From 1154cdc0648a040fa8764cab87071d4f9ce73b69 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Mon, 22 Nov 2021 15:56:04 +0100 Subject: [PATCH] Built motion from commit 64323aab.|2.5.38 --- 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 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/safe-template.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1155 files changed, 1155 insertions(+), 1155 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 020a099..613fdc8 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-11-22T14:20:52.554Z", + "time": "2021-11-22T14:40:59.053Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 23a943e..bcd5528 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-22T14:20:52.554Z", + "time": "2021-11-22T14:40:59.053Z", "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 1104b22..15cfe05 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 _0x60ed=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x335727,_0x21b693){var _0x54692e=function(_0x55a6a2){while(--_0x55a6a2){_0x335727['push'](_0x335727['shift']());}};_0x54692e(++_0x21b693);}(_0x60ed,0x73));var _0xd60e=function(_0x2e1b45,_0x236edf){_0x2e1b45=_0x2e1b45-0x0;var _0x479a04=_0x60ed[_0x2e1b45];return _0x479a04;};'use strict';var Sequelize=require(_0xd60e('0x0'));module[_0xd60e('0x1')]={'name':{'type':Sequelize[_0xd60e('0x2')],'get':function(_0x2f38f6){return this[_0xd60e('0x3')](_0xd60e('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd60e('0x5'),'integration','motionbar','jscripty','urlForward',_0xd60e('0x6'),_0xd60e('0x7'),_0xd60e('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd60e('0x9')},'data1':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comment':_0xd60e('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xd60e('0xc')},'data3':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comment':_0xd60e('0xd')},'data4':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comments':_0xd60e('0xe')},'data5':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comments':_0xd60e('0xf')},'data6':{'type':Sequelize[_0xd60e('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xd60e('0x10')],'comments':_0xd60e('0x11')}}; \ No newline at end of file +var _0x6764=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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','VIRTUAL','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x6764,0x74));var _0x4676=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6764[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4676('0x0')],'get':function(_0xe281d8){return this['getDataValue'](_0x4676('0x1'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x4676('0x2'),_0x4676('0x3'),_0x4676('0x4'),_0x4676('0x5'),_0x4676('0x6'),_0x4676('0x7'),_0x4676('0x8'),_0x4676('0x9')]],'msg':_0x4676('0xa')}},'comment':_0x4676('0xa')},'data1':{'type':Sequelize[_0x4676('0xb')](0x1000),'comment':_0x4676('0xc')},'data2':{'type':Sequelize[_0x4676('0xb')](0x1000),'comment':_0x4676('0xd')},'data3':{'type':Sequelize[_0x4676('0xb')](0x1000),'comment':_0x4676('0xe')},'data4':{'type':Sequelize[_0x4676('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x4676('0xf')},'data6':{'type':Sequelize[_0x4676('0xb')],'comments':_0x4676('0x10')},'data7':{'type':Sequelize[_0x4676('0x11')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 4de386a..4b9d422 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 _0x7b5f=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','update','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x10f77c,_0x5cc257){var _0x262e22=function(_0x5c8e00){while(--_0x5c8e00){_0x10f77c['push'](_0x10f77c['shift']());}};_0x262e22(++_0x5cc257);}(_0x7b5f,0x7e));var _0xf7b5=function(_0x4fe2dd,_0x564590){_0x4fe2dd=_0x4fe2dd-0x0;var _0x48ef25=_0x7b5f[_0x4fe2dd];return _0x48ef25;};'use strict';var emlformat=require(_0xf7b5('0x0'));var rimraf=require(_0xf7b5('0x1'));var zipdir=require(_0xf7b5('0x2'));var jsonpatch=require(_0xf7b5('0x3'));var rp=require(_0xf7b5('0x4'));var moment=require(_0xf7b5('0x5'));var BPromise=require(_0xf7b5('0x6'));var Mustache=require('mustache');var util=require(_0xf7b5('0x7'));var path=require(_0xf7b5('0x8'));var sox=require(_0xf7b5('0x9'));var csv=require(_0xf7b5('0xa'));var ejs=require(_0xf7b5('0xb'));var fs=require('fs');var fs_extra=require(_0xf7b5('0xc'));var _=require('lodash');var squel=require(_0xf7b5('0xd'));var crypto=require(_0xf7b5('0xe'));var jsforce=require(_0xf7b5('0xf'));var deskjs=require(_0xf7b5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf7b5('0x11'));var Papa=require(_0xf7b5('0x12'));var Redis=require(_0xf7b5('0x13'));var authService=require(_0xf7b5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf7b5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7b5('0x16'))(_0xf7b5('0x17'));var utils=require(_0xf7b5('0x18'));var config=require(_0xf7b5('0x19'));var licenseUtil=require(_0xf7b5('0x1a'));var db=require(_0xf7b5('0x1b'))['db'];function respondWithStatusCode(_0x14e01d,_0x590eec){_0x590eec=_0x590eec||0xcc;return function(_0x46badc){if(_0x46badc){return _0x14e01d[_0xf7b5('0x1c')](_0x590eec);}return _0x14e01d[_0xf7b5('0x1d')](_0x590eec)['end']();};}function respondWithResult(_0x8c35a9,_0x1caff9){_0x1caff9=_0x1caff9||0xc8;return function(_0x4a9ce7){if(_0x4a9ce7){return _0x8c35a9[_0xf7b5('0x1d')](_0x1caff9)[_0xf7b5('0x1e')](_0x4a9ce7);}};}function respondWithFilteredResult(_0x3a58a0,_0x44c546){return function(_0x5d1997){if(_0x5d1997){var _0x4d0a11=typeof _0x44c546[_0xf7b5('0x1f')]===_0xf7b5('0x20')&&typeof _0x44c546['limit']===_0xf7b5('0x20');var _0x278e84=_0x5d1997[_0xf7b5('0x21')];var _0x4cdf30=_0x4d0a11?0x0:_0x44c546['offset'];var _0x36094b=_0x4d0a11?_0x5d1997[_0xf7b5('0x21')]:_0x44c546[_0xf7b5('0x1f')]+_0x44c546[_0xf7b5('0x22')];var _0x1d5cee;if(_0x36094b>=_0x278e84){_0x36094b=_0x278e84;_0x1d5cee=0xc8;}else{_0x1d5cee=0xce;}_0x3a58a0[_0xf7b5('0x1d')](_0x1d5cee);return _0x3a58a0[_0xf7b5('0x23')](_0xf7b5('0x24'),_0x4cdf30+'-'+_0x36094b+'/'+_0x278e84)[_0xf7b5('0x1e')](_0x5d1997);}return null;};}function patchUpdates(_0x41147a){return function(_0x402154){try{jsonpatch[_0xf7b5('0x25')](_0x402154,_0x41147a,!![]);}catch(_0x25d17a){return BPromise[_0xf7b5('0x26')](_0x25d17a);}return _0x402154[_0xf7b5('0x27')]();};}function saveUpdates(_0xa597ea,_0xc137b0){return function(_0x31c550){if(_0x31c550){return _0x31c550['update'](_0xa597ea)[_0xf7b5('0x28')](function(_0x12aa97){return _0x12aa97;});}return null;};}function removeEntity(_0x5150cc,_0x41223d){return function(_0x50d372){if(_0x50d372){return _0x50d372['destroy']()[_0xf7b5('0x28')](function(){_0x5150cc[_0xf7b5('0x1d')](0xcc)[_0xf7b5('0x29')]();});}};}function handleEntityNotFound(_0x2f521d,_0x377028){return function(_0x33de99){if(!_0x33de99){_0x2f521d[_0xf7b5('0x1c')](0x194);}return _0x33de99;};}function handleError(_0x176447,_0x1164ab){_0x1164ab=_0x1164ab||0x1f4;return function(_0xd6a3d3){logger[_0xf7b5('0x2a')](_0xd6a3d3[_0xf7b5('0x2b')]);if(_0xd6a3d3[_0xf7b5('0x2c')]){delete _0xd6a3d3[_0xf7b5('0x2c')];}_0x176447[_0xf7b5('0x1d')](_0x1164ab)['send'](_0xd6a3d3);};}exports[_0xf7b5('0x2d')]=function(_0x4f2b64,_0x13dc92){if(_0x4f2b64[_0xf7b5('0x2e')]['id']){delete _0x4f2b64['body']['id'];}return db[_0xf7b5('0x2f')][_0xf7b5('0x30')]({'where':{'id':_0x4f2b64[_0xf7b5('0x31')]['id']}})[_0xf7b5('0x28')](handleEntityNotFound(_0x13dc92,null))[_0xf7b5('0x28')](saveUpdates(_0x4f2b64[_0xf7b5('0x2e')],null))[_0xf7b5('0x28')](respondWithResult(_0x13dc92,null))['catch'](handleError(_0x13dc92,null));};exports[_0xf7b5('0x32')]=function(_0x4c8c67,_0x31cf75){return db[_0xf7b5('0x2f')][_0xf7b5('0x30')]({'where':{'id':_0x4c8c67[_0xf7b5('0x31')]['id']}})[_0xf7b5('0x28')](handleEntityNotFound(_0x31cf75,null))[_0xf7b5('0x28')](removeEntity(_0x31cf75,null))[_0xf7b5('0x33')](handleError(_0x31cf75,null));}; \ No newline at end of file +var _0x00d9=['save','destroy','then','error','stack','name','update','body','find','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','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','status','end','json','offset','limit','undefined','count','set','apply','reject'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x00d9,0xec));var _0x900d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x00d9[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0x900d('0x0'));var rimraf=require(_0x900d('0x1'));var zipdir=require(_0x900d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x900d('0x3'));var moment=require(_0x900d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x900d('0x5'));var util=require(_0x900d('0x6'));var path=require(_0x900d('0x7'));var sox=require(_0x900d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x900d('0x9'));var _=require(_0x900d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x900d('0xb'));var deskjs=require(_0x900d('0xc'));var toCsv=require(_0x900d('0xd'));var querystring=require(_0x900d('0xe'));var Papa=require(_0x900d('0xf'));var Redis=require('ioredis');var authService=require(_0x900d('0x10'));var qs=require(_0x900d('0x11'));var as=require(_0x900d('0x12'));var hardwareService=require(_0x900d('0x13'));var logger=require('../../config/logger')(_0x900d('0x14'));var utils=require(_0x900d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x900d('0x16'));var db=require(_0x900d('0x17'))['db'];function respondWithStatusCode(_0x509cff,_0x25c71f){_0x25c71f=_0x25c71f||0xcc;return function(_0x37b402){if(_0x37b402){return _0x509cff['sendStatus'](_0x25c71f);}return _0x509cff[_0x900d('0x18')](_0x25c71f)[_0x900d('0x19')]();};}function respondWithResult(_0x1da2e,_0x2ff701){_0x2ff701=_0x2ff701||0xc8;return function(_0x3c44e2){if(_0x3c44e2){return _0x1da2e[_0x900d('0x18')](_0x2ff701)[_0x900d('0x1a')](_0x3c44e2);}};}function respondWithFilteredResult(_0x2df02b,_0x57cf30){return function(_0x30ab22){if(_0x30ab22){var _0x20e05f=typeof _0x57cf30[_0x900d('0x1b')]==='undefined'&&typeof _0x57cf30[_0x900d('0x1c')]===_0x900d('0x1d');var _0x2cd4ff=_0x30ab22[_0x900d('0x1e')];var _0x3a658b=_0x20e05f?0x0:_0x57cf30['offset'];var _0xec882d=_0x20e05f?_0x30ab22[_0x900d('0x1e')]:_0x57cf30[_0x900d('0x1b')]+_0x57cf30[_0x900d('0x1c')];var _0x4eb6e5;if(_0xec882d>=_0x2cd4ff){_0xec882d=_0x2cd4ff;_0x4eb6e5=0xc8;}else{_0x4eb6e5=0xce;}_0x2df02b[_0x900d('0x18')](_0x4eb6e5);return _0x2df02b[_0x900d('0x1f')]('Content-Range',_0x3a658b+'-'+_0xec882d+'/'+_0x2cd4ff)[_0x900d('0x1a')](_0x30ab22);}return null;};}function patchUpdates(_0x2b5b3a){return function(_0x32d67a){try{jsonpatch[_0x900d('0x20')](_0x32d67a,_0x2b5b3a,!![]);}catch(_0x42fa8a){return BPromise[_0x900d('0x21')](_0x42fa8a);}return _0x32d67a[_0x900d('0x22')]();};}function saveUpdates(_0x3a0421,_0x21cf0c){return function(_0x16c537){if(_0x16c537){return _0x16c537['update'](_0x3a0421)['then'](function(_0x26474a){return _0x26474a;});}return null;};}function removeEntity(_0x296ba8,_0x4baa7b){return function(_0x534c37){if(_0x534c37){return _0x534c37[_0x900d('0x23')]()[_0x900d('0x24')](function(){_0x296ba8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x178012,_0x1fbff5){return function(_0x2caec0){if(!_0x2caec0){_0x178012['sendStatus'](0x194);}return _0x2caec0;};}function handleError(_0x1a9fad,_0x3be641){_0x3be641=_0x3be641||0x1f4;return function(_0xb7a450){logger[_0x900d('0x25')](_0xb7a450[_0x900d('0x26')]);if(_0xb7a450['name']){delete _0xb7a450[_0x900d('0x27')];}_0x1a9fad[_0x900d('0x18')](_0x3be641)['send'](_0xb7a450);};}exports[_0x900d('0x28')]=function(_0x3b966f,_0x41947d){if(_0x3b966f[_0x900d('0x29')]['id']){delete _0x3b966f['body']['id'];}return db['Action'][_0x900d('0x2a')]({'where':{'id':_0x3b966f['params']['id']}})[_0x900d('0x24')](handleEntityNotFound(_0x41947d,null))[_0x900d('0x24')](saveUpdates(_0x3b966f['body'],null))[_0x900d('0x24')](respondWithResult(_0x41947d,null))[_0x900d('0x2b')](handleError(_0x41947d,null));};exports['destroy']=function(_0xd1ecf1,_0x4ff75d){return db['Action'][_0x900d('0x2a')]({'where':{'id':_0xd1ecf1[_0x900d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4ff75d,null))['then'](removeEntity(_0x4ff75d,null))[_0x900d('0x2b')](handleError(_0x4ff75d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9e99c27..c140ac3 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 _0x00c2=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','Action','tools_actions'];(function(_0x5b2096,_0x213141){var _0x198357=function(_0x5afe77){while(--_0x5afe77){_0x5b2096['push'](_0x5b2096['shift']());}};_0x198357(++_0x213141);}(_0x00c2,0x79));var _0x200c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x00c2[_0x432682];return _0x463d05;};'use strict';var _=require(_0x200c('0x0'));var util=require(_0x200c('0x1'));var logger=require('../../config/logger')(_0x200c('0x2'));var moment=require(_0x200c('0x3'));var BPromise=require(_0x200c('0x4'));var rp=require(_0x200c('0x5'));var fs=require('fs');var path=require(_0x200c('0x6'));var rimraf=require('rimraf');var config=require(_0x200c('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x22ee78,_0x4a10ff){return _0x22ee78[_0x200c('0x8')](_0x200c('0x9'),attributes,{'tableName':_0x200c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74f6=['../../config/environment','./action.attributes','define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b8f4a,_0x30d9f6){var _0x3d84db=function(_0x231607){while(--_0x231607){_0x4b8f4a['push'](_0x4b8f4a['shift']());}};_0x3d84db(++_0x30d9f6);}(_0x74f6,0x1e6));var _0x674f=function(_0x56a4dd,_0x317486){_0x56a4dd=_0x56a4dd-0x0;var _0x40e651=_0x74f6[_0x56a4dd];return _0x40e651;};'use strict';var _=require(_0x674f('0x0'));var util=require('util');var logger=require(_0x674f('0x1'))(_0x674f('0x2'));var moment=require(_0x674f('0x3'));var BPromise=require(_0x674f('0x4'));var rp=require(_0x674f('0x5'));var fs=require('fs');var path=require(_0x674f('0x6'));var rimraf=require(_0x674f('0x7'));var config=require(_0x674f('0x8'));var attributes=require(_0x674f('0x9'));module['exports']=function(_0x2aba7d,_0x502a30){return _0x2aba7d[_0x674f('0xa')](_0x674f('0xb'),attributes,{'tableName':_0x674f('0xc'),'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 6683f56..c7a778e 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5883a9,_0xec68fb){var _0x1dad51=function(_0x5844b5){while(--_0x5844b5){_0x5883a9['push'](_0x5883a9['shift']());}};_0x1dad51(++_0xec68fb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0x7fbe[_0x3a7fe5];return _0x18ed66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x30ec2d,_0x4b8a82){var _0xc29ed8=function(_0x2ef772){while(--_0x2ef772){_0x30ec2d['push'](_0x30ec2d['shift']());}};_0xc29ed8(++_0x4b8a82);}(_0xabce,0x103));var _0xeabc=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xabce[_0x55e08b];return _0xd1a7ff;};'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')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index a0c599f..f6dadfc 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 _0xba06=['isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x512120,_0x1bd7ca){var _0x20b2e3=function(_0x3ac4b6){while(--_0x3ac4b6){_0x512120['push'](_0x512120['shift']());}};_0x20b2e3(++_0x1bd7ca);}(_0xba06,0x1b8));var _0x6ba0=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xba06[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0x6ba0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ba0('0x1'));var express=require(_0x6ba0('0x2'));var router=express['Router']();var fs_extra=require(_0x6ba0('0x3'));var auth=require(_0x6ba0('0x4'));var interaction=require(_0x6ba0('0x5'));var config=require(_0x6ba0('0x6'));var controller=require(_0x6ba0('0x7'));router[_0x6ba0('0x8')](_0x6ba0('0x9'),auth[_0x6ba0('0xa')](),controller[_0x6ba0('0xb')]);router[_0x6ba0('0xc')]('/:id',auth[_0x6ba0('0xa')](),controller[_0x6ba0('0xd')]);module[_0x6ba0('0xe')]=router; \ No newline at end of file +var _0xd58b=['fs-extra','../../components/interaction/service','./action.controller','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2b90dc,_0x10b832){var _0x4794a6=function(_0x3720ca){while(--_0x3720ca){_0x2b90dc['push'](_0x2b90dc['shift']());}};_0x4794a6(++_0x10b832);}(_0xd58b,0x144));var _0xbd58=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xd58b[_0x344a3f];return _0x264712;};'use strict';var multer=require(_0xbd58('0x0'));var util=require(_0xbd58('0x1'));var path=require(_0xbd58('0x2'));var timeout=require(_0xbd58('0x3'));var express=require(_0xbd58('0x4'));var router=express[_0xbd58('0x5')]();var fs_extra=require(_0xbd58('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbd58('0x7'));var config=require('../../config/environment');var controller=require(_0xbd58('0x8'));router[_0xbd58('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbd58('0xa')]);router[_0xbd58('0xb')](_0xbd58('0xc'),auth['isAuthenticated'](),controller[_0xbd58('0xd')]);module[_0xbd58('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8a38ce0..4d9370a 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x2152ba,_0x2c6738){var _0x5a97cc=function(_0x45d812){while(--_0x45d812){_0x2152ba['push'](_0x2152ba['shift']());}};_0x5a97cc(++_0x2c6738);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x3c5cc8,_0x336027){var _0x44675c=function(_0xf9543e){while(--_0xf9543e){_0x3c5cc8['push'](_0x3c5cc8['shift']());}};_0x44675c(++_0x336027);}(_0x814b,0x1a2));var _0xb814=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x814b[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index b8438bc..9d2d4d2 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 _0x8588=['findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parse','includes','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','groupBy','alias','foreignTable','web','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','runReport','MIN(%s)','IS\x20NOT\x20NULL','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric'];(function(_0x1b5d75,_0x2ca173){var _0x510b64=function(_0x437cc8){while(--_0x437cc8){_0x1b5d75['push'](_0x1b5d75['shift']());}};_0x510b64(++_0x2ca173);}(_0x8588,0x185));var _0x8858=function(_0x3032ee,_0xbc5fb4){_0x3032ee=_0x3032ee-0x0;var _0x322ab0=_0x8588[_0x3032ee];return _0x322ab0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8858('0x0'));var zipdir=require(_0x8858('0x1'));var jsonpatch=require(_0x8858('0x2'));var rp=require(_0x8858('0x3'));var moment=require('moment');var BPromise=require(_0x8858('0x4'));var Mustache=require(_0x8858('0x5'));var util=require(_0x8858('0x6'));var path=require('path');var sox=require(_0x8858('0x7'));var csv=require(_0x8858('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8858('0x9'));var _=require(_0x8858('0xa'));var squel=require(_0x8858('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8858('0x8'));var querystring=require('querystring');var Papa=require(_0x8858('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8858('0xd'));var as=require(_0x8858('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8858('0xf'));var utils=require(_0x8858('0x10'));var config=require(_0x8858('0x11'));var licenseUtil=require(_0x8858('0x12'));var db=require(_0x8858('0x13'))['db'];var dbH=require(_0x8858('0x13'))[_0x8858('0x14')];function respondWithStatusCode(_0x3ebff2,_0x25504b){_0x25504b=_0x25504b||0xcc;return function(_0x268387){if(_0x268387){return _0x3ebff2[_0x8858('0x15')](_0x25504b);}return _0x3ebff2[_0x8858('0x16')](_0x25504b)[_0x8858('0x17')]();};}function respondWithResult(_0x424f1d,_0x1b7b6a){_0x1b7b6a=_0x1b7b6a||0xc8;return function(_0x4a9d43){if(_0x4a9d43){return _0x424f1d[_0x8858('0x16')](_0x1b7b6a)['json'](_0x4a9d43);}};}function respondWithFilteredResult(_0x26c0bd,_0x22b356){return function(_0x1cab6a){if(_0x1cab6a){var _0x3b7d14=typeof _0x22b356[_0x8858('0x18')]===_0x8858('0x19')&&typeof _0x22b356[_0x8858('0x1a')]===_0x8858('0x19');var _0x159aab=_0x1cab6a[_0x8858('0x1b')];var _0x5b0880=_0x3b7d14?0x0:_0x22b356[_0x8858('0x18')];var _0x83f44e=_0x3b7d14?_0x1cab6a[_0x8858('0x1b')]:_0x22b356[_0x8858('0x18')]+_0x22b356[_0x8858('0x1a')];var _0x1b8208;if(_0x83f44e>=_0x159aab){_0x83f44e=_0x159aab;_0x1b8208=0xc8;}else{_0x1b8208=0xce;}_0x26c0bd[_0x8858('0x16')](_0x1b8208);return _0x26c0bd[_0x8858('0x1c')](_0x8858('0x1d'),_0x5b0880+'-'+_0x83f44e+'/'+_0x159aab)[_0x8858('0x1e')](_0x1cab6a);}return null;};}function patchUpdates(_0x2b3786){return function(_0x30f607){try{jsonpatch[_0x8858('0x1f')](_0x30f607,_0x2b3786,!![]);}catch(_0x169487){return BPromise['reject'](_0x169487);}return _0x30f607['save']();};}function saveUpdates(_0x1e7ee,_0x48e402){return function(_0x147d9b){if(_0x147d9b){return _0x147d9b[_0x8858('0x20')](_0x1e7ee)[_0x8858('0x21')](function(_0x580fcb){return _0x580fcb;});}return null;};}function removeEntity(_0x4d7267,_0x4caccb){return function(_0x1a6672){if(_0x1a6672){return _0x1a6672[_0x8858('0x22')]()[_0x8858('0x21')](function(){var _0x11e03d=_0x1a6672['get']({'plain':!![]});var _0x113e0c=_0x8858('0x23');return db[_0x8858('0x24')][_0x8858('0x22')]({'where':{'type':_0x113e0c,'resourceId':_0x11e03d['id']}})[_0x8858('0x21')](function(){return _0x1a6672;});})[_0x8858('0x21')](function(){_0x4d7267[_0x8858('0x16')](0xcc)[_0x8858('0x17')]();});}};}function handleEntityNotFound(_0x341685,_0x1520d3){return function(_0x539596){if(!_0x539596){_0x341685[_0x8858('0x15')](0x194);}return _0x539596;};}function handleError(_0x4e2459,_0x3f9191){_0x3f9191=_0x3f9191||0x1f4;return function(_0x2fa4f9){logger[_0x8858('0x25')](_0x2fa4f9[_0x8858('0x26')]);if(_0x2fa4f9[_0x8858('0x27')]){delete _0x2fa4f9['name'];}_0x4e2459[_0x8858('0x16')](_0x3f9191)['send'](_0x2fa4f9);};}exports[_0x8858('0x28')]=function(_0x48fff3,_0x642830){var _0x4f00f8={},_0x4a0ea1={},_0x2cb8d7={'count':0x0,'rows':[]};var _0x48b09b=_[_0x8858('0x29')](db[_0x8858('0x2a')][_0x8858('0x2b')],function(_0x23ef02){return{'name':_0x23ef02[_0x8858('0x2c')],'type':_0x23ef02['type'][_0x8858('0x2d')]};});_0x4a0ea1['model']=_['map'](_0x48b09b,_0x8858('0x27'));_0x4a0ea1[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x48fff3[_0x8858('0x2e')]);_0x4a0ea1['filters']=_[_0x8858('0x30')](_0x4a0ea1[_0x8858('0x31')],_0x4a0ea1[_0x8858('0x2e')]);_0x4f00f8[_0x8858('0x32')]=_[_0x8858('0x30')](_0x4a0ea1[_0x8858('0x31')],qs[_0x8858('0x33')](_0x48fff3[_0x8858('0x2e')][_0x8858('0x33')]));_0x4f00f8[_0x8858('0x32')]=_0x4f00f8[_0x8858('0x32')][_0x8858('0x34')]?_0x4f00f8[_0x8858('0x32')]:_0x4a0ea1[_0x8858('0x31')];if(!_0x48fff3[_0x8858('0x2e')][_0x8858('0x35')](_0x8858('0x36'))){_0x4f00f8['limit']=qs['limit'](_0x48fff3[_0x8858('0x2e')][_0x8858('0x1a')]);_0x4f00f8['offset']=qs[_0x8858('0x18')](_0x48fff3[_0x8858('0x2e')][_0x8858('0x18')]);}_0x4f00f8['order']=qs['sort'](_0x48fff3['query'][_0x8858('0x37')]);_0x4f00f8[_0x8858('0x38')]=qs[_0x8858('0x39')](_[_0x8858('0x3a')](_0x48fff3['query'],_0x4a0ea1[_0x8858('0x39')]),_0x48b09b);if(_0x48fff3[_0x8858('0x2e')][_0x8858('0x3b')]){_0x4f00f8[_0x8858('0x38')]=_['merge'](_0x4f00f8[_0x8858('0x38')],{'$or':_[_0x8858('0x29')](_0x48b09b,function(_0x395e07){if(_0x395e07[_0x8858('0x3c')]!==_0x8858('0x3d')){var _0x5b9049={};_0x5b9049[_0x395e07[_0x8858('0x27')]]={'$like':'%'+_0x48fff3[_0x8858('0x2e')][_0x8858('0x3b')]+'%'};return _0x5b9049;}})});}_0x4f00f8=_[_0x8858('0x3e')]({},_0x4f00f8,_0x48fff3[_0x8858('0x3f')]);var _0x1dc20b={'where':_0x4f00f8[_0x8858('0x38')]};return db[_0x8858('0x2a')][_0x8858('0x1b')](_0x1dc20b)['then'](function(_0x3e8e06){_0x2cb8d7[_0x8858('0x1b')]=_0x3e8e06;if(_0x48fff3[_0x8858('0x2e')][_0x8858('0x40')]){_0x4f00f8['include']=[{'all':!![]}];}return db[_0x8858('0x2a')]['findAll'](_0x4f00f8);})['then'](function(_0x40e7a8){_0x2cb8d7[_0x8858('0x41')]=_0x40e7a8;return _0x2cb8d7;})[_0x8858('0x21')](respondWithFilteredResult(_0x642830,_0x4f00f8))[_0x8858('0x42')](handleError(_0x642830,null));};exports[_0x8858('0x43')]=function(_0x578757,_0x1fe047){var _0x4b42b8={'raw':![],'where':{'id':_0x578757[_0x8858('0x44')]['id']}},_0x4d4be3={};_0x4d4be3[_0x8858('0x31')]=_[_0x8858('0x2f')](db[_0x8858('0x2a')][_0x8858('0x2b')]);_0x4d4be3[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x578757[_0x8858('0x2e')]);_0x4d4be3[_0x8858('0x39')]=_[_0x8858('0x30')](_0x4d4be3[_0x8858('0x31')],_0x4d4be3[_0x8858('0x2e')]);_0x4b42b8[_0x8858('0x32')]=_[_0x8858('0x30')](_0x4d4be3[_0x8858('0x31')],qs[_0x8858('0x33')](_0x578757[_0x8858('0x2e')]['fields']));_0x4b42b8[_0x8858('0x32')]=_0x4b42b8[_0x8858('0x32')]['length']?_0x4b42b8[_0x8858('0x32')]:_0x4d4be3['model'];if(_0x578757[_0x8858('0x2e')][_0x8858('0x40')]){_0x4b42b8[_0x8858('0x45')]=[{'all':!![]}];}_0x4b42b8=_['merge']({},_0x4b42b8,_0x578757[_0x8858('0x3f')]);return db['AnalyticCustomReport']['find'](_0x4b42b8)[_0x8858('0x21')](handleEntityNotFound(_0x1fe047,null))[_0x8858('0x21')](respondWithResult(_0x1fe047,null))[_0x8858('0x42')](handleError(_0x1fe047,null));};exports[_0x8858('0x46')]=function(_0x5156c1,_0x435140){return db[_0x8858('0x2a')][_0x8858('0x46')](_0x5156c1['body'],{})['then'](function(_0x4143b2){var _0x15d86f=_0x5156c1[_0x8858('0x47')][_0x8858('0x48')]({'plain':!![]});if(!_0x15d86f)throw new Error(_0x8858('0x49'));if(_0x15d86f['role']===_0x8858('0x47')){var _0x5ebd23=_0x4143b2[_0x8858('0x48')]({'plain':!![]});var _0x3a25c5=_0x8858('0x4a');return db[_0x8858('0x4b')][_0x8858('0x4c')]({'where':{'name':_0x3a25c5,'userProfileId':_0x15d86f[_0x8858('0x4d')]},'raw':!![]})[_0x8858('0x21')](function(_0x44684b){if(_0x44684b&&_0x44684b[_0x8858('0x4e')]===0x0){return db[_0x8858('0x24')][_0x8858('0x46')]({'name':_0x5ebd23[_0x8858('0x27')],'resourceId':_0x5ebd23['id'],'type':'CustomReports','sectionId':_0x44684b['id']},{})[_0x8858('0x21')](function(){return _0x4143b2;});}else{return _0x4143b2;}})[_0x8858('0x42')](function(_0x575fda){logger[_0x8858('0x25')](_0x8858('0x4f'),_0x575fda);throw _0x575fda;});}return _0x4143b2;})[_0x8858('0x21')](respondWithResult(_0x435140,0xc9))[_0x8858('0x42')](handleError(_0x435140,null));};exports[_0x8858('0x20')]=function(_0x4515cf,_0x188f2e){if(_0x4515cf[_0x8858('0x50')]['id']){delete _0x4515cf[_0x8858('0x50')]['id'];}return db[_0x8858('0x2a')][_0x8858('0x4c')]({'where':{'id':_0x4515cf[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x188f2e,null))[_0x8858('0x21')](saveUpdates(_0x4515cf[_0x8858('0x50')],null))[_0x8858('0x21')](respondWithResult(_0x188f2e,null))['catch'](handleError(_0x188f2e,null));};exports[_0x8858('0x22')]=function(_0xe47b4d,_0x439e55){return db['AnalyticCustomReport'][_0x8858('0x4c')]({'where':{'id':_0xe47b4d[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x439e55,null))[_0x8858('0x21')](removeEntity(_0x439e55,null))[_0x8858('0x42')](handleError(_0x439e55,null));};exports[_0x8858('0x51')]=function(_0x4a5f86,_0x33d00a){var _0x251970=0xa;var _0x21a9ec=[_0x8858('0x52'),_0x8858('0x53'),_0x8858('0x54'),'cross_join'];var _0x11dfcd={'SUM':'SUM(%s)','COUNT':_0x8858('0x55'),'COUNT DISTINCT':_0x8858('0x56'),'MAX':_0x8858('0x57'),'MIN':'MIN(%s)','AVG':_0x8858('0x58'),'GROUP_CONCAT':_0x8858('0x59'),'GROUP_CONCAT ASC':_0x8858('0x5a'),'GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x33ce08={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':_0x8858('0x5f')};var _0x28bfae=function(_0x9f66c2){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8858('0x60'),_0x8858('0x61')],_0x9f66c2);};var _0x2abac8=function(_0x239e73){if(!_0x239e73||!_0x239e73['rules']['length']){return'';}for(var _0x59137d='(',_0x410c73=0x0;_0x410c73<_0x239e73[_0x8858('0x62')]['length'];_0x410c73+=0x1){_0x410c73>0x0&&(_0x59137d+='\x20'+_0x239e73[_0x8858('0x63')]+'\x20');_0x59137d+=_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x64')]?_0x2abac8(_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x64')]):_0x239e73['rules'][_0x410c73][_0x8858('0x65')]+'\x20'+_0x239e73['rules'][_0x410c73][_0x8858('0x66')]+(_0x28bfae(_0x239e73['rules'][_0x410c73][_0x8858('0x66')])?'\x20'+_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x67')]:'');}return _0x59137d+')';};var _0xab7b6={'where':{'id':_0x4a5f86['params']['id']}},_0x225a27,_0x37b71c,_0x429d4e,_0x313575,_0x46d689;_0xab7b6=_['merge']({},_0xab7b6,_0x4a5f86['options']);return db['AnalyticCustomReport'][_0x8858('0x4c')](_0xab7b6)[_0x8858('0x21')](function(_0x24593a){if(_0x24593a){_0x225a27=_0x24593a;return _0x24593a[_0x8858('0x68')]();}return null;})[_0x8858('0x21')](function(_0x21b10b){if(_0x21b10b){if(!_0x21b10b[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))][(_0x8858('0x6a'))](_0x8858('0x6b'),0x193);}_0x37b71c=_0x21b10b;return db[_0x8858('0x6c')][_0x8858('0x6d')]({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x4dbe59){if(_0x4dbe59){_0x429d4e=_[_0x8858('0x6e')](_0x4dbe59,'id');var _0x183d52;var _0x3af3c9=squel[_0x8858('0x6f')]();_0x3af3c9[_0x8858('0x70')](_0x225a27[_0x8858('0x71')]);for(var _0x3b391f=0x0;_0x3b391f<_0x37b71c['length'];_0x3b391f+=0x1){_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x72')]?_0x429d4e[_0x37b71c[_0x3b391f][_0x8858('0x72')]][_0x8858('0x73')]:_0x37b71c[_0x3b391f][_0x8858('0x65')];_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x74')]?_[_0x8858('0x75')](_0x11dfcd[_0x37b71c[_0x3b391f][_0x8858('0x74')]],'%s',_0x183d52):_0x183d52;_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x76')]?_[_0x8858('0x75')](_0x33ce08[_0x37b71c[_0x3b391f]['format']],'%s',_0x183d52):_0x183d52;if(_0x37b71c[_0x3b391f]['groupBy']){_0x3af3c9['group'](_0x183d52);}_0x37b71c[_0x3b391f][_0x8858('0x77')]&&_0x3af3c9[_0x8858('0x78')](_0x183d52,_0x37b71c[_0x3b391f]['orderBy']===_0x8858('0x79')?![]:!![]);_0x3af3c9['field'](_0x183d52,_0x37b71c[_0x3b391f]['alias']||_0x183d52);}if(_0x225a27[_0x8858('0x7a')]){_0x225a27['joins']=JSON[_0x8858('0x7b')](_0x225a27['joins']);for(var _0x11ffe5=0x0;_0x11ffe5<_0x225a27[_0x8858('0x7a')]['length'];_0x11ffe5+=0x1){if(_0x225a27['joins'][_0x11ffe5][_0x8858('0x3c')]&&_[_0x8858('0x7c')](_0x21a9ec,_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x3c')])&&_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7d')]&&_0x225a27['joins'][_0x11ffe5]['foreignTable']&&_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7e')]){_0x3af3c9[_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x3c')]](_0x225a27[_0x8858('0x7a')][_0x11ffe5]['foreignTable'],null,util[_0x8858('0x76')](_0x8858('0x7f'),_0x225a27['table'],_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7d')],_0x225a27[_0x8858('0x7a')][_0x11ffe5]['foreignTable'],_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7e')]));}}}if(_0x225a27['conditions']){_0x225a27[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x225a27[_0x8858('0x80')]);_0x3af3c9[_0x8858('0x38')](_0x2abac8(_0x225a27['conditions']['group']));}_0x46d689=_0x3af3c9[_0x8858('0x81')]();_0x3af3c9['limit'](_0x251970);_0x3af3c9['offset'](0x0);logger[_0x8858('0x82')](_0x8858('0x83'),_0x3af3c9[_0x8858('0x84')]());return dbH[_0x8858('0x85')]['query'](_0x3af3c9[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')]['QueryTypes'][_0x8858('0x86')]});}})[_0x8858('0x21')](respondWithResult(_0x33d00a,null))[_0x8858('0x42')](handleError(_0x33d00a,null));};function runReport(_0x35f0b1,_0x15bb94,_0x49cbd6){var _0x1a2abe=_0x15bb94['name'];var _0x11c9ba=0xa;var _0x537a3c=[_0x8858('0x52'),_0x8858('0x53'),'right_join',_0x8858('0x87')];var _0x3f37c2={'SUM':_0x8858('0x88'),'COUNT':_0x8858('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8858('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8858('0x59'),'GROUP_CONCAT ASC':_0x8858('0x5a'),'GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x8286de={'SEC_TO_TIME':_0x8858('0x89'),'DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':_0x8858('0x5f')};var _0x53da63=function(_0x10ed5f){return!_[_0x8858('0x7c')]([_0x8858('0x8a'),'IS\x20NOT\x20NULL',_0x8858('0x60'),_0x8858('0x61')],_0x10ed5f);};var _0x49b73f=function(_0x162f5d){if(!_0x162f5d||!_0x162f5d[_0x8858('0x62')][_0x8858('0x34')]){return'';}for(var _0x4c6a3b='(',_0x57ad82=0x0;_0x57ad82<_0x162f5d[_0x8858('0x62')][_0x8858('0x34')];_0x57ad82+=0x1){_0x57ad82>0x0&&(_0x4c6a3b+='\x20'+_0x162f5d[_0x8858('0x63')]+'\x20');_0x4c6a3b+=_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x64')]?_0x49b73f(_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x64')]):_0x162f5d['rules'][_0x57ad82]['field']+'\x20'+_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x66')]+(_0x53da63(_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x66')])?'\x20'+_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x67')]:'');}return _0x4c6a3b+')';};var _0xda3d62={'where':{'id':_0x35f0b1['id']}},_0x42dfe2,_0x4cc804,_0x11ff22,_0x1b0d75,_0x4661e8;_0xda3d62=_[_0x8858('0x3e')]({},_0xda3d62,_0x49cbd6);return db[_0x8858('0x2a')][_0x8858('0x4c')](_0xda3d62)[_0x8858('0x21')](function(_0x50185b){if(_0x50185b){_0x42dfe2=_0x50185b;return _0x50185b['getFields']();}return null;})[_0x8858('0x21')](function(_0x4970a2){if(_0x4970a2){if(!_0x4970a2[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))]['ValidationErrorItem'](_0x8858('0x6b'),0x193);}_0x4cc804=_0x4970a2;return db['AnalyticMetric'][_0x8858('0x6d')]({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x1853f7){if(_0x1853f7){_0x11ff22=_['keyBy'](_0x1853f7,'id');var _0x21d1e2;var _0x463303=squel[_0x8858('0x6f')]();_0x463303[_0x8858('0x70')](_0x42dfe2[_0x8858('0x71')]);for(var _0x4aac5d=0x0;_0x4aac5d<_0x4cc804[_0x8858('0x34')];_0x4aac5d+=0x1){_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x72')]?_0x11ff22[_0x4cc804[_0x4aac5d][_0x8858('0x72')]][_0x8858('0x73')]:_0x4cc804[_0x4aac5d][_0x8858('0x65')];_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x74')]?_[_0x8858('0x75')](_0x3f37c2[_0x4cc804[_0x4aac5d][_0x8858('0x74')]],'%s',_0x21d1e2):_0x21d1e2;_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x76')]?_[_0x8858('0x75')](_0x8286de[_0x4cc804[_0x4aac5d][_0x8858('0x76')]],'%s',_0x21d1e2):_0x21d1e2;if(_0x4cc804[_0x4aac5d][_0x8858('0x8b')]){_0x463303[_0x8858('0x64')](_0x21d1e2);}_0x4cc804[_0x4aac5d][_0x8858('0x77')]&&_0x463303[_0x8858('0x78')](_0x21d1e2,_0x4cc804[_0x4aac5d][_0x8858('0x77')]===_0x8858('0x79')?![]:!![]);_0x463303[_0x8858('0x65')](_0x21d1e2,_0x4cc804[_0x4aac5d][_0x8858('0x8c')]||_0x21d1e2);}if(_0x42dfe2[_0x8858('0x7a')]){_0x42dfe2['joins']=JSON['parse'](_0x42dfe2['joins']);for(var _0x4283e0=0x0;_0x4283e0<_0x42dfe2[_0x8858('0x7a')][_0x8858('0x34')];_0x4283e0+=0x1){if(_0x42dfe2['joins'][_0x4283e0][_0x8858('0x3c')]&&_[_0x8858('0x7c')](_0x537a3c,_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x3c')])&&_0x42dfe2['joins'][_0x4283e0][_0x8858('0x7d')]&&_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')]&&_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x7e')]){_0x463303[_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x3c')]](_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')],null,util[_0x8858('0x76')]('%s.%s\x20=\x20%s.%s',_0x42dfe2[_0x8858('0x71')],_0x42dfe2[_0x8858('0x7a')][_0x4283e0]['parentKey'],_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')],_0x42dfe2['joins'][_0x4283e0][_0x8858('0x7e')]));}}}if(_0x42dfe2[_0x8858('0x80')]){_0x42dfe2[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x42dfe2[_0x8858('0x80')]);_0x463303[_0x8858('0x38')](_0x49b73f(_0x42dfe2[_0x8858('0x80')]['group']));}_0x4661e8=_0x463303[_0x8858('0x81')]();_0x463303[_0x8858('0x1a')](_0x11c9ba);_0x463303['offset'](0x0);return;}})[_0x8858('0x21')](function(){if(_0x15bb94['output']===_0x8858('0x8e')){return null;}var _0x50f0be=_[_0x8858('0x3e')](_0x15bb94,{'name':_0x15bb94['fullPath']||_0x15bb94[_0x8858('0x27')]||_0x42dfe2[_0x8858('0x27')],'basename':_0x1a2abe,'savename':util['format'](_0x8858('0x8f'),_0x15bb94['name']||_0x42dfe2[_0x8858('0x27')],require(_0x8858('0x90'))[_0x8858('0x91')](0x4),_0x15bb94[_0x8858('0x92')]||_0x8858('0x93')),'reportId':_0x42dfe2['id'],'reportType':'custom'});return db[_0x8858('0x94')][_0x8858('0x46')](_0x50f0be,{'raw':!![]});})[_0x8858('0x21')](function(_0x52cc8e){if(_0x42dfe2[_0x8858('0x71')]===_0x8858('0x95')){_0x4661e8[_0x8858('0x38')](_0x42dfe2[_0x8858('0x71')]+_0x8858('0x96'),_0x15bb94[_0x8858('0x97')],_0x15bb94[_0x8858('0x98')]);}else{_0x4661e8[_0x8858('0x38')](_0x42dfe2[_0x8858('0x71')]+_0x8858('0x99'),_0x15bb94[_0x8858('0x97')],_0x15bb94['endDate']);}if(_0x52cc8e){logger[_0x8858('0x9a')](_0x8858('0x9b'),_0x4661e8[_0x8858('0x84')]());require(_0x8858('0x9c'))['fork'](path[_0x8858('0x52')](__dirname,_0x8858('0x9d'),_0x52cc8e[_0x8858('0x92')]),[_0x52cc8e['id'],_0x4661e8[_0x8858('0x84')](),path['join'](__dirname,_0x8858('0x9e'),_0x52cc8e[_0x8858('0x9f')]),_0x1a2abe]);return _0x52cc8e;}else{var _0x2f0e31=squel[_0x8858('0x6f')]();_0x2f0e31[_0x8858('0x70')]('('+_0x4661e8[_0x8858('0x84')]()+')',_0x8858('0xa0'));_0x2f0e31[_0x8858('0x65')](_0x8858('0xa1'),_0x8858('0x1b'));_0x4661e8['limit'](_0x15bb94[_0x8858('0x1a')]||_0x11c9ba);_0x4661e8[_0x8858('0x18')](_0x15bb94['offset']||0x0);return dbH[_0x8858('0x85')]['query'](_0x2f0e31[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')][_0x8858('0xa2')][_0x8858('0x86')]})[_0x8858('0x21')](function(_0x512265){if(!_0x512265['length']){_0x1b0d75=0x0;}else{_0x1b0d75=_0x512265[0x0]['count']||0x0;}return dbH['sequelize'][_0x8858('0x2e')](_0x4661e8[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')][_0x8858('0xa2')][_0x8858('0x86')]});})['then'](function(_0xc1c3c4){return{'rows':_0xc1c3c4||[],'count':_0x1b0d75};});}});}exports['run']=function(_0x3fca7b,_0x24c820){return runReport(_0x3fca7b[_0x8858('0x44')],_0x3fca7b[_0x8858('0x2e')],_0x3fca7b['options'])[_0x8858('0x21')](respondWithResult(_0x24c820,null))['catch'](handleError(_0x24c820,null));};exports[_0x8858('0xa3')]=runReport;exports[_0x8858('0x2e')]=function(_0x27d9de,_0x32e1b0){var _0x488611=0xa;var _0x169e36=[_0x8858('0x52'),_0x8858('0x53'),'right_join',_0x8858('0x87')];var _0xb165f0={'SUM':'SUM(%s)','COUNT':_0x8858('0x55'),'COUNT DISTINCT':_0x8858('0x56'),'MAX':_0x8858('0x57'),'MIN':_0x8858('0xa4'),'AVG':_0x8858('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x50e8bc={'SEC_TO_TIME':_0x8858('0x89'),'DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1aea97=function(_0x12cae1){return!_['includes']([_0x8858('0x8a'),_0x8858('0xa5'),_0x8858('0x60'),_0x8858('0x61')],_0x12cae1);};var _0x2eb95e=function(_0x2f3a38){if(!_0x2f3a38||!_0x2f3a38[_0x8858('0x62')][_0x8858('0x34')]){return'';}for(var _0x127fcd='(',_0x50a06b=0x0;_0x50a06b<_0x2f3a38[_0x8858('0x62')][_0x8858('0x34')];_0x50a06b+=0x1){_0x50a06b>0x0&&(_0x127fcd+='\x20'+_0x2f3a38[_0x8858('0x63')]+'\x20');_0x127fcd+=_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x64')]?_0x2eb95e(_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x64')]):_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x65')]+'\x20'+_0x2f3a38['rules'][_0x50a06b][_0x8858('0x66')]+(_0x1aea97(_0x2f3a38['rules'][_0x50a06b][_0x8858('0x66')])?'\x20'+_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x67')]:'');}return _0x127fcd+')';};var _0x94cec0={'where':{'id':_0x27d9de[_0x8858('0x44')]['id']}},_0x1ee78b,_0x587766,_0x3b65a8,_0x4c21d7,_0x5e8cd7;_0x94cec0=_[_0x8858('0x3e')]({},_0x94cec0,_0x27d9de['options']);return db['AnalyticCustomReport'][_0x8858('0x4c')](_0x94cec0)[_0x8858('0x21')](function(_0x29159a){if(_0x29159a){_0x1ee78b=_0x29159a;return _0x29159a[_0x8858('0x68')]();}return null;})[_0x8858('0x21')](function(_0x1a51fa){if(_0x1a51fa){if(!_0x1a51fa[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))]['ValidationErrorItem'](_0x8858('0x6b'),0x193);}_0x587766=_0x1a51fa;return db[_0x8858('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x3734e0){if(_0x3734e0){_0x3b65a8=_['keyBy'](_0x3734e0,'id');var _0xefc581;var _0x4dbcc8=squel[_0x8858('0x6f')]();_0x4dbcc8[_0x8858('0x70')](_0x1ee78b[_0x8858('0x71')]);for(var _0x4fbf18=0x0;_0x4fbf18<_0x587766[_0x8858('0x34')];_0x4fbf18+=0x1){_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x72')]?_0x3b65a8[_0x587766[_0x4fbf18][_0x8858('0x72')]][_0x8858('0x73')]:_0x587766[_0x4fbf18][_0x8858('0x65')];_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x74')]?_[_0x8858('0x75')](_0xb165f0[_0x587766[_0x4fbf18][_0x8858('0x74')]],'%s',_0xefc581):_0xefc581;_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x76')]?_['replace'](_0x50e8bc[_0x587766[_0x4fbf18][_0x8858('0x76')]],'%s',_0xefc581):_0xefc581;if(_0x587766[_0x4fbf18][_0x8858('0x8b')]){_0x4dbcc8[_0x8858('0x64')](_0xefc581);}_0x587766[_0x4fbf18][_0x8858('0x77')]&&_0x4dbcc8[_0x8858('0x78')](_0xefc581,_0x587766[_0x4fbf18][_0x8858('0x77')]===_0x8858('0x79')?![]:!![]);_0x4dbcc8[_0x8858('0x65')](_0xefc581,_0x587766[_0x4fbf18]['alias']||_0xefc581);}if(_0x1ee78b[_0x8858('0x7a')]){_0x1ee78b[_0x8858('0x7a')]=JSON[_0x8858('0x7b')](_0x1ee78b[_0x8858('0x7a')]);for(var _0x309311=0x0;_0x309311<_0x1ee78b['joins'][_0x8858('0x34')];_0x309311+=0x1){if(_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')]&&_['includes'](_0x169e36,_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')])&&_0x1ee78b['joins'][_0x309311][_0x8858('0x7d')]&&_0x1ee78b['joins'][_0x309311][_0x8858('0x8d')]&&_0x1ee78b[_0x8858('0x7a')][_0x309311]['foreignKey']){_0x4dbcc8[_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')]](_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x8d')],null,util[_0x8858('0x76')]('%s.%s\x20=\x20%s.%s',_0x1ee78b['table'],_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x7d')],_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x8d')],_0x1ee78b['joins'][_0x309311][_0x8858('0x7e')]));}}}if(_0x1ee78b[_0x8858('0x80')]){_0x1ee78b[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x1ee78b[_0x8858('0x80')]);_0x4dbcc8[_0x8858('0x38')](_0x2eb95e(_0x1ee78b[_0x8858('0x80')]['group']));}_0x5e8cd7=_0x4dbcc8[_0x8858('0x81')]();_0x4dbcc8[_0x8858('0x1a')](_0x488611);_0x4dbcc8[_0x8858('0x18')](0x0);logger[_0x8858('0x82')]('Limited\x20Query:',_0x4dbcc8['toString']());return dbH[_0x8858('0x85')]['query'](_0x4dbcc8[_0x8858('0x84')](),{'type':dbH['sequelize'][_0x8858('0xa2')][_0x8858('0x86')]});}})[_0x8858('0x21')](function(){return{'sql':_0x5e8cd7[_0x8858('0x84')]()};})[_0x8858('0x21')](respondWithResult(_0x32e1b0,null))['catch'](handleError(_0x32e1b0,null));}; \ No newline at end of file +var _0xb3a3=['../../mysqldb','dbH','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','CustomReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','getFields','Sequelize','groupBy','includes','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','startDate','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','count','QueryTypes','run','runReport','ROUND(%s)','IS\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x61a318,_0x2c4216){var _0x1ba549=function(_0x2329f0){while(--_0x2329f0){_0x61a318['push'](_0x61a318['shift']());}};_0x1ba549(++_0x2c4216);}(_0xb3a3,0x90));var _0x3b3a=function(_0x2dee3b,_0x2e6193){_0x2dee3b=_0x2dee3b-0x0;var _0x13fd41=_0xb3a3[_0x2dee3b];return _0x13fd41;};'use strict';var emlformat=require(_0x3b3a('0x0'));var rimraf=require(_0x3b3a('0x1'));var zipdir=require(_0x3b3a('0x2'));var jsonpatch=require(_0x3b3a('0x3'));var rp=require('request-promise');var moment=require(_0x3b3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b3a('0x5'));var util=require(_0x3b3a('0x6'));var path=require(_0x3b3a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b3a('0x8'));var fs=require('fs');var fs_extra=require(_0x3b3a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b3a('0xa'));var jsforce=require(_0x3b3a('0xb'));var deskjs=require(_0x3b3a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3b3a('0xd'));var Papa=require(_0x3b3a('0xe'));var Redis=require(_0x3b3a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b3a('0x10'));var as=require(_0x3b3a('0x11'));var hardwareService=require(_0x3b3a('0x12'));var logger=require(_0x3b3a('0x13'))(_0x3b3a('0x14'));var utils=require(_0x3b3a('0x15'));var config=require(_0x3b3a('0x16'));var licenseUtil=require(_0x3b3a('0x17'));var db=require(_0x3b3a('0x18'))['db'];var dbH=require(_0x3b3a('0x18'))[_0x3b3a('0x19')];function respondWithStatusCode(_0x2f9c00,_0x1832b3){_0x1832b3=_0x1832b3||0xcc;return function(_0x12b432){if(_0x12b432){return _0x2f9c00['sendStatus'](_0x1832b3);}return _0x2f9c00[_0x3b3a('0x1a')](_0x1832b3)[_0x3b3a('0x1b')]();};}function respondWithResult(_0x341301,_0x3ceee8){_0x3ceee8=_0x3ceee8||0xc8;return function(_0x3fc2ce){if(_0x3fc2ce){return _0x341301[_0x3b3a('0x1a')](_0x3ceee8)[_0x3b3a('0x1c')](_0x3fc2ce);}};}function respondWithFilteredResult(_0x16c062,_0x5e4dee){return function(_0x3dbafd){if(_0x3dbafd){var _0x3c818c=typeof _0x5e4dee[_0x3b3a('0x1d')]===_0x3b3a('0x1e')&&typeof _0x5e4dee[_0x3b3a('0x1f')]==='undefined';var _0x468ae5=_0x3dbafd['count'];var _0x6e98b2=_0x3c818c?0x0:_0x5e4dee[_0x3b3a('0x1d')];var _0x33a4ff=_0x3c818c?_0x3dbafd['count']:_0x5e4dee[_0x3b3a('0x1d')]+_0x5e4dee['limit'];var _0x53b591;if(_0x33a4ff>=_0x468ae5){_0x33a4ff=_0x468ae5;_0x53b591=0xc8;}else{_0x53b591=0xce;}_0x16c062[_0x3b3a('0x1a')](_0x53b591);return _0x16c062[_0x3b3a('0x20')](_0x3b3a('0x21'),_0x6e98b2+'-'+_0x33a4ff+'/'+_0x468ae5)['json'](_0x3dbafd);}return null;};}function patchUpdates(_0x3f5988){return function(_0x5e3d43){try{jsonpatch[_0x3b3a('0x22')](_0x5e3d43,_0x3f5988,!![]);}catch(_0x577357){return BPromise[_0x3b3a('0x23')](_0x577357);}return _0x5e3d43[_0x3b3a('0x24')]();};}function saveUpdates(_0x142bd5,_0x5f2f14){return function(_0xa820dd){if(_0xa820dd){return _0xa820dd[_0x3b3a('0x25')](_0x142bd5)[_0x3b3a('0x26')](function(_0x3657a8){return _0x3657a8;});}return null;};}function removeEntity(_0x142326,_0x4d809e){return function(_0x47e99b){if(_0x47e99b){return _0x47e99b['destroy']()[_0x3b3a('0x26')](function(){var _0x1d1760=_0x47e99b['get']({'plain':!![]});var _0x2739a5=_0x3b3a('0x27');return db[_0x3b3a('0x28')][_0x3b3a('0x29')]({'where':{'type':_0x2739a5,'resourceId':_0x1d1760['id']}})[_0x3b3a('0x26')](function(){return _0x47e99b;});})[_0x3b3a('0x26')](function(){_0x142326[_0x3b3a('0x1a')](0xcc)[_0x3b3a('0x1b')]();});}};}function handleEntityNotFound(_0x1c4ee0,_0x36a983){return function(_0x561e38){if(!_0x561e38){_0x1c4ee0[_0x3b3a('0x2a')](0x194);}return _0x561e38;};}function handleError(_0x22a96b,_0x5e2cdc){_0x5e2cdc=_0x5e2cdc||0x1f4;return function(_0x4b5375){logger[_0x3b3a('0x2b')](_0x4b5375['stack']);if(_0x4b5375[_0x3b3a('0x2c')]){delete _0x4b5375[_0x3b3a('0x2c')];}_0x22a96b['status'](_0x5e2cdc)[_0x3b3a('0x2d')](_0x4b5375);};}exports[_0x3b3a('0x2e')]=function(_0x2a6799,_0x5d2aee){var _0x1ea597={},_0xbfc1cc={},_0x16d70a={'count':0x0,'rows':[]};var _0x1d639c=_[_0x3b3a('0x2f')](db[_0x3b3a('0x30')][_0x3b3a('0x31')],function(_0x442313){return{'name':_0x442313['fieldName'],'type':_0x442313[_0x3b3a('0x32')][_0x3b3a('0x33')]};});_0xbfc1cc['model']=_[_0x3b3a('0x2f')](_0x1d639c,_0x3b3a('0x2c'));_0xbfc1cc['query']=_[_0x3b3a('0x34')](_0x2a6799['query']);_0xbfc1cc['filters']=_[_0x3b3a('0x35')](_0xbfc1cc[_0x3b3a('0x36')],_0xbfc1cc[_0x3b3a('0x37')]);_0x1ea597[_0x3b3a('0x38')]=_['intersection'](_0xbfc1cc[_0x3b3a('0x36')],qs[_0x3b3a('0x39')](_0x2a6799['query']['fields']));_0x1ea597[_0x3b3a('0x38')]=_0x1ea597[_0x3b3a('0x38')][_0x3b3a('0x3a')]?_0x1ea597[_0x3b3a('0x38')]:_0xbfc1cc[_0x3b3a('0x36')];if(!_0x2a6799[_0x3b3a('0x37')][_0x3b3a('0x3b')]('nolimit')){_0x1ea597['limit']=qs[_0x3b3a('0x1f')](_0x2a6799['query'][_0x3b3a('0x1f')]);_0x1ea597[_0x3b3a('0x1d')]=qs['offset'](_0x2a6799['query'][_0x3b3a('0x1d')]);}_0x1ea597[_0x3b3a('0x3c')]=qs[_0x3b3a('0x3d')](_0x2a6799['query'][_0x3b3a('0x3d')]);_0x1ea597[_0x3b3a('0x3e')]=qs['filters'](_[_0x3b3a('0x3f')](_0x2a6799[_0x3b3a('0x37')],_0xbfc1cc[_0x3b3a('0x40')]),_0x1d639c);if(_0x2a6799[_0x3b3a('0x37')][_0x3b3a('0x41')]){_0x1ea597[_0x3b3a('0x3e')]=_[_0x3b3a('0x42')](_0x1ea597[_0x3b3a('0x3e')],{'$or':_[_0x3b3a('0x2f')](_0x1d639c,function(_0x3e32f0){if(_0x3e32f0[_0x3b3a('0x32')]!==_0x3b3a('0x43')){var _0x5d4e14={};_0x5d4e14[_0x3e32f0['name']]={'$like':'%'+_0x2a6799['query'][_0x3b3a('0x41')]+'%'};return _0x5d4e14;}})});}_0x1ea597=_[_0x3b3a('0x42')]({},_0x1ea597,_0x2a6799['options']);var _0x5f35d2={'where':_0x1ea597['where']};return db[_0x3b3a('0x30')]['count'](_0x5f35d2)['then'](function(_0x4e4c92){_0x16d70a['count']=_0x4e4c92;if(_0x2a6799[_0x3b3a('0x37')][_0x3b3a('0x44')]){_0x1ea597[_0x3b3a('0x45')]=[{'all':!![]}];}return db[_0x3b3a('0x30')]['findAll'](_0x1ea597);})['then'](function(_0x2af71c){_0x16d70a[_0x3b3a('0x46')]=_0x2af71c;return _0x16d70a;})[_0x3b3a('0x26')](respondWithFilteredResult(_0x5d2aee,_0x1ea597))[_0x3b3a('0x47')](handleError(_0x5d2aee,null));};exports[_0x3b3a('0x48')]=function(_0x18ff71,_0x1c962f){var _0x574d3c={'raw':![],'where':{'id':_0x18ff71['params']['id']}},_0x12f67e={};_0x12f67e['model']=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x12f67e['query']=_[_0x3b3a('0x34')](_0x18ff71[_0x3b3a('0x37')]);_0x12f67e['filters']=_[_0x3b3a('0x35')](_0x12f67e[_0x3b3a('0x36')],_0x12f67e[_0x3b3a('0x37')]);_0x574d3c[_0x3b3a('0x38')]=_[_0x3b3a('0x35')](_0x12f67e[_0x3b3a('0x36')],qs[_0x3b3a('0x39')](_0x18ff71[_0x3b3a('0x37')]['fields']));_0x574d3c[_0x3b3a('0x38')]=_0x574d3c['attributes']['length']?_0x574d3c['attributes']:_0x12f67e[_0x3b3a('0x36')];if(_0x18ff71[_0x3b3a('0x37')]['includeAll']){_0x574d3c[_0x3b3a('0x45')]=[{'all':!![]}];}_0x574d3c=_[_0x3b3a('0x42')]({},_0x574d3c,_0x18ff71[_0x3b3a('0x49')]);return db[_0x3b3a('0x30')][_0x3b3a('0x4a')](_0x574d3c)[_0x3b3a('0x26')](handleEntityNotFound(_0x1c962f,null))[_0x3b3a('0x26')](respondWithResult(_0x1c962f,null))[_0x3b3a('0x47')](handleError(_0x1c962f,null));};exports[_0x3b3a('0x4b')]=function(_0x3492c0,_0x4dde4){return db['AnalyticCustomReport'][_0x3b3a('0x4b')](_0x3492c0[_0x3b3a('0x4c')],{})['then'](function(_0x16e1cd){var _0x25e0c0=_0x3492c0[_0x3b3a('0x4d')][_0x3b3a('0x4e')]({'plain':!![]});if(!_0x25e0c0)throw new Error(_0x3b3a('0x4f'));if(_0x25e0c0[_0x3b3a('0x50')]===_0x3b3a('0x4d')){var _0x36af6e=_0x16e1cd[_0x3b3a('0x4e')]({'plain':!![]});var _0x1e2bce=_0x3b3a('0x51');return db[_0x3b3a('0x52')][_0x3b3a('0x4a')]({'where':{'name':_0x1e2bce,'userProfileId':_0x25e0c0[_0x3b3a('0x53')]},'raw':!![]})[_0x3b3a('0x26')](function(_0x229a33){if(_0x229a33&&_0x229a33[_0x3b3a('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x36af6e[_0x3b3a('0x2c')],'resourceId':_0x36af6e['id'],'type':_0x3b3a('0x27'),'sectionId':_0x229a33['id']},{})[_0x3b3a('0x26')](function(){return _0x16e1cd;});}else{return _0x16e1cd;}})[_0x3b3a('0x47')](function(_0x481c97){logger[_0x3b3a('0x2b')](_0x3b3a('0x55'),_0x481c97);throw _0x481c97;});}return _0x16e1cd;})[_0x3b3a('0x26')](respondWithResult(_0x4dde4,0xc9))[_0x3b3a('0x47')](handleError(_0x4dde4,null));};exports[_0x3b3a('0x25')]=function(_0x44e440,_0x4a0533){if(_0x44e440[_0x3b3a('0x4c')]['id']){delete _0x44e440['body']['id'];}return db[_0x3b3a('0x30')][_0x3b3a('0x4a')]({'where':{'id':_0x44e440['params']['id']}})[_0x3b3a('0x26')](handleEntityNotFound(_0x4a0533,null))[_0x3b3a('0x26')](saveUpdates(_0x44e440[_0x3b3a('0x4c')],null))[_0x3b3a('0x26')](respondWithResult(_0x4a0533,null))[_0x3b3a('0x47')](handleError(_0x4a0533,null));};exports[_0x3b3a('0x29')]=function(_0x46e8a9,_0x730600){return db['AnalyticCustomReport'][_0x3b3a('0x4a')]({'where':{'id':_0x46e8a9[_0x3b3a('0x56')]['id']}})[_0x3b3a('0x26')](handleEntityNotFound(_0x730600,null))['then'](removeEntity(_0x730600,null))[_0x3b3a('0x47')](handleError(_0x730600,null));};exports[_0x3b3a('0x57')]=function(_0x334dd0,_0x3100d3){var _0x236d5a=0xa;var _0x5ae89a=['join',_0x3b3a('0x58'),_0x3b3a('0x59'),_0x3b3a('0x5a')];var _0x240388={'SUM':_0x3b3a('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3b3a('0x5c'),'MAX':_0x3b3a('0x5d'),'MIN':_0x3b3a('0x5e'),'AVG':_0x3b3a('0x5f'),'GROUP_CONCAT':_0x3b3a('0x60'),'GROUP_CONCAT ASC':_0x3b3a('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xd5615d={'SEC_TO_TIME':_0x3b3a('0x62'),'DATE':'DATE(%s)','HOUR':_0x3b3a('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3b3a('0x64')};var _0x4fa402=function(_0x13990c){return!_['includes'](['IS\x20NULL',_0x3b3a('0x65'),_0x3b3a('0x66'),_0x3b3a('0x67')],_0x13990c);};var _0x1f6d89=function(_0x1a16e8){if(!_0x1a16e8||!_0x1a16e8['rules'][_0x3b3a('0x3a')]){return'';}for(var _0x3391e1='(',_0x1c04f5=0x0;_0x1c04f5<_0x1a16e8[_0x3b3a('0x68')][_0x3b3a('0x3a')];_0x1c04f5+=0x1){_0x1c04f5>0x0&&(_0x3391e1+='\x20'+_0x1a16e8[_0x3b3a('0x69')]+'\x20');_0x3391e1+=_0x1a16e8['rules'][_0x1c04f5][_0x3b3a('0x6a')]?_0x1f6d89(_0x1a16e8[_0x3b3a('0x68')][_0x1c04f5][_0x3b3a('0x6a')]):_0x1a16e8[_0x3b3a('0x68')][_0x1c04f5][_0x3b3a('0x6b')]+'\x20'+_0x1a16e8[_0x3b3a('0x68')][_0x1c04f5][_0x3b3a('0x6c')]+(_0x4fa402(_0x1a16e8[_0x3b3a('0x68')][_0x1c04f5]['condition'])?'\x20'+_0x1a16e8[_0x3b3a('0x68')][_0x1c04f5][_0x3b3a('0x6d')]:'');}return _0x3391e1+')';};var _0x2be713={'where':{'id':_0x334dd0[_0x3b3a('0x56')]['id']}},_0x454611,_0x4dc428,_0x47b8e5,_0x2185ac,_0x2392b0;_0x2be713=_[_0x3b3a('0x42')]({},_0x2be713,_0x334dd0[_0x3b3a('0x49')]);return db['AnalyticCustomReport'][_0x3b3a('0x4a')](_0x2be713)['then'](function(_0x2d99ce){if(_0x2d99ce){_0x454611=_0x2d99ce;return _0x2d99ce['getFields']();}return null;})['then'](function(_0x36b2e2){if(_0x36b2e2){if(!_0x36b2e2[_0x3b3a('0x3a')]){throw new db['Sequelize'][(_0x3b3a('0x6e'))](_0x3b3a('0x6f'),0x193);}_0x4dc428=_0x36b2e2;return db[_0x3b3a('0x70')]['findAll']({'raw':!![]});}return null;})[_0x3b3a('0x26')](function(_0x2aa671){if(_0x2aa671){_0x47b8e5=_[_0x3b3a('0x71')](_0x2aa671,'id');var _0x17c5f0;var _0xe235e1=squel[_0x3b3a('0x72')]();_0xe235e1[_0x3b3a('0x73')](_0x454611[_0x3b3a('0x74')]);for(var _0x9b9b81=0x0;_0x9b9b81<_0x4dc428[_0x3b3a('0x3a')];_0x9b9b81+=0x1){_0x17c5f0=_0x4dc428[_0x9b9b81][_0x3b3a('0x75')]?_0x47b8e5[_0x4dc428[_0x9b9b81][_0x3b3a('0x75')]][_0x3b3a('0x76')]:_0x4dc428[_0x9b9b81][_0x3b3a('0x6b')];_0x17c5f0=_0x4dc428[_0x9b9b81]['function']?_['replace'](_0x240388[_0x4dc428[_0x9b9b81][_0x3b3a('0x77')]],'%s',_0x17c5f0):_0x17c5f0;_0x17c5f0=_0x4dc428[_0x9b9b81][_0x3b3a('0x78')]?_[_0x3b3a('0x79')](_0xd5615d[_0x4dc428[_0x9b9b81][_0x3b3a('0x78')]],'%s',_0x17c5f0):_0x17c5f0;if(_0x4dc428[_0x9b9b81]['groupBy']){_0xe235e1[_0x3b3a('0x6a')](_0x17c5f0);}_0x4dc428[_0x9b9b81]['orderBy']&&_0xe235e1[_0x3b3a('0x3c')](_0x17c5f0,_0x4dc428[_0x9b9b81][_0x3b3a('0x7a')]===_0x3b3a('0x7b')?![]:!![]);_0xe235e1[_0x3b3a('0x6b')](_0x17c5f0,_0x4dc428[_0x9b9b81][_0x3b3a('0x7c')]||_0x17c5f0);}if(_0x454611[_0x3b3a('0x7d')]){_0x454611[_0x3b3a('0x7d')]=JSON[_0x3b3a('0x7e')](_0x454611[_0x3b3a('0x7d')]);for(var _0xfa89de=0x0;_0xfa89de<_0x454611['joins'][_0x3b3a('0x3a')];_0xfa89de+=0x1){if(_0x454611[_0x3b3a('0x7d')][_0xfa89de][_0x3b3a('0x32')]&&_['includes'](_0x5ae89a,_0x454611['joins'][_0xfa89de][_0x3b3a('0x32')])&&_0x454611[_0x3b3a('0x7d')][_0xfa89de][_0x3b3a('0x7f')]&&_0x454611[_0x3b3a('0x7d')][_0xfa89de][_0x3b3a('0x80')]&&_0x454611['joins'][_0xfa89de][_0x3b3a('0x81')]){_0xe235e1[_0x454611[_0x3b3a('0x7d')][_0xfa89de][_0x3b3a('0x32')]](_0x454611[_0x3b3a('0x7d')][_0xfa89de][_0x3b3a('0x80')],null,util[_0x3b3a('0x78')](_0x3b3a('0x82'),_0x454611[_0x3b3a('0x74')],_0x454611[_0x3b3a('0x7d')][_0xfa89de]['parentKey'],_0x454611['joins'][_0xfa89de]['foreignTable'],_0x454611[_0x3b3a('0x7d')][_0xfa89de][_0x3b3a('0x81')]));}}}if(_0x454611[_0x3b3a('0x83')]){_0x454611[_0x3b3a('0x83')]=JSON[_0x3b3a('0x7e')](_0x454611[_0x3b3a('0x83')]);_0xe235e1['where'](_0x1f6d89(_0x454611['conditions'][_0x3b3a('0x6a')]));}_0x2392b0=_0xe235e1[_0x3b3a('0x84')]();_0xe235e1['limit'](_0x236d5a);_0xe235e1[_0x3b3a('0x1d')](0x0);logger[_0x3b3a('0x85')](_0x3b3a('0x86'),_0xe235e1[_0x3b3a('0x87')]());return dbH[_0x3b3a('0x88')][_0x3b3a('0x37')](_0xe235e1[_0x3b3a('0x87')](),{'type':dbH[_0x3b3a('0x88')]['QueryTypes'][_0x3b3a('0x89')]});}})[_0x3b3a('0x26')](respondWithResult(_0x3100d3,null))[_0x3b3a('0x47')](handleError(_0x3100d3,null));};function runReport(_0xa0f7,_0x253bdb,_0x24a03e){var _0x216b96=_0x253bdb['name'];var _0x10c6f7=0xa;var _0xf90379=[_0x3b3a('0x8a'),'left_join','right_join',_0x3b3a('0x5a')];var _0x29ef03={'SUM':_0x3b3a('0x5b'),'COUNT':_0x3b3a('0x8b'),'COUNT DISTINCT':_0x3b3a('0x5c'),'MAX':_0x3b3a('0x5d'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x3b3a('0x60'),'GROUP_CONCAT ASC':_0x3b3a('0x61'),'GROUP_CONCAT DESC':_0x3b3a('0x8c')};var _0x11712b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3b3a('0x8d'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3b3a('0x64')};var _0x43c94f=function(_0x1c038b){return!_['includes'](['IS\x20NULL',_0x3b3a('0x65'),_0x3b3a('0x66'),_0x3b3a('0x67')],_0x1c038b);};var _0x546449=function(_0x1fecef){if(!_0x1fecef||!_0x1fecef[_0x3b3a('0x68')][_0x3b3a('0x3a')]){return'';}for(var _0xcc519d='(',_0x18d578=0x0;_0x18d578<_0x1fecef['rules'][_0x3b3a('0x3a')];_0x18d578+=0x1){_0x18d578>0x0&&(_0xcc519d+='\x20'+_0x1fecef[_0x3b3a('0x69')]+'\x20');_0xcc519d+=_0x1fecef[_0x3b3a('0x68')][_0x18d578][_0x3b3a('0x6a')]?_0x546449(_0x1fecef[_0x3b3a('0x68')][_0x18d578][_0x3b3a('0x6a')]):_0x1fecef['rules'][_0x18d578][_0x3b3a('0x6b')]+'\x20'+_0x1fecef[_0x3b3a('0x68')][_0x18d578]['condition']+(_0x43c94f(_0x1fecef[_0x3b3a('0x68')][_0x18d578]['condition'])?'\x20'+_0x1fecef[_0x3b3a('0x68')][_0x18d578]['value']:'');}return _0xcc519d+')';};var _0x15cb32={'where':{'id':_0xa0f7['id']}},_0x5c0974,_0x114a7d,_0x3a41f0,_0x23a26b,_0x5e8ebd;_0x15cb32=_[_0x3b3a('0x42')]({},_0x15cb32,_0x24a03e);return db[_0x3b3a('0x30')][_0x3b3a('0x4a')](_0x15cb32)[_0x3b3a('0x26')](function(_0x482a33){if(_0x482a33){_0x5c0974=_0x482a33;return _0x482a33[_0x3b3a('0x8e')]();}return null;})[_0x3b3a('0x26')](function(_0x2b1045){if(_0x2b1045){if(!_0x2b1045['length']){throw new db[(_0x3b3a('0x8f'))][(_0x3b3a('0x6e'))](_0x3b3a('0x6f'),0x193);}_0x114a7d=_0x2b1045;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3b3a('0x26')](function(_0x480cb8){if(_0x480cb8){_0x3a41f0=_[_0x3b3a('0x71')](_0x480cb8,'id');var _0x3e02d5;var _0x126751=squel[_0x3b3a('0x72')]();_0x126751[_0x3b3a('0x73')](_0x5c0974[_0x3b3a('0x74')]);for(var _0x51bf8b=0x0;_0x51bf8b<_0x114a7d[_0x3b3a('0x3a')];_0x51bf8b+=0x1){_0x3e02d5=_0x114a7d[_0x51bf8b][_0x3b3a('0x75')]?_0x3a41f0[_0x114a7d[_0x51bf8b][_0x3b3a('0x75')]]['metric']:_0x114a7d[_0x51bf8b][_0x3b3a('0x6b')];_0x3e02d5=_0x114a7d[_0x51bf8b][_0x3b3a('0x77')]?_['replace'](_0x29ef03[_0x114a7d[_0x51bf8b][_0x3b3a('0x77')]],'%s',_0x3e02d5):_0x3e02d5;_0x3e02d5=_0x114a7d[_0x51bf8b][_0x3b3a('0x78')]?_[_0x3b3a('0x79')](_0x11712b[_0x114a7d[_0x51bf8b][_0x3b3a('0x78')]],'%s',_0x3e02d5):_0x3e02d5;if(_0x114a7d[_0x51bf8b][_0x3b3a('0x90')]){_0x126751[_0x3b3a('0x6a')](_0x3e02d5);}_0x114a7d[_0x51bf8b]['orderBy']&&_0x126751[_0x3b3a('0x3c')](_0x3e02d5,_0x114a7d[_0x51bf8b]['orderBy']===_0x3b3a('0x7b')?![]:!![]);_0x126751['field'](_0x3e02d5,_0x114a7d[_0x51bf8b][_0x3b3a('0x7c')]||_0x3e02d5);}if(_0x5c0974[_0x3b3a('0x7d')]){_0x5c0974[_0x3b3a('0x7d')]=JSON[_0x3b3a('0x7e')](_0x5c0974[_0x3b3a('0x7d')]);for(var _0x2d59b7=0x0;_0x2d59b7<_0x5c0974[_0x3b3a('0x7d')]['length'];_0x2d59b7+=0x1){if(_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x32')]&&_[_0x3b3a('0x91')](_0xf90379,_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x32')])&&_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x7f')]&&_0x5c0974['joins'][_0x2d59b7][_0x3b3a('0x80')]&&_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x81')]){_0x126751[_0x5c0974['joins'][_0x2d59b7][_0x3b3a('0x32')]](_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x80')],null,util[_0x3b3a('0x78')](_0x3b3a('0x82'),_0x5c0974['table'],_0x5c0974['joins'][_0x2d59b7][_0x3b3a('0x7f')],_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x80')],_0x5c0974[_0x3b3a('0x7d')][_0x2d59b7][_0x3b3a('0x81')]));}}}if(_0x5c0974[_0x3b3a('0x83')]){_0x5c0974[_0x3b3a('0x83')]=JSON[_0x3b3a('0x7e')](_0x5c0974[_0x3b3a('0x83')]);_0x126751[_0x3b3a('0x3e')](_0x546449(_0x5c0974[_0x3b3a('0x83')][_0x3b3a('0x6a')]));}_0x5e8ebd=_0x126751['clone']();_0x126751[_0x3b3a('0x1f')](_0x10c6f7);_0x126751[_0x3b3a('0x1d')](0x0);return;}})[_0x3b3a('0x26')](function(){if(_0x253bdb[_0x3b3a('0x92')]===_0x3b3a('0x93')){return null;}var _0x5bb037=_[_0x3b3a('0x42')](_0x253bdb,{'name':_0x253bdb['fullPath']||_0x253bdb[_0x3b3a('0x2c')]||_0x5c0974[_0x3b3a('0x2c')],'basename':_0x216b96,'savename':util[_0x3b3a('0x78')](_0x3b3a('0x94'),_0x253bdb[_0x3b3a('0x2c')]||_0x5c0974[_0x3b3a('0x2c')],require(_0x3b3a('0x95'))[_0x3b3a('0x96')](0x4),_0x253bdb['output']||_0x3b3a('0x97')),'reportId':_0x5c0974['id'],'reportType':_0x3b3a('0x98')});return db['AnalyticExtractedReport'][_0x3b3a('0x4b')](_0x5bb037,{'raw':!![]});})[_0x3b3a('0x26')](function(_0x4274f8){if(_0x5c0974['table']===_0x3b3a('0x99')){_0x5e8ebd[_0x3b3a('0x3e')](_0x5c0974[_0x3b3a('0x74')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x253bdb['startDate'],_0x253bdb['endDate']);}else{_0x5e8ebd[_0x3b3a('0x3e')](_0x5c0974[_0x3b3a('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x253bdb[_0x3b3a('0x9a')],_0x253bdb['endDate']);}if(_0x4274f8){logger[_0x3b3a('0x9b')]('Run\x20Query:',_0x5e8ebd[_0x3b3a('0x87')]());require(_0x3b3a('0x9c'))[_0x3b3a('0x9d')](path[_0x3b3a('0x8a')](__dirname,_0x3b3a('0x9e'),_0x4274f8[_0x3b3a('0x92')]),[_0x4274f8['id'],_0x5e8ebd['toString'](),path[_0x3b3a('0x8a')](__dirname,_0x3b3a('0x9f'),_0x4274f8['savename']),_0x216b96]);return _0x4274f8;}else{var _0x11fec5=squel[_0x3b3a('0x72')]();_0x11fec5[_0x3b3a('0x73')]('('+_0x5e8ebd[_0x3b3a('0x87')]()+')',_0x3b3a('0xa0'));_0x11fec5[_0x3b3a('0x6b')](_0x3b3a('0xa1'),_0x3b3a('0xa2'));_0x5e8ebd['limit'](_0x253bdb[_0x3b3a('0x1f')]||_0x10c6f7);_0x5e8ebd[_0x3b3a('0x1d')](_0x253bdb[_0x3b3a('0x1d')]||0x0);return dbH[_0x3b3a('0x88')][_0x3b3a('0x37')](_0x11fec5[_0x3b3a('0x87')](),{'type':dbH[_0x3b3a('0x88')][_0x3b3a('0xa3')][_0x3b3a('0x89')]})['then'](function(_0x4bfb03){if(!_0x4bfb03[_0x3b3a('0x3a')]){_0x23a26b=0x0;}else{_0x23a26b=_0x4bfb03[0x0][_0x3b3a('0xa2')]||0x0;}return dbH[_0x3b3a('0x88')][_0x3b3a('0x37')](_0x5e8ebd['toString'](),{'type':dbH[_0x3b3a('0x88')][_0x3b3a('0xa3')][_0x3b3a('0x89')]});})['then'](function(_0x1b6391){return{'rows':_0x1b6391||[],'count':_0x23a26b};});}});}exports[_0x3b3a('0xa4')]=function(_0x12541c,_0x58a147){return runReport(_0x12541c[_0x3b3a('0x56')],_0x12541c[_0x3b3a('0x37')],_0x12541c[_0x3b3a('0x49')])[_0x3b3a('0x26')](respondWithResult(_0x58a147,null))[_0x3b3a('0x47')](handleError(_0x58a147,null));};exports[_0x3b3a('0xa5')]=runReport;exports['query']=function(_0x9d69d9,_0x4296ed){var _0x452f8a=0xa;var _0x357b77=[_0x3b3a('0x8a'),_0x3b3a('0x58'),'right_join',_0x3b3a('0x5a')];var _0x25d8fe={'SUM':'SUM(%s)','COUNT':_0x3b3a('0x8b'),'COUNT DISTINCT':_0x3b3a('0x5c'),'MAX':'MAX(%s)','MIN':_0x3b3a('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3b3a('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3b3a('0x8c')};var _0x5c7f60={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x3b3a('0x63'),'ROUND':_0x3b3a('0xa6'),'UNIX_TIMESTAMP':_0x3b3a('0x64')};var _0x42ecf6=function(_0x4df31d){return!_[_0x3b3a('0x91')]([_0x3b3a('0xa7'),'IS\x20NOT\x20NULL',_0x3b3a('0x66'),'IS\x20NOT\x20EMPTY'],_0x4df31d);};var _0x3f8781=function(_0x56ab0d){if(!_0x56ab0d||!_0x56ab0d['rules'][_0x3b3a('0x3a')]){return'';}for(var _0x2583d1='(',_0x6dbd56=0x0;_0x6dbd56<_0x56ab0d[_0x3b3a('0x68')][_0x3b3a('0x3a')];_0x6dbd56+=0x1){_0x6dbd56>0x0&&(_0x2583d1+='\x20'+_0x56ab0d[_0x3b3a('0x69')]+'\x20');_0x2583d1+=_0x56ab0d[_0x3b3a('0x68')][_0x6dbd56][_0x3b3a('0x6a')]?_0x3f8781(_0x56ab0d[_0x3b3a('0x68')][_0x6dbd56][_0x3b3a('0x6a')]):_0x56ab0d[_0x3b3a('0x68')][_0x6dbd56]['field']+'\x20'+_0x56ab0d['rules'][_0x6dbd56][_0x3b3a('0x6c')]+(_0x42ecf6(_0x56ab0d['rules'][_0x6dbd56]['condition'])?'\x20'+_0x56ab0d['rules'][_0x6dbd56][_0x3b3a('0x6d')]:'');}return _0x2583d1+')';};var _0x100171={'where':{'id':_0x9d69d9[_0x3b3a('0x56')]['id']}},_0x52b5a0,_0x577cbc,_0x4fbd0c,_0x5234a0,_0x18e75e;_0x100171=_[_0x3b3a('0x42')]({},_0x100171,_0x9d69d9[_0x3b3a('0x49')]);return db[_0x3b3a('0x30')][_0x3b3a('0x4a')](_0x100171)[_0x3b3a('0x26')](function(_0x4ddd96){if(_0x4ddd96){_0x52b5a0=_0x4ddd96;return _0x4ddd96[_0x3b3a('0x8e')]();}return null;})[_0x3b3a('0x26')](function(_0xa3e995){if(_0xa3e995){if(!_0xa3e995[_0x3b3a('0x3a')]){throw new db['Sequelize'][(_0x3b3a('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x577cbc=_0xa3e995;return db[_0x3b3a('0x70')]['findAll']({'raw':!![]});}return null;})[_0x3b3a('0x26')](function(_0x9fe53){if(_0x9fe53){_0x4fbd0c=_[_0x3b3a('0x71')](_0x9fe53,'id');var _0x52f1c1;var _0x23118a=squel[_0x3b3a('0x72')]();_0x23118a['from'](_0x52b5a0[_0x3b3a('0x74')]);for(var _0x27e4b9=0x0;_0x27e4b9<_0x577cbc[_0x3b3a('0x3a')];_0x27e4b9+=0x1){_0x52f1c1=_0x577cbc[_0x27e4b9][_0x3b3a('0x75')]?_0x4fbd0c[_0x577cbc[_0x27e4b9]['MetricId']][_0x3b3a('0x76')]:_0x577cbc[_0x27e4b9]['field'];_0x52f1c1=_0x577cbc[_0x27e4b9][_0x3b3a('0x77')]?_['replace'](_0x25d8fe[_0x577cbc[_0x27e4b9][_0x3b3a('0x77')]],'%s',_0x52f1c1):_0x52f1c1;_0x52f1c1=_0x577cbc[_0x27e4b9]['format']?_[_0x3b3a('0x79')](_0x5c7f60[_0x577cbc[_0x27e4b9][_0x3b3a('0x78')]],'%s',_0x52f1c1):_0x52f1c1;if(_0x577cbc[_0x27e4b9][_0x3b3a('0x90')]){_0x23118a[_0x3b3a('0x6a')](_0x52f1c1);}_0x577cbc[_0x27e4b9]['orderBy']&&_0x23118a[_0x3b3a('0x3c')](_0x52f1c1,_0x577cbc[_0x27e4b9][_0x3b3a('0x7a')]===_0x3b3a('0x7b')?![]:!![]);_0x23118a[_0x3b3a('0x6b')](_0x52f1c1,_0x577cbc[_0x27e4b9][_0x3b3a('0x7c')]||_0x52f1c1);}if(_0x52b5a0['joins']){_0x52b5a0[_0x3b3a('0x7d')]=JSON['parse'](_0x52b5a0['joins']);for(var _0x58ba62=0x0;_0x58ba62<_0x52b5a0[_0x3b3a('0x7d')][_0x3b3a('0x3a')];_0x58ba62+=0x1){if(_0x52b5a0['joins'][_0x58ba62]['type']&&_[_0x3b3a('0x91')](_0x357b77,_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x32')])&&_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62]['parentKey']&&_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x80')]&&_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x81')]){_0x23118a[_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x32')]](_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x80')],null,util[_0x3b3a('0x78')](_0x3b3a('0x82'),_0x52b5a0['table'],_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x7f')],_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x80')],_0x52b5a0[_0x3b3a('0x7d')][_0x58ba62][_0x3b3a('0x81')]));}}}if(_0x52b5a0['conditions']){_0x52b5a0[_0x3b3a('0x83')]=JSON[_0x3b3a('0x7e')](_0x52b5a0[_0x3b3a('0x83')]);_0x23118a['where'](_0x3f8781(_0x52b5a0[_0x3b3a('0x83')]['group']));}_0x18e75e=_0x23118a[_0x3b3a('0x84')]();_0x23118a[_0x3b3a('0x1f')](_0x452f8a);_0x23118a['offset'](0x0);logger[_0x3b3a('0x85')](_0x3b3a('0x86'),_0x23118a['toString']());return dbH['sequelize'][_0x3b3a('0x37')](_0x23118a[_0x3b3a('0x87')](),{'type':dbH[_0x3b3a('0x88')]['QueryTypes'][_0x3b3a('0x89')]});}})['then'](function(){return{'sql':_0x18e75e[_0x3b3a('0x87')]()};})[_0x3b3a('0x26')](respondWithResult(_0x4296ed,null))[_0x3b3a('0x47')](handleError(_0x4296ed,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index ca38cfd..5835dbe 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 _0x9ea5=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','../../config/logger','moment','bluebird','request-promise'];(function(_0x30bbd4,_0x5c703e){var _0x559cb2=function(_0x54b3fe){while(--_0x54b3fe){_0x30bbd4['push'](_0x30bbd4['shift']());}};_0x559cb2(++_0x5c703e);}(_0x9ea5,0x100));var _0x59ea=function(_0xd13772,_0x5636d1){_0xd13772=_0xd13772-0x0;var _0x2d80f1=_0x9ea5[_0xd13772];return _0x2d80f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x59ea('0x0'))('api');var moment=require(_0x59ea('0x1'));var BPromise=require(_0x59ea('0x2'));var rp=require(_0x59ea('0x3'));var fs=require('fs');var path=require(_0x59ea('0x4'));var rimraf=require(_0x59ea('0x5'));var config=require('../../config/environment');var attributes=require(_0x59ea('0x6'));module[_0x59ea('0x7')]=function(_0x49e534,_0x12fda9){return _0x49e534[_0x59ea('0x8')](_0x59ea('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5bc=['define','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2b4659,_0x4655d7){var _0x35badd=function(_0x29d3a5){while(--_0x29d3a5){_0x2b4659['push'](_0x2b4659['shift']());}};_0x35badd(++_0x4655d7);}(_0xc5bc,0xc0));var _0xcc5b=function(_0x12ca4f,_0x469017){_0x12ca4f=_0x12ca4f-0x0;var _0x3d746a=_0xc5bc[_0x12ca4f];return _0x3d746a;};'use strict';var _=require(_0xcc5b('0x0'));var util=require(_0xcc5b('0x1'));var logger=require(_0xcc5b('0x2'))(_0xcc5b('0x3'));var moment=require('moment');var BPromise=require(_0xcc5b('0x4'));var rp=require(_0xcc5b('0x5'));var fs=require('fs');var path=require(_0xcc5b('0x6'));var rimraf=require('rimraf');var config=require(_0xcc5b('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x25d1bb,_0x14962d){return _0x25d1bb[_0xcc5b('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xcc5b('0x9'),'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 d189d47..9566a51 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 _0x23aa=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x23aa,0x179));var _0xa23a=function(_0x53485a,_0x587f3f){_0x53485a=_0x53485a-0x0;var _0x448d36=_0x23aa[_0x53485a];return _0x448d36;};'use strict';var _=require(_0xa23a('0x0'));var util=require('util');var moment=require(_0xa23a('0x1'));var BPromise=require(_0xa23a('0x2'));var rs=require(_0xa23a('0x3'));var fs=require('fs');var Redis=require(_0xa23a('0x4'));var db=require(_0xa23a('0x5'))['db'];var utils=require(_0xa23a('0x6'));var logger=require(_0xa23a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa23a('0x8')][_0xa23a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8f6d,_0x5400d3,_0x56cec7){return new BPromise(function(_0x3685ec,_0x4763e1){return client[_0xa23a('0xa')](_0x3d8f6d,_0x56cec7)[_0xa23a('0xb')](function(_0x262cf1){logger[_0xa23a('0xc')](_0xa23a('0xd'),_0x5400d3,'request\x20sent');logger[_0xa23a('0xe')](_0xa23a('0xf'),_0x5400d3,_0xa23a('0x10'),JSON[_0xa23a('0x11')](_0x262cf1));if(_0x262cf1[_0xa23a('0x12')]){if(_0x262cf1[_0xa23a('0x12')][_0xa23a('0x13')]===0x1f4){logger[_0xa23a('0x12')](_0xa23a('0xd'),_0x5400d3,_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);return _0x4763e1(_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5400d3,_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);return _0x3685ec(_0x262cf1[_0xa23a('0x12')]['message']);}else{logger[_0xa23a('0xc')](_0xa23a('0xd'),_0x5400d3,_0xa23a('0x10'));_0x3685ec(_0x262cf1[_0xa23a('0x15')][_0xa23a('0x14')]);}})[_0xa23a('0x16')](function(_0x271604){logger[_0xa23a('0x12')](_0xa23a('0xd'),_0x5400d3,_0x271604);_0x4763e1(_0x271604);});});} \ No newline at end of file +var _0x8387=['http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x196e1b,_0x55fa06){var _0x5e1f18=function(_0x3bdb41){while(--_0x3bdb41){_0x196e1b['push'](_0x196e1b['shift']());}};_0x5e1f18(++_0x55fa06);}(_0x8387,0x6c));var _0x7838=function(_0x226198,_0x4bb033){_0x226198=_0x226198-0x0;var _0x57c1c8=_0x8387[_0x226198];return _0x57c1c8;};'use strict';var _=require(_0x7838('0x0'));var util=require(_0x7838('0x1'));var moment=require(_0x7838('0x2'));var BPromise=require(_0x7838('0x3'));var rs=require(_0x7838('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7838('0x5'))['db'];var utils=require(_0x7838('0x6'));var logger=require(_0x7838('0x7'))(_0x7838('0x8'));var config=require(_0x7838('0x9'));var jayson=require(_0x7838('0xa'));var client=jayson[_0x7838('0xb')][_0x7838('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c8ad3,_0x36faad,_0x3e9351){return new BPromise(function(_0x26dde6,_0x516115){return client[_0x7838('0xd')](_0x2c8ad3,_0x3e9351)[_0x7838('0xe')](function(_0x199c8c){logger['info'](_0x7838('0xf'),_0x36faad,'request\x20sent');logger[_0x7838('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x36faad,'request\x20sent',JSON[_0x7838('0x11')](_0x199c8c));if(_0x199c8c['error']){if(_0x199c8c['error']['code']===0x1f4){logger[_0x7838('0x12')](_0x7838('0xf'),_0x36faad,_0x199c8c[_0x7838('0x12')]['message']);return _0x516115(_0x199c8c[_0x7838('0x12')][_0x7838('0x13')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x36faad,_0x199c8c[_0x7838('0x12')][_0x7838('0x13')]);return _0x26dde6(_0x199c8c[_0x7838('0x12')]['message']);}else{logger[_0x7838('0x14')](_0x7838('0xf'),_0x36faad,_0x7838('0x15'));_0x26dde6(_0x199c8c[_0x7838('0x16')]['message']);}})[_0x7838('0x17')](function(_0x1d37fc){logger['error'](_0x7838('0xf'),_0x36faad,_0x1d37fc);_0x516115(_0x1d37fc);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e94e9ae..8c18c8c 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 _0xf523=['post','create','put','/:id','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query'];(function(_0xf962f1,_0x129190){var _0x3418c3=function(_0x32825c){while(--_0x32825c){_0xf962f1['push'](_0xf962f1['shift']());}};_0x3418c3(++_0x129190);}(_0xf523,0x196));var _0x3f52=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf523[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3f52('0x0'));var path=require('path');var timeout=require(_0x3f52('0x1'));var express=require('express');var router=express[_0x3f52('0x2')]();var fs_extra=require(_0x3f52('0x3'));var auth=require(_0x3f52('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f52('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x3f52('0x6')]('/',auth[_0x3f52('0x7')](),controller['index']);router[_0x3f52('0x6')]('/:id',auth[_0x3f52('0x7')](),controller[_0x3f52('0x8')]);router[_0x3f52('0x6')](_0x3f52('0x9'),auth[_0x3f52('0x7')](),controller['preview']);router[_0x3f52('0x6')](_0x3f52('0xa'),auth[_0x3f52('0x7')](),controller[_0x3f52('0xb')]);router[_0x3f52('0x6')](_0x3f52('0xc'),auth[_0x3f52('0x7')](),controller[_0x3f52('0xd')]);router[_0x3f52('0xe')]('/',auth[_0x3f52('0x7')](),controller[_0x3f52('0xf')]);router[_0x3f52('0x10')](_0x3f52('0x11'),auth['isAuthenticated'](),controller[_0x3f52('0x12')]);router['delete'](_0x3f52('0x11'),auth[_0x3f52('0x7')](),controller[_0x3f52('0x13')]);module[_0x3f52('0x14')]=router; \ No newline at end of file +var _0x1f93=['/:id/query','post','create','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/preview','run'];(function(_0xcbc227,_0x17401c){var _0x518978=function(_0x3f1116){while(--_0x3f1116){_0xcbc227['push'](_0xcbc227['shift']());}};_0x518978(++_0x17401c);}(_0x1f93,0x148));var _0x31f9=function(_0x566a5b,_0x1322b5){_0x566a5b=_0x566a5b-0x0;var _0x47f9e7=_0x1f93[_0x566a5b];return _0x47f9e7;};'use strict';var multer=require(_0x31f9('0x0'));var util=require(_0x31f9('0x1'));var path=require(_0x31f9('0x2'));var timeout=require(_0x31f9('0x3'));var express=require(_0x31f9('0x4'));var router=express[_0x31f9('0x5')]();var fs_extra=require(_0x31f9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x31f9('0x7'));var config=require(_0x31f9('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x31f9('0x9')]('/',auth[_0x31f9('0xa')](),controller[_0x31f9('0xb')]);router[_0x31f9('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x31f9('0xc'),auth[_0x31f9('0xa')](),controller['preview']);router['get']('/:id/run',auth[_0x31f9('0xa')](),controller[_0x31f9('0xd')]);router[_0x31f9('0x9')](_0x31f9('0xe'),auth[_0x31f9('0xa')](),controller['query']);router[_0x31f9('0xf')]('/',auth['isAuthenticated'](),controller[_0x31f9('0x10')]);router['put'](_0x31f9('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x31f9('0x11'),auth[_0x31f9('0xa')](),controller['destroy']);module[_0x31f9('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 822b93b..6c2d6c2 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x21e857,_0x319366){var _0x3ed3ef=function(_0x17370c){while(--_0x17370c){_0x21e857['push'](_0x21e857['shift']());}};_0x3ed3ef(++_0x319366);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4adff1,_0x4a8cbe){_0x4adff1=_0x4adff1-0x0;var _0x318759=_0x3f8a[_0x4adff1];return _0x318759;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0xdbf5=['exports','STRING','TEXT'];(function(_0x2c4383,_0x285fc4){var _0x4741c0=function(_0x5d486b){while(--_0x5d486b){_0x2c4383['push'](_0x2c4383['shift']());}};_0x4741c0(++_0x285fc4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x48a403,_0x3a408a){_0x48a403=_0x48a403-0x0;var _0x22a8b1=_0xdbf5[_0x48a403];return _0x22a8b1;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 798f0a0..a0e5d33 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6d38[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file +var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x4489cd,_0x83d7ee){var _0x3d202c=function(_0x134751){while(--_0x134751){_0x4489cd['push'](_0x4489cd['shift']());}};_0x3d202c(++_0x83d7ee);}(_0x7a54,0x106));var _0x47a5=function(_0x38a6c7,_0x3ffe7b){_0x38a6c7=_0x38a6c7-0x0;var _0x41f6f6=_0x7a54[_0x38a6c7];return _0x41f6f6;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 913eb62..f7e10ce 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 _0xda83=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33b985,_0x4ac6e0){var _0x12f944=function(_0x307bac){while(--_0x307bac){_0x33b985['push'](_0x33b985['shift']());}};_0x12f944(++_0x4ac6e0);}(_0xda83,0x70));var _0x3da8=function(_0x2674ec,_0x58c37e){_0x2674ec=_0x2674ec-0x0;var _0x3845d5=_0xda83[_0x2674ec];return _0x3845d5;};'use strict';var _=require('lodash');var util=require(_0x3da8('0x0'));var logger=require(_0x3da8('0x1'))(_0x3da8('0x2'));var moment=require('moment');var BPromise=require(_0x3da8('0x3'));var rp=require(_0x3da8('0x4'));var fs=require('fs');var path=require(_0x3da8('0x5'));var rimraf=require(_0x3da8('0x6'));var config=require(_0x3da8('0x7'));var attributes=require(_0x3da8('0x8'));module[_0x3da8('0x9')]=function(_0x4c5000,_0xfc93f){return _0x4c5000['define'](_0x3da8('0xa'),attributes,{'tableName':_0x3da8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21eb=['analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','AnalyticDefaultReport'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x21eb,0x17d));var _0xb21e=function(_0x5a15a2,_0x4b9dd7){_0x5a15a2=_0x5a15a2-0x0;var _0x5affbb=_0x21eb[_0x5a15a2];return _0x5affbb;};'use strict';var _=require(_0xb21e('0x0'));var util=require('util');var logger=require(_0xb21e('0x1'))(_0xb21e('0x2'));var moment=require(_0xb21e('0x3'));var BPromise=require(_0xb21e('0x4'));var rp=require(_0xb21e('0x5'));var fs=require('fs');var path=require(_0xb21e('0x6'));var rimraf=require('rimraf');var config=require(_0xb21e('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x15a75d,_0x200106){return _0x15a75d['define'](_0xb21e('0x8'),attributes,{'tableName':_0xb21e('0x9'),'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 9a7bdae..fe7f47f 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 _0x44a3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2163f6,_0x176963){var _0x577407=function(_0x329c0c){while(--_0x329c0c){_0x2163f6['push'](_0x2163f6['shift']());}};_0x577407(++_0x176963);}(_0x44a3,0x166));var _0x344a=function(_0xd4ae3f,_0x410d0f){_0xd4ae3f=_0xd4ae3f-0x0;var _0x52e69b=_0x44a3[_0xd4ae3f];return _0x52e69b;};'use strict';var _=require(_0x344a('0x0'));var util=require('util');var moment=require(_0x344a('0x1'));var BPromise=require(_0x344a('0x2'));var rs=require(_0x344a('0x3'));var fs=require('fs');var Redis=require(_0x344a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x344a('0x5'));var logger=require(_0x344a('0x6'))(_0x344a('0x7'));var config=require(_0x344a('0x8'));var jayson=require(_0x344a('0x9'));var client=jayson[_0x344a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x369c64,_0x14ff88,_0x51fbf9){return new BPromise(function(_0x2887ba,_0x47aa59){return client[_0x344a('0xb')](_0x369c64,_0x51fbf9)[_0x344a('0xc')](function(_0x7b7261){logger[_0x344a('0xd')](_0x344a('0xe'),_0x14ff88,_0x344a('0xf'));logger[_0x344a('0x10')](_0x344a('0x11'),_0x14ff88,_0x344a('0xf'),JSON[_0x344a('0x12')](_0x7b7261));if(_0x7b7261[_0x344a('0x13')]){if(_0x7b7261[_0x344a('0x13')][_0x344a('0x14')]===0x1f4){logger[_0x344a('0x13')](_0x344a('0xe'),_0x14ff88,_0x7b7261[_0x344a('0x13')][_0x344a('0x15')]);return _0x47aa59(_0x7b7261['error'][_0x344a('0x15')]);}logger[_0x344a('0x13')](_0x344a('0xe'),_0x14ff88,_0x7b7261['error'][_0x344a('0x15')]);return _0x2887ba(_0x7b7261[_0x344a('0x13')][_0x344a('0x15')]);}else{logger[_0x344a('0xd')](_0x344a('0xe'),_0x14ff88,_0x344a('0xf'));_0x2887ba(_0x7b7261[_0x344a('0x16')][_0x344a('0x15')]);}})[_0x344a('0x17')](function(_0x102cc8){logger[_0x344a('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x14ff88,_0x102cc8);_0x47aa59(_0x102cc8);});});} \ No newline at end of file +var _0x088f=['request\x20sent','debug','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x57a620,_0x1d4059){var _0x51e715=function(_0x123c83){while(--_0x123c83){_0x57a620['push'](_0x57a620['shift']());}};_0x51e715(++_0x1d4059);}(_0x088f,0x9b));var _0xf088=function(_0x4e4d02,_0x282a72){_0x4e4d02=_0x4e4d02-0x0;var _0x559bd0=_0x088f[_0x4e4d02];return _0x559bd0;};'use strict';var _=require(_0xf088('0x0'));var util=require(_0xf088('0x1'));var moment=require(_0xf088('0x2'));var BPromise=require(_0xf088('0x3'));var rs=require(_0xf088('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf088('0x5'));var logger=require(_0xf088('0x6'))(_0xf088('0x7'));var config=require(_0xf088('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf088('0x9')][_0xf088('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1af5eb,_0x637d98,_0x340f3c){return new BPromise(function(_0x415089,_0x586ef2){return client['request'](_0x1af5eb,_0x340f3c)[_0xf088('0xb')](function(_0x3caa2a){logger[_0xf088('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x637d98,_0xf088('0xd'));logger[_0xf088('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x637d98,'request\x20sent',JSON[_0xf088('0xf')](_0x3caa2a));if(_0x3caa2a[_0xf088('0x10')]){if(_0x3caa2a['error']['code']===0x1f4){logger[_0xf088('0x10')](_0xf088('0x11'),_0x637d98,_0x3caa2a[_0xf088('0x10')][_0xf088('0x12')]);return _0x586ef2(_0x3caa2a['error'][_0xf088('0x12')]);}logger[_0xf088('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x637d98,_0x3caa2a[_0xf088('0x10')][_0xf088('0x12')]);return _0x415089(_0x3caa2a[_0xf088('0x10')][_0xf088('0x12')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x637d98,_0xf088('0xd'));_0x415089(_0x3caa2a[_0xf088('0x13')][_0xf088('0x12')]);}})[_0xf088('0x14')](function(_0x1fea8a){logger['error'](_0xf088('0x11'),_0x637d98,_0x1fea8a);_0x586ef2(_0x1fea8a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index fcdfa72..56ee123 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 _0x9258=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x2f904d,_0x3302b3){var _0x175c13=function(_0x43d876){while(--_0x43d876){_0x2f904d['push'](_0x2f904d['shift']());}};_0x175c13(++_0x3302b3);}(_0x9258,0x1a0));var _0x8925=function(_0x62d6fe,_0x5a27b2){_0x62d6fe=_0x62d6fe-0x0;var _0x1b00b8=_0x9258[_0x62d6fe];return _0x1b00b8;};'use strict';var multer=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var path=require(_0x8925('0x2'));var timeout=require(_0x8925('0x3'));var express=require(_0x8925('0x4'));var router=express['Router']();var fs_extra=require(_0x8925('0x5'));var auth=require(_0x8925('0x6'));var interaction=require(_0x8925('0x7'));var config=require(_0x8925('0x8'));var controller=require(_0x8925('0x9'));router[_0x8925('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8925('0xa')](_0x8925('0xb'),auth[_0x8925('0xc')](),controller[_0x8925('0xd')]);router['get']('/:id/preview',auth[_0x8925('0xc')](),controller[_0x8925('0xe')]);router[_0x8925('0xa')](_0x8925('0xf'),auth[_0x8925('0xc')](),controller[_0x8925('0x10')]);router[_0x8925('0xa')](_0x8925('0x11'),auth[_0x8925('0xc')](),controller[_0x8925('0x12')]);router[_0x8925('0x13')]('/',auth[_0x8925('0xc')](),controller[_0x8925('0x14')]);router[_0x8925('0x15')](_0x8925('0xb'),auth['isAuthenticated'](),controller[_0x8925('0x16')]);router[_0x8925('0x17')]('/:id',auth[_0x8925('0xc')](),controller[_0x8925('0x18')]);module[_0x8925('0x19')]=router; \ No newline at end of file +var _0x45a4=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x45a4,0xc3));var _0x445a=function(_0x33c444,_0x4507c4){_0x33c444=_0x33c444-0x0;var _0x4149d1=_0x45a4[_0x33c444];return _0x4149d1;};'use strict';var multer=require('multer');var util=require(_0x445a('0x0'));var path=require(_0x445a('0x1'));var timeout=require(_0x445a('0x2'));var express=require(_0x445a('0x3'));var router=express[_0x445a('0x4')]();var fs_extra=require(_0x445a('0x5'));var auth=require(_0x445a('0x6'));var interaction=require(_0x445a('0x7'));var config=require(_0x445a('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x445a('0x9')](),controller[_0x445a('0xa')]);router['get'](_0x445a('0xb'),auth[_0x445a('0x9')](),controller[_0x445a('0xc')]);router[_0x445a('0xd')](_0x445a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x445a('0xd')](_0x445a('0xf'),auth[_0x445a('0x9')](),controller[_0x445a('0x10')]);router[_0x445a('0xd')](_0x445a('0x11'),auth[_0x445a('0x9')](),controller[_0x445a('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x445a('0x13')]);router[_0x445a('0x14')](_0x445a('0xb'),auth[_0x445a('0x9')](),controller['update']);router[_0x445a('0x15')](_0x445a('0xb'),auth[_0x445a('0x9')](),controller[_0x445a('0x16')]);module[_0x445a('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8a14aa2..afb8dd1 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 _0x5ce5=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','UNSIGNED','moment'];(function(_0x1f37af,_0x238de4){var _0x243cad=function(_0x4e971f){while(--_0x4e971f){_0x1f37af['push'](_0x1f37af['shift']());}};_0x243cad(++_0x238de4);}(_0x5ce5,0x1cd));var _0x55ce=function(_0x564945,_0x5d97f7){_0x564945=_0x564945-0x0;var _0x224f00=_0x5ce5[_0x564945];return _0x224f00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x55ce('0x0'));module[_0x55ce('0x1')]={'name':{'type':Sequelize[_0x55ce('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x55ce('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x55ce('0x3'),_0x55ce('0x4'),_0x55ce('0x5')),'allowNull':![],'defaultValue':_0x55ce('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x55ce('0x6')]},'endDate':{'type':Sequelize[_0x55ce('0x6')]},'status':{'type':Sequelize[_0x55ce('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x55ce('0x7')](_0x55ce('0x8'),_0x55ce('0x9')),'allowNull':![],'defaultValue':_0x55ce('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x55ce('0xa')]},'reportType':{'type':Sequelize[_0x55ce('0x2')]}}; \ No newline at end of file +var _0xef7a=['sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x223deb,_0x3da12c){var _0x4ee672=function(_0xf4368a){while(--_0xf4368a){_0x223deb['push'](_0x223deb['shift']());}};_0x4ee672(++_0x3da12c);}(_0xef7a,0x114));var _0xaef7=function(_0x285376,_0x5e7d62){_0x285376=_0x285376-0x0;var _0x76d003=_0xef7a[_0x285376];return _0x76d003;};'use strict';var Sequelize=require(_0xaef7('0x0'));var moment=require(_0xaef7('0x1'));module[_0xaef7('0x2')]={'name':{'type':Sequelize[_0xaef7('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xaef7('0x4')](_0xaef7('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xaef7('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xaef7('0x6')]},'endDate':{'type':Sequelize[_0xaef7('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xaef7('0x7')},'type':{'type':Sequelize[_0xaef7('0x4')](_0xaef7('0x8'),_0xaef7('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xaef7('0xa')](0xb)[_0xaef7('0xb')]},'reportType':{'type':Sequelize[_0xaef7('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f480949..6381f31 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 _0x3124=['order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','params','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','format','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0xe8c799,_0x2a176f){var _0x2695b3=function(_0x37c371){while(--_0x37c371){_0xe8c799['push'](_0xe8c799['shift']());}};_0x2695b3(++_0x2a176f);}(_0x3124,0x13e));var _0x4312=function(_0x15ea49,_0x4eff65){_0x15ea49=_0x15ea49-0x0;var _0x58e4d0=_0x3124[_0x15ea49];return _0x58e4d0;};'use strict';var emlformat=require(_0x4312('0x0'));var rimraf=require(_0x4312('0x1'));var zipdir=require(_0x4312('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4312('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4312('0x4'));var util=require(_0x4312('0x5'));var path=require(_0x4312('0x6'));var sox=require(_0x4312('0x7'));var csv=require(_0x4312('0x8'));var ejs=require(_0x4312('0x9'));var fs=require('fs');var fs_extra=require(_0x4312('0xa'));var _=require(_0x4312('0xb'));var squel=require(_0x4312('0xc'));var crypto=require(_0x4312('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4312('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4312('0xf'));var Papa=require(_0x4312('0x10'));var Redis=require(_0x4312('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4312('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4312('0x13'))(_0x4312('0x14'));var utils=require(_0x4312('0x15'));var config=require(_0x4312('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12c8,_0x5b96f2){_0x5b96f2=_0x5b96f2||0xcc;return function(_0x3700aa){if(_0x3700aa){return _0x3b12c8[_0x4312('0x17')](_0x5b96f2);}return _0x3b12c8[_0x4312('0x18')](_0x5b96f2)[_0x4312('0x19')]();};}function respondWithResult(_0x2829e7,_0x1b7b91){_0x1b7b91=_0x1b7b91||0xc8;return function(_0x48cc6d){if(_0x48cc6d){return _0x2829e7[_0x4312('0x18')](_0x1b7b91)['json'](_0x48cc6d);}};}function respondWithFilteredResult(_0x37d402,_0x517e1f){return function(_0x44b74c){if(_0x44b74c){var _0x45a0ff=typeof _0x517e1f[_0x4312('0x1a')]===_0x4312('0x1b')&&typeof _0x517e1f['limit']===_0x4312('0x1b');var _0x4574d6=_0x44b74c['count'];var _0x137ba7=_0x45a0ff?0x0:_0x517e1f[_0x4312('0x1a')];var _0x17bd83=_0x45a0ff?_0x44b74c[_0x4312('0x1c')]:_0x517e1f[_0x4312('0x1a')]+_0x517e1f[_0x4312('0x1d')];var _0xb87959;if(_0x17bd83>=_0x4574d6){_0x17bd83=_0x4574d6;_0xb87959=0xc8;}else{_0xb87959=0xce;}_0x37d402[_0x4312('0x18')](_0xb87959);return _0x37d402[_0x4312('0x1e')](_0x4312('0x1f'),_0x137ba7+'-'+_0x17bd83+'/'+_0x4574d6)['json'](_0x44b74c);}return null;};}function patchUpdates(_0x2a1549){return function(_0x3c96bc){try{jsonpatch[_0x4312('0x20')](_0x3c96bc,_0x2a1549,!![]);}catch(_0x13fd11){return BPromise['reject'](_0x13fd11);}return _0x3c96bc[_0x4312('0x21')]();};}function saveUpdates(_0x403422,_0x5e6df4){return function(_0x46b4fb){if(_0x46b4fb){return _0x46b4fb['update'](_0x403422)[_0x4312('0x22')](function(_0x2d3b55){return _0x2d3b55;});}return null;};}function removeEntity(_0x30d22b,_0x23eb4a){return function(_0x407c74){if(_0x407c74){return _0x407c74['destroy']()['then'](function(){var _0x58b63b=_0x407c74[_0x4312('0x23')]({'plain':!![]});var _0xca89b=_0x4312('0x24');return db[_0x4312('0x25')][_0x4312('0x26')]({'where':{'type':_0xca89b,'resourceId':_0x58b63b['id']}})[_0x4312('0x22')](function(){return _0x407c74;});})['then'](function(){_0x30d22b[_0x4312('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4db7,_0x374b18){return function(_0x7fe247){if(!_0x7fe247){_0x2b4db7[_0x4312('0x17')](0x194);}return _0x7fe247;};}function handleError(_0xa17345,_0x437478){_0x437478=_0x437478||0x1f4;return function(_0x349dbc){logger[_0x4312('0x27')](_0x349dbc[_0x4312('0x28')]);if(_0x349dbc[_0x4312('0x29')]){delete _0x349dbc[_0x4312('0x29')];}_0xa17345['status'](_0x437478)['send'](_0x349dbc);};}exports[_0x4312('0x2a')]=function(_0xaf42e9,_0x2c29d4){var _0x28775a={},_0x4c6116={},_0x1cb6cb={'count':0x0,'rows':[]};var _0x4a4c67=_[_0x4312('0x2b')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x28965a){return{'name':_0x28965a[_0x4312('0x2c')],'type':_0x28965a['type']['key']};});_0x4c6116[_0x4312('0x2d')]=_[_0x4312('0x2b')](_0x4a4c67,'name');_0x4c6116[_0x4312('0x2e')]=_[_0x4312('0x2f')](_0xaf42e9[_0x4312('0x2e')]);_0x4c6116['filters']=_[_0x4312('0x30')](_0x4c6116[_0x4312('0x2d')],_0x4c6116[_0x4312('0x2e')]);_0x28775a[_0x4312('0x31')]=_['intersection'](_0x4c6116[_0x4312('0x2d')],qs[_0x4312('0x32')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x32')]));_0x28775a[_0x4312('0x31')]=_0x28775a[_0x4312('0x31')][_0x4312('0x33')]?_0x28775a[_0x4312('0x31')]:_0x4c6116['model'];if(!_0xaf42e9[_0x4312('0x2e')][_0x4312('0x34')](_0x4312('0x35'))){_0x28775a[_0x4312('0x1d')]=qs[_0x4312('0x1d')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x1d')]);_0x28775a[_0x4312('0x1a')]=qs['offset'](_0xaf42e9[_0x4312('0x2e')]['offset']);}_0x28775a[_0x4312('0x36')]=qs[_0x4312('0x37')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x37')]);_0x28775a['where']=qs[_0x4312('0x38')](_[_0x4312('0x39')](_0xaf42e9['query'],_0x4c6116[_0x4312('0x38')]),_0x4a4c67);if(_0xaf42e9[_0x4312('0x2e')][_0x4312('0x3a')]){_0x28775a[_0x4312('0x3b')]=_['merge'](_0x28775a['where'],{'$or':_[_0x4312('0x2b')](_0x4a4c67,function(_0x484217){if(_0x484217[_0x4312('0x3c')]!==_0x4312('0x3d')){var _0x1ec80e={};_0x1ec80e[_0x484217[_0x4312('0x29')]]={'$like':'%'+_0xaf42e9[_0x4312('0x2e')][_0x4312('0x3a')]+'%'};return _0x1ec80e;}})});}_0x28775a=_[_0x4312('0x3e')]({},_0x28775a,_0xaf42e9[_0x4312('0x3f')]);var _0x23716c={'where':_0x28775a[_0x4312('0x3b')]};return db[_0x4312('0x40')][_0x4312('0x1c')](_0x23716c)['then'](function(_0x4e1c32){_0x1cb6cb[_0x4312('0x1c')]=_0x4e1c32;if(_0xaf42e9[_0x4312('0x2e')][_0x4312('0x41')]){_0x28775a['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x4312('0x42')](_0x28775a);})[_0x4312('0x22')](function(_0x1e73d8){_0x1cb6cb[_0x4312('0x43')]=_0x1e73d8;return _0x1cb6cb;})['then'](respondWithFilteredResult(_0x2c29d4,_0x28775a))['catch'](handleError(_0x2c29d4,null));};exports['show']=function(_0x455a9c,_0x2cc29e){var _0x111c36={'raw':!![],'where':{'id':_0x455a9c[_0x4312('0x44')]['id']}},_0x3733e7={};_0x3733e7[_0x4312('0x2d')]=_[_0x4312('0x2f')](db[_0x4312('0x40')]['rawAttributes']);_0x3733e7[_0x4312('0x2e')]=_[_0x4312('0x2f')](_0x455a9c[_0x4312('0x2e')]);_0x3733e7[_0x4312('0x38')]=_['intersection'](_0x3733e7['model'],_0x3733e7['query']);_0x111c36[_0x4312('0x31')]=_[_0x4312('0x30')](_0x3733e7[_0x4312('0x2d')],qs[_0x4312('0x32')](_0x455a9c[_0x4312('0x2e')][_0x4312('0x32')]));_0x111c36[_0x4312('0x31')]=_0x111c36[_0x4312('0x31')]['length']?_0x111c36[_0x4312('0x31')]:_0x3733e7[_0x4312('0x2d')];if(_0x455a9c[_0x4312('0x2e')][_0x4312('0x41')]){_0x111c36[_0x4312('0x45')]=[{'all':!![]}];}_0x111c36=_['merge']({},_0x111c36,_0x455a9c[_0x4312('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x111c36)['then'](handleEntityNotFound(_0x2cc29e,null))[_0x4312('0x22')](respondWithResult(_0x2cc29e,null))[_0x4312('0x46')](handleError(_0x2cc29e,null));};exports['create']=function(_0x9196f0,_0x322d59){return db['AnalyticExtractedReport'][_0x4312('0x47')](_0x9196f0['body'],{})[_0x4312('0x22')](function(_0x3aa16d){var _0x3fec3a=_0x9196f0['user'][_0x4312('0x23')]({'plain':!![]});if(!_0x3fec3a)throw new Error(_0x4312('0x48'));if(_0x3fec3a[_0x4312('0x49')]===_0x4312('0x4a')){var _0x2acbfe=_0x3aa16d[_0x4312('0x23')]({'plain':!![]});var _0x296762='ExtractedReports';return db[_0x4312('0x4b')]['find']({'where':{'name':_0x296762,'userProfileId':_0x3fec3a[_0x4312('0x4c')]},'raw':!![]})['then'](function(_0x5282f7){if(_0x5282f7&&_0x5282f7[_0x4312('0x4d')]===0x0){return db[_0x4312('0x25')][_0x4312('0x47')]({'name':_0x2acbfe[_0x4312('0x29')],'resourceId':_0x2acbfe['id'],'type':_0x5282f7[_0x4312('0x29')],'sectionId':_0x5282f7['id']},{})[_0x4312('0x22')](function(){return _0x3aa16d;});}else{return _0x3aa16d;}})[_0x4312('0x46')](function(_0x266245){logger['error'](_0x4312('0x4e'),_0x266245);throw _0x266245;});}return _0x3aa16d;})[_0x4312('0x22')](respondWithResult(_0x322d59,0xc9))['catch'](handleError(_0x322d59,null));};exports[_0x4312('0x4f')]=function(_0x4f991d,_0x4dc8f4){if(_0x4f991d[_0x4312('0x50')]['id']){delete _0x4f991d[_0x4312('0x50')]['id'];}return db[_0x4312('0x40')][_0x4312('0x51')]({'where':{'id':_0x4f991d[_0x4312('0x44')]['id']}})[_0x4312('0x22')](handleEntityNotFound(_0x4dc8f4,null))['then'](saveUpdates(_0x4f991d[_0x4312('0x50')],null))['then'](respondWithResult(_0x4dc8f4,null))[_0x4312('0x46')](handleError(_0x4dc8f4,null));};exports[_0x4312('0x26')]=function(_0x5e3622,_0x68d1ee){return db[_0x4312('0x40')][_0x4312('0x51')]({'where':{'id':_0x5e3622[_0x4312('0x44')]['id']}})['then'](handleEntityNotFound(_0x68d1ee,null))[_0x4312('0x22')](removeEntity(_0x68d1ee,null))[_0x4312('0x46')](handleError(_0x68d1ee,null));};exports[_0x4312('0x52')]=function(_0x12f9e5,_0x485bc9,_0x1e353c){return db[_0x4312('0x40')]['find']({'where':{'id':_0x12f9e5[_0x4312('0x44')]['id']},'attributes':['name',_0x4312('0x53'),_0x4312('0x54'),_0x4312('0x55')],'raw':!![]})[_0x4312('0x22')](handleEntityNotFound(_0x485bc9,null))[_0x4312('0x22')](function(_0x583699){if(_0x583699){if(!fs[_0x4312('0x56')](path[_0x4312('0x57')](config[_0x4312('0x58')],_0x4312('0x59'),_0x583699[_0x4312('0x54')]))){throw new db['Sequelize'][(_0x4312('0x5a'))](_0x4312('0x5b'));}if(_0x12f9e5['query']['exists']){return _0x485bc9[_0x4312('0x17')](0xc8);}return _0x485bc9[_0x4312('0x52')](path[_0x4312('0x57')](config[_0x4312('0x58')],'server/files/reports',_0x583699['savename']),util[_0x4312('0x5c')]('%s.%s',_0x583699['basename']||_0x583699['name'],_0x583699[_0x4312('0x55')]['toLowerCase']()));}})[_0x4312('0x46')](handleError(_0x485bc9,null));}; \ No newline at end of file +var _0x2b7e=['catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','ExtractedReports','UserProfileSection','autoAssociation','body','download','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','output','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find'];(function(_0x41c88c,_0x381f8d){var _0x2c97ea=function(_0x35fd44){while(--_0x35fd44){_0x41c88c['push'](_0x41c88c['shift']());}};_0x2c97ea(++_0x381f8d);}(_0x2b7e,0xe1));var _0xe2b7=function(_0x1b12bc,_0x21df0b){_0x1b12bc=_0x1b12bc-0x0;var _0x2da7ee=_0x2b7e[_0x1b12bc];return _0x2da7ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2b7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2b7('0x1'));var rp=require(_0xe2b7('0x2'));var moment=require(_0xe2b7('0x3'));var BPromise=require(_0xe2b7('0x4'));var Mustache=require('mustache');var util=require(_0xe2b7('0x5'));var path=require(_0xe2b7('0x6'));var sox=require(_0xe2b7('0x7'));var csv=require('to-csv');var ejs=require(_0xe2b7('0x8'));var fs=require('fs');var fs_extra=require(_0xe2b7('0x9'));var _=require(_0xe2b7('0xa'));var squel=require(_0xe2b7('0xb'));var crypto=require(_0xe2b7('0xc'));var jsforce=require(_0xe2b7('0xd'));var deskjs=require(_0xe2b7('0xe'));var toCsv=require(_0xe2b7('0xf'));var querystring=require(_0xe2b7('0x10'));var Papa=require(_0xe2b7('0x11'));var Redis=require('ioredis');var authService=require(_0xe2b7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe2b7('0x13'));var hardwareService=require(_0xe2b7('0x14'));var logger=require(_0xe2b7('0x15'))(_0xe2b7('0x16'));var utils=require(_0xe2b7('0x17'));var config=require(_0xe2b7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2b7('0x19'))['db'];function respondWithStatusCode(_0x56cfa1,_0x50ae52){_0x50ae52=_0x50ae52||0xcc;return function(_0x43e8cc){if(_0x43e8cc){return _0x56cfa1[_0xe2b7('0x1a')](_0x50ae52);}return _0x56cfa1[_0xe2b7('0x1b')](_0x50ae52)[_0xe2b7('0x1c')]();};}function respondWithResult(_0x1ac2cf,_0x10e1a6){_0x10e1a6=_0x10e1a6||0xc8;return function(_0xbe52dd){if(_0xbe52dd){return _0x1ac2cf[_0xe2b7('0x1b')](_0x10e1a6)[_0xe2b7('0x1d')](_0xbe52dd);}};}function respondWithFilteredResult(_0x4ce593,_0x23531e){return function(_0x66c62e){if(_0x66c62e){var _0x4b4002=typeof _0x23531e['offset']===_0xe2b7('0x1e')&&typeof _0x23531e[_0xe2b7('0x1f')]===_0xe2b7('0x1e');var _0x240add=_0x66c62e[_0xe2b7('0x20')];var _0x480b75=_0x4b4002?0x0:_0x23531e[_0xe2b7('0x21')];var _0x41610c=_0x4b4002?_0x66c62e['count']:_0x23531e[_0xe2b7('0x21')]+_0x23531e[_0xe2b7('0x1f')];var _0x2c084c;if(_0x41610c>=_0x240add){_0x41610c=_0x240add;_0x2c084c=0xc8;}else{_0x2c084c=0xce;}_0x4ce593[_0xe2b7('0x1b')](_0x2c084c);return _0x4ce593[_0xe2b7('0x22')](_0xe2b7('0x23'),_0x480b75+'-'+_0x41610c+'/'+_0x240add)['json'](_0x66c62e);}return null;};}function patchUpdates(_0x190094){return function(_0x32f810){try{jsonpatch[_0xe2b7('0x24')](_0x32f810,_0x190094,!![]);}catch(_0x227fec){return BPromise[_0xe2b7('0x25')](_0x227fec);}return _0x32f810[_0xe2b7('0x26')]();};}function saveUpdates(_0x47d176,_0x48f328){return function(_0x522f6d){if(_0x522f6d){return _0x522f6d[_0xe2b7('0x27')](_0x47d176)[_0xe2b7('0x28')](function(_0x52447c){return _0x52447c;});}return null;};}function removeEntity(_0x1a16e0,_0x11b05e){return function(_0x250bb0){if(_0x250bb0){return _0x250bb0[_0xe2b7('0x29')]()[_0xe2b7('0x28')](function(){var _0x52de80=_0x250bb0['get']({'plain':!![]});var _0x4970d2='ExtractedReports';return db[_0xe2b7('0x2a')][_0xe2b7('0x29')]({'where':{'type':_0x4970d2,'resourceId':_0x52de80['id']}})[_0xe2b7('0x28')](function(){return _0x250bb0;});})[_0xe2b7('0x28')](function(){_0x1a16e0['status'](0xcc)[_0xe2b7('0x1c')]();});}};}function handleEntityNotFound(_0x1f7f67,_0x933c8e){return function(_0x2f7a43){if(!_0x2f7a43){_0x1f7f67[_0xe2b7('0x1a')](0x194);}return _0x2f7a43;};}function handleError(_0x526c87,_0x5d65bd){_0x5d65bd=_0x5d65bd||0x1f4;return function(_0x2a3175){logger[_0xe2b7('0x2b')](_0x2a3175[_0xe2b7('0x2c')]);if(_0x2a3175[_0xe2b7('0x2d')]){delete _0x2a3175['name'];}_0x526c87[_0xe2b7('0x1b')](_0x5d65bd)['send'](_0x2a3175);};}exports[_0xe2b7('0x2e')]=function(_0x589ab7,_0x429ada){var _0xe952e1={},_0x2beca8={},_0x4fc24c={'count':0x0,'rows':[]};var _0x5749fb=_[_0xe2b7('0x2f')](db[_0xe2b7('0x30')][_0xe2b7('0x31')],function(_0x248a52){return{'name':_0x248a52[_0xe2b7('0x32')],'type':_0x248a52[_0xe2b7('0x33')][_0xe2b7('0x34')]};});_0x2beca8[_0xe2b7('0x35')]=_['map'](_0x5749fb,_0xe2b7('0x2d'));_0x2beca8[_0xe2b7('0x36')]=_[_0xe2b7('0x37')](_0x589ab7[_0xe2b7('0x36')]);_0x2beca8[_0xe2b7('0x38')]=_[_0xe2b7('0x39')](_0x2beca8[_0xe2b7('0x35')],_0x2beca8['query']);_0xe952e1['attributes']=_['intersection'](_0x2beca8['model'],qs[_0xe2b7('0x3a')](_0x589ab7[_0xe2b7('0x36')][_0xe2b7('0x3a')]));_0xe952e1[_0xe2b7('0x3b')]=_0xe952e1[_0xe2b7('0x3b')][_0xe2b7('0x3c')]?_0xe952e1[_0xe2b7('0x3b')]:_0x2beca8[_0xe2b7('0x35')];if(!_0x589ab7['query'][_0xe2b7('0x3d')](_0xe2b7('0x3e'))){_0xe952e1[_0xe2b7('0x1f')]=qs[_0xe2b7('0x1f')](_0x589ab7[_0xe2b7('0x36')][_0xe2b7('0x1f')]);_0xe952e1[_0xe2b7('0x21')]=qs[_0xe2b7('0x21')](_0x589ab7[_0xe2b7('0x36')][_0xe2b7('0x21')]);}_0xe952e1[_0xe2b7('0x3f')]=qs[_0xe2b7('0x40')](_0x589ab7[_0xe2b7('0x36')]['sort']);_0xe952e1[_0xe2b7('0x41')]=qs[_0xe2b7('0x38')](_[_0xe2b7('0x42')](_0x589ab7[_0xe2b7('0x36')],_0x2beca8[_0xe2b7('0x38')]),_0x5749fb);if(_0x589ab7[_0xe2b7('0x36')][_0xe2b7('0x43')]){_0xe952e1[_0xe2b7('0x41')]=_[_0xe2b7('0x44')](_0xe952e1[_0xe2b7('0x41')],{'$or':_[_0xe2b7('0x2f')](_0x5749fb,function(_0xc4999c){if(_0xc4999c[_0xe2b7('0x33')]!==_0xe2b7('0x45')){var _0x3affeb={};_0x3affeb[_0xc4999c['name']]={'$like':'%'+_0x589ab7['query']['filter']+'%'};return _0x3affeb;}})});}_0xe952e1=_['merge']({},_0xe952e1,_0x589ab7[_0xe2b7('0x46')]);var _0x39de21={'where':_0xe952e1['where']};return db['AnalyticExtractedReport'][_0xe2b7('0x20')](_0x39de21)[_0xe2b7('0x28')](function(_0x4c2812){_0x4fc24c[_0xe2b7('0x20')]=_0x4c2812;if(_0x589ab7[_0xe2b7('0x36')][_0xe2b7('0x47')]){_0xe952e1['include']=[{'all':!![]}];}return db[_0xe2b7('0x30')][_0xe2b7('0x48')](_0xe952e1);})['then'](function(_0x3e264a){_0x4fc24c[_0xe2b7('0x49')]=_0x3e264a;return _0x4fc24c;})[_0xe2b7('0x28')](respondWithFilteredResult(_0x429ada,_0xe952e1))['catch'](handleError(_0x429ada,null));};exports[_0xe2b7('0x4a')]=function(_0x18b09a,_0x44fdc9){var _0x3ff30b={'raw':!![],'where':{'id':_0x18b09a[_0xe2b7('0x4b')]['id']}},_0x656a10={};_0x656a10['model']=_['keys'](db[_0xe2b7('0x30')][_0xe2b7('0x31')]);_0x656a10['query']=_[_0xe2b7('0x37')](_0x18b09a[_0xe2b7('0x36')]);_0x656a10[_0xe2b7('0x38')]=_['intersection'](_0x656a10[_0xe2b7('0x35')],_0x656a10['query']);_0x3ff30b[_0xe2b7('0x3b')]=_[_0xe2b7('0x39')](_0x656a10[_0xe2b7('0x35')],qs[_0xe2b7('0x3a')](_0x18b09a[_0xe2b7('0x36')][_0xe2b7('0x3a')]));_0x3ff30b[_0xe2b7('0x3b')]=_0x3ff30b['attributes'][_0xe2b7('0x3c')]?_0x3ff30b['attributes']:_0x656a10[_0xe2b7('0x35')];if(_0x18b09a[_0xe2b7('0x36')][_0xe2b7('0x47')]){_0x3ff30b[_0xe2b7('0x4c')]=[{'all':!![]}];}_0x3ff30b=_['merge']({},_0x3ff30b,_0x18b09a[_0xe2b7('0x46')]);return db[_0xe2b7('0x30')][_0xe2b7('0x4d')](_0x3ff30b)[_0xe2b7('0x28')](handleEntityNotFound(_0x44fdc9,null))[_0xe2b7('0x28')](respondWithResult(_0x44fdc9,null))[_0xe2b7('0x4e')](handleError(_0x44fdc9,null));};exports[_0xe2b7('0x4f')]=function(_0x38fd2c,_0x3223c5){return db['AnalyticExtractedReport'][_0xe2b7('0x4f')](_0x38fd2c['body'],{})[_0xe2b7('0x28')](function(_0x1419f9){var _0xb14a93=_0x38fd2c['user']['get']({'plain':!![]});if(!_0xb14a93)throw new Error(_0xe2b7('0x50'));if(_0xb14a93['role']===_0xe2b7('0x51')){var _0x5d97a0=_0x1419f9[_0xe2b7('0x52')]({'plain':!![]});var _0x4a753c=_0xe2b7('0x53');return db[_0xe2b7('0x54')][_0xe2b7('0x4d')]({'where':{'name':_0x4a753c,'userProfileId':_0xb14a93['userProfileId']},'raw':!![]})[_0xe2b7('0x28')](function(_0x42c83a){if(_0x42c83a&&_0x42c83a[_0xe2b7('0x55')]===0x0){return db[_0xe2b7('0x2a')]['create']({'name':_0x5d97a0['name'],'resourceId':_0x5d97a0['id'],'type':_0x42c83a[_0xe2b7('0x2d')],'sectionId':_0x42c83a['id']},{})[_0xe2b7('0x28')](function(){return _0x1419f9;});}else{return _0x1419f9;}})[_0xe2b7('0x4e')](function(_0x30f19d){logger[_0xe2b7('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30f19d);throw _0x30f19d;});}return _0x1419f9;})[_0xe2b7('0x28')](respondWithResult(_0x3223c5,0xc9))[_0xe2b7('0x4e')](handleError(_0x3223c5,null));};exports[_0xe2b7('0x27')]=function(_0x4de5dd,_0x344ead){if(_0x4de5dd[_0xe2b7('0x56')]['id']){delete _0x4de5dd[_0xe2b7('0x56')]['id'];}return db[_0xe2b7('0x30')][_0xe2b7('0x4d')]({'where':{'id':_0x4de5dd['params']['id']}})[_0xe2b7('0x28')](handleEntityNotFound(_0x344ead,null))[_0xe2b7('0x28')](saveUpdates(_0x4de5dd[_0xe2b7('0x56')],null))[_0xe2b7('0x28')](respondWithResult(_0x344ead,null))[_0xe2b7('0x4e')](handleError(_0x344ead,null));};exports[_0xe2b7('0x29')]=function(_0x568fc0,_0xb2e4bd){return db[_0xe2b7('0x30')][_0xe2b7('0x4d')]({'where':{'id':_0x568fc0[_0xe2b7('0x4b')]['id']}})[_0xe2b7('0x28')](handleEntityNotFound(_0xb2e4bd,null))[_0xe2b7('0x28')](removeEntity(_0xb2e4bd,null))[_0xe2b7('0x4e')](handleError(_0xb2e4bd,null));};exports[_0xe2b7('0x57')]=function(_0x414e51,_0x31d722,_0x21ca03){return db['AnalyticExtractedReport'][_0xe2b7('0x4d')]({'where':{'id':_0x414e51['params']['id']},'attributes':[_0xe2b7('0x2d'),'basename',_0xe2b7('0x58'),'output'],'raw':!![]})[_0xe2b7('0x28')](handleEntityNotFound(_0x31d722,null))[_0xe2b7('0x28')](function(_0x470d6a){if(_0x470d6a){if(!fs[_0xe2b7('0x59')](path[_0xe2b7('0x5a')](config[_0xe2b7('0x5b')],_0xe2b7('0x5c'),_0x470d6a[_0xe2b7('0x58')]))){throw new db[(_0xe2b7('0x5d'))][(_0xe2b7('0x5e'))](_0xe2b7('0x5f'));}if(_0x414e51[_0xe2b7('0x36')][_0xe2b7('0x60')]){return _0x31d722[_0xe2b7('0x1a')](0xc8);}return _0x31d722[_0xe2b7('0x57')](path[_0xe2b7('0x5a')](config[_0xe2b7('0x5b')],_0xe2b7('0x5c'),_0x470d6a[_0xe2b7('0x58')]),util['format'](_0xe2b7('0x61'),_0x470d6a[_0xe2b7('0x62')]||_0x470d6a[_0xe2b7('0x2d')],_0x470d6a[_0xe2b7('0x63')][_0xe2b7('0x64')]()));}})[_0xe2b7('0x4e')](handleError(_0x31d722,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a2cf7c4..0e90c8f 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 _0xbd1f=['analytics_extracted_reports','lodash','util','api','moment','bluebird','path','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x1fee29,_0x1aa1b5){var _0x2d2c2b=function(_0x1db2d2){while(--_0x1db2d2){_0x1fee29['push'](_0x1fee29['shift']());}};_0x2d2c2b(++_0x1aa1b5);}(_0xbd1f,0xb5));var _0xfbd1=function(_0x29d6f1,_0x4465c0){_0x29d6f1=_0x29d6f1-0x0;var _0x3cd8b8=_0xbd1f[_0x29d6f1];return _0x3cd8b8;};'use strict';var _=require(_0xfbd1('0x0'));var util=require(_0xfbd1('0x1'));var logger=require('../../config/logger')(_0xfbd1('0x2'));var moment=require(_0xfbd1('0x3'));var BPromise=require(_0xfbd1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbd1('0x6'));module[_0xfbd1('0x7')]=function(_0x378055,_0x3ee268){return _0x378055['define'](_0xfbd1('0x8'),attributes,{'tableName':_0xfbd1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x890f=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x890f,0xac));var _0xf890=function(_0x41249e,_0x275d84){_0x41249e=_0x41249e-0x0;var _0x2bff48=_0x890f[_0x41249e];return _0x2bff48;};'use strict';var _=require(_0xf890('0x0'));var util=require(_0xf890('0x1'));var logger=require('../../config/logger')(_0xf890('0x2'));var moment=require(_0xf890('0x3'));var BPromise=require(_0xf890('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf890('0x5'));var rimraf=require(_0xf890('0x6'));var config=require('../../config/environment');var attributes=require(_0xf890('0x7'));module[_0xf890('0x8')]=function(_0x240e28,_0xa4b21){return _0x240e28[_0xf890('0x9')](_0xf890('0xa'),attributes,{'tableName':_0xf890('0xb'),'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 42f537b..5b4bc00 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 _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb2af,0xd2));var _0xfb2a=function(_0x430b76,_0x4f73b7){_0x430b76=_0x430b76-0x0;var _0x4dad15=_0xb2af[_0x430b76];return _0x4dad15;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});} \ No newline at end of file +var _0x5044=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5044,0x7c));var _0x4504=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x5044[_0x3932eb];return _0x5316e5;};'use strict';var _=require(_0x4504('0x0'));var util=require(_0x4504('0x1'));var moment=require(_0x4504('0x2'));var BPromise=require(_0x4504('0x3'));var rs=require(_0x4504('0x4'));var fs=require('fs');var Redis=require(_0x4504('0x5'));var db=require(_0x4504('0x6'))['db'];var utils=require(_0x4504('0x7'));var logger=require(_0x4504('0x8'))('rpc');var config=require(_0x4504('0x9'));var jayson=require(_0x4504('0xa'));var client=jayson[_0x4504('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9b1a26,_0x14785e,_0x5c72e0){return new BPromise(function(_0x50b2d1,_0x20157c){return client['request'](_0x9b1a26,_0x5c72e0)[_0x4504('0xc')](function(_0x160b65){logger[_0x4504('0xd')](_0x4504('0xe'),_0x14785e,_0x4504('0xf'));logger['debug'](_0x4504('0x10'),_0x14785e,'request\x20sent',JSON[_0x4504('0x11')](_0x160b65));if(_0x160b65[_0x4504('0x12')]){if(_0x160b65['error'][_0x4504('0x13')]===0x1f4){logger[_0x4504('0x12')](_0x4504('0xe'),_0x14785e,_0x160b65['error']['message']);return _0x20157c(_0x160b65[_0x4504('0x12')][_0x4504('0x14')]);}logger[_0x4504('0x12')](_0x4504('0xe'),_0x14785e,_0x160b65[_0x4504('0x12')][_0x4504('0x14')]);return _0x50b2d1(_0x160b65[_0x4504('0x12')][_0x4504('0x14')]);}else{logger[_0x4504('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x14785e,'request\x20sent');_0x50b2d1(_0x160b65[_0x4504('0x15')]['message']);}})[_0x4504('0x16')](function(_0xdd2460){logger[_0x4504('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x14785e,_0xdd2460);_0x20157c(_0xdd2460);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e1014dd..5d1b22e 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 _0x9e58=['express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','isAuthenticated','create','put','/:id','update','delete','multer','path','connect-timeout'];(function(_0x2e0dfa,_0x3f6cf3){var _0x781fe=function(_0x48be6e){while(--_0x48be6e){_0x2e0dfa['push'](_0x2e0dfa['shift']());}};_0x781fe(++_0x3f6cf3);}(_0x9e58,0x11d));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89e5('0x0'));var util=require('util');var path=require(_0x89e5('0x1'));var timeout=require(_0x89e5('0x2'));var express=require(_0x89e5('0x3'));var router=express[_0x89e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89e5('0x6'));var controller=require(_0x89e5('0x7'));router[_0x89e5('0x8')]('/',auth['isAuthenticated'](),controller[_0x89e5('0x9')]);router[_0x89e5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x89e5('0xa')]);router[_0x89e5('0x8')](_0x89e5('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x89e5('0xc')](),controller[_0x89e5('0xd')]);router[_0x89e5('0xe')](_0x89e5('0xf'),auth['isAuthenticated'](),controller[_0x89e5('0x10')]);router[_0x89e5('0x11')]('/:id',auth[_0x89e5('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x61a5=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4752ca,_0x29f3e4){var _0x6df077=function(_0x14f15e){while(--_0x14f15e){_0x4752ca['push'](_0x4752ca['shift']());}};_0x6df077(++_0x29f3e4);}(_0x61a5,0x13f));var _0x561a=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x61a5[_0x425716];return _0x2d39af;};'use strict';var multer=require(_0x561a('0x0'));var util=require(_0x561a('0x1'));var path=require('path');var timeout=require(_0x561a('0x2'));var express=require('express');var router=express[_0x561a('0x3')]();var fs_extra=require(_0x561a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x561a('0x5'));var config=require('../../config/environment');var controller=require(_0x561a('0x6'));router[_0x561a('0x7')]('/',auth[_0x561a('0x8')](),controller[_0x561a('0x9')]);router[_0x561a('0x7')](_0x561a('0xa'),auth[_0x561a('0x8')](),controller['show']);router[_0x561a('0x7')](_0x561a('0xb'),auth[_0x561a('0x8')](),controller[_0x561a('0xc')]);router[_0x561a('0xd')]('/',auth[_0x561a('0x8')](),controller[_0x561a('0xe')]);router[_0x561a('0xf')]('/:id',auth[_0x561a('0x8')](),controller[_0x561a('0x10')]);router[_0x561a('0x11')](_0x561a('0xa'),auth[_0x561a('0x8')](),controller[_0x561a('0x12')]);module[_0x561a('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 10ec583..41693ef 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 _0x6516=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x22218b,_0x53d871){var _0x14e54b=function(_0x207a76){while(--_0x207a76){_0x22218b['push'](_0x22218b['shift']());}};_0x14e54b(++_0x53d871);}(_0x6516,0xcf));var _0x6651=function(_0x46f385,_0x4e9de2){_0x46f385=_0x46f385-0x0;var _0x27b7fc=_0x6516[_0x46f385];return _0x27b7fc;};'use strict';var Sequelize=require(_0x6651('0x0'));module['exports']={'field':{'type':Sequelize[_0x6651('0x1')]},'alias':{'type':Sequelize[_0x6651('0x2')]},'function':{'type':Sequelize[_0x6651('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6651('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6651('0x2')]},'custom':{'type':Sequelize[_0x6651('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xab00=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x31f687,_0x51a1a7){var _0x3876a7=function(_0x37c67c){while(--_0x37c67c){_0x31f687['push'](_0x31f687['shift']());}};_0x3876a7(++_0x51a1a7);}(_0xab00,0x1a6));var _0x0ab0=function(_0x1fac03,_0x28df42){_0x1fac03=_0x1fac03-0x0;var _0x596904=_0xab00[_0x1fac03];return _0x596904;};'use strict';var Sequelize=require(_0x0ab0('0x0'));module['exports']={'field':{'type':Sequelize[_0x0ab0('0x1')]},'alias':{'type':Sequelize[_0x0ab0('0x2')]},'function':{'type':Sequelize[_0x0ab0('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0ab0('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0ab0('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index f1c193d..3e6841f 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 _0xb6a8=['where','type','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','bulkCreate','params','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter'];(function(_0x5112ae,_0x3aebce){var _0x13c388=function(_0x16a9c4){while(--_0x16a9c4){_0x5112ae['push'](_0x5112ae['shift']());}};_0x13c388(++_0x3aebce);}(_0xb6a8,0x160));var _0x8b6a=function(_0x3340f5,_0x1b62c7){_0x3340f5=_0x3340f5-0x0;var _0x447105=_0xb6a8[_0x3340f5];return _0x447105;};'use strict';var emlformat=require(_0x8b6a('0x0'));var rimraf=require(_0x8b6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b6a('0x2'));var rp=require(_0x8b6a('0x3'));var moment=require('moment');var BPromise=require(_0x8b6a('0x4'));var Mustache=require(_0x8b6a('0x5'));var util=require(_0x8b6a('0x6'));var path=require(_0x8b6a('0x7'));var sox=require(_0x8b6a('0x8'));var csv=require(_0x8b6a('0x9'));var ejs=require(_0x8b6a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b6a('0xb'));var squel=require(_0x8b6a('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b6a('0xd'));var deskjs=require(_0x8b6a('0xe'));var toCsv=require(_0x8b6a('0x9'));var querystring=require(_0x8b6a('0xf'));var Papa=require(_0x8b6a('0x10'));var Redis=require(_0x8b6a('0x11'));var authService=require(_0x8b6a('0x12'));var qs=require(_0x8b6a('0x13'));var as=require(_0x8b6a('0x14'));var hardwareService=require(_0x8b6a('0x15'));var logger=require(_0x8b6a('0x16'))(_0x8b6a('0x17'));var utils=require(_0x8b6a('0x18'));var config=require(_0x8b6a('0x19'));var licenseUtil=require(_0x8b6a('0x1a'));var db=require(_0x8b6a('0x1b'))['db'];function respondWithStatusCode(_0x4f9ab3,_0x4df8be){_0x4df8be=_0x4df8be||0xcc;return function(_0x5895a9){if(_0x5895a9){return _0x4f9ab3[_0x8b6a('0x1c')](_0x4df8be);}return _0x4f9ab3[_0x8b6a('0x1d')](_0x4df8be)[_0x8b6a('0x1e')]();};}function respondWithResult(_0x87614b,_0x4871b7){_0x4871b7=_0x4871b7||0xc8;return function(_0xb9f719){if(_0xb9f719){return _0x87614b[_0x8b6a('0x1d')](_0x4871b7)[_0x8b6a('0x1f')](_0xb9f719);}};}function respondWithFilteredResult(_0x2c232f,_0x507c7b){return function(_0x5c38ff){if(_0x5c38ff){var _0x3a88d3=typeof _0x507c7b[_0x8b6a('0x20')]===_0x8b6a('0x21')&&typeof _0x507c7b[_0x8b6a('0x22')]===_0x8b6a('0x21');var _0x5132f7=_0x5c38ff[_0x8b6a('0x23')];var _0x36f1ed=_0x3a88d3?0x0:_0x507c7b[_0x8b6a('0x20')];var _0x448069=_0x3a88d3?_0x5c38ff[_0x8b6a('0x23')]:_0x507c7b[_0x8b6a('0x20')]+_0x507c7b[_0x8b6a('0x22')];var _0xf7852c;if(_0x448069>=_0x5132f7){_0x448069=_0x5132f7;_0xf7852c=0xc8;}else{_0xf7852c=0xce;}_0x2c232f[_0x8b6a('0x1d')](_0xf7852c);return _0x2c232f['set'](_0x8b6a('0x24'),_0x36f1ed+'-'+_0x448069+'/'+_0x5132f7)[_0x8b6a('0x1f')](_0x5c38ff);}return null;};}function patchUpdates(_0x83176e){return function(_0x4e6109){try{jsonpatch[_0x8b6a('0x25')](_0x4e6109,_0x83176e,!![]);}catch(_0xa5083a){return BPromise['reject'](_0xa5083a);}return _0x4e6109[_0x8b6a('0x26')]();};}function saveUpdates(_0x233032,_0x5603d1){return function(_0x4ac68c){if(_0x4ac68c){return _0x4ac68c[_0x8b6a('0x27')](_0x233032)['then'](function(_0x3d1c7c){return _0x3d1c7c;});}return null;};}function removeEntity(_0x1a6f4a,_0x56285e){return function(_0x5b8375){if(_0x5b8375){return _0x5b8375[_0x8b6a('0x28')]()[_0x8b6a('0x29')](function(){_0x1a6f4a['status'](0xcc)[_0x8b6a('0x1e')]();});}};}function handleEntityNotFound(_0x17bd2f,_0x3805ad){return function(_0x1a80c0){if(!_0x1a80c0){_0x17bd2f[_0x8b6a('0x1c')](0x194);}return _0x1a80c0;};}function handleError(_0x18b6c5,_0x4c7878){_0x4c7878=_0x4c7878||0x1f4;return function(_0x4fec25){logger[_0x8b6a('0x2a')](_0x4fec25[_0x8b6a('0x2b')]);if(_0x4fec25[_0x8b6a('0x2c')]){delete _0x4fec25[_0x8b6a('0x2c')];}_0x18b6c5[_0x8b6a('0x1d')](_0x4c7878)['send'](_0x4fec25);};}exports['index']=function(_0x6472eb,_0x418dbf){var _0x4c1e7c={},_0x355885={},_0x182b6e={'count':0x0,'rows':[]};var _0x4a31e2=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x5a4221){return{'name':_0x5a4221['fieldName'],'type':_0x5a4221['type'][_0x8b6a('0x2d')]};});_0x355885[_0x8b6a('0x2e')]=_[_0x8b6a('0x2f')](_0x4a31e2,'name');_0x355885[_0x8b6a('0x30')]=_['keys'](_0x6472eb[_0x8b6a('0x30')]);_0x355885[_0x8b6a('0x31')]=_[_0x8b6a('0x32')](_0x355885[_0x8b6a('0x2e')],_0x355885[_0x8b6a('0x30')]);_0x4c1e7c[_0x8b6a('0x33')]=_['intersection'](_0x355885['model'],qs[_0x8b6a('0x34')](_0x6472eb['query'][_0x8b6a('0x34')]));_0x4c1e7c[_0x8b6a('0x33')]=_0x4c1e7c[_0x8b6a('0x33')][_0x8b6a('0x35')]?_0x4c1e7c[_0x8b6a('0x33')]:_0x355885['model'];if(!_0x6472eb[_0x8b6a('0x30')]['hasOwnProperty'](_0x8b6a('0x36'))){_0x4c1e7c[_0x8b6a('0x22')]=qs[_0x8b6a('0x22')](_0x6472eb[_0x8b6a('0x30')]['limit']);_0x4c1e7c[_0x8b6a('0x20')]=qs['offset'](_0x6472eb['query'][_0x8b6a('0x20')]);}_0x4c1e7c['order']=qs[_0x8b6a('0x37')](_0x6472eb['query'][_0x8b6a('0x37')]);_0x4c1e7c['where']=qs['filters'](_[_0x8b6a('0x38')](_0x6472eb['query'],_0x355885['filters']),_0x4a31e2);if(_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x39')]){_0x4c1e7c[_0x8b6a('0x3a')]=_['merge'](_0x4c1e7c[_0x8b6a('0x3a')],{'$or':_[_0x8b6a('0x2f')](_0x4a31e2,function(_0x3485b1){if(_0x3485b1[_0x8b6a('0x3b')]!==_0x8b6a('0x3c')){var _0x38f99a={};_0x38f99a[_0x3485b1[_0x8b6a('0x2c')]]={'$like':'%'+_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x39')]+'%'};return _0x38f99a;}})});}_0x4c1e7c=_[_0x8b6a('0x3d')]({},_0x4c1e7c,_0x6472eb[_0x8b6a('0x3e')]);var _0x4747f3={'where':_0x4c1e7c[_0x8b6a('0x3a')]};return db[_0x8b6a('0x3f')][_0x8b6a('0x23')](_0x4747f3)['then'](function(_0x247702){_0x182b6e[_0x8b6a('0x23')]=_0x247702;if(_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x40')]){_0x4c1e7c[_0x8b6a('0x41')]=[{'all':!![]}];}return db[_0x8b6a('0x3f')][_0x8b6a('0x42')](_0x4c1e7c);})[_0x8b6a('0x29')](function(_0x578920){_0x182b6e[_0x8b6a('0x43')]=_0x578920;return _0x182b6e;})[_0x8b6a('0x29')](respondWithFilteredResult(_0x418dbf,_0x4c1e7c))['catch'](handleError(_0x418dbf,null));};exports[_0x8b6a('0x44')]=function(_0x39470c,_0x263ed1){var _0x45122f={'raw':![],'where':{'id':_0x39470c['params']['id']}},_0x49fa6d={};_0x49fa6d[_0x8b6a('0x2e')]=_[_0x8b6a('0x45')](db['AnalyticFieldReport'][_0x8b6a('0x46')]);_0x49fa6d[_0x8b6a('0x30')]=_[_0x8b6a('0x45')](_0x39470c[_0x8b6a('0x30')]);_0x49fa6d[_0x8b6a('0x31')]=_[_0x8b6a('0x32')](_0x49fa6d[_0x8b6a('0x2e')],_0x49fa6d[_0x8b6a('0x30')]);_0x45122f[_0x8b6a('0x33')]=_[_0x8b6a('0x32')](_0x49fa6d['model'],qs['fields'](_0x39470c['query'][_0x8b6a('0x34')]));_0x45122f['attributes']=_0x45122f[_0x8b6a('0x33')]['length']?_0x45122f[_0x8b6a('0x33')]:_0x49fa6d[_0x8b6a('0x2e')];if(_0x39470c[_0x8b6a('0x30')][_0x8b6a('0x40')]){_0x45122f[_0x8b6a('0x41')]=[{'all':!![]}];}_0x45122f=_['merge']({},_0x45122f,_0x39470c['options']);return db[_0x8b6a('0x3f')][_0x8b6a('0x47')](_0x45122f)[_0x8b6a('0x29')](handleEntityNotFound(_0x263ed1,null))[_0x8b6a('0x29')](respondWithResult(_0x263ed1,null))[_0x8b6a('0x48')](handleError(_0x263ed1,null));};exports[_0x8b6a('0x49')]=function(_0x447a9d,_0x33a2e5){return db['AnalyticFieldReport'][_0x8b6a('0x49')](_0x447a9d[_0x8b6a('0x4a')],{})[_0x8b6a('0x29')](respondWithResult(_0x33a2e5,0xc9))['catch'](handleError(_0x33a2e5,null));};exports[_0x8b6a('0x4b')]=function(_0x3bbc11,_0x36ec6c){return db[_0x8b6a('0x3f')][_0x8b6a('0x4b')](_0x3bbc11[_0x8b6a('0x4a')],{'raw':![],'individualHooks':!![]})[_0x8b6a('0x29')](respondWithResult(_0x36ec6c,0xc9))[_0x8b6a('0x48')](handleError(_0x36ec6c,null));};exports['update']=function(_0x4b8f8c,_0x45e051){if(_0x4b8f8c['body']['id']){delete _0x4b8f8c[_0x8b6a('0x4a')]['id'];}return db['AnalyticFieldReport'][_0x8b6a('0x47')]({'where':{'id':_0x4b8f8c[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x45e051,null))[_0x8b6a('0x29')](saveUpdates(_0x4b8f8c[_0x8b6a('0x4a')],null))[_0x8b6a('0x29')](respondWithResult(_0x45e051,null))[_0x8b6a('0x48')](handleError(_0x45e051,null));};exports['destroy']=function(_0x420712,_0x39fba6){return db['AnalyticFieldReport'][_0x8b6a('0x47')]({'where':{'id':_0x420712[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x39fba6,null))[_0x8b6a('0x29')](removeEntity(_0x39fba6,null))[_0x8b6a('0x48')](handleError(_0x39fba6,null));};exports['bulkDestroy']=function(_0x2f0dcd,_0x45f4d4){return db[_0x8b6a('0x3f')]['destroy']({'where':{'id':_0x2f0dcd[_0x8b6a('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x8b6a('0x29')](respondWithResult(_0x45f4d4,0xcc))[_0x8b6a('0x48')](handleError(_0x45f4d4,null));};exports[_0x8b6a('0x4d')]=function(_0x489b6c,_0x2f85a7,_0x1f9804){return db[_0x8b6a('0x4e')][_0x8b6a('0x4f')]({'where':{'id':_0x489b6c[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x2f85a7,null))[_0x8b6a('0x29')](function(_0x5c1c87){if(_0x5c1c87){return db['sequelize'][_0x8b6a('0x50')](function(_0x4cd4e9){return db[_0x8b6a('0x3f')][_0x8b6a('0x28')]({'where':{'CustomReportId':_0x489b6c[_0x8b6a('0x4c')]['id']},'transaction':_0x4cd4e9})['then'](function(_0x2d0a73){var _0x59235f=_[_0x8b6a('0x2f')](_0x489b6c[_0x8b6a('0x4a')],function(_0x463380){delete _0x463380['id'];_0x463380[_0x8b6a('0x51')]=_0x489b6c[_0x8b6a('0x4c')]['id'];return _0x463380;});return db[_0x8b6a('0x3f')][_0x8b6a('0x4b')](_0x59235f,{'transaction':_0x4cd4e9});});})[_0x8b6a('0x29')](function(){return db[_0x8b6a('0x3f')]['findAll']({'where':{'CustomReportId':_0x489b6c[_0x8b6a('0x4c')]['id']}});});}})[_0x8b6a('0x29')](respondWithResult(_0x2f85a7,null))[_0x8b6a('0x48')](handleError(_0x2f85a7,null));}; \ No newline at end of file +var _0x12d0=['then','destroy','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','sequelize','transaction','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','save','update'];(function(_0x472e3b,_0x555bde){var _0x3b8e33=function(_0x431cb7){while(--_0x431cb7){_0x472e3b['push'](_0x472e3b['shift']());}};_0x3b8e33(++_0x555bde);}(_0x12d0,0x1d2));var _0x012d=function(_0x3414d2,_0x47039f){_0x3414d2=_0x3414d2-0x0;var _0xe0e8b7=_0x12d0[_0x3414d2];return _0xe0e8b7;};'use strict';var emlformat=require(_0x012d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x012d('0x1'));var jsonpatch=require(_0x012d('0x2'));var rp=require(_0x012d('0x3'));var moment=require(_0x012d('0x4'));var BPromise=require(_0x012d('0x5'));var Mustache=require(_0x012d('0x6'));var util=require('util');var path=require(_0x012d('0x7'));var sox=require(_0x012d('0x8'));var csv=require(_0x012d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x012d('0xa'));var _=require(_0x012d('0xb'));var squel=require(_0x012d('0xc'));var crypto=require(_0x012d('0xd'));var jsforce=require(_0x012d('0xe'));var deskjs=require(_0x012d('0xf'));var toCsv=require(_0x012d('0x9'));var querystring=require(_0x012d('0x10'));var Papa=require(_0x012d('0x11'));var Redis=require(_0x012d('0x12'));var authService=require(_0x012d('0x13'));var qs=require(_0x012d('0x14'));var as=require(_0x012d('0x15'));var hardwareService=require(_0x012d('0x16'));var logger=require(_0x012d('0x17'))(_0x012d('0x18'));var utils=require(_0x012d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x012d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a11c6,_0x57fd12){_0x57fd12=_0x57fd12||0xcc;return function(_0x5455e7){if(_0x5455e7){return _0x2a11c6[_0x012d('0x1b')](_0x57fd12);}return _0x2a11c6['status'](_0x57fd12)[_0x012d('0x1c')]();};}function respondWithResult(_0x4ed34e,_0x3acc08){_0x3acc08=_0x3acc08||0xc8;return function(_0x15f2f6){if(_0x15f2f6){return _0x4ed34e[_0x012d('0x1d')](_0x3acc08)[_0x012d('0x1e')](_0x15f2f6);}};}function respondWithFilteredResult(_0xf4cbda,_0xca266b){return function(_0x3972e2){if(_0x3972e2){var _0x1a147a=typeof _0xca266b[_0x012d('0x1f')]==='undefined'&&typeof _0xca266b[_0x012d('0x20')]===_0x012d('0x21');var _0x6d0f2a=_0x3972e2['count'];var _0x3f547c=_0x1a147a?0x0:_0xca266b[_0x012d('0x1f')];var _0x580160=_0x1a147a?_0x3972e2['count']:_0xca266b[_0x012d('0x1f')]+_0xca266b['limit'];var _0x152408;if(_0x580160>=_0x6d0f2a){_0x580160=_0x6d0f2a;_0x152408=0xc8;}else{_0x152408=0xce;}_0xf4cbda[_0x012d('0x1d')](_0x152408);return _0xf4cbda[_0x012d('0x22')](_0x012d('0x23'),_0x3f547c+'-'+_0x580160+'/'+_0x6d0f2a)[_0x012d('0x1e')](_0x3972e2);}return null;};}function patchUpdates(_0x18a1e8){return function(_0x2a05fc){try{jsonpatch['apply'](_0x2a05fc,_0x18a1e8,!![]);}catch(_0x1d69f8){return BPromise['reject'](_0x1d69f8);}return _0x2a05fc[_0x012d('0x24')]();};}function saveUpdates(_0x298fc7,_0x24fd76){return function(_0x35d8d4){if(_0x35d8d4){return _0x35d8d4[_0x012d('0x25')](_0x298fc7)[_0x012d('0x26')](function(_0x34ad77){return _0x34ad77;});}return null;};}function removeEntity(_0x5703ad,_0x1da525){return function(_0x2196f7){if(_0x2196f7){return _0x2196f7[_0x012d('0x27')]()[_0x012d('0x26')](function(){_0x5703ad[_0x012d('0x1d')](0xcc)[_0x012d('0x1c')]();});}};}function handleEntityNotFound(_0x238cb0,_0x380f8){return function(_0x3b77a1){if(!_0x3b77a1){_0x238cb0['sendStatus'](0x194);}return _0x3b77a1;};}function handleError(_0x11d69b,_0xf8d92f){_0xf8d92f=_0xf8d92f||0x1f4;return function(_0x41854b){logger['error'](_0x41854b[_0x012d('0x28')]);if(_0x41854b[_0x012d('0x29')]){delete _0x41854b[_0x012d('0x29')];}_0x11d69b[_0x012d('0x1d')](_0xf8d92f)[_0x012d('0x2a')](_0x41854b);};}exports['index']=function(_0x475d90,_0x2c0ead){var _0x1708a9={},_0x5e4e67={},_0x19f680={'count':0x0,'rows':[]};var _0x2ade1e=_['map'](db[_0x012d('0x2b')][_0x012d('0x2c')],function(_0x3f61ab){return{'name':_0x3f61ab[_0x012d('0x2d')],'type':_0x3f61ab['type'][_0x012d('0x2e')]};});_0x5e4e67[_0x012d('0x2f')]=_[_0x012d('0x30')](_0x2ade1e,'name');_0x5e4e67[_0x012d('0x31')]=_['keys'](_0x475d90[_0x012d('0x31')]);_0x5e4e67[_0x012d('0x32')]=_[_0x012d('0x33')](_0x5e4e67[_0x012d('0x2f')],_0x5e4e67[_0x012d('0x31')]);_0x1708a9[_0x012d('0x34')]=_['intersection'](_0x5e4e67[_0x012d('0x2f')],qs[_0x012d('0x35')](_0x475d90[_0x012d('0x31')][_0x012d('0x35')]));_0x1708a9[_0x012d('0x34')]=_0x1708a9[_0x012d('0x34')][_0x012d('0x36')]?_0x1708a9[_0x012d('0x34')]:_0x5e4e67[_0x012d('0x2f')];if(!_0x475d90[_0x012d('0x31')][_0x012d('0x37')](_0x012d('0x38'))){_0x1708a9['limit']=qs[_0x012d('0x20')](_0x475d90[_0x012d('0x31')][_0x012d('0x20')]);_0x1708a9[_0x012d('0x1f')]=qs[_0x012d('0x1f')](_0x475d90['query']['offset']);}_0x1708a9[_0x012d('0x39')]=qs[_0x012d('0x3a')](_0x475d90[_0x012d('0x31')][_0x012d('0x3a')]);_0x1708a9[_0x012d('0x3b')]=qs[_0x012d('0x32')](_[_0x012d('0x3c')](_0x475d90[_0x012d('0x31')],_0x5e4e67[_0x012d('0x32')]),_0x2ade1e);if(_0x475d90[_0x012d('0x31')][_0x012d('0x3d')]){_0x1708a9[_0x012d('0x3b')]=_[_0x012d('0x3e')](_0x1708a9['where'],{'$or':_[_0x012d('0x30')](_0x2ade1e,function(_0x734659){if(_0x734659[_0x012d('0x3f')]!==_0x012d('0x40')){var _0x210fb7={};_0x210fb7[_0x734659[_0x012d('0x29')]]={'$like':'%'+_0x475d90[_0x012d('0x31')]['filter']+'%'};return _0x210fb7;}})});}_0x1708a9=_[_0x012d('0x3e')]({},_0x1708a9,_0x475d90[_0x012d('0x41')]);var _0x2b34e9={'where':_0x1708a9[_0x012d('0x3b')]};return db[_0x012d('0x2b')][_0x012d('0x42')](_0x2b34e9)[_0x012d('0x26')](function(_0x21f85b){_0x19f680[_0x012d('0x42')]=_0x21f85b;if(_0x475d90[_0x012d('0x31')][_0x012d('0x43')]){_0x1708a9['include']=[{'all':!![]}];}return db[_0x012d('0x2b')][_0x012d('0x44')](_0x1708a9);})[_0x012d('0x26')](function(_0x16413d){_0x19f680[_0x012d('0x45')]=_0x16413d;return _0x19f680;})['then'](respondWithFilteredResult(_0x2c0ead,_0x1708a9))[_0x012d('0x46')](handleError(_0x2c0ead,null));};exports[_0x012d('0x47')]=function(_0x228440,_0x464286){var _0x371df0={'raw':![],'where':{'id':_0x228440[_0x012d('0x48')]['id']}},_0x4294f4={};_0x4294f4[_0x012d('0x2f')]=_[_0x012d('0x49')](db[_0x012d('0x2b')][_0x012d('0x2c')]);_0x4294f4[_0x012d('0x31')]=_[_0x012d('0x49')](_0x228440['query']);_0x4294f4['filters']=_[_0x012d('0x33')](_0x4294f4[_0x012d('0x2f')],_0x4294f4[_0x012d('0x31')]);_0x371df0[_0x012d('0x34')]=_[_0x012d('0x33')](_0x4294f4[_0x012d('0x2f')],qs['fields'](_0x228440[_0x012d('0x31')][_0x012d('0x35')]));_0x371df0[_0x012d('0x34')]=_0x371df0[_0x012d('0x34')][_0x012d('0x36')]?_0x371df0[_0x012d('0x34')]:_0x4294f4[_0x012d('0x2f')];if(_0x228440[_0x012d('0x31')]['includeAll']){_0x371df0[_0x012d('0x4a')]=[{'all':!![]}];}_0x371df0=_[_0x012d('0x3e')]({},_0x371df0,_0x228440[_0x012d('0x41')]);return db[_0x012d('0x2b')][_0x012d('0x4b')](_0x371df0)[_0x012d('0x26')](handleEntityNotFound(_0x464286,null))[_0x012d('0x26')](respondWithResult(_0x464286,null))[_0x012d('0x46')](handleError(_0x464286,null));};exports[_0x012d('0x4c')]=function(_0x2373f3,_0x418dd0){return db[_0x012d('0x2b')][_0x012d('0x4c')](_0x2373f3[_0x012d('0x4d')],{})[_0x012d('0x26')](respondWithResult(_0x418dd0,0xc9))[_0x012d('0x46')](handleError(_0x418dd0,null));};exports[_0x012d('0x4e')]=function(_0x4e9007,_0x34f283){return db[_0x012d('0x2b')][_0x012d('0x4e')](_0x4e9007[_0x012d('0x4d')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x34f283,0xc9))[_0x012d('0x46')](handleError(_0x34f283,null));};exports[_0x012d('0x25')]=function(_0x22276a,_0x4aae3e){if(_0x22276a[_0x012d('0x4d')]['id']){delete _0x22276a[_0x012d('0x4d')]['id'];}return db[_0x012d('0x2b')]['find']({'where':{'id':_0x22276a['params']['id']}})[_0x012d('0x26')](handleEntityNotFound(_0x4aae3e,null))[_0x012d('0x26')](saveUpdates(_0x22276a['body'],null))[_0x012d('0x26')](respondWithResult(_0x4aae3e,null))[_0x012d('0x46')](handleError(_0x4aae3e,null));};exports[_0x012d('0x27')]=function(_0x2aeb9f,_0x3bf1cc){return db[_0x012d('0x2b')][_0x012d('0x4b')]({'where':{'id':_0x2aeb9f[_0x012d('0x48')]['id']}})[_0x012d('0x26')](handleEntityNotFound(_0x3bf1cc,null))[_0x012d('0x26')](removeEntity(_0x3bf1cc,null))[_0x012d('0x46')](handleError(_0x3bf1cc,null));};exports[_0x012d('0x4f')]=function(_0x3c09aa,_0x120b9d){return db['AnalyticFieldReport'][_0x012d('0x27')]({'where':{'id':_0x3c09aa[_0x012d('0x31')][_0x012d('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x012d('0x26')](respondWithResult(_0x120b9d,0xcc))[_0x012d('0x46')](handleError(_0x120b9d,null));};exports[_0x012d('0x51')]=function(_0x158fe5,_0x5db9b9,_0x14633d){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x158fe5[_0x012d('0x48')]['id']}})[_0x012d('0x26')](handleEntityNotFound(_0x5db9b9,null))[_0x012d('0x26')](function(_0x314271){if(_0x314271){return db[_0x012d('0x52')][_0x012d('0x53')](function(_0x47829b){return db[_0x012d('0x2b')][_0x012d('0x27')]({'where':{'CustomReportId':_0x158fe5['params']['id']},'transaction':_0x47829b})[_0x012d('0x26')](function(_0x3aadab){var _0x38cb5b=_[_0x012d('0x30')](_0x158fe5['body'],function(_0x41b876){delete _0x41b876['id'];_0x41b876['CustomReportId']=_0x158fe5[_0x012d('0x48')]['id'];return _0x41b876;});return db['AnalyticFieldReport'][_0x012d('0x4e')](_0x38cb5b,{'transaction':_0x47829b});});})[_0x012d('0x26')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x158fe5[_0x012d('0x48')]['id']}});});}})[_0x012d('0x26')](respondWithResult(_0x5db9b9,null))['catch'](handleError(_0x5db9b9,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ab4e895..54ae1c3 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 _0x5579=['moment','request-promise','path','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x29d994,_0x74c530){var _0x304d4a=function(_0x4a2b14){while(--_0x4a2b14){_0x29d994['push'](_0x29d994['shift']());}};_0x304d4a(++_0x74c530);}(_0x5579,0x192));var _0x9557=function(_0x42f1e9,_0x5d1d83){_0x42f1e9=_0x42f1e9-0x0;var _0x56e8b6=_0x5579[_0x42f1e9];return _0x56e8b6;};'use strict';var _=require('lodash');var util=require(_0x9557('0x0'));var logger=require(_0x9557('0x1'))(_0x9557('0x2'));var moment=require(_0x9557('0x3'));var BPromise=require('bluebird');var rp=require(_0x9557('0x4'));var fs=require('fs');var path=require(_0x9557('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0xa6e2fa,_0x1d8a64){return _0xa6e2fa[_0x9557('0x6')](_0x9557('0x7'),attributes,{'tableName':_0x9557('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2097=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x2998f6,_0x29904e){var _0xf1ebac=function(_0x5352ca){while(--_0x5352ca){_0x2998f6['push'](_0x2998f6['shift']());}};_0xf1ebac(++_0x29904e);}(_0x2097,0x168));var _0x7209=function(_0x399060,_0xda4676){_0x399060=_0x399060-0x0;var _0x303936=_0x2097[_0x399060];return _0x303936;};'use strict';var _=require(_0x7209('0x0'));var util=require(_0x7209('0x1'));var logger=require(_0x7209('0x2'))(_0x7209('0x3'));var moment=require(_0x7209('0x4'));var BPromise=require(_0x7209('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7209('0x6'));var rimraf=require(_0x7209('0x7'));var config=require(_0x7209('0x8'));var attributes=require(_0x7209('0x9'));module[_0x7209('0xa')]=function(_0x1af421,_0x5139bf){return _0x1af421[_0x7209('0xb')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 4c429fd..42170bb 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 _0x433e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','result'];(function(_0x4cf7fe,_0x3e89ba){var _0x3d4aec=function(_0x298e60){while(--_0x298e60){_0x4cf7fe['push'](_0x4cf7fe['shift']());}};_0x3d4aec(++_0x3e89ba);}(_0x433e,0x7e));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe433('0x0'));var util=require(_0xe433('0x1'));var moment=require(_0xe433('0x2'));var BPromise=require('bluebird');var rs=require(_0xe433('0x3'));var fs=require('fs');var Redis=require(_0xe433('0x4'));var db=require(_0xe433('0x5'))['db'];var utils=require(_0xe433('0x6'));var logger=require('../../config/logger')(_0xe433('0x7'));var config=require(_0xe433('0x8'));var jayson=require(_0xe433('0x9'));var client=jayson[_0xe433('0xa')][_0xe433('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35e266,_0x2dbc41,_0x188acd){return new BPromise(function(_0x5bf118,_0x599c52){return client[_0xe433('0xc')](_0x35e266,_0x188acd)['then'](function(_0x348947){logger[_0xe433('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2dbc41,'request\x20sent');logger['debug'](_0xe433('0xe'),_0x2dbc41,'request\x20sent',JSON['stringify'](_0x348947));if(_0x348947[_0xe433('0xf')]){if(_0x348947[_0xe433('0xf')][_0xe433('0x10')]===0x1f4){logger[_0xe433('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2dbc41,_0x348947[_0xe433('0xf')][_0xe433('0x11')]);return _0x599c52(_0x348947[_0xe433('0xf')][_0xe433('0x11')]);}logger[_0xe433('0xf')](_0xe433('0x12'),_0x2dbc41,_0x348947['error'][_0xe433('0x11')]);return _0x5bf118(_0x348947['error'][_0xe433('0x11')]);}else{logger[_0xe433('0xd')](_0xe433('0x12'),_0x2dbc41,_0xe433('0x13'));_0x5bf118(_0x348947[_0xe433('0x14')][_0xe433('0x11')]);}})['catch'](function(_0x145c3b){logger['error'](_0xe433('0x12'),_0x2dbc41,_0x145c3b);_0x599c52(_0x145c3b);});});} \ No newline at end of file +var _0xd791=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x38c37d,_0xbf2594){var _0x358127=function(_0x27686a){while(--_0x27686a){_0x38c37d['push'](_0x38c37d['shift']());}};_0x358127(++_0xbf2594);}(_0xd791,0xa8));var _0x1d79=function(_0xc7f23c,_0x2be758){_0xc7f23c=_0xc7f23c-0x0;var _0x4b4def=_0xd791[_0xc7f23c];return _0x4b4def;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d79('0x0'));var BPromise=require(_0x1d79('0x1'));var rs=require(_0x1d79('0x2'));var fs=require('fs');var Redis=require(_0x1d79('0x3'));var db=require(_0x1d79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1d79('0x5'));var config=require(_0x1d79('0x6'));var jayson=require(_0x1d79('0x7'));var client=jayson[_0x1d79('0x8')][_0x1d79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1f1c,_0x3e1f0b,_0x253814){return new BPromise(function(_0x58adb6,_0x155401){return client[_0x1d79('0xa')](_0x2f1f1c,_0x253814)[_0x1d79('0xb')](function(_0x1648b9){logger[_0x1d79('0xc')](_0x1d79('0xd'),_0x3e1f0b,_0x1d79('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3e1f0b,_0x1d79('0xe'),JSON[_0x1d79('0xf')](_0x1648b9));if(_0x1648b9[_0x1d79('0x10')]){if(_0x1648b9[_0x1d79('0x10')][_0x1d79('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3e1f0b,_0x1648b9[_0x1d79('0x10')][_0x1d79('0x12')]);return _0x155401(_0x1648b9[_0x1d79('0x10')][_0x1d79('0x12')]);}logger[_0x1d79('0x10')](_0x1d79('0xd'),_0x3e1f0b,_0x1648b9[_0x1d79('0x10')]['message']);return _0x58adb6(_0x1648b9[_0x1d79('0x10')]['message']);}else{logger[_0x1d79('0xc')](_0x1d79('0xd'),_0x3e1f0b,_0x1d79('0xe'));_0x58adb6(_0x1648b9[_0x1d79('0x13')]['message']);}})[_0x1d79('0x14')](function(_0x3af881){logger[_0x1d79('0x10')](_0x1d79('0xd'),_0x3e1f0b,_0x3af881);_0x155401(_0x3af881);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e1d55c1..d9e5dc2 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(_0x206775,_0x1e32cd){var _0x257898=function(_0x58e971){while(--_0x58e971){_0x206775['push'](_0x206775['shift']());}};_0x257898(++_0x1e32cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x3beb24,_0x56be4d){var _0x72e855=function(_0xaa8297){while(--_0xaa8297){_0x3beb24['push'](_0x3beb24['shift']());}};_0x72e855(++_0x56be4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 3a5ac17..95ffca7 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 _0xbc8b=['name','STRING','TEXT','exports'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0xbc8b[_0x1428d9];return _0x438019;};'use strict';var Sequelize=require('sequelize');module[_0xbbc8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbbc8('0x1')},'table':{'type':Sequelize[_0xbbc8('0x2')]},'metric':{'type':Sequelize[_0xbbc8('0x3')]},'description':{'type':Sequelize[_0xbbc8('0x2')]}}; \ No newline at end of file +var _0x9993=['name','sequelize','STRING'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0x9993,0x109));var _0x3999=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9993[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x3999('0x0'));module['exports']={'name':{'type':Sequelize[_0x3999('0x1')],'allowNull':![],'unique':_0x3999('0x2')},'table':{'type':Sequelize[_0x3999('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3999('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3142add..c701538 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x61bb05,_0x47421f){var _0x3ceb3e=function(_0x54b8f7){while(--_0x54b8f7){_0x61bb05['push'](_0x61bb05['shift']());}};_0x3ceb3e(++_0x47421f);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6a9ed1,_0x185493){_0x6a9ed1=_0x6a9ed1-0x0;var _0x2d0535=_0x8d0e[_0x6a9ed1];return _0x2d0535;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file +var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x43aae9,_0x5354c9){var _0x296627=function(_0x43a85b){while(--_0x43a85b){_0x43aae9['push'](_0x43aae9['shift']());}};_0x296627(++_0x5354c9);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index bb2da9e..04a3012 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 _0x74f3=['bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0xfaef7a,_0x375c7a){var _0x3eb65f=function(_0x5143f9){while(--_0x5143f9){_0xfaef7a['push'](_0xfaef7a['shift']());}};_0x3eb65f(++_0x375c7a);}(_0x74f3,0x164));var _0x374f=function(_0xa681dc,_0x3100aa){_0xa681dc=_0xa681dc-0x0;var _0x422441=_0x74f3[_0xa681dc];return _0x422441;};'use strict';var _=require(_0x374f('0x0'));var util=require(_0x374f('0x1'));var logger=require(_0x374f('0x2'))('api');var moment=require(_0x374f('0x3'));var BPromise=require(_0x374f('0x4'));var rp=require(_0x374f('0x5'));var fs=require('fs');var path=require(_0x374f('0x6'));var rimraf=require('rimraf');var config=require(_0x374f('0x7'));var attributes=require(_0x374f('0x8'));module['exports']=function(_0x1292f2,_0x1eb333){return _0x1292f2[_0x374f('0x9')](_0x374f('0xa'),attributes,{'tableName':_0x374f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5024=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics'];(function(_0x5ed7ec,_0x30f880){var _0x1fa889=function(_0x5105f7){while(--_0x5105f7){_0x5ed7ec['push'](_0x5ed7ec['shift']());}};_0x1fa889(++_0x30f880);}(_0x5024,0xf7));var _0x4502=function(_0x31893a,_0x15cf6f){_0x31893a=_0x31893a-0x0;var _0x18d55d=_0x5024[_0x31893a];return _0x18d55d;};'use strict';var _=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var logger=require(_0x4502('0x2'))(_0x4502('0x3'));var moment=require('moment');var BPromise=require(_0x4502('0x4'));var rp=require(_0x4502('0x5'));var fs=require('fs');var path=require(_0x4502('0x6'));var rimraf=require(_0x4502('0x7'));var config=require(_0x4502('0x8'));var attributes=require(_0x4502('0x9'));module[_0x4502('0xa')]=function(_0x5eddab,_0x548459){return _0x5eddab[_0x4502('0xb')]('AnalyticMetric',attributes,{'tableName':_0x4502('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 4b67397..709b7f7 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 _0x3a85=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x441644,_0x5a8f34){var _0x4326d9=function(_0x58f63f){while(--_0x58f63f){_0x441644['push'](_0x441644['shift']());}};_0x4326d9(++_0x5a8f34);}(_0x3a85,0x1cd));var _0x53a8=function(_0x1f20ef,_0x3cf650){_0x1f20ef=_0x1f20ef-0x0;var _0x170f61=_0x3a85[_0x1f20ef];return _0x170f61;};'use strict';var _=require('lodash');var util=require(_0x53a8('0x0'));var moment=require('moment');var BPromise=require(_0x53a8('0x1'));var rs=require(_0x53a8('0x2'));var fs=require('fs');var Redis=require(_0x53a8('0x3'));var db=require(_0x53a8('0x4'))['db'];var utils=require(_0x53a8('0x5'));var logger=require(_0x53a8('0x6'))(_0x53a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x53a8('0x8')][_0x53a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a17e1,_0x222092,_0x3ee33d){return new BPromise(function(_0x4845b6,_0x3d525a){return client[_0x53a8('0xa')](_0x4a17e1,_0x3ee33d)['then'](function(_0x3f6d4a){logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x222092,_0x53a8('0xd'));logger[_0x53a8('0xe')](_0x53a8('0xf'),_0x222092,_0x53a8('0xd'),JSON[_0x53a8('0x10')](_0x3f6d4a));if(_0x3f6d4a[_0x53a8('0x11')]){if(_0x3f6d4a['error'][_0x53a8('0x12')]===0x1f4){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x3f6d4a[_0x53a8('0x11')]['message']);return _0x3d525a(_0x3f6d4a[_0x53a8('0x11')]['message']);}logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x3f6d4a['error'][_0x53a8('0x13')]);return _0x4845b6(_0x3f6d4a[_0x53a8('0x11')]['message']);}else{logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x222092,'request\x20sent');_0x4845b6(_0x3f6d4a[_0x53a8('0x14')][_0x53a8('0x13')]);}})[_0x53a8('0x15')](function(_0x4a7c8d){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x4a7c8d);_0x3d525a(_0x4a7c8d);});});} \ No newline at end of file +var _0x6e9d=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s'];(function(_0x10e446,_0x15023e){var _0x3243a6=function(_0x5d01d3){while(--_0x5d01d3){_0x10e446['push'](_0x10e446['shift']());}};_0x3243a6(++_0x15023e);}(_0x6e9d,0x87));var _0xd6e9=function(_0xe0a0f,_0x157fc9){_0xe0a0f=_0xe0a0f-0x0;var _0x24f0a6=_0x6e9d[_0xe0a0f];return _0x24f0a6;};'use strict';var _=require(_0xd6e9('0x0'));var util=require('util');var moment=require(_0xd6e9('0x1'));var BPromise=require(_0xd6e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6e9('0x3'));var db=require(_0xd6e9('0x4'))['db'];var utils=require(_0xd6e9('0x5'));var logger=require('../../config/logger')(_0xd6e9('0x6'));var config=require(_0xd6e9('0x7'));var jayson=require(_0xd6e9('0x8'));var client=jayson['client'][_0xd6e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ef26,_0x160a5f,_0x2552e8){return new BPromise(function(_0x151c47,_0x190739){return client[_0xd6e9('0xa')](_0x17ef26,_0x2552e8)[_0xd6e9('0xb')](function(_0x4f6c31){logger[_0xd6e9('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x160a5f,_0xd6e9('0xd'));logger[_0xd6e9('0xe')](_0xd6e9('0xf'),_0x160a5f,_0xd6e9('0xd'),JSON['stringify'](_0x4f6c31));if(_0x4f6c31['error']){if(_0x4f6c31[_0xd6e9('0x10')][_0xd6e9('0x11')]===0x1f4){logger[_0xd6e9('0x10')](_0xd6e9('0x12'),_0x160a5f,_0x4f6c31[_0xd6e9('0x10')][_0xd6e9('0x13')]);return _0x190739(_0x4f6c31[_0xd6e9('0x10')][_0xd6e9('0x13')]);}logger[_0xd6e9('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x160a5f,_0x4f6c31[_0xd6e9('0x10')][_0xd6e9('0x13')]);return _0x151c47(_0x4f6c31['error'][_0xd6e9('0x13')]);}else{logger['info'](_0xd6e9('0x12'),_0x160a5f,'request\x20sent');_0x151c47(_0x4f6c31[_0xd6e9('0x14')][_0xd6e9('0x13')]);}})[_0xd6e9('0x15')](function(_0xad12fd){logger[_0xd6e9('0x10')](_0xd6e9('0x12'),_0x160a5f,_0xad12fd);_0x190739(_0xad12fd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 42c8a6f..5b6c127 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 _0x3e9d=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x3287e1,_0x229d40){_0x3287e1=_0x3287e1-0x0;var _0x15916f=_0x3e9d[_0x3287e1];return _0x15916f;};'use strict';var multer=require(_0xd3e9('0x0'));var util=require(_0xd3e9('0x1'));var path=require('path');var timeout=require(_0xd3e9('0x2'));var express=require(_0xd3e9('0x3'));var router=express[_0xd3e9('0x4')]();var fs_extra=require(_0xd3e9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd3e9('0x6'));var controller=require(_0xd3e9('0x7'));router[_0xd3e9('0x8')]('/',auth[_0xd3e9('0x9')](),controller['index']);router['get'](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xb')]);router[_0xd3e9('0xc')]('/',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xd')]);router[_0xd3e9('0xe')]('/:id',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xf')]);router[_0xd3e9('0x10')](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0x11')]);module[_0xd3e9('0x12')]=router; \ No newline at end of file +var _0xbd18=['post','put','update','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x259fe7,_0x2fc1fb){var _0x45f849=function(_0x454654){while(--_0x454654){_0x259fe7['push'](_0x259fe7['shift']());}};_0x45f849(++_0x2fc1fb);}(_0xbd18,0x195));var _0x8bd1=function(_0x25f715,_0x14a766){_0x25f715=_0x25f715-0x0;var _0x351068=_0xbd18[_0x25f715];return _0x351068;};'use strict';var multer=require(_0x8bd1('0x0'));var util=require(_0x8bd1('0x1'));var path=require(_0x8bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x8bd1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bd1('0x4'));var config=require(_0x8bd1('0x5'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x8bd1('0x6')](),controller[_0x8bd1('0x7')]);router[_0x8bd1('0x8')](_0x8bd1('0x9'),auth['isAuthenticated'](),controller[_0x8bd1('0xa')]);router[_0x8bd1('0xb')]('/',auth[_0x8bd1('0x6')](),controller['create']);router[_0x8bd1('0xc')](_0x8bd1('0x9'),auth[_0x8bd1('0x6')](),controller[_0x8bd1('0xd')]);router['delete'](_0x8bd1('0x9'),auth['isAuthenticated'](),controller[_0x8bd1('0xe')]);module[_0x8bd1('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 164b18f..3d1f44b 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 _0x5eed=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eed,0x145));var _0xd5ee=function(_0x349876,_0x5675a6){_0x349876=_0x349876-0x0;var _0x228824=_0x5eed[_0x349876];return _0x228824;};'use strict';var Sequelize=require('sequelize');module[_0xd5ee('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xb253=['exports','TEXT','sequelize'];(function(_0x4222a3,_0x3cbcb3){var _0x2aabf6=function(_0x59a37c){while(--_0x59a37c){_0x4222a3['push'](_0x4222a3['shift']());}};_0x2aabf6(++_0x3cbcb3);}(_0xb253,0x15b));var _0x3b25=function(_0x1f973c,_0x3c309e){_0x1f973c=_0x1f973c-0x0;var _0x66ad61=_0xb253[_0x1f973c];return _0x66ad61;};'use strict';var Sequelize=require(_0x3b25('0x0'));module[_0x3b25('0x1')]={'tree':{'type':Sequelize[_0x3b25('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 3b4ee3e..54be0da 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 _0x62e6=['util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','order','sort','pick','where','merge','include','rows','catch','keys','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3adb98,_0x29935f){var _0x4dbaef=function(_0x226afb){while(--_0x226afb){_0x3adb98['push'](_0x3adb98['shift']());}};_0x4dbaef(++_0x29935f);}(_0x62e6,0xd5));var _0x662e=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x62e6[_0x46c9cc];return _0x21b46e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x662e('0x0'));var zipdir=require(_0x662e('0x1'));var jsonpatch=require(_0x662e('0x2'));var rp=require(_0x662e('0x3'));var moment=require(_0x662e('0x4'));var BPromise=require(_0x662e('0x5'));var Mustache=require('mustache');var util=require(_0x662e('0x6'));var path=require(_0x662e('0x7'));var sox=require(_0x662e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x662e('0x9'));var _=require(_0x662e('0xa'));var squel=require('squel');var crypto=require(_0x662e('0xb'));var jsforce=require(_0x662e('0xc'));var deskjs=require(_0x662e('0xd'));var toCsv=require(_0x662e('0xe'));var querystring=require(_0x662e('0xf'));var Papa=require(_0x662e('0x10'));var Redis=require(_0x662e('0x11'));var authService=require(_0x662e('0x12'));var qs=require(_0x662e('0x13'));var as=require(_0x662e('0x14'));var hardwareService=require(_0x662e('0x15'));var logger=require(_0x662e('0x16'))(_0x662e('0x17'));var utils=require(_0x662e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x662e('0x19'));var db=require(_0x662e('0x1a'))['db'];function respondWithStatusCode(_0x3e94ef,_0x549995){_0x549995=_0x549995||0xcc;return function(_0x1766ac){if(_0x1766ac){return _0x3e94ef['sendStatus'](_0x549995);}return _0x3e94ef[_0x662e('0x1b')](_0x549995)[_0x662e('0x1c')]();};}function respondWithResult(_0xd17212,_0x5aa8dc){_0x5aa8dc=_0x5aa8dc||0xc8;return function(_0x2db8da){if(_0x2db8da){return _0xd17212[_0x662e('0x1b')](_0x5aa8dc)[_0x662e('0x1d')](_0x2db8da);}};}function respondWithFilteredResult(_0x580848,_0x14741f){return function(_0x1ad8df){if(_0x1ad8df){var _0xa08d55=typeof _0x14741f[_0x662e('0x1e')]===_0x662e('0x1f')&&typeof _0x14741f['limit']==='undefined';var _0x3d4e8f=_0x1ad8df[_0x662e('0x20')];var _0x243128=_0xa08d55?0x0:_0x14741f[_0x662e('0x1e')];var _0x30f22b=_0xa08d55?_0x1ad8df['count']:_0x14741f[_0x662e('0x1e')]+_0x14741f[_0x662e('0x21')];var _0x59dd65;if(_0x30f22b>=_0x3d4e8f){_0x30f22b=_0x3d4e8f;_0x59dd65=0xc8;}else{_0x59dd65=0xce;}_0x580848['status'](_0x59dd65);return _0x580848[_0x662e('0x22')]('Content-Range',_0x243128+'-'+_0x30f22b+'/'+_0x3d4e8f)['json'](_0x1ad8df);}return null;};}function patchUpdates(_0x5c0741){return function(_0x2e8571){try{jsonpatch[_0x662e('0x23')](_0x2e8571,_0x5c0741,!![]);}catch(_0x1197b3){return BPromise[_0x662e('0x24')](_0x1197b3);}return _0x2e8571[_0x662e('0x25')]();};}function saveUpdates(_0x33f390,_0x2a6672){return function(_0x12da54){if(_0x12da54){return _0x12da54[_0x662e('0x26')](_0x33f390)[_0x662e('0x27')](function(_0x366900){return _0x366900;});}return null;};}function removeEntity(_0x38c02e,_0x1c1c91){return function(_0x3fb270){if(_0x3fb270){return _0x3fb270[_0x662e('0x28')]()[_0x662e('0x27')](function(){_0x38c02e[_0x662e('0x1b')](0xcc)[_0x662e('0x1c')]();});}};}function handleEntityNotFound(_0x4f4a32,_0x1c556a){return function(_0x20d0c9){if(!_0x20d0c9){_0x4f4a32[_0x662e('0x29')](0x194);}return _0x20d0c9;};}function handleError(_0x3d6447,_0x156811){_0x156811=_0x156811||0x1f4;return function(_0xff3e06){logger[_0x662e('0x2a')](_0xff3e06[_0x662e('0x2b')]);if(_0xff3e06['name']){delete _0xff3e06[_0x662e('0x2c')];}_0x3d6447[_0x662e('0x1b')](_0x156811)[_0x662e('0x2d')](_0xff3e06);};}exports[_0x662e('0x2e')]=function(_0xbe4da5,_0x541df3){var _0x486135={},_0x35de49={},_0x4320fb={'count':0x0,'rows':[]};var _0x2a3b35=_[_0x662e('0x2f')](db[_0x662e('0x30')][_0x662e('0x31')],function(_0x2f920f){return{'name':_0x2f920f[_0x662e('0x32')],'type':_0x2f920f[_0x662e('0x33')][_0x662e('0x34')]};});_0x35de49['model']=_[_0x662e('0x2f')](_0x2a3b35,'name');_0x35de49[_0x662e('0x35')]=_['keys'](_0xbe4da5['query']);_0x35de49[_0x662e('0x36')]=_[_0x662e('0x37')](_0x35de49[_0x662e('0x38')],_0x35de49[_0x662e('0x35')]);_0x486135['attributes']=_['intersection'](_0x35de49[_0x662e('0x38')],qs['fields'](_0xbe4da5[_0x662e('0x35')][_0x662e('0x39')]));_0x486135['attributes']=_0x486135[_0x662e('0x3a')]['length']?_0x486135[_0x662e('0x3a')]:_0x35de49[_0x662e('0x38')];if(!_0xbe4da5[_0x662e('0x35')]['hasOwnProperty']('nolimit')){_0x486135[_0x662e('0x21')]=qs[_0x662e('0x21')](_0xbe4da5[_0x662e('0x35')][_0x662e('0x21')]);_0x486135[_0x662e('0x1e')]=qs[_0x662e('0x1e')](_0xbe4da5[_0x662e('0x35')][_0x662e('0x1e')]);}_0x486135[_0x662e('0x3b')]=qs[_0x662e('0x3c')](_0xbe4da5['query'][_0x662e('0x3c')]);_0x486135['where']=qs[_0x662e('0x36')](_[_0x662e('0x3d')](_0xbe4da5[_0x662e('0x35')],_0x35de49[_0x662e('0x36')]),_0x2a3b35);if(_0xbe4da5[_0x662e('0x35')]['filter']){_0x486135[_0x662e('0x3e')]=_[_0x662e('0x3f')](_0x486135[_0x662e('0x3e')],{'$or':_[_0x662e('0x2f')](_0x2a3b35,function(_0xc3ba27){if(_0xc3ba27[_0x662e('0x33')]!=='VIRTUAL'){var _0x206bb8={};_0x206bb8[_0xc3ba27[_0x662e('0x2c')]]={'$like':'%'+_0xbe4da5[_0x662e('0x35')]['filter']+'%'};return _0x206bb8;}})});}_0x486135=_[_0x662e('0x3f')]({},_0x486135,_0xbe4da5['options']);var _0x5c06fe={'where':_0x486135[_0x662e('0x3e')]};return db[_0x662e('0x30')][_0x662e('0x20')](_0x5c06fe)[_0x662e('0x27')](function(_0x226f92){_0x4320fb[_0x662e('0x20')]=_0x226f92;if(_0xbe4da5[_0x662e('0x35')]['includeAll']){_0x486135[_0x662e('0x40')]=[{'all':!![]}];}return db[_0x662e('0x30')]['findAll'](_0x486135);})[_0x662e('0x27')](function(_0x319070){_0x4320fb[_0x662e('0x41')]=_0x319070;return _0x4320fb;})[_0x662e('0x27')](respondWithFilteredResult(_0x541df3,_0x486135))[_0x662e('0x42')](handleError(_0x541df3,null));};exports['show']=function(_0x5e1df7,_0x469fac){var _0x555c69={'raw':!![],'where':{'id':_0x5e1df7['params']['id']}},_0x263f4e={};_0x263f4e[_0x662e('0x38')]=_[_0x662e('0x43')](db[_0x662e('0x30')][_0x662e('0x31')]);_0x263f4e['query']=_[_0x662e('0x43')](_0x5e1df7[_0x662e('0x35')]);_0x263f4e[_0x662e('0x36')]=_[_0x662e('0x37')](_0x263f4e[_0x662e('0x38')],_0x263f4e[_0x662e('0x35')]);_0x555c69[_0x662e('0x3a')]=_[_0x662e('0x37')](_0x263f4e[_0x662e('0x38')],qs['fields'](_0x5e1df7['query'][_0x662e('0x39')]));_0x555c69[_0x662e('0x3a')]=_0x555c69[_0x662e('0x3a')]['length']?_0x555c69[_0x662e('0x3a')]:_0x263f4e[_0x662e('0x38')];if(_0x5e1df7[_0x662e('0x35')]['includeAll']){_0x555c69[_0x662e('0x40')]=[{'all':!![]}];}_0x555c69=_[_0x662e('0x3f')]({},_0x555c69,_0x5e1df7[_0x662e('0x44')]);return db['AnalyticTreeReport'][_0x662e('0x45')](_0x555c69)['then'](handleEntityNotFound(_0x469fac,null))[_0x662e('0x27')](respondWithResult(_0x469fac,null))[_0x662e('0x42')](handleError(_0x469fac,null));};exports[_0x662e('0x46')]=function(_0x575a79,_0x3338ce){return db[_0x662e('0x30')][_0x662e('0x46')](_0x575a79[_0x662e('0x47')],{})[_0x662e('0x27')](respondWithResult(_0x3338ce,0xc9))['catch'](handleError(_0x3338ce,null));};exports[_0x662e('0x26')]=function(_0x11ccf1,_0x2e8cc9){if(_0x11ccf1[_0x662e('0x47')]['id']){delete _0x11ccf1[_0x662e('0x47')]['id'];}return db[_0x662e('0x30')][_0x662e('0x45')]({'where':{'id':_0x11ccf1[_0x662e('0x48')]['id']}})[_0x662e('0x27')](handleEntityNotFound(_0x2e8cc9,null))[_0x662e('0x27')](saveUpdates(_0x11ccf1[_0x662e('0x47')],null))[_0x662e('0x27')](respondWithResult(_0x2e8cc9,null))[_0x662e('0x42')](handleError(_0x2e8cc9,null));};exports[_0x662e('0x28')]=function(_0x4e9d52,_0x60b828){return db[_0x662e('0x30')][_0x662e('0x45')]({'where':{'id':_0x4e9d52['params']['id']}})['then'](handleEntityNotFound(_0x60b828,null))['then'](removeEntity(_0x60b828,null))[_0x662e('0x42')](handleError(_0x60b828,null));}; \ No newline at end of file +var _0xe7db=['VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge'];(function(_0x265ce5,_0x3ca145){var _0x22b666=function(_0x54b5a1){while(--_0x54b5a1){_0x265ce5['push'](_0x265ce5['shift']());}};_0x22b666(++_0x3ca145);}(_0xe7db,0x96));var _0xbe7d=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0xe7db[_0xd050c6];return _0x7278a;};'use strict';var emlformat=require(_0xbe7d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe7d('0x1'));var rp=require(_0xbe7d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbe7d('0x3'));var util=require(_0xbe7d('0x4'));var path=require(_0xbe7d('0x5'));var sox=require(_0xbe7d('0x6'));var csv=require(_0xbe7d('0x7'));var ejs=require(_0xbe7d('0x8'));var fs=require('fs');var fs_extra=require(_0xbe7d('0x9'));var _=require(_0xbe7d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe7d('0xb'));var deskjs=require(_0xbe7d('0xc'));var toCsv=require(_0xbe7d('0x7'));var querystring=require(_0xbe7d('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe7d('0xe'));var authService=require(_0xbe7d('0xf'));var qs=require(_0xbe7d('0x10'));var as=require(_0xbe7d('0x11'));var hardwareService=require(_0xbe7d('0x12'));var logger=require('../../config/logger')(_0xbe7d('0x13'));var utils=require('../../config/utils');var config=require(_0xbe7d('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x263338,_0x217f34){_0x217f34=_0x217f34||0xcc;return function(_0x1abf80){if(_0x1abf80){return _0x263338[_0xbe7d('0x15')](_0x217f34);}return _0x263338[_0xbe7d('0x16')](_0x217f34)[_0xbe7d('0x17')]();};}function respondWithResult(_0x5c8154,_0x1758af){_0x1758af=_0x1758af||0xc8;return function(_0x51a683){if(_0x51a683){return _0x5c8154[_0xbe7d('0x16')](_0x1758af)[_0xbe7d('0x18')](_0x51a683);}};}function respondWithFilteredResult(_0x4b6de2,_0x248270){return function(_0x90a2e6){if(_0x90a2e6){var _0x3c8930=typeof _0x248270[_0xbe7d('0x19')]===_0xbe7d('0x1a')&&typeof _0x248270['limit']===_0xbe7d('0x1a');var _0x14683c=_0x90a2e6[_0xbe7d('0x1b')];var _0x464eef=_0x3c8930?0x0:_0x248270[_0xbe7d('0x19')];var _0x2b76e6=_0x3c8930?_0x90a2e6[_0xbe7d('0x1b')]:_0x248270[_0xbe7d('0x19')]+_0x248270[_0xbe7d('0x1c')];var _0x4d0134;if(_0x2b76e6>=_0x14683c){_0x2b76e6=_0x14683c;_0x4d0134=0xc8;}else{_0x4d0134=0xce;}_0x4b6de2[_0xbe7d('0x16')](_0x4d0134);return _0x4b6de2[_0xbe7d('0x1d')]('Content-Range',_0x464eef+'-'+_0x2b76e6+'/'+_0x14683c)['json'](_0x90a2e6);}return null;};}function patchUpdates(_0x18a6e8){return function(_0x11f9a2){try{jsonpatch[_0xbe7d('0x1e')](_0x11f9a2,_0x18a6e8,!![]);}catch(_0x10c8e9){return BPromise[_0xbe7d('0x1f')](_0x10c8e9);}return _0x11f9a2[_0xbe7d('0x20')]();};}function saveUpdates(_0x49625c,_0x111bd6){return function(_0x23a682){if(_0x23a682){return _0x23a682[_0xbe7d('0x21')](_0x49625c)[_0xbe7d('0x22')](function(_0x982f41){return _0x982f41;});}return null;};}function removeEntity(_0x50ac7a,_0x2a2c53){return function(_0x204063){if(_0x204063){return _0x204063['destroy']()[_0xbe7d('0x22')](function(){_0x50ac7a[_0xbe7d('0x16')](0xcc)[_0xbe7d('0x17')]();});}};}function handleEntityNotFound(_0x1007e5,_0x5d30d3){return function(_0x44819e){if(!_0x44819e){_0x1007e5[_0xbe7d('0x15')](0x194);}return _0x44819e;};}function handleError(_0x2b5b7d,_0x3256de){_0x3256de=_0x3256de||0x1f4;return function(_0x70cd38){logger[_0xbe7d('0x23')](_0x70cd38['stack']);if(_0x70cd38[_0xbe7d('0x24')]){delete _0x70cd38[_0xbe7d('0x24')];}_0x2b5b7d['status'](_0x3256de)[_0xbe7d('0x25')](_0x70cd38);};}exports[_0xbe7d('0x26')]=function(_0x573bb2,_0x59a8e8){var _0x54deac={},_0xdc7464={},_0x21a3c3={'count':0x0,'rows':[]};var _0x197a79=_[_0xbe7d('0x27')](db[_0xbe7d('0x28')][_0xbe7d('0x29')],function(_0x258e4d){return{'name':_0x258e4d['fieldName'],'type':_0x258e4d[_0xbe7d('0x2a')][_0xbe7d('0x2b')]};});_0xdc7464[_0xbe7d('0x2c')]=_['map'](_0x197a79,_0xbe7d('0x24'));_0xdc7464[_0xbe7d('0x2d')]=_['keys'](_0x573bb2[_0xbe7d('0x2d')]);_0xdc7464[_0xbe7d('0x2e')]=_[_0xbe7d('0x2f')](_0xdc7464['model'],_0xdc7464[_0xbe7d('0x2d')]);_0x54deac[_0xbe7d('0x30')]=_[_0xbe7d('0x2f')](_0xdc7464[_0xbe7d('0x2c')],qs[_0xbe7d('0x31')](_0x573bb2[_0xbe7d('0x2d')]['fields']));_0x54deac[_0xbe7d('0x30')]=_0x54deac[_0xbe7d('0x30')][_0xbe7d('0x32')]?_0x54deac['attributes']:_0xdc7464[_0xbe7d('0x2c')];if(!_0x573bb2[_0xbe7d('0x2d')]['hasOwnProperty'](_0xbe7d('0x33'))){_0x54deac[_0xbe7d('0x1c')]=qs[_0xbe7d('0x1c')](_0x573bb2[_0xbe7d('0x2d')][_0xbe7d('0x1c')]);_0x54deac['offset']=qs[_0xbe7d('0x19')](_0x573bb2[_0xbe7d('0x2d')]['offset']);}_0x54deac['order']=qs[_0xbe7d('0x34')](_0x573bb2['query']['sort']);_0x54deac[_0xbe7d('0x35')]=qs[_0xbe7d('0x2e')](_[_0xbe7d('0x36')](_0x573bb2[_0xbe7d('0x2d')],_0xdc7464[_0xbe7d('0x2e')]),_0x197a79);if(_0x573bb2[_0xbe7d('0x2d')][_0xbe7d('0x37')]){_0x54deac['where']=_[_0xbe7d('0x38')](_0x54deac[_0xbe7d('0x35')],{'$or':_['map'](_0x197a79,function(_0x348e82){if(_0x348e82[_0xbe7d('0x2a')]!==_0xbe7d('0x39')){var _0x302464={};_0x302464[_0x348e82[_0xbe7d('0x24')]]={'$like':'%'+_0x573bb2[_0xbe7d('0x2d')][_0xbe7d('0x37')]+'%'};return _0x302464;}})});}_0x54deac=_[_0xbe7d('0x38')]({},_0x54deac,_0x573bb2[_0xbe7d('0x3a')]);var _0xc2f01b={'where':_0x54deac[_0xbe7d('0x35')]};return db[_0xbe7d('0x28')][_0xbe7d('0x1b')](_0xc2f01b)[_0xbe7d('0x22')](function(_0x4fbfdf){_0x21a3c3[_0xbe7d('0x1b')]=_0x4fbfdf;if(_0x573bb2[_0xbe7d('0x2d')]['includeAll']){_0x54deac['include']=[{'all':!![]}];}return db[_0xbe7d('0x28')][_0xbe7d('0x3b')](_0x54deac);})[_0xbe7d('0x22')](function(_0x5a79f3){_0x21a3c3[_0xbe7d('0x3c')]=_0x5a79f3;return _0x21a3c3;})[_0xbe7d('0x22')](respondWithFilteredResult(_0x59a8e8,_0x54deac))[_0xbe7d('0x3d')](handleError(_0x59a8e8,null));};exports[_0xbe7d('0x3e')]=function(_0x2f2704,_0x3bce20){var _0x5f2b7c={'raw':!![],'where':{'id':_0x2f2704[_0xbe7d('0x3f')]['id']}},_0x5a508e={};_0x5a508e[_0xbe7d('0x2c')]=_['keys'](db[_0xbe7d('0x28')][_0xbe7d('0x29')]);_0x5a508e[_0xbe7d('0x2d')]=_[_0xbe7d('0x40')](_0x2f2704[_0xbe7d('0x2d')]);_0x5a508e[_0xbe7d('0x2e')]=_[_0xbe7d('0x2f')](_0x5a508e[_0xbe7d('0x2c')],_0x5a508e[_0xbe7d('0x2d')]);_0x5f2b7c[_0xbe7d('0x30')]=_['intersection'](_0x5a508e[_0xbe7d('0x2c')],qs[_0xbe7d('0x31')](_0x2f2704[_0xbe7d('0x2d')][_0xbe7d('0x31')]));_0x5f2b7c['attributes']=_0x5f2b7c[_0xbe7d('0x30')][_0xbe7d('0x32')]?_0x5f2b7c[_0xbe7d('0x30')]:_0x5a508e['model'];if(_0x2f2704[_0xbe7d('0x2d')][_0xbe7d('0x41')]){_0x5f2b7c['include']=[{'all':!![]}];}_0x5f2b7c=_[_0xbe7d('0x38')]({},_0x5f2b7c,_0x2f2704[_0xbe7d('0x3a')]);return db[_0xbe7d('0x28')][_0xbe7d('0x42')](_0x5f2b7c)[_0xbe7d('0x22')](handleEntityNotFound(_0x3bce20,null))[_0xbe7d('0x22')](respondWithResult(_0x3bce20,null))[_0xbe7d('0x3d')](handleError(_0x3bce20,null));};exports[_0xbe7d('0x43')]=function(_0xb00c28,_0x4b30ba){return db[_0xbe7d('0x28')][_0xbe7d('0x43')](_0xb00c28[_0xbe7d('0x44')],{})[_0xbe7d('0x22')](respondWithResult(_0x4b30ba,0xc9))[_0xbe7d('0x3d')](handleError(_0x4b30ba,null));};exports[_0xbe7d('0x21')]=function(_0x3f5f05,_0x11d18c){if(_0x3f5f05[_0xbe7d('0x44')]['id']){delete _0x3f5f05[_0xbe7d('0x44')]['id'];}return db[_0xbe7d('0x28')][_0xbe7d('0x42')]({'where':{'id':_0x3f5f05['params']['id']}})[_0xbe7d('0x22')](handleEntityNotFound(_0x11d18c,null))['then'](saveUpdates(_0x3f5f05['body'],null))[_0xbe7d('0x22')](respondWithResult(_0x11d18c,null))[_0xbe7d('0x3d')](handleError(_0x11d18c,null));};exports['destroy']=function(_0x39ce42,_0x5bc17a){return db[_0xbe7d('0x28')][_0xbe7d('0x42')]({'where':{'id':_0x39ce42[_0xbe7d('0x3f')]['id']}})[_0xbe7d('0x22')](handleEntityNotFound(_0x5bc17a,null))[_0xbe7d('0x22')](removeEntity(_0x5bc17a,null))[_0xbe7d('0x3d')](handleError(_0x5bc17a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 9f7f4ec..90b8c41 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 _0x471c=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x471c,0xad));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 logger=require(_0xc471('0x2'))('api');var moment=require(_0xc471('0x3'));var BPromise=require(_0xc471('0x4'));var rp=require(_0xc471('0x5'));var fs=require('fs');var path=require(_0xc471('0x6'));var rimraf=require(_0xc471('0x7'));var config=require(_0xc471('0x8'));var attributes=require(_0xc471('0x9'));module[_0xc471('0xa')]=function(_0x1ed31e,_0x4b738e){return _0x1ed31e[_0xc471('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xc471('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52bf=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0x52bf,0x9e));var _0xf52b=function(_0x40e63c,_0x78b7d0){_0x40e63c=_0x40e63c-0x0;var _0x52a142=_0x52bf[_0x40e63c];return _0x52a142;};'use strict';var _=require(_0xf52b('0x0'));var util=require(_0xf52b('0x1'));var logger=require(_0xf52b('0x2'))(_0xf52b('0x3'));var moment=require('moment');var BPromise=require(_0xf52b('0x4'));var rp=require(_0xf52b('0x5'));var fs=require('fs');var path=require(_0xf52b('0x6'));var rimraf=require(_0xf52b('0x7'));var config=require(_0xf52b('0x8'));var attributes=require(_0xf52b('0x9'));module[_0xf52b('0xa')]=function(_0x107920,_0x21abb9){return _0x107920[_0xf52b('0xb')](_0xf52b('0xc'),attributes,{'tableName':_0xf52b('0xd'),'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 a5c9fae..8ddbc40 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5ca7d6,_0x192729){_0x5ca7d6=_0x5ca7d6-0x0;var _0x3bdf92=_0x7a54[_0x5ca7d6];return _0x3bdf92;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\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(_0x31bd57,_0x3415ae){var _0x377c04=function(_0x243e3a){while(--_0x243e3a){_0x31bd57['push'](_0x31bd57['shift']());}};_0x377c04(++_0x3415ae);}(_0x1261,0x144));var _0x1126=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0x1261[_0x36147b];return _0x141351;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 10041f5..804b2c4 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 _0x2478=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x21a8a4,_0x2d5e00){var _0x21cc22=function(_0x2ab59d){while(--_0x2ab59d){_0x21a8a4['push'](_0x21a8a4['shift']());}};_0x21cc22(++_0x2d5e00);}(_0x2478,0xf7));var _0x8247=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x2478[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x8247('0x0'));var util=require('util');var path=require(_0x8247('0x1'));var timeout=require(_0x8247('0x2'));var express=require(_0x8247('0x3'));var router=express[_0x8247('0x4')]();var fs_extra=require(_0x8247('0x5'));var auth=require(_0x8247('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8247('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x8247('0x8')]('/',auth[_0x8247('0x9')](),controller[_0x8247('0xa')]);router[_0x8247('0x8')](_0x8247('0xb'),auth[_0x8247('0x9')](),controller[_0x8247('0xc')]);router[_0x8247('0xd')]('/',auth[_0x8247('0x9')](),controller[_0x8247('0xe')]);router['put']('/:id',auth[_0x8247('0x9')](),controller[_0x8247('0xf')]);router['delete']('/:id',auth[_0x8247('0x9')](),controller[_0x8247('0x10')]);module[_0x8247('0x11')]=router; \ No newline at end of file +var _0xf479=['Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','put','update','delete','multer','path','connect-timeout','express'];(function(_0x5d8778,_0x3c2f0e){var _0x133e42=function(_0x2c23aa){while(--_0x2c23aa){_0x5d8778['push'](_0x5d8778['shift']());}};_0x133e42(++_0x3c2f0e);}(_0xf479,0xfb));var _0x9f47=function(_0x523898,_0x3c69e6){_0x523898=_0x523898-0x0;var _0x38ce96=_0xf479[_0x523898];return _0x38ce96;};'use strict';var multer=require(_0x9f47('0x0'));var util=require('util');var path=require(_0x9f47('0x1'));var timeout=require(_0x9f47('0x2'));var express=require(_0x9f47('0x3'));var router=express[_0x9f47('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9f47('0x5'));var controller=require(_0x9f47('0x6'));router[_0x9f47('0x7')]('/',auth[_0x9f47('0x8')](),controller[_0x9f47('0x9')]);router[_0x9f47('0x7')](_0x9f47('0xa'),auth[_0x9f47('0x8')](),controller['show']);router['post']('/',auth[_0x9f47('0x8')](),controller[_0x9f47('0xb')]);router[_0x9f47('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x9f47('0xd')]);router[_0x9f47('0xe')](_0x9f47('0xa'),auth[_0x9f47('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 27ad72b..8e6ca19 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 _0x0328=['STRING','sequelize','exports'];(function(_0x54cc03,_0xe6c22b){var _0x133344=function(_0x2063d7){while(--_0x2063d7){_0x54cc03['push'](_0x54cc03['shift']());}};_0x133344(++_0xe6c22b);}(_0x0328,0x172));var _0x8032=function(_0x31eac8,_0x2bc0f4){_0x31eac8=_0x31eac8-0x0;var _0x37bb59=_0x0328[_0x31eac8];return _0x37bb59;};'use strict';var Sequelize=require(_0x8032('0x0'));module[_0x8032('0x1')]={'name':{'type':Sequelize[_0x8032('0x2')]},'basename':{'type':Sequelize[_0x8032('0x2')]},'type':{'type':Sequelize[_0x8032('0x2')]}}; \ No newline at end of file +var _0x0c6d=['STRING','exports'];(function(_0x250db5,_0x77171d){var _0x5e21c1=function(_0x41c1b4){while(--_0x41c1b4){_0x250db5['push'](_0x250db5['shift']());}};_0x5e21c1(++_0x77171d);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x249d27,_0x1c50d7){_0x249d27=_0x249d27-0x0;var _0x3dda1e=_0x0c6d[_0x249d27];return _0x3dda1e;};'use strict';var Sequelize=require('sequelize');module[_0xd0c6('0x0')]={'name':{'type':Sequelize[_0xd0c6('0x1')]},'basename':{'type':Sequelize[_0xd0c6('0x1')]},'type':{'type':Sequelize[_0xd0c6('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 11c949b..0068101 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 _0x9299=['update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','findAll','rows','catch','show','params','includeAll','include','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save'];(function(_0x915de9,_0xabf9e5){var _0x274129=function(_0x27fd79){while(--_0x27fd79){_0x915de9['push'](_0x915de9['shift']());}};_0x274129(++_0xabf9e5);}(_0x9299,0x139));var _0x9929=function(_0x3f0e54,_0x549b1d){_0x3f0e54=_0x3f0e54-0x0;var _0x2e8036=_0x9299[_0x3f0e54];return _0x2e8036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9929('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9929('0x1'));var rp=require('request-promise');var moment=require(_0x9929('0x2'));var BPromise=require(_0x9929('0x3'));var Mustache=require(_0x9929('0x4'));var util=require(_0x9929('0x5'));var path=require(_0x9929('0x6'));var sox=require('sox');var csv=require(_0x9929('0x7'));var ejs=require(_0x9929('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9929('0x9'));var squel=require(_0x9929('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9929('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9929('0xc'));var Papa=require(_0x9929('0xd'));var Redis=require(_0x9929('0xe'));var authService=require(_0x9929('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9929('0x10'));var hardwareService=require(_0x9929('0x11'));var logger=require('../../config/logger')(_0x9929('0x12'));var utils=require(_0x9929('0x13'));var config=require(_0x9929('0x14'));var licenseUtil=require(_0x9929('0x15'));var db=require(_0x9929('0x16'))['db'];function respondWithStatusCode(_0x28a7a5,_0x1d2565){_0x1d2565=_0x1d2565||0xcc;return function(_0x45c8be){if(_0x45c8be){return _0x28a7a5[_0x9929('0x17')](_0x1d2565);}return _0x28a7a5[_0x9929('0x18')](_0x1d2565)[_0x9929('0x19')]();};}function respondWithResult(_0x39b999,_0x37ae0b){_0x37ae0b=_0x37ae0b||0xc8;return function(_0xcfc6c4){if(_0xcfc6c4){return _0x39b999[_0x9929('0x18')](_0x37ae0b)[_0x9929('0x1a')](_0xcfc6c4);}};}function respondWithFilteredResult(_0x5d41e5,_0x2266c){return function(_0x2dffb8){if(_0x2dffb8){var _0xc1300=typeof _0x2266c[_0x9929('0x1b')]===_0x9929('0x1c')&&typeof _0x2266c['limit']===_0x9929('0x1c');var _0x2ffd4b=_0x2dffb8[_0x9929('0x1d')];var _0x280c7b=_0xc1300?0x0:_0x2266c[_0x9929('0x1b')];var _0x254847=_0xc1300?_0x2dffb8[_0x9929('0x1d')]:_0x2266c[_0x9929('0x1b')]+_0x2266c[_0x9929('0x1e')];var _0x3c31fc;if(_0x254847>=_0x2ffd4b){_0x254847=_0x2ffd4b;_0x3c31fc=0xc8;}else{_0x3c31fc=0xce;}_0x5d41e5[_0x9929('0x18')](_0x3c31fc);return _0x5d41e5[_0x9929('0x1f')]('Content-Range',_0x280c7b+'-'+_0x254847+'/'+_0x2ffd4b)[_0x9929('0x1a')](_0x2dffb8);}return null;};}function patchUpdates(_0x545d05){return function(_0xb148f5){try{jsonpatch[_0x9929('0x20')](_0xb148f5,_0x545d05,!![]);}catch(_0x4446f1){return BPromise[_0x9929('0x21')](_0x4446f1);}return _0xb148f5[_0x9929('0x22')]();};}function saveUpdates(_0xf34dc6,_0x451082){return function(_0x46c830){if(_0x46c830){return _0x46c830[_0x9929('0x23')](_0xf34dc6)['then'](function(_0x36a9ee){return _0x36a9ee;});}return null;};}function removeEntity(_0x5a8dee,_0x3e3941){return function(_0x34952c){if(_0x34952c){return _0x34952c[_0x9929('0x24')]()[_0x9929('0x25')](function(){_0x5a8dee[_0x9929('0x18')](0xcc)[_0x9929('0x19')]();});}};}function handleEntityNotFound(_0x131547,_0x180b05){return function(_0x1439d9){if(!_0x1439d9){_0x131547[_0x9929('0x17')](0x194);}return _0x1439d9;};}function handleError(_0x53cc8f,_0x42e449){_0x42e449=_0x42e449||0x1f4;return function(_0x762727){logger[_0x9929('0x26')](_0x762727['stack']);if(_0x762727['name']){delete _0x762727[_0x9929('0x27')];}_0x53cc8f['status'](_0x42e449)[_0x9929('0x28')](_0x762727);};}exports[_0x9929('0x29')]=function(_0x2e878f,_0x3c3fbb){var _0x16dd9f={},_0x54cebe={},_0x5dc8a4={'count':0x0,'rows':[]};var _0x27bfcb=_[_0x9929('0x2a')](db[_0x9929('0x2b')][_0x9929('0x2c')],function(_0x2b339b){return{'name':_0x2b339b[_0x9929('0x2d')],'type':_0x2b339b[_0x9929('0x2e')][_0x9929('0x2f')]};});_0x54cebe[_0x9929('0x30')]=_['map'](_0x27bfcb,_0x9929('0x27'));_0x54cebe[_0x9929('0x31')]=_[_0x9929('0x32')](_0x2e878f[_0x9929('0x31')]);_0x54cebe['filters']=_[_0x9929('0x33')](_0x54cebe[_0x9929('0x30')],_0x54cebe[_0x9929('0x31')]);_0x16dd9f[_0x9929('0x34')]=_[_0x9929('0x33')](_0x54cebe[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2e878f[_0x9929('0x31')]['fields']));_0x16dd9f[_0x9929('0x34')]=_0x16dd9f[_0x9929('0x34')][_0x9929('0x36')]?_0x16dd9f[_0x9929('0x34')]:_0x54cebe['model'];if(!_0x2e878f[_0x9929('0x31')][_0x9929('0x37')](_0x9929('0x38'))){_0x16dd9f['limit']=qs['limit'](_0x2e878f['query'][_0x9929('0x1e')]);_0x16dd9f[_0x9929('0x1b')]=qs['offset'](_0x2e878f[_0x9929('0x31')][_0x9929('0x1b')]);}_0x16dd9f[_0x9929('0x39')]=qs[_0x9929('0x3a')](_0x2e878f[_0x9929('0x31')][_0x9929('0x3a')]);_0x16dd9f[_0x9929('0x3b')]=qs[_0x9929('0x3c')](_['pick'](_0x2e878f[_0x9929('0x31')],_0x54cebe[_0x9929('0x3c')]),_0x27bfcb);if(_0x2e878f[_0x9929('0x31')]['filter']){_0x16dd9f[_0x9929('0x3b')]=_[_0x9929('0x3d')](_0x16dd9f[_0x9929('0x3b')],{'$or':_[_0x9929('0x2a')](_0x27bfcb,function(_0x50d358){if(_0x50d358['type']!=='VIRTUAL'){var _0x59cbd6={};_0x59cbd6[_0x50d358['name']]={'$like':'%'+_0x2e878f[_0x9929('0x31')][_0x9929('0x3e')]+'%'};return _0x59cbd6;}})});}_0x16dd9f=_[_0x9929('0x3d')]({},_0x16dd9f,_0x2e878f[_0x9929('0x3f')]);var _0x3cb8fb={'where':_0x16dd9f[_0x9929('0x3b')]};return db['Attachment'][_0x9929('0x1d')](_0x3cb8fb)['then'](function(_0x1d4f33){_0x5dc8a4[_0x9929('0x1d')]=_0x1d4f33;if(_0x2e878f[_0x9929('0x31')]['includeAll']){_0x16dd9f['include']=[{'all':!![]}];}return db[_0x9929('0x2b')][_0x9929('0x40')](_0x16dd9f);})[_0x9929('0x25')](function(_0x4bddc8){_0x5dc8a4[_0x9929('0x41')]=_0x4bddc8;return _0x5dc8a4;})[_0x9929('0x25')](respondWithFilteredResult(_0x3c3fbb,_0x16dd9f))[_0x9929('0x42')](handleError(_0x3c3fbb,null));};exports[_0x9929('0x43')]=function(_0x2ea689,_0x40ae53){var _0x21d7ed={'raw':!![],'where':{'id':_0x2ea689[_0x9929('0x44')]['id']}},_0x244e03={};_0x244e03[_0x9929('0x30')]=_[_0x9929('0x32')](db['Attachment'][_0x9929('0x2c')]);_0x244e03[_0x9929('0x31')]=_[_0x9929('0x32')](_0x2ea689['query']);_0x244e03[_0x9929('0x3c')]=_[_0x9929('0x33')](_0x244e03[_0x9929('0x30')],_0x244e03[_0x9929('0x31')]);_0x21d7ed[_0x9929('0x34')]=_[_0x9929('0x33')](_0x244e03[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2ea689[_0x9929('0x31')][_0x9929('0x35')]));_0x21d7ed[_0x9929('0x34')]=_0x21d7ed[_0x9929('0x34')][_0x9929('0x36')]?_0x21d7ed[_0x9929('0x34')]:_0x244e03[_0x9929('0x30')];if(_0x2ea689[_0x9929('0x31')][_0x9929('0x45')]){_0x21d7ed[_0x9929('0x46')]=[{'all':!![]}];}_0x21d7ed=_[_0x9929('0x3d')]({},_0x21d7ed,_0x2ea689[_0x9929('0x3f')]);return db[_0x9929('0x2b')][_0x9929('0x47')](_0x21d7ed)[_0x9929('0x25')](handleEntityNotFound(_0x40ae53,null))[_0x9929('0x25')](respondWithResult(_0x40ae53,null))['catch'](handleError(_0x40ae53,null));};exports['clone']=function(_0x2c223f,_0x15a2ba){var _0x98fae1={'where':{'id':_0x2c223f[_0x9929('0x44')]['id']}},_0x2f352b={};_0x2f352b[_0x9929('0x30')]=_['keys'](db['Attachment'][_0x9929('0x2c')]);_0x98fae1[_0x9929('0x34')]=_[_0x9929('0x33')](_0x2f352b[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2c223f[_0x9929('0x31')][_0x9929('0x35')]));_0x98fae1['attributes']=_0x98fae1[_0x9929('0x34')][_0x9929('0x36')]?_0x98fae1[_0x9929('0x34')]:_0x2f352b[_0x9929('0x30')];if(_0x2c223f[_0x9929('0x31')][_0x9929('0x45')]){_0x98fae1['include']=[{'all':!![]}];}_0x98fae1=_[_0x9929('0x3d')]({},_0x98fae1,_0x2c223f[_0x9929('0x3f')]);return db[_0x9929('0x2b')]['find'](_0x98fae1)[_0x9929('0x25')](handleEntityNotFound(_0x15a2ba,null))['then'](function(_0x2c8d3e){if(_0x2c8d3e){var _0x587b78=_0x2c8d3e[_0x9929('0x48')]({'plain':!![]});_0x587b78=qs[_0x9929('0x49')](_0x587b78,['id',_0x9929('0x4a'),_0x9929('0x4b')]);_0x2c223f[_0x9929('0x4c')]=_['omit'](_0x2c223f[_0x9929('0x4c')],['id',_0x9929('0x4a'),'updatedAt']);return db[_0x9929('0x2b')]['create'](_['merge'](_0x587b78,_0x2c223f['body']),{'include':_0x2c223f[_0x9929('0x31')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x9929('0x25')](respondWithResult(_0x15a2ba,0xc9))[_0x9929('0x42')](handleError(_0x15a2ba,null));};exports[_0x9929('0x23')]=function(_0x1f9974,_0x2423c3){if(_0x1f9974[_0x9929('0x4c')]['id']){delete _0x1f9974[_0x9929('0x4c')]['id'];}return db[_0x9929('0x2b')][_0x9929('0x47')]({'where':{'id':_0x1f9974[_0x9929('0x44')]['id']}})[_0x9929('0x25')](handleEntityNotFound(_0x2423c3,null))[_0x9929('0x25')](saveUpdates(_0x1f9974['body'],null))[_0x9929('0x25')](respondWithResult(_0x2423c3,null))[_0x9929('0x42')](handleError(_0x2423c3,null));};exports['destroy']=function(_0x491c75,_0x20c283){return db['Attachment']['find']({'where':{'id':_0x491c75[_0x9929('0x44')]['id']}})[_0x9929('0x25')](handleEntityNotFound(_0x20c283,null))[_0x9929('0x25')](removeEntity(_0x20c283,null))[_0x9929('0x42')](handleError(_0x20c283,null));};exports[_0x9929('0x4d')]=function(_0xcd6fa9,_0x569eaf,_0x1dd8b2){_0xcd6fa9['body'][_0x9929('0x27')]=_0xcd6fa9['file'][_0x9929('0x4e')];_0xcd6fa9[_0x9929('0x4c')][_0x9929('0x4f')]=_0xcd6fa9[_0x9929('0x50')]['filename'];_0xcd6fa9['body'][_0x9929('0x2e')]=_0xcd6fa9[_0x9929('0x50')][_0x9929('0x51')];return db[_0x9929('0x2b')]['create'](_0xcd6fa9[_0x9929('0x4c')])['then'](respondWithResult(_0x569eaf,0xc9))['catch'](handleError(_0x569eaf,null));};exports[_0x9929('0x52')]=function(_0x1330a9,_0x3a236c,_0x5a0600){return db[_0x9929('0x2b')][_0x9929('0x53')]({'where':{'id':_0x1330a9[_0x9929('0x44')]['id']},'raw':!![]})[_0x9929('0x25')](handleEntityNotFound(_0x3a236c,null))[_0x9929('0x25')](function(_0xc1b10a){if(_0xc1b10a){var _0x465201=_0xc1b10a[_0x9929('0x54')]!==null;var _0x3f031b=path[_0x9929('0x55')](config['root'],_0x9929('0x56'));if(_0x465201){_0x3f031b=path['join'](_0x3f031b,'offline-chat/');}var _0x49581f=path[_0x9929('0x55')](_0x3f031b,_0xc1b10a[_0x9929('0x4f')]);return _0x3a236c[_0x9929('0x52')](_0x49581f);}})['catch'](handleError(_0x3a236c,null));}; \ No newline at end of file +var _0xa5d6=['rawAttributes','intersection','clone','params','length','includeAll','get','createdAt','body','omit','updatedAt','find','create','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','type','model','query','keys','filters','fields','attributes','nolimit','sort','where','filter','merge','VIRTUAL','options','Attachment','findAll','catch'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xa5d6,0xc9));var _0x6a5d=function(_0x3971cc,_0x2d73d7){_0x3971cc=_0x3971cc-0x0;var _0x3434c3=_0xa5d6[_0x3971cc];return _0x3434c3;};'use strict';var emlformat=require(_0x6a5d('0x0'));var rimraf=require(_0x6a5d('0x1'));var zipdir=require(_0x6a5d('0x2'));var jsonpatch=require(_0x6a5d('0x3'));var rp=require(_0x6a5d('0x4'));var moment=require(_0x6a5d('0x5'));var BPromise=require(_0x6a5d('0x6'));var Mustache=require(_0x6a5d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6a5d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a5d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6a5d('0xa'));var jsforce=require(_0x6a5d('0xb'));var deskjs=require(_0x6a5d('0xc'));var toCsv=require(_0x6a5d('0xd'));var querystring=require(_0x6a5d('0xe'));var Papa=require(_0x6a5d('0xf'));var Redis=require(_0x6a5d('0x10'));var authService=require(_0x6a5d('0x11'));var qs=require(_0x6a5d('0x12'));var as=require(_0x6a5d('0x13'));var hardwareService=require(_0x6a5d('0x14'));var logger=require(_0x6a5d('0x15'))(_0x6a5d('0x16'));var utils=require(_0x6a5d('0x17'));var config=require(_0x6a5d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14d26a,_0x1138db){_0x1138db=_0x1138db||0xcc;return function(_0x13f241){if(_0x13f241){return _0x14d26a[_0x6a5d('0x19')](_0x1138db);}return _0x14d26a[_0x6a5d('0x1a')](_0x1138db)[_0x6a5d('0x1b')]();};}function respondWithResult(_0x2578ad,_0x2a02b3){_0x2a02b3=_0x2a02b3||0xc8;return function(_0x347d81){if(_0x347d81){return _0x2578ad[_0x6a5d('0x1a')](_0x2a02b3)[_0x6a5d('0x1c')](_0x347d81);}};}function respondWithFilteredResult(_0x507abf,_0x45363b){return function(_0x3791a6){if(_0x3791a6){var _0x1b598e=typeof _0x45363b['offset']==='undefined'&&typeof _0x45363b[_0x6a5d('0x1d')]===_0x6a5d('0x1e');var _0x3abde5=_0x3791a6[_0x6a5d('0x1f')];var _0x11d716=_0x1b598e?0x0:_0x45363b[_0x6a5d('0x20')];var _0x57f0de=_0x1b598e?_0x3791a6[_0x6a5d('0x1f')]:_0x45363b[_0x6a5d('0x20')]+_0x45363b[_0x6a5d('0x1d')];var _0x10486e;if(_0x57f0de>=_0x3abde5){_0x57f0de=_0x3abde5;_0x10486e=0xc8;}else{_0x10486e=0xce;}_0x507abf['status'](_0x10486e);return _0x507abf[_0x6a5d('0x21')](_0x6a5d('0x22'),_0x11d716+'-'+_0x57f0de+'/'+_0x3abde5)[_0x6a5d('0x1c')](_0x3791a6);}return null;};}function patchUpdates(_0x4c8d75){return function(_0x4856dc){try{jsonpatch[_0x6a5d('0x23')](_0x4856dc,_0x4c8d75,!![]);}catch(_0x2bfb89){return BPromise[_0x6a5d('0x24')](_0x2bfb89);}return _0x4856dc[_0x6a5d('0x25')]();};}function saveUpdates(_0x4594c4,_0x275015){return function(_0x17a53d){if(_0x17a53d){return _0x17a53d[_0x6a5d('0x26')](_0x4594c4)[_0x6a5d('0x27')](function(_0xb26dd5){return _0xb26dd5;});}return null;};}function removeEntity(_0x4e8ff9,_0xddab36){return function(_0x10ed3b){if(_0x10ed3b){return _0x10ed3b[_0x6a5d('0x28')]()[_0x6a5d('0x27')](function(){_0x4e8ff9[_0x6a5d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1504ba,_0x2b4636){return function(_0x44d5f7){if(!_0x44d5f7){_0x1504ba[_0x6a5d('0x19')](0x194);}return _0x44d5f7;};}function handleError(_0x5459d3,_0x96b93b){_0x96b93b=_0x96b93b||0x1f4;return function(_0x23009e){logger['error'](_0x23009e[_0x6a5d('0x29')]);if(_0x23009e[_0x6a5d('0x2a')]){delete _0x23009e[_0x6a5d('0x2a')];}_0x5459d3[_0x6a5d('0x1a')](_0x96b93b)[_0x6a5d('0x2b')](_0x23009e);};}exports[_0x6a5d('0x2c')]=function(_0xf513b3,_0x2d8b44){var _0x4ed51c={},_0x4e1a4a={},_0x2f8300={'count':0x0,'rows':[]};var _0x2487d1=_[_0x6a5d('0x2d')](db['Attachment']['rawAttributes'],function(_0x2d899d){return{'name':_0x2d899d['fieldName'],'type':_0x2d899d[_0x6a5d('0x2e')]['key']};});_0x4e1a4a[_0x6a5d('0x2f')]=_[_0x6a5d('0x2d')](_0x2487d1,'name');_0x4e1a4a[_0x6a5d('0x30')]=_[_0x6a5d('0x31')](_0xf513b3[_0x6a5d('0x30')]);_0x4e1a4a[_0x6a5d('0x32')]=_['intersection'](_0x4e1a4a['model'],_0x4e1a4a['query']);_0x4ed51c['attributes']=_['intersection'](_0x4e1a4a['model'],qs[_0x6a5d('0x33')](_0xf513b3[_0x6a5d('0x30')]['fields']));_0x4ed51c['attributes']=_0x4ed51c[_0x6a5d('0x34')]['length']?_0x4ed51c[_0x6a5d('0x34')]:_0x4e1a4a[_0x6a5d('0x2f')];if(!_0xf513b3[_0x6a5d('0x30')]['hasOwnProperty'](_0x6a5d('0x35'))){_0x4ed51c[_0x6a5d('0x1d')]=qs['limit'](_0xf513b3['query'][_0x6a5d('0x1d')]);_0x4ed51c[_0x6a5d('0x20')]=qs['offset'](_0xf513b3['query'][_0x6a5d('0x20')]);}_0x4ed51c['order']=qs[_0x6a5d('0x36')](_0xf513b3[_0x6a5d('0x30')][_0x6a5d('0x36')]);_0x4ed51c[_0x6a5d('0x37')]=qs[_0x6a5d('0x32')](_['pick'](_0xf513b3['query'],_0x4e1a4a[_0x6a5d('0x32')]),_0x2487d1);if(_0xf513b3[_0x6a5d('0x30')][_0x6a5d('0x38')]){_0x4ed51c['where']=_[_0x6a5d('0x39')](_0x4ed51c[_0x6a5d('0x37')],{'$or':_['map'](_0x2487d1,function(_0x4cd869){if(_0x4cd869[_0x6a5d('0x2e')]!==_0x6a5d('0x3a')){var _0x21b898={};_0x21b898[_0x4cd869[_0x6a5d('0x2a')]]={'$like':'%'+_0xf513b3['query'][_0x6a5d('0x38')]+'%'};return _0x21b898;}})});}_0x4ed51c=_['merge']({},_0x4ed51c,_0xf513b3[_0x6a5d('0x3b')]);var _0x3da7a={'where':_0x4ed51c[_0x6a5d('0x37')]};return db[_0x6a5d('0x3c')][_0x6a5d('0x1f')](_0x3da7a)[_0x6a5d('0x27')](function(_0x23553c){_0x2f8300[_0x6a5d('0x1f')]=_0x23553c;if(_0xf513b3[_0x6a5d('0x30')]['includeAll']){_0x4ed51c['include']=[{'all':!![]}];}return db['Attachment'][_0x6a5d('0x3d')](_0x4ed51c);})['then'](function(_0x13e69b){_0x2f8300['rows']=_0x13e69b;return _0x2f8300;})[_0x6a5d('0x27')](respondWithFilteredResult(_0x2d8b44,_0x4ed51c))[_0x6a5d('0x3e')](handleError(_0x2d8b44,null));};exports['show']=function(_0x3ede71,_0xed82d8){var _0x2a3bc5={'raw':!![],'where':{'id':_0x3ede71['params']['id']}},_0x2b8159={};_0x2b8159[_0x6a5d('0x2f')]=_[_0x6a5d('0x31')](db[_0x6a5d('0x3c')][_0x6a5d('0x3f')]);_0x2b8159[_0x6a5d('0x30')]=_[_0x6a5d('0x31')](_0x3ede71['query']);_0x2b8159[_0x6a5d('0x32')]=_[_0x6a5d('0x40')](_0x2b8159[_0x6a5d('0x2f')],_0x2b8159['query']);_0x2a3bc5[_0x6a5d('0x34')]=_['intersection'](_0x2b8159[_0x6a5d('0x2f')],qs[_0x6a5d('0x33')](_0x3ede71[_0x6a5d('0x30')]['fields']));_0x2a3bc5[_0x6a5d('0x34')]=_0x2a3bc5[_0x6a5d('0x34')]['length']?_0x2a3bc5[_0x6a5d('0x34')]:_0x2b8159[_0x6a5d('0x2f')];if(_0x3ede71['query']['includeAll']){_0x2a3bc5['include']=[{'all':!![]}];}_0x2a3bc5=_[_0x6a5d('0x39')]({},_0x2a3bc5,_0x3ede71['options']);return db[_0x6a5d('0x3c')]['find'](_0x2a3bc5)[_0x6a5d('0x27')](handleEntityNotFound(_0xed82d8,null))[_0x6a5d('0x27')](respondWithResult(_0xed82d8,null))[_0x6a5d('0x3e')](handleError(_0xed82d8,null));};exports[_0x6a5d('0x41')]=function(_0x2f40c7,_0x1a28c7){var _0x46f25f={'where':{'id':_0x2f40c7[_0x6a5d('0x42')]['id']}},_0x465942={};_0x465942[_0x6a5d('0x2f')]=_[_0x6a5d('0x31')](db['Attachment'][_0x6a5d('0x3f')]);_0x46f25f[_0x6a5d('0x34')]=_[_0x6a5d('0x40')](_0x465942['model'],qs[_0x6a5d('0x33')](_0x2f40c7[_0x6a5d('0x30')]['fields']));_0x46f25f['attributes']=_0x46f25f[_0x6a5d('0x34')][_0x6a5d('0x43')]?_0x46f25f[_0x6a5d('0x34')]:_0x465942[_0x6a5d('0x2f')];if(_0x2f40c7['query'][_0x6a5d('0x44')]){_0x46f25f['include']=[{'all':!![]}];}_0x46f25f=_['merge']({},_0x46f25f,_0x2f40c7[_0x6a5d('0x3b')]);return db['Attachment']['find'](_0x46f25f)[_0x6a5d('0x27')](handleEntityNotFound(_0x1a28c7,null))['then'](function(_0x914dd4){if(_0x914dd4){var _0x39a6d2=_0x914dd4[_0x6a5d('0x45')]({'plain':!![]});_0x39a6d2=qs['omit'](_0x39a6d2,['id',_0x6a5d('0x46'),'updatedAt']);_0x2f40c7[_0x6a5d('0x47')]=_[_0x6a5d('0x48')](_0x2f40c7['body'],['id','createdAt',_0x6a5d('0x49')]);return db['Attachment']['create'](_['merge'](_0x39a6d2,_0x2f40c7[_0x6a5d('0x47')]),{'include':_0x2f40c7[_0x6a5d('0x30')][_0x6a5d('0x44')]?[{'all':!![]}]:undefined});}})[_0x6a5d('0x27')](respondWithResult(_0x1a28c7,0xc9))[_0x6a5d('0x3e')](handleError(_0x1a28c7,null));};exports['update']=function(_0x53c54,_0x1138aa){if(_0x53c54[_0x6a5d('0x47')]['id']){delete _0x53c54[_0x6a5d('0x47')]['id'];}return db['Attachment'][_0x6a5d('0x4a')]({'where':{'id':_0x53c54[_0x6a5d('0x42')]['id']}})['then'](handleEntityNotFound(_0x1138aa,null))['then'](saveUpdates(_0x53c54[_0x6a5d('0x47')],null))[_0x6a5d('0x27')](respondWithResult(_0x1138aa,null))[_0x6a5d('0x3e')](handleError(_0x1138aa,null));};exports[_0x6a5d('0x28')]=function(_0x47d68d,_0x55ca0d){return db[_0x6a5d('0x3c')][_0x6a5d('0x4a')]({'where':{'id':_0x47d68d[_0x6a5d('0x42')]['id']}})[_0x6a5d('0x27')](handleEntityNotFound(_0x55ca0d,null))['then'](removeEntity(_0x55ca0d,null))['catch'](handleError(_0x55ca0d,null));};exports[_0x6a5d('0x4b')]=function(_0x3f203a,_0x1c6873,_0x90581f){_0x3f203a[_0x6a5d('0x47')][_0x6a5d('0x2a')]=_0x3f203a[_0x6a5d('0x4c')][_0x6a5d('0x4d')];_0x3f203a[_0x6a5d('0x47')]['basename']=_0x3f203a['file'][_0x6a5d('0x4e')];_0x3f203a[_0x6a5d('0x47')]['type']=_0x3f203a[_0x6a5d('0x4c')][_0x6a5d('0x4f')];return db[_0x6a5d('0x3c')][_0x6a5d('0x4b')](_0x3f203a[_0x6a5d('0x47')])['then'](respondWithResult(_0x1c6873,0xc9))[_0x6a5d('0x3e')](handleError(_0x1c6873,null));};exports['download']=function(_0x4e075e,_0x49b576,_0x34896b){return db[_0x6a5d('0x3c')][_0x6a5d('0x50')]({'where':{'id':_0x4e075e[_0x6a5d('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x49b576,null))[_0x6a5d('0x27')](function(_0x1598b3){if(_0x1598b3){var _0x27c14c=_0x1598b3[_0x6a5d('0x51')]!==null;var _0x348558=path[_0x6a5d('0x52')](config[_0x6a5d('0x53')],_0x6a5d('0x54'));if(_0x27c14c){_0x348558=path['join'](_0x348558,_0x6a5d('0x55'));}var _0x531e46=path['join'](_0x348558,_0x1598b3[_0x6a5d('0x56')]);return _0x49b576[_0x6a5d('0x57')](_0x531e46);}})['catch'](handleError(_0x49b576,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index fcdaa0f..6580f51 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 _0xb88d=['./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dbf5a,_0x4613fc){var _0x5e83a8=function(_0x523916){while(--_0x523916){_0x3dbf5a['push'](_0x3dbf5a['shift']());}};_0x5e83a8(++_0x4613fc);}(_0xb88d,0x101));var _0xdb88=function(_0x57e05f,_0x318b8d){_0x57e05f=_0x57e05f-0x0;var _0x435e54=_0xb88d[_0x57e05f];return _0x435e54;};'use strict';var _=require('lodash');var util=require(_0xdb88('0x0'));var logger=require(_0xdb88('0x1'))(_0xdb88('0x2'));var moment=require(_0xdb88('0x3'));var BPromise=require(_0xdb88('0x4'));var rp=require(_0xdb88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb88('0x6'));var attributes=require(_0xdb88('0x7'));module[_0xdb88('0x8')]=function(_0x265c6f,_0x5439c8){return _0x265c6f[_0xdb88('0x9')](_0xdb88('0xa'),attributes,{'tableName':_0xdb88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef40=['exports','define','Attachment','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xef40,0x19d));var _0x0ef4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xef40[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x0ef4('0x0'));var util=require(_0x0ef4('0x1'));var logger=require('../../config/logger')(_0x0ef4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ef4('0x3'));var fs=require('fs');var path=require(_0x0ef4('0x4'));var rimraf=require(_0x0ef4('0x5'));var config=require(_0x0ef4('0x6'));var attributes=require('./attachment.attributes');module[_0x0ef4('0x7')]=function(_0x29498b,_0x127e92){return _0x29498b[_0x0ef4('0x8')](_0x0ef4('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 e75caaf..09ee901 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 _0x89e8=['then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89e8,0x74));var _0x889e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x89e8[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});}exports[_0x889e('0x14')]=function(_0x4f9b2c){var _0x75e219=this;return new Promise(function(_0x168fed,_0x232452){return db[_0x889e('0x15')][_0x889e('0x16')](_0x4f9b2c['body'],{'raw':_0x4f9b2c[_0x889e('0x17')]?_0x4f9b2c[_0x889e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x889e('0x18')](function(_0x11abba){logger[_0x889e('0xc')]('CreateAttachment',_0x4f9b2c);logger[_0x889e('0x19')](_0x889e('0x14'),_0x4f9b2c,JSON[_0x889e('0x1a')](_0x11abba));_0x168fed(_0x11abba);})[_0x889e('0x1b')](function(_0x590b6f){logger['error'](_0x889e('0x14'),_0x590b6f[_0x889e('0x12')],_0x4f9b2c);_0x232452(_0x75e219[_0x889e('0x10')](0x1f4,_0x590b6f['message']));});});}; \ No newline at end of file +var _0x0f9f=['debug','stringify','error','code','message','info','result','catch','body','options','raw','CreateAttachment','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x3f8e83,_0x457fd5){var _0x1a1b44=function(_0x40f473){while(--_0x40f473){_0x3f8e83['push'](_0x3f8e83['shift']());}};_0x1a1b44(++_0x457fd5);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0xf1081a,_0xfe4f04){_0xf1081a=_0xf1081a-0x0;var _0x311841=_0x0f9f[_0xf1081a];return _0x311841;};'use strict';var _=require('lodash');var util=require(_0xf0f9('0x0'));var moment=require(_0xf0f9('0x1'));var BPromise=require(_0xf0f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0f9('0x3'));var db=require(_0xf0f9('0x4'))['db'];var utils=require(_0xf0f9('0x5'));var logger=require(_0xf0f9('0x6'))(_0xf0f9('0x7'));var config=require(_0xf0f9('0x8'));var jayson=require(_0xf0f9('0x9'));var client=jayson[_0xf0f9('0xa')][_0xf0f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45694e,_0x51a0ed,_0x448cf5){return new BPromise(function(_0x294b42,_0x5d1753){return client[_0xf0f9('0xc')](_0x45694e,_0x448cf5)[_0xf0f9('0xd')](function(_0x2d72c9){logger['info'](_0xf0f9('0xe'),_0x51a0ed,_0xf0f9('0xf'));logger[_0xf0f9('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x51a0ed,'request\x20sent',JSON[_0xf0f9('0x11')](_0x2d72c9));if(_0x2d72c9[_0xf0f9('0x12')]){if(_0x2d72c9[_0xf0f9('0x12')][_0xf0f9('0x13')]===0x1f4){logger[_0xf0f9('0x12')](_0xf0f9('0xe'),_0x51a0ed,_0x2d72c9[_0xf0f9('0x12')]['message']);return _0x5d1753(_0x2d72c9[_0xf0f9('0x12')][_0xf0f9('0x14')]);}logger[_0xf0f9('0x12')](_0xf0f9('0xe'),_0x51a0ed,_0x2d72c9[_0xf0f9('0x12')]['message']);return _0x294b42(_0x2d72c9[_0xf0f9('0x12')][_0xf0f9('0x14')]);}else{logger[_0xf0f9('0x15')](_0xf0f9('0xe'),_0x51a0ed,_0xf0f9('0xf'));_0x294b42(_0x2d72c9[_0xf0f9('0x16')][_0xf0f9('0x14')]);}})[_0xf0f9('0x17')](function(_0x677b32){logger[_0xf0f9('0x12')]('Attachment,\x20%s,\x20%s',_0x51a0ed,_0x677b32);_0x5d1753(_0x677b32);});});}exports['CreateAttachment']=function(_0x350a48){var _0x3227cf=this;return new Promise(function(_0x4c4e17,_0x178e16){return db['Attachment']['create'](_0x350a48[_0xf0f9('0x18')],{'raw':_0x350a48[_0xf0f9('0x19')]?_0x350a48[_0xf0f9('0x19')][_0xf0f9('0x1a')]===undefined?!![]:![]:!![]})[_0xf0f9('0xd')](function(_0x4ed9ff){logger['info']('CreateAttachment',_0x350a48);logger[_0xf0f9('0x10')](_0xf0f9('0x1b'),_0x350a48,JSON[_0xf0f9('0x11')](_0x4ed9ff));_0x4c4e17(_0x4ed9ff);})['catch'](function(_0x4a8726){logger[_0xf0f9('0x12')]('CreateAttachment',_0x4a8726[_0xf0f9('0x14')],_0x350a48);_0x178e16(_0x3227cf[_0xf0f9('0x12')](0x1f4,_0x4a8726[_0xf0f9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1896395..ffe3c26 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(_0x7ee7cd,_0x436001){var _0x3fe015=function(_0x1ded3c){while(--_0x1ded3c){_0x7ee7cd['push'](_0x7ee7cd['shift']());}};_0x3fe015(++_0x436001);}(_0xadb5,0xad));var _0x5adb=function(_0x5afa4a,_0x457160){_0x5afa4a=_0x5afa4a-0x0;var _0x1bfb61=_0xadb5[_0x5afa4a];return _0x1bfb61;};'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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x433e19,_0x3646a7){var _0x275d17=function(_0x44a7ca){while(--_0x44a7ca){_0x433e19['push'](_0x433e19['shift']());}};_0x275d17(++_0x3646a7);}(_0x2032,0xd9));var _0x2203=function(_0x4600a1,_0x548ca8){_0x4600a1=_0x4600a1-0x0;var _0x23750b=_0x2032[_0x4600a1];return _0x23750b;};'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('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 550d07e..a6c219f 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file +var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 3459af4..e297995 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e9e=['express','Router','post','login','exports'];(function(_0x54872b,_0x3eee62){var _0x45219b=function(_0x296ba6){while(--_0x296ba6){_0x54872b['push'](_0x54872b['shift']());}};_0x45219b(++_0x3eee62);}(_0x8e9e,0x10e));var _0xe8e9=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x8e9e[_0x2f3848];return _0x102668;};'use strict';var express=require(_0xe8e9('0x0'));var router=express[_0xe8e9('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xe8e9('0x2')]('/',controller[_0xe8e9('0x3')]);module[_0xe8e9('0x4')]=router; \ No newline at end of file +var _0xd368=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x39e5e5,_0x5e4a84){var _0x13c529=function(_0x401534){while(--_0x401534){_0x39e5e5['push'](_0x39e5e5['shift']());}};_0x13c529(++_0x5e4a84);}(_0xd368,0x1e7));var _0x8d36=function(_0x8ec947,_0x444fa2){_0x8ec947=_0x8ec947-0x0;var _0x115d2b=_0xd368[_0x8ec947];return _0x115d2b;};'use strict';var express=require(_0x8d36('0x0'));var router=express[_0x8d36('0x1')]();var controller=require(_0x8d36('0x2'));router[_0x8d36('0x3')]('/',controller[_0x8d36('0x4')]);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 d5ba1bb..6f49ca7 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x296904,_0x3fd4d6){var _0x361105=function(_0x4ee20f){while(--_0x4ee20f){_0x296904['push'](_0x296904['shift']());}};_0x361105(++_0x3fd4d6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3ef70c,_0x73d40e){var _0x36e5a8=function(_0x4020fe){while(--_0x4020fe){_0x3ef70c['push'](_0x3ef70c['shift']());}};_0x36e5a8(++_0x73d40e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index b412242..57abcb6 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 _0x6537=['./authGoogle.controller','../user/user.controller.js','/callback','callback','login','exports','express'];(function(_0x189347,_0x5b1eaa){var _0x5aee9a=function(_0x194c32){while(--_0x194c32){_0x189347['push'](_0x189347['shift']());}};_0x5aee9a(++_0x5b1eaa);}(_0x6537,0x1e2));var _0x7653=function(_0xe2a994,_0x40aa67){_0xe2a994=_0xe2a994-0x0;var _0x528ce0=_0x6537[_0xe2a994];return _0x528ce0;};'use strict';var express=require(_0x7653('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x7653('0x1'));var userController=require(_0x7653('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router['get'](_0x7653('0x3'),controller[_0x7653('0x4')],authService['isMiddleware'],userController[_0x7653('0x5')],authService['setTokenCookie']);module[_0x7653('0x6')]=router; \ No newline at end of file +var _0x9dfe=['setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware'];(function(_0x152df4,_0xd2a8f6){var _0x54f4c2=function(_0x42e4cf){while(--_0x42e4cf){_0x152df4['push'](_0x152df4['shift']());}};_0x54f4c2(++_0xd2a8f6);}(_0x9dfe,0xc0));var _0xe9df=function(_0x27669b,_0x306a2c){_0x27669b=_0x27669b-0x0;var _0x31ed6e=_0x9dfe[_0x27669b];return _0x31ed6e;};'use strict';var express=require('express');var passport=require(_0xe9df('0x0'));var router=express[_0xe9df('0x1')]();var controller=require(_0xe9df('0x2'));var userController=require(_0xe9df('0x3'));var authService=require(_0xe9df('0x4'));router[_0xe9df('0x5')]('/',controller['login']);router[_0xe9df('0x5')](_0xe9df('0x6'),controller['callback'],authService[_0xe9df('0x7')],userController['login'],authService[_0xe9df('0x8')]);module[_0xe9df('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 53485a7..f3613f0 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 _0x05f8=['service','Smtp','host','port','secure','authentication','auth','pass','merge','format','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','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://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','passport','Strategy','lodash','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','role','disabled','blocked','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05f8,0x170));var _0x805f=function(_0x5e76a0,_0x5ed0ba){_0x5e76a0=_0x5e76a0-0x0;var _0x283938=_0x05f8[_0x5e76a0];return _0x283938;};'use strict';var util=require('util');var passport=require(_0x805f('0x0'));var LocalStrategy=require('passport-local')[_0x805f('0x1')];var jayson=require('jayson/promise');var _=require(_0x805f('0x2'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x805f('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x805f('0x4'));var client=jayson[_0x805f('0x5')][_0x805f('0x6')]({'port':0x232b});function localAuthenticate(_0x471dc5,_0xe3af32,_0x27a289,_0x38423c){var _0x2e40a5,_0x387b57;return db[_0x805f('0x7')][_0x805f('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x805f('0x9')],'raw':!![]})[_0x805f('0xa')](function(_0x463e09){_0x2e40a5=_0x463e09;return _0x471dc5[_0x805f('0x8')]({'attributes':['id','name',_0x805f('0xb'),'salt',_0x805f('0xc'),_0x805f('0xd'),_0x805f('0xe'),'blockedAt',_0x805f('0xf')],'where':{'name':_0xe3af32,'role':{'$or':[_0x805f('0x10'),_0x805f('0x11'),'agent']}}});})[_0x805f('0xa')](function(_0x2b937d){if(!_0x2b937d||_0x2b937d&&_0x2b937d[_0x805f('0x12')]!==_0xe3af32){throw new Error(_0x805f('0x13'));}else{_0x387b57=_0x2b937d;return _0x387b57;}})[_0x805f('0xa')](function(){_0x387b57[_0x805f('0x14')](_0x27a289,function(_0x232b34,_0x2b3ce4){var _0x1bf1c9=_0x387b57[_0x805f('0xf')]+0x1;if(_0x232b34){return _0x38423c(_0x232b34);}else if(!_0x2b3ce4){if(_0x387b57[_0x805f('0xd')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else if(_0x2e40a5[_0x805f('0x15')]>0x0){if(_0x387b57['blocked']){if(_0x2e40a5[_0x805f('0x9')]>0x0){if(moment(_0x387b57['blockedAt'])[_0x805f('0x16')](_0x2e40a5['blockDuration'],_0x805f('0x17'))>moment()){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else{return utils[_0x805f('0x18')](_0x387b57,_0x1bf1c9,![],null)['then'](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}}else{return _0x38423c(null,![],{'message':_0x805f('0x13')});}}else{if(_0x1bf1c9>=_0x2e40a5['allowedLoginAttempts']){return utils[_0x805f('0x18')](_0x387b57,0x0,!![],moment())[_0x805f('0xa')](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}else{return utils[_0x805f('0x18')](_0x387b57,_0x1bf1c9,![],null)[_0x805f('0xa')](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}}}else{return _0x38423c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x387b57[_0x805f('0xd')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else if(_0x2e40a5[_0x805f('0x15')]>0x0){if(_0x387b57['blocked']){if(_0x2e40a5[_0x805f('0x9')]>0x0){if(moment(_0x387b57[_0x805f('0x19')])[_0x805f('0x16')](_0x2e40a5[_0x805f('0x9')],_0x805f('0x17'))>moment()){return _0x38423c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x805f('0x18')](_0x387b57,0x0,![],null)[_0x805f('0xa')](function(){return utils[_0x805f('0x1a')](_0x387b57);})[_0x805f('0xa')](function(){return _0x38423c(null,_0x387b57);});}}else{return _0x38423c(null,![],{'message':_0x805f('0x13')});}}else{return utils[_0x805f('0x18')](_0x387b57,0x0,![],null)['then'](function(){return utils['getLicense'](_0x387b57);})['then'](function(){return _0x38423c(null,_0x387b57);})[_0x805f('0x1b')](function(_0xb501ba){return _0x38423c(null,![],_0xb501ba);});}}else{if(_0x387b57[_0x805f('0xe')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else{return utils[_0x805f('0x1a')](_0x387b57)[_0x805f('0xa')](function(){return _0x38423c(null,_0x387b57);});}}}});})[_0x805f('0x1b')](function(_0x40511d){return _0x38423c(null,![],_0x40511d);});}function sendServiceMail(_0x2e7eff){return db[_0x805f('0x1c')][_0x805f('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x805f('0x1e')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x5c2b1a){if(!_0x5c2b1a){throw new Error(_0x805f('0x1f'));}var _0x4a05ab={'tls':{'rejectUnauthorized':![]}};if(_0x5c2b1a['Smtp'][_0x805f('0x20')]){_0x4a05ab['service']=_0x5c2b1a[_0x805f('0x21')]['service'];}else{_0x4a05ab[_0x805f('0x22')]=_0x5c2b1a[_0x805f('0x21')]['host'];_0x4a05ab[_0x805f('0x23')]=_0x5c2b1a[_0x805f('0x21')][_0x805f('0x23')];_0x4a05ab['secure']=_0x5c2b1a['Smtp'][_0x805f('0x24')];}if(_0x5c2b1a[_0x805f('0x21')][_0x805f('0x25')]){_0x4a05ab[_0x805f('0x26')]={'user':_0x5c2b1a[_0x805f('0x21')][_0x805f('0x11')],'pass':_0x5c2b1a[_0x805f('0x21')][_0x805f('0x27')]};}var _0x3f60ab={'account':_0x4a05ab,'message':_[_0x805f('0x28')]({'from':util[_0x805f('0x29')]('\x22%s\x22\x20<%s>',_0x5c2b1a[_0x805f('0x12')],_0x5c2b1a[_0x805f('0x1e')]||_0x5c2b1a[_0x805f('0x21')][_0x805f('0x11')])},_0x2e7eff)};return client['request'](_0x805f('0x2a'),_0x3f60ab);})['then'](function(_0x32342a){if(_0x32342a[_0x805f('0x2b')]){throw new Error(util[_0x805f('0x29')](_0x805f('0x2c'),_0x32342a['error'][_0x805f('0x2d')]||JSON[_0x805f('0x2e')](_0x32342a['error'])));}return!![];});}function handleError(_0x34378d,_0x21b6a0,_0x1130fb){return _0x34378d[_0x805f('0x2f')](_0x21b6a0||0x1f4)[_0x805f('0x30')]({'message':_0x1130fb?_0x1130fb[_0x805f('0x2d')]||_0x1130fb:''});}exports[_0x805f('0x31')]=function(_0x196889,_0x49ef8e,_0x345c27){passport[_0x805f('0x14')](_0x805f('0x32'),function(_0x57c169,_0x7507e3,_0x4024ff){var _0x1a0016=_0x57c169||_0x4024ff;if(_0x1a0016){return handleError(_0x49ef8e,0x191,_0x1a0016);}if(!_0x7507e3){return handleError(_0x49ef8e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xbd7e55={'payload':{'id':_0x7507e3['id'],'role':_0x7507e3[_0x805f('0xc')]},'options':{'expiresIn':0x15180}};return authService[_0x805f('0x33')](_0xbd7e55)['then'](function(_0x55cd55){_0x49ef8e[_0x805f('0x34')]({'id':_0x7507e3['id'],'token':_0x55cd55,'statusCall':'','isAlreadyLogged':_0x7507e3[_0x805f('0x35')]});});}})(_0x196889,_0x49ef8e,_0x345c27);};exports[_0x805f('0x36')]=function(_0xddadc4,_0x4b9d8a,_0xed8d7f){if(!_0xddadc4['body']['email']){return handleError(_0x4b9d8a,0x1f4,{'message':_0x805f('0x37')});}var _0x418a52=rs[_0x805f('0x38')]();_0xddadc4[_0x805f('0x39')]['email']=_0xddadc4[_0x805f('0x39')][_0x805f('0x1e')]['trim']()[_0x805f('0x3a')]();var _0x1cd89d;return db[_0x805f('0x7')][_0x805f('0x8')]({'where':{'id':0x1},'attributes':[_0x805f('0x15'),_0x805f('0x9')],'raw':!![]})['then'](function(_0x1d3bda){_0x1cd89d=_0x1d3bda;return db['User']['find']({'where':{'email':_0xddadc4[_0x805f('0x39')][_0x805f('0x1e')]}});})[_0x805f('0xa')](function(_0x3b8016){if(!_0x3b8016){throw new Error(_0x805f('0x3b'));}if(_0x3b8016[_0x805f('0xd')]){throw new Error(_0x805f('0x3c'));}if(_0x3b8016[_0x805f('0xe')]){if(moment(_0x3b8016[_0x805f('0x19')])['add'](_0x1cd89d[_0x805f('0x9')],'minutes')>moment()){throw new Error(_0x805f('0x3d'));}else{_0x3b8016[_0x805f('0xe')]=![];_0x3b8016[_0x805f('0x19')]=null;}}_0x3b8016[_0x805f('0x3e')]=_0x418a52;_0x3b8016[_0x805f('0x3f')]=Date[_0x805f('0x40')]()+0x36ee80;return _0x3b8016[_0x805f('0x41')]();})[_0x805f('0xa')](function(){return sendServiceMail({'to':_0xddadc4['body'][_0x805f('0x1e')],'subject':_0x805f('0x42'),'text':_0x805f('0x43')+_0x805f('0x44')+_0x805f('0x45')+_0xddadc4['headers'][_0x805f('0x22')]+_0x805f('0x46')+_0x418a52+'\x0a\x0a'+_0x805f('0x47')});})[_0x805f('0xa')](function(){_0x4b9d8a[_0x805f('0x2f')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x36af8f){return handleError(_0x4b9d8a,0x1f4,_0x36af8f);});};exports['reset']=function(_0x265c4a,_0x4b771e,_0x403619){return db['User']['find']({'where':{'resetPasswordToken':_0x265c4a['params'][_0x805f('0x48')],'resetPasswordExpires':{'$gt':Date[_0x805f('0x40')]()}}})[_0x805f('0xa')](function(_0x5c17b0){if(!_0x5c17b0){throw new Error(_0x805f('0x49'));}return db[_0x805f('0x7')][_0x805f('0x8')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x805f('0xa')](function(_0x4845c3){if(_0x4845c3[_0x805f('0x4a')])authService['validatePasswordPattern'](_0x265c4a['body'][_0x805f('0xb')]);if(!_0x4845c3[_0x805f('0x4b')]||!_0x5c17b0['previousPasswords'])return _0x5c17b0;authService[_0x805f('0x4c')](_0x265c4a[_0x805f('0x39')]['password'],_0x5c17b0['previousPasswords'],_0x4845c3[_0x805f('0x4d')]);return _0x5c17b0;})[_0x805f('0xa')](function(){_0x5c17b0['password']=_0x265c4a[_0x805f('0x39')][_0x805f('0xb')];_0x5c17b0['resetPasswordToken']=null;_0x5c17b0[_0x805f('0x3f')]=null;return _0x5c17b0[_0x805f('0x41')]();});})[_0x805f('0xa')](function(){_0x4b771e[_0x805f('0x2f')](0xc8)[_0x805f('0x30')]({'message':_0x805f('0x4e')});})['catch'](function(_0x4a2185){return handleError(_0x4b771e,0x1f4,_0x4a2185);});};passport[_0x805f('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x805f('0xb')},function(_0x6c6216,_0x420df2,_0x4b1fa4){return localAuthenticate(db['User'],_0x6c6216,_0x420df2,_0x4b1fa4);})); \ No newline at end of file +var _0xded0=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','then','password','role','disabled','blockedAt','loginAttempts','admin','user','name','authenticate','blocked','add','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','request','SendMail','error','message','stringify','status','send','local-login'];(function(_0xcd3fd1,_0x1a2ffc){var _0x29a9d3=function(_0x567df6){while(--_0x567df6){_0xcd3fd1['push'](_0xcd3fd1['shift']());}};_0x29a9d3(++_0x1a2ffc);}(_0xded0,0xc2));var _0x0ded=function(_0x46a23a,_0x2a0663){_0x46a23a=_0x46a23a-0x0;var _0x3397f9=_0xded0[_0x46a23a];return _0x3397f9;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x0ded('0x0'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x0ded('0x1'));var rs=require('randomstring');var moment=require(_0x0ded('0x2'));var db=require(_0x0ded('0x3'))['db'];var authService=require(_0x0ded('0x4'));var utils=require(_0x0ded('0x5'));var client=jayson[_0x0ded('0x6')]['http']({'port':0x232b});function localAuthenticate(_0x49a015,_0x308dca,_0x58ba15,_0xd4464c){var _0xd68cca,_0x16f242;return db[_0x0ded('0x7')][_0x0ded('0x8')]({'where':{'id':0x1},'attributes':[_0x0ded('0x9'),'blockDuration'],'raw':!![]})[_0x0ded('0xa')](function(_0x37f7ed){_0xd68cca=_0x37f7ed;return _0x49a015['findOne']({'attributes':['id','name',_0x0ded('0xb'),'salt',_0x0ded('0xc'),_0x0ded('0xd'),'blocked',_0x0ded('0xe'),_0x0ded('0xf')],'where':{'name':_0x308dca,'role':{'$or':[_0x0ded('0x10'),_0x0ded('0x11'),'agent']}}});})[_0x0ded('0xa')](function(_0x57ef09){if(!_0x57ef09||_0x57ef09&&_0x57ef09[_0x0ded('0x12')]!==_0x308dca){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x16f242=_0x57ef09;return _0x16f242;}})[_0x0ded('0xa')](function(){_0x16f242[_0x0ded('0x13')](_0x58ba15,function(_0x58d9ef,_0x3e0170){var _0x442882=_0x16f242['loginAttempts']+0x1;if(_0x58d9ef){return _0xd4464c(_0x58d9ef);}else if(!_0x3e0170){if(_0x16f242['disabled']){return _0xd4464c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd68cca[_0x0ded('0x9')]>0x0){if(_0x16f242[_0x0ded('0x14')]){if(_0xd68cca['blockDuration']>0x0){if(moment(_0x16f242[_0x0ded('0xe')])[_0x0ded('0x15')](_0xd68cca[_0x0ded('0x16')],_0x0ded('0x17'))>moment()){return _0xd4464c(null,![],{'message':_0x0ded('0x18')});}else{return utils[_0x0ded('0x19')](_0x16f242,_0x442882,![],null)['then'](function(){return _0xd4464c(null,![],{'message':_0x0ded('0x18')});});}}else{return _0xd4464c(null,![],{'message':_0x0ded('0x18')});}}else{if(_0x442882>=_0xd68cca[_0x0ded('0x9')]){return utils[_0x0ded('0x19')](_0x16f242,0x0,!![],moment())[_0x0ded('0xa')](function(){return _0xd4464c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0ded('0x19')](_0x16f242,_0x442882,![],null)[_0x0ded('0xa')](function(){return _0xd4464c(null,![],{'message':_0x0ded('0x18')});});}}}else{return _0xd4464c(null,![],{'message':_0x0ded('0x18')});}}else{if(_0x16f242[_0x0ded('0xd')]){return _0xd4464c(null,![],{'message':_0x0ded('0x18')});}else if(_0xd68cca[_0x0ded('0x9')]>0x0){if(_0x16f242[_0x0ded('0x14')]){if(_0xd68cca[_0x0ded('0x16')]>0x0){if(moment(_0x16f242[_0x0ded('0xe')])[_0x0ded('0x15')](_0xd68cca[_0x0ded('0x16')],'minutes')>moment()){return _0xd4464c(null,![],{'message':_0x0ded('0x18')});}else{return utils[_0x0ded('0x19')](_0x16f242,0x0,![],null)[_0x0ded('0xa')](function(){return utils['getLicense'](_0x16f242);})['then'](function(){return _0xd4464c(null,_0x16f242);});}}else{return _0xd4464c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0ded('0x19')](_0x16f242,0x0,![],null)[_0x0ded('0xa')](function(){return utils[_0x0ded('0x1a')](_0x16f242);})['then'](function(){return _0xd4464c(null,_0x16f242);})[_0x0ded('0x1b')](function(_0x4e99d2){return _0xd4464c(null,![],_0x4e99d2);});}}else{if(_0x16f242[_0x0ded('0x14')]){return _0xd4464c(null,![],{'message':_0x0ded('0x18')});}else{return utils[_0x0ded('0x1a')](_0x16f242)['then'](function(){return _0xd4464c(null,_0x16f242);});}}}});})['catch'](function(_0x467a0f){return _0xd4464c(null,![],_0x467a0f);});}function sendServiceMail(_0x4b299c){return db[_0x0ded('0x1c')][_0x0ded('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x0ded('0x12'),_0x0ded('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x0ded('0x1f')}]})['then'](function(_0x2eaab5){if(!_0x2eaab5){throw new Error(_0x0ded('0x20'));}var _0xfb3fd7={'tls':{'rejectUnauthorized':![]}};if(_0x2eaab5[_0x0ded('0x1f')][_0x0ded('0x21')]){_0xfb3fd7[_0x0ded('0x21')]=_0x2eaab5[_0x0ded('0x1f')][_0x0ded('0x21')];}else{_0xfb3fd7['host']=_0x2eaab5[_0x0ded('0x1f')][_0x0ded('0x22')];_0xfb3fd7[_0x0ded('0x23')]=_0x2eaab5[_0x0ded('0x1f')][_0x0ded('0x23')];_0xfb3fd7['secure']=_0x2eaab5[_0x0ded('0x1f')][_0x0ded('0x24')];}if(_0x2eaab5[_0x0ded('0x1f')]['authentication']){_0xfb3fd7[_0x0ded('0x25')]={'user':_0x2eaab5['Smtp']['user'],'pass':_0x2eaab5['Smtp'][_0x0ded('0x26')]};}var _0x42c4b1={'account':_0xfb3fd7,'message':_[_0x0ded('0x27')]({'from':util[_0x0ded('0x28')]('\x22%s\x22\x20<%s>',_0x2eaab5[_0x0ded('0x12')],_0x2eaab5[_0x0ded('0x1e')]||_0x2eaab5[_0x0ded('0x1f')]['user'])},_0x4b299c)};return client[_0x0ded('0x29')](_0x0ded('0x2a'),_0x42c4b1);})[_0x0ded('0xa')](function(_0xc40847){if(_0xc40847[_0x0ded('0x2b')]){throw new Error(util[_0x0ded('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xc40847[_0x0ded('0x2b')][_0x0ded('0x2c')]||JSON[_0x0ded('0x2d')](_0xc40847[_0x0ded('0x2b')])));}return!![];});}function handleError(_0x5b6666,_0x9343a0,_0x350174){return _0x5b6666[_0x0ded('0x2e')](_0x9343a0||0x1f4)[_0x0ded('0x2f')]({'message':_0x350174?_0x350174[_0x0ded('0x2c')]||_0x350174:''});}exports['login']=function(_0x5da0e3,_0x8a3e82,_0x213150){passport['authenticate'](_0x0ded('0x30'),function(_0x18ae89,_0x1fd047,_0x8d9e06){var _0x1c782a=_0x18ae89||_0x8d9e06;if(_0x1c782a){return handleError(_0x8a3e82,0x191,_0x1c782a);}if(!_0x1fd047){return handleError(_0x8a3e82,0x194,{'message':_0x0ded('0x31')});}else{var _0x1424ec={'payload':{'id':_0x1fd047['id'],'role':_0x1fd047[_0x0ded('0xc')]},'options':{'expiresIn':0x15180}};return authService[_0x0ded('0x32')](_0x1424ec)['then'](function(_0x2bb678){_0x8a3e82['json']({'id':_0x1fd047['id'],'token':_0x2bb678,'statusCall':'','isAlreadyLogged':_0x1fd047[_0x0ded('0x33')]});});}})(_0x5da0e3,_0x8a3e82,_0x213150);};exports[_0x0ded('0x34')]=function(_0x444eec,_0x1877d1,_0x1254bb){if(!_0x444eec[_0x0ded('0x35')][_0x0ded('0x1e')]){return handleError(_0x1877d1,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x47231e=rs[_0x0ded('0x36')]();_0x444eec['body']['email']=_0x444eec['body'][_0x0ded('0x1e')]['trim']()[_0x0ded('0x37')]();var _0x4a380d;return db[_0x0ded('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0x0ded('0x9'),_0x0ded('0x16')],'raw':!![]})['then'](function(_0xd681af){_0x4a380d=_0xd681af;return db[_0x0ded('0x38')]['find']({'where':{'email':_0x444eec[_0x0ded('0x35')]['email']}});})[_0x0ded('0xa')](function(_0xdddb2c){if(!_0xdddb2c){throw new Error(_0x0ded('0x39'));}if(_0xdddb2c[_0x0ded('0xd')]){throw new Error(_0x0ded('0x3a'));}if(_0xdddb2c['blocked']){if(moment(_0xdddb2c[_0x0ded('0xe')])['add'](_0x4a380d[_0x0ded('0x16')],_0x0ded('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xdddb2c['blocked']=![];_0xdddb2c[_0x0ded('0xe')]=null;}}_0xdddb2c[_0x0ded('0x3b')]=_0x47231e;_0xdddb2c[_0x0ded('0x3c')]=Date[_0x0ded('0x3d')]()+0x36ee80;return _0xdddb2c[_0x0ded('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0x444eec[_0x0ded('0x35')][_0x0ded('0x1e')],'subject':_0x0ded('0x3f'),'text':_0x0ded('0x40')+_0x0ded('0x41')+_0x0ded('0x42')+_0x444eec[_0x0ded('0x43')]['host']+_0x0ded('0x44')+_0x47231e+'\x0a\x0a'+_0x0ded('0x45')});})[_0x0ded('0xa')](function(){_0x1877d1[_0x0ded('0x2e')](0xc8)[_0x0ded('0x2f')]({'message':_0x0ded('0x46')});})[_0x0ded('0x1b')](function(_0xd20375){return handleError(_0x1877d1,0x1f4,_0xd20375);});};exports[_0x0ded('0x47')]=function(_0x19b838,_0x2856a7,_0x5debc1){return db['User'][_0x0ded('0x1d')]({'where':{'resetPasswordToken':_0x19b838[_0x0ded('0x48')][_0x0ded('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x0ded('0xa')](function(_0x445d0d){if(!_0x445d0d){throw new Error(_0x0ded('0x4a'));}return db[_0x0ded('0x7')][_0x0ded('0x8')]({'attributes':['id',_0x0ded('0x4b'),_0x0ded('0x4c'),'passwordHistoryLimit']})['then'](function(_0x33f09d){if(_0x33f09d[_0x0ded('0x4b')])authService['validatePasswordPattern'](_0x19b838['body'][_0x0ded('0xb')]);if(!_0x33f09d[_0x0ded('0x4c')]||!_0x445d0d[_0x0ded('0x4d')])return _0x445d0d;authService[_0x0ded('0x4e')](_0x19b838[_0x0ded('0x35')][_0x0ded('0xb')],_0x445d0d[_0x0ded('0x4d')],_0x33f09d['passwordHistoryLimit']);return _0x445d0d;})[_0x0ded('0xa')](function(){_0x445d0d[_0x0ded('0xb')]=_0x19b838[_0x0ded('0x35')][_0x0ded('0xb')];_0x445d0d[_0x0ded('0x3b')]=null;_0x445d0d[_0x0ded('0x3c')]=null;return _0x445d0d[_0x0ded('0x3e')]();});})[_0x0ded('0xa')](function(){_0x2856a7['status'](0xc8)[_0x0ded('0x2f')]({'message':_0x0ded('0x4f')});})[_0x0ded('0x1b')](function(_0x69653b){return handleError(_0x2856a7,0x1f4,_0x69653b);});};passport[_0x0ded('0x50')](_0x0ded('0x30'),new LocalStrategy({'usernameField':_0x0ded('0x12'),'passwordField':_0x0ded('0xb')},function(_0x37877b,_0x5ed389,_0x4f7078){return localAuthenticate(db[_0x0ded('0x38')],_0x37877b,_0x5ed389,_0x4f7078);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 1c12ca8..0eeb8f2 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 _0x5ee2=['Router','./authLocal.controller','post','login','forgot'];(function(_0x3fb8f7,_0x5363d9){var _0x4b0e88=function(_0x56fd5a){while(--_0x56fd5a){_0x3fb8f7['push'](_0x3fb8f7['shift']());}};_0x4b0e88(++_0x5363d9);}(_0x5ee2,0x11d));var _0x25ee=function(_0x42b3d0,_0x1578a4){_0x42b3d0=_0x42b3d0-0x0;var _0x2dc411=_0x5ee2[_0x42b3d0];return _0x2dc411;};'use strict';var express=require('express');var router=express[_0x25ee('0x0')]();var controller=require(_0x25ee('0x1'));router[_0x25ee('0x2')]('/',controller[_0x25ee('0x3')]);router[_0x25ee('0x2')]('/forgot',controller[_0x25ee('0x4')]);router[_0x25ee('0x2')]('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file +var _0x48e1=['forgot','/reset/:token','exports','express','Router','./authLocal.controller','login','post','/forgot'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x48e1,0x174));var _0x148e=function(_0x394289,_0x2dba3e){_0x394289=_0x394289-0x0;var _0x8a8c3b=_0x48e1[_0x394289];return _0x8a8c3b;};'use strict';var express=require(_0x148e('0x0'));var router=express[_0x148e('0x1')]();var controller=require(_0x148e('0x2'));router['post']('/',controller[_0x148e('0x3')]);router[_0x148e('0x4')](_0x148e('0x5'),controller[_0x148e('0x6')]);router[_0x148e('0x4')](_0x148e('0x7'),controller['reset']);module[_0x148e('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 b3193ea..66fabb5 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 _0xd9dc=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x3176a4,_0x2049fd){var _0x38d9bc=function(_0x30a9aa){while(--_0x30a9aa){_0x3176a4['push'](_0x3176a4['shift']());}};_0x38d9bc(++_0x2049fd);}(_0xd9dc,0x1c1));var _0xcd9d=function(_0x19069d,_0x46921e){_0x19069d=_0x19069d-0x0;var _0x39463a=_0xd9dc[_0x19069d];return _0x39463a;};'use strict';var Sequelize=require(_0xcd9d('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd9d('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xcd9d('0x1')]},'description':{'type':Sequelize[_0xcd9d('0x1')]},'status':{'type':Sequelize[_0xcd9d('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcd9d('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb699=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb699,0x1f2));var _0x9b69=function(_0x432a19,_0x3fc4c1){_0x432a19=_0x432a19-0x0;var _0xa1bc6=_0xb699[_0x432a19];return _0xa1bc6;};'use strict';var Sequelize=require('sequelize');module[_0x9b69('0x0')]={'name':{'type':Sequelize[_0x9b69('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x9b69('0x1')]},'description':{'type':Sequelize[_0x9b69('0x1')]},'status':{'type':Sequelize[_0x9b69('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9b69('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 cbbc1bb..9212095 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 _0x130c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','error','stack','name','send','index','Automation','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','then','includeAll','include','rows','show','params','length','create','body','catch','find','addConditions','getConditions','findOne','Condition','order','nolimit','addActions','ids','getActions','rimraf','zip-dir'];(function(_0x1057ee,_0x3e665b){var _0x10fbac=function(_0x2b4818){while(--_0x2b4818){_0x1057ee['push'](_0x1057ee['shift']());}};_0x10fbac(++_0x3e665b);}(_0x130c,0xa2));var _0xc130=function(_0x2c9d27,_0x1b5ead){_0x2c9d27=_0x2c9d27-0x0;var _0x1b73d0=_0x130c[_0x2c9d27];return _0x1b73d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc130('0x0'));var zipdir=require(_0xc130('0x1'));var jsonpatch=require(_0xc130('0x2'));var rp=require(_0xc130('0x3'));var moment=require(_0xc130('0x4'));var BPromise=require(_0xc130('0x5'));var Mustache=require(_0xc130('0x6'));var util=require(_0xc130('0x7'));var path=require(_0xc130('0x8'));var sox=require(_0xc130('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc130('0xa'));var _=require(_0xc130('0xb'));var squel=require('squel');var crypto=require(_0xc130('0xc'));var jsforce=require(_0xc130('0xd'));var deskjs=require(_0xc130('0xe'));var toCsv=require(_0xc130('0xf'));var querystring=require('querystring');var Papa=require(_0xc130('0x10'));var Redis=require(_0xc130('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc130('0x12'));var as=require(_0xc130('0x13'));var hardwareService=require(_0xc130('0x14'));var logger=require(_0xc130('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc130('0x16'));var licenseUtil=require(_0xc130('0x17'));var db=require(_0xc130('0x18'))['db'];function respondWithStatusCode(_0x250d44,_0x5b6162){_0x5b6162=_0x5b6162||0xcc;return function(_0x125627){if(_0x125627){return _0x250d44[_0xc130('0x19')](_0x5b6162);}return _0x250d44[_0xc130('0x1a')](_0x5b6162)['end']();};}function respondWithResult(_0x2a7017,_0x57098e){_0x57098e=_0x57098e||0xc8;return function(_0x1fefd4){if(_0x1fefd4){return _0x2a7017[_0xc130('0x1a')](_0x57098e)[_0xc130('0x1b')](_0x1fefd4);}};}function respondWithFilteredResult(_0xb41905,_0x329e39){return function(_0x22e9b6){if(_0x22e9b6){var _0x2c52a9=typeof _0x329e39[_0xc130('0x1c')]===_0xc130('0x1d')&&typeof _0x329e39['limit']===_0xc130('0x1d');var _0x16afb9=_0x22e9b6[_0xc130('0x1e')];var _0x5d1d22=_0x2c52a9?0x0:_0x329e39[_0xc130('0x1c')];var _0x34da11=_0x2c52a9?_0x22e9b6[_0xc130('0x1e')]:_0x329e39[_0xc130('0x1c')]+_0x329e39[_0xc130('0x1f')];var _0x1cea72;if(_0x34da11>=_0x16afb9){_0x34da11=_0x16afb9;_0x1cea72=0xc8;}else{_0x1cea72=0xce;}_0xb41905[_0xc130('0x1a')](_0x1cea72);return _0xb41905[_0xc130('0x20')](_0xc130('0x21'),_0x5d1d22+'-'+_0x34da11+'/'+_0x16afb9)[_0xc130('0x1b')](_0x22e9b6);}return null;};}function patchUpdates(_0x4e7255){return function(_0x4a9e52){try{jsonpatch['apply'](_0x4a9e52,_0x4e7255,!![]);}catch(_0x6dfe20){return BPromise['reject'](_0x6dfe20);}return _0x4a9e52[_0xc130('0x22')]();};}function saveUpdates(_0x39e132,_0x26a4a9){return function(_0x1971c3){if(_0x1971c3){return _0x1971c3[_0xc130('0x23')](_0x39e132)['then'](function(_0x439983){return _0x439983;});}return null;};}function removeEntity(_0x24050f,_0x4b3159){return function(_0x2e8323){if(_0x2e8323){return _0x2e8323[_0xc130('0x24')]()['then'](function(){_0x24050f[_0xc130('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9c84,_0x4f72ce){return function(_0x204f03){if(!_0x204f03){_0x1f9c84[_0xc130('0x19')](0x194);}return _0x204f03;};}function handleError(_0x7419ef,_0x638c24){_0x638c24=_0x638c24||0x1f4;return function(_0x22932e){logger[_0xc130('0x25')](_0x22932e[_0xc130('0x26')]);if(_0x22932e[_0xc130('0x27')]){delete _0x22932e[_0xc130('0x27')];}_0x7419ef['status'](_0x638c24)[_0xc130('0x28')](_0x22932e);};}exports[_0xc130('0x29')]=function(_0x4950e7,_0x383635){var _0x21f66c={},_0x209690={},_0x1107cc={'count':0x0,'rows':[]};var _0x2843e6=_['map'](db[_0xc130('0x2a')][_0xc130('0x2b')],function(_0x1e95df){return{'name':_0x1e95df['fieldName'],'type':_0x1e95df[_0xc130('0x2c')][_0xc130('0x2d')]};});_0x209690[_0xc130('0x2e')]=_['map'](_0x2843e6,_0xc130('0x27'));_0x209690[_0xc130('0x2f')]=_[_0xc130('0x30')](_0x4950e7[_0xc130('0x2f')]);_0x209690['filters']=_[_0xc130('0x31')](_0x209690[_0xc130('0x2e')],_0x209690[_0xc130('0x2f')]);_0x21f66c[_0xc130('0x32')]=_['intersection'](_0x209690[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x4950e7['query']['fields']));_0x21f66c[_0xc130('0x32')]=_0x21f66c[_0xc130('0x32')]['length']?_0x21f66c[_0xc130('0x32')]:_0x209690['model'];if(!_0x4950e7['query'][_0xc130('0x34')]('nolimit')){_0x21f66c[_0xc130('0x1f')]=qs[_0xc130('0x1f')](_0x4950e7['query'][_0xc130('0x1f')]);_0x21f66c[_0xc130('0x1c')]=qs[_0xc130('0x1c')](_0x4950e7[_0xc130('0x2f')][_0xc130('0x1c')]);}_0x21f66c['order']=qs[_0xc130('0x35')](_0x4950e7[_0xc130('0x2f')][_0xc130('0x35')]);_0x21f66c[_0xc130('0x36')]=qs[_0xc130('0x37')](_[_0xc130('0x38')](_0x4950e7['query'],_0x209690[_0xc130('0x37')]),_0x2843e6);if(_0x4950e7[_0xc130('0x2f')]['filter']){_0x21f66c[_0xc130('0x36')]=_[_0xc130('0x39')](_0x21f66c[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x2843e6,function(_0x53b22b){if(_0x53b22b['type']!==_0xc130('0x3b')){var _0xc2bb69={};_0xc2bb69[_0x53b22b[_0xc130('0x27')]]={'$like':'%'+_0x4950e7[_0xc130('0x2f')][_0xc130('0x3c')]+'%'};return _0xc2bb69;}})});}_0x21f66c=_[_0xc130('0x39')]({},_0x21f66c,_0x4950e7[_0xc130('0x3d')]);var _0x2a2f74={'where':_0x21f66c['where']};return db[_0xc130('0x2a')][_0xc130('0x1e')](_0x2a2f74)[_0xc130('0x3e')](function(_0x11e283){_0x1107cc[_0xc130('0x1e')]=_0x11e283;if(_0x4950e7[_0xc130('0x2f')][_0xc130('0x3f')]){_0x21f66c[_0xc130('0x40')]=[{'all':!![]}];}return db[_0xc130('0x2a')]['findAll'](_0x21f66c);})[_0xc130('0x3e')](function(_0x4b3caf){_0x1107cc[_0xc130('0x41')]=_0x4b3caf;return _0x1107cc;})['then'](respondWithFilteredResult(_0x383635,_0x21f66c))['catch'](handleError(_0x383635,null));};exports[_0xc130('0x42')]=function(_0x2fb2ad,_0x356bd8){var _0x2289b8={'raw':![],'where':{'id':_0x2fb2ad[_0xc130('0x43')]['id']}},_0x2fea5e={};_0x2fea5e[_0xc130('0x2e')]=_[_0xc130('0x30')](db[_0xc130('0x2a')]['rawAttributes']);_0x2fea5e['query']=_[_0xc130('0x30')](_0x2fb2ad['query']);_0x2fea5e[_0xc130('0x37')]=_[_0xc130('0x31')](_0x2fea5e[_0xc130('0x2e')],_0x2fea5e[_0xc130('0x2f')]);_0x2289b8[_0xc130('0x32')]=_['intersection'](_0x2fea5e[_0xc130('0x2e')],qs['fields'](_0x2fb2ad[_0xc130('0x2f')][_0xc130('0x33')]));_0x2289b8['attributes']=_0x2289b8[_0xc130('0x32')][_0xc130('0x44')]?_0x2289b8['attributes']:_0x2fea5e[_0xc130('0x2e')];if(_0x2fb2ad[_0xc130('0x2f')][_0xc130('0x3f')]){_0x2289b8[_0xc130('0x40')]=[{'all':!![]}];}_0x2289b8=_['merge']({},_0x2289b8,_0x2fb2ad[_0xc130('0x3d')]);return db['Automation']['find'](_0x2289b8)[_0xc130('0x3e')](handleEntityNotFound(_0x356bd8,null))['then'](respondWithResult(_0x356bd8,null))['catch'](handleError(_0x356bd8,null));};exports[_0xc130('0x45')]=function(_0x46fd0f,_0x1bee65){return db[_0xc130('0x2a')][_0xc130('0x45')](_0x46fd0f[_0xc130('0x46')],{})['then'](respondWithResult(_0x1bee65,0xc9))[_0xc130('0x47')](handleError(_0x1bee65,null));};exports[_0xc130('0x23')]=function(_0x252660,_0x9570d0){if(_0x252660[_0xc130('0x46')]['id']){delete _0x252660['body']['id'];}return db[_0xc130('0x2a')][_0xc130('0x48')]({'where':{'id':_0x252660[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x9570d0,null))['then'](saveUpdates(_0x252660[_0xc130('0x46')],null))[_0xc130('0x3e')](respondWithResult(_0x9570d0,null))[_0xc130('0x47')](handleError(_0x9570d0,null));};exports[_0xc130('0x24')]=function(_0x1fc37e,_0x2fcca7){return db[_0xc130('0x2a')]['find']({'where':{'id':_0x1fc37e[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x2fcca7,null))[_0xc130('0x3e')](removeEntity(_0x2fcca7,null))[_0xc130('0x47')](handleError(_0x2fcca7,null));};exports[_0xc130('0x49')]=function(_0x29d8e6,_0x38d577,_0x2616f9){return db['Condition']['find']({'where':{'id':_0x29d8e6[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x38d577,null))[_0xc130('0x3e')](function(_0x1f82d1){if(_0x1f82d1){return _0x1f82d1[_0xc130('0x49')](_0x29d8e6['body']['ids'],_['omit'](_0x29d8e6[_0xc130('0x46')],['ids','id'])||{});}})[_0xc130('0x3e')](respondWithResult(_0x38d577,null))['catch'](handleError(_0x38d577,null));};exports[_0xc130('0x4a')]=function(_0x5d3dea,_0x2ee647,_0x90f986){var _0x279060={};var _0x1e9e6f={};var _0x36a8ff;var _0x44ac4f;return db[_0xc130('0x2a')][_0xc130('0x4b')]({'where':{'id':_0x5d3dea[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x2ee647,null))[_0xc130('0x3e')](function(_0x224563){if(_0x224563){_0x36a8ff=_0x224563;_0x1e9e6f[_0xc130('0x2e')]=_[_0xc130('0x30')](db[_0xc130('0x4c')][_0xc130('0x2b')]);_0x1e9e6f[_0xc130('0x2f')]=_['keys'](_0x5d3dea[_0xc130('0x2f')]);_0x1e9e6f[_0xc130('0x37')]=_['intersection'](_0x1e9e6f['model'],_0x1e9e6f['query']);_0x279060[_0xc130('0x32')]=_['intersection'](_0x1e9e6f[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x5d3dea['query'][_0xc130('0x33')]));_0x279060[_0xc130('0x32')]=_0x279060[_0xc130('0x32')][_0xc130('0x44')]?_0x279060[_0xc130('0x32')]:_0x1e9e6f['model'];_0x279060[_0xc130('0x4d')]=qs[_0xc130('0x35')](_0x5d3dea[_0xc130('0x2f')][_0xc130('0x35')]);_0x279060[_0xc130('0x36')]=qs['filters'](_['pick'](_0x5d3dea[_0xc130('0x2f')],_0x1e9e6f[_0xc130('0x37')]));if(_0x5d3dea[_0xc130('0x2f')][_0xc130('0x3c')]){_0x279060['where']=_['merge'](_0x279060[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x279060[_0xc130('0x32')],function(_0x39e68c){var _0x29697b={};_0x29697b[_0x39e68c]={'$like':'%'+_0x5d3dea[_0xc130('0x2f')]['filter']+'%'};return _0x29697b;})});}_0x279060=_[_0xc130('0x39')]({},_0x279060,_0x5d3dea[_0xc130('0x3d')]);return _0x36a8ff['getConditions'](_0x279060);}})[_0xc130('0x3e')](function(_0x31e430){if(_0x31e430){_0x44ac4f=_0x31e430[_0xc130('0x44')];if(!_0x5d3dea[_0xc130('0x2f')][_0xc130('0x34')](_0xc130('0x4e'))){_0x279060[_0xc130('0x1f')]=qs[_0xc130('0x1f')](_0x5d3dea[_0xc130('0x2f')][_0xc130('0x1f')]);_0x279060[_0xc130('0x1c')]=qs['offset'](_0x5d3dea['query'][_0xc130('0x1c')]);}return _0x36a8ff[_0xc130('0x4a')](_0x279060);}})['then'](function(_0x26a379){if(_0x26a379){return _0x26a379?{'count':_0x44ac4f,'rows':_0x26a379}:null;}})['then'](respondWithResult(_0x2ee647,null))['catch'](handleError(_0x2ee647,null));};exports[_0xc130('0x4f')]=function(_0x3bc5ac,_0x292a67,_0x4daaae){return db['Action'][_0xc130('0x48')]({'where':{'id':_0x3bc5ac['params']['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x292a67,null))[_0xc130('0x3e')](function(_0x3309f9){if(_0x3309f9){return _0x3309f9[_0xc130('0x4f')](_0x3bc5ac[_0xc130('0x46')][_0xc130('0x50')],_['omit'](_0x3bc5ac['body'],[_0xc130('0x50'),'id'])||{});}})[_0xc130('0x3e')](respondWithResult(_0x292a67,null))[_0xc130('0x47')](handleError(_0x292a67,null));};exports[_0xc130('0x51')]=function(_0x2a275c,_0x27d298,_0x3df9dc){var _0x4e1c4a={};var _0x2d9dc2={};var _0x5cce9a;var _0x1c6863;return db[_0xc130('0x2a')][_0xc130('0x4b')]({'where':{'id':_0x2a275c['params']['id']}})['then'](handleEntityNotFound(_0x27d298,null))['then'](function(_0x1f2bc7){if(_0x1f2bc7){_0x5cce9a=_0x1f2bc7;_0x2d9dc2['model']=_[_0xc130('0x30')](db['Action']['rawAttributes']);_0x2d9dc2[_0xc130('0x2f')]=_[_0xc130('0x30')](_0x2a275c[_0xc130('0x2f')]);_0x2d9dc2[_0xc130('0x37')]=_['intersection'](_0x2d9dc2['model'],_0x2d9dc2['query']);_0x4e1c4a[_0xc130('0x32')]=_[_0xc130('0x31')](_0x2d9dc2[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x2a275c['query'][_0xc130('0x33')]));_0x4e1c4a[_0xc130('0x32')]=_0x4e1c4a[_0xc130('0x32')]['length']?_0x4e1c4a['attributes']:_0x2d9dc2['model'];_0x4e1c4a['order']=qs['sort'](_0x2a275c[_0xc130('0x2f')][_0xc130('0x35')]);_0x4e1c4a[_0xc130('0x36')]=qs[_0xc130('0x37')](_[_0xc130('0x38')](_0x2a275c[_0xc130('0x2f')],_0x2d9dc2[_0xc130('0x37')]));if(_0x2a275c[_0xc130('0x2f')][_0xc130('0x3c')]){_0x4e1c4a[_0xc130('0x36')]=_[_0xc130('0x39')](_0x4e1c4a[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x4e1c4a['attributes'],function(_0x4f4cee){var _0x993470={};_0x993470[_0x4f4cee]={'$like':'%'+_0x2a275c[_0xc130('0x2f')]['filter']+'%'};return _0x993470;})});}_0x4e1c4a=_[_0xc130('0x39')]({},_0x4e1c4a,_0x2a275c[_0xc130('0x3d')]);return _0x5cce9a['getActions'](_0x4e1c4a);}})['then'](function(_0x3742b5){if(_0x3742b5){_0x1c6863=_0x3742b5[_0xc130('0x44')];if(!_0x2a275c[_0xc130('0x2f')][_0xc130('0x34')]('nolimit')){_0x4e1c4a['limit']=qs['limit'](_0x2a275c[_0xc130('0x2f')][_0xc130('0x1f')]);_0x4e1c4a['offset']=qs[_0xc130('0x1c')](_0x2a275c[_0xc130('0x2f')][_0xc130('0x1c')]);}return _0x5cce9a['getActions'](_0x4e1c4a);}})[_0xc130('0x3e')](function(_0x1ded5e){if(_0x1ded5e){return _0x1ded5e?{'count':_0x1c6863,'rows':_0x1ded5e}:null;}})[_0xc130('0x3e')](respondWithResult(_0x27d298,null))[_0xc130('0x47')](handleError(_0x27d298,null));}; \ No newline at end of file +var _0x52fb=['create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','rawAttributes','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','end','name','send','index','map','Automation','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find'];(function(_0xbb9cb0,_0x4c1858){var _0x5cfd58=function(_0x28b75c){while(--_0x28b75c){_0xbb9cb0['push'](_0xbb9cb0['shift']());}};_0x5cfd58(++_0x4c1858);}(_0x52fb,0x159));var _0xb52f=function(_0x3c34a7,_0xa6350f){_0x3c34a7=_0x3c34a7-0x0;var _0xd7007e=_0x52fb[_0x3c34a7];return _0xd7007e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb52f('0x0'));var zipdir=require(_0xb52f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb52f('0x2'));var moment=require(_0xb52f('0x3'));var BPromise=require(_0xb52f('0x4'));var Mustache=require(_0xb52f('0x5'));var util=require(_0xb52f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb52f('0x7'));var ejs=require(_0xb52f('0x8'));var fs=require('fs');var fs_extra=require(_0xb52f('0x9'));var _=require('lodash');var squel=require(_0xb52f('0xa'));var crypto=require(_0xb52f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb52f('0x7'));var querystring=require(_0xb52f('0xc'));var Papa=require(_0xb52f('0xd'));var Redis=require(_0xb52f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb52f('0xf'));var as=require(_0xb52f('0x10'));var hardwareService=require(_0xb52f('0x11'));var logger=require(_0xb52f('0x12'))(_0xb52f('0x13'));var utils=require(_0xb52f('0x14'));var config=require(_0xb52f('0x15'));var licenseUtil=require(_0xb52f('0x16'));var db=require(_0xb52f('0x17'))['db'];function respondWithStatusCode(_0x268108,_0x3715d8){_0x3715d8=_0x3715d8||0xcc;return function(_0x3bec6e){if(_0x3bec6e){return _0x268108[_0xb52f('0x18')](_0x3715d8);}return _0x268108[_0xb52f('0x19')](_0x3715d8)['end']();};}function respondWithResult(_0x129732,_0x32ea6d){_0x32ea6d=_0x32ea6d||0xc8;return function(_0x2446b3){if(_0x2446b3){return _0x129732[_0xb52f('0x19')](_0x32ea6d)[_0xb52f('0x1a')](_0x2446b3);}};}function respondWithFilteredResult(_0x516331,_0xb4df1c){return function(_0x22da4e){if(_0x22da4e){var _0x33cc8d=typeof _0xb4df1c[_0xb52f('0x1b')]===_0xb52f('0x1c')&&typeof _0xb4df1c['limit']===_0xb52f('0x1c');var _0x3dfb76=_0x22da4e[_0xb52f('0x1d')];var _0x2755e3=_0x33cc8d?0x0:_0xb4df1c[_0xb52f('0x1b')];var _0x12ea19=_0x33cc8d?_0x22da4e[_0xb52f('0x1d')]:_0xb4df1c[_0xb52f('0x1b')]+_0xb4df1c['limit'];var _0x8d9eee;if(_0x12ea19>=_0x3dfb76){_0x12ea19=_0x3dfb76;_0x8d9eee=0xc8;}else{_0x8d9eee=0xce;}_0x516331[_0xb52f('0x19')](_0x8d9eee);return _0x516331[_0xb52f('0x1e')]('Content-Range',_0x2755e3+'-'+_0x12ea19+'/'+_0x3dfb76)[_0xb52f('0x1a')](_0x22da4e);}return null;};}function patchUpdates(_0x1e15d3){return function(_0x2efafb){try{jsonpatch[_0xb52f('0x1f')](_0x2efafb,_0x1e15d3,!![]);}catch(_0x35b36c){return BPromise[_0xb52f('0x20')](_0x35b36c);}return _0x2efafb[_0xb52f('0x21')]();};}function saveUpdates(_0x1470e6,_0xb13a0){return function(_0x2bf43f){if(_0x2bf43f){return _0x2bf43f[_0xb52f('0x22')](_0x1470e6)[_0xb52f('0x23')](function(_0x580094){return _0x580094;});}return null;};}function removeEntity(_0x5ac2e3,_0x103b2d){return function(_0x1b5500){if(_0x1b5500){return _0x1b5500[_0xb52f('0x24')]()[_0xb52f('0x23')](function(){_0x5ac2e3[_0xb52f('0x19')](0xcc)[_0xb52f('0x25')]();});}};}function handleEntityNotFound(_0x4594ee,_0x33e947){return function(_0x123e11){if(!_0x123e11){_0x4594ee[_0xb52f('0x18')](0x194);}return _0x123e11;};}function handleError(_0x42b28a,_0x4f05f5){_0x4f05f5=_0x4f05f5||0x1f4;return function(_0x373842){logger['error'](_0x373842['stack']);if(_0x373842[_0xb52f('0x26')]){delete _0x373842['name'];}_0x42b28a[_0xb52f('0x19')](_0x4f05f5)[_0xb52f('0x27')](_0x373842);};}exports[_0xb52f('0x28')]=function(_0x993833,_0xe48dee){var _0x1a299f={},_0x25467a={},_0x33f0f2={'count':0x0,'rows':[]};var _0x262d30=_[_0xb52f('0x29')](db[_0xb52f('0x2a')]['rawAttributes'],function(_0x371a5f){return{'name':_0x371a5f['fieldName'],'type':_0x371a5f[_0xb52f('0x2b')]['key']};});_0x25467a[_0xb52f('0x2c')]=_['map'](_0x262d30,_0xb52f('0x26'));_0x25467a[_0xb52f('0x2d')]=_['keys'](_0x993833[_0xb52f('0x2d')]);_0x25467a['filters']=_[_0xb52f('0x2e')](_0x25467a[_0xb52f('0x2c')],_0x25467a[_0xb52f('0x2d')]);_0x1a299f[_0xb52f('0x2f')]=_[_0xb52f('0x2e')](_0x25467a[_0xb52f('0x2c')],qs[_0xb52f('0x30')](_0x993833['query'][_0xb52f('0x30')]));_0x1a299f[_0xb52f('0x2f')]=_0x1a299f['attributes'][_0xb52f('0x31')]?_0x1a299f['attributes']:_0x25467a[_0xb52f('0x2c')];if(!_0x993833[_0xb52f('0x2d')][_0xb52f('0x32')](_0xb52f('0x33'))){_0x1a299f[_0xb52f('0x34')]=qs[_0xb52f('0x34')](_0x993833['query']['limit']);_0x1a299f['offset']=qs['offset'](_0x993833['query'][_0xb52f('0x1b')]);}_0x1a299f[_0xb52f('0x35')]=qs[_0xb52f('0x36')](_0x993833['query'][_0xb52f('0x36')]);_0x1a299f[_0xb52f('0x37')]=qs[_0xb52f('0x38')](_[_0xb52f('0x39')](_0x993833[_0xb52f('0x2d')],_0x25467a['filters']),_0x262d30);if(_0x993833[_0xb52f('0x2d')][_0xb52f('0x3a')]){_0x1a299f[_0xb52f('0x37')]=_[_0xb52f('0x3b')](_0x1a299f['where'],{'$or':_[_0xb52f('0x29')](_0x262d30,function(_0x1840c7){if(_0x1840c7['type']!==_0xb52f('0x3c')){var _0x32dbf1={};_0x32dbf1[_0x1840c7['name']]={'$like':'%'+_0x993833['query'][_0xb52f('0x3a')]+'%'};return _0x32dbf1;}})});}_0x1a299f=_['merge']({},_0x1a299f,_0x993833[_0xb52f('0x3d')]);var _0x58b762={'where':_0x1a299f[_0xb52f('0x37')]};return db['Automation'][_0xb52f('0x1d')](_0x58b762)['then'](function(_0x45a504){_0x33f0f2['count']=_0x45a504;if(_0x993833['query'][_0xb52f('0x3e')]){_0x1a299f['include']=[{'all':!![]}];}return db['Automation'][_0xb52f('0x3f')](_0x1a299f);})[_0xb52f('0x23')](function(_0x55d527){_0x33f0f2[_0xb52f('0x40')]=_0x55d527;return _0x33f0f2;})[_0xb52f('0x23')](respondWithFilteredResult(_0xe48dee,_0x1a299f))[_0xb52f('0x41')](handleError(_0xe48dee,null));};exports[_0xb52f('0x42')]=function(_0x223107,_0x325a3b){var _0x287067={'raw':![],'where':{'id':_0x223107['params']['id']}},_0x171b40={};_0x171b40[_0xb52f('0x2c')]=_[_0xb52f('0x43')](db[_0xb52f('0x2a')]['rawAttributes']);_0x171b40['query']=_[_0xb52f('0x43')](_0x223107[_0xb52f('0x2d')]);_0x171b40['filters']=_[_0xb52f('0x2e')](_0x171b40[_0xb52f('0x2c')],_0x171b40['query']);_0x287067[_0xb52f('0x2f')]=_[_0xb52f('0x2e')](_0x171b40[_0xb52f('0x2c')],qs[_0xb52f('0x30')](_0x223107[_0xb52f('0x2d')][_0xb52f('0x30')]));_0x287067[_0xb52f('0x2f')]=_0x287067[_0xb52f('0x2f')][_0xb52f('0x31')]?_0x287067[_0xb52f('0x2f')]:_0x171b40['model'];if(_0x223107[_0xb52f('0x2d')][_0xb52f('0x3e')]){_0x287067[_0xb52f('0x44')]=[{'all':!![]}];}_0x287067=_[_0xb52f('0x3b')]({},_0x287067,_0x223107[_0xb52f('0x3d')]);return db[_0xb52f('0x2a')][_0xb52f('0x45')](_0x287067)[_0xb52f('0x23')](handleEntityNotFound(_0x325a3b,null))[_0xb52f('0x23')](respondWithResult(_0x325a3b,null))[_0xb52f('0x41')](handleError(_0x325a3b,null));};exports[_0xb52f('0x46')]=function(_0xf96b24,_0x1f609d){return db[_0xb52f('0x2a')]['create'](_0xf96b24[_0xb52f('0x47')],{})[_0xb52f('0x23')](respondWithResult(_0x1f609d,0xc9))[_0xb52f('0x41')](handleError(_0x1f609d,null));};exports[_0xb52f('0x22')]=function(_0x50ff24,_0x53207e){if(_0x50ff24[_0xb52f('0x47')]['id']){delete _0x50ff24[_0xb52f('0x47')]['id'];}return db[_0xb52f('0x2a')][_0xb52f('0x45')]({'where':{'id':_0x50ff24[_0xb52f('0x48')]['id']}})['then'](handleEntityNotFound(_0x53207e,null))[_0xb52f('0x23')](saveUpdates(_0x50ff24[_0xb52f('0x47')],null))[_0xb52f('0x23')](respondWithResult(_0x53207e,null))[_0xb52f('0x41')](handleError(_0x53207e,null));};exports['destroy']=function(_0x21358c,_0x5c0dc4){return db[_0xb52f('0x2a')]['find']({'where':{'id':_0x21358c[_0xb52f('0x48')]['id']}})[_0xb52f('0x23')](handleEntityNotFound(_0x5c0dc4,null))[_0xb52f('0x23')](removeEntity(_0x5c0dc4,null))['catch'](handleError(_0x5c0dc4,null));};exports[_0xb52f('0x49')]=function(_0xea4c,_0x3d2190,_0x4d1f44){return db[_0xb52f('0x4a')][_0xb52f('0x45')]({'where':{'id':_0xea4c[_0xb52f('0x48')]['id']}})[_0xb52f('0x23')](handleEntityNotFound(_0x3d2190,null))['then'](function(_0x4e1780){if(_0x4e1780){return _0x4e1780[_0xb52f('0x49')](_0xea4c[_0xb52f('0x47')][_0xb52f('0x4b')],_[_0xb52f('0x4c')](_0xea4c[_0xb52f('0x47')],[_0xb52f('0x4b'),'id'])||{});}})[_0xb52f('0x23')](respondWithResult(_0x3d2190,null))[_0xb52f('0x41')](handleError(_0x3d2190,null));};exports[_0xb52f('0x4d')]=function(_0xd85fe4,_0x375fc6,_0x54ce4b){var _0x41abe2={};var _0x3c9c18={};var _0x4d053d;var _0x1e9a16;return db[_0xb52f('0x2a')][_0xb52f('0x4e')]({'where':{'id':_0xd85fe4[_0xb52f('0x48')]['id']}})[_0xb52f('0x23')](handleEntityNotFound(_0x375fc6,null))[_0xb52f('0x23')](function(_0x5c4580){if(_0x5c4580){_0x4d053d=_0x5c4580;_0x3c9c18['model']=_[_0xb52f('0x43')](db[_0xb52f('0x4a')]['rawAttributes']);_0x3c9c18[_0xb52f('0x2d')]=_[_0xb52f('0x43')](_0xd85fe4[_0xb52f('0x2d')]);_0x3c9c18[_0xb52f('0x38')]=_['intersection'](_0x3c9c18[_0xb52f('0x2c')],_0x3c9c18['query']);_0x41abe2[_0xb52f('0x2f')]=_[_0xb52f('0x2e')](_0x3c9c18[_0xb52f('0x2c')],qs[_0xb52f('0x30')](_0xd85fe4[_0xb52f('0x2d')][_0xb52f('0x30')]));_0x41abe2[_0xb52f('0x2f')]=_0x41abe2[_0xb52f('0x2f')][_0xb52f('0x31')]?_0x41abe2[_0xb52f('0x2f')]:_0x3c9c18[_0xb52f('0x2c')];_0x41abe2[_0xb52f('0x35')]=qs[_0xb52f('0x36')](_0xd85fe4[_0xb52f('0x2d')][_0xb52f('0x36')]);_0x41abe2['where']=qs['filters'](_['pick'](_0xd85fe4[_0xb52f('0x2d')],_0x3c9c18[_0xb52f('0x38')]));if(_0xd85fe4[_0xb52f('0x2d')][_0xb52f('0x3a')]){_0x41abe2[_0xb52f('0x37')]=_[_0xb52f('0x3b')](_0x41abe2[_0xb52f('0x37')],{'$or':_[_0xb52f('0x29')](_0x41abe2[_0xb52f('0x2f')],function(_0x1a3b7a){var _0x2cfdc1={};_0x2cfdc1[_0x1a3b7a]={'$like':'%'+_0xd85fe4['query'][_0xb52f('0x3a')]+'%'};return _0x2cfdc1;})});}_0x41abe2=_[_0xb52f('0x3b')]({},_0x41abe2,_0xd85fe4[_0xb52f('0x3d')]);return _0x4d053d[_0xb52f('0x4d')](_0x41abe2);}})[_0xb52f('0x23')](function(_0x26826e){if(_0x26826e){_0x1e9a16=_0x26826e[_0xb52f('0x31')];if(!_0xd85fe4['query'][_0xb52f('0x32')](_0xb52f('0x33'))){_0x41abe2[_0xb52f('0x34')]=qs['limit'](_0xd85fe4[_0xb52f('0x2d')]['limit']);_0x41abe2[_0xb52f('0x1b')]=qs[_0xb52f('0x1b')](_0xd85fe4['query'][_0xb52f('0x1b')]);}return _0x4d053d[_0xb52f('0x4d')](_0x41abe2);}})[_0xb52f('0x23')](function(_0x1b3f52){if(_0x1b3f52){return _0x1b3f52?{'count':_0x1e9a16,'rows':_0x1b3f52}:null;}})[_0xb52f('0x23')](respondWithResult(_0x375fc6,null))['catch'](handleError(_0x375fc6,null));};exports[_0xb52f('0x4f')]=function(_0xec0167,_0x3d598b,_0x395879){return db['Action'][_0xb52f('0x45')]({'where':{'id':_0xec0167['params']['id']}})[_0xb52f('0x23')](handleEntityNotFound(_0x3d598b,null))[_0xb52f('0x23')](function(_0x58f0c9){if(_0x58f0c9){return _0x58f0c9[_0xb52f('0x4f')](_0xec0167[_0xb52f('0x47')][_0xb52f('0x4b')],_[_0xb52f('0x4c')](_0xec0167[_0xb52f('0x47')],[_0xb52f('0x4b'),'id'])||{});}})[_0xb52f('0x23')](respondWithResult(_0x3d598b,null))[_0xb52f('0x41')](handleError(_0x3d598b,null));};exports[_0xb52f('0x50')]=function(_0x312db0,_0xbde5dd,_0x227ddd){var _0x128812={};var _0x422e3e={};var _0x32173f;var _0x19fa8b;return db[_0xb52f('0x2a')]['findOne']({'where':{'id':_0x312db0['params']['id']}})[_0xb52f('0x23')](handleEntityNotFound(_0xbde5dd,null))[_0xb52f('0x23')](function(_0x28f431){if(_0x28f431){_0x32173f=_0x28f431;_0x422e3e['model']=_[_0xb52f('0x43')](db[_0xb52f('0x51')][_0xb52f('0x52')]);_0x422e3e['query']=_[_0xb52f('0x43')](_0x312db0[_0xb52f('0x2d')]);_0x422e3e[_0xb52f('0x38')]=_[_0xb52f('0x2e')](_0x422e3e[_0xb52f('0x2c')],_0x422e3e[_0xb52f('0x2d')]);_0x128812['attributes']=_[_0xb52f('0x2e')](_0x422e3e['model'],qs[_0xb52f('0x30')](_0x312db0[_0xb52f('0x2d')][_0xb52f('0x30')]));_0x128812[_0xb52f('0x2f')]=_0x128812[_0xb52f('0x2f')][_0xb52f('0x31')]?_0x128812[_0xb52f('0x2f')]:_0x422e3e[_0xb52f('0x2c')];_0x128812[_0xb52f('0x35')]=qs['sort'](_0x312db0[_0xb52f('0x2d')]['sort']);_0x128812[_0xb52f('0x37')]=qs[_0xb52f('0x38')](_['pick'](_0x312db0[_0xb52f('0x2d')],_0x422e3e[_0xb52f('0x38')]));if(_0x312db0[_0xb52f('0x2d')][_0xb52f('0x3a')]){_0x128812[_0xb52f('0x37')]=_[_0xb52f('0x3b')](_0x128812[_0xb52f('0x37')],{'$or':_['map'](_0x128812[_0xb52f('0x2f')],function(_0x15b9d6){var _0x1d0d40={};_0x1d0d40[_0x15b9d6]={'$like':'%'+_0x312db0['query'][_0xb52f('0x3a')]+'%'};return _0x1d0d40;})});}_0x128812=_[_0xb52f('0x3b')]({},_0x128812,_0x312db0[_0xb52f('0x3d')]);return _0x32173f[_0xb52f('0x50')](_0x128812);}})[_0xb52f('0x23')](function(_0x545b3e){if(_0x545b3e){_0x19fa8b=_0x545b3e[_0xb52f('0x31')];if(!_0x312db0[_0xb52f('0x2d')][_0xb52f('0x32')]('nolimit')){_0x128812['limit']=qs[_0xb52f('0x34')](_0x312db0[_0xb52f('0x2d')][_0xb52f('0x34')]);_0x128812[_0xb52f('0x1b')]=qs['offset'](_0x312db0[_0xb52f('0x2d')][_0xb52f('0x1b')]);}return _0x32173f['getActions'](_0x128812);}})['then'](function(_0x51acaf){if(_0x51acaf){return _0x51acaf?{'count':_0x19fa8b,'rows':_0x51acaf}:null;}})[_0xb52f('0x23')](respondWithResult(_0xbde5dd,null))['catch'](handleError(_0xbde5dd,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 31e7cef..2b2f072 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 _0xa252=['exports','define','Automation','tools_automations','util','moment','path','rimraf','./automation.attributes'];(function(_0xfb8e9c,_0x4bfaec){var _0x432968=function(_0x574cce){while(--_0x574cce){_0xfb8e9c['push'](_0xfb8e9c['shift']());}};_0x432968(++_0x4bfaec);}(_0xa252,0x1d8));var _0x2a25=function(_0x366c03,_0x137ce6){_0x366c03=_0x366c03-0x0;var _0x48c619=_0xa252[_0x366c03];return _0x48c619;};'use strict';var _=require('lodash');var util=require(_0x2a25('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2a25('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a25('0x2'));var rimraf=require(_0x2a25('0x3'));var config=require('../../config/environment');var attributes=require(_0x2a25('0x4'));module[_0x2a25('0x5')]=function(_0xa46b4c,_0xa36adb){return _0xa46b4c[_0x2a25('0x6')](_0x2a25('0x7'),attributes,{'tableName':_0x2a25('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x039a=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation','tools_automations'];(function(_0x4e8286,_0x4eaeb4){var _0x44a440=function(_0x5e0907){while(--_0x5e0907){_0x4e8286['push'](_0x4e8286['shift']());}};_0x44a440(++_0x4eaeb4);}(_0x039a,0x1bc));var _0xa039=function(_0x3073b1,_0x349ef5){_0x3073b1=_0x3073b1-0x0;var _0x58d884=_0x039a[_0x3073b1];return _0x58d884;};'use strict';var _=require(_0xa039('0x0'));var util=require(_0xa039('0x1'));var logger=require('../../config/logger')(_0xa039('0x2'));var moment=require(_0xa039('0x3'));var BPromise=require(_0xa039('0x4'));var rp=require(_0xa039('0x5'));var fs=require('fs');var path=require(_0xa039('0x6'));var rimraf=require('rimraf');var config=require(_0xa039('0x7'));var attributes=require('./automation.attributes');module[_0xa039('0x8')]=function(_0x1f2ab5,_0x55641c){return _0x1f2ab5[_0xa039('0x9')](_0xa039('0xa'),attributes,{'tableName':_0xa039('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 28313af..6d50a27 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 _0x8322=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0x8322,0x186));var _0x2832=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0x8322[_0x242a98];return _0x580999;};'use strict';var _=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var moment=require(_0x2832('0x2'));var BPromise=require(_0x2832('0x3'));var rs=require(_0x2832('0x4'));var fs=require('fs');var Redis=require(_0x2832('0x5'));var db=require(_0x2832('0x6'))['db'];var utils=require(_0x2832('0x7'));var logger=require(_0x2832('0x8'))(_0x2832('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2832('0xa')][_0x2832('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab2c39,_0x29a788,_0x1488df){return new BPromise(function(_0x4b0ca8,_0xb57a3c){return client[_0x2832('0xc')](_0xab2c39,_0x1488df)[_0x2832('0xd')](function(_0xb1f005){logger['info'](_0x2832('0xe'),_0x29a788,_0x2832('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x29a788,_0x2832('0xf'),JSON['stringify'](_0xb1f005));if(_0xb1f005['error']){if(_0xb1f005[_0x2832('0x10')][_0x2832('0x11')]===0x1f4){logger[_0x2832('0x10')](_0x2832('0xe'),_0x29a788,_0xb1f005['error'][_0x2832('0x12')]);return _0xb57a3c(_0xb1f005[_0x2832('0x10')]['message']);}logger[_0x2832('0x10')](_0x2832('0xe'),_0x29a788,_0xb1f005[_0x2832('0x10')][_0x2832('0x12')]);return _0x4b0ca8(_0xb1f005[_0x2832('0x10')][_0x2832('0x12')]);}else{logger[_0x2832('0x13')]('Automation,\x20%s,\x20%s',_0x29a788,_0x2832('0xf'));_0x4b0ca8(_0xb1f005[_0x2832('0x14')]['message']);}})[_0x2832('0x15')](function(_0x56d1e6){logger[_0x2832('0x10')]('Automation,\x20%s,\x20%s',_0x29a788,_0x56d1e6);_0xb57a3c(_0x56d1e6);});});} \ No newline at end of file +var _0xa5dd=['request','then','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x405632,_0x4a20ff){var _0x6f30d5=function(_0x215301){while(--_0x215301){_0x405632['push'](_0x405632['shift']());}};_0x6f30d5(++_0x4a20ff);}(_0xa5dd,0x101));var _0xda5d=function(_0x4ae5dd,_0x5543e1){_0x4ae5dd=_0x4ae5dd-0x0;var _0x1d215d=_0xa5dd[_0x4ae5dd];return _0x1d215d;};'use strict';var _=require(_0xda5d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xda5d('0x1'));var rs=require(_0xda5d('0x2'));var fs=require('fs');var Redis=require(_0xda5d('0x3'));var db=require(_0xda5d('0x4'))['db'];var utils=require(_0xda5d('0x5'));var logger=require('../../config/logger')(_0xda5d('0x6'));var config=require(_0xda5d('0x7'));var jayson=require(_0xda5d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x461283,_0x91cf4e,_0x432097){return new BPromise(function(_0x402aa8,_0x1c1e2d){return client[_0xda5d('0x9')](_0x461283,_0x432097)[_0xda5d('0xa')](function(_0x3d5c69){logger['info']('Automation,\x20%s,\x20%s',_0x91cf4e,_0xda5d('0xb'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x91cf4e,_0xda5d('0xb'),JSON[_0xda5d('0xc')](_0x3d5c69));if(_0x3d5c69['error']){if(_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xe')]===0x1f4){logger[_0xda5d('0xd')]('Automation,\x20%s,\x20%s',_0x91cf4e,_0x3d5c69['error'][_0xda5d('0xf')]);return _0x1c1e2d(_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xf')]);}logger[_0xda5d('0xd')](_0xda5d('0x10'),_0x91cf4e,_0x3d5c69[_0xda5d('0xd')][_0xda5d('0xf')]);return _0x402aa8(_0x3d5c69['error']['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x91cf4e,'request\x20sent');_0x402aa8(_0x3d5c69[_0xda5d('0x11')][_0xda5d('0xf')]);}})[_0xda5d('0x12')](function(_0x388f40){logger[_0xda5d('0xd')](_0xda5d('0x10'),_0x91cf4e,_0x388f40);_0x1c1e2d(_0x388f40);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0cc365d..22f5d02 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 _0x33ed=['post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','getActions'];(function(_0x162902,_0x4b317a){var _0x1ee9b3=function(_0x57e390){while(--_0x57e390){_0x162902['push'](_0x162902['shift']());}};_0x1ee9b3(++_0x4b317a);}(_0x33ed,0x66));var _0xd33e=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x33ed[_0x644ecd];return _0x1c66ce;};'use strict';var multer=require('multer');var util=require(_0xd33e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd33e('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd33e('0x2'));var interaction=require(_0xd33e('0x3'));var config=require(_0xd33e('0x4'));var controller=require('./automation.controller');router['get']('/',auth[_0xd33e('0x5')](),controller[_0xd33e('0x6')]);router['get'](_0xd33e('0x7'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x8')]);router[_0xd33e('0x9')](_0xd33e('0xa'),auth[_0xd33e('0x5')](),controller[_0xd33e('0xb')]);router[_0xd33e('0x9')]('/:id/actions',auth[_0xd33e('0x5')](),controller[_0xd33e('0xc')]);router[_0xd33e('0xd')]('/',auth[_0xd33e('0x5')](),controller[_0xd33e('0xe')]);router[_0xd33e('0xd')](_0xd33e('0xa'),auth[_0xd33e('0x5')](),controller[_0xd33e('0xf')]);router[_0xd33e('0xd')](_0xd33e('0x10'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x11')]);router[_0xd33e('0x12')](_0xd33e('0x7'),auth['isAuthenticated'](),controller[_0xd33e('0x13')]);router[_0xd33e('0x14')](_0xd33e('0x7'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x15')]);module[_0xd33e('0x16')]=router; \ No newline at end of file +var _0xba2d=['update','delete','destroy','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','/:id'];(function(_0x58e8fc,_0x5afae5){var _0x4ebec7=function(_0x13159c){while(--_0x13159c){_0x58e8fc['push'](_0x58e8fc['shift']());}};_0x4ebec7(++_0x5afae5);}(_0xba2d,0xa3));var _0xdba2=function(_0x5bdad7,_0x231d70){_0x5bdad7=_0x5bdad7-0x0;var _0x35fb88=_0xba2d[_0x5bdad7];return _0x35fb88;};'use strict';var multer=require('multer');var util=require(_0xdba2('0x0'));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(_0xdba2('0x1'));var interaction=require(_0xdba2('0x2'));var config=require(_0xdba2('0x3'));var controller=require(_0xdba2('0x4'));router[_0xdba2('0x5')]('/',auth[_0xdba2('0x6')](),controller[_0xdba2('0x7')]);router[_0xdba2('0x5')]('/:id',auth[_0xdba2('0x6')](),controller['show']);router[_0xdba2('0x5')](_0xdba2('0x8'),auth[_0xdba2('0x6')](),controller[_0xdba2('0x9')]);router[_0xdba2('0x5')](_0xdba2('0xa'),auth['isAuthenticated'](),controller[_0xdba2('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdba2('0xc')](_0xdba2('0x8'),auth[_0xdba2('0x6')](),controller[_0xdba2('0xd')]);router[_0xdba2('0xc')](_0xdba2('0xa'),auth[_0xdba2('0x6')](),controller[_0xdba2('0xe')]);router[_0xdba2('0xf')](_0xdba2('0x10'),auth[_0xdba2('0x6')](),controller[_0xdba2('0x11')]);router[_0xdba2('0x12')](_0xdba2('0x10'),auth[_0xdba2('0x6')](),controller[_0xdba2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index d814803..df24cc9 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 _0x9550=['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','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3206ab,_0x55af3b){var _0x17afc4=function(_0x4a3cfe){while(--_0x4a3cfe){_0x3206ab['push'](_0x3206ab['shift']());}};_0x17afc4(++_0x55af3b);}(_0x9550,0x1cc));var _0x0955=function(_0x32d226,_0x1ee2dc){_0x32d226=_0x32d226-0x0;var _0x4acf5f=_0x9550[_0x32d226];return _0x4acf5f;};'use strict';var Sequelize=require('sequelize');module[_0x0955('0x0')]={'name':{'type':Sequelize[_0x0955('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0955('0x2')](_0x0955('0x3')),'allowNull':![],'defaultValue':_0x0955('0x3')},'description':{'type':Sequelize[_0x0955('0x1')]},'active':{'type':Sequelize[_0x0955('0x4')],'defaultValue':0x0,'comment':_0x0955('0x5')},'limitCalls':{'type':Sequelize[_0x0955('0x6')](0x4)[_0x0955('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0955('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0955('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0955('0xd')},'dialTimezone':{'type':Sequelize[_0x0955('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0955('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0955('0x2')](_0x0955('0xe'),_0x0955('0xf'),_0x0955('0x10')),'defaultValue':_0x0955('0xe')},'dialAMDActive':{'type':Sequelize[_0x0955('0x4')],'defaultValue':0x0,'comment':_0x0955('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0955('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0955('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0955('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0955('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0955('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0955('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0955('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0955('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0955('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0955('0x18'),_0x0955('0x19')),'defaultValue':_0x0955('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0955('0x1a')},'dialCutDigit':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0955('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x22')}}; \ No newline at end of file +var _0x0249=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x2e29b9,_0x443f78){var _0x32424d=function(_0x333023){while(--_0x333023){_0x2e29b9['push'](_0x2e29b9['shift']());}};_0x32424d(++_0x443f78);}(_0x0249,0x86));var _0x9024=function(_0x2fce6d,_0x4896ed){_0x2fce6d=_0x2fce6d-0x0;var _0x563d42=_0x0249[_0x2fce6d];return _0x563d42;};'use strict';var Sequelize=require(_0x9024('0x0'));module[_0x9024('0x1')]={'name':{'type':Sequelize[_0x9024('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9024('0x3')](_0x9024('0x4')),'allowNull':![],'defaultValue':_0x9024('0x4')},'description':{'type':Sequelize[_0x9024('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9024('0x5')},'limitCalls':{'type':Sequelize[_0x9024('0x6')](0x4)[_0x9024('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9024('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)[_0x9024('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)[_0x9024('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9024('0x7')],'defaultValue':0x3,'comment':_0x9024('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)[_0x9024('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9024('0xf')},'dialTimezone':{'type':Sequelize[_0x9024('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9024('0x2')],'defaultValue':_0x9024('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x9024('0x3')]('always',_0x9024('0x11'),_0x9024('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x9024('0x13')],'defaultValue':0x0,'comment':_0x9024('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9024('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x9024('0x6')](0x9)[_0x9024('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9024('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9024('0x6')](0x9)[_0x9024('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9024('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9024('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9024('0x6')](0x9)[_0x9024('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9024('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9024('0x6')](0x9)[_0x9024('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9024('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9024('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9024('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9024('0x6')](0x5)[_0x9024('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9024('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9024('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9024('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x9024('0x1d'),_0x9024('0x1e')),'defaultValue':_0x9024('0x1d')},'dialPrefix':{'type':Sequelize[_0x9024('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9024('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9024('0x1f')},'dialCutDigit':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)[_0x9024('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9024('0x6')](0x5)[_0x9024('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9024('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9024('0x6')](0x3)[_0x9024('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9024('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9024('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index a1eb206..c2499dc 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 _0xd8d0=['userProfileId','getHoppers','findOne','CmHopper','CampaignId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','scheduledAt','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','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','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','send','index','map','Campaign','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','IvrCampaigns','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','role'];(function(_0xa9671b,_0x11378d){var _0x205591=function(_0x5dc88d){while(--_0x5dc88d){_0xa9671b['push'](_0xa9671b['shift']());}};_0x205591(++_0x11378d);}(_0xd8d0,0x1c0));var _0x0d8d=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xd8d0[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x0d8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d8d('0x1'));var jsonpatch=require(_0x0d8d('0x2'));var rp=require(_0x0d8d('0x3'));var moment=require(_0x0d8d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d8d('0x5'));var path=require(_0x0d8d('0x6'));var sox=require('sox');var csv=require(_0x0d8d('0x7'));var ejs=require(_0x0d8d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d8d('0x9'));var squel=require(_0x0d8d('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d8d('0xb'));var deskjs=require(_0x0d8d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0d8d('0xd'));var Papa=require(_0x0d8d('0xe'));var Redis=require(_0x0d8d('0xf'));var authService=require(_0x0d8d('0x10'));var qs=require(_0x0d8d('0x11'));var as=require(_0x0d8d('0x12'));var hardwareService=require(_0x0d8d('0x13'));var logger=require(_0x0d8d('0x14'))(_0x0d8d('0x15'));var utils=require(_0x0d8d('0x16'));var config=require(_0x0d8d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25973a,_0x11864a){_0x11864a=_0x11864a||0xcc;return function(_0x4d53b3){if(_0x4d53b3){return _0x25973a[_0x0d8d('0x18')](_0x11864a);}return _0x25973a[_0x0d8d('0x19')](_0x11864a)['end']();};}function respondWithResult(_0x4e6be5,_0x3f8e82){_0x3f8e82=_0x3f8e82||0xc8;return function(_0x4a1502){if(_0x4a1502){return _0x4e6be5['status'](_0x3f8e82)['json'](_0x4a1502);}};}function respondWithFilteredResult(_0x56c18b,_0x20d7c2){return function(_0x405f36){if(_0x405f36){var _0x2ae99d=typeof _0x20d7c2[_0x0d8d('0x1a')]===_0x0d8d('0x1b')&&typeof _0x20d7c2[_0x0d8d('0x1c')]==='undefined';var _0x56d582=_0x405f36[_0x0d8d('0x1d')];var _0x3a74e6=_0x2ae99d?0x0:_0x20d7c2[_0x0d8d('0x1a')];var _0x56c07e=_0x2ae99d?_0x405f36['count']:_0x20d7c2[_0x0d8d('0x1a')]+_0x20d7c2[_0x0d8d('0x1c')];var _0x106c7e;if(_0x56c07e>=_0x56d582){_0x56c07e=_0x56d582;_0x106c7e=0xc8;}else{_0x106c7e=0xce;}_0x56c18b[_0x0d8d('0x19')](_0x106c7e);return _0x56c18b[_0x0d8d('0x1e')](_0x0d8d('0x1f'),_0x3a74e6+'-'+_0x56c07e+'/'+_0x56d582)[_0x0d8d('0x20')](_0x405f36);}return null;};}function patchUpdates(_0x2379f9){return function(_0x2f6bcc){try{jsonpatch[_0x0d8d('0x21')](_0x2f6bcc,_0x2379f9,!![]);}catch(_0x511cba){return BPromise[_0x0d8d('0x22')](_0x511cba);}return _0x2f6bcc[_0x0d8d('0x23')]();};}function saveUpdates(_0x4106fa,_0x3bcd44){return function(_0x199c84){if(_0x199c84){return _0x199c84[_0x0d8d('0x24')](_0x4106fa)[_0x0d8d('0x25')](function(_0xa28bcb){return _0xa28bcb;});}return null;};}function removeEntity(_0x1940ff,_0x266b4e){return function(_0x47c1d9){if(_0x47c1d9){return _0x47c1d9['destroy']()[_0x0d8d('0x25')](function(){var _0x343e47=_0x47c1d9[_0x0d8d('0x26')]({'plain':!![]});var _0xce2cdd='IvrCampaigns';return db[_0x0d8d('0x27')][_0x0d8d('0x28')]({'where':{'type':_0xce2cdd,'resourceId':_0x343e47['id']}})[_0x0d8d('0x25')](function(){return _0x47c1d9;});})[_0x0d8d('0x25')](function(){_0x1940ff['status'](0xcc)[_0x0d8d('0x29')]();});}};}function handleEntityNotFound(_0x5ea510,_0xf984c4){return function(_0x5d297e){if(!_0x5d297e){_0x5ea510[_0x0d8d('0x18')](0x194);}return _0x5d297e;};}function handleError(_0x5adb10,_0x2febe5){_0x2febe5=_0x2febe5||0x1f4;return function(_0x4610b5){logger['error'](_0x4610b5['stack']);if(_0x4610b5[_0x0d8d('0x2a')]){delete _0x4610b5['name'];}_0x5adb10[_0x0d8d('0x19')](_0x2febe5)[_0x0d8d('0x2b')](_0x4610b5);};}exports[_0x0d8d('0x2c')]=function(_0x52cfb3,_0x5c8b6c){var _0x4413bc={},_0x32ca9a={},_0x3ecaff={'count':0x0,'rows':[]};var _0x87de94=_[_0x0d8d('0x2d')](db[_0x0d8d('0x2e')]['rawAttributes'],function(_0x297435){return{'name':_0x297435[_0x0d8d('0x2f')],'type':_0x297435[_0x0d8d('0x30')]['key']};});_0x32ca9a[_0x0d8d('0x31')]=_[_0x0d8d('0x2d')](_0x87de94,_0x0d8d('0x2a'));_0x32ca9a[_0x0d8d('0x32')]=_['keys'](_0x52cfb3[_0x0d8d('0x32')]);_0x32ca9a[_0x0d8d('0x33')]=_['intersection'](_0x32ca9a[_0x0d8d('0x31')],_0x32ca9a[_0x0d8d('0x32')]);_0x4413bc[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x32ca9a[_0x0d8d('0x31')],qs['fields'](_0x52cfb3['query'][_0x0d8d('0x36')]));_0x4413bc[_0x0d8d('0x34')]=_0x4413bc['attributes'][_0x0d8d('0x37')]?_0x4413bc[_0x0d8d('0x34')]:_0x32ca9a['model'];if(!_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x4413bc[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x4413bc[_0x0d8d('0x1a')]=qs['offset'](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x4413bc[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x4413bc['where']=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0x52cfb3['query'],_0x32ca9a[_0x0d8d('0x33')]),_0x87de94);if(_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x4413bc[_0x0d8d('0x3e')]=_['merge'](_0x4413bc[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x87de94,function(_0x289fc7){if(_0x289fc7[_0x0d8d('0x30')]!==_0x0d8d('0x3f')){var _0x21da3e={};_0x21da3e[_0x289fc7[_0x0d8d('0x2a')]]={'$like':'%'+_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x21da3e;}})});}_0x4413bc=_[_0x0d8d('0x40')]({},_0x4413bc,_0x52cfb3[_0x0d8d('0x41')]);var _0x29a2d7={'where':_0x4413bc[_0x0d8d('0x3e')]};return db[_0x0d8d('0x2e')]['count'](_0x29a2d7)[_0x0d8d('0x25')](function(_0x81152c){_0x3ecaff['count']=_0x81152c;if(_0x52cfb3['query']['includeAll']){_0x4413bc[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x2e')][_0x0d8d('0x43')](_0x4413bc);})[_0x0d8d('0x25')](function(_0x309cb6){_0x3ecaff['rows']=_0x309cb6;return _0x3ecaff;})[_0x0d8d('0x25')](respondWithFilteredResult(_0x5c8b6c,_0x4413bc))[_0x0d8d('0x44')](handleError(_0x5c8b6c,null));};exports[_0x0d8d('0x45')]=function(_0x597404,_0x3b5d27){var _0x47cf5b={'raw':![],'where':{'id':_0x597404[_0x0d8d('0x46')]['id']}},_0x4bbaaa={};_0x4bbaaa[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x2e')]['rawAttributes']);_0x4bbaaa[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x597404['query']);_0x4bbaaa[_0x0d8d('0x33')]=_['intersection'](_0x4bbaaa[_0x0d8d('0x31')],_0x4bbaaa[_0x0d8d('0x32')]);_0x47cf5b[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x4bbaaa[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0x597404[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x47cf5b[_0x0d8d('0x34')]=_0x47cf5b[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x47cf5b[_0x0d8d('0x34')]:_0x4bbaaa['model'];if(_0x597404['query'][_0x0d8d('0x48')]){_0x47cf5b[_0x0d8d('0x42')]=[{'all':!![]}];}_0x47cf5b=_['merge']({},_0x47cf5b,_0x597404[_0x0d8d('0x41')]);return db[_0x0d8d('0x2e')]['find'](_0x47cf5b)[_0x0d8d('0x25')](handleEntityNotFound(_0x3b5d27,null))['then'](respondWithResult(_0x3b5d27,null))['catch'](handleError(_0x3b5d27,null));};exports[_0x0d8d('0x49')]=function(_0x378ceb,_0x30b125){return db[_0x0d8d('0x2e')][_0x0d8d('0x49')](_0x378ceb[_0x0d8d('0x4a')],{})[_0x0d8d('0x25')](function(_0xa3ccbc){var _0xeef66e=_0x378ceb['user'][_0x0d8d('0x26')]({'plain':!![]});if(!_0xeef66e)throw new Error(_0x0d8d('0x4b'));if(_0xeef66e['role']===_0x0d8d('0x4c')){var _0x4c6fe8=_0xa3ccbc[_0x0d8d('0x26')]({'plain':!![]});var _0x2eeccc=_0x0d8d('0x4d');return db[_0x0d8d('0x4e')][_0x0d8d('0x4f')]({'where':{'name':_0x2eeccc,'userProfileId':_0xeef66e['userProfileId']},'raw':!![]})['then'](function(_0x3e9a46){if(_0x3e9a46&&_0x3e9a46[_0x0d8d('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c6fe8[_0x0d8d('0x2a')],'resourceId':_0x4c6fe8['id'],'type':_0x3e9a46[_0x0d8d('0x2a')],'sectionId':_0x3e9a46['id']},{})[_0x0d8d('0x25')](function(){return _0xa3ccbc;});}else{return _0xa3ccbc;}})[_0x0d8d('0x44')](function(_0x5fb565){logger[_0x0d8d('0x51')](_0x0d8d('0x52'),_0x5fb565);throw _0x5fb565;});}return _0xa3ccbc;})[_0x0d8d('0x25')](respondWithResult(_0x30b125,0xc9))[_0x0d8d('0x44')](handleError(_0x30b125,null));};exports['clone']=function(_0x4266a3,_0x2bfada){var _0x1b0ec8={'where':{'id':_0x4266a3[_0x0d8d('0x46')]['id']}},_0x10434c={};_0x10434c[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x2e')][_0x0d8d('0x53')]);_0x1b0ec8[_0x0d8d('0x34')]=_['intersection'](_0x10434c['model'],qs[_0x0d8d('0x36')](_0x4266a3[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x1b0ec8['attributes']=_0x1b0ec8[_0x0d8d('0x34')]['length']?_0x1b0ec8[_0x0d8d('0x34')]:_0x10434c[_0x0d8d('0x31')];if(_0x4266a3['query'][_0x0d8d('0x48')]){_0x1b0ec8[_0x0d8d('0x42')]=[{'all':!![]}];}_0x1b0ec8=_[_0x0d8d('0x40')]({},_0x1b0ec8,_0x4266a3['options']);return db['Campaign'][_0x0d8d('0x4f')](_0x1b0ec8)[_0x0d8d('0x25')](handleEntityNotFound(_0x2bfada,null))[_0x0d8d('0x25')](function(_0x63d94c){if(_0x63d94c){var _0x2956d4=_0x63d94c[_0x0d8d('0x26')]({'plain':!![]});_0x2956d4=qs[_0x0d8d('0x54')](_0x2956d4,['id',_0x0d8d('0x55'),_0x0d8d('0x56')]);_0x4266a3['body']=_[_0x0d8d('0x54')](_0x4266a3[_0x0d8d('0x4a')],['id',_0x0d8d('0x55'),_0x0d8d('0x56')]);return db['Campaign'][_0x0d8d('0x49')](_['merge'](_0x2956d4,_0x4266a3['body']),{'include':_0x4266a3[_0x0d8d('0x32')][_0x0d8d('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x1113bc){var _0x22afb9=_0x4266a3[_0x0d8d('0x4c')][_0x0d8d('0x26')]({'plain':!![]});if(!_0x22afb9)throw new Error(_0x0d8d('0x4b'));if(_0x22afb9[_0x0d8d('0x57')]===_0x0d8d('0x4c')){var _0x4582af=_0x1113bc[_0x0d8d('0x26')]({'plain':!![]});var _0x548f29=_0x0d8d('0x4d');return db[_0x0d8d('0x4e')][_0x0d8d('0x4f')]({'where':{'name':_0x548f29,'userProfileId':_0x22afb9[_0x0d8d('0x58')]},'raw':!![]})[_0x0d8d('0x25')](function(_0x4745da){if(_0x4745da&&_0x4745da[_0x0d8d('0x50')]===0x0){return db[_0x0d8d('0x27')][_0x0d8d('0x49')]({'name':_0x4582af[_0x0d8d('0x2a')],'resourceId':_0x4582af['id'],'type':_0x4745da[_0x0d8d('0x2a')],'sectionId':_0x4745da['id']},{})[_0x0d8d('0x25')](function(){return _0x1113bc;});}else{return _0x1113bc;}})[_0x0d8d('0x44')](function(_0x4ba180){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ba180);throw _0x4ba180;});}return _0x1113bc;});}})[_0x0d8d('0x25')](respondWithResult(_0x2bfada,0xc9))[_0x0d8d('0x44')](handleError(_0x2bfada,null));};exports[_0x0d8d('0x24')]=function(_0x302fc2,_0x2822c7){if(_0x302fc2['body']['id']){delete _0x302fc2[_0x0d8d('0x4a')]['id'];}return db['Campaign'][_0x0d8d('0x4f')]({'where':{'id':_0x302fc2['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x2822c7,null))[_0x0d8d('0x25')](saveUpdates(_0x302fc2[_0x0d8d('0x4a')],null))[_0x0d8d('0x25')](respondWithResult(_0x2822c7,null))[_0x0d8d('0x44')](handleError(_0x2822c7,null));};exports[_0x0d8d('0x28')]=function(_0x77845e,_0x3a3f2f){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0x77845e['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x3a3f2f,null))[_0x0d8d('0x25')](removeEntity(_0x3a3f2f,null))[_0x0d8d('0x44')](handleError(_0x3a3f2f,null));};exports[_0x0d8d('0x59')]=function(_0x574a88,_0x32ba3c,_0x187b05){var _0xd46635={'raw':!![],'where':{}};var _0x28e9d9={};var _0x5ccbc3={'count':0x0,'rows':[]};return db['Campaign'][_0x0d8d('0x5a')]({'where':{'id':_0x574a88['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x32ba3c,null))[_0x0d8d('0x25')](function(_0x28ae7b){if(_0x28ae7b){_0x28e9d9[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x5b')][_0x0d8d('0x53')]);_0x28e9d9[_0x0d8d('0x32')]=_['keys'](_0x574a88[_0x0d8d('0x32')]);_0x28e9d9['filters']=_[_0x0d8d('0x35')](_0x28e9d9[_0x0d8d('0x31')],_0x28e9d9[_0x0d8d('0x32')]);_0xd46635[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x28e9d9['model'],qs[_0x0d8d('0x36')](_0x574a88[_0x0d8d('0x32')]['fields']));_0xd46635[_0x0d8d('0x34')]=_0xd46635[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0xd46635['attributes']:_0x28e9d9[_0x0d8d('0x31')];if(!_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0xd46635['limit']=qs[_0x0d8d('0x1c')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0xd46635['offset']=qs[_0x0d8d('0x1a')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0xd46635[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0xd46635[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0x574a88[_0x0d8d('0x32')],_0x28e9d9['filters']));_0xd46635[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x28ae7b['id'];if(_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0xd46635[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0xd46635['where'],{'$or':_[_0x0d8d('0x2d')](_0xd46635[_0x0d8d('0x34')],function(_0x565c87){var _0x36d28a={};_0x36d28a[_0x565c87]={'$like':'%'+_0x574a88[_0x0d8d('0x32')]['filter']+'%'};return _0x36d28a;})});}_0xd46635=_[_0x0d8d('0x40')]({},_0xd46635,_0x574a88[_0x0d8d('0x41')]);return db[_0x0d8d('0x5b')][_0x0d8d('0x1d')]({'where':_0xd46635[_0x0d8d('0x3e')]})[_0x0d8d('0x25')](function(_0x179741){_0x5ccbc3[_0x0d8d('0x1d')]=_0x179741;if(_0x574a88['query'][_0x0d8d('0x48')]){_0xd46635[_0x0d8d('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0d8d('0x43')](_0xd46635);})['then'](function(_0xc37307){_0x5ccbc3[_0x0d8d('0x5d')]=_0xc37307;return _0x5ccbc3;});}})[_0x0d8d('0x25')](respondWithFilteredResult(_0x32ba3c,_0xd46635))[_0x0d8d('0x44')](handleError(_0x32ba3c,null));};exports['getHopperHistories']=function(_0xf2899d,_0x497bcb,_0x2f4473){var _0x47b719={'raw':!![],'where':{}};var _0xcbcec7={};var _0x35886e={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0xf2899d[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x497bcb,null))[_0x0d8d('0x25')](function(_0xa61073){if(_0xa61073){_0xcbcec7['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0xcbcec7['query']=_[_0x0d8d('0x47')](_0xf2899d['query']);_0xcbcec7[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0xcbcec7['model'],_0xcbcec7[_0x0d8d('0x32')]);_0x47b719['attributes']=_['intersection'](_0xcbcec7['model'],qs[_0x0d8d('0x36')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x47b719['attributes']=_0x47b719[_0x0d8d('0x34')]['length']?_0x47b719[_0x0d8d('0x34')]:_0xcbcec7[_0x0d8d('0x31')];if(!_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x47b719['limit']=qs['limit'](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x47b719['offset']=qs[_0x0d8d('0x1a')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x47b719[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x47b719[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_['pick'](_0xf2899d[_0x0d8d('0x32')],_0xcbcec7['filters']));_0x47b719[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0xa61073['id'];if(_0xf2899d['query'][_0x0d8d('0x3d')]){_0x47b719[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x47b719[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x47b719['attributes'],function(_0x7e2fa1){var _0x43a4dd={};_0x43a4dd[_0x7e2fa1]={'$like':'%'+_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x43a4dd;})});}_0x47b719=_[_0x0d8d('0x40')]({},_0x47b719,_0xf2899d[_0x0d8d('0x41')]);return db[_0x0d8d('0x5e')][_0x0d8d('0x1d')]({'where':_0x47b719['where']})[_0x0d8d('0x25')](function(_0x25b485){_0x35886e[_0x0d8d('0x1d')]=_0x25b485;if(_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x48')]){_0x47b719[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x5e')]['findAll'](_0x47b719);})['then'](function(_0x50bf26){_0x35886e[_0x0d8d('0x5d')]=_0x50bf26;return _0x35886e;});}})['then'](respondWithFilteredResult(_0x497bcb,_0x47b719))[_0x0d8d('0x44')](handleError(_0x497bcb,null));};exports[_0x0d8d('0x5f')]=function(_0xf50d6c,_0x48f451,_0x29efba){var _0x14e2c={'raw':!![],'where':{}};var _0x356192={};var _0x2d3994={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0xf50d6c[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x48f451,null))['then'](function(_0x4b96cf){if(_0x4b96cf){_0x356192[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x60')][_0x0d8d('0x53')]);_0x356192['query']=_[_0x0d8d('0x47')](_0xf50d6c[_0x0d8d('0x32')]);_0x356192[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x356192[_0x0d8d('0x31')],_0x356192[_0x0d8d('0x32')]);_0x14e2c[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x356192[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x14e2c[_0x0d8d('0x34')]=_0x14e2c[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x14e2c[_0x0d8d('0x34')]:_0x356192[_0x0d8d('0x31')];if(!_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x14e2c[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x14e2c[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x14e2c[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0xf50d6c['query']['sort']);_0x14e2c['where']=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0xf50d6c['query'],_0x356192[_0x0d8d('0x33')]));_0x14e2c[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x4b96cf['id'];if(_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x14e2c[_0x0d8d('0x3e')]=_['merge'](_0x14e2c[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x14e2c[_0x0d8d('0x34')],function(_0x2ff75e){var _0x671d02={};_0x671d02[_0x2ff75e]={'$like':'%'+_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x671d02;})});}_0x14e2c=_[_0x0d8d('0x40')]({},_0x14e2c,_0xf50d6c[_0x0d8d('0x41')]);return db[_0x0d8d('0x60')][_0x0d8d('0x1d')]({'where':_0x14e2c[_0x0d8d('0x3e')]})[_0x0d8d('0x25')](function(_0x3caed1){_0x2d3994[_0x0d8d('0x1d')]=_0x3caed1;if(_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x48')]){_0x14e2c[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x60')][_0x0d8d('0x43')](_0x14e2c);})['then'](function(_0x2572b2){_0x2d3994['rows']=_0x2572b2;return _0x2d3994;});}})['then'](respondWithFilteredResult(_0x48f451,_0x14e2c))[_0x0d8d('0x44')](handleError(_0x48f451,null));};exports['getHopperBlacks']=function(_0x855fc3,_0x4d772e,_0x46c756){var _0x32b03a={'raw':!![],'where':{}};var _0xade583={};var _0x1064cd={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')]['findOne']({'where':{'id':_0x855fc3[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x4d772e,null))['then'](function(_0x51c637){if(_0x51c637){_0xade583[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x61')][_0x0d8d('0x53')]);_0xade583['query']=_[_0x0d8d('0x47')](_0x855fc3['query']);_0xade583[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0xade583[_0x0d8d('0x31')],_0xade583['query']);_0x32b03a[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0xade583['model'],qs[_0x0d8d('0x36')](_0x855fc3[_0x0d8d('0x32')]['fields']));_0x32b03a['attributes']=_0x32b03a[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x32b03a[_0x0d8d('0x34')]:_0xade583[_0x0d8d('0x31')];if(!_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x38')]('nolimit')){_0x32b03a[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x32b03a[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x32b03a[_0x0d8d('0x3a')]=qs['sort'](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x32b03a[_0x0d8d('0x3e')]=qs['filters'](_[_0x0d8d('0x3c')](_0x855fc3[_0x0d8d('0x32')],_0xade583[_0x0d8d('0x33')]));_0x32b03a[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x51c637['id'];if(_0x855fc3[_0x0d8d('0x32')]['filter']){_0x32b03a['where']=_[_0x0d8d('0x40')](_0x32b03a[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x32b03a[_0x0d8d('0x34')],function(_0x5ec140){var _0x4ab10f={};_0x4ab10f[_0x5ec140]={'$like':'%'+_0x855fc3['query'][_0x0d8d('0x3d')]+'%'};return _0x4ab10f;})});}_0x32b03a=_[_0x0d8d('0x40')]({},_0x32b03a,_0x855fc3[_0x0d8d('0x41')]);return db['CmHopperBlack']['count']({'where':_0x32b03a['where']})['then'](function(_0x585652){_0x1064cd[_0x0d8d('0x1d')]=_0x585652;if(_0x855fc3['query'][_0x0d8d('0x48')]){_0x32b03a['include']=[{'all':!![]}];}return db[_0x0d8d('0x61')]['findAll'](_0x32b03a);})[_0x0d8d('0x25')](function(_0x333fb5){_0x1064cd['rows']=_0x333fb5;return _0x1064cd;});}})[_0x0d8d('0x25')](respondWithFilteredResult(_0x4d772e,_0x32b03a))[_0x0d8d('0x44')](handleError(_0x4d772e,null));};exports[_0x0d8d('0x62')]=function(_0x161c4f,_0x23f0e1,_0x411eab){var _0x1111ad={};var _0x3ced3e={};var _0x1ed82a;var _0x478c33;return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0x161c4f[_0x0d8d('0x46')]['id']}})['then'](handleEntityNotFound(_0x23f0e1,null))[_0x0d8d('0x25')](function(_0x432049){if(_0x432049){_0x1ed82a=_0x432049;_0x3ced3e[_0x0d8d('0x31')]=_['keys'](db[_0x0d8d('0x63')][_0x0d8d('0x53')]);_0x3ced3e[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x161c4f[_0x0d8d('0x32')]);_0x3ced3e[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x3ced3e[_0x0d8d('0x31')],_0x3ced3e[_0x0d8d('0x32')]);_0x1111ad[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x3ced3e[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0x161c4f['query'][_0x0d8d('0x36')]));_0x1111ad[_0x0d8d('0x34')]=_0x1111ad[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x1111ad[_0x0d8d('0x34')]:_0x3ced3e[_0x0d8d('0x31')];_0x1111ad[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x161c4f['query'][_0x0d8d('0x3b')]);_0x1111ad[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_['pick'](_0x161c4f[_0x0d8d('0x32')],_0x3ced3e['filters']));if(_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x1111ad[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x1111ad['where'],{'$or':_[_0x0d8d('0x2d')](_0x1111ad[_0x0d8d('0x34')],function(_0x5f1f92){var _0x11c4fc={};_0x11c4fc[_0x5f1f92]={'$like':'%'+_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x11c4fc;})});}_0x1111ad=_[_0x0d8d('0x40')]({},_0x1111ad,_0x161c4f['options']);return _0x1ed82a[_0x0d8d('0x62')](_0x1111ad);}})[_0x0d8d('0x25')](function(_0x5d2257){if(_0x5d2257){_0x478c33=_0x5d2257[_0x0d8d('0x37')];if(!_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x1111ad['limit']=qs[_0x0d8d('0x1c')](_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x1111ad[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}return _0x1ed82a[_0x0d8d('0x62')](_0x1111ad);}})[_0x0d8d('0x25')](function(_0x3e9c5a){if(_0x3e9c5a){return _0x3e9c5a?{'count':_0x478c33,'rows':_0x3e9c5a}:null;}})['then'](respondWithResult(_0x23f0e1,null))['catch'](handleError(_0x23f0e1,null));};exports['addLists']=function(_0xcc84de,_0x45392c,_0x4b0934){var _0x31cdbe,_0x1fc834;return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xcc84de[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x45392c,null))[_0x0d8d('0x25')](function(_0x1722cb){if(_0x1722cb){_0x1fc834=_0x1722cb;return _0x1722cb[_0x0d8d('0x64')](_0xcc84de[_0x0d8d('0x4a')][_0x0d8d('0x65')],_[_0x0d8d('0x54')](_0xcc84de[_0x0d8d('0x4a')],[_0x0d8d('0x65'),'id'])||{});}return null;})[_0x0d8d('0x66')](function(_0x39a865){var _0x8b1514;_0x31cdbe=_0x39a865||[];var _0x17d30a=[];if(_0x39a865){for(var _0x1fa1ce=0x0;_0x1fa1ce<_0x39a865['length'];_0x1fa1ce+=0x1){var _0x2d473c=_0x39a865[_0x1fa1ce][_0x0d8d('0x26')]({'plain':!![]});_0x1fc834[_0x0d8d('0x67')]=_0xcc84de[_0x0d8d('0x4a')]['dialCheckDuplicateType']?_0xcc84de[_0x0d8d('0x4a')][_0x0d8d('0x67')]:_0x1fc834[_0x0d8d('0x67')];switch(_0x1fc834[_0x0d8d('0x67')]){case _0x0d8d('0x68'):_0x8b1514=squel['insert']()[_0x0d8d('0x69')](_0x0d8d('0x6a'))[_0x0d8d('0x6b')]([_0x0d8d('0x6c'),'scheduledAt',_0x0d8d('0x6d'),_0x0d8d('0x6e'),_0x0d8d('0x5c'),'createdAt','updatedAt'],squel[_0x0d8d('0x6f')]()['field'](_0x0d8d('0x6c'),_0x0d8d('0x6c'))['field']('NOW()',_0x0d8d('0x70'))[_0x0d8d('0x71')]('id','ContactId')[_0x0d8d('0x71')](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),_0x0d8d('0x6e'))['field'](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))[_0x0d8d('0x3e')](_0x0d8d('0x78'),_0x2d473c[_0x0d8d('0x72')]['toString']())[_0x0d8d('0x3e')](_0x0d8d('0x79'))[_0x0d8d('0x3e')](_0x0d8d('0x7a'),squel['select']()[_0x0d8d('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x0d8d('0x75')](_0x0d8d('0x7b'))['where'](_0x0d8d('0x7c'),_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')]()))[_0x0d8d('0x3e')](_0x0d8d('0x7a'),squel[_0x0d8d('0x6f')]()['field'](_0x0d8d('0x7d'))[_0x0d8d('0x75')](_0x0d8d('0x6a'))[_0x0d8d('0x3e')](_0x0d8d('0x7c'),_0xcc84de['params']['id']['toString']())))[_0x0d8d('0x73')]();break;case _0x0d8d('0x7e'):_0x8b1514=squel[_0x0d8d('0x7f')]()[_0x0d8d('0x69')](_0x0d8d('0x6a'))[_0x0d8d('0x6b')]([_0x0d8d('0x6c'),'scheduledAt','ContactId','ListId',_0x0d8d('0x5c'),_0x0d8d('0x55'),_0x0d8d('0x56')],squel[_0x0d8d('0x6f')]()[_0x0d8d('0x71')](_0x0d8d('0x6c'),'phone')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x70'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))['field'](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),_0x0d8d('0x6e'))[_0x0d8d('0x71')](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')]('NOW()','createdAt')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))['where'](_0x0d8d('0x78'),_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')]())['where'](_0x0d8d('0x79'))['where'](_0x0d8d('0x7a'),squel['select']()[_0x0d8d('0x71')](_0x0d8d('0x7d'))['from'](_0x0d8d('0x6a'))['where'](_0x0d8d('0x7c'),_0xcc84de['params']['id']['toString']())))['toString']();break;default:_0x8b1514=squel['insert']()['into'](_0x0d8d('0x6a'))[_0x0d8d('0x6b')](['phone',_0x0d8d('0x70'),_0x0d8d('0x6d'),_0x0d8d('0x6e'),'CampaignId',_0x0d8d('0x55'),_0x0d8d('0x56')],squel['select']()[_0x0d8d('0x71')]('phone','phone')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x70'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))['field'](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),'ListId')[_0x0d8d('0x71')](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),'updatedAt')[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))[_0x0d8d('0x3e')]('ListId\x20=\x20?',_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')]())[_0x0d8d('0x3e')](_0x0d8d('0x79')))['toString']();}_0x17d30a['push'](db[_0x0d8d('0x80')][_0x0d8d('0x32')](_0x8b1514));}return BPromise[_0x0d8d('0x81')](_0x17d30a);}})['then'](function(){return _0x31cdbe;})[_0x0d8d('0x25')](respondWithResult(_0x45392c,null))['catch'](handleError(_0x45392c,null));};exports[_0x0d8d('0x82')]=function(_0x2e453e,_0x357e32,_0x3bcb31){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0x2e453e[_0x0d8d('0x46')]['id']}})['then'](handleEntityNotFound(_0x357e32,null))[_0x0d8d('0x25')](function(_0x1b1564){if(_0x1b1564){return _0x1b1564[_0x0d8d('0x82')](_0x2e453e[_0x0d8d('0x32')][_0x0d8d('0x65')]);}})[_0x0d8d('0x25')](function(_0x328fb1){if(_0x328fb1){return db['CmHopper'][_0x0d8d('0x28')]({'where':{'ListId':_0x2e453e['query'][_0x0d8d('0x65')],'CampaignId':_0x2e453e[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](function(){return _0x328fb1;});}})[_0x0d8d('0x25')](respondWithStatusCode(_0x357e32,null))[_0x0d8d('0x44')](handleError(_0x357e32,null));};exports['getBlackLists']=function(_0x52d9a6,_0x602a8d,_0x347cf6){var _0x1abddb={};var _0x24fa1e={};var _0x79b4d4;var _0x89e5f7;return db['Campaign'][_0x0d8d('0x5a')]({'where':{'id':_0x52d9a6[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x602a8d,null))[_0x0d8d('0x25')](function(_0x2a079b){if(_0x2a079b){_0x79b4d4=_0x2a079b;_0x24fa1e[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x63')][_0x0d8d('0x53')]);_0x24fa1e[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x52d9a6[_0x0d8d('0x32')]);_0x24fa1e[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x24fa1e['model'],_0x24fa1e[_0x0d8d('0x32')]);_0x1abddb[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x24fa1e['model'],qs['fields'](_0x52d9a6[_0x0d8d('0x32')]['fields']));_0x1abddb['attributes']=_0x1abddb[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x1abddb[_0x0d8d('0x34')]:_0x24fa1e[_0x0d8d('0x31')];_0x1abddb['order']=qs[_0x0d8d('0x3b')](_0x52d9a6[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x1abddb[_0x0d8d('0x3e')]=qs['filters'](_['pick'](_0x52d9a6['query'],_0x24fa1e[_0x0d8d('0x33')]));if(_0x52d9a6[_0x0d8d('0x32')]['filter']){_0x1abddb[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x1abddb[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x1abddb[_0x0d8d('0x34')],function(_0x3182bb){var _0x396564={};_0x396564[_0x3182bb]={'$like':'%'+_0x52d9a6[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x396564;})});}_0x1abddb=_[_0x0d8d('0x40')]({},_0x1abddb,_0x52d9a6['options']);return _0x79b4d4['getBlackLists'](_0x1abddb);}})['then'](function(_0x1524cd){if(_0x1524cd){_0x89e5f7=_0x1524cd['length'];if(!_0x52d9a6[_0x0d8d('0x32')]['hasOwnProperty'](_0x0d8d('0x39'))){_0x1abddb[_0x0d8d('0x1c')]=qs['limit'](_0x52d9a6['query'][_0x0d8d('0x1c')]);_0x1abddb[_0x0d8d('0x1a')]=qs['offset'](_0x52d9a6['query']['offset']);}return _0x79b4d4[_0x0d8d('0x83')](_0x1abddb);}})['then'](function(_0x21d3fd){if(_0x21d3fd){return _0x21d3fd?{'count':_0x89e5f7,'rows':_0x21d3fd}:null;}})['then'](respondWithResult(_0x602a8d,null))[_0x0d8d('0x44')](handleError(_0x602a8d,null));};exports['addBlackLists']=function(_0xa9dd3f,_0x7fd298,_0x17db23){var _0x5f5e0a,_0x1dcf0e;return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xa9dd3f[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x7fd298,null))[_0x0d8d('0x25')](function(_0x4ccf74){if(_0x4ccf74){_0x1dcf0e=_0x4ccf74;return _0x4ccf74['addBlackLists'](_0xa9dd3f['body']['ids'],_[_0x0d8d('0x54')](_0xa9dd3f[_0x0d8d('0x4a')],[_0x0d8d('0x65'),'id'])||{});}return null;})['spread'](function(_0x524774){var _0x33521d;_0x5f5e0a=_0x524774||[];var _0x5c2add=[];if(_0x524774){for(var _0x16d123=0x0;_0x16d123<_0x524774[_0x0d8d('0x37')];_0x16d123+=0x1){var _0x188a1e=_0x524774[_0x16d123]['get']({'plain':!![]});_0x33521d=squel[_0x0d8d('0x7f')]()[_0x0d8d('0x69')](_0x0d8d('0x84'))['fromQuery']([_0x0d8d('0x6c'),_0x0d8d('0x6d'),_0x0d8d('0x6e'),'CampaignId','createdAt',_0x0d8d('0x56')],squel[_0x0d8d('0x6f')]()[_0x0d8d('0x71')]('phone',_0x0d8d('0x6c'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))[_0x0d8d('0x71')](_0x188a1e['CmListId'][_0x0d8d('0x73')](),_0x0d8d('0x6e'))[_0x0d8d('0x71')](_0xa9dd3f[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')]('NOW()',_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))['from'](_0x0d8d('0x76'))[_0x0d8d('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0d8d('0x3e')](_0x0d8d('0x78'),_0x188a1e[_0x0d8d('0x72')][_0x0d8d('0x73')]())[_0x0d8d('0x3e')](_0x0d8d('0x79')))['toString']();_0x5c2add['push'](db[_0x0d8d('0x80')][_0x0d8d('0x32')](_0x33521d));}return BPromise[_0x0d8d('0x81')](_0x5c2add);}})[_0x0d8d('0x25')](function(){return _0x5f5e0a;})[_0x0d8d('0x25')](respondWithResult(_0x7fd298,null))['catch'](handleError(_0x7fd298,null));};exports[_0x0d8d('0x85')]=function(_0xaba573,_0x48eaac,_0x1dfb48){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xaba573['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x48eaac,null))[_0x0d8d('0x25')](function(_0x480f5a){if(_0x480f5a){return _0x480f5a['removeBlackLists'](_0xaba573['query']['ids']);}})[_0x0d8d('0x25')](function(_0x4b34c8){if(_0x4b34c8){return db[_0x0d8d('0x61')][_0x0d8d('0x28')]({'where':{'ListId':_0xaba573[_0x0d8d('0x32')][_0x0d8d('0x65')],'CampaignId':_0xaba573[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](function(){return _0x4b34c8;});}})[_0x0d8d('0x25')](respondWithStatusCode(_0x48eaac,null))['catch'](handleError(_0x48eaac,null));}; \ No newline at end of file +var _0x084a=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','Campaign','findAll','rows','catch','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','body','createdAt','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','scheduledAt','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','fieldName','type','key','model','keys','query'];(function(_0x5849ff,_0x535d62){var _0xde61a2=function(_0x399749){while(--_0x399749){_0x5849ff['push'](_0x5849ff['shift']());}};_0xde61a2(++_0x535d62);}(_0x084a,0xde));var _0xa084=function(_0x35069b,_0x30f989){_0x35069b=_0x35069b-0x0;var _0x4ead49=_0x084a[_0x35069b];return _0x4ead49;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa084('0x0'));var jsonpatch=require(_0xa084('0x1'));var rp=require(_0xa084('0x2'));var moment=require('moment');var BPromise=require(_0xa084('0x3'));var Mustache=require(_0xa084('0x4'));var util=require('util');var path=require(_0xa084('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa084('0x6'));var fs=require('fs');var fs_extra=require(_0xa084('0x7'));var _=require(_0xa084('0x8'));var squel=require(_0xa084('0x9'));var crypto=require(_0xa084('0xa'));var jsforce=require(_0xa084('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa084('0xc'));var Papa=require('papaparse');var Redis=require(_0xa084('0xd'));var authService=require(_0xa084('0xe'));var qs=require(_0xa084('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa084('0x10'));var logger=require(_0xa084('0x11'))(_0xa084('0x12'));var utils=require(_0xa084('0x13'));var config=require(_0xa084('0x14'));var licenseUtil=require(_0xa084('0x15'));var db=require(_0xa084('0x16'))['db'];function respondWithStatusCode(_0x3423cf,_0x152e8a){_0x152e8a=_0x152e8a||0xcc;return function(_0x3eef38){if(_0x3eef38){return _0x3423cf[_0xa084('0x17')](_0x152e8a);}return _0x3423cf[_0xa084('0x18')](_0x152e8a)['end']();};}function respondWithResult(_0x272c62,_0x1e789c){_0x1e789c=_0x1e789c||0xc8;return function(_0x585073){if(_0x585073){return _0x272c62[_0xa084('0x18')](_0x1e789c)[_0xa084('0x19')](_0x585073);}};}function respondWithFilteredResult(_0x1c0874,_0x5eb327){return function(_0x48ff9c){if(_0x48ff9c){var _0x152da1=typeof _0x5eb327[_0xa084('0x1a')]===_0xa084('0x1b')&&typeof _0x5eb327['limit']===_0xa084('0x1b');var _0x38acdc=_0x48ff9c[_0xa084('0x1c')];var _0x4fa92=_0x152da1?0x0:_0x5eb327['offset'];var _0xf1b3e9=_0x152da1?_0x48ff9c['count']:_0x5eb327[_0xa084('0x1a')]+_0x5eb327[_0xa084('0x1d')];var _0x5266aa;if(_0xf1b3e9>=_0x38acdc){_0xf1b3e9=_0x38acdc;_0x5266aa=0xc8;}else{_0x5266aa=0xce;}_0x1c0874[_0xa084('0x18')](_0x5266aa);return _0x1c0874[_0xa084('0x1e')](_0xa084('0x1f'),_0x4fa92+'-'+_0xf1b3e9+'/'+_0x38acdc)['json'](_0x48ff9c);}return null;};}function patchUpdates(_0x141e8a){return function(_0x4d243e){try{jsonpatch[_0xa084('0x20')](_0x4d243e,_0x141e8a,!![]);}catch(_0x3aaf94){return BPromise[_0xa084('0x21')](_0x3aaf94);}return _0x4d243e[_0xa084('0x22')]();};}function saveUpdates(_0x424418,_0x45c096){return function(_0x48ec77){if(_0x48ec77){return _0x48ec77[_0xa084('0x23')](_0x424418)[_0xa084('0x24')](function(_0x17efe5){return _0x17efe5;});}return null;};}function removeEntity(_0x14eb5a,_0x1ca95f){return function(_0x16432d){if(_0x16432d){return _0x16432d[_0xa084('0x25')]()[_0xa084('0x24')](function(){var _0x24c868=_0x16432d[_0xa084('0x26')]({'plain':!![]});var _0x7b87d1=_0xa084('0x27');return db[_0xa084('0x28')]['destroy']({'where':{'type':_0x7b87d1,'resourceId':_0x24c868['id']}})[_0xa084('0x24')](function(){return _0x16432d;});})[_0xa084('0x24')](function(){_0x14eb5a[_0xa084('0x18')](0xcc)[_0xa084('0x29')]();});}};}function handleEntityNotFound(_0x5bea1a,_0x1d9942){return function(_0x2231b4){if(!_0x2231b4){_0x5bea1a[_0xa084('0x17')](0x194);}return _0x2231b4;};}function handleError(_0x11b30a,_0x1c7f53){_0x1c7f53=_0x1c7f53||0x1f4;return function(_0x228f17){logger[_0xa084('0x2a')](_0x228f17[_0xa084('0x2b')]);if(_0x228f17[_0xa084('0x2c')]){delete _0x228f17[_0xa084('0x2c')];}_0x11b30a[_0xa084('0x18')](_0x1c7f53)[_0xa084('0x2d')](_0x228f17);};}exports[_0xa084('0x2e')]=function(_0x316cf9,_0x9a9b23){var _0x75b032={},_0x168218={},_0x50299b={'count':0x0,'rows':[]};var _0xfe26ab=_[_0xa084('0x2f')](db['Campaign']['rawAttributes'],function(_0x31ea35){return{'name':_0x31ea35[_0xa084('0x30')],'type':_0x31ea35[_0xa084('0x31')][_0xa084('0x32')]};});_0x168218[_0xa084('0x33')]=_[_0xa084('0x2f')](_0xfe26ab,_0xa084('0x2c'));_0x168218['query']=_[_0xa084('0x34')](_0x316cf9[_0xa084('0x35')]);_0x168218[_0xa084('0x36')]=_['intersection'](_0x168218['model'],_0x168218['query']);_0x75b032[_0xa084('0x37')]=_[_0xa084('0x38')](_0x168218[_0xa084('0x33')],qs[_0xa084('0x39')](_0x316cf9['query'][_0xa084('0x39')]));_0x75b032[_0xa084('0x37')]=_0x75b032[_0xa084('0x37')][_0xa084('0x3a')]?_0x75b032[_0xa084('0x37')]:_0x168218['model'];if(!_0x316cf9[_0xa084('0x35')][_0xa084('0x3b')](_0xa084('0x3c'))){_0x75b032['limit']=qs[_0xa084('0x1d')](_0x316cf9[_0xa084('0x35')][_0xa084('0x1d')]);_0x75b032[_0xa084('0x1a')]=qs[_0xa084('0x1a')](_0x316cf9[_0xa084('0x35')][_0xa084('0x1a')]);}_0x75b032[_0xa084('0x3d')]=qs[_0xa084('0x3e')](_0x316cf9['query'][_0xa084('0x3e')]);_0x75b032[_0xa084('0x3f')]=qs[_0xa084('0x36')](_[_0xa084('0x40')](_0x316cf9[_0xa084('0x35')],_0x168218[_0xa084('0x36')]),_0xfe26ab);if(_0x316cf9[_0xa084('0x35')][_0xa084('0x41')]){_0x75b032['where']=_['merge'](_0x75b032[_0xa084('0x3f')],{'$or':_[_0xa084('0x2f')](_0xfe26ab,function(_0x5a504c){if(_0x5a504c[_0xa084('0x31')]!=='VIRTUAL'){var _0x4e3212={};_0x4e3212[_0x5a504c[_0xa084('0x2c')]]={'$like':'%'+_0x316cf9[_0xa084('0x35')][_0xa084('0x41')]+'%'};return _0x4e3212;}})});}_0x75b032=_[_0xa084('0x42')]({},_0x75b032,_0x316cf9[_0xa084('0x43')]);var _0x4b9129={'where':_0x75b032['where']};return db['Campaign']['count'](_0x4b9129)['then'](function(_0x2dc0bb){_0x50299b['count']=_0x2dc0bb;if(_0x316cf9[_0xa084('0x35')][_0xa084('0x44')]){_0x75b032[_0xa084('0x45')]=[{'all':!![]}];}return db[_0xa084('0x46')][_0xa084('0x47')](_0x75b032);})[_0xa084('0x24')](function(_0x2e2cbd){_0x50299b[_0xa084('0x48')]=_0x2e2cbd;return _0x50299b;})[_0xa084('0x24')](respondWithFilteredResult(_0x9a9b23,_0x75b032))[_0xa084('0x49')](handleError(_0x9a9b23,null));};exports['show']=function(_0x305d4d,_0x42395d){var _0x3a1103={'raw':![],'where':{'id':_0x305d4d['params']['id']}},_0x360d95={};_0x360d95[_0xa084('0x33')]=_[_0xa084('0x34')](db[_0xa084('0x46')][_0xa084('0x4a')]);_0x360d95[_0xa084('0x35')]=_[_0xa084('0x34')](_0x305d4d[_0xa084('0x35')]);_0x360d95[_0xa084('0x36')]=_[_0xa084('0x38')](_0x360d95['model'],_0x360d95[_0xa084('0x35')]);_0x3a1103[_0xa084('0x37')]=_[_0xa084('0x38')](_0x360d95['model'],qs[_0xa084('0x39')](_0x305d4d[_0xa084('0x35')][_0xa084('0x39')]));_0x3a1103[_0xa084('0x37')]=_0x3a1103['attributes']['length']?_0x3a1103[_0xa084('0x37')]:_0x360d95[_0xa084('0x33')];if(_0x305d4d[_0xa084('0x35')]['includeAll']){_0x3a1103[_0xa084('0x45')]=[{'all':!![]}];}_0x3a1103=_[_0xa084('0x42')]({},_0x3a1103,_0x305d4d['options']);return db[_0xa084('0x46')][_0xa084('0x4b')](_0x3a1103)['then'](handleEntityNotFound(_0x42395d,null))[_0xa084('0x24')](respondWithResult(_0x42395d,null))[_0xa084('0x49')](handleError(_0x42395d,null));};exports['create']=function(_0xeba23f,_0x1498f0){return db['Campaign'][_0xa084('0x4c')](_0xeba23f['body'],{})[_0xa084('0x24')](function(_0x425659){var _0x47006d=_0xeba23f['user']['get']({'plain':!![]});if(!_0x47006d)throw new Error(_0xa084('0x4d'));if(_0x47006d[_0xa084('0x4e')]===_0xa084('0x4f')){var _0x3a89cf=_0x425659[_0xa084('0x26')]({'plain':!![]});var _0x406146=_0xa084('0x27');return db[_0xa084('0x50')]['find']({'where':{'name':_0x406146,'userProfileId':_0x47006d[_0xa084('0x51')]},'raw':!![]})[_0xa084('0x24')](function(_0x39addf){if(_0x39addf&&_0x39addf[_0xa084('0x52')]===0x0){return db[_0xa084('0x28')]['create']({'name':_0x3a89cf['name'],'resourceId':_0x3a89cf['id'],'type':_0x39addf[_0xa084('0x2c')],'sectionId':_0x39addf['id']},{})[_0xa084('0x24')](function(){return _0x425659;});}else{return _0x425659;}})['catch'](function(_0x3dbebd){logger[_0xa084('0x2a')](_0xa084('0x53'),_0x3dbebd);throw _0x3dbebd;});}return _0x425659;})[_0xa084('0x24')](respondWithResult(_0x1498f0,0xc9))[_0xa084('0x49')](handleError(_0x1498f0,null));};exports[_0xa084('0x54')]=function(_0x26b348,_0x3d3d0f){var _0x4c5b9b={'where':{'id':_0x26b348[_0xa084('0x55')]['id']}},_0x460f04={};_0x460f04['model']=_[_0xa084('0x34')](db[_0xa084('0x46')][_0xa084('0x4a')]);_0x4c5b9b[_0xa084('0x37')]=_[_0xa084('0x38')](_0x460f04[_0xa084('0x33')],qs[_0xa084('0x39')](_0x26b348[_0xa084('0x35')][_0xa084('0x39')]));_0x4c5b9b[_0xa084('0x37')]=_0x4c5b9b[_0xa084('0x37')][_0xa084('0x3a')]?_0x4c5b9b[_0xa084('0x37')]:_0x460f04[_0xa084('0x33')];if(_0x26b348[_0xa084('0x35')][_0xa084('0x44')]){_0x4c5b9b[_0xa084('0x45')]=[{'all':!![]}];}_0x4c5b9b=_[_0xa084('0x42')]({},_0x4c5b9b,_0x26b348[_0xa084('0x43')]);return db[_0xa084('0x46')][_0xa084('0x4b')](_0x4c5b9b)['then'](handleEntityNotFound(_0x3d3d0f,null))[_0xa084('0x24')](function(_0x2b2f11){if(_0x2b2f11){var _0xa8dd28=_0x2b2f11[_0xa084('0x26')]({'plain':!![]});_0xa8dd28=qs[_0xa084('0x56')](_0xa8dd28,['id','createdAt',_0xa084('0x57')]);_0x26b348['body']=_[_0xa084('0x56')](_0x26b348[_0xa084('0x58')],['id',_0xa084('0x59'),_0xa084('0x57')]);return db['Campaign']['create'](_[_0xa084('0x42')](_0xa8dd28,_0x26b348[_0xa084('0x58')]),{'include':_0x26b348[_0xa084('0x35')][_0xa084('0x44')]?[{'all':!![]}]:undefined})[_0xa084('0x24')](function(_0x1c6737){var _0x46fea4=_0x26b348['user'][_0xa084('0x26')]({'plain':!![]});if(!_0x46fea4)throw new Error(_0xa084('0x4d'));if(_0x46fea4[_0xa084('0x4e')]==='user'){var _0x2dba53=_0x1c6737[_0xa084('0x26')]({'plain':!![]});var _0x33d034=_0xa084('0x27');return db[_0xa084('0x50')][_0xa084('0x4b')]({'where':{'name':_0x33d034,'userProfileId':_0x46fea4['userProfileId']},'raw':!![]})[_0xa084('0x24')](function(_0x321acc){if(_0x321acc&&_0x321acc[_0xa084('0x52')]===0x0){return db[_0xa084('0x28')]['create']({'name':_0x2dba53[_0xa084('0x2c')],'resourceId':_0x2dba53['id'],'type':_0x321acc['name'],'sectionId':_0x321acc['id']},{})['then'](function(){return _0x1c6737;});}else{return _0x1c6737;}})[_0xa084('0x49')](function(_0x2e4a25){logger[_0xa084('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e4a25);throw _0x2e4a25;});}return _0x1c6737;});}})[_0xa084('0x24')](respondWithResult(_0x3d3d0f,0xc9))[_0xa084('0x49')](handleError(_0x3d3d0f,null));};exports['update']=function(_0x2f7979,_0x43efd9){if(_0x2f7979[_0xa084('0x58')]['id']){delete _0x2f7979[_0xa084('0x58')]['id'];}return db['Campaign'][_0xa084('0x4b')]({'where':{'id':_0x2f7979['params']['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x43efd9,null))[_0xa084('0x24')](saveUpdates(_0x2f7979[_0xa084('0x58')],null))[_0xa084('0x24')](respondWithResult(_0x43efd9,null))[_0xa084('0x49')](handleError(_0x43efd9,null));};exports[_0xa084('0x25')]=function(_0x2cb22b,_0x56179c){return db['Campaign'][_0xa084('0x4b')]({'where':{'id':_0x2cb22b[_0xa084('0x55')]['id']}})['then'](handleEntityNotFound(_0x56179c,null))['then'](removeEntity(_0x56179c,null))['catch'](handleError(_0x56179c,null));};exports[_0xa084('0x5a')]=function(_0x10c937,_0xfc29f3,_0xbba817){var _0x6bf83a={'raw':!![],'where':{}};var _0x42c44c={};var _0x3e8f77={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x10c937[_0xa084('0x55')]['id']}})[_0xa084('0x24')](handleEntityNotFound(_0xfc29f3,null))[_0xa084('0x24')](function(_0x18b0c2){if(_0x18b0c2){_0x42c44c[_0xa084('0x33')]=_[_0xa084('0x34')](db[_0xa084('0x5b')][_0xa084('0x4a')]);_0x42c44c[_0xa084('0x35')]=_[_0xa084('0x34')](_0x10c937[_0xa084('0x35')]);_0x42c44c[_0xa084('0x36')]=_[_0xa084('0x38')](_0x42c44c['model'],_0x42c44c['query']);_0x6bf83a[_0xa084('0x37')]=_['intersection'](_0x42c44c[_0xa084('0x33')],qs[_0xa084('0x39')](_0x10c937[_0xa084('0x35')][_0xa084('0x39')]));_0x6bf83a['attributes']=_0x6bf83a[_0xa084('0x37')][_0xa084('0x3a')]?_0x6bf83a[_0xa084('0x37')]:_0x42c44c['model'];if(!_0x10c937[_0xa084('0x35')]['hasOwnProperty']('nolimit')){_0x6bf83a[_0xa084('0x1d')]=qs[_0xa084('0x1d')](_0x10c937['query'][_0xa084('0x1d')]);_0x6bf83a[_0xa084('0x1a')]=qs[_0xa084('0x1a')](_0x10c937[_0xa084('0x35')]['offset']);}_0x6bf83a[_0xa084('0x3d')]=qs[_0xa084('0x3e')](_0x10c937[_0xa084('0x35')]['sort']);_0x6bf83a[_0xa084('0x3f')]=qs['filters'](_[_0xa084('0x40')](_0x10c937[_0xa084('0x35')],_0x42c44c[_0xa084('0x36')]));_0x6bf83a[_0xa084('0x3f')][_0xa084('0x5c')]=_0x18b0c2['id'];if(_0x10c937['query'][_0xa084('0x41')]){_0x6bf83a[_0xa084('0x3f')]=_[_0xa084('0x42')](_0x6bf83a[_0xa084('0x3f')],{'$or':_[_0xa084('0x2f')](_0x6bf83a[_0xa084('0x37')],function(_0x287cb7){var _0x32bfe5={};_0x32bfe5[_0x287cb7]={'$like':'%'+_0x10c937[_0xa084('0x35')][_0xa084('0x41')]+'%'};return _0x32bfe5;})});}_0x6bf83a=_[_0xa084('0x42')]({},_0x6bf83a,_0x10c937[_0xa084('0x43')]);return db[_0xa084('0x5b')][_0xa084('0x1c')]({'where':_0x6bf83a[_0xa084('0x3f')]})[_0xa084('0x24')](function(_0x1d1959){_0x3e8f77['count']=_0x1d1959;if(_0x10c937['query'][_0xa084('0x44')]){_0x6bf83a['include']=[{'all':!![]}];}return db[_0xa084('0x5b')][_0xa084('0x47')](_0x6bf83a);})[_0xa084('0x24')](function(_0x3dd27c){_0x3e8f77[_0xa084('0x48')]=_0x3dd27c;return _0x3e8f77;});}})[_0xa084('0x24')](respondWithFilteredResult(_0xfc29f3,_0x6bf83a))[_0xa084('0x49')](handleError(_0xfc29f3,null));};exports[_0xa084('0x5d')]=function(_0x4714ee,_0x5073dd,_0x370edd){var _0x384e9b={'raw':!![],'where':{}};var _0x33ae6d={};var _0x11231b={'count':0x0,'rows':[]};return db[_0xa084('0x46')][_0xa084('0x5e')]({'where':{'id':_0x4714ee['params']['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x5073dd,null))[_0xa084('0x24')](function(_0x43ec68){if(_0x43ec68){_0x33ae6d[_0xa084('0x33')]=_[_0xa084('0x34')](db[_0xa084('0x5f')]['rawAttributes']);_0x33ae6d[_0xa084('0x35')]=_[_0xa084('0x34')](_0x4714ee[_0xa084('0x35')]);_0x33ae6d[_0xa084('0x36')]=_[_0xa084('0x38')](_0x33ae6d[_0xa084('0x33')],_0x33ae6d[_0xa084('0x35')]);_0x384e9b[_0xa084('0x37')]=_[_0xa084('0x38')](_0x33ae6d['model'],qs[_0xa084('0x39')](_0x4714ee[_0xa084('0x35')][_0xa084('0x39')]));_0x384e9b[_0xa084('0x37')]=_0x384e9b[_0xa084('0x37')][_0xa084('0x3a')]?_0x384e9b[_0xa084('0x37')]:_0x33ae6d[_0xa084('0x33')];if(!_0x4714ee['query']['hasOwnProperty'](_0xa084('0x3c'))){_0x384e9b[_0xa084('0x1d')]=qs[_0xa084('0x1d')](_0x4714ee[_0xa084('0x35')][_0xa084('0x1d')]);_0x384e9b['offset']=qs[_0xa084('0x1a')](_0x4714ee[_0xa084('0x35')][_0xa084('0x1a')]);}_0x384e9b[_0xa084('0x3d')]=qs[_0xa084('0x3e')](_0x4714ee[_0xa084('0x35')][_0xa084('0x3e')]);_0x384e9b[_0xa084('0x3f')]=qs[_0xa084('0x36')](_[_0xa084('0x40')](_0x4714ee['query'],_0x33ae6d[_0xa084('0x36')]));_0x384e9b['where'][_0xa084('0x5c')]=_0x43ec68['id'];if(_0x4714ee[_0xa084('0x35')][_0xa084('0x41')]){_0x384e9b['where']=_[_0xa084('0x42')](_0x384e9b['where'],{'$or':_[_0xa084('0x2f')](_0x384e9b[_0xa084('0x37')],function(_0x5a8506){var _0x1f37ca={};_0x1f37ca[_0x5a8506]={'$like':'%'+_0x4714ee[_0xa084('0x35')]['filter']+'%'};return _0x1f37ca;})});}_0x384e9b=_[_0xa084('0x42')]({},_0x384e9b,_0x4714ee[_0xa084('0x43')]);return db[_0xa084('0x5f')]['count']({'where':_0x384e9b[_0xa084('0x3f')]})[_0xa084('0x24')](function(_0x43cfb0){_0x11231b[_0xa084('0x1c')]=_0x43cfb0;if(_0x4714ee['query'][_0xa084('0x44')]){_0x384e9b[_0xa084('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa084('0x47')](_0x384e9b);})[_0xa084('0x24')](function(_0x1af0d5){_0x11231b[_0xa084('0x48')]=_0x1af0d5;return _0x11231b;});}})['then'](respondWithFilteredResult(_0x5073dd,_0x384e9b))[_0xa084('0x49')](handleError(_0x5073dd,null));};exports[_0xa084('0x60')]=function(_0x2ba3f9,_0x160dd5,_0x5d9d32){var _0x3269b0={'raw':!![],'where':{}};var _0x2006a7={};var _0x2568af={'count':0x0,'rows':[]};return db[_0xa084('0x46')][_0xa084('0x5e')]({'where':{'id':_0x2ba3f9['params']['id']}})['then'](handleEntityNotFound(_0x160dd5,null))['then'](function(_0x477025){if(_0x477025){_0x2006a7[_0xa084('0x33')]=_['keys'](db[_0xa084('0x61')][_0xa084('0x4a')]);_0x2006a7['query']=_[_0xa084('0x34')](_0x2ba3f9['query']);_0x2006a7[_0xa084('0x36')]=_['intersection'](_0x2006a7[_0xa084('0x33')],_0x2006a7[_0xa084('0x35')]);_0x3269b0[_0xa084('0x37')]=_[_0xa084('0x38')](_0x2006a7['model'],qs[_0xa084('0x39')](_0x2ba3f9[_0xa084('0x35')][_0xa084('0x39')]));_0x3269b0[_0xa084('0x37')]=_0x3269b0[_0xa084('0x37')][_0xa084('0x3a')]?_0x3269b0['attributes']:_0x2006a7['model'];if(!_0x2ba3f9[_0xa084('0x35')][_0xa084('0x3b')]('nolimit')){_0x3269b0[_0xa084('0x1d')]=qs[_0xa084('0x1d')](_0x2ba3f9['query'][_0xa084('0x1d')]);_0x3269b0[_0xa084('0x1a')]=qs['offset'](_0x2ba3f9[_0xa084('0x35')]['offset']);}_0x3269b0[_0xa084('0x3d')]=qs['sort'](_0x2ba3f9[_0xa084('0x35')][_0xa084('0x3e')]);_0x3269b0[_0xa084('0x3f')]=qs[_0xa084('0x36')](_[_0xa084('0x40')](_0x2ba3f9['query'],_0x2006a7[_0xa084('0x36')]));_0x3269b0['where'][_0xa084('0x5c')]=_0x477025['id'];if(_0x2ba3f9[_0xa084('0x35')][_0xa084('0x41')]){_0x3269b0[_0xa084('0x3f')]=_[_0xa084('0x42')](_0x3269b0['where'],{'$or':_[_0xa084('0x2f')](_0x3269b0[_0xa084('0x37')],function(_0x410ee8){var _0x3914e8={};_0x3914e8[_0x410ee8]={'$like':'%'+_0x2ba3f9[_0xa084('0x35')][_0xa084('0x41')]+'%'};return _0x3914e8;})});}_0x3269b0=_[_0xa084('0x42')]({},_0x3269b0,_0x2ba3f9[_0xa084('0x43')]);return db['CmHopperFinal'][_0xa084('0x1c')]({'where':_0x3269b0['where']})[_0xa084('0x24')](function(_0x41d21d){_0x2568af[_0xa084('0x1c')]=_0x41d21d;if(_0x2ba3f9[_0xa084('0x35')][_0xa084('0x44')]){_0x3269b0[_0xa084('0x45')]=[{'all':!![]}];}return db[_0xa084('0x61')][_0xa084('0x47')](_0x3269b0);})[_0xa084('0x24')](function(_0x4bd849){_0x2568af[_0xa084('0x48')]=_0x4bd849;return _0x2568af;});}})[_0xa084('0x24')](respondWithFilteredResult(_0x160dd5,_0x3269b0))['catch'](handleError(_0x160dd5,null));};exports[_0xa084('0x62')]=function(_0x41de15,_0x112ed7,_0x11f942){var _0x4da827={'raw':!![],'where':{}};var _0x424e9b={};var _0x23ff1c={'count':0x0,'rows':[]};return db[_0xa084('0x46')][_0xa084('0x5e')]({'where':{'id':_0x41de15[_0xa084('0x55')]['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x112ed7,null))[_0xa084('0x24')](function(_0x7eeda4){if(_0x7eeda4){_0x424e9b[_0xa084('0x33')]=_[_0xa084('0x34')](db[_0xa084('0x63')]['rawAttributes']);_0x424e9b['query']=_[_0xa084('0x34')](_0x41de15[_0xa084('0x35')]);_0x424e9b['filters']=_[_0xa084('0x38')](_0x424e9b[_0xa084('0x33')],_0x424e9b[_0xa084('0x35')]);_0x4da827['attributes']=_[_0xa084('0x38')](_0x424e9b['model'],qs['fields'](_0x41de15[_0xa084('0x35')][_0xa084('0x39')]));_0x4da827['attributes']=_0x4da827[_0xa084('0x37')][_0xa084('0x3a')]?_0x4da827[_0xa084('0x37')]:_0x424e9b[_0xa084('0x33')];if(!_0x41de15[_0xa084('0x35')][_0xa084('0x3b')](_0xa084('0x3c'))){_0x4da827[_0xa084('0x1d')]=qs[_0xa084('0x1d')](_0x41de15['query'][_0xa084('0x1d')]);_0x4da827[_0xa084('0x1a')]=qs['offset'](_0x41de15['query'][_0xa084('0x1a')]);}_0x4da827[_0xa084('0x3d')]=qs[_0xa084('0x3e')](_0x41de15[_0xa084('0x35')]['sort']);_0x4da827[_0xa084('0x3f')]=qs['filters'](_[_0xa084('0x40')](_0x41de15[_0xa084('0x35')],_0x424e9b['filters']));_0x4da827[_0xa084('0x3f')][_0xa084('0x5c')]=_0x7eeda4['id'];if(_0x41de15['query'][_0xa084('0x41')]){_0x4da827[_0xa084('0x3f')]=_['merge'](_0x4da827[_0xa084('0x3f')],{'$or':_[_0xa084('0x2f')](_0x4da827['attributes'],function(_0x118ac8){var _0x340180={};_0x340180[_0x118ac8]={'$like':'%'+_0x41de15[_0xa084('0x35')]['filter']+'%'};return _0x340180;})});}_0x4da827=_[_0xa084('0x42')]({},_0x4da827,_0x41de15[_0xa084('0x43')]);return db[_0xa084('0x63')][_0xa084('0x1c')]({'where':_0x4da827['where']})[_0xa084('0x24')](function(_0x226e76){_0x23ff1c[_0xa084('0x1c')]=_0x226e76;if(_0x41de15['query'][_0xa084('0x44')]){_0x4da827[_0xa084('0x45')]=[{'all':!![]}];}return db[_0xa084('0x63')][_0xa084('0x47')](_0x4da827);})[_0xa084('0x24')](function(_0x167910){_0x23ff1c[_0xa084('0x48')]=_0x167910;return _0x23ff1c;});}})[_0xa084('0x24')](respondWithFilteredResult(_0x112ed7,_0x4da827))['catch'](handleError(_0x112ed7,null));};exports[_0xa084('0x64')]=function(_0x22f051,_0x481a6d,_0x34324c){var _0x2d718b={};var _0x3657d8={};var _0x243d1c;var _0x3b62e4;return db[_0xa084('0x46')]['findOne']({'where':{'id':_0x22f051[_0xa084('0x55')]['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x481a6d,null))[_0xa084('0x24')](function(_0x153620){if(_0x153620){_0x243d1c=_0x153620;_0x3657d8['model']=_[_0xa084('0x34')](db[_0xa084('0x65')][_0xa084('0x4a')]);_0x3657d8[_0xa084('0x35')]=_[_0xa084('0x34')](_0x22f051[_0xa084('0x35')]);_0x3657d8[_0xa084('0x36')]=_['intersection'](_0x3657d8[_0xa084('0x33')],_0x3657d8[_0xa084('0x35')]);_0x2d718b[_0xa084('0x37')]=_[_0xa084('0x38')](_0x3657d8[_0xa084('0x33')],qs['fields'](_0x22f051[_0xa084('0x35')]['fields']));_0x2d718b['attributes']=_0x2d718b[_0xa084('0x37')]['length']?_0x2d718b[_0xa084('0x37')]:_0x3657d8[_0xa084('0x33')];_0x2d718b[_0xa084('0x3d')]=qs[_0xa084('0x3e')](_0x22f051[_0xa084('0x35')][_0xa084('0x3e')]);_0x2d718b['where']=qs[_0xa084('0x36')](_['pick'](_0x22f051[_0xa084('0x35')],_0x3657d8[_0xa084('0x36')]));if(_0x22f051['query'][_0xa084('0x41')]){_0x2d718b[_0xa084('0x3f')]=_['merge'](_0x2d718b[_0xa084('0x3f')],{'$or':_[_0xa084('0x2f')](_0x2d718b['attributes'],function(_0x4166e0){var _0x1571ea={};_0x1571ea[_0x4166e0]={'$like':'%'+_0x22f051[_0xa084('0x35')][_0xa084('0x41')]+'%'};return _0x1571ea;})});}_0x2d718b=_[_0xa084('0x42')]({},_0x2d718b,_0x22f051[_0xa084('0x43')]);return _0x243d1c[_0xa084('0x64')](_0x2d718b);}})['then'](function(_0x29952b){if(_0x29952b){_0x3b62e4=_0x29952b['length'];if(!_0x22f051[_0xa084('0x35')][_0xa084('0x3b')]('nolimit')){_0x2d718b[_0xa084('0x1d')]=qs['limit'](_0x22f051[_0xa084('0x35')][_0xa084('0x1d')]);_0x2d718b['offset']=qs[_0xa084('0x1a')](_0x22f051[_0xa084('0x35')][_0xa084('0x1a')]);}return _0x243d1c[_0xa084('0x64')](_0x2d718b);}})[_0xa084('0x24')](function(_0x5dcb0c){if(_0x5dcb0c){return _0x5dcb0c?{'count':_0x3b62e4,'rows':_0x5dcb0c}:null;}})[_0xa084('0x24')](respondWithResult(_0x481a6d,null))[_0xa084('0x49')](handleError(_0x481a6d,null));};exports[_0xa084('0x66')]=function(_0x3d430e,_0x40f4e7,_0x1ed56f){var _0x4d23f1,_0x246906;return db[_0xa084('0x46')][_0xa084('0x4b')]({'where':{'id':_0x3d430e[_0xa084('0x55')]['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x40f4e7,null))[_0xa084('0x24')](function(_0x2eb877){if(_0x2eb877){_0x246906=_0x2eb877;return _0x2eb877[_0xa084('0x66')](_0x3d430e[_0xa084('0x58')][_0xa084('0x67')],_[_0xa084('0x56')](_0x3d430e['body'],[_0xa084('0x67'),'id'])||{});}return null;})[_0xa084('0x68')](function(_0x17fe32){var _0x2992c9;_0x4d23f1=_0x17fe32||[];var _0x2be775=[];if(_0x17fe32){for(var _0x4a7559=0x0;_0x4a7559<_0x17fe32[_0xa084('0x3a')];_0x4a7559+=0x1){var _0x50bf6b=_0x17fe32[_0x4a7559][_0xa084('0x26')]({'plain':!![]});_0x246906[_0xa084('0x69')]=_0x3d430e[_0xa084('0x58')][_0xa084('0x69')]?_0x3d430e[_0xa084('0x58')][_0xa084('0x69')]:_0x246906[_0xa084('0x69')];switch(_0x246906[_0xa084('0x69')]){case _0xa084('0x6a'):_0x2992c9=squel['insert']()[_0xa084('0x6b')](_0xa084('0x6c'))[_0xa084('0x6d')]([_0xa084('0x6e'),'scheduledAt',_0xa084('0x6f'),_0xa084('0x70'),'CampaignId','createdAt',_0xa084('0x57')],squel[_0xa084('0x71')]()['field'](_0xa084('0x6e'),_0xa084('0x6e'))[_0xa084('0x72')](_0xa084('0x73'),'scheduledAt')[_0xa084('0x72')]('id',_0xa084('0x6f'))['field'](_0x50bf6b[_0xa084('0x74')][_0xa084('0x75')](),_0xa084('0x70'))[_0xa084('0x72')](_0x3d430e[_0xa084('0x55')]['id'][_0xa084('0x75')](),'CampaignId')[_0xa084('0x72')](_0xa084('0x73'),'createdAt')['field']('NOW()','updatedAt')[_0xa084('0x76')](_0xa084('0x77'))['where'](_0xa084('0x78'))[_0xa084('0x3f')]('ListId\x20=\x20?',_0x50bf6b['CmListId'][_0xa084('0x75')]())[_0xa084('0x3f')](_0xa084('0x79'))[_0xa084('0x3f')](_0xa084('0x7a'),squel[_0xa084('0x71')]()[_0xa084('0x72')](_0xa084('0x7b'))[_0xa084('0x76')](_0xa084('0x7c'))[_0xa084('0x3f')](_0xa084('0x7d'),_0x3d430e[_0xa084('0x55')]['id']['toString']()))['where'](_0xa084('0x7a'),squel['select']()[_0xa084('0x72')](_0xa084('0x7e'))[_0xa084('0x76')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x3d430e[_0xa084('0x55')]['id'][_0xa084('0x75')]())))[_0xa084('0x75')]();break;case'onlyIfOpen':_0x2992c9=squel[_0xa084('0x7f')]()[_0xa084('0x6b')]('cm_hopper')[_0xa084('0x6d')]([_0xa084('0x6e'),'scheduledAt',_0xa084('0x6f'),_0xa084('0x70'),'CampaignId',_0xa084('0x59'),_0xa084('0x57')],squel[_0xa084('0x71')]()[_0xa084('0x72')](_0xa084('0x6e'),'phone')['field'](_0xa084('0x73'),_0xa084('0x80'))[_0xa084('0x72')]('id',_0xa084('0x6f'))[_0xa084('0x72')](_0x50bf6b[_0xa084('0x74')][_0xa084('0x75')](),'ListId')[_0xa084('0x72')](_0x3d430e[_0xa084('0x55')]['id']['toString'](),_0xa084('0x5c'))[_0xa084('0x72')](_0xa084('0x73'),_0xa084('0x59'))['field'](_0xa084('0x73'),_0xa084('0x57'))[_0xa084('0x76')](_0xa084('0x77'))[_0xa084('0x3f')](_0xa084('0x78'))['where'](_0xa084('0x81'),_0x50bf6b[_0xa084('0x74')][_0xa084('0x75')]())[_0xa084('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xa084('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xa084('0x72')](_0xa084('0x7e'))[_0xa084('0x76')](_0xa084('0x6c'))[_0xa084('0x3f')](_0xa084('0x7d'),_0x3d430e['params']['id'][_0xa084('0x75')]())))[_0xa084('0x75')]();break;default:_0x2992c9=squel['insert']()[_0xa084('0x6b')](_0xa084('0x6c'))[_0xa084('0x6d')]([_0xa084('0x6e'),_0xa084('0x80'),'ContactId',_0xa084('0x70'),'CampaignId',_0xa084('0x59'),_0xa084('0x57')],squel['select']()['field'](_0xa084('0x6e'),_0xa084('0x6e'))['field'](_0xa084('0x73'),'scheduledAt')[_0xa084('0x72')]('id','ContactId')[_0xa084('0x72')](_0x50bf6b[_0xa084('0x74')]['toString'](),_0xa084('0x70'))[_0xa084('0x72')](_0x3d430e[_0xa084('0x55')]['id'][_0xa084('0x75')](),'CampaignId')[_0xa084('0x72')](_0xa084('0x73'),_0xa084('0x59'))[_0xa084('0x72')]('NOW()','updatedAt')[_0xa084('0x76')]('cm_contacts')['where'](_0xa084('0x78'))[_0xa084('0x3f')](_0xa084('0x81'),_0x50bf6b[_0xa084('0x74')][_0xa084('0x75')]())[_0xa084('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x2be775[_0xa084('0x82')](db[_0xa084('0x83')]['query'](_0x2992c9));}return BPromise[_0xa084('0x84')](_0x2be775);}})[_0xa084('0x24')](function(){return _0x4d23f1;})[_0xa084('0x24')](respondWithResult(_0x40f4e7,null))[_0xa084('0x49')](handleError(_0x40f4e7,null));};exports[_0xa084('0x85')]=function(_0x1071bd,_0x59f543,_0x58290f){return db[_0xa084('0x46')][_0xa084('0x4b')]({'where':{'id':_0x1071bd[_0xa084('0x55')]['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x59f543,null))['then'](function(_0x243a1c){if(_0x243a1c){return _0x243a1c[_0xa084('0x85')](_0x1071bd[_0xa084('0x35')][_0xa084('0x67')]);}})[_0xa084('0x24')](function(_0x4caa05){if(_0x4caa05){return db[_0xa084('0x5b')][_0xa084('0x25')]({'where':{'ListId':_0x1071bd[_0xa084('0x35')][_0xa084('0x67')],'CampaignId':_0x1071bd[_0xa084('0x55')]['id']}})[_0xa084('0x24')](function(){return _0x4caa05;});}})['then'](respondWithStatusCode(_0x59f543,null))[_0xa084('0x49')](handleError(_0x59f543,null));};exports[_0xa084('0x86')]=function(_0x668ab1,_0x4751f9,_0x45d907){var _0x46c78f={};var _0x497a07={};var _0x36e2fa;var _0xf4efdb;return db[_0xa084('0x46')][_0xa084('0x5e')]({'where':{'id':_0x668ab1[_0xa084('0x55')]['id']}})['then'](handleEntityNotFound(_0x4751f9,null))[_0xa084('0x24')](function(_0x534392){if(_0x534392){_0x36e2fa=_0x534392;_0x497a07[_0xa084('0x33')]=_[_0xa084('0x34')](db[_0xa084('0x65')]['rawAttributes']);_0x497a07[_0xa084('0x35')]=_[_0xa084('0x34')](_0x668ab1[_0xa084('0x35')]);_0x497a07[_0xa084('0x36')]=_['intersection'](_0x497a07[_0xa084('0x33')],_0x497a07['query']);_0x46c78f[_0xa084('0x37')]=_[_0xa084('0x38')](_0x497a07[_0xa084('0x33')],qs[_0xa084('0x39')](_0x668ab1[_0xa084('0x35')][_0xa084('0x39')]));_0x46c78f[_0xa084('0x37')]=_0x46c78f[_0xa084('0x37')][_0xa084('0x3a')]?_0x46c78f['attributes']:_0x497a07[_0xa084('0x33')];_0x46c78f['order']=qs['sort'](_0x668ab1[_0xa084('0x35')][_0xa084('0x3e')]);_0x46c78f['where']=qs['filters'](_[_0xa084('0x40')](_0x668ab1[_0xa084('0x35')],_0x497a07[_0xa084('0x36')]));if(_0x668ab1[_0xa084('0x35')]['filter']){_0x46c78f['where']=_[_0xa084('0x42')](_0x46c78f[_0xa084('0x3f')],{'$or':_[_0xa084('0x2f')](_0x46c78f['attributes'],function(_0x2b3518){var _0x232d74={};_0x232d74[_0x2b3518]={'$like':'%'+_0x668ab1[_0xa084('0x35')][_0xa084('0x41')]+'%'};return _0x232d74;})});}_0x46c78f=_[_0xa084('0x42')]({},_0x46c78f,_0x668ab1['options']);return _0x36e2fa[_0xa084('0x86')](_0x46c78f);}})[_0xa084('0x24')](function(_0x189702){if(_0x189702){_0xf4efdb=_0x189702[_0xa084('0x3a')];if(!_0x668ab1[_0xa084('0x35')][_0xa084('0x3b')](_0xa084('0x3c'))){_0x46c78f[_0xa084('0x1d')]=qs[_0xa084('0x1d')](_0x668ab1[_0xa084('0x35')][_0xa084('0x1d')]);_0x46c78f['offset']=qs['offset'](_0x668ab1[_0xa084('0x35')]['offset']);}return _0x36e2fa[_0xa084('0x86')](_0x46c78f);}})[_0xa084('0x24')](function(_0x317f38){if(_0x317f38){return _0x317f38?{'count':_0xf4efdb,'rows':_0x317f38}:null;}})[_0xa084('0x24')](respondWithResult(_0x4751f9,null))[_0xa084('0x49')](handleError(_0x4751f9,null));};exports[_0xa084('0x87')]=function(_0x3de364,_0x47f1c4,_0x1b38ce){var _0x58082a,_0x4ad041;return db['Campaign'][_0xa084('0x4b')]({'where':{'id':_0x3de364[_0xa084('0x55')]['id']}})[_0xa084('0x24')](handleEntityNotFound(_0x47f1c4,null))[_0xa084('0x24')](function(_0x59dbdf){if(_0x59dbdf){_0x4ad041=_0x59dbdf;return _0x59dbdf[_0xa084('0x87')](_0x3de364[_0xa084('0x58')]['ids'],_[_0xa084('0x56')](_0x3de364[_0xa084('0x58')],[_0xa084('0x67'),'id'])||{});}return null;})['spread'](function(_0x361862){var _0x102c4d;_0x58082a=_0x361862||[];var _0x3cf8da=[];if(_0x361862){for(var _0x41dd23=0x0;_0x41dd23<_0x361862[_0xa084('0x3a')];_0x41dd23+=0x1){var _0x193329=_0x361862[_0x41dd23][_0xa084('0x26')]({'plain':!![]});_0x102c4d=squel[_0xa084('0x7f')]()[_0xa084('0x6b')](_0xa084('0x88'))['fromQuery']([_0xa084('0x6e'),_0xa084('0x6f'),'ListId',_0xa084('0x5c'),'createdAt',_0xa084('0x57')],squel['select']()['field'](_0xa084('0x6e'),_0xa084('0x6e'))[_0xa084('0x72')]('id',_0xa084('0x6f'))[_0xa084('0x72')](_0x193329[_0xa084('0x74')][_0xa084('0x75')](),_0xa084('0x70'))[_0xa084('0x72')](_0x3de364['params']['id'][_0xa084('0x75')](),_0xa084('0x5c'))[_0xa084('0x72')](_0xa084('0x73'),_0xa084('0x59'))[_0xa084('0x72')](_0xa084('0x73'),_0xa084('0x57'))[_0xa084('0x76')](_0xa084('0x77'))['where'](_0xa084('0x78'))['where'](_0xa084('0x81'),_0x193329[_0xa084('0x74')][_0xa084('0x75')]())[_0xa084('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3cf8da['push'](db[_0xa084('0x83')][_0xa084('0x35')](_0x102c4d));}return BPromise['all'](_0x3cf8da);}})[_0xa084('0x24')](function(){return _0x58082a;})['then'](respondWithResult(_0x47f1c4,null))['catch'](handleError(_0x47f1c4,null));};exports['removeBlackLists']=function(_0x264c3e,_0xcf7002,_0x463b70){return db[_0xa084('0x46')][_0xa084('0x4b')]({'where':{'id':_0x264c3e[_0xa084('0x55')]['id']}})['then'](handleEntityNotFound(_0xcf7002,null))[_0xa084('0x24')](function(_0x180a9c){if(_0x180a9c){return _0x180a9c[_0xa084('0x89')](_0x264c3e[_0xa084('0x35')]['ids']);}})[_0xa084('0x24')](function(_0xa32ed4){if(_0xa32ed4){return db[_0xa084('0x63')]['destroy']({'where':{'ListId':_0x264c3e[_0xa084('0x35')]['ids'],'CampaignId':_0x264c3e[_0xa084('0x55')]['id']}})[_0xa084('0x24')](function(){return _0xa32ed4;});}})[_0xa084('0x24')](respondWithStatusCode(_0xcf7002,null))[_0xa084('0x49')](handleError(_0xcf7002,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2b6e6cc..4105ee6 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(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 52417b7..3700aae 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 _0x9ff4=['options','raw','where','attributes','limit','include','model','map','then','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCampaign','Campaign','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ff4,0x196));var _0x49ff=function(_0x51c1f0,_0x4b8675){_0x51c1f0=_0x51c1f0-0x0;var _0xa8547b=_0x9ff4[_0x51c1f0];return _0xa8547b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x49ff('0x0'));var rs=require(_0x49ff('0x1'));var fs=require('fs');var Redis=require(_0x49ff('0x2'));var db=require(_0x49ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ff('0x4'))(_0x49ff('0x5'));var config=require(_0x49ff('0x6'));var jayson=require(_0x49ff('0x7'));var client=jayson[_0x49ff('0x8')][_0x49ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe967d3,_0xd87903,_0x50f784){return new BPromise(function(_0x5478a6,_0x304f83){return client[_0x49ff('0xa')](_0xe967d3,_0x50f784)['then'](function(_0x4e845a){logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));logger[_0x49ff('0xe')](_0x49ff('0xf'),_0xd87903,_0x49ff('0xd'),JSON[_0x49ff('0x10')](_0x4e845a));if(_0x4e845a[_0x49ff('0x11')]){if(_0x4e845a['error']['code']===0x1f4){logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a[_0x49ff('0x11')]['message']);return _0x304f83(_0x4e845a[_0x49ff('0x11')]['message']);}logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a['error'][_0x49ff('0x12')]);return _0x5478a6(_0x4e845a[_0x49ff('0x11')][_0x49ff('0x12')]);}else{logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));_0x5478a6(_0x4e845a[_0x49ff('0x13')][_0x49ff('0x12')]);}})['catch'](function(_0x29fb22){logger['error'](_0x49ff('0xc'),_0xd87903,_0x29fb22);_0x304f83(_0x29fb22);});});}exports[_0x49ff('0x14')]=function(_0x1a0f17){var _0x29c5d9=this;return new Promise(function(_0x255229,_0x90480f){return db[_0x49ff('0x15')][_0x49ff('0x16')]({'raw':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x18')]===undefined?!![]:![]:!![],'where':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x19')]||null:null,'attributes':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1a')]||null:null,'limit':_0x1a0f17['options']?_0x1a0f17['options'][_0x49ff('0x1b')]||null:null,'include':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x1c')]?_['map'](_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1c')],function(_0xb1088){return{'model':db[_0xb1088[_0x49ff('0x1d')]],'as':_0xb1088['as'],'attributes':_0xb1088[_0x49ff('0x1a')],'include':_0xb1088[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0xb1088[_0x49ff('0x1c')],function(_0x3c214b){return{'model':db[_0x3c214b[_0x49ff('0x1d')]],'as':_0x3c214b['as'],'attributes':_0x3c214b[_0x49ff('0x1a')],'include':_0x3c214b[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0x3c214b['include'],function(_0x203853){return{'model':db[_0x203853[_0x49ff('0x1d')]],'as':_0x203853['as'],'attributes':_0x203853['attributes']};}):[]};}):[]};}):[]:[]})[_0x49ff('0x1f')](function(_0x1f651a){logger[_0x49ff('0xb')]('GetCampaign',_0x1a0f17);logger[_0x49ff('0xe')](_0x49ff('0x14'),_0x1a0f17,JSON[_0x49ff('0x10')](_0x1f651a));_0x255229(_0x1f651a);})[_0x49ff('0x20')](function(_0xf380ba){logger[_0x49ff('0x11')](_0x49ff('0x14'),_0xf380ba[_0x49ff('0x12')],_0x1a0f17);_0x90480f(_0x29c5d9[_0x49ff('0x11')](0x1f4,_0xf380ba[_0x49ff('0x12')]));});});}; \ No newline at end of file +var _0x2fda=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','error','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch'];(function(_0x4a09b6,_0x364dbc){var _0x15629b=function(_0x59b493){while(--_0x59b493){_0x4a09b6['push'](_0x4a09b6['shift']());}};_0x15629b(++_0x364dbc);}(_0x2fda,0x186));var _0xa2fd=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x2fda[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xa2fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2fd('0x1'));var rs=require(_0xa2fd('0x2'));var fs=require('fs');var Redis=require(_0xa2fd('0x3'));var db=require(_0xa2fd('0x4'))['db'];var utils=require(_0xa2fd('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa2fd('0x6'));var client=jayson[_0xa2fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11994b,_0x2058d3,_0x290063){return new BPromise(function(_0x4abb3a,_0x213134){return client[_0xa2fd('0x8')](_0x11994b,_0x290063)[_0xa2fd('0x9')](function(_0x2683fc){logger[_0xa2fd('0xa')](_0xa2fd('0xb'),_0x2058d3,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x2058d3,_0xa2fd('0xc'),JSON['stringify'](_0x2683fc));if(_0x2683fc[_0xa2fd('0xd')]){if(_0x2683fc[_0xa2fd('0xd')]['code']===0x1f4){logger['error'](_0xa2fd('0xb'),_0x2058d3,_0x2683fc[_0xa2fd('0xd')][_0xa2fd('0xe')]);return _0x213134(_0x2683fc[_0xa2fd('0xd')][_0xa2fd('0xe')]);}logger[_0xa2fd('0xd')]('Campaign,\x20%s,\x20%s',_0x2058d3,_0x2683fc['error'][_0xa2fd('0xe')]);return _0x4abb3a(_0x2683fc['error'][_0xa2fd('0xe')]);}else{logger['info'](_0xa2fd('0xb'),_0x2058d3,_0xa2fd('0xc'));_0x4abb3a(_0x2683fc[_0xa2fd('0xf')][_0xa2fd('0xe')]);}})['catch'](function(_0x1a64a4){logger[_0xa2fd('0xd')](_0xa2fd('0xb'),_0x2058d3,_0x1a64a4);_0x213134(_0x1a64a4);});});}exports[_0xa2fd('0x10')]=function(_0x39f7b2){var _0x5c0697=this;return new Promise(function(_0x466df1,_0x22a3aa){return db[_0xa2fd('0x11')][_0xa2fd('0x12')]({'raw':_0x39f7b2[_0xa2fd('0x13')]?_0x39f7b2[_0xa2fd('0x13')][_0xa2fd('0x14')]===undefined?!![]:![]:!![],'where':_0x39f7b2[_0xa2fd('0x13')]?_0x39f7b2[_0xa2fd('0x13')][_0xa2fd('0x15')]||null:null,'attributes':_0x39f7b2[_0xa2fd('0x13')]?_0x39f7b2['options'][_0xa2fd('0x16')]||null:null,'limit':_0x39f7b2[_0xa2fd('0x13')]?_0x39f7b2[_0xa2fd('0x13')][_0xa2fd('0x17')]||null:null,'include':_0x39f7b2[_0xa2fd('0x13')]?_0x39f7b2['options'][_0xa2fd('0x18')]?_[_0xa2fd('0x19')](_0x39f7b2[_0xa2fd('0x13')][_0xa2fd('0x18')],function(_0x3e2110){return{'model':db[_0x3e2110[_0xa2fd('0x1a')]],'as':_0x3e2110['as'],'attributes':_0x3e2110[_0xa2fd('0x16')],'include':_0x3e2110[_0xa2fd('0x18')]?_[_0xa2fd('0x19')](_0x3e2110['include'],function(_0x3c551d){return{'model':db[_0x3c551d[_0xa2fd('0x1a')]],'as':_0x3c551d['as'],'attributes':_0x3c551d[_0xa2fd('0x16')],'include':_0x3c551d['include']?_['map'](_0x3c551d[_0xa2fd('0x18')],function(_0x113739){return{'model':db[_0x113739[_0xa2fd('0x1a')]],'as':_0x113739['as'],'attributes':_0x113739[_0xa2fd('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b700b){logger[_0xa2fd('0xa')](_0xa2fd('0x10'),_0x39f7b2);logger[_0xa2fd('0x1b')](_0xa2fd('0x10'),_0x39f7b2,JSON[_0xa2fd('0x1c')](_0x4b700b));_0x466df1(_0x4b700b);})[_0xa2fd('0x1d')](function(_0x583a19){logger[_0xa2fd('0xd')](_0xa2fd('0x10'),_0x583a19[_0xa2fd('0xe')],_0x39f7b2);_0x22a3aa(_0x5c0697[_0xa2fd('0xd')](0x1f4,_0x583a19[_0xa2fd('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 9f960ca..58740b6 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 _0x0f24=['removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0f24,0xac));var _0x40f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f24[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x40f2('0x0'));var path=require(_0x40f2('0x1'));var timeout=require(_0x40f2('0x2'));var express=require(_0x40f2('0x3'));var router=express[_0x40f2('0x4')]();var fs_extra=require(_0x40f2('0x5'));var auth=require(_0x40f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40f2('0x7'));var controller=require('./campaign.controller');router['get']('/',auth[_0x40f2('0x8')](),controller[_0x40f2('0x9')]);router[_0x40f2('0xa')](_0x40f2('0xb'),auth['isAuthenticated'](),controller[_0x40f2('0xc')]);router[_0x40f2('0xa')](_0x40f2('0xd'),auth['isAuthenticated'](),controller[_0x40f2('0xe')]);router[_0x40f2('0xa')](_0x40f2('0xf'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x10')]);router[_0x40f2('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x40f2('0x11')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x40f2('0xa')](_0x40f2('0x12'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x13')]);router[_0x40f2('0xa')](_0x40f2('0x14'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x15')]);router[_0x40f2('0x16')]('/',auth[_0x40f2('0x8')](),controller[_0x40f2('0x17')]);router[_0x40f2('0x16')](_0x40f2('0x18'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x19')]);router[_0x40f2('0x16')](_0x40f2('0x12'),auth['isAuthenticated'](),controller[_0x40f2('0x1a')]);router[_0x40f2('0x16')](_0x40f2('0x14'),auth['isAuthenticated'](),controller[_0x40f2('0x1b')]);router[_0x40f2('0x1c')](_0x40f2('0xb'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x1d')]);router[_0x40f2('0x1e')](_0x40f2('0xb'),auth['isAuthenticated'](),controller[_0x40f2('0x1f')]);router[_0x40f2('0x1e')]('/:id/lists',auth[_0x40f2('0x8')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0x40f2('0x8')](),controller[_0x40f2('0x20')]);module[_0x40f2('0x21')]=router; \ No newline at end of file +var _0x7e1b=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','addBlackLists','put','/:id','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x52e740,_0x2c3ccc){var _0x55236e=function(_0x19c2a5){while(--_0x19c2a5){_0x52e740['push'](_0x52e740['shift']());}};_0x55236e(++_0x2c3ccc);}(_0x7e1b,0x79));var _0xb7e1=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7e1b[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0xb7e1('0x0'));var path=require('path');var timeout=require(_0xb7e1('0x1'));var express=require(_0xb7e1('0x2'));var router=express[_0xb7e1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb7e1('0x4'));var interaction=require(_0xb7e1('0x5'));var config=require(_0xb7e1('0x6'));var controller=require(_0xb7e1('0x7'));router[_0xb7e1('0x8')]('/',auth[_0xb7e1('0x9')](),controller[_0xb7e1('0xa')]);router['get']('/:id',auth[_0xb7e1('0x9')](),controller[_0xb7e1('0xb')]);router['get'](_0xb7e1('0xc'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0xd')]);router['get'](_0xb7e1('0xe'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0xf')]);router['get'](_0xb7e1('0x10'),auth['isAuthenticated'](),controller[_0xb7e1('0x11')]);router[_0xb7e1('0x8')](_0xb7e1('0x12'),auth[_0xb7e1('0x9')](),controller['getHopperBlacks']);router[_0xb7e1('0x8')](_0xb7e1('0x13'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0x14')]);router['get'](_0xb7e1('0x15'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0x16')]);router[_0xb7e1('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb7e1('0x17')](_0xb7e1('0x18'),auth[_0xb7e1('0x9')](),controller['clone']);router[_0xb7e1('0x17')]('/:id/lists',auth['isAuthenticated'](),controller[_0xb7e1('0x19')]);router['post'](_0xb7e1('0x15'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0x1a')]);router[_0xb7e1('0x1b')](_0xb7e1('0x1c'),auth[_0xb7e1('0x9')](),controller['update']);router[_0xb7e1('0x1d')](_0xb7e1('0x1c'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0x1e')]);router[_0xb7e1('0x1d')](_0xb7e1('0x13'),auth[_0xb7e1('0x9')](),controller[_0xb7e1('0x1f')]);router[_0xb7e1('0x1d')](_0xb7e1('0x15'),auth['isAuthenticated'](),controller[_0xb7e1('0x20')]);module[_0xb7e1('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 643da8e..73a1f03 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 _0x3198=['sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3f2f56,_0x27e1b8){var _0x26a4a7=function(_0x3d993d){while(--_0x3d993d){_0x3f2f56['push'](_0x3f2f56['shift']());}};_0x26a4a7(++_0x27e1b8);}(_0x3198,0x1f4));var _0x8319=function(_0x42d74c,_0x7be041){_0x42d74c=_0x42d74c-0x0;var _0xb1f9f9=_0x3198[_0x42d74c];return _0xb1f9f9;};'use strict';var Sequelize=require(_0x8319('0x0'));module[_0x8319('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8319('0x2')]},'name':{'type':Sequelize[_0x8319('0x3')],'get':function(){return this[_0x8319('0x4')]('key');}}}; \ No newline at end of file +var _0xf5be=['exports','TEXT','STRING','getDataValue','key','sequelize'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0xf5be,0x173));var _0xef5b=function(_0x31a1f3,_0x423331){_0x31a1f3=_0x31a1f3-0x0;var _0x3d8fd3=_0xf5be[_0x31a1f3];return _0x3d8fd3;};'use strict';var Sequelize=require(_0xef5b('0x0'));module[_0xef5b('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xef5b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xef5b('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xef5b('0x4')](_0xef5b('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9bf55cc..508af55 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 _0x9bcf=['name','index','map','CannedAnswer','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','intersection','length','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack'];(function(_0x9d3f71,_0x2111e0){var _0x4e692c=function(_0x48508f){while(--_0x48508f){_0x9d3f71['push'](_0x9d3f71['shift']());}};_0x4e692c(++_0x2111e0);}(_0x9bcf,0x12d));var _0xf9bc=function(_0x3bfdcd,_0x3e260e){_0x3bfdcd=_0x3bfdcd-0x0;var _0x1089ae=_0x9bcf[_0x3bfdcd];return _0x1089ae;};'use strict';var emlformat=require(_0xf9bc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9bc('0x1'));var moment=require(_0xf9bc('0x2'));var BPromise=require(_0xf9bc('0x3'));var Mustache=require('mustache');var util=require(_0xf9bc('0x4'));var path=require(_0xf9bc('0x5'));var sox=require('sox');var csv=require(_0xf9bc('0x6'));var ejs=require(_0xf9bc('0x7'));var fs=require('fs');var fs_extra=require(_0xf9bc('0x8'));var _=require(_0xf9bc('0x9'));var squel=require(_0xf9bc('0xa'));var crypto=require(_0xf9bc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf9bc('0x6'));var querystring=require(_0xf9bc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9bc('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf9bc('0xe'));var hardwareService=require(_0xf9bc('0xf'));var logger=require(_0xf9bc('0x10'))(_0xf9bc('0x11'));var utils=require(_0xf9bc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf9bc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1458b8,_0x557256){_0x557256=_0x557256||0xcc;return function(_0x536dbe){if(_0x536dbe){return _0x1458b8[_0xf9bc('0x14')](_0x557256);}return _0x1458b8[_0xf9bc('0x15')](_0x557256)['end']();};}function respondWithResult(_0x1d5813,_0x50788d){_0x50788d=_0x50788d||0xc8;return function(_0x170d8e){if(_0x170d8e){return _0x1d5813['status'](_0x50788d)[_0xf9bc('0x16')](_0x170d8e);}};}function respondWithFilteredResult(_0x5cae6b,_0x205606){return function(_0x271167){if(_0x271167){var _0x24f081=typeof _0x205606[_0xf9bc('0x17')]===_0xf9bc('0x18')&&typeof _0x205606[_0xf9bc('0x19')]===_0xf9bc('0x18');var _0x3ddefb=_0x271167['count'];var _0x17963e=_0x24f081?0x0:_0x205606[_0xf9bc('0x17')];var _0x1e68f6=_0x24f081?_0x271167[_0xf9bc('0x1a')]:_0x205606[_0xf9bc('0x17')]+_0x205606[_0xf9bc('0x19')];var _0x5859b7;if(_0x1e68f6>=_0x3ddefb){_0x1e68f6=_0x3ddefb;_0x5859b7=0xc8;}else{_0x5859b7=0xce;}_0x5cae6b['status'](_0x5859b7);return _0x5cae6b[_0xf9bc('0x1b')](_0xf9bc('0x1c'),_0x17963e+'-'+_0x1e68f6+'/'+_0x3ddefb)[_0xf9bc('0x16')](_0x271167);}return null;};}function patchUpdates(_0x58985e){return function(_0x60a3ce){try{jsonpatch[_0xf9bc('0x1d')](_0x60a3ce,_0x58985e,!![]);}catch(_0xb2fdc8){return BPromise['reject'](_0xb2fdc8);}return _0x60a3ce[_0xf9bc('0x1e')]();};}function saveUpdates(_0xa934bc,_0x5d353b){return function(_0x271bfc){if(_0x271bfc){return _0x271bfc[_0xf9bc('0x1f')](_0xa934bc)[_0xf9bc('0x20')](function(_0x369990){return _0x369990;});}return null;};}function removeEntity(_0x4effce,_0x2ecec0){return function(_0x36d60b){if(_0x36d60b){return _0x36d60b[_0xf9bc('0x21')]()[_0xf9bc('0x20')](function(){var _0x421cdf=_0x36d60b[_0xf9bc('0x22')]({'plain':!![]});var _0x5d07b9='CannedAnswers';return db[_0xf9bc('0x23')][_0xf9bc('0x21')]({'where':{'type':_0x5d07b9,'resourceId':_0x421cdf['id']}})[_0xf9bc('0x20')](function(){return _0x36d60b;});})[_0xf9bc('0x20')](function(){_0x4effce['status'](0xcc)[_0xf9bc('0x24')]();});}};}function handleEntityNotFound(_0x3512a2,_0xaafe5a){return function(_0x3b7fb7){if(!_0x3b7fb7){_0x3512a2[_0xf9bc('0x14')](0x194);}return _0x3b7fb7;};}function handleError(_0x847e2d,_0x30dc11){_0x30dc11=_0x30dc11||0x1f4;return function(_0x27df31){logger[_0xf9bc('0x25')](_0x27df31[_0xf9bc('0x26')]);if(_0x27df31[_0xf9bc('0x27')]){delete _0x27df31[_0xf9bc('0x27')];}_0x847e2d[_0xf9bc('0x15')](_0x30dc11)['send'](_0x27df31);};}exports[_0xf9bc('0x28')]=function(_0x591276,_0x41773a){var _0x3c286c={},_0x5598d5={},_0x2a53a8={'count':0x0,'rows':[]};var _0x4b5f4a=_[_0xf9bc('0x29')](db[_0xf9bc('0x2a')][_0xf9bc('0x2b')],function(_0x741ba6){return{'name':_0x741ba6[_0xf9bc('0x2c')],'type':_0x741ba6[_0xf9bc('0x2d')]['key']};});_0x5598d5['model']=_[_0xf9bc('0x29')](_0x4b5f4a,'name');_0x5598d5[_0xf9bc('0x2e')]=_[_0xf9bc('0x2f')](_0x591276[_0xf9bc('0x2e')]);_0x5598d5[_0xf9bc('0x30')]=_['intersection'](_0x5598d5[_0xf9bc('0x31')],_0x5598d5[_0xf9bc('0x2e')]);_0x3c286c['attributes']=_['intersection'](_0x5598d5[_0xf9bc('0x31')],qs[_0xf9bc('0x32')](_0x591276[_0xf9bc('0x2e')]['fields']));_0x3c286c['attributes']=_0x3c286c[_0xf9bc('0x33')]['length']?_0x3c286c[_0xf9bc('0x33')]:_0x5598d5['model'];if(!_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x34')]('nolimit')){_0x3c286c[_0xf9bc('0x19')]=qs[_0xf9bc('0x19')](_0x591276[_0xf9bc('0x2e')]['limit']);_0x3c286c['offset']=qs[_0xf9bc('0x17')](_0x591276['query'][_0xf9bc('0x17')]);}_0x3c286c[_0xf9bc('0x35')]=qs[_0xf9bc('0x36')](_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x36')]);_0x3c286c['where']=qs[_0xf9bc('0x30')](_['pick'](_0x591276[_0xf9bc('0x2e')],_0x5598d5['filters']),_0x4b5f4a);if(_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]){_0x3c286c[_0xf9bc('0x38')]=_[_0xf9bc('0x39')](_0x3c286c['where'],{'$or':[{'key':{'$like':'%'+_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]+'%'}},{'value':{'$like':'%'+_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]+'%'}}]});}_0x3c286c=_[_0xf9bc('0x39')]({},_0x3c286c,_0x591276[_0xf9bc('0x3a')]);var _0x9396af={'where':_0x3c286c[_0xf9bc('0x38')]};return db[_0xf9bc('0x2a')]['count'](_0x9396af)['then'](function(_0x2c7640){_0x2a53a8[_0xf9bc('0x1a')]=_0x2c7640;if(_0x591276['query'][_0xf9bc('0x3b')]){_0x3c286c['include']=[{'all':!![]}];}return db[_0xf9bc('0x2a')][_0xf9bc('0x3c')](_0x3c286c);})[_0xf9bc('0x20')](function(_0x3d4ec7){_0x2a53a8[_0xf9bc('0x3d')]=_0x3d4ec7;return _0x2a53a8;})[_0xf9bc('0x20')](respondWithFilteredResult(_0x41773a,_0x3c286c))[_0xf9bc('0x3e')](handleError(_0x41773a,null));};exports[_0xf9bc('0x3f')]=function(_0x44e473,_0x5ec570){var _0x4295c0={'raw':!![],'where':{'id':_0x44e473[_0xf9bc('0x40')]['id']}},_0x359d78={};_0x359d78[_0xf9bc('0x31')]=_[_0xf9bc('0x2f')](db['CannedAnswer'][_0xf9bc('0x2b')]);_0x359d78[_0xf9bc('0x2e')]=_[_0xf9bc('0x2f')](_0x44e473[_0xf9bc('0x2e')]);_0x359d78[_0xf9bc('0x30')]=_[_0xf9bc('0x41')](_0x359d78[_0xf9bc('0x31')],_0x359d78[_0xf9bc('0x2e')]);_0x4295c0[_0xf9bc('0x33')]=_[_0xf9bc('0x41')](_0x359d78[_0xf9bc('0x31')],qs[_0xf9bc('0x32')](_0x44e473[_0xf9bc('0x2e')][_0xf9bc('0x32')]));_0x4295c0[_0xf9bc('0x33')]=_0x4295c0[_0xf9bc('0x33')][_0xf9bc('0x42')]?_0x4295c0['attributes']:_0x359d78[_0xf9bc('0x31')];if(_0x44e473['query']['includeAll']){_0x4295c0[_0xf9bc('0x43')]=[{'all':!![]}];}_0x4295c0=_[_0xf9bc('0x39')]({},_0x4295c0,_0x44e473[_0xf9bc('0x3a')]);return db[_0xf9bc('0x2a')][_0xf9bc('0x44')](_0x4295c0)['then'](handleEntityNotFound(_0x5ec570,null))[_0xf9bc('0x20')](respondWithResult(_0x5ec570,null))[_0xf9bc('0x3e')](handleError(_0x5ec570,null));};exports[_0xf9bc('0x1f')]=function(_0x11e849,_0x3810eb){if(_0x11e849[_0xf9bc('0x45')]['id']){delete _0x11e849[_0xf9bc('0x45')]['id'];}return db[_0xf9bc('0x2a')][_0xf9bc('0x44')]({'where':{'id':_0x11e849[_0xf9bc('0x40')]['id']}})[_0xf9bc('0x20')](handleEntityNotFound(_0x3810eb,null))[_0xf9bc('0x20')](saveUpdates(_0x11e849['body'],null))[_0xf9bc('0x20')](respondWithResult(_0x3810eb,null))[_0xf9bc('0x3e')](handleError(_0x3810eb,null));};exports[_0xf9bc('0x21')]=function(_0x3e58cc,_0x234b42){return db[_0xf9bc('0x2a')][_0xf9bc('0x44')]({'where':{'id':_0x3e58cc[_0xf9bc('0x40')]['id']}})['then'](handleEntityNotFound(_0x234b42,null))['then'](removeEntity(_0x234b42,null))['catch'](handleError(_0x234b42,null));};exports[_0xf9bc('0x46')]=function(_0x23d929,_0x28b021){var _0xd1cd58={'key':_0x23d929[_0xf9bc('0x45')]['key']};if(_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x47')]){_0xd1cd58[_0xf9bc('0x47')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x47')];}else if(_0x23d929['body'][_0xf9bc('0x48')]){_0xd1cd58[_0xf9bc('0x48')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x48')];}else if(_0x23d929['body']['OpenchannelAccountId']){_0xd1cd58[_0xf9bc('0x49')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x49')];}else if(_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x4a')]){_0xd1cd58[_0xf9bc('0x4a')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x4a')];}return db[_0xf9bc('0x2a')]['find']({'where':_0xd1cd58})[_0xf9bc('0x20')](function(_0x3f792b){if(_0x3f792b){throw new db[(_0xf9bc('0x4b'))][(_0xf9bc('0x4c'))](_0xf9bc('0x4d'));}return db[_0xf9bc('0x2a')][_0xf9bc('0x46')](_0x23d929['body']);})[_0xf9bc('0x20')](function(_0x4c5ab5){var _0x1e6712=_0x23d929['user']['get']({'plain':!![]});if(!_0x1e6712)throw new Error(_0xf9bc('0x4e'));if(_0x1e6712[_0xf9bc('0x4f')]===_0xf9bc('0x50')){var _0x47d6db=_0x4c5ab5[_0xf9bc('0x22')]({'plain':!![]});return db[_0xf9bc('0x51')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x1e6712[_0xf9bc('0x52')]},'raw':!![]})[_0xf9bc('0x20')](function(_0x30e40b){if(_0x30e40b&&_0x30e40b[_0xf9bc('0x53')]===0x0){return db[_0xf9bc('0x23')][_0xf9bc('0x46')]({'name':_0x47d6db[_0xf9bc('0x27')],'resourceId':_0x47d6db['id'],'type':_0x30e40b[_0xf9bc('0x27')],'sectionId':_0x30e40b['id']},{})[_0xf9bc('0x20')](function(){return _0x4c5ab5;});}else{return _0x4c5ab5;}})['catch'](function(_0x575573){logger[_0xf9bc('0x25')](_0xf9bc('0x54'),_0x575573);throw _0x575573;});}return _0x4c5ab5;})[_0xf9bc('0x20')](respondWithResult(_0x28b021,0xc9))[_0xf9bc('0x3e')](handleError(_0x28b021,null));}; \ No newline at end of file +var _0x0555=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','params','include','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x11262d,_0x3f6d72){var _0xf8af7f=function(_0x34c0f6){while(--_0x34c0f6){_0x11262d['push'](_0x11262d['shift']());}};_0xf8af7f(++_0x3f6d72);}(_0x0555,0x1c8));var _0x5055=function(_0x25ac39,_0x3f5d68){_0x25ac39=_0x25ac39-0x0;var _0x227924=_0x0555[_0x25ac39];return _0x227924;};'use strict';var emlformat=require(_0x5055('0x0'));var rimraf=require(_0x5055('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5055('0x2'));var moment=require(_0x5055('0x3'));var BPromise=require(_0x5055('0x4'));var Mustache=require(_0x5055('0x5'));var util=require('util');var path=require(_0x5055('0x6'));var sox=require(_0x5055('0x7'));var csv=require(_0x5055('0x8'));var ejs=require(_0x5055('0x9'));var fs=require('fs');var fs_extra=require(_0x5055('0xa'));var _=require(_0x5055('0xb'));var squel=require(_0x5055('0xc'));var crypto=require(_0x5055('0xd'));var jsforce=require(_0x5055('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5055('0x8'));var querystring=require(_0x5055('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5055('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5055('0x11'));var hardwareService=require(_0x5055('0x12'));var logger=require(_0x5055('0x13'))(_0x5055('0x14'));var utils=require(_0x5055('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5055('0x16'));var db=require(_0x5055('0x17'))['db'];function respondWithStatusCode(_0x5ce69f,_0x430f6e){_0x430f6e=_0x430f6e||0xcc;return function(_0x1ccfc7){if(_0x1ccfc7){return _0x5ce69f[_0x5055('0x18')](_0x430f6e);}return _0x5ce69f[_0x5055('0x19')](_0x430f6e)[_0x5055('0x1a')]();};}function respondWithResult(_0x134cb8,_0x424f15){_0x424f15=_0x424f15||0xc8;return function(_0x15324b){if(_0x15324b){return _0x134cb8[_0x5055('0x19')](_0x424f15)['json'](_0x15324b);}};}function respondWithFilteredResult(_0x367a7c,_0x5100f0){return function(_0x4c0287){if(_0x4c0287){var _0x1b7c4=typeof _0x5100f0[_0x5055('0x1b')]===_0x5055('0x1c')&&typeof _0x5100f0['limit']===_0x5055('0x1c');var _0x4df4a0=_0x4c0287[_0x5055('0x1d')];var _0x24b6bd=_0x1b7c4?0x0:_0x5100f0[_0x5055('0x1b')];var _0x216943=_0x1b7c4?_0x4c0287[_0x5055('0x1d')]:_0x5100f0[_0x5055('0x1b')]+_0x5100f0[_0x5055('0x1e')];var _0x5e150c;if(_0x216943>=_0x4df4a0){_0x216943=_0x4df4a0;_0x5e150c=0xc8;}else{_0x5e150c=0xce;}_0x367a7c[_0x5055('0x19')](_0x5e150c);return _0x367a7c[_0x5055('0x1f')](_0x5055('0x20'),_0x24b6bd+'-'+_0x216943+'/'+_0x4df4a0)[_0x5055('0x21')](_0x4c0287);}return null;};}function patchUpdates(_0x4f43f2){return function(_0x23c371){try{jsonpatch[_0x5055('0x22')](_0x23c371,_0x4f43f2,!![]);}catch(_0x33ca9b){return BPromise['reject'](_0x33ca9b);}return _0x23c371[_0x5055('0x23')]();};}function saveUpdates(_0x5119a3,_0x439ca7){return function(_0x286b15){if(_0x286b15){return _0x286b15['update'](_0x5119a3)['then'](function(_0x59fbd1){return _0x59fbd1;});}return null;};}function removeEntity(_0x6db46c,_0x42dfd1){return function(_0x4f9e74){if(_0x4f9e74){return _0x4f9e74['destroy']()[_0x5055('0x24')](function(){var _0x4332f6=_0x4f9e74[_0x5055('0x25')]({'plain':!![]});var _0x41ef30=_0x5055('0x26');return db[_0x5055('0x27')][_0x5055('0x28')]({'where':{'type':_0x41ef30,'resourceId':_0x4332f6['id']}})[_0x5055('0x24')](function(){return _0x4f9e74;});})[_0x5055('0x24')](function(){_0x6db46c[_0x5055('0x19')](0xcc)[_0x5055('0x1a')]();});}};}function handleEntityNotFound(_0x23afbc,_0x537444){return function(_0x906479){if(!_0x906479){_0x23afbc[_0x5055('0x18')](0x194);}return _0x906479;};}function handleError(_0x49c095,_0x408ed9){_0x408ed9=_0x408ed9||0x1f4;return function(_0xeb9d03){logger[_0x5055('0x29')](_0xeb9d03[_0x5055('0x2a')]);if(_0xeb9d03[_0x5055('0x2b')]){delete _0xeb9d03[_0x5055('0x2b')];}_0x49c095[_0x5055('0x19')](_0x408ed9)['send'](_0xeb9d03);};}exports[_0x5055('0x2c')]=function(_0x7ac5f0,_0x2431d7){var _0x34f080={},_0xb1a49={},_0x3f185c={'count':0x0,'rows':[]};var _0xe270b9=_[_0x5055('0x2d')](db[_0x5055('0x2e')][_0x5055('0x2f')],function(_0x417c57){return{'name':_0x417c57[_0x5055('0x30')],'type':_0x417c57[_0x5055('0x31')][_0x5055('0x32')]};});_0xb1a49['model']=_['map'](_0xe270b9,_0x5055('0x2b'));_0xb1a49['query']=_[_0x5055('0x33')](_0x7ac5f0[_0x5055('0x34')]);_0xb1a49[_0x5055('0x35')]=_[_0x5055('0x36')](_0xb1a49['model'],_0xb1a49['query']);_0x34f080[_0x5055('0x37')]=_[_0x5055('0x36')](_0xb1a49['model'],qs[_0x5055('0x38')](_0x7ac5f0[_0x5055('0x34')][_0x5055('0x38')]));_0x34f080[_0x5055('0x37')]=_0x34f080[_0x5055('0x37')][_0x5055('0x39')]?_0x34f080['attributes']:_0xb1a49[_0x5055('0x3a')];if(!_0x7ac5f0['query'][_0x5055('0x3b')](_0x5055('0x3c'))){_0x34f080[_0x5055('0x1e')]=qs['limit'](_0x7ac5f0[_0x5055('0x34')][_0x5055('0x1e')]);_0x34f080['offset']=qs[_0x5055('0x1b')](_0x7ac5f0['query'][_0x5055('0x1b')]);}_0x34f080[_0x5055('0x3d')]=qs['sort'](_0x7ac5f0[_0x5055('0x34')][_0x5055('0x3e')]);_0x34f080[_0x5055('0x3f')]=qs[_0x5055('0x35')](_[_0x5055('0x40')](_0x7ac5f0['query'],_0xb1a49[_0x5055('0x35')]),_0xe270b9);if(_0x7ac5f0[_0x5055('0x34')]['filter']){_0x34f080[_0x5055('0x3f')]=_[_0x5055('0x41')](_0x34f080['where'],{'$or':[{'key':{'$like':'%'+_0x7ac5f0[_0x5055('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x7ac5f0[_0x5055('0x34')][_0x5055('0x42')]+'%'}}]});}_0x34f080=_[_0x5055('0x41')]({},_0x34f080,_0x7ac5f0[_0x5055('0x43')]);var _0x1c75e4={'where':_0x34f080['where']};return db[_0x5055('0x2e')]['count'](_0x1c75e4)[_0x5055('0x24')](function(_0x5e9448){_0x3f185c[_0x5055('0x1d')]=_0x5e9448;if(_0x7ac5f0[_0x5055('0x34')][_0x5055('0x44')]){_0x34f080['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x5055('0x45')](_0x34f080);})[_0x5055('0x24')](function(_0x3954c6){_0x3f185c[_0x5055('0x46')]=_0x3954c6;return _0x3f185c;})['then'](respondWithFilteredResult(_0x2431d7,_0x34f080))['catch'](handleError(_0x2431d7,null));};exports['show']=function(_0xe6ffd2,_0xe33bde){var _0x330eb4={'raw':!![],'where':{'id':_0xe6ffd2[_0x5055('0x47')]['id']}},_0xec2085={};_0xec2085[_0x5055('0x3a')]=_[_0x5055('0x33')](db[_0x5055('0x2e')][_0x5055('0x2f')]);_0xec2085['query']=_[_0x5055('0x33')](_0xe6ffd2[_0x5055('0x34')]);_0xec2085[_0x5055('0x35')]=_['intersection'](_0xec2085[_0x5055('0x3a')],_0xec2085[_0x5055('0x34')]);_0x330eb4['attributes']=_[_0x5055('0x36')](_0xec2085[_0x5055('0x3a')],qs['fields'](_0xe6ffd2[_0x5055('0x34')][_0x5055('0x38')]));_0x330eb4['attributes']=_0x330eb4['attributes'][_0x5055('0x39')]?_0x330eb4['attributes']:_0xec2085[_0x5055('0x3a')];if(_0xe6ffd2['query'][_0x5055('0x44')]){_0x330eb4[_0x5055('0x48')]=[{'all':!![]}];}_0x330eb4=_['merge']({},_0x330eb4,_0xe6ffd2[_0x5055('0x43')]);return db['CannedAnswer'][_0x5055('0x49')](_0x330eb4)[_0x5055('0x24')](handleEntityNotFound(_0xe33bde,null))[_0x5055('0x24')](respondWithResult(_0xe33bde,null))[_0x5055('0x4a')](handleError(_0xe33bde,null));};exports[_0x5055('0x4b')]=function(_0x56a02b,_0x582de4){if(_0x56a02b['body']['id']){delete _0x56a02b[_0x5055('0x4c')]['id'];}return db[_0x5055('0x2e')][_0x5055('0x49')]({'where':{'id':_0x56a02b[_0x5055('0x47')]['id']}})[_0x5055('0x24')](handleEntityNotFound(_0x582de4,null))[_0x5055('0x24')](saveUpdates(_0x56a02b['body'],null))[_0x5055('0x24')](respondWithResult(_0x582de4,null))[_0x5055('0x4a')](handleError(_0x582de4,null));};exports[_0x5055('0x28')]=function(_0x10dc92,_0x4502aa){return db['CannedAnswer'][_0x5055('0x49')]({'where':{'id':_0x10dc92['params']['id']}})[_0x5055('0x24')](handleEntityNotFound(_0x4502aa,null))[_0x5055('0x24')](removeEntity(_0x4502aa,null))[_0x5055('0x4a')](handleError(_0x4502aa,null));};exports['create']=function(_0x3fe4c3,_0x42e1f9){var _0x1ed07d={'key':_0x3fe4c3['body'][_0x5055('0x32')]};if(_0x3fe4c3[_0x5055('0x4c')][_0x5055('0x4d')]){_0x1ed07d[_0x5055('0x4d')]=_0x3fe4c3['body'][_0x5055('0x4d')];}else if(_0x3fe4c3['body'][_0x5055('0x4e')]){_0x1ed07d[_0x5055('0x4e')]=_0x3fe4c3[_0x5055('0x4c')][_0x5055('0x4e')];}else if(_0x3fe4c3[_0x5055('0x4c')][_0x5055('0x4f')]){_0x1ed07d[_0x5055('0x4f')]=_0x3fe4c3[_0x5055('0x4c')][_0x5055('0x4f')];}else if(_0x3fe4c3['body'][_0x5055('0x50')]){_0x1ed07d[_0x5055('0x50')]=_0x3fe4c3[_0x5055('0x4c')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x5055('0x49')]({'where':_0x1ed07d})[_0x5055('0x24')](function(_0x34af52){if(_0x34af52){throw new db[(_0x5055('0x51'))][(_0x5055('0x52'))](_0x5055('0x53'));}return db['CannedAnswer'][_0x5055('0x54')](_0x3fe4c3[_0x5055('0x4c')]);})[_0x5055('0x24')](function(_0x3a1e54){var _0x313d7d=_0x3fe4c3[_0x5055('0x55')][_0x5055('0x25')]({'plain':!![]});if(!_0x313d7d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x313d7d[_0x5055('0x56')]==='user'){var _0x41f5d2=_0x3a1e54[_0x5055('0x25')]({'plain':!![]});return db[_0x5055('0x57')][_0x5055('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x313d7d[_0x5055('0x58')]},'raw':!![]})[_0x5055('0x24')](function(_0x1a955d){if(_0x1a955d&&_0x1a955d[_0x5055('0x59')]===0x0){return db[_0x5055('0x27')][_0x5055('0x54')]({'name':_0x41f5d2[_0x5055('0x2b')],'resourceId':_0x41f5d2['id'],'type':_0x1a955d['name'],'sectionId':_0x1a955d['id']},{})[_0x5055('0x24')](function(){return _0x3a1e54;});}else{return _0x3a1e54;}})['catch'](function(_0x17d0b6){logger[_0x5055('0x29')](_0x5055('0x5a'),_0x17d0b6);throw _0x17d0b6;});}return _0x3a1e54;})[_0x5055('0x24')](respondWithResult(_0x42e1f9,0xc9))['catch'](handleError(_0x42e1f9,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 59104bc..062520c 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 _0xca0a=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','lodash','api','moment','request-promise','path'];(function(_0x592774,_0x19f692){var _0x2ba6fb=function(_0x5f5849){while(--_0x5f5849){_0x592774['push'](_0x592774['shift']());}};_0x2ba6fb(++_0x19f692);}(_0xca0a,0xf5));var _0xaca0=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xca0a[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xaca0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaca0('0x1'));var moment=require(_0xaca0('0x2'));var BPromise=require('bluebird');var rp=require(_0xaca0('0x3'));var fs=require('fs');var path=require(_0xaca0('0x4'));var rimraf=require('rimraf');var config=require(_0xaca0('0x5'));var attributes=require(_0xaca0('0x6'));module[_0xaca0('0x7')]=function(_0x56541f,_0x1f8510){return _0x56541f['define'](_0xaca0('0x8'),attributes,{'tableName':_0xaca0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1371=['request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4e8df1,_0x3c655d){var _0x51f50e=function(_0x26f3ab){while(--_0x26f3ab){_0x4e8df1['push'](_0x4e8df1['shift']());}};_0x51f50e(++_0x3c655d);}(_0x1371,0x91));var _0x1137=function(_0x2e23dd,_0xf137d0){_0x2e23dd=_0x2e23dd-0x0;var _0x4bd4c1=_0x1371[_0x2e23dd];return _0x4bd4c1;};'use strict';var _=require(_0x1137('0x0'));var util=require(_0x1137('0x1'));var logger=require(_0x1137('0x2'))('api');var moment=require(_0x1137('0x3'));var BPromise=require(_0x1137('0x4'));var rp=require(_0x1137('0x5'));var fs=require('fs');var path=require(_0x1137('0x6'));var rimraf=require(_0x1137('0x7'));var config=require(_0x1137('0x8'));var attributes=require(_0x1137('0x9'));module[_0x1137('0xa')]=function(_0x5d9cf0,_0x1933a8){return _0x5d9cf0['define'](_0x1137('0xb'),attributes,{'tableName':_0x1137('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1137('0xd'),'collate':_0x1137('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 1e9757c..37ace00 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(_0x59a7b7,_0x4d5f8d){var _0x167fc1=function(_0x58ac5a){while(--_0x58ac5a){_0x59a7b7['push'](_0x59a7b7['shift']());}};_0x167fc1(++_0x4d5f8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x4f78b0,_0x5cbf1e){var _0x5acca2=function(_0x3179da){while(--_0x3179da){_0x4f78b0['push'](_0x4f78b0['shift']());}};_0x5acca2(++_0x5cbf1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 4e70c9a..3089647 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 _0xe1dd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','/:id','destroy','exports'];(function(_0xfc4ee7,_0x89427a){var _0x22dd89=function(_0xe01e3b){while(--_0xe01e3b){_0xfc4ee7['push'](_0xfc4ee7['shift']());}};_0x22dd89(++_0x89427a);}(_0xe1dd,0x1c2));var _0xde1d=function(_0x287bd5,_0x47a4eb){_0x287bd5=_0x287bd5-0x0;var _0x4b1605=_0xe1dd[_0x287bd5];return _0x4b1605;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde1d('0x0'));var timeout=require(_0xde1d('0x1'));var express=require(_0xde1d('0x2'));var router=express[_0xde1d('0x3')]();var fs_extra=require(_0xde1d('0x4'));var auth=require(_0xde1d('0x5'));var interaction=require(_0xde1d('0x6'));var config=require(_0xde1d('0x7'));var controller=require('./cannedAnswer.controller');router[_0xde1d('0x8')]('/',auth[_0xde1d('0x9')](),controller[_0xde1d('0xa')]);router[_0xde1d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xde1d('0xb')]('/',auth[_0xde1d('0x9')](),controller[_0xde1d('0xc')]);router[_0xde1d('0xd')]('/:id',auth[_0xde1d('0x9')](),controller[_0xde1d('0xe')]);router['delete'](_0xde1d('0xf'),auth[_0xde1d('0x9')](),controller[_0xde1d('0x10')]);module[_0xde1d('0x11')]=router; \ No newline at end of file +var _0x633b=['fs-extra','../../config/environment','get','isAuthenticated','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xe16fcf,_0x2b5918){var _0x5981e9=function(_0x494df2){while(--_0x494df2){_0xe16fcf['push'](_0xe16fcf['shift']());}};_0x5981e9(++_0x2b5918);}(_0x633b,0x8a));var _0xb633=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x633b[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xb633('0x0'));var util=require(_0xb633('0x1'));var path=require(_0xb633('0x2'));var timeout=require(_0xb633('0x3'));var express=require(_0xb633('0x4'));var router=express[_0xb633('0x5')]();var fs_extra=require(_0xb633('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb633('0x7'));var controller=require('./cannedAnswer.controller');router[_0xb633('0x8')]('/',auth[_0xb633('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb633('0xa')]('/',auth[_0xb633('0x9')](),controller[_0xb633('0xb')]);router[_0xb633('0xc')](_0xb633('0xd'),auth[_0xb633('0x9')](),controller[_0xb633('0xe')]);router['delete'](_0xb633('0xd'),auth[_0xb633('0x9')](),controller['destroy']);module[_0xb633('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4973b82..432b57d 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 _0x7b37=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x1d1a9c,_0x2274db){var _0x3e0c65=function(_0x2c41c5){while(--_0x2c41c5){_0x1d1a9c['push'](_0x1d1a9c['shift']());}};_0x3e0c65(++_0x2274db);}(_0x7b37,0xd9));var _0x77b3=function(_0x4112f5,_0x304bfe){_0x4112f5=_0x4112f5-0x0;var _0x44b7e6=_0x7b37[_0x4112f5];return _0x44b7e6;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x77b3('0x2')},'clid':{'type':Sequelize[_0x77b3('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x77b3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77b3('0x3')]},'dstchannel':{'type':Sequelize[_0x77b3('0x3')]},'lastapp':{'type':Sequelize[_0x77b3('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x77b3('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x77b3('0x3')]},'linkedid':{'type':Sequelize[_0x77b3('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x77b3('0x3')]},'type':{'type':Sequelize[_0x77b3('0x3')]},'tag':{'type':Sequelize[_0x77b3('0x3')]}}; \ No newline at end of file +var _0x16e4=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x257a53,_0x45f592){var _0x2601bc=function(_0x1e3692){while(--_0x1e3692){_0x257a53['push'](_0x257a53['shift']());}};_0x2601bc(++_0x45f592);}(_0x16e4,0x97));var _0x416e=function(_0x4e375e,_0x18a335){_0x4e375e=_0x4e375e-0x0;var _0xdad840=_0x16e4[_0x4e375e];return _0xdad840;};'use strict';var Sequelize=require(_0x416e('0x0'));module[_0x416e('0x1')]={'calldate':{'type':Sequelize[_0x416e('0x2')],'allowNull':![],'defaultValue':_0x416e('0x3')},'clid':{'type':Sequelize[_0x416e('0x4')]},'src':{'type':Sequelize[_0x416e('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x416e('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x416e('0x4')]},'lastapp':{'type':Sequelize[_0x416e('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x416e('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x416e('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x416e('0x4')]},'amaflags':{'type':Sequelize[_0x416e('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x416e('0x4')]},'userfield':{'type':Sequelize[_0x416e('0x4')]},'uniqueid':{'type':Sequelize[_0x416e('0x4')]},'linkedid':{'type':Sequelize[_0x416e('0x4')]},'sequence':{'type':Sequelize[_0x416e('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x416e('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 eca32d4..046110e 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 _0xae30=['offset','apply','reject','end','sendStatus','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0xae30,0x10a));var _0x0ae3=function(_0x2c2f35,_0x20cda1){_0x2c2f35=_0x2c2f35-0x0;var _0x543b7e=_0xae30[_0x2c2f35];return _0x543b7e;};'use strict';var emlformat=require(_0x0ae3('0x0'));var rimraf=require(_0x0ae3('0x1'));var zipdir=require(_0x0ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var Mustache=require(_0x0ae3('0x6'));var util=require('util');var path=require(_0x0ae3('0x7'));var sox=require(_0x0ae3('0x8'));var csv=require(_0x0ae3('0x9'));var ejs=require(_0x0ae3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae3('0xb'));var _=require(_0x0ae3('0xc'));var squel=require(_0x0ae3('0xd'));var crypto=require(_0x0ae3('0xe'));var jsforce=require(_0x0ae3('0xf'));var deskjs=require(_0x0ae3('0x10'));var toCsv=require(_0x0ae3('0x9'));var querystring=require(_0x0ae3('0x11'));var Papa=require(_0x0ae3('0x12'));var Redis=require('ioredis');var authService=require(_0x0ae3('0x13'));var qs=require(_0x0ae3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae3('0x15'))(_0x0ae3('0x16'));var utils=require(_0x0ae3('0x17'));var config=require(_0x0ae3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245ac0,_0x45242d){_0x45242d=_0x45242d||0xcc;return function(_0x50cee6){if(_0x50cee6){return _0x245ac0['sendStatus'](_0x45242d);}return _0x245ac0[_0x0ae3('0x19')](_0x45242d)['end']();};}function respondWithResult(_0x1b1e46,_0x450000){_0x450000=_0x450000||0xc8;return function(_0x1a6c69){if(_0x1a6c69){return _0x1b1e46[_0x0ae3('0x19')](_0x450000)[_0x0ae3('0x1a')](_0x1a6c69);}};}function respondWithFilteredResult(_0x1600bc,_0x28b547){return function(_0x5af348){if(_0x5af348){var _0x17f280=typeof _0x28b547['offset']===_0x0ae3('0x1b')&&typeof _0x28b547[_0x0ae3('0x1c')]===_0x0ae3('0x1b');var _0x59d0de=_0x5af348[_0x0ae3('0x1d')];var _0x40edc6=_0x17f280?0x0:_0x28b547[_0x0ae3('0x1e')];var _0x1bf406=_0x17f280?_0x5af348[_0x0ae3('0x1d')]:_0x28b547['offset']+_0x28b547[_0x0ae3('0x1c')];var _0x4b8949;if(_0x1bf406>=_0x59d0de){_0x1bf406=_0x59d0de;_0x4b8949=0xc8;}else{_0x4b8949=0xce;}_0x1600bc['status'](_0x4b8949);return _0x1600bc['set']('Content-Range',_0x40edc6+'-'+_0x1bf406+'/'+_0x59d0de)['json'](_0x5af348);}return null;};}function patchUpdates(_0x4e8135){return function(_0x4d1385){try{jsonpatch[_0x0ae3('0x1f')](_0x4d1385,_0x4e8135,!![]);}catch(_0x1fd946){return BPromise[_0x0ae3('0x20')](_0x1fd946);}return _0x4d1385['save']();};}function saveUpdates(_0x1cdd85,_0x5ecc45){return function(_0xfcf4a8){if(_0xfcf4a8){return _0xfcf4a8['update'](_0x1cdd85)['then'](function(_0x5ab18d){return _0x5ab18d;});}return null;};}function removeEntity(_0x281adf,_0x3b49a0){return function(_0x51e7d1){if(_0x51e7d1){return _0x51e7d1['destroy']()['then'](function(){_0x281adf[_0x0ae3('0x19')](0xcc)[_0x0ae3('0x21')]();});}};}function handleEntityNotFound(_0x5a76e5,_0x36ce4e){return function(_0x1613c3){if(!_0x1613c3){_0x5a76e5[_0x0ae3('0x22')](0x194);}return _0x1613c3;};}function handleError(_0x5b0117,_0x2f8134){_0x2f8134=_0x2f8134||0x1f4;return function(_0x1f9cde){logger[_0x0ae3('0x23')](_0x1f9cde['stack']);if(_0x1f9cde[_0x0ae3('0x24')]){delete _0x1f9cde[_0x0ae3('0x24')];}_0x5b0117[_0x0ae3('0x19')](_0x2f8134)['send'](_0x1f9cde);};}exports[_0x0ae3('0x25')]=function(_0x247623,_0xf0e310){var _0x152876={},_0x1f8f61={},_0x10a7bd={'count':0x0,'rows':[]};var _0x5e8979=_[_0x0ae3('0x26')](db[_0x0ae3('0x27')][_0x0ae3('0x28')],function(_0x4032f4){return{'name':_0x4032f4[_0x0ae3('0x29')],'type':_0x4032f4[_0x0ae3('0x2a')][_0x0ae3('0x2b')]};});_0x1f8f61[_0x0ae3('0x2c')]=_['map'](_0x5e8979,_0x0ae3('0x24'));_0x1f8f61[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x247623[_0x0ae3('0x2d')]);_0x1f8f61['filters']=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],_0x1f8f61[_0x0ae3('0x2d')]);_0x152876[_0x0ae3('0x30')]=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],qs['fields'](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x31')]));_0x152876[_0x0ae3('0x30')]=_0x152876[_0x0ae3('0x30')][_0x0ae3('0x32')]?_0x152876[_0x0ae3('0x30')]:_0x1f8f61[_0x0ae3('0x2c')];if(!_0x247623['query']['hasOwnProperty'](_0x0ae3('0x33'))){_0x152876[_0x0ae3('0x1c')]=qs[_0x0ae3('0x1c')](_0x247623['query']['limit']);_0x152876[_0x0ae3('0x1e')]=qs[_0x0ae3('0x1e')](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x1e')]);}_0x152876[_0x0ae3('0x34')]=qs[_0x0ae3('0x35')](_0x247623[_0x0ae3('0x2d')]['sort']);_0x152876[_0x0ae3('0x36')]=qs[_0x0ae3('0x37')](_[_0x0ae3('0x38')](_0x247623['query'],_0x1f8f61['filters']),_0x5e8979);if(_0x247623['query'][_0x0ae3('0x39')]){_0x152876[_0x0ae3('0x36')]=_['merge'](_0x152876[_0x0ae3('0x36')],{'$or':_[_0x0ae3('0x26')](_0x5e8979,function(_0x3ee862){if(_0x3ee862['type']!==_0x0ae3('0x3a')){var _0x5dd8d7={};_0x5dd8d7[_0x3ee862[_0x0ae3('0x24')]]={'$like':'%'+_0x247623[_0x0ae3('0x2d')]['filter']+'%'};return _0x5dd8d7;}})});}_0x152876=_[_0x0ae3('0x3b')]({},_0x152876,_0x247623[_0x0ae3('0x3c')]);var _0xfa6c7f={'where':_0x152876[_0x0ae3('0x36')]};return db[_0x0ae3('0x27')]['count'](_0xfa6c7f)['then'](function(_0x2e95e5){_0x10a7bd[_0x0ae3('0x1d')]=_0x2e95e5;if(_0x247623['query']['includeAll']){_0x152876['include']=[{'all':!![]}];}return db['Cdr'][_0x0ae3('0x3d')](_0x152876);})[_0x0ae3('0x3e')](function(_0x325153){_0x10a7bd[_0x0ae3('0x3f')]=_0x325153;return _0x10a7bd;})[_0x0ae3('0x3e')](respondWithFilteredResult(_0xf0e310,_0x152876))[_0x0ae3('0x40')](handleError(_0xf0e310,null));};exports[_0x0ae3('0x41')]=function(_0x3166af,_0x2cfc16){var _0x1230c9={'raw':!![],'where':{'id':_0x3166af[_0x0ae3('0x42')]['id']}},_0x5a0e74={};_0x5a0e74[_0x0ae3('0x2c')]=_['keys'](db[_0x0ae3('0x27')][_0x0ae3('0x28')]);_0x5a0e74[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x3166af[_0x0ae3('0x2d')]);_0x5a0e74['filters']=_[_0x0ae3('0x2f')](_0x5a0e74[_0x0ae3('0x2c')],_0x5a0e74[_0x0ae3('0x2d')]);_0x1230c9[_0x0ae3('0x30')]=_['intersection'](_0x5a0e74[_0x0ae3('0x2c')],qs[_0x0ae3('0x31')](_0x3166af['query'][_0x0ae3('0x31')]));_0x1230c9[_0x0ae3('0x30')]=_0x1230c9['attributes']['length']?_0x1230c9[_0x0ae3('0x30')]:_0x5a0e74[_0x0ae3('0x2c')];if(_0x3166af[_0x0ae3('0x2d')][_0x0ae3('0x43')]){_0x1230c9[_0x0ae3('0x44')]=[{'all':!![]}];}_0x1230c9=_['merge']({},_0x1230c9,_0x3166af['options']);return db[_0x0ae3('0x27')]['find'](_0x1230c9)[_0x0ae3('0x3e')](handleEntityNotFound(_0x2cfc16,null))[_0x0ae3('0x3e')](respondWithResult(_0x2cfc16,null))['catch'](handleError(_0x2cfc16,null));};exports[_0x0ae3('0x45')]=function(_0x3e4bfb,_0x53e018){return db[_0x0ae3('0x27')][_0x0ae3('0x45')](_0x3e4bfb[_0x0ae3('0x46')],{})[_0x0ae3('0x3e')](respondWithResult(_0x53e018,0xc9))[_0x0ae3('0x40')](handleError(_0x53e018,null));};exports['update']=function(_0x3ad6b3,_0x53393b){if(_0x3ad6b3[_0x0ae3('0x46')]['id']){delete _0x3ad6b3[_0x0ae3('0x46')]['id'];}return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x3ad6b3[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x53393b,null))[_0x0ae3('0x3e')](saveUpdates(_0x3ad6b3[_0x0ae3('0x46')],null))['then'](respondWithResult(_0x53393b,null))[_0x0ae3('0x40')](handleError(_0x53393b,null));};exports[_0x0ae3('0x48')]=function(_0x29479f,_0x12ea03){return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x29479f[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x12ea03,null))[_0x0ae3('0x3e')](removeEntity(_0x12ea03,null))[_0x0ae3('0x40')](handleError(_0x12ea03,null));};exports[_0x0ae3('0x49')]=function(_0x572166,_0x256dc5){return db['Cdr'][_0x0ae3('0x49')]()[_0x0ae3('0x3e')](respondWithResult(_0x256dc5,null))[_0x0ae3('0x40')](handleError(_0x256dc5,null));}; \ No newline at end of file +var _0x6aa7=['includeAll','find','create','body','catch','describe','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','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x6aa7,0x178));var _0x76aa=function(_0x31ced3,_0x4f06de){_0x31ced3=_0x31ced3-0x0;var _0x3d69d3=_0x6aa7[_0x31ced3];return _0x3d69d3;};'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(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x19')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x1a')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x2d')](db[_0x76aa('0x2e')][_0x76aa('0x2f')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x30')],'type':_0x3827ec[_0x76aa('0x31')]['key']};});_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x2d')](_0x1e90b9,_0x76aa('0x2b'));_0x365ff8[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x3fcb7f[_0x76aa('0x33')]);_0x365ff8[_0x76aa('0x35')]=_['intersection'](_0x365ff8[_0x76aa('0x32')],_0x365ff8[_0x76aa('0x33')]);_0x994550['attributes']=_[_0x76aa('0x36')](_0x365ff8['model'],qs[_0x76aa('0x37')](_0x3fcb7f['query'][_0x76aa('0x37')]));_0x994550['attributes']=_0x994550['attributes'][_0x76aa('0x38')]?_0x994550[_0x76aa('0x39')]:_0x365ff8[_0x76aa('0x32')];if(!_0x3fcb7f[_0x76aa('0x33')]['hasOwnProperty']('nolimit')){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x1f')]);_0x994550[_0x76aa('0x1e')]=qs['offset'](_0x3fcb7f[_0x76aa('0x33')]['offset']);}_0x994550['order']=qs[_0x76aa('0x3a')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3a')]);_0x994550[_0x76aa('0x3b')]=qs['filters'](_[_0x76aa('0x3c')](_0x3fcb7f[_0x76aa('0x33')],_0x365ff8[_0x76aa('0x35')]),_0x1e90b9);if(_0x3fcb7f['query'][_0x76aa('0x3d')]){_0x994550[_0x76aa('0x3b')]=_[_0x76aa('0x3e')](_0x994550[_0x76aa('0x3b')],{'$or':_[_0x76aa('0x2d')](_0x1e90b9,function(_0x982e62){if(_0x982e62[_0x76aa('0x31')]!==_0x76aa('0x3f')){var _0x283179={};_0x283179[_0x982e62['name']]={'$like':'%'+_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3d')]+'%'};return _0x283179;}})});}_0x994550=_[_0x76aa('0x3e')]({},_0x994550,_0x3fcb7f[_0x76aa('0x40')]);var _0x64612e={'where':_0x994550[_0x76aa('0x3b')]};return db['Cdr']['count'](_0x64612e)[_0x76aa('0x27')](function(_0x262906){_0x2dec94[_0x76aa('0x1d')]=_0x262906;if(_0x3fcb7f[_0x76aa('0x33')]['includeAll']){_0x994550[_0x76aa('0x41')]=[{'all':!![]}];}return db[_0x76aa('0x2e')][_0x76aa('0x42')](_0x994550);})[_0x76aa('0x27')](function(_0x1138b5){_0x2dec94['rows']=_0x1138b5;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))['catch'](handleError(_0x5a8030,null));};exports[_0x76aa('0x43')]=function(_0x54b8fd,_0x496304){var _0x4f7f3a={'raw':!![],'where':{'id':_0x54b8fd['params']['id']}},_0x144f0a={};_0x144f0a['model']=_['keys'](db[_0x76aa('0x2e')][_0x76aa('0x2f')]);_0x144f0a[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x54b8fd[_0x76aa('0x33')]);_0x144f0a['filters']=_[_0x76aa('0x36')](_0x144f0a[_0x76aa('0x32')],_0x144f0a[_0x76aa('0x33')]);_0x4f7f3a[_0x76aa('0x39')]=_[_0x76aa('0x36')](_0x144f0a['model'],qs[_0x76aa('0x37')](_0x54b8fd[_0x76aa('0x33')]['fields']));_0x4f7f3a[_0x76aa('0x39')]=_0x4f7f3a['attributes'][_0x76aa('0x38')]?_0x4f7f3a[_0x76aa('0x39')]:_0x144f0a[_0x76aa('0x32')];if(_0x54b8fd[_0x76aa('0x33')][_0x76aa('0x44')]){_0x4f7f3a[_0x76aa('0x41')]=[{'all':!![]}];}_0x4f7f3a=_[_0x76aa('0x3e')]({},_0x4f7f3a,_0x54b8fd[_0x76aa('0x40')]);return db[_0x76aa('0x2e')][_0x76aa('0x45')](_0x4f7f3a)['then'](handleEntityNotFound(_0x496304,null))[_0x76aa('0x27')](respondWithResult(_0x496304,null))['catch'](handleError(_0x496304,null));};exports[_0x76aa('0x46')]=function(_0x3d3332,_0x5e95f5){return db[_0x76aa('0x2e')]['create'](_0x3d3332['body'],{})[_0x76aa('0x27')](respondWithResult(_0x5e95f5,0xc9))['catch'](handleError(_0x5e95f5,null));};exports[_0x76aa('0x26')]=function(_0x302a0c,_0x4315b3){if(_0x302a0c[_0x76aa('0x47')]['id']){delete _0x302a0c[_0x76aa('0x47')]['id'];}return db[_0x76aa('0x2e')]['find']({'where':{'id':_0x302a0c['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x4315b3,null))[_0x76aa('0x27')](saveUpdates(_0x302a0c[_0x76aa('0x47')],null))[_0x76aa('0x27')](respondWithResult(_0x4315b3,null))[_0x76aa('0x48')](handleError(_0x4315b3,null));};exports[_0x76aa('0x28')]=function(_0x4c52d5,_0x95b7c5){return db[_0x76aa('0x2e')][_0x76aa('0x45')]({'where':{'id':_0x4c52d5['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x95b7c5,null))['then'](removeEntity(_0x95b7c5,null))[_0x76aa('0x48')](handleError(_0x95b7c5,null));};exports['describe']=function(_0x339b0d,_0x4449c1){return db[_0x76aa('0x2e')][_0x76aa('0x49')]()[_0x76aa('0x27')](respondWithResult(_0x4449c1,null))[_0x76aa('0x48')](handleError(_0x4449c1,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 42fb32d..d7ab7f9 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5c45b6,_0x186363){var _0x7e295f=function(_0x129495){while(--_0x129495){_0x5c45b6['push'](_0x5c45b6['shift']());}};_0x7e295f(++_0x186363);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1ed99e,_0x2f17ea){var _0x662a9b=function(_0x2c36ec){while(--_0x2c36ec){_0x1ed99e['push'](_0x1ed99e['shift']());}};_0x662a9b(++_0x2f17ea);}(_0x7a54,0x106));var _0x47a5=function(_0x30c7a1,_0x261243){_0x30c7a1=_0x30c7a1-0x0;var _0x17ac9c=_0x7a54[_0x30c7a1];return _0x17ac9c;};'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 d921ef0..8c08882 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 _0x57ca=['info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x14a));var _0xa57c=function(_0x25af68,_0x4d205a){_0x25af68=_0x25af68-0x0;var _0x3b3491=_0x57ca[_0x25af68];return _0x3b3491;};'use strict';var _=require(_0xa57c('0x0'));var util=require(_0xa57c('0x1'));var moment=require('moment');var BPromise=require(_0xa57c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa57c('0x3'))['db'];var utils=require(_0xa57c('0x4'));var logger=require(_0xa57c('0x5'))('rpc');var config=require(_0xa57c('0x6'));var jayson=require(_0xa57c('0x7'));var client=jayson['client'][_0xa57c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c82f4,_0x10711c,_0x1bd548){return new BPromise(function(_0x4a5264,_0x16e8fb){return client['request'](_0x1c82f4,_0x1bd548)[_0xa57c('0x9')](function(_0x4ca7ad){logger[_0xa57c('0xa')](_0xa57c('0xb'),_0x10711c,'request\x20sent');logger[_0xa57c('0xc')](_0xa57c('0xd'),_0x10711c,_0xa57c('0xe'),JSON[_0xa57c('0xf')](_0x4ca7ad));if(_0x4ca7ad[_0xa57c('0x10')]){if(_0x4ca7ad[_0xa57c('0x10')]['code']===0x1f4){logger['error'](_0xa57c('0xb'),_0x10711c,_0x4ca7ad['error'][_0xa57c('0x11')]);return _0x16e8fb(_0x4ca7ad[_0xa57c('0x10')][_0xa57c('0x11')]);}logger[_0xa57c('0x10')](_0xa57c('0xb'),_0x10711c,_0x4ca7ad[_0xa57c('0x10')][_0xa57c('0x11')]);return _0x4a5264(_0x4ca7ad[_0xa57c('0x10')]['message']);}else{logger[_0xa57c('0xa')](_0xa57c('0xb'),_0x10711c,'request\x20sent');_0x4a5264(_0x4ca7ad[_0xa57c('0x12')][_0xa57c('0x11')]);}})[_0xa57c('0x13')](function(_0x7a939a){logger['error'](_0xa57c('0xb'),_0x10711c,_0x7a939a);_0x16e8fb(_0x7a939a);});});} \ No newline at end of file +var _0x0c8d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','then','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','error','Cdr,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird'];(function(_0x523bbd,_0x55b38c){var _0x3685e5=function(_0x5dd4b3){while(--_0x5dd4b3){_0x523bbd['push'](_0x523bbd['shift']());}};_0x3685e5(++_0x55b38c);}(_0x0c8d,0x179));var _0xd0c8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0c8d[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xd0c8('0x0'));var util=require(_0xd0c8('0x1'));var moment=require('moment');var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require(_0xd0c8('0x5'))['db'];var utils=require(_0xd0c8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0c8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x517694,_0x4d8782,_0x4e46e8){return new BPromise(function(_0x1b38ba,_0x3ea477){return client['request'](_0x517694,_0x4e46e8)[_0xd0c8('0x9')](function(_0xbfbf6b){logger['info']('Cdr,\x20%s,\x20%s',_0x4d8782,_0xd0c8('0xa'));logger[_0xd0c8('0xb')](_0xd0c8('0xc'),_0x4d8782,_0xd0c8('0xa'),JSON['stringify'](_0xbfbf6b));if(_0xbfbf6b['error']){if(_0xbfbf6b['error'][_0xd0c8('0xd')]===0x1f4){logger[_0xd0c8('0xe')](_0xd0c8('0xf'),_0x4d8782,_0xbfbf6b[_0xd0c8('0xe')]['message']);return _0x3ea477(_0xbfbf6b[_0xd0c8('0xe')][_0xd0c8('0x10')]);}logger[_0xd0c8('0xe')](_0xd0c8('0xf'),_0x4d8782,_0xbfbf6b[_0xd0c8('0xe')][_0xd0c8('0x10')]);return _0x1b38ba(_0xbfbf6b[_0xd0c8('0xe')][_0xd0c8('0x10')]);}else{logger[_0xd0c8('0x11')](_0xd0c8('0xf'),_0x4d8782,_0xd0c8('0xa'));_0x1b38ba(_0xbfbf6b[_0xd0c8('0x12')][_0xd0c8('0x10')]);}})[_0xd0c8('0x13')](function(_0x4bf1d6){logger[_0xd0c8('0xe')](_0xd0c8('0xf'),_0x4d8782,_0x4bf1d6);_0x3ea477(_0x4bf1d6);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index f4900a1..33d4d48 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(_0x20a573,_0x3328b4){var _0x399adf=function(_0x2196a1){while(--_0x2196a1){_0x20a573['push'](_0x20a573['shift']());}};_0x399adf(++_0x3328b4);}(_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(_0x508767,_0x369e53){var _0x2480fe=function(_0x25957e){while(--_0x25957e){_0x508767['push'](_0x508767['shift']());}};_0x2480fe(++_0x369e53);}(_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 b58f327..998fbc9 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 _0xca11=['exports','STRING','noop','*,*,*,*'];(function(_0x2f7f56,_0x389de3){var _0x49a05b=function(_0x3a89d6){while(--_0x3a89d6){_0x2f7f56['push'](_0x2f7f56['shift']());}};_0x49a05b(++_0x389de3);}(_0xca11,0x150));var _0x1ca1=function(_0x2fa703,_0x4fcbdc){_0x2fa703=_0x2fa703-0x0;var _0x3789ab=_0xca11[_0x2fa703];return _0x3789ab;};'use strict';var Sequelize=require('sequelize');module[_0x1ca1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1ca1('0x1')],'allowNull':![],'defaultValue':_0x1ca1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1ca1('0x1')]},'interval':{'type':Sequelize[_0x1ca1('0x1')],'defaultValue':_0x1ca1('0x3')}}; \ No newline at end of file +var _0x28b9=['exports','INTEGER','STRING','sequelize'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0x28b9,0x153));var _0x928b=function(_0x1db562,_0x290e26){_0x1db562=_0x1db562-0x0;var _0xa58473=_0x28b9[_0x1db562];return _0xa58473;};'use strict';var Sequelize=require(_0x928b('0x0'));module[_0x928b('0x1')]={'priority':{'type':Sequelize[_0x928b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x928b('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x928b('0x3')]},'interval':{'type':Sequelize[_0x928b('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 171dbc8..be058a8 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 _0xdca3=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','ChatApplication','find','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdca3,0x64));var _0x3dca=function(_0x2a9772,_0x22c9c6){_0x2a9772=_0x2a9772-0x0;var _0x51f364=_0xdca3[_0x2a9772];return _0x51f364;};'use strict';var emlformat=require(_0x3dca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dca('0x1'));var jsonpatch=require(_0x3dca('0x2'));var rp=require(_0x3dca('0x3'));var moment=require(_0x3dca('0x4'));var BPromise=require(_0x3dca('0x5'));var Mustache=require(_0x3dca('0x6'));var util=require(_0x3dca('0x7'));var path=require(_0x3dca('0x8'));var sox=require(_0x3dca('0x9'));var csv=require(_0x3dca('0xa'));var ejs=require(_0x3dca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3dca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3dca('0xa'));var querystring=require(_0x3dca('0xe'));var Papa=require(_0x3dca('0xf'));var Redis=require(_0x3dca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dca('0x11'));var as=require(_0x3dca('0x12'));var hardwareService=require(_0x3dca('0x13'));var logger=require(_0x3dca('0x14'))(_0x3dca('0x15'));var utils=require(_0x3dca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3dca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bfeda,_0x24c6c9){_0x24c6c9=_0x24c6c9||0xcc;return function(_0x11f54e){if(_0x11f54e){return _0x5bfeda[_0x3dca('0x18')](_0x24c6c9);}return _0x5bfeda[_0x3dca('0x19')](_0x24c6c9)[_0x3dca('0x1a')]();};}function respondWithResult(_0x344892,_0xa4149a){_0xa4149a=_0xa4149a||0xc8;return function(_0xf1350d){if(_0xf1350d){return _0x344892[_0x3dca('0x19')](_0xa4149a)[_0x3dca('0x1b')](_0xf1350d);}};}function respondWithFilteredResult(_0x3d1154,_0x911042){return function(_0x1b5906){if(_0x1b5906){var _0x5dc428=typeof _0x911042['offset']===_0x3dca('0x1c')&&typeof _0x911042[_0x3dca('0x1d')]===_0x3dca('0x1c');var _0x1a4ee=_0x1b5906[_0x3dca('0x1e')];var _0x8c046c=_0x5dc428?0x0:_0x911042['offset'];var _0x3a16b4=_0x5dc428?_0x1b5906[_0x3dca('0x1e')]:_0x911042[_0x3dca('0x1f')]+_0x911042[_0x3dca('0x1d')];var _0x4a3cd1;if(_0x3a16b4>=_0x1a4ee){_0x3a16b4=_0x1a4ee;_0x4a3cd1=0xc8;}else{_0x4a3cd1=0xce;}_0x3d1154[_0x3dca('0x19')](_0x4a3cd1);return _0x3d1154[_0x3dca('0x20')](_0x3dca('0x21'),_0x8c046c+'-'+_0x3a16b4+'/'+_0x1a4ee)['json'](_0x1b5906);}return null;};}function patchUpdates(_0x501201){return function(_0x4399ba){try{jsonpatch['apply'](_0x4399ba,_0x501201,!![]);}catch(_0x5f1ad3){return BPromise[_0x3dca('0x22')](_0x5f1ad3);}return _0x4399ba['save']();};}function saveUpdates(_0x4316b7,_0x592459){return function(_0x5b0dee){if(_0x5b0dee){return _0x5b0dee[_0x3dca('0x23')](_0x4316b7)[_0x3dca('0x24')](function(_0x439b6a){return _0x439b6a;});}return null;};}function removeEntity(_0x25f8e7,_0x59be49){return function(_0x18a452){if(_0x18a452){return _0x18a452[_0x3dca('0x25')]()[_0x3dca('0x24')](function(){_0x25f8e7['status'](0xcc)[_0x3dca('0x1a')]();});}};}function handleEntityNotFound(_0x3148ce,_0x4c2dd2){return function(_0x26a21b){if(!_0x26a21b){_0x3148ce[_0x3dca('0x18')](0x194);}return _0x26a21b;};}function handleError(_0x372b1e,_0x2580f6){_0x2580f6=_0x2580f6||0x1f4;return function(_0x3fd367){logger[_0x3dca('0x26')](_0x3fd367[_0x3dca('0x27')]);if(_0x3fd367[_0x3dca('0x28')]){delete _0x3fd367[_0x3dca('0x28')];}_0x372b1e[_0x3dca('0x19')](_0x2580f6)[_0x3dca('0x29')](_0x3fd367);};}exports[_0x3dca('0x2a')]=function(_0xa14500,_0x12560e){var _0x3d13f9={'raw':!![],'where':{'id':_0xa14500[_0x3dca('0x2b')]['id']}},_0x377c6e={};_0x377c6e[_0x3dca('0x2c')]=_[_0x3dca('0x2d')](db['ChatApplication'][_0x3dca('0x2e')]);_0x377c6e[_0x3dca('0x2f')]=_[_0x3dca('0x2d')](_0xa14500[_0x3dca('0x2f')]);_0x377c6e[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x377c6e[_0x3dca('0x2c')],_0x377c6e['query']);_0x3d13f9['attributes']=_['intersection'](_0x377c6e[_0x3dca('0x2c')],qs['fields'](_0xa14500[_0x3dca('0x2f')][_0x3dca('0x32')]));_0x3d13f9[_0x3dca('0x33')]=_0x3d13f9[_0x3dca('0x33')][_0x3dca('0x34')]?_0x3d13f9[_0x3dca('0x33')]:_0x377c6e[_0x3dca('0x2c')];if(_0xa14500[_0x3dca('0x2f')][_0x3dca('0x35')]){_0x3d13f9[_0x3dca('0x36')]=[{'all':!![]}];}_0x3d13f9=_[_0x3dca('0x37')]({},_0x3d13f9,_0xa14500['options']);return db[_0x3dca('0x38')][_0x3dca('0x39')](_0x3d13f9)[_0x3dca('0x24')](handleEntityNotFound(_0x12560e,null))[_0x3dca('0x24')](respondWithResult(_0x12560e,null))['catch'](handleError(_0x12560e,null));};exports[_0x3dca('0x23')]=function(_0x4fb281,_0x5713d9){if(_0x4fb281[_0x3dca('0x3a')]['id']){delete _0x4fb281[_0x3dca('0x3a')]['id'];}return db[_0x3dca('0x38')][_0x3dca('0x39')]({'where':{'id':_0x4fb281[_0x3dca('0x2b')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5713d9,null))['then'](saveUpdates(_0x4fb281[_0x3dca('0x3a')],null))[_0x3dca('0x24')](respondWithResult(_0x5713d9,null))[_0x3dca('0x3b')](handleError(_0x5713d9,null));};exports[_0x3dca('0x25')]=function(_0x430dc3,_0x4147d6){return db['ChatApplication'][_0x3dca('0x39')]({'where':{'id':_0x430dc3[_0x3dca('0x2b')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x4147d6,null))[_0x3dca('0x24')](removeEntity(_0x4147d6,null))[_0x3dca('0x3b')](handleError(_0x4147d6,null));}; \ No newline at end of file +var _0xd66c=['error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','set','Content-Range','reject','save','update','then','destroy','sendStatus'];(function(_0x2d899d,_0x50a985){var _0xa77840=function(_0x569e6a){while(--_0x569e6a){_0x2d899d['push'](_0x2d899d['shift']());}};_0xa77840(++_0x50a985);}(_0xd66c,0x106));var _0xcd66=function(_0x37e7f6,_0x26a83f){_0x37e7f6=_0x37e7f6-0x0;var _0x12cba3=_0xd66c[_0x37e7f6];return _0x12cba3;};'use strict';var emlformat=require(_0xcd66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd66('0x1'));var jsonpatch=require(_0xcd66('0x2'));var rp=require(_0xcd66('0x3'));var moment=require(_0xcd66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd66('0x5'));var util=require(_0xcd66('0x6'));var path=require(_0xcd66('0x7'));var sox=require(_0xcd66('0x8'));var csv=require(_0xcd66('0x9'));var ejs=require(_0xcd66('0xa'));var fs=require('fs');var fs_extra=require(_0xcd66('0xb'));var _=require(_0xcd66('0xc'));var squel=require('squel');var crypto=require(_0xcd66('0xd'));var jsforce=require(_0xcd66('0xe'));var deskjs=require(_0xcd66('0xf'));var toCsv=require(_0xcd66('0x9'));var querystring=require(_0xcd66('0x10'));var Papa=require(_0xcd66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd66('0x13'));var logger=require(_0xcd66('0x14'))('api');var utils=require(_0xcd66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd66('0x16'));var db=require(_0xcd66('0x17'))['db'];function respondWithStatusCode(_0x1cb4a9,_0x3e4e92){_0x3e4e92=_0x3e4e92||0xcc;return function(_0x35479d){if(_0x35479d){return _0x1cb4a9['sendStatus'](_0x3e4e92);}return _0x1cb4a9['status'](_0x3e4e92)[_0xcd66('0x18')]();};}function respondWithResult(_0x5d9bb4,_0x28ae0c){_0x28ae0c=_0x28ae0c||0xc8;return function(_0x588b46){if(_0x588b46){return _0x5d9bb4['status'](_0x28ae0c)[_0xcd66('0x19')](_0x588b46);}};}function respondWithFilteredResult(_0x1fafad,_0x4df4df){return function(_0x3178a7){if(_0x3178a7){var _0x3ed659=typeof _0x4df4df[_0xcd66('0x1a')]==='undefined'&&typeof _0x4df4df[_0xcd66('0x1b')]==='undefined';var _0x1268db=_0x3178a7[_0xcd66('0x1c')];var _0x191f8e=_0x3ed659?0x0:_0x4df4df[_0xcd66('0x1a')];var _0x35d431=_0x3ed659?_0x3178a7[_0xcd66('0x1c')]:_0x4df4df[_0xcd66('0x1a')]+_0x4df4df[_0xcd66('0x1b')];var _0x417907;if(_0x35d431>=_0x1268db){_0x35d431=_0x1268db;_0x417907=0xc8;}else{_0x417907=0xce;}_0x1fafad[_0xcd66('0x1d')](_0x417907);return _0x1fafad[_0xcd66('0x1e')](_0xcd66('0x1f'),_0x191f8e+'-'+_0x35d431+'/'+_0x1268db)[_0xcd66('0x19')](_0x3178a7);}return null;};}function patchUpdates(_0x2d3819){return function(_0x842033){try{jsonpatch['apply'](_0x842033,_0x2d3819,!![]);}catch(_0x3e3bea){return BPromise[_0xcd66('0x20')](_0x3e3bea);}return _0x842033[_0xcd66('0x21')]();};}function saveUpdates(_0x11c75c,_0x1cc184){return function(_0x1f8a04){if(_0x1f8a04){return _0x1f8a04[_0xcd66('0x22')](_0x11c75c)[_0xcd66('0x23')](function(_0x64424a){return _0x64424a;});}return null;};}function removeEntity(_0x35e19e,_0x5ec2d5){return function(_0x2ab69e){if(_0x2ab69e){return _0x2ab69e[_0xcd66('0x24')]()['then'](function(){_0x35e19e[_0xcd66('0x1d')](0xcc)[_0xcd66('0x18')]();});}};}function handleEntityNotFound(_0xb37e77,_0x526e13){return function(_0x141a64){if(!_0x141a64){_0xb37e77[_0xcd66('0x25')](0x194);}return _0x141a64;};}function handleError(_0x3de898,_0x54ac81){_0x54ac81=_0x54ac81||0x1f4;return function(_0x12891d){logger[_0xcd66('0x26')](_0x12891d[_0xcd66('0x27')]);if(_0x12891d[_0xcd66('0x28')]){delete _0x12891d[_0xcd66('0x28')];}_0x3de898[_0xcd66('0x1d')](_0x54ac81)[_0xcd66('0x29')](_0x12891d);};}exports[_0xcd66('0x2a')]=function(_0x51201f,_0xb6d828){var _0x51a7f6={'raw':!![],'where':{'id':_0x51201f[_0xcd66('0x2b')]['id']}},_0x2506d3={};_0x2506d3[_0xcd66('0x2c')]=_[_0xcd66('0x2d')](db[_0xcd66('0x2e')][_0xcd66('0x2f')]);_0x2506d3['query']=_[_0xcd66('0x2d')](_0x51201f[_0xcd66('0x30')]);_0x2506d3[_0xcd66('0x31')]=_[_0xcd66('0x32')](_0x2506d3['model'],_0x2506d3[_0xcd66('0x30')]);_0x51a7f6[_0xcd66('0x33')]=_[_0xcd66('0x32')](_0x2506d3[_0xcd66('0x2c')],qs[_0xcd66('0x34')](_0x51201f['query'][_0xcd66('0x34')]));_0x51a7f6[_0xcd66('0x33')]=_0x51a7f6[_0xcd66('0x33')][_0xcd66('0x35')]?_0x51a7f6['attributes']:_0x2506d3['model'];if(_0x51201f[_0xcd66('0x30')]['includeAll']){_0x51a7f6[_0xcd66('0x36')]=[{'all':!![]}];}_0x51a7f6=_[_0xcd66('0x37')]({},_0x51a7f6,_0x51201f[_0xcd66('0x38')]);return db[_0xcd66('0x2e')][_0xcd66('0x39')](_0x51a7f6)[_0xcd66('0x23')](handleEntityNotFound(_0xb6d828,null))[_0xcd66('0x23')](respondWithResult(_0xb6d828,null))['catch'](handleError(_0xb6d828,null));};exports[_0xcd66('0x22')]=function(_0x366fb2,_0x37f17a){if(_0x366fb2[_0xcd66('0x3a')]['id']){delete _0x366fb2['body']['id'];}return db[_0xcd66('0x2e')][_0xcd66('0x39')]({'where':{'id':_0x366fb2[_0xcd66('0x2b')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x37f17a,null))[_0xcd66('0x23')](saveUpdates(_0x366fb2[_0xcd66('0x3a')],null))[_0xcd66('0x23')](respondWithResult(_0x37f17a,null))[_0xcd66('0x3b')](handleError(_0x37f17a,null));};exports[_0xcd66('0x24')]=function(_0x1f3821,_0x218b7d){return db[_0xcd66('0x2e')][_0xcd66('0x39')]({'where':{'id':_0x1f3821[_0xcd66('0x2b')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x218b7d,null))[_0xcd66('0x23')](removeEntity(_0x218b7d,null))[_0xcd66('0x3b')](handleError(_0x218b7d,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e2f1188..1544f14 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 _0x625b=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','lodash','util','../../config/logger','api','moment'];(function(_0x216b8a,_0x459a11){var _0x344626=function(_0x27c690){while(--_0x27c690){_0x216b8a['push'](_0x216b8a['shift']());}};_0x344626(++_0x459a11);}(_0x625b,0x121));var _0xb625=function(_0x5a3d77,_0x1e1898){_0x5a3d77=_0x5a3d77-0x0;var _0x40e312=_0x625b[_0x5a3d77];return _0x40e312;};'use strict';var _=require(_0xb625('0x0'));var util=require(_0xb625('0x1'));var logger=require(_0xb625('0x2'))(_0xb625('0x3'));var moment=require(_0xb625('0x4'));var BPromise=require(_0xb625('0x5'));var rp=require(_0xb625('0x6'));var fs=require('fs');var path=require(_0xb625('0x7'));var rimraf=require(_0xb625('0x8'));var config=require(_0xb625('0x9'));var attributes=require(_0xb625('0xa'));module[_0xb625('0xb')]=function(_0x98fac0,_0x1a67d9){return _0x98fac0[_0xb625('0xc')](_0xb625('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb4b6=['api','moment','request-promise','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0xb4b6,0x115));var _0x6b4b=function(_0x5324c9,_0x1cdc42){_0x5324c9=_0x5324c9-0x0;var _0x137b3b=_0xb4b6[_0x5324c9];return _0x137b3b;};'use strict';var _=require(_0x6b4b('0x0'));var util=require(_0x6b4b('0x1'));var logger=require(_0x6b4b('0x2'))(_0x6b4b('0x3'));var moment=require(_0x6b4b('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b4b('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b4b('0x7'));module[_0x6b4b('0x8')]=function(_0x4fa770,_0x372308){return _0x4fa770[_0x6b4b('0x9')](_0x6b4b('0xa'),attributes,{'tableName':_0x6b4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b4b('0xc'),'collate':_0x6b4b('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 1fa8952..38b0927 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 _0x2047=['rpc','../../config/environment','jayson/promise','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1019d9,_0x24c81f){var _0x403e4e=function(_0x5ab52e){while(--_0x5ab52e){_0x1019d9['push'](_0x1019d9['shift']());}};_0x403e4e(++_0x24c81f);}(_0x2047,0x81));var _0x7204=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2047[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7204('0x0'));var util=require(_0x7204('0x1'));var moment=require(_0x7204('0x2'));var BPromise=require(_0x7204('0x3'));var rs=require(_0x7204('0x4'));var fs=require('fs');var Redis=require(_0x7204('0x5'));var db=require(_0x7204('0x6'))['db'];var utils=require(_0x7204('0x7'));var logger=require(_0x7204('0x8'))(_0x7204('0x9'));var config=require(_0x7204('0xa'));var jayson=require(_0x7204('0xb'));var client=jayson['client'][_0x7204('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10545a,_0x2e8875,_0x44dbc9){return new BPromise(function(_0x4ca6c5,_0x473399){return client[_0x7204('0xd')](_0x10545a,_0x44dbc9)['then'](function(_0x2fa61a){logger[_0x7204('0xe')](_0x7204('0xf'),_0x2e8875,_0x7204('0x10'));logger[_0x7204('0x11')](_0x7204('0x12'),_0x2e8875,_0x7204('0x10'),JSON['stringify'](_0x2fa61a));if(_0x2fa61a[_0x7204('0x13')]){if(_0x2fa61a[_0x7204('0x13')][_0x7204('0x14')]===0x1f4){logger['error'](_0x7204('0xf'),_0x2e8875,_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);return _0x473399(_0x2fa61a['error'][_0x7204('0x15')]);}logger[_0x7204('0x13')](_0x7204('0xf'),_0x2e8875,_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);return _0x4ca6c5(_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);}else{logger[_0x7204('0xe')](_0x7204('0xf'),_0x2e8875,'request\x20sent');_0x4ca6c5(_0x2fa61a['result'][_0x7204('0x15')]);}})[_0x7204('0x16')](function(_0x382e6e){logger[_0x7204('0x13')](_0x7204('0xf'),_0x2e8875,_0x382e6e);_0x473399(_0x382e6e);});});} \ No newline at end of file +var _0x8cb7=['../../mysqldb','../../config/logger','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis'];(function(_0x12c1f1,_0x7829e2){var _0x42efaf=function(_0x4b7152){while(--_0x4b7152){_0x12c1f1['push'](_0x12c1f1['shift']());}};_0x42efaf(++_0x7829e2);}(_0x8cb7,0x164));var _0x78cb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8cb7[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x78cb('0x0'));var util=require(_0x78cb('0x1'));var moment=require(_0x78cb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78cb('0x3'));var db=require(_0x78cb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x78cb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78cb('0x6'));var client=jayson[_0x78cb('0x7')][_0x78cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f1de8,_0x4b2259,_0x59a652){return new BPromise(function(_0x4ba636,_0x22dc1a){return client['request'](_0x1f1de8,_0x59a652)[_0x78cb('0x9')](function(_0xc9306e){logger['info'](_0x78cb('0xa'),_0x4b2259,_0x78cb('0xb'));logger['debug'](_0x78cb('0xc'),_0x4b2259,_0x78cb('0xb'),JSON[_0x78cb('0xd')](_0xc9306e));if(_0xc9306e[_0x78cb('0xe')]){if(_0xc9306e[_0x78cb('0xe')][_0x78cb('0xf')]===0x1f4){logger[_0x78cb('0xe')](_0x78cb('0xa'),_0x4b2259,_0xc9306e[_0x78cb('0xe')][_0x78cb('0x10')]);return _0x22dc1a(_0xc9306e[_0x78cb('0xe')][_0x78cb('0x10')]);}logger[_0x78cb('0xe')](_0x78cb('0xa'),_0x4b2259,_0xc9306e[_0x78cb('0xe')]['message']);return _0x4ba636(_0xc9306e[_0x78cb('0xe')][_0x78cb('0x10')]);}else{logger[_0x78cb('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4b2259,'request\x20sent');_0x4ba636(_0xc9306e[_0x78cb('0x12')][_0x78cb('0x10')]);}})[_0x78cb('0x13')](function(_0x44afab){logger['error'](_0x78cb('0xa'),_0x4b2259,_0x44afab);_0x22dc1a(_0x44afab);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3d20ea2..f7164ed 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 _0x97d0=['./chatApplication.controller','/:id','isAuthenticated','show','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45bfa1,_0x479201){var _0x32c4ae=function(_0x49ba26){while(--_0x49ba26){_0x45bfa1['push'](_0x45bfa1['shift']());}};_0x32c4ae(++_0x479201);}(_0x97d0,0xb7));var _0x097d=function(_0x1c6f0e,_0x16838a){_0x1c6f0e=_0x1c6f0e-0x0;var _0x34b778=_0x97d0[_0x1c6f0e];return _0x34b778;};'use strict';var multer=require(_0x097d('0x0'));var util=require(_0x097d('0x1'));var path=require('path');var timeout=require(_0x097d('0x2'));var express=require(_0x097d('0x3'));var router=express[_0x097d('0x4')]();var fs_extra=require(_0x097d('0x5'));var auth=require(_0x097d('0x6'));var interaction=require(_0x097d('0x7'));var config=require(_0x097d('0x8'));var controller=require(_0x097d('0x9'));router['get'](_0x097d('0xa'),auth[_0x097d('0xb')](),controller[_0x097d('0xc')]);router[_0x097d('0xd')]('/:id',auth[_0x097d('0xb')](),controller[_0x097d('0xe')]);router['delete'](_0x097d('0xa'),auth[_0x097d('0xb')](),controller[_0x097d('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0bd1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x0bd1,0xbc));var _0x10bd=function(_0x36fa31,_0x33ddeb){_0x36fa31=_0x36fa31-0x0;var _0x191e7d=_0x0bd1[_0x36fa31];return _0x191e7d;};'use strict';var multer=require(_0x10bd('0x0'));var util=require(_0x10bd('0x1'));var path=require(_0x10bd('0x2'));var timeout=require(_0x10bd('0x3'));var express=require(_0x10bd('0x4'));var router=express[_0x10bd('0x5')]();var fs_extra=require(_0x10bd('0x6'));var auth=require(_0x10bd('0x7'));var interaction=require(_0x10bd('0x8'));var config=require('../../config/environment');var controller=require(_0x10bd('0x9'));router[_0x10bd('0xa')](_0x10bd('0xb'),auth[_0x10bd('0xc')](),controller[_0x10bd('0xd')]);router[_0x10bd('0xe')](_0x10bd('0xb'),auth[_0x10bd('0xc')](),controller[_0x10bd('0xf')]);router[_0x10bd('0x10')](_0x10bd('0xb'),auth[_0x10bd('0xc')](),controller[_0x10bd('0x11')]);module[_0x10bd('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c54fed1..d1ccc2a 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 _0x4c6a=['sequelize','exports','STRING'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x428042,_0x52a4f2){_0x428042=_0x428042-0x0;var _0x81c7b9=_0x4c6a[_0x428042];return _0x81c7b9;};'use strict';var Sequelize=require(_0xa4c6('0x0'));module[_0xa4c6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa4c6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6219=['sequelize','exports','STRING','BOOLEAN'];(function(_0x10636a,_0x385890){var _0x59820b=function(_0x2724a6){while(--_0x2724a6){_0x10636a['push'](_0x10636a['shift']());}};_0x59820b(++_0x385890);}(_0x6219,0xc4));var _0x9621=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0x6219[_0x1663ae];return _0x30ffb8;};'use strict';var Sequelize=require(_0x9621('0x0'));module[_0x9621('0x1')]={'name':{'type':Sequelize[_0x9621('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9621('0x2')]},'write':{'type':Sequelize[_0x9621('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 19ef54e..c72d008 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 _0x8f64=['error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','omit','ids','getMembers','findOne','User','filter','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','./chatGroup.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x2ec3b9,_0x30d14a){var _0x30a43f=function(_0x51bd25){while(--_0x51bd25){_0x2ec3b9['push'](_0x2ec3b9['shift']());}};_0x30a43f(++_0x30d14a);}(_0x8f64,0x1be));var _0x48f6=function(_0x30e1ab,_0x1caf0f){_0x30e1ab=_0x30e1ab-0x0;var _0x40deaa=_0x8f64[_0x30e1ab];return _0x40deaa;};'use strict';var emlformat=require(_0x48f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48f6('0x1'));var jsonpatch=require(_0x48f6('0x2'));var rp=require(_0x48f6('0x3'));var moment=require(_0x48f6('0x4'));var BPromise=require(_0x48f6('0x5'));var Mustache=require(_0x48f6('0x6'));var util=require(_0x48f6('0x7'));var path=require(_0x48f6('0x8'));var sox=require(_0x48f6('0x9'));var csv=require(_0x48f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x48f6('0xc'));var jsforce=require(_0x48f6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x48f6('0xe'));var Papa=require(_0x48f6('0xf'));var Redis=require(_0x48f6('0x10'));var authService=require(_0x48f6('0x11'));var qs=require(_0x48f6('0x12'));var as=require(_0x48f6('0x13'));var hardwareService=require(_0x48f6('0x14'));var logger=require('../../config/logger')(_0x48f6('0x15'));var utils=require(_0x48f6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48f6('0x17'))['db'];config[_0x48f6('0x18')]=_['defaults'](config[_0x48f6('0x18')],{'host':_0x48f6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48f6('0x18')]));require(_0x48f6('0x1a'))[_0x48f6('0x1b')](socket);function respondWithStatusCode(_0x34f926,_0x2086b2){_0x2086b2=_0x2086b2||0xcc;return function(_0x69e8fb){if(_0x69e8fb){return _0x34f926['sendStatus'](_0x2086b2);}return _0x34f926[_0x48f6('0x1c')](_0x2086b2)[_0x48f6('0x1d')]();};}function respondWithResult(_0x569d24,_0x31a2d8){_0x31a2d8=_0x31a2d8||0xc8;return function(_0x179596){if(_0x179596){return _0x569d24['status'](_0x31a2d8)['json'](_0x179596);}};}function respondWithFilteredResult(_0x39bfaf,_0x17b2b6){return function(_0x5ce8c4){if(_0x5ce8c4){var _0x3d4e3c=typeof _0x17b2b6[_0x48f6('0x1e')]===_0x48f6('0x1f')&&typeof _0x17b2b6[_0x48f6('0x20')]==='undefined';var _0x235ee2=_0x5ce8c4[_0x48f6('0x21')];var _0x50671a=_0x3d4e3c?0x0:_0x17b2b6[_0x48f6('0x1e')];var _0x411d7b=_0x3d4e3c?_0x5ce8c4[_0x48f6('0x21')]:_0x17b2b6['offset']+_0x17b2b6[_0x48f6('0x20')];var _0x560131;if(_0x411d7b>=_0x235ee2){_0x411d7b=_0x235ee2;_0x560131=0xc8;}else{_0x560131=0xce;}_0x39bfaf[_0x48f6('0x1c')](_0x560131);return _0x39bfaf[_0x48f6('0x22')](_0x48f6('0x23'),_0x50671a+'-'+_0x411d7b+'/'+_0x235ee2)[_0x48f6('0x24')](_0x5ce8c4);}return null;};}function patchUpdates(_0x9b356b){return function(_0x1805b7){try{jsonpatch[_0x48f6('0x25')](_0x1805b7,_0x9b356b,!![]);}catch(_0x3ec460){return BPromise[_0x48f6('0x26')](_0x3ec460);}return _0x1805b7[_0x48f6('0x27')]();};}function saveUpdates(_0x596d43,_0x3627b9){return function(_0xb9b66a){if(_0xb9b66a){return _0xb9b66a[_0x48f6('0x28')](_0x596d43)[_0x48f6('0x29')](function(_0x2381ba){return _0x2381ba;});}return null;};}function removeEntity(_0x3064c2,_0x40b064){return function(_0x2e70cd){if(_0x2e70cd){return _0x2e70cd[_0x48f6('0x2a')]()[_0x48f6('0x29')](function(){_0x3064c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a93b9,_0x2bcf42){return function(_0x513d15){if(!_0x513d15){_0x3a93b9[_0x48f6('0x2b')](0x194);}return _0x513d15;};}function handleError(_0x5b8a0d,_0x11d062){_0x11d062=_0x11d062||0x1f4;return function(_0x567354){logger[_0x48f6('0x2c')](_0x567354['stack']);if(_0x567354[_0x48f6('0x2d')]){delete _0x567354[_0x48f6('0x2d')];}_0x5b8a0d['status'](_0x11d062)[_0x48f6('0x2e')](_0x567354);};}exports[_0x48f6('0x2f')]=function(_0x2cc040,_0x3ad2fd){var _0x42c76b={},_0xcd82a6={},_0x30024f={'count':0x0,'rows':[]};var _0x359ecf=_[_0x48f6('0x30')](db[_0x48f6('0x31')][_0x48f6('0x32')],function(_0x58f5fa){return{'name':_0x58f5fa[_0x48f6('0x33')],'type':_0x58f5fa['type'][_0x48f6('0x34')]};});_0xcd82a6[_0x48f6('0x35')]=_[_0x48f6('0x30')](_0x359ecf,_0x48f6('0x2d'));_0xcd82a6['query']=_[_0x48f6('0x36')](_0x2cc040[_0x48f6('0x37')]);_0xcd82a6['filters']=_[_0x48f6('0x38')](_0xcd82a6['model'],_0xcd82a6[_0x48f6('0x37')]);_0x42c76b['attributes']=_[_0x48f6('0x38')](_0xcd82a6['model'],qs[_0x48f6('0x39')](_0x2cc040[_0x48f6('0x37')]['fields']));_0x42c76b[_0x48f6('0x3a')]=_0x42c76b['attributes'][_0x48f6('0x3b')]?_0x42c76b['attributes']:_0xcd82a6['model'];if(!_0x2cc040[_0x48f6('0x37')]['hasOwnProperty'](_0x48f6('0x3c'))){_0x42c76b[_0x48f6('0x20')]=qs[_0x48f6('0x20')](_0x2cc040[_0x48f6('0x37')][_0x48f6('0x20')]);_0x42c76b[_0x48f6('0x1e')]=qs['offset'](_0x2cc040[_0x48f6('0x37')][_0x48f6('0x1e')]);}_0x42c76b[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0x2cc040['query'][_0x48f6('0x3e')]);_0x42c76b[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0x2cc040[_0x48f6('0x37')],_0xcd82a6['filters']),_0x359ecf);if(_0x2cc040['query']['filter']){_0x42c76b[_0x48f6('0x3f')]=_[_0x48f6('0x42')](_0x42c76b[_0x48f6('0x3f')],{'$or':_['map'](_0x359ecf,function(_0x4ea97a){if(_0x4ea97a[_0x48f6('0x43')]!==_0x48f6('0x44')){var _0x4aa905={};_0x4aa905[_0x4ea97a['name']]={'$like':'%'+_0x2cc040[_0x48f6('0x37')]['filter']+'%'};return _0x4aa905;}})});}_0x42c76b=_[_0x48f6('0x42')]({},_0x42c76b,_0x2cc040[_0x48f6('0x45')]);var _0x531915={'where':_0x42c76b[_0x48f6('0x3f')]};return db['ChatGroup']['count'](_0x531915)['then'](function(_0x5741cf){_0x30024f[_0x48f6('0x21')]=_0x5741cf;if(_0x2cc040[_0x48f6('0x37')]['includeAll']){_0x42c76b[_0x48f6('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x42c76b);})[_0x48f6('0x29')](function(_0x6c7651){_0x30024f[_0x48f6('0x47')]=_0x6c7651;return _0x30024f;})['then'](respondWithFilteredResult(_0x3ad2fd,_0x42c76b))[_0x48f6('0x48')](handleError(_0x3ad2fd,null));};exports[_0x48f6('0x49')]=function(_0x1d5d8a,_0x3f2b63){var _0x4e2a8c={'raw':!![],'where':{'id':_0x1d5d8a[_0x48f6('0x4a')]['id']}},_0x43a52a={};_0x43a52a[_0x48f6('0x35')]=_[_0x48f6('0x36')](db[_0x48f6('0x31')][_0x48f6('0x32')]);_0x43a52a[_0x48f6('0x37')]=_[_0x48f6('0x36')](_0x1d5d8a[_0x48f6('0x37')]);_0x43a52a['filters']=_[_0x48f6('0x38')](_0x43a52a[_0x48f6('0x35')],_0x43a52a[_0x48f6('0x37')]);_0x4e2a8c[_0x48f6('0x3a')]=_[_0x48f6('0x38')](_0x43a52a[_0x48f6('0x35')],qs[_0x48f6('0x39')](_0x1d5d8a[_0x48f6('0x37')]['fields']));_0x4e2a8c['attributes']=_0x4e2a8c[_0x48f6('0x3a')][_0x48f6('0x3b')]?_0x4e2a8c[_0x48f6('0x3a')]:_0x43a52a[_0x48f6('0x35')];if(_0x1d5d8a['query'][_0x48f6('0x4b')]){_0x4e2a8c[_0x48f6('0x46')]=[{'all':!![]}];}_0x4e2a8c=_['merge']({},_0x4e2a8c,_0x1d5d8a['options']);return db[_0x48f6('0x31')][_0x48f6('0x4c')](_0x4e2a8c)[_0x48f6('0x29')](handleEntityNotFound(_0x3f2b63,null))[_0x48f6('0x29')](respondWithResult(_0x3f2b63,null))[_0x48f6('0x48')](handleError(_0x3f2b63,null));};exports[_0x48f6('0x4d')]=function(_0x43655b,_0x322013){return db['ChatGroup'][_0x48f6('0x4d')](_0x43655b[_0x48f6('0x4e')],{})[_0x48f6('0x29')](respondWithResult(_0x322013,0xc9))[_0x48f6('0x48')](handleError(_0x322013,null));};exports[_0x48f6('0x28')]=function(_0x61d642,_0x31ff62){if(_0x61d642[_0x48f6('0x4e')]['id']){delete _0x61d642['body']['id'];}return db['ChatGroup'][_0x48f6('0x4c')]({'where':{'id':_0x61d642[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x31ff62,null))[_0x48f6('0x29')](saveUpdates(_0x61d642[_0x48f6('0x4e')],null))[_0x48f6('0x29')](respondWithResult(_0x31ff62,null))[_0x48f6('0x48')](handleError(_0x31ff62,null));};exports['destroy']=function(_0x4af4f8,_0x285e32){return db['ChatGroup']['find']({'where':{'id':_0x4af4f8[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x285e32,null))[_0x48f6('0x29')](removeEntity(_0x285e32,null))['catch'](handleError(_0x285e32,null));};exports[_0x48f6('0x4f')]=function(_0x4949b7,_0x1bfa35){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x1bfa35,null))[_0x48f6('0x48')](handleError(_0x1bfa35,null));};exports[_0x48f6('0x50')]=function(_0x558407,_0x408012,_0x4ffb60){return db[_0x48f6('0x51')][_0x48f6('0x21')]({'where':{'ChatGroupId':_0x558407['params']['id'],'ToId':_0x558407[_0x48f6('0x52')]['id'],'read':![]}})[_0x48f6('0x29')](function(_0x2cae28){return{'id':_[_0x48f6('0x53')](_0x558407[_0x48f6('0x4a')]['id']),'count':_0x2cae28};})[_0x48f6('0x29')](respondWithResult(_0x408012,null))['catch'](handleError(_0x408012,null));};exports['addMembers']=function(_0x448d71,_0x2927e3,_0x5ef4b1){return db['ChatGroup'][_0x48f6('0x4c')]({'where':{'id':_0x448d71['params']['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x2927e3,null))['then'](function(_0x1c2b86){if(_0x1c2b86){return _0x1c2b86['addMembers'](_0x448d71[_0x48f6('0x4e')]['ids'],_[_0x48f6('0x54')](_0x448d71[_0x48f6('0x4e')],[_0x48f6('0x55'),'id'])||{});}})[_0x48f6('0x29')](respondWithResult(_0x2927e3,null))[_0x48f6('0x48')](handleError(_0x2927e3,null));};exports[_0x48f6('0x56')]=function(_0xb678bf,_0x5e3eb9,_0x586d5a){var _0x5ecebb={};var _0x47a882={};var _0x45daee;var _0x150d78;return db[_0x48f6('0x31')][_0x48f6('0x57')]({'where':{'id':_0xb678bf[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x5e3eb9,null))['then'](function(_0x202a96){if(_0x202a96){_0x45daee=_0x202a96;_0x47a882['model']=_['keys'](db[_0x48f6('0x58')][_0x48f6('0x32')]);_0x47a882[_0x48f6('0x37')]=_[_0x48f6('0x36')](_0xb678bf['query']);_0x47a882[_0x48f6('0x40')]=_[_0x48f6('0x38')](_0x47a882['model'],_0x47a882[_0x48f6('0x37')]);_0x5ecebb[_0x48f6('0x3a')]=_[_0x48f6('0x38')](_0x47a882[_0x48f6('0x35')],qs[_0x48f6('0x39')](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x39')]));_0x5ecebb[_0x48f6('0x3a')]=_0x5ecebb['attributes']['length']?_0x5ecebb['attributes']:_0x47a882['model'];_0x5ecebb[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0xb678bf['query'][_0x48f6('0x3e')]);_0x5ecebb[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0xb678bf[_0x48f6('0x37')],_0x47a882[_0x48f6('0x40')]));if(_0xb678bf[_0x48f6('0x37')][_0x48f6('0x59')]){_0x5ecebb['where']=_['merge'](_0x5ecebb[_0x48f6('0x3f')],{'$or':_['map'](_0x5ecebb[_0x48f6('0x3a')],function(_0x2a38ce){var _0x559527={};_0x559527[_0x2a38ce]={'$like':'%'+_0xb678bf['query']['filter']+'%'};return _0x559527;})});}_0x5ecebb=_[_0x48f6('0x42')]({},_0x5ecebb,_0xb678bf[_0x48f6('0x45')]);return _0x45daee[_0x48f6('0x56')](_0x5ecebb);}})[_0x48f6('0x29')](function(_0x1ec7f1){if(_0x1ec7f1){_0x150d78=_0x1ec7f1[_0x48f6('0x3b')];if(!_0xb678bf[_0x48f6('0x37')][_0x48f6('0x5a')](_0x48f6('0x3c'))){_0x5ecebb[_0x48f6('0x20')]=qs[_0x48f6('0x20')](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x20')]);_0x5ecebb['offset']=qs['offset'](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x1e')]);}return _0x45daee[_0x48f6('0x56')](_0x5ecebb);}})[_0x48f6('0x29')](function(_0x59af26){if(_0x59af26){return _0x59af26?{'count':_0x150d78,'rows':_0x59af26}:null;}})[_0x48f6('0x29')](respondWithResult(_0x5e3eb9,null))['catch'](handleError(_0x5e3eb9,null));};exports[_0x48f6('0x5b')]=function(_0x1ad747,_0x1fe954,_0x4e1678){return db[_0x48f6('0x31')][_0x48f6('0x4c')]({'where':{'id':_0x1ad747[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x1fe954,null))['then'](function(_0x27dae5){if(_0x27dae5){return _0x27dae5[_0x48f6('0x5b')](_0x1ad747[_0x48f6('0x37')][_0x48f6('0x55')]);}})['then'](respondWithStatusCode(_0x1fe954,null))[_0x48f6('0x48')](handleError(_0x1fe954,null));};exports[_0x48f6('0x5c')]=function(_0x1b6e36,_0x549231,_0x43eb0c){if(_0x1b6e36[_0x48f6('0x4e')]['id']){delete _0x1b6e36[_0x48f6('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1b6e36[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x549231,null))[_0x48f6('0x29')](function(_0x328819){if(_0x328819){_0x1b6e36['body'][_0x48f6('0x5d')]=_0x328819['id'];return db[_0x48f6('0x51')][_0x48f6('0x4d')](_0x1b6e36[_0x48f6('0x4e')]);}})[_0x48f6('0x29')](respondWithResult(_0x549231,null))[_0x48f6('0x48')](handleError(_0x549231,null));};exports[_0x48f6('0x5e')]=function(_0x3e780d,_0xb0e0fb,_0x5e3eb0){var _0x241e96={};var _0x57dbd7={};var _0x19d731;var _0x3a9fb8;return db[_0x48f6('0x31')][_0x48f6('0x57')]({'where':{'id':_0x3e780d[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0xb0e0fb,null))[_0x48f6('0x29')](function(_0x16f551){if(_0x16f551){_0x19d731=_0x16f551;_0x57dbd7[_0x48f6('0x35')]=_[_0x48f6('0x36')](db[_0x48f6('0x51')][_0x48f6('0x32')]);_0x57dbd7[_0x48f6('0x37')]=_['keys'](_0x3e780d['query']);_0x57dbd7[_0x48f6('0x40')]=_[_0x48f6('0x38')](_0x57dbd7[_0x48f6('0x35')],_0x57dbd7[_0x48f6('0x37')]);_0x241e96['attributes']=_[_0x48f6('0x38')](_0x57dbd7[_0x48f6('0x35')],qs['fields'](_0x3e780d[_0x48f6('0x37')]['fields']));_0x241e96['attributes']=_0x241e96[_0x48f6('0x3a')][_0x48f6('0x3b')]?_0x241e96['attributes']:_0x57dbd7['model'];_0x241e96[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x3e')]);_0x241e96[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0x3e780d[_0x48f6('0x37')],_0x57dbd7['filters']));if(_0x3e780d[_0x48f6('0x37')][_0x48f6('0x59')]){_0x241e96['where']=_[_0x48f6('0x42')](_0x241e96[_0x48f6('0x3f')],{'$or':_[_0x48f6('0x30')](_0x241e96['attributes'],function(_0x2b933d){var _0x1b046c={};_0x1b046c[_0x2b933d]={'$like':'%'+_0x3e780d[_0x48f6('0x37')]['filter']+'%'};return _0x1b046c;})});}if(_0x3e780d[_0x48f6('0x37')]['$gte']){var _0x488a63=_0x3e780d[_0x48f6('0x37')][_0x48f6('0x5f')][_0x48f6('0x60')](',');var _0x414381={};_0x414381[_0x488a63[0x0]]={'$gte':moment(_0x488a63[0x1])[_0x48f6('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x241e96[_0x48f6('0x3f')]=_[_0x48f6('0x42')](_0x241e96[_0x48f6('0x3f')],_0x414381);}_0x241e96=_[_0x48f6('0x42')]({},_0x241e96,_0x3e780d[_0x48f6('0x45')]);return _0x19d731[_0x48f6('0x5e')](_0x241e96);}})[_0x48f6('0x29')](function(_0x337ab1){if(_0x337ab1){_0x3a9fb8=_0x337ab1[_0x48f6('0x3b')];if(!_0x3e780d[_0x48f6('0x37')][_0x48f6('0x5a')](_0x48f6('0x3c'))){_0x241e96[_0x48f6('0x20')]=qs['limit'](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x20')]);_0x241e96[_0x48f6('0x1e')]=qs[_0x48f6('0x1e')](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x1e')]);}return _0x19d731['getMessages'](_0x241e96);}})['then'](function(_0x37e995){if(_0x37e995){return _0x37e995?{'count':_0x3a9fb8,'rows':_0x37e995}:null;}})['then'](respondWithResult(_0xb0e0fb,null))['catch'](handleError(_0xb0e0fb,null));}; \ No newline at end of file +var _0xec2d=['pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','catch','show','params','fields','length','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','sendStatus','status','end','json','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where'];(function(_0x3c9b74,_0x22decf){var _0x1c5906=function(_0x470d4f){while(--_0x470d4f){_0x3c9b74['push'](_0x3c9b74['shift']());}};_0x1c5906(++_0x22decf);}(_0xec2d,0x81));var _0xdec2=function(_0xbc1d37,_0x7ed97b){_0xbc1d37=_0xbc1d37-0x0;var _0x24544a=_0xec2d[_0xbc1d37];return _0x24544a;};'use strict';var emlformat=require(_0xdec2('0x0'));var rimraf=require(_0xdec2('0x1'));var zipdir=require(_0xdec2('0x2'));var jsonpatch=require(_0xdec2('0x3'));var rp=require(_0xdec2('0x4'));var moment=require('moment');var BPromise=require(_0xdec2('0x5'));var Mustache=require(_0xdec2('0x6'));var util=require(_0xdec2('0x7'));var path=require(_0xdec2('0x8'));var sox=require(_0xdec2('0x9'));var csv=require('to-csv');var ejs=require(_0xdec2('0xa'));var fs=require('fs');var fs_extra=require(_0xdec2('0xb'));var _=require(_0xdec2('0xc'));var squel=require(_0xdec2('0xd'));var crypto=require(_0xdec2('0xe'));var jsforce=require(_0xdec2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdec2('0x10'));var querystring=require(_0xdec2('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdec2('0x12'));var qs=require(_0xdec2('0x13'));var as=require(_0xdec2('0x14'));var hardwareService=require(_0xdec2('0x15'));var logger=require(_0xdec2('0x16'))('api');var utils=require(_0xdec2('0x17'));var config=require(_0xdec2('0x18'));var licenseUtil=require(_0xdec2('0x19'));var db=require('../../mysqldb')['db'];config[_0xdec2('0x1a')]=_[_0xdec2('0x1b')](config[_0xdec2('0x1a')],{'host':_0xdec2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdec2('0x1a')]));require(_0xdec2('0x1d'))['register'](socket);function respondWithStatusCode(_0x59ac06,_0x2490af){_0x2490af=_0x2490af||0xcc;return function(_0xfd524d){if(_0xfd524d){return _0x59ac06[_0xdec2('0x1e')](_0x2490af);}return _0x59ac06[_0xdec2('0x1f')](_0x2490af)[_0xdec2('0x20')]();};}function respondWithResult(_0x4eeeb2,_0x28640e){_0x28640e=_0x28640e||0xc8;return function(_0x2a40a8){if(_0x2a40a8){return _0x4eeeb2[_0xdec2('0x1f')](_0x28640e)[_0xdec2('0x21')](_0x2a40a8);}};}function respondWithFilteredResult(_0x50fae1,_0xa1b645){return function(_0x1de964){if(_0x1de964){var _0x243699=typeof _0xa1b645['offset']==='undefined'&&typeof _0xa1b645[_0xdec2('0x22')]==='undefined';var _0x40a4ce=_0x1de964['count'];var _0x5501b8=_0x243699?0x0:_0xa1b645[_0xdec2('0x23')];var _0x3746b2=_0x243699?_0x1de964[_0xdec2('0x24')]:_0xa1b645['offset']+_0xa1b645[_0xdec2('0x22')];var _0x23747d;if(_0x3746b2>=_0x40a4ce){_0x3746b2=_0x40a4ce;_0x23747d=0xc8;}else{_0x23747d=0xce;}_0x50fae1[_0xdec2('0x1f')](_0x23747d);return _0x50fae1[_0xdec2('0x25')](_0xdec2('0x26'),_0x5501b8+'-'+_0x3746b2+'/'+_0x40a4ce)[_0xdec2('0x21')](_0x1de964);}return null;};}function patchUpdates(_0x5a1825){return function(_0x424383){try{jsonpatch[_0xdec2('0x27')](_0x424383,_0x5a1825,!![]);}catch(_0x47e7a1){return BPromise[_0xdec2('0x28')](_0x47e7a1);}return _0x424383['save']();};}function saveUpdates(_0x1dec1b,_0x5e0aae){return function(_0x37267f){if(_0x37267f){return _0x37267f[_0xdec2('0x29')](_0x1dec1b)[_0xdec2('0x2a')](function(_0x44bebb){return _0x44bebb;});}return null;};}function removeEntity(_0x33af42,_0x32c20b){return function(_0x2e0291){if(_0x2e0291){return _0x2e0291[_0xdec2('0x2b')]()[_0xdec2('0x2a')](function(){_0x33af42[_0xdec2('0x1f')](0xcc)[_0xdec2('0x20')]();});}};}function handleEntityNotFound(_0x60c2cc,_0x18687c){return function(_0x2abbbd){if(!_0x2abbbd){_0x60c2cc[_0xdec2('0x1e')](0x194);}return _0x2abbbd;};}function handleError(_0x435ee3,_0x2c0275){_0x2c0275=_0x2c0275||0x1f4;return function(_0x304b45){logger[_0xdec2('0x2c')](_0x304b45['stack']);if(_0x304b45[_0xdec2('0x2d')]){delete _0x304b45[_0xdec2('0x2d')];}_0x435ee3[_0xdec2('0x1f')](_0x2c0275)['send'](_0x304b45);};}exports['index']=function(_0x5e154c,_0x173dfe){var _0x2b1974={},_0x32a22f={},_0x4d3ff0={'count':0x0,'rows':[]};var _0x4045c3=_[_0xdec2('0x2e')](db['ChatGroup'][_0xdec2('0x2f')],function(_0x1625b2){return{'name':_0x1625b2[_0xdec2('0x30')],'type':_0x1625b2[_0xdec2('0x31')][_0xdec2('0x32')]};});_0x32a22f[_0xdec2('0x33')]=_[_0xdec2('0x2e')](_0x4045c3,_0xdec2('0x2d'));_0x32a22f[_0xdec2('0x34')]=_[_0xdec2('0x35')](_0x5e154c[_0xdec2('0x34')]);_0x32a22f[_0xdec2('0x36')]=_[_0xdec2('0x37')](_0x32a22f[_0xdec2('0x33')],_0x32a22f[_0xdec2('0x34')]);_0x2b1974[_0xdec2('0x38')]=_[_0xdec2('0x37')](_0x32a22f[_0xdec2('0x33')],qs['fields'](_0x5e154c[_0xdec2('0x34')]['fields']));_0x2b1974['attributes']=_0x2b1974[_0xdec2('0x38')]['length']?_0x2b1974[_0xdec2('0x38')]:_0x32a22f[_0xdec2('0x33')];if(!_0x5e154c[_0xdec2('0x34')][_0xdec2('0x39')](_0xdec2('0x3a'))){_0x2b1974[_0xdec2('0x22')]=qs[_0xdec2('0x22')](_0x5e154c[_0xdec2('0x34')][_0xdec2('0x22')]);_0x2b1974[_0xdec2('0x23')]=qs['offset'](_0x5e154c[_0xdec2('0x34')][_0xdec2('0x23')]);}_0x2b1974['order']=qs[_0xdec2('0x3b')](_0x5e154c[_0xdec2('0x34')][_0xdec2('0x3b')]);_0x2b1974[_0xdec2('0x3c')]=qs[_0xdec2('0x36')](_[_0xdec2('0x3d')](_0x5e154c[_0xdec2('0x34')],_0x32a22f[_0xdec2('0x36')]),_0x4045c3);if(_0x5e154c[_0xdec2('0x34')][_0xdec2('0x3e')]){_0x2b1974['where']=_[_0xdec2('0x3f')](_0x2b1974['where'],{'$or':_[_0xdec2('0x2e')](_0x4045c3,function(_0x37a2f0){if(_0x37a2f0[_0xdec2('0x31')]!==_0xdec2('0x40')){var _0x16a54c={};_0x16a54c[_0x37a2f0['name']]={'$like':'%'+_0x5e154c[_0xdec2('0x34')][_0xdec2('0x3e')]+'%'};return _0x16a54c;}})});}_0x2b1974=_[_0xdec2('0x3f')]({},_0x2b1974,_0x5e154c[_0xdec2('0x41')]);var _0x50c23a={'where':_0x2b1974['where']};return db[_0xdec2('0x42')][_0xdec2('0x24')](_0x50c23a)[_0xdec2('0x2a')](function(_0x5e1105){_0x4d3ff0[_0xdec2('0x24')]=_0x5e1105;if(_0x5e154c['query'][_0xdec2('0x43')]){_0x2b1974[_0xdec2('0x44')]=[{'all':!![]}];}return db[_0xdec2('0x42')][_0xdec2('0x45')](_0x2b1974);})[_0xdec2('0x2a')](function(_0x1564ce){_0x4d3ff0['rows']=_0x1564ce;return _0x4d3ff0;})[_0xdec2('0x2a')](respondWithFilteredResult(_0x173dfe,_0x2b1974))[_0xdec2('0x46')](handleError(_0x173dfe,null));};exports[_0xdec2('0x47')]=function(_0x4dcf7a,_0x22c887){var _0x2e3f7f={'raw':!![],'where':{'id':_0x4dcf7a[_0xdec2('0x48')]['id']}},_0x258946={};_0x258946[_0xdec2('0x33')]=_[_0xdec2('0x35')](db[_0xdec2('0x42')]['rawAttributes']);_0x258946[_0xdec2('0x34')]=_[_0xdec2('0x35')](_0x4dcf7a['query']);_0x258946['filters']=_[_0xdec2('0x37')](_0x258946['model'],_0x258946[_0xdec2('0x34')]);_0x2e3f7f[_0xdec2('0x38')]=_[_0xdec2('0x37')](_0x258946[_0xdec2('0x33')],qs[_0xdec2('0x49')](_0x4dcf7a['query'][_0xdec2('0x49')]));_0x2e3f7f[_0xdec2('0x38')]=_0x2e3f7f[_0xdec2('0x38')][_0xdec2('0x4a')]?_0x2e3f7f[_0xdec2('0x38')]:_0x258946[_0xdec2('0x33')];if(_0x4dcf7a[_0xdec2('0x34')]['includeAll']){_0x2e3f7f[_0xdec2('0x44')]=[{'all':!![]}];}_0x2e3f7f=_[_0xdec2('0x3f')]({},_0x2e3f7f,_0x4dcf7a[_0xdec2('0x41')]);return db[_0xdec2('0x42')][_0xdec2('0x4b')](_0x2e3f7f)[_0xdec2('0x2a')](handleEntityNotFound(_0x22c887,null))['then'](respondWithResult(_0x22c887,null))[_0xdec2('0x46')](handleError(_0x22c887,null));};exports[_0xdec2('0x4c')]=function(_0x56d8ab,_0x5e3018){return db[_0xdec2('0x42')][_0xdec2('0x4c')](_0x56d8ab[_0xdec2('0x4d')],{})['then'](respondWithResult(_0x5e3018,0xc9))[_0xdec2('0x46')](handleError(_0x5e3018,null));};exports[_0xdec2('0x29')]=function(_0x14e341,_0x5de5a1){if(_0x14e341[_0xdec2('0x4d')]['id']){delete _0x14e341[_0xdec2('0x4d')]['id'];}return db[_0xdec2('0x42')][_0xdec2('0x4b')]({'where':{'id':_0x14e341['params']['id']}})[_0xdec2('0x2a')](handleEntityNotFound(_0x5de5a1,null))['then'](saveUpdates(_0x14e341['body'],null))[_0xdec2('0x2a')](respondWithResult(_0x5de5a1,null))[_0xdec2('0x46')](handleError(_0x5de5a1,null));};exports[_0xdec2('0x2b')]=function(_0x46596e,_0x1a04d5){return db[_0xdec2('0x42')]['find']({'where':{'id':_0x46596e[_0xdec2('0x48')]['id']}})[_0xdec2('0x2a')](handleEntityNotFound(_0x1a04d5,null))[_0xdec2('0x2a')](removeEntity(_0x1a04d5,null))[_0xdec2('0x46')](handleError(_0x1a04d5,null));};exports[_0xdec2('0x4e')]=function(_0x4ebe9e,_0x4b1f72){return db[_0xdec2('0x42')]['describe']()['then'](respondWithResult(_0x4b1f72,null))[_0xdec2('0x46')](handleError(_0x4b1f72,null));};exports[_0xdec2('0x4f')]=function(_0x16f340,_0x5ad074,_0x594315){return db[_0xdec2('0x50')][_0xdec2('0x24')]({'where':{'ChatGroupId':_0x16f340[_0xdec2('0x48')]['id'],'ToId':_0x16f340[_0xdec2('0x51')]['id'],'read':![]}})[_0xdec2('0x2a')](function(_0xb4edb8){return{'id':_['toInteger'](_0x16f340[_0xdec2('0x48')]['id']),'count':_0xb4edb8};})[_0xdec2('0x2a')](respondWithResult(_0x5ad074,null))[_0xdec2('0x46')](handleError(_0x5ad074,null));};exports['addMembers']=function(_0x1b6baa,_0x391fbd,_0x4827e0){return db['ChatGroup'][_0xdec2('0x4b')]({'where':{'id':_0x1b6baa[_0xdec2('0x48')]['id']}})[_0xdec2('0x2a')](handleEntityNotFound(_0x391fbd,null))[_0xdec2('0x2a')](function(_0x415f23){if(_0x415f23){return _0x415f23[_0xdec2('0x52')](_0x1b6baa[_0xdec2('0x4d')][_0xdec2('0x53')],_[_0xdec2('0x54')](_0x1b6baa['body'],[_0xdec2('0x53'),'id'])||{});}})[_0xdec2('0x2a')](respondWithResult(_0x391fbd,null))['catch'](handleError(_0x391fbd,null));};exports[_0xdec2('0x55')]=function(_0x53e53c,_0x170b04,_0x2b560c){var _0x13fb45={};var _0x48f4a3={};var _0x2e1c0a;var _0x336e1a;return db[_0xdec2('0x42')][_0xdec2('0x56')]({'where':{'id':_0x53e53c[_0xdec2('0x48')]['id']}})[_0xdec2('0x2a')](handleEntityNotFound(_0x170b04,null))['then'](function(_0x420cbb){if(_0x420cbb){_0x2e1c0a=_0x420cbb;_0x48f4a3[_0xdec2('0x33')]=_[_0xdec2('0x35')](db[_0xdec2('0x57')][_0xdec2('0x2f')]);_0x48f4a3['query']=_['keys'](_0x53e53c[_0xdec2('0x34')]);_0x48f4a3[_0xdec2('0x36')]=_[_0xdec2('0x37')](_0x48f4a3[_0xdec2('0x33')],_0x48f4a3[_0xdec2('0x34')]);_0x13fb45[_0xdec2('0x38')]=_[_0xdec2('0x37')](_0x48f4a3[_0xdec2('0x33')],qs[_0xdec2('0x49')](_0x53e53c['query'][_0xdec2('0x49')]));_0x13fb45[_0xdec2('0x38')]=_0x13fb45[_0xdec2('0x38')][_0xdec2('0x4a')]?_0x13fb45[_0xdec2('0x38')]:_0x48f4a3[_0xdec2('0x33')];_0x13fb45[_0xdec2('0x58')]=qs['sort'](_0x53e53c[_0xdec2('0x34')][_0xdec2('0x3b')]);_0x13fb45[_0xdec2('0x3c')]=qs[_0xdec2('0x36')](_[_0xdec2('0x3d')](_0x53e53c[_0xdec2('0x34')],_0x48f4a3[_0xdec2('0x36')]));if(_0x53e53c[_0xdec2('0x34')][_0xdec2('0x3e')]){_0x13fb45[_0xdec2('0x3c')]=_[_0xdec2('0x3f')](_0x13fb45['where'],{'$or':_[_0xdec2('0x2e')](_0x13fb45[_0xdec2('0x38')],function(_0x5d5344){var _0x38a351={};_0x38a351[_0x5d5344]={'$like':'%'+_0x53e53c[_0xdec2('0x34')][_0xdec2('0x3e')]+'%'};return _0x38a351;})});}_0x13fb45=_['merge']({},_0x13fb45,_0x53e53c[_0xdec2('0x41')]);return _0x2e1c0a['getMembers'](_0x13fb45);}})[_0xdec2('0x2a')](function(_0x18fa9d){if(_0x18fa9d){_0x336e1a=_0x18fa9d[_0xdec2('0x4a')];if(!_0x53e53c[_0xdec2('0x34')][_0xdec2('0x39')](_0xdec2('0x3a'))){_0x13fb45[_0xdec2('0x22')]=qs[_0xdec2('0x22')](_0x53e53c[_0xdec2('0x34')][_0xdec2('0x22')]);_0x13fb45['offset']=qs[_0xdec2('0x23')](_0x53e53c[_0xdec2('0x34')][_0xdec2('0x23')]);}return _0x2e1c0a[_0xdec2('0x55')](_0x13fb45);}})[_0xdec2('0x2a')](function(_0x15d995){if(_0x15d995){return _0x15d995?{'count':_0x336e1a,'rows':_0x15d995}:null;}})[_0xdec2('0x2a')](respondWithResult(_0x170b04,null))[_0xdec2('0x46')](handleError(_0x170b04,null));};exports['removeMembers']=function(_0x948adb,_0x3f915e,_0x49cd22){return db[_0xdec2('0x42')][_0xdec2('0x4b')]({'where':{'id':_0x948adb[_0xdec2('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f915e,null))[_0xdec2('0x2a')](function(_0x2f61c9){if(_0x2f61c9){return _0x2f61c9['removeMembers'](_0x948adb[_0xdec2('0x34')][_0xdec2('0x53')]);}})['then'](respondWithStatusCode(_0x3f915e,null))[_0xdec2('0x46')](handleError(_0x3f915e,null));};exports[_0xdec2('0x59')]=function(_0x228cfc,_0x1c467f,_0x35a097){if(_0x228cfc[_0xdec2('0x4d')]['id']){delete _0x228cfc[_0xdec2('0x4d')]['id'];}return db['ChatGroup'][_0xdec2('0x4b')]({'where':{'id':_0x228cfc[_0xdec2('0x48')]['id']}})[_0xdec2('0x2a')](handleEntityNotFound(_0x1c467f,null))['then'](function(_0x1c4046){if(_0x1c4046){_0x228cfc[_0xdec2('0x4d')][_0xdec2('0x5a')]=_0x1c4046['id'];return db[_0xdec2('0x50')][_0xdec2('0x4c')](_0x228cfc[_0xdec2('0x4d')]);}})['then'](respondWithResult(_0x1c467f,null))[_0xdec2('0x46')](handleError(_0x1c467f,null));};exports[_0xdec2('0x5b')]=function(_0x34ff9a,_0x6d89c0,_0x5696bb){var _0x1a714d={};var _0x3e110e={};var _0x3c7689;var _0x4dc249;return db['ChatGroup']['findOne']({'where':{'id':_0x34ff9a[_0xdec2('0x48')]['id']}})[_0xdec2('0x2a')](handleEntityNotFound(_0x6d89c0,null))['then'](function(_0x2f9948){if(_0x2f9948){_0x3c7689=_0x2f9948;_0x3e110e[_0xdec2('0x33')]=_[_0xdec2('0x35')](db[_0xdec2('0x50')][_0xdec2('0x2f')]);_0x3e110e[_0xdec2('0x34')]=_[_0xdec2('0x35')](_0x34ff9a[_0xdec2('0x34')]);_0x3e110e['filters']=_[_0xdec2('0x37')](_0x3e110e[_0xdec2('0x33')],_0x3e110e[_0xdec2('0x34')]);_0x1a714d[_0xdec2('0x38')]=_[_0xdec2('0x37')](_0x3e110e[_0xdec2('0x33')],qs[_0xdec2('0x49')](_0x34ff9a['query']['fields']));_0x1a714d['attributes']=_0x1a714d[_0xdec2('0x38')][_0xdec2('0x4a')]?_0x1a714d[_0xdec2('0x38')]:_0x3e110e[_0xdec2('0x33')];_0x1a714d[_0xdec2('0x58')]=qs[_0xdec2('0x3b')](_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x3b')]);_0x1a714d[_0xdec2('0x3c')]=qs['filters'](_['pick'](_0x34ff9a[_0xdec2('0x34')],_0x3e110e[_0xdec2('0x36')]));if(_0x34ff9a['query']['filter']){_0x1a714d['where']=_['merge'](_0x1a714d[_0xdec2('0x3c')],{'$or':_[_0xdec2('0x2e')](_0x1a714d[_0xdec2('0x38')],function(_0x58e32c){var _0x2e4bf9={};_0x2e4bf9[_0x58e32c]={'$like':'%'+_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x3e')]+'%'};return _0x2e4bf9;})});}if(_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x5c')]){var _0x515587=_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x5c')][_0xdec2('0x5d')](',');var _0x55716e={};_0x55716e[_0x515587[0x0]]={'$gte':moment(_0x515587[0x1])[_0xdec2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1a714d[_0xdec2('0x3c')]=_[_0xdec2('0x3f')](_0x1a714d['where'],_0x55716e);}_0x1a714d=_['merge']({},_0x1a714d,_0x34ff9a[_0xdec2('0x41')]);return _0x3c7689[_0xdec2('0x5b')](_0x1a714d);}})['then'](function(_0x13249a){if(_0x13249a){_0x4dc249=_0x13249a[_0xdec2('0x4a')];if(!_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x39')]('nolimit')){_0x1a714d[_0xdec2('0x22')]=qs[_0xdec2('0x22')](_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x22')]);_0x1a714d[_0xdec2('0x23')]=qs[_0xdec2('0x23')](_0x34ff9a[_0xdec2('0x34')][_0xdec2('0x23')]);}return _0x3c7689[_0xdec2('0x5b')](_0x1a714d);}})[_0xdec2('0x2a')](function(_0x389346){if(_0x389346){return _0x389346?{'count':_0x4dc249,'rows':_0x389346}:null;}})['then'](respondWithResult(_0x6d89c0,null))[_0xdec2('0x46')](handleError(_0x6d89c0,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 7ddbd26..6359a8d 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 _0xbca0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5a68ac,_0x55cf4f){var _0xe7d5db=function(_0x53ebe2){while(--_0x53ebe2){_0x5a68ac['push'](_0x5a68ac['shift']());}};_0xe7d5db(++_0x55cf4f);}(_0xbca0,0x8b));var _0x0bca=function(_0x12f9e9,_0x2c05b7){_0x12f9e9=_0x12f9e9-0x0;var _0x31cae9=_0xbca0[_0x12f9e9];return _0x31cae9;};'use strict';var EventEmitter=require(_0x0bca('0x0'));var ChatGroup=require(_0x0bca('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bca('0x2'),'afterDestroy':_0x0bca('0x3')};function emitEvent(_0x3ce28e){return function(_0x1a6cb5,_0x595711,_0x494f51){ChatGroupEvents[_0x0bca('0x4')](_0x3ce28e+':'+_0x1a6cb5['id'],_0x1a6cb5);ChatGroupEvents[_0x0bca('0x4')](_0x3ce28e,_0x1a6cb5);_0x494f51(null);};}for(var e in events){if(events[_0x0bca('0x5')](e)){var event=events[e];ChatGroup[_0x0bca('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xe6b0=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe6b0,0x18b));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0e6b('0x0'));var ChatGroup=require(_0x0e6b('0x1'))['db'][_0x0e6b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0e6b('0x3')](0x0);var events={'afterCreate':_0x0e6b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4fa974){return function(_0x39deaa,_0xa6dbed,_0x4c0861){ChatGroupEvents[_0x0e6b('0x5')](_0x4fa974+':'+_0x39deaa['id'],_0x39deaa);ChatGroupEvents[_0x0e6b('0x5')](_0x4fa974,_0x39deaa);_0x4c0861(null);};}for(var e in events){if(events[_0x0e6b('0x6')](e)){var event=events[e];ChatGroup[_0x0e6b('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 4b28c8d..ed812e4 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 _0x5cfa=['define','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0x5cfa,0xd9));var _0xa5cf=function(_0x2de4cb,_0xe3bc3b){_0x2de4cb=_0x2de4cb-0x0;var _0x668608=_0x5cfa[_0x2de4cb];return _0x668608;};'use strict';var _=require('lodash');var util=require(_0xa5cf('0x0'));var logger=require(_0xa5cf('0x1'))('api');var moment=require(_0xa5cf('0x2'));var BPromise=require(_0xa5cf('0x3'));var rp=require(_0xa5cf('0x4'));var fs=require('fs');var path=require(_0xa5cf('0x5'));var rimraf=require(_0xa5cf('0x6'));var config=require(_0xa5cf('0x7'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x1261ec,_0x26d544){return _0x1261ec[_0xa5cf('0x8')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6433=['api','moment','bluebird','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger'];(function(_0x1a257c,_0x2d62af){var _0x483407=function(_0x32302b){while(--_0x32302b){_0x1a257c['push'](_0x1a257c['shift']());}};_0x483407(++_0x2d62af);}(_0x6433,0x1d7));var _0x3643=function(_0x523d74,_0x154dde){_0x523d74=_0x523d74-0x0;var _0x5b6d02=_0x6433[_0x523d74];return _0x5b6d02;};'use strict';var _=require(_0x3643('0x0'));var util=require('util');var logger=require(_0x3643('0x1'))(_0x3643('0x2'));var moment=require(_0x3643('0x3'));var BPromise=require(_0x3643('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3643('0x5'));var config=require('../../config/environment');var attributes=require(_0x3643('0x6'));module[_0x3643('0x7')]=function(_0x37e595,_0x49ba61){return _0x37e595[_0x3643('0x8')](_0x3643('0x9'),attributes,{'tableName':_0x3643('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index f856622..9333373 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 _0xd0a4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0xb1c41,_0x1bfbc6){var _0x3478a4=function(_0x3f9273){while(--_0x3f9273){_0xb1c41['push'](_0xb1c41['shift']());}};_0x3478a4(++_0x1bfbc6);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var moment=require(_0x4d0a('0x2'));var BPromise=require(_0x4d0a('0x3'));var rs=require(_0x4d0a('0x4'));var fs=require('fs');var Redis=require(_0x4d0a('0x5'));var db=require(_0x4d0a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d0a('0x7'))(_0x4d0a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d0a('0x9')]({'port':0x232a});config[_0x4d0a('0xa')]=_['defaults'](config[_0x4d0a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d0a('0xa')]));require(_0x4d0a('0xb'))[_0x4d0a('0xc')](socket);function respondWithRpcPromise(_0x4adc33,_0x10b7c7,_0x1b05da){return new BPromise(function(_0x29d5ff,_0x3be4ea){return client[_0x4d0a('0xd')](_0x4adc33,_0x1b05da)[_0x4d0a('0xe')](function(_0x1b7c41){logger[_0x4d0a('0xf')](_0x4d0a('0x10'),_0x10b7c7,_0x4d0a('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'),JSON[_0x4d0a('0x12')](_0x1b7c41));if(_0x1b7c41[_0x4d0a('0x13')]){if(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x14')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')]['message']);return _0x3be4ea(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}logger[_0x4d0a('0x13')](_0x4d0a('0x10'),_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);return _0x29d5ff(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}else{logger[_0x4d0a('0xf')]('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'));_0x29d5ff(_0x1b7c41['result']['message']);}})[_0x4d0a('0x16')](function(_0x3aa85b){logger[_0x4d0a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x3aa85b);_0x3be4ea(_0x3aa85b);});});} \ No newline at end of file +var _0xf61e=['client','http','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x43bce1,_0x194db3){var _0x23be45=function(_0x40096b){while(--_0x40096b){_0x43bce1['push'](_0x43bce1['shift']());}};_0x23be45(++_0x194db3);}(_0xf61e,0x82));var _0xef61=function(_0x3d708d,_0x194365){_0x3d708d=_0x3d708d-0x0;var _0x405952=_0xf61e[_0x3d708d];return _0x405952;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef61('0x3'));var db=require(_0xef61('0x4'))['db'];var utils=require(_0xef61('0x5'));var logger=require(_0xef61('0x6'))(_0xef61('0x7'));var config=require(_0xef61('0x8'));var jayson=require(_0xef61('0x9'));var client=jayson[_0xef61('0xa')][_0xef61('0xb')]({'port':0x232a});config['redis']=_[_0xef61('0xc')](config['redis'],{'host':_0xef61('0xd'),'port':0x18eb});var socket=require(_0xef61('0xe'))(new Redis(config[_0xef61('0xf')]));require(_0xef61('0x10'))[_0xef61('0x11')](socket);function respondWithRpcPromise(_0x5b68e9,_0x4bb153,_0x4e1f45){return new BPromise(function(_0x1721b4,_0x1e10c0){return client[_0xef61('0x12')](_0x5b68e9,_0x4e1f45)['then'](function(_0x1bfd11){logger['info'](_0xef61('0x13'),_0x4bb153,_0xef61('0x14'));logger[_0xef61('0x15')](_0xef61('0x16'),_0x4bb153,'request\x20sent',JSON[_0xef61('0x17')](_0x1bfd11));if(_0x1bfd11['error']){if(_0x1bfd11[_0xef61('0x18')][_0xef61('0x19')]===0x1f4){logger[_0xef61('0x18')](_0xef61('0x13'),_0x4bb153,_0x1bfd11[_0xef61('0x18')][_0xef61('0x1a')]);return _0x1e10c0(_0x1bfd11[_0xef61('0x18')]['message']);}logger[_0xef61('0x18')]('ChatGroup,\x20%s,\x20%s',_0x4bb153,_0x1bfd11[_0xef61('0x18')][_0xef61('0x1a')]);return _0x1721b4(_0x1bfd11[_0xef61('0x18')][_0xef61('0x1a')]);}else{logger[_0xef61('0x1b')]('ChatGroup,\x20%s,\x20%s',_0x4bb153,_0xef61('0x14'));_0x1721b4(_0x1bfd11['result'][_0xef61('0x1a')]);}})['catch'](function(_0x2368b3){logger[_0xef61('0x18')]('ChatGroup,\x20%s,\x20%s',_0x4bb153,_0x2368b3);_0x1e10c0(_0x2368b3);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 186569a..57b97c9 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 _0x4326=['remove','removeListener','length'];(function(_0x53b3b3,_0x2f3a6f){var _0x3bdc9f=function(_0x5282bd){while(--_0x5282bd){_0x53b3b3['push'](_0x53b3b3['shift']());}};_0x3bdc9f(++_0x2f3a6f);}(_0x4326,0x15c));var _0x6432=function(_0x36b088,_0x1871a6){_0x36b088=_0x36b088-0x0;var _0x233f74=_0x4326[_0x36b088];return _0x233f74;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x6432('0x0'),'update'];function createListener(_0x2bcce7,_0x5d54a3){return function(_0x1fd123){_0x5d54a3['emit'](_0x2bcce7,_0x1fd123);};}function removeListener(_0x2d397c,_0x535e2f){return function(){ChatGroupEvents[_0x6432('0x1')](_0x2d397c,_0x535e2f);};}exports['register']=function(_0x11f4f0){for(var _0x5a3312=0x0,_0x471104=events[_0x6432('0x2')];_0x5a3312<_0x471104;_0x5a3312++){var _0xb252a8=events[_0x5a3312];var _0x54039b=createListener('chatGroup:'+_0xb252a8,_0x11f4f0);ChatGroupEvents['on'](_0xb252a8,_0x54039b);}}; \ No newline at end of file +var _0x2fd3=['emit','removeListener','register','./chatGroup.events','save','update'];(function(_0x4cc62c,_0xde61c1){var _0x13be8d=function(_0x5c13f8){while(--_0x5c13f8){_0x4cc62c['push'](_0x4cc62c['shift']());}};_0x13be8d(++_0xde61c1);}(_0x2fd3,0x183));var _0x32fd=function(_0x28b3a4,_0x8f16ab){_0x28b3a4=_0x28b3a4-0x0;var _0x355fb8=_0x2fd3[_0x28b3a4];return _0x355fb8;};'use strict';var ChatGroupEvents=require(_0x32fd('0x0'));var events=[_0x32fd('0x1'),'remove',_0x32fd('0x2')];function createListener(_0x36d4cd,_0x4b4983){return function(_0x47f1c7){_0x4b4983[_0x32fd('0x3')](_0x36d4cd,_0x47f1c7);};}function removeListener(_0x3975c0,_0x5731a4){return function(){ChatGroupEvents[_0x32fd('0x4')](_0x3975c0,_0x5731a4);};}exports[_0x32fd('0x5')]=function(_0x202e2b){for(var _0x5d4fb9=0x0,_0x54e1a3=events['length'];_0x5d4fb9<_0x54e1a3;_0x5d4fb9++){var _0x332d90=events[_0x5d4fb9];var _0x12c53d=createListener('chatGroup:'+_0x332d90,_0x202e2b);ChatGroupEvents['on'](_0x332d90,_0x12c53d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 59554d5..0a07e18 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 _0xe7fb=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','update','delete'];(function(_0x458c6e,_0x228cf1){var _0x3f38ad=function(_0x2c2b49){while(--_0x2c2b49){_0x458c6e['push'](_0x458c6e['shift']());}};_0x3f38ad(++_0x228cf1);}(_0xe7fb,0xb1));var _0xbe7f=function(_0x45a082,_0x3a5f85){_0x45a082=_0x45a082-0x0;var _0x71276=_0xe7fb[_0x45a082];return _0x71276;};'use strict';var multer=require(_0xbe7f('0x0'));var util=require(_0xbe7f('0x1'));var path=require(_0xbe7f('0x2'));var timeout=require(_0xbe7f('0x3'));var express=require(_0xbe7f('0x4'));var router=express[_0xbe7f('0x5')]();var fs_extra=require(_0xbe7f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbe7f('0x7'));var config=require('../../config/environment');var controller=require(_0xbe7f('0x8'));router['get']('/',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0xa')]);router[_0xbe7f('0xb')](_0xbe7f('0xc'),auth[_0xbe7f('0x9')](),controller['describe']);router[_0xbe7f('0xb')](_0xbe7f('0xd'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0xe')]);router[_0xbe7f('0xb')](_0xbe7f('0xf'),auth['isAuthenticated'](),controller[_0xbe7f('0x10')]);router[_0xbe7f('0xb')](_0xbe7f('0x11'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x12')]);router['get'](_0xbe7f('0x13'),auth[_0xbe7f('0x9')](),controller['getMessages']);router[_0xbe7f('0x14')]('/',auth['isAuthenticated'](),controller[_0xbe7f('0x15')]);router[_0xbe7f('0x14')]('/:id/members',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x16')]);router['post'](_0xbe7f('0x13'),auth[_0xbe7f('0x9')](),controller['addMessage']);router[_0xbe7f('0x17')]('/:id',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x18')]);router[_0xbe7f('0x19')](_0xbe7f('0xd'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x1a')]);router[_0xbe7f('0x19')](_0xbe7f('0x11'),auth['isAuthenticated'](),controller[_0xbe7f('0x1b')]);module[_0xbe7f('0x1c')]=router; \ No newline at end of file +var _0x3980=['/:id/unread','/:id/members','/:id/messages','post','create','addMembers','addMessage','delete','destroy','removeMembers','exports','util','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x12ca72,_0x12cdfe){var _0x218945=function(_0x53af8e){while(--_0x53af8e){_0x12ca72['push'](_0x12ca72['shift']());}};_0x218945(++_0x12cdfe);}(_0x3980,0x108));var _0x0398=function(_0x184032,_0x454721){_0x184032=_0x184032-0x0;var _0x2e9c34=_0x3980[_0x184032];return _0x2e9c34;};'use strict';var multer=require('multer');var util=require(_0x0398('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0398('0x1'));var router=express[_0x0398('0x2')]();var fs_extra=require(_0x0398('0x3'));var auth=require(_0x0398('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0398('0x5'));router[_0x0398('0x6')]('/',auth[_0x0398('0x7')](),controller[_0x0398('0x8')]);router[_0x0398('0x6')](_0x0398('0x9'),auth[_0x0398('0x7')](),controller['describe']);router[_0x0398('0x6')](_0x0398('0xa'),auth[_0x0398('0x7')](),controller[_0x0398('0xb')]);router[_0x0398('0x6')](_0x0398('0xc'),auth[_0x0398('0x7')](),controller['getUnread']);router['get'](_0x0398('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x0398('0x6')](_0x0398('0xe'),auth[_0x0398('0x7')](),controller['getMessages']);router[_0x0398('0xf')]('/',auth[_0x0398('0x7')](),controller[_0x0398('0x10')]);router[_0x0398('0xf')]('/:id/members',auth[_0x0398('0x7')](),controller[_0x0398('0x11')]);router[_0x0398('0xf')](_0x0398('0xe'),auth[_0x0398('0x7')](),controller[_0x0398('0x12')]);router['put'](_0x0398('0xa'),auth[_0x0398('0x7')](),controller['update']);router[_0x0398('0x13')](_0x0398('0xa'),auth[_0x0398('0x7')](),controller[_0x0398('0x14')]);router[_0x0398('0x13')](_0x0398('0xd'),auth[_0x0398('0x7')](),controller[_0x0398('0x15')]);module[_0x0398('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 9dd61a1..1f38bbe 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 _0x57f8=['out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x142900,_0x2c1ea4){var _0x1c5a43=function(_0xce427f){while(--_0xce427f){_0x142900['push'](_0x142900['shift']());}};_0x1c5a43(++_0x2c1ea4);}(_0x57f8,0x198));var _0x857f=function(_0x1fa469,_0x5e19b1){_0x1fa469=_0x1fa469-0x0;var _0x22cc36=_0x57f8[_0x1fa469];return _0x22cc36;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'closed':{'type':Sequelize[_0x857f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x857f('0x2')]},'ratingType':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x4'),_0x857f('0x5')),'defaultValue':_0x857f('0x4')},'ratingMessage':{'type':Sequelize[_0x857f('0x6')]},'pathTranscript':{'type':Sequelize[_0x857f('0x6')]},'mailTranscript':{'type':Sequelize[_0x857f('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x857f('0x8')]},'disposition':{'type':Sequelize[_0x857f('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x857f('0x7')]},'note':{'type':Sequelize[_0x857f('0x7')]},'browserName':{'type':Sequelize[_0x857f('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x857f('0x7')]},'osVersion':{'type':Sequelize[_0x857f('0x7')]},'deviceModel':{'type':Sequelize[_0x857f('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x857f('0x7')]},'referer':{'type':Sequelize[_0x857f('0x6')]},'customerIp':{'type':Sequelize[_0x857f('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x857f('0x9'))},'read1stAt':{'type':Sequelize[_0x857f('0x8')]},'lastMsgAt':{'type':Sequelize[_0x857f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x857f('0x3')]('in',_0x857f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x857f('0x7')]},'customerPort':{'type':Sequelize[_0x857f('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x857f('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b20=['DATE','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0xa140a1,_0x496424){var _0x2fbf18=function(_0x3809ab){while(--_0x3809ab){_0xa140a1['push'](_0xa140a1['shift']());}};_0x2fbf18(++_0x496424);}(_0x6b20,0xd1));var _0x06b2=function(_0x55e04e,_0x35ab25){_0x55e04e=_0x55e04e-0x0;var _0x5db651=_0x6b20[_0x55e04e];return _0x5db651;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x06b2('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x06b2('0x3'),_0x06b2('0x4')),'defaultValue':_0x06b2('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x06b2('0x5')]},'mailTranscript':{'type':Sequelize[_0x06b2('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x06b2('0x7')]},'disposition':{'type':Sequelize[_0x06b2('0x6')]},'secondDisposition':{'type':Sequelize[_0x06b2('0x6')]},'thirdDisposition':{'type':Sequelize[_0x06b2('0x6')]},'note':{'type':Sequelize[_0x06b2('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x06b2('0x6')]},'osName':{'type':Sequelize[_0x06b2('0x6')]},'osVersion':{'type':Sequelize[_0x06b2('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x06b2('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x06b2('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x06b2('0x8'))},'read1stAt':{'type':Sequelize[_0x06b2('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x06b2('0x9')]('in',_0x06b2('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x06b2('0x6')]},'customerPort':{'type':Sequelize[_0x06b2('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x06b2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x06b2('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2b22916..182cc2d 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 _0xdd25=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','offset','undefined','limit','count','set','reject','save','update','name','send','merge','body','contact','interaction','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','abandoned','total','closed','UserId','waiting','index','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','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','expr','search','sqlOperator','length','find','unreadMessages','value','having','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','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.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','User','CmContact','Messages','%s%d','System','format','Visitor','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','mkdirSync','Chat','Account','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0xdd25,0x13a));var _0x5dd2=function(_0xdca105,_0x1f91ce){_0xdca105=_0xdca105-0x0;var _0x34a61c=_0xdd25[_0xdca105];return _0x34a61c;};'use strict';var emlformat=require(_0x5dd2('0x0'));var rimraf=require(_0x5dd2('0x1'));var zipdir=require(_0x5dd2('0x2'));var jsonpatch=require(_0x5dd2('0x3'));var rp=require(_0x5dd2('0x4'));var moment=require(_0x5dd2('0x5'));var BPromise=require(_0x5dd2('0x6'));var Mustache=require(_0x5dd2('0x7'));var util=require(_0x5dd2('0x8'));var path=require(_0x5dd2('0x9'));var sox=require(_0x5dd2('0xa'));var csv=require(_0x5dd2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5dd2('0xc'));var squel=require(_0x5dd2('0xd'));var crypto=require(_0x5dd2('0xe'));var jsforce=require(_0x5dd2('0xf'));var deskjs=require(_0x5dd2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5dd2('0x11'));var Redis=require(_0x5dd2('0x12'));var authService=require(_0x5dd2('0x13'));var qs=require(_0x5dd2('0x14'));var as=require(_0x5dd2('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x5dd2('0x16'));var logger=require(_0x5dd2('0x17'))('api');var utils=require(_0x5dd2('0x18'));var config=require(_0x5dd2('0x19'));var licenseUtil=require(_0x5dd2('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5dd2('0x1b')]=_[_0x5dd2('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dd2('0x1b')]));require(_0x5dd2('0x1d'))['register'](socket);var jayson=require(_0x5dd2('0x1e'));var client=jayson[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'port':0x232b});var client9004=jayson[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x31c324,_0x124288,_0x126f76,_0x4d96f3){return new BPromise(function(_0xff930b,_0x307367){var _0x46339f=_0x4d96f3||client;return _0x46339f[_0x5dd2('0x21')](_0x31c324,_0x126f76)[_0x5dd2('0x22')](function(_0x1bddde){logger[_0x5dd2('0x23')](_0x5dd2('0x24'),_0x124288,_0x5dd2('0x25'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x124288,_0x5dd2('0x25'),JSON[_0x5dd2('0x26')](_0x1bddde));if(_0x1bddde[_0x5dd2('0x27')]){if(_0x1bddde[_0x5dd2('0x27')]['code']===0x1f4){logger[_0x5dd2('0x27')](_0x5dd2('0x24'),_0x124288,_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);return _0x307367(_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);}logger['error'](_0x5dd2('0x24'),_0x124288,_0x1bddde[_0x5dd2('0x27')]['message']);return _0xff930b(_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);}else{logger[_0x5dd2('0x23')](_0x5dd2('0x24'),_0x124288,_0x5dd2('0x25'));_0xff930b(_0x1bddde[_0x5dd2('0x29')][_0x5dd2('0x28')]);}})[_0x5dd2('0x2a')](function(_0x2df995){logger[_0x5dd2('0x27')](_0x5dd2('0x24'),_0x124288,_0x2df995);_0x307367(_0x2df995);});});}function respondWithStatusCode(_0x7d7c7f,_0x171d82){_0x171d82=_0x171d82||0xcc;return function(_0x374971){if(_0x374971){return _0x7d7c7f['sendStatus'](_0x171d82);}return _0x7d7c7f['status'](_0x171d82)[_0x5dd2('0x2b')]();};}function respondWithResult(_0x50236c,_0x3f6c82){_0x3f6c82=_0x3f6c82||0xc8;return function(_0x3f3b1b){if(_0x3f3b1b){return _0x50236c[_0x5dd2('0x2c')](_0x3f6c82)[_0x5dd2('0x2d')](_0x3f3b1b);}};}function respondWithFilteredResult(_0x3e09de,_0x252db4){return function(_0x48e367){if(_0x48e367){var _0x4be3bc=typeof _0x252db4[_0x5dd2('0x2e')]===_0x5dd2('0x2f')&&typeof _0x252db4[_0x5dd2('0x30')]===_0x5dd2('0x2f');var _0x3cc4ec=_0x48e367[_0x5dd2('0x31')];var _0x5e87da=_0x4be3bc?0x0:_0x252db4[_0x5dd2('0x2e')];var _0x338884=_0x4be3bc?_0x48e367['count']:_0x252db4[_0x5dd2('0x2e')]+_0x252db4[_0x5dd2('0x30')];var _0x491081;if(_0x338884>=_0x3cc4ec){_0x338884=_0x3cc4ec;_0x491081=0xc8;}else{_0x491081=0xce;}_0x3e09de['status'](_0x491081);return _0x3e09de[_0x5dd2('0x32')]('Content-Range',_0x5e87da+'-'+_0x338884+'/'+_0x3cc4ec)[_0x5dd2('0x2d')](_0x48e367);}return null;};}function patchUpdates(_0x2341c7){return function(_0x3156e7){try{jsonpatch['apply'](_0x3156e7,_0x2341c7,!![]);}catch(_0x4923b3){return BPromise[_0x5dd2('0x33')](_0x4923b3);}return _0x3156e7[_0x5dd2('0x34')]();};}function saveUpdates(_0x26df28,_0x4c5496){return function(_0x8e2131){if(_0x8e2131){return _0x8e2131[_0x5dd2('0x35')](_0x26df28)[_0x5dd2('0x22')](function(_0x4188ff){return _0x4188ff;});}return null;};}function removeEntity(_0x3ccf40,_0xe11ba6){return function(_0x2c0545){if(_0x2c0545){return _0x2c0545['destroy']()[_0x5dd2('0x22')](function(){_0x3ccf40[_0x5dd2('0x2c')](0xcc)[_0x5dd2('0x2b')]();});}};}function handleEntityNotFound(_0x393adc,_0x307996){return function(_0x1c4522){if(!_0x1c4522){_0x393adc['sendStatus'](0x194);}return _0x1c4522;};}function handleError(_0xb9dfad,_0x3a9ff){_0x3a9ff=_0x3a9ff||0x1f4;return function(_0x380d33){logger[_0x5dd2('0x27')](_0x380d33['stack']);if(_0x380d33['name']){delete _0x380d33[_0x5dd2('0x36')];}_0xb9dfad[_0x5dd2('0x2c')](_0x3a9ff)[_0x5dd2('0x37')](_0x380d33);};}function getMustacheRender(_0x1c2700,_0xc6b25b){return Mustache['render'](_0x1c2700,_[_0x5dd2('0x38')](_0xc6b25b[_0x5dd2('0x39')],{'contact':_0xc6b25b[_0x5dd2('0x3a')],'message':_0xc6b25b[_0x5dd2('0x28')],'agent':_0xc6b25b['agent'],'interaction':_0xc6b25b[_0x5dd2('0x3b')],'account':_0xc6b25b['account']}))||'';}function getInteractionUsers(_0x1405a8,_0x16f73d){return new BPromise(function(_0x11e34c,_0xb18576){try{if(_0x16f73d[_0x1405a8['id']]){_0x1405a8[_0x5dd2('0x3c')]=_[_0x5dd2('0x3d')](_0x16f73d[_0x1405a8['id']],function(_0x489700){return{'id':_0x489700['id'],'fullname':_0x489700[_0x5dd2('0x3e')]};});}}catch(_0x5e4fb1){_0xb18576(_0x5e4fb1);}_0x11e34c(_0x1405a8);});}function getInteractionTags(_0x488c64,_0x108d77){return new BPromise(function(_0x11e5e7,_0x29fef5){try{if(_0x488c64[_0x5dd2('0x3f')]){_0x488c64[_0x5dd2('0x40')]=[];_0x488c64[_0x5dd2('0x3f')][_0x5dd2('0x41')](',')[_0x5dd2('0x42')](function(_0x13e89f){_0x488c64[_0x5dd2('0x40')]['push'](_0x108d77[_0x13e89f]);});}delete _0x488c64[_0x5dd2('0x3f')];}catch(_0xe163ed){_0x29fef5(_0xe163ed);}_0x11e5e7(_0x488c64);});}function updateChatInteraction(_0x298ea3,_0xc3aa2c,_0x19ccff){return new BPromise(function(_0x15adaf,_0x151b57){return getInteractionUsers(_0x298ea3,_0x19ccff)[_0x5dd2('0x22')](function(_0x1decdf){return getInteractionTags(_0x1decdf,_0xc3aa2c);})[_0x5dd2('0x22')](function(_0x1f970b){return getStateInteraction(_0x1f970b);})['then'](function(_0x58318b){_0x15adaf(_0x58318b);})[_0x5dd2('0x2a')](function(_0x24c163){_0x151b57(_0x24c163);});});}function getStateInteraction(_0x1e85b1){return new BPromise(function(_0x37e5ca){_0x1e85b1['waiting']=0x0;_0x1e85b1[_0x5dd2('0x43')]=0x0;_0x1e85b1[_0x5dd2('0x44')]=0x0;_0x1e85b1[_0x5dd2('0x45')]=0x0;_0x1e85b1[_0x5dd2('0x46')]=0x0;_0x1e85b1[_0x5dd2('0x47')]=0x0;if(!_0x1e85b1[_0x5dd2('0x48')]&&!_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1['waiting']+=0x1;}if(!_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1[_0x5dd2('0x43')]+=0x1;if(_0x1e85b1[_0x5dd2('0x4a')]){_0x1e85b1[_0x5dd2('0x4a')]-=0x1;}}if(_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1['disposition']===_0x5dd2('0x46')){_0x1e85b1['abandoned']+=0x1;if(_0x1e85b1['waiting']){_0x1e85b1['waiting']-=0x1;}}else if(_0x1e85b1[_0x5dd2('0x48')]&&!_0x1e85b1[_0x5dd2('0x49')]&&_0x1e85b1['disposition']){_0x1e85b1[_0x5dd2('0x45')]+=0x1;if(_0x1e85b1[_0x5dd2('0x4a')]){_0x1e85b1['waiting']-=0x1;}}else if(_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1[_0x5dd2('0x44')]+=0x1;if(_0x1e85b1[_0x5dd2('0x43')]){_0x1e85b1[_0x5dd2('0x43')]-=0x1;}}_0x1e85b1[_0x5dd2('0x47')]+=0x1;_0x37e5ca(_0x1e85b1);});}exports[_0x5dd2('0x4b')]=function(_0x370a41,_0x312f96){var _0x10fe4b={},_0x5653e3={},_0x178848={'count':0x0,'rows':[]};var _0x1d4334=_[_0x5dd2('0x3d')](db[_0x5dd2('0x4c')][_0x5dd2('0x4d')],function(_0x4e6159){return{'name':_0x4e6159[_0x5dd2('0x4e')],'type':_0x4e6159[_0x5dd2('0x4f')]['key']};});_0x5653e3[_0x5dd2('0x50')]=_[_0x5dd2('0x3d')](_0x1d4334,_0x5dd2('0x36'));_0x5653e3[_0x5dd2('0x51')]=_[_0x5dd2('0x52')](_0x370a41[_0x5dd2('0x51')]);_0x5653e3[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x5653e3[_0x5dd2('0x50')],_0x5653e3['query']);_0x10fe4b[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x5653e3[_0x5dd2('0x50')],qs['fields'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x10fe4b['attributes']=_0x10fe4b[_0x5dd2('0x55')]['length']?_0x10fe4b['attributes']:_0x5653e3[_0x5dd2('0x50')];if(!_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x10fe4b[_0x5dd2('0x30')]=qs['limit'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x30')]);_0x10fe4b[_0x5dd2('0x2e')]=qs[_0x5dd2('0x2e')](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x10fe4b[_0x5dd2('0x59')]=qs[_0x5dd2('0x5a')](_0x370a41[_0x5dd2('0x51')]['sort']);_0x10fe4b['where']=qs['filters'](_[_0x5dd2('0x5b')](_0x370a41[_0x5dd2('0x51')],_0x5653e3[_0x5dd2('0x53')]),_0x1d4334);var _0x199c07=[];var _0x273092=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5d')]('id')[_0x5dd2('0x5d')]('name')[_0x5dd2('0x5d')](_0x5dd2('0x5e'))[_0x5dd2('0x5f')](_0x5dd2('0x60'));var _0x3fd77d=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5d')]('u.id')['field']('u.fullname')['field'](_0x5dd2('0x61'))[_0x5dd2('0x5f')](_0x5dd2('0x62'),'ui')[_0x5dd2('0x63')](_0x5dd2('0x64'),'u',_0x5dd2('0x65'));var _0x55e347=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5f')](_0x5dd2('0x66'),'i')[_0x5dd2('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5dd2('0x63')](_0x5dd2('0x64'),'o',_0x5dd2('0x67'))[_0x5dd2('0x63')]('chat_websites','a',_0x5dd2('0x68'))[_0x5dd2('0x63')](_0x5dd2('0x69'),'me',_0x5dd2('0x6a'))[_0x5dd2('0x63')](_0x5dd2('0x6b'),'it',_0x5dd2('0x6c'))[_0x5dd2('0x63')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3a7ac8=squel[_0x5dd2('0x6d')]();var _0x3a5abd=[];var _0x35524a=squel['expr']();var _0x3e9b35;if(_0x370a41[_0x5dd2('0x51')]['search']){_0x3e9b35=as['parseSearch'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x6e')]);var _0x218f94=_0x3e9b35[_0x5dd2('0x6f')];for(var _0x2ca3d3=0x0;_0x2ca3d3<_0x3e9b35['conditions'][_0x5dd2('0x70')];_0x2ca3d3++){var _0x4e0a74=_0x3e9b35['conditions'][_0x2ca3d3];var _0x5b8301='i';var _0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x4e0a74['field']]);if(!_0x2d8229){switch(_0x4e0a74['field']){case _0x5dd2('0x72'):if(_0x4e0a74[_0x5dd2('0x73')]==0x1){_0x55e347[_0x5dd2('0x74')]('`'+_0x4e0a74[_0x5dd2('0x5d')]+'`\x20=\x200');}else{_0x55e347['having']('`'+_0x4e0a74[_0x5dd2('0x5d')]+'`\x20>\x200');}break;case _0x5dd2('0x75'):if(_0x4e0a74['operator']===_0x5dd2('0x76')){if(_0x4e0a74[_0x5dd2('0x73')][_0x5dd2('0x41')]('\x20')['length']>0x1){_0x3a7ac8[_0x218f94](_0x5dd2('0x77'),qs[_0x5dd2('0x78')](_0x4e0a74[_0x5dd2('0x73')]),null);}else{var _0x5af19c='%'+_0x4e0a74[_0x5dd2('0x73')]+'%';_0x3a7ac8[_0x218f94]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5af19c,_0x5af19c,_0x5af19c);}}else{_0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x5dd2('0x79')]);_0x4e0a74[_0x5dd2('0x5d')]=_0x5dd2('0x79');_0x297ba2=as['buildExpression'](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);}break;case _0x5dd2('0x7c'):var _0x3ee73b=_0x4e0a74['value'][_0x5dd2('0x41')](',')[_0x5dd2('0x3d')](function(_0x568143){return Number(_0x568143);});_0x3ee73b['forEach'](function(_0x225568){_0x35524a['or'](_0x5dd2('0x7d'),'%,'+_0x225568+',%');});_0x3a5abd=_[_0x5dd2('0x7e')](_0x3a5abd,_0x3ee73b);break;case'User':if(_0x4e0a74['operator']===_0x5dd2('0x76')){_0x3a7ac8[_0x218f94](_0x5dd2('0x7f'),'%'+_0x4e0a74[_0x5dd2('0x73')]+'%',null);}else{_0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x5dd2('0x49')]);_0x4e0a74['field']=_0x5dd2('0x49');_0x297ba2=as[_0x5dd2('0x80')](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);}break;case _0x5dd2('0x39'):_0x297ba2=as['buildExpression']('me',null,_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);break;}}else{var _0x297ba2=as[_0x5dd2('0x80')](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2['text'],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')]['end']);}}}else{var _0x264a8e=_(_0x370a41[_0x5dd2('0x51')])[_0x5dd2('0x52')]()['map'](function(_0x409702){return _[_0x5dd2('0x81')](_0x1d4334,[_0x5dd2('0x36'),_0x409702])?_0x409702:undefined;})[_0x5dd2('0x82')]()[_0x5dd2('0x73')]();if(!_[_0x5dd2('0x83')](_0x264a8e)){_0x264a8e[_0x5dd2('0x42')](function(_0x445034){if(_0x445034===_0x5dd2('0x84')){_0x55e347[_0x5dd2('0x85')](_0x5dd2('0x86'),[][_0x5dd2('0x87')](_0x370a41[_0x5dd2('0x51')][_0x445034]));}else if(_0x445034===_0x5dd2('0x88')){var _0x30ef10=JSON[_0x5dd2('0x89')](_0x370a41[_0x5dd2('0x51')][_0x445034])[_0x5dd2('0x8a')];var _0x228089=JSON[_0x5dd2('0x89')](_0x370a41[_0x5dd2('0x51')][_0x445034])['$lte'];_0x55e347[_0x5dd2('0x85')](_0x5dd2('0x8b'),_0x30ef10,_0x228089);}else{if(_0x370a41[_0x5dd2('0x51')][_0x445034]===_0x5dd2('0x8c')){_0x55e347[_0x5dd2('0x85')]('i.'+_0x445034+_0x5dd2('0x8d'));}else{_0x55e347['where']('i.'+_0x445034+_0x5dd2('0x8e'),_0x370a41[_0x5dd2('0x51')][_0x445034]);}}});}if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x8f')]){if(_0x370a41['query'][_0x5dd2('0x8f')]==0x1){_0x55e347[_0x5dd2('0x74')](_0x5dd2('0x90'));}else{_0x55e347[_0x5dd2('0x74')]('`unreadMessages`\x20>\x200');}}if(_0x370a41[_0x5dd2('0x51')]['tag']){_0x3a5abd=_['isArray'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x91')])?_0x370a41['query'][_0x5dd2('0x91')]:new Array(_0x370a41[_0x5dd2('0x51')]['tag']);_0x3a5abd[_0x5dd2('0x42')](function(_0x48b7b8){_0x35524a['or'](_0x5dd2('0x7d'),'%,'+_0x48b7b8+',%');});}if(_0x370a41['query'][_0x5dd2('0x92')]){var _0x16ca90=_0x370a41[_0x5dd2('0x51')]['filter'][_0x5dd2('0x93')]('\x5c','\x5c\x5c')[_0x5dd2('0x93')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x16ca90)){_0x3a7ac8['or'](_0x5dd2('0x94'),_0x16ca90+'%');}else{_0x3a7ac8['or'](_0x5dd2('0x95'),qs['getFullTextValue'](_0x16ca90))['or'](_0x5dd2('0x96'),_0x16ca90+'%');}}}_0x55e347['where'](_0x3a7ac8);_0x55e347[_0x5dd2('0x97')](_0x5dd2('0x98'));var _0x13b469={'type':db[_0x5dd2('0x99')][_0x5dd2('0x9a')]['SELECT'],'raw':!![]};var _0x893d45=_0x55e347[_0x5dd2('0x9b')]();_0x893d45[_0x5dd2('0x5d')](_0x5dd2('0x98'));_0x893d45['field'](_0x5dd2('0x9c'),_0x5dd2('0x72'));if(_0x10fe4b[_0x5dd2('0x59')]){_0x10fe4b[_0x5dd2('0x59')][_0x5dd2('0x42')](function(_0x397f2d){var _0x14c34e=_0x397f2d[0x0]===_0x5dd2('0x9d')?_0x397f2d[0x0]:'i.'+_0x397f2d[0x0];_0x55e347[_0x5dd2('0x59')](_0x14c34e,_0x397f2d[0x1]===_0x5dd2('0x9e')?![]:!![]);});}if(!_[_0x5dd2('0x83')](_0x3a5abd)){_0x55e347[_0x5dd2('0x74')](_0x35524a);_0x893d45['where'](_0x5dd2('0x9f'),_0x3a5abd);}BPromise['resolve']()[_0x5dd2('0x22')](function(){if(!_0x3e9b35){if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x84')])return;_0x893d45[_0x5dd2('0x85')](_0x5dd2('0xa0'));_0x55e347['where'](_0x5dd2('0xa0'));return;}if(_0x370a41[_0x5dd2('0xa1')][_0x5dd2('0xa2')]!==_0x5dd2('0xa3'))return;return _0x370a41['user'][_0x5dd2('0xa4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x31a1ac){if(_['isEmpty'](_0x31a1ac)){_0x893d45[_0x5dd2('0x85')]('i.ChatWebsiteId\x20IS\x20NULL');_0x55e347[_0x5dd2('0x85')](_0x5dd2('0xa5'));}else{_0x893d45[_0x5dd2('0x85')](_0x5dd2('0x86'),_[_0x5dd2('0x3d')](_0x31a1ac,'id'));_0x55e347['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x5dd2('0x3d')](_0x31a1ac,'id'));}});})['then'](function(){if(_0x370a41[_0x5dd2('0xa1')]['role']===_0x5dd2('0xa3')&&!_0x3e9b35&&!_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x84')])return[];return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x893d45[_0x5dd2('0xa7')](),_0x13b469);})['then'](function(_0x100158){_0x178848[_0x5dd2('0x31')]=_0x100158[_0x5dd2('0x70')];if(_0x178848[_0x5dd2('0x31')]===0x0)return[];return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x273092[_0x5dd2('0xa7')](),_0x13b469)[_0x5dd2('0x22')](function(_0x40a821){_0x199c07=_['keyBy'](_0x40a821,'id');_0x13b469=_[_0x5dd2('0x38')](_0x13b469,{'model':db[_0x5dd2('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x56')]){_0x10fe4b[_0x5dd2('0x55')]['forEach'](function(_0x58b3d1){_0x55e347['field']('i.'+_0x58b3d1);});}else{_0x55e347[_0x5dd2('0x5d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5dd2('0x72'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xa8'),_0x5dd2('0xa9'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xaa'),_0x5dd2('0xab'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xac'),_0x5dd2('0x9d'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xad'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xae'),_0x5dd2('0xaf'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb0'),_0x5dd2('0xb1'));_0x55e347[_0x5dd2('0x5d')]('c.email','Contact.email');_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb2'),_0x5dd2('0xb3'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb4'),_0x5dd2('0xb5'));_0x55e347['field'](_0x5dd2('0xb6'),_0x5dd2('0xb7'));_0x55e347['field'](_0x5dd2('0xb8'),_0x5dd2('0xb9'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xba'),'Owner.internal');_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xbb'),_0x5dd2('0x3f'));}if(_0x10fe4b['limit'])_0x55e347['limit'](_0x10fe4b['limit']);if(_0x10fe4b[_0x5dd2('0x2e')])_0x55e347[_0x5dd2('0x2e')](_0x10fe4b[_0x5dd2('0x2e')]);return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x55e347[_0x5dd2('0xa7')](),_0x13b469);})[_0x5dd2('0x22')](function(_0x2bbcf3){if(_0x2bbcf3[_0x5dd2('0x70')]>0x0)_0x3fd77d[_0x5dd2('0x85')](_0x5dd2('0xbc'),_[_0x5dd2('0x3d')](_0x2bbcf3,'id'));return db[_0x5dd2('0xa6')]['query'](_0x3fd77d[_0x5dd2('0xa7')](),_0x13b469)[_0x5dd2('0x22')](function(_0x50bf84){var _0x55e0c2=_['groupBy'](_0x50bf84,_0x5dd2('0xbd'));var _0x461162=[];_0x2bbcf3[_0x5dd2('0x42')](function(_0x9303e9){_0x461162[_0x5dd2('0xbe')](updateChatInteraction(_0x9303e9,_0x199c07,_0x55e0c2));});return BPromise[_0x5dd2('0xbf')](_0x461162);});});})[_0x5dd2('0x22')](function(_0x1be4ba){_0x178848[_0x5dd2('0xc0')]=_0x1be4ba;return _0x178848;})[_0x5dd2('0x22')](respondWithFilteredResult(_0x312f96,_0x10fe4b))[_0x5dd2('0x2a')](handleError(_0x312f96,null));};exports[_0x5dd2('0xc1')]=function(_0x8b320a,_0x248b5c){var _0x50448d={'raw':![],'where':{'id':_0x8b320a[_0x5dd2('0xc2')]['id']}},_0x2304bf={};_0x2304bf[_0x5dd2('0x50')]=_[_0x5dd2('0x52')](db[_0x5dd2('0x4c')][_0x5dd2('0x4d')]);_0x2304bf['query']=_[_0x5dd2('0x52')](_0x8b320a['query']);_0x2304bf[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x2304bf['model'],_0x2304bf[_0x5dd2('0x51')]);_0x50448d[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x2304bf[_0x5dd2('0x50')],qs['fields'](_0x8b320a[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x50448d[_0x5dd2('0x55')]=_0x50448d[_0x5dd2('0x55')]['length']?_0x50448d[_0x5dd2('0x55')]:_0x2304bf[_0x5dd2('0x50')];if(_0x8b320a[_0x5dd2('0x51')][_0x5dd2('0xc3')]){_0x50448d[_0x5dd2('0xc4')]=[{'all':!![]}];}_0x50448d=_[_0x5dd2('0x38')]({},_0x50448d,_0x8b320a['options']);return db[_0x5dd2('0x4c')][_0x5dd2('0x71')](_0x50448d)[_0x5dd2('0x22')](handleEntityNotFound(_0x248b5c,null))[_0x5dd2('0x22')](respondWithResult(_0x248b5c,null))[_0x5dd2('0x2a')](handleError(_0x248b5c,null));};exports['create']=function(_0x3d970e,_0x1e05e0){return db[_0x5dd2('0x4c')]['create'](_0x3d970e[_0x5dd2('0x39')],{})[_0x5dd2('0x22')](respondWithResult(_0x1e05e0,0xc9))[_0x5dd2('0x2a')](handleError(_0x1e05e0,null));};exports[_0x5dd2('0x35')]=function(_0x7dd3f3,_0x27ad08){if(_0x7dd3f3[_0x5dd2('0x39')]['id']){delete _0x7dd3f3[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x7dd3f3[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x27ad08,null))[_0x5dd2('0x22')](saveUpdates(_0x7dd3f3[_0x5dd2('0x39')],null))['then'](respondWithResult(_0x27ad08,null))[_0x5dd2('0x2a')](handleError(_0x27ad08,null));};exports[_0x5dd2('0xc5')]=function(_0x4f1f41,_0x3667bb){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x4f1f41[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3667bb,null))[_0x5dd2('0x22')](removeEntity(_0x3667bb,null))['catch'](handleError(_0x3667bb,null));};exports[_0x5dd2('0xc6')]=function(_0x1f5324,_0x76d7f3){return db[_0x5dd2('0x4c')]['describe']()['then'](respondWithResult(_0x76d7f3,null))[_0x5dd2('0x2a')](handleError(_0x76d7f3,null));};exports[_0x5dd2('0xc7')]=function(_0x4511e6,_0x2d2756){var _0x5b5211=_0x4511e6[_0x5dd2('0xc2')]['id'];var _0xcea6;var _0x2395e2;var _0x216a7a;return db[_0x5dd2('0x4c')][_0x5dd2('0xc8')]({'where':{'id':_0x5b5211}})[_0x5dd2('0x22')](function(_0x34dd3d){_0xcea6=_0x34dd3d;return db[_0x5dd2('0xc9')]['findOne']({'where':{'id':_0x34dd3d['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x5dd2('0xca'),_0x5dd2('0xcb'),'vidaooNote',_0x5dd2('0xcc')],'raw':!![]});})[_0x5dd2('0x22')](function(_0x42edcc){if(_0x42edcc&&_0x42edcc[_0x5dd2('0xcd')]&&_0x42edcc[_0x5dd2('0xca')]){_0x2395e2=_0x42edcc;var _0x57b07a={'interaction':{'id':_0x5b5211},'agent':{'id':_0x4511e6[_0x5dd2('0xa1')]['id'],'name':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0x36')],'fullname':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0x3e')],'email':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0xce')]},'contact':_0x4511e6[_0x5dd2('0x39')][_0x5dd2('0x3a')],'account':_0x4511e6['body']['account']};var _0x90345={'rejectUnauthorized':![],'method':'POST','url':_0x5dd2('0xcf'),'headers':{'X-APIKEY':_0x42edcc[_0x5dd2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0xce')]],'buttons':null,'topic':_0x2395e2['vidaooTopic'],'note':_[_0x5dd2('0xd0')](_0x2395e2['vidaooNote'])?null:getMustacheRender(_0x2395e2[_0x5dd2('0xd1')],_0x57b07a),'metadata':null},'redirect':_0x5dd2('0xd2'),'json':!![]};try{if(!_['isNull'](_0x2395e2[_0x5dd2('0xcc')])){var _0x18cf98=getMustacheRender(_0x2395e2[_0x5dd2('0xcc')],_0x57b07a);var _0x2898b2=JSON['parse'](_0x18cf98);_0x90345['body']['metadata']=_0x2898b2;}}catch(_0x321249){throw new db['Sequelize'][(_0x5dd2('0xd3'))](_0x5dd2('0xd4'));}return rp(_0x90345);}else{throw new db[(_0x5dd2('0x99'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x5dd2('0x22')](function(_0x29ebe2){_0x216a7a=_0x29ebe2;if(_0x216a7a['id']){var _0x5b1485={'body':_0x216a7a['join_url'],'ChatWebsiteId':_0x2395e2['id'],'ChatInteractionId':_0xcea6['id'],'direction':_0x5dd2('0xd5'),'UserId':_0x4511e6[_0x5dd2('0xa1')]['id']};return db[_0x5dd2('0xd6')][_0x5dd2('0xd7')](_0x5b1485,{});}else{throw new db[(_0x5dd2('0x99'))]['ValidationError'](_0x5dd2('0xd8'));}})[_0x5dd2('0x22')](function(){return _0xcea6[_0x5dd2('0xd9')]({'vidaooSessionId':_0x216a7a['id']});})[_0x5dd2('0x22')](respondWithResult(_0x2d2756,null))[_0x5dd2('0x2a')](handleError(_0x2d2756,null));};exports[_0x5dd2('0xda')]=function(_0x3f53ee,_0x2c81e5){if(_0x3f53ee[_0x5dd2('0x39')]['id']){delete _0x3f53ee[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x3f53ee[_0x5dd2('0xc2')]['id']},'include':[{'model':db['CmContact'],'as':_0x5dd2('0x75')}]})['then'](handleEntityNotFound(_0x2c81e5,null))['then'](saveUpdates(_0x3f53ee[_0x5dd2('0x39')],null))[_0x5dd2('0x22')](respondWithResult(_0x2c81e5,null))[_0x5dd2('0x2a')](handleError(_0x2c81e5,null));};exports[_0x5dd2('0xdb')]=function(_0x3c42fb,_0x504c61,_0x896c39){if(_0x3c42fb[_0x5dd2('0x39')]['id']){delete _0x3c42fb[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x3c42fb['params']['id']}})[_0x5dd2('0x22')](function(_0x178911){if(!_0x178911){logger[_0x5dd2('0x27')](_0x5dd2('0xdc'),_0x5dd2('0xdb'),0x194,_0x5dd2('0xdd'));_0x504c61[_0x5dd2('0xde')](0x194);}else{if(_0x178911['UserId']){throw new db[(_0x5dd2('0x99'))][(_0x5dd2('0xd3'))](_0x5dd2('0xdf'));}}return _0x178911;})['then'](function(_0x4c0e71){if(_0x4c0e71){return _0x4c0e71['update']({'closed':_0x3c42fb[_0x5dd2('0x39')]['closed'],'disposition':_0x3c42fb[_0x5dd2('0x39')][_0x5dd2('0xe0')]})[_0x5dd2('0x22')](function(_0x1e8e35){return _0x1e8e35;});}})[_0x5dd2('0x22')](function(_0x54053d){return respondWithRpcPromise(_0x5dd2('0xe1'),_0x5dd2('0xdb'),_0x3c42fb[_0x5dd2('0x39')],client9004);})[_0x5dd2('0x22')](respondWithResult(_0x504c61,null))[_0x5dd2('0x2a')](handleError(_0x504c61,null));};exports[_0x5dd2('0xe2')]=function(_0x2825fe,_0x3219cf,_0x5b4028){_0x2825fe[_0x5dd2('0x39')]['name']=_0x2825fe[_0x5dd2('0xe3')]['originalname'];_0x2825fe[_0x5dd2('0x39')][_0x5dd2('0xe4')]=_0x2825fe[_0x5dd2('0xe3')][_0x5dd2('0xe5')];_0x2825fe[_0x5dd2('0x39')][_0x5dd2('0x4f')]=_0x2825fe['file'][_0x5dd2('0xe6')];return db['Attachment']['create'](_0x2825fe['body'])[_0x5dd2('0x22')](respondWithResult(_0x3219cf,0xc9))[_0x5dd2('0x2a')](handleError(_0x3219cf,null));};exports['attachmentDownload']=function(_0x135bea,_0xe8fb54,_0x2b26cd){return db[_0x5dd2('0x4c')][_0x5dd2('0xc8')]({'where':{'id':_0x135bea[_0x5dd2('0xc2')]['id']},'raw':!![]})[_0x5dd2('0x22')](handleEntityNotFound(_0xe8fb54,null))[_0x5dd2('0x22')](function(_0x73a02e){if(_0x73a02e){if(_0x73a02e[_0x5dd2('0x48')]){return _0xe8fb54[_0x5dd2('0x2c')](0x193)[_0x5dd2('0x2d')]({'status':0x193,'message':_0x5dd2('0xe7')});}return db[_0x5dd2('0xe8')][_0x5dd2('0xc8')]({'where':{'id':_0x135bea['query'][_0x5dd2('0xe9')]},'raw':!![]})[_0x5dd2('0x22')](handleEntityNotFound(_0xe8fb54,null));}})[_0x5dd2('0x22')](function(_0x346cd4){if(_0x346cd4){var _0x53918e=_0x346cd4['ChatOfflineMessageId']!==null;var _0x3288c1=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0xec'));if(_0x53918e){_0x3288c1=path[_0x5dd2('0xea')](_0x3288c1,_0x5dd2('0xed'));}var _0x3f4ff1=path[_0x5dd2('0xea')](_0x3288c1,_0x346cd4[_0x5dd2('0xe4')]);return _0xe8fb54[_0x5dd2('0xee')](_0x3f4ff1);}})[_0x5dd2('0x2a')](handleError(_0xe8fb54,null));};exports[_0x5dd2('0xef')]=function(_0x2f6749,_0x4c5b2e){var _0x3be791=null;var _0x32b2a2=null;var _0x1875bd=null;var _0x57bd4a=null;if(_0x2f6749[_0x5dd2('0x39')]['id']){delete _0x2f6749['body']['id'];}if(_0x2f6749[_0x5dd2('0x39')]['mailTranscript']){_0x57bd4a=path[_0x5dd2('0xea')](config['root'],_0x5dd2('0xf0'),util['format'](_0x5dd2('0xf1'),Date['now']()));_0x2f6749['body'][_0x5dd2('0xf2')]=_0x57bd4a;}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2f6749['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0xf3')}]}]})['then'](handleEntityNotFound(_0x4c5b2e,null))['then'](saveUpdates(_0x2f6749[_0x5dd2('0x39')],null))['then'](function(_0x12ac41){if(_0x12ac41){_0x3be791=_0x12ac41;return db[_0x5dd2('0xc9')][_0x5dd2('0x71')]({'where':{'id':_0x3be791[_0x5dd2('0x84')]}});}})[_0x5dd2('0x22')](function(_0x5d8bfc){if(_0x5d8bfc){_0x1875bd=_0x5d8bfc;return db[_0x5dd2('0xf4')]['find']({'where':{'id':_0x3be791['ContactId']}});}})[_0x5dd2('0x22')](function(_0x1a6eb6){if(_0x1a6eb6){_0x32b2a2=_0x1a6eb6;if(_0x57bd4a){var _0x1108f3=null;for(var _0x27e05c=0x1;_0x27e05c<_0x3be791[_0x5dd2('0xf5')][_0x5dd2('0x70')];++_0x27e05c){_0x1108f3=_0x3be791[_0x5dd2('0xf5')][_0x27e05c];var _0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?util['format'](_0x5dd2('0xf6'),_0x1875bd['agentAlias'],_0x1108f3[_0x5dd2('0x49')]):_0x5dd2('0xf7');var _0x3a598c=_0x2f6749[_0x5dd2('0x39')]['customer']||util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x5dd2('0xf9'),_0x1108f3[_0x5dd2('0x79')]);switch(_0x1875bd['agentIdentifier']){case _0x5dd2('0xfa'):_0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x1875bd[_0x5dd2('0xfb')],_0x1108f3[_0x5dd2('0x49')]):'System';break;case _0x5dd2('0xfc'):_0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?_0x1108f3[_0x5dd2('0xf3')][_0x5dd2('0xfd')]||_0x1108f3['User'][_0x5dd2('0x3e')]:_0x5dd2('0xf7');break;case'agent_fullname':_0x4ef7b5=_0x1108f3['UserId']?_0x1108f3['User']['fullname']:_0x5dd2('0xf7');break;default:_0x4ef7b5=_0x1108f3['UserId']?util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x1875bd[_0x5dd2('0xfb')],_0x1108f3[_0x5dd2('0x49')]):_0x5dd2('0xf7');}var _0xa24829=util['format'](_0x5dd2('0xfe'),moment(_0x1108f3[_0x5dd2('0x88')])[_0x5dd2('0xf8')](_0x5dd2('0xff')),_0x1108f3[_0x5dd2('0x100')]==='in'?_0x3a598c:_0x4ef7b5,_0x1108f3[_0x5dd2('0x39')]);if(!_0x1108f3[_0x5dd2('0x101')]){fs['appendFileSync'](_0x57bd4a,_0xa24829);}}return db[_0x5dd2('0x102')][_0x5dd2('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x5dd2('0x103')],'as':_0x5dd2('0x104'),'raw':!![]}]});}}})[_0x5dd2('0x22')](function(_0x27a8bf){if(_0x27a8bf&&_0x27a8bf['Smtp']&&_0x2f6749['body']){var _0x13bf01={'tls':{'rejectUnauthorized':![]}};if(_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x105')]){_0x13bf01[_0x5dd2('0x105')]=_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x105')];}else{_0x13bf01[_0x5dd2('0x106')]=_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x106')];_0x13bf01[_0x5dd2('0x107')]=_0x27a8bf[_0x5dd2('0x104')]['port'];_0x13bf01['secure']=_0x27a8bf['Smtp'][_0x5dd2('0x108')];}if(_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x109')]){_0x13bf01['auth']={'user':_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0xa1')],'pass':_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x10a')]};}return respondWithRpcPromise(_0x5dd2('0x10b'),_0x5dd2('0x10c'),{'account':_0x13bf01,'message':{'from':util[_0x5dd2('0xf8')](_0x5dd2('0x10d'),_0x27a8bf['name'],_0x27a8bf[_0x5dd2('0xce')]||_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0xa1')]),'to':_0x2f6749['body'][_0x5dd2('0x10e')],'subject':_0x5dd2('0x10f'),'text':util[_0x5dd2('0xf8')](_0x5dd2('0x110'),_0x2f6749[_0x5dd2('0x39')]['mailTranscript']),'attachments':[{'path':_0x57bd4a}]}})[_0x5dd2('0x22')](function(){return _0x3be791;})[_0x5dd2('0x2a')](function(_0x47b58b){console[_0x5dd2('0x27')](_0x47b58b);});}else{return _0x3be791;}})[_0x5dd2('0x22')](respondWithStatusCode(_0x4c5b2e,0xc8))['catch'](handleError(_0x4c5b2e,null));};exports[_0x5dd2('0x111')]=function(_0x24f937,_0x3c3403,_0x5da91c){return db[_0x5dd2('0xd6')][_0x5dd2('0x71')]({'where':{'id':_0x24f937[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3c3403,null))[_0x5dd2('0x22')](function(_0x40afcc){if(_0x40afcc){return _0x40afcc[_0x5dd2('0x111')](_0x24f937[_0x5dd2('0x39')][_0x5dd2('0x112')],_[_0x5dd2('0x113')](_0x24f937[_0x5dd2('0x39')],[_0x5dd2('0x112'),'id'])||{});}})[_0x5dd2('0x22')](respondWithResult(_0x3c3403,null))[_0x5dd2('0x2a')](handleError(_0x3c3403,null));};exports[_0x5dd2('0x114')]=function(_0x2917a3,_0x12879a,_0x548792){var _0x52b1ec={'raw':![],'where':{}};var _0x2a7e97={};var _0x2ec2b3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dd2('0xc8')]({'where':{'id':_0x2917a3[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x12879a,null))['then'](function(_0x49544c){if(_0x49544c){_0x2a7e97[_0x5dd2('0x50')]=_[_0x5dd2('0x52')](db[_0x5dd2('0xd6')]['rawAttributes']);_0x2a7e97[_0x5dd2('0x51')]=_[_0x5dd2('0x52')](_0x2917a3[_0x5dd2('0x51')]);_0x2a7e97[_0x5dd2('0x53')]=_['intersection'](_0x2a7e97['model'],_0x2a7e97['query']);_0x52b1ec[_0x5dd2('0x55')]=_['intersection'](_0x2a7e97['model'],qs[_0x5dd2('0x56')](_0x2917a3['query'][_0x5dd2('0x56')]));_0x52b1ec[_0x5dd2('0x55')]=_0x52b1ec[_0x5dd2('0x55')]['length']?_0x52b1ec[_0x5dd2('0x55')]:_0x2a7e97['model'];if(!_0x2917a3['query'][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x52b1ec[_0x5dd2('0x30')]=qs[_0x5dd2('0x30')](_0x2917a3[_0x5dd2('0x51')]['limit']);_0x52b1ec[_0x5dd2('0x2e')]=qs[_0x5dd2('0x2e')](_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x52b1ec[_0x5dd2('0x59')]=qs[_0x5dd2('0x5a')](_0x2917a3[_0x5dd2('0x51')]['sort']);_0x52b1ec[_0x5dd2('0x85')]=qs['filters'](_[_0x5dd2('0x5b')](_0x2917a3['query'],_0x2a7e97[_0x5dd2('0x53')]));_0x52b1ec[_0x5dd2('0x85')][_0x5dd2('0xbd')]=_0x49544c['id'];if(_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x92')]){_0x52b1ec[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x52b1ec[_0x5dd2('0x85')],{'$or':_[_0x5dd2('0x3d')](_0x52b1ec['attributes'],function(_0x2b8efe){var _0x50bb6b={};_0x50bb6b[_0x2b8efe]={'$like':'%'+_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x92')]+'%'};return _0x50bb6b;})});}if(_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x8a')]){var _0x25d352=_0x2917a3[_0x5dd2('0x51')]['$gte'][_0x5dd2('0x41')](',');var _0xec3c15={};_0xec3c15[_0x25d352[0x0]]={'$gte':moment(_0x25d352[0x1])[_0x5dd2('0xf8')](_0x5dd2('0x115'))};_0x52b1ec[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x52b1ec[_0x5dd2('0x85')],_0xec3c15);}_0x52b1ec=_[_0x5dd2('0x38')]({},_0x52b1ec,_0x2917a3[_0x5dd2('0x116')]);return db[_0x5dd2('0xd6')][_0x5dd2('0x31')]({'where':_0x52b1ec[_0x5dd2('0x85')]})['then'](function(_0x590f8e){_0x2ec2b3[_0x5dd2('0x31')]=_0x590f8e;if(_0x2917a3[_0x5dd2('0x51')]['includeAll']){_0x52b1ec['include']=[{'all':!![]}];}return db[_0x5dd2('0xd6')]['findAll'](_0x52b1ec);})[_0x5dd2('0x22')](function(_0x440924){_0x2ec2b3[_0x5dd2('0xc0')]=_0x440924;return _0x2ec2b3;});}})['then'](respondWithFilteredResult(_0x12879a,_0x52b1ec))[_0x5dd2('0x2a')](handleError(_0x12879a,null));};exports[_0x5dd2('0x117')]=function(_0x3a3633,_0x12f6ec,_0x52c8b1){var _0x14914b={'where':{}},_0x5d6514={},_0x393065={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dd2('0xc8')]({'where':{'id':_0x3a3633[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x12f6ec,null))[_0x5dd2('0x22')](function(_0xf869b9){if(_0xf869b9){_0x5d6514['model']=_['keys'](db[_0x5dd2('0xd6')]['rawAttributes']);_0x5d6514['query']=_[_0x5dd2('0x52')](_0x3a3633[_0x5dd2('0x51')]);_0x5d6514[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x5d6514[_0x5dd2('0x50')],_0x5d6514['query']);_0x14914b[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x5d6514[_0x5dd2('0x50')],qs[_0x5dd2('0x56')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x14914b[_0x5dd2('0x55')]=_0x14914b[_0x5dd2('0x55')]['length']?_0x14914b['attributes']:_0x5d6514[_0x5dd2('0x50')];if(!_0x3a3633['query'][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x14914b[_0x5dd2('0x30')]=qs['limit'](_0x3a3633[_0x5dd2('0x51')]['limit']);_0x14914b['offset']=qs[_0x5dd2('0x2e')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x14914b['order']=qs[_0x5dd2('0x5a')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x5a')]);_0x14914b[_0x5dd2('0x85')]=qs[_0x5dd2('0x53')](_[_0x5dd2('0x5b')](_0x3a3633[_0x5dd2('0x51')],_0x5d6514[_0x5dd2('0x53')]));_0x14914b[_0x5dd2('0x85')][_0x5dd2('0xbd')]=_0xf869b9['id'];if(_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x92')]){_0x14914b[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x14914b['where'],{'$or':_[_0x5dd2('0x3d')](_0x14914b[_0x5dd2('0x55')],function(_0x46d372){var _0x5d4ff6={};_0x5d4ff6[_0x46d372]={'$like':'%'+_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x92')]+'%'};return _0x5d4ff6;})});}_0x14914b[_0x5dd2('0x85')]['secret']=![];if(_0x3a3633[_0x5dd2('0x51')]['id']){_0x14914b['where']['id']={'$gt':_0x3a3633[_0x5dd2('0x51')]['id']};}_0x14914b=_[_0x5dd2('0x38')]({},_0x14914b,_0x3a3633[_0x5dd2('0x116')]);return db[_0x5dd2('0xd6')][_0x5dd2('0x31')]({'where':_0x14914b['where']})[_0x5dd2('0x22')](function(_0x750e94){_0x393065[_0x5dd2('0x31')]=_0x750e94;_0x14914b[_0x5dd2('0xc4')]=[];if(_0x3a3633['query'][_0x5dd2('0x118')]){_0x14914b['include'][_0x5dd2('0xbe')]({'model':db['User'],'as':_0x5dd2('0xf3'),'attributes':['id',_0x5dd2('0x3e'),_0x5dd2('0xfd')]});}if(_0x3a3633['query'][_0x5dd2('0xc3')]){_0x14914b['include']=[{'all':!![]}];}return db[_0x5dd2('0xd6')][_0x5dd2('0x119')](_0x14914b);})[_0x5dd2('0x22')](function(_0x1d8ee4){_0x393065[_0x5dd2('0xc0')]=_0x1d8ee4;return _0x393065;});}})[_0x5dd2('0x22')](respondWithFilteredResult(_0x12f6ec,_0x14914b))['catch'](handleError(_0x12f6ec,null));};exports[_0x5dd2('0x11a')]=function(_0x2acb5d,_0x3c306c,_0x3c1864){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2acb5d[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3c306c,null))[_0x5dd2('0x22')](function(_0x3520b9){if(_0x3520b9){return _0x3520b9[_0x5dd2('0x11b')](_0x2acb5d['body']['ids'],_[_0x5dd2('0x113')](_0x2acb5d[_0x5dd2('0x39')],[_0x5dd2('0x112'),'id'])||{})[_0x5dd2('0x11c')](function(){return db[_0x5dd2('0x7c')][_0x5dd2('0x119')]({'attributes':['id',_0x5dd2('0x36'),_0x5dd2('0x5e')],'where':{'id':_0x2acb5d[_0x5dd2('0x39')][_0x5dd2('0x112')]}});})[_0x5dd2('0x22')](function(_0x5e4a53){socket[_0x5dd2('0x11d')]('chatInteractionTags:save',{'id':Number(_0x2acb5d['params']['id']),'tags':_0x5e4a53||[]});return{'id':Number(_0x2acb5d['params']['id']),'tags':_0x5e4a53||[]};});}})['then'](respondWithResult(_0x3c306c,null))['catch'](handleError(_0x3c306c,null));};exports['removeTags']=function(_0x2c64b4,_0x563b70,_0x1f62d4){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2c64b4['params']['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x563b70,null))[_0x5dd2('0x22')](function(_0x5bf732){if(_0x5bf732){return _0x5bf732[_0x5dd2('0x11e')](_0x2c64b4['query'][_0x5dd2('0x112')]);}})[_0x5dd2('0x22')](respondWithStatusCode(_0x563b70,null))[_0x5dd2('0x2a')](handleError(_0x563b70,null));};exports[_0x5dd2('0xee')]=function(_0x296593,_0x42ffe8){var _0x49a7fe=moment()[_0x5dd2('0x11f')]()[_0x5dd2('0xa7')]();var _0x3c80b1=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),_0x5dd2('0x121'),_0x5dd2('0x122'));var _0xde7b58=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),'files',_0x5dd2('0x123'));var _0x214f31=path['join'](_0x3c80b1,_0x49a7fe);var _0x5e3baa=util[_0x5dd2('0xf8')](_0x5dd2('0x124'),_0x296593[_0x5dd2('0xc2')]['id'],_0x49a7fe);var _0x329b77=path['join'](_0x3c80b1,_0x5e3baa);var _0x58149d=[];_0x58149d[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0xf3'),'attributes':['id',_0x5dd2('0x3e')],'raw':!![]});_0x58149d[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf4')],'as':_0x5dd2('0x75'),'attributes':['id',_0x5dd2('0x125'),_0x5dd2('0x126')],'raw':!![]});if(_0x296593['query'][_0x5dd2('0x123')]){_0x58149d['push']({'model':db[_0x5dd2('0xe8')],'as':'Attachment','raw':!![]});}var _0x1b6456=[{'model':db[_0x5dd2('0xd6')],'as':_0x5dd2('0xf5'),'attributes':['id',_0x5dd2('0x39'),_0x5dd2('0x88'),_0x5dd2('0x100'),'secret','read'],'include':_0x58149d}];_0x1b6456[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xc9')],'as':'Account','attributes':['id',_0x5dd2('0x36')]});_0x1b6456[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0x127'),'attributes':['id',_0x5dd2('0x3e')]});return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x296593[_0x5dd2('0xc2')]['id']},'include':_0x1b6456})[_0x5dd2('0x22')](handleEntityNotFound(_0x42ffe8,null))[_0x5dd2('0x22')](function(_0x5dd43f){if(_0x5dd43f){var _0x3adb02=_0x5dd43f['get']({'plain':!![]});fs[_0x5dd2('0x128')](_0x214f31);var _0x5ee73d={'channel':_0x5dd2('0x129'),'account':_0x3adb02[_0x5dd2('0x12a')]['name'],'agent':_0x3adb02['Owner']?_0x3adb02['Owner'][_0x5dd2('0x3e')]:'N.A.','createdAt':moment(_0x3adb02['createdAt'])['format'](_0x5dd2('0x115'))[_0x5dd2('0xa7')](),'closedAt':_0x3adb02[_0x5dd2('0x48')]?moment(_0x3adb02[_0x5dd2('0x12b')])[_0x5dd2('0xf8')](_0x5dd2('0x115'))['toString']():'','disposition':_0x3adb02['disposition'],'chatInfo':{'browser':_0x3adb02[_0x5dd2('0x12c')],'os':_0x3adb02[_0x5dd2('0x12d')],'referer':_0x3adb02['referer'],'customerIp':_0x3adb02[_0x5dd2('0x12e')],'customerPort':_0x3adb02[_0x5dd2('0x12f')]?_0x3adb02['customerPort']:'N.A.'},'messages':_(_0x3adb02[_0x5dd2('0xf5')])[_0x5dd2('0x130')]()[_0x5dd2('0x92')]({'secret':![]})[_0x5dd2('0x3d')](function(_0x4ba4cd){if(_0x4ba4cd[_0x5dd2('0xe8')]){var _0x4d2d3f=path[_0x5dd2('0xea')](_0xde7b58,_0x4ba4cd[_0x5dd2('0xe8')]['basename']);if(fs[_0x5dd2('0x131')](_0x4d2d3f)){fs[_0x5dd2('0x132')](_0x4d2d3f)[_0x5dd2('0x133')](fs['createWriteStream'](path['join'](_0x214f31,_0x4ba4cd['Attachment']['basename'])));}}return{'date':moment(_0x4ba4cd[_0x5dd2('0x88')])[_0x5dd2('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5dd2('0xa7')](),'sender':_0x4ba4cd[_0x5dd2('0x100')]==='out'?_0x4ba4cd[_0x5dd2('0xf3')]?_0x4ba4cd[_0x5dd2('0xf3')]['fullname']:_0x5dd2('0xf7'):_0x4ba4cd[_0x5dd2('0x75')]['firstName']+(_0x4ba4cd[_0x5dd2('0x75')]['lastName']?'\x20'+_0x4ba4cd['Contact']['lastName']:''),'body':_0x4ba4cd[_0x5dd2('0xe8')]?_0x4ba4cd[_0x5dd2('0xe8')][_0x5dd2('0xe4')]:_0x4ba4cd[_0x5dd2('0x39')],'direction':_0x4ba4cd[_0x5dd2('0x100')]===_0x5dd2('0xd5')?'A':'C','secret':_0x4ba4cd[_0x5dd2('0x101')],'read':_0x4ba4cd[_0x5dd2('0x8f')],'attachment':_0x4ba4cd[_0x5dd2('0xe8')]};})[_0x5dd2('0x73')]()};return ejs[_0x5dd2('0x134')](path['join'](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),'views',_0x5dd2('0x135')),{'interaction':_0x5ee73d})[_0x5dd2('0x22')](function(_0x442117){var _0x4b5a4d=path[_0x5dd2('0xea')](_0x214f31,_0x5dd2('0x136')+_0x3adb02['id']+'-'+_0x49a7fe+_0x5dd2('0x137'));var _0x4dc376={'path':_0x4b5a4d,'channel':_0x5dd2('0x129'),'interactionId':_0x3adb02['id']};return pdf[_0x5dd2('0x138')](_0x442117,_0x4dc376);})[_0x5dd2('0x22')](function(){return new BPromise(function(_0x2b011b,_0xcc8314){zipdir(_0x214f31,{'saveTo':_0x329b77},function(_0xadd498,_0x406d2a){if(_0xadd498)return _0xcc8314(_0xadd498);return _0x2b011b(_0x406d2a);});})[_0x5dd2('0x22')](function(){return new BPromise(function(_0x479e35,_0x2ae2de){rimraf(_0x214f31,function(_0x9ae52e){if(_0x9ae52e)_0x2ae2de(_0x9ae52e);return _0x479e35();});});})[_0x5dd2('0x22')](function(){return _0x42ffe8[_0x5dd2('0xee')](_0x329b77,_0x5e3baa,function(_0x2505a7){if(_0x2505a7){console[_0x5dd2('0x139')](_0x5dd2('0x13a'),_0x2505a7);}else{fs[_0x5dd2('0x13b')](_0x329b77);}});});});}else{return _0x42ffe8['sendStatus'](0xc8);}})[_0x5dd2('0x2a')](handleError(_0x42ffe8,null));}; \ No newline at end of file +var _0x003c=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','show','fields','include','options','create','params','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','account','POST','vidaooNote','follow','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','filename','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','basename','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','System','customer','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','includeAgent','addTags','setTags','omit','spread','emit','chatInteractionTags:save','removeTags','download','root','files','tmp','server','attachments','transcript-%d-%s.zip','Owner','get','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','createWriteStream','firstName','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','stack','name','render','contact','agent','interaction','Users','map','fullname','TagIds','Tags','forEach','push','waiting','talking','answered','unmanaged','abandoned','closed','UserId','disposition','total','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','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?','body','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte'];(function(_0x59de2a,_0x264f62){var _0x1d18d2=function(_0x5c1a5a){while(--_0x5c1a5a){_0x59de2a['push'](_0x59de2a['shift']());}};_0x1d18d2(++_0x264f62);}(_0x003c,0x1ef));var _0xc003=function(_0x502ded,_0x1a6f19){_0x502ded=_0x502ded-0x0;var _0x37e8c3=_0x003c[_0x502ded];return _0x37e8c3;};'use strict';var emlformat=require(_0xc003('0x0'));var rimraf=require(_0xc003('0x1'));var zipdir=require(_0xc003('0x2'));var jsonpatch=require(_0xc003('0x3'));var rp=require(_0xc003('0x4'));var moment=require(_0xc003('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc003('0x6'));var util=require(_0xc003('0x7'));var path=require(_0xc003('0x8'));var sox=require(_0xc003('0x9'));var csv=require(_0xc003('0xa'));var ejs=require(_0xc003('0xb'));var fs=require('fs');var fs_extra=require(_0xc003('0xc'));var _=require(_0xc003('0xd'));var squel=require(_0xc003('0xe'));var crypto=require(_0xc003('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc003('0x10'));var toCsv=require(_0xc003('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc003('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xc003('0x12'));var hardwareService=require(_0xc003('0x13'));var logger=require(_0xc003('0x14'))('api');var utils=require(_0xc003('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc003('0x16'));var db=require(_0xc003('0x17'))['db'];config[_0xc003('0x18')]=_[_0xc003('0x19')](config[_0xc003('0x18')],{'host':_0xc003('0x1a'),'port':0x18eb});var socket=require(_0xc003('0x1b'))(new Redis(config['redis']));require(_0xc003('0x1c'))[_0xc003('0x1d')](socket);var jayson=require(_0xc003('0x1e'));var client=jayson[_0xc003('0x1f')][_0xc003('0x20')]({'port':0x232b});var client9004=jayson[_0xc003('0x1f')][_0xc003('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3a3648,_0x2c9677,_0x4ee9a7,_0x45c53d){return new BPromise(function(_0x5eee41,_0x4e61da){var _0xb208eb=_0x45c53d||client;return _0xb208eb['request'](_0x3a3648,_0x4ee9a7)[_0xc003('0x21')](function(_0x35760b){logger[_0xc003('0x22')](_0xc003('0x23'),_0x2c9677,_0xc003('0x24'));logger[_0xc003('0x25')](_0xc003('0x26'),_0x2c9677,'request\x20sent',JSON['stringify'](_0x35760b));if(_0x35760b[_0xc003('0x27')]){if(_0x35760b[_0xc003('0x27')][_0xc003('0x28')]===0x1f4){logger['error'](_0xc003('0x23'),_0x2c9677,_0x35760b[_0xc003('0x27')][_0xc003('0x29')]);return _0x4e61da(_0x35760b[_0xc003('0x27')][_0xc003('0x29')]);}logger['error'](_0xc003('0x23'),_0x2c9677,_0x35760b['error']['message']);return _0x5eee41(_0x35760b[_0xc003('0x27')][_0xc003('0x29')]);}else{logger[_0xc003('0x22')](_0xc003('0x23'),_0x2c9677,_0xc003('0x24'));_0x5eee41(_0x35760b[_0xc003('0x2a')][_0xc003('0x29')]);}})[_0xc003('0x2b')](function(_0x24e127){logger['error'](_0xc003('0x23'),_0x2c9677,_0x24e127);_0x4e61da(_0x24e127);});});}function respondWithStatusCode(_0x546327,_0xddabf9){_0xddabf9=_0xddabf9||0xcc;return function(_0x5b2cc1){if(_0x5b2cc1){return _0x546327[_0xc003('0x2c')](_0xddabf9);}return _0x546327['status'](_0xddabf9)[_0xc003('0x2d')]();};}function respondWithResult(_0x156cd9,_0x2ec34f){_0x2ec34f=_0x2ec34f||0xc8;return function(_0xc9ba37){if(_0xc9ba37){return _0x156cd9[_0xc003('0x2e')](_0x2ec34f)['json'](_0xc9ba37);}};}function respondWithFilteredResult(_0x52a89a,_0x327ff3){return function(_0x26f9c3){if(_0x26f9c3){var _0x30bb2a=typeof _0x327ff3[_0xc003('0x2f')]==='undefined'&&typeof _0x327ff3[_0xc003('0x30')]===_0xc003('0x31');var _0x320998=_0x26f9c3[_0xc003('0x32')];var _0xbc8342=_0x30bb2a?0x0:_0x327ff3[_0xc003('0x2f')];var _0x560c44=_0x30bb2a?_0x26f9c3[_0xc003('0x32')]:_0x327ff3['offset']+_0x327ff3[_0xc003('0x30')];var _0x33df9c;if(_0x560c44>=_0x320998){_0x560c44=_0x320998;_0x33df9c=0xc8;}else{_0x33df9c=0xce;}_0x52a89a[_0xc003('0x2e')](_0x33df9c);return _0x52a89a[_0xc003('0x33')](_0xc003('0x34'),_0xbc8342+'-'+_0x560c44+'/'+_0x320998)[_0xc003('0x35')](_0x26f9c3);}return null;};}function patchUpdates(_0x45b498){return function(_0x431eb1){try{jsonpatch[_0xc003('0x36')](_0x431eb1,_0x45b498,!![]);}catch(_0x5e3c65){return BPromise[_0xc003('0x37')](_0x5e3c65);}return _0x431eb1['save']();};}function saveUpdates(_0x51fc12,_0xf9cdf7){return function(_0x257f6a){if(_0x257f6a){return _0x257f6a[_0xc003('0x38')](_0x51fc12)['then'](function(_0x53726b){return _0x53726b;});}return null;};}function removeEntity(_0x4827fa,_0x2183ae){return function(_0x48e0f6){if(_0x48e0f6){return _0x48e0f6[_0xc003('0x39')]()[_0xc003('0x21')](function(){_0x4827fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bbff5,_0x15c643){return function(_0x49f80b){if(!_0x49f80b){_0x4bbff5[_0xc003('0x2c')](0x194);}return _0x49f80b;};}function handleError(_0x55671b,_0x4d3dc8){_0x4d3dc8=_0x4d3dc8||0x1f4;return function(_0x35aef0){logger['error'](_0x35aef0[_0xc003('0x3a')]);if(_0x35aef0[_0xc003('0x3b')]){delete _0x35aef0[_0xc003('0x3b')];}_0x55671b['status'](_0x4d3dc8)['send'](_0x35aef0);};}function getMustacheRender(_0x3cfad9,_0x42d62b){return Mustache[_0xc003('0x3c')](_0x3cfad9,_['merge'](_0x42d62b['body'],{'contact':_0x42d62b[_0xc003('0x3d')],'message':_0x42d62b[_0xc003('0x29')],'agent':_0x42d62b[_0xc003('0x3e')],'interaction':_0x42d62b[_0xc003('0x3f')],'account':_0x42d62b['account']}))||'';}function getInteractionUsers(_0x9f5ce0,_0x3afabe){return new BPromise(function(_0x5d1e80,_0x5d2a8e){try{if(_0x3afabe[_0x9f5ce0['id']]){_0x9f5ce0[_0xc003('0x40')]=_[_0xc003('0x41')](_0x3afabe[_0x9f5ce0['id']],function(_0x41ba41){return{'id':_0x41ba41['id'],'fullname':_0x41ba41[_0xc003('0x42')]};});}}catch(_0x2aeeaf){_0x5d2a8e(_0x2aeeaf);}_0x5d1e80(_0x9f5ce0);});}function getInteractionTags(_0x2252d1,_0x2a58ec){return new BPromise(function(_0x3b5a7e,_0x2ca890){try{if(_0x2252d1[_0xc003('0x43')]){_0x2252d1[_0xc003('0x44')]=[];_0x2252d1[_0xc003('0x43')]['split'](',')[_0xc003('0x45')](function(_0x1d04cb){_0x2252d1[_0xc003('0x44')][_0xc003('0x46')](_0x2a58ec[_0x1d04cb]);});}delete _0x2252d1[_0xc003('0x43')];}catch(_0x301258){_0x2ca890(_0x301258);}_0x3b5a7e(_0x2252d1);});}function updateChatInteraction(_0x4d0d54,_0x22f8ef,_0x5c9a40){return new BPromise(function(_0x3e29b5,_0x1236a9){return getInteractionUsers(_0x4d0d54,_0x5c9a40)['then'](function(_0x457510){return getInteractionTags(_0x457510,_0x22f8ef);})[_0xc003('0x21')](function(_0x19fade){return getStateInteraction(_0x19fade);})['then'](function(_0x4de729){_0x3e29b5(_0x4de729);})[_0xc003('0x2b')](function(_0x54fdeb){_0x1236a9(_0x54fdeb);});});}function getStateInteraction(_0x59396f){return new BPromise(function(_0x3154e5){_0x59396f[_0xc003('0x47')]=0x0;_0x59396f[_0xc003('0x48')]=0x0;_0x59396f[_0xc003('0x49')]=0x0;_0x59396f[_0xc003('0x4a')]=0x0;_0x59396f[_0xc003('0x4b')]=0x0;_0x59396f['total']=0x0;if(!_0x59396f[_0xc003('0x4c')]&&!_0x59396f[_0xc003('0x4d')]){_0x59396f['waiting']+=0x1;}if(!_0x59396f[_0xc003('0x4c')]&&_0x59396f['UserId']){_0x59396f[_0xc003('0x48')]+=0x1;if(_0x59396f[_0xc003('0x47')]){_0x59396f[_0xc003('0x47')]-=0x1;}}if(_0x59396f[_0xc003('0x4c')]&&_0x59396f[_0xc003('0x4e')]===_0xc003('0x4b')){_0x59396f[_0xc003('0x4b')]+=0x1;if(_0x59396f[_0xc003('0x47')]){_0x59396f[_0xc003('0x47')]-=0x1;}}else if(_0x59396f[_0xc003('0x4c')]&&!_0x59396f[_0xc003('0x4d')]&&_0x59396f[_0xc003('0x4e')]){_0x59396f['unmanaged']+=0x1;if(_0x59396f[_0xc003('0x47')]){_0x59396f[_0xc003('0x47')]-=0x1;}}else if(_0x59396f[_0xc003('0x4c')]&&_0x59396f[_0xc003('0x4d')]){_0x59396f[_0xc003('0x49')]+=0x1;if(_0x59396f[_0xc003('0x48')]){_0x59396f[_0xc003('0x48')]-=0x1;}}_0x59396f[_0xc003('0x4f')]+=0x1;_0x3154e5(_0x59396f);});}exports[_0xc003('0x50')]=function(_0x8437ae,_0x53f58d){var _0x1fb1d2={},_0x2985cf={},_0x54fb07={'count':0x0,'rows':[]};var _0x9299c4=_['map'](db['ChatInteraction'][_0xc003('0x51')],function(_0x49ff1a){return{'name':_0x49ff1a[_0xc003('0x52')],'type':_0x49ff1a[_0xc003('0x53')]['key']};});_0x2985cf[_0xc003('0x54')]=_[_0xc003('0x41')](_0x9299c4,_0xc003('0x3b'));_0x2985cf[_0xc003('0x55')]=_[_0xc003('0x56')](_0x8437ae['query']);_0x2985cf[_0xc003('0x57')]=_[_0xc003('0x58')](_0x2985cf[_0xc003('0x54')],_0x2985cf[_0xc003('0x55')]);_0x1fb1d2[_0xc003('0x59')]=_['intersection'](_0x2985cf[_0xc003('0x54')],qs['fields'](_0x8437ae[_0xc003('0x55')]['fields']));_0x1fb1d2['attributes']=_0x1fb1d2['attributes']['length']?_0x1fb1d2[_0xc003('0x59')]:_0x2985cf[_0xc003('0x54')];if(!_0x8437ae[_0xc003('0x55')][_0xc003('0x5a')]('nolimit')){_0x1fb1d2[_0xc003('0x30')]=qs[_0xc003('0x30')](_0x8437ae['query'][_0xc003('0x30')]);_0x1fb1d2['offset']=qs[_0xc003('0x2f')](_0x8437ae[_0xc003('0x55')]['offset']);}_0x1fb1d2[_0xc003('0x5b')]=qs[_0xc003('0x5c')](_0x8437ae[_0xc003('0x55')][_0xc003('0x5c')]);_0x1fb1d2[_0xc003('0x5d')]=qs[_0xc003('0x57')](_[_0xc003('0x5e')](_0x8437ae[_0xc003('0x55')],_0x2985cf[_0xc003('0x57')]),_0x9299c4);var _0x5dcd46=[];var _0x40f2f7=squel['select']()[_0xc003('0x5f')]('id')['field'](_0xc003('0x3b'))['field'](_0xc003('0x60'))['from'](_0xc003('0x61'));var _0x87ff76=squel[_0xc003('0x62')]()['field'](_0xc003('0x63'))['field']('u.fullname')[_0xc003('0x5f')](_0xc003('0x64'))['from'](_0xc003('0x65'),'ui')[_0xc003('0x66')](_0xc003('0x67'),'u',_0xc003('0x68'));var _0x35826c=squel[_0xc003('0x62')]()['from'](_0xc003('0x69'),'i')[_0xc003('0x66')](_0xc003('0x6a'),'c',_0xc003('0x6b'))[_0xc003('0x66')](_0xc003('0x67'),'o',_0xc003('0x6c'))[_0xc003('0x66')]('chat_websites','a',_0xc003('0x6d'))[_0xc003('0x66')]('chat_messages','me',_0xc003('0x6e'))['left_join'](_0xc003('0x6f'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xc003('0x66')](_0xc003('0x61'),'t',_0xc003('0x70'));var _0x1fedd4=squel[_0xc003('0x71')]();var _0x107bac=[];var _0x208899=squel[_0xc003('0x71')]();var _0x292932;if(_0x8437ae['query'][_0xc003('0x72')]){_0x292932=as[_0xc003('0x73')](_0x8437ae[_0xc003('0x55')][_0xc003('0x72')]);var _0x9849aa=_0x292932[_0xc003('0x74')];for(var _0x1e5452=0x0;_0x1e5452<_0x292932[_0xc003('0x75')][_0xc003('0x76')];_0x1e5452++){var _0x6420ee=_0x292932[_0xc003('0x75')][_0x1e5452];var _0x774913='i';var _0x3e5bdc=_[_0xc003('0x77')](_0x9299c4,[_0xc003('0x3b'),_0x6420ee[_0xc003('0x5f')]]);if(!_0x3e5bdc){switch(_0x6420ee[_0xc003('0x5f')]){case _0xc003('0x78'):if(_0x6420ee['value']==0x1){_0x35826c[_0xc003('0x79')]('`'+_0x6420ee[_0xc003('0x5f')]+_0xc003('0x7a'));}else{_0x35826c[_0xc003('0x79')]('`'+_0x6420ee['field']+'`\x20>\x200');}break;case _0xc003('0x7b'):if(_0x6420ee[_0xc003('0x7c')]===_0xc003('0x7d')){if(_0x6420ee['value'][_0xc003('0x7e')]('\x20')[_0xc003('0x76')]>0x1){_0x1fedd4[_0x9849aa](_0xc003('0x7f'),qs[_0xc003('0x80')](_0x6420ee['value']),null);}else{var _0x73b4a8='%'+_0x6420ee[_0xc003('0x81')]+'%';_0x1fedd4[_0x9849aa]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x73b4a8,_0x73b4a8,_0x73b4a8);}}else{_0x3e5bdc=_[_0xc003('0x77')](_0x9299c4,[_0xc003('0x3b'),_0xc003('0x82')]);_0x6420ee[_0xc003('0x5f')]=_0xc003('0x82');_0x5921ee=as[_0xc003('0x83')](_0x774913,_0x3e5bdc['type'],_0x6420ee);_0x1fedd4[_0x9849aa](_0x5921ee[_0xc003('0x84')],_0x5921ee[_0xc003('0x81')][_0xc003('0x85')],_0x5921ee[_0xc003('0x81')]['end']);}break;case _0xc003('0x86'):var _0x45844a=_0x6420ee[_0xc003('0x81')]['split'](',')[_0xc003('0x41')](function(_0x1287c8){return Number(_0x1287c8);});_0x45844a['forEach'](function(_0x52b899){_0x208899['or'](_0xc003('0x87'),'%,'+_0x52b899+',%');});_0x107bac=_[_0xc003('0x88')](_0x107bac,_0x45844a);break;case _0xc003('0x89'):if(_0x6420ee[_0xc003('0x7c')]===_0xc003('0x7d')){_0x1fedd4[_0x9849aa](_0xc003('0x8a'),'%'+_0x6420ee[_0xc003('0x81')]+'%',null);}else{_0x3e5bdc=_['find'](_0x9299c4,['name',_0xc003('0x4d')]);_0x6420ee[_0xc003('0x5f')]=_0xc003('0x4d');_0x5921ee=as[_0xc003('0x83')](_0x774913,_0x3e5bdc['type'],_0x6420ee);_0x1fedd4[_0x9849aa](_0x5921ee[_0xc003('0x84')],_0x5921ee[_0xc003('0x81')]['start'],_0x5921ee[_0xc003('0x81')][_0xc003('0x2d')]);}break;case _0xc003('0x8b'):_0x5921ee=as[_0xc003('0x83')]('me',null,_0x6420ee);_0x1fedd4[_0x9849aa](_0x5921ee[_0xc003('0x84')],_0x5921ee[_0xc003('0x81')][_0xc003('0x85')],_0x5921ee[_0xc003('0x81')]['end']);break;}}else{var _0x5921ee=as[_0xc003('0x83')](_0x774913,_0x3e5bdc['type'],_0x6420ee);_0x1fedd4[_0x9849aa](_0x5921ee['text'],_0x5921ee['value'][_0xc003('0x85')],_0x5921ee[_0xc003('0x81')]['end']);}}}else{var _0x2f8b9d=_(_0x8437ae[_0xc003('0x55')])[_0xc003('0x56')]()[_0xc003('0x41')](function(_0x5b4330){return _['some'](_0x9299c4,[_0xc003('0x3b'),_0x5b4330])?_0x5b4330:undefined;})[_0xc003('0x8c')]()[_0xc003('0x81')]();if(!_[_0xc003('0x8d')](_0x2f8b9d)){_0x2f8b9d[_0xc003('0x45')](function(_0x1daa9f){if(_0x1daa9f===_0xc003('0x8e')){_0x35826c['where'](_0xc003('0x8f'),[][_0xc003('0x90')](_0x8437ae[_0xc003('0x55')][_0x1daa9f]));}else if(_0x1daa9f===_0xc003('0x91')){var _0x425a7a=JSON['parse'](_0x8437ae[_0xc003('0x55')][_0x1daa9f])[_0xc003('0x92')];var _0x1ef572=JSON[_0xc003('0x93')](_0x8437ae[_0xc003('0x55')][_0x1daa9f])[_0xc003('0x94')];_0x35826c[_0xc003('0x5d')](_0xc003('0x95'),_0x425a7a,_0x1ef572);}else{if(_0x8437ae['query'][_0x1daa9f]===_0xc003('0x96')){_0x35826c[_0xc003('0x5d')]('i.'+_0x1daa9f+'\x20IS\x20NULL');}else{_0x35826c[_0xc003('0x5d')]('i.'+_0x1daa9f+_0xc003('0x97'),_0x8437ae[_0xc003('0x55')][_0x1daa9f]);}}});}if(_0x8437ae['query'][_0xc003('0x98')]){if(_0x8437ae[_0xc003('0x55')][_0xc003('0x98')]==0x1){_0x35826c[_0xc003('0x79')](_0xc003('0x99'));}else{_0x35826c[_0xc003('0x79')](_0xc003('0x9a'));}}if(_0x8437ae[_0xc003('0x55')][_0xc003('0x9b')]){_0x107bac=_['isArray'](_0x8437ae[_0xc003('0x55')][_0xc003('0x9b')])?_0x8437ae[_0xc003('0x55')][_0xc003('0x9b')]:new Array(_0x8437ae[_0xc003('0x55')][_0xc003('0x9b')]);_0x107bac[_0xc003('0x45')](function(_0x35650d){_0x208899['or'](_0xc003('0x87'),'%,'+_0x35650d+',%');});}if(_0x8437ae[_0xc003('0x55')][_0xc003('0x9c')]){var _0x37961a=_0x8437ae[_0xc003('0x55')][_0xc003('0x9c')][_0xc003('0x9d')]('\x5c','\x5c\x5c')[_0xc003('0x9d')](/'/g,'\x27\x27');if(qs[_0xc003('0x9e')](_0x37961a)){_0x1fedd4['or'](_0xc003('0x9f'),_0x37961a+'%');}else{_0x1fedd4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc003('0x80')](_0x37961a))['or'](_0xc003('0xa0'),_0x37961a+'%');}}}_0x35826c['where'](_0x1fedd4);_0x35826c[_0xc003('0xa1')](_0xc003('0xa2'));var _0x57326e={'type':db[_0xc003('0xa3')][_0xc003('0xa4')][_0xc003('0xa5')],'raw':!![]};var _0x57cc44=_0x35826c[_0xc003('0xa6')]();_0x57cc44[_0xc003('0x5f')](_0xc003('0xa2'));_0x57cc44[_0xc003('0x5f')](_0xc003('0xa7'),_0xc003('0x78'));if(_0x1fb1d2['order']){_0x1fb1d2[_0xc003('0x5b')][_0xc003('0x45')](function(_0xc6bc2d){var _0x5691d7=_0xc6bc2d[0x0]===_0xc003('0xa8')?_0xc6bc2d[0x0]:'i.'+_0xc6bc2d[0x0];_0x35826c[_0xc003('0x5b')](_0x5691d7,_0xc6bc2d[0x1]===_0xc003('0xa9')?![]:!![]);});}if(!_['isEmpty'](_0x107bac)){_0x35826c[_0xc003('0x79')](_0x208899);_0x57cc44[_0xc003('0x5d')](_0xc003('0xaa'),_0x107bac);}BPromise[_0xc003('0xab')]()[_0xc003('0x21')](function(){if(!_0x292932){if(_0x8437ae[_0xc003('0x55')]['ChatWebsiteId'])return;_0x57cc44['where'](_0xc003('0xac'));_0x35826c[_0xc003('0x5d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x8437ae[_0xc003('0xad')][_0xc003('0xae')]!=='agent')return;return _0x8437ae[_0xc003('0xad')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x4a7f2e){if(_[_0xc003('0x8d')](_0x4a7f2e)){_0x57cc44[_0xc003('0x5d')](_0xc003('0xaf'));_0x35826c[_0xc003('0x5d')](_0xc003('0xaf'));}else{_0x57cc44[_0xc003('0x5d')](_0xc003('0x8f'),_['map'](_0x4a7f2e,'id'));_0x35826c[_0xc003('0x5d')](_0xc003('0x8f'),_[_0xc003('0x41')](_0x4a7f2e,'id'));}});})['then'](function(){if(_0x8437ae[_0xc003('0xad')][_0xc003('0xae')]===_0xc003('0x3e')&&!_0x292932&&!_0x8437ae[_0xc003('0x55')][_0xc003('0x8e')])return[];return db[_0xc003('0xb0')][_0xc003('0x55')](_0x57cc44[_0xc003('0xb1')](),_0x57326e);})[_0xc003('0x21')](function(_0x59b2f5){_0x54fb07[_0xc003('0x32')]=_0x59b2f5[_0xc003('0x76')];if(_0x54fb07[_0xc003('0x32')]===0x0)return[];return db[_0xc003('0xb0')][_0xc003('0x55')](_0x40f2f7[_0xc003('0xb1')](),_0x57326e)[_0xc003('0x21')](function(_0x1366a3){_0x5dcd46=_['keyBy'](_0x1366a3,'id');_0x57326e=_[_0xc003('0xb2')](_0x57326e,{'model':db[_0xc003('0xb3')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x8437ae[_0xc003('0x55')]['fields']){_0x1fb1d2[_0xc003('0x59')][_0xc003('0x45')](function(_0x20eba0){_0x35826c[_0xc003('0x5f')]('i.'+_0x20eba0);});}else{_0x35826c[_0xc003('0x5f')](_0xc003('0xa7'),_0xc003('0x78'));_0x35826c['field'](_0xc003('0xb4'),_0xc003('0xb5'));_0x35826c[_0xc003('0x5f')](_0xc003('0xb6'),'Account.mandatoryDisposition');_0x35826c[_0xc003('0x5f')](_0xc003('0xb7'),_0xc003('0xa8'));_0x35826c[_0xc003('0x5f')]('i.*');_0x35826c[_0xc003('0x5f')](_0xc003('0xb8'),_0xc003('0xb9'));_0x35826c[_0xc003('0x5f')]('c.lastName','Contact.lastName');_0x35826c[_0xc003('0x5f')](_0xc003('0xba'),_0xc003('0xbb'));_0x35826c[_0xc003('0x5f')](_0xc003('0xbc'),_0xc003('0xbd'));_0x35826c[_0xc003('0x5f')](_0xc003('0xbe'),_0xc003('0xbf'));_0x35826c[_0xc003('0x5f')]('c.fax',_0xc003('0xc0'));_0x35826c[_0xc003('0x5f')](_0xc003('0xc1'),_0xc003('0xc2'));_0x35826c[_0xc003('0x5f')]('o.internal',_0xc003('0xc3'));_0x35826c['field'](_0xc003('0xc4'),_0xc003('0x43'));}if(_0x1fb1d2['limit'])_0x35826c[_0xc003('0x30')](_0x1fb1d2[_0xc003('0x30')]);if(_0x1fb1d2[_0xc003('0x2f')])_0x35826c[_0xc003('0x2f')](_0x1fb1d2[_0xc003('0x2f')]);return db[_0xc003('0xb0')][_0xc003('0x55')](_0x35826c[_0xc003('0xb1')](),_0x57326e);})['then'](function(_0x4970d7){if(_0x4970d7[_0xc003('0x76')]>0x0)_0x87ff76[_0xc003('0x5d')](_0xc003('0xc5'),_[_0xc003('0x41')](_0x4970d7,'id'));return db[_0xc003('0xb0')][_0xc003('0x55')](_0x87ff76[_0xc003('0xb1')](),_0x57326e)[_0xc003('0x21')](function(_0xe8fad4){var _0x5ebdef=_[_0xc003('0xc6')](_0xe8fad4,'ChatInteractionId');var _0x3f93cf=[];_0x4970d7[_0xc003('0x45')](function(_0x246f14){_0x3f93cf[_0xc003('0x46')](updateChatInteraction(_0x246f14,_0x5dcd46,_0x5ebdef));});return BPromise['all'](_0x3f93cf);});});})[_0xc003('0x21')](function(_0x3dff0c){_0x54fb07['rows']=_0x3dff0c;return _0x54fb07;})[_0xc003('0x21')](respondWithFilteredResult(_0x53f58d,_0x1fb1d2))[_0xc003('0x2b')](handleError(_0x53f58d,null));};exports[_0xc003('0xc7')]=function(_0x2dfdd0,_0x461b73){var _0x352000={'raw':![],'where':{'id':_0x2dfdd0['params']['id']}},_0x277dc8={};_0x277dc8['model']=_[_0xc003('0x56')](db[_0xc003('0xb3')][_0xc003('0x51')]);_0x277dc8[_0xc003('0x55')]=_[_0xc003('0x56')](_0x2dfdd0[_0xc003('0x55')]);_0x277dc8[_0xc003('0x57')]=_[_0xc003('0x58')](_0x277dc8[_0xc003('0x54')],_0x277dc8[_0xc003('0x55')]);_0x352000[_0xc003('0x59')]=_[_0xc003('0x58')](_0x277dc8['model'],qs[_0xc003('0xc8')](_0x2dfdd0[_0xc003('0x55')][_0xc003('0xc8')]));_0x352000[_0xc003('0x59')]=_0x352000[_0xc003('0x59')]['length']?_0x352000[_0xc003('0x59')]:_0x277dc8[_0xc003('0x54')];if(_0x2dfdd0[_0xc003('0x55')]['includeAll']){_0x352000[_0xc003('0xc9')]=[{'all':!![]}];}_0x352000=_['merge']({},_0x352000,_0x2dfdd0[_0xc003('0xca')]);return db[_0xc003('0xb3')][_0xc003('0x77')](_0x352000)[_0xc003('0x21')](handleEntityNotFound(_0x461b73,null))[_0xc003('0x21')](respondWithResult(_0x461b73,null))[_0xc003('0x2b')](handleError(_0x461b73,null));};exports[_0xc003('0xcb')]=function(_0x2dced2,_0x71848){return db[_0xc003('0xb3')][_0xc003('0xcb')](_0x2dced2[_0xc003('0x8b')],{})[_0xc003('0x21')](respondWithResult(_0x71848,0xc9))[_0xc003('0x2b')](handleError(_0x71848,null));};exports[_0xc003('0x38')]=function(_0x5038a8,_0x5327ce){if(_0x5038a8['body']['id']){delete _0x5038a8[_0xc003('0x8b')]['id'];}return db[_0xc003('0xb3')]['find']({'where':{'id':_0x5038a8['params']['id']}})[_0xc003('0x21')](handleEntityNotFound(_0x5327ce,null))['then'](saveUpdates(_0x5038a8[_0xc003('0x8b')],null))['then'](respondWithResult(_0x5327ce,null))[_0xc003('0x2b')](handleError(_0x5327ce,null));};exports[_0xc003('0x39')]=function(_0x4fb943,_0x2d8076){return db['ChatInteraction'][_0xc003('0x77')]({'where':{'id':_0x4fb943[_0xc003('0xcc')]['id']}})['then'](handleEntityNotFound(_0x2d8076,null))['then'](removeEntity(_0x2d8076,null))[_0xc003('0x2b')](handleError(_0x2d8076,null));};exports[_0xc003('0xcd')]=function(_0x3faabe,_0x5c4956){return db[_0xc003('0xb3')][_0xc003('0xcd')]()[_0xc003('0x21')](respondWithResult(_0x5c4956,null))[_0xc003('0x2b')](handleError(_0x5c4956,null));};exports['createVidaooSession']=function(_0x1fb25f,_0x1ba3a8){var _0x5e9169=_0x1fb25f[_0xc003('0xcc')]['id'];var _0x52668a;var _0x4af4cc;var _0x2b7d04;return db['ChatInteraction'][_0xc003('0xce')]({'where':{'id':_0x5e9169}})['then'](function(_0x19d062){_0x52668a=_0x19d062;return db[_0xc003('0xcf')][_0xc003('0xce')]({'where':{'id':_0x19d062['ChatWebsiteId']},'attributes':['id',_0xc003('0xd0'),_0xc003('0xd1'),_0xc003('0xd2'),'vidaooNote',_0xc003('0xd3')],'raw':!![]});})[_0xc003('0x21')](function(_0x4940ca){if(_0x4940ca&&_0x4940ca['vidaooApiKey']&&_0x4940ca[_0xc003('0xd1')]){_0x4af4cc=_0x4940ca;var _0x463422={'interaction':{'id':_0x5e9169},'agent':{'id':_0x1fb25f[_0xc003('0xad')]['id'],'name':_0x1fb25f[_0xc003('0xad')][_0xc003('0x3b')],'fullname':_0x1fb25f[_0xc003('0xad')][_0xc003('0x42')],'email':_0x1fb25f[_0xc003('0xad')][_0xc003('0xd4')]},'contact':_0x1fb25f[_0xc003('0x8b')][_0xc003('0x3d')],'account':_0x1fb25f[_0xc003('0x8b')][_0xc003('0xd5')]};var _0x34714e={'rejectUnauthorized':![],'method':_0xc003('0xd6'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4940ca['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1fb25f['user'][_0xc003('0xd4')]],'buttons':null,'topic':_0x4af4cc[_0xc003('0xd2')],'note':_['isNull'](_0x4af4cc[_0xc003('0xd7')])?null:getMustacheRender(_0x4af4cc['vidaooNote'],_0x463422),'metadata':null},'redirect':_0xc003('0xd8'),'json':!![]};try{if(!_[_0xc003('0xd9')](_0x4af4cc[_0xc003('0xd3')])){var _0x48f66a=getMustacheRender(_0x4af4cc['vidaooMetadata'],_0x463422);var _0x159231=JSON[_0xc003('0x93')](_0x48f66a);_0x34714e[_0xc003('0x8b')][_0xc003('0xda')]=_0x159231;}}catch(_0x253ee3){throw new db[(_0xc003('0xa3'))]['ValidationError'](_0xc003('0xdb'));}return rp(_0x34714e);}else{throw new db[(_0xc003('0xa3'))][(_0xc003('0xdc'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x2be8f8){_0x2b7d04=_0x2be8f8;if(_0x2b7d04['id']){var _0x50376e={'body':_0x2b7d04[_0xc003('0xdd')],'ChatWebsiteId':_0x4af4cc['id'],'ChatInteractionId':_0x52668a['id'],'direction':_0xc003('0xde'),'UserId':_0x1fb25f['user']['id']};return db[_0xc003('0xdf')][_0xc003('0xcb')](_0x50376e,{});}else{throw new db[(_0xc003('0xa3'))][(_0xc003('0xdc'))](_0xc003('0xe0'));}})[_0xc003('0x21')](function(){return _0x52668a['updateAttributes']({'vidaooSessionId':_0x2b7d04['id']});})[_0xc003('0x21')](respondWithResult(_0x1ba3a8,null))[_0xc003('0x2b')](handleError(_0x1ba3a8,null));};exports[_0xc003('0xe1')]=function(_0x191034,_0x2796c0){if(_0x191034['body']['id']){delete _0x191034[_0xc003('0x8b')]['id'];}return db[_0xc003('0xb3')][_0xc003('0x77')]({'where':{'id':_0x191034[_0xc003('0xcc')]['id']},'include':[{'model':db[_0xc003('0xe2')],'as':_0xc003('0x7b')}]})[_0xc003('0x21')](handleEntityNotFound(_0x2796c0,null))[_0xc003('0x21')](saveUpdates(_0x191034[_0xc003('0x8b')],null))[_0xc003('0x21')](respondWithResult(_0x2796c0,null))[_0xc003('0x2b')](handleError(_0x2796c0,null));};exports[_0xc003('0xe3')]=function(_0x258eed,_0x3f4d5e,_0x398bbc){if(_0x258eed[_0xc003('0x8b')]['id']){delete _0x258eed[_0xc003('0x8b')]['id'];}return db[_0xc003('0xb3')]['find']({'where':{'id':_0x258eed['params']['id']}})[_0xc003('0x21')](function(_0x500fa1){if(!_0x500fa1){logger[_0xc003('0x27')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xc003('0xe4'));_0x3f4d5e['sendStatus'](0x194);}else{if(_0x500fa1[_0xc003('0x4d')]){throw new db[(_0xc003('0xa3'))][(_0xc003('0xdc'))]('Interaction\x20already\x20assigned');}}return _0x500fa1;})[_0xc003('0x21')](function(_0x4cd821){if(_0x4cd821){return _0x4cd821['update']({'closed':_0x258eed['body'][_0xc003('0x4c')],'disposition':_0x258eed[_0xc003('0x8b')]['disposition']})[_0xc003('0x21')](function(_0x330aec){return _0x330aec;});}})[_0xc003('0x21')](function(_0x4941be){return respondWithRpcPromise(_0xc003('0xe5'),_0xc003('0xe3'),_0x258eed[_0xc003('0x8b')],client9004);})[_0xc003('0x21')](respondWithResult(_0x3f4d5e,null))[_0xc003('0x2b')](handleError(_0x3f4d5e,null));};exports[_0xc003('0xe6')]=function(_0x11b81b,_0x2e4b10,_0x4e1dcb){_0x11b81b['body'][_0xc003('0x3b')]=_0x11b81b[_0xc003('0xe7')][_0xc003('0xe8')];_0x11b81b[_0xc003('0x8b')]['basename']=_0x11b81b[_0xc003('0xe7')][_0xc003('0xe9')];_0x11b81b[_0xc003('0x8b')][_0xc003('0x53')]=_0x11b81b[_0xc003('0xe7')]['mimetype'];return db['Attachment'][_0xc003('0xcb')](_0x11b81b[_0xc003('0x8b')])['then'](respondWithResult(_0x2e4b10,0xc9))[_0xc003('0x2b')](handleError(_0x2e4b10,null));};exports['attachmentDownload']=function(_0x386f6e,_0x4f85db,_0x541171){return db['ChatInteraction']['findOne']({'where':{'id':_0x386f6e[_0xc003('0xcc')]['id']},'raw':!![]})[_0xc003('0x21')](handleEntityNotFound(_0x4f85db,null))[_0xc003('0x21')](function(_0x343311){if(_0x343311){if(_0x343311[_0xc003('0x4c')]){return _0x4f85db[_0xc003('0x2e')](0x193)['json']({'status':0x193,'message':_0xc003('0xea')});}return db[_0xc003('0xeb')]['findOne']({'where':{'id':_0x386f6e[_0xc003('0x55')]['attachId']},'raw':!![]})[_0xc003('0x21')](handleEntityNotFound(_0x4f85db,null));}})[_0xc003('0x21')](function(_0x5416b1){if(_0x5416b1){var _0x522d41=_0x5416b1[_0xc003('0xec')]!==null;var _0x6e846b=path['join'](config['root'],_0xc003('0xed'));if(_0x522d41){_0x6e846b=path[_0xc003('0xee')](_0x6e846b,_0xc003('0xef'));}var _0xa74d2a=path[_0xc003('0xee')](_0x6e846b,_0x5416b1[_0xc003('0xf0')]);return _0x4f85db['download'](_0xa74d2a);}})['catch'](handleError(_0x4f85db,null));};exports['close']=function(_0xf5090e,_0x51234d){var _0x2d1e20=null;var _0x17f8de=null;var _0x463afb=null;var _0x354647=null;if(_0xf5090e[_0xc003('0x8b')]['id']){delete _0xf5090e[_0xc003('0x8b')]['id'];}if(_0xf5090e[_0xc003('0x8b')][_0xc003('0xf1')]){_0x354647=path['join'](config['root'],_0xc003('0xf2'),util[_0xc003('0xf3')](_0xc003('0xf4'),Date[_0xc003('0xf5')]()));_0xf5090e[_0xc003('0x8b')][_0xc003('0xf6')]=_0x354647;}return db['ChatInteraction'][_0xc003('0x77')]({'where':{'id':_0xf5090e[_0xc003('0xcc')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xc003('0x89')],'as':_0xc003('0x89')}]}]})[_0xc003('0x21')](handleEntityNotFound(_0x51234d,null))['then'](saveUpdates(_0xf5090e[_0xc003('0x8b')],null))[_0xc003('0x21')](function(_0x516bdf){if(_0x516bdf){_0x2d1e20=_0x516bdf;return db[_0xc003('0xcf')][_0xc003('0x77')]({'where':{'id':_0x2d1e20[_0xc003('0x8e')]}});}})[_0xc003('0x21')](function(_0x4721d4){if(_0x4721d4){_0x463afb=_0x4721d4;return db[_0xc003('0xe2')][_0xc003('0x77')]({'where':{'id':_0x2d1e20[_0xc003('0x82')]}});}})[_0xc003('0x21')](function(_0x27b5ac){if(_0x27b5ac){_0x17f8de=_0x27b5ac;if(_0x354647){var _0x258264=null;for(var _0x47b967=0x1;_0x47b967<_0x2d1e20[_0xc003('0xf7')]['length'];++_0x47b967){_0x258264=_0x2d1e20[_0xc003('0xf7')][_0x47b967];var _0x3c5c3c=_0x258264[_0xc003('0x4d')]?util[_0xc003('0xf3')](_0xc003('0xf8'),_0x463afb['agentAlias'],_0x258264[_0xc003('0x4d')]):_0xc003('0xf9');var _0x490467=_0xf5090e[_0xc003('0x8b')][_0xc003('0xfa')]||util['format'](_0xc003('0xf8'),'Visitor',_0x258264[_0xc003('0x82')]);switch(_0x463afb[_0xc003('0xfb')]){case _0xc003('0xfc'):_0x3c5c3c=_0x258264['UserId']?util[_0xc003('0xf3')](_0xc003('0xf8'),_0x463afb[_0xc003('0xfd')],_0x258264[_0xc003('0x4d')]):'System';break;case _0xc003('0xfe'):_0x3c5c3c=_0x258264[_0xc003('0x4d')]?_0x258264[_0xc003('0x89')]['alias']||_0x258264[_0xc003('0x89')]['fullname']:_0xc003('0xf9');break;case _0xc003('0xff'):_0x3c5c3c=_0x258264[_0xc003('0x4d')]?_0x258264[_0xc003('0x89')][_0xc003('0x42')]:_0xc003('0xf9');break;default:_0x3c5c3c=_0x258264[_0xc003('0x4d')]?util[_0xc003('0xf3')](_0xc003('0xf8'),_0x463afb[_0xc003('0xfd')],_0x258264['UserId']):_0xc003('0xf9');}var _0x2437f3=util[_0xc003('0xf3')](_0xc003('0x100'),moment(_0x258264['createdAt'])[_0xc003('0xf3')](_0xc003('0x101')),_0x258264[_0xc003('0x102')]==='in'?_0x490467:_0x3c5c3c,_0x258264[_0xc003('0x8b')]);if(!_0x258264[_0xc003('0x103')]){fs[_0xc003('0x104')](_0x354647,_0x2437f3);}}return db[_0xc003('0x105')][_0xc003('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xc003('0x106')],'as':_0xc003('0x107'),'raw':!![]}]});}}})[_0xc003('0x21')](function(_0xc1a5e9){if(_0xc1a5e9&&_0xc1a5e9[_0xc003('0x107')]&&_0xf5090e[_0xc003('0x8b')]){var _0x50cf1d={'tls':{'rejectUnauthorized':![]}};if(_0xc1a5e9[_0xc003('0x107')][_0xc003('0x108')]){_0x50cf1d[_0xc003('0x108')]=_0xc1a5e9[_0xc003('0x107')]['service'];}else{_0x50cf1d[_0xc003('0x109')]=_0xc1a5e9[_0xc003('0x107')][_0xc003('0x109')];_0x50cf1d[_0xc003('0x10a')]=_0xc1a5e9[_0xc003('0x107')][_0xc003('0x10a')];_0x50cf1d[_0xc003('0x10b')]=_0xc1a5e9[_0xc003('0x107')][_0xc003('0x10b')];}if(_0xc1a5e9[_0xc003('0x107')][_0xc003('0x10c')]){_0x50cf1d[_0xc003('0x10d')]={'user':_0xc1a5e9['Smtp'][_0xc003('0xad')],'pass':_0xc1a5e9[_0xc003('0x107')][_0xc003('0x10e')]};}return respondWithRpcPromise(_0xc003('0x10f'),'sendMail',{'account':_0x50cf1d,'message':{'from':util[_0xc003('0xf3')]('\x22%s\x22\x20<%s>',_0xc1a5e9['name'],_0xc1a5e9[_0xc003('0xd4')]||_0xc1a5e9['Smtp'][_0xc003('0xad')]),'to':_0xf5090e[_0xc003('0x8b')][_0xc003('0xf1')],'subject':'Mail\x20Transcript','text':util[_0xc003('0xf3')](_0xc003('0x110'),_0xf5090e[_0xc003('0x8b')]['mailTranscript']),'attachments':[{'path':_0x354647}]}})[_0xc003('0x21')](function(){return _0x2d1e20;})[_0xc003('0x2b')](function(_0x30d032){console['error'](_0x30d032);});}else{return _0x2d1e20;}})[_0xc003('0x21')](respondWithStatusCode(_0x51234d,0xc8))[_0xc003('0x2b')](handleError(_0x51234d,null));};exports[_0xc003('0x111')]=function(_0x915e8,_0x4b2b0b,_0x5955ce){return db[_0xc003('0xdf')]['find']({'where':{'id':_0x915e8['params']['id']}})[_0xc003('0x21')](handleEntityNotFound(_0x4b2b0b,null))[_0xc003('0x21')](function(_0x52f0a6){if(_0x52f0a6){return _0x52f0a6[_0xc003('0x111')](_0x915e8[_0xc003('0x8b')][_0xc003('0x112')],_['omit'](_0x915e8[_0xc003('0x8b')],[_0xc003('0x112'),'id'])||{});}})['then'](respondWithResult(_0x4b2b0b,null))[_0xc003('0x2b')](handleError(_0x4b2b0b,null));};exports[_0xc003('0x113')]=function(_0x39584a,_0x28ec1c,_0x39fe73){var _0x52a40e={'raw':![],'where':{}};var _0x7f102e={};var _0x27572d={'count':0x0,'rows':[]};return db[_0xc003('0xb3')]['findOne']({'where':{'id':_0x39584a[_0xc003('0xcc')]['id']}})['then'](handleEntityNotFound(_0x28ec1c,null))['then'](function(_0xac75b9){if(_0xac75b9){_0x7f102e[_0xc003('0x54')]=_[_0xc003('0x56')](db[_0xc003('0xdf')]['rawAttributes']);_0x7f102e['query']=_[_0xc003('0x56')](_0x39584a[_0xc003('0x55')]);_0x7f102e[_0xc003('0x57')]=_[_0xc003('0x58')](_0x7f102e[_0xc003('0x54')],_0x7f102e[_0xc003('0x55')]);_0x52a40e['attributes']=_[_0xc003('0x58')](_0x7f102e[_0xc003('0x54')],qs[_0xc003('0xc8')](_0x39584a[_0xc003('0x55')]['fields']));_0x52a40e[_0xc003('0x59')]=_0x52a40e[_0xc003('0x59')][_0xc003('0x76')]?_0x52a40e[_0xc003('0x59')]:_0x7f102e[_0xc003('0x54')];if(!_0x39584a[_0xc003('0x55')][_0xc003('0x5a')](_0xc003('0x114'))){_0x52a40e[_0xc003('0x30')]=qs['limit'](_0x39584a[_0xc003('0x55')]['limit']);_0x52a40e[_0xc003('0x2f')]=qs[_0xc003('0x2f')](_0x39584a[_0xc003('0x55')][_0xc003('0x2f')]);}_0x52a40e[_0xc003('0x5b')]=qs['sort'](_0x39584a[_0xc003('0x55')][_0xc003('0x5c')]);_0x52a40e[_0xc003('0x5d')]=qs[_0xc003('0x57')](_['pick'](_0x39584a[_0xc003('0x55')],_0x7f102e[_0xc003('0x57')]));_0x52a40e['where'][_0xc003('0x115')]=_0xac75b9['id'];if(_0x39584a[_0xc003('0x55')][_0xc003('0x9c')]){_0x52a40e['where']=_['merge'](_0x52a40e[_0xc003('0x5d')],{'$or':_[_0xc003('0x41')](_0x52a40e[_0xc003('0x59')],function(_0x5bb837){var _0x4431d2={};_0x4431d2[_0x5bb837]={'$like':'%'+_0x39584a[_0xc003('0x55')]['filter']+'%'};return _0x4431d2;})});}if(_0x39584a[_0xc003('0x55')][_0xc003('0x92')]){var _0x5be806=_0x39584a[_0xc003('0x55')][_0xc003('0x92')]['split'](',');var _0x1784b3={};_0x1784b3[_0x5be806[0x0]]={'$gte':moment(_0x5be806[0x1])[_0xc003('0xf3')](_0xc003('0x116'))};_0x52a40e['where']=_[_0xc003('0xb2')](_0x52a40e[_0xc003('0x5d')],_0x1784b3);}_0x52a40e=_[_0xc003('0xb2')]({},_0x52a40e,_0x39584a[_0xc003('0xca')]);return db['ChatMessage'][_0xc003('0x32')]({'where':_0x52a40e[_0xc003('0x5d')]})[_0xc003('0x21')](function(_0x29df7e){_0x27572d['count']=_0x29df7e;if(_0x39584a[_0xc003('0x55')][_0xc003('0x117')]){_0x52a40e[_0xc003('0xc9')]=[{'all':!![]}];}return db[_0xc003('0xdf')]['findAll'](_0x52a40e);})['then'](function(_0x37a1b6){_0x27572d[_0xc003('0x118')]=_0x37a1b6;return _0x27572d;});}})[_0xc003('0x21')](respondWithFilteredResult(_0x28ec1c,_0x52a40e))[_0xc003('0x2b')](handleError(_0x28ec1c,null));};exports[_0xc003('0x119')]=function(_0x2d2e94,_0x5a79d3,_0x5199ed){var _0x125d1b={'where':{}},_0x196b7c={},_0x355377={'count':0x0,'rows':[]};return db[_0xc003('0xb3')][_0xc003('0xce')]({'where':{'id':_0x2d2e94[_0xc003('0xcc')]['id']}})[_0xc003('0x21')](handleEntityNotFound(_0x5a79d3,null))[_0xc003('0x21')](function(_0x25cdaa){if(_0x25cdaa){_0x196b7c[_0xc003('0x54')]=_[_0xc003('0x56')](db[_0xc003('0xdf')]['rawAttributes']);_0x196b7c[_0xc003('0x55')]=_[_0xc003('0x56')](_0x2d2e94[_0xc003('0x55')]);_0x196b7c['filters']=_['intersection'](_0x196b7c[_0xc003('0x54')],_0x196b7c[_0xc003('0x55')]);_0x125d1b['attributes']=_['intersection'](_0x196b7c[_0xc003('0x54')],qs[_0xc003('0xc8')](_0x2d2e94['query'][_0xc003('0xc8')]));_0x125d1b[_0xc003('0x59')]=_0x125d1b[_0xc003('0x59')]['length']?_0x125d1b[_0xc003('0x59')]:_0x196b7c[_0xc003('0x54')];if(!_0x2d2e94[_0xc003('0x55')][_0xc003('0x5a')]('nolimit')){_0x125d1b[_0xc003('0x30')]=qs[_0xc003('0x30')](_0x2d2e94[_0xc003('0x55')][_0xc003('0x30')]);_0x125d1b[_0xc003('0x2f')]=qs[_0xc003('0x2f')](_0x2d2e94[_0xc003('0x55')][_0xc003('0x2f')]);}_0x125d1b[_0xc003('0x5b')]=qs[_0xc003('0x5c')](_0x2d2e94['query'][_0xc003('0x5c')]);_0x125d1b[_0xc003('0x5d')]=qs[_0xc003('0x57')](_[_0xc003('0x5e')](_0x2d2e94['query'],_0x196b7c[_0xc003('0x57')]));_0x125d1b[_0xc003('0x5d')][_0xc003('0x115')]=_0x25cdaa['id'];if(_0x2d2e94['query'][_0xc003('0x9c')]){_0x125d1b[_0xc003('0x5d')]=_[_0xc003('0xb2')](_0x125d1b[_0xc003('0x5d')],{'$or':_[_0xc003('0x41')](_0x125d1b[_0xc003('0x59')],function(_0x355934){var _0x3e578b={};_0x3e578b[_0x355934]={'$like':'%'+_0x2d2e94[_0xc003('0x55')]['filter']+'%'};return _0x3e578b;})});}_0x125d1b[_0xc003('0x5d')][_0xc003('0x103')]=![];if(_0x2d2e94[_0xc003('0x55')]['id']){_0x125d1b[_0xc003('0x5d')]['id']={'$gt':_0x2d2e94[_0xc003('0x55')]['id']};}_0x125d1b=_[_0xc003('0xb2')]({},_0x125d1b,_0x2d2e94[_0xc003('0xca')]);return db['ChatMessage']['count']({'where':_0x125d1b[_0xc003('0x5d')]})['then'](function(_0x4c7451){_0x355377[_0xc003('0x32')]=_0x4c7451;_0x125d1b[_0xc003('0xc9')]=[];if(_0x2d2e94[_0xc003('0x55')][_0xc003('0x11a')]){_0x125d1b[_0xc003('0xc9')][_0xc003('0x46')]({'model':db[_0xc003('0x89')],'as':_0xc003('0x89'),'attributes':['id',_0xc003('0x42'),'alias']});}if(_0x2d2e94['query'][_0xc003('0x117')]){_0x125d1b['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x125d1b);})[_0xc003('0x21')](function(_0x4ffb80){_0x355377[_0xc003('0x118')]=_0x4ffb80;return _0x355377;});}})['then'](respondWithFilteredResult(_0x5a79d3,_0x125d1b))[_0xc003('0x2b')](handleError(_0x5a79d3,null));};exports[_0xc003('0x11b')]=function(_0x54288e,_0x2b0255,_0x674ae9){return db['ChatInteraction'][_0xc003('0x77')]({'where':{'id':_0x54288e['params']['id']}})[_0xc003('0x21')](handleEntityNotFound(_0x2b0255,null))['then'](function(_0x2b4fe2){if(_0x2b4fe2){return _0x2b4fe2[_0xc003('0x11c')](_0x54288e[_0xc003('0x8b')][_0xc003('0x112')],_[_0xc003('0x11d')](_0x54288e[_0xc003('0x8b')],[_0xc003('0x112'),'id'])||{})[_0xc003('0x11e')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xc003('0x60')],'where':{'id':_0x54288e[_0xc003('0x8b')][_0xc003('0x112')]}});})[_0xc003('0x21')](function(_0x490f49){socket[_0xc003('0x11f')](_0xc003('0x120'),{'id':Number(_0x54288e[_0xc003('0xcc')]['id']),'tags':_0x490f49||[]});return{'id':Number(_0x54288e[_0xc003('0xcc')]['id']),'tags':_0x490f49||[]};});}})[_0xc003('0x21')](respondWithResult(_0x2b0255,null))[_0xc003('0x2b')](handleError(_0x2b0255,null));};exports[_0xc003('0x121')]=function(_0x443ca2,_0x54b902,_0x5c2ca3){return db[_0xc003('0xb3')][_0xc003('0x77')]({'where':{'id':_0x443ca2[_0xc003('0xcc')]['id']}})['then'](handleEntityNotFound(_0x54b902,null))[_0xc003('0x21')](function(_0x3c4f37){if(_0x3c4f37){return _0x3c4f37[_0xc003('0x121')](_0x443ca2[_0xc003('0x55')][_0xc003('0x112')]);}})[_0xc003('0x21')](respondWithStatusCode(_0x54b902,null))[_0xc003('0x2b')](handleError(_0x54b902,null));};exports[_0xc003('0x122')]=function(_0x5ceeba,_0x1d11ee){var _0x4734cf=moment()['unix']()[_0xc003('0xb1')]();var _0x1886c1=path['join'](config[_0xc003('0x123')],'server',_0xc003('0x124'),_0xc003('0x125'));var _0x440131=path[_0xc003('0xee')](config[_0xc003('0x123')],_0xc003('0x126'),'files',_0xc003('0x127'));var _0x11fc9c=path[_0xc003('0xee')](_0x1886c1,_0x4734cf);var _0x3f856b=util[_0xc003('0xf3')](_0xc003('0x128'),_0x5ceeba[_0xc003('0xcc')]['id'],_0x4734cf);var _0x577f77=path[_0xc003('0xee')](_0x1886c1,_0x3f856b);var _0x41e50c=[];_0x41e50c['push']({'model':db[_0xc003('0x89')],'as':'User','attributes':['id',_0xc003('0x42')],'raw':!![]});_0x41e50c['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x5ceeba[_0xc003('0x55')][_0xc003('0x127')]){_0x41e50c[_0xc003('0x46')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x7c64df=[{'model':db[_0xc003('0xdf')],'as':_0xc003('0xf7'),'attributes':['id','body',_0xc003('0x91'),'direction',_0xc003('0x103'),_0xc003('0x98')],'include':_0x41e50c}];_0x7c64df[_0xc003('0x46')]({'model':db[_0xc003('0xcf')],'as':'Account','attributes':['id',_0xc003('0x3b')]});_0x7c64df[_0xc003('0x46')]({'model':db[_0xc003('0x89')],'as':_0xc003('0x129'),'attributes':['id','fullname']});return db[_0xc003('0xb3')][_0xc003('0x77')]({'where':{'id':_0x5ceeba[_0xc003('0xcc')]['id']},'include':_0x7c64df})[_0xc003('0x21')](handleEntityNotFound(_0x1d11ee,null))['then'](function(_0x176166){if(_0x176166){var _0x5f2c0e=_0x176166[_0xc003('0x12a')]({'plain':!![]});fs[_0xc003('0x12b')](_0x11fc9c);var _0x1f68d5={'channel':_0xc003('0x12c'),'account':_0x5f2c0e[_0xc003('0x12d')][_0xc003('0x3b')],'agent':_0x5f2c0e[_0xc003('0x129')]?_0x5f2c0e['Owner'][_0xc003('0x42')]:_0xc003('0x12e'),'createdAt':moment(_0x5f2c0e[_0xc003('0x91')])[_0xc003('0xf3')](_0xc003('0x116'))[_0xc003('0xb1')](),'closedAt':_0x5f2c0e[_0xc003('0x4c')]?moment(_0x5f2c0e[_0xc003('0x12f')])['format'](_0xc003('0x116'))['toString']():'','disposition':_0x5f2c0e[_0xc003('0x4e')],'chatInfo':{'browser':_0x5f2c0e[_0xc003('0x130')],'os':_0x5f2c0e[_0xc003('0x131')],'referer':_0x5f2c0e[_0xc003('0x132')],'customerIp':_0x5f2c0e[_0xc003('0x133')],'customerPort':_0x5f2c0e[_0xc003('0x134')]?_0x5f2c0e['customerPort']:_0xc003('0x12e')},'messages':_(_0x5f2c0e['Messages'])['tail']()['filter']({'secret':![]})[_0xc003('0x41')](function(_0x13e140){if(_0x13e140[_0xc003('0xeb')]){var _0x110b6c=path['join'](_0x440131,_0x13e140[_0xc003('0xeb')][_0xc003('0xf0')]);if(fs[_0xc003('0x135')](_0x110b6c)){fs[_0xc003('0x136')](_0x110b6c)['pipe'](fs[_0xc003('0x137')](path['join'](_0x11fc9c,_0x13e140[_0xc003('0xeb')][_0xc003('0xf0')])));}}return{'date':moment(_0x13e140[_0xc003('0x91')])[_0xc003('0xf3')](_0xc003('0x116'))['toString'](),'sender':_0x13e140['direction']===_0xc003('0xde')?_0x13e140[_0xc003('0x89')]?_0x13e140[_0xc003('0x89')][_0xc003('0x42')]:_0xc003('0xf9'):_0x13e140[_0xc003('0x7b')][_0xc003('0x138')]+(_0x13e140[_0xc003('0x7b')][_0xc003('0x139')]?'\x20'+_0x13e140[_0xc003('0x7b')]['lastName']:''),'body':_0x13e140[_0xc003('0xeb')]?_0x13e140[_0xc003('0xeb')][_0xc003('0xf0')]:_0x13e140['body'],'direction':_0x13e140[_0xc003('0x102')]===_0xc003('0xde')?'A':'C','secret':_0x13e140['secret'],'read':_0x13e140[_0xc003('0x98')],'attachment':_0x13e140[_0xc003('0xeb')]};})[_0xc003('0x81')]()};return ejs['renderFile'](path[_0xc003('0xee')](config['root'],_0xc003('0x126'),_0xc003('0x13a'),_0xc003('0x13b')),{'interaction':_0x1f68d5})[_0xc003('0x21')](function(_0x563ece){var _0x5dd07d=path['join'](_0x11fc9c,_0xc003('0x13c')+_0x5f2c0e['id']+'-'+_0x4734cf+_0xc003('0x13d'));var _0x5a659b={'path':_0x5dd07d,'channel':_0xc003('0x12c'),'interactionId':_0x5f2c0e['id']};return pdf[_0xc003('0x13e')](_0x563ece,_0x5a659b);})['then'](function(){return new BPromise(function(_0x799720,_0x5c6ed7){zipdir(_0x11fc9c,{'saveTo':_0x577f77},function(_0x1ceb2b,_0x435603){if(_0x1ceb2b)return _0x5c6ed7(_0x1ceb2b);return _0x799720(_0x435603);});})['then'](function(){return new BPromise(function(_0x4da8aa,_0x93546b){rimraf(_0x11fc9c,function(_0x385acb){if(_0x385acb)_0x93546b(_0x385acb);return _0x4da8aa();});});})[_0xc003('0x21')](function(){return _0x1d11ee[_0xc003('0x122')](_0x577f77,_0x3f856b,function(_0x446ce9){if(_0x446ce9){console[_0xc003('0x13f')](_0xc003('0x140'),_0x446ce9);}else{fs[_0xc003('0x141')](_0x577f77);}});});});}else{return _0x1d11ee[_0xc003('0x2c')](0xc8);}})[_0xc003('0x2b')](handleError(_0x1d11ee,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index ecacff4..cacc5f8 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 _0xffcd=['then','setDataValue','Users','map','findAll','unreadMessages','emit','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3cb004,_0x25d5d1){var _0x343ec2=function(_0xb9ac0e){while(--_0xb9ac0e){_0x3cb004['push'](_0x3cb004['shift']());}};_0x343ec2(++_0x25d5d1);}(_0xffcd,0x138));var _0xdffc=function(_0x1d0ad7,_0x440ad3){_0x1d0ad7=_0x1d0ad7-0x0;var _0x21425d=_0xffcd[_0x1d0ad7];return _0x21425d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xdffc('0x0'))['db'][_0xdffc('0x1')];var ChatMessage=require(_0xdffc('0x0'))['db'][_0xdffc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdffc('0x3')](0x0);var events={'afterCreate':_0xdffc('0x4'),'afterUpdate':_0xdffc('0x5'),'afterDestroy':_0xdffc('0x6')};function emitEvent(_0x5677e8){return function(_0x12ecd0,_0x44bef5,_0x18e814){_0x12ecd0[_0xdffc('0x7')]({'attributes':['id'],'raw':!![]})[_0xdffc('0x8')](function(_0x555665){_0x12ecd0[_0xdffc('0x9')](_0xdffc('0xa'),_0x555665[_0xdffc('0xb')](function(_0xa549c7){return{'id':_0xa549c7['id']};}));return ChatMessage[_0xdffc('0xc')]({'where':{'ChatInteractionId':_0x12ecd0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdffc('0x8')](function(_0x5c8347){_0x12ecd0['setDataValue'](_0xdffc('0xd'),_0x5c8347['length']);ChatInteractionEvents[_0xdffc('0xe')](_0x5677e8+':'+_0x12ecd0['id'],_0x12ecd0);ChatInteractionEvents[_0xdffc('0xe')](_0x5677e8,_0x12ecd0);_0x18e814(null);})['catch'](_0x18e814(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdffc('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x0a6c=['emit','catch','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','unreadMessages','length'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0x0a6c,0x7c));var _0xc0a6=function(_0x24d98d,_0x27db31){_0x24d98d=_0x24d98d-0x0;var _0x1a8c12=_0x0a6c[_0x24d98d];return _0x1a8c12;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xc0a6('0x0'))['db'][_0xc0a6('0x1')];var ChatMessage=require(_0xc0a6('0x0'))['db'][_0xc0a6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc0a6('0x3'),'afterUpdate':_0xc0a6('0x4'),'afterDestroy':_0xc0a6('0x5')};function emitEvent(_0x483937){return function(_0x48f3db,_0x548f2e,_0x2dbd7e){_0x48f3db[_0xc0a6('0x6')]({'attributes':['id'],'raw':!![]})[_0xc0a6('0x7')](function(_0xdca02b){_0x48f3db[_0xc0a6('0x8')]('Users',_0xdca02b['map'](function(_0x54a97a){return{'id':_0x54a97a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x48f3db['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0a6('0x7')](function(_0x742587){_0x48f3db['setDataValue'](_0xc0a6('0x9'),_0x742587[_0xc0a6('0xa')]);ChatInteractionEvents['emit'](_0x483937+':'+_0x48f3db['id'],_0x48f3db);ChatInteractionEvents[_0xc0a6('0xb')](_0x483937,_0x48f3db);_0x2dbd7e(null);})[_0xc0a6('0xc')](_0x2dbd7e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xc0a6('0xd')](e,emitEvent(event));}}module[_0xc0a6('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 735e34f..4edc087 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 _0x24ea=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x24ea,0x99));var _0xa24e=function(_0x341cbf,_0x52be4a){_0x341cbf=_0x341cbf-0x0;var _0x3ebf74=_0x24ea[_0x341cbf];return _0x3ebf74;};'use strict';var _=require(_0xa24e('0x0'));var util=require(_0xa24e('0x1'));var logger=require(_0xa24e('0x2'))(_0xa24e('0x3'));var moment=require(_0xa24e('0x4'));var BPromise=require(_0xa24e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa24e('0x6'));var rimraf=require(_0xa24e('0x7'));var config=require(_0xa24e('0x8'));var attributes=require(_0xa24e('0x9'));module[_0xa24e('0xa')]=function(_0x6f4b70,_0x9bfe6b){return _0x6f4b70[_0xa24e('0xb')](_0xa24e('0xc'),attributes,{'tableName':_0xa24e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39392c,_0x74a671,_0x31f826){if(_0x39392c[_0xa24e('0xe')](_0xa24e('0xf'))){_0x39392c[_0xa24e('0x10')]=moment()[_0xa24e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31f826(null,_0x39392c);}},'charset':_0xa24e('0x12'),'collate':_0xa24e('0x13')});}; \ No newline at end of file +var _0xa844=['path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa844,0x155));var _0x4a84=function(_0x2c0d39,_0x5dbacc){_0x2c0d39=_0x2c0d39-0x0;var _0x562e1f=_0xa844[_0x2c0d39];return _0x562e1f;};'use strict';var _=require('lodash');var util=require(_0x4a84('0x0'));var logger=require('../../config/logger')(_0x4a84('0x1'));var moment=require(_0x4a84('0x2'));var BPromise=require(_0x4a84('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a84('0x4'));var rimraf=require('rimraf');var config=require(_0x4a84('0x5'));var attributes=require(_0x4a84('0x6'));module[_0x4a84('0x7')]=function(_0x346a69,_0x1e2659){return _0x346a69['define'](_0x4a84('0x8'),attributes,{'tableName':_0x4a84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x522336,_0xb15855,_0x907dfc){if(_0x522336['changed'](_0x4a84('0xa'))){_0x522336['closedAt']=moment()[_0x4a84('0xb')](_0x4a84('0xc'));}_0x907dfc(null,_0x522336);}},'charset':_0x4a84('0xd'),'collate':_0x4a84('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index cff61d4..cd986a2 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 _0x1109=['request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','body','options','raw','where','attributes','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','addTags','ids','AddTags','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x8276f3,_0x21ad5a){var _0x5330a8=function(_0x29c418){while(--_0x29c418){_0x8276f3['push'](_0x8276f3['shift']());}};_0x5330a8(++_0x21ad5a);}(_0x1109,0x140));var _0x9110=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x1109[_0x424357];return _0x29c68e;};'use strict';var _=require(_0x9110('0x0'));var util=require(_0x9110('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9110('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9110('0x3'));var logger=require(_0x9110('0x4'))(_0x9110('0x5'));var config=require(_0x9110('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9110('0x7')][_0x9110('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9110('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9110('0xa'))(new Redis(config[_0x9110('0x9')]));require(_0x9110('0xb'))[_0x9110('0xc')](socket);function respondWithRpcPromise(_0xeda9e2,_0x54ed1f,_0x229203){return new BPromise(function(_0x57925d,_0x4e53a7){return client[_0x9110('0xd')](_0xeda9e2,_0x229203)['then'](function(_0x1200ce){logger[_0x9110('0xe')](_0x9110('0xf'),_0x54ed1f,'request\x20sent');logger['debug'](_0x9110('0x10'),_0x54ed1f,'request\x20sent',JSON[_0x9110('0x11')](_0x1200ce));if(_0x1200ce['error']){if(_0x1200ce[_0x9110('0x12')][_0x9110('0x13')]===0x1f4){logger[_0x9110('0x12')](_0x9110('0xf'),_0x54ed1f,_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);return _0x4e53a7(_0x1200ce['error'][_0x9110('0x14')]);}logger[_0x9110('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x54ed1f,_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);return _0x57925d(_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);}else{logger[_0x9110('0xe')](_0x9110('0xf'),_0x54ed1f,_0x9110('0x15'));_0x57925d(_0x1200ce[_0x9110('0x16')][_0x9110('0x14')]);}})[_0x9110('0x17')](function(_0x356d1a){logger[_0x9110('0x12')](_0x9110('0xf'),_0x54ed1f,_0x356d1a);_0x4e53a7(_0x356d1a);});});}exports['UpdateChatInteraction']=function(_0x517551){var _0x992e95=this;return new Promise(function(_0x565247,_0x475449){return db['ChatInteraction']['update'](_0x517551[_0x9110('0x18')],{'raw':_0x517551['options']?_0x517551[_0x9110('0x19')][_0x9110('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517551[_0x9110('0x19')]?_0x517551['options'][_0x9110('0x1b')]||null:null,'attributes':_0x517551['options']?_0x517551[_0x9110('0x19')][_0x9110('0x1c')]||null:null,'limit':_0x517551[_0x9110('0x19')]?_0x517551['options']['limit']||null:null})[_0x9110('0x1d')](function(_0x24476b){logger[_0x9110('0xe')](_0x9110('0x1e'),_0x517551);logger[_0x9110('0x1f')](_0x9110('0x1e'),_0x517551,JSON['stringify'](_0x24476b));_0x565247(_0x24476b);})[_0x9110('0x17')](function(_0x45376c){logger[_0x9110('0x12')](_0x9110('0x1e'),_0x45376c[_0x9110('0x14')],_0x517551);_0x475449(_0x992e95[_0x9110('0x12')](0x1f4,_0x45376c[_0x9110('0x14')]));});});};exports[_0x9110('0x20')]=function(_0x4fae06){return new Promise(function(_0x5f7adf,_0x1bb905){return db[_0x9110('0x21')]['find']({'where':_0x4fae06[_0x9110('0x19')]?_0x4fae06[_0x9110('0x19')]['where']||null:null})[_0x9110('0x1d')](function(_0x497f61){if(_0x497f61){return _0x497f61[_0x9110('0x22')](_0x4fae06['body']['ids'],_['omit'](_0x4fae06['body'],[_0x9110('0x23'),'id'])||{});}})['spread'](function(_0x5164c2){logger[_0x9110('0xe')](_0x9110('0x24'),_0x4fae06);logger[_0x9110('0x1f')](_0x9110('0x24'),_0x4fae06,JSON[_0x9110('0x11')](_0x5164c2));_0x5f7adf(_0x5164c2);})[_0x9110('0x17')](function(_0x5d99dd){logger[_0x9110('0x12')]('AddTags',_0x5d99dd[_0x9110('0x14')],_0x4fae06);_0x1bb905(_this[_0x9110('0x12')](0x1f4,_0x5d99dd[_0x9110('0x14')]));});});}; \ No newline at end of file +var _0x54e6=['../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','addTags','body','omit','ids','spread','AddTags','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3079fe,_0x201497){var _0x4e4df4=function(_0x4efe3a){while(--_0x4efe3a){_0x3079fe['push'](_0x3079fe['shift']());}};_0x4e4df4(++_0x201497);}(_0x54e6,0x180));var _0x654e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x54e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x654e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x654e('0x1'));var fs=require('fs');var Redis=require(_0x654e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x654e('0x3'));var logger=require(_0x654e('0x4'))(_0x654e('0x5'));var config=require(_0x654e('0x6'));var jayson=require(_0x654e('0x7'));var client=jayson[_0x654e('0x8')][_0x654e('0x9')]({'port':0x232a});config[_0x654e('0xa')]=_['defaults'](config[_0x654e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x654e('0xb'))(new Redis(config[_0x654e('0xa')]));require(_0x654e('0xc'))['register'](socket);function respondWithRpcPromise(_0x4d9090,_0x59b1a2,_0x386526){return new BPromise(function(_0x4ccf05,_0x4dc2d4){return client[_0x654e('0xd')](_0x4d9090,_0x386526)[_0x654e('0xe')](function(_0x4e5519){logger[_0x654e('0xf')](_0x654e('0x10'),_0x59b1a2,_0x654e('0x11'));logger[_0x654e('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x59b1a2,_0x654e('0x11'),JSON[_0x654e('0x13')](_0x4e5519));if(_0x4e5519[_0x654e('0x14')]){if(_0x4e5519[_0x654e('0x14')][_0x654e('0x15')]===0x1f4){logger[_0x654e('0x14')](_0x654e('0x10'),_0x59b1a2,_0x4e5519[_0x654e('0x14')][_0x654e('0x16')]);return _0x4dc2d4(_0x4e5519['error'][_0x654e('0x16')]);}logger[_0x654e('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x59b1a2,_0x4e5519[_0x654e('0x14')][_0x654e('0x16')]);return _0x4ccf05(_0x4e5519[_0x654e('0x14')][_0x654e('0x16')]);}else{logger['info'](_0x654e('0x10'),_0x59b1a2,_0x654e('0x11'));_0x4ccf05(_0x4e5519['result'][_0x654e('0x16')]);}})['catch'](function(_0x5f2c5e){logger['error'](_0x654e('0x10'),_0x59b1a2,_0x5f2c5e);_0x4dc2d4(_0x5f2c5e);});});}exports[_0x654e('0x17')]=function(_0x30335b){var _0x1abd05=this;return new Promise(function(_0x2ad9c6,_0x2e3e76){return db[_0x654e('0x18')][_0x654e('0x19')](_0x30335b['body'],{'raw':_0x30335b[_0x654e('0x1a')]?_0x30335b[_0x654e('0x1a')][_0x654e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30335b['options']?_0x30335b[_0x654e('0x1a')][_0x654e('0x1c')]||null:null,'attributes':_0x30335b[_0x654e('0x1a')]?_0x30335b['options'][_0x654e('0x1d')]||null:null,'limit':_0x30335b['options']?_0x30335b[_0x654e('0x1a')][_0x654e('0x1e')]||null:null})[_0x654e('0xe')](function(_0x4b3780){logger['info'](_0x654e('0x17'),_0x30335b);logger[_0x654e('0x12')](_0x654e('0x17'),_0x30335b,JSON[_0x654e('0x13')](_0x4b3780));_0x2ad9c6(_0x4b3780);})[_0x654e('0x1f')](function(_0x4b1fa6){logger[_0x654e('0x14')](_0x654e('0x17'),_0x4b1fa6[_0x654e('0x16')],_0x30335b);_0x2e3e76(_0x1abd05[_0x654e('0x14')](0x1f4,_0x4b1fa6[_0x654e('0x16')]));});});};exports[_0x654e('0x20')]=function(_0x456b6f){return new Promise(function(_0x564552,_0x71fea3){return db['ChatInteraction']['find']({'where':_0x456b6f['options']?_0x456b6f['options']['where']||null:null})['then'](function(_0x481ae1){if(_0x481ae1){return _0x481ae1[_0x654e('0x21')](_0x456b6f[_0x654e('0x22')]['ids'],_[_0x654e('0x23')](_0x456b6f[_0x654e('0x22')],[_0x654e('0x24'),'id'])||{});}})[_0x654e('0x25')](function(_0x1f4bba){logger['info'](_0x654e('0x26'),_0x456b6f);logger['debug']('AddTags',_0x456b6f,JSON[_0x654e('0x13')](_0x1f4bba));_0x564552(_0x1f4bba);})[_0x654e('0x1f')](function(_0x39c4ce){logger[_0x654e('0x14')](_0x654e('0x26'),_0x39c4ce[_0x654e('0x16')],_0x456b6f);_0x71fea3(_this[_0x654e('0x14')](0x1f4,_0x39c4ce[_0x654e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c329d26..cf0494b 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 _0x498a=['save','update','emit','register','./chatInteraction.events'];(function(_0x3b557a,_0x2decdc){var _0x53fdbb=function(_0x49b177){while(--_0x49b177){_0x3b557a['push'](_0x3b557a['shift']());}};_0x53fdbb(++_0x2decdc);}(_0x498a,0x1bc));var _0xa498=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x498a[_0x5b644e];return _0x49c6bf;};'use strict';var ChatInteractionEvents=require(_0xa498('0x0'));var events=[_0xa498('0x1'),'remove',_0xa498('0x2')];function createListener(_0x4e3bd6,_0x4c8a4c){return function(_0x3967e6){_0x4c8a4c[_0xa498('0x3')](_0x4e3bd6,_0x3967e6);};}function removeListener(_0x459775,_0x2adfef){return function(){ChatInteractionEvents['removeListener'](_0x459775,_0x2adfef);};}exports[_0xa498('0x4')]=function(_0x4a8acb){for(var _0x7d2d8b=0x0,_0x346d01=events['length'];_0x7d2d8b<_0x346d01;_0x7d2d8b++){var _0xe38dd=events[_0x7d2d8b];var _0x703b=createListener('chatInteraction:'+_0xe38dd,_0x4a8acb);ChatInteractionEvents['on'](_0xe38dd,_0x703b);}}; \ No newline at end of file +var _0x7dfc=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x7dfc,0x19b));var _0xc7df=function(_0x148dff,_0x559310){_0x148dff=_0x148dff-0x0;var _0x13b7c4=_0x7dfc[_0x148dff];return _0x13b7c4;};'use strict';var ChatInteractionEvents=require(_0xc7df('0x0'));var events=[_0xc7df('0x1'),'remove',_0xc7df('0x2')];function createListener(_0x431fb9,_0xefdddd){return function(_0x153122){_0xefdddd[_0xc7df('0x3')](_0x431fb9,_0x153122);};}function removeListener(_0x1855c8,_0x17e6bc){return function(){ChatInteractionEvents[_0xc7df('0x4')](_0x1855c8,_0x17e6bc);};}exports['register']=function(_0x3ba6d3){for(var _0x343fb0=0x0,_0x288e4e=events[_0xc7df('0x5')];_0x343fb0<_0x288e4e;_0x343fb0++){var _0x2fbf63=events[_0x343fb0];var _0x491233=createListener(_0xc7df('0x6')+_0x2fbf63,_0x3ba6d3);ChatInteractionEvents['on'](_0x2fbf63,_0x491233);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 9dacbfa..84602d9 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 _0xc815=['file','attachmentUpload','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','/:id/attachment_upload','single'];(function(_0x360f8e,_0x1c2b20){var _0x23589e=function(_0x2c0a71){while(--_0x2c0a71){_0x360f8e['push'](_0x360f8e['shift']());}};_0x23589e(++_0x1c2b20);}(_0xc815,0x1a7));var _0x5c81=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xc815[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0x5c81('0x0'));var util=require(_0x5c81('0x1'));var path=require('path');var timeout=require(_0x5c81('0x2'));var express=require(_0x5c81('0x3'));var router=express[_0x5c81('0x4')]();var fs_extra=require(_0x5c81('0x5'));var auth=require(_0x5c81('0x6'));var interaction=require(_0x5c81('0x7'));var config=require(_0x5c81('0x8'));var controller=require(_0x5c81('0x9'));router[_0x5c81('0xa')]('/',auth[_0x5c81('0xb')](),controller['index']);router['get'](_0x5c81('0xc'),auth[_0x5c81('0xb')](),controller[_0x5c81('0xd')]);router['get'](_0x5c81('0xe'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x10')]);router[_0x5c81('0xa')](_0x5c81('0x11'),auth[_0x5c81('0xf')](),controller['attachmentDownload']);router[_0x5c81('0xa')](_0x5c81('0x12'),auth[_0x5c81('0xb')](),controller['getMessages']);router[_0x5c81('0xa')](_0x5c81('0x13'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x14')]);router[_0x5c81('0xa')](_0x5c81('0x15'),auth[_0x5c81('0xb')](),controller[_0x5c81('0x16')]);router[_0x5c81('0x17')]('/',auth[_0x5c81('0xb')](),controller[_0x5c81('0x18')]);router[_0x5c81('0x17')](_0x5c81('0x19'),auth[_0x5c81('0xb')](),controller[_0x5c81('0x1a')]);var upload=multer({'storage':multer[_0x5c81('0x1b')]({'destination':function(_0x4355fd,_0x228247,_0xc8dfdb){_0xc8dfdb(null,path[_0x5c81('0x1c')](config[_0x5c81('0x1d')],_0x5c81('0x1e')));},'filename':function(_0x3c0242,_0x583391,_0x4baafc){_0x4baafc(null,util[_0x5c81('0x1f')](_0x5c81('0x20'),Date[_0x5c81('0x21')](),_0x583391['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5c81('0x17')](_0x5c81('0x22'),upload[_0x5c81('0x23')](_0x5c81('0x24')),controller[_0x5c81('0x25')]);router['post'](_0x5c81('0x12'),auth[_0x5c81('0xf')](),controller['addMessage']);router[_0x5c81('0x17')]('/:id/tags',auth[_0x5c81('0xb')](),interaction[_0x5c81('0x26')](_0x5c81('0x27'),_0x5c81('0x28')),controller['addTags']);router[_0x5c81('0x29')](_0x5c81('0xe'),auth[_0x5c81('0xb')](),interaction['tracked'](_0x5c81('0x27'),_0x5c81('0x2a')),controller['update']);router[_0x5c81('0x29')]('/:id/custom_update',controller['customUpdate']);router[_0x5c81('0x29')](_0x5c81('0x2b'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x2c')]);router['put'](_0x5c81('0x2d'),controller[_0x5c81('0x2e')]);router[_0x5c81('0x2f')](_0x5c81('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x5c81('0x27'),_0x5c81('0x30')),controller[_0x5c81('0x31')]);router[_0x5c81('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x5c81('0x32')]);module['exports']=router; \ No newline at end of file +var _0x6680=['multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','tracked','chat','addTags','put','chatinteraction:update','update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports'];(function(_0x47017a,_0x415c09){var _0x5d4a0c=function(_0x5df187){while(--_0x5df187){_0x47017a['push'](_0x47017a['shift']());}};_0x5d4a0c(++_0x415c09);}(_0x6680,0xc0));var _0x0668=function(_0x50521f,_0x4375b3){_0x50521f=_0x50521f-0x0;var _0x29b4be=_0x6680[_0x50521f];return _0x29b4be;};'use strict';var multer=require(_0x0668('0x0'));var util=require(_0x0668('0x1'));var path=require(_0x0668('0x2'));var timeout=require(_0x0668('0x3'));var express=require('express');var router=express[_0x0668('0x4')]();var fs_extra=require(_0x0668('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0668('0x6'));var controller=require(_0x0668('0x7'));router[_0x0668('0x8')]('/',auth[_0x0668('0x9')](),controller['index']);router[_0x0668('0x8')](_0x0668('0xa'),auth['isAuthenticated'](),controller[_0x0668('0xb')]);router[_0x0668('0x8')](_0x0668('0xc'),auth[_0x0668('0xd')](),controller[_0x0668('0xe')]);router[_0x0668('0x8')](_0x0668('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x0668('0x10'),auth[_0x0668('0x9')](),controller[_0x0668('0x11')]);router[_0x0668('0x8')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x0668('0x12')]);router[_0x0668('0x8')](_0x0668('0x13'),auth[_0x0668('0x9')](),controller['download']);router[_0x0668('0x14')]('/',auth['isAuthenticated'](),controller[_0x0668('0x15')]);router['post']('/:id/vidaoo',auth[_0x0668('0x9')](),controller[_0x0668('0x16')]);var upload=multer({'storage':multer[_0x0668('0x17')]({'destination':function(_0x365a9a,_0x27b40b,_0x24f85d){_0x24f85d(null,path['join'](config[_0x0668('0x18')],'server/files/attachments/'));},'filename':function(_0x94f189,_0x41239d,_0x547751){_0x547751(null,util[_0x0668('0x19')](_0x0668('0x1a'),Date[_0x0668('0x1b')](),_0x41239d[_0x0668('0x1c')][_0x0668('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0668('0x1e'),upload[_0x0668('0x1f')]('file'),controller[_0x0668('0x20')]);router[_0x0668('0x14')](_0x0668('0x10'),auth[_0x0668('0xd')](),controller['addMessage']);router[_0x0668('0x14')]('/:id/tags',auth[_0x0668('0x9')](),interaction[_0x0668('0x21')](_0x0668('0x22'),'chatinteraction:addtags'),controller[_0x0668('0x23')]);router[_0x0668('0x24')](_0x0668('0xc'),auth[_0x0668('0x9')](),interaction[_0x0668('0x21')](_0x0668('0x22'),_0x0668('0x25')),controller[_0x0668('0x26')]);router[_0x0668('0x24')]('/:id/custom_update',controller['customUpdate']);router[_0x0668('0x24')](_0x0668('0x27'),auth[_0x0668('0xd')](),controller[_0x0668('0x28')]);router['put'](_0x0668('0x29'),controller[_0x0668('0x2a')]);router[_0x0668('0x2b')](_0x0668('0xc'),auth[_0x0668('0x9')](),interaction[_0x0668('0x21')]('chat',_0x0668('0x2c')),controller[_0x0668('0x2d')]);router[_0x0668('0x2b')]('/:id/tags',auth[_0x0668('0x9')](),controller[_0x0668('0x2e')]);module[_0x0668('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 36769ac..a7a2c16 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 _0x6f59=['TEXT','sequelize','exports'];(function(_0x392c8d,_0x4f947a){var _0x53adda=function(_0x1a55fa){while(--_0x1a55fa){_0x392c8d['push'](_0x392c8d['shift']());}};_0x53adda(++_0x4f947a);}(_0x6f59,0x145));var _0x96f5=function(_0x16585a,_0x5b0829){_0x16585a=_0x16585a-0x0;var _0x447482=_0x6f59[_0x16585a];return _0x447482;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe738=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe738,0x1a8));var _0x8e73=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xe738[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x8e73('0x0'));module[_0x8e73('0x1')]={'body':{'type':Sequelize[_0x8e73('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8e73('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8e73('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b0f7d01..83b7c71 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 _0x0ccd=['get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','online','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','findAll','show','keys','include','options','find','catch','create','body','params','describe'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0ccd,0x90));var _0xd0cc=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x0ccd[_0x5bff9e];return _0x7f42ef;};'use strict';var emlformat=require(_0xd0cc('0x0'));var rimraf=require(_0xd0cc('0x1'));var zipdir=require(_0xd0cc('0x2'));var jsonpatch=require(_0xd0cc('0x3'));var rp=require(_0xd0cc('0x4'));var moment=require(_0xd0cc('0x5'));var BPromise=require(_0xd0cc('0x6'));var Mustache=require(_0xd0cc('0x7'));var util=require(_0xd0cc('0x8'));var path=require(_0xd0cc('0x9'));var sox=require(_0xd0cc('0xa'));var csv=require(_0xd0cc('0xb'));var ejs=require(_0xd0cc('0xc'));var fs=require('fs');var fs_extra=require(_0xd0cc('0xd'));var _=require(_0xd0cc('0xe'));var squel=require(_0xd0cc('0xf'));var crypto=require(_0xd0cc('0x10'));var jsforce=require(_0xd0cc('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xd0cc('0xb'));var querystring=require(_0xd0cc('0x12'));var Papa=require(_0xd0cc('0x13'));var Redis=require(_0xd0cc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd0cc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0cc('0x16'));var logger=require(_0xd0cc('0x17'))(_0xd0cc('0x18'));var utils=require(_0xd0cc('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd0cc('0x1a')](config[_0xd0cc('0x1b')],{'host':_0xd0cc('0x1c'),'port':0x18eb});var socket=require(_0xd0cc('0x1d'))(new Redis(config[_0xd0cc('0x1b')]));require(_0xd0cc('0x1e'))[_0xd0cc('0x1f')](socket);function respondWithStatusCode(_0x289d8c,_0x222a66){_0x222a66=_0x222a66||0xcc;return function(_0x277c0d){if(_0x277c0d){return _0x289d8c[_0xd0cc('0x20')](_0x222a66);}return _0x289d8c[_0xd0cc('0x21')](_0x222a66)[_0xd0cc('0x22')]();};}function respondWithResult(_0x39f14c,_0x377284){_0x377284=_0x377284||0xc8;return function(_0x496c32){if(_0x496c32){return _0x39f14c[_0xd0cc('0x21')](_0x377284)[_0xd0cc('0x23')](_0x496c32);}};}function respondWithFilteredResult(_0x209806,_0x37e2a0){return function(_0x4dc4aa){if(_0x4dc4aa){var _0x407a75=typeof _0x37e2a0[_0xd0cc('0x24')]===_0xd0cc('0x25')&&typeof _0x37e2a0[_0xd0cc('0x26')]==='undefined';var _0x3ebf21=_0x4dc4aa[_0xd0cc('0x27')];var _0x5bbfa9=_0x407a75?0x0:_0x37e2a0[_0xd0cc('0x24')];var _0x43eeb7=_0x407a75?_0x4dc4aa[_0xd0cc('0x27')]:_0x37e2a0[_0xd0cc('0x24')]+_0x37e2a0[_0xd0cc('0x26')];var _0x173a65;if(_0x43eeb7>=_0x3ebf21){_0x43eeb7=_0x3ebf21;_0x173a65=0xc8;}else{_0x173a65=0xce;}_0x209806[_0xd0cc('0x21')](_0x173a65);return _0x209806[_0xd0cc('0x28')]('Content-Range',_0x5bbfa9+'-'+_0x43eeb7+'/'+_0x3ebf21)[_0xd0cc('0x23')](_0x4dc4aa);}return null;};}function patchUpdates(_0x434d98){return function(_0x32bacd){try{jsonpatch[_0xd0cc('0x29')](_0x32bacd,_0x434d98,!![]);}catch(_0x55ec1a){return BPromise['reject'](_0x55ec1a);}return _0x32bacd[_0xd0cc('0x2a')]();};}function saveUpdates(_0x1549f0,_0x299940){return function(_0x71d8ad){if(_0x71d8ad){return _0x71d8ad[_0xd0cc('0x2b')](_0x1549f0)[_0xd0cc('0x2c')](function(_0x3d6af8){return _0x3d6af8;});}return null;};}function removeEntity(_0x3e7cd5,_0x385bdc){return function(_0x2e0c40){if(_0x2e0c40){return _0x2e0c40[_0xd0cc('0x2d')]()[_0xd0cc('0x2c')](function(){_0x3e7cd5[_0xd0cc('0x21')](0xcc)[_0xd0cc('0x22')]();});}};}function handleEntityNotFound(_0x52316f,_0x1a37a7){return function(_0x534d87){if(!_0x534d87){_0x52316f[_0xd0cc('0x20')](0x194);}return _0x534d87;};}function handleError(_0x23d5ca,_0x59b1b1){_0x59b1b1=_0x59b1b1||0x1f4;return function(_0x148904){logger[_0xd0cc('0x2e')](_0x148904[_0xd0cc('0x2f')]);if(_0x148904[_0xd0cc('0x30')]){delete _0x148904['name'];}_0x23d5ca['status'](_0x59b1b1)['send'](_0x148904);};}exports[_0xd0cc('0x31')]=function(_0x33c4c9,_0x49ff7b){var _0x531204={},_0x5e9a18={},_0x308acf={'count':0x0,'rows':[]};var _0x434e43=_[_0xd0cc('0x32')](db['ChatInternalMessage'][_0xd0cc('0x33')],function(_0x57adcb){return{'name':_0x57adcb[_0xd0cc('0x34')],'type':_0x57adcb[_0xd0cc('0x35')]['key']};});_0x5e9a18[_0xd0cc('0x36')]=_['map'](_0x434e43,_0xd0cc('0x30'));_0x5e9a18[_0xd0cc('0x37')]=_['keys'](_0x33c4c9['query']);_0x5e9a18[_0xd0cc('0x38')]=_[_0xd0cc('0x39')](_0x5e9a18[_0xd0cc('0x36')],_0x5e9a18[_0xd0cc('0x37')]);_0x531204[_0xd0cc('0x3a')]=_[_0xd0cc('0x39')](_0x5e9a18[_0xd0cc('0x36')],qs[_0xd0cc('0x3b')](_0x33c4c9[_0xd0cc('0x37')]['fields']));_0x531204[_0xd0cc('0x3a')]=_0x531204[_0xd0cc('0x3a')][_0xd0cc('0x3c')]?_0x531204[_0xd0cc('0x3a')]:_0x5e9a18[_0xd0cc('0x36')];if(!_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x3d')](_0xd0cc('0x3e'))){_0x531204[_0xd0cc('0x26')]=qs[_0xd0cc('0x26')](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x26')]);_0x531204[_0xd0cc('0x24')]=qs['offset'](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x24')]);}_0x531204['order']=qs[_0xd0cc('0x3f')](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x3f')]);_0x531204[_0xd0cc('0x40')]=qs[_0xd0cc('0x38')](_[_0xd0cc('0x41')](_0x33c4c9[_0xd0cc('0x37')],_0x5e9a18[_0xd0cc('0x38')]),_0x434e43);if(_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x42')]){_0x531204[_0xd0cc('0x40')]=_[_0xd0cc('0x43')](_0x531204[_0xd0cc('0x40')],{'$or':_['map'](_0x434e43,function(_0xf72fd0){if(_0xf72fd0[_0xd0cc('0x35')]!==_0xd0cc('0x44')){var _0x5cd6d4={};_0x5cd6d4[_0xf72fd0[_0xd0cc('0x30')]]={'$like':'%'+_0x33c4c9[_0xd0cc('0x37')]['filter']+'%'};return _0x5cd6d4;}})});}_0x531204=_[_0xd0cc('0x43')]({},_0x531204,_0x33c4c9['options']);var _0x3c2205={'where':_0x531204[_0xd0cc('0x40')]};return db[_0xd0cc('0x45')]['count'](_0x3c2205)[_0xd0cc('0x2c')](function(_0x3fbd75){_0x308acf[_0xd0cc('0x27')]=_0x3fbd75;if(_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x46')]){_0x531204['include']=[{'all':!![]}];}return db[_0xd0cc('0x45')][_0xd0cc('0x47')](_0x531204);})[_0xd0cc('0x2c')](function(_0x2c5e4a){_0x308acf['rows']=_0x2c5e4a;return _0x308acf;})[_0xd0cc('0x2c')](respondWithFilteredResult(_0x49ff7b,_0x531204))['catch'](handleError(_0x49ff7b,null));};exports[_0xd0cc('0x48')]=function(_0x496667,_0x27fafe){var _0x18a397={'raw':!![],'where':{'id':_0x496667['params']['id']}},_0x2d2788={};_0x2d2788[_0xd0cc('0x36')]=_[_0xd0cc('0x49')](db['ChatInternalMessage']['rawAttributes']);_0x2d2788[_0xd0cc('0x37')]=_[_0xd0cc('0x49')](_0x496667['query']);_0x2d2788[_0xd0cc('0x38')]=_[_0xd0cc('0x39')](_0x2d2788[_0xd0cc('0x36')],_0x2d2788[_0xd0cc('0x37')]);_0x18a397['attributes']=_[_0xd0cc('0x39')](_0x2d2788[_0xd0cc('0x36')],qs['fields'](_0x496667[_0xd0cc('0x37')][_0xd0cc('0x3b')]));_0x18a397['attributes']=_0x18a397['attributes']['length']?_0x18a397[_0xd0cc('0x3a')]:_0x2d2788['model'];if(_0x496667[_0xd0cc('0x37')][_0xd0cc('0x46')]){_0x18a397[_0xd0cc('0x4a')]=[{'all':!![]}];}_0x18a397=_[_0xd0cc('0x43')]({},_0x18a397,_0x496667[_0xd0cc('0x4b')]);return db[_0xd0cc('0x45')][_0xd0cc('0x4c')](_0x18a397)[_0xd0cc('0x2c')](handleEntityNotFound(_0x27fafe,null))['then'](respondWithResult(_0x27fafe,null))[_0xd0cc('0x4d')](handleError(_0x27fafe,null));};exports[_0xd0cc('0x4e')]=function(_0x25e8dc,_0x528806){return db[_0xd0cc('0x45')][_0xd0cc('0x4e')](_0x25e8dc[_0xd0cc('0x4f')],{})[_0xd0cc('0x2c')](respondWithResult(_0x528806,0xc9))[_0xd0cc('0x4d')](handleError(_0x528806,null));};exports[_0xd0cc('0x2b')]=function(_0x89861,_0x1469b4){if(_0x89861[_0xd0cc('0x4f')]['id']){delete _0x89861['body']['id'];}return db[_0xd0cc('0x45')][_0xd0cc('0x4c')]({'where':{'id':_0x89861[_0xd0cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1469b4,null))[_0xd0cc('0x2c')](saveUpdates(_0x89861[_0xd0cc('0x4f')],null))[_0xd0cc('0x2c')](respondWithResult(_0x1469b4,null))[_0xd0cc('0x4d')](handleError(_0x1469b4,null));};exports[_0xd0cc('0x2d')]=function(_0x2ebe0f,_0x4dccc4){return db[_0xd0cc('0x45')]['find']({'where':{'id':_0x2ebe0f[_0xd0cc('0x50')]['id']}})[_0xd0cc('0x2c')](handleEntityNotFound(_0x4dccc4,null))[_0xd0cc('0x2c')](removeEntity(_0x4dccc4,null))[_0xd0cc('0x4d')](handleError(_0x4dccc4,null));};exports[_0xd0cc('0x51')]=function(_0x1a5f99,_0x567ff4){return db['ChatInternalMessage'][_0xd0cc('0x51')]()['then'](respondWithResult(_0x567ff4,null))['catch'](handleError(_0x567ff4,null));};function wrapUser(_0x918966){return function(_0x57eef6){var _0x9e5866=_0x918966[_0xd0cc('0x52')]({'plain':!![]});_0x9e5866[_0xd0cc('0x53')]=[];if(_0x57eef6){_0x9e5866[_0xd0cc('0x54')]=_0x57eef6['createdAt'];_0x9e5866[_0xd0cc('0x55')]=_0x57eef6;}else{_0x9e5866['lastMessageAt']=moment(0x0)['format'](_0xd0cc('0x56'));_0x9e5866[_0xd0cc('0x55')]={};}return _0x9e5866;};}exports[_0xd0cc('0x57')]=function(_0x7430ac,_0x4a3e07,_0x3a3390){var _0x1e2d88=[];return db[_0xd0cc('0x58')][_0xd0cc('0x47')]({'where':{'role':['agent',_0xd0cc('0x59'),_0xd0cc('0x5a')]},'attributes':['id',_0xd0cc('0x5b'),_0xd0cc('0x30'),_0xd0cc('0x5c'),_0xd0cc('0x5d'),'internal',_0xd0cc('0x5e'),'lastLoginAt','allowmessenger',_0xd0cc('0x5f')],'order':qs['sort'](_0xd0cc('0x60')),'include':[{'model':db[_0xd0cc('0x61')],'as':'VoiceQueues','attributes':['id',_0xd0cc('0x30'),_0xd0cc('0x35')],'through':{'attributes':[]}}]})[_0xd0cc('0x2c')](function(_0x4d2628){if(_0x4d2628){var _0x236358=_0x7430ac['user']['get']({'plain':!![]});if(!_0x236358)throw new Error(_0xd0cc('0x62'));if(_0x236358['role']===_0xd0cc('0x5a')){return db[_0xd0cc('0x63')][_0xd0cc('0x4c')]({'where':{'name':_0xd0cc('0x64'),'userProfileId':_0x236358[_0xd0cc('0x65')]},'raw':!![]})['then'](function(_0x2e9b0d){if(_0x2e9b0d){if(_0x2e9b0d[_0xd0cc('0x66')]===0x0){return db[_0xd0cc('0x67')][_0xd0cc('0x47')]({'where':{'sectionId':_0x2e9b0d['id']},'raw':!![]})[_0xd0cc('0x2c')](function(_0x3d8190){var _0x31d75c=[];if(_[_0xd0cc('0x68')](_0x3d8190)){_0x31d75c=_[_0xd0cc('0x42')](_0x4d2628,function(_0x170468){if(_0x170468[_0xd0cc('0x5c')]!==_0xd0cc('0x69')){return _0x170468;}});return _0x31d75c;}else{for(var _0x21355f=0x0;_0x21355f<_0x4d2628['length'];_0x21355f++){var _0xda4b34=_0x4d2628[_0x21355f];if(_0xda4b34['role']===_0xd0cc('0x69')){var _0x15abec=_[_0xd0cc('0x4c')](_0x3d8190,function(_0x16a24d){return _0x16a24d[_0xd0cc('0x6a')]===_0xda4b34['id'];});if(_0x15abec)_0x31d75c[_0xd0cc('0x6b')](_0xda4b34);}else{_0x31d75c[_0xd0cc('0x6b')](_0xda4b34);}}return _0x31d75c;}});}else{return _0x4d2628;}}else{var _0x566504=_[_0xd0cc('0x42')](_0x4d2628,function(_0x3d225f){if(_0x3d225f[_0xd0cc('0x5c')]!==_0xd0cc('0x69')){return _0x3d225f;}});return _0x566504;}});}else{return _0x4d2628;}}})[_0xd0cc('0x2c')](function(_0x36df6e){var _0x212a7=[];if(_0x36df6e){_0x1e2d88=_0x36df6e;for(var _0x319403=0x0;_0x319403<_0x36df6e['length'];_0x319403+=0x1){_0x1e2d88[_0x319403]['messages']=[];_0x212a7['push'](db[_0xd0cc('0x45')][_0xd0cc('0x4c')]({'where':{'FromId':[_0x7430ac[_0xd0cc('0x5a')]['id'],_0x36df6e[_0x319403]['id']],'ToId':[_0x7430ac[_0xd0cc('0x5a')]['id'],_0x36df6e[_0x319403]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xd0cc('0x6c'),_0xd0cc('0x6d'),_0xd0cc('0x6e'),'body'],'order':qs[_0xd0cc('0x3f')](_0xd0cc('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0cc('0x2c')](wrapUser(_0x36df6e[_0x319403])));}return BPromise[_0xd0cc('0x70')](_0x212a7);}return[];})[_0xd0cc('0x2c')](function(_0x2be743){return{'rows':_0x2be743,'count':_0x2be743[_0xd0cc('0x3c')]};})[_0xd0cc('0x2c')](respondWithResult(_0x4a3e07,null))[_0xd0cc('0x4d')](handleError(_0x4a3e07,null));}; \ No newline at end of file +var _0xf6b9=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','show','params','rawAttributes','merge','find','create','body','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring'];(function(_0x182c0b,_0x42fdcc){var _0x21e6e8=function(_0x1069b8){while(--_0x1069b8){_0x182c0b['push'](_0x182c0b['shift']());}};_0x21e6e8(++_0x42fdcc);}(_0xf6b9,0xd7));var _0x9f6b=function(_0x3d8291,_0x560e85){_0x3d8291=_0x3d8291-0x0;var _0x2bad5c=_0xf6b9[_0x3d8291];return _0x2bad5c;};'use strict';var emlformat=require(_0x9f6b('0x0'));var rimraf=require(_0x9f6b('0x1'));var zipdir=require(_0x9f6b('0x2'));var jsonpatch=require(_0x9f6b('0x3'));var rp=require(_0x9f6b('0x4'));var moment=require('moment');var BPromise=require(_0x9f6b('0x5'));var Mustache=require(_0x9f6b('0x6'));var util=require(_0x9f6b('0x7'));var path=require(_0x9f6b('0x8'));var sox=require(_0x9f6b('0x9'));var csv=require('to-csv');var ejs=require(_0x9f6b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f6b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f6b('0xc'));var deskjs=require(_0x9f6b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f6b('0xe'));var Papa=require('papaparse');var Redis=require(_0x9f6b('0xf'));var authService=require(_0x9f6b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9f6b('0x11'));var hardwareService=require(_0x9f6b('0x12'));var logger=require(_0x9f6b('0x13'))(_0x9f6b('0x14'));var utils=require(_0x9f6b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9f6b('0x16'));var db=require(_0x9f6b('0x17'))['db'];config[_0x9f6b('0x18')]=_[_0x9f6b('0x19')](config[_0x9f6b('0x18')],{'host':_0x9f6b('0x1a'),'port':0x18eb});var socket=require(_0x9f6b('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x9f6b('0x1c')](socket);function respondWithStatusCode(_0x3b2190,_0x400fe2){_0x400fe2=_0x400fe2||0xcc;return function(_0x2f62ec){if(_0x2f62ec){return _0x3b2190[_0x9f6b('0x1d')](_0x400fe2);}return _0x3b2190['status'](_0x400fe2)[_0x9f6b('0x1e')]();};}function respondWithResult(_0x4c7187,_0x3c4c09){_0x3c4c09=_0x3c4c09||0xc8;return function(_0x53f7fc){if(_0x53f7fc){return _0x4c7187['status'](_0x3c4c09)['json'](_0x53f7fc);}};}function respondWithFilteredResult(_0x4ea2a6,_0xe3c9a0){return function(_0x3757d9){if(_0x3757d9){var _0x1e93ed=typeof _0xe3c9a0[_0x9f6b('0x1f')]==='undefined'&&typeof _0xe3c9a0[_0x9f6b('0x20')]===_0x9f6b('0x21');var _0x508e44=_0x3757d9[_0x9f6b('0x22')];var _0x1a92ca=_0x1e93ed?0x0:_0xe3c9a0[_0x9f6b('0x1f')];var _0x2dcf4c=_0x1e93ed?_0x3757d9[_0x9f6b('0x22')]:_0xe3c9a0[_0x9f6b('0x1f')]+_0xe3c9a0[_0x9f6b('0x20')];var _0x47860f;if(_0x2dcf4c>=_0x508e44){_0x2dcf4c=_0x508e44;_0x47860f=0xc8;}else{_0x47860f=0xce;}_0x4ea2a6[_0x9f6b('0x23')](_0x47860f);return _0x4ea2a6[_0x9f6b('0x24')](_0x9f6b('0x25'),_0x1a92ca+'-'+_0x2dcf4c+'/'+_0x508e44)['json'](_0x3757d9);}return null;};}function patchUpdates(_0x56c60d){return function(_0x2a05ab){try{jsonpatch[_0x9f6b('0x26')](_0x2a05ab,_0x56c60d,!![]);}catch(_0xb432a9){return BPromise[_0x9f6b('0x27')](_0xb432a9);}return _0x2a05ab[_0x9f6b('0x28')]();};}function saveUpdates(_0x106194,_0x4d1a6a){return function(_0x735768){if(_0x735768){return _0x735768[_0x9f6b('0x29')](_0x106194)[_0x9f6b('0x2a')](function(_0x53904c){return _0x53904c;});}return null;};}function removeEntity(_0x514dab,_0x3d8eb4){return function(_0x45ebc1){if(_0x45ebc1){return _0x45ebc1[_0x9f6b('0x2b')]()[_0x9f6b('0x2a')](function(){_0x514dab['status'](0xcc)[_0x9f6b('0x1e')]();});}};}function handleEntityNotFound(_0x39cc6c,_0xd2471a){return function(_0x264a55){if(!_0x264a55){_0x39cc6c[_0x9f6b('0x1d')](0x194);}return _0x264a55;};}function handleError(_0x28734e,_0x491625){_0x491625=_0x491625||0x1f4;return function(_0x3eae10){logger[_0x9f6b('0x2c')](_0x3eae10[_0x9f6b('0x2d')]);if(_0x3eae10['name']){delete _0x3eae10[_0x9f6b('0x2e')];}_0x28734e[_0x9f6b('0x23')](_0x491625)[_0x9f6b('0x2f')](_0x3eae10);};}exports[_0x9f6b('0x30')]=function(_0x14e615,_0x4c8545){var _0x2ab7e6={},_0x2c5674={},_0x21f07d={'count':0x0,'rows':[]};var _0x103c30=_[_0x9f6b('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x36ac8a){return{'name':_0x36ac8a[_0x9f6b('0x32')],'type':_0x36ac8a[_0x9f6b('0x33')]['key']};});_0x2c5674[_0x9f6b('0x34')]=_[_0x9f6b('0x31')](_0x103c30,_0x9f6b('0x2e'));_0x2c5674['query']=_[_0x9f6b('0x35')](_0x14e615[_0x9f6b('0x36')]);_0x2c5674[_0x9f6b('0x37')]=_['intersection'](_0x2c5674[_0x9f6b('0x34')],_0x2c5674[_0x9f6b('0x36')]);_0x2ab7e6[_0x9f6b('0x38')]=_[_0x9f6b('0x39')](_0x2c5674[_0x9f6b('0x34')],qs[_0x9f6b('0x3a')](_0x14e615[_0x9f6b('0x36')][_0x9f6b('0x3a')]));_0x2ab7e6[_0x9f6b('0x38')]=_0x2ab7e6[_0x9f6b('0x38')][_0x9f6b('0x3b')]?_0x2ab7e6[_0x9f6b('0x38')]:_0x2c5674[_0x9f6b('0x34')];if(!_0x14e615[_0x9f6b('0x36')][_0x9f6b('0x3c')](_0x9f6b('0x3d'))){_0x2ab7e6['limit']=qs[_0x9f6b('0x20')](_0x14e615['query'][_0x9f6b('0x20')]);_0x2ab7e6[_0x9f6b('0x1f')]=qs['offset'](_0x14e615['query'][_0x9f6b('0x1f')]);}_0x2ab7e6[_0x9f6b('0x3e')]=qs[_0x9f6b('0x3f')](_0x14e615[_0x9f6b('0x36')][_0x9f6b('0x3f')]);_0x2ab7e6[_0x9f6b('0x40')]=qs[_0x9f6b('0x37')](_[_0x9f6b('0x41')](_0x14e615['query'],_0x2c5674[_0x9f6b('0x37')]),_0x103c30);if(_0x14e615[_0x9f6b('0x36')][_0x9f6b('0x42')]){_0x2ab7e6[_0x9f6b('0x40')]=_['merge'](_0x2ab7e6['where'],{'$or':_[_0x9f6b('0x31')](_0x103c30,function(_0x583a6f){if(_0x583a6f[_0x9f6b('0x33')]!==_0x9f6b('0x43')){var _0x262cde={};_0x262cde[_0x583a6f[_0x9f6b('0x2e')]]={'$like':'%'+_0x14e615[_0x9f6b('0x36')][_0x9f6b('0x42')]+'%'};return _0x262cde;}})});}_0x2ab7e6=_['merge']({},_0x2ab7e6,_0x14e615[_0x9f6b('0x44')]);var _0x24844b={'where':_0x2ab7e6[_0x9f6b('0x40')]};return db[_0x9f6b('0x45')][_0x9f6b('0x22')](_0x24844b)[_0x9f6b('0x2a')](function(_0x4a034c){_0x21f07d['count']=_0x4a034c;if(_0x14e615[_0x9f6b('0x36')][_0x9f6b('0x46')]){_0x2ab7e6[_0x9f6b('0x47')]=[{'all':!![]}];}return db[_0x9f6b('0x45')]['findAll'](_0x2ab7e6);})[_0x9f6b('0x2a')](function(_0x3090c5){_0x21f07d[_0x9f6b('0x48')]=_0x3090c5;return _0x21f07d;})['then'](respondWithFilteredResult(_0x4c8545,_0x2ab7e6))[_0x9f6b('0x49')](handleError(_0x4c8545,null));};exports[_0x9f6b('0x4a')]=function(_0x4b41bb,_0x190893){var _0x265158={'raw':!![],'where':{'id':_0x4b41bb[_0x9f6b('0x4b')]['id']}},_0x167b7e={};_0x167b7e[_0x9f6b('0x34')]=_[_0x9f6b('0x35')](db['ChatInternalMessage'][_0x9f6b('0x4c')]);_0x167b7e[_0x9f6b('0x36')]=_[_0x9f6b('0x35')](_0x4b41bb[_0x9f6b('0x36')]);_0x167b7e[_0x9f6b('0x37')]=_['intersection'](_0x167b7e['model'],_0x167b7e['query']);_0x265158[_0x9f6b('0x38')]=_[_0x9f6b('0x39')](_0x167b7e[_0x9f6b('0x34')],qs['fields'](_0x4b41bb[_0x9f6b('0x36')]['fields']));_0x265158[_0x9f6b('0x38')]=_0x265158[_0x9f6b('0x38')][_0x9f6b('0x3b')]?_0x265158[_0x9f6b('0x38')]:_0x167b7e[_0x9f6b('0x34')];if(_0x4b41bb[_0x9f6b('0x36')][_0x9f6b('0x46')]){_0x265158[_0x9f6b('0x47')]=[{'all':!![]}];}_0x265158=_[_0x9f6b('0x4d')]({},_0x265158,_0x4b41bb[_0x9f6b('0x44')]);return db[_0x9f6b('0x45')][_0x9f6b('0x4e')](_0x265158)['then'](handleEntityNotFound(_0x190893,null))[_0x9f6b('0x2a')](respondWithResult(_0x190893,null))[_0x9f6b('0x49')](handleError(_0x190893,null));};exports[_0x9f6b('0x4f')]=function(_0x55e5bd,_0x3f39bb){return db[_0x9f6b('0x45')][_0x9f6b('0x4f')](_0x55e5bd['body'],{})['then'](respondWithResult(_0x3f39bb,0xc9))[_0x9f6b('0x49')](handleError(_0x3f39bb,null));};exports['update']=function(_0xf1b59,_0x58754b){if(_0xf1b59[_0x9f6b('0x50')]['id']){delete _0xf1b59[_0x9f6b('0x50')]['id'];}return db['ChatInternalMessage'][_0x9f6b('0x4e')]({'where':{'id':_0xf1b59['params']['id']}})[_0x9f6b('0x2a')](handleEntityNotFound(_0x58754b,null))[_0x9f6b('0x2a')](saveUpdates(_0xf1b59['body'],null))['then'](respondWithResult(_0x58754b,null))[_0x9f6b('0x49')](handleError(_0x58754b,null));};exports[_0x9f6b('0x2b')]=function(_0x3468c7,_0x413f8e){return db[_0x9f6b('0x45')]['find']({'where':{'id':_0x3468c7['params']['id']}})[_0x9f6b('0x2a')](handleEntityNotFound(_0x413f8e,null))[_0x9f6b('0x2a')](removeEntity(_0x413f8e,null))[_0x9f6b('0x49')](handleError(_0x413f8e,null));};exports['describe']=function(_0x3086bd,_0x3fb2d6){return db[_0x9f6b('0x45')][_0x9f6b('0x51')]()[_0x9f6b('0x2a')](respondWithResult(_0x3fb2d6,null))['catch'](handleError(_0x3fb2d6,null));};function wrapUser(_0x505f8c){return function(_0x57a516){var _0x589d48=_0x505f8c[_0x9f6b('0x52')]({'plain':!![]});_0x589d48[_0x9f6b('0x53')]=[];if(_0x57a516){_0x589d48['lastMessageAt']=_0x57a516[_0x9f6b('0x54')];_0x589d48[_0x9f6b('0x55')]=_0x57a516;}else{_0x589d48['lastMessageAt']=moment(0x0)[_0x9f6b('0x56')](_0x9f6b('0x57'));_0x589d48[_0x9f6b('0x55')]={};}return _0x589d48;};}exports[_0x9f6b('0x58')]=function(_0x4dd7cd,_0x4203cf,_0x48b86f){var _0x118f6f=[];return db[_0x9f6b('0x59')][_0x9f6b('0x5a')]({'where':{'role':[_0x9f6b('0x5b'),_0x9f6b('0x5c'),_0x9f6b('0x5d')]},'attributes':['id',_0x9f6b('0x5e'),'name',_0x9f6b('0x5f'),_0x9f6b('0x60'),'internal',_0x9f6b('0x61'),_0x9f6b('0x62'),'allowmessenger',_0x9f6b('0x63')],'order':qs[_0x9f6b('0x3f')]('-online'),'include':[{'model':db[_0x9f6b('0x64')],'as':_0x9f6b('0x65'),'attributes':['id',_0x9f6b('0x2e'),_0x9f6b('0x33')],'through':{'attributes':[]}}]})[_0x9f6b('0x2a')](function(_0x50c92d){if(_0x50c92d){var _0x361c06=_0x4dd7cd[_0x9f6b('0x5d')][_0x9f6b('0x52')]({'plain':!![]});if(!_0x361c06)throw new Error(_0x9f6b('0x66'));if(_0x361c06[_0x9f6b('0x5f')]==='user'){return db[_0x9f6b('0x67')][_0x9f6b('0x4e')]({'where':{'name':_0x9f6b('0x68'),'userProfileId':_0x361c06['userProfileId']},'raw':!![]})[_0x9f6b('0x2a')](function(_0x2d7c4b){if(_0x2d7c4b){if(_0x2d7c4b[_0x9f6b('0x69')]===0x0){return db[_0x9f6b('0x6a')]['findAll']({'where':{'sectionId':_0x2d7c4b['id']},'raw':!![]})[_0x9f6b('0x2a')](function(_0x25740c){var _0x2dd64c=[];if(_[_0x9f6b('0x6b')](_0x25740c)){_0x2dd64c=_['filter'](_0x50c92d,function(_0x2034b1){if(_0x2034b1[_0x9f6b('0x5f')]!==_0x9f6b('0x5b')){return _0x2034b1;}});return _0x2dd64c;}else{for(var _0x25d44a=0x0;_0x25d44a<_0x50c92d[_0x9f6b('0x3b')];_0x25d44a++){var _0x4dfe1f=_0x50c92d[_0x25d44a];if(_0x4dfe1f[_0x9f6b('0x5f')]===_0x9f6b('0x5b')){var _0xb5e46a=_[_0x9f6b('0x4e')](_0x25740c,function(_0x40b2e7){return _0x40b2e7[_0x9f6b('0x6c')]===_0x4dfe1f['id'];});if(_0xb5e46a)_0x2dd64c['push'](_0x4dfe1f);}else{_0x2dd64c[_0x9f6b('0x6d')](_0x4dfe1f);}}return _0x2dd64c;}});}else{return _0x50c92d;}}else{var _0x3f06de=_[_0x9f6b('0x42')](_0x50c92d,function(_0x2f438c){if(_0x2f438c[_0x9f6b('0x5f')]!==_0x9f6b('0x5b')){return _0x2f438c;}});return _0x3f06de;}});}else{return _0x50c92d;}}})[_0x9f6b('0x2a')](function(_0x1c32e0){var _0x189593=[];if(_0x1c32e0){_0x118f6f=_0x1c32e0;for(var _0x175092=0x0;_0x175092<_0x1c32e0[_0x9f6b('0x3b')];_0x175092+=0x1){_0x118f6f[_0x175092][_0x9f6b('0x53')]=[];_0x189593[_0x9f6b('0x6d')](db[_0x9f6b('0x45')][_0x9f6b('0x4e')]({'where':{'FromId':[_0x4dd7cd['user']['id'],_0x1c32e0[_0x175092]['id']],'ToId':[_0x4dd7cd[_0x9f6b('0x5d')]['id'],_0x1c32e0[_0x175092]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9f6b('0x6e'),_0x9f6b('0x6f'),_0x9f6b('0x70'),_0x9f6b('0x50')],'order':qs[_0x9f6b('0x3f')](_0x9f6b('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9f6b('0x2a')](wrapUser(_0x1c32e0[_0x175092])));}return BPromise[_0x9f6b('0x72')](_0x189593);}return[];})[_0x9f6b('0x2a')](function(_0x19b5b3){return{'rows':_0x19b5b3,'count':_0x19b5b3[_0x9f6b('0x3b')]};})[_0x9f6b('0x2a')](respondWithResult(_0x4203cf,null))[_0x9f6b('0x49')](handleError(_0x4203cf,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5fe660a..81cd1bb 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 _0xf701=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','update'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0xf701,0x15a));var _0x1f70=function(_0x441637,_0x3b0a6d){_0x441637=_0x441637-0x0;var _0x413474=_0xf701[_0x441637];return _0x413474;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1f70('0x0'))['db'][_0x1f70('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1f70('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f70('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f9505){return function(_0x35eb5f,_0x5937bf,_0x4a0b68){ChatInternalMessageEvents[_0x1f70('0x4')](_0x1f9505+':'+_0x35eb5f['id'],_0x35eb5f);ChatInternalMessageEvents[_0x1f70('0x4')](_0x1f9505,_0x35eb5f);_0x4a0b68(null);};}for(var e in events){if(events[_0x1f70('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1f70('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x5dcd=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x472689,_0x27ce2f){var _0x776f29=function(_0x41d86b){while(--_0x41d86b){_0x472689['push'](_0x472689['shift']());}};_0x776f29(++_0x27ce2f);}(_0x5dcd,0xbb));var _0xd5dc=function(_0x4da093,_0x44abef){_0x4da093=_0x4da093-0x0;var _0x1b7237=_0x5dcd[_0x4da093];return _0x1b7237;};'use strict';var EventEmitter=require(_0xd5dc('0x0'));var ChatInternalMessage=require(_0xd5dc('0x1'))['db'][_0xd5dc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd5dc('0x3')](0x0);var events={'afterCreate':_0xd5dc('0x4'),'afterUpdate':_0xd5dc('0x5'),'afterDestroy':_0xd5dc('0x6')};function emitEvent(_0x4e9983){return function(_0x4ec320,_0x563ede,_0x28e67d){ChatInternalMessageEvents[_0xd5dc('0x7')](_0x4e9983+':'+_0x4ec320['id'],_0x4ec320);ChatInternalMessageEvents[_0xd5dc('0x7')](_0x4e9983,_0x4ec320);_0x28e67d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xd5dc('0x8')](e,emitEvent(event));}}module[_0xd5dc('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index ed83b10..4610682 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 _0x600f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x220a04,_0x43e822){var _0xb558fa=function(_0x1f1f2f){while(--_0x1f1f2f){_0x220a04['push'](_0x220a04['shift']());}};_0xb558fa(++_0x43e822);}(_0x600f,0x11c));var _0xf600=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x600f[_0x4cc280];return _0x16ed24;};'use strict';var _=require('lodash');var util=require(_0xf600('0x0'));var logger=require(_0xf600('0x1'))(_0xf600('0x2'));var moment=require(_0xf600('0x3'));var BPromise=require(_0xf600('0x4'));var rp=require(_0xf600('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf600('0x6'));var config=require(_0xf600('0x7'));var attributes=require(_0xf600('0x8'));module['exports']=function(_0xa8e17e,_0x262955){return _0xa8e17e['define'](_0xf600('0x9'),attributes,{'tableName':_0xf600('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf600('0xb'),'collate':_0xf600('0xc')});}; \ No newline at end of file +var _0xc9ec=['chat_internal_messages','utf8mb4_unicode_ci','lodash','util','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x3ff818,_0x5d9e54){var _0x2cae16=function(_0x36f40e){while(--_0x36f40e){_0x3ff818['push'](_0x3ff818['shift']());}};_0x2cae16(++_0x5d9e54);}(_0xc9ec,0x174));var _0xcc9e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc9ec[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xcc9e('0x0'));var util=require(_0xcc9e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc9e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc9e('0x3'));var attributes=require(_0xcc9e('0x4'));module[_0xcc9e('0x5')]=function(_0x3b4cf3,_0x149811){return _0x3b4cf3[_0xcc9e('0x6')](_0xcc9e('0x7'),attributes,{'tableName':_0xcc9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc9e('0x9')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 70f696b..bce1271 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 _0xd0b1=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd0b1,0x16e));var _0x1d0b=function(_0xe8a9c6,_0x315a90){_0xe8a9c6=_0xe8a9c6-0x0;var _0x3d150c=_0xd0b1[_0xe8a9c6];return _0x3d150c;};'use strict';var _=require(_0x1d0b('0x0'));var util=require(_0x1d0b('0x1'));var moment=require('moment');var BPromise=require(_0x1d0b('0x2'));var rs=require(_0x1d0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d0b('0x4'))['db'];var utils=require(_0x1d0b('0x5'));var logger=require(_0x1d0b('0x6'))(_0x1d0b('0x7'));var config=require(_0x1d0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d0b('0x9')][_0x1d0b('0xa')]({'port':0x232a});config[_0x1d0b('0xb')]=_[_0x1d0b('0xc')](config[_0x1d0b('0xb')],{'host':_0x1d0b('0xd'),'port':0x18eb});var socket=require(_0x1d0b('0xe'))(new Redis(config['redis']));require(_0x1d0b('0xf'))[_0x1d0b('0x10')](socket);function respondWithRpcPromise(_0x3a5369,_0x4b136e,_0x1b520a){return new BPromise(function(_0x5ef099,_0x196c3b){return client[_0x1d0b('0x11')](_0x3a5369,_0x1b520a)['then'](function(_0x529c76){logger[_0x1d0b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x1d0b('0x13'));logger[_0x1d0b('0x14')](_0x1d0b('0x15'),_0x4b136e,_0x1d0b('0x13'),JSON[_0x1d0b('0x16')](_0x529c76));if(_0x529c76['error']){if(_0x529c76[_0x1d0b('0x17')]['code']===0x1f4){logger[_0x1d0b('0x17')](_0x1d0b('0x18'),_0x4b136e,_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);return _0x196c3b(_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);}logger[_0x1d0b('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);return _0x5ef099(_0x529c76['error'][_0x1d0b('0x19')]);}else{logger[_0x1d0b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x1d0b('0x13'));_0x5ef099(_0x529c76[_0x1d0b('0x1a')]['message']);}})[_0x1d0b('0x1b')](function(_0x1f874){logger[_0x1d0b('0x17')](_0x1d0b('0x18'),_0x4b136e,_0x1f874);_0x196c3b(_0x1f874);});});} \ No newline at end of file +var _0x8f2f=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x9f721,_0x14bcc5){var _0x20052d=function(_0xba8047){while(--_0xba8047){_0x9f721['push'](_0x9f721['shift']());}};_0x20052d(++_0x14bcc5);}(_0x8f2f,0x1b6));var _0xf8f2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8f2f[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf8f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf8f2('0x1'));var rs=require(_0xf8f2('0x2'));var fs=require('fs');var Redis=require(_0xf8f2('0x3'));var db=require(_0xf8f2('0x4'))['db'];var utils=require(_0xf8f2('0x5'));var logger=require('../../config/logger')(_0xf8f2('0x6'));var config=require('../../config/environment');var jayson=require(_0xf8f2('0x7'));var client=jayson[_0xf8f2('0x8')][_0xf8f2('0x9')]({'port':0x232a});config[_0xf8f2('0xa')]=_['defaults'](config[_0xf8f2('0xa')],{'host':_0xf8f2('0xb'),'port':0x18eb});var socket=require(_0xf8f2('0xc'))(new Redis(config['redis']));require(_0xf8f2('0xd'))[_0xf8f2('0xe')](socket);function respondWithRpcPromise(_0x3fdc5f,_0x3035fd,_0x52715d){return new BPromise(function(_0x4bbde8,_0x1ab536){return client[_0xf8f2('0xf')](_0x3fdc5f,_0x52715d)[_0xf8f2('0x10')](function(_0x210131){logger[_0xf8f2('0x11')](_0xf8f2('0x12'),_0x3035fd,_0xf8f2('0x13'));logger[_0xf8f2('0x14')](_0xf8f2('0x15'),_0x3035fd,'request\x20sent',JSON[_0xf8f2('0x16')](_0x210131));if(_0x210131[_0xf8f2('0x17')]){if(_0x210131[_0xf8f2('0x17')][_0xf8f2('0x18')]===0x1f4){logger['error'](_0xf8f2('0x12'),_0x3035fd,_0x210131[_0xf8f2('0x17')][_0xf8f2('0x19')]);return _0x1ab536(_0x210131[_0xf8f2('0x17')][_0xf8f2('0x19')]);}logger[_0xf8f2('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3035fd,_0x210131[_0xf8f2('0x17')][_0xf8f2('0x19')]);return _0x4bbde8(_0x210131[_0xf8f2('0x17')][_0xf8f2('0x19')]);}else{logger[_0xf8f2('0x11')](_0xf8f2('0x12'),_0x3035fd,_0xf8f2('0x13'));_0x4bbde8(_0x210131[_0xf8f2('0x1a')][_0xf8f2('0x19')]);}})[_0xf8f2('0x1b')](function(_0x278e70){logger[_0xf8f2('0x17')](_0xf8f2('0x12'),_0x3035fd,_0x278e70);_0x1ab536(_0x278e70);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4dbdfe1..6e01b31 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 _0x4cd2=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x3eddb3,_0x4c7b89){var _0x2c7497=function(_0x17dfb9){while(--_0x17dfb9){_0x3eddb3['push'](_0x3eddb3['shift']());}};_0x2c7497(++_0x4c7b89);}(_0x4cd2,0x193));var _0x24cd=function(_0x412cee,_0x3bd66a){_0x412cee=_0x412cee-0x0;var _0x553f36=_0x4cd2[_0x412cee];return _0x553f36;};'use strict';var ChatInternalMessageEvents=require(_0x24cd('0x0'));var events=[_0x24cd('0x1'),_0x24cd('0x2'),_0x24cd('0x3')];function createListener(_0xf41b1e,_0x330cb0){return function(_0x46474b){_0x330cb0[_0x24cd('0x4')](_0xf41b1e,_0x46474b);};}function removeListener(_0x533a33,_0x3739e0){return function(){ChatInternalMessageEvents[_0x24cd('0x5')](_0x533a33,_0x3739e0);};}exports['register']=function(_0xe1ccf8){for(var _0xb6ae30=0x0,_0x41bc6d=events[_0x24cd('0x6')];_0xb6ae30<_0x41bc6d;_0xb6ae30++){var _0x53cbe3=events[_0xb6ae30];var _0x546488=createListener(_0x24cd('0x7')+_0x53cbe3,_0xe1ccf8);ChatInternalMessageEvents['on'](_0x53cbe3,_0x546488);}}; \ No newline at end of file +var _0x0eed=['save','update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0eed,0x76));var _0xd0ee=function(_0x58658d,_0x33cff4){_0x58658d=_0x58658d-0x0;var _0x487a2f=_0x0eed[_0x58658d];return _0x487a2f;};'use strict';var ChatInternalMessageEvents=require(_0xd0ee('0x0'));var events=[_0xd0ee('0x1'),'remove',_0xd0ee('0x2')];function createListener(_0x427193,_0x430d7c){return function(_0x340fc4){_0x430d7c['emit'](_0x427193,_0x340fc4);};}function removeListener(_0x42fae6,_0x4d6ed7){return function(){ChatInternalMessageEvents[_0xd0ee('0x3')](_0x42fae6,_0x4d6ed7);};}exports[_0xd0ee('0x4')]=function(_0x19a2cf){for(var _0x14aed3=0x0,_0x50eb82=events[_0xd0ee('0x5')];_0x14aed3<_0x50eb82;_0x14aed3++){var _0x46715f=events[_0x14aed3];var _0x859c74=createListener(_0xd0ee('0x6')+_0x46715f,_0x19a2cf);ChatInternalMessageEvents['on'](_0x46715f,_0x859c74);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 604adc5..f6ec395 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 _0x1c24=['/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x17d703,_0x2266eb){var _0x4fd652=function(_0x4147ad){while(--_0x4147ad){_0x17d703['push'](_0x17d703['shift']());}};_0x4fd652(++_0x2266eb);}(_0x1c24,0x1ac));var _0x41c2=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1c24[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x41c2('0x0'));var util=require(_0x41c2('0x1'));var path=require('path');var timeout=require(_0x41c2('0x2'));var express=require(_0x41c2('0x3'));var router=express[_0x41c2('0x4')]();var fs_extra=require(_0x41c2('0x5'));var auth=require(_0x41c2('0x6'));var interaction=require(_0x41c2('0x7'));var config=require(_0x41c2('0x8'));var controller=require(_0x41c2('0x9'));router[_0x41c2('0xa')]('/',auth[_0x41c2('0xb')](),controller['index']);router[_0x41c2('0xa')]('/describe',auth[_0x41c2('0xb')](),controller['describe']);router['get'](_0x41c2('0xc'),auth[_0x41c2('0xb')](),controller[_0x41c2('0xd')]);router[_0x41c2('0xa')](_0x41c2('0xe'),auth[_0x41c2('0xb')](),controller[_0x41c2('0xf')]);router[_0x41c2('0x10')]('/',auth[_0x41c2('0xb')](),controller[_0x41c2('0x11')]);router[_0x41c2('0x12')](_0x41c2('0xe'),controller[_0x41c2('0x13')]);router[_0x41c2('0x14')](_0x41c2('0xe'),auth[_0x41c2('0xb')](),controller[_0x41c2('0x15')]);module['exports']=router; \ No newline at end of file +var _0x666e=['describe','/users','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x54f1a5,_0x5b2734){var _0x3778c7=function(_0x845c46){while(--_0x845c46){_0x54f1a5['push'](_0x54f1a5['shift']());}};_0x3778c7(++_0x5b2734);}(_0x666e,0x17b));var _0xe666=function(_0x1232ec,_0x2df4b1){_0x1232ec=_0x1232ec-0x0;var _0x4483b4=_0x666e[_0x1232ec];return _0x4483b4;};'use strict';var multer=require(_0xe666('0x0'));var util=require(_0xe666('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe666('0x2'));var router=express[_0xe666('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe666('0x4'));var interaction=require(_0xe666('0x5'));var config=require(_0xe666('0x6'));var controller=require(_0xe666('0x7'));router['get']('/',auth[_0xe666('0x8')](),controller[_0xe666('0x9')]);router[_0xe666('0xa')](_0xe666('0xb'),auth[_0xe666('0x8')](),controller[_0xe666('0xc')]);router['get'](_0xe666('0xd'),auth[_0xe666('0x8')](),controller['getUsers']);router[_0xe666('0xa')](_0xe666('0xe'),auth[_0xe666('0x8')](),controller[_0xe666('0xf')]);router[_0xe666('0x10')]('/',auth['isAuthenticated'](),controller[_0xe666('0x11')]);router[_0xe666('0x12')]('/:id',controller[_0xe666('0x13')]);router[_0xe666('0x14')](_0xe666('0xe'),auth[_0xe666('0x8')](),controller[_0xe666('0x15')]);module[_0xe666('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 96f1fd7..89c8a0c 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 _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0xab36ea,_0xb838df){var _0x27e12d=function(_0x3d31ed){while(--_0x3d31ed){_0xab36ea['push'](_0xab36ea['shift']());}};_0x27e12d(++_0xb838df);}(_0x97e6,0x159));var _0x697e=function(_0x2812c2,_0x2b382d){_0x2812c2=_0x2812c2-0x0;var _0x218ac9=_0x97e6[_0x2812c2];return _0x218ac9;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}}; \ No newline at end of file +var _0xe511=['medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x37545c,_0x9906f5){var _0x4cd312=function(_0x21536b){while(--_0x21536b){_0x37545c['push'](_0x37545c['shift']());}};_0x4cd312(++_0x9906f5);}(_0xe511,0x16f));var _0x1e51=function(_0x1ac77b,_0x10ee7a){_0x1ac77b=_0x1ac77b-0x0;var _0x161584=_0xe511[_0x1ac77b];return _0x161584;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1e51('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1e51('0x4')]('in','out'),'defaultValue':_0x1e51('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1e51('0x6')]},'providerName':{'type':Sequelize[_0x1e51('0x7')]},'providerResponse':{'type':Sequelize[_0x1e51('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 625bb7a..eae61b6 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 _0x5b34=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','include','rows','show','params','length','includeAll','create','body','find','describe','../../config/logger','chat','read','UserId','user','agent','get','format','YYYY-MM-DD\x20HH:mm:ss','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','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','fullname','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','name','send','map','rawAttributes','fieldName','key','model','keys','query','intersection'];(function(_0x3f85b0,_0x88efeb){var _0x2489e2=function(_0x26397a){while(--_0x26397a){_0x3f85b0['push'](_0x3f85b0['shift']());}};_0x2489e2(++_0x88efeb);}(_0x5b34,0x13a));var _0x45b3=function(_0x5056f8,_0x37ec78){_0x5056f8=_0x5056f8-0x0;var _0x3f4532=_0x5b34[_0x5056f8];return _0x3f4532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45b3('0x0'));var zipdir=require(_0x45b3('0x1'));var jsonpatch=require(_0x45b3('0x2'));var rp=require(_0x45b3('0x3'));var moment=require('moment');var BPromise=require(_0x45b3('0x4'));var Mustache=require(_0x45b3('0x5'));var util=require('util');var path=require(_0x45b3('0x6'));var sox=require(_0x45b3('0x7'));var csv=require(_0x45b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45b3('0x9'));var _=require(_0x45b3('0xa'));var squel=require(_0x45b3('0xb'));var crypto=require(_0x45b3('0xc'));var jsforce=require(_0x45b3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x45b3('0x8'));var querystring=require(_0x45b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x45b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x45b3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45b3('0x11'));var logger=require('../../config/logger')(_0x45b3('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x45b3('0x13'));var db=require(_0x45b3('0x14'))['db'];config[_0x45b3('0x15')]=_[_0x45b3('0x16')](config[_0x45b3('0x15')],{'host':_0x45b3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45b3('0x15')]));require(_0x45b3('0x18'))[_0x45b3('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36d0e7,_0x382c1d,_0x39e20c,_0x2f6ec8){return new BPromise(function(_0x92e3f3,_0xfdaacc){var _0x14d495=_0x2f6ec8||client;return _0x14d495[_0x45b3('0x1a')](_0x36d0e7,_0x39e20c)[_0x45b3('0x1b')](function(_0x5dd6e7){logger[_0x45b3('0x1c')](_0x45b3('0x1d'),_0x382c1d,_0x45b3('0x1e'));logger[_0x45b3('0x1f')](_0x45b3('0x20'),_0x382c1d,_0x45b3('0x1e'),JSON[_0x45b3('0x21')](_0x5dd6e7));if(_0x5dd6e7[_0x45b3('0x22')]){if(_0x5dd6e7[_0x45b3('0x22')][_0x45b3('0x23')]===0x1f4){logger[_0x45b3('0x22')](_0x45b3('0x1d'),_0x382c1d,_0x5dd6e7['error'][_0x45b3('0x24')]);return _0xfdaacc(_0x5dd6e7[_0x45b3('0x22')][_0x45b3('0x24')]);}logger[_0x45b3('0x22')]('ChatMessage,\x20%s,\x20%s',_0x382c1d,_0x5dd6e7['error'][_0x45b3('0x24')]);return _0x92e3f3(_0x5dd6e7[_0x45b3('0x22')]['message']);}else{logger[_0x45b3('0x1c')](_0x45b3('0x1d'),_0x382c1d,_0x45b3('0x1e'));_0x92e3f3(_0x5dd6e7[_0x45b3('0x25')]['message']);}})[_0x45b3('0x26')](function(_0x461486){logger[_0x45b3('0x22')](_0x45b3('0x1d'),_0x382c1d,_0x461486);_0xfdaacc(_0x461486);});});}function respondWithStatusCode(_0x5d6aae,_0x1eff45){_0x1eff45=_0x1eff45||0xcc;return function(_0x2c4d7a){if(_0x2c4d7a){return _0x5d6aae['sendStatus'](_0x1eff45);}return _0x5d6aae[_0x45b3('0x27')](_0x1eff45)['end']();};}function respondWithResult(_0x4de542,_0x3d7d41){_0x3d7d41=_0x3d7d41||0xc8;return function(_0x17be4c){if(_0x17be4c){return _0x4de542[_0x45b3('0x27')](_0x3d7d41)['json'](_0x17be4c);}};}function respondWithFilteredResult(_0x33ad21,_0x1ebce2){return function(_0x4534db){if(_0x4534db){var _0x2ab7d4=typeof _0x1ebce2[_0x45b3('0x28')]===_0x45b3('0x29')&&typeof _0x1ebce2[_0x45b3('0x2a')]==='undefined';var _0x35e866=_0x4534db[_0x45b3('0x2b')];var _0x1857c9=_0x2ab7d4?0x0:_0x1ebce2[_0x45b3('0x28')];var _0xde9172=_0x2ab7d4?_0x4534db['count']:_0x1ebce2[_0x45b3('0x28')]+_0x1ebce2[_0x45b3('0x2a')];var _0x2fc0fe;if(_0xde9172>=_0x35e866){_0xde9172=_0x35e866;_0x2fc0fe=0xc8;}else{_0x2fc0fe=0xce;}_0x33ad21[_0x45b3('0x27')](_0x2fc0fe);return _0x33ad21[_0x45b3('0x2c')](_0x45b3('0x2d'),_0x1857c9+'-'+_0xde9172+'/'+_0x35e866)[_0x45b3('0x2e')](_0x4534db);}return null;};}function patchUpdates(_0x29b553){return function(_0x18e8a4){try{jsonpatch[_0x45b3('0x2f')](_0x18e8a4,_0x29b553,!![]);}catch(_0x1069eb){return BPromise[_0x45b3('0x30')](_0x1069eb);}return _0x18e8a4[_0x45b3('0x31')]();};}function saveUpdates(_0xe91204,_0x4e9581){return function(_0x51bce1){if(_0x51bce1){return _0x51bce1[_0x45b3('0x32')](_0xe91204)[_0x45b3('0x1b')](function(_0x1f0d79){return _0x1f0d79;});}return null;};}function removeEntity(_0x15362f,_0x1ba5e3){return function(_0x36eb3f){if(_0x36eb3f){return _0x36eb3f[_0x45b3('0x33')]()[_0x45b3('0x1b')](function(){_0x15362f[_0x45b3('0x27')](0xcc)[_0x45b3('0x34')]();});}};}function handleEntityNotFound(_0x55a4ac,_0x263f7a){return function(_0x68ebe8){if(!_0x68ebe8){_0x55a4ac[_0x45b3('0x35')](0x194);}return _0x68ebe8;};}function handleError(_0x4005fc,_0x2d09e4){_0x2d09e4=_0x2d09e4||0x1f4;return function(_0x41778d){logger[_0x45b3('0x22')](_0x41778d['stack']);if(_0x41778d['name']){delete _0x41778d[_0x45b3('0x36')];}_0x4005fc[_0x45b3('0x27')](_0x2d09e4)[_0x45b3('0x37')](_0x41778d);};}exports['index']=function(_0x22b376,_0x247491){var _0xc776a2={},_0x208c4d={},_0x21dadc={'count':0x0,'rows':[]};var _0x5b4855=_[_0x45b3('0x38')](db['ChatMessage'][_0x45b3('0x39')],function(_0x4de599){return{'name':_0x4de599[_0x45b3('0x3a')],'type':_0x4de599['type'][_0x45b3('0x3b')]};});_0x208c4d[_0x45b3('0x3c')]=_[_0x45b3('0x38')](_0x5b4855,_0x45b3('0x36'));_0x208c4d['query']=_[_0x45b3('0x3d')](_0x22b376[_0x45b3('0x3e')]);_0x208c4d['filters']=_[_0x45b3('0x3f')](_0x208c4d[_0x45b3('0x3c')],_0x208c4d['query']);_0xc776a2[_0x45b3('0x40')]=_['intersection'](_0x208c4d[_0x45b3('0x3c')],qs[_0x45b3('0x41')](_0x22b376['query'][_0x45b3('0x41')]));_0xc776a2[_0x45b3('0x40')]=_0xc776a2[_0x45b3('0x40')]['length']?_0xc776a2[_0x45b3('0x40')]:_0x208c4d[_0x45b3('0x3c')];if(!_0x22b376['query'][_0x45b3('0x42')](_0x45b3('0x43'))){_0xc776a2[_0x45b3('0x2a')]=qs[_0x45b3('0x2a')](_0x22b376[_0x45b3('0x3e')][_0x45b3('0x2a')]);_0xc776a2[_0x45b3('0x28')]=qs[_0x45b3('0x28')](_0x22b376[_0x45b3('0x3e')][_0x45b3('0x28')]);}_0xc776a2[_0x45b3('0x44')]=qs[_0x45b3('0x45')](_0x22b376[_0x45b3('0x3e')]['sort']);_0xc776a2[_0x45b3('0x46')]=qs['filters'](_[_0x45b3('0x47')](_0x22b376['query'],_0x208c4d['filters']),_0x5b4855);if(_0x22b376[_0x45b3('0x3e')][_0x45b3('0x48')]){_0xc776a2['where']=_[_0x45b3('0x49')](_0xc776a2[_0x45b3('0x46')],{'$or':_[_0x45b3('0x38')](_0x5b4855,function(_0x5c9483){if(_0x5c9483[_0x45b3('0x4a')]!==_0x45b3('0x4b')){var _0x35bd60={};_0x35bd60[_0x5c9483[_0x45b3('0x36')]]={'$like':'%'+_0x22b376['query'][_0x45b3('0x48')]+'%'};return _0x35bd60;}})});}_0xc776a2=_['merge']({},_0xc776a2,_0x22b376[_0x45b3('0x4c')]);var _0x5a75cf={'where':_0xc776a2['where']};return db[_0x45b3('0x4d')][_0x45b3('0x2b')](_0x5a75cf)[_0x45b3('0x1b')](function(_0x3a4647){_0x21dadc['count']=_0x3a4647;if(_0x22b376[_0x45b3('0x3e')]['includeAll']){_0xc776a2[_0x45b3('0x4e')]=[{'all':!![]}];}return db[_0x45b3('0x4d')]['findAll'](_0xc776a2);})['then'](function(_0x1943fc){_0x21dadc[_0x45b3('0x4f')]=_0x1943fc;return _0x21dadc;})[_0x45b3('0x1b')](respondWithFilteredResult(_0x247491,_0xc776a2))[_0x45b3('0x26')](handleError(_0x247491,null));};exports[_0x45b3('0x50')]=function(_0x1ebae4,_0x21ff7c){var _0x15abb7={'raw':!![],'where':{'id':_0x1ebae4[_0x45b3('0x51')]['id']}},_0x5ebf38={};_0x5ebf38[_0x45b3('0x3c')]=_[_0x45b3('0x3d')](db[_0x45b3('0x4d')][_0x45b3('0x39')]);_0x5ebf38[_0x45b3('0x3e')]=_[_0x45b3('0x3d')](_0x1ebae4[_0x45b3('0x3e')]);_0x5ebf38['filters']=_[_0x45b3('0x3f')](_0x5ebf38[_0x45b3('0x3c')],_0x5ebf38[_0x45b3('0x3e')]);_0x15abb7[_0x45b3('0x40')]=_[_0x45b3('0x3f')](_0x5ebf38[_0x45b3('0x3c')],qs[_0x45b3('0x41')](_0x1ebae4['query'][_0x45b3('0x41')]));_0x15abb7[_0x45b3('0x40')]=_0x15abb7['attributes'][_0x45b3('0x52')]?_0x15abb7[_0x45b3('0x40')]:_0x5ebf38[_0x45b3('0x3c')];if(_0x1ebae4[_0x45b3('0x3e')][_0x45b3('0x53')]){_0x15abb7[_0x45b3('0x4e')]=[{'all':!![]}];}_0x15abb7=_[_0x45b3('0x49')]({},_0x15abb7,_0x1ebae4[_0x45b3('0x4c')]);return db['ChatMessage']['find'](_0x15abb7)[_0x45b3('0x1b')](handleEntityNotFound(_0x21ff7c,null))[_0x45b3('0x1b')](respondWithResult(_0x21ff7c,null))['catch'](handleError(_0x21ff7c,null));};exports[_0x45b3('0x54')]=function(_0x4f1494,_0x41aab1){return db[_0x45b3('0x4d')][_0x45b3('0x54')](_0x4f1494[_0x45b3('0x55')],{})['then'](respondWithResult(_0x41aab1,0xc9))[_0x45b3('0x26')](handleError(_0x41aab1,null));};exports[_0x45b3('0x32')]=function(_0x20b227,_0xff5b69){if(_0x20b227[_0x45b3('0x55')]['id']){delete _0x20b227[_0x45b3('0x55')]['id'];}return db[_0x45b3('0x4d')][_0x45b3('0x56')]({'where':{'id':_0x20b227[_0x45b3('0x51')]['id']}})['then'](handleEntityNotFound(_0xff5b69,null))[_0x45b3('0x1b')](saveUpdates(_0x20b227['body'],null))[_0x45b3('0x1b')](respondWithResult(_0xff5b69,null))[_0x45b3('0x26')](handleError(_0xff5b69,null));};exports[_0x45b3('0x33')]=function(_0x4b8a6c,_0x577353){return db[_0x45b3('0x4d')]['find']({'where':{'id':_0x4b8a6c[_0x45b3('0x51')]['id']}})[_0x45b3('0x1b')](handleEntityNotFound(_0x577353,null))['then'](removeEntity(_0x577353,null))[_0x45b3('0x26')](handleError(_0x577353,null));};exports[_0x45b3('0x57')]=function(_0x17bef8,_0x19efa4){return db[_0x45b3('0x4d')]['describe']()['then'](respondWithResult(_0x19efa4,null))[_0x45b3('0x26')](handleError(_0x19efa4,null));};var interaction_log=require(_0x45b3('0x58'))('chat-interactions');exports['accept']=function(_0x217569,_0x52e395,_0x27dfa5){var _0xaa77b0={'agent':{},'channel':_0x45b3('0x59')};if(_0x217569[_0x45b3('0x55')]['id']){delete _0x217569[_0x45b3('0x55')]['id'];}_0x217569['body'][_0x45b3('0x5a')]=!![];_0x217569[_0x45b3('0x55')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')]=_0x217569['body'][_0x45b3('0x5b')]||_0x217569[_0x45b3('0x5c')]['id'];_0xaa77b0[_0x45b3('0x5d')]['id']=_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')];return db[_0x45b3('0x4d')][_0x45b3('0x56')]({'where':{'id':_0x217569[_0x45b3('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52e395,null))[_0x45b3('0x1b')](saveUpdates(_0x217569[_0x45b3('0x55')],null))['then'](function(_0x322010){if(_0x322010){_0xaa77b0[_0x45b3('0x24')]=_0x322010[_0x45b3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x45b3('0x56')]({'where':{'id':_0x322010['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x52e395,null))['then'](function(_0x4cbbb3){if(_0x4cbbb3){return _0x4cbbb3[_0x45b3('0x32')]({'UserId':_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')],'read1stAt':_['isNil'](_0x4cbbb3['read1stAt'])?moment()[_0x45b3('0x5f')](_0x45b3('0x60')):undefined});}return null;})['then'](function(_0x290f72){if(_0x290f72){_0xaa77b0[_0x45b3('0x61')]=_0x290f72['get']({'plain':!![]});interaction_log['info'](_0x45b3('0x62'),_0x217569[_0x45b3('0x5c')]['id'],_0x217569[_0x45b3('0x5c')][_0x45b3('0x36')],_0x217569['user'][_0x45b3('0x63')],_0xaa77b0[_0x45b3('0x61')]['id'],_0x217569[_0x45b3('0x55')]?JSON[_0x45b3('0x21')](_0x217569[_0x45b3('0x55')]):_0x45b3('0x64'));return respondWithRpcPromise(_0x45b3('0x65'),'acceptMessage',_0xaa77b0);}return null;})[_0x45b3('0x1b')](function(_0x1f0533){var _0x3bba4d=_0x45b3('0x66')+_0x1f0533['message'][_0x45b3('0x67')];return db[_0x45b3('0x68')]['query'](_0x3bba4d,{'type':db[_0x45b3('0x69')][_0x45b3('0x6a')][_0x45b3('0x6b')],'raw':!![]})[_0x45b3('0x1b')](function(_0x2af102){return _0x2af102;});})['then'](function(_0x4c3948){if(_0x4c3948){_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x6c')]=_0x4c3948[0x0];if(!_0x217569['body'][_0x45b3('0x5b')])return;return db[_0x45b3('0x6d')][_0x45b3('0x56')]({'where':{'id':_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')],'role':_0x45b3('0x5d')},'attributes':['id','name','fullname',_0x45b3('0x6e'),_0x45b3('0x6f')],'raw':!![]});}return null;})[_0x45b3('0x1b')](function(_0x3d03ea){if(!_0x3d03ea)return null;_0xaa77b0['message'][_0x45b3('0x5d')]=_0x3d03ea;return _0xaa77b0;})[_0x45b3('0x1b')](function(_0x41cb61){if(_0x41cb61){if(_0x217569['body'][_0x45b3('0x70')]){_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x71')]=util[_0x45b3('0x5f')]('SIP/%s',_0x217569[_0x45b3('0x5c')][_0x45b3('0x36')]);_0xaa77b0['message'][_0x45b3('0x72')]=_0xaa77b0[_0x45b3('0x72')];_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x73')]=_0xaa77b0['channel'];_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x74')]=_0x45b3('0x75');return respondWithRpcPromise(_0x45b3('0x76'),_0x45b3('0x76'),{'event':_0x45b3('0x77'),'message':_[_0x45b3('0x49')](_0xaa77b0['message'],JSON[_0x45b3('0x78')](_0xaa77b0[_0x45b3('0x61')][_0x45b3('0x79')]))},client9002)[_0x45b3('0x1b')](function(){return _0xaa77b0;});}return _0xaa77b0;}return null;})[_0x45b3('0x1b')](respondWithResult(_0x52e395,null))[_0x45b3('0x26')](handleError(_0x52e395,null));};var interaction_log=require(_0x45b3('0x58'))(_0x45b3('0x7a'));exports[_0x45b3('0x30')]=function(_0x1658f1,_0x512d14,_0xc61ef0){var _0x5aa96b={'agent':{},'channel':_0x45b3('0x59')};if(_0x1658f1[_0x45b3('0x55')]['id']){delete _0x1658f1[_0x45b3('0x55')]['id'];}_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')]=_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')]||_0x1658f1['user']['id'];_0x5aa96b['agent']['id']=_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')];return db[_0x45b3('0x4d')]['find']({'where':{'id':_0x1658f1[_0x45b3('0x51')]['id'],'UserId':null}})[_0x45b3('0x1b')](handleEntityNotFound(_0x512d14,null))[_0x45b3('0x1b')](function(_0x3b4ca3){if(_0x3b4ca3){_0x5aa96b[_0x45b3('0x24')]=_0x3b4ca3[_0x45b3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x45b3('0x56')]({'where':{'id':_0x3b4ca3[_0x45b3('0x7b')]}});}return null;})[_0x45b3('0x1b')](handleEntityNotFound(_0x512d14,null))[_0x45b3('0x1b')](function(_0x32ec45){if(_0x32ec45){_0x5aa96b[_0x45b3('0x61')]=_0x32ec45[_0x45b3('0x5e')]({'plain':!![]});interaction_log[_0x45b3('0x1c')](_0x45b3('0x7c'),_0x1658f1['user']['id'],_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x36')],_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x63')],_0x5aa96b[_0x45b3('0x61')]['id'],_0x1658f1[_0x45b3('0x55')]?JSON[_0x45b3('0x21')](_0x1658f1['body']):_0x45b3('0x64'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5aa96b);}return null;})[_0x45b3('0x1b')](function(_0x50daf5){var _0x2f3e1e=_0x45b3('0x66')+_0x50daf5[_0x45b3('0x24')][_0x45b3('0x67')];return db[_0x45b3('0x68')]['query'](_0x2f3e1e,{'type':db[_0x45b3('0x69')][_0x45b3('0x6a')][_0x45b3('0x6b')],'raw':!![]})[_0x45b3('0x1b')](function(_0x4aa05a){return _0x4aa05a;});})[_0x45b3('0x1b')](function(_0x21af2e){if(_0x21af2e){_0x5aa96b['message'][_0x45b3('0x6c')]=_0x21af2e[0x0];if(!_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')])return;return db[_0x45b3('0x6d')][_0x45b3('0x56')]({'where':{'id':_0x1658f1['body'][_0x45b3('0x5b')],'role':_0x45b3('0x5d')},'attributes':['id',_0x45b3('0x36'),_0x45b3('0x7d'),'email',_0x45b3('0x6f')],'raw':!![]});}return null;})[_0x45b3('0x1b')](function(_0x520298){if(!_0x520298)return null;_0x5aa96b[_0x45b3('0x24')][_0x45b3('0x5d')]=_0x520298;return _0x5aa96b;})[_0x45b3('0x1b')](function(_0xf9d58b){if(_0xf9d58b){_0xf9d58b[_0x45b3('0x24')]['interface']=util['format']('SIP/%s',_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x36')]);_0xf9d58b['message']['channel']=_0x5aa96b[_0x45b3('0x72')];_0xf9d58b['message']['motionChannel']=_0x5aa96b[_0x45b3('0x72')];_0xf9d58b[_0x45b3('0x24')][_0x45b3('0x74')]='reject';respondWithRpcPromise('EventManager',_0x45b3('0x76'),{'event':'rejectmessage','message':_[_0x45b3('0x49')](_0x5aa96b[_0x45b3('0x24')],JSON[_0x45b3('0x78')](_0x5aa96b['interaction'][_0x45b3('0x79')]))},client9002);return _0x5aa96b;}return null;})['then'](respondWithResult(_0x512d14,null))[_0x45b3('0x26')](handleError(_0x512d14,null));}; \ No newline at end of file +var _0x4bf4=['jayson/promise','client','http','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','info','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','body','params','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteractionId','isNil','format','interaction','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','parse','formData','get','ChatInteraction','role','RejectMessage','SELECT','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket'];(function(_0x252455,_0x4ce56a){var _0xb217d7=function(_0x37e201){while(--_0x37e201){_0x252455['push'](_0x252455['shift']());}};_0xb217d7(++_0x4ce56a);}(_0x4bf4,0xe3));var _0x44bf=function(_0x2e848c,_0x754fee){_0x2e848c=_0x2e848c-0x0;var _0x3de087=_0x4bf4[_0x2e848c];return _0x3de087;};'use strict';var emlformat=require(_0x44bf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44bf('0x1'));var rp=require('request-promise');var moment=require(_0x44bf('0x2'));var BPromise=require(_0x44bf('0x3'));var Mustache=require(_0x44bf('0x4'));var util=require(_0x44bf('0x5'));var path=require(_0x44bf('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44bf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x44bf('0x8'));var crypto=require(_0x44bf('0x9'));var jsforce=require(_0x44bf('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x44bf('0xb'));var querystring=require(_0x44bf('0xc'));var Papa=require(_0x44bf('0xd'));var Redis=require(_0x44bf('0xe'));var authService=require(_0x44bf('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44bf('0x10'));var logger=require(_0x44bf('0x11'))('api');var utils=require(_0x44bf('0x12'));var config=require(_0x44bf('0x13'));var licenseUtil=require(_0x44bf('0x14'));var db=require('../../mysqldb')['db'];config[_0x44bf('0x15')]=_[_0x44bf('0x16')](config[_0x44bf('0x15')],{'host':_0x44bf('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44bf('0x15')]));require(_0x44bf('0x18'))['register'](socket);var jayson=require(_0x44bf('0x19'));var client=jayson[_0x44bf('0x1a')][_0x44bf('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x44bf('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2944fe,_0x3d7e1f,_0x1abc66,_0x56dc52){return new BPromise(function(_0x2e4f52,_0x5b497d){var _0x5a77c5=_0x56dc52||client;return _0x5a77c5[_0x44bf('0x1c')](_0x2944fe,_0x1abc66)[_0x44bf('0x1d')](function(_0x5cfc2d){logger['info']('ChatMessage,\x20%s,\x20%s',_0x3d7e1f,_0x44bf('0x1e'));logger[_0x44bf('0x1f')](_0x44bf('0x20'),_0x3d7e1f,_0x44bf('0x1e'),JSON['stringify'](_0x5cfc2d));if(_0x5cfc2d[_0x44bf('0x21')]){if(_0x5cfc2d[_0x44bf('0x21')][_0x44bf('0x22')]===0x1f4){logger[_0x44bf('0x21')]('ChatMessage,\x20%s,\x20%s',_0x3d7e1f,_0x5cfc2d['error'][_0x44bf('0x23')]);return _0x5b497d(_0x5cfc2d['error'][_0x44bf('0x23')]);}logger[_0x44bf('0x21')](_0x44bf('0x24'),_0x3d7e1f,_0x5cfc2d['error']['message']);return _0x2e4f52(_0x5cfc2d['error']['message']);}else{logger[_0x44bf('0x25')](_0x44bf('0x24'),_0x3d7e1f,_0x44bf('0x1e'));_0x2e4f52(_0x5cfc2d['result']['message']);}})[_0x44bf('0x26')](function(_0x5d4da1){logger[_0x44bf('0x21')](_0x44bf('0x24'),_0x3d7e1f,_0x5d4da1);_0x5b497d(_0x5d4da1);});});}function respondWithStatusCode(_0x1ae596,_0x53bdc7){_0x53bdc7=_0x53bdc7||0xcc;return function(_0x32f7e0){if(_0x32f7e0){return _0x1ae596[_0x44bf('0x27')](_0x53bdc7);}return _0x1ae596[_0x44bf('0x28')](_0x53bdc7)[_0x44bf('0x29')]();};}function respondWithResult(_0x4f2f9e,_0x47c470){_0x47c470=_0x47c470||0xc8;return function(_0x13d346){if(_0x13d346){return _0x4f2f9e['status'](_0x47c470)['json'](_0x13d346);}};}function respondWithFilteredResult(_0x6bff20,_0x25d770){return function(_0xc74f0d){if(_0xc74f0d){var _0x534971=typeof _0x25d770['offset']===_0x44bf('0x2a')&&typeof _0x25d770[_0x44bf('0x2b')]===_0x44bf('0x2a');var _0xa7d722=_0xc74f0d[_0x44bf('0x2c')];var _0x290586=_0x534971?0x0:_0x25d770[_0x44bf('0x2d')];var _0x6e9f23=_0x534971?_0xc74f0d[_0x44bf('0x2c')]:_0x25d770[_0x44bf('0x2d')]+_0x25d770[_0x44bf('0x2b')];var _0x461717;if(_0x6e9f23>=_0xa7d722){_0x6e9f23=_0xa7d722;_0x461717=0xc8;}else{_0x461717=0xce;}_0x6bff20['status'](_0x461717);return _0x6bff20[_0x44bf('0x2e')](_0x44bf('0x2f'),_0x290586+'-'+_0x6e9f23+'/'+_0xa7d722)[_0x44bf('0x30')](_0xc74f0d);}return null;};}function patchUpdates(_0x298487){return function(_0x4fd367){try{jsonpatch[_0x44bf('0x31')](_0x4fd367,_0x298487,!![]);}catch(_0x5802b5){return BPromise['reject'](_0x5802b5);}return _0x4fd367[_0x44bf('0x32')]();};}function saveUpdates(_0x38b337,_0x33c7d2){return function(_0xe78724){if(_0xe78724){return _0xe78724[_0x44bf('0x33')](_0x38b337)['then'](function(_0x942801){return _0x942801;});}return null;};}function removeEntity(_0x223804,_0x241a49){return function(_0x45640e){if(_0x45640e){return _0x45640e[_0x44bf('0x34')]()[_0x44bf('0x1d')](function(){_0x223804['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1620d8,_0x36ffed){return function(_0x18d378){if(!_0x18d378){_0x1620d8['sendStatus'](0x194);}return _0x18d378;};}function handleError(_0x5ef8b9,_0x2661b9){_0x2661b9=_0x2661b9||0x1f4;return function(_0x5f0580){logger[_0x44bf('0x21')](_0x5f0580[_0x44bf('0x35')]);if(_0x5f0580[_0x44bf('0x36')]){delete _0x5f0580[_0x44bf('0x36')];}_0x5ef8b9[_0x44bf('0x28')](_0x2661b9)[_0x44bf('0x37')](_0x5f0580);};}exports[_0x44bf('0x38')]=function(_0x40ae5f,_0x30e92a){var _0x50ee08={},_0xb7e4ac={},_0x3399a1={'count':0x0,'rows':[]};var _0x5ca1ec=_[_0x44bf('0x39')](db[_0x44bf('0x3a')][_0x44bf('0x3b')],function(_0x490b79){return{'name':_0x490b79[_0x44bf('0x3c')],'type':_0x490b79[_0x44bf('0x3d')][_0x44bf('0x3e')]};});_0xb7e4ac[_0x44bf('0x3f')]=_['map'](_0x5ca1ec,'name');_0xb7e4ac[_0x44bf('0x40')]=_[_0x44bf('0x41')](_0x40ae5f[_0x44bf('0x40')]);_0xb7e4ac[_0x44bf('0x42')]=_[_0x44bf('0x43')](_0xb7e4ac[_0x44bf('0x3f')],_0xb7e4ac[_0x44bf('0x40')]);_0x50ee08[_0x44bf('0x44')]=_[_0x44bf('0x43')](_0xb7e4ac[_0x44bf('0x3f')],qs[_0x44bf('0x45')](_0x40ae5f[_0x44bf('0x40')][_0x44bf('0x45')]));_0x50ee08['attributes']=_0x50ee08[_0x44bf('0x44')][_0x44bf('0x46')]?_0x50ee08[_0x44bf('0x44')]:_0xb7e4ac['model'];if(!_0x40ae5f[_0x44bf('0x40')]['hasOwnProperty'](_0x44bf('0x47'))){_0x50ee08[_0x44bf('0x2b')]=qs['limit'](_0x40ae5f[_0x44bf('0x40')][_0x44bf('0x2b')]);_0x50ee08[_0x44bf('0x2d')]=qs[_0x44bf('0x2d')](_0x40ae5f[_0x44bf('0x40')][_0x44bf('0x2d')]);}_0x50ee08[_0x44bf('0x48')]=qs[_0x44bf('0x49')](_0x40ae5f[_0x44bf('0x40')][_0x44bf('0x49')]);_0x50ee08[_0x44bf('0x4a')]=qs['filters'](_['pick'](_0x40ae5f['query'],_0xb7e4ac['filters']),_0x5ca1ec);if(_0x40ae5f['query']['filter']){_0x50ee08[_0x44bf('0x4a')]=_[_0x44bf('0x4b')](_0x50ee08['where'],{'$or':_[_0x44bf('0x39')](_0x5ca1ec,function(_0x38389e){if(_0x38389e['type']!==_0x44bf('0x4c')){var _0x11f5e6={};_0x11f5e6[_0x38389e[_0x44bf('0x36')]]={'$like':'%'+_0x40ae5f[_0x44bf('0x40')][_0x44bf('0x4d')]+'%'};return _0x11f5e6;}})});}_0x50ee08=_[_0x44bf('0x4b')]({},_0x50ee08,_0x40ae5f[_0x44bf('0x4e')]);var _0x211760={'where':_0x50ee08['where']};return db[_0x44bf('0x3a')]['count'](_0x211760)['then'](function(_0x56e9f2){_0x3399a1[_0x44bf('0x2c')]=_0x56e9f2;if(_0x40ae5f[_0x44bf('0x40')][_0x44bf('0x4f')]){_0x50ee08[_0x44bf('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x44bf('0x51')](_0x50ee08);})[_0x44bf('0x1d')](function(_0x5a7036){_0x3399a1[_0x44bf('0x52')]=_0x5a7036;return _0x3399a1;})[_0x44bf('0x1d')](respondWithFilteredResult(_0x30e92a,_0x50ee08))[_0x44bf('0x26')](handleError(_0x30e92a,null));};exports[_0x44bf('0x53')]=function(_0x17518a,_0x4eabc8){var _0x56a45e={'raw':!![],'where':{'id':_0x17518a['params']['id']}},_0x17ef40={};_0x17ef40[_0x44bf('0x3f')]=_[_0x44bf('0x41')](db[_0x44bf('0x3a')]['rawAttributes']);_0x17ef40[_0x44bf('0x40')]=_['keys'](_0x17518a[_0x44bf('0x40')]);_0x17ef40[_0x44bf('0x42')]=_['intersection'](_0x17ef40[_0x44bf('0x3f')],_0x17ef40[_0x44bf('0x40')]);_0x56a45e[_0x44bf('0x44')]=_[_0x44bf('0x43')](_0x17ef40[_0x44bf('0x3f')],qs[_0x44bf('0x45')](_0x17518a[_0x44bf('0x40')]['fields']));_0x56a45e['attributes']=_0x56a45e[_0x44bf('0x44')][_0x44bf('0x46')]?_0x56a45e[_0x44bf('0x44')]:_0x17ef40['model'];if(_0x17518a[_0x44bf('0x40')]['includeAll']){_0x56a45e['include']=[{'all':!![]}];}_0x56a45e=_[_0x44bf('0x4b')]({},_0x56a45e,_0x17518a[_0x44bf('0x4e')]);return db[_0x44bf('0x3a')][_0x44bf('0x54')](_0x56a45e)[_0x44bf('0x1d')](handleEntityNotFound(_0x4eabc8,null))[_0x44bf('0x1d')](respondWithResult(_0x4eabc8,null))['catch'](handleError(_0x4eabc8,null));};exports[_0x44bf('0x55')]=function(_0x30e99f,_0x35fe29){return db['ChatMessage'][_0x44bf('0x55')](_0x30e99f['body'],{})[_0x44bf('0x1d')](respondWithResult(_0x35fe29,0xc9))[_0x44bf('0x26')](handleError(_0x35fe29,null));};exports['update']=function(_0x2caeff,_0x1bc5e9){if(_0x2caeff[_0x44bf('0x56')]['id']){delete _0x2caeff['body']['id'];}return db[_0x44bf('0x3a')][_0x44bf('0x54')]({'where':{'id':_0x2caeff[_0x44bf('0x57')]['id']}})[_0x44bf('0x1d')](handleEntityNotFound(_0x1bc5e9,null))['then'](saveUpdates(_0x2caeff[_0x44bf('0x56')],null))[_0x44bf('0x1d')](respondWithResult(_0x1bc5e9,null))[_0x44bf('0x26')](handleError(_0x1bc5e9,null));};exports['destroy']=function(_0x295b8d,_0x58e83c){return db[_0x44bf('0x3a')]['find']({'where':{'id':_0x295b8d['params']['id']}})[_0x44bf('0x1d')](handleEntityNotFound(_0x58e83c,null))[_0x44bf('0x1d')](removeEntity(_0x58e83c,null))[_0x44bf('0x26')](handleError(_0x58e83c,null));};exports['describe']=function(_0x5594b0,_0x56de0c){return db[_0x44bf('0x3a')]['describe']()[_0x44bf('0x1d')](respondWithResult(_0x56de0c,null))[_0x44bf('0x26')](handleError(_0x56de0c,null));};var interaction_log=require('../../config/logger')(_0x44bf('0x58'));exports['accept']=function(_0x30dfed,_0x3ecb02,_0x45634c){var _0x510b9a={'agent':{},'channel':_0x44bf('0x59')};if(_0x30dfed[_0x44bf('0x56')]['id']){delete _0x30dfed[_0x44bf('0x56')]['id'];}_0x30dfed[_0x44bf('0x56')][_0x44bf('0x5a')]=!![];_0x30dfed[_0x44bf('0x56')][_0x44bf('0x5b')]=moment()['format'](_0x44bf('0x5c'));_0x30dfed[_0x44bf('0x56')]['UserId']=_0x30dfed[_0x44bf('0x56')][_0x44bf('0x5d')]||_0x30dfed[_0x44bf('0x5e')]['id'];_0x510b9a['agent']['id']=_0x30dfed['body'][_0x44bf('0x5d')];return db['ChatMessage'][_0x44bf('0x54')]({'where':{'id':_0x30dfed['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ecb02,null))[_0x44bf('0x1d')](saveUpdates(_0x30dfed[_0x44bf('0x56')],null))[_0x44bf('0x1d')](function(_0x2d2b7c){if(_0x2d2b7c){_0x510b9a[_0x44bf('0x23')]=_0x2d2b7c['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x2d2b7c[_0x44bf('0x5f')]}});}return null;})[_0x44bf('0x1d')](handleEntityNotFound(_0x3ecb02,null))[_0x44bf('0x1d')](function(_0x38f1a1){if(_0x38f1a1){return _0x38f1a1['update']({'UserId':_0x30dfed['body'][_0x44bf('0x5d')],'read1stAt':_[_0x44bf('0x60')](_0x38f1a1['read1stAt'])?moment()[_0x44bf('0x61')](_0x44bf('0x5c')):undefined});}return null;})[_0x44bf('0x1d')](function(_0x38e29a){if(_0x38e29a){_0x510b9a[_0x44bf('0x62')]=_0x38e29a['get']({'plain':!![]});interaction_log[_0x44bf('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30dfed[_0x44bf('0x5e')]['id'],_0x30dfed[_0x44bf('0x5e')][_0x44bf('0x36')],_0x30dfed[_0x44bf('0x5e')]['role'],_0x510b9a[_0x44bf('0x62')]['id'],_0x30dfed[_0x44bf('0x56')]?JSON['stringify'](_0x30dfed[_0x44bf('0x56')]):_0x44bf('0x63'));return respondWithRpcPromise(_0x44bf('0x64'),'acceptMessage',_0x510b9a);}return null;})[_0x44bf('0x1d')](function(_0x175c47){var _0x3dd35a=_0x44bf('0x65')+_0x175c47[_0x44bf('0x23')][_0x44bf('0x66')];return db[_0x44bf('0x67')][_0x44bf('0x40')](_0x3dd35a,{'type':db[_0x44bf('0x68')][_0x44bf('0x69')]['SELECT'],'raw':!![]})[_0x44bf('0x1d')](function(_0x4173f6){return _0x4173f6;});})[_0x44bf('0x1d')](function(_0x5ab418){if(_0x5ab418){_0x510b9a[_0x44bf('0x23')][_0x44bf('0x6a')]=_0x5ab418[0x0];if(!_0x30dfed[_0x44bf('0x56')][_0x44bf('0x5d')])return;return db[_0x44bf('0x6b')][_0x44bf('0x54')]({'where':{'id':_0x30dfed[_0x44bf('0x56')][_0x44bf('0x5d')],'role':_0x44bf('0x6c')},'attributes':['id',_0x44bf('0x36'),_0x44bf('0x6d'),'email',_0x44bf('0x6e')],'raw':!![]});}return null;})[_0x44bf('0x1d')](function(_0x1af585){if(!_0x1af585)return null;_0x510b9a[_0x44bf('0x23')][_0x44bf('0x6c')]=_0x1af585;return _0x510b9a;})[_0x44bf('0x1d')](function(_0x18a14c){if(_0x18a14c){if(_0x30dfed[_0x44bf('0x56')][_0x44bf('0x6f')]){_0x510b9a[_0x44bf('0x23')][_0x44bf('0x70')]=util['format'](_0x44bf('0x71'),_0x30dfed[_0x44bf('0x5e')]['name']);_0x510b9a[_0x44bf('0x23')][_0x44bf('0x72')]=_0x510b9a[_0x44bf('0x72')];_0x510b9a['message'][_0x44bf('0x73')]=_0x510b9a['channel'];_0x510b9a[_0x44bf('0x23')][_0x44bf('0x74')]='accept';return respondWithRpcPromise(_0x44bf('0x75'),_0x44bf('0x75'),{'event':_0x44bf('0x76'),'message':_[_0x44bf('0x4b')](_0x510b9a[_0x44bf('0x23')],JSON[_0x44bf('0x77')](_0x510b9a[_0x44bf('0x62')][_0x44bf('0x78')]))},client9002)[_0x44bf('0x1d')](function(){return _0x510b9a;});}return _0x510b9a;}return null;})[_0x44bf('0x1d')](respondWithResult(_0x3ecb02,null))[_0x44bf('0x26')](handleError(_0x3ecb02,null));};var interaction_log=require(_0x44bf('0x11'))(_0x44bf('0x58'));exports['reject']=function(_0x48bd84,_0x3ba45f,_0x1d938d){var _0x17c08c={'agent':{},'channel':_0x44bf('0x59')};if(_0x48bd84[_0x44bf('0x56')]['id']){delete _0x48bd84[_0x44bf('0x56')]['id'];}_0x48bd84['body'][_0x44bf('0x5d')]=_0x48bd84[_0x44bf('0x56')][_0x44bf('0x5d')]||_0x48bd84[_0x44bf('0x5e')]['id'];_0x17c08c[_0x44bf('0x6c')]['id']=_0x48bd84[_0x44bf('0x56')][_0x44bf('0x5d')];return db[_0x44bf('0x3a')][_0x44bf('0x54')]({'where':{'id':_0x48bd84[_0x44bf('0x57')]['id'],'UserId':null}})[_0x44bf('0x1d')](handleEntityNotFound(_0x3ba45f,null))[_0x44bf('0x1d')](function(_0x2a3f94){if(_0x2a3f94){_0x17c08c['message']=_0x2a3f94[_0x44bf('0x79')]({'plain':!![]});return db[_0x44bf('0x7a')]['find']({'where':{'id':_0x2a3f94[_0x44bf('0x5f')]}});}return null;})[_0x44bf('0x1d')](handleEntityNotFound(_0x3ba45f,null))['then'](function(_0x886778){if(_0x886778){_0x17c08c[_0x44bf('0x62')]=_0x886778[_0x44bf('0x79')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48bd84[_0x44bf('0x5e')]['id'],_0x48bd84[_0x44bf('0x5e')][_0x44bf('0x36')],_0x48bd84['user'][_0x44bf('0x7b')],_0x17c08c[_0x44bf('0x62')]['id'],_0x48bd84[_0x44bf('0x56')]?JSON['stringify'](_0x48bd84['body']):_0x44bf('0x63'));return respondWithRpcPromise(_0x44bf('0x7c'),'rejectMessage',_0x17c08c);}return null;})[_0x44bf('0x1d')](function(_0x5c8da7){var _0x560341=_0x44bf('0x65')+_0x5c8da7[_0x44bf('0x23')]['ContactId'];return db[_0x44bf('0x67')][_0x44bf('0x40')](_0x560341,{'type':db[_0x44bf('0x68')]['QueryTypes'][_0x44bf('0x7d')],'raw':!![]})[_0x44bf('0x1d')](function(_0x164e4e){return _0x164e4e;});})[_0x44bf('0x1d')](function(_0x158577){if(_0x158577){_0x17c08c['message'][_0x44bf('0x6a')]=_0x158577[0x0];if(!_0x48bd84[_0x44bf('0x56')][_0x44bf('0x5d')])return;return db[_0x44bf('0x6b')][_0x44bf('0x54')]({'where':{'id':_0x48bd84['body'][_0x44bf('0x5d')],'role':'agent'},'attributes':['id',_0x44bf('0x36'),_0x44bf('0x6d'),'email',_0x44bf('0x6e')],'raw':!![]});}return null;})[_0x44bf('0x1d')](function(_0x2913ca){if(!_0x2913ca)return null;_0x17c08c[_0x44bf('0x23')][_0x44bf('0x6c')]=_0x2913ca;return _0x17c08c;})['then'](function(_0x3450a3){if(_0x3450a3){_0x3450a3[_0x44bf('0x23')][_0x44bf('0x70')]=util['format'](_0x44bf('0x71'),_0x48bd84[_0x44bf('0x5e')][_0x44bf('0x36')]);_0x3450a3['message'][_0x44bf('0x72')]=_0x17c08c['channel'];_0x3450a3[_0x44bf('0x23')][_0x44bf('0x73')]=_0x17c08c['channel'];_0x3450a3[_0x44bf('0x23')][_0x44bf('0x74')]='reject';respondWithRpcPromise(_0x44bf('0x75'),'EventManager',{'event':'rejectmessage','message':_[_0x44bf('0x4b')](_0x17c08c[_0x44bf('0x23')],JSON[_0x44bf('0x77')](_0x17c08c[_0x44bf('0x62')][_0x44bf('0x78')]))},client9002);return _0x17c08c;}return null;})[_0x44bf('0x1d')](respondWithResult(_0x3ba45f,null))[_0x44bf('0x26')](handleError(_0x3ba45f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 727f5f0..c0384a3 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 _0x4f69=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hook'];(function(_0x27650e,_0x278f7a){var _0x28fe08=function(_0x476eee){while(--_0x476eee){_0x27650e['push'](_0x27650e['shift']());}};_0x28fe08(++_0x278f7a);}(_0x4f69,0x91));var _0x94f6=function(_0x3dc85,_0x4f2d39){_0x3dc85=_0x3dc85-0x0;var _0x3e938e=_0x4f69[_0x3dc85];return _0x3e938e;};'use strict';var EventEmitter=require(_0x94f6('0x0'));var ChatMessage=require(_0x94f6('0x1'))['db'][_0x94f6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x94f6('0x3')](0x0);var events={'afterCreate':_0x94f6('0x4'),'afterUpdate':_0x94f6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1277f8){return function(_0x2f96d3,_0x44c6bf,_0x252df9){ChatMessageEvents[_0x94f6('0x6')](_0x1277f8+':'+_0x2f96d3['id'],_0x2f96d3);ChatMessageEvents[_0x94f6('0x6')](_0x1277f8,_0x2f96d3);_0x252df9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x94f6('0x7')](e,emitEvent(event));}}module[_0x94f6('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x3835=['save','update','emit','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x4f68b2,_0x4a69da){var _0x653390=function(_0x3ad880){while(--_0x3ad880){_0x4f68b2['push'](_0x4f68b2['shift']());}};_0x653390(++_0x4a69da);}(_0x3835,0x144));var _0x5383=function(_0x1715a2,_0x13d1d3){_0x1715a2=_0x1715a2-0x0;var _0x447fc1=_0x3835[_0x1715a2];return _0x447fc1;};'use strict';var EventEmitter=require(_0x5383('0x0'));var ChatMessage=require(_0x5383('0x1'))['db'][_0x5383('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5383('0x3')](0x0);var events={'afterCreate':_0x5383('0x4'),'afterUpdate':_0x5383('0x5'),'afterDestroy':'remove'};function emitEvent(_0x185e80){return function(_0x430d49,_0x4ec59b,_0x5bbe49){ChatMessageEvents[_0x5383('0x6')](_0x185e80+':'+_0x430d49['id'],_0x430d49);ChatMessageEvents[_0x5383('0x6')](_0x185e80,_0x430d49);_0x5bbe49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5383('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index d1e586c..5c74b96 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 _0xb15c=['direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb15c,0x15e));var _0xcb15=function(_0x973c93,_0x394bd6){_0x973c93=_0x973c93-0x0;var _0xbadd17=_0xb15c[_0x973c93];return _0xbadd17;};'use strict';var _=require('lodash');var util=require(_0xcb15('0x0'));var logger=require('../../config/logger')(_0xcb15('0x1'));var moment=require(_0xcb15('0x2'));var BPromise=require(_0xcb15('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb15('0x4'));module['exports']=function(_0x2db3a3,_0x33ddc1){return _0x2db3a3[_0xcb15('0x5')](_0xcb15('0x6'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcb15('0x7'),'fields':[_0xcb15('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e226,_0x27bcce,_0x2b696c){var _0x38a96c=_0x2db3a3['models'];var _0x51b482=_0x49e226[_0xcb15('0x9')]({'plain':!![]});if(_0x51b482[_0xcb15('0xa')][_0xcb15('0xb')]()==='in'||_0x51b482[_0xcb15('0xa')]['toLowerCase']()===_0xcb15('0xc')&&!_0x51b482[_0xcb15('0xd')]&&!_['isNil'](_0x51b482[_0xcb15('0xe')])){_0x38a96c[_0xcb15('0xf')]['findOne']({'where':{'id':_0x51b482[_0xcb15('0x10')]}})[_0xcb15('0x11')](function(_0xd2daab){if(_0xd2daab){_0xd2daab[_0xcb15('0x12')]({'lastMsgAt':_0x51b482[_0xcb15('0x13')],'lastMsgDirection':_0x51b482[_0xcb15('0xa')]['toLowerCase']()});}})[_0xcb15('0x14')](function(_0x15ad37){console[_0xcb15('0x15')](_0x15ad37);});}_0x2b696c();}},'charset':_0xcb15('0x16'),'collate':_0xcb15('0x17')});}; \ No newline at end of file +var _0xfb7b=['catch','error','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','toLowerCase','direction','out','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt'];(function(_0xf1a5d8,_0xaa4f2e){var _0xf496f6=function(_0x474772){while(--_0x474772){_0xf1a5d8['push'](_0xf1a5d8['shift']());}};_0xf496f6(++_0xaa4f2e);}(_0xfb7b,0x1c3));var _0xbfb7=function(_0x530ea2,_0x19db07){_0x530ea2=_0x530ea2-0x0;var _0x221ead=_0xfb7b[_0x530ea2];return _0x221ead;};'use strict';var _=require(_0xbfb7('0x0'));var util=require('util');var logger=require(_0xbfb7('0x1'))(_0xbfb7('0x2'));var moment=require('moment');var BPromise=require(_0xbfb7('0x3'));var rp=require(_0xbfb7('0x4'));var fs=require('fs');var path=require(_0xbfb7('0x5'));var rimraf=require(_0xbfb7('0x6'));var config=require(_0xbfb7('0x7'));var attributes=require(_0xbfb7('0x8'));module[_0xbfb7('0x9')]=function(_0x398c78,_0x383b7d){return _0x398c78[_0xbfb7('0xa')](_0xbfb7('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xbfb7('0xc'),'fields':[_0xbfb7('0xd')],'type':_0xbfb7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xee2a84,_0x49cd81,_0x3027c4){var _0x1cf5ee=_0x398c78['models'];var _0x50f36f=_0xee2a84['get']({'plain':!![]});if(_0x50f36f['direction'][_0xbfb7('0xf')]()==='in'||_0x50f36f[_0xbfb7('0x10')][_0xbfb7('0xf')]()===_0xbfb7('0x11')&&!_0x50f36f['secret']&&!_[_0xbfb7('0x12')](_0x50f36f['UserId'])){_0x1cf5ee[_0xbfb7('0x13')][_0xbfb7('0x14')]({'where':{'id':_0x50f36f[_0xbfb7('0x15')]}})[_0xbfb7('0x16')](function(_0x10c1a5){if(_0x10c1a5){_0x10c1a5[_0xbfb7('0x17')]({'lastMsgAt':_0x50f36f[_0xbfb7('0x18')],'lastMsgDirection':_0x50f36f[_0xbfb7('0x10')][_0xbfb7('0xf')]()});}})[_0xbfb7('0x19')](function(_0x5f12bf){console[_0xbfb7('0x1a')](_0x5f12bf);});}_0x3027c4();}},'charset':_0xbfb7('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 4f51240..6fb4d97 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 _0x7344=['localhost','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3f66bb,_0x14961e){var _0x28f493=function(_0x5482a5){while(--_0x5482a5){_0x3f66bb['push'](_0x3f66bb['shift']());}};_0x28f493(++_0x14961e);}(_0x7344,0xbd));var _0x4734=function(_0x45d0ac,_0x2ca746){_0x45d0ac=_0x45d0ac-0x0;var _0x445ee0=_0x7344[_0x45d0ac];return _0x445ee0;};'use strict';var _=require(_0x4734('0x0'));var util=require(_0x4734('0x1'));var moment=require(_0x4734('0x2'));var BPromise=require(_0x4734('0x3'));var rs=require(_0x4734('0x4'));var fs=require('fs');var Redis=require(_0x4734('0x5'));var db=require(_0x4734('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4734('0x7'))(_0x4734('0x8'));var config=require(_0x4734('0x9'));var jayson=require(_0x4734('0xa'));var client=jayson[_0x4734('0xb')][_0x4734('0xc')]({'port':0x232a});config[_0x4734('0xd')]=_[_0x4734('0xe')](config[_0x4734('0xd')],{'host':_0x4734('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4734('0xd')]));require(_0x4734('0x10'))['register'](socket);function respondWithRpcPromise(_0x214341,_0x65d939,_0x3211a3){return new BPromise(function(_0x23d59b,_0x19eff1){return client['request'](_0x214341,_0x3211a3)[_0x4734('0x11')](function(_0x479842){logger['info'](_0x4734('0x12'),_0x65d939,_0x4734('0x13'));logger[_0x4734('0x14')](_0x4734('0x15'),_0x65d939,'request\x20sent',JSON[_0x4734('0x16')](_0x479842));if(_0x479842[_0x4734('0x17')]){if(_0x479842[_0x4734('0x17')][_0x4734('0x18')]===0x1f4){logger['error'](_0x4734('0x12'),_0x65d939,_0x479842[_0x4734('0x17')][_0x4734('0x19')]);return _0x19eff1(_0x479842['error'][_0x4734('0x19')]);}logger[_0x4734('0x17')](_0x4734('0x12'),_0x65d939,_0x479842['error'][_0x4734('0x19')]);return _0x23d59b(_0x479842['error']['message']);}else{logger[_0x4734('0x1a')](_0x4734('0x12'),_0x65d939,'request\x20sent');_0x23d59b(_0x479842['result'][_0x4734('0x19')]);}})[_0x4734('0x1b')](function(_0x3a9b89){logger[_0x4734('0x17')](_0x4734('0x12'),_0x65d939,_0x3a9b89);_0x19eff1(_0x3a9b89);});});}exports[_0x4734('0x1c')]=function(_0x59d61b){var _0x12dbf2=this;return new Promise(function(_0x58a9f9,_0x425f4a){return db[_0x4734('0x1d')][_0x4734('0x1e')](_0x59d61b[_0x4734('0x1f')],{'raw':_0x59d61b[_0x4734('0x20')]?_0x59d61b[_0x4734('0x20')][_0x4734('0x21')]===undefined?!![]:![]:!![]})[_0x4734('0x11')](function(_0x51bebd){logger['info'](_0x4734('0x1c'),_0x59d61b);logger[_0x4734('0x14')](_0x4734('0x1c'),_0x59d61b,JSON[_0x4734('0x16')](_0x51bebd));_0x58a9f9(_0x51bebd);})['catch'](function(_0x5cd07f){logger[_0x4734('0x17')]('CreateChatMessage',_0x5cd07f[_0x4734('0x19')],_0x59d61b);_0x425f4a(_0x12dbf2['error'](0x1f4,_0x5cd07f[_0x4734('0x19')]));});});}; \ No newline at end of file +var _0xfc46=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','create','body','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xdc7042,_0x4d6d08){var _0x1c314e=function(_0x538d19){while(--_0x538d19){_0xdc7042['push'](_0xdc7042['shift']());}};_0x1c314e(++_0x4d6d08);}(_0xfc46,0x9a));var _0x6fc4=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0xfc46[_0x39a2d6];return _0x23af66;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var moment=require(_0x6fc4('0x1'));var BPromise=require(_0x6fc4('0x2'));var rs=require(_0x6fc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fc4('0x4'))['db'];var utils=require(_0x6fc4('0x5'));var logger=require(_0x6fc4('0x6'))(_0x6fc4('0x7'));var config=require('../../config/environment');var jayson=require(_0x6fc4('0x8'));var client=jayson[_0x6fc4('0x9')][_0x6fc4('0xa')]({'port':0x232a});config[_0x6fc4('0xb')]=_[_0x6fc4('0xc')](config[_0x6fc4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fc4('0xd'))(new Redis(config['redis']));require(_0x6fc4('0xe'))[_0x6fc4('0xf')](socket);function respondWithRpcPromise(_0x57dd8c,_0x2c573b,_0x19dc5b){return new BPromise(function(_0x3a8f51,_0x16072b){return client[_0x6fc4('0x10')](_0x57dd8c,_0x19dc5b)[_0x6fc4('0x11')](function(_0x15a009){logger[_0x6fc4('0x12')](_0x6fc4('0x13'),_0x2c573b,_0x6fc4('0x14'));logger[_0x6fc4('0x15')](_0x6fc4('0x16'),_0x2c573b,_0x6fc4('0x14'),JSON[_0x6fc4('0x17')](_0x15a009));if(_0x15a009[_0x6fc4('0x18')]){if(_0x15a009[_0x6fc4('0x18')][_0x6fc4('0x19')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x2c573b,_0x15a009[_0x6fc4('0x18')][_0x6fc4('0x1a')]);return _0x16072b(_0x15a009[_0x6fc4('0x18')][_0x6fc4('0x1a')]);}logger[_0x6fc4('0x18')](_0x6fc4('0x13'),_0x2c573b,_0x15a009[_0x6fc4('0x18')][_0x6fc4('0x1a')]);return _0x3a8f51(_0x15a009[_0x6fc4('0x18')]['message']);}else{logger[_0x6fc4('0x12')](_0x6fc4('0x13'),_0x2c573b,'request\x20sent');_0x3a8f51(_0x15a009['result'][_0x6fc4('0x1a')]);}})[_0x6fc4('0x1b')](function(_0x4f49d1){logger[_0x6fc4('0x18')](_0x6fc4('0x13'),_0x2c573b,_0x4f49d1);_0x16072b(_0x4f49d1);});});}exports[_0x6fc4('0x1c')]=function(_0x4edb51){var _0x176d12=this;return new Promise(function(_0xd2f0e0,_0x3a3842){return db['ChatMessage'][_0x6fc4('0x1d')](_0x4edb51[_0x6fc4('0x1e')],{'raw':_0x4edb51['options']?_0x4edb51['options'][_0x6fc4('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x53e5fb){logger['info'](_0x6fc4('0x1c'),_0x4edb51);logger[_0x6fc4('0x15')](_0x6fc4('0x1c'),_0x4edb51,JSON['stringify'](_0x53e5fb));_0xd2f0e0(_0x53e5fb);})[_0x6fc4('0x1b')](function(_0x38f60c){logger['error'](_0x6fc4('0x1c'),_0x38f60c[_0x6fc4('0x1a')],_0x4edb51);_0x3a3842(_0x176d12[_0x6fc4('0x18')](0x1f4,_0x38f60c[_0x6fc4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 36f10d3..af8dae7 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 _0x919e=['save','remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x2f42f4,_0x5bddce){var _0x3c1c51=function(_0x292f14){while(--_0x292f14){_0x2f42f4['push'](_0x2f42f4['shift']());}};_0x3c1c51(++_0x5bddce);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0x115b01,_0x55cc54){return function(_0x4f9fcd){_0x55cc54[_0xe919('0x3')](_0x115b01,_0x4f9fcd);};}function removeListener(_0x3a1192,_0x2bf552){return function(){ChatMessageEvents[_0xe919('0x4')](_0x3a1192,_0x2bf552);};}exports[_0xe919('0x5')]=function(_0x5a27ad){for(var _0x1225a5=0x0,_0x493b47=events[_0xe919('0x6')];_0x1225a5<_0x493b47;_0x1225a5++){var _0x2ceb41=events[_0x1225a5];var _0x57c3fe=createListener(_0xe919('0x7')+_0x2ceb41,_0x5a27ad);ChatMessageEvents['on'](_0x2ceb41,_0x57c3fe);}}; \ No newline at end of file +var _0xaba6=['emit','removeListener','./chatMessage.events','save'];(function(_0x2ceb8e,_0x19ba8e){var _0xe283bb=function(_0x104094){while(--_0x104094){_0x2ceb8e['push'](_0x2ceb8e['shift']());}};_0xe283bb(++_0x19ba8e);}(_0xaba6,0xe2));var _0x6aba=function(_0x153dba,_0x2fc9d9){_0x153dba=_0x153dba-0x0;var _0x4d3654=_0xaba6[_0x153dba];return _0x4d3654;};'use strict';var ChatMessageEvents=require(_0x6aba('0x0'));var events=[_0x6aba('0x1'),'remove','update'];function createListener(_0x5140ee,_0x596c18){return function(_0x42fd1f){_0x596c18[_0x6aba('0x2')](_0x5140ee,_0x42fd1f);};}function removeListener(_0x58d8a8,_0x1e32a1){return function(){ChatMessageEvents[_0x6aba('0x3')](_0x58d8a8,_0x1e32a1);};}exports['register']=function(_0x4e929a){for(var _0x5ae14c=0x0,_0x39c32a=events['length'];_0x5ae14c<_0x39c32a;_0x5ae14c++){var _0x3766d4=events[_0x5ae14c];var _0x1a4fbc=createListener('chatMessage:'+_0x3766d4,_0x4e929a);ChatMessageEvents['on'](_0x3766d4,_0x1a4fbc);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 5311fd4..fb25d5d 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 _0xef09=['show','post','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xc74264,_0x5a41e9){var _0x238107=function(_0x49ad5c){while(--_0x49ad5c){_0xc74264['push'](_0xc74264['shift']());}};_0x238107(++_0x5a41e9);}(_0xef09,0x11a));var _0x9ef0=function(_0x1962c2,_0x5a098e){_0x1962c2=_0x1962c2-0x0;var _0x50aa8e=_0xef09[_0x1962c2];return _0x50aa8e;};'use strict';var multer=require('multer');var util=require(_0x9ef0('0x0'));var path=require(_0x9ef0('0x1'));var timeout=require(_0x9ef0('0x2'));var express=require(_0x9ef0('0x3'));var router=express[_0x9ef0('0x4')]();var fs_extra=require(_0x9ef0('0x5'));var auth=require(_0x9ef0('0x6'));var interaction=require(_0x9ef0('0x7'));var config=require(_0x9ef0('0x8'));var controller=require('./chatMessage.controller');router[_0x9ef0('0x9')]('/',auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xb')]);router[_0x9ef0('0x9')](_0x9ef0('0xc'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xd')]);router[_0x9ef0('0x9')](_0x9ef0('0xe'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xf')]);router[_0x9ef0('0x10')]('/',auth[_0x9ef0('0xa')](),interaction['tracked'](_0x9ef0('0x11'),_0x9ef0('0x12')),controller[_0x9ef0('0x13')]);router[_0x9ef0('0x14')](_0x9ef0('0xe'),controller['update']);router[_0x9ef0('0x14')](_0x9ef0('0x15'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x16')]);router[_0x9ef0('0x14')](_0x9ef0('0x17'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x18')]);router[_0x9ef0('0x19')](_0x9ef0('0xe'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xaa7d=['create','put','update','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','chat','chatmessage:create'];(function(_0x14bdc6,_0x27db25){var _0x3e187e=function(_0x5c7350){while(--_0x5c7350){_0x14bdc6['push'](_0x14bdc6['shift']());}};_0x3e187e(++_0x27db25);}(_0xaa7d,0x120));var _0xdaa7=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xaa7d[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0xdaa7('0x0'));var util=require(_0xdaa7('0x1'));var path=require(_0xdaa7('0x2'));var timeout=require('connect-timeout');var express=require(_0xdaa7('0x3'));var router=express[_0xdaa7('0x4')]();var fs_extra=require(_0xdaa7('0x5'));var auth=require(_0xdaa7('0x6'));var interaction=require(_0xdaa7('0x7'));var config=require(_0xdaa7('0x8'));var controller=require(_0xdaa7('0x9'));router[_0xdaa7('0xa')]('/',auth['isAuthenticated'](),controller[_0xdaa7('0xb')]);router['get'](_0xdaa7('0xc'),auth[_0xdaa7('0xd')](),controller[_0xdaa7('0xe')]);router[_0xdaa7('0xa')](_0xdaa7('0xf'),auth[_0xdaa7('0xd')](),controller['show']);router[_0xdaa7('0x10')]('/',auth[_0xdaa7('0xd')](),interaction[_0xdaa7('0x11')](_0xdaa7('0x12'),_0xdaa7('0x13')),controller[_0xdaa7('0x14')]);router[_0xdaa7('0x15')]('/:id',controller[_0xdaa7('0x16')]);router[_0xdaa7('0x15')]('/:id/accept',auth[_0xdaa7('0xd')](),controller[_0xdaa7('0x17')]);router[_0xdaa7('0x15')](_0xdaa7('0x18'),auth[_0xdaa7('0xd')](),controller['reject']);router[_0xdaa7('0x19')](_0xdaa7('0xf'),auth['isAuthenticated'](),controller[_0xdaa7('0x1a')]);module[_0xdaa7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 18c8bc2..722e458 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 _0xa65d=['sequelize','TEXT','medium'];(function(_0x3380bc,_0x11e0fb){var _0x540ca2=function(_0x5ef409){while(--_0x5ef409){_0x3380bc['push'](_0x3380bc['shift']());}};_0x540ca2(++_0x11e0fb);}(_0xa65d,0x111));var _0xda65=function(_0x110116,_0x26fcdc){_0x110116=_0x110116-0x0;var _0x579093=_0xa65d[_0x110116];return _0x579093;};'use strict';var Sequelize=require(_0xda65('0x0'));module['exports']={'body':{'type':Sequelize[_0xda65('0x1')](_0xda65('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xd980=['TEXT','medium','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd980,0x8f));var _0x0d98=function(_0x2326a2,_0x53042e){_0x2326a2=_0x2326a2-0x0;var _0x2d960b=_0xd980[_0x2326a2];return _0x2d960b;};'use strict';var Sequelize=require(_0x0d98('0x0'));module['exports']={'body':{'type':Sequelize[_0x0d98('0x1')](_0x0d98('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a479286..58e2741 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x32b568,_0x353b10){_0x32b568=_0x32b568-0x0;var _0x20425d=_0x7a54[_0x32b568];return _0x20425d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7a54,0x106));var _0x47a5=function(_0x2db284,_0x324644){_0x2db284=_0x2db284-0x0;var _0x1bedeb=_0x7a54[_0x2db284];return _0x1bedeb;};'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 d8de5cc..696475d 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 _0x3615=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x53102a,_0x55ecb6){var _0x96f568=function(_0x4d0abe){while(--_0x4d0abe){_0x53102a['push'](_0x53102a['shift']());}};_0x96f568(++_0x55ecb6);}(_0x3615,0x1e0));var _0x5361=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x3615[_0xd09668];return _0x68726;};'use strict';var _=require(_0x5361('0x0'));var util=require(_0x5361('0x1'));var logger=require(_0x5361('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5361('0x3'));var rp=require(_0x5361('0x4'));var fs=require('fs');var path=require(_0x5361('0x5'));var rimraf=require(_0x5361('0x6'));var config=require(_0x5361('0x7'));var attributes=require(_0x5361('0x8'));module[_0x5361('0x9')]=function(_0x170aa3,_0x400914){return _0x170aa3[_0x5361('0xa')](_0x5361('0xb'),attributes,{'tableName':_0x5361('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5361('0xd'),'collate':_0x5361('0xe')});}; \ No newline at end of file +var _0xb0a5=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0a5,0x103));var _0x5b0a=function(_0x49ccaa,_0x5944f2){_0x49ccaa=_0x49ccaa-0x0;var _0x2c1ae1=_0xb0a5[_0x49ccaa];return _0x2c1ae1;};'use strict';var _=require(_0x5b0a('0x0'));var util=require(_0x5b0a('0x1'));var logger=require(_0x5b0a('0x2'))(_0x5b0a('0x3'));var moment=require(_0x5b0a('0x4'));var BPromise=require(_0x5b0a('0x5'));var rp=require(_0x5b0a('0x6'));var fs=require('fs');var path=require(_0x5b0a('0x7'));var rimraf=require(_0x5b0a('0x8'));var config=require('../../config/environment');var attributes=require(_0x5b0a('0x9'));module['exports']=function(_0x395676,_0x39b123){return _0x395676[_0x5b0a('0xa')](_0x5b0a('0xb'),attributes,{'tableName':_0x5b0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b0a('0xd'),'collate':_0x5b0a('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 26728e1..2020208 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 _0xa454=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug'];(function(_0x8924f7,_0x2d690a){var _0x512b8e=function(_0x283696){while(--_0x283696){_0x8924f7['push'](_0x8924f7['shift']());}};_0x512b8e(++_0x2d690a);}(_0xa454,0xa3));var _0x4a45=function(_0x4b4092,_0x378b29){_0x4b4092=_0x4b4092-0x0;var _0xd447f9=_0xa454[_0x4b4092];return _0xd447f9;};'use strict';var _=require(_0x4a45('0x0'));var util=require(_0x4a45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a45('0x2'));var fs=require('fs');var Redis=require(_0x4a45('0x3'));var db=require(_0x4a45('0x4'))['db'];var utils=require(_0x4a45('0x5'));var logger=require('../../config/logger')(_0x4a45('0x6'));var config=require(_0x4a45('0x7'));var jayson=require(_0x4a45('0x8'));var client=jayson[_0x4a45('0x9')][_0x4a45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2635,_0x5ca8c1,_0x518106){return new BPromise(function(_0x1ad34c,_0x3a43fa){return client['request'](_0x4f2635,_0x518106)['then'](function(_0x2ba9e9){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ca8c1,_0x4a45('0xb'));logger[_0x4a45('0xc')](_0x4a45('0xd'),_0x5ca8c1,_0x4a45('0xb'),JSON[_0x4a45('0xe')](_0x2ba9e9));if(_0x2ba9e9[_0x4a45('0xf')]){if(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x10')]===0x1f4){logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);return _0x3a43fa(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);}logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x2ba9e9['error'][_0x4a45('0x12')]);return _0x1ad34c(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);}else{logger[_0x4a45('0x13')](_0x4a45('0x11'),_0x5ca8c1,_0x4a45('0xb'));_0x1ad34c(_0x2ba9e9[_0x4a45('0x14')][_0x4a45('0x12')]);}})[_0x4a45('0x15')](function(_0x4b8932){logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x4b8932);_0x3a43fa(_0x4b8932);});});} \ No newline at end of file +var _0xba54=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x51e1d5,_0x399588){var _0x105666=function(_0x325128){while(--_0x325128){_0x51e1d5['push'](_0x51e1d5['shift']());}};_0x105666(++_0x399588);}(_0xba54,0x176));var _0x4ba5=function(_0x4ae13b,_0x517a31){_0x4ae13b=_0x4ae13b-0x0;var _0x4f733c=_0xba54[_0x4ae13b];return _0x4f733c;};'use strict';var _=require('lodash');var util=require(_0x4ba5('0x0'));var moment=require(_0x4ba5('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ba5('0x2'));var fs=require('fs');var Redis=require(_0x4ba5('0x3'));var db=require(_0x4ba5('0x4'))['db'];var utils=require(_0x4ba5('0x5'));var logger=require(_0x4ba5('0x6'))(_0x4ba5('0x7'));var config=require('../../config/environment');var jayson=require(_0x4ba5('0x8'));var client=jayson[_0x4ba5('0x9')][_0x4ba5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4db699,_0x431c26,_0x11f933){return new BPromise(function(_0x437113,_0x1617f6){return client[_0x4ba5('0xb')](_0x4db699,_0x11f933)[_0x4ba5('0xc')](function(_0x5f07b4){logger[_0x4ba5('0xd')](_0x4ba5('0xe'),_0x431c26,_0x4ba5('0xf'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x431c26,_0x4ba5('0xf'),JSON['stringify'](_0x5f07b4));if(_0x5f07b4['error']){if(_0x5f07b4[_0x4ba5('0x10')][_0x4ba5('0x11')]===0x1f4){logger[_0x4ba5('0x10')](_0x4ba5('0xe'),_0x431c26,_0x5f07b4[_0x4ba5('0x10')]['message']);return _0x1617f6(_0x5f07b4['error']['message']);}logger[_0x4ba5('0x10')](_0x4ba5('0xe'),_0x431c26,_0x5f07b4['error'][_0x4ba5('0x12')]);return _0x437113(_0x5f07b4[_0x4ba5('0x10')][_0x4ba5('0x12')]);}else{logger[_0x4ba5('0xd')](_0x4ba5('0xe'),_0x431c26,_0x4ba5('0xf'));_0x437113(_0x5f07b4['result'][_0x4ba5('0x12')]);}})['catch'](function(_0x5498c8){logger[_0x4ba5('0x10')](_0x4ba5('0xe'),_0x431c26,_0x5498c8);_0x1617f6(_0x5498c8);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b86dc53..e28305d 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 _0x6d3c=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','destroy','exports'];(function(_0x11511e,_0x59e6c1){var _0x441f30=function(_0x335835){while(--_0x335835){_0x11511e['push'](_0x11511e['shift']());}};_0x441f30(++_0x59e6c1);}(_0x6d3c,0x1d4));var _0xc6d3=function(_0x4891d7,_0x2b3472){_0x4891d7=_0x4891d7-0x0;var _0x4bd2a1=_0x6d3c[_0x4891d7];return _0x4bd2a1;};'use strict';var multer=require(_0xc6d3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc6d3('0x1'));var express=require('express');var router=express[_0xc6d3('0x2')]();var fs_extra=require(_0xc6d3('0x3'));var auth=require(_0xc6d3('0x4'));var interaction=require(_0xc6d3('0x5'));var config=require(_0xc6d3('0x6'));var controller=require(_0xc6d3('0x7'));router[_0xc6d3('0x8')]('/',auth[_0xc6d3('0x9')](),controller[_0xc6d3('0xa')]);router[_0xc6d3('0x8')](_0xc6d3('0xb'),auth[_0xc6d3('0x9')](),controller[_0xc6d3('0xc')]);router[_0xc6d3('0x8')](_0xc6d3('0xd'),auth['isAuthenticated'](),controller[_0xc6d3('0xe')]);router[_0xc6d3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc6d3('0xd'),auth[_0xc6d3('0x9')](),controller['update']);router['delete'](_0xc6d3('0xd'),auth[_0xc6d3('0x9')](),controller[_0xc6d3('0x10')]);module[_0xc6d3('0x11')]=router; \ No newline at end of file +var _0x594d=['describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x594d,0x168));var _0xd594=function(_0x428c43,_0x1d9dd3){_0x428c43=_0x428c43-0x0;var _0x2d3674=_0x594d[_0x428c43];return _0x2d3674;};'use strict';var multer=require(_0xd594('0x0'));var util=require(_0xd594('0x1'));var path=require(_0xd594('0x2'));var timeout=require(_0xd594('0x3'));var express=require(_0xd594('0x4'));var router=express[_0xd594('0x5')]();var fs_extra=require(_0xd594('0x6'));var auth=require(_0xd594('0x7'));var interaction=require(_0xd594('0x8'));var config=require('../../config/environment');var controller=require(_0xd594('0x9'));router[_0xd594('0xa')]('/',auth[_0xd594('0xb')](),controller[_0xd594('0xc')]);router[_0xd594('0xa')](_0xd594('0xd'),auth[_0xd594('0xb')](),controller[_0xd594('0xe')]);router['get']('/:id',auth[_0xd594('0xb')](),controller[_0xd594('0xf')]);router[_0xd594('0x10')]('/',auth[_0xd594('0xb')](),controller[_0xd594('0x11')]);router[_0xd594('0x12')](_0xd594('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd594('0x13'),auth[_0xd594('0xb')](),controller[_0xd594('0x14')]);module[_0xd594('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0b52c6f..750aef5 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 _0xcff2=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x529afe,_0x36883a){var _0xf42175=function(_0x3b9a94){while(--_0x3b9a94){_0x529afe['push'](_0x529afe['shift']());}};_0xf42175(++_0x36883a);}(_0xcff2,0x117));var _0x2cff=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xcff2[_0x1406ae];return _0x23a076;};'use strict';var Sequelize=require(_0x2cff('0x0'));module[_0x2cff('0x1')]={'name':{'type':Sequelize[_0x2cff('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2cff('0x3')](_0x2cff('0x4'),_0x2cff('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2cff('0x2')]},'timeout':{'type':Sequelize[_0x2cff('0x6')]}}; \ No newline at end of file +var _0x08e7=['STRING','ENUM','mouseOver','exports'];(function(_0x458295,_0x519262){var _0xf90669=function(_0x2bec05){while(--_0x2bec05){_0x458295['push'](_0x458295['shift']());}};_0xf90669(++_0x519262);}(_0x08e7,0x1d3));var _0x708e=function(_0x388315,_0x16d4f3){_0x388315=_0x388315-0x0;var _0x1538fd=_0x08e7[_0x388315];return _0x1538fd;};'use strict';var Sequelize=require('sequelize');module[_0x708e('0x0')]={'name':{'type':Sequelize[_0x708e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x708e('0x2')](_0x708e('0x3'),'timeout'),'defaultValue':_0x708e('0x3')},'selector':{'type':Sequelize['STRING']},'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 a31ac2d..e9ca2a3 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 _0x56a6=['util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','merge','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x3ee4c6,_0xb63080){var _0x26956d=function(_0x5aac2d){while(--_0x5aac2d){_0x3ee4c6['push'](_0x3ee4c6['shift']());}};_0x26956d(++_0xb63080);}(_0x56a6,0x17b));var _0x656a=function(_0x4895b5,_0x8ac595){_0x4895b5=_0x4895b5-0x0;var _0x1da8da=_0x56a6[_0x4895b5];return _0x1da8da;};'use strict';var emlformat=require(_0x656a('0x0'));var rimraf=require(_0x656a('0x1'));var zipdir=require(_0x656a('0x2'));var jsonpatch=require(_0x656a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x656a('0x4'));var Mustache=require(_0x656a('0x5'));var util=require(_0x656a('0x6'));var path=require('path');var sox=require(_0x656a('0x7'));var csv=require(_0x656a('0x8'));var ejs=require(_0x656a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x656a('0xa'));var squel=require(_0x656a('0xb'));var crypto=require(_0x656a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x656a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x656a('0xe'));var Redis=require(_0x656a('0xf'));var authService=require(_0x656a('0x10'));var qs=require(_0x656a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x656a('0x12'));var logger=require(_0x656a('0x13'))(_0x656a('0x14'));var utils=require(_0x656a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16312b,_0x32a319){_0x32a319=_0x32a319||0xcc;return function(_0x2ab2d7){if(_0x2ab2d7){return _0x16312b[_0x656a('0x16')](_0x32a319);}return _0x16312b[_0x656a('0x17')](_0x32a319)['end']();};}function respondWithResult(_0x30e0ab,_0x2721cd){_0x2721cd=_0x2721cd||0xc8;return function(_0x36b24e){if(_0x36b24e){return _0x30e0ab[_0x656a('0x17')](_0x2721cd)[_0x656a('0x18')](_0x36b24e);}};}function respondWithFilteredResult(_0x29f176,_0x55ed){return function(_0x3c8d71){if(_0x3c8d71){var _0x552b5b=typeof _0x55ed[_0x656a('0x19')]===_0x656a('0x1a')&&typeof _0x55ed[_0x656a('0x1b')]===_0x656a('0x1a');var _0x3bade4=_0x3c8d71[_0x656a('0x1c')];var _0x28cd04=_0x552b5b?0x0:_0x55ed[_0x656a('0x19')];var _0x2f186f=_0x552b5b?_0x3c8d71['count']:_0x55ed[_0x656a('0x19')]+_0x55ed[_0x656a('0x1b')];var _0x36e416;if(_0x2f186f>=_0x3bade4){_0x2f186f=_0x3bade4;_0x36e416=0xc8;}else{_0x36e416=0xce;}_0x29f176[_0x656a('0x17')](_0x36e416);return _0x29f176[_0x656a('0x1d')](_0x656a('0x1e'),_0x28cd04+'-'+_0x2f186f+'/'+_0x3bade4)[_0x656a('0x18')](_0x3c8d71);}return null;};}function patchUpdates(_0x1cecf4){return function(_0x53661e){try{jsonpatch[_0x656a('0x1f')](_0x53661e,_0x1cecf4,!![]);}catch(_0x50be0e){return BPromise['reject'](_0x50be0e);}return _0x53661e['save']();};}function saveUpdates(_0x53c0b6,_0x124f76){return function(_0x404fa6){if(_0x404fa6){return _0x404fa6['update'](_0x53c0b6)[_0x656a('0x20')](function(_0x326a75){return _0x326a75;});}return null;};}function removeEntity(_0x39d148,_0x519ef3){return function(_0x37565e){if(_0x37565e){return _0x37565e[_0x656a('0x21')]()[_0x656a('0x20')](function(){_0x39d148[_0x656a('0x17')](0xcc)[_0x656a('0x22')]();});}};}function handleEntityNotFound(_0xc2860f,_0xa9ec33){return function(_0x15271f){if(!_0x15271f){_0xc2860f['sendStatus'](0x194);}return _0x15271f;};}function handleError(_0x988ef0,_0x4c79cd){_0x4c79cd=_0x4c79cd||0x1f4;return function(_0x223d67){logger['error'](_0x223d67[_0x656a('0x23')]);if(_0x223d67['name']){delete _0x223d67[_0x656a('0x24')];}_0x988ef0['status'](_0x4c79cd)[_0x656a('0x25')](_0x223d67);};}exports['show']=function(_0x55abd2,_0x47bcc0){var _0x2a00ba={'raw':!![],'where':{'id':_0x55abd2[_0x656a('0x26')]['id']}},_0x49a723={};_0x49a723['model']=_[_0x656a('0x27')](db[_0x656a('0x28')][_0x656a('0x29')]);_0x49a723[_0x656a('0x2a')]=_['keys'](_0x55abd2['query']);_0x49a723[_0x656a('0x2b')]=_[_0x656a('0x2c')](_0x49a723['model'],_0x49a723[_0x656a('0x2a')]);_0x2a00ba[_0x656a('0x2d')]=_[_0x656a('0x2c')](_0x49a723[_0x656a('0x2e')],qs['fields'](_0x55abd2['query'][_0x656a('0x2f')]));_0x2a00ba[_0x656a('0x2d')]=_0x2a00ba['attributes']['length']?_0x2a00ba[_0x656a('0x2d')]:_0x49a723[_0x656a('0x2e')];if(_0x55abd2[_0x656a('0x2a')]['includeAll']){_0x2a00ba['include']=[{'all':!![]}];}_0x2a00ba=_[_0x656a('0x30')]({},_0x2a00ba,_0x55abd2[_0x656a('0x31')]);return db[_0x656a('0x28')][_0x656a('0x32')](_0x2a00ba)[_0x656a('0x20')](handleEntityNotFound(_0x47bcc0,null))[_0x656a('0x20')](respondWithResult(_0x47bcc0,null))['catch'](handleError(_0x47bcc0,null));};exports['create']=function(_0x375b4b,_0x401b45){return db['ChatProactiveAction'][_0x656a('0x33')](_0x375b4b[_0x656a('0x34')],{})['then'](respondWithResult(_0x401b45,0xc9))[_0x656a('0x35')](handleError(_0x401b45,null));};exports[_0x656a('0x36')]=function(_0x14d074,_0x37847e){if(_0x14d074[_0x656a('0x34')]['id']){delete _0x14d074[_0x656a('0x34')]['id'];}return db[_0x656a('0x28')][_0x656a('0x32')]({'where':{'id':_0x14d074[_0x656a('0x26')]['id']}})['then'](handleEntityNotFound(_0x37847e,null))['then'](saveUpdates(_0x14d074['body'],null))[_0x656a('0x20')](respondWithResult(_0x37847e,null))['catch'](handleError(_0x37847e,null));};exports[_0x656a('0x21')]=function(_0x3c2481,_0x12b2de){return db[_0x656a('0x28')]['find']({'where':{'id':_0x3c2481[_0x656a('0x26')]['id']}})[_0x656a('0x20')](handleEntityNotFound(_0x12b2de,null))[_0x656a('0x20')](removeEntity(_0x12b2de,null))[_0x656a('0x35')](handleError(_0x12b2de,null));}; \ No newline at end of file +var _0x3e74=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','find','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x3e74,0x175));var _0x43e7=function(_0x122548,_0x4287cd){_0x122548=_0x122548-0x0;var _0x7e9ea6=_0x3e74[_0x122548];return _0x7e9ea6;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={'raw':!![],'where':{'id':_0xb1fc63[_0x43e7('0x27')]['id']}},_0x4690a6={};_0x4690a6[_0x43e7('0x28')]=_[_0x43e7('0x29')](db[_0x43e7('0x2a')][_0x43e7('0x2b')]);_0x4690a6[_0x43e7('0x2c')]=_[_0x43e7('0x29')](_0xb1fc63[_0x43e7('0x2c')]);_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_0x4690a6[_0x43e7('0x28')],_0x4690a6[_0x43e7('0x2c')]);_0x33a1a5['attributes']=_[_0x43e7('0x2e')](_0x4690a6[_0x43e7('0x28')],qs[_0x43e7('0x2f')](_0xb1fc63[_0x43e7('0x2c')][_0x43e7('0x2f')]));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x30')][_0x43e7('0x31')]?_0x33a1a5[_0x43e7('0x30')]:_0x4690a6[_0x43e7('0x28')];if(_0xb1fc63['query']['includeAll']){_0x33a1a5['include']=[{'all':!![]}];}_0x33a1a5=_[_0x43e7('0x32')]({},_0x33a1a5,_0xb1fc63[_0x43e7('0x33')]);return db[_0x43e7('0x2a')][_0x43e7('0x34')](_0x33a1a5)[_0x43e7('0x21')](handleEntityNotFound(_0x5087d7,null))[_0x43e7('0x21')](respondWithResult(_0x5087d7,null))['catch'](handleError(_0x5087d7,null));};exports['create']=function(_0x4ac23d,_0x59e5b2){return db['ChatProactiveAction']['create'](_0x4ac23d['body'],{})[_0x43e7('0x21')](respondWithResult(_0x59e5b2,0xc9))['catch'](handleError(_0x59e5b2,null));};exports[_0x43e7('0x20')]=function(_0x8e9f40,_0x31bc78){if(_0x8e9f40[_0x43e7('0x35')]['id']){delete _0x8e9f40[_0x43e7('0x35')]['id'];}return db[_0x43e7('0x2a')][_0x43e7('0x34')]({'where':{'id':_0x8e9f40['params']['id']}})['then'](handleEntityNotFound(_0x31bc78,null))['then'](saveUpdates(_0x8e9f40[_0x43e7('0x35')],null))[_0x43e7('0x21')](respondWithResult(_0x31bc78,null))[_0x43e7('0x36')](handleError(_0x31bc78,null));};exports[_0x43e7('0x22')]=function(_0x1b1440,_0x1ed538){return db[_0x43e7('0x2a')][_0x43e7('0x34')]({'where':{'id':_0x1b1440['params']['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1ed538,null))[_0x43e7('0x21')](removeEntity(_0x1ed538,null))['catch'](handleError(_0x1ed538,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index bb99a64..0bd2571 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 _0x5781=['../../config/logger','moment','bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util'];(function(_0x177b20,_0x4b396d){var _0x53d1e8=function(_0x5f91f2){while(--_0x5f91f2){_0x177b20['push'](_0x177b20['shift']());}};_0x53d1e8(++_0x4b396d);}(_0x5781,0x120));var _0x1578=function(_0xc8a63e,_0x5463f2){_0xc8a63e=_0xc8a63e-0x0;var _0x38f889=_0x5781[_0xc8a63e];return _0x38f889;};'use strict';var _=require(_0x1578('0x0'));var util=require(_0x1578('0x1'));var logger=require(_0x1578('0x2'))('api');var moment=require(_0x1578('0x3'));var BPromise=require(_0x1578('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1578('0x5'));var attributes=require(_0x1578('0x6'));module[_0x1578('0x7')]=function(_0x2bcde7,_0x3baacb){return _0x2bcde7[_0x1578('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x1578('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d0d=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1f069b,_0x4709b5){var _0x1eae54=function(_0x5eabd6){while(--_0x5eabd6){_0x1f069b['push'](_0x1f069b['shift']());}};_0x1eae54(++_0x4709b5);}(_0x0d0d,0x158));var _0xd0d0=function(_0x286114,_0x4bf1ae){_0x286114=_0x286114-0x0;var _0x3496cb=_0x0d0d[_0x286114];return _0x3496cb;};'use strict';var _=require(_0xd0d0('0x0'));var util=require(_0xd0d0('0x1'));var logger=require(_0xd0d0('0x2'))(_0xd0d0('0x3'));var moment=require(_0xd0d0('0x4'));var BPromise=require(_0xd0d0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0d0('0x6'));var rimraf=require(_0xd0d0('0x7'));var config=require(_0xd0d0('0x8'));var attributes=require(_0xd0d0('0x9'));module[_0xd0d0('0xa')]=function(_0x59b44b,_0x4dbd48){return _0x59b44b[_0xd0d0('0xb')](_0xd0d0('0xc'),attributes,{'tableName':_0xd0d0('0xd'),'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 0c0e2c2..428ba4d 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 _0x98bf=['message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x34c300,_0x45abcc){var _0x272bb0=function(_0x5ca010){while(--_0x5ca010){_0x34c300['push'](_0x34c300['shift']());}};_0x272bb0(++_0x45abcc);}(_0x98bf,0x163));var _0xf98b=function(_0x1eead3,_0x18f32b){_0x1eead3=_0x1eead3-0x0;var _0x12a236=_0x98bf[_0x1eead3];return _0x12a236;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf98b('0x0'));var BPromise=require(_0xf98b('0x1'));var rs=require(_0xf98b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf98b('0x3'));var logger=require(_0xf98b('0x4'))(_0xf98b('0x5'));var config=require(_0xf98b('0x6'));var jayson=require(_0xf98b('0x7'));var client=jayson[_0xf98b('0x8')][_0xf98b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d0bf,_0x8f6a93,_0x24bac3){return new BPromise(function(_0x2223d8,_0x362444){return client[_0xf98b('0xa')](_0x10d0bf,_0x24bac3)[_0xf98b('0xb')](function(_0x480cc0){logger[_0xf98b('0xc')](_0xf98b('0xd'),_0x8f6a93,_0xf98b('0xe'));logger[_0xf98b('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x8f6a93,_0xf98b('0xe'),JSON[_0xf98b('0x10')](_0x480cc0));if(_0x480cc0['error']){if(_0x480cc0[_0xf98b('0x11')][_0xf98b('0x12')]===0x1f4){logger[_0xf98b('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f6a93,_0x480cc0[_0xf98b('0x11')][_0xf98b('0x13')]);return _0x362444(_0x480cc0[_0xf98b('0x11')]['message']);}logger[_0xf98b('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f6a93,_0x480cc0['error']['message']);return _0x2223d8(_0x480cc0['error'][_0xf98b('0x13')]);}else{logger['info'](_0xf98b('0xd'),_0x8f6a93,_0xf98b('0xe'));_0x2223d8(_0x480cc0[_0xf98b('0x14')][_0xf98b('0x13')]);}})[_0xf98b('0x15')](function(_0x9253a9){logger[_0xf98b('0x11')](_0xf98b('0xd'),_0x8f6a93,_0x9253a9);_0x362444(_0x9253a9);});});} \ No newline at end of file +var _0x3187=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1445ff,_0x3edc98){var _0x2c2eb1=function(_0x152a04){while(--_0x152a04){_0x1445ff['push'](_0x1445ff['shift']());}};_0x2c2eb1(++_0x3edc98);}(_0x3187,0x1bf));var _0x7318=function(_0x10a872,_0x1f4ebd){_0x10a872=_0x10a872-0x0;var _0x52a39f=_0x3187[_0x10a872];return _0x52a39f;};'use strict';var _=require(_0x7318('0x0'));var util=require('util');var moment=require(_0x7318('0x1'));var BPromise=require(_0x7318('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7318('0x3'));var db=require(_0x7318('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7318('0x5'))('rpc');var config=require(_0x7318('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7318('0x7')][_0x7318('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x225f69,_0x91ea41,_0x4c0391){return new BPromise(function(_0x5ecd68,_0x3eac14){return client[_0x7318('0x9')](_0x225f69,_0x4c0391)[_0x7318('0xa')](function(_0x47b603){logger[_0x7318('0xb')](_0x7318('0xc'),_0x91ea41,_0x7318('0xd'));logger[_0x7318('0xe')](_0x7318('0xf'),_0x91ea41,'request\x20sent',JSON[_0x7318('0x10')](_0x47b603));if(_0x47b603[_0x7318('0x11')]){if(_0x47b603['error'][_0x7318('0x12')]===0x1f4){logger[_0x7318('0x11')](_0x7318('0xc'),_0x91ea41,_0x47b603['error'][_0x7318('0x13')]);return _0x3eac14(_0x47b603[_0x7318('0x11')]['message']);}logger['error'](_0x7318('0xc'),_0x91ea41,_0x47b603[_0x7318('0x11')][_0x7318('0x13')]);return _0x5ecd68(_0x47b603[_0x7318('0x11')][_0x7318('0x13')]);}else{logger[_0x7318('0xb')](_0x7318('0xc'),_0x91ea41,'request\x20sent');_0x5ecd68(_0x47b603[_0x7318('0x14')][_0x7318('0x13')]);}})[_0x7318('0x15')](function(_0x1838c3){logger[_0x7318('0x11')](_0x7318('0xc'),_0x91ea41,_0x1838c3);_0x3eac14(_0x1838c3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f4e16d1..0bda552 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 _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x49382a,_0x55219c){var _0x25733f=function(_0x5eb8f9){while(--_0x5eb8f9){_0x49382a['push'](_0x49382a['shift']());}};_0x25733f(++_0x55219c);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xf2ca[_0x3f993e];return _0x39c135;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router; \ No newline at end of file +var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0x98a8,0x12c));var _0x898a=function(_0x2452c4,_0xc173ab){_0x2452c4=_0x2452c4-0x0;var _0x38b11d=_0x98a8[_0x2452c4];return _0x38b11d;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7af76cc..99726b5 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 _0xac7a=['sequelize','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xac7a,0x198));var _0xaac7=function(_0x42e350,_0x1c5490){_0x42e350=_0x42e350-0x0;var _0x36cd7b=_0xac7a[_0x42e350];return _0x36cd7b;};'use strict';var Sequelize=require(_0xaac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xaac7('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaac7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaac7('0x3')](_0xaac7('0x4'),'beepall',_0xaac7('0x5'))}}; \ No newline at end of file +var _0x774b=['name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x774b,0x15e));var _0xb774=function(_0x2d31bf,_0x5b6bc0){_0x2d31bf=_0x2d31bf-0x0;var _0x525086=_0x774b[_0x2d31bf];return _0x525086;};'use strict';var Sequelize=require(_0xb774('0x0'));module[_0xb774('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb774('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb774('0x3')]},'timeout':{'type':Sequelize[_0xb774('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb774('0x5')](_0xb774('0x6'),_0xb774('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 3861bbb..0830fac 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 _0x1aa0=['each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','value','transaction','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','findOne','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','register','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','offset','count','limit','set','Content-Range','json','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize'];(function(_0x27ede2,_0x41b067){var _0x4a174d=function(_0x16f954){while(--_0x16f954){_0x27ede2['push'](_0x27ede2['shift']());}};_0x4a174d(++_0x41b067);}(_0x1aa0,0x141));var _0x01aa=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x1aa0[_0x2bc3f4];return _0x14ac53;};'use strict';var emlformat=require(_0x01aa('0x0'));var rimraf=require(_0x01aa('0x1'));var zipdir=require(_0x01aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01aa('0x3'));var BPromise=require(_0x01aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01aa('0x5'));var sox=require(_0x01aa('0x6'));var csv=require(_0x01aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01aa('0x8'));var _=require(_0x01aa('0x9'));var squel=require('squel');var crypto=require(_0x01aa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x01aa('0xb'));var toCsv=require(_0x01aa('0x7'));var querystring=require('querystring');var Papa=require(_0x01aa('0xc'));var Redis=require('ioredis');var authService=require(_0x01aa('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x01aa('0xe'));var hardwareService=require(_0x01aa('0xf'));var logger=require(_0x01aa('0x10'))(_0x01aa('0x11'));var utils=require(_0x01aa('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01aa('0x13'))['db'];config['redis']=_[_0x01aa('0x14')](config['redis'],{'host':_0x01aa('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01aa('0x16')]));require('./chatQueue.socket')[_0x01aa('0x17')](socket);var jayson=require(_0x01aa('0x18'));var client=jayson[_0x01aa('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f091c,_0x116167,_0x4dc23b,_0x18fc88){return new BPromise(function(_0x4d5256,_0x2df5cc){var _0x121bf5=_0x18fc88||client;return _0x121bf5['request'](_0x5f091c,_0x4dc23b)[_0x01aa('0x1a')](function(_0x384b3d){logger[_0x01aa('0x1b')](_0x01aa('0x1c'),_0x116167,_0x01aa('0x1d'));logger['debug'](_0x01aa('0x1e'),_0x116167,'request\x20sent',JSON[_0x01aa('0x1f')](_0x384b3d));if(_0x384b3d[_0x01aa('0x20')]){if(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x21')]===0x1f4){logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);return _0x2df5cc(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);}logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x384b3d['error']['message']);return _0x4d5256(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);}else{logger['info'](_0x01aa('0x1c'),_0x116167,_0x01aa('0x1d'));_0x4d5256(_0x384b3d[_0x01aa('0x23')][_0x01aa('0x22')]);}})['catch'](function(_0x286020){logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x286020);_0x2df5cc(_0x286020);});});}function respondWithStatusCode(_0x522819,_0x4ff459){_0x4ff459=_0x4ff459||0xcc;return function(_0x56f48b){if(_0x56f48b){return _0x522819[_0x01aa('0x24')](_0x4ff459);}return _0x522819['status'](_0x4ff459)[_0x01aa('0x25')]();};}function respondWithResult(_0x170fe3,_0x50a51c){_0x50a51c=_0x50a51c||0xc8;return function(_0x500a0e){if(_0x500a0e){return _0x170fe3[_0x01aa('0x26')](_0x50a51c)['json'](_0x500a0e);}};}function respondWithFilteredResult(_0x4abc2b,_0x255922){return function(_0x437015){if(_0x437015){var _0x161ce1=typeof _0x255922[_0x01aa('0x27')]==='undefined'&&typeof _0x255922['limit']==='undefined';var _0x2606d3=_0x437015[_0x01aa('0x28')];var _0x24611d=_0x161ce1?0x0:_0x255922[_0x01aa('0x27')];var _0x1e01e1=_0x161ce1?_0x437015[_0x01aa('0x28')]:_0x255922[_0x01aa('0x27')]+_0x255922[_0x01aa('0x29')];var _0x268ba7;if(_0x1e01e1>=_0x2606d3){_0x1e01e1=_0x2606d3;_0x268ba7=0xc8;}else{_0x268ba7=0xce;}_0x4abc2b[_0x01aa('0x26')](_0x268ba7);return _0x4abc2b[_0x01aa('0x2a')](_0x01aa('0x2b'),_0x24611d+'-'+_0x1e01e1+'/'+_0x2606d3)[_0x01aa('0x2c')](_0x437015);}return null;};}function patchUpdates(_0x15a0e6){return function(_0x59158e){try{jsonpatch['apply'](_0x59158e,_0x15a0e6,!![]);}catch(_0x4fc34e){return BPromise[_0x01aa('0x2d')](_0x4fc34e);}return _0x59158e[_0x01aa('0x2e')]();};}function saveUpdates(_0xa94747,_0x484cb0){return function(_0x20d46d){if(_0x20d46d){return _0x20d46d['update'](_0xa94747)[_0x01aa('0x1a')](function(_0x22bd21){return _0x22bd21;});}return null;};}function removeEntity(_0x2975e3,_0x5aabfe){return function(_0x24a457){if(_0x24a457){return _0x24a457[_0x01aa('0x2f')]()['then'](function(){var _0x4e55db=_0x24a457[_0x01aa('0x30')]({'plain':!![]});var _0xbf2c83=_0x01aa('0x31');return db[_0x01aa('0x32')][_0x01aa('0x2f')]({'where':{'type':_0xbf2c83,'resourceId':_0x4e55db['id']}})[_0x01aa('0x1a')](function(){return _0x24a457;});})[_0x01aa('0x1a')](function(){_0x2975e3[_0x01aa('0x26')](0xcc)[_0x01aa('0x25')]();});}};}function handleEntityNotFound(_0x314da5,_0x2d1e78){return function(_0x348807){if(!_0x348807){_0x314da5[_0x01aa('0x24')](0x194);}return _0x348807;};}function handleError(_0x566583,_0x53c837){_0x53c837=_0x53c837||0x1f4;return function(_0x52075b){logger[_0x01aa('0x20')](_0x52075b[_0x01aa('0x33')]);if(_0x52075b[_0x01aa('0x34')]){delete _0x52075b['name'];}_0x566583[_0x01aa('0x26')](_0x53c837)[_0x01aa('0x35')](_0x52075b);};}exports[_0x01aa('0x36')]=function(_0x23bd68,_0x29412c){var _0x1be690={},_0x389a94={},_0x3f1fcd={'count':0x0,'rows':[]};var _0xf6e691=_[_0x01aa('0x37')](db[_0x01aa('0x38')][_0x01aa('0x39')],function(_0x4994ca){return{'name':_0x4994ca['fieldName'],'type':_0x4994ca[_0x01aa('0x3a')][_0x01aa('0x3b')]};});_0x389a94[_0x01aa('0x3c')]=_[_0x01aa('0x37')](_0xf6e691,'name');_0x389a94[_0x01aa('0x3d')]=_[_0x01aa('0x3e')](_0x23bd68['query']);_0x389a94[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x389a94[_0x01aa('0x3c')],_0x389a94[_0x01aa('0x3d')]);_0x1be690['attributes']=_[_0x01aa('0x40')](_0x389a94[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x1be690['attributes']=_0x1be690[_0x01aa('0x42')][_0x01aa('0x43')]?_0x1be690[_0x01aa('0x42')]:_0x389a94[_0x01aa('0x3c')];if(!_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x1be690[_0x01aa('0x29')]=qs[_0x01aa('0x29')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x1be690[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x27')]);}_0x1be690[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x47')]);_0x1be690[_0x01aa('0x48')]=qs['filters'](_[_0x01aa('0x49')](_0x23bd68[_0x01aa('0x3d')],_0x389a94[_0x01aa('0x3f')]),_0xf6e691);if(_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x1be690[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x1be690[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0xf6e691,function(_0x55c300){if(_0x55c300[_0x01aa('0x3a')]!==_0x01aa('0x4c')){var _0x53e329={};_0x53e329[_0x55c300['name']]={'$like':'%'+_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4a')]+'%'};return _0x53e329;}})});}_0x1be690=_[_0x01aa('0x4b')]({},_0x1be690,_0x23bd68[_0x01aa('0x4d')]);var _0x4eb380={'where':_0x1be690[_0x01aa('0x48')]};return db[_0x01aa('0x38')][_0x01aa('0x28')](_0x4eb380)['then'](function(_0x431fd1){_0x3f1fcd[_0x01aa('0x28')]=_0x431fd1;if(_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4e')]){_0x1be690[_0x01aa('0x4f')]=[{'all':!![]}];}return db[_0x01aa('0x38')][_0x01aa('0x50')](_0x1be690);})[_0x01aa('0x1a')](function(_0x16d6e8){_0x3f1fcd[_0x01aa('0x51')]=_0x16d6e8;return _0x3f1fcd;})[_0x01aa('0x1a')](respondWithFilteredResult(_0x29412c,_0x1be690))[_0x01aa('0x52')](handleError(_0x29412c,null));};exports['show']=function(_0x4540a5,_0x1237de){var _0x47634f={'raw':!![],'where':{'id':_0x4540a5['params']['id']}},_0x24a294={};_0x24a294[_0x01aa('0x3c')]=_[_0x01aa('0x3e')](db[_0x01aa('0x38')][_0x01aa('0x39')]);_0x24a294['query']=_[_0x01aa('0x3e')](_0x4540a5[_0x01aa('0x3d')]);_0x24a294[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x24a294[_0x01aa('0x3c')],_0x24a294[_0x01aa('0x3d')]);_0x47634f[_0x01aa('0x42')]=_[_0x01aa('0x40')](_0x24a294[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x4540a5[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x47634f[_0x01aa('0x42')]=_0x47634f[_0x01aa('0x42')][_0x01aa('0x43')]?_0x47634f[_0x01aa('0x42')]:_0x24a294[_0x01aa('0x3c')];if(_0x4540a5[_0x01aa('0x3d')][_0x01aa('0x4e')]){_0x47634f[_0x01aa('0x4f')]=[{'all':!![]}];}_0x47634f=_[_0x01aa('0x4b')]({},_0x47634f,_0x4540a5[_0x01aa('0x4d')]);return db[_0x01aa('0x38')][_0x01aa('0x53')](_0x47634f)[_0x01aa('0x1a')](handleEntityNotFound(_0x1237de,null))['then'](respondWithResult(_0x1237de,null))[_0x01aa('0x52')](handleError(_0x1237de,null));};exports[_0x01aa('0x54')]=function(_0xb12ecd,_0x2ae64e){return db[_0x01aa('0x38')]['create'](_0xb12ecd[_0x01aa('0x55')],{})[_0x01aa('0x1a')](function(_0xa68aa2){var _0x45dd44=_0xb12ecd['user'][_0x01aa('0x30')]({'plain':!![]});if(!_0x45dd44)throw new Error(_0x01aa('0x56'));if(_0x45dd44['role']===_0x01aa('0x57')){var _0x58c0f0=_0xa68aa2[_0x01aa('0x30')]({'plain':!![]});var _0x4875b5=_0x01aa('0x31');return db['UserProfileSection'][_0x01aa('0x53')]({'where':{'name':_0x4875b5,'userProfileId':_0x45dd44['userProfileId']},'raw':!![]})[_0x01aa('0x1a')](function(_0x53f412){if(_0x53f412&&_0x53f412[_0x01aa('0x58')]===0x0){return db[_0x01aa('0x32')]['create']({'name':_0x58c0f0[_0x01aa('0x34')],'resourceId':_0x58c0f0['id'],'type':_0x53f412['name'],'sectionId':_0x53f412['id']},{})['then'](function(){return _0xa68aa2;});}else{return _0xa68aa2;}})[_0x01aa('0x52')](function(_0x15b01e){logger[_0x01aa('0x20')](_0x01aa('0x59'),_0x15b01e);throw _0x15b01e;});}return _0xa68aa2;})[_0x01aa('0x1a')](respondWithResult(_0x2ae64e,0xc9))['catch'](handleError(_0x2ae64e,null));};exports[_0x01aa('0x5a')]=function(_0x5706bc,_0x3bfad4){if(_0x5706bc['body']['id']){delete _0x5706bc[_0x01aa('0x55')]['id'];}return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x5706bc[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3bfad4,null))[_0x01aa('0x1a')](saveUpdates(_0x5706bc[_0x01aa('0x55')],null))['then'](respondWithResult(_0x3bfad4,null))[_0x01aa('0x52')](handleError(_0x3bfad4,null));};exports[_0x01aa('0x2f')]=function(_0x1da9f6,_0x59a992){return db['ChatQueue']['find']({'where':{'id':_0x1da9f6[_0x01aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x59a992,null))[_0x01aa('0x1a')](removeEntity(_0x59a992,null))['catch'](handleError(_0x59a992,null));};exports[_0x01aa('0x5c')]=function(_0x487ce6,_0x10a3a0){return db[_0x01aa('0x38')]['describe']()[_0x01aa('0x1a')](respondWithResult(_0x10a3a0,null))[_0x01aa('0x52')](handleError(_0x10a3a0,null));};exports['getMembers']=function(_0x4cf2d3,_0x413680,_0x784692){var _0x166ff9={'raw':!![],'where':{}},_0x2f74b8={},_0x1c45b7;return db['ChatQueue']['findOne']({'where':{'id':_0x4cf2d3['params']['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x413680,null))[_0x01aa('0x1a')](function(_0x3c0934){if(_0x3c0934){_0x1c45b7=_0x3c0934['get']({'plain':!![]});_0x2f74b8[_0x01aa('0x3c')]=_[_0x01aa('0x3e')](db[_0x01aa('0x5d')]['rawAttributes']);_0x2f74b8[_0x01aa('0x3d')]=_['keys'](_0x4cf2d3[_0x01aa('0x3d')]);_0x2f74b8[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x2f74b8[_0x01aa('0x3c')],_0x2f74b8[_0x01aa('0x3d')]);_0x166ff9[_0x01aa('0x42')]=_[_0x01aa('0x40')](_0x2f74b8[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x166ff9[_0x01aa('0x42')]=_0x166ff9['attributes'][_0x01aa('0x43')]?_0x166ff9[_0x01aa('0x42')]:_0x2f74b8[_0x01aa('0x3c')];if(!_0x4cf2d3[_0x01aa('0x3d')]['hasOwnProperty']('nolimit')){_0x166ff9[_0x01aa('0x29')]=qs['limit'](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x166ff9[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x4cf2d3['query'][_0x01aa('0x27')]);}_0x166ff9[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x47')]);_0x166ff9[_0x01aa('0x48')]=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x4cf2d3[_0x01aa('0x3d')],_0x2f74b8[_0x01aa('0x3f')]));_0x166ff9[_0x01aa('0x48')][_0x01aa('0x5e')]=_0x3c0934['id'];if(_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x166ff9[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x166ff9[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0x166ff9[_0x01aa('0x42')],function(_0x41f337){var _0x59f009={};_0x59f009[_0x41f337]={'$like':'%'+_0x4cf2d3['query'][_0x01aa('0x4a')]+'%'};return _0x59f009;})});}_0x166ff9=_[_0x01aa('0x4b')]({},_0x166ff9,_0x4cf2d3[_0x01aa('0x4d')]);return db[_0x01aa('0x5d')][_0x01aa('0x50')](_0x166ff9);}})[_0x01aa('0x1a')](function(_0x1041df){if(_0x1041df){return db[_0x01aa('0x5f')]['findAndCountAll']({'where':{'id':_[_0x01aa('0x37')](_0x1041df,'UserId'),'role':_0x01aa('0x60')},'attributes':['id','name',_0x01aa('0x61'),_0x01aa('0x62'),'createdAt']});}})['then'](function(_0x4cf2fa){if(_0x4cf2fa){return{'count':_0x4cf2fa[_0x01aa('0x28')],'rows':_[_0x01aa('0x37')](_0x4cf2fa[_0x01aa('0x51')],function(_0x5491ad){return{'membername':_0x5491ad['name'],'UserId':_0x5491ad['id'],'queue_name':_0x1c45b7[_0x01aa('0x34')],'ChatQueueId':_0x1c45b7['id'],'interface':util['format'](_0x01aa('0x63'),_0x01aa('0x64'),_0x5491ad[_0x01aa('0x34')]),'penalty':0x0,'paused':_0x5491ad[_0x01aa('0x61')],'createdAt':_0x5491ad[_0x01aa('0x65')],'updatedAt':_0x5491ad[_0x01aa('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x01aa('0x1a')](respondWithFilteredResult(_0x413680,_0x166ff9))[_0x01aa('0x52')](handleError(_0x413680,null));};exports['getTeams']=function(_0x1ddda5,_0x44a119,_0x19449c){var _0x3e6662={};var _0x28b5fb={};var _0x416834;var _0x3d59b9;return db[_0x01aa('0x38')]['findOne']({'where':{'id':_0x1ddda5[_0x01aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x44a119,null))[_0x01aa('0x1a')](function(_0x288554){if(_0x288554){_0x416834=_0x288554;_0x28b5fb['model']=_[_0x01aa('0x3e')](db[_0x01aa('0x66')][_0x01aa('0x39')]);_0x28b5fb['query']=_[_0x01aa('0x3e')](_0x1ddda5[_0x01aa('0x3d')]);_0x28b5fb['filters']=_[_0x01aa('0x40')](_0x28b5fb['model'],_0x28b5fb[_0x01aa('0x3d')]);_0x3e6662['attributes']=_[_0x01aa('0x40')](_0x28b5fb[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x3e6662[_0x01aa('0x42')]=_0x3e6662['attributes']['length']?_0x3e6662['attributes']:_0x28b5fb[_0x01aa('0x3c')];_0x3e6662[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x1ddda5[_0x01aa('0x3d')]['sort']);_0x3e6662[_0x01aa('0x48')]=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x1ddda5['query'],_0x28b5fb[_0x01aa('0x3f')]));if(_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x3e6662[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x3e6662['where'],{'$or':_[_0x01aa('0x37')](_0x3e6662['attributes'],function(_0x4a62c1){var _0x38635e={};_0x38635e[_0x4a62c1]={'$like':'%'+_0x1ddda5['query'][_0x01aa('0x4a')]+'%'};return _0x38635e;})});}_0x3e6662=_[_0x01aa('0x4b')]({},_0x3e6662,_0x1ddda5[_0x01aa('0x4d')]);return _0x416834[_0x01aa('0x67')](_0x3e6662);}})[_0x01aa('0x1a')](function(_0xd18522){if(_0xd18522){_0x3d59b9=_0xd18522[_0x01aa('0x43')];if(!_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x3e6662[_0x01aa('0x29')]=qs[_0x01aa('0x29')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x3e6662[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x27')]);}return _0x416834[_0x01aa('0x67')](_0x3e6662);}})[_0x01aa('0x1a')](function(_0x34bb05){if(_0x34bb05){return _0x34bb05?{'count':_0x3d59b9,'rows':_0x34bb05}:null;}})[_0x01aa('0x1a')](respondWithResult(_0x44a119,null))[_0x01aa('0x52')](handleError(_0x44a119,null));};exports[_0x01aa('0x68')]=function(_0x363b53,_0x14544d,_0x287ab0){var _0x4705f3=_0x363b53[_0x01aa('0x55')][_0x01aa('0x69')];return db[_0x01aa('0x66')][_0x01aa('0x50')]({'where':{'id':_0x4705f3},'attributes':['id'],'include':[{'model':db[_0x01aa('0x5f')],'as':_0x01aa('0x6a'),'attributes':['id','name','online',_0x01aa('0x6b'),_0x01aa('0x6c')],'raw':!![]}]})[_0x01aa('0x1a')](function(_0x4b0400){if(_0x4b0400){var _0x410c99=_[_0x01aa('0x6d')](_0x4b0400,function(_0x32ff60){var _0xa5f0e0=_0x32ff60[_0x01aa('0x30')]({'plain':!![]});return _0xa5f0e0[_0x01aa('0x6a')];});return db['ChatQueue']['find']({'where':{'id':_0x363b53[_0x01aa('0x5b')]['id']}})['then'](function(_0x4ee739){return db[_0x01aa('0x6e')]['transaction'](function(_0x7a9583){return _0x4ee739['addTeams'](_0x4705f3,{'transaction':_0x7a9583})[_0x01aa('0x1a')](function(){return BPromise[_0x01aa('0x6f')](_0x410c99,function(_0x10b13c){return db['UserChatQueue'][_0x01aa('0x70')]({'where':{'UserId':_0x10b13c['id'],'ChatQueueId':_0x363b53[_0x01aa('0x5b')]['id']},'transaction':_0x7a9583});});})[_0x01aa('0x1a')](function(){_0x410c99[_0x01aa('0x71')](function(_0x4e1c43){socket[_0x01aa('0x72')]('userChatQueue:save',{'UserId':_0x4e1c43['id'],'ChatQueueId':_0x4ee739['id']});});});});});}})[_0x01aa('0x1a')](respondWithStatusCode(_0x14544d,null))[_0x01aa('0x52')](handleError(_0x14544d,null));};exports[_0x01aa('0x73')]=function(_0x4bfcd3,_0x3ea135,_0x2d8c57){return db[_0x01aa('0x66')][_0x01aa('0x50')]({'where':{'id':_0x4bfcd3['query'][_0x01aa('0x69')]},'attributes':['id'],'include':[{'model':db[_0x01aa('0x5f')],'as':_0x01aa('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x01aa('0x1a')](handleEntityNotFound(_0x3ea135,null))[_0x01aa('0x1a')](function(_0x2cdd18){var _0x23cc54=_[_0x01aa('0x37')](_0x2cdd18,'id');var _0x3b66=[];var _0x4b60b8=[];var _0x964d8d=squel[_0x01aa('0x74')]();_0x964d8d[_0x01aa('0x75')](_0x01aa('0x76'))[_0x01aa('0x77')](_0x01aa('0x78'),'tq')[_0x01aa('0x79')](_0x01aa('0x7a'),'ut',_0x01aa('0x7b'))[_0x01aa('0x48')](_0x01aa('0x7c'),_0x4bfcd3[_0x01aa('0x5b')]['id']);for(var _0x5c7d22=0x0;_0x5c7d22<_0x2cdd18[_0x01aa('0x43')];_0x5c7d22+=0x1){let _0xdf8b96=_0x2cdd18[_0x5c7d22];for(var _0x45ea04=0x0;_0x45ea04<_0xdf8b96['Agents'][_0x01aa('0x43')];_0x45ea04+=0x1){let _0x4a1eba=_0xdf8b96[_0x01aa('0x6a')][_0x45ea04];var _0x150d43=_0x964d8d[_0x01aa('0x7d')]();_0x150d43[_0x01aa('0x48')](_0x01aa('0x7e'),_0x4a1eba['id']);_0x4b60b8[_0x01aa('0x7f')](db[_0x01aa('0x6e')][_0x01aa('0x3d')](_0x150d43[_0x01aa('0x80')](),{'type':db[_0x01aa('0x6e')]['QueryTypes'][_0x01aa('0x81')]})[_0x01aa('0x1a')](function(_0x3fb0dd){if(_0x3fb0dd[_0x01aa('0x43')]===0x1){return _0x4a1eba['id'];}else{var _0x485bc3=_['every'](_[_0x01aa('0x37')](_0x3fb0dd,_0x01aa('0x82')),function(_0x2a6ab8){return _['includes'](_0x23cc54,_0x2a6ab8);});if(_0x485bc3){return _0x4a1eba['id'];}}}));}}return BPromise[_0x01aa('0x83')](_0x4b60b8)[_0x01aa('0x1a')](function(_0x1d67a7){_0x3b66=_(_0x3b66)[_0x01aa('0x84')](_0x1d67a7)[_0x01aa('0x85')]()[_0x01aa('0x86')]();return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x4bfcd3['params']['id']}})[_0x01aa('0x1a')](function(_0x17fb27){return db[_0x01aa('0x6e')][_0x01aa('0x87')](function(_0x448d18){return _0x17fb27['removeTeams'](_0x4bfcd3[_0x01aa('0x3d')][_0x01aa('0x69')],{'transaction':_0x448d18})[_0x01aa('0x1a')](function(){if(!_['isEmpty'](_0x3b66)){return _0x17fb27['removeAgents'](_0x3b66,{'transaction':_0x448d18});}})['then'](function(){_0x3b66['forEach'](function(_0x5eb2de){socket['emit']('userChatQueue:remove',{'UserId':_0x5eb2de,'ChatQueueId':_0x17fb27['id']});});});});});});})[_0x01aa('0x1a')](respondWithStatusCode(_0x3ea135,null))[_0x01aa('0x52')](handleError(_0x3ea135,null));};exports[_0x01aa('0x88')]=function(_0x3b3f06,_0x33b3cb,_0x3ca2ea){return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x3b3f06['params']['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x33b3cb,null))[_0x01aa('0x1a')](function(_0x5b6df7){if(_0x5b6df7){return _0x5b6df7[_0x01aa('0x88')](_0x3b3f06[_0x01aa('0x55')]['ids'],_[_0x01aa('0x89')](_0x3b3f06[_0x01aa('0x55')],[_0x01aa('0x69'),'id'])||{})[_0x01aa('0x8a')](function(_0xb62470){for(var _0x5800e0=0x0;_0x5800e0<_0x3b3f06[_0x01aa('0x55')][_0x01aa('0x69')][_0x01aa('0x43')];_0x5800e0+=0x1){socket[_0x01aa('0x72')]('userChatQueue:save',{'UserId':Number(_0x3b3f06[_0x01aa('0x55')][_0x01aa('0x69')][_0x5800e0]),'ChatQueueId':Number(_0x3b3f06[_0x01aa('0x5b')]['id'])});}return _0xb62470;});}})['then'](respondWithResult(_0x33b3cb,null))[_0x01aa('0x52')](handleError(_0x33b3cb,null));};exports[_0x01aa('0x8b')]=function(_0xb48995,_0x3bd998,_0x4f75f0){return db[_0x01aa('0x38')]['find']({'where':{'id':_0xb48995[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3bd998,null))[_0x01aa('0x1a')](function(_0x173c71){if(_0x173c71){return _0x173c71[_0x01aa('0x8b')](_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')])['then'](function(){if(_[_0x01aa('0x8c')](_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')])){for(var _0x5a55ba=0x0;_0x5a55ba<_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')]['length'];_0x5a55ba+=0x1){socket[_0x01aa('0x72')](_0x01aa('0x8d'),{'UserId':Number(_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')][_0x5a55ba]),'ChatQueueId':Number(_0xb48995[_0x01aa('0x5b')]['id'])});}}else{socket[_0x01aa('0x72')](_0x01aa('0x8d'),{'UserId':Number(_0xb48995[_0x01aa('0x3d')]['ids']),'ChatQueueId':Number(_0xb48995[_0x01aa('0x5b')]['id'])});}});}})[_0x01aa('0x1a')](respondWithStatusCode(_0x3bd998,null))[_0x01aa('0x52')](handleError(_0x3bd998,null));};exports['getAgents']=function(_0x51572c,_0x3aa29f,_0x12710f){var _0x1650c8={};var _0x3d5634={};var _0x23abc6;var _0x4484b7;return db[_0x01aa('0x38')][_0x01aa('0x8e')]({'where':{'id':_0x51572c[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3aa29f,null))['then'](function(_0x2b0fe5){if(_0x2b0fe5){_0x23abc6=_0x2b0fe5;_0x3d5634[_0x01aa('0x3c')]=_['keys'](db[_0x01aa('0x5f')][_0x01aa('0x39')]);_0x3d5634['query']=_[_0x01aa('0x3e')](_0x51572c[_0x01aa('0x3d')]);_0x3d5634['filters']=_[_0x01aa('0x40')](_0x3d5634[_0x01aa('0x3c')],_0x3d5634[_0x01aa('0x3d')]);_0x1650c8['attributes']=_[_0x01aa('0x40')](_0x3d5634[_0x01aa('0x3c')],qs['fields'](_0x51572c[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x1650c8['attributes']=_0x1650c8[_0x01aa('0x42')][_0x01aa('0x43')]?_0x1650c8[_0x01aa('0x42')]:_0x3d5634['model'];_0x1650c8[_0x01aa('0x46')]=qs['sort'](_0x51572c['query'][_0x01aa('0x47')]);_0x1650c8['where']=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x51572c[_0x01aa('0x3d')],_0x3d5634[_0x01aa('0x3f')]));if(_0x51572c[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x1650c8[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x1650c8[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0x1650c8['attributes'],function(_0x95893a){var _0x1cbe1f={};_0x1cbe1f[_0x95893a]={'$like':'%'+_0x51572c[_0x01aa('0x3d')][_0x01aa('0x4a')]+'%'};return _0x1cbe1f;})});}_0x1650c8=_['merge']({},_0x1650c8,_0x51572c[_0x01aa('0x4d')]);return _0x23abc6[_0x01aa('0x8f')](_0x1650c8);}})['then'](function(_0x7e781){if(_0x7e781){_0x4484b7=_0x7e781[_0x01aa('0x43')];if(!_0x51572c[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x1650c8['limit']=qs[_0x01aa('0x29')](_0x51572c['query']['limit']);_0x1650c8[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x51572c[_0x01aa('0x3d')][_0x01aa('0x27')]);}return _0x23abc6[_0x01aa('0x8f')](_0x1650c8);}})[_0x01aa('0x1a')](function(_0x62c57b){if(_0x62c57b){return _0x62c57b?{'count':_0x4484b7,'rows':_0x62c57b}:null;}})['then'](respondWithResult(_0x3aa29f,null))[_0x01aa('0x52')](handleError(_0x3aa29f,null));}; \ No newline at end of file +var _0xd488=['removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./chatQueue.socket','register','client','http','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','ChatQueues','end','stack','name','send','index','ChatQueue','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','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','getMembers','findOne','UserChatQueue','ChatQueueId','User','UserId','updatedAt','createdAt','getTeams','Team','pick','map','addTeams','Agents','online','interface','flatMap','transaction','each','forEach','emit','userChatQueue:save','ids','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty'];(function(_0x27b2f6,_0x38347d){var _0xd3d82f=function(_0x463ed6){while(--_0x463ed6){_0x27b2f6['push'](_0x27b2f6['shift']());}};_0xd3d82f(++_0x38347d);}(_0xd488,0x9d));var _0x8d48=function(_0x332edd,_0x30528b){_0x332edd=_0x332edd-0x0;var _0x310417=_0xd488[_0x332edd];return _0x310417;};'use strict';var emlformat=require(_0x8d48('0x0'));var rimraf=require(_0x8d48('0x1'));var zipdir=require(_0x8d48('0x2'));var jsonpatch=require(_0x8d48('0x3'));var rp=require(_0x8d48('0x4'));var moment=require('moment');var BPromise=require(_0x8d48('0x5'));var Mustache=require(_0x8d48('0x6'));var util=require(_0x8d48('0x7'));var path=require(_0x8d48('0x8'));var sox=require(_0x8d48('0x9'));var csv=require(_0x8d48('0xa'));var ejs=require(_0x8d48('0xb'));var fs=require('fs');var fs_extra=require(_0x8d48('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8d48('0xd'));var jsforce=require(_0x8d48('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8d48('0xa'));var querystring=require(_0x8d48('0xf'));var Papa=require(_0x8d48('0x10'));var Redis=require(_0x8d48('0x11'));var authService=require(_0x8d48('0x12'));var qs=require(_0x8d48('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d48('0x14'));var logger=require(_0x8d48('0x15'))(_0x8d48('0x16'));var utils=require(_0x8d48('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8d48('0x18'));var db=require(_0x8d48('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8d48('0x1a'))(new Redis(config[_0x8d48('0x1b')]));require(_0x8d48('0x1c'))[_0x8d48('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8d48('0x1e')][_0x8d48('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x32bb74,_0x4959b3,_0x40baa6,_0x21d1f7){return new BPromise(function(_0x345f8b,_0x1be4af){var _0x303028=_0x21d1f7||client;return _0x303028['request'](_0x32bb74,_0x40baa6)[_0x8d48('0x20')](function(_0x4c0082){logger['info'](_0x8d48('0x21'),_0x4959b3,_0x8d48('0x22'));logger['debug'](_0x8d48('0x23'),_0x4959b3,_0x8d48('0x22'),JSON[_0x8d48('0x24')](_0x4c0082));if(_0x4c0082['error']){if(_0x4c0082[_0x8d48('0x25')][_0x8d48('0x26')]===0x1f4){logger['error'](_0x8d48('0x21'),_0x4959b3,_0x4c0082['error'][_0x8d48('0x27')]);return _0x1be4af(_0x4c0082[_0x8d48('0x25')][_0x8d48('0x27')]);}logger[_0x8d48('0x25')]('ChatQueue,\x20%s,\x20%s',_0x4959b3,_0x4c0082[_0x8d48('0x25')]['message']);return _0x345f8b(_0x4c0082['error'][_0x8d48('0x27')]);}else{logger[_0x8d48('0x28')](_0x8d48('0x21'),_0x4959b3,_0x8d48('0x22'));_0x345f8b(_0x4c0082[_0x8d48('0x29')][_0x8d48('0x27')]);}})[_0x8d48('0x2a')](function(_0x346f3a){logger[_0x8d48('0x25')](_0x8d48('0x21'),_0x4959b3,_0x346f3a);_0x1be4af(_0x346f3a);});});}function respondWithStatusCode(_0x9ecc6d,_0x4383e0){_0x4383e0=_0x4383e0||0xcc;return function(_0x12295f){if(_0x12295f){return _0x9ecc6d[_0x8d48('0x2b')](_0x4383e0);}return _0x9ecc6d[_0x8d48('0x2c')](_0x4383e0)['end']();};}function respondWithResult(_0xbb86d,_0x4ea756){_0x4ea756=_0x4ea756||0xc8;return function(_0x5a9a42){if(_0x5a9a42){return _0xbb86d[_0x8d48('0x2c')](_0x4ea756)['json'](_0x5a9a42);}};}function respondWithFilteredResult(_0x28b2c0,_0x4a63a6){return function(_0x43a9cc){if(_0x43a9cc){var _0x79f8a0=typeof _0x4a63a6['offset']===_0x8d48('0x2d')&&typeof _0x4a63a6[_0x8d48('0x2e')]===_0x8d48('0x2d');var _0x54c80f=_0x43a9cc[_0x8d48('0x2f')];var _0x3a392d=_0x79f8a0?0x0:_0x4a63a6['offset'];var _0x29a66c=_0x79f8a0?_0x43a9cc['count']:_0x4a63a6['offset']+_0x4a63a6[_0x8d48('0x2e')];var _0x16371a;if(_0x29a66c>=_0x54c80f){_0x29a66c=_0x54c80f;_0x16371a=0xc8;}else{_0x16371a=0xce;}_0x28b2c0['status'](_0x16371a);return _0x28b2c0['set'](_0x8d48('0x30'),_0x3a392d+'-'+_0x29a66c+'/'+_0x54c80f)['json'](_0x43a9cc);}return null;};}function patchUpdates(_0x390c7e){return function(_0x24a324){try{jsonpatch[_0x8d48('0x31')](_0x24a324,_0x390c7e,!![]);}catch(_0x216279){return BPromise[_0x8d48('0x32')](_0x216279);}return _0x24a324['save']();};}function saveUpdates(_0x3143c3,_0x3e9177){return function(_0xa874f7){if(_0xa874f7){return _0xa874f7[_0x8d48('0x33')](_0x3143c3)['then'](function(_0x3909da){return _0x3909da;});}return null;};}function removeEntity(_0x81fe4a,_0x1f50bd){return function(_0x2588fc){if(_0x2588fc){return _0x2588fc[_0x8d48('0x34')]()[_0x8d48('0x20')](function(){var _0x4a1f6b=_0x2588fc[_0x8d48('0x35')]({'plain':!![]});var _0xc5108f=_0x8d48('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0xc5108f,'resourceId':_0x4a1f6b['id']}})['then'](function(){return _0x2588fc;});})[_0x8d48('0x20')](function(){_0x81fe4a[_0x8d48('0x2c')](0xcc)[_0x8d48('0x37')]();});}};}function handleEntityNotFound(_0x196329,_0x3db33e){return function(_0x2139de){if(!_0x2139de){_0x196329[_0x8d48('0x2b')](0x194);}return _0x2139de;};}function handleError(_0x46035d,_0x21c843){_0x21c843=_0x21c843||0x1f4;return function(_0x343a35){logger[_0x8d48('0x25')](_0x343a35[_0x8d48('0x38')]);if(_0x343a35['name']){delete _0x343a35[_0x8d48('0x39')];}_0x46035d[_0x8d48('0x2c')](_0x21c843)[_0x8d48('0x3a')](_0x343a35);};}exports[_0x8d48('0x3b')]=function(_0xd277f6,_0x5126c5){var _0x15f500={},_0xe39bfc={},_0x50cbd5={'count':0x0,'rows':[]};var _0x55e480=_['map'](db[_0x8d48('0x3c')][_0x8d48('0x3d')],function(_0x442f70){return{'name':_0x442f70['fieldName'],'type':_0x442f70['type'][_0x8d48('0x3e')]};});_0xe39bfc['model']=_['map'](_0x55e480,_0x8d48('0x39'));_0xe39bfc[_0x8d48('0x3f')]=_[_0x8d48('0x40')](_0xd277f6['query']);_0xe39bfc[_0x8d48('0x41')]=_['intersection'](_0xe39bfc[_0x8d48('0x42')],_0xe39bfc[_0x8d48('0x3f')]);_0x15f500[_0x8d48('0x43')]=_[_0x8d48('0x44')](_0xe39bfc['model'],qs[_0x8d48('0x45')](_0xd277f6[_0x8d48('0x3f')][_0x8d48('0x45')]));_0x15f500['attributes']=_0x15f500[_0x8d48('0x43')][_0x8d48('0x46')]?_0x15f500[_0x8d48('0x43')]:_0xe39bfc['model'];if(!_0xd277f6[_0x8d48('0x3f')][_0x8d48('0x47')](_0x8d48('0x48'))){_0x15f500[_0x8d48('0x2e')]=qs[_0x8d48('0x2e')](_0xd277f6['query'][_0x8d48('0x2e')]);_0x15f500[_0x8d48('0x49')]=qs[_0x8d48('0x49')](_0xd277f6['query'][_0x8d48('0x49')]);}_0x15f500[_0x8d48('0x4a')]=qs[_0x8d48('0x4b')](_0xd277f6[_0x8d48('0x3f')][_0x8d48('0x4b')]);_0x15f500['where']=qs[_0x8d48('0x41')](_['pick'](_0xd277f6[_0x8d48('0x3f')],_0xe39bfc[_0x8d48('0x41')]),_0x55e480);if(_0xd277f6[_0x8d48('0x3f')]['filter']){_0x15f500[_0x8d48('0x4c')]=_[_0x8d48('0x4d')](_0x15f500[_0x8d48('0x4c')],{'$or':_['map'](_0x55e480,function(_0x17da96){if(_0x17da96[_0x8d48('0x4e')]!==_0x8d48('0x4f')){var _0x4f7922={};_0x4f7922[_0x17da96[_0x8d48('0x39')]]={'$like':'%'+_0xd277f6['query'][_0x8d48('0x50')]+'%'};return _0x4f7922;}})});}_0x15f500=_[_0x8d48('0x4d')]({},_0x15f500,_0xd277f6[_0x8d48('0x51')]);var _0x336c62={'where':_0x15f500[_0x8d48('0x4c')]};return db[_0x8d48('0x3c')]['count'](_0x336c62)['then'](function(_0x102a9b){_0x50cbd5[_0x8d48('0x2f')]=_0x102a9b;if(_0xd277f6[_0x8d48('0x3f')]['includeAll']){_0x15f500[_0x8d48('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0x8d48('0x53')](_0x15f500);})[_0x8d48('0x20')](function(_0x217867){_0x50cbd5[_0x8d48('0x54')]=_0x217867;return _0x50cbd5;})[_0x8d48('0x20')](respondWithFilteredResult(_0x5126c5,_0x15f500))['catch'](handleError(_0x5126c5,null));};exports[_0x8d48('0x55')]=function(_0x33adce,_0x44ed3a){var _0x7013c4={'raw':!![],'where':{'id':_0x33adce[_0x8d48('0x56')]['id']}},_0x48c760={};_0x48c760[_0x8d48('0x42')]=_['keys'](db[_0x8d48('0x3c')][_0x8d48('0x3d')]);_0x48c760[_0x8d48('0x3f')]=_['keys'](_0x33adce[_0x8d48('0x3f')]);_0x48c760[_0x8d48('0x41')]=_[_0x8d48('0x44')](_0x48c760[_0x8d48('0x42')],_0x48c760[_0x8d48('0x3f')]);_0x7013c4['attributes']=_[_0x8d48('0x44')](_0x48c760['model'],qs['fields'](_0x33adce[_0x8d48('0x3f')][_0x8d48('0x45')]));_0x7013c4[_0x8d48('0x43')]=_0x7013c4[_0x8d48('0x43')]['length']?_0x7013c4[_0x8d48('0x43')]:_0x48c760['model'];if(_0x33adce[_0x8d48('0x3f')][_0x8d48('0x57')]){_0x7013c4['include']=[{'all':!![]}];}_0x7013c4=_['merge']({},_0x7013c4,_0x33adce['options']);return db[_0x8d48('0x3c')][_0x8d48('0x58')](_0x7013c4)[_0x8d48('0x20')](handleEntityNotFound(_0x44ed3a,null))[_0x8d48('0x20')](respondWithResult(_0x44ed3a,null))['catch'](handleError(_0x44ed3a,null));};exports[_0x8d48('0x59')]=function(_0x1f4c0f,_0x13db10){return db[_0x8d48('0x3c')][_0x8d48('0x59')](_0x1f4c0f[_0x8d48('0x5a')],{})[_0x8d48('0x20')](function(_0x45626e){var _0x23ca7d=_0x1f4c0f[_0x8d48('0x5b')][_0x8d48('0x35')]({'plain':!![]});if(!_0x23ca7d)throw new Error(_0x8d48('0x5c'));if(_0x23ca7d[_0x8d48('0x5d')]===_0x8d48('0x5b')){var _0x295802=_0x45626e[_0x8d48('0x35')]({'plain':!![]});var _0x108050=_0x8d48('0x36');return db[_0x8d48('0x5e')][_0x8d48('0x58')]({'where':{'name':_0x108050,'userProfileId':_0x23ca7d[_0x8d48('0x5f')]},'raw':!![]})['then'](function(_0x4293ae){if(_0x4293ae&&_0x4293ae[_0x8d48('0x60')]===0x0){return db[_0x8d48('0x61')][_0x8d48('0x59')]({'name':_0x295802[_0x8d48('0x39')],'resourceId':_0x295802['id'],'type':_0x4293ae[_0x8d48('0x39')],'sectionId':_0x4293ae['id']},{})['then'](function(){return _0x45626e;});}else{return _0x45626e;}})[_0x8d48('0x2a')](function(_0x57dc25){logger[_0x8d48('0x25')](_0x8d48('0x62'),_0x57dc25);throw _0x57dc25;});}return _0x45626e;})[_0x8d48('0x20')](respondWithResult(_0x13db10,0xc9))[_0x8d48('0x2a')](handleError(_0x13db10,null));};exports[_0x8d48('0x33')]=function(_0xf07e35,_0x2ee9ef){if(_0xf07e35[_0x8d48('0x5a')]['id']){delete _0xf07e35[_0x8d48('0x5a')]['id'];}return db['ChatQueue'][_0x8d48('0x58')]({'where':{'id':_0xf07e35['params']['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x2ee9ef,null))[_0x8d48('0x20')](saveUpdates(_0xf07e35[_0x8d48('0x5a')],null))[_0x8d48('0x20')](respondWithResult(_0x2ee9ef,null))[_0x8d48('0x2a')](handleError(_0x2ee9ef,null));};exports[_0x8d48('0x34')]=function(_0x2b033a,_0x390b3a){return db[_0x8d48('0x3c')]['find']({'where':{'id':_0x2b033a[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x390b3a,null))[_0x8d48('0x20')](removeEntity(_0x390b3a,null))[_0x8d48('0x2a')](handleError(_0x390b3a,null));};exports[_0x8d48('0x63')]=function(_0x4cb962,_0xe2167a){return db['ChatQueue'][_0x8d48('0x63')]()['then'](respondWithResult(_0xe2167a,null))[_0x8d48('0x2a')](handleError(_0xe2167a,null));};exports[_0x8d48('0x64')]=function(_0x19a534,_0x6eee28,_0x426cd5){var _0x27caef={'raw':!![],'where':{}},_0x5aa5d8={},_0x26ce51;return db[_0x8d48('0x3c')][_0x8d48('0x65')]({'where':{'id':_0x19a534[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x6eee28,null))[_0x8d48('0x20')](function(_0x1f31cc){if(_0x1f31cc){_0x26ce51=_0x1f31cc[_0x8d48('0x35')]({'plain':!![]});_0x5aa5d8[_0x8d48('0x42')]=_[_0x8d48('0x40')](db[_0x8d48('0x66')]['rawAttributes']);_0x5aa5d8[_0x8d48('0x3f')]=_[_0x8d48('0x40')](_0x19a534[_0x8d48('0x3f')]);_0x5aa5d8['filters']=_[_0x8d48('0x44')](_0x5aa5d8[_0x8d48('0x42')],_0x5aa5d8[_0x8d48('0x3f')]);_0x27caef[_0x8d48('0x43')]=_['intersection'](_0x5aa5d8['model'],qs[_0x8d48('0x45')](_0x19a534[_0x8d48('0x3f')][_0x8d48('0x45')]));_0x27caef[_0x8d48('0x43')]=_0x27caef['attributes']['length']?_0x27caef[_0x8d48('0x43')]:_0x5aa5d8[_0x8d48('0x42')];if(!_0x19a534[_0x8d48('0x3f')][_0x8d48('0x47')](_0x8d48('0x48'))){_0x27caef['limit']=qs[_0x8d48('0x2e')](_0x19a534[_0x8d48('0x3f')][_0x8d48('0x2e')]);_0x27caef[_0x8d48('0x49')]=qs['offset'](_0x19a534[_0x8d48('0x3f')][_0x8d48('0x49')]);}_0x27caef[_0x8d48('0x4a')]=qs['sort'](_0x19a534[_0x8d48('0x3f')][_0x8d48('0x4b')]);_0x27caef['where']=qs['filters'](_['pick'](_0x19a534[_0x8d48('0x3f')],_0x5aa5d8[_0x8d48('0x41')]));_0x27caef['where'][_0x8d48('0x67')]=_0x1f31cc['id'];if(_0x19a534[_0x8d48('0x3f')][_0x8d48('0x50')]){_0x27caef[_0x8d48('0x4c')]=_[_0x8d48('0x4d')](_0x27caef[_0x8d48('0x4c')],{'$or':_['map'](_0x27caef[_0x8d48('0x43')],function(_0x3ead0b){var _0x515ec3={};_0x515ec3[_0x3ead0b]={'$like':'%'+_0x19a534['query'][_0x8d48('0x50')]+'%'};return _0x515ec3;})});}_0x27caef=_[_0x8d48('0x4d')]({},_0x27caef,_0x19a534[_0x8d48('0x51')]);return db[_0x8d48('0x66')][_0x8d48('0x53')](_0x27caef);}})[_0x8d48('0x20')](function(_0x397259){if(_0x397259){return db[_0x8d48('0x68')]['findAndCountAll']({'where':{'id':_['map'](_0x397259,_0x8d48('0x69')),'role':'agent'},'attributes':['id',_0x8d48('0x39'),'chatPause',_0x8d48('0x6a'),_0x8d48('0x6b')]});}})[_0x8d48('0x20')](function(_0x275657){if(_0x275657){return{'count':_0x275657[_0x8d48('0x2f')],'rows':_['map'](_0x275657[_0x8d48('0x54')],function(_0x43fe2d){return{'membername':_0x43fe2d[_0x8d48('0x39')],'UserId':_0x43fe2d['id'],'queue_name':_0x26ce51['name'],'ChatQueueId':_0x26ce51['id'],'interface':util['format']('%s/%s','SIP',_0x43fe2d[_0x8d48('0x39')]),'penalty':0x0,'paused':_0x43fe2d['chatPause'],'createdAt':_0x43fe2d['createdAt'],'updatedAt':_0x43fe2d[_0x8d48('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d48('0x20')](respondWithFilteredResult(_0x6eee28,_0x27caef))[_0x8d48('0x2a')](handleError(_0x6eee28,null));};exports[_0x8d48('0x6c')]=function(_0x20e78f,_0x37295c,_0x271e26){var _0x532142={};var _0x3647ce={};var _0x22fad2;var _0x4c5e07;return db[_0x8d48('0x3c')]['findOne']({'where':{'id':_0x20e78f[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x37295c,null))['then'](function(_0x29d9a5){if(_0x29d9a5){_0x22fad2=_0x29d9a5;_0x3647ce[_0x8d48('0x42')]=_[_0x8d48('0x40')](db[_0x8d48('0x6d')][_0x8d48('0x3d')]);_0x3647ce[_0x8d48('0x3f')]=_['keys'](_0x20e78f[_0x8d48('0x3f')]);_0x3647ce[_0x8d48('0x41')]=_['intersection'](_0x3647ce[_0x8d48('0x42')],_0x3647ce[_0x8d48('0x3f')]);_0x532142['attributes']=_['intersection'](_0x3647ce[_0x8d48('0x42')],qs[_0x8d48('0x45')](_0x20e78f[_0x8d48('0x3f')][_0x8d48('0x45')]));_0x532142['attributes']=_0x532142[_0x8d48('0x43')][_0x8d48('0x46')]?_0x532142['attributes']:_0x3647ce['model'];_0x532142[_0x8d48('0x4a')]=qs[_0x8d48('0x4b')](_0x20e78f[_0x8d48('0x3f')]['sort']);_0x532142[_0x8d48('0x4c')]=qs[_0x8d48('0x41')](_[_0x8d48('0x6e')](_0x20e78f[_0x8d48('0x3f')],_0x3647ce[_0x8d48('0x41')]));if(_0x20e78f[_0x8d48('0x3f')][_0x8d48('0x50')]){_0x532142[_0x8d48('0x4c')]=_[_0x8d48('0x4d')](_0x532142[_0x8d48('0x4c')],{'$or':_[_0x8d48('0x6f')](_0x532142['attributes'],function(_0x3fd5ae){var _0x4c80ce={};_0x4c80ce[_0x3fd5ae]={'$like':'%'+_0x20e78f[_0x8d48('0x3f')]['filter']+'%'};return _0x4c80ce;})});}_0x532142=_['merge']({},_0x532142,_0x20e78f[_0x8d48('0x51')]);return _0x22fad2[_0x8d48('0x6c')](_0x532142);}})[_0x8d48('0x20')](function(_0xedf96c){if(_0xedf96c){_0x4c5e07=_0xedf96c[_0x8d48('0x46')];if(!_0x20e78f[_0x8d48('0x3f')]['hasOwnProperty']('nolimit')){_0x532142[_0x8d48('0x2e')]=qs[_0x8d48('0x2e')](_0x20e78f[_0x8d48('0x3f')][_0x8d48('0x2e')]);_0x532142[_0x8d48('0x49')]=qs[_0x8d48('0x49')](_0x20e78f[_0x8d48('0x3f')][_0x8d48('0x49')]);}return _0x22fad2[_0x8d48('0x6c')](_0x532142);}})[_0x8d48('0x20')](function(_0x26d066){if(_0x26d066){return _0x26d066?{'count':_0x4c5e07,'rows':_0x26d066}:null;}})[_0x8d48('0x20')](respondWithResult(_0x37295c,null))[_0x8d48('0x2a')](handleError(_0x37295c,null));};exports[_0x8d48('0x70')]=function(_0x124e87,_0x54ba91,_0xe11b25){var _0x1062fb=_0x124e87[_0x8d48('0x5a')]['ids'];return db[_0x8d48('0x6d')]['findAll']({'where':{'id':_0x1062fb},'attributes':['id'],'include':[{'model':db[_0x8d48('0x68')],'as':_0x8d48('0x71'),'attributes':['id','name',_0x8d48('0x72'),'voicePause',_0x8d48('0x73')],'raw':!![]}]})[_0x8d48('0x20')](function(_0x46885c){if(_0x46885c){var _0x4b6103=_[_0x8d48('0x74')](_0x46885c,function(_0x55189c){var _0x1fb3bd=_0x55189c[_0x8d48('0x35')]({'plain':!![]});return _0x1fb3bd[_0x8d48('0x71')];});return db['ChatQueue'][_0x8d48('0x58')]({'where':{'id':_0x124e87['params']['id']}})[_0x8d48('0x20')](function(_0x106044){return db['sequelize'][_0x8d48('0x75')](function(_0x404489){return _0x106044[_0x8d48('0x70')](_0x1062fb,{'transaction':_0x404489})['then'](function(){return BPromise[_0x8d48('0x76')](_0x4b6103,function(_0x57c032){return db[_0x8d48('0x66')]['findOrCreate']({'where':{'UserId':_0x57c032['id'],'ChatQueueId':_0x124e87['params']['id']},'transaction':_0x404489});});})[_0x8d48('0x20')](function(){_0x4b6103[_0x8d48('0x77')](function(_0x475cc2){socket[_0x8d48('0x78')](_0x8d48('0x79'),{'UserId':_0x475cc2['id'],'ChatQueueId':_0x106044['id']});});});});});}})[_0x8d48('0x20')](respondWithStatusCode(_0x54ba91,null))[_0x8d48('0x2a')](handleError(_0x54ba91,null));};exports['removeTeams']=function(_0x4d675a,_0x46a49f,_0x3f332b){return db[_0x8d48('0x6d')]['findAll']({'where':{'id':_0x4d675a['query'][_0x8d48('0x7a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8d48('0x71'),'attributes':['id'],'raw':!![]}]})[_0x8d48('0x20')](handleEntityNotFound(_0x46a49f,null))[_0x8d48('0x20')](function(_0x16e5c8){var _0x130753=_[_0x8d48('0x6f')](_0x16e5c8,'id');var _0x44d2c3=[];var _0x3743d5=[];var _0x18e946=squel['select']();_0x18e946[_0x8d48('0x7b')](_0x8d48('0x7c'))[_0x8d48('0x7d')]('team_has_chat_queues','tq')[_0x8d48('0x7e')]('user_has_teams','ut',_0x8d48('0x7f'))[_0x8d48('0x4c')](_0x8d48('0x80'),_0x4d675a['params']['id']);for(var _0x4df696=0x0;_0x4df696<_0x16e5c8['length'];_0x4df696+=0x1){let _0x2bfb60=_0x16e5c8[_0x4df696];for(var _0x4de26a=0x0;_0x4de26a<_0x2bfb60['Agents'][_0x8d48('0x46')];_0x4de26a+=0x1){let _0xdec739=_0x2bfb60[_0x8d48('0x71')][_0x4de26a];var _0x34aeb6=_0x18e946['clone']();_0x34aeb6[_0x8d48('0x4c')](_0x8d48('0x81'),_0xdec739['id']);_0x3743d5[_0x8d48('0x82')](db['sequelize'][_0x8d48('0x3f')](_0x34aeb6['toString'](),{'type':db[_0x8d48('0x83')][_0x8d48('0x84')][_0x8d48('0x85')]})[_0x8d48('0x20')](function(_0x5c67ee){if(_0x5c67ee[_0x8d48('0x46')]===0x1){return _0xdec739['id'];}else{var _0x24ef09=_[_0x8d48('0x86')](_[_0x8d48('0x6f')](_0x5c67ee,_0x8d48('0x87')),function(_0x4bd624){return _[_0x8d48('0x88')](_0x130753,_0x4bd624);});if(_0x24ef09){return _0xdec739['id'];}}}));}}return BPromise[_0x8d48('0x89')](_0x3743d5)[_0x8d48('0x20')](function(_0x187334){_0x44d2c3=_(_0x44d2c3)[_0x8d48('0x8a')](_0x187334)[_0x8d48('0x8b')]()[_0x8d48('0x8c')]();return db[_0x8d48('0x3c')][_0x8d48('0x58')]({'where':{'id':_0x4d675a[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](function(_0x1dc4b9){return db[_0x8d48('0x83')][_0x8d48('0x75')](function(_0x5e291f){return _0x1dc4b9[_0x8d48('0x8d')](_0x4d675a['query'][_0x8d48('0x7a')],{'transaction':_0x5e291f})[_0x8d48('0x20')](function(){if(!_[_0x8d48('0x8e')](_0x44d2c3)){return _0x1dc4b9[_0x8d48('0x8f')](_0x44d2c3,{'transaction':_0x5e291f});}})[_0x8d48('0x20')](function(){_0x44d2c3[_0x8d48('0x77')](function(_0x4e8752){socket['emit'](_0x8d48('0x90'),{'UserId':_0x4e8752,'ChatQueueId':_0x1dc4b9['id']});});});});});});})['then'](respondWithStatusCode(_0x46a49f,null))[_0x8d48('0x2a')](handleError(_0x46a49f,null));};exports['addAgents']=function(_0xb70bdd,_0x2004b6,_0x33c7f9){return db[_0x8d48('0x3c')][_0x8d48('0x58')]({'where':{'id':_0xb70bdd[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x2004b6,null))[_0x8d48('0x20')](function(_0x1a1de3){if(_0x1a1de3){return _0x1a1de3[_0x8d48('0x91')](_0xb70bdd[_0x8d48('0x5a')][_0x8d48('0x7a')],_[_0x8d48('0x92')](_0xb70bdd[_0x8d48('0x5a')],[_0x8d48('0x7a'),'id'])||{})[_0x8d48('0x93')](function(_0x217ddf){for(var _0x41d059=0x0;_0x41d059<_0xb70bdd[_0x8d48('0x5a')]['ids']['length'];_0x41d059+=0x1){socket[_0x8d48('0x78')](_0x8d48('0x79'),{'UserId':Number(_0xb70bdd[_0x8d48('0x5a')]['ids'][_0x41d059]),'ChatQueueId':Number(_0xb70bdd['params']['id'])});}return _0x217ddf;});}})[_0x8d48('0x20')](respondWithResult(_0x2004b6,null))[_0x8d48('0x2a')](handleError(_0x2004b6,null));};exports[_0x8d48('0x8f')]=function(_0x352d38,_0x1155bf,_0x23f8d6){return db[_0x8d48('0x3c')][_0x8d48('0x58')]({'where':{'id':_0x352d38[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x1155bf,null))[_0x8d48('0x20')](function(_0x567677){if(_0x567677){return _0x567677[_0x8d48('0x8f')](_0x352d38[_0x8d48('0x3f')]['ids'])['then'](function(){if(_[_0x8d48('0x94')](_0x352d38[_0x8d48('0x3f')][_0x8d48('0x7a')])){for(var _0x4e914f=0x0;_0x4e914f<_0x352d38[_0x8d48('0x3f')]['ids']['length'];_0x4e914f+=0x1){socket[_0x8d48('0x78')]('userChatQueue:remove',{'UserId':Number(_0x352d38[_0x8d48('0x3f')][_0x8d48('0x7a')][_0x4e914f]),'ChatQueueId':Number(_0x352d38[_0x8d48('0x56')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x352d38[_0x8d48('0x3f')][_0x8d48('0x7a')]),'ChatQueueId':Number(_0x352d38[_0x8d48('0x56')]['id'])});}});}})[_0x8d48('0x20')](respondWithStatusCode(_0x1155bf,null))[_0x8d48('0x2a')](handleError(_0x1155bf,null));};exports[_0x8d48('0x95')]=function(_0x221d92,_0x4deff1,_0x4cb2a1){var _0x393bd3={};var _0x433411={};var _0x2ad39a;var _0x23e963;return db[_0x8d48('0x3c')]['findOne']({'where':{'id':_0x221d92[_0x8d48('0x56')]['id']}})[_0x8d48('0x20')](handleEntityNotFound(_0x4deff1,null))[_0x8d48('0x20')](function(_0x4e7357){if(_0x4e7357){_0x2ad39a=_0x4e7357;_0x433411[_0x8d48('0x42')]=_[_0x8d48('0x40')](db[_0x8d48('0x68')][_0x8d48('0x3d')]);_0x433411[_0x8d48('0x3f')]=_[_0x8d48('0x40')](_0x221d92[_0x8d48('0x3f')]);_0x433411[_0x8d48('0x41')]=_[_0x8d48('0x44')](_0x433411[_0x8d48('0x42')],_0x433411[_0x8d48('0x3f')]);_0x393bd3[_0x8d48('0x43')]=_[_0x8d48('0x44')](_0x433411[_0x8d48('0x42')],qs['fields'](_0x221d92[_0x8d48('0x3f')][_0x8d48('0x45')]));_0x393bd3['attributes']=_0x393bd3['attributes'][_0x8d48('0x46')]?_0x393bd3[_0x8d48('0x43')]:_0x433411['model'];_0x393bd3['order']=qs[_0x8d48('0x4b')](_0x221d92[_0x8d48('0x3f')]['sort']);_0x393bd3[_0x8d48('0x4c')]=qs[_0x8d48('0x41')](_[_0x8d48('0x6e')](_0x221d92[_0x8d48('0x3f')],_0x433411[_0x8d48('0x41')]));if(_0x221d92[_0x8d48('0x3f')][_0x8d48('0x50')]){_0x393bd3[_0x8d48('0x4c')]=_[_0x8d48('0x4d')](_0x393bd3[_0x8d48('0x4c')],{'$or':_[_0x8d48('0x6f')](_0x393bd3[_0x8d48('0x43')],function(_0x57aaa9){var _0x2477e5={};_0x2477e5[_0x57aaa9]={'$like':'%'+_0x221d92['query'][_0x8d48('0x50')]+'%'};return _0x2477e5;})});}_0x393bd3=_[_0x8d48('0x4d')]({},_0x393bd3,_0x221d92[_0x8d48('0x51')]);return _0x2ad39a[_0x8d48('0x95')](_0x393bd3);}})[_0x8d48('0x20')](function(_0x167275){if(_0x167275){_0x23e963=_0x167275[_0x8d48('0x46')];if(!_0x221d92[_0x8d48('0x3f')][_0x8d48('0x47')](_0x8d48('0x48'))){_0x393bd3[_0x8d48('0x2e')]=qs[_0x8d48('0x2e')](_0x221d92[_0x8d48('0x3f')][_0x8d48('0x2e')]);_0x393bd3[_0x8d48('0x49')]=qs[_0x8d48('0x49')](_0x221d92[_0x8d48('0x3f')]['offset']);}return _0x2ad39a[_0x8d48('0x95')](_0x393bd3);}})[_0x8d48('0x20')](function(_0x38380f){if(_0x38380f){return _0x38380f?{'count':_0x23e963,'rows':_0x38380f}:null;}})[_0x8d48('0x20')](respondWithResult(_0x4deff1,null))[_0x8d48('0x2a')](handleError(_0x4deff1,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ddcca7e..12e63c2 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 _0x4085=['emit','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0x4085,0x199));var _0x5408=function(_0x18dce0,_0x338691){_0x18dce0=_0x18dce0-0x0;var _0x71da89=_0x4085[_0x18dce0];return _0x71da89;};'use strict';var EventEmitter=require(_0x5408('0x0'));var ChatQueue=require(_0x5408('0x1'))['db'][_0x5408('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5408('0x3')](0x0);var events={'afterCreate':_0x5408('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x444a73){return function(_0x554074,_0x13a8e9,_0x3337ea){ChatQueueEvents[_0x5408('0x5')](_0x444a73+':'+_0x554074['id'],_0x554074);ChatQueueEvents[_0x5408('0x5')](_0x444a73,_0x554074);_0x3337ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xa362=['events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa362,0x183));var _0x2a36=function(_0x36bfc5,_0x1f5802){_0x36bfc5=_0x36bfc5-0x0;var _0x2ca9fa=_0xa362[_0x36bfc5];return _0x2ca9fa;};'use strict';var EventEmitter=require(_0x2a36('0x0'));var ChatQueue=require(_0x2a36('0x1'))['db'][_0x2a36('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2a36('0x3')](0x0);var events={'afterCreate':_0x2a36('0x4'),'afterUpdate':'update','afterDestroy':_0x2a36('0x5')};function emitEvent(_0x3b2a3d){return function(_0x315780,_0x240a4e,_0x34d8ed){ChatQueueEvents[_0x2a36('0x6')](_0x3b2a3d+':'+_0x315780['id'],_0x315780);ChatQueueEvents[_0x2a36('0x6')](_0x3b2a3d,_0x315780);_0x34d8ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x2a36('0x7')](e,emitEvent(event));}}module[_0x2a36('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0b39542..985b334 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 _0x99e6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x35c8f5,_0x399f44){var _0xb5c718=function(_0x50450c){while(--_0x50450c){_0x35c8f5['push'](_0x35c8f5['shift']());}};_0xb5c718(++_0x399f44);}(_0x99e6,0x86));var _0x699e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x99e6[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x699e('0x0'));var util=require(_0x699e('0x1'));var logger=require(_0x699e('0x2'))(_0x699e('0x3'));var moment=require(_0x699e('0x4'));var BPromise=require(_0x699e('0x5'));var rp=require(_0x699e('0x6'));var fs=require('fs');var path=require(_0x699e('0x7'));var rimraf=require(_0x699e('0x8'));var config=require(_0x699e('0x9'));var attributes=require(_0x699e('0xa'));module[_0x699e('0xb')]=function(_0x955609,_0x22dfff){return _0x955609[_0x699e('0xc')](_0x699e('0xd'),attributes,{'tableName':_0x699e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d61=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define','ChatQueue','chat_queues'];(function(_0x531f64,_0x2e179c){var _0x503b4d=function(_0x4fb265){while(--_0x4fb265){_0x531f64['push'](_0x531f64['shift']());}};_0x503b4d(++_0x2e179c);}(_0x2d61,0x6e));var _0x12d6=function(_0x372253,_0x2cdbb3){_0x372253=_0x372253-0x0;var _0x5e0f1d=_0x2d61[_0x372253];return _0x5e0f1d;};'use strict';var _=require(_0x12d6('0x0'));var util=require(_0x12d6('0x1'));var logger=require(_0x12d6('0x2'))('api');var moment=require(_0x12d6('0x3'));var BPromise=require(_0x12d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12d6('0x5'));var rimraf=require(_0x12d6('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x12d6('0x7')]=function(_0x18dce0,_0x398021){return _0x18dce0[_0x12d6('0x8')](_0x12d6('0x9'),attributes,{'tableName':_0x12d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index a7efcf9..c1d4443 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 _0xf29d=['include','map','model','ShowChatQueue','where','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit'];(function(_0x51f3d6,_0x572b62){var _0x2f0dfa=function(_0x102852){while(--_0x102852){_0x51f3d6['push'](_0x51f3d6['shift']());}};_0x2f0dfa(++_0x572b62);}(_0xf29d,0xc4));var _0xdf29=function(_0x1406c3,_0x1390de){_0x1406c3=_0x1406c3-0x0;var _0x3a9f8f=_0xf29d[_0x1406c3];return _0x3a9f8f;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var moment=require('moment');var BPromise=require(_0xdf29('0x2'));var rs=require(_0xdf29('0x3'));var fs=require('fs');var Redis=require(_0xdf29('0x4'));var db=require(_0xdf29('0x5'))['db'];var utils=require(_0xdf29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf29('0x7'));var client=jayson[_0xdf29('0x8')][_0xdf29('0x9')]({'port':0x232a});config['redis']=_[_0xdf29('0xa')](config[_0xdf29('0xb')],{'host':_0xdf29('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf29('0xb')]));require(_0xdf29('0xd'))[_0xdf29('0xe')](socket);function respondWithRpcPromise(_0x298dbb,_0x517d89,_0x5503f0){return new BPromise(function(_0x3e1865,_0x14b4ec){return client['request'](_0x298dbb,_0x5503f0)[_0xdf29('0xf')](function(_0x26b212){logger[_0xdf29('0x10')](_0xdf29('0x11'),_0x517d89,_0xdf29('0x12'));logger['debug'](_0xdf29('0x13'),_0x517d89,'request\x20sent',JSON[_0xdf29('0x14')](_0x26b212));if(_0x26b212[_0xdf29('0x15')]){if(_0x26b212[_0xdf29('0x15')]['code']===0x1f4){logger[_0xdf29('0x15')](_0xdf29('0x11'),_0x517d89,_0x26b212['error'][_0xdf29('0x16')]);return _0x14b4ec(_0x26b212[_0xdf29('0x15')][_0xdf29('0x16')]);}logger['error'](_0xdf29('0x11'),_0x517d89,_0x26b212['error']['message']);return _0x3e1865(_0x26b212[_0xdf29('0x15')][_0xdf29('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x517d89,_0xdf29('0x12'));_0x3e1865(_0x26b212[_0xdf29('0x17')]['message']);}})[_0xdf29('0x18')](function(_0xf56cfa){logger[_0xdf29('0x15')](_0xdf29('0x11'),_0x517d89,_0xf56cfa);_0x14b4ec(_0xf56cfa);});});}exports[_0xdf29('0x19')]=function(_0x407f30){var _0x3cc6d7=this;return new Promise(function(_0x2f1f7d,_0x15501e){return db[_0xdf29('0x1a')][_0xdf29('0x1b')]({'raw':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1d')]===undefined?!![]:![]:!![],'where':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')]['where']||null:null,'attributes':_0x407f30['options']?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1e')]||null:null,'limit':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1f')]||null:null,'include':_0x407f30['options']?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x407f30[_0xdf29('0x1c')]['include'],function(_0x29d3a1){return{'model':db[_0x29d3a1['model']],'as':_0x29d3a1['as'],'attributes':_0x29d3a1['attributes'],'include':_0x29d3a1['include']?_['map'](_0x29d3a1['include'],function(_0x3ba001){return{'model':db[_0x3ba001['model']],'as':_0x3ba001['as'],'attributes':_0x3ba001[_0xdf29('0x1e')],'include':_0x3ba001['include']?_['map'](_0x3ba001['include'],function(_0x3f5a96){return{'model':db[_0x3f5a96[_0xdf29('0x22')]],'as':_0x3f5a96['as'],'attributes':_0x3f5a96[_0xdf29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xf')](function(_0x37ca23){logger[_0xdf29('0x10')]('GetChatQueue',_0x407f30);logger['debug'](_0xdf29('0x19'),_0x407f30,JSON[_0xdf29('0x14')](_0x37ca23));_0x2f1f7d(_0x37ca23);})[_0xdf29('0x18')](function(_0x240777){logger[_0xdf29('0x15')](_0xdf29('0x19'),_0x240777[_0xdf29('0x16')],_0x407f30);_0x15501e(_0x3cc6d7[_0xdf29('0x15')](0x1f4,_0x240777[_0xdf29('0x16')]));});});};exports[_0xdf29('0x23')]=function(_0x1bb3ce){var _0x38ad0d=this;return new Promise(function(_0x15141e,_0x1a4c24){return db[_0xdf29('0x1a')]['find']({'raw':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')][_0xdf29('0x24')]||null:null,'attributes':_0x1bb3ce['options']?_0x1bb3ce[_0xdf29('0x1c')][_0xdf29('0x1e')]||null:null,'include':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')]['include']?_[_0xdf29('0x21')](_0x1bb3ce[_0xdf29('0x1c')]['include'],function(_0x36eac3){return{'model':db[_0x36eac3['model']],'as':_0x36eac3['as'],'attributes':_0x36eac3[_0xdf29('0x1e')],'include':_0x36eac3[_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x36eac3[_0xdf29('0x20')],function(_0x174c9e){return{'model':db[_0x174c9e[_0xdf29('0x22')]],'as':_0x174c9e['as'],'attributes':_0x174c9e[_0xdf29('0x1e')],'include':_0x174c9e[_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x174c9e['include'],function(_0x1868ef){return{'model':db[_0x1868ef[_0xdf29('0x22')]],'as':_0x1868ef['as'],'attributes':_0x1868ef[_0xdf29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xf')](function(_0x1bab4f){logger[_0xdf29('0x10')](_0xdf29('0x23'),_0x1bb3ce);logger[_0xdf29('0x25')]('ShowChatQueue',_0x1bb3ce,JSON['stringify'](_0x1bab4f));_0x15141e(_0x1bab4f);})[_0xdf29('0x18')](function(_0x53e82b){logger[_0xdf29('0x15')](_0xdf29('0x23'),_0x53e82b[_0xdf29('0x16')],_0x1bb3ce);_0x1a4c24(_0x38ad0d[_0xdf29('0x15')](0x1f4,_0x53e82b[_0xdf29('0x16')]));});});}; \ No newline at end of file +var _0x342c=['then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','catch','ShowChatQueue','ChatQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x342c,0x149));var _0xc342=function(_0x19396c,_0x2528a8){_0x19396c=_0x19396c-0x0;var _0x18e2a1=_0x342c[_0x19396c];return _0x18e2a1;};'use strict';var _=require(_0xc342('0x0'));var util=require(_0xc342('0x1'));var moment=require('moment');var BPromise=require(_0xc342('0x2'));var rs=require(_0xc342('0x3'));var fs=require('fs');var Redis=require(_0xc342('0x4'));var db=require(_0xc342('0x5'))['db'];var utils=require(_0xc342('0x6'));var logger=require('../../config/logger')(_0xc342('0x7'));var config=require(_0xc342('0x8'));var jayson=require(_0xc342('0x9'));var client=jayson[_0xc342('0xa')]['http']({'port':0x232a});config[_0xc342('0xb')]=_[_0xc342('0xc')](config['redis'],{'host':_0xc342('0xd'),'port':0x18eb});var socket=require(_0xc342('0xe'))(new Redis(config['redis']));require(_0xc342('0xf'))[_0xc342('0x10')](socket);function respondWithRpcPromise(_0x451ecf,_0x29a751,_0x55a04c){return new BPromise(function(_0x41db94,_0x4228b9){return client[_0xc342('0x11')](_0x451ecf,_0x55a04c)['then'](function(_0x356575){logger[_0xc342('0x12')](_0xc342('0x13'),_0x29a751,_0xc342('0x14'));logger[_0xc342('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29a751,_0xc342('0x14'),JSON[_0xc342('0x16')](_0x356575));if(_0x356575['error']){if(_0x356575[_0xc342('0x17')][_0xc342('0x18')]===0x1f4){logger[_0xc342('0x17')](_0xc342('0x13'),_0x29a751,_0x356575[_0xc342('0x17')][_0xc342('0x19')]);return _0x4228b9(_0x356575[_0xc342('0x17')][_0xc342('0x19')]);}logger['error'](_0xc342('0x13'),_0x29a751,_0x356575[_0xc342('0x17')][_0xc342('0x19')]);return _0x41db94(_0x356575['error'][_0xc342('0x19')]);}else{logger[_0xc342('0x12')](_0xc342('0x13'),_0x29a751,_0xc342('0x14'));_0x41db94(_0x356575[_0xc342('0x1a')][_0xc342('0x19')]);}})['catch'](function(_0x163c01){logger['error'](_0xc342('0x13'),_0x29a751,_0x163c01);_0x4228b9(_0x163c01);});});}exports[_0xc342('0x1b')]=function(_0x4377cb){var _0x24e8c8=this;return new Promise(function(_0xe6b1ed,_0x2e5e59){return db['ChatQueue'][_0xc342('0x1c')]({'raw':_0x4377cb['options']?_0x4377cb['options'][_0xc342('0x1d')]===undefined?!![]:![]:!![],'where':_0x4377cb['options']?_0x4377cb[_0xc342('0x1e')][_0xc342('0x1f')]||null:null,'attributes':_0x4377cb['options']?_0x4377cb[_0xc342('0x1e')][_0xc342('0x20')]||null:null,'limit':_0x4377cb[_0xc342('0x1e')]?_0x4377cb[_0xc342('0x1e')][_0xc342('0x21')]||null:null,'include':_0x4377cb['options']?_0x4377cb[_0xc342('0x1e')][_0xc342('0x22')]?_[_0xc342('0x23')](_0x4377cb[_0xc342('0x1e')]['include'],function(_0x34c7fd){return{'model':db[_0x34c7fd['model']],'as':_0x34c7fd['as'],'attributes':_0x34c7fd['attributes'],'include':_0x34c7fd[_0xc342('0x22')]?_[_0xc342('0x23')](_0x34c7fd[_0xc342('0x22')],function(_0xffe9fd){return{'model':db[_0xffe9fd[_0xc342('0x24')]],'as':_0xffe9fd['as'],'attributes':_0xffe9fd[_0xc342('0x20')],'include':_0xffe9fd[_0xc342('0x22')]?_['map'](_0xffe9fd[_0xc342('0x22')],function(_0x318e6f){return{'model':db[_0x318e6f[_0xc342('0x24')]],'as':_0x318e6f['as'],'attributes':_0x318e6f[_0xc342('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1051aa){logger[_0xc342('0x12')](_0xc342('0x1b'),_0x4377cb);logger[_0xc342('0x15')](_0xc342('0x1b'),_0x4377cb,JSON['stringify'](_0x1051aa));_0xe6b1ed(_0x1051aa);})[_0xc342('0x25')](function(_0x12432e){logger[_0xc342('0x17')](_0xc342('0x1b'),_0x12432e['message'],_0x4377cb);_0x2e5e59(_0x24e8c8[_0xc342('0x17')](0x1f4,_0x12432e[_0xc342('0x19')]));});});};exports[_0xc342('0x26')]=function(_0x509b3b){var _0x4520c3=this;return new Promise(function(_0x3d5da7,_0x2cadd9){return db[_0xc342('0x27')]['find']({'raw':_0x509b3b[_0xc342('0x1e')]?_0x509b3b[_0xc342('0x1e')][_0xc342('0x1d')]===undefined?!![]:![]:!![],'where':_0x509b3b[_0xc342('0x1e')]?_0x509b3b[_0xc342('0x1e')][_0xc342('0x1f')]||null:null,'attributes':_0x509b3b['options']?_0x509b3b[_0xc342('0x1e')][_0xc342('0x20')]||null:null,'include':_0x509b3b[_0xc342('0x1e')]?_0x509b3b[_0xc342('0x1e')][_0xc342('0x22')]?_[_0xc342('0x23')](_0x509b3b[_0xc342('0x1e')][_0xc342('0x22')],function(_0x156956){return{'model':db[_0x156956[_0xc342('0x24')]],'as':_0x156956['as'],'attributes':_0x156956['attributes'],'include':_0x156956[_0xc342('0x22')]?_[_0xc342('0x23')](_0x156956[_0xc342('0x22')],function(_0x182e3a){return{'model':db[_0x182e3a[_0xc342('0x24')]],'as':_0x182e3a['as'],'attributes':_0x182e3a[_0xc342('0x20')],'include':_0x182e3a[_0xc342('0x22')]?_[_0xc342('0x23')](_0x182e3a[_0xc342('0x22')],function(_0x3ae15e){return{'model':db[_0x3ae15e[_0xc342('0x24')]],'as':_0x3ae15e['as'],'attributes':_0x3ae15e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc342('0x28')](function(_0x3c33c4){logger[_0xc342('0x12')](_0xc342('0x26'),_0x509b3b);logger['debug']('ShowChatQueue',_0x509b3b,JSON[_0xc342('0x16')](_0x3c33c4));_0x3d5da7(_0x3c33c4);})[_0xc342('0x25')](function(_0x24b3ae){logger[_0xc342('0x17')](_0xc342('0x26'),_0x24b3ae[_0xc342('0x19')],_0x509b3b);_0x2cadd9(_0x4520c3[_0xc342('0x17')](0x1f4,_0x24b3ae[_0xc342('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ea0a0bd..6a4baa3 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 _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x493876,_0x17ac7c){var _0xa96f38=function(_0x38d42d){while(--_0x38d42d){_0x493876['push'](_0x493876['shift']());}};_0xa96f38(++_0x17ac7c);}(_0x2dae,0xc3));var _0xe2da=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x2dae[_0x1e175d];return _0x3a3ce5;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}}; \ No newline at end of file +var _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0xf737bf,_0x1efdea){var _0x308603=function(_0xbef4af){while(--_0xbef4af){_0xf737bf['push'](_0xf737bf['shift']());}};_0x308603(++_0x1efdea);}(_0x22fb,0x192));var _0xb22f=function(_0x5d4c6f,_0x5c9953){_0x5d4c6f=_0x5d4c6f-0x0;var _0x5d646f=_0x22fb[_0x5d4c6f];return _0x5d646f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 88e590e..12d0646 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(_0x11ce7c,_0x11906f){var _0x21fc8b=function(_0x47bb26){while(--_0x47bb26){_0x11ce7c['push'](_0x11ce7c['shift']());}};_0x21fc8b(++_0x11906f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5bb4be,_0x3cb40c){var _0x3d66f8=function(_0x26a64f){while(--_0x26a64f){_0x5bb4be['push'](_0x5bb4be['shift']());}};_0x3d66f8(++_0x3cb40c);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 4be8d87..3b9e447 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 _0x2e0a=['exports','STRING','DATE','moment','sequelize'];(function(_0x4a9961,_0x261ff8){var _0x3211b5=function(_0x123840){while(--_0x123840){_0x4a9961['push'](_0x4a9961['shift']());}};_0x3211b5(++_0x261ff8);}(_0x2e0a,0xa3));var _0xa2e0=function(_0x55a496,_0x12a0a3){_0x55a496=_0x55a496-0x0;var _0x57fb12=_0x2e0a[_0x55a496];return _0x57fb12;};'use strict';var moment=require(_0xa2e0('0x0'));var Sequelize=require(_0xa2e0('0x1'));module[_0xa2e0('0x2')]={'uniqueid':{'type':Sequelize[_0xa2e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa2e0('0x3')]},'joinAt':{'type':Sequelize[_0xa2e0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa2e0('0x4')]},'exitAt':{'type':Sequelize[_0xa2e0('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6f72=['STRING','DATE','sequelize','exports'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x6f72,0xae));var _0x26f7=function(_0x3d7c55,_0x38bac3){_0x3d7c55=_0x3d7c55-0x0;var _0x1b747d=_0x6f72[_0x3d7c55];return _0x1b747d;};'use strict';var moment=require('moment');var Sequelize=require(_0x26f7('0x0'));module[_0x26f7('0x1')]={'uniqueid':{'type':Sequelize[_0x26f7('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x26f7('0x3')]},'leaveAt':{'type':Sequelize[_0x26f7('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x26f7('0x3')]},'reason':{'type':Sequelize[_0x26f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 6d1cd2f..d1d5b0c 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 _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','ChatQueueReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4bdd47,_0x24dd3e){var _0x2e7cf6=function(_0x5b7a5a){while(--_0x5b7a5a){_0x4bdd47['push'](_0x4bdd47['shift']());}};_0x2e7cf6(++_0x24dd3e);}(_0x814b,0x1a2));var _0xb814=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x814b[_0x451735];return _0x41d1e2;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['ChatQueueReport'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['ChatQueueReport'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));}; \ No newline at end of file +var _0x2dc3=['include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','map','ChatQueueReport','fieldName','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll'];(function(_0x7afd31,_0x5a0987){var _0x592e81=function(_0xdc35f7){while(--_0xdc35f7){_0x7afd31['push'](_0x7afd31['shift']());}};_0x592e81(++_0x5a0987);}(_0x2dc3,0x127));var _0x32dc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2dc3[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32dc('0x0'));var zipdir=require(_0x32dc('0x1'));var jsonpatch=require(_0x32dc('0x2'));var rp=require(_0x32dc('0x3'));var moment=require(_0x32dc('0x4'));var BPromise=require(_0x32dc('0x5'));var Mustache=require(_0x32dc('0x6'));var util=require(_0x32dc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x32dc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32dc('0x9'));var _=require('lodash');var squel=require(_0x32dc('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x32dc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x32dc('0xc'));var Papa=require(_0x32dc('0xd'));var Redis=require(_0x32dc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32dc('0xf'));var hardwareService=require(_0x32dc('0x10'));var logger=require(_0x32dc('0x11'))(_0x32dc('0x12'));var utils=require(_0x32dc('0x13'));var config=require(_0x32dc('0x14'));var licenseUtil=require(_0x32dc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36ab9f,_0x480027){_0x480027=_0x480027||0xcc;return function(_0x3b163b){if(_0x3b163b){return _0x36ab9f[_0x32dc('0x16')](_0x480027);}return _0x36ab9f[_0x32dc('0x17')](_0x480027)['end']();};}function respondWithResult(_0x355d98,_0x10f169){_0x10f169=_0x10f169||0xc8;return function(_0x5e373a){if(_0x5e373a){return _0x355d98[_0x32dc('0x17')](_0x10f169)['json'](_0x5e373a);}};}function respondWithFilteredResult(_0x2dee08,_0x5954f3){return function(_0x47fe19){if(_0x47fe19){var _0x497b11=typeof _0x5954f3[_0x32dc('0x18')]===_0x32dc('0x19')&&typeof _0x5954f3[_0x32dc('0x1a')]==='undefined';var _0x284dfe=_0x47fe19[_0x32dc('0x1b')];var _0x38064a=_0x497b11?0x0:_0x5954f3['offset'];var _0x36e287=_0x497b11?_0x47fe19[_0x32dc('0x1b')]:_0x5954f3[_0x32dc('0x18')]+_0x5954f3[_0x32dc('0x1a')];var _0x5bbd7c;if(_0x36e287>=_0x284dfe){_0x36e287=_0x284dfe;_0x5bbd7c=0xc8;}else{_0x5bbd7c=0xce;}_0x2dee08[_0x32dc('0x17')](_0x5bbd7c);return _0x2dee08[_0x32dc('0x1c')](_0x32dc('0x1d'),_0x38064a+'-'+_0x36e287+'/'+_0x284dfe)[_0x32dc('0x1e')](_0x47fe19);}return null;};}function patchUpdates(_0x43b4a3){return function(_0x445c79){try{jsonpatch[_0x32dc('0x1f')](_0x445c79,_0x43b4a3,!![]);}catch(_0x33eae0){return BPromise['reject'](_0x33eae0);}return _0x445c79[_0x32dc('0x20')]();};}function saveUpdates(_0x37e2d1,_0xd8dd68){return function(_0x2a4bf9){if(_0x2a4bf9){return _0x2a4bf9['update'](_0x37e2d1)[_0x32dc('0x21')](function(_0x3582af){return _0x3582af;});}return null;};}function removeEntity(_0x36398c,_0x39182b){return function(_0x57e1e3){if(_0x57e1e3){return _0x57e1e3[_0x32dc('0x22')]()[_0x32dc('0x21')](function(){_0x36398c[_0x32dc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51af54,_0x3718e1){return function(_0x4a0e6e){if(!_0x4a0e6e){_0x51af54[_0x32dc('0x16')](0x194);}return _0x4a0e6e;};}function handleError(_0x582651,_0x5a7382){_0x5a7382=_0x5a7382||0x1f4;return function(_0x50ccf4){logger[_0x32dc('0x23')](_0x50ccf4['stack']);if(_0x50ccf4[_0x32dc('0x24')]){delete _0x50ccf4[_0x32dc('0x24')];}_0x582651['status'](_0x5a7382)[_0x32dc('0x25')](_0x50ccf4);};}exports[_0x32dc('0x26')]=function(_0x28beb9,_0xa37191){var _0x287bb2={},_0x41d845={},_0x84c29d={'count':0x0,'rows':[]};var _0x53dd9e=_[_0x32dc('0x27')](db[_0x32dc('0x28')]['rawAttributes'],function(_0x486c19){return{'name':_0x486c19[_0x32dc('0x29')],'type':_0x486c19['type'][_0x32dc('0x2a')]};});_0x41d845['model']=_[_0x32dc('0x27')](_0x53dd9e,_0x32dc('0x24'));_0x41d845['query']=_[_0x32dc('0x2b')](_0x28beb9[_0x32dc('0x2c')]);_0x41d845[_0x32dc('0x2d')]=_['intersection'](_0x41d845[_0x32dc('0x2e')],_0x41d845[_0x32dc('0x2c')]);_0x287bb2[_0x32dc('0x2f')]=_[_0x32dc('0x30')](_0x41d845[_0x32dc('0x2e')],qs[_0x32dc('0x31')](_0x28beb9[_0x32dc('0x2c')][_0x32dc('0x31')]));_0x287bb2[_0x32dc('0x2f')]=_0x287bb2[_0x32dc('0x2f')]['length']?_0x287bb2[_0x32dc('0x2f')]:_0x41d845[_0x32dc('0x2e')];if(!_0x28beb9[_0x32dc('0x2c')][_0x32dc('0x32')](_0x32dc('0x33'))){_0x287bb2['limit']=qs[_0x32dc('0x1a')](_0x28beb9['query'][_0x32dc('0x1a')]);_0x287bb2['offset']=qs[_0x32dc('0x18')](_0x28beb9['query']['offset']);}_0x287bb2[_0x32dc('0x34')]=qs[_0x32dc('0x35')](_0x28beb9[_0x32dc('0x2c')][_0x32dc('0x35')]);_0x287bb2['where']=qs[_0x32dc('0x2d')](_[_0x32dc('0x36')](_0x28beb9[_0x32dc('0x2c')],_0x41d845[_0x32dc('0x2d')]),_0x53dd9e);if(_0x28beb9['query'][_0x32dc('0x37')]){_0x287bb2[_0x32dc('0x38')]=_[_0x32dc('0x39')](_0x287bb2[_0x32dc('0x38')],{'$or':_[_0x32dc('0x27')](_0x53dd9e,function(_0x5718b2){if(_0x5718b2['type']!=='VIRTUAL'){var _0x52b6d8={};_0x52b6d8[_0x5718b2['name']]={'$like':'%'+_0x28beb9[_0x32dc('0x2c')][_0x32dc('0x37')]+'%'};return _0x52b6d8;}})});}_0x287bb2=_['merge']({},_0x287bb2,_0x28beb9[_0x32dc('0x3a')]);var _0x46f049={'where':_0x287bb2['where']};return db[_0x32dc('0x28')][_0x32dc('0x1b')](_0x46f049)[_0x32dc('0x21')](function(_0x4afc95){_0x84c29d['count']=_0x4afc95;if(_0x28beb9[_0x32dc('0x2c')][_0x32dc('0x3b')]){_0x287bb2[_0x32dc('0x3c')]=[{'all':!![]}];}return db[_0x32dc('0x28')][_0x32dc('0x3d')](_0x287bb2);})[_0x32dc('0x21')](function(_0xc54728){_0x84c29d[_0x32dc('0x3e')]=_0xc54728;return _0x84c29d;})[_0x32dc('0x21')](respondWithFilteredResult(_0xa37191,_0x287bb2))[_0x32dc('0x3f')](handleError(_0xa37191,null));};exports[_0x32dc('0x40')]=function(_0x205e71,_0x4411c4){var _0x4d53f1={'raw':!![],'where':{'id':_0x205e71[_0x32dc('0x41')]['id']}},_0x5705fe={};_0x5705fe[_0x32dc('0x2e')]=_[_0x32dc('0x2b')](db[_0x32dc('0x28')]['rawAttributes']);_0x5705fe[_0x32dc('0x2c')]=_[_0x32dc('0x2b')](_0x205e71[_0x32dc('0x2c')]);_0x5705fe['filters']=_[_0x32dc('0x30')](_0x5705fe['model'],_0x5705fe[_0x32dc('0x2c')]);_0x4d53f1[_0x32dc('0x2f')]=_[_0x32dc('0x30')](_0x5705fe[_0x32dc('0x2e')],qs['fields'](_0x205e71[_0x32dc('0x2c')]['fields']));_0x4d53f1[_0x32dc('0x2f')]=_0x4d53f1['attributes'][_0x32dc('0x42')]?_0x4d53f1[_0x32dc('0x2f')]:_0x5705fe[_0x32dc('0x2e')];if(_0x205e71[_0x32dc('0x2c')][_0x32dc('0x3b')]){_0x4d53f1[_0x32dc('0x3c')]=[{'all':!![]}];}_0x4d53f1=_[_0x32dc('0x39')]({},_0x4d53f1,_0x205e71[_0x32dc('0x3a')]);return db[_0x32dc('0x28')][_0x32dc('0x43')](_0x4d53f1)[_0x32dc('0x21')](handleEntityNotFound(_0x4411c4,null))['then'](respondWithResult(_0x4411c4,null))[_0x32dc('0x3f')](handleError(_0x4411c4,null));};exports[_0x32dc('0x44')]=function(_0x265197,_0xdd70f5){return db['ChatQueueReport'][_0x32dc('0x44')](_0x265197['body'],{})[_0x32dc('0x21')](respondWithResult(_0xdd70f5,0xc9))['catch'](handleError(_0xdd70f5,null));};exports['update']=function(_0x79a5b6,_0xdb438c){if(_0x79a5b6[_0x32dc('0x45')]['id']){delete _0x79a5b6[_0x32dc('0x45')]['id'];}return db['ChatQueueReport'][_0x32dc('0x43')]({'where':{'id':_0x79a5b6[_0x32dc('0x41')]['id']}})[_0x32dc('0x21')](handleEntityNotFound(_0xdb438c,null))['then'](saveUpdates(_0x79a5b6['body'],null))[_0x32dc('0x21')](respondWithResult(_0xdb438c,null))['catch'](handleError(_0xdb438c,null));};exports[_0x32dc('0x22')]=function(_0x57ff36,_0x48395d){return db[_0x32dc('0x28')][_0x32dc('0x43')]({'where':{'id':_0x57ff36[_0x32dc('0x41')]['id']}})[_0x32dc('0x21')](handleEntityNotFound(_0x48395d,null))['then'](removeEntity(_0x48395d,null))[_0x32dc('0x3f')](handleError(_0x48395d,null));};exports['describe']=function(_0x2514ff,_0x2056c2){return db[_0x32dc('0x28')][_0x32dc('0x46')]()[_0x32dc('0x21')](respondWithResult(_0x2056c2,null))['catch'](handleError(_0x2056c2,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3967553..0b0b827 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(_0x30321d,_0x1a6b9c){var _0x411788=function(_0x1f8756){while(--_0x1f8756){_0x30321d['push'](_0x30321d['shift']());}};_0x411788(++_0x1a6b9c);}(_0x757a,0xde));var _0xa757=function(_0x4c4c4b,_0x27b4c0){_0x4c4c4b=_0x4c4c4b-0x0;var _0x4ecc32=_0x757a[_0x4c4c4b];return _0x4ecc32;};'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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5cc665,_0x124a7e){var _0x3d19a7=function(_0x2c4b97){while(--_0x2c4b97){_0x5cc665['push'](_0x5cc665['shift']());}};_0x3d19a7(++_0x124a7e);}(_0x757a,0xde));var _0xa757=function(_0x146c77,_0x5da6c8){_0x146c77=_0x146c77-0x0;var _0x20b38e=_0x757a[_0x146c77];return _0x20b38e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f893ed6..40b3dc0 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 _0xd0eb=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0eb,0x11b));var _0xbd0e=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xd0eb[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0xbd0e('0x0'));var util=require(_0xbd0e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbd0e('0x2'));var fs=require('fs');var Redis=require(_0xbd0e('0x3'));var db=require(_0xbd0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd0e('0x5'))('rpc');var config=require(_0xbd0e('0x6'));var jayson=require(_0xbd0e('0x7'));var client=jayson[_0xbd0e('0x8')][_0xbd0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fb2a5,_0x5837e4,_0x301345){return new BPromise(function(_0x2aa462,_0x23051c){return client[_0xbd0e('0xa')](_0x4fb2a5,_0x301345)['then'](function(_0x300daa){logger[_0xbd0e('0xb')](_0xbd0e('0xc'),_0x5837e4,_0xbd0e('0xd'));logger[_0xbd0e('0xe')](_0xbd0e('0xf'),_0x5837e4,'request\x20sent',JSON[_0xbd0e('0x10')](_0x300daa));if(_0x300daa[_0xbd0e('0x11')]){if(_0x300daa[_0xbd0e('0x11')][_0xbd0e('0x12')]===0x1f4){logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x300daa[_0xbd0e('0x11')][_0xbd0e('0x13')]);return _0x23051c(_0x300daa['error'][_0xbd0e('0x13')]);}logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x300daa['error']['message']);return _0x2aa462(_0x300daa['error'][_0xbd0e('0x13')]);}else{logger[_0xbd0e('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x5837e4,_0xbd0e('0xd'));_0x2aa462(_0x300daa[_0xbd0e('0x14')][_0xbd0e('0x13')]);}})[_0xbd0e('0x15')](function(_0x583422){logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x583422);_0x23051c(_0x583422);});});}exports[_0xbd0e('0x16')]=function(_0x16ecf2){var _0x53e1c3=this;return new Promise(function(_0xd93d7c,_0x48ec26){return db[_0xbd0e('0x17')][_0xbd0e('0x18')](_0x16ecf2[_0xbd0e('0x19')],{'raw':_0x16ecf2[_0xbd0e('0x1a')]?_0x16ecf2[_0xbd0e('0x1a')][_0xbd0e('0x1b')]===undefined?!![]:![]:!![]})[_0xbd0e('0x1c')](function(_0xf8790){logger[_0xbd0e('0xb')](_0xbd0e('0x16'),_0x16ecf2);logger['debug'](_0xbd0e('0x16'),_0x16ecf2,JSON[_0xbd0e('0x10')](_0xf8790));_0xd93d7c(_0xf8790);})[_0xbd0e('0x15')](function(_0x571a7b){logger[_0xbd0e('0x11')]('CreateChatQueueReport',_0x571a7b[_0xbd0e('0x13')],_0x16ecf2);_0x48ec26(_0x53e1c3[_0xbd0e('0x11')](0x1f4,_0x571a7b[_0xbd0e('0x13')]));});});};exports[_0xbd0e('0x1d')]=function(_0x166d8a){var _0x493b67=this;return new Promise(function(_0x18bd27,_0x377907){return db[_0xbd0e('0x17')][_0xbd0e('0x1e')](_0x166d8a['body'],{'raw':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a[_0xbd0e('0x1a')][_0xbd0e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a[_0xbd0e('0x1a')]['where']||null:null,'attributes':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a['options'][_0xbd0e('0x1f')]||null:null,'limit':_0x166d8a['options']?_0x166d8a['options'][_0xbd0e('0x20')]||null:null})[_0xbd0e('0x1c')](function(_0x3cf29c){logger[_0xbd0e('0xb')](_0xbd0e('0x1d'),_0x166d8a);logger[_0xbd0e('0xe')](_0xbd0e('0x1d'),_0x166d8a,JSON[_0xbd0e('0x10')](_0x3cf29c));_0x18bd27(_0x3cf29c);})[_0xbd0e('0x15')](function(_0x502cac){logger['error'](_0xbd0e('0x1d'),_0x502cac[_0xbd0e('0x13')],_0x166d8a);_0x377907(_0x493b67['error'](0x1f4,_0x502cac['message']));});});}; \ No newline at end of file +var _0x53b0=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','where','attributes','limit','stringify'];(function(_0x5e13cc,_0x3b584d){var _0x42d93c=function(_0x2d0e3d){while(--_0x2d0e3d){_0x5e13cc['push'](_0x5e13cc['shift']());}};_0x42d93c(++_0x3b584d);}(_0x53b0,0x1dc));var _0x053b=function(_0x3d3fa1,_0x570439){_0x3d3fa1=_0x3d3fa1-0x0;var _0x4bfa64=_0x53b0[_0x3d3fa1];return _0x4bfa64;};'use strict';var _=require('lodash');var util=require(_0x053b('0x0'));var moment=require('moment');var BPromise=require(_0x053b('0x1'));var rs=require(_0x053b('0x2'));var fs=require('fs');var Redis=require(_0x053b('0x3'));var db=require(_0x053b('0x4'))['db'];var utils=require(_0x053b('0x5'));var logger=require(_0x053b('0x6'))(_0x053b('0x7'));var config=require(_0x053b('0x8'));var jayson=require(_0x053b('0x9'));var client=jayson['client'][_0x053b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220070,_0x3267c1,_0x12bcfb){return new BPromise(function(_0x27df44,_0x1cffd3){return client[_0x053b('0xb')](_0x220070,_0x12bcfb)[_0x053b('0xc')](function(_0x3ba13a){logger[_0x053b('0xd')](_0x053b('0xe'),_0x3267c1,_0x053b('0xf'));logger['debug'](_0x053b('0x10'),_0x3267c1,_0x053b('0xf'),JSON['stringify'](_0x3ba13a));if(_0x3ba13a[_0x053b('0x11')]){if(_0x3ba13a[_0x053b('0x11')][_0x053b('0x12')]===0x1f4){logger['error'](_0x053b('0xe'),_0x3267c1,_0x3ba13a[_0x053b('0x11')][_0x053b('0x13')]);return _0x1cffd3(_0x3ba13a[_0x053b('0x11')]['message']);}logger[_0x053b('0x11')](_0x053b('0xe'),_0x3267c1,_0x3ba13a['error'][_0x053b('0x13')]);return _0x27df44(_0x3ba13a[_0x053b('0x11')][_0x053b('0x13')]);}else{logger[_0x053b('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3267c1,_0x053b('0xf'));_0x27df44(_0x3ba13a[_0x053b('0x14')][_0x053b('0x13')]);}})[_0x053b('0x15')](function(_0x1653d8){logger[_0x053b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x3267c1,_0x1653d8);_0x1cffd3(_0x1653d8);});});}exports[_0x053b('0x16')]=function(_0x33c2f5){var _0x35ecba=this;return new Promise(function(_0x2379ad,_0xe752b2){return db['ChatQueueReport'][_0x053b('0x17')](_0x33c2f5[_0x053b('0x18')],{'raw':_0x33c2f5[_0x053b('0x19')]?_0x33c2f5[_0x053b('0x19')][_0x053b('0x1a')]===undefined?!![]:![]:!![]})[_0x053b('0xc')](function(_0x40c404){logger['info'](_0x053b('0x16'),_0x33c2f5);logger[_0x053b('0x1b')](_0x053b('0x16'),_0x33c2f5,JSON['stringify'](_0x40c404));_0x2379ad(_0x40c404);})[_0x053b('0x15')](function(_0x389c70){logger['error']('CreateChatQueueReport',_0x389c70['message'],_0x33c2f5);_0xe752b2(_0x35ecba[_0x053b('0x11')](0x1f4,_0x389c70[_0x053b('0x13')]));});});};exports[_0x053b('0x1c')]=function(_0x2482a1){var _0x2642f2=this;return new Promise(function(_0xb73945,_0x534b18){return db['ChatQueueReport'][_0x053b('0x1d')](_0x2482a1[_0x053b('0x18')],{'raw':_0x2482a1['options']?_0x2482a1[_0x053b('0x19')][_0x053b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2482a1[_0x053b('0x19')]?_0x2482a1[_0x053b('0x19')][_0x053b('0x1e')]||null:null,'attributes':_0x2482a1[_0x053b('0x19')]?_0x2482a1[_0x053b('0x19')][_0x053b('0x1f')]||null:null,'limit':_0x2482a1[_0x053b('0x19')]?_0x2482a1[_0x053b('0x19')][_0x053b('0x20')]||null:null})[_0x053b('0xc')](function(_0x86404a){logger[_0x053b('0xd')]('UpdateChatQueueReport',_0x2482a1);logger[_0x053b('0x1b')](_0x053b('0x1c'),_0x2482a1,JSON[_0x053b('0x21')](_0x86404a));_0xb73945(_0x86404a);})['catch'](function(_0x46bed4){logger['error'](_0x053b('0x1c'),_0x46bed4[_0x053b('0x13')],_0x2482a1);_0x534b18(_0x2642f2['error'](0x1f4,_0x46bed4[_0x053b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index d516564..2134515 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 _0xbf76=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x2ee360,_0x48442d){var _0x47d4ff=function(_0x2afdcc){while(--_0x2afdcc){_0x2ee360['push'](_0x2ee360['shift']());}};_0x47d4ff(++_0x48442d);}(_0xbf76,0x14f));var _0x6bf7=function(_0x5c91f1,_0x5d27ef){_0x5c91f1=_0x5c91f1-0x0;var _0x4b4652=_0xbf76[_0x5c91f1];return _0x4b4652;};'use strict';var multer=require(_0x6bf7('0x0'));var util=require(_0x6bf7('0x1'));var path=require(_0x6bf7('0x2'));var timeout=require(_0x6bf7('0x3'));var express=require(_0x6bf7('0x4'));var router=express[_0x6bf7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6bf7('0x6'));var config=require('../../config/environment');var controller=require(_0x6bf7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6bf7('0x8')]);router[_0x6bf7('0x9')](_0x6bf7('0xa'),auth['isAuthenticated'](),controller[_0x6bf7('0xb')]);router[_0x6bf7('0x9')](_0x6bf7('0xc'),auth[_0x6bf7('0xd')](),controller[_0x6bf7('0xe')]);router[_0x6bf7('0xf')]('/',auth[_0x6bf7('0xd')](),controller[_0x6bf7('0x10')]);router[_0x6bf7('0x11')](_0x6bf7('0xc'),auth['isAuthenticated'](),controller[_0x6bf7('0x12')]);router[_0x6bf7('0x13')](_0x6bf7('0xc'),auth[_0x6bf7('0xd')](),controller[_0x6bf7('0x14')]);module[_0x6bf7('0x15')]=router; \ No newline at end of file +var _0x30f9=['get','index','/describe','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller'];(function(_0x4bad6c,_0x29ec89){var _0x46ac3b=function(_0x7f67e0){while(--_0x7f67e0){_0x4bad6c['push'](_0x4bad6c['shift']());}};_0x46ac3b(++_0x29ec89);}(_0x30f9,0x6c));var _0x930f=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x30f9[_0x4cbf20];return _0x582ae4;};'use strict';var multer=require(_0x930f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x930f('0x1'));var express=require('express');var router=express[_0x930f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x930f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x930f('0x4'));var controller=require(_0x930f('0x5'));router[_0x930f('0x6')]('/',auth['isAuthenticated'](),controller[_0x930f('0x7')]);router[_0x930f('0x6')](_0x930f('0x8'),auth['isAuthenticated'](),controller[_0x930f('0x9')]);router[_0x930f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x930f('0xa')]);router[_0x930f('0xb')]('/',auth[_0x930f('0xc')](),controller[_0x930f('0xd')]);router[_0x930f('0xe')](_0x930f('0xf'),auth[_0x930f('0xc')](),controller[_0x930f('0x10')]);router[_0x930f('0x11')]('/:id',auth[_0x930f('0xc')](),controller[_0x930f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 7a83fee..746f5b3 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3d2ea4,_0xbbfa1d){var _0x2c4a59=function(_0x1ee70f){while(--_0x1ee70f){_0x3d2ea4['push'](_0x3d2ea4['shift']());}};_0x2c4a59(++_0xbbfa1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x57a902,_0x7a36c6){var _0x5c45d1=function(_0x118ea4){while(--_0x118ea4){_0x57a902['push'](_0x57a902['shift']());}};_0x5c45d1(++_0x7a36c6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2992e8,_0x579e0e){_0x2992e8=_0x2992e8-0x0;var _0xf50aef=_0xf4eb[_0x2992e8];return _0xf50aef;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 68a384a..2741217 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 _0xfa8f=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','model','length','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xfa8f,0x15e));var _0xffa8=function(_0x517b20,_0x1155af){_0x517b20=_0x517b20-0x0;var _0x2b083b=_0xfa8f[_0x517b20];return _0x2b083b;};'use strict';var emlformat=require(_0xffa8('0x0'));var rimraf=require(_0xffa8('0x1'));var zipdir=require(_0xffa8('0x2'));var jsonpatch=require(_0xffa8('0x3'));var rp=require('request-promise');var moment=require(_0xffa8('0x4'));var BPromise=require(_0xffa8('0x5'));var Mustache=require(_0xffa8('0x6'));var util=require(_0xffa8('0x7'));var path=require('path');var sox=require(_0xffa8('0x8'));var csv=require(_0xffa8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffa8('0xa'));var squel=require(_0xffa8('0xb'));var crypto=require(_0xffa8('0xc'));var jsforce=require(_0xffa8('0xd'));var deskjs=require(_0xffa8('0xe'));var toCsv=require(_0xffa8('0x9'));var querystring=require('querystring');var Papa=require(_0xffa8('0xf'));var Redis=require('ioredis');var authService=require(_0xffa8('0x10'));var qs=require(_0xffa8('0x11'));var as=require(_0xffa8('0x12'));var hardwareService=require(_0xffa8('0x13'));var logger=require(_0xffa8('0x14'))(_0xffa8('0x15'));var utils=require(_0xffa8('0x16'));var config=require(_0xffa8('0x17'));var licenseUtil=require(_0xffa8('0x18'));var db=require(_0xffa8('0x19'))['db'];function respondWithStatusCode(_0x1c6a89,_0x57ee43){_0x57ee43=_0x57ee43||0xcc;return function(_0x544574){if(_0x544574){return _0x1c6a89[_0xffa8('0x1a')](_0x57ee43);}return _0x1c6a89[_0xffa8('0x1b')](_0x57ee43)[_0xffa8('0x1c')]();};}function respondWithResult(_0x58e67e,_0x17e355){_0x17e355=_0x17e355||0xc8;return function(_0x5d9b49){if(_0x5d9b49){return _0x58e67e[_0xffa8('0x1b')](_0x17e355)['json'](_0x5d9b49);}};}function respondWithFilteredResult(_0x546f5c,_0x2a60f6){return function(_0xd1b092){if(_0xd1b092){var _0x38039e=typeof _0x2a60f6['offset']===_0xffa8('0x1d')&&typeof _0x2a60f6[_0xffa8('0x1e')]===_0xffa8('0x1d');var _0x52b6b5=_0xd1b092[_0xffa8('0x1f')];var _0x3e11b0=_0x38039e?0x0:_0x2a60f6[_0xffa8('0x20')];var _0x329559=_0x38039e?_0xd1b092[_0xffa8('0x1f')]:_0x2a60f6[_0xffa8('0x20')]+_0x2a60f6[_0xffa8('0x1e')];var _0xa0ec7;if(_0x329559>=_0x52b6b5){_0x329559=_0x52b6b5;_0xa0ec7=0xc8;}else{_0xa0ec7=0xce;}_0x546f5c[_0xffa8('0x1b')](_0xa0ec7);return _0x546f5c['set']('Content-Range',_0x3e11b0+'-'+_0x329559+'/'+_0x52b6b5)[_0xffa8('0x21')](_0xd1b092);}return null;};}function patchUpdates(_0x13d3d3){return function(_0x5dce53){try{jsonpatch[_0xffa8('0x22')](_0x5dce53,_0x13d3d3,!![]);}catch(_0x738e0e){return BPromise[_0xffa8('0x23')](_0x738e0e);}return _0x5dce53[_0xffa8('0x24')]();};}function saveUpdates(_0x2be6d4,_0x214ff7){return function(_0x499427){if(_0x499427){return _0x499427[_0xffa8('0x25')](_0x2be6d4)[_0xffa8('0x26')](function(_0x16b0f7){return _0x16b0f7;});}return null;};}function removeEntity(_0x48d7be,_0x3aef02){return function(_0x23ae48){if(_0x23ae48){return _0x23ae48['destroy']()[_0xffa8('0x26')](function(){_0x48d7be[_0xffa8('0x1b')](0xcc)[_0xffa8('0x1c')]();});}};}function handleEntityNotFound(_0x56d140,_0xa666){return function(_0x3fa102){if(!_0x3fa102){_0x56d140['sendStatus'](0x194);}return _0x3fa102;};}function handleError(_0x5e0fe2,_0x51a250){_0x51a250=_0x51a250||0x1f4;return function(_0x291282){logger['error'](_0x291282[_0xffa8('0x27')]);if(_0x291282[_0xffa8('0x28')]){delete _0x291282[_0xffa8('0x28')];}_0x5e0fe2['status'](_0x51a250)[_0xffa8('0x29')](_0x291282);};}exports[_0xffa8('0x2a')]=function(_0x216d4a,_0x45f0b4){var _0x55e1c0={},_0x5a97ec={},_0xc957fa={'count':0x0,'rows':[]};var _0x3a3745=_[_0xffa8('0x2b')](db[_0xffa8('0x2c')][_0xffa8('0x2d')],function(_0x1fe2c9){return{'name':_0x1fe2c9[_0xffa8('0x2e')],'type':_0x1fe2c9[_0xffa8('0x2f')][_0xffa8('0x30')]};});_0x5a97ec['model']=_['map'](_0x3a3745,_0xffa8('0x28'));_0x5a97ec[_0xffa8('0x31')]=_[_0xffa8('0x32')](_0x216d4a[_0xffa8('0x31')]);_0x5a97ec['filters']=_[_0xffa8('0x33')](_0x5a97ec['model'],_0x5a97ec['query']);_0x55e1c0[_0xffa8('0x34')]=_[_0xffa8('0x33')](_0x5a97ec['model'],qs[_0xffa8('0x35')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x35')]));_0x55e1c0[_0xffa8('0x34')]=_0x55e1c0[_0xffa8('0x34')]['length']?_0x55e1c0[_0xffa8('0x34')]:_0x5a97ec['model'];if(!_0x216d4a[_0xffa8('0x31')]['hasOwnProperty'](_0xffa8('0x36'))){_0x55e1c0[_0xffa8('0x1e')]=qs[_0xffa8('0x1e')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x1e')]);_0x55e1c0[_0xffa8('0x20')]=qs['offset'](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x20')]);}_0x55e1c0['order']=qs[_0xffa8('0x37')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x37')]);_0x55e1c0[_0xffa8('0x38')]=qs[_0xffa8('0x39')](_[_0xffa8('0x3a')](_0x216d4a[_0xffa8('0x31')],_0x5a97ec['filters']),_0x3a3745);if(_0x216d4a[_0xffa8('0x31')][_0xffa8('0x3b')]){_0x55e1c0[_0xffa8('0x38')]=_['merge'](_0x55e1c0[_0xffa8('0x38')],{'$or':_[_0xffa8('0x2b')](_0x3a3745,function(_0x2413c2){if(_0x2413c2['type']!=='VIRTUAL'){var _0x543492={};_0x543492[_0x2413c2[_0xffa8('0x28')]]={'$like':'%'+_0x216d4a['query']['filter']+'%'};return _0x543492;}})});}_0x55e1c0=_[_0xffa8('0x3c')]({},_0x55e1c0,_0x216d4a[_0xffa8('0x3d')]);var _0x513a44={'where':_0x55e1c0[_0xffa8('0x38')]};return db['ChatTransferReport']['count'](_0x513a44)['then'](function(_0x9a4b94){_0xc957fa[_0xffa8('0x1f')]=_0x9a4b94;if(_0x216d4a[_0xffa8('0x31')][_0xffa8('0x3e')]){_0x55e1c0['include']=[{'all':!![]}];}return db[_0xffa8('0x2c')][_0xffa8('0x3f')](_0x55e1c0);})[_0xffa8('0x26')](function(_0x2ce7ce){_0xc957fa['rows']=_0x2ce7ce;return _0xc957fa;})[_0xffa8('0x26')](respondWithFilteredResult(_0x45f0b4,_0x55e1c0))['catch'](handleError(_0x45f0b4,null));};exports[_0xffa8('0x40')]=function(_0x3546aa,_0x462c4e){var _0xb29e4a={'raw':!![],'where':{'id':_0x3546aa['params']['id']}},_0x3aa9ab={};_0x3aa9ab[_0xffa8('0x41')]=_[_0xffa8('0x32')](db[_0xffa8('0x2c')]['rawAttributes']);_0x3aa9ab[_0xffa8('0x31')]=_[_0xffa8('0x32')](_0x3546aa[_0xffa8('0x31')]);_0x3aa9ab['filters']=_['intersection'](_0x3aa9ab[_0xffa8('0x41')],_0x3aa9ab[_0xffa8('0x31')]);_0xb29e4a['attributes']=_[_0xffa8('0x33')](_0x3aa9ab['model'],qs[_0xffa8('0x35')](_0x3546aa['query'][_0xffa8('0x35')]));_0xb29e4a[_0xffa8('0x34')]=_0xb29e4a['attributes'][_0xffa8('0x42')]?_0xb29e4a[_0xffa8('0x34')]:_0x3aa9ab[_0xffa8('0x41')];if(_0x3546aa[_0xffa8('0x31')][_0xffa8('0x3e')]){_0xb29e4a[_0xffa8('0x43')]=[{'all':!![]}];}_0xb29e4a=_[_0xffa8('0x3c')]({},_0xb29e4a,_0x3546aa['options']);return db[_0xffa8('0x2c')][_0xffa8('0x44')](_0xb29e4a)[_0xffa8('0x26')](handleEntityNotFound(_0x462c4e,null))['then'](respondWithResult(_0x462c4e,null))[_0xffa8('0x45')](handleError(_0x462c4e,null));};exports[_0xffa8('0x46')]=function(_0x3d856d,_0x3ff3ef){return db[_0xffa8('0x2c')][_0xffa8('0x46')](_0x3d856d[_0xffa8('0x47')],{})[_0xffa8('0x26')](respondWithResult(_0x3ff3ef,0xc9))[_0xffa8('0x45')](handleError(_0x3ff3ef,null));};exports[_0xffa8('0x25')]=function(_0x203d77,_0x470047){if(_0x203d77['body']['id']){delete _0x203d77['body']['id'];}return db[_0xffa8('0x2c')][_0xffa8('0x44')]({'where':{'id':_0x203d77['params']['id']}})['then'](handleEntityNotFound(_0x470047,null))[_0xffa8('0x26')](saveUpdates(_0x203d77[_0xffa8('0x47')],null))[_0xffa8('0x26')](respondWithResult(_0x470047,null))[_0xffa8('0x45')](handleError(_0x470047,null));};exports['destroy']=function(_0x45886a,_0x386312){return db[_0xffa8('0x2c')][_0xffa8('0x44')]({'where':{'id':_0x45886a[_0xffa8('0x48')]['id']}})[_0xffa8('0x26')](handleEntityNotFound(_0x386312,null))[_0xffa8('0x26')](removeEntity(_0x386312,null))[_0xffa8('0x45')](handleError(_0x386312,null));};exports['describe']=function(_0x337745,_0x331a3c){return db[_0xffa8('0x2c')][_0xffa8('0x49')]()['then'](respondWithResult(_0x331a3c,null))[_0xffa8('0x45')](handleError(_0x331a3c,null));}; \ No newline at end of file +var _0x27d6=['name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','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','count','limit','Content-Range','reject','save','update','then','destroy','error'];(function(_0x46d4e9,_0x37f650){var _0x5f1993=function(_0x1d656d){while(--_0x1d656d){_0x46d4e9['push'](_0x46d4e9['shift']());}};_0x5f1993(++_0x37f650);}(_0x27d6,0x14a));var _0x627d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x27d6[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0x627d('0x0'));var rimraf=require(_0x627d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x627d('0x2'));var moment=require('moment');var BPromise=require(_0x627d('0x3'));var Mustache=require(_0x627d('0x4'));var util=require(_0x627d('0x5'));var path=require(_0x627d('0x6'));var sox=require(_0x627d('0x7'));var csv=require(_0x627d('0x8'));var ejs=require(_0x627d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x627d('0xa'));var squel=require(_0x627d('0xb'));var crypto=require(_0x627d('0xc'));var jsforce=require(_0x627d('0xd'));var deskjs=require(_0x627d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x627d('0xf'));var Papa=require('papaparse');var Redis=require(_0x627d('0x10'));var authService=require(_0x627d('0x11'));var qs=require(_0x627d('0x12'));var as=require(_0x627d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x627d('0x14'))('api');var utils=require(_0x627d('0x15'));var config=require(_0x627d('0x16'));var licenseUtil=require(_0x627d('0x17'));var db=require(_0x627d('0x18'))['db'];function respondWithStatusCode(_0x1ad092,_0x328a6d){_0x328a6d=_0x328a6d||0xcc;return function(_0x58b912){if(_0x58b912){return _0x1ad092[_0x627d('0x19')](_0x328a6d);}return _0x1ad092[_0x627d('0x1a')](_0x328a6d)[_0x627d('0x1b')]();};}function respondWithResult(_0x192481,_0x331e93){_0x331e93=_0x331e93||0xc8;return function(_0x198144){if(_0x198144){return _0x192481[_0x627d('0x1a')](_0x331e93)[_0x627d('0x1c')](_0x198144);}};}function respondWithFilteredResult(_0x2e98b3,_0x1c6839){return function(_0x3f6a1d){if(_0x3f6a1d){var _0x3f8d48=typeof _0x1c6839[_0x627d('0x1d')]===_0x627d('0x1e')&&typeof _0x1c6839['limit']===_0x627d('0x1e');var _0x27bbd2=_0x3f6a1d[_0x627d('0x1f')];var _0x169c96=_0x3f8d48?0x0:_0x1c6839[_0x627d('0x1d')];var _0x292091=_0x3f8d48?_0x3f6a1d[_0x627d('0x1f')]:_0x1c6839[_0x627d('0x1d')]+_0x1c6839[_0x627d('0x20')];var _0x88303d;if(_0x292091>=_0x27bbd2){_0x292091=_0x27bbd2;_0x88303d=0xc8;}else{_0x88303d=0xce;}_0x2e98b3[_0x627d('0x1a')](_0x88303d);return _0x2e98b3['set'](_0x627d('0x21'),_0x169c96+'-'+_0x292091+'/'+_0x27bbd2)['json'](_0x3f6a1d);}return null;};}function patchUpdates(_0x117a0f){return function(_0x418e96){try{jsonpatch['apply'](_0x418e96,_0x117a0f,!![]);}catch(_0x49a931){return BPromise[_0x627d('0x22')](_0x49a931);}return _0x418e96[_0x627d('0x23')]();};}function saveUpdates(_0x98e0b2,_0x2d5bb9){return function(_0x124be4){if(_0x124be4){return _0x124be4[_0x627d('0x24')](_0x98e0b2)[_0x627d('0x25')](function(_0x369524){return _0x369524;});}return null;};}function removeEntity(_0x1aa4d3,_0x20afa8){return function(_0x5472fd){if(_0x5472fd){return _0x5472fd[_0x627d('0x26')]()[_0x627d('0x25')](function(){_0x1aa4d3[_0x627d('0x1a')](0xcc)[_0x627d('0x1b')]();});}};}function handleEntityNotFound(_0x264267,_0x45558a){return function(_0x1dbdab){if(!_0x1dbdab){_0x264267[_0x627d('0x19')](0x194);}return _0x1dbdab;};}function handleError(_0x429891,_0x242e62){_0x242e62=_0x242e62||0x1f4;return function(_0x4a7d5c){logger[_0x627d('0x27')](_0x4a7d5c['stack']);if(_0x4a7d5c[_0x627d('0x28')]){delete _0x4a7d5c[_0x627d('0x28')];}_0x429891[_0x627d('0x1a')](_0x242e62)[_0x627d('0x29')](_0x4a7d5c);};}exports['index']=function(_0xbfe94e,_0xa151bf){var _0x32ac66={},_0x4dc3b7={},_0x2c304c={'count':0x0,'rows':[]};var _0x809b=_[_0x627d('0x2a')](db[_0x627d('0x2b')][_0x627d('0x2c')],function(_0x4daeb2){return{'name':_0x4daeb2[_0x627d('0x2d')],'type':_0x4daeb2[_0x627d('0x2e')][_0x627d('0x2f')]};});_0x4dc3b7[_0x627d('0x30')]=_['map'](_0x809b,'name');_0x4dc3b7[_0x627d('0x31')]=_['keys'](_0xbfe94e[_0x627d('0x31')]);_0x4dc3b7[_0x627d('0x32')]=_[_0x627d('0x33')](_0x4dc3b7[_0x627d('0x30')],_0x4dc3b7[_0x627d('0x31')]);_0x32ac66['attributes']=_['intersection'](_0x4dc3b7[_0x627d('0x30')],qs[_0x627d('0x34')](_0xbfe94e[_0x627d('0x31')][_0x627d('0x34')]));_0x32ac66[_0x627d('0x35')]=_0x32ac66[_0x627d('0x35')]['length']?_0x32ac66[_0x627d('0x35')]:_0x4dc3b7[_0x627d('0x30')];if(!_0xbfe94e[_0x627d('0x31')][_0x627d('0x36')](_0x627d('0x37'))){_0x32ac66['limit']=qs[_0x627d('0x20')](_0xbfe94e[_0x627d('0x31')][_0x627d('0x20')]);_0x32ac66['offset']=qs[_0x627d('0x1d')](_0xbfe94e[_0x627d('0x31')]['offset']);}_0x32ac66['order']=qs[_0x627d('0x38')](_0xbfe94e[_0x627d('0x31')][_0x627d('0x38')]);_0x32ac66['where']=qs[_0x627d('0x32')](_['pick'](_0xbfe94e['query'],_0x4dc3b7[_0x627d('0x32')]),_0x809b);if(_0xbfe94e[_0x627d('0x31')]['filter']){_0x32ac66[_0x627d('0x39')]=_['merge'](_0x32ac66['where'],{'$or':_[_0x627d('0x2a')](_0x809b,function(_0x13760d){if(_0x13760d[_0x627d('0x2e')]!==_0x627d('0x3a')){var _0x4a05b4={};_0x4a05b4[_0x13760d[_0x627d('0x28')]]={'$like':'%'+_0xbfe94e[_0x627d('0x31')][_0x627d('0x3b')]+'%'};return _0x4a05b4;}})});}_0x32ac66=_['merge']({},_0x32ac66,_0xbfe94e[_0x627d('0x3c')]);var _0x181b6f={'where':_0x32ac66[_0x627d('0x39')]};return db[_0x627d('0x2b')]['count'](_0x181b6f)[_0x627d('0x25')](function(_0x1e100f){_0x2c304c[_0x627d('0x1f')]=_0x1e100f;if(_0xbfe94e[_0x627d('0x31')][_0x627d('0x3d')]){_0x32ac66[_0x627d('0x3e')]=[{'all':!![]}];}return db[_0x627d('0x2b')][_0x627d('0x3f')](_0x32ac66);})[_0x627d('0x25')](function(_0x37d8ff){_0x2c304c[_0x627d('0x40')]=_0x37d8ff;return _0x2c304c;})[_0x627d('0x25')](respondWithFilteredResult(_0xa151bf,_0x32ac66))[_0x627d('0x41')](handleError(_0xa151bf,null));};exports[_0x627d('0x42')]=function(_0x103dd2,_0x546255){var _0x42a821={'raw':!![],'where':{'id':_0x103dd2[_0x627d('0x43')]['id']}},_0x4b994b={};_0x4b994b[_0x627d('0x30')]=_[_0x627d('0x44')](db[_0x627d('0x2b')]['rawAttributes']);_0x4b994b[_0x627d('0x31')]=_[_0x627d('0x44')](_0x103dd2[_0x627d('0x31')]);_0x4b994b[_0x627d('0x32')]=_['intersection'](_0x4b994b[_0x627d('0x30')],_0x4b994b[_0x627d('0x31')]);_0x42a821[_0x627d('0x35')]=_[_0x627d('0x33')](_0x4b994b[_0x627d('0x30')],qs[_0x627d('0x34')](_0x103dd2[_0x627d('0x31')][_0x627d('0x34')]));_0x42a821[_0x627d('0x35')]=_0x42a821[_0x627d('0x35')][_0x627d('0x45')]?_0x42a821[_0x627d('0x35')]:_0x4b994b[_0x627d('0x30')];if(_0x103dd2[_0x627d('0x31')][_0x627d('0x3d')]){_0x42a821[_0x627d('0x3e')]=[{'all':!![]}];}_0x42a821=_['merge']({},_0x42a821,_0x103dd2[_0x627d('0x3c')]);return db[_0x627d('0x2b')][_0x627d('0x46')](_0x42a821)[_0x627d('0x25')](handleEntityNotFound(_0x546255,null))['then'](respondWithResult(_0x546255,null))[_0x627d('0x41')](handleError(_0x546255,null));};exports[_0x627d('0x47')]=function(_0x2a134c,_0x5f17ff){return db['ChatTransferReport'][_0x627d('0x47')](_0x2a134c['body'],{})[_0x627d('0x25')](respondWithResult(_0x5f17ff,0xc9))[_0x627d('0x41')](handleError(_0x5f17ff,null));};exports[_0x627d('0x24')]=function(_0x136e2e,_0x46d5e2){if(_0x136e2e[_0x627d('0x48')]['id']){delete _0x136e2e[_0x627d('0x48')]['id'];}return db[_0x627d('0x2b')][_0x627d('0x46')]({'where':{'id':_0x136e2e['params']['id']}})[_0x627d('0x25')](handleEntityNotFound(_0x46d5e2,null))[_0x627d('0x25')](saveUpdates(_0x136e2e[_0x627d('0x48')],null))['then'](respondWithResult(_0x46d5e2,null))[_0x627d('0x41')](handleError(_0x46d5e2,null));};exports[_0x627d('0x26')]=function(_0x575758,_0x409064){return db['ChatTransferReport'][_0x627d('0x46')]({'where':{'id':_0x575758[_0x627d('0x43')]['id']}})[_0x627d('0x25')](handleEntityNotFound(_0x409064,null))[_0x627d('0x25')](removeEntity(_0x409064,null))[_0x627d('0x41')](handleError(_0x409064,null));};exports[_0x627d('0x49')]=function(_0x29fbc3,_0x267794){return db[_0x627d('0x2b')][_0x627d('0x49')]()[_0x627d('0x25')](respondWithResult(_0x267794,null))[_0x627d('0x41')](handleError(_0x267794,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index dc859ec..31ba19b 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 _0xd87f=['lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x3ea698,_0x2dd8a7){var _0x19a411=function(_0x2ea112){while(--_0x2ea112){_0x3ea698['push'](_0x3ea698['shift']());}};_0x19a411(++_0x2dd8a7);}(_0xd87f,0x12c));var _0xfd87=function(_0x4f4965,_0x2de5c5){_0x4f4965=_0x4f4965-0x0;var _0x19e5d9=_0xd87f[_0x4f4965];return _0x19e5d9;};'use strict';var _=require(_0xfd87('0x0'));var util=require(_0xfd87('0x1'));var logger=require('../../config/logger')(_0xfd87('0x2'));var moment=require(_0xfd87('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd87('0x4'));var fs=require('fs');var path=require(_0xfd87('0x5'));var rimraf=require(_0xfd87('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd87('0x7'));module[_0xfd87('0x8')]=function(_0xd42ae0,_0x5e4003){return _0xd42ae0[_0xfd87('0x9')](_0xfd87('0xa'),attributes,{'tableName':_0xfd87('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbbc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdbbc,0x1c3));var _0xcdbb=function(_0x4a1d85,_0x54af7f){_0x4a1d85=_0x4a1d85-0x0;var _0x485f74=_0xdbbc[_0x4a1d85];return _0x485f74;};'use strict';var _=require(_0xcdbb('0x0'));var util=require(_0xcdbb('0x1'));var logger=require(_0xcdbb('0x2'))(_0xcdbb('0x3'));var moment=require(_0xcdbb('0x4'));var BPromise=require(_0xcdbb('0x5'));var rp=require(_0xcdbb('0x6'));var fs=require('fs');var path=require(_0xcdbb('0x7'));var rimraf=require(_0xcdbb('0x8'));var config=require(_0xcdbb('0x9'));var attributes=require(_0xcdbb('0xa'));module[_0xcdbb('0xb')]=function(_0x21e2a2,_0x5421dc){return _0x21e2a2['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xcdbb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a22c861..9ddd894 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 _0xb92c=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash'];(function(_0x48f60a,_0x5914b7){var _0x13829b=function(_0x3f1da5){while(--_0x3f1da5){_0x48f60a['push'](_0x48f60a['shift']());}};_0x13829b(++_0x5914b7);}(_0xb92c,0x175));var _0xcb92=function(_0x2e99a6,_0x423933){_0x2e99a6=_0x2e99a6-0x0;var _0x3cf5b4=_0xb92c[_0x2e99a6];return _0x3cf5b4;};'use strict';var _=require(_0xcb92('0x0'));var util=require(_0xcb92('0x1'));var moment=require(_0xcb92('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb92('0x3'));var db=require(_0xcb92('0x4'))['db'];var utils=require(_0xcb92('0x5'));var logger=require('../../config/logger')(_0xcb92('0x6'));var config=require(_0xcb92('0x7'));var jayson=require(_0xcb92('0x8'));var client=jayson[_0xcb92('0x9')][_0xcb92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf0b2b1,_0x36b0f0,_0x167288){return new BPromise(function(_0x1da49a,_0x84d276){return client[_0xcb92('0xb')](_0xf0b2b1,_0x167288)[_0xcb92('0xc')](function(_0x416217){logger['info'](_0xcb92('0xd'),_0x36b0f0,_0xcb92('0xe'));logger[_0xcb92('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x36b0f0,_0xcb92('0xe'),JSON[_0xcb92('0x10')](_0x416217));if(_0x416217['error']){if(_0x416217[_0xcb92('0x11')][_0xcb92('0x12')]===0x1f4){logger[_0xcb92('0x11')](_0xcb92('0xd'),_0x36b0f0,_0x416217[_0xcb92('0x11')][_0xcb92('0x13')]);return _0x84d276(_0x416217[_0xcb92('0x11')][_0xcb92('0x13')]);}logger[_0xcb92('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x36b0f0,_0x416217[_0xcb92('0x11')]['message']);return _0x1da49a(_0x416217[_0xcb92('0x11')]['message']);}else{logger[_0xcb92('0x14')](_0xcb92('0xd'),_0x36b0f0,_0xcb92('0xe'));_0x1da49a(_0x416217[_0xcb92('0x15')][_0xcb92('0x13')]);}})['catch'](function(_0x103839){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x36b0f0,_0x103839);_0x84d276(_0x103839);});});} \ No newline at end of file +var _0x6ad9=['request\x20sent','error','code','message','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6ad9,0x12c));var _0x96ad=function(_0x5f293b,_0x3532ff){_0x5f293b=_0x5f293b-0x0;var _0x453b19=_0x6ad9[_0x5f293b];return _0x453b19;};'use strict';var _=require(_0x96ad('0x0'));var util=require('util');var moment=require(_0x96ad('0x1'));var BPromise=require('bluebird');var rs=require(_0x96ad('0x2'));var fs=require('fs');var Redis=require(_0x96ad('0x3'));var db=require(_0x96ad('0x4'))['db'];var utils=require(_0x96ad('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ad('0x6'));var jayson=require(_0x96ad('0x7'));var client=jayson[_0x96ad('0x8')][_0x96ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48e219,_0x1f8a85,_0x970d7){return new BPromise(function(_0x5ea1bd,_0xa94a97){return client[_0x96ad('0xa')](_0x48e219,_0x970d7)[_0x96ad('0xb')](function(_0x3157ac){logger['info'](_0x96ad('0xc'),_0x1f8a85,'request\x20sent');logger[_0x96ad('0xd')](_0x96ad('0xe'),_0x1f8a85,_0x96ad('0xf'),JSON['stringify'](_0x3157ac));if(_0x3157ac['error']){if(_0x3157ac[_0x96ad('0x10')][_0x96ad('0x11')]===0x1f4){logger[_0x96ad('0x10')](_0x96ad('0xc'),_0x1f8a85,_0x3157ac[_0x96ad('0x10')][_0x96ad('0x12')]);return _0xa94a97(_0x3157ac['error'][_0x96ad('0x12')]);}logger[_0x96ad('0x10')](_0x96ad('0xc'),_0x1f8a85,_0x3157ac['error'][_0x96ad('0x12')]);return _0x5ea1bd(_0x3157ac['error'][_0x96ad('0x12')]);}else{logger[_0x96ad('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x1f8a85,_0x96ad('0xf'));_0x5ea1bd(_0x3157ac['result'][_0x96ad('0x12')]);}})[_0x96ad('0x14')](function(_0x3b6ce6){logger[_0x96ad('0x10')](_0x96ad('0xc'),_0x1f8a85,_0x3b6ce6);_0xa94a97(_0x3b6ce6);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6b6951e..a7c5580 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 _0x0aeb=['../../components/interaction/service','./chatTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','post','put','/:id','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bb24b,_0x3af77a){var _0x34c437=function(_0x218a3a){while(--_0x218a3a){_0x3bb24b['push'](_0x3bb24b['shift']());}};_0x34c437(++_0x3af77a);}(_0x0aeb,0x94));var _0xb0ae=function(_0xa01255,_0x38166e){_0xa01255=_0xa01255-0x0;var _0xa06916=_0x0aeb[_0xa01255];return _0xa06916;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0ae('0x0'));var express=require(_0xb0ae('0x1'));var router=express[_0xb0ae('0x2')]();var fs_extra=require(_0xb0ae('0x3'));var auth=require(_0xb0ae('0x4'));var interaction=require(_0xb0ae('0x5'));var config=require('../../config/environment');var controller=require(_0xb0ae('0x6'));router[_0xb0ae('0x7')]('/',auth['isAuthenticated'](),controller[_0xb0ae('0x8')]);router['get'](_0xb0ae('0x9'),auth['isAuthenticated'](),controller[_0xb0ae('0xa')]);router['get']('/:id',auth[_0xb0ae('0xb')](),controller[_0xb0ae('0xc')]);router[_0xb0ae('0xd')]('/',auth[_0xb0ae('0xb')](),controller['create']);router[_0xb0ae('0xe')](_0xb0ae('0xf'),auth[_0xb0ae('0xb')](),controller['update']);router[_0xb0ae('0x10')]('/:id',auth[_0xb0ae('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5745=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x182573,_0x1899ea){var _0x5dcbc1=function(_0x685bc3){while(--_0x685bc3){_0x182573['push'](_0x182573['shift']());}};_0x5dcbc1(++_0x1899ea);}(_0x5745,0x1e8));var _0x5574=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5745[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x5574('0x0'));var util=require(_0x5574('0x1'));var path=require(_0x5574('0x2'));var timeout=require(_0x5574('0x3'));var express=require(_0x5574('0x4'));var router=express['Router']();var fs_extra=require(_0x5574('0x5'));var auth=require(_0x5574('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5574('0x7'));var controller=require(_0x5574('0x8'));router[_0x5574('0x9')]('/',auth[_0x5574('0xa')](),controller['index']);router['get'](_0x5574('0xb'),auth[_0x5574('0xa')](),controller['describe']);router['get'](_0x5574('0xc'),auth[_0x5574('0xa')](),controller['show']);router[_0x5574('0xd')]('/',auth[_0x5574('0xa')](),controller[_0x5574('0xe')]);router[_0x5574('0xf')]('/:id',auth[_0x5574('0xa')](),controller[_0x5574('0x10')]);router[_0x5574('0x11')](_0x5574('0xc'),auth[_0x5574('0xa')](),controller['destroy']);module[_0x5574('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index b2c70e6..b89f77e 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 _0x854f=['#fafafa','System','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Send','Skip','Feedback','star','thumb','input','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','bottom_right','CHAT','alternate'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x854f,0x188));var _0xf854=function(_0x1b859a,_0x1ab2d4){_0x1b859a=_0x1b859a-0x0;var _0x5ce5cd=_0x854f[_0x1b859a];return _0x5ce5cd;};'use strict';var Sequelize=require(_0xf854('0x0'));var rs=require(_0xf854('0x1'));module['exports']={'name':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xf854('0x2')]},'mapKey':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x3')},'mapKeyOffline':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x3')},'key':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x4')},'customerAlias':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf854('0x2')]},'animation':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf854('0x9')](_0xf854('0xa'),_0xf854('0xb')),'defaultValue':_0xf854('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0xc')},'start_chat_button':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0xe')},'download_transcript':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf854('0xf')]},'closingQuestion':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x13')},'skipMessageButton':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x14')},'conditionAgreement':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x15')},'ratingType':{'type':Sequelize[_0xf854('0x9')](_0xf854('0x16'),_0xf854('0x17')),'defaultValue':_0xf854('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf854('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xf854('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf854('0x3'),'type':_0xf854('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf854('0x19')](_0xf854('0x1a'))?JSON['parse'](this['getDataValue'](_0xf854('0x1a'))):{};},'set':function(_0x1f0e81){return this[_0xf854('0x1b')](_0xf854('0x1a'),JSON[_0xf854('0x1c')](_0x1f0e81));}},'offlineForm':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf854('0x18'),'props':{'title':_0xf854('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf854('0x3'),'type':_0xf854('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf854('0x1d')},'props':{'title':_0xf854('0x1d'),'helpText':_0xf854('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xf854('0x19')](_0xf854('0x1f'))?JSON['parse'](this[_0xf854('0x19')](_0xf854('0x1f'))):{};},'set':function(_0x56a3c5){return this['setDataValue'](_0xf854('0x1f'),JSON[_0xf854('0x1c')](_0x56a3c5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf854('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf854('0x2')]},'forwardOffline':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf854('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x21')},'waitingMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x14')},'sendUnmanaged':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf854('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf854('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x23')},'verticalAlignment':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x24')},'messagesAlignment':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x25')},'defaultTitle':{'type':Sequelize[_0xf854('0x2')]},'customerAvatar':{'type':Sequelize[_0xf854('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x26'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x27')},'systemAvatar':{'type':Sequelize[_0xf854('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb520a2){if(!_0xb520a2)this[_0xf854('0x1b')](_0xf854('0x28'),null);this[_0xf854('0x1b')](_0xf854('0x29'),_0xb520a2);}},'vidaooEscalation':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf854('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf854('0x2')],'defaultValue':function(){return _0xf854('0x2a');}},'vidaooMetadata':{'type':Sequelize[_0xf854('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xcf32=['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.','Skip','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x36e6b6,_0x189fe2){var _0x1aea27=function(_0x552b0f){while(--_0x552b0f){_0x36e6b6['push'](_0x36e6b6['shift']());}};_0x1aea27(++_0x189fe2);}(_0xcf32,0x70));var _0x2cf3=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0xcf32[_0x3227c1];return _0x31fd48;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x2cf3('0x0')]={'name':{'type':Sequelize[_0x2cf3('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x2cf3('0x1')],'allowNull':![],'unique':_0x2cf3('0x2')},'description':{'type':Sequelize[_0x2cf3('0x1')]},'mapKey':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x3')},'key':{'type':Sequelize[_0x2cf3('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2cf3('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2cf3('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2cf3('0x1')],'allowNull':![],'defaultValue':_0x2cf3('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2cf3('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2cf3('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2cf3('0x8')]('rounded',_0x2cf3('0x9')),'defaultValue':_0x2cf3('0xa')},'header_online':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0xb')},'start_chat_button':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0xc')},'download_transcript':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2cf3('0xe')]},'closingQuestion':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x11')},'noteTitle':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x12')},'placeholderMessage':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x13')},'closingMessage':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2cf3('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2cf3('0x8')]('star',_0x2cf3('0x16')),'defaultValue':_0x2cf3('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x2cf3('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2cf3('0xe')],'defaultValue':function(){return JSON[_0x2cf3('0x18')]({'items':[{'type':_0x2cf3('0x19'),'variable':null,'config':{'placeholder':_0x2cf3('0x1a'),'type':_0x2cf3('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2cf3('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2cf3('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2cf3('0x1c')](_0x2cf3('0x1d'))?JSON[_0x2cf3('0x1e')](this['getDataValue'](_0x2cf3('0x1d'))):{};},'set':function(_0x10d371){return this['setDataValue'](_0x2cf3('0x1d'),JSON[_0x2cf3('0x18')](_0x10d371));}},'offlineForm':{'type':Sequelize[_0x2cf3('0xe')],'defaultValue':function(){return JSON[_0x2cf3('0x18')]({'items':[{'type':'input','props':{'title':_0x2cf3('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x2cf3('0x3'),'type':'email'},'variable':null},{'type':_0x2cf3('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x2cf3('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x2cf3('0x1c')](_0x2cf3('0x21'))?JSON[_0x2cf3('0x1e')](this['getDataValue']('offlineForm')):{};},'set':function(_0x4a4b90){return this['setDataValue']('offlineForm',JSON[_0x2cf3('0x18')](_0x4a4b90));}},'token':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2cf3('0x1')]},'forwardOffline':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2cf3('0x1')]},'waitingTitle':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x22')},'waitingMessage':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x2cf3('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x25')},'skipUnmanaged':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x26')},'sendUnmanaged':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2cf3('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2cf3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x28')},'verticalAlignment':{'type':Sequelize[_0x2cf3('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x2cf3('0x1')]},'customerAvatar':{'type':Sequelize[_0x2cf3('0xe')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2cf3('0x1')],'allowNull':![],'defaultValue':_0x2cf3('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2cf3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':_0x2cf3('0x2b')},'systemAvatar':{'type':Sequelize[_0x2cf3('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2cf3('0x7')],'comment':_0x2cf3('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x2cf3('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5a4bb0){if(!_0x5a4bb0)this[_0x2cf3('0x2d')](_0x2cf3('0x2e'),null);this[_0x2cf3('0x2d')](_0x2cf3('0x2f'),_0x5a4bb0);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2cf3('0x1')]},'vidaooTopic':{'type':Sequelize[_0x2cf3('0x1')],'allowNull':![],'defaultValue':_0x2cf3('0x30')},'vidaooNote':{'type':Sequelize[_0x2cf3('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x2cf3('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2cf3('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index aa198aa..688b2d0 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 _0xeb60=['Applications','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','sequelize','transaction','MailServerOut','forwardOffline','Smtp','service','host','port','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','interval','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','utf8','remote','referer','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','sendStatus','json','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','count','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','show','Pause','rawAttributes','find','create','body','user','role','userProfileId','params','describe','ChatWebsiteId','Disposition','findOne','includeAll','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','applications','list','orderBy','priority','asc','account'];(function(_0x4d471b,_0x281167){var _0x54fd9b=function(_0x4d85b0){while(--_0x4d85b0){_0x4d471b['push'](_0x4d471b['shift']());}};_0x54fd9b(++_0x281167);}(_0xeb60,0x91));var _0x0eb6=function(_0x2c667e,_0x33d24b){_0x2c667e=_0x2c667e-0x0;var _0xf74e6f=_0xeb60[_0x2c667e];return _0xf74e6f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0eb6('0x0'));var util=require(_0x0eb6('0x1'));var path=require(_0x0eb6('0x2'));var ejs=require(_0x0eb6('0x3'));var fs=require('fs');var fs_extra=require(_0x0eb6('0x4'));var _=require('lodash');var querystring=require(_0x0eb6('0x5'));var Redis=require('ioredis');var qs=require(_0x0eb6('0x6'));var logger=require(_0x0eb6('0x7'))(_0x0eb6('0x8'));var config=require(_0x0eb6('0x9'));var db=require(_0x0eb6('0xa'))['db'];config[_0x0eb6('0xb')]=_[_0x0eb6('0xc')](config[_0x0eb6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eb6('0xd'))(new Redis(config['redis']));require(_0x0eb6('0xe'))[_0x0eb6('0xf')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0eb6('0x10')]({'port':0x232c});var client9002=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x232a});var client9003=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x232b});var client9001=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x271dbe,_0x20ee06,_0x1f869a,_0x3a7dff){return new BPromise(function(_0x28e97f,_0x334598){var _0x20dfaa=_0x3a7dff||client;return _0x20dfaa[_0x0eb6('0x12')](_0x271dbe,_0x1f869a)[_0x0eb6('0x13')](function(_0xae6eb4){logger[_0x0eb6('0x14')](_0x0eb6('0x15'),_0x20ee06,_0x0eb6('0x16'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x20ee06,_0x0eb6('0x16'),JSON[_0x0eb6('0x17')](_0xae6eb4));if(_0xae6eb4[_0x0eb6('0x18')]){if(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x19')]===0x1f4){logger[_0x0eb6('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x20ee06,_0xae6eb4['error'][_0x0eb6('0x1a')]);return _0x334598(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);}logger[_0x0eb6('0x18')](_0x0eb6('0x15'),_0x20ee06,_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);return _0x28e97f(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);}else{logger[_0x0eb6('0x14')](_0x0eb6('0x15'),_0x20ee06,_0x0eb6('0x16'));_0x28e97f(_0xae6eb4[_0x0eb6('0x1b')][_0x0eb6('0x1a')]);}})[_0x0eb6('0x1c')](function(_0x5aa9fe){logger[_0x0eb6('0x18')](_0x0eb6('0x15'),_0x20ee06,_0x5aa9fe);_0x334598(_0x5aa9fe);});});}function respondWithStatusCode(_0xed0d89,_0x157f0a){_0x157f0a=_0x157f0a||0xcc;return function(_0x7e665f){if(_0x7e665f){return _0xed0d89['sendStatus'](_0x157f0a);}return _0xed0d89['status'](_0x157f0a)[_0x0eb6('0x1d')]();};}function respondWithResult(_0x24fb08,_0x15d0c5){_0x15d0c5=_0x15d0c5||0xc8;return function(_0xb46291){if(_0xb46291){return _0x24fb08[_0x0eb6('0x1e')](_0x15d0c5)['json'](_0xb46291);}};}function respondWithFilteredResult(_0xe61e9a,_0xd4175d){return function(_0x2ab0c8){if(_0x2ab0c8){var _0x22b41c=typeof _0xd4175d[_0x0eb6('0x1f')]===_0x0eb6('0x20')&&typeof _0xd4175d['limit']===_0x0eb6('0x20');var _0x450321=_0x2ab0c8[_0x0eb6('0x21')];var _0x432f7e=_0x22b41c?0x0:_0xd4175d[_0x0eb6('0x1f')];var _0x4999ec=_0x22b41c?_0x2ab0c8[_0x0eb6('0x21')]:_0xd4175d[_0x0eb6('0x1f')]+_0xd4175d[_0x0eb6('0x22')];var _0x3c40bd;if(_0x4999ec>=_0x450321){_0x4999ec=_0x450321;_0x3c40bd=0xc8;}else{_0x3c40bd=0xce;}_0xe61e9a[_0x0eb6('0x1e')](_0x3c40bd);return _0xe61e9a[_0x0eb6('0x23')]('Content-Range',_0x432f7e+'-'+_0x4999ec+'/'+_0x450321)['json'](_0x2ab0c8);}return null;};}function saveUpdates(_0x11bec4){return function(_0x240384){if(_0x240384){return _0x240384[_0x0eb6('0x24')](_0x11bec4)['then'](function(_0x563b52){return _0x563b52;});}return null;};}function removeEntity(_0x3cee47){return function(_0xd9e3e6){if(_0xd9e3e6){return _0xd9e3e6[_0x0eb6('0x25')]()[_0x0eb6('0x13')](function(){var _0x410f4b=_0xd9e3e6[_0x0eb6('0x26')]({'plain':!![]});var _0x3791b9=_0x0eb6('0x27');return db[_0x0eb6('0x28')][_0x0eb6('0x25')]({'where':{'type':_0x3791b9,'resourceId':_0x410f4b['id']}})[_0x0eb6('0x13')](function(){return _0xd9e3e6;});})[_0x0eb6('0x13')](function(){_0x3cee47[_0x0eb6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dec85){return function(_0x4808d9){if(!_0x4808d9){_0x1dec85['sendStatus'](0x194);}return _0x4808d9;};}function handleError(_0x38a084,_0x52da8){_0x52da8=_0x52da8||0x1f4;return function(_0x5a23c2){logger[_0x0eb6('0x18')](_0x5a23c2[_0x0eb6('0x29')]);if(_0x5a23c2[_0x0eb6('0x2a')]){delete _0x5a23c2[_0x0eb6('0x2a')];}_0x38a084[_0x0eb6('0x1e')](_0x52da8)[_0x0eb6('0x2b')](_0x5a23c2);};}exports[_0x0eb6('0x2c')]=function(_0xc9b02f,_0x442d09){var _0x1aee95={'include':[{'model':db['Pause'],'as':_0x0eb6('0x2d')}]},_0x16f0da={},_0x2d78ce={'count':0x0,'rows':[]};var _0x1fea21=_['map'](db[_0x0eb6('0x2e')]['rawAttributes'],function(_0x408df9){return{'name':_0x408df9['fieldName'],'type':_0x408df9[_0x0eb6('0x2f')][_0x0eb6('0x30')]};});_0x16f0da[_0x0eb6('0x31')]=_[_0x0eb6('0x32')](_0x1fea21,_0x0eb6('0x2a'));_0x16f0da[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0xc9b02f[_0x0eb6('0x33')]);_0x16f0da[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x16f0da[_0x0eb6('0x31')],_0x16f0da[_0x0eb6('0x33')]);_0x1aee95[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x16f0da[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0xc9b02f[_0x0eb6('0x33')]['fields']));_0x1aee95[_0x0eb6('0x37')]=_0x1aee95[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x1aee95[_0x0eb6('0x37')]:_0x16f0da['model'];if(!_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x1aee95[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1aee95[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0xc9b02f['query']['offset']);}_0x1aee95['order']=qs[_0x0eb6('0x3c')](_0xc9b02f['query'][_0x0eb6('0x3c')]);_0x1aee95['where']=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0xc9b02f[_0x0eb6('0x33')],_0x16f0da[_0x0eb6('0x35')]),_0x1fea21);if(_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x3e')]){_0x1aee95[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x1aee95['where'],{'$or':_['map'](_0x1fea21,function(_0x1c4a49){if(_0x1c4a49[_0x0eb6('0x2f')]!=='VIRTUAL'){var _0xaa87b3={};_0xaa87b3[_0x1c4a49[_0x0eb6('0x2a')]]={'$like':'%'+_0xc9b02f[_0x0eb6('0x33')]['filter']+'%'};return _0xaa87b3;}})});}_0x1aee95=_[_0x0eb6('0x40')]({},_0x1aee95,_0xc9b02f[_0x0eb6('0x41')]);var _0x2b6b1f={'where':_0x1aee95[_0x0eb6('0x3f')]};return db[_0x0eb6('0x2e')][_0x0eb6('0x21')](_0x2b6b1f)[_0x0eb6('0x13')](function(_0x29130b){_0x2d78ce[_0x0eb6('0x21')]=_0x29130b;if(_0xc9b02f[_0x0eb6('0x33')]['includeAll']){_0x1aee95[_0x0eb6('0x42')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1aee95);})[_0x0eb6('0x13')](function(_0x658ab8){_0x2d78ce['rows']=_0x658ab8;return _0x2d78ce;})[_0x0eb6('0x13')](respondWithFilteredResult(_0x442d09,_0x1aee95))[_0x0eb6('0x1c')](handleError(_0x442d09,null));};exports[_0x0eb6('0x43')]=function(_0x1ec909,_0x524878){var _0x2ee996={'raw':![],'where':{'id':_0x1ec909['params']['id']},'include':[{'model':db[_0x0eb6('0x44')],'as':_0x0eb6('0x2d')}]},_0x103415={};_0x103415[_0x0eb6('0x31')]=_[_0x0eb6('0x34')](db[_0x0eb6('0x2e')][_0x0eb6('0x45')]);_0x103415[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x1ec909[_0x0eb6('0x33')]);_0x103415['filters']=_[_0x0eb6('0x36')](_0x103415[_0x0eb6('0x31')],_0x103415['query']);_0x2ee996['attributes']=_[_0x0eb6('0x36')](_0x103415['model'],qs[_0x0eb6('0x38')](_0x1ec909[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x2ee996[_0x0eb6('0x37')]=_0x2ee996[_0x0eb6('0x37')]['length']?_0x2ee996[_0x0eb6('0x37')]:_0x103415[_0x0eb6('0x31')];if(_0x1ec909[_0x0eb6('0x33')]['includeAll']){_0x2ee996[_0x0eb6('0x42')]=[{'all':!![]}];}_0x2ee996=_[_0x0eb6('0x40')]({},_0x2ee996,_0x1ec909[_0x0eb6('0x41')]);return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x2ee996)[_0x0eb6('0x13')](handleEntityNotFound(_0x524878,null))['then'](respondWithResult(_0x524878,null))[_0x0eb6('0x1c')](handleError(_0x524878,null));};exports[_0x0eb6('0x47')]=function(_0x2ba18f,_0x329f2e){return db[_0x0eb6('0x2e')][_0x0eb6('0x47')](_0x2ba18f[_0x0eb6('0x48')],{})[_0x0eb6('0x13')](function(_0x2a58a6){var _0x20edfc=_0x2ba18f[_0x0eb6('0x49')][_0x0eb6('0x26')]({'plain':!![]});if(!_0x20edfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20edfc[_0x0eb6('0x4a')]===_0x0eb6('0x49')){var _0x1807c4=_0x2a58a6[_0x0eb6('0x26')]({'plain':!![]});var _0x152e26=_0x0eb6('0x27');return db['UserProfileSection'][_0x0eb6('0x46')]({'where':{'name':_0x152e26,'userProfileId':_0x20edfc[_0x0eb6('0x4b')]},'raw':!![]})[_0x0eb6('0x13')](function(_0x2864b1){if(_0x2864b1&&_0x2864b1['autoAssociation']===0x0){return db[_0x0eb6('0x28')]['create']({'name':_0x1807c4['name'],'resourceId':_0x1807c4['id'],'type':_0x2864b1['name'],'sectionId':_0x2864b1['id']},{})[_0x0eb6('0x13')](function(){return _0x2a58a6;});}else{return _0x2a58a6;}})[_0x0eb6('0x1c')](function(_0xd69927){logger[_0x0eb6('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd69927);throw _0xd69927;});}return _0x2a58a6;})['then'](respondWithResult(_0x329f2e,0xc9))[_0x0eb6('0x1c')](handleError(_0x329f2e,null));};exports[_0x0eb6('0x24')]=function(_0x2768fc,_0x16c07b){if(_0x2768fc[_0x0eb6('0x48')]['id']){delete _0x2768fc[_0x0eb6('0x48')]['id'];}return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x2768fc[_0x0eb6('0x4c')]['id']},'include':[{'model':db[_0x0eb6('0x44')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x16c07b,null))[_0x0eb6('0x13')](saveUpdates(_0x2768fc[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x16c07b,null))[_0x0eb6('0x1c')](handleError(_0x16c07b,null));};exports[_0x0eb6('0x25')]=function(_0x584bd4,_0x21d1f7){return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x584bd4[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x21d1f7,null))[_0x0eb6('0x13')](removeEntity(_0x21d1f7,null))[_0x0eb6('0x1c')](handleError(_0x21d1f7,null));};exports[_0x0eb6('0x4d')]=function(_0x176de5,_0x15cc0d){return db[_0x0eb6('0x2e')][_0x0eb6('0x4d')]()[_0x0eb6('0x13')](respondWithResult(_0x15cc0d,null))['catch'](handleError(_0x15cc0d,null));};exports['addDisposition']=function(_0x4b068e,_0x59af17){if(_0x4b068e[_0x0eb6('0x48')]['id']){delete _0x4b068e['body']['id'];}return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x4b068e[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x59af17,null))[_0x0eb6('0x13')](function(_0x18a646){if(_0x18a646){_0x4b068e['body'][_0x0eb6('0x4e')]=_0x18a646['id'];return db[_0x0eb6('0x4f')][_0x0eb6('0x47')](_0x4b068e[_0x0eb6('0x48')]);}})[_0x0eb6('0x13')](respondWithResult(_0x59af17,null))['catch'](handleError(_0x59af17,null));};exports['getDispositions']=function(_0x4ee7de,_0x1199e1){var _0x3ba92e={'raw':![],'where':{}};var _0x170069={};var _0x43f3eb={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x4ee7de[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1199e1,null))[_0x0eb6('0x13')](function(_0x72094d){if(_0x72094d){_0x170069[_0x0eb6('0x31')]=_['keys'](db[_0x0eb6('0x4f')][_0x0eb6('0x45')]);_0x170069['query']=_[_0x0eb6('0x34')](_0x4ee7de[_0x0eb6('0x33')]);_0x170069[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x170069[_0x0eb6('0x31')],_0x170069['query']);_0x3ba92e['attributes']=_[_0x0eb6('0x36')](_0x170069[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x4ee7de[_0x0eb6('0x33')]['fields']));_0x3ba92e['attributes']=_0x3ba92e['attributes'][_0x0eb6('0x39')]?_0x3ba92e[_0x0eb6('0x37')]:_0x170069[_0x0eb6('0x31')];if(!_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x3a')]('nolimit')){_0x3ba92e['limit']=qs[_0x0eb6('0x22')](_0x4ee7de['query'][_0x0eb6('0x22')]);_0x3ba92e['offset']=qs['offset'](_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x3ba92e['order']=qs['sort'](_0x4ee7de[_0x0eb6('0x33')]['sort']);_0x3ba92e[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_['pick'](_0x4ee7de[_0x0eb6('0x33')],_0x170069['filters']));_0x3ba92e[_0x0eb6('0x3f')]['ChatWebsiteId']=_0x72094d['id'];if(_0x4ee7de['query'][_0x0eb6('0x3e')]){_0x3ba92e[_0x0eb6('0x3f')]=_['merge'](_0x3ba92e[_0x0eb6('0x3f')],{'$or':_['map'](_0x3ba92e[_0x0eb6('0x37')],function(_0x4ed1c8){var _0x12f43a={};_0x12f43a[_0x4ed1c8]={'$like':'%'+_0x4ee7de['query']['filter']+'%'};return _0x12f43a;})});}_0x3ba92e=_[_0x0eb6('0x40')]({},_0x3ba92e,_0x4ee7de[_0x0eb6('0x41')]);return db[_0x0eb6('0x4f')][_0x0eb6('0x21')]({'where':_0x3ba92e[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x15ed2a){_0x43f3eb[_0x0eb6('0x21')]=_0x15ed2a;if(_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x3ba92e[_0x0eb6('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x0eb6('0x52')](_0x3ba92e);})[_0x0eb6('0x13')](function(_0x59ccc4){_0x43f3eb[_0x0eb6('0x53')]=_0x59ccc4;return _0x43f3eb;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x1199e1,_0x3ba92e))['catch'](handleError(_0x1199e1,null));};exports[_0x0eb6('0x54')]=function(_0x103ab6,_0x204983){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x103ab6['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x204983,null))['then'](function(_0x34c865){if(_0x34c865){return _0x34c865[_0x0eb6('0x54')](_0x103ab6['query'][_0x0eb6('0x55')]);}})[_0x0eb6('0x13')](respondWithStatusCode(_0x204983,null))[_0x0eb6('0x1c')](handleError(_0x204983,null));};exports[_0x0eb6('0x56')]=function(_0x58ad1a,_0x1e1439){if(_0x58ad1a[_0x0eb6('0x48')]['id']){delete _0x58ad1a['body']['id'];}return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x58ad1a['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1e1439,null))[_0x0eb6('0x13')](function(_0x880a43){if(_0x880a43){_0x58ad1a[_0x0eb6('0x48')][_0x0eb6('0x4e')]=_0x880a43['id'];return db[_0x0eb6('0x57')][_0x0eb6('0x47')](_0x58ad1a[_0x0eb6('0x48')]);}})[_0x0eb6('0x13')](respondWithResult(_0x1e1439,null))['catch'](handleError(_0x1e1439,null));};exports['getAnswers']=function(_0x407b5c,_0x4907a0){var _0x2e057c={'raw':![],'where':{}};var _0x4c5e38={};var _0x1e8fc7={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x407b5c[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x4907a0,null))['then'](function(_0x529e4f){if(_0x529e4f){_0x4c5e38['model']=_[_0x0eb6('0x34')](db[_0x0eb6('0x57')][_0x0eb6('0x45')]);_0x4c5e38[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x407b5c[_0x0eb6('0x33')]);_0x4c5e38[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x4c5e38[_0x0eb6('0x31')],_0x4c5e38[_0x0eb6('0x33')]);_0x2e057c[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x4c5e38[_0x0eb6('0x31')],qs['fields'](_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x2e057c['attributes']=_0x2e057c[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x2e057c[_0x0eb6('0x37')]:_0x4c5e38[_0x0eb6('0x31')];if(!_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x2e057c[_0x0eb6('0x22')]=qs['limit'](_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x2e057c[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x407b5c[_0x0eb6('0x33')]['offset']);}_0x2e057c[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x407b5c['query'][_0x0eb6('0x3c')]);_0x2e057c['where']=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x407b5c[_0x0eb6('0x33')],_0x4c5e38[_0x0eb6('0x35')]));_0x2e057c['where'][_0x0eb6('0x4e')]=_0x529e4f['id'];if(_0x407b5c['query'][_0x0eb6('0x3e')]){_0x2e057c['where']=_[_0x0eb6('0x40')](_0x2e057c['where'],{'$or':_[_0x0eb6('0x32')](_0x2e057c[_0x0eb6('0x37')],function(_0x1c5b54){var _0x3033ed={};_0x3033ed[_0x1c5b54]={'$like':'%'+_0x407b5c['query']['filter']+'%'};return _0x3033ed;})});}_0x2e057c=_['merge']({},_0x2e057c,_0x407b5c[_0x0eb6('0x41')]);return db['CannedAnswer'][_0x0eb6('0x21')]({'where':_0x2e057c[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x3515d2){_0x1e8fc7[_0x0eb6('0x21')]=_0x3515d2;if(_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x2e057c[_0x0eb6('0x42')]=[{'all':!![]}];}return db[_0x0eb6('0x57')]['findAll'](_0x2e057c);})[_0x0eb6('0x13')](function(_0x3f8c9f){_0x1e8fc7[_0x0eb6('0x53')]=_0x3f8c9f;return _0x1e8fc7;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x4907a0,_0x2e057c))['catch'](handleError(_0x4907a0,null));};exports[_0x0eb6('0x59')]=function(_0x547bcd,_0x2b663a){return db[_0x0eb6('0x2e')]['find']({'where':{'id':_0x547bcd[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b663a,null))['then'](function(_0x395341){if(_0x395341){return _0x395341[_0x0eb6('0x59')](_0x547bcd[_0x0eb6('0x33')][_0x0eb6('0x55')]);}})[_0x0eb6('0x13')](respondWithStatusCode(_0x2b663a,null))[_0x0eb6('0x1c')](handleError(_0x2b663a,null));};exports[_0x0eb6('0x5a')]=function(_0x518da9,_0x534a34){_0x518da9['body'][_0x0eb6('0x5b')]=_0x518da9[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x518da9[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x534a34,null))[_0x0eb6('0x13')](saveUpdates(_0x518da9[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x534a34,null))[_0x0eb6('0x1c')](handleError(_0x534a34,null));};exports['addAvatar']=function(_0x31b16f,_0x209eb7){_0x31b16f['body'][_0x0eb6('0x5e')]=_0x31b16f[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x31b16f['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x209eb7,null))['then'](saveUpdates(_0x31b16f[_0x0eb6('0x48')],null))['then'](respondWithResult(_0x209eb7,null))['catch'](handleError(_0x209eb7,null));};exports[_0x0eb6('0x5f')]=function(_0x16cd1d,_0x49d1cd){_0x16cd1d['body'][_0x0eb6('0x60')]=_0x16cd1d['file']['filename'];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x16cd1d[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49d1cd,null))[_0x0eb6('0x13')](saveUpdates(_0x16cd1d[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x49d1cd,null))['catch'](handleError(_0x49d1cd,null));};exports[_0x0eb6('0x61')]=function(_0x46be2f,_0x3b8677){_0x46be2f[_0x0eb6('0x48')]['systemAvatar']=_0x46be2f[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x46be2f[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b8677,null))[_0x0eb6('0x13')](saveUpdates(_0x46be2f[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x3b8677,null))[_0x0eb6('0x1c')](handleError(_0x3b8677,null));};exports[_0x0eb6('0x62')]=function(_0x340963,_0x5115aa){var _0x43b76d=path['join'](config[_0x0eb6('0x63')],_0x0eb6('0x64'));var _0x1c4370={'where':{'id':_0x340963['params']['id']},'attributes':['id',_0x0eb6('0x5b')],'raw':!![]};var _0x262a44=![];return require(_0x0eb6('0x65'))[_0x0eb6('0x66')]()[_0x0eb6('0x13')](function(_0xddc839){if(_0xddc839){_0x262a44=_0xddc839[_0x0eb6('0x67')];}})['then'](function(){return db[_0x0eb6('0x2e')]['find'](_0x1c4370);})[_0x0eb6('0x13')](handleEntityNotFound(_0x5115aa,null))['then'](function(_0x1e1205){if(_0x1e1205){if(!_['isNil'](_0x1e1205[_0x0eb6('0x5b')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6a'),_0x1e1205[_0x0eb6('0x5b')]))&&_0x262a44){_0x43b76d=path['join'](config[_0x0eb6('0x63')],'server/files/images/logos/',_0x1e1205[_0x0eb6('0x5b')]);}}return _0x5115aa[_0x0eb6('0x6b')](_0x43b76d);}})[_0x0eb6('0x1c')](handleError(_0x5115aa,null));};exports[_0x0eb6('0x6c')]=function(_0x26755a,_0x341e23){var _0x259adf=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6d'));var _0x2259c8={'where':{'id':_0x26755a[_0x0eb6('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x2259c8)[_0x0eb6('0x13')](handleEntityNotFound(_0x341e23,null))['then'](function(_0x3fe773){if(_0x3fe773){if(!_[_0x0eb6('0x6e')](_0x3fe773['agentAvatar'])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6f'),_0x3fe773['agentAvatar']))){_0x259adf=path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6f'),_0x3fe773[_0x0eb6('0x5e')]);}}return _0x341e23[_0x0eb6('0x6b')](_0x259adf);}})[_0x0eb6('0x1c')](handleError(_0x341e23,null));};exports[_0x0eb6('0x70')]=function(_0x20f149,_0xe248b8){var _0x56990a=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x71'));var _0x1bc55f={'where':{'id':_0x20f149[_0x0eb6('0x4c')]['id']},'attributes':['id',_0x0eb6('0x60'),_0x0eb6('0x72')],'raw':!![]};return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x1bc55f)['then'](handleEntityNotFound(_0xe248b8,null))[_0x0eb6('0x13')](function(_0x2b5971){if(_0x2b5971){if(!_[_0x0eb6('0x6e')](_0x2b5971[_0x0eb6('0x60')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6f'),_0x2b5971[_0x0eb6('0x60')]))&&_0x2b5971['showCustomerAvatar']){_0x56990a=path['join'](config['root'],_0x0eb6('0x6f'),_0x2b5971[_0x0eb6('0x60')]);}}return _0xe248b8[_0x0eb6('0x6b')](_0x56990a);}})[_0x0eb6('0x1c')](handleError(_0xe248b8,null));};exports[_0x0eb6('0x73')]=function(_0x3849bd,_0xe774ca){var _0x583a29=path['join'](config['root'],_0x0eb6('0x74'));var _0x330531={'where':{'id':_0x3849bd[_0x0eb6('0x4c')]['id']},'attributes':['id',_0x0eb6('0x75')],'raw':!![]};return db['ChatWebsite'][_0x0eb6('0x46')](_0x330531)[_0x0eb6('0x13')](handleEntityNotFound(_0xe774ca,null))[_0x0eb6('0x13')](function(_0x4b69dc){if(_0x4b69dc){if(!_[_0x0eb6('0x6e')](_0x4b69dc[_0x0eb6('0x75')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],'server/files/images/avatars/',_0x4b69dc[_0x0eb6('0x75')]))){_0x583a29=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6f'),_0x4b69dc[_0x0eb6('0x75')]);}}return _0xe774ca[_0x0eb6('0x6b')](_0x583a29);}})['catch'](handleError(_0xe774ca,null));};exports[_0x0eb6('0x76')]=function(_0x5dab6e,_0x2827c0){var _0x5787a3=require(_0x0eb6('0x77'));var _0x1db7c6=new _0x5787a3();var _0x3aeeb6=_0x1db7c6[_0x0eb6('0x78')](_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x7a')])[_0x0eb6('0x7b')]();var _0x120843={'body':_0x5dab6e['body'],'channel':_0x0eb6('0x7c')};var _0x1551ce=[];var _0x2f46ac=[];var _0x3e856e={};var _0x40582c=![];return db[_0x0eb6('0x7d')][_0x0eb6('0x4d')]()[_0x0eb6('0x13')](function(_0x4d8e29){if(!_0x4d8e29){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x7f'));}_0x1551ce=_[_0x0eb6('0x80')](_[_0x0eb6('0x34')](_0x4d8e29),[_0x0eb6('0x81'),'updatedAt']);_0x2f46ac=_['difference'](_[_0x0eb6('0x34')](_0x4d8e29),[_0x0eb6('0x81'),_0x0eb6('0x82'),_0x0eb6('0x83'),_0x0eb6('0x84')]);if(_0x5dab6e[_0x0eb6('0x48')]['id']){delete _0x5dab6e[_0x0eb6('0x48')]['id'];}if(_['isNil'](_0x5dab6e['body'][_0x0eb6('0x85')])){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x87'));}if(_[_0x0eb6('0x6e')](_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x48')])||_0x5dab6e[_0x0eb6('0x48')]['body']===''){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x88'));}if(_[_0x0eb6('0x6e')](_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x89')])){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x8a')+_0x2f46ac);}if(!_[_0x0eb6('0x8b')](_0x2f46ac,_0x5dab6e['body']['mapKey'])){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x8c')+_0x2f46ac);}_0x3e856e[_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x89')]]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x85')];})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x5dab6e[_0x0eb6('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0x0eb6('0x8d'),'include':[{'model':db['CmContact'],'as':_0x0eb6('0x8e'),'where':_0x3e856e,'limit':0x1,'order':[[_0x0eb6('0x82'),_0x0eb6('0x8f')]]}]},{'model':db[_0x0eb6('0x90')],'as':'Applications'}]});})[_0x0eb6('0x13')](handleEntityNotFound(_0x2827c0,null))[_0x0eb6('0x13')](function(_0x93e277){if(_0x93e277&&_0x93e277[_0x0eb6('0x8d')]){_0x120843['account']=_0x93e277;_0x120843[_0x0eb6('0x91')]=_0x93e277['Applications'];_0x120843[_0x0eb6('0x92')]=_0x93e277[_0x0eb6('0x8d')];_0x120843[_0x0eb6('0x91')]=_[_0x0eb6('0x93')](_0x120843[_0x0eb6('0x91')],[_0x0eb6('0x94')],[_0x0eb6('0x95')]);if(_0x120843[_0x0eb6('0x96')][_0x0eb6('0x97')]){delete _0x120843[_0x0eb6('0x96')]['Applications'];}if(_0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')]&&_0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')][_0x0eb6('0x8e')][_0x0eb6('0x39')]){return _0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')][_0x0eb6('0x8e')][0x0];}var _0x1906af=_[_0x0eb6('0xc')](_0x5dab6e['body'],{'firstName':_0x5dab6e[_0x0eb6('0x48')]['from'],'ListId':_0x93e277[_0x0eb6('0x84')]});_0x1906af[_0x5dab6e[_0x0eb6('0x48')]['mapKey']]=_0x5dab6e[_0x0eb6('0x48')]['from'];return db['CmContact'][_0x0eb6('0x47')](_0x1906af,{'fields':_0x1551ce,'raw':!![]});}})['then'](handleEntityNotFound(_0x2827c0,null))[_0x0eb6('0x13')](function(_0x38d771){_0x120843[_0x0eb6('0x98')]=_0x38d771;var _0x2c92ea=_0x5dab6e['body'][_0x0eb6('0x99')];if(_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9a')]){_0x2c92ea=_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9a')];}else if(_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9b')]){_0x2c92ea=_['first'](_0x5dab6e[_0x0eb6('0x79')]['x-forwarded-for']['split'](','));}if(_0x38d771){var _0x506aee={'ContactId':_0x38d771['id'],'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'from':(_0x38d771[_0x0eb6('0x9c')]||'')+'\x20'+(_0x38d771[_0x0eb6('0x9d')]||''),'customerIp':_0x2c92ea,'customerPort':_0x5dab6e[_0x0eb6('0x79')]['x-real-port']?_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9e')]:null,'referer':_0x5dab6e[_0x0eb6('0x48')]['referer'],'browserName':_0x3aeeb6[_0x0eb6('0x9f')][_0x0eb6('0x2a')]&&_0x3aeeb6[_0x0eb6('0x9f')][_0x0eb6('0xa0')]?util['format']('%s\x20%s',_0x3aeeb6['browser']['name'],_0x3aeeb6['browser'][_0x0eb6('0xa0')]):_0x0eb6('0xa1'),'browserVersion':_0x3aeeb6[_0x0eb6('0x9f')]['version']||_0x0eb6('0xa1'),'osName':util[_0x0eb6('0xa2')](_0x0eb6('0xa3'),_0x3aeeb6['os']['name'],_0x3aeeb6['os'][_0x0eb6('0xa0')]),'osVersion':_0x3aeeb6['os'][_0x0eb6('0xa0')],'deviceModel':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x31')]&&_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0xa5')]?util[_0x0eb6('0xa2')](_0x0eb6('0xa6'),_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x31')],_0x3aeeb6[_0x0eb6('0xa4')]['vendor'],_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x2f')]):null,'deviceVendor':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0xa5')],'deviceType':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x2f')],'formData':JSON['stringify'](_0x5dab6e['body'])};var _0xbcbee3={'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'closed':![]};if(_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')]){_0xbcbee3['threadId']=_0x5dab6e['body'][_0x0eb6('0xa7')];return db['ChatInteraction'][_0x0eb6('0x46')]({'where':_0xbcbee3})[_0x0eb6('0x13')](function(_0x2228dc){if(_0x2228dc){return[_0x2228dc,![]];}_0x506aee[_0x0eb6('0xa7')]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')];_0x506aee[_0x0eb6('0xa8')]=_0x5dab6e['body'][_0x0eb6('0xa8')];return db[_0x0eb6('0xa9')][_0x0eb6('0x47')](_0x506aee)[_0x0eb6('0x13')](function(_0x316c96){return[_0x316c96,!![]];});});}_0xbcbee3[_0x0eb6('0xaa')]=_0x38d771['id'];if(_0x5dab6e[_0x0eb6('0x48')]['interaction']&&_0x5dab6e['body'][_0x0eb6('0xab')]['id']){_0xbcbee3['id']=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xab')]['id'];return db[_0x0eb6('0xa9')][_0x0eb6('0x46')]({'where':_0xbcbee3})[_0x0eb6('0x13')](function(_0x2066e2){if(_0x2066e2){return[_0x2066e2,![]];}return db['ChatInteraction'][_0x0eb6('0x47')](_0x506aee)[_0x0eb6('0x13')](function(_0x15becb){return[_0x15becb,!![]];});});}return db['ChatInteraction']['create'](_0x506aee)[_0x0eb6('0x13')](function(_0xe73e24){return[_0xe73e24,!![]];});}})['spread'](function(_0x15317d,_0x8e72cf){if(_0x15317d){_0x40582c=_0x8e72cf;if(!_0x8e72cf){var _0x418d2e={'from':(_0x120843['contact'][_0x0eb6('0x9c')]||'')+'\x20'+(_0x120843[_0x0eb6('0x98')]['lastName']||'')};if(_0x5dab6e[_0x0eb6('0x48')]['threadId']&&_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')]&&_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')]!=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')]){_0x418d2e[_0x0eb6('0xa7')]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')];}return _0x15317d[_0x0eb6('0x24')](_0x418d2e);}else{return _0x15317d;}}})[_0x0eb6('0x13')](function(_0x457671){_0x120843[_0x0eb6('0xab')]=_0x457671[_0x0eb6('0x26')]({'plain':!![]});_0x120843[_0x0eb6('0xab')][_0x0eb6('0xad')]=_0x40582c;if(_0x120843['interaction'][_0x0eb6('0xad')]){if(_0x120843['account']['autoclose']){_0x120843[_0x0eb6('0x91')]['push']({'id':0x0,'priority':_0x120843['applications'][_0x0eb6('0x39')]+0x1,'app':_0x0eb6('0xae'),'appdata':_0x0eb6('0xaf'),'interval':_0x0eb6('0xb0')});}}return db[_0x0eb6('0xb1')][_0x0eb6('0x47')]({'body':_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x48')],'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'ChatInteractionId':_0x457671['id'],'direction':'in','ContactId':_0x120843[_0x0eb6('0x98')]['id'],'AttachmentId':_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xb2')]});})[_0x0eb6('0x13')](function(_0x14b7f6){_0x120843[_0x0eb6('0x1a')]=_0x14b7f6;if(_0x120843[_0x0eb6('0xab')][_0x0eb6('0xb3')]){return db[_0x0eb6('0xb4')][_0x0eb6('0x46')]({'attributes':['id',_0x0eb6('0x2a')],'where':{'id':_0x120843['interaction']['UserId']}})[_0x0eb6('0x13')](function(_0x5df035){if(_0x5df035){_0x120843['applications'][_0x0eb6('0xb5')]({'id':0x0,'priority':0x0,'app':_0x0eb6('0xb6'),'appdata':_0x5df035[_0x0eb6('0x2a')]+','+(_0x120843[_0x0eb6('0x96')]['waitForTheAssignedAgent']||0xa),'interval':_0x0eb6('0xb0')});_0x120843['forcedOwnership']=!![];}return respondWithRpcPromise(_0x0eb6('0xb7'),_0x0eb6('0xb8'),_0x120843);});}return respondWithRpcPromise('Start',_0x0eb6('0xb8'),_0x120843);})[_0x0eb6('0x13')](function(_0xfaa49){respondWithRpcPromise(_0x0eb6('0xb9'),'EventManager',{'event':_0x0eb6('0x76'),'message':_0xfaa49},client9002);return _0xfaa49;})[_0x0eb6('0x13')](respondWithResult(_0x2827c0,null))[_0x0eb6('0x1c')](handleError(_0x2827c0,null));};exports[_0x0eb6('0xba')]=function(_0x51f686,_0x24055a){var _0x52f407,_0x29ffab,_0x3562c4;var _0x3513fc=[];var _0x2135a8={};var _0x312322=_0x51f686[_0x0eb6('0xbb')]||[];var _0xf4aae4=[];var _0x178968;return db[_0x0eb6('0x7d')][_0x0eb6('0x4d')]()['then'](function(_0x188494){if(!_0x188494){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x7f'));}_0x3513fc=_['difference'](_[_0x0eb6('0x34')](_0x188494),[_0x0eb6('0x81'),'updatedAt',_0x0eb6('0x83'),_0x0eb6('0x84')]);if(_0x51f686['body']['id']){delete _0x51f686['body']['id'];}if(_[_0x0eb6('0x6e')](_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')])){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)['send'](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x87')));}if(_['isNil'](_0x51f686[_0x0eb6('0x48')]['body'])||_0x51f686[_0x0eb6('0x48')]['body']===''){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)[_0x0eb6('0x2b')](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x88')));}if(_[_0x0eb6('0x6e')](_0x51f686['body'][_0x0eb6('0xbc')])){throw _0x24055a['status'](0x1f4)[_0x0eb6('0x2b')](new db['Sequelize']['ValidationError'](_0x0eb6('0xbd')+_0x3513fc));}if(!_['includes'](_0x3513fc,_0x51f686[_0x0eb6('0x48')][_0x0eb6('0xbc')])){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)[_0x0eb6('0x2b')](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0xbe')+_0x3513fc));}_0x2135a8[_0x51f686['body'][_0x0eb6('0xbc')]]=_0x51f686['body'][_0x0eb6('0x85')];})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x51f686[_0x0eb6('0x4c')]['id']},'include':[{'model':db[_0x0eb6('0xbf')],'as':_0x0eb6('0x8d')},{'model':db['MailAccount'],'as':_0x0eb6('0xc0')}]});})[_0x0eb6('0x13')](handleEntityNotFound(_0x24055a,null))[_0x0eb6('0x13')](function(_0xa641cb){if(_0xa641cb&&_0xa641cb[_0x0eb6('0x8d')]){_0x29ffab=_0xa641cb;var _0xd5b127=_[_0x0eb6('0xc')](_0x51f686[_0x0eb6('0x48')],{'firstName':_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')],'phone':_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')],'ListId':_0xa641cb[_0x0eb6('0x84')]});_0xd5b127[_0x51f686[_0x0eb6('0x48')]['mapKeyOffline']]=_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')];return db[_0x0eb6('0x7d')][_0x0eb6('0xc1')]({'where':_0x2135a8,'defaults':_0xd5b127});}})['spread'](function(_0x2055e5){if(_0x2055e5){_0x3562c4=_0x2055e5;var _0x185fcf=fs[_0x0eb6('0xc2')](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xc3')),'utf8');var _0x19f990=ejs[_0x0eb6('0xc4')](_0x185fcf,{'body':_[_0x0eb6('0xc5')](_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x48')]),'bodyTitle':_0x29ffab[_0x0eb6('0xc6')]});return db[_0x0eb6('0xc7')][_0x0eb6('0x47')]({'body':_0x19f990,'ContactId':_0x2055e5['id'],'ChatWebsiteId':_0x29ffab['id']});}})[_0x0eb6('0x13')](function(_0x48428d){_0x178968=_0x48428d;if(_0x312322['length']){var _0x5bbe6a=_0x312322[_0x0eb6('0x32')](function(_0x27af42){return{'name':_0x27af42[_0x0eb6('0xc8')],'basename':_0x27af42[_0x0eb6('0x5d')],'type':_0x27af42[_0x0eb6('0xc9')],'ChatOfflineMessageId':_0x48428d['id']};});_0xf4aae4=_0x5bbe6a['map'](_0x486d83=>{var _0x473995={'filename':_0x486d83[_0x0eb6('0x2a')],'path':path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xca'),_0x0eb6('0xbb'),'attachments',_0x0eb6('0xcb'),_0x486d83['basename'])};return _0x473995;});if(!_0x29ffab['openNewInteraction']){return db[_0x0eb6('0xcc')][_0x0eb6('0xcd')](function(_0x5d3667){return db['Attachment']['bulkCreate'](_0x5bbe6a,{'transaction':_0x5d3667});});}}})['then'](function(){if(_0x178968){_0x52f407=_0x178968;return db[_0x0eb6('0xc0')][_0x0eb6('0x50')]({'where':{'active':!![]},'include':[{'model':db[_0x0eb6('0xce')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x220def){if(_0x220def&&_0x220def['Smtp']&&_0x29ffab[_0x0eb6('0xcf')]&&_0x29ffab['forwardOfflineAddress']){var _0x2a476d={'tls':{'rejectUnauthorized':![]}};if(_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd1')]){_0x2a476d[_0x0eb6('0xd1')]=_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd1')];}else{_0x2a476d[_0x0eb6('0xd2')]=_0x220def[_0x0eb6('0xd0')]['host'];_0x2a476d['port']=_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd3')];_0x2a476d['secure']=_0x220def[_0x0eb6('0xd0')]['secure'];}if(_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd4')]){_0x2a476d['auth']={'user':_0x220def[_0x0eb6('0xd0')]['user'],'pass':_0x220def['Smtp'][_0x0eb6('0xd5')]};}return respondWithRpcPromise(_0x0eb6('0xd6'),_0x0eb6('0xd7'),{'account':_0x2a476d,'message':{'from':util[_0x0eb6('0xa2')](_0x0eb6('0xd8'),_0x220def[_0x0eb6('0x2a')],_0x220def[_0x0eb6('0xd9')]||_0x220def[_0x0eb6('0xd0')][_0x0eb6('0x49')]),'to':_0x29ffab[_0x0eb6('0xda')],'subject':_0x29ffab[_0x0eb6('0xdb')],'html':_0x52f407['body'],'attachments':_0xf4aae4}},client9003)[_0x0eb6('0x13')](function(){return _0x52f407;})['catch'](function(_0x54f5e5){console[_0x0eb6('0x18')](_0x54f5e5);});}})[_0x0eb6('0x13')](function(){if(_0x29ffab&&_0x29ffab[_0x0eb6('0xdc')]&&_0x29ffab[_0x0eb6('0xdd')]){var _0x4c9be1=[];if(_0x312322[_0x0eb6('0x39')]){_0x4c9be1=_0x312322['map'](function(_0x32e415){return{'name':_0x32e415[_0x0eb6('0xc8')],'basename':_0x32e415[_0x0eb6('0x5d')],'type':_0x32e415[_0x0eb6('0xc9')],'ChatOfflineMessageId':_0x178968['id']};});}var _0x441674;if(!_[_0x0eb6('0x6e')](_0x29ffab['subjectOffline'])){var _0x12bd3a=_[_0x0eb6('0x32')](_0x51f686[_0x0eb6('0x48')],function(_0x45e5a5){return _0x45e5a5;});var _0x498978=_[_0x0eb6('0xde')](_0x12bd3a)[0x0];var _0x13ff17=_[_0x0eb6('0xdf')](_0x498978,function(_0x6eda9){return _0x6eda9;});_0x441674=_0x13ff17[0x1][_0x29ffab[_0x0eb6('0xe0')]];}var _0x4590fb={'from':_0x3562c4[_0x0eb6('0xd9')],'firstName':_0x3562c4[_0x0eb6('0x9c')],'lastName':_0x3562c4['lastName'],'mapKey':'email','message':{'from':_0x3562c4['email'],'to':_0x29ffab['MailAccount'][_0x0eb6('0xd9')],'cc':'','subject':_['isNil'](_0x441674)?_0x29ffab['offlineMessageSubject']:_0x441674,'messageId':'','sentAt':new Date(),'attach':_0x4c9be1[_0x0eb6('0x39')],'attachments':_0x4c9be1,'originChannel':_0x0eb6('0xe1'),'ChatWebsiteId':_0x29ffab['id'],'ChatOfflineMessageId':_0x52f407['id'],'originTo':_0x29ffab[_0x0eb6('0xc0')][_0x0eb6('0xd9')]},'body':_0x52f407[_0x0eb6('0x48')]};var _0x23a36f={'account':{'id':_0x29ffab[_0x0eb6('0xdd')]},'body':_0x4590fb,'log':_0x0eb6('0xe2')};return respondWithRpcPromise(_0x0eb6('0xe2'),_0x0eb6('0xe3'),_0x23a36f,client9001)[_0x0eb6('0x13')](function(){return _0x52f407;})[_0x0eb6('0x1c')](function(_0x35f11d){console[_0x0eb6('0x18')](_0x35f11d);});}return;})[_0x0eb6('0x13')](function(){if(_0x52f407){return _0x52f407;}})[_0x0eb6('0x13')](respondWithResult(_0x24055a,null))[_0x0eb6('0x1c')](function(_0x1b06be){console[_0x0eb6('0x18')](_0x0eb6('0x1c'),_0x1b06be);for(var _0x399acc of _0x312322){var _0x2703bb=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xca'),'files',_0x0eb6('0xe4'),'offline-chat',_0x399acc[_0x0eb6('0x5d')]);fs_extra[_0x0eb6('0xe5')](_0x2703bb)[_0x0eb6('0x1c')](function(_0x19bded){console[_0x0eb6('0x18')](_0x0eb6('0xe6'),_0x2703bb,_0x19bded);});}});};exports[_0x0eb6('0xe7')]=function(_0x1f46d8,_0x250f62){return db[_0x0eb6('0xa9')][_0x0eb6('0x46')]({'where':{'id':_0x1f46d8[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x250f62,null))[_0x0eb6('0x13')](function(_0x3b6e2c){if(_0x3b6e2c){return _0x3b6e2c[_0x0eb6('0xe7')](_0x1f46d8['body'][_0x0eb6('0x55')],_['omit'](_0x1f46d8[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{});}})[_0x0eb6('0x13')](respondWithResult(_0x250f62,null))[_0x0eb6('0x1c')](handleError(_0x250f62,null));};exports['getInteractions']=function(_0x39e8e5,_0x599b9d){var _0x4dc738={'raw':![],'where':{}};var _0x3a7803={};var _0x2961b4={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')]['findOne']({'where':{'id':_0x39e8e5['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x599b9d,null))[_0x0eb6('0x13')](function(_0x8689ac){if(_0x8689ac){_0x3a7803['model']=_[_0x0eb6('0x34')](db['ChatInteraction'][_0x0eb6('0x45')]);_0x3a7803[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x39e8e5[_0x0eb6('0x33')]);_0x3a7803[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x3a7803[_0x0eb6('0x31')],_0x3a7803[_0x0eb6('0x33')]);_0x4dc738[_0x0eb6('0x37')]=_['intersection'](_0x3a7803[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x39e8e5[_0x0eb6('0x33')]['fields']));_0x4dc738[_0x0eb6('0x37')]=_0x4dc738[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x4dc738['attributes']:_0x3a7803[_0x0eb6('0x31')];if(!_0x39e8e5['query']['hasOwnProperty'](_0x0eb6('0x3b'))){_0x4dc738[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x39e8e5['query'][_0x0eb6('0x22')]);_0x4dc738[_0x0eb6('0x1f')]=qs['offset'](_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x4dc738['order']=qs[_0x0eb6('0x3c')](_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x4dc738[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x39e8e5['query'],_0x3a7803[_0x0eb6('0x35')]));_0x4dc738[_0x0eb6('0x3f')]['ChatWebsiteId']=_0x8689ac['id'];if(_0x39e8e5[_0x0eb6('0x33')]['filter']){_0x4dc738[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x4dc738[_0x0eb6('0x3f')],{'$or':_[_0x0eb6('0x32')](_0x4dc738['attributes'],function(_0xde4714){var _0x13246a={};_0x13246a[_0xde4714]={'$like':'%'+_0x39e8e5[_0x0eb6('0x33')]['filter']+'%'};return _0x13246a;})});}_0x4dc738=_['merge']({},_0x4dc738,_0x39e8e5[_0x0eb6('0x41')]);return db['ChatInteraction']['count']({'where':_0x4dc738[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x52b8e0){_0x2961b4[_0x0eb6('0x21')]=_0x52b8e0;if(_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x4dc738['include']=[{'model':db[_0x0eb6('0x7d')],'as':'Contact','required':![]},{'model':db[_0x0eb6('0xb4')],'as':'Owner','attributes':[_0x0eb6('0x2a'),'fullname',_0x0eb6('0xe8')],'required':![]},{'model':db[_0x0eb6('0xe9')],'as':_0x0eb6('0xea'),'attributes':['id','name',_0x0eb6('0xeb')],'where':_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0xec')]?{'id':_0x39e8e5['query'][_0x0eb6('0xec')]}:undefined,'required':_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x0eb6('0x52')](_0x4dc738);})['then'](function(_0xfe3c7a){_0x2961b4[_0x0eb6('0x53')]=_0xfe3c7a;return _0x2961b4;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x599b9d,_0x4dc738))['catch'](handleError(_0x599b9d,null));};function iftimePromise(_0x54204c,_0x5b5881){return respondWithRpcPromise(_0x0eb6('0xed'),_0x0eb6('0xee'),{'command':_0x5b5881['timezone']?util['format'](_0x0eb6('0xef'),_0x54204c['interval'],_0x5b5881['timezone']):util[_0x0eb6('0xa2')]('iftime\x20%s',_0x54204c['interval'])},client9002)[_0x0eb6('0x13')](function(_0x517da7){var _0x3bf1ea=_0x517da7&&_0x517da7[_0x0eb6('0xf0')](_0x0eb6('0xf1'))>=0x0?!![]:![];logger[_0x0eb6('0x14')](_0x0eb6('0xf2'),_0x5b5881['id'],_0x54204c['id'],_0x54204c['interval'],_0x3bf1ea?_0x0eb6('0xf3'):_0x0eb6('0xf4'),_0x5b5881[_0x0eb6('0xf5')]?_0x5b5881[_0x0eb6('0xf5')]:_0x0eb6('0xf6'));return _0x3bf1ea;})[_0x0eb6('0x1c')](function(_0xed400){logger[_0x0eb6('0x18')](_0x0eb6('0xf2'),_0x5b5881['id'],_0x54204c['id'],_0x54204c[_0x0eb6('0xf7')],util[_0x0eb6('0xf8')](_0xed400,{'showHidden':![],'depth':null}),_0x5b5881['timezone']?_0x5b5881['timezone']:_0x0eb6('0xf6'));return![];});}exports['getSnippet']=function(_0x3a140e,_0x54b58a){var _0x552d99=0x0;var _0x3349e0=0x0;var _0x5165fc=![];var _0x65a91e;var _0x488941;return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x3a140e[_0x0eb6('0x4c')]['id']},'include':[{'model':db['Interval'],'as':_0x0eb6('0xf9'),'include':[{'model':db[_0x0eb6('0xf9')],'as':_0x0eb6('0xfa'),'attributes':['id',_0x0eb6('0xf7')],'raw':!![]}]}]})[_0x0eb6('0x13')](handleEntityNotFound(_0x54b58a,null))[_0x0eb6('0x13')](function(_0x43a456){if(_0x43a456){_0x65a91e=_0x43a456;return _0x43a456[_0x0eb6('0xfb')]({'raw':!![]});}})[_0x0eb6('0x13')](function(_0xd4161b){if(_0x65a91e){if(_0xd4161b){_0x488941=_0xd4161b;}}return require(_0x0eb6('0x65'))[_0x0eb6('0x66')]();})[_0x0eb6('0x13')](function(_0x29c06c){if(_0x29c06c){_0x3349e0=_0x29c06c[_0x0eb6('0xfc')];_0x5165fc=_0x29c06c[_0x0eb6('0x67')];}})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0xa9')][_0x0eb6('0x21')]({'where':{'closed':![]}});})[_0x0eb6('0x13')](function(_0x34c650){_0x552d99=_0x34c650;if(_0x3349e0&&_0x34c650>_0x3349e0){return db['License'][_0x0eb6('0x50')]({'where':{'id':0x1}})['then'](function(_0x185bf1){if(_0x185bf1){_0x185bf1[_0x0eb6('0xfd')](_0x0eb6('0xfe'));}});}})['then'](function(){if(_0x65a91e[_0x0eb6('0xf9')]&&_0x65a91e[_0x0eb6('0xf9')][_0x0eb6('0xfa')]){var _0x18c2ed=[];for(var _0x4c7e2f=0x0;_0x4c7e2f<_0x65a91e[_0x0eb6('0xf9')][_0x0eb6('0xfa')][_0x0eb6('0x39')];_0x4c7e2f++){var _0x270a3f=_0x65a91e[_0x0eb6('0xf9')]['Intervals'][_0x4c7e2f][_0x0eb6('0x26')]({'plain':!![]});_0x18c2ed[_0x0eb6('0xff')](iftimePromise(_0x270a3f,_0x65a91e));}return BPromise[_0x0eb6('0x100')](_0x18c2ed)[_0x0eb6('0x13')](function(_0x327d88){return _[_0x0eb6('0x101')](_0x327d88);});}else{return!![];}})[_0x0eb6('0x13')](function(_0x5a9888){var _0x47189b=fs['readFileSync'](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x102')),_0x0eb6('0x103'));var _0x2f43e5={'remote':_0x65a91e[_0x0eb6('0x104')],'query':querystring[_0x0eb6('0x17')](_[_0x0eb6('0x40')](_0x65a91e[_0x0eb6('0x26')]({'plain':!![]}),{'customerIp':_0x3a140e[_0x0eb6('0x79')][_0x0eb6('0x9b')]||_0x3a140e[_0x0eb6('0x79')]['x-real-ip']||_0x3a140e['connection']['remoteAddress']||_0x3a140e['ip'],'referer':_0x3a140e['headers'][_0x0eb6('0x105')],'openedInteractions':_0x552d99,'maxInteractions':_0x3349e0,'virtual':_0x5165fc[_0x0eb6('0xfc')],'online':_0x5a9888,'custom':_0x5165fc}))['replace'](/'/g,'\x5c\x27')};_0x54b58a[_0x0eb6('0x2b')](ejs[_0x0eb6('0xc4')](Mustache['render'](_0x47189b,_0x2f43e5),{'proactiveActions':_0x488941,'alignment':_0x65a91e[_0x0eb6('0x106')],'verticalAlignment':_0x65a91e[_0x0eb6('0x107')],'div_color':_0x65a91e[_0x0eb6('0xeb')],'labelText':_0x65a91e['labelText'],'text_color':_0x65a91e[_0x0eb6('0x108')],'button_color':_0x65a91e[_0x0eb6('0x109')],'background_color':_0x65a91e[_0x0eb6('0x10a')]}));})[_0x0eb6('0x1c')](handleError(_0x54b58a,null));};exports[_0x0eb6('0x10b')]=function(_0xc64b06,_0x3e1c5a){var _0x5d2c58=_0xc64b06[_0x0eb6('0x4c')]['id'];var _0x445d5a=_0xc64b06[_0x0eb6('0x48')];var _0x39c4fc=0xc8;var _0xfe5cdf=null;return db['sequelize'][_0x0eb6('0xcd')]({'isolationLevel':db[_0x0eb6('0xcc')][_0x0eb6('0x10c')][_0x0eb6('0x10d')][_0x0eb6('0x10e')]},function(_0xc7d897){return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x5d2c58},'transaction':_0xc7d897})[_0x0eb6('0x13')](function(_0x4b7405){if(_0x4b7405){return db[_0x0eb6('0x90')][_0x0eb6('0x25')]({'where':{'ChatWebsiteId':_0x5d2c58},'transaction':_0xc7d897})[_0x0eb6('0x13')](function(){var _0x1d079a=_['map'](_0x445d5a,function(_0x4ecf7d){_0x4ecf7d['ChatWebsiteId']=_0x5d2c58;return _0x4ecf7d;});return db[_0x0eb6('0x90')][_0x0eb6('0x10f')](_0x1d079a,{'transaction':_0xc7d897});});}else{_0x39c4fc=0x194;_0xfe5cdf=[];}});})[_0x0eb6('0x13')](function(){if(_0x39c4fc!==0x194){return db[_0x0eb6('0x90')][_0x0eb6('0x110')]({'where':{'ChatWebsiteId':_0x5d2c58},'order':_0x0eb6('0x94')})['then'](function(_0x13ec7e){_0xfe5cdf=_0x13ec7e;});}})[_0x0eb6('0x1c')](function(_0x31f0d8){_0x39c4fc=0x1f4;logger[_0x0eb6('0x18')](_0x31f0d8[_0x0eb6('0x29')]);if(_0x31f0d8[_0x0eb6('0x2a')]){delete _0x31f0d8[_0x0eb6('0x2a')];}_0xfe5cdf=_0x31f0d8;})[_0x0eb6('0x111')](function(){if(_0xfe5cdf===null){_0x3e1c5a[_0x0eb6('0x112')](_0x39c4fc);}else{if(_0x39c4fc===0x1f4){_0x3e1c5a['status'](_0x39c4fc)['send'](_0xfe5cdf);}else{_0x3e1c5a[_0x0eb6('0x1e')](_0x39c4fc)[_0x0eb6('0x113')](_0xfe5cdf);}}});};exports[_0x0eb6('0x114')]=function(_0x5e7645,_0x4c2e8e){var _0x1a2c5b={};var _0x4ee294={};var _0x1fea5d;var _0x1909e9;return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x5e7645['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x4c2e8e,null))[_0x0eb6('0x13')](function(_0x3ffa36){if(_0x3ffa36){_0x1fea5d=_0x3ffa36;_0x4ee294['model']=_['keys'](db[_0x0eb6('0x90')][_0x0eb6('0x45')]);_0x4ee294[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x5e7645[_0x0eb6('0x33')]);_0x4ee294[_0x0eb6('0x35')]=_['intersection'](_0x4ee294[_0x0eb6('0x31')],_0x4ee294[_0x0eb6('0x33')]);_0x1a2c5b[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x4ee294[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x1a2c5b[_0x0eb6('0x37')]=_0x1a2c5b[_0x0eb6('0x37')]['length']?_0x1a2c5b[_0x0eb6('0x37')]:_0x4ee294[_0x0eb6('0x31')];_0x1a2c5b['order']=qs[_0x0eb6('0x3c')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x1a2c5b[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x5e7645[_0x0eb6('0x33')],_0x4ee294['filters']));if(_0x5e7645['query']['filter']){_0x1a2c5b[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x1a2c5b[_0x0eb6('0x3f')],{'$or':_[_0x0eb6('0x32')](_0x1a2c5b[_0x0eb6('0x37')],function(_0x306db1){var _0x528cca={};_0x528cca[_0x306db1]={'$like':'%'+_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x528cca;})});}_0x1a2c5b=_[_0x0eb6('0x40')]({},_0x1a2c5b,_0x5e7645[_0x0eb6('0x41')]);return _0x1fea5d['getApplications'](_0x1a2c5b);}})[_0x0eb6('0x13')](function(_0x3869ef){if(_0x3869ef){_0x1909e9=_0x3869ef[_0x0eb6('0x39')];if(!_0x5e7645['query']['hasOwnProperty'](_0x0eb6('0x3b'))){_0x1a2c5b['limit']=qs[_0x0eb6('0x22')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1a2c5b[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x5e7645[_0x0eb6('0x33')]['offset']);}return _0x1fea5d['getApplications'](_0x1a2c5b);}})[_0x0eb6('0x13')](function(_0x5c4171){if(_0x5c4171){return _0x5c4171?{'count':_0x1909e9,'rows':_0x5c4171}:null;}})['then'](respondWithResult(_0x4c2e8e,null))[_0x0eb6('0x1c')](handleError(_0x4c2e8e,null));};exports[_0x0eb6('0x115')]=function(_0x54df33,_0x50a73c){return db[_0x0eb6('0x116')]['find']({'where':{'id':_0x54df33['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x50a73c,null))[_0x0eb6('0x13')](function(_0x4ad502){if(_0x4ad502){return _0x4ad502[_0x0eb6('0x115')](_0x54df33[_0x0eb6('0x48')]['ids'],_[_0x0eb6('0x117')](_0x54df33[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{});}})['then'](respondWithResult(_0x50a73c,null))[_0x0eb6('0x1c')](handleError(_0x50a73c,null));};exports['getProactiveActions']=function(_0x49a403,_0x2a33ff){var _0x3a5c26={};var _0x3a4e03={};var _0x1b1838;var _0x491555;return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x49a403[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x2a33ff,null))[_0x0eb6('0x13')](function(_0x13a0aa){if(_0x13a0aa){_0x1b1838=_0x13a0aa;_0x3a4e03[_0x0eb6('0x31')]=_[_0x0eb6('0x34')](db[_0x0eb6('0x118')][_0x0eb6('0x45')]);_0x3a4e03[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x49a403[_0x0eb6('0x33')]);_0x3a4e03[_0x0eb6('0x35')]=_['intersection'](_0x3a4e03[_0x0eb6('0x31')],_0x3a4e03[_0x0eb6('0x33')]);_0x3a5c26[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x3a4e03[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x49a403['query'][_0x0eb6('0x38')]));_0x3a5c26[_0x0eb6('0x37')]=_0x3a5c26[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x3a5c26[_0x0eb6('0x37')]:_0x3a4e03['model'];_0x3a5c26[_0x0eb6('0x58')]=qs['sort'](_0x49a403[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x3a5c26[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x49a403['query'],_0x3a4e03['filters']));if(_0x49a403['query']['filter']){_0x3a5c26[_0x0eb6('0x3f')]=_['merge'](_0x3a5c26['where'],{'$or':_['map'](_0x3a5c26[_0x0eb6('0x37')],function(_0xf971f5){var _0x243fac={};_0x243fac[_0xf971f5]={'$like':'%'+_0x49a403[_0x0eb6('0x33')]['filter']+'%'};return _0x243fac;})});}_0x3a5c26=_[_0x0eb6('0x40')]({},_0x3a5c26,_0x49a403[_0x0eb6('0x41')]);return _0x1b1838[_0x0eb6('0xfb')](_0x3a5c26);}})[_0x0eb6('0x13')](function(_0x5ad5d0){if(_0x5ad5d0){_0x491555=_0x5ad5d0[_0x0eb6('0x39')];if(!_0x49a403[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x3a5c26[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x49a403['query']['limit']);_0x3a5c26[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x49a403[_0x0eb6('0x33')]['offset']);}return _0x1b1838['getProactiveActions'](_0x3a5c26);}})[_0x0eb6('0x13')](function(_0x528914){if(_0x528914){return _0x528914?{'count':_0x491555,'rows':_0x528914}:null;}})[_0x0eb6('0x13')](respondWithResult(_0x2a33ff,null))[_0x0eb6('0x1c')](handleError(_0x2a33ff,null));};exports[_0x0eb6('0x119')]=function(_0x283a1d,_0x1a3824){var _0x423581=_0x283a1d['query']['online']===_0x0eb6('0x11a')?_0x0eb6('0x11b'):'onlineForm';return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'attributes':['id',_0x423581],'where':{'id':_0x283a1d[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1a3824,null))[_0x0eb6('0x13')](function(_0x3ce015){if(_0x3ce015){var _0x121d55=_0x3ce015[_0x423581];var _0x10518e=_0x121d55&&_0x121d55[_0x0eb6('0x11c')]?_0x121d55[_0x0eb6('0x11c')]:[];_0x1a3824[_0x0eb6('0x2b')]({'fromKey':_['isNil'](_0x121d55[_0x0eb6('0x11d')])?undefined:_0x121d55['fromKey'],'count':_0x10518e[_0x0eb6('0x39')],'rows':_0x10518e});}})[_0x0eb6('0x1c')](handleError(_0x1a3824,null));};exports[_0x0eb6('0x11e')]=function(_0x219d95,_0x31322e){var _0x1c6ff9={'raw':![],'where':{}};var _0x5804b6={};var _0x1d8923={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x219d95[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x31322e,null))[_0x0eb6('0x13')](function(_0x478b75){if(_0x478b75){_0x5804b6['model']=_['keys'](db[_0x0eb6('0xc7')]['rawAttributes']);_0x5804b6[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x219d95[_0x0eb6('0x33')]);_0x5804b6[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x5804b6[_0x0eb6('0x31')],_0x5804b6[_0x0eb6('0x33')]);_0x1c6ff9[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x5804b6[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x1c6ff9[_0x0eb6('0x37')]=_0x1c6ff9[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x1c6ff9[_0x0eb6('0x37')]:_0x5804b6['model'];if(!_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x1c6ff9[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1c6ff9['offset']=qs[_0x0eb6('0x1f')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x1c6ff9[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x1c6ff9[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x219d95[_0x0eb6('0x33')],_0x5804b6['filters']));_0x1c6ff9[_0x0eb6('0x3f')][_0x0eb6('0x4e')]=_0x478b75['id'];if(_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3e')]){_0x1c6ff9['where']=_[_0x0eb6('0x40')](_0x1c6ff9['where'],{'$or':_[_0x0eb6('0x32')](_0x1c6ff9['attributes'],function(_0x21347c){var _0x1c04b1={};_0x1c04b1[_0x21347c]={'$like':'%'+_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x1c04b1;})});}_0x1c6ff9=_[_0x0eb6('0x40')]({},_0x1c6ff9,_0x219d95[_0x0eb6('0x41')]);return db[_0x0eb6('0xc7')]['count']({'where':_0x1c6ff9[_0x0eb6('0x3f')]})['then'](function(_0x7abfc9){_0x1d8923[_0x0eb6('0x21')]=_0x7abfc9;if(_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x1c6ff9['include']=[{'all':!![]}];}else{_0x1c6ff9['include']=[{'model':db[_0x0eb6('0x7d')],'as':'Contact','required':![]},{'model':db[_0x0eb6('0x11f')],'as':_0x0eb6('0x120'),'required':![]}];}return db[_0x0eb6('0xc7')][_0x0eb6('0x52')](_0x1c6ff9);})['then'](function(_0x3df815){_0x1d8923[_0x0eb6('0x53')]=_0x3df815;return _0x1d8923;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x31322e,_0x1c6ff9))[_0x0eb6('0x1c')](handleError(_0x31322e,null));};exports[_0x0eb6('0x121')]=function(_0x3c8734,_0x251738){return db[_0x0eb6('0x2e')]['find']({'where':{'id':_0x3c8734[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x251738,null))[_0x0eb6('0x13')](function(_0xc4976e){if(_0xc4976e){return _0xc4976e[_0x0eb6('0x121')](_0x3c8734[_0x0eb6('0x48')]['ids'],_[_0x0eb6('0x117')](_0x3c8734[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{})[_0x0eb6('0x122')](function(_0x3fee27){for(var _0x2f6c37=0x0;_0x2f6c37<_0x3c8734[_0x0eb6('0x48')][_0x0eb6('0x55')][_0x0eb6('0x39')];_0x2f6c37+=0x1){socket[_0x0eb6('0x123')](_0x0eb6('0x124'),{'UserId':Number(_0x3c8734['body'][_0x0eb6('0x55')][_0x2f6c37]),'ChatWebsiteId':Number(_0x3c8734[_0x0eb6('0x4c')]['id'])});}return _0x3fee27;});}})[_0x0eb6('0x13')](respondWithResult(_0x251738,null))[_0x0eb6('0x1c')](handleError(_0x251738,null));};exports[_0x0eb6('0x125')]=function(_0x4887a6,_0x28eaf2){return db['ChatWebsite']['find']({'where':{'id':_0x4887a6[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x28eaf2,null))['then'](function(_0x341ea3){if(_0x341ea3){return _0x341ea3[_0x0eb6('0x125')](_0x4887a6[_0x0eb6('0x33')][_0x0eb6('0x55')])[_0x0eb6('0x13')](function(){if(_['isArray'](_0x4887a6[_0x0eb6('0x33')]['ids'])){for(var _0x20cb9e=0x0;_0x20cb9e<_0x4887a6[_0x0eb6('0x33')][_0x0eb6('0x55')][_0x0eb6('0x39')];_0x20cb9e+=0x1){socket[_0x0eb6('0x123')](_0x0eb6('0x126'),{'UserId':Number(_0x4887a6['query']['ids'][_0x20cb9e]),'ChatWebsiteId':Number(_0x4887a6[_0x0eb6('0x4c')]['id'])});}}else{socket['emit'](_0x0eb6('0x126'),{'UserId':Number(_0x4887a6[_0x0eb6('0x33')]['ids']),'ChatWebsiteId':Number(_0x4887a6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x28eaf2,null))['catch'](handleError(_0x28eaf2,null));};exports[_0x0eb6('0x127')]=function(_0x4d6562,_0x3e1bea){var _0x58c4fa={};var _0x253b26={};var _0x13418a;var _0x53f113;return db['ChatWebsite'][_0x0eb6('0x50')]({'where':{'id':_0x4d6562[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x3e1bea,null))[_0x0eb6('0x13')](function(_0x5d48cf){if(_0x5d48cf){_0x13418a=_0x5d48cf;_0x253b26[_0x0eb6('0x31')]=_['keys'](db[_0x0eb6('0xb4')][_0x0eb6('0x45')]);_0x253b26[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x4d6562[_0x0eb6('0x33')]);_0x253b26[_0x0eb6('0x35')]=_['intersection'](_0x253b26['model'],_0x253b26[_0x0eb6('0x33')]);_0x58c4fa[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x253b26['model'],qs['fields'](_0x4d6562['query'][_0x0eb6('0x38')]));_0x58c4fa[_0x0eb6('0x37')]=_0x58c4fa[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x58c4fa['attributes']:_0x253b26[_0x0eb6('0x31')];_0x58c4fa[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x58c4fa[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x4d6562['query'],_0x253b26['filters']));if(_0x4d6562[_0x0eb6('0x33')]['filter']){_0x58c4fa[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x58c4fa[_0x0eb6('0x3f')],{'$or':_['map'](_0x58c4fa[_0x0eb6('0x37')],function(_0x17897f){var _0x2f08d3={};_0x2f08d3[_0x17897f]={'$like':'%'+_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x2f08d3;})});}_0x58c4fa=_[_0x0eb6('0x40')]({},_0x58c4fa,_0x4d6562['options']);return _0x13418a[_0x0eb6('0x127')](_0x58c4fa);}})[_0x0eb6('0x13')](function(_0x44b9e7){if(_0x44b9e7){_0x53f113=_0x44b9e7[_0x0eb6('0x39')];if(!_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x58c4fa['limit']=qs[_0x0eb6('0x22')](_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x58c4fa[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x4d6562['query'][_0x0eb6('0x1f')]);}return _0x13418a[_0x0eb6('0x127')](_0x58c4fa);}})[_0x0eb6('0x13')](function(_0x1380ec){if(_0x1380ec){return _0x1380ec?{'count':_0x53f113,'rows':_0x1380ec}:null;}})['then'](respondWithResult(_0x3e1bea,null))[_0x0eb6('0x1c')](handleError(_0x3e1bea,null));}; \ No newline at end of file +var _0xe562=['agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','server','offline-chat','basename','openNewInteraction','transaction','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','MailAccountId','originalname','mimetype','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','Tags','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','Interval','Intervals','custom','License','increment','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','labelText','textColor','color_button','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachment','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','json','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','mandatoryDispositionPause','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','join','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','priority','ListId','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','unknown','format','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xe562,0x72));var _0x2e56=function(_0xdb4b33,_0xfd8bf4){_0xdb4b33=_0xdb4b33-0x0;var _0x56518e=_0xe562[_0xdb4b33];return _0x56518e;};'use strict';var BPromise=require(_0x2e56('0x0'));var Mustache=require('mustache');var util=require(_0x2e56('0x1'));var path=require(_0x2e56('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e56('0x3'));var _=require(_0x2e56('0x4'));var querystring=require(_0x2e56('0x5'));var Redis=require('ioredis');var qs=require(_0x2e56('0x6'));var logger=require(_0x2e56('0x7'))('api');var config=require('../../config/environment');var db=require(_0x2e56('0x8'))['db'];config[_0x2e56('0x9')]=_[_0x2e56('0xa')](config[_0x2e56('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e56('0xb'))(new Redis(config['redis']));require(_0x2e56('0xc'))[_0x2e56('0xd')](socket);var jayson=require(_0x2e56('0xe'));var client=jayson[_0x2e56('0xf')][_0x2e56('0x10')]({'port':0x232c});var client9002=jayson[_0x2e56('0xf')][_0x2e56('0x10')]({'port':0x232a});var client9003=jayson[_0x2e56('0xf')][_0x2e56('0x10')]({'port':0x232b});var client9001=jayson[_0x2e56('0xf')]['http']({'port':0x2329});function respondWithRpcPromise(_0x37555b,_0x318699,_0x1c15c0,_0x8b2ea7){return new BPromise(function(_0x37cf69,_0x4d235b){var _0x45815d=_0x8b2ea7||client;return _0x45815d[_0x2e56('0x11')](_0x37555b,_0x1c15c0)[_0x2e56('0x12')](function(_0x2737ba){logger[_0x2e56('0x13')](_0x2e56('0x14'),_0x318699,_0x2e56('0x15'));logger[_0x2e56('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x318699,'request\x20sent',JSON['stringify'](_0x2737ba));if(_0x2737ba[_0x2e56('0x17')]){if(_0x2737ba[_0x2e56('0x17')][_0x2e56('0x18')]===0x1f4){logger[_0x2e56('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x318699,_0x2737ba[_0x2e56('0x17')][_0x2e56('0x19')]);return _0x4d235b(_0x2737ba[_0x2e56('0x17')]['message']);}logger[_0x2e56('0x17')](_0x2e56('0x14'),_0x318699,_0x2737ba[_0x2e56('0x17')][_0x2e56('0x19')]);return _0x37cf69(_0x2737ba[_0x2e56('0x17')][_0x2e56('0x19')]);}else{logger[_0x2e56('0x13')](_0x2e56('0x14'),_0x318699,_0x2e56('0x15'));_0x37cf69(_0x2737ba[_0x2e56('0x1a')][_0x2e56('0x19')]);}})[_0x2e56('0x1b')](function(_0x40c060){logger[_0x2e56('0x17')](_0x2e56('0x14'),_0x318699,_0x40c060);_0x4d235b(_0x40c060);});});}function respondWithStatusCode(_0x36e37a,_0x25d94c){_0x25d94c=_0x25d94c||0xcc;return function(_0xdb20e0){if(_0xdb20e0){return _0x36e37a['sendStatus'](_0x25d94c);}return _0x36e37a[_0x2e56('0x1c')](_0x25d94c)[_0x2e56('0x1d')]();};}function respondWithResult(_0x36ec2c,_0x259505){_0x259505=_0x259505||0xc8;return function(_0x3d5722){if(_0x3d5722){return _0x36ec2c[_0x2e56('0x1c')](_0x259505)[_0x2e56('0x1e')](_0x3d5722);}};}function respondWithFilteredResult(_0x7ef8c1,_0x49a0c7){return function(_0x2c187f){if(_0x2c187f){var _0x164905=typeof _0x49a0c7['offset']===_0x2e56('0x1f')&&typeof _0x49a0c7[_0x2e56('0x20')]===_0x2e56('0x1f');var _0xcf1e29=_0x2c187f['count'];var _0x2bedcc=_0x164905?0x0:_0x49a0c7['offset'];var _0x3fda5a=_0x164905?_0x2c187f[_0x2e56('0x21')]:_0x49a0c7['offset']+_0x49a0c7[_0x2e56('0x20')];var _0x11e52d;if(_0x3fda5a>=_0xcf1e29){_0x3fda5a=_0xcf1e29;_0x11e52d=0xc8;}else{_0x11e52d=0xce;}_0x7ef8c1[_0x2e56('0x1c')](_0x11e52d);return _0x7ef8c1[_0x2e56('0x22')](_0x2e56('0x23'),_0x2bedcc+'-'+_0x3fda5a+'/'+_0xcf1e29)[_0x2e56('0x1e')](_0x2c187f);}return null;};}function saveUpdates(_0x164cf3){return function(_0x2c3ee8){if(_0x2c3ee8){return _0x2c3ee8[_0x2e56('0x24')](_0x164cf3)[_0x2e56('0x12')](function(_0x34e8dc){return _0x34e8dc;});}return null;};}function removeEntity(_0x6a891a){return function(_0x206e2e){if(_0x206e2e){return _0x206e2e[_0x2e56('0x25')]()[_0x2e56('0x12')](function(){var _0x5cdd4e=_0x206e2e[_0x2e56('0x26')]({'plain':!![]});var _0x1e1320=_0x2e56('0x27');return db[_0x2e56('0x28')][_0x2e56('0x25')]({'where':{'type':_0x1e1320,'resourceId':_0x5cdd4e['id']}})[_0x2e56('0x12')](function(){return _0x206e2e;});})[_0x2e56('0x12')](function(){_0x6a891a['status'](0xcc)[_0x2e56('0x1d')]();});}};}function handleEntityNotFound(_0x31561c){return function(_0x5922bf){if(!_0x5922bf){_0x31561c[_0x2e56('0x29')](0x194);}return _0x5922bf;};}function handleError(_0x1ab1fa,_0x38c78e){_0x38c78e=_0x38c78e||0x1f4;return function(_0x2cbd35){logger['error'](_0x2cbd35['stack']);if(_0x2cbd35['name']){delete _0x2cbd35['name'];}_0x1ab1fa[_0x2e56('0x1c')](_0x38c78e)[_0x2e56('0x2a')](_0x2cbd35);};}exports[_0x2e56('0x2b')]=function(_0x2c8663,_0x3e9e40){var _0x268383={'include':[{'model':db[_0x2e56('0x2c')],'as':'mandatoryDispositionPause'}]},_0x459969={},_0x1b9bbb={'count':0x0,'rows':[]};var _0x4c74af=_[_0x2e56('0x2d')](db[_0x2e56('0x2e')][_0x2e56('0x2f')],function(_0x32144a){return{'name':_0x32144a[_0x2e56('0x30')],'type':_0x32144a[_0x2e56('0x31')][_0x2e56('0x32')]};});_0x459969['model']=_[_0x2e56('0x2d')](_0x4c74af,_0x2e56('0x33'));_0x459969[_0x2e56('0x34')]=_['keys'](_0x2c8663[_0x2e56('0x34')]);_0x459969[_0x2e56('0x35')]=_[_0x2e56('0x36')](_0x459969[_0x2e56('0x37')],_0x459969[_0x2e56('0x34')]);_0x268383[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0x459969[_0x2e56('0x37')],qs[_0x2e56('0x39')](_0x2c8663[_0x2e56('0x34')]['fields']));_0x268383[_0x2e56('0x38')]=_0x268383[_0x2e56('0x38')][_0x2e56('0x3a')]?_0x268383[_0x2e56('0x38')]:_0x459969[_0x2e56('0x37')];if(!_0x2c8663['query'][_0x2e56('0x3b')](_0x2e56('0x3c'))){_0x268383[_0x2e56('0x20')]=qs[_0x2e56('0x20')](_0x2c8663['query'][_0x2e56('0x20')]);_0x268383[_0x2e56('0x3d')]=qs[_0x2e56('0x3d')](_0x2c8663['query']['offset']);}_0x268383['order']=qs[_0x2e56('0x3e')](_0x2c8663[_0x2e56('0x34')][_0x2e56('0x3e')]);_0x268383[_0x2e56('0x3f')]=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0x2c8663['query'],_0x459969[_0x2e56('0x35')]),_0x4c74af);if(_0x2c8663[_0x2e56('0x34')][_0x2e56('0x41')]){_0x268383[_0x2e56('0x3f')]=_[_0x2e56('0x42')](_0x268383[_0x2e56('0x3f')],{'$or':_['map'](_0x4c74af,function(_0xef1973){if(_0xef1973[_0x2e56('0x31')]!==_0x2e56('0x43')){var _0x294eae={};_0x294eae[_0xef1973['name']]={'$like':'%'+_0x2c8663[_0x2e56('0x34')][_0x2e56('0x41')]+'%'};return _0x294eae;}})});}_0x268383=_['merge']({},_0x268383,_0x2c8663[_0x2e56('0x44')]);var _0x2ae383={'where':_0x268383[_0x2e56('0x3f')]};return db[_0x2e56('0x2e')][_0x2e56('0x21')](_0x2ae383)['then'](function(_0x74c009){_0x1b9bbb[_0x2e56('0x21')]=_0x74c009;if(_0x2c8663[_0x2e56('0x34')][_0x2e56('0x45')]){_0x268383['include']=[{'all':!![]}];}return db[_0x2e56('0x2e')][_0x2e56('0x46')](_0x268383);})[_0x2e56('0x12')](function(_0x4d0254){_0x1b9bbb[_0x2e56('0x47')]=_0x4d0254;return _0x1b9bbb;})[_0x2e56('0x12')](respondWithFilteredResult(_0x3e9e40,_0x268383))[_0x2e56('0x1b')](handleError(_0x3e9e40,null));};exports[_0x2e56('0x48')]=function(_0x1e0405,_0x54d448){var _0x25f9ca={'raw':![],'where':{'id':_0x1e0405['params']['id']},'include':[{'model':db[_0x2e56('0x2c')],'as':_0x2e56('0x49')}]},_0x349515={};_0x349515['model']=_[_0x2e56('0x4a')](db[_0x2e56('0x2e')][_0x2e56('0x2f')]);_0x349515[_0x2e56('0x34')]=_[_0x2e56('0x4a')](_0x1e0405['query']);_0x349515[_0x2e56('0x35')]=_['intersection'](_0x349515[_0x2e56('0x37')],_0x349515['query']);_0x25f9ca[_0x2e56('0x38')]=_['intersection'](_0x349515[_0x2e56('0x37')],qs[_0x2e56('0x39')](_0x1e0405['query']['fields']));_0x25f9ca[_0x2e56('0x38')]=_0x25f9ca['attributes'][_0x2e56('0x3a')]?_0x25f9ca[_0x2e56('0x38')]:_0x349515['model'];if(_0x1e0405[_0x2e56('0x34')][_0x2e56('0x45')]){_0x25f9ca[_0x2e56('0x4b')]=[{'all':!![]}];}_0x25f9ca=_[_0x2e56('0x42')]({},_0x25f9ca,_0x1e0405['options']);return db[_0x2e56('0x2e')][_0x2e56('0x4c')](_0x25f9ca)[_0x2e56('0x12')](handleEntityNotFound(_0x54d448,null))[_0x2e56('0x12')](respondWithResult(_0x54d448,null))[_0x2e56('0x1b')](handleError(_0x54d448,null));};exports[_0x2e56('0x4d')]=function(_0x39f1b6,_0x55a628){return db[_0x2e56('0x2e')][_0x2e56('0x4d')](_0x39f1b6[_0x2e56('0x4e')],{})[_0x2e56('0x12')](function(_0x21c767){var _0xa6257c=_0x39f1b6[_0x2e56('0x4f')]['get']({'plain':!![]});if(!_0xa6257c)throw new Error(_0x2e56('0x50'));if(_0xa6257c[_0x2e56('0x51')]===_0x2e56('0x4f')){var _0x405007=_0x21c767[_0x2e56('0x26')]({'plain':!![]});var _0x27ed07=_0x2e56('0x27');return db[_0x2e56('0x52')][_0x2e56('0x4c')]({'where':{'name':_0x27ed07,'userProfileId':_0xa6257c[_0x2e56('0x53')]},'raw':!![]})[_0x2e56('0x12')](function(_0x492331){if(_0x492331&&_0x492331['autoAssociation']===0x0){return db[_0x2e56('0x28')]['create']({'name':_0x405007[_0x2e56('0x33')],'resourceId':_0x405007['id'],'type':_0x492331[_0x2e56('0x33')],'sectionId':_0x492331['id']},{})['then'](function(){return _0x21c767;});}else{return _0x21c767;}})[_0x2e56('0x1b')](function(_0x482116){logger[_0x2e56('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x482116);throw _0x482116;});}return _0x21c767;})[_0x2e56('0x12')](respondWithResult(_0x55a628,0xc9))[_0x2e56('0x1b')](handleError(_0x55a628,null));};exports[_0x2e56('0x24')]=function(_0x36e896,_0x15d2ce){if(_0x36e896['body']['id']){delete _0x36e896[_0x2e56('0x4e')]['id'];}return db['ChatWebsite'][_0x2e56('0x4c')]({'where':{'id':_0x36e896['params']['id']},'include':[{'model':db['Pause'],'as':_0x2e56('0x49')}]})[_0x2e56('0x12')](handleEntityNotFound(_0x15d2ce,null))[_0x2e56('0x12')](saveUpdates(_0x36e896[_0x2e56('0x4e')],null))[_0x2e56('0x12')](respondWithResult(_0x15d2ce,null))[_0x2e56('0x1b')](handleError(_0x15d2ce,null));};exports[_0x2e56('0x25')]=function(_0x249f89,_0x3fbe6e){return db['ChatWebsite'][_0x2e56('0x4c')]({'where':{'id':_0x249f89[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0x3fbe6e,null))[_0x2e56('0x12')](removeEntity(_0x3fbe6e,null))[_0x2e56('0x1b')](handleError(_0x3fbe6e,null));};exports['describe']=function(_0x407811,_0x52e3be){return db['ChatWebsite'][_0x2e56('0x55')]()[_0x2e56('0x12')](respondWithResult(_0x52e3be,null))[_0x2e56('0x1b')](handleError(_0x52e3be,null));};exports[_0x2e56('0x56')]=function(_0x3f558f,_0xdd84c3){if(_0x3f558f['body']['id']){delete _0x3f558f[_0x2e56('0x4e')]['id'];}return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x3f558f[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0xdd84c3,null))['then'](function(_0x42cec0){if(_0x42cec0){_0x3f558f[_0x2e56('0x4e')][_0x2e56('0x57')]=_0x42cec0['id'];return db[_0x2e56('0x58')][_0x2e56('0x4d')](_0x3f558f['body']);}})[_0x2e56('0x12')](respondWithResult(_0xdd84c3,null))['catch'](handleError(_0xdd84c3,null));};exports[_0x2e56('0x59')]=function(_0x293bc1,_0x292bc6){var _0x92c904={'raw':![],'where':{}};var _0x5f3293={};var _0x4fc17f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2e56('0x5a')]({'where':{'id':_0x293bc1['params']['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x292bc6,null))[_0x2e56('0x12')](function(_0x1b7f37){if(_0x1b7f37){_0x5f3293[_0x2e56('0x37')]=_[_0x2e56('0x4a')](db[_0x2e56('0x58')][_0x2e56('0x2f')]);_0x5f3293[_0x2e56('0x34')]=_[_0x2e56('0x4a')](_0x293bc1[_0x2e56('0x34')]);_0x5f3293[_0x2e56('0x35')]=_[_0x2e56('0x36')](_0x5f3293[_0x2e56('0x37')],_0x5f3293[_0x2e56('0x34')]);_0x92c904[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0x5f3293[_0x2e56('0x37')],qs['fields'](_0x293bc1[_0x2e56('0x34')][_0x2e56('0x39')]));_0x92c904[_0x2e56('0x38')]=_0x92c904[_0x2e56('0x38')][_0x2e56('0x3a')]?_0x92c904[_0x2e56('0x38')]:_0x5f3293[_0x2e56('0x37')];if(!_0x293bc1['query']['hasOwnProperty'](_0x2e56('0x3c'))){_0x92c904[_0x2e56('0x20')]=qs['limit'](_0x293bc1[_0x2e56('0x34')][_0x2e56('0x20')]);_0x92c904[_0x2e56('0x3d')]=qs[_0x2e56('0x3d')](_0x293bc1['query']['offset']);}_0x92c904[_0x2e56('0x5b')]=qs[_0x2e56('0x3e')](_0x293bc1[_0x2e56('0x34')][_0x2e56('0x3e')]);_0x92c904[_0x2e56('0x3f')]=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0x293bc1[_0x2e56('0x34')],_0x5f3293['filters']));_0x92c904[_0x2e56('0x3f')][_0x2e56('0x57')]=_0x1b7f37['id'];if(_0x293bc1['query'][_0x2e56('0x41')]){_0x92c904['where']=_[_0x2e56('0x42')](_0x92c904[_0x2e56('0x3f')],{'$or':_['map'](_0x92c904[_0x2e56('0x38')],function(_0x3468ae){var _0x5d938a={};_0x5d938a[_0x3468ae]={'$like':'%'+_0x293bc1['query']['filter']+'%'};return _0x5d938a;})});}_0x92c904=_[_0x2e56('0x42')]({},_0x92c904,_0x293bc1[_0x2e56('0x44')]);return db['Disposition'][_0x2e56('0x21')]({'where':_0x92c904['where']})[_0x2e56('0x12')](function(_0x1cbd4d){_0x4fc17f[_0x2e56('0x21')]=_0x1cbd4d;if(_0x293bc1['query'][_0x2e56('0x45')]){_0x92c904[_0x2e56('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0x2e56('0x46')](_0x92c904);})['then'](function(_0x40580a){_0x4fc17f[_0x2e56('0x47')]=_0x40580a;return _0x4fc17f;});}})[_0x2e56('0x12')](respondWithFilteredResult(_0x292bc6,_0x92c904))[_0x2e56('0x1b')](handleError(_0x292bc6,null));};exports[_0x2e56('0x5c')]=function(_0xdc1948,_0x4de067){return db['ChatWebsite']['find']({'where':{'id':_0xdc1948[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x4de067,null))[_0x2e56('0x12')](function(_0x321ecd){if(_0x321ecd){return _0x321ecd[_0x2e56('0x5c')](_0xdc1948['query']['ids']);}})[_0x2e56('0x12')](respondWithStatusCode(_0x4de067,null))[_0x2e56('0x1b')](handleError(_0x4de067,null));};exports['addAnswer']=function(_0x3ea30e,_0x38656a){if(_0x3ea30e[_0x2e56('0x4e')]['id']){delete _0x3ea30e[_0x2e56('0x4e')]['id'];}return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x3ea30e[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x38656a,null))[_0x2e56('0x12')](function(_0x503c50){if(_0x503c50){_0x3ea30e[_0x2e56('0x4e')][_0x2e56('0x57')]=_0x503c50['id'];return db[_0x2e56('0x5d')][_0x2e56('0x4d')](_0x3ea30e[_0x2e56('0x4e')]);}})[_0x2e56('0x12')](respondWithResult(_0x38656a,null))['catch'](handleError(_0x38656a,null));};exports[_0x2e56('0x5e')]=function(_0x3201dc,_0x4a5893){var _0x190984={'raw':![],'where':{}};var _0xd9d3e={};var _0x141ab4={'count':0x0,'rows':[]};return db[_0x2e56('0x2e')][_0x2e56('0x5a')]({'where':{'id':_0x3201dc[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x4a5893,null))[_0x2e56('0x12')](function(_0x236638){if(_0x236638){_0xd9d3e[_0x2e56('0x37')]=_[_0x2e56('0x4a')](db[_0x2e56('0x5d')]['rawAttributes']);_0xd9d3e[_0x2e56('0x34')]=_['keys'](_0x3201dc[_0x2e56('0x34')]);_0xd9d3e[_0x2e56('0x35')]=_['intersection'](_0xd9d3e['model'],_0xd9d3e['query']);_0x190984[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0xd9d3e[_0x2e56('0x37')],qs['fields'](_0x3201dc['query'][_0x2e56('0x39')]));_0x190984[_0x2e56('0x38')]=_0x190984[_0x2e56('0x38')][_0x2e56('0x3a')]?_0x190984[_0x2e56('0x38')]:_0xd9d3e[_0x2e56('0x37')];if(!_0x3201dc[_0x2e56('0x34')][_0x2e56('0x3b')](_0x2e56('0x3c'))){_0x190984[_0x2e56('0x20')]=qs[_0x2e56('0x20')](_0x3201dc[_0x2e56('0x34')][_0x2e56('0x20')]);_0x190984[_0x2e56('0x3d')]=qs['offset'](_0x3201dc[_0x2e56('0x34')]['offset']);}_0x190984[_0x2e56('0x5b')]=qs[_0x2e56('0x3e')](_0x3201dc[_0x2e56('0x34')]['sort']);_0x190984['where']=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0x3201dc[_0x2e56('0x34')],_0xd9d3e[_0x2e56('0x35')]));_0x190984[_0x2e56('0x3f')][_0x2e56('0x57')]=_0x236638['id'];if(_0x3201dc['query']['filter']){_0x190984['where']=_[_0x2e56('0x42')](_0x190984[_0x2e56('0x3f')],{'$or':_[_0x2e56('0x2d')](_0x190984[_0x2e56('0x38')],function(_0x4daeb1){var _0x577283={};_0x577283[_0x4daeb1]={'$like':'%'+_0x3201dc[_0x2e56('0x34')][_0x2e56('0x41')]+'%'};return _0x577283;})});}_0x190984=_['merge']({},_0x190984,_0x3201dc[_0x2e56('0x44')]);return db[_0x2e56('0x5d')]['count']({'where':_0x190984['where']})[_0x2e56('0x12')](function(_0x43f404){_0x141ab4[_0x2e56('0x21')]=_0x43f404;if(_0x3201dc['query'][_0x2e56('0x45')]){_0x190984[_0x2e56('0x4b')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x190984);})[_0x2e56('0x12')](function(_0x275da2){_0x141ab4[_0x2e56('0x47')]=_0x275da2;return _0x141ab4;});}})[_0x2e56('0x12')](respondWithFilteredResult(_0x4a5893,_0x190984))['catch'](handleError(_0x4a5893,null));};exports[_0x2e56('0x5f')]=function(_0x5a5095,_0xde5e90){return db['ChatWebsite']['find']({'where':{'id':_0x5a5095[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0xde5e90,null))[_0x2e56('0x12')](function(_0x2aedc2){if(_0x2aedc2){return _0x2aedc2[_0x2e56('0x5f')](_0x5a5095['query'][_0x2e56('0x60')]);}})['then'](respondWithStatusCode(_0xde5e90,null))[_0x2e56('0x1b')](handleError(_0xde5e90,null));};exports[_0x2e56('0x61')]=function(_0x1f2c8a,_0x35c162){_0x1f2c8a[_0x2e56('0x4e')][_0x2e56('0x62')]=_0x1f2c8a[_0x2e56('0x63')][_0x2e56('0x64')];return db[_0x2e56('0x2e')]['find']({'where':{'id':_0x1f2c8a[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0x35c162,null))[_0x2e56('0x12')](saveUpdates(_0x1f2c8a[_0x2e56('0x4e')],null))['then'](respondWithResult(_0x35c162,null))[_0x2e56('0x1b')](handleError(_0x35c162,null));};exports['addAvatar']=function(_0x255189,_0x52f25){_0x255189['body'][_0x2e56('0x65')]=_0x255189[_0x2e56('0x63')][_0x2e56('0x64')];return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x255189[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x52f25,null))['then'](saveUpdates(_0x255189['body'],null))[_0x2e56('0x12')](respondWithResult(_0x52f25,null))[_0x2e56('0x1b')](handleError(_0x52f25,null));};exports[_0x2e56('0x66')]=function(_0x37db9b,_0x56b2ff){_0x37db9b[_0x2e56('0x4e')][_0x2e56('0x67')]=_0x37db9b[_0x2e56('0x63')][_0x2e56('0x64')];return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x37db9b[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x56b2ff,null))[_0x2e56('0x12')](saveUpdates(_0x37db9b[_0x2e56('0x4e')],null))[_0x2e56('0x12')](respondWithResult(_0x56b2ff,null))[_0x2e56('0x1b')](handleError(_0x56b2ff,null));};exports[_0x2e56('0x68')]=function(_0x204d51,_0x401e09){_0x204d51[_0x2e56('0x4e')]['systemAvatar']=_0x204d51[_0x2e56('0x63')]['filename'];return db['ChatWebsite'][_0x2e56('0x4c')]({'where':{'id':_0x204d51[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x401e09,null))['then'](saveUpdates(_0x204d51[_0x2e56('0x4e')],null))[_0x2e56('0x12')](respondWithResult(_0x401e09,null))[_0x2e56('0x1b')](handleError(_0x401e09,null));};exports['getLogo']=function(_0x4c0c27,_0xa7955a){var _0x4144ce=path[_0x2e56('0x69')](config['root'],_0x2e56('0x6a'));var _0x2d5047={'where':{'id':_0x4c0c27[_0x2e56('0x54')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x391d6a=![];return require('../../config/license/util')[_0x2e56('0x6b')]()[_0x2e56('0x12')](function(_0x154265){if(_0x154265){_0x391d6a=_0x154265['custom'];}})['then'](function(){return db[_0x2e56('0x2e')]['find'](_0x2d5047);})[_0x2e56('0x12')](handleEntityNotFound(_0xa7955a,null))[_0x2e56('0x12')](function(_0x55b5e6){if(_0x55b5e6){if(!_[_0x2e56('0x6c')](_0x55b5e6[_0x2e56('0x62')])){if(fs[_0x2e56('0x6d')](path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0x6f'),_0x55b5e6[_0x2e56('0x62')]))&&_0x391d6a){_0x4144ce=path['join'](config[_0x2e56('0x6e')],_0x2e56('0x6f'),_0x55b5e6['sitepic']);}}return _0xa7955a[_0x2e56('0x70')](_0x4144ce);}})[_0x2e56('0x1b')](handleError(_0xa7955a,null));};exports[_0x2e56('0x71')]=function(_0x3a96bc,_0x2cd3ad){var _0x2f3d2e=path[_0x2e56('0x69')](config['root'],_0x2e56('0x72'));var _0xd38f44={'where':{'id':_0x3a96bc[_0x2e56('0x54')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2e56('0x2e')]['find'](_0xd38f44)[_0x2e56('0x12')](handleEntityNotFound(_0x2cd3ad,null))[_0x2e56('0x12')](function(_0x2ad4d7){if(_0x2ad4d7){if(!_['isNil'](_0x2ad4d7[_0x2e56('0x65')])){if(fs[_0x2e56('0x6d')](path[_0x2e56('0x69')](config['root'],'server/files/images/avatars/',_0x2ad4d7[_0x2e56('0x65')]))){_0x2f3d2e=path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0x73'),_0x2ad4d7['agentAvatar']);}}return _0x2cd3ad['download'](_0x2f3d2e);}})[_0x2e56('0x1b')](handleError(_0x2cd3ad,null));};exports[_0x2e56('0x74')]=function(_0x5c6f3e,_0x539958){var _0x39ed2f=path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0x75'));var _0x57c80d={'where':{'id':_0x5c6f3e[_0x2e56('0x54')]['id']},'attributes':['id',_0x2e56('0x67'),'showCustomerAvatar'],'raw':!![]};return db[_0x2e56('0x2e')]['find'](_0x57c80d)[_0x2e56('0x12')](handleEntityNotFound(_0x539958,null))['then'](function(_0x13bdd9){if(_0x13bdd9){if(!_[_0x2e56('0x6c')](_0x13bdd9['customerAvatar'])){if(fs[_0x2e56('0x6d')](path['join'](config[_0x2e56('0x6e')],'server/files/images/avatars/',_0x13bdd9[_0x2e56('0x67')]))&&_0x13bdd9[_0x2e56('0x76')]){_0x39ed2f=path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0x73'),_0x13bdd9[_0x2e56('0x67')]);}}return _0x539958[_0x2e56('0x70')](_0x39ed2f);}})[_0x2e56('0x1b')](handleError(_0x539958,null));};exports[_0x2e56('0x77')]=function(_0x23d7f8,_0x37f303){var _0x3fe8c1=path['join'](config[_0x2e56('0x6e')],_0x2e56('0x78'));var _0x29afb2={'where':{'id':_0x23d7f8['params']['id']},'attributes':['id',_0x2e56('0x79')],'raw':!![]};return db[_0x2e56('0x2e')][_0x2e56('0x4c')](_0x29afb2)[_0x2e56('0x12')](handleEntityNotFound(_0x37f303,null))[_0x2e56('0x12')](function(_0x14e748){if(_0x14e748){if(!_[_0x2e56('0x6c')](_0x14e748[_0x2e56('0x79')])){if(fs[_0x2e56('0x6d')](path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0x73'),_0x14e748[_0x2e56('0x79')]))){_0x3fe8c1=path[_0x2e56('0x69')](config[_0x2e56('0x6e')],'server/files/images/avatars/',_0x14e748[_0x2e56('0x79')]);}}return _0x37f303[_0x2e56('0x70')](_0x3fe8c1);}})['catch'](handleError(_0x37f303,null));};exports['notify']=function(_0x340692,_0x1b819f){var _0x5c3b18=require('user-agent-parser');var _0x4a23e3=new _0x5c3b18();var _0x5741cd=_0x4a23e3['setUA'](_0x340692[_0x2e56('0x7a')]['user-agent'])[_0x2e56('0x7b')]();var _0x1dacf7={'body':_0x340692['body'],'channel':'chat'};var _0x41a032=[];var _0x274414=[];var _0x2f56e6={};var _0x55db0d=![];return db[_0x2e56('0x7c')][_0x2e56('0x55')]()[_0x2e56('0x12')](function(_0xa72cb){if(!_0xa72cb){throw new db[(_0x2e56('0x7d'))][(_0x2e56('0x7e'))](_0x2e56('0x7f'));}_0x41a032=_[_0x2e56('0x80')](_['keys'](_0xa72cb),[_0x2e56('0x81'),_0x2e56('0x82')]);_0x274414=_[_0x2e56('0x80')](_[_0x2e56('0x4a')](_0xa72cb),[_0x2e56('0x81'),_0x2e56('0x82'),_0x2e56('0x83'),'ListId']);if(_0x340692[_0x2e56('0x4e')]['id']){delete _0x340692['body']['id'];}if(_[_0x2e56('0x6c')](_0x340692[_0x2e56('0x4e')]['from'])){throw new db[(_0x2e56('0x7d'))][(_0x2e56('0x7e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x340692['body'][_0x2e56('0x4e')])||_0x340692['body'][_0x2e56('0x4e')]===''){throw new db[(_0x2e56('0x7d'))][(_0x2e56('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2e56('0x6c')](_0x340692[_0x2e56('0x4e')]['mapKey'])){throw new db['Sequelize'][(_0x2e56('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x274414);}if(!_[_0x2e56('0x84')](_0x274414,_0x340692['body']['mapKey'])){throw new db['Sequelize'][(_0x2e56('0x7e'))](_0x2e56('0x85')+_0x274414);}_0x2f56e6[_0x340692['body'][_0x2e56('0x86')]]=_0x340692['body'][_0x2e56('0x87')];})[_0x2e56('0x12')](function(){return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x340692[_0x2e56('0x54')]['id']},'include':[{'model':db[_0x2e56('0x88')],'as':_0x2e56('0x89'),'include':[{'model':db['CmContact'],'as':_0x2e56('0x8a'),'where':_0x2f56e6,'limit':0x1,'order':[[_0x2e56('0x82'),_0x2e56('0x8b')]]}]},{'model':db[_0x2e56('0x8c')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1b819f,null))[_0x2e56('0x12')](function(_0xbad4cd){if(_0xbad4cd&&_0xbad4cd[_0x2e56('0x89')]){_0x1dacf7[_0x2e56('0x8d')]=_0xbad4cd;_0x1dacf7[_0x2e56('0x8e')]=_0xbad4cd[_0x2e56('0x8f')];_0x1dacf7[_0x2e56('0x90')]=_0xbad4cd[_0x2e56('0x89')];_0x1dacf7[_0x2e56('0x8e')]=_['orderBy'](_0x1dacf7[_0x2e56('0x8e')],[_0x2e56('0x91')],['asc']);if(_0x1dacf7[_0x2e56('0x8d')][_0x2e56('0x8f')]){delete _0x1dacf7[_0x2e56('0x8d')]['Applications'];}if(_0x1dacf7['account'][_0x2e56('0x89')]&&_0x1dacf7['account'][_0x2e56('0x89')]['Contacts']['length']){return _0x1dacf7[_0x2e56('0x8d')][_0x2e56('0x89')][_0x2e56('0x8a')][0x0];}var _0x4e9cfc=_[_0x2e56('0xa')](_0x340692[_0x2e56('0x4e')],{'firstName':_0x340692['body']['from'],'ListId':_0xbad4cd[_0x2e56('0x92')]});_0x4e9cfc[_0x340692[_0x2e56('0x4e')][_0x2e56('0x86')]]=_0x340692['body'][_0x2e56('0x87')];return db[_0x2e56('0x7c')][_0x2e56('0x4d')](_0x4e9cfc,{'fields':_0x41a032,'raw':!![]});}})[_0x2e56('0x12')](handleEntityNotFound(_0x1b819f,null))[_0x2e56('0x12')](function(_0xe439c0){_0x1dacf7[_0x2e56('0x93')]=_0xe439c0;var _0x3378ad=_0x340692[_0x2e56('0x4e')]['customerIp'];if(_0x340692[_0x2e56('0x7a')][_0x2e56('0x94')]){_0x3378ad=_0x340692[_0x2e56('0x7a')]['cf-connecting-ip'];}else if(_0x340692[_0x2e56('0x7a')][_0x2e56('0x95')]){_0x3378ad=_[_0x2e56('0x96')](_0x340692[_0x2e56('0x7a')][_0x2e56('0x95')]['split'](','));}if(_0xe439c0){var _0x1bff39={'ContactId':_0xe439c0['id'],'ChatWebsiteId':_0x340692[_0x2e56('0x54')]['id'],'from':(_0xe439c0[_0x2e56('0x97')]||'')+'\x20'+(_0xe439c0[_0x2e56('0x98')]||''),'customerIp':_0x3378ad,'customerPort':_0x340692['headers']['x-real-port']?_0x340692[_0x2e56('0x7a')][_0x2e56('0x99')]:null,'referer':_0x340692[_0x2e56('0x4e')]['referer'],'browserName':_0x5741cd[_0x2e56('0x9a')][_0x2e56('0x33')]&&_0x5741cd['browser'][_0x2e56('0x9b')]?util['format']('%s\x20%s',_0x5741cd[_0x2e56('0x9a')][_0x2e56('0x33')],_0x5741cd['browser'][_0x2e56('0x9b')]):_0x2e56('0x9c'),'browserVersion':_0x5741cd['browser']['version']||_0x2e56('0x9c'),'osName':util[_0x2e56('0x9d')]('%s\x20%s',_0x5741cd['os'][_0x2e56('0x33')],_0x5741cd['os']['version']),'osVersion':_0x5741cd['os'][_0x2e56('0x9b')],'deviceModel':_0x5741cd['device'][_0x2e56('0x37')]&&_0x5741cd[_0x2e56('0x9e')][_0x2e56('0x9f')]?util['format']('%s\x20%s\x20%s',_0x5741cd['device']['model'],_0x5741cd['device']['vendor'],_0x5741cd['device'][_0x2e56('0x31')]):null,'deviceVendor':_0x5741cd['device'][_0x2e56('0x9f')],'deviceType':_0x5741cd[_0x2e56('0x9e')][_0x2e56('0x31')],'formData':JSON[_0x2e56('0xa0')](_0x340692[_0x2e56('0x4e')])};var _0x323cd4={'ChatWebsiteId':_0x340692['params']['id'],'closed':![]};if(_0x340692['body'][_0x2e56('0xa1')]){_0x323cd4['threadId']=_0x340692[_0x2e56('0x4e')]['threadId'];return db[_0x2e56('0xa2')][_0x2e56('0x4c')]({'where':_0x323cd4})[_0x2e56('0x12')](function(_0x4c8285){if(_0x4c8285){return[_0x4c8285,![]];}_0x1bff39[_0x2e56('0xa1')]=_0x340692[_0x2e56('0x4e')][_0x2e56('0xa1')];_0x1bff39['externalUrl']=_0x340692[_0x2e56('0x4e')][_0x2e56('0xa3')];return db[_0x2e56('0xa2')][_0x2e56('0x4d')](_0x1bff39)[_0x2e56('0x12')](function(_0xdb1c20){return[_0xdb1c20,!![]];});});}_0x323cd4[_0x2e56('0xa4')]=_0xe439c0['id'];if(_0x340692[_0x2e56('0x4e')][_0x2e56('0xa5')]&&_0x340692['body']['interaction']['id']){_0x323cd4['id']=_0x340692['body'][_0x2e56('0xa5')]['id'];return db[_0x2e56('0xa2')][_0x2e56('0x4c')]({'where':_0x323cd4})[_0x2e56('0x12')](function(_0x1fe09c){if(_0x1fe09c){return[_0x1fe09c,![]];}return db[_0x2e56('0xa2')][_0x2e56('0x4d')](_0x1bff39)[_0x2e56('0x12')](function(_0x26d672){return[_0x26d672,!![]];});});}return db[_0x2e56('0xa2')][_0x2e56('0x4d')](_0x1bff39)['then'](function(_0x4e1875){return[_0x4e1875,!![]];});}})[_0x2e56('0xa6')](function(_0x39a9cc,_0x5e16d3){if(_0x39a9cc){_0x55db0d=_0x5e16d3;if(!_0x5e16d3){var _0x13e8ff={'from':(_0x1dacf7[_0x2e56('0x93')][_0x2e56('0x97')]||'')+'\x20'+(_0x1dacf7['contact'][_0x2e56('0x98')]||'')};if(_0x340692[_0x2e56('0x4e')][_0x2e56('0xa1')]&&_0x340692[_0x2e56('0x4e')]['messageId']&&_0x340692[_0x2e56('0x4e')][_0x2e56('0xa1')]!=_0x340692['body'][_0x2e56('0xa7')]){_0x13e8ff['threadId']=_0x340692['body'][_0x2e56('0xa7')];}return _0x39a9cc['update'](_0x13e8ff);}else{return _0x39a9cc;}}})['then'](function(_0x4c4e1d){_0x1dacf7['interaction']=_0x4c4e1d['get']({'plain':!![]});_0x1dacf7[_0x2e56('0xa5')]['created']=_0x55db0d;if(_0x1dacf7[_0x2e56('0xa5')][_0x2e56('0xa8')]){if(_0x1dacf7[_0x2e56('0x8d')][_0x2e56('0xa9')]){_0x1dacf7[_0x2e56('0x8e')][_0x2e56('0xaa')]({'id':0x0,'priority':_0x1dacf7[_0x2e56('0x8e')]['length']+0x1,'app':_0x2e56('0xab'),'appdata':_0x2e56('0xac'),'interval':_0x2e56('0xad')});}}return db[_0x2e56('0xae')]['create']({'body':_0x340692[_0x2e56('0x4e')][_0x2e56('0x4e')],'ChatWebsiteId':_0x340692[_0x2e56('0x54')]['id'],'ChatInteractionId':_0x4c4e1d['id'],'direction':'in','ContactId':_0x1dacf7['contact']['id'],'AttachmentId':_0x340692[_0x2e56('0x4e')][_0x2e56('0xaf')]});})[_0x2e56('0x12')](function(_0x28ce2f){_0x1dacf7[_0x2e56('0x19')]=_0x28ce2f;if(_0x1dacf7['interaction'][_0x2e56('0xb0')]){return db[_0x2e56('0xb1')][_0x2e56('0x4c')]({'attributes':['id',_0x2e56('0x33')],'where':{'id':_0x1dacf7[_0x2e56('0xa5')][_0x2e56('0xb0')]}})[_0x2e56('0x12')](function(_0x43aae1){if(_0x43aae1){_0x1dacf7[_0x2e56('0x8e')][_0x2e56('0xb2')]({'id':0x0,'priority':0x0,'app':_0x2e56('0xb3'),'appdata':_0x43aae1[_0x2e56('0x33')]+','+(_0x1dacf7[_0x2e56('0x8d')][_0x2e56('0xb4')]||0xa),'interval':'*,*,*,*'});_0x1dacf7[_0x2e56('0xb5')]=!![];}return respondWithRpcPromise(_0x2e56('0xb6'),_0x2e56('0xb7'),_0x1dacf7);});}return respondWithRpcPromise(_0x2e56('0xb6'),'startRouting',_0x1dacf7);})[_0x2e56('0x12')](function(_0x5de652){respondWithRpcPromise('EventManager',_0x2e56('0xb8'),{'event':_0x2e56('0xb9'),'message':_0x5de652},client9002);return _0x5de652;})[_0x2e56('0x12')](respondWithResult(_0x1b819f,null))[_0x2e56('0x1b')](handleError(_0x1b819f,null));};exports['offline']=function(_0x5e848b,_0x204dc6){var _0x9bcb2f,_0x3656df,_0x3142b2;var _0x114343=[];var _0x34cf58={};var _0x49227e=_0x5e848b[_0x2e56('0xba')]||[];var _0x2e33b2=[];var _0x351a4c;return db[_0x2e56('0x7c')][_0x2e56('0x55')]()[_0x2e56('0x12')](function(_0x79a546){if(!_0x79a546){throw new db[(_0x2e56('0x7d'))][(_0x2e56('0x7e'))]('no\x20available\x20attributes');}_0x114343=_['difference'](_['keys'](_0x79a546),[_0x2e56('0x81'),'updatedAt',_0x2e56('0x83'),_0x2e56('0x92')]);if(_0x5e848b[_0x2e56('0x4e')]['id']){delete _0x5e848b[_0x2e56('0x4e')]['id'];}if(_[_0x2e56('0x6c')](_0x5e848b[_0x2e56('0x4e')][_0x2e56('0x87')])){throw _0x204dc6[_0x2e56('0x1c')](0x1f4)['send'](new db[(_0x2e56('0x7d'))]['ValidationError'](_0x2e56('0xbb')));}if(_[_0x2e56('0x6c')](_0x5e848b[_0x2e56('0x4e')][_0x2e56('0x4e')])||_0x5e848b['body'][_0x2e56('0x4e')]===''){throw _0x204dc6[_0x2e56('0x1c')](0x1f4)[_0x2e56('0x2a')](new db['Sequelize']['ValidationError'](_0x2e56('0xbc')));}if(_['isNil'](_0x5e848b[_0x2e56('0x4e')][_0x2e56('0xbd')])){throw _0x204dc6[_0x2e56('0x1c')](0x1f4)[_0x2e56('0x2a')](new db[(_0x2e56('0x7d'))][(_0x2e56('0x7e'))](_0x2e56('0xbe')+_0x114343));}if(!_[_0x2e56('0x84')](_0x114343,_0x5e848b[_0x2e56('0x4e')]['mapKeyOffline'])){throw _0x204dc6[_0x2e56('0x1c')](0x1f4)[_0x2e56('0x2a')](new db[(_0x2e56('0x7d'))][(_0x2e56('0x7e'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x114343));}_0x34cf58[_0x5e848b[_0x2e56('0x4e')][_0x2e56('0xbd')]]=_0x5e848b['body']['from'];})[_0x2e56('0x12')](function(){return db[_0x2e56('0x2e')]['find']({'where':{'id':_0x5e848b[_0x2e56('0x54')]['id']},'include':[{'model':db[_0x2e56('0x88')],'as':_0x2e56('0x89')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x204dc6,null))[_0x2e56('0x12')](function(_0x422de8){if(_0x422de8&&_0x422de8[_0x2e56('0x89')]){_0x3656df=_0x422de8;var _0x51a3d5=_[_0x2e56('0xa')](_0x5e848b[_0x2e56('0x4e')],{'firstName':_0x5e848b[_0x2e56('0x4e')][_0x2e56('0x87')],'phone':_0x5e848b['body'][_0x2e56('0x87')],'ListId':_0x422de8['ListId']});_0x51a3d5[_0x5e848b['body'][_0x2e56('0xbd')]]=_0x5e848b['body'][_0x2e56('0x87')];return db[_0x2e56('0x7c')][_0x2e56('0xbf')]({'where':_0x34cf58,'defaults':_0x51a3d5});}})['spread'](function(_0x1e7260){if(_0x1e7260){_0x3142b2=_0x1e7260;var _0x3d8527=fs[_0x2e56('0xc0')](path['join'](config[_0x2e56('0x6e')],_0x2e56('0xc1')),_0x2e56('0xc2'));var _0x5b7de5=ejs[_0x2e56('0xc3')](_0x3d8527,{'body':_[_0x2e56('0xc4')](_0x5e848b[_0x2e56('0x4e')][_0x2e56('0x4e')]),'bodyTitle':_0x3656df[_0x2e56('0xc5')]});return db['ChatOfflineMessage'][_0x2e56('0x4d')]({'body':_0x5b7de5,'ContactId':_0x1e7260['id'],'ChatWebsiteId':_0x3656df['id']});}})['then'](function(_0x4303d6){_0x351a4c=_0x4303d6;if(_0x49227e[_0x2e56('0x3a')]){var _0x145580=_0x49227e[_0x2e56('0x2d')](function(_0x11ccc6){return{'name':_0x11ccc6['originalname'],'basename':_0x11ccc6[_0x2e56('0x64')],'type':_0x11ccc6['mimetype'],'ChatOfflineMessageId':_0x4303d6['id']};});_0x2e33b2=_0x145580[_0x2e56('0x2d')](_0x54c43e=>{var _0x5eaad1={'filename':_0x54c43e[_0x2e56('0x33')],'path':path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0xc6'),_0x2e56('0xba'),'attachments',_0x2e56('0xc7'),_0x54c43e[_0x2e56('0xc8')])};return _0x5eaad1;});if(!_0x3656df[_0x2e56('0xc9')]){return db['sequelize'][_0x2e56('0xca')](function(_0x7c20c){return db['Attachment']['bulkCreate'](_0x145580,{'transaction':_0x7c20c});});}}})[_0x2e56('0x12')](function(){if(_0x351a4c){_0x9bcb2f=_0x351a4c;return db[_0x2e56('0xcb')][_0x2e56('0x5a')]({'where':{'active':!![]},'include':[{'model':db[_0x2e56('0xcc')],'as':'Smtp','raw':!![]}]});}})[_0x2e56('0x12')](function(_0x402a4e){if(_0x402a4e&&_0x402a4e[_0x2e56('0xcd')]&&_0x3656df['forwardOffline']&&_0x3656df[_0x2e56('0xce')]){var _0x376f43={'tls':{'rejectUnauthorized':![]}};if(_0x402a4e[_0x2e56('0xcd')][_0x2e56('0xcf')]){_0x376f43[_0x2e56('0xcf')]=_0x402a4e[_0x2e56('0xcd')][_0x2e56('0xcf')];}else{_0x376f43[_0x2e56('0xd0')]=_0x402a4e[_0x2e56('0xcd')][_0x2e56('0xd0')];_0x376f43[_0x2e56('0xd1')]=_0x402a4e[_0x2e56('0xcd')][_0x2e56('0xd1')];_0x376f43[_0x2e56('0xd2')]=_0x402a4e[_0x2e56('0xcd')][_0x2e56('0xd2')];}if(_0x402a4e[_0x2e56('0xcd')][_0x2e56('0xd3')]){_0x376f43[_0x2e56('0xd4')]={'user':_0x402a4e[_0x2e56('0xcd')][_0x2e56('0x4f')],'pass':_0x402a4e['Smtp'][_0x2e56('0xd5')]};}return respondWithRpcPromise(_0x2e56('0xd6'),_0x2e56('0xd7'),{'account':_0x376f43,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x402a4e['name'],_0x402a4e[_0x2e56('0xd8')]||_0x402a4e[_0x2e56('0xcd')][_0x2e56('0x4f')]),'to':_0x3656df[_0x2e56('0xce')],'subject':_0x3656df['offlineMessageSubject'],'html':_0x9bcb2f[_0x2e56('0x4e')],'attachments':_0x2e33b2}},client9003)[_0x2e56('0x12')](function(){return _0x9bcb2f;})[_0x2e56('0x1b')](function(_0xf24efb){console[_0x2e56('0x17')](_0xf24efb);});}})[_0x2e56('0x12')](function(){if(_0x3656df&&_0x3656df[_0x2e56('0xc9')]&&_0x3656df[_0x2e56('0xd9')]){var _0x42fb88=[];if(_0x49227e[_0x2e56('0x3a')]){_0x42fb88=_0x49227e['map'](function(_0x1627a1){return{'name':_0x1627a1[_0x2e56('0xda')],'basename':_0x1627a1['filename'],'type':_0x1627a1[_0x2e56('0xdb')],'ChatOfflineMessageId':_0x351a4c['id']};});}var _0x332eec;if(!_[_0x2e56('0x6c')](_0x3656df[_0x2e56('0xdc')])){var _0x1e1049=_['map'](_0x5e848b[_0x2e56('0x4e')],function(_0x8c8308){return _0x8c8308;});var _0x113880=_[_0x2e56('0xdd')](_0x1e1049)[0x0];var _0x476b1d=_['mapValues'](_0x113880,function(_0x4582ba){return _0x4582ba;});_0x332eec=_0x476b1d[0x1][_0x3656df[_0x2e56('0xdc')]];}var _0x4b5b42={'from':_0x3142b2[_0x2e56('0xd8')],'firstName':_0x3142b2['firstName'],'lastName':_0x3142b2['lastName'],'mapKey':_0x2e56('0xd8'),'message':{'from':_0x3142b2[_0x2e56('0xd8')],'to':_0x3656df['MailAccount'][_0x2e56('0xd8')],'cc':'','subject':_[_0x2e56('0x6c')](_0x332eec)?_0x3656df['offlineMessageSubject']:_0x332eec,'messageId':'','sentAt':new Date(),'attach':_0x42fb88[_0x2e56('0x3a')],'attachments':_0x42fb88,'originChannel':_0x2e56('0xde'),'ChatWebsiteId':_0x3656df['id'],'ChatOfflineMessageId':_0x9bcb2f['id'],'originTo':_0x3656df['MailAccount']['email']},'body':_0x9bcb2f[_0x2e56('0x4e')]};var _0x9af1d3={'account':{'id':_0x3656df[_0x2e56('0xd9')]},'body':_0x4b5b42,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x2e56('0xdf'),_0x2e56('0xe0'),_0x9af1d3,client9001)[_0x2e56('0x12')](function(){return _0x9bcb2f;})[_0x2e56('0x1b')](function(_0x28af9a){console[_0x2e56('0x17')](_0x28af9a);});}return;})[_0x2e56('0x12')](function(){if(_0x9bcb2f){return _0x9bcb2f;}})[_0x2e56('0x12')](respondWithResult(_0x204dc6,null))[_0x2e56('0x1b')](function(_0x50b94c){console['error'](_0x2e56('0x1b'),_0x50b94c);for(var _0x238e84 of _0x49227e){var _0x53f08f=path[_0x2e56('0x69')](config[_0x2e56('0x6e')],_0x2e56('0xc6'),'files',_0x2e56('0xe1'),'offline-chat',_0x238e84[_0x2e56('0x64')]);fs_extra[_0x2e56('0xe2')](_0x53f08f)[_0x2e56('0x1b')](function(_0x2951e1){console['error'](_0x2e56('0xe3'),_0x53f08f,_0x2951e1);});}});};exports[_0x2e56('0xe4')]=function(_0xd71bb0,_0x34eabf){return db[_0x2e56('0xa2')][_0x2e56('0x4c')]({'where':{'id':_0xd71bb0[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x34eabf,null))[_0x2e56('0x12')](function(_0x177259){if(_0x177259){return _0x177259[_0x2e56('0xe4')](_0xd71bb0['body'][_0x2e56('0x60')],_[_0x2e56('0xe5')](_0xd71bb0[_0x2e56('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x34eabf,null))[_0x2e56('0x1b')](handleError(_0x34eabf,null));};exports['getInteractions']=function(_0x58d21d,_0x1447a1){var _0x140d94={'raw':![],'where':{}};var _0x39e4f7={};var _0x27b09f={'count':0x0,'rows':[]};return db[_0x2e56('0x2e')][_0x2e56('0x5a')]({'where':{'id':_0x58d21d[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0x1447a1,null))['then'](function(_0x3f97b3){if(_0x3f97b3){_0x39e4f7[_0x2e56('0x37')]=_[_0x2e56('0x4a')](db['ChatInteraction'][_0x2e56('0x2f')]);_0x39e4f7['query']=_[_0x2e56('0x4a')](_0x58d21d[_0x2e56('0x34')]);_0x39e4f7[_0x2e56('0x35')]=_[_0x2e56('0x36')](_0x39e4f7[_0x2e56('0x37')],_0x39e4f7['query']);_0x140d94[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0x39e4f7['model'],qs['fields'](_0x58d21d[_0x2e56('0x34')][_0x2e56('0x39')]));_0x140d94['attributes']=_0x140d94[_0x2e56('0x38')]['length']?_0x140d94['attributes']:_0x39e4f7[_0x2e56('0x37')];if(!_0x58d21d['query'][_0x2e56('0x3b')](_0x2e56('0x3c'))){_0x140d94[_0x2e56('0x20')]=qs[_0x2e56('0x20')](_0x58d21d['query'][_0x2e56('0x20')]);_0x140d94[_0x2e56('0x3d')]=qs[_0x2e56('0x3d')](_0x58d21d[_0x2e56('0x34')]['offset']);}_0x140d94[_0x2e56('0x5b')]=qs[_0x2e56('0x3e')](_0x58d21d[_0x2e56('0x34')][_0x2e56('0x3e')]);_0x140d94[_0x2e56('0x3f')]=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0x58d21d[_0x2e56('0x34')],_0x39e4f7[_0x2e56('0x35')]));_0x140d94['where'][_0x2e56('0x57')]=_0x3f97b3['id'];if(_0x58d21d['query'][_0x2e56('0x41')]){_0x140d94['where']=_[_0x2e56('0x42')](_0x140d94['where'],{'$or':_[_0x2e56('0x2d')](_0x140d94['attributes'],function(_0x309450){var _0x33142c={};_0x33142c[_0x309450]={'$like':'%'+_0x58d21d[_0x2e56('0x34')][_0x2e56('0x41')]+'%'};return _0x33142c;})});}_0x140d94=_[_0x2e56('0x42')]({},_0x140d94,_0x58d21d['options']);return db[_0x2e56('0xa2')][_0x2e56('0x21')]({'where':_0x140d94[_0x2e56('0x3f')]})[_0x2e56('0x12')](function(_0x3a828b){_0x27b09f[_0x2e56('0x21')]=_0x3a828b;if(_0x58d21d[_0x2e56('0x34')][_0x2e56('0x45')]){_0x140d94['include']=[{'model':db[_0x2e56('0x7c')],'as':_0x2e56('0xe6'),'required':![]},{'model':db[_0x2e56('0xb1')],'as':_0x2e56('0xe7'),'attributes':[_0x2e56('0x33'),_0x2e56('0xe8'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x2e56('0xe9'),'attributes':['id',_0x2e56('0x33'),'color'],'where':_0x58d21d['query']['tag']?{'id':_0x58d21d[_0x2e56('0x34')][_0x2e56('0xea')]}:undefined,'required':_0x58d21d[_0x2e56('0x34')][_0x2e56('0xea')]?!![]:![]}];}return db[_0x2e56('0xa2')][_0x2e56('0x46')](_0x140d94);})[_0x2e56('0x12')](function(_0x3b5f78){_0x27b09f['rows']=_0x3b5f78;return _0x27b09f;});}})['then'](respondWithFilteredResult(_0x1447a1,_0x140d94))[_0x2e56('0x1b')](handleError(_0x1447a1,null));};function iftimePromise(_0x5f3190,_0x55a86d){return respondWithRpcPromise(_0x2e56('0xeb'),_0x2e56('0xec'),{'command':_0x55a86d['timezone']?util[_0x2e56('0x9d')](_0x2e56('0xed'),_0x5f3190[_0x2e56('0xee')],_0x55a86d['timezone']):util[_0x2e56('0x9d')](_0x2e56('0xef'),_0x5f3190[_0x2e56('0xee')])},client9002)[_0x2e56('0x12')](function(_0x2f8ad5){var _0x67f8ce=_0x2f8ad5&&_0x2f8ad5[_0x2e56('0xf0')](_0x2e56('0xf1'))>=0x0?!![]:![];logger[_0x2e56('0x13')](_0x2e56('0xf2'),_0x55a86d['id'],_0x5f3190['id'],_0x5f3190[_0x2e56('0xee')],_0x67f8ce?_0x2e56('0xf3'):_0x2e56('0xf4'),_0x55a86d[_0x2e56('0xf5')]?_0x55a86d[_0x2e56('0xf5')]:_0x2e56('0xf6'));return _0x67f8ce;})[_0x2e56('0x1b')](function(_0x25da36){logger[_0x2e56('0x17')](_0x2e56('0xf2'),_0x55a86d['id'],_0x5f3190['id'],_0x5f3190[_0x2e56('0xee')],util[_0x2e56('0xf7')](_0x25da36,{'showHidden':![],'depth':null}),_0x55a86d[_0x2e56('0xf5')]?_0x55a86d[_0x2e56('0xf5')]:_0x2e56('0xf6'));return![];});}exports[_0x2e56('0xec')]=function(_0x23c5a7,_0x1e2c40){var _0x5dbff4=0x0;var _0x5e55b9=0x0;var _0x4891a8=![];var _0x5a4ddb;var _0x10c776;return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x23c5a7[_0x2e56('0x54')]['id']},'include':[{'model':db[_0x2e56('0xf8')],'as':_0x2e56('0xf8'),'include':[{'model':db[_0x2e56('0xf8')],'as':_0x2e56('0xf9'),'attributes':['id',_0x2e56('0xee')],'raw':!![]}]}]})[_0x2e56('0x12')](handleEntityNotFound(_0x1e2c40,null))[_0x2e56('0x12')](function(_0x458ecf){if(_0x458ecf){_0x5a4ddb=_0x458ecf;return _0x458ecf['getProactiveActions']({'raw':!![]});}})[_0x2e56('0x12')](function(_0x15d6dd){if(_0x5a4ddb){if(_0x15d6dd){_0x10c776=_0x15d6dd;}}return require('../../config/license/util')[_0x2e56('0x6b')]();})[_0x2e56('0x12')](function(_0x269dd6){if(_0x269dd6){_0x5e55b9=_0x269dd6['virtual'];_0x4891a8=_0x269dd6[_0x2e56('0xfa')];}})[_0x2e56('0x12')](function(){return db[_0x2e56('0xa2')][_0x2e56('0x21')]({'where':{'closed':![]}});})[_0x2e56('0x12')](function(_0x3e9ea1){_0x5dbff4=_0x3e9ea1;if(_0x5e55b9&&_0x3e9ea1>_0x5e55b9){return db[_0x2e56('0xfb')][_0x2e56('0x5a')]({'where':{'id':0x1}})[_0x2e56('0x12')](function(_0x56b6d6){if(_0x56b6d6){_0x56b6d6[_0x2e56('0xfc')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x5a4ddb[_0x2e56('0xf8')]&&_0x5a4ddb[_0x2e56('0xf8')][_0x2e56('0xf9')]){var _0x21ba17=[];for(var _0x106a11=0x0;_0x106a11<_0x5a4ddb['Interval']['Intervals']['length'];_0x106a11++){var _0xa152f2=_0x5a4ddb[_0x2e56('0xf8')][_0x2e56('0xf9')][_0x106a11][_0x2e56('0x26')]({'plain':!![]});_0x21ba17[_0x2e56('0xaa')](iftimePromise(_0xa152f2,_0x5a4ddb));}return BPromise['all'](_0x21ba17)[_0x2e56('0x12')](function(_0x1eabb3){return _[_0x2e56('0xfd')](_0x1eabb3);});}else{return!![];}})[_0x2e56('0x12')](function(_0x57256f){var _0x25a95e=fs[_0x2e56('0xc0')](path['join'](config['root'],_0x2e56('0xfe')),_0x2e56('0xc2'));var _0x3c1994={'remote':_0x5a4ddb[_0x2e56('0xff')],'query':querystring[_0x2e56('0xa0')](_[_0x2e56('0x42')](_0x5a4ddb['get']({'plain':!![]}),{'customerIp':_0x23c5a7['headers'][_0x2e56('0x95')]||_0x23c5a7['headers'][_0x2e56('0x100')]||_0x23c5a7[_0x2e56('0x101')][_0x2e56('0x102')]||_0x23c5a7['ip'],'referer':_0x23c5a7[_0x2e56('0x7a')]['referer'],'openedInteractions':_0x5dbff4,'maxInteractions':_0x5e55b9,'virtual':_0x4891a8[_0x2e56('0x103')],'online':_0x57256f,'custom':_0x4891a8}))[_0x2e56('0x104')](/'/g,'\x5c\x27')};_0x1e2c40[_0x2e56('0x2a')](ejs[_0x2e56('0xc3')](Mustache[_0x2e56('0xc3')](_0x25a95e,_0x3c1994),{'proactiveActions':_0x10c776,'alignment':_0x5a4ddb[_0x2e56('0x105')],'verticalAlignment':_0x5a4ddb['verticalAlignment'],'div_color':_0x5a4ddb['color'],'labelText':_0x5a4ddb[_0x2e56('0x106')],'text_color':_0x5a4ddb[_0x2e56('0x107')],'button_color':_0x5a4ddb[_0x2e56('0x108')],'background_color':_0x5a4ddb['backgroundColor']}));})[_0x2e56('0x1b')](handleError(_0x1e2c40,null));};exports[_0x2e56('0x109')]=function(_0x3e2be2,_0x19f413){var _0x595a90=_0x3e2be2['params']['id'];var _0x3a1427=_0x3e2be2[_0x2e56('0x4e')];var _0x3f1b66=0xc8;var _0x428967=null;return db[_0x2e56('0x10a')]['transaction']({'isolationLevel':db['sequelize'][_0x2e56('0x10b')][_0x2e56('0x10c')][_0x2e56('0x10d')]},function(_0xd52e32){return db[_0x2e56('0x2e')]['findOne']({'where':{'id':_0x595a90},'transaction':_0xd52e32})[_0x2e56('0x12')](function(_0x37054a){if(_0x37054a){return db[_0x2e56('0x8c')][_0x2e56('0x25')]({'where':{'ChatWebsiteId':_0x595a90},'transaction':_0xd52e32})[_0x2e56('0x12')](function(){var _0x196825=_[_0x2e56('0x2d')](_0x3a1427,function(_0x284be6){_0x284be6[_0x2e56('0x57')]=_0x595a90;return _0x284be6;});return db[_0x2e56('0x8c')][_0x2e56('0x10e')](_0x196825,{'transaction':_0xd52e32});});}else{_0x3f1b66=0x194;_0x428967=[];}});})['then'](function(){if(_0x3f1b66!==0x194){return db['ChatApplication'][_0x2e56('0x10f')]({'where':{'ChatWebsiteId':_0x595a90},'order':_0x2e56('0x91')})[_0x2e56('0x12')](function(_0x3d164f){_0x428967=_0x3d164f;});}})[_0x2e56('0x1b')](function(_0x1898c7){_0x3f1b66=0x1f4;logger['error'](_0x1898c7[_0x2e56('0x110')]);if(_0x1898c7[_0x2e56('0x33')]){delete _0x1898c7['name'];}_0x428967=_0x1898c7;})[_0x2e56('0x111')](function(){if(_0x428967===null){_0x19f413[_0x2e56('0x29')](_0x3f1b66);}else{if(_0x3f1b66===0x1f4){_0x19f413[_0x2e56('0x1c')](_0x3f1b66)['send'](_0x428967);}else{_0x19f413[_0x2e56('0x1c')](_0x3f1b66)['json'](_0x428967);}}});};exports[_0x2e56('0x112')]=function(_0x6c9c24,_0x491368){var _0x5553f3={};var _0x42d61c={};var _0x4fd98e;var _0x417497;return db[_0x2e56('0x2e')][_0x2e56('0x5a')]({'where':{'id':_0x6c9c24[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x491368,null))[_0x2e56('0x12')](function(_0x71957c){if(_0x71957c){_0x4fd98e=_0x71957c;_0x42d61c[_0x2e56('0x37')]=_[_0x2e56('0x4a')](db['ChatApplication'][_0x2e56('0x2f')]);_0x42d61c[_0x2e56('0x34')]=_[_0x2e56('0x4a')](_0x6c9c24[_0x2e56('0x34')]);_0x42d61c[_0x2e56('0x35')]=_['intersection'](_0x42d61c[_0x2e56('0x37')],_0x42d61c[_0x2e56('0x34')]);_0x5553f3['attributes']=_[_0x2e56('0x36')](_0x42d61c['model'],qs['fields'](_0x6c9c24[_0x2e56('0x34')][_0x2e56('0x39')]));_0x5553f3[_0x2e56('0x38')]=_0x5553f3['attributes']['length']?_0x5553f3[_0x2e56('0x38')]:_0x42d61c['model'];_0x5553f3[_0x2e56('0x5b')]=qs[_0x2e56('0x3e')](_0x6c9c24[_0x2e56('0x34')]['sort']);_0x5553f3['where']=qs['filters'](_[_0x2e56('0x40')](_0x6c9c24[_0x2e56('0x34')],_0x42d61c[_0x2e56('0x35')]));if(_0x6c9c24[_0x2e56('0x34')]['filter']){_0x5553f3[_0x2e56('0x3f')]=_[_0x2e56('0x42')](_0x5553f3[_0x2e56('0x3f')],{'$or':_[_0x2e56('0x2d')](_0x5553f3[_0x2e56('0x38')],function(_0x33753b){var _0x422b66={};_0x422b66[_0x33753b]={'$like':'%'+_0x6c9c24['query'][_0x2e56('0x41')]+'%'};return _0x422b66;})});}_0x5553f3=_[_0x2e56('0x42')]({},_0x5553f3,_0x6c9c24[_0x2e56('0x44')]);return _0x4fd98e[_0x2e56('0x112')](_0x5553f3);}})[_0x2e56('0x12')](function(_0x4b53f8){if(_0x4b53f8){_0x417497=_0x4b53f8[_0x2e56('0x3a')];if(!_0x6c9c24[_0x2e56('0x34')]['hasOwnProperty'](_0x2e56('0x3c'))){_0x5553f3['limit']=qs['limit'](_0x6c9c24[_0x2e56('0x34')]['limit']);_0x5553f3['offset']=qs['offset'](_0x6c9c24[_0x2e56('0x34')][_0x2e56('0x3d')]);}return _0x4fd98e[_0x2e56('0x112')](_0x5553f3);}})[_0x2e56('0x12')](function(_0x47b0e6){if(_0x47b0e6){return _0x47b0e6?{'count':_0x417497,'rows':_0x47b0e6}:null;}})[_0x2e56('0x12')](respondWithResult(_0x491368,null))[_0x2e56('0x1b')](handleError(_0x491368,null));};exports['addProactiveActions']=function(_0x53d215,_0xf0a581){return db[_0x2e56('0x113')]['find']({'where':{'id':_0x53d215[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0xf0a581,null))[_0x2e56('0x12')](function(_0x3e8ea3){if(_0x3e8ea3){return _0x3e8ea3[_0x2e56('0x114')](_0x53d215[_0x2e56('0x4e')][_0x2e56('0x60')],_[_0x2e56('0xe5')](_0x53d215[_0x2e56('0x4e')],[_0x2e56('0x60'),'id'])||{});}})[_0x2e56('0x12')](respondWithResult(_0xf0a581,null))[_0x2e56('0x1b')](handleError(_0xf0a581,null));};exports[_0x2e56('0x115')]=function(_0x4c3872,_0x117d8e){var _0x4f8b24={};var _0x4dc56b={};var _0x1b5fb9;var _0x4533b1;return db[_0x2e56('0x2e')][_0x2e56('0x5a')]({'where':{'id':_0x4c3872[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x117d8e,null))[_0x2e56('0x12')](function(_0x6909aa){if(_0x6909aa){_0x1b5fb9=_0x6909aa;_0x4dc56b['model']=_['keys'](db[_0x2e56('0x116')][_0x2e56('0x2f')]);_0x4dc56b[_0x2e56('0x34')]=_[_0x2e56('0x4a')](_0x4c3872[_0x2e56('0x34')]);_0x4dc56b['filters']=_[_0x2e56('0x36')](_0x4dc56b['model'],_0x4dc56b[_0x2e56('0x34')]);_0x4f8b24[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0x4dc56b[_0x2e56('0x37')],qs[_0x2e56('0x39')](_0x4c3872[_0x2e56('0x34')][_0x2e56('0x39')]));_0x4f8b24[_0x2e56('0x38')]=_0x4f8b24[_0x2e56('0x38')][_0x2e56('0x3a')]?_0x4f8b24['attributes']:_0x4dc56b[_0x2e56('0x37')];_0x4f8b24[_0x2e56('0x5b')]=qs['sort'](_0x4c3872[_0x2e56('0x34')][_0x2e56('0x3e')]);_0x4f8b24[_0x2e56('0x3f')]=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0x4c3872[_0x2e56('0x34')],_0x4dc56b[_0x2e56('0x35')]));if(_0x4c3872['query']['filter']){_0x4f8b24[_0x2e56('0x3f')]=_[_0x2e56('0x42')](_0x4f8b24[_0x2e56('0x3f')],{'$or':_['map'](_0x4f8b24[_0x2e56('0x38')],function(_0xd1f143){var _0x35e4b7={};_0x35e4b7[_0xd1f143]={'$like':'%'+_0x4c3872[_0x2e56('0x34')][_0x2e56('0x41')]+'%'};return _0x35e4b7;})});}_0x4f8b24=_['merge']({},_0x4f8b24,_0x4c3872[_0x2e56('0x44')]);return _0x1b5fb9[_0x2e56('0x115')](_0x4f8b24);}})[_0x2e56('0x12')](function(_0x5700ee){if(_0x5700ee){_0x4533b1=_0x5700ee[_0x2e56('0x3a')];if(!_0x4c3872[_0x2e56('0x34')][_0x2e56('0x3b')]('nolimit')){_0x4f8b24[_0x2e56('0x20')]=qs[_0x2e56('0x20')](_0x4c3872[_0x2e56('0x34')][_0x2e56('0x20')]);_0x4f8b24[_0x2e56('0x3d')]=qs['offset'](_0x4c3872['query'][_0x2e56('0x3d')]);}return _0x1b5fb9[_0x2e56('0x115')](_0x4f8b24);}})[_0x2e56('0x12')](function(_0x5e05b2){if(_0x5e05b2){return _0x5e05b2?{'count':_0x4533b1,'rows':_0x5e05b2}:null;}})[_0x2e56('0x12')](respondWithResult(_0x117d8e,null))['catch'](handleError(_0x117d8e,null));};exports[_0x2e56('0x117')]=function(_0x119798,_0x562dc6){var _0x26c3eb=_0x119798[_0x2e56('0x34')]['online']===_0x2e56('0x118')?_0x2e56('0x119'):_0x2e56('0x11a');return db['ChatWebsite'][_0x2e56('0x4c')]({'attributes':['id',_0x26c3eb],'where':{'id':_0x119798[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x562dc6,null))[_0x2e56('0x12')](function(_0x32ca4e){if(_0x32ca4e){var _0x5237c1=_0x32ca4e[_0x26c3eb];var _0x4c7223=_0x5237c1&&_0x5237c1[_0x2e56('0x11b')]?_0x5237c1[_0x2e56('0x11b')]:[];_0x562dc6[_0x2e56('0x2a')]({'fromKey':_[_0x2e56('0x6c')](_0x5237c1[_0x2e56('0x11c')])?undefined:_0x5237c1[_0x2e56('0x11c')],'count':_0x4c7223['length'],'rows':_0x4c7223});}})[_0x2e56('0x1b')](handleError(_0x562dc6,null));};exports['getOfflineMessages']=function(_0x173876,_0x130342){var _0x258040={'raw':![],'where':{}};var _0x18c0f5={};var _0x136e24={'count':0x0,'rows':[]};return db[_0x2e56('0x2e')][_0x2e56('0x5a')]({'where':{'id':_0x173876[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0x130342,null))[_0x2e56('0x12')](function(_0x13580f){if(_0x13580f){_0x18c0f5['model']=_[_0x2e56('0x4a')](db[_0x2e56('0x11d')]['rawAttributes']);_0x18c0f5[_0x2e56('0x34')]=_['keys'](_0x173876[_0x2e56('0x34')]);_0x18c0f5[_0x2e56('0x35')]=_[_0x2e56('0x36')](_0x18c0f5[_0x2e56('0x37')],_0x18c0f5['query']);_0x258040[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0x18c0f5[_0x2e56('0x37')],qs[_0x2e56('0x39')](_0x173876['query']['fields']));_0x258040[_0x2e56('0x38')]=_0x258040[_0x2e56('0x38')][_0x2e56('0x3a')]?_0x258040[_0x2e56('0x38')]:_0x18c0f5['model'];if(!_0x173876['query'][_0x2e56('0x3b')](_0x2e56('0x3c'))){_0x258040['limit']=qs[_0x2e56('0x20')](_0x173876['query']['limit']);_0x258040[_0x2e56('0x3d')]=qs[_0x2e56('0x3d')](_0x173876[_0x2e56('0x34')][_0x2e56('0x3d')]);}_0x258040['order']=qs['sort'](_0x173876['query'][_0x2e56('0x3e')]);_0x258040[_0x2e56('0x3f')]=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0x173876[_0x2e56('0x34')],_0x18c0f5[_0x2e56('0x35')]));_0x258040[_0x2e56('0x3f')][_0x2e56('0x57')]=_0x13580f['id'];if(_0x173876[_0x2e56('0x34')][_0x2e56('0x41')]){_0x258040[_0x2e56('0x3f')]=_[_0x2e56('0x42')](_0x258040[_0x2e56('0x3f')],{'$or':_[_0x2e56('0x2d')](_0x258040[_0x2e56('0x38')],function(_0x353490){var _0x4c2d3d={};_0x4c2d3d[_0x353490]={'$like':'%'+_0x173876[_0x2e56('0x34')][_0x2e56('0x41')]+'%'};return _0x4c2d3d;})});}_0x258040=_[_0x2e56('0x42')]({},_0x258040,_0x173876[_0x2e56('0x44')]);return db['ChatOfflineMessage'][_0x2e56('0x21')]({'where':_0x258040[_0x2e56('0x3f')]})[_0x2e56('0x12')](function(_0x5f1774){_0x136e24[_0x2e56('0x21')]=_0x5f1774;if(_0x173876[_0x2e56('0x34')][_0x2e56('0x45')]){_0x258040[_0x2e56('0x4b')]=[{'all':!![]}];}else{_0x258040[_0x2e56('0x4b')]=[{'model':db['CmContact'],'as':_0x2e56('0xe6'),'required':![]},{'model':db[_0x2e56('0x11e')],'as':'Attachments','required':![]}];}return db[_0x2e56('0x11d')][_0x2e56('0x46')](_0x258040);})['then'](function(_0x43ae95){_0x136e24[_0x2e56('0x47')]=_0x43ae95;return _0x136e24;});}})['then'](respondWithFilteredResult(_0x130342,_0x258040))[_0x2e56('0x1b')](handleError(_0x130342,null));};exports[_0x2e56('0x11f')]=function(_0x1487a8,_0x3f6920){return db['ChatWebsite'][_0x2e56('0x4c')]({'where':{'id':_0x1487a8['params']['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x3f6920,null))[_0x2e56('0x12')](function(_0xa09c34){if(_0xa09c34){return _0xa09c34['addAgents'](_0x1487a8['body']['ids'],_['omit'](_0x1487a8[_0x2e56('0x4e')],[_0x2e56('0x60'),'id'])||{})[_0x2e56('0xa6')](function(_0x443282){for(var _0x1c6106=0x0;_0x1c6106<_0x1487a8[_0x2e56('0x4e')]['ids']['length'];_0x1c6106+=0x1){socket[_0x2e56('0x120')]('userChatWebsite:save',{'UserId':Number(_0x1487a8[_0x2e56('0x4e')][_0x2e56('0x60')][_0x1c6106]),'ChatWebsiteId':Number(_0x1487a8[_0x2e56('0x54')]['id'])});}return _0x443282;});}})['then'](respondWithResult(_0x3f6920,null))['catch'](handleError(_0x3f6920,null));};exports[_0x2e56('0x121')]=function(_0x2ec4f3,_0x460114){return db[_0x2e56('0x2e')][_0x2e56('0x4c')]({'where':{'id':_0x2ec4f3[_0x2e56('0x54')]['id']}})[_0x2e56('0x12')](handleEntityNotFound(_0x460114,null))['then'](function(_0x318327){if(_0x318327){return _0x318327['removeAgents'](_0x2ec4f3[_0x2e56('0x34')][_0x2e56('0x60')])['then'](function(){if(_[_0x2e56('0x122')](_0x2ec4f3[_0x2e56('0x34')][_0x2e56('0x60')])){for(var _0x101d4b=0x0;_0x101d4b<_0x2ec4f3[_0x2e56('0x34')][_0x2e56('0x60')][_0x2e56('0x3a')];_0x101d4b+=0x1){socket[_0x2e56('0x120')](_0x2e56('0x123'),{'UserId':Number(_0x2ec4f3[_0x2e56('0x34')][_0x2e56('0x60')][_0x101d4b]),'ChatWebsiteId':Number(_0x2ec4f3[_0x2e56('0x54')]['id'])});}}else{socket[_0x2e56('0x120')](_0x2e56('0x123'),{'UserId':Number(_0x2ec4f3[_0x2e56('0x34')][_0x2e56('0x60')]),'ChatWebsiteId':Number(_0x2ec4f3[_0x2e56('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x460114,null))[_0x2e56('0x1b')](handleError(_0x460114,null));};exports['getAgents']=function(_0xf8088d,_0x3c06ed){var _0x19a4a8={};var _0x34a8da={};var _0x50f6de;var _0x41e679;return db['ChatWebsite'][_0x2e56('0x5a')]({'where':{'id':_0xf8088d[_0x2e56('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c06ed,null))[_0x2e56('0x12')](function(_0x21b606){if(_0x21b606){_0x50f6de=_0x21b606;_0x34a8da[_0x2e56('0x37')]=_[_0x2e56('0x4a')](db[_0x2e56('0xb1')][_0x2e56('0x2f')]);_0x34a8da[_0x2e56('0x34')]=_[_0x2e56('0x4a')](_0xf8088d[_0x2e56('0x34')]);_0x34a8da[_0x2e56('0x35')]=_[_0x2e56('0x36')](_0x34a8da['model'],_0x34a8da['query']);_0x19a4a8[_0x2e56('0x38')]=_[_0x2e56('0x36')](_0x34a8da['model'],qs[_0x2e56('0x39')](_0xf8088d[_0x2e56('0x34')][_0x2e56('0x39')]));_0x19a4a8[_0x2e56('0x38')]=_0x19a4a8[_0x2e56('0x38')][_0x2e56('0x3a')]?_0x19a4a8[_0x2e56('0x38')]:_0x34a8da[_0x2e56('0x37')];_0x19a4a8['order']=qs[_0x2e56('0x3e')](_0xf8088d[_0x2e56('0x34')][_0x2e56('0x3e')]);_0x19a4a8['where']=qs[_0x2e56('0x35')](_[_0x2e56('0x40')](_0xf8088d[_0x2e56('0x34')],_0x34a8da[_0x2e56('0x35')]));if(_0xf8088d[_0x2e56('0x34')][_0x2e56('0x41')]){_0x19a4a8[_0x2e56('0x3f')]=_['merge'](_0x19a4a8[_0x2e56('0x3f')],{'$or':_[_0x2e56('0x2d')](_0x19a4a8['attributes'],function(_0x4c72d6){var _0xdc93d6={};_0xdc93d6[_0x4c72d6]={'$like':'%'+_0xf8088d[_0x2e56('0x34')][_0x2e56('0x41')]+'%'};return _0xdc93d6;})});}_0x19a4a8=_[_0x2e56('0x42')]({},_0x19a4a8,_0xf8088d[_0x2e56('0x44')]);return _0x50f6de['getAgents'](_0x19a4a8);}})[_0x2e56('0x12')](function(_0x45891a){if(_0x45891a){_0x41e679=_0x45891a['length'];if(!_0xf8088d[_0x2e56('0x34')][_0x2e56('0x3b')]('nolimit')){_0x19a4a8[_0x2e56('0x20')]=qs[_0x2e56('0x20')](_0xf8088d[_0x2e56('0x34')][_0x2e56('0x20')]);_0x19a4a8[_0x2e56('0x3d')]=qs[_0x2e56('0x3d')](_0xf8088d[_0x2e56('0x34')][_0x2e56('0x3d')]);}return _0x50f6de[_0x2e56('0x124')](_0x19a4a8);}})[_0x2e56('0x12')](function(_0x5ddc3e){if(_0x5ddc3e){return _0x5ddc3e?{'count':_0x41e679,'rows':_0x5ddc3e}:null;}})[_0x2e56('0x12')](respondWithResult(_0x3c06ed,null))[_0x2e56('0x1b')](handleError(_0x3c06ed,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 81726b2..dc24d7c 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 _0x6b4e=['emit','hasOwnProperty','hook','exports','../../mysqldb','remove'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2c4eb4,_0x42bc84){_0x2c4eb4=_0x2c4eb4-0x0;var _0x2f711c=_0x6b4e[_0x2c4eb4];return _0x2f711c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe6b4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe6b4('0x1')};function emitEvent(_0x3be9b1){return function(_0x1aedc5,_0x344db1,_0x436fc0){ChatWebsiteEvents[_0xe6b4('0x2')](_0x3be9b1+':'+_0x1aedc5['id'],_0x1aedc5);ChatWebsiteEvents['emit'](_0x3be9b1,_0x1aedc5);_0x436fc0(null);};}for(var e in events){if(events[_0xe6b4('0x3')](e)){var event=events[e];ChatWebsite[_0xe6b4('0x4')](e,emitEvent(event));}}module[_0xe6b4('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0xbe02=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x13b247,_0x33d312){var _0x305a4b=function(_0x46c7b5){while(--_0x46c7b5){_0x13b247['push'](_0x13b247['shift']());}};_0x305a4b(++_0x33d312);}(_0xbe02,0x146));var _0x2be0=function(_0x30f788,_0x17626d){_0x30f788=_0x30f788-0x0;var _0x34a919=_0xbe02[_0x30f788];return _0x34a919;};'use strict';var EventEmitter=require(_0x2be0('0x0'));var ChatWebsite=require(_0x2be0('0x1'))['db'][_0x2be0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2be0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2be0('0x4'),'afterDestroy':_0x2be0('0x5')};function emitEvent(_0x9eb980){return function(_0x364c99,_0x22ed11,_0x3b824){ChatWebsiteEvents[_0x2be0('0x6')](_0x9eb980+':'+_0x364c99['id'],_0x364c99);ChatWebsiteEvents[_0x2be0('0x6')](_0x9eb980,_0x364c99);_0x3b824(null);};}for(var e in events){if(events[_0x2be0('0x7')](e)){var event=events[e];ChatWebsite['hook'](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 0f1256a..a3f0351 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 _0xe07e=['path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise'];(function(_0x579dca,_0x31321c){var _0x200848=function(_0x17d9e3){while(--_0x17d9e3){_0x579dca['push'](_0x579dca['shift']());}};_0x200848(++_0x31321c);}(_0xe07e,0x127));var _0xee07=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xe07e[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require(_0xee07('0x0'));var logger=require(_0xee07('0x1'))(_0xee07('0x2'));var moment=require(_0xee07('0x3'));var BPromise=require('bluebird');var rp=require(_0xee07('0x4'));var fs=require('fs');var path=require(_0xee07('0x5'));var rimraf=require('rimraf');var config=require(_0xee07('0x6'));var attributes=require(_0xee07('0x7'));module[_0xee07('0x8')]=function(_0x3f8c95,_0x915313){return _0x3f8c95[_0xee07('0x9')](_0xee07('0xa'),attributes,{'tableName':_0xee07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc274=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatWebsite','lodash','util','../../config/logger'];(function(_0x27d877,_0x4ccf83){var _0x3d4d0e=function(_0x213c5a){while(--_0x213c5a){_0x27d877['push'](_0x27d877['shift']());}};_0x3d4d0e(++_0x4ccf83);}(_0xc274,0x17d));var _0x4c27=function(_0x54e60d,_0x3b3ee9){_0x54e60d=_0x54e60d-0x0;var _0x28db5e=_0xc274[_0x54e60d];return _0x28db5e;};'use strict';var _=require(_0x4c27('0x0'));var util=require(_0x4c27('0x1'));var logger=require(_0x4c27('0x2'))(_0x4c27('0x3'));var moment=require(_0x4c27('0x4'));var BPromise=require(_0x4c27('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c27('0x6'));var rimraf=require(_0x4c27('0x7'));var config=require(_0x4c27('0x8'));var attributes=require('./chatWebsite.attributes');module[_0x4c27('0x9')]=function(_0x3060f5,_0x58e0de){return _0x3060f5[_0x4c27('0xa')](_0x4c27('0xb'),attributes,{'tableName':'chat_websites','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 fd31c58..c41f520 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 _0x4567=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1c1f82,_0x5ec1b8){var _0x58e07f=function(_0x4e4cf4){while(--_0x4e4cf4){_0x1c1f82['push'](_0x1c1f82['shift']());}};_0x58e07f(++_0x5ec1b8);}(_0x4567,0x1b2));var _0x7456=function(_0x14a340,_0xb96778){_0x14a340=_0x14a340-0x0;var _0x48d1f0=_0x4567[_0x14a340];return _0x48d1f0;};'use strict';var _=require(_0x7456('0x0'));var util=require(_0x7456('0x1'));var moment=require('moment');var BPromise=require(_0x7456('0x2'));var rs=require(_0x7456('0x3'));var fs=require('fs');var Redis=require(_0x7456('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7456('0x5'));var logger=require(_0x7456('0x6'))(_0x7456('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7456('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7456('0x9')],{'host':_0x7456('0xa'),'port':0x18eb});var socket=require(_0x7456('0xb'))(new Redis(config['redis']));require(_0x7456('0xc'))['register'](socket);function respondWithRpcPromise(_0xfe7422,_0x2a388a,_0x2beff8){return new BPromise(function(_0x2e7ef3,_0x7b7129){return client[_0x7456('0xd')](_0xfe7422,_0x2beff8)['then'](function(_0x2d0b6d){logger[_0x7456('0xe')](_0x7456('0xf'),_0x2a388a,_0x7456('0x10'));logger[_0x7456('0x11')](_0x7456('0x12'),_0x2a388a,_0x7456('0x10'),JSON['stringify'](_0x2d0b6d));if(_0x2d0b6d[_0x7456('0x13')]){if(_0x2d0b6d['error'][_0x7456('0x14')]===0x1f4){logger['error'](_0x7456('0xf'),_0x2a388a,_0x2d0b6d[_0x7456('0x13')]['message']);return _0x7b7129(_0x2d0b6d[_0x7456('0x13')][_0x7456('0x15')]);}logger[_0x7456('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2a388a,_0x2d0b6d['error']['message']);return _0x2e7ef3(_0x2d0b6d[_0x7456('0x13')]['message']);}else{logger[_0x7456('0xe')](_0x7456('0xf'),_0x2a388a,_0x7456('0x10'));_0x2e7ef3(_0x2d0b6d[_0x7456('0x16')][_0x7456('0x15')]);}})[_0x7456('0x17')](function(_0x80f93){logger[_0x7456('0x13')](_0x7456('0xf'),_0x2a388a,_0x80f93);_0x7b7129(_0x80f93);});});} \ No newline at end of file +var _0x7a9d=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x7a9d,0x112));var _0xd7a9=function(_0x2bf86b,_0x508522){_0x2bf86b=_0x2bf86b-0x0;var _0x5b5ff6=_0x7a9d[_0x2bf86b];return _0x5b5ff6;};'use strict';var _=require(_0xd7a9('0x0'));var util=require(_0xd7a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd7a9('0x2'));var fs=require('fs');var Redis=require(_0xd7a9('0x3'));var db=require(_0xd7a9('0x4'))['db'];var utils=require(_0xd7a9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd7a9('0x6'));var jayson=require(_0xd7a9('0x7'));var client=jayson[_0xd7a9('0x8')]['http']({'port':0x232a});config[_0xd7a9('0x9')]=_[_0xd7a9('0xa')](config[_0xd7a9('0x9')],{'host':_0xd7a9('0xb'),'port':0x18eb});var socket=require(_0xd7a9('0xc'))(new Redis(config[_0xd7a9('0x9')]));require(_0xd7a9('0xd'))[_0xd7a9('0xe')](socket);function respondWithRpcPromise(_0x47b53f,_0x596894,_0x4fc0a4){return new BPromise(function(_0xeed2c7,_0x374ba5){return client['request'](_0x47b53f,_0x4fc0a4)[_0xd7a9('0xf')](function(_0x253d6a){logger['info'](_0xd7a9('0x10'),_0x596894,'request\x20sent');logger[_0xd7a9('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x596894,_0xd7a9('0x12'),JSON[_0xd7a9('0x13')](_0x253d6a));if(_0x253d6a[_0xd7a9('0x14')]){if(_0x253d6a[_0xd7a9('0x14')][_0xd7a9('0x15')]===0x1f4){logger['error'](_0xd7a9('0x10'),_0x596894,_0x253d6a[_0xd7a9('0x14')][_0xd7a9('0x16')]);return _0x374ba5(_0x253d6a[_0xd7a9('0x14')][_0xd7a9('0x16')]);}logger[_0xd7a9('0x14')](_0xd7a9('0x10'),_0x596894,_0x253d6a[_0xd7a9('0x14')][_0xd7a9('0x16')]);return _0xeed2c7(_0x253d6a[_0xd7a9('0x14')][_0xd7a9('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x596894,_0xd7a9('0x12'));_0xeed2c7(_0x253d6a[_0xd7a9('0x17')]['message']);}})[_0xd7a9('0x18')](function(_0x1ec3d4){logger[_0xd7a9('0x14')](_0xd7a9('0x10'),_0x596894,_0x1ec3d4);_0x374ba5(_0x1ec3d4);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fa5fa82..dd14d09 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 _0x8686=['removeListener','register','length','./chatWebsite.events','save','remove','update','emit'];(function(_0x5af522,_0x2b3022){var _0x2eec5f=function(_0xd2780f){while(--_0xd2780f){_0x5af522['push'](_0x5af522['shift']());}};_0x2eec5f(++_0x2b3022);}(_0x8686,0x7b));var _0x6868=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x8686[_0x2afbb0];return _0x411ff2;};'use strict';var ChatWebsiteEvents=require(_0x6868('0x0'));var events=[_0x6868('0x1'),_0x6868('0x2'),_0x6868('0x3')];function createListener(_0x38f9df,_0x4bfb5e){return function(_0x4bdb37){_0x4bfb5e[_0x6868('0x4')](_0x38f9df,_0x4bdb37);};}function removeListener(_0x556b13,_0x383aab){return function(){ChatWebsiteEvents[_0x6868('0x5')](_0x556b13,_0x383aab);};}exports[_0x6868('0x6')]=function(_0x3fcd8c){for(var _0x200737=0x0,_0x53da50=events[_0x6868('0x7')];_0x200737<_0x53da50;_0x200737++){var _0x58298b=events[_0x200737];var _0x9556e1=createListener('chatWebsite:'+_0x58298b,_0x3fcd8c);ChatWebsiteEvents['on'](_0x58298b,_0x9556e1);}}; \ No newline at end of file +var _0xdef0=['register','length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x34d152,_0x515b3b){var _0x2f360d=function(_0x8315d9){while(--_0x8315d9){_0x34d152['push'](_0x34d152['shift']());}};_0x2f360d(++_0x515b3b);}(_0xdef0,0x19b));var _0x0def=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdef0[_0x2dafbe];return _0x58a45a;};'use strict';var ChatWebsiteEvents=require(_0x0def('0x0'));var events=[_0x0def('0x1'),'remove',_0x0def('0x2')];function createListener(_0xf3397e,_0x4f19e4){return function(_0x1c65c3){_0x4f19e4[_0x0def('0x3')](_0xf3397e,_0x1c65c3);};}function removeListener(_0x3c05b3,_0x3dbc29){return function(){ChatWebsiteEvents[_0x0def('0x4')](_0x3c05b3,_0x3dbc29);};}exports[_0x0def('0x5')]=function(_0xfc90e1){for(var _0x3d0a40=0x0,_0x71a39a=events[_0x0def('0x6')];_0x3d0a40<_0x71a39a;_0x3d0a40++){var _0x3ef19a=events[_0x3d0a40];var _0x5e1bb0=createListener(_0x0def('0x7')+_0x3ef19a,_0xfc90e1);ChatWebsiteEvents['on'](_0x3ef19a,_0x5e1bb0);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 1b17ffd..768b8d0 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 _0xce61=['/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','join','format','now','originalname','addLogo','diskStorage','root','server/files/images/avatars/','/:id/avatar','single','addAvatar','%s-%s','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xce61,0xd6));var _0x1ce6=function(_0x21a3a6,_0x30957e){_0x21a3a6=_0x21a3a6-0x0;var _0x17c8a3=_0xce61[_0x21a3a6];return _0x17c8a3;};'use strict';var multer=require(_0x1ce6('0x0'));var util=require(_0x1ce6('0x1'));var path=require(_0x1ce6('0x2'));var timeout=require(_0x1ce6('0x3'));var express=require(_0x1ce6('0x4'));var router=express[_0x1ce6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1ce6('0x6'));var interaction=require(_0x1ce6('0x7'));var config=require(_0x1ce6('0x8'));var controller=require(_0x1ce6('0x9'));router[_0x1ce6('0xa')]('/',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xc')]);router[_0x1ce6('0xa')](_0x1ce6('0xd'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xe')]);router[_0x1ce6('0xa')]('/:id',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xf')]);router['get'](_0x1ce6('0x10'),auth['isAuthenticated'](),controller[_0x1ce6('0x11')]);router[_0x1ce6('0xa')]('/:id/canned_answers',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x12')]);router['get'](_0x1ce6('0x13'),controller[_0x1ce6('0x14')]);router['get']('/:id/avatar',controller[_0x1ce6('0x15')]);router[_0x1ce6('0xa')](_0x1ce6('0x16'),controller[_0x1ce6('0x17')]);router[_0x1ce6('0xa')](_0x1ce6('0x18'),controller[_0x1ce6('0x19')]);router['get'](_0x1ce6('0x1a'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x1b')]);router['get'](_0x1ce6('0x1c'),controller[_0x1ce6('0x1d')]);router[_0x1ce6('0xa')](_0x1ce6('0x1e'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x1f')]);router[_0x1ce6('0xa')](_0x1ce6('0x20'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x21')]);router[_0x1ce6('0xa')](_0x1ce6('0x22'),controller[_0x1ce6('0x23')]);router['get'](_0x1ce6('0x24'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x25')]);router[_0x1ce6('0xa')](_0x1ce6('0x26'),auth['isAuthenticated'](),controller[_0x1ce6('0x27')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ce6('0x28')]);router[_0x1ce6('0x29')](_0x1ce6('0x10'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x2a')]);router[_0x1ce6('0x29')](_0x1ce6('0x2b'),auth['isAuthenticated'](),controller[_0x1ce6('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc9b9,_0xc47d96,_0x2d7fa9){_0x2d7fa9(null,path[_0x1ce6('0x2d')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1f5c53,_0x2cf7e0,_0x69d5af){_0x69d5af(null,util[_0x1ce6('0x2e')]('%s-%s',Date[_0x1ce6('0x2f')](),_0x2cf7e0[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x13'),upload['single']('file'),controller[_0x1ce6('0x31')]);var upload=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x11c296,_0x4a58b5,_0x10c741){_0x10c741(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],_0x1ce6('0x34')));},'filename':function(_0x875683,_0x300fd4,_0x165607){_0x165607(null,util[_0x1ce6('0x2e')]('%s-%s',Date[_0x1ce6('0x2f')](),_0x300fd4[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x35'),upload[_0x1ce6('0x36')]('file'),controller[_0x1ce6('0x37')]);var upload=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x34faf4,_0x1a7815,_0x33954a){_0x33954a(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],'server/files/images/avatars/'));},'filename':function(_0x11dde5,_0x268a4e,_0x297fec){_0x297fec(null,util[_0x1ce6('0x2e')](_0x1ce6('0x38'),Date[_0x1ce6('0x2f')](),_0x268a4e[_0x1ce6('0x30')]));}})});router['post'](_0x1ce6('0x16'),upload[_0x1ce6('0x36')](_0x1ce6('0x39')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a5612,_0x562ac7,_0x5e7001){_0x5e7001(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],_0x1ce6('0x34')));},'filename':function(_0x55cc98,_0x3bb436,_0x866d13){_0x866d13(null,util['format'](_0x1ce6('0x38'),Date['now'](),_0x3bb436[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x18'),upload[_0x1ce6('0x36')](_0x1ce6('0x39')),controller[_0x1ce6('0x3a')]);router[_0x1ce6('0x29')](_0x1ce6('0x3b'),controller[_0x1ce6('0x3c')]);const offlineUploadMulter=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x472342,_0x570535,_0x3d99d1){const _0x418178=path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],'server/files',_0x1ce6('0x3d'),_0x1ce6('0x3e'));fs_extra[_0x1ce6('0x3f')](_0x418178,function(){_0x3d99d1(null,_0x418178);});},'filename':function(_0x4874b3,_0x383bbf,_0xb4da77){const _0x520b2f=_0x383bbf['originalname'][_0x1ce6('0x40')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x70b620=path[_0x1ce6('0x41')](_0x520b2f);const _0x19ae90=Date[_0x1ce6('0x2f')]()+'-'+_0x520b2f['replace'](_0x70b620,'')+_0x70b620;_0xb4da77(null,_0x19ae90);}})});router[_0x1ce6('0x29')](_0x1ce6('0x42'),offlineUploadMulter[_0x1ce6('0x43')](),controller[_0x1ce6('0x44')]);router[_0x1ce6('0x29')](_0x1ce6('0x1a'),auth['isAuthenticated'](),controller[_0x1ce6('0x45')]);router[_0x1ce6('0x29')](_0x1ce6('0x1e'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x46')]);router[_0x1ce6('0x29')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x1ce6('0x47')]);router[_0x1ce6('0x29')](_0x1ce6('0x26'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x48')]);router[_0x1ce6('0x49')]('/:id',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4a')]);router[_0x1ce6('0x4b')](_0x1ce6('0x4c'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4d')]);router[_0x1ce6('0x4b')]('/:id/dispositions',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4e')]);router['delete']('/:id/canned_answers',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4f')]);router[_0x1ce6('0x4b')](_0x1ce6('0x26'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x50')]);module[_0x1ce6('0x51')]=router; \ No newline at end of file +var _0xa596=['getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','originalname','/:id/logo','single','file','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x4d38cf,_0x50efa6){var _0x40c835=function(_0x327729){while(--_0x327729){_0x4d38cf['push'](_0x4d38cf['shift']());}};_0x40c835(++_0x50efa6);}(_0xa596,0x81));var _0x6a59=function(_0x6d6b83,_0x3b94d8){_0x6d6b83=_0x6d6b83-0x0;var _0x5f003f=_0xa596[_0x6d6b83];return _0x5f003f;};'use strict';var multer=require('multer');var util=require(_0x6a59('0x0'));var path=require(_0x6a59('0x1'));var timeout=require(_0x6a59('0x2'));var express=require(_0x6a59('0x3'));var router=express[_0x6a59('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6a59('0x5'));var interaction=require(_0x6a59('0x6'));var config=require(_0x6a59('0x7'));var controller=require(_0x6a59('0x8'));router[_0x6a59('0x9')]('/',auth[_0x6a59('0xa')](),controller[_0x6a59('0xb')]);router['get'](_0x6a59('0xc'),auth[_0x6a59('0xa')](),controller[_0x6a59('0xd')]);router[_0x6a59('0x9')](_0x6a59('0xe'),auth[_0x6a59('0xa')](),controller[_0x6a59('0xf')]);router['get'](_0x6a59('0x10'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x11')]);router[_0x6a59('0x9')](_0x6a59('0x12'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x13')]);router['get']('/:id/logo',controller[_0x6a59('0x14')]);router[_0x6a59('0x9')]('/:id/avatar',controller[_0x6a59('0x15')]);router['get'](_0x6a59('0x16'),controller[_0x6a59('0x17')]);router[_0x6a59('0x9')](_0x6a59('0x18'),controller['getSystemAvatar']);router[_0x6a59('0x9')](_0x6a59('0x19'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x6a59('0x9')](_0x6a59('0x1a'),controller[_0x6a59('0x1b')]);router[_0x6a59('0x9')](_0x6a59('0x1c'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x1d')]);router[_0x6a59('0x9')](_0x6a59('0x1e'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x1f')]);router[_0x6a59('0x9')](_0x6a59('0x20'),controller[_0x6a59('0x21')]);router[_0x6a59('0x9')](_0x6a59('0x22'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x23')]);router['get'](_0x6a59('0x24'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x25')]);router['post']('/',auth[_0x6a59('0xa')](),controller['create']);router[_0x6a59('0x26')](_0x6a59('0x10'),auth['isAuthenticated'](),controller[_0x6a59('0x27')]);router[_0x6a59('0x26')]('/:id/canned_answers',auth[_0x6a59('0xa')](),controller[_0x6a59('0x28')]);var upload=multer({'storage':multer[_0x6a59('0x29')]({'destination':function(_0x4d6b29,_0x3b6129,_0x8e9dfc){_0x8e9dfc(null,path[_0x6a59('0x2a')](config[_0x6a59('0x2b')],'server/files/images/logos/'));},'filename':function(_0x204a75,_0x225901,_0x27f6bb){_0x27f6bb(null,util[_0x6a59('0x2c')](_0x6a59('0x2d'),Date['now'](),_0x225901[_0x6a59('0x2e')]));}})});router[_0x6a59('0x26')](_0x6a59('0x2f'),upload[_0x6a59('0x30')](_0x6a59('0x31')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x599602,_0xbb951a,_0x56912f){_0x56912f(null,path[_0x6a59('0x2a')](config[_0x6a59('0x2b')],_0x6a59('0x32')));},'filename':function(_0x1d9a6b,_0x1ae163,_0x4e6439){_0x4e6439(null,util['format'](_0x6a59('0x2d'),Date[_0x6a59('0x33')](),_0x1ae163['originalname']));}})});router['post'](_0x6a59('0x34'),upload['single'](_0x6a59('0x31')),controller[_0x6a59('0x35')]);var upload=multer({'storage':multer[_0x6a59('0x29')]({'destination':function(_0x591c6b,_0x4c3446,_0x408213){_0x408213(null,path[_0x6a59('0x2a')](config[_0x6a59('0x2b')],_0x6a59('0x32')));},'filename':function(_0x466c16,_0x5f3b5f,_0x5089d3){_0x5089d3(null,util[_0x6a59('0x2c')](_0x6a59('0x2d'),Date['now'](),_0x5f3b5f[_0x6a59('0x2e')]));}})});router['post'](_0x6a59('0x16'),upload[_0x6a59('0x30')](_0x6a59('0x31')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ee9ad,_0x54bbbb,_0x50028a){_0x50028a(null,path[_0x6a59('0x2a')](config[_0x6a59('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x249454,_0x5b967a,_0x3a50c1){_0x3a50c1(null,util['format'](_0x6a59('0x2d'),Date[_0x6a59('0x33')](),_0x5b967a[_0x6a59('0x2e')]));}})});router[_0x6a59('0x26')](_0x6a59('0x18'),upload[_0x6a59('0x30')](_0x6a59('0x31')),controller[_0x6a59('0x36')]);router[_0x6a59('0x26')](_0x6a59('0x37'),controller[_0x6a59('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x6a59('0x29')]({'destination':function(_0x4a9a70,_0x95fdec,_0xd3b0a){const _0x26f753=path[_0x6a59('0x2a')](config[_0x6a59('0x2b')],_0x6a59('0x39'),_0x6a59('0x3a'),_0x6a59('0x3b'));fs_extra[_0x6a59('0x3c')](_0x26f753,function(){_0xd3b0a(null,_0x26f753);});},'filename':function(_0x595098,_0xd41ea7,_0x1dc2db){const _0x5a189c=_0xd41ea7[_0x6a59('0x2e')][_0x6a59('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x341d6b=path['extname'](_0x5a189c);const _0x4a6745=Date[_0x6a59('0x33')]()+'-'+_0x5a189c[_0x6a59('0x3d')](_0x341d6b,'')+_0x341d6b;_0x1dc2db(null,_0x4a6745);}})});router[_0x6a59('0x26')]('/:id/offline',offlineUploadMulter[_0x6a59('0x3e')](),controller[_0x6a59('0x3f')]);router[_0x6a59('0x26')]('/:id/interactions',auth[_0x6a59('0xa')](),controller[_0x6a59('0x40')]);router[_0x6a59('0x26')](_0x6a59('0x1c'),auth[_0x6a59('0xa')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x6a59('0x41')]);router[_0x6a59('0x26')](_0x6a59('0x24'),auth['isAuthenticated'](),controller[_0x6a59('0x42')]);router[_0x6a59('0x43')](_0x6a59('0xe'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x44')]);router[_0x6a59('0x45')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x6a59('0x45')](_0x6a59('0x10'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x46')]);router['delete'](_0x6a59('0x12'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x47')]);router[_0x6a59('0x45')](_0x6a59('0x24'),auth['isAuthenticated'](),controller[_0x6a59('0x48')]);module[_0x6a59('0x49')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index dea8542..257ef1e 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 _0xb61a=['Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM'];(function(_0x2a6073,_0x5c42d3){var _0x6b34dc=function(_0x35bf07){while(--_0x35bf07){_0x2a6073['push'](_0x2a6073['shift']());}};_0x6b34dc(++_0x5c42d3);}(_0xb61a,0x165));var _0xab61=function(_0x3695a8,_0x364266){_0x3695a8=_0x3695a8-0x0;var _0x463e61=_0xb61a[_0x3695a8];return _0x463e61;};'use strict';var Sequelize=require(_0xab61('0x0'));module['exports']={'name':{'type':Sequelize[_0xab61('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xab61('0x2')]('AmazonAWS','Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xab61('0x2')]('Outlook365',_0xab61('0x3'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xab61('0x1')],'comment':_0xab61('0x4')},'data3':{'type':Sequelize['STRING'],'comment':_0xab61('0x5')},'data4':{'type':Sequelize[_0xab61('0x1')],'comment':_0xab61('0x6')},'data5':{'type':Sequelize['TEXT'],'comment':_0xab61('0x7')},'data6':{'type':Sequelize[_0xab61('0x8')],'comment':_0xab61('0x9')}}; \ No newline at end of file +var _0x1f53=['Google','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f53,0x16e));var _0x31f5=function(_0x226724,_0x110fc8){_0x226724=_0x226724-0x0;var _0x373db3=_0x1f53[_0x226724];return _0x373db3;};'use strict';var Sequelize=require(_0x31f5('0x0'));module[_0x31f5('0x1')]={'name':{'type':Sequelize[_0x31f5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x31f5('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x31f5('0x4')]('Outlook365',_0x31f5('0x5'))},'data1':{'type':Sequelize[_0x31f5('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x31f5('0x6')},'data3':{'type':Sequelize[_0x31f5('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x31f5('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x31f5('0x7')],'comment':_0x31f5('0x8')},'data6':{'type':Sequelize[_0x31f5('0x7')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 6a6933a..fe43eb7 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 _0x079b=['openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','send','map','CloudProvider','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','hex','client_id','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','oauth2Claims','oauth2/','data1','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','refresh_token','data6','POST','access_token','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','ascii','del','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','request-promise','lodash','moment','crypto','jsonwebtoken','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x079b,0x165));var _0xb079=function(_0x391e9c,_0x3b4958){_0x391e9c=_0x391e9c-0x0;var _0x1807da=_0x079b[_0x391e9c];return _0x1807da;};'use strict';var rp=require(_0xb079('0x0'));var _=require(_0xb079('0x1'));var moment=require(_0xb079('0x2'));var crypto=require(_0xb079('0x3'));var jwt=require(_0xb079('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var config=require(_0xb079('0x5'));var logger=require(_0xb079('0x6'))('api');var db=require(_0xb079('0x7'))['db'];config[_0xb079('0x8')]=_['defaults'](config[_0xb079('0x8')],{'host':_0xb079('0x9'),'port':0x18eb});var socket=require(_0xb079('0xa'))(new Redis(config[_0xb079('0x8')]));var redis=new Redis(config[_0xb079('0x8')]);var MICROSOFT_AUTH_URL=_0xb079('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb079('0xc'),_0xb079('0xd'),_0xb079('0xe'),'offline_access',_0xb079('0xf'),_0xb079('0x10'),_0xb079('0x11')],'Dynamics365':['openid',_0xb079('0x12')]};var AZURE_TOKEN_SCOPES={'Outlook365':_0xb079('0xf'),'Dynamics365':''};var MICROSOFT_AUTH_ENDPOINT=_0xb079('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';function respondWithStatusCode(_0x74e4a8,_0x575290){_0x575290=_0x575290||0xcc;return function(_0x3544f5){if(_0x3544f5){return _0x74e4a8[_0xb079('0x14')](_0x575290);}return _0x74e4a8['status'](_0x575290)[_0xb079('0x15')]();};}function respondWithResult(_0x56419c,_0x3c675e){_0x3c675e=_0x3c675e||0xc8;return function(_0x4ddc5f){if(_0x4ddc5f){return _0x56419c[_0xb079('0x16')](_0x3c675e)[_0xb079('0x17')](_0x4ddc5f);}};}function respondWithFilteredResult(_0x117ec5,_0x2b7d6f){return function(_0x4845ec){if(_0x4845ec){var _0x422110=typeof _0x2b7d6f[_0xb079('0x18')]===_0xb079('0x19')&&typeof _0x2b7d6f['limit']==='undefined';var _0x4872eb=_0x4845ec[_0xb079('0x1a')];var _0x13dd18=_0x422110?0x0:_0x2b7d6f[_0xb079('0x18')];var _0x2406db=_0x422110?_0x4845ec['count']:_0x2b7d6f[_0xb079('0x18')]+_0x2b7d6f[_0xb079('0x1b')];var _0x336629;if(_0x2406db>=_0x4872eb){_0x2406db=_0x4872eb;_0x336629=0xc8;}else{_0x336629=0xce;}_0x117ec5[_0xb079('0x16')](_0x336629);return _0x117ec5[_0xb079('0x1c')](_0xb079('0x1d'),_0x13dd18+'-'+_0x2406db+'/'+_0x4872eb)['json'](_0x4845ec);}return null;};}function saveUpdates(_0xd55d08){return function(_0x9a535b){if(_0x9a535b){return _0x9a535b['update'](_0xd55d08)[_0xb079('0x1e')](function(_0x53059a){return _0x53059a;});}return null;};}function removeEntity(_0x6b7eb4){return function(_0x42cb57){if(_0x42cb57){return _0x42cb57[_0xb079('0x1f')]()[_0xb079('0x1e')](function(){_0x6b7eb4[_0xb079('0x16')](0xcc)[_0xb079('0x15')]();});}};}function handleEntityNotFound(_0xfe9698){return function(_0x309b26){if(!_0x309b26){_0xfe9698[_0xb079('0x14')](0x194);}return _0x309b26;};}function handleError(_0x2a837f,_0x27d885){_0x27d885=_0x27d885||0x1f4;return function(_0x465625){logger[_0xb079('0x20')](_0x465625[_0xb079('0x21')]);if(_0x465625[_0xb079('0x22')]){delete _0x465625[_0xb079('0x22')];}_0x2a837f[_0xb079('0x16')](_0x27d885)[_0xb079('0x23')](_0x465625);};}exports['index']=function(_0x13f0cf,_0x3041e5){var _0x5ef466={},_0x43eae2={},_0x57f45a={'count':0x0,'rows':[]};var _0x4d627c=_[_0xb079('0x24')](db[_0xb079('0x25')][_0xb079('0x26')],function(_0xd68eda){return{'name':_0xd68eda[_0xb079('0x27')],'type':_0xd68eda['type'][_0xb079('0x28')]};});_0x43eae2['model']=_[_0xb079('0x24')](_0x4d627c,_0xb079('0x22'));_0x43eae2[_0xb079('0x29')]=_[_0xb079('0x2a')](_0x13f0cf['query']);_0x43eae2[_0xb079('0x2b')]=_['intersection'](_0x43eae2[_0xb079('0x2c')],_0x43eae2[_0xb079('0x29')]);_0x5ef466[_0xb079('0x2d')]=_[_0xb079('0x2e')](_0x43eae2[_0xb079('0x2c')],qs[_0xb079('0x2f')](_0x13f0cf[_0xb079('0x29')][_0xb079('0x2f')]));_0x5ef466['attributes']=_0x5ef466['attributes'][_0xb079('0x30')]?_0x5ef466[_0xb079('0x2d')]:_0x43eae2[_0xb079('0x2c')];if(!_0x13f0cf[_0xb079('0x29')][_0xb079('0x31')]('nolimit')){_0x5ef466['limit']=qs[_0xb079('0x1b')](_0x13f0cf[_0xb079('0x29')]['limit']);_0x5ef466[_0xb079('0x18')]=qs[_0xb079('0x18')](_0x13f0cf['query']['offset']);}_0x5ef466[_0xb079('0x32')]=qs[_0xb079('0x33')](_0x13f0cf[_0xb079('0x29')][_0xb079('0x33')]);_0x5ef466['where']=qs[_0xb079('0x2b')](_[_0xb079('0x34')](_0x13f0cf[_0xb079('0x29')],_0x43eae2[_0xb079('0x2b')]),_0x4d627c);if(_0x13f0cf[_0xb079('0x29')]['filter']){_0x5ef466['where']=_[_0xb079('0x35')](_0x5ef466[_0xb079('0x36')],{'$or':_[_0xb079('0x24')](_0x4d627c,function(_0x41256a){if(_0x41256a[_0xb079('0x37')]!==_0xb079('0x38')){var _0x213112={};_0x213112[_0x41256a[_0xb079('0x22')]]={'$like':'%'+_0x13f0cf[_0xb079('0x29')][_0xb079('0x39')]+'%'};return _0x213112;}})});}_0x5ef466=_['merge']({},_0x5ef466,_0x13f0cf[_0xb079('0x3a')]);var _0x230108={'where':_0x5ef466[_0xb079('0x36')]};return db[_0xb079('0x25')][_0xb079('0x1a')](_0x230108)[_0xb079('0x1e')](function(_0x430deb){_0x57f45a[_0xb079('0x1a')]=_0x430deb;if(_0x13f0cf[_0xb079('0x29')][_0xb079('0x3b')]){_0x5ef466[_0xb079('0x3c')]=[{'all':!![]}];}return db[_0xb079('0x25')][_0xb079('0x3d')](_0x5ef466);})[_0xb079('0x1e')](function(_0xbaf9d7){_0x57f45a[_0xb079('0x3e')]=_0xbaf9d7;return _0x57f45a;})[_0xb079('0x1e')](respondWithFilteredResult(_0x3041e5,_0x5ef466))[_0xb079('0x3f')](handleError(_0x3041e5,null));};exports[_0xb079('0x40')]=function(_0x447365,_0xc5e1a5){var _0x335b90={'raw':!![],'where':{'id':_0x447365[_0xb079('0x41')]['id']}},_0x314233={};_0x314233[_0xb079('0x2c')]=_[_0xb079('0x2a')](db[_0xb079('0x25')][_0xb079('0x26')]);_0x314233[_0xb079('0x29')]=_['keys'](_0x447365['query']);_0x314233[_0xb079('0x2b')]=_[_0xb079('0x2e')](_0x314233['model'],_0x314233[_0xb079('0x29')]);_0x335b90[_0xb079('0x2d')]=_['intersection'](_0x314233[_0xb079('0x2c')],qs[_0xb079('0x2f')](_0x447365['query']['fields']));_0x335b90[_0xb079('0x2d')]=_0x335b90['attributes'][_0xb079('0x30')]?_0x335b90[_0xb079('0x2d')]:_0x314233[_0xb079('0x2c')];if(_0x447365[_0xb079('0x29')]['includeAll']){_0x335b90[_0xb079('0x3c')]=[{'all':!![]}];}_0x335b90=_[_0xb079('0x35')]({},_0x335b90,_0x447365[_0xb079('0x3a')]);return db[_0xb079('0x25')][_0xb079('0x42')](_0x335b90)['then'](handleEntityNotFound(_0xc5e1a5,null))[_0xb079('0x1e')](respondWithResult(_0xc5e1a5,null))[_0xb079('0x3f')](handleError(_0xc5e1a5,null));};exports['create']=function(_0x214489,_0x432e1d){return db['CloudProvider'][_0xb079('0x43')](_0x214489[_0xb079('0x44')],{})[_0xb079('0x1e')](respondWithResult(_0x432e1d,0xc9))['catch'](handleError(_0x432e1d,null));};exports[_0xb079('0x45')]=function(_0x5f3257,_0x7b3bc4){if(_0x5f3257['body']['id']){delete _0x5f3257[_0xb079('0x44')]['id'];}return db[_0xb079('0x25')]['find']({'where':{'id':_0x5f3257[_0xb079('0x41')]['id']}})[_0xb079('0x1e')](handleEntityNotFound(_0x7b3bc4,null))['then'](saveUpdates(_0x5f3257[_0xb079('0x44')],null))['then'](respondWithResult(_0x7b3bc4,null))[_0xb079('0x3f')](handleError(_0x7b3bc4,null));};exports['destroy']=function(_0x478e1f,_0x4a1e60){return db[_0xb079('0x25')][_0xb079('0x42')]({'where':{'id':_0x478e1f[_0xb079('0x41')]['id']}})[_0xb079('0x1e')](handleEntityNotFound(_0x4a1e60,null))[_0xb079('0x1e')](removeEntity(_0x4a1e60,null))[_0xb079('0x3f')](handleError(_0x4a1e60,null));};function generateMicrosoftAuthorizationUrl(_0x566d1c,_0x317df4){var _0x2a1236=MICROSOFT_AUTH_URL[_0xb079('0x46')](_0xb079('0x47'),_0x566d1c[_0xb079('0x48')]);var _0x460123=[_0xb079('0x49'),_0xb079('0x4a')];var _0x349120=Buffer['from'](JSON[_0xb079('0x4b')]({'id':_0x317df4}))[_0xb079('0x4c')](_0xb079('0x4d'));var _0x27efcd=crypto['randomBytes'](0x10)[_0xb079('0x4c')](_0xb079('0x4e'));var _0x43b784=[{'key':_0xb079('0x4f'),'value':_0x566d1c['data1']},{'key':_0xb079('0x50'),'value':encodeURIComponent(_0x460123[_0xb079('0x51')]('\x20'))},{'key':_0xb079('0x52'),'value':_0x566d1c[_0xb079('0x53')]},{'key':_0xb079('0x54'),'value':_0xb079('0x55')},{'key':_0xb079('0x56'),'value':encodeURIComponent(AZURE_AUTH_SCOPES[_0x566d1c[_0xb079('0x37')]][_0xb079('0x51')]('\x20'))},{'key':'state','value':_0x349120},{'key':_0xb079('0x57'),'value':_0x27efcd},{'key':_0xb079('0x58'),'value':_0xb079('0x59')}];var _0x55decc=_0x2a1236+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb079('0x24')](_0x43b784,function(_0x417caf){return _0x417caf[_0xb079('0x28')]+'='+_0x417caf['value'];})['join']('&');_0x566d1c[_0xb079('0x5a')]={'issuer':_0x2a1236[_0xb079('0x46')](_0xb079('0x5b'),''),'audience':_0x566d1c[_0xb079('0x5c')],'state':_0x349120,'nonce':_0x27efcd};redis[_0xb079('0x1c')](_0x349120,JSON[_0xb079('0x4b')](_0x566d1c));return _0x55decc;}function isValidIdToken(_0x423e58,_0x412a31){try{var _0x4e3eac=jwt[_0xb079('0x5d')](_0x423e58,{'complete':!![]});var _0x8c53bd=_0x4e3eac[_0xb079('0x5e')];if(_0x8c53bd[_0xb079('0x5f')]!==_0x412a31[_0xb079('0x60')])return![];if(_0x8c53bd[_0xb079('0x61')]!==_0x412a31[_0xb079('0x62')])return![];if(_0x8c53bd[_0xb079('0x57')]!==_0x412a31['nonce'])return![];if(moment()[_0xb079('0x63')](moment[_0xb079('0x64')](_0x8c53bd[_0xb079('0x65')])))return![];return!![];}catch(_0x199d88){throw _0x199d88;}}function refreshOauth2MicrosoftAccessToken(_0x26fd76){var _0x472201={'grant_type':_0xb079('0x66'),'refresh_token':_0x26fd76[_0xb079('0x67')],'scope':AZURE_TOKEN_SCOPES[_0x26fd76['type']],'redirect_uri':_0x26fd76[_0xb079('0x53')],'client_id':_0x26fd76[_0xb079('0x5c')],'client_secret':_0x26fd76['data3']};var _0x295492={'method':_0xb079('0x68'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb079('0x47'),_0x26fd76['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x472201,'json':!![]};return rp(_0x295492)[_0xb079('0x1e')](function(_0x52eae0){return db[_0xb079('0x25')][_0xb079('0x45')]({'data5':_0x52eae0[_0xb079('0x69')],'data6':_0x52eae0[_0xb079('0x66')]},{'where':{'id':_0x26fd76['id']}});})[_0xb079('0x3f')](function(_0x916fb7){logger[_0xb079('0x20')](_0xb079('0x6a'),_0x26fd76['id'],_0x916fb7);});}function getOauth2MicrosoftAccessToken(_0x192fde,_0x41e3a9){var _0x4b2cbd={'grant_type':_0xb079('0x6b'),'code':_0x192fde,'scope':AZURE_TOKEN_SCOPES[_0x41e3a9[_0xb079('0x37')]],'redirect_uri':_0x41e3a9[_0xb079('0x53')],'client_id':_0x41e3a9[_0xb079('0x5c')],'client_secret':_0x41e3a9['data3']};var _0x3f2ec6={'method':_0xb079('0x68'),'uri':MICROSOFT_AUTH_URL[_0xb079('0x46')](_0xb079('0x47'),_0x41e3a9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b2cbd,'json':!![]};return rp(_0x3f2ec6);}exports[_0xb079('0x6c')]=function(_0xd0ca2e,_0x335089){return db['CloudProvider']['findOne']({'where':{'id':_0xd0ca2e[_0xb079('0x41')]['id']},'raw':!![]})[_0xb079('0x1e')](function(_0x14e54f){if(!_0x14e54f)return _0x335089[_0xb079('0x14')](0x194);return{'url':generateMicrosoftAuthorizationUrl(_0x14e54f,_0xd0ca2e[_0xb079('0x6d')]['id'])};})[_0xb079('0x1e')](respondWithResult(_0x335089,null))[_0xb079('0x3f')](handleError(_0x335089,null));};exports[_0xb079('0x6e')]=function(_0x15ee26,_0x59ca30){var _0x2bfa0f=_0x15ee26[_0xb079('0x44')];var _0x1d9b24;var _0x254a42;if(_0x2bfa0f['error'])throw _0x2bfa0f;redis['get'](_0x2bfa0f[_0xb079('0x6f')])[_0xb079('0x1e')](function(_0x155501){if(!_0x155501)throw new Error(_0xb079('0x70'));_0x1d9b24=JSON[_0xb079('0x71')](_0x155501);var _0x318c0c=Buffer[_0xb079('0x72')](_0x2bfa0f['state'],'base64')[_0xb079('0x4c')](_0xb079('0x73'));_0x254a42=JSON['parse'](_0x318c0c);if(!isValidIdToken(_0x2bfa0f[_0xb079('0x4a')],_0x1d9b24[_0xb079('0x5a')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb079('0x74')](_0x2bfa0f['state']);return getOauth2MicrosoftAccessToken(_0x2bfa0f[_0xb079('0x49')],_0x1d9b24);})['then'](function(_0x25db05){_0x1d9b24[_0xb079('0x75')]=_0x25db05[_0xb079('0x69')];_0x1d9b24[_0xb079('0x67')]=_0x25db05['refresh_token'];return db[_0xb079('0x25')]['update']({'data5':_0x1d9b24[_0xb079('0x75')],'data6':_0x1d9b24[_0xb079('0x67')]},{'where':{'id':_0x1d9b24['id']}});})[_0xb079('0x1e')](function(){setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,_0x1d9b24),0xfa*0x3e8);socket[_0xb079('0x76')](_0xb079('0x77'),{'id':_0x254a42['id']});return;})[_0xb079('0x1e')](respondWithStatusCode(_0x59ca30,null))[_0xb079('0x3f')](function(_0x72e08f){if(_0x254a42){socket[_0xb079('0x76')](_0xb079('0x78'),{'id':_0x254a42['id']});}if(!_0x1d9b24){logger[_0xb079('0x20')](_0xb079('0x79'),_0x72e08f);return _0x59ca30[_0xb079('0x16')](0x1f4)[_0xb079('0x23')](_0x72e08f['message']);}logger[_0xb079('0x20')](_0xb079('0x7a'),_0x1d9b24['id'],_0x72e08f);});}; \ No newline at end of file +var _0x304a=['{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','join','data4','response_mode','scope','state','nonce','login','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','data6','data3','POST','access_token','refresh_token','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','Unable\x20to\x20validate\x20id_token','data5','bind','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','request-promise','lodash','moment','crypto','jsonwebtoken','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','params','find','create','catch','update','body','replace'];(function(_0xef85d5,_0x5c4efe){var _0x387cd3=function(_0x1efd17){while(--_0x1efd17){_0xef85d5['push'](_0xef85d5['shift']());}};_0x387cd3(++_0x5c4efe);}(_0x304a,0x19a));var _0xa304=function(_0x51fbcd,_0x5d564d){_0x51fbcd=_0x51fbcd-0x0;var _0x25106a=_0x304a[_0x51fbcd];return _0x25106a;};'use strict';var rp=require(_0xa304('0x0'));var _=require(_0xa304('0x1'));var moment=require(_0xa304('0x2'));var crypto=require(_0xa304('0x3'));var jwt=require(_0xa304('0x4'));var Redis=require(_0xa304('0x5'));var qs=require(_0xa304('0x6'));var config=require(_0xa304('0x7'));var logger=require(_0xa304('0x8'))(_0xa304('0x9'));var db=require(_0xa304('0xa'))['db'];config['redis']=_[_0xa304('0xb')](config[_0xa304('0xc')],{'host':_0xa304('0xd'),'port':0x18eb});var socket=require(_0xa304('0xe'))(new Redis(config[_0xa304('0xc')]));var redis=new Redis(config[_0xa304('0xc')]);var MICROSOFT_AUTH_URL=_0xa304('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa304('0x10'),'profile',_0xa304('0x11'),_0xa304('0x12'),_0xa304('0x13'),_0xa304('0x14'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0xa304('0x12')]};var AZURE_TOKEN_SCOPES={'Outlook365':'https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365':''};var MICROSOFT_AUTH_ENDPOINT=_0xa304('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xa304('0x16');function respondWithStatusCode(_0x32806a,_0x2acc50){_0x2acc50=_0x2acc50||0xcc;return function(_0x3995b6){if(_0x3995b6){return _0x32806a[_0xa304('0x17')](_0x2acc50);}return _0x32806a[_0xa304('0x18')](_0x2acc50)[_0xa304('0x19')]();};}function respondWithResult(_0x49c63e,_0x3ab97a){_0x3ab97a=_0x3ab97a||0xc8;return function(_0x4952f8){if(_0x4952f8){return _0x49c63e[_0xa304('0x18')](_0x3ab97a)[_0xa304('0x1a')](_0x4952f8);}};}function respondWithFilteredResult(_0x3746da,_0x4bc7a5){return function(_0x1c79ca){if(_0x1c79ca){var _0x423975=typeof _0x4bc7a5[_0xa304('0x1b')]===_0xa304('0x1c')&&typeof _0x4bc7a5[_0xa304('0x1d')]===_0xa304('0x1c');var _0xe1b137=_0x1c79ca[_0xa304('0x1e')];var _0x3096be=_0x423975?0x0:_0x4bc7a5[_0xa304('0x1b')];var _0x355677=_0x423975?_0x1c79ca[_0xa304('0x1e')]:_0x4bc7a5[_0xa304('0x1b')]+_0x4bc7a5[_0xa304('0x1d')];var _0x65be9b;if(_0x355677>=_0xe1b137){_0x355677=_0xe1b137;_0x65be9b=0xc8;}else{_0x65be9b=0xce;}_0x3746da['status'](_0x65be9b);return _0x3746da['set'](_0xa304('0x1f'),_0x3096be+'-'+_0x355677+'/'+_0xe1b137)[_0xa304('0x1a')](_0x1c79ca);}return null;};}function saveUpdates(_0x3626fd){return function(_0x37b317){if(_0x37b317){return _0x37b317['update'](_0x3626fd)[_0xa304('0x20')](function(_0x1ed68d){return _0x1ed68d;});}return null;};}function removeEntity(_0x131f8d){return function(_0x35d841){if(_0x35d841){return _0x35d841[_0xa304('0x21')]()['then'](function(){_0x131f8d[_0xa304('0x18')](0xcc)[_0xa304('0x19')]();});}};}function handleEntityNotFound(_0x3e5d5c){return function(_0x40d27a){if(!_0x40d27a){_0x3e5d5c[_0xa304('0x17')](0x194);}return _0x40d27a;};}function handleError(_0x2f6d4e,_0x5d8bc3){_0x5d8bc3=_0x5d8bc3||0x1f4;return function(_0x131fdd){logger[_0xa304('0x22')](_0x131fdd[_0xa304('0x23')]);if(_0x131fdd[_0xa304('0x24')]){delete _0x131fdd[_0xa304('0x24')];}_0x2f6d4e[_0xa304('0x18')](_0x5d8bc3)[_0xa304('0x25')](_0x131fdd);};}exports['index']=function(_0x5dd112,_0x32f8fb){var _0x26f037={},_0x3670e0={},_0x56ec3c={'count':0x0,'rows':[]};var _0x17d5a9=_['map'](db['CloudProvider'][_0xa304('0x26')],function(_0x3f9c8e){return{'name':_0x3f9c8e[_0xa304('0x27')],'type':_0x3f9c8e[_0xa304('0x28')][_0xa304('0x29')]};});_0x3670e0['model']=_[_0xa304('0x2a')](_0x17d5a9,_0xa304('0x24'));_0x3670e0[_0xa304('0x2b')]=_[_0xa304('0x2c')](_0x5dd112[_0xa304('0x2b')]);_0x3670e0[_0xa304('0x2d')]=_[_0xa304('0x2e')](_0x3670e0['model'],_0x3670e0[_0xa304('0x2b')]);_0x26f037[_0xa304('0x2f')]=_[_0xa304('0x2e')](_0x3670e0[_0xa304('0x30')],qs[_0xa304('0x31')](_0x5dd112[_0xa304('0x2b')][_0xa304('0x31')]));_0x26f037[_0xa304('0x2f')]=_0x26f037[_0xa304('0x2f')][_0xa304('0x32')]?_0x26f037[_0xa304('0x2f')]:_0x3670e0['model'];if(!_0x5dd112[_0xa304('0x2b')]['hasOwnProperty'](_0xa304('0x33'))){_0x26f037[_0xa304('0x1d')]=qs[_0xa304('0x1d')](_0x5dd112[_0xa304('0x2b')]['limit']);_0x26f037['offset']=qs[_0xa304('0x1b')](_0x5dd112['query']['offset']);}_0x26f037[_0xa304('0x34')]=qs[_0xa304('0x35')](_0x5dd112['query']['sort']);_0x26f037[_0xa304('0x36')]=qs['filters'](_['pick'](_0x5dd112['query'],_0x3670e0[_0xa304('0x2d')]),_0x17d5a9);if(_0x5dd112['query'][_0xa304('0x37')]){_0x26f037['where']=_[_0xa304('0x38')](_0x26f037[_0xa304('0x36')],{'$or':_[_0xa304('0x2a')](_0x17d5a9,function(_0x23415c){if(_0x23415c[_0xa304('0x28')]!==_0xa304('0x39')){var _0x801e={};_0x801e[_0x23415c[_0xa304('0x24')]]={'$like':'%'+_0x5dd112[_0xa304('0x2b')]['filter']+'%'};return _0x801e;}})});}_0x26f037=_['merge']({},_0x26f037,_0x5dd112[_0xa304('0x3a')]);var _0x4f6b83={'where':_0x26f037[_0xa304('0x36')]};return db[_0xa304('0x3b')][_0xa304('0x1e')](_0x4f6b83)[_0xa304('0x20')](function(_0x35fa68){_0x56ec3c[_0xa304('0x1e')]=_0x35fa68;if(_0x5dd112['query'][_0xa304('0x3c')]){_0x26f037[_0xa304('0x3d')]=[{'all':!![]}];}return db[_0xa304('0x3b')][_0xa304('0x3e')](_0x26f037);})[_0xa304('0x20')](function(_0x294178){_0x56ec3c['rows']=_0x294178;return _0x56ec3c;})[_0xa304('0x20')](respondWithFilteredResult(_0x32f8fb,_0x26f037))['catch'](handleError(_0x32f8fb,null));};exports['show']=function(_0x17abcf,_0x4352e0){var _0x424ed0={'raw':!![],'where':{'id':_0x17abcf[_0xa304('0x3f')]['id']}},_0xa7bc54={};_0xa7bc54[_0xa304('0x30')]=_[_0xa304('0x2c')](db[_0xa304('0x3b')]['rawAttributes']);_0xa7bc54[_0xa304('0x2b')]=_[_0xa304('0x2c')](_0x17abcf[_0xa304('0x2b')]);_0xa7bc54['filters']=_['intersection'](_0xa7bc54[_0xa304('0x30')],_0xa7bc54['query']);_0x424ed0[_0xa304('0x2f')]=_['intersection'](_0xa7bc54[_0xa304('0x30')],qs[_0xa304('0x31')](_0x17abcf['query'][_0xa304('0x31')]));_0x424ed0[_0xa304('0x2f')]=_0x424ed0[_0xa304('0x2f')][_0xa304('0x32')]?_0x424ed0[_0xa304('0x2f')]:_0xa7bc54[_0xa304('0x30')];if(_0x17abcf['query']['includeAll']){_0x424ed0['include']=[{'all':!![]}];}_0x424ed0=_[_0xa304('0x38')]({},_0x424ed0,_0x17abcf[_0xa304('0x3a')]);return db['CloudProvider'][_0xa304('0x40')](_0x424ed0)[_0xa304('0x20')](handleEntityNotFound(_0x4352e0,null))[_0xa304('0x20')](respondWithResult(_0x4352e0,null))['catch'](handleError(_0x4352e0,null));};exports[_0xa304('0x41')]=function(_0x3352dd,_0x1ed1e7){return db[_0xa304('0x3b')]['create'](_0x3352dd['body'],{})[_0xa304('0x20')](respondWithResult(_0x1ed1e7,0xc9))[_0xa304('0x42')](handleError(_0x1ed1e7,null));};exports[_0xa304('0x43')]=function(_0x4976a3,_0x28f2bd){if(_0x4976a3['body']['id']){delete _0x4976a3[_0xa304('0x44')]['id'];}return db[_0xa304('0x3b')][_0xa304('0x40')]({'where':{'id':_0x4976a3[_0xa304('0x3f')]['id']}})[_0xa304('0x20')](handleEntityNotFound(_0x28f2bd,null))[_0xa304('0x20')](saveUpdates(_0x4976a3[_0xa304('0x44')],null))['then'](respondWithResult(_0x28f2bd,null))[_0xa304('0x42')](handleError(_0x28f2bd,null));};exports[_0xa304('0x21')]=function(_0x269798,_0x5efc5a){return db[_0xa304('0x3b')][_0xa304('0x40')]({'where':{'id':_0x269798[_0xa304('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5efc5a,null))['then'](removeEntity(_0x5efc5a,null))[_0xa304('0x42')](handleError(_0x5efc5a,null));};function generateMicrosoftAuthorizationUrl(_0x7319db,_0x5b6d71){var _0x58c94e=MICROSOFT_AUTH_URL[_0xa304('0x45')](_0xa304('0x46'),_0x7319db[_0xa304('0x47')]);var _0x4722ef=[_0xa304('0x48'),_0xa304('0x49')];var _0x1baa7e=Buffer[_0xa304('0x4a')](JSON[_0xa304('0x4b')]({'id':_0x5b6d71}))[_0xa304('0x4c')](_0xa304('0x4d'));var _0x53c220=crypto[_0xa304('0x4e')](0x10)[_0xa304('0x4c')](_0xa304('0x4f'));var _0x61d024=[{'key':_0xa304('0x50'),'value':_0x7319db[_0xa304('0x51')]},{'key':_0xa304('0x52'),'value':encodeURIComponent(_0x4722ef[_0xa304('0x53')]('\x20'))},{'key':'redirect_uri','value':_0x7319db[_0xa304('0x54')]},{'key':_0xa304('0x55'),'value':'form_post'},{'key':_0xa304('0x56'),'value':encodeURIComponent(AZURE_AUTH_SCOPES[_0x7319db[_0xa304('0x28')]][_0xa304('0x53')]('\x20'))},{'key':_0xa304('0x57'),'value':_0x1baa7e},{'key':_0xa304('0x58'),'value':_0x53c220},{'key':'prompt','value':_0xa304('0x59')}];var _0x5bb751=_0x58c94e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x61d024,function(_0x216ebc){return _0x216ebc[_0xa304('0x29')]+'='+_0x216ebc[_0xa304('0x5a')];})[_0xa304('0x53')]('&');_0x7319db[_0xa304('0x5b')]={'issuer':_0x58c94e['replace'](_0xa304('0x5c'),''),'audience':_0x7319db[_0xa304('0x51')],'state':_0x1baa7e,'nonce':_0x53c220};redis[_0xa304('0x5d')](_0x1baa7e,JSON[_0xa304('0x4b')](_0x7319db));return _0x5bb751;}function isValidIdToken(_0xec8db8,_0x51a05c){try{var _0x2599b1=jwt[_0xa304('0x5e')](_0xec8db8,{'complete':!![]});var _0xc6c3bf=_0x2599b1[_0xa304('0x5f')];if(_0xc6c3bf[_0xa304('0x60')]!==_0x51a05c[_0xa304('0x61')])return![];if(_0xc6c3bf[_0xa304('0x62')]!==_0x51a05c[_0xa304('0x63')])return![];if(_0xc6c3bf[_0xa304('0x58')]!==_0x51a05c[_0xa304('0x58')])return![];if(moment()[_0xa304('0x64')](moment[_0xa304('0x65')](_0xc6c3bf['exp'])))return![];return!![];}catch(_0x2412d){throw _0x2412d;}}function refreshOauth2MicrosoftAccessToken(_0xc15596){var _0xc2909e={'grant_type':'refresh_token','refresh_token':_0xc15596[_0xa304('0x66')],'scope':AZURE_TOKEN_SCOPES[_0xc15596[_0xa304('0x28')]],'redirect_uri':_0xc15596[_0xa304('0x54')],'client_id':_0xc15596[_0xa304('0x51')],'client_secret':_0xc15596[_0xa304('0x67')]};var _0x2c936f={'method':_0xa304('0x68'),'uri':MICROSOFT_AUTH_URL[_0xa304('0x45')](_0xa304('0x46'),_0xc15596[_0xa304('0x47')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xc2909e,'json':!![]};return rp(_0x2c936f)[_0xa304('0x20')](function(_0x51edd6){return db[_0xa304('0x3b')][_0xa304('0x43')]({'data5':_0x51edd6[_0xa304('0x69')],'data6':_0x51edd6[_0xa304('0x6a')]},{'where':{'id':_0xc15596['id']}});})[_0xa304('0x42')](function(_0xb981ba){logger[_0xa304('0x22')](_0xa304('0x6b'),_0xc15596['id'],_0xb981ba);});}function getOauth2MicrosoftAccessToken(_0x795c1b,_0x212881){var _0x351665={'grant_type':'authorization_code','code':_0x795c1b,'scope':AZURE_TOKEN_SCOPES[_0x212881[_0xa304('0x28')]],'redirect_uri':_0x212881[_0xa304('0x54')],'client_id':_0x212881[_0xa304('0x51')],'client_secret':_0x212881[_0xa304('0x67')]};var _0xd17322={'method':_0xa304('0x68'),'uri':MICROSOFT_AUTH_URL[_0xa304('0x45')](_0xa304('0x46'),_0x212881['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x351665,'json':!![]};return rp(_0xd17322);}exports[_0xa304('0x6c')]=function(_0x52eda4,_0x3c4ffd){return db[_0xa304('0x3b')]['findOne']({'where':{'id':_0x52eda4[_0xa304('0x3f')]['id']},'raw':!![]})[_0xa304('0x20')](function(_0x21c435){if(!_0x21c435)return _0x3c4ffd[_0xa304('0x17')](0x194);return{'url':generateMicrosoftAuthorizationUrl(_0x21c435,_0x52eda4[_0xa304('0x6d')]['id'])};})[_0xa304('0x20')](respondWithResult(_0x3c4ffd,null))['catch'](handleError(_0x3c4ffd,null));};exports[_0xa304('0x6e')]=function(_0x126490,_0x114092){var _0x2a6298=_0x126490[_0xa304('0x44')];var _0x24b6f4;var _0xe061b0;if(_0x2a6298[_0xa304('0x22')])throw _0x2a6298;redis[_0xa304('0x6f')](_0x2a6298[_0xa304('0x57')])[_0xa304('0x20')](function(_0x16e0f3){if(!_0x16e0f3)throw new Error(_0xa304('0x70'));_0x24b6f4=JSON[_0xa304('0x71')](_0x16e0f3);var _0x3828b7=Buffer[_0xa304('0x4a')](_0x2a6298[_0xa304('0x57')],_0xa304('0x4d'))[_0xa304('0x4c')]('ascii');_0xe061b0=JSON['parse'](_0x3828b7);if(!isValidIdToken(_0x2a6298['id_token'],_0x24b6f4['oauth2Claims']))throw new Error(_0xa304('0x72'));redis['del'](_0x2a6298[_0xa304('0x57')]);return getOauth2MicrosoftAccessToken(_0x2a6298[_0xa304('0x48')],_0x24b6f4);})[_0xa304('0x20')](function(_0x454b55){_0x24b6f4[_0xa304('0x73')]=_0x454b55[_0xa304('0x69')];_0x24b6f4[_0xa304('0x66')]=_0x454b55[_0xa304('0x6a')];return db[_0xa304('0x3b')][_0xa304('0x43')]({'data5':_0x24b6f4[_0xa304('0x73')],'data6':_0x24b6f4['data6']},{'where':{'id':_0x24b6f4['id']}});})[_0xa304('0x20')](function(){setInterval(refreshOauth2MicrosoftAccessToken[_0xa304('0x74')](this,_0x24b6f4),0xfa*0x3e8);socket[_0xa304('0x75')](_0xa304('0x76'),{'id':_0xe061b0['id']});return;})[_0xa304('0x20')](respondWithStatusCode(_0x114092,null))[_0xa304('0x42')](function(_0x5a9745){if(_0xe061b0){socket[_0xa304('0x75')]('microsoftAuthorization:error',{'id':_0xe061b0['id']});}if(!_0x24b6f4){logger[_0xa304('0x22')](_0xa304('0x77'),_0x5a9745);return _0x114092[_0xa304('0x18')](0x1f4)[_0xa304('0x25')](_0x5a9745['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s',_0x24b6f4['id'],_0x5a9745);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 3b7be31..6982d9d 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 _0xf644=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger'];(function(_0x56086c,_0x4506c1){var _0x393b7e=function(_0x549c17){while(--_0x549c17){_0x56086c['push'](_0x56086c['shift']());}};_0x393b7e(++_0x4506c1);}(_0xf644,0xf9));var _0x4f64=function(_0x567026,_0x44fdee){_0x567026=_0x567026-0x0;var _0x324935=_0xf644[_0x567026];return _0x324935;};'use strict';var _=require(_0x4f64('0x0'));var util=require(_0x4f64('0x1'));var logger=require(_0x4f64('0x2'))(_0x4f64('0x3'));var moment=require('moment');var BPromise=require(_0x4f64('0x4'));var rp=require(_0x4f64('0x5'));var fs=require('fs');var path=require(_0x4f64('0x6'));var rimraf=require(_0x4f64('0x7'));var config=require(_0x4f64('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x4f64('0x9')]=function(_0x1aa313,_0x136071){return _0x1aa313[_0x4f64('0xa')](_0x4f64('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf65a=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider'];(function(_0x2dc817,_0x28c714){var _0x494cea=function(_0x1cb107){while(--_0x1cb107){_0x2dc817['push'](_0x2dc817['shift']());}};_0x494cea(++_0x28c714);}(_0xf65a,0xbb));var _0xaf65=function(_0x317c08,_0x8eac60){_0x317c08=_0x317c08-0x0;var _0x514b5b=_0xf65a[_0x317c08];return _0x514b5b;};'use strict';var _=require(_0xaf65('0x0'));var util=require(_0xaf65('0x1'));var logger=require(_0xaf65('0x2'))(_0xaf65('0x3'));var moment=require(_0xaf65('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf65('0x5'));var fs=require('fs');var path=require(_0xaf65('0x6'));var rimraf=require('rimraf');var config=require(_0xaf65('0x7'));var attributes=require(_0xaf65('0x8'));module['exports']=function(_0x19b7ff,_0x2787a8){return _0x19b7ff[_0xaf65('0x9')](_0xaf65('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 1853777..3b0c2ea 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 _0x5430=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5430,0x10c));var _0x0543=function(_0x51744a,_0x5ae592){_0x51744a=_0x51744a-0x0;var _0x24316a=_0x5430[_0x51744a];return _0x24316a;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('CloudProvider,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('CloudProvider,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});} \ No newline at end of file +var _0xfaf2=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CloudProvider,\x20%s,\x20%s','message','result'];(function(_0x16f72a,_0x19065d){var _0x28fcab=function(_0x17136e){while(--_0x17136e){_0x16f72a['push'](_0x16f72a['shift']());}};_0x28fcab(++_0x19065d);}(_0xfaf2,0x169));var _0x2faf=function(_0x2423c5,_0x17425f){_0x2423c5=_0x2423c5-0x0;var _0xe384a7=_0xfaf2[_0x2423c5];return _0xe384a7;};'use strict';var _=require(_0x2faf('0x0'));var util=require(_0x2faf('0x1'));var moment=require(_0x2faf('0x2'));var BPromise=require(_0x2faf('0x3'));var rs=require(_0x2faf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2faf('0x5'))['db'];var utils=require(_0x2faf('0x6'));var logger=require(_0x2faf('0x7'))(_0x2faf('0x8'));var config=require(_0x2faf('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32cdb3,_0x43128c,_0x1d3420){return new BPromise(function(_0x1522cb,_0x3f5c12){return client['request'](_0x32cdb3,_0x1d3420)['then'](function(_0x9c958c){logger[_0x2faf('0xa')]('CloudProvider,\x20%s,\x20%s',_0x43128c,'request\x20sent');logger[_0x2faf('0xb')](_0x2faf('0xc'),_0x43128c,_0x2faf('0xd'),JSON['stringify'](_0x9c958c));if(_0x9c958c['error']){if(_0x9c958c[_0x2faf('0xe')][_0x2faf('0xf')]===0x1f4){logger['error'](_0x2faf('0x10'),_0x43128c,_0x9c958c['error'][_0x2faf('0x11')]);return _0x3f5c12(_0x9c958c[_0x2faf('0xe')][_0x2faf('0x11')]);}logger[_0x2faf('0xe')](_0x2faf('0x10'),_0x43128c,_0x9c958c[_0x2faf('0xe')]['message']);return _0x1522cb(_0x9c958c[_0x2faf('0xe')][_0x2faf('0x11')]);}else{logger['info'](_0x2faf('0x10'),_0x43128c,_0x2faf('0xd'));_0x1522cb(_0x9c958c[_0x2faf('0x12')][_0x2faf('0x11')]);}})['catch'](function(_0x3a2f18){logger[_0x2faf('0xe')](_0x2faf('0x10'),_0x43128c,_0x3a2f18);_0x3f5c12(_0x3a2f18);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index ce3d33b..64049ea 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x1a6278,_0x298782){var _0x557688=function(_0x23149c){while(--_0x23149c){_0x1a6278['push'](_0x1a6278['shift']());}};_0x557688(++_0x298782);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7a54,0x106));var _0x47a5=function(_0x1228f9,_0x2512bf){_0x1228f9=_0x1228f9-0x0;var _0x31e547=_0x7a54[_0x1228f9];return _0x31e547;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 4f7eb33..250faac 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 _0x245e=['exports','name','STRING','sequelize'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x245e,0x15f));var _0xe245=function(_0x2e86b6,_0x47d704){_0x2e86b6=_0x2e86b6-0x0;var _0x5c767b=_0x245e[_0x2e86b6];return _0x5c767b;};'use strict';var Sequelize=require(_0xe245('0x0'));module[_0xe245('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe245('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe245('0x3')]},'companyId':{'type':Sequelize[_0xe245('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe245('0x3')]},'fax':{'type':Sequelize[_0xe245('0x3')]},'type':{'type':Sequelize[_0xe245('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe245('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe245('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe245('0x3')]},'sStreet':{'type':Sequelize[_0xe245('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xe245('0x3')]},'sCountry':{'type':Sequelize[_0xe245('0x3')]},'description':{'type':Sequelize[_0xe245('0x3')]}}; \ No newline at end of file +var _0xd609=['STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd609,0x10b));var _0x9d60=function(_0x5bf915,_0xcc81e2){_0x5bf915=_0x5bf915-0x0;var _0x2f6c74=_0xd609[_0x5bf915];return _0x2f6c74;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d60('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x9d60('0x0')]},'website':{'type':Sequelize[_0x9d60('0x0')]},'phone':{'type':Sequelize[_0x9d60('0x0')]},'fax':{'type':Sequelize[_0x9d60('0x0')]},'type':{'type':Sequelize[_0x9d60('0x0')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9d60('0x0')]},'city':{'type':Sequelize[_0x9d60('0x0')]},'country':{'type':Sequelize[_0x9d60('0x0')]},'email':{'type':Sequelize[_0x9d60('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9d60('0x0')]},'sPostalCode':{'type':Sequelize[_0x9d60('0x0')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9d60('0x0')]},'description':{'type':Sequelize[_0x9d60('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 1f32b82..1585b23 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 _0x272b=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','CmCompany','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','order','map','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','Companies','UserProfileResource','end','error','stack','name','send','describe','model','query','keys','filters','intersection'];(function(_0x33ffb2,_0x4987d3){var _0x19f512=function(_0x5832d7){while(--_0x5832d7){_0x33ffb2['push'](_0x33ffb2['shift']());}};_0x19f512(++_0x4987d3);}(_0x272b,0xd8));var _0xb272=function(_0xf9c82d,_0x375263){_0xf9c82d=_0xf9c82d-0x0;var _0x39c593=_0x272b[_0xf9c82d];return _0x39c593;};'use strict';var emlformat=require(_0xb272('0x0'));var rimraf=require(_0xb272('0x1'));var zipdir=require(_0xb272('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb272('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb272('0x4'));var util=require('util');var path=require(_0xb272('0x5'));var sox=require(_0xb272('0x6'));var csv=require('to-csv');var ejs=require(_0xb272('0x7'));var fs=require('fs');var fs_extra=require(_0xb272('0x8'));var _=require(_0xb272('0x9'));var squel=require(_0xb272('0xa'));var crypto=require(_0xb272('0xb'));var jsforce=require(_0xb272('0xc'));var deskjs=require(_0xb272('0xd'));var toCsv=require(_0xb272('0xe'));var querystring=require(_0xb272('0xf'));var Papa=require(_0xb272('0x10'));var Redis=require(_0xb272('0x11'));var authService=require(_0xb272('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb272('0x13'));var hardwareService=require(_0xb272('0x14'));var logger=require('../../config/logger')(_0xb272('0x15'));var utils=require('../../config/utils');var config=require(_0xb272('0x16'));var licenseUtil=require(_0xb272('0x17'));var db=require(_0xb272('0x18'))['db'];function respondWithStatusCode(_0x3c964e,_0x52c4ee){_0x52c4ee=_0x52c4ee||0xcc;return function(_0x5ef719){if(_0x5ef719){return _0x3c964e[_0xb272('0x19')](_0x52c4ee);}return _0x3c964e[_0xb272('0x1a')](_0x52c4ee)['end']();};}function respondWithResult(_0x5b253c,_0xf0d570){_0xf0d570=_0xf0d570||0xc8;return function(_0x14779d){if(_0x14779d){return _0x5b253c[_0xb272('0x1a')](_0xf0d570)[_0xb272('0x1b')](_0x14779d);}};}function respondWithFilteredResult(_0x175df9,_0x12b531){return function(_0x220ba9){if(_0x220ba9){var _0x4ebfe0=typeof _0x12b531['offset']===_0xb272('0x1c')&&typeof _0x12b531[_0xb272('0x1d')]==='undefined';var _0x493893=_0x220ba9[_0xb272('0x1e')];var _0x2c1774=_0x4ebfe0?0x0:_0x12b531['offset'];var _0x4477d8=_0x4ebfe0?_0x220ba9['count']:_0x12b531[_0xb272('0x1f')]+_0x12b531['limit'];var _0x12da43;if(_0x4477d8>=_0x493893){_0x4477d8=_0x493893;_0x12da43=0xc8;}else{_0x12da43=0xce;}_0x175df9[_0xb272('0x1a')](_0x12da43);return _0x175df9['set'](_0xb272('0x20'),_0x2c1774+'-'+_0x4477d8+'/'+_0x493893)[_0xb272('0x1b')](_0x220ba9);}return null;};}function patchUpdates(_0x3435bc){return function(_0x22d244){try{jsonpatch[_0xb272('0x21')](_0x22d244,_0x3435bc,!![]);}catch(_0x6c961e){return BPromise[_0xb272('0x22')](_0x6c961e);}return _0x22d244[_0xb272('0x23')]();};}function saveUpdates(_0x3557cd,_0x1dea93){return function(_0x49d6dc){if(_0x49d6dc){return _0x49d6dc[_0xb272('0x24')](_0x3557cd)[_0xb272('0x25')](function(_0x25a68e){return _0x25a68e;});}return null;};}function removeEntity(_0x2a8282,_0x131cf7){return function(_0x53d495){if(_0x53d495){return _0x53d495['destroy']()[_0xb272('0x25')](function(){var _0x1846dd=_0x53d495['get']({'plain':!![]});var _0xf23781=_0xb272('0x26');return db[_0xb272('0x27')]['destroy']({'where':{'type':_0xf23781,'resourceId':_0x1846dd['id']}})[_0xb272('0x25')](function(){return _0x53d495;});})[_0xb272('0x25')](function(){_0x2a8282[_0xb272('0x1a')](0xcc)[_0xb272('0x28')]();});}};}function handleEntityNotFound(_0x2fc6c4,_0x193e27){return function(_0x39ffa8){if(!_0x39ffa8){_0x2fc6c4[_0xb272('0x19')](0x194);}return _0x39ffa8;};}function handleError(_0x2547b4,_0x30477f){_0x30477f=_0x30477f||0x1f4;return function(_0x300101){logger[_0xb272('0x29')](_0x300101[_0xb272('0x2a')]);if(_0x300101['name']){delete _0x300101[_0xb272('0x2b')];}_0x2547b4[_0xb272('0x1a')](_0x30477f)[_0xb272('0x2c')](_0x300101);};}exports['index']=function(_0x5b8640,_0xbc0c6a){var _0x5d0afc={},_0x1f52f3={},_0x5acc55={'count':0x0,'rows':[]};return db['CmCompany'][_0xb272('0x2d')]()[_0xb272('0x25')](function(_0x13b026){_0x1f52f3[_0xb272('0x2e')]=_['keys'](_0x13b026);_0x1f52f3[_0xb272('0x2f')]=_[_0xb272('0x30')](_0x5b8640[_0xb272('0x2f')]);_0x1f52f3[_0xb272('0x31')]=_[_0xb272('0x32')](_0x1f52f3[_0xb272('0x2e')],_0x1f52f3[_0xb272('0x2f')]);_0x5d0afc['attributes']=_[_0xb272('0x32')](_0x1f52f3['model'],qs[_0xb272('0x33')](_0x5b8640[_0xb272('0x2f')]['fields']));_0x5d0afc[_0xb272('0x34')]=_0x5d0afc[_0xb272('0x34')][_0xb272('0x35')]?_0x5d0afc[_0xb272('0x34')]:_0x1f52f3[_0xb272('0x2e')];if(!_0x5b8640['query'][_0xb272('0x36')](_0xb272('0x37'))){_0x5d0afc[_0xb272('0x1d')]=qs[_0xb272('0x1d')](_0x5b8640['query'][_0xb272('0x1d')]);_0x5d0afc[_0xb272('0x1f')]=qs[_0xb272('0x1f')](_0x5b8640['query'][_0xb272('0x1f')]);}_0x5d0afc['order']=qs[_0xb272('0x38')](_0x5b8640[_0xb272('0x2f')][_0xb272('0x38')]);_0x5d0afc['where']=qs['filters'](_[_0xb272('0x39')](_0x5b8640[_0xb272('0x2f')],_0x1f52f3['filters']),_0x13b026);if(_0x5b8640['query'][_0xb272('0x3a')]){_0x5d0afc[_0xb272('0x3b')]=_[_0xb272('0x3c')](_0x5d0afc[_0xb272('0x3b')],{'$or':_['map'](_0x5d0afc[_0xb272('0x34')],function(_0x203175){var _0x22c9e1={};_0x22c9e1[_0x203175]={'$like':'%'+_0x5b8640[_0xb272('0x2f')][_0xb272('0x3a')]+'%'};return _0x22c9e1;})});}_0x5d0afc=_['merge']({},_0x5d0afc,_0x5b8640['options']);var _0x442c92={'where':_0x5d0afc[_0xb272('0x3b')]};return db[_0xb272('0x3d')][_0xb272('0x1e')](_0x442c92)['then'](function(_0x692df5){_0x5acc55[_0xb272('0x1e')]=_0x692df5;if(_0x5b8640['query'][_0xb272('0x3e')]){_0x5d0afc[_0xb272('0x3f')]=[{'all':!![]}];}return db[_0xb272('0x3d')][_0xb272('0x40')](_0x5d0afc);})[_0xb272('0x25')](function(_0xdc8f1a){_0x5acc55[_0xb272('0x41')]=_0xdc8f1a;return _0x5acc55;})[_0xb272('0x25')](respondWithFilteredResult(_0xbc0c6a,_0x5d0afc))[_0xb272('0x42')](handleError(_0xbc0c6a,null));})[_0xb272('0x42')](handleError(_0xbc0c6a,null));};exports[_0xb272('0x43')]=function(_0x3e4dfd,_0x2d0b4a){var _0x3dc31e={'raw':![],'where':{'id':_0x3e4dfd[_0xb272('0x44')]['id']}},_0x43cfc1={};_0x43cfc1['model']=_[_0xb272('0x30')](db[_0xb272('0x3d')]['rawAttributes']);_0x43cfc1[_0xb272('0x2f')]=_['keys'](_0x3e4dfd[_0xb272('0x2f')]);_0x43cfc1[_0xb272('0x31')]=_[_0xb272('0x32')](_0x43cfc1[_0xb272('0x2e')],_0x43cfc1['query']);_0x3dc31e[_0xb272('0x34')]=_[_0xb272('0x32')](_0x43cfc1[_0xb272('0x2e')],qs['fields'](_0x3e4dfd['query']['fields']));_0x3dc31e['attributes']=_0x3dc31e[_0xb272('0x34')][_0xb272('0x35')]?_0x3dc31e[_0xb272('0x34')]:_0x43cfc1[_0xb272('0x2e')];if(_0x3e4dfd[_0xb272('0x2f')][_0xb272('0x3e')]){_0x3dc31e[_0xb272('0x3f')]=[{'all':!![]}];}_0x3dc31e=_[_0xb272('0x3c')]({},_0x3dc31e,_0x3e4dfd[_0xb272('0x45')]);return db[_0xb272('0x3d')]['find'](_0x3dc31e)[_0xb272('0x25')](handleEntityNotFound(_0x2d0b4a,null))[_0xb272('0x25')](respondWithResult(_0x2d0b4a,null))[_0xb272('0x42')](handleError(_0x2d0b4a,null));};exports[_0xb272('0x46')]=function(_0x503568,_0x407b95){return db['CmCompany']['create'](_0x503568[_0xb272('0x47')],{})['then'](function(_0x256bbb){var _0x3c21ed=_0x503568[_0xb272('0x48')][_0xb272('0x49')]({'plain':!![]});if(!_0x3c21ed)throw new Error(_0xb272('0x4a'));if(_0x3c21ed[_0xb272('0x4b')]===_0xb272('0x48')){var _0x3a7039=_0x256bbb[_0xb272('0x49')]({'plain':!![]});var _0x185e1c=_0xb272('0x26');return db[_0xb272('0x4c')]['find']({'where':{'name':_0x185e1c,'userProfileId':_0x3c21ed[_0xb272('0x4d')]},'raw':!![]})[_0xb272('0x25')](function(_0x6b6490){if(_0x6b6490&&_0x6b6490['autoAssociation']===0x0){return db[_0xb272('0x27')]['create']({'name':_0x3a7039[_0xb272('0x2b')],'resourceId':_0x3a7039['id'],'type':_0x6b6490['name'],'sectionId':_0x6b6490['id']},{})[_0xb272('0x25')](function(){return _0x256bbb;});}else{return _0x256bbb;}})[_0xb272('0x42')](function(_0x50f32c){logger[_0xb272('0x29')](_0xb272('0x4e'),_0x50f32c);throw _0x50f32c;});}return _0x256bbb;})[_0xb272('0x25')](respondWithResult(_0x407b95,0xc9))[_0xb272('0x42')](handleError(_0x407b95,null));};exports[_0xb272('0x24')]=function(_0xd02a44,_0x52009c){if(_0xd02a44[_0xb272('0x47')]['id']){delete _0xd02a44['body']['id'];}return db[_0xb272('0x3d')][_0xb272('0x4f')]({'where':{'id':_0xd02a44[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x52009c,null))[_0xb272('0x25')](saveUpdates(_0xd02a44[_0xb272('0x47')],null))[_0xb272('0x25')](respondWithResult(_0x52009c,null))[_0xb272('0x42')](handleError(_0x52009c,null));};exports[_0xb272('0x50')]=function(_0x247185,_0x43bb2a){return db[_0xb272('0x3d')][_0xb272('0x4f')]({'where':{'id':_0x247185['params']['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x43bb2a,null))[_0xb272('0x25')](removeEntity(_0x43bb2a,null))[_0xb272('0x42')](handleError(_0x43bb2a,null));};exports['describe']=function(_0x2fc535,_0x5e048d){return db['CmCompany'][_0xb272('0x2d')]()[_0xb272('0x25')](respondWithResult(_0x5e048d,null))[_0xb272('0x42')](handleError(_0x5e048d,null));};exports[_0xb272('0x51')]=function(_0x156af4,_0x10a81e,_0x40f4d0){return db[_0xb272('0x52')][_0xb272('0x4f')]({'where':{'id':_0x156af4[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x10a81e,null))['then'](function(_0x1a6c1f){if(_0x1a6c1f){return _0x1a6c1f[_0xb272('0x51')](_0x156af4[_0xb272('0x47')][_0xb272('0x53')],_['omit'](_0x156af4[_0xb272('0x47')],['ids','id'])||{});}})[_0xb272('0x25')](respondWithResult(_0x10a81e,null))[_0xb272('0x42')](handleError(_0x10a81e,null));};exports[_0xb272('0x54')]=function(_0x5ef715,_0x34866d,_0x2f7872){var _0x3fade5={};var _0x38c93c={};var _0x1ef88d;var _0x160a76;return db['CmCompany'][_0xb272('0x55')]({'where':{'id':_0x5ef715[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x34866d,null))[_0xb272('0x25')](function(_0x356627){if(_0x356627){_0x1ef88d=_0x356627;_0x38c93c[_0xb272('0x2e')]=_['keys'](db[_0xb272('0x52')][_0xb272('0x56')]);_0x38c93c[_0xb272('0x2f')]=_[_0xb272('0x30')](_0x5ef715[_0xb272('0x2f')]);_0x38c93c[_0xb272('0x31')]=_[_0xb272('0x32')](_0x38c93c['model'],_0x38c93c['query']);_0x3fade5['attributes']=_[_0xb272('0x32')](_0x38c93c[_0xb272('0x2e')],qs['fields'](_0x5ef715[_0xb272('0x2f')][_0xb272('0x33')]));_0x3fade5[_0xb272('0x34')]=_0x3fade5[_0xb272('0x34')][_0xb272('0x35')]?_0x3fade5[_0xb272('0x34')]:_0x38c93c[_0xb272('0x2e')];_0x3fade5[_0xb272('0x57')]=qs[_0xb272('0x38')](_0x5ef715[_0xb272('0x2f')][_0xb272('0x38')]);_0x3fade5['where']=qs[_0xb272('0x31')](_[_0xb272('0x39')](_0x5ef715[_0xb272('0x2f')],_0x38c93c[_0xb272('0x31')]));if(_0x5ef715[_0xb272('0x2f')][_0xb272('0x3a')]){_0x3fade5[_0xb272('0x3b')]=_[_0xb272('0x3c')](_0x3fade5[_0xb272('0x3b')],{'$or':_[_0xb272('0x58')](_0x3fade5[_0xb272('0x34')],function(_0x2403e3){var _0x3b1527={};_0x3b1527[_0x2403e3]={'$like':'%'+_0x5ef715[_0xb272('0x2f')][_0xb272('0x3a')]+'%'};return _0x3b1527;})});}_0x3fade5=_[_0xb272('0x3c')]({},_0x3fade5,_0x5ef715['options']);return _0x1ef88d[_0xb272('0x54')](_0x3fade5);}})[_0xb272('0x25')](function(_0x5f06c2){if(_0x5f06c2){_0x160a76=_0x5f06c2['length'];if(!_0x5ef715[_0xb272('0x2f')][_0xb272('0x36')](_0xb272('0x37'))){_0x3fade5[_0xb272('0x1d')]=qs[_0xb272('0x1d')](_0x5ef715['query'][_0xb272('0x1d')]);_0x3fade5[_0xb272('0x1f')]=qs[_0xb272('0x1f')](_0x5ef715[_0xb272('0x2f')][_0xb272('0x1f')]);}return _0x1ef88d[_0xb272('0x54')](_0x3fade5);}})[_0xb272('0x25')](function(_0x2c5724){if(_0x2c5724){return _0x2c5724?{'count':_0x160a76,'rows':_0x2c5724}:null;}})[_0xb272('0x25')](respondWithResult(_0x34866d,null))['catch'](handleError(_0x34866d,null));}; \ No newline at end of file +var _0xdf1c=['apply','save','update','then','destroy','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','findOne','keys','hasOwnProperty','nolimit','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x5b5926,_0x50052d){var _0x1753f1=function(_0x2b1b4d){while(--_0x2b1b4d){_0x5b5926['push'](_0x5b5926['shift']());}};_0x1753f1(++_0x50052d);}(_0xdf1c,0xe3));var _0xcdf1=function(_0x2991ba,_0x3cc2c3){_0x2991ba=_0x2991ba-0x0;var _0x45665a=_0xdf1c[_0x2991ba];return _0x45665a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdf1('0x0'));var zipdir=require(_0xcdf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdf1('0x2'));var moment=require('moment');var BPromise=require(_0xcdf1('0x3'));var Mustache=require(_0xcdf1('0x4'));var util=require(_0xcdf1('0x5'));var path=require(_0xcdf1('0x6'));var sox=require(_0xcdf1('0x7'));var csv=require(_0xcdf1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdf1('0x9'));var _=require('lodash');var squel=require(_0xcdf1('0xa'));var crypto=require(_0xcdf1('0xb'));var jsforce=require(_0xcdf1('0xc'));var deskjs=require(_0xcdf1('0xd'));var toCsv=require(_0xcdf1('0x8'));var querystring=require(_0xcdf1('0xe'));var Papa=require('papaparse');var Redis=require(_0xcdf1('0xf'));var authService=require(_0xcdf1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdf1('0x11'));var utils=require('../../config/utils');var config=require(_0xcdf1('0x12'));var licenseUtil=require(_0xcdf1('0x13'));var db=require(_0xcdf1('0x14'))['db'];function respondWithStatusCode(_0x587932,_0x4d0871){_0x4d0871=_0x4d0871||0xcc;return function(_0x24cda9){if(_0x24cda9){return _0x587932[_0xcdf1('0x15')](_0x4d0871);}return _0x587932[_0xcdf1('0x16')](_0x4d0871)[_0xcdf1('0x17')]();};}function respondWithResult(_0x308611,_0x29bf0c){_0x29bf0c=_0x29bf0c||0xc8;return function(_0x5a76e1){if(_0x5a76e1){return _0x308611['status'](_0x29bf0c)[_0xcdf1('0x18')](_0x5a76e1);}};}function respondWithFilteredResult(_0x179ae9,_0x18a5c5){return function(_0x396057){if(_0x396057){var _0x9c3930=typeof _0x18a5c5[_0xcdf1('0x19')]==='undefined'&&typeof _0x18a5c5[_0xcdf1('0x1a')]===_0xcdf1('0x1b');var _0x5c4d37=_0x396057[_0xcdf1('0x1c')];var _0xb5177c=_0x9c3930?0x0:_0x18a5c5['offset'];var _0x19fe84=_0x9c3930?_0x396057[_0xcdf1('0x1c')]:_0x18a5c5[_0xcdf1('0x19')]+_0x18a5c5['limit'];var _0x2b3f79;if(_0x19fe84>=_0x5c4d37){_0x19fe84=_0x5c4d37;_0x2b3f79=0xc8;}else{_0x2b3f79=0xce;}_0x179ae9['status'](_0x2b3f79);return _0x179ae9[_0xcdf1('0x1d')](_0xcdf1('0x1e'),_0xb5177c+'-'+_0x19fe84+'/'+_0x5c4d37)[_0xcdf1('0x18')](_0x396057);}return null;};}function patchUpdates(_0x995ed0){return function(_0x75a625){try{jsonpatch[_0xcdf1('0x1f')](_0x75a625,_0x995ed0,!![]);}catch(_0x38d7a8){return BPromise['reject'](_0x38d7a8);}return _0x75a625[_0xcdf1('0x20')]();};}function saveUpdates(_0x262125,_0x226055){return function(_0x2703e3){if(_0x2703e3){return _0x2703e3[_0xcdf1('0x21')](_0x262125)[_0xcdf1('0x22')](function(_0x367482){return _0x367482;});}return null;};}function removeEntity(_0x56995f,_0x4802a2){return function(_0x4fad79){if(_0x4fad79){return _0x4fad79[_0xcdf1('0x23')]()[_0xcdf1('0x22')](function(){var _0x5ee777=_0x4fad79['get']({'plain':!![]});var _0x2ec349=_0xcdf1('0x24');return db[_0xcdf1('0x25')]['destroy']({'where':{'type':_0x2ec349,'resourceId':_0x5ee777['id']}})[_0xcdf1('0x22')](function(){return _0x4fad79;});})[_0xcdf1('0x22')](function(){_0x56995f[_0xcdf1('0x16')](0xcc)[_0xcdf1('0x17')]();});}};}function handleEntityNotFound(_0x4af307,_0x494483){return function(_0x474a64){if(!_0x474a64){_0x4af307[_0xcdf1('0x15')](0x194);}return _0x474a64;};}function handleError(_0x10853e,_0x37d99e){_0x37d99e=_0x37d99e||0x1f4;return function(_0x5b4039){logger[_0xcdf1('0x26')](_0x5b4039['stack']);if(_0x5b4039[_0xcdf1('0x27')]){delete _0x5b4039[_0xcdf1('0x27')];}_0x10853e[_0xcdf1('0x16')](_0x37d99e)[_0xcdf1('0x28')](_0x5b4039);};}exports[_0xcdf1('0x29')]=function(_0x24e865,_0x51529a){var _0x42437b={},_0x3adca3={},_0x43b555={'count':0x0,'rows':[]};return db[_0xcdf1('0x2a')][_0xcdf1('0x2b')]()[_0xcdf1('0x22')](function(_0x17afc1){_0x3adca3[_0xcdf1('0x2c')]=_['keys'](_0x17afc1);_0x3adca3[_0xcdf1('0x2d')]=_['keys'](_0x24e865[_0xcdf1('0x2d')]);_0x3adca3[_0xcdf1('0x2e')]=_[_0xcdf1('0x2f')](_0x3adca3[_0xcdf1('0x2c')],_0x3adca3[_0xcdf1('0x2d')]);_0x42437b[_0xcdf1('0x30')]=_[_0xcdf1('0x2f')](_0x3adca3[_0xcdf1('0x2c')],qs[_0xcdf1('0x31')](_0x24e865[_0xcdf1('0x2d')][_0xcdf1('0x31')]));_0x42437b[_0xcdf1('0x30')]=_0x42437b[_0xcdf1('0x30')][_0xcdf1('0x32')]?_0x42437b[_0xcdf1('0x30')]:_0x3adca3[_0xcdf1('0x2c')];if(!_0x24e865[_0xcdf1('0x2d')]['hasOwnProperty']('nolimit')){_0x42437b[_0xcdf1('0x1a')]=qs['limit'](_0x24e865['query']['limit']);_0x42437b['offset']=qs['offset'](_0x24e865[_0xcdf1('0x2d')][_0xcdf1('0x19')]);}_0x42437b[_0xcdf1('0x33')]=qs['sort'](_0x24e865['query'][_0xcdf1('0x34')]);_0x42437b['where']=qs[_0xcdf1('0x2e')](_[_0xcdf1('0x35')](_0x24e865[_0xcdf1('0x2d')],_0x3adca3[_0xcdf1('0x2e')]),_0x17afc1);if(_0x24e865[_0xcdf1('0x2d')][_0xcdf1('0x36')]){_0x42437b[_0xcdf1('0x37')]=_[_0xcdf1('0x38')](_0x42437b[_0xcdf1('0x37')],{'$or':_[_0xcdf1('0x39')](_0x42437b['attributes'],function(_0x40f1a6){var _0x5177e5={};_0x5177e5[_0x40f1a6]={'$like':'%'+_0x24e865[_0xcdf1('0x2d')]['filter']+'%'};return _0x5177e5;})});}_0x42437b=_[_0xcdf1('0x38')]({},_0x42437b,_0x24e865[_0xcdf1('0x3a')]);var _0x31915b={'where':_0x42437b[_0xcdf1('0x37')]};return db['CmCompany']['count'](_0x31915b)['then'](function(_0x7b6f4){_0x43b555[_0xcdf1('0x1c')]=_0x7b6f4;if(_0x24e865[_0xcdf1('0x2d')][_0xcdf1('0x3b')]){_0x42437b[_0xcdf1('0x3c')]=[{'all':!![]}];}return db[_0xcdf1('0x2a')][_0xcdf1('0x3d')](_0x42437b);})['then'](function(_0x5e44e5){_0x43b555[_0xcdf1('0x3e')]=_0x5e44e5;return _0x43b555;})[_0xcdf1('0x22')](respondWithFilteredResult(_0x51529a,_0x42437b))[_0xcdf1('0x3f')](handleError(_0x51529a,null));})['catch'](handleError(_0x51529a,null));};exports[_0xcdf1('0x40')]=function(_0x3eb81f,_0x3d9e7e){var _0x50a903={'raw':![],'where':{'id':_0x3eb81f[_0xcdf1('0x41')]['id']}},_0x4092e7={};_0x4092e7[_0xcdf1('0x2c')]=_['keys'](db[_0xcdf1('0x2a')][_0xcdf1('0x42')]);_0x4092e7['query']=_['keys'](_0x3eb81f[_0xcdf1('0x2d')]);_0x4092e7[_0xcdf1('0x2e')]=_[_0xcdf1('0x2f')](_0x4092e7[_0xcdf1('0x2c')],_0x4092e7[_0xcdf1('0x2d')]);_0x50a903['attributes']=_[_0xcdf1('0x2f')](_0x4092e7[_0xcdf1('0x2c')],qs['fields'](_0x3eb81f[_0xcdf1('0x2d')][_0xcdf1('0x31')]));_0x50a903[_0xcdf1('0x30')]=_0x50a903[_0xcdf1('0x30')][_0xcdf1('0x32')]?_0x50a903[_0xcdf1('0x30')]:_0x4092e7[_0xcdf1('0x2c')];if(_0x3eb81f['query'][_0xcdf1('0x3b')]){_0x50a903[_0xcdf1('0x3c')]=[{'all':!![]}];}_0x50a903=_['merge']({},_0x50a903,_0x3eb81f[_0xcdf1('0x3a')]);return db[_0xcdf1('0x2a')][_0xcdf1('0x43')](_0x50a903)[_0xcdf1('0x22')](handleEntityNotFound(_0x3d9e7e,null))[_0xcdf1('0x22')](respondWithResult(_0x3d9e7e,null))[_0xcdf1('0x3f')](handleError(_0x3d9e7e,null));};exports[_0xcdf1('0x44')]=function(_0x5d053e,_0x5381ce){return db['CmCompany']['create'](_0x5d053e['body'],{})['then'](function(_0x168ac8){var _0x4d36ea=_0x5d053e[_0xcdf1('0x45')][_0xcdf1('0x46')]({'plain':!![]});if(!_0x4d36ea)throw new Error(_0xcdf1('0x47'));if(_0x4d36ea['role']===_0xcdf1('0x45')){var _0x6d4863=_0x168ac8[_0xcdf1('0x46')]({'plain':!![]});var _0x493305=_0xcdf1('0x24');return db[_0xcdf1('0x48')]['find']({'where':{'name':_0x493305,'userProfileId':_0x4d36ea[_0xcdf1('0x49')]},'raw':!![]})[_0xcdf1('0x22')](function(_0x1f42c8){if(_0x1f42c8&&_0x1f42c8[_0xcdf1('0x4a')]===0x0){return db['UserProfileResource'][_0xcdf1('0x44')]({'name':_0x6d4863['name'],'resourceId':_0x6d4863['id'],'type':_0x1f42c8[_0xcdf1('0x27')],'sectionId':_0x1f42c8['id']},{})['then'](function(){return _0x168ac8;});}else{return _0x168ac8;}})[_0xcdf1('0x3f')](function(_0x432138){logger[_0xcdf1('0x26')](_0xcdf1('0x4b'),_0x432138);throw _0x432138;});}return _0x168ac8;})[_0xcdf1('0x22')](respondWithResult(_0x5381ce,0xc9))[_0xcdf1('0x3f')](handleError(_0x5381ce,null));};exports[_0xcdf1('0x21')]=function(_0x3070d8,_0x3b1c0c){if(_0x3070d8[_0xcdf1('0x4c')]['id']){delete _0x3070d8[_0xcdf1('0x4c')]['id'];}return db[_0xcdf1('0x2a')][_0xcdf1('0x43')]({'where':{'id':_0x3070d8['params']['id']}})[_0xcdf1('0x22')](handleEntityNotFound(_0x3b1c0c,null))[_0xcdf1('0x22')](saveUpdates(_0x3070d8[_0xcdf1('0x4c')],null))[_0xcdf1('0x22')](respondWithResult(_0x3b1c0c,null))['catch'](handleError(_0x3b1c0c,null));};exports['destroy']=function(_0x2e5750,_0x548b00){return db[_0xcdf1('0x2a')]['find']({'where':{'id':_0x2e5750['params']['id']}})[_0xcdf1('0x22')](handleEntityNotFound(_0x548b00,null))[_0xcdf1('0x22')](removeEntity(_0x548b00,null))[_0xcdf1('0x3f')](handleError(_0x548b00,null));};exports['describe']=function(_0x30bd24,_0x4e41cd){return db[_0xcdf1('0x2a')]['describe']()[_0xcdf1('0x22')](respondWithResult(_0x4e41cd,null))[_0xcdf1('0x3f')](handleError(_0x4e41cd,null));};exports[_0xcdf1('0x4d')]=function(_0x1faf1a,_0x2efb98,_0x2c9ca4){return db[_0xcdf1('0x4e')][_0xcdf1('0x43')]({'where':{'id':_0x1faf1a[_0xcdf1('0x41')]['id']}})['then'](handleEntityNotFound(_0x2efb98,null))['then'](function(_0x1ef026){if(_0x1ef026){return _0x1ef026[_0xcdf1('0x4d')](_0x1faf1a['body'][_0xcdf1('0x4f')],_[_0xcdf1('0x50')](_0x1faf1a[_0xcdf1('0x4c')],['ids','id'])||{});}})[_0xcdf1('0x22')](respondWithResult(_0x2efb98,null))[_0xcdf1('0x3f')](handleError(_0x2efb98,null));};exports[_0xcdf1('0x51')]=function(_0x359bf7,_0x1ea9a2,_0xe8aad0){var _0x21ea79={};var _0x27014a={};var _0x12d536;var _0x45482;return db[_0xcdf1('0x2a')][_0xcdf1('0x52')]({'where':{'id':_0x359bf7['params']['id']}})[_0xcdf1('0x22')](handleEntityNotFound(_0x1ea9a2,null))[_0xcdf1('0x22')](function(_0x56e516){if(_0x56e516){_0x12d536=_0x56e516;_0x27014a[_0xcdf1('0x2c')]=_[_0xcdf1('0x53')](db[_0xcdf1('0x4e')]['rawAttributes']);_0x27014a[_0xcdf1('0x2d')]=_[_0xcdf1('0x53')](_0x359bf7['query']);_0x27014a[_0xcdf1('0x2e')]=_[_0xcdf1('0x2f')](_0x27014a[_0xcdf1('0x2c')],_0x27014a[_0xcdf1('0x2d')]);_0x21ea79['attributes']=_[_0xcdf1('0x2f')](_0x27014a[_0xcdf1('0x2c')],qs['fields'](_0x359bf7[_0xcdf1('0x2d')][_0xcdf1('0x31')]));_0x21ea79[_0xcdf1('0x30')]=_0x21ea79[_0xcdf1('0x30')][_0xcdf1('0x32')]?_0x21ea79[_0xcdf1('0x30')]:_0x27014a[_0xcdf1('0x2c')];_0x21ea79[_0xcdf1('0x33')]=qs[_0xcdf1('0x34')](_0x359bf7[_0xcdf1('0x2d')][_0xcdf1('0x34')]);_0x21ea79['where']=qs[_0xcdf1('0x2e')](_[_0xcdf1('0x35')](_0x359bf7[_0xcdf1('0x2d')],_0x27014a[_0xcdf1('0x2e')]));if(_0x359bf7[_0xcdf1('0x2d')][_0xcdf1('0x36')]){_0x21ea79[_0xcdf1('0x37')]=_[_0xcdf1('0x38')](_0x21ea79[_0xcdf1('0x37')],{'$or':_[_0xcdf1('0x39')](_0x21ea79['attributes'],function(_0x238945){var _0x3f32c9={};_0x3f32c9[_0x238945]={'$like':'%'+_0x359bf7[_0xcdf1('0x2d')][_0xcdf1('0x36')]+'%'};return _0x3f32c9;})});}_0x21ea79=_[_0xcdf1('0x38')]({},_0x21ea79,_0x359bf7[_0xcdf1('0x3a')]);return _0x12d536['getContacts'](_0x21ea79);}})[_0xcdf1('0x22')](function(_0x5b0627){if(_0x5b0627){_0x45482=_0x5b0627['length'];if(!_0x359bf7[_0xcdf1('0x2d')][_0xcdf1('0x54')](_0xcdf1('0x55'))){_0x21ea79[_0xcdf1('0x1a')]=qs[_0xcdf1('0x1a')](_0x359bf7[_0xcdf1('0x2d')]['limit']);_0x21ea79[_0xcdf1('0x19')]=qs[_0xcdf1('0x19')](_0x359bf7[_0xcdf1('0x2d')][_0xcdf1('0x19')]);}return _0x12d536['getContacts'](_0x21ea79);}})[_0xcdf1('0x22')](function(_0x33e416){if(_0x33e416){return _0x33e416?{'count':_0x45482,'rows':_0x33e416}:null;}})[_0xcdf1('0x22')](respondWithResult(_0x1ea9a2,null))['catch'](handleError(_0x1ea9a2,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index c3d01f0..dfb973d 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 _0x5c40=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x4e11e7,_0x42d0b6){var _0x1d7d39=function(_0x416030){while(--_0x416030){_0x4e11e7['push'](_0x4e11e7['shift']());}};_0x1d7d39(++_0x42d0b6);}(_0x5c40,0x11c));var _0x05c4=function(_0x53e1c4,_0x11347f){_0x53e1c4=_0x53e1c4-0x0;var _0xaa2da3=_0x5c40[_0x53e1c4];return _0xaa2da3;};'use strict';var _=require(_0x05c4('0x0'));var util=require(_0x05c4('0x1'));var logger=require(_0x05c4('0x2'))(_0x05c4('0x3'));var moment=require(_0x05c4('0x4'));var BPromise=require(_0x05c4('0x5'));var rp=require(_0x05c4('0x6'));var fs=require('fs');var path=require(_0x05c4('0x7'));var rimraf=require('rimraf');var config=require(_0x05c4('0x8'));var attributes=require('./cmCompany.attributes');module[_0x05c4('0x9')]=function(_0x36383d,_0x2f3852){return _0x36383d[_0x05c4('0xa')](_0x05c4('0xb'),attributes,{'tableName':_0x05c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8139=['moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger'];(function(_0x5c0a90,_0x448892){var _0x5adda6=function(_0x24310f){while(--_0x24310f){_0x5c0a90['push'](_0x5c0a90['shift']());}};_0x5adda6(++_0x448892);}(_0x8139,0x76));var _0x9813=function(_0x15c6fc,_0x5e7a75){_0x15c6fc=_0x15c6fc-0x0;var _0x1185dd=_0x8139[_0x15c6fc];return _0x1185dd;};'use strict';var _=require(_0x9813('0x0'));var util=require(_0x9813('0x1'));var logger=require(_0x9813('0x2'))('api');var moment=require(_0x9813('0x3'));var BPromise=require(_0x9813('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9813('0x5'));var config=require(_0x9813('0x6'));var attributes=require(_0x9813('0x7'));module[_0x9813('0x8')]=function(_0x3207f3,_0x27ae58){return _0x3207f3[_0x9813('0x9')](_0x9813('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index bd1f116..7e9f328 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 _0x6178=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then'];(function(_0x4dd441,_0x4a0ea0){var _0x492067=function(_0x310ab8){while(--_0x310ab8){_0x4dd441['push'](_0x4dd441['shift']());}};_0x492067(++_0x4a0ea0);}(_0x6178,0x8e));var _0x8617=function(_0x275560,_0xead495){_0x275560=_0x275560-0x0;var _0x3dcabc=_0x6178[_0x275560];return _0x3dcabc;};'use strict';var _=require(_0x8617('0x0'));var util=require(_0x8617('0x1'));var moment=require(_0x8617('0x2'));var BPromise=require(_0x8617('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8617('0x4'));var db=require(_0x8617('0x5'))['db'];var utils=require(_0x8617('0x6'));var logger=require('../../config/logger')(_0x8617('0x7'));var config=require(_0x8617('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8617('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6318,_0x5e6380,_0x185e85){return new BPromise(function(_0x2582e9,_0x470bcc){return client[_0x8617('0xa')](_0x1f6318,_0x185e85)[_0x8617('0xb')](function(_0x383555){logger['info'](_0x8617('0xc'),_0x5e6380,_0x8617('0xd'));logger[_0x8617('0xe')](_0x8617('0xf'),_0x5e6380,'request\x20sent',JSON[_0x8617('0x10')](_0x383555));if(_0x383555[_0x8617('0x11')]){if(_0x383555[_0x8617('0x11')][_0x8617('0x12')]===0x1f4){logger[_0x8617('0x11')](_0x8617('0xc'),_0x5e6380,_0x383555['error'][_0x8617('0x13')]);return _0x470bcc(_0x383555['error'][_0x8617('0x13')]);}logger['error'](_0x8617('0xc'),_0x5e6380,_0x383555[_0x8617('0x11')][_0x8617('0x13')]);return _0x2582e9(_0x383555[_0x8617('0x11')][_0x8617('0x13')]);}else{logger[_0x8617('0x14')](_0x8617('0xc'),_0x5e6380,_0x8617('0xd'));_0x2582e9(_0x383555['result']['message']);}})[_0x8617('0x15')](function(_0x5c6ec1){logger['error'](_0x8617('0xc'),_0x5e6380,_0x5c6ec1);_0x470bcc(_0x5c6ec1);});});} \ No newline at end of file +var _0x3bb3=['bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util'];(function(_0x176d37,_0x5dfa31){var _0x14cf5c=function(_0xa78179){while(--_0xa78179){_0x176d37['push'](_0x176d37['shift']());}};_0x14cf5c(++_0x5dfa31);}(_0x3bb3,0x152));var _0x33bb=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3bb3[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x33bb('0x0'));var util=require(_0x33bb('0x1'));var moment=require('moment');var BPromise=require(_0x33bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x33bb('0x4'))(_0x33bb('0x5'));var config=require('../../config/environment');var jayson=require(_0x33bb('0x6'));var client=jayson[_0x33bb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e157c,_0x1a3f95,_0x31b2b9){return new BPromise(function(_0x5e88c8,_0x1fa6c4){return client['request'](_0x3e157c,_0x31b2b9)[_0x33bb('0x8')](function(_0x2d49a6){logger[_0x33bb('0x9')](_0x33bb('0xa'),_0x1a3f95,_0x33bb('0xb'));logger[_0x33bb('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x1a3f95,_0x33bb('0xb'),JSON[_0x33bb('0xd')](_0x2d49a6));if(_0x2d49a6[_0x33bb('0xe')]){if(_0x2d49a6['error']['code']===0x1f4){logger[_0x33bb('0xe')](_0x33bb('0xa'),_0x1a3f95,_0x2d49a6[_0x33bb('0xe')][_0x33bb('0xf')]);return _0x1fa6c4(_0x2d49a6[_0x33bb('0xe')]['message']);}logger[_0x33bb('0xe')]('CmCompany,\x20%s,\x20%s',_0x1a3f95,_0x2d49a6[_0x33bb('0xe')][_0x33bb('0xf')]);return _0x5e88c8(_0x2d49a6[_0x33bb('0xe')][_0x33bb('0xf')]);}else{logger[_0x33bb('0x9')]('CmCompany,\x20%s,\x20%s',_0x1a3f95,_0x33bb('0xb'));_0x5e88c8(_0x2d49a6[_0x33bb('0x10')]['message']);}})['catch'](function(_0x26c5e3){logger[_0x33bb('0xe')](_0x33bb('0xa'),_0x1a3f95,_0x26c5e3);_0x1fa6c4(_0x26c5e3);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 3e58b2a..5197b17 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 _0x5def=['express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','multer','util','path'];(function(_0x47412e,_0x1acf84){var _0x398524=function(_0x2d358c){while(--_0x2d358c){_0x47412e['push'](_0x47412e['shift']());}};_0x398524(++_0x1acf84);}(_0x5def,0x162));var _0xf5de=function(_0x3614f2,_0x1bb103){_0x3614f2=_0x3614f2-0x0;var _0x5dc391=_0x5def[_0x3614f2];return _0x5dc391;};'use strict';var multer=require(_0xf5de('0x0'));var util=require(_0xf5de('0x1'));var path=require(_0xf5de('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5de('0x3'));var router=express[_0xf5de('0x4')]();var fs_extra=require(_0xf5de('0x5'));var auth=require(_0xf5de('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5de('0x7'));router[_0xf5de('0x8')]('/',auth[_0xf5de('0x9')](),controller['index']);router[_0xf5de('0x8')](_0xf5de('0xa'),auth[_0xf5de('0x9')](),controller[_0xf5de('0xb')]);router['get'](_0xf5de('0xc'),auth['isAuthenticated'](),controller[_0xf5de('0xd')]);router[_0xf5de('0x8')](_0xf5de('0xe'),auth[_0xf5de('0x9')](),controller['getContacts']);router[_0xf5de('0xf')]('/',auth[_0xf5de('0x9')](),controller['create']);router[_0xf5de('0xf')](_0xf5de('0xe'),auth[_0xf5de('0x9')](),controller[_0xf5de('0x10')]);router[_0xf5de('0x11')]('/:id',auth[_0xf5de('0x9')](),controller['update']);router[_0xf5de('0x12')](_0xf5de('0xc'),auth['isAuthenticated'](),controller[_0xf5de('0x13')]);module[_0xf5de('0x14')]=router; \ No newline at end of file +var _0x1aa5=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','create','addContacts','update','delete','destroy','multer'];(function(_0x3cc6af,_0x5929a4){var _0x326cdd=function(_0x35a28b){while(--_0x35a28b){_0x3cc6af['push'](_0x3cc6af['shift']());}};_0x326cdd(++_0x5929a4);}(_0x1aa5,0x18e));var _0x51aa=function(_0x119226,_0x51833a){_0x119226=_0x119226-0x0;var _0x166d0a=_0x1aa5[_0x119226];return _0x166d0a;};'use strict';var multer=require(_0x51aa('0x0'));var util=require('util');var path=require(_0x51aa('0x1'));var timeout=require(_0x51aa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x51aa('0x3'));var auth=require(_0x51aa('0x4'));var interaction=require(_0x51aa('0x5'));var config=require('../../config/environment');var controller=require(_0x51aa('0x6'));router[_0x51aa('0x7')]('/',auth[_0x51aa('0x8')](),controller[_0x51aa('0x9')]);router[_0x51aa('0x7')](_0x51aa('0xa'),auth[_0x51aa('0x8')](),controller['describe']);router[_0x51aa('0x7')](_0x51aa('0xb'),auth['isAuthenticated'](),controller[_0x51aa('0xc')]);router[_0x51aa('0x7')](_0x51aa('0xd'),auth[_0x51aa('0x8')](),controller['getContacts']);router['post']('/',auth[_0x51aa('0x8')](),controller[_0x51aa('0xe')]);router['post']('/:id/contacts',auth[_0x51aa('0x8')](),controller[_0x51aa('0xf')]);router['put']('/:id',auth[_0x51aa('0x8')](),controller[_0x51aa('0x10')]);router[_0x51aa('0x11')](_0x51aa('0xb'),auth[_0x51aa('0x8')](),controller[_0x51aa('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 05ad743..067cabd 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 _0x631f=['lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x631f,0x198));var _0xf631=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x631f[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0xf631('0x0'));var Sequelize=require(_0xf631('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xf631('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf631('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf631('0x2')]},'country':{'type':Sequelize[_0xf631('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf631('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf631('0x2')]},'fax':{'type':Sequelize[_0xf631('0x2')]},'email':{'type':Sequelize[_0xf631('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf631('0x2')]},'fb_data':{'type':Sequelize[_0xf631('0x2')]},'twitter':{'type':Sequelize[_0xf631('0x2')]},'skype':{'type':Sequelize[_0xf631('0x2')]},'teams':{'type':Sequelize[_0xf631('0x2')]},'viber':{'type':Sequelize[_0xf631('0x2')]},'line':{'type':Sequelize[_0xf631('0x2')]},'wechat':{'type':Sequelize[_0xf631('0x2')]},'telegram':{'type':Sequelize[_0xf631('0x2')]},'UserId':{'type':Sequelize[_0xf631('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf631('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf631('0x6')],'defaultValue':Sequelize[_0xf631('0x7')]}}; \ No newline at end of file +var _0x29ca=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x4dea8f,_0x7abc1b){var _0x472ea6=function(_0x2e3f2a){while(--_0x2e3f2a){_0x4dea8f['push'](_0x4dea8f['shift']());}};_0x472ea6(++_0x7abc1b);}(_0x29ca,0x1a4));var _0xa29c=function(_0x2a7d55,_0x36bd70){_0x2a7d55=_0x2a7d55-0x0;var _0x137989=_0x29ca[_0x2a7d55];return _0x137989;};'use strict';var _=require(_0xa29c('0x0'));var Sequelize=require(_0xa29c('0x1'));module[_0xa29c('0x2')]={'firstName':{'type':Sequelize[_0xa29c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa29c('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa29c('0x3')]},'country':{'type':Sequelize[_0xa29c('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa29c('0x4')]},'phone':{'type':Sequelize[_0xa29c('0x3')]},'mobile':{'type':Sequelize[_0xa29c('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xa29c('0x3')]},'facebook':{'type':Sequelize[_0xa29c('0x3')]},'fb_data':{'type':Sequelize[_0xa29c('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa29c('0x3')]},'teams':{'type':Sequelize[_0xa29c('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa29c('0x3')]},'wechat':{'type':Sequelize[_0xa29c('0x3')]},'telegram':{'type':Sequelize[_0xa29c('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xa29c('0x5')](0x2)[_0xa29c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa29c('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 1a8c9ca..0415c91 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 _0x2082=['join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','show','isNil','$and','CmCustomField','omit','format','cf_%d','pickBy','setFields','phone','getTags','findOne','rawAttributes','pick','setTags','ids','ContactId','options','include','getHopperHistories','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','import','User','binding','child_process','fork','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','mail','chat','sms','fax','whatsapp','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','source','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','startCase','Website','Account','closed','disposition','secondDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','slice','util','path','squel','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','undefined','limit','count','Content-Range','update','then','destroy','end','sendStatus','error','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','trimStart','all','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','buildExpression','text','start','filter','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','having','t.id\x20IN\x20?','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','params','catch','displayName','analytics','findAll','columnName','alias','custom','values','merge','body','get','mergeWith','tags'];(function(_0x5a30fb,_0x206270){var _0x3b86aa=function(_0x67ea17){while(--_0x67ea17){_0x5a30fb['push'](_0x5a30fb['shift']());}};_0x3b86aa(++_0x206270);}(_0x2082,0x8e));var _0x2208=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2082[_0x1928c9];return _0x51b5fb;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x2208('0x0'));var path=require(_0x2208('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2208('0x2'));var Papa=require(_0x2208('0x3'));var Redis=require('ioredis');var qs=require(_0x2208('0x4'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x2208('0x5'))(_0x2208('0x6'));var config=require(_0x2208('0x7'));var db=require(_0x2208('0x8'))['db'];config[_0x2208('0x9')]=_[_0x2208('0xa')](config[_0x2208('0x9')],{'host':_0x2208('0xb'),'port':0x18eb});var socket=require(_0x2208('0xc'))(new Redis(config['redis']));require(_0x2208('0xd'))[_0x2208('0xe')](socket);function respondWithResult(_0xffba92,_0x55ff66){_0x55ff66=_0x55ff66||0xc8;return function(_0x520d37){if(_0x520d37){return _0xffba92[_0x2208('0xf')](_0x55ff66)[_0x2208('0x10')](_0x520d37);}};}function respondWithFilteredResult(_0x242717,_0x1e8558){return function(_0xf557ec){if(_0xf557ec){var _0xae42d8=typeof _0x1e8558['offset']===_0x2208('0x11')&&typeof _0x1e8558[_0x2208('0x12')]===_0x2208('0x11');var _0x2a9492=_0xf557ec[_0x2208('0x13')];var _0x3b7f23=_0xae42d8?0x0:_0x1e8558['offset'];var _0x485496=_0xae42d8?_0xf557ec[_0x2208('0x13')]:_0x1e8558['offset']+_0x1e8558[_0x2208('0x12')];var _0x5373bc;if(_0x485496>=_0x2a9492){_0x485496=_0x2a9492;_0x5373bc=0xc8;}else{_0x5373bc=0xce;}_0x242717[_0x2208('0xf')](_0x5373bc);return _0x242717['set'](_0x2208('0x14'),_0x3b7f23+'-'+_0x485496+'/'+_0x2a9492)[_0x2208('0x10')](_0xf557ec);}return null;};}function saveUpdates(_0x12a701){return function(_0x1dde6a){if(_0x1dde6a){return _0x1dde6a[_0x2208('0x15')](_0x12a701)[_0x2208('0x16')](function(_0x51f03a){return _0x51f03a;});}return null;};}function removeEntity(_0x6b27ee){return function(_0x2a3450){if(_0x2a3450){return _0x2a3450[_0x2208('0x17')]()[_0x2208('0x16')](function(){_0x6b27ee[_0x2208('0xf')](0xcc)[_0x2208('0x18')]();});}};}function handleEntityNotFound(_0x3e7733){return function(_0xda6614){if(!_0xda6614){_0x3e7733[_0x2208('0x19')](0x194);}return _0xda6614;};}function handleError(_0x289c0c,_0x46a1e5){_0x46a1e5=_0x46a1e5||0x1f4;return function(_0x3092c3){logger[_0x2208('0x1a')](_0x3092c3['stack']);if(_0x3092c3[_0x2208('0x1b')]){delete _0x3092c3[_0x2208('0x1b')];}_0x289c0c[_0x2208('0xf')](_0x46a1e5)[_0x2208('0x1c')](_0x3092c3);};}exports[_0x2208('0x1d')]=function(_0x43e350,_0x246706){var _0x274276={},_0x3970af={},_0x5b85e7={'count':0x0,'rows':[]};return db[_0x2208('0x1e')][_0x2208('0x1f')]()['then'](function(_0x5303f3){var _0x5b412b=[];for(var _0x331bba=0x0;_0x331bba0x1){_0x11096d['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2208('0x60')](_0x27e48d),null);}else{if(qs['isNumeric'](_0x27e48d)){_0x11096d['or']('c.id\x20LIKE\x20?',_0x27e48d+'%');_0x11096d['or'](_0x2208('0x61'),_0x27e48d+'%');_0x11096d['or']('c.mobile\x20LIKE\x20?',_0x27e48d+'%');_0x11096d['or']('c.fax\x20LIKE\x20?',_0x27e48d+'%');}else if(qs['isEmail'](_0x27e48d)){_0x11096d['or'](_0x2208('0x62'),_0x27e48d+'%');}else{_0x11096d['or']('c.firstName\x20LIKE\x20?','%'+_0x27e48d+'%');_0x11096d['or'](_0x2208('0x63'),'%'+_0x27e48d+'%');_0x11096d['or'](_0x2208('0x62'),'%'+_0x27e48d+'%');}}}}_0x10e47f[_0x2208('0x33')](_0x11096d);_0x10e47f[_0x2208('0x64')](_0x2208('0x65'));var _0x468a43={'type':db[_0x2208('0x66')]['QueryTypes']['SELECT'],'raw':!![]};var _0x37669a=_0x10e47f['clone']()[_0x2208('0x35')](_0x2208('0x65'));if(_0x274276[_0x2208('0x31')]){_0x274276[_0x2208('0x31')]['forEach'](function(_0x5d7e98){_0x10e47f['order']('c.'+_0x5d7e98[0x0],_0x5d7e98[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2bb1a5)){_0x10e47f[_0x2208('0x67')](_0x58ef2f);_0x37669a[_0x2208('0x33')](_0x2208('0x68'),_0x2bb1a5);}BPromise[_0x2208('0x69')]()[_0x2208('0x16')](function(){if(!_0x38117a)return;if(_0x43e350[_0x2208('0x6a')]['role']!==_0x2208('0x6b'))return;if(!_[_0x2208('0x6c')](_0x38117a[_0x2208('0x43')],[_0x2208('0x35'),'User'])){return _0x43e350[_0x2208('0x6a')][_0x2208('0x6d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x103bac){if(_[_0x2208('0x56')](_0x103bac)){_0x37669a['where'](_0x2208('0x6e'));_0x10e47f[_0x2208('0x33')](_0x2208('0x6e'));}else{_0x37669a[_0x2208('0x33')](_0x2208('0x59'),_[_0x2208('0x48')](_0x103bac,'id'));_0x10e47f[_0x2208('0x33')]('c.ListId\x20IN\x20?',_[_0x2208('0x48')](_0x103bac,'id'));}});}})[_0x2208('0x16')](function(){if(_0x43e350[_0x2208('0x6a')][_0x2208('0x6f')]===_0x2208('0x6b')&&!_0x38117a&&!_0x43e350[_0x2208('0x29')]['ListId'])return[];return db[_0x2208('0x70')]['query'](_0x37669a[_0x2208('0x71')](),_0x468a43);})[_0x2208('0x16')](function(_0x5d83bb){_0x5b85e7['count']=_0x5d83bb[_0x2208('0x21')];if(_0x5b85e7[_0x2208('0x13')]===0x0)return[];return db[_0x2208('0x70')]['query'](_0x1fc29f[_0x2208('0x71')](),_0x468a43)[_0x2208('0x16')](function(_0x25ed5f){_0x365be8=_[_0x2208('0x72')](_0x25ed5f,'id');_0x468a43=_['merge'](_0x468a43,{'model':db[_0x2208('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43e350[_0x2208('0x29')][_0x2208('0x2d')]){_0x274276[_0x2208('0x2b')]['forEach'](function(_0x210084){_0x10e47f[_0x2208('0x35')]('c.'+_0x210084);});}else{_0x10e47f['field']('c.id');_0x10e47f[_0x2208('0x35')](_0x2208('0x73'));_0x10e47f[_0x2208('0x35')](_0x2208('0x74'));_0x10e47f['field'](_0x2208('0x75'));_0x10e47f[_0x2208('0x35')](_0x2208('0x76'));_0x10e47f[_0x2208('0x35')]('c.fax');_0x10e47f[_0x2208('0x35')]('c.email');_0x10e47f['field'](_0x2208('0x77'));_0x10e47f[_0x2208('0x35')](_0x2208('0x78'));_0x10e47f[_0x2208('0x35')](_0x2208('0x79'));_0x10e47f[_0x2208('0x35')](_0x2208('0x7a'));_0x10e47f[_0x2208('0x35')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2208('0x7b'));}if(_0x274276[_0x2208('0x12')])_0x10e47f['limit'](_0x274276['limit']);if(_0x274276['offset'])_0x10e47f[_0x2208('0x30')](_0x274276[_0x2208('0x30')]);return db[_0x2208('0x70')][_0x2208('0x29')](_0x10e47f[_0x2208('0x71')](),_0x468a43);});})[_0x2208('0x16')](function(_0x254d52){_0x254d52[_0x2208('0x57')](function(_0x22e51b){if(_0x22e51b[_0x2208('0x7b')]){_0x22e51b[_0x2208('0x7c')]=[];_0x22e51b['TagIds'][_0x2208('0x47')](',')['forEach'](function(_0xf0f07a){_0x22e51b['Tags'][_0x2208('0x24')](_0x365be8[_0xf0f07a]);});}delete _0x22e51b[_0x2208('0x7b')];});_0x5b85e7[_0x2208('0x7d')]=_0x254d52;return _0x5b85e7;})['then'](respondWithFilteredResult(_0x246706,_0x274276));})['catch'](handleError(_0x246706,null));};exports[_0x2208('0x17')]=function(_0xf4f436,_0x467f45){return db[_0x2208('0x1e')][_0x2208('0x44')]({'where':{'id':_0xf4f436[_0x2208('0x7e')]['id']}})[_0x2208('0x16')](handleEntityNotFound(_0x467f45,null))[_0x2208('0x16')](removeEntity(_0x467f45,null))[_0x2208('0x7f')](handleError(_0x467f45,null));};exports['describe']=function(_0x59db23,_0x314292){return db['CmContact'][_0x2208('0x1f')]()[_0x2208('0x16')](function(_0x5101ce){delete _0x5101ce['tags'];for(var _0x5b8888=0x0;_0x5b8888=_0x1e138e){_0x39ed69=_0x1e138e;_0x51f68e=0xc8;}else{_0x51f68e=0xce;}_0x5299de['status'](_0x51f68e);return _0x5299de[_0x03ef('0x14')](_0x03ef('0x15'),_0x2eb81a+'-'+_0x39ed69+'/'+_0x1e138e)[_0x03ef('0xf')](_0x278ff9);}return null;};}function saveUpdates(_0x2f6a35){return function(_0x12169c){if(_0x12169c){return _0x12169c['update'](_0x2f6a35)['then'](function(_0x343bf0){return _0x343bf0;});}return null;};}function removeEntity(_0x1f412c){return function(_0x501d87){if(_0x501d87){return _0x501d87['destroy']()[_0x03ef('0x16')](function(){_0x1f412c[_0x03ef('0xe')](0xcc)[_0x03ef('0x17')]();});}};}function handleEntityNotFound(_0x111073){return function(_0x1776d8){if(!_0x1776d8){_0x111073['sendStatus'](0x194);}return _0x1776d8;};}function handleError(_0x275e03,_0x47c1e6){_0x47c1e6=_0x47c1e6||0x1f4;return function(_0x5161b0){logger[_0x03ef('0x18')](_0x5161b0[_0x03ef('0x19')]);if(_0x5161b0[_0x03ef('0x1a')]){delete _0x5161b0[_0x03ef('0x1a')];}_0x275e03[_0x03ef('0xe')](_0x47c1e6)['send'](_0x5161b0);};}exports['index']=function(_0x41d7d7,_0x5d56e1){var _0x11073e={},_0x5644f5={},_0x5c1a36={'count':0x0,'rows':[]};return db[_0x03ef('0x1b')][_0x03ef('0x1c')]()['then'](function(_0x5f0084){var _0x3aafcd=[];for(var _0x38a7c5=0x0;_0x38a7c50x1){_0x2ec612['or'](_0x03ef('0x57'),qs['getFullTextValue'](_0x440366),null);}else{if(qs['isNumeric'](_0x440366)){_0x2ec612['or'](_0x03ef('0x58'),_0x440366+'%');_0x2ec612['or'](_0x03ef('0x59'),_0x440366+'%');_0x2ec612['or'](_0x03ef('0x5a'),_0x440366+'%');_0x2ec612['or'](_0x03ef('0x5b'),_0x440366+'%');}else if(qs['isEmail'](_0x440366)){_0x2ec612['or'](_0x03ef('0x5c'),_0x440366+'%');}else{_0x2ec612['or'](_0x03ef('0x5d'),'%'+_0x440366+'%');_0x2ec612['or'](_0x03ef('0x5e'),'%'+_0x440366+'%');_0x2ec612['or'](_0x03ef('0x5c'),'%'+_0x440366+'%');}}}}_0x3d1c9e[_0x03ef('0x2d')](_0x2ec612);_0x3d1c9e[_0x03ef('0x5f')]('c.id');var _0x30fe3b={'type':db[_0x03ef('0x60')][_0x03ef('0x61')]['SELECT'],'raw':!![]};var _0x111935=_0x3d1c9e[_0x03ef('0x62')]()[_0x03ef('0x30')](_0x03ef('0x63'));if(_0x11073e[_0x03ef('0x64')]){_0x11073e[_0x03ef('0x64')]['forEach'](function(_0x8923b9){_0x3d1c9e[_0x03ef('0x64')]('c.'+_0x8923b9[0x0],_0x8923b9[0x1]==='DESC'?![]:!![]);});}if(!_[_0x03ef('0x51')](_0x5f8cb2)){_0x3d1c9e[_0x03ef('0x65')](_0x5b79de);_0x111935[_0x03ef('0x2d')](_0x03ef('0x66'),_0x5f8cb2);}BPromise['resolve']()[_0x03ef('0x16')](function(){if(!_0x113f9b)return;if(_0x41d7d7[_0x03ef('0x67')][_0x03ef('0x68')]!==_0x03ef('0x69'))return;if(!_[_0x03ef('0x6a')](_0x113f9b[_0x03ef('0x40')],[_0x03ef('0x30'),_0x03ef('0x48')])){return _0x41d7d7[_0x03ef('0x67')][_0x03ef('0x6b')]({'attributes':['id'],'raw':!![]})[_0x03ef('0x16')](function(_0x49489a){if(_[_0x03ef('0x51')](_0x49489a)){_0x111935[_0x03ef('0x2d')](_0x03ef('0x6c'));_0x3d1c9e[_0x03ef('0x2d')](_0x03ef('0x6c'));}else{_0x111935[_0x03ef('0x2d')](_0x03ef('0x6d'),_[_0x03ef('0x44')](_0x49489a,'id'));_0x3d1c9e[_0x03ef('0x2d')](_0x03ef('0x6d'),_['map'](_0x49489a,'id'));}});}})[_0x03ef('0x16')](function(){if(_0x41d7d7[_0x03ef('0x67')][_0x03ef('0x68')]===_0x03ef('0x69')&&!_0x113f9b&&!_0x41d7d7[_0x03ef('0x26')][_0x03ef('0x52')])return[];return db[_0x03ef('0x6e')][_0x03ef('0x26')](_0x111935[_0x03ef('0x6f')](),_0x30fe3b);})[_0x03ef('0x16')](function(_0x4e1c69){_0x5c1a36[_0x03ef('0x12')]=_0x4e1c69[_0x03ef('0x1d')];if(_0x5c1a36[_0x03ef('0x12')]===0x0)return[];return db[_0x03ef('0x6e')][_0x03ef('0x26')](_0x4e8b4c[_0x03ef('0x6f')](),_0x30fe3b)[_0x03ef('0x16')](function(_0x30f2f0){_0x24f1c1=_[_0x03ef('0x70')](_0x30f2f0,'id');_0x30fe3b=_[_0x03ef('0x71')](_0x30fe3b,{'model':db[_0x03ef('0x1b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41d7d7[_0x03ef('0x26')]['fields']){_0x11073e[_0x03ef('0x2a')][_0x03ef('0x45')](function(_0x1cdbd5){_0x3d1c9e[_0x03ef('0x30')]('c.'+_0x1cdbd5);});}else{_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x63'));_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x72'));_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x73'));_0x3d1c9e['field'](_0x03ef('0x74'));_0x3d1c9e[_0x03ef('0x30')]('c.mobile');_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x75'));_0x3d1c9e[_0x03ef('0x30')]('c.email');_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x76'));_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x77'));_0x3d1c9e[_0x03ef('0x30')]('c.deletedAt');_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x78'));_0x3d1c9e[_0x03ef('0x30')](_0x03ef('0x79'),_0x03ef('0x7a'));}if(_0x11073e[_0x03ef('0x11')])_0x3d1c9e[_0x03ef('0x11')](_0x11073e['limit']);if(_0x11073e[_0x03ef('0x13')])_0x3d1c9e[_0x03ef('0x13')](_0x11073e['offset']);return db['sequelize'][_0x03ef('0x26')](_0x3d1c9e[_0x03ef('0x6f')](),_0x30fe3b);});})['then'](function(_0x5a0e20){_0x5a0e20[_0x03ef('0x45')](function(_0x7d275f){if(_0x7d275f[_0x03ef('0x7a')]){_0x7d275f[_0x03ef('0x7b')]=[];_0x7d275f[_0x03ef('0x7a')][_0x03ef('0x43')](',')[_0x03ef('0x45')](function(_0x39b84e){_0x7d275f['Tags']['push'](_0x24f1c1[_0x39b84e]);});}delete _0x7d275f[_0x03ef('0x7a')];});_0x5c1a36[_0x03ef('0x7c')]=_0x5a0e20;return _0x5c1a36;})[_0x03ef('0x16')](respondWithFilteredResult(_0x5d56e1,_0x11073e));})['catch'](handleError(_0x5d56e1,null));};exports[_0x03ef('0x7d')]=function(_0x38838e,_0x2f0e72){return db['CmContact'][_0x03ef('0x41')]({'where':{'id':_0x38838e['params']['id']}})[_0x03ef('0x16')](handleEntityNotFound(_0x2f0e72,null))[_0x03ef('0x16')](removeEntity(_0x2f0e72,null))['catch'](handleError(_0x2f0e72,null));};exports[_0x03ef('0x1c')]=function(_0x5d8f2d,_0x1dc93c){return db[_0x03ef('0x1b')][_0x03ef('0x1c')]()[_0x03ef('0x16')](function(_0x4f7dd5){delete _0x4f7dd5[_0x03ef('0x7e')];for(var _0x49a584=0x0;_0x49a584{}\s\\|]/g,'-');_0x5c53dd(null,util[_0x6874('0x21')](_0x6874('0x22'),path[_0x6874('0x23')](_0x25d51d[_0x6874('0x1f')],path[_0x6874('0x24')](_0x25d51d[_0x6874('0x1f')])),Date[_0x6874('0x25')](),path[_0x6874('0x24')](_0x25d51d[_0x6874('0x1f')])));}})});router['post']('/csv',upload[_0x6874('0x26')](_0x6874('0x27')),controller[_0x6874('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a7cf1,_0x412fb0,_0x45d530){_0x45d530(null,path[_0x6874('0x1c')](config[_0x6874('0x1d')],_0x6874('0x1e')));},'filename':function(_0x12c0ce,_0x43a8e0,_0x4fb547){_0x43a8e0[_0x6874('0x1f')]=_0x43a8e0[_0x6874('0x1f')][_0x6874('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4fb547(null,util[_0x6874('0x21')]('%s-%s%s',path['basename'](_0x43a8e0['originalname'],path[_0x6874('0x24')](_0x43a8e0[_0x6874('0x1f')])),Date['now'](),path[_0x6874('0x24')](_0x43a8e0[_0x6874('0x1f')])));}})});router[_0x6874('0x16')](_0x6874('0x29'),upload['single'](_0x6874('0x27')),controller[_0x6874('0x2a')]);router['post'](_0x6874('0x2b'),auth[_0x6874('0x8')](),controller['import']);router['put']('/:id',auth[_0x6874('0x8')](),controller[_0x6874('0x2c')]);router[_0x6874('0x2d')]('/:id',auth[_0x6874('0x8')](),controller[_0x6874('0x2e')]);module[_0x6874('0x2f')]=router; \ No newline at end of file +var _0x2b1a=['basename','extname','/csv','single','file','uploadCsv','root','server/files/tmp','replace','now','/upload','upload','import','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','merge','/create_many','diskStorage','join','originalname','format','%s-%s%s'];(function(_0xb98937,_0x5c2fec){var _0x6c1af7=function(_0x5c33f0){while(--_0x5c33f0){_0xb98937['push'](_0xb98937['shift']());}};_0x6c1af7(++_0x5c2fec);}(_0x2b1a,0x1aa));var _0xa2b1=function(_0x492a56,_0x58b962){_0x492a56=_0x492a56-0x0;var _0x32f77b=_0x2b1a[_0x492a56];return _0x32f77b;};'use strict';var multer=require('multer');var util=require(_0xa2b1('0x0'));var path=require(_0xa2b1('0x1'));var timeout=require(_0xa2b1('0x2'));var express=require(_0xa2b1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2b1('0x4'));var config=require(_0xa2b1('0x5'));var controller=require(_0xa2b1('0x6'));router[_0xa2b1('0x7')]('/',auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x9')]);router[_0xa2b1('0x7')](_0xa2b1('0xa'),auth[_0xa2b1('0x8')](),controller['describe']);router['get'](_0xa2b1('0xb'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0xc')]);router[_0xa2b1('0x7')](_0xa2b1('0xd'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0xe')]);router[_0xa2b1('0x7')](_0xa2b1('0xf'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x10')]);router[_0xa2b1('0x7')](_0xa2b1('0x11'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x12')]);router[_0xa2b1('0x7')](_0xa2b1('0x13'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x14')]);router['get'](_0xa2b1('0x15'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x16')]);router[_0xa2b1('0x7')](_0xa2b1('0x17'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x18')]);router[_0xa2b1('0x19')]('/merge',auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x1a')]);router[_0xa2b1('0x19')]('/',auth[_0xa2b1('0x8')](),controller['create']);router[_0xa2b1('0x19')](_0xa2b1('0x1b'),auth[_0xa2b1('0x8')](),controller['bulkCreate']);router['post'](_0xa2b1('0xd'),auth[_0xa2b1('0x8')](),controller['setTags']);var upload=multer({'storage':multer[_0xa2b1('0x1c')]({'destination':function(_0x1890b3,_0x5922f9,_0x40c732){_0x40c732(null,path[_0xa2b1('0x1d')](config['root'],'server/files/tmp'));},'filename':function(_0x4c9db3,_0xbffd58,_0x2e9d8f){_0xbffd58[_0xa2b1('0x1e')]=_0xbffd58[_0xa2b1('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e9d8f(null,util[_0xa2b1('0x1f')](_0xa2b1('0x20'),path[_0xa2b1('0x21')](_0xbffd58[_0xa2b1('0x1e')],path[_0xa2b1('0x22')](_0xbffd58[_0xa2b1('0x1e')])),Date['now'](),path[_0xa2b1('0x22')](_0xbffd58[_0xa2b1('0x1e')])));}})});router[_0xa2b1('0x19')](_0xa2b1('0x23'),upload[_0xa2b1('0x24')](_0xa2b1('0x25')),controller[_0xa2b1('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2468e4,_0x550f79,_0x5f4d54){_0x5f4d54(null,path[_0xa2b1('0x1d')](config[_0xa2b1('0x27')],_0xa2b1('0x28')));},'filename':function(_0x20a7a2,_0x5a4069,_0x4ce843){_0x5a4069[_0xa2b1('0x1e')]=_0x5a4069[_0xa2b1('0x1e')][_0xa2b1('0x29')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ce843(null,util['format']('%s-%s%s',path[_0xa2b1('0x21')](_0x5a4069[_0xa2b1('0x1e')],path['extname'](_0x5a4069[_0xa2b1('0x1e')])),Date[_0xa2b1('0x2a')](),path[_0xa2b1('0x22')](_0x5a4069[_0xa2b1('0x1e')])));}})});router[_0xa2b1('0x19')](_0xa2b1('0x2b'),upload[_0xa2b1('0x24')]('file'),controller[_0xa2b1('0x2c')]);router[_0xa2b1('0x19')]('/upload/:id',auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x2d')]);router[_0xa2b1('0x2e')](_0xa2b1('0xb'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x2f')]);router[_0xa2b1('0x30')](_0xa2b1('0xb'),auth[_0xa2b1('0x8')](),controller[_0xa2b1('0x31')]);module[_0xa2b1('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 41f1c24..120540a 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 _0x57da=['STRING','TEXT','getDataValue','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','setDataValue','name'];(function(_0x20ca39,_0x54c173){var _0x542705=function(_0x1f3224){while(--_0x1f3224){_0x20ca39['push'](_0x20ca39['shift']());}};_0x542705(++_0x54c173);}(_0x57da,0x170));var _0xa57d=function(_0x512bdc,_0x2fcdcb){_0x512bdc=_0x512bdc-0x0;var _0x51a7f0=_0x57da[_0x512bdc];return _0x51a7f0;};'use strict';var Sequelize=require(_0xa57d('0x0'));var _=require(_0xa57d('0x1'));module[_0xa57d('0x2')]={'name':{'type':Sequelize[_0xa57d('0x3')],'get':function(_0x4e9157){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4308c0){this[_0xa57d('0x4')]('alias',_0x4308c0?_0x4308c0:this['getDataValue'](_0xa57d('0x5')));}},'type':{'type':Sequelize[_0xa57d('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xa57d('0x7')]('long'),'get':function(){if(this[_0xa57d('0x8')](_0xa57d('0x9'))===_0xa57d('0xa')){return JSON[_0xa57d('0xb')](this[_0xa57d('0x8')](_0xa57d('0xc')));}else{return this['getDataValue']('values');}},'set':function(_0x36ce44){if(Array[_0xa57d('0xd')](_0x36ce44)){this[_0xa57d('0x4')](_0xa57d('0xc'),JSON['stringify'](_0x36ce44));}else{this[_0xa57d('0x4')](_0xa57d('0xc'),_0x36ce44);}}},'required':{'type':Sequelize[_0xa57d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa57d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa57d('0xf')](_0xa57d('0x10'))}}; \ No newline at end of file +var _0x2833=['lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','long','select','values','isArray','stringify','BOOLEAN','sequelize'];(function(_0x46c7fe,_0x2b6b9a){var _0x2cbbf7=function(_0x2efc37){while(--_0x2efc37){_0x46c7fe['push'](_0x46c7fe['shift']());}};_0x2cbbf7(++_0x2b6b9a);}(_0x2833,0x187));var _0x3283=function(_0x566048,_0xa7c107){_0x566048=_0x566048-0x0;var _0x41fb7e=_0x2833[_0x566048];return _0x41fb7e;};'use strict';var Sequelize=require(_0x3283('0x0'));var _=require(_0x3283('0x1'));module[_0x3283('0x2')]={'name':{'type':Sequelize[_0x3283('0x3')],'get':function(_0x462746){return this[_0x3283('0x4')]('alias');}},'alias':{'type':Sequelize[_0x3283('0x5')],'allowNull':![],'set':function(_0x1b8b79){this[_0x3283('0x6')](_0x3283('0x7'),_0x1b8b79?_0x1b8b79:this[_0x3283('0x4')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x3283('0x8')),'get':function(){if(this[_0x3283('0x4')]('type')===_0x3283('0x9')){return JSON['parse'](this['getDataValue'](_0x3283('0xa')));}else{return this[_0x3283('0x4')](_0x3283('0xa'));}},'set':function(_0x5d2e25){if(Array[_0x3283('0xb')](_0x5d2e25)){this['setDataValue'](_0x3283('0xa'),JSON[_0x3283('0xc')](_0x5d2e25));}else{this[_0x3283('0x6')](_0x3283('0xa'),_0x5d2e25);}}},'required':{'type':Sequelize[_0x3283('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9219b04..d5d5813 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 _0x6319=['status','json','offset','undefined','count','set','Content-Range','apply','then','destroy','end','sendStatus','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','find','update','body','sequelize','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','addColumn','format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a0fbc,_0x5917d0){var _0x1df78d=function(_0x5b877a){while(--_0x5b877a){_0x1a0fbc['push'](_0x1a0fbc['shift']());}};_0x1df78d(++_0x5917d0);}(_0x6319,0xdb));var _0x9631=function(_0x41e495,_0x2bf45d){_0x41e495=_0x41e495-0x0;var _0x421aa6=_0x6319[_0x41e495];return _0x421aa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9631('0x0'));var zipdir=require(_0x9631('0x1'));var jsonpatch=require(_0x9631('0x2'));var rp=require('request-promise');var moment=require(_0x9631('0x3'));var BPromise=require(_0x9631('0x4'));var Mustache=require(_0x9631('0x5'));var util=require(_0x9631('0x6'));var path=require('path');var sox=require(_0x9631('0x7'));var csv=require(_0x9631('0x8'));var ejs=require(_0x9631('0x9'));var fs=require('fs');var fs_extra=require(_0x9631('0xa'));var _=require(_0x9631('0xb'));var squel=require('squel');var crypto=require(_0x9631('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9631('0x8'));var querystring=require(_0x9631('0xd'));var Papa=require(_0x9631('0xe'));var Redis=require(_0x9631('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9631('0x10'));var as=require(_0x9631('0x11'));var hardwareService=require(_0x9631('0x12'));var logger=require(_0x9631('0x13'))(_0x9631('0x14'));var utils=require('../../config/utils');var config=require(_0x9631('0x15'));var licenseUtil=require(_0x9631('0x16'));var db=require(_0x9631('0x17'))['db'];function respondWithStatusCode(_0x5354b8,_0x52bc79){_0x52bc79=_0x52bc79||0xcc;return function(_0x57d375){if(_0x57d375){return _0x5354b8['sendStatus'](_0x52bc79);}return _0x5354b8[_0x9631('0x18')](_0x52bc79)['end']();};}function respondWithResult(_0x382ffc,_0x30df22){_0x30df22=_0x30df22||0xc8;return function(_0x584816){if(_0x584816){return _0x382ffc[_0x9631('0x18')](_0x30df22)[_0x9631('0x19')](_0x584816);}};}function respondWithFilteredResult(_0x2a147b,_0x5e7c3e){return function(_0x55027a){if(_0x55027a){var _0x5e6839=typeof _0x5e7c3e[_0x9631('0x1a')]==='undefined'&&typeof _0x5e7c3e['limit']===_0x9631('0x1b');var _0x3aaef9=_0x55027a[_0x9631('0x1c')];var _0x405ed7=_0x5e6839?0x0:_0x5e7c3e['offset'];var _0x3bfa23=_0x5e6839?_0x55027a['count']:_0x5e7c3e['offset']+_0x5e7c3e['limit'];var _0x5e542b;if(_0x3bfa23>=_0x3aaef9){_0x3bfa23=_0x3aaef9;_0x5e542b=0xc8;}else{_0x5e542b=0xce;}_0x2a147b[_0x9631('0x18')](_0x5e542b);return _0x2a147b[_0x9631('0x1d')](_0x9631('0x1e'),_0x405ed7+'-'+_0x3bfa23+'/'+_0x3aaef9)[_0x9631('0x19')](_0x55027a);}return null;};}function patchUpdates(_0x1d89d5){return function(_0xc9cd8){try{jsonpatch[_0x9631('0x1f')](_0xc9cd8,_0x1d89d5,!![]);}catch(_0x5d0723){return BPromise['reject'](_0x5d0723);}return _0xc9cd8['save']();};}function saveUpdates(_0x43cb74,_0x404a45){return function(_0x2c21a8){if(_0x2c21a8){return _0x2c21a8['update'](_0x43cb74)[_0x9631('0x20')](function(_0x1e69fb){return _0x1e69fb;});}return null;};}function removeEntity(_0x59d48a,_0x20ab33){return function(_0x5f3f63){if(_0x5f3f63){return _0x5f3f63[_0x9631('0x21')]()[_0x9631('0x20')](function(){_0x59d48a[_0x9631('0x18')](0xcc)[_0x9631('0x22')]();});}};}function handleEntityNotFound(_0x2d08f4,_0x1e73eb){return function(_0x181954){if(!_0x181954){_0x2d08f4[_0x9631('0x23')](0x194);}return _0x181954;};}function handleError(_0x1e213c,_0x4bfe67){_0x4bfe67=_0x4bfe67||0x1f4;return function(_0x5d3553){logger[_0x9631('0x24')](_0x5d3553[_0x9631('0x25')]);if(_0x5d3553[_0x9631('0x26')]){delete _0x5d3553['name'];}_0x1e213c[_0x9631('0x18')](_0x4bfe67)[_0x9631('0x27')](_0x5d3553);};}exports[_0x9631('0x28')]=function(_0x2b5f62,_0x2ebac6){var _0x58131b={},_0x4a8b8d={},_0xf43d88={'count':0x0,'rows':[]};var _0xe32506=_['map'](db[_0x9631('0x29')][_0x9631('0x2a')],function(_0x2402dc){return{'name':_0x2402dc[_0x9631('0x2b')],'type':_0x2402dc[_0x9631('0x2c')]['key']};});_0x4a8b8d[_0x9631('0x2d')]=_['differenceBy'](_[_0x9631('0x2e')](_0xe32506,_0x9631('0x26')),['name']);_0x4a8b8d['query']=_[_0x9631('0x2f')](_0x2b5f62[_0x9631('0x30')]);_0x4a8b8d[_0x9631('0x31')]=_[_0x9631('0x32')](_0x4a8b8d[_0x9631('0x2d')],_0x4a8b8d[_0x9631('0x30')]);_0x58131b[_0x9631('0x33')]=_[_0x9631('0x32')](_0x4a8b8d['model'],qs[_0x9631('0x34')](_0x2b5f62[_0x9631('0x30')][_0x9631('0x34')]));_0x58131b[_0x9631('0x33')]=_0x58131b[_0x9631('0x33')]['length']?_0x58131b[_0x9631('0x33')]:_0x4a8b8d['model'];if(!_0x2b5f62[_0x9631('0x30')]['hasOwnProperty'](_0x9631('0x35'))){_0x58131b[_0x9631('0x36')]=qs[_0x9631('0x36')](_0x2b5f62['query']['limit']);_0x58131b[_0x9631('0x1a')]=qs[_0x9631('0x1a')](_0x2b5f62[_0x9631('0x30')][_0x9631('0x1a')]);}_0x58131b[_0x9631('0x37')]=qs['sort'](_0x2b5f62[_0x9631('0x30')][_0x9631('0x38')]);_0x58131b[_0x9631('0x39')]=qs['filters'](_['pick'](_0x2b5f62[_0x9631('0x30')],_0x4a8b8d[_0x9631('0x31')]),_0xe32506);if(_0x2b5f62[_0x9631('0x30')][_0x9631('0x3a')]){_0x58131b[_0x9631('0x39')]=_[_0x9631('0x3b')](_0x58131b['where'],{'$or':_[_0x9631('0x2e')](_0xe32506,function(_0xebff8e){if(_0xebff8e[_0x9631('0x2c')]!=='VIRTUAL'){var _0x3add0c={};_0x3add0c[_0xebff8e[_0x9631('0x26')]]={'$like':'%'+_0x2b5f62[_0x9631('0x30')][_0x9631('0x3a')]+'%'};return _0x3add0c;}})});}_0x58131b=_['merge']({},_0x58131b,_0x2b5f62[_0x9631('0x3c')]);var _0x5515a1={'where':_0x58131b[_0x9631('0x39')]};return db['CmCustomField'][_0x9631('0x1c')](_0x5515a1)[_0x9631('0x20')](function(_0x5452b1){_0xf43d88[_0x9631('0x1c')]=_0x5452b1;if(_0x2b5f62[_0x9631('0x30')][_0x9631('0x3d')]){_0x58131b[_0x9631('0x3e')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x58131b);})[_0x9631('0x20')](function(_0x107278){_0xf43d88[_0x9631('0x3f')]=_0x107278;return _0xf43d88;})[_0x9631('0x20')](respondWithFilteredResult(_0x2ebac6,_0x58131b))[_0x9631('0x40')](handleError(_0x2ebac6,null));};exports[_0x9631('0x41')]=function(_0x5f4646,_0x185b6a){var _0x2f8ab9={'raw':!![],'where':{'id':_0x5f4646[_0x9631('0x42')]['id']}},_0x473aba={};_0x473aba[_0x9631('0x2d')]=_[_0x9631('0x2f')](db[_0x9631('0x29')][_0x9631('0x2a')]);_0x473aba[_0x9631('0x30')]=_['keys'](_0x5f4646[_0x9631('0x30')]);_0x473aba[_0x9631('0x31')]=_[_0x9631('0x32')](_0x473aba[_0x9631('0x2d')],_0x473aba['query']);_0x2f8ab9[_0x9631('0x33')]=_['intersection'](_0x473aba[_0x9631('0x2d')],qs['fields'](_0x5f4646[_0x9631('0x30')][_0x9631('0x34')]));_0x2f8ab9['attributes']=_0x2f8ab9[_0x9631('0x33')]['length']?_0x2f8ab9[_0x9631('0x33')]:_0x473aba['model'];if(_0x5f4646[_0x9631('0x30')][_0x9631('0x3d')]){_0x2f8ab9[_0x9631('0x3e')]=[{'all':!![]}];}_0x2f8ab9=_[_0x9631('0x3b')]({},_0x2f8ab9,_0x5f4646[_0x9631('0x3c')]);return db[_0x9631('0x29')][_0x9631('0x43')](_0x2f8ab9)[_0x9631('0x20')](handleEntityNotFound(_0x185b6a,null))['then'](respondWithResult(_0x185b6a,null))[_0x9631('0x40')](handleError(_0x185b6a,null));};exports[_0x9631('0x44')]=function(_0x4bc86e,_0x10a613){if(_0x4bc86e['body']['id']){delete _0x4bc86e[_0x9631('0x45')]['id'];}return db[_0x9631('0x29')][_0x9631('0x43')]({'where':{'id':_0x4bc86e['params']['id']}})[_0x9631('0x20')](handleEntityNotFound(_0x10a613,null))['then'](saveUpdates(_0x4bc86e[_0x9631('0x45')],null))[_0x9631('0x20')](respondWithResult(_0x10a613,null))['catch'](handleError(_0x10a613,null));};exports[_0x9631('0x21')]=function(_0x282ede,_0xec572a){return db['CmCustomField'][_0x9631('0x43')]({'where':{'id':_0x282ede[_0x9631('0x42')]['id']}})['then'](handleEntityNotFound(_0xec572a,null))[_0x9631('0x20')](removeEntity(_0xec572a,null))[_0x9631('0x40')](handleError(_0xec572a,null));};exports['create']=function(_0x19ac0d,_0x55caaa){var _0x42696e;return db[_0x9631('0x46')][_0x9631('0x47')](function(_0x260738){return db[_0x9631('0x29')][_0x9631('0x48')](_0x19ac0d['body'],{'transaction':_0x260738})[_0x9631('0x20')](function(_0x7bcb6b){_0x42696e=_0x7bcb6b;var _0x37b06d={'type':db[_0x9631('0x49')][_0x9631('0x4a')],'transaction':_0x260738};switch(_0x19ac0d[_0x9631('0x45')][_0x9631('0x2c')]){case _0x9631('0x4b'):_0x37b06d[_0x9631('0x2c')]=db[_0x9631('0x49')][_0x9631('0x4a')];break;case _0x9631('0x4c'):_0x37b06d[_0x9631('0x2c')]=db[_0x9631('0x49')][_0x9631('0x4d')];break;case _0x9631('0x4e'):_0x37b06d['type']=db[_0x9631('0x49')]['BOOLEAN'];_0x37b06d['defaultValue']=![];break;default:}return db[_0x9631('0x46')]['queryInterface'][_0x9631('0x4f')]('cm_contacts',util[_0x9631('0x50')]('cf_%d',_0x42696e['id']),_0x37b06d);})[_0x9631('0x20')](function(){return _0x42696e;});})['then'](respondWithResult(_0x55caaa,0xc9))[_0x9631('0x40')](handleError(_0x55caaa,null));}; \ No newline at end of file +var _0xea98=['queryInterface','addColumn','cm_contacts','format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','params','find','body','transaction','create','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize'];(function(_0x4827b3,_0x375541){var _0x1050df=function(_0x332def){while(--_0x332def){_0x4827b3['push'](_0x4827b3['shift']());}};_0x1050df(++_0x375541);}(_0xea98,0x1c6));var _0x8ea9=function(_0x4b87e2,_0x58dec0){_0x4b87e2=_0x4b87e2-0x0;var _0x5911b6=_0xea98[_0x4b87e2];return _0x5911b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ea9('0x0'));var zipdir=require(_0x8ea9('0x1'));var jsonpatch=require(_0x8ea9('0x2'));var rp=require(_0x8ea9('0x3'));var moment=require('moment');var BPromise=require(_0x8ea9('0x4'));var Mustache=require(_0x8ea9('0x5'));var util=require(_0x8ea9('0x6'));var path=require(_0x8ea9('0x7'));var sox=require('sox');var csv=require(_0x8ea9('0x8'));var ejs=require(_0x8ea9('0x9'));var fs=require('fs');var fs_extra=require(_0x8ea9('0xa'));var _=require(_0x8ea9('0xb'));var squel=require('squel');var crypto=require(_0x8ea9('0xc'));var jsforce=require(_0x8ea9('0xd'));var deskjs=require(_0x8ea9('0xe'));var toCsv=require(_0x8ea9('0x8'));var querystring=require(_0x8ea9('0xf'));var Papa=require(_0x8ea9('0x10'));var Redis=require(_0x8ea9('0x11'));var authService=require(_0x8ea9('0x12'));var qs=require(_0x8ea9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ea9('0x14'));var logger=require(_0x8ea9('0x15'))(_0x8ea9('0x16'));var utils=require(_0x8ea9('0x17'));var config=require(_0x8ea9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ea9('0x19'))['db'];function respondWithStatusCode(_0x3c5d29,_0x72d165){_0x72d165=_0x72d165||0xcc;return function(_0x4041e0){if(_0x4041e0){return _0x3c5d29[_0x8ea9('0x1a')](_0x72d165);}return _0x3c5d29[_0x8ea9('0x1b')](_0x72d165)[_0x8ea9('0x1c')]();};}function respondWithResult(_0x13f659,_0x46bccb){_0x46bccb=_0x46bccb||0xc8;return function(_0x1bd43a){if(_0x1bd43a){return _0x13f659['status'](_0x46bccb)[_0x8ea9('0x1d')](_0x1bd43a);}};}function respondWithFilteredResult(_0x44eaa1,_0x532e2f){return function(_0x56632a){if(_0x56632a){var _0x3399cc=typeof _0x532e2f[_0x8ea9('0x1e')]===_0x8ea9('0x1f')&&typeof _0x532e2f['limit']==='undefined';var _0x5d57f9=_0x56632a['count'];var _0x4df92d=_0x3399cc?0x0:_0x532e2f[_0x8ea9('0x1e')];var _0xb873d0=_0x3399cc?_0x56632a[_0x8ea9('0x20')]:_0x532e2f[_0x8ea9('0x1e')]+_0x532e2f[_0x8ea9('0x21')];var _0x2a46c;if(_0xb873d0>=_0x5d57f9){_0xb873d0=_0x5d57f9;_0x2a46c=0xc8;}else{_0x2a46c=0xce;}_0x44eaa1['status'](_0x2a46c);return _0x44eaa1['set']('Content-Range',_0x4df92d+'-'+_0xb873d0+'/'+_0x5d57f9)[_0x8ea9('0x1d')](_0x56632a);}return null;};}function patchUpdates(_0x40f9f7){return function(_0x2651ac){try{jsonpatch[_0x8ea9('0x22')](_0x2651ac,_0x40f9f7,!![]);}catch(_0x56baa6){return BPromise[_0x8ea9('0x23')](_0x56baa6);}return _0x2651ac[_0x8ea9('0x24')]();};}function saveUpdates(_0x5bc36f,_0x19fe61){return function(_0x1a107c){if(_0x1a107c){return _0x1a107c[_0x8ea9('0x25')](_0x5bc36f)[_0x8ea9('0x26')](function(_0x43b193){return _0x43b193;});}return null;};}function removeEntity(_0x11fa65,_0xd9abdf){return function(_0x10fe46){if(_0x10fe46){return _0x10fe46[_0x8ea9('0x27')]()[_0x8ea9('0x26')](function(){_0x11fa65[_0x8ea9('0x1b')](0xcc)[_0x8ea9('0x1c')]();});}};}function handleEntityNotFound(_0x3b9f2d,_0x16a176){return function(_0x49741d){if(!_0x49741d){_0x3b9f2d[_0x8ea9('0x1a')](0x194);}return _0x49741d;};}function handleError(_0x573809,_0x2267f9){_0x2267f9=_0x2267f9||0x1f4;return function(_0x51292b){logger[_0x8ea9('0x28')](_0x51292b[_0x8ea9('0x29')]);if(_0x51292b['name']){delete _0x51292b[_0x8ea9('0x2a')];}_0x573809[_0x8ea9('0x1b')](_0x2267f9)[_0x8ea9('0x2b')](_0x51292b);};}exports[_0x8ea9('0x2c')]=function(_0x486693,_0x4e2389){var _0x49cc39={},_0x5979b2={},_0x552022={'count':0x0,'rows':[]};var _0x38fc4e=_[_0x8ea9('0x2d')](db[_0x8ea9('0x2e')][_0x8ea9('0x2f')],function(_0x4d42d1){return{'name':_0x4d42d1[_0x8ea9('0x30')],'type':_0x4d42d1[_0x8ea9('0x31')]['key']};});_0x5979b2[_0x8ea9('0x32')]=_[_0x8ea9('0x33')](_[_0x8ea9('0x2d')](_0x38fc4e,_0x8ea9('0x2a')),[_0x8ea9('0x2a')]);_0x5979b2['query']=_[_0x8ea9('0x34')](_0x486693['query']);_0x5979b2[_0x8ea9('0x35')]=_[_0x8ea9('0x36')](_0x5979b2[_0x8ea9('0x32')],_0x5979b2[_0x8ea9('0x37')]);_0x49cc39[_0x8ea9('0x38')]=_[_0x8ea9('0x36')](_0x5979b2[_0x8ea9('0x32')],qs[_0x8ea9('0x39')](_0x486693[_0x8ea9('0x37')][_0x8ea9('0x39')]));_0x49cc39['attributes']=_0x49cc39['attributes'][_0x8ea9('0x3a')]?_0x49cc39[_0x8ea9('0x38')]:_0x5979b2[_0x8ea9('0x32')];if(!_0x486693[_0x8ea9('0x37')][_0x8ea9('0x3b')](_0x8ea9('0x3c'))){_0x49cc39[_0x8ea9('0x21')]=qs[_0x8ea9('0x21')](_0x486693['query'][_0x8ea9('0x21')]);_0x49cc39[_0x8ea9('0x1e')]=qs[_0x8ea9('0x1e')](_0x486693['query'][_0x8ea9('0x1e')]);}_0x49cc39[_0x8ea9('0x3d')]=qs[_0x8ea9('0x3e')](_0x486693[_0x8ea9('0x37')][_0x8ea9('0x3e')]);_0x49cc39[_0x8ea9('0x3f')]=qs[_0x8ea9('0x35')](_[_0x8ea9('0x40')](_0x486693[_0x8ea9('0x37')],_0x5979b2[_0x8ea9('0x35')]),_0x38fc4e);if(_0x486693[_0x8ea9('0x37')]['filter']){_0x49cc39[_0x8ea9('0x3f')]=_[_0x8ea9('0x41')](_0x49cc39[_0x8ea9('0x3f')],{'$or':_[_0x8ea9('0x2d')](_0x38fc4e,function(_0x3a7409){if(_0x3a7409[_0x8ea9('0x31')]!=='VIRTUAL'){var _0x2dc458={};_0x2dc458[_0x3a7409['name']]={'$like':'%'+_0x486693[_0x8ea9('0x37')]['filter']+'%'};return _0x2dc458;}})});}_0x49cc39=_[_0x8ea9('0x41')]({},_0x49cc39,_0x486693[_0x8ea9('0x42')]);var _0x2fad95={'where':_0x49cc39['where']};return db[_0x8ea9('0x2e')][_0x8ea9('0x20')](_0x2fad95)[_0x8ea9('0x26')](function(_0x148608){_0x552022[_0x8ea9('0x20')]=_0x148608;if(_0x486693[_0x8ea9('0x37')][_0x8ea9('0x43')]){_0x49cc39[_0x8ea9('0x44')]=[{'all':!![]}];}return db[_0x8ea9('0x2e')][_0x8ea9('0x45')](_0x49cc39);})[_0x8ea9('0x26')](function(_0x6e8e86){_0x552022['rows']=_0x6e8e86;return _0x552022;})['then'](respondWithFilteredResult(_0x4e2389,_0x49cc39))[_0x8ea9('0x46')](handleError(_0x4e2389,null));};exports[_0x8ea9('0x47')]=function(_0xfdfcd6,_0x502e23){var _0x12e81b={'raw':!![],'where':{'id':_0xfdfcd6[_0x8ea9('0x48')]['id']}},_0x347fee={};_0x347fee['model']=_['keys'](db['CmCustomField'][_0x8ea9('0x2f')]);_0x347fee['query']=_['keys'](_0xfdfcd6['query']);_0x347fee[_0x8ea9('0x35')]=_[_0x8ea9('0x36')](_0x347fee['model'],_0x347fee[_0x8ea9('0x37')]);_0x12e81b[_0x8ea9('0x38')]=_[_0x8ea9('0x36')](_0x347fee[_0x8ea9('0x32')],qs[_0x8ea9('0x39')](_0xfdfcd6[_0x8ea9('0x37')][_0x8ea9('0x39')]));_0x12e81b['attributes']=_0x12e81b['attributes'][_0x8ea9('0x3a')]?_0x12e81b[_0x8ea9('0x38')]:_0x347fee[_0x8ea9('0x32')];if(_0xfdfcd6[_0x8ea9('0x37')][_0x8ea9('0x43')]){_0x12e81b[_0x8ea9('0x44')]=[{'all':!![]}];}_0x12e81b=_[_0x8ea9('0x41')]({},_0x12e81b,_0xfdfcd6[_0x8ea9('0x42')]);return db['CmCustomField'][_0x8ea9('0x49')](_0x12e81b)[_0x8ea9('0x26')](handleEntityNotFound(_0x502e23,null))['then'](respondWithResult(_0x502e23,null))[_0x8ea9('0x46')](handleError(_0x502e23,null));};exports[_0x8ea9('0x25')]=function(_0x3d4223,_0x14750d){if(_0x3d4223['body']['id']){delete _0x3d4223[_0x8ea9('0x4a')]['id'];}return db[_0x8ea9('0x2e')][_0x8ea9('0x49')]({'where':{'id':_0x3d4223['params']['id']}})[_0x8ea9('0x26')](handleEntityNotFound(_0x14750d,null))['then'](saveUpdates(_0x3d4223[_0x8ea9('0x4a')],null))[_0x8ea9('0x26')](respondWithResult(_0x14750d,null))[_0x8ea9('0x46')](handleError(_0x14750d,null));};exports[_0x8ea9('0x27')]=function(_0x370d1e,_0x599ad7){return db[_0x8ea9('0x2e')][_0x8ea9('0x49')]({'where':{'id':_0x370d1e['params']['id']}})[_0x8ea9('0x26')](handleEntityNotFound(_0x599ad7,null))[_0x8ea9('0x26')](removeEntity(_0x599ad7,null))[_0x8ea9('0x46')](handleError(_0x599ad7,null));};exports['create']=function(_0x1bb226,_0x14a977){var _0x3237e7;return db['sequelize'][_0x8ea9('0x4b')](function(_0x15f503){return db[_0x8ea9('0x2e')][_0x8ea9('0x4c')](_0x1bb226[_0x8ea9('0x4a')],{'transaction':_0x15f503})[_0x8ea9('0x26')](function(_0xe0265){_0x3237e7=_0xe0265;var _0x278fd2={'type':db['Sequelize'][_0x8ea9('0x4d')],'transaction':_0x15f503};switch(_0x1bb226[_0x8ea9('0x4a')]['type']){case _0x8ea9('0x4e'):_0x278fd2[_0x8ea9('0x31')]=db[_0x8ea9('0x4f')]['TEXT'];break;case _0x8ea9('0x50'):_0x278fd2['type']=db['Sequelize'][_0x8ea9('0x51')];break;case _0x8ea9('0x52'):_0x278fd2[_0x8ea9('0x31')]=db[_0x8ea9('0x4f')][_0x8ea9('0x53')];_0x278fd2[_0x8ea9('0x54')]=![];break;default:}return db[_0x8ea9('0x55')][_0x8ea9('0x56')][_0x8ea9('0x57')](_0x8ea9('0x58'),util[_0x8ea9('0x59')]('cf_%d',_0x3237e7['id']),_0x278fd2);})[_0x8ea9('0x26')](function(){return _0x3237e7;});})[_0x8ea9('0x26')](respondWithResult(_0x14a977,0xc9))[_0x8ea9('0x46')](handleError(_0x14a977,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d77f76d..131bb1e 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 _0xb911=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','api','request-promise','path'];(function(_0x288ada,_0xf7d134){var _0x58250d=function(_0x225255){while(--_0x225255){_0x288ada['push'](_0x288ada['shift']());}};_0x58250d(++_0xf7d134);}(_0xb911,0x17c));var _0x1b91=function(_0x3dffb5,_0x1964ac){_0x3dffb5=_0x3dffb5-0x0;var _0x252404=_0xb911[_0x3dffb5];return _0x252404;};'use strict';var _=require(_0x1b91('0x0'));var util=require(_0x1b91('0x1'));var logger=require('../../config/logger')(_0x1b91('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1b91('0x3'));var fs=require('fs');var path=require(_0x1b91('0x4'));var rimraf=require(_0x1b91('0x5'));var config=require(_0x1b91('0x6'));var attributes=require(_0x1b91('0x7'));module[_0x1b91('0x8')]=function(_0x1c3256,_0x4cb287){return _0x1c3256[_0x1b91('0x9')]('CmCustomField',attributes,{'tableName':_0x1b91('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61da=['define','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x56a594,_0x2698c1){var _0x4c9acf=function(_0x41a443){while(--_0x41a443){_0x56a594['push'](_0x56a594['shift']());}};_0x4c9acf(++_0x2698c1);}(_0x61da,0x16a));var _0xa61d=function(_0x585daa,_0x425bdd){_0x585daa=_0x585daa-0x0;var _0x1f1e8a=_0x61da[_0x585daa];return _0x1f1e8a;};'use strict';var _=require(_0xa61d('0x0'));var util=require(_0xa61d('0x1'));var logger=require(_0xa61d('0x2'))(_0xa61d('0x3'));var moment=require(_0xa61d('0x4'));var BPromise=require(_0xa61d('0x5'));var rp=require(_0xa61d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa61d('0x7'));var config=require(_0xa61d('0x8'));var attributes=require(_0xa61d('0x9'));module['exports']=function(_0x427499,_0x3aee1a){return _0x427499[_0xa61d('0xa')](_0xa61d('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index e8b2b3f..95d75f7 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 _0x045b=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8a217e,_0x450bfc){var _0x3fc350=function(_0x55ed99){while(--_0x55ed99){_0x8a217e['push'](_0x8a217e['shift']());}};_0x3fc350(++_0x450bfc);}(_0x045b,0x17e));var _0xb045=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0x045b[_0x2ed7d1];return _0x38ae3c;};'use strict';var _=require(_0xb045('0x0'));var util=require(_0xb045('0x1'));var moment=require(_0xb045('0x2'));var BPromise=require(_0xb045('0x3'));var rs=require(_0xb045('0x4'));var fs=require('fs');var Redis=require(_0xb045('0x5'));var db=require(_0xb045('0x6'))['db'];var utils=require(_0xb045('0x7'));var logger=require(_0xb045('0x8'))(_0xb045('0x9'));var config=require(_0xb045('0xa'));var jayson=require(_0xb045('0xb'));var client=jayson[_0xb045('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3029b5,_0x5dc744,_0xf96808){return new BPromise(function(_0x2fac45,_0x19d24a){return client['request'](_0x3029b5,_0xf96808)[_0xb045('0xd')](function(_0x12f124){logger[_0xb045('0xe')](_0xb045('0xf'),_0x5dc744,_0xb045('0x10'));logger[_0xb045('0x11')](_0xb045('0x12'),_0x5dc744,_0xb045('0x10'),JSON[_0xb045('0x13')](_0x12f124));if(_0x12f124[_0xb045('0x14')]){if(_0x12f124[_0xb045('0x14')][_0xb045('0x15')]===0x1f4){logger[_0xb045('0x14')](_0xb045('0xf'),_0x5dc744,_0x12f124[_0xb045('0x14')][_0xb045('0x16')]);return _0x19d24a(_0x12f124['error'][_0xb045('0x16')]);}logger[_0xb045('0x14')](_0xb045('0xf'),_0x5dc744,_0x12f124[_0xb045('0x14')]['message']);return _0x2fac45(_0x12f124['error'][_0xb045('0x16')]);}else{logger['info'](_0xb045('0xf'),_0x5dc744,_0xb045('0x10'));_0x2fac45(_0x12f124[_0xb045('0x17')][_0xb045('0x16')]);}})[_0xb045('0x18')](function(_0x2820bc){logger[_0xb045('0x14')](_0xb045('0xf'),_0x5dc744,_0x2820bc);_0x19d24a(_0x2820bc);});});} \ No newline at end of file +var _0x9117=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x26acf9,_0x16c720){var _0x57c983=function(_0xea0219){while(--_0xea0219){_0x26acf9['push'](_0x26acf9['shift']());}};_0x57c983(++_0x16c720);}(_0x9117,0x118));var _0x7911=function(_0x4c5f45,_0x629730){_0x4c5f45=_0x4c5f45-0x0;var _0x2e2824=_0x9117[_0x4c5f45];return _0x2e2824;};'use strict';var _=require(_0x7911('0x0'));var util=require(_0x7911('0x1'));var moment=require(_0x7911('0x2'));var BPromise=require(_0x7911('0x3'));var rs=require(_0x7911('0x4'));var fs=require('fs');var Redis=require(_0x7911('0x5'));var db=require(_0x7911('0x6'))['db'];var utils=require(_0x7911('0x7'));var logger=require(_0x7911('0x8'))(_0x7911('0x9'));var config=require(_0x7911('0xa'));var jayson=require(_0x7911('0xb'));var client=jayson[_0x7911('0xc')][_0x7911('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x163589,_0x5a5d78,_0x3ef752){return new BPromise(function(_0x1d74f3,_0x243f0f){return client[_0x7911('0xe')](_0x163589,_0x3ef752)[_0x7911('0xf')](function(_0x524273){logger[_0x7911('0x10')](_0x7911('0x11'),_0x5a5d78,_0x7911('0x12'));logger['debug'](_0x7911('0x13'),_0x5a5d78,_0x7911('0x12'),JSON['stringify'](_0x524273));if(_0x524273[_0x7911('0x14')]){if(_0x524273[_0x7911('0x14')][_0x7911('0x15')]===0x1f4){logger['error'](_0x7911('0x11'),_0x5a5d78,_0x524273[_0x7911('0x14')][_0x7911('0x16')]);return _0x243f0f(_0x524273['error'][_0x7911('0x16')]);}logger[_0x7911('0x14')](_0x7911('0x11'),_0x5a5d78,_0x524273[_0x7911('0x14')][_0x7911('0x16')]);return _0x1d74f3(_0x524273['error'][_0x7911('0x16')]);}else{logger[_0x7911('0x10')](_0x7911('0x11'),_0x5a5d78,_0x7911('0x12'));_0x1d74f3(_0x524273[_0x7911('0x17')][_0x7911('0x16')]);}})[_0x7911('0x18')](function(_0x48bd07){logger[_0x7911('0x14')](_0x7911('0x11'),_0x5a5d78,_0x48bd07);_0x243f0f(_0x48bd07);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index b74df6c..4b589b6 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 _0xfa5d=['Router','../../components/interaction/service','./cmCustomField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa5d,0x19e));var _0xdfa5=function(_0x15ce19,_0x5cde84){_0x15ce19=_0x15ce19-0x0;var _0x54e308=_0xfa5d[_0x15ce19];return _0x54e308;};'use strict';var multer=require(_0xdfa5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdfa5('0x1'));var router=express[_0xdfa5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdfa5('0x3'));var config=require('../../config/environment');var controller=require(_0xdfa5('0x4'));router[_0xdfa5('0x5')]('/',auth['isAuthenticated'](),controller[_0xdfa5('0x6')]);router['get'](_0xdfa5('0x7'),auth[_0xdfa5('0x8')](),controller['show']);router[_0xdfa5('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfa5('0xa')]);router[_0xdfa5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdfa5('0xc')]);router[_0xdfa5('0xd')](_0xdfa5('0x7'),auth[_0xdfa5('0x8')](),controller[_0xdfa5('0xe')]);module[_0xdfa5('0xf')]=router; \ No newline at end of file +var _0xeec6=['./cmCustomField.controller','isAuthenticated','index','/:id','show','post','create','put','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36c9fb,_0x307935){var _0x818f0a=function(_0x1f6882){while(--_0x1f6882){_0x36c9fb['push'](_0x36c9fb['shift']());}};_0x818f0a(++_0x307935);}(_0xeec6,0x1c2));var _0x6eec=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0xeec6[_0x22eb96];return _0x5e1adf;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/',auth['isAuthenticated'](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')](_0x6eec('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 39d633a..393ca32 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 _0x7376=['exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x49ae75,_0x5fc190){var _0x5692d5=function(_0x456ec1){while(--_0x456ec1){_0x49ae75['push'](_0x49ae75['shift']());}};_0x5692d5(++_0x5fc190);}(_0x7376,0x111));var _0x6737=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7376[_0x178e48];return _0x440d7e;};'use strict';var moment=require(_0x6737('0x0'));var Sequelize=require(_0x6737('0x1'));module[_0x6737('0x2')]={'phone':{'type':Sequelize[_0x6737('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x6737('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6737('0x5')],'defaultValue':moment()[_0x6737('0x6')](_0x6737('0x7'))},'countbusyretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6737('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6737('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x6737('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6737('0x8')],'unique':_0x6737('0xa')},'ListId':{'type':Sequelize[_0x6737('0x8')],'unique':_0x6737('0xa')},'UserId':{'type':Sequelize[_0x6737('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x6737('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x6737('0x8')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6737('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6df6=['contactListQueue','moment','sequelize','STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x597646,_0x3b7fa5){var _0x3d2ee8=function(_0x8fe622){while(--_0x8fe622){_0x597646['push'](_0x597646['shift']());}};_0x3d2ee8(++_0x3b7fa5);}(_0x6df6,0xa3));var _0x66df=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x6df6[_0x49fcfb];return _0x964926;};'use strict';var moment=require(_0x66df('0x0'));var Sequelize=require(_0x66df('0x1'));module['exports']={'phone':{'type':Sequelize[_0x66df('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x66df('0x3')],'defaultValue':moment()[_0x66df('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x66df('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x66df('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x66df('0x5')](0x2)[_0x66df('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x66df('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x66df('0x8')},'UserId':{'type':Sequelize[_0x66df('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x66df('0x5')],'unique':_0x66df('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x66df('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 2c609c1..18272e3 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 _0x05c6=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','CmHopper','rawAttributes','key','model','query','filters','intersection','concat','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','findAll','catch','show','params','keys','includeAll','options','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','getPreview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','ASC','literal','DESC','priority','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getOpenContacts','getVoiceQueues','outbound','preview','format','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x05c6,0x125));var _0x605c=function(_0x2119e5,_0x439455){_0x2119e5=_0x2119e5-0x0;var _0x321ccb=_0x05c6[_0x2119e5];return _0x321ccb;};'use strict';var emlformat=require(_0x605c('0x0'));var rimraf=require(_0x605c('0x1'));var zipdir=require(_0x605c('0x2'));var jsonpatch=require(_0x605c('0x3'));var rp=require(_0x605c('0x4'));var moment=require(_0x605c('0x5'));var BPromise=require(_0x605c('0x6'));var Mustache=require(_0x605c('0x7'));var util=require(_0x605c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x605c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x605c('0xa'));var _=require(_0x605c('0xb'));var squel=require(_0x605c('0xc'));var crypto=require(_0x605c('0xd'));var jsforce=require(_0x605c('0xe'));var deskjs=require(_0x605c('0xf'));var toCsv=require(_0x605c('0x9'));var querystring=require(_0x605c('0x10'));var Papa=require(_0x605c('0x11'));var Redis=require(_0x605c('0x12'));var authService=require(_0x605c('0x13'));var qs=require(_0x605c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x605c('0x15'));var logger=require(_0x605c('0x16'))('api');var utils=require(_0x605c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x605c('0x18'))['db'];function respondWithStatusCode(_0x32994c,_0x5c64a9){_0x5c64a9=_0x5c64a9||0xcc;return function(_0x31d198){if(_0x31d198){return _0x32994c[_0x605c('0x19')](_0x5c64a9);}return _0x32994c[_0x605c('0x1a')](_0x5c64a9)[_0x605c('0x1b')]();};}function respondWithResult(_0x4ca699,_0x3414c8){_0x3414c8=_0x3414c8||0xc8;return function(_0x4e9761){if(_0x4e9761){return _0x4ca699[_0x605c('0x1a')](_0x3414c8)['json'](_0x4e9761);}};}function respondWithFilteredResult(_0x5e4b3c,_0x1659e2){return function(_0x487986){if(_0x487986){var _0x183dbd=typeof _0x1659e2[_0x605c('0x1c')]==='undefined'&&typeof _0x1659e2[_0x605c('0x1d')]==='undefined';var _0x33af6e=_0x487986[_0x605c('0x1e')];var _0x209aab=_0x183dbd?0x0:_0x1659e2[_0x605c('0x1c')];var _0x5f10ea=_0x183dbd?_0x487986[_0x605c('0x1e')]:_0x1659e2['offset']+_0x1659e2[_0x605c('0x1d')];var _0x3f662a;if(_0x5f10ea>=_0x33af6e){_0x5f10ea=_0x33af6e;_0x3f662a=0xc8;}else{_0x3f662a=0xce;}_0x5e4b3c[_0x605c('0x1a')](_0x3f662a);return _0x5e4b3c[_0x605c('0x1f')](_0x605c('0x20'),_0x209aab+'-'+_0x5f10ea+'/'+_0x33af6e)['json'](_0x487986);}return null;};}function patchUpdates(_0x171c4c){return function(_0x414200){try{jsonpatch[_0x605c('0x21')](_0x414200,_0x171c4c,!![]);}catch(_0x13f9cc){return BPromise[_0x605c('0x22')](_0x13f9cc);}return _0x414200['save']();};}function saveUpdates(_0x579e37,_0x5f401b){return function(_0x2e8674){if(_0x2e8674){return _0x2e8674[_0x605c('0x23')](_0x579e37)['then'](function(_0x494342){return _0x494342;});}return null;};}function removeEntity(_0x5a68d3,_0x4de77e){return function(_0x1ae034){if(_0x1ae034){return _0x1ae034[_0x605c('0x24')]()[_0x605c('0x25')](function(){_0x5a68d3[_0x605c('0x1a')](0xcc)[_0x605c('0x1b')]();});}};}function handleEntityNotFound(_0x5bcd7a,_0x2cf7e0){return function(_0x285f88){if(!_0x285f88){_0x5bcd7a[_0x605c('0x19')](0x194);}return _0x285f88;};}function handleError(_0x538106,_0x4c193e){_0x4c193e=_0x4c193e||0x1f4;return function(_0x904aca){logger[_0x605c('0x26')](_0x904aca[_0x605c('0x27')]);if(_0x904aca[_0x605c('0x28')]){delete _0x904aca[_0x605c('0x28')];}_0x538106[_0x605c('0x1a')](_0x4c193e)[_0x605c('0x29')](_0x904aca);};}exports['index']=function(_0x158fe4,_0x294f25){var _0x1a911d={},_0x167970={},_0xf2197={'count':0x0,'rows':[]};var _0x41fa4c=_[_0x605c('0x2a')](db[_0x605c('0x2b')][_0x605c('0x2c')],function(_0x38ae19){return{'name':_0x38ae19['fieldName'],'type':_0x38ae19['type'][_0x605c('0x2d')]};});_0x167970[_0x605c('0x2e')]=_[_0x605c('0x2a')](_0x41fa4c,_0x605c('0x28'));_0x167970[_0x605c('0x2f')]=_['keys'](_0x158fe4['query']);_0x167970[_0x605c('0x30')]=_[_0x605c('0x31')](_0x167970[_0x605c('0x2e')],_0x167970['query']);_0x167970[_0x605c('0x30')]=_[_0x605c('0x32')](_0x167970['filters'],[_0x605c('0x33'),_0x605c('0x34'),_0x605c('0x35'),'$gte',_0x605c('0x36'),'$lte',_0x605c('0x37'),_0x605c('0x38'),_0x605c('0x39'),_0x605c('0x3a'),_0x605c('0x3b'),_0x605c('0x3c'),_0x605c('0x3d'),'$like',_0x605c('0x3e'),_0x605c('0x3f'),_0x605c('0x40'),_0x605c('0x41'),_0x605c('0x42'),_0x605c('0x43'),_0x605c('0x44'),_0x605c('0x45')]);_0x1a911d['attributes']=_[_0x605c('0x31')](_0x167970[_0x605c('0x2e')],qs[_0x605c('0x46')](_0x158fe4[_0x605c('0x2f')][_0x605c('0x46')]));_0x1a911d[_0x605c('0x47')]=_0x1a911d[_0x605c('0x47')][_0x605c('0x48')]?_0x1a911d['attributes']:_0x167970[_0x605c('0x2e')];if(!_0x158fe4[_0x605c('0x2f')][_0x605c('0x49')](_0x605c('0x4a'))){_0x1a911d['limit']=qs[_0x605c('0x1d')](_0x158fe4[_0x605c('0x2f')]['limit']);_0x1a911d[_0x605c('0x1c')]=qs['offset'](_0x158fe4['query'][_0x605c('0x1c')]);}_0x1a911d[_0x605c('0x4b')]=qs[_0x605c('0x4c')](_0x158fe4[_0x605c('0x2f')][_0x605c('0x4c')]);_0x1a911d[_0x605c('0x4d')]=qs[_0x605c('0x30')](_['pick'](_0x158fe4[_0x605c('0x2f')],_0x167970['filters']),_0x41fa4c);if(_0x158fe4['query'][_0x605c('0x4e')]){_0x1a911d[_0x605c('0x4d')]=_[_0x605c('0x4f')](_0x1a911d[_0x605c('0x4d')],{'$or':_[_0x605c('0x2a')](_0x41fa4c,function(_0x210f0b){if(_0x210f0b['type']!=='VIRTUAL'){var _0x4977f3={};_0x4977f3[_0x210f0b[_0x605c('0x28')]]={'$like':'%'+_0x158fe4[_0x605c('0x2f')][_0x605c('0x4e')]+'%'};return _0x4977f3;}})});}_0x1a911d=_[_0x605c('0x4f')]({},_0x1a911d,_0x158fe4['options']);var _0x5e34a2={'where':_0x1a911d[_0x605c('0x4d')]};return db['CmHopper']['count'](_0x5e34a2)['then'](function(_0xd5ff81){_0xf2197[_0x605c('0x1e')]=_0xd5ff81;if(_0x158fe4[_0x605c('0x2f')]['includeAll']){_0x1a911d['include']=[{'all':!![]}];}return db[_0x605c('0x2b')][_0x605c('0x50')](_0x1a911d);})[_0x605c('0x25')](function(_0x214ab5){_0xf2197['rows']=_0x214ab5;return _0xf2197;})[_0x605c('0x25')](respondWithFilteredResult(_0x294f25,_0x1a911d))[_0x605c('0x51')](handleError(_0x294f25,null));};exports[_0x605c('0x52')]=function(_0x3304bf,_0x47146b){var _0x5423c7={'raw':!![],'where':{'id':_0x3304bf[_0x605c('0x53')]['id']}},_0x1bea4a={};_0x1bea4a[_0x605c('0x2e')]=_[_0x605c('0x54')](db[_0x605c('0x2b')][_0x605c('0x2c')]);_0x1bea4a[_0x605c('0x2f')]=_[_0x605c('0x54')](_0x3304bf[_0x605c('0x2f')]);_0x1bea4a[_0x605c('0x30')]=_['intersection'](_0x1bea4a[_0x605c('0x2e')],_0x1bea4a[_0x605c('0x2f')]);_0x5423c7[_0x605c('0x47')]=_[_0x605c('0x31')](_0x1bea4a[_0x605c('0x2e')],qs[_0x605c('0x46')](_0x3304bf[_0x605c('0x2f')][_0x605c('0x46')]));_0x5423c7[_0x605c('0x47')]=_0x5423c7[_0x605c('0x47')][_0x605c('0x48')]?_0x5423c7['attributes']:_0x1bea4a[_0x605c('0x2e')];if(_0x3304bf[_0x605c('0x2f')][_0x605c('0x55')]){_0x5423c7['include']=[{'all':!![]}];}_0x5423c7=_[_0x605c('0x4f')]({},_0x5423c7,_0x3304bf[_0x605c('0x56')]);return db[_0x605c('0x2b')][_0x605c('0x57')](_0x5423c7)[_0x605c('0x25')](handleEntityNotFound(_0x47146b,null))['then'](respondWithResult(_0x47146b,null))[_0x605c('0x51')](handleError(_0x47146b,null));};exports['create']=function(_0x2cb650,_0x49ee78){return db[_0x605c('0x2b')][_0x605c('0x58')](_0x2cb650[_0x605c('0x59')],{})[_0x605c('0x25')](respondWithResult(_0x49ee78,0xc9))[_0x605c('0x51')](handleError(_0x49ee78,null));};exports[_0x605c('0x23')]=function(_0x3675cc,_0x5174e5){if(_0x3675cc[_0x605c('0x59')]['id']){delete _0x3675cc['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x3675cc[_0x605c('0x53')]['id']}})[_0x605c('0x25')](handleEntityNotFound(_0x5174e5,null))[_0x605c('0x25')](saveUpdates(_0x3675cc[_0x605c('0x59')],null))[_0x605c('0x25')](respondWithResult(_0x5174e5,null))[_0x605c('0x51')](handleError(_0x5174e5,null));};exports[_0x605c('0x5a')]=function(_0x3b6e86,_0x26a386){return db[_0x605c('0x2b')]['describe']()[_0x605c('0x25')](respondWithResult(_0x26a386,null))[_0x605c('0x51')](handleError(_0x26a386,null));};exports['destroy']=function(_0x49b8a1,_0x18a897){var _0xf61e14;return db[_0x605c('0x2b')][_0x605c('0x57')]({'where':{'id':_0x49b8a1[_0x605c('0x53')]['id']}})[_0x605c('0x25')](handleEntityNotFound(_0x18a897,null))['then'](function(_0x14020c){if(_0x14020c){return _0x14020c[_0x605c('0x24')]()[_0x605c('0x25')](function(_0x4c0c3d){return _0x4c0c3d;});}})[_0x605c('0x25')](function(_0x1c6d86){_0xf61e14=_0x1c6d86;if(_0x1c6d86){if(_0x1c6d86['VoiceQueueId']||_0x1c6d86[_0x605c('0x5b')]){return db[_0x1c6d86[_0x605c('0x5c')]?_0x605c('0x5d'):'Campaign'][_0x605c('0x57')]({'where':{'id':_0x1c6d86[_0x605c('0x5c')]?_0x1c6d86[_0x605c('0x5c')]:_0x1c6d86['CampaignId']},'attributes':['id',_0x605c('0x28')],'raw':!![]});}}})[_0x605c('0x25')](function(_0x294124){var _0x25d12d={};if(_0x294124){_[_0x605c('0x4f')](_0x25d12d,_['omit'](_0xf61e14[_0x605c('0x5e')],['createdAt',_0x605c('0x5f'),'id']));_0x25d12d[_0x605c('0x60')]=0x15;_0x25d12d[_0x605c('0x61')]=_0x605c('0x62');_0x25d12d[_0x605c('0x63')]=_0x294124[_0x605c('0x28')];_0x25d12d[_0x605c('0x64')]=_0x49b8a1[_0x605c('0x65')][_0x605c('0x28')];_0x25d12d[_0x605c('0x66')]=_0x49b8a1[_0x605c('0x65')]['id'];_0x25d12d[_0x605c('0x62')]=!![];_0x25d12d[_0x605c('0x67')]=moment()['format'](_0x605c('0x68'));_0x25d12d[_0x605c('0x69')]=_0xf61e14[_0x605c('0x6a')];_0x25d12d[_0x605c('0x6b')]=_0xf61e14[_0x605c('0x5c')]?_0x605c('0x6c'):_0x605c('0x6d');return db[_0x605c('0x6e')][_0x605c('0x57')]({'where':{'id':_0x25d12d[_0x605c('0x6f')]},'attributes':['firstName','lastName']})[_0x605c('0x25')](function(_0x51ae6b){if(!_[_0x605c('0x70')](_0x18a897)&&!_[_0x605c('0x70')](_0x51ae6b[_0x605c('0x71')])){_0x25d12d[_0x605c('0x72')]=_0x51ae6b['firstName'];if(!_[_0x605c('0x70')](_0x51ae6b[_0x605c('0x73')])){_0x25d12d['calleridname']+='\x20'+_0x51ae6b['lastName'];}}})[_0x605c('0x74')](function(){return db[_0x605c('0x75')][_0x605c('0x58')](_0x25d12d);});}})['then'](function(){return _0x18a897['status'](0xcc)['end']();})[_0x605c('0x51')](handleError(_0x18a897,null));};exports[_0x605c('0x76')]=function(_0x23de7b,_0xa9277f,_0x5bd0c1){var _0x456231=[];return db[_0x605c('0x6e')][_0x605c('0x5a')]()[_0x605c('0x25')](function(_0x3345ff){_0x456231=_[_0x605c('0x54')](_0x3345ff);return _0x23de7b[_0x605c('0x65')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x605c('0x77'),_0x605c('0x78')],'raw':!![]});})['then'](function(_0x462f04){if(_0x462f04&&_0x462f04[_0x605c('0x48')]){return db[_0x605c('0x79')][_0x605c('0x7a')](function(_0x3049b1){var _0x56c8f5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x605c('0x68'))},'VoiceQueueId':{'$in':_[_0x605c('0x2a')](_0x462f04,'id')},'$or':[{'UserId':null},{'UserId':_0x23de7b[_0x605c('0x65')]['id']}]};var _0x2d0e5e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x462f04)[_0x605c('0x4e')]([_0x605c('0x78'),0x0])[_0x605c('0x2a')]('id')[_0x605c('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x23de7b[_0x605c('0x65')]['id']}]};var _0x4c6c4b={'$or':[_0x56c8f5,_0x2d0e5e]};var _0x2e550d=[];if(_0x23de7b[_0x605c('0x59')][_0x605c('0x7c')]&&_0x23de7b['body'][_0x605c('0x7c')]===_0x605c('0x7d')){if(!_[_0x605c('0x7e')](_0x23de7b[_0x605c('0x59')]['hopperIds'])){_0x4c6c4b['id']={'$in':_0x23de7b['body'][_0x605c('0x7f')]};}_0x2e550d=[['priority','ASC'],['scheduledAt',_0x462f04[0x0][_0x605c('0x77')]===_0x605c('0x80')?'DESC':'ASC'],db['sequelize'][_0x605c('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x605c('0x82')]];}else{if(!_[_0x605c('0x7e')](_0x23de7b[_0x605c('0x59')][_0x605c('0x7f')])){_0x4c6c4b['id']={'$notIn':_0x23de7b[_0x605c('0x59')][_0x605c('0x7f')]};}_0x2e550d=[[_0x605c('0x83'),_0x605c('0x82')],[_0x605c('0x84'),_0x462f04[0x0]['dialOrderByScheduledAt']],db[_0x605c('0x79')]['literal'](_0x605c('0x85')),['id',_0x605c('0x80')]];}return db['CmHopper'][_0x605c('0x86')]({'attributes':['id',_0x605c('0x87'),_0x605c('0x88')],'where':_0x4c6c4b,'order':_0x2e550d,'transaction':_0x3049b1,'lock':_0x3049b1[_0x605c('0x89')][_0x605c('0x8a')],'include':[{'model':db[_0x605c('0x6e')],'as':_0x605c('0x8b'),'attributes':_0x456231,'include':[{'model':db[_0x605c('0x8c')],'as':'Company','attributes':['id',_0x605c('0x28')]}]},{'model':db[_0x605c('0x8d')],'as':_0x605c('0x8e'),'attributes':['id',_0x605c('0x28')]},{'model':db[_0x605c('0x5d')],'as':_0x605c('0x8f'),'attributes':['id',_0x605c('0x28'),_0x605c('0x90')]}]})[_0x605c('0x25')](function(_0x567628){if(_0x567628){return _0x567628[_0x605c('0x23')]({'UserId':_0x23de7b['user']['id']},{'transaction':_0x3049b1});}});});}})[_0x605c('0x25')](handleEntityNotFound(_0xa9277f,null))[_0x605c('0x25')](respondWithResult(_0xa9277f,null))['catch'](handleError(_0xa9277f,null));};exports[_0x605c('0x91')]=function(_0x57b603,_0x356a,_0x2f66c){return _0x57b603[_0x605c('0x65')][_0x605c('0x92')]({'where':{'type':_0x605c('0x93'),'dialActive':!![],'dialMethod':_0x605c('0x94')},'attributes':['id'],'raw':!![]})[_0x605c('0x25')](function(_0x4fffbf){if(_0x4fffbf&&_0x4fffbf[_0x605c('0x48')]){return db['CmHopper'][_0x605c('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x605c('0x95')](_0x605c('0x68'))},'VoiceQueueId':{'$in':_[_0x605c('0x2a')](_0x4fffbf,'id')},'$or':[{'UserId':null},{'UserId':_0x57b603[_0x605c('0x65')]['id']}]}});}return 0x0;})[_0x605c('0x25')](function(_0x3828cb){if(!_[_0x605c('0x70')](_0x3828cb)&&_[_0x605c('0x96')](_0x3828cb)){return _0x356a[_0x605c('0x1a')](0xc8)[_0x605c('0x97')]({'contacts':_0x3828cb});}else{logger[_0x605c('0x26')](_0x605c('0x98'),_0x605c('0x91'),0x194,'entity\x20not\x20found');_0x356a['sendStatus'](0x194);}})['catch'](handleError(_0x356a,null));}; \ No newline at end of file +var _0xab2a=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','index','map','CmHopper','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','$and','$gt','$gte','$ne','$eq','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','create','body','describe','find','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','outbound','preview','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','ASC','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x48564d,_0x2c1c8c){var _0x2ad779=function(_0x4490dd){while(--_0x4490dd){_0x48564d['push'](_0x48564d['shift']());}};_0x2ad779(++_0x2c1c8c);}(_0xab2a,0x1a1));var _0xaab2=function(_0x35a791,_0x877a12){_0x35a791=_0x35a791-0x0;var _0x3ba2b8=_0xab2a[_0x35a791];return _0x3ba2b8;};'use strict';var emlformat=require(_0xaab2('0x0'));var rimraf=require(_0xaab2('0x1'));var zipdir=require(_0xaab2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaab2('0x3'));var moment=require('moment');var BPromise=require(_0xaab2('0x4'));var Mustache=require(_0xaab2('0x5'));var util=require(_0xaab2('0x6'));var path=require('path');var sox=require(_0xaab2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaab2('0x8'));var crypto=require(_0xaab2('0x9'));var jsforce=require(_0xaab2('0xa'));var deskjs=require(_0xaab2('0xb'));var toCsv=require(_0xaab2('0xc'));var querystring=require(_0xaab2('0xd'));var Papa=require(_0xaab2('0xe'));var Redis=require(_0xaab2('0xf'));var authService=require(_0xaab2('0x10'));var qs=require(_0xaab2('0x11'));var as=require(_0xaab2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaab2('0x13'))('api');var utils=require(_0xaab2('0x14'));var config=require(_0xaab2('0x15'));var licenseUtil=require(_0xaab2('0x16'));var db=require(_0xaab2('0x17'))['db'];function respondWithStatusCode(_0x56d19d,_0x433136){_0x433136=_0x433136||0xcc;return function(_0x84d7db){if(_0x84d7db){return _0x56d19d[_0xaab2('0x18')](_0x433136);}return _0x56d19d[_0xaab2('0x19')](_0x433136)[_0xaab2('0x1a')]();};}function respondWithResult(_0x1549ec,_0x5cdabe){_0x5cdabe=_0x5cdabe||0xc8;return function(_0x58cab0){if(_0x58cab0){return _0x1549ec[_0xaab2('0x19')](_0x5cdabe)[_0xaab2('0x1b')](_0x58cab0);}};}function respondWithFilteredResult(_0x5d8dc1,_0x39585c){return function(_0x17cbb3){if(_0x17cbb3){var _0x3e59a7=typeof _0x39585c[_0xaab2('0x1c')]===_0xaab2('0x1d')&&typeof _0x39585c['limit']==='undefined';var _0x1b58a7=_0x17cbb3[_0xaab2('0x1e')];var _0x4d796a=_0x3e59a7?0x0:_0x39585c[_0xaab2('0x1c')];var _0x27b87d=_0x3e59a7?_0x17cbb3['count']:_0x39585c['offset']+_0x39585c[_0xaab2('0x1f')];var _0x67aca3;if(_0x27b87d>=_0x1b58a7){_0x27b87d=_0x1b58a7;_0x67aca3=0xc8;}else{_0x67aca3=0xce;}_0x5d8dc1[_0xaab2('0x19')](_0x67aca3);return _0x5d8dc1[_0xaab2('0x20')](_0xaab2('0x21'),_0x4d796a+'-'+_0x27b87d+'/'+_0x1b58a7)[_0xaab2('0x1b')](_0x17cbb3);}return null;};}function patchUpdates(_0x37bd23){return function(_0x17b7fd){try{jsonpatch[_0xaab2('0x22')](_0x17b7fd,_0x37bd23,!![]);}catch(_0x2de8a9){return BPromise[_0xaab2('0x23')](_0x2de8a9);}return _0x17b7fd[_0xaab2('0x24')]();};}function saveUpdates(_0x20cd3a,_0x358848){return function(_0x22452d){if(_0x22452d){return _0x22452d[_0xaab2('0x25')](_0x20cd3a)[_0xaab2('0x26')](function(_0x3e8fc7){return _0x3e8fc7;});}return null;};}function removeEntity(_0x134ebb,_0x57595e){return function(_0x2ce729){if(_0x2ce729){return _0x2ce729['destroy']()[_0xaab2('0x26')](function(){_0x134ebb['status'](0xcc)[_0xaab2('0x1a')]();});}};}function handleEntityNotFound(_0x2900aa,_0x4d7ed){return function(_0x35e3e6){if(!_0x35e3e6){_0x2900aa[_0xaab2('0x18')](0x194);}return _0x35e3e6;};}function handleError(_0xae3537,_0x50caa3){_0x50caa3=_0x50caa3||0x1f4;return function(_0x445733){logger[_0xaab2('0x27')](_0x445733['stack']);if(_0x445733['name']){delete _0x445733['name'];}_0xae3537[_0xaab2('0x19')](_0x50caa3)['send'](_0x445733);};}exports[_0xaab2('0x28')]=function(_0x258dd7,_0x6f13d4){var _0x5a4a49={},_0x578501={},_0x217975={'count':0x0,'rows':[]};var _0x4dcbd0=_[_0xaab2('0x29')](db[_0xaab2('0x2a')][_0xaab2('0x2b')],function(_0x2e30f5){return{'name':_0x2e30f5[_0xaab2('0x2c')],'type':_0x2e30f5[_0xaab2('0x2d')][_0xaab2('0x2e')]};});_0x578501['model']=_[_0xaab2('0x29')](_0x4dcbd0,_0xaab2('0x2f'));_0x578501[_0xaab2('0x30')]=_[_0xaab2('0x31')](_0x258dd7['query']);_0x578501[_0xaab2('0x32')]=_[_0xaab2('0x33')](_0x578501[_0xaab2('0x34')],_0x578501[_0xaab2('0x30')]);_0x578501[_0xaab2('0x32')]=_['concat'](_0x578501[_0xaab2('0x32')],[_0xaab2('0x35'),'$or',_0xaab2('0x36'),_0xaab2('0x37'),'$lt','$lte',_0xaab2('0x38'),_0xaab2('0x39'),_0xaab2('0x3a'),_0xaab2('0x3b'),'$notBetween',_0xaab2('0x3c'),'$notIn',_0xaab2('0x3d'),_0xaab2('0x3e'),_0xaab2('0x3f'),_0xaab2('0x40'),'$like',_0xaab2('0x41'),'$contains',_0xaab2('0x42'),_0xaab2('0x43')]);_0x5a4a49[_0xaab2('0x44')]=_[_0xaab2('0x33')](_0x578501[_0xaab2('0x34')],qs['fields'](_0x258dd7[_0xaab2('0x30')][_0xaab2('0x45')]));_0x5a4a49[_0xaab2('0x44')]=_0x5a4a49[_0xaab2('0x44')][_0xaab2('0x46')]?_0x5a4a49['attributes']:_0x578501[_0xaab2('0x34')];if(!_0x258dd7[_0xaab2('0x30')][_0xaab2('0x47')](_0xaab2('0x48'))){_0x5a4a49[_0xaab2('0x1f')]=qs[_0xaab2('0x1f')](_0x258dd7['query'][_0xaab2('0x1f')]);_0x5a4a49[_0xaab2('0x1c')]=qs[_0xaab2('0x1c')](_0x258dd7[_0xaab2('0x30')][_0xaab2('0x1c')]);}_0x5a4a49[_0xaab2('0x49')]=qs[_0xaab2('0x4a')](_0x258dd7[_0xaab2('0x30')][_0xaab2('0x4a')]);_0x5a4a49[_0xaab2('0x4b')]=qs[_0xaab2('0x32')](_[_0xaab2('0x4c')](_0x258dd7[_0xaab2('0x30')],_0x578501[_0xaab2('0x32')]),_0x4dcbd0);if(_0x258dd7[_0xaab2('0x30')][_0xaab2('0x4d')]){_0x5a4a49[_0xaab2('0x4b')]=_[_0xaab2('0x4e')](_0x5a4a49[_0xaab2('0x4b')],{'$or':_[_0xaab2('0x29')](_0x4dcbd0,function(_0x5750bf){if(_0x5750bf[_0xaab2('0x2d')]!==_0xaab2('0x4f')){var _0x161976={};_0x161976[_0x5750bf[_0xaab2('0x2f')]]={'$like':'%'+_0x258dd7['query'][_0xaab2('0x4d')]+'%'};return _0x161976;}})});}_0x5a4a49=_[_0xaab2('0x4e')]({},_0x5a4a49,_0x258dd7[_0xaab2('0x50')]);var _0x19347a={'where':_0x5a4a49['where']};return db[_0xaab2('0x2a')][_0xaab2('0x1e')](_0x19347a)[_0xaab2('0x26')](function(_0x4adfc3){_0x217975[_0xaab2('0x1e')]=_0x4adfc3;if(_0x258dd7['query'][_0xaab2('0x51')]){_0x5a4a49[_0xaab2('0x52')]=[{'all':!![]}];}return db[_0xaab2('0x2a')]['findAll'](_0x5a4a49);})['then'](function(_0x4f201c){_0x217975['rows']=_0x4f201c;return _0x217975;})[_0xaab2('0x26')](respondWithFilteredResult(_0x6f13d4,_0x5a4a49))[_0xaab2('0x53')](handleError(_0x6f13d4,null));};exports[_0xaab2('0x54')]=function(_0x40d81d,_0xffd70e){var _0x2c3e26={'raw':!![],'where':{'id':_0x40d81d[_0xaab2('0x55')]['id']}},_0x2d91e5={};_0x2d91e5[_0xaab2('0x34')]=_['keys'](db['CmHopper'][_0xaab2('0x2b')]);_0x2d91e5[_0xaab2('0x30')]=_[_0xaab2('0x31')](_0x40d81d['query']);_0x2d91e5[_0xaab2('0x32')]=_[_0xaab2('0x33')](_0x2d91e5[_0xaab2('0x34')],_0x2d91e5['query']);_0x2c3e26[_0xaab2('0x44')]=_[_0xaab2('0x33')](_0x2d91e5['model'],qs[_0xaab2('0x45')](_0x40d81d[_0xaab2('0x30')][_0xaab2('0x45')]));_0x2c3e26['attributes']=_0x2c3e26[_0xaab2('0x44')][_0xaab2('0x46')]?_0x2c3e26[_0xaab2('0x44')]:_0x2d91e5[_0xaab2('0x34')];if(_0x40d81d[_0xaab2('0x30')]['includeAll']){_0x2c3e26[_0xaab2('0x52')]=[{'all':!![]}];}_0x2c3e26=_[_0xaab2('0x4e')]({},_0x2c3e26,_0x40d81d[_0xaab2('0x50')]);return db[_0xaab2('0x2a')]['find'](_0x2c3e26)[_0xaab2('0x26')](handleEntityNotFound(_0xffd70e,null))[_0xaab2('0x26')](respondWithResult(_0xffd70e,null))[_0xaab2('0x53')](handleError(_0xffd70e,null));};exports[_0xaab2('0x56')]=function(_0x2cdad6,_0x203335){return db[_0xaab2('0x2a')]['create'](_0x2cdad6['body'],{})[_0xaab2('0x26')](respondWithResult(_0x203335,0xc9))[_0xaab2('0x53')](handleError(_0x203335,null));};exports[_0xaab2('0x25')]=function(_0x40d5fc,_0x47c4ee){if(_0x40d5fc[_0xaab2('0x57')]['id']){delete _0x40d5fc[_0xaab2('0x57')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x40d5fc['params']['id']}})[_0xaab2('0x26')](handleEntityNotFound(_0x47c4ee,null))[_0xaab2('0x26')](saveUpdates(_0x40d5fc[_0xaab2('0x57')],null))[_0xaab2('0x26')](respondWithResult(_0x47c4ee,null))['catch'](handleError(_0x47c4ee,null));};exports[_0xaab2('0x58')]=function(_0x3733c9,_0x5ef62a){return db[_0xaab2('0x2a')][_0xaab2('0x58')]()[_0xaab2('0x26')](respondWithResult(_0x5ef62a,null))[_0xaab2('0x53')](handleError(_0x5ef62a,null));};exports['destroy']=function(_0x139136,_0x1f945d){var _0x36cef1;return db['CmHopper'][_0xaab2('0x59')]({'where':{'id':_0x139136['params']['id']}})[_0xaab2('0x26')](handleEntityNotFound(_0x1f945d,null))['then'](function(_0x86b333){if(_0x86b333){return _0x86b333['destroy']()[_0xaab2('0x26')](function(_0x5f0c61){return _0x5f0c61;});}})[_0xaab2('0x26')](function(_0x3c6788){_0x36cef1=_0x3c6788;if(_0x3c6788){if(_0x3c6788['VoiceQueueId']||_0x3c6788[_0xaab2('0x5a')]){return db[_0x3c6788[_0xaab2('0x5b')]?_0xaab2('0x5c'):_0xaab2('0x5d')][_0xaab2('0x59')]({'where':{'id':_0x3c6788[_0xaab2('0x5b')]?_0x3c6788[_0xaab2('0x5b')]:_0x3c6788[_0xaab2('0x5a')]},'attributes':['id',_0xaab2('0x2f')],'raw':!![]});}}})[_0xaab2('0x26')](function(_0x2612c2){var _0x592e44={};if(_0x2612c2){_[_0xaab2('0x4e')](_0x592e44,_[_0xaab2('0x5e')](_0x36cef1[_0xaab2('0x5f')],['createdAt',_0xaab2('0x60'),'id']));_0x592e44['state']=0x15;_0x592e44[_0xaab2('0x61')]=_0xaab2('0x62');_0x592e44[_0xaab2('0x63')]=_0x2612c2[_0xaab2('0x2f')];_0x592e44[_0xaab2('0x64')]=_0x139136[_0xaab2('0x65')]['name'];_0x592e44['UserId']=_0x139136[_0xaab2('0x65')]['id'];_0x592e44['deleted']=!![];_0x592e44[_0xaab2('0x66')]=moment()[_0xaab2('0x67')](_0xaab2('0x68'));_0x592e44['calleridnum']=_0x36cef1[_0xaab2('0x69')];_0x592e44[_0xaab2('0x6a')]=_0x36cef1[_0xaab2('0x5b')]?'queue':_0xaab2('0x6b');return db[_0xaab2('0x6c')]['find']({'where':{'id':_0x592e44[_0xaab2('0x6d')]},'attributes':[_0xaab2('0x6e'),_0xaab2('0x6f')]})[_0xaab2('0x26')](function(_0x38f7ad){if(!_[_0xaab2('0x70')](_0x1f945d)&&!_[_0xaab2('0x70')](_0x38f7ad[_0xaab2('0x6e')])){_0x592e44[_0xaab2('0x71')]=_0x38f7ad[_0xaab2('0x6e')];if(!_[_0xaab2('0x70')](_0x38f7ad[_0xaab2('0x6f')])){_0x592e44['calleridname']+='\x20'+_0x38f7ad[_0xaab2('0x6f')];}}})['finally'](function(){return db[_0xaab2('0x72')]['create'](_0x592e44);});}})[_0xaab2('0x26')](function(){return _0x1f945d[_0xaab2('0x19')](0xcc)[_0xaab2('0x1a')]();})[_0xaab2('0x53')](handleError(_0x1f945d,null));};exports[_0xaab2('0x73')]=function(_0x460f82,_0x191153,_0x31ec56){var _0x2ff92d=[];return db[_0xaab2('0x6c')][_0xaab2('0x58')]()[_0xaab2('0x26')](function(_0x6ba100){_0x2ff92d=_[_0xaab2('0x31')](_0x6ba100);return _0x460f82[_0xaab2('0x65')]['getVoiceQueues']({'where':{'type':_0xaab2('0x74'),'dialActive':!![],'dialMethod':_0xaab2('0x75')},'attributes':['id','dialOrderByScheduledAt',_0xaab2('0x76')],'raw':!![]});})[_0xaab2('0x26')](function(_0x11e8c2){if(_0x11e8c2&&_0x11e8c2[_0xaab2('0x46')]){return db['sequelize']['transaction'](function(_0x1984dd){var _0x380c3e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaab2('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaab2('0x29')](_0x11e8c2,'id')},'$or':[{'UserId':null},{'UserId':_0x460f82['user']['id']}]};var _0x53cd56={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x11e8c2)[_0xaab2('0x4d')]([_0xaab2('0x76'),0x0])[_0xaab2('0x29')]('id')[_0xaab2('0x77')]()},'$or':[{'UserId':null},{'UserId':_0x460f82[_0xaab2('0x65')]['id']}]};var _0x22cfce={'$or':[_0x380c3e,_0x53cd56]};var _0x42d89e=[];if(_0x460f82['body'][_0xaab2('0x78')]&&_0x460f82['body'][_0xaab2('0x78')]===_0xaab2('0x79')){if(!_[_0xaab2('0x7a')](_0x460f82[_0xaab2('0x57')][_0xaab2('0x7b')])){_0x22cfce['id']={'$in':_0x460f82[_0xaab2('0x57')][_0xaab2('0x7b')]};}_0x42d89e=[['priority',_0xaab2('0x7c')],['scheduledAt',_0x11e8c2[0x0][_0xaab2('0x7d')]==='ASC'?_0xaab2('0x7e'):_0xaab2('0x7c')],db[_0xaab2('0x7f')][_0xaab2('0x80')](_0xaab2('0x81')),['id',_0xaab2('0x7e')]];}else{if(!_[_0xaab2('0x7a')](_0x460f82[_0xaab2('0x57')]['hopperIds'])){_0x22cfce['id']={'$notIn':_0x460f82[_0xaab2('0x57')][_0xaab2('0x7b')]};}_0x42d89e=[[_0xaab2('0x82'),_0xaab2('0x7e')],['scheduledAt',_0x11e8c2[0x0][_0xaab2('0x7d')]],db[_0xaab2('0x7f')][_0xaab2('0x80')](_0xaab2('0x83')),['id',_0xaab2('0x7c')]];}return db[_0xaab2('0x2a')][_0xaab2('0x84')]({'attributes':['id',_0xaab2('0x85'),'recallme'],'where':_0x22cfce,'order':_0x42d89e,'transaction':_0x1984dd,'lock':_0x1984dd['LOCK'][_0xaab2('0x86')],'include':[{'model':db[_0xaab2('0x6c')],'as':_0xaab2('0x87'),'attributes':_0x2ff92d,'include':[{'model':db[_0xaab2('0x88')],'as':_0xaab2('0x89'),'attributes':['id',_0xaab2('0x2f')]}]},{'model':db[_0xaab2('0x8a')],'as':_0xaab2('0x8b'),'attributes':['id',_0xaab2('0x2f')]},{'model':db[_0xaab2('0x5c')],'as':_0xaab2('0x8c'),'attributes':['id',_0xaab2('0x2f'),_0xaab2('0x8d')]}]})['then'](function(_0x4c46ba){if(_0x4c46ba){return _0x4c46ba[_0xaab2('0x25')]({'UserId':_0x460f82[_0xaab2('0x65')]['id']},{'transaction':_0x1984dd});}});});}})[_0xaab2('0x26')](handleEntityNotFound(_0x191153,null))[_0xaab2('0x26')](respondWithResult(_0x191153,null))[_0xaab2('0x53')](handleError(_0x191153,null));};exports[_0xaab2('0x8e')]=function(_0x37804d,_0x202449,_0x548af0){return _0x37804d['user'][_0xaab2('0x8f')]({'where':{'type':_0xaab2('0x74'),'dialActive':!![],'dialMethod':_0xaab2('0x75')},'attributes':['id'],'raw':!![]})[_0xaab2('0x26')](function(_0x47fe11){if(_0x47fe11&&_0x47fe11['length']){return db[_0xaab2('0x2a')][_0xaab2('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaab2('0x67')](_0xaab2('0x68'))},'VoiceQueueId':{'$in':_[_0xaab2('0x29')](_0x47fe11,'id')},'$or':[{'UserId':null},{'UserId':_0x37804d[_0xaab2('0x65')]['id']}]}});}return 0x0;})[_0xaab2('0x26')](function(_0x4bc88f){if(!_['isNil'](_0x4bc88f)&&_[_0xaab2('0x90')](_0x4bc88f)){return _0x202449['status'](0xc8)['json']({'contacts':_0x4bc88f});}else{logger[_0xaab2('0x27')](_0xaab2('0x91'),_0xaab2('0x8e'),0x194,_0xaab2('0x92'));_0x202449[_0xaab2('0x18')](0x194);}})[_0xaab2('0x53')](handleError(_0x202449,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 0877243..0428bb6 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 _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2bb52b,_0x3d9bc6){_0x2bb52b=_0x2bb52b-0x0;var _0x11ade2=_0xc6ac[_0x2bb52b];return _0x11ade2;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['define','CmHopper','cm_hopper','scheduledat','phone','priority','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x4d469d,_0x4b766c){var _0x3113c1=function(_0x440fda){while(--_0x440fda){_0x4d469d['push'](_0x4d469d['shift']());}};_0x3113c1(++_0x4b766c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5d6630,_0x585612){_0x5d6630=_0x5d6630-0x0;var _0x42e399=_0xdbf5[_0x5d6630];return _0x42e399;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5dbf('0xc')]},{'name':'phone','fields':[_0x5dbf('0xd')]},{'name':_0x5dbf('0xe'),'fields':[_0x5dbf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 1ffd7bd..1a5cca2 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 _0x1471=['../../config/environment','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','then','stringify','find','model','ShowCmHopper','CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','includes','push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x541b80,_0x4717d1){var _0x339d0=function(_0x2fe210){while(--_0x2fe210){_0x541b80['push'](_0x541b80['shift']());}};_0x339d0(++_0x4717d1);}(_0x1471,0x13f));var _0x1147=function(_0x2bdc88,_0x4ce1c9){_0x2bdc88=_0x2bdc88-0x0;var _0x631da0=_0x1471[_0x2bdc88];return _0x631da0;};'use strict';var _=require(_0x1147('0x0'));var util=require(_0x1147('0x1'));var moment=require(_0x1147('0x2'));var BPromise=require(_0x1147('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1147('0x4'));var db=require(_0x1147('0x5'))['db'];var utils=require(_0x1147('0x6'));var logger=require(_0x1147('0x7'))(_0x1147('0x8'));var config=require(_0x1147('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1147('0xa')][_0x1147('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a2f3,_0x10ff0b,_0x11c344){return new BPromise(function(_0x43902f,_0x19941e){return client[_0x1147('0xc')](_0x22a2f3,_0x11c344)['then'](function(_0x4ba5ab){logger[_0x1147('0xd')](_0x1147('0xe'),_0x10ff0b,_0x1147('0xf'));logger[_0x1147('0x10')](_0x1147('0x11'),_0x10ff0b,_0x1147('0xf'),JSON['stringify'](_0x4ba5ab));if(_0x4ba5ab[_0x1147('0x12')]){if(_0x4ba5ab[_0x1147('0x12')][_0x1147('0x13')]===0x1f4){logger[_0x1147('0x12')](_0x1147('0xe'),_0x10ff0b,_0x4ba5ab[_0x1147('0x12')][_0x1147('0x14')]);return _0x19941e(_0x4ba5ab[_0x1147('0x12')][_0x1147('0x14')]);}logger[_0x1147('0x12')]('CmHopper,\x20%s,\x20%s',_0x10ff0b,_0x4ba5ab[_0x1147('0x12')]['message']);return _0x43902f(_0x4ba5ab[_0x1147('0x12')][_0x1147('0x14')]);}else{logger[_0x1147('0xd')](_0x1147('0xe'),_0x10ff0b,_0x1147('0xf'));_0x43902f(_0x4ba5ab[_0x1147('0x15')]['message']);}})[_0x1147('0x16')](function(_0x4d0851){logger[_0x1147('0x12')](_0x1147('0xe'),_0x10ff0b,_0x4d0851);_0x19941e(_0x4d0851);});});}exports[_0x1147('0x17')]=function(_0x1d4171){var _0xc7c888=this;return new Promise(function(_0x1aa392,_0x4680a1){return db[_0x1147('0x18')][_0x1147('0x19')]({'raw':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1d')]||null:null,'limit':_0x1d4171['options']?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1e')]||null:null,'include':_0x1d4171[_0x1147('0x1a')]?_0x1d4171[_0x1147('0x1a')][_0x1147('0x1f')]?_[_0x1147('0x20')](_0x1d4171['options'][_0x1147('0x1f')],function(_0x36d472){return{'model':db[_0x36d472['model']],'as':_0x36d472['as'],'attributes':_0x36d472['attributes'],'include':_0x36d472['include']?_[_0x1147('0x20')](_0x36d472['include'],function(_0x5e165a){return{'model':db[_0x5e165a['model']],'as':_0x5e165a['as'],'attributes':_0x5e165a[_0x1147('0x1d')],'include':_0x5e165a['include']?_[_0x1147('0x20')](_0x5e165a[_0x1147('0x1f')],function(_0x58a19d){return{'model':db[_0x58a19d['model']],'as':_0x58a19d['as'],'attributes':_0x58a19d[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0xaafc2c){logger[_0x1147('0xd')](_0x1147('0x17'),_0x1d4171);logger[_0x1147('0x10')]('GetCmHopper',_0x1d4171,JSON[_0x1147('0x22')](_0xaafc2c));_0x1aa392(_0xaafc2c);})[_0x1147('0x16')](function(_0x4b9a05){logger[_0x1147('0x12')](_0x1147('0x17'),_0x4b9a05[_0x1147('0x14')],_0x1d4171);_0x4680a1(_0xc7c888[_0x1147('0x12')](0x1f4,_0x4b9a05['message']));});});};exports['ShowCmHopper']=function(_0x186fc5){var _0x362127=this;return new Promise(function(_0x469bbf,_0x484cd4){return db[_0x1147('0x18')][_0x1147('0x23')]({'raw':_0x186fc5['options']?_0x186fc5[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x186fc5['options']?_0x186fc5[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x186fc5[_0x1147('0x1a')]?_0x186fc5[_0x1147('0x1a')]['attributes']||null:null,'include':_0x186fc5[_0x1147('0x1a')]?_0x186fc5[_0x1147('0x1a')][_0x1147('0x1f')]?_[_0x1147('0x20')](_0x186fc5[_0x1147('0x1a')][_0x1147('0x1f')],function(_0x4177c1){return{'model':db[_0x4177c1[_0x1147('0x24')]],'as':_0x4177c1['as'],'attributes':_0x4177c1[_0x1147('0x1d')],'include':_0x4177c1[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x4177c1[_0x1147('0x1f')],function(_0x3d088f){return{'model':db[_0x3d088f[_0x1147('0x24')]],'as':_0x3d088f['as'],'attributes':_0x3d088f[_0x1147('0x1d')],'include':_0x3d088f[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x3d088f[_0x1147('0x1f')],function(_0x5ca610){return{'model':db[_0x5ca610[_0x1147('0x24')]],'as':_0x5ca610['as'],'attributes':_0x5ca610[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0x142a93){logger['info'](_0x1147('0x25'),_0x186fc5);logger[_0x1147('0x10')](_0x1147('0x25'),_0x186fc5,JSON['stringify'](_0x142a93));_0x469bbf(_0x142a93);})[_0x1147('0x16')](function(_0x2f3977){logger[_0x1147('0x12')]('ShowCmHopper',_0x2f3977[_0x1147('0x14')],_0x186fc5);_0x484cd4(_0x362127[_0x1147('0x12')](0x1f4,_0x2f3977['message']));});});};exports[_0x1147('0x26')]=function(_0x13b732){var _0x5b5138=this;return new Promise(function(_0x3957a6,_0x47d93b){return db[_0x1147('0x18')][_0x1147('0x27')](_0x13b732[_0x1147('0x28')],{'raw':_0x13b732[_0x1147('0x1a')]?_0x13b732[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![]})[_0x1147('0x21')](function(_0x20e15e){logger[_0x1147('0xd')]('CreateCmHopper',_0x13b732);logger[_0x1147('0x10')](_0x1147('0x26'),_0x13b732,JSON[_0x1147('0x22')](_0x20e15e));_0x3957a6(_0x20e15e);})[_0x1147('0x16')](function(_0x575049){logger[_0x1147('0x12')](_0x1147('0x26'),_0x575049[_0x1147('0x14')],_0x13b732);_0x47d93b(_0x5b5138[_0x1147('0x12')](0x1f4,_0x575049[_0x1147('0x14')]));});});};exports['UpdateCmHopper']=function(_0x5d7ccb){var _0x5e0be4=this;return new Promise(function(_0x229530,_0x1562ef){return db['CmHopper'][_0x1147('0x29')](_0x5d7ccb[_0x1147('0x28')],{'raw':_0x5d7ccb['options']?_0x5d7ccb[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7ccb[_0x1147('0x1a')]?_0x5d7ccb[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x5d7ccb[_0x1147('0x1a')]?_0x5d7ccb['options'][_0x1147('0x1d')]||null:null,'limit':_0x5d7ccb[_0x1147('0x1a')]?_0x5d7ccb[_0x1147('0x1a')][_0x1147('0x1e')]||null:null})['then'](function(_0x53bc0b){logger['info'](_0x1147('0x2a'),_0x5d7ccb);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1147('0x22')](_0x5d7ccb['options'][_0x1147('0x1c')]),_0x5d7ccb['body']['active']);logger[_0x1147('0x10')](_0x1147('0x2a'),_0x5d7ccb,JSON[_0x1147('0x22')](_0x53bc0b));_0x229530(_0x53bc0b);})[_0x1147('0x16')](function(_0x6364c8){logger[_0x1147('0x12')](_0x1147('0x2a'),_0x6364c8[_0x1147('0x14')],_0x5d7ccb);_0x1562ef(_0x5e0be4[_0x1147('0x12')](0x1f4,_0x6364c8[_0x1147('0x14')]));});});};exports[_0x1147('0x2b')]=function(_0x44bb98){var _0x1db377=this;return new Promise(function(_0x2cd220,_0x578d8d){return db[_0x1147('0x18')][_0x1147('0x2c')]({'where':_0x44bb98[_0x1147('0x1a')]?_0x44bb98[_0x1147('0x1a')]['where']||null:null})[_0x1147('0x21')](function(_0x4e2fd7){logger[_0x1147('0xd')](_0x1147('0x2b'),_0x44bb98);logger[_0x1147('0x10')](_0x1147('0x2b'),_0x44bb98,JSON[_0x1147('0x22')](_0x4e2fd7));_0x2cd220(_0x4e2fd7);})[_0x1147('0x16')](function(_0x1d5bcd){logger[_0x1147('0x12')](_0x1147('0x2b'),_0x1d5bcd[_0x1147('0x14')],_0x44bb98);_0x578d8d(_0x1db377[_0x1147('0x12')](0x1f4,_0x1d5bcd['message']));});});};exports[_0x1147('0x2d')]=function(_0xabd3e5){var _0xa185a9=this;return new Promise(function(_0x2951ba,_0x4963af){return db[_0x1147('0x2e')][_0x1147('0x2f')]()[_0x1147('0x21')](function(_0x2947de){return db[_0x1147('0x30')][_0x1147('0x31')](function(_0x5cab40){return db['CmHopper'][_0x1147('0x19')]({'where':_0xabd3e5[_0x1147('0x1a')]?_0xabd3e5[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0xabd3e5[_0x1147('0x1a')]?_0xabd3e5['options'][_0x1147('0x1d')]||null:null,'limit':_0xabd3e5['options']?_0xabd3e5[_0x1147('0x1a')]['limit']||null:null,'order':_0xabd3e5[_0x1147('0x1a')]?_0xabd3e5['options']['order']||null:null,'transaction':_0x5cab40,'lock':_0x5cab40[_0x1147('0x32')][_0x1147('0x33')],'include':[{'model':db['CmContact'],'as':_0x1147('0x34'),'attributes':_[_0x1147('0x35')](_0x2947de)},{'model':db[_0x1147('0x36')],'as':_0x1147('0x37'),'attributes':['id',_0x1147('0x38'),_0x1147('0x39')]}]})[_0x1147('0x21')](function(_0x2cca79){var _0x5911bb=[];var _0x3c33c8=[];for(var _0x4e4388=0x0;_0x4e4388<_0x2cca79[_0x1147('0x3a')];_0x4e4388+=0x1){var _0x329ea8=_0x2cca79[_0x4e4388][_0x1147('0x3b')];if(_0x329ea8===null){_0x5911bb['push'](_0x2cca79[_0x4e4388][_0x1147('0x29')](_0xabd3e5[_0x1147('0x28')],{'transaction':_0x5cab40}));}else if(!_0x3c33c8[_0x1147('0x3c')](_0x329ea8)){_0x3c33c8[_0x1147('0x3d')](_0x329ea8);_0x5911bb[_0x1147('0x3d')](_0x2cca79[_0x4e4388][_0x1147('0x29')](_0xabd3e5[_0x1147('0x28')],{'transaction':_0x5cab40}));}}return BPromise['all'](_0x5911bb);});})[_0x1147('0x21')](function(_0x59c51b){logger[_0x1147('0xd')](_0x1147('0x2d'),_0xabd3e5);if(_0x59c51b[_0x1147('0x3a')]>0x0){logger[_0x1147('0xd')](_0x1147('0x3e'),_0x59c51b[0x0][_0x1147('0x3f')]['id'],_0x59c51b[0x0]['dataValues'][_0x1147('0x40')],_0x59c51b[0x0][_0x1147('0x3f')][_0x1147('0x41')]);}logger['debug'](_0x1147('0x2d'),_0xabd3e5,JSON[_0x1147('0x22')](_0x59c51b));_0x2951ba(_0x59c51b);})[_0x1147('0x16')](function(_0x321861){logger[_0x1147('0x12')](_0x1147('0x2d'),_0x321861['message'],_0xabd3e5);_0x4963af(_0xa185a9[_0x1147('0x12')](0x1f4,_0x321861[_0x1147('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x46825e){var _0x2f1a22=this;return new Promise(function(_0x2794cf,_0x2b0da3){return db['sequelize'][_0x1147('0x31')](function(_0x4bd1e8){return db[_0x1147('0x42')][_0x1147('0x27')](_0x46825e[_0x1147('0x28')],{'raw':_0x46825e[_0x1147('0x1a')]?_0x46825e['options'][_0x1147('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x4bd1e8})['then'](function(){logger[_0x1147('0xd')](_0x1147('0x43'),JSON['stringify'](_0x46825e[_0x1147('0x1a')][_0x1147('0x1c')]),_0x46825e[_0x1147('0x1a')]['where']['active']);return db[_0x1147('0x18')][_0x1147('0x2c')]({'where':_0x46825e[_0x1147('0x1a')]?_0x46825e['options'][_0x1147('0x1c')]||null:null,'transaction':_0x4bd1e8});});})['then'](function(_0x1c21e1){logger['info'](_0x1147('0x44'),_0x46825e);logger[_0x1147('0x10')](_0x1147('0x44'),_0x46825e,JSON[_0x1147('0x22')](_0x1c21e1));_0x2794cf(_0x1c21e1);})[_0x1147('0x16')](function(_0x4a6065){logger['error'](_0x1147('0x44'),_0x4a6065[_0x1147('0x14')],_0x46825e);_0x2b0da3(_0x2f1a22['error'](0x1f4,_0x4a6065[_0x1147('0x14')]));});});};exports[_0x1147('0x45')]=function(_0x45998e){var _0x28613f=this;return new Promise(function(_0xc08b3d,_0x1d547b){return db[_0x1147('0x18')][_0x1147('0x19')]({'raw':_0x45998e['options']?_0x45998e['options'][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x45998e['options']?_0x45998e['options'][_0x1147('0x1c')]||null:null,'attributes':[[db[_0x1147('0x30')]['fn'](_0x1147('0x46'),db[_0x1147('0x30')]['fn']('IF',db[_0x1147('0x30')][_0x1147('0x47')](_0x1147('0x48')+util[_0x1147('0x49')](_0x1147('0x4a'),moment()[_0x1147('0x49')](_0x1147('0x4b')))+_0x1147('0x4c')))),_0x1147('0x4d')]]})[_0x1147('0x21')](function(_0x592c2b){logger['info'](_0x1147('0x45'),_0x45998e);logger[_0x1147('0x10')](_0x1147('0x45'),_0x45998e,JSON[_0x1147('0x22')](_0x592c2b));_0xc08b3d(_0x592c2b);})['catch'](function(_0x3e49ab){logger[_0x1147('0x12')](_0x1147('0x45'),_0x3e49ab['message'],_0x45998e);_0x1d547b(_0x28613f[_0x1147('0x12')](0x1f4,_0x3e49ab[_0x1147('0x14')]));});});};exports[_0x1147('0x4e')]=function(_0x17853f){var _0x5f59ca=this;return new Promise(function(_0x489584,_0x199e64){return db[_0x1147('0x2e')]['describe']()[_0x1147('0x21')](function(_0x4363f4){return db[_0x1147('0x30')]['transaction'](function(_0x1ca25c){return db['CmHopper'][_0x1147('0x19')]({'where':_0x17853f[_0x1147('0x1a')]?_0x17853f[_0x1147('0x1a')][_0x1147('0x1c')]||null:null,'attributes':_0x17853f['options']?_0x17853f['options']['attributes']||null:null,'limit':0x1,'order':_0x17853f[_0x1147('0x1a')]?_0x17853f[_0x1147('0x1a')][_0x1147('0x4f')]||null:null,'group':db[_0x1147('0x18')][_0x1147('0x3b')],'transaction':_0x1ca25c,'lock':_0x1ca25c[_0x1147('0x32')][_0x1147('0x33')],'include':_0x17853f[_0x1147('0x1a')]?_0x17853f[_0x1147('0x1a')]['include']?_[_0x1147('0x20')](_0x17853f[_0x1147('0x1a')][_0x1147('0x1f')],function(_0x407a63){return{'model':db[_0x407a63[_0x1147('0x24')]],'as':_0x407a63['as'],'attributes':_0x407a63['attributes'],'include':_0x407a63['include']?_['map'](_0x407a63[_0x1147('0x1f')],function(_0xd5d24d){return{'model':db[_0xd5d24d[_0x1147('0x24')]],'as':_0xd5d24d['as'],'attributes':_0xd5d24d[_0x1147('0x1d')],'include':_0xd5d24d[_0x1147('0x1f')]?_[_0x1147('0x20')](_0xd5d24d[_0x1147('0x1f')],function(_0x3b2597){return{'model':db[_0x3b2597[_0x1147('0x24')]],'as':_0x3b2597['as'],'attributes':_0x3b2597[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0x487faa){var _0x505e81=[];for(var _0x3695e5=0x0;_0x3695e5<_0x487faa[_0x1147('0x3a')];_0x3695e5+=0x1){_0x505e81[_0x1147('0x3d')](_0x487faa[_0x3695e5][_0x1147('0x29')](_0x17853f['body'],{'transaction':_0x1ca25c}));}return BPromise['all'](_0x505e81);});})['then'](function(_0x131c71){logger[_0x1147('0xd')]('GetContactRecallMe',_0x17853f);logger['debug'](_0x1147('0x4e'),_0x17853f,JSON[_0x1147('0x22')](_0x131c71));_0x489584(_0x131c71);})[_0x1147('0x16')](function(_0x32cea2){logger[_0x1147('0x12')](_0x1147('0x4e'),_0x32cea2[_0x1147('0x14')],_0x17853f);_0x199e64(_0x5f59ca[_0x1147('0x12')](0x1f4,_0x32cea2[_0x1147('0x14')]));});});});};exports[_0x1147('0x50')]=function(_0x1962d0){var _0x151af6=this;return new Promise(function(_0x4561a5,_0xa37bb4){db['CmContact'][_0x1147('0x2f')]()[_0x1147('0x21')](function(_0x5421f1){return db[_0x1147('0x18')][_0x1147('0x19')]({'raw':_0x1962d0[_0x1147('0x1a')]?_0x1962d0[_0x1147('0x1a')][_0x1147('0x1b')]===undefined?!![]:![]:!![],'where':_0x1962d0[_0x1147('0x1a')]?_0x1962d0['options'][_0x1147('0x1c')]||null:null,'attributes':_0x1962d0[_0x1147('0x1a')]?_0x1962d0['options'][_0x1147('0x1d')]||null:null,'limit':_0x1962d0[_0x1147('0x1a')]?_0x1962d0[_0x1147('0x1a')][_0x1147('0x1e')]||null:null,'include':_0x1962d0[_0x1147('0x1a')]?_0x1962d0[_0x1147('0x1a')][_0x1147('0x1f')]?_[_0x1147('0x20')](_0x1962d0[_0x1147('0x1a')][_0x1147('0x1f')],function(_0x4fba32){return{'model':db[_0x4fba32[_0x1147('0x24')]],'as':_0x4fba32['as'],'attributes':_0x4fba32['as']===_0x1147('0x34')?_[_0x1147('0x35')](_0x5421f1):_0x4fba32['attributes'],'include':_0x4fba32[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x4fba32['include'],function(_0x42e492){return{'model':db[_0x42e492['model']],'as':_0x42e492['as'],'attributes':_0x42e492[_0x1147('0x1d')],'include':_0x42e492[_0x1147('0x1f')]?_[_0x1147('0x20')](_0x42e492[_0x1147('0x1f')],function(_0x2a0cd8){return{'model':db[_0x2a0cd8[_0x1147('0x24')]],'as':_0x2a0cd8['as'],'attributes':_0x2a0cd8[_0x1147('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1147('0x21')](function(_0x10c372){logger[_0x1147('0xd')]('GetCmHopper',_0x1962d0);logger[_0x1147('0x10')](_0x1147('0x17'),_0x1962d0,JSON[_0x1147('0x22')](_0x10c372));_0x4561a5(_0x10c372);})['catch'](function(_0xf1f1db){logger['error'](_0x1147('0x17'),_0xf1f1db[_0x1147('0x14')],_0x1962d0);_0xa37bb4(_0x151af6[_0x1147('0x12')](0x1f4,_0xf1f1db[_0x1147('0x14')]));});});});};exports[_0x1147('0x51')]=function(_0x501391){var _0x1db2b3=this;return new Promise(function(_0x514e29,_0x21d03b){return db[_0x1147('0x30')][_0x1147('0x31')](function(_0x1f52de){return db[_0x1147('0x18')][_0x1147('0x29')]({'active':![]},{'where':{},'transaction':_0x1f52de})[_0x1147('0x21')](function(_0x53abf3){logger[_0x1147('0xd')](_0x1147('0x51'),_0x501391);logger[_0x1147('0x10')](_0x1147('0x51'),_0x501391,JSON[_0x1147('0x22')](_0x53abf3));_0x514e29(_0x53abf3);})[_0x1147('0x16')](function(_0x224c56){logger[_0x1147('0x12')](_0x1147('0x51'),_0x224c56[_0x1147('0x14')],_0x501391);_0x21d03b(_0x1db2b3[_0x1147('0x12')](0x1f4,_0x224c56[_0x1147('0x14')]));});});});}; \ No newline at end of file +var _0x20df=['info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopper','findAll','options','raw','where','include','map','model','attributes','GetCmHopper','debug','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','limit','active','DestroyCmHopper','CmContact','describe','sequelize','transaction','UPDATE','Contact','keys','User','name','voicePause','includes','push','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','order','LOCK','length','ResetActiveCalls','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x4ae137,_0x5303c0){var _0x1e1820=function(_0x1473d0){while(--_0x1473d0){_0x4ae137['push'](_0x4ae137['shift']());}};_0x1e1820(++_0x5303c0);}(_0x20df,0xc8));var _0xf20d=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x20df[_0x43a37c];return _0x5d1d40;};'use strict';var _=require('lodash');var util=require(_0xf20d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf20d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf20d('0x2'))['db'];var utils=require(_0xf20d('0x3'));var logger=require(_0xf20d('0x4'))(_0xf20d('0x5'));var config=require(_0xf20d('0x6'));var jayson=require(_0xf20d('0x7'));var client=jayson[_0xf20d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22bda1,_0x81796f,_0x35b7d8){return new BPromise(function(_0x5e2a44,_0x39ec9a){return client['request'](_0x22bda1,_0x35b7d8)[_0xf20d('0x9')](function(_0x3f7da0){logger[_0xf20d('0xa')](_0xf20d('0xb'),_0x81796f,'request\x20sent');logger['debug'](_0xf20d('0xc'),_0x81796f,'request\x20sent',JSON[_0xf20d('0xd')](_0x3f7da0));if(_0x3f7da0[_0xf20d('0xe')]){if(_0x3f7da0[_0xf20d('0xe')]['code']===0x1f4){logger['error'](_0xf20d('0xb'),_0x81796f,_0x3f7da0[_0xf20d('0xe')][_0xf20d('0xf')]);return _0x39ec9a(_0x3f7da0['error'][_0xf20d('0xf')]);}logger[_0xf20d('0xe')](_0xf20d('0xb'),_0x81796f,_0x3f7da0[_0xf20d('0xe')][_0xf20d('0xf')]);return _0x5e2a44(_0x3f7da0[_0xf20d('0xe')][_0xf20d('0xf')]);}else{logger[_0xf20d('0xa')](_0xf20d('0xb'),_0x81796f,'request\x20sent');_0x5e2a44(_0x3f7da0[_0xf20d('0x10')]['message']);}})[_0xf20d('0x11')](function(_0x599725){logger[_0xf20d('0xe')](_0xf20d('0xb'),_0x81796f,_0x599725);_0x39ec9a(_0x599725);});});}exports['GetCmHopper']=function(_0x5b8ad5){var _0x456bba=this;return new Promise(function(_0x10b2a7,_0x508922){return db[_0xf20d('0x12')][_0xf20d('0x13')]({'raw':_0x5b8ad5[_0xf20d('0x14')]?_0x5b8ad5[_0xf20d('0x14')][_0xf20d('0x15')]===undefined?!![]:![]:!![],'where':_0x5b8ad5[_0xf20d('0x14')]?_0x5b8ad5[_0xf20d('0x14')][_0xf20d('0x16')]||null:null,'attributes':_0x5b8ad5['options']?_0x5b8ad5[_0xf20d('0x14')]['attributes']||null:null,'limit':_0x5b8ad5[_0xf20d('0x14')]?_0x5b8ad5[_0xf20d('0x14')]['limit']||null:null,'include':_0x5b8ad5['options']?_0x5b8ad5[_0xf20d('0x14')][_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x5b8ad5[_0xf20d('0x14')][_0xf20d('0x17')],function(_0x4b932d){return{'model':db[_0x4b932d[_0xf20d('0x19')]],'as':_0x4b932d['as'],'attributes':_0x4b932d[_0xf20d('0x1a')],'include':_0x4b932d['include']?_[_0xf20d('0x18')](_0x4b932d['include'],function(_0x262fa8){return{'model':db[_0x262fa8['model']],'as':_0x262fa8['as'],'attributes':_0x262fa8['attributes'],'include':_0x262fa8[_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x262fa8[_0xf20d('0x17')],function(_0x102589){return{'model':db[_0x102589[_0xf20d('0x19')]],'as':_0x102589['as'],'attributes':_0x102589[_0xf20d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48c9a7){logger[_0xf20d('0xa')](_0xf20d('0x1b'),_0x5b8ad5);logger[_0xf20d('0x1c')](_0xf20d('0x1b'),_0x5b8ad5,JSON['stringify'](_0x48c9a7));_0x10b2a7(_0x48c9a7);})[_0xf20d('0x11')](function(_0x30b3c1){logger[_0xf20d('0xe')](_0xf20d('0x1b'),_0x30b3c1[_0xf20d('0xf')],_0x5b8ad5);_0x508922(_0x456bba[_0xf20d('0xe')](0x1f4,_0x30b3c1[_0xf20d('0xf')]));});});};exports[_0xf20d('0x1d')]=function(_0x23ee44){var _0x22f314=this;return new Promise(function(_0x4eab0c,_0x44b525){return db['CmHopper']['find']({'raw':_0x23ee44['options']?_0x23ee44[_0xf20d('0x14')][_0xf20d('0x15')]===undefined?!![]:![]:!![],'where':_0x23ee44[_0xf20d('0x14')]?_0x23ee44[_0xf20d('0x14')]['where']||null:null,'attributes':_0x23ee44[_0xf20d('0x14')]?_0x23ee44[_0xf20d('0x14')][_0xf20d('0x1a')]||null:null,'include':_0x23ee44['options']?_0x23ee44[_0xf20d('0x14')][_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x23ee44['options']['include'],function(_0x45b821){return{'model':db[_0x45b821['model']],'as':_0x45b821['as'],'attributes':_0x45b821['attributes'],'include':_0x45b821[_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x45b821[_0xf20d('0x17')],function(_0x2afe62){return{'model':db[_0x2afe62[_0xf20d('0x19')]],'as':_0x2afe62['as'],'attributes':_0x2afe62[_0xf20d('0x1a')],'include':_0x2afe62['include']?_[_0xf20d('0x18')](_0x2afe62[_0xf20d('0x17')],function(_0x247445){return{'model':db[_0x247445[_0xf20d('0x19')]],'as':_0x247445['as'],'attributes':_0x247445['attributes']};}):[]};}):[]};}):[]:[]})[_0xf20d('0x9')](function(_0x3768fe){logger['info'](_0xf20d('0x1d'),_0x23ee44);logger['debug'](_0xf20d('0x1d'),_0x23ee44,JSON[_0xf20d('0xd')](_0x3768fe));_0x4eab0c(_0x3768fe);})['catch'](function(_0x22fb06){logger['error'](_0xf20d('0x1d'),_0x22fb06[_0xf20d('0xf')],_0x23ee44);_0x44b525(_0x22f314[_0xf20d('0xe')](0x1f4,_0x22fb06['message']));});});};exports[_0xf20d('0x1e')]=function(_0x4ef447){var _0x575b4f=this;return new Promise(function(_0x23ad45,_0xcaae5a){return db['CmHopper']['create'](_0x4ef447[_0xf20d('0x1f')],{'raw':_0x4ef447[_0xf20d('0x14')]?_0x4ef447[_0xf20d('0x14')][_0xf20d('0x15')]===undefined?!![]:![]:!![]})[_0xf20d('0x9')](function(_0x5c7f61){logger[_0xf20d('0xa')](_0xf20d('0x1e'),_0x4ef447);logger[_0xf20d('0x1c')](_0xf20d('0x1e'),_0x4ef447,JSON['stringify'](_0x5c7f61));_0x23ad45(_0x5c7f61);})[_0xf20d('0x11')](function(_0x49d38b){logger[_0xf20d('0xe')](_0xf20d('0x1e'),_0x49d38b['message'],_0x4ef447);_0xcaae5a(_0x575b4f[_0xf20d('0xe')](0x1f4,_0x49d38b['message']));});});};exports[_0xf20d('0x20')]=function(_0x17c4f7){var _0x475b83=this;return new Promise(function(_0x38aa9c,_0x4d3765){return db[_0xf20d('0x12')][_0xf20d('0x21')](_0x17c4f7[_0xf20d('0x1f')],{'raw':_0x17c4f7['options']?_0x17c4f7[_0xf20d('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c4f7['options']?_0x17c4f7[_0xf20d('0x14')][_0xf20d('0x16')]||null:null,'attributes':_0x17c4f7[_0xf20d('0x14')]?_0x17c4f7[_0xf20d('0x14')][_0xf20d('0x1a')]||null:null,'limit':_0x17c4f7[_0xf20d('0x14')]?_0x17c4f7[_0xf20d('0x14')][_0xf20d('0x22')]||null:null})[_0xf20d('0x9')](function(_0x3797f0){logger[_0xf20d('0xa')](_0xf20d('0x20'),_0x17c4f7);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x17c4f7['options'][_0xf20d('0x16')]),_0x17c4f7[_0xf20d('0x1f')][_0xf20d('0x23')]);logger[_0xf20d('0x1c')](_0xf20d('0x20'),_0x17c4f7,JSON[_0xf20d('0xd')](_0x3797f0));_0x38aa9c(_0x3797f0);})[_0xf20d('0x11')](function(_0x3314fc){logger[_0xf20d('0xe')](_0xf20d('0x20'),_0x3314fc[_0xf20d('0xf')],_0x17c4f7);_0x4d3765(_0x475b83[_0xf20d('0xe')](0x1f4,_0x3314fc[_0xf20d('0xf')]));});});};exports[_0xf20d('0x24')]=function(_0x3a6440){var _0x325e3d=this;return new Promise(function(_0x513ad5,_0x33dedd){return db[_0xf20d('0x12')]['destroy']({'where':_0x3a6440[_0xf20d('0x14')]?_0x3a6440[_0xf20d('0x14')][_0xf20d('0x16')]||null:null})[_0xf20d('0x9')](function(_0x10395d){logger[_0xf20d('0xa')](_0xf20d('0x24'),_0x3a6440);logger[_0xf20d('0x1c')](_0xf20d('0x24'),_0x3a6440,JSON[_0xf20d('0xd')](_0x10395d));_0x513ad5(_0x10395d);})['catch'](function(_0x63bc06){logger[_0xf20d('0xe')](_0xf20d('0x24'),_0x63bc06[_0xf20d('0xf')],_0x3a6440);_0x33dedd(_0x325e3d['error'](0x1f4,_0x63bc06[_0xf20d('0xf')]));});});};exports['GetContactDialer']=function(_0x30d578){var _0x425c6c=this;return new Promise(function(_0x1d08f0,_0x44a571){return db[_0xf20d('0x25')][_0xf20d('0x26')]()[_0xf20d('0x9')](function(_0x38dd5f){return db[_0xf20d('0x27')][_0xf20d('0x28')](function(_0x331d93){return db['CmHopper'][_0xf20d('0x13')]({'where':_0x30d578[_0xf20d('0x14')]?_0x30d578[_0xf20d('0x14')][_0xf20d('0x16')]||null:null,'attributes':_0x30d578[_0xf20d('0x14')]?_0x30d578['options']['attributes']||null:null,'limit':_0x30d578[_0xf20d('0x14')]?_0x30d578[_0xf20d('0x14')][_0xf20d('0x22')]||null:null,'order':_0x30d578[_0xf20d('0x14')]?_0x30d578[_0xf20d('0x14')]['order']||null:null,'transaction':_0x331d93,'lock':_0x331d93['LOCK'][_0xf20d('0x29')],'include':[{'model':db[_0xf20d('0x25')],'as':_0xf20d('0x2a'),'attributes':_[_0xf20d('0x2b')](_0x38dd5f)},{'model':db[_0xf20d('0x2c')],'as':'Agent','attributes':['id',_0xf20d('0x2d'),_0xf20d('0x2e')]}]})[_0xf20d('0x9')](function(_0x535e62){var _0x5d65f8=[];var _0x58421c=[];for(var _0x32574c=0x0;_0x32574c<_0x535e62['length'];_0x32574c+=0x1){var _0x5a7975=_0x535e62[_0x32574c]['UserId'];if(_0x5a7975===null){_0x5d65f8['push'](_0x535e62[_0x32574c][_0xf20d('0x21')](_0x30d578[_0xf20d('0x1f')],{'transaction':_0x331d93}));}else if(!_0x58421c[_0xf20d('0x2f')](_0x5a7975)){_0x58421c[_0xf20d('0x30')](_0x5a7975);_0x5d65f8[_0xf20d('0x30')](_0x535e62[_0x32574c][_0xf20d('0x21')](_0x30d578[_0xf20d('0x1f')],{'transaction':_0x331d93}));}}return BPromise[_0xf20d('0x31')](_0x5d65f8);});})[_0xf20d('0x9')](function(_0x32247a){logger['info'](_0xf20d('0x32'),_0x30d578);if(_0x32247a['length']>0x0){logger[_0xf20d('0xa')](_0xf20d('0x33'),_0x32247a[0x0][_0xf20d('0x34')]['id'],_0x32247a[0x0][_0xf20d('0x34')][_0xf20d('0x35')],_0x32247a[0x0][_0xf20d('0x34')][_0xf20d('0x23')]);}logger[_0xf20d('0x1c')](_0xf20d('0x32'),_0x30d578,JSON[_0xf20d('0xd')](_0x32247a));_0x1d08f0(_0x32247a);})[_0xf20d('0x11')](function(_0x465907){logger[_0xf20d('0xe')](_0xf20d('0x32'),_0x465907[_0xf20d('0xf')],_0x30d578);_0x44a571(_0x425c6c['error'](0x1f4,_0x465907['message']));});});});};exports[_0xf20d('0x36')]=function(_0x53fb2a){var _0x56e365=this;return new Promise(function(_0x2710f9,_0x2fa20b){return db[_0xf20d('0x27')]['transaction'](function(_0x1d31cc){return db[_0xf20d('0x37')]['create'](_0x53fb2a[_0xf20d('0x1f')],{'raw':_0x53fb2a['options']?_0x53fb2a[_0xf20d('0x14')][_0xf20d('0x15')]===undefined?!![]:![]:!![],'transaction':_0x1d31cc})['then'](function(){logger[_0xf20d('0xa')](_0xf20d('0x38'),JSON[_0xf20d('0xd')](_0x53fb2a[_0xf20d('0x14')][_0xf20d('0x16')]),_0x53fb2a[_0xf20d('0x14')][_0xf20d('0x16')]['active']);return db[_0xf20d('0x12')][_0xf20d('0x39')]({'where':_0x53fb2a[_0xf20d('0x14')]?_0x53fb2a[_0xf20d('0x14')]['where']||null:null,'transaction':_0x1d31cc});});})[_0xf20d('0x9')](function(_0x33c5fc){logger['info'](_0xf20d('0x36'),_0x53fb2a);logger[_0xf20d('0x1c')](_0xf20d('0x36'),_0x53fb2a,JSON[_0xf20d('0xd')](_0x33c5fc));_0x2710f9(_0x33c5fc);})[_0xf20d('0x11')](function(_0x44f1bb){logger[_0xf20d('0xe')](_0xf20d('0x36'),_0x44f1bb['message'],_0x53fb2a);_0x2fa20b(_0x56e365[_0xf20d('0xe')](0x1f4,_0x44f1bb[_0xf20d('0xf')]));});});};exports[_0xf20d('0x3a')]=function(_0x12dacc){var _0x450c33=this;return new Promise(function(_0x25495d,_0xaefd7b){return db[_0xf20d('0x12')][_0xf20d('0x13')]({'raw':_0x12dacc[_0xf20d('0x14')]?_0x12dacc[_0xf20d('0x14')][_0xf20d('0x15')]===undefined?!![]:![]:!![],'where':_0x12dacc[_0xf20d('0x14')]?_0x12dacc[_0xf20d('0x14')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xf20d('0x3b'),db[_0xf20d('0x27')]['fn']('IF',db['sequelize']['literal'](_0xf20d('0x3c')+util[_0xf20d('0x3d')](_0xf20d('0x3e'),moment()[_0xf20d('0x3d')](_0xf20d('0x3f')))+_0xf20d('0x40')))),'contactsRescheduled']]})['then'](function(_0x2613d0){logger[_0xf20d('0xa')]('CountReScheduled',_0x12dacc);logger[_0xf20d('0x1c')](_0xf20d('0x3a'),_0x12dacc,JSON[_0xf20d('0xd')](_0x2613d0));_0x25495d(_0x2613d0);})['catch'](function(_0x3dda1f){logger[_0xf20d('0xe')](_0xf20d('0x3a'),_0x3dda1f['message'],_0x12dacc);_0xaefd7b(_0x450c33[_0xf20d('0xe')](0x1f4,_0x3dda1f['message']));});});};exports[_0xf20d('0x41')]=function(_0x15622a){var _0x4fb15c=this;return new Promise(function(_0x1316ab,_0x2e698e){return db[_0xf20d('0x25')][_0xf20d('0x26')]()['then'](function(_0x354d9c){return db['sequelize']['transaction'](function(_0x58f22d){return db[_0xf20d('0x12')][_0xf20d('0x13')]({'where':_0x15622a[_0xf20d('0x14')]?_0x15622a['options'][_0xf20d('0x16')]||null:null,'attributes':_0x15622a[_0xf20d('0x14')]?_0x15622a[_0xf20d('0x14')][_0xf20d('0x1a')]||null:null,'limit':0x1,'order':_0x15622a[_0xf20d('0x14')]?_0x15622a[_0xf20d('0x14')][_0xf20d('0x42')]||null:null,'group':db[_0xf20d('0x12')]['UserId'],'transaction':_0x58f22d,'lock':_0x58f22d[_0xf20d('0x43')][_0xf20d('0x29')],'include':_0x15622a[_0xf20d('0x14')]?_0x15622a[_0xf20d('0x14')][_0xf20d('0x17')]?_['map'](_0x15622a['options'][_0xf20d('0x17')],function(_0x3f1bee){return{'model':db[_0x3f1bee[_0xf20d('0x19')]],'as':_0x3f1bee['as'],'attributes':_0x3f1bee[_0xf20d('0x1a')],'include':_0x3f1bee[_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x3f1bee[_0xf20d('0x17')],function(_0x266c97){return{'model':db[_0x266c97[_0xf20d('0x19')]],'as':_0x266c97['as'],'attributes':_0x266c97[_0xf20d('0x1a')],'include':_0x266c97[_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x266c97[_0xf20d('0x17')],function(_0x194f8b){return{'model':db[_0x194f8b[_0xf20d('0x19')]],'as':_0x194f8b['as'],'attributes':_0x194f8b[_0xf20d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf20d('0x9')](function(_0x14ec18){var _0x38fceb=[];for(var _0x2dd9f2=0x0;_0x2dd9f2<_0x14ec18[_0xf20d('0x44')];_0x2dd9f2+=0x1){_0x38fceb[_0xf20d('0x30')](_0x14ec18[_0x2dd9f2]['update'](_0x15622a[_0xf20d('0x1f')],{'transaction':_0x58f22d}));}return BPromise[_0xf20d('0x31')](_0x38fceb);});})[_0xf20d('0x9')](function(_0x374b35){logger[_0xf20d('0xa')]('GetContactRecallMe',_0x15622a);logger[_0xf20d('0x1c')](_0xf20d('0x41'),_0x15622a,JSON['stringify'](_0x374b35));_0x1316ab(_0x374b35);})[_0xf20d('0x11')](function(_0x4700be){logger[_0xf20d('0xe')](_0xf20d('0x41'),_0x4700be['message'],_0x15622a);_0x2e698e(_0x4fb15c[_0xf20d('0xe')](0x1f4,_0x4700be[_0xf20d('0xf')]));});});});};exports['GetCmHopperPreview']=function(_0x7cf8a8){var _0x3e12a5=this;return new Promise(function(_0x44bff1,_0x129ca9){db[_0xf20d('0x25')][_0xf20d('0x26')]()[_0xf20d('0x9')](function(_0x146b1b){return db['CmHopper']['findAll']({'raw':_0x7cf8a8[_0xf20d('0x14')]?_0x7cf8a8[_0xf20d('0x14')][_0xf20d('0x15')]===undefined?!![]:![]:!![],'where':_0x7cf8a8[_0xf20d('0x14')]?_0x7cf8a8['options'][_0xf20d('0x16')]||null:null,'attributes':_0x7cf8a8[_0xf20d('0x14')]?_0x7cf8a8[_0xf20d('0x14')][_0xf20d('0x1a')]||null:null,'limit':_0x7cf8a8['options']?_0x7cf8a8[_0xf20d('0x14')][_0xf20d('0x22')]||null:null,'include':_0x7cf8a8[_0xf20d('0x14')]?_0x7cf8a8[_0xf20d('0x14')][_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x7cf8a8['options'][_0xf20d('0x17')],function(_0x33c7d9){return{'model':db[_0x33c7d9['model']],'as':_0x33c7d9['as'],'attributes':_0x33c7d9['as']===_0xf20d('0x2a')?_[_0xf20d('0x2b')](_0x146b1b):_0x33c7d9[_0xf20d('0x1a')],'include':_0x33c7d9[_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x33c7d9[_0xf20d('0x17')],function(_0x2893f0){return{'model':db[_0x2893f0[_0xf20d('0x19')]],'as':_0x2893f0['as'],'attributes':_0x2893f0[_0xf20d('0x1a')],'include':_0x2893f0[_0xf20d('0x17')]?_[_0xf20d('0x18')](_0x2893f0['include'],function(_0x40037b){return{'model':db[_0x40037b['model']],'as':_0x40037b['as'],'attributes':_0x40037b[_0xf20d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf20d('0x9')](function(_0x1918f9){logger[_0xf20d('0xa')]('GetCmHopper',_0x7cf8a8);logger[_0xf20d('0x1c')](_0xf20d('0x1b'),_0x7cf8a8,JSON[_0xf20d('0xd')](_0x1918f9));_0x44bff1(_0x1918f9);})[_0xf20d('0x11')](function(_0xbaa00b){logger[_0xf20d('0xe')](_0xf20d('0x1b'),_0xbaa00b['message'],_0x7cf8a8);_0x129ca9(_0x3e12a5[_0xf20d('0xe')](0x1f4,_0xbaa00b['message']));});});});};exports[_0xf20d('0x45')]=function(_0xd01547){var _0x50c749=this;return new Promise(function(_0x1b297d,_0x57a066){return db[_0xf20d('0x27')][_0xf20d('0x28')](function(_0x767754){return db[_0xf20d('0x12')][_0xf20d('0x21')]({'active':![]},{'where':{},'transaction':_0x767754})[_0xf20d('0x9')](function(_0xcff33f){logger['info'](_0xf20d('0x45'),_0xd01547);logger[_0xf20d('0x1c')](_0xf20d('0x45'),_0xd01547,JSON['stringify'](_0xcff33f));_0x1b297d(_0xcff33f);})['catch'](function(_0x24389f){logger[_0xf20d('0xe')]('ResetActiveCalls',_0x24389f[_0xf20d('0xf')],_0xd01547);_0x57a066(_0x50c749[_0xf20d('0xe')](0x1f4,_0x24389f[_0xf20d('0xf')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 9eff6d3..dbb0107 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 _0x23b2=['getOpenContacts','post','create','/preview','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts'];(function(_0x21c9fa,_0x3877c1){var _0xd2aa9a=function(_0x276efe){while(--_0x276efe){_0x21c9fa['push'](_0x21c9fa['shift']());}};_0xd2aa9a(++_0x3877c1);}(_0x23b2,0x1d6));var _0x223b=function(_0x530bb1,_0xfadb4){_0x530bb1=_0x530bb1-0x0;var _0x6999d5=_0x23b2[_0x530bb1];return _0x6999d5;};'use strict';var multer=require(_0x223b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x223b('0x1'));var express=require(_0x223b('0x2'));var router=express[_0x223b('0x3')]();var fs_extra=require(_0x223b('0x4'));var auth=require(_0x223b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x223b('0x6'));router[_0x223b('0x7')]('/',auth[_0x223b('0x8')](),controller[_0x223b('0x9')]);router['get'](_0x223b('0xa'),auth[_0x223b('0x8')](),controller[_0x223b('0xb')]);router[_0x223b('0x7')](_0x223b('0xc'),auth[_0x223b('0x8')](),controller[_0x223b('0xd')]);router[_0x223b('0x7')]('/:id',auth[_0x223b('0x8')](),controller['show']);router[_0x223b('0xe')]('/',auth[_0x223b('0x8')](),controller[_0x223b('0xf')]);router[_0x223b('0xe')](_0x223b('0x10'),auth[_0x223b('0x8')](),controller['getPreview']);router[_0x223b('0x11')](_0x223b('0x12'),auth[_0x223b('0x8')](),controller[_0x223b('0x13')]);router[_0x223b('0x14')](_0x223b('0x12'),auth[_0x223b('0x8')](),controller[_0x223b('0x15')]);module[_0x223b('0x16')]=router; \ No newline at end of file +var _0x8d02=['post','create','put','delete','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','/:id','show'];(function(_0xc8c303,_0x355e4a){var _0x3f16dc=function(_0x41feaf){while(--_0x41feaf){_0xc8c303['push'](_0xc8c303['shift']());}};_0x3f16dc(++_0x355e4a);}(_0x8d02,0xa4));var _0x28d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8d02[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x28d0('0x0'));var util=require(_0x28d0('0x1'));var path=require('path');var timeout=require(_0x28d0('0x2'));var express=require(_0x28d0('0x3'));var router=express[_0x28d0('0x4')]();var fs_extra=require(_0x28d0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x28d0('0x6'));var controller=require(_0x28d0('0x7'));router['get']('/',auth[_0x28d0('0x8')](),controller[_0x28d0('0x9')]);router[_0x28d0('0xa')](_0x28d0('0xb'),auth[_0x28d0('0x8')](),controller[_0x28d0('0xc')]);router[_0x28d0('0xa')](_0x28d0('0xd'),auth[_0x28d0('0x8')](),controller['getOpenContacts']);router[_0x28d0('0xa')](_0x28d0('0xe'),auth[_0x28d0('0x8')](),controller[_0x28d0('0xf')]);router[_0x28d0('0x10')]('/',auth['isAuthenticated'](),controller[_0x28d0('0x11')]);router['post']('/preview',auth[_0x28d0('0x8')](),controller['getPreview']);router[_0x28d0('0x12')](_0x28d0('0xe'),auth[_0x28d0('0x8')](),controller['update']);router[_0x28d0('0x13')](_0x28d0('0xe'),auth[_0x28d0('0x8')](),controller['destroy']);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 f55cd2a..399fbc3 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 _0x7556=['INTEGER','contactListQueue','STRING'];(function(_0x20643c,_0x143832){var _0x3a43f1=function(_0x4ba4ab){while(--_0x4ba4ab){_0x20643c['push'](_0x20643c['shift']());}};_0x3a43f1(++_0x143832);}(_0x7556,0x188));var _0x6755=function(_0x57dfc3,_0x10b9ba){_0x57dfc3=_0x57dfc3-0x0;var _0x329aad=_0x7556[_0x57dfc3];return _0x329aad;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x6755('0x0')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6755('0x1')],'unique':_0x6755('0x2')},'ListId':{'type':Sequelize[_0x6755('0x1')],'unique':_0x6755('0x2')},'VoiceQueueId':{'type':Sequelize[_0x6755('0x1')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x2e65=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x58ca49,_0x10549){var _0x530eee=function(_0xa6f39b){while(--_0xa6f39b){_0x58ca49['push'](_0x58ca49['shift']());}};_0x530eee(++_0x10549);}(_0x2e65,0x193));var _0x52e6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2e65[_0x21a9d9];return _0x46adce;};'use strict';var moment=require(_0x52e6('0x0'));var Sequelize=require(_0x52e6('0x1'));module[_0x52e6('0x2')]={'phone':{'type':Sequelize[_0x52e6('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x52e6('0x4')],'unique':_0x52e6('0x5')},'ListId':{'type':Sequelize[_0x52e6('0x4')],'unique':_0x52e6('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x52e6('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index f153230..e65df52 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 _0x1900=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','CmHopperBlack','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x194cf8,_0x536123){var _0x17444f=function(_0x20be73){while(--_0x20be73){_0x194cf8['push'](_0x194cf8['shift']());}};_0x17444f(++_0x536123);}(_0x1900,0x76));var _0x0190=function(_0x3e60b1,_0x265bc7){_0x3e60b1=_0x3e60b1-0x0;var _0x9263e2=_0x1900[_0x3e60b1];return _0x9263e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0190('0x0'));var zipdir=require(_0x0190('0x1'));var jsonpatch=require(_0x0190('0x2'));var rp=require('request-promise');var moment=require(_0x0190('0x3'));var BPromise=require(_0x0190('0x4'));var Mustache=require('mustache');var util=require(_0x0190('0x5'));var path=require(_0x0190('0x6'));var sox=require(_0x0190('0x7'));var csv=require(_0x0190('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0190('0x9'));var _=require(_0x0190('0xa'));var squel=require(_0x0190('0xb'));var crypto=require(_0x0190('0xc'));var jsforce=require(_0x0190('0xd'));var deskjs=require(_0x0190('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0190('0xf'));var Redis=require(_0x0190('0x10'));var authService=require(_0x0190('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0190('0x12'));var logger=require(_0x0190('0x13'))(_0x0190('0x14'));var utils=require(_0x0190('0x15'));var config=require(_0x0190('0x16'));var licenseUtil=require(_0x0190('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4098b5,_0x3f7765){_0x3f7765=_0x3f7765||0xcc;return function(_0x18e133){if(_0x18e133){return _0x4098b5[_0x0190('0x18')](_0x3f7765);}return _0x4098b5[_0x0190('0x19')](_0x3f7765)[_0x0190('0x1a')]();};}function respondWithResult(_0x51af9b,_0x50f6d9){_0x50f6d9=_0x50f6d9||0xc8;return function(_0x48d419){if(_0x48d419){return _0x51af9b[_0x0190('0x19')](_0x50f6d9)[_0x0190('0x1b')](_0x48d419);}};}function respondWithFilteredResult(_0xeab56a,_0xeb69ad){return function(_0x3acf38){if(_0x3acf38){var _0x5be263=typeof _0xeb69ad[_0x0190('0x1c')]===_0x0190('0x1d')&&typeof _0xeb69ad[_0x0190('0x1e')]===_0x0190('0x1d');var _0x550e3a=_0x3acf38['count'];var _0x1755f8=_0x5be263?0x0:_0xeb69ad[_0x0190('0x1c')];var _0x375e75=_0x5be263?_0x3acf38[_0x0190('0x1f')]:_0xeb69ad[_0x0190('0x1c')]+_0xeb69ad[_0x0190('0x1e')];var _0x4c5367;if(_0x375e75>=_0x550e3a){_0x375e75=_0x550e3a;_0x4c5367=0xc8;}else{_0x4c5367=0xce;}_0xeab56a[_0x0190('0x19')](_0x4c5367);return _0xeab56a[_0x0190('0x20')](_0x0190('0x21'),_0x1755f8+'-'+_0x375e75+'/'+_0x550e3a)[_0x0190('0x1b')](_0x3acf38);}return null;};}function patchUpdates(_0xcc67c0){return function(_0x128c0a){try{jsonpatch[_0x0190('0x22')](_0x128c0a,_0xcc67c0,!![]);}catch(_0x2b3467){return BPromise[_0x0190('0x23')](_0x2b3467);}return _0x128c0a[_0x0190('0x24')]();};}function saveUpdates(_0x1a50dd,_0x11736f){return function(_0x1ccca5){if(_0x1ccca5){return _0x1ccca5[_0x0190('0x25')](_0x1a50dd)[_0x0190('0x26')](function(_0x28ba0d){return _0x28ba0d;});}return null;};}function removeEntity(_0xe3f042,_0x4b2505){return function(_0x580869){if(_0x580869){return _0x580869[_0x0190('0x27')]()[_0x0190('0x26')](function(){_0xe3f042[_0x0190('0x19')](0xcc)[_0x0190('0x1a')]();});}};}function handleEntityNotFound(_0x418957,_0x33b801){return function(_0xe43b92){if(!_0xe43b92){_0x418957[_0x0190('0x18')](0x194);}return _0xe43b92;};}function handleError(_0x2ee78d,_0x211197){_0x211197=_0x211197||0x1f4;return function(_0x3a4944){logger[_0x0190('0x28')](_0x3a4944[_0x0190('0x29')]);if(_0x3a4944['name']){delete _0x3a4944[_0x0190('0x2a')];}_0x2ee78d[_0x0190('0x19')](_0x211197)['send'](_0x3a4944);};}exports[_0x0190('0x2b')]=function(_0x1007b1,_0x1ea5d5){var _0x1673a9={},_0x4ed879={},_0x11b214={'count':0x0,'rows':[]};var _0x289ff5=_[_0x0190('0x2c')](db['CmHopperBlack']['rawAttributes'],function(_0x1f6981){return{'name':_0x1f6981[_0x0190('0x2d')],'type':_0x1f6981[_0x0190('0x2e')]['key']};});_0x4ed879[_0x0190('0x2f')]=_[_0x0190('0x2c')](_0x289ff5,_0x0190('0x2a'));_0x4ed879[_0x0190('0x30')]=_[_0x0190('0x31')](_0x1007b1[_0x0190('0x30')]);_0x4ed879[_0x0190('0x32')]=_[_0x0190('0x33')](_0x4ed879[_0x0190('0x2f')],_0x4ed879[_0x0190('0x30')]);_0x1673a9[_0x0190('0x34')]=_[_0x0190('0x33')](_0x4ed879[_0x0190('0x2f')],qs[_0x0190('0x35')](_0x1007b1[_0x0190('0x30')][_0x0190('0x35')]));_0x1673a9[_0x0190('0x34')]=_0x1673a9[_0x0190('0x34')][_0x0190('0x36')]?_0x1673a9[_0x0190('0x34')]:_0x4ed879[_0x0190('0x2f')];if(!_0x1007b1['query'][_0x0190('0x37')](_0x0190('0x38'))){_0x1673a9[_0x0190('0x1e')]=qs[_0x0190('0x1e')](_0x1007b1[_0x0190('0x30')][_0x0190('0x1e')]);_0x1673a9[_0x0190('0x1c')]=qs[_0x0190('0x1c')](_0x1007b1['query']['offset']);}_0x1673a9['order']=qs[_0x0190('0x39')](_0x1007b1[_0x0190('0x30')]['sort']);_0x1673a9['where']=qs[_0x0190('0x32')](_[_0x0190('0x3a')](_0x1007b1['query'],_0x4ed879[_0x0190('0x32')]),_0x289ff5);if(_0x1007b1[_0x0190('0x30')][_0x0190('0x3b')]){_0x1673a9['where']=_[_0x0190('0x3c')](_0x1673a9['where'],{'$or':_[_0x0190('0x2c')](_0x289ff5,function(_0x515c19){if(_0x515c19[_0x0190('0x2e')]!=='VIRTUAL'){var _0x4a953a={};_0x4a953a[_0x515c19[_0x0190('0x2a')]]={'$like':'%'+_0x1007b1[_0x0190('0x30')]['filter']+'%'};return _0x4a953a;}})});}_0x1673a9=_['merge']({},_0x1673a9,_0x1007b1['options']);var _0x47025e={'where':_0x1673a9[_0x0190('0x3d')]};return db[_0x0190('0x3e')][_0x0190('0x1f')](_0x47025e)[_0x0190('0x26')](function(_0x584809){_0x11b214[_0x0190('0x1f')]=_0x584809;if(_0x1007b1[_0x0190('0x30')][_0x0190('0x3f')]){_0x1673a9[_0x0190('0x40')]=[{'all':!![]}];}return db[_0x0190('0x3e')][_0x0190('0x41')](_0x1673a9);})['then'](function(_0x2051af){_0x11b214[_0x0190('0x42')]=_0x2051af;return _0x11b214;})[_0x0190('0x26')](respondWithFilteredResult(_0x1ea5d5,_0x1673a9))[_0x0190('0x43')](handleError(_0x1ea5d5,null));};exports[_0x0190('0x44')]=function(_0x4d1d6d,_0x3ccaab){var _0x2acdd4={'raw':!![],'where':{'id':_0x4d1d6d[_0x0190('0x45')]['id']}},_0x25c9f2={};_0x25c9f2['model']=_[_0x0190('0x31')](db[_0x0190('0x3e')][_0x0190('0x46')]);_0x25c9f2[_0x0190('0x30')]=_[_0x0190('0x31')](_0x4d1d6d[_0x0190('0x30')]);_0x25c9f2[_0x0190('0x32')]=_['intersection'](_0x25c9f2[_0x0190('0x2f')],_0x25c9f2[_0x0190('0x30')]);_0x2acdd4[_0x0190('0x34')]=_[_0x0190('0x33')](_0x25c9f2[_0x0190('0x2f')],qs['fields'](_0x4d1d6d[_0x0190('0x30')][_0x0190('0x35')]));_0x2acdd4[_0x0190('0x34')]=_0x2acdd4[_0x0190('0x34')]['length']?_0x2acdd4[_0x0190('0x34')]:_0x25c9f2[_0x0190('0x2f')];if(_0x4d1d6d['query'][_0x0190('0x3f')]){_0x2acdd4[_0x0190('0x40')]=[{'all':!![]}];}_0x2acdd4=_[_0x0190('0x3c')]({},_0x2acdd4,_0x4d1d6d[_0x0190('0x47')]);return db[_0x0190('0x3e')][_0x0190('0x48')](_0x2acdd4)[_0x0190('0x26')](handleEntityNotFound(_0x3ccaab,null))['then'](respondWithResult(_0x3ccaab,null))[_0x0190('0x43')](handleError(_0x3ccaab,null));};exports['update']=function(_0x4b57c2,_0x27a845){if(_0x4b57c2[_0x0190('0x49')]['id']){delete _0x4b57c2[_0x0190('0x49')]['id'];}return db[_0x0190('0x3e')][_0x0190('0x48')]({'where':{'id':_0x4b57c2[_0x0190('0x45')]['id']}})[_0x0190('0x26')](handleEntityNotFound(_0x27a845,null))['then'](saveUpdates(_0x4b57c2[_0x0190('0x49')],null))[_0x0190('0x26')](respondWithResult(_0x27a845,null))[_0x0190('0x43')](handleError(_0x27a845,null));};exports['destroy']=function(_0x1a224f,_0x1c18fc){return db[_0x0190('0x3e')][_0x0190('0x48')]({'where':{'id':_0x1a224f[_0x0190('0x45')]['id']}})[_0x0190('0x26')](handleEntityNotFound(_0x1c18fc,null))['then'](removeEntity(_0x1c18fc,null))['catch'](handleError(_0x1c18fc,null));};exports[_0x0190('0x4a')]=function(_0x2f308e,_0x519383){return db[_0x0190('0x3e')][_0x0190('0x4a')]()['then'](respondWithResult(_0x519383,null))[_0x0190('0x43')](handleError(_0x519383,null));}; \ No newline at end of file +var _0x484d=['catch','show','params','rawAttributes','find','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','end','status','json','undefined','limit','count','offset','set','apply','save','then','destroy','stack','name','send','index','map','CmHopperBlack','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x56608c,_0x29eb74){var _0x3c7fb0=function(_0x154b1c){while(--_0x154b1c){_0x56608c['push'](_0x56608c['shift']());}};_0x3c7fb0(++_0x29eb74);}(_0x484d,0x165));var _0xd484=function(_0x59a1d8,_0x55a556){_0x59a1d8=_0x59a1d8-0x0;var _0x374ccd=_0x484d[_0x59a1d8];return _0x374ccd;};'use strict';var emlformat=require(_0xd484('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd484('0x1'));var rp=require(_0xd484('0x2'));var moment=require(_0xd484('0x3'));var BPromise=require(_0xd484('0x4'));var Mustache=require(_0xd484('0x5'));var util=require(_0xd484('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd484('0x7'));var ejs=require(_0xd484('0x8'));var fs=require('fs');var fs_extra=require(_0xd484('0x9'));var _=require(_0xd484('0xa'));var squel=require('squel');var crypto=require(_0xd484('0xb'));var jsforce=require(_0xd484('0xc'));var deskjs=require(_0xd484('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd484('0xe'));var Papa=require(_0xd484('0xf'));var Redis=require('ioredis');var authService=require(_0xd484('0x10'));var qs=require(_0xd484('0x11'));var as=require(_0xd484('0x12'));var hardwareService=require(_0xd484('0x13'));var logger=require(_0xd484('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd484('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49e3fb,_0x16aa0c){_0x16aa0c=_0x16aa0c||0xcc;return function(_0xf1cd47){if(_0xf1cd47){return _0x49e3fb['sendStatus'](_0x16aa0c);}return _0x49e3fb['status'](_0x16aa0c)[_0xd484('0x16')]();};}function respondWithResult(_0x250936,_0x2df694){_0x2df694=_0x2df694||0xc8;return function(_0x4edb53){if(_0x4edb53){return _0x250936[_0xd484('0x17')](_0x2df694)[_0xd484('0x18')](_0x4edb53);}};}function respondWithFilteredResult(_0x271205,_0x10c649){return function(_0x5ad5fb){if(_0x5ad5fb){var _0xecf180=typeof _0x10c649['offset']===_0xd484('0x19')&&typeof _0x10c649[_0xd484('0x1a')]==='undefined';var _0x44fe68=_0x5ad5fb[_0xd484('0x1b')];var _0x565ea2=_0xecf180?0x0:_0x10c649[_0xd484('0x1c')];var _0x5a8071=_0xecf180?_0x5ad5fb[_0xd484('0x1b')]:_0x10c649[_0xd484('0x1c')]+_0x10c649[_0xd484('0x1a')];var _0x5ba0e1;if(_0x5a8071>=_0x44fe68){_0x5a8071=_0x44fe68;_0x5ba0e1=0xc8;}else{_0x5ba0e1=0xce;}_0x271205[_0xd484('0x17')](_0x5ba0e1);return _0x271205[_0xd484('0x1d')]('Content-Range',_0x565ea2+'-'+_0x5a8071+'/'+_0x44fe68)[_0xd484('0x18')](_0x5ad5fb);}return null;};}function patchUpdates(_0x490be2){return function(_0x5012c9){try{jsonpatch[_0xd484('0x1e')](_0x5012c9,_0x490be2,!![]);}catch(_0x56ed2c){return BPromise['reject'](_0x56ed2c);}return _0x5012c9[_0xd484('0x1f')]();};}function saveUpdates(_0x2667f3,_0x51228b){return function(_0x3ccf61){if(_0x3ccf61){return _0x3ccf61['update'](_0x2667f3)[_0xd484('0x20')](function(_0xd5df1e){return _0xd5df1e;});}return null;};}function removeEntity(_0x28e2c8,_0x53e57a){return function(_0xe98b69){if(_0xe98b69){return _0xe98b69[_0xd484('0x21')]()[_0xd484('0x20')](function(){_0x28e2c8[_0xd484('0x17')](0xcc)[_0xd484('0x16')]();});}};}function handleEntityNotFound(_0x1ae59c,_0x4171f8){return function(_0x35d6a1){if(!_0x35d6a1){_0x1ae59c['sendStatus'](0x194);}return _0x35d6a1;};}function handleError(_0x2eefd4,_0x485c5b){_0x485c5b=_0x485c5b||0x1f4;return function(_0x5661e1){logger['error'](_0x5661e1[_0xd484('0x22')]);if(_0x5661e1[_0xd484('0x23')]){delete _0x5661e1['name'];}_0x2eefd4[_0xd484('0x17')](_0x485c5b)[_0xd484('0x24')](_0x5661e1);};}exports[_0xd484('0x25')]=function(_0xf80a23,_0x41afdb){var _0x3e21c5={},_0xf525d2={},_0x2bb2cc={'count':0x0,'rows':[]};var _0x4e566b=_[_0xd484('0x26')](db[_0xd484('0x27')]['rawAttributes'],function(_0x791383){return{'name':_0x791383[_0xd484('0x28')],'type':_0x791383[_0xd484('0x29')]['key']};});_0xf525d2[_0xd484('0x2a')]=_['map'](_0x4e566b,_0xd484('0x23'));_0xf525d2[_0xd484('0x2b')]=_['keys'](_0xf80a23[_0xd484('0x2b')]);_0xf525d2[_0xd484('0x2c')]=_[_0xd484('0x2d')](_0xf525d2[_0xd484('0x2a')],_0xf525d2[_0xd484('0x2b')]);_0x3e21c5[_0xd484('0x2e')]=_[_0xd484('0x2d')](_0xf525d2[_0xd484('0x2a')],qs[_0xd484('0x2f')](_0xf80a23[_0xd484('0x2b')][_0xd484('0x2f')]));_0x3e21c5[_0xd484('0x2e')]=_0x3e21c5[_0xd484('0x2e')][_0xd484('0x30')]?_0x3e21c5[_0xd484('0x2e')]:_0xf525d2[_0xd484('0x2a')];if(!_0xf80a23['query'][_0xd484('0x31')](_0xd484('0x32'))){_0x3e21c5[_0xd484('0x1a')]=qs[_0xd484('0x1a')](_0xf80a23[_0xd484('0x2b')][_0xd484('0x1a')]);_0x3e21c5['offset']=qs[_0xd484('0x1c')](_0xf80a23['query'][_0xd484('0x1c')]);}_0x3e21c5[_0xd484('0x33')]=qs[_0xd484('0x34')](_0xf80a23[_0xd484('0x2b')][_0xd484('0x34')]);_0x3e21c5[_0xd484('0x35')]=qs[_0xd484('0x2c')](_[_0xd484('0x36')](_0xf80a23[_0xd484('0x2b')],_0xf525d2['filters']),_0x4e566b);if(_0xf80a23[_0xd484('0x2b')][_0xd484('0x37')]){_0x3e21c5['where']=_[_0xd484('0x38')](_0x3e21c5['where'],{'$or':_['map'](_0x4e566b,function(_0x47d41f){if(_0x47d41f[_0xd484('0x29')]!==_0xd484('0x39')){var _0x564ff7={};_0x564ff7[_0x47d41f['name']]={'$like':'%'+_0xf80a23[_0xd484('0x2b')]['filter']+'%'};return _0x564ff7;}})});}_0x3e21c5=_[_0xd484('0x38')]({},_0x3e21c5,_0xf80a23[_0xd484('0x3a')]);var _0xa833a7={'where':_0x3e21c5['where']};return db[_0xd484('0x27')][_0xd484('0x1b')](_0xa833a7)[_0xd484('0x20')](function(_0x4b18b6){_0x2bb2cc['count']=_0x4b18b6;if(_0xf80a23[_0xd484('0x2b')][_0xd484('0x3b')]){_0x3e21c5[_0xd484('0x3c')]=[{'all':!![]}];}return db[_0xd484('0x27')][_0xd484('0x3d')](_0x3e21c5);})[_0xd484('0x20')](function(_0x42f213){_0x2bb2cc[_0xd484('0x3e')]=_0x42f213;return _0x2bb2cc;})[_0xd484('0x20')](respondWithFilteredResult(_0x41afdb,_0x3e21c5))[_0xd484('0x3f')](handleError(_0x41afdb,null));};exports[_0xd484('0x40')]=function(_0x524d05,_0xbf201e){var _0x5d3d51={'raw':!![],'where':{'id':_0x524d05[_0xd484('0x41')]['id']}},_0x2fbd34={};_0x2fbd34['model']=_['keys'](db[_0xd484('0x27')][_0xd484('0x42')]);_0x2fbd34[_0xd484('0x2b')]=_['keys'](_0x524d05[_0xd484('0x2b')]);_0x2fbd34[_0xd484('0x2c')]=_[_0xd484('0x2d')](_0x2fbd34[_0xd484('0x2a')],_0x2fbd34[_0xd484('0x2b')]);_0x5d3d51[_0xd484('0x2e')]=_[_0xd484('0x2d')](_0x2fbd34['model'],qs[_0xd484('0x2f')](_0x524d05['query'][_0xd484('0x2f')]));_0x5d3d51[_0xd484('0x2e')]=_0x5d3d51[_0xd484('0x2e')][_0xd484('0x30')]?_0x5d3d51[_0xd484('0x2e')]:_0x2fbd34[_0xd484('0x2a')];if(_0x524d05[_0xd484('0x2b')][_0xd484('0x3b')]){_0x5d3d51['include']=[{'all':!![]}];}_0x5d3d51=_[_0xd484('0x38')]({},_0x5d3d51,_0x524d05[_0xd484('0x3a')]);return db['CmHopperBlack']['find'](_0x5d3d51)['then'](handleEntityNotFound(_0xbf201e,null))[_0xd484('0x20')](respondWithResult(_0xbf201e,null))['catch'](handleError(_0xbf201e,null));};exports['update']=function(_0x336af2,_0x3de2f5){if(_0x336af2['body']['id']){delete _0x336af2['body']['id'];}return db[_0xd484('0x27')][_0xd484('0x43')]({'where':{'id':_0x336af2[_0xd484('0x41')]['id']}})[_0xd484('0x20')](handleEntityNotFound(_0x3de2f5,null))[_0xd484('0x20')](saveUpdates(_0x336af2[_0xd484('0x44')],null))[_0xd484('0x20')](respondWithResult(_0x3de2f5,null))['catch'](handleError(_0x3de2f5,null));};exports[_0xd484('0x21')]=function(_0x3135ab,_0x1e5d3e){return db[_0xd484('0x27')][_0xd484('0x43')]({'where':{'id':_0x3135ab[_0xd484('0x41')]['id']}})[_0xd484('0x20')](handleEntityNotFound(_0x1e5d3e,null))['then'](removeEntity(_0x1e5d3e,null))[_0xd484('0x3f')](handleError(_0x1e5d3e,null));};exports[_0xd484('0x45')]=function(_0x4bdaf0,_0x23b9f2){return db[_0xd484('0x27')]['describe']()['then'](respondWithResult(_0x23b9f2,null))[_0xd484('0x3f')](handleError(_0x23b9f2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index c1c1968..aa4219f 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 _0xee05=['../../config/environment','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee05,0x16c));var _0x5ee0=function(_0xdc1e87,_0x485810){_0xdc1e87=_0xdc1e87-0x0;var _0x31d90f=_0xee05[_0xdc1e87];return _0x31d90f;};'use strict';var _=require(_0x5ee0('0x0'));var util=require(_0x5ee0('0x1'));var logger=require(_0x5ee0('0x2'))(_0x5ee0('0x3'));var moment=require('moment');var BPromise=require(_0x5ee0('0x4'));var rp=require(_0x5ee0('0x5'));var fs=require('fs');var path=require(_0x5ee0('0x6'));var rimraf=require(_0x5ee0('0x7'));var config=require(_0x5ee0('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x5ee0('0x9')]=function(_0x10cd92,_0x1290eb){return _0x10cd92['define'](_0x5ee0('0xa'),attributes,{'tableName':_0x5ee0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6567=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6567,0x1c3));var _0x7656=function(_0x4e5f99,_0x32edcd){_0x4e5f99=_0x4e5f99-0x0;var _0x384e8b=_0x6567[_0x4e5f99];return _0x384e8b;};'use strict';var _=require(_0x7656('0x0'));var util=require(_0x7656('0x1'));var logger=require('../../config/logger')(_0x7656('0x2'));var moment=require(_0x7656('0x3'));var BPromise=require(_0x7656('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7656('0x5'));var config=require(_0x7656('0x6'));var attributes=require(_0x7656('0x7'));module[_0x7656('0x8')]=function(_0x1ea058,_0x17d968){return _0x1ea058[_0x7656('0x9')](_0x7656('0xa'),attributes,{'tableName':_0x7656('0xb'),'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 680e1bf..9862b82 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 _0x2d88=['update','body','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetCmHopperBlack','findAll','options','raw','where','attributes','include','map','model','catch','UpdateCmHopperBlack'];(function(_0x1366e8,_0x2d1f28){var _0x34f0e7=function(_0x1ae564){while(--_0x1ae564){_0x1366e8['push'](_0x1366e8['shift']());}};_0x34f0e7(++_0x2d1f28);}(_0x2d88,0xa1));var _0x82d8=function(_0x194969,_0x2d191a){_0x194969=_0x194969-0x0;var _0x2119cb=_0x2d88[_0x194969];return _0x2119cb;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var moment=require(_0x82d8('0x2'));var BPromise=require(_0x82d8('0x3'));var rs=require(_0x82d8('0x4'));var fs=require('fs');var Redis=require(_0x82d8('0x5'));var db=require(_0x82d8('0x6'))['db'];var utils=require(_0x82d8('0x7'));var logger=require('../../config/logger')(_0x82d8('0x8'));var config=require(_0x82d8('0x9'));var jayson=require(_0x82d8('0xa'));var client=jayson[_0x82d8('0xb')][_0x82d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16f30f,_0x1ca124,_0x52086a){return new BPromise(function(_0x557b22,_0x31acef){return client['request'](_0x16f30f,_0x52086a)[_0x82d8('0xd')](function(_0x38bfe9){logger[_0x82d8('0xe')](_0x82d8('0xf'),_0x1ca124,'request\x20sent');logger[_0x82d8('0x10')](_0x82d8('0x11'),_0x1ca124,_0x82d8('0x12'),JSON[_0x82d8('0x13')](_0x38bfe9));if(_0x38bfe9[_0x82d8('0x14')]){if(_0x38bfe9['error'][_0x82d8('0x15')]===0x1f4){logger[_0x82d8('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x1ca124,_0x38bfe9[_0x82d8('0x14')]['message']);return _0x31acef(_0x38bfe9[_0x82d8('0x14')][_0x82d8('0x16')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1ca124,_0x38bfe9[_0x82d8('0x14')][_0x82d8('0x16')]);return _0x557b22(_0x38bfe9[_0x82d8('0x14')][_0x82d8('0x16')]);}else{logger[_0x82d8('0xe')](_0x82d8('0xf'),_0x1ca124,_0x82d8('0x12'));_0x557b22(_0x38bfe9['result'][_0x82d8('0x16')]);}})['catch'](function(_0x209767){logger['error'](_0x82d8('0xf'),_0x1ca124,_0x209767);_0x31acef(_0x209767);});});}exports[_0x82d8('0x17')]=function(_0x3658e0){var _0x71810=this;return new Promise(function(_0x46c591,_0x59f50c){return db['CmHopperBlack'][_0x82d8('0x18')]({'raw':_0x3658e0[_0x82d8('0x19')]?_0x3658e0['options'][_0x82d8('0x1a')]===undefined?!![]:![]:!![],'where':_0x3658e0[_0x82d8('0x19')]?_0x3658e0['options'][_0x82d8('0x1b')]||null:null,'attributes':_0x3658e0[_0x82d8('0x19')]?_0x3658e0['options'][_0x82d8('0x1c')]||null:null,'limit':_0x3658e0[_0x82d8('0x19')]?_0x3658e0[_0x82d8('0x19')]['limit']||null:null,'include':_0x3658e0['options']?_0x3658e0[_0x82d8('0x19')][_0x82d8('0x1d')]?_[_0x82d8('0x1e')](_0x3658e0[_0x82d8('0x19')][_0x82d8('0x1d')],function(_0x462510){return{'model':db[_0x462510[_0x82d8('0x1f')]],'as':_0x462510['as'],'attributes':_0x462510[_0x82d8('0x1c')],'include':_0x462510[_0x82d8('0x1d')]?_['map'](_0x462510[_0x82d8('0x1d')],function(_0x75d02a){return{'model':db[_0x75d02a[_0x82d8('0x1f')]],'as':_0x75d02a['as'],'attributes':_0x75d02a[_0x82d8('0x1c')],'include':_0x75d02a[_0x82d8('0x1d')]?_[_0x82d8('0x1e')](_0x75d02a[_0x82d8('0x1d')],function(_0x47e5ae){return{'model':db[_0x47e5ae[_0x82d8('0x1f')]],'as':_0x47e5ae['as'],'attributes':_0x47e5ae[_0x82d8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x82d8('0xd')](function(_0x4f8c86){logger['info'](_0x82d8('0x17'),_0x3658e0);logger[_0x82d8('0x10')](_0x82d8('0x17'),_0x3658e0,JSON[_0x82d8('0x13')](_0x4f8c86));_0x46c591(_0x4f8c86);})[_0x82d8('0x20')](function(_0x332aca){logger[_0x82d8('0x14')](_0x82d8('0x17'),_0x332aca['message'],_0x3658e0);_0x59f50c(_0x71810[_0x82d8('0x14')](0x1f4,_0x332aca[_0x82d8('0x16')]));});});};exports[_0x82d8('0x21')]=function(_0x55c30){var _0x14e8e8=this;return new Promise(function(_0x587213,_0x448223){return db['CmHopperBlack'][_0x82d8('0x22')](_0x55c30[_0x82d8('0x23')],{'raw':_0x55c30['options']?_0x55c30[_0x82d8('0x19')][_0x82d8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c30[_0x82d8('0x19')]?_0x55c30['options'][_0x82d8('0x1b')]||null:null,'attributes':_0x55c30['options']?_0x55c30[_0x82d8('0x19')]['attributes']||null:null,'limit':_0x55c30[_0x82d8('0x19')]?_0x55c30[_0x82d8('0x19')][_0x82d8('0x24')]||null:null})[_0x82d8('0xd')](function(_0x4e9c1c){logger[_0x82d8('0xe')](_0x82d8('0x21'),_0x55c30);logger[_0x82d8('0x10')]('UpdateCmHopperBlack',_0x55c30,JSON[_0x82d8('0x13')](_0x4e9c1c));_0x587213(_0x4e9c1c);})[_0x82d8('0x20')](function(_0x5c9f68){logger['error']('UpdateCmHopperBlack',_0x5c9f68['message'],_0x55c30);_0x448223(_0x14e8e8['error'](0x1f4,_0x5c9f68[_0x82d8('0x16')]));});});};exports[_0x82d8('0x25')]=function(_0x16fb83){var _0x17430d=this;return new Promise(function(_0xa510b9,_0x430256){return db['CmHopperBlack'][_0x82d8('0x26')]({'where':_0x16fb83[_0x82d8('0x19')]?_0x16fb83[_0x82d8('0x19')][_0x82d8('0x1b')]||null:null})[_0x82d8('0xd')](function(_0xc162b7){logger[_0x82d8('0xe')](_0x82d8('0x25'),_0x16fb83);logger[_0x82d8('0x10')]('DestroyCmHopperBlack',_0x16fb83,JSON[_0x82d8('0x13')](_0xc162b7));_0xa510b9(_0xc162b7);})['catch'](function(_0xa1a2bb){logger[_0x82d8('0x14')](_0x82d8('0x25'),_0xa1a2bb[_0x82d8('0x16')],_0x16fb83);_0x430256(_0x17430d[_0x82d8('0x14')](0x1f4,_0xa1a2bb[_0x82d8('0x16')]));});});}; \ No newline at end of file +var _0x0523=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','CmHopperBlack,\x20%s,\x20%s','message','catch','findAll','options','where','attributes','limit','include','model','map','GetCmHopperBlack','debug','body','raw','UpdateCmHopperBlack','stringify','destroy','DestroyCmHopperBlack'];(function(_0x27ad79,_0x33a96f){var _0x4f6f40=function(_0x1e54cc){while(--_0x1e54cc){_0x27ad79['push'](_0x27ad79['shift']());}};_0x4f6f40(++_0x33a96f);}(_0x0523,0x110));var _0x3052=function(_0x425bdd,_0x26da8d){_0x425bdd=_0x425bdd-0x0;var _0x595bc6=_0x0523[_0x425bdd];return _0x595bc6;};'use strict';var _=require('lodash');var util=require(_0x3052('0x0'));var moment=require(_0x3052('0x1'));var BPromise=require(_0x3052('0x2'));var rs=require(_0x3052('0x3'));var fs=require('fs');var Redis=require(_0x3052('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3052('0x5'));var logger=require('../../config/logger')(_0x3052('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3052('0x7')][_0x3052('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x75ea37,_0x22f8fe,_0x1dc4ad){return new BPromise(function(_0x144fec,_0x5701f1){return client[_0x3052('0x9')](_0x75ea37,_0x1dc4ad)[_0x3052('0xa')](function(_0x2ca217){logger[_0x3052('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x22f8fe,_0x3052('0xc'));logger['debug'](_0x3052('0xd'),_0x22f8fe,_0x3052('0xc'),JSON['stringify'](_0x2ca217));if(_0x2ca217['error']){if(_0x2ca217[_0x3052('0xe')]['code']===0x1f4){logger[_0x3052('0xe')](_0x3052('0xf'),_0x22f8fe,_0x2ca217[_0x3052('0xe')]['message']);return _0x5701f1(_0x2ca217[_0x3052('0xe')][_0x3052('0x10')]);}logger[_0x3052('0xe')](_0x3052('0xf'),_0x22f8fe,_0x2ca217['error'][_0x3052('0x10')]);return _0x144fec(_0x2ca217[_0x3052('0xe')][_0x3052('0x10')]);}else{logger[_0x3052('0xb')](_0x3052('0xf'),_0x22f8fe,'request\x20sent');_0x144fec(_0x2ca217['result'][_0x3052('0x10')]);}})[_0x3052('0x11')](function(_0x3bca49){logger['error'](_0x3052('0xf'),_0x22f8fe,_0x3bca49);_0x5701f1(_0x3bca49);});});}exports['GetCmHopperBlack']=function(_0x3725bb){var _0x559c56=this;return new Promise(function(_0x5a6bc5,_0x3bdb20){return db['CmHopperBlack'][_0x3052('0x12')]({'raw':_0x3725bb[_0x3052('0x13')]?_0x3725bb[_0x3052('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3725bb[_0x3052('0x13')]?_0x3725bb[_0x3052('0x13')][_0x3052('0x14')]||null:null,'attributes':_0x3725bb['options']?_0x3725bb[_0x3052('0x13')][_0x3052('0x15')]||null:null,'limit':_0x3725bb[_0x3052('0x13')]?_0x3725bb[_0x3052('0x13')][_0x3052('0x16')]||null:null,'include':_0x3725bb[_0x3052('0x13')]?_0x3725bb[_0x3052('0x13')]['include']?_['map'](_0x3725bb[_0x3052('0x13')][_0x3052('0x17')],function(_0x1cb741){return{'model':db[_0x1cb741[_0x3052('0x18')]],'as':_0x1cb741['as'],'attributes':_0x1cb741['attributes'],'include':_0x1cb741[_0x3052('0x17')]?_[_0x3052('0x19')](_0x1cb741['include'],function(_0x3cb6f4){return{'model':db[_0x3cb6f4[_0x3052('0x18')]],'as':_0x3cb6f4['as'],'attributes':_0x3cb6f4['attributes'],'include':_0x3cb6f4[_0x3052('0x17')]?_[_0x3052('0x19')](_0x3cb6f4['include'],function(_0x8ada8c){return{'model':db[_0x8ada8c[_0x3052('0x18')]],'as':_0x8ada8c['as'],'attributes':_0x8ada8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3052('0xa')](function(_0x11d906){logger[_0x3052('0xb')](_0x3052('0x1a'),_0x3725bb);logger[_0x3052('0x1b')](_0x3052('0x1a'),_0x3725bb,JSON['stringify'](_0x11d906));_0x5a6bc5(_0x11d906);})[_0x3052('0x11')](function(_0x413f5c){logger[_0x3052('0xe')]('GetCmHopperBlack',_0x413f5c[_0x3052('0x10')],_0x3725bb);_0x3bdb20(_0x559c56[_0x3052('0xe')](0x1f4,_0x413f5c[_0x3052('0x10')]));});});};exports['UpdateCmHopperBlack']=function(_0x1f0162){var _0x2289e6=this;return new Promise(function(_0x24110b,_0x1b6a48){return db['CmHopperBlack']['update'](_0x1f0162[_0x3052('0x1c')],{'raw':_0x1f0162[_0x3052('0x13')]?_0x1f0162[_0x3052('0x13')][_0x3052('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f0162[_0x3052('0x13')]?_0x1f0162[_0x3052('0x13')]['where']||null:null,'attributes':_0x1f0162[_0x3052('0x13')]?_0x1f0162[_0x3052('0x13')]['attributes']||null:null,'limit':_0x1f0162[_0x3052('0x13')]?_0x1f0162[_0x3052('0x13')]['limit']||null:null})[_0x3052('0xa')](function(_0x26969d){logger['info'](_0x3052('0x1e'),_0x1f0162);logger[_0x3052('0x1b')]('UpdateCmHopperBlack',_0x1f0162,JSON[_0x3052('0x1f')](_0x26969d));_0x24110b(_0x26969d);})[_0x3052('0x11')](function(_0x5e364f){logger[_0x3052('0xe')](_0x3052('0x1e'),_0x5e364f[_0x3052('0x10')],_0x1f0162);_0x1b6a48(_0x2289e6[_0x3052('0xe')](0x1f4,_0x5e364f[_0x3052('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x2d00cc){var _0x15719a=this;return new Promise(function(_0x490c89,_0xe61af0){return db['CmHopperBlack'][_0x3052('0x20')]({'where':_0x2d00cc[_0x3052('0x13')]?_0x2d00cc[_0x3052('0x13')][_0x3052('0x14')]||null:null})[_0x3052('0xa')](function(_0x26a5a6){logger[_0x3052('0xb')](_0x3052('0x21'),_0x2d00cc);logger[_0x3052('0x1b')](_0x3052('0x21'),_0x2d00cc,JSON[_0x3052('0x1f')](_0x26a5a6));_0x490c89(_0x26a5a6);})[_0x3052('0x11')](function(_0x48d3b9){logger[_0x3052('0xe')](_0x3052('0x21'),_0x48d3b9[_0x3052('0x10')],_0x2d00cc);_0xe61af0(_0x15719a[_0x3052('0xe')](0x1f4,_0x48d3b9[_0x3052('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 715d19a..229c18b 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 _0xb145=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x3cd21c,_0x3dff3c){var _0x326d87=function(_0x20c758){while(--_0x20c758){_0x3cd21c['push'](_0x3cd21c['shift']());}};_0x326d87(++_0x3dff3c);}(_0xb145,0xa3));var _0x5b14=function(_0x3a7490,_0x5c7a3d){_0x3a7490=_0x3a7490-0x0;var _0x195eac=_0xb145[_0x3a7490];return _0x195eac;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xe'),auth[_0x5b14('0xa')](),controller['destroy']);module[_0x5b14('0x13')]=router; \ No newline at end of file +var _0x57ca=['../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x46c415,_0x442b74){var _0x2d854d=function(_0x568b01){while(--_0x568b01){_0x46c415['push'](_0x46c415['shift']());}};_0x2d854d(++_0x442b74);}(_0x57ca,0x108));var _0xa57c=function(_0xbea479,_0x948477){_0xbea479=_0xbea479-0x0;var _0x543df1=_0x57ca[_0xbea479];return _0x543df1;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/:id',auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x10')](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8936f8c..382b8f7 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 _0x544f=['sequelize','moment','exports','INTEGER','STRING','DATE','endtime','followuptime','diff','seconds','BOOLEAN'];(function(_0x1fd3dd,_0x89682a){var _0x2461e0=function(_0x1cef7d){while(--_0x1cef7d){_0x1fd3dd['push'](_0x1fd3dd['shift']());}};_0x2461e0(++_0x89682a);}(_0x544f,0x9a));var _0xf544=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x544f[_0x5a6644];return _0x3a2a5d;};'use strict';var Sequelize=require(_0xf544('0x0'));var moment=require(_0xf544('0x1'));module[_0xf544('0x2')]={'state':{'type':Sequelize[_0xf544('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf544('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xf544('0x4')]},'originatecalleridname':{'type':Sequelize[_0xf544('0x4')]},'calleridnum':{'type':Sequelize[_0xf544('0x4')]},'calleridname':{'type':Sequelize[_0xf544('0x4')]},'starttime':{'type':Sequelize[_0xf544('0x5')]},'responsetime':{'type':Sequelize[_0xf544('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf544('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf544('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf544('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf544('0x4')]},'secondDisposition':{'type':Sequelize[_0xf544('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf544('0x4')]},'dispositionat':{'type':Sequelize[_0xf544('0x5')],'set':function(_0x41eb28){var _0x3001ab=this['getDataValue'](_0xf544('0x6'));if(_0x3001ab&&_0x41eb28){this['setDataValue'](_0xf544('0x7'),moment(_0x41eb28)[_0xf544('0x8')](moment(_0x3001ab),_0xf544('0x9')));}return this['setDataValue']('dispositionat',_0x41eb28);}},'amd':{'type':Sequelize[_0xf544('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf544('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf544('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf544('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf544('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf544('0x5')]},'deleted':{'type':Sequelize[_0xf544('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf544('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf544('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf544('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1762=['seconds','BOOLEAN','sequelize','moment','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0x1762,0x1b2));var _0x2176=function(_0x5e8c92,_0x38fe8d){_0x5e8c92=_0x5e8c92-0x0;var _0x48686f=_0x1762[_0x5e8c92];return _0x48686f;};'use strict';var Sequelize=require(_0x2176('0x0'));var moment=require(_0x2176('0x1'));module['exports']={'state':{'type':Sequelize[_0x2176('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2176('0x3')]},'countbusyretry':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2176('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2176('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2176('0x4')]},'starttime':{'type':Sequelize[_0x2176('0x3')]},'responsetime':{'type':Sequelize[_0x2176('0x3')]},'answertime':{'type':Sequelize[_0x2176('0x3')]},'droptime':{'type':Sequelize[_0x2176('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2176('0x4')]},'campaign':{'type':Sequelize[_0x2176('0x4')]},'campaigntype':{'type':Sequelize[_0x2176('0x4')]},'membername':{'type':Sequelize[_0x2176('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2176('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2176('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5c0f06){var _0x3791fe=this[_0x2176('0x5')](_0x2176('0x6'));if(_0x3791fe&&_0x5c0f06){this[_0x2176('0x7')](_0x2176('0x8'),moment(_0x5c0f06)[_0x2176('0x9')](moment(_0x3791fe),_0x2176('0xa')));}return this['setDataValue']('dispositionat',_0x5c0f06);}},'amd':{'type':Sequelize[_0x2176('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2176('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2176('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2176('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2176('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2176('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2176('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2176('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index facb71b..aedb0d9 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 _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x42f212,_0x5f2207){var _0x1c6f63=function(_0x364c0a){while(--_0x364c0a){_0x42f212['push'](_0x42f212['shift']());}};_0x1c6f63(++_0x5f2207);}(_0x0295,0x1f0));var _0x5029=function(_0x3f239d,_0x1e4675){_0x3f239d=_0x3f239d-0x0;var _0x46f035=_0x0295[_0x3f239d];return _0x46f035;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file +var _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x187d,0x93));var _0xd187=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x187d[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 7a8971d..90a6bda 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 _0x5da3=['../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x55d82c,_0x56dafb){var _0x3820ab=function(_0x265cc1){while(--_0x265cc1){_0x55d82c['push'](_0x55d82c['shift']());}};_0x3820ab(++_0x56dafb);}(_0x5da3,0x1b3));var _0x35da=function(_0x54a529,_0x14374b){_0x54a529=_0x54a529-0x0;var _0x2a9bb1=_0x5da3[_0x54a529];return _0x2a9bb1;};'use strict';var _=require(_0x35da('0x0'));var util=require(_0x35da('0x1'));var logger=require(_0x35da('0x2'))(_0x35da('0x3'));var moment=require('moment');var BPromise=require(_0x35da('0x4'));var rp=require(_0x35da('0x5'));var fs=require('fs');var path=require(_0x35da('0x6'));var rimraf=require('rimraf');var config=require(_0x35da('0x7'));var attributes=require(_0x35da('0x8'));module['exports']=function(_0x5e4a24,_0x42a13f){return _0x5e4a24[_0x35da('0x9')](_0x35da('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x35da('0xb'),'fields':[_0x35da('0xb')]},{'name':_0x35da('0xc'),'fields':[_0x35da('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ece=['cm_hopper_final','calleridnum','uniqueid','lodash','util','api','bluebird','request-promise','rimraf','exports','CmHopperFinal'];(function(_0x4f8c0d,_0x14c734){var _0x38d1a7=function(_0x1be12c){while(--_0x1be12c){_0x4f8c0d['push'](_0x4f8c0d['shift']());}};_0x38d1a7(++_0x14c734);}(_0x7ece,0xf5));var _0xe7ec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7ece[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xe7ec('0x0'));var util=require(_0xe7ec('0x1'));var logger=require('../../config/logger')(_0xe7ec('0x2'));var moment=require('moment');var BPromise=require(_0xe7ec('0x3'));var rp=require(_0xe7ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7ec('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xe7ec('0x6')]=function(_0x5bca3f,_0x3e35bf){return _0x5bca3f['define'](_0xe7ec('0x7'),attributes,{'tableName':_0xe7ec('0x8'),'paranoid':![],'indexes':[{'name':_0xe7ec('0x9'),'fields':[_0xe7ec('0x9')]},{'name':_0xe7ec('0xa'),'fields':[_0xe7ec('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 8b01cde..dd10c09 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(_0x52ab94,_0x4d3f94){var _0xb7284c=function(_0x1aa207){while(--_0x1aa207){_0x52ab94['push'](_0x52ab94['shift']());}};_0xb7284c(++_0x4d3f94);}(_0xb10b,0x12a));var _0xbb10=function(_0x25979f,_0x32a3eb){_0x25979f=_0x25979f-0x0;var _0x4de4e7=_0xb10b[_0x25979f];return _0x4de4e7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x542588,_0x4305c9){var _0xf24784=function(_0x13ea9d){while(--_0x13ea9d){_0x542588['push'](_0x542588['shift']());}};_0xf24784(++_0x4305c9);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d07bb,_0x271464){_0x5d07bb=_0x5d07bb-0x0;var _0x42960a=_0xb10b[_0x5d07bb];return _0x42960a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 17dc1a9..4a97ca7 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 _0x269b=['checkContactHopper','put','/:id','update','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0x269b,0x9a));var _0xb269=function(_0xffa65c,_0x3aa2f3){_0xffa65c=_0xffa65c-0x0;var _0x2157ad=_0x269b[_0xffa65c];return _0x2157ad;};'use strict';var multer=require(_0xb269('0x0'));var util=require('util');var path=require(_0xb269('0x1'));var timeout=require(_0xb269('0x2'));var express=require(_0xb269('0x3'));var router=express[_0xb269('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb269('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xb269('0x6')]('/',auth[_0xb269('0x7')](),controller[_0xb269('0x8')]);router[_0xb269('0x6')](_0xb269('0x9'),auth[_0xb269('0x7')](),controller[_0xb269('0xa')]);router['get']('/:id',auth[_0xb269('0x7')](),controller[_0xb269('0xb')]);router[_0xb269('0x6')](_0xb269('0xc'),auth[_0xb269('0x7')](),controller[_0xb269('0xd')]);router[_0xb269('0x6')](_0xb269('0xe'),auth[_0xb269('0x7')](),controller[_0xb269('0xf')]);router[_0xb269('0x10')](_0xb269('0x11'),auth[_0xb269('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb269('0x10')](_0xb269('0x12'),auth[_0xb269('0x7')](),controller[_0xb269('0x13')]);router[_0xb269('0x10')](_0xb269('0x14'),auth['isAuthenticated'](),controller[_0xb269('0x15')]);router[_0xb269('0x16')](_0xb269('0x17'),auth[_0xb269('0x7')](),controller[_0xb269('0x18')]);module['exports']=router; \ No newline at end of file +var _0x68a1=['./cmHopperFinal.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x103327,_0x48624a){var _0x445e50=function(_0x209da6){while(--_0x209da6){_0x103327['push'](_0x103327['shift']());}};_0x445e50(++_0x48624a);}(_0x68a1,0x89));var _0x168a=function(_0x27c0b9,_0x417555){_0x27c0b9=_0x27c0b9-0x0;var _0x3f0c06=_0x68a1[_0x27c0b9];return _0x3f0c06;};'use strict';var multer=require(_0x168a('0x0'));var util=require(_0x168a('0x1'));var path=require(_0x168a('0x2'));var timeout=require(_0x168a('0x3'));var express=require('express');var router=express[_0x168a('0x4')]();var fs_extra=require(_0x168a('0x5'));var auth=require(_0x168a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x168a('0x7'));var controller=require(_0x168a('0x8'));router[_0x168a('0x9')]('/',auth['isAuthenticated'](),controller[_0x168a('0xa')]);router[_0x168a('0x9')](_0x168a('0xb'),auth['isAuthenticated'](),controller[_0x168a('0xc')]);router[_0x168a('0x9')](_0x168a('0xd'),auth[_0x168a('0xe')](),controller[_0x168a('0xf')]);router[_0x168a('0x9')](_0x168a('0x10'),auth[_0x168a('0xe')](),controller[_0x168a('0x11')]);router[_0x168a('0x9')](_0x168a('0x12'),auth[_0x168a('0xe')](),controller[_0x168a('0x13')]);router[_0x168a('0x14')](_0x168a('0x15'),auth[_0x168a('0xe')](),controller[_0x168a('0x16')]);router[_0x168a('0x14')](_0x168a('0x17'),auth[_0x168a('0xe')](),controller[_0x168a('0x18')]);router['post'](_0x168a('0x19'),auth['isAuthenticated'](),controller[_0x168a('0x1a')]);router[_0x168a('0x1b')](_0x168a('0xd'),auth['isAuthenticated'](),controller[_0x168a('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 2eef9f0..0a5f2ea 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 _0x2f9a=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x32b449,_0x2afed0){var _0x24c3dc=function(_0x2216e0){while(--_0x2216e0){_0x32b449['push'](_0x32b449['shift']());}};_0x24c3dc(++_0x2afed0);}(_0x2f9a,0x75));var _0xa2f9=function(_0x1415ef,_0x5c219e){_0x1415ef=_0x1415ef-0x0;var _0x234acc=_0x2f9a[_0x1415ef];return _0x234acc;};'use strict';var Sequelize=require(_0xa2f9('0x0'));module[_0xa2f9('0x1')]={'state':{'type':Sequelize[_0xa2f9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa2f9('0x3')]},'scheduledat':{'type':Sequelize[_0xa2f9('0x4')]},'countbusyretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa2f9('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xa2f9('0x3')]},'originatecalleridname':{'type':Sequelize[_0xa2f9('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa2f9('0x3')]},'starttime':{'type':Sequelize[_0xa2f9('0x4')]},'responsetime':{'type':Sequelize[_0xa2f9('0x4')]},'answertime':{'type':Sequelize[_0xa2f9('0x4')]},'droptime':{'type':Sequelize[_0xa2f9('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa2f9('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa2f9('0x3')]},'membername':{'type':Sequelize[_0xa2f9('0x3')]},'reason':{'type':Sequelize[_0xa2f9('0x3')]},'amd':{'type':Sequelize[_0xa2f9('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa2f9('0x4')]},'recallme':{'type':Sequelize[_0xa2f9('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa2f9('0x4')]},'edited':{'type':Sequelize[_0xa2f9('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa2f9('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1ff1=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5177c5,_0x2b3d33){var _0x4783d6=function(_0x2455ee){while(--_0x2455ee){_0x5177c5['push'](_0x5177c5['shift']());}};_0x4783d6(++_0x2b3d33);}(_0x1ff1,0x139));var _0x11ff=function(_0x4bd3f3,_0xe87cb4){_0x4bd3f3=_0x4bd3f3-0x0;var _0x51e4f6=_0x1ff1[_0x4bd3f3];return _0x51e4f6;};'use strict';var Sequelize=require(_0x11ff('0x0'));module[_0x11ff('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x11ff('0x2')]},'scheduledat':{'type':Sequelize[_0x11ff('0x3')]},'countbusyretry':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x11ff('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x11ff('0x2')]},'originatecalleridname':{'type':Sequelize[_0x11ff('0x2')]},'calleridnum':{'type':Sequelize[_0x11ff('0x2')]},'calleridname':{'type':Sequelize[_0x11ff('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x11ff('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x11ff('0x3')]},'endtime':{'type':Sequelize[_0x11ff('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x11ff('0x2')]},'campaigntype':{'type':Sequelize[_0x11ff('0x2')]},'membername':{'type':Sequelize[_0x11ff('0x2')]},'reason':{'type':Sequelize[_0x11ff('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x11ff('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x11ff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x11ff('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x11ff('0x3')]},'recallme':{'type':Sequelize[_0x11ff('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x11ff('0x3')]},'edited':{'type':Sequelize[_0x11ff('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x11ff('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x11ff('0x4')],'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 c1d2bdf..f0dc4b6 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 _0x1b8c=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x59c590,_0x5d31d8){var _0x20d222=function(_0x277d34){while(--_0x277d34){_0x59c590['push'](_0x59c590['shift']());}};_0x20d222(++_0x5d31d8);}(_0x1b8c,0x97));var _0xc1b8=function(_0x4e2f7f,_0x501e5b){_0x4e2f7f=_0x4e2f7f-0x0;var _0xf0060=_0x1b8c[_0x4e2f7f];return _0xf0060;};'use strict';var emlformat=require(_0xc1b8('0x0'));var rimraf=require(_0xc1b8('0x1'));var zipdir=require(_0xc1b8('0x2'));var jsonpatch=require(_0xc1b8('0x3'));var rp=require('request-promise');var moment=require(_0xc1b8('0x4'));var BPromise=require(_0xc1b8('0x5'));var Mustache=require('mustache');var util=require(_0xc1b8('0x6'));var path=require('path');var sox=require(_0xc1b8('0x7'));var csv=require(_0xc1b8('0x8'));var ejs=require(_0xc1b8('0x9'));var fs=require('fs');var fs_extra=require(_0xc1b8('0xa'));var _=require(_0xc1b8('0xb'));var squel=require(_0xc1b8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1b8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc1b8('0xe'));var Papa=require(_0xc1b8('0xf'));var Redis=require(_0xc1b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc1b8('0x11'));var as=require(_0xc1b8('0x12'));var hardwareService=require(_0xc1b8('0x13'));var logger=require('../../config/logger')(_0xc1b8('0x14'));var utils=require(_0xc1b8('0x15'));var config=require(_0xc1b8('0x16'));var licenseUtil=require(_0xc1b8('0x17'));var db=require(_0xc1b8('0x18'))['db'];function respondWithStatusCode(_0x325214,_0xeb1926){_0xeb1926=_0xeb1926||0xcc;return function(_0x5965ba){if(_0x5965ba){return _0x325214[_0xc1b8('0x19')](_0xeb1926);}return _0x325214['status'](_0xeb1926)[_0xc1b8('0x1a')]();};}function respondWithResult(_0x40bc5e,_0x9f34a1){_0x9f34a1=_0x9f34a1||0xc8;return function(_0x5ddda3){if(_0x5ddda3){return _0x40bc5e[_0xc1b8('0x1b')](_0x9f34a1)[_0xc1b8('0x1c')](_0x5ddda3);}};}function respondWithFilteredResult(_0x382b2f,_0x12d528){return function(_0x4fca87){if(_0x4fca87){var _0x389556=typeof _0x12d528[_0xc1b8('0x1d')]===_0xc1b8('0x1e')&&typeof _0x12d528[_0xc1b8('0x1f')]===_0xc1b8('0x1e');var _0x1f774b=_0x4fca87[_0xc1b8('0x20')];var _0x5c5cc0=_0x389556?0x0:_0x12d528[_0xc1b8('0x1d')];var _0x491024=_0x389556?_0x4fca87['count']:_0x12d528[_0xc1b8('0x1d')]+_0x12d528[_0xc1b8('0x1f')];var _0xa234af;if(_0x491024>=_0x1f774b){_0x491024=_0x1f774b;_0xa234af=0xc8;}else{_0xa234af=0xce;}_0x382b2f[_0xc1b8('0x1b')](_0xa234af);return _0x382b2f[_0xc1b8('0x21')]('Content-Range',_0x5c5cc0+'-'+_0x491024+'/'+_0x1f774b)[_0xc1b8('0x1c')](_0x4fca87);}return null;};}function patchUpdates(_0x47fcc9){return function(_0x364d){try{jsonpatch[_0xc1b8('0x22')](_0x364d,_0x47fcc9,!![]);}catch(_0x58f35f){return BPromise[_0xc1b8('0x23')](_0x58f35f);}return _0x364d[_0xc1b8('0x24')]();};}function saveUpdates(_0xbc34c5,_0xc3d4d4){return function(_0x246a8d){if(_0x246a8d){return _0x246a8d['update'](_0xbc34c5)[_0xc1b8('0x25')](function(_0x184c01){return _0x184c01;});}return null;};}function removeEntity(_0x584e02,_0x2970fb){return function(_0x546f01){if(_0x546f01){return _0x546f01['destroy']()[_0xc1b8('0x25')](function(){_0x584e02[_0xc1b8('0x1b')](0xcc)[_0xc1b8('0x1a')]();});}};}function handleEntityNotFound(_0xc845bc,_0x4ac343){return function(_0x89683d){if(!_0x89683d){_0xc845bc[_0xc1b8('0x19')](0x194);}return _0x89683d;};}function handleError(_0x519792,_0x488690){_0x488690=_0x488690||0x1f4;return function(_0x1cbb64){logger[_0xc1b8('0x26')](_0x1cbb64[_0xc1b8('0x27')]);if(_0x1cbb64[_0xc1b8('0x28')]){delete _0x1cbb64['name'];}_0x519792[_0xc1b8('0x1b')](_0x488690)['send'](_0x1cbb64);};}exports[_0xc1b8('0x29')]=function(_0x251a20,_0x24ce0a){var _0x146db5={},_0x11ac6c={},_0x3a47f3={'count':0x0,'rows':[]};var _0x5330c3=_[_0xc1b8('0x2a')](db[_0xc1b8('0x2b')][_0xc1b8('0x2c')],function(_0x153371){return{'name':_0x153371[_0xc1b8('0x2d')],'type':_0x153371[_0xc1b8('0x2e')][_0xc1b8('0x2f')]};});_0x11ac6c[_0xc1b8('0x30')]=_[_0xc1b8('0x2a')](_0x5330c3,_0xc1b8('0x28'));_0x11ac6c['query']=_[_0xc1b8('0x31')](_0x251a20[_0xc1b8('0x32')]);_0x11ac6c[_0xc1b8('0x33')]=_[_0xc1b8('0x34')](_0x11ac6c[_0xc1b8('0x30')],_0x11ac6c[_0xc1b8('0x32')]);_0x146db5[_0xc1b8('0x35')]=_[_0xc1b8('0x34')](_0x11ac6c[_0xc1b8('0x30')],qs[_0xc1b8('0x36')](_0x251a20['query'][_0xc1b8('0x36')]));_0x146db5[_0xc1b8('0x35')]=_0x146db5[_0xc1b8('0x35')][_0xc1b8('0x37')]?_0x146db5[_0xc1b8('0x35')]:_0x11ac6c[_0xc1b8('0x30')];if(!_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x38')](_0xc1b8('0x39'))){_0x146db5[_0xc1b8('0x1f')]=qs[_0xc1b8('0x1f')](_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x1f')]);_0x146db5[_0xc1b8('0x1d')]=qs['offset'](_0x251a20[_0xc1b8('0x32')]['offset']);}_0x146db5[_0xc1b8('0x3a')]=qs[_0xc1b8('0x3b')](_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x3b')]);_0x146db5[_0xc1b8('0x3c')]=qs[_0xc1b8('0x33')](_[_0xc1b8('0x3d')](_0x251a20[_0xc1b8('0x32')],_0x11ac6c[_0xc1b8('0x33')]),_0x5330c3);if(_0x251a20['query'][_0xc1b8('0x3e')]){_0x146db5[_0xc1b8('0x3c')]=_[_0xc1b8('0x3f')](_0x146db5[_0xc1b8('0x3c')],{'$or':_['map'](_0x5330c3,function(_0x2a4ceb){if(_0x2a4ceb[_0xc1b8('0x2e')]!==_0xc1b8('0x40')){var _0x4d7cfe={};_0x4d7cfe[_0x2a4ceb[_0xc1b8('0x28')]]={'$like':'%'+_0x251a20['query'][_0xc1b8('0x3e')]+'%'};return _0x4d7cfe;}})});}_0x146db5=_['merge']({},_0x146db5,_0x251a20[_0xc1b8('0x41')]);var _0x2e0d7e={'where':_0x146db5[_0xc1b8('0x3c')]};return db[_0xc1b8('0x2b')][_0xc1b8('0x20')](_0x2e0d7e)[_0xc1b8('0x25')](function(_0x3fe4c9){_0x3a47f3[_0xc1b8('0x20')]=_0x3fe4c9;if(_0x251a20[_0xc1b8('0x32')][_0xc1b8('0x42')]){_0x146db5[_0xc1b8('0x43')]=[{'all':!![]}];}return db[_0xc1b8('0x2b')][_0xc1b8('0x44')](_0x146db5);})[_0xc1b8('0x25')](function(_0x5849d0){_0x3a47f3['rows']=_0x5849d0;return _0x3a47f3;})['then'](respondWithFilteredResult(_0x24ce0a,_0x146db5))['catch'](handleError(_0x24ce0a,null));};exports[_0xc1b8('0x45')]=function(_0x2e28ec,_0x4c59b7){var _0x37cf5f={'raw':!![],'where':{'id':_0x2e28ec[_0xc1b8('0x46')]['id']}},_0x36efd6={};_0x36efd6['model']=_[_0xc1b8('0x31')](db[_0xc1b8('0x2b')][_0xc1b8('0x2c')]);_0x36efd6['query']=_['keys'](_0x2e28ec[_0xc1b8('0x32')]);_0x36efd6[_0xc1b8('0x33')]=_['intersection'](_0x36efd6[_0xc1b8('0x30')],_0x36efd6[_0xc1b8('0x32')]);_0x37cf5f[_0xc1b8('0x35')]=_[_0xc1b8('0x34')](_0x36efd6['model'],qs[_0xc1b8('0x36')](_0x2e28ec[_0xc1b8('0x32')][_0xc1b8('0x36')]));_0x37cf5f[_0xc1b8('0x35')]=_0x37cf5f[_0xc1b8('0x35')]['length']?_0x37cf5f[_0xc1b8('0x35')]:_0x36efd6['model'];if(_0x2e28ec[_0xc1b8('0x32')][_0xc1b8('0x42')]){_0x37cf5f['include']=[{'all':!![]}];}_0x37cf5f=_[_0xc1b8('0x3f')]({},_0x37cf5f,_0x2e28ec[_0xc1b8('0x41')]);return db[_0xc1b8('0x2b')][_0xc1b8('0x47')](_0x37cf5f)[_0xc1b8('0x25')](handleEntityNotFound(_0x4c59b7,null))[_0xc1b8('0x25')](respondWithResult(_0x4c59b7,null))[_0xc1b8('0x48')](handleError(_0x4c59b7,null));};exports['create']=function(_0x5f5267,_0x13af00){return db[_0xc1b8('0x2b')][_0xc1b8('0x49')](_0x5f5267[_0xc1b8('0x4a')],{})[_0xc1b8('0x25')](respondWithResult(_0x13af00,0xc9))[_0xc1b8('0x48')](handleError(_0x13af00,null));};exports['describe']=function(_0x460d61,_0x4a3af8){return db[_0xc1b8('0x2b')][_0xc1b8('0x4b')]()[_0xc1b8('0x25')](respondWithResult(_0x4a3af8,null))[_0xc1b8('0x48')](handleError(_0x4a3af8,null));};exports[_0xc1b8('0x4c')]=function(_0x452138,_0x28f98d){if(_0x452138[_0xc1b8('0x4a')][_0xc1b8('0x4d')]){delete _0x452138[_0xc1b8('0x4a')][_0xc1b8('0x4d')];}return db[_0xc1b8('0x2b')][_0xc1b8('0x47')]({'where':{'uniqueid':_0x452138['params']['id']}})['then'](handleEntityNotFound(_0x28f98d,null))[_0xc1b8('0x25')](saveUpdates(_0x452138[_0xc1b8('0x4a')],null))[_0xc1b8('0x25')](respondWithResult(_0x28f98d,null))[_0xc1b8('0x48')](handleError(_0x28f98d,null));}; \ No newline at end of file +var _0x57e8=['destroy','error','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','CmHopperHistory','findAll','rows','catch','show','params','find','update','body','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','then'];(function(_0x341cce,_0x284b0e){var _0x3bd24=function(_0x3c10ee){while(--_0x3c10ee){_0x341cce['push'](_0x341cce['shift']());}};_0x3bd24(++_0x284b0e);}(_0x57e8,0x1dc));var _0x857e=function(_0x4d6e14,_0x265a89){_0x4d6e14=_0x4d6e14-0x0;var _0x15468a=_0x57e8[_0x4d6e14];return _0x15468a;};'use strict';var emlformat=require(_0x857e('0x0'));var rimraf=require(_0x857e('0x1'));var zipdir=require(_0x857e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x857e('0x3'));var moment=require(_0x857e('0x4'));var BPromise=require(_0x857e('0x5'));var Mustache=require('mustache');var util=require(_0x857e('0x6'));var path=require(_0x857e('0x7'));var sox=require(_0x857e('0x8'));var csv=require(_0x857e('0x9'));var ejs=require(_0x857e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x857e('0xb'));var crypto=require(_0x857e('0xc'));var jsforce=require(_0x857e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x857e('0x9'));var querystring=require('querystring');var Papa=require(_0x857e('0xe'));var Redis=require(_0x857e('0xf'));var authService=require(_0x857e('0x10'));var qs=require(_0x857e('0x11'));var as=require(_0x857e('0x12'));var hardwareService=require(_0x857e('0x13'));var logger=require(_0x857e('0x14'))('api');var utils=require(_0x857e('0x15'));var config=require(_0x857e('0x16'));var licenseUtil=require(_0x857e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b553d,_0x1725ff){_0x1725ff=_0x1725ff||0xcc;return function(_0x24e253){if(_0x24e253){return _0x5b553d[_0x857e('0x18')](_0x1725ff);}return _0x5b553d[_0x857e('0x19')](_0x1725ff)[_0x857e('0x1a')]();};}function respondWithResult(_0x48e2ad,_0x3bcb5f){_0x3bcb5f=_0x3bcb5f||0xc8;return function(_0x10b53e){if(_0x10b53e){return _0x48e2ad['status'](_0x3bcb5f)['json'](_0x10b53e);}};}function respondWithFilteredResult(_0x4480be,_0x3c18c9){return function(_0x2b242d){if(_0x2b242d){var _0x7ee851=typeof _0x3c18c9[_0x857e('0x1b')]===_0x857e('0x1c')&&typeof _0x3c18c9[_0x857e('0x1d')]==='undefined';var _0x13572b=_0x2b242d[_0x857e('0x1e')];var _0x1036bf=_0x7ee851?0x0:_0x3c18c9[_0x857e('0x1b')];var _0x282b79=_0x7ee851?_0x2b242d[_0x857e('0x1e')]:_0x3c18c9[_0x857e('0x1b')]+_0x3c18c9[_0x857e('0x1d')];var _0x3c8fcf;if(_0x282b79>=_0x13572b){_0x282b79=_0x13572b;_0x3c8fcf=0xc8;}else{_0x3c8fcf=0xce;}_0x4480be['status'](_0x3c8fcf);return _0x4480be[_0x857e('0x1f')](_0x857e('0x20'),_0x1036bf+'-'+_0x282b79+'/'+_0x13572b)['json'](_0x2b242d);}return null;};}function patchUpdates(_0xaedc5a){return function(_0x3e0552){try{jsonpatch[_0x857e('0x21')](_0x3e0552,_0xaedc5a,!![]);}catch(_0x27b109){return BPromise['reject'](_0x27b109);}return _0x3e0552['save']();};}function saveUpdates(_0x1b215c,_0x309d00){return function(_0x44256f){if(_0x44256f){return _0x44256f['update'](_0x1b215c)[_0x857e('0x22')](function(_0x163725){return _0x163725;});}return null;};}function removeEntity(_0x7e9a7e,_0x450714){return function(_0x25f36d){if(_0x25f36d){return _0x25f36d[_0x857e('0x23')]()['then'](function(){_0x7e9a7e[_0x857e('0x19')](0xcc)[_0x857e('0x1a')]();});}};}function handleEntityNotFound(_0x351325,_0x3240c4){return function(_0x5a75d2){if(!_0x5a75d2){_0x351325[_0x857e('0x18')](0x194);}return _0x5a75d2;};}function handleError(_0x3b76f8,_0x49335b){_0x49335b=_0x49335b||0x1f4;return function(_0x3622ce){logger[_0x857e('0x24')](_0x3622ce['stack']);if(_0x3622ce[_0x857e('0x25')]){delete _0x3622ce[_0x857e('0x25')];}_0x3b76f8[_0x857e('0x19')](_0x49335b)['send'](_0x3622ce);};}exports[_0x857e('0x26')]=function(_0x542a0a,_0x1c07ab){var _0xecc9e4={},_0x238f9d={},_0x57d902={'count':0x0,'rows':[]};var _0x3be728=_['map'](db['CmHopperHistory'][_0x857e('0x27')],function(_0xb46f6a){return{'name':_0xb46f6a[_0x857e('0x28')],'type':_0xb46f6a['type'][_0x857e('0x29')]};});_0x238f9d[_0x857e('0x2a')]=_[_0x857e('0x2b')](_0x3be728,_0x857e('0x25'));_0x238f9d[_0x857e('0x2c')]=_[_0x857e('0x2d')](_0x542a0a[_0x857e('0x2c')]);_0x238f9d[_0x857e('0x2e')]=_['intersection'](_0x238f9d[_0x857e('0x2a')],_0x238f9d[_0x857e('0x2c')]);_0xecc9e4[_0x857e('0x2f')]=_[_0x857e('0x30')](_0x238f9d[_0x857e('0x2a')],qs['fields'](_0x542a0a[_0x857e('0x2c')][_0x857e('0x31')]));_0xecc9e4['attributes']=_0xecc9e4[_0x857e('0x2f')][_0x857e('0x32')]?_0xecc9e4['attributes']:_0x238f9d[_0x857e('0x2a')];if(!_0x542a0a[_0x857e('0x2c')][_0x857e('0x33')](_0x857e('0x34'))){_0xecc9e4[_0x857e('0x1d')]=qs[_0x857e('0x1d')](_0x542a0a['query'][_0x857e('0x1d')]);_0xecc9e4[_0x857e('0x1b')]=qs[_0x857e('0x1b')](_0x542a0a[_0x857e('0x2c')][_0x857e('0x1b')]);}_0xecc9e4[_0x857e('0x35')]=qs['sort'](_0x542a0a[_0x857e('0x2c')]['sort']);_0xecc9e4[_0x857e('0x36')]=qs[_0x857e('0x2e')](_[_0x857e('0x37')](_0x542a0a[_0x857e('0x2c')],_0x238f9d[_0x857e('0x2e')]),_0x3be728);if(_0x542a0a[_0x857e('0x2c')][_0x857e('0x38')]){_0xecc9e4[_0x857e('0x36')]=_['merge'](_0xecc9e4[_0x857e('0x36')],{'$or':_[_0x857e('0x2b')](_0x3be728,function(_0x431490){if(_0x431490[_0x857e('0x39')]!==_0x857e('0x3a')){var _0x225b37={};_0x225b37[_0x431490[_0x857e('0x25')]]={'$like':'%'+_0x542a0a[_0x857e('0x2c')][_0x857e('0x38')]+'%'};return _0x225b37;}})});}_0xecc9e4=_[_0x857e('0x3b')]({},_0xecc9e4,_0x542a0a[_0x857e('0x3c')]);var _0x3a2c9b={'where':_0xecc9e4[_0x857e('0x36')]};return db['CmHopperHistory'][_0x857e('0x1e')](_0x3a2c9b)['then'](function(_0x2f09df){_0x57d902['count']=_0x2f09df;if(_0x542a0a[_0x857e('0x2c')][_0x857e('0x3d')]){_0xecc9e4[_0x857e('0x3e')]=[{'all':!![]}];}return db[_0x857e('0x3f')][_0x857e('0x40')](_0xecc9e4);})[_0x857e('0x22')](function(_0x4de811){_0x57d902[_0x857e('0x41')]=_0x4de811;return _0x57d902;})[_0x857e('0x22')](respondWithFilteredResult(_0x1c07ab,_0xecc9e4))[_0x857e('0x42')](handleError(_0x1c07ab,null));};exports[_0x857e('0x43')]=function(_0x54a4be,_0x457848){var _0x353555={'raw':!![],'where':{'id':_0x54a4be[_0x857e('0x44')]['id']}},_0x582947={};_0x582947[_0x857e('0x2a')]=_['keys'](db['CmHopperHistory'][_0x857e('0x27')]);_0x582947['query']=_[_0x857e('0x2d')](_0x54a4be['query']);_0x582947[_0x857e('0x2e')]=_['intersection'](_0x582947[_0x857e('0x2a')],_0x582947[_0x857e('0x2c')]);_0x353555[_0x857e('0x2f')]=_[_0x857e('0x30')](_0x582947[_0x857e('0x2a')],qs[_0x857e('0x31')](_0x54a4be['query'][_0x857e('0x31')]));_0x353555[_0x857e('0x2f')]=_0x353555[_0x857e('0x2f')][_0x857e('0x32')]?_0x353555['attributes']:_0x582947[_0x857e('0x2a')];if(_0x54a4be[_0x857e('0x2c')][_0x857e('0x3d')]){_0x353555['include']=[{'all':!![]}];}_0x353555=_[_0x857e('0x3b')]({},_0x353555,_0x54a4be['options']);return db[_0x857e('0x3f')][_0x857e('0x45')](_0x353555)[_0x857e('0x22')](handleEntityNotFound(_0x457848,null))[_0x857e('0x22')](respondWithResult(_0x457848,null))['catch'](handleError(_0x457848,null));};exports['create']=function(_0xef8328,_0x27101a){return db[_0x857e('0x3f')]['create'](_0xef8328['body'],{})[_0x857e('0x22')](respondWithResult(_0x27101a,0xc9))[_0x857e('0x42')](handleError(_0x27101a,null));};exports['describe']=function(_0x32b628,_0x2d45a6){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0x2d45a6,null))['catch'](handleError(_0x2d45a6,null));};exports[_0x857e('0x46')]=function(_0x398a4c,_0x3564ce){if(_0x398a4c[_0x857e('0x47')][_0x857e('0x48')]){delete _0x398a4c['body'][_0x857e('0x48')];}return db[_0x857e('0x3f')][_0x857e('0x45')]({'where':{'uniqueid':_0x398a4c[_0x857e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3564ce,null))[_0x857e('0x22')](saveUpdates(_0x398a4c[_0x857e('0x47')],null))[_0x857e('0x22')](respondWithResult(_0x3564ce,null))['catch'](handleError(_0x3564ce,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 26930eb..9648ef7 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 _0x5324=['define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x535c01,_0x547181){var _0x462ba5=function(_0x5b4797){while(--_0x5b4797){_0x535c01['push'](_0x535c01['shift']());}};_0x462ba5(++_0x547181);}(_0x5324,0x154));var _0x4532=function(_0x1d8245,_0x581db2){_0x1d8245=_0x1d8245-0x0;var _0x43e0f4=_0x5324[_0x1d8245];return _0x43e0f4;};'use strict';var _=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var logger=require(_0x4532('0x2'))(_0x4532('0x3'));var moment=require('moment');var BPromise=require(_0x4532('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4532('0x5'));var rimraf=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var attributes=require(_0x4532('0x8'));module[_0x4532('0x9')]=function(_0x3f68e2,_0x2672ec){return _0x3f68e2[_0x4532('0xa')]('CmHopperHistory',attributes,{'tableName':_0x4532('0xb'),'paranoid':![],'indexes':[{'name':_0x4532('0xc'),'fields':[_0x4532('0xc')]},{'name':_0x4532('0xd'),'fields':[_0x4532('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x514ac4,_0x1f0374){_0x514ac4=_0x514ac4-0x0;var _0x372431=_0xdb28[_0x514ac4];return _0x372431;};'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('./cmHopperHistory.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'name':_0x8db2('0xc'),'fields':[_0x8db2('0xc')]},{'name':_0x8db2('0xd'),'fields':[_0x8db2('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 b121977..d42e9b3 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 _0x6931=['predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null'];(function(_0xaa7629,_0x219723){var _0x487c07=function(_0x36959c){while(--_0x36959c){_0xaa7629['push'](_0xaa7629['shift']());}};_0x487c07(++_0x219723);}(_0x6931,0xa5));var _0x1693=function(_0x191dea,_0x4d46a9){_0x191dea=_0x191dea-0x0;var _0x2c5674=_0x6931[_0x191dea];return _0x2c5674;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1693('0x2'));var fs=require('fs');var Redis=require(_0x1693('0x3'));var db=require(_0x1693('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1693('0x5'))(_0x1693('0x6'));var config=require(_0x1693('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1693('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3594e0,_0x45aa35,_0x328cfc){return new BPromise(function(_0x2ab0a0,_0x31bff8){return client[_0x1693('0x9')](_0x3594e0,_0x328cfc)[_0x1693('0xa')](function(_0x391134){logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));logger[_0x1693('0xe')](_0x1693('0xf'),_0x45aa35,_0x1693('0xd'),JSON[_0x1693('0x10')](_0x391134));if(_0x391134[_0x1693('0x11')]){if(_0x391134['error'][_0x1693('0x12')]===0x1f4){logger['error'](_0x1693('0xc'),_0x45aa35,_0x391134[_0x1693('0x11')]['message']);return _0x31bff8(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}logger[_0x1693('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x45aa35,_0x391134[_0x1693('0x11')][_0x1693('0x13')]);return _0x2ab0a0(_0x391134[_0x1693('0x11')][_0x1693('0x13')]);}else{logger[_0x1693('0xb')](_0x1693('0xc'),_0x45aa35,_0x1693('0xd'));_0x2ab0a0(_0x391134[_0x1693('0x14')][_0x1693('0x13')]);}})[_0x1693('0x15')](function(_0x59cbff){logger[_0x1693('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x45aa35,_0x59cbff);_0x31bff8(_0x59cbff);});});}exports[_0x1693('0x16')]=function(_0x20906b){var _0x2ffa86=this;return new Promise(function(_0x410c3b,_0x3f5287){return db[_0x1693('0x17')][_0x1693('0x18')](_0x20906b[_0x1693('0x19')],{'raw':_0x20906b[_0x1693('0x1a')]?_0x20906b[_0x1693('0x1a')][_0x1693('0x1b')]===undefined?!![]:![]:!![]})[_0x1693('0xa')](function(_0x17c613){logger[_0x1693('0xb')](_0x1693('0x16'),_0x20906b);logger[_0x1693('0xe')]('CreateCmHopperHistory',_0x20906b,JSON[_0x1693('0x10')](_0x17c613));_0x410c3b(_0x17c613);})[_0x1693('0x15')](function(_0x5332ae){logger[_0x1693('0x11')](_0x1693('0x16'),_0x5332ae[_0x1693('0x13')],_0x20906b);_0x3f5287(_0x2ffa86[_0x1693('0x11')](0x1f4,_0x5332ae[_0x1693('0x13')]));});});};exports['AvgHandleTime']=function(_0x28749b){var _0x46311f=this;return new Promise(function(_0x400edc,_0x4e5d82){return db[_0x1693('0x17')][_0x1693('0x1c')]({'raw':_0x28749b['options']?_0x28749b[_0x1693('0x1a')][_0x1693('0x1b')]===undefined?!![]:![]:!![],'where':_0x28749b['options']?_0x28749b['options']['where']||null:null,'attributes':[[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')][_0x1693('0x1e')]('id')),_0x1693('0x1f')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')]['literal'](_0x1693('0x20')))),_0x1693('0x21')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x23')))),_0x1693('0x24')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x1693('0x1d')]['fn'](_0x1693('0x26'),db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x1693('0x27')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x26'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x1693('0x28')]]})[_0x1693('0xa')](function(_0x4af172){logger[_0x1693('0xb')]('AvgHandleTime',_0x28749b);logger['debug']('AvgHandleTime',_0x28749b,JSON['stringify'](_0x4af172));_0x400edc(_0x4af172);})['catch'](function(_0x402f19){logger[_0x1693('0x11')](_0x1693('0x29'),_0x402f19['message'],_0x28749b);_0x4e5d82(_0x46311f[_0x1693('0x11')](0x1f4,_0x402f19[_0x1693('0x13')]));});});};exports[_0x1693('0x2a')]=function(_0x2b9744){var _0x29dabc=this;return new Promise(function(_0x3c15b9,_0x4b872e){return db[_0x1693('0x17')][_0x1693('0x1c')]({'raw':_0x2b9744[_0x1693('0x1a')]?_0x2b9744[_0x1693('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2b9744[_0x1693('0x1a')]?_0x2b9744['options'][_0x1693('0x2b')]||null:null,'attributes':[[_0x1693('0x2c'),_0x1693('0x2d')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x2e')))),_0x1693('0x2f')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')]['literal'](_0x1693('0x20')))),_0x1693('0x30')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')](_0x1693('0x31')))),_0x1693('0x32')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')](_0x1693('0x33')))),_0x1693('0x34')],[db[_0x1693('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1693('0x36')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x37')))),_0x1693('0x38')],[db['sequelize']['fn'](_0x1693('0x25'),db['sequelize']['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x39')))),_0x1693('0x3a')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x1693('0x3b')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1693('0x3c')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x1693('0x3b')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')]['fn']('IF',db['sequelize'][_0x1693('0x22')](_0x1693('0x3d')))),_0x1693('0x3e')]],'group':['campaign']})[_0x1693('0xa')](function(_0x460e39){logger[_0x1693('0xb')](_0x1693('0x2a'),_0x2b9744);logger[_0x1693('0xe')](_0x1693('0x2a'),_0x2b9744,JSON[_0x1693('0x10')](_0x460e39));_0x3c15b9(_0x460e39);})[_0x1693('0x15')](function(_0x53c73b){logger[_0x1693('0x11')](_0x1693('0x2a'),_0x53c73b['message'],_0x2b9744);_0x4b872e(_0x29dabc[_0x1693('0x11')](0x1f4,_0x53c73b[_0x1693('0x13')]));});});};exports[_0x1693('0x3f')]=function(_0xdc35d){var _0x13406d=this;return new Promise(function(_0x300543,_0x135362){return db[_0x1693('0x17')]['findAll']({'raw':_0xdc35d[_0x1693('0x1a')]?_0xdc35d[_0x1693('0x1a')][_0x1693('0x1b')]===undefined?!![]:![]:!![],'where':_0xdc35d[_0x1693('0x1a')]?_0xdc35d[_0x1693('0x1a')][_0x1693('0x2b')]||null:null,'attributes':[[_0x1693('0x2c'),_0x1693('0x2d')],[db[_0x1693('0x1d')]['fn'](_0x1693('0x25'),db[_0x1693('0x1d')][_0x1693('0x1e')]('id')),_0x1693('0x40')],[db[_0x1693('0x1d')]['fn']('COUNT',db[_0x1693('0x1d')]['fn']('IF',db[_0x1693('0x1d')][_0x1693('0x22')](_0x1693('0x20')))),_0x1693('0x41')]],'group':['campaign']})[_0x1693('0xa')](function(_0x58ab2f){logger[_0x1693('0xb')](_0x1693('0x3f'),_0xdc35d);logger[_0x1693('0xe')](_0x1693('0x3f'),_0xdc35d,JSON[_0x1693('0x10')](_0x58ab2f));_0x300543(_0x58ab2f);})[_0x1693('0x15')](function(_0x431c0e){logger[_0x1693('0x11')]('GetCampaignHopperHistory',_0x431c0e[_0x1693('0x13')],_0xdc35d);_0x135362(_0x13406d['error'](0x1f4,_0x431c0e[_0x1693('0x13')]));});});}; \ No newline at end of file +var _0x8c58=['`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','debug','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','AvgHandleTime','findAll','where','sequelize','predictiveIntervalTotalCalls','literal'];(function(_0x1cc1e3,_0x4598a4){var _0x2843cc=function(_0x24261b){while(--_0x24261b){_0x1cc1e3['push'](_0x1cc1e3['shift']());}};_0x2843cc(++_0x4598a4);}(_0x8c58,0xba));var _0x88c5=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x8c58[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x88c5('0x0'));var util=require(_0x88c5('0x1'));var moment=require('moment');var BPromise=require(_0x88c5('0x2'));var rs=require(_0x88c5('0x3'));var fs=require('fs');var Redis=require(_0x88c5('0x4'));var db=require(_0x88c5('0x5'))['db'];var utils=require(_0x88c5('0x6'));var logger=require(_0x88c5('0x7'))(_0x88c5('0x8'));var config=require(_0x88c5('0x9'));var jayson=require(_0x88c5('0xa'));var client=jayson[_0x88c5('0xb')][_0x88c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26f059,_0x30a1a3,_0x44e6f5){return new BPromise(function(_0x5a0b92,_0x52416e){return client[_0x88c5('0xd')](_0x26f059,_0x44e6f5)[_0x88c5('0xe')](function(_0x2967b2){logger['info'](_0x88c5('0xf'),_0x30a1a3,_0x88c5('0x10'));logger['debug'](_0x88c5('0x11'),_0x30a1a3,_0x88c5('0x10'),JSON[_0x88c5('0x12')](_0x2967b2));if(_0x2967b2[_0x88c5('0x13')]){if(_0x2967b2['error'][_0x88c5('0x14')]===0x1f4){logger[_0x88c5('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x30a1a3,_0x2967b2[_0x88c5('0x13')][_0x88c5('0x15')]);return _0x52416e(_0x2967b2[_0x88c5('0x13')][_0x88c5('0x15')]);}logger[_0x88c5('0x13')](_0x88c5('0xf'),_0x30a1a3,_0x2967b2['error'][_0x88c5('0x15')]);return _0x5a0b92(_0x2967b2[_0x88c5('0x13')][_0x88c5('0x15')]);}else{logger[_0x88c5('0x16')]('CmHopperHistory,\x20%s,\x20%s',_0x30a1a3,_0x88c5('0x10'));_0x5a0b92(_0x2967b2[_0x88c5('0x17')][_0x88c5('0x15')]);}})[_0x88c5('0x18')](function(_0xd014bb){logger[_0x88c5('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x30a1a3,_0xd014bb);_0x52416e(_0xd014bb);});});}exports[_0x88c5('0x19')]=function(_0x3675aa){var _0x2e6737=this;return new Promise(function(_0x342371,_0x12dd04){return db[_0x88c5('0x1a')][_0x88c5('0x1b')](_0x3675aa['body'],{'raw':_0x3675aa[_0x88c5('0x1c')]?_0x3675aa[_0x88c5('0x1c')][_0x88c5('0x1d')]===undefined?!![]:![]:!![]})[_0x88c5('0xe')](function(_0x737835){logger[_0x88c5('0x16')](_0x88c5('0x19'),_0x3675aa);logger['debug'](_0x88c5('0x19'),_0x3675aa,JSON['stringify'](_0x737835));_0x342371(_0x737835);})[_0x88c5('0x18')](function(_0x1db033){logger[_0x88c5('0x13')](_0x88c5('0x19'),_0x1db033[_0x88c5('0x15')],_0x3675aa);_0x12dd04(_0x2e6737[_0x88c5('0x13')](0x1f4,_0x1db033[_0x88c5('0x15')]));});});};exports[_0x88c5('0x1e')]=function(_0x10aee4){var _0x25c3f3=this;return new Promise(function(_0x452eb7,_0x494d21){return db[_0x88c5('0x1a')][_0x88c5('0x1f')]({'raw':_0x10aee4[_0x88c5('0x1c')]?_0x10aee4['options'][_0x88c5('0x1d')]===undefined?!![]:![]:!![],'where':_0x10aee4[_0x88c5('0x1c')]?_0x10aee4['options'][_0x88c5('0x20')]||null:null,'attributes':[[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')]['col']('id')),_0x88c5('0x22')],[db['sequelize']['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x24')))),_0x88c5('0x25')],[db['sequelize']['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x29'),db[_0x88c5('0x21')]['fn']('IF',db['sequelize'][_0x88c5('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x88c5('0x2a')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x29'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x2b')))),_0x88c5('0x2c')]]})[_0x88c5('0xe')](function(_0xd5558d){logger[_0x88c5('0x16')](_0x88c5('0x1e'),_0x10aee4);logger['debug'](_0x88c5('0x1e'),_0x10aee4,JSON[_0x88c5('0x12')](_0xd5558d));_0x452eb7(_0xd5558d);})[_0x88c5('0x18')](function(_0x70d855){logger['error'](_0x88c5('0x1e'),_0x70d855['message'],_0x10aee4);_0x494d21(_0x25c3f3[_0x88c5('0x13')](0x1f4,_0x70d855[_0x88c5('0x15')]));});});};exports[_0x88c5('0x2d')]=function(_0x210514){var _0x3269cb=this;return new Promise(function(_0x27b5b1,_0x397d99){return db[_0x88c5('0x1a')][_0x88c5('0x1f')]({'raw':_0x210514['options']?_0x210514[_0x88c5('0x1c')][_0x88c5('0x1d')]===undefined?!![]:![]:!![],'where':_0x210514[_0x88c5('0x1c')]?_0x210514[_0x88c5('0x1c')][_0x88c5('0x20')]||null:null,'attributes':[[_0x88c5('0x2e'),_0x88c5('0x2f')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x30')))),_0x88c5('0x31')],[db['sequelize']['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')]['literal'](_0x88c5('0x32')))),_0x88c5('0x33')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db['sequelize']['fn']('IF',db[_0x88c5('0x21')]['literal'](_0x88c5('0x24')))),_0x88c5('0x34')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x35')))),_0x88c5('0x36')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')]['literal'](_0x88c5('0x37')))),_0x88c5('0x38')],[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')]['literal'](_0x88c5('0x39')))),_0x88c5('0x3a')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x3b')))),_0x88c5('0x3c')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x3d')))),_0x88c5('0x3e')],[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')]('`state`\x20=\x2013,\x201,\x20null'))),_0x88c5('0x3f')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db[_0x88c5('0x21')]['fn']('IF',db['sequelize']['literal'](_0x88c5('0x40')))),_0x88c5('0x41')],[db['sequelize']['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x88c5('0x42')],[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x43')))),'outboundAnswerAgiCallsDay'],[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db[_0x88c5('0x21')][_0x88c5('0x23')](_0x88c5('0x44')))),'outboundRejectCallsDay'],[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')]['fn']('IF',db['sequelize']['literal'](_0x88c5('0x45')))),'outboundReCallsDay']],'group':[_0x88c5('0x2e')]})[_0x88c5('0xe')](function(_0x3c6ce0){logger[_0x88c5('0x16')]('GetVoiceQueueHopperHistory',_0x210514);logger[_0x88c5('0x46')]('GetVoiceQueueHopperHistory',_0x210514,JSON[_0x88c5('0x12')](_0x3c6ce0));_0x27b5b1(_0x3c6ce0);})['catch'](function(_0x435f9e){logger[_0x88c5('0x13')]('GetVoiceQueueHopperHistory',_0x435f9e[_0x88c5('0x15')],_0x210514);_0x397d99(_0x3269cb['error'](0x1f4,_0x435f9e[_0x88c5('0x15')]));});});};exports[_0x88c5('0x47')]=function(_0x1917d7){var _0x190e9c=this;return new Promise(function(_0x49b5da,_0x2960ce){return db['CmHopperHistory'][_0x88c5('0x1f')]({'raw':_0x1917d7[_0x88c5('0x1c')]?_0x1917d7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1917d7[_0x88c5('0x1c')]?_0x1917d7[_0x88c5('0x1c')]['where']||null:null,'attributes':[[_0x88c5('0x2e'),_0x88c5('0x2f')],[db[_0x88c5('0x21')]['fn']('COUNT',db[_0x88c5('0x21')][_0x88c5('0x48')]('id')),_0x88c5('0x49')],[db[_0x88c5('0x21')]['fn'](_0x88c5('0x26'),db['sequelize']['fn']('IF',db['sequelize'][_0x88c5('0x23')](_0x88c5('0x24')))),'ivrAnswerCallsDay']],'group':[_0x88c5('0x2e')]})[_0x88c5('0xe')](function(_0x12d231){logger['info']('GetCampaignHopperHistory',_0x1917d7);logger[_0x88c5('0x46')](_0x88c5('0x47'),_0x1917d7,JSON[_0x88c5('0x12')](_0x12d231));_0x49b5da(_0x12d231);})[_0x88c5('0x18')](function(_0x94d73e){logger[_0x88c5('0x13')](_0x88c5('0x47'),_0x94d73e['message'],_0x1917d7);_0x2960ce(_0x190e9c[_0x88c5('0x13')](0x1f4,_0x94d73e[_0x88c5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a38f6ba..a24aa1d 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 _0x128c=['isAuthenticated','index','describe','show','post','create','put','/:id','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x4d515d,_0x108c96){var _0x58fe07=function(_0x2e18bf){while(--_0x2e18bf){_0x4d515d['push'](_0x4d515d['shift']());}};_0x58fe07(++_0x108c96);}(_0x128c,0x122));var _0xc128=function(_0x560120,_0x21f47b){_0x560120=_0x560120-0x0;var _0x363af0=_0x128c[_0x560120];return _0x363af0;};'use strict';var multer=require(_0xc128('0x0'));var util=require('util');var path=require(_0xc128('0x1'));var timeout=require('connect-timeout');var express=require(_0xc128('0x2'));var router=express[_0xc128('0x3')]();var fs_extra=require(_0xc128('0x4'));var auth=require(_0xc128('0x5'));var interaction=require(_0xc128('0x6'));var config=require(_0xc128('0x7'));var controller=require(_0xc128('0x8'));router[_0xc128('0x9')]('/',auth[_0xc128('0xa')](),controller[_0xc128('0xb')]);router[_0xc128('0x9')]('/describe',auth[_0xc128('0xa')](),controller[_0xc128('0xc')]);router[_0xc128('0x9')]('/:id',auth[_0xc128('0xa')](),controller[_0xc128('0xd')]);router[_0xc128('0xe')]('/',auth[_0xc128('0xa')](),controller[_0xc128('0xf')]);router[_0xc128('0x10')](_0xc128('0x11'),auth[_0xc128('0xa')](),controller[_0xc128('0x12')]);module[_0xc128('0x13')]=router; \ No newline at end of file +var _0x23a1=['../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','post','put','/:id','update','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x19c9d0,_0x4c6f81){var _0x6de53e=function(_0x135875){while(--_0x135875){_0x19c9d0['push'](_0x19c9d0['shift']());}};_0x6de53e(++_0x4c6f81);}(_0x23a1,0x73));var _0x123a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x23a1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x123a('0x0'));var timeout=require(_0x123a('0x1'));var express=require(_0x123a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x123a('0x3'));var interaction=require(_0x123a('0x4'));var config=require(_0x123a('0x5'));var controller=require(_0x123a('0x6'));router[_0x123a('0x7')]('/',auth[_0x123a('0x8')](),controller['index']);router['get'](_0x123a('0x9'),auth[_0x123a('0x8')](),controller[_0x123a('0xa')]);router['get']('/:id',auth[_0x123a('0x8')](),controller['show']);router[_0x123a('0xb')]('/',auth[_0x123a('0x8')](),controller['create']);router[_0x123a('0xc')](_0x123a('0xd'),auth[_0x123a('0x8')](),controller[_0x123a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index bc59850..0b51381 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 _0xc3b5=['name','STRING'];(function(_0x29aca7,_0x21c650){var _0x1db0a0=function(_0x45b5ea){while(--_0x45b5ea){_0x29aca7['push'](_0x29aca7['shift']());}};_0x1db0a0(++_0x21c650);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4eb36b,_0x8b797a){_0x4eb36b=_0x4eb36b-0x0;var _0x2fc06f=_0xc3b5[_0x4eb36b];return _0x2fc06f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5c3b('0x0')],'unique':_0x5c3b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5c3b('0x0')]},'dialPrefix':{'type':Sequelize[_0x5c3b('0x0')]}}; \ No newline at end of file +var _0x536e=['name','sequelize','exports','STRING'];(function(_0x105233,_0xd0c461){var _0x28006d=function(_0x13e659){while(--_0x13e659){_0x105233['push'](_0x105233['shift']());}};_0x28006d(++_0xd0c461);}(_0x536e,0x155));var _0xe536=function(_0x6b8e6,_0x5b5b8d){_0x6b8e6=_0x6b8e6-0x0;var _0x11e8d9=_0x536e[_0x6b8e6];return _0x11e8d9;};'use strict';var Sequelize=require(_0xe536('0x0'));module[_0xe536('0x1')]={'name':{'type':Sequelize[_0xe536('0x2')],'unique':_0xe536('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe536('0x2')]},'dialPrefix':{'type':Sequelize[_0xe536('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ca7b7f5..3c01b15 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 _0x7cf5=['sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','get','Lists','UserProfileResource','destroy','error','name','index','map','CmList','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','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','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','tags','isArray','join','push','each','success','errors','message','CmContact','concat','CustomFields','cf_%d','length','hasOwnProperty','nolimit','raw','getContacts','CmCustomField','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','defaultValue','sequelize','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register'];(function(_0x502cf2,_0x3478fb){var _0x3515af=function(_0x2978bb){while(--_0x2978bb){_0x502cf2['push'](_0x502cf2['shift']());}};_0x3515af(++_0x3478fb);}(_0x7cf5,0x75));var _0x57cf=function(_0x564782,_0x4f0b92){_0x564782=_0x564782-0x0;var _0x3d2a1d=_0x7cf5[_0x564782];return _0x3d2a1d;};'use strict';var emlformat=require(_0x57cf('0x0'));var rimraf=require(_0x57cf('0x1'));var zipdir=require(_0x57cf('0x2'));var jsonpatch=require(_0x57cf('0x3'));var rp=require(_0x57cf('0x4'));var moment=require(_0x57cf('0x5'));var BPromise=require(_0x57cf('0x6'));var Mustache=require(_0x57cf('0x7'));var util=require(_0x57cf('0x8'));var path=require(_0x57cf('0x9'));var sox=require(_0x57cf('0xa'));var csv=require(_0x57cf('0xb'));var ejs=require(_0x57cf('0xc'));var fs=require('fs');var fs_extra=require(_0x57cf('0xd'));var _=require(_0x57cf('0xe'));var squel=require(_0x57cf('0xf'));var crypto=require(_0x57cf('0x10'));var jsforce=require(_0x57cf('0x11'));var deskjs=require(_0x57cf('0x12'));var toCsv=require('to-csv');var querystring=require(_0x57cf('0x13'));var Papa=require(_0x57cf('0x14'));var Redis=require(_0x57cf('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x57cf('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57cf('0x17'));var utils=require('../../config/utils');var config=require(_0x57cf('0x18'));var licenseUtil=require(_0x57cf('0x19'));var db=require(_0x57cf('0x1a'))['db'];config['redis']=_['defaults'](config[_0x57cf('0x1b')],{'host':_0x57cf('0x1c'),'port':0x18eb});var socket=require(_0x57cf('0x1d'))(new Redis(config[_0x57cf('0x1b')]));require(_0x57cf('0x1e'))[_0x57cf('0x1f')](socket);function respondWithStatusCode(_0x28e18b,_0x4cb84b){_0x4cb84b=_0x4cb84b||0xcc;return function(_0x1b0f8a){if(_0x1b0f8a){return _0x28e18b[_0x57cf('0x20')](_0x4cb84b);}return _0x28e18b[_0x57cf('0x21')](_0x4cb84b)[_0x57cf('0x22')]();};}function respondWithResult(_0x3af0c0,_0x8e743e){_0x8e743e=_0x8e743e||0xc8;return function(_0x3d12d8){if(_0x3d12d8){return _0x3af0c0['status'](_0x8e743e)[_0x57cf('0x23')](_0x3d12d8);}};}function respondWithFilteredResult(_0x253f30,_0x1f0c29){return function(_0x2f616b){if(_0x2f616b){var _0x5e2911=typeof _0x1f0c29[_0x57cf('0x24')]==='undefined'&&typeof _0x1f0c29['limit']===_0x57cf('0x25');var _0x24d2f3=_0x2f616b[_0x57cf('0x26')];var _0x552484=_0x5e2911?0x0:_0x1f0c29[_0x57cf('0x24')];var _0x44e006=_0x5e2911?_0x2f616b[_0x57cf('0x26')]:_0x1f0c29[_0x57cf('0x24')]+_0x1f0c29['limit'];var _0x362643;if(_0x44e006>=_0x24d2f3){_0x44e006=_0x24d2f3;_0x362643=0xc8;}else{_0x362643=0xce;}_0x253f30[_0x57cf('0x21')](_0x362643);return _0x253f30['set'](_0x57cf('0x27'),_0x552484+'-'+_0x44e006+'/'+_0x24d2f3)[_0x57cf('0x23')](_0x2f616b);}return null;};}function patchUpdates(_0x337135){return function(_0xa1a670){try{jsonpatch[_0x57cf('0x28')](_0xa1a670,_0x337135,!![]);}catch(_0x2c13a7){return BPromise[_0x57cf('0x29')](_0x2c13a7);}return _0xa1a670['save']();};}function saveUpdates(_0x4f96ec,_0x182b0a){return function(_0xe8fa63){if(_0xe8fa63){return _0xe8fa63[_0x57cf('0x2a')](_0x4f96ec)[_0x57cf('0x2b')](function(_0x56dbc5){return _0x56dbc5;});}return null;};}function removeEntity(_0x2cace8,_0x1c5454){return function(_0x1785d5){if(_0x1785d5){return _0x1785d5['destroy']()[_0x57cf('0x2b')](function(){var _0x18362c=_0x1785d5[_0x57cf('0x2c')]({'plain':!![]});var _0x4ce4af=_0x57cf('0x2d');return db[_0x57cf('0x2e')][_0x57cf('0x2f')]({'where':{'type':_0x4ce4af,'resourceId':_0x18362c['id']}})[_0x57cf('0x2b')](function(){return _0x1785d5;});})[_0x57cf('0x2b')](function(){_0x2cace8[_0x57cf('0x21')](0xcc)[_0x57cf('0x22')]();});}};}function handleEntityNotFound(_0x4a0b3b,_0x517200){return function(_0x24be9d){if(!_0x24be9d){_0x4a0b3b[_0x57cf('0x20')](0x194);}return _0x24be9d;};}function handleError(_0x3a2f3c,_0x410421){_0x410421=_0x410421||0x1f4;return function(_0x3bb3f4){logger[_0x57cf('0x30')](_0x3bb3f4['stack']);if(_0x3bb3f4[_0x57cf('0x31')]){delete _0x3bb3f4[_0x57cf('0x31')];}_0x3a2f3c['status'](_0x410421)['send'](_0x3bb3f4);};}exports[_0x57cf('0x32')]=function(_0x199226,_0x5cad1f){var _0x315ed6={},_0x4fb313={},_0x5b758d={'count':0x0,'rows':[]};var _0x2616fe=_[_0x57cf('0x33')](db[_0x57cf('0x34')][_0x57cf('0x35')],function(_0x3bd913){return{'name':_0x3bd913[_0x57cf('0x36')],'type':_0x3bd913[_0x57cf('0x37')]['key']};});_0x4fb313['model']=_[_0x57cf('0x33')](_0x2616fe,_0x57cf('0x31'));_0x4fb313[_0x57cf('0x38')]=_[_0x57cf('0x39')](_0x199226[_0x57cf('0x38')]);_0x4fb313['filters']=_[_0x57cf('0x3a')](_0x4fb313[_0x57cf('0x3b')],_0x4fb313[_0x57cf('0x38')]);_0x315ed6[_0x57cf('0x3c')]=_['intersection'](_0x4fb313[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x199226[_0x57cf('0x38')][_0x57cf('0x3d')]));_0x315ed6[_0x57cf('0x3c')]=_0x315ed6['attributes']['length']?_0x315ed6['attributes']:_0x4fb313[_0x57cf('0x3b')];if(!_0x199226[_0x57cf('0x38')]['hasOwnProperty']('nolimit')){_0x315ed6[_0x57cf('0x3e')]=qs[_0x57cf('0x3e')](_0x199226[_0x57cf('0x38')][_0x57cf('0x3e')]);_0x315ed6[_0x57cf('0x24')]=qs[_0x57cf('0x24')](_0x199226['query']['offset']);}_0x315ed6[_0x57cf('0x3f')]=qs[_0x57cf('0x40')](_0x199226[_0x57cf('0x38')][_0x57cf('0x40')]);_0x315ed6[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x199226['query'],_0x4fb313['filters']),_0x2616fe);if(_0x199226[_0x57cf('0x38')][_0x57cf('0x44')]){_0x315ed6[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x315ed6[_0x57cf('0x41')],{'$or':_['map'](_0x2616fe,function(_0x261494){if(_0x261494[_0x57cf('0x37')]!==_0x57cf('0x46')){var _0x16a853={};_0x16a853[_0x261494[_0x57cf('0x31')]]={'$like':'%'+_0x199226[_0x57cf('0x38')]['filter']+'%'};return _0x16a853;}})});}_0x315ed6=_[_0x57cf('0x45')]({},_0x315ed6,_0x199226[_0x57cf('0x47')]);var _0x595708={'where':_0x315ed6[_0x57cf('0x41')]};return db[_0x57cf('0x34')][_0x57cf('0x26')](_0x595708)[_0x57cf('0x2b')](function(_0x38b516){_0x5b758d[_0x57cf('0x26')]=_0x38b516;if(_0x199226[_0x57cf('0x38')][_0x57cf('0x48')]){_0x315ed6[_0x57cf('0x49')]=[{'all':!![]}];}return db[_0x57cf('0x34')][_0x57cf('0x4a')](_0x315ed6);})['then'](function(_0x7b081){_0x5b758d[_0x57cf('0x4b')]=_0x7b081;return _0x5b758d;})['then'](respondWithFilteredResult(_0x5cad1f,_0x315ed6))[_0x57cf('0x4c')](handleError(_0x5cad1f,null));};exports['show']=function(_0x174ad4,_0x685d1e){var _0x3a52c0={'raw':![],'where':{'id':_0x174ad4[_0x57cf('0x4d')]['id']}},_0x2ee93d={};_0x2ee93d[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x34')][_0x57cf('0x35')]);_0x2ee93d['query']=_[_0x57cf('0x39')](_0x174ad4[_0x57cf('0x38')]);_0x2ee93d[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x2ee93d['model'],_0x2ee93d[_0x57cf('0x38')]);_0x3a52c0[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x2ee93d[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x174ad4['query'][_0x57cf('0x3d')]));_0x3a52c0[_0x57cf('0x3c')]=_0x3a52c0['attributes']['length']?_0x3a52c0[_0x57cf('0x3c')]:_0x2ee93d[_0x57cf('0x3b')];if(_0x174ad4['query'][_0x57cf('0x48')]){_0x3a52c0['include']=[{'all':!![]}];}_0x3a52c0=_[_0x57cf('0x45')]({},_0x3a52c0,_0x174ad4[_0x57cf('0x47')]);return db[_0x57cf('0x34')][_0x57cf('0x4e')](_0x3a52c0)['then'](handleEntityNotFound(_0x685d1e,null))['then'](respondWithResult(_0x685d1e,null))[_0x57cf('0x4c')](handleError(_0x685d1e,null));};exports[_0x57cf('0x4f')]=function(_0x600b58,_0x22d55a){return db[_0x57cf('0x34')]['create'](_0x600b58[_0x57cf('0x50')],{})[_0x57cf('0x2b')](function(_0x411072){var _0x5b27aa=_0x600b58[_0x57cf('0x51')][_0x57cf('0x2c')]({'plain':!![]});if(!_0x5b27aa)throw new Error(_0x57cf('0x52'));if(_0x5b27aa[_0x57cf('0x53')]===_0x57cf('0x51')){var _0x4c81ce=_0x411072[_0x57cf('0x2c')]({'plain':!![]});var _0x285c89=_0x57cf('0x2d');return db[_0x57cf('0x54')][_0x57cf('0x4e')]({'where':{'name':_0x285c89,'userProfileId':_0x5b27aa[_0x57cf('0x55')]},'raw':!![]})[_0x57cf('0x2b')](function(_0x4c7e87){if(_0x4c7e87&&_0x4c7e87[_0x57cf('0x56')]===0x0){return db[_0x57cf('0x2e')]['create']({'name':_0x4c81ce[_0x57cf('0x31')],'resourceId':_0x4c81ce['id'],'type':_0x4c7e87[_0x57cf('0x31')],'sectionId':_0x4c7e87['id']},{})[_0x57cf('0x2b')](function(){return _0x411072;});}else{return _0x411072;}})['catch'](function(_0x182608){logger[_0x57cf('0x30')](_0x57cf('0x57'),_0x182608);throw _0x182608;});}return _0x411072;})[_0x57cf('0x2b')](respondWithResult(_0x22d55a,0xc9))[_0x57cf('0x4c')](handleError(_0x22d55a,null));};exports[_0x57cf('0x2a')]=function(_0x3b7de0,_0x1dbe5f){if(_0x3b7de0[_0x57cf('0x50')]['id']){delete _0x3b7de0['body']['id'];}return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x3b7de0[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x1dbe5f,null))[_0x57cf('0x2b')](saveUpdates(_0x3b7de0['body'],null))[_0x57cf('0x2b')](respondWithResult(_0x1dbe5f,null))[_0x57cf('0x4c')](handleError(_0x1dbe5f,null));};exports[_0x57cf('0x2f')]=function(_0x1fa7d5,_0x30003e){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x1fa7d5['params']['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x30003e,null))[_0x57cf('0x2b')](removeEntity(_0x30003e,null))['catch'](handleError(_0x30003e,null));};exports[_0x57cf('0x58')]=function(_0x59935b,_0x7bb108){return db[_0x57cf('0x34')][_0x57cf('0x58')]()['then'](respondWithResult(_0x7bb108,null))[_0x57cf('0x4c')](handleError(_0x7bb108,null));};exports[_0x57cf('0x59')]=function(_0x392f5a,_0x12e80e,_0x2425d6){if(_0x392f5a[_0x57cf('0x50')]['id']){delete _0x392f5a[_0x57cf('0x50')]['id'];}return db[_0x57cf('0x34')]['find']({'where':{'id':_0x392f5a[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x12e80e,null))['then'](function(_0x4b707e){if(_0x4b707e){_0x392f5a[_0x57cf('0x50')][_0x57cf('0x5a')]=_0x4b707e['id'];return db[_0x57cf('0x5b')]['create'](_0x392f5a[_0x57cf('0x50')]);}})[_0x57cf('0x2b')](respondWithResult(_0x12e80e,null))[_0x57cf('0x4c')](handleError(_0x12e80e,null));};exports[_0x57cf('0x5c')]=function(_0x1f0dfd,_0x2a4baf,_0x488995){var _0x48c55c={'raw':![],'where':{}};var _0x19d4c7={};var _0x506f47={'count':0x0,'rows':[]};return db[_0x57cf('0x34')][_0x57cf('0x5d')]({'where':{'id':_0x1f0dfd[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x2a4baf,null))[_0x57cf('0x2b')](function(_0x4f3956){if(_0x4f3956){_0x19d4c7[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x5b')][_0x57cf('0x35')]);_0x19d4c7[_0x57cf('0x38')]=_[_0x57cf('0x39')](_0x1f0dfd[_0x57cf('0x38')]);_0x19d4c7[_0x57cf('0x42')]=_['intersection'](_0x19d4c7[_0x57cf('0x3b')],_0x19d4c7[_0x57cf('0x38')]);_0x48c55c[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x19d4c7[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x1f0dfd['query'][_0x57cf('0x3d')]));_0x48c55c[_0x57cf('0x3c')]=_0x48c55c[_0x57cf('0x3c')]['length']?_0x48c55c[_0x57cf('0x3c')]:_0x19d4c7[_0x57cf('0x3b')];if(!_0x1f0dfd[_0x57cf('0x38')]['hasOwnProperty']('nolimit')){_0x48c55c['limit']=qs['limit'](_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x3e')]);_0x48c55c['offset']=qs[_0x57cf('0x24')](_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x24')]);}_0x48c55c[_0x57cf('0x3f')]=qs[_0x57cf('0x40')](_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x40')]);_0x48c55c[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x1f0dfd[_0x57cf('0x38')],_0x19d4c7[_0x57cf('0x42')]));_0x48c55c[_0x57cf('0x41')][_0x57cf('0x5a')]=_0x4f3956['id'];if(_0x1f0dfd['query']['filter']){_0x48c55c[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x48c55c[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x48c55c['attributes'],function(_0x4911e9){var _0x25889b={};_0x25889b[_0x4911e9]={'$like':'%'+_0x1f0dfd['query'][_0x57cf('0x44')]+'%'};return _0x25889b;})});}_0x48c55c=_[_0x57cf('0x45')]({},_0x48c55c,_0x1f0dfd['options']);return db[_0x57cf('0x5b')][_0x57cf('0x26')]({'where':_0x48c55c[_0x57cf('0x41')]})[_0x57cf('0x2b')](function(_0x3b9732){_0x506f47[_0x57cf('0x26')]=_0x3b9732;if(_0x1f0dfd[_0x57cf('0x38')][_0x57cf('0x48')]){_0x48c55c[_0x57cf('0x49')]=[{'all':!![]}];}return db['Disposition'][_0x57cf('0x4a')](_0x48c55c);})[_0x57cf('0x2b')](function(_0x59cf6f){_0x506f47[_0x57cf('0x4b')]=_0x59cf6f;return _0x506f47;});}})['then'](respondWithFilteredResult(_0x2a4baf,_0x48c55c))['catch'](handleError(_0x2a4baf,null));};exports[_0x57cf('0x5e')]=function(_0x3ab0a6,_0x34276f,_0x46953c){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x3ab0a6[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x34276f,null))['then'](function(_0x5ebf45){if(_0x5ebf45){return _0x5ebf45['removeDispositions'](_0x3ab0a6['query'][_0x57cf('0x5f')]);}})[_0x57cf('0x2b')](respondWithStatusCode(_0x34276f,null))['catch'](handleError(_0x34276f,null));};exports['addContacts']=function(_0x2c0060,_0x3d91d5,_0x330997){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x2c0060[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x3d91d5,null))[_0x57cf('0x2b')](function(_0x38afe1){if(_0x38afe1){var _0x57b872=[];var _0x517229={'success':[],'errors':[]};return db['CmContact']['describe']()['then'](function(_0x4c2792){if(_0x2c0060['body'][_0x57cf('0x60')]&&_[_0x57cf('0x61')](_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')])){if(_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')]['length']){_0x2c0060[_0x57cf('0x50')]['tags']=_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')][_0x57cf('0x62')](';')+';';}else{_0x2c0060['body'][_0x57cf('0x60')]=null;}}else{_0x2c0060[_0x57cf('0x50')][_0x57cf('0x60')]=null;}if(_0x2c0060[_0x57cf('0x50')]&&_[_0x57cf('0x61')](_0x2c0060[_0x57cf('0x50')])){for(var _0x5791a3=0x0;_0x5791a3<_0x2c0060[_0x57cf('0x50')]['length'];_0x5791a3+=0x1){_0x2c0060[_0x57cf('0x50')][_0x5791a3][_0x57cf('0x5a')]=_0x2c0060[_0x57cf('0x4d')]['id'];_0x57b872[_0x57cf('0x63')](_0x2c0060['body'][_0x5791a3]);}return BPromise[_0x57cf('0x64')](_0x57b872,function(_0x16e9a6){return db['CmContact'][_0x57cf('0x4f')](_['omit'](_0x16e9a6,[_0x57cf('0x5f'),'id'])||{},{'fields':_[_0x57cf('0x39')](_0x4c2792),'raw':!![]})[_0x57cf('0x2b')](function(_0x540ed1){_0x517229[_0x57cf('0x65')][_0x57cf('0x63')](_0x540ed1['dataValues']);})['catch'](function(_0x3eb60a){_0x517229[_0x57cf('0x66')][_0x57cf('0x63')]({'data':_0x16e9a6,'error':_0x3eb60a[_0x57cf('0x67')]});});})[_0x57cf('0x2b')](function(_0x455f8a){return _0x517229;})[_0x57cf('0x4c')](function(_0x12fcd5){return _0x12fcd5;});}else{_0x3d91d5['status'](0x190)[_0x57cf('0x23')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x57cf('0x2b')](respondWithResult(_0x3d91d5,null))[_0x57cf('0x4c')](handleError(_0x3d91d5,null));};exports['getContacts']=function(_0x2e566a,_0x45b63d,_0x1006a7){var _0x37b1b4;return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x2e566a[_0x57cf('0x4d')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x57cf('0x2b')](handleEntityNotFound(_0x45b63d,null))[_0x57cf('0x2b')](function(_0x3ae255){if(_0x3ae255){_0x37b1b4=_0x3ae255;return db[_0x57cf('0x68')][_0x57cf('0x35')];}})[_0x57cf('0x2b')](function(_0x5693ff){if(_0x5693ff){var _0x56af6e={};var _0x4b9e66={};_0x4b9e66[_0x57cf('0x3b')]=_[_0x57cf('0x69')](_[_0x57cf('0x39')](_0x5693ff),_[_0x57cf('0x33')](_0x37b1b4[_0x57cf('0x6a')],function(_0x34041d){return util['format'](_0x57cf('0x6b'),_0x34041d['id']);}));_0x4b9e66[_0x57cf('0x38')]=_['keys'](_0x2e566a[_0x57cf('0x38')]);_0x4b9e66[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x4b9e66[_0x57cf('0x3b')],_0x4b9e66['query']);_0x56af6e['attributes']=_[_0x57cf('0x3a')](_0x4b9e66[_0x57cf('0x3b')],qs['fields'](_0x2e566a[_0x57cf('0x38')][_0x57cf('0x3d')]));_0x56af6e[_0x57cf('0x3c')]=_0x56af6e['attributes'][_0x57cf('0x6c')]?_0x56af6e['attributes']:_0x4b9e66[_0x57cf('0x3b')];if(!_0x2e566a[_0x57cf('0x38')][_0x57cf('0x6d')](_0x57cf('0x6e'))){_0x56af6e[_0x57cf('0x3e')]=qs[_0x57cf('0x3e')](_0x2e566a['query'][_0x57cf('0x3e')]);_0x56af6e[_0x57cf('0x24')]=qs[_0x57cf('0x24')](_0x2e566a[_0x57cf('0x38')][_0x57cf('0x24')]);}_0x56af6e['order']=qs[_0x57cf('0x40')](_0x2e566a[_0x57cf('0x38')][_0x57cf('0x40')]);_0x56af6e[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x2e566a[_0x57cf('0x38')],_0x4b9e66[_0x57cf('0x42')]));_0x56af6e[_0x57cf('0x6f')]=!![];if(_0x2e566a[_0x57cf('0x38')][_0x57cf('0x44')]){_0x56af6e[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x56af6e[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x56af6e[_0x57cf('0x3c')],function(_0x3c5d67){var _0x37238d={};_0x37238d[_0x3c5d67]={'$like':'%'+_0x2e566a['query'][_0x57cf('0x44')]+'%'};return _0x37238d;})});}_0x56af6e=_[_0x57cf('0x45')]({},_0x56af6e,_0x2e566a[_0x57cf('0x47')]);return _0x37b1b4[_0x57cf('0x70')](_0x56af6e);}})[_0x57cf('0x2b')](respondWithResult(_0x45b63d,null))[_0x57cf('0x4c')](handleError(_0x45b63d,null));};exports['getContactsCsv']=function(_0x52545e,_0x81047c,_0x2a2d17){var _0x565589;return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x52545e[_0x57cf('0x4d')]['id']},'include':[{'model':db[_0x57cf('0x71')],'as':_0x57cf('0x6a')}]})[_0x57cf('0x2b')](handleEntityNotFound(_0x81047c,null))[_0x57cf('0x2b')](function(_0x1b3cc9){if(_0x1b3cc9){_0x565589=_0x1b3cc9;return db[_0x57cf('0x68')][_0x57cf('0x35')];}})[_0x57cf('0x2b')](function(_0x562a09){if(_0x562a09){var _0x518713={};var _0x28c3ba={};_0x28c3ba[_0x57cf('0x3b')]=_[_0x57cf('0x69')](_[_0x57cf('0x39')](_0x562a09),_[_0x57cf('0x33')](_0x565589[_0x57cf('0x6a')],function(_0x301414){return util[_0x57cf('0x72')](_0x57cf('0x6b'),_0x301414['id']);}));_0x28c3ba[_0x57cf('0x38')]=_[_0x57cf('0x39')](_0x52545e['query']);_0x28c3ba[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x28c3ba[_0x57cf('0x3b')],_0x28c3ba[_0x57cf('0x38')]);_0x518713['attributes']=_[_0x57cf('0x3a')](_0x28c3ba['model'],qs[_0x57cf('0x3d')](_0x52545e[_0x57cf('0x38')]['fields']));_0x518713[_0x57cf('0x3c')]=_0x518713[_0x57cf('0x3c')]['length']?_0x518713[_0x57cf('0x3c')]:_0x28c3ba[_0x57cf('0x3b')];if(!_0x52545e[_0x57cf('0x38')][_0x57cf('0x6d')](_0x57cf('0x6e'))){_0x518713[_0x57cf('0x3e')]=qs[_0x57cf('0x3e')](_0x52545e['query'][_0x57cf('0x3e')]);_0x518713[_0x57cf('0x24')]=qs[_0x57cf('0x24')](_0x52545e[_0x57cf('0x38')]['offset']);}_0x518713['order']=qs['sort'](_0x52545e[_0x57cf('0x38')]['sort']);_0x518713[_0x57cf('0x41')]=qs[_0x57cf('0x42')](_['pick'](_0x52545e['query'],_0x28c3ba['filters']));_0x518713[_0x57cf('0x6f')]=!![];if(_0x52545e[_0x57cf('0x38')]['filter']){_0x518713[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x518713[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x518713[_0x57cf('0x3c')],function(_0xf86adc){var _0x482c87={};_0x482c87[_0xf86adc]={'$like':'%'+_0x52545e[_0x57cf('0x38')][_0x57cf('0x44')]+'%'};return _0x482c87;})});}_0x518713=_[_0x57cf('0x45')]({},_0x518713,_0x52545e['options']);return _0x565589[_0x57cf('0x70')](_0x518713);}})[_0x57cf('0x2b')](function(_0x1d9c1a){if(!_[_0x57cf('0x73')](_0x1d9c1a)){var _0x411edf=toCsv(_0x1d9c1a);var _0x1a72db=Date[_0x57cf('0x74')]();fs[_0x57cf('0x75')](util[_0x57cf('0x72')](_0x57cf('0x76'),_0x565589['id'],_0x1a72db),_0x411edf);_0x81047c[_0x57cf('0x77')](_0x57cf('0x78'),_0x57cf('0x79')+util[_0x57cf('0x72')](_0x57cf('0x7a'),_0x565589['id'],_0x1a72db));_0x81047c[_0x57cf('0x77')](_0x57cf('0x7b'),_0x57cf('0x7c'));return _0x81047c[_0x57cf('0x7d')](util[_0x57cf('0x72')]('/tmp/list_%d_%s.csv',_0x565589['id'],_0x1a72db));}else{return _0x81047c['sendStatus'](0xcc);}})[_0x57cf('0x4c')](handleError(_0x81047c,null));};exports[_0x57cf('0x7e')]=function(_0x5f45b1,_0x40b48b,_0x7598bd){var _0x5151e2;delete _0x5f45b1[_0x57cf('0x50')]['id'];return db[_0x57cf('0x34')]['findOne']({'where':{'id':_0x5f45b1[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x40b48b,null))[_0x57cf('0x2b')](function(_0x116240){if(_0x116240){return db['sequelize']['transaction'](function(_0x67ee85){return db['CmCustomField'][_0x57cf('0x4f')](_0x5f45b1['body'],{'transaction':_0x67ee85})[_0x57cf('0x2b')](function(_0x511d3c){_0x5151e2=_0x511d3c;return _0x116240[_0x57cf('0x7f')](_0x511d3c,{'transaction':_0x67ee85});})[_0x57cf('0x2b')](function(){var _0x3b9e08={'type':db['Sequelize'][_0x57cf('0x80')],'transaction':_0x67ee85};switch(_0x5f45b1[_0x57cf('0x50')]['type']){case _0x57cf('0x81'):_0x3b9e08[_0x57cf('0x37')]=db[_0x57cf('0x82')]['TEXT'];break;case'number':_0x3b9e08['type']=db[_0x57cf('0x82')][_0x57cf('0x83')];break;case _0x57cf('0x84'):_0x3b9e08[_0x57cf('0x37')]=db[_0x57cf('0x82')]['BOOLEAN'];_0x3b9e08[_0x57cf('0x85')]=![];break;default:}return db[_0x57cf('0x86')][_0x57cf('0x87')]['addColumn'](_0x57cf('0x88'),util[_0x57cf('0x72')](_0x57cf('0x89'),_0x5151e2['id']),_0x3b9e08);})[_0x57cf('0x2b')](function(){return _0x5151e2;});});}})[_0x57cf('0x2b')](respondWithResult(_0x40b48b,null))[_0x57cf('0x4c')](handleError(_0x40b48b,null));};exports[_0x57cf('0x8a')]=function(_0x109512,_0x5709ae,_0x229dfc){var _0x4a3463={};var _0x3842a8={};var _0x4c3fee;var _0x4d5d73;return db[_0x57cf('0x34')]['findOne']({'where':{'id':_0x109512[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x5709ae,null))[_0x57cf('0x2b')](function(_0x3bdb04){if(_0x3bdb04){_0x4c3fee=_0x3bdb04;_0x3842a8[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x71')][_0x57cf('0x35')]);_0x3842a8[_0x57cf('0x38')]=_['keys'](_0x109512['query']);_0x3842a8['filters']=_[_0x57cf('0x3a')](_0x3842a8[_0x57cf('0x3b')],_0x3842a8[_0x57cf('0x38')]);_0x4a3463[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x3842a8[_0x57cf('0x3b')],qs[_0x57cf('0x3d')](_0x109512[_0x57cf('0x38')][_0x57cf('0x3d')]));_0x4a3463[_0x57cf('0x3c')]=_0x4a3463[_0x57cf('0x3c')][_0x57cf('0x6c')]?_0x4a3463[_0x57cf('0x3c')]:_0x3842a8['model'];_0x4a3463[_0x57cf('0x3f')]=qs[_0x57cf('0x40')](_0x109512[_0x57cf('0x38')][_0x57cf('0x40')]);_0x4a3463['where']=qs[_0x57cf('0x42')](_[_0x57cf('0x43')](_0x109512[_0x57cf('0x38')],_0x3842a8[_0x57cf('0x42')]));_0x4a3463[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x4a3463['where'],{'$or':[{'ListId':_0x3bdb04['id']},{'ListId':null}]});if(_0x109512['query'][_0x57cf('0x44')]){_0x4a3463[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x4a3463[_0x57cf('0x41')],{'$or':_[_0x57cf('0x33')](_0x4a3463[_0x57cf('0x3c')],function(_0x16e404){var _0x559e1d={};_0x559e1d[_0x16e404]={'$like':'%'+_0x109512[_0x57cf('0x38')]['filter']+'%'};return _0x559e1d;})});}_0x4a3463=_[_0x57cf('0x45')]({},_0x4a3463,_0x109512[_0x57cf('0x47')]);return db[_0x57cf('0x71')][_0x57cf('0x8b')](_0x4a3463);}})['then'](respondWithResult(_0x5709ae,null))[_0x57cf('0x4c')](handleError(_0x5709ae,null));};exports[_0x57cf('0x8c')]=function(_0x3beae4,_0x4e8a31,_0x4cdcfb){return db[_0x57cf('0x34')][_0x57cf('0x4e')]({'where':{'id':_0x3beae4[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x4e8a31,null))[_0x57cf('0x2b')](function(_0x3b186d){if(_0x3b186d){return _0x3b186d[_0x57cf('0x8c')](_0x3beae4[_0x57cf('0x50')]['ids'],_[_0x57cf('0x8d')](_0x3beae4[_0x57cf('0x50')],[_0x57cf('0x5f'),'id'])||{})[_0x57cf('0x8e')](function(_0x5a4969){for(var _0x4bb256=0x0;_0x4bb256<_0x3beae4[_0x57cf('0x50')][_0x57cf('0x5f')][_0x57cf('0x6c')];_0x4bb256+=0x1){socket['emit'](_0x57cf('0x8f'),{'UserId':Number(_0x3beae4[_0x57cf('0x50')][_0x57cf('0x5f')][_0x4bb256]),'CmListId':Number(_0x3beae4[_0x57cf('0x4d')]['id'])});}return _0x5a4969;});}})[_0x57cf('0x2b')](respondWithResult(_0x4e8a31,null))[_0x57cf('0x4c')](handleError(_0x4e8a31,null));};exports[_0x57cf('0x90')]=function(_0x1293cc,_0x59da1b,_0x367c39){return db['CmList'][_0x57cf('0x4e')]({'where':{'id':_0x1293cc[_0x57cf('0x4d')]['id']}})[_0x57cf('0x2b')](handleEntityNotFound(_0x59da1b,null))['then'](function(_0x54f521){if(_0x54f521){return _0x54f521['removeAgents'](_0x1293cc[_0x57cf('0x38')][_0x57cf('0x5f')])['then'](function(){if(_[_0x57cf('0x61')](_0x1293cc[_0x57cf('0x38')][_0x57cf('0x5f')])){for(var _0x1f9409=0x0;_0x1f9409<_0x1293cc[_0x57cf('0x38')]['ids'][_0x57cf('0x6c')];_0x1f9409+=0x1){socket[_0x57cf('0x91')](_0x57cf('0x92'),{'UserId':Number(_0x1293cc['query'][_0x57cf('0x5f')][_0x1f9409]),'CmListId':Number(_0x1293cc[_0x57cf('0x4d')]['id'])});}}else{socket[_0x57cf('0x91')](_0x57cf('0x92'),{'UserId':Number(_0x1293cc[_0x57cf('0x38')][_0x57cf('0x5f')]),'CmListId':Number(_0x1293cc[_0x57cf('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x59da1b,null))[_0x57cf('0x4c')](handleError(_0x59da1b,null));};exports[_0x57cf('0x93')]=function(_0x212177,_0x5ed0d0,_0x5d62d3){var _0x456dc8={};var _0x13795d={};var _0x1ceaec;var _0x5f3f11;return db[_0x57cf('0x34')]['findOne']({'where':{'id':_0x212177['params']['id']}})['then'](handleEntityNotFound(_0x5ed0d0,null))['then'](function(_0x203bdf){if(_0x203bdf){_0x1ceaec=_0x203bdf;_0x13795d[_0x57cf('0x3b')]=_[_0x57cf('0x39')](db[_0x57cf('0x94')][_0x57cf('0x35')]);_0x13795d['query']=_[_0x57cf('0x39')](_0x212177[_0x57cf('0x38')]);_0x13795d[_0x57cf('0x42')]=_[_0x57cf('0x3a')](_0x13795d[_0x57cf('0x3b')],_0x13795d[_0x57cf('0x38')]);_0x456dc8[_0x57cf('0x3c')]=_[_0x57cf('0x3a')](_0x13795d['model'],qs[_0x57cf('0x3d')](_0x212177['query'][_0x57cf('0x3d')]));_0x456dc8[_0x57cf('0x3c')]=_0x456dc8[_0x57cf('0x3c')][_0x57cf('0x6c')]?_0x456dc8[_0x57cf('0x3c')]:_0x13795d[_0x57cf('0x3b')];_0x456dc8[_0x57cf('0x3f')]=qs['sort'](_0x212177[_0x57cf('0x38')][_0x57cf('0x40')]);_0x456dc8[_0x57cf('0x41')]=qs['filters'](_[_0x57cf('0x43')](_0x212177[_0x57cf('0x38')],_0x13795d[_0x57cf('0x42')]));if(_0x212177[_0x57cf('0x38')][_0x57cf('0x44')]){_0x456dc8[_0x57cf('0x41')]=_[_0x57cf('0x45')](_0x456dc8[_0x57cf('0x41')],{'$or':_['map'](_0x456dc8[_0x57cf('0x3c')],function(_0x25bb62){var _0x2bbde6={};_0x2bbde6[_0x25bb62]={'$like':'%'+_0x212177[_0x57cf('0x38')][_0x57cf('0x44')]+'%'};return _0x2bbde6;})});}_0x456dc8=_[_0x57cf('0x45')]({},_0x456dc8,_0x212177[_0x57cf('0x47')]);return _0x1ceaec[_0x57cf('0x93')](_0x456dc8);}})[_0x57cf('0x2b')](function(_0x2ec716){if(_0x2ec716){_0x5f3f11=_0x2ec716[_0x57cf('0x6c')];if(!_0x212177[_0x57cf('0x38')][_0x57cf('0x6d')](_0x57cf('0x6e'))){_0x456dc8['limit']=qs[_0x57cf('0x3e')](_0x212177[_0x57cf('0x38')][_0x57cf('0x3e')]);_0x456dc8['offset']=qs[_0x57cf('0x24')](_0x212177[_0x57cf('0x38')]['offset']);}return _0x1ceaec[_0x57cf('0x93')](_0x456dc8);}})[_0x57cf('0x2b')](function(_0x11a7d3){if(_0x11a7d3){return _0x11a7d3?{'count':_0x5f3f11,'rows':_0x11a7d3}:null;}})[_0x57cf('0x2b')](respondWithResult(_0x5ed0d0,null))['catch'](handleError(_0x5ed0d0,null));}; \ No newline at end of file +var _0x989c=['download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Lists','UserProfileResource','end','error','stack','name','send','index','map','CmList','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','pick','getContactsCsv','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x989c,0xa9));var _0xc989=function(_0x4d3b97,_0x210218){_0x4d3b97=_0x4d3b97-0x0;var _0x17354e=_0x989c[_0x4d3b97];return _0x17354e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc989('0x0'));var jsonpatch=require(_0xc989('0x1'));var rp=require(_0xc989('0x2'));var moment=require(_0xc989('0x3'));var BPromise=require(_0xc989('0x4'));var Mustache=require(_0xc989('0x5'));var util=require('util');var path=require(_0xc989('0x6'));var sox=require('sox');var csv=require(_0xc989('0x7'));var ejs=require(_0xc989('0x8'));var fs=require('fs');var fs_extra=require(_0xc989('0x9'));var _=require('lodash');var squel=require(_0xc989('0xa'));var crypto=require(_0xc989('0xb'));var jsforce=require(_0xc989('0xc'));var deskjs=require(_0xc989('0xd'));var toCsv=require(_0xc989('0x7'));var querystring=require(_0xc989('0xe'));var Papa=require(_0xc989('0xf'));var Redis=require(_0xc989('0x10'));var authService=require(_0xc989('0x11'));var qs=require(_0xc989('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc989('0x13'))(_0xc989('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc989('0x15'));var db=require(_0xc989('0x16'))['db'];config[_0xc989('0x17')]=_[_0xc989('0x18')](config[_0xc989('0x17')],{'host':_0xc989('0x19'),'port':0x18eb});var socket=require(_0xc989('0x1a'))(new Redis(config[_0xc989('0x17')]));require(_0xc989('0x1b'))['register'](socket);function respondWithStatusCode(_0x3f8e9d,_0x38b03a){_0x38b03a=_0x38b03a||0xcc;return function(_0x1352af){if(_0x1352af){return _0x3f8e9d[_0xc989('0x1c')](_0x38b03a);}return _0x3f8e9d[_0xc989('0x1d')](_0x38b03a)['end']();};}function respondWithResult(_0x43669d,_0x2c8203){_0x2c8203=_0x2c8203||0xc8;return function(_0x547807){if(_0x547807){return _0x43669d[_0xc989('0x1d')](_0x2c8203)[_0xc989('0x1e')](_0x547807);}};}function respondWithFilteredResult(_0x5a3b4b,_0x48ac50){return function(_0x90c868){if(_0x90c868){var _0x16e413=typeof _0x48ac50[_0xc989('0x1f')]===_0xc989('0x20')&&typeof _0x48ac50[_0xc989('0x21')]===_0xc989('0x20');var _0x4d2f63=_0x90c868[_0xc989('0x22')];var _0x58a342=_0x16e413?0x0:_0x48ac50[_0xc989('0x1f')];var _0x5b0807=_0x16e413?_0x90c868[_0xc989('0x22')]:_0x48ac50[_0xc989('0x1f')]+_0x48ac50[_0xc989('0x21')];var _0x3992f2;if(_0x5b0807>=_0x4d2f63){_0x5b0807=_0x4d2f63;_0x3992f2=0xc8;}else{_0x3992f2=0xce;}_0x5a3b4b[_0xc989('0x1d')](_0x3992f2);return _0x5a3b4b[_0xc989('0x23')](_0xc989('0x24'),_0x58a342+'-'+_0x5b0807+'/'+_0x4d2f63)[_0xc989('0x1e')](_0x90c868);}return null;};}function patchUpdates(_0x2c4433){return function(_0x16a2a3){try{jsonpatch['apply'](_0x16a2a3,_0x2c4433,!![]);}catch(_0x3e74b1){return BPromise[_0xc989('0x25')](_0x3e74b1);}return _0x16a2a3[_0xc989('0x26')]();};}function saveUpdates(_0x4e47ae,_0x2813b4){return function(_0x4dd52a){if(_0x4dd52a){return _0x4dd52a[_0xc989('0x27')](_0x4e47ae)['then'](function(_0x4e6476){return _0x4e6476;});}return null;};}function removeEntity(_0x5d9463,_0x3f5632){return function(_0x28256d){if(_0x28256d){return _0x28256d[_0xc989('0x28')]()[_0xc989('0x29')](function(){var _0x80e933=_0x28256d[_0xc989('0x2a')]({'plain':!![]});var _0x288ddb=_0xc989('0x2b');return db[_0xc989('0x2c')][_0xc989('0x28')]({'where':{'type':_0x288ddb,'resourceId':_0x80e933['id']}})[_0xc989('0x29')](function(){return _0x28256d;});})[_0xc989('0x29')](function(){_0x5d9463[_0xc989('0x1d')](0xcc)[_0xc989('0x2d')]();});}};}function handleEntityNotFound(_0x300f4d,_0x2b7cec){return function(_0xf4b009){if(!_0xf4b009){_0x300f4d['sendStatus'](0x194);}return _0xf4b009;};}function handleError(_0x51b4fd,_0x558cff){_0x558cff=_0x558cff||0x1f4;return function(_0x5ed2b7){logger[_0xc989('0x2e')](_0x5ed2b7[_0xc989('0x2f')]);if(_0x5ed2b7[_0xc989('0x30')]){delete _0x5ed2b7[_0xc989('0x30')];}_0x51b4fd[_0xc989('0x1d')](_0x558cff)[_0xc989('0x31')](_0x5ed2b7);};}exports[_0xc989('0x32')]=function(_0x43d533,_0xc672c2){var _0x114063={},_0x2a7116={},_0x51ea7a={'count':0x0,'rows':[]};var _0x3e5112=_[_0xc989('0x33')](db[_0xc989('0x34')][_0xc989('0x35')],function(_0x47044d){return{'name':_0x47044d['fieldName'],'type':_0x47044d[_0xc989('0x36')][_0xc989('0x37')]};});_0x2a7116[_0xc989('0x38')]=_[_0xc989('0x33')](_0x3e5112,'name');_0x2a7116['query']=_[_0xc989('0x39')](_0x43d533[_0xc989('0x3a')]);_0x2a7116['filters']=_[_0xc989('0x3b')](_0x2a7116[_0xc989('0x38')],_0x2a7116[_0xc989('0x3a')]);_0x114063[_0xc989('0x3c')]=_['intersection'](_0x2a7116[_0xc989('0x38')],qs[_0xc989('0x3d')](_0x43d533[_0xc989('0x3a')]['fields']));_0x114063[_0xc989('0x3c')]=_0x114063[_0xc989('0x3c')]['length']?_0x114063[_0xc989('0x3c')]:_0x2a7116['model'];if(!_0x43d533[_0xc989('0x3a')]['hasOwnProperty'](_0xc989('0x3e'))){_0x114063[_0xc989('0x21')]=qs['limit'](_0x43d533[_0xc989('0x3a')][_0xc989('0x21')]);_0x114063['offset']=qs[_0xc989('0x1f')](_0x43d533[_0xc989('0x3a')][_0xc989('0x1f')]);}_0x114063[_0xc989('0x3f')]=qs[_0xc989('0x40')](_0x43d533[_0xc989('0x3a')][_0xc989('0x40')]);_0x114063['where']=qs['filters'](_['pick'](_0x43d533[_0xc989('0x3a')],_0x2a7116[_0xc989('0x41')]),_0x3e5112);if(_0x43d533[_0xc989('0x3a')][_0xc989('0x42')]){_0x114063[_0xc989('0x43')]=_[_0xc989('0x44')](_0x114063['where'],{'$or':_[_0xc989('0x33')](_0x3e5112,function(_0x3a7b88){if(_0x3a7b88[_0xc989('0x36')]!==_0xc989('0x45')){var _0xcfb10d={};_0xcfb10d[_0x3a7b88[_0xc989('0x30')]]={'$like':'%'+_0x43d533[_0xc989('0x3a')][_0xc989('0x42')]+'%'};return _0xcfb10d;}})});}_0x114063=_[_0xc989('0x44')]({},_0x114063,_0x43d533[_0xc989('0x46')]);var _0x31c405={'where':_0x114063[_0xc989('0x43')]};return db[_0xc989('0x34')][_0xc989('0x22')](_0x31c405)[_0xc989('0x29')](function(_0x1a8eb8){_0x51ea7a[_0xc989('0x22')]=_0x1a8eb8;if(_0x43d533['query'][_0xc989('0x47')]){_0x114063['include']=[{'all':!![]}];}return db['CmList'][_0xc989('0x48')](_0x114063);})[_0xc989('0x29')](function(_0x37ec1a){_0x51ea7a[_0xc989('0x49')]=_0x37ec1a;return _0x51ea7a;})[_0xc989('0x29')](respondWithFilteredResult(_0xc672c2,_0x114063))[_0xc989('0x4a')](handleError(_0xc672c2,null));};exports['show']=function(_0x4ba93c,_0x1db956){var _0x5aef4b={'raw':![],'where':{'id':_0x4ba93c[_0xc989('0x4b')]['id']}},_0x111d73={};_0x111d73['model']=_[_0xc989('0x39')](db['CmList']['rawAttributes']);_0x111d73[_0xc989('0x3a')]=_[_0xc989('0x39')](_0x4ba93c['query']);_0x111d73[_0xc989('0x41')]=_['intersection'](_0x111d73[_0xc989('0x38')],_0x111d73[_0xc989('0x3a')]);_0x5aef4b[_0xc989('0x3c')]=_['intersection'](_0x111d73['model'],qs['fields'](_0x4ba93c[_0xc989('0x3a')][_0xc989('0x3d')]));_0x5aef4b[_0xc989('0x3c')]=_0x5aef4b[_0xc989('0x3c')][_0xc989('0x4c')]?_0x5aef4b['attributes']:_0x111d73['model'];if(_0x4ba93c[_0xc989('0x3a')][_0xc989('0x47')]){_0x5aef4b[_0xc989('0x4d')]=[{'all':!![]}];}_0x5aef4b=_[_0xc989('0x44')]({},_0x5aef4b,_0x4ba93c['options']);return db[_0xc989('0x34')][_0xc989('0x4e')](_0x5aef4b)[_0xc989('0x29')](handleEntityNotFound(_0x1db956,null))[_0xc989('0x29')](respondWithResult(_0x1db956,null))['catch'](handleError(_0x1db956,null));};exports[_0xc989('0x4f')]=function(_0x2ef62b,_0xebf3b5){return db[_0xc989('0x34')][_0xc989('0x4f')](_0x2ef62b['body'],{})[_0xc989('0x29')](function(_0xf21698){var _0xc44c05=_0x2ef62b[_0xc989('0x50')][_0xc989('0x2a')]({'plain':!![]});if(!_0xc44c05)throw new Error(_0xc989('0x51'));if(_0xc44c05[_0xc989('0x52')]===_0xc989('0x50')){var _0x16de8c=_0xf21698[_0xc989('0x2a')]({'plain':!![]});var _0x3f5255=_0xc989('0x2b');return db[_0xc989('0x53')][_0xc989('0x4e')]({'where':{'name':_0x3f5255,'userProfileId':_0xc44c05['userProfileId']},'raw':!![]})['then'](function(_0x4c3092){if(_0x4c3092&&_0x4c3092['autoAssociation']===0x0){return db[_0xc989('0x2c')][_0xc989('0x4f')]({'name':_0x16de8c['name'],'resourceId':_0x16de8c['id'],'type':_0x4c3092[_0xc989('0x30')],'sectionId':_0x4c3092['id']},{})[_0xc989('0x29')](function(){return _0xf21698;});}else{return _0xf21698;}})[_0xc989('0x4a')](function(_0x302823){logger[_0xc989('0x2e')](_0xc989('0x54'),_0x302823);throw _0x302823;});}return _0xf21698;})[_0xc989('0x29')](respondWithResult(_0xebf3b5,0xc9))[_0xc989('0x4a')](handleError(_0xebf3b5,null));};exports[_0xc989('0x27')]=function(_0x475bfc,_0x6d0e03){if(_0x475bfc['body']['id']){delete _0x475bfc[_0xc989('0x55')]['id'];}return db[_0xc989('0x34')]['find']({'where':{'id':_0x475bfc[_0xc989('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6d0e03,null))[_0xc989('0x29')](saveUpdates(_0x475bfc[_0xc989('0x55')],null))[_0xc989('0x29')](respondWithResult(_0x6d0e03,null))[_0xc989('0x4a')](handleError(_0x6d0e03,null));};exports[_0xc989('0x28')]=function(_0x120b8a,_0x5a2d00){return db[_0xc989('0x34')][_0xc989('0x4e')]({'where':{'id':_0x120b8a[_0xc989('0x4b')]['id']}})[_0xc989('0x29')](handleEntityNotFound(_0x5a2d00,null))['then'](removeEntity(_0x5a2d00,null))[_0xc989('0x4a')](handleError(_0x5a2d00,null));};exports[_0xc989('0x56')]=function(_0x8c68c9,_0x2b670d){return db[_0xc989('0x34')]['describe']()[_0xc989('0x29')](respondWithResult(_0x2b670d,null))[_0xc989('0x4a')](handleError(_0x2b670d,null));};exports[_0xc989('0x57')]=function(_0x42a3b9,_0x58bc42,_0x2f05d0){if(_0x42a3b9[_0xc989('0x55')]['id']){delete _0x42a3b9[_0xc989('0x55')]['id'];}return db[_0xc989('0x34')][_0xc989('0x4e')]({'where':{'id':_0x42a3b9['params']['id']}})['then'](handleEntityNotFound(_0x58bc42,null))[_0xc989('0x29')](function(_0x324974){if(_0x324974){_0x42a3b9[_0xc989('0x55')][_0xc989('0x58')]=_0x324974['id'];return db['Disposition'][_0xc989('0x4f')](_0x42a3b9[_0xc989('0x55')]);}})[_0xc989('0x29')](respondWithResult(_0x58bc42,null))[_0xc989('0x4a')](handleError(_0x58bc42,null));};exports['getDispositions']=function(_0x534a4d,_0x4fd95f,_0x4285bf){var _0x304c4d={'raw':![],'where':{}};var _0x14cde7={};var _0x3bf0e2={'count':0x0,'rows':[]};return db[_0xc989('0x34')][_0xc989('0x59')]({'where':{'id':_0x534a4d[_0xc989('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fd95f,null))[_0xc989('0x29')](function(_0x2253a4){if(_0x2253a4){_0x14cde7[_0xc989('0x38')]=_[_0xc989('0x39')](db[_0xc989('0x5a')][_0xc989('0x35')]);_0x14cde7[_0xc989('0x3a')]=_[_0xc989('0x39')](_0x534a4d[_0xc989('0x3a')]);_0x14cde7[_0xc989('0x41')]=_[_0xc989('0x3b')](_0x14cde7[_0xc989('0x38')],_0x14cde7['query']);_0x304c4d[_0xc989('0x3c')]=_[_0xc989('0x3b')](_0x14cde7['model'],qs[_0xc989('0x3d')](_0x534a4d[_0xc989('0x3a')][_0xc989('0x3d')]));_0x304c4d[_0xc989('0x3c')]=_0x304c4d[_0xc989('0x3c')][_0xc989('0x4c')]?_0x304c4d[_0xc989('0x3c')]:_0x14cde7[_0xc989('0x38')];if(!_0x534a4d[_0xc989('0x3a')][_0xc989('0x5b')](_0xc989('0x3e'))){_0x304c4d['limit']=qs[_0xc989('0x21')](_0x534a4d[_0xc989('0x3a')][_0xc989('0x21')]);_0x304c4d[_0xc989('0x1f')]=qs[_0xc989('0x1f')](_0x534a4d[_0xc989('0x3a')][_0xc989('0x1f')]);}_0x304c4d[_0xc989('0x3f')]=qs['sort'](_0x534a4d[_0xc989('0x3a')][_0xc989('0x40')]);_0x304c4d[_0xc989('0x43')]=qs[_0xc989('0x41')](_['pick'](_0x534a4d[_0xc989('0x3a')],_0x14cde7[_0xc989('0x41')]));_0x304c4d['where'][_0xc989('0x58')]=_0x2253a4['id'];if(_0x534a4d[_0xc989('0x3a')][_0xc989('0x42')]){_0x304c4d[_0xc989('0x43')]=_[_0xc989('0x44')](_0x304c4d[_0xc989('0x43')],{'$or':_['map'](_0x304c4d[_0xc989('0x3c')],function(_0x56e08e){var _0x1260b6={};_0x1260b6[_0x56e08e]={'$like':'%'+_0x534a4d[_0xc989('0x3a')][_0xc989('0x42')]+'%'};return _0x1260b6;})});}_0x304c4d=_[_0xc989('0x44')]({},_0x304c4d,_0x534a4d[_0xc989('0x46')]);return db[_0xc989('0x5a')][_0xc989('0x22')]({'where':_0x304c4d[_0xc989('0x43')]})[_0xc989('0x29')](function(_0x5ae9f6){_0x3bf0e2['count']=_0x5ae9f6;if(_0x534a4d[_0xc989('0x3a')][_0xc989('0x47')]){_0x304c4d[_0xc989('0x4d')]=[{'all':!![]}];}return db[_0xc989('0x5a')][_0xc989('0x48')](_0x304c4d);})['then'](function(_0x42466b){_0x3bf0e2[_0xc989('0x49')]=_0x42466b;return _0x3bf0e2;});}})[_0xc989('0x29')](respondWithFilteredResult(_0x4fd95f,_0x304c4d))[_0xc989('0x4a')](handleError(_0x4fd95f,null));};exports[_0xc989('0x5c')]=function(_0x5d735a,_0x1c1e1b,_0x3e3e47){return db[_0xc989('0x34')]['find']({'where':{'id':_0x5d735a[_0xc989('0x4b')]['id']}})[_0xc989('0x29')](handleEntityNotFound(_0x1c1e1b,null))[_0xc989('0x29')](function(_0x13b04a){if(_0x13b04a){return _0x13b04a[_0xc989('0x5c')](_0x5d735a[_0xc989('0x3a')][_0xc989('0x5d')]);}})[_0xc989('0x29')](respondWithStatusCode(_0x1c1e1b,null))[_0xc989('0x4a')](handleError(_0x1c1e1b,null));};exports['addContacts']=function(_0x143a09,_0x1457d6,_0x3b2a85){return db['CmList'][_0xc989('0x4e')]({'where':{'id':_0x143a09[_0xc989('0x4b')]['id']}})[_0xc989('0x29')](handleEntityNotFound(_0x1457d6,null))[_0xc989('0x29')](function(_0x30117f){if(_0x30117f){var _0x537680=[];var _0x2f92f4={'success':[],'errors':[]};return db[_0xc989('0x5e')][_0xc989('0x56')]()[_0xc989('0x29')](function(_0x3a407f){if(_0x143a09[_0xc989('0x55')][_0xc989('0x5f')]&&_[_0xc989('0x60')](_0x143a09[_0xc989('0x55')][_0xc989('0x5f')])){if(_0x143a09[_0xc989('0x55')][_0xc989('0x5f')][_0xc989('0x4c')]){_0x143a09[_0xc989('0x55')][_0xc989('0x5f')]=_0x143a09[_0xc989('0x55')][_0xc989('0x5f')][_0xc989('0x61')](';')+';';}else{_0x143a09['body'][_0xc989('0x5f')]=null;}}else{_0x143a09[_0xc989('0x55')][_0xc989('0x5f')]=null;}if(_0x143a09['body']&&_[_0xc989('0x60')](_0x143a09[_0xc989('0x55')])){for(var _0x118ef9=0x0;_0x118ef9<_0x143a09['body'][_0xc989('0x4c')];_0x118ef9+=0x1){_0x143a09[_0xc989('0x55')][_0x118ef9][_0xc989('0x58')]=_0x143a09['params']['id'];_0x537680[_0xc989('0x62')](_0x143a09[_0xc989('0x55')][_0x118ef9]);}return BPromise['each'](_0x537680,function(_0x22b007){return db[_0xc989('0x5e')][_0xc989('0x4f')](_[_0xc989('0x63')](_0x22b007,['ids','id'])||{},{'fields':_[_0xc989('0x39')](_0x3a407f),'raw':!![]})['then'](function(_0x4277b2){_0x2f92f4[_0xc989('0x64')][_0xc989('0x62')](_0x4277b2[_0xc989('0x65')]);})[_0xc989('0x4a')](function(_0x12454a){_0x2f92f4[_0xc989('0x66')][_0xc989('0x62')]({'data':_0x22b007,'error':_0x12454a['message']});});})['then'](function(_0x5f2a4e){return _0x2f92f4;})[_0xc989('0x4a')](function(_0x32c14e){return _0x32c14e;});}else{_0x1457d6[_0xc989('0x1d')](0x190)[_0xc989('0x1e')]({'message':_0xc989('0x67')});}});}})['then'](respondWithResult(_0x1457d6,null))[_0xc989('0x4a')](handleError(_0x1457d6,null));};exports[_0xc989('0x68')]=function(_0x4e0774,_0x4da1e9,_0x5423cc){var _0x58feed;return db[_0xc989('0x34')][_0xc989('0x4e')]({'where':{'id':_0x4e0774[_0xc989('0x4b')]['id']},'include':[{'model':db[_0xc989('0x69')],'as':_0xc989('0x6a')}]})['then'](handleEntityNotFound(_0x4da1e9,null))['then'](function(_0x2a518e){if(_0x2a518e){_0x58feed=_0x2a518e;return db[_0xc989('0x5e')][_0xc989('0x35')];}})[_0xc989('0x29')](function(_0x7795db){if(_0x7795db){var _0x5b67e9={};var _0x187e94={};_0x187e94[_0xc989('0x38')]=_[_0xc989('0x6b')](_[_0xc989('0x39')](_0x7795db),_[_0xc989('0x33')](_0x58feed[_0xc989('0x6a')],function(_0x3903dd){return util['format'](_0xc989('0x6c'),_0x3903dd['id']);}));_0x187e94[_0xc989('0x3a')]=_[_0xc989('0x39')](_0x4e0774['query']);_0x187e94[_0xc989('0x41')]=_[_0xc989('0x3b')](_0x187e94[_0xc989('0x38')],_0x187e94[_0xc989('0x3a')]);_0x5b67e9['attributes']=_[_0xc989('0x3b')](_0x187e94[_0xc989('0x38')],qs[_0xc989('0x3d')](_0x4e0774[_0xc989('0x3a')][_0xc989('0x3d')]));_0x5b67e9[_0xc989('0x3c')]=_0x5b67e9[_0xc989('0x3c')][_0xc989('0x4c')]?_0x5b67e9['attributes']:_0x187e94[_0xc989('0x38')];if(!_0x4e0774[_0xc989('0x3a')][_0xc989('0x5b')](_0xc989('0x3e'))){_0x5b67e9['limit']=qs[_0xc989('0x21')](_0x4e0774[_0xc989('0x3a')][_0xc989('0x21')]);_0x5b67e9[_0xc989('0x1f')]=qs[_0xc989('0x1f')](_0x4e0774[_0xc989('0x3a')]['offset']);}_0x5b67e9[_0xc989('0x3f')]=qs[_0xc989('0x40')](_0x4e0774[_0xc989('0x3a')][_0xc989('0x40')]);_0x5b67e9[_0xc989('0x43')]=qs[_0xc989('0x41')](_[_0xc989('0x6d')](_0x4e0774[_0xc989('0x3a')],_0x187e94[_0xc989('0x41')]));_0x5b67e9['raw']=!![];if(_0x4e0774[_0xc989('0x3a')][_0xc989('0x42')]){_0x5b67e9[_0xc989('0x43')]=_[_0xc989('0x44')](_0x5b67e9[_0xc989('0x43')],{'$or':_[_0xc989('0x33')](_0x5b67e9['attributes'],function(_0x53180a){var _0x46a9d3={};_0x46a9d3[_0x53180a]={'$like':'%'+_0x4e0774['query'][_0xc989('0x42')]+'%'};return _0x46a9d3;})});}_0x5b67e9=_[_0xc989('0x44')]({},_0x5b67e9,_0x4e0774[_0xc989('0x46')]);return _0x58feed[_0xc989('0x68')](_0x5b67e9);}})['then'](respondWithResult(_0x4da1e9,null))[_0xc989('0x4a')](handleError(_0x4da1e9,null));};exports[_0xc989('0x6e')]=function(_0x456bda,_0x36e5fb,_0xe54eb2){var _0x14a038;return db[_0xc989('0x34')][_0xc989('0x4e')]({'where':{'id':_0x456bda[_0xc989('0x4b')]['id']},'include':[{'model':db[_0xc989('0x69')],'as':_0xc989('0x6a')}]})[_0xc989('0x29')](handleEntityNotFound(_0x36e5fb,null))[_0xc989('0x29')](function(_0x31db6e){if(_0x31db6e){_0x14a038=_0x31db6e;return db[_0xc989('0x5e')][_0xc989('0x35')];}})['then'](function(_0x124399){if(_0x124399){var _0x5a0b05={};var _0x331154={};_0x331154[_0xc989('0x38')]=_['concat'](_[_0xc989('0x39')](_0x124399),_[_0xc989('0x33')](_0x14a038['CustomFields'],function(_0x394aa5){return util[_0xc989('0x6f')](_0xc989('0x6c'),_0x394aa5['id']);}));_0x331154['query']=_[_0xc989('0x39')](_0x456bda[_0xc989('0x3a')]);_0x331154[_0xc989('0x41')]=_[_0xc989('0x3b')](_0x331154[_0xc989('0x38')],_0x331154[_0xc989('0x3a')]);_0x5a0b05[_0xc989('0x3c')]=_[_0xc989('0x3b')](_0x331154[_0xc989('0x38')],qs['fields'](_0x456bda[_0xc989('0x3a')][_0xc989('0x3d')]));_0x5a0b05[_0xc989('0x3c')]=_0x5a0b05[_0xc989('0x3c')]['length']?_0x5a0b05[_0xc989('0x3c')]:_0x331154[_0xc989('0x38')];if(!_0x456bda['query'][_0xc989('0x5b')]('nolimit')){_0x5a0b05['limit']=qs[_0xc989('0x21')](_0x456bda[_0xc989('0x3a')][_0xc989('0x21')]);_0x5a0b05['offset']=qs[_0xc989('0x1f')](_0x456bda['query'][_0xc989('0x1f')]);}_0x5a0b05[_0xc989('0x3f')]=qs[_0xc989('0x40')](_0x456bda[_0xc989('0x3a')][_0xc989('0x40')]);_0x5a0b05[_0xc989('0x43')]=qs[_0xc989('0x41')](_['pick'](_0x456bda[_0xc989('0x3a')],_0x331154[_0xc989('0x41')]));_0x5a0b05['raw']=!![];if(_0x456bda['query'][_0xc989('0x42')]){_0x5a0b05[_0xc989('0x43')]=_[_0xc989('0x44')](_0x5a0b05[_0xc989('0x43')],{'$or':_[_0xc989('0x33')](_0x5a0b05[_0xc989('0x3c')],function(_0x3c38a0){var _0x2b768b={};_0x2b768b[_0x3c38a0]={'$like':'%'+_0x456bda['query'][_0xc989('0x42')]+'%'};return _0x2b768b;})});}_0x5a0b05=_['merge']({},_0x5a0b05,_0x456bda[_0xc989('0x46')]);return _0x14a038[_0xc989('0x68')](_0x5a0b05);}})['then'](function(_0x2b2bcf){if(!_[_0xc989('0x70')](_0x2b2bcf)){var _0x9bd59e=toCsv(_0x2b2bcf);var _0x8eedee=Date[_0xc989('0x71')]();fs[_0xc989('0x72')](util['format'](_0xc989('0x73'),_0x14a038['id'],_0x8eedee),_0x9bd59e);_0x36e5fb[_0xc989('0x74')]('Content-disposition',_0xc989('0x75')+util[_0xc989('0x6f')](_0xc989('0x76'),_0x14a038['id'],_0x8eedee));_0x36e5fb[_0xc989('0x74')](_0xc989('0x77'),_0xc989('0x78'));return _0x36e5fb[_0xc989('0x79')](util[_0xc989('0x6f')](_0xc989('0x73'),_0x14a038['id'],_0x8eedee));}else{return _0x36e5fb[_0xc989('0x1c')](0xcc);}})[_0xc989('0x4a')](handleError(_0x36e5fb,null));};exports[_0xc989('0x7a')]=function(_0x471685,_0x3dddab,_0x2101cc){var _0x3c725a;delete _0x471685[_0xc989('0x55')]['id'];return db[_0xc989('0x34')][_0xc989('0x59')]({'where':{'id':_0x471685['params']['id']}})[_0xc989('0x29')](handleEntityNotFound(_0x3dddab,null))[_0xc989('0x29')](function(_0x18ae44){if(_0x18ae44){return db[_0xc989('0x7b')][_0xc989('0x7c')](function(_0xe3f8d6){return db[_0xc989('0x69')][_0xc989('0x4f')](_0x471685[_0xc989('0x55')],{'transaction':_0xe3f8d6})['then'](function(_0x5b24f1){_0x3c725a=_0x5b24f1;return _0x18ae44['addCustomFields'](_0x5b24f1,{'transaction':_0xe3f8d6});})[_0xc989('0x29')](function(){var _0x469139={'type':db[_0xc989('0x7d')][_0xc989('0x7e')],'transaction':_0xe3f8d6};switch(_0x471685[_0xc989('0x55')][_0xc989('0x36')]){case _0xc989('0x7f'):_0x469139[_0xc989('0x36')]=db[_0xc989('0x7d')]['TEXT'];break;case _0xc989('0x80'):_0x469139[_0xc989('0x36')]=db['Sequelize'][_0xc989('0x81')];break;case _0xc989('0x82'):_0x469139[_0xc989('0x36')]=db[_0xc989('0x7d')][_0xc989('0x83')];_0x469139[_0xc989('0x84')]=![];break;default:}return db['sequelize'][_0xc989('0x85')]['addColumn'](_0xc989('0x86'),util[_0xc989('0x6f')](_0xc989('0x87'),_0x3c725a['id']),_0x469139);})['then'](function(){return _0x3c725a;});});}})[_0xc989('0x29')](respondWithResult(_0x3dddab,null))[_0xc989('0x4a')](handleError(_0x3dddab,null));};exports['getCustomFields']=function(_0x5d46ce,_0x31f7b9,_0x106d71){var _0x37bed0={};var _0x44f071={};var _0x940c11;var _0x432dcd;return db[_0xc989('0x34')]['findOne']({'where':{'id':_0x5d46ce[_0xc989('0x4b')]['id']}})['then'](handleEntityNotFound(_0x31f7b9,null))[_0xc989('0x29')](function(_0x1ba9d9){if(_0x1ba9d9){_0x940c11=_0x1ba9d9;_0x44f071['model']=_[_0xc989('0x39')](db[_0xc989('0x69')][_0xc989('0x35')]);_0x44f071['query']=_[_0xc989('0x39')](_0x5d46ce['query']);_0x44f071[_0xc989('0x41')]=_['intersection'](_0x44f071[_0xc989('0x38')],_0x44f071[_0xc989('0x3a')]);_0x37bed0[_0xc989('0x3c')]=_[_0xc989('0x3b')](_0x44f071[_0xc989('0x38')],qs[_0xc989('0x3d')](_0x5d46ce[_0xc989('0x3a')]['fields']));_0x37bed0['attributes']=_0x37bed0['attributes'][_0xc989('0x4c')]?_0x37bed0[_0xc989('0x3c')]:_0x44f071['model'];_0x37bed0['order']=qs[_0xc989('0x40')](_0x5d46ce['query'][_0xc989('0x40')]);_0x37bed0[_0xc989('0x43')]=qs[_0xc989('0x41')](_[_0xc989('0x6d')](_0x5d46ce[_0xc989('0x3a')],_0x44f071[_0xc989('0x41')]));_0x37bed0[_0xc989('0x43')]=_[_0xc989('0x44')](_0x37bed0['where'],{'$or':[{'ListId':_0x1ba9d9['id']},{'ListId':null}]});if(_0x5d46ce[_0xc989('0x3a')][_0xc989('0x42')]){_0x37bed0[_0xc989('0x43')]=_['merge'](_0x37bed0[_0xc989('0x43')],{'$or':_[_0xc989('0x33')](_0x37bed0[_0xc989('0x3c')],function(_0x1906d9){var _0x16d06a={};_0x16d06a[_0x1906d9]={'$like':'%'+_0x5d46ce[_0xc989('0x3a')]['filter']+'%'};return _0x16d06a;})});}_0x37bed0=_[_0xc989('0x44')]({},_0x37bed0,_0x5d46ce[_0xc989('0x46')]);return db['CmCustomField'][_0xc989('0x88')](_0x37bed0);}})[_0xc989('0x29')](respondWithResult(_0x31f7b9,null))['catch'](handleError(_0x31f7b9,null));};exports[_0xc989('0x89')]=function(_0x8f77,_0x21bd69,_0x3e9e02){return db[_0xc989('0x34')][_0xc989('0x4e')]({'where':{'id':_0x8f77[_0xc989('0x4b')]['id']}})['then'](handleEntityNotFound(_0x21bd69,null))[_0xc989('0x29')](function(_0x383079){if(_0x383079){return _0x383079[_0xc989('0x89')](_0x8f77[_0xc989('0x55')]['ids'],_[_0xc989('0x63')](_0x8f77[_0xc989('0x55')],['ids','id'])||{})[_0xc989('0x8a')](function(_0x5cf0b9){for(var _0x4e0870=0x0;_0x4e0870<_0x8f77[_0xc989('0x55')][_0xc989('0x5d')][_0xc989('0x4c')];_0x4e0870+=0x1){socket[_0xc989('0x8b')](_0xc989('0x8c'),{'UserId':Number(_0x8f77[_0xc989('0x55')][_0xc989('0x5d')][_0x4e0870]),'CmListId':Number(_0x8f77['params']['id'])});}return _0x5cf0b9;});}})[_0xc989('0x29')](respondWithResult(_0x21bd69,null))[_0xc989('0x4a')](handleError(_0x21bd69,null));};exports['removeAgents']=function(_0x2d2a2a,_0x240909,_0x4c1800){return db[_0xc989('0x34')]['find']({'where':{'id':_0x2d2a2a[_0xc989('0x4b')]['id']}})['then'](handleEntityNotFound(_0x240909,null))[_0xc989('0x29')](function(_0xa7a7f9){if(_0xa7a7f9){return _0xa7a7f9[_0xc989('0x8d')](_0x2d2a2a[_0xc989('0x3a')][_0xc989('0x5d')])[_0xc989('0x29')](function(){if(_[_0xc989('0x60')](_0x2d2a2a[_0xc989('0x3a')]['ids'])){for(var _0x110954=0x0;_0x110954<_0x2d2a2a[_0xc989('0x3a')][_0xc989('0x5d')]['length'];_0x110954+=0x1){socket[_0xc989('0x8b')](_0xc989('0x8e'),{'UserId':Number(_0x2d2a2a[_0xc989('0x3a')][_0xc989('0x5d')][_0x110954]),'CmListId':Number(_0x2d2a2a[_0xc989('0x4b')]['id'])});}}else{socket[_0xc989('0x8b')](_0xc989('0x8e'),{'UserId':Number(_0x2d2a2a['query'][_0xc989('0x5d')]),'CmListId':Number(_0x2d2a2a[_0xc989('0x4b')]['id'])});}});}})[_0xc989('0x29')](respondWithStatusCode(_0x240909,null))[_0xc989('0x4a')](handleError(_0x240909,null));};exports[_0xc989('0x8f')]=function(_0x25debc,_0x3556cd,_0x1c9342){var _0x2a0724={};var _0x559552={};var _0x29f9bf;var _0x4bcd71;return db[_0xc989('0x34')][_0xc989('0x59')]({'where':{'id':_0x25debc[_0xc989('0x4b')]['id']}})[_0xc989('0x29')](handleEntityNotFound(_0x3556cd,null))['then'](function(_0x39fb51){if(_0x39fb51){_0x29f9bf=_0x39fb51;_0x559552['model']=_[_0xc989('0x39')](db[_0xc989('0x90')][_0xc989('0x35')]);_0x559552[_0xc989('0x3a')]=_[_0xc989('0x39')](_0x25debc[_0xc989('0x3a')]);_0x559552['filters']=_[_0xc989('0x3b')](_0x559552[_0xc989('0x38')],_0x559552[_0xc989('0x3a')]);_0x2a0724[_0xc989('0x3c')]=_[_0xc989('0x3b')](_0x559552[_0xc989('0x38')],qs['fields'](_0x25debc[_0xc989('0x3a')][_0xc989('0x3d')]));_0x2a0724['attributes']=_0x2a0724['attributes'][_0xc989('0x4c')]?_0x2a0724[_0xc989('0x3c')]:_0x559552['model'];_0x2a0724[_0xc989('0x3f')]=qs[_0xc989('0x40')](_0x25debc['query'][_0xc989('0x40')]);_0x2a0724[_0xc989('0x43')]=qs[_0xc989('0x41')](_['pick'](_0x25debc['query'],_0x559552[_0xc989('0x41')]));if(_0x25debc['query'][_0xc989('0x42')]){_0x2a0724[_0xc989('0x43')]=_[_0xc989('0x44')](_0x2a0724[_0xc989('0x43')],{'$or':_[_0xc989('0x33')](_0x2a0724[_0xc989('0x3c')],function(_0x37c692){var _0x200b0c={};_0x200b0c[_0x37c692]={'$like':'%'+_0x25debc['query']['filter']+'%'};return _0x200b0c;})});}_0x2a0724=_['merge']({},_0x2a0724,_0x25debc['options']);return _0x29f9bf[_0xc989('0x8f')](_0x2a0724);}})[_0xc989('0x29')](function(_0x54bbba){if(_0x54bbba){_0x4bcd71=_0x54bbba[_0xc989('0x4c')];if(!_0x25debc['query'][_0xc989('0x5b')](_0xc989('0x3e'))){_0x2a0724[_0xc989('0x21')]=qs[_0xc989('0x21')](_0x25debc['query'][_0xc989('0x21')]);_0x2a0724[_0xc989('0x1f')]=qs[_0xc989('0x1f')](_0x25debc[_0xc989('0x3a')][_0xc989('0x1f')]);}return _0x29f9bf[_0xc989('0x8f')](_0x2a0724);}})[_0xc989('0x29')](function(_0xf874e9){if(_0xf874e9){return _0xf874e9?{'count':_0x4bcd71,'rows':_0xf874e9}:null;}})[_0xc989('0x29')](respondWithResult(_0x3556cd,null))[_0xc989('0x4a')](handleError(_0x3556cd,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 2add7b0..6c911c9 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(_0x4f5c99,_0x11508f){_0x4f5c99=_0x4f5c99-0x0;var _0x41493d=_0x326f[_0x4f5c99];return _0x41493d;};'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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x557463,_0x1f72d4){var _0xe19022=function(_0x365111){while(--_0x365111){_0x557463['push'](_0x557463['shift']());}};_0xe19022(++_0x1f72d4);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e3e8796..7b5abb1 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 _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0xf109,0xce));var _0x9f10=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xf109[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0xa75b,0x170));var _0xba75=function(_0x34dc04,_0x5beb16){_0x34dc04=_0x34dc04-0x0;var _0xddc079=_0xa75b[_0x34dc04];return _0xddc079;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),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 4fe8ef5..f65fc54 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 _0x497a=['socket.io-emitter','./cmList.socket','register','request','then','request\x20sent','debug','error','code','CmList,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x4e3abe,_0x23d12a){var _0x26409c=function(_0x64f205){while(--_0x64f205){_0x4e3abe['push'](_0x4e3abe['shift']());}};_0x26409c(++_0x23d12a);}(_0x497a,0x1ce));var _0xa497=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x497a[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa497('0x0'));var BPromise=require(_0xa497('0x1'));var rs=require(_0xa497('0x2'));var fs=require('fs');var Redis=require(_0xa497('0x3'));var db=require(_0xa497('0x4'))['db'];var utils=require(_0xa497('0x5'));var logger=require(_0xa497('0x6'))(_0xa497('0x7'));var config=require(_0xa497('0x8'));var jayson=require(_0xa497('0x9'));var client=jayson[_0xa497('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa497('0xb')](config[_0xa497('0xc')],{'host':_0xa497('0xd'),'port':0x18eb});var socket=require(_0xa497('0xe'))(new Redis(config[_0xa497('0xc')]));require(_0xa497('0xf'))[_0xa497('0x10')](socket);function respondWithRpcPromise(_0x20df50,_0x131acb,_0x19db26){return new BPromise(function(_0x4c8826,_0x1ac92a){return client[_0xa497('0x11')](_0x20df50,_0x19db26)[_0xa497('0x12')](function(_0x28b08c){logger['info']('CmList,\x20%s,\x20%s',_0x131acb,_0xa497('0x13'));logger[_0xa497('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x131acb,'request\x20sent',JSON['stringify'](_0x28b08c));if(_0x28b08c[_0xa497('0x15')]){if(_0x28b08c['error'][_0xa497('0x16')]===0x1f4){logger[_0xa497('0x15')](_0xa497('0x17'),_0x131acb,_0x28b08c[_0xa497('0x15')][_0xa497('0x18')]);return _0x1ac92a(_0x28b08c[_0xa497('0x15')][_0xa497('0x18')]);}logger['error'](_0xa497('0x17'),_0x131acb,_0x28b08c['error'][_0xa497('0x18')]);return _0x4c8826(_0x28b08c['error'][_0xa497('0x18')]);}else{logger[_0xa497('0x19')](_0xa497('0x17'),_0x131acb,'request\x20sent');_0x4c8826(_0x28b08c[_0xa497('0x1a')][_0xa497('0x18')]);}})[_0xa497('0x1b')](function(_0x3a0126){logger[_0xa497('0x15')](_0xa497('0x17'),_0x131acb,_0x3a0126);_0x1ac92a(_0x3a0126);});});} \ No newline at end of file +var _0x88b1=['request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x42181c,_0x267642){var _0x2e2e20=function(_0x430bad){while(--_0x430bad){_0x42181c['push'](_0x42181c['shift']());}};_0x2e2e20(++_0x267642);}(_0x88b1,0x1c7));var _0x188b=function(_0xe48773,_0x2e8d5b){_0xe48773=_0xe48773-0x0;var _0x295910=_0x88b1[_0xe48773];return _0x295910;};'use strict';var _=require('lodash');var util=require(_0x188b('0x0'));var moment=require(_0x188b('0x1'));var BPromise=require(_0x188b('0x2'));var rs=require(_0x188b('0x3'));var fs=require('fs');var Redis=require(_0x188b('0x4'));var db=require(_0x188b('0x5'))['db'];var utils=require(_0x188b('0x6'));var logger=require(_0x188b('0x7'))(_0x188b('0x8'));var config=require(_0x188b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x188b('0xa')]['http']({'port':0x232a});config[_0x188b('0xb')]=_['defaults'](config[_0x188b('0xb')],{'host':_0x188b('0xc'),'port':0x18eb});var socket=require(_0x188b('0xd'))(new Redis(config[_0x188b('0xb')]));require('./cmList.socket')[_0x188b('0xe')](socket);function respondWithRpcPromise(_0x706c9a,_0x27bed2,_0x311a1c){return new BPromise(function(_0x2a43c5,_0x2e4dfc){return client[_0x188b('0xf')](_0x706c9a,_0x311a1c)[_0x188b('0x10')](function(_0x268245){logger[_0x188b('0x11')](_0x188b('0x12'),_0x27bed2,'request\x20sent');logger[_0x188b('0x13')](_0x188b('0x14'),_0x27bed2,_0x188b('0x15'),JSON[_0x188b('0x16')](_0x268245));if(_0x268245[_0x188b('0x17')]){if(_0x268245[_0x188b('0x17')][_0x188b('0x18')]===0x1f4){logger[_0x188b('0x17')](_0x188b('0x12'),_0x27bed2,_0x268245[_0x188b('0x17')][_0x188b('0x19')]);return _0x2e4dfc(_0x268245[_0x188b('0x17')]['message']);}logger[_0x188b('0x17')](_0x188b('0x12'),_0x27bed2,_0x268245[_0x188b('0x17')][_0x188b('0x19')]);return _0x2a43c5(_0x268245[_0x188b('0x17')][_0x188b('0x19')]);}else{logger[_0x188b('0x11')](_0x188b('0x12'),_0x27bed2,_0x188b('0x15'));_0x2a43c5(_0x268245[_0x188b('0x1a')][_0x188b('0x19')]);}})[_0x188b('0x1b')](function(_0x135e2c){logger['error'](_0x188b('0x12'),_0x27bed2,_0x135e2c);_0x2e4dfc(_0x135e2c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4280eec..0e6b425 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 _0xebca=['register','length','cmList:','./cmList.events','save','emit'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0xebca,0x1bf));var _0xaebc=function(_0xfe26da,_0x5ac1b7){_0xfe26da=_0xfe26da-0x0;var _0x2abe6e=_0xebca[_0xfe26da];return _0x2abe6e;};'use strict';var CmListEvents=require(_0xaebc('0x0'));var events=[_0xaebc('0x1'),'remove','update'];function createListener(_0x1da0e8,_0x12ce9e){return function(_0x322694){_0x12ce9e[_0xaebc('0x2')](_0x1da0e8,_0x322694);};}function removeListener(_0x49ce9b,_0x33a13a){return function(){CmListEvents['removeListener'](_0x49ce9b,_0x33a13a);};}exports[_0xaebc('0x3')]=function(_0x27a518){for(var _0x8ab3f5=0x0,_0x35398d=events[_0xaebc('0x4')];_0x8ab3f5<_0x35398d;_0x8ab3f5++){var _0x5b00f6=events[_0x8ab3f5];var _0x4cd55c=createListener(_0xaebc('0x5')+_0x5b00f6,_0x27a518);CmListEvents['on'](_0x5b00f6,_0x4cd55c);}}; \ No newline at end of file +var _0x48f8=['register','./cmList.events','save','remove','update','emit'];(function(_0x5c48e4,_0x2ef2ee){var _0x807bc4=function(_0x490181){while(--_0x490181){_0x5c48e4['push'](_0x5c48e4['shift']());}};_0x807bc4(++_0x2ef2ee);}(_0x48f8,0x127));var _0x848f=function(_0x27c156,_0x14ce9b){_0x27c156=_0x27c156-0x0;var _0x4a94af=_0x48f8[_0x27c156];return _0x4a94af;};'use strict';var CmListEvents=require(_0x848f('0x0'));var events=[_0x848f('0x1'),_0x848f('0x2'),_0x848f('0x3')];function createListener(_0x47c32d,_0x55c8d9){return function(_0xdf4cd6){_0x55c8d9[_0x848f('0x4')](_0x47c32d,_0xdf4cd6);};}function removeListener(_0x53051a,_0x429f5b){return function(){CmListEvents['removeListener'](_0x53051a,_0x429f5b);};}exports[_0x848f('0x5')]=function(_0x8d9719){for(var _0x3bbfcc=0x0,_0x5adf3d=events['length'];_0x3bbfcc<_0x5adf3d;_0x3bbfcc++){var _0x2ce49b=events[_0x3bbfcc];var _0xde0611=createListener('cmList:'+_0x2ce49b,_0x8d9719);CmListEvents['on'](_0x2ce49b,_0xde0611);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 9d3c81e..1931044 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 _0x7335=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','index','get','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents'];(function(_0xf1b354,_0x32048c){var _0x405d3a=function(_0x2e1dbc){while(--_0x2e1dbc){_0xf1b354['push'](_0xf1b354['shift']());}};_0x405d3a(++_0x32048c);}(_0x7335,0xef));var _0x5733=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x7335[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0x5733('0x0'));var util=require('util');var path=require(_0x5733('0x1'));var timeout=require(_0x5733('0x2'));var express=require(_0x5733('0x3'));var router=express[_0x5733('0x4')]();var fs_extra=require(_0x5733('0x5'));var auth=require(_0x5733('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5733('0x7'));var controller=require(_0x5733('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5733('0x9')]);router[_0x5733('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5733('0xb')]);router[_0x5733('0xa')](_0x5733('0xc'),auth[_0x5733('0xd')](),controller[_0x5733('0xe')]);router[_0x5733('0xa')](_0x5733('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5733('0xa')](_0x5733('0x10'),auth[_0x5733('0xd')](),controller[_0x5733('0x11')]);router[_0x5733('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x5733('0x12')]);router[_0x5733('0xa')](_0x5733('0x13'),auth[_0x5733('0xd')](),controller[_0x5733('0x14')]);router[_0x5733('0xa')](_0x5733('0x15'),auth[_0x5733('0xd')](),controller[_0x5733('0x16')]);router[_0x5733('0x17')]('/',auth['isAuthenticated'](),controller[_0x5733('0x18')]);router['post'](_0x5733('0xf'),auth[_0x5733('0xd')](),controller[_0x5733('0x19')]);router['post'](_0x5733('0x10'),auth[_0x5733('0xd')](),controller['addContacts']);router[_0x5733('0x17')](_0x5733('0x13'),auth['isAuthenticated'](),controller[_0x5733('0x1a')]);router[_0x5733('0x17')](_0x5733('0x15'),auth[_0x5733('0xd')](),controller[_0x5733('0x1b')]);router[_0x5733('0x1c')](_0x5733('0xc'),auth[_0x5733('0xd')](),controller[_0x5733('0x1d')]);router['delete'](_0x5733('0xc'),auth[_0x5733('0xd')](),controller['destroy']);router[_0x5733('0x1e')](_0x5733('0xf'),auth['isAuthenticated'](),controller[_0x5733('0x1f')]);router[_0x5733('0x1e')](_0x5733('0x15'),auth['isAuthenticated'](),controller[_0x5733('0x20')]);module[_0x5733('0x21')]=router; \ No newline at end of file +var _0x5d71=['fs-extra','../../components/auth/service','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','/:id/contacts','addAgents','update','delete','removeDispositions','exports','multer','path','connect-timeout','Router'];(function(_0x11f78d,_0x58c792){var _0x10568a=function(_0x160a0f){while(--_0x160a0f){_0x11f78d['push'](_0x11f78d['shift']());}};_0x10568a(++_0x58c792);}(_0x5d71,0x175));var _0x15d7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5d71[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x15d7('0x0'));var util=require('util');var path=require(_0x15d7('0x1'));var timeout=require(_0x15d7('0x2'));var express=require('express');var router=express[_0x15d7('0x3')]();var fs_extra=require(_0x15d7('0x4'));var auth=require(_0x15d7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x15d7('0x6'));router[_0x15d7('0x7')]('/',auth['isAuthenticated'](),controller[_0x15d7('0x8')]);router[_0x15d7('0x7')](_0x15d7('0x9'),auth[_0x15d7('0xa')](),controller[_0x15d7('0xb')]);router[_0x15d7('0x7')](_0x15d7('0xc'),auth['isAuthenticated'](),controller[_0x15d7('0xd')]);router['get'](_0x15d7('0xe'),auth[_0x15d7('0xa')](),controller[_0x15d7('0xf')]);router['get']('/:id/contacts',auth[_0x15d7('0xa')](),controller[_0x15d7('0x10')]);router[_0x15d7('0x7')]('/:id/contacts/csv',auth[_0x15d7('0xa')](),controller['getContactsCsv']);router['get'](_0x15d7('0x11'),auth[_0x15d7('0xa')](),controller[_0x15d7('0x12')]);router[_0x15d7('0x7')](_0x15d7('0x13'),auth['isAuthenticated'](),controller[_0x15d7('0x14')]);router['post']('/',auth[_0x15d7('0xa')](),controller[_0x15d7('0x15')]);router[_0x15d7('0x16')]('/:id/dispositions',auth[_0x15d7('0xa')](),controller['addDisposition']);router['post'](_0x15d7('0x17'),auth[_0x15d7('0xa')](),controller['addContacts']);router['post']('/:id/fields',auth['isAuthenticated'](),controller['addCustomField']);router[_0x15d7('0x16')](_0x15d7('0x13'),auth[_0x15d7('0xa')](),controller[_0x15d7('0x18')]);router['put'](_0x15d7('0xc'),auth['isAuthenticated'](),controller[_0x15d7('0x19')]);router[_0x15d7('0x1a')](_0x15d7('0xc'),auth[_0x15d7('0xa')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x15d7('0xa')](),controller[_0x15d7('0x1b')]);router[_0x15d7('0x1a')](_0x15d7('0x13'),auth[_0x15d7('0xa')](),controller['removeAgents']);module[_0x15d7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e33bec1..032d526 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 _0xfc28=['exports','getDataValue','STRING','sequelize'];(function(_0x2c896c,_0x422261){var _0x553990=function(_0x14118e){while(--_0x14118e){_0x2c896c['push'](_0x2c896c['shift']());}};_0x553990(++_0x422261);}(_0xfc28,0x1ef));var _0x8fc2=function(_0x115f1b,_0x58e1b2){_0x115f1b=_0x115f1b-0x0;var _0xc3393a=_0xfc28[_0x115f1b];return _0xc3393a;};'use strict';var Sequelize=require(_0x8fc2('0x0'));module[_0x8fc2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3da768){return this[_0x8fc2('0x2')]('field');}},'field':{'type':Sequelize[_0x8fc2('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x8fc2('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x8fc2('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x20a1=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x19958c,_0x9c863b){var _0x3cbcd1=function(_0x105b4e){while(--_0x105b4e){_0x19958c['push'](_0x19958c['shift']());}};_0x3cbcd1(++_0x9c863b);}(_0x20a1,0x11a));var _0x120a=function(_0xd674d1,_0x1a347b){_0xd674d1=_0xd674d1-0x0;var _0x11b100=_0x20a1[_0xd674d1];return _0x11b100;};'use strict';var Sequelize=require(_0x120a('0x0'));module[_0x120a('0x1')]={'name':{'type':Sequelize[_0x120a('0x2')],'get':function(_0x4dc53e){return this[_0x120a('0x3')](_0x120a('0x4'));}},'field':{'type':Sequelize[_0x120a('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x120a('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x120a('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index f8a1992..12f1f4c 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x39f0b0,_0x88ba80){var _0x462831=function(_0x431f8c){while(--_0x431f8c){_0x39f0b0['push'](_0x39f0b0['shift']());}};_0x462831(++_0x88ba80);}(_0x7a54,0x106));var _0x47a5=function(_0x5a44a4,_0x5935d6){_0x5a44a4=_0x5a44a4-0x0;var _0xcf1317=_0x7a54[_0x5a44a4];return _0xcf1317;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4c93c0,_0x1e0be0){var _0x4c3dcd=function(_0x5645a1){while(--_0x5645a1){_0x4c93c0['push'](_0x4c93c0['shift']());}};_0x4c3dcd(++_0x1e0be0);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 aaa8de4..4db934a 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 _0xb87b=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb87b,0xb2));var _0xbb87=function(_0x190b91,_0x2f4cfe){_0x190b91=_0x190b91-0x0;var _0x2db823=_0xb87b[_0x190b91];return _0x2db823;};'use strict';var _=require(_0xbb87('0x0'));var util=require(_0xbb87('0x1'));var logger=require(_0xbb87('0x2'))('api');var moment=require(_0xbb87('0x3'));var BPromise=require(_0xbb87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb87('0x5'));var rimraf=require(_0xbb87('0x6'));var config=require(_0xbb87('0x7'));var attributes=require(_0xbb87('0x8'));module[_0xbb87('0x9')]=function(_0x3e9a16,_0x374b6d){return _0x3e9a16[_0xbb87('0xa')](_0xbb87('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72a9=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x23d878,_0x59d6d9){var _0x38fa8b=function(_0x589550){while(--_0x589550){_0x23d878['push'](_0x23d878['shift']());}};_0x38fa8b(++_0x59d6d9);}(_0x72a9,0x1a6));var _0x972a=function(_0x584fde,_0x479309){_0x584fde=_0x584fde-0x0;var _0x4b7515=_0x72a9[_0x584fde];return _0x4b7515;};'use strict';var _=require(_0x972a('0x0'));var util=require('util');var logger=require(_0x972a('0x1'))(_0x972a('0x2'));var moment=require(_0x972a('0x3'));var BPromise=require(_0x972a('0x4'));var rp=require(_0x972a('0x5'));var fs=require('fs');var path=require(_0x972a('0x6'));var rimraf=require(_0x972a('0x7'));var config=require(_0x972a('0x8'));var attributes=require(_0x972a('0x9'));module[_0x972a('0xa')]=function(_0x2ab057,_0x596992){return _0x2ab057[_0x972a('0xb')](_0x972a('0xc'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 3ffc373..9c2abc2 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 _0x1959=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x1959,0x121));var _0x9195=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x1959[_0x3d27a];return _0x314fd7;};'use strict';var _=require(_0x9195('0x0'));var util=require(_0x9195('0x1'));var moment=require(_0x9195('0x2'));var BPromise=require('bluebird');var rs=require(_0x9195('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9195('0x4'))['db'];var utils=require(_0x9195('0x5'));var logger=require(_0x9195('0x6'))('rpc');var config=require(_0x9195('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9195('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x305a24,_0xbba445,_0x1720b6){return new BPromise(function(_0x5e4aae,_0x511f23){return client[_0x9195('0x9')](_0x305a24,_0x1720b6)[_0x9195('0xa')](function(_0x3686e3){logger[_0x9195('0xb')](_0x9195('0xc'),_0xbba445,_0x9195('0xd'));logger[_0x9195('0xe')](_0x9195('0xf'),_0xbba445,_0x9195('0xd'),JSON[_0x9195('0x10')](_0x3686e3));if(_0x3686e3[_0x9195('0x11')]){if(_0x3686e3[_0x9195('0x11')][_0x9195('0x12')]===0x1f4){logger[_0x9195('0x11')](_0x9195('0xc'),_0xbba445,_0x3686e3['error'][_0x9195('0x13')]);return _0x511f23(_0x3686e3['error'][_0x9195('0x13')]);}logger[_0x9195('0x11')](_0x9195('0xc'),_0xbba445,_0x3686e3[_0x9195('0x11')]['message']);return _0x5e4aae(_0x3686e3[_0x9195('0x11')][_0x9195('0x13')]);}else{logger[_0x9195('0xb')]('Condition,\x20%s,\x20%s',_0xbba445,_0x9195('0xd'));_0x5e4aae(_0x3686e3[_0x9195('0x14')]['message']);}})['catch'](function(_0x2483b5){logger['error'](_0x9195('0xc'),_0xbba445,_0x2483b5);_0x511f23(_0x2483b5);});});} \ No newline at end of file +var _0x8a91=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xf93cc1,_0x253b48){var _0x21c1d8=function(_0x55600b){while(--_0x55600b){_0xf93cc1['push'](_0xf93cc1['shift']());}};_0x21c1d8(++_0x253b48);}(_0x8a91,0xa1));var _0x18a9=function(_0x37a512,_0x2d4b2b){_0x37a512=_0x37a512-0x0;var _0x58c663=_0x8a91[_0x37a512];return _0x58c663;};'use strict';var _=require(_0x18a9('0x0'));var util=require('util');var moment=require(_0x18a9('0x1'));var BPromise=require(_0x18a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18a9('0x3'));var db=require(_0x18a9('0x4'))['db'];var utils=require(_0x18a9('0x5'));var logger=require(_0x18a9('0x6'))(_0x18a9('0x7'));var config=require(_0x18a9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x18a9('0x9')][_0x18a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38f633,_0x5a6184,_0x386171){return new BPromise(function(_0x4784e2,_0x2bd334){return client[_0x18a9('0xb')](_0x38f633,_0x386171)['then'](function(_0x5c4582){logger['info'](_0x18a9('0xc'),_0x5a6184,'request\x20sent');logger['debug'](_0x18a9('0xd'),_0x5a6184,_0x18a9('0xe'),JSON[_0x18a9('0xf')](_0x5c4582));if(_0x5c4582[_0x18a9('0x10')]){if(_0x5c4582[_0x18a9('0x10')][_0x18a9('0x11')]===0x1f4){logger[_0x18a9('0x10')](_0x18a9('0xc'),_0x5a6184,_0x5c4582[_0x18a9('0x10')]['message']);return _0x2bd334(_0x5c4582[_0x18a9('0x10')][_0x18a9('0x12')]);}logger[_0x18a9('0x10')](_0x18a9('0xc'),_0x5a6184,_0x5c4582[_0x18a9('0x10')][_0x18a9('0x12')]);return _0x4784e2(_0x5c4582['error'][_0x18a9('0x12')]);}else{logger[_0x18a9('0x13')](_0x18a9('0xc'),_0x5a6184,_0x18a9('0xe'));_0x4784e2(_0x5c4582[_0x18a9('0x14')][_0x18a9('0x12')]);}})[_0x18a9('0x15')](function(_0x27af66){logger[_0x18a9('0x10')](_0x18a9('0xc'),_0x5a6184,_0x27af66);_0x2bd334(_0x27af66);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1cb04b4..9963742 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 _0x4b6d=['../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0x4b6d,0xff));var _0xd4b6=function(_0x487780,_0x50efd9){_0x487780=_0x487780-0x0;var _0x40328c=_0x4b6d[_0x487780];return _0x40328c;};'use strict';var multer=require(_0xd4b6('0x0'));var util=require(_0xd4b6('0x1'));var path=require('path');var timeout=require(_0xd4b6('0x2'));var express=require(_0xd4b6('0x3'));var router=express[_0xd4b6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd4b6('0x5'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xd4b6('0x6')](_0xd4b6('0x7'),auth[_0xd4b6('0x8')](),controller[_0xd4b6('0x9')]);router[_0xd4b6('0xa')](_0xd4b6('0x7'),auth[_0xd4b6('0x8')](),controller[_0xd4b6('0xb')]);module[_0xd4b6('0xc')]=router; \ No newline at end of file +var _0x5d26=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','update','/:id','destroy'];(function(_0x5a9841,_0x950566){var _0xb4f748=function(_0xdecea8){while(--_0xdecea8){_0x5a9841['push'](_0x5a9841['shift']());}};_0xb4f748(++_0x950566);}(_0x5d26,0x1d5));var _0x65d2=function(_0x10bf64,_0x1b2e31){_0x10bf64=_0x10bf64-0x0;var _0x5e63cf=_0x5d26[_0x10bf64];return _0x5e63cf;};'use strict';var multer=require(_0x65d2('0x0'));var util=require(_0x65d2('0x1'));var path=require('path');var timeout=require(_0x65d2('0x2'));var express=require(_0x65d2('0x3'));var router=express[_0x65d2('0x4')]();var fs_extra=require(_0x65d2('0x5'));var auth=require(_0x65d2('0x6'));var interaction=require(_0x65d2('0x7'));var config=require(_0x65d2('0x8'));var controller=require('./condition.controller');router['put']('/:id',auth['isAuthenticated'](),controller[_0x65d2('0x9')]);router['delete'](_0x65d2('0xa'),auth['isAuthenticated'](),controller[_0x65d2('0xb')]);module[_0x65d2('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 1a0517a..218f536 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(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7e7[_0x1fc122];return _0xa2cb13;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0xa13eff,_0x3e7df8){var _0x22a765=function(_0x63e8f6){while(--_0x63e8f6){_0xa13eff['push'](_0xa13eff['shift']());}};_0x22a765(++_0x3e7df8);}(_0x757a,0xde));var _0xa757=function(_0x3397ea,_0x224688){_0x3397ea=_0x3397ea-0x0;var _0x303e76=_0x757a[_0x3397ea];return _0x303e76;};'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 84edf01..0eaf345 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 _0xd1b3=['omit','updatedAt','createdAt','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie3','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','status','end','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','map','Dashboard','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params'];(function(_0x3513ee,_0x48daa6){var _0x1660f8=function(_0x121d2c){while(--_0x121d2c){_0x3513ee['push'](_0x3513ee['shift']());}};_0x1660f8(++_0x48daa6);}(_0xd1b3,0x12c));var _0x3d1b=function(_0x1b2461,_0x1cd8cc){_0x1b2461=_0x1b2461-0x0;var _0x56b12d=_0xd1b3[_0x1b2461];return _0x56b12d;};'use strict';var emlformat=require(_0x3d1b('0x0'));var rimraf=require(_0x3d1b('0x1'));var zipdir=require(_0x3d1b('0x2'));var jsonpatch=require(_0x3d1b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d1b('0x4'));var Mustache=require(_0x3d1b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3d1b('0x6'));var csv=require(_0x3d1b('0x7'));var ejs=require(_0x3d1b('0x8'));var fs=require('fs');var fs_extra=require(_0x3d1b('0x9'));var _=require('lodash');var squel=require(_0x3d1b('0xa'));var crypto=require('crypto');var jsforce=require(_0x3d1b('0xb'));var deskjs=require(_0x3d1b('0xc'));var toCsv=require(_0x3d1b('0x7'));var querystring=require(_0x3d1b('0xd'));var Papa=require(_0x3d1b('0xe'));var Redis=require(_0x3d1b('0xf'));var authService=require(_0x3d1b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3d1b('0x11'));var hardwareService=require(_0x3d1b('0x12'));var logger=require(_0x3d1b('0x13'))(_0x3d1b('0x14'));var utils=require(_0x3d1b('0x15'));var config=require(_0x3d1b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d1b('0x17'))['db'];config[_0x3d1b('0x18')]=_[_0x3d1b('0x19')](config[_0x3d1b('0x18')],{'host':_0x3d1b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d1b('0x18')]));require(_0x3d1b('0x1b'))[_0x3d1b('0x1c')](socket);function respondWithStatusCode(_0x2be487,_0x77366){_0x77366=_0x77366||0xcc;return function(_0x4ac3a1){if(_0x4ac3a1){return _0x2be487['sendStatus'](_0x77366);}return _0x2be487[_0x3d1b('0x1d')](_0x77366)[_0x3d1b('0x1e')]();};}function respondWithResult(_0xfdca5,_0x5017ef){_0x5017ef=_0x5017ef||0xc8;return function(_0xb8022){if(_0xb8022){return _0xfdca5[_0x3d1b('0x1d')](_0x5017ef)['json'](_0xb8022);}};}function respondWithFilteredResult(_0xfe83a2,_0x55743a){return function(_0x354684){if(_0x354684){var _0x3d402f=typeof _0x55743a[_0x3d1b('0x1f')]===_0x3d1b('0x20')&&typeof _0x55743a['limit']===_0x3d1b('0x20');var _0x3826ec=_0x354684['count'];var _0x2078e1=_0x3d402f?0x0:_0x55743a['offset'];var _0x5078b4=_0x3d402f?_0x354684['count']:_0x55743a[_0x3d1b('0x1f')]+_0x55743a['limit'];var _0xa04c80;if(_0x5078b4>=_0x3826ec){_0x5078b4=_0x3826ec;_0xa04c80=0xc8;}else{_0xa04c80=0xce;}_0xfe83a2[_0x3d1b('0x1d')](_0xa04c80);return _0xfe83a2[_0x3d1b('0x21')](_0x3d1b('0x22'),_0x2078e1+'-'+_0x5078b4+'/'+_0x3826ec)['json'](_0x354684);}return null;};}function patchUpdates(_0xe46fcc){return function(_0x54ad70){try{jsonpatch[_0x3d1b('0x23')](_0x54ad70,_0xe46fcc,!![]);}catch(_0x1a3b8d){return BPromise[_0x3d1b('0x24')](_0x1a3b8d);}return _0x54ad70[_0x3d1b('0x25')]();};}function saveUpdates(_0x2ca1dd,_0x3b3cdf){return function(_0x87ac94){if(_0x87ac94){return _0x87ac94[_0x3d1b('0x26')](_0x2ca1dd)[_0x3d1b('0x27')](function(_0x43757e){return _0x43757e;});}return null;};}function removeEntity(_0x2c2dcc,_0x1d9125){return function(_0x2d85f5){if(_0x2d85f5){return _0x2d85f5[_0x3d1b('0x28')]()[_0x3d1b('0x27')](function(){var _0x4d4fc9=_0x2d85f5[_0x3d1b('0x29')]({'plain':!![]});var _0x203210=_0x3d1b('0x2a');return db[_0x3d1b('0x2b')]['destroy']({'where':{'type':_0x203210,'resourceId':_0x4d4fc9['id']}})[_0x3d1b('0x27')](function(){return _0x2d85f5;});})[_0x3d1b('0x27')](function(){_0x2c2dcc[_0x3d1b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bf2bb,_0x366390){return function(_0x5b410d){if(!_0x5b410d){_0x2bf2bb[_0x3d1b('0x2c')](0x194);}return _0x5b410d;};}function handleError(_0x5d3f57,_0x3dd194){_0x3dd194=_0x3dd194||0x1f4;return function(_0xb5053a){logger[_0x3d1b('0x2d')](_0xb5053a[_0x3d1b('0x2e')]);if(_0xb5053a[_0x3d1b('0x2f')]){delete _0xb5053a[_0x3d1b('0x2f')];}_0x5d3f57[_0x3d1b('0x1d')](_0x3dd194)[_0x3d1b('0x30')](_0xb5053a);};}exports[_0x3d1b('0x31')]=function(_0x351588,_0x5cde83){var _0x31dadd={},_0x3ca195={},_0x248246={'count':0x0,'rows':[]};var _0xe5d97a=_[_0x3d1b('0x32')](db[_0x3d1b('0x33')]['rawAttributes'],function(_0x472c37){return{'name':_0x472c37[_0x3d1b('0x34')],'type':_0x472c37[_0x3d1b('0x35')]['key']};});_0x3ca195['model']=_[_0x3d1b('0x32')](_0xe5d97a,'name');_0x3ca195[_0x3d1b('0x36')]=_[_0x3d1b('0x37')](_0x351588[_0x3d1b('0x36')]);_0x3ca195['filters']=_[_0x3d1b('0x38')](_0x3ca195[_0x3d1b('0x39')],_0x3ca195['query']);_0x31dadd['attributes']=_[_0x3d1b('0x38')](_0x3ca195[_0x3d1b('0x39')],qs[_0x3d1b('0x3a')](_0x351588[_0x3d1b('0x36')][_0x3d1b('0x3a')]));_0x31dadd[_0x3d1b('0x3b')]=_0x31dadd[_0x3d1b('0x3b')][_0x3d1b('0x3c')]?_0x31dadd['attributes']:_0x3ca195['model'];if(!_0x351588['query'][_0x3d1b('0x3d')](_0x3d1b('0x3e'))){_0x31dadd[_0x3d1b('0x3f')]=qs[_0x3d1b('0x3f')](_0x351588[_0x3d1b('0x36')][_0x3d1b('0x3f')]);_0x31dadd[_0x3d1b('0x1f')]=qs['offset'](_0x351588[_0x3d1b('0x36')]['offset']);}_0x31dadd[_0x3d1b('0x40')]=qs['sort'](_0x351588[_0x3d1b('0x36')][_0x3d1b('0x41')]);_0x31dadd[_0x3d1b('0x42')]=qs[_0x3d1b('0x43')](_[_0x3d1b('0x44')](_0x351588[_0x3d1b('0x36')],_0x3ca195[_0x3d1b('0x43')]),_0xe5d97a);if(_0x351588[_0x3d1b('0x36')][_0x3d1b('0x45')]){_0x31dadd[_0x3d1b('0x42')]=_[_0x3d1b('0x46')](_0x31dadd[_0x3d1b('0x42')],{'$or':_['map'](_0xe5d97a,function(_0x2cafa3){if(_0x2cafa3[_0x3d1b('0x35')]!=='VIRTUAL'){var _0x3234da={};_0x3234da[_0x2cafa3[_0x3d1b('0x2f')]]={'$like':'%'+_0x351588['query'][_0x3d1b('0x45')]+'%'};return _0x3234da;}})});}_0x31dadd=_[_0x3d1b('0x46')]({},_0x31dadd,_0x351588[_0x3d1b('0x47')]);var _0x521563={'where':_0x31dadd[_0x3d1b('0x42')]};return db['Dashboard'][_0x3d1b('0x48')](_0x521563)[_0x3d1b('0x27')](function(_0xeae6e4){_0x248246['count']=_0xeae6e4;if(_0x351588[_0x3d1b('0x36')][_0x3d1b('0x49')]){_0x31dadd['include']=[{'all':!![]}];}return db[_0x3d1b('0x33')][_0x3d1b('0x4a')](_0x31dadd);})[_0x3d1b('0x27')](function(_0x51f789){_0x248246[_0x3d1b('0x4b')]=_0x51f789;return _0x248246;})['then'](respondWithFilteredResult(_0x5cde83,_0x31dadd))[_0x3d1b('0x4c')](handleError(_0x5cde83,null));};exports[_0x3d1b('0x4d')]=function(_0x519f08,_0x1877ee){var _0x57f95b={'raw':![],'where':{'id':_0x519f08['params']['id']}},_0x4301b6={};_0x4301b6[_0x3d1b('0x39')]=_['keys'](db[_0x3d1b('0x33')][_0x3d1b('0x4e')]);_0x4301b6['query']=_['keys'](_0x519f08['query']);_0x4301b6[_0x3d1b('0x43')]=_[_0x3d1b('0x38')](_0x4301b6[_0x3d1b('0x39')],_0x4301b6[_0x3d1b('0x36')]);_0x57f95b[_0x3d1b('0x3b')]=_['intersection'](_0x4301b6[_0x3d1b('0x39')],qs[_0x3d1b('0x3a')](_0x519f08[_0x3d1b('0x36')]['fields']));_0x57f95b[_0x3d1b('0x3b')]=_0x57f95b[_0x3d1b('0x3b')]['length']?_0x57f95b[_0x3d1b('0x3b')]:_0x4301b6[_0x3d1b('0x39')];if(_0x519f08[_0x3d1b('0x36')][_0x3d1b('0x49')]){_0x57f95b['include']=[{'all':!![]}];}_0x57f95b=_['merge']({},_0x57f95b,_0x519f08[_0x3d1b('0x47')]);return db[_0x3d1b('0x33')][_0x3d1b('0x4f')](_0x57f95b)[_0x3d1b('0x27')](handleEntityNotFound(_0x1877ee,null))[_0x3d1b('0x27')](respondWithResult(_0x1877ee,null))['catch'](handleError(_0x1877ee,null));};exports['create']=function(_0x574f98,_0x4126c9){return db[_0x3d1b('0x33')][_0x3d1b('0x50')](_0x574f98[_0x3d1b('0x51')],{})['then'](function(_0x37a50e){var _0x305e09=_0x574f98[_0x3d1b('0x52')][_0x3d1b('0x29')]({'plain':!![]});if(!_0x305e09)throw new Error(_0x3d1b('0x53'));if(_0x305e09[_0x3d1b('0x54')]===_0x3d1b('0x52')){var _0x29cc76=_0x37a50e[_0x3d1b('0x29')]({'plain':!![]});var _0x4206ba='CustomDashboards';return db[_0x3d1b('0x55')]['find']({'where':{'name':_0x4206ba,'userProfileId':_0x305e09[_0x3d1b('0x56')]},'raw':!![]})[_0x3d1b('0x27')](function(_0x57f45f){if(_0x57f45f&&_0x57f45f['autoAssociation']===0x0){return db[_0x3d1b('0x2b')][_0x3d1b('0x50')]({'name':_0x29cc76[_0x3d1b('0x2f')],'resourceId':_0x29cc76['id'],'type':_0x57f45f['name'],'sectionId':_0x57f45f['id']},{})[_0x3d1b('0x27')](function(){return _0x37a50e;});}else{return _0x37a50e;}})[_0x3d1b('0x4c')](function(_0x488bfb){logger[_0x3d1b('0x2d')](_0x3d1b('0x57'),_0x488bfb);throw _0x488bfb;});}return _0x37a50e;})[_0x3d1b('0x27')](respondWithResult(_0x4126c9,0xc9))[_0x3d1b('0x4c')](handleError(_0x4126c9,null));};exports[_0x3d1b('0x58')]=function(_0x5d3682,_0x46c952){var _0x47e13a={'where':{'id':_0x5d3682[_0x3d1b('0x59')]['id']}},_0x587ca5={};_0x587ca5['model']=_[_0x3d1b('0x37')](db['Dashboard'][_0x3d1b('0x4e')]);_0x47e13a[_0x3d1b('0x3b')]=_[_0x3d1b('0x38')](_0x587ca5[_0x3d1b('0x39')],qs[_0x3d1b('0x3a')](_0x5d3682[_0x3d1b('0x36')][_0x3d1b('0x3a')]));_0x47e13a[_0x3d1b('0x3b')]=_0x47e13a['attributes'][_0x3d1b('0x3c')]?_0x47e13a[_0x3d1b('0x3b')]:_0x587ca5[_0x3d1b('0x39')];if(_0x5d3682[_0x3d1b('0x36')]['includeAll']){_0x47e13a['include']=[{'all':!![]}];}_0x47e13a=_[_0x3d1b('0x46')]({},_0x47e13a,_0x5d3682['options']);return db[_0x3d1b('0x33')][_0x3d1b('0x4f')](_0x47e13a)['then'](handleEntityNotFound(_0x46c952,null))[_0x3d1b('0x27')](function(_0x282ee8){if(_0x282ee8){var _0x83efc8=_0x282ee8[_0x3d1b('0x29')]({'plain':!![]});_0x83efc8=qs[_0x3d1b('0x5a')](_0x83efc8,['id','createdAt',_0x3d1b('0x5b')]);_0x5d3682['body']=_['omit'](_0x5d3682['body'],['id',_0x3d1b('0x5c'),_0x3d1b('0x5b')]);return db[_0x3d1b('0x33')]['create'](_[_0x3d1b('0x46')](_0x83efc8,_0x5d3682[_0x3d1b('0x51')]),{'include':_0x5d3682[_0x3d1b('0x36')][_0x3d1b('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x10e519){var _0x173dd0=_0x5d3682['user'][_0x3d1b('0x29')]({'plain':!![]});if(!_0x173dd0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x173dd0['role']===_0x3d1b('0x52')){var _0x21a7ea=_0x10e519[_0x3d1b('0x29')]({'plain':!![]});var _0x3b871c=_0x3d1b('0x2a');return db[_0x3d1b('0x55')][_0x3d1b('0x4f')]({'where':{'name':_0x3b871c,'userProfileId':_0x173dd0[_0x3d1b('0x56')]},'raw':!![]})['then'](function(_0x2db9cc){if(_0x2db9cc&&_0x2db9cc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x21a7ea[_0x3d1b('0x2f')],'resourceId':_0x21a7ea['id'],'type':_0x2db9cc['name'],'sectionId':_0x2db9cc['id']},{})[_0x3d1b('0x27')](function(){return _0x10e519;});}else{return _0x10e519;}})[_0x3d1b('0x4c')](function(_0x123e47){logger[_0x3d1b('0x2d')](_0x3d1b('0x57'),_0x123e47);throw _0x123e47;});}return _0x10e519;});}})[_0x3d1b('0x27')](respondWithResult(_0x46c952,0xc9))[_0x3d1b('0x4c')](handleError(_0x46c952,null));};exports[_0x3d1b('0x26')]=function(_0x4a33f4,_0x431acb){if(_0x4a33f4[_0x3d1b('0x51')]['id']){delete _0x4a33f4[_0x3d1b('0x51')]['id'];}return db[_0x3d1b('0x33')][_0x3d1b('0x4f')]({'where':{'id':_0x4a33f4['params']['id']}})['then'](handleEntityNotFound(_0x431acb,null))['then'](saveUpdates(_0x4a33f4[_0x3d1b('0x51')],null))[_0x3d1b('0x27')](respondWithResult(_0x431acb,null))[_0x3d1b('0x4c')](handleError(_0x431acb,null));};exports[_0x3d1b('0x28')]=function(_0x101628,_0x5f3661){return db['Dashboard']['find']({'where':{'id':_0x101628[_0x3d1b('0x59')]['id']}})[_0x3d1b('0x27')](handleEntityNotFound(_0x5f3661,null))[_0x3d1b('0x27')](removeEntity(_0x5f3661,null))[_0x3d1b('0x4c')](handleError(_0x5f3661,null));};function widgetAttributes(_0x9ba2ac){try{switch(_0x9ba2ac[_0x3d1b('0x35')]){case _0x3d1b('0x5d'):return[{'name':_0x3d1b('0x5e'),'value':_0x9ba2ac[_0x3d1b('0x5e')]||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||_0x3d1b('0x61')}];case _0x3d1b('0x62'):return[{'name':'attrPath','value':_0x9ba2ac['attrPath']||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||''}];case _0x3d1b('0x63'):return[{'name':_0x3d1b('0x64'),'value':_0x9ba2ac[_0x3d1b('0x64')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||_0x3d1b('0x65')},{'name':_0x3d1b('0x66'),'value':_0x9ba2ac[_0x3d1b('0x66')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||_0x3d1b('0x67')},{'name':_0x3d1b('0x68'),'value':_0x9ba2ac[_0x3d1b('0x68')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x2]?_0x9ba2ac['attrs'][0x2][_0x3d1b('0x60')]:undefined)||0xc}];case _0x3d1b('0x69'):return[{'name':_0x3d1b('0x6a'),'value':_0x9ba2ac[_0x3d1b('0x6a')]||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||'total'},{'name':_0x3d1b('0x6b'),'value':_0x9ba2ac[_0x3d1b('0x6b')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x9ba2ac[_0x3d1b('0x68')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x2]?_0x9ba2ac['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x3d1b('0x6c'),'value':_0x9ba2ac[_0x3d1b('0x6c')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x3]?_0x9ba2ac['attrs'][0x3]['value']:undefined)||_0x3d1b('0x6d')},{'name':'attrEmailAccounts','value':_0x9ba2ac['attrEmailAccounts']||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x4]?_0x9ba2ac['attrs'][0x4]['value']:undefined)||''},{'name':_0x3d1b('0x6e'),'value':_0x9ba2ac[_0x3d1b('0x6e')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x5]?_0x9ba2ac[_0x3d1b('0x5f')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x9ba2ac[_0x3d1b('0x6f')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x6]?_0x9ba2ac[_0x3d1b('0x5f')][0x6][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x70'),'value':_0x9ba2ac['attrOpenchannelAccounts']||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x7]?_0x9ba2ac[_0x3d1b('0x5f')][0x7][_0x3d1b('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x9ba2ac[_0x3d1b('0x71')]||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x8]?_0x9ba2ac[_0x3d1b('0x5f')][0x8][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x72'),'value':_0x9ba2ac[_0x3d1b('0x72')]||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x9]?_0x9ba2ac[_0x3d1b('0x5f')][0x9][_0x3d1b('0x60')]:undefined)||''}];case _0x3d1b('0x73'):case _0x3d1b('0x74'):return[{'name':_0x3d1b('0x75'),'value':_0x9ba2ac['attrSerie1']||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0]['value']:undefined)||_0x3d1b('0x76')},{'name':'attrSerie2','value':_0x9ba2ac['attrSerie2']||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||null},{'name':_0x3d1b('0x77'),'value':_0x9ba2ac[_0x3d1b('0x77')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x2]?_0x9ba2ac[_0x3d1b('0x5f')][0x2]['value']:undefined)||null},{'name':_0x3d1b('0x6b'),'value':_0x9ba2ac[_0x3d1b('0x6b')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x3]?_0x9ba2ac['attrs'][0x3][_0x3d1b('0x60')]:undefined)||[]},{'name':_0x3d1b('0x6c'),'value':_0x9ba2ac[_0x3d1b('0x6c')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x4]?_0x9ba2ac[_0x3d1b('0x5f')][0x4][_0x3d1b('0x60')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x9ba2ac[_0x3d1b('0x78')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x5]?_0x9ba2ac[_0x3d1b('0x5f')][0x5][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x6e'),'value':_0x9ba2ac['attrFaxAccounts']||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x6]?_0x9ba2ac[_0x3d1b('0x5f')][0x6][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x6f'),'value':_0x9ba2ac[_0x3d1b('0x6f')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x7]?_0x9ba2ac['attrs'][0x7][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x70'),'value':_0x9ba2ac[_0x3d1b('0x70')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x8]?_0x9ba2ac[_0x3d1b('0x5f')][0x8][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x71'),'value':_0x9ba2ac[_0x3d1b('0x71')]||(_0x9ba2ac['attrs']&&_0x9ba2ac[_0x3d1b('0x5f')][0x9]?_0x9ba2ac[_0x3d1b('0x5f')][0x9][_0x3d1b('0x60')]:undefined)||''},{'name':_0x3d1b('0x72'),'value':_0x9ba2ac[_0x3d1b('0x72')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac['attrs'][0xa]?_0x9ba2ac[_0x3d1b('0x5f')][0xa][_0x3d1b('0x60')]:undefined)||''}];case _0x3d1b('0x79'):return[{'name':_0x3d1b('0x7a'),'type':_0x9ba2ac[_0x3d1b('0x7b')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x35')]:undefined)||null,'value':_0x9ba2ac['attrReport']||(_0x9ba2ac['attrs']&&_0x9ba2ac['attrs'][0x0]?_0x9ba2ac[_0x3d1b('0x5f')][0x0][_0x3d1b('0x60')]:undefined)||null},{'name':_0x3d1b('0x7c'),'value':_0x9ba2ac[_0x3d1b('0x7c')]||(_0x9ba2ac[_0x3d1b('0x5f')]&&_0x9ba2ac[_0x3d1b('0x5f')][0x1]?_0x9ba2ac[_0x3d1b('0x5f')][0x1][_0x3d1b('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x5a5281){logger[_0x3d1b('0x2d')](_0x3d1b('0x7d'),JSON[_0x3d1b('0x7e')](_0x5a5281));return[];}}exports['addItem']=function(_0x3060de,_0x58261d,_0x9d66ac){if(_0x3060de[_0x3d1b('0x51')]['id']){delete _0x3060de[_0x3d1b('0x51')]['id'];}return db['Dashboard'][_0x3d1b('0x4f')]({'where':{'id':_0x3060de[_0x3d1b('0x59')]['id']}})[_0x3d1b('0x27')](handleEntityNotFound(_0x58261d,null))[_0x3d1b('0x27')](function(_0x10d156){if(_0x10d156){_0x3060de['body'][_0x3d1b('0x7f')]=_0x10d156['id'];_0x3060de[_0x3d1b('0x51')][_0x3d1b('0x5f')]=widgetAttributes(_0x3060de[_0x3d1b('0x51')]);return db['DashboardItem'][_0x3d1b('0x50')](_0x3060de['body']);}})[_0x3d1b('0x27')](respondWithResult(_0x58261d,null))['catch'](handleError(_0x58261d,null));};exports[_0x3d1b('0x80')]=function(_0x6e68f1,_0x1d7aa3,_0x3a4318){var _0x413091={};var _0x3bd90c={};var _0xcbaecf;var _0x59420d;return db['Dashboard'][_0x3d1b('0x81')]({'where':{'id':_0x6e68f1[_0x3d1b('0x59')]['id']}})[_0x3d1b('0x27')](handleEntityNotFound(_0x1d7aa3,null))[_0x3d1b('0x27')](function(_0x75936a){if(_0x75936a){_0xcbaecf=_0x75936a;_0x3bd90c[_0x3d1b('0x39')]=_[_0x3d1b('0x37')](db['DashboardItem'][_0x3d1b('0x4e')]);_0x3bd90c[_0x3d1b('0x36')]=_['keys'](_0x6e68f1['query']);_0x3bd90c[_0x3d1b('0x43')]=_[_0x3d1b('0x38')](_0x3bd90c[_0x3d1b('0x39')],_0x3bd90c[_0x3d1b('0x36')]);_0x413091[_0x3d1b('0x3b')]=_[_0x3d1b('0x38')](_0x3bd90c[_0x3d1b('0x39')],qs['fields'](_0x6e68f1['query']['fields']));_0x413091['attributes']=_0x413091['attributes'][_0x3d1b('0x3c')]?_0x413091[_0x3d1b('0x3b')]:_0x3bd90c['model'];_0x413091[_0x3d1b('0x40')]=qs[_0x3d1b('0x41')](_0x6e68f1['query'][_0x3d1b('0x41')]);_0x413091[_0x3d1b('0x42')]=qs[_0x3d1b('0x43')](_['pick'](_0x6e68f1[_0x3d1b('0x36')],_0x3bd90c['filters']));if(_0x6e68f1['query']['filter']){_0x413091[_0x3d1b('0x42')]=_['merge'](_0x413091[_0x3d1b('0x42')],{'$or':_[_0x3d1b('0x32')](_0x413091[_0x3d1b('0x3b')],function(_0xc427b6){var _0x44179f={};_0x44179f[_0xc427b6]={'$like':'%'+_0x6e68f1[_0x3d1b('0x36')][_0x3d1b('0x45')]+'%'};return _0x44179f;})});}_0x413091=_[_0x3d1b('0x46')]({},_0x413091,_0x6e68f1[_0x3d1b('0x47')]);return _0xcbaecf[_0x3d1b('0x80')](_0x413091);}})[_0x3d1b('0x27')](function(_0x499e5c){if(_0x499e5c){_0x59420d=_0x499e5c['length'];if(!_0x6e68f1['query'][_0x3d1b('0x3d')](_0x3d1b('0x3e'))){_0x413091[_0x3d1b('0x3f')]=qs[_0x3d1b('0x3f')](_0x6e68f1['query'][_0x3d1b('0x3f')]);_0x413091[_0x3d1b('0x1f')]=qs[_0x3d1b('0x1f')](_0x6e68f1['query'][_0x3d1b('0x1f')]);}return _0xcbaecf[_0x3d1b('0x80')](_0x413091);}})[_0x3d1b('0x27')](function(_0x52baa8){if(_0x52baa8){return _0x52baa8?{'count':_0x59420d,'rows':_0x52baa8}:null;}})[_0x3d1b('0x27')](respondWithResult(_0x1d7aa3,null))[_0x3d1b('0x4c')](handleError(_0x1d7aa3,null));}; \ No newline at end of file +var _0xe6a0=['rows','catch','show','params','rawAttributes','intersection','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','clone','merge','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','findOne','hasOwnProperty','nolimit','zip-dir','request-promise','mustache','sox','ejs','fs-extra','lodash','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','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','CustomDashboards','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','includeAll','include','Dashboard','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6a0,0x1bd));var _0x0e6a=function(_0x2afb75,_0x1e9ddf){_0x2afb75=_0x2afb75-0x0;var _0x5e0c7=_0xe6a0[_0x2afb75];return _0x5e0c7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0e6a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e6a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0e6a('0x2'));var util=require('util');var path=require('path');var sox=require(_0x0e6a('0x3'));var csv=require('to-csv');var ejs=require(_0x0e6a('0x4'));var fs=require('fs');var fs_extra=require(_0x0e6a('0x5'));var _=require(_0x0e6a('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e6a('0x7'));var deskjs=require(_0x0e6a('0x8'));var toCsv=require(_0x0e6a('0x9'));var querystring=require(_0x0e6a('0xa'));var Papa=require(_0x0e6a('0xb'));var Redis=require(_0x0e6a('0xc'));var authService=require(_0x0e6a('0xd'));var qs=require(_0x0e6a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e6a('0xf'));var logger=require(_0x0e6a('0x10'))('api');var utils=require(_0x0e6a('0x11'));var config=require(_0x0e6a('0x12'));var licenseUtil=require(_0x0e6a('0x13'));var db=require(_0x0e6a('0x14'))['db'];config['redis']=_[_0x0e6a('0x15')](config[_0x0e6a('0x16')],{'host':_0x0e6a('0x17'),'port':0x18eb});var socket=require(_0x0e6a('0x18'))(new Redis(config['redis']));require(_0x0e6a('0x19'))['register'](socket);function respondWithStatusCode(_0x52b157,_0x3a4d0f){_0x3a4d0f=_0x3a4d0f||0xcc;return function(_0x865f65){if(_0x865f65){return _0x52b157[_0x0e6a('0x1a')](_0x3a4d0f);}return _0x52b157['status'](_0x3a4d0f)[_0x0e6a('0x1b')]();};}function respondWithResult(_0x5d556f,_0x3b483d){_0x3b483d=_0x3b483d||0xc8;return function(_0x333963){if(_0x333963){return _0x5d556f[_0x0e6a('0x1c')](_0x3b483d)[_0x0e6a('0x1d')](_0x333963);}};}function respondWithFilteredResult(_0x30b730,_0xee9d16){return function(_0x1980cd){if(_0x1980cd){var _0x18badd=typeof _0xee9d16[_0x0e6a('0x1e')]===_0x0e6a('0x1f')&&typeof _0xee9d16[_0x0e6a('0x20')]==='undefined';var _0x2cc554=_0x1980cd[_0x0e6a('0x21')];var _0x5b12a1=_0x18badd?0x0:_0xee9d16[_0x0e6a('0x1e')];var _0x4c58d9=_0x18badd?_0x1980cd['count']:_0xee9d16[_0x0e6a('0x1e')]+_0xee9d16[_0x0e6a('0x20')];var _0x1444cf;if(_0x4c58d9>=_0x2cc554){_0x4c58d9=_0x2cc554;_0x1444cf=0xc8;}else{_0x1444cf=0xce;}_0x30b730[_0x0e6a('0x1c')](_0x1444cf);return _0x30b730[_0x0e6a('0x22')]('Content-Range',_0x5b12a1+'-'+_0x4c58d9+'/'+_0x2cc554)[_0x0e6a('0x1d')](_0x1980cd);}return null;};}function patchUpdates(_0x3fc989){return function(_0x347101){try{jsonpatch['apply'](_0x347101,_0x3fc989,!![]);}catch(_0x591892){return BPromise[_0x0e6a('0x23')](_0x591892);}return _0x347101['save']();};}function saveUpdates(_0x466db6,_0x555bc3){return function(_0x27250b){if(_0x27250b){return _0x27250b[_0x0e6a('0x24')](_0x466db6)[_0x0e6a('0x25')](function(_0x46eced){return _0x46eced;});}return null;};}function removeEntity(_0x5926e2,_0x26bd0a){return function(_0x2ac979){if(_0x2ac979){return _0x2ac979[_0x0e6a('0x26')]()[_0x0e6a('0x25')](function(){var _0x1281c0=_0x2ac979[_0x0e6a('0x27')]({'plain':!![]});var _0x1cbc61=_0x0e6a('0x28');return db['UserProfileResource'][_0x0e6a('0x26')]({'where':{'type':_0x1cbc61,'resourceId':_0x1281c0['id']}})['then'](function(){return _0x2ac979;});})[_0x0e6a('0x25')](function(){_0x5926e2[_0x0e6a('0x1c')](0xcc)[_0x0e6a('0x1b')]();});}};}function handleEntityNotFound(_0x3e31b9,_0x57fd1f){return function(_0x1af311){if(!_0x1af311){_0x3e31b9['sendStatus'](0x194);}return _0x1af311;};}function handleError(_0x2cde3e,_0x1e4357){_0x1e4357=_0x1e4357||0x1f4;return function(_0x482bdf){logger[_0x0e6a('0x29')](_0x482bdf[_0x0e6a('0x2a')]);if(_0x482bdf['name']){delete _0x482bdf[_0x0e6a('0x2b')];}_0x2cde3e[_0x0e6a('0x1c')](_0x1e4357)[_0x0e6a('0x2c')](_0x482bdf);};}exports[_0x0e6a('0x2d')]=function(_0x41774e,_0x4d593c){var _0x182a5c={},_0x1fe0a1={},_0x501f8e={'count':0x0,'rows':[]};var _0x50e231=_[_0x0e6a('0x2e')](db['Dashboard']['rawAttributes'],function(_0x1ba6de){return{'name':_0x1ba6de[_0x0e6a('0x2f')],'type':_0x1ba6de[_0x0e6a('0x30')][_0x0e6a('0x31')]};});_0x1fe0a1['model']=_['map'](_0x50e231,_0x0e6a('0x2b'));_0x1fe0a1[_0x0e6a('0x32')]=_[_0x0e6a('0x33')](_0x41774e[_0x0e6a('0x32')]);_0x1fe0a1[_0x0e6a('0x34')]=_['intersection'](_0x1fe0a1[_0x0e6a('0x35')],_0x1fe0a1['query']);_0x182a5c['attributes']=_['intersection'](_0x1fe0a1[_0x0e6a('0x35')],qs[_0x0e6a('0x36')](_0x41774e[_0x0e6a('0x32')][_0x0e6a('0x36')]));_0x182a5c['attributes']=_0x182a5c[_0x0e6a('0x37')][_0x0e6a('0x38')]?_0x182a5c[_0x0e6a('0x37')]:_0x1fe0a1[_0x0e6a('0x35')];if(!_0x41774e[_0x0e6a('0x32')]['hasOwnProperty']('nolimit')){_0x182a5c[_0x0e6a('0x20')]=qs[_0x0e6a('0x20')](_0x41774e['query'][_0x0e6a('0x20')]);_0x182a5c[_0x0e6a('0x1e')]=qs[_0x0e6a('0x1e')](_0x41774e[_0x0e6a('0x32')][_0x0e6a('0x1e')]);}_0x182a5c[_0x0e6a('0x39')]=qs[_0x0e6a('0x3a')](_0x41774e[_0x0e6a('0x32')]['sort']);_0x182a5c[_0x0e6a('0x3b')]=qs['filters'](_[_0x0e6a('0x3c')](_0x41774e['query'],_0x1fe0a1[_0x0e6a('0x34')]),_0x50e231);if(_0x41774e[_0x0e6a('0x32')][_0x0e6a('0x3d')]){_0x182a5c[_0x0e6a('0x3b')]=_['merge'](_0x182a5c[_0x0e6a('0x3b')],{'$or':_[_0x0e6a('0x2e')](_0x50e231,function(_0x4d2141){if(_0x4d2141['type']!==_0x0e6a('0x3e')){var _0x2d55d1={};_0x2d55d1[_0x4d2141[_0x0e6a('0x2b')]]={'$like':'%'+_0x41774e['query']['filter']+'%'};return _0x2d55d1;}})});}_0x182a5c=_['merge']({},_0x182a5c,_0x41774e['options']);var _0x589339={'where':_0x182a5c[_0x0e6a('0x3b')]};return db['Dashboard'][_0x0e6a('0x21')](_0x589339)['then'](function(_0x8183fb){_0x501f8e[_0x0e6a('0x21')]=_0x8183fb;if(_0x41774e['query'][_0x0e6a('0x3f')]){_0x182a5c[_0x0e6a('0x40')]=[{'all':!![]}];}return db[_0x0e6a('0x41')][_0x0e6a('0x42')](_0x182a5c);})[_0x0e6a('0x25')](function(_0x354ca9){_0x501f8e[_0x0e6a('0x43')]=_0x354ca9;return _0x501f8e;})[_0x0e6a('0x25')](respondWithFilteredResult(_0x4d593c,_0x182a5c))[_0x0e6a('0x44')](handleError(_0x4d593c,null));};exports[_0x0e6a('0x45')]=function(_0xe01ab,_0x353116){var _0x2e84ba={'raw':![],'where':{'id':_0xe01ab[_0x0e6a('0x46')]['id']}},_0x16deed={};_0x16deed[_0x0e6a('0x35')]=_[_0x0e6a('0x33')](db[_0x0e6a('0x41')][_0x0e6a('0x47')]);_0x16deed[_0x0e6a('0x32')]=_[_0x0e6a('0x33')](_0xe01ab[_0x0e6a('0x32')]);_0x16deed[_0x0e6a('0x34')]=_[_0x0e6a('0x48')](_0x16deed[_0x0e6a('0x35')],_0x16deed[_0x0e6a('0x32')]);_0x2e84ba[_0x0e6a('0x37')]=_[_0x0e6a('0x48')](_0x16deed['model'],qs[_0x0e6a('0x36')](_0xe01ab[_0x0e6a('0x32')][_0x0e6a('0x36')]));_0x2e84ba['attributes']=_0x2e84ba[_0x0e6a('0x37')][_0x0e6a('0x38')]?_0x2e84ba[_0x0e6a('0x37')]:_0x16deed[_0x0e6a('0x35')];if(_0xe01ab['query'][_0x0e6a('0x3f')]){_0x2e84ba[_0x0e6a('0x40')]=[{'all':!![]}];}_0x2e84ba=_['merge']({},_0x2e84ba,_0xe01ab[_0x0e6a('0x49')]);return db[_0x0e6a('0x41')]['find'](_0x2e84ba)[_0x0e6a('0x25')](handleEntityNotFound(_0x353116,null))[_0x0e6a('0x25')](respondWithResult(_0x353116,null))[_0x0e6a('0x44')](handleError(_0x353116,null));};exports[_0x0e6a('0x4a')]=function(_0x3eee5a,_0x10b325){return db[_0x0e6a('0x41')][_0x0e6a('0x4a')](_0x3eee5a[_0x0e6a('0x4b')],{})['then'](function(_0x3b5577){var _0xeebc31=_0x3eee5a[_0x0e6a('0x4c')][_0x0e6a('0x27')]({'plain':!![]});if(!_0xeebc31)throw new Error(_0x0e6a('0x4d'));if(_0xeebc31['role']===_0x0e6a('0x4c')){var _0x558a9d=_0x3b5577[_0x0e6a('0x27')]({'plain':!![]});var _0x235b0a=_0x0e6a('0x28');return db[_0x0e6a('0x4e')][_0x0e6a('0x4f')]({'where':{'name':_0x235b0a,'userProfileId':_0xeebc31[_0x0e6a('0x50')]},'raw':!![]})[_0x0e6a('0x25')](function(_0x4d69dc){if(_0x4d69dc&&_0x4d69dc['autoAssociation']===0x0){return db[_0x0e6a('0x51')][_0x0e6a('0x4a')]({'name':_0x558a9d[_0x0e6a('0x2b')],'resourceId':_0x558a9d['id'],'type':_0x4d69dc[_0x0e6a('0x2b')],'sectionId':_0x4d69dc['id']},{})[_0x0e6a('0x25')](function(){return _0x3b5577;});}else{return _0x3b5577;}})[_0x0e6a('0x44')](function(_0xad667c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad667c);throw _0xad667c;});}return _0x3b5577;})['then'](respondWithResult(_0x10b325,0xc9))[_0x0e6a('0x44')](handleError(_0x10b325,null));};exports[_0x0e6a('0x52')]=function(_0xa2309,_0x4abf7b){var _0x4e0455={'where':{'id':_0xa2309[_0x0e6a('0x46')]['id']}},_0x3336bb={};_0x3336bb[_0x0e6a('0x35')]=_[_0x0e6a('0x33')](db[_0x0e6a('0x41')][_0x0e6a('0x47')]);_0x4e0455[_0x0e6a('0x37')]=_[_0x0e6a('0x48')](_0x3336bb[_0x0e6a('0x35')],qs[_0x0e6a('0x36')](_0xa2309[_0x0e6a('0x32')][_0x0e6a('0x36')]));_0x4e0455['attributes']=_0x4e0455[_0x0e6a('0x37')][_0x0e6a('0x38')]?_0x4e0455['attributes']:_0x3336bb[_0x0e6a('0x35')];if(_0xa2309[_0x0e6a('0x32')][_0x0e6a('0x3f')]){_0x4e0455['include']=[{'all':!![]}];}_0x4e0455=_[_0x0e6a('0x53')]({},_0x4e0455,_0xa2309['options']);return db['Dashboard'][_0x0e6a('0x4f')](_0x4e0455)['then'](handleEntityNotFound(_0x4abf7b,null))[_0x0e6a('0x25')](function(_0x3d999c){if(_0x3d999c){var _0x19c3d0=_0x3d999c[_0x0e6a('0x27')]({'plain':!![]});_0x19c3d0=qs[_0x0e6a('0x54')](_0x19c3d0,['id',_0x0e6a('0x55'),_0x0e6a('0x56')]);_0xa2309[_0x0e6a('0x4b')]=_['omit'](_0xa2309[_0x0e6a('0x4b')],['id',_0x0e6a('0x55'),_0x0e6a('0x56')]);return db[_0x0e6a('0x41')][_0x0e6a('0x4a')](_[_0x0e6a('0x53')](_0x19c3d0,_0xa2309[_0x0e6a('0x4b')]),{'include':_0xa2309[_0x0e6a('0x32')][_0x0e6a('0x3f')]?[{'all':!![]}]:undefined})[_0x0e6a('0x25')](function(_0x488a94){var _0x538d13=_0xa2309[_0x0e6a('0x4c')][_0x0e6a('0x27')]({'plain':!![]});if(!_0x538d13)throw new Error(_0x0e6a('0x4d'));if(_0x538d13[_0x0e6a('0x57')]===_0x0e6a('0x4c')){var _0x4efa69=_0x488a94[_0x0e6a('0x27')]({'plain':!![]});var _0x1ebaa4=_0x0e6a('0x28');return db[_0x0e6a('0x4e')][_0x0e6a('0x4f')]({'where':{'name':_0x1ebaa4,'userProfileId':_0x538d13[_0x0e6a('0x50')]},'raw':!![]})[_0x0e6a('0x25')](function(_0x14da26){if(_0x14da26&&_0x14da26[_0x0e6a('0x58')]===0x0){return db[_0x0e6a('0x51')]['create']({'name':_0x4efa69[_0x0e6a('0x2b')],'resourceId':_0x4efa69['id'],'type':_0x14da26[_0x0e6a('0x2b')],'sectionId':_0x14da26['id']},{})['then'](function(){return _0x488a94;});}else{return _0x488a94;}})[_0x0e6a('0x44')](function(_0x13acd8){logger[_0x0e6a('0x29')](_0x0e6a('0x59'),_0x13acd8);throw _0x13acd8;});}return _0x488a94;});}})[_0x0e6a('0x25')](respondWithResult(_0x4abf7b,0xc9))['catch'](handleError(_0x4abf7b,null));};exports['update']=function(_0x3ed72c,_0x430103){if(_0x3ed72c[_0x0e6a('0x4b')]['id']){delete _0x3ed72c[_0x0e6a('0x4b')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x3ed72c[_0x0e6a('0x46')]['id']}})[_0x0e6a('0x25')](handleEntityNotFound(_0x430103,null))['then'](saveUpdates(_0x3ed72c[_0x0e6a('0x4b')],null))[_0x0e6a('0x25')](respondWithResult(_0x430103,null))[_0x0e6a('0x44')](handleError(_0x430103,null));};exports[_0x0e6a('0x26')]=function(_0x5a77d6,_0x26bc86){return db[_0x0e6a('0x41')][_0x0e6a('0x4f')]({'where':{'id':_0x5a77d6['params']['id']}})['then'](handleEntityNotFound(_0x26bc86,null))['then'](removeEntity(_0x26bc86,null))[_0x0e6a('0x44')](handleError(_0x26bc86,null));};function widgetAttributes(_0x330687){try{switch(_0x330687[_0x0e6a('0x30')]){case _0x0e6a('0x5a'):return[{'name':'attrUrl','value':_0x330687[_0x0e6a('0x5b')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x0]?_0x330687[_0x0e6a('0x5c')][0x0][_0x0e6a('0x5d')]:undefined)||_0x0e6a('0x5e')}];case'custom':return[{'name':_0x0e6a('0x5f'),'value':_0x330687[_0x0e6a('0x5f')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687['attrs'][0x0]?_0x330687[_0x0e6a('0x5c')][0x0][_0x0e6a('0x5d')]:undefined)||''}];case _0x0e6a('0x60'):return[{'name':_0x0e6a('0x61'),'value':_0x330687['attrHourFormat']||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x0]?_0x330687[_0x0e6a('0x5c')][0x0][_0x0e6a('0x5d')]:undefined)||_0x0e6a('0x62')},{'name':_0x0e6a('0x63'),'value':_0x330687[_0x0e6a('0x63')]||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x1]?_0x330687[_0x0e6a('0x5c')][0x1][_0x0e6a('0x5d')]:undefined)||'0.00'},{'name':_0x0e6a('0x64'),'value':_0x330687[_0x0e6a('0x64')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x2]?_0x330687[_0x0e6a('0x5c')][0x2][_0x0e6a('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0x0e6a('0x65'),'value':_0x330687[_0x0e6a('0x65')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687['attrs'][0x0]?_0x330687['attrs'][0x0][_0x0e6a('0x5d')]:undefined)||_0x0e6a('0x66')},{'name':_0x0e6a('0x67'),'value':_0x330687[_0x0e6a('0x67')]||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x1]?_0x330687['attrs'][0x1][_0x0e6a('0x5d')]:undefined)||[]},{'name':_0x0e6a('0x64'),'value':_0x330687['attrFontSize']||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x2]?_0x330687['attrs'][0x2][_0x0e6a('0x5d')]:undefined)||0x14},{'name':_0x0e6a('0x68'),'value':_0x330687[_0x0e6a('0x68')]||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x3]?_0x330687[_0x0e6a('0x5c')][0x3][_0x0e6a('0x5d')]:undefined)||_0x0e6a('0x69')},{'name':_0x0e6a('0x6a'),'value':_0x330687['attrEmailAccounts']||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x4]?_0x330687[_0x0e6a('0x5c')][0x4][_0x0e6a('0x5d')]:undefined)||''},{'name':_0x0e6a('0x6b'),'value':_0x330687[_0x0e6a('0x6b')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x5]?_0x330687[_0x0e6a('0x5c')][0x5][_0x0e6a('0x5d')]:undefined)||''},{'name':_0x0e6a('0x6c'),'value':_0x330687[_0x0e6a('0x6c')]||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x6]?_0x330687[_0x0e6a('0x5c')][0x6][_0x0e6a('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x330687[_0x0e6a('0x6d')]||(_0x330687['attrs']&&_0x330687['attrs'][0x7]?_0x330687[_0x0e6a('0x5c')][0x7][_0x0e6a('0x5d')]:undefined)||''},{'name':_0x0e6a('0x6e'),'value':_0x330687[_0x0e6a('0x6e')]||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x8]?_0x330687[_0x0e6a('0x5c')][0x8][_0x0e6a('0x5d')]:undefined)||''},{'name':_0x0e6a('0x6f'),'value':_0x330687[_0x0e6a('0x6f')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x9]?_0x330687[_0x0e6a('0x5c')][0x9][_0x0e6a('0x5d')]:undefined)||''}];case _0x0e6a('0x70'):case _0x0e6a('0x71'):return[{'name':'attrSerie1','value':_0x330687[_0x0e6a('0x72')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x0]?_0x330687[_0x0e6a('0x5c')][0x0][_0x0e6a('0x5d')]:undefined)||_0x0e6a('0x66')},{'name':_0x0e6a('0x73'),'value':_0x330687[_0x0e6a('0x73')]||(_0x330687['attrs']&&_0x330687[_0x0e6a('0x5c')][0x1]?_0x330687['attrs'][0x1][_0x0e6a('0x5d')]:undefined)||null},{'name':_0x0e6a('0x74'),'value':_0x330687[_0x0e6a('0x74')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687['attrs'][0x2]?_0x330687[_0x0e6a('0x5c')][0x2]['value']:undefined)||null},{'name':_0x0e6a('0x67'),'value':_0x330687['attrVoiceQueues']||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x3]?_0x330687[_0x0e6a('0x5c')][0x3][_0x0e6a('0x5d')]:undefined)||[]},{'name':_0x0e6a('0x68'),'value':_0x330687[_0x0e6a('0x68')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x4]?_0x330687[_0x0e6a('0x5c')][0x4][_0x0e6a('0x5d')]:undefined)||'voice'},{'name':_0x0e6a('0x6a'),'value':_0x330687[_0x0e6a('0x6a')]||(_0x330687['attrs']&&_0x330687['attrs'][0x5]?_0x330687['attrs'][0x5]['value']:undefined)||''},{'name':_0x0e6a('0x6b'),'value':_0x330687[_0x0e6a('0x6b')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x6]?_0x330687[_0x0e6a('0x5c')][0x6][_0x0e6a('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x330687[_0x0e6a('0x6c')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x7]?_0x330687['attrs'][0x7][_0x0e6a('0x5d')]:undefined)||''},{'name':_0x0e6a('0x6d'),'value':_0x330687['attrOpenchannelAccounts']||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x8]?_0x330687[_0x0e6a('0x5c')][0x8][_0x0e6a('0x5d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x330687[_0x0e6a('0x6e')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x9]?_0x330687['attrs'][0x9]['value']:undefined)||''},{'name':_0x0e6a('0x6f'),'value':_0x330687[_0x0e6a('0x6f')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0xa]?_0x330687[_0x0e6a('0x5c')][0xa]['value']:undefined)||''}];case _0x0e6a('0x75'):return[{'name':_0x0e6a('0x76'),'type':_0x330687[_0x0e6a('0x77')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x0]?_0x330687[_0x0e6a('0x5c')][0x0]['type']:undefined)||null,'value':_0x330687[_0x0e6a('0x76')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687[_0x0e6a('0x5c')][0x0]?_0x330687[_0x0e6a('0x5c')][0x0][_0x0e6a('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x330687[_0x0e6a('0x78')]||(_0x330687[_0x0e6a('0x5c')]&&_0x330687['attrs'][0x1]?_0x330687[_0x0e6a('0x5c')][0x1][_0x0e6a('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0xb2fbb){logger[_0x0e6a('0x29')]('widgetAttributes:\x20%s',JSON[_0x0e6a('0x79')](_0xb2fbb));return[];}}exports[_0x0e6a('0x7a')]=function(_0x313ca2,_0x5b0ce4,_0x399e2b){if(_0x313ca2['body']['id']){delete _0x313ca2[_0x0e6a('0x4b')]['id'];}return db[_0x0e6a('0x41')][_0x0e6a('0x4f')]({'where':{'id':_0x313ca2[_0x0e6a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b0ce4,null))[_0x0e6a('0x25')](function(_0x547792){if(_0x547792){_0x313ca2[_0x0e6a('0x4b')][_0x0e6a('0x7b')]=_0x547792['id'];_0x313ca2[_0x0e6a('0x4b')][_0x0e6a('0x5c')]=widgetAttributes(_0x313ca2[_0x0e6a('0x4b')]);return db[_0x0e6a('0x7c')]['create'](_0x313ca2[_0x0e6a('0x4b')]);}})[_0x0e6a('0x25')](respondWithResult(_0x5b0ce4,null))['catch'](handleError(_0x5b0ce4,null));};exports['getItems']=function(_0x99de5f,_0x11a8d8,_0x5cec5b){var _0x47269={};var _0x311e90={};var _0x5b7d7e;var _0x3d2cce;return db[_0x0e6a('0x41')][_0x0e6a('0x7d')]({'where':{'id':_0x99de5f['params']['id']}})['then'](handleEntityNotFound(_0x11a8d8,null))['then'](function(_0x24ea4e){if(_0x24ea4e){_0x5b7d7e=_0x24ea4e;_0x311e90[_0x0e6a('0x35')]=_[_0x0e6a('0x33')](db[_0x0e6a('0x7c')][_0x0e6a('0x47')]);_0x311e90[_0x0e6a('0x32')]=_[_0x0e6a('0x33')](_0x99de5f[_0x0e6a('0x32')]);_0x311e90[_0x0e6a('0x34')]=_[_0x0e6a('0x48')](_0x311e90[_0x0e6a('0x35')],_0x311e90[_0x0e6a('0x32')]);_0x47269['attributes']=_['intersection'](_0x311e90[_0x0e6a('0x35')],qs[_0x0e6a('0x36')](_0x99de5f[_0x0e6a('0x32')][_0x0e6a('0x36')]));_0x47269[_0x0e6a('0x37')]=_0x47269[_0x0e6a('0x37')][_0x0e6a('0x38')]?_0x47269[_0x0e6a('0x37')]:_0x311e90[_0x0e6a('0x35')];_0x47269[_0x0e6a('0x39')]=qs[_0x0e6a('0x3a')](_0x99de5f['query'][_0x0e6a('0x3a')]);_0x47269['where']=qs[_0x0e6a('0x34')](_[_0x0e6a('0x3c')](_0x99de5f[_0x0e6a('0x32')],_0x311e90[_0x0e6a('0x34')]));if(_0x99de5f[_0x0e6a('0x32')][_0x0e6a('0x3d')]){_0x47269[_0x0e6a('0x3b')]=_['merge'](_0x47269[_0x0e6a('0x3b')],{'$or':_[_0x0e6a('0x2e')](_0x47269[_0x0e6a('0x37')],function(_0x42234a){var _0x5ca536={};_0x5ca536[_0x42234a]={'$like':'%'+_0x99de5f[_0x0e6a('0x32')][_0x0e6a('0x3d')]+'%'};return _0x5ca536;})});}_0x47269=_[_0x0e6a('0x53')]({},_0x47269,_0x99de5f[_0x0e6a('0x49')]);return _0x5b7d7e['getItems'](_0x47269);}})['then'](function(_0x2795a6){if(_0x2795a6){_0x3d2cce=_0x2795a6[_0x0e6a('0x38')];if(!_0x99de5f[_0x0e6a('0x32')][_0x0e6a('0x7e')](_0x0e6a('0x7f'))){_0x47269[_0x0e6a('0x20')]=qs[_0x0e6a('0x20')](_0x99de5f['query'][_0x0e6a('0x20')]);_0x47269[_0x0e6a('0x1e')]=qs[_0x0e6a('0x1e')](_0x99de5f[_0x0e6a('0x32')][_0x0e6a('0x1e')]);}return _0x5b7d7e['getItems'](_0x47269);}})['then'](function(_0x5cbad1){if(_0x5cbad1){return _0x5cbad1?{'count':_0x3d2cce,'rows':_0x5cbad1}:null;}})[_0x0e6a('0x25')](respondWithResult(_0x11a8d8,null))[_0x0e6a('0x44')](handleError(_0x11a8d8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index d75ca83..dee3f54 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 _0xb96d=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','Dashboard'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xb96d,0x9e));var _0xdb96=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xb96d[_0x2ddfd9];return _0x2668f0;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xdb96('0x0'))['db'][_0xdb96('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xdb96('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdb96('0x3'),'afterDestroy':_0xdb96('0x4')};function emitEvent(_0x22be94){return function(_0x488b02,_0x4af3cf,_0x291c6a){DashboardEvents[_0xdb96('0x5')](_0x22be94+':'+_0x488b02['id'],_0x488b02);DashboardEvents[_0xdb96('0x5')](_0x22be94,_0x488b02);_0x291c6a(null);};}for(var e in events){if(events[_0xdb96('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xdb96('0x7')]=DashboardEvents; \ No newline at end of file +var _0xd4e8=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard'];(function(_0x151436,_0x469bcf){var _0x117e9d=function(_0x5b9890){while(--_0x5b9890){_0x151436['push'](_0x151436['shift']());}};_0x117e9d(++_0x469bcf);}(_0xd4e8,0xe7));var _0x8d4e=function(_0x10de99,_0xdd42d){_0x10de99=_0x10de99-0x0;var _0x8550e5=_0xd4e8[_0x10de99];return _0x8550e5;};'use strict';var EventEmitter=require(_0x8d4e('0x0'));var Dashboard=require(_0x8d4e('0x1'))['db'][_0x8d4e('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8d4e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8d4e('0x4'),'afterDestroy':_0x8d4e('0x5')};function emitEvent(_0x5ca730){return function(_0x2f42a7,_0x371f4c,_0x22d139){DashboardEvents[_0x8d4e('0x6')](_0x5ca730+':'+_0x2f42a7['id'],_0x2f42a7);DashboardEvents['emit'](_0x5ca730,_0x2f42a7);_0x22d139(null);};}for(var e in events){if(events[_0x8d4e('0x7')](e)){var event=events[e];Dashboard[_0x8d4e('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index c00697a..47d5fad 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 _0xbbdd=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','Dashboard','dashboards'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbbdd,0x120));var _0xdbbd=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xbbdd[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xdbbd('0x0'));var util=require(_0xdbbd('0x1'));var logger=require(_0xdbbd('0x2'))('api');var moment=require(_0xdbbd('0x3'));var BPromise=require(_0xdbbd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbbd('0x5'));var rimraf=require(_0xdbbd('0x6'));var config=require(_0xdbbd('0x7'));var attributes=require('./dashboard.attributes');module[_0xdbbd('0x8')]=function(_0x1b1f26,_0x4c8540){return _0x1b1f26[_0xdbbd('0x9')](_0xdbbd('0xa'),attributes,{'tableName':_0xdbbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4b1=['request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x42d67f,_0x5ec7ab){var _0x4e1773=function(_0x1d1aa7){while(--_0x1d1aa7){_0x42d67f['push'](_0x42d67f['shift']());}};_0x4e1773(++_0x5ec7ab);}(_0xa4b1,0x133));var _0x1a4b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa4b1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1a4b('0x0'));var util=require(_0x1a4b('0x1'));var logger=require(_0x1a4b('0x2'))(_0x1a4b('0x3'));var moment=require(_0x1a4b('0x4'));var BPromise=require('bluebird');var rp=require(_0x1a4b('0x5'));var fs=require('fs');var path=require(_0x1a4b('0x6'));var rimraf=require('rimraf');var config=require(_0x1a4b('0x7'));var attributes=require(_0x1a4b('0x8'));module[_0x1a4b('0x9')]=function(_0x2861ef,_0x569494){return _0x2861ef[_0x1a4b('0xa')](_0x1a4b('0xb'),attributes,{'tableName':_0x1a4b('0xc'),'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 5bf54cd..50ed44c 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 _0x3102=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x3102,0x119));var _0x2310=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x3102[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0x2310('0x0'));var moment=require(_0x2310('0x1'));var BPromise=require(_0x2310('0x2'));var rs=require(_0x2310('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2310('0x4'))['db'];var utils=require(_0x2310('0x5'));var logger=require(_0x2310('0x6'))(_0x2310('0x7'));var config=require(_0x2310('0x8'));var jayson=require(_0x2310('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2310('0xa')]=_[_0x2310('0xb')](config['redis'],{'host':_0x2310('0xc'),'port':0x18eb});var socket=require(_0x2310('0xd'))(new Redis(config[_0x2310('0xa')]));require(_0x2310('0xe'))['register'](socket);function respondWithRpcPromise(_0x3510c8,_0x15514e,_0x55ccfa){return new BPromise(function(_0x3bf547,_0x283c19){return client[_0x2310('0xf')](_0x3510c8,_0x55ccfa)[_0x2310('0x10')](function(_0x3e9d0c){logger[_0x2310('0x11')](_0x2310('0x12'),_0x15514e,_0x2310('0x13'));logger[_0x2310('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x15514e,'request\x20sent',JSON[_0x2310('0x15')](_0x3e9d0c));if(_0x3e9d0c['error']){if(_0x3e9d0c[_0x2310('0x16')]['code']===0x1f4){logger['error'](_0x2310('0x12'),_0x15514e,_0x3e9d0c[_0x2310('0x16')][_0x2310('0x17')]);return _0x283c19(_0x3e9d0c[_0x2310('0x16')][_0x2310('0x17')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x15514e,_0x3e9d0c['error']['message']);return _0x3bf547(_0x3e9d0c['error'][_0x2310('0x17')]);}else{logger['info'](_0x2310('0x12'),_0x15514e,_0x2310('0x13'));_0x3bf547(_0x3e9d0c[_0x2310('0x18')][_0x2310('0x17')]);}})[_0x2310('0x19')](function(_0x495b77){logger[_0x2310('0x16')]('Dashboard,\x20%s,\x20%s',_0x15514e,_0x495b77);_0x283c19(_0x495b77);});});} \ No newline at end of file +var _0x924b=['code','Dashboard,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0x924b,0x76));var _0xb924=function(_0x497948,_0x4ca60c){_0x497948=_0x497948-0x0;var _0x39bb36=_0x924b[_0x497948];return _0x39bb36;};'use strict';var _=require(_0xb924('0x0'));var util=require('util');var moment=require(_0xb924('0x1'));var BPromise=require(_0xb924('0x2'));var rs=require(_0xb924('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb924('0x4'));var logger=require(_0xb924('0x5'))(_0xb924('0x6'));var config=require(_0xb924('0x7'));var jayson=require(_0xb924('0x8'));var client=jayson[_0xb924('0x9')][_0xb924('0xa')]({'port':0x232a});config[_0xb924('0xb')]=_[_0xb924('0xc')](config[_0xb924('0xb')],{'host':_0xb924('0xd'),'port':0x18eb});var socket=require(_0xb924('0xe'))(new Redis(config[_0xb924('0xb')]));require(_0xb924('0xf'))[_0xb924('0x10')](socket);function respondWithRpcPromise(_0x39bcc8,_0x5df619,_0x200dfd){return new BPromise(function(_0x9d7f1e,_0x46cf22){return client['request'](_0x39bcc8,_0x200dfd)[_0xb924('0x11')](function(_0x51fb48){logger['info']('Dashboard,\x20%s,\x20%s',_0x5df619,_0xb924('0x12'));logger[_0xb924('0x13')](_0xb924('0x14'),_0x5df619,_0xb924('0x12'),JSON['stringify'](_0x51fb48));if(_0x51fb48[_0xb924('0x15')]){if(_0x51fb48[_0xb924('0x15')][_0xb924('0x16')]===0x1f4){logger[_0xb924('0x15')](_0xb924('0x17'),_0x5df619,_0x51fb48['error'][_0xb924('0x18')]);return _0x46cf22(_0x51fb48[_0xb924('0x15')][_0xb924('0x18')]);}logger[_0xb924('0x15')]('Dashboard,\x20%s,\x20%s',_0x5df619,_0x51fb48[_0xb924('0x15')][_0xb924('0x18')]);return _0x9d7f1e(_0x51fb48['error'][_0xb924('0x18')]);}else{logger[_0xb924('0x19')](_0xb924('0x17'),_0x5df619,_0xb924('0x12'));_0x9d7f1e(_0x51fb48[_0xb924('0x1a')][_0xb924('0x18')]);}})[_0xb924('0x1b')](function(_0x58709f){logger[_0xb924('0x15')](_0xb924('0x17'),_0x5df619,_0x58709f);_0x46cf22(_0x58709f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 8b83886..97f0845 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 _0x7469=['removeListener','length','dashboard:','save','remove'];(function(_0x25fcd6,_0x4735e0){var _0x366629=function(_0x449059){while(--_0x449059){_0x25fcd6['push'](_0x25fcd6['shift']());}};_0x366629(++_0x4735e0);}(_0x7469,0x1ac));var _0x9746=function(_0x382556,_0x3b79cf){_0x382556=_0x382556-0x0;var _0x4b6eb8=_0x7469[_0x382556];return _0x4b6eb8;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x9746('0x0'),_0x9746('0x1'),'update'];function createListener(_0x4e9672,_0x553fcb){return function(_0x25cbc4){_0x553fcb['emit'](_0x4e9672,_0x25cbc4);};}function removeListener(_0x2a7b60,_0x32e949){return function(){DashboardEvents[_0x9746('0x2')](_0x2a7b60,_0x32e949);};}exports['register']=function(_0x4bf1e7){for(var _0x2985eb=0x0,_0x5a6d72=events[_0x9746('0x3')];_0x2985eb<_0x5a6d72;_0x2985eb++){var _0x33e08c=events[_0x2985eb];var _0x1c1594=createListener(_0x9746('0x4')+_0x33e08c,_0x4bf1e7);DashboardEvents['on'](_0x33e08c,_0x1c1594);}}; \ No newline at end of file +var _0xe443=['save','remove','update','removeListener','length','dashboard:'];(function(_0x3741ac,_0x46bf07){var _0x2b22c5=function(_0x591f8d){while(--_0x591f8d){_0x3741ac['push'](_0x3741ac['shift']());}};_0x2b22c5(++_0x46bf07);}(_0xe443,0x162));var _0x3e44=function(_0x3fee0b,_0x141c74){_0x3fee0b=_0x3fee0b-0x0;var _0x1d1e29=_0xe443[_0x3fee0b];return _0x1d1e29;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x3e44('0x0'),_0x3e44('0x1'),_0x3e44('0x2')];function createListener(_0x46aac9,_0x2f9273){return function(_0x1e8b39){_0x2f9273['emit'](_0x46aac9,_0x1e8b39);};}function removeListener(_0xa32fb2,_0x546daf){return function(){DashboardEvents[_0x3e44('0x3')](_0xa32fb2,_0x546daf);};}exports['register']=function(_0x3d560e){for(var _0x14b6ce=0x0,_0x184e16=events[_0x3e44('0x4')];_0x14b6ce<_0x184e16;_0x14b6ce++){var _0x53eb7d=events[_0x14b6ce];var _0x860104=createListener(_0x3e44('0x5')+_0x53eb7d,_0x3d560e);DashboardEvents['on'](_0x53eb7d,_0x860104);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1644d89..ccfc7df 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 _0x3dbc=['getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items'];(function(_0x53284b,_0x11028b){var _0x39dc7d=function(_0x2d117b){while(--_0x2d117b){_0x53284b['push'](_0x53284b['shift']());}};_0x39dc7d(++_0x11028b);}(_0x3dbc,0xd2));var _0xc3db=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x3dbc[_0x3b2369];return _0x5a1367;};'use strict';var multer=require(_0xc3db('0x0'));var util=require(_0xc3db('0x1'));var path=require(_0xc3db('0x2'));var timeout=require(_0xc3db('0x3'));var express=require('express');var router=express[_0xc3db('0x4')]();var fs_extra=require(_0xc3db('0x5'));var auth=require(_0xc3db('0x6'));var interaction=require(_0xc3db('0x7'));var config=require(_0xc3db('0x8'));var controller=require(_0xc3db('0x9'));router[_0xc3db('0xa')]('/',auth[_0xc3db('0xb')](),controller['index']);router[_0xc3db('0xa')](_0xc3db('0xc'),auth[_0xc3db('0xb')](),controller[_0xc3db('0xd')]);router[_0xc3db('0xa')](_0xc3db('0xe'),auth[_0xc3db('0xb')](),controller[_0xc3db('0xf')]);router[_0xc3db('0x10')]('/',auth[_0xc3db('0xb')](),controller[_0xc3db('0x11')]);router[_0xc3db('0x10')](_0xc3db('0x12'),auth['isAuthenticated'](),controller['clone']);router[_0xc3db('0x10')](_0xc3db('0xe'),auth[_0xc3db('0xb')](),controller[_0xc3db('0x13')]);router[_0xc3db('0x14')](_0xc3db('0xc'),auth[_0xc3db('0xb')](),controller[_0xc3db('0x15')]);router[_0xc3db('0x16')](_0xc3db('0xc'),auth[_0xc3db('0xb')](),controller[_0xc3db('0x17')]);module[_0xc3db('0x18')]=router; \ No newline at end of file +var _0x687f=['clone','addItem','update','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getItems','post'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x687f,0xa7));var _0xf687=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x687f[_0x3337b6];return _0x568270;};'use strict';var multer=require(_0xf687('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf687('0x1'));var router=express[_0xf687('0x2')]();var fs_extra=require(_0xf687('0x3'));var auth=require(_0xf687('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf687('0x5'));var controller=require('./dashboard.controller');router[_0xf687('0x6')]('/',auth[_0xf687('0x7')](),controller[_0xf687('0x8')]);router[_0xf687('0x6')](_0xf687('0x9'),auth[_0xf687('0x7')](),controller[_0xf687('0xa')]);router[_0xf687('0x6')]('/:id/items',auth[_0xf687('0x7')](),controller[_0xf687('0xb')]);router['post']('/',auth[_0xf687('0x7')](),controller['create']);router[_0xf687('0xc')]('/:id/clone',auth[_0xf687('0x7')](),controller[_0xf687('0xd')]);router[_0xf687('0xc')]('/:id/items',auth['isAuthenticated'](),controller[_0xf687('0xe')]);router['put'](_0xf687('0x9'),auth[_0xf687('0x7')](),controller[_0xf687('0xf')]);router[_0xf687('0x10')](_0xf687('0x9'),auth[_0xf687('0x7')](),controller[_0xf687('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index ea13051..88aa9bc 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 _0xacf4=['lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xacf4,0xe7));var _0x4acf=function(_0x210e5e,_0x74bded){_0x210e5e=_0x210e5e-0x0;var _0x16375f=_0xacf4[_0x210e5e];return _0x16375f;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4acf('0x0'));module[_0x4acf('0x1')]={'title':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4acf('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4acf('0x3')](_0x4acf('0x4')),'get':function(){try{return JSON[_0x4acf('0x5')](this['getDataValue'](_0x4acf('0x6')));}catch(_0x2124c8){return[];}},'set':function(_0x4e0c43){try{this[_0x4acf('0x7')](_0x4acf('0x6'),JSON[_0x4acf('0x8')](_0x4e0c43));}catch(_0x45a5a4){this[_0x4acf('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4acf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4acf('0x9')]},'col':{'type':Sequelize[_0x4acf('0x9')]},'background':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':_0x4acf('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x6f47=['#ffffff','squel','lodash','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x3f2b8f,_0x28a198){var _0x367e4a=function(_0x5b4d8e){while(--_0x5b4d8e){_0x3f2b8f['push'](_0x3f2b8f['shift']());}};_0x367e4a(++_0x28a198);}(_0x6f47,0xc7));var _0x76f4=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x6f47[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));module['exports']={'title':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x76f4('0x3')]('long'),'get':function(){try{return JSON[_0x76f4('0x4')](this[_0x76f4('0x5')](_0x76f4('0x6')));}catch(_0x2523ba){return[];}},'set':function(_0x5754ca){try{this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')](_0x5754ca));}catch(_0x497f99){this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![],'defaultValue':_0x76f4('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x76f4('0x2')]},'titleFontSize':{'type':Sequelize[_0x76f4('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index bf6fbea..e7dda7b 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 _0xd69e=['defaults','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','find','catch','type','iframe','attrUrl','attrs','https://','attrPath','clock','attrHourFormat','value','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','DashboardItem','create','eml-format','rimraf','zip-dir','request-promise','moment','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis'];(function(_0x118355,_0x201311){var _0x32f7ea=function(_0x4fd55b){while(--_0x4fd55b){_0x118355['push'](_0x118355['shift']());}};_0x32f7ea(++_0x201311);}(_0xd69e,0xa0));var _0xed69=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd69e[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed69('0x3'));var moment=require(_0xed69('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed69('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed69('0x6'));var _=require(_0xed69('0x7'));var squel=require(_0xed69('0x8'));var crypto=require(_0xed69('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xed69('0xa'));var toCsv=require('to-csv');var querystring=require(_0xed69('0xb'));var Papa=require(_0xed69('0xc'));var Redis=require('ioredis');var authService=require(_0xed69('0xd'));var qs=require(_0xed69('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed69('0xf'));var logger=require('../../config/logger')(_0xed69('0x10'));var utils=require(_0xed69('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xed69('0x12'));var db=require('../../mysqldb')['db'];config[_0xed69('0x13')]=_[_0xed69('0x14')](config[_0xed69('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed69('0x13')]));require(_0xed69('0x15'))[_0xed69('0x16')](socket);function respondWithStatusCode(_0x476524,_0x12cfd5){_0x12cfd5=_0x12cfd5||0xcc;return function(_0x5a9ffd){if(_0x5a9ffd){return _0x476524[_0xed69('0x17')](_0x12cfd5);}return _0x476524[_0xed69('0x18')](_0x12cfd5)[_0xed69('0x19')]();};}function respondWithResult(_0x118ab3,_0x35d924){_0x35d924=_0x35d924||0xc8;return function(_0x2990fa){if(_0x2990fa){return _0x118ab3[_0xed69('0x18')](_0x35d924)[_0xed69('0x1a')](_0x2990fa);}};}function respondWithFilteredResult(_0x1e7446,_0xa510c1){return function(_0x4df35e){if(_0x4df35e){var _0x4843bf=typeof _0xa510c1['offset']===_0xed69('0x1b')&&typeof _0xa510c1[_0xed69('0x1c')]===_0xed69('0x1b');var _0x576a71=_0x4df35e[_0xed69('0x1d')];var _0x11c1fc=_0x4843bf?0x0:_0xa510c1['offset'];var _0x3ed869=_0x4843bf?_0x4df35e[_0xed69('0x1d')]:_0xa510c1[_0xed69('0x1e')]+_0xa510c1[_0xed69('0x1c')];var _0x4ef2fe;if(_0x3ed869>=_0x576a71){_0x3ed869=_0x576a71;_0x4ef2fe=0xc8;}else{_0x4ef2fe=0xce;}_0x1e7446[_0xed69('0x18')](_0x4ef2fe);return _0x1e7446[_0xed69('0x1f')]('Content-Range',_0x11c1fc+'-'+_0x3ed869+'/'+_0x576a71)[_0xed69('0x1a')](_0x4df35e);}return null;};}function patchUpdates(_0x350f01){return function(_0x257550){try{jsonpatch[_0xed69('0x20')](_0x257550,_0x350f01,!![]);}catch(_0xa3486a){return BPromise[_0xed69('0x21')](_0xa3486a);}return _0x257550['save']();};}function saveUpdates(_0x35e7ec,_0x91b170){return function(_0x115558){if(_0x115558){return _0x115558[_0xed69('0x22')](_0x35e7ec)[_0xed69('0x23')](function(_0xd182bd){return _0xd182bd;});}return null;};}function removeEntity(_0x33f01f,_0x1e34c8){return function(_0x2156ad){if(_0x2156ad){return _0x2156ad[_0xed69('0x24')]()[_0xed69('0x23')](function(){_0x33f01f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x383a83,_0x228091){return function(_0x2c77d4){if(!_0x2c77d4){_0x383a83[_0xed69('0x17')](0x194);}return _0x2c77d4;};}function handleError(_0xbb7904,_0x21be83){_0x21be83=_0x21be83||0x1f4;return function(_0x5b6ee3){logger[_0xed69('0x25')](_0x5b6ee3[_0xed69('0x26')]);if(_0x5b6ee3[_0xed69('0x27')]){delete _0x5b6ee3['name'];}_0xbb7904['status'](_0x21be83)[_0xed69('0x28')](_0x5b6ee3);};}exports['show']=function(_0x379706,_0x234c8a){var _0x164316={'raw':![],'where':{'id':_0x379706[_0xed69('0x29')]['id']}},_0x1f4e54={};_0x1f4e54[_0xed69('0x2a')]=_[_0xed69('0x2b')](db['DashboardItem'][_0xed69('0x2c')]);_0x1f4e54[_0xed69('0x2d')]=_[_0xed69('0x2b')](_0x379706[_0xed69('0x2d')]);_0x1f4e54[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x1f4e54[_0xed69('0x2a')],_0x1f4e54['query']);_0x164316['attributes']=_[_0xed69('0x2f')](_0x1f4e54[_0xed69('0x2a')],qs[_0xed69('0x30')](_0x379706[_0xed69('0x2d')][_0xed69('0x30')]));_0x164316[_0xed69('0x31')]=_0x164316['attributes'][_0xed69('0x32')]?_0x164316[_0xed69('0x31')]:_0x1f4e54[_0xed69('0x2a')];if(_0x379706[_0xed69('0x2d')][_0xed69('0x33')]){_0x164316[_0xed69('0x34')]=[{'all':!![]}];}_0x164316=_['merge']({},_0x164316,_0x379706['options']);return db['DashboardItem'][_0xed69('0x35')](_0x164316)[_0xed69('0x23')](handleEntityNotFound(_0x234c8a,null))[_0xed69('0x23')](respondWithResult(_0x234c8a,null))[_0xed69('0x36')](handleError(_0x234c8a,null));};exports['destroy']=function(_0x347311,_0x338be3){return db['DashboardItem'][_0xed69('0x35')]({'where':{'id':_0x347311[_0xed69('0x29')]['id']}})[_0xed69('0x23')](handleEntityNotFound(_0x338be3,null))[_0xed69('0x23')](removeEntity(_0x338be3,null))['catch'](handleError(_0x338be3,null));};function widgetAttributes(_0x13f04c){try{switch(_0x13f04c[_0xed69('0x37')]){case _0xed69('0x38'):return[{'name':_0xed69('0x39'),'value':_0x13f04c[_0xed69('0x39')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||_0xed69('0x3b')}];case'custom':return[{'name':_0xed69('0x3c'),'value':_0x13f04c[_0xed69('0x3c')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||''}];case _0xed69('0x3d'):return[{'name':_0xed69('0x3e'),'value':_0x13f04c[_0xed69('0x3e')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0][_0xed69('0x3f')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x13f04c[_0xed69('0x40')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x1]?_0x13f04c[_0xed69('0x3a')][0x1]['value']:undefined)||_0xed69('0x41')},{'name':_0xed69('0x42'),'value':_0x13f04c[_0xed69('0x42')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x2]?_0x13f04c[_0xed69('0x3a')][0x2][_0xed69('0x3f')]:undefined)||0xc}];case _0xed69('0x43'):return[{'name':'attrMetric','value':_0x13f04c['attrMetric']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||_0xed69('0x44')},{'name':_0xed69('0x45'),'value':_0x13f04c[_0xed69('0x45')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x1]?_0x13f04c[_0xed69('0x3a')][0x1][_0xed69('0x3f')]:undefined)||[]},{'name':_0xed69('0x42'),'value':_0x13f04c['attrFontSize']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x2]?_0x13f04c[_0xed69('0x3a')][0x2]['value']:undefined)||0x14},{'name':_0xed69('0x46'),'value':_0x13f04c[_0xed69('0x46')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x3]?_0x13f04c['attrs'][0x3][_0xed69('0x3f')]:undefined)||'voice'},{'name':_0xed69('0x47'),'value':_0x13f04c[_0xed69('0x47')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x4]?_0x13f04c[_0xed69('0x3a')][0x4][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x48'),'value':_0x13f04c[_0xed69('0x48')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x5]?_0x13f04c[_0xed69('0x3a')][0x5][_0xed69('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x13f04c[_0xed69('0x49')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x6]?_0x13f04c[_0xed69('0x3a')][0x6][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4a'),'value':_0x13f04c[_0xed69('0x4a')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x7]?_0x13f04c[_0xed69('0x3a')][0x7]['value']:undefined)||''},{'name':_0xed69('0x4b'),'value':_0x13f04c[_0xed69('0x4b')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x8]?_0x13f04c['attrs'][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x13f04c[_0xed69('0x4c')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x9]?_0x13f04c[_0xed69('0x3a')][0x9]['value']:undefined)||''}];case _0xed69('0x4d'):case'pie-chart':return[{'name':'attrSerie1','value':_0x13f04c[_0xed69('0x4e')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0]['value']:undefined)||'total'},{'name':_0xed69('0x4f'),'value':_0x13f04c['attrSerie2']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x1]?_0x13f04c[_0xed69('0x3a')][0x1]['value']:undefined)||null},{'name':_0xed69('0x50'),'value':_0x13f04c[_0xed69('0x50')]||(_0x13f04c['attrs']&&_0x13f04c[_0xed69('0x3a')][0x2]?_0x13f04c[_0xed69('0x3a')][0x2][_0xed69('0x3f')]:undefined)||null},{'name':_0xed69('0x45'),'value':_0x13f04c['attrVoiceQueues']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x3]?_0x13f04c['attrs'][0x3][_0xed69('0x3f')]:undefined)||[]},{'name':_0xed69('0x46'),'value':_0x13f04c[_0xed69('0x46')]||(_0x13f04c['attrs']&&_0x13f04c['attrs'][0x4]?_0x13f04c[_0xed69('0x3a')][0x4][_0xed69('0x3f')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x13f04c[_0xed69('0x47')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x5]?_0x13f04c[_0xed69('0x3a')][0x5][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x48'),'value':_0x13f04c[_0xed69('0x48')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x6]?_0x13f04c['attrs'][0x6][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x49'),'value':_0x13f04c[_0xed69('0x49')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c['attrs'][0x7]?_0x13f04c[_0xed69('0x3a')][0x7][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4a'),'value':_0x13f04c[_0xed69('0x4a')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x8]?_0x13f04c['attrs'][0x8][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4b'),'value':_0x13f04c['attrWhatsappAccounts']||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x9]?_0x13f04c[_0xed69('0x3a')][0x9][_0xed69('0x3f')]:undefined)||''},{'name':_0xed69('0x4c'),'value':_0x13f04c[_0xed69('0x4c')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0xa]?_0x13f04c[_0xed69('0x3a')][0xa][_0xed69('0x3f')]:undefined)||''}];case _0xed69('0x51'):return[{'name':_0xed69('0x52'),'type':_0x13f04c[_0xed69('0x53')]||(_0x13f04c[_0xed69('0x3a')]&&_0x13f04c[_0xed69('0x3a')][0x0]?_0x13f04c[_0xed69('0x3a')][0x0][_0xed69('0x37')]:undefined)||null,'value':_0x13f04c[_0xed69('0x52')]||(_0x13f04c['attrs']&&_0x13f04c['attrs'][0x0]?_0x13f04c[_0xed69('0x3a')][0x0][_0xed69('0x3f')]:undefined)||null},{'name':_0xed69('0x54'),'value':_0x13f04c[_0xed69('0x54')]||(_0x13f04c['attrs']&&_0x13f04c['attrs'][0x1]?_0x13f04c[_0xed69('0x3a')][0x1][_0xed69('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x3fb6b5){logger[_0xed69('0x25')](_0xed69('0x55'),JSON[_0xed69('0x56')](_0x3fb6b5));return[];}}exports['create']=function(_0x39d520,_0x271a43){if(_0x39d520[_0xed69('0x57')]){_0x39d520[_0xed69('0x57')][_0xed69('0x3a')]=widgetAttributes(_0x39d520[_0xed69('0x57')]);}return db[_0xed69('0x58')][_0xed69('0x59')](_0x39d520[_0xed69('0x57')],{})[_0xed69('0x23')](respondWithResult(_0x271a43,0xc9))['catch'](handleError(_0x271a43,null));};exports['update']=function(_0x47f006,_0x5bed4b){if(_0x47f006[_0xed69('0x57')]['id']){delete _0x47f006['body']['id'];}_0x47f006[_0xed69('0x57')][_0xed69('0x3a')]=widgetAttributes(_0x47f006[_0xed69('0x57')]);return db[_0xed69('0x58')][_0xed69('0x35')]({'where':{'id':_0x47f006[_0xed69('0x29')]['id']}})[_0xed69('0x23')](handleEntityNotFound(_0x5bed4b,null))['then'](saveUpdates(_0x47f006[_0xed69('0x57')],null))[_0xed69('0x23')](respondWithResult(_0x5bed4b,null))['catch'](handleError(_0x5bed4b,null));}; \ No newline at end of file +var _0xcaf2=['type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','DashboardItem','find','catch','params'];(function(_0x2f0510,_0x193e90){var _0x2ef5b8=function(_0x4f2892){while(--_0x4f2892){_0x2f0510['push'](_0x2f0510['shift']());}};_0x2ef5b8(++_0x193e90);}(_0xcaf2,0x8a));var _0x2caf=function(_0x5a69ab,_0x610049){_0x5a69ab=_0x5a69ab-0x0;var _0x27f2f7=_0xcaf2[_0x5a69ab];return _0x27f2f7;};'use strict';var emlformat=require(_0x2caf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2caf('0x1'));var jsonpatch=require(_0x2caf('0x2'));var rp=require('request-promise');var moment=require(_0x2caf('0x3'));var BPromise=require(_0x2caf('0x4'));var Mustache=require('mustache');var util=require(_0x2caf('0x5'));var path=require('path');var sox=require(_0x2caf('0x6'));var csv=require(_0x2caf('0x7'));var ejs=require(_0x2caf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2caf('0x9'));var squel=require(_0x2caf('0xa'));var crypto=require(_0x2caf('0xb'));var jsforce=require(_0x2caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2caf('0x7'));var querystring=require(_0x2caf('0xd'));var Papa=require(_0x2caf('0xe'));var Redis=require(_0x2caf('0xf'));var authService=require(_0x2caf('0x10'));var qs=require(_0x2caf('0x11'));var as=require(_0x2caf('0x12'));var hardwareService=require(_0x2caf('0x13'));var logger=require(_0x2caf('0x14'))('api');var utils=require(_0x2caf('0x15'));var config=require(_0x2caf('0x16'));var licenseUtil=require(_0x2caf('0x17'));var db=require(_0x2caf('0x18'))['db'];config[_0x2caf('0x19')]=_[_0x2caf('0x1a')](config[_0x2caf('0x19')],{'host':_0x2caf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2caf('0x19')]));require(_0x2caf('0x1c'))['register'](socket);function respondWithStatusCode(_0x4c47b8,_0x5f1e93){_0x5f1e93=_0x5f1e93||0xcc;return function(_0x27bca8){if(_0x27bca8){return _0x4c47b8['sendStatus'](_0x5f1e93);}return _0x4c47b8[_0x2caf('0x1d')](_0x5f1e93)[_0x2caf('0x1e')]();};}function respondWithResult(_0x3b8b67,_0x32ff41){_0x32ff41=_0x32ff41||0xc8;return function(_0x486b8d){if(_0x486b8d){return _0x3b8b67[_0x2caf('0x1d')](_0x32ff41)['json'](_0x486b8d);}};}function respondWithFilteredResult(_0x2d5b64,_0x57f3cd){return function(_0x4a33fc){if(_0x4a33fc){var _0x3e975f=typeof _0x57f3cd['offset']===_0x2caf('0x1f')&&typeof _0x57f3cd[_0x2caf('0x20')]==='undefined';var _0x12624b=_0x4a33fc[_0x2caf('0x21')];var _0x6b3778=_0x3e975f?0x0:_0x57f3cd[_0x2caf('0x22')];var _0x20f7d3=_0x3e975f?_0x4a33fc['count']:_0x57f3cd[_0x2caf('0x22')]+_0x57f3cd[_0x2caf('0x20')];var _0x2b4d16;if(_0x20f7d3>=_0x12624b){_0x20f7d3=_0x12624b;_0x2b4d16=0xc8;}else{_0x2b4d16=0xce;}_0x2d5b64[_0x2caf('0x1d')](_0x2b4d16);return _0x2d5b64[_0x2caf('0x23')](_0x2caf('0x24'),_0x6b3778+'-'+_0x20f7d3+'/'+_0x12624b)[_0x2caf('0x25')](_0x4a33fc);}return null;};}function patchUpdates(_0x256cc4){return function(_0x3332b1){try{jsonpatch[_0x2caf('0x26')](_0x3332b1,_0x256cc4,!![]);}catch(_0x6814bc){return BPromise['reject'](_0x6814bc);}return _0x3332b1[_0x2caf('0x27')]();};}function saveUpdates(_0x14bfd2,_0x1f29b0){return function(_0x401ea2){if(_0x401ea2){return _0x401ea2[_0x2caf('0x28')](_0x14bfd2)[_0x2caf('0x29')](function(_0x392196){return _0x392196;});}return null;};}function removeEntity(_0x164da,_0x2e0a75){return function(_0x31f059){if(_0x31f059){return _0x31f059['destroy']()[_0x2caf('0x29')](function(){_0x164da[_0x2caf('0x1d')](0xcc)[_0x2caf('0x1e')]();});}};}function handleEntityNotFound(_0x37b08f,_0x3c60d1){return function(_0x17d3c6){if(!_0x17d3c6){_0x37b08f[_0x2caf('0x2a')](0x194);}return _0x17d3c6;};}function handleError(_0x135977,_0x23f765){_0x23f765=_0x23f765||0x1f4;return function(_0x2304f1){logger[_0x2caf('0x2b')](_0x2304f1[_0x2caf('0x2c')]);if(_0x2304f1[_0x2caf('0x2d')]){delete _0x2304f1['name'];}_0x135977[_0x2caf('0x1d')](_0x23f765)[_0x2caf('0x2e')](_0x2304f1);};}exports[_0x2caf('0x2f')]=function(_0x25bbfc,_0xa8523b){var _0x1f52bf={'raw':![],'where':{'id':_0x25bbfc['params']['id']}},_0x3812cd={};_0x3812cd[_0x2caf('0x30')]=_[_0x2caf('0x31')](db['DashboardItem'][_0x2caf('0x32')]);_0x3812cd[_0x2caf('0x33')]=_[_0x2caf('0x31')](_0x25bbfc['query']);_0x3812cd[_0x2caf('0x34')]=_['intersection'](_0x3812cd['model'],_0x3812cd[_0x2caf('0x33')]);_0x1f52bf[_0x2caf('0x35')]=_[_0x2caf('0x36')](_0x3812cd[_0x2caf('0x30')],qs[_0x2caf('0x37')](_0x25bbfc[_0x2caf('0x33')][_0x2caf('0x37')]));_0x1f52bf[_0x2caf('0x35')]=_0x1f52bf[_0x2caf('0x35')]['length']?_0x1f52bf[_0x2caf('0x35')]:_0x3812cd[_0x2caf('0x30')];if(_0x25bbfc[_0x2caf('0x33')][_0x2caf('0x38')]){_0x1f52bf[_0x2caf('0x39')]=[{'all':!![]}];}_0x1f52bf=_[_0x2caf('0x3a')]({},_0x1f52bf,_0x25bbfc[_0x2caf('0x3b')]);return db[_0x2caf('0x3c')][_0x2caf('0x3d')](_0x1f52bf)[_0x2caf('0x29')](handleEntityNotFound(_0xa8523b,null))[_0x2caf('0x29')](respondWithResult(_0xa8523b,null))[_0x2caf('0x3e')](handleError(_0xa8523b,null));};exports['destroy']=function(_0x5b3a78,_0x410020){return db[_0x2caf('0x3c')][_0x2caf('0x3d')]({'where':{'id':_0x5b3a78[_0x2caf('0x3f')]['id']}})['then'](handleEntityNotFound(_0x410020,null))[_0x2caf('0x29')](removeEntity(_0x410020,null))[_0x2caf('0x3e')](handleError(_0x410020,null));};function widgetAttributes(_0x4568f9){try{switch(_0x4568f9[_0x2caf('0x40')]){case _0x2caf('0x41'):return[{'name':_0x2caf('0x42'),'value':_0x4568f9[_0x2caf('0x42')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x0]?_0x4568f9['attrs'][0x0][_0x2caf('0x44')]:undefined)||_0x2caf('0x45')}];case _0x2caf('0x46'):return[{'name':_0x2caf('0x47'),'value':_0x4568f9[_0x2caf('0x47')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x0]?_0x4568f9[_0x2caf('0x43')][0x0][_0x2caf('0x44')]:undefined)||''}];case _0x2caf('0x48'):return[{'name':_0x2caf('0x49'),'value':_0x4568f9['attrHourFormat']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x0]?_0x4568f9[_0x2caf('0x43')][0x0]['value']:undefined)||_0x2caf('0x4a')},{'name':_0x2caf('0x4b'),'value':_0x4568f9[_0x2caf('0x4b')]||(_0x4568f9['attrs']&&_0x4568f9[_0x2caf('0x43')][0x1]?_0x4568f9[_0x2caf('0x43')][0x1]['value']:undefined)||_0x2caf('0x4c')},{'name':_0x2caf('0x4d'),'value':_0x4568f9['attrFontSize']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x2]?_0x4568f9[_0x2caf('0x43')][0x2][_0x2caf('0x44')]:undefined)||0xc}];case _0x2caf('0x4e'):return[{'name':_0x2caf('0x4f'),'value':_0x4568f9[_0x2caf('0x4f')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x0]?_0x4568f9[_0x2caf('0x43')][0x0]['value']:undefined)||_0x2caf('0x50')},{'name':_0x2caf('0x51'),'value':_0x4568f9[_0x2caf('0x51')]||(_0x4568f9['attrs']&&_0x4568f9['attrs'][0x1]?_0x4568f9[_0x2caf('0x43')][0x1]['value']:undefined)||[]},{'name':_0x2caf('0x4d'),'value':_0x4568f9[_0x2caf('0x4d')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x2]?_0x4568f9[_0x2caf('0x43')][0x2][_0x2caf('0x44')]:undefined)||0x14},{'name':_0x2caf('0x52'),'value':_0x4568f9[_0x2caf('0x52')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x3]?_0x4568f9[_0x2caf('0x43')][0x3][_0x2caf('0x44')]:undefined)||_0x2caf('0x53')},{'name':_0x2caf('0x54'),'value':_0x4568f9[_0x2caf('0x54')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x4]?_0x4568f9[_0x2caf('0x43')][0x4][_0x2caf('0x44')]:undefined)||''},{'name':_0x2caf('0x55'),'value':_0x4568f9[_0x2caf('0x55')]||(_0x4568f9['attrs']&&_0x4568f9[_0x2caf('0x43')][0x5]?_0x4568f9[_0x2caf('0x43')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x4568f9[_0x2caf('0x56')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x6]?_0x4568f9[_0x2caf('0x43')][0x6][_0x2caf('0x44')]:undefined)||''},{'name':_0x2caf('0x57'),'value':_0x4568f9[_0x2caf('0x57')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x7]?_0x4568f9[_0x2caf('0x43')][0x7][_0x2caf('0x44')]:undefined)||''},{'name':_0x2caf('0x58'),'value':_0x4568f9[_0x2caf('0x58')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x8]?_0x4568f9[_0x2caf('0x43')][0x8]['value']:undefined)||''},{'name':_0x2caf('0x59'),'value':_0x4568f9[_0x2caf('0x59')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x9]?_0x4568f9[_0x2caf('0x43')][0x9][_0x2caf('0x44')]:undefined)||''}];case _0x2caf('0x5a'):case _0x2caf('0x5b'):return[{'name':_0x2caf('0x5c'),'value':_0x4568f9[_0x2caf('0x5c')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x0]?_0x4568f9[_0x2caf('0x43')][0x0][_0x2caf('0x44')]:undefined)||'total'},{'name':_0x2caf('0x5d'),'value':_0x4568f9[_0x2caf('0x5d')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x1]?_0x4568f9[_0x2caf('0x43')][0x1][_0x2caf('0x44')]:undefined)||null},{'name':_0x2caf('0x5e'),'value':_0x4568f9['attrSerie3']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x2]?_0x4568f9[_0x2caf('0x43')][0x2][_0x2caf('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4568f9[_0x2caf('0x51')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x3]?_0x4568f9['attrs'][0x3][_0x2caf('0x44')]:undefined)||[]},{'name':_0x2caf('0x52'),'value':_0x4568f9['attrChannel']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x4]?_0x4568f9[_0x2caf('0x43')][0x4]['value']:undefined)||_0x2caf('0x53')},{'name':'attrEmailAccounts','value':_0x4568f9[_0x2caf('0x54')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x5]?_0x4568f9['attrs'][0x5][_0x2caf('0x44')]:undefined)||''},{'name':_0x2caf('0x55'),'value':_0x4568f9[_0x2caf('0x55')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x6]?_0x4568f9['attrs'][0x6][_0x2caf('0x44')]:undefined)||''},{'name':_0x2caf('0x56'),'value':_0x4568f9['attrSmsAccounts']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x7]?_0x4568f9['attrs'][0x7]['value']:undefined)||''},{'name':_0x2caf('0x57'),'value':_0x4568f9['attrOpenchannelAccounts']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x8]?_0x4568f9[_0x2caf('0x43')][0x8][_0x2caf('0x44')]:undefined)||''},{'name':_0x2caf('0x58'),'value':_0x4568f9['attrWhatsappAccounts']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9['attrs'][0x9]?_0x4568f9[_0x2caf('0x43')][0x9]['value']:undefined)||''},{'name':_0x2caf('0x59'),'value':_0x4568f9['attrChatWebsites']||(_0x4568f9['attrs']&&_0x4568f9[_0x2caf('0x43')][0xa]?_0x4568f9['attrs'][0xa][_0x2caf('0x44')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x4568f9[_0x2caf('0x5f')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x0]?_0x4568f9[_0x2caf('0x43')][0x0][_0x2caf('0x40')]:undefined)||null,'value':_0x4568f9['attrReport']||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x0]?_0x4568f9['attrs'][0x0][_0x2caf('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x4568f9[_0x2caf('0x60')]||(_0x4568f9[_0x2caf('0x43')]&&_0x4568f9[_0x2caf('0x43')][0x1]?_0x4568f9[_0x2caf('0x43')][0x1][_0x2caf('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x5d82f5){logger['error'](_0x2caf('0x61'),JSON[_0x2caf('0x62')](_0x5d82f5));return[];}}exports[_0x2caf('0x63')]=function(_0x177e28,_0x16eb75){if(_0x177e28[_0x2caf('0x64')]){_0x177e28[_0x2caf('0x64')]['attrs']=widgetAttributes(_0x177e28[_0x2caf('0x64')]);}return db[_0x2caf('0x3c')][_0x2caf('0x63')](_0x177e28[_0x2caf('0x64')],{})[_0x2caf('0x29')](respondWithResult(_0x16eb75,0xc9))['catch'](handleError(_0x16eb75,null));};exports[_0x2caf('0x28')]=function(_0x5ed955,_0x1fb36f){if(_0x5ed955[_0x2caf('0x64')]['id']){delete _0x5ed955[_0x2caf('0x64')]['id'];}_0x5ed955[_0x2caf('0x64')][_0x2caf('0x43')]=widgetAttributes(_0x5ed955['body']);return db[_0x2caf('0x3c')]['find']({'where':{'id':_0x5ed955[_0x2caf('0x3f')]['id']}})[_0x2caf('0x29')](handleEntityNotFound(_0x1fb36f,null))['then'](saveUpdates(_0x5ed955[_0x2caf('0x64')],null))[_0x2caf('0x29')](respondWithResult(_0x1fb36f,null))[_0x2caf('0x3e')](handleError(_0x1fb36f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index fb6239b..963ad2e 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 _0xe8fc=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x1616df,_0x3e66b5){var _0x6a7d7b=function(_0x454b20){while(--_0x454b20){_0x1616df['push'](_0x1616df['shift']());}};_0x6a7d7b(++_0x3e66b5);}(_0xe8fc,0x144));var _0xce8f=function(_0x3f6c23,_0x436877){_0x3f6c23=_0x3f6c23-0x0;var _0x1fe8b1=_0xe8fc[_0x3f6c23];return _0x1fe8b1;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xce8f('0x0'))['db'][_0xce8f('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xce8f('0x2')](0x0);var events={'afterCreate':_0xce8f('0x3'),'afterUpdate':_0xce8f('0x4'),'afterDestroy':_0xce8f('0x5')};function emitEvent(_0xf6c6fa){return function(_0x2312a9,_0x3548f2,_0x97abb2){DashboardItemEvents[_0xce8f('0x6')](_0xf6c6fa+':'+_0x2312a9['id'],_0x2312a9);DashboardItemEvents['emit'](_0xf6c6fa,_0x2312a9);_0x97abb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xce8f('0x7')](e,emitEvent(event));}}module[_0xce8f('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x583d=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xa2de20,_0x550ae9){var _0x598681=function(_0x24d22f){while(--_0x24d22f){_0xa2de20['push'](_0xa2de20['shift']());}};_0x598681(++_0x550ae9);}(_0x583d,0x161));var _0xd583=function(_0x5e229a,_0xd2334a){_0x5e229a=_0x5e229a-0x0;var _0x274086=_0x583d[_0x5e229a];return _0x274086;};'use strict';var EventEmitter=require(_0xd583('0x0'));var DashboardItem=require(_0xd583('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd583('0x2')](0x0);var events={'afterCreate':_0xd583('0x3'),'afterUpdate':'update','afterDestroy':_0xd583('0x4')};function emitEvent(_0x7bcf5){return function(_0x4bd8fa,_0x1df511,_0x4f1aa3){DashboardItemEvents['emit'](_0x7bcf5+':'+_0x4bd8fa['id'],_0x4bd8fa);DashboardItemEvents[_0xd583('0x5')](_0x7bcf5,_0x4bd8fa);_0x4f1aa3(null);};}for(var e in events){if(events[_0xd583('0x6')](e)){var event=events[e];DashboardItem[_0xd583('0x7')](e,emitEvent(event));}}module[_0xd583('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d353b1d..c4ee6fb 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 _0x35b5=['dashboard_items','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','define'];(function(_0x4c1ecb,_0x1b5c2b){var _0x5759e4=function(_0x52c2e0){while(--_0x52c2e0){_0x4c1ecb['push'](_0x4c1ecb['shift']());}};_0x5759e4(++_0x1b5c2b);}(_0x35b5,0x1c4));var _0x535b=function(_0x14d68f,_0x3d3b93){_0x14d68f=_0x14d68f-0x0;var _0x33c4e2=_0x35b5[_0x14d68f];return _0x33c4e2;};'use strict';var _=require(_0x535b('0x0'));var util=require('util');var logger=require(_0x535b('0x1'))(_0x535b('0x2'));var moment=require(_0x535b('0x3'));var BPromise=require(_0x535b('0x4'));var rp=require(_0x535b('0x5'));var fs=require('fs');var path=require(_0x535b('0x6'));var rimraf=require('rimraf');var config=require(_0x535b('0x7'));var attributes=require(_0x535b('0x8'));module['exports']=function(_0x436b8f,_0x5ab9d7){return _0x436b8f[_0x535b('0x9')]('DashboardItem',attributes,{'tableName':_0x535b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89b9=['lodash','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','dashboard_items'];(function(_0x4cd0c0,_0xfb9df5){var _0x1fcab1=function(_0x3c5b15){while(--_0x3c5b15){_0x4cd0c0['push'](_0x4cd0c0['shift']());}};_0x1fcab1(++_0xfb9df5);}(_0x89b9,0x17a));var _0x989b=function(_0x1b1828,_0x4a5b02){_0x1b1828=_0x1b1828-0x0;var _0x3a065a=_0x89b9[_0x1b1828];return _0x3a065a;};'use strict';var _=require(_0x989b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x989b('0x1'));var rp=require(_0x989b('0x2'));var fs=require('fs');var path=require(_0x989b('0x3'));var rimraf=require(_0x989b('0x4'));var config=require('../../config/environment');var attributes=require(_0x989b('0x5'));module[_0x989b('0x6')]=function(_0x3cd354,_0x5b2b7f){return _0x3cd354[_0x989b('0x7')]('DashboardItem',attributes,{'tableName':_0x989b('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 60486be..9c33cc9 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 _0xd73c=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x51d267,_0x160ccb){var _0x3f4476=function(_0x3798bb){while(--_0x3798bb){_0x51d267['push'](_0x51d267['shift']());}};_0x3f4476(++_0x160ccb);}(_0xd73c,0x1aa));var _0xcd73=function(_0xe97a4a,_0x59fc5b){_0xe97a4a=_0xe97a4a-0x0;var _0x51add6=_0xd73c[_0xe97a4a];return _0x51add6;};'use strict';var _=require(_0xcd73('0x0'));var util=require('util');var moment=require(_0xcd73('0x1'));var BPromise=require(_0xcd73('0x2'));var rs=require(_0xcd73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd73('0x4'))['db'];var utils=require(_0xcd73('0x5'));var logger=require(_0xcd73('0x6'))(_0xcd73('0x7'));var config=require(_0xcd73('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xcd73('0x9')]=_[_0xcd73('0xa')](config['redis'],{'host':_0xcd73('0xb'),'port':0x18eb});var socket=require(_0xcd73('0xc'))(new Redis(config['redis']));require(_0xcd73('0xd'))[_0xcd73('0xe')](socket);function respondWithRpcPromise(_0x443991,_0x2f59f1,_0x569de5){return new BPromise(function(_0x1b10b5,_0xbbf68d){return client[_0xcd73('0xf')](_0x443991,_0x569de5)[_0xcd73('0x10')](function(_0x3555bd){logger[_0xcd73('0x11')](_0xcd73('0x12'),_0x2f59f1,_0xcd73('0x13'));logger[_0xcd73('0x14')](_0xcd73('0x15'),_0x2f59f1,_0xcd73('0x13'),JSON[_0xcd73('0x16')](_0x3555bd));if(_0x3555bd[_0xcd73('0x17')]){if(_0x3555bd[_0xcd73('0x17')][_0xcd73('0x18')]===0x1f4){logger[_0xcd73('0x17')]('DashboardItem,\x20%s,\x20%s',_0x2f59f1,_0x3555bd[_0xcd73('0x17')][_0xcd73('0x19')]);return _0xbbf68d(_0x3555bd['error'][_0xcd73('0x19')]);}logger['error'](_0xcd73('0x12'),_0x2f59f1,_0x3555bd[_0xcd73('0x17')][_0xcd73('0x19')]);return _0x1b10b5(_0x3555bd[_0xcd73('0x17')]['message']);}else{logger[_0xcd73('0x11')](_0xcd73('0x12'),_0x2f59f1,_0xcd73('0x13'));_0x1b10b5(_0x3555bd[_0xcd73('0x1a')][_0xcd73('0x19')]);}})['catch'](function(_0x3e68e8){logger['error'](_0xcd73('0x12'),_0x2f59f1,_0x3e68e8);_0xbbf68d(_0x3e68e8);});});} \ No newline at end of file +var _0x6c77=['request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','./dashboardItem.socket','register'];(function(_0x43794c,_0x4b4158){var _0xa31045=function(_0x2201e7){while(--_0x2201e7){_0x43794c['push'](_0x43794c['shift']());}};_0xa31045(++_0x4b4158);}(_0x6c77,0xfd));var _0x76c7=function(_0x19be52,_0x417078){_0x19be52=_0x19be52-0x0;var _0x42dfd2=_0x6c77[_0x19be52];return _0x42dfd2;};'use strict';var _=require('lodash');var util=require(_0x76c7('0x0'));var moment=require(_0x76c7('0x1'));var BPromise=require('bluebird');var rs=require(_0x76c7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76c7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x76c7('0x4'));var config=require(_0x76c7('0x5'));var jayson=require(_0x76c7('0x6'));var client=jayson[_0x76c7('0x7')]['http']({'port':0x232a});config[_0x76c7('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76c7('0x8')]));require(_0x76c7('0x9'))[_0x76c7('0xa')](socket);function respondWithRpcPromise(_0x2e8d1a,_0xd12308,_0x167226){return new BPromise(function(_0x105a5f,_0x2b7c62){return client[_0x76c7('0xb')](_0x2e8d1a,_0x167226)['then'](function(_0x498813){logger[_0x76c7('0xc')](_0x76c7('0xd'),_0xd12308,_0x76c7('0xe'));logger[_0x76c7('0xf')](_0x76c7('0x10'),_0xd12308,_0x76c7('0xe'),JSON[_0x76c7('0x11')](_0x498813));if(_0x498813[_0x76c7('0x12')]){if(_0x498813[_0x76c7('0x12')]['code']===0x1f4){logger[_0x76c7('0x12')](_0x76c7('0xd'),_0xd12308,_0x498813[_0x76c7('0x12')][_0x76c7('0x13')]);return _0x2b7c62(_0x498813[_0x76c7('0x12')][_0x76c7('0x13')]);}logger[_0x76c7('0x12')](_0x76c7('0xd'),_0xd12308,_0x498813[_0x76c7('0x12')][_0x76c7('0x13')]);return _0x105a5f(_0x498813[_0x76c7('0x12')][_0x76c7('0x13')]);}else{logger[_0x76c7('0xc')](_0x76c7('0xd'),_0xd12308,_0x76c7('0xe'));_0x105a5f(_0x498813[_0x76c7('0x14')][_0x76c7('0x13')]);}})[_0x76c7('0x15')](function(_0x384402){logger[_0x76c7('0x12')](_0x76c7('0xd'),_0xd12308,_0x384402);_0x2b7c62(_0x384402);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 9f90818..815038e 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 _0xb62d=['register','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x3fec75,_0x523d63){var _0x1dc06=function(_0xf83a9){while(--_0xf83a9){_0x3fec75['push'](_0x3fec75['shift']());}};_0x1dc06(++_0x523d63);}(_0xb62d,0xba));var _0xdb62=function(_0x2405de,_0x548637){_0x2405de=_0x2405de-0x0;var _0xeadb6e=_0xb62d[_0x2405de];return _0xeadb6e;};'use strict';var DashboardItemEvents=require(_0xdb62('0x0'));var events=[_0xdb62('0x1'),_0xdb62('0x2'),_0xdb62('0x3')];function createListener(_0x1d0b6d,_0x28323a){return function(_0x1c52ba){_0x28323a[_0xdb62('0x4')](_0x1d0b6d,_0x1c52ba);};}function removeListener(_0x3eaf0e,_0x13db16){return function(){DashboardItemEvents[_0xdb62('0x5')](_0x3eaf0e,_0x13db16);};}exports[_0xdb62('0x6')]=function(_0x1fab55){for(var _0x2021b2=0x0,_0x3cd285=events['length'];_0x2021b2<_0x3cd285;_0x2021b2++){var _0x411aa7=events[_0x2021b2];var _0xf4622d=createListener(_0xdb62('0x7')+_0x411aa7,_0x1fab55);DashboardItemEvents['on'](_0x411aa7,_0xf4622d);}}; \ No newline at end of file +var _0x1a9f=['save','update','removeListener','length','dashboardItem:'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1a9f,0x154));var _0xf1a9=function(_0x5181f4,_0x3e7316){_0x5181f4=_0x5181f4-0x0;var _0x2eb504=_0x1a9f[_0x5181f4];return _0x2eb504;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf1a9('0x0'),'remove',_0xf1a9('0x1')];function createListener(_0x2bdfeb,_0x2daabd){return function(_0x117d31){_0x2daabd['emit'](_0x2bdfeb,_0x117d31);};}function removeListener(_0x2e762a,_0x37c457){return function(){DashboardItemEvents[_0xf1a9('0x2')](_0x2e762a,_0x37c457);};}exports['register']=function(_0x14ed0b){for(var _0x1c5492=0x0,_0x125ef1=events[_0xf1a9('0x3')];_0x1c5492<_0x125ef1;_0x1c5492++){var _0x261060=events[_0x1c5492];var _0x34e210=createListener(_0xf1a9('0x4')+_0x261060,_0x14ed0b);DashboardItemEvents['on'](_0x261060,_0x34e210);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 861cb65..ce467c3 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 _0xaa5d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./dashboardItem.controller','/:id','post','isAuthenticated','create','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa5d,0x13b));var _0xdaa5=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0xaa5d[_0x3de4f8];return _0x3d81fc;};'use strict';var multer=require(_0xdaa5('0x0'));var util=require(_0xdaa5('0x1'));var path=require(_0xdaa5('0x2'));var timeout=require(_0xdaa5('0x3'));var express=require(_0xdaa5('0x4'));var router=express[_0xdaa5('0x5')]();var fs_extra=require(_0xdaa5('0x6'));var auth=require(_0xdaa5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdaa5('0x8'));router['get'](_0xdaa5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xdaa5('0xa')]('/',auth[_0xdaa5('0xb')](),controller[_0xdaa5('0xc')]);router['put'](_0xdaa5('0x9'),auth[_0xdaa5('0xb')](),controller['update']);router[_0xdaa5('0xd')](_0xdaa5('0x9'),auth[_0xdaa5('0xb')](),controller[_0xdaa5('0xe')]);module['exports']=router; \ No newline at end of file +var _0x51a5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','update','delete','/:id','destroy','exports','util','path'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0x51a5,0x1b6));var _0x551a=function(_0x17cd56,_0x5c47ff){_0x17cd56=_0x17cd56-0x0;var _0x4b7f02=_0x51a5[_0x17cd56];return _0x4b7f02;};'use strict';var multer=require('multer');var util=require(_0x551a('0x0'));var path=require(_0x551a('0x1'));var timeout=require(_0x551a('0x2'));var express=require(_0x551a('0x3'));var router=express[_0x551a('0x4')]();var fs_extra=require(_0x551a('0x5'));var auth=require(_0x551a('0x6'));var interaction=require(_0x551a('0x7'));var config=require(_0x551a('0x8'));var controller=require(_0x551a('0x9'));router[_0x551a('0xa')]('/:id',auth[_0x551a('0xb')](),controller[_0x551a('0xc')]);router[_0x551a('0xd')]('/',auth['isAuthenticated'](),controller[_0x551a('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x551a('0xf')]);router[_0x551a('0x10')](_0x551a('0x11'),auth[_0x551a('0xb')](),controller[_0x551a('0x12')]);module[_0x551a('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 3fc90c7..0562ebe 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 _0x40a9=['ENUM','first','third','sequelize','exports','STRING'];(function(_0x44aca9,_0x392405){var _0x5c2315=function(_0x3d9997){while(--_0x3d9997){_0x44aca9['push'](_0x44aca9['shift']());}};_0x5c2315(++_0x392405);}(_0x40a9,0xf3));var _0x940a=function(_0x5a9683,_0x36cc18){_0x5a9683=_0x5a9683-0x0;var _0x3300c3=_0x40a9[_0x5a9683];return _0x3300c3;};'use strict';var Sequelize=require(_0x940a('0x0'));module[_0x940a('0x1')]={'name':{'type':Sequelize[_0x940a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x940a('0x3')](_0x940a('0x4'),'second',_0x940a('0x5')),'allowNull':![],'defaultValue':_0x940a('0x4')},'description':{'type':Sequelize[_0x940a('0x2')]}}; \ No newline at end of file +var _0x340e=['first','second','third','sequelize','STRING'];(function(_0x2fd156,_0x23802d){var _0x1cd1dd=function(_0x376d97){while(--_0x376d97){_0x2fd156['push'](_0x2fd156['shift']());}};_0x1cd1dd(++_0x23802d);}(_0x340e,0x134));var _0xe340=function(_0x159edb,_0x235456){_0x159edb=_0x159edb-0x0;var _0x8b86cb=_0x340e[_0x159edb];return _0x8b86cb;};'use strict';var Sequelize=require(_0xe340('0x0'));module['exports']={'name':{'type':Sequelize[_0xe340('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xe340('0x2'),_0xe340('0x3'),_0xe340('0x4')),'allowNull':![],'defaultValue':_0xe340('0x2')},'description':{'type':Sequelize[_0xe340('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d371cee..49bc1ef 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 _0x0c01=['mustache','util','path','sox','to-csv','squel','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','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','get','Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','include','rows','catch','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xef8ec,_0x2f64d9){var _0x30c59c=function(_0x169213){while(--_0x169213){_0xef8ec['push'](_0xef8ec['shift']());}};_0x30c59c(++_0x2f64d9);}(_0x0c01,0x9d));var _0x10c0=function(_0x16e4b2,_0x3e52d4){_0x16e4b2=_0x16e4b2-0x0;var _0x436b2a=_0x0c01[_0x16e4b2];return _0x436b2a;};'use strict';var emlformat=require(_0x10c0('0x0'));var rimraf=require(_0x10c0('0x1'));var zipdir=require(_0x10c0('0x2'));var jsonpatch=require(_0x10c0('0x3'));var rp=require(_0x10c0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x10c0('0x5'));var util=require(_0x10c0('0x6'));var path=require(_0x10c0('0x7'));var sox=require(_0x10c0('0x8'));var csv=require(_0x10c0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x10c0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x10c0('0xb'));var toCsv=require(_0x10c0('0x9'));var querystring=require(_0x10c0('0xc'));var Papa=require(_0x10c0('0xd'));var Redis=require(_0x10c0('0xe'));var authService=require(_0x10c0('0xf'));var qs=require(_0x10c0('0x10'));var as=require(_0x10c0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10c0('0x12'))(_0x10c0('0x13'));var utils=require(_0x10c0('0x14'));var config=require(_0x10c0('0x15'));var licenseUtil=require(_0x10c0('0x16'));var db=require(_0x10c0('0x17'))['db'];function respondWithStatusCode(_0x4adb0c,_0x467209){_0x467209=_0x467209||0xcc;return function(_0x1087e5){if(_0x1087e5){return _0x4adb0c['sendStatus'](_0x467209);}return _0x4adb0c[_0x10c0('0x18')](_0x467209)[_0x10c0('0x19')]();};}function respondWithResult(_0x456294,_0x9091f2){_0x9091f2=_0x9091f2||0xc8;return function(_0x269be2){if(_0x269be2){return _0x456294[_0x10c0('0x18')](_0x9091f2)['json'](_0x269be2);}};}function respondWithFilteredResult(_0x1d39be,_0x2d9eb7){return function(_0x234feb){if(_0x234feb){var _0x324d23=typeof _0x2d9eb7[_0x10c0('0x1a')]===_0x10c0('0x1b')&&typeof _0x2d9eb7[_0x10c0('0x1c')]===_0x10c0('0x1b');var _0x43d3b7=_0x234feb['count'];var _0x18e1bd=_0x324d23?0x0:_0x2d9eb7[_0x10c0('0x1a')];var _0xf52ff1=_0x324d23?_0x234feb[_0x10c0('0x1d')]:_0x2d9eb7[_0x10c0('0x1a')]+_0x2d9eb7[_0x10c0('0x1c')];var _0xecaebc;if(_0xf52ff1>=_0x43d3b7){_0xf52ff1=_0x43d3b7;_0xecaebc=0xc8;}else{_0xecaebc=0xce;}_0x1d39be[_0x10c0('0x18')](_0xecaebc);return _0x1d39be['set'](_0x10c0('0x1e'),_0x18e1bd+'-'+_0xf52ff1+'/'+_0x43d3b7)[_0x10c0('0x1f')](_0x234feb);}return null;};}function patchUpdates(_0x1e11c8){return function(_0x1624f5){try{jsonpatch[_0x10c0('0x20')](_0x1624f5,_0x1e11c8,!![]);}catch(_0x27c360){return BPromise[_0x10c0('0x21')](_0x27c360);}return _0x1624f5[_0x10c0('0x22')]();};}function saveUpdates(_0x342611,_0x187ae3){return function(_0xf72eb){if(_0xf72eb){return _0xf72eb[_0x10c0('0x23')](_0x342611)['then'](function(_0x2e4af7){return _0x2e4af7;});}return null;};}function removeEntity(_0x2e35c4,_0x3d3955){return function(_0x5c5972){if(_0x5c5972){return _0x5c5972[_0x10c0('0x24')]()['then'](function(){var _0xa6aaad=_0x5c5972[_0x10c0('0x25')]({'plain':!![]});var _0x239a6f=_0x10c0('0x26');return db[_0x10c0('0x27')][_0x10c0('0x24')]({'where':{'type':_0x239a6f,'resourceId':_0xa6aaad['id']}})['then'](function(){return _0x5c5972;});})['then'](function(){_0x2e35c4['status'](0xcc)[_0x10c0('0x19')]();});}};}function handleEntityNotFound(_0x4fb560,_0x23865f){return function(_0x3900e7){if(!_0x3900e7){_0x4fb560[_0x10c0('0x28')](0x194);}return _0x3900e7;};}function handleError(_0x503692,_0x488bd6){_0x488bd6=_0x488bd6||0x1f4;return function(_0x1ddb62){logger[_0x10c0('0x29')](_0x1ddb62[_0x10c0('0x2a')]);if(_0x1ddb62['name']){delete _0x1ddb62[_0x10c0('0x2b')];}_0x503692[_0x10c0('0x18')](_0x488bd6)[_0x10c0('0x2c')](_0x1ddb62);};}exports[_0x10c0('0x2d')]=function(_0x39c187,_0x6c0e24){var _0x2de0f1={},_0x243473={},_0x2fea91={'count':0x0,'rows':[]};var _0x487e94=_[_0x10c0('0x2e')](db[_0x10c0('0x2f')][_0x10c0('0x30')],function(_0x5ad0f0){return{'name':_0x5ad0f0[_0x10c0('0x31')],'type':_0x5ad0f0['type']['key']};});_0x243473['model']=_[_0x10c0('0x2e')](_0x487e94,_0x10c0('0x2b'));_0x243473[_0x10c0('0x32')]=_[_0x10c0('0x33')](_0x39c187[_0x10c0('0x32')]);_0x243473[_0x10c0('0x34')]=_['intersection'](_0x243473[_0x10c0('0x35')],_0x243473['query']);_0x2de0f1[_0x10c0('0x36')]=_[_0x10c0('0x37')](_0x243473[_0x10c0('0x35')],qs[_0x10c0('0x38')](_0x39c187[_0x10c0('0x32')][_0x10c0('0x38')]));_0x2de0f1[_0x10c0('0x36')]=_0x2de0f1[_0x10c0('0x36')][_0x10c0('0x39')]?_0x2de0f1[_0x10c0('0x36')]:_0x243473[_0x10c0('0x35')];if(!_0x39c187[_0x10c0('0x32')][_0x10c0('0x3a')](_0x10c0('0x3b'))){_0x2de0f1['limit']=qs[_0x10c0('0x1c')](_0x39c187[_0x10c0('0x32')][_0x10c0('0x1c')]);_0x2de0f1['offset']=qs[_0x10c0('0x1a')](_0x39c187[_0x10c0('0x32')][_0x10c0('0x1a')]);}_0x2de0f1['order']=qs['sort'](_0x39c187[_0x10c0('0x32')][_0x10c0('0x3c')]);_0x2de0f1[_0x10c0('0x3d')]=qs['filters'](_[_0x10c0('0x3e')](_0x39c187[_0x10c0('0x32')],_0x243473[_0x10c0('0x34')]),_0x487e94);if(_0x39c187[_0x10c0('0x32')][_0x10c0('0x3f')]){_0x2de0f1['where']=_[_0x10c0('0x40')](_0x2de0f1[_0x10c0('0x3d')],{'$or':_[_0x10c0('0x2e')](_0x487e94,function(_0x44e4d3){if(_0x44e4d3['type']!==_0x10c0('0x41')){var _0x523fc5={};_0x523fc5[_0x44e4d3[_0x10c0('0x2b')]]={'$like':'%'+_0x39c187[_0x10c0('0x32')][_0x10c0('0x3f')]+'%'};return _0x523fc5;}})});}_0x2de0f1=_['merge']({},_0x2de0f1,_0x39c187[_0x10c0('0x42')]);var _0x50b8f3={'where':_0x2de0f1['where']};return db['Disposition'][_0x10c0('0x1d')](_0x50b8f3)[_0x10c0('0x43')](function(_0x5449c3){_0x2fea91['count']=_0x5449c3;if(_0x39c187[_0x10c0('0x32')]['includeAll']){_0x2de0f1[_0x10c0('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2de0f1);})['then'](function(_0xf3175c){_0x2fea91[_0x10c0('0x45')]=_0xf3175c;return _0x2fea91;})['then'](respondWithFilteredResult(_0x6c0e24,_0x2de0f1))[_0x10c0('0x46')](handleError(_0x6c0e24,null));};exports['show']=function(_0x485deb,_0x12b746){var _0x22fee4={'raw':!![],'where':{'id':_0x485deb[_0x10c0('0x47')]['id']}},_0x367444={};_0x367444[_0x10c0('0x35')]=_[_0x10c0('0x33')](db[_0x10c0('0x2f')][_0x10c0('0x30')]);_0x367444[_0x10c0('0x32')]=_[_0x10c0('0x33')](_0x485deb['query']);_0x367444[_0x10c0('0x34')]=_[_0x10c0('0x37')](_0x367444['model'],_0x367444[_0x10c0('0x32')]);_0x22fee4[_0x10c0('0x36')]=_[_0x10c0('0x37')](_0x367444[_0x10c0('0x35')],qs['fields'](_0x485deb['query'][_0x10c0('0x38')]));_0x22fee4[_0x10c0('0x36')]=_0x22fee4[_0x10c0('0x36')][_0x10c0('0x39')]?_0x22fee4[_0x10c0('0x36')]:_0x367444[_0x10c0('0x35')];if(_0x485deb['query'][_0x10c0('0x48')]){_0x22fee4[_0x10c0('0x44')]=[{'all':!![]}];}_0x22fee4=_[_0x10c0('0x40')]({},_0x22fee4,_0x485deb[_0x10c0('0x42')]);return db[_0x10c0('0x2f')][_0x10c0('0x49')](_0x22fee4)[_0x10c0('0x43')](handleEntityNotFound(_0x12b746,null))['then'](respondWithResult(_0x12b746,null))[_0x10c0('0x46')](handleError(_0x12b746,null));};exports['create']=function(_0x8da84f,_0x4ff5ec){return db[_0x10c0('0x2f')][_0x10c0('0x4a')](_0x8da84f[_0x10c0('0x4b')],{})[_0x10c0('0x43')](function(_0x1eae47){var _0x45576a=_0x8da84f['user'][_0x10c0('0x25')]({'plain':!![]});if(!_0x45576a)throw new Error(_0x10c0('0x4c'));if(_0x45576a[_0x10c0('0x4d')]==='user'){var _0x544c61=_0x1eae47[_0x10c0('0x25')]({'plain':!![]});var _0x50e796='Dispositions';return db['UserProfileSection'][_0x10c0('0x49')]({'where':{'name':_0x50e796,'userProfileId':_0x45576a[_0x10c0('0x4e')]},'raw':!![]})[_0x10c0('0x43')](function(_0x34fe24){if(_0x34fe24&&_0x34fe24[_0x10c0('0x4f')]===0x0){return db[_0x10c0('0x27')][_0x10c0('0x4a')]({'name':_0x544c61[_0x10c0('0x2b')],'resourceId':_0x544c61['id'],'type':_0x34fe24[_0x10c0('0x2b')],'sectionId':_0x34fe24['id']},{})['then'](function(){return _0x1eae47;});}else{return _0x1eae47;}})[_0x10c0('0x46')](function(_0x2dd2fd){logger[_0x10c0('0x29')](_0x10c0('0x50'),_0x2dd2fd);throw _0x2dd2fd;});}return _0x1eae47;})[_0x10c0('0x43')](respondWithResult(_0x4ff5ec,0xc9))[_0x10c0('0x46')](handleError(_0x4ff5ec,null));};exports[_0x10c0('0x23')]=function(_0x27e2e6,_0x241c5f){if(_0x27e2e6['body']['id']){delete _0x27e2e6[_0x10c0('0x4b')]['id'];}return db[_0x10c0('0x2f')][_0x10c0('0x49')]({'where':{'id':_0x27e2e6[_0x10c0('0x47')]['id']}})[_0x10c0('0x43')](handleEntityNotFound(_0x241c5f,null))[_0x10c0('0x43')](saveUpdates(_0x27e2e6[_0x10c0('0x4b')],null))[_0x10c0('0x43')](respondWithResult(_0x241c5f,null))['catch'](handleError(_0x241c5f,null));};exports[_0x10c0('0x24')]=function(_0x253385,_0x1e48ea){return db[_0x10c0('0x2f')][_0x10c0('0x49')]({'where':{'id':_0x253385['params']['id']}})[_0x10c0('0x43')](handleEntityNotFound(_0x1e48ea,null))[_0x10c0('0x43')](removeEntity(_0x1e48ea,null))[_0x10c0('0x46')](handleError(_0x1e48ea,null));}; \ No newline at end of file +var _0x76db=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','Dispositions','UserProfileResource','destroy','error','stack','name','send','map','Disposition','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x20aad7,_0x2f256b){var _0x321bdd=function(_0x3a6a4e){while(--_0x3a6a4e){_0x20aad7['push'](_0x20aad7['shift']());}};_0x321bdd(++_0x2f256b);}(_0x76db,0x9d));var _0xb76d=function(_0x480e8b,_0x15afc6){_0x480e8b=_0x480e8b-0x0;var _0x3a87f3=_0x76db[_0x480e8b];return _0x3a87f3;};'use strict';var emlformat=require(_0xb76d('0x0'));var rimraf=require(_0xb76d('0x1'));var zipdir=require(_0xb76d('0x2'));var jsonpatch=require(_0xb76d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb76d('0x4'));var Mustache=require(_0xb76d('0x5'));var util=require(_0xb76d('0x6'));var path=require(_0xb76d('0x7'));var sox=require('sox');var csv=require(_0xb76d('0x8'));var ejs=require(_0xb76d('0x9'));var fs=require('fs');var fs_extra=require(_0xb76d('0xa'));var _=require('lodash');var squel=require(_0xb76d('0xb'));var crypto=require(_0xb76d('0xc'));var jsforce=require(_0xb76d('0xd'));var deskjs=require(_0xb76d('0xe'));var toCsv=require(_0xb76d('0x8'));var querystring=require(_0xb76d('0xf'));var Papa=require(_0xb76d('0x10'));var Redis=require(_0xb76d('0x11'));var authService=require(_0xb76d('0x12'));var qs=require(_0xb76d('0x13'));var as=require(_0xb76d('0x14'));var hardwareService=require(_0xb76d('0x15'));var logger=require(_0xb76d('0x16'))('api');var utils=require(_0xb76d('0x17'));var config=require(_0xb76d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb76d('0x19'))['db'];function respondWithStatusCode(_0x17f40e,_0x512d30){_0x512d30=_0x512d30||0xcc;return function(_0x32cb73){if(_0x32cb73){return _0x17f40e[_0xb76d('0x1a')](_0x512d30);}return _0x17f40e[_0xb76d('0x1b')](_0x512d30)[_0xb76d('0x1c')]();};}function respondWithResult(_0x25c052,_0x3e4360){_0x3e4360=_0x3e4360||0xc8;return function(_0x43b7d8){if(_0x43b7d8){return _0x25c052[_0xb76d('0x1b')](_0x3e4360)[_0xb76d('0x1d')](_0x43b7d8);}};}function respondWithFilteredResult(_0x139f9f,_0x2ddbba){return function(_0x3d9ec6){if(_0x3d9ec6){var _0x52516e=typeof _0x2ddbba['offset']==='undefined'&&typeof _0x2ddbba[_0xb76d('0x1e')]===_0xb76d('0x1f');var _0x9d857a=_0x3d9ec6[_0xb76d('0x20')];var _0x67a798=_0x52516e?0x0:_0x2ddbba[_0xb76d('0x21')];var _0x1f4e4=_0x52516e?_0x3d9ec6[_0xb76d('0x20')]:_0x2ddbba[_0xb76d('0x21')]+_0x2ddbba[_0xb76d('0x1e')];var _0xfba511;if(_0x1f4e4>=_0x9d857a){_0x1f4e4=_0x9d857a;_0xfba511=0xc8;}else{_0xfba511=0xce;}_0x139f9f[_0xb76d('0x1b')](_0xfba511);return _0x139f9f[_0xb76d('0x22')](_0xb76d('0x23'),_0x67a798+'-'+_0x1f4e4+'/'+_0x9d857a)[_0xb76d('0x1d')](_0x3d9ec6);}return null;};}function patchUpdates(_0x57ca1e){return function(_0x211302){try{jsonpatch[_0xb76d('0x24')](_0x211302,_0x57ca1e,!![]);}catch(_0x42e28c){return BPromise[_0xb76d('0x25')](_0x42e28c);}return _0x211302[_0xb76d('0x26')]();};}function saveUpdates(_0xec31d,_0x4e6e37){return function(_0x53ab33){if(_0x53ab33){return _0x53ab33[_0xb76d('0x27')](_0xec31d)[_0xb76d('0x28')](function(_0xdecff9){return _0xdecff9;});}return null;};}function removeEntity(_0x38fc3c,_0x187580){return function(_0x55eed7){if(_0x55eed7){return _0x55eed7['destroy']()[_0xb76d('0x28')](function(){var _0x584a64=_0x55eed7['get']({'plain':!![]});var _0x1fe4f8=_0xb76d('0x29');return db[_0xb76d('0x2a')][_0xb76d('0x2b')]({'where':{'type':_0x1fe4f8,'resourceId':_0x584a64['id']}})[_0xb76d('0x28')](function(){return _0x55eed7;});})[_0xb76d('0x28')](function(){_0x38fc3c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17ab8a,_0x34d629){return function(_0x52e470){if(!_0x52e470){_0x17ab8a[_0xb76d('0x1a')](0x194);}return _0x52e470;};}function handleError(_0x17e497,_0x419423){_0x419423=_0x419423||0x1f4;return function(_0x237db1){logger[_0xb76d('0x2c')](_0x237db1[_0xb76d('0x2d')]);if(_0x237db1[_0xb76d('0x2e')]){delete _0x237db1[_0xb76d('0x2e')];}_0x17e497['status'](_0x419423)[_0xb76d('0x2f')](_0x237db1);};}exports['index']=function(_0x53e543,_0x268991){var _0x120bc7={},_0x215495={},_0x159116={'count':0x0,'rows':[]};var _0x381cde=_[_0xb76d('0x30')](db[_0xb76d('0x31')][_0xb76d('0x32')],function(_0x5b9cb4){return{'name':_0x5b9cb4[_0xb76d('0x33')],'type':_0x5b9cb4['type'][_0xb76d('0x34')]};});_0x215495['model']=_[_0xb76d('0x30')](_0x381cde,_0xb76d('0x2e'));_0x215495[_0xb76d('0x35')]=_[_0xb76d('0x36')](_0x53e543[_0xb76d('0x35')]);_0x215495[_0xb76d('0x37')]=_[_0xb76d('0x38')](_0x215495[_0xb76d('0x39')],_0x215495[_0xb76d('0x35')]);_0x120bc7['attributes']=_[_0xb76d('0x38')](_0x215495[_0xb76d('0x39')],qs[_0xb76d('0x3a')](_0x53e543[_0xb76d('0x35')][_0xb76d('0x3a')]));_0x120bc7[_0xb76d('0x3b')]=_0x120bc7[_0xb76d('0x3b')][_0xb76d('0x3c')]?_0x120bc7[_0xb76d('0x3b')]:_0x215495[_0xb76d('0x39')];if(!_0x53e543[_0xb76d('0x35')]['hasOwnProperty'](_0xb76d('0x3d'))){_0x120bc7[_0xb76d('0x1e')]=qs[_0xb76d('0x1e')](_0x53e543[_0xb76d('0x35')][_0xb76d('0x1e')]);_0x120bc7[_0xb76d('0x21')]=qs[_0xb76d('0x21')](_0x53e543[_0xb76d('0x35')][_0xb76d('0x21')]);}_0x120bc7[_0xb76d('0x3e')]=qs[_0xb76d('0x3f')](_0x53e543[_0xb76d('0x35')][_0xb76d('0x3f')]);_0x120bc7[_0xb76d('0x40')]=qs['filters'](_[_0xb76d('0x41')](_0x53e543[_0xb76d('0x35')],_0x215495[_0xb76d('0x37')]),_0x381cde);if(_0x53e543['query'][_0xb76d('0x42')]){_0x120bc7[_0xb76d('0x40')]=_[_0xb76d('0x43')](_0x120bc7[_0xb76d('0x40')],{'$or':_[_0xb76d('0x30')](_0x381cde,function(_0x8cffbc){if(_0x8cffbc['type']!==_0xb76d('0x44')){var _0x31d22f={};_0x31d22f[_0x8cffbc[_0xb76d('0x2e')]]={'$like':'%'+_0x53e543[_0xb76d('0x35')][_0xb76d('0x42')]+'%'};return _0x31d22f;}})});}_0x120bc7=_['merge']({},_0x120bc7,_0x53e543[_0xb76d('0x45')]);var _0x13265b={'where':_0x120bc7[_0xb76d('0x40')]};return db['Disposition'][_0xb76d('0x20')](_0x13265b)['then'](function(_0x1d5681){_0x159116[_0xb76d('0x20')]=_0x1d5681;if(_0x53e543[_0xb76d('0x35')][_0xb76d('0x46')]){_0x120bc7[_0xb76d('0x47')]=[{'all':!![]}];}return db[_0xb76d('0x31')][_0xb76d('0x48')](_0x120bc7);})[_0xb76d('0x28')](function(_0x333db9){_0x159116['rows']=_0x333db9;return _0x159116;})[_0xb76d('0x28')](respondWithFilteredResult(_0x268991,_0x120bc7))[_0xb76d('0x49')](handleError(_0x268991,null));};exports[_0xb76d('0x4a')]=function(_0xe4aaf9,_0xd9263a){var _0x1feb66={'raw':!![],'where':{'id':_0xe4aaf9[_0xb76d('0x4b')]['id']}},_0x55cb09={};_0x55cb09[_0xb76d('0x39')]=_[_0xb76d('0x36')](db[_0xb76d('0x31')][_0xb76d('0x32')]);_0x55cb09[_0xb76d('0x35')]=_[_0xb76d('0x36')](_0xe4aaf9[_0xb76d('0x35')]);_0x55cb09['filters']=_[_0xb76d('0x38')](_0x55cb09[_0xb76d('0x39')],_0x55cb09[_0xb76d('0x35')]);_0x1feb66['attributes']=_[_0xb76d('0x38')](_0x55cb09[_0xb76d('0x39')],qs['fields'](_0xe4aaf9[_0xb76d('0x35')][_0xb76d('0x3a')]));_0x1feb66['attributes']=_0x1feb66[_0xb76d('0x3b')][_0xb76d('0x3c')]?_0x1feb66[_0xb76d('0x3b')]:_0x55cb09[_0xb76d('0x39')];if(_0xe4aaf9[_0xb76d('0x35')]['includeAll']){_0x1feb66['include']=[{'all':!![]}];}_0x1feb66=_[_0xb76d('0x43')]({},_0x1feb66,_0xe4aaf9['options']);return db[_0xb76d('0x31')][_0xb76d('0x4c')](_0x1feb66)[_0xb76d('0x28')](handleEntityNotFound(_0xd9263a,null))[_0xb76d('0x28')](respondWithResult(_0xd9263a,null))['catch'](handleError(_0xd9263a,null));};exports['create']=function(_0x58e06e,_0x2e9736){return db[_0xb76d('0x31')]['create'](_0x58e06e[_0xb76d('0x4d')],{})[_0xb76d('0x28')](function(_0x2173be){var _0x5ab19c=_0x58e06e[_0xb76d('0x4e')]['get']({'plain':!![]});if(!_0x5ab19c)throw new Error(_0xb76d('0x4f'));if(_0x5ab19c[_0xb76d('0x50')]==='user'){var _0x2337a5=_0x2173be[_0xb76d('0x51')]({'plain':!![]});var _0x9c954d=_0xb76d('0x29');return db[_0xb76d('0x52')][_0xb76d('0x4c')]({'where':{'name':_0x9c954d,'userProfileId':_0x5ab19c['userProfileId']},'raw':!![]})[_0xb76d('0x28')](function(_0x13bc66){if(_0x13bc66&&_0x13bc66['autoAssociation']===0x0){return db['UserProfileResource'][_0xb76d('0x53')]({'name':_0x2337a5['name'],'resourceId':_0x2337a5['id'],'type':_0x13bc66[_0xb76d('0x2e')],'sectionId':_0x13bc66['id']},{})[_0xb76d('0x28')](function(){return _0x2173be;});}else{return _0x2173be;}})[_0xb76d('0x49')](function(_0x4d6158){logger[_0xb76d('0x2c')](_0xb76d('0x54'),_0x4d6158);throw _0x4d6158;});}return _0x2173be;})[_0xb76d('0x28')](respondWithResult(_0x2e9736,0xc9))['catch'](handleError(_0x2e9736,null));};exports[_0xb76d('0x27')]=function(_0x5676c1,_0x55414b){if(_0x5676c1[_0xb76d('0x4d')]['id']){delete _0x5676c1['body']['id'];}return db[_0xb76d('0x31')][_0xb76d('0x4c')]({'where':{'id':_0x5676c1[_0xb76d('0x4b')]['id']}})[_0xb76d('0x28')](handleEntityNotFound(_0x55414b,null))[_0xb76d('0x28')](saveUpdates(_0x5676c1[_0xb76d('0x4d')],null))[_0xb76d('0x28')](respondWithResult(_0x55414b,null))[_0xb76d('0x49')](handleError(_0x55414b,null));};exports['destroy']=function(_0x3ce705,_0x5a23d2){return db[_0xb76d('0x31')][_0xb76d('0x4c')]({'where':{'id':_0x3ce705['params']['id']}})[_0xb76d('0x28')](handleEntityNotFound(_0x5a23d2,null))[_0xb76d('0x28')](removeEntity(_0x5a23d2,null))['catch'](handleError(_0x5a23d2,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9130529..1854c3c 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 _0x7d4b=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','name_voice','ChatWebsiteId','name_mail','name','MailAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp'];(function(_0x3bb549,_0x55e629){var _0x2c77b5=function(_0x387981){while(--_0x387981){_0x3bb549['push'](_0x3bb549['shift']());}};_0x2c77b5(++_0x55e629);}(_0x7d4b,0xb4));var _0xb7d4=function(_0x48a858,_0x75f431){_0x48a858=_0x48a858-0x0;var _0x487f2f=_0x7d4b[_0x48a858];return _0x487f2f;};'use strict';var _=require(_0xb7d4('0x0'));var util=require(_0xb7d4('0x1'));var logger=require(_0xb7d4('0x2'))('api');var moment=require(_0xb7d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7d4('0x4'));var fs=require('fs');var path=require(_0xb7d4('0x5'));var rimraf=require(_0xb7d4('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xb7d4('0x7')]=function(_0x38b82d,_0x24bba9){return _0x38b82d[_0xb7d4('0x8')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xb7d4('0x9'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':['name',_0xb7d4('0xa')]},{'unique':!![],'name':_0xb7d4('0xb'),'fields':[_0xb7d4('0xc'),_0xb7d4('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0xb7d4('0xc'),'SmsAccountId']},{'unique':!![],'name':_0xb7d4('0xe'),'fields':['name',_0xb7d4('0xf')]},{'unique':!![],'name':_0xb7d4('0x10'),'fields':[_0xb7d4('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0xb7d4('0x11'),'fields':[_0xb7d4('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33a9=['../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0x33a9,0x8a));var _0x933a=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x33a9[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0x933a('0x0'));var util=require(_0x933a('0x1'));var logger=require(_0x933a('0x2'))('api');var moment=require(_0x933a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x933a('0x4'));var rimraf=require(_0x933a('0x5'));var config=require(_0x933a('0x6'));var attributes=require(_0x933a('0x7'));module[_0x933a('0x8')]=function(_0x27fc33,_0x44c2a5){return _0x27fc33[_0x933a('0x9')](_0x933a('0xa'),attributes,{'tableName':_0x933a('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x933a('0xc'),'fields':[_0x933a('0xd'),_0x933a('0xe')]},{'unique':!![],'name':_0x933a('0xf'),'fields':['name',_0x933a('0x10')]},{'unique':!![],'name':_0x933a('0x11'),'fields':[_0x933a('0xd'),_0x933a('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0x933a('0xd'),_0x933a('0x13')]},{'unique':!![],'name':_0x933a('0x14'),'fields':[_0x933a('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x933a('0x15'),'fields':[_0x933a('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x933a('0x16'),'fields':[_0x933a('0xd'),_0x933a('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b2f6c89..f3eec23 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(_0x131023,_0x2055da){var _0x9d357=function(_0x734abb){while(--_0x734abb){_0x131023['push'](_0x131023['shift']());}};_0x9d357(++_0x2055da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x179168,_0x24271f){var _0x5d21fa=function(_0x5414a2){while(--_0x5414a2){_0x179168['push'](_0x179168['shift']());}};_0x5d21fa(++_0x24271f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 5b026ab..feec934 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 _0xa468=['./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa468,0x1b1));var _0x8a46=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa468[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x8a46('0x0'));var util=require(_0x8a46('0x1'));var path=require(_0x8a46('0x2'));var timeout=require(_0x8a46('0x3'));var express=require(_0x8a46('0x4'));var router=express[_0x8a46('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a46('0x6'));var config=require(_0x8a46('0x7'));var controller=require(_0x8a46('0x8'));router[_0x8a46('0x9')]('/',auth[_0x8a46('0xa')](),controller[_0x8a46('0xb')]);router[_0x8a46('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8a46('0xc')]);router[_0x8a46('0xd')]('/',auth['isAuthenticated'](),controller[_0x8a46('0xe')]);router[_0x8a46('0xf')](_0x8a46('0x10'),auth[_0x8a46('0xa')](),controller[_0x8a46('0x11')]);router[_0x8a46('0x12')](_0x8a46('0x10'),auth[_0x8a46('0xa')](),controller[_0x8a46('0x13')]);module[_0x8a46('0x14')]=router; \ No newline at end of file +var _0xe0c0=['./disposition.controller','get','isAuthenticated','index','show','post','create','delete','/:id','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x313fdf,_0xa6bcca){var _0x3002a5=function(_0x5b3146){while(--_0x5b3146){_0x313fdf['push'](_0x313fdf['shift']());}};_0x3002a5(++_0xa6bcca);}(_0xe0c0,0xe7));var _0x0e0c=function(_0x143b30,_0x17ebc3){_0x143b30=_0x143b30-0x0;var _0x1b9c7e=_0xe0c0[_0x143b30];return _0x1b9c7e;};'use strict';var multer=require(_0x0e0c('0x0'));var util=require('util');var path=require(_0x0e0c('0x1'));var timeout=require(_0x0e0c('0x2'));var express=require('express');var router=express[_0x0e0c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0e0c('0x4'));var interaction=require(_0x0e0c('0x5'));var config=require(_0x0e0c('0x6'));var controller=require(_0x0e0c('0x7'));router[_0x0e0c('0x8')]('/',auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xa')]);router[_0x0e0c('0x8')]('/:id',auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xb')]);router[_0x0e0c('0xc')]('/',auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0e0c('0xe')](_0x0e0c('0xf'),auth['isAuthenticated'](),controller[_0x0e0c('0x10')]);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 e82a34c..e83f3f0 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 _0xde8d=['mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','7200','9600','14400','2400','4800','12000','v17,v27,v29','INTEGER','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x4a31c3,_0x3d8ebf){var _0x59fc2f=function(_0x280209){while(--_0x280209){_0x4a31c3['push'](_0x4a31c3['shift']());}};_0x59fc2f(++_0x3d8ebf);}(_0xde8d,0x1c3));var _0xdde8=function(_0x152287,_0x16fb16){_0x152287=_0x152287-0x0;var _0x466e86=_0xde8d[_0x152287];return _0x466e86;};'use strict';var Sequelize=require(_0xdde8('0x0'));module[_0xdde8('0x1')]={'name':{'type':Sequelize[_0xdde8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xdde8('0x3'),'no'),'defaultValue':_0xdde8('0x3')},'headerinfo':{'type':Sequelize[_0xdde8('0x2')],'defaultValue':_0xdde8('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xdde8('0x5')},'minrate':{'type':Sequelize[_0xdde8('0x6')]('2400','4800',_0xdde8('0x7'),_0xdde8('0x8'),'12000',_0xdde8('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xdde8('0xa'),_0xdde8('0xb'),_0xdde8('0x7'),_0xdde8('0x8'),_0xdde8('0xc'),'14400'),'defaultValue':_0xdde8('0x9')},'modem':{'type':Sequelize[_0xdde8('0x2')],'defaultValue':_0xdde8('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xdde8('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xdde8('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xdde8('0x6')]('SIP','IAX',_0xdde8('0xf'),_0xdde8('0x10')),'defaultValue':_0xdde8('0x11')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdde8('0x12')],'defaultValue':function(){return _0xdde8('0x13');}},'notificationSound':{'type':Sequelize[_0xdde8('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdde8('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdde8('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdde8('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdde8('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xdde8('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdde8('0x16'),'set':function(_0x49b072){if(!_0x49b072)this[_0xdde8('0x17')]('mandatoryDispositionPauseId',null);this[_0xdde8('0x17')](_0xdde8('0x18'),_0x49b072);}}}; \ No newline at end of file +var _0x5248=['14400','v17,v27,v29','INTEGER','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','localstationid','2400','4800','7200','9600'];(function(_0x149615,_0x269a87){var _0x4150cd=function(_0x4b7dac){while(--_0x4b7dac){_0x149615['push'](_0x149615['shift']());}};_0x4150cd(++_0x269a87);}(_0x5248,0x128));var _0x8524=function(_0x599864,_0x5ae102){_0x599864=_0x599864-0x0;var _0x16bede=_0x5248[_0x599864];return _0x16bede;};'use strict';var Sequelize=require(_0x8524('0x0'));module['exports']={'name':{'type':Sequelize[_0x8524('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8524('0x1')]},'ecm':{'type':Sequelize[_0x8524('0x2')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x8524('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x8524('0x1')],'unique':_0x8524('0x3')},'minrate':{'type':Sequelize['ENUM'](_0x8524('0x4'),_0x8524('0x5'),_0x8524('0x6'),_0x8524('0x7'),'12000',_0x8524('0x8')),'defaultValue':_0x8524('0x5')},'maxrate':{'type':Sequelize['ENUM'](_0x8524('0x4'),_0x8524('0x5'),_0x8524('0x6'),'9600','12000','14400'),'defaultValue':_0x8524('0x8')},'modem':{'type':Sequelize[_0x8524('0x1')],'defaultValue':_0x8524('0x9')},'gateway':{'type':Sequelize[_0x8524('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8524('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8524('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX','DADHI','KHOMP'),'defaultValue':_0x8524('0xb')},'key':{'type':Sequelize[_0x8524('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8524('0xc')],'defaultValue':function(){return _0x8524('0xd');}},'notificationSound':{'type':Sequelize[_0x8524('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8524('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8524('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8524('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8524('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8524('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8524('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0x8524('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8524('0x10'),'set':function(_0x3544a3){if(!_0x3544a3)this[_0x8524('0x11')](_0x8524('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x3544a3);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index fff4d9c..73e5849 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 _0xd351=['send','index','Pause','mandatoryDispositionPause','FaxAccount','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','update','describe','addDisposition','FaxAccountId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','bulkCreate','omit','tech','key','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','fax','ListId','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','FaxAccounts','UserProfileResource','end','sendStatus','name'];(function(_0x118fbc,_0x38565e){var _0x4d7966=function(_0x133bd8){while(--_0x133bd8){_0x118fbc['push'](_0x118fbc['shift']());}};_0x4d7966(++_0x38565e);}(_0xd351,0x8b));var _0x1d35=function(_0x5f2360,_0x45b393){_0x5f2360=_0x5f2360-0x0;var _0x3df0be=_0xd351[_0x5f2360];return _0x3df0be;};'use strict';var emlformat=require(_0x1d35('0x0'));var rimraf=require(_0x1d35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d35('0x2'));var moment=require(_0x1d35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1d35('0x4'));var util=require(_0x1d35('0x5'));var path=require(_0x1d35('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d35('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d35('0x8'));var squel=require(_0x1d35('0x9'));var crypto=require(_0x1d35('0xa'));var jsforce=require(_0x1d35('0xb'));var deskjs=require(_0x1d35('0xc'));var toCsv=require(_0x1d35('0xd'));var querystring=require(_0x1d35('0xe'));var Papa=require(_0x1d35('0xf'));var Redis=require(_0x1d35('0x10'));var authService=require(_0x1d35('0x11'));var qs=require(_0x1d35('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d35('0x13'))('api');var utils=require(_0x1d35('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1d35('0x15'))['db'];config[_0x1d35('0x16')]=_[_0x1d35('0x17')](config[_0x1d35('0x16')],{'host':_0x1d35('0x18'),'port':0x18eb});var socket=require(_0x1d35('0x19'))(new Redis(config[_0x1d35('0x16')]));require('./faxAccount.socket')[_0x1d35('0x1a')](socket);var jayson=require(_0x1d35('0x1b'));var client=jayson[_0x1d35('0x1c')][_0x1d35('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x1d35('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x30e8a1,_0x2c7356,_0x515141,_0x4d1bd2){return new BPromise(function(_0x34c84c,_0x4a6f9c){var _0x197aad=_0x4d1bd2||client;return _0x197aad[_0x1d35('0x1e')](_0x30e8a1,_0x515141)[_0x1d35('0x1f')](function(_0x3e57f5){logger[_0x1d35('0x20')](_0x1d35('0x21'),_0x2c7356,_0x1d35('0x22'));logger[_0x1d35('0x23')](_0x1d35('0x24'),_0x2c7356,_0x1d35('0x22'),JSON[_0x1d35('0x25')](_0x3e57f5));if(_0x3e57f5['error']){if(_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x27')]===0x1f4){logger[_0x1d35('0x26')](_0x1d35('0x21'),_0x2c7356,_0x3e57f5['error']['message']);return _0x4a6f9c(_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x28')]);}logger[_0x1d35('0x26')](_0x1d35('0x21'),_0x2c7356,_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x28')]);return _0x34c84c(_0x3e57f5[_0x1d35('0x26')][_0x1d35('0x28')]);}else{logger[_0x1d35('0x20')](_0x1d35('0x21'),_0x2c7356,'request\x20sent');_0x34c84c(_0x3e57f5['result'][_0x1d35('0x28')]);}})['catch'](function(_0x12a079){logger[_0x1d35('0x26')](_0x1d35('0x21'),_0x2c7356,_0x12a079);_0x4a6f9c(_0x12a079);});});}function respondWithStatusCode(_0x4184a8,_0x7cf9d8){_0x7cf9d8=_0x7cf9d8||0xcc;return function(_0x1e8ce3){if(_0x1e8ce3){return _0x4184a8['sendStatus'](_0x7cf9d8);}return _0x4184a8['status'](_0x7cf9d8)['end']();};}function respondWithResult(_0x2436e3,_0x13a450){_0x13a450=_0x13a450||0xc8;return function(_0x199e0c){if(_0x199e0c){return _0x2436e3[_0x1d35('0x29')](_0x13a450)[_0x1d35('0x2a')](_0x199e0c);}};}function respondWithFilteredResult(_0x4d533e,_0x5cb2e1){return function(_0x39d4a4){if(_0x39d4a4){var _0x1707d5=typeof _0x5cb2e1[_0x1d35('0x2b')]==='undefined'&&typeof _0x5cb2e1[_0x1d35('0x2c')]===_0x1d35('0x2d');var _0xbb419b=_0x39d4a4[_0x1d35('0x2e')];var _0x3c19c7=_0x1707d5?0x0:_0x5cb2e1[_0x1d35('0x2b')];var _0x2e0624=_0x1707d5?_0x39d4a4[_0x1d35('0x2e')]:_0x5cb2e1['offset']+_0x5cb2e1[_0x1d35('0x2c')];var _0x2d819a;if(_0x2e0624>=_0xbb419b){_0x2e0624=_0xbb419b;_0x2d819a=0xc8;}else{_0x2d819a=0xce;}_0x4d533e[_0x1d35('0x29')](_0x2d819a);return _0x4d533e[_0x1d35('0x2f')](_0x1d35('0x30'),_0x3c19c7+'-'+_0x2e0624+'/'+_0xbb419b)[_0x1d35('0x2a')](_0x39d4a4);}return null;};}function patchUpdates(_0x2cb4e2){return function(_0x53c823){try{jsonpatch[_0x1d35('0x31')](_0x53c823,_0x2cb4e2,!![]);}catch(_0x50057e){return BPromise[_0x1d35('0x32')](_0x50057e);}return _0x53c823[_0x1d35('0x33')]();};}function saveUpdates(_0x39237e,_0x23168c){return function(_0x4590e8){if(_0x4590e8){return _0x4590e8['update'](_0x39237e)['then'](function(_0x49533d){return _0x49533d;});}return null;};}function removeEntity(_0x31079c,_0x22b457){return function(_0x536b50){if(_0x536b50){return _0x536b50[_0x1d35('0x34')]()[_0x1d35('0x1f')](function(){var _0x2d5887=_0x536b50['get']({'plain':!![]});var _0x4c7e30=_0x1d35('0x35');return db[_0x1d35('0x36')][_0x1d35('0x34')]({'where':{'type':_0x4c7e30,'resourceId':_0x2d5887['id']}})['then'](function(){return _0x536b50;});})[_0x1d35('0x1f')](function(){_0x31079c['status'](0xcc)[_0x1d35('0x37')]();});}};}function handleEntityNotFound(_0x1bf753,_0x56d8e1){return function(_0x7d8f66){if(!_0x7d8f66){_0x1bf753[_0x1d35('0x38')](0x194);}return _0x7d8f66;};}function handleError(_0x2e5e5d,_0xdf9f1){_0xdf9f1=_0xdf9f1||0x1f4;return function(_0x5c9d72){logger[_0x1d35('0x26')](_0x5c9d72['stack']);if(_0x5c9d72[_0x1d35('0x39')]){delete _0x5c9d72['name'];}_0x2e5e5d[_0x1d35('0x29')](_0xdf9f1)[_0x1d35('0x3a')](_0x5c9d72);};}exports[_0x1d35('0x3b')]=function(_0x153c86,_0x2c0a29){var _0xa0f74a={'include':[{'model':db[_0x1d35('0x3c')],'as':_0x1d35('0x3d')}]},_0x26ce41={},_0x52fe7e={'count':0x0,'rows':[]};var _0x3f5894=_['map'](db[_0x1d35('0x3e')]['rawAttributes'],function(_0x2eadd9){return{'name':_0x2eadd9['fieldName'],'type':_0x2eadd9[_0x1d35('0x3f')]['key']};});_0x26ce41[_0x1d35('0x40')]=_[_0x1d35('0x41')](_0x3f5894,'name');_0x26ce41[_0x1d35('0x42')]=_['keys'](_0x153c86['query']);_0x26ce41[_0x1d35('0x43')]=_['intersection'](_0x26ce41['model'],_0x26ce41[_0x1d35('0x42')]);_0xa0f74a['attributes']=_[_0x1d35('0x44')](_0x26ce41[_0x1d35('0x40')],qs['fields'](_0x153c86[_0x1d35('0x42')][_0x1d35('0x45')]));_0xa0f74a[_0x1d35('0x46')]=_0xa0f74a[_0x1d35('0x46')]['length']?_0xa0f74a[_0x1d35('0x46')]:_0x26ce41['model'];if(!_0x153c86['query'][_0x1d35('0x47')]('nolimit')){_0xa0f74a[_0x1d35('0x2c')]=qs[_0x1d35('0x2c')](_0x153c86['query'][_0x1d35('0x2c')]);_0xa0f74a['offset']=qs['offset'](_0x153c86['query'][_0x1d35('0x2b')]);}_0xa0f74a[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0x153c86[_0x1d35('0x42')][_0x1d35('0x49')]);_0xa0f74a['where']=qs['filters'](_[_0x1d35('0x4a')](_0x153c86['query'],_0x26ce41[_0x1d35('0x43')]),_0x3f5894);if(_0x153c86[_0x1d35('0x42')][_0x1d35('0x4b')]){_0xa0f74a[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0xa0f74a[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x3f5894,function(_0x292b86){if(_0x292b86[_0x1d35('0x3f')]!==_0x1d35('0x4e')){var _0x2c6d9d={};_0x2c6d9d[_0x292b86[_0x1d35('0x39')]]={'$like':'%'+_0x153c86[_0x1d35('0x42')][_0x1d35('0x4b')]+'%'};return _0x2c6d9d;}})});}_0xa0f74a=_['merge']({},_0xa0f74a,_0x153c86[_0x1d35('0x4f')]);var _0x18d58d={'where':_0xa0f74a[_0x1d35('0x4c')]};return db[_0x1d35('0x3e')][_0x1d35('0x2e')](_0x18d58d)[_0x1d35('0x1f')](function(_0x3ef6b3){_0x52fe7e[_0x1d35('0x2e')]=_0x3ef6b3;if(_0x153c86['query'][_0x1d35('0x50')]){_0xa0f74a[_0x1d35('0x51')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0xa0f74a);})['then'](function(_0x30b8d3){_0x52fe7e[_0x1d35('0x52')]=_0x30b8d3;return _0x52fe7e;})[_0x1d35('0x1f')](respondWithFilteredResult(_0x2c0a29,_0xa0f74a))[_0x1d35('0x53')](handleError(_0x2c0a29,null));};exports['show']=function(_0x5c7a64,_0x5548ce){var _0x39bf61={'raw':![],'where':{'id':_0x5c7a64[_0x1d35('0x54')]['id']},'include':[{'model':db[_0x1d35('0x3c')],'as':_0x1d35('0x3d')}]},_0x479c2d={};_0x479c2d[_0x1d35('0x40')]=_[_0x1d35('0x55')](db[_0x1d35('0x3e')][_0x1d35('0x56')]);_0x479c2d[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0x5c7a64[_0x1d35('0x42')]);_0x479c2d[_0x1d35('0x43')]=_['intersection'](_0x479c2d[_0x1d35('0x40')],_0x479c2d['query']);_0x39bf61[_0x1d35('0x46')]=_[_0x1d35('0x44')](_0x479c2d['model'],qs[_0x1d35('0x45')](_0x5c7a64['query']['fields']));_0x39bf61[_0x1d35('0x46')]=_0x39bf61[_0x1d35('0x46')][_0x1d35('0x57')]?_0x39bf61[_0x1d35('0x46')]:_0x479c2d[_0x1d35('0x40')];if(_0x5c7a64['query'][_0x1d35('0x50')]){_0x39bf61[_0x1d35('0x51')]=[{'all':!![]}];}_0x39bf61=_[_0x1d35('0x4d')]({},_0x39bf61,_0x5c7a64[_0x1d35('0x4f')]);return db[_0x1d35('0x3e')][_0x1d35('0x58')](_0x39bf61)['then'](handleEntityNotFound(_0x5548ce,null))[_0x1d35('0x1f')](respondWithResult(_0x5548ce,null))['catch'](handleError(_0x5548ce,null));};exports['create']=function(_0x6774d,_0x260a2b){return db[_0x1d35('0x3e')][_0x1d35('0x59')](_0x6774d[_0x1d35('0x5a')],{})['then'](function(_0x1c69b8){var _0x3abfa3=_0x6774d['user'][_0x1d35('0x5b')]({'plain':!![]});if(!_0x3abfa3)throw new Error(_0x1d35('0x5c'));if(_0x3abfa3[_0x1d35('0x5d')]===_0x1d35('0x5e')){var _0x1abded=_0x1c69b8[_0x1d35('0x5b')]({'plain':!![]});var _0x30c97c=_0x1d35('0x35');return db['UserProfileSection'][_0x1d35('0x58')]({'where':{'name':_0x30c97c,'userProfileId':_0x3abfa3['userProfileId']},'raw':!![]})[_0x1d35('0x1f')](function(_0x2c51ef){if(_0x2c51ef&&_0x2c51ef[_0x1d35('0x5f')]===0x0){return db['UserProfileResource'][_0x1d35('0x59')]({'name':_0x1abded[_0x1d35('0x39')],'resourceId':_0x1abded['id'],'type':_0x2c51ef['name'],'sectionId':_0x2c51ef['id']},{})[_0x1d35('0x1f')](function(){return _0x1c69b8;});}else{return _0x1c69b8;}})[_0x1d35('0x53')](function(_0xc83d06){logger[_0x1d35('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc83d06);throw _0xc83d06;});}return _0x1c69b8;})[_0x1d35('0x1f')](respondWithResult(_0x260a2b,0xc9))['catch'](handleError(_0x260a2b,null));};exports[_0x1d35('0x60')]=function(_0x59bb4b,_0x3b92fe){if(_0x59bb4b[_0x1d35('0x5a')]['id']){delete _0x59bb4b['body']['id'];}return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x59bb4b[_0x1d35('0x54')]['id']},'include':[{'model':db[_0x1d35('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x1d35('0x1f')](handleEntityNotFound(_0x3b92fe,null))[_0x1d35('0x1f')](saveUpdates(_0x59bb4b[_0x1d35('0x5a')],null))['then'](respondWithResult(_0x3b92fe,null))['catch'](handleError(_0x3b92fe,null));};exports[_0x1d35('0x34')]=function(_0x521f2a,_0xe7186a){return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x521f2a['params']['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0xe7186a,null))[_0x1d35('0x1f')](removeEntity(_0xe7186a,null))[_0x1d35('0x53')](handleError(_0xe7186a,null));};exports[_0x1d35('0x61')]=function(_0x396bd1,_0x296e88){return db['FaxAccount'][_0x1d35('0x61')]()[_0x1d35('0x1f')](respondWithResult(_0x296e88,null))[_0x1d35('0x53')](handleError(_0x296e88,null));};exports[_0x1d35('0x62')]=function(_0x3d5f2e,_0xaf43f4,_0x3824f2){if(_0x3d5f2e[_0x1d35('0x5a')]['id']){delete _0x3d5f2e[_0x1d35('0x5a')]['id'];}return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x3d5f2e[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0xaf43f4,null))[_0x1d35('0x1f')](function(_0xf3e195){if(_0xf3e195){_0x3d5f2e[_0x1d35('0x5a')][_0x1d35('0x63')]=_0xf3e195['id'];return db[_0x1d35('0x64')]['create'](_0x3d5f2e[_0x1d35('0x5a')]);}})[_0x1d35('0x1f')](respondWithResult(_0xaf43f4,null))[_0x1d35('0x53')](handleError(_0xaf43f4,null));};exports['getDispositions']=function(_0x1881e1,_0x478011,_0x50ddf6){var _0x1a8f8d={'raw':![],'where':{}};var _0x26677f={};var _0x55c488={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1d35('0x65')]({'where':{'id':_0x1881e1[_0x1d35('0x54')]['id']}})['then'](handleEntityNotFound(_0x478011,null))[_0x1d35('0x1f')](function(_0x213814){if(_0x213814){_0x26677f['model']=_[_0x1d35('0x55')](db['Disposition']['rawAttributes']);_0x26677f[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0x1881e1[_0x1d35('0x42')]);_0x26677f[_0x1d35('0x43')]=_['intersection'](_0x26677f[_0x1d35('0x40')],_0x26677f[_0x1d35('0x42')]);_0x1a8f8d['attributes']=_[_0x1d35('0x44')](_0x26677f[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0x1881e1[_0x1d35('0x42')]['fields']));_0x1a8f8d[_0x1d35('0x46')]=_0x1a8f8d[_0x1d35('0x46')][_0x1d35('0x57')]?_0x1a8f8d['attributes']:_0x26677f[_0x1d35('0x40')];if(!_0x1881e1[_0x1d35('0x42')][_0x1d35('0x47')]('nolimit')){_0x1a8f8d[_0x1d35('0x2c')]=qs['limit'](_0x1881e1[_0x1d35('0x42')]['limit']);_0x1a8f8d['offset']=qs[_0x1d35('0x2b')](_0x1881e1[_0x1d35('0x42')]['offset']);}_0x1a8f8d[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0x1881e1[_0x1d35('0x42')][_0x1d35('0x49')]);_0x1a8f8d[_0x1d35('0x4c')]=qs['filters'](_[_0x1d35('0x4a')](_0x1881e1['query'],_0x26677f['filters']));_0x1a8f8d[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x213814['id'];if(_0x1881e1[_0x1d35('0x42')][_0x1d35('0x4b')]){_0x1a8f8d['where']=_[_0x1d35('0x4d')](_0x1a8f8d['where'],{'$or':_[_0x1d35('0x41')](_0x1a8f8d[_0x1d35('0x46')],function(_0x3c34f9){var _0x1c923d={};_0x1c923d[_0x3c34f9]={'$like':'%'+_0x1881e1[_0x1d35('0x42')]['filter']+'%'};return _0x1c923d;})});}_0x1a8f8d=_[_0x1d35('0x4d')]({},_0x1a8f8d,_0x1881e1['options']);return db[_0x1d35('0x64')][_0x1d35('0x2e')]({'where':_0x1a8f8d['where']})[_0x1d35('0x1f')](function(_0x417b58){_0x55c488['count']=_0x417b58;if(_0x1881e1[_0x1d35('0x42')]['includeAll']){_0x1a8f8d[_0x1d35('0x51')]=[{'all':!![]}];}return db[_0x1d35('0x64')][_0x1d35('0x66')](_0x1a8f8d);})[_0x1d35('0x1f')](function(_0x106543){_0x55c488[_0x1d35('0x52')]=_0x106543;return _0x55c488;});}})[_0x1d35('0x1f')](respondWithFilteredResult(_0x478011,_0x1a8f8d))[_0x1d35('0x53')](handleError(_0x478011,null));};exports[_0x1d35('0x67')]=function(_0x5a4ba2,_0x5028b8,_0x5d5248){return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x5a4ba2[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x5028b8,null))[_0x1d35('0x1f')](function(_0x1a82e2){if(_0x1a82e2){return _0x1a82e2[_0x1d35('0x67')](_0x5a4ba2[_0x1d35('0x42')][_0x1d35('0x68')]);}})['then'](respondWithStatusCode(_0x5028b8,null))['catch'](handleError(_0x5028b8,null));};exports[_0x1d35('0x69')]=function(_0x1010f,_0x20ad34,_0x41507f){if(_0x1010f['body']['id']){delete _0x1010f[_0x1d35('0x5a')]['id'];}return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x1010f[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x20ad34,null))[_0x1d35('0x1f')](function(_0x1e2fc1){if(_0x1e2fc1){_0x1010f['body'][_0x1d35('0x63')]=_0x1e2fc1['id'];return db[_0x1d35('0x6a')][_0x1d35('0x59')](_0x1010f[_0x1d35('0x5a')]);}})[_0x1d35('0x1f')](respondWithResult(_0x20ad34,null))['catch'](handleError(_0x20ad34,null));};exports[_0x1d35('0x6b')]=function(_0xb784b4,_0x561d28,_0x9e29b){var _0x27a626={'raw':![],'where':{}};var _0x7a58e0={};var _0x46b7ae={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1d35('0x65')]({'where':{'id':_0xb784b4['params']['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x561d28,null))['then'](function(_0x592f27){if(_0x592f27){_0x7a58e0[_0x1d35('0x40')]=_[_0x1d35('0x55')](db[_0x1d35('0x6a')][_0x1d35('0x56')]);_0x7a58e0[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0xb784b4['query']);_0x7a58e0[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x7a58e0[_0x1d35('0x40')],_0x7a58e0[_0x1d35('0x42')]);_0x27a626[_0x1d35('0x46')]=_['intersection'](_0x7a58e0[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0xb784b4[_0x1d35('0x42')]['fields']));_0x27a626[_0x1d35('0x46')]=_0x27a626[_0x1d35('0x46')][_0x1d35('0x57')]?_0x27a626[_0x1d35('0x46')]:_0x7a58e0[_0x1d35('0x40')];if(!_0xb784b4[_0x1d35('0x42')][_0x1d35('0x47')](_0x1d35('0x6c'))){_0x27a626['limit']=qs[_0x1d35('0x2c')](_0xb784b4[_0x1d35('0x42')]['limit']);_0x27a626[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0xb784b4[_0x1d35('0x42')]['offset']);}_0x27a626[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0xb784b4[_0x1d35('0x42')][_0x1d35('0x49')]);_0x27a626[_0x1d35('0x4c')]=qs['filters'](_['pick'](_0xb784b4[_0x1d35('0x42')],_0x7a58e0[_0x1d35('0x43')]));_0x27a626[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x592f27['id'];if(_0xb784b4[_0x1d35('0x42')]['filter']){_0x27a626[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x27a626[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x27a626[_0x1d35('0x46')],function(_0x27bf6c){var _0x484f47={};_0x484f47[_0x27bf6c]={'$like':'%'+_0xb784b4[_0x1d35('0x42')]['filter']+'%'};return _0x484f47;})});}_0x27a626=_[_0x1d35('0x4d')]({},_0x27a626,_0xb784b4[_0x1d35('0x4f')]);return db[_0x1d35('0x6a')]['count']({'where':_0x27a626[_0x1d35('0x4c')]})[_0x1d35('0x1f')](function(_0x47b6ad){_0x46b7ae[_0x1d35('0x2e')]=_0x47b6ad;if(_0xb784b4['query'][_0x1d35('0x50')]){_0x27a626['include']=[{'all':!![]}];}return db[_0x1d35('0x6a')][_0x1d35('0x66')](_0x27a626);})[_0x1d35('0x1f')](function(_0x227a85){_0x46b7ae[_0x1d35('0x52')]=_0x227a85;return _0x46b7ae;});}})['then'](respondWithFilteredResult(_0x561d28,_0x27a626))[_0x1d35('0x53')](handleError(_0x561d28,null));};exports['removeAnswers']=function(_0x33bbf1,_0x3551cd,_0x198aed){return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x33bbf1[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x3551cd,null))['then'](function(_0x58ef9b){if(_0x58ef9b){return _0x58ef9b[_0x1d35('0x6d')](_0x33bbf1[_0x1d35('0x42')]['ids']);}})[_0x1d35('0x1f')](respondWithStatusCode(_0x3551cd,null))[_0x1d35('0x53')](handleError(_0x3551cd,null));};exports[_0x1d35('0x6e')]=function(_0x2eeb9d,_0x15e80f,_0x5298be){return db[_0x1d35('0x6f')][_0x1d35('0x58')]({'where':{'id':_0x2eeb9d[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x15e80f,null))[_0x1d35('0x1f')](function(_0x5d263f){if(_0x5d263f){return _0x5d263f['addInteraction'](_0x2eeb9d['body'][_0x1d35('0x68')],_['omit'](_0x2eeb9d['body'],[_0x1d35('0x68'),'id'])||{});}})['then'](respondWithResult(_0x15e80f,null))[_0x1d35('0x53')](handleError(_0x15e80f,null));};exports[_0x1d35('0x70')]=function(_0x1d91ed,_0x133ac5,_0x237d46){var _0x3d5c31={'raw':![],'where':{}};var _0x5b6c26={};var _0x17e6b5={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x1d91ed[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x133ac5,null))[_0x1d35('0x1f')](function(_0x379393){if(_0x379393){_0x5b6c26[_0x1d35('0x40')]=_[_0x1d35('0x55')](db['FaxInteraction'][_0x1d35('0x56')]);_0x5b6c26['query']=_[_0x1d35('0x55')](_0x1d91ed[_0x1d35('0x42')]);_0x5b6c26[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x5b6c26['model'],_0x5b6c26['query']);_0x3d5c31[_0x1d35('0x46')]=_[_0x1d35('0x44')](_0x5b6c26[_0x1d35('0x40')],qs['fields'](_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x45')]));_0x3d5c31['attributes']=_0x3d5c31[_0x1d35('0x46')][_0x1d35('0x57')]?_0x3d5c31['attributes']:_0x5b6c26['model'];if(!_0x1d91ed[_0x1d35('0x42')]['hasOwnProperty'](_0x1d35('0x6c'))){_0x3d5c31['limit']=qs['limit'](_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x2c')]);_0x3d5c31[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x2b')]);}_0x3d5c31['order']=qs[_0x1d35('0x49')](_0x1d91ed[_0x1d35('0x42')]['sort']);_0x3d5c31[_0x1d35('0x4c')]=qs[_0x1d35('0x43')](_[_0x1d35('0x4a')](_0x1d91ed[_0x1d35('0x42')],_0x5b6c26[_0x1d35('0x43')]));_0x3d5c31[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x379393['id'];if(_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x4b')]){_0x3d5c31[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x3d5c31[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x3d5c31['attributes'],function(_0x8565f0){var _0x5df98b={};_0x5df98b[_0x8565f0]={'$like':'%'+_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x4b')]+'%'};return _0x5df98b;})});}_0x3d5c31=_['merge']({},_0x3d5c31,_0x1d91ed[_0x1d35('0x4f')]);return db[_0x1d35('0x6f')]['count']({'where':_0x3d5c31[_0x1d35('0x4c')]})['then'](function(_0x239c4){_0x17e6b5[_0x1d35('0x2e')]=_0x239c4;if(_0x1d91ed['query'][_0x1d35('0x50')]){_0x3d5c31[_0x1d35('0x51')]=[{'model':db[_0x1d35('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x1d35('0x39'),_0x1d35('0x72'),_0x1d35('0x73')],'required':![]},{'model':db[_0x1d35('0x74')],'as':_0x1d35('0x75'),'attributes':['id','name',_0x1d35('0x76')],'where':_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x77')]?{'id':_0x1d91ed[_0x1d35('0x42')][_0x1d35('0x77')]}:undefined,'required':_0x1d91ed['query'][_0x1d35('0x77')]?!![]:![]}];}return db[_0x1d35('0x6f')][_0x1d35('0x66')](_0x3d5c31);})['then'](function(_0x4dbce4){_0x17e6b5[_0x1d35('0x52')]=_0x4dbce4;return _0x17e6b5;});}})[_0x1d35('0x1f')](respondWithFilteredResult(_0x133ac5,_0x3d5c31))['catch'](handleError(_0x133ac5,null));};exports[_0x1d35('0x78')]=function(_0x1d1238,_0x2d9351){var _0x4b72f7=_0x1d1238[_0x1d35('0x54')]['id'];var _0x4673d5=_0x1d1238[_0x1d35('0x5a')];var _0x433710=0xc8;var _0x33da34=null;return db['sequelize'][_0x1d35('0x79')]({'isolationLevel':db[_0x1d35('0x7a')][_0x1d35('0x7b')]['ISOLATION_LEVELS'][_0x1d35('0x7c')]},function(_0x2293ab){return db[_0x1d35('0x3e')][_0x1d35('0x65')]({'where':{'id':_0x4b72f7},'transaction':_0x2293ab})[_0x1d35('0x1f')](function(_0x49f79e){if(_0x49f79e){return db[_0x1d35('0x7d')][_0x1d35('0x34')]({'where':{'FaxAccountId':_0x4b72f7},'transaction':_0x2293ab})[_0x1d35('0x1f')](function(){var _0x5455b7=_['map'](_0x4673d5,function(_0x4f2927){_0x4f2927[_0x1d35('0x63')]=_0x4b72f7;return _0x4f2927;});return db[_0x1d35('0x7d')]['bulkCreate'](_0x5455b7,{'transaction':_0x2293ab});});}else{_0x433710=0x194;_0x33da34=[];}});})[_0x1d35('0x1f')](function(){if(_0x433710!==0x194){return db[_0x1d35('0x7d')][_0x1d35('0x7e')]({'where':{'FaxAccountId':_0x4b72f7},'order':_0x1d35('0x7f')})[_0x1d35('0x1f')](function(_0x554d98){_0x33da34=_0x554d98;});}})[_0x1d35('0x53')](function(_0x391452){_0x433710=0x1f4;logger['error'](_0x391452['stack']);if(_0x391452[_0x1d35('0x39')]){delete _0x391452[_0x1d35('0x39')];}_0x33da34=_0x391452;})[_0x1d35('0x80')](function(){if(_0x33da34===null){_0x2d9351['sendStatus'](_0x433710);}else{if(_0x433710===0x1f4){_0x2d9351[_0x1d35('0x29')](_0x433710)[_0x1d35('0x3a')](_0x33da34);}else{_0x2d9351[_0x1d35('0x29')](_0x433710)[_0x1d35('0x2a')](_0x33da34);}}});};exports['getApplications']=function(_0x27e1b2,_0x28cd09,_0x35fc5d){var _0x385b46={};var _0x153afb={};var _0x15f6a6;var _0x268689;return db[_0x1d35('0x3e')][_0x1d35('0x65')]({'where':{'id':_0x27e1b2['params']['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x28cd09,null))[_0x1d35('0x1f')](function(_0x84e3ec){if(_0x84e3ec){_0x15f6a6=_0x84e3ec;_0x153afb[_0x1d35('0x40')]=_[_0x1d35('0x55')](db[_0x1d35('0x7d')]['rawAttributes']);_0x153afb[_0x1d35('0x42')]=_[_0x1d35('0x55')](_0x27e1b2[_0x1d35('0x42')]);_0x153afb['filters']=_[_0x1d35('0x44')](_0x153afb[_0x1d35('0x40')],_0x153afb['query']);_0x385b46['attributes']=_[_0x1d35('0x44')](_0x153afb['model'],qs[_0x1d35('0x45')](_0x27e1b2[_0x1d35('0x42')]['fields']));_0x385b46[_0x1d35('0x46')]=_0x385b46[_0x1d35('0x46')]['length']?_0x385b46[_0x1d35('0x46')]:_0x153afb[_0x1d35('0x40')];_0x385b46['order']=qs['sort'](_0x27e1b2['query'][_0x1d35('0x49')]);_0x385b46[_0x1d35('0x4c')]=qs['filters'](_[_0x1d35('0x4a')](_0x27e1b2[_0x1d35('0x42')],_0x153afb[_0x1d35('0x43')]));if(_0x27e1b2[_0x1d35('0x42')]['filter']){_0x385b46[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x385b46[_0x1d35('0x4c')],{'$or':_['map'](_0x385b46['attributes'],function(_0x2a2498){var _0xe07614={};_0xe07614[_0x2a2498]={'$like':'%'+_0x27e1b2['query'][_0x1d35('0x4b')]+'%'};return _0xe07614;})});}_0x385b46=_['merge']({},_0x385b46,_0x27e1b2[_0x1d35('0x4f')]);return _0x15f6a6[_0x1d35('0x81')](_0x385b46);}})[_0x1d35('0x1f')](function(_0x182401){if(_0x182401){_0x268689=_0x182401[_0x1d35('0x57')];if(!_0x27e1b2[_0x1d35('0x42')][_0x1d35('0x47')]('nolimit')){_0x385b46['limit']=qs[_0x1d35('0x2c')](_0x27e1b2[_0x1d35('0x42')][_0x1d35('0x2c')]);_0x385b46[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0x27e1b2[_0x1d35('0x42')][_0x1d35('0x2b')]);}return _0x15f6a6[_0x1d35('0x81')](_0x385b46);}})[_0x1d35('0x1f')](function(_0x2f96d1){if(_0x2f96d1){return _0x2f96d1?{'count':_0x268689,'rows':_0x2f96d1}:null;}})[_0x1d35('0x1f')](respondWithResult(_0x28cd09,null))[_0x1d35('0x53')](handleError(_0x28cd09,null));};function Extension(_0x5d85e4,_0x26e23b,_0x2b2a64,_0x52cd49){this[_0x1d35('0x82')]=_0x1d35('0x83');this[_0x1d35('0x84')]=_0x5d85e4['localstationid'];this['app']=_0x52cd49;this[_0x1d35('0x3f')]=_0x1d35('0x85');this[_0x1d35('0x86')]=_0x1d35('0x87');this[_0x1d35('0x63')]=_0x5d85e4['id'];this[_0x1d35('0x7f')]=_0x26e23b;this[_0x1d35('0x88')]=_0x2b2a64;}function createExtensionsReciveFax(_0x57a3a6){var _0x14d504=0x1;var _0xadf987=[];_0xadf987['push'](new Extension(_0x57a3a6,_0x14d504,'',_0x1d35('0x89')));_0x14d504+=0x1;_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,_0x1d35('0x8b'),_0x1d35('0x8c')));_0x14d504+=0x1;for(var _0xd15e42 in _0x57a3a6){if(_0x57a3a6[_0x1d35('0x47')](_0xd15e42)&&(_0xd15e42===_0x1d35('0x8d')||_0xd15e42===_0x1d35('0x8e')||_0xd15e42===_0x1d35('0x8f')||_0xd15e42===_0x1d35('0x90')||_0xd15e42==='headerinfo'||_0xd15e42==='maxrate'||_0xd15e42===_0x1d35('0x91')||_0xd15e42===_0x1d35('0x92')||_0xd15e42===_0x1d35('0x93'))){_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,_0x1d35('0x94')+_0xd15e42+')='+_0x57a3a6[_0xd15e42],'Set'));_0x14d504+=0x1;}}_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,'6',_0x1d35('0x95')));_0x14d504+=0x1;_0xadf987[_0x1d35('0x8a')](new Extension(_0x57a3a6,_0x14d504,_0x1d35('0x96'),_0x1d35('0x97')));_0x14d504=0x0;return _0xadf987;}exports['addAccountApplications']=function(_0x312f88,_0x5b5658,_0x54e301){var _0x27965b;return db[_0x1d35('0x7a')][_0x1d35('0x79')](function(_0x445620){return db[_0x1d35('0x3e')][_0x1d35('0x59')](_0x312f88['body'],{'transaction':_0x445620})['then'](function(_0x3c7ae8){_0x27965b=_0x3c7ae8[_0x1d35('0x5b')]({'plain':!![]});return db[_0x1d35('0x98')][_0x1d35('0x99')](createExtensionsReciveFax(_0x27965b),{'transaction':_0x445620});});})[_0x1d35('0x1f')](function(){return _0x27965b;})[_0x1d35('0x1f')](respondWithResult(_0x5b5658,null))[_0x1d35('0x53')](handleError(_0x5b5658,null));};exports['updateAccountApplications']=function(_0x19926e,_0x3afe46,_0x410f45){var _0x2eebfb;return db['sequelize'][_0x1d35('0x79')](function(_0x581f8f){return db['FaxAccount'][_0x1d35('0x60')](_0x19926e[_0x1d35('0x5a')],{'where':{'id':_0x19926e['body']['id']},'transaction':_0x581f8f})[_0x1d35('0x1f')](function(_0x4b1ac){return db[_0x1d35('0x98')][_0x1d35('0x34')]({'where':{'FaxAccountId':_0x19926e[_0x1d35('0x5a')]['id']},'transaction':_0x581f8f})[_0x1d35('0x1f')](function(_0x144793){return db[_0x1d35('0x98')][_0x1d35('0x99')](createExtensionsReciveFax(_[_0x1d35('0x9a')](_0x19926e[_0x1d35('0x5a')],[_0x1d35('0x9b'),_0x1d35('0x9c'),_0x1d35('0x9d'),_0x1d35('0x9e'),'TrunkId','ListId'])),{'transaction':_0x581f8f});});});})[_0x1d35('0x1f')](function(){return db[_0x1d35('0x3e')][_0x1d35('0x9f')](_0x19926e[_0x1d35('0x5a')]['id']);})[_0x1d35('0x1f')](respondWithResult(_0x3afe46,null))['catch'](handleError(_0x3afe46,null));};exports[_0x1d35('0xa0')]=function(_0x8f02b9,_0xf5f7e6,_0x2beda1){var _0x583878={'raw':!![],'where':{}};var _0x22088d={};var _0x3ca1ee={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1d35('0x65')]({'where':{'id':_0x8f02b9[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0xf5f7e6,null))[_0x1d35('0x1f')](function(_0x212051){if(_0x212051){_0x22088d[_0x1d35('0x40')]=_['keys'](db[_0x1d35('0xa1')]['rawAttributes']);_0x22088d[_0x1d35('0x42')]=_['keys'](_0x8f02b9[_0x1d35('0x42')]);_0x22088d[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x22088d[_0x1d35('0x40')],_0x22088d[_0x1d35('0x42')]);_0x583878[_0x1d35('0x46')]=_['intersection'](_0x22088d[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0x8f02b9[_0x1d35('0x42')][_0x1d35('0x45')]));_0x583878[_0x1d35('0x46')]=_0x583878[_0x1d35('0x46')][_0x1d35('0x57')]?_0x583878['attributes']:_0x22088d[_0x1d35('0x40')];if(!_0x8f02b9['query'][_0x1d35('0x47')]('nolimit')){_0x583878[_0x1d35('0x2c')]=qs[_0x1d35('0x2c')](_0x8f02b9['query']['limit']);_0x583878[_0x1d35('0x2b')]=qs[_0x1d35('0x2b')](_0x8f02b9[_0x1d35('0x42')][_0x1d35('0x2b')]);}_0x583878[_0x1d35('0x48')]=qs[_0x1d35('0x49')](_0x8f02b9['query'][_0x1d35('0x49')]);_0x583878[_0x1d35('0x4c')]=qs[_0x1d35('0x43')](_[_0x1d35('0x4a')](_0x8f02b9[_0x1d35('0x42')],_0x22088d[_0x1d35('0x43')]));_0x583878[_0x1d35('0x4c')][_0x1d35('0x63')]=_0x212051['id'];if(_0x8f02b9['query']['filter']){_0x583878[_0x1d35('0x4c')]=_[_0x1d35('0x4d')](_0x583878[_0x1d35('0x4c')],{'$or':_[_0x1d35('0x41')](_0x583878[_0x1d35('0x46')],function(_0x1c8280){var _0x1b3088={};_0x1b3088[_0x1c8280]={'$like':'%'+_0x8f02b9[_0x1d35('0x42')][_0x1d35('0x4b')]+'%'};return _0x1b3088;})});}if(_0x8f02b9[_0x1d35('0x42')][_0x1d35('0xa2')]){var _0x391b2d=_0x8f02b9[_0x1d35('0x42')][_0x1d35('0xa2')][_0x1d35('0xa3')](',');var _0x265def={};_0x265def[_0x391b2d[0x0]]={'$gte':moment(_0x391b2d[0x1])['format'](_0x1d35('0xa4'))};_0x583878[_0x1d35('0x4c')]=_['merge'](_0x583878[_0x1d35('0x4c')],_0x265def);}_0x583878=_[_0x1d35('0x4d')]({},_0x583878,_0x8f02b9[_0x1d35('0x4f')]);return db[_0x1d35('0xa1')][_0x1d35('0x2e')]({'where':_0x583878['where']})[_0x1d35('0x1f')](function(_0x4ec165){_0x3ca1ee['count']=_0x4ec165;if(_0x8f02b9[_0x1d35('0x42')]['includeAll']){_0x583878[_0x1d35('0x51')]=[{'all':!![]}];}return db[_0x1d35('0xa1')]['findAll'](_0x583878);})[_0x1d35('0x1f')](function(_0x5bf727){_0x3ca1ee['rows']=_0x5bf727;return _0x3ca1ee;});}})['then'](respondWithFilteredResult(_0xf5f7e6,_0x583878))[_0x1d35('0x53')](handleError(_0xf5f7e6,null));};exports[_0x1d35('0x3a')]=function(_0x56ff0f,_0x4a5c72,_0x152d6b){var _0x5dcd2b,_0x3282cb={},_0x5532be;if(_0x56ff0f[_0x1d35('0x5a')]['to']){_0x5532be=_0x56ff0f['body']['to'][0x0];}return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x56ff0f[_0x1d35('0x54')]['id']},'include':[{'model':db[_0x1d35('0xa5')],'as':_0x1d35('0xa6'),'include':[{'model':db[_0x1d35('0x71')],'as':_0x1d35('0xa7'),'where':{'fax':_0x5532be},'limit':0x1,'order':[['updatedAt',_0x1d35('0xa8')]]}]}]})[_0x1d35('0x1f')](handleEntityNotFound(_0x4a5c72,null))[_0x1d35('0x1f')](function(_0x57ee20){_0x5dcd2b=_0x57ee20;if(_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')]&&_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][_0x1d35('0x57')]){for(var _0x4cb5bf=0x0;_0x4cb5bf<_0x56ff0f[_0x1d35('0x5a')]['attachments'][_0x1d35('0x57')];_0x4cb5bf+=0x1){_0x56ff0f['body'][_0x1d35('0xa9')][_0x4cb5bf]={'filename':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][_0x4cb5bf][_0x1d35('0x39')],'id':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][_0x4cb5bf]['id'],'path':path[_0x1d35('0xaa')](config[_0x1d35('0xab')],_0x1d35('0xac'),_0x56ff0f['body'][_0x1d35('0xa9')][_0x4cb5bf][_0x1d35('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0x1d35('0xae'),{'FaxAccountId':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x54')]['id'])?undefined:_0x56ff0f[_0x1d35('0x54')]['id'],'path':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0x6')])?undefined:_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0x6')],'fax':_['isNil'](_0x56ff0f['body']['to'][0x0])?undefined:_0x56ff0f[_0x1d35('0x5a')]['to'][0x0]},client9002);})[_0x1d35('0x1f')](function(){if(_0x5dcd2b){if(_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xb0')])){_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xb0')]=util[_0x1d35('0xb1')]('\x22%s\x22\x20<%s>',_0x5dcd2b[_0x1d35('0x39')],_0x5dcd2b[_0x1d35('0xb2')]);}if(_0x5dcd2b[_0x1d35('0xa6')]){if(_0x5dcd2b[_0x1d35('0xa6')][_0x1d35('0xa7')][_0x1d35('0x57')]){return _0x5dcd2b[_0x1d35('0xa6')]['Contacts'][0x0];}else{return db[_0x1d35('0x71')]['create'](_[_0x1d35('0x17')](_0x56ff0f['body'],{'firstName':_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'phone':_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'fax':_0x56ff0f['body']['to'][0x0],'ListId':_0x5dcd2b[_0x1d35('0xb3')]}));}}else{throw new Error(_0x1d35('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x1aa7dd){if(_0x1aa7dd){return db[_0x1d35('0x6f')][_0x1d35('0x58')]({'where':{'ContactId':_0x1aa7dd['id'],'closed':![],'FaxAccountId':_0x5dcd2b['id']}})[_0x1d35('0x1f')](function(_0x88f323){if(_0x88f323){return[_0x88f323,![]];}return db[_0x1d35('0x6f')]['create']({'UserId':_0x56ff0f[_0x1d35('0x5e')]['id'],'ContactId':_0x1aa7dd['id'],'FaxAccountId':_0x5dcd2b['id'],'fax':_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1d35('0x4d')](_0x56ff0f[_0x1d35('0x5a')],{'read':![],'body':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0xb5')],'FaxAccountId':_0x5dcd2b['id'],'UserId':_0x56ff0f[_0x1d35('0x5e')]['id'],'ContactId':_0x1aa7dd['id'],'AttachmentId':_0x56ff0f[_0x1d35('0x5a')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x1d35('0xa1')],'as':_0x1d35('0xb6')}]})[_0x1d35('0x1f')](function(_0x228c4b){return[_0x228c4b,!![]];});});}else{throw new Error(_0x1d35('0xb7'));}})[_0x1d35('0xb8')](function(_0x73c360,_0x5506f0){if(_0x5506f0){return _0x73c360;}return db[_0x1d35('0xa1')][_0x1d35('0x59')]({'direction':_0x1d35('0xb9'),'read':![],'body':_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0][_0x1d35('0xb5')],'FaxAccountId':_0x5dcd2b['id'],'FaxInteractionId':_0x73c360['id'],'UserId':_0x56ff0f[_0x1d35('0x5e')]['id'],'ContactId':_0x73c360[_0x1d35('0xba')],'AttachmentId':_0x56ff0f[_0x1d35('0x5a')]['attachments'][0x0]['id']})[_0x1d35('0x1f')](function(_0x1fa47c){_0x73c360[_0x1d35('0xbb')][_0x1d35('0xb6')]=[];_0x73c360[_0x1d35('0xbb')][_0x1d35('0xb6')][_0x1d35('0x8a')](_0x1fa47c[_0x1d35('0xbb')]);return _0x73c360;});})['then'](function(_0x54f8df){respondWithRpcPromise('SendFax',_0x1d35('0xbc'),{'FaxAccountId':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x54')]['id'])?undefined:_0x56ff0f['params']['id'],'path':_[_0x1d35('0xaf')](_0x56ff0f['body'][_0x1d35('0xa9')][0x0]['path'])?undefined:_0x56ff0f[_0x1d35('0x5a')][_0x1d35('0xa9')][0x0]['path'],'fax':_[_0x1d35('0xaf')](_0x56ff0f[_0x1d35('0x5a')]['to'][0x0])?undefined:_0x56ff0f[_0x1d35('0x5a')]['to'][0x0],'AttachmentId':_0x56ff0f['body'][_0x1d35('0xa9')][0x0]['id']},client9002)[_0x1d35('0x1f')](function(_0x491dc3){logger['info'](_0x1d35('0xbd'),_0x491dc3);})[_0x1d35('0x53')](function(_0x3875a5){logger['info']('SendFaxRpc,\x20%s',_0x3875a5);});return _0x54f8df;})[_0x1d35('0x1f')](respondWithResult(_0x4a5c72,null))[_0x1d35('0x53')](handleError(_0x4a5c72,null));};exports[_0x1d35('0xbe')]=function(_0x57e042,_0x36503f,_0x2eb041){return db[_0x1d35('0x3e')][_0x1d35('0x58')]({'where':{'id':_0x57e042[_0x1d35('0x54')]['id']}})['then'](handleEntityNotFound(_0x36503f,null))[_0x1d35('0x1f')](function(_0x524d17){if(_0x524d17){return _0x524d17[_0x1d35('0xbe')](_0x57e042[_0x1d35('0x5a')][_0x1d35('0x68')],_[_0x1d35('0x9a')](_0x57e042[_0x1d35('0x5a')],[_0x1d35('0x68'),'id'])||{})['spread'](function(_0x1101d8){for(var _0x1461c4=0x0;_0x1461c4<_0x57e042[_0x1d35('0x5a')]['ids'][_0x1d35('0x57')];_0x1461c4+=0x1){socket['emit'](_0x1d35('0xbf'),{'UserId':Number(_0x57e042['body']['ids'][_0x1461c4]),'FaxAccountId':Number(_0x57e042[_0x1d35('0x54')]['id'])});}return _0x1101d8;});}})[_0x1d35('0x1f')](respondWithResult(_0x36503f,null))['catch'](handleError(_0x36503f,null));};exports[_0x1d35('0xc0')]=function(_0x3bbf1b,_0x3748c2,_0x165c00){return db['FaxAccount'][_0x1d35('0x58')]({'where':{'id':_0x3bbf1b[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x3748c2,null))[_0x1d35('0x1f')](function(_0x119268){if(_0x119268){return _0x119268[_0x1d35('0xc0')](_0x3bbf1b['query'][_0x1d35('0x68')])[_0x1d35('0x1f')](function(){if(_[_0x1d35('0xc1')](_0x3bbf1b['query']['ids'])){for(var _0x48f14b=0x0;_0x48f14b<_0x3bbf1b[_0x1d35('0x42')][_0x1d35('0x68')][_0x1d35('0x57')];_0x48f14b+=0x1){socket[_0x1d35('0xc2')](_0x1d35('0xc3'),{'UserId':Number(_0x3bbf1b[_0x1d35('0x42')]['ids'][_0x48f14b]),'FaxAccountId':Number(_0x3bbf1b[_0x1d35('0x54')]['id'])});}}else{socket[_0x1d35('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x3bbf1b[_0x1d35('0x42')]['ids']),'FaxAccountId':Number(_0x3bbf1b['params']['id'])});}});}})[_0x1d35('0x1f')](respondWithStatusCode(_0x3748c2,null))[_0x1d35('0x53')](handleError(_0x3748c2,null));};exports[_0x1d35('0xc4')]=function(_0x262322,_0x394cf1,_0x126199){var _0xa1653e={};var _0x1be753={};var _0x3fbb95;var _0x2e1c89;return db[_0x1d35('0x3e')][_0x1d35('0x65')]({'where':{'id':_0x262322[_0x1d35('0x54')]['id']}})[_0x1d35('0x1f')](handleEntityNotFound(_0x394cf1,null))[_0x1d35('0x1f')](function(_0x2bc73d){if(_0x2bc73d){_0x3fbb95=_0x2bc73d;_0x1be753[_0x1d35('0x40')]=_[_0x1d35('0x55')](db['User'][_0x1d35('0x56')]);_0x1be753[_0x1d35('0x42')]=_['keys'](_0x262322[_0x1d35('0x42')]);_0x1be753[_0x1d35('0x43')]=_[_0x1d35('0x44')](_0x1be753[_0x1d35('0x40')],_0x1be753[_0x1d35('0x42')]);_0xa1653e[_0x1d35('0x46')]=_[_0x1d35('0x44')](_0x1be753[_0x1d35('0x40')],qs[_0x1d35('0x45')](_0x262322['query'][_0x1d35('0x45')]));_0xa1653e[_0x1d35('0x46')]=_0xa1653e['attributes'][_0x1d35('0x57')]?_0xa1653e[_0x1d35('0x46')]:_0x1be753[_0x1d35('0x40')];_0xa1653e['order']=qs[_0x1d35('0x49')](_0x262322[_0x1d35('0x42')][_0x1d35('0x49')]);_0xa1653e[_0x1d35('0x4c')]=qs[_0x1d35('0x43')](_[_0x1d35('0x4a')](_0x262322[_0x1d35('0x42')],_0x1be753[_0x1d35('0x43')]));if(_0x262322[_0x1d35('0x42')][_0x1d35('0x4b')]){_0xa1653e[_0x1d35('0x4c')]=_['merge'](_0xa1653e['where'],{'$or':_[_0x1d35('0x41')](_0xa1653e[_0x1d35('0x46')],function(_0x3e7a39){var _0x3a061e={};_0x3a061e[_0x3e7a39]={'$like':'%'+_0x262322['query'][_0x1d35('0x4b')]+'%'};return _0x3a061e;})});}_0xa1653e=_[_0x1d35('0x4d')]({},_0xa1653e,_0x262322[_0x1d35('0x4f')]);return _0x3fbb95[_0x1d35('0xc4')](_0xa1653e);}})[_0x1d35('0x1f')](function(_0xc7802a){if(_0xc7802a){_0x2e1c89=_0xc7802a[_0x1d35('0x57')];if(!_0x262322[_0x1d35('0x42')][_0x1d35('0x47')](_0x1d35('0x6c'))){_0xa1653e[_0x1d35('0x2c')]=qs[_0x1d35('0x2c')](_0x262322[_0x1d35('0x42')][_0x1d35('0x2c')]);_0xa1653e[_0x1d35('0x2b')]=qs['offset'](_0x262322[_0x1d35('0x42')][_0x1d35('0x2b')]);}return _0x3fbb95['getAgents'](_0xa1653e);}})[_0x1d35('0x1f')](function(_0x1bc380){if(_0x1bc380){return _0x1bc380?{'count':_0x2e1c89,'rows':_0x1bc380}:null;}})['then'](respondWithResult(_0x394cf1,null))[_0x1d35('0x53')](handleError(_0x394cf1,null));}; \ No newline at end of file +var _0x4d8d=['rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','hasOwnProperty','nolimit','removeDispositions','addAnswer','FaxAccountId','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','findOne','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','VoiceExtension','omit','tech','key','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','CmList','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','List','Send\x20Fax\x20failed','user','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','FaxAccounts','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','Pause'];(function(_0x1c7686,_0x5ac25f){var _0x11b2d8=function(_0x3408c8){while(--_0x3408c8){_0x1c7686['push'](_0x1c7686['shift']());}};_0x11b2d8(++_0x5ac25f);}(_0x4d8d,0x6b));var _0xd4d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4d8d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd4d8('0x0'));var rimraf=require(_0xd4d8('0x1'));var zipdir=require(_0xd4d8('0x2'));var jsonpatch=require(_0xd4d8('0x3'));var rp=require(_0xd4d8('0x4'));var moment=require(_0xd4d8('0x5'));var BPromise=require(_0xd4d8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd4d8('0x7'));var csv=require('to-csv');var ejs=require(_0xd4d8('0x8'));var fs=require('fs');var fs_extra=require(_0xd4d8('0x9'));var _=require(_0xd4d8('0xa'));var squel=require(_0xd4d8('0xb'));var crypto=require('crypto');var jsforce=require(_0xd4d8('0xc'));var deskjs=require(_0xd4d8('0xd'));var toCsv=require(_0xd4d8('0xe'));var querystring=require(_0xd4d8('0xf'));var Papa=require(_0xd4d8('0x10'));var Redis=require(_0xd4d8('0x11'));var authService=require(_0xd4d8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4d8('0x13'))(_0xd4d8('0x14'));var utils=require(_0xd4d8('0x15'));var config=require(_0xd4d8('0x16'));var licenseUtil=require(_0xd4d8('0x17'));var db=require(_0xd4d8('0x18'))['db'];config[_0xd4d8('0x19')]=_[_0xd4d8('0x1a')](config[_0xd4d8('0x19')],{'host':_0xd4d8('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4d8('0x19')]));require(_0xd4d8('0x1c'))[_0xd4d8('0x1d')](socket);var jayson=require(_0xd4d8('0x1e'));var client=jayson[_0xd4d8('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xd4d8('0x1f')][_0xd4d8('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x333568,_0x46ae8c,_0x4960a5,_0x1b7065){return new BPromise(function(_0x446b70,_0x438c09){var _0x1a1e41=_0x1b7065||client;return _0x1a1e41[_0xd4d8('0x21')](_0x333568,_0x4960a5)['then'](function(_0x3c8a66){logger[_0xd4d8('0x22')](_0xd4d8('0x23'),_0x46ae8c,'request\x20sent');logger['debug'](_0xd4d8('0x24'),_0x46ae8c,_0xd4d8('0x25'),JSON['stringify'](_0x3c8a66));if(_0x3c8a66[_0xd4d8('0x26')]){if(_0x3c8a66[_0xd4d8('0x26')][_0xd4d8('0x27')]===0x1f4){logger[_0xd4d8('0x26')](_0xd4d8('0x23'),_0x46ae8c,_0x3c8a66[_0xd4d8('0x26')]['message']);return _0x438c09(_0x3c8a66['error'][_0xd4d8('0x28')]);}logger['error'](_0xd4d8('0x23'),_0x46ae8c,_0x3c8a66[_0xd4d8('0x26')][_0xd4d8('0x28')]);return _0x446b70(_0x3c8a66['error']['message']);}else{logger[_0xd4d8('0x22')](_0xd4d8('0x23'),_0x46ae8c,_0xd4d8('0x25'));_0x446b70(_0x3c8a66[_0xd4d8('0x29')][_0xd4d8('0x28')]);}})[_0xd4d8('0x2a')](function(_0x1c3fbd){logger[_0xd4d8('0x26')](_0xd4d8('0x23'),_0x46ae8c,_0x1c3fbd);_0x438c09(_0x1c3fbd);});});}function respondWithStatusCode(_0x251d15,_0x586a8e){_0x586a8e=_0x586a8e||0xcc;return function(_0x164025){if(_0x164025){return _0x251d15[_0xd4d8('0x2b')](_0x586a8e);}return _0x251d15['status'](_0x586a8e)['end']();};}function respondWithResult(_0x1333e9,_0x201e2a){_0x201e2a=_0x201e2a||0xc8;return function(_0x52d3b4){if(_0x52d3b4){return _0x1333e9[_0xd4d8('0x2c')](_0x201e2a)[_0xd4d8('0x2d')](_0x52d3b4);}};}function respondWithFilteredResult(_0x140ed0,_0x473fbc){return function(_0x193ec7){if(_0x193ec7){var _0x4c2d42=typeof _0x473fbc[_0xd4d8('0x2e')]===_0xd4d8('0x2f')&&typeof _0x473fbc[_0xd4d8('0x30')]===_0xd4d8('0x2f');var _0x6bee9e=_0x193ec7[_0xd4d8('0x31')];var _0x4853b7=_0x4c2d42?0x0:_0x473fbc[_0xd4d8('0x2e')];var _0x1a6f72=_0x4c2d42?_0x193ec7[_0xd4d8('0x31')]:_0x473fbc[_0xd4d8('0x2e')]+_0x473fbc[_0xd4d8('0x30')];var _0x545663;if(_0x1a6f72>=_0x6bee9e){_0x1a6f72=_0x6bee9e;_0x545663=0xc8;}else{_0x545663=0xce;}_0x140ed0[_0xd4d8('0x2c')](_0x545663);return _0x140ed0[_0xd4d8('0x32')](_0xd4d8('0x33'),_0x4853b7+'-'+_0x1a6f72+'/'+_0x6bee9e)[_0xd4d8('0x2d')](_0x193ec7);}return null;};}function patchUpdates(_0xd95c57){return function(_0x27128b){try{jsonpatch['apply'](_0x27128b,_0xd95c57,!![]);}catch(_0x552bc7){return BPromise[_0xd4d8('0x34')](_0x552bc7);}return _0x27128b[_0xd4d8('0x35')]();};}function saveUpdates(_0x1f8b45,_0x4ca332){return function(_0xaadaed){if(_0xaadaed){return _0xaadaed[_0xd4d8('0x36')](_0x1f8b45)[_0xd4d8('0x37')](function(_0x20b951){return _0x20b951;});}return null;};}function removeEntity(_0x2814e7,_0x4723cb){return function(_0x32cd56){if(_0x32cd56){return _0x32cd56[_0xd4d8('0x38')]()['then'](function(){var _0x487b15=_0x32cd56[_0xd4d8('0x39')]({'plain':!![]});var _0xd073ac=_0xd4d8('0x3a');return db['UserProfileResource'][_0xd4d8('0x38')]({'where':{'type':_0xd073ac,'resourceId':_0x487b15['id']}})[_0xd4d8('0x37')](function(){return _0x32cd56;});})[_0xd4d8('0x37')](function(){_0x2814e7[_0xd4d8('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14bcb4,_0x36c02d){return function(_0x92b9de){if(!_0x92b9de){_0x14bcb4[_0xd4d8('0x2b')](0x194);}return _0x92b9de;};}function handleError(_0x197340,_0x24438d){_0x24438d=_0x24438d||0x1f4;return function(_0x203802){logger[_0xd4d8('0x26')](_0x203802[_0xd4d8('0x3b')]);if(_0x203802[_0xd4d8('0x3c')]){delete _0x203802[_0xd4d8('0x3c')];}_0x197340[_0xd4d8('0x2c')](_0x24438d)[_0xd4d8('0x3d')](_0x203802);};}exports[_0xd4d8('0x3e')]=function(_0x20f2fb,_0x580387){var _0x24170a={'include':[{'model':db['Pause'],'as':_0xd4d8('0x3f')}]},_0x34b64c={},_0x55e7fa={'count':0x0,'rows':[]};var _0x4944f3=_[_0xd4d8('0x40')](db[_0xd4d8('0x41')]['rawAttributes'],function(_0x5a996a){return{'name':_0x5a996a[_0xd4d8('0x42')],'type':_0x5a996a[_0xd4d8('0x43')]['key']};});_0x34b64c[_0xd4d8('0x44')]=_[_0xd4d8('0x40')](_0x4944f3,'name');_0x34b64c[_0xd4d8('0x45')]=_[_0xd4d8('0x46')](_0x20f2fb[_0xd4d8('0x45')]);_0x34b64c[_0xd4d8('0x47')]=_[_0xd4d8('0x48')](_0x34b64c['model'],_0x34b64c[_0xd4d8('0x45')]);_0x24170a[_0xd4d8('0x49')]=_[_0xd4d8('0x48')](_0x34b64c[_0xd4d8('0x44')],qs[_0xd4d8('0x4a')](_0x20f2fb['query'][_0xd4d8('0x4a')]));_0x24170a[_0xd4d8('0x49')]=_0x24170a[_0xd4d8('0x49')][_0xd4d8('0x4b')]?_0x24170a['attributes']:_0x34b64c[_0xd4d8('0x44')];if(!_0x20f2fb[_0xd4d8('0x45')]['hasOwnProperty']('nolimit')){_0x24170a['limit']=qs[_0xd4d8('0x30')](_0x20f2fb[_0xd4d8('0x45')]['limit']);_0x24170a[_0xd4d8('0x2e')]=qs['offset'](_0x20f2fb[_0xd4d8('0x45')][_0xd4d8('0x2e')]);}_0x24170a[_0xd4d8('0x4c')]=qs[_0xd4d8('0x4d')](_0x20f2fb[_0xd4d8('0x45')][_0xd4d8('0x4d')]);_0x24170a[_0xd4d8('0x4e')]=qs[_0xd4d8('0x47')](_[_0xd4d8('0x4f')](_0x20f2fb[_0xd4d8('0x45')],_0x34b64c[_0xd4d8('0x47')]),_0x4944f3);if(_0x20f2fb[_0xd4d8('0x45')][_0xd4d8('0x50')]){_0x24170a[_0xd4d8('0x4e')]=_[_0xd4d8('0x51')](_0x24170a['where'],{'$or':_['map'](_0x4944f3,function(_0x594411){if(_0x594411[_0xd4d8('0x43')]!==_0xd4d8('0x52')){var _0x17ef8f={};_0x17ef8f[_0x594411[_0xd4d8('0x3c')]]={'$like':'%'+_0x20f2fb[_0xd4d8('0x45')]['filter']+'%'};return _0x17ef8f;}})});}_0x24170a=_[_0xd4d8('0x51')]({},_0x24170a,_0x20f2fb['options']);var _0x339dd6={'where':_0x24170a[_0xd4d8('0x4e')]};return db[_0xd4d8('0x41')][_0xd4d8('0x31')](_0x339dd6)['then'](function(_0x261835){_0x55e7fa[_0xd4d8('0x31')]=_0x261835;if(_0x20f2fb[_0xd4d8('0x45')][_0xd4d8('0x53')]){_0x24170a[_0xd4d8('0x54')]=[{'all':!![]}];}return db[_0xd4d8('0x41')][_0xd4d8('0x55')](_0x24170a);})[_0xd4d8('0x37')](function(_0x567066){_0x55e7fa[_0xd4d8('0x56')]=_0x567066;return _0x55e7fa;})[_0xd4d8('0x37')](respondWithFilteredResult(_0x580387,_0x24170a))['catch'](handleError(_0x580387,null));};exports['show']=function(_0x321434,_0x52fc5a){var _0x12017d={'raw':![],'where':{'id':_0x321434[_0xd4d8('0x57')]['id']},'include':[{'model':db[_0xd4d8('0x58')],'as':_0xd4d8('0x3f')}]},_0x189c6b={};_0x189c6b[_0xd4d8('0x44')]=_['keys'](db[_0xd4d8('0x41')][_0xd4d8('0x59')]);_0x189c6b['query']=_[_0xd4d8('0x46')](_0x321434[_0xd4d8('0x45')]);_0x189c6b[_0xd4d8('0x47')]=_[_0xd4d8('0x48')](_0x189c6b[_0xd4d8('0x44')],_0x189c6b['query']);_0x12017d['attributes']=_['intersection'](_0x189c6b[_0xd4d8('0x44')],qs[_0xd4d8('0x4a')](_0x321434[_0xd4d8('0x45')][_0xd4d8('0x4a')]));_0x12017d[_0xd4d8('0x49')]=_0x12017d['attributes'][_0xd4d8('0x4b')]?_0x12017d[_0xd4d8('0x49')]:_0x189c6b[_0xd4d8('0x44')];if(_0x321434['query'][_0xd4d8('0x53')]){_0x12017d['include']=[{'all':!![]}];}_0x12017d=_[_0xd4d8('0x51')]({},_0x12017d,_0x321434[_0xd4d8('0x5a')]);return db[_0xd4d8('0x41')][_0xd4d8('0x5b')](_0x12017d)[_0xd4d8('0x37')](handleEntityNotFound(_0x52fc5a,null))['then'](respondWithResult(_0x52fc5a,null))[_0xd4d8('0x2a')](handleError(_0x52fc5a,null));};exports[_0xd4d8('0x5c')]=function(_0x32520f,_0x47edd1){return db[_0xd4d8('0x41')]['create'](_0x32520f[_0xd4d8('0x5d')],{})[_0xd4d8('0x37')](function(_0x4a0ab2){var _0x4f3e19=_0x32520f['user'][_0xd4d8('0x39')]({'plain':!![]});if(!_0x4f3e19)throw new Error(_0xd4d8('0x5e'));if(_0x4f3e19[_0xd4d8('0x5f')]==='user'){var _0x4198a5=_0x4a0ab2['get']({'plain':!![]});var _0x3de380=_0xd4d8('0x3a');return db[_0xd4d8('0x60')][_0xd4d8('0x5b')]({'where':{'name':_0x3de380,'userProfileId':_0x4f3e19['userProfileId']},'raw':!![]})['then'](function(_0x34b82b){if(_0x34b82b&&_0x34b82b[_0xd4d8('0x61')]===0x0){return db[_0xd4d8('0x62')][_0xd4d8('0x5c')]({'name':_0x4198a5[_0xd4d8('0x3c')],'resourceId':_0x4198a5['id'],'type':_0x34b82b[_0xd4d8('0x3c')],'sectionId':_0x34b82b['id']},{})[_0xd4d8('0x37')](function(){return _0x4a0ab2;});}else{return _0x4a0ab2;}})[_0xd4d8('0x2a')](function(_0x5bac22){logger[_0xd4d8('0x26')](_0xd4d8('0x63'),_0x5bac22);throw _0x5bac22;});}return _0x4a0ab2;})[_0xd4d8('0x37')](respondWithResult(_0x47edd1,0xc9))['catch'](handleError(_0x47edd1,null));};exports[_0xd4d8('0x36')]=function(_0x26231f,_0x3d17bd){if(_0x26231f[_0xd4d8('0x5d')]['id']){delete _0x26231f[_0xd4d8('0x5d')]['id'];}return db['FaxAccount'][_0xd4d8('0x5b')]({'where':{'id':_0x26231f[_0xd4d8('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd4d8('0x3f')}]})['then'](handleEntityNotFound(_0x3d17bd,null))[_0xd4d8('0x37')](saveUpdates(_0x26231f[_0xd4d8('0x5d')],null))[_0xd4d8('0x37')](respondWithResult(_0x3d17bd,null))[_0xd4d8('0x2a')](handleError(_0x3d17bd,null));};exports[_0xd4d8('0x38')]=function(_0x161c32,_0x560aeb){return db['FaxAccount'][_0xd4d8('0x5b')]({'where':{'id':_0x161c32['params']['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x560aeb,null))[_0xd4d8('0x37')](removeEntity(_0x560aeb,null))[_0xd4d8('0x2a')](handleError(_0x560aeb,null));};exports['describe']=function(_0x43d23c,_0x335a95){return db[_0xd4d8('0x41')][_0xd4d8('0x64')]()[_0xd4d8('0x37')](respondWithResult(_0x335a95,null))['catch'](handleError(_0x335a95,null));};exports[_0xd4d8('0x65')]=function(_0x2557b4,_0x1f9dcd,_0x278dd6){if(_0x2557b4[_0xd4d8('0x5d')]['id']){delete _0x2557b4['body']['id'];}return db[_0xd4d8('0x41')][_0xd4d8('0x5b')]({'where':{'id':_0x2557b4['params']['id']}})['then'](handleEntityNotFound(_0x1f9dcd,null))[_0xd4d8('0x37')](function(_0x383a36){if(_0x383a36){_0x2557b4[_0xd4d8('0x5d')]['FaxAccountId']=_0x383a36['id'];return db[_0xd4d8('0x66')][_0xd4d8('0x5c')](_0x2557b4[_0xd4d8('0x5d')]);}})[_0xd4d8('0x37')](respondWithResult(_0x1f9dcd,null))[_0xd4d8('0x2a')](handleError(_0x1f9dcd,null));};exports[_0xd4d8('0x67')]=function(_0x32699e,_0x3671ed,_0x5d0704){var _0x41d1d0={'raw':![],'where':{}};var _0x1d14e4={};var _0x131198={'count':0x0,'rows':[]};return db[_0xd4d8('0x41')]['findOne']({'where':{'id':_0x32699e['params']['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x3671ed,null))[_0xd4d8('0x37')](function(_0x5c17f9){if(_0x5c17f9){_0x1d14e4[_0xd4d8('0x44')]=_['keys'](db[_0xd4d8('0x66')][_0xd4d8('0x59')]);_0x1d14e4[_0xd4d8('0x45')]=_[_0xd4d8('0x46')](_0x32699e['query']);_0x1d14e4[_0xd4d8('0x47')]=_['intersection'](_0x1d14e4['model'],_0x1d14e4['query']);_0x41d1d0['attributes']=_[_0xd4d8('0x48')](_0x1d14e4[_0xd4d8('0x44')],qs['fields'](_0x32699e[_0xd4d8('0x45')][_0xd4d8('0x4a')]));_0x41d1d0['attributes']=_0x41d1d0[_0xd4d8('0x49')][_0xd4d8('0x4b')]?_0x41d1d0['attributes']:_0x1d14e4[_0xd4d8('0x44')];if(!_0x32699e[_0xd4d8('0x45')][_0xd4d8('0x68')](_0xd4d8('0x69'))){_0x41d1d0[_0xd4d8('0x30')]=qs[_0xd4d8('0x30')](_0x32699e['query'][_0xd4d8('0x30')]);_0x41d1d0['offset']=qs[_0xd4d8('0x2e')](_0x32699e[_0xd4d8('0x45')][_0xd4d8('0x2e')]);}_0x41d1d0[_0xd4d8('0x4c')]=qs[_0xd4d8('0x4d')](_0x32699e[_0xd4d8('0x45')][_0xd4d8('0x4d')]);_0x41d1d0['where']=qs[_0xd4d8('0x47')](_['pick'](_0x32699e[_0xd4d8('0x45')],_0x1d14e4['filters']));_0x41d1d0[_0xd4d8('0x4e')]['FaxAccountId']=_0x5c17f9['id'];if(_0x32699e['query'][_0xd4d8('0x50')]){_0x41d1d0[_0xd4d8('0x4e')]=_[_0xd4d8('0x51')](_0x41d1d0[_0xd4d8('0x4e')],{'$or':_[_0xd4d8('0x40')](_0x41d1d0['attributes'],function(_0x170c62){var _0x39bf61={};_0x39bf61[_0x170c62]={'$like':'%'+_0x32699e[_0xd4d8('0x45')][_0xd4d8('0x50')]+'%'};return _0x39bf61;})});}_0x41d1d0=_[_0xd4d8('0x51')]({},_0x41d1d0,_0x32699e[_0xd4d8('0x5a')]);return db[_0xd4d8('0x66')]['count']({'where':_0x41d1d0[_0xd4d8('0x4e')]})[_0xd4d8('0x37')](function(_0x54c6f7){_0x131198['count']=_0x54c6f7;if(_0x32699e[_0xd4d8('0x45')][_0xd4d8('0x53')]){_0x41d1d0[_0xd4d8('0x54')]=[{'all':!![]}];}return db[_0xd4d8('0x66')][_0xd4d8('0x55')](_0x41d1d0);})[_0xd4d8('0x37')](function(_0x17538a){_0x131198['rows']=_0x17538a;return _0x131198;});}})['then'](respondWithFilteredResult(_0x3671ed,_0x41d1d0))['catch'](handleError(_0x3671ed,null));};exports['removeDispositions']=function(_0x1a9bc8,_0x186633,_0x35b917){return db[_0xd4d8('0x41')][_0xd4d8('0x5b')]({'where':{'id':_0x1a9bc8[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x186633,null))[_0xd4d8('0x37')](function(_0x890ffe){if(_0x890ffe){return _0x890ffe[_0xd4d8('0x6a')](_0x1a9bc8[_0xd4d8('0x45')]['ids']);}})[_0xd4d8('0x37')](respondWithStatusCode(_0x186633,null))['catch'](handleError(_0x186633,null));};exports[_0xd4d8('0x6b')]=function(_0x135682,_0x46bb08,_0x3ba00c){if(_0x135682[_0xd4d8('0x5d')]['id']){delete _0x135682[_0xd4d8('0x5d')]['id'];}return db['FaxAccount'][_0xd4d8('0x5b')]({'where':{'id':_0x135682[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x46bb08,null))[_0xd4d8('0x37')](function(_0x57de02){if(_0x57de02){_0x135682[_0xd4d8('0x5d')][_0xd4d8('0x6c')]=_0x57de02['id'];return db[_0xd4d8('0x6d')][_0xd4d8('0x5c')](_0x135682[_0xd4d8('0x5d')]);}})['then'](respondWithResult(_0x46bb08,null))['catch'](handleError(_0x46bb08,null));};exports['getAnswers']=function(_0x2eb3f5,_0x5d5fef,_0x535544){var _0x4f626e={'raw':![],'where':{}};var _0x9e5763={};var _0x2d6dfb={'count':0x0,'rows':[]};return db[_0xd4d8('0x41')]['findOne']({'where':{'id':_0x2eb3f5['params']['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x5d5fef,null))[_0xd4d8('0x37')](function(_0x592819){if(_0x592819){_0x9e5763['model']=_['keys'](db['CannedAnswer'][_0xd4d8('0x59')]);_0x9e5763[_0xd4d8('0x45')]=_[_0xd4d8('0x46')](_0x2eb3f5[_0xd4d8('0x45')]);_0x9e5763[_0xd4d8('0x47')]=_[_0xd4d8('0x48')](_0x9e5763[_0xd4d8('0x44')],_0x9e5763['query']);_0x4f626e[_0xd4d8('0x49')]=_[_0xd4d8('0x48')](_0x9e5763[_0xd4d8('0x44')],qs[_0xd4d8('0x4a')](_0x2eb3f5[_0xd4d8('0x45')][_0xd4d8('0x4a')]));_0x4f626e[_0xd4d8('0x49')]=_0x4f626e[_0xd4d8('0x49')][_0xd4d8('0x4b')]?_0x4f626e[_0xd4d8('0x49')]:_0x9e5763[_0xd4d8('0x44')];if(!_0x2eb3f5[_0xd4d8('0x45')][_0xd4d8('0x68')](_0xd4d8('0x69'))){_0x4f626e[_0xd4d8('0x30')]=qs[_0xd4d8('0x30')](_0x2eb3f5[_0xd4d8('0x45')][_0xd4d8('0x30')]);_0x4f626e[_0xd4d8('0x2e')]=qs[_0xd4d8('0x2e')](_0x2eb3f5[_0xd4d8('0x45')][_0xd4d8('0x2e')]);}_0x4f626e['order']=qs[_0xd4d8('0x4d')](_0x2eb3f5[_0xd4d8('0x45')]['sort']);_0x4f626e['where']=qs[_0xd4d8('0x47')](_['pick'](_0x2eb3f5[_0xd4d8('0x45')],_0x9e5763[_0xd4d8('0x47')]));_0x4f626e[_0xd4d8('0x4e')][_0xd4d8('0x6c')]=_0x592819['id'];if(_0x2eb3f5[_0xd4d8('0x45')][_0xd4d8('0x50')]){_0x4f626e[_0xd4d8('0x4e')]=_[_0xd4d8('0x51')](_0x4f626e['where'],{'$or':_['map'](_0x4f626e[_0xd4d8('0x49')],function(_0x860d23){var _0x20d0e2={};_0x20d0e2[_0x860d23]={'$like':'%'+_0x2eb3f5['query'][_0xd4d8('0x50')]+'%'};return _0x20d0e2;})});}_0x4f626e=_[_0xd4d8('0x51')]({},_0x4f626e,_0x2eb3f5[_0xd4d8('0x5a')]);return db[_0xd4d8('0x6d')][_0xd4d8('0x31')]({'where':_0x4f626e[_0xd4d8('0x4e')]})[_0xd4d8('0x37')](function(_0x33b11f){_0x2d6dfb[_0xd4d8('0x31')]=_0x33b11f;if(_0x2eb3f5[_0xd4d8('0x45')][_0xd4d8('0x53')]){_0x4f626e[_0xd4d8('0x54')]=[{'all':!![]}];}return db[_0xd4d8('0x6d')][_0xd4d8('0x55')](_0x4f626e);})[_0xd4d8('0x37')](function(_0x311100){_0x2d6dfb[_0xd4d8('0x56')]=_0x311100;return _0x2d6dfb;});}})[_0xd4d8('0x37')](respondWithFilteredResult(_0x5d5fef,_0x4f626e))[_0xd4d8('0x2a')](handleError(_0x5d5fef,null));};exports[_0xd4d8('0x6e')]=function(_0x3a316d,_0xb7ca78,_0x1835b7){return db[_0xd4d8('0x41')][_0xd4d8('0x5b')]({'where':{'id':_0x3a316d[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0xb7ca78,null))[_0xd4d8('0x37')](function(_0x1f2480){if(_0x1f2480){return _0x1f2480['removeAnswers'](_0x3a316d['query'][_0xd4d8('0x6f')]);}})['then'](respondWithStatusCode(_0xb7ca78,null))[_0xd4d8('0x2a')](handleError(_0xb7ca78,null));};exports[_0xd4d8('0x70')]=function(_0x64d9b5,_0x26fbe9,_0x47580d){return db[_0xd4d8('0x71')][_0xd4d8('0x5b')]({'where':{'id':_0x64d9b5[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x26fbe9,null))[_0xd4d8('0x37')](function(_0x4da052){if(_0x4da052){return _0x4da052[_0xd4d8('0x70')](_0x64d9b5[_0xd4d8('0x5d')]['ids'],_['omit'](_0x64d9b5[_0xd4d8('0x5d')],[_0xd4d8('0x6f'),'id'])||{});}})[_0xd4d8('0x37')](respondWithResult(_0x26fbe9,null))[_0xd4d8('0x2a')](handleError(_0x26fbe9,null));};exports['getInteractions']=function(_0x46905b,_0x17378a,_0x17c887){var _0x2e5635={'raw':![],'where':{}};var _0xa62283={};var _0x30d729={'count':0x0,'rows':[]};return db[_0xd4d8('0x41')][_0xd4d8('0x72')]({'where':{'id':_0x46905b[_0xd4d8('0x57')]['id']}})['then'](handleEntityNotFound(_0x17378a,null))[_0xd4d8('0x37')](function(_0x169a3e){if(_0x169a3e){_0xa62283['model']=_[_0xd4d8('0x46')](db[_0xd4d8('0x71')][_0xd4d8('0x59')]);_0xa62283['query']=_['keys'](_0x46905b[_0xd4d8('0x45')]);_0xa62283[_0xd4d8('0x47')]=_['intersection'](_0xa62283[_0xd4d8('0x44')],_0xa62283[_0xd4d8('0x45')]);_0x2e5635[_0xd4d8('0x49')]=_[_0xd4d8('0x48')](_0xa62283[_0xd4d8('0x44')],qs[_0xd4d8('0x4a')](_0x46905b['query'][_0xd4d8('0x4a')]));_0x2e5635[_0xd4d8('0x49')]=_0x2e5635['attributes'][_0xd4d8('0x4b')]?_0x2e5635[_0xd4d8('0x49')]:_0xa62283[_0xd4d8('0x44')];if(!_0x46905b[_0xd4d8('0x45')]['hasOwnProperty'](_0xd4d8('0x69'))){_0x2e5635[_0xd4d8('0x30')]=qs[_0xd4d8('0x30')](_0x46905b[_0xd4d8('0x45')][_0xd4d8('0x30')]);_0x2e5635[_0xd4d8('0x2e')]=qs[_0xd4d8('0x2e')](_0x46905b[_0xd4d8('0x45')][_0xd4d8('0x2e')]);}_0x2e5635['order']=qs['sort'](_0x46905b[_0xd4d8('0x45')]['sort']);_0x2e5635[_0xd4d8('0x4e')]=qs[_0xd4d8('0x47')](_['pick'](_0x46905b[_0xd4d8('0x45')],_0xa62283[_0xd4d8('0x47')]));_0x2e5635[_0xd4d8('0x4e')][_0xd4d8('0x6c')]=_0x169a3e['id'];if(_0x46905b[_0xd4d8('0x45')][_0xd4d8('0x50')]){_0x2e5635['where']=_[_0xd4d8('0x51')](_0x2e5635[_0xd4d8('0x4e')],{'$or':_[_0xd4d8('0x40')](_0x2e5635['attributes'],function(_0x417189){var _0x571dcd={};_0x571dcd[_0x417189]={'$like':'%'+_0x46905b['query'][_0xd4d8('0x50')]+'%'};return _0x571dcd;})});}_0x2e5635=_[_0xd4d8('0x51')]({},_0x2e5635,_0x46905b[_0xd4d8('0x5a')]);return db[_0xd4d8('0x71')][_0xd4d8('0x31')]({'where':_0x2e5635[_0xd4d8('0x4e')]})[_0xd4d8('0x37')](function(_0x2a11ac){_0x30d729[_0xd4d8('0x31')]=_0x2a11ac;if(_0x46905b['query']['includeAll']){_0x2e5635[_0xd4d8('0x54')]=[{'model':db[_0xd4d8('0x73')],'as':_0xd4d8('0x74'),'required':![]},{'model':db[_0xd4d8('0x75')],'as':'Owner','attributes':[_0xd4d8('0x3c'),'fullname',_0xd4d8('0x76')],'required':![]},{'model':db[_0xd4d8('0x77')],'as':_0xd4d8('0x78'),'attributes':['id','name',_0xd4d8('0x79')],'where':_0x46905b[_0xd4d8('0x45')][_0xd4d8('0x7a')]?{'id':_0x46905b[_0xd4d8('0x45')]['tag']}:undefined,'required':_0x46905b[_0xd4d8('0x45')][_0xd4d8('0x7a')]?!![]:![]}];}return db['FaxInteraction'][_0xd4d8('0x55')](_0x2e5635);})[_0xd4d8('0x37')](function(_0x4e2925){_0x30d729[_0xd4d8('0x56')]=_0x4e2925;return _0x30d729;});}})[_0xd4d8('0x37')](respondWithFilteredResult(_0x17378a,_0x2e5635))['catch'](handleError(_0x17378a,null));};exports[_0xd4d8('0x7b')]=function(_0x94b0b4,_0x27797e){var _0x3a4602=_0x94b0b4['params']['id'];var _0x26d97a=_0x94b0b4[_0xd4d8('0x5d')];var _0x2a092e=0xc8;var _0x556a53=null;return db['sequelize'][_0xd4d8('0x7c')]({'isolationLevel':db[_0xd4d8('0x7d')]['Transaction'][_0xd4d8('0x7e')][_0xd4d8('0x7f')]},function(_0x4b8d24){return db[_0xd4d8('0x41')][_0xd4d8('0x72')]({'where':{'id':_0x3a4602},'transaction':_0x4b8d24})[_0xd4d8('0x37')](function(_0x1abf2b){if(_0x1abf2b){return db[_0xd4d8('0x80')]['destroy']({'where':{'FaxAccountId':_0x3a4602},'transaction':_0x4b8d24})['then'](function(){var _0xe698d7=_[_0xd4d8('0x40')](_0x26d97a,function(_0x49161b){_0x49161b[_0xd4d8('0x6c')]=_0x3a4602;return _0x49161b;});return db[_0xd4d8('0x80')][_0xd4d8('0x81')](_0xe698d7,{'transaction':_0x4b8d24});});}else{_0x2a092e=0x194;_0x556a53=[];}});})[_0xd4d8('0x37')](function(){if(_0x2a092e!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x3a4602},'order':_0xd4d8('0x82')})[_0xd4d8('0x37')](function(_0x51c6e2){_0x556a53=_0x51c6e2;});}})[_0xd4d8('0x2a')](function(_0x411350){_0x2a092e=0x1f4;logger['error'](_0x411350['stack']);if(_0x411350['name']){delete _0x411350[_0xd4d8('0x3c')];}_0x556a53=_0x411350;})[_0xd4d8('0x83')](function(){if(_0x556a53===null){_0x27797e[_0xd4d8('0x2b')](_0x2a092e);}else{if(_0x2a092e===0x1f4){_0x27797e[_0xd4d8('0x2c')](_0x2a092e)[_0xd4d8('0x3d')](_0x556a53);}else{_0x27797e['status'](_0x2a092e)[_0xd4d8('0x2d')](_0x556a53);}}});};exports[_0xd4d8('0x84')]=function(_0x124bc4,_0x1c5d39,_0x49b7eb){var _0x65c6a3={};var _0x20b13c={};var _0x5ea9ce;var _0x3f643e;return db['FaxAccount'][_0xd4d8('0x72')]({'where':{'id':_0x124bc4[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x1c5d39,null))[_0xd4d8('0x37')](function(_0x832c7){if(_0x832c7){_0x5ea9ce=_0x832c7;_0x20b13c['model']=_[_0xd4d8('0x46')](db[_0xd4d8('0x80')][_0xd4d8('0x59')]);_0x20b13c['query']=_[_0xd4d8('0x46')](_0x124bc4[_0xd4d8('0x45')]);_0x20b13c['filters']=_[_0xd4d8('0x48')](_0x20b13c[_0xd4d8('0x44')],_0x20b13c['query']);_0x65c6a3[_0xd4d8('0x49')]=_[_0xd4d8('0x48')](_0x20b13c[_0xd4d8('0x44')],qs[_0xd4d8('0x4a')](_0x124bc4['query'][_0xd4d8('0x4a')]));_0x65c6a3[_0xd4d8('0x49')]=_0x65c6a3[_0xd4d8('0x49')]['length']?_0x65c6a3['attributes']:_0x20b13c['model'];_0x65c6a3[_0xd4d8('0x4c')]=qs[_0xd4d8('0x4d')](_0x124bc4[_0xd4d8('0x45')][_0xd4d8('0x4d')]);_0x65c6a3['where']=qs['filters'](_['pick'](_0x124bc4[_0xd4d8('0x45')],_0x20b13c[_0xd4d8('0x47')]));if(_0x124bc4['query'][_0xd4d8('0x50')]){_0x65c6a3[_0xd4d8('0x4e')]=_[_0xd4d8('0x51')](_0x65c6a3[_0xd4d8('0x4e')],{'$or':_['map'](_0x65c6a3[_0xd4d8('0x49')],function(_0xf52afc){var _0x185fb8={};_0x185fb8[_0xf52afc]={'$like':'%'+_0x124bc4['query']['filter']+'%'};return _0x185fb8;})});}_0x65c6a3=_[_0xd4d8('0x51')]({},_0x65c6a3,_0x124bc4[_0xd4d8('0x5a')]);return _0x5ea9ce[_0xd4d8('0x84')](_0x65c6a3);}})[_0xd4d8('0x37')](function(_0x36592b){if(_0x36592b){_0x3f643e=_0x36592b['length'];if(!_0x124bc4['query'][_0xd4d8('0x68')]('nolimit')){_0x65c6a3[_0xd4d8('0x30')]=qs[_0xd4d8('0x30')](_0x124bc4['query'][_0xd4d8('0x30')]);_0x65c6a3[_0xd4d8('0x2e')]=qs[_0xd4d8('0x2e')](_0x124bc4['query']['offset']);}return _0x5ea9ce[_0xd4d8('0x84')](_0x65c6a3);}})['then'](function(_0x4332cc){if(_0x4332cc){return _0x4332cc?{'count':_0x3f643e,'rows':_0x4332cc}:null;}})[_0xd4d8('0x37')](respondWithResult(_0x1c5d39,null))[_0xd4d8('0x2a')](handleError(_0x1c5d39,null));};function Extension(_0x37c9,_0x370532,_0x36a466,_0x3454d1){this['context']='from-voip-provider';this['exten']=_0x37c9[_0xd4d8('0x85')];this[_0xd4d8('0x86')]=_0x3454d1;this[_0xd4d8('0x43')]=_0xd4d8('0x87');this[_0xd4d8('0x88')]=_0xd4d8('0x89');this[_0xd4d8('0x6c')]=_0x37c9['id'];this[_0xd4d8('0x82')]=_0x370532;this[_0xd4d8('0x8a')]=_0x36a466;}function createExtensionsReciveFax(_0x4a7d17){var _0x41fb15=0x1;var _0x1f9308=[];_0x1f9308[_0xd4d8('0x8b')](new Extension(_0x4a7d17,_0x41fb15,'',_0xd4d8('0x8c')));_0x41fb15+=0x1;_0x1f9308[_0xd4d8('0x8b')](new Extension(_0x4a7d17,_0x41fb15,_0xd4d8('0x8d'),_0xd4d8('0x8e')));_0x41fb15+=0x1;for(var _0x4f5d52 in _0x4a7d17){if(_0x4a7d17[_0xd4d8('0x68')](_0x4f5d52)&&(_0x4f5d52===_0xd4d8('0x8f')||_0x4f5d52==='localstationid'||_0x4f5d52==='gateway'||_0x4f5d52===_0xd4d8('0x90')||_0x4f5d52==='headerinfo'||_0x4f5d52===_0xd4d8('0x91')||_0x4f5d52===_0xd4d8('0x92')||_0x4f5d52==='modem'||_0x4f5d52===_0xd4d8('0x93'))){_0x1f9308[_0xd4d8('0x8b')](new Extension(_0x4a7d17,_0x41fb15,_0xd4d8('0x94')+_0x4f5d52+')='+_0x4a7d17[_0x4f5d52],_0xd4d8('0x8e')));_0x41fb15+=0x1;}}_0x1f9308['push'](new Extension(_0x4a7d17,_0x41fb15,'6',_0xd4d8('0x95')));_0x41fb15+=0x1;_0x1f9308[_0xd4d8('0x8b')](new Extension(_0x4a7d17,_0x41fb15,_0xd4d8('0x96'),_0xd4d8('0x97')));_0x41fb15=0x0;return _0x1f9308;}exports['addAccountApplications']=function(_0x3804bf,_0x219141,_0x467dc0){var _0x30a342;return db['sequelize'][_0xd4d8('0x7c')](function(_0xbe7252){return db[_0xd4d8('0x41')]['create'](_0x3804bf[_0xd4d8('0x5d')],{'transaction':_0xbe7252})['then'](function(_0x2f59e0){_0x30a342=_0x2f59e0[_0xd4d8('0x39')]({'plain':!![]});return db['VoiceExtension'][_0xd4d8('0x81')](createExtensionsReciveFax(_0x30a342),{'transaction':_0xbe7252});});})['then'](function(){return _0x30a342;})[_0xd4d8('0x37')](respondWithResult(_0x219141,null))['catch'](handleError(_0x219141,null));};exports[_0xd4d8('0x98')]=function(_0x32435d,_0x11e616,_0x462cc8){var _0x41db61;return db[_0xd4d8('0x7d')][_0xd4d8('0x7c')](function(_0x184c32){return db[_0xd4d8('0x41')][_0xd4d8('0x36')](_0x32435d[_0xd4d8('0x5d')],{'where':{'id':_0x32435d['body']['id']},'transaction':_0x184c32})[_0xd4d8('0x37')](function(_0xb12938){return db['VoiceExtension'][_0xd4d8('0x38')]({'where':{'FaxAccountId':_0x32435d[_0xd4d8('0x5d')]['id']},'transaction':_0x184c32})['then'](function(_0x212107){return db[_0xd4d8('0x99')][_0xd4d8('0x81')](createExtensionsReciveFax(_[_0xd4d8('0x9a')](_0x32435d[_0xd4d8('0x5d')],[_0xd4d8('0x9b'),_0xd4d8('0x9c'),_0xd4d8('0x9d'),_0xd4d8('0x9e'),_0xd4d8('0x9f'),'ListId'])),{'transaction':_0x184c32});});});})['then'](function(){return db[_0xd4d8('0x41')]['findById'](_0x32435d[_0xd4d8('0x5d')]['id']);})[_0xd4d8('0x37')](respondWithResult(_0x11e616,null))['catch'](handleError(_0x11e616,null));};exports[_0xd4d8('0xa0')]=function(_0xf0039d,_0x48e57f,_0x10229a){var _0x3adff4={'raw':!![],'where':{}};var _0x382590={};var _0x1c6ea7={'count':0x0,'rows':[]};return db[_0xd4d8('0x41')]['findOne']({'where':{'id':_0xf0039d[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x48e57f,null))[_0xd4d8('0x37')](function(_0x5c9e19){if(_0x5c9e19){_0x382590[_0xd4d8('0x44')]=_[_0xd4d8('0x46')](db[_0xd4d8('0xa1')][_0xd4d8('0x59')]);_0x382590['query']=_[_0xd4d8('0x46')](_0xf0039d['query']);_0x382590[_0xd4d8('0x47')]=_[_0xd4d8('0x48')](_0x382590[_0xd4d8('0x44')],_0x382590['query']);_0x3adff4['attributes']=_[_0xd4d8('0x48')](_0x382590[_0xd4d8('0x44')],qs[_0xd4d8('0x4a')](_0xf0039d[_0xd4d8('0x45')][_0xd4d8('0x4a')]));_0x3adff4['attributes']=_0x3adff4[_0xd4d8('0x49')]['length']?_0x3adff4[_0xd4d8('0x49')]:_0x382590['model'];if(!_0xf0039d[_0xd4d8('0x45')][_0xd4d8('0x68')](_0xd4d8('0x69'))){_0x3adff4['limit']=qs[_0xd4d8('0x30')](_0xf0039d['query']['limit']);_0x3adff4[_0xd4d8('0x2e')]=qs[_0xd4d8('0x2e')](_0xf0039d[_0xd4d8('0x45')]['offset']);}_0x3adff4[_0xd4d8('0x4c')]=qs[_0xd4d8('0x4d')](_0xf0039d[_0xd4d8('0x45')][_0xd4d8('0x4d')]);_0x3adff4[_0xd4d8('0x4e')]=qs['filters'](_[_0xd4d8('0x4f')](_0xf0039d[_0xd4d8('0x45')],_0x382590[_0xd4d8('0x47')]));_0x3adff4[_0xd4d8('0x4e')][_0xd4d8('0x6c')]=_0x5c9e19['id'];if(_0xf0039d[_0xd4d8('0x45')][_0xd4d8('0x50')]){_0x3adff4[_0xd4d8('0x4e')]=_[_0xd4d8('0x51')](_0x3adff4[_0xd4d8('0x4e')],{'$or':_[_0xd4d8('0x40')](_0x3adff4['attributes'],function(_0x4199bb){var _0x2e6a55={};_0x2e6a55[_0x4199bb]={'$like':'%'+_0xf0039d[_0xd4d8('0x45')][_0xd4d8('0x50')]+'%'};return _0x2e6a55;})});}if(_0xf0039d[_0xd4d8('0x45')][_0xd4d8('0xa2')]){var _0x451f3a=_0xf0039d[_0xd4d8('0x45')]['$gte'][_0xd4d8('0xa3')](',');var _0x851334={};_0x851334[_0x451f3a[0x0]]={'$gte':moment(_0x451f3a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3adff4[_0xd4d8('0x4e')]=_[_0xd4d8('0x51')](_0x3adff4[_0xd4d8('0x4e')],_0x851334);}_0x3adff4=_['merge']({},_0x3adff4,_0xf0039d['options']);return db['FaxMessage'][_0xd4d8('0x31')]({'where':_0x3adff4[_0xd4d8('0x4e')]})[_0xd4d8('0x37')](function(_0x539ad6){_0x1c6ea7[_0xd4d8('0x31')]=_0x539ad6;if(_0xf0039d['query'][_0xd4d8('0x53')]){_0x3adff4[_0xd4d8('0x54')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3adff4);})[_0xd4d8('0x37')](function(_0x1bd9bf){_0x1c6ea7[_0xd4d8('0x56')]=_0x1bd9bf;return _0x1c6ea7;});}})[_0xd4d8('0x37')](respondWithFilteredResult(_0x48e57f,_0x3adff4))[_0xd4d8('0x2a')](handleError(_0x48e57f,null));};exports[_0xd4d8('0x3d')]=function(_0x5a79f6,_0x33104c,_0x4e9a31){var _0x1e6268,_0x17b2f9={},_0x2b1ddf;if(_0x5a79f6[_0xd4d8('0x5d')]['to']){_0x2b1ddf=_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0];}return db[_0xd4d8('0x41')][_0xd4d8('0x5b')]({'where':{'id':_0x5a79f6[_0xd4d8('0x57')]['id']},'include':[{'model':db[_0xd4d8('0xa4')],'as':'List','include':[{'model':db[_0xd4d8('0x73')],'as':_0xd4d8('0xa5'),'where':{'fax':_0x2b1ddf},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xd4d8('0x37')](handleEntityNotFound(_0x33104c,null))[_0xd4d8('0x37')](function(_0x5e58ac){_0x1e6268=_0x5e58ac;if(_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')]&&_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')]['length']){for(var _0x474080=0x0;_0x474080<_0x5a79f6['body'][_0xd4d8('0xa6')]['length'];_0x474080+=0x1){_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][_0x474080]={'filename':_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][_0x474080][_0xd4d8('0x3c')],'id':_0x5a79f6[_0xd4d8('0x5d')]['attachments'][_0x474080]['id'],'path':path[_0xd4d8('0xa7')](config[_0xd4d8('0xa8')],_0xd4d8('0xa9'),_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][_0x474080]['basename'])};}}return respondWithRpcPromise(_0xd4d8('0xaa'),_0xd4d8('0xaa'),{'FaxAccountId':_[_0xd4d8('0xab')](_0x5a79f6[_0xd4d8('0x57')]['id'])?undefined:_0x5a79f6[_0xd4d8('0x57')]['id'],'path':_['isNil'](_0x5a79f6['body'][_0xd4d8('0xa6')][0x0][_0xd4d8('0xac')])?undefined:_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][0x0][_0xd4d8('0xac')],'fax':_['isNil'](_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0])?undefined:_0x5a79f6['body']['to'][0x0]},client9002);})[_0xd4d8('0x37')](function(){if(_0x1e6268){if(_['isNil'](_0x5a79f6[_0xd4d8('0x5d')]['from'])){_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xad')]=util[_0xd4d8('0xae')](_0xd4d8('0xaf'),_0x1e6268[_0xd4d8('0x3c')],_0x1e6268[_0xd4d8('0xb0')]);}if(_0x1e6268[_0xd4d8('0xb1')]){if(_0x1e6268[_0xd4d8('0xb1')][_0xd4d8('0xa5')][_0xd4d8('0x4b')]){return _0x1e6268['List'][_0xd4d8('0xa5')][0x0];}else{return db[_0xd4d8('0x73')][_0xd4d8('0x5c')](_[_0xd4d8('0x1a')](_0x5a79f6[_0xd4d8('0x5d')],{'firstName':_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0],'phone':_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0],'fax':_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0],'ListId':_0x1e6268['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xd4d8('0xb2'));}})['then'](function(_0x23192f){if(_0x23192f){return db[_0xd4d8('0x71')][_0xd4d8('0x5b')]({'where':{'ContactId':_0x23192f['id'],'closed':![],'FaxAccountId':_0x1e6268['id']}})[_0xd4d8('0x37')](function(_0x49baf2){if(_0x49baf2){return[_0x49baf2,![]];}return db[_0xd4d8('0x71')][_0xd4d8('0x5c')]({'UserId':_0x5a79f6[_0xd4d8('0xb3')]['id'],'ContactId':_0x23192f['id'],'FaxAccountId':_0x1e6268['id'],'fax':_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0],'firstMsgDirection':_0xd4d8('0xb4'),'Messages':[_[_0xd4d8('0x51')](_0x5a79f6[_0xd4d8('0x5d')],{'read':![],'body':_0x5a79f6[_0xd4d8('0x5d')]['attachments'][0x0][_0xd4d8('0xb5')],'FaxAccountId':_0x1e6268['id'],'UserId':_0x5a79f6[_0xd4d8('0xb3')]['id'],'ContactId':_0x23192f['id'],'AttachmentId':_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xd4d8('0xa1')],'as':_0xd4d8('0xb6')}]})['then'](function(_0x375ad2){return[_0x375ad2,!![]];});});}else{throw new Error(_0xd4d8('0xb7'));}})[_0xd4d8('0xb8')](function(_0x33f2a0,_0x5e0a4b){if(_0x5e0a4b){return _0x33f2a0;}return db[_0xd4d8('0xa1')][_0xd4d8('0x5c')]({'direction':'out','read':![],'body':_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][0x0][_0xd4d8('0xb5')],'FaxAccountId':_0x1e6268['id'],'FaxInteractionId':_0x33f2a0['id'],'UserId':_0x5a79f6[_0xd4d8('0xb3')]['id'],'ContactId':_0x33f2a0[_0xd4d8('0xb9')],'AttachmentId':_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][0x0]['id']})[_0xd4d8('0x37')](function(_0x5a5278){_0x33f2a0[_0xd4d8('0xba')]['Messages']=[];_0x33f2a0[_0xd4d8('0xba')][_0xd4d8('0xb6')][_0xd4d8('0x8b')](_0x5a5278[_0xd4d8('0xba')]);return _0x33f2a0;});})[_0xd4d8('0x37')](function(_0x50e8ac){respondWithRpcPromise(_0xd4d8('0xbb'),_0xd4d8('0xbb'),{'FaxAccountId':_['isNil'](_0x5a79f6['params']['id'])?undefined:_0x5a79f6[_0xd4d8('0x57')]['id'],'path':_['isNil'](_0x5a79f6[_0xd4d8('0x5d')]['attachments'][0x0]['path'])?undefined:_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][0x0][_0xd4d8('0xac')],'fax':_['isNil'](_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0])?undefined:_0x5a79f6[_0xd4d8('0x5d')]['to'][0x0],'AttachmentId':_0x5a79f6[_0xd4d8('0x5d')][_0xd4d8('0xa6')][0x0]['id']},client9002)[_0xd4d8('0x37')](function(_0x3911be){logger[_0xd4d8('0x22')](_0xd4d8('0xbc'),_0x3911be);})['catch'](function(_0x8c095c){logger[_0xd4d8('0x22')](_0xd4d8('0xbc'),_0x8c095c);});return _0x50e8ac;})[_0xd4d8('0x37')](respondWithResult(_0x33104c,null))[_0xd4d8('0x2a')](handleError(_0x33104c,null));};exports[_0xd4d8('0xbd')]=function(_0x2a4028,_0xcf5e1d,_0xab56bc){return db[_0xd4d8('0x41')][_0xd4d8('0x5b')]({'where':{'id':_0x2a4028['params']['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0xcf5e1d,null))[_0xd4d8('0x37')](function(_0xf5efc2){if(_0xf5efc2){return _0xf5efc2[_0xd4d8('0xbd')](_0x2a4028[_0xd4d8('0x5d')][_0xd4d8('0x6f')],_[_0xd4d8('0x9a')](_0x2a4028[_0xd4d8('0x5d')],[_0xd4d8('0x6f'),'id'])||{})['spread'](function(_0x1466ee){for(var _0x160fc7=0x0;_0x160fc7<_0x2a4028[_0xd4d8('0x5d')][_0xd4d8('0x6f')][_0xd4d8('0x4b')];_0x160fc7+=0x1){socket[_0xd4d8('0xbe')](_0xd4d8('0xbf'),{'UserId':Number(_0x2a4028['body'][_0xd4d8('0x6f')][_0x160fc7]),'FaxAccountId':Number(_0x2a4028['params']['id'])});}return _0x1466ee;});}})[_0xd4d8('0x37')](respondWithResult(_0xcf5e1d,null))[_0xd4d8('0x2a')](handleError(_0xcf5e1d,null));};exports[_0xd4d8('0xc0')]=function(_0x5685ad,_0x13be33,_0x5ab6d5){return db[_0xd4d8('0x41')]['find']({'where':{'id':_0x5685ad[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x13be33,null))[_0xd4d8('0x37')](function(_0x398353){if(_0x398353){return _0x398353[_0xd4d8('0xc0')](_0x5685ad[_0xd4d8('0x45')][_0xd4d8('0x6f')])[_0xd4d8('0x37')](function(){if(_[_0xd4d8('0xc1')](_0x5685ad['query'][_0xd4d8('0x6f')])){for(var _0x48d08d=0x0;_0x48d08d<_0x5685ad[_0xd4d8('0x45')][_0xd4d8('0x6f')][_0xd4d8('0x4b')];_0x48d08d+=0x1){socket[_0xd4d8('0xbe')](_0xd4d8('0xc2'),{'UserId':Number(_0x5685ad[_0xd4d8('0x45')]['ids'][_0x48d08d]),'FaxAccountId':Number(_0x5685ad['params']['id'])});}}else{socket[_0xd4d8('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x5685ad[_0xd4d8('0x45')]['ids']),'FaxAccountId':Number(_0x5685ad[_0xd4d8('0x57')]['id'])});}});}})[_0xd4d8('0x37')](respondWithStatusCode(_0x13be33,null))[_0xd4d8('0x2a')](handleError(_0x13be33,null));};exports[_0xd4d8('0xc3')]=function(_0x128f0d,_0x4e788c,_0x3ab01a){var _0x30df7={};var _0xc6a696={};var _0x4918a3;var _0x1d7b3b;return db['FaxAccount']['findOne']({'where':{'id':_0x128f0d[_0xd4d8('0x57')]['id']}})[_0xd4d8('0x37')](handleEntityNotFound(_0x4e788c,null))[_0xd4d8('0x37')](function(_0x4d3e08){if(_0x4d3e08){_0x4918a3=_0x4d3e08;_0xc6a696[_0xd4d8('0x44')]=_[_0xd4d8('0x46')](db['User'][_0xd4d8('0x59')]);_0xc6a696[_0xd4d8('0x45')]=_['keys'](_0x128f0d[_0xd4d8('0x45')]);_0xc6a696[_0xd4d8('0x47')]=_[_0xd4d8('0x48')](_0xc6a696[_0xd4d8('0x44')],_0xc6a696[_0xd4d8('0x45')]);_0x30df7[_0xd4d8('0x49')]=_[_0xd4d8('0x48')](_0xc6a696['model'],qs[_0xd4d8('0x4a')](_0x128f0d[_0xd4d8('0x45')]['fields']));_0x30df7[_0xd4d8('0x49')]=_0x30df7[_0xd4d8('0x49')]['length']?_0x30df7['attributes']:_0xc6a696[_0xd4d8('0x44')];_0x30df7[_0xd4d8('0x4c')]=qs['sort'](_0x128f0d[_0xd4d8('0x45')][_0xd4d8('0x4d')]);_0x30df7[_0xd4d8('0x4e')]=qs['filters'](_[_0xd4d8('0x4f')](_0x128f0d[_0xd4d8('0x45')],_0xc6a696['filters']));if(_0x128f0d[_0xd4d8('0x45')][_0xd4d8('0x50')]){_0x30df7['where']=_[_0xd4d8('0x51')](_0x30df7[_0xd4d8('0x4e')],{'$or':_['map'](_0x30df7[_0xd4d8('0x49')],function(_0x2634dc){var _0x374c15={};_0x374c15[_0x2634dc]={'$like':'%'+_0x128f0d[_0xd4d8('0x45')][_0xd4d8('0x50')]+'%'};return _0x374c15;})});}_0x30df7=_[_0xd4d8('0x51')]({},_0x30df7,_0x128f0d[_0xd4d8('0x5a')]);return _0x4918a3[_0xd4d8('0xc3')](_0x30df7);}})[_0xd4d8('0x37')](function(_0x631894){if(_0x631894){_0x1d7b3b=_0x631894['length'];if(!_0x128f0d['query'][_0xd4d8('0x68')]('nolimit')){_0x30df7[_0xd4d8('0x30')]=qs[_0xd4d8('0x30')](_0x128f0d['query'][_0xd4d8('0x30')]);_0x30df7[_0xd4d8('0x2e')]=qs[_0xd4d8('0x2e')](_0x128f0d[_0xd4d8('0x45')][_0xd4d8('0x2e')]);}return _0x4918a3['getAgents'](_0x30df7);}})[_0xd4d8('0x37')](function(_0x5e710a){if(_0x5e710a){return _0x5e710a?{'count':_0x1d7b3b,'rows':_0x5e710a}:null;}})[_0xd4d8('0x37')](respondWithResult(_0x4e788c,null))['catch'](handleError(_0x4e788c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d7e7c52..b6371dd 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 _0x50a5=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4d427b,_0x574a2a){var _0x5b324e=function(_0x4df23b){while(--_0x4df23b){_0x4d427b['push'](_0x4d427b['shift']());}};_0x5b324e(++_0x574a2a);}(_0x50a5,0xd1));var _0x550a=function(_0xacb855,_0x5cb963){_0xacb855=_0xacb855-0x0;var _0x4855ec=_0x50a5[_0xacb855];return _0x4855ec;};'use strict';var EventEmitter=require(_0x550a('0x0'));var FaxAccount=require(_0x550a('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x550a('0x2')};function emitEvent(_0x4827e0){return function(_0x357485,_0x2038f7,_0x45ca06){FaxAccountEvents[_0x550a('0x3')](_0x4827e0+':'+_0x357485['id'],_0x357485);FaxAccountEvents[_0x550a('0x3')](_0x4827e0,_0x357485);_0x45ca06(null);};}for(var e in events){if(events[_0x550a('0x4')](e)){var event=events[e];FaxAccount[_0x550a('0x5')](e,emitEvent(event));}}module[_0x550a('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0x5835=['emit','hook','exports','events','setMaxListeners','save'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0x5835,0x123));var _0x5583=function(_0x541930,_0x4d9f67){_0x541930=_0x541930-0x0;var _0x38fad5=_0x5835[_0x541930];return _0x38fad5;};'use strict';var EventEmitter=require(_0x5583('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5583('0x1')](0x0);var events={'afterCreate':_0x5583('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x241edf){return function(_0x4da6c6,_0x1f775f,_0x5c45bc){FaxAccountEvents[_0x5583('0x3')](_0x241edf+':'+_0x4da6c6['id'],_0x4da6c6);FaxAccountEvents['emit'](_0x241edf,_0x4da6c6);_0x5c45bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x5583('0x4')](e,emitEvent(event));}}module[_0x5583('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 115bcc2..e324816 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 _0xc74f=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc74f,0x1c6));var _0xfc74=function(_0x5d1ff0,_0x3752ee){_0x5d1ff0=_0x5d1ff0-0x0;var _0x5c5b01=_0xc74f[_0x5d1ff0];return _0x5c5b01;};'use strict';var _=require(_0xfc74('0x0'));var util=require(_0xfc74('0x1'));var logger=require(_0xfc74('0x2'))(_0xfc74('0x3'));var moment=require(_0xfc74('0x4'));var BPromise=require(_0xfc74('0x5'));var rp=require(_0xfc74('0x6'));var fs=require('fs');var path=require(_0xfc74('0x7'));var rimraf=require('rimraf');var config=require(_0xfc74('0x8'));var attributes=require(_0xfc74('0x9'));module[_0xfc74('0xa')]=function(_0x355665,_0x444f99){return _0x355665['define'](_0xfc74('0xb'),attributes,{'tableName':_0xfc74('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b86=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount'];(function(_0x267ecf,_0x444e45){var _0xf67a1f=function(_0x2d9d44){while(--_0x2d9d44){_0x267ecf['push'](_0x267ecf['shift']());}};_0xf67a1f(++_0x444e45);}(_0x8b86,0xfd));var _0x68b8=function(_0x15da5f,_0x3fce0e){_0x15da5f=_0x15da5f-0x0;var _0x1992f1=_0x8b86[_0x15da5f];return _0x1992f1;};'use strict';var _=require('lodash');var util=require(_0x68b8('0x0'));var logger=require(_0x68b8('0x1'))('api');var moment=require(_0x68b8('0x2'));var BPromise=require(_0x68b8('0x3'));var rp=require(_0x68b8('0x4'));var fs=require('fs');var path=require(_0x68b8('0x5'));var rimraf=require(_0x68b8('0x6'));var config=require(_0x68b8('0x7'));var attributes=require('./faxAccount.attributes');module[_0x68b8('0x8')]=function(_0x7cabee,_0xc9dd9b){return _0x7cabee[_0x68b8('0x9')](_0x68b8('0xa'),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 60741e2..55d3d8b 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 _0x2a0f=['request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','limit','include','map','attributes','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','DESC','get','account','applications','Applications','orderBy','priority','asc','length','contact','FaxInteraction','create','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x2a0f,0x1f1));var _0xf2a0=function(_0x3f5ad7,_0x573e92){_0x3f5ad7=_0x3f5ad7-0x0;var _0x3380a0=_0x2a0f[_0x3f5ad7];return _0x3380a0;};'use strict';var _=require('lodash');var util=require(_0xf2a0('0x0'));var moment=require(_0xf2a0('0x1'));var BPromise=require(_0xf2a0('0x2'));var rs=require(_0xf2a0('0x3'));var fs=require('fs');var Redis=require(_0xf2a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf2a0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2a0('0x6')][_0xf2a0('0x7')]({'port':0x232c});config[_0xf2a0('0x8')]=_[_0xf2a0('0x9')](config[_0xf2a0('0x8')],{'host':_0xf2a0('0xa'),'port':0x18eb});var socket=require(_0xf2a0('0xb'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xf2a0('0xc')](socket);function respondWithRpcPromise(_0x50478e,_0x28e655,_0x4e1c55){return new BPromise(function(_0x5e1c7e,_0x5e302f){return client[_0xf2a0('0xd')](_0x50478e,_0x4e1c55)[_0xf2a0('0xe')](function(_0x57a9f9){logger[_0xf2a0('0xf')](_0xf2a0('0x10'),_0x28e655,_0xf2a0('0x11'));logger[_0xf2a0('0x12')](_0xf2a0('0x13'),_0x28e655,'request\x20sent',JSON[_0xf2a0('0x14')](_0x57a9f9));if(_0x57a9f9['error']){if(_0x57a9f9['error']['code']===0x1f4){logger[_0xf2a0('0x15')]('FaxAccount,\x20%s,\x20%s',_0x28e655,_0x57a9f9[_0xf2a0('0x15')][_0xf2a0('0x16')]);return _0x5e302f(_0x57a9f9[_0xf2a0('0x15')][_0xf2a0('0x16')]);}logger[_0xf2a0('0x15')](_0xf2a0('0x10'),_0x28e655,_0x57a9f9[_0xf2a0('0x15')][_0xf2a0('0x16')]);return _0x5e1c7e(_0x57a9f9[_0xf2a0('0x15')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x28e655,_0xf2a0('0x11'));_0x5e1c7e(_0x57a9f9[_0xf2a0('0x17')]['message']);}})[_0xf2a0('0x18')](function(_0xb67c2){logger[_0xf2a0('0x15')]('FaxAccount,\x20%s,\x20%s',_0x28e655,_0xb67c2);_0x5e302f(_0xb67c2);});});}exports['GetFaxAccount']=function(_0x31b68b){var _0x1c0df1=this;return new Promise(function(_0x418c6f,_0x55ce39){return db['FaxAccount'][_0xf2a0('0x19')]({'raw':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options'][_0xf2a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b[_0xf2a0('0x1a')][_0xf2a0('0x1c')]||null:null,'attributes':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options']['attributes']||null:null,'limit':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options'][_0xf2a0('0x1d')]||null:null,'include':_0x31b68b[_0xf2a0('0x1a')]?_0x31b68b['options'][_0xf2a0('0x1e')]?_[_0xf2a0('0x1f')](_0x31b68b[_0xf2a0('0x1a')]['include'],function(_0x3baf79){return{'model':db[_0x3baf79['model']],'as':_0x3baf79['as'],'attributes':_0x3baf79[_0xf2a0('0x20')],'include':_0x3baf79[_0xf2a0('0x1e')]?_[_0xf2a0('0x1f')](_0x3baf79['include'],function(_0x2faf59){return{'model':db[_0x2faf59['model']],'as':_0x2faf59['as'],'attributes':_0x2faf59[_0xf2a0('0x20')],'include':_0x2faf59[_0xf2a0('0x1e')]?_[_0xf2a0('0x1f')](_0x2faf59[_0xf2a0('0x1e')],function(_0x55d5b0){return{'model':db[_0x55d5b0[_0xf2a0('0x21')]],'as':_0x55d5b0['as'],'attributes':_0x55d5b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2a0('0xe')](function(_0x5a9892){logger['info'](_0xf2a0('0x22'),_0x31b68b);logger[_0xf2a0('0x12')](_0xf2a0('0x22'),_0x31b68b,JSON['stringify'](_0x5a9892));_0x418c6f(_0x5a9892);})[_0xf2a0('0x18')](function(_0x3821a5){logger[_0xf2a0('0x15')](_0xf2a0('0x22'),_0x3821a5[_0xf2a0('0x16')],_0x31b68b);_0x55ce39(_0x1c0df1[_0xf2a0('0x15')](0x1f4,_0x3821a5[_0xf2a0('0x16')]));});});};exports[_0xf2a0('0x23')]=function(_0x44c16d,_0x482347,_0x13d8ca){var _0x5e8bd7=this;return new Promise(function(_0x19404a,_0xef6adc){var _0x1e2e1c={'body':_0x44c16d['body'],'channel':_0xf2a0('0x24')};var _0x33ed78=[];var _0x8f1fca=[];var _0x5b7dc2={};return db[_0xf2a0('0x25')]['describe']()[_0xf2a0('0xe')](function(_0x344c26){if(!_0x344c26){throw new db[(_0xf2a0('0x26'))][(_0xf2a0('0x27'))](_0xf2a0('0x28'));}_0x33ed78=_[_0xf2a0('0x29')](_[_0xf2a0('0x2a')](_0x344c26),['createdAt',_0xf2a0('0x2b')]);_0x8f1fca=_[_0xf2a0('0x29')](_[_0xf2a0('0x2a')](_0x344c26),[_0xf2a0('0x2c'),_0xf2a0('0x2b'),_0xf2a0('0x2d'),_0xf2a0('0x2e')]);if(_0x44c16d[_0xf2a0('0x2f')]['id']){delete _0x44c16d[_0xf2a0('0x2f')]['id'];}if(_['isNil'](_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x30')])){throw new db[(_0xf2a0('0x26'))][(_0xf2a0('0x27'))](_0xf2a0('0x31'));}if(_[_0xf2a0('0x32')](_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x2f')])||_0x44c16d[_0xf2a0('0x2f')]['body']===''){throw new db['Sequelize'][(_0xf2a0('0x27'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf2a0('0x32')](_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')])){throw new db['Sequelize'][(_0xf2a0('0x27'))](_0xf2a0('0x34')+_0x8f1fca);}if(!_['includes'](_0x8f1fca,_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')])){throw new db[(_0xf2a0('0x26'))][(_0xf2a0('0x27'))](_0xf2a0('0x35')+_0x8f1fca);}_0x5b7dc2[_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')]]=_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x30')];})[_0xf2a0('0xe')](function(){return db['FaxAccount'][_0xf2a0('0x36')]({'where':{'id':_0x44c16d['account']['id']},'include':[{'model':db[_0xf2a0('0x37')],'as':_0xf2a0('0x38'),'include':[{'model':db[_0xf2a0('0x25')],'as':'Contacts','where':_0x5b7dc2,'limit':0x1,'order':[[_0xf2a0('0x2b'),_0xf2a0('0x39')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf2a0('0xe')](function(_0x17c423){if(_0x17c423&&_0x17c423[_0xf2a0('0x38')]){var _0x3d3720=_0x17c423[_0xf2a0('0x3a')]({'plain':!![]});_0x1e2e1c[_0xf2a0('0x3b')]=_0x3d3720;_0x1e2e1c[_0xf2a0('0x3c')]=_0x3d3720[_0xf2a0('0x3d')];_0x1e2e1c['list']=_0x3d3720['List'];_0x1e2e1c[_0xf2a0('0x3c')]=_[_0xf2a0('0x3e')](_0x1e2e1c['applications'],[_0xf2a0('0x3f')],[_0xf2a0('0x40')]);if(_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x3d')]){delete _0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x3d')];}if(_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x38')]&&_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x38')]['Contacts'][_0xf2a0('0x41')]){return _0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x38')]['Contacts'][0x0];}var _0xbdb9eb=_[_0xf2a0('0x9')](_0x44c16d[_0xf2a0('0x2f')],{'firstName':_0x44c16d['body'][_0xf2a0('0x30')],'ListId':_0x3d3720[_0xf2a0('0x2e')]});_0xbdb9eb[_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x33')]]=_0x44c16d[_0xf2a0('0x2f')][_0xf2a0('0x30')];return db[_0xf2a0('0x25')]['create'](_0xbdb9eb,{'fields':_0x33ed78,'raw':!![]});}})[_0xf2a0('0xe')](function(_0x46e79d){_0x1e2e1c[_0xf2a0('0x42')]=_0x46e79d;if(_0x46e79d){var _0xe7d053={'ContactId':_0x46e79d['id'],'FaxAccountId':_0x44c16d[_0xf2a0('0x3b')]['id'],'fax':_0x46e79d[_0xf2a0('0x24')]};return db[_0xf2a0('0x43')][_0xf2a0('0x36')]({'where':{'ContactId':_0x46e79d['id'],'closed':![],'FaxAccountId':_0x44c16d[_0xf2a0('0x3b')]['id']}})[_0xf2a0('0xe')](function(_0x296c1c){if(_0x296c1c){return[_0x296c1c,![]];}return db[_0xf2a0('0x43')][_0xf2a0('0x44')](_0xe7d053)[_0xf2a0('0xe')](function(_0x7a8942){return[_0x7a8942,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf2a0('0x45')](function(_0x18b2e0,_0x551903){var _0x2f5612=_0x18b2e0['get']({'plain':!![]});if(_0x551903){if(_0x1e2e1c[_0xf2a0('0x3b')][_0xf2a0('0x46')]){_0x1e2e1c[_0xf2a0('0x3c')][_0xf2a0('0x47')]({'id':0x0,'priority':_0x1e2e1c['applications'][_0xf2a0('0x41')]+0x1,'app':_0xf2a0('0x48'),'appdata':_0xf2a0('0x49'),'interval':_0xf2a0('0x4a')});}_0x2f5612['created']=!![];}else{_0x2f5612[_0xf2a0('0x4b')]=![];}_0x1e2e1c[_0xf2a0('0x4c')]=_0x2f5612;return db['FaxMessage'][_0xf2a0('0x44')]({'body':_0x44c16d[_0xf2a0('0x2f')]['body'],'FaxAccountId':_0x44c16d[_0xf2a0('0x3b')]['id'],'FaxInteractionId':_0x18b2e0['id'],'direction':'in','ContactId':_0x18b2e0['ContactId'],'AttachmentId':_0x44c16d[_0xf2a0('0x2f')]['AttachmentId']});})[_0xf2a0('0xe')](function(_0x41d3aa){_0x1e2e1c[_0xf2a0('0x16')]=_0x41d3aa;if(_0x1e2e1c[_0xf2a0('0x4c')][_0xf2a0('0x4d')]){return db[_0xf2a0('0x4e')][_0xf2a0('0x36')]({'attributes':['id',_0xf2a0('0x4f')],'where':{'id':_0x1e2e1c[_0xf2a0('0x4c')][_0xf2a0('0x4d')]}})[_0xf2a0('0xe')](function(_0x339975){if(_0x339975){_0x1e2e1c['applications'][_0xf2a0('0x50')]({'id':0x0,'priority':0x0,'app':_0xf2a0('0x51'),'appdata':_0x339975[_0xf2a0('0x4f')]+','+(_0x1e2e1c['account'][_0xf2a0('0x52')]||0xa),'interval':_0xf2a0('0x4a')});}return respondWithRpcPromise(_0xf2a0('0x53'),_0xf2a0('0x54'),_0x1e2e1c);});}return respondWithRpcPromise(_0xf2a0('0x53'),_0xf2a0('0x54'),_0x1e2e1c);})[_0xf2a0('0xe')](function(_0x1583ce){_0x19404a(_0x1583ce);})[_0xf2a0('0x18')](function(_0x311cb8){_0xef6adc(_0x5e8bd7[_0xf2a0('0x15')](0x1f4,_0x311cb8[_0xf2a0('0x16')]));});});}; \ No newline at end of file +var _0x58be=['User','name','agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFaxAccount','findAll','options','raw','where','limit','include','model','attributes','then','stringify','NotifyFaxAccount','fax','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','CmContact','Contacts','updatedAt','DESC','FaxApplication','List','get','Applications','list','applications','asc','length','defaults','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId'];(function(_0xb79944,_0x486504){var _0x330f1d=function(_0x53e214){while(--_0x53e214){_0xb79944['push'](_0xb79944['shift']());}};_0x330f1d(++_0x486504);}(_0x58be,0x119));var _0xe58b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x58be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe58b('0x0'));var util=require(_0xe58b('0x1'));var moment=require(_0xe58b('0x2'));var BPromise=require(_0xe58b('0x3'));var rs=require(_0xe58b('0x4'));var fs=require('fs');var Redis=require(_0xe58b('0x5'));var db=require(_0xe58b('0x6'))['db'];var utils=require(_0xe58b('0x7'));var logger=require(_0xe58b('0x8'))('rpc');var config=require(_0xe58b('0x9'));var jayson=require(_0xe58b('0xa'));var client=jayson[_0xe58b('0xb')][_0xe58b('0xc')]({'port':0x232c});config[_0xe58b('0xd')]=_['defaults'](config[_0xe58b('0xd')],{'host':_0xe58b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe58b('0xd')]));require(_0xe58b('0xf'))[_0xe58b('0x10')](socket);function respondWithRpcPromise(_0x3141a8,_0x5b8d0d,_0x4d040e){return new BPromise(function(_0x3711bd,_0xa2670a){return client[_0xe58b('0x11')](_0x3141a8,_0x4d040e)['then'](function(_0x2677e2){logger[_0xe58b('0x12')](_0xe58b('0x13'),_0x5b8d0d,_0xe58b('0x14'));logger[_0xe58b('0x15')](_0xe58b('0x16'),_0x5b8d0d,'request\x20sent',JSON['stringify'](_0x2677e2));if(_0x2677e2[_0xe58b('0x17')]){if(_0x2677e2[_0xe58b('0x17')]['code']===0x1f4){logger['error'](_0xe58b('0x13'),_0x5b8d0d,_0x2677e2[_0xe58b('0x17')][_0xe58b('0x18')]);return _0xa2670a(_0x2677e2['error'][_0xe58b('0x18')]);}logger['error'](_0xe58b('0x13'),_0x5b8d0d,_0x2677e2[_0xe58b('0x17')][_0xe58b('0x18')]);return _0x3711bd(_0x2677e2[_0xe58b('0x17')][_0xe58b('0x18')]);}else{logger['info'](_0xe58b('0x13'),_0x5b8d0d,_0xe58b('0x14'));_0x3711bd(_0x2677e2[_0xe58b('0x19')]['message']);}})[_0xe58b('0x1a')](function(_0x137e49){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5b8d0d,_0x137e49);_0xa2670a(_0x137e49);});});}exports[_0xe58b('0x1b')]=function(_0x499755){var _0x4f32ee=this;return new Promise(function(_0x491ec8,_0x3e2c19){return db['FaxAccount'][_0xe58b('0x1c')]({'raw':_0x499755[_0xe58b('0x1d')]?_0x499755['options'][_0xe58b('0x1e')]===undefined?!![]:![]:!![],'where':_0x499755[_0xe58b('0x1d')]?_0x499755[_0xe58b('0x1d')][_0xe58b('0x1f')]||null:null,'attributes':_0x499755[_0xe58b('0x1d')]?_0x499755['options']['attributes']||null:null,'limit':_0x499755[_0xe58b('0x1d')]?_0x499755[_0xe58b('0x1d')][_0xe58b('0x20')]||null:null,'include':_0x499755[_0xe58b('0x1d')]?_0x499755[_0xe58b('0x1d')]['include']?_['map'](_0x499755['options'][_0xe58b('0x21')],function(_0x2acd5d){return{'model':db[_0x2acd5d[_0xe58b('0x22')]],'as':_0x2acd5d['as'],'attributes':_0x2acd5d[_0xe58b('0x23')],'include':_0x2acd5d[_0xe58b('0x21')]?_['map'](_0x2acd5d[_0xe58b('0x21')],function(_0x43e8c5){return{'model':db[_0x43e8c5[_0xe58b('0x22')]],'as':_0x43e8c5['as'],'attributes':_0x43e8c5[_0xe58b('0x23')],'include':_0x43e8c5['include']?_['map'](_0x43e8c5['include'],function(_0x5ccfe0){return{'model':db[_0x5ccfe0[_0xe58b('0x22')]],'as':_0x5ccfe0['as'],'attributes':_0x5ccfe0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe58b('0x24')](function(_0x3cb25d){logger[_0xe58b('0x12')]('GetFaxAccount',_0x499755);logger['debug'](_0xe58b('0x1b'),_0x499755,JSON[_0xe58b('0x25')](_0x3cb25d));_0x491ec8(_0x3cb25d);})[_0xe58b('0x1a')](function(_0x595f36){logger['error'](_0xe58b('0x1b'),_0x595f36['message'],_0x499755);_0x3e2c19(_0x4f32ee['error'](0x1f4,_0x595f36['message']));});});};exports[_0xe58b('0x26')]=function(_0x30a022,_0x228305,_0x2aac95){var _0x381219=this;return new Promise(function(_0x3c2d16,_0x4ead7a){var _0x41de73={'body':_0x30a022['body'],'channel':_0xe58b('0x27')};var _0x318215=[];var _0x501aea=[];var _0xc9fc4c={};return db['CmContact'][_0xe58b('0x28')]()[_0xe58b('0x24')](function(_0x14cc91){if(!_0x14cc91){throw new db[(_0xe58b('0x29'))]['ValidationError'](_0xe58b('0x2a'));}_0x318215=_[_0xe58b('0x2b')](_[_0xe58b('0x2c')](_0x14cc91),[_0xe58b('0x2d'),'updatedAt']);_0x501aea=_[_0xe58b('0x2b')](_[_0xe58b('0x2c')](_0x14cc91),[_0xe58b('0x2d'),'updatedAt',_0xe58b('0x2e'),_0xe58b('0x2f')]);if(_0x30a022['body']['id']){delete _0x30a022[_0xe58b('0x30')]['id'];}if(_[_0xe58b('0x31')](_0x30a022['body'][_0xe58b('0x32')])){throw new db[(_0xe58b('0x29'))]['ValidationError'](_0xe58b('0x33'));}if(_[_0xe58b('0x31')](_0x30a022[_0xe58b('0x30')][_0xe58b('0x30')])||_0x30a022[_0xe58b('0x30')][_0xe58b('0x30')]===''){throw new db[(_0xe58b('0x29'))][(_0xe58b('0x34'))](_0xe58b('0x35'));}if(_['isNil'](_0x30a022[_0xe58b('0x30')][_0xe58b('0x36')])){throw new db[(_0xe58b('0x29'))][(_0xe58b('0x34'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x501aea);}if(!_[_0xe58b('0x37')](_0x501aea,_0x30a022[_0xe58b('0x30')][_0xe58b('0x36')])){throw new db[(_0xe58b('0x29'))][(_0xe58b('0x34'))](_0xe58b('0x38')+_0x501aea);}_0xc9fc4c[_0x30a022['body'][_0xe58b('0x36')]]=_0x30a022[_0xe58b('0x30')][_0xe58b('0x32')];})[_0xe58b('0x24')](function(){return db[_0xe58b('0x39')][_0xe58b('0x3a')]({'where':{'id':_0x30a022[_0xe58b('0x3b')]['id']},'include':[{'model':db[_0xe58b('0x3c')],'as':'List','include':[{'model':db[_0xe58b('0x3d')],'as':_0xe58b('0x3e'),'where':_0xc9fc4c,'limit':0x1,'order':[[_0xe58b('0x3f'),_0xe58b('0x40')]]}]},{'model':db[_0xe58b('0x41')],'as':'Applications'}]});})['then'](function(_0x46bf53){if(_0x46bf53&&_0x46bf53[_0xe58b('0x42')]){var _0x5c4671=_0x46bf53[_0xe58b('0x43')]({'plain':!![]});_0x41de73['account']=_0x5c4671;_0x41de73['applications']=_0x5c4671[_0xe58b('0x44')];_0x41de73[_0xe58b('0x45')]=_0x5c4671[_0xe58b('0x42')];_0x41de73[_0xe58b('0x46')]=_['orderBy'](_0x41de73['applications'],['priority'],[_0xe58b('0x47')]);if(_0x41de73['account'][_0xe58b('0x44')]){delete _0x41de73[_0xe58b('0x3b')]['Applications'];}if(_0x41de73[_0xe58b('0x3b')]['List']&&_0x41de73[_0xe58b('0x3b')][_0xe58b('0x42')][_0xe58b('0x3e')][_0xe58b('0x48')]){return _0x41de73[_0xe58b('0x3b')][_0xe58b('0x42')][_0xe58b('0x3e')][0x0];}var _0x31b1ab=_[_0xe58b('0x49')](_0x30a022[_0xe58b('0x30')],{'firstName':_0x30a022['body'][_0xe58b('0x32')],'ListId':_0x5c4671[_0xe58b('0x2f')]});_0x31b1ab[_0x30a022[_0xe58b('0x30')][_0xe58b('0x36')]]=_0x30a022[_0xe58b('0x30')][_0xe58b('0x32')];return db[_0xe58b('0x3d')][_0xe58b('0x4a')](_0x31b1ab,{'fields':_0x318215,'raw':!![]});}})[_0xe58b('0x24')](function(_0x58b54e){_0x41de73['contact']=_0x58b54e;if(_0x58b54e){var _0x5487ac={'ContactId':_0x58b54e['id'],'FaxAccountId':_0x30a022[_0xe58b('0x3b')]['id'],'fax':_0x58b54e[_0xe58b('0x27')]};return db[_0xe58b('0x4b')]['find']({'where':{'ContactId':_0x58b54e['id'],'closed':![],'FaxAccountId':_0x30a022['account']['id']}})[_0xe58b('0x24')](function(_0xec4ee){if(_0xec4ee){return[_0xec4ee,![]];}return db[_0xe58b('0x4b')][_0xe58b('0x4a')](_0x5487ac)[_0xe58b('0x24')](function(_0x467348){return[_0x467348,!![]];});});}else{throw new Error(_0xe58b('0x4c'));}})[_0xe58b('0x4d')](function(_0x4aece3,_0x2bc5de){var _0x1abb66=_0x4aece3[_0xe58b('0x43')]({'plain':!![]});if(_0x2bc5de){if(_0x41de73[_0xe58b('0x3b')][_0xe58b('0x4e')]){_0x41de73['applications'][_0xe58b('0x4f')]({'id':0x0,'priority':_0x41de73[_0xe58b('0x46')][_0xe58b('0x48')]+0x1,'app':_0xe58b('0x50'),'appdata':'unmanaged','interval':_0xe58b('0x51')});}_0x1abb66[_0xe58b('0x52')]=!![];}else{_0x1abb66[_0xe58b('0x52')]=![];}_0x41de73['interaction']=_0x1abb66;return db['FaxMessage']['create']({'body':_0x30a022[_0xe58b('0x30')][_0xe58b('0x30')],'FaxAccountId':_0x30a022[_0xe58b('0x3b')]['id'],'FaxInteractionId':_0x4aece3['id'],'direction':'in','ContactId':_0x4aece3[_0xe58b('0x53')],'AttachmentId':_0x30a022['body'][_0xe58b('0x54')]});})[_0xe58b('0x24')](function(_0x39c74c){_0x41de73[_0xe58b('0x18')]=_0x39c74c;if(_0x41de73[_0xe58b('0x55')][_0xe58b('0x56')]){return db[_0xe58b('0x57')][_0xe58b('0x3a')]({'attributes':['id',_0xe58b('0x58')],'where':{'id':_0x41de73[_0xe58b('0x55')][_0xe58b('0x56')]}})[_0xe58b('0x24')](function(_0x2e9540){if(_0x2e9540){_0x41de73[_0xe58b('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe58b('0x59'),'appdata':_0x2e9540[_0xe58b('0x58')]+','+(_0x41de73[_0xe58b('0x3b')][_0xe58b('0x5a')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x41de73);});}return respondWithRpcPromise(_0xe58b('0x5b'),'startRouting',_0x41de73);})['then'](function(_0x479920){_0x3c2d16(_0x479920);})[_0xe58b('0x1a')](function(_0x1860c6){_0x4ead7a(_0x381219['error'](0x1f4,_0x1860c6[_0xe58b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ef43c9e..8ddbb60 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 _0x88ac=['faxAccount:','./faxAccount.events','update','emit','removeListener','register','length'];(function(_0x15cc30,_0x1d572b){var _0x3857d9=function(_0x212449){while(--_0x212449){_0x15cc30['push'](_0x15cc30['shift']());}};_0x3857d9(++_0x1d572b);}(_0x88ac,0x16d));var _0xc88a=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0x88ac[_0x455150];return _0x12ca9c;};'use strict';var FaxAccountEvents=require(_0xc88a('0x0'));var events=['save','remove',_0xc88a('0x1')];function createListener(_0x178cd0,_0x569450){return function(_0x2102e6){_0x569450[_0xc88a('0x2')](_0x178cd0,_0x2102e6);};}function removeListener(_0x20a184,_0xb79c54){return function(){FaxAccountEvents[_0xc88a('0x3')](_0x20a184,_0xb79c54);};}exports[_0xc88a('0x4')]=function(_0x3bc893){for(var _0x573a5f=0x0,_0x23674b=events[_0xc88a('0x5')];_0x573a5f<_0x23674b;_0x573a5f++){var _0x2bb5cd=events[_0x573a5f];var _0x60a8c2=createListener(_0xc88a('0x6')+_0x2bb5cd,_0x3bc893);FaxAccountEvents['on'](_0x2bb5cd,_0x60a8c2);}}; \ No newline at end of file +var _0x99c1=['remove','update','emit','removeListener','length','faxAccount:','./faxAccount.events','save'];(function(_0x453ecd,_0x5491f7){var _0x55b214=function(_0x3555c0){while(--_0x3555c0){_0x453ecd['push'](_0x453ecd['shift']());}};_0x55b214(++_0x5491f7);}(_0x99c1,0x1ee));var _0x199c=function(_0x7d4ca8,_0x318e9f){_0x7d4ca8=_0x7d4ca8-0x0;var _0x2f2cf8=_0x99c1[_0x7d4ca8];return _0x2f2cf8;};'use strict';var FaxAccountEvents=require(_0x199c('0x0'));var events=[_0x199c('0x1'),_0x199c('0x2'),_0x199c('0x3')];function createListener(_0x3a1a33,_0x3f9dbe){return function(_0x103f8f){_0x3f9dbe[_0x199c('0x4')](_0x3a1a33,_0x103f8f);};}function removeListener(_0x1d0fed,_0x48129e){return function(){FaxAccountEvents[_0x199c('0x5')](_0x1d0fed,_0x48129e);};}exports['register']=function(_0x4529cc){for(var _0x3f8466=0x0,_0x219b1f=events[_0x199c('0x6')];_0x3f8466<_0x219b1f;_0x3f8466++){var _0x3a8741=events[_0x3f8466];var _0x5ecfe7=createListener(_0x199c('0x7')+_0x3a8741,_0x4529cc);FaxAccountEvents['on'](_0x3a8741,_0x5ecfe7);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2b9ea6f..090c70f 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(_0x20c59f,_0x583d0a){var _0x2b6df8=function(_0x303e11){while(--_0x303e11){_0x20c59f['push'](_0x20c59f['shift']());}};_0x2b6df8(++_0x583d0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x4767a6,_0x1acecf){var _0xd04111=function(_0x135dae){while(--_0x135dae){_0x4767a6['push'](_0x4767a6['shift']());}};_0xd04111(++_0x1acecf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 1de6fb5..0955ae8 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 _0x82d9=['noop','TEXT','exports','STRING'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x82d9,0x132));var _0x982d=function(_0x4da872,_0x11df87){_0x4da872=_0x4da872-0x0;var _0x27588d=_0x82d9[_0x4da872];return _0x27588d;};'use strict';var Sequelize=require('sequelize');module[_0x982d('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x982d('0x1')],'allowNull':![],'defaultValue':_0x982d('0x2')},'appdata':{'type':Sequelize[_0x982d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x982d('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1d64=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1d64,0x17b));var _0x41d6=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x1d64[_0x1b1e76];return _0x3d743a;};'use strict';var Sequelize=require(_0x41d6('0x0'));module['exports']={'priority':{'type':Sequelize[_0x41d6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x41d6('0x2')],'allowNull':![],'defaultValue':_0x41d6('0x3')},'appdata':{'type':Sequelize[_0x41d6('0x4')]()},'description':{'type':Sequelize[_0x41d6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x41d6('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 3e21fb0..c211f3d 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 _0x648e=['params','includeAll','find','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','query','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x54a38b,_0x110ea2){var _0x1f8837=function(_0x3bdb73){while(--_0x3bdb73){_0x54a38b['push'](_0x54a38b['shift']());}};_0x1f8837(++_0x110ea2);}(_0x648e,0x1c1));var _0xe648=function(_0x587b3e,_0x2c419f){_0x587b3e=_0x587b3e-0x0;var _0x53c66f=_0x648e[_0x587b3e];return _0x53c66f;};'use strict';var emlformat=require(_0xe648('0x0'));var rimraf=require(_0xe648('0x1'));var zipdir=require(_0xe648('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe648('0x3'));var moment=require(_0xe648('0x4'));var BPromise=require(_0xe648('0x5'));var Mustache=require(_0xe648('0x6'));var util=require(_0xe648('0x7'));var path=require(_0xe648('0x8'));var sox=require(_0xe648('0x9'));var csv=require(_0xe648('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe648('0xb'));var _=require(_0xe648('0xc'));var squel=require(_0xe648('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe648('0xa'));var querystring=require(_0xe648('0xe'));var Papa=require(_0xe648('0xf'));var Redis=require('ioredis');var authService=require(_0xe648('0x10'));var qs=require(_0xe648('0x11'));var as=require(_0xe648('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe648('0x13'))('api');var utils=require(_0xe648('0x14'));var config=require(_0xe648('0x15'));var licenseUtil=require(_0xe648('0x16'));var db=require(_0xe648('0x17'))['db'];function respondWithStatusCode(_0x46d1d2,_0xf51380){_0xf51380=_0xf51380||0xcc;return function(_0x56dfe6){if(_0x56dfe6){return _0x46d1d2[_0xe648('0x18')](_0xf51380);}return _0x46d1d2[_0xe648('0x19')](_0xf51380)['end']();};}function respondWithResult(_0x50071e,_0x40a604){_0x40a604=_0x40a604||0xc8;return function(_0x51482c){if(_0x51482c){return _0x50071e['status'](_0x40a604)[_0xe648('0x1a')](_0x51482c);}};}function respondWithFilteredResult(_0x4b0aba,_0x3eaf71){return function(_0x500867){if(_0x500867){var _0x5b6ea8=typeof _0x3eaf71[_0xe648('0x1b')]==='undefined'&&typeof _0x3eaf71[_0xe648('0x1c')]===_0xe648('0x1d');var _0x3a3887=_0x500867[_0xe648('0x1e')];var _0x257606=_0x5b6ea8?0x0:_0x3eaf71[_0xe648('0x1b')];var _0x36ecdc=_0x5b6ea8?_0x500867[_0xe648('0x1e')]:_0x3eaf71[_0xe648('0x1b')]+_0x3eaf71['limit'];var _0x243f46;if(_0x36ecdc>=_0x3a3887){_0x36ecdc=_0x3a3887;_0x243f46=0xc8;}else{_0x243f46=0xce;}_0x4b0aba[_0xe648('0x19')](_0x243f46);return _0x4b0aba[_0xe648('0x1f')](_0xe648('0x20'),_0x257606+'-'+_0x36ecdc+'/'+_0x3a3887)[_0xe648('0x1a')](_0x500867);}return null;};}function patchUpdates(_0x3c622b){return function(_0x30d327){try{jsonpatch[_0xe648('0x21')](_0x30d327,_0x3c622b,!![]);}catch(_0x342460){return BPromise[_0xe648('0x22')](_0x342460);}return _0x30d327['save']();};}function saveUpdates(_0x1f5908,_0x3da74f){return function(_0x4aac7a){if(_0x4aac7a){return _0x4aac7a[_0xe648('0x23')](_0x1f5908)[_0xe648('0x24')](function(_0x39f6b0){return _0x39f6b0;});}return null;};}function removeEntity(_0x1cc23b,_0xed8aef){return function(_0x213080){if(_0x213080){return _0x213080['destroy']()[_0xe648('0x24')](function(){_0x1cc23b[_0xe648('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc91b,_0xb94856){return function(_0x2c9beb){if(!_0x2c9beb){_0x1dc91b[_0xe648('0x18')](0x194);}return _0x2c9beb;};}function handleError(_0x1f41a9,_0x38a4fa){_0x38a4fa=_0x38a4fa||0x1f4;return function(_0x26b971){logger[_0xe648('0x25')](_0x26b971[_0xe648('0x26')]);if(_0x26b971[_0xe648('0x27')]){delete _0x26b971[_0xe648('0x27')];}_0x1f41a9[_0xe648('0x19')](_0x38a4fa)[_0xe648('0x28')](_0x26b971);};}exports[_0xe648('0x29')]=function(_0x18e681,_0x552ca3){var _0x6e3225={},_0xfb2d3b={},_0x196f7a={'count':0x0,'rows':[]};var _0x23c6da=_['map'](db[_0xe648('0x2a')][_0xe648('0x2b')],function(_0x3a3432){return{'name':_0x3a3432[_0xe648('0x2c')],'type':_0x3a3432['type'][_0xe648('0x2d')]};});_0xfb2d3b[_0xe648('0x2e')]=_[_0xe648('0x2f')](_0x23c6da,_0xe648('0x27'));_0xfb2d3b['query']=_[_0xe648('0x30')](_0x18e681['query']);_0xfb2d3b[_0xe648('0x31')]=_[_0xe648('0x32')](_0xfb2d3b[_0xe648('0x2e')],_0xfb2d3b['query']);_0x6e3225[_0xe648('0x33')]=_['intersection'](_0xfb2d3b[_0xe648('0x2e')],qs['fields'](_0x18e681[_0xe648('0x34')][_0xe648('0x35')]));_0x6e3225[_0xe648('0x33')]=_0x6e3225[_0xe648('0x33')][_0xe648('0x36')]?_0x6e3225[_0xe648('0x33')]:_0xfb2d3b[_0xe648('0x2e')];if(!_0x18e681[_0xe648('0x34')]['hasOwnProperty']('nolimit')){_0x6e3225[_0xe648('0x1c')]=qs[_0xe648('0x1c')](_0x18e681[_0xe648('0x34')][_0xe648('0x1c')]);_0x6e3225[_0xe648('0x1b')]=qs['offset'](_0x18e681['query'][_0xe648('0x1b')]);}_0x6e3225[_0xe648('0x37')]=qs[_0xe648('0x38')](_0x18e681[_0xe648('0x34')][_0xe648('0x38')]);_0x6e3225['where']=qs[_0xe648('0x31')](_[_0xe648('0x39')](_0x18e681['query'],_0xfb2d3b[_0xe648('0x31')]),_0x23c6da);if(_0x18e681[_0xe648('0x34')][_0xe648('0x3a')]){_0x6e3225[_0xe648('0x3b')]=_[_0xe648('0x3c')](_0x6e3225[_0xe648('0x3b')],{'$or':_[_0xe648('0x2f')](_0x23c6da,function(_0x569a79){if(_0x569a79[_0xe648('0x3d')]!==_0xe648('0x3e')){var _0x3a2621={};_0x3a2621[_0x569a79['name']]={'$like':'%'+_0x18e681[_0xe648('0x34')]['filter']+'%'};return _0x3a2621;}})});}_0x6e3225=_['merge']({},_0x6e3225,_0x18e681[_0xe648('0x3f')]);var _0x1f19db={'where':_0x6e3225[_0xe648('0x3b')]};return db['FaxApplication'][_0xe648('0x1e')](_0x1f19db)[_0xe648('0x24')](function(_0x466ac8){_0x196f7a[_0xe648('0x1e')]=_0x466ac8;if(_0x18e681[_0xe648('0x34')]['includeAll']){_0x6e3225[_0xe648('0x40')]=[{'all':!![]}];}return db[_0xe648('0x2a')][_0xe648('0x41')](_0x6e3225);})['then'](function(_0x5f509c){_0x196f7a[_0xe648('0x42')]=_0x5f509c;return _0x196f7a;})[_0xe648('0x24')](respondWithFilteredResult(_0x552ca3,_0x6e3225))[_0xe648('0x43')](handleError(_0x552ca3,null));};exports[_0xe648('0x44')]=function(_0x4ea3d2,_0x137fd1){var _0x3759ac={'raw':!![],'where':{'id':_0x4ea3d2[_0xe648('0x45')]['id']}},_0x3ce096={};_0x3ce096['model']=_[_0xe648('0x30')](db['FaxApplication'][_0xe648('0x2b')]);_0x3ce096['query']=_[_0xe648('0x30')](_0x4ea3d2[_0xe648('0x34')]);_0x3ce096[_0xe648('0x31')]=_['intersection'](_0x3ce096[_0xe648('0x2e')],_0x3ce096[_0xe648('0x34')]);_0x3759ac['attributes']=_['intersection'](_0x3ce096[_0xe648('0x2e')],qs[_0xe648('0x35')](_0x4ea3d2['query'][_0xe648('0x35')]));_0x3759ac[_0xe648('0x33')]=_0x3759ac[_0xe648('0x33')][_0xe648('0x36')]?_0x3759ac[_0xe648('0x33')]:_0x3ce096['model'];if(_0x4ea3d2[_0xe648('0x34')][_0xe648('0x46')]){_0x3759ac[_0xe648('0x40')]=[{'all':!![]}];}_0x3759ac=_['merge']({},_0x3759ac,_0x4ea3d2['options']);return db[_0xe648('0x2a')][_0xe648('0x47')](_0x3759ac)[_0xe648('0x24')](handleEntityNotFound(_0x137fd1,null))[_0xe648('0x24')](respondWithResult(_0x137fd1,null))[_0xe648('0x43')](handleError(_0x137fd1,null));};exports['create']=function(_0x17646e,_0x315b2e){return db['FaxApplication']['create'](_0x17646e['body'],{})['then'](respondWithResult(_0x315b2e,0xc9))[_0xe648('0x43')](handleError(_0x315b2e,null));};exports[_0xe648('0x23')]=function(_0x315627,_0x2ced4e){if(_0x315627[_0xe648('0x48')]['id']){delete _0x315627[_0xe648('0x48')]['id'];}return db[_0xe648('0x2a')][_0xe648('0x47')]({'where':{'id':_0x315627[_0xe648('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ced4e,null))[_0xe648('0x24')](saveUpdates(_0x315627[_0xe648('0x48')],null))[_0xe648('0x24')](respondWithResult(_0x2ced4e,null))[_0xe648('0x43')](handleError(_0x2ced4e,null));};exports[_0xe648('0x49')]=function(_0x8edecf,_0x3fc987){return db['FaxApplication'][_0xe648('0x47')]({'where':{'id':_0x8edecf['params']['id']}})[_0xe648('0x24')](handleEntityNotFound(_0x3fc987,null))[_0xe648('0x24')](removeEntity(_0x3fc987,null))[_0xe648('0x43')](handleError(_0x3fc987,null));}; \ No newline at end of file +var _0x4885=['apply','reject','save','update','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','findAll','rows','catch','show','keys','include','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x2bd66c,_0x561f32){var _0x1eb24b=function(_0x4b8f17){while(--_0x4b8f17){_0x2bd66c['push'](_0x2bd66c['shift']());}};_0x1eb24b(++_0x561f32);}(_0x4885,0x150));var _0x5488=function(_0x32174f,_0x484008){_0x32174f=_0x32174f-0x0;var _0x5e7a36=_0x4885[_0x32174f];return _0x5e7a36;};'use strict';var emlformat=require(_0x5488('0x0'));var rimraf=require(_0x5488('0x1'));var zipdir=require(_0x5488('0x2'));var jsonpatch=require(_0x5488('0x3'));var rp=require(_0x5488('0x4'));var moment=require(_0x5488('0x5'));var BPromise=require(_0x5488('0x6'));var Mustache=require(_0x5488('0x7'));var util=require(_0x5488('0x8'));var path=require('path');var sox=require(_0x5488('0x9'));var csv=require(_0x5488('0xa'));var ejs=require(_0x5488('0xb'));var fs=require('fs');var fs_extra=require(_0x5488('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5488('0xd'));var jsforce=require(_0x5488('0xe'));var deskjs=require(_0x5488('0xf'));var toCsv=require(_0x5488('0xa'));var querystring=require(_0x5488('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5488('0x11'));var qs=require(_0x5488('0x12'));var as=require(_0x5488('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5488('0x14'))(_0x5488('0x15'));var utils=require(_0x5488('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5488('0x17'))['db'];function respondWithStatusCode(_0x33dc8a,_0x343552){_0x343552=_0x343552||0xcc;return function(_0x1d456f){if(_0x1d456f){return _0x33dc8a[_0x5488('0x18')](_0x343552);}return _0x33dc8a[_0x5488('0x19')](_0x343552)[_0x5488('0x1a')]();};}function respondWithResult(_0x24e166,_0x541f39){_0x541f39=_0x541f39||0xc8;return function(_0x55c574){if(_0x55c574){return _0x24e166[_0x5488('0x19')](_0x541f39)[_0x5488('0x1b')](_0x55c574);}};}function respondWithFilteredResult(_0x3f96ec,_0x19bae9){return function(_0x48dd27){if(_0x48dd27){var _0x542507=typeof _0x19bae9[_0x5488('0x1c')]===_0x5488('0x1d')&&typeof _0x19bae9[_0x5488('0x1e')]==='undefined';var _0x29a33d=_0x48dd27[_0x5488('0x1f')];var _0x1df3c6=_0x542507?0x0:_0x19bae9[_0x5488('0x1c')];var _0x1f83da=_0x542507?_0x48dd27[_0x5488('0x1f')]:_0x19bae9[_0x5488('0x1c')]+_0x19bae9[_0x5488('0x1e')];var _0x29baa8;if(_0x1f83da>=_0x29a33d){_0x1f83da=_0x29a33d;_0x29baa8=0xc8;}else{_0x29baa8=0xce;}_0x3f96ec[_0x5488('0x19')](_0x29baa8);return _0x3f96ec[_0x5488('0x20')](_0x5488('0x21'),_0x1df3c6+'-'+_0x1f83da+'/'+_0x29a33d)[_0x5488('0x1b')](_0x48dd27);}return null;};}function patchUpdates(_0x4319f7){return function(_0xb93c9e){try{jsonpatch[_0x5488('0x22')](_0xb93c9e,_0x4319f7,!![]);}catch(_0x473373){return BPromise[_0x5488('0x23')](_0x473373);}return _0xb93c9e[_0x5488('0x24')]();};}function saveUpdates(_0x37e481,_0x9f396b){return function(_0x49cbcf){if(_0x49cbcf){return _0x49cbcf[_0x5488('0x25')](_0x37e481)[_0x5488('0x26')](function(_0x5200f0){return _0x5200f0;});}return null;};}function removeEntity(_0x1d6932,_0x4627f1){return function(_0x16b0e3){if(_0x16b0e3){return _0x16b0e3['destroy']()[_0x5488('0x26')](function(){_0x1d6932[_0x5488('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4b9f,_0x3eb3bd){return function(_0x3a7a3f){if(!_0x3a7a3f){_0x4a4b9f[_0x5488('0x18')](0x194);}return _0x3a7a3f;};}function handleError(_0x466c44,_0x304e9f){_0x304e9f=_0x304e9f||0x1f4;return function(_0x4948ac){logger[_0x5488('0x27')](_0x4948ac[_0x5488('0x28')]);if(_0x4948ac[_0x5488('0x29')]){delete _0x4948ac[_0x5488('0x29')];}_0x466c44[_0x5488('0x19')](_0x304e9f)[_0x5488('0x2a')](_0x4948ac);};}exports[_0x5488('0x2b')]=function(_0x49c306,_0x741658){var _0x568d1a={},_0x43ee90={},_0x28c2ed={'count':0x0,'rows':[]};var _0x22b10e=_[_0x5488('0x2c')](db[_0x5488('0x2d')][_0x5488('0x2e')],function(_0x3a6933){return{'name':_0x3a6933[_0x5488('0x2f')],'type':_0x3a6933[_0x5488('0x30')][_0x5488('0x31')]};});_0x43ee90[_0x5488('0x32')]=_[_0x5488('0x2c')](_0x22b10e,_0x5488('0x29'));_0x43ee90['query']=_['keys'](_0x49c306[_0x5488('0x33')]);_0x43ee90[_0x5488('0x34')]=_['intersection'](_0x43ee90[_0x5488('0x32')],_0x43ee90[_0x5488('0x33')]);_0x568d1a[_0x5488('0x35')]=_['intersection'](_0x43ee90[_0x5488('0x32')],qs[_0x5488('0x36')](_0x49c306[_0x5488('0x33')]['fields']));_0x568d1a[_0x5488('0x35')]=_0x568d1a[_0x5488('0x35')][_0x5488('0x37')]?_0x568d1a[_0x5488('0x35')]:_0x43ee90[_0x5488('0x32')];if(!_0x49c306[_0x5488('0x33')][_0x5488('0x38')](_0x5488('0x39'))){_0x568d1a[_0x5488('0x1e')]=qs[_0x5488('0x1e')](_0x49c306[_0x5488('0x33')][_0x5488('0x1e')]);_0x568d1a[_0x5488('0x1c')]=qs['offset'](_0x49c306[_0x5488('0x33')]['offset']);}_0x568d1a[_0x5488('0x3a')]=qs[_0x5488('0x3b')](_0x49c306[_0x5488('0x33')][_0x5488('0x3b')]);_0x568d1a['where']=qs[_0x5488('0x34')](_[_0x5488('0x3c')](_0x49c306['query'],_0x43ee90['filters']),_0x22b10e);if(_0x49c306['query']['filter']){_0x568d1a[_0x5488('0x3d')]=_[_0x5488('0x3e')](_0x568d1a[_0x5488('0x3d')],{'$or':_[_0x5488('0x2c')](_0x22b10e,function(_0xc66aba){if(_0xc66aba[_0x5488('0x30')]!=='VIRTUAL'){var _0x5be906={};_0x5be906[_0xc66aba[_0x5488('0x29')]]={'$like':'%'+_0x49c306[_0x5488('0x33')]['filter']+'%'};return _0x5be906;}})});}_0x568d1a=_['merge']({},_0x568d1a,_0x49c306[_0x5488('0x3f')]);var _0xae6737={'where':_0x568d1a[_0x5488('0x3d')]};return db[_0x5488('0x2d')][_0x5488('0x1f')](_0xae6737)[_0x5488('0x26')](function(_0x436a52){_0x28c2ed[_0x5488('0x1f')]=_0x436a52;if(_0x49c306[_0x5488('0x33')][_0x5488('0x40')]){_0x568d1a['include']=[{'all':!![]}];}return db[_0x5488('0x2d')][_0x5488('0x41')](_0x568d1a);})[_0x5488('0x26')](function(_0x46a401){_0x28c2ed[_0x5488('0x42')]=_0x46a401;return _0x28c2ed;})[_0x5488('0x26')](respondWithFilteredResult(_0x741658,_0x568d1a))[_0x5488('0x43')](handleError(_0x741658,null));};exports[_0x5488('0x44')]=function(_0x10e0ac,_0x24b4ba){var _0x3594d7={'raw':!![],'where':{'id':_0x10e0ac['params']['id']}},_0x55f746={};_0x55f746['model']=_[_0x5488('0x45')](db[_0x5488('0x2d')][_0x5488('0x2e')]);_0x55f746[_0x5488('0x33')]=_['keys'](_0x10e0ac['query']);_0x55f746['filters']=_['intersection'](_0x55f746[_0x5488('0x32')],_0x55f746['query']);_0x3594d7[_0x5488('0x35')]=_['intersection'](_0x55f746[_0x5488('0x32')],qs[_0x5488('0x36')](_0x10e0ac[_0x5488('0x33')][_0x5488('0x36')]));_0x3594d7['attributes']=_0x3594d7['attributes']['length']?_0x3594d7[_0x5488('0x35')]:_0x55f746[_0x5488('0x32')];if(_0x10e0ac[_0x5488('0x33')][_0x5488('0x40')]){_0x3594d7[_0x5488('0x46')]=[{'all':!![]}];}_0x3594d7=_[_0x5488('0x3e')]({},_0x3594d7,_0x10e0ac['options']);return db['FaxApplication']['find'](_0x3594d7)['then'](handleEntityNotFound(_0x24b4ba,null))[_0x5488('0x26')](respondWithResult(_0x24b4ba,null))['catch'](handleError(_0x24b4ba,null));};exports[_0x5488('0x47')]=function(_0x50c546,_0x367deb){return db[_0x5488('0x2d')][_0x5488('0x47')](_0x50c546[_0x5488('0x48')],{})['then'](respondWithResult(_0x367deb,0xc9))[_0x5488('0x43')](handleError(_0x367deb,null));};exports[_0x5488('0x25')]=function(_0x887919,_0x460e7d){if(_0x887919['body']['id']){delete _0x887919[_0x5488('0x48')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x887919['params']['id']}})['then'](handleEntityNotFound(_0x460e7d,null))[_0x5488('0x26')](saveUpdates(_0x887919[_0x5488('0x48')],null))[_0x5488('0x26')](respondWithResult(_0x460e7d,null))[_0x5488('0x43')](handleError(_0x460e7d,null));};exports['destroy']=function(_0x14c6a8,_0x3ec5fe){return db['FaxApplication']['find']({'where':{'id':_0x14c6a8[_0x5488('0x49')]['id']}})[_0x5488('0x26')](handleEntityNotFound(_0x3ec5fe,null))['then'](removeEntity(_0x3ec5fe,null))[_0x5488('0x43')](handleError(_0x3ec5fe,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b7c1030..279a90b 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 _0xdfe2=['request-promise','path','../../config/environment','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1126df,_0x5d0348){var _0x13bc70=function(_0x5b6ef5){while(--_0x5b6ef5){_0x1126df['push'](_0x1126df['shift']());}};_0x13bc70(++_0x5d0348);}(_0xdfe2,0x186));var _0x2dfe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdfe2[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2dfe('0x0'));var util=require(_0x2dfe('0x1'));var logger=require(_0x2dfe('0x2'))(_0x2dfe('0x3'));var moment=require(_0x2dfe('0x4'));var BPromise=require(_0x2dfe('0x5'));var rp=require(_0x2dfe('0x6'));var fs=require('fs');var path=require(_0x2dfe('0x7'));var rimraf=require('rimraf');var config=require(_0x2dfe('0x8'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x41111c,_0x2ace51){return _0x41111c['define']('FaxApplication',attributes,{'tableName':_0x2dfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dfe('0xa'),'collate':_0x2dfe('0xb')});}; \ No newline at end of file +var _0xc231=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','../../config/environment','define','FaxApplication','fax_applications'];(function(_0x324fa3,_0x1d72d1){var _0x4f9d35=function(_0x1aa479){while(--_0x1aa479){_0x324fa3['push'](_0x324fa3['shift']());}};_0x4f9d35(++_0x1d72d1);}(_0xc231,0xe9));var _0x1c23=function(_0x6c50a8,_0x136185){_0x6c50a8=_0x6c50a8-0x0;var _0x3cd5ec=_0xc231[_0x6c50a8];return _0x3cd5ec;};'use strict';var _=require(_0x1c23('0x0'));var util=require(_0x1c23('0x1'));var logger=require('../../config/logger')(_0x1c23('0x2'));var moment=require(_0x1c23('0x3'));var BPromise=require(_0x1c23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c23('0x5'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x5b6c95,_0x36b369){return _0x5b6c95[_0x1c23('0x6')](_0x1c23('0x7'),attributes,{'tableName':_0x1c23('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c23('0x9'),'collate':_0x1c23('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2edb4c9..73782bf 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 _0xfcb1=['../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','FaxApplication','body','options','raw','where','attributes','limit','info','UpdateFaxApplication','util','moment','bluebird','../../mysqldb'];(function(_0xfcb5f,_0x4394af){var _0x3afaa4=function(_0x4ef84b){while(--_0x4ef84b){_0xfcb5f['push'](_0xfcb5f['shift']());}};_0x3afaa4(++_0x4394af);}(_0xfcb1,0x134));var _0x1fcb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfcb1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1fcb('0x0'));var moment=require(_0x1fcb('0x1'));var BPromise=require(_0x1fcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fcb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fcb('0x4'))('rpc');var config=require(_0x1fcb('0x5'));var jayson=require(_0x1fcb('0x6'));var client=jayson[_0x1fcb('0x7')][_0x1fcb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d9c12,_0x5d5e82,_0x4d25fd){return new BPromise(function(_0x23e91a,_0x5ebe1c){return client['request'](_0x5d9c12,_0x4d25fd)[_0x1fcb('0x9')](function(_0x208e10){logger['info'](_0x1fcb('0xa'),_0x5d5e82,'request\x20sent');logger[_0x1fcb('0xb')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5d5e82,_0x1fcb('0xc'),JSON[_0x1fcb('0xd')](_0x208e10));if(_0x208e10['error']){if(_0x208e10[_0x1fcb('0xe')]['code']===0x1f4){logger[_0x1fcb('0xe')](_0x1fcb('0xa'),_0x5d5e82,_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);return _0x5ebe1c(_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);}logger[_0x1fcb('0xe')](_0x1fcb('0xa'),_0x5d5e82,_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);return _0x23e91a(_0x208e10[_0x1fcb('0xe')][_0x1fcb('0xf')]);}else{logger['info'](_0x1fcb('0xa'),_0x5d5e82,'request\x20sent');_0x23e91a(_0x208e10['result'][_0x1fcb('0xf')]);}})[_0x1fcb('0x10')](function(_0x29850d){logger[_0x1fcb('0xe')](_0x1fcb('0xa'),_0x5d5e82,_0x29850d);_0x5ebe1c(_0x29850d);});});}exports['UpdateFaxApplication']=function(_0x1c843b){var _0x1573ab=this;return new Promise(function(_0x2472f9,_0x59eaa3){return db[_0x1fcb('0x11')]['update'](_0x1c843b[_0x1fcb('0x12')],{'raw':_0x1c843b[_0x1fcb('0x13')]?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c843b['options']?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x15')]||null:null,'attributes':_0x1c843b[_0x1fcb('0x13')]?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x16')]||null:null,'limit':_0x1c843b[_0x1fcb('0x13')]?_0x1c843b[_0x1fcb('0x13')][_0x1fcb('0x17')]||null:null})['then'](function(_0x44fcd6){logger[_0x1fcb('0x18')](_0x1fcb('0x19'),_0x1c843b);logger[_0x1fcb('0xb')]('UpdateFaxApplication',_0x1c843b,JSON[_0x1fcb('0xd')](_0x44fcd6));_0x2472f9(_0x44fcd6);})[_0x1fcb('0x10')](function(_0x419863){logger['error'](_0x1fcb('0x19'),_0x419863['message'],_0x1c843b);_0x59eaa3(_0x1573ab[_0x1fcb('0xe')](0x1f4,_0x419863[_0x1fcb('0xf')]));});});}; \ No newline at end of file +var _0xdfe2=['FaxApplication','body','options','raw','where','attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xdfe2,0x100));var _0x2dfe=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xdfe2[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x2dfe('0x0'));var util=require('util');var moment=require(_0x2dfe('0x1'));var BPromise=require(_0x2dfe('0x2'));var rs=require(_0x2dfe('0x3'));var fs=require('fs');var Redis=require(_0x2dfe('0x4'));var db=require(_0x2dfe('0x5'))['db'];var utils=require(_0x2dfe('0x6'));var logger=require('../../config/logger')(_0x2dfe('0x7'));var config=require('../../config/environment');var jayson=require(_0x2dfe('0x8'));var client=jayson['client'][_0x2dfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc8c1d6,_0x309ed2,_0x46ca6b){return new BPromise(function(_0x53c8a0,_0x8468a5){return client[_0x2dfe('0xa')](_0xc8c1d6,_0x46ca6b)[_0x2dfe('0xb')](function(_0x171ded){logger[_0x2dfe('0xc')](_0x2dfe('0xd'),_0x309ed2,_0x2dfe('0xe'));logger['debug'](_0x2dfe('0xf'),_0x309ed2,'request\x20sent',JSON[_0x2dfe('0x10')](_0x171ded));if(_0x171ded['error']){if(_0x171ded[_0x2dfe('0x11')][_0x2dfe('0x12')]===0x1f4){logger['error'](_0x2dfe('0xd'),_0x309ed2,_0x171ded['error'][_0x2dfe('0x13')]);return _0x8468a5(_0x171ded['error'][_0x2dfe('0x13')]);}logger['error'](_0x2dfe('0xd'),_0x309ed2,_0x171ded[_0x2dfe('0x11')][_0x2dfe('0x13')]);return _0x53c8a0(_0x171ded[_0x2dfe('0x11')][_0x2dfe('0x13')]);}else{logger[_0x2dfe('0xc')](_0x2dfe('0xd'),_0x309ed2,'request\x20sent');_0x53c8a0(_0x171ded[_0x2dfe('0x14')][_0x2dfe('0x13')]);}})[_0x2dfe('0x15')](function(_0x21852e){logger[_0x2dfe('0x11')]('FaxApplication,\x20%s,\x20%s',_0x309ed2,_0x21852e);_0x8468a5(_0x21852e);});});}exports[_0x2dfe('0x16')]=function(_0x2af7ed){var _0x42f0f0=this;return new Promise(function(_0x4b03e2,_0x23cff6){return db[_0x2dfe('0x17')]['update'](_0x2af7ed[_0x2dfe('0x18')],{'raw':_0x2af7ed['options']?_0x2af7ed[_0x2dfe('0x19')][_0x2dfe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af7ed[_0x2dfe('0x19')]?_0x2af7ed[_0x2dfe('0x19')][_0x2dfe('0x1b')]||null:null,'attributes':_0x2af7ed[_0x2dfe('0x19')]?_0x2af7ed[_0x2dfe('0x19')][_0x2dfe('0x1c')]||null:null,'limit':_0x2af7ed[_0x2dfe('0x19')]?_0x2af7ed['options'][_0x2dfe('0x1d')]||null:null})[_0x2dfe('0xb')](function(_0x11633e){logger['info']('UpdateFaxApplication',_0x2af7ed);logger[_0x2dfe('0x1e')](_0x2dfe('0x16'),_0x2af7ed,JSON[_0x2dfe('0x10')](_0x11633e));_0x4b03e2(_0x11633e);})[_0x2dfe('0x15')](function(_0x445df1){logger[_0x2dfe('0x11')]('UpdateFaxApplication',_0x445df1[_0x2dfe('0x13')],_0x2af7ed);_0x23cff6(_0x42f0f0['error'](0x1f4,_0x445df1[_0x2dfe('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 363fcf9..95e9c77 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 _0xd7d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x21c068,_0x369d6a){var _0x5cf199=function(_0x2c0159){while(--_0x2c0159){_0x21c068['push'](_0x21c068['shift']());}};_0x5cf199(++_0x369d6a);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x521df9,_0x5e3460){_0x521df9=_0x521df9-0x0;var _0x2eddfe=_0xd7d1[_0x521df9];return _0x2eddfe;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);module[_0x1d7d('0x14')]=router; \ No newline at end of file +var _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x80ed,0x11c));var _0xd80e=function(_0x12677c,_0x4b3a98){_0x12677c=_0x12677c-0x0;var _0x41d91d=_0x80ed[_0x12677c];return _0x41d91d;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c632cf5..bb3ddd9 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 _0xc772=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x1614ee,_0x45f8ca){var _0x366687=function(_0x40ae60){while(--_0x40ae60){_0x1614ee['push'](_0x1614ee['shift']());}};_0x366687(++_0x45f8ca);}(_0xc772,0xd1));var _0x2c77=function(_0x33c338,_0x33b70c){_0x33c338=_0x33c338-0x0;var _0x53b359=_0xc772[_0x33c338];return _0x53b359;};'use strict';var Sequelize=require('sequelize');module[_0x2c77('0x0')]={'closed':{'type':Sequelize[_0x2c77('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c77('0x2')]},'disposition':{'type':Sequelize[_0x2c77('0x3')]},'secondDisposition':{'type':Sequelize[_0x2c77('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2c77('0x3')]},'note':{'type':Sequelize[_0x2c77('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x2c77('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2c77('0x4')]('in',_0x2c77('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2c77('0x4')]('in',_0x2c77('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x9a2c=['out','sequelize','exports','DATE','STRING','ENUM'];(function(_0x36985e,_0x4abc77){var _0x5cc73b=function(_0x3f1dd8){while(--_0x3f1dd8){_0x36985e['push'](_0x36985e['shift']());}};_0x5cc73b(++_0x4abc77);}(_0x9a2c,0x115));var _0xc9a2=function(_0x427653,_0x4396e1){_0x427653=_0x427653-0x0;var _0x2a297c=_0x9a2c[_0x427653];return _0x2a297c;};'use strict';var Sequelize=require(_0xc9a2('0x0'));module[_0xc9a2('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc9a2('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc9a2('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc9a2('0x3')]},'note':{'type':Sequelize[_0xc9a2('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xc9a2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc9a2('0x4')]('in',_0xc9a2('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc9a2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc9a2('0x4')]('in',_0xc9a2('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d519bac..ccd936b 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 _0x3649=['SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','options','create','update','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','sort','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','merge','include','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','destroy','then','end','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','select','field','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','body','text','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','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'];(function(_0x300e01,_0x1adf56){var _0x14e002=function(_0x3e8856){while(--_0x3e8856){_0x300e01['push'](_0x300e01['shift']());}};_0x14e002(++_0x1adf56);}(_0x3649,0x130));var _0x9364=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3649[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0x9364('0x0'));var rimraf=require(_0x9364('0x1'));var zipdir=require(_0x9364('0x2'));var jsonpatch=require(_0x9364('0x3'));var rp=require(_0x9364('0x4'));var moment=require(_0x9364('0x5'));var BPromise=require(_0x9364('0x6'));var Mustache=require(_0x9364('0x7'));var util=require('util');var path=require(_0x9364('0x8'));var sox=require(_0x9364('0x9'));var csv=require(_0x9364('0xa'));var ejs=require(_0x9364('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9364('0xc'));var squel=require(_0x9364('0xd'));var crypto=require(_0x9364('0xe'));var jsforce=require(_0x9364('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9364('0x10'));var Papa=require(_0x9364('0x11'));var Redis=require('ioredis');var authService=require(_0x9364('0x12'));var qs=require(_0x9364('0x13'));var as=require(_0x9364('0x14'));var hardwareService=require(_0x9364('0x15'));var logger=require(_0x9364('0x16'))(_0x9364('0x17'));var utils=require(_0x9364('0x18'));var config=require(_0x9364('0x19'));var licenseUtil=require(_0x9364('0x1a'));var db=require(_0x9364('0x1b'))['db'];config[_0x9364('0x1c')]=_['defaults'](config[_0x9364('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9364('0x1c')]));require('./faxInteraction.socket')[_0x9364('0x1d')](socket);function respondWithStatusCode(_0x269f74,_0x305e4c){_0x305e4c=_0x305e4c||0xcc;return function(_0x18be0c){if(_0x18be0c){return _0x269f74[_0x9364('0x1e')](_0x305e4c);}return _0x269f74[_0x9364('0x1f')](_0x305e4c)['end']();};}function respondWithResult(_0x3a9cdb,_0x51c515){_0x51c515=_0x51c515||0xc8;return function(_0x7606b6){if(_0x7606b6){return _0x3a9cdb[_0x9364('0x1f')](_0x51c515)['json'](_0x7606b6);}};}function respondWithFilteredResult(_0x1fada2,_0x23a9a6){return function(_0x2b9d81){if(_0x2b9d81){var _0xd26cf1=typeof _0x23a9a6[_0x9364('0x20')]==='undefined'&&typeof _0x23a9a6[_0x9364('0x21')]==='undefined';var _0x212059=_0x2b9d81[_0x9364('0x22')];var _0x1d5d82=_0xd26cf1?0x0:_0x23a9a6[_0x9364('0x20')];var _0xbb06d4=_0xd26cf1?_0x2b9d81[_0x9364('0x22')]:_0x23a9a6['offset']+_0x23a9a6[_0x9364('0x21')];var _0x3816bf;if(_0xbb06d4>=_0x212059){_0xbb06d4=_0x212059;_0x3816bf=0xc8;}else{_0x3816bf=0xce;}_0x1fada2['status'](_0x3816bf);return _0x1fada2[_0x9364('0x23')](_0x9364('0x24'),_0x1d5d82+'-'+_0xbb06d4+'/'+_0x212059)[_0x9364('0x25')](_0x2b9d81);}return null;};}function patchUpdates(_0x491031){return function(_0x21c687){try{jsonpatch[_0x9364('0x26')](_0x21c687,_0x491031,!![]);}catch(_0x4b5d6e){return BPromise['reject'](_0x4b5d6e);}return _0x21c687[_0x9364('0x27')]();};}function saveUpdates(_0x13035e,_0x3ac8d3){return function(_0x4d67fa){if(_0x4d67fa){return _0x4d67fa['update'](_0x13035e)['then'](function(_0x49996c){return _0x49996c;});}return null;};}function removeEntity(_0x237dd1,_0x4190ff){return function(_0x10dfbb){if(_0x10dfbb){return _0x10dfbb[_0x9364('0x28')]()[_0x9364('0x29')](function(){_0x237dd1['status'](0xcc)[_0x9364('0x2a')]();});}};}function handleEntityNotFound(_0x4ea44b,_0x2f6986){return function(_0xfad4d3){if(!_0xfad4d3){_0x4ea44b[_0x9364('0x1e')](0x194);}return _0xfad4d3;};}function handleError(_0x50ec84,_0x4fdfba){_0x4fdfba=_0x4fdfba||0x1f4;return function(_0x2b2ff8){logger['error'](_0x2b2ff8[_0x9364('0x2b')]);if(_0x2b2ff8['name']){delete _0x2b2ff8[_0x9364('0x2c')];}_0x50ec84[_0x9364('0x1f')](_0x4fdfba)[_0x9364('0x2d')](_0x2b2ff8);};}function getInteractionUsers(_0x53e3b2,_0x28ee38){return new BPromise(function(_0x10609b,_0x543dde){try{if(_0x28ee38[_0x53e3b2['id']]){_0x53e3b2[_0x9364('0x2e')]=_[_0x9364('0x2f')](_0x28ee38[_0x53e3b2['id']],function(_0x3738bd){return{'id':_0x3738bd['id'],'fullname':_0x3738bd[_0x9364('0x30')]};});}}catch(_0x59fdf0){_0x543dde(_0x59fdf0);}_0x10609b(_0x53e3b2);});}function getInteractionTags(_0x598f5f,_0x207e0f){return new BPromise(function(_0x579775,_0x528d98){try{if(_0x598f5f[_0x9364('0x31')]){_0x598f5f['Tags']=[];_0x598f5f['TagIds']['split'](',')['forEach'](function(_0x53f639){_0x598f5f[_0x9364('0x32')][_0x9364('0x33')](_0x207e0f[_0x53f639]);});}delete _0x598f5f['TagIds'];}catch(_0x2df301){_0x528d98(_0x2df301);}_0x579775(_0x598f5f);});}function updateFaxInteraction(_0x3e177d,_0x502e1a,_0xeb5f8a){return new BPromise(function(_0x24612c,_0x209a0e){return getInteractionUsers(_0x3e177d,_0xeb5f8a)[_0x9364('0x29')](function(_0x34c669){return getInteractionTags(_0x34c669,_0x502e1a);})[_0x9364('0x29')](function(_0x8cf7c0){return getStateInteraction(_0x8cf7c0);})[_0x9364('0x29')](function(_0xfa4bb2){_0x24612c(_0xfa4bb2);})[_0x9364('0x34')](function(_0x32943c){_0x209a0e(_0x32943c);});});}function getStateInteraction(_0x1e2100){return new BPromise(function(_0x1f04b6){_0x1e2100[_0x9364('0x35')]=0x0;_0x1e2100[_0x9364('0x36')]=0x0;_0x1e2100[_0x9364('0x37')]=0x0;_0x1e2100[_0x9364('0x38')]=0x0;_0x1e2100[_0x9364('0x39')]=0x0;if(!_0x1e2100[_0x9364('0x3a')]&&!_0x1e2100['UserId']){_0x1e2100[_0x9364('0x35')]+=0x1;}if(!_0x1e2100[_0x9364('0x3a')]&&_0x1e2100[_0x9364('0x3b')]){_0x1e2100[_0x9364('0x36')]+=0x1;if(_0x1e2100[_0x9364('0x35')]){_0x1e2100[_0x9364('0x35')]-=0x1;}}if(_0x1e2100[_0x9364('0x3a')]&&_0x1e2100[_0x9364('0x3b')]){_0x1e2100['answered']+=0x1;if(_0x1e2100[_0x9364('0x36')]){_0x1e2100[_0x9364('0x36')]-=0x1;}}if(_0x1e2100[_0x9364('0x3a')]&&!_0x1e2100[_0x9364('0x3b')]){_0x1e2100[_0x9364('0x38')]+=0x1;if(_0x1e2100['waiting']){_0x1e2100[_0x9364('0x35')]-=0x1;}}_0x1e2100[_0x9364('0x39')]+=0x1;_0x1f04b6(_0x1e2100);});}exports[_0x9364('0x3c')]=function(_0x9f52fe,_0x4b7684){var _0x4cbe3a={},_0x531660={},_0x40833d={'count':0x0,'rows':[]};var _0x7d6e2c=_[_0x9364('0x2f')](db[_0x9364('0x3d')][_0x9364('0x3e')],function(_0x3a9f25){return{'name':_0x3a9f25[_0x9364('0x3f')],'type':_0x3a9f25[_0x9364('0x40')][_0x9364('0x41')]};});_0x531660[_0x9364('0x42')]=_[_0x9364('0x2f')](_0x7d6e2c,_0x9364('0x2c'));_0x531660[_0x9364('0x43')]=_[_0x9364('0x44')](_0x9f52fe[_0x9364('0x43')]);_0x531660[_0x9364('0x45')]=_['intersection'](_0x531660[_0x9364('0x42')],_0x531660[_0x9364('0x43')]);_0x4cbe3a[_0x9364('0x46')]=_[_0x9364('0x47')](_0x531660[_0x9364('0x42')],qs['fields'](_0x9f52fe['query'][_0x9364('0x48')]));_0x4cbe3a['attributes']=_0x4cbe3a[_0x9364('0x46')][_0x9364('0x49')]?_0x4cbe3a[_0x9364('0x46')]:_0x531660[_0x9364('0x42')];if(!_0x9f52fe[_0x9364('0x43')][_0x9364('0x4a')](_0x9364('0x4b'))){_0x4cbe3a[_0x9364('0x21')]=qs[_0x9364('0x21')](_0x9f52fe[_0x9364('0x43')][_0x9364('0x21')]);_0x4cbe3a['offset']=qs[_0x9364('0x20')](_0x9f52fe[_0x9364('0x43')]['offset']);}_0x4cbe3a[_0x9364('0x4c')]=qs['sort'](_0x9f52fe['query']['sort']);_0x4cbe3a[_0x9364('0x4d')]=qs[_0x9364('0x45')](_[_0x9364('0x4e')](_0x9f52fe['query'],_0x531660[_0x9364('0x45')]),_0x7d6e2c);var _0x1475b5=[];var _0x4ee739=squel[_0x9364('0x4f')]()['field']('id')[_0x9364('0x50')](_0x9364('0x2c'))[_0x9364('0x50')]('color')[_0x9364('0x51')](_0x9364('0x52'));var _0x48b6e5=squel['select']()['field'](_0x9364('0x53'))['field']('u.fullname')[_0x9364('0x50')](_0x9364('0x54'))[_0x9364('0x51')](_0x9364('0x55'),'ui')[_0x9364('0x56')](_0x9364('0x57'),'u',_0x9364('0x58'));var _0x5f1417=squel['select']()['from'](_0x9364('0x59'),'i')[_0x9364('0x56')]('cm_contacts','c',_0x9364('0x5a'))[_0x9364('0x56')](_0x9364('0x57'),'o','o.id\x20=\x20i.UserId')[_0x9364('0x56')](_0x9364('0x5b'),'a',_0x9364('0x5c'))[_0x9364('0x56')](_0x9364('0x5d'),'me',_0x9364('0x5e'))['left_join'](_0x9364('0x5f'),'it',_0x9364('0x60'))['left_join'](_0x9364('0x52'),'t','t.id\x20=\x20it.TagId');var _0x1b7efc=squel['expr']();var _0x59fb18=[];var _0x125801=squel[_0x9364('0x61')]();var _0x274111;if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x62')]){_0x274111=as[_0x9364('0x63')](_0x9f52fe[_0x9364('0x43')]['search']);var _0x489fde=_0x274111[_0x9364('0x64')];for(var _0x3a7d46=0x0;_0x3a7d46<_0x274111[_0x9364('0x65')][_0x9364('0x49')];_0x3a7d46++){var _0x4b6e45=_0x274111['conditions'][_0x3a7d46];var _0x124da4='i';var _0x3601aa=_[_0x9364('0x66')](_0x7d6e2c,[_0x9364('0x2c'),_0x4b6e45[_0x9364('0x50')]]);if(!_0x3601aa){switch(_0x4b6e45[_0x9364('0x50')]){case _0x9364('0x67'):if(_0x4b6e45[_0x9364('0x68')]==0x1){_0x5f1417['having']('`'+_0x4b6e45['field']+_0x9364('0x69'));}else{_0x5f1417[_0x9364('0x6a')]('`'+_0x4b6e45[_0x9364('0x50')]+_0x9364('0x6b'));}break;case _0x9364('0x6c'):if(_0x4b6e45['operator']===_0x9364('0x6d')){if(_0x4b6e45[_0x9364('0x68')][_0x9364('0x6e')]('\x20')[_0x9364('0x49')]>0x1){_0x1b7efc[_0x489fde](_0x9364('0x6f'),qs['getFullTextValue'](_0x4b6e45[_0x9364('0x68')]),null);}else{var _0x544a4='%'+_0x4b6e45[_0x9364('0x68')]+'%';_0x1b7efc[_0x489fde](_0x9364('0x70'),_0x544a4,_0x544a4,_0x544a4);}}else{_0x3601aa=_['find'](_0x7d6e2c,[_0x9364('0x2c'),_0x9364('0x71')]);_0x4b6e45[_0x9364('0x50')]=_0x9364('0x71');_0x5a7366=as[_0x9364('0x72')](_0x124da4,_0x3601aa[_0x9364('0x40')],_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366['text'],_0x5a7366[_0x9364('0x68')][_0x9364('0x73')],_0x5a7366[_0x9364('0x68')]['end']);}break;case _0x9364('0x74'):var _0x1bbc4f=_0x4b6e45[_0x9364('0x68')][_0x9364('0x6e')](',')[_0x9364('0x2f')](function(_0x474be9){return Number(_0x474be9);});_0x1bbc4f[_0x9364('0x75')](function(_0x2f6a33){_0x125801['or'](_0x9364('0x76'),'%,'+_0x2f6a33+',%');});_0x59fb18=_['union'](_0x59fb18,_0x1bbc4f);break;case _0x9364('0x77'):if(_0x4b6e45[_0x9364('0x78')]===_0x9364('0x6d')){_0x1b7efc[_0x489fde]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b6e45[_0x9364('0x68')]+'%',null);}else{_0x3601aa=_[_0x9364('0x66')](_0x7d6e2c,['name',_0x9364('0x3b')]);_0x4b6e45[_0x9364('0x50')]='UserId';_0x5a7366=as[_0x9364('0x72')](_0x124da4,_0x3601aa[_0x9364('0x40')],_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366['text'],_0x5a7366[_0x9364('0x68')][_0x9364('0x73')],_0x5a7366[_0x9364('0x68')]['end']);}break;case _0x9364('0x79'):_0x5a7366=as['buildExpression']('me',null,_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366[_0x9364('0x7a')],_0x5a7366[_0x9364('0x68')][_0x9364('0x73')],_0x5a7366['value'][_0x9364('0x2a')]);break;}}else{var _0x5a7366=as[_0x9364('0x72')](_0x124da4,_0x3601aa[_0x9364('0x40')],_0x4b6e45);_0x1b7efc[_0x489fde](_0x5a7366[_0x9364('0x7a')],_0x5a7366[_0x9364('0x68')]['start'],_0x5a7366['value'][_0x9364('0x2a')]);}}}else{var _0x23d015=_(_0x9f52fe[_0x9364('0x43')])['keys']()[_0x9364('0x2f')](function(_0x33eaf4){return _[_0x9364('0x7b')](_0x7d6e2c,['name',_0x33eaf4])?_0x33eaf4:undefined;})[_0x9364('0x7c')]()[_0x9364('0x68')]();if(!_['isEmpty'](_0x23d015)){_0x23d015['forEach'](function(_0xd49e0f){if(_0xd49e0f===_0x9364('0x7d')){_0x5f1417['where'](_0x9364('0x7e'),[][_0x9364('0x7f')](_0x9f52fe[_0x9364('0x43')][_0xd49e0f]));}else if(_0xd49e0f===_0x9364('0x80')){var _0x43e86b=JSON[_0x9364('0x81')](_0x9f52fe[_0x9364('0x43')][_0xd49e0f])[_0x9364('0x82')];var _0x15fe1a=JSON[_0x9364('0x81')](_0x9f52fe[_0x9364('0x43')][_0xd49e0f])[_0x9364('0x83')];_0x5f1417[_0x9364('0x4d')](_0x9364('0x84'),_0x43e86b,_0x15fe1a);}else{if(_0x9f52fe[_0x9364('0x43')][_0xd49e0f]===_0x9364('0x85')){_0x5f1417[_0x9364('0x4d')]('i.'+_0xd49e0f+'\x20IS\x20NULL');}else{_0x5f1417['where']('i.'+_0xd49e0f+_0x9364('0x86'),_0x9f52fe['query'][_0xd49e0f]);}}});}if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x87')]){if(_0x9f52fe['query'][_0x9364('0x87')]==0x1){_0x5f1417[_0x9364('0x6a')](_0x9364('0x88'));}else{_0x5f1417[_0x9364('0x6a')]('`unreadMessages`\x20>\x200');}}if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')]){_0x59fb18=_[_0x9364('0x8a')](_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')])?_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')]:new Array(_0x9f52fe[_0x9364('0x43')][_0x9364('0x89')]);_0x59fb18[_0x9364('0x75')](function(_0x5dfccb){_0x125801['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5dfccb+',%');});}if(_0x9f52fe['query']['filter']){var _0x12b19c=_0x9f52fe[_0x9364('0x43')][_0x9364('0x8b')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9364('0x8c')](_0x12b19c)){_0x1b7efc['or'](_0x9364('0x8d'),_0x12b19c+'%')['or'](_0x9364('0x8e'),_0x12b19c+'%');}_0x1b7efc['or'](_0x9364('0x8f'),_0x12b19c+'%');}}_0x5f1417['where'](_0x1b7efc);_0x5f1417[_0x9364('0x90')](_0x9364('0x91'));var _0x1d6353={'type':db[_0x9364('0x92')][_0x9364('0x93')][_0x9364('0x94')],'raw':!![]};var _0x138084=_0x5f1417['clone']();_0x138084[_0x9364('0x50')](_0x9364('0x91'));_0x138084['field'](_0x9364('0x95'),_0x9364('0x67'));if(_0x4cbe3a['order']){_0x4cbe3a['order'][_0x9364('0x75')](function(_0x5eba58){var _0x1f1c90=_0x5eba58[0x0]===_0x9364('0x96')?_0x5eba58[0x0]:'i.'+_0x5eba58[0x0];_0x5f1417[_0x9364('0x4c')](_0x1f1c90,_0x5eba58[0x1]===_0x9364('0x97')?![]:!![]);});}if(!_[_0x9364('0x98')](_0x59fb18)){_0x5f1417[_0x9364('0x6a')](_0x125801);_0x138084[_0x9364('0x4d')](_0x9364('0x99'),_0x59fb18);}BPromise[_0x9364('0x9a')]()[_0x9364('0x29')](function(){if(!_0x274111){if(_0x9f52fe[_0x9364('0x43')]['FaxAccountId'])return;_0x138084[_0x9364('0x4d')](_0x9364('0x9b'));_0x5f1417[_0x9364('0x4d')](_0x9364('0x9b'));return;}if(_0x9f52fe[_0x9364('0x9c')][_0x9364('0x9d')]!=='agent')return;return _0x9f52fe[_0x9364('0x9c')][_0x9364('0x9e')]({'attributes':['id'],'raw':!![]})[_0x9364('0x29')](function(_0x46afe6){if(_[_0x9364('0x98')](_0x46afe6)){_0x138084[_0x9364('0x4d')](_0x9364('0x9f'));_0x5f1417[_0x9364('0x4d')](_0x9364('0x9f'));}else{_0x138084['where'](_0x9364('0x7e'),_[_0x9364('0x2f')](_0x46afe6,'id'));_0x5f1417[_0x9364('0x4d')](_0x9364('0x7e'),_[_0x9364('0x2f')](_0x46afe6,'id'));}});})[_0x9364('0x29')](function(){if(_0x9f52fe[_0x9364('0x9c')]['role']===_0x9364('0xa0')&&!_0x274111&&!_0x9f52fe['query'][_0x9364('0x7d')])return[];return db[_0x9364('0xa1')][_0x9364('0x43')](_0x138084[_0x9364('0xa2')](),_0x1d6353);})['then'](function(_0x47ffab){_0x40833d[_0x9364('0x22')]=_0x47ffab[_0x9364('0x49')];if(_0x40833d[_0x9364('0x22')]===0x0)return[];return db[_0x9364('0xa1')][_0x9364('0x43')](_0x4ee739[_0x9364('0xa2')](),_0x1d6353)[_0x9364('0x29')](function(_0xc0403d){_0x1475b5=_['keyBy'](_0xc0403d,'id');_0x1d6353=_['merge'](_0x1d6353,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9f52fe[_0x9364('0x43')][_0x9364('0x48')]){_0x4cbe3a[_0x9364('0x46')][_0x9364('0x75')](function(_0x1d5fbd){_0x5f1417[_0x9364('0x50')]('i.'+_0x1d5fbd);});}else{_0x5f1417[_0x9364('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9364('0x67'));_0x5f1417['field'](_0x9364('0xa3'),_0x9364('0xa4'));_0x5f1417['field'](_0x9364('0xa5'),_0x9364('0xa6'));_0x5f1417[_0x9364('0x50')]('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',_0x9364('0x96'));_0x5f1417[_0x9364('0x50')](_0x9364('0xa7'));_0x5f1417['field']('c.firstName',_0x9364('0xa8'));_0x5f1417[_0x9364('0x50')]('c.lastName',_0x9364('0xa9'));_0x5f1417[_0x9364('0x50')](_0x9364('0xaa'),_0x9364('0xab'));_0x5f1417['field'](_0x9364('0xac'),'Contact.phone');_0x5f1417[_0x9364('0x50')]('c.mobile',_0x9364('0xad'));_0x5f1417[_0x9364('0x50')](_0x9364('0xae'),_0x9364('0xaf'));_0x5f1417[_0x9364('0x50')]('o.fullname','Owner.fullname');_0x5f1417[_0x9364('0x50')](_0x9364('0xb0'),_0x9364('0xb1'));_0x5f1417[_0x9364('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4cbe3a[_0x9364('0x21')])_0x5f1417[_0x9364('0x21')](_0x4cbe3a[_0x9364('0x21')]);if(_0x4cbe3a[_0x9364('0x20')])_0x5f1417[_0x9364('0x20')](_0x4cbe3a[_0x9364('0x20')]);return db[_0x9364('0xa1')]['query'](_0x5f1417[_0x9364('0xa2')](),_0x1d6353);})[_0x9364('0x29')](function(_0x42a9d0){if(_0x42a9d0['length']>0x0)_0x48b6e5['where'](_0x9364('0xb2'),_[_0x9364('0x2f')](_0x42a9d0,'id'));return db[_0x9364('0xa1')][_0x9364('0x43')](_0x48b6e5[_0x9364('0xa2')](),_0x1d6353)[_0x9364('0x29')](function(_0x91a492){var _0x1878a0=_[_0x9364('0xb3')](_0x91a492,'FaxInteractionId');var _0x340e99=[];_0x42a9d0['forEach'](function(_0xac0743){_0x340e99[_0x9364('0x33')](updateFaxInteraction(_0xac0743,_0x1475b5,_0x1878a0));});return BPromise[_0x9364('0xb4')](_0x340e99);});});})[_0x9364('0x29')](function(_0x107841){_0x40833d[_0x9364('0xb5')]=_0x107841;return _0x40833d;})[_0x9364('0x29')](respondWithFilteredResult(_0x4b7684,_0x4cbe3a))[_0x9364('0x34')](handleError(_0x4b7684,null));};exports[_0x9364('0xb6')]=function(_0x14767a,_0x546338){var _0x5af4e9={'raw':![],'where':{'id':_0x14767a['params']['id']}},_0x9dbf57={};_0x9dbf57[_0x9364('0x42')]=_[_0x9364('0x44')](db[_0x9364('0x3d')][_0x9364('0x3e')]);_0x9dbf57[_0x9364('0x43')]=_[_0x9364('0x44')](_0x14767a[_0x9364('0x43')]);_0x9dbf57[_0x9364('0x45')]=_['intersection'](_0x9dbf57[_0x9364('0x42')],_0x9dbf57['query']);_0x5af4e9[_0x9364('0x46')]=_[_0x9364('0x47')](_0x9dbf57[_0x9364('0x42')],qs['fields'](_0x14767a[_0x9364('0x43')][_0x9364('0x48')]));_0x5af4e9['attributes']=_0x5af4e9[_0x9364('0x46')][_0x9364('0x49')]?_0x5af4e9[_0x9364('0x46')]:_0x9dbf57[_0x9364('0x42')];if(_0x14767a['query'][_0x9364('0xb7')]){_0x5af4e9['include']=[{'all':!![]}];}_0x5af4e9=_['merge']({},_0x5af4e9,_0x14767a[_0x9364('0xb8')]);return db[_0x9364('0x3d')][_0x9364('0x66')](_0x5af4e9)['then'](handleEntityNotFound(_0x546338,null))['then'](respondWithResult(_0x546338,null))['catch'](handleError(_0x546338,null));};exports[_0x9364('0xb9')]=function(_0x36ffbb,_0x4058ec){return db[_0x9364('0x3d')][_0x9364('0xb9')](_0x36ffbb[_0x9364('0x79')],{})[_0x9364('0x29')](respondWithResult(_0x4058ec,0xc9))['catch'](handleError(_0x4058ec,null));};exports[_0x9364('0xba')]=function(_0x4728bf,_0x974101){if(_0x4728bf[_0x9364('0x79')]['id']){delete _0x4728bf[_0x9364('0x79')]['id'];}return db['FaxInteraction'][_0x9364('0x66')]({'where':{'id':_0x4728bf['params']['id']}})['then'](handleEntityNotFound(_0x974101,null))[_0x9364('0x29')](saveUpdates(_0x4728bf[_0x9364('0x79')],null))[_0x9364('0x29')](respondWithResult(_0x974101,null))[_0x9364('0x34')](handleError(_0x974101,null));};exports['destroy']=function(_0x2d5b2d,_0x4e1e18){return db[_0x9364('0x3d')][_0x9364('0x66')]({'where':{'id':_0x2d5b2d[_0x9364('0xbb')]['id']}})[_0x9364('0x29')](handleEntityNotFound(_0x4e1e18,null))[_0x9364('0x29')](removeEntity(_0x4e1e18,null))[_0x9364('0x34')](handleError(_0x4e1e18,null));};exports[_0x9364('0xbc')]=function(_0x44a10b,_0x517cd4){return db['FaxInteraction'][_0x9364('0xbc')]()[_0x9364('0x29')](respondWithResult(_0x517cd4,null))[_0x9364('0x34')](handleError(_0x517cd4,null));};exports[_0x9364('0xbd')]=function(_0x19f14b,_0x58c21a,_0x5c989a){return db[_0x9364('0xbe')][_0x9364('0x66')]({'where':{'id':_0x19f14b['params']['id']}})[_0x9364('0x29')](handleEntityNotFound(_0x58c21a,null))['then'](function(_0x5d6783){if(_0x5d6783){return _0x5d6783['addMessage'](_0x19f14b[_0x9364('0x79')][_0x9364('0xbf')],_[_0x9364('0xc0')](_0x19f14b[_0x9364('0x79')],['ids','id'])||{});}})['then'](respondWithResult(_0x58c21a,null))[_0x9364('0x34')](handleError(_0x58c21a,null));};exports[_0x9364('0xc1')]=function(_0x210c2e,_0xcdd8c5,_0x37a2f8){var _0x334a84={'raw':![],'where':{}};var _0x561372={};var _0x11ad05={'count':0x0,'rows':[]};return db[_0x9364('0x3d')][_0x9364('0xc2')]({'where':{'id':_0x210c2e['params']['id']}})[_0x9364('0x29')](handleEntityNotFound(_0xcdd8c5,null))[_0x9364('0x29')](function(_0x24fb81){if(_0x24fb81){_0x561372[_0x9364('0x42')]=_[_0x9364('0x44')](db[_0x9364('0xbe')][_0x9364('0x3e')]);_0x561372[_0x9364('0x43')]=_[_0x9364('0x44')](_0x210c2e[_0x9364('0x43')]);_0x561372[_0x9364('0x45')]=_[_0x9364('0x47')](_0x561372[_0x9364('0x42')],_0x561372[_0x9364('0x43')]);_0x334a84[_0x9364('0x46')]=_['intersection'](_0x561372[_0x9364('0x42')],qs[_0x9364('0x48')](_0x210c2e[_0x9364('0x43')][_0x9364('0x48')]));_0x334a84[_0x9364('0x46')]=_0x334a84[_0x9364('0x46')][_0x9364('0x49')]?_0x334a84[_0x9364('0x46')]:_0x561372['model'];if(!_0x210c2e[_0x9364('0x43')][_0x9364('0x4a')]('nolimit')){_0x334a84['limit']=qs[_0x9364('0x21')](_0x210c2e[_0x9364('0x43')][_0x9364('0x21')]);_0x334a84['offset']=qs[_0x9364('0x20')](_0x210c2e[_0x9364('0x43')][_0x9364('0x20')]);}_0x334a84[_0x9364('0x4c')]=qs[_0x9364('0xc3')](_0x210c2e[_0x9364('0x43')][_0x9364('0xc3')]);_0x334a84[_0x9364('0x4d')]=qs[_0x9364('0x45')](_[_0x9364('0x4e')](_0x210c2e[_0x9364('0x43')],_0x561372[_0x9364('0x45')]));_0x334a84[_0x9364('0x4d')][_0x9364('0xc4')]=_0x24fb81['id'];if(_0x210c2e[_0x9364('0x43')][_0x9364('0x8b')]){_0x334a84[_0x9364('0x4d')]=_['merge'](_0x334a84[_0x9364('0x4d')],{'$or':_['map'](_0x334a84[_0x9364('0x46')],function(_0x5e5cbe){var _0x39771c={};_0x39771c[_0x5e5cbe]={'$like':'%'+_0x210c2e[_0x9364('0x43')][_0x9364('0x8b')]+'%'};return _0x39771c;})});}if(_0x210c2e['query'][_0x9364('0x82')]){var _0x355e96=_0x210c2e['query'][_0x9364('0x82')][_0x9364('0x6e')](',');var _0x2aaddc={};_0x2aaddc[_0x355e96[0x0]]={'$gte':moment(_0x355e96[0x1])[_0x9364('0xc5')](_0x9364('0xc6'))};_0x334a84['where']=_[_0x9364('0xc7')](_0x334a84[_0x9364('0x4d')],_0x2aaddc);}_0x334a84=_['merge']({},_0x334a84,_0x210c2e[_0x9364('0xb8')]);return db['FaxMessage'][_0x9364('0x22')]({'where':_0x334a84[_0x9364('0x4d')]})[_0x9364('0x29')](function(_0x543530){_0x11ad05[_0x9364('0x22')]=_0x543530;if(_0x210c2e[_0x9364('0x43')][_0x9364('0xb7')]){_0x334a84[_0x9364('0xc8')]=[{'all':!![]}];}return db[_0x9364('0xbe')][_0x9364('0xc9')](_0x334a84);})[_0x9364('0x29')](function(_0x4bc95a){_0x11ad05[_0x9364('0xb5')]=_0x4bc95a;return _0x11ad05;});}})[_0x9364('0x29')](respondWithFilteredResult(_0xcdd8c5,_0x334a84))['catch'](handleError(_0xcdd8c5,null));};exports[_0x9364('0xca')]=function(_0x557d81,_0xe0346b,_0x15111a){return db['FaxInteraction'][_0x9364('0x66')]({'where':{'id':_0x557d81[_0x9364('0xbb')]['id']}})[_0x9364('0x29')](handleEntityNotFound(_0xe0346b,null))[_0x9364('0x29')](function(_0x20e681){if(_0x20e681){return _0x20e681[_0x9364('0xcb')](_0x557d81[_0x9364('0x79')]['ids'],_[_0x9364('0xc0')](_0x557d81[_0x9364('0x79')],[_0x9364('0xbf'),'id'])||{})[_0x9364('0xcc')](function(){return db['Tag'][_0x9364('0xc9')]({'attributes':['id',_0x9364('0x2c'),_0x9364('0xcd')],'where':{'id':_0x557d81[_0x9364('0x79')]['ids']}});})[_0x9364('0x29')](function(_0x4960b8){socket[_0x9364('0xce')](_0x9364('0xcf'),{'id':Number(_0x557d81[_0x9364('0xbb')]['id']),'tags':_0x4960b8||[]});return{'id':Number(_0x557d81[_0x9364('0xbb')]['id']),'tags':_0x4960b8||[]};});}})[_0x9364('0x29')](respondWithResult(_0xe0346b,null))[_0x9364('0x34')](handleError(_0xe0346b,null));};exports[_0x9364('0xd0')]=function(_0x21871c,_0x1e3d15,_0x16de34){return db[_0x9364('0x3d')]['find']({'where':{'id':_0x21871c[_0x9364('0xbb')]['id']}})[_0x9364('0x29')](handleEntityNotFound(_0x1e3d15,null))['then'](function(_0x54b48f){if(_0x54b48f){return _0x54b48f[_0x9364('0xd0')](_0x21871c[_0x9364('0x43')]['ids']);}})[_0x9364('0x29')](respondWithStatusCode(_0x1e3d15,null))['catch'](handleError(_0x1e3d15,null));};exports[_0x9364('0xd1')]=function(_0x1a9bef,_0x3d62dd){var _0xe1afe8=moment()[_0x9364('0xd2')]()[_0x9364('0xa2')]();var _0x47faa9=path[_0x9364('0xd3')](config['root'],_0x9364('0xd4'),'files',_0x9364('0xd5'));var _0xd28209=path['join'](config[_0x9364('0xd6')],_0x9364('0xd4'),'files',_0x9364('0xd7'));var _0x5bf791=path[_0x9364('0xd3')](_0x47faa9,_0xe1afe8);var _0x47f918=util[_0x9364('0xc5')](_0x9364('0xd8'),_0x1a9bef[_0x9364('0xbb')]['id'],_0xe1afe8);var _0x4b6f2e=path[_0x9364('0xd3')](_0x47faa9,_0x47f918);var _0x5e95e1=[];_0x5e95e1[_0x9364('0x33')]({'model':db[_0x9364('0xd9')],'as':_0x9364('0xd9'),'raw':!![]});var _0x5ba71d=[{'model':db['FaxMessage'],'as':_0x9364('0xda'),'attributes':['id',_0x9364('0x79'),_0x9364('0x80')],'include':_0x5e95e1}];return db[_0x9364('0x3d')][_0x9364('0x66')]({'where':{'id':_0x1a9bef[_0x9364('0xbb')]['id']},'include':_0x5ba71d})[_0x9364('0x29')](handleEntityNotFound(_0x3d62dd,null))['then'](function(_0x5ad426){if(_0x5ad426&&_0x5ad426[_0x9364('0xda')]){var _0x564861=_0x5ad426['get']({'plain':!![]});fs['mkdirSync'](_0x5bf791);for(var _0x16a77c=0x0;_0x16a77c<_0x564861[_0x9364('0xda')][_0x9364('0x49')];_0x16a77c++){var _0x3a22f4=_0x564861[_0x9364('0xda')][_0x16a77c][_0x9364('0xd9')];if(_0x3a22f4){var _0xf22af3=path[_0x9364('0xd3')](_0xd28209,_0x3a22f4[_0x9364('0xdb')]);if(fs[_0x9364('0xdc')](_0xf22af3)){fs[_0x9364('0xdd')](_0xf22af3)[_0x9364('0xde')](fs[_0x9364('0xdf')](path[_0x9364('0xd3')](_0x5bf791,_0x3a22f4['basename'])));}}}return BPromise[_0x9364('0x9a')]()[_0x9364('0x29')](function(){return new BPromise(function(_0x5aea7e,_0x321b17){zipdir(_0x5bf791,{'saveTo':_0x4b6f2e},function(_0x21b0df,_0x2231c3){if(_0x21b0df)return _0x321b17(_0x21b0df);return _0x5aea7e(_0x2231c3);});})['then'](function(){return new BPromise(function(_0x29264b,_0x4794e6){rimraf(_0x5bf791,function(_0x2dd231){if(_0x2dd231)_0x4794e6(_0x2dd231);return _0x29264b();});});})[_0x9364('0x29')](function(){return _0x3d62dd['download'](_0x4b6f2e,_0x47f918,function(_0x16ebb5){if(_0x16ebb5){console[_0x9364('0xe0')](_0x9364('0xe1'),_0x16ebb5);}else{fs['unlinkSync'](_0x4b6f2e);}});});});}else{return _0x3d62dd[_0x9364('0x1e')](0xc8);}})[_0x9364('0x34')](handleError(_0x3d62dd,null));}; \ No newline at end of file +var _0xcccb=['apply','update','then','destroy','sendStatus','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','talking','unmanaged','closed','UserId','waiting','answered','total','index','FaxInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','body','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','count','merge','Account.key','a.mandatoryDisposition','contactName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','params','rawAttributes','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','FaxInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','findAll','faxInteractionTags:save','removeTags','unix','join','root','tmp','server','files','Attachment','Messages','basename','createWriteStream','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxInteraction.socket','status','end','json','offset','limit','set','Content-Range'];(function(_0x165672,_0xf98d8c){var _0x17075d=function(_0x1d9dee){while(--_0x1d9dee){_0x165672['push'](_0x165672['shift']());}};_0x17075d(++_0xf98d8c);}(_0xcccb,0xae));var _0xbccc=function(_0xa81d08,_0x4d2b16){_0xa81d08=_0xa81d08-0x0;var _0x38a324=_0xcccb[_0xa81d08];return _0x38a324;};'use strict';var emlformat=require(_0xbccc('0x0'));var rimraf=require(_0xbccc('0x1'));var zipdir=require(_0xbccc('0x2'));var jsonpatch=require(_0xbccc('0x3'));var rp=require(_0xbccc('0x4'));var moment=require(_0xbccc('0x5'));var BPromise=require(_0xbccc('0x6'));var Mustache=require(_0xbccc('0x7'));var util=require(_0xbccc('0x8'));var path=require(_0xbccc('0x9'));var sox=require(_0xbccc('0xa'));var csv=require(_0xbccc('0xb'));var ejs=require(_0xbccc('0xc'));var fs=require('fs');var fs_extra=require(_0xbccc('0xd'));var _=require(_0xbccc('0xe'));var squel=require('squel');var crypto=require(_0xbccc('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbccc('0x10'));var Papa=require(_0xbccc('0x11'));var Redis=require('ioredis');var authService=require(_0xbccc('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbccc('0x13'));var logger=require('../../config/logger')(_0xbccc('0x14'));var utils=require('../../config/utils');var config=require(_0xbccc('0x15'));var licenseUtil=require(_0xbccc('0x16'));var db=require(_0xbccc('0x17'))['db'];config[_0xbccc('0x18')]=_[_0xbccc('0x19')](config[_0xbccc('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbccc('0x18')]));require(_0xbccc('0x1a'))['register'](socket);function respondWithStatusCode(_0x370e58,_0x5a5510){_0x5a5510=_0x5a5510||0xcc;return function(_0x2e2052){if(_0x2e2052){return _0x370e58['sendStatus'](_0x5a5510);}return _0x370e58[_0xbccc('0x1b')](_0x5a5510)[_0xbccc('0x1c')]();};}function respondWithResult(_0x3e6e15,_0x3bd55c){_0x3bd55c=_0x3bd55c||0xc8;return function(_0x4b56ba){if(_0x4b56ba){return _0x3e6e15['status'](_0x3bd55c)[_0xbccc('0x1d')](_0x4b56ba);}};}function respondWithFilteredResult(_0xb17f61,_0x327f5a){return function(_0x5065f7){if(_0x5065f7){var _0x2bc915=typeof _0x327f5a[_0xbccc('0x1e')]==='undefined'&&typeof _0x327f5a['limit']==='undefined';var _0x4300f8=_0x5065f7['count'];var _0x1d97e7=_0x2bc915?0x0:_0x327f5a[_0xbccc('0x1e')];var _0x4bd225=_0x2bc915?_0x5065f7['count']:_0x327f5a[_0xbccc('0x1e')]+_0x327f5a[_0xbccc('0x1f')];var _0x28c856;if(_0x4bd225>=_0x4300f8){_0x4bd225=_0x4300f8;_0x28c856=0xc8;}else{_0x28c856=0xce;}_0xb17f61['status'](_0x28c856);return _0xb17f61[_0xbccc('0x20')](_0xbccc('0x21'),_0x1d97e7+'-'+_0x4bd225+'/'+_0x4300f8)[_0xbccc('0x1d')](_0x5065f7);}return null;};}function patchUpdates(_0x51a27e){return function(_0x1f7a8a){try{jsonpatch[_0xbccc('0x22')](_0x1f7a8a,_0x51a27e,!![]);}catch(_0x47b69b){return BPromise['reject'](_0x47b69b);}return _0x1f7a8a['save']();};}function saveUpdates(_0x2e1447,_0x33a5ee){return function(_0x2fe570){if(_0x2fe570){return _0x2fe570[_0xbccc('0x23')](_0x2e1447)[_0xbccc('0x24')](function(_0x8258e5){return _0x8258e5;});}return null;};}function removeEntity(_0x2d01a9,_0xde96fd){return function(_0x52f291){if(_0x52f291){return _0x52f291[_0xbccc('0x25')]()[_0xbccc('0x24')](function(){_0x2d01a9[_0xbccc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aadd3,_0x364b20){return function(_0x1bcf48){if(!_0x1bcf48){_0x1aadd3[_0xbccc('0x26')](0x194);}return _0x1bcf48;};}function handleError(_0x44766a,_0x468ea5){_0x468ea5=_0x468ea5||0x1f4;return function(_0x3e3cd8){logger['error'](_0x3e3cd8['stack']);if(_0x3e3cd8[_0xbccc('0x27')]){delete _0x3e3cd8[_0xbccc('0x27')];}_0x44766a[_0xbccc('0x1b')](_0x468ea5)[_0xbccc('0x28')](_0x3e3cd8);};}function getInteractionUsers(_0xfcabc3,_0x37d3fe){return new BPromise(function(_0x4a6fe9,_0x23dd36){try{if(_0x37d3fe[_0xfcabc3['id']]){_0xfcabc3[_0xbccc('0x29')]=_[_0xbccc('0x2a')](_0x37d3fe[_0xfcabc3['id']],function(_0x134fdd){return{'id':_0x134fdd['id'],'fullname':_0x134fdd[_0xbccc('0x2b')]};});}}catch(_0x3ee947){_0x23dd36(_0x3ee947);}_0x4a6fe9(_0xfcabc3);});}function getInteractionTags(_0x25ab55,_0x3876fd){return new BPromise(function(_0x591b2d,_0x394d31){try{if(_0x25ab55[_0xbccc('0x2c')]){_0x25ab55[_0xbccc('0x2d')]=[];_0x25ab55[_0xbccc('0x2c')][_0xbccc('0x2e')](',')[_0xbccc('0x2f')](function(_0x5b53b2){_0x25ab55['Tags'][_0xbccc('0x30')](_0x3876fd[_0x5b53b2]);});}delete _0x25ab55['TagIds'];}catch(_0x431aca){_0x394d31(_0x431aca);}_0x591b2d(_0x25ab55);});}function updateFaxInteraction(_0x50470c,_0x3fa3ff,_0x1a93c4){return new BPromise(function(_0x33b2da,_0x3186b2){return getInteractionUsers(_0x50470c,_0x1a93c4)[_0xbccc('0x24')](function(_0x2bf70f){return getInteractionTags(_0x2bf70f,_0x3fa3ff);})[_0xbccc('0x24')](function(_0x3b3026){return getStateInteraction(_0x3b3026);})[_0xbccc('0x24')](function(_0x10e4c0){_0x33b2da(_0x10e4c0);})[_0xbccc('0x31')](function(_0x416af3){_0x3186b2(_0x416af3);});});}function getStateInteraction(_0x4660d7){return new BPromise(function(_0x33920b){_0x4660d7['waiting']=0x0;_0x4660d7[_0xbccc('0x32')]=0x0;_0x4660d7['answered']=0x0;_0x4660d7[_0xbccc('0x33')]=0x0;_0x4660d7['total']=0x0;if(!_0x4660d7[_0xbccc('0x34')]&&!_0x4660d7['UserId']){_0x4660d7['waiting']+=0x1;}if(!_0x4660d7[_0xbccc('0x34')]&&_0x4660d7[_0xbccc('0x35')]){_0x4660d7['talking']+=0x1;if(_0x4660d7[_0xbccc('0x36')]){_0x4660d7[_0xbccc('0x36')]-=0x1;}}if(_0x4660d7[_0xbccc('0x34')]&&_0x4660d7['UserId']){_0x4660d7[_0xbccc('0x37')]+=0x1;if(_0x4660d7['talking']){_0x4660d7['talking']-=0x1;}}if(_0x4660d7[_0xbccc('0x34')]&&!_0x4660d7[_0xbccc('0x35')]){_0x4660d7[_0xbccc('0x33')]+=0x1;if(_0x4660d7['waiting']){_0x4660d7[_0xbccc('0x36')]-=0x1;}}_0x4660d7[_0xbccc('0x38')]+=0x1;_0x33920b(_0x4660d7);});}exports[_0xbccc('0x39')]=function(_0x10a8e7,_0x1b650e){var _0x5d6bf={},_0x137db9={},_0x121fc7={'count':0x0,'rows':[]};var _0x4799e9=_[_0xbccc('0x2a')](db[_0xbccc('0x3a')]['rawAttributes'],function(_0x361d67){return{'name':_0x361d67[_0xbccc('0x3b')],'type':_0x361d67[_0xbccc('0x3c')][_0xbccc('0x3d')]};});_0x137db9['model']=_[_0xbccc('0x2a')](_0x4799e9,_0xbccc('0x27'));_0x137db9[_0xbccc('0x3e')]=_[_0xbccc('0x3f')](_0x10a8e7['query']);_0x137db9[_0xbccc('0x40')]=_[_0xbccc('0x41')](_0x137db9[_0xbccc('0x42')],_0x137db9[_0xbccc('0x3e')]);_0x5d6bf[_0xbccc('0x43')]=_[_0xbccc('0x41')](_0x137db9[_0xbccc('0x42')],qs[_0xbccc('0x44')](_0x10a8e7['query'][_0xbccc('0x44')]));_0x5d6bf[_0xbccc('0x43')]=_0x5d6bf['attributes']['length']?_0x5d6bf[_0xbccc('0x43')]:_0x137db9[_0xbccc('0x42')];if(!_0x10a8e7['query'][_0xbccc('0x45')](_0xbccc('0x46'))){_0x5d6bf[_0xbccc('0x1f')]=qs['limit'](_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x1f')]);_0x5d6bf[_0xbccc('0x1e')]=qs[_0xbccc('0x1e')](_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x1e')]);}_0x5d6bf[_0xbccc('0x47')]=qs[_0xbccc('0x48')](_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x48')]);_0x5d6bf[_0xbccc('0x49')]=qs[_0xbccc('0x40')](_[_0xbccc('0x4a')](_0x10a8e7[_0xbccc('0x3e')],_0x137db9['filters']),_0x4799e9);var _0x2e505a=[];var _0x51de5d=squel[_0xbccc('0x4b')]()[_0xbccc('0x4c')]('id')[_0xbccc('0x4c')](_0xbccc('0x27'))['field'](_0xbccc('0x4d'))[_0xbccc('0x4e')](_0xbccc('0x4f'));var _0x4236b5=squel[_0xbccc('0x4b')]()[_0xbccc('0x4c')](_0xbccc('0x50'))['field']('u.fullname')[_0xbccc('0x4c')](_0xbccc('0x51'))['from']('user_has_fax_interactions','ui')[_0xbccc('0x52')](_0xbccc('0x53'),'u',_0xbccc('0x54'));var _0x14b002=squel['select']()['from'](_0xbccc('0x55'),'i')[_0xbccc('0x52')](_0xbccc('0x56'),'c',_0xbccc('0x57'))['left_join'](_0xbccc('0x53'),'o','o.id\x20=\x20i.UserId')[_0xbccc('0x52')](_0xbccc('0x58'),'a',_0xbccc('0x59'))['left_join'](_0xbccc('0x5a'),'me',_0xbccc('0x5b'))[_0xbccc('0x52')](_0xbccc('0x5c'),'it',_0xbccc('0x5d'))['left_join'](_0xbccc('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x59b22e=squel[_0xbccc('0x5e')]();var _0x55c8b0=[];var _0x563ac4=squel[_0xbccc('0x5e')]();var _0x1a7a39;if(_0x10a8e7['query']['search']){_0x1a7a39=as[_0xbccc('0x5f')](_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x60')]);var _0x1547d3=_0x1a7a39['sqlOperator'];for(var _0x597ff4=0x0;_0x597ff4<_0x1a7a39[_0xbccc('0x61')][_0xbccc('0x62')];_0x597ff4++){var _0x58f7e2=_0x1a7a39[_0xbccc('0x61')][_0x597ff4];var _0x4ddb84='i';var _0x2aa3d7=_[_0xbccc('0x63')](_0x4799e9,[_0xbccc('0x27'),_0x58f7e2[_0xbccc('0x4c')]]);if(!_0x2aa3d7){switch(_0x58f7e2[_0xbccc('0x4c')]){case _0xbccc('0x64'):if(_0x58f7e2[_0xbccc('0x65')]==0x1){_0x14b002[_0xbccc('0x66')]('`'+_0x58f7e2[_0xbccc('0x4c')]+_0xbccc('0x67'));}else{_0x14b002[_0xbccc('0x66')]('`'+_0x58f7e2[_0xbccc('0x4c')]+_0xbccc('0x68'));}break;case'Contact':if(_0x58f7e2['operator']===_0xbccc('0x69')){if(_0x58f7e2[_0xbccc('0x65')][_0xbccc('0x2e')]('\x20')[_0xbccc('0x62')]>0x1){_0x59b22e[_0x1547d3](_0xbccc('0x6a'),qs['getFullTextValue'](_0x58f7e2[_0xbccc('0x65')]),null);}else{var _0x3f548d='%'+_0x58f7e2[_0xbccc('0x65')]+'%';_0x59b22e[_0x1547d3]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3f548d,_0x3f548d,_0x3f548d);}}else{_0x2aa3d7=_['find'](_0x4799e9,['name',_0xbccc('0x6b')]);_0x58f7e2[_0xbccc('0x4c')]=_0xbccc('0x6b');_0x1feb1e=as[_0xbccc('0x6c')](_0x4ddb84,_0x2aa3d7['type'],_0x58f7e2);_0x59b22e[_0x1547d3](_0x1feb1e[_0xbccc('0x6d')],_0x1feb1e[_0xbccc('0x65')][_0xbccc('0x6e')],_0x1feb1e[_0xbccc('0x65')][_0xbccc('0x1c')]);}break;case'Tag':var _0x2ff72b=_0x58f7e2[_0xbccc('0x65')][_0xbccc('0x2e')](',')['map'](function(_0x3c108d){return Number(_0x3c108d);});_0x2ff72b[_0xbccc('0x2f')](function(_0x2d9d26){_0x563ac4['or'](_0xbccc('0x6f'),'%,'+_0x2d9d26+',%');});_0x55c8b0=_[_0xbccc('0x70')](_0x55c8b0,_0x2ff72b);break;case _0xbccc('0x71'):if(_0x58f7e2[_0xbccc('0x72')]===_0xbccc('0x69')){_0x59b22e[_0x1547d3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x58f7e2[_0xbccc('0x65')]+'%',null);}else{_0x2aa3d7=_[_0xbccc('0x63')](_0x4799e9,[_0xbccc('0x27'),_0xbccc('0x35')]);_0x58f7e2[_0xbccc('0x4c')]=_0xbccc('0x35');_0x1feb1e=as['buildExpression'](_0x4ddb84,_0x2aa3d7[_0xbccc('0x3c')],_0x58f7e2);_0x59b22e[_0x1547d3](_0x1feb1e[_0xbccc('0x6d')],_0x1feb1e['value'][_0xbccc('0x6e')],_0x1feb1e[_0xbccc('0x65')]['end']);}break;case _0xbccc('0x73'):_0x1feb1e=as[_0xbccc('0x6c')]('me',null,_0x58f7e2);_0x59b22e[_0x1547d3](_0x1feb1e[_0xbccc('0x6d')],_0x1feb1e[_0xbccc('0x65')][_0xbccc('0x6e')],_0x1feb1e[_0xbccc('0x65')]['end']);break;}}else{var _0x1feb1e=as[_0xbccc('0x6c')](_0x4ddb84,_0x2aa3d7[_0xbccc('0x3c')],_0x58f7e2);_0x59b22e[_0x1547d3](_0x1feb1e[_0xbccc('0x6d')],_0x1feb1e[_0xbccc('0x65')][_0xbccc('0x6e')],_0x1feb1e[_0xbccc('0x65')][_0xbccc('0x1c')]);}}}else{var _0x5c7ea6=_(_0x10a8e7['query'])[_0xbccc('0x3f')]()[_0xbccc('0x2a')](function(_0x45ad6e){return _['some'](_0x4799e9,[_0xbccc('0x27'),_0x45ad6e])?_0x45ad6e:undefined;})[_0xbccc('0x74')]()[_0xbccc('0x65')]();if(!_[_0xbccc('0x75')](_0x5c7ea6)){_0x5c7ea6[_0xbccc('0x2f')](function(_0x5d3106){if(_0x5d3106===_0xbccc('0x76')){_0x14b002[_0xbccc('0x49')](_0xbccc('0x77'),[][_0xbccc('0x78')](_0x10a8e7[_0xbccc('0x3e')][_0x5d3106]));}else if(_0x5d3106===_0xbccc('0x79')){var _0x42969e=JSON[_0xbccc('0x7a')](_0x10a8e7[_0xbccc('0x3e')][_0x5d3106])['$gte'];var _0x55c65e=JSON[_0xbccc('0x7a')](_0x10a8e7[_0xbccc('0x3e')][_0x5d3106])[_0xbccc('0x7b')];_0x14b002['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42969e,_0x55c65e);}else{if(_0x10a8e7[_0xbccc('0x3e')][_0x5d3106]===_0xbccc('0x7c')){_0x14b002[_0xbccc('0x49')]('i.'+_0x5d3106+_0xbccc('0x7d'));}else{_0x14b002[_0xbccc('0x49')]('i.'+_0x5d3106+_0xbccc('0x7e'),_0x10a8e7['query'][_0x5d3106]);}}});}if(_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x7f')]){if(_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x7f')]==0x1){_0x14b002['having']('`unreadMessages`\x20=\x200');}else{_0x14b002[_0xbccc('0x66')](_0xbccc('0x80'));}}if(_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x81')]){_0x55c8b0=_['isArray'](_0x10a8e7['query'][_0xbccc('0x81')])?_0x10a8e7[_0xbccc('0x3e')]['tag']:new Array(_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x81')]);_0x55c8b0[_0xbccc('0x2f')](function(_0x6ee637){_0x563ac4['or'](_0xbccc('0x6f'),'%,'+_0x6ee637+',%');});}if(_0x10a8e7[_0xbccc('0x3e')]['filter']){var _0x27ce04=_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x82')][_0xbccc('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbccc('0x84')](_0x27ce04)){_0x59b22e['or'](_0xbccc('0x85'),_0x27ce04+'%')['or'](_0xbccc('0x86'),_0x27ce04+'%');}_0x59b22e['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x27ce04+'%');}}_0x14b002[_0xbccc('0x49')](_0x59b22e);_0x14b002[_0xbccc('0x87')](_0xbccc('0x88'));var _0x3917c1={'type':db['Sequelize'][_0xbccc('0x89')][_0xbccc('0x8a')],'raw':!![]};var _0x4e8b2e=_0x14b002[_0xbccc('0x8b')]();_0x4e8b2e[_0xbccc('0x4c')](_0xbccc('0x88'));_0x4e8b2e[_0xbccc('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbccc('0x64'));if(_0x5d6bf[_0xbccc('0x47')]){_0x5d6bf[_0xbccc('0x47')]['forEach'](function(_0x363051){var _0x1ed374=_0x363051[0x0]==='contactName'?_0x363051[0x0]:'i.'+_0x363051[0x0];_0x14b002[_0xbccc('0x47')](_0x1ed374,_0x363051[0x1]===_0xbccc('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x55c8b0)){_0x14b002['having'](_0x563ac4);_0x4e8b2e[_0xbccc('0x49')](_0xbccc('0x8d'),_0x55c8b0);}BPromise[_0xbccc('0x8e')]()[_0xbccc('0x24')](function(){if(!_0x1a7a39){if(_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x76')])return;_0x4e8b2e[_0xbccc('0x49')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x14b002[_0xbccc('0x49')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x10a8e7[_0xbccc('0x8f')][_0xbccc('0x90')]!=='agent')return;return _0x10a8e7[_0xbccc('0x8f')][_0xbccc('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1cee8a){if(_[_0xbccc('0x75')](_0x1cee8a)){_0x4e8b2e['where']('i.FaxAccountId\x20IS\x20NULL');_0x14b002[_0xbccc('0x49')](_0xbccc('0x92'));}else{_0x4e8b2e[_0xbccc('0x49')](_0xbccc('0x77'),_['map'](_0x1cee8a,'id'));_0x14b002[_0xbccc('0x49')](_0xbccc('0x77'),_['map'](_0x1cee8a,'id'));}});})[_0xbccc('0x24')](function(){if(_0x10a8e7[_0xbccc('0x8f')]['role']===_0xbccc('0x93')&&!_0x1a7a39&&!_0x10a8e7[_0xbccc('0x3e')][_0xbccc('0x76')])return[];return db[_0xbccc('0x94')][_0xbccc('0x3e')](_0x4e8b2e[_0xbccc('0x95')](),_0x3917c1);})['then'](function(_0x5623f5){_0x121fc7['count']=_0x5623f5[_0xbccc('0x62')];if(_0x121fc7[_0xbccc('0x96')]===0x0)return[];return db[_0xbccc('0x94')][_0xbccc('0x3e')](_0x51de5d[_0xbccc('0x95')](),_0x3917c1)[_0xbccc('0x24')](function(_0x3aeb55){_0x2e505a=_['keyBy'](_0x3aeb55,'id');_0x3917c1=_[_0xbccc('0x97')](_0x3917c1,{'model':db[_0xbccc('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10a8e7[_0xbccc('0x3e')]['fields']){_0x5d6bf[_0xbccc('0x43')][_0xbccc('0x2f')](function(_0x504195){_0x14b002['field']('i.'+_0x504195);});}else{_0x14b002['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x14b002[_0xbccc('0x4c')]('a.key',_0xbccc('0x98'));_0x14b002[_0xbccc('0x4c')](_0xbccc('0x99'),'Account.mandatoryDisposition');_0x14b002[_0xbccc('0x4c')]('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',_0xbccc('0x9a'));_0x14b002[_0xbccc('0x4c')]('i.*');_0x14b002[_0xbccc('0x4c')]('c.firstName',_0xbccc('0x9b'));_0x14b002[_0xbccc('0x4c')](_0xbccc('0x9c'),_0xbccc('0x9d'));_0x14b002['field'](_0xbccc('0x9e'),_0xbccc('0x9f'));_0x14b002[_0xbccc('0x4c')]('c.phone',_0xbccc('0xa0'));_0x14b002['field']('c.mobile',_0xbccc('0xa1'));_0x14b002[_0xbccc('0x4c')](_0xbccc('0xa2'),_0xbccc('0xa3'));_0x14b002[_0xbccc('0x4c')](_0xbccc('0xa4'),_0xbccc('0xa5'));_0x14b002['field']('o.internal',_0xbccc('0xa6'));_0x14b002[_0xbccc('0x4c')](_0xbccc('0xa7'),_0xbccc('0x2c'));}if(_0x5d6bf[_0xbccc('0x1f')])_0x14b002[_0xbccc('0x1f')](_0x5d6bf[_0xbccc('0x1f')]);if(_0x5d6bf[_0xbccc('0x1e')])_0x14b002['offset'](_0x5d6bf[_0xbccc('0x1e')]);return db[_0xbccc('0x94')][_0xbccc('0x3e')](_0x14b002[_0xbccc('0x95')](),_0x3917c1);})[_0xbccc('0x24')](function(_0x36b0c0){if(_0x36b0c0[_0xbccc('0x62')]>0x0)_0x4236b5[_0xbccc('0x49')](_0xbccc('0xa8'),_[_0xbccc('0x2a')](_0x36b0c0,'id'));return db[_0xbccc('0x94')]['query'](_0x4236b5['toString'](),_0x3917c1)[_0xbccc('0x24')](function(_0x534525){var _0x3178d8=_[_0xbccc('0xa9')](_0x534525,'FaxInteractionId');var _0x462f3a=[];_0x36b0c0[_0xbccc('0x2f')](function(_0x164f5d){_0x462f3a['push'](updateFaxInteraction(_0x164f5d,_0x2e505a,_0x3178d8));});return BPromise[_0xbccc('0xaa')](_0x462f3a);});});})[_0xbccc('0x24')](function(_0x47a79c){_0x121fc7[_0xbccc('0xab')]=_0x47a79c;return _0x121fc7;})[_0xbccc('0x24')](respondWithFilteredResult(_0x1b650e,_0x5d6bf))['catch'](handleError(_0x1b650e,null));};exports['show']=function(_0x1e6b26,_0xc352bb){var _0x5ca6b={'raw':![],'where':{'id':_0x1e6b26[_0xbccc('0xac')]['id']}},_0x50e49e={};_0x50e49e[_0xbccc('0x42')]=_[_0xbccc('0x3f')](db[_0xbccc('0x3a')][_0xbccc('0xad')]);_0x50e49e['query']=_[_0xbccc('0x3f')](_0x1e6b26['query']);_0x50e49e[_0xbccc('0x40')]=_[_0xbccc('0x41')](_0x50e49e[_0xbccc('0x42')],_0x50e49e[_0xbccc('0x3e')]);_0x5ca6b['attributes']=_[_0xbccc('0x41')](_0x50e49e['model'],qs[_0xbccc('0x44')](_0x1e6b26[_0xbccc('0x3e')][_0xbccc('0x44')]));_0x5ca6b[_0xbccc('0x43')]=_0x5ca6b[_0xbccc('0x43')][_0xbccc('0x62')]?_0x5ca6b[_0xbccc('0x43')]:_0x50e49e[_0xbccc('0x42')];if(_0x1e6b26['query'][_0xbccc('0xae')]){_0x5ca6b[_0xbccc('0xaf')]=[{'all':!![]}];}_0x5ca6b=_[_0xbccc('0x97')]({},_0x5ca6b,_0x1e6b26[_0xbccc('0xb0')]);return db[_0xbccc('0x3a')][_0xbccc('0x63')](_0x5ca6b)[_0xbccc('0x24')](handleEntityNotFound(_0xc352bb,null))[_0xbccc('0x24')](respondWithResult(_0xc352bb,null))[_0xbccc('0x31')](handleError(_0xc352bb,null));};exports[_0xbccc('0xb1')]=function(_0x113486,_0x47edd4){return db[_0xbccc('0x3a')][_0xbccc('0xb1')](_0x113486[_0xbccc('0x73')],{})['then'](respondWithResult(_0x47edd4,0xc9))[_0xbccc('0x31')](handleError(_0x47edd4,null));};exports[_0xbccc('0x23')]=function(_0xfc76cf,_0x120f83){if(_0xfc76cf['body']['id']){delete _0xfc76cf[_0xbccc('0x73')]['id'];}return db[_0xbccc('0x3a')][_0xbccc('0x63')]({'where':{'id':_0xfc76cf[_0xbccc('0xac')]['id']}})[_0xbccc('0x24')](handleEntityNotFound(_0x120f83,null))[_0xbccc('0x24')](saveUpdates(_0xfc76cf['body'],null))[_0xbccc('0x24')](respondWithResult(_0x120f83,null))[_0xbccc('0x31')](handleError(_0x120f83,null));};exports['destroy']=function(_0x15f4a2,_0x5c6b96){return db[_0xbccc('0x3a')][_0xbccc('0x63')]({'where':{'id':_0x15f4a2['params']['id']}})[_0xbccc('0x24')](handleEntityNotFound(_0x5c6b96,null))[_0xbccc('0x24')](removeEntity(_0x5c6b96,null))[_0xbccc('0x31')](handleError(_0x5c6b96,null));};exports[_0xbccc('0xb2')]=function(_0x19e4fd,_0x416bde){return db[_0xbccc('0x3a')][_0xbccc('0xb2')]()[_0xbccc('0x24')](respondWithResult(_0x416bde,null))[_0xbccc('0x31')](handleError(_0x416bde,null));};exports['addMessage']=function(_0xf0d907,_0x3fa5c2,_0x5ebaa0){return db['FaxMessage'][_0xbccc('0x63')]({'where':{'id':_0xf0d907['params']['id']}})[_0xbccc('0x24')](handleEntityNotFound(_0x3fa5c2,null))[_0xbccc('0x24')](function(_0x26d037){if(_0x26d037){return _0x26d037[_0xbccc('0xb3')](_0xf0d907[_0xbccc('0x73')][_0xbccc('0xb4')],_[_0xbccc('0xb5')](_0xf0d907[_0xbccc('0x73')],[_0xbccc('0xb4'),'id'])||{});}})[_0xbccc('0x24')](respondWithResult(_0x3fa5c2,null))[_0xbccc('0x31')](handleError(_0x3fa5c2,null));};exports[_0xbccc('0xb6')]=function(_0x25322d,_0x400838,_0x31eddb){var _0x493958={'raw':![],'where':{}};var _0x5871b3={};var _0x127e9c={'count':0x0,'rows':[]};return db[_0xbccc('0x3a')][_0xbccc('0xb7')]({'where':{'id':_0x25322d[_0xbccc('0xac')]['id']}})[_0xbccc('0x24')](handleEntityNotFound(_0x400838,null))['then'](function(_0x7bf44a){if(_0x7bf44a){_0x5871b3[_0xbccc('0x42')]=_[_0xbccc('0x3f')](db[_0xbccc('0xb8')][_0xbccc('0xad')]);_0x5871b3['query']=_[_0xbccc('0x3f')](_0x25322d[_0xbccc('0x3e')]);_0x5871b3[_0xbccc('0x40')]=_[_0xbccc('0x41')](_0x5871b3[_0xbccc('0x42')],_0x5871b3[_0xbccc('0x3e')]);_0x493958[_0xbccc('0x43')]=_[_0xbccc('0x41')](_0x5871b3[_0xbccc('0x42')],qs[_0xbccc('0x44')](_0x25322d[_0xbccc('0x3e')]['fields']));_0x493958[_0xbccc('0x43')]=_0x493958[_0xbccc('0x43')][_0xbccc('0x62')]?_0x493958[_0xbccc('0x43')]:_0x5871b3[_0xbccc('0x42')];if(!_0x25322d[_0xbccc('0x3e')]['hasOwnProperty'](_0xbccc('0x46'))){_0x493958[_0xbccc('0x1f')]=qs[_0xbccc('0x1f')](_0x25322d['query'][_0xbccc('0x1f')]);_0x493958[_0xbccc('0x1e')]=qs[_0xbccc('0x1e')](_0x25322d[_0xbccc('0x3e')][_0xbccc('0x1e')]);}_0x493958['order']=qs[_0xbccc('0x48')](_0x25322d[_0xbccc('0x3e')][_0xbccc('0x48')]);_0x493958[_0xbccc('0x49')]=qs[_0xbccc('0x40')](_['pick'](_0x25322d[_0xbccc('0x3e')],_0x5871b3[_0xbccc('0x40')]));_0x493958[_0xbccc('0x49')][_0xbccc('0xb9')]=_0x7bf44a['id'];if(_0x25322d[_0xbccc('0x3e')][_0xbccc('0x82')]){_0x493958[_0xbccc('0x49')]=_[_0xbccc('0x97')](_0x493958[_0xbccc('0x49')],{'$or':_[_0xbccc('0x2a')](_0x493958[_0xbccc('0x43')],function(_0x273ebf){var _0x11a4d1={};_0x11a4d1[_0x273ebf]={'$like':'%'+_0x25322d['query'][_0xbccc('0x82')]+'%'};return _0x11a4d1;})});}if(_0x25322d[_0xbccc('0x3e')]['$gte']){var _0x4b6035=_0x25322d[_0xbccc('0x3e')][_0xbccc('0xba')][_0xbccc('0x2e')](',');var _0x17cad0={};_0x17cad0[_0x4b6035[0x0]]={'$gte':moment(_0x4b6035[0x1])['format'](_0xbccc('0xbb'))};_0x493958[_0xbccc('0x49')]=_[_0xbccc('0x97')](_0x493958[_0xbccc('0x49')],_0x17cad0);}_0x493958=_[_0xbccc('0x97')]({},_0x493958,_0x25322d[_0xbccc('0xb0')]);return db[_0xbccc('0xb8')][_0xbccc('0x96')]({'where':_0x493958[_0xbccc('0x49')]})['then'](function(_0x4169b7){_0x127e9c[_0xbccc('0x96')]=_0x4169b7;if(_0x25322d['query'][_0xbccc('0xae')]){_0x493958[_0xbccc('0xaf')]=[{'all':!![]}];}return db[_0xbccc('0xb8')]['findAll'](_0x493958);})[_0xbccc('0x24')](function(_0xb0564b){_0x127e9c[_0xbccc('0xab')]=_0xb0564b;return _0x127e9c;});}})[_0xbccc('0x24')](respondWithFilteredResult(_0x400838,_0x493958))[_0xbccc('0x31')](handleError(_0x400838,null));};exports[_0xbccc('0xbc')]=function(_0x11ff05,_0x5c2d20,_0x46d3ce){return db[_0xbccc('0x3a')][_0xbccc('0x63')]({'where':{'id':_0x11ff05[_0xbccc('0xac')]['id']}})['then'](handleEntityNotFound(_0x5c2d20,null))[_0xbccc('0x24')](function(_0x3b049f){if(_0x3b049f){return _0x3b049f[_0xbccc('0xbd')](_0x11ff05[_0xbccc('0x73')]['ids'],_['omit'](_0x11ff05[_0xbccc('0x73')],[_0xbccc('0xb4'),'id'])||{})[_0xbccc('0xbe')](function(){return db[_0xbccc('0xbf')][_0xbccc('0xc0')]({'attributes':['id',_0xbccc('0x27'),_0xbccc('0x4d')],'where':{'id':_0x11ff05[_0xbccc('0x73')][_0xbccc('0xb4')]}});})[_0xbccc('0x24')](function(_0x15e1b6){socket['emit'](_0xbccc('0xc1'),{'id':Number(_0x11ff05[_0xbccc('0xac')]['id']),'tags':_0x15e1b6||[]});return{'id':Number(_0x11ff05['params']['id']),'tags':_0x15e1b6||[]};});}})[_0xbccc('0x24')](respondWithResult(_0x5c2d20,null))[_0xbccc('0x31')](handleError(_0x5c2d20,null));};exports[_0xbccc('0xc2')]=function(_0x5db153,_0x58e841,_0x1334cc){return db['FaxInteraction']['find']({'where':{'id':_0x5db153[_0xbccc('0xac')]['id']}})[_0xbccc('0x24')](handleEntityNotFound(_0x58e841,null))[_0xbccc('0x24')](function(_0x2d49d4){if(_0x2d49d4){return _0x2d49d4['removeTags'](_0x5db153['query'][_0xbccc('0xb4')]);}})[_0xbccc('0x24')](respondWithStatusCode(_0x58e841,null))[_0xbccc('0x31')](handleError(_0x58e841,null));};exports['download']=function(_0x2d31a8,_0x32e805){var _0x7b24c7=moment()[_0xbccc('0xc3')]()[_0xbccc('0x95')]();var _0x35de7c=path[_0xbccc('0xc4')](config[_0xbccc('0xc5')],'server','files',_0xbccc('0xc6'));var _0xcc4c45=path[_0xbccc('0xc4')](config['root'],_0xbccc('0xc7'),_0xbccc('0xc8'),'attachments');var _0x5d9718=path[_0xbccc('0xc4')](_0x35de7c,_0x7b24c7);var _0x9af3f1=util['format']('transcript-%d-%s.zip',_0x2d31a8['params']['id'],_0x7b24c7);var _0x123024=path[_0xbccc('0xc4')](_0x35de7c,_0x9af3f1);var _0x563df8=[];_0x563df8['push']({'model':db['Attachment'],'as':_0xbccc('0xc9'),'raw':!![]});var _0x41123b=[{'model':db[_0xbccc('0xb8')],'as':_0xbccc('0xca'),'attributes':['id',_0xbccc('0x73'),_0xbccc('0x79')],'include':_0x563df8}];return db[_0xbccc('0x3a')][_0xbccc('0x63')]({'where':{'id':_0x2d31a8[_0xbccc('0xac')]['id']},'include':_0x41123b})[_0xbccc('0x24')](handleEntityNotFound(_0x32e805,null))['then'](function(_0x3aea80){if(_0x3aea80&&_0x3aea80[_0xbccc('0xca')]){var _0x25b859=_0x3aea80['get']({'plain':!![]});fs['mkdirSync'](_0x5d9718);for(var _0x22ae34=0x0;_0x22ae34<_0x25b859[_0xbccc('0xca')][_0xbccc('0x62')];_0x22ae34++){var _0x3ccdf3=_0x25b859[_0xbccc('0xca')][_0x22ae34][_0xbccc('0xc9')];if(_0x3ccdf3){var _0x3149e3=path['join'](_0xcc4c45,_0x3ccdf3[_0xbccc('0xcb')]);if(fs['existsSync'](_0x3149e3)){fs['createReadStream'](_0x3149e3)['pipe'](fs[_0xbccc('0xcc')](path[_0xbccc('0xc4')](_0x5d9718,_0x3ccdf3[_0xbccc('0xcb')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x3a08c2,_0x4d222d){zipdir(_0x5d9718,{'saveTo':_0x123024},function(_0x1fd1d3,_0x4a51ca){if(_0x1fd1d3)return _0x4d222d(_0x1fd1d3);return _0x3a08c2(_0x4a51ca);});})[_0xbccc('0x24')](function(){return new BPromise(function(_0x11391b,_0x2ae05c){rimraf(_0x5d9718,function(_0x3be7b8){if(_0x3be7b8)_0x2ae05c(_0x3be7b8);return _0x11391b();});});})[_0xbccc('0x24')](function(){return _0x32e805[_0xbccc('0xcd')](_0x123024,_0x9af3f1,function(_0x342295){if(_0x342295){console[_0xbccc('0xce')](_0xbccc('0xcf'),_0x342295);}else{fs['unlinkSync'](_0x123024);}});});});}else{return _0x32e805['sendStatus'](0xc8);}})[_0xbccc('0x31')](handleError(_0x32e805,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 5b91db7..a31b317 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 _0xb0d0=['save','update','getUsers','then','findAll','setDataValue','length','emit','catch','hasOwnProperty','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x577077,_0x52f056){var _0x370769=function(_0x34d109){while(--_0x34d109){_0x577077['push'](_0x577077['shift']());}};_0x370769(++_0x52f056);}(_0xb0d0,0x192));var _0x0b0d=function(_0x48d3ef,_0x49641a){_0x48d3ef=_0x48d3ef-0x0;var _0xfee757=_0xb0d0[_0x48d3ef];return _0xfee757;};'use strict';var EventEmitter=require(_0x0b0d('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x0b0d('0x1'))['db'][_0x0b0d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0b0d('0x3')](0x0);var events={'afterCreate':_0x0b0d('0x4'),'afterUpdate':_0x0b0d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x571d31){return function(_0x50baed,_0x27a617,_0x4b3dd2){_0x50baed[_0x0b0d('0x6')]({'attributes':['id'],'raw':!![]})[_0x0b0d('0x7')](function(_0x194d6b){_0x50baed['setDataValue']('Users',_0x194d6b['map'](function(_0x346ca7){return{'id':_0x346ca7['id']};}));return FaxMessage[_0x0b0d('0x8')]({'where':{'FaxInteractionId':_0x50baed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0b0d('0x7')](function(_0x4a673b){_0x50baed[_0x0b0d('0x9')]('unreadMessages',_0x4a673b[_0x0b0d('0xa')]);FaxInteractionEvents['emit'](_0x571d31+':'+_0x50baed['id'],_0x50baed);FaxInteractionEvents[_0x0b0d('0xb')](_0x571d31,_0x50baed);_0x4b3dd2(null);})[_0x0b0d('0xc')](_0x4b3dd2(null));};}for(var e in events){if(events[_0x0b0d('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x760f=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','save','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x4a1a5a,_0x4a0e1b){var _0x44bffd=function(_0x395de4){while(--_0x395de4){_0x4a1a5a['push'](_0x4a1a5a['shift']());}};_0x44bffd(++_0x4a0e1b);}(_0x760f,0x1a4));var _0xf760=function(_0x1fb1ba,_0x834081){_0x1fb1ba=_0x1fb1ba-0x0;var _0x1add53=_0x760f[_0x1fb1ba];return _0x1add53;};'use strict';var EventEmitter=require(_0xf760('0x0'));var FaxInteraction=require(_0xf760('0x1'))['db'][_0xf760('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf760('0x3'),'afterUpdate':'update','afterDestroy':_0xf760('0x4')};function emitEvent(_0x2de189){return function(_0x29b3af,_0x313cfc,_0x163f3d){_0x29b3af['getUsers']({'attributes':['id'],'raw':!![]})[_0xf760('0x5')](function(_0x439cfa){_0x29b3af[_0xf760('0x6')](_0xf760('0x7'),_0x439cfa['map'](function(_0x1ff908){return{'id':_0x1ff908['id']};}));return FaxMessage[_0xf760('0x8')]({'where':{'FaxInteractionId':_0x29b3af['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf760('0x5')](function(_0xb75a63){_0x29b3af[_0xf760('0x6')](_0xf760('0x9'),_0xb75a63[_0xf760('0xa')]);FaxInteractionEvents[_0xf760('0xb')](_0x2de189+':'+_0x29b3af['id'],_0x29b3af);FaxInteractionEvents[_0xf760('0xb')](_0x2de189,_0x29b3af);_0x163f3d(null);})[_0xf760('0xc')](_0x163f3d(null));};}for(var e in events){if(events[_0xf760('0xd')](e)){var event=events[e];FaxInteraction[_0xf760('0xe')](e,emitEvent(event));}}module[_0xf760('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b69d71b..66cda4f 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 _0x3301=['exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x41b89f,_0x27ab71){var _0x8d0936=function(_0x29c9df){while(--_0x29c9df){_0x41b89f['push'](_0x41b89f['shift']());}};_0x8d0936(++_0x27ab71);}(_0x3301,0x69));var _0x1330=function(_0x38d2a5,_0x3e4915){_0x38d2a5=_0x38d2a5-0x0;var _0x4d0941=_0x3301[_0x38d2a5];return _0x4d0941;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var logger=require(_0x1330('0x2'))('api');var moment=require(_0x1330('0x3'));var BPromise=require('bluebird');var rp=require(_0x1330('0x4'));var fs=require('fs');var path=require(_0x1330('0x5'));var rimraf=require('rimraf');var config=require(_0x1330('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x1330('0x7')]=function(_0x18ec8a,_0x299e03){return _0x18ec8a[_0x1330('0x8')](_0x1330('0x9'),attributes,{'tableName':_0x1330('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x497e13,_0x1bebe6,_0x193dee){if(_0x497e13[_0x1330('0xb')](_0x1330('0xc'))){_0x497e13[_0x1330('0xd')]=moment()[_0x1330('0xe')](_0x1330('0xf'));}_0x193dee(null,_0x497e13);}}});}; \ No newline at end of file +var _0xcd26=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xcd26,0x77));var _0x6cd2=function(_0x525b28,_0x5cf5a0){_0x525b28=_0x525b28-0x0;var _0x180178=_0xcd26[_0x525b28];return _0x180178;};'use strict';var _=require('lodash');var util=require(_0x6cd2('0x0'));var logger=require('../../config/logger')(_0x6cd2('0x1'));var moment=require(_0x6cd2('0x2'));var BPromise=require(_0x6cd2('0x3'));var rp=require(_0x6cd2('0x4'));var fs=require('fs');var path=require(_0x6cd2('0x5'));var rimraf=require(_0x6cd2('0x6'));var config=require(_0x6cd2('0x7'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0xa7f153,_0x2e9b24){return _0xa7f153[_0x6cd2('0x8')](_0x6cd2('0x9'),attributes,{'tableName':_0x6cd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53d18d,_0x8a4d42,_0x5d2030){if(_0x53d18d[_0x6cd2('0xb')](_0x6cd2('0xc'))){_0x53d18d[_0x6cd2('0xd')]=moment()['format'](_0x6cd2('0xe'));}_0x5d2030(null,_0x53d18d);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8ca15be..9ee25f1 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 _0x2f4f=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','AddTagsToFaxInteraction','find','where','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4bbdfe,_0x267103){var _0x3cb5c2=function(_0x1d6bbb){while(--_0x1d6bbb){_0x4bbdfe['push'](_0x4bbdfe['shift']());}};_0x3cb5c2(++_0x267103);}(_0x2f4f,0xdb));var _0xf2f4=function(_0x1a37df,_0x3ed536){_0x1a37df=_0x1a37df-0x0;var _0x5a7d5f=_0x2f4f[_0x1a37df];return _0x5a7d5f;};'use strict';var _=require('lodash');var util=require(_0xf2f4('0x0'));var moment=require(_0xf2f4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf2f4('0x2'));var fs=require('fs');var Redis=require(_0xf2f4('0x3'));var db=require(_0xf2f4('0x4'))['db'];var utils=require(_0xf2f4('0x5'));var logger=require(_0xf2f4('0x6'))(_0xf2f4('0x7'));var config=require(_0xf2f4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf2f4('0x9')]({'port':0x232a});config[_0xf2f4('0xa')]=_[_0xf2f4('0xb')](config[_0xf2f4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2f4('0xc'))(new Redis(config[_0xf2f4('0xa')]));require(_0xf2f4('0xd'))[_0xf2f4('0xe')](socket);function respondWithRpcPromise(_0xed1763,_0x21ed68,_0x11d5f8){return new BPromise(function(_0x7e2c31,_0x33378d){return client[_0xf2f4('0xf')](_0xed1763,_0x11d5f8)[_0xf2f4('0x10')](function(_0x244d41){logger[_0xf2f4('0x11')](_0xf2f4('0x12'),_0x21ed68,_0xf2f4('0x13'));logger[_0xf2f4('0x14')](_0xf2f4('0x15'),_0x21ed68,_0xf2f4('0x13'),JSON[_0xf2f4('0x16')](_0x244d41));if(_0x244d41[_0xf2f4('0x17')]){if(_0x244d41[_0xf2f4('0x17')][_0xf2f4('0x18')]===0x1f4){logger['error'](_0xf2f4('0x12'),_0x21ed68,_0x244d41['error']['message']);return _0x33378d(_0x244d41[_0xf2f4('0x17')]['message']);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x21ed68,_0x244d41[_0xf2f4('0x17')][_0xf2f4('0x19')]);return _0x7e2c31(_0x244d41[_0xf2f4('0x17')][_0xf2f4('0x19')]);}else{logger[_0xf2f4('0x11')](_0xf2f4('0x12'),_0x21ed68,_0xf2f4('0x13'));_0x7e2c31(_0x244d41['result'][_0xf2f4('0x19')]);}})[_0xf2f4('0x1a')](function(_0x3bcc37){logger['error'](_0xf2f4('0x12'),_0x21ed68,_0x3bcc37);_0x33378d(_0x3bcc37);});});}exports[_0xf2f4('0x1b')]=function(_0x17e8a4){var _0xd84ec0=this;return new Promise(function(_0x59fda2,_0x5b5dd4){return db[_0xf2f4('0x1c')][_0xf2f4('0x1d')](_0x17e8a4[_0xf2f4('0x1e')],{'raw':_0x17e8a4[_0xf2f4('0x1f')]?_0x17e8a4['options'][_0xf2f4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e8a4[_0xf2f4('0x1f')]?_0x17e8a4[_0xf2f4('0x1f')]['where']||null:null,'attributes':_0x17e8a4[_0xf2f4('0x1f')]?_0x17e8a4[_0xf2f4('0x1f')]['attributes']||null:null,'limit':_0x17e8a4['options']?_0x17e8a4[_0xf2f4('0x1f')]['limit']||null:null})[_0xf2f4('0x10')](function(_0x5a96ed){logger[_0xf2f4('0x11')]('UpdateFaxInteraction',_0x17e8a4);logger['debug'](_0xf2f4('0x1b'),_0x17e8a4,JSON['stringify'](_0x5a96ed));_0x59fda2(_0x5a96ed);})[_0xf2f4('0x1a')](function(_0xd312cd){logger['error'](_0xf2f4('0x1b'),_0xd312cd[_0xf2f4('0x19')],_0x17e8a4);_0x5b5dd4(_0xd84ec0[_0xf2f4('0x17')](0x1f4,_0xd312cd[_0xf2f4('0x19')]));});});};exports[_0xf2f4('0x21')]=function(_0x305972){return new Promise(function(_0x5d9402,_0x2e20e8){return db[_0xf2f4('0x1c')][_0xf2f4('0x22')]({'where':_0x305972[_0xf2f4('0x1f')]?_0x305972[_0xf2f4('0x1f')][_0xf2f4('0x23')]||null:null})[_0xf2f4('0x10')](function(_0x34ab62){if(_0x34ab62){return _0x34ab62['addTags'](_0x305972[_0xf2f4('0x1e')][_0xf2f4('0x24')],_[_0xf2f4('0x25')](_0x305972['body'],[_0xf2f4('0x24'),'id'])||{});}})[_0xf2f4('0x26')](function(_0x211960){logger[_0xf2f4('0x11')]('AddTags',_0x305972);logger[_0xf2f4('0x14')](_0xf2f4('0x27'),_0x305972,JSON[_0xf2f4('0x16')](_0x211960));_0x5d9402(_0x211960);})[_0xf2f4('0x1a')](function(_0x870c8f){logger[_0xf2f4('0x17')](_0xf2f4('0x27'),_0x870c8f[_0xf2f4('0x19')],_0x305972);_0x2e20e8(_this[_0xf2f4('0x17')](0x1f4,_0x870c8f[_0xf2f4('0x19')]));});});}; \ No newline at end of file +var _0x7bbd=['AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','update','body','options','raw','where','attributes','limit','then','catch','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread'];(function(_0x2f7023,_0x1aa399){var _0x2f5e4e=function(_0x1fa5d4){while(--_0x1fa5d4){_0x2f7023['push'](_0x2f7023['shift']());}};_0x2f5e4e(++_0x1aa399);}(_0x7bbd,0x1ba));var _0xd7bb=function(_0x2a258d,_0x4460de){_0x2a258d=_0x2a258d-0x0;var _0x4fb931=_0x7bbd[_0x2a258d];return _0x4fb931;};'use strict';var _=require(_0xd7bb('0x0'));var util=require(_0xd7bb('0x1'));var moment=require(_0xd7bb('0x2'));var BPromise=require(_0xd7bb('0x3'));var rs=require(_0xd7bb('0x4'));var fs=require('fs');var Redis=require(_0xd7bb('0x5'));var db=require(_0xd7bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd7bb('0x7'));var config=require(_0xd7bb('0x8'));var jayson=require(_0xd7bb('0x9'));var client=jayson[_0xd7bb('0xa')][_0xd7bb('0xb')]({'port':0x232a});config['redis']=_[_0xd7bb('0xc')](config[_0xd7bb('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7bb('0xd')]));require(_0xd7bb('0xe'))['register'](socket);function respondWithRpcPromise(_0x1c762c,_0x31c305,_0x3bc0b9){return new BPromise(function(_0x184715,_0x28a358){return client[_0xd7bb('0xf')](_0x1c762c,_0x3bc0b9)['then'](function(_0x2e0875){logger[_0xd7bb('0x10')](_0xd7bb('0x11'),_0x31c305,'request\x20sent');logger['debug'](_0xd7bb('0x12'),_0x31c305,_0xd7bb('0x13'),JSON[_0xd7bb('0x14')](_0x2e0875));if(_0x2e0875[_0xd7bb('0x15')]){if(_0x2e0875['error'][_0xd7bb('0x16')]===0x1f4){logger['error'](_0xd7bb('0x11'),_0x31c305,_0x2e0875[_0xd7bb('0x15')][_0xd7bb('0x17')]);return _0x28a358(_0x2e0875[_0xd7bb('0x15')][_0xd7bb('0x17')]);}logger['error'](_0xd7bb('0x11'),_0x31c305,_0x2e0875['error']['message']);return _0x184715(_0x2e0875[_0xd7bb('0x15')][_0xd7bb('0x17')]);}else{logger[_0xd7bb('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x31c305,'request\x20sent');_0x184715(_0x2e0875[_0xd7bb('0x18')][_0xd7bb('0x17')]);}})['catch'](function(_0x111372){logger[_0xd7bb('0x15')](_0xd7bb('0x11'),_0x31c305,_0x111372);_0x28a358(_0x111372);});});}exports[_0xd7bb('0x19')]=function(_0x2386f7){var _0xe54458=this;return new Promise(function(_0x825df1,_0x571cad){return db['FaxInteraction'][_0xd7bb('0x1a')](_0x2386f7[_0xd7bb('0x1b')],{'raw':_0x2386f7[_0xd7bb('0x1c')]?_0x2386f7[_0xd7bb('0x1c')][_0xd7bb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2386f7[_0xd7bb('0x1c')]?_0x2386f7['options'][_0xd7bb('0x1e')]||null:null,'attributes':_0x2386f7[_0xd7bb('0x1c')]?_0x2386f7['options'][_0xd7bb('0x1f')]||null:null,'limit':_0x2386f7[_0xd7bb('0x1c')]?_0x2386f7[_0xd7bb('0x1c')][_0xd7bb('0x20')]||null:null})[_0xd7bb('0x21')](function(_0x5d3218){logger[_0xd7bb('0x10')](_0xd7bb('0x19'),_0x2386f7);logger['debug'](_0xd7bb('0x19'),_0x2386f7,JSON['stringify'](_0x5d3218));_0x825df1(_0x5d3218);})[_0xd7bb('0x22')](function(_0x55a6d9){logger['error'](_0xd7bb('0x19'),_0x55a6d9[_0xd7bb('0x17')],_0x2386f7);_0x571cad(_0xe54458[_0xd7bb('0x15')](0x1f4,_0x55a6d9[_0xd7bb('0x17')]));});});};exports[_0xd7bb('0x23')]=function(_0x504f13){return new Promise(function(_0x470980,_0x68112f){return db[_0xd7bb('0x24')][_0xd7bb('0x25')]({'where':_0x504f13[_0xd7bb('0x1c')]?_0x504f13['options'][_0xd7bb('0x1e')]||null:null})[_0xd7bb('0x21')](function(_0x3a78f2){if(_0x3a78f2){return _0x3a78f2[_0xd7bb('0x26')](_0x504f13[_0xd7bb('0x1b')][_0xd7bb('0x27')],_[_0xd7bb('0x28')](_0x504f13['body'],['ids','id'])||{});}})[_0xd7bb('0x29')](function(_0x42c60b){logger[_0xd7bb('0x10')](_0xd7bb('0x2a'),_0x504f13);logger[_0xd7bb('0x2b')]('AddTags',_0x504f13,JSON[_0xd7bb('0x14')](_0x42c60b));_0x470980(_0x42c60b);})[_0xd7bb('0x22')](function(_0x2de131){logger['error']('AddTags',_0x2de131['message'],_0x504f13);_0x68112f(_this['error'](0x1f4,_0x2de131[_0xd7bb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index c0ad0be..3784d40 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 _0x30a4=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x52a9a8,_0x4c68b4){var _0xb139cc=function(_0x48b3ef){while(--_0x48b3ef){_0x52a9a8['push'](_0x52a9a8['shift']());}};_0xb139cc(++_0x4c68b4);}(_0x30a4,0x1b6));var _0x430a=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0x30a4[_0x591e16];return _0x543b35;};'use strict';var FaxInteractionEvents=require(_0x430a('0x0'));var events=['save',_0x430a('0x1'),_0x430a('0x2')];function createListener(_0x36203d,_0x33bf30){return function(_0x3d6f48){_0x33bf30[_0x430a('0x3')](_0x36203d,_0x3d6f48);};}function removeListener(_0x600d55,_0x38a1dd){return function(){FaxInteractionEvents[_0x430a('0x4')](_0x600d55,_0x38a1dd);};}exports[_0x430a('0x5')]=function(_0x4558c8){for(var _0x4c34b1=0x0,_0x4562d1=events[_0x430a('0x6')];_0x4c34b1<_0x4562d1;_0x4c34b1++){var _0x20a2c8=events[_0x4c34b1];var _0x4a5a06=createListener(_0x430a('0x7')+_0x20a2c8,_0x4558c8);FaxInteractionEvents['on'](_0x20a2c8,_0x4a5a06);}}; \ No newline at end of file +var _0x2762=['remove','update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x4f205d,_0x39af34){var _0x255e92=function(_0x238e4c){while(--_0x238e4c){_0x4f205d['push'](_0x4f205d['shift']());}};_0x255e92(++_0x39af34);}(_0x2762,0x116));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require(_0x2276('0x0'));var events=[_0x2276('0x1'),_0x2276('0x2'),_0x2276('0x3')];function createListener(_0x31f0e7,_0x4d7fac){return function(_0x2d93df){_0x4d7fac[_0x2276('0x4')](_0x31f0e7,_0x2d93df);};}function removeListener(_0x420f0a,_0x3fe304){return function(){FaxInteractionEvents[_0x2276('0x5')](_0x420f0a,_0x3fe304);};}exports['register']=function(_0x142166){for(var _0x999b2c=0x0,_0x13e215=events[_0x2276('0x6')];_0x999b2c<_0x13e215;_0x999b2c++){var _0x4f022c=events[_0x999b2c];var _0x557987=createListener(_0x2276('0x7')+_0x4f022c,_0x142166);FaxInteractionEvents['on'](_0x4f022c,_0x557987);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 174da30..3800d34 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 _0x5547=['/:id/download','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x5547,0x76));var _0x7554=function(_0x4e215b,_0x597fbc){_0x4e215b=_0x4e215b-0x0;var _0x56d77a=_0x5547[_0x4e215b];return _0x56d77a;};'use strict';var multer=require(_0x7554('0x0'));var util=require(_0x7554('0x1'));var path=require(_0x7554('0x2'));var timeout=require(_0x7554('0x3'));var express=require(_0x7554('0x4'));var router=express['Router']();var fs_extra=require(_0x7554('0x5'));var auth=require(_0x7554('0x6'));var interaction=require(_0x7554('0x7'));var config=require(_0x7554('0x8'));var controller=require(_0x7554('0x9'));router[_0x7554('0xa')]('/',auth[_0x7554('0xb')](),controller[_0x7554('0xc')]);router['get'](_0x7554('0xd'),auth[_0x7554('0xb')](),controller[_0x7554('0xe')]);router[_0x7554('0xa')](_0x7554('0xf'),auth[_0x7554('0xb')](),controller[_0x7554('0x10')]);router[_0x7554('0xa')](_0x7554('0x11'),auth[_0x7554('0xb')](),controller['getMessages']);router[_0x7554('0xa')](_0x7554('0x12'),auth['isAuthenticated'](),controller[_0x7554('0x13')]);router[_0x7554('0x14')]('/',auth['isAuthenticated'](),controller[_0x7554('0x15')]);router[_0x7554('0x14')](_0x7554('0x11'),auth[_0x7554('0xb')](),controller[_0x7554('0x16')]);router['post']('/:id/tags',auth[_0x7554('0xb')](),interaction[_0x7554('0x17')](_0x7554('0x18'),_0x7554('0x19')),controller[_0x7554('0x1a')]);router[_0x7554('0x1b')]('/:id',auth[_0x7554('0xb')](),interaction[_0x7554('0x17')](_0x7554('0x18'),_0x7554('0x1c')),controller[_0x7554('0x1d')]);router[_0x7554('0x1e')](_0x7554('0xf'),auth[_0x7554('0xb')](),interaction[_0x7554('0x17')](_0x7554('0x18'),_0x7554('0x1f')),controller[_0x7554('0x20')]);router[_0x7554('0x1e')](_0x7554('0x21'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xec12=['show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','fax','addTags','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xa74e7b,_0x4a3ee5){var _0x431939=function(_0x58b6ed){while(--_0x58b6ed){_0xa74e7b['push'](_0xa74e7b['shift']());}};_0x431939(++_0x4a3ee5);}(_0xec12,0x1bf));var _0x2ec1=function(_0xd99de,_0x2270a9){_0xd99de=_0xd99de-0x0;var _0x54116b=_0xec12[_0xd99de];return _0x54116b;};'use strict';var multer=require(_0x2ec1('0x0'));var util=require(_0x2ec1('0x1'));var path=require('path');var timeout=require(_0x2ec1('0x2'));var express=require(_0x2ec1('0x3'));var router=express[_0x2ec1('0x4')]();var fs_extra=require(_0x2ec1('0x5'));var auth=require(_0x2ec1('0x6'));var interaction=require(_0x2ec1('0x7'));var config=require(_0x2ec1('0x8'));var controller=require('./faxInteraction.controller');router[_0x2ec1('0x9')]('/',auth[_0x2ec1('0xa')](),controller[_0x2ec1('0xb')]);router[_0x2ec1('0x9')](_0x2ec1('0xc'),auth[_0x2ec1('0xa')](),controller[_0x2ec1('0xd')]);router[_0x2ec1('0x9')](_0x2ec1('0xe'),auth[_0x2ec1('0xa')](),controller[_0x2ec1('0xf')]);router['get'](_0x2ec1('0x10'),auth[_0x2ec1('0xa')](),controller[_0x2ec1('0x11')]);router[_0x2ec1('0x9')](_0x2ec1('0x12'),auth[_0x2ec1('0xa')](),controller[_0x2ec1('0x13')]);router[_0x2ec1('0x14')]('/',auth[_0x2ec1('0xa')](),controller['create']);router[_0x2ec1('0x14')]('/:id/messages',auth[_0x2ec1('0xa')](),controller[_0x2ec1('0x15')]);router[_0x2ec1('0x14')](_0x2ec1('0x16'),auth[_0x2ec1('0xa')](),interaction['tracked'](_0x2ec1('0x17'),'faxinteraction:addtags'),controller[_0x2ec1('0x18')]);router['put'](_0x2ec1('0xe'),auth[_0x2ec1('0xa')](),interaction[_0x2ec1('0x19')]('fax',_0x2ec1('0x1a')),controller[_0x2ec1('0x1b')]);router[_0x2ec1('0x1c')](_0x2ec1('0xe'),auth[_0x2ec1('0xa')](),interaction[_0x2ec1('0x19')](_0x2ec1('0x17'),_0x2ec1('0x1d')),controller[_0x2ec1('0x1e')]);router[_0x2ec1('0x1c')]('/:id/tags',auth[_0x2ec1('0xa')](),controller[_0x2ec1('0x1f')]);module[_0x2ec1('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index e61b1d6..ff12f11 100644 --- a/server/api/faxMessage/faxMessage.attributes.js +++ b/server/api/faxMessage/faxMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x513988,_0x3566e7){var _0x2b43bc=function(_0x51e38){while(--_0x51e38){_0x513988['push'](_0x513988['shift']());}};_0x2b43bc(++_0x3566e7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xf3cd[_0x128bef];return _0x1ba862;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'body':{'type':Sequelize[_0xdf3c('0x2')](_0xdf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdf3c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf3c('0x5')]('in','out'),'defaultValue':_0xdf3c('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdf3c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xdf3c('0x7')]}}; \ No newline at end of file +var _0x6737=['BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x6737,0xe2));var _0x7673=function(_0x133d89,_0xe80fe9){_0x133d89=_0x133d89-0x0;var _0x20e597=_0x6737[_0x133d89];return _0x20e597;};'use strict';var Sequelize=require('sequelize');module[_0x7673('0x0')]={'body':{'type':Sequelize[_0x7673('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7673('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7673('0x3')]('in',_0x7673('0x4')),'defaultValue':_0x7673('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7673('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 503988d..d6b65bd 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 _0x6e86=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','map','FaxMessage','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','body','params','describe','accept','read','UserId','user','agent','get','FaxInteraction','isNil','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','channel','event','EventManager','fax-interactions','fax','FaxInteractionId','RejectMessage','rejectMessage','ContactId','SIP/%s','motionChannel','create','findOne','SendFax','FaxAccountId','basename','AttachmentId','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x1b561a,_0x25551c){var _0x4e9e58=function(_0x59b95f){while(--_0x59b95f){_0x1b561a['push'](_0x1b561a['shift']());}};_0x4e9e58(++_0x25551c);}(_0x6e86,0x183));var _0x66e8=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0x6e86[_0x5de967];return _0x5b07a3;};'use strict';var emlformat=require(_0x66e8('0x0'));var rimraf=require(_0x66e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x66e8('0x2'));var moment=require('moment');var BPromise=require(_0x66e8('0x3'));var Mustache=require(_0x66e8('0x4'));var util=require('util');var path=require('path');var sox=require(_0x66e8('0x5'));var csv=require(_0x66e8('0x6'));var ejs=require(_0x66e8('0x7'));var fs=require('fs');var fs_extra=require(_0x66e8('0x8'));var _=require(_0x66e8('0x9'));var squel=require('squel');var crypto=require(_0x66e8('0xa'));var jsforce=require(_0x66e8('0xb'));var deskjs=require(_0x66e8('0xc'));var toCsv=require(_0x66e8('0x6'));var querystring=require(_0x66e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x66e8('0xe'));var authService=require(_0x66e8('0xf'));var qs=require(_0x66e8('0x10'));var as=require(_0x66e8('0x11'));var hardwareService=require(_0x66e8('0x12'));var logger=require(_0x66e8('0x13'))(_0x66e8('0x14'));var utils=require(_0x66e8('0x15'));var config=require(_0x66e8('0x16'));var licenseUtil=require(_0x66e8('0x17'));var db=require('../../mysqldb')['db'];config[_0x66e8('0x18')]=_[_0x66e8('0x19')](config[_0x66e8('0x18')],{'host':_0x66e8('0x1a'),'port':0x18eb});var socket=require(_0x66e8('0x1b'))(new Redis(config[_0x66e8('0x18')]));require(_0x66e8('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x66e8('0x1d')][_0x66e8('0x1e')]({'port':0x232c});var client9002=jayson[_0x66e8('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1af838,_0x28c1ea,_0x366473,_0x1cf406){return new BPromise(function(_0x2f7980,_0x4378c5){var _0x14c742=_0x1cf406||client;return _0x14c742[_0x66e8('0x1f')](_0x1af838,_0x366473)[_0x66e8('0x20')](function(_0x23f1cd){logger[_0x66e8('0x21')](_0x66e8('0x22'),_0x28c1ea,_0x66e8('0x23'));logger[_0x66e8('0x24')](_0x66e8('0x25'),_0x28c1ea,_0x66e8('0x23'),JSON['stringify'](_0x23f1cd));if(_0x23f1cd[_0x66e8('0x26')]){if(_0x23f1cd['error'][_0x66e8('0x27')]===0x1f4){logger[_0x66e8('0x26')]('FaxMessage,\x20%s,\x20%s',_0x28c1ea,_0x23f1cd[_0x66e8('0x26')]['message']);return _0x4378c5(_0x23f1cd[_0x66e8('0x26')][_0x66e8('0x28')]);}logger[_0x66e8('0x26')]('FaxMessage,\x20%s,\x20%s',_0x28c1ea,_0x23f1cd[_0x66e8('0x26')]['message']);return _0x2f7980(_0x23f1cd[_0x66e8('0x26')]['message']);}else{logger[_0x66e8('0x21')](_0x66e8('0x22'),_0x28c1ea,'request\x20sent');_0x2f7980(_0x23f1cd[_0x66e8('0x29')]['message']);}})[_0x66e8('0x2a')](function(_0x999efa){logger['error'](_0x66e8('0x22'),_0x28c1ea,_0x999efa);_0x4378c5(_0x999efa);});});}function respondWithStatusCode(_0x356098,_0x1a3a5b){_0x1a3a5b=_0x1a3a5b||0xcc;return function(_0xc2bc0e){if(_0xc2bc0e){return _0x356098[_0x66e8('0x2b')](_0x1a3a5b);}return _0x356098[_0x66e8('0x2c')](_0x1a3a5b)['end']();};}function respondWithResult(_0x40de9a,_0x3dfead){_0x3dfead=_0x3dfead||0xc8;return function(_0x51979e){if(_0x51979e){return _0x40de9a[_0x66e8('0x2c')](_0x3dfead)[_0x66e8('0x2d')](_0x51979e);}};}function respondWithFilteredResult(_0x4cfec3,_0x521aac){return function(_0x8da4e){if(_0x8da4e){var _0x21643d=typeof _0x521aac[_0x66e8('0x2e')]===_0x66e8('0x2f')&&typeof _0x521aac['limit']===_0x66e8('0x2f');var _0x56385a=_0x8da4e[_0x66e8('0x30')];var _0x391200=_0x21643d?0x0:_0x521aac[_0x66e8('0x2e')];var _0x332b55=_0x21643d?_0x8da4e[_0x66e8('0x30')]:_0x521aac[_0x66e8('0x2e')]+_0x521aac[_0x66e8('0x31')];var _0x2a74ec;if(_0x332b55>=_0x56385a){_0x332b55=_0x56385a;_0x2a74ec=0xc8;}else{_0x2a74ec=0xce;}_0x4cfec3['status'](_0x2a74ec);return _0x4cfec3[_0x66e8('0x32')](_0x66e8('0x33'),_0x391200+'-'+_0x332b55+'/'+_0x56385a)[_0x66e8('0x2d')](_0x8da4e);}return null;};}function patchUpdates(_0x50246f){return function(_0x3ccd57){try{jsonpatch[_0x66e8('0x34')](_0x3ccd57,_0x50246f,!![]);}catch(_0x31559b){return BPromise[_0x66e8('0x35')](_0x31559b);}return _0x3ccd57[_0x66e8('0x36')]();};}function saveUpdates(_0xcb7eaa,_0x4e565e){return function(_0x17d49b){if(_0x17d49b){return _0x17d49b[_0x66e8('0x37')](_0xcb7eaa)['then'](function(_0x115185){return _0x115185;});}return null;};}function removeEntity(_0xa7b542,_0x4e45e5){return function(_0x56b5d6){if(_0x56b5d6){return _0x56b5d6[_0x66e8('0x38')]()[_0x66e8('0x20')](function(){_0xa7b542[_0x66e8('0x2c')](0xcc)[_0x66e8('0x39')]();});}};}function handleEntityNotFound(_0x5a5f85,_0x4236d3){return function(_0x49fa21){if(!_0x49fa21){_0x5a5f85['sendStatus'](0x194);}return _0x49fa21;};}function handleError(_0x23528a,_0x27119f){_0x27119f=_0x27119f||0x1f4;return function(_0x3fb26d){logger[_0x66e8('0x26')](_0x3fb26d[_0x66e8('0x3a')]);if(_0x3fb26d[_0x66e8('0x3b')]){delete _0x3fb26d[_0x66e8('0x3b')];}_0x23528a[_0x66e8('0x2c')](_0x27119f)['send'](_0x3fb26d);};}exports['index']=function(_0x4d7e3d,_0x285bed){var _0x386e75={},_0x22c8f6={},_0xd46b2c={'count':0x0,'rows':[]};var _0x34a777=_[_0x66e8('0x3c')](db[_0x66e8('0x3d')]['rawAttributes'],function(_0x1e0c14){return{'name':_0x1e0c14['fieldName'],'type':_0x1e0c14[_0x66e8('0x3e')][_0x66e8('0x3f')]};});_0x22c8f6[_0x66e8('0x40')]=_[_0x66e8('0x3c')](_0x34a777,_0x66e8('0x3b'));_0x22c8f6['query']=_['keys'](_0x4d7e3d['query']);_0x22c8f6['filters']=_[_0x66e8('0x41')](_0x22c8f6[_0x66e8('0x40')],_0x22c8f6[_0x66e8('0x42')]);_0x386e75[_0x66e8('0x43')]=_[_0x66e8('0x41')](_0x22c8f6[_0x66e8('0x40')],qs['fields'](_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x44')]));_0x386e75[_0x66e8('0x43')]=_0x386e75[_0x66e8('0x43')][_0x66e8('0x45')]?_0x386e75['attributes']:_0x22c8f6['model'];if(!_0x4d7e3d['query'][_0x66e8('0x46')](_0x66e8('0x47'))){_0x386e75[_0x66e8('0x31')]=qs[_0x66e8('0x31')](_0x4d7e3d[_0x66e8('0x42')]['limit']);_0x386e75[_0x66e8('0x2e')]=qs['offset'](_0x4d7e3d['query'][_0x66e8('0x2e')]);}_0x386e75[_0x66e8('0x48')]=qs[_0x66e8('0x49')](_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x49')]);_0x386e75[_0x66e8('0x4a')]=qs['filters'](_[_0x66e8('0x4b')](_0x4d7e3d[_0x66e8('0x42')],_0x22c8f6[_0x66e8('0x4c')]),_0x34a777);if(_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x4d')]){_0x386e75[_0x66e8('0x4a')]=_[_0x66e8('0x4e')](_0x386e75['where'],{'$or':_['map'](_0x34a777,function(_0x395c77){if(_0x395c77['type']!=='VIRTUAL'){var _0x563d26={};_0x563d26[_0x395c77[_0x66e8('0x3b')]]={'$like':'%'+_0x4d7e3d['query']['filter']+'%'};return _0x563d26;}})});}_0x386e75=_['merge']({},_0x386e75,_0x4d7e3d['options']);var _0x10252a={'where':_0x386e75['where']};return db[_0x66e8('0x3d')][_0x66e8('0x30')](_0x10252a)[_0x66e8('0x20')](function(_0x3ab0fb){_0xd46b2c[_0x66e8('0x30')]=_0x3ab0fb;if(_0x4d7e3d[_0x66e8('0x42')][_0x66e8('0x4f')]){_0x386e75[_0x66e8('0x50')]=[{'all':!![]}];}return db[_0x66e8('0x3d')][_0x66e8('0x51')](_0x386e75);})['then'](function(_0x3903cc){_0xd46b2c[_0x66e8('0x52')]=_0x3903cc;return _0xd46b2c;})['then'](respondWithFilteredResult(_0x285bed,_0x386e75))[_0x66e8('0x2a')](handleError(_0x285bed,null));};exports[_0x66e8('0x53')]=function(_0x3b2e41,_0xf63831){var _0x5bcb36={'raw':!![],'where':{'id':_0x3b2e41['params']['id']}},_0x59c6a1={};_0x59c6a1['model']=_[_0x66e8('0x54')](db[_0x66e8('0x3d')][_0x66e8('0x55')]);_0x59c6a1[_0x66e8('0x42')]=_[_0x66e8('0x54')](_0x3b2e41[_0x66e8('0x42')]);_0x59c6a1['filters']=_[_0x66e8('0x41')](_0x59c6a1[_0x66e8('0x40')],_0x59c6a1[_0x66e8('0x42')]);_0x5bcb36[_0x66e8('0x43')]=_[_0x66e8('0x41')](_0x59c6a1['model'],qs[_0x66e8('0x44')](_0x3b2e41[_0x66e8('0x42')][_0x66e8('0x44')]));_0x5bcb36['attributes']=_0x5bcb36['attributes'][_0x66e8('0x45')]?_0x5bcb36[_0x66e8('0x43')]:_0x59c6a1['model'];if(_0x3b2e41[_0x66e8('0x42')][_0x66e8('0x4f')]){_0x5bcb36[_0x66e8('0x50')]=[{'all':!![]}];}_0x5bcb36=_[_0x66e8('0x4e')]({},_0x5bcb36,_0x3b2e41[_0x66e8('0x56')]);return db[_0x66e8('0x3d')][_0x66e8('0x57')](_0x5bcb36)[_0x66e8('0x20')](handleEntityNotFound(_0xf63831,null))['then'](respondWithResult(_0xf63831,null))[_0x66e8('0x2a')](handleError(_0xf63831,null));};exports['update']=function(_0x551d31,_0x1d3342){if(_0x551d31[_0x66e8('0x58')]['id']){delete _0x551d31[_0x66e8('0x58')]['id'];}return db[_0x66e8('0x3d')]['find']({'where':{'id':_0x551d31[_0x66e8('0x59')]['id']}})[_0x66e8('0x20')](handleEntityNotFound(_0x1d3342,null))[_0x66e8('0x20')](saveUpdates(_0x551d31[_0x66e8('0x58')],null))[_0x66e8('0x20')](respondWithResult(_0x1d3342,null))[_0x66e8('0x2a')](handleError(_0x1d3342,null));};exports[_0x66e8('0x38')]=function(_0x32dd97,_0x401ccf){return db['FaxMessage'][_0x66e8('0x57')]({'where':{'id':_0x32dd97[_0x66e8('0x59')]['id']}})['then'](handleEntityNotFound(_0x401ccf,null))[_0x66e8('0x20')](removeEntity(_0x401ccf,null))[_0x66e8('0x2a')](handleError(_0x401ccf,null));};exports[_0x66e8('0x5a')]=function(_0x4fb97f,_0x528e4c){return db[_0x66e8('0x3d')]['describe']()[_0x66e8('0x20')](respondWithResult(_0x528e4c,null))['catch'](handleError(_0x528e4c,null));};var interaction_log=require(_0x66e8('0x13'))('fax-interactions');exports[_0x66e8('0x5b')]=function(_0x2a07a6,_0x5acd56,_0xd4c775){var _0x2248dc={'agent':{},'channel':'fax'};if(_0x2a07a6['body']['id']){delete _0x2a07a6[_0x66e8('0x58')]['id'];}_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x5c')]=!![];_0x2a07a6['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a07a6['body']['UserId']=_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x5d')]||_0x2a07a6[_0x66e8('0x5e')]['id'];_0x2248dc[_0x66e8('0x5f')]['id']=_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x5d')];return db[_0x66e8('0x3d')][_0x66e8('0x57')]({'where':{'id':_0x2a07a6['params']['id'],'UserId':null}})[_0x66e8('0x20')](handleEntityNotFound(_0x5acd56,null))['then'](saveUpdates(_0x2a07a6[_0x66e8('0x58')],null))[_0x66e8('0x20')](function(_0x71bc8){if(_0x71bc8){_0x2248dc[_0x66e8('0x28')]=_0x71bc8[_0x66e8('0x60')]({'plain':!![]});return db[_0x66e8('0x61')][_0x66e8('0x57')]({'where':{'id':_0x71bc8['FaxInteractionId']}});}return null;})[_0x66e8('0x20')](handleEntityNotFound(_0x5acd56,null))['then'](function(_0x5609af){if(_0x5609af){return _0x5609af[_0x66e8('0x37')]({'UserId':_0x2a07a6[_0x66e8('0x58')]['UserId'],'read1stAt':_[_0x66e8('0x62')](_0x5609af['read1stAt'])?moment()[_0x66e8('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x66e8('0x20')](function(_0x4b9240){if(_0x4b9240){_0x2248dc['interaction']=_0x4b9240[_0x66e8('0x60')]({'plain':!![]});interaction_log[_0x66e8('0x21')](_0x66e8('0x64'),_0x2a07a6['user']['id'],_0x2a07a6[_0x66e8('0x5e')]['name'],_0x2a07a6[_0x66e8('0x5e')][_0x66e8('0x65')],_0x2248dc[_0x66e8('0x66')]['id'],_0x2a07a6[_0x66e8('0x58')]?JSON[_0x66e8('0x67')](_0x2a07a6[_0x66e8('0x58')]):_0x66e8('0x68'));return respondWithRpcPromise(_0x66e8('0x69'),_0x66e8('0x6a'),_0x2248dc);}return null;})[_0x66e8('0x20')](function(_0x572600){var _0x49f5b5=_0x66e8('0x6b')+_0x572600[_0x66e8('0x28')]['ContactId'];return db[_0x66e8('0x6c')][_0x66e8('0x42')](_0x49f5b5,{'type':db[_0x66e8('0x6d')][_0x66e8('0x6e')][_0x66e8('0x6f')],'raw':!![]})['then'](function(_0x377e73){return _0x377e73;});})[_0x66e8('0x20')](function(_0x413b69){if(_0x413b69){_0x2248dc[_0x66e8('0x28')][_0x66e8('0x70')]=_0x413b69[0x0];if(!_0x2a07a6[_0x66e8('0x58')]['UserId'])return;return db[_0x66e8('0x71')][_0x66e8('0x57')]({'where':{'id':_0x2a07a6['body']['UserId'],'role':'agent'},'attributes':['id',_0x66e8('0x3b'),_0x66e8('0x72'),_0x66e8('0x73'),'internal'],'raw':!![]});}return null;})[_0x66e8('0x20')](function(_0x56af77){if(!_0x56af77)return null;_0x2248dc[_0x66e8('0x28')][_0x66e8('0x5f')]=_0x56af77;return _0x2248dc;})[_0x66e8('0x20')](function(_0x309925){if(_0x309925){if(_0x2a07a6[_0x66e8('0x58')][_0x66e8('0x74')]){_0x2248dc[_0x66e8('0x28')]['interface']=util[_0x66e8('0x63')]('SIP/%s',_0x2a07a6['user'][_0x66e8('0x3b')]);_0x2248dc['message']['channel']=_0x2248dc['channel'];_0x2248dc['message']['motionChannel']=_0x2248dc[_0x66e8('0x75')];_0x2248dc['message'][_0x66e8('0x76')]=_0x66e8('0x5b');return respondWithRpcPromise('EventManager',_0x66e8('0x77'),{'event':'acceptmessage','message':_0x2248dc['message']},client9002)['then'](function(){return _0x2248dc;});}return _0x2248dc;}return null;})[_0x66e8('0x20')](respondWithResult(_0x5acd56,null))[_0x66e8('0x2a')](handleError(_0x5acd56,null));};var interaction_log=require('../../config/logger')(_0x66e8('0x78'));exports[_0x66e8('0x35')]=function(_0x35022f,_0x4b0003,_0xd1df11){var _0x562ca8={'agent':{},'channel':_0x66e8('0x79')};if(_0x35022f['body']['id']){delete _0x35022f['body']['id'];}_0x35022f[_0x66e8('0x58')][_0x66e8('0x5d')]=_0x35022f[_0x66e8('0x58')][_0x66e8('0x5d')]||_0x35022f[_0x66e8('0x5e')]['id'];_0x562ca8[_0x66e8('0x5f')]['id']=_0x35022f['body'][_0x66e8('0x5d')];return db['FaxMessage'][_0x66e8('0x57')]({'where':{'id':_0x35022f['params']['id'],'UserId':null}})[_0x66e8('0x20')](handleEntityNotFound(_0x4b0003,null))[_0x66e8('0x20')](function(_0x37ca18){if(_0x37ca18){_0x562ca8[_0x66e8('0x28')]=_0x37ca18[_0x66e8('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x66e8('0x57')]({'where':{'id':_0x37ca18[_0x66e8('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x4b0003,null))[_0x66e8('0x20')](function(_0x2d59a0){if(_0x2d59a0){_0x562ca8[_0x66e8('0x66')]=_0x2d59a0[_0x66e8('0x60')]({'plain':!![]});interaction_log[_0x66e8('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35022f[_0x66e8('0x5e')]['id'],_0x35022f['user'][_0x66e8('0x3b')],_0x35022f['user'][_0x66e8('0x65')],_0x562ca8[_0x66e8('0x66')]['id'],_0x35022f[_0x66e8('0x58')]?JSON[_0x66e8('0x67')](_0x35022f[_0x66e8('0x58')]):_0x66e8('0x68'));return respondWithRpcPromise(_0x66e8('0x7b'),_0x66e8('0x7c'),_0x562ca8);}return null;})[_0x66e8('0x20')](function(_0x34f2b0){var _0x19c8ff=_0x66e8('0x6b')+_0x34f2b0[_0x66e8('0x28')][_0x66e8('0x7d')];return db[_0x66e8('0x6c')][_0x66e8('0x42')](_0x19c8ff,{'type':db['Sequelize'][_0x66e8('0x6e')][_0x66e8('0x6f')],'raw':!![]})['then'](function(_0x2e0343){return _0x2e0343;});})[_0x66e8('0x20')](function(_0x23ba80){if(_0x23ba80){_0x562ca8[_0x66e8('0x28')][_0x66e8('0x70')]=_0x23ba80[0x0];if(!_0x35022f['body']['UserId'])return;return db[_0x66e8('0x71')]['find']({'where':{'id':_0x35022f[_0x66e8('0x58')][_0x66e8('0x5d')],'role':_0x66e8('0x5f')},'attributes':['id',_0x66e8('0x3b'),'fullname',_0x66e8('0x73'),'internal'],'raw':!![]});}return null;})[_0x66e8('0x20')](function(_0x589b23){if(!_0x589b23)return null;_0x562ca8['message'][_0x66e8('0x5f')]=_0x589b23;return _0x562ca8;})[_0x66e8('0x20')](function(_0x11335f){if(_0x11335f){_0x11335f[_0x66e8('0x28')]['interface']=util[_0x66e8('0x63')](_0x66e8('0x7e'),_0x35022f['user'][_0x66e8('0x3b')]);_0x11335f[_0x66e8('0x28')]['channel']=_0x562ca8[_0x66e8('0x75')];_0x11335f[_0x66e8('0x28')][_0x66e8('0x7f')]=_0x562ca8[_0x66e8('0x75')];_0x11335f[_0x66e8('0x28')]['event']=_0x66e8('0x35');respondWithRpcPromise(_0x66e8('0x77'),_0x66e8('0x77'),{'event':'rejectmessage','message':_0x11335f[_0x66e8('0x28')]},client9002);return _0x562ca8;}return null;})[_0x66e8('0x20')](respondWithResult(_0x4b0003,null))[_0x66e8('0x2a')](handleError(_0x4b0003,null));};exports[_0x66e8('0x80')]=function(_0x5d6de9,_0x2e7c08){var _0x2e556c;return db[_0x66e8('0x3d')][_0x66e8('0x80')](_0x5d6de9[_0x66e8('0x58')],{})[_0x66e8('0x20')](function(_0x3f2b60){_0x2e556c=_0x3f2b60;return db['CmContact']['findOne']({'where':{'id':_0x2e556c['ContactId']}});})[_0x66e8('0x20')](function(_0x298a5b){if(_[_0x66e8('0x62')](_0x298a5b)){return;}else{_0x2e556c['fax']=_0x298a5b['fax'];return db['Attachment'][_0x66e8('0x81')]({'where':{'id':_0x2e556c['AttachmentId']}});}})['then'](function(_0x5937b6){return respondWithRpcPromise(_0x66e8('0x82'),_0x66e8('0x82'),{'FaxAccountId':_[_0x66e8('0x62')](_0x5d6de9[_0x66e8('0x58')])?undefined:_0x5d6de9[_0x66e8('0x58')][_0x66e8('0x83')],'path':_[_0x66e8('0x62')](_0x5937b6)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x5937b6[_0x66e8('0x84')]),'fax':_[_0x66e8('0x62')](_0x2e556c[_0x66e8('0x79')])?undefined:_0x2e556c[_0x66e8('0x79')],'AttachmentId':_0x2e556c[_0x66e8('0x85')]},client9002);})[_0x66e8('0x20')](respondWithResult(_0x2e7c08,0xc9))['catch'](handleError(_0x2e7c08,null));};exports[_0x66e8('0x86')]=function(_0x436bab,_0x529efe){var _0x1de33=path[_0x66e8('0x87')](config[_0x66e8('0x88')],_0x66e8('0x89'),_0x66e8('0x8a'),_0x66e8('0x8b'));return db[_0x66e8('0x3d')]['find']({'where':{'id':_0x436bab[_0x66e8('0x59')]['id']},'include':[{'model':db[_0x66e8('0x8c')],'as':_0x66e8('0x8c')}]})['then'](handleEntityNotFound(_0x529efe,null))[_0x66e8('0x20')](function(_0xd3beda){if(_0xd3beda){return _0x529efe['download'](path['join'](_0x1de33,_0xd3beda[_0x66e8('0x8c')][_0x66e8('0x84')]));}})['catch'](handleError(_0x529efe,null));}; \ No newline at end of file +var _0x271f=['root','server','download','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','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','./faxMessage.socket','register','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','include','find','body','destroy','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','sequelize','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x271f,0x123));var _0xf271=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x271f[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xf271('0x0'));var rimraf=require(_0xf271('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf271('0x2'));var moment=require(_0xf271('0x3'));var BPromise=require(_0xf271('0x4'));var Mustache=require(_0xf271('0x5'));var util=require(_0xf271('0x6'));var path=require(_0xf271('0x7'));var sox=require('sox');var csv=require(_0xf271('0x8'));var ejs=require(_0xf271('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf271('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf271('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf271('0x8'));var querystring=require(_0xf271('0xc'));var Papa=require(_0xf271('0xd'));var Redis=require('ioredis');var authService=require(_0xf271('0xe'));var qs=require(_0xf271('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf271('0x10'));var logger=require(_0xf271('0x11'))(_0xf271('0x12'));var utils=require(_0xf271('0x13'));var config=require(_0xf271('0x14'));var licenseUtil=require(_0xf271('0x15'));var db=require(_0xf271('0x16'))['db'];config[_0xf271('0x17')]=_[_0xf271('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf271('0x19'))(new Redis(config[_0xf271('0x17')]));require(_0xf271('0x1a'))[_0xf271('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf271('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xf271('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x300437,_0x3f8a66,_0x83a5ec,_0xafe6f5){return new BPromise(function(_0x3b7ebc,_0x5e37e7){var _0x48b1a5=_0xafe6f5||client;return _0x48b1a5[_0xf271('0x1d')](_0x300437,_0x83a5ec)[_0xf271('0x1e')](function(_0x435a75){logger[_0xf271('0x1f')](_0xf271('0x20'),_0x3f8a66,_0xf271('0x21'));logger[_0xf271('0x22')](_0xf271('0x23'),_0x3f8a66,_0xf271('0x21'),JSON['stringify'](_0x435a75));if(_0x435a75[_0xf271('0x24')]){if(_0x435a75[_0xf271('0x24')][_0xf271('0x25')]===0x1f4){logger[_0xf271('0x24')](_0xf271('0x20'),_0x3f8a66,_0x435a75['error'][_0xf271('0x26')]);return _0x5e37e7(_0x435a75['error'][_0xf271('0x26')]);}logger[_0xf271('0x24')](_0xf271('0x20'),_0x3f8a66,_0x435a75[_0xf271('0x24')][_0xf271('0x26')]);return _0x3b7ebc(_0x435a75[_0xf271('0x24')][_0xf271('0x26')]);}else{logger['info'](_0xf271('0x20'),_0x3f8a66,_0xf271('0x21'));_0x3b7ebc(_0x435a75[_0xf271('0x27')][_0xf271('0x26')]);}})[_0xf271('0x28')](function(_0x5aea02){logger['error'](_0xf271('0x20'),_0x3f8a66,_0x5aea02);_0x5e37e7(_0x5aea02);});});}function respondWithStatusCode(_0x1a69cd,_0x12250f){_0x12250f=_0x12250f||0xcc;return function(_0x158fd0){if(_0x158fd0){return _0x1a69cd[_0xf271('0x29')](_0x12250f);}return _0x1a69cd[_0xf271('0x2a')](_0x12250f)[_0xf271('0x2b')]();};}function respondWithResult(_0x30e61b,_0x124645){_0x124645=_0x124645||0xc8;return function(_0x58d337){if(_0x58d337){return _0x30e61b[_0xf271('0x2a')](_0x124645)[_0xf271('0x2c')](_0x58d337);}};}function respondWithFilteredResult(_0x56e017,_0x2558b3){return function(_0x2416e0){if(_0x2416e0){var _0x4c37ed=typeof _0x2558b3[_0xf271('0x2d')]===_0xf271('0x2e')&&typeof _0x2558b3[_0xf271('0x2f')]===_0xf271('0x2e');var _0x35001d=_0x2416e0[_0xf271('0x30')];var _0x4579bc=_0x4c37ed?0x0:_0x2558b3[_0xf271('0x2d')];var _0x11f92a=_0x4c37ed?_0x2416e0[_0xf271('0x30')]:_0x2558b3['offset']+_0x2558b3['limit'];var _0x5ebb3c;if(_0x11f92a>=_0x35001d){_0x11f92a=_0x35001d;_0x5ebb3c=0xc8;}else{_0x5ebb3c=0xce;}_0x56e017[_0xf271('0x2a')](_0x5ebb3c);return _0x56e017[_0xf271('0x31')]('Content-Range',_0x4579bc+'-'+_0x11f92a+'/'+_0x35001d)[_0xf271('0x2c')](_0x2416e0);}return null;};}function patchUpdates(_0x34e386){return function(_0x301d0b){try{jsonpatch[_0xf271('0x32')](_0x301d0b,_0x34e386,!![]);}catch(_0x2a6a64){return BPromise[_0xf271('0x33')](_0x2a6a64);}return _0x301d0b[_0xf271('0x34')]();};}function saveUpdates(_0x1ca018,_0x1a2e23){return function(_0x9614b4){if(_0x9614b4){return _0x9614b4[_0xf271('0x35')](_0x1ca018)[_0xf271('0x1e')](function(_0x1e8668){return _0x1e8668;});}return null;};}function removeEntity(_0x3e709b,_0x258e04){return function(_0x3da6b5){if(_0x3da6b5){return _0x3da6b5['destroy']()['then'](function(){_0x3e709b[_0xf271('0x2a')](0xcc)[_0xf271('0x2b')]();});}};}function handleEntityNotFound(_0x225d61,_0xd719d9){return function(_0x585b98){if(!_0x585b98){_0x225d61[_0xf271('0x29')](0x194);}return _0x585b98;};}function handleError(_0x1a475a,_0xdb1b1d){_0xdb1b1d=_0xdb1b1d||0x1f4;return function(_0x263eaa){logger[_0xf271('0x24')](_0x263eaa[_0xf271('0x36')]);if(_0x263eaa[_0xf271('0x37')]){delete _0x263eaa[_0xf271('0x37')];}_0x1a475a['status'](_0xdb1b1d)[_0xf271('0x38')](_0x263eaa);};}exports[_0xf271('0x39')]=function(_0x25c777,_0x49d380){var _0x25787a={},_0x554879={},_0x3e0eca={'count':0x0,'rows':[]};var _0xc62ef9=_[_0xf271('0x3a')](db[_0xf271('0x3b')][_0xf271('0x3c')],function(_0x48ba69){return{'name':_0x48ba69[_0xf271('0x3d')],'type':_0x48ba69[_0xf271('0x3e')]['key']};});_0x554879[_0xf271('0x3f')]=_['map'](_0xc62ef9,_0xf271('0x37'));_0x554879[_0xf271('0x40')]=_[_0xf271('0x41')](_0x25c777[_0xf271('0x40')]);_0x554879[_0xf271('0x42')]=_[_0xf271('0x43')](_0x554879['model'],_0x554879[_0xf271('0x40')]);_0x25787a[_0xf271('0x44')]=_[_0xf271('0x43')](_0x554879['model'],qs['fields'](_0x25c777[_0xf271('0x40')][_0xf271('0x45')]));_0x25787a[_0xf271('0x44')]=_0x25787a[_0xf271('0x44')]['length']?_0x25787a[_0xf271('0x44')]:_0x554879[_0xf271('0x3f')];if(!_0x25c777[_0xf271('0x40')][_0xf271('0x46')](_0xf271('0x47'))){_0x25787a[_0xf271('0x2f')]=qs[_0xf271('0x2f')](_0x25c777[_0xf271('0x40')][_0xf271('0x2f')]);_0x25787a[_0xf271('0x2d')]=qs[_0xf271('0x2d')](_0x25c777[_0xf271('0x40')][_0xf271('0x2d')]);}_0x25787a['order']=qs[_0xf271('0x48')](_0x25c777['query'][_0xf271('0x48')]);_0x25787a[_0xf271('0x49')]=qs[_0xf271('0x42')](_['pick'](_0x25c777[_0xf271('0x40')],_0x554879[_0xf271('0x42')]),_0xc62ef9);if(_0x25c777[_0xf271('0x40')][_0xf271('0x4a')]){_0x25787a[_0xf271('0x49')]=_['merge'](_0x25787a['where'],{'$or':_[_0xf271('0x3a')](_0xc62ef9,function(_0x101a76){if(_0x101a76['type']!==_0xf271('0x4b')){var _0xf7ca83={};_0xf7ca83[_0x101a76[_0xf271('0x37')]]={'$like':'%'+_0x25c777[_0xf271('0x40')][_0xf271('0x4a')]+'%'};return _0xf7ca83;}})});}_0x25787a=_[_0xf271('0x4c')]({},_0x25787a,_0x25c777[_0xf271('0x4d')]);var _0x5ea420={'where':_0x25787a['where']};return db[_0xf271('0x3b')][_0xf271('0x30')](_0x5ea420)[_0xf271('0x1e')](function(_0x4e2309){_0x3e0eca['count']=_0x4e2309;if(_0x25c777['query'][_0xf271('0x4e')]){_0x25787a['include']=[{'all':!![]}];}return db['FaxMessage'][_0xf271('0x4f')](_0x25787a);})['then'](function(_0x2f976c){_0x3e0eca[_0xf271('0x50')]=_0x2f976c;return _0x3e0eca;})[_0xf271('0x1e')](respondWithFilteredResult(_0x49d380,_0x25787a))[_0xf271('0x28')](handleError(_0x49d380,null));};exports[_0xf271('0x51')]=function(_0xe2dca0,_0x24554d){var _0x2fec38={'raw':!![],'where':{'id':_0xe2dca0[_0xf271('0x52')]['id']}},_0x637ec4={};_0x637ec4['model']=_[_0xf271('0x41')](db[_0xf271('0x3b')][_0xf271('0x3c')]);_0x637ec4[_0xf271('0x40')]=_[_0xf271('0x41')](_0xe2dca0[_0xf271('0x40')]);_0x637ec4[_0xf271('0x42')]=_[_0xf271('0x43')](_0x637ec4['model'],_0x637ec4[_0xf271('0x40')]);_0x2fec38[_0xf271('0x44')]=_['intersection'](_0x637ec4['model'],qs['fields'](_0xe2dca0[_0xf271('0x40')][_0xf271('0x45')]));_0x2fec38[_0xf271('0x44')]=_0x2fec38[_0xf271('0x44')][_0xf271('0x53')]?_0x2fec38[_0xf271('0x44')]:_0x637ec4['model'];if(_0xe2dca0[_0xf271('0x40')][_0xf271('0x4e')]){_0x2fec38[_0xf271('0x54')]=[{'all':!![]}];}_0x2fec38=_['merge']({},_0x2fec38,_0xe2dca0['options']);return db['FaxMessage'][_0xf271('0x55')](_0x2fec38)[_0xf271('0x1e')](handleEntityNotFound(_0x24554d,null))[_0xf271('0x1e')](respondWithResult(_0x24554d,null))[_0xf271('0x28')](handleError(_0x24554d,null));};exports[_0xf271('0x35')]=function(_0x599266,_0x42e531){if(_0x599266[_0xf271('0x56')]['id']){delete _0x599266[_0xf271('0x56')]['id'];}return db[_0xf271('0x3b')][_0xf271('0x55')]({'where':{'id':_0x599266[_0xf271('0x52')]['id']}})[_0xf271('0x1e')](handleEntityNotFound(_0x42e531,null))[_0xf271('0x1e')](saveUpdates(_0x599266[_0xf271('0x56')],null))[_0xf271('0x1e')](respondWithResult(_0x42e531,null))[_0xf271('0x28')](handleError(_0x42e531,null));};exports[_0xf271('0x57')]=function(_0x514244,_0x4ff051){return db['FaxMessage'][_0xf271('0x55')]({'where':{'id':_0x514244['params']['id']}})[_0xf271('0x1e')](handleEntityNotFound(_0x4ff051,null))[_0xf271('0x1e')](removeEntity(_0x4ff051,null))[_0xf271('0x28')](handleError(_0x4ff051,null));};exports[_0xf271('0x58')]=function(_0x24a4fc,_0x50ec5f){return db['FaxMessage'][_0xf271('0x58')]()[_0xf271('0x1e')](respondWithResult(_0x50ec5f,null))[_0xf271('0x28')](handleError(_0x50ec5f,null));};var interaction_log=require(_0xf271('0x11'))('fax-interactions');exports[_0xf271('0x59')]=function(_0xc5560f,_0x6a61e9,_0x56ee29){var _0x529f7c={'agent':{},'channel':_0xf271('0x5a')};if(_0xc5560f[_0xf271('0x56')]['id']){delete _0xc5560f[_0xf271('0x56')]['id'];}_0xc5560f['body'][_0xf271('0x5b')]=!![];_0xc5560f[_0xf271('0x56')][_0xf271('0x5c')]=moment()[_0xf271('0x5d')](_0xf271('0x5e'));_0xc5560f[_0xf271('0x56')][_0xf271('0x5f')]=_0xc5560f[_0xf271('0x56')][_0xf271('0x5f')]||_0xc5560f[_0xf271('0x60')]['id'];_0x529f7c[_0xf271('0x61')]['id']=_0xc5560f[_0xf271('0x56')][_0xf271('0x5f')];return db['FaxMessage'][_0xf271('0x55')]({'where':{'id':_0xc5560f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6a61e9,null))[_0xf271('0x1e')](saveUpdates(_0xc5560f['body'],null))[_0xf271('0x1e')](function(_0x1b62e1){if(_0x1b62e1){_0x529f7c['message']=_0x1b62e1[_0xf271('0x62')]({'plain':!![]});return db[_0xf271('0x63')][_0xf271('0x55')]({'where':{'id':_0x1b62e1[_0xf271('0x64')]}});}return null;})[_0xf271('0x1e')](handleEntityNotFound(_0x6a61e9,null))[_0xf271('0x1e')](function(_0x5231cd){if(_0x5231cd){return _0x5231cd[_0xf271('0x35')]({'UserId':_0xc5560f[_0xf271('0x56')]['UserId'],'read1stAt':_[_0xf271('0x65')](_0x5231cd['read1stAt'])?moment()[_0xf271('0x5d')](_0xf271('0x5e')):undefined});}return null;})['then'](function(_0x106885){if(_0x106885){_0x529f7c['interaction']=_0x106885[_0xf271('0x62')]({'plain':!![]});interaction_log[_0xf271('0x1f')](_0xf271('0x66'),_0xc5560f['user']['id'],_0xc5560f['user'][_0xf271('0x37')],_0xc5560f[_0xf271('0x60')]['role'],_0x529f7c[_0xf271('0x67')]['id'],_0xc5560f['body']?JSON[_0xf271('0x68')](_0xc5560f[_0xf271('0x56')]):_0xf271('0x69'));return respondWithRpcPromise(_0xf271('0x6a'),_0xf271('0x6b'),_0x529f7c);}return null;})[_0xf271('0x1e')](function(_0x432319){var _0x258011=_0xf271('0x6c')+_0x432319[_0xf271('0x26')][_0xf271('0x6d')];return db['sequelize'][_0xf271('0x40')](_0x258011,{'type':db[_0xf271('0x6e')][_0xf271('0x6f')][_0xf271('0x70')],'raw':!![]})[_0xf271('0x1e')](function(_0x33c591){return _0x33c591;});})[_0xf271('0x1e')](function(_0x282d8c){if(_0x282d8c){_0x529f7c['message'][_0xf271('0x71')]=_0x282d8c[0x0];if(!_0xc5560f[_0xf271('0x56')][_0xf271('0x5f')])return;return db[_0xf271('0x72')][_0xf271('0x55')]({'where':{'id':_0xc5560f[_0xf271('0x56')][_0xf271('0x5f')],'role':_0xf271('0x61')},'attributes':['id',_0xf271('0x37'),_0xf271('0x73'),_0xf271('0x74'),_0xf271('0x75')],'raw':!![]});}return null;})[_0xf271('0x1e')](function(_0x2b1185){if(!_0x2b1185)return null;_0x529f7c[_0xf271('0x26')][_0xf271('0x61')]=_0x2b1185;return _0x529f7c;})['then'](function(_0x45bce5){if(_0x45bce5){if(_0xc5560f['body'][_0xf271('0x76')]){_0x529f7c[_0xf271('0x26')][_0xf271('0x77')]=util[_0xf271('0x5d')](_0xf271('0x78'),_0xc5560f['user']['name']);_0x529f7c['message']['channel']=_0x529f7c['channel'];_0x529f7c[_0xf271('0x26')][_0xf271('0x79')]=_0x529f7c[_0xf271('0x7a')];_0x529f7c[_0xf271('0x26')][_0xf271('0x7b')]=_0xf271('0x59');return respondWithRpcPromise(_0xf271('0x7c'),_0xf271('0x7c'),{'event':_0xf271('0x7d'),'message':_0x529f7c['message']},client9002)[_0xf271('0x1e')](function(){return _0x529f7c;});}return _0x529f7c;}return null;})[_0xf271('0x1e')](respondWithResult(_0x6a61e9,null))[_0xf271('0x28')](handleError(_0x6a61e9,null));};var interaction_log=require(_0xf271('0x11'))(_0xf271('0x7e'));exports['reject']=function(_0x376b91,_0x309453,_0x3b501e){var _0x42a80d={'agent':{},'channel':'fax'};if(_0x376b91[_0xf271('0x56')]['id']){delete _0x376b91[_0xf271('0x56')]['id'];}_0x376b91[_0xf271('0x56')][_0xf271('0x5f')]=_0x376b91[_0xf271('0x56')]['UserId']||_0x376b91[_0xf271('0x60')]['id'];_0x42a80d[_0xf271('0x61')]['id']=_0x376b91[_0xf271('0x56')]['UserId'];return db[_0xf271('0x3b')][_0xf271('0x55')]({'where':{'id':_0x376b91[_0xf271('0x52')]['id'],'UserId':null}})[_0xf271('0x1e')](handleEntityNotFound(_0x309453,null))[_0xf271('0x1e')](function(_0x8ba3cb){if(_0x8ba3cb){_0x42a80d[_0xf271('0x26')]=_0x8ba3cb['get']({'plain':!![]});return db[_0xf271('0x63')]['find']({'where':{'id':_0x8ba3cb[_0xf271('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x309453,null))[_0xf271('0x1e')](function(_0x9ded20){if(_0x9ded20){_0x42a80d['interaction']=_0x9ded20[_0xf271('0x62')]({'plain':!![]});interaction_log[_0xf271('0x1f')](_0xf271('0x7f'),_0x376b91[_0xf271('0x60')]['id'],_0x376b91[_0xf271('0x60')][_0xf271('0x37')],_0x376b91[_0xf271('0x60')][_0xf271('0x80')],_0x42a80d[_0xf271('0x67')]['id'],_0x376b91['body']?JSON[_0xf271('0x68')](_0x376b91[_0xf271('0x56')]):_0xf271('0x69'));return respondWithRpcPromise('RejectMessage',_0xf271('0x81'),_0x42a80d);}return null;})[_0xf271('0x1e')](function(_0x2d4535){var _0x261085=_0xf271('0x6c')+_0x2d4535['message']['ContactId'];return db[_0xf271('0x82')][_0xf271('0x40')](_0x261085,{'type':db[_0xf271('0x6e')][_0xf271('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x273d74){return _0x273d74;});})['then'](function(_0x1469f7){if(_0x1469f7){_0x42a80d[_0xf271('0x26')]['contact']=_0x1469f7[0x0];if(!_0x376b91[_0xf271('0x56')][_0xf271('0x5f')])return;return db[_0xf271('0x72')][_0xf271('0x55')]({'where':{'id':_0x376b91['body'][_0xf271('0x5f')],'role':_0xf271('0x61')},'attributes':['id',_0xf271('0x37'),_0xf271('0x73'),_0xf271('0x74'),_0xf271('0x75')],'raw':!![]});}return null;})[_0xf271('0x1e')](function(_0x14a0a0){if(!_0x14a0a0)return null;_0x42a80d[_0xf271('0x26')]['agent']=_0x14a0a0;return _0x42a80d;})[_0xf271('0x1e')](function(_0x1e9aac){if(_0x1e9aac){_0x1e9aac[_0xf271('0x26')][_0xf271('0x77')]=util['format'](_0xf271('0x78'),_0x376b91['user']['name']);_0x1e9aac['message'][_0xf271('0x7a')]=_0x42a80d['channel'];_0x1e9aac['message'][_0xf271('0x79')]=_0x42a80d[_0xf271('0x7a')];_0x1e9aac[_0xf271('0x26')][_0xf271('0x7b')]=_0xf271('0x33');respondWithRpcPromise(_0xf271('0x7c'),'EventManager',{'event':_0xf271('0x83'),'message':_0x1e9aac[_0xf271('0x26')]},client9002);return _0x42a80d;}return null;})[_0xf271('0x1e')](respondWithResult(_0x309453,null))[_0xf271('0x28')](handleError(_0x309453,null));};exports[_0xf271('0x84')]=function(_0x5ecf7e,_0x254810){var _0x207ecf;return db[_0xf271('0x3b')][_0xf271('0x84')](_0x5ecf7e['body'],{})['then'](function(_0x49b050){_0x207ecf=_0x49b050;return db[_0xf271('0x85')]['findOne']({'where':{'id':_0x207ecf[_0xf271('0x6d')]}});})[_0xf271('0x1e')](function(_0x8d280){if(_['isNil'](_0x8d280)){return;}else{_0x207ecf[_0xf271('0x5a')]=_0x8d280[_0xf271('0x5a')];return db[_0xf271('0x86')][_0xf271('0x87')]({'where':{'id':_0x207ecf[_0xf271('0x88')]}});}})['then'](function(_0x2ed2aa){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xf271('0x65')](_0x5ecf7e[_0xf271('0x56')])?undefined:_0x5ecf7e['body'][_0xf271('0x89')],'path':_['isNil'](_0x2ed2aa)?undefined:util[_0xf271('0x5d')](_0xf271('0x8a'),_0x2ed2aa[_0xf271('0x8b')]),'fax':_[_0xf271('0x65')](_0x207ecf[_0xf271('0x5a')])?undefined:_0x207ecf[_0xf271('0x5a')],'AttachmentId':_0x207ecf['AttachmentId']},client9002);})[_0xf271('0x1e')](respondWithResult(_0x254810,0xc9))[_0xf271('0x28')](handleError(_0x254810,null));};exports['download']=function(_0x1cfb29,_0x53e29f){var _0x42a2b6=path[_0xf271('0x8c')](config[_0xf271('0x8d')],_0xf271('0x8e'),'files','attachments');return db[_0xf271('0x3b')][_0xf271('0x55')]({'where':{'id':_0x1cfb29['params']['id']},'include':[{'model':db[_0xf271('0x86')],'as':_0xf271('0x86')}]})[_0xf271('0x1e')](handleEntityNotFound(_0x53e29f,null))['then'](function(_0x318cfe){if(_0x318cfe){return _0x53e29f[_0xf271('0x8f')](path[_0xf271('0x8c')](_0x42a2b6,_0x318cfe['Attachment'][_0xf271('0x8b')]));}})['catch'](handleError(_0x53e29f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 59d0442..d5d7917 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 _0x39d2=['hasOwnProperty','hook','events','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x39d2,0xf5));var _0x239d=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x39d2[_0x3e32a8];return _0x2997b0;};'use strict';var EventEmitter=require(_0x239d('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x239d('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x239d('0x2')](0x0);var events={'afterCreate':_0x239d('0x3'),'afterUpdate':_0x239d('0x4'),'afterDestroy':_0x239d('0x5')};function emitEvent(_0x29b3f0){return function(_0x298c6e,_0x1f5943,_0x367278){FaxMessageEvents[_0x239d('0x6')](_0x29b3f0+':'+_0x298c6e['id'],_0x298c6e);FaxMessageEvents[_0x239d('0x6')](_0x29b3f0,_0x298c6e);_0x367278(null);};}for(var e in events){if(events[_0x239d('0x7')](e)){var event=events[e];FaxMessage[_0x239d('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x4fb4=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x4fb4,0x190));var _0x44fb=function(_0x16ae41,_0x590626){_0x16ae41=_0x16ae41-0x0;var _0x1112f0=_0x4fb4[_0x16ae41];return _0x1112f0;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x44fb('0x0'))['db'][_0x44fb('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x44fb('0x2')](0x0);var events={'afterCreate':_0x44fb('0x3'),'afterUpdate':_0x44fb('0x4'),'afterDestroy':_0x44fb('0x5')};function emitEvent(_0x53ee5d){return function(_0xec6dce,_0x953327,_0x308b96){FaxMessageEvents[_0x44fb('0x6')](_0x53ee5d+':'+_0xec6dce['id'],_0xec6dce);FaxMessageEvents[_0x44fb('0x6')](_0x53ee5d,_0xec6dce);_0x308b96(null);};}for(var e in events){if(events[_0x44fb('0x7')](e)){var event=events[e];FaxMessage[_0x44fb('0x8')](e,emitEvent(event));}}module[_0x44fb('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b97ea69..ce701eb 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 _0xec10=['UserId','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','out','secret'];(function(_0x3bae58,_0x2a9314){var _0x228c11=function(_0x299a13){while(--_0x299a13){_0x3bae58['push'](_0x3bae58['shift']());}};_0x228c11(++_0x2a9314);}(_0xec10,0x75));var _0x0ec1=function(_0x3f3f5a,_0x18a48c){_0x3f3f5a=_0x3f3f5a-0x0;var _0x300242=_0xec10[_0x3f3f5a];return _0x300242;};'use strict';var _=require(_0x0ec1('0x0'));var util=require(_0x0ec1('0x1'));var logger=require(_0x0ec1('0x2'))(_0x0ec1('0x3'));var moment=require(_0x0ec1('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ec1('0x5'));var fs=require('fs');var path=require(_0x0ec1('0x6'));var rimraf=require(_0x0ec1('0x7'));var config=require(_0x0ec1('0x8'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x28c5a4,_0x3ca7d4){return _0x28c5a4['define'](_0x0ec1('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x0ec1('0xa'),'fields':[_0x0ec1('0xb')],'type':_0x0ec1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x222af0,_0x20841b,_0x3cffb3){var _0x140c9f=_0x28c5a4[_0x0ec1('0xd')];var _0x3cf6c0=_0x222af0[_0x0ec1('0xe')]({'plain':!![]});if(_0x3cf6c0[_0x0ec1('0xf')]['toLowerCase']()==='in'||_0x3cf6c0[_0x0ec1('0xf')]['toLowerCase']()===_0x0ec1('0x10')&&!_0x3cf6c0[_0x0ec1('0x11')]&&!_['isNil'](_0x3cf6c0[_0x0ec1('0x12')])){_0x140c9f['FaxInteraction'][_0x0ec1('0x13')]({'where':{'id':_0x3cf6c0[_0x0ec1('0x14')]}})[_0x0ec1('0x15')](function(_0x3193b2){if(_0x3193b2){_0x3193b2[_0x0ec1('0x16')]({'lastMsgAt':_0x3cf6c0['createdAt'],'lastMsgDirection':_0x3cf6c0['direction']['toLowerCase']()});}})[_0x0ec1('0x17')](function(_0x5a7458){console[_0x0ec1('0x18')](_0x5a7458);});}_0x3cffb3();}},'charset':_0x0ec1('0x19'),'collate':_0x0ec1('0x1a')});}; \ No newline at end of file +var _0xa87f=['fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./faxMessage.attributes','exports','FaxMessage'];(function(_0x45d123,_0x3f7632){var _0x11fef3=function(_0x28bc8e){while(--_0x28bc8e){_0x45d123['push'](_0x45d123['shift']());}};_0x11fef3(++_0x3f7632);}(_0xa87f,0x1b1));var _0xfa87=function(_0x4243f7,_0x3e05be){_0x4243f7=_0x4243f7-0x0;var _0x1c89ae=_0xa87f[_0x4243f7];return _0x1c89ae;};'use strict';var _=require('lodash');var util=require(_0xfa87('0x0'));var logger=require(_0xfa87('0x1'))(_0xfa87('0x2'));var moment=require('moment');var BPromise=require(_0xfa87('0x3'));var rp=require(_0xfa87('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfa87('0x5'));var attributes=require(_0xfa87('0x6'));module[_0xfa87('0x7')]=function(_0x178bf8,_0x17510a){return _0x178bf8['define'](_0xfa87('0x8'),attributes,{'tableName':_0xfa87('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xfa87('0xa')],'type':_0xfa87('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57b9f6,_0x1ec2e2,_0xaf9cbb){var _0x116493=_0x178bf8['models'];var _0x58de66=_0x57b9f6[_0xfa87('0xc')]({'plain':!![]});if(_0x58de66[_0xfa87('0xd')][_0xfa87('0xe')]()==='in'||_0x58de66['direction'][_0xfa87('0xe')]()===_0xfa87('0xf')&&!_0x58de66[_0xfa87('0x10')]&&!_[_0xfa87('0x11')](_0x58de66[_0xfa87('0x12')])){_0x116493[_0xfa87('0x13')][_0xfa87('0x14')]({'where':{'id':_0x58de66[_0xfa87('0x15')]}})[_0xfa87('0x16')](function(_0x4d268d){if(_0x4d268d){_0x4d268d['update']({'lastMsgAt':_0x58de66[_0xfa87('0x17')],'lastMsgDirection':_0x58de66['direction']['toLowerCase']()});}})['catch'](function(_0x31907d){console['error'](_0x31907d);});}_0xaf9cbb();}},'charset':_0xfa87('0x18'),'collate':_0xfa87('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index d4299fc..95f1586 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 _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1e295f,_0x2c4be0){_0x1e295f=_0x1e295f-0x0;var _0x50a8ce=_0x6f0d[_0x1e295f];return _0x50a8ce;};'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});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file +var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xed1f,0x6a));var _0xfed1=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xed1f[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b91051f..37b9de6 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 _0x747e=['update','emit','removeListener','register','length','save'];(function(_0x2e6820,_0x52d4d9){var _0xb358b1=function(_0x304aa6){while(--_0x304aa6){_0x2e6820['push'](_0x2e6820['shift']());}};_0xb358b1(++_0x52d4d9);}(_0x747e,0x161));var _0xe747=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x747e[_0xbd08b4];return _0x314f1e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xe747('0x0'),'remove',_0xe747('0x1')];function createListener(_0x30f3ea,_0xf0736a){return function(_0x43c338){_0xf0736a[_0xe747('0x2')](_0x30f3ea,_0x43c338);};}function removeListener(_0x5b7df5,_0x1a8e84){return function(){FaxMessageEvents[_0xe747('0x3')](_0x5b7df5,_0x1a8e84);};}exports[_0xe747('0x4')]=function(_0x57e089){for(var _0x2c8143=0x0,_0x116396=events[_0xe747('0x5')];_0x2c8143<_0x116396;_0x2c8143++){var _0x55c050=events[_0x2c8143];var _0x54f65a=createListener('faxMessage:'+_0x55c050,_0x57e089);FaxMessageEvents['on'](_0x55c050,_0x54f65a);}}; \ No newline at end of file +var _0x765b=['faxMessage:','./faxMessage.events','save','remove','removeListener','register','length'];(function(_0x41a3e3,_0x8f880e){var _0x377596=function(_0x7bf3b1){while(--_0x7bf3b1){_0x41a3e3['push'](_0x41a3e3['shift']());}};_0x377596(++_0x8f880e);}(_0x765b,0xfd));var _0xb765=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x765b[_0x24fa1a];return _0xc5621f;};'use strict';var FaxMessageEvents=require(_0xb765('0x0'));var events=[_0xb765('0x1'),_0xb765('0x2'),'update'];function createListener(_0x37189d,_0x301d22){return function(_0x576517){_0x301d22['emit'](_0x37189d,_0x576517);};}function removeListener(_0x528532,_0x241885){return function(){FaxMessageEvents[_0xb765('0x3')](_0x528532,_0x241885);};}exports[_0xb765('0x4')]=function(_0x56720f){for(var _0x414916=0x0,_0x486106=events[_0xb765('0x5')];_0x414916<_0x486106;_0x414916++){var _0x199f3c=events[_0x414916];var _0x1f88ce=createListener(_0xb765('0x6')+_0x199f3c,_0x56720f);FaxMessageEvents['on'](_0x199f3c,_0x1f88ce);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index c879e9a..25d5472 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 _0x668b=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x668b,0x140));var _0xb668=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x668b[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xa')](_0xb668('0xf'),auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')]('/',auth['isAuthenticated'](),interaction[_0xb668('0x12')](_0xb668('0x13'),_0xb668('0x14')),controller[_0xb668('0x15')]);router[_0xb668('0x16')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x17')]);router[_0xb668('0x16')](_0xb668('0x18'),auth[_0xb668('0x8')](),controller[_0xb668('0x19')]);router[_0xb668('0x16')](_0xb668('0x1a'),auth[_0xb668('0x8')](),controller[_0xb668('0x1b')]);router[_0xb668('0x1c')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x1d')]);module[_0xb668('0x1e')]=router; \ No newline at end of file +var _0xb43b=['update','/:id/reject','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','create','put'];(function(_0x33759c,_0x12b87f){var _0x50df90=function(_0x27d0dc){while(--_0x27d0dc){_0x33759c['push'](_0x33759c['shift']());}};_0x50df90(++_0x12b87f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12e442,_0x42555c){_0x12e442=_0x12e442-0x0;var _0x4faaef=_0xb43b[_0x12e442];return _0x4faaef;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0xd')]('/:id/download',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')]('/',auth[_0xbb43('0xb')](),interaction[_0xbb43('0x12')](_0xbb43('0x13'),'faxmessage:create'),controller[_0xbb43('0x14')]);router[_0xbb43('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0x16')]);router['put']('/:id/accept',auth[_0xbb43('0xb')](),controller['accept']);router[_0xbb43('0x15')](_0xbb43('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller['destroy']);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 5b18434..e427053 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 _0xdf78=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x272b48,_0x72a3d7){var _0xafac03=function(_0x16a6b3){while(--_0x16a6b3){_0x272b48['push'](_0x272b48['shift']());}};_0xafac03(++_0x72a3d7);}(_0xdf78,0x143));var _0x8df7=function(_0x11bfb4,_0x4283ea){_0x11bfb4=_0x11bfb4-0x0;var _0x2ce785=_0xdf78[_0x11bfb4];return _0x2ce785;};'use strict';var Sequelize=require(_0x8df7('0x0'));module[_0x8df7('0x1')]={'name':{'type':Sequelize[_0x8df7('0x2')],'unique':_0x8df7('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8df7('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8df7('0x5')](_0x8df7('0x6'),'beepall',_0x8df7('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8df7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3832=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0x3832,0x9d));var _0x2383=function(_0x59259c,_0x46a459){_0x59259c=_0x59259c-0x0;var _0x3178b3=_0x3832[_0x59259c];return _0x3178b3;};'use strict';var Sequelize=require(_0x2383('0x0'));module[_0x2383('0x1')]={'name':{'type':Sequelize[_0x2383('0x2')],'unique':_0x2383('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2383('0x2')]},'timeout':{'type':Sequelize[_0x2383('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2383('0x5')](_0x2383('0x6'),'beepall',_0x2383('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2383('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index f2e861a..423d5a0 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 _0x669b=['sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxQueue.socket','status','end','json','offset','limit','undefined','count','apply','save','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','FaxQueue','fieldName','type','key','query','filters','intersection','model','length','attributes','order','sort','where','filter','merge','map','options','include','rows','catch','show','params','keys','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','rawAttributes','hasOwnProperty','nolimit','pick','FaxQueueId','UserFaxQueue','findAll','User','UserId','agent','updatedAt','format','%s/%s','SIP','faxPause','createdAt','getTeams','findOne','addTeams','ids','Team','online','flatMap','Agents'];(function(_0xcb2546,_0x140505){var _0x1c175d=function(_0xa3eed3){while(--_0xa3eed3){_0xcb2546['push'](_0xcb2546['shift']());}};_0x1c175d(++_0x140505);}(_0x669b,0x1c5));var _0xb669=function(_0x3e844c,_0x114926){_0x3e844c=_0x3e844c-0x0;var _0x349373=_0x669b[_0x3e844c];return _0x349373;};'use strict';var emlformat=require(_0xb669('0x0'));var rimraf=require(_0xb669('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb669('0x2'));var rp=require('request-promise');var moment=require(_0xb669('0x3'));var BPromise=require(_0xb669('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb669('0x5'));var sox=require(_0xb669('0x6'));var csv=require('to-csv');var ejs=require(_0xb669('0x7'));var fs=require('fs');var fs_extra=require(_0xb669('0x8'));var _=require(_0xb669('0x9'));var squel=require(_0xb669('0xa'));var crypto=require(_0xb669('0xb'));var jsforce=require(_0xb669('0xc'));var deskjs=require(_0xb669('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb669('0xe'));var Papa=require('papaparse');var Redis=require(_0xb669('0xf'));var authService=require(_0xb669('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb669('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb669('0x12'))('api');var utils=require(_0xb669('0x13'));var config=require(_0xb669('0x14'));var licenseUtil=require(_0xb669('0x15'));var db=require(_0xb669('0x16'))['db'];config['redis']=_[_0xb669('0x17')](config[_0xb669('0x18')],{'host':_0xb669('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb669('0x18')]));require(_0xb669('0x1a'))['register'](socket);function respondWithStatusCode(_0x328c70,_0x1b4381){_0x1b4381=_0x1b4381||0xcc;return function(_0x339bf1){if(_0x339bf1){return _0x328c70['sendStatus'](_0x1b4381);}return _0x328c70[_0xb669('0x1b')](_0x1b4381)[_0xb669('0x1c')]();};}function respondWithResult(_0x5982b8,_0x3df2cd){_0x3df2cd=_0x3df2cd||0xc8;return function(_0x3c0ca0){if(_0x3c0ca0){return _0x5982b8[_0xb669('0x1b')](_0x3df2cd)[_0xb669('0x1d')](_0x3c0ca0);}};}function respondWithFilteredResult(_0x34e025,_0x3adbef){return function(_0x19fe19){if(_0x19fe19){var _0xd13d83=typeof _0x3adbef[_0xb669('0x1e')]==='undefined'&&typeof _0x3adbef[_0xb669('0x1f')]===_0xb669('0x20');var _0x1a339a=_0x19fe19['count'];var _0x5e1f47=_0xd13d83?0x0:_0x3adbef[_0xb669('0x1e')];var _0x413945=_0xd13d83?_0x19fe19[_0xb669('0x21')]:_0x3adbef[_0xb669('0x1e')]+_0x3adbef[_0xb669('0x1f')];var _0x44328d;if(_0x413945>=_0x1a339a){_0x413945=_0x1a339a;_0x44328d=0xc8;}else{_0x44328d=0xce;}_0x34e025['status'](_0x44328d);return _0x34e025['set']('Content-Range',_0x5e1f47+'-'+_0x413945+'/'+_0x1a339a)['json'](_0x19fe19);}return null;};}function patchUpdates(_0x4983dc){return function(_0x385afd){try{jsonpatch[_0xb669('0x22')](_0x385afd,_0x4983dc,!![]);}catch(_0x13ea54){return BPromise['reject'](_0x13ea54);}return _0x385afd[_0xb669('0x23')]();};}function saveUpdates(_0x459abb,_0x2b3182){return function(_0x1d417f){if(_0x1d417f){return _0x1d417f['update'](_0x459abb)[_0xb669('0x24')](function(_0x233940){return _0x233940;});}return null;};}function removeEntity(_0x2a55b7,_0x26032d){return function(_0x2f4c5a){if(_0x2f4c5a){return _0x2f4c5a[_0xb669('0x25')]()[_0xb669('0x24')](function(){var _0x4523b9=_0x2f4c5a[_0xb669('0x26')]({'plain':!![]});var _0x390243=_0xb669('0x27');return db[_0xb669('0x28')][_0xb669('0x25')]({'where':{'type':_0x390243,'resourceId':_0x4523b9['id']}})[_0xb669('0x24')](function(){return _0x2f4c5a;});})[_0xb669('0x24')](function(){_0x2a55b7[_0xb669('0x1b')](0xcc)[_0xb669('0x1c')]();});}};}function handleEntityNotFound(_0x368dd6,_0x479c60){return function(_0x3d1bc1){if(!_0x3d1bc1){_0x368dd6[_0xb669('0x29')](0x194);}return _0x3d1bc1;};}function handleError(_0x169534,_0x4bffe2){_0x4bffe2=_0x4bffe2||0x1f4;return function(_0x532ac0){logger[_0xb669('0x2a')](_0x532ac0[_0xb669('0x2b')]);if(_0x532ac0[_0xb669('0x2c')]){delete _0x532ac0[_0xb669('0x2c')];}_0x169534[_0xb669('0x1b')](_0x4bffe2)[_0xb669('0x2d')](_0x532ac0);};}exports[_0xb669('0x2e')]=function(_0x63bd98,_0x220301){var _0x1d8558={},_0xb9830b={},_0x3a7ac9={'count':0x0,'rows':[]};var _0x1472b3=_['map'](db[_0xb669('0x2f')]['rawAttributes'],function(_0x2e2b9f){return{'name':_0x2e2b9f[_0xb669('0x30')],'type':_0x2e2b9f[_0xb669('0x31')][_0xb669('0x32')]};});_0xb9830b['model']=_['map'](_0x1472b3,_0xb669('0x2c'));_0xb9830b['query']=_['keys'](_0x63bd98[_0xb669('0x33')]);_0xb9830b[_0xb669('0x34')]=_[_0xb669('0x35')](_0xb9830b[_0xb669('0x36')],_0xb9830b['query']);_0x1d8558['attributes']=_['intersection'](_0xb9830b[_0xb669('0x36')],qs['fields'](_0x63bd98[_0xb669('0x33')]['fields']));_0x1d8558['attributes']=_0x1d8558['attributes'][_0xb669('0x37')]?_0x1d8558[_0xb669('0x38')]:_0xb9830b['model'];if(!_0x63bd98[_0xb669('0x33')]['hasOwnProperty']('nolimit')){_0x1d8558[_0xb669('0x1f')]=qs[_0xb669('0x1f')](_0x63bd98['query'][_0xb669('0x1f')]);_0x1d8558[_0xb669('0x1e')]=qs[_0xb669('0x1e')](_0x63bd98[_0xb669('0x33')][_0xb669('0x1e')]);}_0x1d8558[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0x63bd98['query']['sort']);_0x1d8558[_0xb669('0x3b')]=qs[_0xb669('0x34')](_['pick'](_0x63bd98[_0xb669('0x33')],_0xb9830b[_0xb669('0x34')]),_0x1472b3);if(_0x63bd98[_0xb669('0x33')][_0xb669('0x3c')]){_0x1d8558[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0x1d8558[_0xb669('0x3b')],{'$or':_[_0xb669('0x3e')](_0x1472b3,function(_0x4bab47){if(_0x4bab47[_0xb669('0x31')]!=='VIRTUAL'){var _0x5d4c29={};_0x5d4c29[_0x4bab47[_0xb669('0x2c')]]={'$like':'%'+_0x63bd98['query'][_0xb669('0x3c')]+'%'};return _0x5d4c29;}})});}_0x1d8558=_[_0xb669('0x3d')]({},_0x1d8558,_0x63bd98[_0xb669('0x3f')]);var _0x40827d={'where':_0x1d8558[_0xb669('0x3b')]};return db[_0xb669('0x2f')][_0xb669('0x21')](_0x40827d)[_0xb669('0x24')](function(_0x48a958){_0x3a7ac9[_0xb669('0x21')]=_0x48a958;if(_0x63bd98[_0xb669('0x33')]['includeAll']){_0x1d8558[_0xb669('0x40')]=[{'all':!![]}];}return db[_0xb669('0x2f')]['findAll'](_0x1d8558);})[_0xb669('0x24')](function(_0x45c451){_0x3a7ac9[_0xb669('0x41')]=_0x45c451;return _0x3a7ac9;})[_0xb669('0x24')](respondWithFilteredResult(_0x220301,_0x1d8558))[_0xb669('0x42')](handleError(_0x220301,null));};exports[_0xb669('0x43')]=function(_0x5b1f7d,_0xd9cdf7){var _0x4bcbe2={'raw':!![],'where':{'id':_0x5b1f7d[_0xb669('0x44')]['id']}},_0x23ade8={};_0x23ade8[_0xb669('0x36')]=_[_0xb669('0x45')](db['FaxQueue']['rawAttributes']);_0x23ade8['query']=_['keys'](_0x5b1f7d['query']);_0x23ade8[_0xb669('0x34')]=_[_0xb669('0x35')](_0x23ade8[_0xb669('0x36')],_0x23ade8[_0xb669('0x33')]);_0x4bcbe2[_0xb669('0x38')]=_[_0xb669('0x35')](_0x23ade8[_0xb669('0x36')],qs[_0xb669('0x46')](_0x5b1f7d[_0xb669('0x33')]['fields']));_0x4bcbe2[_0xb669('0x38')]=_0x4bcbe2[_0xb669('0x38')]['length']?_0x4bcbe2[_0xb669('0x38')]:_0x23ade8[_0xb669('0x36')];if(_0x5b1f7d['query'][_0xb669('0x47')]){_0x4bcbe2[_0xb669('0x40')]=[{'all':!![]}];}_0x4bcbe2=_[_0xb669('0x3d')]({},_0x4bcbe2,_0x5b1f7d[_0xb669('0x3f')]);return db[_0xb669('0x2f')]['find'](_0x4bcbe2)['then'](handleEntityNotFound(_0xd9cdf7,null))[_0xb669('0x24')](respondWithResult(_0xd9cdf7,null))[_0xb669('0x42')](handleError(_0xd9cdf7,null));};exports['create']=function(_0x4fa5c6,_0x17b8a0){return db['FaxQueue'][_0xb669('0x48')](_0x4fa5c6[_0xb669('0x49')],{})[_0xb669('0x24')](function(_0x57958f){var _0x301f23=_0x4fa5c6[_0xb669('0x4a')][_0xb669('0x26')]({'plain':!![]});if(!_0x301f23)throw new Error(_0xb669('0x4b'));if(_0x301f23[_0xb669('0x4c')]===_0xb669('0x4a')){var _0xe4ee08=_0x57958f[_0xb669('0x26')]({'plain':!![]});var _0x5b2421='FaxQueues';return db[_0xb669('0x4d')][_0xb669('0x4e')]({'where':{'name':_0x5b2421,'userProfileId':_0x301f23[_0xb669('0x4f')]},'raw':!![]})[_0xb669('0x24')](function(_0x5e7ffc){if(_0x5e7ffc&&_0x5e7ffc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe4ee08[_0xb669('0x2c')],'resourceId':_0xe4ee08['id'],'type':_0x5e7ffc['name'],'sectionId':_0x5e7ffc['id']},{})[_0xb669('0x24')](function(){return _0x57958f;});}else{return _0x57958f;}})[_0xb669('0x42')](function(_0xa7e35a){logger[_0xb669('0x2a')](_0xb669('0x50'),_0xa7e35a);throw _0xa7e35a;});}return _0x57958f;})[_0xb669('0x24')](respondWithResult(_0x17b8a0,0xc9))[_0xb669('0x42')](handleError(_0x17b8a0,null));};exports[_0xb669('0x51')]=function(_0x3cc24a,_0x6336aa){if(_0x3cc24a[_0xb669('0x49')]['id']){delete _0x3cc24a['body']['id'];}return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0x3cc24a[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x6336aa,null))[_0xb669('0x24')](saveUpdates(_0x3cc24a['body'],null))[_0xb669('0x24')](respondWithResult(_0x6336aa,null))['catch'](handleError(_0x6336aa,null));};exports[_0xb669('0x25')]=function(_0x107550,_0x1584d9){return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0x107550[_0xb669('0x44')]['id']}})['then'](handleEntityNotFound(_0x1584d9,null))['then'](removeEntity(_0x1584d9,null))[_0xb669('0x42')](handleError(_0x1584d9,null));};exports['describe']=function(_0x5dc0d4,_0x3a9525){return db['FaxQueue']['describe']()[_0xb669('0x24')](respondWithResult(_0x3a9525,null))[_0xb669('0x42')](handleError(_0x3a9525,null));};exports[_0xb669('0x52')]=function(_0xbf75f5,_0x56f6e8,_0x279c23){var _0x1842b0={'raw':!![],'where':{}},_0x17fe0a={},_0x4c3280;return db[_0xb669('0x2f')]['findOne']({'where':{'id':_0xbf75f5['params']['id']}})['then'](handleEntityNotFound(_0x56f6e8,null))[_0xb669('0x24')](function(_0x4a6dd1){if(_0x4a6dd1){_0x4c3280=_0x4a6dd1['get']({'plain':!![]});_0x17fe0a[_0xb669('0x36')]=_[_0xb669('0x45')](db['UserFaxQueue'][_0xb669('0x53')]);_0x17fe0a[_0xb669('0x33')]=_[_0xb669('0x45')](_0xbf75f5[_0xb669('0x33')]);_0x17fe0a[_0xb669('0x34')]=_[_0xb669('0x35')](_0x17fe0a['model'],_0x17fe0a[_0xb669('0x33')]);_0x1842b0[_0xb669('0x38')]=_['intersection'](_0x17fe0a[_0xb669('0x36')],qs['fields'](_0xbf75f5[_0xb669('0x33')][_0xb669('0x46')]));_0x1842b0[_0xb669('0x38')]=_0x1842b0[_0xb669('0x38')][_0xb669('0x37')]?_0x1842b0[_0xb669('0x38')]:_0x17fe0a['model'];if(!_0xbf75f5['query'][_0xb669('0x54')](_0xb669('0x55'))){_0x1842b0[_0xb669('0x1f')]=qs['limit'](_0xbf75f5[_0xb669('0x33')]['limit']);_0x1842b0[_0xb669('0x1e')]=qs['offset'](_0xbf75f5[_0xb669('0x33')][_0xb669('0x1e')]);}_0x1842b0[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0xbf75f5[_0xb669('0x33')][_0xb669('0x3a')]);_0x1842b0[_0xb669('0x3b')]=qs[_0xb669('0x34')](_[_0xb669('0x56')](_0xbf75f5[_0xb669('0x33')],_0x17fe0a[_0xb669('0x34')]));_0x1842b0[_0xb669('0x3b')][_0xb669('0x57')]=_0x4a6dd1['id'];if(_0xbf75f5[_0xb669('0x33')][_0xb669('0x3c')]){_0x1842b0[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0x1842b0[_0xb669('0x3b')],{'$or':_[_0xb669('0x3e')](_0x1842b0[_0xb669('0x38')],function(_0x3a908e){var _0x317156={};_0x317156[_0x3a908e]={'$like':'%'+_0xbf75f5[_0xb669('0x33')][_0xb669('0x3c')]+'%'};return _0x317156;})});}_0x1842b0=_[_0xb669('0x3d')]({},_0x1842b0,_0xbf75f5[_0xb669('0x3f')]);return db[_0xb669('0x58')][_0xb669('0x59')](_0x1842b0);}})['then'](function(_0x1b2c22){if(_0x1b2c22){return db[_0xb669('0x5a')]['findAndCountAll']({'where':{'id':_[_0xb669('0x3e')](_0x1b2c22,_0xb669('0x5b')),'role':_0xb669('0x5c')},'attributes':['id',_0xb669('0x2c'),'faxPause',_0xb669('0x5d'),'createdAt']});}})['then'](function(_0x5cd3c8){if(_0x5cd3c8){return{'count':_0x5cd3c8[_0xb669('0x21')],'rows':_[_0xb669('0x3e')](_0x5cd3c8[_0xb669('0x41')],function(_0xab5cc3){return{'membername':_0xab5cc3[_0xb669('0x2c')],'UserId':_0xab5cc3['id'],'queue_name':_0x4c3280['name'],'FaxQueueId':_0x4c3280['id'],'interface':util[_0xb669('0x5e')](_0xb669('0x5f'),_0xb669('0x60'),_0xab5cc3[_0xb669('0x2c')]),'penalty':0x0,'paused':_0xab5cc3[_0xb669('0x61')],'createdAt':_0xab5cc3[_0xb669('0x62')],'updatedAt':_0xab5cc3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb669('0x24')](respondWithFilteredResult(_0x56f6e8,_0x1842b0))[_0xb669('0x42')](handleError(_0x56f6e8,null));};exports[_0xb669('0x63')]=function(_0x16eaa7,_0x56dfde,_0x417cad){var _0xc780f8={};var _0xce0401={};var _0x5bcae4;var _0x2efe0b;return db[_0xb669('0x2f')][_0xb669('0x64')]({'where':{'id':_0x16eaa7[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x56dfde,null))[_0xb669('0x24')](function(_0x5dfe93){if(_0x5dfe93){_0x5bcae4=_0x5dfe93;_0xce0401['model']=_['keys'](db['Team']['rawAttributes']);_0xce0401[_0xb669('0x33')]=_[_0xb669('0x45')](_0x16eaa7[_0xb669('0x33')]);_0xce0401['filters']=_[_0xb669('0x35')](_0xce0401['model'],_0xce0401[_0xb669('0x33')]);_0xc780f8[_0xb669('0x38')]=_[_0xb669('0x35')](_0xce0401[_0xb669('0x36')],qs[_0xb669('0x46')](_0x16eaa7[_0xb669('0x33')][_0xb669('0x46')]));_0xc780f8[_0xb669('0x38')]=_0xc780f8['attributes']['length']?_0xc780f8['attributes']:_0xce0401[_0xb669('0x36')];_0xc780f8[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0x16eaa7[_0xb669('0x33')][_0xb669('0x3a')]);_0xc780f8['where']=qs[_0xb669('0x34')](_[_0xb669('0x56')](_0x16eaa7[_0xb669('0x33')],_0xce0401[_0xb669('0x34')]));if(_0x16eaa7[_0xb669('0x33')][_0xb669('0x3c')]){_0xc780f8[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0xc780f8[_0xb669('0x3b')],{'$or':_[_0xb669('0x3e')](_0xc780f8['attributes'],function(_0x5e13ad){var _0x10c8e1={};_0x10c8e1[_0x5e13ad]={'$like':'%'+_0x16eaa7[_0xb669('0x33')][_0xb669('0x3c')]+'%'};return _0x10c8e1;})});}_0xc780f8=_[_0xb669('0x3d')]({},_0xc780f8,_0x16eaa7[_0xb669('0x3f')]);return _0x5bcae4['getTeams'](_0xc780f8);}})['then'](function(_0x545177){if(_0x545177){_0x2efe0b=_0x545177[_0xb669('0x37')];if(!_0x16eaa7[_0xb669('0x33')][_0xb669('0x54')](_0xb669('0x55'))){_0xc780f8[_0xb669('0x1f')]=qs[_0xb669('0x1f')](_0x16eaa7[_0xb669('0x33')][_0xb669('0x1f')]);_0xc780f8[_0xb669('0x1e')]=qs[_0xb669('0x1e')](_0x16eaa7['query'][_0xb669('0x1e')]);}return _0x5bcae4[_0xb669('0x63')](_0xc780f8);}})[_0xb669('0x24')](function(_0x41ff2d){if(_0x41ff2d){return _0x41ff2d?{'count':_0x2efe0b,'rows':_0x41ff2d}:null;}})[_0xb669('0x24')](respondWithResult(_0x56dfde,null))[_0xb669('0x42')](handleError(_0x56dfde,null));};exports[_0xb669('0x65')]=function(_0x599605,_0x203616,_0x212f3e){var _0x42b613=_0x599605[_0xb669('0x49')][_0xb669('0x66')];return db[_0xb669('0x67')][_0xb669('0x59')]({'where':{'id':_0x42b613},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb669('0x2c'),_0xb669('0x68'),'voicePause','interface'],'raw':!![]}]})[_0xb669('0x24')](function(_0x20940d){if(_0x20940d){var _0x39f249=_[_0xb669('0x69')](_0x20940d,function(_0x482aad){var _0x193d2d=_0x482aad['get']({'plain':!![]});return _0x193d2d[_0xb669('0x6a')];});return db['FaxQueue']['find']({'where':{'id':_0x599605['params']['id']}})[_0xb669('0x24')](function(_0x58b40b){return db[_0xb669('0x6b')][_0xb669('0x6c')](function(_0x20ece8){return _0x58b40b['addTeams'](_0x42b613,{'transaction':_0x20ece8})[_0xb669('0x24')](function(){return BPromise[_0xb669('0x6d')](_0x39f249,function(_0x46c637){return db['UserFaxQueue'][_0xb669('0x6e')]({'where':{'UserId':_0x46c637['id'],'FaxQueueId':_0x599605['params']['id']},'transaction':_0x20ece8});});})[_0xb669('0x24')](function(){_0x39f249[_0xb669('0x6f')](function(_0x3f7104){socket[_0xb669('0x70')](_0xb669('0x71'),{'UserId':_0x3f7104['id'],'FaxQueueId':_0x58b40b['id']});});});});});}})[_0xb669('0x24')](respondWithStatusCode(_0x203616,null))[_0xb669('0x42')](handleError(_0x203616,null));};exports[_0xb669('0x72')]=function(_0xfde88d,_0x1bf803,_0x2d76ad){return db[_0xb669('0x67')][_0xb669('0x59')]({'where':{'id':_0xfde88d[_0xb669('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb669('0x5a')],'as':_0xb669('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xb669('0x24')](handleEntityNotFound(_0x1bf803,null))[_0xb669('0x24')](function(_0x293388){var _0x484b08=_[_0xb669('0x3e')](_0x293388,'id');var _0x298d81=[];var _0x8d7e53=[];var _0x5bdddc=squel[_0xb669('0x73')]();_0x5bdddc[_0xb669('0x74')]('tq.TeamId')['from'](_0xb669('0x75'),'tq')[_0xb669('0x76')](_0xb669('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb669('0x3b')](_0xb669('0x78'),_0xfde88d[_0xb669('0x44')]['id']);for(var _0x3ac0a9=0x0;_0x3ac0a9<_0x293388[_0xb669('0x37')];_0x3ac0a9+=0x1){let _0x2f82bb=_0x293388[_0x3ac0a9];for(var _0x280d62=0x0;_0x280d62<_0x2f82bb['Agents'][_0xb669('0x37')];_0x280d62+=0x1){let _0x52a616=_0x2f82bb[_0xb669('0x6a')][_0x280d62];var _0x3e93e7=_0x5bdddc[_0xb669('0x79')]();_0x3e93e7[_0xb669('0x3b')](_0xb669('0x7a'),_0x52a616['id']);_0x8d7e53[_0xb669('0x7b')](db['sequelize'][_0xb669('0x33')](_0x3e93e7[_0xb669('0x7c')](),{'type':db['sequelize'][_0xb669('0x7d')]['SELECT']})[_0xb669('0x24')](function(_0x30cd42){if(_0x30cd42[_0xb669('0x37')]===0x1){return _0x52a616['id'];}else{var _0x320449=_[_0xb669('0x7e')](_[_0xb669('0x3e')](_0x30cd42,_0xb669('0x7f')),function(_0x2fea8a){return _[_0xb669('0x80')](_0x484b08,_0x2fea8a);});if(_0x320449){return _0x52a616['id'];}}}));}}return BPromise[_0xb669('0x81')](_0x8d7e53)[_0xb669('0x24')](function(_0x33bde1){_0x298d81=_(_0x298d81)['union'](_0x33bde1)[_0xb669('0x82')]()[_0xb669('0x83')]();return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0xfde88d['params']['id']}})['then'](function(_0x23706b){return db[_0xb669('0x6b')][_0xb669('0x6c')](function(_0x2979f7){return _0x23706b['removeTeams'](_0xfde88d[_0xb669('0x33')][_0xb669('0x66')],{'transaction':_0x2979f7})[_0xb669('0x24')](function(){if(!_[_0xb669('0x84')](_0x298d81)){return _0x23706b[_0xb669('0x85')](_0x298d81,{'transaction':_0x2979f7});}})[_0xb669('0x24')](function(){_0x298d81['forEach'](function(_0x31e3c0){socket[_0xb669('0x70')](_0xb669('0x86'),{'UserId':_0x31e3c0,'FaxQueueId':_0x23706b['id']});});});});});});})[_0xb669('0x24')](respondWithStatusCode(_0x1bf803,null))[_0xb669('0x42')](handleError(_0x1bf803,null));};exports[_0xb669('0x87')]=function(_0x35a95a,_0x3a4557,_0xf13c61){return db[_0xb669('0x2f')]['find']({'where':{'id':_0x35a95a[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x3a4557,null))[_0xb669('0x24')](function(_0x49b0bc){if(_0x49b0bc){return _0x49b0bc[_0xb669('0x87')](_0x35a95a[_0xb669('0x49')][_0xb669('0x66')],_[_0xb669('0x88')](_0x35a95a['body'],[_0xb669('0x66'),'id'])||{})[_0xb669('0x89')](function(_0x4d0984){for(var _0x111a81=0x0;_0x111a81<_0x35a95a[_0xb669('0x49')][_0xb669('0x66')]['length'];_0x111a81+=0x1){socket['emit'](_0xb669('0x71'),{'UserId':Number(_0x35a95a['body'][_0xb669('0x66')][_0x111a81]),'FaxQueueId':Number(_0x35a95a[_0xb669('0x44')]['id'])});}return _0x4d0984;});}})[_0xb669('0x24')](respondWithResult(_0x3a4557,null))['catch'](handleError(_0x3a4557,null));};exports[_0xb669('0x85')]=function(_0x4243c5,_0xd3eead,_0x27a64e){return db[_0xb669('0x2f')][_0xb669('0x4e')]({'where':{'id':_0x4243c5[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0xd3eead,null))[_0xb669('0x24')](function(_0x24206f){if(_0x24206f){return _0x24206f[_0xb669('0x85')](_0x4243c5[_0xb669('0x33')][_0xb669('0x66')])['then'](function(){if(_[_0xb669('0x8a')](_0x4243c5[_0xb669('0x33')][_0xb669('0x66')])){for(var _0x7291d8=0x0;_0x7291d8<_0x4243c5[_0xb669('0x33')][_0xb669('0x66')][_0xb669('0x37')];_0x7291d8+=0x1){socket['emit'](_0xb669('0x86'),{'UserId':Number(_0x4243c5[_0xb669('0x33')][_0xb669('0x66')][_0x7291d8]),'FaxQueueId':Number(_0x4243c5['params']['id'])});}}else{socket[_0xb669('0x70')](_0xb669('0x86'),{'UserId':Number(_0x4243c5['query'][_0xb669('0x66')]),'FaxQueueId':Number(_0x4243c5[_0xb669('0x44')]['id'])});}});}})[_0xb669('0x24')](respondWithStatusCode(_0xd3eead,null))['catch'](handleError(_0xd3eead,null));};exports[_0xb669('0x8b')]=function(_0x435cef,_0x2b0244,_0x136e97){var _0x1a7a93={};var _0x2b7521={};var _0x44a003;var _0x5b8721;return db[_0xb669('0x2f')][_0xb669('0x64')]({'where':{'id':_0x435cef[_0xb669('0x44')]['id']}})[_0xb669('0x24')](handleEntityNotFound(_0x2b0244,null))[_0xb669('0x24')](function(_0x5a18b1){if(_0x5a18b1){_0x44a003=_0x5a18b1;_0x2b7521[_0xb669('0x36')]=_[_0xb669('0x45')](db[_0xb669('0x5a')]['rawAttributes']);_0x2b7521[_0xb669('0x33')]=_[_0xb669('0x45')](_0x435cef[_0xb669('0x33')]);_0x2b7521[_0xb669('0x34')]=_[_0xb669('0x35')](_0x2b7521[_0xb669('0x36')],_0x2b7521[_0xb669('0x33')]);_0x1a7a93['attributes']=_[_0xb669('0x35')](_0x2b7521[_0xb669('0x36')],qs[_0xb669('0x46')](_0x435cef[_0xb669('0x33')]['fields']));_0x1a7a93[_0xb669('0x38')]=_0x1a7a93['attributes'][_0xb669('0x37')]?_0x1a7a93[_0xb669('0x38')]:_0x2b7521['model'];_0x1a7a93[_0xb669('0x39')]=qs[_0xb669('0x3a')](_0x435cef[_0xb669('0x33')][_0xb669('0x3a')]);_0x1a7a93[_0xb669('0x3b')]=qs[_0xb669('0x34')](_[_0xb669('0x56')](_0x435cef[_0xb669('0x33')],_0x2b7521[_0xb669('0x34')]));if(_0x435cef['query'][_0xb669('0x3c')]){_0x1a7a93[_0xb669('0x3b')]=_[_0xb669('0x3d')](_0x1a7a93[_0xb669('0x3b')],{'$or':_['map'](_0x1a7a93[_0xb669('0x38')],function(_0x28425d){var _0x270588={};_0x270588[_0x28425d]={'$like':'%'+_0x435cef[_0xb669('0x33')][_0xb669('0x3c')]+'%'};return _0x270588;})});}_0x1a7a93=_[_0xb669('0x3d')]({},_0x1a7a93,_0x435cef[_0xb669('0x3f')]);return _0x44a003[_0xb669('0x8b')](_0x1a7a93);}})['then'](function(_0x4e52f8){if(_0x4e52f8){_0x5b8721=_0x4e52f8[_0xb669('0x37')];if(!_0x435cef[_0xb669('0x33')][_0xb669('0x54')]('nolimit')){_0x1a7a93[_0xb669('0x1f')]=qs['limit'](_0x435cef[_0xb669('0x33')][_0xb669('0x1f')]);_0x1a7a93[_0xb669('0x1e')]=qs[_0xb669('0x1e')](_0x435cef[_0xb669('0x33')]['offset']);}return _0x44a003[_0xb669('0x8b')](_0x1a7a93);}})['then'](function(_0x5b32d8){if(_0x5b32d8){return _0x5b32d8?{'count':_0x5b8721,'rows':_0x5b32d8}:null;}})['then'](respondWithResult(_0x2b0244,null))[_0xb669('0x42')](handleError(_0x2b0244,null));}; \ No newline at end of file +var _0x9f11=['attributes','hasOwnProperty','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','nolimit','order','pick','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','interface','flatMap','transaction','UserFaxQueue','findOrCreate','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','get','UserProfileResource','destroy','end','error','name','send','map','FaxQueue','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0xbf607b,_0x403437){var _0x4153f1=function(_0x5f0a97){while(--_0x5f0a97){_0xbf607b['push'](_0xbf607b['shift']());}};_0x4153f1(++_0x403437);}(_0x9f11,0x16b));var _0x19f1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f11[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x19f1('0x0'));var rimraf=require(_0x19f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x19f1('0x2'));var rp=require(_0x19f1('0x3'));var moment=require(_0x19f1('0x4'));var BPromise=require(_0x19f1('0x5'));var Mustache=require(_0x19f1('0x6'));var util=require(_0x19f1('0x7'));var path=require(_0x19f1('0x8'));var sox=require(_0x19f1('0x9'));var csv=require(_0x19f1('0xa'));var ejs=require(_0x19f1('0xb'));var fs=require('fs');var fs_extra=require(_0x19f1('0xc'));var _=require(_0x19f1('0xd'));var squel=require(_0x19f1('0xe'));var crypto=require(_0x19f1('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x19f1('0xa'));var querystring=require(_0x19f1('0x10'));var Papa=require(_0x19f1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19f1('0x12'));var as=require(_0x19f1('0x13'));var hardwareService=require(_0x19f1('0x14'));var logger=require(_0x19f1('0x15'))(_0x19f1('0x16'));var utils=require(_0x19f1('0x17'));var config=require(_0x19f1('0x18'));var licenseUtil=require(_0x19f1('0x19'));var db=require(_0x19f1('0x1a'))['db'];config['redis']=_[_0x19f1('0x1b')](config['redis'],{'host':_0x19f1('0x1c'),'port':0x18eb});var socket=require(_0x19f1('0x1d'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x19f1('0x1e')](socket);function respondWithStatusCode(_0x519fc3,_0x51c63e){_0x51c63e=_0x51c63e||0xcc;return function(_0x2ae89b){if(_0x2ae89b){return _0x519fc3[_0x19f1('0x1f')](_0x51c63e);}return _0x519fc3[_0x19f1('0x20')](_0x51c63e)['end']();};}function respondWithResult(_0x3e6fcd,_0x3109b3){_0x3109b3=_0x3109b3||0xc8;return function(_0x541462){if(_0x541462){return _0x3e6fcd['status'](_0x3109b3)['json'](_0x541462);}};}function respondWithFilteredResult(_0x260883,_0x3d9d5a){return function(_0x53f11b){if(_0x53f11b){var _0x158905=typeof _0x3d9d5a[_0x19f1('0x21')]===_0x19f1('0x22')&&typeof _0x3d9d5a[_0x19f1('0x23')]===_0x19f1('0x22');var _0x2228d4=_0x53f11b[_0x19f1('0x24')];var _0x2d2dcd=_0x158905?0x0:_0x3d9d5a['offset'];var _0x56804f=_0x158905?_0x53f11b[_0x19f1('0x24')]:_0x3d9d5a['offset']+_0x3d9d5a[_0x19f1('0x23')];var _0x5de2fd;if(_0x56804f>=_0x2228d4){_0x56804f=_0x2228d4;_0x5de2fd=0xc8;}else{_0x5de2fd=0xce;}_0x260883['status'](_0x5de2fd);return _0x260883[_0x19f1('0x25')](_0x19f1('0x26'),_0x2d2dcd+'-'+_0x56804f+'/'+_0x2228d4)[_0x19f1('0x27')](_0x53f11b);}return null;};}function patchUpdates(_0x728c){return function(_0x529613){try{jsonpatch[_0x19f1('0x28')](_0x529613,_0x728c,!![]);}catch(_0x1d6eef){return BPromise[_0x19f1('0x29')](_0x1d6eef);}return _0x529613['save']();};}function saveUpdates(_0x2b2e43,_0x55a200){return function(_0x4c63f0){if(_0x4c63f0){return _0x4c63f0['update'](_0x2b2e43)[_0x19f1('0x2a')](function(_0x366cc4){return _0x366cc4;});}return null;};}function removeEntity(_0x328d13,_0x56cfce){return function(_0x264bf4){if(_0x264bf4){return _0x264bf4['destroy']()[_0x19f1('0x2a')](function(){var _0x188006=_0x264bf4[_0x19f1('0x2b')]({'plain':!![]});var _0x2c656d='FaxQueues';return db[_0x19f1('0x2c')][_0x19f1('0x2d')]({'where':{'type':_0x2c656d,'resourceId':_0x188006['id']}})[_0x19f1('0x2a')](function(){return _0x264bf4;});})[_0x19f1('0x2a')](function(){_0x328d13[_0x19f1('0x20')](0xcc)[_0x19f1('0x2e')]();});}};}function handleEntityNotFound(_0x19d2ca,_0x4bd1cb){return function(_0x1b22bf){if(!_0x1b22bf){_0x19d2ca['sendStatus'](0x194);}return _0x1b22bf;};}function handleError(_0x51f947,_0x2110db){_0x2110db=_0x2110db||0x1f4;return function(_0x4fcf96){logger[_0x19f1('0x2f')](_0x4fcf96['stack']);if(_0x4fcf96[_0x19f1('0x30')]){delete _0x4fcf96[_0x19f1('0x30')];}_0x51f947['status'](_0x2110db)[_0x19f1('0x31')](_0x4fcf96);};}exports['index']=function(_0x443677,_0x4b9768){var _0x8a782={},_0x47d4c0={},_0xec2cbb={'count':0x0,'rows':[]};var _0x3b19ff=_[_0x19f1('0x32')](db[_0x19f1('0x33')][_0x19f1('0x34')],function(_0x276739){return{'name':_0x276739['fieldName'],'type':_0x276739[_0x19f1('0x35')][_0x19f1('0x36')]};});_0x47d4c0[_0x19f1('0x37')]=_[_0x19f1('0x32')](_0x3b19ff,'name');_0x47d4c0[_0x19f1('0x38')]=_[_0x19f1('0x39')](_0x443677['query']);_0x47d4c0[_0x19f1('0x3a')]=_[_0x19f1('0x3b')](_0x47d4c0[_0x19f1('0x37')],_0x47d4c0[_0x19f1('0x38')]);_0x8a782[_0x19f1('0x3c')]=_['intersection'](_0x47d4c0[_0x19f1('0x37')],qs['fields'](_0x443677['query']['fields']));_0x8a782[_0x19f1('0x3c')]=_0x8a782[_0x19f1('0x3c')]['length']?_0x8a782['attributes']:_0x47d4c0['model'];if(!_0x443677['query'][_0x19f1('0x3d')]('nolimit')){_0x8a782[_0x19f1('0x23')]=qs[_0x19f1('0x23')](_0x443677[_0x19f1('0x38')][_0x19f1('0x23')]);_0x8a782[_0x19f1('0x21')]=qs[_0x19f1('0x21')](_0x443677['query'][_0x19f1('0x21')]);}_0x8a782['order']=qs[_0x19f1('0x3e')](_0x443677[_0x19f1('0x38')]['sort']);_0x8a782['where']=qs[_0x19f1('0x3a')](_['pick'](_0x443677[_0x19f1('0x38')],_0x47d4c0['filters']),_0x3b19ff);if(_0x443677[_0x19f1('0x38')][_0x19f1('0x3f')]){_0x8a782['where']=_[_0x19f1('0x40')](_0x8a782[_0x19f1('0x41')],{'$or':_[_0x19f1('0x32')](_0x3b19ff,function(_0x4536d2){if(_0x4536d2[_0x19f1('0x35')]!=='VIRTUAL'){var _0x147a04={};_0x147a04[_0x4536d2['name']]={'$like':'%'+_0x443677[_0x19f1('0x38')][_0x19f1('0x3f')]+'%'};return _0x147a04;}})});}_0x8a782=_[_0x19f1('0x40')]({},_0x8a782,_0x443677[_0x19f1('0x42')]);var _0x5c1ebf={'where':_0x8a782['where']};return db['FaxQueue']['count'](_0x5c1ebf)['then'](function(_0x2348be){_0xec2cbb[_0x19f1('0x24')]=_0x2348be;if(_0x443677[_0x19f1('0x38')][_0x19f1('0x43')]){_0x8a782[_0x19f1('0x44')]=[{'all':!![]}];}return db[_0x19f1('0x33')][_0x19f1('0x45')](_0x8a782);})[_0x19f1('0x2a')](function(_0x32eeb8){_0xec2cbb[_0x19f1('0x46')]=_0x32eeb8;return _0xec2cbb;})[_0x19f1('0x2a')](respondWithFilteredResult(_0x4b9768,_0x8a782))[_0x19f1('0x47')](handleError(_0x4b9768,null));};exports[_0x19f1('0x48')]=function(_0x4017d9,_0x5721ea){var _0x215849={'raw':!![],'where':{'id':_0x4017d9[_0x19f1('0x49')]['id']}},_0x5c4de1={};_0x5c4de1[_0x19f1('0x37')]=_['keys'](db['FaxQueue'][_0x19f1('0x34')]);_0x5c4de1[_0x19f1('0x38')]=_[_0x19f1('0x39')](_0x4017d9[_0x19f1('0x38')]);_0x5c4de1[_0x19f1('0x3a')]=_['intersection'](_0x5c4de1['model'],_0x5c4de1[_0x19f1('0x38')]);_0x215849[_0x19f1('0x3c')]=_[_0x19f1('0x3b')](_0x5c4de1[_0x19f1('0x37')],qs[_0x19f1('0x4a')](_0x4017d9['query'][_0x19f1('0x4a')]));_0x215849[_0x19f1('0x3c')]=_0x215849['attributes'][_0x19f1('0x4b')]?_0x215849[_0x19f1('0x3c')]:_0x5c4de1[_0x19f1('0x37')];if(_0x4017d9['query']['includeAll']){_0x215849[_0x19f1('0x44')]=[{'all':!![]}];}_0x215849=_[_0x19f1('0x40')]({},_0x215849,_0x4017d9[_0x19f1('0x42')]);return db['FaxQueue'][_0x19f1('0x4c')](_0x215849)[_0x19f1('0x2a')](handleEntityNotFound(_0x5721ea,null))['then'](respondWithResult(_0x5721ea,null))[_0x19f1('0x47')](handleError(_0x5721ea,null));};exports[_0x19f1('0x4d')]=function(_0x85cab9,_0xaff14a){return db['FaxQueue'][_0x19f1('0x4d')](_0x85cab9[_0x19f1('0x4e')],{})[_0x19f1('0x2a')](function(_0x5cdb69){var _0x34b2c1=_0x85cab9[_0x19f1('0x4f')][_0x19f1('0x2b')]({'plain':!![]});if(!_0x34b2c1)throw new Error(_0x19f1('0x50'));if(_0x34b2c1[_0x19f1('0x51')]==='user'){var _0x5ace6e=_0x5cdb69[_0x19f1('0x2b')]({'plain':!![]});var _0xb5fe3d=_0x19f1('0x52');return db['UserProfileSection']['find']({'where':{'name':_0xb5fe3d,'userProfileId':_0x34b2c1[_0x19f1('0x53')]},'raw':!![]})['then'](function(_0x36cfeb){if(_0x36cfeb&&_0x36cfeb['autoAssociation']===0x0){return db['UserProfileResource'][_0x19f1('0x4d')]({'name':_0x5ace6e[_0x19f1('0x30')],'resourceId':_0x5ace6e['id'],'type':_0x36cfeb['name'],'sectionId':_0x36cfeb['id']},{})[_0x19f1('0x2a')](function(){return _0x5cdb69;});}else{return _0x5cdb69;}})[_0x19f1('0x47')](function(_0x335128){logger['error'](_0x19f1('0x54'),_0x335128);throw _0x335128;});}return _0x5cdb69;})[_0x19f1('0x2a')](respondWithResult(_0xaff14a,0xc9))[_0x19f1('0x47')](handleError(_0xaff14a,null));};exports[_0x19f1('0x55')]=function(_0x201e9d,_0x3eed86){if(_0x201e9d[_0x19f1('0x4e')]['id']){delete _0x201e9d['body']['id'];}return db['FaxQueue'][_0x19f1('0x4c')]({'where':{'id':_0x201e9d[_0x19f1('0x49')]['id']}})[_0x19f1('0x2a')](handleEntityNotFound(_0x3eed86,null))['then'](saveUpdates(_0x201e9d[_0x19f1('0x4e')],null))[_0x19f1('0x2a')](respondWithResult(_0x3eed86,null))[_0x19f1('0x47')](handleError(_0x3eed86,null));};exports[_0x19f1('0x2d')]=function(_0x3c3dac,_0x227cd9){return db[_0x19f1('0x33')]['find']({'where':{'id':_0x3c3dac[_0x19f1('0x49')]['id']}})[_0x19f1('0x2a')](handleEntityNotFound(_0x227cd9,null))['then'](removeEntity(_0x227cd9,null))[_0x19f1('0x47')](handleError(_0x227cd9,null));};exports[_0x19f1('0x56')]=function(_0x1b9e61,_0x1f84e5){return db[_0x19f1('0x33')][_0x19f1('0x56')]()['then'](respondWithResult(_0x1f84e5,null))[_0x19f1('0x47')](handleError(_0x1f84e5,null));};exports['getMembers']=function(_0x3b99a2,_0x2cc371,_0x41806d){var _0x13c844={'raw':!![],'where':{}},_0x2b374f={},_0x108188;return db[_0x19f1('0x33')][_0x19f1('0x57')]({'where':{'id':_0x3b99a2[_0x19f1('0x49')]['id']}})[_0x19f1('0x2a')](handleEntityNotFound(_0x2cc371,null))['then'](function(_0x561e36){if(_0x561e36){_0x108188=_0x561e36[_0x19f1('0x2b')]({'plain':!![]});_0x2b374f['model']=_[_0x19f1('0x39')](db['UserFaxQueue'][_0x19f1('0x34')]);_0x2b374f[_0x19f1('0x38')]=_[_0x19f1('0x39')](_0x3b99a2[_0x19f1('0x38')]);_0x2b374f[_0x19f1('0x3a')]=_['intersection'](_0x2b374f[_0x19f1('0x37')],_0x2b374f[_0x19f1('0x38')]);_0x13c844[_0x19f1('0x3c')]=_['intersection'](_0x2b374f[_0x19f1('0x37')],qs[_0x19f1('0x4a')](_0x3b99a2[_0x19f1('0x38')]['fields']));_0x13c844['attributes']=_0x13c844['attributes'][_0x19f1('0x4b')]?_0x13c844['attributes']:_0x2b374f[_0x19f1('0x37')];if(!_0x3b99a2[_0x19f1('0x38')][_0x19f1('0x3d')](_0x19f1('0x58'))){_0x13c844[_0x19f1('0x23')]=qs[_0x19f1('0x23')](_0x3b99a2[_0x19f1('0x38')][_0x19f1('0x23')]);_0x13c844[_0x19f1('0x21')]=qs[_0x19f1('0x21')](_0x3b99a2[_0x19f1('0x38')]['offset']);}_0x13c844[_0x19f1('0x59')]=qs[_0x19f1('0x3e')](_0x3b99a2[_0x19f1('0x38')][_0x19f1('0x3e')]);_0x13c844[_0x19f1('0x41')]=qs[_0x19f1('0x3a')](_[_0x19f1('0x5a')](_0x3b99a2['query'],_0x2b374f[_0x19f1('0x3a')]));_0x13c844[_0x19f1('0x41')][_0x19f1('0x5b')]=_0x561e36['id'];if(_0x3b99a2[_0x19f1('0x38')][_0x19f1('0x3f')]){_0x13c844['where']=_['merge'](_0x13c844[_0x19f1('0x41')],{'$or':_[_0x19f1('0x32')](_0x13c844[_0x19f1('0x3c')],function(_0x25b42e){var _0x16aab8={};_0x16aab8[_0x25b42e]={'$like':'%'+_0x3b99a2[_0x19f1('0x38')][_0x19f1('0x3f')]+'%'};return _0x16aab8;})});}_0x13c844=_[_0x19f1('0x40')]({},_0x13c844,_0x3b99a2[_0x19f1('0x42')]);return db['UserFaxQueue']['findAll'](_0x13c844);}})['then'](function(_0x203640){if(_0x203640){return db['User'][_0x19f1('0x5c')]({'where':{'id':_['map'](_0x203640,'UserId'),'role':_0x19f1('0x5d')},'attributes':['id',_0x19f1('0x30'),_0x19f1('0x5e'),_0x19f1('0x5f'),_0x19f1('0x60')]});}})[_0x19f1('0x2a')](function(_0x6ef3a){if(_0x6ef3a){return{'count':_0x6ef3a['count'],'rows':_[_0x19f1('0x32')](_0x6ef3a[_0x19f1('0x46')],function(_0x552b7c){return{'membername':_0x552b7c[_0x19f1('0x30')],'UserId':_0x552b7c['id'],'queue_name':_0x108188[_0x19f1('0x30')],'FaxQueueId':_0x108188['id'],'interface':util['format']('%s/%s','SIP',_0x552b7c[_0x19f1('0x30')]),'penalty':0x0,'paused':_0x552b7c[_0x19f1('0x5e')],'createdAt':_0x552b7c['createdAt'],'updatedAt':_0x552b7c[_0x19f1('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x19f1('0x2a')](respondWithFilteredResult(_0x2cc371,_0x13c844))['catch'](handleError(_0x2cc371,null));};exports[_0x19f1('0x61')]=function(_0x43aac2,_0x2e9fa5,_0x3e5bc5){var _0x365616={};var _0x5768bd={};var _0x5d3336;var _0x1295c3;return db[_0x19f1('0x33')][_0x19f1('0x57')]({'where':{'id':_0x43aac2[_0x19f1('0x49')]['id']}})[_0x19f1('0x2a')](handleEntityNotFound(_0x2e9fa5,null))[_0x19f1('0x2a')](function(_0x290929){if(_0x290929){_0x5d3336=_0x290929;_0x5768bd[_0x19f1('0x37')]=_[_0x19f1('0x39')](db[_0x19f1('0x62')][_0x19f1('0x34')]);_0x5768bd[_0x19f1('0x38')]=_[_0x19f1('0x39')](_0x43aac2['query']);_0x5768bd[_0x19f1('0x3a')]=_[_0x19f1('0x3b')](_0x5768bd[_0x19f1('0x37')],_0x5768bd[_0x19f1('0x38')]);_0x365616[_0x19f1('0x3c')]=_[_0x19f1('0x3b')](_0x5768bd[_0x19f1('0x37')],qs[_0x19f1('0x4a')](_0x43aac2[_0x19f1('0x38')][_0x19f1('0x4a')]));_0x365616[_0x19f1('0x3c')]=_0x365616['attributes'][_0x19f1('0x4b')]?_0x365616[_0x19f1('0x3c')]:_0x5768bd[_0x19f1('0x37')];_0x365616['order']=qs[_0x19f1('0x3e')](_0x43aac2[_0x19f1('0x38')][_0x19f1('0x3e')]);_0x365616[_0x19f1('0x41')]=qs['filters'](_[_0x19f1('0x5a')](_0x43aac2['query'],_0x5768bd['filters']));if(_0x43aac2[_0x19f1('0x38')]['filter']){_0x365616[_0x19f1('0x41')]=_[_0x19f1('0x40')](_0x365616[_0x19f1('0x41')],{'$or':_[_0x19f1('0x32')](_0x365616[_0x19f1('0x3c')],function(_0x5db8c0){var _0x533b6d={};_0x533b6d[_0x5db8c0]={'$like':'%'+_0x43aac2[_0x19f1('0x38')][_0x19f1('0x3f')]+'%'};return _0x533b6d;})});}_0x365616=_[_0x19f1('0x40')]({},_0x365616,_0x43aac2[_0x19f1('0x42')]);return _0x5d3336[_0x19f1('0x61')](_0x365616);}})[_0x19f1('0x2a')](function(_0x1e7572){if(_0x1e7572){_0x1295c3=_0x1e7572['length'];if(!_0x43aac2[_0x19f1('0x38')][_0x19f1('0x3d')](_0x19f1('0x58'))){_0x365616['limit']=qs[_0x19f1('0x23')](_0x43aac2[_0x19f1('0x38')][_0x19f1('0x23')]);_0x365616[_0x19f1('0x21')]=qs[_0x19f1('0x21')](_0x43aac2[_0x19f1('0x38')][_0x19f1('0x21')]);}return _0x5d3336[_0x19f1('0x61')](_0x365616);}})[_0x19f1('0x2a')](function(_0x2d8d58){if(_0x2d8d58){return _0x2d8d58?{'count':_0x1295c3,'rows':_0x2d8d58}:null;}})['then'](respondWithResult(_0x2e9fa5,null))['catch'](handleError(_0x2e9fa5,null));};exports[_0x19f1('0x63')]=function(_0x122db1,_0x5d9de3,_0x1d3167){var _0x4f8f4b=_0x122db1[_0x19f1('0x4e')][_0x19f1('0x64')];return db[_0x19f1('0x62')][_0x19f1('0x45')]({'where':{'id':_0x4f8f4b},'attributes':['id'],'include':[{'model':db[_0x19f1('0x65')],'as':_0x19f1('0x66'),'attributes':['id','name',_0x19f1('0x67'),'voicePause',_0x19f1('0x68')],'raw':!![]}]})[_0x19f1('0x2a')](function(_0x543dff){if(_0x543dff){var _0x9463e3=_[_0x19f1('0x69')](_0x543dff,function(_0x48323c){var _0x30077f=_0x48323c[_0x19f1('0x2b')]({'plain':!![]});return _0x30077f['Agents'];});return db[_0x19f1('0x33')][_0x19f1('0x4c')]({'where':{'id':_0x122db1[_0x19f1('0x49')]['id']}})['then'](function(_0xea4f15){return db['sequelize'][_0x19f1('0x6a')](function(_0x4fbfe3){return _0xea4f15[_0x19f1('0x63')](_0x4f8f4b,{'transaction':_0x4fbfe3})['then'](function(){return BPromise['each'](_0x9463e3,function(_0x5efd17){return db[_0x19f1('0x6b')][_0x19f1('0x6c')]({'where':{'UserId':_0x5efd17['id'],'FaxQueueId':_0x122db1[_0x19f1('0x49')]['id']},'transaction':_0x4fbfe3});});})['then'](function(){_0x9463e3['forEach'](function(_0x33096f){socket[_0x19f1('0x6d')](_0x19f1('0x6e'),{'UserId':_0x33096f['id'],'FaxQueueId':_0xea4f15['id']});});});});});}})[_0x19f1('0x2a')](respondWithStatusCode(_0x5d9de3,null))['catch'](handleError(_0x5d9de3,null));};exports['removeTeams']=function(_0x18947b,_0x19106f,_0x217887){return db['Team'][_0x19f1('0x45')]({'where':{'id':_0x18947b[_0x19f1('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x19f1('0x65')],'as':_0x19f1('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x19106f,null))[_0x19f1('0x2a')](function(_0x508331){var _0x85ad9a=_[_0x19f1('0x32')](_0x508331,'id');var _0x3ff317=[];var _0x459c28=[];var _0x5e43b0=squel[_0x19f1('0x6f')]();_0x5e43b0[_0x19f1('0x70')](_0x19f1('0x71'))[_0x19f1('0x72')](_0x19f1('0x73'),'tq')[_0x19f1('0x74')](_0x19f1('0x75'),'ut',_0x19f1('0x76'))[_0x19f1('0x41')](_0x19f1('0x77'),_0x18947b[_0x19f1('0x49')]['id']);for(var _0x2f65db=0x0;_0x2f65db<_0x508331[_0x19f1('0x4b')];_0x2f65db+=0x1){let _0x9e04bd=_0x508331[_0x2f65db];for(var _0x46cb7c=0x0;_0x46cb7c<_0x9e04bd[_0x19f1('0x66')]['length'];_0x46cb7c+=0x1){let _0x1fd861=_0x9e04bd['Agents'][_0x46cb7c];var _0x3c2cb0=_0x5e43b0['clone']();_0x3c2cb0[_0x19f1('0x41')]('ut.UserId\x20=\x20?',_0x1fd861['id']);_0x459c28[_0x19f1('0x78')](db[_0x19f1('0x79')][_0x19f1('0x38')](_0x3c2cb0[_0x19f1('0x7a')](),{'type':db['sequelize'][_0x19f1('0x7b')][_0x19f1('0x7c')]})['then'](function(_0x4801ff){if(_0x4801ff[_0x19f1('0x4b')]===0x1){return _0x1fd861['id'];}else{var _0x4f3312=_[_0x19f1('0x7d')](_['map'](_0x4801ff,_0x19f1('0x7e')),function(_0x23a443){return _[_0x19f1('0x7f')](_0x85ad9a,_0x23a443);});if(_0x4f3312){return _0x1fd861['id'];}}}));}}return BPromise[_0x19f1('0x80')](_0x459c28)[_0x19f1('0x2a')](function(_0xf851bb){_0x3ff317=_(_0x3ff317)[_0x19f1('0x81')](_0xf851bb)[_0x19f1('0x82')]()[_0x19f1('0x83')]();return db['FaxQueue'][_0x19f1('0x4c')]({'where':{'id':_0x18947b[_0x19f1('0x49')]['id']}})[_0x19f1('0x2a')](function(_0x5e5692){return db['sequelize'][_0x19f1('0x6a')](function(_0x1db3e9){return _0x5e5692[_0x19f1('0x84')](_0x18947b['query'][_0x19f1('0x64')],{'transaction':_0x1db3e9})[_0x19f1('0x2a')](function(){if(!_[_0x19f1('0x85')](_0x3ff317)){return _0x5e5692[_0x19f1('0x86')](_0x3ff317,{'transaction':_0x1db3e9});}})[_0x19f1('0x2a')](function(){_0x3ff317[_0x19f1('0x87')](function(_0x36dd78){socket['emit'](_0x19f1('0x88'),{'UserId':_0x36dd78,'FaxQueueId':_0x5e5692['id']});});});});});});})[_0x19f1('0x2a')](respondWithStatusCode(_0x19106f,null))[_0x19f1('0x47')](handleError(_0x19106f,null));};exports[_0x19f1('0x89')]=function(_0x2258dd,_0x1b81f5,_0x5d8bc0){return db['FaxQueue'][_0x19f1('0x4c')]({'where':{'id':_0x2258dd[_0x19f1('0x49')]['id']}})[_0x19f1('0x2a')](handleEntityNotFound(_0x1b81f5,null))['then'](function(_0xe8829c){if(_0xe8829c){return _0xe8829c['addAgents'](_0x2258dd[_0x19f1('0x4e')][_0x19f1('0x64')],_[_0x19f1('0x8a')](_0x2258dd[_0x19f1('0x4e')],[_0x19f1('0x64'),'id'])||{})['spread'](function(_0x92412){for(var _0x12f750=0x0;_0x12f750<_0x2258dd[_0x19f1('0x4e')]['ids']['length'];_0x12f750+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x2258dd[_0x19f1('0x4e')][_0x19f1('0x64')][_0x12f750]),'FaxQueueId':Number(_0x2258dd['params']['id'])});}return _0x92412;});}})[_0x19f1('0x2a')](respondWithResult(_0x1b81f5,null))[_0x19f1('0x47')](handleError(_0x1b81f5,null));};exports[_0x19f1('0x86')]=function(_0x486331,_0x2b36d8,_0x87b914){return db[_0x19f1('0x33')]['find']({'where':{'id':_0x486331[_0x19f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b36d8,null))[_0x19f1('0x2a')](function(_0x88b58d){if(_0x88b58d){return _0x88b58d[_0x19f1('0x86')](_0x486331[_0x19f1('0x38')][_0x19f1('0x64')])['then'](function(){if(_[_0x19f1('0x8b')](_0x486331[_0x19f1('0x38')]['ids'])){for(var _0x51d5b8=0x0;_0x51d5b8<_0x486331[_0x19f1('0x38')][_0x19f1('0x64')][_0x19f1('0x4b')];_0x51d5b8+=0x1){socket[_0x19f1('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x486331[_0x19f1('0x38')]['ids'][_0x51d5b8]),'FaxQueueId':Number(_0x486331[_0x19f1('0x49')]['id'])});}}else{socket['emit'](_0x19f1('0x88'),{'UserId':Number(_0x486331[_0x19f1('0x38')][_0x19f1('0x64')]),'FaxQueueId':Number(_0x486331['params']['id'])});}});}})[_0x19f1('0x2a')](respondWithStatusCode(_0x2b36d8,null))[_0x19f1('0x47')](handleError(_0x2b36d8,null));};exports[_0x19f1('0x8c')]=function(_0x12e4f5,_0x23f1c0,_0x4eb0c1){var _0x505d06={};var _0x3b41ba={};var _0x7849f3;var _0x5fefc8;return db[_0x19f1('0x33')]['findOne']({'where':{'id':_0x12e4f5[_0x19f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x23f1c0,null))[_0x19f1('0x2a')](function(_0x1fcc13){if(_0x1fcc13){_0x7849f3=_0x1fcc13;_0x3b41ba['model']=_[_0x19f1('0x39')](db['User']['rawAttributes']);_0x3b41ba['query']=_[_0x19f1('0x39')](_0x12e4f5[_0x19f1('0x38')]);_0x3b41ba['filters']=_[_0x19f1('0x3b')](_0x3b41ba[_0x19f1('0x37')],_0x3b41ba['query']);_0x505d06[_0x19f1('0x3c')]=_[_0x19f1('0x3b')](_0x3b41ba['model'],qs[_0x19f1('0x4a')](_0x12e4f5['query'][_0x19f1('0x4a')]));_0x505d06[_0x19f1('0x3c')]=_0x505d06['attributes'][_0x19f1('0x4b')]?_0x505d06[_0x19f1('0x3c')]:_0x3b41ba['model'];_0x505d06[_0x19f1('0x59')]=qs['sort'](_0x12e4f5['query'][_0x19f1('0x3e')]);_0x505d06[_0x19f1('0x41')]=qs[_0x19f1('0x3a')](_[_0x19f1('0x5a')](_0x12e4f5[_0x19f1('0x38')],_0x3b41ba[_0x19f1('0x3a')]));if(_0x12e4f5[_0x19f1('0x38')]['filter']){_0x505d06[_0x19f1('0x41')]=_[_0x19f1('0x40')](_0x505d06['where'],{'$or':_[_0x19f1('0x32')](_0x505d06['attributes'],function(_0x3c2d49){var _0x373ce7={};_0x373ce7[_0x3c2d49]={'$like':'%'+_0x12e4f5[_0x19f1('0x38')][_0x19f1('0x3f')]+'%'};return _0x373ce7;})});}_0x505d06=_['merge']({},_0x505d06,_0x12e4f5['options']);return _0x7849f3[_0x19f1('0x8c')](_0x505d06);}})[_0x19f1('0x2a')](function(_0x4cf1ea){if(_0x4cf1ea){_0x5fefc8=_0x4cf1ea['length'];if(!_0x12e4f5[_0x19f1('0x38')][_0x19f1('0x3d')]('nolimit')){_0x505d06['limit']=qs[_0x19f1('0x23')](_0x12e4f5[_0x19f1('0x38')][_0x19f1('0x23')]);_0x505d06[_0x19f1('0x21')]=qs['offset'](_0x12e4f5[_0x19f1('0x38')][_0x19f1('0x21')]);}return _0x7849f3[_0x19f1('0x8c')](_0x505d06);}})[_0x19f1('0x2a')](function(_0x1c2f91){if(_0x1c2f91){return _0x1c2f91?{'count':_0x5fefc8,'rows':_0x1c2f91}:null;}})[_0x19f1('0x2a')](respondWithResult(_0x23f1c0,null))['catch'](handleError(_0x23f1c0,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 876dfb1..11d4c00 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 _0xff7c=['hasOwnProperty','hook','events','../../mysqldb','FaxQueue','save','update','remove','emit'];(function(_0x399a68,_0x32b703){var _0x283d8c=function(_0x22a206){while(--_0x22a206){_0x399a68['push'](_0x399a68['shift']());}};_0x283d8c(++_0x32b703);}(_0xff7c,0xda));var _0xcff7=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xff7c[_0x2cc569];return _0x1bfc2e;};'use strict';var EventEmitter=require(_0xcff7('0x0'));var FaxQueue=require(_0xcff7('0x1'))['db'][_0xcff7('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcff7('0x3'),'afterUpdate':_0xcff7('0x4'),'afterDestroy':_0xcff7('0x5')};function emitEvent(_0x47328c){return function(_0x460c9a,_0x2ee664,_0x10671c){FaxQueueEvents[_0xcff7('0x6')](_0x47328c+':'+_0x460c9a['id'],_0x460c9a);FaxQueueEvents['emit'](_0x47328c,_0x460c9a);_0x10671c(null);};}for(var e in events){if(events[_0xcff7('0x7')](e)){var event=events[e];FaxQueue[_0xcff7('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xd3e4=['FaxQueue','save','hook','exports','events','../../mysqldb'];(function(_0x4605dc,_0x3f7ae5){var _0x5d3e81=function(_0x1d0375){while(--_0x1d0375){_0x4605dc['push'](_0x4605dc['shift']());}};_0x5d3e81(++_0x3f7ae5);}(_0xd3e4,0x7c));var _0x4d3e=function(_0x468eba,_0x172609){_0x468eba=_0x468eba-0x0;var _0x5d27d1=_0xd3e4[_0x468eba];return _0x5d27d1;};'use strict';var EventEmitter=require(_0x4d3e('0x0'));var FaxQueue=require(_0x4d3e('0x1'))['db'][_0x4d3e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4d3e('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3c5197){return function(_0x270cff,_0x2275bc,_0xeee6ff){FaxQueueEvents['emit'](_0x3c5197+':'+_0x270cff['id'],_0x270cff);FaxQueueEvents['emit'](_0x3c5197,_0x270cff);_0xeee6ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x4d3e('0x4')](e,emitEvent(event));}}module[_0x4d3e('0x5')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index f5e8aea..9ce0ff9 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 _0x1279=['lodash','util','api','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues'];(function(_0x32c038,_0x5cba92){var _0x11366b=function(_0x2e4b4a){while(--_0x2e4b4a){_0x32c038['push'](_0x32c038['shift']());}};_0x11366b(++_0x5cba92);}(_0x1279,0x154));var _0x9127=function(_0x4ce8c3,_0x30c484){_0x4ce8c3=_0x4ce8c3-0x0;var _0x325f32=_0x1279[_0x4ce8c3];return _0x325f32;};'use strict';var _=require(_0x9127('0x0'));var util=require(_0x9127('0x1'));var logger=require('../../config/logger')(_0x9127('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9127('0x3'));var rimraf=require(_0x9127('0x4'));var config=require(_0x9127('0x5'));var attributes=require(_0x9127('0x6'));module[_0x9127('0x7')]=function(_0x2dbea5,_0x1794b1){return _0x2dbea5[_0x9127('0x8')]('FaxQueue',attributes,{'tableName':_0x9127('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d2e=['rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x9d2e,0x125));var _0xe9d2=function(_0x4e0174,_0x347ca3){_0x4e0174=_0x4e0174-0x0;var _0x21b5db=_0x9d2e[_0x4e0174];return _0x21b5db;};'use strict';var _=require(_0xe9d2('0x0'));var util=require(_0xe9d2('0x1'));var logger=require(_0xe9d2('0x2'))(_0xe9d2('0x3'));var moment=require(_0xe9d2('0x4'));var BPromise=require(_0xe9d2('0x5'));var rp=require(_0xe9d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9d2('0x7'));var config=require(_0xe9d2('0x8'));var attributes=require(_0xe9d2('0x9'));module['exports']=function(_0x4be4b9,_0x50adf3){return _0x4be4b9[_0xe9d2('0xa')](_0xe9d2('0xb'),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 3d4f7ce..f217c01 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 _0xb4d4=['map','model','then','debug','ShowFaxQueue','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4d4,0x70));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b4d('0x0'));var util=require(_0x4b4d('0x1'));var moment=require('moment');var BPromise=require(_0x4b4d('0x2'));var rs=require(_0x4b4d('0x3'));var fs=require('fs');var Redis=require(_0x4b4d('0x4'));var db=require(_0x4b4d('0x5'))['db'];var utils=require(_0x4b4d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4b4d('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x4b4d('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b4d('0x8')]));require(_0x4b4d('0x9'))[_0x4b4d('0xa')](socket);function respondWithRpcPromise(_0x451b08,_0x37d494,_0x4073a9){return new BPromise(function(_0x14f7af,_0x4ac8ab){return client['request'](_0x451b08,_0x4073a9)['then'](function(_0x19b816){logger[_0x4b4d('0xb')](_0x4b4d('0xc'),_0x37d494,_0x4b4d('0xd'));logger['debug'](_0x4b4d('0xe'),_0x37d494,'request\x20sent',JSON[_0x4b4d('0xf')](_0x19b816));if(_0x19b816[_0x4b4d('0x10')]){if(_0x19b816[_0x4b4d('0x10')][_0x4b4d('0x11')]===0x1f4){logger[_0x4b4d('0x10')](_0x4b4d('0xc'),_0x37d494,_0x19b816['error'][_0x4b4d('0x12')]);return _0x4ac8ab(_0x19b816['error']['message']);}logger[_0x4b4d('0x10')](_0x4b4d('0xc'),_0x37d494,_0x19b816['error']['message']);return _0x14f7af(_0x19b816[_0x4b4d('0x10')]['message']);}else{logger[_0x4b4d('0xb')](_0x4b4d('0xc'),_0x37d494,_0x4b4d('0xd'));_0x14f7af(_0x19b816['result'][_0x4b4d('0x12')]);}})['catch'](function(_0x5e3e9e){logger[_0x4b4d('0x10')](_0x4b4d('0xc'),_0x37d494,_0x5e3e9e);_0x4ac8ab(_0x5e3e9e);});});}exports[_0x4b4d('0x13')]=function(_0x395996){var _0xcec7a9=this;return new Promise(function(_0x2fe034,_0x38896d){return db[_0x4b4d('0x14')][_0x4b4d('0x15')]({'raw':_0x395996[_0x4b4d('0x16')]?_0x395996[_0x4b4d('0x16')][_0x4b4d('0x17')]===undefined?!![]:![]:!![],'where':_0x395996[_0x4b4d('0x16')]?_0x395996['options'][_0x4b4d('0x18')]||null:null,'attributes':_0x395996['options']?_0x395996[_0x4b4d('0x16')][_0x4b4d('0x19')]||null:null,'limit':_0x395996[_0x4b4d('0x16')]?_0x395996[_0x4b4d('0x16')][_0x4b4d('0x1a')]||null:null,'include':_0x395996[_0x4b4d('0x16')]?_0x395996['options'][_0x4b4d('0x1b')]?_[_0x4b4d('0x1c')](_0x395996[_0x4b4d('0x16')][_0x4b4d('0x1b')],function(_0x51a5a3){return{'model':db[_0x51a5a3[_0x4b4d('0x1d')]],'as':_0x51a5a3['as'],'attributes':_0x51a5a3[_0x4b4d('0x19')],'include':_0x51a5a3[_0x4b4d('0x1b')]?_[_0x4b4d('0x1c')](_0x51a5a3[_0x4b4d('0x1b')],function(_0x181a47){return{'model':db[_0x181a47[_0x4b4d('0x1d')]],'as':_0x181a47['as'],'attributes':_0x181a47[_0x4b4d('0x19')],'include':_0x181a47[_0x4b4d('0x1b')]?_['map'](_0x181a47['include'],function(_0x2abc63){return{'model':db[_0x2abc63[_0x4b4d('0x1d')]],'as':_0x2abc63['as'],'attributes':_0x2abc63[_0x4b4d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4b4d('0x1e')](function(_0x2fcb47){logger['info'](_0x4b4d('0x13'),_0x395996);logger[_0x4b4d('0x1f')](_0x4b4d('0x13'),_0x395996,JSON[_0x4b4d('0xf')](_0x2fcb47));_0x2fe034(_0x2fcb47);})['catch'](function(_0x29a7fc){logger[_0x4b4d('0x10')](_0x4b4d('0x13'),_0x29a7fc['message'],_0x395996);_0x38896d(_0xcec7a9[_0x4b4d('0x10')](0x1f4,_0x29a7fc[_0x4b4d('0x12')]));});});};exports[_0x4b4d('0x20')]=function(_0x1d5c46){var _0x4bc962=this;return new Promise(function(_0x3bcc47,_0x3474c7){return db[_0x4b4d('0x14')][_0x4b4d('0x21')]({'raw':_0x1d5c46['options']?_0x1d5c46[_0x4b4d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d5c46[_0x4b4d('0x16')]?_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x18')]||null:null,'attributes':_0x1d5c46[_0x4b4d('0x16')]?_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x19')]||null:null,'include':_0x1d5c46[_0x4b4d('0x16')]?_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x1b')]?_[_0x4b4d('0x1c')](_0x1d5c46[_0x4b4d('0x16')][_0x4b4d('0x1b')],function(_0x2ad7d9){return{'model':db[_0x2ad7d9['model']],'as':_0x2ad7d9['as'],'attributes':_0x2ad7d9['attributes'],'include':_0x2ad7d9['include']?_['map'](_0x2ad7d9[_0x4b4d('0x1b')],function(_0x13749c){return{'model':db[_0x13749c[_0x4b4d('0x1d')]],'as':_0x13749c['as'],'attributes':_0x13749c[_0x4b4d('0x19')],'include':_0x13749c[_0x4b4d('0x1b')]?_['map'](_0x13749c[_0x4b4d('0x1b')],function(_0x267bf7){return{'model':db[_0x267bf7[_0x4b4d('0x1d')]],'as':_0x267bf7['as'],'attributes':_0x267bf7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x486b48){logger['info']('ShowFaxQueue',_0x1d5c46);logger[_0x4b4d('0x1f')](_0x4b4d('0x20'),_0x1d5c46,JSON['stringify'](_0x486b48));_0x3bcc47(_0x486b48);})[_0x4b4d('0x22')](function(_0xdbc653){logger[_0x4b4d('0x10')](_0x4b4d('0x20'),_0xdbc653[_0x4b4d('0x12')],_0x1d5c46);_0x3474c7(_0x4bc962[_0x4b4d('0x10')](0x1f4,_0xdbc653[_0x4b4d('0x12')]));});});}; \ No newline at end of file +var _0x3bce=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','find','ShowFaxQueue','lodash','moment'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0x3bce,0x10f));var _0xe3bc=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3bce[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xe3bc('0x0'));var util=require('util');var moment=require(_0xe3bc('0x1'));var BPromise=require(_0xe3bc('0x2'));var rs=require(_0xe3bc('0x3'));var fs=require('fs');var Redis=require(_0xe3bc('0x4'));var db=require(_0xe3bc('0x5'))['db'];var utils=require(_0xe3bc('0x6'));var logger=require(_0xe3bc('0x7'))('rpc');var config=require(_0xe3bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe3bc('0x9')][_0xe3bc('0xa')]({'port':0x232a});config['redis']=_[_0xe3bc('0xb')](config[_0xe3bc('0xc')],{'host':_0xe3bc('0xd'),'port':0x18eb});var socket=require(_0xe3bc('0xe'))(new Redis(config[_0xe3bc('0xc')]));require(_0xe3bc('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c0e50,_0x23ff58,_0x260a6c){return new BPromise(function(_0x3dca65,_0x25b5c5){return client['request'](_0x4c0e50,_0x260a6c)[_0xe3bc('0x10')](function(_0x4b07d0){logger[_0xe3bc('0x11')](_0xe3bc('0x12'),_0x23ff58,_0xe3bc('0x13'));logger[_0xe3bc('0x14')](_0xe3bc('0x15'),_0x23ff58,_0xe3bc('0x13'),JSON[_0xe3bc('0x16')](_0x4b07d0));if(_0x4b07d0[_0xe3bc('0x17')]){if(_0x4b07d0[_0xe3bc('0x17')]['code']===0x1f4){logger[_0xe3bc('0x17')](_0xe3bc('0x12'),_0x23ff58,_0x4b07d0[_0xe3bc('0x17')]['message']);return _0x25b5c5(_0x4b07d0['error'][_0xe3bc('0x18')]);}logger[_0xe3bc('0x17')](_0xe3bc('0x12'),_0x23ff58,_0x4b07d0[_0xe3bc('0x17')][_0xe3bc('0x18')]);return _0x3dca65(_0x4b07d0[_0xe3bc('0x17')][_0xe3bc('0x18')]);}else{logger['info'](_0xe3bc('0x12'),_0x23ff58,_0xe3bc('0x13'));_0x3dca65(_0x4b07d0[_0xe3bc('0x19')]['message']);}})[_0xe3bc('0x1a')](function(_0x47bcf0){logger[_0xe3bc('0x17')](_0xe3bc('0x12'),_0x23ff58,_0x47bcf0);_0x25b5c5(_0x47bcf0);});});}exports[_0xe3bc('0x1b')]=function(_0x5ef18d){var _0x1d7926=this;return new Promise(function(_0x4eabbb,_0x404bc0){return db[_0xe3bc('0x1c')]['findAll']({'raw':_0x5ef18d[_0xe3bc('0x1d')]?_0x5ef18d['options'][_0xe3bc('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ef18d[_0xe3bc('0x1d')]?_0x5ef18d[_0xe3bc('0x1d')][_0xe3bc('0x1f')]||null:null,'attributes':_0x5ef18d[_0xe3bc('0x1d')]?_0x5ef18d[_0xe3bc('0x1d')][_0xe3bc('0x20')]||null:null,'limit':_0x5ef18d['options']?_0x5ef18d[_0xe3bc('0x1d')][_0xe3bc('0x21')]||null:null,'include':_0x5ef18d[_0xe3bc('0x1d')]?_0x5ef18d[_0xe3bc('0x1d')][_0xe3bc('0x22')]?_[_0xe3bc('0x23')](_0x5ef18d[_0xe3bc('0x1d')]['include'],function(_0x5016b8){return{'model':db[_0x5016b8['model']],'as':_0x5016b8['as'],'attributes':_0x5016b8[_0xe3bc('0x20')],'include':_0x5016b8[_0xe3bc('0x22')]?_[_0xe3bc('0x23')](_0x5016b8['include'],function(_0x1ea3f4){return{'model':db[_0x1ea3f4[_0xe3bc('0x24')]],'as':_0x1ea3f4['as'],'attributes':_0x1ea3f4[_0xe3bc('0x20')],'include':_0x1ea3f4[_0xe3bc('0x22')]?_[_0xe3bc('0x23')](_0x1ea3f4[_0xe3bc('0x22')],function(_0x20bf1e){return{'model':db[_0x20bf1e[_0xe3bc('0x24')]],'as':_0x20bf1e['as'],'attributes':_0x20bf1e[_0xe3bc('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe3bc('0x10')](function(_0x5078c2){logger['info'](_0xe3bc('0x1b'),_0x5ef18d);logger[_0xe3bc('0x14')](_0xe3bc('0x1b'),_0x5ef18d,JSON[_0xe3bc('0x16')](_0x5078c2));_0x4eabbb(_0x5078c2);})[_0xe3bc('0x1a')](function(_0x37f972){logger[_0xe3bc('0x17')](_0xe3bc('0x1b'),_0x37f972[_0xe3bc('0x18')],_0x5ef18d);_0x404bc0(_0x1d7926[_0xe3bc('0x17')](0x1f4,_0x37f972['message']));});});};exports['ShowFaxQueue']=function(_0x32b025){var _0x5608fe=this;return new Promise(function(_0x3dbf51,_0x10d77d){return db[_0xe3bc('0x1c')][_0xe3bc('0x25')]({'raw':_0x32b025[_0xe3bc('0x1d')]?_0x32b025[_0xe3bc('0x1d')][_0xe3bc('0x1e')]===undefined?!![]:![]:!![],'where':_0x32b025[_0xe3bc('0x1d')]?_0x32b025[_0xe3bc('0x1d')]['where']||null:null,'attributes':_0x32b025[_0xe3bc('0x1d')]?_0x32b025[_0xe3bc('0x1d')][_0xe3bc('0x20')]||null:null,'include':_0x32b025[_0xe3bc('0x1d')]?_0x32b025[_0xe3bc('0x1d')][_0xe3bc('0x22')]?_[_0xe3bc('0x23')](_0x32b025['options'][_0xe3bc('0x22')],function(_0x2df276){return{'model':db[_0x2df276[_0xe3bc('0x24')]],'as':_0x2df276['as'],'attributes':_0x2df276[_0xe3bc('0x20')],'include':_0x2df276[_0xe3bc('0x22')]?_[_0xe3bc('0x23')](_0x2df276['include'],function(_0x205e49){return{'model':db[_0x205e49[_0xe3bc('0x24')]],'as':_0x205e49['as'],'attributes':_0x205e49[_0xe3bc('0x20')],'include':_0x205e49[_0xe3bc('0x22')]?_[_0xe3bc('0x23')](_0x205e49['include'],function(_0x2df9e3){return{'model':db[_0x2df9e3[_0xe3bc('0x24')]],'as':_0x2df9e3['as'],'attributes':_0x2df9e3[_0xe3bc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7ab3b3){logger[_0xe3bc('0x11')](_0xe3bc('0x26'),_0x32b025);logger[_0xe3bc('0x14')](_0xe3bc('0x26'),_0x32b025,JSON[_0xe3bc('0x16')](_0x7ab3b3));_0x3dbf51(_0x7ab3b3);})[_0xe3bc('0x1a')](function(_0x2bbdbb){logger[_0xe3bc('0x17')]('ShowFaxQueue',_0x2bbdbb[_0xe3bc('0x18')],_0x32b025);_0x10d77d(_0x5608fe[_0xe3bc('0x17')](0x1f4,_0x2bbdbb[_0xe3bc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 99ba4eb..a818b9a 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 _0x6f0d=['remove','update','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x38628f,_0x3b08d4){var _0x51c1b4=function(_0x2a47f4){while(--_0x2a47f4){_0x38628f['push'](_0x38628f['shift']());}};_0x51c1b4(++_0x3b08d4);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x1773d8,_0x551063){_0x1773d8=_0x1773d8-0x0;var _0x33914b=_0x6f0d[_0x1773d8];return _0x33914b;};'use strict';var FaxQueueEvents=require(_0xd6f0('0x0'));var events=['save',_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x214284,_0x20cf0c){return function(_0x13cfe2){_0x20cf0c['emit'](_0x214284,_0x13cfe2);};}function removeListener(_0x196ec0,_0x2072dc){return function(){FaxQueueEvents[_0xd6f0('0x3')](_0x196ec0,_0x2072dc);};}exports['register']=function(_0x52c4d9){for(var _0x18a556=0x0,_0x1cf8b2=events[_0xd6f0('0x4')];_0x18a556<_0x1cf8b2;_0x18a556++){var _0x289bc6=events[_0x18a556];var _0x272022=createListener(_0xd6f0('0x5')+_0x289bc6,_0x52c4d9);FaxQueueEvents['on'](_0x289bc6,_0x272022);}}; \ No newline at end of file +var _0xad9b=['./faxQueue.events','remove','update','emit','removeListener','length'];(function(_0x24579a,_0x59612d){var _0x59dff7=function(_0x47c50f){while(--_0x47c50f){_0x24579a['push'](_0x24579a['shift']());}};_0x59dff7(++_0x59612d);}(_0xad9b,0x10e));var _0xbad9=function(_0xdd56d8,_0x404844){_0xdd56d8=_0xdd56d8-0x0;var _0x5b4efd=_0xad9b[_0xdd56d8];return _0x5b4efd;};'use strict';var FaxQueueEvents=require(_0xbad9('0x0'));var events=['save',_0xbad9('0x1'),_0xbad9('0x2')];function createListener(_0x3f9f81,_0x190e63){return function(_0x45aee3){_0x190e63[_0xbad9('0x3')](_0x3f9f81,_0x45aee3);};}function removeListener(_0x5423d9,_0x5cd9b9){return function(){FaxQueueEvents[_0xbad9('0x4')](_0x5423d9,_0x5cd9b9);};}exports['register']=function(_0xbca672){for(var _0x4a77f1=0x0,_0x4e05fd=events[_0xbad9('0x5')];_0x4a77f1<_0x4e05fd;_0x4a77f1++){var _0x18216f=events[_0x4a77f1];var _0x41895e=createListener('faxQueue:'+_0x18216f,_0xbca672);FaxQueueEvents['on'](_0x18216f,_0x41895e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9ac187a..38d9181 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 _0xef17=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','put','update','destroy'];(function(_0xc31458,_0x45ee76){var _0x1b4a90=function(_0x1a49b0){while(--_0x1a49b0){_0xc31458['push'](_0xc31458['shift']());}};_0x1b4a90(++_0x45ee76);}(_0xef17,0x136));var _0x7ef1=function(_0x4f952e,_0x5623f9){_0x4f952e=_0x4f952e-0x0;var _0x102bef=_0xef17[_0x4f952e];return _0x102bef;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7ef1('0x11')]);router['post']('/',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')](_0x7ef1('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7ef1('0x17')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7ef1('0x19')]);router['delete'](_0x7ef1('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7ef1('0x16'),auth['isAuthenticated'](),controller[_0x7ef1('0x1a')]);module[_0x7ef1('0x1b')]=router; \ No newline at end of file +var _0xaa3f=['getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x2c2e2f,_0x1387a8){_0x2c2e2f=_0x2c2e2f-0x0;var _0x1928fe=_0xaa3f[_0x2c2e2f];return _0x1928fe;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xfaa3('0x10')]);router[_0xfaa3('0x9')](_0xfaa3('0x11'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x12')]);router[_0xfaa3('0x9')]('/:id/users',auth[_0xfaa3('0xc')](),controller['getAgents']);router[_0xfaa3('0x13')]('/',auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x14')]);router['post'](_0xfaa3('0x11'),auth['isAuthenticated'](),controller[_0xfaa3('0x15')]);router[_0xfaa3('0x13')](_0xfaa3('0x16'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x17')]);router[_0xfaa3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xfaa3('0x19')]);router[_0xfaa3('0x1a')](_0xfaa3('0xe'),auth[_0xfaa3('0xc')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xfaa3('0x1a')]('/:id/users',auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x1b')]);module[_0xfaa3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 31a94d7..27065b9 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 _0xceb3=['moment','sequelize','exports','STRING','DATE'];(function(_0x139f36,_0x3610de){var _0x26ca27=function(_0x5ae210){while(--_0x5ae210){_0x139f36['push'](_0x139f36['shift']());}};_0x26ca27(++_0x3610de);}(_0xceb3,0xf5));var _0x3ceb=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xceb3[_0x172747];return _0x509692;};'use strict';var moment=require(_0x3ceb('0x0'));var Sequelize=require(_0x3ceb('0x1'));module[_0x3ceb('0x2')]={'uniqueid':{'type':Sequelize[_0x3ceb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3ceb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3ceb('0x4')]},'acceptAt':{'type':Sequelize[_0x3ceb('0x4')]},'exitAt':{'type':Sequelize[_0x3ceb('0x4')]},'reason':{'type':Sequelize[_0x3ceb('0x3')]}}; \ No newline at end of file +var _0x57e4=['STRING','moment','sequelize','exports','DATE'];(function(_0x741184,_0x174846){var _0x3fff52=function(_0x537842){while(--_0x537842){_0x741184['push'](_0x741184['shift']());}};_0x3fff52(++_0x174846);}(_0x57e4,0x1eb));var _0x457e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x57e4[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0x457e('0x0'));var Sequelize=require(_0x457e('0x1'));module[_0x457e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x457e('0x3')]},'leaveAt':{'type':Sequelize[_0x457e('0x3')]},'acceptAt':{'type':Sequelize[_0x457e('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x457e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0fddb9d..336448a 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 _0x4876=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','FaxQueueReport','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','describe','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2b3509,_0x662ece){var _0x11795e=function(_0x54f68f){while(--_0x54f68f){_0x2b3509['push'](_0x2b3509['shift']());}};_0x11795e(++_0x662ece);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6487('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6487('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6487('0x2'));var util=require(_0x6487('0x3'));var path=require(_0x6487('0x4'));var sox=require(_0x6487('0x5'));var csv=require('to-csv');var ejs=require(_0x6487('0x6'));var fs=require('fs');var fs_extra=require(_0x6487('0x7'));var _=require('lodash');var squel=require(_0x6487('0x8'));var crypto=require(_0x6487('0x9'));var jsforce=require(_0x6487('0xa'));var deskjs=require(_0x6487('0xb'));var toCsv=require(_0x6487('0xc'));var querystring=require(_0x6487('0xd'));var Papa=require(_0x6487('0xe'));var Redis=require(_0x6487('0xf'));var authService=require(_0x6487('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6487('0x11'));var hardwareService=require(_0x6487('0x12'));var logger=require(_0x6487('0x13'))(_0x6487('0x14'));var utils=require(_0x6487('0x15'));var config=require(_0x6487('0x16'));var licenseUtil=require(_0x6487('0x17'));var db=require(_0x6487('0x18'))['db'];function respondWithStatusCode(_0x48e266,_0x30227d){_0x30227d=_0x30227d||0xcc;return function(_0x22596a){if(_0x22596a){return _0x48e266[_0x6487('0x19')](_0x30227d);}return _0x48e266[_0x6487('0x1a')](_0x30227d)['end']();};}function respondWithResult(_0x40a352,_0x10f2e1){_0x10f2e1=_0x10f2e1||0xc8;return function(_0x1ac263){if(_0x1ac263){return _0x40a352[_0x6487('0x1a')](_0x10f2e1)['json'](_0x1ac263);}};}function respondWithFilteredResult(_0x522154,_0x1dde46){return function(_0x552f2d){if(_0x552f2d){var _0x2fdfc3=typeof _0x1dde46['offset']===_0x6487('0x1b')&&typeof _0x1dde46[_0x6487('0x1c')]===_0x6487('0x1b');var _0x26b2f2=_0x552f2d[_0x6487('0x1d')];var _0x59514e=_0x2fdfc3?0x0:_0x1dde46['offset'];var _0x5afb4a=_0x2fdfc3?_0x552f2d[_0x6487('0x1d')]:_0x1dde46[_0x6487('0x1e')]+_0x1dde46[_0x6487('0x1c')];var _0x424ae2;if(_0x5afb4a>=_0x26b2f2){_0x5afb4a=_0x26b2f2;_0x424ae2=0xc8;}else{_0x424ae2=0xce;}_0x522154[_0x6487('0x1a')](_0x424ae2);return _0x522154[_0x6487('0x1f')](_0x6487('0x20'),_0x59514e+'-'+_0x5afb4a+'/'+_0x26b2f2)[_0x6487('0x21')](_0x552f2d);}return null;};}function patchUpdates(_0x1b99ef){return function(_0x30ed2e){try{jsonpatch[_0x6487('0x22')](_0x30ed2e,_0x1b99ef,!![]);}catch(_0x2827a3){return BPromise[_0x6487('0x23')](_0x2827a3);}return _0x30ed2e[_0x6487('0x24')]();};}function saveUpdates(_0x21b8e8,_0x21050d){return function(_0x3affe7){if(_0x3affe7){return _0x3affe7[_0x6487('0x25')](_0x21b8e8)[_0x6487('0x26')](function(_0x4d06b2){return _0x4d06b2;});}return null;};}function removeEntity(_0x58d269,_0x234485){return function(_0x4e8ec8){if(_0x4e8ec8){return _0x4e8ec8['destroy']()[_0x6487('0x26')](function(){_0x58d269[_0x6487('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x116995,_0x38ac56){return function(_0x2f4190){if(!_0x2f4190){_0x116995[_0x6487('0x19')](0x194);}return _0x2f4190;};}function handleError(_0x392e60,_0x5439f7){_0x5439f7=_0x5439f7||0x1f4;return function(_0x44bb48){logger['error'](_0x44bb48[_0x6487('0x27')]);if(_0x44bb48['name']){delete _0x44bb48['name'];}_0x392e60[_0x6487('0x1a')](_0x5439f7)[_0x6487('0x28')](_0x44bb48);};}exports[_0x6487('0x29')]=function(_0x4c424a,_0x39581d){var _0x3c4411={},_0x33085b={},_0x63ddc7={'count':0x0,'rows':[]};var _0x35b089=_[_0x6487('0x2a')](db['FaxQueueReport'][_0x6487('0x2b')],function(_0x270e6e){return{'name':_0x270e6e['fieldName'],'type':_0x270e6e[_0x6487('0x2c')][_0x6487('0x2d')]};});_0x33085b[_0x6487('0x2e')]=_[_0x6487('0x2a')](_0x35b089,_0x6487('0x2f'));_0x33085b[_0x6487('0x30')]=_[_0x6487('0x31')](_0x4c424a['query']);_0x33085b[_0x6487('0x32')]=_['intersection'](_0x33085b[_0x6487('0x2e')],_0x33085b['query']);_0x3c4411['attributes']=_['intersection'](_0x33085b['model'],qs[_0x6487('0x33')](_0x4c424a[_0x6487('0x30')][_0x6487('0x33')]));_0x3c4411['attributes']=_0x3c4411[_0x6487('0x34')]['length']?_0x3c4411[_0x6487('0x34')]:_0x33085b[_0x6487('0x2e')];if(!_0x4c424a[_0x6487('0x30')][_0x6487('0x35')](_0x6487('0x36'))){_0x3c4411['limit']=qs[_0x6487('0x1c')](_0x4c424a['query'][_0x6487('0x1c')]);_0x3c4411[_0x6487('0x1e')]=qs[_0x6487('0x1e')](_0x4c424a[_0x6487('0x30')]['offset']);}_0x3c4411[_0x6487('0x37')]=qs[_0x6487('0x38')](_0x4c424a[_0x6487('0x30')]['sort']);_0x3c4411['where']=qs[_0x6487('0x32')](_['pick'](_0x4c424a[_0x6487('0x30')],_0x33085b[_0x6487('0x32')]),_0x35b089);if(_0x4c424a[_0x6487('0x30')]['filter']){_0x3c4411[_0x6487('0x39')]=_[_0x6487('0x3a')](_0x3c4411[_0x6487('0x39')],{'$or':_[_0x6487('0x2a')](_0x35b089,function(_0x2e532d){if(_0x2e532d[_0x6487('0x2c')]!==_0x6487('0x3b')){var _0x538293={};_0x538293[_0x2e532d[_0x6487('0x2f')]]={'$like':'%'+_0x4c424a[_0x6487('0x30')][_0x6487('0x3c')]+'%'};return _0x538293;}})});}_0x3c4411=_['merge']({},_0x3c4411,_0x4c424a[_0x6487('0x3d')]);var _0x4de8c8={'where':_0x3c4411[_0x6487('0x39')]};return db['FaxQueueReport'][_0x6487('0x1d')](_0x4de8c8)['then'](function(_0x44e2e9){_0x63ddc7[_0x6487('0x1d')]=_0x44e2e9;if(_0x4c424a[_0x6487('0x30')][_0x6487('0x3e')]){_0x3c4411[_0x6487('0x3f')]=[{'all':!![]}];}return db[_0x6487('0x40')][_0x6487('0x41')](_0x3c4411);})[_0x6487('0x26')](function(_0x47b3bb){_0x63ddc7[_0x6487('0x42')]=_0x47b3bb;return _0x63ddc7;})[_0x6487('0x26')](respondWithFilteredResult(_0x39581d,_0x3c4411))[_0x6487('0x43')](handleError(_0x39581d,null));};exports[_0x6487('0x44')]=function(_0x3598c4,_0x12f7f5){var _0x594b42={'raw':!![],'where':{'id':_0x3598c4[_0x6487('0x45')]['id']}},_0x56452e={};_0x56452e['model']=_[_0x6487('0x31')](db[_0x6487('0x40')][_0x6487('0x2b')]);_0x56452e[_0x6487('0x30')]=_[_0x6487('0x31')](_0x3598c4[_0x6487('0x30')]);_0x56452e[_0x6487('0x32')]=_[_0x6487('0x46')](_0x56452e[_0x6487('0x2e')],_0x56452e['query']);_0x594b42[_0x6487('0x34')]=_[_0x6487('0x46')](_0x56452e[_0x6487('0x2e')],qs['fields'](_0x3598c4['query'][_0x6487('0x33')]));_0x594b42[_0x6487('0x34')]=_0x594b42[_0x6487('0x34')][_0x6487('0x47')]?_0x594b42[_0x6487('0x34')]:_0x56452e[_0x6487('0x2e')];if(_0x3598c4['query'][_0x6487('0x3e')]){_0x594b42['include']=[{'all':!![]}];}_0x594b42=_[_0x6487('0x3a')]({},_0x594b42,_0x3598c4[_0x6487('0x3d')]);return db[_0x6487('0x40')][_0x6487('0x48')](_0x594b42)[_0x6487('0x26')](handleEntityNotFound(_0x12f7f5,null))[_0x6487('0x26')](respondWithResult(_0x12f7f5,null))[_0x6487('0x43')](handleError(_0x12f7f5,null));};exports[_0x6487('0x49')]=function(_0x2f6b86,_0x1e8ae7){return db[_0x6487('0x40')][_0x6487('0x49')](_0x2f6b86['body'],{})[_0x6487('0x26')](respondWithResult(_0x1e8ae7,0xc9))['catch'](handleError(_0x1e8ae7,null));};exports[_0x6487('0x25')]=function(_0x2c4272,_0x46c3dd){if(_0x2c4272[_0x6487('0x4a')]['id']){delete _0x2c4272[_0x6487('0x4a')]['id'];}return db[_0x6487('0x40')][_0x6487('0x48')]({'where':{'id':_0x2c4272[_0x6487('0x45')]['id']}})[_0x6487('0x26')](handleEntityNotFound(_0x46c3dd,null))[_0x6487('0x26')](saveUpdates(_0x2c4272[_0x6487('0x4a')],null))[_0x6487('0x26')](respondWithResult(_0x46c3dd,null))[_0x6487('0x43')](handleError(_0x46c3dd,null));};exports[_0x6487('0x4b')]=function(_0x2a7715,_0x2dde3c){return db[_0x6487('0x40')][_0x6487('0x48')]({'where':{'id':_0x2a7715[_0x6487('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dde3c,null))[_0x6487('0x26')](removeEntity(_0x2dde3c,null))[_0x6487('0x43')](handleError(_0x2dde3c,null));};exports['describe']=function(_0x39f822,_0x38a94b){return db[_0x6487('0x40')][_0x6487('0x4c')]()['then'](respondWithResult(_0x38a94b,null))[_0x6487('0x43')](handleError(_0x38a94b,null));}; \ No newline at end of file +var _0xde2c=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','save','update','destroy','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','then','show','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xde2c,0x7f));var _0xcde2=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xde2c[_0x492af5];return _0x59f529;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require(_0xcde2('0x3'));var rp=require(_0xcde2('0x4'));var moment=require(_0xcde2('0x5'));var BPromise=require(_0xcde2('0x6'));var Mustache=require(_0xcde2('0x7'));var util=require('util');var path=require(_0xcde2('0x8'));var sox=require(_0xcde2('0x9'));var csv=require(_0xcde2('0xa'));var ejs=require(_0xcde2('0xb'));var fs=require('fs');var fs_extra=require(_0xcde2('0xc'));var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var licenseUtil=require(_0xcde2('0x18'));var db=require(_0xcde2('0x19'))['db'];function respondWithStatusCode(_0x932b90,_0x1ea4bb){_0x1ea4bb=_0x1ea4bb||0xcc;return function(_0x599294){if(_0x599294){return _0x932b90[_0xcde2('0x1a')](_0x1ea4bb);}return _0x932b90['status'](_0x1ea4bb)[_0xcde2('0x1b')]();};}function respondWithResult(_0x4f0ac9,_0x4b0e0e){_0x4b0e0e=_0x4b0e0e||0xc8;return function(_0x34e079){if(_0x34e079){return _0x4f0ac9[_0xcde2('0x1c')](_0x4b0e0e)[_0xcde2('0x1d')](_0x34e079);}};}function respondWithFilteredResult(_0x19b54b,_0x11665c){return function(_0x5312c7){if(_0x5312c7){var _0x39b023=typeof _0x11665c['offset']===_0xcde2('0x1e')&&typeof _0x11665c[_0xcde2('0x1f')]===_0xcde2('0x1e');var _0x1f1858=_0x5312c7['count'];var _0x4fd5aa=_0x39b023?0x0:_0x11665c['offset'];var _0x2b4468=_0x39b023?_0x5312c7['count']:_0x11665c[_0xcde2('0x20')]+_0x11665c[_0xcde2('0x1f')];var _0x252372;if(_0x2b4468>=_0x1f1858){_0x2b4468=_0x1f1858;_0x252372=0xc8;}else{_0x252372=0xce;}_0x19b54b['status'](_0x252372);return _0x19b54b[_0xcde2('0x21')](_0xcde2('0x22'),_0x4fd5aa+'-'+_0x2b4468+'/'+_0x1f1858)[_0xcde2('0x1d')](_0x5312c7);}return null;};}function patchUpdates(_0x3c1d7e){return function(_0x43df7a){try{jsonpatch['apply'](_0x43df7a,_0x3c1d7e,!![]);}catch(_0x4bce90){return BPromise['reject'](_0x4bce90);}return _0x43df7a[_0xcde2('0x23')]();};}function saveUpdates(_0x3e5170,_0x2c9562){return function(_0x4063d4){if(_0x4063d4){return _0x4063d4[_0xcde2('0x24')](_0x3e5170)['then'](function(_0x1104b8){return _0x1104b8;});}return null;};}function removeEntity(_0x52368b,_0x280d8c){return function(_0xb2123c){if(_0xb2123c){return _0xb2123c[_0xcde2('0x25')]()['then'](function(){_0x52368b['status'](0xcc)[_0xcde2('0x1b')]();});}};}function handleEntityNotFound(_0x207a12,_0x3e8aaf){return function(_0x217ec9){if(!_0x217ec9){_0x207a12[_0xcde2('0x1a')](0x194);}return _0x217ec9;};}function handleError(_0x5a5b92,_0x2d1d17){_0x2d1d17=_0x2d1d17||0x1f4;return function(_0x45275a){logger[_0xcde2('0x26')](_0x45275a['stack']);if(_0x45275a[_0xcde2('0x27')]){delete _0x45275a[_0xcde2('0x27')];}_0x5a5b92[_0xcde2('0x1c')](_0x2d1d17)[_0xcde2('0x28')](_0x45275a);};}exports[_0xcde2('0x29')]=function(_0x5b2b7,_0x40b12c){var _0x3e492f={},_0x5bf1e6={},_0x3c3c01={'count':0x0,'rows':[]};var _0x4a0826=_[_0xcde2('0x2a')](db[_0xcde2('0x2b')][_0xcde2('0x2c')],function(_0x49cb58){return{'name':_0x49cb58[_0xcde2('0x2d')],'type':_0x49cb58[_0xcde2('0x2e')]['key']};});_0x5bf1e6[_0xcde2('0x2f')]=_[_0xcde2('0x2a')](_0x4a0826,_0xcde2('0x27'));_0x5bf1e6[_0xcde2('0x30')]=_[_0xcde2('0x31')](_0x5b2b7[_0xcde2('0x30')]);_0x5bf1e6[_0xcde2('0x32')]=_[_0xcde2('0x33')](_0x5bf1e6['model'],_0x5bf1e6[_0xcde2('0x30')]);_0x3e492f[_0xcde2('0x34')]=_[_0xcde2('0x33')](_0x5bf1e6[_0xcde2('0x2f')],qs['fields'](_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x35')]));_0x3e492f[_0xcde2('0x34')]=_0x3e492f[_0xcde2('0x34')]['length']?_0x3e492f[_0xcde2('0x34')]:_0x5bf1e6[_0xcde2('0x2f')];if(!_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x36')]('nolimit')){_0x3e492f[_0xcde2('0x1f')]=qs[_0xcde2('0x1f')](_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x1f')]);_0x3e492f[_0xcde2('0x20')]=qs['offset'](_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x20')]);}_0x3e492f[_0xcde2('0x37')]=qs[_0xcde2('0x38')](_0x5b2b7['query']['sort']);_0x3e492f[_0xcde2('0x39')]=qs[_0xcde2('0x32')](_[_0xcde2('0x3a')](_0x5b2b7[_0xcde2('0x30')],_0x5bf1e6[_0xcde2('0x32')]),_0x4a0826);if(_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x3b')]){_0x3e492f[_0xcde2('0x39')]=_[_0xcde2('0x3c')](_0x3e492f['where'],{'$or':_[_0xcde2('0x2a')](_0x4a0826,function(_0x766279){if(_0x766279[_0xcde2('0x2e')]!==_0xcde2('0x3d')){var _0x2a73df={};_0x2a73df[_0x766279['name']]={'$like':'%'+_0x5b2b7['query'][_0xcde2('0x3b')]+'%'};return _0x2a73df;}})});}_0x3e492f=_[_0xcde2('0x3c')]({},_0x3e492f,_0x5b2b7[_0xcde2('0x3e')]);var _0x383899={'where':_0x3e492f[_0xcde2('0x39')]};return db[_0xcde2('0x2b')]['count'](_0x383899)['then'](function(_0x5160c2){_0x3c3c01[_0xcde2('0x3f')]=_0x5160c2;if(_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x40')]){_0x3e492f[_0xcde2('0x41')]=[{'all':!![]}];}return db[_0xcde2('0x2b')][_0xcde2('0x42')](_0x3e492f);})[_0xcde2('0x43')](function(_0x49b862){_0x3c3c01['rows']=_0x49b862;return _0x3c3c01;})[_0xcde2('0x43')](respondWithFilteredResult(_0x40b12c,_0x3e492f))['catch'](handleError(_0x40b12c,null));};exports[_0xcde2('0x44')]=function(_0x4fc7bf,_0x1126b2){var _0x3239a0={'raw':!![],'where':{'id':_0x4fc7bf['params']['id']}},_0x2cf372={};_0x2cf372[_0xcde2('0x2f')]=_['keys'](db[_0xcde2('0x2b')][_0xcde2('0x2c')]);_0x2cf372[_0xcde2('0x30')]=_[_0xcde2('0x31')](_0x4fc7bf[_0xcde2('0x30')]);_0x2cf372[_0xcde2('0x32')]=_['intersection'](_0x2cf372['model'],_0x2cf372[_0xcde2('0x30')]);_0x3239a0['attributes']=_['intersection'](_0x2cf372[_0xcde2('0x2f')],qs['fields'](_0x4fc7bf[_0xcde2('0x30')][_0xcde2('0x35')]));_0x3239a0['attributes']=_0x3239a0[_0xcde2('0x34')]['length']?_0x3239a0['attributes']:_0x2cf372[_0xcde2('0x2f')];if(_0x4fc7bf[_0xcde2('0x30')]['includeAll']){_0x3239a0[_0xcde2('0x41')]=[{'all':!![]}];}_0x3239a0=_['merge']({},_0x3239a0,_0x4fc7bf[_0xcde2('0x3e')]);return db[_0xcde2('0x2b')][_0xcde2('0x45')](_0x3239a0)[_0xcde2('0x43')](handleEntityNotFound(_0x1126b2,null))[_0xcde2('0x43')](respondWithResult(_0x1126b2,null))['catch'](handleError(_0x1126b2,null));};exports[_0xcde2('0x46')]=function(_0x3e4fc0,_0x40d14b){return db[_0xcde2('0x2b')]['create'](_0x3e4fc0['body'],{})[_0xcde2('0x43')](respondWithResult(_0x40d14b,0xc9))['catch'](handleError(_0x40d14b,null));};exports[_0xcde2('0x24')]=function(_0x3e9e79,_0x381bd4){if(_0x3e9e79[_0xcde2('0x47')]['id']){delete _0x3e9e79[_0xcde2('0x47')]['id'];}return db[_0xcde2('0x2b')]['find']({'where':{'id':_0x3e9e79[_0xcde2('0x48')]['id']}})['then'](handleEntityNotFound(_0x381bd4,null))[_0xcde2('0x43')](saveUpdates(_0x3e9e79['body'],null))[_0xcde2('0x43')](respondWithResult(_0x381bd4,null))[_0xcde2('0x49')](handleError(_0x381bd4,null));};exports[_0xcde2('0x25')]=function(_0x16cddb,_0x446cf0){return db[_0xcde2('0x2b')]['find']({'where':{'id':_0x16cddb[_0xcde2('0x48')]['id']}})['then'](handleEntityNotFound(_0x446cf0,null))[_0xcde2('0x43')](removeEntity(_0x446cf0,null))[_0xcde2('0x49')](handleError(_0x446cf0,null));};exports[_0xcde2('0x4a')]=function(_0x428a55,_0x1e1c9e){return db[_0xcde2('0x2b')][_0xcde2('0x4a')]()[_0xcde2('0x43')](respondWithResult(_0x1e1c9e,null))[_0xcde2('0x49')](handleError(_0x1e1c9e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index fa537ec..c21db0f 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x19438b,_0x57bd67){var _0x135efe=function(_0x1e3d21){while(--_0x1e3d21){_0x19438b['push'](_0x19438b['shift']());}};_0x135efe(++_0x57bd67);}(_0x7a54,0x106));var _0x47a5=function(_0x294590,_0x16735f){_0x294590=_0x294590-0x0;var _0xb6492=_0x7a54[_0x294590];return _0xb6492;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x84dbd4,_0x590b54){var _0x3b079e=function(_0x5384e6){while(--_0x5384e6){_0x84dbd4['push'](_0x84dbd4['shift']());}};_0x3b079e(++_0x590b54);}(_0x5fab,0x177));var _0xb5fa=function(_0x5137c9,_0x3d193f){_0x5137c9=_0x5137c9-0x0;var _0x548778=_0x5fab[_0x5137c9];return _0x548778;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 39e636c..0f6142c 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 _0x2832=['result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','UpdateFaxQueueReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1aed66,_0x23163e){var _0x4bfc31=function(_0x1ed23e){while(--_0x1ed23e){_0x1aed66['push'](_0x1aed66['shift']());}};_0x4bfc31(++_0x23163e);}(_0x2832,0x14c));var _0x2283=function(_0x15e650,_0x48ac06){_0x15e650=_0x15e650-0x0;var _0xffba51=_0x2832[_0x15e650];return _0xffba51;};'use strict';var _=require(_0x2283('0x0'));var util=require('util');var moment=require(_0x2283('0x1'));var BPromise=require(_0x2283('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2283('0x3'));var db=require(_0x2283('0x4'))['db'];var utils=require(_0x2283('0x5'));var logger=require('../../config/logger')(_0x2283('0x6'));var config=require(_0x2283('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2283('0x8')][_0x2283('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d746a,_0x55dbdc,_0x530557){return new BPromise(function(_0x24453b,_0x6e4024){return client[_0x2283('0xa')](_0x4d746a,_0x530557)[_0x2283('0xb')](function(_0x3e62a){logger[_0x2283('0xc')](_0x2283('0xd'),_0x55dbdc,_0x2283('0xe'));logger[_0x2283('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x55dbdc,_0x2283('0xe'),JSON[_0x2283('0x10')](_0x3e62a));if(_0x3e62a[_0x2283('0x11')]){if(_0x3e62a[_0x2283('0x11')][_0x2283('0x12')]===0x1f4){logger[_0x2283('0x11')](_0x2283('0xd'),_0x55dbdc,_0x3e62a['error'][_0x2283('0x13')]);return _0x6e4024(_0x3e62a['error'][_0x2283('0x13')]);}logger['error'](_0x2283('0xd'),_0x55dbdc,_0x3e62a[_0x2283('0x11')]['message']);return _0x24453b(_0x3e62a[_0x2283('0x11')][_0x2283('0x13')]);}else{logger[_0x2283('0xc')](_0x2283('0xd'),_0x55dbdc,_0x2283('0xe'));_0x24453b(_0x3e62a[_0x2283('0x14')][_0x2283('0x13')]);}})[_0x2283('0x15')](function(_0x151168){logger[_0x2283('0x11')](_0x2283('0xd'),_0x55dbdc,_0x151168);_0x6e4024(_0x151168);});});}exports[_0x2283('0x16')]=function(_0x516b0a){var _0x1622b8=this;return new Promise(function(_0x481dd6,_0x50bad2){return db[_0x2283('0x17')][_0x2283('0x18')](_0x516b0a[_0x2283('0x19')],{'raw':_0x516b0a[_0x2283('0x1a')]?_0x516b0a['options']['raw']===undefined?!![]:![]:!![]})[_0x2283('0xb')](function(_0x1704b1){logger[_0x2283('0xc')](_0x2283('0x16'),_0x516b0a);logger['debug']('CreateFaxQueueReport',_0x516b0a,JSON[_0x2283('0x10')](_0x1704b1));_0x481dd6(_0x1704b1);})['catch'](function(_0x30d9b2){logger[_0x2283('0x11')](_0x2283('0x16'),_0x30d9b2[_0x2283('0x13')],_0x516b0a);_0x50bad2(_0x1622b8[_0x2283('0x11')](0x1f4,_0x30d9b2[_0x2283('0x13')]));});});};exports[_0x2283('0x1b')]=function(_0x55c3b3){var _0x17e475=this;return new Promise(function(_0x4c4ae1,_0x156d3f){return db['FaxQueueReport'][_0x2283('0x1c')](_0x55c3b3[_0x2283('0x19')],{'raw':_0x55c3b3['options']?_0x55c3b3[_0x2283('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c3b3[_0x2283('0x1a')]?_0x55c3b3[_0x2283('0x1a')][_0x2283('0x1d')]||null:null,'attributes':_0x55c3b3[_0x2283('0x1a')]?_0x55c3b3[_0x2283('0x1a')][_0x2283('0x1e')]||null:null,'limit':_0x55c3b3[_0x2283('0x1a')]?_0x55c3b3['options'][_0x2283('0x1f')]||null:null})[_0x2283('0xb')](function(_0x260538){logger[_0x2283('0xc')](_0x2283('0x1b'),_0x55c3b3);logger[_0x2283('0xf')]('UpdateFaxQueueReport',_0x55c3b3,JSON[_0x2283('0x10')](_0x260538));_0x4c4ae1(_0x260538);})[_0x2283('0x15')](function(_0x704e5c){logger['error'](_0x2283('0x1b'),_0x704e5c['message'],_0x55c3b3);_0x156d3f(_0x17e475[_0x2283('0x11')](0x1f4,_0x704e5c[_0x2283('0x13')]));});});}; \ No newline at end of file +var _0x8e5b=['FaxQueueReport','body','catch','UpdateFaxQueueReport','update','options','raw','where','attributes','limit','then','lodash','moment','../../mysqldb','../../config/logger','client','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','CreateFaxQueueReport'];(function(_0x57a1f7,_0xd3f42b){var _0x38a9c2=function(_0x193383){while(--_0x193383){_0x57a1f7['push'](_0x57a1f7['shift']());}};_0x38a9c2(++_0xd3f42b);}(_0x8e5b,0x193));var _0xb8e5=function(_0x399d11,_0xab24f1){_0x399d11=_0x399d11-0x0;var _0xa03faa=_0x8e5b[_0x399d11];return _0xa03faa;};'use strict';var _=require(_0xb8e5('0x0'));var util=require('util');var moment=require(_0xb8e5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8e5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8e5('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb8e5('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46bf0d,_0x4230a2,_0x4e0b14){return new BPromise(function(_0x53df13,_0xec6cc5){return client[_0xb8e5('0x5')](_0x46bf0d,_0x4e0b14)['then'](function(_0x52b00c){logger[_0xb8e5('0x6')]('FaxQueueReport,\x20%s,\x20%s',_0x4230a2,_0xb8e5('0x7'));logger[_0xb8e5('0x8')](_0xb8e5('0x9'),_0x4230a2,_0xb8e5('0x7'),JSON[_0xb8e5('0xa')](_0x52b00c));if(_0x52b00c['error']){if(_0x52b00c[_0xb8e5('0xb')][_0xb8e5('0xc')]===0x1f4){logger[_0xb8e5('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x4230a2,_0x52b00c['error'][_0xb8e5('0xd')]);return _0xec6cc5(_0x52b00c['error'][_0xb8e5('0xd')]);}logger['error'](_0xb8e5('0xe'),_0x4230a2,_0x52b00c[_0xb8e5('0xb')][_0xb8e5('0xd')]);return _0x53df13(_0x52b00c[_0xb8e5('0xb')]['message']);}else{logger[_0xb8e5('0x6')](_0xb8e5('0xe'),_0x4230a2,_0xb8e5('0x7'));_0x53df13(_0x52b00c[_0xb8e5('0xf')]['message']);}})['catch'](function(_0x198f9a){logger[_0xb8e5('0xb')](_0xb8e5('0xe'),_0x4230a2,_0x198f9a);_0xec6cc5(_0x198f9a);});});}exports[_0xb8e5('0x10')]=function(_0x441ab2){var _0x32d945=this;return new Promise(function(_0x9bf260,_0x248cb9){return db[_0xb8e5('0x11')]['create'](_0x441ab2[_0xb8e5('0x12')],{'raw':_0x441ab2['options']?_0x441ab2['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2d9135){logger[_0xb8e5('0x6')]('CreateFaxQueueReport',_0x441ab2);logger[_0xb8e5('0x8')]('CreateFaxQueueReport',_0x441ab2,JSON[_0xb8e5('0xa')](_0x2d9135));_0x9bf260(_0x2d9135);})[_0xb8e5('0x13')](function(_0x9b36f4){logger['error'](_0xb8e5('0x10'),_0x9b36f4[_0xb8e5('0xd')],_0x441ab2);_0x248cb9(_0x32d945['error'](0x1f4,_0x9b36f4[_0xb8e5('0xd')]));});});};exports[_0xb8e5('0x14')]=function(_0x5f55b2){var _0x446d31=this;return new Promise(function(_0xc08511,_0x4432d9){return db[_0xb8e5('0x11')][_0xb8e5('0x15')](_0x5f55b2[_0xb8e5('0x12')],{'raw':_0x5f55b2['options']?_0x5f55b2[_0xb8e5('0x16')][_0xb8e5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f55b2[_0xb8e5('0x16')]?_0x5f55b2['options'][_0xb8e5('0x18')]||null:null,'attributes':_0x5f55b2['options']?_0x5f55b2['options'][_0xb8e5('0x19')]||null:null,'limit':_0x5f55b2[_0xb8e5('0x16')]?_0x5f55b2[_0xb8e5('0x16')][_0xb8e5('0x1a')]||null:null})[_0xb8e5('0x1b')](function(_0x479665){logger[_0xb8e5('0x6')](_0xb8e5('0x14'),_0x5f55b2);logger[_0xb8e5('0x8')](_0xb8e5('0x14'),_0x5f55b2,JSON[_0xb8e5('0xa')](_0x479665));_0xc08511(_0x479665);})['catch'](function(_0x1ed575){logger[_0xb8e5('0xb')](_0xb8e5('0x14'),_0x1ed575[_0xb8e5('0xd')],_0x5f55b2);_0x4432d9(_0x446d31[_0xb8e5('0xb')](0x1f4,_0x1ed575[_0xb8e5('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a2df9dd..41cbe8a 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 _0xe700=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','put','delete','destroy','exports','multer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe700,0x71));var _0x0e70=function(_0x38f004,_0x1ff34d){_0x38f004=_0x38f004-0x0;var _0x3ffd73=_0xe700[_0x38f004];return _0x3ffd73;};'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('express');var router=express[_0x0e70('0x4')]();var fs_extra=require(_0x0e70('0x5'));var auth=require(_0x0e70('0x6'));var interaction=require(_0x0e70('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0x9')]);router[_0x0e70('0xa')](_0x0e70('0xb'),auth['isAuthenticated'](),controller[_0x0e70('0xc')]);router['get'](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller[_0x0e70('0xe')]);router['post']('/',auth[_0x0e70('0x8')](),controller['create']);router[_0x0e70('0xf')](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller['update']);router[_0x0e70('0x10')](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller[_0x0e70('0x11')]);module[_0x0e70('0x12')]=router; \ No newline at end of file +var _0x67e9=['/describe','describe','/:id','show','create','put','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','get'];(function(_0x208eef,_0x3f809d){var _0x3adce9=function(_0x2858ed){while(--_0x2858ed){_0x208eef['push'](_0x208eef['shift']());}};_0x3adce9(++_0x3f809d);}(_0x67e9,0xbb));var _0x967e=function(_0x44ca27,_0x81f0da){_0x44ca27=_0x44ca27-0x0;var _0x38bc17=_0x67e9[_0x44ca27];return _0x38bc17;};'use strict';var multer=require(_0x967e('0x0'));var util=require('util');var path=require(_0x967e('0x1'));var timeout=require(_0x967e('0x2'));var express=require('express');var router=express[_0x967e('0x3')]();var fs_extra=require(_0x967e('0x4'));var auth=require(_0x967e('0x5'));var interaction=require(_0x967e('0x6'));var config=require(_0x967e('0x7'));var controller=require(_0x967e('0x8'));router['get']('/',auth[_0x967e('0x9')](),controller['index']);router[_0x967e('0xa')](_0x967e('0xb'),auth[_0x967e('0x9')](),controller[_0x967e('0xc')]);router['get'](_0x967e('0xd'),auth['isAuthenticated'](),controller[_0x967e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x967e('0xf')]);router[_0x967e('0x10')]('/:id',auth[_0x967e('0x9')](),controller['update']);router[_0x967e('0x11')](_0x967e('0xd'),auth[_0x967e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 493392e..f5ef907 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0x54ef,0x112));var _0xf54e=function(_0x8fabd1,_0x5038be){_0x8fabd1=_0x8fabd1-0x0;var _0x49b577=_0x54ef[_0x8fabd1];return _0x49b577;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x341ed1,_0x3eb708){var _0x32f175=function(_0x49bbe5){while(--_0x49bbe5){_0x341ed1['push'](_0x341ed1['shift']());}};_0x32f175(++_0x3eb708);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0xf3cd[_0x43dc7e];return _0x21e12d;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 17f21e2..ca035bd 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 _0x8721=['destroy','stack','name','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','save','update','then'];(function(_0x314e0a,_0x189b9c){var _0x20dbef=function(_0x4d3f1e){while(--_0x4d3f1e){_0x314e0a['push'](_0x314e0a['shift']());}};_0x20dbef(++_0x189b9c);}(_0x8721,0x143));var _0x1872=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x8721[_0x52085a];return _0x5afc1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1872('0x0'));var zipdir=require(_0x1872('0x1'));var jsonpatch=require(_0x1872('0x2'));var rp=require('request-promise');var moment=require(_0x1872('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1872('0x4'));var util=require('util');var path=require(_0x1872('0x5'));var sox=require(_0x1872('0x6'));var csv=require('to-csv');var ejs=require(_0x1872('0x7'));var fs=require('fs');var fs_extra=require(_0x1872('0x8'));var _=require(_0x1872('0x9'));var squel=require(_0x1872('0xa'));var crypto=require(_0x1872('0xb'));var jsforce=require(_0x1872('0xc'));var deskjs=require(_0x1872('0xd'));var toCsv=require(_0x1872('0xe'));var querystring=require(_0x1872('0xf'));var Papa=require(_0x1872('0x10'));var Redis=require(_0x1872('0x11'));var authService=require(_0x1872('0x12'));var qs=require(_0x1872('0x13'));var as=require(_0x1872('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1872('0x15'));var utils=require(_0x1872('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1872('0x17'));var db=require(_0x1872('0x18'))['db'];function respondWithStatusCode(_0x1aed7b,_0x408b93){_0x408b93=_0x408b93||0xcc;return function(_0x5a3513){if(_0x5a3513){return _0x1aed7b[_0x1872('0x19')](_0x408b93);}return _0x1aed7b['status'](_0x408b93)[_0x1872('0x1a')]();};}function respondWithResult(_0x4717bb,_0x3d53d2){_0x3d53d2=_0x3d53d2||0xc8;return function(_0x4b6d7c){if(_0x4b6d7c){return _0x4717bb[_0x1872('0x1b')](_0x3d53d2)['json'](_0x4b6d7c);}};}function respondWithFilteredResult(_0x272e10,_0x339679){return function(_0x5b99de){if(_0x5b99de){var _0x3d9d08=typeof _0x339679[_0x1872('0x1c')]===_0x1872('0x1d')&&typeof _0x339679['limit']===_0x1872('0x1d');var _0x314ece=_0x5b99de[_0x1872('0x1e')];var _0x297a59=_0x3d9d08?0x0:_0x339679['offset'];var _0x2190ad=_0x3d9d08?_0x5b99de[_0x1872('0x1e')]:_0x339679[_0x1872('0x1c')]+_0x339679[_0x1872('0x1f')];var _0x6bca12;if(_0x2190ad>=_0x314ece){_0x2190ad=_0x314ece;_0x6bca12=0xc8;}else{_0x6bca12=0xce;}_0x272e10[_0x1872('0x1b')](_0x6bca12);return _0x272e10[_0x1872('0x20')](_0x1872('0x21'),_0x297a59+'-'+_0x2190ad+'/'+_0x314ece)['json'](_0x5b99de);}return null;};}function patchUpdates(_0x5ee151){return function(_0x4e8cae){try{jsonpatch['apply'](_0x4e8cae,_0x5ee151,!![]);}catch(_0x238ad1){return BPromise['reject'](_0x238ad1);}return _0x4e8cae[_0x1872('0x22')]();};}function saveUpdates(_0x82575e,_0x278e43){return function(_0x380cd1){if(_0x380cd1){return _0x380cd1[_0x1872('0x23')](_0x82575e)[_0x1872('0x24')](function(_0x542e10){return _0x542e10;});}return null;};}function removeEntity(_0x5a2a4c,_0x52399a){return function(_0x25f72){if(_0x25f72){return _0x25f72[_0x1872('0x25')]()[_0x1872('0x24')](function(){_0x5a2a4c[_0x1872('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x364841,_0x438a83){return function(_0x43a8dc){if(!_0x43a8dc){_0x364841[_0x1872('0x19')](0x194);}return _0x43a8dc;};}function handleError(_0x2fb028,_0x560ced){_0x560ced=_0x560ced||0x1f4;return function(_0x5d257a){logger['error'](_0x5d257a[_0x1872('0x26')]);if(_0x5d257a[_0x1872('0x27')]){delete _0x5d257a[_0x1872('0x27')];}_0x2fb028[_0x1872('0x1b')](_0x560ced)['send'](_0x5d257a);};}exports[_0x1872('0x28')]=function(_0x15fb22,_0x347729){var _0x1d6ca7={},_0x44a2f5={},_0x345aec={'count':0x0,'rows':[]};var _0x529f8b=_[_0x1872('0x29')](db[_0x1872('0x2a')]['rawAttributes'],function(_0x3d908c){return{'name':_0x3d908c[_0x1872('0x2b')],'type':_0x3d908c[_0x1872('0x2c')][_0x1872('0x2d')]};});_0x44a2f5[_0x1872('0x2e')]=_['map'](_0x529f8b,_0x1872('0x27'));_0x44a2f5[_0x1872('0x2f')]=_[_0x1872('0x30')](_0x15fb22[_0x1872('0x2f')]);_0x44a2f5[_0x1872('0x31')]=_[_0x1872('0x32')](_0x44a2f5[_0x1872('0x2e')],_0x44a2f5[_0x1872('0x2f')]);_0x1d6ca7['attributes']=_['intersection'](_0x44a2f5[_0x1872('0x2e')],qs[_0x1872('0x33')](_0x15fb22[_0x1872('0x2f')]['fields']));_0x1d6ca7['attributes']=_0x1d6ca7[_0x1872('0x34')][_0x1872('0x35')]?_0x1d6ca7['attributes']:_0x44a2f5[_0x1872('0x2e')];if(!_0x15fb22[_0x1872('0x2f')][_0x1872('0x36')](_0x1872('0x37'))){_0x1d6ca7[_0x1872('0x1f')]=qs[_0x1872('0x1f')](_0x15fb22[_0x1872('0x2f')][_0x1872('0x1f')]);_0x1d6ca7[_0x1872('0x1c')]=qs[_0x1872('0x1c')](_0x15fb22['query'][_0x1872('0x1c')]);}_0x1d6ca7['order']=qs[_0x1872('0x38')](_0x15fb22[_0x1872('0x2f')][_0x1872('0x38')]);_0x1d6ca7['where']=qs['filters'](_[_0x1872('0x39')](_0x15fb22[_0x1872('0x2f')],_0x44a2f5['filters']),_0x529f8b);if(_0x15fb22['query'][_0x1872('0x3a')]){_0x1d6ca7['where']=_[_0x1872('0x3b')](_0x1d6ca7[_0x1872('0x3c')],{'$or':_[_0x1872('0x29')](_0x529f8b,function(_0x6adca3){if(_0x6adca3['type']!=='VIRTUAL'){var _0x59a4ee={};_0x59a4ee[_0x6adca3[_0x1872('0x27')]]={'$like':'%'+_0x15fb22['query'][_0x1872('0x3a')]+'%'};return _0x59a4ee;}})});}_0x1d6ca7=_[_0x1872('0x3b')]({},_0x1d6ca7,_0x15fb22[_0x1872('0x3d')]);var _0x75995f={'where':_0x1d6ca7['where']};return db[_0x1872('0x2a')][_0x1872('0x1e')](_0x75995f)[_0x1872('0x24')](function(_0x2af7a3){_0x345aec[_0x1872('0x1e')]=_0x2af7a3;if(_0x15fb22[_0x1872('0x2f')][_0x1872('0x3e')]){_0x1d6ca7['include']=[{'all':!![]}];}return db[_0x1872('0x2a')][_0x1872('0x3f')](_0x1d6ca7);})[_0x1872('0x24')](function(_0x319477){_0x345aec['rows']=_0x319477;return _0x345aec;})['then'](respondWithFilteredResult(_0x347729,_0x1d6ca7))[_0x1872('0x40')](handleError(_0x347729,null));};exports[_0x1872('0x41')]=function(_0x101670,_0x2073bd){var _0x472ad5={'raw':!![],'where':{'id':_0x101670[_0x1872('0x42')]['id']}},_0x29bc1a={};_0x29bc1a['model']=_[_0x1872('0x30')](db[_0x1872('0x2a')][_0x1872('0x43')]);_0x29bc1a[_0x1872('0x2f')]=_[_0x1872('0x30')](_0x101670[_0x1872('0x2f')]);_0x29bc1a['filters']=_[_0x1872('0x32')](_0x29bc1a[_0x1872('0x2e')],_0x29bc1a['query']);_0x472ad5[_0x1872('0x34')]=_[_0x1872('0x32')](_0x29bc1a[_0x1872('0x2e')],qs[_0x1872('0x33')](_0x101670[_0x1872('0x2f')][_0x1872('0x33')]));_0x472ad5[_0x1872('0x34')]=_0x472ad5[_0x1872('0x34')][_0x1872('0x35')]?_0x472ad5['attributes']:_0x29bc1a[_0x1872('0x2e')];if(_0x101670[_0x1872('0x2f')][_0x1872('0x3e')]){_0x472ad5['include']=[{'all':!![]}];}_0x472ad5=_[_0x1872('0x3b')]({},_0x472ad5,_0x101670['options']);return db[_0x1872('0x2a')][_0x1872('0x44')](_0x472ad5)[_0x1872('0x24')](handleEntityNotFound(_0x2073bd,null))[_0x1872('0x24')](respondWithResult(_0x2073bd,null))['catch'](handleError(_0x2073bd,null));};exports[_0x1872('0x45')]=function(_0x80cefc,_0x17e895){return db[_0x1872('0x2a')]['create'](_0x80cefc[_0x1872('0x46')],{})[_0x1872('0x24')](respondWithResult(_0x17e895,0xc9))[_0x1872('0x40')](handleError(_0x17e895,null));};exports[_0x1872('0x23')]=function(_0x2da1d8,_0x561c6b){if(_0x2da1d8['body']['id']){delete _0x2da1d8[_0x1872('0x46')]['id'];}return db['FaxTransferReport'][_0x1872('0x44')]({'where':{'id':_0x2da1d8['params']['id']}})[_0x1872('0x24')](handleEntityNotFound(_0x561c6b,null))['then'](saveUpdates(_0x2da1d8['body'],null))['then'](respondWithResult(_0x561c6b,null))[_0x1872('0x40')](handleError(_0x561c6b,null));};exports[_0x1872('0x25')]=function(_0x4638f0,_0x3faf8d){return db[_0x1872('0x2a')][_0x1872('0x44')]({'where':{'id':_0x4638f0[_0x1872('0x42')]['id']}})['then'](handleEntityNotFound(_0x3faf8d,null))[_0x1872('0x24')](removeEntity(_0x3faf8d,null))[_0x1872('0x40')](handleError(_0x3faf8d,null));};exports[_0x1872('0x47')]=function(_0x4f7b60,_0x15b12c){return db[_0x1872('0x2a')][_0x1872('0x47')]()['then'](respondWithResult(_0x15b12c,null))['catch'](handleError(_0x15b12c,null));}; \ No newline at end of file +var _0x2e19=['json','offset','undefined','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','FaxTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x961bcc,_0x518765){var _0x3663e4=function(_0x1b2c0e){while(--_0x1b2c0e){_0x961bcc['push'](_0x961bcc['shift']());}};_0x3663e4(++_0x518765);}(_0x2e19,0x113));var _0x92e1=function(_0x13c20c,_0x20bc08){_0x13c20c=_0x13c20c-0x0;var _0x4a7577=_0x2e19[_0x13c20c];return _0x4a7577;};'use strict';var emlformat=require(_0x92e1('0x0'));var rimraf=require(_0x92e1('0x1'));var zipdir=require(_0x92e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92e1('0x3'));var moment=require(_0x92e1('0x4'));var BPromise=require(_0x92e1('0x5'));var Mustache=require(_0x92e1('0x6'));var util=require(_0x92e1('0x7'));var path=require(_0x92e1('0x8'));var sox=require('sox');var csv=require(_0x92e1('0x9'));var ejs=require(_0x92e1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92e1('0xb'));var squel=require(_0x92e1('0xc'));var crypto=require(_0x92e1('0xd'));var jsforce=require(_0x92e1('0xe'));var deskjs=require(_0x92e1('0xf'));var toCsv=require(_0x92e1('0x9'));var querystring=require('querystring');var Papa=require(_0x92e1('0x10'));var Redis=require('ioredis');var authService=require(_0x92e1('0x11'));var qs=require(_0x92e1('0x12'));var as=require(_0x92e1('0x13'));var hardwareService=require(_0x92e1('0x14'));var logger=require(_0x92e1('0x15'))(_0x92e1('0x16'));var utils=require(_0x92e1('0x17'));var config=require(_0x92e1('0x18'));var licenseUtil=require(_0x92e1('0x19'));var db=require(_0x92e1('0x1a'))['db'];function respondWithStatusCode(_0x2ad0b9,_0x5e4935){_0x5e4935=_0x5e4935||0xcc;return function(_0x55a422){if(_0x55a422){return _0x2ad0b9[_0x92e1('0x1b')](_0x5e4935);}return _0x2ad0b9[_0x92e1('0x1c')](_0x5e4935)['end']();};}function respondWithResult(_0x31ea10,_0xc425e8){_0xc425e8=_0xc425e8||0xc8;return function(_0x61cbf9){if(_0x61cbf9){return _0x31ea10[_0x92e1('0x1c')](_0xc425e8)[_0x92e1('0x1d')](_0x61cbf9);}};}function respondWithFilteredResult(_0x1beeec,_0x3882b1){return function(_0x3d8c39){if(_0x3d8c39){var _0x19dced=typeof _0x3882b1[_0x92e1('0x1e')]==='undefined'&&typeof _0x3882b1['limit']===_0x92e1('0x1f');var _0xf11eb7=_0x3d8c39[_0x92e1('0x20')];var _0x20e278=_0x19dced?0x0:_0x3882b1[_0x92e1('0x1e')];var _0x58d87d=_0x19dced?_0x3d8c39[_0x92e1('0x20')]:_0x3882b1[_0x92e1('0x1e')]+_0x3882b1['limit'];var _0x24a1fd;if(_0x58d87d>=_0xf11eb7){_0x58d87d=_0xf11eb7;_0x24a1fd=0xc8;}else{_0x24a1fd=0xce;}_0x1beeec[_0x92e1('0x1c')](_0x24a1fd);return _0x1beeec['set'](_0x92e1('0x21'),_0x20e278+'-'+_0x58d87d+'/'+_0xf11eb7)[_0x92e1('0x1d')](_0x3d8c39);}return null;};}function patchUpdates(_0x2fdfe4){return function(_0x4b54ef){try{jsonpatch[_0x92e1('0x22')](_0x4b54ef,_0x2fdfe4,!![]);}catch(_0xb555ae){return BPromise[_0x92e1('0x23')](_0xb555ae);}return _0x4b54ef[_0x92e1('0x24')]();};}function saveUpdates(_0x211aad,_0x2e1fdf){return function(_0x126416){if(_0x126416){return _0x126416['update'](_0x211aad)[_0x92e1('0x25')](function(_0x55b594){return _0x55b594;});}return null;};}function removeEntity(_0x3d0cee,_0x2623d3){return function(_0x3f2609){if(_0x3f2609){return _0x3f2609['destroy']()['then'](function(){_0x3d0cee[_0x92e1('0x1c')](0xcc)[_0x92e1('0x26')]();});}};}function handleEntityNotFound(_0x46712b,_0x414a35){return function(_0x5c99d1){if(!_0x5c99d1){_0x46712b[_0x92e1('0x1b')](0x194);}return _0x5c99d1;};}function handleError(_0x165c31,_0x51e7fd){_0x51e7fd=_0x51e7fd||0x1f4;return function(_0x4fbdf2){logger[_0x92e1('0x27')](_0x4fbdf2[_0x92e1('0x28')]);if(_0x4fbdf2[_0x92e1('0x29')]){delete _0x4fbdf2[_0x92e1('0x29')];}_0x165c31[_0x92e1('0x1c')](_0x51e7fd)[_0x92e1('0x2a')](_0x4fbdf2);};}exports[_0x92e1('0x2b')]=function(_0x30cd29,_0x26d468){var _0x11855f={},_0x1bae73={},_0x1be05e={'count':0x0,'rows':[]};var _0x1b0e0c=_['map'](db[_0x92e1('0x2c')][_0x92e1('0x2d')],function(_0x459513){return{'name':_0x459513['fieldName'],'type':_0x459513[_0x92e1('0x2e')][_0x92e1('0x2f')]};});_0x1bae73[_0x92e1('0x30')]=_['map'](_0x1b0e0c,_0x92e1('0x29'));_0x1bae73[_0x92e1('0x31')]=_[_0x92e1('0x32')](_0x30cd29['query']);_0x1bae73[_0x92e1('0x33')]=_[_0x92e1('0x34')](_0x1bae73[_0x92e1('0x30')],_0x1bae73['query']);_0x11855f[_0x92e1('0x35')]=_['intersection'](_0x1bae73['model'],qs['fields'](_0x30cd29[_0x92e1('0x31')][_0x92e1('0x36')]));_0x11855f[_0x92e1('0x35')]=_0x11855f[_0x92e1('0x35')]['length']?_0x11855f['attributes']:_0x1bae73['model'];if(!_0x30cd29[_0x92e1('0x31')]['hasOwnProperty'](_0x92e1('0x37'))){_0x11855f[_0x92e1('0x38')]=qs[_0x92e1('0x38')](_0x30cd29[_0x92e1('0x31')][_0x92e1('0x38')]);_0x11855f[_0x92e1('0x1e')]=qs[_0x92e1('0x1e')](_0x30cd29[_0x92e1('0x31')][_0x92e1('0x1e')]);}_0x11855f[_0x92e1('0x39')]=qs[_0x92e1('0x3a')](_0x30cd29['query']['sort']);_0x11855f[_0x92e1('0x3b')]=qs[_0x92e1('0x33')](_['pick'](_0x30cd29['query'],_0x1bae73[_0x92e1('0x33')]),_0x1b0e0c);if(_0x30cd29[_0x92e1('0x31')][_0x92e1('0x3c')]){_0x11855f[_0x92e1('0x3b')]=_[_0x92e1('0x3d')](_0x11855f[_0x92e1('0x3b')],{'$or':_[_0x92e1('0x3e')](_0x1b0e0c,function(_0x1e55ec){if(_0x1e55ec['type']!==_0x92e1('0x3f')){var _0x3e5c74={};_0x3e5c74[_0x1e55ec['name']]={'$like':'%'+_0x30cd29[_0x92e1('0x31')][_0x92e1('0x3c')]+'%'};return _0x3e5c74;}})});}_0x11855f=_[_0x92e1('0x3d')]({},_0x11855f,_0x30cd29[_0x92e1('0x40')]);var _0xde6bfc={'where':_0x11855f['where']};return db[_0x92e1('0x2c')][_0x92e1('0x20')](_0xde6bfc)[_0x92e1('0x25')](function(_0x4e2c61){_0x1be05e[_0x92e1('0x20')]=_0x4e2c61;if(_0x30cd29[_0x92e1('0x31')][_0x92e1('0x41')]){_0x11855f['include']=[{'all':!![]}];}return db[_0x92e1('0x2c')][_0x92e1('0x42')](_0x11855f);})[_0x92e1('0x25')](function(_0x32b851){_0x1be05e[_0x92e1('0x43')]=_0x32b851;return _0x1be05e;})[_0x92e1('0x25')](respondWithFilteredResult(_0x26d468,_0x11855f))[_0x92e1('0x44')](handleError(_0x26d468,null));};exports['show']=function(_0x3aef40,_0x5bf1c3){var _0xbe1dc9={'raw':!![],'where':{'id':_0x3aef40[_0x92e1('0x45')]['id']}},_0xa8faaf={};_0xa8faaf[_0x92e1('0x30')]=_[_0x92e1('0x32')](db[_0x92e1('0x2c')][_0x92e1('0x2d')]);_0xa8faaf[_0x92e1('0x31')]=_[_0x92e1('0x32')](_0x3aef40[_0x92e1('0x31')]);_0xa8faaf['filters']=_[_0x92e1('0x34')](_0xa8faaf[_0x92e1('0x30')],_0xa8faaf[_0x92e1('0x31')]);_0xbe1dc9[_0x92e1('0x35')]=_[_0x92e1('0x34')](_0xa8faaf[_0x92e1('0x30')],qs[_0x92e1('0x36')](_0x3aef40[_0x92e1('0x31')][_0x92e1('0x36')]));_0xbe1dc9['attributes']=_0xbe1dc9[_0x92e1('0x35')]['length']?_0xbe1dc9[_0x92e1('0x35')]:_0xa8faaf[_0x92e1('0x30')];if(_0x3aef40[_0x92e1('0x31')][_0x92e1('0x41')]){_0xbe1dc9[_0x92e1('0x46')]=[{'all':!![]}];}_0xbe1dc9=_[_0x92e1('0x3d')]({},_0xbe1dc9,_0x3aef40[_0x92e1('0x40')]);return db[_0x92e1('0x2c')][_0x92e1('0x47')](_0xbe1dc9)[_0x92e1('0x25')](handleEntityNotFound(_0x5bf1c3,null))['then'](respondWithResult(_0x5bf1c3,null))[_0x92e1('0x44')](handleError(_0x5bf1c3,null));};exports[_0x92e1('0x48')]=function(_0x4c1a90,_0x5abd13){return db[_0x92e1('0x2c')][_0x92e1('0x48')](_0x4c1a90[_0x92e1('0x49')],{})[_0x92e1('0x25')](respondWithResult(_0x5abd13,0xc9))['catch'](handleError(_0x5abd13,null));};exports['update']=function(_0x5bba85,_0x23eb87){if(_0x5bba85['body']['id']){delete _0x5bba85[_0x92e1('0x49')]['id'];}return db['FaxTransferReport'][_0x92e1('0x47')]({'where':{'id':_0x5bba85['params']['id']}})[_0x92e1('0x25')](handleEntityNotFound(_0x23eb87,null))[_0x92e1('0x25')](saveUpdates(_0x5bba85['body'],null))['then'](respondWithResult(_0x23eb87,null))['catch'](handleError(_0x23eb87,null));};exports[_0x92e1('0x4a')]=function(_0x2b8568,_0x32721b){return db[_0x92e1('0x2c')][_0x92e1('0x47')]({'where':{'id':_0x2b8568['params']['id']}})[_0x92e1('0x25')](handleEntityNotFound(_0x32721b,null))['then'](removeEntity(_0x32721b,null))[_0x92e1('0x44')](handleError(_0x32721b,null));};exports['describe']=function(_0x1b3212,_0xc49b2){return db[_0x92e1('0x2c')][_0x92e1('0x4b')]()[_0x92e1('0x25')](respondWithResult(_0xc49b2,null))[_0x92e1('0x44')](handleError(_0xc49b2,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 4f505ef..95251a0 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 _0x72a0=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer'];(function(_0x43d226,_0x898195){var _0xc3159d=function(_0x186624){while(--_0x186624){_0x43d226['push'](_0x43d226['shift']());}};_0xc3159d(++_0x898195);}(_0x72a0,0x194));var _0x072a=function(_0x407e4f,_0x151647){_0x407e4f=_0x407e4f-0x0;var _0xd7c489=_0x72a0[_0x407e4f];return _0xd7c489;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var logger=require(_0x072a('0x2'))(_0x072a('0x3'));var moment=require(_0x072a('0x4'));var BPromise=require(_0x072a('0x5'));var rp=require(_0x072a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x072a('0x7'));var config=require('../../config/environment');var attributes=require(_0x072a('0x8'));module['exports']=function(_0x23100f,_0x597fd9){return _0x23100f[_0x072a('0x9')](_0x072a('0xa'),attributes,{'tableName':_0x072a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x072a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x216c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxTransferReport','uniqueid','lodash','util'];(function(_0x456cbb,_0x547275){var _0x9c3a70=function(_0x1c8686){while(--_0x1c8686){_0x456cbb['push'](_0x456cbb['shift']());}};_0x9c3a70(++_0x547275);}(_0x216c,0xb4));var _0xc216=function(_0x85e1fb,_0x4ca682){_0x85e1fb=_0x85e1fb-0x0;var _0xbc071c=_0x216c[_0x85e1fb];return _0xbc071c;};'use strict';var _=require(_0xc216('0x0'));var util=require(_0xc216('0x1'));var logger=require(_0xc216('0x2'))(_0xc216('0x3'));var moment=require(_0xc216('0x4'));var BPromise=require(_0xc216('0x5'));var rp=require(_0xc216('0x6'));var fs=require('fs');var path=require(_0xc216('0x7'));var rimraf=require(_0xc216('0x8'));var config=require(_0xc216('0x9'));var attributes=require('./faxTransferReport.attributes');module[_0xc216('0xa')]=function(_0x198cdb,_0x187be7){return _0x198cdb['define'](_0xc216('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc216('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0583920..a0b9d6c 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 _0x40aa=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0x40aa,0x7b));var _0xa40a=function(_0x8b6f3,_0x94c494){_0x8b6f3=_0x8b6f3-0x0;var _0x38d34d=_0x40aa[_0x8b6f3];return _0x38d34d;};'use strict';var _=require(_0xa40a('0x0'));var util=require(_0xa40a('0x1'));var moment=require(_0xa40a('0x2'));var BPromise=require(_0xa40a('0x3'));var rs=require(_0xa40a('0x4'));var fs=require('fs');var Redis=require(_0xa40a('0x5'));var db=require(_0xa40a('0x6'))['db'];var utils=require(_0xa40a('0x7'));var logger=require(_0xa40a('0x8'))('rpc');var config=require(_0xa40a('0x9'));var jayson=require(_0xa40a('0xa'));var client=jayson[_0xa40a('0xb')][_0xa40a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24287e,_0xcea09f,_0x344ad4){return new BPromise(function(_0x2fab90,_0x2a11e5){return client[_0xa40a('0xd')](_0x24287e,_0x344ad4)[_0xa40a('0xe')](function(_0x27f326){logger['info'](_0xa40a('0xf'),_0xcea09f,_0xa40a('0x10'));logger[_0xa40a('0x11')](_0xa40a('0x12'),_0xcea09f,_0xa40a('0x10'),JSON['stringify'](_0x27f326));if(_0x27f326[_0xa40a('0x13')]){if(_0x27f326[_0xa40a('0x13')][_0xa40a('0x14')]===0x1f4){logger[_0xa40a('0x13')](_0xa40a('0xf'),_0xcea09f,_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);return _0x2a11e5(_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);}logger[_0xa40a('0x13')](_0xa40a('0xf'),_0xcea09f,_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);return _0x2fab90(_0x27f326[_0xa40a('0x13')][_0xa40a('0x15')]);}else{logger[_0xa40a('0x16')](_0xa40a('0xf'),_0xcea09f,_0xa40a('0x10'));_0x2fab90(_0x27f326[_0xa40a('0x17')][_0xa40a('0x15')]);}})['catch'](function(_0x14e383){logger['error'](_0xa40a('0xf'),_0xcea09f,_0x14e383);_0x2a11e5(_0x14e383);});});} \ No newline at end of file +var _0xf82b=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xf82b,0x9b));var _0xbf82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf82b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xbf82('0x0'));var moment=require(_0xbf82('0x1'));var BPromise=require(_0xbf82('0x2'));var rs=require(_0xbf82('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf82('0x5'))(_0xbf82('0x6'));var config=require(_0xbf82('0x7'));var jayson=require(_0xbf82('0x8'));var client=jayson[_0xbf82('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40b1a9,_0x54838a,_0x1553fd){return new BPromise(function(_0x379e93,_0x1cdc3a){return client[_0xbf82('0xa')](_0x40b1a9,_0x1553fd)['then'](function(_0xeb6305){logger['info'](_0xbf82('0xb'),_0x54838a,_0xbf82('0xc'));logger[_0xbf82('0xd')](_0xbf82('0xe'),_0x54838a,_0xbf82('0xc'),JSON[_0xbf82('0xf')](_0xeb6305));if(_0xeb6305[_0xbf82('0x10')]){if(_0xeb6305[_0xbf82('0x10')][_0xbf82('0x11')]===0x1f4){logger[_0xbf82('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x54838a,_0xeb6305[_0xbf82('0x10')][_0xbf82('0x12')]);return _0x1cdc3a(_0xeb6305['error'][_0xbf82('0x12')]);}logger[_0xbf82('0x10')](_0xbf82('0xb'),_0x54838a,_0xeb6305[_0xbf82('0x10')]['message']);return _0x379e93(_0xeb6305[_0xbf82('0x10')][_0xbf82('0x12')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x54838a,_0xbf82('0xc'));_0x379e93(_0xeb6305[_0xbf82('0x13')][_0xbf82('0x12')]);}})[_0xbf82('0x14')](function(_0x280759){logger[_0xbf82('0x10')](_0xbf82('0xb'),_0x54838a,_0x280759);_0x1cdc3a(_0x280759);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 38f9a33..affff49 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 _0xc905=['./faxTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x331e13,_0x124809){var _0x2e7034=function(_0x55e94c){while(--_0x55e94c){_0x331e13['push'](_0x331e13['shift']());}};_0x2e7034(++_0x124809);}(_0xc905,0x1c1));var _0x5c90=function(_0x1dd5d9,_0x1ef658){_0x1dd5d9=_0x1dd5d9-0x0;var _0x2e8fc1=_0xc905[_0x1dd5d9];return _0x2e8fc1;};'use strict';var multer=require(_0x5c90('0x0'));var util=require(_0x5c90('0x1'));var path=require(_0x5c90('0x2'));var timeout=require(_0x5c90('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5c90('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5c90('0x5'));var config=require(_0x5c90('0x6'));var controller=require(_0x5c90('0x7'));router['get']('/',auth[_0x5c90('0x8')](),controller[_0x5c90('0x9')]);router[_0x5c90('0xa')]('/describe',auth[_0x5c90('0x8')](),controller[_0x5c90('0xb')]);router[_0x5c90('0xa')](_0x5c90('0xc'),auth['isAuthenticated'](),controller[_0x5c90('0xd')]);router[_0x5c90('0xe')]('/',auth[_0x5c90('0x8')](),controller[_0x5c90('0xf')]);router['put'](_0x5c90('0xc'),auth[_0x5c90('0x8')](),controller[_0x5c90('0x10')]);router['delete'](_0x5c90('0xc'),auth[_0x5c90('0x8')](),controller[_0x5c90('0x11')]);module[_0x5c90('0x12')]=router; \ No newline at end of file +var _0xf043=['isAuthenticated','index','get','/describe','/:id','post','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x2e0ced,_0x2d02d5){var _0x3390e6=function(_0x2237af){while(--_0x2237af){_0x2e0ced['push'](_0x2e0ced['shift']());}};_0x3390e6(++_0x2d02d5);}(_0xf043,0x14d));var _0x3f04=function(_0x104021,_0x1a3217){_0x104021=_0x104021-0x0;var _0x5c2290=_0xf043[_0x104021];return _0x5c2290;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3f04('0x0'));var timeout=require(_0x3f04('0x1'));var express=require(_0x3f04('0x2'));var router=express[_0x3f04('0x3')]();var fs_extra=require(_0x3f04('0x4'));var auth=require(_0x3f04('0x5'));var interaction=require(_0x3f04('0x6'));var config=require(_0x3f04('0x7'));var controller=require(_0x3f04('0x8'));router['get']('/',auth[_0x3f04('0x9')](),controller[_0x3f04('0xa')]);router[_0x3f04('0xb')](_0x3f04('0xc'),auth[_0x3f04('0x9')](),controller['describe']);router[_0x3f04('0xb')](_0x3f04('0xd'),auth[_0x3f04('0x9')](),controller['show']);router[_0x3f04('0xe')]('/',auth[_0x3f04('0x9')](),controller['create']);router[_0x3f04('0xf')](_0x3f04('0xd'),auth[_0x3f04('0x9')](),controller[_0x3f04('0x10')]);router['delete'](_0x3f04('0xd'),auth['isAuthenticated'](),controller[_0x3f04('0x11')]);module[_0x3f04('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f58c720..934df72 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 _0xf9b0=['getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xf9b0,0x1e8));var _0x0f9b=function(_0x6e0ac3,_0xb0ad99){_0x6e0ac3=_0x6e0ac3-0x0;var _0x381be3=_0xf9b0[_0x6e0ac3];return _0x381be3;};'use strict';var multer=require(_0x0f9b('0x0'));var util=require(_0x0f9b('0x1'));var path=require(_0x0f9b('0x2'));var timeout=require(_0x0f9b('0x3'));var express=require(_0x0f9b('0x4'));var router=express['Router']();var fs_extra=require(_0x0f9b('0x5'));var auth=require(_0x0f9b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0f9b('0x7'));var controller=require(_0x0f9b('0x8'));router[_0x0f9b('0x9')]('/',auth[_0x0f9b('0xa')](),controller[_0x0f9b('0xb')]);router[_0x0f9b('0x9')](_0x0f9b('0xc'),auth[_0x0f9b('0xa')](),controller[_0x0f9b('0xd')]);router[_0x0f9b('0x9')](_0x0f9b('0xe'),auth[_0x0f9b('0xa')](),controller[_0x0f9b('0xf')]);router[_0x0f9b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0f9b('0x10')]);router['post']('/',auth[_0x0f9b('0xa')](),controller['create']);router[_0x0f9b('0x11')](_0x0f9b('0xe'),auth['isAuthenticated'](),controller[_0x0f9b('0x12')]);router[_0x0f9b('0x13')](_0x0f9b('0xc'),auth['isAuthenticated'](),controller[_0x0f9b('0x14')]);router[_0x0f9b('0x15')](_0x0f9b('0xc'),auth[_0x0f9b('0xa')](),controller[_0x0f9b('0x16')]);module[_0x0f9b('0x17')]=router; \ No newline at end of file +var _0x121a=['update','delete','util','path','connect-timeout','fs-extra','../../components/auth/service','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration'];(function(_0x2e11d3,_0x26a29a){var _0x3f7f7f=function(_0x3c43f1){while(--_0x3c43f1){_0x2e11d3['push'](_0x2e11d3['shift']());}};_0x3f7f7f(++_0x26a29a);}(_0x121a,0x182));var _0xa121=function(_0x18836f,_0x4fd6d6){_0x18836f=_0x18836f-0x0;var _0x5bd3b4=_0x121a[_0x18836f];return _0x5bd3b4;};'use strict';var multer=require('multer');var util=require(_0xa121('0x0'));var path=require(_0xa121('0x1'));var timeout=require(_0xa121('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa121('0x3'));var auth=require(_0xa121('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa121('0x5'));router[_0xa121('0x6')]('/',auth[_0xa121('0x7')](),controller['index']);router['get'](_0xa121('0x8'),auth['isAuthenticated'](),controller[_0xa121('0x9')]);router[_0xa121('0x6')](_0xa121('0xa'),auth[_0xa121('0x7')](),controller['getConfigurations']);router[_0xa121('0x6')](_0xa121('0xb'),auth[_0xa121('0x7')](),controller['getFields']);router['post']('/',auth[_0xa121('0x7')](),controller['create']);router[_0xa121('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa121('0xd')]);router['put']('/:id',auth[_0xa121('0x7')](),controller[_0xa121('0xe')]);router[_0xa121('0xf')]('/:id',auth[_0xa121('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 73b5e27..cba582f 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 _0x0a48=['basic','newTab','integrationTab','exports','STRING','ENUM'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0a48,0x19b));var _0x80a4=function(_0x514989,_0x2437bb){_0x514989=_0x514989-0x0;var _0x132218=_0x0a48[_0x514989];return _0x132218;};'use strict';var Sequelize=require('sequelize');module[_0x80a4('0x0')]={'name':{'type':Sequelize[_0x80a4('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x80a4('0x1')]},'remoteUri':{'type':Sequelize[_0x80a4('0x1')]},'authType':{'type':Sequelize[_0x80a4('0x2')](_0x80a4('0x3')),'defaultValue':_0x80a4('0x3')},'password':{'type':Sequelize[_0x80a4('0x1')]},'consumerKey':{'type':Sequelize[_0x80a4('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x80a4('0x1')]},'tokenSecret':{'type':Sequelize[_0x80a4('0x1')]},'serverUrl':{'type':Sequelize[_0x80a4('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x80a4('0x4')),'defaultValue':_0x80a4('0x5')}}; \ No newline at end of file +var _0xfbf5=['basic','integrationTab','newTab','sequelize','STRING','ENUM'];(function(_0x25495f,_0x33d201){var _0xbf083e=function(_0x2bf395){while(--_0x2bf395){_0x25495f['push'](_0x25495f['shift']());}};_0xbf083e(++_0x33d201);}(_0xfbf5,0x17d));var _0x5fbf=function(_0x9efe2,_0x18328c){_0x9efe2=_0x9efe2-0x0;var _0x2eafe5=_0xfbf5[_0x9efe2];return _0x2eafe5;};'use strict';var Sequelize=require(_0x5fbf('0x0'));module['exports']={'name':{'type':Sequelize[_0x5fbf('0x1')]},'description':{'type':Sequelize[_0x5fbf('0x1')]},'username':{'type':Sequelize[_0x5fbf('0x1')]},'remoteUri':{'type':Sequelize[_0x5fbf('0x1')]},'authType':{'type':Sequelize[_0x5fbf('0x2')](_0x5fbf('0x3')),'defaultValue':_0x5fbf('0x3')},'password':{'type':Sequelize[_0x5fbf('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x5fbf('0x1')]},'token':{'type':Sequelize[_0x5fbf('0x1')]},'tokenSecret':{'type':Sequelize[_0x5fbf('0x1')]},'serverUrl':{'type':Sequelize[_0x5fbf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5fbf('0x2')](_0x5fbf('0x4'),_0x5fbf('0x5')),'defaultValue':_0x5fbf('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8413ed4..1171e60 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 _0x01e4=['order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','catch','create','body','params','destroy','getConfigurations','DeskConfiguration','pick','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','model','query','intersection','attributes','fields','length','nolimit'];(function(_0x4b839d,_0x4c1a4a){var _0x1ac602=function(_0x3ee5c9){while(--_0x3ee5c9){_0x4b839d['push'](_0x4b839d['shift']());}};_0x1ac602(++_0x4c1a4a);}(_0x01e4,0x18e));var _0x401e=function(_0x1a809c,_0x199a58){_0x1a809c=_0x1a809c-0x0;var _0x533174=_0x01e4[_0x1a809c];return _0x533174;};'use strict';var emlformat=require(_0x401e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x401e('0x1'));var jsonpatch=require(_0x401e('0x2'));var rp=require('request-promise');var moment=require(_0x401e('0x3'));var BPromise=require(_0x401e('0x4'));var Mustache=require(_0x401e('0x5'));var util=require('util');var path=require(_0x401e('0x6'));var sox=require(_0x401e('0x7'));var csv=require('to-csv');var ejs=require(_0x401e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x401e('0x9'));var squel=require(_0x401e('0xa'));var crypto=require('crypto');var jsforce=require(_0x401e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x401e('0xc'));var querystring=require(_0x401e('0xd'));var Papa=require('papaparse');var Redis=require(_0x401e('0xe'));var authService=require(_0x401e('0xf'));var qs=require(_0x401e('0x10'));var as=require(_0x401e('0x11'));var hardwareService=require(_0x401e('0x12'));var logger=require(_0x401e('0x13'))(_0x401e('0x14'));var utils=require(_0x401e('0x15'));var config=require(_0x401e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x401e('0x17'))['db'];var integrations=require(_0x401e('0x18'));function respondWithStatusCode(_0x3f361a,_0x9ba460){_0x9ba460=_0x9ba460||0xcc;return function(_0x31ed81){if(_0x31ed81){return _0x3f361a[_0x401e('0x19')](_0x9ba460);}return _0x3f361a[_0x401e('0x1a')](_0x9ba460)['end']();};}function respondWithResult(_0x2fcd81,_0x1ad63e){_0x1ad63e=_0x1ad63e||0xc8;return function(_0x31319b){if(_0x31319b){return _0x2fcd81[_0x401e('0x1a')](_0x1ad63e)['json'](_0x31319b);}};}function respondWithFilteredResult(_0x490d4b,_0x2572b9){return function(_0x299b99){if(_0x299b99){var _0x2d4a94=typeof _0x2572b9[_0x401e('0x1b')]===_0x401e('0x1c')&&typeof _0x2572b9[_0x401e('0x1d')]===_0x401e('0x1c');var _0x1f36da=_0x299b99[_0x401e('0x1e')];var _0x358eb6=_0x2d4a94?0x0:_0x2572b9[_0x401e('0x1b')];var _0x60e764=_0x2d4a94?_0x299b99[_0x401e('0x1e')]:_0x2572b9['offset']+_0x2572b9[_0x401e('0x1d')];var _0x4d4cdc;if(_0x60e764>=_0x1f36da){_0x60e764=_0x1f36da;_0x4d4cdc=0xc8;}else{_0x4d4cdc=0xce;}_0x490d4b[_0x401e('0x1a')](_0x4d4cdc);return _0x490d4b[_0x401e('0x1f')](_0x401e('0x20'),_0x358eb6+'-'+_0x60e764+'/'+_0x1f36da)['json'](_0x299b99);}return null;};}function patchUpdates(_0x1e71e4){return function(_0x4c828a){try{jsonpatch[_0x401e('0x21')](_0x4c828a,_0x1e71e4,!![]);}catch(_0x1f16c6){return BPromise[_0x401e('0x22')](_0x1f16c6);}return _0x4c828a[_0x401e('0x23')]();};}function saveUpdates(_0x38eb2c,_0x151d5d){return function(_0x2e185c){if(_0x2e185c){return _0x2e185c[_0x401e('0x24')](_0x38eb2c)[_0x401e('0x25')](function(_0x4439c9){return _0x4439c9;});}return null;};}function removeEntity(_0x2f5938,_0x57c71f){return function(_0x52ef45){if(_0x52ef45){return _0x52ef45['destroy']()[_0x401e('0x25')](function(){_0x2f5938[_0x401e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de87d,_0x16b0ee){return function(_0x308056){if(!_0x308056){_0x5de87d['sendStatus'](0x194);}return _0x308056;};}function handleError(_0x8581b0,_0x55579b){_0x55579b=_0x55579b||0x1f4;return function(_0x119681){logger[_0x401e('0x26')](_0x119681[_0x401e('0x27')]);if(_0x119681[_0x401e('0x28')]){delete _0x119681[_0x401e('0x28')];}_0x8581b0['status'](_0x55579b)[_0x401e('0x29')](_0x119681);};}exports[_0x401e('0x2a')]=function(_0x209a25,_0x45d82b){var _0x2d587a={},_0x361421={},_0x4ad854={'count':0x0,'rows':[]};var _0x14ddef=_[_0x401e('0x2b')](db[_0x401e('0x2c')][_0x401e('0x2d')],function(_0x51cb3e){return{'name':_0x51cb3e['fieldName'],'type':_0x51cb3e[_0x401e('0x2e')]['key']};});_0x361421[_0x401e('0x2f')]=_['map'](_0x14ddef,_0x401e('0x28'));_0x361421[_0x401e('0x30')]=_['keys'](_0x209a25[_0x401e('0x30')]);_0x361421['filters']=_[_0x401e('0x31')](_0x361421['model'],_0x361421['query']);_0x2d587a[_0x401e('0x32')]=_[_0x401e('0x31')](_0x361421['model'],qs[_0x401e('0x33')](_0x209a25['query'][_0x401e('0x33')]));_0x2d587a[_0x401e('0x32')]=_0x2d587a[_0x401e('0x32')][_0x401e('0x34')]?_0x2d587a['attributes']:_0x361421[_0x401e('0x2f')];if(!_0x209a25[_0x401e('0x30')]['hasOwnProperty'](_0x401e('0x35'))){_0x2d587a[_0x401e('0x1d')]=qs[_0x401e('0x1d')](_0x209a25[_0x401e('0x30')][_0x401e('0x1d')]);_0x2d587a[_0x401e('0x1b')]=qs[_0x401e('0x1b')](_0x209a25[_0x401e('0x30')][_0x401e('0x1b')]);}_0x2d587a[_0x401e('0x36')]=qs['sort'](_0x209a25['query'][_0x401e('0x37')]);_0x2d587a[_0x401e('0x38')]=qs[_0x401e('0x39')](_['pick'](_0x209a25['query'],_0x361421[_0x401e('0x39')]),_0x14ddef);if(_0x209a25[_0x401e('0x30')][_0x401e('0x3a')]){_0x2d587a[_0x401e('0x38')]=_[_0x401e('0x3b')](_0x2d587a[_0x401e('0x38')],{'$or':_[_0x401e('0x2b')](_0x14ddef,function(_0x12ef49){if(_0x12ef49[_0x401e('0x2e')]!==_0x401e('0x3c')){var _0x5af896={};_0x5af896[_0x12ef49[_0x401e('0x28')]]={'$like':'%'+_0x209a25[_0x401e('0x30')]['filter']+'%'};return _0x5af896;}})});}_0x2d587a=_[_0x401e('0x3b')]({},_0x2d587a,_0x209a25[_0x401e('0x3d')]);var _0x9bae3a={'where':_0x2d587a[_0x401e('0x38')]};return db[_0x401e('0x2c')]['count'](_0x9bae3a)['then'](function(_0x3fbb59){_0x4ad854[_0x401e('0x1e')]=_0x3fbb59;if(_0x209a25[_0x401e('0x30')][_0x401e('0x3e')]){_0x2d587a[_0x401e('0x3f')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x2d587a);})[_0x401e('0x25')](function(_0x4c0fef){_0x4ad854[_0x401e('0x40')]=_0x4c0fef;return _0x4ad854;})[_0x401e('0x25')](respondWithFilteredResult(_0x45d82b,_0x2d587a))['catch'](handleError(_0x45d82b,null));};exports[_0x401e('0x41')]=function(_0x599079,_0x5d4b3f){var _0x21505a={'raw':![],'where':{'id':_0x599079['params']['id']}},_0x331c00={};_0x331c00[_0x401e('0x2f')]=_[_0x401e('0x42')](db[_0x401e('0x2c')][_0x401e('0x2d')]);_0x331c00['query']=_[_0x401e('0x42')](_0x599079[_0x401e('0x30')]);_0x331c00[_0x401e('0x39')]=_['intersection'](_0x331c00['model'],_0x331c00[_0x401e('0x30')]);_0x21505a[_0x401e('0x32')]=_['intersection'](_0x331c00[_0x401e('0x2f')],qs['fields'](_0x599079['query']['fields']));_0x21505a[_0x401e('0x32')]=_0x21505a[_0x401e('0x32')][_0x401e('0x34')]?_0x21505a[_0x401e('0x32')]:_0x331c00[_0x401e('0x2f')];if(_0x599079[_0x401e('0x30')][_0x401e('0x3e')]){_0x21505a[_0x401e('0x3f')]=[{'all':!![]}];}_0x21505a=_[_0x401e('0x3b')]({},_0x21505a,_0x599079['options']);return db[_0x401e('0x2c')][_0x401e('0x43')](_0x21505a)['then'](handleEntityNotFound(_0x5d4b3f,null))['then'](respondWithResult(_0x5d4b3f,null))[_0x401e('0x44')](handleError(_0x5d4b3f,null));};exports['create']=function(_0x15fc73,_0x43d6fc){return db[_0x401e('0x2c')][_0x401e('0x45')](_0x15fc73[_0x401e('0x46')],{})['then'](respondWithResult(_0x43d6fc,0xc9))[_0x401e('0x44')](handleError(_0x43d6fc,null));};exports[_0x401e('0x24')]=function(_0x4d7504,_0xd838c5){if(_0x4d7504[_0x401e('0x46')]['id']){delete _0x4d7504[_0x401e('0x46')]['id'];}return db[_0x401e('0x2c')][_0x401e('0x43')]({'where':{'id':_0x4d7504[_0x401e('0x47')]['id']}})['then'](handleEntityNotFound(_0xd838c5,null))['then'](saveUpdates(_0x4d7504['body'],null))[_0x401e('0x25')](respondWithResult(_0xd838c5,null))[_0x401e('0x44')](handleError(_0xd838c5,null));};exports[_0x401e('0x48')]=function(_0x211132,_0x235058){return db[_0x401e('0x2c')][_0x401e('0x43')]({'where':{'id':_0x211132[_0x401e('0x47')]['id']}})[_0x401e('0x25')](handleEntityNotFound(_0x235058,null))[_0x401e('0x25')](removeEntity(_0x235058,null))[_0x401e('0x44')](handleError(_0x235058,null));};exports[_0x401e('0x49')]=function(_0x1eaeed,_0x57a7c5,_0x521974){var _0x458d1c={};var _0x51f1c2={};var _0x422604;var _0x512f08;return db['DeskAccount']['findOne']({'where':{'id':_0x1eaeed[_0x401e('0x47')]['id']}})['then'](handleEntityNotFound(_0x57a7c5,null))['then'](function(_0x118710){if(_0x118710){_0x422604=_0x118710;_0x51f1c2[_0x401e('0x2f')]=_['keys'](db[_0x401e('0x4a')][_0x401e('0x2d')]);_0x51f1c2['query']=_[_0x401e('0x42')](_0x1eaeed[_0x401e('0x30')]);_0x51f1c2[_0x401e('0x39')]=_[_0x401e('0x31')](_0x51f1c2[_0x401e('0x2f')],_0x51f1c2[_0x401e('0x30')]);_0x458d1c['attributes']=_[_0x401e('0x31')](_0x51f1c2[_0x401e('0x2f')],qs[_0x401e('0x33')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x33')]));_0x458d1c[_0x401e('0x32')]=_0x458d1c[_0x401e('0x32')]['length']?_0x458d1c[_0x401e('0x32')]:_0x51f1c2['model'];_0x458d1c[_0x401e('0x36')]=qs[_0x401e('0x37')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x37')]);_0x458d1c[_0x401e('0x38')]=qs[_0x401e('0x39')](_[_0x401e('0x4b')](_0x1eaeed['query'],_0x51f1c2[_0x401e('0x39')]));if(_0x1eaeed[_0x401e('0x30')][_0x401e('0x3a')]){_0x458d1c[_0x401e('0x38')]=_[_0x401e('0x3b')](_0x458d1c[_0x401e('0x38')],{'$or':_['map'](_0x458d1c[_0x401e('0x32')],function(_0x401598){var _0x18e53c={};_0x18e53c[_0x401598]={'$like':'%'+_0x1eaeed['query'][_0x401e('0x3a')]+'%'};return _0x18e53c;})});}_0x458d1c=_[_0x401e('0x3b')]({},_0x458d1c,_0x1eaeed['options']);return _0x422604[_0x401e('0x49')](_0x458d1c);}})[_0x401e('0x25')](function(_0x4532b8){if(_0x4532b8){_0x512f08=_0x4532b8[_0x401e('0x34')];if(!_0x1eaeed['query']['hasOwnProperty']('nolimit')){_0x458d1c['limit']=qs[_0x401e('0x1d')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x1d')]);_0x458d1c[_0x401e('0x1b')]=qs[_0x401e('0x1b')](_0x1eaeed[_0x401e('0x30')][_0x401e('0x1b')]);}return _0x422604[_0x401e('0x49')](_0x458d1c);}})[_0x401e('0x25')](function(_0x107fb1){if(_0x107fb1){return _0x107fb1?{'count':_0x512f08,'rows':_0x107fb1}:null;}})[_0x401e('0x25')](respondWithResult(_0x57a7c5,null))['catch'](handleError(_0x57a7c5,null));};exports[_0x401e('0x4c')]=function(_0x45f667,_0x89991,_0x3bd33e){if(_0x45f667['body']['id']){delete _0x45f667[_0x401e('0x46')]['id'];}return db[_0x401e('0x2c')][_0x401e('0x4d')]({'where':{'id':_0x45f667['params']['id']}})['then'](handleEntityNotFound(_0x89991,null))[_0x401e('0x25')](function(_0xace752){if(_0xace752){_0x45f667[_0x401e('0x46')][_0x401e('0x4e')]=_0xace752['id'];_0x45f667[_0x401e('0x46')]['Subjects']=integrations['getSubjects'](_0x45f667[_0x401e('0x46')][_0x401e('0x4f')],_0x45f667[_0x401e('0x46')][_0x401e('0x2e')]);_0x45f667[_0x401e('0x46')][_0x401e('0x50')]=integrations[_0x401e('0x51')](_0x45f667[_0x401e('0x46')]['channel'],_0x45f667[_0x401e('0x46')][_0x401e('0x2e')]);return db[_0x401e('0x4a')][_0x401e('0x45')](_0x45f667[_0x401e('0x46')],{'include':[{'model':db[_0x401e('0x52')],'as':_0x401e('0x53')},{'model':db[_0x401e('0x52')],'as':_0x401e('0x50')}]});}return null;})['then'](respondWithResult(_0x89991,null))[_0x401e('0x44')](handleError(_0x89991,null));};exports[_0x401e('0x54')]=function(_0x4dad30,_0x1ec5c9,_0x56fb9f){var _0x512f8b=[{'name':_0x401e('0x55'),'label':_0x401e('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 _0x444d21='';return db[_0x401e('0x2c')]['findOne']({'where':{'id':_0x4dad30[_0x401e('0x47')]['id']},'attributes':['id',_0x401e('0x56'),_0x401e('0x57'),_0x401e('0x58'),'password',_0x401e('0x59'),_0x401e('0x5a'),_0x401e('0x5b'),_0x401e('0x5c')]})['then'](handleEntityNotFound(_0x1ec5c9,null))[_0x401e('0x25')](function(_0x580642){if(_0x580642){_0x444d21=_0x580642[_0x401e('0x56')];var _0x497d9e=_0x444d21[_0x401e('0x5d')](-0x1);if(_0x497d9e==='/'){_0x444d21=_0x444d21[_0x401e('0x5e')](0x0,_0x444d21['lastIndexOf'](_0x497d9e));}var _0x24ae4f={'method':_0x401e('0x5f'),'uri':util[_0x401e('0x60')]('%s/custom_fields',_0x444d21),'headers':{'Content-Type':_0x401e('0x61'),'Accept':_0x401e('0x61')},'json':!![]};if(_0x580642['authType']===_0x401e('0x62')){_0x24ae4f['headers'][_0x401e('0x63')]=util[_0x401e('0x60')](_0x401e('0x64'),new Buffer(util[_0x401e('0x60')](_0x401e('0x65'),_0x580642[_0x401e('0x58')],_0x580642[_0x401e('0x66')]))[_0x401e('0x67')](_0x401e('0x68')));}return rp(_0x24ae4f)[_0x401e('0x25')](function(_0x5a8a17){return _0x512f8b[_0x401e('0x69')](_[_0x401e('0x2b')](_0x5a8a17['_embedded'][_0x401e('0x6a')],function(_0x118823){return{'id':_0x118823['name'],'name':_0x118823[_0x401e('0x28')],'type':_0x118823[_0x401e('0x2e')],'active':_0x118823[_0x401e('0x6b')],'label':_0x118823['label'],'custom':!![]};}));});}})[_0x401e('0x25')](function(_0x28707e){return{'count':_0x28707e[_0x401e('0x34')],'rows':_0x28707e};})[_0x401e('0x25')](respondWithResult(_0x1ec5c9,null))['catch'](function(_0x1306c7){var _0x28a3e3=_0x4dad30['query'][_0x401e('0x6c')]?0x1f4:_0x1306c7[_0x401e('0x6d')]||0x1f4;logger['error'](_0x401e('0x6e'),_0x401e('0x54'),_0x28a3e3,JSON[_0x401e('0x6f')](_0x1306c7));delete _0x1306c7[_0x401e('0x28')];if(_0x28a3e3===0x191){_0x28a3e3=0x190;}_0x1ec5c9[_0x401e('0x1a')](_0x28a3e3)[_0x401e('0x29')](_0x4dad30[_0x401e('0x30')][_0x401e('0x6c')]?{'message':_0x401e('0x70'),'statusCode':_0x1306c7[_0x401e('0x6d')]}:_0x1306c7);});}; \ No newline at end of file +var _0xdefc=['DeskField','getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','base64','_embedded','entries','label','test','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','end','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','channel','DeskConfiguration'];(function(_0x622f4b,_0x37ec98){var _0x5287b7=function(_0x1df0af){while(--_0x1df0af){_0x622f4b['push'](_0x622f4b['shift']());}};_0x5287b7(++_0x37ec98);}(_0xdefc,0x15c));var _0xcdef=function(_0x78929c,_0x529d2f){_0x78929c=_0x78929c-0x0;var _0x1c1c5c=_0xdefc[_0x78929c];return _0x1c1c5c;};'use strict';var emlformat=require(_0xcdef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdef('0x2'));var BPromise=require(_0xcdef('0x3'));var Mustache=require('mustache');var util=require(_0xcdef('0x4'));var path=require(_0xcdef('0x5'));var sox=require(_0xcdef('0x6'));var csv=require(_0xcdef('0x7'));var ejs=require(_0xcdef('0x8'));var fs=require('fs');var fs_extra=require(_0xcdef('0x9'));var _=require(_0xcdef('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcdef('0x7'));var querystring=require(_0xcdef('0xb'));var Papa=require(_0xcdef('0xc'));var Redis=require(_0xcdef('0xd'));var authService=require(_0xcdef('0xe'));var qs=require(_0xcdef('0xf'));var as=require(_0xcdef('0x10'));var hardwareService=require(_0xcdef('0x11'));var logger=require(_0xcdef('0x12'))(_0xcdef('0x13'));var utils=require(_0xcdef('0x14'));var config=require(_0xcdef('0x15'));var licenseUtil=require(_0xcdef('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcdef('0x17'));function respondWithStatusCode(_0x5c3631,_0x995565){_0x995565=_0x995565||0xcc;return function(_0x1bbcd9){if(_0x1bbcd9){return _0x5c3631[_0xcdef('0x18')](_0x995565);}return _0x5c3631[_0xcdef('0x19')](_0x995565)['end']();};}function respondWithResult(_0x5e1b10,_0x2fc890){_0x2fc890=_0x2fc890||0xc8;return function(_0x59dea5){if(_0x59dea5){return _0x5e1b10[_0xcdef('0x19')](_0x2fc890)[_0xcdef('0x1a')](_0x59dea5);}};}function respondWithFilteredResult(_0x3c9010,_0x40add5){return function(_0x34216f){if(_0x34216f){var _0x1bf22c=typeof _0x40add5[_0xcdef('0x1b')]===_0xcdef('0x1c')&&typeof _0x40add5[_0xcdef('0x1d')]==='undefined';var _0x307185=_0x34216f[_0xcdef('0x1e')];var _0x4b24b5=_0x1bf22c?0x0:_0x40add5['offset'];var _0x7e41cd=_0x1bf22c?_0x34216f[_0xcdef('0x1e')]:_0x40add5[_0xcdef('0x1b')]+_0x40add5['limit'];var _0x55070f;if(_0x7e41cd>=_0x307185){_0x7e41cd=_0x307185;_0x55070f=0xc8;}else{_0x55070f=0xce;}_0x3c9010[_0xcdef('0x19')](_0x55070f);return _0x3c9010['set'](_0xcdef('0x1f'),_0x4b24b5+'-'+_0x7e41cd+'/'+_0x307185)[_0xcdef('0x1a')](_0x34216f);}return null;};}function patchUpdates(_0x3e19a9){return function(_0x12b07d){try{jsonpatch[_0xcdef('0x20')](_0x12b07d,_0x3e19a9,!![]);}catch(_0x5e4bca){return BPromise['reject'](_0x5e4bca);}return _0x12b07d[_0xcdef('0x21')]();};}function saveUpdates(_0x2da779,_0x5a9621){return function(_0x1a465b){if(_0x1a465b){return _0x1a465b['update'](_0x2da779)['then'](function(_0x155431){return _0x155431;});}return null;};}function removeEntity(_0x30474d,_0x4bdad8){return function(_0xf8ccaf){if(_0xf8ccaf){return _0xf8ccaf[_0xcdef('0x22')]()[_0xcdef('0x23')](function(){_0x30474d['status'](0xcc)[_0xcdef('0x24')]();});}};}function handleEntityNotFound(_0x706e15,_0x37fe97){return function(_0x5eea2b){if(!_0x5eea2b){_0x706e15['sendStatus'](0x194);}return _0x5eea2b;};}function handleError(_0x2fe68b,_0x45f83c){_0x45f83c=_0x45f83c||0x1f4;return function(_0x10b36e){logger[_0xcdef('0x25')](_0x10b36e[_0xcdef('0x26')]);if(_0x10b36e[_0xcdef('0x27')]){delete _0x10b36e[_0xcdef('0x27')];}_0x2fe68b[_0xcdef('0x19')](_0x45f83c)[_0xcdef('0x28')](_0x10b36e);};}exports['index']=function(_0x5e4061,_0x980362){var _0x159c90={},_0x18e7a={},_0x2a9af4={'count':0x0,'rows':[]};var _0x4c444e=_[_0xcdef('0x29')](db[_0xcdef('0x2a')][_0xcdef('0x2b')],function(_0x45c964){return{'name':_0x45c964[_0xcdef('0x2c')],'type':_0x45c964[_0xcdef('0x2d')][_0xcdef('0x2e')]};});_0x18e7a[_0xcdef('0x2f')]=_[_0xcdef('0x29')](_0x4c444e,_0xcdef('0x27'));_0x18e7a['query']=_[_0xcdef('0x30')](_0x5e4061['query']);_0x18e7a[_0xcdef('0x31')]=_[_0xcdef('0x32')](_0x18e7a[_0xcdef('0x2f')],_0x18e7a[_0xcdef('0x33')]);_0x159c90[_0xcdef('0x34')]=_['intersection'](_0x18e7a['model'],qs[_0xcdef('0x35')](_0x5e4061[_0xcdef('0x33')][_0xcdef('0x35')]));_0x159c90[_0xcdef('0x34')]=_0x159c90[_0xcdef('0x34')][_0xcdef('0x36')]?_0x159c90[_0xcdef('0x34')]:_0x18e7a[_0xcdef('0x2f')];if(!_0x5e4061[_0xcdef('0x33')][_0xcdef('0x37')](_0xcdef('0x38'))){_0x159c90['limit']=qs[_0xcdef('0x1d')](_0x5e4061[_0xcdef('0x33')][_0xcdef('0x1d')]);_0x159c90[_0xcdef('0x1b')]=qs[_0xcdef('0x1b')](_0x5e4061[_0xcdef('0x33')][_0xcdef('0x1b')]);}_0x159c90['order']=qs[_0xcdef('0x39')](_0x5e4061[_0xcdef('0x33')][_0xcdef('0x39')]);_0x159c90['where']=qs[_0xcdef('0x31')](_['pick'](_0x5e4061[_0xcdef('0x33')],_0x18e7a[_0xcdef('0x31')]),_0x4c444e);if(_0x5e4061['query'][_0xcdef('0x3a')]){_0x159c90['where']=_[_0xcdef('0x3b')](_0x159c90[_0xcdef('0x3c')],{'$or':_[_0xcdef('0x29')](_0x4c444e,function(_0x3915da){if(_0x3915da['type']!==_0xcdef('0x3d')){var _0x455164={};_0x455164[_0x3915da['name']]={'$like':'%'+_0x5e4061['query'][_0xcdef('0x3a')]+'%'};return _0x455164;}})});}_0x159c90=_[_0xcdef('0x3b')]({},_0x159c90,_0x5e4061[_0xcdef('0x3e')]);var _0x1e0d8c={'where':_0x159c90[_0xcdef('0x3c')]};return db[_0xcdef('0x2a')][_0xcdef('0x1e')](_0x1e0d8c)['then'](function(_0x1d987d){_0x2a9af4[_0xcdef('0x1e')]=_0x1d987d;if(_0x5e4061[_0xcdef('0x33')][_0xcdef('0x3f')]){_0x159c90[_0xcdef('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0xcdef('0x41')](_0x159c90);})[_0xcdef('0x23')](function(_0x3834df){_0x2a9af4['rows']=_0x3834df;return _0x2a9af4;})[_0xcdef('0x23')](respondWithFilteredResult(_0x980362,_0x159c90))[_0xcdef('0x42')](handleError(_0x980362,null));};exports[_0xcdef('0x43')]=function(_0x36bb07,_0x28c2f7){var _0x22aa2b={'raw':![],'where':{'id':_0x36bb07[_0xcdef('0x44')]['id']}},_0x58ffd7={};_0x58ffd7[_0xcdef('0x2f')]=_[_0xcdef('0x30')](db[_0xcdef('0x2a')][_0xcdef('0x2b')]);_0x58ffd7[_0xcdef('0x33')]=_[_0xcdef('0x30')](_0x36bb07[_0xcdef('0x33')]);_0x58ffd7['filters']=_[_0xcdef('0x32')](_0x58ffd7[_0xcdef('0x2f')],_0x58ffd7['query']);_0x22aa2b[_0xcdef('0x34')]=_[_0xcdef('0x32')](_0x58ffd7['model'],qs['fields'](_0x36bb07[_0xcdef('0x33')][_0xcdef('0x35')]));_0x22aa2b['attributes']=_0x22aa2b[_0xcdef('0x34')][_0xcdef('0x36')]?_0x22aa2b[_0xcdef('0x34')]:_0x58ffd7[_0xcdef('0x2f')];if(_0x36bb07[_0xcdef('0x33')][_0xcdef('0x3f')]){_0x22aa2b[_0xcdef('0x40')]=[{'all':!![]}];}_0x22aa2b=_[_0xcdef('0x3b')]({},_0x22aa2b,_0x36bb07[_0xcdef('0x3e')]);return db['DeskAccount'][_0xcdef('0x45')](_0x22aa2b)[_0xcdef('0x23')](handleEntityNotFound(_0x28c2f7,null))[_0xcdef('0x23')](respondWithResult(_0x28c2f7,null))['catch'](handleError(_0x28c2f7,null));};exports[_0xcdef('0x46')]=function(_0x3efd87,_0x16ce72){return db[_0xcdef('0x2a')]['create'](_0x3efd87[_0xcdef('0x47')],{})[_0xcdef('0x23')](respondWithResult(_0x16ce72,0xc9))[_0xcdef('0x42')](handleError(_0x16ce72,null));};exports['update']=function(_0x15cbdf,_0x1d31e2){if(_0x15cbdf['body']['id']){delete _0x15cbdf[_0xcdef('0x47')]['id'];}return db['DeskAccount'][_0xcdef('0x45')]({'where':{'id':_0x15cbdf[_0xcdef('0x44')]['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x1d31e2,null))['then'](saveUpdates(_0x15cbdf[_0xcdef('0x47')],null))[_0xcdef('0x23')](respondWithResult(_0x1d31e2,null))[_0xcdef('0x42')](handleError(_0x1d31e2,null));};exports['destroy']=function(_0x30c628,_0x1ee91c){return db[_0xcdef('0x2a')][_0xcdef('0x45')]({'where':{'id':_0x30c628[_0xcdef('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ee91c,null))['then'](removeEntity(_0x1ee91c,null))[_0xcdef('0x42')](handleError(_0x1ee91c,null));};exports[_0xcdef('0x48')]=function(_0x57621e,_0x29f042,_0x4b83ab){var _0x5fb60e={};var _0x1e5714={};var _0x426eb4;var _0x368356;return db[_0xcdef('0x2a')][_0xcdef('0x49')]({'where':{'id':_0x57621e[_0xcdef('0x44')]['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x29f042,null))['then'](function(_0x4c223a){if(_0x4c223a){_0x426eb4=_0x4c223a;_0x1e5714[_0xcdef('0x2f')]=_[_0xcdef('0x30')](db['DeskConfiguration']['rawAttributes']);_0x1e5714['query']=_['keys'](_0x57621e['query']);_0x1e5714[_0xcdef('0x31')]=_[_0xcdef('0x32')](_0x1e5714['model'],_0x1e5714['query']);_0x5fb60e[_0xcdef('0x34')]=_[_0xcdef('0x32')](_0x1e5714[_0xcdef('0x2f')],qs[_0xcdef('0x35')](_0x57621e['query'][_0xcdef('0x35')]));_0x5fb60e[_0xcdef('0x34')]=_0x5fb60e[_0xcdef('0x34')]['length']?_0x5fb60e[_0xcdef('0x34')]:_0x1e5714[_0xcdef('0x2f')];_0x5fb60e['order']=qs[_0xcdef('0x39')](_0x57621e[_0xcdef('0x33')][_0xcdef('0x39')]);_0x5fb60e[_0xcdef('0x3c')]=qs[_0xcdef('0x31')](_['pick'](_0x57621e[_0xcdef('0x33')],_0x1e5714[_0xcdef('0x31')]));if(_0x57621e['query']['filter']){_0x5fb60e['where']=_[_0xcdef('0x3b')](_0x5fb60e[_0xcdef('0x3c')],{'$or':_['map'](_0x5fb60e[_0xcdef('0x34')],function(_0x92fde2){var _0x55ee2a={};_0x55ee2a[_0x92fde2]={'$like':'%'+_0x57621e[_0xcdef('0x33')][_0xcdef('0x3a')]+'%'};return _0x55ee2a;})});}_0x5fb60e=_['merge']({},_0x5fb60e,_0x57621e[_0xcdef('0x3e')]);return _0x426eb4['getConfigurations'](_0x5fb60e);}})[_0xcdef('0x23')](function(_0x5c65e5){if(_0x5c65e5){_0x368356=_0x5c65e5['length'];if(!_0x57621e[_0xcdef('0x33')]['hasOwnProperty'](_0xcdef('0x38'))){_0x5fb60e[_0xcdef('0x1d')]=qs['limit'](_0x57621e[_0xcdef('0x33')]['limit']);_0x5fb60e[_0xcdef('0x1b')]=qs['offset'](_0x57621e[_0xcdef('0x33')][_0xcdef('0x1b')]);}return _0x426eb4[_0xcdef('0x48')](_0x5fb60e);}})[_0xcdef('0x23')](function(_0x11f6ac){if(_0x11f6ac){return _0x11f6ac?{'count':_0x368356,'rows':_0x11f6ac}:null;}})[_0xcdef('0x23')](respondWithResult(_0x29f042,null))[_0xcdef('0x42')](handleError(_0x29f042,null));};exports[_0xcdef('0x4a')]=function(_0x9a7de8,_0x45456a,_0x52ece8){if(_0x9a7de8['body']['id']){delete _0x9a7de8[_0xcdef('0x47')]['id'];}return db[_0xcdef('0x2a')][_0xcdef('0x49')]({'where':{'id':_0x9a7de8['params']['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x45456a,null))[_0xcdef('0x23')](function(_0x1ff46a){if(_0x1ff46a){_0x9a7de8[_0xcdef('0x47')][_0xcdef('0x4b')]=_0x1ff46a['id'];_0x9a7de8[_0xcdef('0x47')][_0xcdef('0x4c')]=integrations['getSubjects'](_0x9a7de8[_0xcdef('0x47')]['channel'],_0x9a7de8[_0xcdef('0x47')][_0xcdef('0x2d')]);_0x9a7de8[_0xcdef('0x47')][_0xcdef('0x4d')]=integrations['getDescriptions'](_0x9a7de8[_0xcdef('0x47')][_0xcdef('0x4e')],_0x9a7de8['body'][_0xcdef('0x2d')]);return db[_0xcdef('0x4f')][_0xcdef('0x46')](_0x9a7de8[_0xcdef('0x47')],{'include':[{'model':db[_0xcdef('0x50')],'as':'Subjects'},{'model':db[_0xcdef('0x50')],'as':_0xcdef('0x4d')}]});}return null;})[_0xcdef('0x23')](respondWithResult(_0x45456a,null))[_0xcdef('0x42')](handleError(_0x45456a,null));};exports[_0xcdef('0x51')]=function(_0x55e2dd,_0x2fb677,_0x57a761){var _0x16bd26=[{'name':_0xcdef('0x52'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5ad459='';return db[_0xcdef('0x2a')]['findOne']({'where':{'id':_0x55e2dd[_0xcdef('0x44')]['id']},'attributes':['id','remoteUri',_0xcdef('0x53'),_0xcdef('0x54'),_0xcdef('0x55'),'consumerKey',_0xcdef('0x56'),_0xcdef('0x57'),_0xcdef('0x58')]})['then'](handleEntityNotFound(_0x2fb677,null))[_0xcdef('0x23')](function(_0x3b809c){if(_0x3b809c){_0x5ad459=_0x3b809c[_0xcdef('0x59')];var _0x590a71=_0x5ad459['slice'](-0x1);if(_0x590a71==='/'){_0x5ad459=_0x5ad459[_0xcdef('0x5a')](0x0,_0x5ad459[_0xcdef('0x5b')](_0x590a71));}var _0x54568a={'method':_0xcdef('0x5c'),'uri':util[_0xcdef('0x5d')](_0xcdef('0x5e'),_0x5ad459),'headers':{'Content-Type':_0xcdef('0x5f'),'Accept':_0xcdef('0x5f')},'json':!![]};if(_0x3b809c['authType']===_0xcdef('0x60')){_0x54568a[_0xcdef('0x61')]['Authorization']=util[_0xcdef('0x5d')](_0xcdef('0x62'),new Buffer(util['format']('%s:%s',_0x3b809c[_0xcdef('0x54')],_0x3b809c[_0xcdef('0x55')]))['toString'](_0xcdef('0x63')));}return rp(_0x54568a)[_0xcdef('0x23')](function(_0x52d231){return _0x16bd26['concat'](_[_0xcdef('0x29')](_0x52d231[_0xcdef('0x64')][_0xcdef('0x65')],function(_0x3d41a7){return{'id':_0x3d41a7[_0xcdef('0x27')],'name':_0x3d41a7['name'],'type':_0x3d41a7[_0xcdef('0x2d')],'active':_0x3d41a7['active'],'label':_0x3d41a7[_0xcdef('0x66')],'custom':!![]};}));});}})[_0xcdef('0x23')](function(_0x118218){return{'count':_0x118218[_0xcdef('0x36')],'rows':_0x118218};})['then'](respondWithResult(_0x2fb677,null))[_0xcdef('0x42')](function(_0x4d8e7e){var _0x5494d8=_0x55e2dd[_0xcdef('0x33')][_0xcdef('0x67')]?0x1f4:_0x4d8e7e['statusCode']||0x1f4;logger[_0xcdef('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xcdef('0x51'),_0x5494d8,JSON[_0xcdef('0x68')](_0x4d8e7e));delete _0x4d8e7e[_0xcdef('0x27')];if(_0x5494d8===0x191){_0x5494d8=0x190;}_0x2fb677[_0xcdef('0x19')](_0x5494d8)[_0xcdef('0x28')](_0x55e2dd[_0xcdef('0x33')][_0xcdef('0x67')]?{'message':_0xcdef('0x69'),'statusCode':_0x4d8e7e[_0xcdef('0x6a')]}:_0x4d8e7e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index eee8e78..9135fb7 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 _0xa0b9=['DeskAccount','int_desk_accounts','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define'];(function(_0x2018ca,_0x18ffc1){var _0x23ef6d=function(_0xd2f8da){while(--_0xd2f8da){_0x2018ca['push'](_0x2018ca['shift']());}};_0x23ef6d(++_0x18ffc1);}(_0xa0b9,0xfe));var _0x9a0b=function(_0x7de56d,_0x1cb5f5){_0x7de56d=_0x7de56d-0x0;var _0x283687=_0xa0b9[_0x7de56d];return _0x283687;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a0b('0x0'))(_0x9a0b('0x1'));var moment=require(_0x9a0b('0x2'));var BPromise=require(_0x9a0b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a0b('0x4'));var rimraf=require(_0x9a0b('0x5'));var config=require(_0x9a0b('0x6'));var attributes=require(_0x9a0b('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x9a0b('0x8')]=function(_0x4eb66b,_0x30ede8){return _0x4eb66b[_0x9a0b('0x9')](_0x9a0b('0xa'),attributes,{'tableName':_0x9a0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec7=['api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x14eb8c,_0x18dbd6){var _0x1e1167=function(_0x37ee80){while(--_0x37ee80){_0x14eb8c['push'](_0x14eb8c['shift']());}};_0x1e1167(++_0x18dbd6);}(_0x0ec7,0x10e));var _0x70ec=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0ec7[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x70ec('0x0'));var util=require(_0x70ec('0x1'));var logger=require(_0x70ec('0x2'))(_0x70ec('0x3'));var moment=require(_0x70ec('0x4'));var BPromise=require(_0x70ec('0x5'));var rp=require(_0x70ec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70ec('0x7'));var config=require(_0x70ec('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x70ec('0x9'));module[_0x70ec('0xa')]=function(_0x22ed2d,_0x75b865){return _0x22ed2d[_0x70ec('0xb')]('DeskAccount',attributes,{'tableName':_0x70ec('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 4423424..ca764e7 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 _0x717a=['stringify','error','code','message','catch','DeskAccount','findAll','options','raw','where','attributes','map','include','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x306b57,_0x13f798){var _0x5836fc=function(_0x7a50aa){while(--_0x7a50aa){_0x306b57['push'](_0x306b57['shift']());}};_0x5836fc(++_0x13f798);}(_0x717a,0x1ed));var _0xa717=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x717a[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require(_0xa717('0x0'));var util=require(_0xa717('0x1'));var moment=require(_0xa717('0x2'));var BPromise=require(_0xa717('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa717('0x4'));var db=require(_0xa717('0x5'))['db'];var utils=require(_0xa717('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa717('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa717('0x8')][_0xa717('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53f6c3,_0x524308,_0x104fe4){return new BPromise(function(_0x5448a6,_0x264aa1){return client[_0xa717('0xa')](_0x53f6c3,_0x104fe4)[_0xa717('0xb')](function(_0x15dc8a){logger[_0xa717('0xc')](_0xa717('0xd'),_0x524308,_0xa717('0xe'));logger[_0xa717('0xf')](_0xa717('0x10'),_0x524308,_0xa717('0xe'),JSON[_0xa717('0x11')](_0x15dc8a));if(_0x15dc8a[_0xa717('0x12')]){if(_0x15dc8a[_0xa717('0x12')][_0xa717('0x13')]===0x1f4){logger[_0xa717('0x12')](_0xa717('0xd'),_0x524308,_0x15dc8a[_0xa717('0x12')][_0xa717('0x14')]);return _0x264aa1(_0x15dc8a['error'][_0xa717('0x14')]);}logger['error'](_0xa717('0xd'),_0x524308,_0x15dc8a['error'][_0xa717('0x14')]);return _0x5448a6(_0x15dc8a[_0xa717('0x12')][_0xa717('0x14')]);}else{logger[_0xa717('0xc')]('DeskAccount,\x20%s,\x20%s',_0x524308,_0xa717('0xe'));_0x5448a6(_0x15dc8a['result'][_0xa717('0x14')]);}})[_0xa717('0x15')](function(_0x259069){logger[_0xa717('0x12')](_0xa717('0xd'),_0x524308,_0x259069);_0x264aa1(_0x259069);});});}exports['GetDeskAccount']=function(_0x4584f8){var _0x1f9fe5=this;return new Promise(function(_0x45e653,_0xadcda0){return db[_0xa717('0x16')][_0xa717('0x17')]({'raw':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')][_0xa717('0x19')]===undefined?!![]:![]:!![],'where':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')][_0xa717('0x1a')]||null:null,'attributes':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')][_0xa717('0x1b')]||null:null,'limit':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')]['limit']||null:null,'include':_0x4584f8[_0xa717('0x18')]?_0x4584f8[_0xa717('0x18')]['include']?_[_0xa717('0x1c')](_0x4584f8[_0xa717('0x18')][_0xa717('0x1d')],function(_0x625c8){return{'model':db[_0x625c8[_0xa717('0x1e')]],'as':_0x625c8['as'],'attributes':_0x625c8[_0xa717('0x1b')],'include':_0x625c8[_0xa717('0x1d')]?_[_0xa717('0x1c')](_0x625c8[_0xa717('0x1d')],function(_0x2cf94a){return{'model':db[_0x2cf94a[_0xa717('0x1e')]],'as':_0x2cf94a['as'],'attributes':_0x2cf94a['attributes'],'include':_0x2cf94a['include']?_['map'](_0x2cf94a[_0xa717('0x1d')],function(_0x30c522){return{'model':db[_0x30c522[_0xa717('0x1e')]],'as':_0x30c522['as'],'attributes':_0x30c522[_0xa717('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x404e84){logger[_0xa717('0xc')](_0xa717('0x1f'),_0x4584f8);logger[_0xa717('0xf')](_0xa717('0x1f'),_0x4584f8,JSON['stringify'](_0x404e84));_0x45e653(_0x404e84);})[_0xa717('0x15')](function(_0x5756d1){logger[_0xa717('0x12')](_0xa717('0x1f'),_0x5756d1[_0xa717('0x14')],_0x4584f8);_0xadcda0(_0x1f9fe5[_0xa717('0x12')](0x1f4,_0x5756d1['message']));});});};exports['ShowDeskAccount']=function(_0x3432e5){var _0x214428=this;return new Promise(function(_0x133920,_0x4e3ad4){return db[_0xa717('0x16')][_0xa717('0x20')]({'raw':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options'][_0xa717('0x19')]===undefined?!![]:![]:!![],'where':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options'][_0xa717('0x1a')]||null:null,'attributes':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options'][_0xa717('0x1b')]||null:null,'include':_0x3432e5[_0xa717('0x18')]?_0x3432e5['options']['include']?_[_0xa717('0x1c')](_0x3432e5['options'][_0xa717('0x1d')],function(_0x3274d8){return{'model':db[_0x3274d8[_0xa717('0x1e')]],'as':_0x3274d8['as'],'attributes':_0x3274d8['attributes'],'include':_0x3274d8[_0xa717('0x1d')]?_[_0xa717('0x1c')](_0x3274d8['include'],function(_0x100623){return{'model':db[_0x100623[_0xa717('0x1e')]],'as':_0x100623['as'],'attributes':_0x100623[_0xa717('0x1b')],'include':_0x100623[_0xa717('0x1d')]?_['map'](_0x100623['include'],function(_0xd3c341){return{'model':db[_0xd3c341[_0xa717('0x1e')]],'as':_0xd3c341['as'],'attributes':_0xd3c341[_0xa717('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa717('0xb')](function(_0x4d19d7){logger[_0xa717('0xc')](_0xa717('0x21'),_0x3432e5);logger[_0xa717('0xf')]('ShowDeskAccount',_0x3432e5,JSON[_0xa717('0x11')](_0x4d19d7));_0x133920(_0x4d19d7);})[_0xa717('0x15')](function(_0x3f0a4f){logger['error'](_0xa717('0x21'),_0x3f0a4f[_0xa717('0x14')],_0x3432e5);_0x4e3ad4(_0x214428['error'](0x1f4,_0x3f0a4f[_0xa717('0x14')]));});});}; \ No newline at end of file +var _0x9604=['DeskAccount,\x20%s,\x20%s','message','info','catch','DeskAccount','findAll','options','raw','where','attributes','include','map','model','GetDeskAccount','ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error'];(function(_0x36e8fa,_0x1d2b32){var _0x2b5c4a=function(_0x237da6){while(--_0x237da6){_0x36e8fa['push'](_0x36e8fa['shift']());}};_0x2b5c4a(++_0x1d2b32);}(_0x9604,0x6f));var _0x4960=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9604[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4960('0x0'));var util=require(_0x4960('0x1'));var moment=require('moment');var BPromise=require(_0x4960('0x2'));var rs=require(_0x4960('0x3'));var fs=require('fs');var Redis=require(_0x4960('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4960('0x5'));var logger=require(_0x4960('0x6'))(_0x4960('0x7'));var config=require(_0x4960('0x8'));var jayson=require(_0x4960('0x9'));var client=jayson[_0x4960('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3831b9,_0x2a476e,_0x5c43b6){return new BPromise(function(_0x12059d,_0x45c390){return client[_0x4960('0xb')](_0x3831b9,_0x5c43b6)[_0x4960('0xc')](function(_0x1cc494){logger['info']('DeskAccount,\x20%s,\x20%s',_0x2a476e,_0x4960('0xd'));logger[_0x4960('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2a476e,_0x4960('0xd'),JSON[_0x4960('0xf')](_0x1cc494));if(_0x1cc494[_0x4960('0x10')]){if(_0x1cc494[_0x4960('0x10')]['code']===0x1f4){logger[_0x4960('0x10')](_0x4960('0x11'),_0x2a476e,_0x1cc494[_0x4960('0x10')]['message']);return _0x45c390(_0x1cc494['error'][_0x4960('0x12')]);}logger[_0x4960('0x10')](_0x4960('0x11'),_0x2a476e,_0x1cc494[_0x4960('0x10')][_0x4960('0x12')]);return _0x12059d(_0x1cc494[_0x4960('0x10')][_0x4960('0x12')]);}else{logger[_0x4960('0x13')](_0x4960('0x11'),_0x2a476e,_0x4960('0xd'));_0x12059d(_0x1cc494['result'][_0x4960('0x12')]);}})[_0x4960('0x14')](function(_0x36b652){logger[_0x4960('0x10')](_0x4960('0x11'),_0x2a476e,_0x36b652);_0x45c390(_0x36b652);});});}exports['GetDeskAccount']=function(_0x38010c){var _0x479149=this;return new Promise(function(_0x443239,_0x30538c){return db[_0x4960('0x15')][_0x4960('0x16')]({'raw':_0x38010c[_0x4960('0x17')]?_0x38010c['options'][_0x4960('0x18')]===undefined?!![]:![]:!![],'where':_0x38010c[_0x4960('0x17')]?_0x38010c[_0x4960('0x17')][_0x4960('0x19')]||null:null,'attributes':_0x38010c[_0x4960('0x17')]?_0x38010c[_0x4960('0x17')][_0x4960('0x1a')]||null:null,'limit':_0x38010c[_0x4960('0x17')]?_0x38010c['options']['limit']||null:null,'include':_0x38010c[_0x4960('0x17')]?_0x38010c[_0x4960('0x17')][_0x4960('0x1b')]?_[_0x4960('0x1c')](_0x38010c['options'][_0x4960('0x1b')],function(_0x27d9e8){return{'model':db[_0x27d9e8[_0x4960('0x1d')]],'as':_0x27d9e8['as'],'attributes':_0x27d9e8[_0x4960('0x1a')],'include':_0x27d9e8['include']?_['map'](_0x27d9e8[_0x4960('0x1b')],function(_0xac750d){return{'model':db[_0xac750d[_0x4960('0x1d')]],'as':_0xac750d['as'],'attributes':_0xac750d[_0x4960('0x1a')],'include':_0xac750d[_0x4960('0x1b')]?_[_0x4960('0x1c')](_0xac750d[_0x4960('0x1b')],function(_0x3485cf){return{'model':db[_0x3485cf[_0x4960('0x1d')]],'as':_0x3485cf['as'],'attributes':_0x3485cf[_0x4960('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4960('0xc')](function(_0x17f364){logger['info']('GetDeskAccount',_0x38010c);logger['debug']('GetDeskAccount',_0x38010c,JSON['stringify'](_0x17f364));_0x443239(_0x17f364);})[_0x4960('0x14')](function(_0x52a9fe){logger['error'](_0x4960('0x1e'),_0x52a9fe[_0x4960('0x12')],_0x38010c);_0x30538c(_0x479149[_0x4960('0x10')](0x1f4,_0x52a9fe[_0x4960('0x12')]));});});};exports[_0x4960('0x1f')]=function(_0x30d69d){var _0x927cc0=this;return new Promise(function(_0x53feb7,_0x953b46){return db['DeskAccount']['find']({'raw':_0x30d69d[_0x4960('0x17')]?_0x30d69d['options'][_0x4960('0x18')]===undefined?!![]:![]:!![],'where':_0x30d69d['options']?_0x30d69d[_0x4960('0x17')][_0x4960('0x19')]||null:null,'attributes':_0x30d69d[_0x4960('0x17')]?_0x30d69d['options'][_0x4960('0x1a')]||null:null,'include':_0x30d69d['options']?_0x30d69d[_0x4960('0x17')][_0x4960('0x1b')]?_['map'](_0x30d69d[_0x4960('0x17')][_0x4960('0x1b')],function(_0x4b1f23){return{'model':db[_0x4b1f23[_0x4960('0x1d')]],'as':_0x4b1f23['as'],'attributes':_0x4b1f23[_0x4960('0x1a')],'include':_0x4b1f23[_0x4960('0x1b')]?_['map'](_0x4b1f23[_0x4960('0x1b')],function(_0xa18256){return{'model':db[_0xa18256[_0x4960('0x1d')]],'as':_0xa18256['as'],'attributes':_0xa18256[_0x4960('0x1a')],'include':_0xa18256[_0x4960('0x1b')]?_['map'](_0xa18256[_0x4960('0x1b')],function(_0x4450d9){return{'model':db[_0x4450d9[_0x4960('0x1d')]],'as':_0x4450d9['as'],'attributes':_0x4450d9[_0x4960('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4960('0xc')](function(_0x3c2112){logger[_0x4960('0x13')](_0x4960('0x1f'),_0x30d69d);logger[_0x4960('0xe')]('ShowDeskAccount',_0x30d69d,JSON['stringify'](_0x3c2112));_0x53feb7(_0x3c2112);})['catch'](function(_0x456ecb){logger['error'](_0x4960('0x1f'),_0x456ecb[_0x4960('0x12')],_0x30d69d);_0x953b46(_0x927cc0[_0x4960('0x10')](0x1f4,_0x456ecb[_0x4960('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index ea9d7ef..413f1b3 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x155839,_0x3f679d){var _0x51d322=function(_0xf96e28){while(--_0xf96e28){_0x155839['push'](_0x155839['shift']());}};_0x51d322(++_0x3f679d);}(_0x55ca,0x126));var _0xa55c=function(_0xb011d6,_0x74d4eb){_0xb011d6=_0xb011d6-0x0;var _0x1e30f1=_0x55ca[_0xb011d6];return _0x1e30f1;};'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['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2690a6,_0x234902){var _0x9bff67=function(_0x5e0158){while(--_0x5e0158){_0x2690a6['push'](_0x2690a6['shift']());}};_0x9bff67(++_0x234902);}(_0x34e8,0x12c));var _0x834e=function(_0x38e198,_0x168db5){_0x38e198=_0x38e198-0x0;var _0x15be8f=_0x34e8[_0x38e198];return _0x15be8f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index d5a5807..cf46c03 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 _0x6926=['exports','STRING','sequelize'];(function(_0x42e01a,_0x4585b4){var _0x40f1b7=function(_0x596bfe){while(--_0x596bfe){_0x42e01a['push'](_0x42e01a['shift']());}};_0x40f1b7(++_0x4585b4);}(_0x6926,0x185));var _0x6692=function(_0x1a7cad,_0x13be22){_0x1a7cad=_0x1a7cad-0x0;var _0x43f300=_0x6926[_0x1a7cad];return _0x43f300;};'use strict';var Sequelize=require(_0x6692('0x0'));module[_0x6692('0x1')]={'name':{'type':Sequelize[_0x6692('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcfda=['exports','STRING'];(function(_0x231606,_0x56c320){var _0x45dd41=function(_0x3f700d){while(--_0x3f700d){_0x231606['push'](_0x231606['shift']());}};_0x45dd41(++_0x56c320);}(_0xcfda,0xca));var _0xacfd=function(_0x3167a7,_0x6bce6b){_0x3167a7=_0x3167a7-0x0;var _0x37eaf0=_0xcfda[_0x3167a7];return _0x37eaf0;};'use strict';var Sequelize=require('sequelize');module[_0xacfd('0x0')]={'name':{'type':Sequelize[_0xacfd('0x1')]},'description':{'type':Sequelize[_0xacfd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c6a96f1..f512472 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 _0xf895=['rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format'];(function(_0x489850,_0x23462d){var _0x3a3032=function(_0x18832b){while(--_0x18832b){_0x489850['push'](_0x489850['shift']());}};_0x3a3032(++_0x23462d);}(_0xf895,0xfe));var _0x5f89=function(_0x1e0f80,_0x1aa550){_0x1e0f80=_0x1e0f80-0x0;var _0x326085=_0xf895[_0x1e0f80];return _0x326085;};'use strict';var emlformat=require(_0x5f89('0x0'));var rimraf=require(_0x5f89('0x1'));var zipdir=require(_0x5f89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5f89('0x3'));var BPromise=require(_0x5f89('0x4'));var Mustache=require('mustache');var util=require(_0x5f89('0x5'));var path=require(_0x5f89('0x6'));var sox=require(_0x5f89('0x7'));var csv=require(_0x5f89('0x8'));var ejs=require(_0x5f89('0x9'));var fs=require('fs');var fs_extra=require(_0x5f89('0xa'));var _=require(_0x5f89('0xb'));var squel=require(_0x5f89('0xc'));var crypto=require(_0x5f89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f89('0xe'));var toCsv=require(_0x5f89('0x8'));var querystring=require(_0x5f89('0xf'));var Papa=require('papaparse');var Redis=require(_0x5f89('0x10'));var authService=require(_0x5f89('0x11'));var qs=require(_0x5f89('0x12'));var as=require(_0x5f89('0x13'));var hardwareService=require(_0x5f89('0x14'));var logger=require(_0x5f89('0x15'))(_0x5f89('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x502803,_0x2baaf2){_0x2baaf2=_0x2baaf2||0xcc;return function(_0x3f2370){if(_0x3f2370){return _0x502803[_0x5f89('0x17')](_0x2baaf2);}return _0x502803[_0x5f89('0x18')](_0x2baaf2)[_0x5f89('0x19')]();};}function respondWithResult(_0x560ded,_0x2d7a4b){_0x2d7a4b=_0x2d7a4b||0xc8;return function(_0x3a89c5){if(_0x3a89c5){return _0x560ded[_0x5f89('0x18')](_0x2d7a4b)[_0x5f89('0x1a')](_0x3a89c5);}};}function respondWithFilteredResult(_0x3860fd,_0x1d3c00){return function(_0x3b055f){if(_0x3b055f){var _0x481d1c=typeof _0x1d3c00['offset']===_0x5f89('0x1b')&&typeof _0x1d3c00[_0x5f89('0x1c')]==='undefined';var _0x5f177e=_0x3b055f[_0x5f89('0x1d')];var _0x37ac53=_0x481d1c?0x0:_0x1d3c00[_0x5f89('0x1e')];var _0x187d89=_0x481d1c?_0x3b055f['count']:_0x1d3c00[_0x5f89('0x1e')]+_0x1d3c00[_0x5f89('0x1c')];var _0x4acc91;if(_0x187d89>=_0x5f177e){_0x187d89=_0x5f177e;_0x4acc91=0xc8;}else{_0x4acc91=0xce;}_0x3860fd[_0x5f89('0x18')](_0x4acc91);return _0x3860fd[_0x5f89('0x1f')]('Content-Range',_0x37ac53+'-'+_0x187d89+'/'+_0x5f177e)[_0x5f89('0x1a')](_0x3b055f);}return null;};}function patchUpdates(_0x48dead){return function(_0x89aafd){try{jsonpatch[_0x5f89('0x20')](_0x89aafd,_0x48dead,!![]);}catch(_0xd787c1){return BPromise[_0x5f89('0x21')](_0xd787c1);}return _0x89aafd[_0x5f89('0x22')]();};}function saveUpdates(_0x1117a4,_0x4169ee){return function(_0x1e1a63){if(_0x1e1a63){return _0x1e1a63[_0x5f89('0x23')](_0x1117a4)[_0x5f89('0x24')](function(_0x2ffc0d){return _0x2ffc0d;});}return null;};}function removeEntity(_0x149c76,_0x1fc0c8){return function(_0x1e64d3){if(_0x1e64d3){return _0x1e64d3[_0x5f89('0x25')]()[_0x5f89('0x24')](function(){_0x149c76[_0x5f89('0x18')](0xcc)[_0x5f89('0x19')]();});}};}function handleEntityNotFound(_0x31a8ea,_0x2a4977){return function(_0x14a266){if(!_0x14a266){_0x31a8ea[_0x5f89('0x17')](0x194);}return _0x14a266;};}function handleError(_0x6c57dd,_0x16bd0f){_0x16bd0f=_0x16bd0f||0x1f4;return function(_0x207171){logger[_0x5f89('0x26')](_0x207171[_0x5f89('0x27')]);if(_0x207171[_0x5f89('0x28')]){delete _0x207171['name'];}_0x6c57dd['status'](_0x16bd0f)[_0x5f89('0x29')](_0x207171);};}exports[_0x5f89('0x2a')]=function(_0x4d9249,_0x289569){var _0x264615={},_0x5643a8={},_0x15341a={'count':0x0,'rows':[]};var _0x2ff3f2=_[_0x5f89('0x2b')](db[_0x5f89('0x2c')][_0x5f89('0x2d')],function(_0x1bf4d1){return{'name':_0x1bf4d1[_0x5f89('0x2e')],'type':_0x1bf4d1[_0x5f89('0x2f')][_0x5f89('0x30')]};});_0x5643a8[_0x5f89('0x31')]=_['map'](_0x2ff3f2,'name');_0x5643a8[_0x5f89('0x32')]=_[_0x5f89('0x33')](_0x4d9249[_0x5f89('0x32')]);_0x5643a8[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x5643a8[_0x5f89('0x31')],_0x5643a8['query']);_0x264615['attributes']=_[_0x5f89('0x35')](_0x5643a8[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x36')]));_0x264615[_0x5f89('0x37')]=_0x264615[_0x5f89('0x37')][_0x5f89('0x38')]?_0x264615['attributes']:_0x5643a8[_0x5f89('0x31')];if(!_0x4d9249[_0x5f89('0x32')]['hasOwnProperty'](_0x5f89('0x39'))){_0x264615[_0x5f89('0x1c')]=qs['limit'](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x1c')]);_0x264615[_0x5f89('0x1e')]=qs[_0x5f89('0x1e')](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x1e')]);}_0x264615[_0x5f89('0x3a')]=qs[_0x5f89('0x3b')](_0x4d9249[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x264615[_0x5f89('0x3c')]=qs[_0x5f89('0x34')](_[_0x5f89('0x3d')](_0x4d9249['query'],_0x5643a8['filters']),_0x2ff3f2);if(_0x4d9249[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x264615[_0x5f89('0x3c')]=_[_0x5f89('0x3f')](_0x264615[_0x5f89('0x3c')],{'$or':_[_0x5f89('0x2b')](_0x2ff3f2,function(_0x5c516c){if(_0x5c516c[_0x5f89('0x2f')]!==_0x5f89('0x40')){var _0x3c2fec={};_0x3c2fec[_0x5c516c[_0x5f89('0x28')]]={'$like':'%'+_0x4d9249[_0x5f89('0x32')]['filter']+'%'};return _0x3c2fec;}})});}_0x264615=_[_0x5f89('0x3f')]({},_0x264615,_0x4d9249['options']);var _0x45756f={'where':_0x264615['where']};return db['DeskConfiguration'][_0x5f89('0x1d')](_0x45756f)[_0x5f89('0x24')](function(_0x3bfdcc){_0x15341a['count']=_0x3bfdcc;if(_0x4d9249[_0x5f89('0x32')][_0x5f89('0x41')]){_0x264615[_0x5f89('0x42')]=[{'all':!![]}];}return db[_0x5f89('0x2c')]['findAll'](_0x264615);})[_0x5f89('0x24')](function(_0x5c18a7){_0x15341a[_0x5f89('0x43')]=_0x5c18a7;return _0x15341a;})['then'](respondWithFilteredResult(_0x289569,_0x264615))[_0x5f89('0x44')](handleError(_0x289569,null));};exports[_0x5f89('0x45')]=function(_0x52f841,_0xa6ec8d){var _0x3e4557={'raw':![],'where':{'id':_0x52f841[_0x5f89('0x46')]['id']}},_0x35e47f={};_0x35e47f[_0x5f89('0x31')]=_[_0x5f89('0x33')](db[_0x5f89('0x2c')][_0x5f89('0x2d')]);_0x35e47f[_0x5f89('0x32')]=_['keys'](_0x52f841['query']);_0x35e47f[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x35e47f[_0x5f89('0x31')],_0x35e47f[_0x5f89('0x32')]);_0x3e4557[_0x5f89('0x37')]=_[_0x5f89('0x35')](_0x35e47f[_0x5f89('0x31')],qs['fields'](_0x52f841[_0x5f89('0x32')]['fields']));_0x3e4557['attributes']=_0x3e4557['attributes'][_0x5f89('0x38')]?_0x3e4557[_0x5f89('0x37')]:_0x35e47f[_0x5f89('0x31')];if(_0x52f841[_0x5f89('0x32')][_0x5f89('0x41')]){_0x3e4557[_0x5f89('0x42')]=[{'all':!![]}];}_0x3e4557=_[_0x5f89('0x3f')]({},_0x3e4557,_0x52f841[_0x5f89('0x47')]);return db[_0x5f89('0x2c')][_0x5f89('0x48')](_0x3e4557)[_0x5f89('0x24')](handleEntityNotFound(_0xa6ec8d,null))[_0x5f89('0x24')](respondWithResult(_0xa6ec8d,null))[_0x5f89('0x44')](handleError(_0xa6ec8d,null));};exports[_0x5f89('0x49')]=function(_0x987810,_0x43dba8){return db[_0x5f89('0x2c')][_0x5f89('0x49')](_0x987810['body'],{})[_0x5f89('0x24')](respondWithResult(_0x43dba8,0xc9))[_0x5f89('0x44')](handleError(_0x43dba8,null));};exports[_0x5f89('0x23')]=function(_0x5b961b,_0x395d9f){if(_0x5b961b['body']['id']){delete _0x5b961b[_0x5f89('0x4a')]['id'];}return db[_0x5f89('0x2c')]['find']({'where':{'id':_0x5b961b[_0x5f89('0x46')]['id']}})[_0x5f89('0x24')](handleEntityNotFound(_0x395d9f,null))[_0x5f89('0x24')](saveUpdates(_0x5b961b[_0x5f89('0x4a')],null))[_0x5f89('0x24')](respondWithResult(_0x395d9f,null))[_0x5f89('0x44')](handleError(_0x395d9f,null));};exports[_0x5f89('0x25')]=function(_0x3eba8b,_0x4ae017){return db[_0x5f89('0x2c')]['find']({'where':{'id':_0x3eba8b[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ae017,null))['then'](removeEntity(_0x4ae017,null))[_0x5f89('0x44')](handleError(_0x4ae017,null));};exports[_0x5f89('0x4b')]=function(_0xfed50,_0xb8b3e8,_0x478d2a){var _0x228369={};var _0x5e8e2a={};var _0x230802;var _0x591bc2;return db[_0x5f89('0x2c')][_0x5f89('0x4c')]({'where':{'id':_0xfed50[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0xb8b3e8,null))[_0x5f89('0x24')](function(_0x558cb8){if(_0x558cb8){_0x230802=_0x558cb8;_0x5e8e2a[_0x5f89('0x31')]=_['keys'](db['DeskField'][_0x5f89('0x2d')]);_0x5e8e2a[_0x5f89('0x32')]=_['keys'](_0xfed50[_0x5f89('0x32')]);_0x5e8e2a['filters']=_[_0x5f89('0x35')](_0x5e8e2a[_0x5f89('0x31')],_0x5e8e2a['query']);_0x228369['attributes']=_[_0x5f89('0x35')](_0x5e8e2a[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0xfed50[_0x5f89('0x32')][_0x5f89('0x36')]));_0x228369[_0x5f89('0x37')]=_0x228369[_0x5f89('0x37')][_0x5f89('0x38')]?_0x228369[_0x5f89('0x37')]:_0x5e8e2a[_0x5f89('0x31')];_0x228369[_0x5f89('0x3a')]=qs[_0x5f89('0x3b')](_0xfed50[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x228369[_0x5f89('0x3c')]=qs[_0x5f89('0x34')](_[_0x5f89('0x3d')](_0xfed50['query'],_0x5e8e2a['filters']));if(_0xfed50[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x228369[_0x5f89('0x3c')]=_['merge'](_0x228369['where'],{'$or':_['map'](_0x228369[_0x5f89('0x37')],function(_0x44223e){var _0x1f867b={};_0x1f867b[_0x44223e]={'$like':'%'+_0xfed50[_0x5f89('0x32')][_0x5f89('0x3e')]+'%'};return _0x1f867b;})});}_0x228369=_[_0x5f89('0x3f')]({},_0x228369,_0xfed50[_0x5f89('0x47')]);return _0x230802[_0x5f89('0x4b')](_0x228369);}})[_0x5f89('0x24')](function(_0x1c3da2){if(_0x1c3da2){_0x591bc2=_0x1c3da2[_0x5f89('0x38')];if(!_0xfed50['query'][_0x5f89('0x4d')]('nolimit')){_0x228369[_0x5f89('0x1c')]=qs[_0x5f89('0x1c')](_0xfed50['query'][_0x5f89('0x1c')]);_0x228369[_0x5f89('0x1e')]=qs[_0x5f89('0x1e')](_0xfed50[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x230802['getFields'](_0x228369);}})[_0x5f89('0x24')](function(_0x1b5e37){if(_0x1b5e37){return _0x1b5e37?{'count':_0x591bc2,'rows':_0x1b5e37}:null;}})[_0x5f89('0x24')](respondWithResult(_0xb8b3e8,null))[_0x5f89('0x44')](handleError(_0xb8b3e8,null));};exports[_0x5f89('0x4e')]=function(_0x12cf21,_0x3135ee,_0x441382){var _0x34fb75={};var _0x103d1a={};var _0x47db76;var _0x36279e;return db[_0x5f89('0x2c')][_0x5f89('0x4c')]({'where':{'id':_0x12cf21[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0x3135ee,null))[_0x5f89('0x24')](function(_0x248b9a){if(_0x248b9a){_0x47db76=_0x248b9a;_0x103d1a[_0x5f89('0x31')]=_[_0x5f89('0x33')](db[_0x5f89('0x4f')]['rawAttributes']);_0x103d1a[_0x5f89('0x32')]=_['keys'](_0x12cf21['query']);_0x103d1a[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x103d1a['model'],_0x103d1a['query']);_0x34fb75[_0x5f89('0x37')]=_['intersection'](_0x103d1a[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0x12cf21['query'][_0x5f89('0x36')]));_0x34fb75[_0x5f89('0x37')]=_0x34fb75[_0x5f89('0x37')]['length']?_0x34fb75['attributes']:_0x103d1a['model'];_0x34fb75[_0x5f89('0x3a')]=qs['sort'](_0x12cf21[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x34fb75[_0x5f89('0x3c')]=qs['filters'](_['pick'](_0x12cf21[_0x5f89('0x32')],_0x103d1a['filters']));if(_0x12cf21['query'][_0x5f89('0x3e')]){_0x34fb75[_0x5f89('0x3c')]=_[_0x5f89('0x3f')](_0x34fb75[_0x5f89('0x3c')],{'$or':_['map'](_0x34fb75[_0x5f89('0x37')],function(_0x150bd9){var _0x1e125c={};_0x1e125c[_0x150bd9]={'$like':'%'+_0x12cf21[_0x5f89('0x32')][_0x5f89('0x3e')]+'%'};return _0x1e125c;})});}_0x34fb75=_[_0x5f89('0x3f')]({},_0x34fb75,_0x12cf21[_0x5f89('0x47')]);return _0x47db76[_0x5f89('0x4e')](_0x34fb75);}})[_0x5f89('0x24')](function(_0x86f9e1){if(_0x86f9e1){_0x36279e=_0x86f9e1[_0x5f89('0x38')];if(!_0x12cf21[_0x5f89('0x32')][_0x5f89('0x4d')](_0x5f89('0x39'))){_0x34fb75[_0x5f89('0x1c')]=qs[_0x5f89('0x1c')](_0x12cf21[_0x5f89('0x32')][_0x5f89('0x1c')]);_0x34fb75[_0x5f89('0x1e')]=qs['offset'](_0x12cf21[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x47db76[_0x5f89('0x4e')](_0x34fb75);}})[_0x5f89('0x24')](function(_0x1d0321){if(_0x1d0321){return _0x1d0321?{'count':_0x36279e,'rows':_0x1d0321}:null;}})['then'](respondWithResult(_0x3135ee,null))[_0x5f89('0x44')](handleError(_0x3135ee,null));};exports[_0x5f89('0x50')]=function(_0x4982e8,_0x2b11b8,_0x4e3588){var _0x2af7bb={};var _0x2a0b23={};var _0x244fb3;var _0x3714a0;return db[_0x5f89('0x2c')][_0x5f89('0x4c')]({'where':{'id':_0x4982e8[_0x5f89('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b11b8,null))[_0x5f89('0x24')](function(_0x1e77f5){if(_0x1e77f5){_0x244fb3=_0x1e77f5;_0x2a0b23[_0x5f89('0x31')]=_[_0x5f89('0x33')](db[_0x5f89('0x4f')]['rawAttributes']);_0x2a0b23[_0x5f89('0x32')]=_[_0x5f89('0x33')](_0x4982e8[_0x5f89('0x32')]);_0x2a0b23[_0x5f89('0x34')]=_['intersection'](_0x2a0b23[_0x5f89('0x31')],_0x2a0b23[_0x5f89('0x32')]);_0x2af7bb[_0x5f89('0x37')]=_[_0x5f89('0x35')](_0x2a0b23[_0x5f89('0x31')],qs[_0x5f89('0x36')](_0x4982e8[_0x5f89('0x32')][_0x5f89('0x36')]));_0x2af7bb['attributes']=_0x2af7bb[_0x5f89('0x37')][_0x5f89('0x38')]?_0x2af7bb['attributes']:_0x2a0b23[_0x5f89('0x31')];_0x2af7bb[_0x5f89('0x3a')]=qs[_0x5f89('0x3b')](_0x4982e8[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x2af7bb[_0x5f89('0x3c')]=qs[_0x5f89('0x34')](_[_0x5f89('0x3d')](_0x4982e8['query'],_0x2a0b23[_0x5f89('0x34')]));if(_0x4982e8[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x2af7bb[_0x5f89('0x3c')]=_['merge'](_0x2af7bb[_0x5f89('0x3c')],{'$or':_[_0x5f89('0x2b')](_0x2af7bb[_0x5f89('0x37')],function(_0x5f36fc){var _0x18c008={};_0x18c008[_0x5f36fc]={'$like':'%'+_0x4982e8[_0x5f89('0x32')][_0x5f89('0x3e')]+'%'};return _0x18c008;})});}_0x2af7bb=_[_0x5f89('0x3f')]({},_0x2af7bb,_0x4982e8['options']);return _0x244fb3[_0x5f89('0x50')](_0x2af7bb);}})[_0x5f89('0x24')](function(_0x368bf7){if(_0x368bf7){_0x3714a0=_0x368bf7[_0x5f89('0x38')];if(!_0x4982e8['query']['hasOwnProperty'](_0x5f89('0x39'))){_0x2af7bb['limit']=qs[_0x5f89('0x1c')](_0x4982e8[_0x5f89('0x32')]['limit']);_0x2af7bb[_0x5f89('0x1e')]=qs[_0x5f89('0x1e')](_0x4982e8[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x244fb3[_0x5f89('0x50')](_0x2af7bb);}})['then'](function(_0x5c7a51){if(_0x5c7a51){return _0x5c7a51?{'count':_0x3714a0,'rows':_0x5c7a51}:null;}})[_0x5f89('0x24')](respondWithResult(_0x2b11b8,null))[_0x5f89('0x44')](handleError(_0x2b11b8,null));};exports['getTags']=function(_0x463fbb,_0x1cfc9b,_0x1e3053){var _0x2f8a39={};var _0x31e63d={};var _0x542ae6;var _0x4e46e4;return db['DeskConfiguration']['findOne']({'where':{'id':_0x463fbb['params']['id']}})[_0x5f89('0x24')](handleEntityNotFound(_0x1cfc9b,null))[_0x5f89('0x24')](function(_0x368fed){if(_0x368fed){_0x542ae6=_0x368fed;_0x31e63d[_0x5f89('0x31')]=_['keys'](db[_0x5f89('0x51')][_0x5f89('0x2d')]);_0x31e63d['query']=_[_0x5f89('0x33')](_0x463fbb[_0x5f89('0x32')]);_0x31e63d[_0x5f89('0x34')]=_[_0x5f89('0x35')](_0x31e63d[_0x5f89('0x31')],_0x31e63d[_0x5f89('0x32')]);_0x2f8a39['attributes']=_['intersection'](_0x31e63d[_0x5f89('0x31')],qs['fields'](_0x463fbb[_0x5f89('0x32')][_0x5f89('0x36')]));_0x2f8a39[_0x5f89('0x37')]=_0x2f8a39[_0x5f89('0x37')][_0x5f89('0x38')]?_0x2f8a39[_0x5f89('0x37')]:_0x31e63d[_0x5f89('0x31')];_0x2f8a39['order']=qs['sort'](_0x463fbb[_0x5f89('0x32')][_0x5f89('0x3b')]);_0x2f8a39['where']=qs['filters'](_['pick'](_0x463fbb[_0x5f89('0x32')],_0x31e63d['filters']));if(_0x463fbb[_0x5f89('0x32')][_0x5f89('0x3e')]){_0x2f8a39[_0x5f89('0x3c')]=_[_0x5f89('0x3f')](_0x2f8a39[_0x5f89('0x3c')],{'$or':_['map'](_0x2f8a39[_0x5f89('0x37')],function(_0x259a2f){var _0x4385b6={};_0x4385b6[_0x259a2f]={'$like':'%'+_0x463fbb[_0x5f89('0x32')]['filter']+'%'};return _0x4385b6;})});}_0x2f8a39=_[_0x5f89('0x3f')]({},_0x2f8a39,_0x463fbb['options']);return _0x542ae6[_0x5f89('0x52')](_0x2f8a39);}})[_0x5f89('0x24')](function(_0x47eb0d){if(_0x47eb0d){_0x4e46e4=_0x47eb0d['length'];if(!_0x463fbb['query'][_0x5f89('0x4d')](_0x5f89('0x39'))){_0x2f8a39[_0x5f89('0x1c')]=qs[_0x5f89('0x1c')](_0x463fbb['query']['limit']);_0x2f8a39['offset']=qs[_0x5f89('0x1e')](_0x463fbb[_0x5f89('0x32')][_0x5f89('0x1e')]);}return _0x542ae6[_0x5f89('0x52')](_0x2f8a39);}})[_0x5f89('0x24')](function(_0x1a6d48){if(_0x1a6d48){return _0x1a6d48?{'count':_0x4e46e4,'rows':_0x1a6d48}:null;}})[_0x5f89('0x24')](respondWithResult(_0x1cfc9b,null))[_0x5f89('0x44')](handleError(_0x1cfc9b,null));};exports[_0x5f89('0x53')]=function(_0x3210ef,_0x21011c,_0x43c048){if(_0x3210ef[_0x5f89('0x4a')]['id']){delete _0x3210ef[_0x5f89('0x4a')]['id'];}return db[_0x5f89('0x2c')]['findOne']({'where':{'id':_0x3210ef[_0x5f89('0x46')]['id']}})[_0x5f89('0x24')](handleEntityNotFound(_0x21011c,null))[_0x5f89('0x24')](function(_0x5e72be){if(_0x5e72be){return _0x5e72be[_0x5f89('0x53')](_0x3210ef[_0x5f89('0x4a')][_0x5f89('0x54')]||[]);}return null;})[_0x5f89('0x24')](respondWithResult(_0x21011c,null))['catch'](handleError(_0x21011c,null));}; \ No newline at end of file +var _0xc713=['findOne','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','to-csv','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','find','create','params','destroy','getFields','DeskField','getSubjects','getDescriptions'];(function(_0x420df7,_0x26fa8b){var _0x59dc5c=function(_0x5d7315){while(--_0x5d7315){_0x420df7['push'](_0x420df7['shift']());}};_0x59dc5c(++_0x26fa8b);}(_0xc713,0xef));var _0x3c71=function(_0x1c0778,_0x167133){_0x1c0778=_0x1c0778-0x0;var _0x1e63d4=_0xc713[_0x1c0778];return _0x1e63d4;};'use strict';var emlformat=require(_0x3c71('0x0'));var rimraf=require(_0x3c71('0x1'));var zipdir=require(_0x3c71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c71('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3c71('0x4'));var util=require(_0x3c71('0x5'));var path=require(_0x3c71('0x6'));var sox=require(_0x3c71('0x7'));var csv=require('to-csv');var ejs=require(_0x3c71('0x8'));var fs=require('fs');var fs_extra=require(_0x3c71('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3c71('0xa'));var querystring=require(_0x3c71('0xb'));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(_0x3c71('0xc'));var logger=require(_0x3c71('0xd'))('api');var utils=require(_0x3c71('0xe'));var config=require(_0x3c71('0xf'));var licenseUtil=require(_0x3c71('0x10'));var db=require(_0x3c71('0x11'))['db'];function respondWithStatusCode(_0x175b11,_0x5e74e6){_0x5e74e6=_0x5e74e6||0xcc;return function(_0x5b3a22){if(_0x5b3a22){return _0x175b11[_0x3c71('0x12')](_0x5e74e6);}return _0x175b11[_0x3c71('0x13')](_0x5e74e6)['end']();};}function respondWithResult(_0x130070,_0x510761){_0x510761=_0x510761||0xc8;return function(_0x3adc0a){if(_0x3adc0a){return _0x130070['status'](_0x510761)[_0x3c71('0x14')](_0x3adc0a);}};}function respondWithFilteredResult(_0x3f1ef7,_0x4cb368){return function(_0x116f22){if(_0x116f22){var _0xe770a7=typeof _0x4cb368['offset']===_0x3c71('0x15')&&typeof _0x4cb368['limit']==='undefined';var _0x752d3d=_0x116f22[_0x3c71('0x16')];var _0x1d4fda=_0xe770a7?0x0:_0x4cb368[_0x3c71('0x17')];var _0x4bb5da=_0xe770a7?_0x116f22[_0x3c71('0x16')]:_0x4cb368[_0x3c71('0x17')]+_0x4cb368[_0x3c71('0x18')];var _0x1525c5;if(_0x4bb5da>=_0x752d3d){_0x4bb5da=_0x752d3d;_0x1525c5=0xc8;}else{_0x1525c5=0xce;}_0x3f1ef7[_0x3c71('0x13')](_0x1525c5);return _0x3f1ef7[_0x3c71('0x19')](_0x3c71('0x1a'),_0x1d4fda+'-'+_0x4bb5da+'/'+_0x752d3d)['json'](_0x116f22);}return null;};}function patchUpdates(_0x11e1b2){return function(_0x5b0b3e){try{jsonpatch[_0x3c71('0x1b')](_0x5b0b3e,_0x11e1b2,!![]);}catch(_0x1f5921){return BPromise[_0x3c71('0x1c')](_0x1f5921);}return _0x5b0b3e[_0x3c71('0x1d')]();};}function saveUpdates(_0x475c4a,_0x418886){return function(_0x13d69f){if(_0x13d69f){return _0x13d69f[_0x3c71('0x1e')](_0x475c4a)[_0x3c71('0x1f')](function(_0x106ea3){return _0x106ea3;});}return null;};}function removeEntity(_0x4f5bdd,_0x4845f6){return function(_0x2bdc8f){if(_0x2bdc8f){return _0x2bdc8f['destroy']()[_0x3c71('0x1f')](function(){_0x4f5bdd[_0x3c71('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd0df,_0x26c1db){return function(_0x5874ec){if(!_0x5874ec){_0x3fd0df[_0x3c71('0x12')](0x194);}return _0x5874ec;};}function handleError(_0x7928e1,_0x2776b1){_0x2776b1=_0x2776b1||0x1f4;return function(_0x118784){logger[_0x3c71('0x20')](_0x118784[_0x3c71('0x21')]);if(_0x118784[_0x3c71('0x22')]){delete _0x118784['name'];}_0x7928e1[_0x3c71('0x13')](_0x2776b1)[_0x3c71('0x23')](_0x118784);};}exports[_0x3c71('0x24')]=function(_0x425ae3,_0x5b7f6e){var _0x4e2e0f={},_0x397199={},_0x37bb6b={'count':0x0,'rows':[]};var _0x5c5fec=_['map'](db[_0x3c71('0x25')][_0x3c71('0x26')],function(_0x2bd3bc){return{'name':_0x2bd3bc[_0x3c71('0x27')],'type':_0x2bd3bc[_0x3c71('0x28')]['key']};});_0x397199[_0x3c71('0x29')]=_[_0x3c71('0x2a')](_0x5c5fec,_0x3c71('0x22'));_0x397199[_0x3c71('0x2b')]=_['keys'](_0x425ae3[_0x3c71('0x2b')]);_0x397199['filters']=_[_0x3c71('0x2c')](_0x397199[_0x3c71('0x29')],_0x397199[_0x3c71('0x2b')]);_0x4e2e0f[_0x3c71('0x2d')]=_[_0x3c71('0x2c')](_0x397199[_0x3c71('0x29')],qs[_0x3c71('0x2e')](_0x425ae3[_0x3c71('0x2b')][_0x3c71('0x2e')]));_0x4e2e0f[_0x3c71('0x2d')]=_0x4e2e0f[_0x3c71('0x2d')][_0x3c71('0x2f')]?_0x4e2e0f[_0x3c71('0x2d')]:_0x397199[_0x3c71('0x29')];if(!_0x425ae3[_0x3c71('0x2b')][_0x3c71('0x30')](_0x3c71('0x31'))){_0x4e2e0f[_0x3c71('0x18')]=qs[_0x3c71('0x18')](_0x425ae3[_0x3c71('0x2b')]['limit']);_0x4e2e0f[_0x3c71('0x17')]=qs[_0x3c71('0x17')](_0x425ae3[_0x3c71('0x2b')][_0x3c71('0x17')]);}_0x4e2e0f[_0x3c71('0x32')]=qs[_0x3c71('0x33')](_0x425ae3[_0x3c71('0x2b')]['sort']);_0x4e2e0f[_0x3c71('0x34')]=qs[_0x3c71('0x35')](_[_0x3c71('0x36')](_0x425ae3[_0x3c71('0x2b')],_0x397199[_0x3c71('0x35')]),_0x5c5fec);if(_0x425ae3['query'][_0x3c71('0x37')]){_0x4e2e0f[_0x3c71('0x34')]=_['merge'](_0x4e2e0f[_0x3c71('0x34')],{'$or':_[_0x3c71('0x2a')](_0x5c5fec,function(_0x15d96c){if(_0x15d96c[_0x3c71('0x28')]!==_0x3c71('0x38')){var _0x2f0d03={};_0x2f0d03[_0x15d96c[_0x3c71('0x22')]]={'$like':'%'+_0x425ae3['query'][_0x3c71('0x37')]+'%'};return _0x2f0d03;}})});}_0x4e2e0f=_[_0x3c71('0x39')]({},_0x4e2e0f,_0x425ae3[_0x3c71('0x3a')]);var _0x14a664={'where':_0x4e2e0f[_0x3c71('0x34')]};return db[_0x3c71('0x25')]['count'](_0x14a664)[_0x3c71('0x1f')](function(_0xcbaa59){_0x37bb6b['count']=_0xcbaa59;if(_0x425ae3[_0x3c71('0x2b')][_0x3c71('0x3b')]){_0x4e2e0f[_0x3c71('0x3c')]=[{'all':!![]}];}return db[_0x3c71('0x25')][_0x3c71('0x3d')](_0x4e2e0f);})[_0x3c71('0x1f')](function(_0x2b992f){_0x37bb6b['rows']=_0x2b992f;return _0x37bb6b;})[_0x3c71('0x1f')](respondWithFilteredResult(_0x5b7f6e,_0x4e2e0f))[_0x3c71('0x3e')](handleError(_0x5b7f6e,null));};exports[_0x3c71('0x3f')]=function(_0x262cf8,_0x199ca7){var _0x6f866={'raw':![],'where':{'id':_0x262cf8['params']['id']}},_0x3e50c4={};_0x3e50c4['model']=_['keys'](db[_0x3c71('0x25')][_0x3c71('0x26')]);_0x3e50c4[_0x3c71('0x2b')]=_[_0x3c71('0x40')](_0x262cf8[_0x3c71('0x2b')]);_0x3e50c4['filters']=_[_0x3c71('0x2c')](_0x3e50c4['model'],_0x3e50c4[_0x3c71('0x2b')]);_0x6f866[_0x3c71('0x2d')]=_[_0x3c71('0x2c')](_0x3e50c4[_0x3c71('0x29')],qs['fields'](_0x262cf8[_0x3c71('0x2b')]['fields']));_0x6f866[_0x3c71('0x2d')]=_0x6f866[_0x3c71('0x2d')][_0x3c71('0x2f')]?_0x6f866[_0x3c71('0x2d')]:_0x3e50c4['model'];if(_0x262cf8['query']['includeAll']){_0x6f866[_0x3c71('0x3c')]=[{'all':!![]}];}_0x6f866=_[_0x3c71('0x39')]({},_0x6f866,_0x262cf8[_0x3c71('0x3a')]);return db[_0x3c71('0x25')][_0x3c71('0x41')](_0x6f866)[_0x3c71('0x1f')](handleEntityNotFound(_0x199ca7,null))[_0x3c71('0x1f')](respondWithResult(_0x199ca7,null))[_0x3c71('0x3e')](handleError(_0x199ca7,null));};exports[_0x3c71('0x42')]=function(_0x35e480,_0x58e348){return db['DeskConfiguration']['create'](_0x35e480['body'],{})['then'](respondWithResult(_0x58e348,0xc9))['catch'](handleError(_0x58e348,null));};exports['update']=function(_0x37e093,_0x5c0146){if(_0x37e093['body']['id']){delete _0x37e093['body']['id'];}return db[_0x3c71('0x25')][_0x3c71('0x41')]({'where':{'id':_0x37e093[_0x3c71('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c0146,null))[_0x3c71('0x1f')](saveUpdates(_0x37e093['body'],null))[_0x3c71('0x1f')](respondWithResult(_0x5c0146,null))[_0x3c71('0x3e')](handleError(_0x5c0146,null));};exports[_0x3c71('0x44')]=function(_0x55934e,_0x18f785){return db[_0x3c71('0x25')][_0x3c71('0x41')]({'where':{'id':_0x55934e[_0x3c71('0x43')]['id']}})[_0x3c71('0x1f')](handleEntityNotFound(_0x18f785,null))[_0x3c71('0x1f')](removeEntity(_0x18f785,null))[_0x3c71('0x3e')](handleError(_0x18f785,null));};exports[_0x3c71('0x45')]=function(_0x5e03b5,_0x5bba58,_0x3c9b06){var _0x3d98d3={};var _0x132412={};var _0x4391f2;var _0x571106;return db[_0x3c71('0x25')]['findOne']({'where':{'id':_0x5e03b5[_0x3c71('0x43')]['id']}})[_0x3c71('0x1f')](handleEntityNotFound(_0x5bba58,null))[_0x3c71('0x1f')](function(_0x2c0bef){if(_0x2c0bef){_0x4391f2=_0x2c0bef;_0x132412[_0x3c71('0x29')]=_[_0x3c71('0x40')](db['DeskField'][_0x3c71('0x26')]);_0x132412[_0x3c71('0x2b')]=_[_0x3c71('0x40')](_0x5e03b5[_0x3c71('0x2b')]);_0x132412['filters']=_[_0x3c71('0x2c')](_0x132412[_0x3c71('0x29')],_0x132412[_0x3c71('0x2b')]);_0x3d98d3[_0x3c71('0x2d')]=_[_0x3c71('0x2c')](_0x132412[_0x3c71('0x29')],qs[_0x3c71('0x2e')](_0x5e03b5[_0x3c71('0x2b')]['fields']));_0x3d98d3[_0x3c71('0x2d')]=_0x3d98d3[_0x3c71('0x2d')][_0x3c71('0x2f')]?_0x3d98d3['attributes']:_0x132412[_0x3c71('0x29')];_0x3d98d3[_0x3c71('0x32')]=qs[_0x3c71('0x33')](_0x5e03b5[_0x3c71('0x2b')][_0x3c71('0x33')]);_0x3d98d3['where']=qs[_0x3c71('0x35')](_[_0x3c71('0x36')](_0x5e03b5[_0x3c71('0x2b')],_0x132412[_0x3c71('0x35')]));if(_0x5e03b5[_0x3c71('0x2b')][_0x3c71('0x37')]){_0x3d98d3[_0x3c71('0x34')]=_[_0x3c71('0x39')](_0x3d98d3[_0x3c71('0x34')],{'$or':_[_0x3c71('0x2a')](_0x3d98d3[_0x3c71('0x2d')],function(_0x1eec62){var _0x342994={};_0x342994[_0x1eec62]={'$like':'%'+_0x5e03b5[_0x3c71('0x2b')][_0x3c71('0x37')]+'%'};return _0x342994;})});}_0x3d98d3=_[_0x3c71('0x39')]({},_0x3d98d3,_0x5e03b5['options']);return _0x4391f2['getFields'](_0x3d98d3);}})[_0x3c71('0x1f')](function(_0x483f9a){if(_0x483f9a){_0x571106=_0x483f9a['length'];if(!_0x5e03b5[_0x3c71('0x2b')][_0x3c71('0x30')](_0x3c71('0x31'))){_0x3d98d3[_0x3c71('0x18')]=qs[_0x3c71('0x18')](_0x5e03b5[_0x3c71('0x2b')][_0x3c71('0x18')]);_0x3d98d3[_0x3c71('0x17')]=qs[_0x3c71('0x17')](_0x5e03b5['query']['offset']);}return _0x4391f2['getFields'](_0x3d98d3);}})[_0x3c71('0x1f')](function(_0x38a871){if(_0x38a871){return _0x38a871?{'count':_0x571106,'rows':_0x38a871}:null;}})[_0x3c71('0x1f')](respondWithResult(_0x5bba58,null))[_0x3c71('0x3e')](handleError(_0x5bba58,null));};exports['getSubjects']=function(_0x2e80c2,_0x5b20db,_0x59b76f){var _0x88a374={};var _0x37398e={};var _0x56b755;var _0x405516;return db[_0x3c71('0x25')]['findOne']({'where':{'id':_0x2e80c2[_0x3c71('0x43')]['id']}})[_0x3c71('0x1f')](handleEntityNotFound(_0x5b20db,null))[_0x3c71('0x1f')](function(_0x5b5248){if(_0x5b5248){_0x56b755=_0x5b5248;_0x37398e[_0x3c71('0x29')]=_[_0x3c71('0x40')](db[_0x3c71('0x46')][_0x3c71('0x26')]);_0x37398e['query']=_[_0x3c71('0x40')](_0x2e80c2[_0x3c71('0x2b')]);_0x37398e[_0x3c71('0x35')]=_['intersection'](_0x37398e['model'],_0x37398e[_0x3c71('0x2b')]);_0x88a374[_0x3c71('0x2d')]=_[_0x3c71('0x2c')](_0x37398e[_0x3c71('0x29')],qs[_0x3c71('0x2e')](_0x2e80c2[_0x3c71('0x2b')][_0x3c71('0x2e')]));_0x88a374[_0x3c71('0x2d')]=_0x88a374[_0x3c71('0x2d')][_0x3c71('0x2f')]?_0x88a374['attributes']:_0x37398e['model'];_0x88a374[_0x3c71('0x32')]=qs['sort'](_0x2e80c2[_0x3c71('0x2b')]['sort']);_0x88a374[_0x3c71('0x34')]=qs[_0x3c71('0x35')](_[_0x3c71('0x36')](_0x2e80c2[_0x3c71('0x2b')],_0x37398e[_0x3c71('0x35')]));if(_0x2e80c2['query'][_0x3c71('0x37')]){_0x88a374[_0x3c71('0x34')]=_['merge'](_0x88a374[_0x3c71('0x34')],{'$or':_[_0x3c71('0x2a')](_0x88a374[_0x3c71('0x2d')],function(_0x25705c){var _0xecf066={};_0xecf066[_0x25705c]={'$like':'%'+_0x2e80c2[_0x3c71('0x2b')][_0x3c71('0x37')]+'%'};return _0xecf066;})});}_0x88a374=_['merge']({},_0x88a374,_0x2e80c2['options']);return _0x56b755[_0x3c71('0x47')](_0x88a374);}})[_0x3c71('0x1f')](function(_0x514831){if(_0x514831){_0x405516=_0x514831[_0x3c71('0x2f')];if(!_0x2e80c2[_0x3c71('0x2b')][_0x3c71('0x30')](_0x3c71('0x31'))){_0x88a374['limit']=qs['limit'](_0x2e80c2['query'][_0x3c71('0x18')]);_0x88a374[_0x3c71('0x17')]=qs['offset'](_0x2e80c2['query'][_0x3c71('0x17')]);}return _0x56b755[_0x3c71('0x47')](_0x88a374);}})[_0x3c71('0x1f')](function(_0x57b255){if(_0x57b255){return _0x57b255?{'count':_0x405516,'rows':_0x57b255}:null;}})[_0x3c71('0x1f')](respondWithResult(_0x5b20db,null))[_0x3c71('0x3e')](handleError(_0x5b20db,null));};exports[_0x3c71('0x48')]=function(_0x34760b,_0xf28481,_0x762136){var _0x3e8b3b={};var _0x3c84ca={};var _0x353a91;var _0x1aee55;return db[_0x3c71('0x25')][_0x3c71('0x49')]({'where':{'id':_0x34760b[_0x3c71('0x43')]['id']}})[_0x3c71('0x1f')](handleEntityNotFound(_0xf28481,null))['then'](function(_0x470384){if(_0x470384){_0x353a91=_0x470384;_0x3c84ca[_0x3c71('0x29')]=_['keys'](db[_0x3c71('0x46')][_0x3c71('0x26')]);_0x3c84ca[_0x3c71('0x2b')]=_[_0x3c71('0x40')](_0x34760b[_0x3c71('0x2b')]);_0x3c84ca[_0x3c71('0x35')]=_[_0x3c71('0x2c')](_0x3c84ca['model'],_0x3c84ca[_0x3c71('0x2b')]);_0x3e8b3b[_0x3c71('0x2d')]=_[_0x3c71('0x2c')](_0x3c84ca[_0x3c71('0x29')],qs[_0x3c71('0x2e')](_0x34760b[_0x3c71('0x2b')][_0x3c71('0x2e')]));_0x3e8b3b[_0x3c71('0x2d')]=_0x3e8b3b[_0x3c71('0x2d')][_0x3c71('0x2f')]?_0x3e8b3b[_0x3c71('0x2d')]:_0x3c84ca[_0x3c71('0x29')];_0x3e8b3b['order']=qs[_0x3c71('0x33')](_0x34760b[_0x3c71('0x2b')][_0x3c71('0x33')]);_0x3e8b3b[_0x3c71('0x34')]=qs['filters'](_[_0x3c71('0x36')](_0x34760b[_0x3c71('0x2b')],_0x3c84ca[_0x3c71('0x35')]));if(_0x34760b['query'][_0x3c71('0x37')]){_0x3e8b3b[_0x3c71('0x34')]=_[_0x3c71('0x39')](_0x3e8b3b[_0x3c71('0x34')],{'$or':_['map'](_0x3e8b3b[_0x3c71('0x2d')],function(_0x31c9d0){var _0x13b5da={};_0x13b5da[_0x31c9d0]={'$like':'%'+_0x34760b[_0x3c71('0x2b')][_0x3c71('0x37')]+'%'};return _0x13b5da;})});}_0x3e8b3b=_[_0x3c71('0x39')]({},_0x3e8b3b,_0x34760b[_0x3c71('0x3a')]);return _0x353a91[_0x3c71('0x48')](_0x3e8b3b);}})[_0x3c71('0x1f')](function(_0x4849a3){if(_0x4849a3){_0x1aee55=_0x4849a3[_0x3c71('0x2f')];if(!_0x34760b['query'][_0x3c71('0x30')](_0x3c71('0x31'))){_0x3e8b3b['limit']=qs[_0x3c71('0x18')](_0x34760b[_0x3c71('0x2b')][_0x3c71('0x18')]);_0x3e8b3b[_0x3c71('0x17')]=qs[_0x3c71('0x17')](_0x34760b[_0x3c71('0x2b')][_0x3c71('0x17')]);}return _0x353a91['getDescriptions'](_0x3e8b3b);}})['then'](function(_0x2ee98b){if(_0x2ee98b){return _0x2ee98b?{'count':_0x1aee55,'rows':_0x2ee98b}:null;}})[_0x3c71('0x1f')](respondWithResult(_0xf28481,null))[_0x3c71('0x3e')](handleError(_0xf28481,null));};exports['getTags']=function(_0x3183b0,_0x5ea225,_0x3c74f8){var _0x5b5149={};var _0xcc5ba3={};var _0x3aec87;var _0xf796ff;return db[_0x3c71('0x25')][_0x3c71('0x49')]({'where':{'id':_0x3183b0[_0x3c71('0x43')]['id']}})['then'](handleEntityNotFound(_0x5ea225,null))[_0x3c71('0x1f')](function(_0x2af26c){if(_0x2af26c){_0x3aec87=_0x2af26c;_0xcc5ba3['model']=_[_0x3c71('0x40')](db[_0x3c71('0x4a')][_0x3c71('0x26')]);_0xcc5ba3[_0x3c71('0x2b')]=_['keys'](_0x3183b0[_0x3c71('0x2b')]);_0xcc5ba3['filters']=_[_0x3c71('0x2c')](_0xcc5ba3['model'],_0xcc5ba3[_0x3c71('0x2b')]);_0x5b5149['attributes']=_[_0x3c71('0x2c')](_0xcc5ba3[_0x3c71('0x29')],qs[_0x3c71('0x2e')](_0x3183b0[_0x3c71('0x2b')][_0x3c71('0x2e')]));_0x5b5149['attributes']=_0x5b5149[_0x3c71('0x2d')][_0x3c71('0x2f')]?_0x5b5149[_0x3c71('0x2d')]:_0xcc5ba3['model'];_0x5b5149[_0x3c71('0x32')]=qs[_0x3c71('0x33')](_0x3183b0[_0x3c71('0x2b')][_0x3c71('0x33')]);_0x5b5149[_0x3c71('0x34')]=qs['filters'](_[_0x3c71('0x36')](_0x3183b0[_0x3c71('0x2b')],_0xcc5ba3[_0x3c71('0x35')]));if(_0x3183b0['query'][_0x3c71('0x37')]){_0x5b5149[_0x3c71('0x34')]=_[_0x3c71('0x39')](_0x5b5149['where'],{'$or':_[_0x3c71('0x2a')](_0x5b5149[_0x3c71('0x2d')],function(_0x42e9c5){var _0x39b803={};_0x39b803[_0x42e9c5]={'$like':'%'+_0x3183b0[_0x3c71('0x2b')][_0x3c71('0x37')]+'%'};return _0x39b803;})});}_0x5b5149=_[_0x3c71('0x39')]({},_0x5b5149,_0x3183b0[_0x3c71('0x3a')]);return _0x3aec87[_0x3c71('0x4b')](_0x5b5149);}})['then'](function(_0x49fa78){if(_0x49fa78){_0xf796ff=_0x49fa78[_0x3c71('0x2f')];if(!_0x3183b0[_0x3c71('0x2b')][_0x3c71('0x30')](_0x3c71('0x31'))){_0x5b5149[_0x3c71('0x18')]=qs[_0x3c71('0x18')](_0x3183b0[_0x3c71('0x2b')]['limit']);_0x5b5149[_0x3c71('0x17')]=qs[_0x3c71('0x17')](_0x3183b0[_0x3c71('0x2b')][_0x3c71('0x17')]);}return _0x3aec87[_0x3c71('0x4b')](_0x5b5149);}})[_0x3c71('0x1f')](function(_0x3df777){if(_0x3df777){return _0x3df777?{'count':_0xf796ff,'rows':_0x3df777}:null;}})[_0x3c71('0x1f')](respondWithResult(_0x5ea225,null))[_0x3c71('0x3e')](handleError(_0x5ea225,null));};exports[_0x3c71('0x4c')]=function(_0x80ab7a,_0x57c0a1,_0x201610){if(_0x80ab7a['body']['id']){delete _0x80ab7a['body']['id'];}return db[_0x3c71('0x25')][_0x3c71('0x49')]({'where':{'id':_0x80ab7a[_0x3c71('0x43')]['id']}})[_0x3c71('0x1f')](handleEntityNotFound(_0x57c0a1,null))[_0x3c71('0x1f')](function(_0x4ada04){if(_0x4ada04){return _0x4ada04['setTags'](_0x80ab7a['body'][_0x3c71('0x4d')]||[]);}return null;})[_0x3c71('0x1f')](respondWithResult(_0x57c0a1,null))[_0x3c71('0x3e')](handleError(_0x57c0a1,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 446ecef..0e813bf 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 _0xe2db=['../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','bluebird','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2db,0x83));var _0xbe2d=function(_0x229049,_0x5c257e){_0x229049=_0x229049-0x0;var _0x23791f=_0xe2db[_0x229049];return _0x23791f;};'use strict';var _=require(_0xbe2d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbe2d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe2d('0x2'));var rimraf=require(_0xbe2d('0x3'));var config=require(_0xbe2d('0x4'));var attributes=require(_0xbe2d('0x5'));module['exports']=function(_0x5b5b4a,_0x3e6057){return _0x5b5b4a[_0xbe2d('0x6')](_0xbe2d('0x7'),attributes,{'tableName':_0xbe2d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe962=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','api','moment','request-promise','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xe962,0x9f));var _0x2e96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe962[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2e96('0x0'));var util=require(_0x2e96('0x1'));var logger=require('../../config/logger')(_0x2e96('0x2'));var moment=require(_0x2e96('0x3'));var BPromise=require('bluebird');var rp=require(_0x2e96('0x4'));var fs=require('fs');var path=require(_0x2e96('0x5'));var rimraf=require('rimraf');var config=require(_0x2e96('0x6'));var attributes=require(_0x2e96('0x7'));module[_0x2e96('0x8')]=function(_0x2d77ad,_0x2a8832){return _0x2d77ad[_0x2e96('0x9')](_0x2e96('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5f7d4eb..9588b27 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 _0x1867=['http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x36bfeb,_0x39d784){var _0x5bde81=function(_0x19e736){while(--_0x19e736){_0x36bfeb['push'](_0x36bfeb['shift']());}};_0x5bde81(++_0x39d784);}(_0x1867,0xb5));var _0x7186=function(_0x17f254,_0x24d202){_0x17f254=_0x17f254-0x0;var _0xe81597=_0x1867[_0x17f254];return _0xe81597;};'use strict';var _=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var moment=require('moment');var BPromise=require(_0x7186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7186('0x3'));var db=require(_0x7186('0x4'))['db'];var utils=require(_0x7186('0x5'));var logger=require(_0x7186('0x6'))(_0x7186('0x7'));var config=require(_0x7186('0x8'));var jayson=require(_0x7186('0x9'));var client=jayson[_0x7186('0xa')][_0x7186('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bea9f,_0x45938b,_0x18c4b9){return new BPromise(function(_0x546a90,_0x350c54){return client[_0x7186('0xc')](_0x4bea9f,_0x18c4b9)[_0x7186('0xd')](function(_0xb49c4b){logger['info'](_0x7186('0xe'),_0x45938b,_0x7186('0xf'));logger[_0x7186('0x10')](_0x7186('0x11'),_0x45938b,_0x7186('0xf'),JSON['stringify'](_0xb49c4b));if(_0xb49c4b[_0x7186('0x12')]){if(_0xb49c4b[_0x7186('0x12')][_0x7186('0x13')]===0x1f4){logger[_0x7186('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x45938b,_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);return _0x350c54(_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x45938b,_0xb49c4b['error'][_0x7186('0x14')]);return _0x546a90(_0xb49c4b[_0x7186('0x12')][_0x7186('0x14')]);}else{logger[_0x7186('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x45938b,_0x7186('0xf'));_0x546a90(_0xb49c4b[_0x7186('0x16')][_0x7186('0x14')]);}})[_0x7186('0x17')](function(_0x6508f5){logger[_0x7186('0x12')](_0x7186('0xe'),_0x45938b,_0x6508f5);_0x350c54(_0x6508f5);});});} \ No newline at end of file +var _0x24d5=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x24d5,0xa9));var _0x524d=function(_0x2f477d,_0x2dfcc6){_0x2f477d=_0x2f477d-0x0;var _0x434974=_0x24d5[_0x2f477d];return _0x434974;};'use strict';var _=require(_0x524d('0x0'));var util=require(_0x524d('0x1'));var moment=require(_0x524d('0x2'));var BPromise=require('bluebird');var rs=require(_0x524d('0x3'));var fs=require('fs');var Redis=require(_0x524d('0x4'));var db=require(_0x524d('0x5'))['db'];var utils=require(_0x524d('0x6'));var logger=require(_0x524d('0x7'))(_0x524d('0x8'));var config=require(_0x524d('0x9'));var jayson=require(_0x524d('0xa'));var client=jayson['client'][_0x524d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c27ee,_0x348814,_0xb2cba){return new BPromise(function(_0x40702d,_0x30ade2){return client[_0x524d('0xc')](_0x1c27ee,_0xb2cba)[_0x524d('0xd')](function(_0x25172c){logger[_0x524d('0xe')](_0x524d('0xf'),_0x348814,_0x524d('0x10'));logger['debug'](_0x524d('0x11'),_0x348814,'request\x20sent',JSON[_0x524d('0x12')](_0x25172c));if(_0x25172c[_0x524d('0x13')]){if(_0x25172c[_0x524d('0x13')][_0x524d('0x14')]===0x1f4){logger['error'](_0x524d('0xf'),_0x348814,_0x25172c[_0x524d('0x13')][_0x524d('0x15')]);return _0x30ade2(_0x25172c[_0x524d('0x13')]['message']);}logger[_0x524d('0x13')](_0x524d('0xf'),_0x348814,_0x25172c[_0x524d('0x13')][_0x524d('0x15')]);return _0x40702d(_0x25172c[_0x524d('0x13')][_0x524d('0x15')]);}else{logger[_0x524d('0xe')](_0x524d('0xf'),_0x348814,_0x524d('0x10'));_0x40702d(_0x25172c[_0x524d('0x16')][_0x524d('0x15')]);}})[_0x524d('0x17')](function(_0x2c47b0){logger[_0x524d('0x13')](_0x524d('0xf'),_0x348814,_0x2c47b0);_0x30ade2(_0x2c47b0);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index b593811..144b59d 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 _0x087a=['fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x16f789,_0x310273){var _0x6940c3=function(_0x65e038){while(--_0x65e038){_0x16f789['push'](_0x16f789['shift']());}};_0x6940c3(++_0x310273);}(_0x087a,0x9a));var _0xa087=function(_0x5a9d7c,_0x22e7d6){_0x5a9d7c=_0x5a9d7c-0x0;var _0x2be553=_0x087a[_0x5a9d7c];return _0x2be553;};'use strict';var multer=require(_0xa087('0x0'));var util=require(_0xa087('0x1'));var path=require(_0xa087('0x2'));var timeout=require(_0xa087('0x3'));var express=require(_0xa087('0x4'));var router=express[_0xa087('0x5')]();var fs_extra=require(_0xa087('0x6'));var auth=require(_0xa087('0x7'));var interaction=require(_0xa087('0x8'));var config=require('../../config/environment');var controller=require(_0xa087('0x9'));router[_0xa087('0xa')]('/',auth[_0xa087('0xb')](),controller[_0xa087('0xc')]);router[_0xa087('0xa')]('/:id',auth[_0xa087('0xb')](),controller['show']);router['post']('/',auth[_0xa087('0xb')](),controller[_0xa087('0xd')]);router[_0xa087('0xe')](_0xa087('0xf'),auth[_0xa087('0xb')](),controller[_0xa087('0x10')]);router[_0xa087('0x11')]('/:id',auth[_0xa087('0xb')](),controller[_0xa087('0x12')]);module[_0xa087('0x13')]=router; \ No newline at end of file +var _0x2764=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3c307c,_0x1b06c4){var _0x32cf08=function(_0x371144){while(--_0x371144){_0x3c307c['push'](_0x3c307c['shift']());}};_0x32cf08(++_0x1b06c4);}(_0x2764,0x13f));var _0x4276=function(_0x5bdda9,_0x361059){_0x5bdda9=_0x5bdda9-0x0;var _0x42ee98=_0x2764[_0x5bdda9];return _0x42ee98;};'use strict';var multer=require(_0x4276('0x0'));var util=require(_0x4276('0x1'));var path=require(_0x4276('0x2'));var timeout=require(_0x4276('0x3'));var express=require(_0x4276('0x4'));var router=express[_0x4276('0x5')]();var fs_extra=require(_0x4276('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4276('0x7'));var config=require(_0x4276('0x8'));var controller=require(_0x4276('0x9'));router[_0x4276('0xa')]('/',auth[_0x4276('0xb')](),controller['index']);router[_0x4276('0xa')](_0x4276('0xc'),auth[_0x4276('0xb')](),controller[_0x4276('0xd')]);router[_0x4276('0xe')]('/',auth['isAuthenticated'](),controller[_0x4276('0xf')]);router['put']('/:id',auth[_0x4276('0xb')](),controller[_0x4276('0x10')]);router[_0x4276('0x11')](_0x4276('0xc'),auth[_0x4276('0xb')](),controller[_0x4276('0x12')]);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 262285e..efe64da 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 _0x63f5=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports'];(function(_0x3aaf01,_0x24624f){var _0x2561d5=function(_0x426137){while(--_0x426137){_0x3aaf01['push'](_0x3aaf01['shift']());}};_0x2561d5(++_0x24624f);}(_0x63f5,0x1ca));var _0x563f=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x63f5[_0x680821];return _0x3f132c;};'use strict';var Sequelize=require('sequelize');module[_0x563f('0x0')]={'type':{'type':Sequelize[_0x563f('0x1')]('string',_0x563f('0x2'),_0x563f('0x3'),_0x563f('0x4'),_0x563f('0x5')),'defaultValue':_0x563f('0x6')},'content':{'type':Sequelize[_0x563f('0x7')]},'key':{'type':Sequelize[_0x563f('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x563f('0x2'),_0x563f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x563f('0x7')]},'nameField':{'type':Sequelize[_0x563f('0x7')]},'customField':{'type':Sequelize[_0x563f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x563f('0x7')]}}; \ No newline at end of file +var _0xd7d0=['exports','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x412d4f,_0x4a368f){var _0x4e8f13=function(_0x599a51){while(--_0x599a51){_0x412d4f['push'](_0x412d4f['shift']());}};_0x4e8f13(++_0x4a368f);}(_0xd7d0,0xe7));var _0x0d7d=function(_0xfeba9,_0x28c392){_0xfeba9=_0xfeba9-0x0;var _0x266971=_0xd7d0[_0xfeba9];return _0x266971;};'use strict';var Sequelize=require(_0x0d7d('0x0'));module[_0x0d7d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0d7d('0x2'),'variable',_0x0d7d('0x3'),_0x0d7d('0x4'),_0x0d7d('0x5')),'defaultValue':_0x0d7d('0x2')},'content':{'type':Sequelize[_0x0d7d('0x6')]},'key':{'type':Sequelize[_0x0d7d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x0d7d('0x2'),'variable',_0x0d7d('0x3'))},'keyContent':{'type':Sequelize[_0x0d7d('0x6')]},'idField':{'type':Sequelize[_0x0d7d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0d7d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0d7d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index a4b6722..fa2345b 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 _0xefce=['ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x34e747,_0x173163){var _0x200a90=function(_0x2cfb42){while(--_0x2cfb42){_0x34e747['push'](_0x34e747['shift']());}};_0x200a90(++_0x173163);}(_0xefce,0x1e8));var _0xeefc=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xefce[_0x1ac120];return _0x19b703;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeefc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeefc('0x1'));var moment=require(_0xeefc('0x2'));var BPromise=require(_0xeefc('0x3'));var Mustache=require(_0xeefc('0x4'));var util=require(_0xeefc('0x5'));var path=require(_0xeefc('0x6'));var sox=require(_0xeefc('0x7'));var csv=require(_0xeefc('0x8'));var ejs=require(_0xeefc('0x9'));var fs=require('fs');var fs_extra=require(_0xeefc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeefc('0xb'));var jsforce=require(_0xeefc('0xc'));var deskjs=require(_0xeefc('0xd'));var toCsv=require(_0xeefc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeefc('0xe'));var authService=require(_0xeefc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeefc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeefc('0x11'))(_0xeefc('0x12'));var utils=require('../../config/utils');var config=require(_0xeefc('0x13'));var licenseUtil=require(_0xeefc('0x14'));var db=require(_0xeefc('0x15'))['db'];function respondWithStatusCode(_0x5f255a,_0x454066){_0x454066=_0x454066||0xcc;return function(_0x3e9251){if(_0x3e9251){return _0x5f255a[_0xeefc('0x16')](_0x454066);}return _0x5f255a[_0xeefc('0x17')](_0x454066)[_0xeefc('0x18')]();};}function respondWithResult(_0x405ba3,_0xa0e71a){_0xa0e71a=_0xa0e71a||0xc8;return function(_0x4537e2){if(_0x4537e2){return _0x405ba3[_0xeefc('0x17')](_0xa0e71a)[_0xeefc('0x19')](_0x4537e2);}};}function respondWithFilteredResult(_0x224d28,_0x5d728e){return function(_0x3d8489){if(_0x3d8489){var _0x5c447b=typeof _0x5d728e[_0xeefc('0x1a')]===_0xeefc('0x1b')&&typeof _0x5d728e[_0xeefc('0x1c')]===_0xeefc('0x1b');var _0x15baaa=_0x3d8489['count'];var _0x1c247e=_0x5c447b?0x0:_0x5d728e[_0xeefc('0x1a')];var _0x55c2fb=_0x5c447b?_0x3d8489[_0xeefc('0x1d')]:_0x5d728e[_0xeefc('0x1a')]+_0x5d728e[_0xeefc('0x1c')];var _0x4ba684;if(_0x55c2fb>=_0x15baaa){_0x55c2fb=_0x15baaa;_0x4ba684=0xc8;}else{_0x4ba684=0xce;}_0x224d28[_0xeefc('0x17')](_0x4ba684);return _0x224d28[_0xeefc('0x1e')]('Content-Range',_0x1c247e+'-'+_0x55c2fb+'/'+_0x15baaa)[_0xeefc('0x19')](_0x3d8489);}return null;};}function patchUpdates(_0x5b34b9){return function(_0x208959){try{jsonpatch[_0xeefc('0x1f')](_0x208959,_0x5b34b9,!![]);}catch(_0x3cebaa){return BPromise[_0xeefc('0x20')](_0x3cebaa);}return _0x208959[_0xeefc('0x21')]();};}function saveUpdates(_0x2f475e,_0x2ac6e0){return function(_0x4ec1c9){if(_0x4ec1c9){return _0x4ec1c9[_0xeefc('0x22')](_0x2f475e)[_0xeefc('0x23')](function(_0x6e690b){return _0x6e690b;});}return null;};}function removeEntity(_0xe20f0a,_0x4eea87){return function(_0x48246d){if(_0x48246d){return _0x48246d[_0xeefc('0x24')]()[_0xeefc('0x23')](function(){_0xe20f0a[_0xeefc('0x17')](0xcc)[_0xeefc('0x18')]();});}};}function handleEntityNotFound(_0x4aeaa7,_0x16e60e){return function(_0x3ea299){if(!_0x3ea299){_0x4aeaa7[_0xeefc('0x16')](0x194);}return _0x3ea299;};}function handleError(_0x4776f5,_0x5773c8){_0x5773c8=_0x5773c8||0x1f4;return function(_0x5a8736){logger[_0xeefc('0x25')](_0x5a8736['stack']);if(_0x5a8736[_0xeefc('0x26')]){delete _0x5a8736[_0xeefc('0x26')];}_0x4776f5['status'](_0x5773c8)['send'](_0x5a8736);};}exports[_0xeefc('0x27')]=function(_0x56ea84,_0x56de5f){var _0x453f6e={},_0x1079f2={},_0x4d3aec={'count':0x0,'rows':[]};var _0x47acb4=_[_0xeefc('0x28')](db[_0xeefc('0x29')][_0xeefc('0x2a')],function(_0x13a33e){return{'name':_0x13a33e[_0xeefc('0x2b')],'type':_0x13a33e[_0xeefc('0x2c')][_0xeefc('0x2d')]};});_0x1079f2[_0xeefc('0x2e')]=_[_0xeefc('0x28')](_0x47acb4,'name');_0x1079f2[_0xeefc('0x2f')]=_[_0xeefc('0x30')](_0x56ea84[_0xeefc('0x2f')]);_0x1079f2[_0xeefc('0x31')]=_[_0xeefc('0x32')](_0x1079f2[_0xeefc('0x2e')],_0x1079f2[_0xeefc('0x2f')]);_0x453f6e[_0xeefc('0x33')]=_[_0xeefc('0x32')](_0x1079f2[_0xeefc('0x2e')],qs[_0xeefc('0x34')](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x34')]));_0x453f6e['attributes']=_0x453f6e[_0xeefc('0x33')][_0xeefc('0x35')]?_0x453f6e['attributes']:_0x1079f2[_0xeefc('0x2e')];if(!_0x56ea84[_0xeefc('0x2f')]['hasOwnProperty']('nolimit')){_0x453f6e[_0xeefc('0x1c')]=qs[_0xeefc('0x1c')](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x1c')]);_0x453f6e['offset']=qs[_0xeefc('0x1a')](_0x56ea84['query'][_0xeefc('0x1a')]);}_0x453f6e[_0xeefc('0x36')]=qs['sort'](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x37')]);_0x453f6e[_0xeefc('0x38')]=qs[_0xeefc('0x31')](_[_0xeefc('0x39')](_0x56ea84[_0xeefc('0x2f')],_0x1079f2[_0xeefc('0x31')]),_0x47acb4);if(_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3a')]){_0x453f6e[_0xeefc('0x38')]=_['merge'](_0x453f6e['where'],{'$or':_['map'](_0x47acb4,function(_0x2cab08){if(_0x2cab08[_0xeefc('0x2c')]!==_0xeefc('0x3b')){var _0x463283={};_0x463283[_0x2cab08['name']]={'$like':'%'+_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3a')]+'%'};return _0x463283;}})});}_0x453f6e=_[_0xeefc('0x3c')]({},_0x453f6e,_0x56ea84[_0xeefc('0x3d')]);var _0x4ddf39={'where':_0x453f6e[_0xeefc('0x38')]};return db[_0xeefc('0x29')][_0xeefc('0x1d')](_0x4ddf39)[_0xeefc('0x23')](function(_0x26015c){_0x4d3aec[_0xeefc('0x1d')]=_0x26015c;if(_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3e')]){_0x453f6e[_0xeefc('0x3f')]=[{'all':!![]}];}return db[_0xeefc('0x29')]['findAll'](_0x453f6e);})['then'](function(_0x34786f){_0x4d3aec[_0xeefc('0x40')]=_0x34786f;return _0x4d3aec;})[_0xeefc('0x23')](respondWithFilteredResult(_0x56de5f,_0x453f6e))[_0xeefc('0x41')](handleError(_0x56de5f,null));};exports[_0xeefc('0x42')]=function(_0x44e88,_0x560d99){var _0x49b478={'raw':!![],'where':{'id':_0x44e88[_0xeefc('0x43')]['id']}},_0x28049e={};_0x28049e[_0xeefc('0x2e')]=_[_0xeefc('0x30')](db[_0xeefc('0x29')][_0xeefc('0x2a')]);_0x28049e[_0xeefc('0x2f')]=_[_0xeefc('0x30')](_0x44e88[_0xeefc('0x2f')]);_0x28049e['filters']=_[_0xeefc('0x32')](_0x28049e[_0xeefc('0x2e')],_0x28049e[_0xeefc('0x2f')]);_0x49b478[_0xeefc('0x33')]=_[_0xeefc('0x32')](_0x28049e[_0xeefc('0x2e')],qs[_0xeefc('0x34')](_0x44e88[_0xeefc('0x2f')][_0xeefc('0x34')]));_0x49b478[_0xeefc('0x33')]=_0x49b478[_0xeefc('0x33')][_0xeefc('0x35')]?_0x49b478[_0xeefc('0x33')]:_0x28049e[_0xeefc('0x2e')];if(_0x44e88[_0xeefc('0x2f')]['includeAll']){_0x49b478[_0xeefc('0x3f')]=[{'all':!![]}];}_0x49b478=_[_0xeefc('0x3c')]({},_0x49b478,_0x44e88[_0xeefc('0x3d')]);return db[_0xeefc('0x29')][_0xeefc('0x44')](_0x49b478)[_0xeefc('0x23')](handleEntityNotFound(_0x560d99,null))[_0xeefc('0x23')](respondWithResult(_0x560d99,null))[_0xeefc('0x41')](handleError(_0x560d99,null));};exports[_0xeefc('0x45')]=function(_0x2b5298,_0xaf7a14){return db[_0xeefc('0x29')][_0xeefc('0x45')](_0x2b5298[_0xeefc('0x46')],{})['then'](respondWithResult(_0xaf7a14,0xc9))[_0xeefc('0x41')](handleError(_0xaf7a14,null));};exports[_0xeefc('0x22')]=function(_0x29f739,_0x76f2fa){if(_0x29f739['body']['id']){delete _0x29f739['body']['id'];}return db[_0xeefc('0x29')][_0xeefc('0x44')]({'where':{'id':_0x29f739[_0xeefc('0x43')]['id']}})[_0xeefc('0x23')](handleEntityNotFound(_0x76f2fa,null))[_0xeefc('0x23')](saveUpdates(_0x29f739[_0xeefc('0x46')],null))[_0xeefc('0x23')](respondWithResult(_0x76f2fa,null))[_0xeefc('0x41')](handleError(_0x76f2fa,null));};exports['destroy']=function(_0x5eece6,_0x28e7e9){return db[_0xeefc('0x29')][_0xeefc('0x44')]({'where':{'id':_0x5eece6['params']['id']}})[_0xeefc('0x23')](handleEntityNotFound(_0x28e7e9,null))[_0xeefc('0x23')](removeEntity(_0x28e7e9,null))[_0xeefc('0x41')](handleError(_0x28e7e9,null));}; \ No newline at end of file +var _0x7c09=['stack','name','send','index','map','DeskField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7c09,0x102));var _0x97c0=function(_0x27a08e,_0x1d9a5b){_0x27a08e=_0x27a08e-0x0;var _0x20d509=_0x7c09[_0x27a08e];return _0x20d509;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['DeskField'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['DeskField'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6a13fcc..451d91f 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 _0x17e0=['../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','api','moment','bluebird'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x17e0,0x8b));var _0x017e=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x17e0[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x017e('0x0'));var util=require(_0x017e('0x1'));var logger=require('../../config/logger')(_0x017e('0x2'));var moment=require(_0x017e('0x3'));var BPromise=require(_0x017e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x017e('0x5'));var attributes=require(_0x017e('0x6'));module[_0x017e('0x7')]=function(_0x1b6185,_0x1fcb69){return _0x1b6185['define'](_0x017e('0x8'),attributes,{'tableName':_0x017e('0x9'),'paranoid':![],'indexes':[{'name':_0x017e('0xa'),'fields':['idField',_0x017e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e10=['desk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','DeskField','int_desk_fields'];(function(_0x49f8de,_0x223f99){var _0x1b98bb=function(_0x58ae30){while(--_0x58ae30){_0x49f8de['push'](_0x49f8de['shift']());}};_0x1b98bb(++_0x223f99);}(_0x6e10,0x9f));var _0x06e1=function(_0x3437c0,_0x59e6b0){_0x3437c0=_0x3437c0-0x0;var _0x53e0e7=_0x6e10[_0x3437c0];return _0x53e0e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x06e1('0x0'))(_0x06e1('0x1'));var moment=require(_0x06e1('0x2'));var BPromise=require(_0x06e1('0x3'));var rp=require(_0x06e1('0x4'));var fs=require('fs');var path=require(_0x06e1('0x5'));var rimraf=require(_0x06e1('0x6'));var config=require(_0x06e1('0x7'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x672062,_0x5dea43){return _0x672062['define'](_0x06e1('0x8'),attributes,{'tableName':_0x06e1('0x9'),'paranoid':![],'indexes':[{'name':_0x06e1('0xa'),'fields':[_0x06e1('0xb'),_0x06e1('0xc')],'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 bb0614a..ed5de94 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 _0xef05=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef05,0xdb));var _0x5ef0=function(_0x1e6c63,_0x1a4435){_0x1e6c63=_0x1e6c63-0x0;var _0x95fd57=_0xef05[_0x1e6c63];return _0x95fd57;};'use strict';var _=require(_0x5ef0('0x0'));var util=require('util');var moment=require(_0x5ef0('0x1'));var BPromise=require(_0x5ef0('0x2'));var rs=require(_0x5ef0('0x3'));var fs=require('fs');var Redis=require(_0x5ef0('0x4'));var db=require(_0x5ef0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ef0('0x6'));var config=require(_0x5ef0('0x7'));var jayson=require(_0x5ef0('0x8'));var client=jayson['client'][_0x5ef0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x349a52,_0xad5ed8,_0x18dfb9){return new BPromise(function(_0x5f30dc,_0x19c5f8){return client['request'](_0x349a52,_0x18dfb9)[_0x5ef0('0xa')](function(_0x4c0edc){logger[_0x5ef0('0xb')](_0x5ef0('0xc'),_0xad5ed8,_0x5ef0('0xd'));logger['debug'](_0x5ef0('0xe'),_0xad5ed8,_0x5ef0('0xd'),JSON[_0x5ef0('0xf')](_0x4c0edc));if(_0x4c0edc[_0x5ef0('0x10')]){if(_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x11')]===0x1f4){logger[_0x5ef0('0x10')](_0x5ef0('0xc'),_0xad5ed8,_0x4c0edc[_0x5ef0('0x10')]['message']);return _0x19c5f8(_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x12')]);}logger[_0x5ef0('0x10')](_0x5ef0('0xc'),_0xad5ed8,_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x12')]);return _0x5f30dc(_0x4c0edc[_0x5ef0('0x10')][_0x5ef0('0x12')]);}else{logger[_0x5ef0('0xb')](_0x5ef0('0xc'),_0xad5ed8,_0x5ef0('0xd'));_0x5f30dc(_0x4c0edc[_0x5ef0('0x13')][_0x5ef0('0x12')]);}})['catch'](function(_0x10f27a){logger['error'](_0x5ef0('0xc'),_0xad5ed8,_0x10f27a);_0x19c5f8(_0x10f27a);});});} \ No newline at end of file +var _0x7fb6=['stringify','error','code','message','DeskField,\x20%s,\x20%s','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3625ea,_0xc6bf4a){var _0x57211e=function(_0x3e5acf){while(--_0x3e5acf){_0x3625ea['push'](_0x3625ea['shift']());}};_0x57211e(++_0xc6bf4a);}(_0x7fb6,0x1ab));var _0x67fb=function(_0x7628f1,_0x10e7fc){_0x7628f1=_0x7628f1-0x0;var _0xd5fd4e=_0x7fb6[_0x7628f1];return _0xd5fd4e;};'use strict';var _=require('lodash');var util=require(_0x67fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x67fb('0x1'));var fs=require('fs');var Redis=require(_0x67fb('0x2'));var db=require(_0x67fb('0x3'))['db'];var utils=require(_0x67fb('0x4'));var logger=require('../../config/logger')(_0x67fb('0x5'));var config=require(_0x67fb('0x6'));var jayson=require(_0x67fb('0x7'));var client=jayson['client'][_0x67fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34aaff,_0x4087be,_0x27dba7){return new BPromise(function(_0x278f6e,_0x4f4e75){return client[_0x67fb('0x9')](_0x34aaff,_0x27dba7)['then'](function(_0x289f4b){logger[_0x67fb('0xa')]('DeskField,\x20%s,\x20%s',_0x4087be,_0x67fb('0xb'));logger[_0x67fb('0xc')](_0x67fb('0xd'),_0x4087be,_0x67fb('0xb'),JSON[_0x67fb('0xe')](_0x289f4b));if(_0x289f4b[_0x67fb('0xf')]){if(_0x289f4b[_0x67fb('0xf')][_0x67fb('0x10')]===0x1f4){logger[_0x67fb('0xf')]('DeskField,\x20%s,\x20%s',_0x4087be,_0x289f4b[_0x67fb('0xf')][_0x67fb('0x11')]);return _0x4f4e75(_0x289f4b[_0x67fb('0xf')][_0x67fb('0x11')]);}logger[_0x67fb('0xf')]('DeskField,\x20%s,\x20%s',_0x4087be,_0x289f4b[_0x67fb('0xf')][_0x67fb('0x11')]);return _0x278f6e(_0x289f4b[_0x67fb('0xf')][_0x67fb('0x11')]);}else{logger['info'](_0x67fb('0x12'),_0x4087be,_0x67fb('0xb'));_0x278f6e(_0x289f4b[_0x67fb('0x13')]['message']);}})[_0x67fb('0x14')](function(_0x480030){logger[_0x67fb('0xf')](_0x67fb('0x12'),_0x4087be,_0x480030);_0x4f4e75(_0x480030);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b783706..b8b7c2a 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 _0xe3b3=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller'];(function(_0x327d6d,_0x29c367){var _0x359a6c=function(_0x2643f2){while(--_0x2643f2){_0x327d6d['push'](_0x327d6d['shift']());}};_0x359a6c(++_0x29c367);}(_0xe3b3,0x10a));var _0x3e3b=function(_0x119a12,_0xacedaf){_0x119a12=_0x119a12-0x0;var _0x41a3b2=_0xe3b3[_0x119a12];return _0x41a3b2;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express[_0x3e3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3e3b('0x6'));var interaction=require(_0x3e3b('0x7'));var config=require('../../config/environment');var controller=require(_0x3e3b('0x8'));router[_0x3e3b('0x9')]('/',auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xb')]);router[_0x3e3b('0x9')](_0x3e3b('0xc'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xd')]);router[_0x3e3b('0x9')](_0x3e3b('0xe'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xf')]);router[_0x3e3b('0x9')](_0x3e3b('0x10'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x11')]);router[_0x3e3b('0x12')]('/',auth['isAuthenticated'](),controller[_0x3e3b('0x13')]);router[_0x3e3b('0x12')]('/:id/configurations',auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x14')]);router[_0x3e3b('0x15')](_0x3e3b('0xc'),auth[_0x3e3b('0xa')](),controller['update']);router[_0x3e3b('0x16')](_0x3e3b('0xc'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x17')]);module[_0x3e3b('0x18')]=router; \ No newline at end of file +var _0x468e=['post','/:id/configurations','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','./intDynamics365Account.controller','get','isAuthenticated','/:id','getConfigurations','/:id/fields','getFields'];(function(_0x4a869e,_0x350c89){var _0x54ae70=function(_0x29f47c){while(--_0x29f47c){_0x4a869e['push'](_0x4a869e['shift']());}};_0x54ae70(++_0x350c89);}(_0x468e,0x126));var _0xe468=function(_0x50123f,_0x3c7d8d){_0x50123f=_0x50123f-0x0;var _0x2e6166=_0x468e[_0x50123f];return _0x2e6166;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe468('0x0'));var timeout=require(_0xe468('0x1'));var express=require(_0xe468('0x2'));var router=express[_0xe468('0x3')]();var fs_extra=require(_0xe468('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe468('0x5'));router[_0xe468('0x6')]('/',auth[_0xe468('0x7')](),controller['index']);router[_0xe468('0x6')](_0xe468('0x8'),auth[_0xe468('0x7')](),controller['show']);router[_0xe468('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe468('0x9')]);router[_0xe468('0x6')](_0xe468('0xa'),auth[_0xe468('0x7')](),controller[_0xe468('0xb')]);router[_0xe468('0xc')]('/',auth[_0xe468('0x7')](),controller['create']);router['post'](_0xe468('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe468('0xe')](_0xe468('0x8'),auth[_0xe468('0x7')](),controller[_0xe468('0xf')]);router[_0xe468('0x10')](_0xe468('0x8'),auth[_0xe468('0x7')](),controller['destroy']);module[_0xe468('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d4488a1..5813cbc 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 _0xdb84=['STRING','sequelize','exports'];(function(_0x2eb736,_0x541c0c){var _0x23c426=function(_0x46bc0a){while(--_0x46bc0a){_0x2eb736['push'](_0x2eb736['shift']());}};_0x23c426(++_0x541c0c);}(_0xdb84,0x76));var _0x4db8=function(_0x583967,_0x502dc1){_0x583967=_0x583967-0x0;var _0x2598ac=_0xdb84[_0x583967];return _0x2598ac;};'use strict';var Sequelize=require(_0x4db8('0x0'));module[_0x4db8('0x1')]={'name':{'type':Sequelize[_0x4db8('0x2')]},'username':{'type':Sequelize[_0x4db8('0x2')]},'password':{'type':Sequelize[_0x4db8('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x4db8('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x4db8('0x2')]},'serverUrl':{'type':Sequelize[_0x4db8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9d3b=['STRING','sequelize','exports'];(function(_0x2c4de8,_0x3d664d){var _0x15f310=function(_0x147206){while(--_0x147206){_0x2c4de8['push'](_0x2c4de8['shift']());}};_0x15f310(++_0x3d664d);}(_0x9d3b,0x15d));var _0xb9d3=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x9d3b[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require(_0xb9d3('0x0'));module[_0xb9d3('0x1')]={'name':{'type':Sequelize[_0xb9d3('0x2')]},'username':{'type':Sequelize[_0xb9d3('0x2')]},'password':{'type':Sequelize[_0xb9d3('0x2')]},'remoteUri':{'type':Sequelize[_0xb9d3('0x2')]},'tenantId':{'type':Sequelize[_0xb9d3('0x2')]},'clientId':{'type':Sequelize[_0xb9d3('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb9d3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb9d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index cd2ac73..37c5f53 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 _0x7868=['/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','LogicalName','DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','Dynamics365Account','type','key','model','query','keys','filters','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','intersection','create','catch','body','find','getConfigurations','rawAttributes','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidyominame','slainvokedidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST'];(function(_0x1f3635,_0x51b6ec){var _0x446afc=function(_0x414411){while(--_0x414411){_0x1f3635['push'](_0x1f3635['shift']());}};_0x446afc(++_0x51b6ec);}(_0x7868,0x1c0));var _0x8786=function(_0x46a01e,_0x25c0a0){_0x46a01e=_0x46a01e-0x0;var _0x210c27=_0x7868[_0x46a01e];return _0x210c27;};'use strict';var emlformat=require(_0x8786('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8786('0x1'));var jsonpatch=require(_0x8786('0x2'));var rp=require(_0x8786('0x3'));var moment=require(_0x8786('0x4'));var BPromise=require(_0x8786('0x5'));var Mustache=require('mustache');var util=require(_0x8786('0x6'));var path=require(_0x8786('0x7'));var sox=require(_0x8786('0x8'));var csv=require(_0x8786('0x9'));var ejs=require(_0x8786('0xa'));var fs=require('fs');var fs_extra=require(_0x8786('0xb'));var _=require(_0x8786('0xc'));var squel=require(_0x8786('0xd'));var crypto=require(_0x8786('0xe'));var jsforce=require(_0x8786('0xf'));var deskjs=require(_0x8786('0x10'));var toCsv=require(_0x8786('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8786('0x11'));var authService=require(_0x8786('0x12'));var qs=require(_0x8786('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8786('0x14'))('api');var utils=require(_0x8786('0x15'));var config=require(_0x8786('0x16'));var licenseUtil=require(_0x8786('0x17'));var db=require(_0x8786('0x18'))['db'];var integrations=require(_0x8786('0x19'));function respondWithStatusCode(_0x46ead4,_0x58f255){_0x58f255=_0x58f255||0xcc;return function(_0x1a0f59){if(_0x1a0f59){return _0x46ead4[_0x8786('0x1a')](_0x58f255);}return _0x46ead4['status'](_0x58f255)[_0x8786('0x1b')]();};}function respondWithResult(_0x1d3dd3,_0x5cde1d){_0x5cde1d=_0x5cde1d||0xc8;return function(_0x130f3d){if(_0x130f3d){return _0x1d3dd3[_0x8786('0x1c')](_0x5cde1d)[_0x8786('0x1d')](_0x130f3d);}};}function respondWithFilteredResult(_0x438bad,_0x5975bf){return function(_0x54d9f6){if(_0x54d9f6){var _0x4f599e=typeof _0x5975bf[_0x8786('0x1e')]===_0x8786('0x1f')&&typeof _0x5975bf[_0x8786('0x20')]===_0x8786('0x1f');var _0x4fcf1c=_0x54d9f6[_0x8786('0x21')];var _0x3b9ff1=_0x4f599e?0x0:_0x5975bf[_0x8786('0x1e')];var _0x359f68=_0x4f599e?_0x54d9f6[_0x8786('0x21')]:_0x5975bf[_0x8786('0x1e')]+_0x5975bf[_0x8786('0x20')];var _0x643c33;if(_0x359f68>=_0x4fcf1c){_0x359f68=_0x4fcf1c;_0x643c33=0xc8;}else{_0x643c33=0xce;}_0x438bad[_0x8786('0x1c')](_0x643c33);return _0x438bad['set'](_0x8786('0x22'),_0x3b9ff1+'-'+_0x359f68+'/'+_0x4fcf1c)[_0x8786('0x1d')](_0x54d9f6);}return null;};}function patchUpdates(_0x28f0b6){return function(_0x26eeba){try{jsonpatch[_0x8786('0x23')](_0x26eeba,_0x28f0b6,!![]);}catch(_0x5ca4e7){return BPromise[_0x8786('0x24')](_0x5ca4e7);}return _0x26eeba[_0x8786('0x25')]();};}function saveUpdates(_0x5de3ef,_0x13a7b0){return function(_0x1af37a){if(_0x1af37a){return _0x1af37a[_0x8786('0x26')](_0x5de3ef)['then'](function(_0x5165f7){return _0x5165f7;});}return null;};}function removeEntity(_0x529247,_0x27f85e){return function(_0x33346d){if(_0x33346d){return _0x33346d[_0x8786('0x27')]()['then'](function(){_0x529247[_0x8786('0x1c')](0xcc)[_0x8786('0x1b')]();});}};}function handleEntityNotFound(_0xcd7d9,_0x30fd5e){return function(_0x9f348e){if(!_0x9f348e){_0xcd7d9['sendStatus'](0x194);}return _0x9f348e;};}function handleError(_0x4a17f3,_0x30091c){_0x30091c=_0x30091c||0x1f4;return function(_0x78f355){logger[_0x8786('0x28')](_0x78f355[_0x8786('0x29')]);if(_0x78f355[_0x8786('0x2a')]){delete _0x78f355[_0x8786('0x2a')];}_0x4a17f3[_0x8786('0x1c')](_0x30091c)[_0x8786('0x2b')](_0x78f355);};}exports[_0x8786('0x2c')]=function(_0xd796e7,_0x49ab14){var _0x5b5af0={},_0x5966cb={},_0x26a132={'count':0x0,'rows':[]};var _0x502440=_[_0x8786('0x2d')](db[_0x8786('0x2e')]['rawAttributes'],function(_0x3dc758){return{'name':_0x3dc758['fieldName'],'type':_0x3dc758[_0x8786('0x2f')][_0x8786('0x30')]};});_0x5966cb[_0x8786('0x31')]=_['map'](_0x502440,'name');_0x5966cb[_0x8786('0x32')]=_[_0x8786('0x33')](_0xd796e7[_0x8786('0x32')]);_0x5966cb[_0x8786('0x34')]=_['intersection'](_0x5966cb[_0x8786('0x31')],_0x5966cb[_0x8786('0x32')]);_0x5b5af0['attributes']=_['intersection'](_0x5966cb[_0x8786('0x31')],qs[_0x8786('0x35')](_0xd796e7[_0x8786('0x32')][_0x8786('0x35')]));_0x5b5af0['attributes']=_0x5b5af0[_0x8786('0x36')][_0x8786('0x37')]?_0x5b5af0['attributes']:_0x5966cb[_0x8786('0x31')];if(!_0xd796e7['query']['hasOwnProperty'](_0x8786('0x38'))){_0x5b5af0[_0x8786('0x20')]=qs[_0x8786('0x20')](_0xd796e7['query'][_0x8786('0x20')]);_0x5b5af0[_0x8786('0x1e')]=qs[_0x8786('0x1e')](_0xd796e7[_0x8786('0x32')]['offset']);}_0x5b5af0['order']=qs[_0x8786('0x39')](_0xd796e7[_0x8786('0x32')][_0x8786('0x39')]);_0x5b5af0[_0x8786('0x3a')]=qs[_0x8786('0x34')](_[_0x8786('0x3b')](_0xd796e7['query'],_0x5966cb[_0x8786('0x34')]),_0x502440);if(_0xd796e7[_0x8786('0x32')][_0x8786('0x3c')]){_0x5b5af0[_0x8786('0x3a')]=_[_0x8786('0x3d')](_0x5b5af0[_0x8786('0x3a')],{'$or':_[_0x8786('0x2d')](_0x502440,function(_0x1dd281){if(_0x1dd281[_0x8786('0x2f')]!==_0x8786('0x3e')){var _0x231e45={};_0x231e45[_0x1dd281[_0x8786('0x2a')]]={'$like':'%'+_0xd796e7['query'][_0x8786('0x3c')]+'%'};return _0x231e45;}})});}_0x5b5af0=_[_0x8786('0x3d')]({},_0x5b5af0,_0xd796e7[_0x8786('0x3f')]);var _0x25a4cb={'where':_0x5b5af0[_0x8786('0x3a')]};return db[_0x8786('0x2e')]['count'](_0x25a4cb)[_0x8786('0x40')](function(_0x2bf898){_0x26a132['count']=_0x2bf898;if(_0xd796e7[_0x8786('0x32')][_0x8786('0x41')]){_0x5b5af0[_0x8786('0x42')]=[{'all':!![]}];}return db[_0x8786('0x2e')][_0x8786('0x43')](_0x5b5af0);})[_0x8786('0x40')](function(_0x3bbf38){_0x26a132[_0x8786('0x44')]=_0x3bbf38;return _0x26a132;})['then'](respondWithFilteredResult(_0x49ab14,_0x5b5af0))['catch'](handleError(_0x49ab14,null));};exports[_0x8786('0x45')]=function(_0x155861,_0x392a56){var _0x346425={'raw':![],'where':{'id':_0x155861[_0x8786('0x46')]['id']}},_0x449aa5={};_0x449aa5['model']=_[_0x8786('0x33')](db['Dynamics365Account']['rawAttributes']);_0x449aa5[_0x8786('0x32')]=_['keys'](_0x155861[_0x8786('0x32')]);_0x449aa5[_0x8786('0x34')]=_[_0x8786('0x47')](_0x449aa5[_0x8786('0x31')],_0x449aa5[_0x8786('0x32')]);_0x346425[_0x8786('0x36')]=_[_0x8786('0x47')](_0x449aa5[_0x8786('0x31')],qs[_0x8786('0x35')](_0x155861['query'][_0x8786('0x35')]));_0x346425[_0x8786('0x36')]=_0x346425[_0x8786('0x36')]['length']?_0x346425['attributes']:_0x449aa5[_0x8786('0x31')];if(_0x155861[_0x8786('0x32')]['includeAll']){_0x346425[_0x8786('0x42')]=[{'all':!![]}];}_0x346425=_['merge']({},_0x346425,_0x155861[_0x8786('0x3f')]);return db[_0x8786('0x2e')]['find'](_0x346425)[_0x8786('0x40')](handleEntityNotFound(_0x392a56,null))[_0x8786('0x40')](respondWithResult(_0x392a56,null))['catch'](handleError(_0x392a56,null));};exports['create']=function(_0x5b2614,_0x1b495f){return db['Dynamics365Account'][_0x8786('0x48')](_0x5b2614['body'],{})[_0x8786('0x40')](respondWithResult(_0x1b495f,0xc9))[_0x8786('0x49')](handleError(_0x1b495f,null));};exports[_0x8786('0x26')]=function(_0x4c6f74,_0x3866cd){if(_0x4c6f74[_0x8786('0x4a')]['id']){delete _0x4c6f74[_0x8786('0x4a')]['id'];}return db[_0x8786('0x2e')][_0x8786('0x4b')]({'where':{'id':_0x4c6f74[_0x8786('0x46')]['id']}})['then'](handleEntityNotFound(_0x3866cd,null))[_0x8786('0x40')](saveUpdates(_0x4c6f74[_0x8786('0x4a')],null))['then'](respondWithResult(_0x3866cd,null))['catch'](handleError(_0x3866cd,null));};exports[_0x8786('0x27')]=function(_0x48d71c,_0x2b08fe){return db[_0x8786('0x2e')][_0x8786('0x4b')]({'where':{'id':_0x48d71c[_0x8786('0x46')]['id']}})[_0x8786('0x40')](handleEntityNotFound(_0x2b08fe,null))[_0x8786('0x40')](removeEntity(_0x2b08fe,null))[_0x8786('0x49')](handleError(_0x2b08fe,null));};exports[_0x8786('0x4c')]=function(_0x578185,_0x386042,_0x374ebb){var _0x3c26d8={};var _0x27580f={};var _0x50f89e;var _0x430a7c;return db[_0x8786('0x2e')]['findOne']({'where':{'id':_0x578185[_0x8786('0x46')]['id']}})['then'](handleEntityNotFound(_0x386042,null))[_0x8786('0x40')](function(_0x3fa376){if(_0x3fa376){_0x50f89e=_0x3fa376;_0x27580f[_0x8786('0x31')]=_[_0x8786('0x33')](db['Dynamics365Configuration'][_0x8786('0x4d')]);_0x27580f['query']=_[_0x8786('0x33')](_0x578185[_0x8786('0x32')]);_0x27580f[_0x8786('0x34')]=_[_0x8786('0x47')](_0x27580f[_0x8786('0x31')],_0x27580f[_0x8786('0x32')]);_0x3c26d8[_0x8786('0x36')]=_[_0x8786('0x47')](_0x27580f[_0x8786('0x31')],qs[_0x8786('0x35')](_0x578185[_0x8786('0x32')][_0x8786('0x35')]));_0x3c26d8[_0x8786('0x36')]=_0x3c26d8[_0x8786('0x36')][_0x8786('0x37')]?_0x3c26d8[_0x8786('0x36')]:_0x27580f[_0x8786('0x31')];_0x3c26d8[_0x8786('0x4e')]=qs[_0x8786('0x39')](_0x578185[_0x8786('0x32')][_0x8786('0x39')]);_0x3c26d8[_0x8786('0x3a')]=qs[_0x8786('0x34')](_[_0x8786('0x3b')](_0x578185[_0x8786('0x32')],_0x27580f[_0x8786('0x34')]));if(_0x578185[_0x8786('0x32')][_0x8786('0x3c')]){_0x3c26d8['where']=_[_0x8786('0x3d')](_0x3c26d8['where'],{'$or':_['map'](_0x3c26d8[_0x8786('0x36')],function(_0x5aa7e5){var _0x306c0b={};_0x306c0b[_0x5aa7e5]={'$like':'%'+_0x578185[_0x8786('0x32')][_0x8786('0x3c')]+'%'};return _0x306c0b;})});}_0x3c26d8=_[_0x8786('0x3d')]({},_0x3c26d8,_0x578185[_0x8786('0x3f')]);return _0x50f89e[_0x8786('0x4c')](_0x3c26d8);}})[_0x8786('0x40')](function(_0x40a101){if(_0x40a101){_0x430a7c=_0x40a101[_0x8786('0x37')];if(!_0x578185['query']['hasOwnProperty']('nolimit')){_0x3c26d8['limit']=qs[_0x8786('0x20')](_0x578185[_0x8786('0x32')][_0x8786('0x20')]);_0x3c26d8[_0x8786('0x1e')]=qs[_0x8786('0x1e')](_0x578185[_0x8786('0x32')]['offset']);}return _0x50f89e[_0x8786('0x4c')](_0x3c26d8);}})[_0x8786('0x40')](function(_0x23cdf0){if(_0x23cdf0){return _0x23cdf0?{'count':_0x430a7c,'rows':_0x23cdf0}:null;}})[_0x8786('0x40')](respondWithResult(_0x386042,null))['catch'](handleError(_0x386042,null));};exports[_0x8786('0x4f')]=function(_0x2daf17,_0x4688a3,_0x33ce36){if(_0x2daf17['body']['id']){delete _0x2daf17[_0x8786('0x4a')]['id'];}return db[_0x8786('0x2e')][_0x8786('0x50')]({'where':{'id':_0x2daf17[_0x8786('0x46')]['id']}})[_0x8786('0x40')](handleEntityNotFound(_0x4688a3,null))[_0x8786('0x40')](function(_0x35e614){if(_0x35e614){_0x2daf17[_0x8786('0x4a')][_0x8786('0x51')]=_0x35e614['id'];_0x2daf17[_0x8786('0x4a')][_0x8786('0x52')]=integrations[_0x8786('0x53')](_0x2daf17[_0x8786('0x4a')][_0x8786('0x54')],_0x2daf17[_0x8786('0x4a')][_0x8786('0x2f')]);_0x2daf17[_0x8786('0x4a')][_0x8786('0x55')]=integrations[_0x8786('0x56')](_0x2daf17[_0x8786('0x4a')]['channel'],_0x2daf17[_0x8786('0x4a')][_0x8786('0x2f')]);return db[_0x8786('0x57')][_0x8786('0x48')](_0x2daf17[_0x8786('0x4a')],{'include':[{'model':db[_0x8786('0x58')],'as':'Subjects'},{'model':db[_0x8786('0x58')],'as':_0x8786('0x55')}]});}return null;})[_0x8786('0x40')](respondWithResult(_0x4688a3,null))[_0x8786('0x49')](handleError(_0x4688a3,null));};exports[_0x8786('0x59')]=function(_0x4dfca5,_0x2f2f98,_0x58e895){var _0x447366=_0x4dfca5[_0x8786('0x32')][_0x8786('0x5a')];var _0xc80d4d=_0x447366==='incident'?'Incident':_0x8786('0x5b');var _0x2e5724='';var _0x29824d='';var _0xb8a6f2='';var _0x12564c='';var _0x354545='';var _0xccf90b='';var _0x5b12bf='';var _0x1a99ca='';var _0x901fb=[_0x8786('0x5c'),_0x8786('0x5d'),_0x8786('0x5e'),_0x8786('0x5f'),'caseorigincode',_0x8786('0x60'),_0x8786('0x61'),_0x8786('0x62'),'directioncode',_0x8786('0x63')];var _0x2969e8=[_0x8786('0x64'),'accountidyominame','actualserviceunits',_0x8786('0x65'),_0x8786('0x66'),_0x8786('0x67'),_0x8786('0x68'),_0x8786('0x69'),_0x8786('0x6a'),_0x8786('0x6b'),'createdbyname',_0x8786('0x6c'),_0x8786('0x6d'),_0x8786('0x6e'),_0x8786('0x6f'),_0x8786('0x70'),_0x8786('0x71'),_0x8786('0x72'),_0x8786('0x73'),_0x8786('0x74'),_0x8786('0x75'),_0x8786('0x76'),_0x8786('0x77'),_0x8786('0x78'),'firstresponsebykpiidname',_0x8786('0x79'),_0x8786('0x7a'),'influencescore',_0x8786('0x7b'),'lastonholdtime',_0x8786('0x7c'),'modifiedbyexternalpartyname',_0x8786('0x7d'),'modifiedbyname','modifiedbyyominame','modifiedon',_0x8786('0x7e'),_0x8786('0x7f'),'msdyn_incidenttypename','msdyn_iotalertname',_0x8786('0x80'),_0x8786('0x81'),_0x8786('0x82'),_0x8786('0x83'),'owneridtype','owneridyominame',_0x8786('0x84'),_0x8786('0x85'),_0x8786('0x86'),_0x8786('0x87'),'productidname',_0x8786('0x88'),_0x8786('0x89'),'resolvebykpiidname',_0x8786('0x8a'),'responsiblecontactidname',_0x8786('0x8b'),'sentimentvalue',_0x8786('0x8c'),'slaname','socialprofileidname',_0x8786('0x8d'),_0x8786('0x8e'),_0x8786('0x8f'),'ticketnumber',_0x8786('0x90'),_0x8786('0x91'),_0x8786('0x92'),'utcconversiontimezonecode','versionnumber'];var _0x21fd80=_0x901fb[_0x8786('0x93')](_0x2969e8);return db['Dynamics365Account'][_0x8786('0x50')]({'where':{'id':_0x4dfca5['params']['id']},'attributes':['id',_0x8786('0x94'),'password',_0x8786('0x95'),_0x8786('0x96'),_0x8786('0x97'),_0x8786('0x98')]})[_0x8786('0x40')](handleEntityNotFound(_0x2f2f98,null))[_0x8786('0x40')](function(_0x449670){if(_0x449670){_0x1a99ca=_0x449670[_0x8786('0x95')];var _0x20d6a9=_0x1a99ca[_0x8786('0x99')](-0x1);if(_0x20d6a9==='/'){_0x1a99ca=_0x1a99ca[_0x8786('0x9a')](0x0,_0x1a99ca['lastIndexOf'](_0x20d6a9));}_0x5b12bf=util[_0x8786('0x9b')](_0x8786('0x9c'),_0x1a99ca);var _0x24dc6a={'method':_0x8786('0x9d'),'uri':'https://login.microsoftonline.com/'+_0x449670['tenantId']+_0x8786('0x9e'),'form':{'client_id':_0x449670[_0x8786('0x97')],'resource':_0x1a99ca,'username':_0x449670[_0x8786('0x94')],'password':_0x449670[_0x8786('0x9f')],'grant_type':_0x8786('0x9f'),'client_secret':_0x449670[_0x8786('0x98')]},'json':!![]};return rp(_0x24dc6a);}})[_0x8786('0x40')](function(_0x59114c){_0xccf90b=_0x59114c[_0x8786('0xa0')];var _0x6c93cc={'method':_0x8786('0xa1'),'uri':encodeURI(_0x5b12bf+_0x8786('0xa2')+_0xc80d4d+'\x27'),'headers':{'Authorization':_0x8786('0xa3')+_0xccf90b,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x6c93cc);})['then'](function(_0x3ca2ab){var _0x336aab=_0x3ca2ab[_0x8786('0xa5')][0x0];var _0x5b2fe9=_0x336aab[_0x8786('0xa6')];var _0x238957={'method':'GET','uri':_0x5b12bf+_0x8786('0xa7')+_0x5b2fe9+_0x8786('0xa8'),'headers':{'Authorization':_0x8786('0xa3')+_0xccf90b,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x238957);})[_0x8786('0x40')](function(_0x2d6561){_0x2e5724=_0x2d6561;_0x29824d=_0x2e5724[_0x8786('0xa9')];_0x29824d=_[_0x8786('0xaa')](_0x29824d,function(_0x4c88e6){return!_0x21fd80[_0x8786('0xab')](_0x4c88e6['LogicalName']);});var _0x2ec75d=[];var _0x4cee4f=[];_0x29824d[_0x8786('0xac')](function(_0x33434c){if(_0x33434c['@odata.type']){var _0x33aa5c=_0x33434c[_0x8786('0xad')]['substring'](_0x33434c['@odata.type'][_0x8786('0xae')]('.')+0x1);if(_0x33aa5c===_0x8786('0xaf')){_0x2ec75d[_0x8786('0xb0')](getSelectList(_0x5b12bf,_0x447366,_0x4cee4f,_0x2e5724[_0x8786('0xa6')],_0x33434c[_0x8786('0xa6')],_0xccf90b));}}});return Promise[_0x8786('0xb1')](_0x2ec75d);})[_0x8786('0x40')](function(_0x2064c1){_0xb8a6f2=_0x2064c1[0x0];var _0x4bec4c=[];var _0x5d6325=[];_0x29824d[_0x8786('0xac')](function(_0xc4043d){if(!_[_0x8786('0xb2')](_0xc4043d[_0x8786('0xad')])){var _0x3b5d64=_0xc4043d[_0x8786('0xad')][_0x8786('0x9a')](_0xc4043d[_0x8786('0xad')][_0x8786('0xae')]('.')+0x1);if(_0x3b5d64===_0x8786('0xb3')){_0x4bec4c[_0x8786('0xb0')](getBooleanList(_0x5b12bf,_0x447366,_0x5d6325,_0x2e5724[_0x8786('0xa6')],_0xc4043d[_0x8786('0xa6')],_0xccf90b));}}});return Promise[_0x8786('0xb1')](_0x4bec4c);})[_0x8786('0x40')](function(_0x447867){_0x12564c=_0x447867[0x0];var _0x486cdd=[];var _0x49e11f=[];_0x29824d[_0x8786('0xac')](function(_0x5f2929){if(_0x5f2929['@odata.type']){var _0x20d8b0=_0x5f2929[_0x8786('0xad')][_0x8786('0x9a')](_0x5f2929[_0x8786('0xad')][_0x8786('0xae')]('.')+0x1);if(_0x20d8b0===_0x8786('0xb4')||_0x20d8b0==='DoubleAttributeMetadata'||_0x20d8b0===_0x8786('0xb5')||_0x20d8b0==='IntegerAttributeMetadata'||_0x20d8b0===_0x8786('0xb6')||_0x20d8b0===_0x8786('0xb7')||_0x20d8b0===_0x8786('0xb8')||_0x20d8b0===_0x8786('0xb9')||_0x20d8b0===_0x8786('0xba')||_0x20d8b0===_0x8786('0xbb')){_0x486cdd[_0x8786('0xb0')](getInputList(_0x5b12bf,_0x447366,_0x20d8b0,_0x49e11f,_0x2e5724['MetadataId'],_0x5f2929[_0x8786('0xa6')],_0xccf90b));}}});return Promise[_0x8786('0xb1')](_0x486cdd);})[_0x8786('0x40')](function(_0x51adf2){_0x354545=_0x51adf2[0x0];var _0x39f81e=_0xb8a6f2[_0x8786('0x93')](_0x12564c)[_0x8786('0x93')](_0x354545);var _0x564692={'count':_0x39f81e[_0x8786('0x37')],'rows':_0x39f81e};return _0x564692;})[_0x8786('0x40')](respondWithResult(_0x2f2f98,null))[_0x8786('0x49')](function(_0x375f6f){var _0x5eefbf=_0x4dfca5[_0x8786('0x32')]['test']?0x1f4:_0x375f6f['statusCode']||0x1f4;logger['error'](_0x375f6f['stack']);delete _0x375f6f[_0x8786('0x2a')];if(_0x5eefbf===0x191){_0x5eefbf=0x190;}_0x2f2f98[_0x8786('0x1c')](_0x5eefbf)[_0x8786('0x2b')](_0x4dfca5[_0x8786('0x32')]['test']?{'message':_0x8786('0xbc'),'statusCode':_0x375f6f[_0x8786('0xbd')]}:_0x375f6f);});};function getSelectList(_0x6431b5,_0x10275e,_0x35f99c,_0x1d29a4,_0x10edc0,_0xa66f72){var _0x2d558d={'method':_0x8786('0xa1'),'uri':_0x6431b5+_0x8786('0xa7')+_0x1d29a4+')/Attributes('+_0x10edc0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x8786('0xbe'),'headers':{'Authorization':_0x8786('0xa3')+_0xa66f72,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x2d558d)[_0x8786('0x40')](function(_0x17295b){var _0x40aae3=[];var _0x36c97f=_0x17295b['OptionSet'][_0x8786('0xbf')];_0x36c97f['forEach'](function(_0x2e43de){_0x40aae3[_0x8786('0xb0')]({'name':_0x2e43de[_0x8786('0xc0')]['UserLocalizedLabel'][_0x8786('0xc0')],'value':String(_0x2e43de['Value'])});});var _0xa841d7={'id':_0x10275e+'_'+_0x17295b[_0x8786('0xc1')],'name':_0x17295b[_0x8786('0xc2')][_0x8786('0xc3')][_0x8786('0xc0')],'custom':![],'options':_0x40aae3};_0x35f99c[_0x8786('0xb0')](_0xa841d7);return _0x35f99c;});}function getBooleanList(_0x67d2c4,_0x1ed2de,_0x27541d,_0xade92,_0x4fc720,_0x1369d2){var _0x2fd035={'method':_0x8786('0xa1'),'uri':_0x67d2c4+_0x8786('0xa7')+_0xade92+_0x8786('0xc4')+_0x4fc720+_0x8786('0xc5'),'headers':{'Authorization':'Bearer\x20'+_0x1369d2,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x2fd035)['then'](function(_0x1a5d30){var _0x3e45f8=[];_0x3e45f8[_0x8786('0xb0')]({'name':_0x1a5d30['OptionSet']['TrueOption'][_0x8786('0xc0')][_0x8786('0xc3')][_0x8786('0xc0')],'value':_0x8786('0xc6')},{'name':_0x1a5d30['OptionSet']['FalseOption']['Label'][_0x8786('0xc3')][_0x8786('0xc0')],'value':_0x8786('0xc7')});var _0x31b915={'id':_0x1ed2de+'_'+_0x1a5d30['LogicalName'],'name':_0x1a5d30[_0x8786('0xc2')][_0x8786('0xc3')][_0x8786('0xc0')],'custom':![],'options':_0x3e45f8};_0x27541d['push'](_0x31b915);return _0x27541d;});}function getInputList(_0x3f2e97,_0x2f2854,_0x3cd50c,_0x1d8939,_0x5cdacd,_0x53567b,_0xdaab3d){var _0x4be10d={'method':_0x8786('0xa1'),'uri':_0x3f2e97+_0x8786('0xa7')+_0x5cdacd+_0x8786('0xc4')+_0x53567b+_0x8786('0xc8')+_0x3cd50c+_0x8786('0xc9'),'headers':{'Authorization':_0x8786('0xa3')+_0xdaab3d,'If-None-Match':null,'OData-Version':_0x8786('0xa4')},'json':!![]};return rp(_0x4be10d)['then'](function(_0xc4316){var _0x32f2cf={'id':_0x2f2854+'_'+_0xc4316[_0x8786('0xc1')],'name':_0xc4316[_0x8786('0xc2')][_0x8786('0xc3')]?_0xc4316[_0x8786('0xc2')]['UserLocalizedLabel'][_0x8786('0xc0')]:_0xc4316[_0x8786('0xc1')],'custom':![],'options':[]};_0x1d8939[_0x8786('0xb0')](_0x32f2cf);return _0x1d8939;});} \ No newline at end of file +var _0xf822=['true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','end','error','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','options','then','rows','catch','show','params','length','includeAll','merge','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdonbehalfbyname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','@odata.type','push','MetadataId','isNil','substring','BooleanAttributeMetadata','all','forEach','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','stack','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','UserLocalizedLabel'];(function(_0x378aa7,_0x3968cd){var _0x35ba1d=function(_0x41d6d0){while(--_0x41d6d0){_0x378aa7['push'](_0x378aa7['shift']());}};_0x35ba1d(++_0x3968cd);}(_0xf822,0x19e));var _0x2f82=function(_0x2f5b40,_0x2a7e15){_0x2f5b40=_0x2f5b40-0x0;var _0x58f943=_0xf822[_0x2f5b40];return _0x58f943;};'use strict';var emlformat=require(_0x2f82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f82('0x1'));var jsonpatch=require(_0x2f82('0x2'));var rp=require(_0x2f82('0x3'));var moment=require(_0x2f82('0x4'));var BPromise=require(_0x2f82('0x5'));var Mustache=require(_0x2f82('0x6'));var util=require('util');var path=require(_0x2f82('0x7'));var sox=require(_0x2f82('0x8'));var csv=require(_0x2f82('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f82('0xa'));var _=require('lodash');var squel=require(_0x2f82('0xb'));var crypto=require(_0x2f82('0xc'));var jsforce=require(_0x2f82('0xd'));var deskjs=require(_0x2f82('0xe'));var toCsv=require(_0x2f82('0x9'));var querystring=require(_0x2f82('0xf'));var Papa=require('papaparse');var Redis=require(_0x2f82('0x10'));var authService=require(_0x2f82('0x11'));var qs=require(_0x2f82('0x12'));var as=require(_0x2f82('0x13'));var hardwareService=require(_0x2f82('0x14'));var logger=require(_0x2f82('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2f82('0x16'));var licenseUtil=require(_0x2f82('0x17'));var db=require(_0x2f82('0x18'))['db'];var integrations=require(_0x2f82('0x19'));function respondWithStatusCode(_0x5e7036,_0x5f51f4){_0x5f51f4=_0x5f51f4||0xcc;return function(_0x153655){if(_0x153655){return _0x5e7036[_0x2f82('0x1a')](_0x5f51f4);}return _0x5e7036[_0x2f82('0x1b')](_0x5f51f4)['end']();};}function respondWithResult(_0x434262,_0x2df1bf){_0x2df1bf=_0x2df1bf||0xc8;return function(_0x5bdc8d){if(_0x5bdc8d){return _0x434262['status'](_0x2df1bf)['json'](_0x5bdc8d);}};}function respondWithFilteredResult(_0x6d2748,_0x14f4b7){return function(_0xe1a92f){if(_0xe1a92f){var _0x3e41ea=typeof _0x14f4b7['offset']===_0x2f82('0x1c')&&typeof _0x14f4b7['limit']===_0x2f82('0x1c');var _0x5ec789=_0xe1a92f[_0x2f82('0x1d')];var _0xccbee0=_0x3e41ea?0x0:_0x14f4b7[_0x2f82('0x1e')];var _0x371720=_0x3e41ea?_0xe1a92f[_0x2f82('0x1d')]:_0x14f4b7[_0x2f82('0x1e')]+_0x14f4b7[_0x2f82('0x1f')];var _0x26f9dc;if(_0x371720>=_0x5ec789){_0x371720=_0x5ec789;_0x26f9dc=0xc8;}else{_0x26f9dc=0xce;}_0x6d2748['status'](_0x26f9dc);return _0x6d2748[_0x2f82('0x20')](_0x2f82('0x21'),_0xccbee0+'-'+_0x371720+'/'+_0x5ec789)[_0x2f82('0x22')](_0xe1a92f);}return null;};}function patchUpdates(_0x56357a){return function(_0xbac84c){try{jsonpatch[_0x2f82('0x23')](_0xbac84c,_0x56357a,!![]);}catch(_0x17cd6b){return BPromise[_0x2f82('0x24')](_0x17cd6b);}return _0xbac84c[_0x2f82('0x25')]();};}function saveUpdates(_0x508a52,_0x3e9b75){return function(_0x339335){if(_0x339335){return _0x339335[_0x2f82('0x26')](_0x508a52)['then'](function(_0x530e1b){return _0x530e1b;});}return null;};}function removeEntity(_0x510bd0,_0x3f2abc){return function(_0x1bf504){if(_0x1bf504){return _0x1bf504['destroy']()['then'](function(){_0x510bd0[_0x2f82('0x1b')](0xcc)[_0x2f82('0x27')]();});}};}function handleEntityNotFound(_0x1525ac,_0x46222f){return function(_0x2efdf7){if(!_0x2efdf7){_0x1525ac['sendStatus'](0x194);}return _0x2efdf7;};}function handleError(_0x5e1df8,_0x30efa5){_0x30efa5=_0x30efa5||0x1f4;return function(_0x5280fe){logger[_0x2f82('0x28')](_0x5280fe['stack']);if(_0x5280fe[_0x2f82('0x29')]){delete _0x5280fe[_0x2f82('0x29')];}_0x5e1df8[_0x2f82('0x1b')](_0x30efa5)[_0x2f82('0x2a')](_0x5280fe);};}exports[_0x2f82('0x2b')]=function(_0x5f121f,_0x1f9a03){var _0x3f2e84={},_0x41c9dd={},_0x16886b={'count':0x0,'rows':[]};var _0x101bf4=_[_0x2f82('0x2c')](db[_0x2f82('0x2d')][_0x2f82('0x2e')],function(_0xead18){return{'name':_0xead18['fieldName'],'type':_0xead18[_0x2f82('0x2f')][_0x2f82('0x30')]};});_0x41c9dd[_0x2f82('0x31')]=_[_0x2f82('0x2c')](_0x101bf4,_0x2f82('0x29'));_0x41c9dd[_0x2f82('0x32')]=_[_0x2f82('0x33')](_0x5f121f['query']);_0x41c9dd[_0x2f82('0x34')]=_[_0x2f82('0x35')](_0x41c9dd[_0x2f82('0x31')],_0x41c9dd[_0x2f82('0x32')]);_0x3f2e84[_0x2f82('0x36')]=_[_0x2f82('0x35')](_0x41c9dd['model'],qs[_0x2f82('0x37')](_0x5f121f[_0x2f82('0x32')]['fields']));_0x3f2e84['attributes']=_0x3f2e84[_0x2f82('0x36')]['length']?_0x3f2e84[_0x2f82('0x36')]:_0x41c9dd[_0x2f82('0x31')];if(!_0x5f121f[_0x2f82('0x32')]['hasOwnProperty'](_0x2f82('0x38'))){_0x3f2e84[_0x2f82('0x1f')]=qs[_0x2f82('0x1f')](_0x5f121f['query'][_0x2f82('0x1f')]);_0x3f2e84[_0x2f82('0x1e')]=qs['offset'](_0x5f121f['query'][_0x2f82('0x1e')]);}_0x3f2e84['order']=qs[_0x2f82('0x39')](_0x5f121f['query']['sort']);_0x3f2e84[_0x2f82('0x3a')]=qs[_0x2f82('0x34')](_[_0x2f82('0x3b')](_0x5f121f[_0x2f82('0x32')],_0x41c9dd[_0x2f82('0x34')]),_0x101bf4);if(_0x5f121f[_0x2f82('0x32')][_0x2f82('0x3c')]){_0x3f2e84['where']=_['merge'](_0x3f2e84[_0x2f82('0x3a')],{'$or':_[_0x2f82('0x2c')](_0x101bf4,function(_0x33dc9f){if(_0x33dc9f[_0x2f82('0x2f')]!=='VIRTUAL'){var _0x1a7337={};_0x1a7337[_0x33dc9f[_0x2f82('0x29')]]={'$like':'%'+_0x5f121f[_0x2f82('0x32')][_0x2f82('0x3c')]+'%'};return _0x1a7337;}})});}_0x3f2e84=_['merge']({},_0x3f2e84,_0x5f121f[_0x2f82('0x3d')]);var _0x3f6239={'where':_0x3f2e84[_0x2f82('0x3a')]};return db['Dynamics365Account'][_0x2f82('0x1d')](_0x3f6239)[_0x2f82('0x3e')](function(_0x4142af){_0x16886b[_0x2f82('0x1d')]=_0x4142af;if(_0x5f121f[_0x2f82('0x32')]['includeAll']){_0x3f2e84['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x3f2e84);})['then'](function(_0x1ae81b){_0x16886b[_0x2f82('0x3f')]=_0x1ae81b;return _0x16886b;})[_0x2f82('0x3e')](respondWithFilteredResult(_0x1f9a03,_0x3f2e84))[_0x2f82('0x40')](handleError(_0x1f9a03,null));};exports[_0x2f82('0x41')]=function(_0x589d44,_0x3577cc){var _0x32b927={'raw':![],'where':{'id':_0x589d44[_0x2f82('0x42')]['id']}},_0x34f377={};_0x34f377[_0x2f82('0x31')]=_[_0x2f82('0x33')](db[_0x2f82('0x2d')][_0x2f82('0x2e')]);_0x34f377[_0x2f82('0x32')]=_[_0x2f82('0x33')](_0x589d44[_0x2f82('0x32')]);_0x34f377[_0x2f82('0x34')]=_[_0x2f82('0x35')](_0x34f377[_0x2f82('0x31')],_0x34f377[_0x2f82('0x32')]);_0x32b927['attributes']=_[_0x2f82('0x35')](_0x34f377[_0x2f82('0x31')],qs['fields'](_0x589d44[_0x2f82('0x32')][_0x2f82('0x37')]));_0x32b927['attributes']=_0x32b927[_0x2f82('0x36')][_0x2f82('0x43')]?_0x32b927[_0x2f82('0x36')]:_0x34f377[_0x2f82('0x31')];if(_0x589d44[_0x2f82('0x32')][_0x2f82('0x44')]){_0x32b927['include']=[{'all':!![]}];}_0x32b927=_[_0x2f82('0x45')]({},_0x32b927,_0x589d44[_0x2f82('0x3d')]);return db[_0x2f82('0x2d')][_0x2f82('0x46')](_0x32b927)[_0x2f82('0x3e')](handleEntityNotFound(_0x3577cc,null))[_0x2f82('0x3e')](respondWithResult(_0x3577cc,null))['catch'](handleError(_0x3577cc,null));};exports[_0x2f82('0x47')]=function(_0x133aef,_0x571094){return db[_0x2f82('0x2d')][_0x2f82('0x47')](_0x133aef[_0x2f82('0x48')],{})[_0x2f82('0x3e')](respondWithResult(_0x571094,0xc9))[_0x2f82('0x40')](handleError(_0x571094,null));};exports['update']=function(_0x42a55b,_0x3a7ccd){if(_0x42a55b[_0x2f82('0x48')]['id']){delete _0x42a55b[_0x2f82('0x48')]['id'];}return db[_0x2f82('0x2d')][_0x2f82('0x46')]({'where':{'id':_0x42a55b[_0x2f82('0x42')]['id']}})['then'](handleEntityNotFound(_0x3a7ccd,null))[_0x2f82('0x3e')](saveUpdates(_0x42a55b['body'],null))[_0x2f82('0x3e')](respondWithResult(_0x3a7ccd,null))[_0x2f82('0x40')](handleError(_0x3a7ccd,null));};exports[_0x2f82('0x49')]=function(_0x5b5ef5,_0x310623){return db['Dynamics365Account'][_0x2f82('0x46')]({'where':{'id':_0x5b5ef5['params']['id']}})[_0x2f82('0x3e')](handleEntityNotFound(_0x310623,null))[_0x2f82('0x3e')](removeEntity(_0x310623,null))[_0x2f82('0x40')](handleError(_0x310623,null));};exports[_0x2f82('0x4a')]=function(_0x2e6e44,_0x51902d,_0x5ba529){var _0x105800={};var _0x5341c7={};var _0x29dda6;var _0x5036d1;return db[_0x2f82('0x2d')][_0x2f82('0x4b')]({'where':{'id':_0x2e6e44['params']['id']}})[_0x2f82('0x3e')](handleEntityNotFound(_0x51902d,null))[_0x2f82('0x3e')](function(_0x165b5f){if(_0x165b5f){_0x29dda6=_0x165b5f;_0x5341c7[_0x2f82('0x31')]=_['keys'](db[_0x2f82('0x4c')][_0x2f82('0x2e')]);_0x5341c7[_0x2f82('0x32')]=_[_0x2f82('0x33')](_0x2e6e44['query']);_0x5341c7[_0x2f82('0x34')]=_['intersection'](_0x5341c7['model'],_0x5341c7[_0x2f82('0x32')]);_0x105800[_0x2f82('0x36')]=_['intersection'](_0x5341c7[_0x2f82('0x31')],qs['fields'](_0x2e6e44[_0x2f82('0x32')][_0x2f82('0x37')]));_0x105800[_0x2f82('0x36')]=_0x105800['attributes'][_0x2f82('0x43')]?_0x105800[_0x2f82('0x36')]:_0x5341c7[_0x2f82('0x31')];_0x105800[_0x2f82('0x4d')]=qs[_0x2f82('0x39')](_0x2e6e44['query'][_0x2f82('0x39')]);_0x105800[_0x2f82('0x3a')]=qs[_0x2f82('0x34')](_['pick'](_0x2e6e44[_0x2f82('0x32')],_0x5341c7[_0x2f82('0x34')]));if(_0x2e6e44[_0x2f82('0x32')][_0x2f82('0x3c')]){_0x105800[_0x2f82('0x3a')]=_[_0x2f82('0x45')](_0x105800[_0x2f82('0x3a')],{'$or':_[_0x2f82('0x2c')](_0x105800[_0x2f82('0x36')],function(_0x1680b3){var _0x28b946={};_0x28b946[_0x1680b3]={'$like':'%'+_0x2e6e44[_0x2f82('0x32')]['filter']+'%'};return _0x28b946;})});}_0x105800=_[_0x2f82('0x45')]({},_0x105800,_0x2e6e44[_0x2f82('0x3d')]);return _0x29dda6['getConfigurations'](_0x105800);}})[_0x2f82('0x3e')](function(_0x5c0220){if(_0x5c0220){_0x5036d1=_0x5c0220[_0x2f82('0x43')];if(!_0x2e6e44[_0x2f82('0x32')][_0x2f82('0x4e')]('nolimit')){_0x105800[_0x2f82('0x1f')]=qs[_0x2f82('0x1f')](_0x2e6e44[_0x2f82('0x32')][_0x2f82('0x1f')]);_0x105800['offset']=qs[_0x2f82('0x1e')](_0x2e6e44[_0x2f82('0x32')][_0x2f82('0x1e')]);}return _0x29dda6[_0x2f82('0x4a')](_0x105800);}})[_0x2f82('0x3e')](function(_0x1e1726){if(_0x1e1726){return _0x1e1726?{'count':_0x5036d1,'rows':_0x1e1726}:null;}})[_0x2f82('0x3e')](respondWithResult(_0x51902d,null))[_0x2f82('0x40')](handleError(_0x51902d,null));};exports[_0x2f82('0x4f')]=function(_0x309b75,_0x423cd0,_0x285205){if(_0x309b75['body']['id']){delete _0x309b75['body']['id'];}return db[_0x2f82('0x2d')][_0x2f82('0x4b')]({'where':{'id':_0x309b75['params']['id']}})[_0x2f82('0x3e')](handleEntityNotFound(_0x423cd0,null))[_0x2f82('0x3e')](function(_0x588219){if(_0x588219){_0x309b75[_0x2f82('0x48')]['AccountId']=_0x588219['id'];_0x309b75['body'][_0x2f82('0x50')]=integrations[_0x2f82('0x51')](_0x309b75[_0x2f82('0x48')][_0x2f82('0x52')],_0x309b75[_0x2f82('0x48')][_0x2f82('0x2f')]);_0x309b75['body'][_0x2f82('0x53')]=integrations[_0x2f82('0x54')](_0x309b75[_0x2f82('0x48')][_0x2f82('0x52')],_0x309b75['body'][_0x2f82('0x2f')]);return db[_0x2f82('0x4c')][_0x2f82('0x47')](_0x309b75[_0x2f82('0x48')],{'include':[{'model':db[_0x2f82('0x55')],'as':'Subjects'},{'model':db[_0x2f82('0x55')],'as':'Descriptions'}]});}return null;})[_0x2f82('0x3e')](respondWithResult(_0x423cd0,null))[_0x2f82('0x40')](handleError(_0x423cd0,null));};exports[_0x2f82('0x56')]=function(_0x1fe33b,_0x1f6649,_0xe913de){var _0x280bf9=_0x1fe33b[_0x2f82('0x32')][_0x2f82('0x57')];var _0xba9687=_0x280bf9===_0x2f82('0x58')?_0x2f82('0x59'):_0x2f82('0x5a');var _0x1258e7='';var _0x2f8a43='';var _0x1bfaac='';var _0x5424e1='';var _0x330657='';var _0x509deb='';var _0x1582cb='';var _0x3e121e='';var _0x983d47=[_0x2f82('0x5b'),_0x2f82('0x5c'),_0x2f82('0x5d'),_0x2f82('0x5e'),'caseorigincode','subject',_0x2f82('0x5f'),_0x2f82('0x60'),_0x2f82('0x61'),'phonecall_activity_parties'];var _0x443e43=[_0x2f82('0x62'),_0x2f82('0x63'),_0x2f82('0x64'),'billedserviceunits',_0x2f82('0x65'),_0x2f82('0x66'),_0x2f82('0x67'),_0x2f82('0x68'),_0x2f82('0x69'),'createdbyexternalpartyyominame',_0x2f82('0x6a'),'createdbyyominame','createdon',_0x2f82('0x6b'),'createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame',_0x2f82('0x6c'),_0x2f82('0x6d'),_0x2f82('0x6e'),_0x2f82('0x6f'),_0x2f82('0x70'),'exchangerate',_0x2f82('0x71'),_0x2f82('0x72'),_0x2f82('0x73'),_0x2f82('0x74'),_0x2f82('0x75'),'lastonholdtime',_0x2f82('0x76'),_0x2f82('0x77'),_0x2f82('0x78'),_0x2f82('0x79'),_0x2f82('0x7a'),_0x2f82('0x7b'),_0x2f82('0x7c'),'modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname',_0x2f82('0x7d'),_0x2f82('0x7e'),_0x2f82('0x7f'),'owneridname','owneridtype',_0x2f82('0x80'),_0x2f82('0x81'),_0x2f82('0x82'),_0x2f82('0x83'),_0x2f82('0x84'),_0x2f82('0x85'),_0x2f82('0x86'),_0x2f82('0x87'),_0x2f82('0x88'),'responseby','responsiblecontactidname',_0x2f82('0x89'),_0x2f82('0x8a'),_0x2f82('0x8b'),_0x2f82('0x8c'),_0x2f82('0x8d'),_0x2f82('0x8e'),_0x2f82('0x8f'),'subjectidname',_0x2f82('0x90'),'timezoneruleversionnumber','transactioncurrencyidname',_0x2f82('0x91'),_0x2f82('0x92'),_0x2f82('0x93')];var _0x5073eb=_0x983d47[_0x2f82('0x94')](_0x443e43);return db[_0x2f82('0x2d')][_0x2f82('0x4b')]({'where':{'id':_0x1fe33b[_0x2f82('0x42')]['id']},'attributes':['id',_0x2f82('0x95'),_0x2f82('0x96'),_0x2f82('0x97'),_0x2f82('0x98'),_0x2f82('0x99'),'clientSecret']})[_0x2f82('0x3e')](handleEntityNotFound(_0x1f6649,null))[_0x2f82('0x3e')](function(_0x558cf9){if(_0x558cf9){_0x3e121e=_0x558cf9[_0x2f82('0x97')];var _0x54bf03=_0x3e121e[_0x2f82('0x9a')](-0x1);if(_0x54bf03==='/'){_0x3e121e=_0x3e121e['substring'](0x0,_0x3e121e[_0x2f82('0x9b')](_0x54bf03));}_0x1582cb=util[_0x2f82('0x9c')](_0x2f82('0x9d'),_0x3e121e);var _0x4f21ac={'method':_0x2f82('0x9e'),'uri':_0x2f82('0x9f')+_0x558cf9[_0x2f82('0x98')]+'/oauth2/token','form':{'client_id':_0x558cf9[_0x2f82('0x99')],'resource':_0x3e121e,'username':_0x558cf9[_0x2f82('0x95')],'password':_0x558cf9['password'],'grant_type':'password','client_secret':_0x558cf9['clientSecret']},'json':!![]};return rp(_0x4f21ac);}})[_0x2f82('0x3e')](function(_0xb4e8f8){_0x509deb=_0xb4e8f8[_0x2f82('0xa0')];var _0x3f858b={'method':_0x2f82('0xa1'),'uri':encodeURI(_0x1582cb+_0x2f82('0xa2')+_0xba9687+'\x27'),'headers':{'Authorization':_0x2f82('0xa3')+_0x509deb,'If-None-Match':null,'OData-Version':_0x2f82('0xa4')},'json':!![]};return rp(_0x3f858b);})[_0x2f82('0x3e')](function(_0x1b6aa7){var _0x4093e4=_0x1b6aa7['value'][0x0];var _0x465d87=_0x4093e4['MetadataId'];var _0x454a0f={'method':_0x2f82('0xa1'),'uri':_0x1582cb+'EntityDefinitions('+_0x465d87+_0x2f82('0xa5'),'headers':{'Authorization':_0x2f82('0xa3')+_0x509deb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x454a0f);})[_0x2f82('0x3e')](function(_0x4d01f4){_0x1258e7=_0x4d01f4;_0x2f8a43=_0x1258e7[_0x2f82('0xa6')];_0x2f8a43=_['remove'](_0x2f8a43,function(_0x8eac3){return!_0x5073eb[_0x2f82('0xa7')](_0x8eac3[_0x2f82('0xa8')]);});var _0x40865d=[];var _0x27d4f9=[];_0x2f8a43['forEach'](function(_0x4a4f81){if(_0x4a4f81[_0x2f82('0xa9')]){var _0x3d5493=_0x4a4f81['@odata.type']['substring'](_0x4a4f81[_0x2f82('0xa9')][_0x2f82('0x9b')]('.')+0x1);if(_0x3d5493==='PicklistAttributeMetadata'){_0x40865d[_0x2f82('0xaa')](getSelectList(_0x1582cb,_0x280bf9,_0x27d4f9,_0x1258e7[_0x2f82('0xab')],_0x4a4f81[_0x2f82('0xab')],_0x509deb));}}});return Promise['all'](_0x40865d);})[_0x2f82('0x3e')](function(_0x4971c2){_0x1bfaac=_0x4971c2[0x0];var _0x7defc0=[];var _0x1c29e0=[];_0x2f8a43['forEach'](function(_0x350c62){if(!_[_0x2f82('0xac')](_0x350c62[_0x2f82('0xa9')])){var _0x4ff916=_0x350c62[_0x2f82('0xa9')][_0x2f82('0xad')](_0x350c62[_0x2f82('0xa9')][_0x2f82('0x9b')]('.')+0x1);if(_0x4ff916===_0x2f82('0xae')){_0x7defc0[_0x2f82('0xaa')](getBooleanList(_0x1582cb,_0x280bf9,_0x1c29e0,_0x1258e7['MetadataId'],_0x350c62[_0x2f82('0xab')],_0x509deb));}}});return Promise[_0x2f82('0xaf')](_0x7defc0);})[_0x2f82('0x3e')](function(_0x50be33){_0x5424e1=_0x50be33[0x0];var _0x2dff8f=[];var _0x24e632=[];_0x2f8a43[_0x2f82('0xb0')](function(_0x1174db){if(_0x1174db[_0x2f82('0xa9')]){var _0x13c8b2=_0x1174db[_0x2f82('0xa9')][_0x2f82('0xad')](_0x1174db['@odata.type']['lastIndexOf']('.')+0x1);if(_0x13c8b2==='StringAttributeMetadata'||_0x13c8b2===_0x2f82('0xb1')||_0x13c8b2===_0x2f82('0xb2')||_0x13c8b2==='IntegerAttributeMetadata'||_0x13c8b2===_0x2f82('0xb3')||_0x13c8b2===_0x2f82('0xb4')||_0x13c8b2===_0x2f82('0xb5')||_0x13c8b2===_0x2f82('0xb6')||_0x13c8b2===_0x2f82('0xb7')||_0x13c8b2===_0x2f82('0xb8')){_0x2dff8f['push'](getInputList(_0x1582cb,_0x280bf9,_0x13c8b2,_0x24e632,_0x1258e7[_0x2f82('0xab')],_0x1174db[_0x2f82('0xab')],_0x509deb));}}});return Promise[_0x2f82('0xaf')](_0x2dff8f);})['then'](function(_0x46f602){_0x330657=_0x46f602[0x0];var _0x2bf0fa=_0x1bfaac[_0x2f82('0x94')](_0x5424e1)[_0x2f82('0x94')](_0x330657);var _0x2dcf03={'count':_0x2bf0fa[_0x2f82('0x43')],'rows':_0x2bf0fa};return _0x2dcf03;})[_0x2f82('0x3e')](respondWithResult(_0x1f6649,null))[_0x2f82('0x40')](function(_0xe26040){var _0x50fc7b=_0x1fe33b[_0x2f82('0x32')]['test']?0x1f4:_0xe26040['statusCode']||0x1f4;logger[_0x2f82('0x28')](_0xe26040[_0x2f82('0xb9')]);delete _0xe26040[_0x2f82('0x29')];if(_0x50fc7b===0x191){_0x50fc7b=0x190;}_0x1f6649[_0x2f82('0x1b')](_0x50fc7b)[_0x2f82('0x2a')](_0x1fe33b[_0x2f82('0x32')][_0x2f82('0xba')]?{'message':_0x2f82('0xbb'),'statusCode':_0xe26040['statusCode']}:_0xe26040);});};function getSelectList(_0x39db15,_0x8c7676,_0x9a296d,_0x13fbca,_0x19b20d,_0x66b919){var _0x5212a9={'method':_0x2f82('0xa1'),'uri':_0x39db15+_0x2f82('0xbc')+_0x13fbca+_0x2f82('0xbd')+_0x19b20d+_0x2f82('0xbe')+_0x2f82('0xbf'),'headers':{'Authorization':_0x2f82('0xa3')+_0x66b919,'If-None-Match':null,'OData-Version':_0x2f82('0xa4')},'json':!![]};return rp(_0x5212a9)[_0x2f82('0x3e')](function(_0x5c75b4){var _0xceb90=[];var _0x350be5=_0x5c75b4['OptionSet'][_0x2f82('0xc0')];_0x350be5[_0x2f82('0xb0')](function(_0x45757f){_0xceb90[_0x2f82('0xaa')]({'name':_0x45757f[_0x2f82('0xc1')]['UserLocalizedLabel'][_0x2f82('0xc1')],'value':String(_0x45757f[_0x2f82('0xc2')])});});var _0x28a265={'id':_0x8c7676+'_'+_0x5c75b4['LogicalName'],'name':_0x5c75b4['DisplayName']['UserLocalizedLabel'][_0x2f82('0xc1')],'custom':![],'options':_0xceb90};_0x9a296d[_0x2f82('0xaa')](_0x28a265);return _0x9a296d;});}function getBooleanList(_0x10f8b4,_0x517458,_0x1e1ddd,_0x12263a,_0x2aa965,_0xd609bf){var _0x2e671b={'method':_0x2f82('0xa1'),'uri':_0x10f8b4+_0x2f82('0xbc')+_0x12263a+_0x2f82('0xbd')+_0x2aa965+_0x2f82('0xc3'),'headers':{'Authorization':'Bearer\x20'+_0xd609bf,'If-None-Match':null,'OData-Version':_0x2f82('0xa4')},'json':!![]};return rp(_0x2e671b)[_0x2f82('0x3e')](function(_0x3a7786){var _0x1bda99=[];_0x1bda99['push']({'name':_0x3a7786[_0x2f82('0xc4')]['TrueOption'][_0x2f82('0xc1')][_0x2f82('0xc5')][_0x2f82('0xc1')],'value':_0x2f82('0xc6')},{'name':_0x3a7786[_0x2f82('0xc4')][_0x2f82('0xc7')][_0x2f82('0xc1')][_0x2f82('0xc5')][_0x2f82('0xc1')],'value':_0x2f82('0xc8')});var _0x1b4613={'id':_0x517458+'_'+_0x3a7786[_0x2f82('0xa8')],'name':_0x3a7786['DisplayName'][_0x2f82('0xc5')]['Label'],'custom':![],'options':_0x1bda99};_0x1e1ddd[_0x2f82('0xaa')](_0x1b4613);return _0x1e1ddd;});}function getInputList(_0xfd72b6,_0x147a52,_0x18d028,_0x7dfc17,_0x4a5ebe,_0x38f73b,_0x2184d3){var _0x5867a0={'method':_0x2f82('0xa1'),'uri':_0xfd72b6+_0x2f82('0xbc')+_0x4a5ebe+_0x2f82('0xbd')+_0x38f73b+_0x2f82('0xc9')+_0x18d028+_0x2f82('0xca'),'headers':{'Authorization':'Bearer\x20'+_0x2184d3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5867a0)['then'](function(_0x44da23){var _0x565cc={'id':_0x147a52+'_'+_0x44da23[_0x2f82('0xa8')],'name':_0x44da23[_0x2f82('0xcb')][_0x2f82('0xc5')]?_0x44da23[_0x2f82('0xcb')][_0x2f82('0xc5')][_0x2f82('0xc1')]:_0x44da23['LogicalName'],'custom':![],'options':[]};_0x7dfc17[_0x2f82('0xaa')](_0x565cc);return _0x7dfc17;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 436e920..038bb0c 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(_0x2ce03a,_0x135af8){var _0x217100=function(_0x58c606){while(--_0x58c606){_0x2ce03a['push'](_0x2ce03a['shift']());}};_0x217100(++_0x135af8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x48db3d,_0x5188a4){var _0x1e94a4=function(_0x4feb2e){while(--_0x4feb2e){_0x48db3d['push'](_0x48db3d['shift']());}};_0x1e94a4(++_0x5188a4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index ea40c14..0f8da49 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 _0x73d9=['GetDynamics365Account','debug','find','ShowDynamics365Account','lodash','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','findAll','options','where','attributes','limit','include','model','map'];(function(_0x197821,_0x33b01d){var _0x25e66f=function(_0x17fe18){while(--_0x17fe18){_0x197821['push'](_0x197821['shift']());}};_0x25e66f(++_0x33b01d);}(_0x73d9,0x104));var _0x973d=function(_0x581105,_0x21efb4){_0x581105=_0x581105-0x0;var _0x6cd083=_0x73d9[_0x581105];return _0x6cd083;};'use strict';var _=require(_0x973d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x973d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x973d('0x2'))['db'];var utils=require(_0x973d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x973d('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x973d('0x5')][_0x973d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x523c90,_0xa4296c,_0xd75a07){return new BPromise(function(_0x95f7b2,_0x2f4f21){return client[_0x973d('0x7')](_0x523c90,_0xd75a07)[_0x973d('0x8')](function(_0x106696){logger[_0x973d('0x9')](_0x973d('0xa'),_0xa4296c,_0x973d('0xb'));logger['debug'](_0x973d('0xc'),_0xa4296c,_0x973d('0xb'),JSON[_0x973d('0xd')](_0x106696));if(_0x106696[_0x973d('0xe')]){if(_0x106696[_0x973d('0xe')][_0x973d('0xf')]===0x1f4){logger[_0x973d('0xe')](_0x973d('0xa'),_0xa4296c,_0x106696['error']['message']);return _0x2f4f21(_0x106696[_0x973d('0xe')][_0x973d('0x10')]);}logger[_0x973d('0xe')](_0x973d('0xa'),_0xa4296c,_0x106696[_0x973d('0xe')][_0x973d('0x10')]);return _0x95f7b2(_0x106696['error']['message']);}else{logger['info'](_0x973d('0xa'),_0xa4296c,_0x973d('0xb'));_0x95f7b2(_0x106696[_0x973d('0x11')][_0x973d('0x10')]);}})[_0x973d('0x12')](function(_0x3a4c23){logger['error'](_0x973d('0xa'),_0xa4296c,_0x3a4c23);_0x2f4f21(_0x3a4c23);});});}exports['GetDynamics365Account']=function(_0x2177b1){var _0x249f34=this;return new Promise(function(_0x2c53e7,_0x5e0fec){return db[_0x973d('0x13')][_0x973d('0x14')]({'raw':_0x2177b1[_0x973d('0x15')]?_0x2177b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x2177b1['options']?_0x2177b1[_0x973d('0x15')][_0x973d('0x16')]||null:null,'attributes':_0x2177b1[_0x973d('0x15')]?_0x2177b1['options'][_0x973d('0x17')]||null:null,'limit':_0x2177b1[_0x973d('0x15')]?_0x2177b1[_0x973d('0x15')][_0x973d('0x18')]||null:null,'include':_0x2177b1[_0x973d('0x15')]?_0x2177b1[_0x973d('0x15')][_0x973d('0x19')]?_['map'](_0x2177b1['options']['include'],function(_0x1b8198){return{'model':db[_0x1b8198[_0x973d('0x1a')]],'as':_0x1b8198['as'],'attributes':_0x1b8198[_0x973d('0x17')],'include':_0x1b8198[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x1b8198[_0x973d('0x19')],function(_0x1298de){return{'model':db[_0x1298de[_0x973d('0x1a')]],'as':_0x1298de['as'],'attributes':_0x1298de[_0x973d('0x17')],'include':_0x1298de[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x1298de['include'],function(_0x131319){return{'model':db[_0x131319[_0x973d('0x1a')]],'as':_0x131319['as'],'attributes':_0x131319['attributes']};}):[]};}):[]};}):[]:[]})[_0x973d('0x8')](function(_0x5597dd){logger[_0x973d('0x9')](_0x973d('0x1c'),_0x2177b1);logger[_0x973d('0x1d')](_0x973d('0x1c'),_0x2177b1,JSON['stringify'](_0x5597dd));_0x2c53e7(_0x5597dd);})[_0x973d('0x12')](function(_0x3a916d){logger['error']('GetDynamics365Account',_0x3a916d[_0x973d('0x10')],_0x2177b1);_0x5e0fec(_0x249f34['error'](0x1f4,_0x3a916d[_0x973d('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x7e569b){var _0x15280e=this;return new Promise(function(_0x5e8d2f,_0x2649f8){return db[_0x973d('0x13')][_0x973d('0x1e')]({'raw':_0x7e569b[_0x973d('0x15')]?_0x7e569b[_0x973d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x7e569b[_0x973d('0x15')]?_0x7e569b[_0x973d('0x15')]['where']||null:null,'attributes':_0x7e569b[_0x973d('0x15')]?_0x7e569b['options'][_0x973d('0x17')]||null:null,'include':_0x7e569b[_0x973d('0x15')]?_0x7e569b[_0x973d('0x15')][_0x973d('0x19')]?_['map'](_0x7e569b[_0x973d('0x15')][_0x973d('0x19')],function(_0x1434d7){return{'model':db[_0x1434d7[_0x973d('0x1a')]],'as':_0x1434d7['as'],'attributes':_0x1434d7[_0x973d('0x17')],'include':_0x1434d7[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x1434d7[_0x973d('0x19')],function(_0x2dbd55){return{'model':db[_0x2dbd55[_0x973d('0x1a')]],'as':_0x2dbd55['as'],'attributes':_0x2dbd55['attributes'],'include':_0x2dbd55[_0x973d('0x19')]?_[_0x973d('0x1b')](_0x2dbd55[_0x973d('0x19')],function(_0x53cf7b){return{'model':db[_0x53cf7b[_0x973d('0x1a')]],'as':_0x53cf7b['as'],'attributes':_0x53cf7b[_0x973d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b61d){logger['info'](_0x973d('0x1f'),_0x7e569b);logger['debug']('ShowDynamics365Account',_0x7e569b,JSON['stringify'](_0x59b61d));_0x5e8d2f(_0x59b61d);})['catch'](function(_0x4724d7){logger[_0x973d('0xe')](_0x973d('0x1f'),_0x4724d7['message'],_0x7e569b);_0x2649f8(_0x15280e[_0x973d('0xe')](0x1f4,_0x4724d7[_0x973d('0x10')]));});});}; \ No newline at end of file +var _0x17a1=['raw','where','attributes','limit','map','include','model','stringify','ShowDynamics365Account','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetDynamics365Account','findAll','options'];(function(_0x514fc0,_0x1032a0){var _0x26f8ee=function(_0x3bd0da){while(--_0x3bd0da){_0x514fc0['push'](_0x514fc0['shift']());}};_0x26f8ee(++_0x1032a0);}(_0x17a1,0x13b));var _0x117a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x17a1[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x117a('0x0'));var util=require(_0x117a('0x1'));var moment=require(_0x117a('0x2'));var BPromise=require(_0x117a('0x3'));var rs=require(_0x117a('0x4'));var fs=require('fs');var Redis=require(_0x117a('0x5'));var db=require(_0x117a('0x6'))['db'];var utils=require(_0x117a('0x7'));var logger=require(_0x117a('0x8'))(_0x117a('0x9'));var config=require(_0x117a('0xa'));var jayson=require(_0x117a('0xb'));var client=jayson[_0x117a('0xc')][_0x117a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b0267,_0x134e47,_0x270cbc){return new BPromise(function(_0x122f09,_0x46573a){return client[_0x117a('0xe')](_0x4b0267,_0x270cbc)[_0x117a('0xf')](function(_0x30b783){logger[_0x117a('0x10')](_0x117a('0x11'),_0x134e47,_0x117a('0x12'));logger['debug'](_0x117a('0x13'),_0x134e47,_0x117a('0x12'),JSON['stringify'](_0x30b783));if(_0x30b783['error']){if(_0x30b783[_0x117a('0x14')]['code']===0x1f4){logger[_0x117a('0x14')](_0x117a('0x11'),_0x134e47,_0x30b783['error'][_0x117a('0x15')]);return _0x46573a(_0x30b783[_0x117a('0x14')][_0x117a('0x15')]);}logger[_0x117a('0x14')](_0x117a('0x11'),_0x134e47,_0x30b783[_0x117a('0x14')][_0x117a('0x15')]);return _0x122f09(_0x30b783['error'][_0x117a('0x15')]);}else{logger[_0x117a('0x10')](_0x117a('0x11'),_0x134e47,_0x117a('0x12'));_0x122f09(_0x30b783[_0x117a('0x16')][_0x117a('0x15')]);}})[_0x117a('0x17')](function(_0x18b3c7){logger[_0x117a('0x14')](_0x117a('0x11'),_0x134e47,_0x18b3c7);_0x46573a(_0x18b3c7);});});}exports[_0x117a('0x18')]=function(_0x3ec9fe){var _0x59a821=this;return new Promise(function(_0x5a036a,_0x20423f){return db['Dynamics365Account'][_0x117a('0x19')]({'raw':_0x3ec9fe[_0x117a('0x1a')]?_0x3ec9fe[_0x117a('0x1a')][_0x117a('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ec9fe['options']?_0x3ec9fe[_0x117a('0x1a')][_0x117a('0x1c')]||null:null,'attributes':_0x3ec9fe[_0x117a('0x1a')]?_0x3ec9fe[_0x117a('0x1a')][_0x117a('0x1d')]||null:null,'limit':_0x3ec9fe[_0x117a('0x1a')]?_0x3ec9fe[_0x117a('0x1a')][_0x117a('0x1e')]||null:null,'include':_0x3ec9fe[_0x117a('0x1a')]?_0x3ec9fe[_0x117a('0x1a')]['include']?_[_0x117a('0x1f')](_0x3ec9fe['options'][_0x117a('0x20')],function(_0x159c40){return{'model':db[_0x159c40[_0x117a('0x21')]],'as':_0x159c40['as'],'attributes':_0x159c40['attributes'],'include':_0x159c40['include']?_[_0x117a('0x1f')](_0x159c40[_0x117a('0x20')],function(_0x4f3f6e){return{'model':db[_0x4f3f6e[_0x117a('0x21')]],'as':_0x4f3f6e['as'],'attributes':_0x4f3f6e[_0x117a('0x1d')],'include':_0x4f3f6e[_0x117a('0x20')]?_[_0x117a('0x1f')](_0x4f3f6e[_0x117a('0x20')],function(_0x2a4f02){return{'model':db[_0x2a4f02['model']],'as':_0x2a4f02['as'],'attributes':_0x2a4f02[_0x117a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x117a('0xf')](function(_0x13b92e){logger['info'](_0x117a('0x18'),_0x3ec9fe);logger['debug'](_0x117a('0x18'),_0x3ec9fe,JSON[_0x117a('0x22')](_0x13b92e));_0x5a036a(_0x13b92e);})[_0x117a('0x17')](function(_0x1e56a2){logger[_0x117a('0x14')](_0x117a('0x18'),_0x1e56a2[_0x117a('0x15')],_0x3ec9fe);_0x20423f(_0x59a821[_0x117a('0x14')](0x1f4,_0x1e56a2['message']));});});};exports[_0x117a('0x23')]=function(_0x2a98d8){var _0x4cf26c=this;return new Promise(function(_0x10f6ed,_0x44db7d){return db['Dynamics365Account'][_0x117a('0x24')]({'raw':_0x2a98d8[_0x117a('0x1a')]?_0x2a98d8[_0x117a('0x1a')][_0x117a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2a98d8[_0x117a('0x1a')]?_0x2a98d8[_0x117a('0x1a')][_0x117a('0x1c')]||null:null,'attributes':_0x2a98d8[_0x117a('0x1a')]?_0x2a98d8['options']['attributes']||null:null,'include':_0x2a98d8['options']?_0x2a98d8[_0x117a('0x1a')][_0x117a('0x20')]?_[_0x117a('0x1f')](_0x2a98d8['options'][_0x117a('0x20')],function(_0x513c09){return{'model':db[_0x513c09[_0x117a('0x21')]],'as':_0x513c09['as'],'attributes':_0x513c09[_0x117a('0x1d')],'include':_0x513c09['include']?_[_0x117a('0x1f')](_0x513c09[_0x117a('0x20')],function(_0x5608c6){return{'model':db[_0x5608c6[_0x117a('0x21')]],'as':_0x5608c6['as'],'attributes':_0x5608c6[_0x117a('0x1d')],'include':_0x5608c6[_0x117a('0x20')]?_['map'](_0x5608c6[_0x117a('0x20')],function(_0x5544b9){return{'model':db[_0x5544b9[_0x117a('0x21')]],'as':_0x5544b9['as'],'attributes':_0x5544b9[_0x117a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x117a('0xf')](function(_0x273cb6){logger[_0x117a('0x10')]('ShowDynamics365Account',_0x2a98d8);logger[_0x117a('0x25')](_0x117a('0x23'),_0x2a98d8,JSON[_0x117a('0x22')](_0x273cb6));_0x10f6ed(_0x273cb6);})[_0x117a('0x17')](function(_0x47f3c1){logger['error'](_0x117a('0x23'),_0x47f3c1[_0x117a('0x15')],_0x2a98d8);_0x44db7d(_0x4cf26c[_0x117a('0x14')](0x1f4,_0x47f3c1['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 4fc4a75..cbb59a6 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 _0xd3a0=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','update','delete'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x188f29,_0x3875e6){_0x188f29=_0x188f29-0x0;var _0x4a5489=_0xd3a0[_0x188f29];return _0x4a5489;};'use strict';var multer=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var path=require(_0x0d3a('0x2'));var timeout=require(_0x0d3a('0x3'));var express=require('express');var router=express[_0x0d3a('0x4')]();var fs_extra=require(_0x0d3a('0x5'));var auth=require(_0x0d3a('0x6'));var interaction=require(_0x0d3a('0x7'));var config=require(_0x0d3a('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x0d3a('0x9')]('/',auth[_0x0d3a('0xa')](),controller[_0x0d3a('0xb')]);router[_0x0d3a('0x9')](_0x0d3a('0xc'),auth['isAuthenticated'](),controller[_0x0d3a('0xd')]);router[_0x0d3a('0x9')](_0x0d3a('0xe'),auth[_0x0d3a('0xa')](),controller[_0x0d3a('0xf')]);router[_0x0d3a('0x9')](_0x0d3a('0x10'),auth['isAuthenticated'](),controller[_0x0d3a('0x11')]);router[_0x0d3a('0x9')]('/:id/descriptions',auth[_0x0d3a('0xa')](),controller[_0x0d3a('0x12')]);router[_0x0d3a('0x13')]('/',auth[_0x0d3a('0xa')](),controller['create']);router['put'](_0x0d3a('0xc'),auth[_0x0d3a('0xa')](),controller[_0x0d3a('0x14')]);router[_0x0d3a('0x15')](_0x0d3a('0xc'),auth[_0x0d3a('0xa')](),controller[_0x0d3a('0x16')]);module[_0x0d3a('0x17')]=router; \ No newline at end of file +var _0x3d3e=['isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x3d3e,0x89));var _0xe3d3=function(_0x2f04ed,_0x18e3ce){_0x2f04ed=_0x2f04ed-0x0;var _0x5116d7=_0x3d3e[_0x2f04ed];return _0x5116d7;};'use strict';var multer=require(_0xe3d3('0x0'));var util=require(_0xe3d3('0x1'));var path=require(_0xe3d3('0x2'));var timeout=require(_0xe3d3('0x3'));var express=require(_0xe3d3('0x4'));var router=express[_0xe3d3('0x5')]();var fs_extra=require(_0xe3d3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe3d3('0x7'));var config=require(_0xe3d3('0x8'));var controller=require(_0xe3d3('0x9'));router[_0xe3d3('0xa')]('/',auth['isAuthenticated'](),controller[_0xe3d3('0xb')]);router[_0xe3d3('0xa')](_0xe3d3('0xc'),auth[_0xe3d3('0xd')](),controller['show']);router['get'](_0xe3d3('0xe'),auth[_0xe3d3('0xd')](),controller[_0xe3d3('0xf')]);router[_0xe3d3('0xa')](_0xe3d3('0x10'),auth['isAuthenticated'](),controller[_0xe3d3('0x11')]);router['get'](_0xe3d3('0x12'),auth[_0xe3d3('0xd')](),controller[_0xe3d3('0x13')]);router[_0xe3d3('0x14')]('/',auth[_0xe3d3('0xd')](),controller[_0xe3d3('0x15')]);router[_0xe3d3('0x16')](_0xe3d3('0xc'),auth[_0xe3d3('0xd')](),controller['update']);router[_0xe3d3('0x17')](_0xe3d3('0xc'),auth[_0xe3d3('0xd')](),controller['destroy']);module[_0xe3d3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 9caba06..32dbced 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 _0x5ee2=['contact','sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x5d3dad,_0x9e4d94){var _0x2ed55c=function(_0x306f76){while(--_0x306f76){_0x5d3dad['push'](_0x5d3dad['shift']());}};_0x2ed55c(++_0x9e4d94);}(_0x5ee2,0x14a));var _0x25ee=function(_0x160e12,_0x2c91aa){_0x160e12=_0x160e12-0x0;var _0x1efbe4=_0x5ee2[_0x160e12];return _0x1efbe4;};'use strict';var Sequelize=require(_0x25ee('0x0'));module[_0x25ee('0x1')]={'name':{'type':Sequelize[_0x25ee('0x2')]},'description':{'type':Sequelize[_0x25ee('0x2')]},'ticketType':{'type':Sequelize[_0x25ee('0x3')](_0x25ee('0x4'),_0x25ee('0x5')),'defaultValue':_0x25ee('0x4')},'moduleCreate':{'type':Sequelize[_0x25ee('0x3')](_0x25ee('0x6'),'nothing'),'defaultValue':_0x25ee('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x03dd=['ENUM','incident','phonecall','contact','nothing','sequelize','exports','STRING'];(function(_0x4db1c1,_0x4f26a4){var _0xb48c08=function(_0x2a7cac){while(--_0x2a7cac){_0x4db1c1['push'](_0x4db1c1['shift']());}};_0xb48c08(++_0x4f26a4);}(_0x03dd,0x19d));var _0xd03d=function(_0x501e6d,_0x43ce8e){_0x501e6d=_0x501e6d-0x0;var _0x545ff9=_0x03dd[_0x501e6d];return _0x545ff9;};'use strict';var Sequelize=require(_0xd03d('0x0'));module[_0xd03d('0x1')]={'name':{'type':Sequelize[_0xd03d('0x2')]},'description':{'type':Sequelize[_0xd03d('0x2')]},'ticketType':{'type':Sequelize[_0xd03d('0x3')](_0xd03d('0x4'),_0xd03d('0x5')),'defaultValue':_0xd03d('0x4')},'moduleCreate':{'type':Sequelize[_0xd03d('0x3')](_0xd03d('0x6'),_0xd03d('0x7')),'defaultValue':_0xd03d('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 7522e55..55f1e78 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 _0x4463=['attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','rawAttributes','type','map','query','filters','intersection'];(function(_0x2ac35e,_0x2802d3){var _0x58ba3b=function(_0x124df0){while(--_0x124df0){_0x2ac35e['push'](_0x2ac35e['shift']());}};_0x58ba3b(++_0x2802d3);}(_0x4463,0x10f));var _0x3446=function(_0x4094d2,_0x207209){_0x4094d2=_0x4094d2-0x0;var _0x14f6da=_0x4463[_0x4094d2];return _0x14f6da;};'use strict';var emlformat=require(_0x3446('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3446('0x1'));var jsonpatch=require(_0x3446('0x2'));var rp=require(_0x3446('0x3'));var moment=require(_0x3446('0x4'));var BPromise=require(_0x3446('0x5'));var Mustache=require(_0x3446('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3446('0x7'));var csv=require(_0x3446('0x8'));var ejs=require(_0x3446('0x9'));var fs=require('fs');var fs_extra=require(_0x3446('0xa'));var _=require(_0x3446('0xb'));var squel=require(_0x3446('0xc'));var crypto=require(_0x3446('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3446('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3446('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3446('0x10'));var qs=require(_0x3446('0x11'));var as=require(_0x3446('0x12'));var hardwareService=require(_0x3446('0x13'));var logger=require(_0x3446('0x14'))(_0x3446('0x15'));var utils=require(_0x3446('0x16'));var config=require(_0x3446('0x17'));var licenseUtil=require(_0x3446('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b29a9,_0x109f51){_0x109f51=_0x109f51||0xcc;return function(_0x48a079){if(_0x48a079){return _0x5b29a9['sendStatus'](_0x109f51);}return _0x5b29a9[_0x3446('0x19')](_0x109f51)[_0x3446('0x1a')]();};}function respondWithResult(_0x35d22d,_0x4abe30){_0x4abe30=_0x4abe30||0xc8;return function(_0x23b456){if(_0x23b456){return _0x35d22d['status'](_0x4abe30)['json'](_0x23b456);}};}function respondWithFilteredResult(_0x1bcabd,_0x5bf885){return function(_0x53fcf0){if(_0x53fcf0){var _0x208001=typeof _0x5bf885[_0x3446('0x1b')]===_0x3446('0x1c')&&typeof _0x5bf885[_0x3446('0x1d')]==='undefined';var _0x5702f3=_0x53fcf0[_0x3446('0x1e')];var _0x557ebe=_0x208001?0x0:_0x5bf885[_0x3446('0x1b')];var _0x36be28=_0x208001?_0x53fcf0[_0x3446('0x1e')]:_0x5bf885[_0x3446('0x1b')]+_0x5bf885[_0x3446('0x1d')];var _0x364cc4;if(_0x36be28>=_0x5702f3){_0x36be28=_0x5702f3;_0x364cc4=0xc8;}else{_0x364cc4=0xce;}_0x1bcabd[_0x3446('0x19')](_0x364cc4);return _0x1bcabd[_0x3446('0x1f')](_0x3446('0x20'),_0x557ebe+'-'+_0x36be28+'/'+_0x5702f3)[_0x3446('0x21')](_0x53fcf0);}return null;};}function patchUpdates(_0x10e6cc){return function(_0x2f0c90){try{jsonpatch[_0x3446('0x22')](_0x2f0c90,_0x10e6cc,!![]);}catch(_0xb8287e){return BPromise[_0x3446('0x23')](_0xb8287e);}return _0x2f0c90['save']();};}function saveUpdates(_0x748e04,_0x4e73e2){return function(_0x5dd1be){if(_0x5dd1be){return _0x5dd1be[_0x3446('0x24')](_0x748e04)[_0x3446('0x25')](function(_0x720fda){return _0x720fda;});}return null;};}function removeEntity(_0x2b0e50,_0x4c5daf){return function(_0x5ceda3){if(_0x5ceda3){return _0x5ceda3['destroy']()[_0x3446('0x25')](function(){_0x2b0e50[_0x3446('0x19')](0xcc)[_0x3446('0x1a')]();});}};}function handleEntityNotFound(_0x13b47e,_0xe244aa){return function(_0x2da8ab){if(!_0x2da8ab){_0x13b47e[_0x3446('0x26')](0x194);}return _0x2da8ab;};}function handleError(_0x92064c,_0x3abb1f){_0x3abb1f=_0x3abb1f||0x1f4;return function(_0x536257){logger[_0x3446('0x27')](_0x536257[_0x3446('0x28')]);if(_0x536257[_0x3446('0x29')]){delete _0x536257[_0x3446('0x29')];}_0x92064c[_0x3446('0x19')](_0x3abb1f)[_0x3446('0x2a')](_0x536257);};}exports['index']=function(_0x1102a4,_0x5166dc){var _0xe8061e={},_0x51c8c3={},_0x4f7dcc={'count':0x0,'rows':[]};var _0x399333=_['map'](db['Dynamics365Configuration'][_0x3446('0x2b')],function(_0x1ee79a){return{'name':_0x1ee79a['fieldName'],'type':_0x1ee79a[_0x3446('0x2c')]['key']};});_0x51c8c3['model']=_[_0x3446('0x2d')](_0x399333,_0x3446('0x29'));_0x51c8c3[_0x3446('0x2e')]=_['keys'](_0x1102a4['query']);_0x51c8c3[_0x3446('0x2f')]=_[_0x3446('0x30')](_0x51c8c3['model'],_0x51c8c3[_0x3446('0x2e')]);_0xe8061e[_0x3446('0x31')]=_[_0x3446('0x30')](_0x51c8c3[_0x3446('0x32')],qs[_0x3446('0x33')](_0x1102a4['query'][_0x3446('0x33')]));_0xe8061e[_0x3446('0x31')]=_0xe8061e[_0x3446('0x31')][_0x3446('0x34')]?_0xe8061e[_0x3446('0x31')]:_0x51c8c3[_0x3446('0x32')];if(!_0x1102a4[_0x3446('0x2e')][_0x3446('0x35')](_0x3446('0x36'))){_0xe8061e['limit']=qs[_0x3446('0x1d')](_0x1102a4[_0x3446('0x2e')]['limit']);_0xe8061e[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x1102a4[_0x3446('0x2e')][_0x3446('0x1b')]);}_0xe8061e[_0x3446('0x37')]=qs[_0x3446('0x38')](_0x1102a4[_0x3446('0x2e')][_0x3446('0x38')]);_0xe8061e[_0x3446('0x39')]=qs[_0x3446('0x2f')](_['pick'](_0x1102a4[_0x3446('0x2e')],_0x51c8c3[_0x3446('0x2f')]),_0x399333);if(_0x1102a4[_0x3446('0x2e')][_0x3446('0x3a')]){_0xe8061e['where']=_[_0x3446('0x3b')](_0xe8061e['where'],{'$or':_[_0x3446('0x2d')](_0x399333,function(_0x347978){if(_0x347978[_0x3446('0x2c')]!==_0x3446('0x3c')){var _0x213bc4={};_0x213bc4[_0x347978['name']]={'$like':'%'+_0x1102a4['query'][_0x3446('0x3a')]+'%'};return _0x213bc4;}})});}_0xe8061e=_[_0x3446('0x3b')]({},_0xe8061e,_0x1102a4[_0x3446('0x3d')]);var _0x46a599={'where':_0xe8061e[_0x3446('0x39')]};return db[_0x3446('0x3e')][_0x3446('0x1e')](_0x46a599)[_0x3446('0x25')](function(_0x1b53a2){_0x4f7dcc[_0x3446('0x1e')]=_0x1b53a2;if(_0x1102a4[_0x3446('0x2e')][_0x3446('0x3f')]){_0xe8061e[_0x3446('0x40')]=[{'all':!![]}];}return db[_0x3446('0x3e')][_0x3446('0x41')](_0xe8061e);})[_0x3446('0x25')](function(_0x4549dd){_0x4f7dcc[_0x3446('0x42')]=_0x4549dd;return _0x4f7dcc;})[_0x3446('0x25')](respondWithFilteredResult(_0x5166dc,_0xe8061e))[_0x3446('0x43')](handleError(_0x5166dc,null));};exports[_0x3446('0x44')]=function(_0x36dc94,_0x3ff2cc){var _0x13a605={'raw':![],'where':{'id':_0x36dc94['params']['id']}},_0x21d813={};_0x21d813[_0x3446('0x32')]=_[_0x3446('0x45')](db[_0x3446('0x3e')][_0x3446('0x2b')]);_0x21d813[_0x3446('0x2e')]=_['keys'](_0x36dc94[_0x3446('0x2e')]);_0x21d813[_0x3446('0x2f')]=_[_0x3446('0x30')](_0x21d813[_0x3446('0x32')],_0x21d813[_0x3446('0x2e')]);_0x13a605[_0x3446('0x31')]=_[_0x3446('0x30')](_0x21d813[_0x3446('0x32')],qs[_0x3446('0x33')](_0x36dc94['query'][_0x3446('0x33')]));_0x13a605[_0x3446('0x31')]=_0x13a605[_0x3446('0x31')][_0x3446('0x34')]?_0x13a605[_0x3446('0x31')]:_0x21d813[_0x3446('0x32')];if(_0x36dc94[_0x3446('0x2e')][_0x3446('0x3f')]){_0x13a605[_0x3446('0x40')]=[{'all':!![]}];}_0x13a605=_[_0x3446('0x3b')]({},_0x13a605,_0x36dc94[_0x3446('0x3d')]);return db['Dynamics365Configuration'][_0x3446('0x46')](_0x13a605)[_0x3446('0x25')](handleEntityNotFound(_0x3ff2cc,null))[_0x3446('0x25')](respondWithResult(_0x3ff2cc,null))[_0x3446('0x43')](handleError(_0x3ff2cc,null));};exports[_0x3446('0x47')]=function(_0x1202a7,_0x8b4be){return db[_0x3446('0x3e')][_0x3446('0x47')](_0x1202a7[_0x3446('0x48')],{})[_0x3446('0x25')](respondWithResult(_0x8b4be,0xc9))[_0x3446('0x43')](handleError(_0x8b4be,null));};exports['update']=function(_0x2ca0a8,_0x1eb349){if(_0x2ca0a8[_0x3446('0x48')]['id']){delete _0x2ca0a8[_0x3446('0x48')]['id'];}return db['Dynamics365Configuration'][_0x3446('0x46')]({'where':{'id':_0x2ca0a8[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x1eb349,null))['then'](saveUpdates(_0x2ca0a8['body'],null))[_0x3446('0x25')](respondWithResult(_0x1eb349,null))['catch'](handleError(_0x1eb349,null));};exports['destroy']=function(_0x5ef81a,_0x4764a8){return db[_0x3446('0x3e')][_0x3446('0x46')]({'where':{'id':_0x5ef81a['params']['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x4764a8,null))['then'](removeEntity(_0x4764a8,null))[_0x3446('0x43')](handleError(_0x4764a8,null));};exports[_0x3446('0x4a')]=function(_0x59f364,_0x4292b0,_0x5c743d){var _0x3b691e={};var _0x1b35ef={};var _0x4c4428;var _0x80da03;return db[_0x3446('0x3e')][_0x3446('0x4b')]({'where':{'id':_0x59f364[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x4292b0,null))[_0x3446('0x25')](function(_0x2cd743){if(_0x2cd743){_0x4c4428=_0x2cd743;_0x1b35ef[_0x3446('0x32')]=_[_0x3446('0x45')](db[_0x3446('0x4c')][_0x3446('0x2b')]);_0x1b35ef[_0x3446('0x2e')]=_[_0x3446('0x45')](_0x59f364[_0x3446('0x2e')]);_0x1b35ef['filters']=_['intersection'](_0x1b35ef[_0x3446('0x32')],_0x1b35ef['query']);_0x3b691e[_0x3446('0x31')]=_[_0x3446('0x30')](_0x1b35ef[_0x3446('0x32')],qs[_0x3446('0x33')](_0x59f364[_0x3446('0x2e')]['fields']));_0x3b691e[_0x3446('0x31')]=_0x3b691e[_0x3446('0x31')][_0x3446('0x34')]?_0x3b691e['attributes']:_0x1b35ef[_0x3446('0x32')];_0x3b691e[_0x3446('0x37')]=qs[_0x3446('0x38')](_0x59f364[_0x3446('0x2e')]['sort']);_0x3b691e[_0x3446('0x39')]=qs['filters'](_[_0x3446('0x4d')](_0x59f364[_0x3446('0x2e')],_0x1b35ef[_0x3446('0x2f')]));if(_0x59f364[_0x3446('0x2e')]['filter']){_0x3b691e[_0x3446('0x39')]=_[_0x3446('0x3b')](_0x3b691e[_0x3446('0x39')],{'$or':_['map'](_0x3b691e[_0x3446('0x31')],function(_0x2dbaf3){var _0x53076d={};_0x53076d[_0x2dbaf3]={'$like':'%'+_0x59f364[_0x3446('0x2e')][_0x3446('0x3a')]+'%'};return _0x53076d;})});}_0x3b691e=_[_0x3446('0x3b')]({},_0x3b691e,_0x59f364[_0x3446('0x3d')]);return _0x4c4428[_0x3446('0x4a')](_0x3b691e);}})[_0x3446('0x25')](function(_0x7eb73f){if(_0x7eb73f){_0x80da03=_0x7eb73f[_0x3446('0x34')];if(!_0x59f364[_0x3446('0x2e')]['hasOwnProperty']('nolimit')){_0x3b691e[_0x3446('0x1d')]=qs[_0x3446('0x1d')](_0x59f364[_0x3446('0x2e')][_0x3446('0x1d')]);_0x3b691e[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x59f364[_0x3446('0x2e')][_0x3446('0x1b')]);}return _0x4c4428[_0x3446('0x4a')](_0x3b691e);}})['then'](function(_0x236575){if(_0x236575){return _0x236575?{'count':_0x80da03,'rows':_0x236575}:null;}})['then'](respondWithResult(_0x4292b0,null))['catch'](handleError(_0x4292b0,null));};exports[_0x3446('0x4e')]=function(_0x49e234,_0x575294,_0x4d28ba){var _0x44f48e={};var _0xe81856={};var _0x266207;var _0x181bf6;return db[_0x3446('0x3e')][_0x3446('0x4b')]({'where':{'id':_0x49e234[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x575294,null))[_0x3446('0x25')](function(_0x1530b7){if(_0x1530b7){_0x266207=_0x1530b7;_0xe81856[_0x3446('0x32')]=_[_0x3446('0x45')](db[_0x3446('0x4c')][_0x3446('0x2b')]);_0xe81856['query']=_[_0x3446('0x45')](_0x49e234['query']);_0xe81856[_0x3446('0x2f')]=_[_0x3446('0x30')](_0xe81856[_0x3446('0x32')],_0xe81856[_0x3446('0x2e')]);_0x44f48e[_0x3446('0x31')]=_[_0x3446('0x30')](_0xe81856['model'],qs['fields'](_0x49e234['query']['fields']));_0x44f48e['attributes']=_0x44f48e[_0x3446('0x31')]['length']?_0x44f48e[_0x3446('0x31')]:_0xe81856[_0x3446('0x32')];_0x44f48e[_0x3446('0x37')]=qs['sort'](_0x49e234[_0x3446('0x2e')][_0x3446('0x38')]);_0x44f48e[_0x3446('0x39')]=qs[_0x3446('0x2f')](_[_0x3446('0x4d')](_0x49e234[_0x3446('0x2e')],_0xe81856[_0x3446('0x2f')]));if(_0x49e234[_0x3446('0x2e')]['filter']){_0x44f48e[_0x3446('0x39')]=_['merge'](_0x44f48e[_0x3446('0x39')],{'$or':_[_0x3446('0x2d')](_0x44f48e[_0x3446('0x31')],function(_0x40b721){var _0x14509c={};_0x14509c[_0x40b721]={'$like':'%'+_0x49e234[_0x3446('0x2e')][_0x3446('0x3a')]+'%'};return _0x14509c;})});}_0x44f48e=_[_0x3446('0x3b')]({},_0x44f48e,_0x49e234['options']);return _0x266207['getSubjects'](_0x44f48e);}})[_0x3446('0x25')](function(_0x5d2041){if(_0x5d2041){_0x181bf6=_0x5d2041[_0x3446('0x34')];if(!_0x49e234[_0x3446('0x2e')]['hasOwnProperty']('nolimit')){_0x44f48e[_0x3446('0x1d')]=qs[_0x3446('0x1d')](_0x49e234[_0x3446('0x2e')][_0x3446('0x1d')]);_0x44f48e[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x49e234[_0x3446('0x2e')]['offset']);}return _0x266207[_0x3446('0x4e')](_0x44f48e);}})[_0x3446('0x25')](function(_0x2d92b3){if(_0x2d92b3){return _0x2d92b3?{'count':_0x181bf6,'rows':_0x2d92b3}:null;}})[_0x3446('0x25')](respondWithResult(_0x575294,null))[_0x3446('0x43')](handleError(_0x575294,null));};exports[_0x3446('0x4f')]=function(_0x16abfb,_0x55dbf0,_0x18a733){var _0x28376a={};var _0x5e3dae={};var _0x5837ca;var _0x2e5c43;return db['Dynamics365Configuration'][_0x3446('0x4b')]({'where':{'id':_0x16abfb[_0x3446('0x49')]['id']}})[_0x3446('0x25')](handleEntityNotFound(_0x55dbf0,null))[_0x3446('0x25')](function(_0x1b9e07){if(_0x1b9e07){_0x5837ca=_0x1b9e07;_0x5e3dae['model']=_['keys'](db[_0x3446('0x4c')][_0x3446('0x2b')]);_0x5e3dae[_0x3446('0x2e')]=_[_0x3446('0x45')](_0x16abfb[_0x3446('0x2e')]);_0x5e3dae[_0x3446('0x2f')]=_[_0x3446('0x30')](_0x5e3dae[_0x3446('0x32')],_0x5e3dae[_0x3446('0x2e')]);_0x28376a[_0x3446('0x31')]=_[_0x3446('0x30')](_0x5e3dae[_0x3446('0x32')],qs[_0x3446('0x33')](_0x16abfb[_0x3446('0x2e')][_0x3446('0x33')]));_0x28376a[_0x3446('0x31')]=_0x28376a['attributes']['length']?_0x28376a[_0x3446('0x31')]:_0x5e3dae['model'];_0x28376a['order']=qs['sort'](_0x16abfb[_0x3446('0x2e')][_0x3446('0x38')]);_0x28376a[_0x3446('0x39')]=qs[_0x3446('0x2f')](_[_0x3446('0x4d')](_0x16abfb[_0x3446('0x2e')],_0x5e3dae[_0x3446('0x2f')]));if(_0x16abfb['query']['filter']){_0x28376a['where']=_['merge'](_0x28376a[_0x3446('0x39')],{'$or':_[_0x3446('0x2d')](_0x28376a['attributes'],function(_0x9ec409){var _0x9af567={};_0x9af567[_0x9ec409]={'$like':'%'+_0x16abfb[_0x3446('0x2e')][_0x3446('0x3a')]+'%'};return _0x9af567;})});}_0x28376a=_[_0x3446('0x3b')]({},_0x28376a,_0x16abfb[_0x3446('0x3d')]);return _0x5837ca[_0x3446('0x4f')](_0x28376a);}})[_0x3446('0x25')](function(_0x14d370){if(_0x14d370){_0x2e5c43=_0x14d370[_0x3446('0x34')];if(!_0x16abfb[_0x3446('0x2e')][_0x3446('0x35')](_0x3446('0x36'))){_0x28376a[_0x3446('0x1d')]=qs[_0x3446('0x1d')](_0x16abfb[_0x3446('0x2e')][_0x3446('0x1d')]);_0x28376a[_0x3446('0x1b')]=qs[_0x3446('0x1b')](_0x16abfb['query'][_0x3446('0x1b')]);}return _0x5837ca[_0x3446('0x4f')](_0x28376a);}})[_0x3446('0x25')](function(_0x39b0c5){if(_0x39b0c5){return _0x39b0c5?{'count':_0x2e5c43,'rows':_0x39b0c5}:null;}})['then'](respondWithResult(_0x55dbf0,null))['catch'](handleError(_0x55dbf0,null));}; \ No newline at end of file +var _0x2978=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','create','body','update','Dynamics365Field','pick','getFields','findOne','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x189f19,_0x1b0c2c){var _0x5ecd63=function(_0x14e406){while(--_0x14e406){_0x189f19['push'](_0x189f19['shift']());}};_0x5ecd63(++_0x1b0c2c);}(_0x2978,0x152));var _0x8297=function(_0x1fc3fd,_0x2c74f6){_0x1fc3fd=_0x1fc3fd-0x0;var _0x3a9727=_0x2978[_0x1fc3fd];return _0x3a9727;};'use strict';var emlformat=require(_0x8297('0x0'));var rimraf=require(_0x8297('0x1'));var zipdir=require(_0x8297('0x2'));var jsonpatch=require(_0x8297('0x3'));var rp=require(_0x8297('0x4'));var moment=require(_0x8297('0x5'));var BPromise=require(_0x8297('0x6'));var Mustache=require(_0x8297('0x7'));var util=require(_0x8297('0x8'));var path=require(_0x8297('0x9'));var sox=require(_0x8297('0xa'));var csv=require('to-csv');var ejs=require(_0x8297('0xb'));var fs=require('fs');var fs_extra=require(_0x8297('0xc'));var _=require(_0x8297('0xd'));var squel=require(_0x8297('0xe'));var crypto=require(_0x8297('0xf'));var jsforce=require(_0x8297('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8297('0x11'));var querystring=require(_0x8297('0x12'));var Papa=require(_0x8297('0x13'));var Redis=require(_0x8297('0x14'));var authService=require(_0x8297('0x15'));var qs=require(_0x8297('0x16'));var as=require(_0x8297('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8297('0x18'))(_0x8297('0x19'));var utils=require(_0x8297('0x1a'));var config=require(_0x8297('0x1b'));var licenseUtil=require(_0x8297('0x1c'));var db=require(_0x8297('0x1d'))['db'];function respondWithStatusCode(_0x56d3ae,_0x3af227){_0x3af227=_0x3af227||0xcc;return function(_0x5f4af4){if(_0x5f4af4){return _0x56d3ae['sendStatus'](_0x3af227);}return _0x56d3ae[_0x8297('0x1e')](_0x3af227)[_0x8297('0x1f')]();};}function respondWithResult(_0x2a2a30,_0x3c5b15){_0x3c5b15=_0x3c5b15||0xc8;return function(_0xafb2f0){if(_0xafb2f0){return _0x2a2a30[_0x8297('0x1e')](_0x3c5b15)[_0x8297('0x20')](_0xafb2f0);}};}function respondWithFilteredResult(_0x1a7c68,_0x2f5092){return function(_0x4ef6bf){if(_0x4ef6bf){var _0x320b3a=typeof _0x2f5092[_0x8297('0x21')]==='undefined'&&typeof _0x2f5092[_0x8297('0x22')]===_0x8297('0x23');var _0x3777ce=_0x4ef6bf[_0x8297('0x24')];var _0x101ee2=_0x320b3a?0x0:_0x2f5092['offset'];var _0x290b93=_0x320b3a?_0x4ef6bf[_0x8297('0x24')]:_0x2f5092[_0x8297('0x21')]+_0x2f5092[_0x8297('0x22')];var _0x771727;if(_0x290b93>=_0x3777ce){_0x290b93=_0x3777ce;_0x771727=0xc8;}else{_0x771727=0xce;}_0x1a7c68[_0x8297('0x1e')](_0x771727);return _0x1a7c68['set'](_0x8297('0x25'),_0x101ee2+'-'+_0x290b93+'/'+_0x3777ce)[_0x8297('0x20')](_0x4ef6bf);}return null;};}function patchUpdates(_0x472211){return function(_0x540fd){try{jsonpatch[_0x8297('0x26')](_0x540fd,_0x472211,!![]);}catch(_0x44b400){return BPromise[_0x8297('0x27')](_0x44b400);}return _0x540fd[_0x8297('0x28')]();};}function saveUpdates(_0x522f44,_0x4a3955){return function(_0xed0e07){if(_0xed0e07){return _0xed0e07['update'](_0x522f44)[_0x8297('0x29')](function(_0x3890b){return _0x3890b;});}return null;};}function removeEntity(_0xa7574f,_0x51a021){return function(_0x24ed68){if(_0x24ed68){return _0x24ed68[_0x8297('0x2a')]()[_0x8297('0x29')](function(){_0xa7574f[_0x8297('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d794,_0x231388){return function(_0x377fdf){if(!_0x377fdf){_0x42d794[_0x8297('0x2b')](0x194);}return _0x377fdf;};}function handleError(_0x7730fc,_0x5cd7d3){_0x5cd7d3=_0x5cd7d3||0x1f4;return function(_0x2473b8){logger[_0x8297('0x2c')](_0x2473b8[_0x8297('0x2d')]);if(_0x2473b8[_0x8297('0x2e')]){delete _0x2473b8['name'];}_0x7730fc[_0x8297('0x1e')](_0x5cd7d3)[_0x8297('0x2f')](_0x2473b8);};}exports[_0x8297('0x30')]=function(_0xf5efe1,_0x463308){var _0x250dc7={},_0x490eb5={},_0x506089={'count':0x0,'rows':[]};var _0x42fe42=_['map'](db[_0x8297('0x31')][_0x8297('0x32')],function(_0x2fc129){return{'name':_0x2fc129['fieldName'],'type':_0x2fc129[_0x8297('0x33')][_0x8297('0x34')]};});_0x490eb5[_0x8297('0x35')]=_['map'](_0x42fe42,_0x8297('0x2e'));_0x490eb5[_0x8297('0x36')]=_[_0x8297('0x37')](_0xf5efe1['query']);_0x490eb5['filters']=_[_0x8297('0x38')](_0x490eb5[_0x8297('0x35')],_0x490eb5[_0x8297('0x36')]);_0x250dc7['attributes']=_['intersection'](_0x490eb5[_0x8297('0x35')],qs[_0x8297('0x39')](_0xf5efe1[_0x8297('0x36')]['fields']));_0x250dc7['attributes']=_0x250dc7['attributes']['length']?_0x250dc7[_0x8297('0x3a')]:_0x490eb5[_0x8297('0x35')];if(!_0xf5efe1['query']['hasOwnProperty'](_0x8297('0x3b'))){_0x250dc7[_0x8297('0x22')]=qs[_0x8297('0x22')](_0xf5efe1[_0x8297('0x36')][_0x8297('0x22')]);_0x250dc7[_0x8297('0x21')]=qs[_0x8297('0x21')](_0xf5efe1[_0x8297('0x36')][_0x8297('0x21')]);}_0x250dc7[_0x8297('0x3c')]=qs[_0x8297('0x3d')](_0xf5efe1[_0x8297('0x36')]['sort']);_0x250dc7[_0x8297('0x3e')]=qs['filters'](_['pick'](_0xf5efe1[_0x8297('0x36')],_0x490eb5[_0x8297('0x3f')]),_0x42fe42);if(_0xf5efe1[_0x8297('0x36')][_0x8297('0x40')]){_0x250dc7[_0x8297('0x3e')]=_[_0x8297('0x41')](_0x250dc7[_0x8297('0x3e')],{'$or':_[_0x8297('0x42')](_0x42fe42,function(_0x4a8c29){if(_0x4a8c29[_0x8297('0x33')]!==_0x8297('0x43')){var _0x217037={};_0x217037[_0x4a8c29[_0x8297('0x2e')]]={'$like':'%'+_0xf5efe1[_0x8297('0x36')]['filter']+'%'};return _0x217037;}})});}_0x250dc7=_[_0x8297('0x41')]({},_0x250dc7,_0xf5efe1['options']);var _0x510a40={'where':_0x250dc7['where']};return db[_0x8297('0x31')][_0x8297('0x24')](_0x510a40)[_0x8297('0x29')](function(_0x562546){_0x506089[_0x8297('0x24')]=_0x562546;if(_0xf5efe1[_0x8297('0x36')][_0x8297('0x44')]){_0x250dc7[_0x8297('0x45')]=[{'all':!![]}];}return db[_0x8297('0x31')]['findAll'](_0x250dc7);})[_0x8297('0x29')](function(_0x3de34){_0x506089[_0x8297('0x46')]=_0x3de34;return _0x506089;})[_0x8297('0x29')](respondWithFilteredResult(_0x463308,_0x250dc7))[_0x8297('0x47')](handleError(_0x463308,null));};exports[_0x8297('0x48')]=function(_0xdafbec,_0xe31d05){var _0x3d9562={'raw':![],'where':{'id':_0xdafbec[_0x8297('0x49')]['id']}},_0x149e98={};_0x149e98[_0x8297('0x35')]=_[_0x8297('0x37')](db[_0x8297('0x31')][_0x8297('0x32')]);_0x149e98['query']=_[_0x8297('0x37')](_0xdafbec[_0x8297('0x36')]);_0x149e98[_0x8297('0x3f')]=_['intersection'](_0x149e98[_0x8297('0x35')],_0x149e98[_0x8297('0x36')]);_0x3d9562[_0x8297('0x3a')]=_[_0x8297('0x38')](_0x149e98[_0x8297('0x35')],qs[_0x8297('0x39')](_0xdafbec['query']['fields']));_0x3d9562['attributes']=_0x3d9562['attributes'][_0x8297('0x4a')]?_0x3d9562[_0x8297('0x3a')]:_0x149e98[_0x8297('0x35')];if(_0xdafbec[_0x8297('0x36')][_0x8297('0x44')]){_0x3d9562[_0x8297('0x45')]=[{'all':!![]}];}_0x3d9562=_['merge']({},_0x3d9562,_0xdafbec[_0x8297('0x4b')]);return db['Dynamics365Configuration'][_0x8297('0x4c')](_0x3d9562)[_0x8297('0x29')](handleEntityNotFound(_0xe31d05,null))['then'](respondWithResult(_0xe31d05,null))[_0x8297('0x47')](handleError(_0xe31d05,null));};exports[_0x8297('0x4d')]=function(_0x181147,_0x418ba3){return db[_0x8297('0x31')]['create'](_0x181147[_0x8297('0x4e')],{})[_0x8297('0x29')](respondWithResult(_0x418ba3,0xc9))[_0x8297('0x47')](handleError(_0x418ba3,null));};exports[_0x8297('0x4f')]=function(_0x40f2ff,_0xa25154){if(_0x40f2ff[_0x8297('0x4e')]['id']){delete _0x40f2ff[_0x8297('0x4e')]['id'];}return db[_0x8297('0x31')][_0x8297('0x4c')]({'where':{'id':_0x40f2ff[_0x8297('0x49')]['id']}})[_0x8297('0x29')](handleEntityNotFound(_0xa25154,null))[_0x8297('0x29')](saveUpdates(_0x40f2ff[_0x8297('0x4e')],null))['then'](respondWithResult(_0xa25154,null))[_0x8297('0x47')](handleError(_0xa25154,null));};exports['destroy']=function(_0x38d067,_0x12ed7a){return db['Dynamics365Configuration'][_0x8297('0x4c')]({'where':{'id':_0x38d067[_0x8297('0x49')]['id']}})[_0x8297('0x29')](handleEntityNotFound(_0x12ed7a,null))[_0x8297('0x29')](removeEntity(_0x12ed7a,null))[_0x8297('0x47')](handleError(_0x12ed7a,null));};exports['getFields']=function(_0x45863b,_0x2edf6d,_0x1d9435){var _0x5298cb={};var _0x243996={};var _0xd76f5c;var _0x3d71a5;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x45863b[_0x8297('0x49')]['id']}})[_0x8297('0x29')](handleEntityNotFound(_0x2edf6d,null))[_0x8297('0x29')](function(_0x4a8ad7){if(_0x4a8ad7){_0xd76f5c=_0x4a8ad7;_0x243996[_0x8297('0x35')]=_['keys'](db[_0x8297('0x50')][_0x8297('0x32')]);_0x243996['query']=_[_0x8297('0x37')](_0x45863b['query']);_0x243996[_0x8297('0x3f')]=_[_0x8297('0x38')](_0x243996[_0x8297('0x35')],_0x243996['query']);_0x5298cb[_0x8297('0x3a')]=_[_0x8297('0x38')](_0x243996[_0x8297('0x35')],qs[_0x8297('0x39')](_0x45863b[_0x8297('0x36')][_0x8297('0x39')]));_0x5298cb['attributes']=_0x5298cb[_0x8297('0x3a')][_0x8297('0x4a')]?_0x5298cb[_0x8297('0x3a')]:_0x243996['model'];_0x5298cb[_0x8297('0x3c')]=qs['sort'](_0x45863b[_0x8297('0x36')]['sort']);_0x5298cb[_0x8297('0x3e')]=qs[_0x8297('0x3f')](_[_0x8297('0x51')](_0x45863b[_0x8297('0x36')],_0x243996[_0x8297('0x3f')]));if(_0x45863b[_0x8297('0x36')][_0x8297('0x40')]){_0x5298cb['where']=_[_0x8297('0x41')](_0x5298cb[_0x8297('0x3e')],{'$or':_['map'](_0x5298cb[_0x8297('0x3a')],function(_0x132669){var _0x2d4761={};_0x2d4761[_0x132669]={'$like':'%'+_0x45863b[_0x8297('0x36')][_0x8297('0x40')]+'%'};return _0x2d4761;})});}_0x5298cb=_['merge']({},_0x5298cb,_0x45863b[_0x8297('0x4b')]);return _0xd76f5c[_0x8297('0x52')](_0x5298cb);}})[_0x8297('0x29')](function(_0x528441){if(_0x528441){_0x3d71a5=_0x528441['length'];if(!_0x45863b[_0x8297('0x36')]['hasOwnProperty'](_0x8297('0x3b'))){_0x5298cb['limit']=qs[_0x8297('0x22')](_0x45863b[_0x8297('0x36')][_0x8297('0x22')]);_0x5298cb['offset']=qs[_0x8297('0x21')](_0x45863b[_0x8297('0x36')][_0x8297('0x21')]);}return _0xd76f5c['getFields'](_0x5298cb);}})[_0x8297('0x29')](function(_0x408290){if(_0x408290){return _0x408290?{'count':_0x3d71a5,'rows':_0x408290}:null;}})['then'](respondWithResult(_0x2edf6d,null))[_0x8297('0x47')](handleError(_0x2edf6d,null));};exports['getSubjects']=function(_0x3ecadd,_0x5aa187,_0x5086b5){var _0x16b678={};var _0x6d4ae5={};var _0xecc286;var _0x85bcc;return db[_0x8297('0x31')][_0x8297('0x53')]({'where':{'id':_0x3ecadd[_0x8297('0x49')]['id']}})[_0x8297('0x29')](handleEntityNotFound(_0x5aa187,null))[_0x8297('0x29')](function(_0x528d58){if(_0x528d58){_0xecc286=_0x528d58;_0x6d4ae5[_0x8297('0x35')]=_[_0x8297('0x37')](db[_0x8297('0x50')][_0x8297('0x32')]);_0x6d4ae5[_0x8297('0x36')]=_[_0x8297('0x37')](_0x3ecadd[_0x8297('0x36')]);_0x6d4ae5['filters']=_[_0x8297('0x38')](_0x6d4ae5[_0x8297('0x35')],_0x6d4ae5[_0x8297('0x36')]);_0x16b678[_0x8297('0x3a')]=_[_0x8297('0x38')](_0x6d4ae5[_0x8297('0x35')],qs['fields'](_0x3ecadd[_0x8297('0x36')][_0x8297('0x39')]));_0x16b678['attributes']=_0x16b678[_0x8297('0x3a')]['length']?_0x16b678[_0x8297('0x3a')]:_0x6d4ae5[_0x8297('0x35')];_0x16b678[_0x8297('0x3c')]=qs[_0x8297('0x3d')](_0x3ecadd[_0x8297('0x36')][_0x8297('0x3d')]);_0x16b678['where']=qs[_0x8297('0x3f')](_[_0x8297('0x51')](_0x3ecadd['query'],_0x6d4ae5['filters']));if(_0x3ecadd['query'][_0x8297('0x40')]){_0x16b678[_0x8297('0x3e')]=_[_0x8297('0x41')](_0x16b678[_0x8297('0x3e')],{'$or':_[_0x8297('0x42')](_0x16b678['attributes'],function(_0xba093e){var _0x4340b2={};_0x4340b2[_0xba093e]={'$like':'%'+_0x3ecadd[_0x8297('0x36')][_0x8297('0x40')]+'%'};return _0x4340b2;})});}_0x16b678=_['merge']({},_0x16b678,_0x3ecadd[_0x8297('0x4b')]);return _0xecc286['getSubjects'](_0x16b678);}})[_0x8297('0x29')](function(_0x552e39){if(_0x552e39){_0x85bcc=_0x552e39['length'];if(!_0x3ecadd[_0x8297('0x36')][_0x8297('0x54')](_0x8297('0x3b'))){_0x16b678[_0x8297('0x22')]=qs[_0x8297('0x22')](_0x3ecadd[_0x8297('0x36')][_0x8297('0x22')]);_0x16b678[_0x8297('0x21')]=qs[_0x8297('0x21')](_0x3ecadd[_0x8297('0x36')][_0x8297('0x21')]);}return _0xecc286['getSubjects'](_0x16b678);}})['then'](function(_0x67084b){if(_0x67084b){return _0x67084b?{'count':_0x85bcc,'rows':_0x67084b}:null;}})['then'](respondWithResult(_0x5aa187,null))['catch'](handleError(_0x5aa187,null));};exports[_0x8297('0x55')]=function(_0x3b5309,_0x577854,_0x307f6b){var _0x523772={};var _0x15e27f={};var _0x22e0e8;var _0x955389;return db[_0x8297('0x31')][_0x8297('0x53')]({'where':{'id':_0x3b5309[_0x8297('0x49')]['id']}})[_0x8297('0x29')](handleEntityNotFound(_0x577854,null))[_0x8297('0x29')](function(_0x2019c6){if(_0x2019c6){_0x22e0e8=_0x2019c6;_0x15e27f[_0x8297('0x35')]=_[_0x8297('0x37')](db[_0x8297('0x50')][_0x8297('0x32')]);_0x15e27f[_0x8297('0x36')]=_[_0x8297('0x37')](_0x3b5309[_0x8297('0x36')]);_0x15e27f[_0x8297('0x3f')]=_[_0x8297('0x38')](_0x15e27f[_0x8297('0x35')],_0x15e27f['query']);_0x523772[_0x8297('0x3a')]=_[_0x8297('0x38')](_0x15e27f['model'],qs[_0x8297('0x39')](_0x3b5309[_0x8297('0x36')][_0x8297('0x39')]));_0x523772[_0x8297('0x3a')]=_0x523772[_0x8297('0x3a')][_0x8297('0x4a')]?_0x523772[_0x8297('0x3a')]:_0x15e27f[_0x8297('0x35')];_0x523772[_0x8297('0x3c')]=qs['sort'](_0x3b5309[_0x8297('0x36')][_0x8297('0x3d')]);_0x523772['where']=qs[_0x8297('0x3f')](_['pick'](_0x3b5309[_0x8297('0x36')],_0x15e27f[_0x8297('0x3f')]));if(_0x3b5309['query'][_0x8297('0x40')]){_0x523772[_0x8297('0x3e')]=_[_0x8297('0x41')](_0x523772[_0x8297('0x3e')],{'$or':_[_0x8297('0x42')](_0x523772[_0x8297('0x3a')],function(_0x23742e){var _0x2d3cde={};_0x2d3cde[_0x23742e]={'$like':'%'+_0x3b5309[_0x8297('0x36')][_0x8297('0x40')]+'%'};return _0x2d3cde;})});}_0x523772=_[_0x8297('0x41')]({},_0x523772,_0x3b5309[_0x8297('0x4b')]);return _0x22e0e8[_0x8297('0x55')](_0x523772);}})[_0x8297('0x29')](function(_0x5eebec){if(_0x5eebec){_0x955389=_0x5eebec[_0x8297('0x4a')];if(!_0x3b5309[_0x8297('0x36')][_0x8297('0x54')]('nolimit')){_0x523772['limit']=qs['limit'](_0x3b5309[_0x8297('0x36')][_0x8297('0x22')]);_0x523772[_0x8297('0x21')]=qs[_0x8297('0x21')](_0x3b5309[_0x8297('0x36')][_0x8297('0x21')]);}return _0x22e0e8[_0x8297('0x55')](_0x523772);}})[_0x8297('0x29')](function(_0x3ced15){if(_0x3ced15){return _0x3ced15?{'count':_0x955389,'rows':_0x3ced15}:null;}})[_0x8297('0x29')](respondWithResult(_0x577854,null))[_0x8297('0x47')](handleError(_0x577854,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1557966..8baa8b6 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x467929,_0x3fd971){var _0x1b28c1=function(_0x247f6f){while(--_0x247f6f){_0x467929['push'](_0x467929['shift']());}};_0x1b28c1(++_0x3fd971);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3088f1,_0x5076fd){_0x3088f1=_0x3088f1-0x0;var _0x19e1f3=_0x9bde[_0x3088f1];return _0x19e1f3;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5755d2,_0x5a33c4){var _0x4d3de6=function(_0x4e454d){while(--_0x4e454d){_0x5755d2['push'](_0x5755d2['shift']());}};_0x4d3de6(++_0x5a33c4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0xf3cd[_0x59dccc];return _0xc97bcb;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 1ee8211..dbc9463 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 _0xd8b7=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xd8b7,0xb8));var _0x7d8b=function(_0x2005c6,_0x2d4763){_0x2005c6=_0x2005c6-0x0;var _0x187368=_0xd8b7[_0x2005c6];return _0x187368;};'use strict';var _=require(_0x7d8b('0x0'));var util=require(_0x7d8b('0x1'));var moment=require(_0x7d8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d8b('0x3'));var fs=require('fs');var Redis=require(_0x7d8b('0x4'));var db=require(_0x7d8b('0x5'))['db'];var utils=require(_0x7d8b('0x6'));var logger=require(_0x7d8b('0x7'))(_0x7d8b('0x8'));var config=require(_0x7d8b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7d8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c7906,_0x1b63bd,_0x4b83c8){return new BPromise(function(_0x312f2e,_0x4e21f5){return client['request'](_0x2c7906,_0x4b83c8)['then'](function(_0x54f2ee){logger[_0x7d8b('0xb')](_0x7d8b('0xc'),_0x1b63bd,_0x7d8b('0xd'));logger['debug'](_0x7d8b('0xe'),_0x1b63bd,_0x7d8b('0xd'),JSON[_0x7d8b('0xf')](_0x54f2ee));if(_0x54f2ee[_0x7d8b('0x10')]){if(_0x54f2ee[_0x7d8b('0x10')][_0x7d8b('0x11')]===0x1f4){logger[_0x7d8b('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b63bd,_0x54f2ee['error'][_0x7d8b('0x12')]);return _0x4e21f5(_0x54f2ee[_0x7d8b('0x10')][_0x7d8b('0x12')]);}logger[_0x7d8b('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b63bd,_0x54f2ee[_0x7d8b('0x10')][_0x7d8b('0x12')]);return _0x312f2e(_0x54f2ee['error'][_0x7d8b('0x12')]);}else{logger['info'](_0x7d8b('0xc'),_0x1b63bd,'request\x20sent');_0x312f2e(_0x54f2ee[_0x7d8b('0x13')][_0x7d8b('0x12')]);}})['catch'](function(_0x218479){logger[_0x7d8b('0x10')](_0x7d8b('0xc'),_0x1b63bd,_0x218479);_0x4e21f5(_0x218479);});});} \ No newline at end of file +var _0xbbdc=['ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xbbdc,0x81));var _0xcbbd=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xbbdc[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xcbbd('0x0'));var util=require(_0xcbbd('0x1'));var moment=require('moment');var BPromise=require(_0xcbbd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbbd('0x3'));var db=require(_0xcbbd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcbbd('0x5'));var jayson=require(_0xcbbd('0x6'));var client=jayson[_0xcbbd('0x7')][_0xcbbd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c66b7,_0x41b39b,_0x5a1eef){return new BPromise(function(_0x44206d,_0x3e0bd0){return client[_0xcbbd('0x9')](_0x1c66b7,_0x5a1eef)[_0xcbbd('0xa')](function(_0x52f262){logger[_0xcbbd('0xb')](_0xcbbd('0xc'),_0x41b39b,_0xcbbd('0xd'));logger[_0xcbbd('0xe')](_0xcbbd('0xf'),_0x41b39b,_0xcbbd('0xd'),JSON[_0xcbbd('0x10')](_0x52f262));if(_0x52f262[_0xcbbd('0x11')]){if(_0x52f262[_0xcbbd('0x11')][_0xcbbd('0x12')]===0x1f4){logger[_0xcbbd('0x11')](_0xcbbd('0xc'),_0x41b39b,_0x52f262['error']['message']);return _0x3e0bd0(_0x52f262['error'][_0xcbbd('0x13')]);}logger[_0xcbbd('0x11')](_0xcbbd('0xc'),_0x41b39b,_0x52f262[_0xcbbd('0x11')]['message']);return _0x44206d(_0x52f262['error']['message']);}else{logger[_0xcbbd('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x41b39b,_0xcbbd('0xd'));_0x44206d(_0x52f262[_0xcbbd('0x14')][_0xcbbd('0x13')]);}})[_0xcbbd('0x15')](function(_0xbd88f6){logger[_0xcbbd('0x11')](_0xcbbd('0xc'),_0x41b39b,_0xbd88f6);_0x3e0bd0(_0xbd88f6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 77cb5c3..7a1e380 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 _0x1c26=['../../config/environment','./intDynamics365Field.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53b72c,_0x33f3ec){var _0x43ecec=function(_0x7de2c5){while(--_0x7de2c5){_0x53b72c['push'](_0x53b72c['shift']());}};_0x43ecec(++_0x33f3ec);}(_0x1c26,0x1db));var _0x61c2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1c26[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x61c2('0x0'));var util=require(_0x61c2('0x1'));var path=require(_0x61c2('0x2'));var timeout=require(_0x61c2('0x3'));var express=require('express');var router=express[_0x61c2('0x4')]();var fs_extra=require(_0x61c2('0x5'));var auth=require(_0x61c2('0x6'));var interaction=require(_0x61c2('0x7'));var config=require(_0x61c2('0x8'));var controller=require(_0x61c2('0x9'));router['get']('/',auth[_0x61c2('0xa')](),controller['index']);router[_0x61c2('0xb')](_0x61c2('0xc'),auth[_0x61c2('0xa')](),controller[_0x61c2('0xd')]);router[_0x61c2('0xe')]('/',auth['isAuthenticated'](),controller[_0x61c2('0xf')]);router[_0x61c2('0x10')](_0x61c2('0xc'),auth['isAuthenticated'](),controller[_0x61c2('0x11')]);router[_0x61c2('0x12')](_0x61c2('0xc'),auth[_0x61c2('0xa')](),controller[_0x61c2('0x13')]);module[_0x61c2('0x14')]=router; \ No newline at end of file +var _0xc9ae=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','update','delete'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0xc9ae,0xf2));var _0xec9a=function(_0x2e3fb6,_0x587302){_0x2e3fb6=_0x2e3fb6-0x0;var _0x5cea59=_0xc9ae[_0x2e3fb6];return _0x5cea59;};'use strict';var multer=require(_0xec9a('0x0'));var util=require('util');var path=require(_0xec9a('0x1'));var timeout=require(_0xec9a('0x2'));var express=require(_0xec9a('0x3'));var router=express[_0xec9a('0x4')]();var fs_extra=require(_0xec9a('0x5'));var auth=require(_0xec9a('0x6'));var interaction=require(_0xec9a('0x7'));var config=require(_0xec9a('0x8'));var controller=require(_0xec9a('0x9'));router[_0xec9a('0xa')]('/',auth[_0xec9a('0xb')](),controller[_0xec9a('0xc')]);router['get'](_0xec9a('0xd'),auth[_0xec9a('0xb')](),controller[_0xec9a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xec9a('0xf')]);router['put'](_0xec9a('0xd'),auth[_0xec9a('0xb')](),controller[_0xec9a('0x10')]);router[_0xec9a('0x11')](_0xec9a('0xd'),auth[_0xec9a('0xb')](),controller[_0xec9a('0x12')]);module[_0xec9a('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 c3eae01..884974c 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 _0x29fb=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x7d3dfe,_0x2094dc){var _0x59ae2f=function(_0x35827b){while(--_0x35827b){_0x7d3dfe['push'](_0x7d3dfe['shift']());}};_0x59ae2f(++_0x2094dc);}(_0x29fb,0x18c));var _0xb29f=function(_0x2e2755,_0xd67d7c){_0x2e2755=_0x2e2755-0x0;var _0x2afe37=_0x29fb[_0x2e2755];return _0x2afe37;};'use strict';var Sequelize=require(_0xb29f('0x0'));module['exports']={'type':{'type':Sequelize[_0xb29f('0x1')](_0xb29f('0x2'),_0xb29f('0x3'),_0xb29f('0x4'),_0xb29f('0x5'),_0xb29f('0x6')),'defaultValue':_0xb29f('0x2')},'content':{'type':Sequelize[_0xb29f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb29f('0x1')](_0xb29f('0x2'),'variable',_0xb29f('0x4'))},'keyContent':{'type':Sequelize[_0xb29f('0x7')]},'idField':{'type':Sequelize[_0xb29f('0x7')]},'nameField':{'type':Sequelize[_0xb29f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb29f('0x7')]}}; \ No newline at end of file +var _0xc7fa=['customVariable','picklist','string','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x2794e4,_0x11bcf6){var _0xf860d4=function(_0x1ef56e){while(--_0x1ef56e){_0x2794e4['push'](_0x2794e4['shift']());}};_0xf860d4(++_0x11bcf6);}(_0xc7fa,0xcd));var _0xac7f=function(_0x2ec8b0,_0x112dc9){_0x2ec8b0=_0x2ec8b0-0x0;var _0x207302=_0xc7fa[_0x2ec8b0];return _0x207302;};'use strict';var Sequelize=require(_0xac7f('0x0'));module[_0xac7f('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xac7f('0x2'),'keyValue',_0xac7f('0x3')),'defaultValue':_0xac7f('0x4')},'content':{'type':Sequelize[_0xac7f('0x5')]},'key':{'type':Sequelize[_0xac7f('0x5')]},'keyType':{'type':Sequelize[_0xac7f('0x6')](_0xac7f('0x4'),_0xac7f('0x7'),_0xac7f('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xac7f('0x5')]},'nameField':{'type':Sequelize[_0xac7f('0x5')]},'customField':{'type':Sequelize[_0xac7f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xac7f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0e490cc..c7e634e 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 _0x9403=['Dynamics365Field','fieldName','key','model','query','keys','attributes','intersection','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','fields','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','map'];(function(_0x505088,_0x23a321){var _0x3eb2c9=function(_0x2fcf8d){while(--_0x2fcf8d){_0x505088['push'](_0x505088['shift']());}};_0x3eb2c9(++_0x23a321);}(_0x9403,0xa6));var _0x3940=function(_0x16f8aa,_0x4a0b8b){_0x16f8aa=_0x16f8aa-0x0;var _0x39fd18=_0x9403[_0x16f8aa];return _0x39fd18;};'use strict';var emlformat=require(_0x3940('0x0'));var rimraf=require(_0x3940('0x1'));var zipdir=require(_0x3940('0x2'));var jsonpatch=require(_0x3940('0x3'));var rp=require(_0x3940('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3940('0x5'));var util=require(_0x3940('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(_0x3940('0x7'));var _=require(_0x3940('0x8'));var squel=require(_0x3940('0x9'));var crypto=require('crypto');var jsforce=require(_0x3940('0xa'));var deskjs=require(_0x3940('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3940('0xc'));var Papa=require(_0x3940('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3940('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3940('0xf'))(_0x3940('0x10'));var utils=require(_0x3940('0x11'));var config=require(_0x3940('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3940('0x13'))['db'];function respondWithStatusCode(_0x261892,_0x2f2973){_0x2f2973=_0x2f2973||0xcc;return function(_0x9af07d){if(_0x9af07d){return _0x261892[_0x3940('0x14')](_0x2f2973);}return _0x261892[_0x3940('0x15')](_0x2f2973)[_0x3940('0x16')]();};}function respondWithResult(_0x17f9cf,_0x38ac8a){_0x38ac8a=_0x38ac8a||0xc8;return function(_0x1d4d6d){if(_0x1d4d6d){return _0x17f9cf[_0x3940('0x15')](_0x38ac8a)['json'](_0x1d4d6d);}};}function respondWithFilteredResult(_0x1ec898,_0x217da8){return function(_0x20daf2){if(_0x20daf2){var _0xa33250=typeof _0x217da8[_0x3940('0x17')]==='undefined'&&typeof _0x217da8[_0x3940('0x18')]===_0x3940('0x19');var _0x3cae8f=_0x20daf2[_0x3940('0x1a')];var _0x3cf645=_0xa33250?0x0:_0x217da8['offset'];var _0x4757db=_0xa33250?_0x20daf2[_0x3940('0x1a')]:_0x217da8[_0x3940('0x17')]+_0x217da8[_0x3940('0x18')];var _0x28ac63;if(_0x4757db>=_0x3cae8f){_0x4757db=_0x3cae8f;_0x28ac63=0xc8;}else{_0x28ac63=0xce;}_0x1ec898['status'](_0x28ac63);return _0x1ec898['set'](_0x3940('0x1b'),_0x3cf645+'-'+_0x4757db+'/'+_0x3cae8f)['json'](_0x20daf2);}return null;};}function patchUpdates(_0xed9854){return function(_0x56c5de){try{jsonpatch[_0x3940('0x1c')](_0x56c5de,_0xed9854,!![]);}catch(_0xd4a32e){return BPromise['reject'](_0xd4a32e);}return _0x56c5de[_0x3940('0x1d')]();};}function saveUpdates(_0x5506c2,_0x42b5e1){return function(_0x2479f4){if(_0x2479f4){return _0x2479f4[_0x3940('0x1e')](_0x5506c2)[_0x3940('0x1f')](function(_0x1f5ce7){return _0x1f5ce7;});}return null;};}function removeEntity(_0xe3d3b0,_0x40c7c9){return function(_0xf555c0){if(_0xf555c0){return _0xf555c0[_0x3940('0x20')]()['then'](function(){_0xe3d3b0[_0x3940('0x15')](0xcc)[_0x3940('0x16')]();});}};}function handleEntityNotFound(_0x45f571,_0x5152d2){return function(_0x53a91f){if(!_0x53a91f){_0x45f571[_0x3940('0x14')](0x194);}return _0x53a91f;};}function handleError(_0x1a27bd,_0x1dc3bf){_0x1dc3bf=_0x1dc3bf||0x1f4;return function(_0x44f2e5){logger[_0x3940('0x21')](_0x44f2e5['stack']);if(_0x44f2e5['name']){delete _0x44f2e5[_0x3940('0x22')];}_0x1a27bd[_0x3940('0x15')](_0x1dc3bf)[_0x3940('0x23')](_0x44f2e5);};}exports[_0x3940('0x24')]=function(_0x5600bc,_0x2a638f){var _0x26eb13={},_0x2ac754={},_0x1a32aa={'count':0x0,'rows':[]};var _0x3f67e9=_[_0x3940('0x25')](db[_0x3940('0x26')]['rawAttributes'],function(_0x1bdb78){return{'name':_0x1bdb78[_0x3940('0x27')],'type':_0x1bdb78['type'][_0x3940('0x28')]};});_0x2ac754[_0x3940('0x29')]=_[_0x3940('0x25')](_0x3f67e9,_0x3940('0x22'));_0x2ac754[_0x3940('0x2a')]=_[_0x3940('0x2b')](_0x5600bc[_0x3940('0x2a')]);_0x2ac754['filters']=_['intersection'](_0x2ac754[_0x3940('0x29')],_0x2ac754[_0x3940('0x2a')]);_0x26eb13[_0x3940('0x2c')]=_[_0x3940('0x2d')](_0x2ac754[_0x3940('0x29')],qs['fields'](_0x5600bc[_0x3940('0x2a')]['fields']));_0x26eb13[_0x3940('0x2c')]=_0x26eb13[_0x3940('0x2c')][_0x3940('0x2e')]?_0x26eb13[_0x3940('0x2c')]:_0x2ac754['model'];if(!_0x5600bc[_0x3940('0x2a')]['hasOwnProperty'](_0x3940('0x2f'))){_0x26eb13[_0x3940('0x18')]=qs[_0x3940('0x18')](_0x5600bc[_0x3940('0x2a')][_0x3940('0x18')]);_0x26eb13['offset']=qs['offset'](_0x5600bc[_0x3940('0x2a')]['offset']);}_0x26eb13['order']=qs[_0x3940('0x30')](_0x5600bc[_0x3940('0x2a')][_0x3940('0x30')]);_0x26eb13[_0x3940('0x31')]=qs[_0x3940('0x32')](_[_0x3940('0x33')](_0x5600bc[_0x3940('0x2a')],_0x2ac754[_0x3940('0x32')]),_0x3f67e9);if(_0x5600bc['query'][_0x3940('0x34')]){_0x26eb13['where']=_[_0x3940('0x35')](_0x26eb13['where'],{'$or':_['map'](_0x3f67e9,function(_0x2ab0ba){if(_0x2ab0ba[_0x3940('0x36')]!==_0x3940('0x37')){var _0x7bfa8c={};_0x7bfa8c[_0x2ab0ba[_0x3940('0x22')]]={'$like':'%'+_0x5600bc[_0x3940('0x2a')][_0x3940('0x34')]+'%'};return _0x7bfa8c;}})});}_0x26eb13=_[_0x3940('0x35')]({},_0x26eb13,_0x5600bc[_0x3940('0x38')]);var _0x2d6fc0={'where':_0x26eb13['where']};return db['Dynamics365Field'][_0x3940('0x1a')](_0x2d6fc0)['then'](function(_0x46c53d){_0x1a32aa['count']=_0x46c53d;if(_0x5600bc[_0x3940('0x2a')][_0x3940('0x39')]){_0x26eb13['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x3940('0x3a')](_0x26eb13);})['then'](function(_0x5d02e0){_0x1a32aa[_0x3940('0x3b')]=_0x5d02e0;return _0x1a32aa;})[_0x3940('0x1f')](respondWithFilteredResult(_0x2a638f,_0x26eb13))['catch'](handleError(_0x2a638f,null));};exports[_0x3940('0x3c')]=function(_0x2dcd10,_0x13f5aa){var _0x1fe736={'raw':!![],'where':{'id':_0x2dcd10[_0x3940('0x3d')]['id']}},_0x467352={};_0x467352['model']=_[_0x3940('0x2b')](db['Dynamics365Field'][_0x3940('0x3e')]);_0x467352['query']=_[_0x3940('0x2b')](_0x2dcd10[_0x3940('0x2a')]);_0x467352[_0x3940('0x32')]=_[_0x3940('0x2d')](_0x467352[_0x3940('0x29')],_0x467352[_0x3940('0x2a')]);_0x1fe736['attributes']=_[_0x3940('0x2d')](_0x467352[_0x3940('0x29')],qs[_0x3940('0x3f')](_0x2dcd10[_0x3940('0x2a')][_0x3940('0x3f')]));_0x1fe736[_0x3940('0x2c')]=_0x1fe736['attributes'][_0x3940('0x2e')]?_0x1fe736[_0x3940('0x2c')]:_0x467352[_0x3940('0x29')];if(_0x2dcd10[_0x3940('0x2a')][_0x3940('0x39')]){_0x1fe736['include']=[{'all':!![]}];}_0x1fe736=_[_0x3940('0x35')]({},_0x1fe736,_0x2dcd10['options']);return db[_0x3940('0x26')][_0x3940('0x40')](_0x1fe736)['then'](handleEntityNotFound(_0x13f5aa,null))['then'](respondWithResult(_0x13f5aa,null))[_0x3940('0x41')](handleError(_0x13f5aa,null));};exports[_0x3940('0x42')]=function(_0x793c5c,_0x43f90a){return db[_0x3940('0x26')]['create'](_0x793c5c[_0x3940('0x43')],{})[_0x3940('0x1f')](respondWithResult(_0x43f90a,0xc9))[_0x3940('0x41')](handleError(_0x43f90a,null));};exports[_0x3940('0x1e')]=function(_0x4eeb83,_0xed4d0e){if(_0x4eeb83[_0x3940('0x43')]['id']){delete _0x4eeb83[_0x3940('0x43')]['id'];}return db[_0x3940('0x26')][_0x3940('0x40')]({'where':{'id':_0x4eeb83[_0x3940('0x3d')]['id']}})['then'](handleEntityNotFound(_0xed4d0e,null))[_0x3940('0x1f')](saveUpdates(_0x4eeb83[_0x3940('0x43')],null))[_0x3940('0x1f')](respondWithResult(_0xed4d0e,null))[_0x3940('0x41')](handleError(_0xed4d0e,null));};exports[_0x3940('0x20')]=function(_0x3cf92a,_0x15b220){return db[_0x3940('0x26')][_0x3940('0x40')]({'where':{'id':_0x3cf92a[_0x3940('0x3d')]['id']}})['then'](handleEntityNotFound(_0x15b220,null))['then'](removeEntity(_0x15b220,null))[_0x3940('0x41')](handleError(_0x15b220,null));}; \ No newline at end of file +var _0x644a=['send','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','show','params','fields','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','json','apply','save','update','then','destroy','error','stack','name'];(function(_0x1fb86d,_0xc5978a){var _0x3f7334=function(_0x4b74b9){while(--_0x4b74b9){_0x1fb86d['push'](_0x1fb86d['shift']());}};_0x3f7334(++_0xc5978a);}(_0x644a,0xfa));var _0xa644=function(_0xcb537a,_0x15ca9b){_0xcb537a=_0xcb537a-0x0;var _0x5dcba0=_0x644a[_0xcb537a];return _0x5dcba0;};'use strict';var emlformat=require(_0xa644('0x0'));var rimraf=require(_0xa644('0x1'));var zipdir=require(_0xa644('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa644('0x3'));var moment=require(_0xa644('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa644('0x5'));var path=require(_0xa644('0x6'));var sox=require(_0xa644('0x7'));var csv=require(_0xa644('0x8'));var ejs=require(_0xa644('0x9'));var fs=require('fs');var fs_extra=require(_0xa644('0xa'));var _=require(_0xa644('0xb'));var squel=require(_0xa644('0xc'));var crypto=require('crypto');var jsforce=require(_0xa644('0xd'));var deskjs=require(_0xa644('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa644('0xf'));var Papa=require(_0xa644('0x10'));var Redis=require(_0xa644('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa644('0x12'));var as=require(_0xa644('0x13'));var hardwareService=require(_0xa644('0x14'));var logger=require(_0xa644('0x15'))(_0xa644('0x16'));var utils=require(_0xa644('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa644('0x18'));var db=require(_0xa644('0x19'))['db'];function respondWithStatusCode(_0xebda80,_0x250fd3){_0x250fd3=_0x250fd3||0xcc;return function(_0x3ba2a1){if(_0x3ba2a1){return _0xebda80[_0xa644('0x1a')](_0x250fd3);}return _0xebda80['status'](_0x250fd3)[_0xa644('0x1b')]();};}function respondWithResult(_0x466df7,_0x16307a){_0x16307a=_0x16307a||0xc8;return function(_0x3a29ef){if(_0x3a29ef){return _0x466df7[_0xa644('0x1c')](_0x16307a)['json'](_0x3a29ef);}};}function respondWithFilteredResult(_0x43dad0,_0x882196){return function(_0x4049d6){if(_0x4049d6){var _0x3d5c24=typeof _0x882196[_0xa644('0x1d')]===_0xa644('0x1e')&&typeof _0x882196[_0xa644('0x1f')]===_0xa644('0x1e');var _0x533269=_0x4049d6[_0xa644('0x20')];var _0x4710db=_0x3d5c24?0x0:_0x882196[_0xa644('0x1d')];var _0x5b1db9=_0x3d5c24?_0x4049d6['count']:_0x882196['offset']+_0x882196[_0xa644('0x1f')];var _0x87c9aa;if(_0x5b1db9>=_0x533269){_0x5b1db9=_0x533269;_0x87c9aa=0xc8;}else{_0x87c9aa=0xce;}_0x43dad0[_0xa644('0x1c')](_0x87c9aa);return _0x43dad0['set']('Content-Range',_0x4710db+'-'+_0x5b1db9+'/'+_0x533269)[_0xa644('0x21')](_0x4049d6);}return null;};}function patchUpdates(_0x2564da){return function(_0x47b944){try{jsonpatch[_0xa644('0x22')](_0x47b944,_0x2564da,!![]);}catch(_0x406813){return BPromise['reject'](_0x406813);}return _0x47b944[_0xa644('0x23')]();};}function saveUpdates(_0x115a1e,_0x2ec514){return function(_0x280802){if(_0x280802){return _0x280802[_0xa644('0x24')](_0x115a1e)[_0xa644('0x25')](function(_0x51159d){return _0x51159d;});}return null;};}function removeEntity(_0x1d2752,_0x3e6858){return function(_0xd6c5b){if(_0xd6c5b){return _0xd6c5b[_0xa644('0x26')]()[_0xa644('0x25')](function(){_0x1d2752['status'](0xcc)[_0xa644('0x1b')]();});}};}function handleEntityNotFound(_0x32d71d,_0x23d67c){return function(_0x34ff82){if(!_0x34ff82){_0x32d71d[_0xa644('0x1a')](0x194);}return _0x34ff82;};}function handleError(_0x24f7dc,_0x4c7b61){_0x4c7b61=_0x4c7b61||0x1f4;return function(_0x57886a){logger[_0xa644('0x27')](_0x57886a[_0xa644('0x28')]);if(_0x57886a[_0xa644('0x29')]){delete _0x57886a['name'];}_0x24f7dc[_0xa644('0x1c')](_0x4c7b61)[_0xa644('0x2a')](_0x57886a);};}exports[_0xa644('0x2b')]=function(_0x32e039,_0x14cdf9){var _0x2ad71a={},_0x1dfc81={},_0x291676={'count':0x0,'rows':[]};var _0x5ef7e0=_[_0xa644('0x2c')](db['Dynamics365Field'][_0xa644('0x2d')],function(_0x369dab){return{'name':_0x369dab['fieldName'],'type':_0x369dab[_0xa644('0x2e')]['key']};});_0x1dfc81[_0xa644('0x2f')]=_['map'](_0x5ef7e0,_0xa644('0x29'));_0x1dfc81['query']=_[_0xa644('0x30')](_0x32e039[_0xa644('0x31')]);_0x1dfc81[_0xa644('0x32')]=_[_0xa644('0x33')](_0x1dfc81[_0xa644('0x2f')],_0x1dfc81[_0xa644('0x31')]);_0x2ad71a[_0xa644('0x34')]=_[_0xa644('0x33')](_0x1dfc81[_0xa644('0x2f')],qs['fields'](_0x32e039[_0xa644('0x31')]['fields']));_0x2ad71a['attributes']=_0x2ad71a['attributes'][_0xa644('0x35')]?_0x2ad71a[_0xa644('0x34')]:_0x1dfc81[_0xa644('0x2f')];if(!_0x32e039[_0xa644('0x31')]['hasOwnProperty']('nolimit')){_0x2ad71a[_0xa644('0x1f')]=qs['limit'](_0x32e039['query']['limit']);_0x2ad71a[_0xa644('0x1d')]=qs[_0xa644('0x1d')](_0x32e039[_0xa644('0x31')]['offset']);}_0x2ad71a[_0xa644('0x36')]=qs['sort'](_0x32e039[_0xa644('0x31')][_0xa644('0x37')]);_0x2ad71a[_0xa644('0x38')]=qs[_0xa644('0x32')](_['pick'](_0x32e039['query'],_0x1dfc81[_0xa644('0x32')]),_0x5ef7e0);if(_0x32e039[_0xa644('0x31')][_0xa644('0x39')]){_0x2ad71a[_0xa644('0x38')]=_[_0xa644('0x3a')](_0x2ad71a[_0xa644('0x38')],{'$or':_['map'](_0x5ef7e0,function(_0xbd88dd){if(_0xbd88dd['type']!==_0xa644('0x3b')){var _0xacdb0f={};_0xacdb0f[_0xbd88dd['name']]={'$like':'%'+_0x32e039['query']['filter']+'%'};return _0xacdb0f;}})});}_0x2ad71a=_[_0xa644('0x3a')]({},_0x2ad71a,_0x32e039[_0xa644('0x3c')]);var _0x27e83a={'where':_0x2ad71a['where']};return db[_0xa644('0x3d')][_0xa644('0x20')](_0x27e83a)['then'](function(_0x131a85){_0x291676[_0xa644('0x20')]=_0x131a85;if(_0x32e039[_0xa644('0x31')][_0xa644('0x3e')]){_0x2ad71a[_0xa644('0x3f')]=[{'all':!![]}];}return db[_0xa644('0x3d')][_0xa644('0x40')](_0x2ad71a);})['then'](function(_0x18ef37){_0x291676[_0xa644('0x41')]=_0x18ef37;return _0x291676;})[_0xa644('0x25')](respondWithFilteredResult(_0x14cdf9,_0x2ad71a))['catch'](handleError(_0x14cdf9,null));};exports[_0xa644('0x42')]=function(_0x50bfcb,_0x2e6de0){var _0x588e3c={'raw':!![],'where':{'id':_0x50bfcb[_0xa644('0x43')]['id']}},_0x4aa258={};_0x4aa258[_0xa644('0x2f')]=_[_0xa644('0x30')](db[_0xa644('0x3d')][_0xa644('0x2d')]);_0x4aa258[_0xa644('0x31')]=_[_0xa644('0x30')](_0x50bfcb[_0xa644('0x31')]);_0x4aa258['filters']=_[_0xa644('0x33')](_0x4aa258[_0xa644('0x2f')],_0x4aa258[_0xa644('0x31')]);_0x588e3c['attributes']=_['intersection'](_0x4aa258[_0xa644('0x2f')],qs['fields'](_0x50bfcb[_0xa644('0x31')][_0xa644('0x44')]));_0x588e3c['attributes']=_0x588e3c['attributes'][_0xa644('0x35')]?_0x588e3c[_0xa644('0x34')]:_0x4aa258[_0xa644('0x2f')];if(_0x50bfcb[_0xa644('0x31')][_0xa644('0x3e')]){_0x588e3c[_0xa644('0x3f')]=[{'all':!![]}];}_0x588e3c=_[_0xa644('0x3a')]({},_0x588e3c,_0x50bfcb['options']);return db[_0xa644('0x3d')]['find'](_0x588e3c)[_0xa644('0x25')](handleEntityNotFound(_0x2e6de0,null))['then'](respondWithResult(_0x2e6de0,null))[_0xa644('0x45')](handleError(_0x2e6de0,null));};exports[_0xa644('0x46')]=function(_0x96b3d1,_0xb75742){return db[_0xa644('0x3d')]['create'](_0x96b3d1[_0xa644('0x47')],{})['then'](respondWithResult(_0xb75742,0xc9))[_0xa644('0x45')](handleError(_0xb75742,null));};exports[_0xa644('0x24')]=function(_0x58fcb6,_0x18dd5c){if(_0x58fcb6[_0xa644('0x47')]['id']){delete _0x58fcb6[_0xa644('0x47')]['id'];}return db[_0xa644('0x3d')][_0xa644('0x48')]({'where':{'id':_0x58fcb6['params']['id']}})[_0xa644('0x25')](handleEntityNotFound(_0x18dd5c,null))[_0xa644('0x25')](saveUpdates(_0x58fcb6[_0xa644('0x47')],null))['then'](respondWithResult(_0x18dd5c,null))['catch'](handleError(_0x18dd5c,null));};exports[_0xa644('0x26')]=function(_0x3c24b3,_0x224f32){return db[_0xa644('0x3d')]['find']({'where':{'id':_0x3c24b3[_0xa644('0x43')]['id']}})[_0xa644('0x25')](handleEntityNotFound(_0x224f32,null))[_0xa644('0x25')](removeEntity(_0x224f32,null))[_0xa644('0x45')](handleError(_0x224f32,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 441ff7a..26efcb5 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 _0x9805=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x25bd53,_0xdcad5c){var _0x6b405a=function(_0x3b6b24){while(--_0x3b6b24){_0x25bd53['push'](_0x25bd53['shift']());}};_0x6b405a(++_0xdcad5c);}(_0x9805,0x126));var _0x5980=function(_0x720057,_0x2bfc55){_0x720057=_0x720057-0x0;var _0x35924b=_0x9805[_0x720057];return _0x35924b;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var logger=require('../../config/logger')(_0x5980('0x2'));var moment=require(_0x5980('0x3'));var BPromise=require(_0x5980('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5980('0x5'));var config=require(_0x5980('0x6'));var attributes=require(_0x5980('0x7'));module[_0x5980('0x8')]=function(_0x9f774f,_0x5f3001){return _0x9f774f[_0x5980('0x9')](_0x5980('0xa'),attributes,{'tableName':_0x5980('0xb'),'paranoid':![],'indexes':[{'name':_0x5980('0xc'),'fields':[_0x5980('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0db4=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash'];(function(_0x5ae58c,_0x5e2828){var _0x168636=function(_0x27e113){while(--_0x27e113){_0x5ae58c['push'](_0x5ae58c['shift']());}};_0x168636(++_0x5e2828);}(_0x0db4,0x95));var _0x40db=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0db4[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x40db('0x0'));var util=require(_0x40db('0x1'));var logger=require('../../config/logger')(_0x40db('0x2'));var moment=require('moment');var BPromise=require(_0x40db('0x3'));var rp=require(_0x40db('0x4'));var fs=require('fs');var path=require(_0x40db('0x5'));var rimraf=require(_0x40db('0x6'));var config=require(_0x40db('0x7'));var attributes=require(_0x40db('0x8'));module[_0x40db('0x9')]=function(_0x1cb302,_0x2ed7ea){return _0x1cb302[_0x40db('0xa')](_0x40db('0xb'),attributes,{'tableName':_0x40db('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x40db('0xd'),_0x40db('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 445afaf..93b1924 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 _0x9a5c=['message','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s'];(function(_0x5aa244,_0x4ea0a3){var _0x4ec98e=function(_0x182a99){while(--_0x182a99){_0x5aa244['push'](_0x5aa244['shift']());}};_0x4ec98e(++_0x4ea0a3);}(_0x9a5c,0x17d));var _0xc9a5=function(_0x2184bd,_0xfc4324){_0x2184bd=_0x2184bd-0x0;var _0x4820d5=_0x9a5c[_0x2184bd];return _0x4820d5;};'use strict';var _=require(_0xc9a5('0x0'));var util=require(_0xc9a5('0x1'));var moment=require(_0xc9a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9a5('0x3'));var db=require(_0xc9a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9a5('0x5'))('rpc');var config=require(_0xc9a5('0x6'));var jayson=require(_0xc9a5('0x7'));var client=jayson['client'][_0xc9a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x245096,_0x5edbfa,_0x41ea4c){return new BPromise(function(_0x2d6eeb,_0x78ebbd){return client[_0xc9a5('0x9')](_0x245096,_0x41ea4c)[_0xc9a5('0xa')](function(_0x366f56){logger[_0xc9a5('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5edbfa,'request\x20sent');logger[_0xc9a5('0xc')](_0xc9a5('0xd'),_0x5edbfa,'request\x20sent',JSON[_0xc9a5('0xe')](_0x366f56));if(_0x366f56[_0xc9a5('0xf')]){if(_0x366f56[_0xc9a5('0xf')][_0xc9a5('0x10')]===0x1f4){logger[_0xc9a5('0xf')](_0xc9a5('0x11'),_0x5edbfa,_0x366f56['error'][_0xc9a5('0x12')]);return _0x78ebbd(_0x366f56[_0xc9a5('0xf')]['message']);}logger['error'](_0xc9a5('0x11'),_0x5edbfa,_0x366f56['error'][_0xc9a5('0x12')]);return _0x2d6eeb(_0x366f56[_0xc9a5('0xf')][_0xc9a5('0x12')]);}else{logger['info'](_0xc9a5('0x11'),_0x5edbfa,_0xc9a5('0x13'));_0x2d6eeb(_0x366f56['result'][_0xc9a5('0x12')]);}})[_0xc9a5('0x14')](function(_0x57b147){logger['error'](_0xc9a5('0x11'),_0x5edbfa,_0x57b147);_0x78ebbd(_0x57b147);});});} \ No newline at end of file +var _0x8955=['Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x4565db,_0x4d6706){var _0x2de14c=function(_0x67b358){while(--_0x67b358){_0x4565db['push'](_0x4565db['shift']());}};_0x2de14c(++_0x4d6706);}(_0x8955,0x1ae));var _0x5895=function(_0x164f75,_0x9be61c){_0x164f75=_0x164f75-0x0;var _0x312eba=_0x8955[_0x164f75];return _0x312eba;};'use strict';var _=require('lodash');var util=require(_0x5895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5895('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5895('0x2'))['db'];var utils=require(_0x5895('0x3'));var logger=require(_0x5895('0x4'))(_0x5895('0x5'));var config=require('../../config/environment');var jayson=require(_0x5895('0x6'));var client=jayson[_0x5895('0x7')][_0x5895('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51857b,_0x249e28,_0x2a409a){return new BPromise(function(_0x431438,_0x238e31){return client['request'](_0x51857b,_0x2a409a)[_0x5895('0x9')](function(_0x1db0b4){logger[_0x5895('0xa')](_0x5895('0xb'),_0x249e28,'request\x20sent');logger[_0x5895('0xc')](_0x5895('0xd'),_0x249e28,_0x5895('0xe'),JSON[_0x5895('0xf')](_0x1db0b4));if(_0x1db0b4['error']){if(_0x1db0b4['error'][_0x5895('0x10')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x249e28,_0x1db0b4['error'][_0x5895('0x11')]);return _0x238e31(_0x1db0b4[_0x5895('0x12')][_0x5895('0x11')]);}logger[_0x5895('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x249e28,_0x1db0b4[_0x5895('0x12')][_0x5895('0x11')]);return _0x431438(_0x1db0b4[_0x5895('0x12')][_0x5895('0x11')]);}else{logger[_0x5895('0xa')](_0x5895('0xb'),_0x249e28,_0x5895('0xe'));_0x431438(_0x1db0b4[_0x5895('0x13')][_0x5895('0x11')]);}})[_0x5895('0x14')](function(_0xefadfb){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x249e28,_0xefadfb);_0x238e31(_0xefadfb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 51ecc2e..d14e373 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 _0xf2b3=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','multer'];(function(_0x20dcce,_0x29107b){var _0x42c86a=function(_0x35cfd8){while(--_0x35cfd8){_0x20dcce['push'](_0x20dcce['shift']());}};_0x42c86a(++_0x29107b);}(_0xf2b3,0x77));var _0x3f2b=function(_0xfef2c7,_0x6ede38){_0xfef2c7=_0xfef2c7-0x0;var _0x491bca=_0xf2b3[_0xfef2c7];return _0x491bca;};'use strict';var multer=require(_0x3f2b('0x0'));var util=require('util');var path=require(_0x3f2b('0x1'));var timeout=require(_0x3f2b('0x2'));var express=require(_0x3f2b('0x3'));var router=express[_0x3f2b('0x4')]();var fs_extra=require(_0x3f2b('0x5'));var auth=require(_0x3f2b('0x6'));var interaction=require(_0x3f2b('0x7'));var config=require(_0x3f2b('0x8'));var controller=require(_0x3f2b('0x9'));router[_0x3f2b('0xa')]('/',auth[_0x3f2b('0xb')](),controller[_0x3f2b('0xc')]);router['get'](_0x3f2b('0xd'),auth[_0x3f2b('0xb')](),controller[_0x3f2b('0xe')]);router[_0x3f2b('0xa')](_0x3f2b('0xf'),auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x10')]);router['get'](_0x3f2b('0x11'),auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x12')]);router['post']('/',auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x13')]);router[_0x3f2b('0x14')]('/:id/configurations',auth[_0x3f2b('0xb')](),controller[_0x3f2b('0x15')]);router[_0x3f2b('0x16')](_0x3f2b('0xd'),auth['isAuthenticated'](),controller[_0x3f2b('0x17')]);router['delete'](_0x3f2b('0xd'),auth[_0x3f2b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2dd2=['delete','destroy','multer','path','express','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x2dd2,0x17e));var _0x22dd=function(_0x25ba1b,_0x172071){_0x25ba1b=_0x25ba1b-0x0;var _0x303a0d=_0x2dd2[_0x25ba1b];return _0x303a0d;};'use strict';var multer=require(_0x22dd('0x0'));var util=require('util');var path=require(_0x22dd('0x1'));var timeout=require('connect-timeout');var express=require(_0x22dd('0x2'));var router=express['Router']();var fs_extra=require(_0x22dd('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22dd('0x4'));var controller=require(_0x22dd('0x5'));router[_0x22dd('0x6')]('/',auth['isAuthenticated'](),controller[_0x22dd('0x7')]);router[_0x22dd('0x6')](_0x22dd('0x8'),auth[_0x22dd('0x9')](),controller[_0x22dd('0xa')]);router[_0x22dd('0x6')](_0x22dd('0xb'),auth[_0x22dd('0x9')](),controller['getConfigurations']);router[_0x22dd('0x6')](_0x22dd('0xc'),auth[_0x22dd('0x9')](),controller[_0x22dd('0xd')]);router[_0x22dd('0xe')]('/',auth[_0x22dd('0x9')](),controller[_0x22dd('0xf')]);router[_0x22dd('0xe')]('/:id/configurations',auth[_0x22dd('0x9')](),controller[_0x22dd('0x10')]);router[_0x22dd('0x11')](_0x22dd('0x8'),auth[_0x22dd('0x9')](),controller['update']);router[_0x22dd('0x12')](_0x22dd('0x8'),auth[_0x22dd('0x9')](),controller[_0x22dd('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 295c950..d7cffb5 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 _0x2ef3=['remoteUri','sequelize','exports','STRING','username'];(function(_0x368c97,_0x5dda9a){var _0x140706=function(_0x217ce2){while(--_0x217ce2){_0x368c97['push'](_0x368c97['shift']());}};_0x140706(++_0x5dda9a);}(_0x2ef3,0xba));var _0x32ef=function(_0x50947a,_0x48caf7){_0x50947a=_0x50947a-0x0;var _0x2e314c=_0x2ef3[_0x50947a];return _0x2e314c;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'name':{'type':Sequelize[_0x32ef('0x2')]},'description':{'type':Sequelize[_0x32ef('0x2')]},'username':{'type':Sequelize[_0x32ef('0x2')],'unique':_0x32ef('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x32ef('0x2')],'unique':_0x32ef('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x17ea97,_0x1b7351){var _0x37c25a=function(_0x16a1f1){while(--_0x16a1f1){_0x17ea97['push'](_0x17ea97['shift']());}};_0x37c25a(++_0x1b7351);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('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 35bcb39..1a9ff76 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 _0x2d58=['FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','options','find','create','body','getConfigurations','hasOwnProperty','findOne','AccountId','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','apiKey','toString','requester','agent','priority','group','source','company','remove','custom_text','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x82d5('0x0'));var rimraf=require(_0x82d5('0x1'));var zipdir=require(_0x82d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82d5('0x3'));var moment=require('moment');var BPromise=require(_0x82d5('0x4'));var Mustache=require(_0x82d5('0x5'));var util=require(_0x82d5('0x6'));var path=require(_0x82d5('0x7'));var sox=require(_0x82d5('0x8'));var csv=require(_0x82d5('0x9'));var ejs=require(_0x82d5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82d5('0xb'));var squel=require(_0x82d5('0xc'));var crypto=require(_0x82d5('0xd'));var jsforce=require(_0x82d5('0xe'));var deskjs=require(_0x82d5('0xf'));var toCsv=require(_0x82d5('0x9'));var querystring=require(_0x82d5('0x10'));var Papa=require(_0x82d5('0x11'));var Redis=require(_0x82d5('0x12'));var authService=require(_0x82d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x82d5('0x14'));var hardwareService=require(_0x82d5('0x15'));var logger=require(_0x82d5('0x16'))(_0x82d5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x82d5('0x18'));var db=require(_0x82d5('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14ccdc,_0x5c2d84){_0x5c2d84=_0x5c2d84||0xcc;return function(_0x2a14c4){if(_0x2a14c4){return _0x14ccdc[_0x82d5('0x1a')](_0x5c2d84);}return _0x14ccdc[_0x82d5('0x1b')](_0x5c2d84)[_0x82d5('0x1c')]();};}function respondWithResult(_0x201e56,_0x3f26ff){_0x3f26ff=_0x3f26ff||0xc8;return function(_0xa1c73e){if(_0xa1c73e){return _0x201e56[_0x82d5('0x1b')](_0x3f26ff)['json'](_0xa1c73e);}};}function respondWithFilteredResult(_0x128c42,_0x26caa1){return function(_0x5b0b6e){if(_0x5b0b6e){var _0x6ad68c=typeof _0x26caa1[_0x82d5('0x1d')]===_0x82d5('0x1e')&&typeof _0x26caa1[_0x82d5('0x1f')]===_0x82d5('0x1e');var _0x57cb4b=_0x5b0b6e[_0x82d5('0x20')];var _0x269375=_0x6ad68c?0x0:_0x26caa1[_0x82d5('0x1d')];var _0x2c1b30=_0x6ad68c?_0x5b0b6e[_0x82d5('0x20')]:_0x26caa1[_0x82d5('0x1d')]+_0x26caa1[_0x82d5('0x1f')];var _0x53fef6;if(_0x2c1b30>=_0x57cb4b){_0x2c1b30=_0x57cb4b;_0x53fef6=0xc8;}else{_0x53fef6=0xce;}_0x128c42['status'](_0x53fef6);return _0x128c42[_0x82d5('0x21')](_0x82d5('0x22'),_0x269375+'-'+_0x2c1b30+'/'+_0x57cb4b)[_0x82d5('0x23')](_0x5b0b6e);}return null;};}function patchUpdates(_0x4712db){return function(_0x32be04){try{jsonpatch[_0x82d5('0x24')](_0x32be04,_0x4712db,!![]);}catch(_0x1679eb){return BPromise[_0x82d5('0x25')](_0x1679eb);}return _0x32be04['save']();};}function saveUpdates(_0x423fe1,_0x2d22ab){return function(_0x7cf20){if(_0x7cf20){return _0x7cf20[_0x82d5('0x26')](_0x423fe1)['then'](function(_0x942fc){return _0x942fc;});}return null;};}function removeEntity(_0x59605b,_0x47736d){return function(_0x3bff15){if(_0x3bff15){return _0x3bff15[_0x82d5('0x27')]()[_0x82d5('0x28')](function(){_0x59605b[_0x82d5('0x1b')](0xcc)[_0x82d5('0x1c')]();});}};}function handleEntityNotFound(_0x485639,_0x18339a){return function(_0x47d93c){if(!_0x47d93c){_0x485639['sendStatus'](0x194);}return _0x47d93c;};}function handleError(_0x22b3cb,_0x5b659c){_0x5b659c=_0x5b659c||0x1f4;return function(_0x630b31){logger[_0x82d5('0x29')](_0x630b31[_0x82d5('0x2a')]);if(_0x630b31['name']){delete _0x630b31[_0x82d5('0x2b')];}_0x22b3cb[_0x82d5('0x1b')](_0x5b659c)[_0x82d5('0x2c')](_0x630b31);};}exports['index']=function(_0x35839b,_0x5227e0){var _0x2c9105={},_0x269619={},_0x22269a={'count':0x0,'rows':[]};var _0x5cf951=_[_0x82d5('0x2d')](db[_0x82d5('0x2e')][_0x82d5('0x2f')],function(_0x375c26){return{'name':_0x375c26[_0x82d5('0x30')],'type':_0x375c26[_0x82d5('0x31')][_0x82d5('0x32')]};});_0x269619['model']=_[_0x82d5('0x2d')](_0x5cf951,_0x82d5('0x2b'));_0x269619[_0x82d5('0x33')]=_['keys'](_0x35839b[_0x82d5('0x33')]);_0x269619[_0x82d5('0x34')]=_['intersection'](_0x269619[_0x82d5('0x35')],_0x269619[_0x82d5('0x33')]);_0x2c9105[_0x82d5('0x36')]=_[_0x82d5('0x37')](_0x269619['model'],qs[_0x82d5('0x38')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x38')]));_0x2c9105[_0x82d5('0x36')]=_0x2c9105[_0x82d5('0x36')][_0x82d5('0x39')]?_0x2c9105[_0x82d5('0x36')]:_0x269619[_0x82d5('0x35')];if(!_0x35839b['query']['hasOwnProperty'](_0x82d5('0x3a'))){_0x2c9105[_0x82d5('0x1f')]=qs[_0x82d5('0x1f')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x1f')]);_0x2c9105[_0x82d5('0x1d')]=qs[_0x82d5('0x1d')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x1d')]);}_0x2c9105[_0x82d5('0x3b')]=qs[_0x82d5('0x3c')](_0x35839b[_0x82d5('0x33')][_0x82d5('0x3c')]);_0x2c9105[_0x82d5('0x3d')]=qs['filters'](_[_0x82d5('0x3e')](_0x35839b[_0x82d5('0x33')],_0x269619[_0x82d5('0x34')]),_0x5cf951);if(_0x35839b[_0x82d5('0x33')][_0x82d5('0x3f')]){_0x2c9105['where']=_[_0x82d5('0x40')](_0x2c9105[_0x82d5('0x3d')],{'$or':_[_0x82d5('0x2d')](_0x5cf951,function(_0x56cd6e){if(_0x56cd6e[_0x82d5('0x31')]!==_0x82d5('0x41')){var _0x40a46c={};_0x40a46c[_0x56cd6e[_0x82d5('0x2b')]]={'$like':'%'+_0x35839b[_0x82d5('0x33')][_0x82d5('0x3f')]+'%'};return _0x40a46c;}})});}_0x2c9105=_['merge']({},_0x2c9105,_0x35839b['options']);var _0x124c50={'where':_0x2c9105['where']};return db[_0x82d5('0x2e')][_0x82d5('0x20')](_0x124c50)['then'](function(_0x1b21fe){_0x22269a[_0x82d5('0x20')]=_0x1b21fe;if(_0x35839b['query'][_0x82d5('0x42')]){_0x2c9105[_0x82d5('0x43')]=[{'all':!![]}];}return db[_0x82d5('0x2e')][_0x82d5('0x44')](_0x2c9105);})['then'](function(_0x5c82cc){_0x22269a['rows']=_0x5c82cc;return _0x22269a;})[_0x82d5('0x28')](respondWithFilteredResult(_0x5227e0,_0x2c9105))[_0x82d5('0x45')](handleError(_0x5227e0,null));};exports['show']=function(_0x5315af,_0x4e1350){var _0x17113a={'raw':![],'where':{'id':_0x5315af[_0x82d5('0x46')]['id']}},_0x1253b6={};_0x1253b6[_0x82d5('0x35')]=_['keys'](db['FreshdeskAccount'][_0x82d5('0x2f')]);_0x1253b6['query']=_[_0x82d5('0x47')](_0x5315af[_0x82d5('0x33')]);_0x1253b6[_0x82d5('0x34')]=_['intersection'](_0x1253b6[_0x82d5('0x35')],_0x1253b6[_0x82d5('0x33')]);_0x17113a[_0x82d5('0x36')]=_[_0x82d5('0x37')](_0x1253b6[_0x82d5('0x35')],qs[_0x82d5('0x38')](_0x5315af[_0x82d5('0x33')]['fields']));_0x17113a[_0x82d5('0x36')]=_0x17113a['attributes'][_0x82d5('0x39')]?_0x17113a[_0x82d5('0x36')]:_0x1253b6['model'];if(_0x5315af[_0x82d5('0x33')][_0x82d5('0x42')]){_0x17113a[_0x82d5('0x43')]=[{'all':!![]}];}_0x17113a=_[_0x82d5('0x40')]({},_0x17113a,_0x5315af[_0x82d5('0x48')]);return db[_0x82d5('0x2e')][_0x82d5('0x49')](_0x17113a)['then'](handleEntityNotFound(_0x4e1350,null))['then'](respondWithResult(_0x4e1350,null))['catch'](handleError(_0x4e1350,null));};exports[_0x82d5('0x4a')]=function(_0x2778a6,_0x4f4656){return db[_0x82d5('0x2e')][_0x82d5('0x4a')](_0x2778a6['body'],{})['then'](respondWithResult(_0x4f4656,0xc9))[_0x82d5('0x45')](handleError(_0x4f4656,null));};exports[_0x82d5('0x26')]=function(_0x4db992,_0xaf6d1c){if(_0x4db992[_0x82d5('0x4b')]['id']){delete _0x4db992[_0x82d5('0x4b')]['id'];}return db[_0x82d5('0x2e')][_0x82d5('0x49')]({'where':{'id':_0x4db992['params']['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0xaf6d1c,null))[_0x82d5('0x28')](saveUpdates(_0x4db992[_0x82d5('0x4b')],null))['then'](respondWithResult(_0xaf6d1c,null))[_0x82d5('0x45')](handleError(_0xaf6d1c,null));};exports[_0x82d5('0x27')]=function(_0x51e9aa,_0x472e65){return db[_0x82d5('0x2e')][_0x82d5('0x49')]({'where':{'id':_0x51e9aa[_0x82d5('0x46')]['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0x472e65,null))[_0x82d5('0x28')](removeEntity(_0x472e65,null))[_0x82d5('0x45')](handleError(_0x472e65,null));};exports['getConfigurations']=function(_0xceadea,_0x51ae74,_0x4d2729){var _0x387a63={};var _0x3b57d6={};var _0x738ab8;var _0x51299f;return db[_0x82d5('0x2e')]['findOne']({'where':{'id':_0xceadea[_0x82d5('0x46')]['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0x51ae74,null))[_0x82d5('0x28')](function(_0x3318bd){if(_0x3318bd){_0x738ab8=_0x3318bd;_0x3b57d6['model']=_[_0x82d5('0x47')](db['FreshdeskConfiguration'][_0x82d5('0x2f')]);_0x3b57d6[_0x82d5('0x33')]=_[_0x82d5('0x47')](_0xceadea['query']);_0x3b57d6[_0x82d5('0x34')]=_[_0x82d5('0x37')](_0x3b57d6[_0x82d5('0x35')],_0x3b57d6['query']);_0x387a63['attributes']=_['intersection'](_0x3b57d6[_0x82d5('0x35')],qs[_0x82d5('0x38')](_0xceadea[_0x82d5('0x33')][_0x82d5('0x38')]));_0x387a63[_0x82d5('0x36')]=_0x387a63[_0x82d5('0x36')][_0x82d5('0x39')]?_0x387a63[_0x82d5('0x36')]:_0x3b57d6['model'];_0x387a63[_0x82d5('0x3b')]=qs[_0x82d5('0x3c')](_0xceadea[_0x82d5('0x33')][_0x82d5('0x3c')]);_0x387a63[_0x82d5('0x3d')]=qs[_0x82d5('0x34')](_[_0x82d5('0x3e')](_0xceadea[_0x82d5('0x33')],_0x3b57d6[_0x82d5('0x34')]));if(_0xceadea[_0x82d5('0x33')][_0x82d5('0x3f')]){_0x387a63['where']=_[_0x82d5('0x40')](_0x387a63[_0x82d5('0x3d')],{'$or':_[_0x82d5('0x2d')](_0x387a63[_0x82d5('0x36')],function(_0x5b5fe0){var _0x311ceb={};_0x311ceb[_0x5b5fe0]={'$like':'%'+_0xceadea['query']['filter']+'%'};return _0x311ceb;})});}_0x387a63=_['merge']({},_0x387a63,_0xceadea[_0x82d5('0x48')]);return _0x738ab8[_0x82d5('0x4c')](_0x387a63);}})[_0x82d5('0x28')](function(_0x5daddf){if(_0x5daddf){_0x51299f=_0x5daddf[_0x82d5('0x39')];if(!_0xceadea['query'][_0x82d5('0x4d')]('nolimit')){_0x387a63[_0x82d5('0x1f')]=qs[_0x82d5('0x1f')](_0xceadea[_0x82d5('0x33')]['limit']);_0x387a63['offset']=qs[_0x82d5('0x1d')](_0xceadea[_0x82d5('0x33')]['offset']);}return _0x738ab8['getConfigurations'](_0x387a63);}})[_0x82d5('0x28')](function(_0x440629){if(_0x440629){return _0x440629?{'count':_0x51299f,'rows':_0x440629}:null;}})[_0x82d5('0x28')](respondWithResult(_0x51ae74,null))['catch'](handleError(_0x51ae74,null));};exports['addConfiguration']=function(_0x5c9556,_0x1823e8,_0x2ea849){if(_0x5c9556[_0x82d5('0x4b')]['id']){delete _0x5c9556[_0x82d5('0x4b')]['id'];}return db[_0x82d5('0x2e')][_0x82d5('0x4e')]({'where':{'id':_0x5c9556['params']['id']}})[_0x82d5('0x28')](handleEntityNotFound(_0x1823e8,null))[_0x82d5('0x28')](function(_0x25c243){if(_0x25c243){_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x4f')]=_0x25c243['id'];_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x50')]=integrations['getSubjects'](_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x51')],_0x5c9556['body'][_0x82d5('0x31')]);_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x52')]=integrations['getDescriptions'](_0x5c9556[_0x82d5('0x4b')][_0x82d5('0x51')],_0x5c9556[_0x82d5('0x4b')]['type']);return db[_0x82d5('0x53')]['create'](_0x5c9556[_0x82d5('0x4b')],{'include':[{'model':db[_0x82d5('0x54')],'as':_0x82d5('0x50')},{'model':db[_0x82d5('0x54')],'as':'Descriptions'}]});}return null;})[_0x82d5('0x28')](respondWithResult(_0x1823e8,null))['catch'](handleError(_0x1823e8,null));};exports[_0x82d5('0x55')]=function(_0x28ba24,_0x1a6411,_0x32129e){var _0x1f6156='';return db[_0x82d5('0x2e')][_0x82d5('0x4e')]({'where':{'id':_0x28ba24[_0x82d5('0x46')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x1a6411,null))[_0x82d5('0x28')](function(_0x5f3c64){if(_0x5f3c64){_0x1f6156=_0x5f3c64[_0x82d5('0x56')];var _0x52ecef=_0x1f6156[_0x82d5('0x57')](-0x1);if(_0x52ecef==='/'){_0x1f6156=_0x1f6156['substring'](0x0,_0x1f6156[_0x82d5('0x58')](_0x52ecef));}return rp({'method':_0x82d5('0x59'),'uri':util[_0x82d5('0x5a')](_0x82d5('0x5b'),_0x1f6156,_0x82d5('0x5c')),'headers':{'Authorization':util[_0x82d5('0x5a')]('Basic\x20%s',new Buffer(util[_0x82d5('0x5a')]('%s:X',_0x5f3c64[_0x82d5('0x5d')]))[_0x82d5('0x5e')]('base64'))},'json':!![]});}})[_0x82d5('0x28')](function(_0x4a0d9c){if(_0x4a0d9c){var _0x1ac38a=[_0x82d5('0x5f'),'subject',_0x82d5('0x60'),'description',_0x82d5('0x1b'),_0x82d5('0x61'),_0x82d5('0x62'),_0x82d5('0x63'),'ticket_type',_0x82d5('0x62'),_0x82d5('0x64')];_[_0x82d5('0x65')](_0x4a0d9c,function(_0x343b44){return _0x1ac38a['includes'](_0x343b44[_0x82d5('0x2b')])||!_0x343b44['default']&&_0x343b44[_0x82d5('0x31')]!==_0x82d5('0x66')&&_0x343b44[_0x82d5('0x31')]!=='custom_dropdown';});return{'count':_0x4a0d9c['length'],'rows':_[_0x82d5('0x2d')](_0x4a0d9c,function(_0x2a7ae0){return{'id':_0x2a7ae0[_0x82d5('0x2b')],'name':_0x2a7ae0[_0x82d5('0x67')],'custom':!_0x2a7ae0['default'],'options':_0x2a7ae0['choices']?_['map'](_0x2a7ae0['choices'],function(_0x2f5283){return{'name':_['capitalize'](_0x2f5283),'value':_0x2f5283};}):[]};})};}})[_0x82d5('0x28')](respondWithResult(_0x1a6411,null))[_0x82d5('0x45')](function(_0x410367){var _0x2844b5=_0x28ba24[_0x82d5('0x33')][_0x82d5('0x68')]?0x1f4:_0x410367[_0x82d5('0x69')]||0x1f4;logger['error'](_0x82d5('0x6a'),_0x82d5('0x55'),_0x2844b5,JSON[_0x82d5('0x6b')](_0x410367));delete _0x410367[_0x82d5('0x2b')];if(_0x2844b5===0x191){_0x2844b5=0x190;}_0x1a6411[_0x82d5('0x1b')](_0x2844b5)[_0x82d5('0x2c')](_0x28ba24[_0x82d5('0x33')][_0x82d5('0x68')]?{'message':_0x82d5('0x6c'),'statusCode':_0x410367[_0x82d5('0x69')]}:_0x410367);});}; \ No newline at end of file +var _0x3189=['query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','FreshdeskAccount','includeAll','findAll','rows','catch','include','find','create','body','params','findOne','order','options','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','GET','format','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','group','source','company','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model'];(function(_0x711043,_0x2555b8){var _0x39aa7e=function(_0x373028){while(--_0x373028){_0x711043['push'](_0x711043['shift']());}};_0x39aa7e(++_0x2555b8);}(_0x3189,0xae));var _0x9318=function(_0x478c2d,_0x4f07fd){_0x478c2d=_0x478c2d-0x0;var _0x372758=_0x3189[_0x478c2d];return _0x372758;};'use strict';var emlformat=require(_0x9318('0x0'));var rimraf=require(_0x9318('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9318('0x2'));var rp=require(_0x9318('0x3'));var moment=require(_0x9318('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9318('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9318('0x6'));var csv=require(_0x9318('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9318('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9318('0x9'));var jsforce=require(_0x9318('0xa'));var deskjs=require(_0x9318('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9318('0xc'));var Papa=require(_0x9318('0xd'));var Redis=require(_0x9318('0xe'));var authService=require(_0x9318('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9318('0x10'));var logger=require('../../config/logger')(_0x9318('0x11'));var utils=require(_0x9318('0x12'));var config=require(_0x9318('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9318('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5133a4,_0x2ac258){_0x2ac258=_0x2ac258||0xcc;return function(_0x4fba52){if(_0x4fba52){return _0x5133a4[_0x9318('0x15')](_0x2ac258);}return _0x5133a4[_0x9318('0x16')](_0x2ac258)['end']();};}function respondWithResult(_0x258b56,_0xfe145c){_0xfe145c=_0xfe145c||0xc8;return function(_0x326e26){if(_0x326e26){return _0x258b56['status'](_0xfe145c)['json'](_0x326e26);}};}function respondWithFilteredResult(_0x10d4f0,_0x11b380){return function(_0x4ee574){if(_0x4ee574){var _0x1a22c=typeof _0x11b380[_0x9318('0x17')]==='undefined'&&typeof _0x11b380[_0x9318('0x18')]===_0x9318('0x19');var _0x411fa4=_0x4ee574[_0x9318('0x1a')];var _0xd1fd86=_0x1a22c?0x0:_0x11b380[_0x9318('0x17')];var _0xf657f7=_0x1a22c?_0x4ee574[_0x9318('0x1a')]:_0x11b380['offset']+_0x11b380[_0x9318('0x18')];var _0x4611cb;if(_0xf657f7>=_0x411fa4){_0xf657f7=_0x411fa4;_0x4611cb=0xc8;}else{_0x4611cb=0xce;}_0x10d4f0[_0x9318('0x16')](_0x4611cb);return _0x10d4f0[_0x9318('0x1b')](_0x9318('0x1c'),_0xd1fd86+'-'+_0xf657f7+'/'+_0x411fa4)[_0x9318('0x1d')](_0x4ee574);}return null;};}function patchUpdates(_0x59a34f){return function(_0x325f14){try{jsonpatch['apply'](_0x325f14,_0x59a34f,!![]);}catch(_0x4c2883){return BPromise[_0x9318('0x1e')](_0x4c2883);}return _0x325f14[_0x9318('0x1f')]();};}function saveUpdates(_0xa45304,_0x2b3d31){return function(_0x714c45){if(_0x714c45){return _0x714c45['update'](_0xa45304)[_0x9318('0x20')](function(_0x3d6205){return _0x3d6205;});}return null;};}function removeEntity(_0x451694,_0x33502a){return function(_0x4316f8){if(_0x4316f8){return _0x4316f8[_0x9318('0x21')]()[_0x9318('0x20')](function(){_0x451694[_0x9318('0x16')](0xcc)[_0x9318('0x22')]();});}};}function handleEntityNotFound(_0xaf8aec,_0x30386c){return function(_0x202123){if(!_0x202123){_0xaf8aec[_0x9318('0x15')](0x194);}return _0x202123;};}function handleError(_0x659998,_0x35e85e){_0x35e85e=_0x35e85e||0x1f4;return function(_0x30be80){logger['error'](_0x30be80[_0x9318('0x23')]);if(_0x30be80[_0x9318('0x24')]){delete _0x30be80['name'];}_0x659998[_0x9318('0x16')](_0x35e85e)[_0x9318('0x25')](_0x30be80);};}exports[_0x9318('0x26')]=function(_0xf8bc76,_0xf01d79){var _0x430f42={},_0x30b048={},_0x4c8dc6={'count':0x0,'rows':[]};var _0x2fb678=_[_0x9318('0x27')](db['FreshdeskAccount'][_0x9318('0x28')],function(_0x4c4a6f){return{'name':_0x4c4a6f[_0x9318('0x29')],'type':_0x4c4a6f[_0x9318('0x2a')]['key']};});_0x30b048[_0x9318('0x2b')]=_['map'](_0x2fb678,_0x9318('0x24'));_0x30b048[_0x9318('0x2c')]=_[_0x9318('0x2d')](_0xf8bc76['query']);_0x30b048[_0x9318('0x2e')]=_[_0x9318('0x2f')](_0x30b048[_0x9318('0x2b')],_0x30b048[_0x9318('0x2c')]);_0x430f42['attributes']=_['intersection'](_0x30b048[_0x9318('0x2b')],qs['fields'](_0xf8bc76[_0x9318('0x2c')][_0x9318('0x30')]));_0x430f42['attributes']=_0x430f42[_0x9318('0x31')][_0x9318('0x32')]?_0x430f42['attributes']:_0x30b048[_0x9318('0x2b')];if(!_0xf8bc76[_0x9318('0x2c')]['hasOwnProperty'](_0x9318('0x33'))){_0x430f42[_0x9318('0x18')]=qs[_0x9318('0x18')](_0xf8bc76[_0x9318('0x2c')][_0x9318('0x18')]);_0x430f42[_0x9318('0x17')]=qs[_0x9318('0x17')](_0xf8bc76[_0x9318('0x2c')][_0x9318('0x17')]);}_0x430f42['order']=qs['sort'](_0xf8bc76[_0x9318('0x2c')][_0x9318('0x34')]);_0x430f42[_0x9318('0x35')]=qs[_0x9318('0x2e')](_[_0x9318('0x36')](_0xf8bc76[_0x9318('0x2c')],_0x30b048[_0x9318('0x2e')]),_0x2fb678);if(_0xf8bc76[_0x9318('0x2c')][_0x9318('0x37')]){_0x430f42[_0x9318('0x35')]=_['merge'](_0x430f42['where'],{'$or':_[_0x9318('0x27')](_0x2fb678,function(_0x5538b2){if(_0x5538b2['type']!==_0x9318('0x38')){var _0xa1b0b1={};_0xa1b0b1[_0x5538b2[_0x9318('0x24')]]={'$like':'%'+_0xf8bc76[_0x9318('0x2c')][_0x9318('0x37')]+'%'};return _0xa1b0b1;}})});}_0x430f42=_[_0x9318('0x39')]({},_0x430f42,_0xf8bc76['options']);var _0x3f3673={'where':_0x430f42[_0x9318('0x35')]};return db[_0x9318('0x3a')][_0x9318('0x1a')](_0x3f3673)['then'](function(_0xf31f83){_0x4c8dc6[_0x9318('0x1a')]=_0xf31f83;if(_0xf8bc76[_0x9318('0x2c')][_0x9318('0x3b')]){_0x430f42['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x9318('0x3c')](_0x430f42);})[_0x9318('0x20')](function(_0x5392b0){_0x4c8dc6[_0x9318('0x3d')]=_0x5392b0;return _0x4c8dc6;})[_0x9318('0x20')](respondWithFilteredResult(_0xf01d79,_0x430f42))[_0x9318('0x3e')](handleError(_0xf01d79,null));};exports['show']=function(_0x94a111,_0x205f06){var _0x28d505={'raw':![],'where':{'id':_0x94a111['params']['id']}},_0x430975={};_0x430975[_0x9318('0x2b')]=_['keys'](db[_0x9318('0x3a')][_0x9318('0x28')]);_0x430975[_0x9318('0x2c')]=_[_0x9318('0x2d')](_0x94a111[_0x9318('0x2c')]);_0x430975[_0x9318('0x2e')]=_['intersection'](_0x430975[_0x9318('0x2b')],_0x430975['query']);_0x28d505[_0x9318('0x31')]=_[_0x9318('0x2f')](_0x430975['model'],qs['fields'](_0x94a111['query'][_0x9318('0x30')]));_0x28d505[_0x9318('0x31')]=_0x28d505[_0x9318('0x31')][_0x9318('0x32')]?_0x28d505[_0x9318('0x31')]:_0x430975[_0x9318('0x2b')];if(_0x94a111[_0x9318('0x2c')][_0x9318('0x3b')]){_0x28d505[_0x9318('0x3f')]=[{'all':!![]}];}_0x28d505=_[_0x9318('0x39')]({},_0x28d505,_0x94a111['options']);return db[_0x9318('0x3a')][_0x9318('0x40')](_0x28d505)[_0x9318('0x20')](handleEntityNotFound(_0x205f06,null))[_0x9318('0x20')](respondWithResult(_0x205f06,null))[_0x9318('0x3e')](handleError(_0x205f06,null));};exports[_0x9318('0x41')]=function(_0x5eec25,_0x210f74){return db['FreshdeskAccount'][_0x9318('0x41')](_0x5eec25[_0x9318('0x42')],{})[_0x9318('0x20')](respondWithResult(_0x210f74,0xc9))['catch'](handleError(_0x210f74,null));};exports['update']=function(_0x4ce675,_0x19aa0e){if(_0x4ce675[_0x9318('0x42')]['id']){delete _0x4ce675[_0x9318('0x42')]['id'];}return db[_0x9318('0x3a')][_0x9318('0x40')]({'where':{'id':_0x4ce675[_0x9318('0x43')]['id']}})[_0x9318('0x20')](handleEntityNotFound(_0x19aa0e,null))['then'](saveUpdates(_0x4ce675[_0x9318('0x42')],null))[_0x9318('0x20')](respondWithResult(_0x19aa0e,null))['catch'](handleError(_0x19aa0e,null));};exports['destroy']=function(_0x1d8e80,_0x155e69){return db[_0x9318('0x3a')][_0x9318('0x40')]({'where':{'id':_0x1d8e80[_0x9318('0x43')]['id']}})[_0x9318('0x20')](handleEntityNotFound(_0x155e69,null))[_0x9318('0x20')](removeEntity(_0x155e69,null))[_0x9318('0x3e')](handleError(_0x155e69,null));};exports['getConfigurations']=function(_0x2c7eca,_0x221dc3,_0x44128e){var _0x14b195={};var _0x1bd5c1={};var _0x11b2ce;var _0x2c41a0;return db[_0x9318('0x3a')][_0x9318('0x44')]({'where':{'id':_0x2c7eca[_0x9318('0x43')]['id']}})[_0x9318('0x20')](handleEntityNotFound(_0x221dc3,null))[_0x9318('0x20')](function(_0x359871){if(_0x359871){_0x11b2ce=_0x359871;_0x1bd5c1[_0x9318('0x2b')]=_[_0x9318('0x2d')](db['FreshdeskConfiguration']['rawAttributes']);_0x1bd5c1[_0x9318('0x2c')]=_[_0x9318('0x2d')](_0x2c7eca['query']);_0x1bd5c1[_0x9318('0x2e')]=_[_0x9318('0x2f')](_0x1bd5c1[_0x9318('0x2b')],_0x1bd5c1[_0x9318('0x2c')]);_0x14b195[_0x9318('0x31')]=_[_0x9318('0x2f')](_0x1bd5c1['model'],qs['fields'](_0x2c7eca[_0x9318('0x2c')][_0x9318('0x30')]));_0x14b195[_0x9318('0x31')]=_0x14b195['attributes']['length']?_0x14b195[_0x9318('0x31')]:_0x1bd5c1['model'];_0x14b195[_0x9318('0x45')]=qs[_0x9318('0x34')](_0x2c7eca['query'][_0x9318('0x34')]);_0x14b195['where']=qs[_0x9318('0x2e')](_['pick'](_0x2c7eca[_0x9318('0x2c')],_0x1bd5c1[_0x9318('0x2e')]));if(_0x2c7eca[_0x9318('0x2c')][_0x9318('0x37')]){_0x14b195[_0x9318('0x35')]=_[_0x9318('0x39')](_0x14b195[_0x9318('0x35')],{'$or':_[_0x9318('0x27')](_0x14b195[_0x9318('0x31')],function(_0x37be4d){var _0x21ced4={};_0x21ced4[_0x37be4d]={'$like':'%'+_0x2c7eca[_0x9318('0x2c')][_0x9318('0x37')]+'%'};return _0x21ced4;})});}_0x14b195=_['merge']({},_0x14b195,_0x2c7eca[_0x9318('0x46')]);return _0x11b2ce[_0x9318('0x47')](_0x14b195);}})[_0x9318('0x20')](function(_0x2c98f4){if(_0x2c98f4){_0x2c41a0=_0x2c98f4['length'];if(!_0x2c7eca[_0x9318('0x2c')][_0x9318('0x48')](_0x9318('0x33'))){_0x14b195[_0x9318('0x18')]=qs[_0x9318('0x18')](_0x2c7eca[_0x9318('0x2c')]['limit']);_0x14b195[_0x9318('0x17')]=qs[_0x9318('0x17')](_0x2c7eca[_0x9318('0x2c')][_0x9318('0x17')]);}return _0x11b2ce[_0x9318('0x47')](_0x14b195);}})[_0x9318('0x20')](function(_0x34178d){if(_0x34178d){return _0x34178d?{'count':_0x2c41a0,'rows':_0x34178d}:null;}})[_0x9318('0x20')](respondWithResult(_0x221dc3,null))[_0x9318('0x3e')](handleError(_0x221dc3,null));};exports['addConfiguration']=function(_0x19db94,_0x1dbfcc,_0x1178fc){if(_0x19db94[_0x9318('0x42')]['id']){delete _0x19db94[_0x9318('0x42')]['id'];}return db[_0x9318('0x3a')]['findOne']({'where':{'id':_0x19db94['params']['id']}})[_0x9318('0x20')](handleEntityNotFound(_0x1dbfcc,null))[_0x9318('0x20')](function(_0x3b9b1c){if(_0x3b9b1c){_0x19db94['body'][_0x9318('0x49')]=_0x3b9b1c['id'];_0x19db94[_0x9318('0x42')][_0x9318('0x4a')]=integrations[_0x9318('0x4b')](_0x19db94[_0x9318('0x42')][_0x9318('0x4c')],_0x19db94['body'][_0x9318('0x2a')]);_0x19db94[_0x9318('0x42')][_0x9318('0x4d')]=integrations[_0x9318('0x4e')](_0x19db94[_0x9318('0x42')]['channel'],_0x19db94[_0x9318('0x42')][_0x9318('0x2a')]);return db[_0x9318('0x4f')][_0x9318('0x41')](_0x19db94[_0x9318('0x42')],{'include':[{'model':db[_0x9318('0x50')],'as':_0x9318('0x4a')},{'model':db[_0x9318('0x50')],'as':_0x9318('0x4d')}]});}return null;})[_0x9318('0x20')](respondWithResult(_0x1dbfcc,null))[_0x9318('0x3e')](handleError(_0x1dbfcc,null));};exports[_0x9318('0x51')]=function(_0x178fc5,_0x497171,_0x43850e){var _0x3ec6cb='';return db[_0x9318('0x3a')][_0x9318('0x44')]({'where':{'id':_0x178fc5['params']['id']},'attributes':['id',_0x9318('0x52'),_0x9318('0x53')]})[_0x9318('0x20')](handleEntityNotFound(_0x497171,null))[_0x9318('0x20')](function(_0x53900c){if(_0x53900c){_0x3ec6cb=_0x53900c[_0x9318('0x52')];var _0x2a4a07=_0x3ec6cb[_0x9318('0x54')](-0x1);if(_0x2a4a07==='/'){_0x3ec6cb=_0x3ec6cb['substring'](0x0,_0x3ec6cb['lastIndexOf'](_0x2a4a07));}return rp({'method':_0x9318('0x55'),'uri':util[_0x9318('0x56')]('%s/%s',_0x3ec6cb,_0x9318('0x57')),'headers':{'Authorization':util[_0x9318('0x56')](_0x9318('0x58'),new Buffer(util[_0x9318('0x56')]('%s:X',_0x53900c[_0x9318('0x53')]))[_0x9318('0x59')](_0x9318('0x5a')))},'json':!![]});}})[_0x9318('0x20')](function(_0x58e274){if(_0x58e274){var _0x197f01=[_0x9318('0x5b'),_0x9318('0x5c'),_0x9318('0x5d'),_0x9318('0x5e'),_0x9318('0x16'),'priority',_0x9318('0x5f'),_0x9318('0x60'),'ticket_type',_0x9318('0x5f'),_0x9318('0x61')];_['remove'](_0x58e274,function(_0xdde700){return _0x197f01[_0x9318('0x62')](_0xdde700[_0x9318('0x24')])||!_0xdde700[_0x9318('0x63')]&&_0xdde700[_0x9318('0x2a')]!=='custom_text'&&_0xdde700[_0x9318('0x2a')]!==_0x9318('0x64');});return{'count':_0x58e274['length'],'rows':_[_0x9318('0x27')](_0x58e274,function(_0x76fe43){return{'id':_0x76fe43['name'],'name':_0x76fe43[_0x9318('0x65')],'custom':!_0x76fe43[_0x9318('0x63')],'options':_0x76fe43[_0x9318('0x66')]?_[_0x9318('0x27')](_0x76fe43[_0x9318('0x66')],function(_0x34600f){return{'name':_[_0x9318('0x67')](_0x34600f),'value':_0x34600f};}):[]};})};}})['then'](respondWithResult(_0x497171,null))[_0x9318('0x3e')](function(_0x1b9b25){var _0x2ca2e6=_0x178fc5[_0x9318('0x2c')][_0x9318('0x68')]?0x1f4:_0x1b9b25[_0x9318('0x69')]||0x1f4;logger[_0x9318('0x6a')]('getFields,\x20%s,\x20%s,\x20%s',_0x9318('0x51'),_0x2ca2e6,JSON[_0x9318('0x6b')](_0x1b9b25));delete _0x1b9b25['name'];if(_0x2ca2e6===0x191){_0x2ca2e6=0x190;}_0x497171[_0x9318('0x16')](_0x2ca2e6)['send'](_0x178fc5[_0x9318('0x2c')][_0x9318('0x68')]?{'message':_0x9318('0x6c'),'statusCode':_0x1b9b25[_0x9318('0x69')]}:_0x1b9b25);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 50792ff..4702b1b 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 _0x6d45=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','int_freshdesk_accounts','lodash','util'];(function(_0x2dec23,_0x4b5dd8){var _0x12ccee=function(_0xdd05e4){while(--_0xdd05e4){_0x2dec23['push'](_0x2dec23['shift']());}};_0x12ccee(++_0x4b5dd8);}(_0x6d45,0x1f2));var _0x56d4=function(_0x35cb56,_0x52686c){_0x35cb56=_0x35cb56-0x0;var _0x4c9fb7=_0x6d45[_0x35cb56];return _0x4c9fb7;};'use strict';var _=require(_0x56d4('0x0'));var util=require(_0x56d4('0x1'));var logger=require('../../config/logger')(_0x56d4('0x2'));var moment=require(_0x56d4('0x3'));var BPromise=require(_0x56d4('0x4'));var rp=require(_0x56d4('0x5'));var fs=require('fs');var path=require(_0x56d4('0x6'));var rimraf=require(_0x56d4('0x7'));var config=require(_0x56d4('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4a9c19,_0x41e60d){return _0x4a9c19['define']('FreshdeskAccount',attributes,{'tableName':_0x56d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75fe=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment'];(function(_0x424895,_0x14c6f8){var _0xbf70ff=function(_0x2aacf5){while(--_0x2aacf5){_0x424895['push'](_0x424895['shift']());}};_0xbf70ff(++_0x14c6f8);}(_0x75fe,0x182));var _0xe75f=function(_0x1b4052,_0x1652ac){_0x1b4052=_0x1b4052-0x0;var _0x4e6cd8=_0x75fe[_0x1b4052];return _0x4e6cd8;};'use strict';var _=require(_0xe75f('0x0'));var util=require('util');var logger=require(_0xe75f('0x1'))(_0xe75f('0x2'));var moment=require(_0xe75f('0x3'));var BPromise=require(_0xe75f('0x4'));var rp=require(_0xe75f('0x5'));var fs=require('fs');var path=require(_0xe75f('0x6'));var rimraf=require(_0xe75f('0x7'));var config=require(_0xe75f('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xe75f('0x9'));module['exports']=function(_0x400d52,_0x39b7e5){return _0x400d52[_0xe75f('0xa')](_0xe75f('0xb'),attributes,{'tableName':_0xe75f('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 f18a83e..fd4f5da 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 _0xb932=['then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount','findAll','raw','options','where','attributes','map','include','model','GetFreshdeskAccount','debug','catch','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2373c6,_0x4218c9){var _0xf2aaa9=function(_0x26eb3b){while(--_0x26eb3b){_0x2373c6['push'](_0x2373c6['shift']());}};_0xf2aaa9(++_0x4218c9);}(_0xb932,0xd5));var _0x2b93=function(_0x20bcb0,_0xb5cbdd){_0x20bcb0=_0x20bcb0-0x0;var _0xdc4f5b=_0xb932[_0x20bcb0];return _0xdc4f5b;};'use strict';var _=require(_0x2b93('0x0'));var util=require(_0x2b93('0x1'));var moment=require('moment');var BPromise=require(_0x2b93('0x2'));var rs=require(_0x2b93('0x3'));var fs=require('fs');var Redis=require(_0x2b93('0x4'));var db=require(_0x2b93('0x5'))['db'];var utils=require(_0x2b93('0x6'));var logger=require(_0x2b93('0x7'))(_0x2b93('0x8'));var config=require(_0x2b93('0x9'));var jayson=require(_0x2b93('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x415f20,_0x46d72e,_0x26b3eb){return new BPromise(function(_0x4a3674,_0x115e1b){return client['request'](_0x415f20,_0x26b3eb)[_0x2b93('0xb')](function(_0x44a2a0){logger[_0x2b93('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d72e,_0x2b93('0xd'));logger['debug'](_0x2b93('0xe'),_0x46d72e,_0x2b93('0xd'),JSON[_0x2b93('0xf')](_0x44a2a0));if(_0x44a2a0[_0x2b93('0x10')]){if(_0x44a2a0['error']['code']===0x1f4){logger[_0x2b93('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d72e,_0x44a2a0[_0x2b93('0x10')]['message']);return _0x115e1b(_0x44a2a0['error'][_0x2b93('0x11')]);}logger[_0x2b93('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x46d72e,_0x44a2a0[_0x2b93('0x10')]['message']);return _0x4a3674(_0x44a2a0[_0x2b93('0x10')][_0x2b93('0x11')]);}else{logger[_0x2b93('0xc')](_0x2b93('0x12'),_0x46d72e,_0x2b93('0xd'));_0x4a3674(_0x44a2a0['result'][_0x2b93('0x11')]);}})['catch'](function(_0x185114){logger[_0x2b93('0x10')](_0x2b93('0x12'),_0x46d72e,_0x185114);_0x115e1b(_0x185114);});});}exports['GetFreshdeskAccount']=function(_0x52de46){var _0x304261=this;return new Promise(function(_0x314b00,_0x44e8f2){return db[_0x2b93('0x13')][_0x2b93('0x14')]({'raw':_0x52de46['options']?_0x52de46['options'][_0x2b93('0x15')]===undefined?!![]:![]:!![],'where':_0x52de46[_0x2b93('0x16')]?_0x52de46[_0x2b93('0x16')][_0x2b93('0x17')]||null:null,'attributes':_0x52de46[_0x2b93('0x16')]?_0x52de46[_0x2b93('0x16')][_0x2b93('0x18')]||null:null,'limit':_0x52de46[_0x2b93('0x16')]?_0x52de46[_0x2b93('0x16')]['limit']||null:null,'include':_0x52de46[_0x2b93('0x16')]?_0x52de46['options']['include']?_[_0x2b93('0x19')](_0x52de46[_0x2b93('0x16')][_0x2b93('0x1a')],function(_0x22a7cf){return{'model':db[_0x22a7cf[_0x2b93('0x1b')]],'as':_0x22a7cf['as'],'attributes':_0x22a7cf[_0x2b93('0x18')],'include':_0x22a7cf['include']?_['map'](_0x22a7cf['include'],function(_0x433f5f){return{'model':db[_0x433f5f['model']],'as':_0x433f5f['as'],'attributes':_0x433f5f[_0x2b93('0x18')],'include':_0x433f5f[_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0x433f5f[_0x2b93('0x1a')],function(_0x51dc01){return{'model':db[_0x51dc01[_0x2b93('0x1b')]],'as':_0x51dc01['as'],'attributes':_0x51dc01[_0x2b93('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2b93('0xb')](function(_0x1ac9cb){logger[_0x2b93('0xc')](_0x2b93('0x1c'),_0x52de46);logger[_0x2b93('0x1d')](_0x2b93('0x1c'),_0x52de46,JSON[_0x2b93('0xf')](_0x1ac9cb));_0x314b00(_0x1ac9cb);})[_0x2b93('0x1e')](function(_0xc12865){logger[_0x2b93('0x10')](_0x2b93('0x1c'),_0xc12865[_0x2b93('0x11')],_0x52de46);_0x44e8f2(_0x304261[_0x2b93('0x10')](0x1f4,_0xc12865[_0x2b93('0x11')]));});});};exports[_0x2b93('0x1f')]=function(_0x4a0d7a){var _0x54e763=this;return new Promise(function(_0x20d239,_0x464e40){return db['FreshdeskAccount']['find']({'raw':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a['options'][_0x2b93('0x15')]===undefined?!![]:![]:!![],'where':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a[_0x2b93('0x16')][_0x2b93('0x17')]||null:null,'attributes':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a[_0x2b93('0x16')]['attributes']||null:null,'include':_0x4a0d7a[_0x2b93('0x16')]?_0x4a0d7a[_0x2b93('0x16')][_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0x4a0d7a[_0x2b93('0x16')][_0x2b93('0x1a')],function(_0x5e3ef5){return{'model':db[_0x5e3ef5[_0x2b93('0x1b')]],'as':_0x5e3ef5['as'],'attributes':_0x5e3ef5[_0x2b93('0x18')],'include':_0x5e3ef5[_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0x5e3ef5[_0x2b93('0x1a')],function(_0xdf0001){return{'model':db[_0xdf0001[_0x2b93('0x1b')]],'as':_0xdf0001['as'],'attributes':_0xdf0001[_0x2b93('0x18')],'include':_0xdf0001[_0x2b93('0x1a')]?_[_0x2b93('0x19')](_0xdf0001['include'],function(_0x13062e){return{'model':db[_0x13062e['model']],'as':_0x13062e['as'],'attributes':_0x13062e[_0x2b93('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2b93('0xb')](function(_0x1d7b4f){logger[_0x2b93('0xc')](_0x2b93('0x1f'),_0x4a0d7a);logger[_0x2b93('0x1d')](_0x2b93('0x1f'),_0x4a0d7a,JSON['stringify'](_0x1d7b4f));_0x20d239(_0x1d7b4f);})['catch'](function(_0x2f65c3){logger['error'](_0x2b93('0x1f'),_0x2f65c3['message'],_0x4a0d7a);_0x464e40(_0x54e763[_0x2b93('0x10')](0x1f4,_0x2f65c3[_0x2b93('0x11')]));});});}; \ No newline at end of file +var _0xf620=['util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','FreshdeskAccount,\x20%s,\x20%s','message','GetFreshdeskAccount','findAll','raw','options','attributes','limit','include','model','debug','stringify','FreshdeskAccount','find','map','ShowFreshdeskAccount','lodash'];(function(_0x3ceeb4,_0x909aae){var _0x39070a=function(_0x54042d){while(--_0x54042d){_0x3ceeb4['push'](_0x3ceeb4['shift']());}};_0x39070a(++_0x909aae);}(_0xf620,0x197));var _0x0f62=function(_0x1edd84,_0x4fabf2){_0x1edd84=_0x1edd84-0x0;var _0x2160cf=_0xf620[_0x1edd84];return _0x2160cf;};'use strict';var _=require(_0x0f62('0x0'));var util=require(_0x0f62('0x1'));var moment=require(_0x0f62('0x2'));var BPromise=require(_0x0f62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f62('0x4'));var db=require(_0x0f62('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0f62('0x6'));var config=require(_0x0f62('0x7'));var jayson=require(_0x0f62('0x8'));var client=jayson[_0x0f62('0x9')][_0x0f62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xde828a,_0x4aa40c,_0x169451){return new BPromise(function(_0x4575d1,_0x20789c){return client[_0x0f62('0xb')](_0xde828a,_0x169451)[_0x0f62('0xc')](function(_0xe35873){logger[_0x0f62('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4aa40c,'request\x20sent');logger['debug'](_0x0f62('0xe'),_0x4aa40c,_0x0f62('0xf'),JSON['stringify'](_0xe35873));if(_0xe35873['error']){if(_0xe35873['error'][_0x0f62('0x10')]===0x1f4){logger[_0x0f62('0x11')](_0x0f62('0x12'),_0x4aa40c,_0xe35873[_0x0f62('0x11')][_0x0f62('0x13')]);return _0x20789c(_0xe35873[_0x0f62('0x11')]['message']);}logger[_0x0f62('0x11')](_0x0f62('0x12'),_0x4aa40c,_0xe35873[_0x0f62('0x11')]['message']);return _0x4575d1(_0xe35873[_0x0f62('0x11')][_0x0f62('0x13')]);}else{logger[_0x0f62('0xd')](_0x0f62('0x12'),_0x4aa40c,_0x0f62('0xf'));_0x4575d1(_0xe35873['result'][_0x0f62('0x13')]);}})['catch'](function(_0x5037f2){logger['error'](_0x0f62('0x12'),_0x4aa40c,_0x5037f2);_0x20789c(_0x5037f2);});});}exports[_0x0f62('0x14')]=function(_0x299a5a){var _0x273f11=this;return new Promise(function(_0x535452,_0x46576d){return db['FreshdeskAccount'][_0x0f62('0x15')]({'raw':_0x299a5a['options']?_0x299a5a['options'][_0x0f62('0x16')]===undefined?!![]:![]:!![],'where':_0x299a5a[_0x0f62('0x17')]?_0x299a5a['options']['where']||null:null,'attributes':_0x299a5a[_0x0f62('0x17')]?_0x299a5a['options'][_0x0f62('0x18')]||null:null,'limit':_0x299a5a[_0x0f62('0x17')]?_0x299a5a[_0x0f62('0x17')][_0x0f62('0x19')]||null:null,'include':_0x299a5a[_0x0f62('0x17')]?_0x299a5a[_0x0f62('0x17')][_0x0f62('0x1a')]?_['map'](_0x299a5a[_0x0f62('0x17')][_0x0f62('0x1a')],function(_0x40efd7){return{'model':db[_0x40efd7[_0x0f62('0x1b')]],'as':_0x40efd7['as'],'attributes':_0x40efd7[_0x0f62('0x18')],'include':_0x40efd7['include']?_['map'](_0x40efd7[_0x0f62('0x1a')],function(_0x567f3e){return{'model':db[_0x567f3e[_0x0f62('0x1b')]],'as':_0x567f3e['as'],'attributes':_0x567f3e[_0x0f62('0x18')],'include':_0x567f3e['include']?_['map'](_0x567f3e['include'],function(_0x3a3877){return{'model':db[_0x3a3877['model']],'as':_0x3a3877['as'],'attributes':_0x3a3877['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f62('0xc')](function(_0x420fe3){logger[_0x0f62('0xd')](_0x0f62('0x14'),_0x299a5a);logger[_0x0f62('0x1c')](_0x0f62('0x14'),_0x299a5a,JSON[_0x0f62('0x1d')](_0x420fe3));_0x535452(_0x420fe3);})['catch'](function(_0x1c7672){logger[_0x0f62('0x11')](_0x0f62('0x14'),_0x1c7672['message'],_0x299a5a);_0x46576d(_0x273f11['error'](0x1f4,_0x1c7672['message']));});});};exports['ShowFreshdeskAccount']=function(_0x4c89fc){var _0x27d515=this;return new Promise(function(_0x324918,_0x5355e0){return db[_0x0f62('0x1e')][_0x0f62('0x1f')]({'raw':_0x4c89fc[_0x0f62('0x17')]?_0x4c89fc[_0x0f62('0x17')][_0x0f62('0x16')]===undefined?!![]:![]:!![],'where':_0x4c89fc[_0x0f62('0x17')]?_0x4c89fc[_0x0f62('0x17')]['where']||null:null,'attributes':_0x4c89fc[_0x0f62('0x17')]?_0x4c89fc[_0x0f62('0x17')]['attributes']||null:null,'include':_0x4c89fc[_0x0f62('0x17')]?_0x4c89fc['options']['include']?_['map'](_0x4c89fc[_0x0f62('0x17')][_0x0f62('0x1a')],function(_0x1b8a31){return{'model':db[_0x1b8a31[_0x0f62('0x1b')]],'as':_0x1b8a31['as'],'attributes':_0x1b8a31[_0x0f62('0x18')],'include':_0x1b8a31[_0x0f62('0x1a')]?_[_0x0f62('0x20')](_0x1b8a31[_0x0f62('0x1a')],function(_0x287568){return{'model':db[_0x287568[_0x0f62('0x1b')]],'as':_0x287568['as'],'attributes':_0x287568[_0x0f62('0x18')],'include':_0x287568[_0x0f62('0x1a')]?_[_0x0f62('0x20')](_0x287568[_0x0f62('0x1a')],function(_0x55cc31){return{'model':db[_0x55cc31[_0x0f62('0x1b')]],'as':_0x55cc31['as'],'attributes':_0x55cc31[_0x0f62('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0f62('0xc')](function(_0x39b8b4){logger['info'](_0x0f62('0x21'),_0x4c89fc);logger['debug'](_0x0f62('0x21'),_0x4c89fc,JSON[_0x0f62('0x1d')](_0x39b8b4));_0x324918(_0x39b8b4);})['catch'](function(_0x3e45ea){logger[_0x0f62('0x11')](_0x0f62('0x21'),_0x3e45ea[_0x0f62('0x13')],_0x4c89fc);_0x5355e0(_0x27d515['error'](0x1f4,_0x3e45ea['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c58af14..75a3269 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 _0xd7f0=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','setTags','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0xd7f0,0x172));var _0x0d7f=function(_0x268dd7,_0x9390f0){_0x268dd7=_0x268dd7-0x0;var _0x4ace9f=_0xd7f0[_0x268dd7];return _0x4ace9f;};'use strict';var multer=require(_0x0d7f('0x0'));var util=require(_0x0d7f('0x1'));var path=require('path');var timeout=require(_0x0d7f('0x2'));var express=require(_0x0d7f('0x3'));var router=express[_0x0d7f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d7f('0x5'));var config=require(_0x0d7f('0x6'));var controller=require(_0x0d7f('0x7'));router['get']('/',auth[_0x0d7f('0x8')](),controller['index']);router[_0x0d7f('0x9')](_0x0d7f('0xa'),auth[_0x0d7f('0x8')](),controller[_0x0d7f('0xb')]);router[_0x0d7f('0x9')](_0x0d7f('0xc'),auth[_0x0d7f('0x8')](),controller[_0x0d7f('0xd')]);router[_0x0d7f('0x9')](_0x0d7f('0xe'),auth['isAuthenticated'](),controller[_0x0d7f('0xf')]);router[_0x0d7f('0x9')]('/:id/descriptions',auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x10')]);router['get']('/:id/tags',auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x11')]);router[_0x0d7f('0x12')]('/',auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x13')]);router[_0x0d7f('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0d7f('0x14')]);router['put'](_0x0d7f('0xa'),auth[_0x0d7f('0x8')](),controller[_0x0d7f('0x15')]);router[_0x0d7f('0x16')](_0x0d7f('0xa'),auth['isAuthenticated'](),controller[_0x0d7f('0x17')]);module[_0x0d7f('0x18')]=router; \ No newline at end of file +var _0xe350=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra'];(function(_0x17c5bf,_0x20f3e5){var _0x1cce18=function(_0x464a16){while(--_0x464a16){_0x17c5bf['push'](_0x17c5bf['shift']());}};_0x1cce18(++_0x20f3e5);}(_0xe350,0x1ac));var _0x0e35=function(_0x464470,_0x33ca44){_0x464470=_0x464470-0x0;var _0x3f8444=_0xe350[_0x464470];return _0x3f8444;};'use strict';var multer=require(_0x0e35('0x0'));var util=require('util');var path=require(_0x0e35('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e35('0x2')]();var fs_extra=require(_0x0e35('0x3'));var auth=require(_0x0e35('0x4'));var interaction=require(_0x0e35('0x5'));var config=require(_0x0e35('0x6'));var controller=require(_0x0e35('0x7'));router[_0x0e35('0x8')]('/',auth['isAuthenticated'](),controller[_0x0e35('0x9')]);router[_0x0e35('0x8')](_0x0e35('0xa'),auth[_0x0e35('0xb')](),controller[_0x0e35('0xc')]);router[_0x0e35('0x8')](_0x0e35('0xd'),auth[_0x0e35('0xb')](),controller[_0x0e35('0xe')]);router[_0x0e35('0x8')](_0x0e35('0xf'),auth[_0x0e35('0xb')](),controller[_0x0e35('0x10')]);router['get'](_0x0e35('0x11'),auth[_0x0e35('0xb')](),controller['getDescriptions']);router['get'](_0x0e35('0x12'),auth[_0x0e35('0xb')](),controller[_0x0e35('0x13')]);router[_0x0e35('0x14')]('/',auth[_0x0e35('0xb')](),controller[_0x0e35('0x15')]);router[_0x0e35('0x14')]('/:id/tags',auth[_0x0e35('0xb')](),controller['setTags']);router[_0x0e35('0x16')]('/:id',auth[_0x0e35('0xb')](),controller[_0x0e35('0x17')]);router[_0x0e35('0x18')](_0x0e35('0xa'),auth[_0x0e35('0xb')](),controller[_0x0e35('0x19')]);module[_0x0e35('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 7e9e4c4..ba40a72 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 _0xf8d0=['STRING','sequelize','exports'];(function(_0x114b2f,_0x5a9b64){var _0x2ed4fe=function(_0x5c5715){while(--_0x5c5715){_0x114b2f['push'](_0x114b2f['shift']());}};_0x2ed4fe(++_0x5a9b64);}(_0xf8d0,0xb2));var _0x0f8d=function(_0x5a339e,_0x2300e1){_0x5a339e=_0x5a339e-0x0;var _0x4f700f=_0xf8d0[_0x5a339e];return _0x4f700f;};'use strict';var Sequelize=require(_0x0f8d('0x0'));module[_0x0f8d('0x1')]={'name':{'type':Sequelize[_0x0f8d('0x2')]},'description':{'type':Sequelize[_0x0f8d('0x2')]}}; \ No newline at end of file +var _0xc6cb=['STRING','sequelize'];(function(_0x228ab4,_0x5cb3da){var _0x4e1fd1=function(_0x1bd7cb){while(--_0x1bd7cb){_0x228ab4['push'](_0x228ab4['shift']());}};_0x4e1fd1(++_0x5cb3da);}(_0xc6cb,0x87));var _0xbc6c=function(_0x450b7d,_0x161564){_0x450b7d=_0x450b7d-0x0;var _0x206e46=_0xc6cb[_0x450b7d];return _0x206e46;};'use strict';var Sequelize=require(_0xbc6c('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc6c('0x1')]},'description':{'type':Sequelize[_0xbc6c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 7375e61..500c097 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 _0xf3c6=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../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','reject','save','update','then','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','destroy','getFields','findOne','FreshdeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf3c6,0xad));var _0x6f3c=function(_0x448b32,_0x9043c2){_0x448b32=_0x448b32-0x0;var _0x2007d6=_0xf3c6[_0x448b32];return _0x2007d6;};'use strict';var emlformat=require(_0x6f3c('0x0'));var rimraf=require(_0x6f3c('0x1'));var zipdir=require(_0x6f3c('0x2'));var jsonpatch=require(_0x6f3c('0x3'));var rp=require(_0x6f3c('0x4'));var moment=require('moment');var BPromise=require(_0x6f3c('0x5'));var Mustache=require(_0x6f3c('0x6'));var util=require(_0x6f3c('0x7'));var path=require(_0x6f3c('0x8'));var sox=require(_0x6f3c('0x9'));var csv=require(_0x6f3c('0xa'));var ejs=require(_0x6f3c('0xb'));var fs=require('fs');var fs_extra=require(_0x6f3c('0xc'));var _=require('lodash');var squel=require(_0x6f3c('0xd'));var crypto=require(_0x6f3c('0xe'));var jsforce=require(_0x6f3c('0xf'));var deskjs=require(_0x6f3c('0x10'));var toCsv=require(_0x6f3c('0xa'));var querystring=require(_0x6f3c('0x11'));var Papa=require('papaparse');var Redis=require(_0x6f3c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6f3c('0x13'));var as=require(_0x6f3c('0x14'));var hardwareService=require(_0x6f3c('0x15'));var logger=require(_0x6f3c('0x16'))(_0x6f3c('0x17'));var utils=require(_0x6f3c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6f3c('0x19'));var db=require(_0x6f3c('0x1a'))['db'];function respondWithStatusCode(_0x451986,_0x176e8b){_0x176e8b=_0x176e8b||0xcc;return function(_0x482d8c){if(_0x482d8c){return _0x451986[_0x6f3c('0x1b')](_0x176e8b);}return _0x451986[_0x6f3c('0x1c')](_0x176e8b)[_0x6f3c('0x1d')]();};}function respondWithResult(_0x4f1671,_0x1beebd){_0x1beebd=_0x1beebd||0xc8;return function(_0x1781a5){if(_0x1781a5){return _0x4f1671['status'](_0x1beebd)[_0x6f3c('0x1e')](_0x1781a5);}};}function respondWithFilteredResult(_0x5da9bc,_0x598bed){return function(_0xa604ac){if(_0xa604ac){var _0x217248=typeof _0x598bed[_0x6f3c('0x1f')]===_0x6f3c('0x20')&&typeof _0x598bed[_0x6f3c('0x21')]===_0x6f3c('0x20');var _0x1e205e=_0xa604ac[_0x6f3c('0x22')];var _0xd72156=_0x217248?0x0:_0x598bed[_0x6f3c('0x1f')];var _0x2322d6=_0x217248?_0xa604ac['count']:_0x598bed[_0x6f3c('0x1f')]+_0x598bed[_0x6f3c('0x21')];var _0x3df3fd;if(_0x2322d6>=_0x1e205e){_0x2322d6=_0x1e205e;_0x3df3fd=0xc8;}else{_0x3df3fd=0xce;}_0x5da9bc[_0x6f3c('0x1c')](_0x3df3fd);return _0x5da9bc[_0x6f3c('0x23')](_0x6f3c('0x24'),_0xd72156+'-'+_0x2322d6+'/'+_0x1e205e)[_0x6f3c('0x1e')](_0xa604ac);}return null;};}function patchUpdates(_0x3ff3c2){return function(_0x40eff2){try{jsonpatch['apply'](_0x40eff2,_0x3ff3c2,!![]);}catch(_0x1b5c50){return BPromise[_0x6f3c('0x25')](_0x1b5c50);}return _0x40eff2[_0x6f3c('0x26')]();};}function saveUpdates(_0x586b2b,_0x4396df){return function(_0x571440){if(_0x571440){return _0x571440[_0x6f3c('0x27')](_0x586b2b)[_0x6f3c('0x28')](function(_0xbb5889){return _0xbb5889;});}return null;};}function removeEntity(_0x37a660,_0x297210){return function(_0x439cc2){if(_0x439cc2){return _0x439cc2['destroy']()[_0x6f3c('0x28')](function(){_0x37a660['status'](0xcc)[_0x6f3c('0x1d')]();});}};}function handleEntityNotFound(_0x509c40,_0x1f88f6){return function(_0x4c92a7){if(!_0x4c92a7){_0x509c40['sendStatus'](0x194);}return _0x4c92a7;};}function handleError(_0x47ceff,_0xc024bd){_0xc024bd=_0xc024bd||0x1f4;return function(_0x461ed9){logger[_0x6f3c('0x29')](_0x461ed9['stack']);if(_0x461ed9[_0x6f3c('0x2a')]){delete _0x461ed9['name'];}_0x47ceff[_0x6f3c('0x1c')](_0xc024bd)[_0x6f3c('0x2b')](_0x461ed9);};}exports[_0x6f3c('0x2c')]=function(_0x312c2d,_0x2749da){var _0x353681={},_0x4a44a4={},_0x500570={'count':0x0,'rows':[]};var _0xe16f03=_[_0x6f3c('0x2d')](db[_0x6f3c('0x2e')][_0x6f3c('0x2f')],function(_0x558ec1){return{'name':_0x558ec1[_0x6f3c('0x30')],'type':_0x558ec1[_0x6f3c('0x31')][_0x6f3c('0x32')]};});_0x4a44a4['model']=_['map'](_0xe16f03,_0x6f3c('0x2a'));_0x4a44a4[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x312c2d[_0x6f3c('0x33')]);_0x4a44a4['filters']=_['intersection'](_0x4a44a4['model'],_0x4a44a4[_0x6f3c('0x33')]);_0x353681['attributes']=_[_0x6f3c('0x35')](_0x4a44a4[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x353681[_0x6f3c('0x38')]=_0x353681[_0x6f3c('0x38')]['length']?_0x353681[_0x6f3c('0x38')]:_0x4a44a4[_0x6f3c('0x36')];if(!_0x312c2d['query']['hasOwnProperty'](_0x6f3c('0x39'))){_0x353681['limit']=qs['limit'](_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x353681[_0x6f3c('0x1f')]=qs[_0x6f3c('0x1f')](_0x312c2d[_0x6f3c('0x33')]['offset']);}_0x353681[_0x6f3c('0x3a')]=qs[_0x6f3c('0x3b')](_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x3b')]);_0x353681[_0x6f3c('0x3c')]=qs[_0x6f3c('0x3d')](_['pick'](_0x312c2d[_0x6f3c('0x33')],_0x4a44a4[_0x6f3c('0x3d')]),_0xe16f03);if(_0x312c2d['query'][_0x6f3c('0x3e')]){_0x353681[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x353681[_0x6f3c('0x3c')],{'$or':_[_0x6f3c('0x2d')](_0xe16f03,function(_0x48141b){if(_0x48141b[_0x6f3c('0x31')]!==_0x6f3c('0x40')){var _0x511856={};_0x511856[_0x48141b[_0x6f3c('0x2a')]]={'$like':'%'+_0x312c2d['query'][_0x6f3c('0x3e')]+'%'};return _0x511856;}})});}_0x353681=_['merge']({},_0x353681,_0x312c2d[_0x6f3c('0x41')]);var _0x30b1dc={'where':_0x353681['where']};return db[_0x6f3c('0x2e')][_0x6f3c('0x22')](_0x30b1dc)[_0x6f3c('0x28')](function(_0x3f24e2){_0x500570[_0x6f3c('0x22')]=_0x3f24e2;if(_0x312c2d[_0x6f3c('0x33')][_0x6f3c('0x42')]){_0x353681[_0x6f3c('0x43')]=[{'all':!![]}];}return db[_0x6f3c('0x2e')][_0x6f3c('0x44')](_0x353681);})[_0x6f3c('0x28')](function(_0x5675fe){_0x500570[_0x6f3c('0x45')]=_0x5675fe;return _0x500570;})[_0x6f3c('0x28')](respondWithFilteredResult(_0x2749da,_0x353681))[_0x6f3c('0x46')](handleError(_0x2749da,null));};exports[_0x6f3c('0x47')]=function(_0x33c907,_0x1d4f8d){var _0x3c3432={'raw':![],'where':{'id':_0x33c907[_0x6f3c('0x48')]['id']}},_0x708737={};_0x708737[_0x6f3c('0x36')]=_[_0x6f3c('0x34')](db[_0x6f3c('0x2e')][_0x6f3c('0x2f')]);_0x708737[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x33c907[_0x6f3c('0x33')]);_0x708737[_0x6f3c('0x3d')]=_[_0x6f3c('0x35')](_0x708737['model'],_0x708737[_0x6f3c('0x33')]);_0x3c3432[_0x6f3c('0x38')]=_[_0x6f3c('0x35')](_0x708737[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x33c907[_0x6f3c('0x33')]['fields']));_0x3c3432[_0x6f3c('0x38')]=_0x3c3432[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x3c3432[_0x6f3c('0x38')]:_0x708737[_0x6f3c('0x36')];if(_0x33c907[_0x6f3c('0x33')][_0x6f3c('0x42')]){_0x3c3432[_0x6f3c('0x43')]=[{'all':!![]}];}_0x3c3432=_[_0x6f3c('0x3f')]({},_0x3c3432,_0x33c907[_0x6f3c('0x41')]);return db[_0x6f3c('0x2e')][_0x6f3c('0x4a')](_0x3c3432)['then'](handleEntityNotFound(_0x1d4f8d,null))[_0x6f3c('0x28')](respondWithResult(_0x1d4f8d,null))[_0x6f3c('0x46')](handleError(_0x1d4f8d,null));};exports['create']=function(_0x178720,_0x48169e){return db[_0x6f3c('0x2e')]['create'](_0x178720[_0x6f3c('0x4b')],{})['then'](respondWithResult(_0x48169e,0xc9))[_0x6f3c('0x46')](handleError(_0x48169e,null));};exports['update']=function(_0x598df6,_0x4ea1b7){if(_0x598df6[_0x6f3c('0x4b')]['id']){delete _0x598df6[_0x6f3c('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x6f3c('0x4a')]({'where':{'id':_0x598df6[_0x6f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ea1b7,null))[_0x6f3c('0x28')](saveUpdates(_0x598df6[_0x6f3c('0x4b')],null))[_0x6f3c('0x28')](respondWithResult(_0x4ea1b7,null))[_0x6f3c('0x46')](handleError(_0x4ea1b7,null));};exports[_0x6f3c('0x4c')]=function(_0x11ac77,_0x18b969){return db[_0x6f3c('0x2e')]['find']({'where':{'id':_0x11ac77[_0x6f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x18b969,null))[_0x6f3c('0x28')](removeEntity(_0x18b969,null))[_0x6f3c('0x46')](handleError(_0x18b969,null));};exports[_0x6f3c('0x4d')]=function(_0x387e1d,_0x21cacc,_0x5e7c99){var _0x3ef10a={};var _0x14d770={};var _0x20bd59;var _0x35ae83;return db['FreshdeskConfiguration'][_0x6f3c('0x4e')]({'where':{'id':_0x387e1d[_0x6f3c('0x48')]['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x21cacc,null))[_0x6f3c('0x28')](function(_0x8d37e4){if(_0x8d37e4){_0x20bd59=_0x8d37e4;_0x14d770[_0x6f3c('0x36')]=_[_0x6f3c('0x34')](db[_0x6f3c('0x4f')][_0x6f3c('0x2f')]);_0x14d770[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x387e1d[_0x6f3c('0x33')]);_0x14d770['filters']=_[_0x6f3c('0x35')](_0x14d770[_0x6f3c('0x36')],_0x14d770['query']);_0x3ef10a[_0x6f3c('0x38')]=_['intersection'](_0x14d770[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x3ef10a[_0x6f3c('0x38')]=_0x3ef10a[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x3ef10a['attributes']:_0x14d770[_0x6f3c('0x36')];_0x3ef10a[_0x6f3c('0x3a')]=qs['sort'](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x3b')]);_0x3ef10a[_0x6f3c('0x3c')]=qs['filters'](_[_0x6f3c('0x50')](_0x387e1d[_0x6f3c('0x33')],_0x14d770[_0x6f3c('0x3d')]));if(_0x387e1d['query'][_0x6f3c('0x3e')]){_0x3ef10a[_0x6f3c('0x3c')]=_['merge'](_0x3ef10a[_0x6f3c('0x3c')],{'$or':_[_0x6f3c('0x2d')](_0x3ef10a[_0x6f3c('0x38')],function(_0x5d08ee){var _0x339400={};_0x339400[_0x5d08ee]={'$like':'%'+_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x3e')]+'%'};return _0x339400;})});}_0x3ef10a=_[_0x6f3c('0x3f')]({},_0x3ef10a,_0x387e1d[_0x6f3c('0x41')]);return _0x20bd59[_0x6f3c('0x4d')](_0x3ef10a);}})[_0x6f3c('0x28')](function(_0x13e310){if(_0x13e310){_0x35ae83=_0x13e310[_0x6f3c('0x49')];if(!_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x51')](_0x6f3c('0x39'))){_0x3ef10a[_0x6f3c('0x21')]=qs['limit'](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x3ef10a['offset']=qs[_0x6f3c('0x1f')](_0x387e1d[_0x6f3c('0x33')][_0x6f3c('0x1f')]);}return _0x20bd59['getFields'](_0x3ef10a);}})[_0x6f3c('0x28')](function(_0x45f598){if(_0x45f598){return _0x45f598?{'count':_0x35ae83,'rows':_0x45f598}:null;}})[_0x6f3c('0x28')](respondWithResult(_0x21cacc,null))[_0x6f3c('0x46')](handleError(_0x21cacc,null));};exports[_0x6f3c('0x52')]=function(_0x25a0d4,_0x4f374b,_0x34949b){var _0x38d19d={};var _0x3be43a={};var _0x3a17a9;var _0x3610f5;return db[_0x6f3c('0x2e')][_0x6f3c('0x4e')]({'where':{'id':_0x25a0d4['params']['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x4f374b,null))[_0x6f3c('0x28')](function(_0x2c3d5c){if(_0x2c3d5c){_0x3a17a9=_0x2c3d5c;_0x3be43a[_0x6f3c('0x36')]=_['keys'](db[_0x6f3c('0x4f')][_0x6f3c('0x2f')]);_0x3be43a[_0x6f3c('0x33')]=_['keys'](_0x25a0d4[_0x6f3c('0x33')]);_0x3be43a['filters']=_[_0x6f3c('0x35')](_0x3be43a['model'],_0x3be43a[_0x6f3c('0x33')]);_0x38d19d['attributes']=_[_0x6f3c('0x35')](_0x3be43a[_0x6f3c('0x36')],qs['fields'](_0x25a0d4[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x38d19d[_0x6f3c('0x38')]=_0x38d19d[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x38d19d[_0x6f3c('0x38')]:_0x3be43a[_0x6f3c('0x36')];_0x38d19d[_0x6f3c('0x3a')]=qs[_0x6f3c('0x3b')](_0x25a0d4['query'][_0x6f3c('0x3b')]);_0x38d19d['where']=qs['filters'](_[_0x6f3c('0x50')](_0x25a0d4[_0x6f3c('0x33')],_0x3be43a['filters']));if(_0x25a0d4['query'][_0x6f3c('0x3e')]){_0x38d19d[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x38d19d[_0x6f3c('0x3c')],{'$or':_['map'](_0x38d19d['attributes'],function(_0x50b6a0){var _0x1fcef1={};_0x1fcef1[_0x50b6a0]={'$like':'%'+_0x25a0d4[_0x6f3c('0x33')][_0x6f3c('0x3e')]+'%'};return _0x1fcef1;})});}_0x38d19d=_[_0x6f3c('0x3f')]({},_0x38d19d,_0x25a0d4[_0x6f3c('0x41')]);return _0x3a17a9['getSubjects'](_0x38d19d);}})[_0x6f3c('0x28')](function(_0x18b55f){if(_0x18b55f){_0x3610f5=_0x18b55f[_0x6f3c('0x49')];if(!_0x25a0d4[_0x6f3c('0x33')]['hasOwnProperty']('nolimit')){_0x38d19d['limit']=qs[_0x6f3c('0x21')](_0x25a0d4[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x38d19d[_0x6f3c('0x1f')]=qs['offset'](_0x25a0d4['query'][_0x6f3c('0x1f')]);}return _0x3a17a9['getSubjects'](_0x38d19d);}})['then'](function(_0x589396){if(_0x589396){return _0x589396?{'count':_0x3610f5,'rows':_0x589396}:null;}})[_0x6f3c('0x28')](respondWithResult(_0x4f374b,null))[_0x6f3c('0x46')](handleError(_0x4f374b,null));};exports[_0x6f3c('0x53')]=function(_0x2e5093,_0x3262c9,_0x283d42){var _0x1fb4a6={};var _0x351c0e={};var _0x3d4e9a;var _0x557b12;return db[_0x6f3c('0x2e')][_0x6f3c('0x4e')]({'where':{'id':_0x2e5093['params']['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x3262c9,null))[_0x6f3c('0x28')](function(_0x3568d4){if(_0x3568d4){_0x3d4e9a=_0x3568d4;_0x351c0e[_0x6f3c('0x36')]=_[_0x6f3c('0x34')](db[_0x6f3c('0x4f')]['rawAttributes']);_0x351c0e[_0x6f3c('0x33')]=_[_0x6f3c('0x34')](_0x2e5093[_0x6f3c('0x33')]);_0x351c0e['filters']=_[_0x6f3c('0x35')](_0x351c0e[_0x6f3c('0x36')],_0x351c0e['query']);_0x1fb4a6[_0x6f3c('0x38')]=_['intersection'](_0x351c0e[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x2e5093[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x1fb4a6[_0x6f3c('0x38')]=_0x1fb4a6['attributes'][_0x6f3c('0x49')]?_0x1fb4a6[_0x6f3c('0x38')]:_0x351c0e[_0x6f3c('0x36')];_0x1fb4a6['order']=qs[_0x6f3c('0x3b')](_0x2e5093[_0x6f3c('0x33')]['sort']);_0x1fb4a6[_0x6f3c('0x3c')]=qs[_0x6f3c('0x3d')](_['pick'](_0x2e5093[_0x6f3c('0x33')],_0x351c0e[_0x6f3c('0x3d')]));if(_0x2e5093[_0x6f3c('0x33')][_0x6f3c('0x3e')]){_0x1fb4a6[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x1fb4a6['where'],{'$or':_[_0x6f3c('0x2d')](_0x1fb4a6[_0x6f3c('0x38')],function(_0x2390f7){var _0x35b5c2={};_0x35b5c2[_0x2390f7]={'$like':'%'+_0x2e5093['query'][_0x6f3c('0x3e')]+'%'};return _0x35b5c2;})});}_0x1fb4a6=_[_0x6f3c('0x3f')]({},_0x1fb4a6,_0x2e5093[_0x6f3c('0x41')]);return _0x3d4e9a[_0x6f3c('0x53')](_0x1fb4a6);}})[_0x6f3c('0x28')](function(_0x4edc07){if(_0x4edc07){_0x557b12=_0x4edc07['length'];if(!_0x2e5093[_0x6f3c('0x33')]['hasOwnProperty'](_0x6f3c('0x39'))){_0x1fb4a6[_0x6f3c('0x21')]=qs[_0x6f3c('0x21')](_0x2e5093[_0x6f3c('0x33')]['limit']);_0x1fb4a6[_0x6f3c('0x1f')]=qs[_0x6f3c('0x1f')](_0x2e5093['query'][_0x6f3c('0x1f')]);}return _0x3d4e9a[_0x6f3c('0x53')](_0x1fb4a6);}})['then'](function(_0x14fda8){if(_0x14fda8){return _0x14fda8?{'count':_0x557b12,'rows':_0x14fda8}:null;}})['then'](respondWithResult(_0x3262c9,null))[_0x6f3c('0x46')](handleError(_0x3262c9,null));};exports[_0x6f3c('0x54')]=function(_0x5dacab,_0x222d7c,_0x2db8cc){var _0x49f1cc={};var _0x587401={};var _0x53a8cb;var _0x564bab;return db[_0x6f3c('0x2e')][_0x6f3c('0x4e')]({'where':{'id':_0x5dacab[_0x6f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x222d7c,null))[_0x6f3c('0x28')](function(_0x111760){if(_0x111760){_0x53a8cb=_0x111760;_0x587401['model']=_['keys'](db['Tag'][_0x6f3c('0x2f')]);_0x587401['query']=_[_0x6f3c('0x34')](_0x5dacab[_0x6f3c('0x33')]);_0x587401[_0x6f3c('0x3d')]=_['intersection'](_0x587401['model'],_0x587401[_0x6f3c('0x33')]);_0x49f1cc['attributes']=_[_0x6f3c('0x35')](_0x587401[_0x6f3c('0x36')],qs[_0x6f3c('0x37')](_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x37')]));_0x49f1cc['attributes']=_0x49f1cc[_0x6f3c('0x38')][_0x6f3c('0x49')]?_0x49f1cc['attributes']:_0x587401[_0x6f3c('0x36')];_0x49f1cc[_0x6f3c('0x3a')]=qs[_0x6f3c('0x3b')](_0x5dacab[_0x6f3c('0x33')]['sort']);_0x49f1cc[_0x6f3c('0x3c')]=qs['filters'](_[_0x6f3c('0x50')](_0x5dacab[_0x6f3c('0x33')],_0x587401[_0x6f3c('0x3d')]));if(_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x3e')]){_0x49f1cc[_0x6f3c('0x3c')]=_[_0x6f3c('0x3f')](_0x49f1cc[_0x6f3c('0x3c')],{'$or':_[_0x6f3c('0x2d')](_0x49f1cc[_0x6f3c('0x38')],function(_0x5b1409){var _0x5db73f={};_0x5db73f[_0x5b1409]={'$like':'%'+_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x3e')]+'%'};return _0x5db73f;})});}_0x49f1cc=_[_0x6f3c('0x3f')]({},_0x49f1cc,_0x5dacab['options']);return _0x53a8cb['getTags'](_0x49f1cc);}})['then'](function(_0x8fc22e){if(_0x8fc22e){_0x564bab=_0x8fc22e[_0x6f3c('0x49')];if(!_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x51')](_0x6f3c('0x39'))){_0x49f1cc[_0x6f3c('0x21')]=qs[_0x6f3c('0x21')](_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x21')]);_0x49f1cc[_0x6f3c('0x1f')]=qs[_0x6f3c('0x1f')](_0x5dacab[_0x6f3c('0x33')][_0x6f3c('0x1f')]);}return _0x53a8cb['getTags'](_0x49f1cc);}})[_0x6f3c('0x28')](function(_0x48f614){if(_0x48f614){return _0x48f614?{'count':_0x564bab,'rows':_0x48f614}:null;}})[_0x6f3c('0x28')](respondWithResult(_0x222d7c,null))['catch'](handleError(_0x222d7c,null));};exports[_0x6f3c('0x55')]=function(_0x57d3aa,_0x58e19c,_0x1a2964){if(_0x57d3aa[_0x6f3c('0x4b')]['id']){delete _0x57d3aa['body']['id'];}return db['FreshdeskConfiguration'][_0x6f3c('0x4e')]({'where':{'id':_0x57d3aa[_0x6f3c('0x48')]['id']}})[_0x6f3c('0x28')](handleEntityNotFound(_0x58e19c,null))[_0x6f3c('0x28')](function(_0x3dac2b){if(_0x3dac2b){return _0x3dac2b[_0x6f3c('0x55')](_0x57d3aa[_0x6f3c('0x4b')][_0x6f3c('0x56')]||[]);}return null;})[_0x6f3c('0x28')](respondWithResult(_0x58e19c,null))['catch'](handleError(_0x58e19c,null));}; \ No newline at end of file +var _0x3b4f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids'];(function(_0x4f88fe,_0x142997){var _0x52bbc0=function(_0xf1b466){while(--_0xf1b466){_0x4f88fe['push'](_0x4f88fe['shift']());}};_0x52bbc0(++_0x142997);}(_0x3b4f,0x1bd));var _0xf3b4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3b4f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf3b4('0x0'));var rimraf=require(_0xf3b4('0x1'));var zipdir=require(_0xf3b4('0x2'));var jsonpatch=require(_0xf3b4('0x3'));var rp=require(_0xf3b4('0x4'));var moment=require(_0xf3b4('0x5'));var BPromise=require(_0xf3b4('0x6'));var Mustache=require('mustache');var util=require(_0xf3b4('0x7'));var path=require(_0xf3b4('0x8'));var sox=require(_0xf3b4('0x9'));var csv=require(_0xf3b4('0xa'));var ejs=require(_0xf3b4('0xb'));var fs=require('fs');var fs_extra=require(_0xf3b4('0xc'));var _=require('lodash');var squel=require(_0xf3b4('0xd'));var crypto=require(_0xf3b4('0xe'));var jsforce=require(_0xf3b4('0xf'));var deskjs=require(_0xf3b4('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf3b4('0x11'));var Papa=require(_0xf3b4('0x12'));var Redis=require('ioredis');var authService=require(_0xf3b4('0x13'));var qs=require(_0xf3b4('0x14'));var as=require(_0xf3b4('0x15'));var hardwareService=require(_0xf3b4('0x16'));var logger=require('../../config/logger')(_0xf3b4('0x17'));var utils=require(_0xf3b4('0x18'));var config=require(_0xf3b4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3b4('0x1a'))['db'];function respondWithStatusCode(_0x561d1e,_0x4c363d){_0x4c363d=_0x4c363d||0xcc;return function(_0x4caea8){if(_0x4caea8){return _0x561d1e[_0xf3b4('0x1b')](_0x4c363d);}return _0x561d1e[_0xf3b4('0x1c')](_0x4c363d)['end']();};}function respondWithResult(_0x4589c,_0xf33b8){_0xf33b8=_0xf33b8||0xc8;return function(_0x37b1fe){if(_0x37b1fe){return _0x4589c[_0xf3b4('0x1c')](_0xf33b8)['json'](_0x37b1fe);}};}function respondWithFilteredResult(_0x439408,_0x2060f9){return function(_0x47c188){if(_0x47c188){var _0x205c0d=typeof _0x2060f9[_0xf3b4('0x1d')]===_0xf3b4('0x1e')&&typeof _0x2060f9['limit']===_0xf3b4('0x1e');var _0x1bb350=_0x47c188[_0xf3b4('0x1f')];var _0x2e3021=_0x205c0d?0x0:_0x2060f9['offset'];var _0x4e54cf=_0x205c0d?_0x47c188[_0xf3b4('0x1f')]:_0x2060f9['offset']+_0x2060f9[_0xf3b4('0x20')];var _0x11244d;if(_0x4e54cf>=_0x1bb350){_0x4e54cf=_0x1bb350;_0x11244d=0xc8;}else{_0x11244d=0xce;}_0x439408['status'](_0x11244d);return _0x439408[_0xf3b4('0x21')](_0xf3b4('0x22'),_0x2e3021+'-'+_0x4e54cf+'/'+_0x1bb350)[_0xf3b4('0x23')](_0x47c188);}return null;};}function patchUpdates(_0x3eaf2e){return function(_0x4d8611){try{jsonpatch[_0xf3b4('0x24')](_0x4d8611,_0x3eaf2e,!![]);}catch(_0x442fdc){return BPromise[_0xf3b4('0x25')](_0x442fdc);}return _0x4d8611[_0xf3b4('0x26')]();};}function saveUpdates(_0x1c8f18,_0x22abf1){return function(_0x3d07a9){if(_0x3d07a9){return _0x3d07a9[_0xf3b4('0x27')](_0x1c8f18)[_0xf3b4('0x28')](function(_0x4e8482){return _0x4e8482;});}return null;};}function removeEntity(_0x4a58f8,_0x25b216){return function(_0x3037b0){if(_0x3037b0){return _0x3037b0['destroy']()[_0xf3b4('0x28')](function(){_0x4a58f8[_0xf3b4('0x1c')](0xcc)[_0xf3b4('0x29')]();});}};}function handleEntityNotFound(_0x2d039b,_0x3459c3){return function(_0x43cfe0){if(!_0x43cfe0){_0x2d039b['sendStatus'](0x194);}return _0x43cfe0;};}function handleError(_0x5b6d01,_0x43626f){_0x43626f=_0x43626f||0x1f4;return function(_0x2c561a){logger[_0xf3b4('0x2a')](_0x2c561a['stack']);if(_0x2c561a['name']){delete _0x2c561a[_0xf3b4('0x2b')];}_0x5b6d01['status'](_0x43626f)[_0xf3b4('0x2c')](_0x2c561a);};}exports[_0xf3b4('0x2d')]=function(_0x4ccda5,_0x5805a2){var _0x46d023={},_0x1698e7={},_0x26f1e7={'count':0x0,'rows':[]};var _0x467026=_[_0xf3b4('0x2e')](db[_0xf3b4('0x2f')][_0xf3b4('0x30')],function(_0x16dd21){return{'name':_0x16dd21[_0xf3b4('0x31')],'type':_0x16dd21[_0xf3b4('0x32')][_0xf3b4('0x33')]};});_0x1698e7[_0xf3b4('0x34')]=_[_0xf3b4('0x2e')](_0x467026,_0xf3b4('0x2b'));_0x1698e7[_0xf3b4('0x35')]=_[_0xf3b4('0x36')](_0x4ccda5[_0xf3b4('0x35')]);_0x1698e7['filters']=_['intersection'](_0x1698e7[_0xf3b4('0x34')],_0x1698e7['query']);_0x46d023[_0xf3b4('0x37')]=_[_0xf3b4('0x38')](_0x1698e7[_0xf3b4('0x34')],qs[_0xf3b4('0x39')](_0x4ccda5[_0xf3b4('0x35')][_0xf3b4('0x39')]));_0x46d023[_0xf3b4('0x37')]=_0x46d023[_0xf3b4('0x37')][_0xf3b4('0x3a')]?_0x46d023[_0xf3b4('0x37')]:_0x1698e7['model'];if(!_0x4ccda5[_0xf3b4('0x35')]['hasOwnProperty'](_0xf3b4('0x3b'))){_0x46d023['limit']=qs[_0xf3b4('0x20')](_0x4ccda5['query'][_0xf3b4('0x20')]);_0x46d023[_0xf3b4('0x1d')]=qs['offset'](_0x4ccda5[_0xf3b4('0x35')]['offset']);}_0x46d023[_0xf3b4('0x3c')]=qs[_0xf3b4('0x3d')](_0x4ccda5['query'][_0xf3b4('0x3d')]);_0x46d023[_0xf3b4('0x3e')]=qs['filters'](_[_0xf3b4('0x3f')](_0x4ccda5[_0xf3b4('0x35')],_0x1698e7[_0xf3b4('0x40')]),_0x467026);if(_0x4ccda5[_0xf3b4('0x35')][_0xf3b4('0x41')]){_0x46d023[_0xf3b4('0x3e')]=_[_0xf3b4('0x42')](_0x46d023['where'],{'$or':_[_0xf3b4('0x2e')](_0x467026,function(_0x525a3f){if(_0x525a3f[_0xf3b4('0x32')]!=='VIRTUAL'){var _0x328465={};_0x328465[_0x525a3f[_0xf3b4('0x2b')]]={'$like':'%'+_0x4ccda5['query'][_0xf3b4('0x41')]+'%'};return _0x328465;}})});}_0x46d023=_['merge']({},_0x46d023,_0x4ccda5[_0xf3b4('0x43')]);var _0x4fb499={'where':_0x46d023['where']};return db['FreshdeskConfiguration'][_0xf3b4('0x1f')](_0x4fb499)[_0xf3b4('0x28')](function(_0x16cf3f){_0x26f1e7[_0xf3b4('0x1f')]=_0x16cf3f;if(_0x4ccda5[_0xf3b4('0x35')][_0xf3b4('0x44')]){_0x46d023['include']=[{'all':!![]}];}return db[_0xf3b4('0x2f')][_0xf3b4('0x45')](_0x46d023);})[_0xf3b4('0x28')](function(_0x25db70){_0x26f1e7[_0xf3b4('0x46')]=_0x25db70;return _0x26f1e7;})['then'](respondWithFilteredResult(_0x5805a2,_0x46d023))[_0xf3b4('0x47')](handleError(_0x5805a2,null));};exports[_0xf3b4('0x48')]=function(_0x2ce4ec,_0x4ee7b3){var _0x36158e={'raw':![],'where':{'id':_0x2ce4ec[_0xf3b4('0x49')]['id']}},_0x367d1b={};_0x367d1b['model']=_[_0xf3b4('0x36')](db[_0xf3b4('0x2f')][_0xf3b4('0x30')]);_0x367d1b[_0xf3b4('0x35')]=_['keys'](_0x2ce4ec['query']);_0x367d1b[_0xf3b4('0x40')]=_[_0xf3b4('0x38')](_0x367d1b[_0xf3b4('0x34')],_0x367d1b['query']);_0x36158e[_0xf3b4('0x37')]=_[_0xf3b4('0x38')](_0x367d1b[_0xf3b4('0x34')],qs[_0xf3b4('0x39')](_0x2ce4ec[_0xf3b4('0x35')][_0xf3b4('0x39')]));_0x36158e[_0xf3b4('0x37')]=_0x36158e[_0xf3b4('0x37')]['length']?_0x36158e[_0xf3b4('0x37')]:_0x367d1b[_0xf3b4('0x34')];if(_0x2ce4ec[_0xf3b4('0x35')]['includeAll']){_0x36158e[_0xf3b4('0x4a')]=[{'all':!![]}];}_0x36158e=_['merge']({},_0x36158e,_0x2ce4ec[_0xf3b4('0x43')]);return db['FreshdeskConfiguration']['find'](_0x36158e)[_0xf3b4('0x28')](handleEntityNotFound(_0x4ee7b3,null))[_0xf3b4('0x28')](respondWithResult(_0x4ee7b3,null))[_0xf3b4('0x47')](handleError(_0x4ee7b3,null));};exports['create']=function(_0x8e595b,_0x547b0e){return db[_0xf3b4('0x2f')][_0xf3b4('0x4b')](_0x8e595b[_0xf3b4('0x4c')],{})['then'](respondWithResult(_0x547b0e,0xc9))[_0xf3b4('0x47')](handleError(_0x547b0e,null));};exports['update']=function(_0x3587e2,_0x3fc95b){if(_0x3587e2[_0xf3b4('0x4c')]['id']){delete _0x3587e2[_0xf3b4('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0xf3b4('0x4d')]({'where':{'id':_0x3587e2[_0xf3b4('0x49')]['id']}})[_0xf3b4('0x28')](handleEntityNotFound(_0x3fc95b,null))[_0xf3b4('0x28')](saveUpdates(_0x3587e2[_0xf3b4('0x4c')],null))[_0xf3b4('0x28')](respondWithResult(_0x3fc95b,null))[_0xf3b4('0x47')](handleError(_0x3fc95b,null));};exports[_0xf3b4('0x4e')]=function(_0x1ad7f9,_0x5342c2){return db['FreshdeskConfiguration'][_0xf3b4('0x4d')]({'where':{'id':_0x1ad7f9['params']['id']}})[_0xf3b4('0x28')](handleEntityNotFound(_0x5342c2,null))[_0xf3b4('0x28')](removeEntity(_0x5342c2,null))[_0xf3b4('0x47')](handleError(_0x5342c2,null));};exports[_0xf3b4('0x4f')]=function(_0x53fc5e,_0x2ed132,_0x1ed361){var _0x2e573c={};var _0x833149={};var _0x1e7aee;var _0x2006e3;return db[_0xf3b4('0x2f')][_0xf3b4('0x50')]({'where':{'id':_0x53fc5e[_0xf3b4('0x49')]['id']}})[_0xf3b4('0x28')](handleEntityNotFound(_0x2ed132,null))[_0xf3b4('0x28')](function(_0x52d1cd){if(_0x52d1cd){_0x1e7aee=_0x52d1cd;_0x833149[_0xf3b4('0x34')]=_['keys'](db[_0xf3b4('0x51')][_0xf3b4('0x30')]);_0x833149[_0xf3b4('0x35')]=_[_0xf3b4('0x36')](_0x53fc5e[_0xf3b4('0x35')]);_0x833149[_0xf3b4('0x40')]=_['intersection'](_0x833149['model'],_0x833149[_0xf3b4('0x35')]);_0x2e573c[_0xf3b4('0x37')]=_[_0xf3b4('0x38')](_0x833149['model'],qs[_0xf3b4('0x39')](_0x53fc5e[_0xf3b4('0x35')][_0xf3b4('0x39')]));_0x2e573c['attributes']=_0x2e573c[_0xf3b4('0x37')][_0xf3b4('0x3a')]?_0x2e573c[_0xf3b4('0x37')]:_0x833149[_0xf3b4('0x34')];_0x2e573c[_0xf3b4('0x3c')]=qs[_0xf3b4('0x3d')](_0x53fc5e[_0xf3b4('0x35')][_0xf3b4('0x3d')]);_0x2e573c[_0xf3b4('0x3e')]=qs[_0xf3b4('0x40')](_['pick'](_0x53fc5e[_0xf3b4('0x35')],_0x833149[_0xf3b4('0x40')]));if(_0x53fc5e[_0xf3b4('0x35')][_0xf3b4('0x41')]){_0x2e573c[_0xf3b4('0x3e')]=_['merge'](_0x2e573c[_0xf3b4('0x3e')],{'$or':_[_0xf3b4('0x2e')](_0x2e573c[_0xf3b4('0x37')],function(_0xda7a60){var _0x4bc70a={};_0x4bc70a[_0xda7a60]={'$like':'%'+_0x53fc5e[_0xf3b4('0x35')]['filter']+'%'};return _0x4bc70a;})});}_0x2e573c=_[_0xf3b4('0x42')]({},_0x2e573c,_0x53fc5e[_0xf3b4('0x43')]);return _0x1e7aee[_0xf3b4('0x4f')](_0x2e573c);}})['then'](function(_0x3d9429){if(_0x3d9429){_0x2006e3=_0x3d9429[_0xf3b4('0x3a')];if(!_0x53fc5e[_0xf3b4('0x35')][_0xf3b4('0x52')](_0xf3b4('0x3b'))){_0x2e573c['limit']=qs[_0xf3b4('0x20')](_0x53fc5e[_0xf3b4('0x35')]['limit']);_0x2e573c[_0xf3b4('0x1d')]=qs[_0xf3b4('0x1d')](_0x53fc5e['query']['offset']);}return _0x1e7aee[_0xf3b4('0x4f')](_0x2e573c);}})[_0xf3b4('0x28')](function(_0x575321){if(_0x575321){return _0x575321?{'count':_0x2006e3,'rows':_0x575321}:null;}})[_0xf3b4('0x28')](respondWithResult(_0x2ed132,null))[_0xf3b4('0x47')](handleError(_0x2ed132,null));};exports[_0xf3b4('0x53')]=function(_0x3ce2e1,_0x27370d,_0x1cc479){var _0x1cbaaf={};var _0x5757ce={};var _0xcdb92c;var _0x424c97;return db[_0xf3b4('0x2f')][_0xf3b4('0x50')]({'where':{'id':_0x3ce2e1[_0xf3b4('0x49')]['id']}})[_0xf3b4('0x28')](handleEntityNotFound(_0x27370d,null))['then'](function(_0x4fc621){if(_0x4fc621){_0xcdb92c=_0x4fc621;_0x5757ce[_0xf3b4('0x34')]=_[_0xf3b4('0x36')](db[_0xf3b4('0x51')]['rawAttributes']);_0x5757ce['query']=_[_0xf3b4('0x36')](_0x3ce2e1['query']);_0x5757ce[_0xf3b4('0x40')]=_[_0xf3b4('0x38')](_0x5757ce[_0xf3b4('0x34')],_0x5757ce['query']);_0x1cbaaf[_0xf3b4('0x37')]=_[_0xf3b4('0x38')](_0x5757ce[_0xf3b4('0x34')],qs['fields'](_0x3ce2e1['query']['fields']));_0x1cbaaf[_0xf3b4('0x37')]=_0x1cbaaf[_0xf3b4('0x37')][_0xf3b4('0x3a')]?_0x1cbaaf['attributes']:_0x5757ce['model'];_0x1cbaaf[_0xf3b4('0x3c')]=qs['sort'](_0x3ce2e1['query'][_0xf3b4('0x3d')]);_0x1cbaaf[_0xf3b4('0x3e')]=qs[_0xf3b4('0x40')](_['pick'](_0x3ce2e1[_0xf3b4('0x35')],_0x5757ce['filters']));if(_0x3ce2e1[_0xf3b4('0x35')][_0xf3b4('0x41')]){_0x1cbaaf[_0xf3b4('0x3e')]=_[_0xf3b4('0x42')](_0x1cbaaf[_0xf3b4('0x3e')],{'$or':_['map'](_0x1cbaaf[_0xf3b4('0x37')],function(_0x56d7f4){var _0x26dbef={};_0x26dbef[_0x56d7f4]={'$like':'%'+_0x3ce2e1['query'][_0xf3b4('0x41')]+'%'};return _0x26dbef;})});}_0x1cbaaf=_[_0xf3b4('0x42')]({},_0x1cbaaf,_0x3ce2e1[_0xf3b4('0x43')]);return _0xcdb92c[_0xf3b4('0x53')](_0x1cbaaf);}})[_0xf3b4('0x28')](function(_0x4b770e){if(_0x4b770e){_0x424c97=_0x4b770e['length'];if(!_0x3ce2e1['query'][_0xf3b4('0x52')](_0xf3b4('0x3b'))){_0x1cbaaf[_0xf3b4('0x20')]=qs[_0xf3b4('0x20')](_0x3ce2e1[_0xf3b4('0x35')][_0xf3b4('0x20')]);_0x1cbaaf['offset']=qs[_0xf3b4('0x1d')](_0x3ce2e1[_0xf3b4('0x35')][_0xf3b4('0x1d')]);}return _0xcdb92c[_0xf3b4('0x53')](_0x1cbaaf);}})[_0xf3b4('0x28')](function(_0x1feecd){if(_0x1feecd){return _0x1feecd?{'count':_0x424c97,'rows':_0x1feecd}:null;}})['then'](respondWithResult(_0x27370d,null))[_0xf3b4('0x47')](handleError(_0x27370d,null));};exports['getDescriptions']=function(_0x3bf997,_0x2260e3,_0x4ccdfb){var _0x5c5af6={};var _0x874338={};var _0xd30366;var _0x55021d;return db[_0xf3b4('0x2f')][_0xf3b4('0x50')]({'where':{'id':_0x3bf997[_0xf3b4('0x49')]['id']}})[_0xf3b4('0x28')](handleEntityNotFound(_0x2260e3,null))[_0xf3b4('0x28')](function(_0x32bf60){if(_0x32bf60){_0xd30366=_0x32bf60;_0x874338['model']=_['keys'](db['FreshdeskField'][_0xf3b4('0x30')]);_0x874338[_0xf3b4('0x35')]=_[_0xf3b4('0x36')](_0x3bf997['query']);_0x874338[_0xf3b4('0x40')]=_[_0xf3b4('0x38')](_0x874338['model'],_0x874338[_0xf3b4('0x35')]);_0x5c5af6[_0xf3b4('0x37')]=_[_0xf3b4('0x38')](_0x874338[_0xf3b4('0x34')],qs[_0xf3b4('0x39')](_0x3bf997[_0xf3b4('0x35')][_0xf3b4('0x39')]));_0x5c5af6[_0xf3b4('0x37')]=_0x5c5af6[_0xf3b4('0x37')][_0xf3b4('0x3a')]?_0x5c5af6['attributes']:_0x874338[_0xf3b4('0x34')];_0x5c5af6[_0xf3b4('0x3c')]=qs['sort'](_0x3bf997[_0xf3b4('0x35')][_0xf3b4('0x3d')]);_0x5c5af6['where']=qs[_0xf3b4('0x40')](_['pick'](_0x3bf997[_0xf3b4('0x35')],_0x874338[_0xf3b4('0x40')]));if(_0x3bf997['query'][_0xf3b4('0x41')]){_0x5c5af6['where']=_[_0xf3b4('0x42')](_0x5c5af6[_0xf3b4('0x3e')],{'$or':_[_0xf3b4('0x2e')](_0x5c5af6[_0xf3b4('0x37')],function(_0xfb8e79){var _0x510346={};_0x510346[_0xfb8e79]={'$like':'%'+_0x3bf997[_0xf3b4('0x35')][_0xf3b4('0x41')]+'%'};return _0x510346;})});}_0x5c5af6=_['merge']({},_0x5c5af6,_0x3bf997['options']);return _0xd30366[_0xf3b4('0x54')](_0x5c5af6);}})['then'](function(_0x62f81e){if(_0x62f81e){_0x55021d=_0x62f81e[_0xf3b4('0x3a')];if(!_0x3bf997[_0xf3b4('0x35')][_0xf3b4('0x52')]('nolimit')){_0x5c5af6[_0xf3b4('0x20')]=qs[_0xf3b4('0x20')](_0x3bf997[_0xf3b4('0x35')][_0xf3b4('0x20')]);_0x5c5af6[_0xf3b4('0x1d')]=qs['offset'](_0x3bf997[_0xf3b4('0x35')][_0xf3b4('0x1d')]);}return _0xd30366[_0xf3b4('0x54')](_0x5c5af6);}})[_0xf3b4('0x28')](function(_0x565f52){if(_0x565f52){return _0x565f52?{'count':_0x55021d,'rows':_0x565f52}:null;}})[_0xf3b4('0x28')](respondWithResult(_0x2260e3,null))[_0xf3b4('0x47')](handleError(_0x2260e3,null));};exports[_0xf3b4('0x55')]=function(_0x21209f,_0x1cc313,_0x32f321){var _0x26e577={};var _0x1095b9={};var _0x854f6b;var _0x241c18;return db[_0xf3b4('0x2f')][_0xf3b4('0x50')]({'where':{'id':_0x21209f[_0xf3b4('0x49')]['id']}})[_0xf3b4('0x28')](handleEntityNotFound(_0x1cc313,null))[_0xf3b4('0x28')](function(_0x2617b3){if(_0x2617b3){_0x854f6b=_0x2617b3;_0x1095b9['model']=_[_0xf3b4('0x36')](db[_0xf3b4('0x56')]['rawAttributes']);_0x1095b9[_0xf3b4('0x35')]=_[_0xf3b4('0x36')](_0x21209f['query']);_0x1095b9[_0xf3b4('0x40')]=_[_0xf3b4('0x38')](_0x1095b9[_0xf3b4('0x34')],_0x1095b9[_0xf3b4('0x35')]);_0x26e577[_0xf3b4('0x37')]=_[_0xf3b4('0x38')](_0x1095b9[_0xf3b4('0x34')],qs[_0xf3b4('0x39')](_0x21209f[_0xf3b4('0x35')]['fields']));_0x26e577['attributes']=_0x26e577[_0xf3b4('0x37')]['length']?_0x26e577[_0xf3b4('0x37')]:_0x1095b9['model'];_0x26e577['order']=qs[_0xf3b4('0x3d')](_0x21209f[_0xf3b4('0x35')]['sort']);_0x26e577['where']=qs[_0xf3b4('0x40')](_[_0xf3b4('0x3f')](_0x21209f[_0xf3b4('0x35')],_0x1095b9['filters']));if(_0x21209f['query']['filter']){_0x26e577[_0xf3b4('0x3e')]=_[_0xf3b4('0x42')](_0x26e577[_0xf3b4('0x3e')],{'$or':_[_0xf3b4('0x2e')](_0x26e577[_0xf3b4('0x37')],function(_0x31f473){var _0x3d85ae={};_0x3d85ae[_0x31f473]={'$like':'%'+_0x21209f[_0xf3b4('0x35')][_0xf3b4('0x41')]+'%'};return _0x3d85ae;})});}_0x26e577=_[_0xf3b4('0x42')]({},_0x26e577,_0x21209f[_0xf3b4('0x43')]);return _0x854f6b[_0xf3b4('0x55')](_0x26e577);}})[_0xf3b4('0x28')](function(_0x3d6c0f){if(_0x3d6c0f){_0x241c18=_0x3d6c0f[_0xf3b4('0x3a')];if(!_0x21209f[_0xf3b4('0x35')][_0xf3b4('0x52')](_0xf3b4('0x3b'))){_0x26e577[_0xf3b4('0x20')]=qs[_0xf3b4('0x20')](_0x21209f[_0xf3b4('0x35')][_0xf3b4('0x20')]);_0x26e577['offset']=qs[_0xf3b4('0x1d')](_0x21209f[_0xf3b4('0x35')][_0xf3b4('0x1d')]);}return _0x854f6b[_0xf3b4('0x55')](_0x26e577);}})[_0xf3b4('0x28')](function(_0x377f6d){if(_0x377f6d){return _0x377f6d?{'count':_0x241c18,'rows':_0x377f6d}:null;}})[_0xf3b4('0x28')](respondWithResult(_0x1cc313,null))[_0xf3b4('0x47')](handleError(_0x1cc313,null));};exports[_0xf3b4('0x57')]=function(_0x3e68b3,_0x2a8134,_0x4c0499){if(_0x3e68b3[_0xf3b4('0x4c')]['id']){delete _0x3e68b3['body']['id'];}return db[_0xf3b4('0x2f')]['findOne']({'where':{'id':_0x3e68b3['params']['id']}})['then'](handleEntityNotFound(_0x2a8134,null))[_0xf3b4('0x28')](function(_0x20e138){if(_0x20e138){return _0x20e138[_0xf3b4('0x57')](_0x3e68b3[_0xf3b4('0x4c')][_0xf3b4('0x58')]||[]);}return null;})[_0xf3b4('0x28')](respondWithResult(_0x2a8134,null))[_0xf3b4('0x47')](handleError(_0x2a8134,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d599b71..2c9c86a 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 _0x87fb=['util','api','moment','request-promise','path','rimraf','exports','define','FreshdeskConfiguration','lodash'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x87fb,0x103));var _0xb87f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x87fb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb87f('0x0'));var util=require(_0xb87f('0x1'));var logger=require('../../config/logger')(_0xb87f('0x2'));var moment=require(_0xb87f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb87f('0x4'));var fs=require('fs');var path=require(_0xb87f('0x5'));var rimraf=require(_0xb87f('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xb87f('0x7')]=function(_0x342f4e,_0x4d7cb7){return _0x342f4e[_0xb87f('0x8')](_0xb87f('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6798=['request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0x6798,0x97));var _0x8679=function(_0x3525f3,_0x49aef4){_0x3525f3=_0x3525f3-0x0;var _0x3e3770=_0x6798[_0x3525f3];return _0x3e3770;};'use strict';var _=require(_0x8679('0x0'));var util=require(_0x8679('0x1'));var logger=require(_0x8679('0x2'))(_0x8679('0x3'));var moment=require(_0x8679('0x4'));var BPromise=require('bluebird');var rp=require(_0x8679('0x5'));var fs=require('fs');var path=require(_0x8679('0x6'));var rimraf=require(_0x8679('0x7'));var config=require('../../config/environment');var attributes=require(_0x8679('0x8'));module[_0x8679('0x9')]=function(_0x33b9a9,_0x8edf61){return _0x33b9a9[_0x8679('0xa')](_0x8679('0xb'),attributes,{'tableName':_0x8679('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index e6ee6fb..de9d522 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 _0x81fa=['FreshdeskConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x2e1046,_0x289069){var _0x2f76a5=function(_0x371eee){while(--_0x371eee){_0x2e1046['push'](_0x2e1046['shift']());}};_0x2f76a5(++_0x289069);}(_0x81fa,0x114));var _0xa81f=function(_0x5d054e,_0x19c2e0){_0x5d054e=_0x5d054e-0x0;var _0x28db29=_0x81fa[_0x5d054e];return _0x28db29;};'use strict';var _=require('lodash');var util=require(_0xa81f('0x0'));var moment=require(_0xa81f('0x1'));var BPromise=require(_0xa81f('0x2'));var rs=require(_0xa81f('0x3'));var fs=require('fs');var Redis=require(_0xa81f('0x4'));var db=require(_0xa81f('0x5'))['db'];var utils=require(_0xa81f('0x6'));var logger=require(_0xa81f('0x7'))('rpc');var config=require(_0xa81f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa81f('0x9')][_0xa81f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b0f4d,_0x5e1fda,_0x404a94){return new BPromise(function(_0x9705ca,_0x3be5f1){return client[_0xa81f('0xb')](_0x5b0f4d,_0x404a94)[_0xa81f('0xc')](function(_0x4f58d4){logger[_0xa81f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e1fda,_0xa81f('0xe'));logger[_0xa81f('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5e1fda,'request\x20sent',JSON['stringify'](_0x4f58d4));if(_0x4f58d4['error']){if(_0x4f58d4[_0xa81f('0x10')][_0xa81f('0x11')]===0x1f4){logger[_0xa81f('0x10')](_0xa81f('0x12'),_0x5e1fda,_0x4f58d4[_0xa81f('0x10')][_0xa81f('0x13')]);return _0x3be5f1(_0x4f58d4['error'][_0xa81f('0x13')]);}logger[_0xa81f('0x10')](_0xa81f('0x12'),_0x5e1fda,_0x4f58d4['error'][_0xa81f('0x13')]);return _0x9705ca(_0x4f58d4['error'][_0xa81f('0x13')]);}else{logger[_0xa81f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5e1fda,'request\x20sent');_0x9705ca(_0x4f58d4['result'][_0xa81f('0x13')]);}})[_0xa81f('0x14')](function(_0x4fac7f){logger[_0xa81f('0x10')](_0xa81f('0x12'),_0x5e1fda,_0x4fac7f);_0x3be5f1(_0x4fac7f);});});} \ No newline at end of file +var _0x6858=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','../../mysqldb'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x6858,0x10d));var _0x8685=function(_0x15f6a4,_0x40aecd){_0x15f6a4=_0x15f6a4-0x0;var _0x2bc869=_0x6858[_0x15f6a4];return _0x2bc869;};'use strict';var _=require(_0x8685('0x0'));var util=require(_0x8685('0x1'));var moment=require('moment');var BPromise=require(_0x8685('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8685('0x3'))['db'];var utils=require(_0x8685('0x4'));var logger=require(_0x8685('0x5'))(_0x8685('0x6'));var config=require(_0x8685('0x7'));var jayson=require(_0x8685('0x8'));var client=jayson[_0x8685('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x456bb9,_0x2a4dc8,_0x52c8fa){return new BPromise(function(_0x2971bc,_0x2e442b){return client[_0x8685('0xa')](_0x456bb9,_0x52c8fa)[_0x8685('0xb')](function(_0x35ae6){logger[_0x8685('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2a4dc8,_0x8685('0xd'));logger[_0x8685('0xe')](_0x8685('0xf'),_0x2a4dc8,_0x8685('0xd'),JSON[_0x8685('0x10')](_0x35ae6));if(_0x35ae6['error']){if(_0x35ae6['error']['code']===0x1f4){logger[_0x8685('0x11')](_0x8685('0x12'),_0x2a4dc8,_0x35ae6[_0x8685('0x11')][_0x8685('0x13')]);return _0x2e442b(_0x35ae6[_0x8685('0x11')][_0x8685('0x13')]);}logger[_0x8685('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2a4dc8,_0x35ae6[_0x8685('0x11')]['message']);return _0x2971bc(_0x35ae6[_0x8685('0x11')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2a4dc8,_0x8685('0xd'));_0x2971bc(_0x35ae6[_0x8685('0x14')][_0x8685('0x13')]);}})['catch'](function(_0x221eab){logger[_0x8685('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2a4dc8,_0x221eab);_0x2e442b(_0x221eab);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index f2da255..805dc5e 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 _0xdcaa=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','exports','util'];(function(_0x5ecca2,_0x28f9c4){var _0x226f66=function(_0x49adee){while(--_0x49adee){_0x5ecca2['push'](_0x5ecca2['shift']());}};_0x226f66(++_0x28f9c4);}(_0xdcaa,0x87));var _0xadca=function(_0x2aa4c1,_0x1e023a){_0x2aa4c1=_0x2aa4c1-0x0;var _0x439fe3=_0xdcaa[_0x2aa4c1];return _0x439fe3;};'use strict';var multer=require('multer');var util=require(_0xadca('0x0'));var path=require(_0xadca('0x1'));var timeout=require(_0xadca('0x2'));var express=require(_0xadca('0x3'));var router=express[_0xadca('0x4')]();var fs_extra=require(_0xadca('0x5'));var auth=require(_0xadca('0x6'));var interaction=require(_0xadca('0x7'));var config=require(_0xadca('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xadca('0x9')]('/',auth[_0xadca('0xa')](),controller[_0xadca('0xb')]);router[_0xadca('0x9')](_0xadca('0xc'),auth['isAuthenticated'](),controller[_0xadca('0xd')]);router[_0xadca('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xadca('0xc'),auth['isAuthenticated'](),controller[_0xadca('0xf')]);router['delete'](_0xadca('0xc'),auth[_0xadca('0xa')](),controller['destroy']);module[_0xadca('0x10')]=router; \ No newline at end of file +var _0x4527=['/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x47e93d,_0x26bbdd){var _0xe86c46=function(_0x10e072){while(--_0x10e072){_0x47e93d['push'](_0x47e93d['shift']());}};_0xe86c46(++_0x26bbdd);}(_0x4527,0xc5));var _0x7452=function(_0x404de1,_0x401a5f){_0x404de1=_0x404de1-0x0;var _0x43daa7=_0x4527[_0x404de1];return _0x43daa7;};'use strict';var multer=require(_0x7452('0x0'));var util=require(_0x7452('0x1'));var path=require(_0x7452('0x2'));var timeout=require(_0x7452('0x3'));var express=require('express');var router=express[_0x7452('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7452('0x5'));var interaction=require(_0x7452('0x6'));var config=require(_0x7452('0x7'));var controller=require(_0x7452('0x8'));router[_0x7452('0x9')]('/',auth[_0x7452('0xa')](),controller[_0x7452('0xb')]);router[_0x7452('0x9')](_0x7452('0xc'),auth[_0x7452('0xa')](),controller[_0x7452('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7452('0xe')]);router[_0x7452('0xf')](_0x7452('0xc'),auth['isAuthenticated'](),controller[_0x7452('0x10')]);router[_0x7452('0x11')](_0x7452('0xc'),auth[_0x7452('0xa')](),controller['destroy']);module[_0x7452('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 231157b..58a5a73 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 _0xe668=['ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','exports'];(function(_0x290a36,_0x561046){var _0xc59237=function(_0x5c0c52){while(--_0x5c0c52){_0x290a36['push'](_0x290a36['shift']());}};_0xc59237(++_0x561046);}(_0xe668,0x19f));var _0x8e66=function(_0x2c34ff,_0x1e8bee){_0x2c34ff=_0x2c34ff-0x0;var _0x476508=_0xe668[_0x2c34ff];return _0x476508;};'use strict';var Sequelize=require('sequelize');module[_0x8e66('0x0')]={'type':{'type':Sequelize[_0x8e66('0x1')]('string',_0x8e66('0x2'),_0x8e66('0x3'),_0x8e66('0x4'),'picklist'),'defaultValue':_0x8e66('0x5')},'content':{'type':Sequelize[_0x8e66('0x6')]},'key':{'type':Sequelize[_0x8e66('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x8e66('0x5'),_0x8e66('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x8e66('0x6')]},'idField':{'type':Sequelize[_0x8e66('0x6')]},'nameField':{'type':Sequelize[_0x8e66('0x6')]},'customField':{'type':Sequelize[_0x8e66('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x78be=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3b5f00,_0xa1466a){var _0x507e05=function(_0x579753){while(--_0x579753){_0x3b5f00['push'](_0x3b5f00['shift']());}};_0x507e05(++_0xa1466a);}(_0x78be,0x1ce));var _0xe78b=function(_0x4f4f3b,_0x25aa57){_0x4f4f3b=_0x4f4f3b-0x0;var _0x2c11d9=_0x78be[_0x4f4f3b];return _0x2c11d9;};'use strict';var Sequelize=require(_0xe78b('0x0'));module[_0xe78b('0x1')]={'type':{'type':Sequelize[_0xe78b('0x2')](_0xe78b('0x3'),_0xe78b('0x4'),_0xe78b('0x5'),'keyValue',_0xe78b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe78b('0x7')]},'key':{'type':Sequelize[_0xe78b('0x7')]},'keyType':{'type':Sequelize[_0xe78b('0x2')](_0xe78b('0x3'),_0xe78b('0x4'),_0xe78b('0x5'))},'keyContent':{'type':Sequelize[_0xe78b('0x7')]},'idField':{'type':Sequelize[_0xe78b('0x7')]},'nameField':{'type':Sequelize[_0xe78b('0x7')]},'customField':{'type':Sequelize[_0xe78b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe78b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7d52ab3..147d13e 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 _0x0102=['FreshdeskField','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','then','findAll','rows','catch','params','rawAttributes','intersection','include','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','sendStatus','error','stack','name','send','index','map'];(function(_0x23e3b0,_0x5f2901){var _0x13c675=function(_0x4be356){while(--_0x4be356){_0x23e3b0['push'](_0x23e3b0['shift']());}};_0x13c675(++_0x5f2901);}(_0x0102,0x186));var _0x2010=function(_0x65b8da,_0x125944){_0x65b8da=_0x65b8da-0x0;var _0x1ddad2=_0x0102[_0x65b8da];return _0x1ddad2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x52b4fe,_0x99ebe0){return function(_0x4cff59){if(!_0x4cff59){_0x52b4fe[_0x2010('0x23')](0x194);}return _0x4cff59;};}function handleError(_0x27b425,_0x3929d9){_0x3929d9=_0x3929d9||0x1f4;return function(_0x3dcea4){logger[_0x2010('0x24')](_0x3dcea4[_0x2010('0x25')]);if(_0x3dcea4[_0x2010('0x26')]){delete _0x3dcea4[_0x2010('0x26')];}_0x27b425[_0x2010('0x19')](_0x3929d9)[_0x2010('0x27')](_0x3dcea4);};}exports[_0x2010('0x28')]=function(_0x2ebdbb,_0x499cbe){var _0x2a4691={},_0x52fe5e={},_0x5b52fb={'count':0x0,'rows':[]};var _0x147a5a=_[_0x2010('0x29')](db[_0x2010('0x2a')]['rawAttributes'],function(_0x554f66){return{'name':_0x554f66[_0x2010('0x2b')],'type':_0x554f66['type'][_0x2010('0x2c')]};});_0x52fe5e[_0x2010('0x2d')]=_['map'](_0x147a5a,_0x2010('0x26'));_0x52fe5e[_0x2010('0x2e')]=_[_0x2010('0x2f')](_0x2ebdbb[_0x2010('0x2e')]);_0x52fe5e[_0x2010('0x30')]=_['intersection'](_0x52fe5e[_0x2010('0x2d')],_0x52fe5e[_0x2010('0x2e')]);_0x2a4691[_0x2010('0x31')]=_['intersection'](_0x52fe5e['model'],qs[_0x2010('0x32')](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x32')]));_0x2a4691['attributes']=_0x2a4691['attributes'][_0x2010('0x33')]?_0x2a4691[_0x2010('0x31')]:_0x52fe5e[_0x2010('0x2d')];if(!_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x34')]('nolimit')){_0x2a4691['limit']=qs['limit'](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x1d')]);_0x2a4691[_0x2010('0x1b')]=qs['offset'](_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x1b')]);}_0x2a4691[_0x2010('0x35')]=qs[_0x2010('0x36')](_0x2ebdbb['query'][_0x2010('0x36')]);_0x2a4691[_0x2010('0x37')]=qs[_0x2010('0x30')](_['pick'](_0x2ebdbb[_0x2010('0x2e')],_0x52fe5e['filters']),_0x147a5a);if(_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x38')]){_0x2a4691[_0x2010('0x37')]=_[_0x2010('0x39')](_0x2a4691[_0x2010('0x37')],{'$or':_[_0x2010('0x29')](_0x147a5a,function(_0x53c09e){if(_0x53c09e[_0x2010('0x3a')]!=='VIRTUAL'){var _0x3e5422={};_0x3e5422[_0x53c09e[_0x2010('0x26')]]={'$like':'%'+_0x2ebdbb[_0x2010('0x2e')][_0x2010('0x38')]+'%'};return _0x3e5422;}})});}_0x2a4691=_[_0x2010('0x39')]({},_0x2a4691,_0x2ebdbb[_0x2010('0x3b')]);var _0x398f10={'where':_0x2a4691[_0x2010('0x37')]};return db[_0x2010('0x2a')][_0x2010('0x1e')](_0x398f10)[_0x2010('0x3c')](function(_0x2f37ca){_0x5b52fb[_0x2010('0x1e')]=_0x2f37ca;if(_0x2ebdbb[_0x2010('0x2e')]['includeAll']){_0x2a4691['include']=[{'all':!![]}];}return db[_0x2010('0x2a')][_0x2010('0x3d')](_0x2a4691);})[_0x2010('0x3c')](function(_0x35d631){_0x5b52fb[_0x2010('0x3e')]=_0x35d631;return _0x5b52fb;})[_0x2010('0x3c')](respondWithFilteredResult(_0x499cbe,_0x2a4691))[_0x2010('0x3f')](handleError(_0x499cbe,null));};exports['show']=function(_0x392576,_0x578645){var _0x27fd64={'raw':!![],'where':{'id':_0x392576[_0x2010('0x40')]['id']}},_0x3ff496={};_0x3ff496[_0x2010('0x2d')]=_[_0x2010('0x2f')](db['FreshdeskField'][_0x2010('0x41')]);_0x3ff496[_0x2010('0x2e')]=_[_0x2010('0x2f')](_0x392576[_0x2010('0x2e')]);_0x3ff496['filters']=_[_0x2010('0x42')](_0x3ff496['model'],_0x3ff496['query']);_0x27fd64['attributes']=_[_0x2010('0x42')](_0x3ff496[_0x2010('0x2d')],qs[_0x2010('0x32')](_0x392576[_0x2010('0x2e')][_0x2010('0x32')]));_0x27fd64[_0x2010('0x31')]=_0x27fd64['attributes'][_0x2010('0x33')]?_0x27fd64[_0x2010('0x31')]:_0x3ff496[_0x2010('0x2d')];if(_0x392576['query']['includeAll']){_0x27fd64[_0x2010('0x43')]=[{'all':!![]}];}_0x27fd64=_['merge']({},_0x27fd64,_0x392576[_0x2010('0x3b')]);return db[_0x2010('0x2a')][_0x2010('0x44')](_0x27fd64)[_0x2010('0x3c')](handleEntityNotFound(_0x578645,null))['then'](respondWithResult(_0x578645,null))[_0x2010('0x3f')](handleError(_0x578645,null));};exports[_0x2010('0x45')]=function(_0x2e2703,_0x231db7){return db[_0x2010('0x2a')][_0x2010('0x45')](_0x2e2703['body'],{})[_0x2010('0x3c')](respondWithResult(_0x231db7,0xc9))[_0x2010('0x3f')](handleError(_0x231db7,null));};exports[_0x2010('0x46')]=function(_0x4dc0cf,_0x30e5d0){if(_0x4dc0cf[_0x2010('0x47')]['id']){delete _0x4dc0cf['body']['id'];}return db[_0x2010('0x2a')][_0x2010('0x44')]({'where':{'id':_0x4dc0cf[_0x2010('0x40')]['id']}})[_0x2010('0x3c')](handleEntityNotFound(_0x30e5d0,null))[_0x2010('0x3c')](saveUpdates(_0x4dc0cf[_0x2010('0x47')],null))[_0x2010('0x3c')](respondWithResult(_0x30e5d0,null))[_0x2010('0x3f')](handleError(_0x30e5d0,null));};exports['destroy']=function(_0x5258b9,_0xc9f070){return db[_0x2010('0x2a')]['find']({'where':{'id':_0x5258b9[_0x2010('0x40')]['id']}})[_0x2010('0x3c')](handleEntityNotFound(_0xc9f070,null))[_0x2010('0x3c')](removeEntity(_0xc9f070,null))[_0x2010('0x3f')](handleError(_0xc9f070,null));}; \ No newline at end of file +var _0x9e0d=['includeAll','findAll','rows','params','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FreshdeskField'];(function(_0x5b5302,_0x1b9d54){var _0x379a62=function(_0x8dbc5c){while(--_0x8dbc5c){_0x5b5302['push'](_0x5b5302['shift']());}};_0x379a62(++_0x1b9d54);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x59aecc,_0x255014){_0x59aecc=_0x59aecc-0x0;var _0x46b112=_0x9e0d[_0x59aecc];return _0x46b112;};'use strict';var emlformat=require(_0xd9e0('0x0'));var rimraf=require(_0xd9e0('0x1'));var zipdir=require(_0xd9e0('0x2'));var jsonpatch=require(_0xd9e0('0x3'));var rp=require('request-promise');var moment=require(_0xd9e0('0x4'));var BPromise=require(_0xd9e0('0x5'));var Mustache=require(_0xd9e0('0x6'));var util=require(_0xd9e0('0x7'));var path=require(_0xd9e0('0x8'));var sox=require(_0xd9e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e0('0xa'));var _=require(_0xd9e0('0xb'));var squel=require(_0xd9e0('0xc'));var crypto=require(_0xd9e0('0xd'));var jsforce=require(_0xd9e0('0xe'));var deskjs=require(_0xd9e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9e0('0x10'));var Papa=require(_0xd9e0('0x11'));var Redis=require(_0xd9e0('0x12'));var authService=require(_0xd9e0('0x13'));var qs=require(_0xd9e0('0x14'));var as=require(_0xd9e0('0x15'));var hardwareService=require(_0xd9e0('0x16'));var logger=require('../../config/logger')(_0xd9e0('0x17'));var utils=require(_0xd9e0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd9e0('0x19'));var db=require(_0xd9e0('0x1a'))['db'];function respondWithStatusCode(_0x418d84,_0x1fb454){_0x1fb454=_0x1fb454||0xcc;return function(_0x18fdf2){if(_0x18fdf2){return _0x418d84['sendStatus'](_0x1fb454);}return _0x418d84[_0xd9e0('0x1b')](_0x1fb454)['end']();};}function respondWithResult(_0x2f311c,_0x55c704){_0x55c704=_0x55c704||0xc8;return function(_0x24d361){if(_0x24d361){return _0x2f311c[_0xd9e0('0x1b')](_0x55c704)[_0xd9e0('0x1c')](_0x24d361);}};}function respondWithFilteredResult(_0x18301b,_0x3e4c5d){return function(_0x4da900){if(_0x4da900){var _0x58d44c=typeof _0x3e4c5d['offset']===_0xd9e0('0x1d')&&typeof _0x3e4c5d[_0xd9e0('0x1e')]===_0xd9e0('0x1d');var _0x1cdcb6=_0x4da900['count'];var _0x209c04=_0x58d44c?0x0:_0x3e4c5d['offset'];var _0x483b74=_0x58d44c?_0x4da900[_0xd9e0('0x1f')]:_0x3e4c5d[_0xd9e0('0x20')]+_0x3e4c5d['limit'];var _0x5ac8f5;if(_0x483b74>=_0x1cdcb6){_0x483b74=_0x1cdcb6;_0x5ac8f5=0xc8;}else{_0x5ac8f5=0xce;}_0x18301b[_0xd9e0('0x1b')](_0x5ac8f5);return _0x18301b[_0xd9e0('0x21')]('Content-Range',_0x209c04+'-'+_0x483b74+'/'+_0x1cdcb6)[_0xd9e0('0x1c')](_0x4da900);}return null;};}function patchUpdates(_0x4cc3c9){return function(_0xd3d455){try{jsonpatch[_0xd9e0('0x22')](_0xd3d455,_0x4cc3c9,!![]);}catch(_0x67f69f){return BPromise[_0xd9e0('0x23')](_0x67f69f);}return _0xd3d455[_0xd9e0('0x24')]();};}function saveUpdates(_0x5711a1,_0x19534a){return function(_0x333233){if(_0x333233){return _0x333233['update'](_0x5711a1)[_0xd9e0('0x25')](function(_0x124ca7){return _0x124ca7;});}return null;};}function removeEntity(_0x5d4549,_0x357bd9){return function(_0x5e17d4){if(_0x5e17d4){return _0x5e17d4[_0xd9e0('0x26')]()[_0xd9e0('0x25')](function(){_0x5d4549['status'](0xcc)[_0xd9e0('0x27')]();});}};}function handleEntityNotFound(_0x53cf67,_0x554aeb){return function(_0x50f57d){if(!_0x50f57d){_0x53cf67[_0xd9e0('0x28')](0x194);}return _0x50f57d;};}function handleError(_0x21c796,_0x7065c6){_0x7065c6=_0x7065c6||0x1f4;return function(_0x1c36df){logger[_0xd9e0('0x29')](_0x1c36df[_0xd9e0('0x2a')]);if(_0x1c36df[_0xd9e0('0x2b')]){delete _0x1c36df['name'];}_0x21c796[_0xd9e0('0x1b')](_0x7065c6)[_0xd9e0('0x2c')](_0x1c36df);};}exports[_0xd9e0('0x2d')]=function(_0x17a899,_0x2738e9){var _0x4f5367={},_0x4b4f7d={},_0x4e719c={'count':0x0,'rows':[]};var _0x2cdbba=_[_0xd9e0('0x2e')](db['FreshdeskField'][_0xd9e0('0x2f')],function(_0x183a79){return{'name':_0x183a79[_0xd9e0('0x30')],'type':_0x183a79[_0xd9e0('0x31')][_0xd9e0('0x32')]};});_0x4b4f7d[_0xd9e0('0x33')]=_[_0xd9e0('0x2e')](_0x2cdbba,'name');_0x4b4f7d[_0xd9e0('0x34')]=_[_0xd9e0('0x35')](_0x17a899[_0xd9e0('0x34')]);_0x4b4f7d[_0xd9e0('0x36')]=_[_0xd9e0('0x37')](_0x4b4f7d[_0xd9e0('0x33')],_0x4b4f7d[_0xd9e0('0x34')]);_0x4f5367[_0xd9e0('0x38')]=_[_0xd9e0('0x37')](_0x4b4f7d[_0xd9e0('0x33')],qs[_0xd9e0('0x39')](_0x17a899[_0xd9e0('0x34')]['fields']));_0x4f5367[_0xd9e0('0x38')]=_0x4f5367[_0xd9e0('0x38')][_0xd9e0('0x3a')]?_0x4f5367[_0xd9e0('0x38')]:_0x4b4f7d[_0xd9e0('0x33')];if(!_0x17a899['query'][_0xd9e0('0x3b')](_0xd9e0('0x3c'))){_0x4f5367[_0xd9e0('0x1e')]=qs[_0xd9e0('0x1e')](_0x17a899['query'][_0xd9e0('0x1e')]);_0x4f5367['offset']=qs[_0xd9e0('0x20')](_0x17a899[_0xd9e0('0x34')][_0xd9e0('0x20')]);}_0x4f5367[_0xd9e0('0x3d')]=qs[_0xd9e0('0x3e')](_0x17a899[_0xd9e0('0x34')][_0xd9e0('0x3e')]);_0x4f5367[_0xd9e0('0x3f')]=qs[_0xd9e0('0x36')](_['pick'](_0x17a899[_0xd9e0('0x34')],_0x4b4f7d[_0xd9e0('0x36')]),_0x2cdbba);if(_0x17a899[_0xd9e0('0x34')][_0xd9e0('0x40')]){_0x4f5367['where']=_[_0xd9e0('0x41')](_0x4f5367[_0xd9e0('0x3f')],{'$or':_[_0xd9e0('0x2e')](_0x2cdbba,function(_0x317414){if(_0x317414[_0xd9e0('0x31')]!==_0xd9e0('0x42')){var _0x3fc833={};_0x3fc833[_0x317414[_0xd9e0('0x2b')]]={'$like':'%'+_0x17a899[_0xd9e0('0x34')][_0xd9e0('0x40')]+'%'};return _0x3fc833;}})});}_0x4f5367=_[_0xd9e0('0x41')]({},_0x4f5367,_0x17a899[_0xd9e0('0x43')]);var _0x18ee0b={'where':_0x4f5367[_0xd9e0('0x3f')]};return db[_0xd9e0('0x44')][_0xd9e0('0x1f')](_0x18ee0b)['then'](function(_0x1d071e){_0x4e719c[_0xd9e0('0x1f')]=_0x1d071e;if(_0x17a899['query'][_0xd9e0('0x45')]){_0x4f5367['include']=[{'all':!![]}];}return db[_0xd9e0('0x44')][_0xd9e0('0x46')](_0x4f5367);})[_0xd9e0('0x25')](function(_0x34a00f){_0x4e719c[_0xd9e0('0x47')]=_0x34a00f;return _0x4e719c;})[_0xd9e0('0x25')](respondWithFilteredResult(_0x2738e9,_0x4f5367))['catch'](handleError(_0x2738e9,null));};exports['show']=function(_0x142fa7,_0x186365){var _0x36ab92={'raw':!![],'where':{'id':_0x142fa7[_0xd9e0('0x48')]['id']}},_0x3fa8cb={};_0x3fa8cb['model']=_[_0xd9e0('0x35')](db[_0xd9e0('0x44')][_0xd9e0('0x2f')]);_0x3fa8cb[_0xd9e0('0x34')]=_['keys'](_0x142fa7[_0xd9e0('0x34')]);_0x3fa8cb[_0xd9e0('0x36')]=_[_0xd9e0('0x37')](_0x3fa8cb['model'],_0x3fa8cb['query']);_0x36ab92[_0xd9e0('0x38')]=_[_0xd9e0('0x37')](_0x3fa8cb['model'],qs['fields'](_0x142fa7[_0xd9e0('0x34')][_0xd9e0('0x39')]));_0x36ab92[_0xd9e0('0x38')]=_0x36ab92[_0xd9e0('0x38')][_0xd9e0('0x3a')]?_0x36ab92[_0xd9e0('0x38')]:_0x3fa8cb[_0xd9e0('0x33')];if(_0x142fa7[_0xd9e0('0x34')]['includeAll']){_0x36ab92[_0xd9e0('0x49')]=[{'all':!![]}];}_0x36ab92=_[_0xd9e0('0x41')]({},_0x36ab92,_0x142fa7['options']);return db[_0xd9e0('0x44')][_0xd9e0('0x4a')](_0x36ab92)[_0xd9e0('0x25')](handleEntityNotFound(_0x186365,null))[_0xd9e0('0x25')](respondWithResult(_0x186365,null))[_0xd9e0('0x4b')](handleError(_0x186365,null));};exports[_0xd9e0('0x4c')]=function(_0x42be53,_0x2ec72a){return db[_0xd9e0('0x44')][_0xd9e0('0x4c')](_0x42be53[_0xd9e0('0x4d')],{})[_0xd9e0('0x25')](respondWithResult(_0x2ec72a,0xc9))['catch'](handleError(_0x2ec72a,null));};exports[_0xd9e0('0x4e')]=function(_0x23d7fb,_0x4e3e1c){if(_0x23d7fb[_0xd9e0('0x4d')]['id']){delete _0x23d7fb['body']['id'];}return db[_0xd9e0('0x44')][_0xd9e0('0x4a')]({'where':{'id':_0x23d7fb[_0xd9e0('0x48')]['id']}})[_0xd9e0('0x25')](handleEntityNotFound(_0x4e3e1c,null))[_0xd9e0('0x25')](saveUpdates(_0x23d7fb[_0xd9e0('0x4d')],null))[_0xd9e0('0x25')](respondWithResult(_0x4e3e1c,null))['catch'](handleError(_0x4e3e1c,null));};exports[_0xd9e0('0x26')]=function(_0xc2b731,_0x434b47){return db[_0xd9e0('0x44')][_0xd9e0('0x4a')]({'where':{'id':_0xc2b731['params']['id']}})['then'](handleEntityNotFound(_0x434b47,null))[_0xd9e0('0x25')](removeEntity(_0x434b47,null))['catch'](handleError(_0x434b47,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e00f66b..77cfa12 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 _0xefdf=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird'];(function(_0x226882,_0x3071db){var _0x5b610e=function(_0x43963a){while(--_0x43963a){_0x226882['push'](_0x226882['shift']());}};_0x5b610e(++_0x3071db);}(_0xefdf,0x15c));var _0xfefd=function(_0xaee9b2,_0x4f74cf){_0xaee9b2=_0xaee9b2-0x0;var _0x8c26c1=_0xefdf[_0xaee9b2];return _0x8c26c1;};'use strict';var _=require(_0xfefd('0x0'));var util=require('util');var logger=require(_0xfefd('0x1'))(_0xfefd('0x2'));var moment=require('moment');var BPromise=require(_0xfefd('0x3'));var rp=require(_0xfefd('0x4'));var fs=require('fs');var path=require(_0xfefd('0x5'));var rimraf=require(_0xfefd('0x6'));var config=require(_0xfefd('0x7'));var attributes=require(_0xfefd('0x8'));module[_0xfefd('0x9')]=function(_0x3f5320,_0x2db864){return _0x3f5320[_0xfefd('0xa')](_0xfefd('0xb'),attributes,{'tableName':_0xfefd('0xc'),'paranoid':![],'indexes':[{'name':_0xfefd('0xd'),'fields':[_0xfefd('0xe'),_0xfefd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x59c0=['exports','int_freshdesk_fields','freshdesk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x3e6449,_0x5d46b0){var _0x530f70=function(_0x309c5b){while(--_0x309c5b){_0x3e6449['push'](_0x3e6449['shift']());}};_0x530f70(++_0x5d46b0);}(_0x59c0,0x163));var _0x059c=function(_0x1c75c1,_0x393564){_0x1c75c1=_0x1c75c1-0x0;var _0x576b28=_0x59c0[_0x1c75c1];return _0x576b28;};'use strict';var _=require('lodash');var util=require(_0x059c('0x0'));var logger=require(_0x059c('0x1'))(_0x059c('0x2'));var moment=require(_0x059c('0x3'));var BPromise=require(_0x059c('0x4'));var rp=require(_0x059c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x059c('0x6'));var config=require(_0x059c('0x7'));var attributes=require(_0x059c('0x8'));module[_0x059c('0x9')]=function(_0x1a0bd8,_0x41a8b8){return _0x1a0bd8['define']('FreshdeskField',attributes,{'tableName':_0x059c('0xa'),'paranoid':![],'indexes':[{'name':_0x059c('0xb'),'fields':[_0x059c('0xc'),'FieldId'],'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 b2fbcb9..a1da190 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 _0x761a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xb03edf,_0x60dcd0){var _0x83d54e=function(_0x48bfb5){while(--_0x48bfb5){_0xb03edf['push'](_0xb03edf['shift']());}};_0x83d54e(++_0x60dcd0);}(_0x761a,0x13c));var _0xa761=function(_0x4d3d50,_0x50f156){_0x4d3d50=_0x4d3d50-0x0;var _0x175e6d=_0x761a[_0x4d3d50];return _0x175e6d;};'use strict';var _=require(_0xa761('0x0'));var util=require(_0xa761('0x1'));var moment=require(_0xa761('0x2'));var BPromise=require(_0xa761('0x3'));var rs=require(_0xa761('0x4'));var fs=require('fs');var Redis=require(_0xa761('0x5'));var db=require(_0xa761('0x6'))['db'];var utils=require(_0xa761('0x7'));var logger=require(_0xa761('0x8'))(_0xa761('0x9'));var config=require(_0xa761('0xa'));var jayson=require(_0xa761('0xb'));var client=jayson['client'][_0xa761('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28e350,_0x4b6b86,_0x1543a2){return new BPromise(function(_0x2d813d,_0x1759cf){return client['request'](_0x28e350,_0x1543a2)['then'](function(_0x5787d9){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x4b6b86,'request\x20sent');logger[_0xa761('0xd')](_0xa761('0xe'),_0x4b6b86,_0xa761('0xf'),JSON[_0xa761('0x10')](_0x5787d9));if(_0x5787d9[_0xa761('0x11')]){if(_0x5787d9[_0xa761('0x11')][_0xa761('0x12')]===0x1f4){logger['error'](_0xa761('0x13'),_0x4b6b86,_0x5787d9['error']['message']);return _0x1759cf(_0x5787d9[_0xa761('0x11')]['message']);}logger[_0xa761('0x11')](_0xa761('0x13'),_0x4b6b86,_0x5787d9['error'][_0xa761('0x14')]);return _0x2d813d(_0x5787d9[_0xa761('0x11')][_0xa761('0x14')]);}else{logger[_0xa761('0x15')](_0xa761('0x13'),_0x4b6b86,'request\x20sent');_0x2d813d(_0x5787d9['result'][_0xa761('0x14')]);}})[_0xa761('0x16')](function(_0x151466){logger[_0xa761('0x11')](_0xa761('0x13'),_0x4b6b86,_0x151466);_0x1759cf(_0x151466);});});} \ No newline at end of file +var _0x711d=['message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x711d,0xc9));var _0xd711=function(_0x3c84eb,_0x4fbd31){_0x3c84eb=_0x3c84eb-0x0;var _0x2f7dec=_0x711d[_0x3c84eb];return _0x2f7dec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd711('0x0'));var BPromise=require('bluebird');var rs=require(_0xd711('0x1'));var fs=require('fs');var Redis=require(_0xd711('0x2'));var db=require(_0xd711('0x3'))['db'];var utils=require(_0xd711('0x4'));var logger=require(_0xd711('0x5'))(_0xd711('0x6'));var config=require(_0xd711('0x7'));var jayson=require(_0xd711('0x8'));var client=jayson['client'][_0xd711('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306e70,_0x39dae8,_0x50b7b0){return new BPromise(function(_0x25db2b,_0x45571c){return client[_0xd711('0xa')](_0x306e70,_0x50b7b0)[_0xd711('0xb')](function(_0x30048c){logger[_0xd711('0xc')](_0xd711('0xd'),_0x39dae8,_0xd711('0xe'));logger[_0xd711('0xf')](_0xd711('0x10'),_0x39dae8,'request\x20sent',JSON['stringify'](_0x30048c));if(_0x30048c[_0xd711('0x11')]){if(_0x30048c[_0xd711('0x11')][_0xd711('0x12')]===0x1f4){logger['error'](_0xd711('0xd'),_0x39dae8,_0x30048c[_0xd711('0x11')]['message']);return _0x45571c(_0x30048c[_0xd711('0x11')][_0xd711('0x13')]);}logger[_0xd711('0x11')](_0xd711('0xd'),_0x39dae8,_0x30048c['error'][_0xd711('0x13')]);return _0x25db2b(_0x30048c[_0xd711('0x11')][_0xd711('0x13')]);}else{logger[_0xd711('0xc')](_0xd711('0xd'),_0x39dae8,_0xd711('0xe'));_0x25db2b(_0x30048c[_0xd711('0x14')][_0xd711('0x13')]);}})[_0xd711('0x15')](function(_0x2eb084){logger[_0xd711('0x11')](_0xd711('0xd'),_0x39dae8,_0x2eb084);_0x45571c(_0x2eb084);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index cc69b40..be34d02 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 _0xb58b=['Router','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x58e505,_0x18cc33){var _0x1953ad=function(_0x4b6fe1){while(--_0x4b6fe1){_0x58e505['push'](_0x58e505['shift']());}};_0x1953ad(++_0x18cc33);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4dce7e,_0x270304){_0x4dce7e=_0x4dce7e-0x0;var _0x14d593=_0xb58b[_0x4dce7e];return _0x14d593;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0x7')](_0xbb58('0xd'),auth[_0xbb58('0x8')](),controller['getFields']);router[_0xbb58('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0xe')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['addConfiguration']);router[_0xbb58('0x10')](_0xbb58('0x9'),auth['isAuthenticated'](),controller[_0xbb58('0x11')]);router[_0xbb58('0x12')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0x13')]);module['exports']=router; \ No newline at end of file +var _0xbf6e=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x118355,_0x201311){var _0x32f7ea=function(_0x4fd55b){while(--_0x4fd55b){_0x118355['push'](_0x118355['shift']());}};_0x32f7ea(++_0x201311);}(_0xbf6e,0x149));var _0xebf6=function(_0x3d8088,_0x59af8b){_0x3d8088=_0x3d8088-0x0;var _0x1705a6=_0xbf6e[_0x3d8088];return _0x1705a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0x8')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller['getConfigurations']);router[_0xebf6('0x8')](_0xebf6('0xd'),auth['isAuthenticated'](),controller[_0xebf6('0xe')]);router[_0xebf6('0xf')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0x10')]);router[_0xebf6('0xf')](_0xebf6('0xc'),auth['isAuthenticated'](),controller[_0xebf6('0x11')]);router[_0xebf6('0x12')]('/:id',auth[_0xebf6('0x9')](),controller[_0xebf6('0x13')]);router[_0xebf6('0x14')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index afffe9d..92a1810 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 _0xdf55=['exports','STRING','remoteUri','sequelize'];(function(_0x5b5c80,_0x2e3eeb){var _0x57d9a1=function(_0x284bea){while(--_0x284bea){_0x5b5c80['push'](_0x5b5c80['shift']());}};_0x57d9a1(++_0x2e3eeb);}(_0xdf55,0x83));var _0x5df5=function(_0x1e0d60,_0x503460){_0x1e0d60=_0x1e0d60-0x0;var _0x5b9564=_0xdf55[_0x1e0d60];return _0x5b9564;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5df5('0x2')]},'username':{'type':Sequelize[_0x5df5('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x5df5('0x2')]},'remoteUri':{'type':Sequelize[_0x5df5('0x2')],'unique':_0x5df5('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0xc83285,_0x3860f3){var _0x59ef36=function(_0x375eaf){while(--_0x375eaf){_0xc83285['push'](_0xc83285['shift']());}};_0x59ef36(++_0x3860f3);}(_0x5c3c,0x132));var _0xc5c3=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x5c3c[_0x50aa2e];return _0x5e07f0;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('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 475a9b7..4db4996 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 _0xedde=['name','send','index','map','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','FreshsalesAccount','includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','find','create','catch','body','getConfigurations','FreshsalesConfiguration','order','getSubjects','channel','Descriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xedde,0x99));var _0xeedd=function(_0x3a760c,_0x39961e){_0x3a760c=_0x3a760c-0x0;var _0x5a6e76=_0xedde[_0x3a760c];return _0x5a6e76;};'use strict';var emlformat=require(_0xeedd('0x0'));var rimraf=require(_0xeedd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeedd('0x2'));var rp=require(_0xeedd('0x3'));var moment=require(_0xeedd('0x4'));var BPromise=require(_0xeedd('0x5'));var Mustache=require(_0xeedd('0x6'));var util=require('util');var path=require(_0xeedd('0x7'));var sox=require(_0xeedd('0x8'));var csv=require(_0xeedd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeedd('0xa'));var _=require('lodash');var squel=require(_0xeedd('0xb'));var crypto=require(_0xeedd('0xc'));var jsforce=require(_0xeedd('0xd'));var deskjs=require(_0xeedd('0xe'));var toCsv=require(_0xeedd('0x9'));var querystring=require(_0xeedd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeedd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeedd('0x11'))(_0xeedd('0x12'));var utils=require(_0xeedd('0x13'));var config=require(_0xeedd('0x14'));var licenseUtil=require(_0xeedd('0x15'));var db=require(_0xeedd('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49625b,_0xdcf83a){_0xdcf83a=_0xdcf83a||0xcc;return function(_0x5f4890){if(_0x5f4890){return _0x49625b[_0xeedd('0x17')](_0xdcf83a);}return _0x49625b[_0xeedd('0x18')](_0xdcf83a)[_0xeedd('0x19')]();};}function respondWithResult(_0x79d69e,_0x3d298c){_0x3d298c=_0x3d298c||0xc8;return function(_0xe9e09a){if(_0xe9e09a){return _0x79d69e[_0xeedd('0x18')](_0x3d298c)[_0xeedd('0x1a')](_0xe9e09a);}};}function respondWithFilteredResult(_0x231fb7,_0x5b431c){return function(_0x5b236d){if(_0x5b236d){var _0x142c84=typeof _0x5b431c['offset']==='undefined'&&typeof _0x5b431c[_0xeedd('0x1b')]==='undefined';var _0x2f6702=_0x5b236d[_0xeedd('0x1c')];var _0x329052=_0x142c84?0x0:_0x5b431c[_0xeedd('0x1d')];var _0x3b7df1=_0x142c84?_0x5b236d[_0xeedd('0x1c')]:_0x5b431c[_0xeedd('0x1d')]+_0x5b431c['limit'];var _0x3c8073;if(_0x3b7df1>=_0x2f6702){_0x3b7df1=_0x2f6702;_0x3c8073=0xc8;}else{_0x3c8073=0xce;}_0x231fb7[_0xeedd('0x18')](_0x3c8073);return _0x231fb7[_0xeedd('0x1e')](_0xeedd('0x1f'),_0x329052+'-'+_0x3b7df1+'/'+_0x2f6702)[_0xeedd('0x1a')](_0x5b236d);}return null;};}function patchUpdates(_0x216605){return function(_0x2f3df2){try{jsonpatch['apply'](_0x2f3df2,_0x216605,!![]);}catch(_0x1b1b50){return BPromise[_0xeedd('0x20')](_0x1b1b50);}return _0x2f3df2[_0xeedd('0x21')]();};}function saveUpdates(_0x353ae5,_0xb4579){return function(_0x14bc9f){if(_0x14bc9f){return _0x14bc9f[_0xeedd('0x22')](_0x353ae5)[_0xeedd('0x23')](function(_0x1e7db7){return _0x1e7db7;});}return null;};}function removeEntity(_0x4bc09b,_0x5317ff){return function(_0x252d6b){if(_0x252d6b){return _0x252d6b[_0xeedd('0x24')]()['then'](function(){_0x4bc09b[_0xeedd('0x18')](0xcc)[_0xeedd('0x19')]();});}};}function handleEntityNotFound(_0x57c056,_0x5cae5a){return function(_0x475e5f){if(!_0x475e5f){_0x57c056[_0xeedd('0x17')](0x194);}return _0x475e5f;};}function handleError(_0x4dd8a2,_0x9dd2b9){_0x9dd2b9=_0x9dd2b9||0x1f4;return function(_0x1a44be){logger[_0xeedd('0x25')](_0x1a44be[_0xeedd('0x26')]);if(_0x1a44be[_0xeedd('0x27')]){delete _0x1a44be[_0xeedd('0x27')];}_0x4dd8a2[_0xeedd('0x18')](_0x9dd2b9)[_0xeedd('0x28')](_0x1a44be);};}exports[_0xeedd('0x29')]=function(_0x383ddb,_0x3c078a){var _0x2ac798={},_0x1bd0eb={},_0xb8747e={'count':0x0,'rows':[]};var _0x5e1263=_[_0xeedd('0x2a')](db['FreshsalesAccount']['rawAttributes'],function(_0x377f0b){return{'name':_0x377f0b[_0xeedd('0x2b')],'type':_0x377f0b[_0xeedd('0x2c')]['key']};});_0x1bd0eb[_0xeedd('0x2d')]=_[_0xeedd('0x2a')](_0x5e1263,_0xeedd('0x27'));_0x1bd0eb[_0xeedd('0x2e')]=_['keys'](_0x383ddb[_0xeedd('0x2e')]);_0x1bd0eb[_0xeedd('0x2f')]=_['intersection'](_0x1bd0eb[_0xeedd('0x2d')],_0x1bd0eb['query']);_0x2ac798[_0xeedd('0x30')]=_['intersection'](_0x1bd0eb[_0xeedd('0x2d')],qs[_0xeedd('0x31')](_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x31')]));_0x2ac798[_0xeedd('0x30')]=_0x2ac798[_0xeedd('0x30')][_0xeedd('0x32')]?_0x2ac798[_0xeedd('0x30')]:_0x1bd0eb[_0xeedd('0x2d')];if(!_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x33')](_0xeedd('0x34'))){_0x2ac798[_0xeedd('0x1b')]=qs[_0xeedd('0x1b')](_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x1b')]);_0x2ac798[_0xeedd('0x1d')]=qs['offset'](_0x383ddb['query'][_0xeedd('0x1d')]);}_0x2ac798['order']=qs['sort'](_0x383ddb['query'][_0xeedd('0x35')]);_0x2ac798[_0xeedd('0x36')]=qs[_0xeedd('0x2f')](_[_0xeedd('0x37')](_0x383ddb[_0xeedd('0x2e')],_0x1bd0eb[_0xeedd('0x2f')]),_0x5e1263);if(_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x38')]){_0x2ac798[_0xeedd('0x36')]=_[_0xeedd('0x39')](_0x2ac798[_0xeedd('0x36')],{'$or':_[_0xeedd('0x2a')](_0x5e1263,function(_0x41c6d9){if(_0x41c6d9[_0xeedd('0x2c')]!=='VIRTUAL'){var _0x2f2f5d={};_0x2f2f5d[_0x41c6d9[_0xeedd('0x27')]]={'$like':'%'+_0x383ddb[_0xeedd('0x2e')][_0xeedd('0x38')]+'%'};return _0x2f2f5d;}})});}_0x2ac798=_[_0xeedd('0x39')]({},_0x2ac798,_0x383ddb[_0xeedd('0x3a')]);var _0x33710f={'where':_0x2ac798['where']};return db[_0xeedd('0x3b')][_0xeedd('0x1c')](_0x33710f)['then'](function(_0x5b6a4c){_0xb8747e[_0xeedd('0x1c')]=_0x5b6a4c;if(_0x383ddb['query'][_0xeedd('0x3c')]){_0x2ac798[_0xeedd('0x3d')]=[{'all':!![]}];}return db[_0xeedd('0x3b')][_0xeedd('0x3e')](_0x2ac798);})[_0xeedd('0x23')](function(_0x4f98bc){_0xb8747e[_0xeedd('0x3f')]=_0x4f98bc;return _0xb8747e;})[_0xeedd('0x23')](respondWithFilteredResult(_0x3c078a,_0x2ac798))['catch'](handleError(_0x3c078a,null));};exports[_0xeedd('0x40')]=function(_0x47946f,_0xf1e81c){var _0x184a45={'raw':![],'where':{'id':_0x47946f[_0xeedd('0x41')]['id']}},_0x114176={};_0x114176[_0xeedd('0x2d')]=_[_0xeedd('0x42')](db[_0xeedd('0x3b')][_0xeedd('0x43')]);_0x114176['query']=_['keys'](_0x47946f['query']);_0x114176[_0xeedd('0x2f')]=_[_0xeedd('0x44')](_0x114176[_0xeedd('0x2d')],_0x114176[_0xeedd('0x2e')]);_0x184a45[_0xeedd('0x30')]=_[_0xeedd('0x44')](_0x114176[_0xeedd('0x2d')],qs['fields'](_0x47946f[_0xeedd('0x2e')]['fields']));_0x184a45[_0xeedd('0x30')]=_0x184a45[_0xeedd('0x30')][_0xeedd('0x32')]?_0x184a45[_0xeedd('0x30')]:_0x114176[_0xeedd('0x2d')];if(_0x47946f[_0xeedd('0x2e')][_0xeedd('0x3c')]){_0x184a45[_0xeedd('0x3d')]=[{'all':!![]}];}_0x184a45=_[_0xeedd('0x39')]({},_0x184a45,_0x47946f[_0xeedd('0x3a')]);return db['FreshsalesAccount'][_0xeedd('0x45')](_0x184a45)[_0xeedd('0x23')](handleEntityNotFound(_0xf1e81c,null))[_0xeedd('0x23')](respondWithResult(_0xf1e81c,null))['catch'](handleError(_0xf1e81c,null));};exports[_0xeedd('0x46')]=function(_0x13248a,_0x2326f3){return db[_0xeedd('0x3b')][_0xeedd('0x46')](_0x13248a['body'],{})['then'](respondWithResult(_0x2326f3,0xc9))[_0xeedd('0x47')](handleError(_0x2326f3,null));};exports[_0xeedd('0x22')]=function(_0x432c6a,_0xa65094){if(_0x432c6a[_0xeedd('0x48')]['id']){delete _0x432c6a[_0xeedd('0x48')]['id'];}return db[_0xeedd('0x3b')]['find']({'where':{'id':_0x432c6a[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0xa65094,null))[_0xeedd('0x23')](saveUpdates(_0x432c6a[_0xeedd('0x48')],null))[_0xeedd('0x23')](respondWithResult(_0xa65094,null))[_0xeedd('0x47')](handleError(_0xa65094,null));};exports[_0xeedd('0x24')]=function(_0x28190c,_0x18690a){return db[_0xeedd('0x3b')][_0xeedd('0x45')]({'where':{'id':_0x28190c[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0x18690a,null))[_0xeedd('0x23')](removeEntity(_0x18690a,null))[_0xeedd('0x47')](handleError(_0x18690a,null));};exports[_0xeedd('0x49')]=function(_0x93fa43,_0x436e03,_0x2d7dba){var _0x3da9df={};var _0x2e521c={};var _0x3d6485;var _0x1e6f25;return db[_0xeedd('0x3b')]['findOne']({'where':{'id':_0x93fa43[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0x436e03,null))['then'](function(_0x16fab3){if(_0x16fab3){_0x3d6485=_0x16fab3;_0x2e521c['model']=_[_0xeedd('0x42')](db[_0xeedd('0x4a')][_0xeedd('0x43')]);_0x2e521c[_0xeedd('0x2e')]=_[_0xeedd('0x42')](_0x93fa43[_0xeedd('0x2e')]);_0x2e521c['filters']=_[_0xeedd('0x44')](_0x2e521c[_0xeedd('0x2d')],_0x2e521c[_0xeedd('0x2e')]);_0x3da9df[_0xeedd('0x30')]=_['intersection'](_0x2e521c[_0xeedd('0x2d')],qs['fields'](_0x93fa43['query']['fields']));_0x3da9df[_0xeedd('0x30')]=_0x3da9df['attributes']['length']?_0x3da9df['attributes']:_0x2e521c['model'];_0x3da9df[_0xeedd('0x4b')]=qs[_0xeedd('0x35')](_0x93fa43['query'][_0xeedd('0x35')]);_0x3da9df['where']=qs[_0xeedd('0x2f')](_['pick'](_0x93fa43[_0xeedd('0x2e')],_0x2e521c[_0xeedd('0x2f')]));if(_0x93fa43[_0xeedd('0x2e')][_0xeedd('0x38')]){_0x3da9df[_0xeedd('0x36')]=_['merge'](_0x3da9df[_0xeedd('0x36')],{'$or':_[_0xeedd('0x2a')](_0x3da9df[_0xeedd('0x30')],function(_0x5e0b10){var _0x460cfa={};_0x460cfa[_0x5e0b10]={'$like':'%'+_0x93fa43[_0xeedd('0x2e')][_0xeedd('0x38')]+'%'};return _0x460cfa;})});}_0x3da9df=_[_0xeedd('0x39')]({},_0x3da9df,_0x93fa43[_0xeedd('0x3a')]);return _0x3d6485['getConfigurations'](_0x3da9df);}})[_0xeedd('0x23')](function(_0x1fcd00){if(_0x1fcd00){_0x1e6f25=_0x1fcd00[_0xeedd('0x32')];if(!_0x93fa43[_0xeedd('0x2e')][_0xeedd('0x33')](_0xeedd('0x34'))){_0x3da9df['limit']=qs[_0xeedd('0x1b')](_0x93fa43['query'][_0xeedd('0x1b')]);_0x3da9df[_0xeedd('0x1d')]=qs[_0xeedd('0x1d')](_0x93fa43[_0xeedd('0x2e')]['offset']);}return _0x3d6485[_0xeedd('0x49')](_0x3da9df);}})[_0xeedd('0x23')](function(_0x1cb642){if(_0x1cb642){return _0x1cb642?{'count':_0x1e6f25,'rows':_0x1cb642}:null;}})['then'](respondWithResult(_0x436e03,null))['catch'](handleError(_0x436e03,null));};exports['addConfiguration']=function(_0x250be8,_0x437312,_0x11763c){if(_0x250be8[_0xeedd('0x48')]['id']){delete _0x250be8[_0xeedd('0x48')]['id'];}return db[_0xeedd('0x3b')]['findOne']({'where':{'id':_0x250be8[_0xeedd('0x41')]['id']}})[_0xeedd('0x23')](handleEntityNotFound(_0x437312,null))[_0xeedd('0x23')](function(_0xde613f){if(_0xde613f){_0x250be8[_0xeedd('0x48')]['AccountId']=_0xde613f['id'];_0x250be8[_0xeedd('0x48')]['Subjects']=integrations[_0xeedd('0x4c')](_0x250be8[_0xeedd('0x48')][_0xeedd('0x4d')],_0x250be8[_0xeedd('0x48')][_0xeedd('0x2c')]);_0x250be8['body'][_0xeedd('0x4e')]=integrations['getDescriptions'](_0x250be8[_0xeedd('0x48')]['channel'],_0x250be8['body'][_0xeedd('0x2c')]);return db[_0xeedd('0x4a')][_0xeedd('0x46')](_0x250be8['body'],{'include':[{'model':db[_0xeedd('0x4f')],'as':_0xeedd('0x50')},{'model':db[_0xeedd('0x4f')],'as':_0xeedd('0x4e')}]});}return null;})[_0xeedd('0x23')](respondWithResult(_0x437312,null))[_0xeedd('0x47')](handleError(_0x437312,null));};exports[_0xeedd('0x51')]=function(_0x4b71b6,_0x3a8329,_0x22076a){var _0x300c90='';var _0x2823c9='';return db[_0xeedd('0x3b')]['findOne']({'where':{'id':_0x4b71b6[_0xeedd('0x41')]['id']},'attributes':['id',_0xeedd('0x52'),_0xeedd('0x53'),_0xeedd('0x54')]})[_0xeedd('0x23')](handleEntityNotFound(_0x3a8329,null))[_0xeedd('0x23')](function(_0x279072){if(_0x279072){_0x2823c9=_0x279072['username'];_0x300c90=_0x279072[_0xeedd('0x53')];var _0x42d8e8=_0x279072[_0xeedd('0x53')][_0xeedd('0x55')](-0x1);if(_0x42d8e8==='/'){_0x300c90=_0x300c90['substring'](0x0,_0x300c90[_0xeedd('0x56')](_0x42d8e8));}return rp({'method':_0xeedd('0x57'),'uri':util[_0xeedd('0x58')](_0xeedd('0x59'),_0x300c90,_0xeedd('0x5a')),'headers':{'Authorization':'Token\x20token='+_0x279072[_0xeedd('0x54')]},'json':!![]});}})[_0xeedd('0x23')](function(_0xe568bd){if(_0xe568bd){var _0x44dba5=_0xe568bd['users'];var _0x4ba6da=![];var _0x2534c7=null;for(_0x2534c7=0x0;_0x2534c7<_0x44dba5[_0xeedd('0x32')];_0x2534c7++){if(_0x44dba5[_0x2534c7][_0xeedd('0x5b')]===_0x2823c9){_0x4ba6da=!![];}}if(_0x4ba6da){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xeedd('0x23')](respondWithResult(_0x3a8329,null))[_0xeedd('0x47')](function(_0x2f39bc){var _0x2c9530=_0x4b71b6['query']['test']?0x1f4:_0x2f39bc[_0xeedd('0x5c')]||0x1f4;logger['error'](_0xeedd('0x5d'),_0xeedd('0x51'),_0x2c9530,JSON[_0xeedd('0x5e')](_0x2f39bc));delete _0x2f39bc[_0xeedd('0x27')];if(_0x2c9530===0x191){_0x2c9530=0x190;}_0x3a8329['status'](_0x2c9530)['send'](_0x4b71b6['query'][_0xeedd('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x2f39bc[_0xeedd('0x5c')]}:_0x2f39bc);});}; \ No newline at end of file +var _0x8de1=['undefined','limit','count','offset','set','apply','update','destroy','then','end','sendStatus','error','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','length','options','catch','create','body','find','params','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','Subjects','FreshsalesField','username','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','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/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8de1,0x113));var _0x18de=function(_0x19c5dd,_0x2a35f5){_0x19c5dd=_0x19c5dd-0x0;var _0x40218d=_0x8de1[_0x19c5dd];return _0x40218d;};'use strict';var emlformat=require(_0x18de('0x0'));var rimraf=require(_0x18de('0x1'));var zipdir=require(_0x18de('0x2'));var jsonpatch=require(_0x18de('0x3'));var rp=require(_0x18de('0x4'));var moment=require(_0x18de('0x5'));var BPromise=require(_0x18de('0x6'));var Mustache=require(_0x18de('0x7'));var util=require(_0x18de('0x8'));var path=require(_0x18de('0x9'));var sox=require(_0x18de('0xa'));var csv=require(_0x18de('0xb'));var ejs=require(_0x18de('0xc'));var fs=require('fs');var fs_extra=require(_0x18de('0xd'));var _=require(_0x18de('0xe'));var squel=require(_0x18de('0xf'));var crypto=require('crypto');var jsforce=require(_0x18de('0x10'));var deskjs=require(_0x18de('0x11'));var toCsv=require(_0x18de('0xb'));var querystring=require('querystring');var Papa=require(_0x18de('0x12'));var Redis=require(_0x18de('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x18de('0x14'));var as=require(_0x18de('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18de('0x16'));var utils=require(_0x18de('0x17'));var config=require(_0x18de('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x18de('0x19'));function respondWithStatusCode(_0x321cb6,_0x139737){_0x139737=_0x139737||0xcc;return function(_0x30ddda){if(_0x30ddda){return _0x321cb6['sendStatus'](_0x139737);}return _0x321cb6['status'](_0x139737)['end']();};}function respondWithResult(_0x3e283b,_0xb14c84){_0xb14c84=_0xb14c84||0xc8;return function(_0x37760b){if(_0x37760b){return _0x3e283b[_0x18de('0x1a')](_0xb14c84)[_0x18de('0x1b')](_0x37760b);}};}function respondWithFilteredResult(_0x2e1d4e,_0x4b62f6){return function(_0x26f07c){if(_0x26f07c){var _0x320e88=typeof _0x4b62f6['offset']===_0x18de('0x1c')&&typeof _0x4b62f6[_0x18de('0x1d')]===_0x18de('0x1c');var _0xe39aed=_0x26f07c[_0x18de('0x1e')];var _0x4c9c40=_0x320e88?0x0:_0x4b62f6[_0x18de('0x1f')];var _0x2df677=_0x320e88?_0x26f07c[_0x18de('0x1e')]:_0x4b62f6[_0x18de('0x1f')]+_0x4b62f6[_0x18de('0x1d')];var _0x5b6801;if(_0x2df677>=_0xe39aed){_0x2df677=_0xe39aed;_0x5b6801=0xc8;}else{_0x5b6801=0xce;}_0x2e1d4e[_0x18de('0x1a')](_0x5b6801);return _0x2e1d4e[_0x18de('0x20')]('Content-Range',_0x4c9c40+'-'+_0x2df677+'/'+_0xe39aed)[_0x18de('0x1b')](_0x26f07c);}return null;};}function patchUpdates(_0x28ff4d){return function(_0x1b0fb1){try{jsonpatch[_0x18de('0x21')](_0x1b0fb1,_0x28ff4d,!![]);}catch(_0x1de8e7){return BPromise['reject'](_0x1de8e7);}return _0x1b0fb1['save']();};}function saveUpdates(_0x492af9,_0x24fb67){return function(_0x23a430){if(_0x23a430){return _0x23a430[_0x18de('0x22')](_0x492af9)['then'](function(_0x5c9f34){return _0x5c9f34;});}return null;};}function removeEntity(_0x1c3aa2,_0x2b8bc1){return function(_0x225af4){if(_0x225af4){return _0x225af4[_0x18de('0x23')]()[_0x18de('0x24')](function(){_0x1c3aa2[_0x18de('0x1a')](0xcc)[_0x18de('0x25')]();});}};}function handleEntityNotFound(_0x522a84,_0x4011ee){return function(_0x35237e){if(!_0x35237e){_0x522a84[_0x18de('0x26')](0x194);}return _0x35237e;};}function handleError(_0x3adc50,_0x5aad22){_0x5aad22=_0x5aad22||0x1f4;return function(_0x421856){logger[_0x18de('0x27')](_0x421856['stack']);if(_0x421856[_0x18de('0x28')]){delete _0x421856[_0x18de('0x28')];}_0x3adc50['status'](_0x5aad22)['send'](_0x421856);};}exports[_0x18de('0x29')]=function(_0x36485e,_0x3c3ea8){var _0x26f7dd={},_0x598d4d={},_0x1b1ebc={'count':0x0,'rows':[]};var _0x3d46a6=_[_0x18de('0x2a')](db[_0x18de('0x2b')][_0x18de('0x2c')],function(_0xb951a5){return{'name':_0xb951a5[_0x18de('0x2d')],'type':_0xb951a5[_0x18de('0x2e')][_0x18de('0x2f')]};});_0x598d4d[_0x18de('0x30')]=_[_0x18de('0x2a')](_0x3d46a6,_0x18de('0x28'));_0x598d4d[_0x18de('0x31')]=_[_0x18de('0x32')](_0x36485e[_0x18de('0x31')]);_0x598d4d[_0x18de('0x33')]=_[_0x18de('0x34')](_0x598d4d[_0x18de('0x30')],_0x598d4d['query']);_0x26f7dd[_0x18de('0x35')]=_[_0x18de('0x34')](_0x598d4d[_0x18de('0x30')],qs[_0x18de('0x36')](_0x36485e[_0x18de('0x31')]['fields']));_0x26f7dd['attributes']=_0x26f7dd[_0x18de('0x35')]['length']?_0x26f7dd['attributes']:_0x598d4d[_0x18de('0x30')];if(!_0x36485e[_0x18de('0x31')][_0x18de('0x37')](_0x18de('0x38'))){_0x26f7dd[_0x18de('0x1d')]=qs['limit'](_0x36485e[_0x18de('0x31')][_0x18de('0x1d')]);_0x26f7dd[_0x18de('0x1f')]=qs['offset'](_0x36485e[_0x18de('0x31')]['offset']);}_0x26f7dd[_0x18de('0x39')]=qs[_0x18de('0x3a')](_0x36485e[_0x18de('0x31')][_0x18de('0x3a')]);_0x26f7dd[_0x18de('0x3b')]=qs[_0x18de('0x33')](_[_0x18de('0x3c')](_0x36485e[_0x18de('0x31')],_0x598d4d[_0x18de('0x33')]),_0x3d46a6);if(_0x36485e[_0x18de('0x31')][_0x18de('0x3d')]){_0x26f7dd[_0x18de('0x3b')]=_[_0x18de('0x3e')](_0x26f7dd[_0x18de('0x3b')],{'$or':_[_0x18de('0x2a')](_0x3d46a6,function(_0x10f2c9){if(_0x10f2c9[_0x18de('0x2e')]!==_0x18de('0x3f')){var _0x1d615a={};_0x1d615a[_0x10f2c9['name']]={'$like':'%'+_0x36485e[_0x18de('0x31')]['filter']+'%'};return _0x1d615a;}})});}_0x26f7dd=_[_0x18de('0x3e')]({},_0x26f7dd,_0x36485e['options']);var _0x256e7c={'where':_0x26f7dd[_0x18de('0x3b')]};return db[_0x18de('0x2b')][_0x18de('0x1e')](_0x256e7c)['then'](function(_0x4d3674){_0x1b1ebc[_0x18de('0x1e')]=_0x4d3674;if(_0x36485e[_0x18de('0x31')][_0x18de('0x40')]){_0x26f7dd[_0x18de('0x41')]=[{'all':!![]}];}return db[_0x18de('0x2b')][_0x18de('0x42')](_0x26f7dd);})['then'](function(_0x2a9223){_0x1b1ebc['rows']=_0x2a9223;return _0x1b1ebc;})['then'](respondWithFilteredResult(_0x3c3ea8,_0x26f7dd))['catch'](handleError(_0x3c3ea8,null));};exports[_0x18de('0x43')]=function(_0x59b0c9,_0x3d51f3){var _0x24f30c={'raw':![],'where':{'id':_0x59b0c9['params']['id']}},_0x3eaa69={};_0x3eaa69[_0x18de('0x30')]=_[_0x18de('0x32')](db[_0x18de('0x2b')]['rawAttributes']);_0x3eaa69['query']=_[_0x18de('0x32')](_0x59b0c9['query']);_0x3eaa69[_0x18de('0x33')]=_['intersection'](_0x3eaa69['model'],_0x3eaa69['query']);_0x24f30c[_0x18de('0x35')]=_[_0x18de('0x34')](_0x3eaa69[_0x18de('0x30')],qs[_0x18de('0x36')](_0x59b0c9[_0x18de('0x31')][_0x18de('0x36')]));_0x24f30c['attributes']=_0x24f30c['attributes'][_0x18de('0x44')]?_0x24f30c[_0x18de('0x35')]:_0x3eaa69[_0x18de('0x30')];if(_0x59b0c9[_0x18de('0x31')][_0x18de('0x40')]){_0x24f30c[_0x18de('0x41')]=[{'all':!![]}];}_0x24f30c=_[_0x18de('0x3e')]({},_0x24f30c,_0x59b0c9[_0x18de('0x45')]);return db[_0x18de('0x2b')]['find'](_0x24f30c)['then'](handleEntityNotFound(_0x3d51f3,null))[_0x18de('0x24')](respondWithResult(_0x3d51f3,null))[_0x18de('0x46')](handleError(_0x3d51f3,null));};exports[_0x18de('0x47')]=function(_0x158a71,_0x537fe7){return db[_0x18de('0x2b')][_0x18de('0x47')](_0x158a71['body'],{})[_0x18de('0x24')](respondWithResult(_0x537fe7,0xc9))[_0x18de('0x46')](handleError(_0x537fe7,null));};exports[_0x18de('0x22')]=function(_0xd87198,_0x3a7913){if(_0xd87198[_0x18de('0x48')]['id']){delete _0xd87198[_0x18de('0x48')]['id'];}return db[_0x18de('0x2b')][_0x18de('0x49')]({'where':{'id':_0xd87198['params']['id']}})[_0x18de('0x24')](handleEntityNotFound(_0x3a7913,null))['then'](saveUpdates(_0xd87198[_0x18de('0x48')],null))[_0x18de('0x24')](respondWithResult(_0x3a7913,null))['catch'](handleError(_0x3a7913,null));};exports[_0x18de('0x23')]=function(_0x49f5c7,_0x321d59){return db[_0x18de('0x2b')][_0x18de('0x49')]({'where':{'id':_0x49f5c7[_0x18de('0x4a')]['id']}})[_0x18de('0x24')](handleEntityNotFound(_0x321d59,null))['then'](removeEntity(_0x321d59,null))['catch'](handleError(_0x321d59,null));};exports[_0x18de('0x4b')]=function(_0x1eb707,_0x226b61,_0x35b7c5){var _0x18d275={};var _0x592db3={};var _0x4e6bdc;var _0x3db84b;return db[_0x18de('0x2b')]['findOne']({'where':{'id':_0x1eb707[_0x18de('0x4a')]['id']}})['then'](handleEntityNotFound(_0x226b61,null))['then'](function(_0x53009e){if(_0x53009e){_0x4e6bdc=_0x53009e;_0x592db3[_0x18de('0x30')]=_[_0x18de('0x32')](db[_0x18de('0x4c')][_0x18de('0x2c')]);_0x592db3[_0x18de('0x31')]=_[_0x18de('0x32')](_0x1eb707[_0x18de('0x31')]);_0x592db3[_0x18de('0x33')]=_[_0x18de('0x34')](_0x592db3[_0x18de('0x30')],_0x592db3[_0x18de('0x31')]);_0x18d275['attributes']=_[_0x18de('0x34')](_0x592db3[_0x18de('0x30')],qs[_0x18de('0x36')](_0x1eb707[_0x18de('0x31')][_0x18de('0x36')]));_0x18d275['attributes']=_0x18d275[_0x18de('0x35')][_0x18de('0x44')]?_0x18d275[_0x18de('0x35')]:_0x592db3[_0x18de('0x30')];_0x18d275['order']=qs[_0x18de('0x3a')](_0x1eb707[_0x18de('0x31')][_0x18de('0x3a')]);_0x18d275[_0x18de('0x3b')]=qs[_0x18de('0x33')](_['pick'](_0x1eb707['query'],_0x592db3['filters']));if(_0x1eb707[_0x18de('0x31')]['filter']){_0x18d275[_0x18de('0x3b')]=_['merge'](_0x18d275[_0x18de('0x3b')],{'$or':_[_0x18de('0x2a')](_0x18d275[_0x18de('0x35')],function(_0x4c6412){var _0x467981={};_0x467981[_0x4c6412]={'$like':'%'+_0x1eb707[_0x18de('0x31')]['filter']+'%'};return _0x467981;})});}_0x18d275=_[_0x18de('0x3e')]({},_0x18d275,_0x1eb707['options']);return _0x4e6bdc['getConfigurations'](_0x18d275);}})[_0x18de('0x24')](function(_0x4c7376){if(_0x4c7376){_0x3db84b=_0x4c7376[_0x18de('0x44')];if(!_0x1eb707[_0x18de('0x31')][_0x18de('0x37')](_0x18de('0x38'))){_0x18d275[_0x18de('0x1d')]=qs[_0x18de('0x1d')](_0x1eb707[_0x18de('0x31')]['limit']);_0x18d275[_0x18de('0x1f')]=qs['offset'](_0x1eb707[_0x18de('0x31')][_0x18de('0x1f')]);}return _0x4e6bdc[_0x18de('0x4b')](_0x18d275);}})['then'](function(_0x48e981){if(_0x48e981){return _0x48e981?{'count':_0x3db84b,'rows':_0x48e981}:null;}})[_0x18de('0x24')](respondWithResult(_0x226b61,null))[_0x18de('0x46')](handleError(_0x226b61,null));};exports[_0x18de('0x4d')]=function(_0x1bff95,_0x5a256c,_0x1c4f68){if(_0x1bff95[_0x18de('0x48')]['id']){delete _0x1bff95['body']['id'];}return db[_0x18de('0x2b')][_0x18de('0x4e')]({'where':{'id':_0x1bff95['params']['id']}})[_0x18de('0x24')](handleEntityNotFound(_0x5a256c,null))[_0x18de('0x24')](function(_0x3a8450){if(_0x3a8450){_0x1bff95[_0x18de('0x48')][_0x18de('0x4f')]=_0x3a8450['id'];_0x1bff95['body']['Subjects']=integrations['getSubjects'](_0x1bff95['body'][_0x18de('0x50')],_0x1bff95['body'][_0x18de('0x2e')]);_0x1bff95[_0x18de('0x48')][_0x18de('0x51')]=integrations[_0x18de('0x52')](_0x1bff95[_0x18de('0x48')][_0x18de('0x50')],_0x1bff95[_0x18de('0x48')]['type']);return db[_0x18de('0x4c')]['create'](_0x1bff95[_0x18de('0x48')],{'include':[{'model':db['FreshsalesField'],'as':_0x18de('0x53')},{'model':db[_0x18de('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5a256c,null))[_0x18de('0x46')](handleError(_0x5a256c,null));};exports['getFields']=function(_0x483b89,_0x23cba8,_0x119aba){var _0x535985='';var _0x24fd1e='';return db['FreshsalesAccount'][_0x18de('0x4e')]({'where':{'id':_0x483b89[_0x18de('0x4a')]['id']},'attributes':['id',_0x18de('0x55'),_0x18de('0x56'),_0x18de('0x57')]})[_0x18de('0x24')](handleEntityNotFound(_0x23cba8,null))[_0x18de('0x24')](function(_0x347b03){if(_0x347b03){_0x24fd1e=_0x347b03[_0x18de('0x55')];_0x535985=_0x347b03['remoteUri'];var _0x25697e=_0x347b03[_0x18de('0x56')]['slice'](-0x1);if(_0x25697e==='/'){_0x535985=_0x535985[_0x18de('0x58')](0x0,_0x535985[_0x18de('0x59')](_0x25697e));}return rp({'method':_0x18de('0x5a'),'uri':util[_0x18de('0x5b')](_0x18de('0x5c'),_0x535985,'/api/selector/owners'),'headers':{'Authorization':_0x18de('0x5d')+_0x347b03['apiKey']},'json':!![]});}})[_0x18de('0x24')](function(_0x448b38){if(_0x448b38){var _0x40aa26=_0x448b38[_0x18de('0x5e')];var _0x42d34e=![];var _0x45046d=null;for(_0x45046d=0x0;_0x45046d<_0x40aa26['length'];_0x45046d++){if(_0x40aa26[_0x45046d]['email']===_0x24fd1e){_0x42d34e=!![];}}if(_0x42d34e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x18de('0x5f')});}}})['then'](respondWithResult(_0x23cba8,null))[_0x18de('0x46')](function(_0x37212c){var _0x4bf079=_0x483b89[_0x18de('0x31')][_0x18de('0x60')]?0x1f4:_0x37212c[_0x18de('0x61')]||0x1f4;logger['error'](_0x18de('0x62'),_0x18de('0x63'),_0x4bf079,JSON['stringify'](_0x37212c));delete _0x37212c['name'];if(_0x4bf079===0x191){_0x4bf079=0x190;}_0x23cba8[_0x18de('0x1a')](_0x4bf079)['send'](_0x483b89[_0x18de('0x31')][_0x18de('0x60')]?{'message':_0x18de('0x64'),'statusCode':_0x37212c[_0x18de('0x61')]}:_0x37212c);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 06de2c6..4002930 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 _0x4137=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util','../../config/logger','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'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'));var integrations=require(_0x7413('0xb'));module['exports']=function(_0xc808cd,_0x188d89){return _0xc808cd[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32f4=['define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4290e7,_0x57cd3b){var _0x2b63b9=function(_0x211f0d){while(--_0x211f0d){_0x4290e7['push'](_0x4290e7['shift']());}};_0x2b63b9(++_0x57cd3b);}(_0x32f4,0x154));var _0x432f=function(_0x4694d8,_0x5b23a8){_0x4694d8=_0x4694d8-0x0;var _0xe14393=_0x32f4[_0x4694d8];return _0xe14393;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require(_0x432f('0x2'))(_0x432f('0x3'));var moment=require('moment');var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));var integrations=require(_0x432f('0x9'));module[_0x432f('0xa')]=function(_0x5d8cc0,_0x5b5f08){return _0x5d8cc0[_0x432f('0xb')](_0x432f('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 60cf71b..b69d90d 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 _0xd943=['limit','include','map','model','attributes','debug','ShowFreshsalesAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0xd943,0x15d));var _0x3d94=function(_0x1bcbac,_0x569cdf){_0x1bcbac=_0x1bcbac-0x0;var _0x90b699=_0xd943[_0x1bcbac];return _0x90b699;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['findAll']({'raw':_0x2acee3[_0x3d94('0x16')]?_0x2acee3['options'][_0x3d94('0x17')]===undefined?!![]:![]:!![],'where':_0x2acee3[_0x3d94('0x16')]?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x18')]||null:null,'attributes':_0x2acee3[_0x3d94('0x16')]?_0x2acee3['options']['attributes']||null:null,'limit':_0x2acee3[_0x3d94('0x16')]?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x19')]||null:null,'include':_0x2acee3['options']?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x2acee3[_0x3d94('0x16')][_0x3d94('0x1a')],function(_0x4093a4){return{'model':db[_0x4093a4[_0x3d94('0x1c')]],'as':_0x4093a4['as'],'attributes':_0x4093a4[_0x3d94('0x1d')],'include':_0x4093a4[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x4093a4[_0x3d94('0x1a')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1c')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1d')],'include':_0x192839[_0x3d94('0x1a')]?_['map'](_0x192839[_0x3d94('0x1a')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1c')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xa')](function(_0x439173){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1e')]('GetFreshsalesAccount',_0x2acee3,JSON['stringify'](_0x439173));_0x4afc92(_0x439173);})[_0x3d94('0x13')](function(_0x4813e1){logger['error'](_0x3d94('0x14'),_0x4813e1['message'],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0x4813e1[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1f')]=function(_0x4cef9c){var _0x2a07b4=this;return new Promise(function(_0x4c1237,_0x3d4994){return db['FreshsalesAccount'][_0x3d94('0x20')]({'raw':_0x4cef9c[_0x3d94('0x16')]?_0x4cef9c[_0x3d94('0x16')][_0x3d94('0x17')]===undefined?!![]:![]:!![],'where':_0x4cef9c['options']?_0x4cef9c[_0x3d94('0x16')]['where']||null:null,'attributes':_0x4cef9c[_0x3d94('0x16')]?_0x4cef9c[_0x3d94('0x16')]['attributes']||null:null,'include':_0x4cef9c['options']?_0x4cef9c[_0x3d94('0x16')][_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x4cef9c['options'][_0x3d94('0x1a')],function(_0x3d29fd){return{'model':db[_0x3d29fd['model']],'as':_0x3d29fd['as'],'attributes':_0x3d29fd[_0x3d94('0x1d')],'include':_0x3d29fd[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x3d29fd[_0x3d94('0x1a')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1d')],'include':_0x782c1[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x782c1[_0x3d94('0x1a')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1c')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfe58eb){logger[_0x3d94('0xb')](_0x3d94('0x1f'),_0x4cef9c);logger[_0x3d94('0x1e')](_0x3d94('0x1f'),_0x4cef9c,JSON[_0x3d94('0x21')](_0xfe58eb));_0x4c1237(_0xfe58eb);})[_0x3d94('0x13')](function(_0x12c01a){logger[_0x3d94('0xe')](_0x3d94('0x1f'),_0x12c01a['message'],_0x4cef9c);_0x3d4994(_0x2a07b4[_0x3d94('0xe')](0x1f4,_0x12c01a[_0x3d94('0x11')]));});});}; \ No newline at end of file +var _0x47c5=['include','model','attributes','map','GetFreshsalesAccount','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FreshsalesAccount','findAll','options','raw'];(function(_0x5681ed,_0x352e95){var _0x33d383=function(_0x127eb9){while(--_0x127eb9){_0x5681ed['push'](_0x5681ed['shift']());}};_0x33d383(++_0x352e95);}(_0x47c5,0x165));var _0x547c=function(_0xb517fb,_0x1ae8bc){_0xb517fb=_0xb517fb-0x0;var _0x348a16=_0x47c5[_0xb517fb];return _0x348a16;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['GetFreshsalesAccount']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')]({'raw':_0x23fa9e[_0x547c('0x1a')]?_0x23fa9e['options'][_0x547c('0x1b')]===undefined?!![]:![]:!![],'where':_0x23fa9e[_0x547c('0x1a')]?_0x23fa9e['options']['where']||null:null,'attributes':_0x23fa9e[_0x547c('0x1a')]?_0x23fa9e[_0x547c('0x1a')]['attributes']||null:null,'limit':_0x23fa9e[_0x547c('0x1a')]?_0x23fa9e[_0x547c('0x1a')]['limit']||null:null,'include':_0x23fa9e[_0x547c('0x1a')]?_0x23fa9e[_0x547c('0x1a')][_0x547c('0x1c')]?_['map'](_0x23fa9e[_0x547c('0x1a')][_0x547c('0x1c')],function(_0x470694){return{'model':db[_0x470694[_0x547c('0x1d')]],'as':_0x470694['as'],'attributes':_0x470694[_0x547c('0x1e')],'include':_0x470694[_0x547c('0x1c')]?_[_0x547c('0x1f')](_0x470694[_0x547c('0x1c')],function(_0x507895){return{'model':db[_0x507895[_0x547c('0x1d')]],'as':_0x507895['as'],'attributes':_0x507895['attributes'],'include':_0x507895['include']?_['map'](_0x507895['include'],function(_0x2c725d){return{'model':db[_0x2c725d['model']],'as':_0x2c725d['as'],'attributes':_0x2c725d[_0x547c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ea493){logger['info'](_0x547c('0x20'),_0x23fa9e);logger[_0x547c('0x10')](_0x547c('0x20'),_0x23fa9e,JSON[_0x547c('0x12')](_0x3ea493));_0xeb059e(_0x3ea493);})[_0x547c('0x17')](function(_0x569924){logger['error'](_0x547c('0x20'),_0x569924['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x569924[_0x547c('0x15')]));});});};exports[_0x547c('0x21')]=function(_0x1695be){var _0x4652e7=this;return new Promise(function(_0x51e6e7,_0x342c10){return db['FreshsalesAccount']['find']({'raw':_0x1695be[_0x547c('0x1a')]?_0x1695be[_0x547c('0x1a')][_0x547c('0x1b')]===undefined?!![]:![]:!![],'where':_0x1695be[_0x547c('0x1a')]?_0x1695be[_0x547c('0x1a')][_0x547c('0x22')]||null:null,'attributes':_0x1695be[_0x547c('0x1a')]?_0x1695be[_0x547c('0x1a')][_0x547c('0x1e')]||null:null,'include':_0x1695be[_0x547c('0x1a')]?_0x1695be[_0x547c('0x1a')][_0x547c('0x1c')]?_[_0x547c('0x1f')](_0x1695be[_0x547c('0x1a')]['include'],function(_0x3afc28){return{'model':db[_0x3afc28['model']],'as':_0x3afc28['as'],'attributes':_0x3afc28['attributes'],'include':_0x3afc28['include']?_[_0x547c('0x1f')](_0x3afc28[_0x547c('0x1c')],function(_0x31c7d3){return{'model':db[_0x31c7d3[_0x547c('0x1d')]],'as':_0x31c7d3['as'],'attributes':_0x31c7d3[_0x547c('0x1e')],'include':_0x31c7d3[_0x547c('0x1c')]?_['map'](_0x31c7d3['include'],function(_0x5ea2c7){return{'model':db[_0x5ea2c7[_0x547c('0x1d')]],'as':_0x5ea2c7['as'],'attributes':_0x5ea2c7[_0x547c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x547c('0xc')](function(_0x44687e){logger[_0x547c('0xd')](_0x547c('0x21'),_0x1695be);logger['debug'](_0x547c('0x21'),_0x1695be,JSON['stringify'](_0x44687e));_0x51e6e7(_0x44687e);})[_0x547c('0x17')](function(_0x18fcc5){logger['error'](_0x547c('0x21'),_0x18fcc5['message'],_0x1695be);_0x342c10(_0x4652e7['error'](0x1f4,_0x18fcc5[_0x547c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 96d9586..6622c22 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 _0x1bcb=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','destroy','exports','util','path'];(function(_0x40c15b,_0x3aa0bf){var _0x3bb067=function(_0x5356b0){while(--_0x5356b0){_0x40c15b['push'](_0x40c15b['shift']());}};_0x3bb067(++_0x3aa0bf);}(_0x1bcb,0xc4));var _0xb1bc=function(_0x1d01f7,_0x24da1e){_0x1d01f7=_0x1d01f7-0x0;var _0x20609c=_0x1bcb[_0x1d01f7];return _0x20609c;};'use strict';var multer=require('multer');var util=require(_0xb1bc('0x0'));var path=require(_0xb1bc('0x1'));var timeout=require('connect-timeout');var express=require(_0xb1bc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb1bc('0x3'));var interaction=require(_0xb1bc('0x4'));var config=require(_0xb1bc('0x5'));var controller=require(_0xb1bc('0x6'));router[_0xb1bc('0x7')]('/',auth[_0xb1bc('0x8')](),controller[_0xb1bc('0x9')]);router[_0xb1bc('0x7')](_0xb1bc('0xa'),auth[_0xb1bc('0x8')](),controller['show']);router['get'](_0xb1bc('0xb'),auth['isAuthenticated'](),controller[_0xb1bc('0xc')]);router['get'](_0xb1bc('0xd'),auth[_0xb1bc('0x8')](),controller[_0xb1bc('0xe')]);router[_0xb1bc('0x7')](_0xb1bc('0xf'),auth['isAuthenticated'](),controller[_0xb1bc('0x10')]);router[_0xb1bc('0x11')]('/',auth['isAuthenticated'](),controller[_0xb1bc('0x12')]);router[_0xb1bc('0x13')]('/:id',auth[_0xb1bc('0x8')](),controller['update']);router['delete'](_0xb1bc('0xa'),auth['isAuthenticated'](),controller[_0xb1bc('0x14')]);module[_0xb1bc('0x15')]=router; \ No newline at end of file +var _0xd9c5=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x4620d4,_0x515a83){var _0x5e4d64=function(_0x7292e9){while(--_0x7292e9){_0x4620d4['push'](_0x4620d4['shift']());}};_0x5e4d64(++_0x515a83);}(_0xd9c5,0x18c));var _0x5d9c=function(_0x53c87d,_0x26a4f5){_0x53c87d=_0x53c87d-0x0;var _0x42c635=_0xd9c5[_0x53c87d];return _0x42c635;};'use strict';var multer=require(_0x5d9c('0x0'));var util=require(_0x5d9c('0x1'));var path=require(_0x5d9c('0x2'));var timeout=require(_0x5d9c('0x3'));var express=require(_0x5d9c('0x4'));var router=express[_0x5d9c('0x5')]();var fs_extra=require(_0x5d9c('0x6'));var auth=require(_0x5d9c('0x7'));var interaction=require(_0x5d9c('0x8'));var config=require('../../config/environment');var controller=require(_0x5d9c('0x9'));router[_0x5d9c('0xa')]('/',auth[_0x5d9c('0xb')](),controller[_0x5d9c('0xc')]);router[_0x5d9c('0xa')](_0x5d9c('0xd'),auth[_0x5d9c('0xb')](),controller[_0x5d9c('0xe')]);router[_0x5d9c('0xa')](_0x5d9c('0xf'),auth[_0x5d9c('0xb')](),controller[_0x5d9c('0x10')]);router[_0x5d9c('0xa')](_0x5d9c('0x11'),auth[_0x5d9c('0xb')](),controller[_0x5d9c('0x12')]);router[_0x5d9c('0xa')]('/:id/fields',auth[_0x5d9c('0xb')](),controller['getFields']);router[_0x5d9c('0x13')]('/',auth[_0x5d9c('0xb')](),controller[_0x5d9c('0x14')]);router[_0x5d9c('0x15')](_0x5d9c('0xd'),auth['isAuthenticated'](),controller[_0x5d9c('0x16')]);router[_0x5d9c('0x17')](_0x5d9c('0xd'),auth[_0x5d9c('0xb')](),controller[_0x5d9c('0x18')]);module[_0x5d9c('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index fd53571..d9583b0 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 _0xc316=['STRING','sequelize','exports'];(function(_0x48ed7e,_0x5629be){var _0x56abfb=function(_0x46a46a){while(--_0x46a46a){_0x48ed7e['push'](_0x48ed7e['shift']());}};_0x56abfb(++_0x5629be);}(_0xc316,0x9a));var _0x6c31=function(_0x548003,_0x19cd0e){_0x548003=_0x548003-0x0;var _0x459a44=_0xc316[_0x548003];return _0x459a44;};'use strict';var Sequelize=require(_0x6c31('0x0'));module[_0x6c31('0x1')]={'name':{'type':Sequelize[_0x6c31('0x2')]},'description':{'type':Sequelize[_0x6c31('0x2')]}}; \ No newline at end of file +var _0xd4b8=['STRING','exports'];(function(_0x138b14,_0x4e7854){var _0xa6c08c=function(_0x559547){while(--_0x559547){_0x138b14['push'](_0x138b14['shift']());}};_0xa6c08c(++_0x4e7854);}(_0xd4b8,0x10d));var _0x8d4b=function(_0x8566f1,_0x198297){_0x8566f1=_0x8566f1-0x0;var _0x2174c1=_0xd4b8[_0x8566f1];return _0x2174c1;};'use strict';var Sequelize=require('sequelize');module[_0x8d4b('0x0')]={'name':{'type':Sequelize[_0x8d4b('0x1')]},'description':{'type':Sequelize[_0x8d4b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index b9bed24..162e9fc 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 _0x4883=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','type','includeAll','include','rows','catch','show','params','keys','options','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x19cbf4,_0x669e30){var _0x15a86e=function(_0x5f231b){while(--_0x5f231b){_0x19cbf4['push'](_0x19cbf4['shift']());}};_0x15a86e(++_0x669e30);}(_0x4883,0x138));var _0x3488=function(_0x3a9bb3,_0x204909){_0x3a9bb3=_0x3a9bb3-0x0;var _0x5169a8=_0x4883[_0x3a9bb3];return _0x5169a8;};'use strict';var emlformat=require(_0x3488('0x0'));var rimraf=require(_0x3488('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3488('0x2'));var rp=require(_0x3488('0x3'));var moment=require(_0x3488('0x4'));var BPromise=require(_0x3488('0x5'));var Mustache=require(_0x3488('0x6'));var util=require(_0x3488('0x7'));var path=require(_0x3488('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3488('0x9'));var fs=require('fs');var fs_extra=require(_0x3488('0xa'));var _=require('lodash');var squel=require(_0x3488('0xb'));var crypto=require(_0x3488('0xc'));var jsforce=require(_0x3488('0xd'));var deskjs=require(_0x3488('0xe'));var toCsv=require(_0x3488('0xf'));var querystring=require('querystring');var Papa=require(_0x3488('0x10'));var Redis=require(_0x3488('0x11'));var authService=require(_0x3488('0x12'));var qs=require(_0x3488('0x13'));var as=require(_0x3488('0x14'));var hardwareService=require(_0x3488('0x15'));var logger=require(_0x3488('0x16'))(_0x3488('0x17'));var utils=require(_0x3488('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3488('0x19'));var db=require(_0x3488('0x1a'))['db'];function respondWithStatusCode(_0x30483c,_0x359c2a){_0x359c2a=_0x359c2a||0xcc;return function(_0x476e71){if(_0x476e71){return _0x30483c[_0x3488('0x1b')](_0x359c2a);}return _0x30483c[_0x3488('0x1c')](_0x359c2a)[_0x3488('0x1d')]();};}function respondWithResult(_0x35f443,_0xdab1ff){_0xdab1ff=_0xdab1ff||0xc8;return function(_0x3a0a1e){if(_0x3a0a1e){return _0x35f443['status'](_0xdab1ff)[_0x3488('0x1e')](_0x3a0a1e);}};}function respondWithFilteredResult(_0x346338,_0x3f86d9){return function(_0x18689a){if(_0x18689a){var _0xce0670=typeof _0x3f86d9[_0x3488('0x1f')]===_0x3488('0x20')&&typeof _0x3f86d9[_0x3488('0x21')]===_0x3488('0x20');var _0x552386=_0x18689a[_0x3488('0x22')];var _0xe39800=_0xce0670?0x0:_0x3f86d9[_0x3488('0x1f')];var _0x5d4c30=_0xce0670?_0x18689a['count']:_0x3f86d9[_0x3488('0x1f')]+_0x3f86d9[_0x3488('0x21')];var _0x3d2cf3;if(_0x5d4c30>=_0x552386){_0x5d4c30=_0x552386;_0x3d2cf3=0xc8;}else{_0x3d2cf3=0xce;}_0x346338[_0x3488('0x1c')](_0x3d2cf3);return _0x346338[_0x3488('0x23')](_0x3488('0x24'),_0xe39800+'-'+_0x5d4c30+'/'+_0x552386)[_0x3488('0x1e')](_0x18689a);}return null;};}function patchUpdates(_0x1d6bc7){return function(_0x27990e){try{jsonpatch[_0x3488('0x25')](_0x27990e,_0x1d6bc7,!![]);}catch(_0x4d75a1){return BPromise['reject'](_0x4d75a1);}return _0x27990e[_0x3488('0x26')]();};}function saveUpdates(_0x350998,_0x413588){return function(_0x3aacff){if(_0x3aacff){return _0x3aacff[_0x3488('0x27')](_0x350998)[_0x3488('0x28')](function(_0x2808ad){return _0x2808ad;});}return null;};}function removeEntity(_0x6637ff,_0x210204){return function(_0x3c543b){if(_0x3c543b){return _0x3c543b[_0x3488('0x29')]()[_0x3488('0x28')](function(){_0x6637ff['status'](0xcc)[_0x3488('0x1d')]();});}};}function handleEntityNotFound(_0x5791a6,_0xede8a7){return function(_0x493da4){if(!_0x493da4){_0x5791a6[_0x3488('0x1b')](0x194);}return _0x493da4;};}function handleError(_0x3c5949,_0x11d8c7){_0x11d8c7=_0x11d8c7||0x1f4;return function(_0x59e9c8){logger[_0x3488('0x2a')](_0x59e9c8[_0x3488('0x2b')]);if(_0x59e9c8[_0x3488('0x2c')]){delete _0x59e9c8[_0x3488('0x2c')];}_0x3c5949['status'](_0x11d8c7)[_0x3488('0x2d')](_0x59e9c8);};}exports[_0x3488('0x2e')]=function(_0x2bbb92,_0x113b4c){var _0x304d3f={},_0x43a4a7={},_0xa8ad2={'count':0x0,'rows':[]};var _0x540aed=_['map'](db[_0x3488('0x2f')][_0x3488('0x30')],function(_0x2a2610){return{'name':_0x2a2610[_0x3488('0x31')],'type':_0x2a2610['type'][_0x3488('0x32')]};});_0x43a4a7[_0x3488('0x33')]=_['map'](_0x540aed,_0x3488('0x2c'));_0x43a4a7[_0x3488('0x34')]=_['keys'](_0x2bbb92[_0x3488('0x34')]);_0x43a4a7['filters']=_[_0x3488('0x35')](_0x43a4a7[_0x3488('0x33')],_0x43a4a7[_0x3488('0x34')]);_0x304d3f[_0x3488('0x36')]=_[_0x3488('0x35')](_0x43a4a7[_0x3488('0x33')],qs[_0x3488('0x37')](_0x2bbb92[_0x3488('0x34')]['fields']));_0x304d3f[_0x3488('0x36')]=_0x304d3f[_0x3488('0x36')][_0x3488('0x38')]?_0x304d3f[_0x3488('0x36')]:_0x43a4a7[_0x3488('0x33')];if(!_0x2bbb92[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x304d3f['limit']=qs[_0x3488('0x21')](_0x2bbb92[_0x3488('0x34')]['limit']);_0x304d3f['offset']=qs[_0x3488('0x1f')](_0x2bbb92[_0x3488('0x34')]['offset']);}_0x304d3f[_0x3488('0x3b')]=qs[_0x3488('0x3c')](_0x2bbb92['query'][_0x3488('0x3c')]);_0x304d3f['where']=qs[_0x3488('0x3d')](_[_0x3488('0x3e')](_0x2bbb92[_0x3488('0x34')],_0x43a4a7[_0x3488('0x3d')]),_0x540aed);if(_0x2bbb92[_0x3488('0x34')][_0x3488('0x3f')]){_0x304d3f['where']=_[_0x3488('0x40')](_0x304d3f[_0x3488('0x41')],{'$or':_[_0x3488('0x42')](_0x540aed,function(_0x2a7a15){if(_0x2a7a15[_0x3488('0x43')]!=='VIRTUAL'){var _0x4498bd={};_0x4498bd[_0x2a7a15[_0x3488('0x2c')]]={'$like':'%'+_0x2bbb92[_0x3488('0x34')][_0x3488('0x3f')]+'%'};return _0x4498bd;}})});}_0x304d3f=_['merge']({},_0x304d3f,_0x2bbb92['options']);var _0x464bf9={'where':_0x304d3f['where']};return db[_0x3488('0x2f')]['count'](_0x464bf9)[_0x3488('0x28')](function(_0x543734){_0xa8ad2[_0x3488('0x22')]=_0x543734;if(_0x2bbb92['query'][_0x3488('0x44')]){_0x304d3f[_0x3488('0x45')]=[{'all':!![]}];}return db[_0x3488('0x2f')]['findAll'](_0x304d3f);})['then'](function(_0xc2ea10){_0xa8ad2[_0x3488('0x46')]=_0xc2ea10;return _0xa8ad2;})[_0x3488('0x28')](respondWithFilteredResult(_0x113b4c,_0x304d3f))[_0x3488('0x47')](handleError(_0x113b4c,null));};exports[_0x3488('0x48')]=function(_0x1b8dbe,_0x5adce8){var _0x39e9c3={'raw':![],'where':{'id':_0x1b8dbe[_0x3488('0x49')]['id']}},_0x7acbdb={};_0x7acbdb['model']=_['keys'](db[_0x3488('0x2f')][_0x3488('0x30')]);_0x7acbdb['query']=_[_0x3488('0x4a')](_0x1b8dbe[_0x3488('0x34')]);_0x7acbdb[_0x3488('0x3d')]=_['intersection'](_0x7acbdb[_0x3488('0x33')],_0x7acbdb[_0x3488('0x34')]);_0x39e9c3[_0x3488('0x36')]=_['intersection'](_0x7acbdb[_0x3488('0x33')],qs[_0x3488('0x37')](_0x1b8dbe[_0x3488('0x34')][_0x3488('0x37')]));_0x39e9c3['attributes']=_0x39e9c3[_0x3488('0x36')][_0x3488('0x38')]?_0x39e9c3['attributes']:_0x7acbdb[_0x3488('0x33')];if(_0x1b8dbe[_0x3488('0x34')][_0x3488('0x44')]){_0x39e9c3[_0x3488('0x45')]=[{'all':!![]}];}_0x39e9c3=_[_0x3488('0x40')]({},_0x39e9c3,_0x1b8dbe[_0x3488('0x4b')]);return db[_0x3488('0x2f')][_0x3488('0x4c')](_0x39e9c3)[_0x3488('0x28')](handleEntityNotFound(_0x5adce8,null))[_0x3488('0x28')](respondWithResult(_0x5adce8,null))[_0x3488('0x47')](handleError(_0x5adce8,null));};exports[_0x3488('0x4d')]=function(_0x4c491f,_0x1c54ff){return db['FreshsalesConfiguration'][_0x3488('0x4d')](_0x4c491f['body'],{})[_0x3488('0x28')](respondWithResult(_0x1c54ff,0xc9))['catch'](handleError(_0x1c54ff,null));};exports[_0x3488('0x27')]=function(_0x103aec,_0x524519){if(_0x103aec['body']['id']){delete _0x103aec[_0x3488('0x4e')]['id'];}return db[_0x3488('0x2f')][_0x3488('0x4c')]({'where':{'id':_0x103aec[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x524519,null))[_0x3488('0x28')](saveUpdates(_0x103aec[_0x3488('0x4e')],null))[_0x3488('0x28')](respondWithResult(_0x524519,null))[_0x3488('0x47')](handleError(_0x524519,null));};exports[_0x3488('0x29')]=function(_0x354cc0,_0x3e454c){return db[_0x3488('0x2f')][_0x3488('0x4c')]({'where':{'id':_0x354cc0[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x3e454c,null))[_0x3488('0x28')](removeEntity(_0x3e454c,null))[_0x3488('0x47')](handleError(_0x3e454c,null));};exports[_0x3488('0x4f')]=function(_0xb025f9,_0x39ebef,_0x3ec44b){var _0x39305c={};var _0x6c8982={};var _0xde730d;var _0x48f622;return db[_0x3488('0x2f')][_0x3488('0x50')]({'where':{'id':_0xb025f9[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x39ebef,null))[_0x3488('0x28')](function(_0x1699e0){if(_0x1699e0){_0xde730d=_0x1699e0;_0x6c8982['model']=_['keys'](db[_0x3488('0x51')][_0x3488('0x30')]);_0x6c8982[_0x3488('0x34')]=_[_0x3488('0x4a')](_0xb025f9['query']);_0x6c8982[_0x3488('0x3d')]=_[_0x3488('0x35')](_0x6c8982['model'],_0x6c8982[_0x3488('0x34')]);_0x39305c[_0x3488('0x36')]=_[_0x3488('0x35')](_0x6c8982[_0x3488('0x33')],qs[_0x3488('0x37')](_0xb025f9[_0x3488('0x34')][_0x3488('0x37')]));_0x39305c[_0x3488('0x36')]=_0x39305c[_0x3488('0x36')][_0x3488('0x38')]?_0x39305c[_0x3488('0x36')]:_0x6c8982[_0x3488('0x33')];_0x39305c[_0x3488('0x3b')]=qs[_0x3488('0x3c')](_0xb025f9[_0x3488('0x34')][_0x3488('0x3c')]);_0x39305c[_0x3488('0x41')]=qs['filters'](_[_0x3488('0x3e')](_0xb025f9[_0x3488('0x34')],_0x6c8982['filters']));if(_0xb025f9[_0x3488('0x34')][_0x3488('0x3f')]){_0x39305c['where']=_[_0x3488('0x40')](_0x39305c[_0x3488('0x41')],{'$or':_[_0x3488('0x42')](_0x39305c[_0x3488('0x36')],function(_0xa5184d){var _0x435377={};_0x435377[_0xa5184d]={'$like':'%'+_0xb025f9['query'][_0x3488('0x3f')]+'%'};return _0x435377;})});}_0x39305c=_[_0x3488('0x40')]({},_0x39305c,_0xb025f9[_0x3488('0x4b')]);return _0xde730d['getSubjects'](_0x39305c);}})[_0x3488('0x28')](function(_0x1a5ff9){if(_0x1a5ff9){_0x48f622=_0x1a5ff9[_0x3488('0x38')];if(!_0xb025f9[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x39305c[_0x3488('0x21')]=qs[_0x3488('0x21')](_0xb025f9[_0x3488('0x34')]['limit']);_0x39305c[_0x3488('0x1f')]=qs[_0x3488('0x1f')](_0xb025f9[_0x3488('0x34')][_0x3488('0x1f')]);}return _0xde730d[_0x3488('0x4f')](_0x39305c);}})[_0x3488('0x28')](function(_0x4b379d){if(_0x4b379d){return _0x4b379d?{'count':_0x48f622,'rows':_0x4b379d}:null;}})[_0x3488('0x28')](respondWithResult(_0x39ebef,null))[_0x3488('0x47')](handleError(_0x39ebef,null));};exports['getDescriptions']=function(_0x3f5f48,_0x214159,_0x3b9498){var _0x8a562b={};var _0x2f7704={};var _0xd55346;var _0x55f22f;return db[_0x3488('0x2f')]['findOne']({'where':{'id':_0x3f5f48[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x214159,null))['then'](function(_0x17f60d){if(_0x17f60d){_0xd55346=_0x17f60d;_0x2f7704['model']=_[_0x3488('0x4a')](db[_0x3488('0x51')]['rawAttributes']);_0x2f7704[_0x3488('0x34')]=_['keys'](_0x3f5f48[_0x3488('0x34')]);_0x2f7704[_0x3488('0x3d')]=_['intersection'](_0x2f7704[_0x3488('0x33')],_0x2f7704['query']);_0x8a562b[_0x3488('0x36')]=_[_0x3488('0x35')](_0x2f7704['model'],qs['fields'](_0x3f5f48[_0x3488('0x34')][_0x3488('0x37')]));_0x8a562b['attributes']=_0x8a562b[_0x3488('0x36')]['length']?_0x8a562b['attributes']:_0x2f7704[_0x3488('0x33')];_0x8a562b['order']=qs[_0x3488('0x3c')](_0x3f5f48[_0x3488('0x34')]['sort']);_0x8a562b[_0x3488('0x41')]=qs['filters'](_[_0x3488('0x3e')](_0x3f5f48[_0x3488('0x34')],_0x2f7704['filters']));if(_0x3f5f48[_0x3488('0x34')]['filter']){_0x8a562b[_0x3488('0x41')]=_[_0x3488('0x40')](_0x8a562b[_0x3488('0x41')],{'$or':_['map'](_0x8a562b[_0x3488('0x36')],function(_0x349127){var _0x58915e={};_0x58915e[_0x349127]={'$like':'%'+_0x3f5f48[_0x3488('0x34')][_0x3488('0x3f')]+'%'};return _0x58915e;})});}_0x8a562b=_[_0x3488('0x40')]({},_0x8a562b,_0x3f5f48[_0x3488('0x4b')]);return _0xd55346[_0x3488('0x52')](_0x8a562b);}})[_0x3488('0x28')](function(_0x28ff3c){if(_0x28ff3c){_0x55f22f=_0x28ff3c[_0x3488('0x38')];if(!_0x3f5f48[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x8a562b['limit']=qs[_0x3488('0x21')](_0x3f5f48[_0x3488('0x34')][_0x3488('0x21')]);_0x8a562b['offset']=qs['offset'](_0x3f5f48[_0x3488('0x34')]['offset']);}return _0xd55346[_0x3488('0x52')](_0x8a562b);}})[_0x3488('0x28')](function(_0x45d322){if(_0x45d322){return _0x45d322?{'count':_0x55f22f,'rows':_0x45d322}:null;}})[_0x3488('0x28')](respondWithResult(_0x214159,null))[_0x3488('0x47')](handleError(_0x214159,null));};exports[_0x3488('0x53')]=function(_0x2cfd2a,_0x57ef2d,_0x873325){var _0x36419c={};var _0x4a490d={};var _0x5bc540;var _0x44ed17;return db[_0x3488('0x2f')][_0x3488('0x50')]({'where':{'id':_0x2cfd2a[_0x3488('0x49')]['id']}})[_0x3488('0x28')](handleEntityNotFound(_0x57ef2d,null))[_0x3488('0x28')](function(_0x1baa55){if(_0x1baa55){_0x5bc540=_0x1baa55;_0x4a490d[_0x3488('0x33')]=_[_0x3488('0x4a')](db[_0x3488('0x51')][_0x3488('0x30')]);_0x4a490d[_0x3488('0x34')]=_['keys'](_0x2cfd2a[_0x3488('0x34')]);_0x4a490d['filters']=_[_0x3488('0x35')](_0x4a490d['model'],_0x4a490d[_0x3488('0x34')]);_0x36419c[_0x3488('0x36')]=_['intersection'](_0x4a490d[_0x3488('0x33')],qs['fields'](_0x2cfd2a[_0x3488('0x34')][_0x3488('0x37')]));_0x36419c['attributes']=_0x36419c[_0x3488('0x36')][_0x3488('0x38')]?_0x36419c[_0x3488('0x36')]:_0x4a490d[_0x3488('0x33')];_0x36419c[_0x3488('0x3b')]=qs[_0x3488('0x3c')](_0x2cfd2a['query'][_0x3488('0x3c')]);_0x36419c[_0x3488('0x41')]=qs[_0x3488('0x3d')](_['pick'](_0x2cfd2a['query'],_0x4a490d['filters']));if(_0x2cfd2a[_0x3488('0x34')]['filter']){_0x36419c['where']=_[_0x3488('0x40')](_0x36419c['where'],{'$or':_[_0x3488('0x42')](_0x36419c[_0x3488('0x36')],function(_0x6d25a1){var _0x186f46={};_0x186f46[_0x6d25a1]={'$like':'%'+_0x2cfd2a[_0x3488('0x34')]['filter']+'%'};return _0x186f46;})});}_0x36419c=_['merge']({},_0x36419c,_0x2cfd2a['options']);return _0x5bc540[_0x3488('0x53')](_0x36419c);}})['then'](function(_0x401478){if(_0x401478){_0x44ed17=_0x401478[_0x3488('0x38')];if(!_0x2cfd2a[_0x3488('0x34')][_0x3488('0x39')](_0x3488('0x3a'))){_0x36419c[_0x3488('0x21')]=qs[_0x3488('0x21')](_0x2cfd2a[_0x3488('0x34')][_0x3488('0x21')]);_0x36419c[_0x3488('0x1f')]=qs[_0x3488('0x1f')](_0x2cfd2a[_0x3488('0x34')]['offset']);}return _0x5bc540['getFields'](_0x36419c);}})['then'](function(_0x4fe4b2){if(_0x4fe4b2){return _0x4fe4b2?{'count':_0x44ed17,'rows':_0x4fe4b2}:null;}})[_0x3488('0x28')](respondWithResult(_0x57ef2d,null))[_0x3488('0x47')](handleError(_0x57ef2d,null));}; \ No newline at end of file +var _0xa9c3=['findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','count','status','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','create','body','getSubjects'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9c3,0xa0));var _0x3a9c=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xa9c3[_0xbf8ebe];return _0x1e25e8;};'use strict';var emlformat=require(_0x3a9c('0x0'));var rimraf=require(_0x3a9c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3a9c('0x2'));var moment=require(_0x3a9c('0x3'));var BPromise=require(_0x3a9c('0x4'));var Mustache=require(_0x3a9c('0x5'));var util=require(_0x3a9c('0x6'));var path=require(_0x3a9c('0x7'));var sox=require(_0x3a9c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a9c('0x9'));var _=require(_0x3a9c('0xa'));var squel=require(_0x3a9c('0xb'));var crypto=require(_0x3a9c('0xc'));var jsforce=require(_0x3a9c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a9c('0xe'));var querystring=require(_0x3a9c('0xf'));var Papa=require(_0x3a9c('0x10'));var Redis=require(_0x3a9c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3a9c('0x12'));var as=require(_0x3a9c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a9c('0x14'))('api');var utils=require(_0x3a9c('0x15'));var config=require(_0x3a9c('0x16'));var licenseUtil=require(_0x3a9c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x429a29,_0xa68a88){_0xa68a88=_0xa68a88||0xcc;return function(_0x726f36){if(_0x726f36){return _0x429a29[_0x3a9c('0x18')](_0xa68a88);}return _0x429a29['status'](_0xa68a88)[_0x3a9c('0x19')]();};}function respondWithResult(_0x37a1ed,_0x244ad3){_0x244ad3=_0x244ad3||0xc8;return function(_0x10dd9e){if(_0x10dd9e){return _0x37a1ed['status'](_0x244ad3)[_0x3a9c('0x1a')](_0x10dd9e);}};}function respondWithFilteredResult(_0x5667e8,_0x346b7c){return function(_0x33e847){if(_0x33e847){var _0xcd5713=typeof _0x346b7c[_0x3a9c('0x1b')]==='undefined'&&typeof _0x346b7c['limit']==='undefined';var _0xff1532=_0x33e847['count'];var _0x39cfba=_0xcd5713?0x0:_0x346b7c[_0x3a9c('0x1b')];var _0x4c3594=_0xcd5713?_0x33e847[_0x3a9c('0x1c')]:_0x346b7c[_0x3a9c('0x1b')]+_0x346b7c['limit'];var _0x3d1c81;if(_0x4c3594>=_0xff1532){_0x4c3594=_0xff1532;_0x3d1c81=0xc8;}else{_0x3d1c81=0xce;}_0x5667e8[_0x3a9c('0x1d')](_0x3d1c81);return _0x5667e8[_0x3a9c('0x1e')](_0x3a9c('0x1f'),_0x39cfba+'-'+_0x4c3594+'/'+_0xff1532)[_0x3a9c('0x1a')](_0x33e847);}return null;};}function patchUpdates(_0x55a2e6){return function(_0x35fbd3){try{jsonpatch[_0x3a9c('0x20')](_0x35fbd3,_0x55a2e6,!![]);}catch(_0x15cf59){return BPromise[_0x3a9c('0x21')](_0x15cf59);}return _0x35fbd3['save']();};}function saveUpdates(_0x4b29ab,_0x24f0af){return function(_0x413e94){if(_0x413e94){return _0x413e94[_0x3a9c('0x22')](_0x4b29ab)[_0x3a9c('0x23')](function(_0x5553e3){return _0x5553e3;});}return null;};}function removeEntity(_0x203860,_0x11db44){return function(_0x597a24){if(_0x597a24){return _0x597a24[_0x3a9c('0x24')]()['then'](function(){_0x203860['status'](0xcc)[_0x3a9c('0x19')]();});}};}function handleEntityNotFound(_0x586809,_0x42102a){return function(_0x55d92d){if(!_0x55d92d){_0x586809['sendStatus'](0x194);}return _0x55d92d;};}function handleError(_0x157808,_0x5a9b9e){_0x5a9b9e=_0x5a9b9e||0x1f4;return function(_0xd4c8fb){logger['error'](_0xd4c8fb['stack']);if(_0xd4c8fb[_0x3a9c('0x25')]){delete _0xd4c8fb[_0x3a9c('0x25')];}_0x157808[_0x3a9c('0x1d')](_0x5a9b9e)[_0x3a9c('0x26')](_0xd4c8fb);};}exports[_0x3a9c('0x27')]=function(_0x29c581,_0x67f7fc){var _0xd46c27={},_0x28cdf0={},_0x7d846d={'count':0x0,'rows':[]};var _0x410051=_[_0x3a9c('0x28')](db[_0x3a9c('0x29')][_0x3a9c('0x2a')],function(_0x2a0b1b){return{'name':_0x2a0b1b['fieldName'],'type':_0x2a0b1b[_0x3a9c('0x2b')][_0x3a9c('0x2c')]};});_0x28cdf0[_0x3a9c('0x2d')]=_[_0x3a9c('0x28')](_0x410051,'name');_0x28cdf0[_0x3a9c('0x2e')]=_[_0x3a9c('0x2f')](_0x29c581['query']);_0x28cdf0[_0x3a9c('0x30')]=_['intersection'](_0x28cdf0[_0x3a9c('0x2d')],_0x28cdf0[_0x3a9c('0x2e')]);_0xd46c27[_0x3a9c('0x31')]=_[_0x3a9c('0x32')](_0x28cdf0['model'],qs[_0x3a9c('0x33')](_0x29c581['query']['fields']));_0xd46c27['attributes']=_0xd46c27[_0x3a9c('0x31')][_0x3a9c('0x34')]?_0xd46c27[_0x3a9c('0x31')]:_0x28cdf0[_0x3a9c('0x2d')];if(!_0x29c581[_0x3a9c('0x2e')][_0x3a9c('0x35')](_0x3a9c('0x36'))){_0xd46c27[_0x3a9c('0x37')]=qs[_0x3a9c('0x37')](_0x29c581['query'][_0x3a9c('0x37')]);_0xd46c27['offset']=qs[_0x3a9c('0x1b')](_0x29c581[_0x3a9c('0x2e')][_0x3a9c('0x1b')]);}_0xd46c27[_0x3a9c('0x38')]=qs['sort'](_0x29c581[_0x3a9c('0x2e')][_0x3a9c('0x39')]);_0xd46c27[_0x3a9c('0x3a')]=qs[_0x3a9c('0x30')](_[_0x3a9c('0x3b')](_0x29c581[_0x3a9c('0x2e')],_0x28cdf0['filters']),_0x410051);if(_0x29c581['query'][_0x3a9c('0x3c')]){_0xd46c27[_0x3a9c('0x3a')]=_[_0x3a9c('0x3d')](_0xd46c27['where'],{'$or':_['map'](_0x410051,function(_0x3d61ae){if(_0x3d61ae['type']!==_0x3a9c('0x3e')){var _0x3ce588={};_0x3ce588[_0x3d61ae[_0x3a9c('0x25')]]={'$like':'%'+_0x29c581['query']['filter']+'%'};return _0x3ce588;}})});}_0xd46c27=_[_0x3a9c('0x3d')]({},_0xd46c27,_0x29c581[_0x3a9c('0x3f')]);var _0x2ffb28={'where':_0xd46c27['where']};return db[_0x3a9c('0x29')][_0x3a9c('0x1c')](_0x2ffb28)[_0x3a9c('0x23')](function(_0x395219){_0x7d846d['count']=_0x395219;if(_0x29c581['query']['includeAll']){_0xd46c27['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x3a9c('0x40')](_0xd46c27);})[_0x3a9c('0x23')](function(_0x5dcfd8){_0x7d846d[_0x3a9c('0x41')]=_0x5dcfd8;return _0x7d846d;})['then'](respondWithFilteredResult(_0x67f7fc,_0xd46c27))[_0x3a9c('0x42')](handleError(_0x67f7fc,null));};exports[_0x3a9c('0x43')]=function(_0x205cde,_0x5302b1){var _0x35079e={'raw':![],'where':{'id':_0x205cde[_0x3a9c('0x44')]['id']}},_0x1c4793={};_0x1c4793[_0x3a9c('0x2d')]=_[_0x3a9c('0x2f')](db[_0x3a9c('0x29')][_0x3a9c('0x2a')]);_0x1c4793[_0x3a9c('0x2e')]=_[_0x3a9c('0x2f')](_0x205cde[_0x3a9c('0x2e')]);_0x1c4793[_0x3a9c('0x30')]=_[_0x3a9c('0x32')](_0x1c4793[_0x3a9c('0x2d')],_0x1c4793['query']);_0x35079e['attributes']=_[_0x3a9c('0x32')](_0x1c4793[_0x3a9c('0x2d')],qs['fields'](_0x205cde[_0x3a9c('0x2e')][_0x3a9c('0x33')]));_0x35079e[_0x3a9c('0x31')]=_0x35079e[_0x3a9c('0x31')][_0x3a9c('0x34')]?_0x35079e['attributes']:_0x1c4793[_0x3a9c('0x2d')];if(_0x205cde[_0x3a9c('0x2e')]['includeAll']){_0x35079e[_0x3a9c('0x45')]=[{'all':!![]}];}_0x35079e=_[_0x3a9c('0x3d')]({},_0x35079e,_0x205cde['options']);return db['FreshsalesConfiguration'][_0x3a9c('0x46')](_0x35079e)[_0x3a9c('0x23')](handleEntityNotFound(_0x5302b1,null))[_0x3a9c('0x23')](respondWithResult(_0x5302b1,null))[_0x3a9c('0x42')](handleError(_0x5302b1,null));};exports[_0x3a9c('0x47')]=function(_0x35eac6,_0xec193f){return db[_0x3a9c('0x29')][_0x3a9c('0x47')](_0x35eac6[_0x3a9c('0x48')],{})[_0x3a9c('0x23')](respondWithResult(_0xec193f,0xc9))[_0x3a9c('0x42')](handleError(_0xec193f,null));};exports[_0x3a9c('0x22')]=function(_0x5bc19b,_0x1b8eec){if(_0x5bc19b[_0x3a9c('0x48')]['id']){delete _0x5bc19b[_0x3a9c('0x48')]['id'];}return db[_0x3a9c('0x29')][_0x3a9c('0x46')]({'where':{'id':_0x5bc19b[_0x3a9c('0x44')]['id']}})[_0x3a9c('0x23')](handleEntityNotFound(_0x1b8eec,null))[_0x3a9c('0x23')](saveUpdates(_0x5bc19b[_0x3a9c('0x48')],null))[_0x3a9c('0x23')](respondWithResult(_0x1b8eec,null))[_0x3a9c('0x42')](handleError(_0x1b8eec,null));};exports[_0x3a9c('0x24')]=function(_0x58f364,_0x47c4bf){return db['FreshsalesConfiguration'][_0x3a9c('0x46')]({'where':{'id':_0x58f364[_0x3a9c('0x44')]['id']}})[_0x3a9c('0x23')](handleEntityNotFound(_0x47c4bf,null))['then'](removeEntity(_0x47c4bf,null))[_0x3a9c('0x42')](handleError(_0x47c4bf,null));};exports[_0x3a9c('0x49')]=function(_0x470a1a,_0x30b747,_0xbce29b){var _0x28593d={};var _0x203bda={};var _0x5bef89;var _0x211d3c;return db[_0x3a9c('0x29')][_0x3a9c('0x4a')]({'where':{'id':_0x470a1a[_0x3a9c('0x44')]['id']}})[_0x3a9c('0x23')](handleEntityNotFound(_0x30b747,null))['then'](function(_0xe58d0e){if(_0xe58d0e){_0x5bef89=_0xe58d0e;_0x203bda[_0x3a9c('0x2d')]=_[_0x3a9c('0x2f')](db[_0x3a9c('0x4b')][_0x3a9c('0x2a')]);_0x203bda[_0x3a9c('0x2e')]=_[_0x3a9c('0x2f')](_0x470a1a['query']);_0x203bda[_0x3a9c('0x30')]=_['intersection'](_0x203bda[_0x3a9c('0x2d')],_0x203bda[_0x3a9c('0x2e')]);_0x28593d[_0x3a9c('0x31')]=_[_0x3a9c('0x32')](_0x203bda[_0x3a9c('0x2d')],qs['fields'](_0x470a1a['query']['fields']));_0x28593d[_0x3a9c('0x31')]=_0x28593d['attributes']['length']?_0x28593d['attributes']:_0x203bda[_0x3a9c('0x2d')];_0x28593d[_0x3a9c('0x38')]=qs['sort'](_0x470a1a['query'][_0x3a9c('0x39')]);_0x28593d[_0x3a9c('0x3a')]=qs[_0x3a9c('0x30')](_[_0x3a9c('0x3b')](_0x470a1a[_0x3a9c('0x2e')],_0x203bda[_0x3a9c('0x30')]));if(_0x470a1a[_0x3a9c('0x2e')][_0x3a9c('0x3c')]){_0x28593d['where']=_[_0x3a9c('0x3d')](_0x28593d['where'],{'$or':_[_0x3a9c('0x28')](_0x28593d[_0x3a9c('0x31')],function(_0xf61e7a){var _0x59da05={};_0x59da05[_0xf61e7a]={'$like':'%'+_0x470a1a[_0x3a9c('0x2e')][_0x3a9c('0x3c')]+'%'};return _0x59da05;})});}_0x28593d=_['merge']({},_0x28593d,_0x470a1a[_0x3a9c('0x3f')]);return _0x5bef89[_0x3a9c('0x49')](_0x28593d);}})[_0x3a9c('0x23')](function(_0x582ab3){if(_0x582ab3){_0x211d3c=_0x582ab3[_0x3a9c('0x34')];if(!_0x470a1a[_0x3a9c('0x2e')]['hasOwnProperty'](_0x3a9c('0x36'))){_0x28593d[_0x3a9c('0x37')]=qs[_0x3a9c('0x37')](_0x470a1a[_0x3a9c('0x2e')][_0x3a9c('0x37')]);_0x28593d[_0x3a9c('0x1b')]=qs[_0x3a9c('0x1b')](_0x470a1a[_0x3a9c('0x2e')][_0x3a9c('0x1b')]);}return _0x5bef89[_0x3a9c('0x49')](_0x28593d);}})[_0x3a9c('0x23')](function(_0x4f591d){if(_0x4f591d){return _0x4f591d?{'count':_0x211d3c,'rows':_0x4f591d}:null;}})[_0x3a9c('0x23')](respondWithResult(_0x30b747,null))[_0x3a9c('0x42')](handleError(_0x30b747,null));};exports[_0x3a9c('0x4c')]=function(_0x58a68a,_0x462829,_0x2d4289){var _0x106720={};var _0x211f22={};var _0x2319c8;var _0x9d09a0;return db[_0x3a9c('0x29')]['findOne']({'where':{'id':_0x58a68a[_0x3a9c('0x44')]['id']}})[_0x3a9c('0x23')](handleEntityNotFound(_0x462829,null))['then'](function(_0x220e2a){if(_0x220e2a){_0x2319c8=_0x220e2a;_0x211f22[_0x3a9c('0x2d')]=_[_0x3a9c('0x2f')](db[_0x3a9c('0x4b')][_0x3a9c('0x2a')]);_0x211f22[_0x3a9c('0x2e')]=_[_0x3a9c('0x2f')](_0x58a68a[_0x3a9c('0x2e')]);_0x211f22[_0x3a9c('0x30')]=_[_0x3a9c('0x32')](_0x211f22['model'],_0x211f22['query']);_0x106720[_0x3a9c('0x31')]=_['intersection'](_0x211f22[_0x3a9c('0x2d')],qs[_0x3a9c('0x33')](_0x58a68a['query'][_0x3a9c('0x33')]));_0x106720[_0x3a9c('0x31')]=_0x106720[_0x3a9c('0x31')][_0x3a9c('0x34')]?_0x106720[_0x3a9c('0x31')]:_0x211f22[_0x3a9c('0x2d')];_0x106720['order']=qs[_0x3a9c('0x39')](_0x58a68a[_0x3a9c('0x2e')][_0x3a9c('0x39')]);_0x106720[_0x3a9c('0x3a')]=qs['filters'](_[_0x3a9c('0x3b')](_0x58a68a[_0x3a9c('0x2e')],_0x211f22[_0x3a9c('0x30')]));if(_0x58a68a[_0x3a9c('0x2e')][_0x3a9c('0x3c')]){_0x106720[_0x3a9c('0x3a')]=_[_0x3a9c('0x3d')](_0x106720[_0x3a9c('0x3a')],{'$or':_[_0x3a9c('0x28')](_0x106720[_0x3a9c('0x31')],function(_0x35a448){var _0x3c1c1e={};_0x3c1c1e[_0x35a448]={'$like':'%'+_0x58a68a[_0x3a9c('0x2e')][_0x3a9c('0x3c')]+'%'};return _0x3c1c1e;})});}_0x106720=_['merge']({},_0x106720,_0x58a68a[_0x3a9c('0x3f')]);return _0x2319c8['getDescriptions'](_0x106720);}})['then'](function(_0x4ab25d){if(_0x4ab25d){_0x9d09a0=_0x4ab25d['length'];if(!_0x58a68a[_0x3a9c('0x2e')][_0x3a9c('0x35')]('nolimit')){_0x106720[_0x3a9c('0x37')]=qs[_0x3a9c('0x37')](_0x58a68a[_0x3a9c('0x2e')][_0x3a9c('0x37')]);_0x106720[_0x3a9c('0x1b')]=qs[_0x3a9c('0x1b')](_0x58a68a['query']['offset']);}return _0x2319c8[_0x3a9c('0x4c')](_0x106720);}})['then'](function(_0x4543f0){if(_0x4543f0){return _0x4543f0?{'count':_0x9d09a0,'rows':_0x4543f0}:null;}})[_0x3a9c('0x23')](respondWithResult(_0x462829,null))[_0x3a9c('0x42')](handleError(_0x462829,null));};exports[_0x3a9c('0x4d')]=function(_0x168cf5,_0x585e11,_0x41fed9){var _0x5a68a1={};var _0x43f05f={};var _0x4681de;var _0x5502f2;return db[_0x3a9c('0x29')]['findOne']({'where':{'id':_0x168cf5['params']['id']}})[_0x3a9c('0x23')](handleEntityNotFound(_0x585e11,null))[_0x3a9c('0x23')](function(_0x395dae){if(_0x395dae){_0x4681de=_0x395dae;_0x43f05f[_0x3a9c('0x2d')]=_[_0x3a9c('0x2f')](db[_0x3a9c('0x4b')][_0x3a9c('0x2a')]);_0x43f05f['query']=_['keys'](_0x168cf5[_0x3a9c('0x2e')]);_0x43f05f[_0x3a9c('0x30')]=_[_0x3a9c('0x32')](_0x43f05f[_0x3a9c('0x2d')],_0x43f05f[_0x3a9c('0x2e')]);_0x5a68a1[_0x3a9c('0x31')]=_[_0x3a9c('0x32')](_0x43f05f[_0x3a9c('0x2d')],qs['fields'](_0x168cf5['query'][_0x3a9c('0x33')]));_0x5a68a1[_0x3a9c('0x31')]=_0x5a68a1[_0x3a9c('0x31')]['length']?_0x5a68a1[_0x3a9c('0x31')]:_0x43f05f[_0x3a9c('0x2d')];_0x5a68a1[_0x3a9c('0x38')]=qs[_0x3a9c('0x39')](_0x168cf5[_0x3a9c('0x2e')][_0x3a9c('0x39')]);_0x5a68a1[_0x3a9c('0x3a')]=qs[_0x3a9c('0x30')](_[_0x3a9c('0x3b')](_0x168cf5[_0x3a9c('0x2e')],_0x43f05f['filters']));if(_0x168cf5[_0x3a9c('0x2e')][_0x3a9c('0x3c')]){_0x5a68a1['where']=_[_0x3a9c('0x3d')](_0x5a68a1[_0x3a9c('0x3a')],{'$or':_['map'](_0x5a68a1[_0x3a9c('0x31')],function(_0x510cf9){var _0xdacbee={};_0xdacbee[_0x510cf9]={'$like':'%'+_0x168cf5[_0x3a9c('0x2e')]['filter']+'%'};return _0xdacbee;})});}_0x5a68a1=_[_0x3a9c('0x3d')]({},_0x5a68a1,_0x168cf5['options']);return _0x4681de[_0x3a9c('0x4d')](_0x5a68a1);}})['then'](function(_0x2cda6e){if(_0x2cda6e){_0x5502f2=_0x2cda6e[_0x3a9c('0x34')];if(!_0x168cf5[_0x3a9c('0x2e')][_0x3a9c('0x35')](_0x3a9c('0x36'))){_0x5a68a1[_0x3a9c('0x37')]=qs[_0x3a9c('0x37')](_0x168cf5['query'][_0x3a9c('0x37')]);_0x5a68a1['offset']=qs[_0x3a9c('0x1b')](_0x168cf5[_0x3a9c('0x2e')][_0x3a9c('0x1b')]);}return _0x4681de['getFields'](_0x5a68a1);}})[_0x3a9c('0x23')](function(_0xc264dd){if(_0xc264dd){return _0xc264dd?{'count':_0x5502f2,'rows':_0xc264dd}:null;}})['then'](respondWithResult(_0x585e11,null))[_0x3a9c('0x42')](handleError(_0x585e11,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 6a50819..b864853 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 _0x20aa=['moment','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','lodash','../../config/logger'];(function(_0x4dea75,_0x55612d){var _0x3d71da=function(_0x20a802){while(--_0x20a802){_0x4dea75['push'](_0x4dea75['shift']());}};_0x3d71da(++_0x55612d);}(_0x20aa,0x1ce));var _0xa20a=function(_0x360aad,_0x24311a){_0x360aad=_0x360aad-0x0;var _0x43d98f=_0x20aa[_0x360aad];return _0x43d98f;};'use strict';var _=require(_0xa20a('0x0'));var util=require('util');var logger=require(_0xa20a('0x1'))('api');var moment=require(_0xa20a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa20a('0x3'));var rimraf=require(_0xa20a('0x4'));var config=require(_0xa20a('0x5'));var attributes=require(_0xa20a('0x6'));module['exports']=function(_0x1d601a,_0x37891d){return _0x1d601a[_0xa20a('0x7')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ddb=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x52285a,_0x4fa3fc){var _0x423654=function(_0x9774f5){while(--_0x9774f5){_0x52285a['push'](_0x52285a['shift']());}};_0x423654(++_0x4fa3fc);}(_0x6ddb,0x10a));var _0xb6dd=function(_0x29c644,_0x46941a){_0x29c644=_0x29c644-0x0;var _0x2d704a=_0x6ddb[_0x29c644];return _0x2d704a;};'use strict';var _=require(_0xb6dd('0x0'));var util=require(_0xb6dd('0x1'));var logger=require(_0xb6dd('0x2'))('api');var moment=require(_0xb6dd('0x3'));var BPromise=require(_0xb6dd('0x4'));var rp=require(_0xb6dd('0x5'));var fs=require('fs');var path=require(_0xb6dd('0x6'));var rimraf=require(_0xb6dd('0x7'));var config=require(_0xb6dd('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x2b3fb8,_0x2b3a84){return _0x2b3fb8['define'](_0xb6dd('0x9'),attributes,{'tableName':_0xb6dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 21329d9..ebe6b3e 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 _0x6809=['result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x3022dd,_0x470d35){var _0x28647a=function(_0xff47be){while(--_0xff47be){_0x3022dd['push'](_0x3022dd['shift']());}};_0x28647a(++_0x470d35);}(_0x6809,0xe8));var _0x9680=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x6809[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0x9680('0x0'));var util=require('util');var moment=require(_0x9680('0x1'));var BPromise=require(_0x9680('0x2'));var rs=require(_0x9680('0x3'));var fs=require('fs');var Redis=require(_0x9680('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9680('0x5'));var logger=require(_0x9680('0x6'))(_0x9680('0x7'));var config=require(_0x9680('0x8'));var jayson=require(_0x9680('0x9'));var client=jayson[_0x9680('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x160449,_0xf270ec,_0x55ba2c){return new BPromise(function(_0x123137,_0x244a43){return client[_0x9680('0xb')](_0x160449,_0x55ba2c)[_0x9680('0xc')](function(_0x127e77){logger['info'](_0x9680('0xd'),_0xf270ec,_0x9680('0xe'));logger[_0x9680('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xf270ec,_0x9680('0xe'),JSON['stringify'](_0x127e77));if(_0x127e77['error']){if(_0x127e77[_0x9680('0x10')][_0x9680('0x11')]===0x1f4){logger[_0x9680('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xf270ec,_0x127e77['error'][_0x9680('0x12')]);return _0x244a43(_0x127e77[_0x9680('0x10')]['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0xf270ec,_0x127e77[_0x9680('0x10')]['message']);return _0x123137(_0x127e77[_0x9680('0x10')][_0x9680('0x12')]);}else{logger[_0x9680('0x13')](_0x9680('0xd'),_0xf270ec,_0x9680('0xe'));_0x123137(_0x127e77[_0x9680('0x14')]['message']);}})['catch'](function(_0xb86821){logger['error'](_0x9680('0xd'),_0xf270ec,_0xb86821);_0x244a43(_0xb86821);});});} \ No newline at end of file +var _0x77e1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2824e,_0xfc2cb){var _0x529cb7=function(_0x266193){while(--_0x266193){_0x2824e['push'](_0x2824e['shift']());}};_0x529cb7(++_0xfc2cb);}(_0x77e1,0x9c));var _0x177e=function(_0x378614,_0x2f9bdd){_0x378614=_0x378614-0x0;var _0xe135b2=_0x77e1[_0x378614];return _0xe135b2;};'use strict';var _=require(_0x177e('0x0'));var util=require(_0x177e('0x1'));var moment=require(_0x177e('0x2'));var BPromise=require(_0x177e('0x3'));var rs=require(_0x177e('0x4'));var fs=require('fs');var Redis=require(_0x177e('0x5'));var db=require(_0x177e('0x6'))['db'];var utils=require(_0x177e('0x7'));var logger=require(_0x177e('0x8'))(_0x177e('0x9'));var config=require('../../config/environment');var jayson=require(_0x177e('0xa'));var client=jayson[_0x177e('0xb')][_0x177e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d6895,_0xc4a5bb,_0x347004){return new BPromise(function(_0x4db53f,_0x39b8aa){return client[_0x177e('0xd')](_0x3d6895,_0x347004)[_0x177e('0xe')](function(_0x1a522c){logger[_0x177e('0xf')](_0x177e('0x10'),_0xc4a5bb,'request\x20sent');logger[_0x177e('0x11')](_0x177e('0x12'),_0xc4a5bb,_0x177e('0x13'),JSON[_0x177e('0x14')](_0x1a522c));if(_0x1a522c[_0x177e('0x15')]){if(_0x1a522c['error'][_0x177e('0x16')]===0x1f4){logger[_0x177e('0x15')](_0x177e('0x10'),_0xc4a5bb,_0x1a522c[_0x177e('0x15')]['message']);return _0x39b8aa(_0x1a522c[_0x177e('0x15')][_0x177e('0x17')]);}logger[_0x177e('0x15')](_0x177e('0x10'),_0xc4a5bb,_0x1a522c['error'][_0x177e('0x17')]);return _0x4db53f(_0x1a522c[_0x177e('0x15')][_0x177e('0x17')]);}else{logger[_0x177e('0xf')](_0x177e('0x10'),_0xc4a5bb,_0x177e('0x13'));_0x4db53f(_0x1a522c[_0x177e('0x18')][_0x177e('0x17')]);}})[_0x177e('0x19')](function(_0x13edaf){logger[_0x177e('0x15')](_0x177e('0x10'),_0xc4a5bb,_0x13edaf);_0x39b8aa(_0x13edaf);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 997e966..a053cf7 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 _0xf2c7=['isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x3e8bf8,_0x4e76d6){var _0x3391ce=function(_0x4f32d6){while(--_0x4f32d6){_0x3e8bf8['push'](_0x3e8bf8['shift']());}};_0x3391ce(++_0x4e76d6);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0xf2c7[_0x31b31b];return _0x2c8fc2;};'use strict';var multer=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var path=require(_0x7f2c('0x2'));var timeout=require(_0x7f2c('0x3'));var express=require('express');var router=express[_0x7f2c('0x4')]();var fs_extra=require(_0x7f2c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f2c('0x6'));var controller=require('./intFreshsalesField.controller');router[_0x7f2c('0x7')]('/',auth[_0x7f2c('0x8')](),controller['index']);router[_0x7f2c('0x7')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['show']);router[_0x7f2c('0xa')]('/',auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xb')]);router[_0x7f2c('0xc')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['update']);router[_0x7f2c('0xd')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xe')]);module[_0x7f2c('0xf')]=router; \ No newline at end of file +var _0x03bc=['create','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x2c0c09,_0x20ea92){var _0x482b0a=function(_0x5d876a){while(--_0x5d876a){_0x2c0c09['push'](_0x2c0c09['shift']());}};_0x482b0a(++_0x20ea92);}(_0x03bc,0xb8));var _0xc03b=function(_0x24e01,_0x58be5a){_0x24e01=_0x24e01-0x0;var _0x25efc6=_0x03bc[_0x24e01];return _0x25efc6;};'use strict';var multer=require(_0xc03b('0x0'));var util=require('util');var path=require(_0xc03b('0x1'));var timeout=require(_0xc03b('0x2'));var express=require('express');var router=express[_0xc03b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc03b('0x4'));var interaction=require(_0xc03b('0x5'));var config=require(_0xc03b('0x6'));var controller=require(_0xc03b('0x7'));router[_0xc03b('0x8')]('/',auth['isAuthenticated'](),controller[_0xc03b('0x9')]);router['get'](_0xc03b('0xa'),auth[_0xc03b('0xb')](),controller[_0xc03b('0xc')]);router[_0xc03b('0xd')]('/',auth[_0xc03b('0xb')](),controller[_0xc03b('0xe')]);router[_0xc03b('0xf')](_0xc03b('0xa'),auth['isAuthenticated'](),controller[_0xc03b('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc03b('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 64c2cb1..86a898a 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 _0xa98b=['BOOLEAN','ENUM','string','keyValue','picklist','STRING','variable','customVariable'];(function(_0x39e038,_0x25e5f5){var _0x505af8=function(_0x2ebc0f){while(--_0x2ebc0f){_0x39e038['push'](_0x39e038['shift']());}};_0x505af8(++_0x25e5f5);}(_0xa98b,0x1e1));var _0xba98=function(_0x298884,_0x1069a4){_0x298884=_0x298884-0x0;var _0x3f918f=_0xa98b[_0x298884];return _0x3f918f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xba98('0x0')](_0xba98('0x1'),'variable','customVariable',_0xba98('0x2'),_0xba98('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba98('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xba98('0x1'),_0xba98('0x5'),_0xba98('0x6'))},'keyContent':{'type':Sequelize[_0xba98('0x4')]},'idField':{'type':Sequelize[_0xba98('0x4')]},'nameField':{'type':Sequelize[_0xba98('0x4')]},'customField':{'type':Sequelize[_0xba98('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba98('0x4')]}}; \ No newline at end of file +var _0x1167=['picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x55ab14,_0x46a1aa){var _0x180e29=function(_0x1775bd){while(--_0x1775bd){_0x55ab14['push'](_0x55ab14['shift']());}};_0x180e29(++_0x46a1aa);}(_0x1167,0x150));var _0x7116=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1167[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x7116('0x0'));module[_0x7116('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7116('0x2'),_0x7116('0x3'),_0x7116('0x4'),_0x7116('0x5'),_0x7116('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7116('0x7')]},'key':{'type':Sequelize[_0x7116('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x7116('0x2'),'variable',_0x7116('0x4'))},'keyContent':{'type':Sequelize[_0x7116('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7116('0x7')]},'customField':{'type':Sequelize[_0x7116('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b7b6456..02c63ce 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 _0xf402=['where','pick','merge','VIRTUAL','options','FreshsalesField','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5af08d,_0x1d182d){var _0x295832=function(_0x228ed6){while(--_0x228ed6){_0x5af08d['push'](_0x5af08d['shift']());}};_0x295832(++_0x1d182d);}(_0xf402,0x1cc));var _0x2f40=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf402[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x2f40('0x0'));var rimraf=require(_0x2f40('0x1'));var zipdir=require(_0x2f40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f40('0x3'));var moment=require(_0x2f40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f40('0x5'));var util=require(_0x2f40('0x6'));var path=require(_0x2f40('0x7'));var sox=require(_0x2f40('0x8'));var csv=require(_0x2f40('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f40('0xa'));var _=require(_0x2f40('0xb'));var squel=require(_0x2f40('0xc'));var crypto=require(_0x2f40('0xd'));var jsforce=require(_0x2f40('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f40('0xf'));var Papa=require(_0x2f40('0x10'));var Redis=require('ioredis');var authService=require(_0x2f40('0x11'));var qs=require(_0x2f40('0x12'));var as=require(_0x2f40('0x13'));var hardwareService=require(_0x2f40('0x14'));var logger=require(_0x2f40('0x15'))(_0x2f40('0x16'));var utils=require('../../config/utils');var config=require(_0x2f40('0x17'));var licenseUtil=require(_0x2f40('0x18'));var db=require(_0x2f40('0x19'))['db'];function respondWithStatusCode(_0xfee0f1,_0x52e4a3){_0x52e4a3=_0x52e4a3||0xcc;return function(_0x5699eb){if(_0x5699eb){return _0xfee0f1['sendStatus'](_0x52e4a3);}return _0xfee0f1[_0x2f40('0x1a')](_0x52e4a3)[_0x2f40('0x1b')]();};}function respondWithResult(_0x248c5f,_0x49626e){_0x49626e=_0x49626e||0xc8;return function(_0x39ec4c){if(_0x39ec4c){return _0x248c5f[_0x2f40('0x1a')](_0x49626e)[_0x2f40('0x1c')](_0x39ec4c);}};}function respondWithFilteredResult(_0x13ae22,_0x40eacf){return function(_0x219b07){if(_0x219b07){var _0xcfacbf=typeof _0x40eacf[_0x2f40('0x1d')]===_0x2f40('0x1e')&&typeof _0x40eacf['limit']===_0x2f40('0x1e');var _0x49d31a=_0x219b07['count'];var _0x123893=_0xcfacbf?0x0:_0x40eacf['offset'];var _0x4f6257=_0xcfacbf?_0x219b07[_0x2f40('0x1f')]:_0x40eacf[_0x2f40('0x1d')]+_0x40eacf[_0x2f40('0x20')];var _0x10b211;if(_0x4f6257>=_0x49d31a){_0x4f6257=_0x49d31a;_0x10b211=0xc8;}else{_0x10b211=0xce;}_0x13ae22[_0x2f40('0x1a')](_0x10b211);return _0x13ae22['set'](_0x2f40('0x21'),_0x123893+'-'+_0x4f6257+'/'+_0x49d31a)[_0x2f40('0x1c')](_0x219b07);}return null;};}function patchUpdates(_0x4b5a8b){return function(_0x3a8890){try{jsonpatch[_0x2f40('0x22')](_0x3a8890,_0x4b5a8b,!![]);}catch(_0x41546f){return BPromise[_0x2f40('0x23')](_0x41546f);}return _0x3a8890[_0x2f40('0x24')]();};}function saveUpdates(_0x12c20d,_0x58bd22){return function(_0x467800){if(_0x467800){return _0x467800['update'](_0x12c20d)[_0x2f40('0x25')](function(_0x3d67ea){return _0x3d67ea;});}return null;};}function removeEntity(_0x81c9ad,_0xaa42a5){return function(_0x31e133){if(_0x31e133){return _0x31e133[_0x2f40('0x26')]()[_0x2f40('0x25')](function(){_0x81c9ad[_0x2f40('0x1a')](0xcc)[_0x2f40('0x1b')]();});}};}function handleEntityNotFound(_0x272735,_0x29aa9b){return function(_0x5612fd){if(!_0x5612fd){_0x272735[_0x2f40('0x27')](0x194);}return _0x5612fd;};}function handleError(_0x567748,_0x5467af){_0x5467af=_0x5467af||0x1f4;return function(_0x42ac42){logger['error'](_0x42ac42[_0x2f40('0x28')]);if(_0x42ac42['name']){delete _0x42ac42[_0x2f40('0x29')];}_0x567748[_0x2f40('0x1a')](_0x5467af)['send'](_0x42ac42);};}exports[_0x2f40('0x2a')]=function(_0x22a3c1,_0x366379){var _0x59da16={},_0x2d845d={},_0x15d1f2={'count':0x0,'rows':[]};var _0x5e84bc=_[_0x2f40('0x2b')](db['FreshsalesField'][_0x2f40('0x2c')],function(_0x5e2958){return{'name':_0x5e2958['fieldName'],'type':_0x5e2958['type'][_0x2f40('0x2d')]};});_0x2d845d[_0x2f40('0x2e')]=_[_0x2f40('0x2b')](_0x5e84bc,'name');_0x2d845d['query']=_[_0x2f40('0x2f')](_0x22a3c1[_0x2f40('0x30')]);_0x2d845d[_0x2f40('0x31')]=_['intersection'](_0x2d845d['model'],_0x2d845d[_0x2f40('0x30')]);_0x59da16['attributes']=_[_0x2f40('0x32')](_0x2d845d[_0x2f40('0x2e')],qs[_0x2f40('0x33')](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x33')]));_0x59da16[_0x2f40('0x34')]=_0x59da16[_0x2f40('0x34')][_0x2f40('0x35')]?_0x59da16[_0x2f40('0x34')]:_0x2d845d[_0x2f40('0x2e')];if(!_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x36')](_0x2f40('0x37'))){_0x59da16[_0x2f40('0x20')]=qs['limit'](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x20')]);_0x59da16[_0x2f40('0x1d')]=qs[_0x2f40('0x1d')](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x1d')]);}_0x59da16[_0x2f40('0x38')]=qs[_0x2f40('0x39')](_0x22a3c1[_0x2f40('0x30')][_0x2f40('0x39')]);_0x59da16[_0x2f40('0x3a')]=qs[_0x2f40('0x31')](_[_0x2f40('0x3b')](_0x22a3c1[_0x2f40('0x30')],_0x2d845d[_0x2f40('0x31')]),_0x5e84bc);if(_0x22a3c1[_0x2f40('0x30')]['filter']){_0x59da16[_0x2f40('0x3a')]=_[_0x2f40('0x3c')](_0x59da16['where'],{'$or':_[_0x2f40('0x2b')](_0x5e84bc,function(_0x4dc329){if(_0x4dc329['type']!==_0x2f40('0x3d')){var _0x285650={};_0x285650[_0x4dc329['name']]={'$like':'%'+_0x22a3c1[_0x2f40('0x30')]['filter']+'%'};return _0x285650;}})});}_0x59da16=_[_0x2f40('0x3c')]({},_0x59da16,_0x22a3c1[_0x2f40('0x3e')]);var _0x19083f={'where':_0x59da16[_0x2f40('0x3a')]};return db[_0x2f40('0x3f')]['count'](_0x19083f)['then'](function(_0x1248df){_0x15d1f2['count']=_0x1248df;if(_0x22a3c1['query'][_0x2f40('0x40')]){_0x59da16['include']=[{'all':!![]}];}return db[_0x2f40('0x3f')][_0x2f40('0x41')](_0x59da16);})[_0x2f40('0x25')](function(_0x1aa58d){_0x15d1f2[_0x2f40('0x42')]=_0x1aa58d;return _0x15d1f2;})['then'](respondWithFilteredResult(_0x366379,_0x59da16))[_0x2f40('0x43')](handleError(_0x366379,null));};exports[_0x2f40('0x44')]=function(_0x386664,_0x36678f){var _0x504e9b={'raw':!![],'where':{'id':_0x386664[_0x2f40('0x45')]['id']}},_0x130cba={};_0x130cba[_0x2f40('0x2e')]=_[_0x2f40('0x2f')](db[_0x2f40('0x3f')][_0x2f40('0x2c')]);_0x130cba[_0x2f40('0x30')]=_[_0x2f40('0x2f')](_0x386664['query']);_0x130cba['filters']=_[_0x2f40('0x32')](_0x130cba[_0x2f40('0x2e')],_0x130cba[_0x2f40('0x30')]);_0x504e9b[_0x2f40('0x34')]=_[_0x2f40('0x32')](_0x130cba[_0x2f40('0x2e')],qs[_0x2f40('0x33')](_0x386664[_0x2f40('0x30')]['fields']));_0x504e9b[_0x2f40('0x34')]=_0x504e9b[_0x2f40('0x34')][_0x2f40('0x35')]?_0x504e9b[_0x2f40('0x34')]:_0x130cba[_0x2f40('0x2e')];if(_0x386664[_0x2f40('0x30')][_0x2f40('0x40')]){_0x504e9b[_0x2f40('0x46')]=[{'all':!![]}];}_0x504e9b=_[_0x2f40('0x3c')]({},_0x504e9b,_0x386664[_0x2f40('0x3e')]);return db[_0x2f40('0x3f')]['find'](_0x504e9b)[_0x2f40('0x25')](handleEntityNotFound(_0x36678f,null))['then'](respondWithResult(_0x36678f,null))[_0x2f40('0x43')](handleError(_0x36678f,null));};exports['create']=function(_0xccaa05,_0x4484d2){return db[_0x2f40('0x3f')][_0x2f40('0x47')](_0xccaa05[_0x2f40('0x48')],{})[_0x2f40('0x25')](respondWithResult(_0x4484d2,0xc9))[_0x2f40('0x43')](handleError(_0x4484d2,null));};exports['update']=function(_0x1a28bd,_0x7bb417){if(_0x1a28bd['body']['id']){delete _0x1a28bd[_0x2f40('0x48')]['id'];}return db[_0x2f40('0x3f')][_0x2f40('0x49')]({'where':{'id':_0x1a28bd[_0x2f40('0x45')]['id']}})[_0x2f40('0x25')](handleEntityNotFound(_0x7bb417,null))['then'](saveUpdates(_0x1a28bd[_0x2f40('0x48')],null))[_0x2f40('0x25')](respondWithResult(_0x7bb417,null))['catch'](handleError(_0x7bb417,null));};exports['destroy']=function(_0x27c787,_0xf1281f){return db[_0x2f40('0x3f')][_0x2f40('0x49')]({'where':{'id':_0x27c787[_0x2f40('0x45')]['id']}})['then'](handleEntityNotFound(_0xf1281f,null))['then'](removeEntity(_0xf1281f,null))['catch'](handleError(_0xf1281f,null));}; \ No newline at end of file +var _0x3b92=['count','set','apply','save','update','then','destroy','sendStatus','name','send','map','FreshsalesField','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','params','keys','rawAttributes','intersection','find','catch','create','body','eml-format','rimraf','request-promise','mustache','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/environment','../../mysqldb','end','status','json','offset','undefined'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x3b92,0x135));var _0x23b9=function(_0x388180,_0xd4f7d3){_0x388180=_0x388180-0x0;var _0x30c18b=_0x3b92[_0x388180];return _0x30c18b;};'use strict';var emlformat=require(_0x23b9('0x0'));var rimraf=require(_0x23b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x23b9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x23b9('0x3'));var util=require('util');var path=require(_0x23b9('0x4'));var sox=require(_0x23b9('0x5'));var csv=require(_0x23b9('0x6'));var ejs=require(_0x23b9('0x7'));var fs=require('fs');var fs_extra=require(_0x23b9('0x8'));var _=require(_0x23b9('0x9'));var squel=require(_0x23b9('0xa'));var crypto=require(_0x23b9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23b9('0x6'));var querystring=require('querystring');var Papa=require(_0x23b9('0xc'));var Redis=require('ioredis');var authService=require(_0x23b9('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x23b9('0xe'));var hardwareService=require(_0x23b9('0xf'));var logger=require(_0x23b9('0x10'))(_0x23b9('0x11'));var utils=require(_0x23b9('0x12'));var config=require(_0x23b9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x23b9('0x14'))['db'];function respondWithStatusCode(_0x5e1612,_0x4b3273){_0x4b3273=_0x4b3273||0xcc;return function(_0x4c593f){if(_0x4c593f){return _0x5e1612['sendStatus'](_0x4b3273);}return _0x5e1612['status'](_0x4b3273)[_0x23b9('0x15')]();};}function respondWithResult(_0x360f02,_0x399c0b){_0x399c0b=_0x399c0b||0xc8;return function(_0x2908c6){if(_0x2908c6){return _0x360f02[_0x23b9('0x16')](_0x399c0b)[_0x23b9('0x17')](_0x2908c6);}};}function respondWithFilteredResult(_0x2c5a13,_0x379501){return function(_0x5e2783){if(_0x5e2783){var _0x76ca04=typeof _0x379501[_0x23b9('0x18')]===_0x23b9('0x19')&&typeof _0x379501['limit']===_0x23b9('0x19');var _0x234b50=_0x5e2783[_0x23b9('0x1a')];var _0x1c3d2e=_0x76ca04?0x0:_0x379501[_0x23b9('0x18')];var _0x316155=_0x76ca04?_0x5e2783[_0x23b9('0x1a')]:_0x379501['offset']+_0x379501['limit'];var _0x38ce73;if(_0x316155>=_0x234b50){_0x316155=_0x234b50;_0x38ce73=0xc8;}else{_0x38ce73=0xce;}_0x2c5a13[_0x23b9('0x16')](_0x38ce73);return _0x2c5a13[_0x23b9('0x1b')]('Content-Range',_0x1c3d2e+'-'+_0x316155+'/'+_0x234b50)[_0x23b9('0x17')](_0x5e2783);}return null;};}function patchUpdates(_0x40c210){return function(_0x5c85a6){try{jsonpatch[_0x23b9('0x1c')](_0x5c85a6,_0x40c210,!![]);}catch(_0x4baa22){return BPromise['reject'](_0x4baa22);}return _0x5c85a6[_0x23b9('0x1d')]();};}function saveUpdates(_0x20a10d,_0x786ae5){return function(_0x3e951a){if(_0x3e951a){return _0x3e951a[_0x23b9('0x1e')](_0x20a10d)[_0x23b9('0x1f')](function(_0xab8b48){return _0xab8b48;});}return null;};}function removeEntity(_0x4bcdaf,_0x2de317){return function(_0xa9a243){if(_0xa9a243){return _0xa9a243[_0x23b9('0x20')]()[_0x23b9('0x1f')](function(){_0x4bcdaf[_0x23b9('0x16')](0xcc)[_0x23b9('0x15')]();});}};}function handleEntityNotFound(_0x4d868c,_0x325dbc){return function(_0x163e72){if(!_0x163e72){_0x4d868c[_0x23b9('0x21')](0x194);}return _0x163e72;};}function handleError(_0x1bd737,_0x5de3b0){_0x5de3b0=_0x5de3b0||0x1f4;return function(_0x539e51){logger['error'](_0x539e51['stack']);if(_0x539e51[_0x23b9('0x22')]){delete _0x539e51[_0x23b9('0x22')];}_0x1bd737[_0x23b9('0x16')](_0x5de3b0)[_0x23b9('0x23')](_0x539e51);};}exports['index']=function(_0x173693,_0x25b4cc){var _0x1945e7={},_0x396e54={},_0xdf80e0={'count':0x0,'rows':[]};var _0x4d69e8=_[_0x23b9('0x24')](db[_0x23b9('0x25')]['rawAttributes'],function(_0xf2005a){return{'name':_0xf2005a[_0x23b9('0x26')],'type':_0xf2005a[_0x23b9('0x27')][_0x23b9('0x28')]};});_0x396e54['model']=_['map'](_0x4d69e8,_0x23b9('0x22'));_0x396e54[_0x23b9('0x29')]=_['keys'](_0x173693['query']);_0x396e54[_0x23b9('0x2a')]=_['intersection'](_0x396e54[_0x23b9('0x2b')],_0x396e54[_0x23b9('0x29')]);_0x1945e7[_0x23b9('0x2c')]=_['intersection'](_0x396e54[_0x23b9('0x2b')],qs[_0x23b9('0x2d')](_0x173693[_0x23b9('0x29')][_0x23b9('0x2d')]));_0x1945e7['attributes']=_0x1945e7[_0x23b9('0x2c')][_0x23b9('0x2e')]?_0x1945e7['attributes']:_0x396e54[_0x23b9('0x2b')];if(!_0x173693['query'][_0x23b9('0x2f')]('nolimit')){_0x1945e7[_0x23b9('0x30')]=qs[_0x23b9('0x30')](_0x173693[_0x23b9('0x29')][_0x23b9('0x30')]);_0x1945e7[_0x23b9('0x18')]=qs[_0x23b9('0x18')](_0x173693[_0x23b9('0x29')][_0x23b9('0x18')]);}_0x1945e7[_0x23b9('0x31')]=qs[_0x23b9('0x32')](_0x173693[_0x23b9('0x29')][_0x23b9('0x32')]);_0x1945e7[_0x23b9('0x33')]=qs['filters'](_[_0x23b9('0x34')](_0x173693['query'],_0x396e54[_0x23b9('0x2a')]),_0x4d69e8);if(_0x173693['query'][_0x23b9('0x35')]){_0x1945e7[_0x23b9('0x33')]=_[_0x23b9('0x36')](_0x1945e7[_0x23b9('0x33')],{'$or':_['map'](_0x4d69e8,function(_0x5ec248){if(_0x5ec248[_0x23b9('0x27')]!==_0x23b9('0x37')){var _0x5c5abc={};_0x5c5abc[_0x5ec248[_0x23b9('0x22')]]={'$like':'%'+_0x173693[_0x23b9('0x29')]['filter']+'%'};return _0x5c5abc;}})});}_0x1945e7=_['merge']({},_0x1945e7,_0x173693['options']);var _0x2c7511={'where':_0x1945e7[_0x23b9('0x33')]};return db[_0x23b9('0x25')][_0x23b9('0x1a')](_0x2c7511)['then'](function(_0x54790a){_0xdf80e0[_0x23b9('0x1a')]=_0x54790a;if(_0x173693[_0x23b9('0x29')][_0x23b9('0x38')]){_0x1945e7[_0x23b9('0x39')]=[{'all':!![]}];}return db[_0x23b9('0x25')]['findAll'](_0x1945e7);})['then'](function(_0x3a4f66){_0xdf80e0[_0x23b9('0x3a')]=_0x3a4f66;return _0xdf80e0;})[_0x23b9('0x1f')](respondWithFilteredResult(_0x25b4cc,_0x1945e7))['catch'](handleError(_0x25b4cc,null));};exports['show']=function(_0x19d3f5,_0x2509e5){var _0xf7c4f8={'raw':!![],'where':{'id':_0x19d3f5[_0x23b9('0x3b')]['id']}},_0x25b041={};_0x25b041[_0x23b9('0x2b')]=_[_0x23b9('0x3c')](db['FreshsalesField'][_0x23b9('0x3d')]);_0x25b041['query']=_['keys'](_0x19d3f5[_0x23b9('0x29')]);_0x25b041[_0x23b9('0x2a')]=_[_0x23b9('0x3e')](_0x25b041['model'],_0x25b041['query']);_0xf7c4f8['attributes']=_[_0x23b9('0x3e')](_0x25b041[_0x23b9('0x2b')],qs[_0x23b9('0x2d')](_0x19d3f5['query'][_0x23b9('0x2d')]));_0xf7c4f8[_0x23b9('0x2c')]=_0xf7c4f8['attributes'][_0x23b9('0x2e')]?_0xf7c4f8[_0x23b9('0x2c')]:_0x25b041[_0x23b9('0x2b')];if(_0x19d3f5[_0x23b9('0x29')]['includeAll']){_0xf7c4f8[_0x23b9('0x39')]=[{'all':!![]}];}_0xf7c4f8=_[_0x23b9('0x36')]({},_0xf7c4f8,_0x19d3f5['options']);return db[_0x23b9('0x25')][_0x23b9('0x3f')](_0xf7c4f8)[_0x23b9('0x1f')](handleEntityNotFound(_0x2509e5,null))[_0x23b9('0x1f')](respondWithResult(_0x2509e5,null))[_0x23b9('0x40')](handleError(_0x2509e5,null));};exports[_0x23b9('0x41')]=function(_0x5a3340,_0x21a81c){return db[_0x23b9('0x25')][_0x23b9('0x41')](_0x5a3340[_0x23b9('0x42')],{})[_0x23b9('0x1f')](respondWithResult(_0x21a81c,0xc9))[_0x23b9('0x40')](handleError(_0x21a81c,null));};exports['update']=function(_0x4f0340,_0x185dfc){if(_0x4f0340[_0x23b9('0x42')]['id']){delete _0x4f0340[_0x23b9('0x42')]['id'];}return db[_0x23b9('0x25')][_0x23b9('0x3f')]({'where':{'id':_0x4f0340[_0x23b9('0x3b')]['id']}})[_0x23b9('0x1f')](handleEntityNotFound(_0x185dfc,null))[_0x23b9('0x1f')](saveUpdates(_0x4f0340[_0x23b9('0x42')],null))[_0x23b9('0x1f')](respondWithResult(_0x185dfc,null))[_0x23b9('0x40')](handleError(_0x185dfc,null));};exports['destroy']=function(_0x49a075,_0x2cccc1){return db[_0x23b9('0x25')]['find']({'where':{'id':_0x49a075[_0x23b9('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2cccc1,null))[_0x23b9('0x1f')](removeEntity(_0x2cccc1,null))['catch'](handleError(_0x2cccc1,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6dbc39b..a389c13 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 _0x45d8=['path','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x131483,_0x43583f){var _0x46b78e=function(_0x28e9cf){while(--_0x28e9cf){_0x131483['push'](_0x131483['shift']());}};_0x46b78e(++_0x43583f);}(_0x45d8,0x174));var _0x845d=function(_0x2911e2,_0x39c3d9){_0x2911e2=_0x2911e2-0x0;var _0x111b30=_0x45d8[_0x2911e2];return _0x111b30;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var logger=require(_0x845d('0x2'))(_0x845d('0x3'));var moment=require(_0x845d('0x4'));var BPromise=require(_0x845d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x845d('0x6'));var rimraf=require('rimraf');var config=require(_0x845d('0x7'));var attributes=require(_0x845d('0x8'));module['exports']=function(_0x4ba664,_0x312806){return _0x4ba664['define'](_0x845d('0x9'),attributes,{'tableName':_0x845d('0xa'),'paranoid':![],'indexes':[{'name':_0x845d('0xb'),'fields':[_0x845d('0xc'),_0x845d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa64=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','idField','FieldId'];(function(_0x5b3e6b,_0x47a86f){var _0x3f615a=function(_0x31b4a6){while(--_0x31b4a6){_0x5b3e6b['push'](_0x5b3e6b['shift']());}};_0x3f615a(++_0x47a86f);}(_0xaa64,0xf7));var _0x4aa6=function(_0x23f97b,_0x416706){_0x23f97b=_0x23f97b-0x0;var _0x45d628=_0xaa64[_0x23f97b];return _0x45d628;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var logger=require('../../config/logger')(_0x4aa6('0x2'));var moment=require('moment');var BPromise=require(_0x4aa6('0x3'));var rp=require(_0x4aa6('0x4'));var fs=require('fs');var path=require(_0x4aa6('0x5'));var rimraf=require('rimraf');var config=require(_0x4aa6('0x6'));var attributes=require(_0x4aa6('0x7'));module[_0x4aa6('0x8')]=function(_0x37a260,_0x426bd6){return _0x37a260[_0x4aa6('0x9')](_0x4aa6('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x4aa6('0xb'),_0x4aa6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 90922e1..a3aba8e 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x32f38b,_0x1b4fc7){var _0x15ec9b=function(_0x1331da){while(--_0x1331da){_0x32f38b['push'](_0x32f38b['shift']());}};_0x15ec9b(++_0x1b4fc7);}(_0x2ef3,0xba));var _0x32ef=function(_0x5af492,_0x5e855e){_0x5af492=_0x5af492-0x0;var _0x20797b=_0x2ef3[_0x5af492];return _0x20797b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1973e1,_0x40e720){var _0x3458a4=function(_0x5f2a2c){while(--_0x5f2a2c){_0x1973e1['push'](_0x1973e1['shift']());}};_0x3458a4(++_0x40e720);}(_0x1883,0xab));var _0x3188=function(_0xa15c95,_0x28e844){_0xa15c95=_0xa15c95-0x0;var _0x13b137=_0x1883[_0xa15c95];return _0x13b137;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e83af6a..55ae8a0 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x515d93,_0x24d70e){var _0x24f558=function(_0x33a853){while(--_0x33a853){_0x515d93['push'](_0x515d93['shift']());}};_0x24f558(++_0x24d70e);}(_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 +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x909a11,_0x3ecbbd){var _0x164081=function(_0x80fec9){while(--_0x80fec9){_0x909a11['push'](_0x909a11['shift']());}};_0x164081(++_0x3ecbbd);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 154edfe..3f59916 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 _0x225b=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x225b,0xb1));var _0xb225=function(_0x26d3d3,_0x23c4e2){_0x26d3d3=_0x26d3d3-0x0;var _0x5ea4b5=_0x225b[_0x26d3d3];return _0x5ea4b5;};'use strict';var Sequelize=require(_0xb225('0x0'));module[_0xb225('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb225('0x2')]},'username':{'type':Sequelize[_0xb225('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xb225('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb225('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb225('0x2')]},'serverUrl':{'type':Sequelize[_0xb225('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb225('0x3')](_0xb225('0x4'),_0xb225('0x5')),'defaultValue':_0xb225('0x4')}}; \ No newline at end of file +var _0xc373=['STRING','newTab','integrationTab','exports'];(function(_0x59b549,_0x3a2ba7){var _0x2da2d9=function(_0xf0a8b1){while(--_0xf0a8b1){_0x59b549['push'](_0x59b549['shift']());}};_0x2da2d9(++_0x3a2ba7);}(_0xc373,0x1c7));var _0x3c37=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xc373[_0x43aee5];return _0x76d1d0;};'use strict';var Sequelize=require('sequelize');module[_0x3c37('0x0')]={'name':{'type':Sequelize[_0x3c37('0x1')]},'description':{'type':Sequelize[_0x3c37('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x3c37('0x1')]},'password':{'type':Sequelize[_0x3c37('0x1')]},'clientId':{'type':Sequelize[_0x3c37('0x1')]},'clientSecret':{'type':Sequelize[_0x3c37('0x1')]},'securityToken':{'type':Sequelize[_0x3c37('0x1')]},'serverUrl':{'type':Sequelize[_0x3c37('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x3c37('0x2')),'defaultValue':_0x3c37('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index e4ac0f5..5f256bb 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 _0xf3d0=['Connection','clientId','clientSecret','login','concat','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','phone','remove','includes','label','custom','picklistValues','value','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','end','error','stack','name','send','index','SalesforceAccount','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','merge','create','body','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','SalesforceConfiguration','SalesforceField','getFields','remoteUri','username','password','slice','substring','lastIndexOf'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xf3d0,0x97));var _0x0f3d=function(_0xd3c9f8,_0x2afa85){_0xd3c9f8=_0xd3c9f8-0x0;var _0x31ebde=_0xf3d0[_0xd3c9f8];return _0x31ebde;};'use strict';var emlformat=require(_0x0f3d('0x0'));var rimraf=require(_0x0f3d('0x1'));var zipdir=require(_0x0f3d('0x2'));var jsonpatch=require(_0x0f3d('0x3'));var rp=require(_0x0f3d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f3d('0x5'));var util=require(_0x0f3d('0x6'));var path=require('path');var sox=require(_0x0f3d('0x7'));var csv=require('to-csv');var ejs=require(_0x0f3d('0x8'));var fs=require('fs');var fs_extra=require(_0x0f3d('0x9'));var _=require('lodash');var squel=require(_0x0f3d('0xa'));var crypto=require(_0x0f3d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0f3d('0xc'));var toCsv=require(_0x0f3d('0xd'));var querystring=require('querystring');var Papa=require(_0x0f3d('0xe'));var Redis=require('ioredis');var authService=require(_0x0f3d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f3d('0x10'));var logger=require(_0x0f3d('0x11'))(_0x0f3d('0x12'));var utils=require(_0x0f3d('0x13'));var config=require(_0x0f3d('0x14'));var licenseUtil=require(_0x0f3d('0x15'));var db=require(_0x0f3d('0x16'))['db'];var integrations=require(_0x0f3d('0x17'));function respondWithStatusCode(_0x323807,_0x1823c3){_0x1823c3=_0x1823c3||0xcc;return function(_0x445a9f){if(_0x445a9f){return _0x323807['sendStatus'](_0x1823c3);}return _0x323807[_0x0f3d('0x18')](_0x1823c3)['end']();};}function respondWithResult(_0x1f2226,_0x16d9b3){_0x16d9b3=_0x16d9b3||0xc8;return function(_0x1e4f2d){if(_0x1e4f2d){return _0x1f2226[_0x0f3d('0x18')](_0x16d9b3)['json'](_0x1e4f2d);}};}function respondWithFilteredResult(_0x58aab2,_0x2d3751){return function(_0x4d2a43){if(_0x4d2a43){var _0x55c8a0=typeof _0x2d3751['offset']===_0x0f3d('0x19')&&typeof _0x2d3751[_0x0f3d('0x1a')]==='undefined';var _0x20847d=_0x4d2a43[_0x0f3d('0x1b')];var _0x170919=_0x55c8a0?0x0:_0x2d3751[_0x0f3d('0x1c')];var _0x47a23c=_0x55c8a0?_0x4d2a43[_0x0f3d('0x1b')]:_0x2d3751[_0x0f3d('0x1c')]+_0x2d3751[_0x0f3d('0x1a')];var _0x22f14d;if(_0x47a23c>=_0x20847d){_0x47a23c=_0x20847d;_0x22f14d=0xc8;}else{_0x22f14d=0xce;}_0x58aab2[_0x0f3d('0x18')](_0x22f14d);return _0x58aab2[_0x0f3d('0x1d')](_0x0f3d('0x1e'),_0x170919+'-'+_0x47a23c+'/'+_0x20847d)[_0x0f3d('0x1f')](_0x4d2a43);}return null;};}function patchUpdates(_0x2d56f2){return function(_0x481f30){try{jsonpatch[_0x0f3d('0x20')](_0x481f30,_0x2d56f2,!![]);}catch(_0x24efab){return BPromise['reject'](_0x24efab);}return _0x481f30['save']();};}function saveUpdates(_0x1a82ac,_0x375cf5){return function(_0x3c169d){if(_0x3c169d){return _0x3c169d['update'](_0x1a82ac)[_0x0f3d('0x21')](function(_0x348c5b){return _0x348c5b;});}return null;};}function removeEntity(_0x254877,_0x5b54a9){return function(_0x577b01){if(_0x577b01){return _0x577b01[_0x0f3d('0x22')]()[_0x0f3d('0x21')](function(){_0x254877['status'](0xcc)[_0x0f3d('0x23')]();});}};}function handleEntityNotFound(_0x2139c9,_0x120c00){return function(_0x56f106){if(!_0x56f106){_0x2139c9['sendStatus'](0x194);}return _0x56f106;};}function handleError(_0x5c0f5c,_0x5d7c97){_0x5d7c97=_0x5d7c97||0x1f4;return function(_0x1e09a9){logger[_0x0f3d('0x24')](_0x1e09a9[_0x0f3d('0x25')]);if(_0x1e09a9[_0x0f3d('0x26')]){delete _0x1e09a9[_0x0f3d('0x26')];}_0x5c0f5c[_0x0f3d('0x18')](_0x5d7c97)[_0x0f3d('0x27')](_0x1e09a9);};}exports[_0x0f3d('0x28')]=function(_0x237d03,_0x818f3){var _0xcd5228={},_0x316af3={},_0x28336f={'count':0x0,'rows':[]};var _0x18e8c7=_['map'](db[_0x0f3d('0x29')][_0x0f3d('0x2a')],function(_0x1afa0e){return{'name':_0x1afa0e['fieldName'],'type':_0x1afa0e[_0x0f3d('0x2b')]['key']};});_0x316af3[_0x0f3d('0x2c')]=_[_0x0f3d('0x2d')](_0x18e8c7,_0x0f3d('0x26'));_0x316af3[_0x0f3d('0x2e')]=_['keys'](_0x237d03[_0x0f3d('0x2e')]);_0x316af3[_0x0f3d('0x2f')]=_[_0x0f3d('0x30')](_0x316af3['model'],_0x316af3[_0x0f3d('0x2e')]);_0xcd5228[_0x0f3d('0x31')]=_['intersection'](_0x316af3[_0x0f3d('0x2c')],qs[_0x0f3d('0x32')](_0x237d03['query'][_0x0f3d('0x32')]));_0xcd5228[_0x0f3d('0x31')]=_0xcd5228['attributes'][_0x0f3d('0x33')]?_0xcd5228['attributes']:_0x316af3[_0x0f3d('0x2c')];if(!_0x237d03[_0x0f3d('0x2e')]['hasOwnProperty'](_0x0f3d('0x34'))){_0xcd5228[_0x0f3d('0x1a')]=qs[_0x0f3d('0x1a')](_0x237d03[_0x0f3d('0x2e')]['limit']);_0xcd5228[_0x0f3d('0x1c')]=qs['offset'](_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x1c')]);}_0xcd5228[_0x0f3d('0x35')]=qs[_0x0f3d('0x36')](_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x36')]);_0xcd5228[_0x0f3d('0x37')]=qs[_0x0f3d('0x2f')](_[_0x0f3d('0x38')](_0x237d03[_0x0f3d('0x2e')],_0x316af3[_0x0f3d('0x2f')]),_0x18e8c7);if(_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x39')]){_0xcd5228['where']=_['merge'](_0xcd5228[_0x0f3d('0x37')],{'$or':_['map'](_0x18e8c7,function(_0x1e64a6){if(_0x1e64a6[_0x0f3d('0x2b')]!==_0x0f3d('0x3a')){var _0x2e756e={};_0x2e756e[_0x1e64a6[_0x0f3d('0x26')]]={'$like':'%'+_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x39')]+'%'};return _0x2e756e;}})});}_0xcd5228=_['merge']({},_0xcd5228,_0x237d03[_0x0f3d('0x3b')]);var _0x1fa760={'where':_0xcd5228[_0x0f3d('0x37')]};return db['SalesforceAccount'][_0x0f3d('0x1b')](_0x1fa760)['then'](function(_0x2e945b){_0x28336f[_0x0f3d('0x1b')]=_0x2e945b;if(_0x237d03[_0x0f3d('0x2e')][_0x0f3d('0x3c')]){_0xcd5228[_0x0f3d('0x3d')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0xcd5228);})[_0x0f3d('0x21')](function(_0x3b5c44){_0x28336f[_0x0f3d('0x3e')]=_0x3b5c44;return _0x28336f;})[_0x0f3d('0x21')](respondWithFilteredResult(_0x818f3,_0xcd5228))[_0x0f3d('0x3f')](handleError(_0x818f3,null));};exports[_0x0f3d('0x40')]=function(_0x3d26e6,_0x1af1b8){var _0x1f3754={'raw':![],'where':{'id':_0x3d26e6[_0x0f3d('0x41')]['id']}},_0x13e3f6={};_0x13e3f6[_0x0f3d('0x2c')]=_[_0x0f3d('0x42')](db['SalesforceAccount'][_0x0f3d('0x2a')]);_0x13e3f6['query']=_[_0x0f3d('0x42')](_0x3d26e6[_0x0f3d('0x2e')]);_0x13e3f6[_0x0f3d('0x2f')]=_[_0x0f3d('0x30')](_0x13e3f6['model'],_0x13e3f6[_0x0f3d('0x2e')]);_0x1f3754[_0x0f3d('0x31')]=_['intersection'](_0x13e3f6['model'],qs['fields'](_0x3d26e6['query']['fields']));_0x1f3754[_0x0f3d('0x31')]=_0x1f3754[_0x0f3d('0x31')][_0x0f3d('0x33')]?_0x1f3754[_0x0f3d('0x31')]:_0x13e3f6['model'];if(_0x3d26e6[_0x0f3d('0x2e')][_0x0f3d('0x3c')]){_0x1f3754[_0x0f3d('0x3d')]=[{'all':!![]}];}_0x1f3754=_[_0x0f3d('0x43')]({},_0x1f3754,_0x3d26e6[_0x0f3d('0x3b')]);return db[_0x0f3d('0x29')]['find'](_0x1f3754)['then'](handleEntityNotFound(_0x1af1b8,null))['then'](respondWithResult(_0x1af1b8,null))[_0x0f3d('0x3f')](handleError(_0x1af1b8,null));};exports[_0x0f3d('0x44')]=function(_0x29d62e,_0xdc15fa){return db['SalesforceAccount'][_0x0f3d('0x44')](_0x29d62e[_0x0f3d('0x45')],{})[_0x0f3d('0x21')](respondWithResult(_0xdc15fa,0xc9))[_0x0f3d('0x3f')](handleError(_0xdc15fa,null));};exports['update']=function(_0x1e83c7,_0x1e0c11){if(_0x1e83c7[_0x0f3d('0x45')]['id']){delete _0x1e83c7[_0x0f3d('0x45')]['id'];}return db['SalesforceAccount'][_0x0f3d('0x46')]({'where':{'id':_0x1e83c7[_0x0f3d('0x41')]['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x1e0c11,null))[_0x0f3d('0x21')](saveUpdates(_0x1e83c7[_0x0f3d('0x45')],null))[_0x0f3d('0x21')](respondWithResult(_0x1e0c11,null))['catch'](handleError(_0x1e0c11,null));};exports[_0x0f3d('0x22')]=function(_0x356d64,_0x5b2e44){return db['SalesforceAccount']['find']({'where':{'id':_0x356d64['params']['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x5b2e44,null))[_0x0f3d('0x21')](removeEntity(_0x5b2e44,null))['catch'](handleError(_0x5b2e44,null));};exports[_0x0f3d('0x47')]=function(_0x1cdb32,_0x174ac7,_0x40a589){var _0xd0e61f={};var _0x2e0930={};var _0x44bfac;var _0x2f009d;return db[_0x0f3d('0x29')][_0x0f3d('0x48')]({'where':{'id':_0x1cdb32[_0x0f3d('0x41')]['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x174ac7,null))[_0x0f3d('0x21')](function(_0x29f3d3){if(_0x29f3d3){_0x44bfac=_0x29f3d3;_0x2e0930['model']=_[_0x0f3d('0x42')](db['SalesforceConfiguration'][_0x0f3d('0x2a')]);_0x2e0930[_0x0f3d('0x2e')]=_[_0x0f3d('0x42')](_0x1cdb32['query']);_0x2e0930[_0x0f3d('0x2f')]=_[_0x0f3d('0x30')](_0x2e0930[_0x0f3d('0x2c')],_0x2e0930['query']);_0xd0e61f[_0x0f3d('0x31')]=_[_0x0f3d('0x30')](_0x2e0930[_0x0f3d('0x2c')],qs[_0x0f3d('0x32')](_0x1cdb32[_0x0f3d('0x2e')]['fields']));_0xd0e61f[_0x0f3d('0x31')]=_0xd0e61f['attributes'][_0x0f3d('0x33')]?_0xd0e61f[_0x0f3d('0x31')]:_0x2e0930[_0x0f3d('0x2c')];_0xd0e61f[_0x0f3d('0x35')]=qs[_0x0f3d('0x36')](_0x1cdb32[_0x0f3d('0x2e')][_0x0f3d('0x36')]);_0xd0e61f[_0x0f3d('0x37')]=qs[_0x0f3d('0x2f')](_[_0x0f3d('0x38')](_0x1cdb32[_0x0f3d('0x2e')],_0x2e0930['filters']));if(_0x1cdb32[_0x0f3d('0x2e')][_0x0f3d('0x39')]){_0xd0e61f[_0x0f3d('0x37')]=_[_0x0f3d('0x43')](_0xd0e61f[_0x0f3d('0x37')],{'$or':_[_0x0f3d('0x2d')](_0xd0e61f[_0x0f3d('0x31')],function(_0x32a93e){var _0x4ab3a6={};_0x4ab3a6[_0x32a93e]={'$like':'%'+_0x1cdb32['query'][_0x0f3d('0x39')]+'%'};return _0x4ab3a6;})});}_0xd0e61f=_['merge']({},_0xd0e61f,_0x1cdb32[_0x0f3d('0x3b')]);return _0x44bfac[_0x0f3d('0x47')](_0xd0e61f);}})[_0x0f3d('0x21')](function(_0xa2a796){if(_0xa2a796){_0x2f009d=_0xa2a796['length'];if(!_0x1cdb32['query'][_0x0f3d('0x49')]('nolimit')){_0xd0e61f[_0x0f3d('0x1a')]=qs['limit'](_0x1cdb32[_0x0f3d('0x2e')][_0x0f3d('0x1a')]);_0xd0e61f[_0x0f3d('0x1c')]=qs[_0x0f3d('0x1c')](_0x1cdb32['query']['offset']);}return _0x44bfac[_0x0f3d('0x47')](_0xd0e61f);}})[_0x0f3d('0x21')](function(_0x3e21e5){if(_0x3e21e5){return _0x3e21e5?{'count':_0x2f009d,'rows':_0x3e21e5}:null;}})[_0x0f3d('0x21')](respondWithResult(_0x174ac7,null))[_0x0f3d('0x3f')](handleError(_0x174ac7,null));};exports[_0x0f3d('0x4a')]=function(_0x5e469a,_0x3103a6,_0x7e1abb){if(_0x5e469a[_0x0f3d('0x45')]['id']){delete _0x5e469a['body']['id'];}return db[_0x0f3d('0x29')][_0x0f3d('0x48')]({'where':{'id':_0x5e469a[_0x0f3d('0x41')]['id']}})[_0x0f3d('0x21')](handleEntityNotFound(_0x3103a6,null))['then'](function(_0x4c47a5){if(_0x4c47a5){_0x5e469a['body']['AccountId']=_0x4c47a5['id'];_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x4b')]=integrations[_0x0f3d('0x4c')](_0x5e469a[_0x0f3d('0x45')]['channel'],_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x2b')]);_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x4d')]=integrations['getDescriptions'](_0x5e469a[_0x0f3d('0x45')]['channel'],_0x5e469a[_0x0f3d('0x45')][_0x0f3d('0x2b')]);return db[_0x0f3d('0x4e')][_0x0f3d('0x44')](_0x5e469a[_0x0f3d('0x45')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x0f3d('0x4f')],'as':_0x0f3d('0x4d')}]});}return null;})[_0x0f3d('0x21')](respondWithResult(_0x3103a6,null))['catch'](handleError(_0x3103a6,null));};exports[_0x0f3d('0x50')]=function(_0x4fa99,_0x3b03d9,_0x24c4ab){var _0x58a500;var _0x4a69c9='';var _0xd26a36='Task';return db[_0x0f3d('0x29')][_0x0f3d('0x48')]({'where':{'id':_0x4fa99[_0x0f3d('0x41')]['id']},'attributes':['id',_0x0f3d('0x51'),'clientId','clientSecret',_0x0f3d('0x52'),_0x0f3d('0x53'),'securityToken']})[_0x0f3d('0x21')](handleEntityNotFound(_0x3b03d9,null))[_0x0f3d('0x21')](function(_0x5601ae){if(_0x5601ae){_0x4a69c9=_0x5601ae['remoteUri'];var _0x1d7c85=_0x4a69c9[_0x0f3d('0x54')](-0x1);if(_0x1d7c85==='/'){_0x4a69c9=_0x4a69c9[_0x0f3d('0x55')](0x0,_0x4a69c9[_0x0f3d('0x56')](_0x1d7c85));}_0x58a500=new jsforce[(_0x0f3d('0x57'))]({'oauth2':{'loginUrl':_0x4a69c9,'clientId':_0x5601ae[_0x0f3d('0x58')],'clientSecret':_0x5601ae[_0x0f3d('0x59')]}});return _0x58a500[_0x0f3d('0x5a')](_0x5601ae['username'],_0x5601ae[_0x0f3d('0x53')][_0x0f3d('0x5b')](_0x5601ae[_0x0f3d('0x5c')]));}})['then'](function(_0x3819ef){if(_0x3819ef){if(!_[_0x0f3d('0x5d')](_0x4fa99[_0x0f3d('0x2e')][_0x0f3d('0x5e')])){_0xd26a36=_0x4fa99[_0x0f3d('0x2e')][_0x0f3d('0x5e')];}return _0x58a500[_0x0f3d('0x5f')](_0xd26a36)['describe']();}})[_0x0f3d('0x21')](function(_0x41deca){var _0x35e26d=[_0x0f3d('0x60'),_0x0f3d('0x61'),_0x0f3d('0x62'),_0x0f3d('0x63'),_0x0f3d('0x64'),_0x0f3d('0x65')];var _0x5ae4ef=['string',_0x0f3d('0x66'),_0x0f3d('0x67'),_0x0f3d('0x68'),_0x0f3d('0x69'),'textarea',_0x0f3d('0x6a')];if(_0x41deca){_[_0x0f3d('0x6b')](_0x41deca[_0x0f3d('0x32')],function(_0x11b1b0){return _0x35e26d['includes'](_0x11b1b0['name'])||!_0x5ae4ef[_0x0f3d('0x6c')](_0x11b1b0[_0x0f3d('0x2b')]);});return{'count':_0x41deca[_0x0f3d('0x32')]['length'],'rows':_[_0x0f3d('0x2d')](_0x41deca['fields'],function(_0x3fc5e1){return{'id':_0x3fc5e1[_0x0f3d('0x26')],'name':_0x3fc5e1[_0x0f3d('0x6d')],'custom':_0x3fc5e1[_0x0f3d('0x6e')],'options':_0x3fc5e1[_0x0f3d('0x6f')][_0x0f3d('0x33')]>0x0?_[_0x0f3d('0x2d')](_0x3fc5e1[_0x0f3d('0x6f')],function(_0x5d88ba){return{'name':_0x5d88ba['label'],'value':_0x5d88ba[_0x0f3d('0x70')]};}):_0x3fc5e1['type']==_0x0f3d('0x68')?[{'name':'True','value':'true'},{'name':_0x0f3d('0x71'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x3b03d9,null))['catch'](function(_0x3ab4dd){var _0x4ee79d=_0x4fa99[_0x0f3d('0x2e')][_0x0f3d('0x72')]?0x1f4:_0x3ab4dd['statusCode']||0x1f4;logger['error'](_0x0f3d('0x73'),_0x0f3d('0x50'),_0x4ee79d,JSON[_0x0f3d('0x74')](_0x3ab4dd));delete _0x3ab4dd['name'];if(_0x4ee79d===0x191){_0x4ee79d=0x190;}_0x3b03d9[_0x0f3d('0x18')](_0x4ee79d)['send'](_0x4fa99['query']['test']?{'message':_0x0f3d('0x75'),'statusCode':_0x3ab4dd[_0x0f3d('0x76')]}:_0x3ab4dd);});}; \ No newline at end of file +var _0x4852=['isNil','ticketType','sobject','describe','OwnerId','IsRecurrence','Description','int','boolean','email','textarea','includes','label','custom','picklistValues','value','true','False','false','error','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','getConfigurations','findOne','SalesforceConfiguration','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','clientId'];(function(_0x1acc44,_0x4661ab){var _0x5bee35=function(_0x5da868){while(--_0x5da868){_0x1acc44['push'](_0x1acc44['shift']());}};_0x5bee35(++_0x4661ab);}(_0x4852,0xff));var _0x2485=function(_0x36e161,_0x4b15d0){_0x36e161=_0x36e161-0x0;var _0x5a7e53=_0x4852[_0x36e161];return _0x5a7e53;};'use strict';var emlformat=require(_0x2485('0x0'));var rimraf=require(_0x2485('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2485('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2485('0x3'));var Mustache=require(_0x2485('0x4'));var util=require(_0x2485('0x5'));var path=require(_0x2485('0x6'));var sox=require('sox');var csv=require(_0x2485('0x7'));var ejs=require(_0x2485('0x8'));var fs=require('fs');var fs_extra=require(_0x2485('0x9'));var _=require('lodash');var squel=require(_0x2485('0xa'));var crypto=require(_0x2485('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2485('0xc'));var Papa=require(_0x2485('0xd'));var Redis=require('ioredis');var authService=require(_0x2485('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2485('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2485('0x10'))('api');var utils=require(_0x2485('0x11'));var config=require(_0x2485('0x12'));var licenseUtil=require(_0x2485('0x13'));var db=require(_0x2485('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x487f01,_0x21838d){_0x21838d=_0x21838d||0xcc;return function(_0x24d39b){if(_0x24d39b){return _0x487f01[_0x2485('0x15')](_0x21838d);}return _0x487f01[_0x2485('0x16')](_0x21838d)[_0x2485('0x17')]();};}function respondWithResult(_0x2cc78c,_0x50a33a){_0x50a33a=_0x50a33a||0xc8;return function(_0x338739){if(_0x338739){return _0x2cc78c['status'](_0x50a33a)[_0x2485('0x18')](_0x338739);}};}function respondWithFilteredResult(_0x848c7c,_0x3b225f){return function(_0x425d8e){if(_0x425d8e){var _0x5ba3b8=typeof _0x3b225f[_0x2485('0x19')]==='undefined'&&typeof _0x3b225f[_0x2485('0x1a')]===_0x2485('0x1b');var _0x4f321d=_0x425d8e[_0x2485('0x1c')];var _0x7ba65f=_0x5ba3b8?0x0:_0x3b225f[_0x2485('0x19')];var _0x332e72=_0x5ba3b8?_0x425d8e[_0x2485('0x1c')]:_0x3b225f['offset']+_0x3b225f['limit'];var _0x3a4667;if(_0x332e72>=_0x4f321d){_0x332e72=_0x4f321d;_0x3a4667=0xc8;}else{_0x3a4667=0xce;}_0x848c7c['status'](_0x3a4667);return _0x848c7c[_0x2485('0x1d')](_0x2485('0x1e'),_0x7ba65f+'-'+_0x332e72+'/'+_0x4f321d)[_0x2485('0x18')](_0x425d8e);}return null;};}function patchUpdates(_0x3d6de1){return function(_0x4b5c1a){try{jsonpatch[_0x2485('0x1f')](_0x4b5c1a,_0x3d6de1,!![]);}catch(_0x504dfa){return BPromise[_0x2485('0x20')](_0x504dfa);}return _0x4b5c1a['save']();};}function saveUpdates(_0x54d931,_0x172bb1){return function(_0x58c728){if(_0x58c728){return _0x58c728['update'](_0x54d931)[_0x2485('0x21')](function(_0x10e6d6){return _0x10e6d6;});}return null;};}function removeEntity(_0x496bd7,_0xa02fdd){return function(_0x38046d){if(_0x38046d){return _0x38046d[_0x2485('0x22')]()[_0x2485('0x21')](function(){_0x496bd7[_0x2485('0x16')](0xcc)[_0x2485('0x17')]();});}};}function handleEntityNotFound(_0x5068e6,_0x53c6cb){return function(_0x295f77){if(!_0x295f77){_0x5068e6[_0x2485('0x15')](0x194);}return _0x295f77;};}function handleError(_0x154d4d,_0x35b941){_0x35b941=_0x35b941||0x1f4;return function(_0x2fd1c7){logger['error'](_0x2fd1c7[_0x2485('0x23')]);if(_0x2fd1c7['name']){delete _0x2fd1c7[_0x2485('0x24')];}_0x154d4d['status'](_0x35b941)[_0x2485('0x25')](_0x2fd1c7);};}exports[_0x2485('0x26')]=function(_0x4f5034,_0x6de190){var _0x4620fe={},_0x1ef543={},_0x18b695={'count':0x0,'rows':[]};var _0x8cfddf=_[_0x2485('0x27')](db[_0x2485('0x28')][_0x2485('0x29')],function(_0x27b3d2){return{'name':_0x27b3d2[_0x2485('0x2a')],'type':_0x27b3d2[_0x2485('0x2b')]['key']};});_0x1ef543[_0x2485('0x2c')]=_[_0x2485('0x27')](_0x8cfddf,_0x2485('0x24'));_0x1ef543[_0x2485('0x2d')]=_[_0x2485('0x2e')](_0x4f5034[_0x2485('0x2d')]);_0x1ef543['filters']=_[_0x2485('0x2f')](_0x1ef543[_0x2485('0x2c')],_0x1ef543[_0x2485('0x2d')]);_0x4620fe[_0x2485('0x30')]=_[_0x2485('0x2f')](_0x1ef543[_0x2485('0x2c')],qs[_0x2485('0x31')](_0x4f5034[_0x2485('0x2d')]['fields']));_0x4620fe[_0x2485('0x30')]=_0x4620fe[_0x2485('0x30')][_0x2485('0x32')]?_0x4620fe[_0x2485('0x30')]:_0x1ef543[_0x2485('0x2c')];if(!_0x4f5034[_0x2485('0x2d')][_0x2485('0x33')]('nolimit')){_0x4620fe[_0x2485('0x1a')]=qs[_0x2485('0x1a')](_0x4f5034[_0x2485('0x2d')][_0x2485('0x1a')]);_0x4620fe[_0x2485('0x19')]=qs[_0x2485('0x19')](_0x4f5034[_0x2485('0x2d')][_0x2485('0x19')]);}_0x4620fe[_0x2485('0x34')]=qs[_0x2485('0x35')](_0x4f5034['query']['sort']);_0x4620fe[_0x2485('0x36')]=qs['filters'](_[_0x2485('0x37')](_0x4f5034[_0x2485('0x2d')],_0x1ef543[_0x2485('0x38')]),_0x8cfddf);if(_0x4f5034[_0x2485('0x2d')][_0x2485('0x39')]){_0x4620fe[_0x2485('0x36')]=_[_0x2485('0x3a')](_0x4620fe[_0x2485('0x36')],{'$or':_[_0x2485('0x27')](_0x8cfddf,function(_0x4efe9f){if(_0x4efe9f[_0x2485('0x2b')]!=='VIRTUAL'){var _0x1d2a8b={};_0x1d2a8b[_0x4efe9f['name']]={'$like':'%'+_0x4f5034[_0x2485('0x2d')][_0x2485('0x39')]+'%'};return _0x1d2a8b;}})});}_0x4620fe=_['merge']({},_0x4620fe,_0x4f5034[_0x2485('0x3b')]);var _0x354dea={'where':_0x4620fe['where']};return db[_0x2485('0x28')][_0x2485('0x1c')](_0x354dea)[_0x2485('0x21')](function(_0x1a0e44){_0x18b695[_0x2485('0x1c')]=_0x1a0e44;if(_0x4f5034[_0x2485('0x2d')][_0x2485('0x3c')]){_0x4620fe[_0x2485('0x3d')]=[{'all':!![]}];}return db[_0x2485('0x28')][_0x2485('0x3e')](_0x4620fe);})['then'](function(_0xf894ab){_0x18b695[_0x2485('0x3f')]=_0xf894ab;return _0x18b695;})[_0x2485('0x21')](respondWithFilteredResult(_0x6de190,_0x4620fe))[_0x2485('0x40')](handleError(_0x6de190,null));};exports[_0x2485('0x41')]=function(_0x19b7ba,_0x55f8d0){var _0x20da91={'raw':![],'where':{'id':_0x19b7ba[_0x2485('0x42')]['id']}},_0x221264={};_0x221264[_0x2485('0x2c')]=_[_0x2485('0x2e')](db[_0x2485('0x28')][_0x2485('0x29')]);_0x221264[_0x2485('0x2d')]=_['keys'](_0x19b7ba[_0x2485('0x2d')]);_0x221264[_0x2485('0x38')]=_['intersection'](_0x221264[_0x2485('0x2c')],_0x221264[_0x2485('0x2d')]);_0x20da91[_0x2485('0x30')]=_[_0x2485('0x2f')](_0x221264[_0x2485('0x2c')],qs[_0x2485('0x31')](_0x19b7ba[_0x2485('0x2d')]['fields']));_0x20da91['attributes']=_0x20da91[_0x2485('0x30')][_0x2485('0x32')]?_0x20da91[_0x2485('0x30')]:_0x221264[_0x2485('0x2c')];if(_0x19b7ba[_0x2485('0x2d')][_0x2485('0x3c')]){_0x20da91[_0x2485('0x3d')]=[{'all':!![]}];}_0x20da91=_[_0x2485('0x3a')]({},_0x20da91,_0x19b7ba[_0x2485('0x3b')]);return db[_0x2485('0x28')][_0x2485('0x43')](_0x20da91)[_0x2485('0x21')](handleEntityNotFound(_0x55f8d0,null))[_0x2485('0x21')](respondWithResult(_0x55f8d0,null))['catch'](handleError(_0x55f8d0,null));};exports[_0x2485('0x44')]=function(_0x5a7ed3,_0x4e1d04){return db['SalesforceAccount'][_0x2485('0x44')](_0x5a7ed3['body'],{})['then'](respondWithResult(_0x4e1d04,0xc9))[_0x2485('0x40')](handleError(_0x4e1d04,null));};exports[_0x2485('0x45')]=function(_0x501273,_0x1f7b5a){if(_0x501273[_0x2485('0x46')]['id']){delete _0x501273[_0x2485('0x46')]['id'];}return db[_0x2485('0x28')][_0x2485('0x43')]({'where':{'id':_0x501273[_0x2485('0x42')]['id']}})['then'](handleEntityNotFound(_0x1f7b5a,null))[_0x2485('0x21')](saveUpdates(_0x501273[_0x2485('0x46')],null))[_0x2485('0x21')](respondWithResult(_0x1f7b5a,null))[_0x2485('0x40')](handleError(_0x1f7b5a,null));};exports[_0x2485('0x22')]=function(_0xe62b06,_0x148fc3){return db[_0x2485('0x28')][_0x2485('0x43')]({'where':{'id':_0xe62b06[_0x2485('0x42')]['id']}})[_0x2485('0x21')](handleEntityNotFound(_0x148fc3,null))[_0x2485('0x21')](removeEntity(_0x148fc3,null))[_0x2485('0x40')](handleError(_0x148fc3,null));};exports[_0x2485('0x47')]=function(_0x46e645,_0x3769d4,_0x17405c){var _0x2665a7={};var _0x31dee3={};var _0x5f0aa0;var _0x5a476a;return db['SalesforceAccount'][_0x2485('0x48')]({'where':{'id':_0x46e645[_0x2485('0x42')]['id']}})[_0x2485('0x21')](handleEntityNotFound(_0x3769d4,null))[_0x2485('0x21')](function(_0x38778c){if(_0x38778c){_0x5f0aa0=_0x38778c;_0x31dee3[_0x2485('0x2c')]=_[_0x2485('0x2e')](db[_0x2485('0x49')][_0x2485('0x29')]);_0x31dee3[_0x2485('0x2d')]=_[_0x2485('0x2e')](_0x46e645[_0x2485('0x2d')]);_0x31dee3['filters']=_['intersection'](_0x31dee3[_0x2485('0x2c')],_0x31dee3[_0x2485('0x2d')]);_0x2665a7['attributes']=_[_0x2485('0x2f')](_0x31dee3[_0x2485('0x2c')],qs[_0x2485('0x31')](_0x46e645[_0x2485('0x2d')][_0x2485('0x31')]));_0x2665a7[_0x2485('0x30')]=_0x2665a7[_0x2485('0x30')]['length']?_0x2665a7[_0x2485('0x30')]:_0x31dee3[_0x2485('0x2c')];_0x2665a7[_0x2485('0x34')]=qs['sort'](_0x46e645[_0x2485('0x2d')]['sort']);_0x2665a7[_0x2485('0x36')]=qs[_0x2485('0x38')](_[_0x2485('0x37')](_0x46e645[_0x2485('0x2d')],_0x31dee3[_0x2485('0x38')]));if(_0x46e645[_0x2485('0x2d')]['filter']){_0x2665a7[_0x2485('0x36')]=_[_0x2485('0x3a')](_0x2665a7[_0x2485('0x36')],{'$or':_[_0x2485('0x27')](_0x2665a7[_0x2485('0x30')],function(_0x1a6c72){var _0x4b3ab5={};_0x4b3ab5[_0x1a6c72]={'$like':'%'+_0x46e645[_0x2485('0x2d')]['filter']+'%'};return _0x4b3ab5;})});}_0x2665a7=_[_0x2485('0x3a')]({},_0x2665a7,_0x46e645[_0x2485('0x3b')]);return _0x5f0aa0['getConfigurations'](_0x2665a7);}})[_0x2485('0x21')](function(_0x20aca8){if(_0x20aca8){_0x5a476a=_0x20aca8[_0x2485('0x32')];if(!_0x46e645[_0x2485('0x2d')][_0x2485('0x33')](_0x2485('0x4a'))){_0x2665a7[_0x2485('0x1a')]=qs['limit'](_0x46e645[_0x2485('0x2d')][_0x2485('0x1a')]);_0x2665a7[_0x2485('0x19')]=qs['offset'](_0x46e645[_0x2485('0x2d')][_0x2485('0x19')]);}return _0x5f0aa0['getConfigurations'](_0x2665a7);}})[_0x2485('0x21')](function(_0x3b69a4){if(_0x3b69a4){return _0x3b69a4?{'count':_0x5a476a,'rows':_0x3b69a4}:null;}})[_0x2485('0x21')](respondWithResult(_0x3769d4,null))[_0x2485('0x40')](handleError(_0x3769d4,null));};exports['addConfiguration']=function(_0x190720,_0x5dc366,_0x259f2a){if(_0x190720[_0x2485('0x46')]['id']){delete _0x190720[_0x2485('0x46')]['id'];}return db['SalesforceAccount'][_0x2485('0x48')]({'where':{'id':_0x190720[_0x2485('0x42')]['id']}})[_0x2485('0x21')](handleEntityNotFound(_0x5dc366,null))[_0x2485('0x21')](function(_0x44615b){if(_0x44615b){_0x190720['body'][_0x2485('0x4b')]=_0x44615b['id'];_0x190720[_0x2485('0x46')][_0x2485('0x4c')]=integrations[_0x2485('0x4d')](_0x190720[_0x2485('0x46')]['channel'],_0x190720[_0x2485('0x46')][_0x2485('0x2b')]);_0x190720[_0x2485('0x46')][_0x2485('0x4e')]=integrations[_0x2485('0x4f')](_0x190720[_0x2485('0x46')][_0x2485('0x50')],_0x190720[_0x2485('0x46')][_0x2485('0x2b')]);return db['SalesforceConfiguration'][_0x2485('0x44')](_0x190720['body'],{'include':[{'model':db[_0x2485('0x51')],'as':'Subjects'},{'model':db[_0x2485('0x51')],'as':_0x2485('0x4e')}]});}return null;})[_0x2485('0x21')](respondWithResult(_0x5dc366,null))[_0x2485('0x40')](handleError(_0x5dc366,null));};exports[_0x2485('0x52')]=function(_0x5c67a1,_0x22afa9,_0x15c20d){var _0x1687ce;var _0x2afd99='';var _0x4e028f=_0x2485('0x53');return db[_0x2485('0x28')][_0x2485('0x48')]({'where':{'id':_0x5c67a1[_0x2485('0x42')]['id']},'attributes':['id',_0x2485('0x54'),'clientId',_0x2485('0x55'),_0x2485('0x56'),_0x2485('0x57'),_0x2485('0x58')]})[_0x2485('0x21')](handleEntityNotFound(_0x22afa9,null))[_0x2485('0x21')](function(_0x6086fa){if(_0x6086fa){_0x2afd99=_0x6086fa['remoteUri'];var _0x354dc0=_0x2afd99[_0x2485('0x59')](-0x1);if(_0x354dc0==='/'){_0x2afd99=_0x2afd99['substring'](0x0,_0x2afd99[_0x2485('0x5a')](_0x354dc0));}_0x1687ce=new jsforce[(_0x2485('0x5b'))]({'oauth2':{'loginUrl':_0x2afd99,'clientId':_0x6086fa[_0x2485('0x5c')],'clientSecret':_0x6086fa[_0x2485('0x55')]}});return _0x1687ce['login'](_0x6086fa['username'],_0x6086fa[_0x2485('0x57')]['concat'](_0x6086fa[_0x2485('0x58')]));}})[_0x2485('0x21')](function(_0x2d57e){if(_0x2d57e){if(!_[_0x2485('0x5d')](_0x5c67a1[_0x2485('0x2d')][_0x2485('0x5e')])){_0x4e028f=_0x5c67a1[_0x2485('0x2d')][_0x2485('0x5e')];}return _0x1687ce[_0x2485('0x5f')](_0x4e028f)[_0x2485('0x60')]();}})[_0x2485('0x21')](function(_0xc2c887){var _0x324966=[_0x2485('0x61'),'ActivityDate','IsReminderSet',_0x2485('0x62'),'Subject',_0x2485('0x63')];var _0x1d3725=['string',_0x2485('0x64'),'picklist',_0x2485('0x65'),_0x2485('0x66'),_0x2485('0x67'),'phone'];if(_0xc2c887){_['remove'](_0xc2c887[_0x2485('0x31')],function(_0x3d0d0c){return _0x324966[_0x2485('0x68')](_0x3d0d0c[_0x2485('0x24')])||!_0x1d3725[_0x2485('0x68')](_0x3d0d0c[_0x2485('0x2b')]);});return{'count':_0xc2c887[_0x2485('0x31')][_0x2485('0x32')],'rows':_['map'](_0xc2c887[_0x2485('0x31')],function(_0x17de7d){return{'id':_0x17de7d[_0x2485('0x24')],'name':_0x17de7d[_0x2485('0x69')],'custom':_0x17de7d[_0x2485('0x6a')],'options':_0x17de7d[_0x2485('0x6b')][_0x2485('0x32')]>0x0?_[_0x2485('0x27')](_0x17de7d[_0x2485('0x6b')],function(_0x584fc7){return{'name':_0x584fc7[_0x2485('0x69')],'value':_0x584fc7[_0x2485('0x6c')]};}):_0x17de7d['type']==_0x2485('0x65')?[{'name':'True','value':_0x2485('0x6d')},{'name':_0x2485('0x6e'),'value':_0x2485('0x6f')}]:[]};})};}})[_0x2485('0x21')](respondWithResult(_0x22afa9,null))[_0x2485('0x40')](function(_0x350a2a){var _0x57f209=_0x5c67a1[_0x2485('0x2d')]['test']?0x1f4:_0x350a2a['statusCode']||0x1f4;logger[_0x2485('0x70')](_0x2485('0x71'),_0x2485('0x52'),_0x57f209,JSON[_0x2485('0x72')](_0x350a2a));delete _0x350a2a[_0x2485('0x24')];if(_0x57f209===0x191){_0x57f209=0x190;}_0x22afa9[_0x2485('0x16')](_0x57f209)['send'](_0x5c67a1['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x350a2a[_0x2485('0x73')]}:_0x350a2a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ab15644..ce267bf 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 _0x944e=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','lodash'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0x944e,0xba));var _0xe944=function(_0x45ac6b,_0x4489ad){_0x45ac6b=_0x45ac6b-0x0;var _0x4510a9=_0x944e[_0x45ac6b];return _0x4510a9;};'use strict';var _=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var logger=require(_0xe944('0x2'))(_0xe944('0x3'));var moment=require(_0xe944('0x4'));var BPromise=require(_0xe944('0x5'));var rp=require(_0xe944('0x6'));var fs=require('fs');var path=require(_0xe944('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xe944('0x8'));module[_0xe944('0x9')]=function(_0x4bceaf,_0x30b59b){return _0x4bceaf[_0xe944('0xa')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9cc=['exports','define','SalesforceAccount','lodash','util','api','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x440c08,_0x502eb1){var _0x2fd835=function(_0xe24c46){while(--_0xe24c46){_0x440c08['push'](_0x440c08['shift']());}};_0x2fd835(++_0x502eb1);}(_0xd9cc,0x66));var _0xcd9c=function(_0x4d1fbd,_0x54ba98){_0x4d1fbd=_0x4d1fbd-0x0;var _0x9220e6=_0xd9cc[_0x4d1fbd];return _0x9220e6;};'use strict';var _=require(_0xcd9c('0x0'));var util=require(_0xcd9c('0x1'));var logger=require('../../config/logger')(_0xcd9c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcd9c('0x3'));var fs=require('fs');var path=require(_0xcd9c('0x4'));var rimraf=require(_0xcd9c('0x5'));var config=require(_0xcd9c('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xcd9c('0x7'));module[_0xcd9c('0x8')]=function(_0x294833,_0x242d02){return _0x294833[_0xcd9c('0x9')](_0xcd9c('0xa'),attributes,{'tableName':'int_salesforce_accounts','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 c38b95b..024cac5 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 _0xed60=['then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','findAll','options','where','attributes','limit','include','map','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','raw','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request'];(function(_0x44dbde,_0x535682){var _0x217ff9=function(_0x556c04){while(--_0x556c04){_0x44dbde['push'](_0x44dbde['shift']());}};_0x217ff9(++_0x535682);}(_0xed60,0x77));var _0x0ed6=function(_0x39af20,_0x4cb30e){_0x39af20=_0x39af20-0x0;var _0x56c40d=_0xed60[_0x39af20];return _0x56c40d;};'use strict';var _=require('lodash');var util=require(_0x0ed6('0x0'));var moment=require(_0x0ed6('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ed6('0x2'));var fs=require('fs');var Redis=require(_0x0ed6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ed6('0x4'))('rpc');var config=require(_0x0ed6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0ed6('0x6')][_0x0ed6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bcd2b,_0x536c1b,_0x288f59){return new BPromise(function(_0x229e11,_0x4466fb){return client[_0x0ed6('0x8')](_0x1bcd2b,_0x288f59)[_0x0ed6('0x9')](function(_0x25ae41){logger['info'](_0x0ed6('0xa'),_0x536c1b,_0x0ed6('0xb'));logger[_0x0ed6('0xc')](_0x0ed6('0xd'),_0x536c1b,'request\x20sent',JSON['stringify'](_0x25ae41));if(_0x25ae41[_0x0ed6('0xe')]){if(_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0xf')]===0x1f4){logger[_0x0ed6('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x536c1b,_0x25ae41['error'][_0x0ed6('0x10')]);return _0x4466fb(_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0x10')]);}logger[_0x0ed6('0xe')](_0x0ed6('0xa'),_0x536c1b,_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0x10')]);return _0x229e11(_0x25ae41[_0x0ed6('0xe')][_0x0ed6('0x10')]);}else{logger[_0x0ed6('0x11')](_0x0ed6('0xa'),_0x536c1b,_0x0ed6('0xb'));_0x229e11(_0x25ae41[_0x0ed6('0x12')][_0x0ed6('0x10')]);}})[_0x0ed6('0x13')](function(_0x35f683){logger[_0x0ed6('0xe')](_0x0ed6('0xa'),_0x536c1b,_0x35f683);_0x4466fb(_0x35f683);});});}exports['GetSalesforceAccount']=function(_0x1ecea7){var _0x5f3157=this;return new Promise(function(_0x4b85a8,_0xe0087f){return db['SalesforceAccount'][_0x0ed6('0x14')]({'raw':_0x1ecea7[_0x0ed6('0x15')]?_0x1ecea7[_0x0ed6('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1ecea7[_0x0ed6('0x15')]?_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x16')]||null:null,'attributes':_0x1ecea7[_0x0ed6('0x15')]?_0x1ecea7['options'][_0x0ed6('0x17')]||null:null,'limit':_0x1ecea7['options']?_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x18')]||null:null,'include':_0x1ecea7['options']?_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x1ecea7[_0x0ed6('0x15')][_0x0ed6('0x19')],function(_0x247084){return{'model':db[_0x247084['model']],'as':_0x247084['as'],'attributes':_0x247084['attributes'],'include':_0x247084[_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x247084[_0x0ed6('0x19')],function(_0x54b6c7){return{'model':db[_0x54b6c7[_0x0ed6('0x1b')]],'as':_0x54b6c7['as'],'attributes':_0x54b6c7[_0x0ed6('0x17')],'include':_0x54b6c7[_0x0ed6('0x19')]?_['map'](_0x54b6c7['include'],function(_0xcc99c1){return{'model':db[_0xcc99c1[_0x0ed6('0x1b')]],'as':_0xcc99c1['as'],'attributes':_0xcc99c1[_0x0ed6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0ed6('0x9')](function(_0x33d4f8){logger[_0x0ed6('0x11')](_0x0ed6('0x1c'),_0x1ecea7);logger[_0x0ed6('0xc')](_0x0ed6('0x1c'),_0x1ecea7,JSON[_0x0ed6('0x1d')](_0x33d4f8));_0x4b85a8(_0x33d4f8);})[_0x0ed6('0x13')](function(_0x28a1e7){logger[_0x0ed6('0xe')](_0x0ed6('0x1c'),_0x28a1e7[_0x0ed6('0x10')],_0x1ecea7);_0xe0087f(_0x5f3157[_0x0ed6('0xe')](0x1f4,_0x28a1e7[_0x0ed6('0x10')]));});});};exports[_0x0ed6('0x1e')]=function(_0x21a885){var _0x7996ca=this;return new Promise(function(_0x22b0f9,_0x4cde2e){return db['SalesforceAccount']['find']({'raw':_0x21a885[_0x0ed6('0x15')]?_0x21a885['options'][_0x0ed6('0x1f')]===undefined?!![]:![]:!![],'where':_0x21a885[_0x0ed6('0x15')]?_0x21a885['options'][_0x0ed6('0x16')]||null:null,'attributes':_0x21a885[_0x0ed6('0x15')]?_0x21a885[_0x0ed6('0x15')][_0x0ed6('0x17')]||null:null,'include':_0x21a885[_0x0ed6('0x15')]?_0x21a885['options'][_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x21a885[_0x0ed6('0x15')][_0x0ed6('0x19')],function(_0x265720){return{'model':db[_0x265720[_0x0ed6('0x1b')]],'as':_0x265720['as'],'attributes':_0x265720['attributes'],'include':_0x265720[_0x0ed6('0x19')]?_['map'](_0x265720['include'],function(_0x13d09a){return{'model':db[_0x13d09a[_0x0ed6('0x1b')]],'as':_0x13d09a['as'],'attributes':_0x13d09a[_0x0ed6('0x17')],'include':_0x13d09a[_0x0ed6('0x19')]?_[_0x0ed6('0x1a')](_0x13d09a[_0x0ed6('0x19')],function(_0x3b74a9){return{'model':db[_0x3b74a9[_0x0ed6('0x1b')]],'as':_0x3b74a9['as'],'attributes':_0x3b74a9[_0x0ed6('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0ed6('0x9')](function(_0x32f866){logger[_0x0ed6('0x11')](_0x0ed6('0x1e'),_0x21a885);logger[_0x0ed6('0xc')](_0x0ed6('0x1e'),_0x21a885,JSON[_0x0ed6('0x1d')](_0x32f866));_0x22b0f9(_0x32f866);})['catch'](function(_0x13650e){logger['error'](_0x0ed6('0x1e'),_0x13650e['message'],_0x21a885);_0x4cde2e(_0x7996ca['error'](0x1f4,_0x13650e[_0x0ed6('0x10')]));});});}; \ No newline at end of file +var _0x13e6=['stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount','findAll','options','raw','where','limit','include','map','attributes','model','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3d7fd7,_0x3e260e){var _0x455aa7=function(_0x584f2a){while(--_0x584f2a){_0x3d7fd7['push'](_0x3d7fd7['shift']());}};_0x455aa7(++_0x3e260e);}(_0x13e6,0xce));var _0x613e=function(_0x53af3f,_0x3c7918){_0x53af3f=_0x53af3f-0x0;var _0x2339b2=_0x13e6[_0x53af3f];return _0x2339b2;};'use strict';var _=require(_0x613e('0x0'));var util=require(_0x613e('0x1'));var moment=require(_0x613e('0x2'));var BPromise=require(_0x613e('0x3'));var rs=require(_0x613e('0x4'));var fs=require('fs');var Redis=require(_0x613e('0x5'));var db=require(_0x613e('0x6'))['db'];var utils=require(_0x613e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x613e('0x8'));var jayson=require(_0x613e('0x9'));var client=jayson['client'][_0x613e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28effb,_0x20a707,_0x5ec4a9){return new BPromise(function(_0x2edaef,_0x223ac9){return client[_0x613e('0xb')](_0x28effb,_0x5ec4a9)[_0x613e('0xc')](function(_0x244213){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x20a707,_0x613e('0xd'));logger[_0x613e('0xe')](_0x613e('0xf'),_0x20a707,_0x613e('0xd'),JSON[_0x613e('0x10')](_0x244213));if(_0x244213[_0x613e('0x11')]){if(_0x244213[_0x613e('0x11')][_0x613e('0x12')]===0x1f4){logger[_0x613e('0x11')](_0x613e('0x13'),_0x20a707,_0x244213[_0x613e('0x11')][_0x613e('0x14')]);return _0x223ac9(_0x244213[_0x613e('0x11')][_0x613e('0x14')]);}logger[_0x613e('0x11')](_0x613e('0x13'),_0x20a707,_0x244213[_0x613e('0x11')]['message']);return _0x2edaef(_0x244213[_0x613e('0x11')]['message']);}else{logger[_0x613e('0x15')](_0x613e('0x13'),_0x20a707,'request\x20sent');_0x2edaef(_0x244213[_0x613e('0x16')][_0x613e('0x14')]);}})[_0x613e('0x17')](function(_0x194026){logger[_0x613e('0x11')](_0x613e('0x13'),_0x20a707,_0x194026);_0x223ac9(_0x194026);});});}exports['GetSalesforceAccount']=function(_0x77be25){var _0x3946ee=this;return new Promise(function(_0xd03746,_0x2dff7d){return db[_0x613e('0x18')][_0x613e('0x19')]({'raw':_0x77be25[_0x613e('0x1a')]?_0x77be25['options'][_0x613e('0x1b')]===undefined?!![]:![]:!![],'where':_0x77be25['options']?_0x77be25[_0x613e('0x1a')][_0x613e('0x1c')]||null:null,'attributes':_0x77be25['options']?_0x77be25[_0x613e('0x1a')]['attributes']||null:null,'limit':_0x77be25['options']?_0x77be25[_0x613e('0x1a')][_0x613e('0x1d')]||null:null,'include':_0x77be25['options']?_0x77be25[_0x613e('0x1a')][_0x613e('0x1e')]?_[_0x613e('0x1f')](_0x77be25[_0x613e('0x1a')][_0x613e('0x1e')],function(_0x50c044){return{'model':db[_0x50c044['model']],'as':_0x50c044['as'],'attributes':_0x50c044[_0x613e('0x20')],'include':_0x50c044[_0x613e('0x1e')]?_[_0x613e('0x1f')](_0x50c044[_0x613e('0x1e')],function(_0x3882db){return{'model':db[_0x3882db[_0x613e('0x21')]],'as':_0x3882db['as'],'attributes':_0x3882db[_0x613e('0x20')],'include':_0x3882db[_0x613e('0x1e')]?_['map'](_0x3882db[_0x613e('0x1e')],function(_0x241c7b){return{'model':db[_0x241c7b['model']],'as':_0x241c7b['as'],'attributes':_0x241c7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x613e('0xc')](function(_0x22e26c){logger['info'](_0x613e('0x22'),_0x77be25);logger[_0x613e('0xe')]('GetSalesforceAccount',_0x77be25,JSON['stringify'](_0x22e26c));_0xd03746(_0x22e26c);})[_0x613e('0x17')](function(_0x48d81b){logger[_0x613e('0x11')](_0x613e('0x22'),_0x48d81b[_0x613e('0x14')],_0x77be25);_0x2dff7d(_0x3946ee[_0x613e('0x11')](0x1f4,_0x48d81b[_0x613e('0x14')]));});});};exports[_0x613e('0x23')]=function(_0x1f05bf){var _0x21cbb6=this;return new Promise(function(_0x410518,_0x537382){return db[_0x613e('0x18')][_0x613e('0x24')]({'raw':_0x1f05bf[_0x613e('0x1a')]?_0x1f05bf[_0x613e('0x1a')][_0x613e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f05bf[_0x613e('0x1a')]?_0x1f05bf[_0x613e('0x1a')]['where']||null:null,'attributes':_0x1f05bf[_0x613e('0x1a')]?_0x1f05bf[_0x613e('0x1a')][_0x613e('0x20')]||null:null,'include':_0x1f05bf[_0x613e('0x1a')]?_0x1f05bf[_0x613e('0x1a')][_0x613e('0x1e')]?_[_0x613e('0x1f')](_0x1f05bf[_0x613e('0x1a')][_0x613e('0x1e')],function(_0x430f38){return{'model':db[_0x430f38[_0x613e('0x21')]],'as':_0x430f38['as'],'attributes':_0x430f38['attributes'],'include':_0x430f38['include']?_[_0x613e('0x1f')](_0x430f38[_0x613e('0x1e')],function(_0x5c7251){return{'model':db[_0x5c7251[_0x613e('0x21')]],'as':_0x5c7251['as'],'attributes':_0x5c7251[_0x613e('0x20')],'include':_0x5c7251[_0x613e('0x1e')]?_[_0x613e('0x1f')](_0x5c7251['include'],function(_0x1c05c3){return{'model':db[_0x1c05c3[_0x613e('0x21')]],'as':_0x1c05c3['as'],'attributes':_0x1c05c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x613e('0xc')](function(_0x48444c){logger['info'](_0x613e('0x23'),_0x1f05bf);logger[_0x613e('0xe')](_0x613e('0x23'),_0x1f05bf,JSON[_0x613e('0x10')](_0x48444c));_0x410518(_0x48444c);})[_0x613e('0x17')](function(_0x2c625d){logger[_0x613e('0x11')](_0x613e('0x23'),_0x2c625d[_0x613e('0x14')],_0x1f05bf);_0x537382(_0x21cbb6[_0x613e('0x11')](0x1f4,_0x2c625d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2b90d46..1c6af65 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2dcc75,_0xcb07c9){var _0x176d20=function(_0x1136e0){while(--_0x1136e0){_0x2dcc75['push'](_0x2dcc75['shift']());}};_0x176d20(++_0xcb07c9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x5ae869,_0x3872b3){var _0xf9d957=function(_0x24e31a){while(--_0x24e31a){_0x5ae869['push'](_0x5ae869['shift']());}};_0xf9d957(++_0x3872b3);}(_0x2ef3,0xba));var _0x32ef=function(_0x635f76,_0x468cdf){_0x635f76=_0x635f76-0x0;var _0x303d69=_0x2ef3[_0x635f76];return _0x303d69;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8a653a4..b9e8b7d 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 _0xada2=['contact','lead','account_contact_lead','nothing','sequelize','STRING','ENUM','Task','Case','contact_lead'];(function(_0x547bb6,_0x2d6f27){var _0x1a9154=function(_0x18080f){while(--_0x18080f){_0x547bb6['push'](_0x547bb6['shift']());}};_0x1a9154(++_0x2d6f27);}(_0xada2,0xc2));var _0x2ada=function(_0x96c988,_0x6e060b){_0x96c988=_0x96c988-0x0;var _0x3f64d5=_0xada2[_0x96c988];return _0x3f64d5;};'use strict';var Sequelize=require(_0x2ada('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ada('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2ada('0x2')](_0x2ada('0x3'),_0x2ada('0x4')),'defaultValue':_0x2ada('0x3')},'moduleSearch':{'type':Sequelize[_0x2ada('0x2')](_0x2ada('0x5'),_0x2ada('0x6'),_0x2ada('0x7'),_0x2ada('0x8'),'account'),'defaultValue':_0x2ada('0x5')},'moduleCreate':{'type':Sequelize[_0x2ada('0x2')](_0x2ada('0x9'),_0x2ada('0x6'),_0x2ada('0x7'),'account'),'defaultValue':_0x2ada('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x2ada('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x2ada('0x1')]}}; \ No newline at end of file +var _0x854d=['contact_lead','nothing','sequelize','exports','STRING','ENUM','Case','Task','contact','lead','account_contact_lead','account'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x854d,0x13a));var _0xd854=function(_0x2f2693,_0x115f40){_0x2f2693=_0x2f2693-0x0;var _0x379d90=_0x854d[_0x2f2693];return _0x379d90;};'use strict';var Sequelize=require(_0xd854('0x0'));module[_0xd854('0x1')]={'name':{'type':Sequelize[_0xd854('0x2')]},'description':{'type':Sequelize[_0xd854('0x2')]},'ticketType':{'type':Sequelize[_0xd854('0x3')]('Task',_0xd854('0x4')),'defaultValue':_0xd854('0x5')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xd854('0x6'),_0xd854('0x7'),_0xd854('0x8'),_0xd854('0x9')),'defaultValue':_0xd854('0xa')},'moduleCreate':{'type':Sequelize['ENUM'](_0xd854('0xb'),_0xd854('0x6'),_0xd854('0x7'),'account'),'defaultValue':_0xd854('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xd854('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xd854('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 69011e6..a7f4dcf 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 _0x8767=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getFields','findOne','SalesforceField','order','merge','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xf9457f,_0x31b9b2){var _0x1e2929=function(_0x1e381b){while(--_0x1e381b){_0xf9457f['push'](_0xf9457f['shift']());}};_0x1e2929(++_0x31b9b2);}(_0x8767,0x134));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7876('0x0'));var zipdir=require(_0x7876('0x1'));var jsonpatch=require(_0x7876('0x2'));var rp=require(_0x7876('0x3'));var moment=require(_0x7876('0x4'));var BPromise=require(_0x7876('0x5'));var Mustache=require(_0x7876('0x6'));var util=require(_0x7876('0x7'));var path=require(_0x7876('0x8'));var sox=require(_0x7876('0x9'));var csv=require('to-csv');var ejs=require(_0x7876('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7876('0xb'));var crypto=require(_0x7876('0xc'));var jsforce=require(_0x7876('0xd'));var deskjs=require(_0x7876('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7876('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7876('0x10'));var qs=require(_0x7876('0x11'));var as=require(_0x7876('0x12'));var hardwareService=require(_0x7876('0x13'));var logger=require(_0x7876('0x14'))('api');var utils=require(_0x7876('0x15'));var config=require(_0x7876('0x16'));var licenseUtil=require(_0x7876('0x17'));var db=require(_0x7876('0x18'))['db'];function respondWithStatusCode(_0x86d11d,_0xac5e0c){_0xac5e0c=_0xac5e0c||0xcc;return function(_0xe2748a){if(_0xe2748a){return _0x86d11d[_0x7876('0x19')](_0xac5e0c);}return _0x86d11d[_0x7876('0x1a')](_0xac5e0c)[_0x7876('0x1b')]();};}function respondWithResult(_0xdf050a,_0x3fdb02){_0x3fdb02=_0x3fdb02||0xc8;return function(_0x56a96a){if(_0x56a96a){return _0xdf050a[_0x7876('0x1a')](_0x3fdb02)[_0x7876('0x1c')](_0x56a96a);}};}function respondWithFilteredResult(_0x5382a1,_0x2e5fad){return function(_0x490c3f){if(_0x490c3f){var _0x3bc7cf=typeof _0x2e5fad[_0x7876('0x1d')]===_0x7876('0x1e')&&typeof _0x2e5fad['limit']===_0x7876('0x1e');var _0x52df5b=_0x490c3f[_0x7876('0x1f')];var _0x18a301=_0x3bc7cf?0x0:_0x2e5fad['offset'];var _0xaf8a14=_0x3bc7cf?_0x490c3f[_0x7876('0x1f')]:_0x2e5fad[_0x7876('0x1d')]+_0x2e5fad[_0x7876('0x20')];var _0x4b18c6;if(_0xaf8a14>=_0x52df5b){_0xaf8a14=_0x52df5b;_0x4b18c6=0xc8;}else{_0x4b18c6=0xce;}_0x5382a1['status'](_0x4b18c6);return _0x5382a1[_0x7876('0x21')]('Content-Range',_0x18a301+'-'+_0xaf8a14+'/'+_0x52df5b)[_0x7876('0x1c')](_0x490c3f);}return null;};}function patchUpdates(_0x4ed5b2){return function(_0xc92ead){try{jsonpatch[_0x7876('0x22')](_0xc92ead,_0x4ed5b2,!![]);}catch(_0x1a1009){return BPromise['reject'](_0x1a1009);}return _0xc92ead[_0x7876('0x23')]();};}function saveUpdates(_0x2a23b9,_0x1a11e2){return function(_0x48068f){if(_0x48068f){return _0x48068f[_0x7876('0x24')](_0x2a23b9)['then'](function(_0x9b11ab){return _0x9b11ab;});}return null;};}function removeEntity(_0x2bf263,_0x140f5e){return function(_0x32c894){if(_0x32c894){return _0x32c894[_0x7876('0x25')]()[_0x7876('0x26')](function(){_0x2bf263[_0x7876('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30bfed,_0x7ae8dc){return function(_0xec0f4a){if(!_0xec0f4a){_0x30bfed[_0x7876('0x19')](0x194);}return _0xec0f4a;};}function handleError(_0x33ab68,_0x55aaa4){_0x55aaa4=_0x55aaa4||0x1f4;return function(_0x35ce2b){logger[_0x7876('0x27')](_0x35ce2b[_0x7876('0x28')]);if(_0x35ce2b[_0x7876('0x29')]){delete _0x35ce2b[_0x7876('0x29')];}_0x33ab68[_0x7876('0x1a')](_0x55aaa4)[_0x7876('0x2a')](_0x35ce2b);};}exports[_0x7876('0x2b')]=function(_0x2de4ad,_0x2709c6){var _0x3bf58b={},_0x346799={},_0x145566={'count':0x0,'rows':[]};var _0x1e43cc=_[_0x7876('0x2c')](db[_0x7876('0x2d')][_0x7876('0x2e')],function(_0x2bae0f){return{'name':_0x2bae0f[_0x7876('0x2f')],'type':_0x2bae0f[_0x7876('0x30')]['key']};});_0x346799[_0x7876('0x31')]=_[_0x7876('0x2c')](_0x1e43cc,_0x7876('0x29'));_0x346799[_0x7876('0x32')]=_['keys'](_0x2de4ad[_0x7876('0x32')]);_0x346799[_0x7876('0x33')]=_[_0x7876('0x34')](_0x346799[_0x7876('0x31')],_0x346799[_0x7876('0x32')]);_0x3bf58b['attributes']=_[_0x7876('0x34')](_0x346799[_0x7876('0x31')],qs[_0x7876('0x35')](_0x2de4ad[_0x7876('0x32')][_0x7876('0x35')]));_0x3bf58b[_0x7876('0x36')]=_0x3bf58b[_0x7876('0x36')]['length']?_0x3bf58b[_0x7876('0x36')]:_0x346799[_0x7876('0x31')];if(!_0x2de4ad['query'][_0x7876('0x37')](_0x7876('0x38'))){_0x3bf58b['limit']=qs[_0x7876('0x20')](_0x2de4ad[_0x7876('0x32')][_0x7876('0x20')]);_0x3bf58b[_0x7876('0x1d')]=qs[_0x7876('0x1d')](_0x2de4ad[_0x7876('0x32')]['offset']);}_0x3bf58b['order']=qs[_0x7876('0x39')](_0x2de4ad[_0x7876('0x32')][_0x7876('0x39')]);_0x3bf58b[_0x7876('0x3a')]=qs[_0x7876('0x33')](_[_0x7876('0x3b')](_0x2de4ad[_0x7876('0x32')],_0x346799[_0x7876('0x33')]),_0x1e43cc);if(_0x2de4ad[_0x7876('0x32')]['filter']){_0x3bf58b[_0x7876('0x3a')]=_['merge'](_0x3bf58b[_0x7876('0x3a')],{'$or':_[_0x7876('0x2c')](_0x1e43cc,function(_0x359ff1){if(_0x359ff1[_0x7876('0x30')]!==_0x7876('0x3c')){var _0x388af9={};_0x388af9[_0x359ff1[_0x7876('0x29')]]={'$like':'%'+_0x2de4ad['query'][_0x7876('0x3d')]+'%'};return _0x388af9;}})});}_0x3bf58b=_['merge']({},_0x3bf58b,_0x2de4ad[_0x7876('0x3e')]);var _0x1f377e={'where':_0x3bf58b[_0x7876('0x3a')]};return db[_0x7876('0x2d')][_0x7876('0x1f')](_0x1f377e)[_0x7876('0x26')](function(_0x1bdbbe){_0x145566[_0x7876('0x1f')]=_0x1bdbbe;if(_0x2de4ad[_0x7876('0x32')][_0x7876('0x3f')]){_0x3bf58b['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x7876('0x40')](_0x3bf58b);})[_0x7876('0x26')](function(_0x5c47ba){_0x145566[_0x7876('0x41')]=_0x5c47ba;return _0x145566;})[_0x7876('0x26')](respondWithFilteredResult(_0x2709c6,_0x3bf58b))[_0x7876('0x42')](handleError(_0x2709c6,null));};exports[_0x7876('0x43')]=function(_0x21151d,_0x432c45){var _0x214c18={'raw':![],'where':{'id':_0x21151d[_0x7876('0x44')]['id']}},_0x4ebd00={};_0x4ebd00[_0x7876('0x31')]=_[_0x7876('0x45')](db['SalesforceConfiguration'][_0x7876('0x2e')]);_0x4ebd00[_0x7876('0x32')]=_[_0x7876('0x45')](_0x21151d[_0x7876('0x32')]);_0x4ebd00[_0x7876('0x33')]=_[_0x7876('0x34')](_0x4ebd00[_0x7876('0x31')],_0x4ebd00[_0x7876('0x32')]);_0x214c18[_0x7876('0x36')]=_[_0x7876('0x34')](_0x4ebd00[_0x7876('0x31')],qs[_0x7876('0x35')](_0x21151d['query']['fields']));_0x214c18[_0x7876('0x36')]=_0x214c18[_0x7876('0x36')][_0x7876('0x46')]?_0x214c18[_0x7876('0x36')]:_0x4ebd00[_0x7876('0x31')];if(_0x21151d['query'][_0x7876('0x3f')]){_0x214c18[_0x7876('0x47')]=[{'all':!![]}];}_0x214c18=_['merge']({},_0x214c18,_0x21151d[_0x7876('0x3e')]);return db['SalesforceConfiguration'][_0x7876('0x48')](_0x214c18)[_0x7876('0x26')](handleEntityNotFound(_0x432c45,null))[_0x7876('0x26')](respondWithResult(_0x432c45,null))[_0x7876('0x42')](handleError(_0x432c45,null));};exports['create']=function(_0x1b67ef,_0xa104a0){return db[_0x7876('0x2d')][_0x7876('0x49')](_0x1b67ef[_0x7876('0x4a')],{})[_0x7876('0x26')](respondWithResult(_0xa104a0,0xc9))[_0x7876('0x42')](handleError(_0xa104a0,null));};exports[_0x7876('0x24')]=function(_0x1d177b,_0x420300){if(_0x1d177b[_0x7876('0x4a')]['id']){delete _0x1d177b['body']['id'];}return db[_0x7876('0x2d')][_0x7876('0x48')]({'where':{'id':_0x1d177b['params']['id']}})[_0x7876('0x26')](handleEntityNotFound(_0x420300,null))[_0x7876('0x26')](saveUpdates(_0x1d177b[_0x7876('0x4a')],null))['then'](respondWithResult(_0x420300,null))[_0x7876('0x42')](handleError(_0x420300,null));};exports[_0x7876('0x25')]=function(_0x15d189,_0x14e07e){return db['SalesforceConfiguration'][_0x7876('0x48')]({'where':{'id':_0x15d189[_0x7876('0x44')]['id']}})[_0x7876('0x26')](handleEntityNotFound(_0x14e07e,null))[_0x7876('0x26')](removeEntity(_0x14e07e,null))['catch'](handleError(_0x14e07e,null));};exports[_0x7876('0x4b')]=function(_0x43a6eb,_0xfd322f,_0x5bd14a){var _0x5902c8={};var _0xf152c4={};var _0x2782c1;var _0x3c32a4;return db['SalesforceConfiguration'][_0x7876('0x4c')]({'where':{'id':_0x43a6eb['params']['id']}})[_0x7876('0x26')](handleEntityNotFound(_0xfd322f,null))[_0x7876('0x26')](function(_0x1af8c1){if(_0x1af8c1){_0x2782c1=_0x1af8c1;_0xf152c4['model']=_[_0x7876('0x45')](db[_0x7876('0x4d')]['rawAttributes']);_0xf152c4[_0x7876('0x32')]=_[_0x7876('0x45')](_0x43a6eb[_0x7876('0x32')]);_0xf152c4[_0x7876('0x33')]=_[_0x7876('0x34')](_0xf152c4[_0x7876('0x31')],_0xf152c4[_0x7876('0x32')]);_0x5902c8[_0x7876('0x36')]=_['intersection'](_0xf152c4[_0x7876('0x31')],qs[_0x7876('0x35')](_0x43a6eb[_0x7876('0x32')]['fields']));_0x5902c8['attributes']=_0x5902c8[_0x7876('0x36')][_0x7876('0x46')]?_0x5902c8[_0x7876('0x36')]:_0xf152c4[_0x7876('0x31')];_0x5902c8[_0x7876('0x4e')]=qs[_0x7876('0x39')](_0x43a6eb[_0x7876('0x32')]['sort']);_0x5902c8['where']=qs[_0x7876('0x33')](_['pick'](_0x43a6eb[_0x7876('0x32')],_0xf152c4[_0x7876('0x33')]));if(_0x43a6eb['query']['filter']){_0x5902c8[_0x7876('0x3a')]=_[_0x7876('0x4f')](_0x5902c8[_0x7876('0x3a')],{'$or':_['map'](_0x5902c8['attributes'],function(_0x1728f8){var _0x2b632a={};_0x2b632a[_0x1728f8]={'$like':'%'+_0x43a6eb[_0x7876('0x32')]['filter']+'%'};return _0x2b632a;})});}_0x5902c8=_[_0x7876('0x4f')]({},_0x5902c8,_0x43a6eb[_0x7876('0x3e')]);return _0x2782c1[_0x7876('0x4b')](_0x5902c8);}})['then'](function(_0x1f35cb){if(_0x1f35cb){_0x3c32a4=_0x1f35cb['length'];if(!_0x43a6eb[_0x7876('0x32')]['hasOwnProperty']('nolimit')){_0x5902c8['limit']=qs['limit'](_0x43a6eb[_0x7876('0x32')][_0x7876('0x20')]);_0x5902c8['offset']=qs['offset'](_0x43a6eb['query'][_0x7876('0x1d')]);}return _0x2782c1[_0x7876('0x4b')](_0x5902c8);}})[_0x7876('0x26')](function(_0x228117){if(_0x228117){return _0x228117?{'count':_0x3c32a4,'rows':_0x228117}:null;}})['then'](respondWithResult(_0xfd322f,null))[_0x7876('0x42')](handleError(_0xfd322f,null));};exports[_0x7876('0x50')]=function(_0x416fb5,_0x3b93d8,_0x3151d9){var _0x3c3c9b={};var _0x561753={};var _0x61df0;var _0xa944be;return db['SalesforceConfiguration'][_0x7876('0x4c')]({'where':{'id':_0x416fb5[_0x7876('0x44')]['id']}})[_0x7876('0x26')](handleEntityNotFound(_0x3b93d8,null))['then'](function(_0x2760f2){if(_0x2760f2){_0x61df0=_0x2760f2;_0x561753[_0x7876('0x31')]=_[_0x7876('0x45')](db['SalesforceField'][_0x7876('0x2e')]);_0x561753[_0x7876('0x32')]=_[_0x7876('0x45')](_0x416fb5[_0x7876('0x32')]);_0x561753['filters']=_[_0x7876('0x34')](_0x561753[_0x7876('0x31')],_0x561753[_0x7876('0x32')]);_0x3c3c9b['attributes']=_['intersection'](_0x561753[_0x7876('0x31')],qs[_0x7876('0x35')](_0x416fb5[_0x7876('0x32')][_0x7876('0x35')]));_0x3c3c9b['attributes']=_0x3c3c9b['attributes'][_0x7876('0x46')]?_0x3c3c9b[_0x7876('0x36')]:_0x561753[_0x7876('0x31')];_0x3c3c9b[_0x7876('0x4e')]=qs[_0x7876('0x39')](_0x416fb5[_0x7876('0x32')][_0x7876('0x39')]);_0x3c3c9b[_0x7876('0x3a')]=qs[_0x7876('0x33')](_[_0x7876('0x3b')](_0x416fb5[_0x7876('0x32')],_0x561753[_0x7876('0x33')]));if(_0x416fb5[_0x7876('0x32')][_0x7876('0x3d')]){_0x3c3c9b[_0x7876('0x3a')]=_[_0x7876('0x4f')](_0x3c3c9b['where'],{'$or':_['map'](_0x3c3c9b[_0x7876('0x36')],function(_0x2860cb){var _0x3ee49a={};_0x3ee49a[_0x2860cb]={'$like':'%'+_0x416fb5[_0x7876('0x32')][_0x7876('0x3d')]+'%'};return _0x3ee49a;})});}_0x3c3c9b=_['merge']({},_0x3c3c9b,_0x416fb5[_0x7876('0x3e')]);return _0x61df0[_0x7876('0x50')](_0x3c3c9b);}})[_0x7876('0x26')](function(_0x228fca){if(_0x228fca){_0xa944be=_0x228fca[_0x7876('0x46')];if(!_0x416fb5[_0x7876('0x32')][_0x7876('0x37')](_0x7876('0x38'))){_0x3c3c9b[_0x7876('0x20')]=qs['limit'](_0x416fb5['query'][_0x7876('0x20')]);_0x3c3c9b[_0x7876('0x1d')]=qs[_0x7876('0x1d')](_0x416fb5[_0x7876('0x32')][_0x7876('0x1d')]);}return _0x61df0[_0x7876('0x50')](_0x3c3c9b);}})[_0x7876('0x26')](function(_0x4c7016){if(_0x4c7016){return _0x4c7016?{'count':_0xa944be,'rows':_0x4c7016}:null;}})[_0x7876('0x26')](respondWithResult(_0x3b93d8,null))[_0x7876('0x42')](handleError(_0x3b93d8,null));};exports[_0x7876('0x51')]=function(_0x23e189,_0x3cd674,_0xca0faa){var _0x344f0c={};var _0x400a43={};var _0x3d14a7;var _0x1eff27;return db[_0x7876('0x2d')][_0x7876('0x4c')]({'where':{'id':_0x23e189[_0x7876('0x44')]['id']}})['then'](handleEntityNotFound(_0x3cd674,null))[_0x7876('0x26')](function(_0x3da36d){if(_0x3da36d){_0x3d14a7=_0x3da36d;_0x400a43[_0x7876('0x31')]=_[_0x7876('0x45')](db[_0x7876('0x4d')][_0x7876('0x2e')]);_0x400a43['query']=_[_0x7876('0x45')](_0x23e189[_0x7876('0x32')]);_0x400a43[_0x7876('0x33')]=_[_0x7876('0x34')](_0x400a43[_0x7876('0x31')],_0x400a43['query']);_0x344f0c[_0x7876('0x36')]=_[_0x7876('0x34')](_0x400a43[_0x7876('0x31')],qs[_0x7876('0x35')](_0x23e189[_0x7876('0x32')][_0x7876('0x35')]));_0x344f0c[_0x7876('0x36')]=_0x344f0c[_0x7876('0x36')][_0x7876('0x46')]?_0x344f0c[_0x7876('0x36')]:_0x400a43[_0x7876('0x31')];_0x344f0c[_0x7876('0x4e')]=qs[_0x7876('0x39')](_0x23e189[_0x7876('0x32')]['sort']);_0x344f0c[_0x7876('0x3a')]=qs[_0x7876('0x33')](_[_0x7876('0x3b')](_0x23e189[_0x7876('0x32')],_0x400a43[_0x7876('0x33')]));if(_0x23e189['query']['filter']){_0x344f0c['where']=_[_0x7876('0x4f')](_0x344f0c[_0x7876('0x3a')],{'$or':_[_0x7876('0x2c')](_0x344f0c[_0x7876('0x36')],function(_0x5c39ee){var _0x5edc66={};_0x5edc66[_0x5c39ee]={'$like':'%'+_0x23e189[_0x7876('0x32')]['filter']+'%'};return _0x5edc66;})});}_0x344f0c=_[_0x7876('0x4f')]({},_0x344f0c,_0x23e189[_0x7876('0x3e')]);return _0x3d14a7[_0x7876('0x51')](_0x344f0c);}})[_0x7876('0x26')](function(_0x24876a){if(_0x24876a){_0x1eff27=_0x24876a[_0x7876('0x46')];if(!_0x23e189['query']['hasOwnProperty']('nolimit')){_0x344f0c['limit']=qs[_0x7876('0x20')](_0x23e189[_0x7876('0x32')]['limit']);_0x344f0c[_0x7876('0x1d')]=qs['offset'](_0x23e189['query'][_0x7876('0x1d')]);}return _0x3d14a7[_0x7876('0x51')](_0x344f0c);}})[_0x7876('0x26')](function(_0xf683ac){if(_0xf683ac){return _0xf683ac?{'count':_0x1eff27,'rows':_0xf683ac}:null;}})[_0x7876('0x26')](respondWithResult(_0x3cd674,null))[_0x7876('0x42')](handleError(_0x3cd674,null));}; \ No newline at end of file +var _0x83b1=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceConfiguration','include','rows','catch','show','params','intersection','includeAll','options','create','body','find','getFields','findOne','SalesforceField','nolimit','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x83b1,0x128));var _0x183b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x83b1[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x183b('0x0'));var rimraf=require(_0x183b('0x1'));var zipdir=require(_0x183b('0x2'));var jsonpatch=require(_0x183b('0x3'));var rp=require(_0x183b('0x4'));var moment=require(_0x183b('0x5'));var BPromise=require(_0x183b('0x6'));var Mustache=require(_0x183b('0x7'));var util=require(_0x183b('0x8'));var path=require(_0x183b('0x9'));var sox=require('sox');var csv=require(_0x183b('0xa'));var ejs=require(_0x183b('0xb'));var fs=require('fs');var fs_extra=require(_0x183b('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x183b('0xd'));var deskjs=require(_0x183b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x183b('0xf'));var Papa=require(_0x183b('0x10'));var Redis=require('ioredis');var authService=require(_0x183b('0x11'));var qs=require(_0x183b('0x12'));var as=require(_0x183b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x183b('0x14'))('api');var utils=require(_0x183b('0x15'));var config=require(_0x183b('0x16'));var licenseUtil=require(_0x183b('0x17'));var db=require(_0x183b('0x18'))['db'];function respondWithStatusCode(_0x32e32c,_0x22d011){_0x22d011=_0x22d011||0xcc;return function(_0x1585ee){if(_0x1585ee){return _0x32e32c[_0x183b('0x19')](_0x22d011);}return _0x32e32c['status'](_0x22d011)[_0x183b('0x1a')]();};}function respondWithResult(_0x1ba54c,_0x10ab2c){_0x10ab2c=_0x10ab2c||0xc8;return function(_0x4b10bd){if(_0x4b10bd){return _0x1ba54c[_0x183b('0x1b')](_0x10ab2c)[_0x183b('0x1c')](_0x4b10bd);}};}function respondWithFilteredResult(_0x51a76d,_0x5f15da){return function(_0x2198ca){if(_0x2198ca){var _0x40216e=typeof _0x5f15da[_0x183b('0x1d')]===_0x183b('0x1e')&&typeof _0x5f15da[_0x183b('0x1f')]==='undefined';var _0x1dc872=_0x2198ca[_0x183b('0x20')];var _0x4c7c6f=_0x40216e?0x0:_0x5f15da[_0x183b('0x1d')];var _0x3ace95=_0x40216e?_0x2198ca[_0x183b('0x20')]:_0x5f15da[_0x183b('0x1d')]+_0x5f15da[_0x183b('0x1f')];var _0x436e18;if(_0x3ace95>=_0x1dc872){_0x3ace95=_0x1dc872;_0x436e18=0xc8;}else{_0x436e18=0xce;}_0x51a76d[_0x183b('0x1b')](_0x436e18);return _0x51a76d['set'](_0x183b('0x21'),_0x4c7c6f+'-'+_0x3ace95+'/'+_0x1dc872)[_0x183b('0x1c')](_0x2198ca);}return null;};}function patchUpdates(_0x47c729){return function(_0x37c251){try{jsonpatch[_0x183b('0x22')](_0x37c251,_0x47c729,!![]);}catch(_0x4263a0){return BPromise['reject'](_0x4263a0);}return _0x37c251[_0x183b('0x23')]();};}function saveUpdates(_0x1614b8,_0x2a3968){return function(_0x5c6d2e){if(_0x5c6d2e){return _0x5c6d2e['update'](_0x1614b8)[_0x183b('0x24')](function(_0x25faf8){return _0x25faf8;});}return null;};}function removeEntity(_0x9acab1,_0x2373ab){return function(_0x165eea){if(_0x165eea){return _0x165eea[_0x183b('0x25')]()[_0x183b('0x24')](function(){_0x9acab1[_0x183b('0x1b')](0xcc)[_0x183b('0x1a')]();});}};}function handleEntityNotFound(_0x177e01,_0x1042de){return function(_0xd8e699){if(!_0xd8e699){_0x177e01['sendStatus'](0x194);}return _0xd8e699;};}function handleError(_0x22f9e1,_0x402b73){_0x402b73=_0x402b73||0x1f4;return function(_0x3f8bd7){logger['error'](_0x3f8bd7[_0x183b('0x26')]);if(_0x3f8bd7[_0x183b('0x27')]){delete _0x3f8bd7[_0x183b('0x27')];}_0x22f9e1[_0x183b('0x1b')](_0x402b73)[_0x183b('0x28')](_0x3f8bd7);};}exports[_0x183b('0x29')]=function(_0x3fdb2f,_0x5b0776){var _0x33da4f={},_0x24cdff={},_0x56e9a4={'count':0x0,'rows':[]};var _0x5abc17=_['map'](db['SalesforceConfiguration'][_0x183b('0x2a')],function(_0x53e9e8){return{'name':_0x53e9e8[_0x183b('0x2b')],'type':_0x53e9e8[_0x183b('0x2c')][_0x183b('0x2d')]};});_0x24cdff[_0x183b('0x2e')]=_[_0x183b('0x2f')](_0x5abc17,_0x183b('0x27'));_0x24cdff[_0x183b('0x30')]=_[_0x183b('0x31')](_0x3fdb2f['query']);_0x24cdff[_0x183b('0x32')]=_['intersection'](_0x24cdff[_0x183b('0x2e')],_0x24cdff[_0x183b('0x30')]);_0x33da4f['attributes']=_['intersection'](_0x24cdff[_0x183b('0x2e')],qs[_0x183b('0x33')](_0x3fdb2f[_0x183b('0x30')][_0x183b('0x33')]));_0x33da4f[_0x183b('0x34')]=_0x33da4f['attributes'][_0x183b('0x35')]?_0x33da4f[_0x183b('0x34')]:_0x24cdff['model'];if(!_0x3fdb2f['query'][_0x183b('0x36')]('nolimit')){_0x33da4f['limit']=qs[_0x183b('0x1f')](_0x3fdb2f[_0x183b('0x30')]['limit']);_0x33da4f[_0x183b('0x1d')]=qs[_0x183b('0x1d')](_0x3fdb2f[_0x183b('0x30')]['offset']);}_0x33da4f[_0x183b('0x37')]=qs['sort'](_0x3fdb2f['query'][_0x183b('0x38')]);_0x33da4f[_0x183b('0x39')]=qs[_0x183b('0x32')](_[_0x183b('0x3a')](_0x3fdb2f[_0x183b('0x30')],_0x24cdff[_0x183b('0x32')]),_0x5abc17);if(_0x3fdb2f[_0x183b('0x30')][_0x183b('0x3b')]){_0x33da4f[_0x183b('0x39')]=_[_0x183b('0x3c')](_0x33da4f[_0x183b('0x39')],{'$or':_[_0x183b('0x2f')](_0x5abc17,function(_0xdaa087){if(_0xdaa087[_0x183b('0x2c')]!==_0x183b('0x3d')){var _0x363d79={};_0x363d79[_0xdaa087[_0x183b('0x27')]]={'$like':'%'+_0x3fdb2f[_0x183b('0x30')][_0x183b('0x3b')]+'%'};return _0x363d79;}})});}_0x33da4f=_[_0x183b('0x3c')]({},_0x33da4f,_0x3fdb2f['options']);var _0x25ae2a={'where':_0x33da4f[_0x183b('0x39')]};return db[_0x183b('0x3e')][_0x183b('0x20')](_0x25ae2a)[_0x183b('0x24')](function(_0x2d0f68){_0x56e9a4['count']=_0x2d0f68;if(_0x3fdb2f['query']['includeAll']){_0x33da4f[_0x183b('0x3f')]=[{'all':!![]}];}return db[_0x183b('0x3e')]['findAll'](_0x33da4f);})[_0x183b('0x24')](function(_0x37fac8){_0x56e9a4[_0x183b('0x40')]=_0x37fac8;return _0x56e9a4;})[_0x183b('0x24')](respondWithFilteredResult(_0x5b0776,_0x33da4f))[_0x183b('0x41')](handleError(_0x5b0776,null));};exports[_0x183b('0x42')]=function(_0x9dd656,_0x15118c){var _0xfcf83d={'raw':![],'where':{'id':_0x9dd656[_0x183b('0x43')]['id']}},_0x4358c1={};_0x4358c1[_0x183b('0x2e')]=_[_0x183b('0x31')](db[_0x183b('0x3e')][_0x183b('0x2a')]);_0x4358c1[_0x183b('0x30')]=_[_0x183b('0x31')](_0x9dd656[_0x183b('0x30')]);_0x4358c1[_0x183b('0x32')]=_[_0x183b('0x44')](_0x4358c1[_0x183b('0x2e')],_0x4358c1[_0x183b('0x30')]);_0xfcf83d[_0x183b('0x34')]=_[_0x183b('0x44')](_0x4358c1[_0x183b('0x2e')],qs[_0x183b('0x33')](_0x9dd656[_0x183b('0x30')]['fields']));_0xfcf83d[_0x183b('0x34')]=_0xfcf83d[_0x183b('0x34')][_0x183b('0x35')]?_0xfcf83d['attributes']:_0x4358c1[_0x183b('0x2e')];if(_0x9dd656[_0x183b('0x30')][_0x183b('0x45')]){_0xfcf83d[_0x183b('0x3f')]=[{'all':!![]}];}_0xfcf83d=_[_0x183b('0x3c')]({},_0xfcf83d,_0x9dd656[_0x183b('0x46')]);return db[_0x183b('0x3e')]['find'](_0xfcf83d)[_0x183b('0x24')](handleEntityNotFound(_0x15118c,null))[_0x183b('0x24')](respondWithResult(_0x15118c,null))['catch'](handleError(_0x15118c,null));};exports[_0x183b('0x47')]=function(_0xcbd5bb,_0x2f5037){return db[_0x183b('0x3e')][_0x183b('0x47')](_0xcbd5bb[_0x183b('0x48')],{})[_0x183b('0x24')](respondWithResult(_0x2f5037,0xc9))[_0x183b('0x41')](handleError(_0x2f5037,null));};exports['update']=function(_0x4ce103,_0x139fd7){if(_0x4ce103[_0x183b('0x48')]['id']){delete _0x4ce103[_0x183b('0x48')]['id'];}return db[_0x183b('0x3e')][_0x183b('0x49')]({'where':{'id':_0x4ce103[_0x183b('0x43')]['id']}})[_0x183b('0x24')](handleEntityNotFound(_0x139fd7,null))['then'](saveUpdates(_0x4ce103[_0x183b('0x48')],null))[_0x183b('0x24')](respondWithResult(_0x139fd7,null))[_0x183b('0x41')](handleError(_0x139fd7,null));};exports[_0x183b('0x25')]=function(_0x2a4406,_0x24e505){return db[_0x183b('0x3e')][_0x183b('0x49')]({'where':{'id':_0x2a4406[_0x183b('0x43')]['id']}})[_0x183b('0x24')](handleEntityNotFound(_0x24e505,null))[_0x183b('0x24')](removeEntity(_0x24e505,null))['catch'](handleError(_0x24e505,null));};exports[_0x183b('0x4a')]=function(_0x2f2afb,_0x9c1fc1,_0x92073a){var _0x173455={};var _0x2ab18e={};var _0x3575a1;var _0x1097b7;return db['SalesforceConfiguration'][_0x183b('0x4b')]({'where':{'id':_0x2f2afb[_0x183b('0x43')]['id']}})[_0x183b('0x24')](handleEntityNotFound(_0x9c1fc1,null))[_0x183b('0x24')](function(_0x55694d){if(_0x55694d){_0x3575a1=_0x55694d;_0x2ab18e['model']=_[_0x183b('0x31')](db[_0x183b('0x4c')]['rawAttributes']);_0x2ab18e[_0x183b('0x30')]=_[_0x183b('0x31')](_0x2f2afb['query']);_0x2ab18e[_0x183b('0x32')]=_['intersection'](_0x2ab18e['model'],_0x2ab18e['query']);_0x173455[_0x183b('0x34')]=_[_0x183b('0x44')](_0x2ab18e[_0x183b('0x2e')],qs['fields'](_0x2f2afb['query'][_0x183b('0x33')]));_0x173455['attributes']=_0x173455[_0x183b('0x34')][_0x183b('0x35')]?_0x173455['attributes']:_0x2ab18e[_0x183b('0x2e')];_0x173455[_0x183b('0x37')]=qs[_0x183b('0x38')](_0x2f2afb['query']['sort']);_0x173455[_0x183b('0x39')]=qs[_0x183b('0x32')](_[_0x183b('0x3a')](_0x2f2afb[_0x183b('0x30')],_0x2ab18e[_0x183b('0x32')]));if(_0x2f2afb['query'][_0x183b('0x3b')]){_0x173455['where']=_[_0x183b('0x3c')](_0x173455[_0x183b('0x39')],{'$or':_[_0x183b('0x2f')](_0x173455[_0x183b('0x34')],function(_0x3c1851){var _0x21e097={};_0x21e097[_0x3c1851]={'$like':'%'+_0x2f2afb[_0x183b('0x30')][_0x183b('0x3b')]+'%'};return _0x21e097;})});}_0x173455=_[_0x183b('0x3c')]({},_0x173455,_0x2f2afb['options']);return _0x3575a1[_0x183b('0x4a')](_0x173455);}})[_0x183b('0x24')](function(_0x2139ec){if(_0x2139ec){_0x1097b7=_0x2139ec[_0x183b('0x35')];if(!_0x2f2afb[_0x183b('0x30')][_0x183b('0x36')](_0x183b('0x4d'))){_0x173455[_0x183b('0x1f')]=qs['limit'](_0x2f2afb[_0x183b('0x30')][_0x183b('0x1f')]);_0x173455[_0x183b('0x1d')]=qs[_0x183b('0x1d')](_0x2f2afb['query'][_0x183b('0x1d')]);}return _0x3575a1['getFields'](_0x173455);}})[_0x183b('0x24')](function(_0x223345){if(_0x223345){return _0x223345?{'count':_0x1097b7,'rows':_0x223345}:null;}})[_0x183b('0x24')](respondWithResult(_0x9c1fc1,null))[_0x183b('0x41')](handleError(_0x9c1fc1,null));};exports[_0x183b('0x4e')]=function(_0x50494f,_0x5365f2,_0x24ead4){var _0x39a629={};var _0x9d4d08={};var _0x28d840;var _0x95fcc7;return db['SalesforceConfiguration'][_0x183b('0x4b')]({'where':{'id':_0x50494f[_0x183b('0x43')]['id']}})[_0x183b('0x24')](handleEntityNotFound(_0x5365f2,null))[_0x183b('0x24')](function(_0x227958){if(_0x227958){_0x28d840=_0x227958;_0x9d4d08[_0x183b('0x2e')]=_[_0x183b('0x31')](db[_0x183b('0x4c')][_0x183b('0x2a')]);_0x9d4d08[_0x183b('0x30')]=_[_0x183b('0x31')](_0x50494f[_0x183b('0x30')]);_0x9d4d08['filters']=_[_0x183b('0x44')](_0x9d4d08[_0x183b('0x2e')],_0x9d4d08[_0x183b('0x30')]);_0x39a629[_0x183b('0x34')]=_['intersection'](_0x9d4d08[_0x183b('0x2e')],qs['fields'](_0x50494f[_0x183b('0x30')][_0x183b('0x33')]));_0x39a629[_0x183b('0x34')]=_0x39a629[_0x183b('0x34')][_0x183b('0x35')]?_0x39a629[_0x183b('0x34')]:_0x9d4d08[_0x183b('0x2e')];_0x39a629[_0x183b('0x37')]=qs['sort'](_0x50494f['query'][_0x183b('0x38')]);_0x39a629[_0x183b('0x39')]=qs[_0x183b('0x32')](_[_0x183b('0x3a')](_0x50494f['query'],_0x9d4d08[_0x183b('0x32')]));if(_0x50494f['query']['filter']){_0x39a629[_0x183b('0x39')]=_[_0x183b('0x3c')](_0x39a629[_0x183b('0x39')],{'$or':_[_0x183b('0x2f')](_0x39a629[_0x183b('0x34')],function(_0x23f33a){var _0x1b0418={};_0x1b0418[_0x23f33a]={'$like':'%'+_0x50494f[_0x183b('0x30')][_0x183b('0x3b')]+'%'};return _0x1b0418;})});}_0x39a629=_['merge']({},_0x39a629,_0x50494f[_0x183b('0x46')]);return _0x28d840[_0x183b('0x4e')](_0x39a629);}})[_0x183b('0x24')](function(_0x11d4aa){if(_0x11d4aa){_0x95fcc7=_0x11d4aa['length'];if(!_0x50494f[_0x183b('0x30')][_0x183b('0x36')](_0x183b('0x4d'))){_0x39a629['limit']=qs[_0x183b('0x1f')](_0x50494f[_0x183b('0x30')]['limit']);_0x39a629[_0x183b('0x1d')]=qs['offset'](_0x50494f[_0x183b('0x30')][_0x183b('0x1d')]);}return _0x28d840['getSubjects'](_0x39a629);}})[_0x183b('0x24')](function(_0x54ec7c){if(_0x54ec7c){return _0x54ec7c?{'count':_0x95fcc7,'rows':_0x54ec7c}:null;}})['then'](respondWithResult(_0x5365f2,null))[_0x183b('0x41')](handleError(_0x5365f2,null));};exports['getDescriptions']=function(_0x363b09,_0x4cbfd0,_0x202cf3){var _0x1c6978={};var _0x5ea245={};var _0x27afbb;var _0xf4518c;return db[_0x183b('0x3e')][_0x183b('0x4b')]({'where':{'id':_0x363b09[_0x183b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4cbfd0,null))[_0x183b('0x24')](function(_0x3159b9){if(_0x3159b9){_0x27afbb=_0x3159b9;_0x5ea245[_0x183b('0x2e')]=_[_0x183b('0x31')](db[_0x183b('0x4c')][_0x183b('0x2a')]);_0x5ea245[_0x183b('0x30')]=_[_0x183b('0x31')](_0x363b09[_0x183b('0x30')]);_0x5ea245[_0x183b('0x32')]=_[_0x183b('0x44')](_0x5ea245[_0x183b('0x2e')],_0x5ea245[_0x183b('0x30')]);_0x1c6978['attributes']=_[_0x183b('0x44')](_0x5ea245[_0x183b('0x2e')],qs[_0x183b('0x33')](_0x363b09[_0x183b('0x30')][_0x183b('0x33')]));_0x1c6978[_0x183b('0x34')]=_0x1c6978[_0x183b('0x34')][_0x183b('0x35')]?_0x1c6978[_0x183b('0x34')]:_0x5ea245['model'];_0x1c6978['order']=qs[_0x183b('0x38')](_0x363b09[_0x183b('0x30')][_0x183b('0x38')]);_0x1c6978[_0x183b('0x39')]=qs[_0x183b('0x32')](_['pick'](_0x363b09['query'],_0x5ea245[_0x183b('0x32')]));if(_0x363b09[_0x183b('0x30')][_0x183b('0x3b')]){_0x1c6978[_0x183b('0x39')]=_[_0x183b('0x3c')](_0x1c6978[_0x183b('0x39')],{'$or':_[_0x183b('0x2f')](_0x1c6978[_0x183b('0x34')],function(_0x114ebd){var _0x167211={};_0x167211[_0x114ebd]={'$like':'%'+_0x363b09[_0x183b('0x30')][_0x183b('0x3b')]+'%'};return _0x167211;})});}_0x1c6978=_[_0x183b('0x3c')]({},_0x1c6978,_0x363b09[_0x183b('0x46')]);return _0x27afbb['getDescriptions'](_0x1c6978);}})[_0x183b('0x24')](function(_0x1ea60c){if(_0x1ea60c){_0xf4518c=_0x1ea60c[_0x183b('0x35')];if(!_0x363b09['query'][_0x183b('0x36')]('nolimit')){_0x1c6978['limit']=qs[_0x183b('0x1f')](_0x363b09[_0x183b('0x30')][_0x183b('0x1f')]);_0x1c6978[_0x183b('0x1d')]=qs[_0x183b('0x1d')](_0x363b09[_0x183b('0x30')]['offset']);}return _0x27afbb['getDescriptions'](_0x1c6978);}})[_0x183b('0x24')](function(_0x23022b){if(_0x23022b){return _0x23022b?{'count':_0xf4518c,'rows':_0x23022b}:null;}})[_0x183b('0x24')](respondWithResult(_0x4cbfd0,null))[_0x183b('0x41')](handleError(_0x4cbfd0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c7b950d..53a23a1 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 _0x14c4=['moment','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','lodash','util','../../config/logger'];(function(_0xbe796f,_0x1b280c){var _0x2f300e=function(_0x5c9f98){while(--_0x5c9f98){_0xbe796f['push'](_0xbe796f['shift']());}};_0x2f300e(++_0x1b280c);}(_0x14c4,0x16f));var _0x414c=function(_0x125106,_0x1a5f5d){_0x125106=_0x125106-0x0;var _0xc1ffd5=_0x14c4[_0x125106];return _0xc1ffd5;};'use strict';var _=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var logger=require(_0x414c('0x2'))('api');var moment=require(_0x414c('0x3'));var BPromise=require('bluebird');var rp=require(_0x414c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x414c('0x5'));var config=require(_0x414c('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x414c('0x7')]=function(_0xcbd058,_0x4b34c3){return _0xcbd058[_0x414c('0x8')](_0x414c('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe63c=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x8cda6f,_0x4961bc){var _0x46bccd=function(_0x2cbc22){while(--_0x2cbc22){_0x8cda6f['push'](_0x8cda6f['shift']());}};_0x46bccd(++_0x4961bc);}(_0xe63c,0x66));var _0xce63=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0xe63c[_0x457c96];return _0x4e5ebc;};'use strict';var _=require(_0xce63('0x0'));var util=require(_0xce63('0x1'));var logger=require(_0xce63('0x2'))('api');var moment=require(_0xce63('0x3'));var BPromise=require(_0xce63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce63('0x5'));var rimraf=require(_0xce63('0x6'));var config=require(_0xce63('0x7'));var attributes=require(_0xce63('0x8'));module[_0xce63('0x9')]=function(_0x19346e,_0x286e69){return _0x19346e[_0xce63('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0xce63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 94abc14..3513b1b 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 _0xb82e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment'];(function(_0x302777,_0x41145b){var _0x2d4a16=function(_0x92dae2){while(--_0x92dae2){_0x302777['push'](_0x302777['shift']());}};_0x2d4a16(++_0x41145b);}(_0xb82e,0xc4));var _0xeb82=function(_0x191e4a,_0x5c04b5){_0x191e4a=_0x191e4a-0x0;var _0x3f5750=_0xb82e[_0x191e4a];return _0x3f5750;};'use strict';var _=require(_0xeb82('0x0'));var util=require('util');var moment=require(_0xeb82('0x1'));var BPromise=require(_0xeb82('0x2'));var rs=require(_0xeb82('0x3'));var fs=require('fs');var Redis=require(_0xeb82('0x4'));var db=require(_0xeb82('0x5'))['db'];var utils=require(_0xeb82('0x6'));var logger=require(_0xeb82('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb82('0x8'));var client=jayson['client'][_0xeb82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353603,_0x4df134,_0xd02f7f){return new BPromise(function(_0x25927f,_0xc5735){return client[_0xeb82('0xa')](_0x353603,_0xd02f7f)[_0xeb82('0xb')](function(_0x2d7d20){logger[_0xeb82('0xc')](_0xeb82('0xd'),_0x4df134,'request\x20sent');logger[_0xeb82('0xe')](_0xeb82('0xf'),_0x4df134,_0xeb82('0x10'),JSON[_0xeb82('0x11')](_0x2d7d20));if(_0x2d7d20[_0xeb82('0x12')]){if(_0x2d7d20[_0xeb82('0x12')][_0xeb82('0x13')]===0x1f4){logger[_0xeb82('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4df134,_0x2d7d20['error'][_0xeb82('0x14')]);return _0xc5735(_0x2d7d20['error']['message']);}logger['error'](_0xeb82('0xd'),_0x4df134,_0x2d7d20[_0xeb82('0x12')]['message']);return _0x25927f(_0x2d7d20['error'][_0xeb82('0x14')]);}else{logger[_0xeb82('0xc')](_0xeb82('0xd'),_0x4df134,_0xeb82('0x10'));_0x25927f(_0x2d7d20['result'][_0xeb82('0x14')]);}})[_0xeb82('0x15')](function(_0x2d88cc){logger[_0xeb82('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4df134,_0x2d88cc);_0xc5735(_0x2d88cc);});});} \ No newline at end of file +var _0x70c4=['stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x13b123,_0x3a9c70){var _0x10be5a=function(_0x804be2){while(--_0x804be2){_0x13b123['push'](_0x13b123['shift']());}};_0x10be5a(++_0x3a9c70);}(_0x70c4,0x1a8));var _0x470c=function(_0x394d1c,_0x2a926c){_0x394d1c=_0x394d1c-0x0;var _0x265922=_0x70c4[_0x394d1c];return _0x265922;};'use strict';var _=require(_0x470c('0x0'));var util=require(_0x470c('0x1'));var moment=require(_0x470c('0x2'));var BPromise=require(_0x470c('0x3'));var rs=require(_0x470c('0x4'));var fs=require('fs');var Redis=require(_0x470c('0x5'));var db=require(_0x470c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x470c('0x7'))(_0x470c('0x8'));var config=require(_0x470c('0x9'));var jayson=require(_0x470c('0xa'));var client=jayson['client'][_0x470c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4721c5,_0x5825f4,_0x243f82){return new BPromise(function(_0x1b0e41,_0x1b475b){return client[_0x470c('0xc')](_0x4721c5,_0x243f82)['then'](function(_0x1c5a0e){logger['info'](_0x470c('0xd'),_0x5825f4,_0x470c('0xe'));logger[_0x470c('0xf')](_0x470c('0x10'),_0x5825f4,'request\x20sent',JSON[_0x470c('0x11')](_0x1c5a0e));if(_0x1c5a0e[_0x470c('0x12')]){if(_0x1c5a0e[_0x470c('0x12')]['code']===0x1f4){logger[_0x470c('0x12')](_0x470c('0xd'),_0x5825f4,_0x1c5a0e[_0x470c('0x12')][_0x470c('0x13')]);return _0x1b475b(_0x1c5a0e[_0x470c('0x12')][_0x470c('0x13')]);}logger[_0x470c('0x12')](_0x470c('0xd'),_0x5825f4,_0x1c5a0e['error'][_0x470c('0x13')]);return _0x1b0e41(_0x1c5a0e[_0x470c('0x12')][_0x470c('0x13')]);}else{logger[_0x470c('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5825f4,'request\x20sent');_0x1b0e41(_0x1c5a0e['result'][_0x470c('0x13')]);}})['catch'](function(_0x18cf0d){logger['error'](_0x470c('0xd'),_0x5825f4,_0x18cf0d);_0x1b475b(_0x18cf0d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4dbbbd2..d4a906c 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 _0x87bb=['create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','post'];(function(_0x56d3cb,_0x2c77c1){var _0x4ecbce=function(_0x346555){while(--_0x346555){_0x56d3cb['push'](_0x56d3cb['shift']());}};_0x4ecbce(++_0x2c77c1);}(_0x87bb,0x148));var _0xb87b=function(_0x53896d,_0x4b8282){_0x53896d=_0x53896d-0x0;var _0x50b533=_0x87bb[_0x53896d];return _0x50b533;};'use strict';var multer=require(_0xb87b('0x0'));var util=require('util');var path=require(_0xb87b('0x1'));var timeout=require('connect-timeout');var express=require(_0xb87b('0x2'));var router=express[_0xb87b('0x3')]();var fs_extra=require(_0xb87b('0x4'));var auth=require(_0xb87b('0x5'));var interaction=require(_0xb87b('0x6'));var config=require(_0xb87b('0x7'));var controller=require(_0xb87b('0x8'));router['get']('/',auth[_0xb87b('0x9')](),controller[_0xb87b('0xa')]);router[_0xb87b('0xb')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller['show']);router[_0xb87b('0xd')]('/',auth[_0xb87b('0x9')](),controller[_0xb87b('0xe')]);router[_0xb87b('0xf')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller[_0xb87b('0x10')]);router[_0xb87b('0x11')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller['destroy']);module[_0xb87b('0x12')]=router; \ No newline at end of file +var _0x21c2=['isAuthenticated','index','show','post','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get'];(function(_0x164ab6,_0x45359d){var _0x1c471a=function(_0x450391){while(--_0x450391){_0x164ab6['push'](_0x164ab6['shift']());}};_0x1c471a(++_0x45359d);}(_0x21c2,0x1e3));var _0x221c=function(_0x5cde94,_0x17dcfa){_0x5cde94=_0x5cde94-0x0;var _0x2f9af5=_0x21c2[_0x5cde94];return _0x2f9af5;};'use strict';var multer=require(_0x221c('0x0'));var util=require(_0x221c('0x1'));var path=require(_0x221c('0x2'));var timeout=require(_0x221c('0x3'));var express=require(_0x221c('0x4'));var router=express[_0x221c('0x5')]();var fs_extra=require(_0x221c('0x6'));var auth=require(_0x221c('0x7'));var interaction=require(_0x221c('0x8'));var config=require('../../config/environment');var controller=require(_0x221c('0x9'));router[_0x221c('0xa')]('/',auth[_0x221c('0xb')](),controller[_0x221c('0xc')]);router[_0x221c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x221c('0xd')]);router[_0x221c('0xe')]('/',auth[_0x221c('0xb')](),controller['create']);router['put'](_0x221c('0xf'),auth[_0x221c('0xb')](),controller[_0x221c('0x10')]);router[_0x221c('0x11')]('/:id',auth[_0x221c('0xb')](),controller['destroy']);module[_0x221c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e0c089e..84262fc 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 _0x6515=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x6515,0xe0));var _0x5651=function(_0x2dfd28,_0x153b3c){_0x2dfd28=_0x2dfd28-0x0;var _0x49c016=_0x6515[_0x2dfd28];return _0x49c016;};'use strict';var Sequelize=require('sequelize');module[_0x5651('0x0')]={'type':{'type':Sequelize[_0x5651('0x1')](_0x5651('0x2'),_0x5651('0x3'),'customVariable',_0x5651('0x4'),_0x5651('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5651('0x6')]},'key':{'type':Sequelize[_0x5651('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5651('0x2'),_0x5651('0x3'),_0x5651('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5651('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x723f=['customVariable','keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x56d1c5,_0x9e5b88){var _0x37515d=function(_0x1e8a57){while(--_0x1e8a57){_0x56d1c5['push'](_0x56d1c5['shift']());}};_0x37515d(++_0x9e5b88);}(_0x723f,0xa3));var _0xf723=function(_0x17c5c8,_0x5729b1){_0x17c5c8=_0x17c5c8-0x0;var _0x35173a=_0x723f[_0x17c5c8];return _0x35173a;};'use strict';var Sequelize=require(_0xf723('0x0'));module[_0xf723('0x1')]={'type':{'type':Sequelize[_0xf723('0x2')](_0xf723('0x3'),_0xf723('0x4'),_0xf723('0x5'),_0xf723('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xf723('0x7')]},'key':{'type':Sequelize[_0xf723('0x7')]},'keyType':{'type':Sequelize[_0xf723('0x2')](_0xf723('0x3'),_0xf723('0x4'),_0xf723('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xf723('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6eae46e..208364e 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 _0x08df=['type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x08df,0x18e));var _0xf08d=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x08df[_0x1dc24d];return _0x5d7fb2;};'use strict';var emlformat=require(_0xf08d('0x0'));var rimraf=require(_0xf08d('0x1'));var zipdir=require(_0xf08d('0x2'));var jsonpatch=require(_0xf08d('0x3'));var rp=require(_0xf08d('0x4'));var moment=require(_0xf08d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf08d('0x6'));var path=require(_0xf08d('0x7'));var sox=require('sox');var csv=require(_0xf08d('0x8'));var ejs=require(_0xf08d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf08d('0xa'));var squel=require(_0xf08d('0xb'));var crypto=require(_0xf08d('0xc'));var jsforce=require(_0xf08d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf08d('0xe'));var Papa=require('papaparse');var Redis=require(_0xf08d('0xf'));var authService=require(_0xf08d('0x10'));var qs=require(_0xf08d('0x11'));var as=require(_0xf08d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf08d('0x13'))(_0xf08d('0x14'));var utils=require(_0xf08d('0x15'));var config=require(_0xf08d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08d('0x17'))['db'];function respondWithStatusCode(_0x459d01,_0x49d781){_0x49d781=_0x49d781||0xcc;return function(_0xb3fef3){if(_0xb3fef3){return _0x459d01[_0xf08d('0x18')](_0x49d781);}return _0x459d01[_0xf08d('0x19')](_0x49d781)['end']();};}function respondWithResult(_0x187cad,_0x33b398){_0x33b398=_0x33b398||0xc8;return function(_0x2a0686){if(_0x2a0686){return _0x187cad[_0xf08d('0x19')](_0x33b398)['json'](_0x2a0686);}};}function respondWithFilteredResult(_0x2b48f9,_0x31b1fa){return function(_0x291011){if(_0x291011){var _0x183348=typeof _0x31b1fa[_0xf08d('0x1a')]===_0xf08d('0x1b')&&typeof _0x31b1fa[_0xf08d('0x1c')]===_0xf08d('0x1b');var _0x37a165=_0x291011[_0xf08d('0x1d')];var _0x10ff9e=_0x183348?0x0:_0x31b1fa[_0xf08d('0x1a')];var _0x84c0b6=_0x183348?_0x291011[_0xf08d('0x1d')]:_0x31b1fa[_0xf08d('0x1a')]+_0x31b1fa[_0xf08d('0x1c')];var _0x2c7afb;if(_0x84c0b6>=_0x37a165){_0x84c0b6=_0x37a165;_0x2c7afb=0xc8;}else{_0x2c7afb=0xce;}_0x2b48f9[_0xf08d('0x19')](_0x2c7afb);return _0x2b48f9[_0xf08d('0x1e')]('Content-Range',_0x10ff9e+'-'+_0x84c0b6+'/'+_0x37a165)['json'](_0x291011);}return null;};}function patchUpdates(_0x264abe){return function(_0x55a1e0){try{jsonpatch[_0xf08d('0x1f')](_0x55a1e0,_0x264abe,!![]);}catch(_0x2fff35){return BPromise[_0xf08d('0x20')](_0x2fff35);}return _0x55a1e0['save']();};}function saveUpdates(_0x1b0f01,_0x209fcc){return function(_0x47af1a){if(_0x47af1a){return _0x47af1a[_0xf08d('0x21')](_0x1b0f01)[_0xf08d('0x22')](function(_0xac84f7){return _0xac84f7;});}return null;};}function removeEntity(_0x3acbba,_0x1c34a0){return function(_0x7c833b){if(_0x7c833b){return _0x7c833b[_0xf08d('0x23')]()[_0xf08d('0x22')](function(){_0x3acbba[_0xf08d('0x19')](0xcc)[_0xf08d('0x24')]();});}};}function handleEntityNotFound(_0x2e9890,_0x5643a7){return function(_0x1a9a17){if(!_0x1a9a17){_0x2e9890[_0xf08d('0x18')](0x194);}return _0x1a9a17;};}function handleError(_0x305289,_0x1e0b2a){_0x1e0b2a=_0x1e0b2a||0x1f4;return function(_0x5a2289){logger[_0xf08d('0x25')](_0x5a2289[_0xf08d('0x26')]);if(_0x5a2289[_0xf08d('0x27')]){delete _0x5a2289[_0xf08d('0x27')];}_0x305289[_0xf08d('0x19')](_0x1e0b2a)[_0xf08d('0x28')](_0x5a2289);};}exports[_0xf08d('0x29')]=function(_0x41f72a,_0x3b77cc){var _0x4e4911={},_0x1d1ee7={},_0x502d71={'count':0x0,'rows':[]};var _0x56c09f=_[_0xf08d('0x2a')](db[_0xf08d('0x2b')][_0xf08d('0x2c')],function(_0x25e01a){return{'name':_0x25e01a[_0xf08d('0x2d')],'type':_0x25e01a[_0xf08d('0x2e')][_0xf08d('0x2f')]};});_0x1d1ee7['model']=_[_0xf08d('0x2a')](_0x56c09f,_0xf08d('0x27'));_0x1d1ee7[_0xf08d('0x30')]=_[_0xf08d('0x31')](_0x41f72a[_0xf08d('0x30')]);_0x1d1ee7[_0xf08d('0x32')]=_[_0xf08d('0x33')](_0x1d1ee7['model'],_0x1d1ee7[_0xf08d('0x30')]);_0x4e4911[_0xf08d('0x34')]=_[_0xf08d('0x33')](_0x1d1ee7[_0xf08d('0x35')],qs[_0xf08d('0x36')](_0x41f72a[_0xf08d('0x30')][_0xf08d('0x36')]));_0x4e4911['attributes']=_0x4e4911[_0xf08d('0x34')][_0xf08d('0x37')]?_0x4e4911[_0xf08d('0x34')]:_0x1d1ee7[_0xf08d('0x35')];if(!_0x41f72a['query'][_0xf08d('0x38')](_0xf08d('0x39'))){_0x4e4911['limit']=qs[_0xf08d('0x1c')](_0x41f72a[_0xf08d('0x30')][_0xf08d('0x1c')]);_0x4e4911[_0xf08d('0x1a')]=qs[_0xf08d('0x1a')](_0x41f72a['query'][_0xf08d('0x1a')]);}_0x4e4911[_0xf08d('0x3a')]=qs[_0xf08d('0x3b')](_0x41f72a['query']['sort']);_0x4e4911[_0xf08d('0x3c')]=qs[_0xf08d('0x32')](_[_0xf08d('0x3d')](_0x41f72a[_0xf08d('0x30')],_0x1d1ee7[_0xf08d('0x32')]),_0x56c09f);if(_0x41f72a[_0xf08d('0x30')][_0xf08d('0x3e')]){_0x4e4911[_0xf08d('0x3c')]=_[_0xf08d('0x3f')](_0x4e4911[_0xf08d('0x3c')],{'$or':_[_0xf08d('0x2a')](_0x56c09f,function(_0x406ca8){if(_0x406ca8[_0xf08d('0x2e')]!==_0xf08d('0x40')){var _0x31bac9={};_0x31bac9[_0x406ca8[_0xf08d('0x27')]]={'$like':'%'+_0x41f72a[_0xf08d('0x30')]['filter']+'%'};return _0x31bac9;}})});}_0x4e4911=_['merge']({},_0x4e4911,_0x41f72a[_0xf08d('0x41')]);var _0x299235={'where':_0x4e4911[_0xf08d('0x3c')]};return db[_0xf08d('0x2b')][_0xf08d('0x1d')](_0x299235)['then'](function(_0x56bb01){_0x502d71[_0xf08d('0x1d')]=_0x56bb01;if(_0x41f72a[_0xf08d('0x30')][_0xf08d('0x42')]){_0x4e4911['include']=[{'all':!![]}];}return db['SalesforceField'][_0xf08d('0x43')](_0x4e4911);})['then'](function(_0x3a51d1){_0x502d71['rows']=_0x3a51d1;return _0x502d71;})['then'](respondWithFilteredResult(_0x3b77cc,_0x4e4911))['catch'](handleError(_0x3b77cc,null));};exports['show']=function(_0x4f6a98,_0x36146c){var _0x1f736f={'raw':!![],'where':{'id':_0x4f6a98[_0xf08d('0x44')]['id']}},_0x344bec={};_0x344bec[_0xf08d('0x35')]=_[_0xf08d('0x31')](db[_0xf08d('0x2b')][_0xf08d('0x2c')]);_0x344bec['query']=_[_0xf08d('0x31')](_0x4f6a98[_0xf08d('0x30')]);_0x344bec['filters']=_[_0xf08d('0x33')](_0x344bec[_0xf08d('0x35')],_0x344bec[_0xf08d('0x30')]);_0x1f736f['attributes']=_[_0xf08d('0x33')](_0x344bec[_0xf08d('0x35')],qs['fields'](_0x4f6a98[_0xf08d('0x30')][_0xf08d('0x36')]));_0x1f736f[_0xf08d('0x34')]=_0x1f736f[_0xf08d('0x34')]['length']?_0x1f736f['attributes']:_0x344bec[_0xf08d('0x35')];if(_0x4f6a98['query'][_0xf08d('0x42')]){_0x1f736f[_0xf08d('0x45')]=[{'all':!![]}];}_0x1f736f=_[_0xf08d('0x3f')]({},_0x1f736f,_0x4f6a98['options']);return db['SalesforceField'][_0xf08d('0x46')](_0x1f736f)[_0xf08d('0x22')](handleEntityNotFound(_0x36146c,null))[_0xf08d('0x22')](respondWithResult(_0x36146c,null))[_0xf08d('0x47')](handleError(_0x36146c,null));};exports['create']=function(_0xe73e44,_0x43f7e8){return db['SalesforceField'][_0xf08d('0x48')](_0xe73e44[_0xf08d('0x49')],{})[_0xf08d('0x22')](respondWithResult(_0x43f7e8,0xc9))['catch'](handleError(_0x43f7e8,null));};exports[_0xf08d('0x21')]=function(_0x32e9a4,_0x1c2f9d){if(_0x32e9a4['body']['id']){delete _0x32e9a4[_0xf08d('0x49')]['id'];}return db[_0xf08d('0x2b')][_0xf08d('0x46')]({'where':{'id':_0x32e9a4[_0xf08d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c2f9d,null))[_0xf08d('0x22')](saveUpdates(_0x32e9a4[_0xf08d('0x49')],null))[_0xf08d('0x22')](respondWithResult(_0x1c2f9d,null))['catch'](handleError(_0x1c2f9d,null));};exports[_0xf08d('0x23')]=function(_0xbb0889,_0x1cc7ff){return db[_0xf08d('0x2b')][_0xf08d('0x46')]({'where':{'id':_0xbb0889[_0xf08d('0x44')]['id']}})[_0xf08d('0x22')](handleEntityNotFound(_0x1cc7ff,null))['then'](removeEntity(_0x1cc7ff,null))[_0xf08d('0x47')](handleError(_0x1cc7ff,null));}; \ No newline at end of file +var _0xa037=['type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','map','SalesforceField','rawAttributes'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0xa037,0x1b9));var _0x7a03=function(_0x573a05,_0x116879){_0x573a05=_0x573a05-0x0;var _0x2b36db=_0xa037[_0x573a05];return _0x2b36db;};'use strict';var emlformat=require(_0x7a03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a03('0x1'));var rp=require('request-promise');var moment=require(_0x7a03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7a03('0x3'));var util=require(_0x7a03('0x4'));var path=require('path');var sox=require(_0x7a03('0x5'));var csv=require(_0x7a03('0x6'));var ejs=require(_0x7a03('0x7'));var fs=require('fs');var fs_extra=require(_0x7a03('0x8'));var _=require(_0x7a03('0x9'));var squel=require('squel');var crypto=require(_0x7a03('0xa'));var jsforce=require(_0x7a03('0xb'));var deskjs=require(_0x7a03('0xc'));var toCsv=require(_0x7a03('0x6'));var querystring=require('querystring');var Papa=require(_0x7a03('0xd'));var Redis=require(_0x7a03('0xe'));var authService=require(_0x7a03('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7a03('0x10'));var hardwareService=require(_0x7a03('0x11'));var logger=require(_0x7a03('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7a03('0x13'));var licenseUtil=require(_0x7a03('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b8cef,_0x1e45df){_0x1e45df=_0x1e45df||0xcc;return function(_0x5767dd){if(_0x5767dd){return _0x3b8cef['sendStatus'](_0x1e45df);}return _0x3b8cef[_0x7a03('0x15')](_0x1e45df)[_0x7a03('0x16')]();};}function respondWithResult(_0x50e3f8,_0x166384){_0x166384=_0x166384||0xc8;return function(_0x595306){if(_0x595306){return _0x50e3f8[_0x7a03('0x15')](_0x166384)[_0x7a03('0x17')](_0x595306);}};}function respondWithFilteredResult(_0x3de216,_0x7c7383){return function(_0x46b49a){if(_0x46b49a){var _0xe253f1=typeof _0x7c7383['offset']===_0x7a03('0x18')&&typeof _0x7c7383[_0x7a03('0x19')]===_0x7a03('0x18');var _0x595859=_0x46b49a[_0x7a03('0x1a')];var _0x1b1d0d=_0xe253f1?0x0:_0x7c7383[_0x7a03('0x1b')];var _0x4facfd=_0xe253f1?_0x46b49a[_0x7a03('0x1a')]:_0x7c7383[_0x7a03('0x1b')]+_0x7c7383['limit'];var _0x1e7f58;if(_0x4facfd>=_0x595859){_0x4facfd=_0x595859;_0x1e7f58=0xc8;}else{_0x1e7f58=0xce;}_0x3de216[_0x7a03('0x15')](_0x1e7f58);return _0x3de216[_0x7a03('0x1c')](_0x7a03('0x1d'),_0x1b1d0d+'-'+_0x4facfd+'/'+_0x595859)['json'](_0x46b49a);}return null;};}function patchUpdates(_0x225bbc){return function(_0x2416ab){try{jsonpatch[_0x7a03('0x1e')](_0x2416ab,_0x225bbc,!![]);}catch(_0x4908d4){return BPromise['reject'](_0x4908d4);}return _0x2416ab[_0x7a03('0x1f')]();};}function saveUpdates(_0x4e6358,_0x28bb4f){return function(_0x29513b){if(_0x29513b){return _0x29513b[_0x7a03('0x20')](_0x4e6358)[_0x7a03('0x21')](function(_0x45cbb7){return _0x45cbb7;});}return null;};}function removeEntity(_0x217cb3,_0x5c782d){return function(_0x4bd3f6){if(_0x4bd3f6){return _0x4bd3f6[_0x7a03('0x22')]()['then'](function(){_0x217cb3[_0x7a03('0x15')](0xcc)[_0x7a03('0x16')]();});}};}function handleEntityNotFound(_0x13a524,_0x45796c){return function(_0x3114d0){if(!_0x3114d0){_0x13a524[_0x7a03('0x23')](0x194);}return _0x3114d0;};}function handleError(_0xeb4ba4,_0x19f8e5){_0x19f8e5=_0x19f8e5||0x1f4;return function(_0x40abcf){logger['error'](_0x40abcf[_0x7a03('0x24')]);if(_0x40abcf[_0x7a03('0x25')]){delete _0x40abcf[_0x7a03('0x25')];}_0xeb4ba4[_0x7a03('0x15')](_0x19f8e5)[_0x7a03('0x26')](_0x40abcf);};}exports['index']=function(_0x3b4318,_0x75add9){var _0x3482d8={},_0x4e3c20={},_0x322156={'count':0x0,'rows':[]};var _0x1def77=_[_0x7a03('0x27')](db[_0x7a03('0x28')][_0x7a03('0x29')],function(_0x8ea70a){return{'name':_0x8ea70a['fieldName'],'type':_0x8ea70a[_0x7a03('0x2a')][_0x7a03('0x2b')]};});_0x4e3c20[_0x7a03('0x2c')]=_[_0x7a03('0x27')](_0x1def77,'name');_0x4e3c20['query']=_[_0x7a03('0x2d')](_0x3b4318[_0x7a03('0x2e')]);_0x4e3c20[_0x7a03('0x2f')]=_[_0x7a03('0x30')](_0x4e3c20['model'],_0x4e3c20[_0x7a03('0x2e')]);_0x3482d8[_0x7a03('0x31')]=_[_0x7a03('0x30')](_0x4e3c20[_0x7a03('0x2c')],qs[_0x7a03('0x32')](_0x3b4318['query'][_0x7a03('0x32')]));_0x3482d8[_0x7a03('0x31')]=_0x3482d8[_0x7a03('0x31')][_0x7a03('0x33')]?_0x3482d8['attributes']:_0x4e3c20[_0x7a03('0x2c')];if(!_0x3b4318[_0x7a03('0x2e')]['hasOwnProperty'](_0x7a03('0x34'))){_0x3482d8[_0x7a03('0x19')]=qs[_0x7a03('0x19')](_0x3b4318[_0x7a03('0x2e')][_0x7a03('0x19')]);_0x3482d8[_0x7a03('0x1b')]=qs[_0x7a03('0x1b')](_0x3b4318[_0x7a03('0x2e')][_0x7a03('0x1b')]);}_0x3482d8[_0x7a03('0x35')]=qs[_0x7a03('0x36')](_0x3b4318[_0x7a03('0x2e')][_0x7a03('0x36')]);_0x3482d8[_0x7a03('0x37')]=qs[_0x7a03('0x2f')](_[_0x7a03('0x38')](_0x3b4318[_0x7a03('0x2e')],_0x4e3c20['filters']),_0x1def77);if(_0x3b4318['query'][_0x7a03('0x39')]){_0x3482d8[_0x7a03('0x37')]=_[_0x7a03('0x3a')](_0x3482d8[_0x7a03('0x37')],{'$or':_[_0x7a03('0x27')](_0x1def77,function(_0x410ead){if(_0x410ead[_0x7a03('0x2a')]!==_0x7a03('0x3b')){var _0x3f5198={};_0x3f5198[_0x410ead[_0x7a03('0x25')]]={'$like':'%'+_0x3b4318[_0x7a03('0x2e')][_0x7a03('0x39')]+'%'};return _0x3f5198;}})});}_0x3482d8=_['merge']({},_0x3482d8,_0x3b4318[_0x7a03('0x3c')]);var _0x173e70={'where':_0x3482d8[_0x7a03('0x37')]};return db[_0x7a03('0x28')][_0x7a03('0x1a')](_0x173e70)[_0x7a03('0x21')](function(_0x5b365c){_0x322156[_0x7a03('0x1a')]=_0x5b365c;if(_0x3b4318[_0x7a03('0x2e')][_0x7a03('0x3d')]){_0x3482d8[_0x7a03('0x3e')]=[{'all':!![]}];}return db[_0x7a03('0x28')][_0x7a03('0x3f')](_0x3482d8);})[_0x7a03('0x21')](function(_0x21ea2d){_0x322156['rows']=_0x21ea2d;return _0x322156;})[_0x7a03('0x21')](respondWithFilteredResult(_0x75add9,_0x3482d8))['catch'](handleError(_0x75add9,null));};exports['show']=function(_0x4c4e20,_0x405f8e){var _0x54df56={'raw':!![],'where':{'id':_0x4c4e20[_0x7a03('0x40')]['id']}},_0x3e0a8e={};_0x3e0a8e['model']=_[_0x7a03('0x2d')](db[_0x7a03('0x28')]['rawAttributes']);_0x3e0a8e[_0x7a03('0x2e')]=_[_0x7a03('0x2d')](_0x4c4e20[_0x7a03('0x2e')]);_0x3e0a8e[_0x7a03('0x2f')]=_[_0x7a03('0x30')](_0x3e0a8e['model'],_0x3e0a8e[_0x7a03('0x2e')]);_0x54df56['attributes']=_[_0x7a03('0x30')](_0x3e0a8e[_0x7a03('0x2c')],qs[_0x7a03('0x32')](_0x4c4e20['query'][_0x7a03('0x32')]));_0x54df56[_0x7a03('0x31')]=_0x54df56[_0x7a03('0x31')][_0x7a03('0x33')]?_0x54df56['attributes']:_0x3e0a8e['model'];if(_0x4c4e20[_0x7a03('0x2e')][_0x7a03('0x3d')]){_0x54df56['include']=[{'all':!![]}];}_0x54df56=_[_0x7a03('0x3a')]({},_0x54df56,_0x4c4e20['options']);return db[_0x7a03('0x28')][_0x7a03('0x41')](_0x54df56)[_0x7a03('0x21')](handleEntityNotFound(_0x405f8e,null))[_0x7a03('0x21')](respondWithResult(_0x405f8e,null))[_0x7a03('0x42')](handleError(_0x405f8e,null));};exports['create']=function(_0x90e197,_0x1ad67f){return db[_0x7a03('0x28')][_0x7a03('0x43')](_0x90e197['body'],{})[_0x7a03('0x21')](respondWithResult(_0x1ad67f,0xc9))['catch'](handleError(_0x1ad67f,null));};exports['update']=function(_0xdf2636,_0x7c7b00){if(_0xdf2636[_0x7a03('0x44')]['id']){delete _0xdf2636[_0x7a03('0x44')]['id'];}return db[_0x7a03('0x28')][_0x7a03('0x41')]({'where':{'id':_0xdf2636[_0x7a03('0x40')]['id']}})[_0x7a03('0x21')](handleEntityNotFound(_0x7c7b00,null))[_0x7a03('0x21')](saveUpdates(_0xdf2636['body'],null))[_0x7a03('0x21')](respondWithResult(_0x7c7b00,null))[_0x7a03('0x42')](handleError(_0x7c7b00,null));};exports[_0x7a03('0x22')]=function(_0x59ef42,_0x333121){return db[_0x7a03('0x28')][_0x7a03('0x41')]({'where':{'id':_0x59ef42[_0x7a03('0x40')]['id']}})[_0x7a03('0x21')](handleEntityNotFound(_0x333121,null))[_0x7a03('0x21')](removeEntity(_0x333121,null))[_0x7a03('0x42')](handleError(_0x333121,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 4c16961..86fa6e7 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 _0x2f3e=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','api','moment','bluebird'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0x2f3e,0x1b6));var _0xe2f3=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x2f3e[_0x16938f];return _0x5c66e9;};'use strict';var _=require(_0xe2f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe2f3('0x1'));var moment=require(_0xe2f3('0x2'));var BPromise=require(_0xe2f3('0x3'));var rp=require(_0xe2f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2f3('0x5'));var config=require(_0xe2f3('0x6'));var attributes=require(_0xe2f3('0x7'));module['exports']=function(_0x3def9a,_0x33a25b){return _0x3def9a[_0xe2f3('0x8')](_0xe2f3('0x9'),attributes,{'tableName':_0xe2f3('0xa'),'paranoid':![],'indexes':[{'name':_0xe2f3('0xb'),'fields':['idField',_0xe2f3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd26a=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x330a1c,_0x21522c){var _0x5885c4=function(_0x14b892){while(--_0x14b892){_0x330a1c['push'](_0x330a1c['shift']());}};_0x5885c4(++_0x21522c);}(_0xd26a,0xec));var _0xad26=function(_0x84183f,_0xb91202){_0x84183f=_0x84183f-0x0;var _0x4950e4=_0xd26a[_0x84183f];return _0x4950e4;};'use strict';var _=require(_0xad26('0x0'));var util=require(_0xad26('0x1'));var logger=require(_0xad26('0x2'))('api');var moment=require('moment');var BPromise=require(_0xad26('0x3'));var rp=require(_0xad26('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad26('0x5'));var config=require(_0xad26('0x6'));var attributes=require(_0xad26('0x7'));module[_0xad26('0x8')]=function(_0x37b557,_0x57a2d6){return _0x37b557[_0xad26('0x9')](_0xad26('0xa'),attributes,{'tableName':_0xad26('0xb'),'paranoid':![],'indexes':[{'name':_0xad26('0xc'),'fields':[_0xad26('0xd'),_0xad26('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 1939bf5..b189f60 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 _0xde6f=['../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x6ebb48,_0x53fbf3){var _0xc74302=function(_0x1a2614){while(--_0x1a2614){_0x6ebb48['push'](_0x6ebb48['shift']());}};_0xc74302(++_0x53fbf3);}(_0xde6f,0xe8));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfde6('0x0'));var util=require(_0xfde6('0x1'));var moment=require(_0xfde6('0x2'));var BPromise=require(_0xfde6('0x3'));var rs=require(_0xfde6('0x4'));var fs=require('fs');var Redis=require(_0xfde6('0x5'));var db=require(_0xfde6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfde6('0x7'))('rpc');var config=require(_0xfde6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfde6('0x9')][_0xfde6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58eff6,_0x415eae,_0x17a2ab){return new BPromise(function(_0x24be29,_0x2bd32d){return client[_0xfde6('0xb')](_0x58eff6,_0x17a2ab)[_0xfde6('0xc')](function(_0x595015){logger[_0xfde6('0xd')](_0xfde6('0xe'),_0x415eae,_0xfde6('0xf'));logger[_0xfde6('0x10')](_0xfde6('0x11'),_0x415eae,_0xfde6('0xf'),JSON[_0xfde6('0x12')](_0x595015));if(_0x595015[_0xfde6('0x13')]){if(_0x595015['error'][_0xfde6('0x14')]===0x1f4){logger[_0xfde6('0x13')](_0xfde6('0xe'),_0x415eae,_0x595015[_0xfde6('0x13')][_0xfde6('0x15')]);return _0x2bd32d(_0x595015['error']['message']);}logger[_0xfde6('0x13')](_0xfde6('0xe'),_0x415eae,_0x595015[_0xfde6('0x13')][_0xfde6('0x15')]);return _0x24be29(_0x595015[_0xfde6('0x13')][_0xfde6('0x15')]);}else{logger['info'](_0xfde6('0xe'),_0x415eae,_0xfde6('0xf'));_0x24be29(_0x595015[_0xfde6('0x16')][_0xfde6('0x15')]);}})[_0xfde6('0x17')](function(_0x5d458c){logger[_0xfde6('0x13')](_0xfde6('0xe'),_0x415eae,_0x5d458c);_0x2bd32d(_0x5d458c);});});} \ No newline at end of file +var _0x61b0=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xd8c9a8,_0x4e4005){var _0x5488cc=function(_0x44ff67){while(--_0x44ff67){_0xd8c9a8['push'](_0xd8c9a8['shift']());}};_0x5488cc(++_0x4e4005);}(_0x61b0,0x1f1));var _0x061b=function(_0x2db78a,_0x499e2c){_0x2db78a=_0x2db78a-0x0;var _0x166c9e=_0x61b0[_0x2db78a];return _0x166c9e;};'use strict';var _=require(_0x061b('0x0'));var util=require(_0x061b('0x1'));var moment=require('moment');var BPromise=require(_0x061b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x061b('0x3'));var db=require(_0x061b('0x4'))['db'];var utils=require(_0x061b('0x5'));var logger=require(_0x061b('0x6'))(_0x061b('0x7'));var config=require(_0x061b('0x8'));var jayson=require(_0x061b('0x9'));var client=jayson[_0x061b('0xa')][_0x061b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c4640,_0x453711,_0xb7ed6d){return new BPromise(function(_0x549e80,_0x4dc2a3){return client[_0x061b('0xc')](_0x1c4640,_0xb7ed6d)[_0x061b('0xd')](function(_0x297a58){logger[_0x061b('0xe')](_0x061b('0xf'),_0x453711,_0x061b('0x10'));logger[_0x061b('0x11')](_0x061b('0x12'),_0x453711,_0x061b('0x10'),JSON[_0x061b('0x13')](_0x297a58));if(_0x297a58[_0x061b('0x14')]){if(_0x297a58[_0x061b('0x14')][_0x061b('0x15')]===0x1f4){logger['error'](_0x061b('0xf'),_0x453711,_0x297a58[_0x061b('0x14')][_0x061b('0x16')]);return _0x4dc2a3(_0x297a58['error']['message']);}logger['error'](_0x061b('0xf'),_0x453711,_0x297a58['error'][_0x061b('0x16')]);return _0x549e80(_0x297a58[_0x061b('0x14')][_0x061b('0x16')]);}else{logger['info'](_0x061b('0xf'),_0x453711,'request\x20sent');_0x549e80(_0x297a58['result'][_0x061b('0x16')]);}})[_0x061b('0x17')](function(_0x3e21ba){logger[_0x061b('0x14')](_0x061b('0xf'),_0x453711,_0x3e21ba);_0x4dc2a3(_0x3e21ba);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e598bc1..48aa4bf 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 _0xc9fb=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x45d982,_0x348169){var _0x387916=function(_0x3478f8){while(--_0x3478f8){_0x45d982['push'](_0x45d982['shift']());}};_0x387916(++_0x348169);}(_0xc9fb,0x148));var _0xbc9f=function(_0x383094,_0x2b054a){_0x383094=_0x383094-0x0;var _0x55800a=_0xc9fb[_0x383094];return _0x55800a;};'use strict';var multer=require(_0xbc9f('0x0'));var util=require(_0xbc9f('0x1'));var path=require(_0xbc9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc9f('0x3'));var router=express['Router']();var fs_extra=require(_0xbc9f('0x4'));var auth=require(_0xbc9f('0x5'));var interaction=require(_0xbc9f('0x6'));var config=require(_0xbc9f('0x7'));var controller=require(_0xbc9f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc9f('0x9')]);router[_0xbc9f('0xa')](_0xbc9f('0xb'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0xd')]);router[_0xbc9f('0xa')](_0xbc9f('0xe'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0xf')]);router['get'](_0xbc9f('0x10'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x11')]);router[_0xbc9f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xbc9f('0xe'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x13')]);router[_0xbc9f('0x14')](_0xbc9f('0xb'),auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x15')]);router[_0xbc9f('0x16')]('/:id',auth[_0xbc9f('0xc')](),controller[_0xbc9f('0x17')]);module[_0xbc9f('0x18')]=router; \ No newline at end of file +var _0x11b7=['/:id/fields','getFields','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x5a87e9,_0x4053ca){var _0x475c33=function(_0x2d9549){while(--_0x2d9549){_0x5a87e9['push'](_0x5a87e9['shift']());}};_0x475c33(++_0x4053ca);}(_0x11b7,0x132));var _0x711b=function(_0xef7f3b,_0x4f689f){_0xef7f3b=_0xef7f3b-0x0;var _0x5bc9e3=_0x11b7[_0xef7f3b];return _0x5bc9e3;};'use strict';var multer=require(_0x711b('0x0'));var util=require(_0x711b('0x1'));var path=require(_0x711b('0x2'));var timeout=require(_0x711b('0x3'));var express=require(_0x711b('0x4'));var router=express[_0x711b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x711b('0x6'));var interaction=require(_0x711b('0x7'));var config=require(_0x711b('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x711b('0x9')]('/',auth[_0x711b('0xa')](),controller[_0x711b('0xb')]);router[_0x711b('0x9')](_0x711b('0xc'),auth[_0x711b('0xa')](),controller[_0x711b('0xd')]);router[_0x711b('0x9')](_0x711b('0xe'),auth[_0x711b('0xa')](),controller[_0x711b('0xf')]);router[_0x711b('0x9')](_0x711b('0x10'),auth[_0x711b('0xa')](),controller[_0x711b('0x11')]);router['post']('/',auth[_0x711b('0xa')](),controller[_0x711b('0x12')]);router['post'](_0x711b('0xe'),auth[_0x711b('0xa')](),controller[_0x711b('0x13')]);router[_0x711b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x711b('0x15')]);router['delete'](_0x711b('0xc'),auth[_0x711b('0xa')](),controller['destroy']);module[_0x711b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index c0b6f9c..955c957 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 _0x796a=['remoteUri','sequelize','STRING','username'];(function(_0x4e2111,_0x1d5493){var _0x1b4556=function(_0x2bd9ee){while(--_0x2bd9ee){_0x4e2111['push'](_0x4e2111['shift']());}};_0x1b4556(++_0x1d5493);}(_0x796a,0xf5));var _0xa796=function(_0x65959d,_0x4dd888){_0x65959d=_0x65959d-0x0;var _0x2d71aa=_0x796a[_0x65959d];return _0x2d71aa;};'use strict';var Sequelize=require(_0xa796('0x0'));module['exports']={'name':{'type':Sequelize[_0xa796('0x1')]},'description':{'type':Sequelize[_0xa796('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xa796('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa796('0x1')],'unique':_0xa796('0x3')},'serverUrl':{'type':Sequelize[_0xa796('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc7f4=['remoteUri','sequelize','STRING','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc7f4,0x121));var _0x4c7f=function(_0x17dccb,_0x35a024){_0x17dccb=_0x17dccb-0x0;var _0x1fa895=_0xc7f4[_0x17dccb];return _0x1fa895;};'use strict';var Sequelize=require(_0x4c7f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4c7f('0x1')]},'username':{'type':Sequelize[_0x4c7f('0x1')],'unique':_0x4c7f('0x2')},'password':{'type':Sequelize[_0x4c7f('0x1')]},'email':{'type':Sequelize[_0x4c7f('0x1')]},'remoteUri':{'type':Sequelize[_0x4c7f('0x1')],'unique':_0x4c7f('0x3')},'serverUrl':{'type':Sequelize[_0x4c7f('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index e0a3cbe..2e25a49 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 _0x547c=['password','email','remoteUri','serverUrl','slice','substring','format','GET','incident?sysparm_display_value=all','result','log','assign','includes','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','send','index','map','ServicenowAccount','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','getConfigurations','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','type','ServicenowConfiguration','ServicenowField','getFields','knowledge','subcategory','close_code','incident_state','severity','made_sla','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','category','findOne','username'];(function(_0x4bb48e,_0x42d15d){var _0xcaec94=function(_0x2b6ca1){while(--_0x2b6ca1){_0x4bb48e['push'](_0x4bb48e['shift']());}};_0xcaec94(++_0x42d15d);}(_0x547c,0x198));var _0xc547=function(_0x731327,_0x5e62ea){_0x731327=_0x731327-0x0;var _0x5e1ff0=_0x547c[_0x731327];return _0x5e1ff0;};'use strict';var emlformat=require(_0xc547('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc547('0x1'));var rp=require(_0xc547('0x2'));var moment=require(_0xc547('0x3'));var BPromise=require(_0xc547('0x4'));var Mustache=require(_0xc547('0x5'));var util=require('util');var path=require(_0xc547('0x6'));var sox=require(_0xc547('0x7'));var csv=require(_0xc547('0x8'));var ejs=require(_0xc547('0x9'));var fs=require('fs');var fs_extra=require(_0xc547('0xa'));var _=require(_0xc547('0xb'));var squel=require(_0xc547('0xc'));var crypto=require('crypto');var jsforce=require(_0xc547('0xd'));var deskjs=require(_0xc547('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc547('0xf'));var Papa=require(_0xc547('0x10'));var Redis=require(_0xc547('0x11'));var authService=require(_0xc547('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc547('0x13'));var logger=require(_0xc547('0x14'))(_0xc547('0x15'));var utils=require(_0xc547('0x16'));var config=require(_0xc547('0x17'));var licenseUtil=require(_0xc547('0x18'));var db=require(_0xc547('0x19'))['db'];var integrations=require(_0xc547('0x1a'));function respondWithStatusCode(_0x4ed4c5,_0xc1dda4){_0xc1dda4=_0xc1dda4||0xcc;return function(_0x403d4f){if(_0x403d4f){return _0x4ed4c5['sendStatus'](_0xc1dda4);}return _0x4ed4c5['status'](_0xc1dda4)[_0xc547('0x1b')]();};}function respondWithResult(_0x226c7d,_0x29bd30){_0x29bd30=_0x29bd30||0xc8;return function(_0x4acdc3){if(_0x4acdc3){return _0x226c7d['status'](_0x29bd30)['json'](_0x4acdc3);}};}function respondWithFilteredResult(_0x2900f8,_0x598c42){return function(_0x1b94d0){if(_0x1b94d0){var _0x369f47=typeof _0x598c42['offset']===_0xc547('0x1c')&&typeof _0x598c42[_0xc547('0x1d')]===_0xc547('0x1c');var _0x563d46=_0x1b94d0[_0xc547('0x1e')];var _0x2183a8=_0x369f47?0x0:_0x598c42[_0xc547('0x1f')];var _0xad8a03=_0x369f47?_0x1b94d0[_0xc547('0x1e')]:_0x598c42[_0xc547('0x1f')]+_0x598c42[_0xc547('0x1d')];var _0x5dd703;if(_0xad8a03>=_0x563d46){_0xad8a03=_0x563d46;_0x5dd703=0xc8;}else{_0x5dd703=0xce;}_0x2900f8['status'](_0x5dd703);return _0x2900f8[_0xc547('0x20')](_0xc547('0x21'),_0x2183a8+'-'+_0xad8a03+'/'+_0x563d46)[_0xc547('0x22')](_0x1b94d0);}return null;};}function patchUpdates(_0x52ba84){return function(_0x574cda){try{jsonpatch[_0xc547('0x23')](_0x574cda,_0x52ba84,!![]);}catch(_0x5659d6){return BPromise[_0xc547('0x24')](_0x5659d6);}return _0x574cda[_0xc547('0x25')]();};}function saveUpdates(_0x514aad,_0x55f0a5){return function(_0x4fd0b2){if(_0x4fd0b2){return _0x4fd0b2[_0xc547('0x26')](_0x514aad)[_0xc547('0x27')](function(_0x5b9b7f){return _0x5b9b7f;});}return null;};}function removeEntity(_0x4bc4b3,_0x2f4226){return function(_0x30cc0c){if(_0x30cc0c){return _0x30cc0c[_0xc547('0x28')]()['then'](function(){_0x4bc4b3[_0xc547('0x29')](0xcc)[_0xc547('0x1b')]();});}};}function handleEntityNotFound(_0x355241,_0xdb2714){return function(_0x33de13){if(!_0x33de13){_0x355241[_0xc547('0x2a')](0x194);}return _0x33de13;};}function handleError(_0x34743b,_0x3a54d6){_0x3a54d6=_0x3a54d6||0x1f4;return function(_0x2a50a1){logger[_0xc547('0x2b')](_0x2a50a1[_0xc547('0x2c')]);if(_0x2a50a1['name']){delete _0x2a50a1['name'];}_0x34743b[_0xc547('0x29')](_0x3a54d6)[_0xc547('0x2d')](_0x2a50a1);};}exports[_0xc547('0x2e')]=function(_0x2ac5d9,_0x2f091a){var _0x1cf4e7={},_0x165c60={},_0x1ec205={'count':0x0,'rows':[]};var _0x3b8e18=_[_0xc547('0x2f')](db[_0xc547('0x30')]['rawAttributes'],function(_0x22430e){return{'name':_0x22430e[_0xc547('0x31')],'type':_0x22430e['type'][_0xc547('0x32')]};});_0x165c60[_0xc547('0x33')]=_[_0xc547('0x2f')](_0x3b8e18,_0xc547('0x34'));_0x165c60[_0xc547('0x35')]=_['keys'](_0x2ac5d9[_0xc547('0x35')]);_0x165c60[_0xc547('0x36')]=_[_0xc547('0x37')](_0x165c60[_0xc547('0x33')],_0x165c60[_0xc547('0x35')]);_0x1cf4e7[_0xc547('0x38')]=_[_0xc547('0x37')](_0x165c60[_0xc547('0x33')],qs[_0xc547('0x39')](_0x2ac5d9['query'][_0xc547('0x39')]));_0x1cf4e7[_0xc547('0x38')]=_0x1cf4e7['attributes'][_0xc547('0x3a')]?_0x1cf4e7[_0xc547('0x38')]:_0x165c60['model'];if(!_0x2ac5d9[_0xc547('0x35')][_0xc547('0x3b')]('nolimit')){_0x1cf4e7[_0xc547('0x1d')]=qs[_0xc547('0x1d')](_0x2ac5d9[_0xc547('0x35')][_0xc547('0x1d')]);_0x1cf4e7[_0xc547('0x1f')]=qs[_0xc547('0x1f')](_0x2ac5d9[_0xc547('0x35')]['offset']);}_0x1cf4e7[_0xc547('0x3c')]=qs[_0xc547('0x3d')](_0x2ac5d9['query'][_0xc547('0x3d')]);_0x1cf4e7[_0xc547('0x3e')]=qs['filters'](_[_0xc547('0x3f')](_0x2ac5d9[_0xc547('0x35')],_0x165c60[_0xc547('0x36')]),_0x3b8e18);if(_0x2ac5d9['query'][_0xc547('0x40')]){_0x1cf4e7[_0xc547('0x3e')]=_[_0xc547('0x41')](_0x1cf4e7[_0xc547('0x3e')],{'$or':_['map'](_0x3b8e18,function(_0x5c1d6b){if(_0x5c1d6b['type']!==_0xc547('0x42')){var _0x19cb87={};_0x19cb87[_0x5c1d6b[_0xc547('0x34')]]={'$like':'%'+_0x2ac5d9['query']['filter']+'%'};return _0x19cb87;}})});}_0x1cf4e7=_[_0xc547('0x41')]({},_0x1cf4e7,_0x2ac5d9[_0xc547('0x43')]);var _0x2d3384={'where':_0x1cf4e7['where']};return db['ServicenowAccount']['count'](_0x2d3384)[_0xc547('0x27')](function(_0x4e75f3){_0x1ec205['count']=_0x4e75f3;if(_0x2ac5d9[_0xc547('0x35')][_0xc547('0x44')]){_0x1cf4e7[_0xc547('0x45')]=[{'all':!![]}];}return db[_0xc547('0x30')][_0xc547('0x46')](_0x1cf4e7);})['then'](function(_0x2064ae){_0x1ec205[_0xc547('0x47')]=_0x2064ae;return _0x1ec205;})[_0xc547('0x27')](respondWithFilteredResult(_0x2f091a,_0x1cf4e7))[_0xc547('0x48')](handleError(_0x2f091a,null));};exports['show']=function(_0x4d971e,_0x1e0be9){var _0x222aab={'raw':![],'where':{'id':_0x4d971e[_0xc547('0x49')]['id']}},_0x35b462={};_0x35b462[_0xc547('0x33')]=_[_0xc547('0x4a')](db['ServicenowAccount'][_0xc547('0x4b')]);_0x35b462[_0xc547('0x35')]=_[_0xc547('0x4a')](_0x4d971e['query']);_0x35b462[_0xc547('0x36')]=_['intersection'](_0x35b462[_0xc547('0x33')],_0x35b462[_0xc547('0x35')]);_0x222aab[_0xc547('0x38')]=_[_0xc547('0x37')](_0x35b462[_0xc547('0x33')],qs[_0xc547('0x39')](_0x4d971e[_0xc547('0x35')][_0xc547('0x39')]));_0x222aab[_0xc547('0x38')]=_0x222aab[_0xc547('0x38')][_0xc547('0x3a')]?_0x222aab['attributes']:_0x35b462[_0xc547('0x33')];if(_0x4d971e['query'][_0xc547('0x44')]){_0x222aab[_0xc547('0x45')]=[{'all':!![]}];}_0x222aab=_[_0xc547('0x41')]({},_0x222aab,_0x4d971e[_0xc547('0x43')]);return db[_0xc547('0x30')][_0xc547('0x4c')](_0x222aab)[_0xc547('0x27')](handleEntityNotFound(_0x1e0be9,null))[_0xc547('0x27')](respondWithResult(_0x1e0be9,null))[_0xc547('0x48')](handleError(_0x1e0be9,null));};exports[_0xc547('0x4d')]=function(_0x443c94,_0x217dc8){return db['ServicenowAccount']['create'](_0x443c94[_0xc547('0x4e')],{})[_0xc547('0x27')](respondWithResult(_0x217dc8,0xc9))[_0xc547('0x48')](handleError(_0x217dc8,null));};exports[_0xc547('0x26')]=function(_0x388b25,_0x28f63c){if(_0x388b25[_0xc547('0x4e')]['id']){delete _0x388b25[_0xc547('0x4e')]['id'];}return db[_0xc547('0x30')][_0xc547('0x4c')]({'where':{'id':_0x388b25['params']['id']}})['then'](handleEntityNotFound(_0x28f63c,null))[_0xc547('0x27')](saveUpdates(_0x388b25[_0xc547('0x4e')],null))['then'](respondWithResult(_0x28f63c,null))['catch'](handleError(_0x28f63c,null));};exports[_0xc547('0x28')]=function(_0x55382a,_0x5bdac5){return db['ServicenowAccount'][_0xc547('0x4c')]({'where':{'id':_0x55382a[_0xc547('0x49')]['id']}})[_0xc547('0x27')](handleEntityNotFound(_0x5bdac5,null))[_0xc547('0x27')](removeEntity(_0x5bdac5,null))[_0xc547('0x48')](handleError(_0x5bdac5,null));};exports['getConfigurations']=function(_0x1f13da,_0x3a5b2c,_0x51526f){var _0x4cf6de={};var _0x1cf26a={};var _0x30a6ac;var _0x4d7969;return db[_0xc547('0x30')]['findOne']({'where':{'id':_0x1f13da[_0xc547('0x49')]['id']}})[_0xc547('0x27')](handleEntityNotFound(_0x3a5b2c,null))[_0xc547('0x27')](function(_0x575ac0){if(_0x575ac0){_0x30a6ac=_0x575ac0;_0x1cf26a[_0xc547('0x33')]=_[_0xc547('0x4a')](db['ServicenowConfiguration']['rawAttributes']);_0x1cf26a[_0xc547('0x35')]=_['keys'](_0x1f13da['query']);_0x1cf26a[_0xc547('0x36')]=_['intersection'](_0x1cf26a[_0xc547('0x33')],_0x1cf26a[_0xc547('0x35')]);_0x4cf6de[_0xc547('0x38')]=_[_0xc547('0x37')](_0x1cf26a['model'],qs['fields'](_0x1f13da[_0xc547('0x35')]['fields']));_0x4cf6de[_0xc547('0x38')]=_0x4cf6de[_0xc547('0x38')][_0xc547('0x3a')]?_0x4cf6de[_0xc547('0x38')]:_0x1cf26a['model'];_0x4cf6de[_0xc547('0x3c')]=qs[_0xc547('0x3d')](_0x1f13da['query'][_0xc547('0x3d')]);_0x4cf6de[_0xc547('0x3e')]=qs[_0xc547('0x36')](_[_0xc547('0x3f')](_0x1f13da[_0xc547('0x35')],_0x1cf26a[_0xc547('0x36')]));if(_0x1f13da['query'][_0xc547('0x40')]){_0x4cf6de[_0xc547('0x3e')]=_[_0xc547('0x41')](_0x4cf6de[_0xc547('0x3e')],{'$or':_[_0xc547('0x2f')](_0x4cf6de['attributes'],function(_0x48d325){var _0x3ff14e={};_0x3ff14e[_0x48d325]={'$like':'%'+_0x1f13da[_0xc547('0x35')][_0xc547('0x40')]+'%'};return _0x3ff14e;})});}_0x4cf6de=_[_0xc547('0x41')]({},_0x4cf6de,_0x1f13da[_0xc547('0x43')]);return _0x30a6ac[_0xc547('0x4f')](_0x4cf6de);}})['then'](function(_0x360d60){if(_0x360d60){_0x4d7969=_0x360d60[_0xc547('0x3a')];if(!_0x1f13da[_0xc547('0x35')][_0xc547('0x3b')](_0xc547('0x50'))){_0x4cf6de[_0xc547('0x1d')]=qs[_0xc547('0x1d')](_0x1f13da[_0xc547('0x35')][_0xc547('0x1d')]);_0x4cf6de[_0xc547('0x1f')]=qs[_0xc547('0x1f')](_0x1f13da[_0xc547('0x35')][_0xc547('0x1f')]);}return _0x30a6ac[_0xc547('0x4f')](_0x4cf6de);}})[_0xc547('0x27')](function(_0x522d69){if(_0x522d69){return _0x522d69?{'count':_0x4d7969,'rows':_0x522d69}:null;}})['then'](respondWithResult(_0x3a5b2c,null))[_0xc547('0x48')](handleError(_0x3a5b2c,null));};exports['addConfiguration']=function(_0x14a7d6,_0x43e00d,_0x335224){if(_0x14a7d6['body']['id']){delete _0x14a7d6[_0xc547('0x4e')]['id'];}return db[_0xc547('0x30')]['findOne']({'where':{'id':_0x14a7d6['params']['id']}})[_0xc547('0x27')](handleEntityNotFound(_0x43e00d,null))[_0xc547('0x27')](function(_0x59baa9){if(_0x59baa9){_0x14a7d6['body'][_0xc547('0x51')]=_0x59baa9['id'];_0x14a7d6[_0xc547('0x4e')][_0xc547('0x52')]=integrations['getSubjects'](_0x14a7d6[_0xc547('0x4e')][_0xc547('0x53')],_0x14a7d6[_0xc547('0x4e')]['type']);_0x14a7d6['body'][_0xc547('0x54')]=integrations[_0xc547('0x55')](_0x14a7d6[_0xc547('0x4e')][_0xc547('0x53')],_0x14a7d6[_0xc547('0x4e')][_0xc547('0x56')]);return db[_0xc547('0x57')][_0xc547('0x4d')](_0x14a7d6[_0xc547('0x4e')],{'include':[{'model':db[_0xc547('0x58')],'as':_0xc547('0x52')},{'model':db[_0xc547('0x58')],'as':_0xc547('0x54')}]});}return null;})[_0xc547('0x27')](respondWithResult(_0x43e00d,null))[_0xc547('0x48')](handleError(_0x43e00d,null));};exports[_0xc547('0x59')]=function(_0x457a06,_0x2c948e,_0x204e25){var _0x1c09d8=['made_sla','hold_reason',_0xc547('0x5a'),_0xc547('0x5b'),_0xc547('0x5c'),'notify',_0xc547('0x5d'),_0xc547('0x5e'),'category'];var _0x3d3903=['parent',_0xc547('0x5f'),_0xc547('0x60'),'watch_list',_0xc547('0x61'),_0xc547('0x62'),_0xc547('0x63'),'hold_reason',_0xc547('0x64'),'number','resolved_by','sys_updated_by',_0xc547('0x65'),_0xc547('0x66'),'sys_created_on',_0xc547('0x67'),'state',_0xc547('0x68'),_0xc547('0x5a'),_0xc547('0x3c'),_0xc547('0x69'),_0xc547('0x6a'),'cmdb_ci',_0xc547('0x6b'),_0xc547('0x6c'),'active','work_notes_list',_0xc547('0x6d'),_0xc547('0x6e'),_0xc547('0x6f'),_0xc547('0x70'),_0xc547('0x71'),_0xc547('0x72'),_0xc547('0x73'),_0xc547('0x74'),_0xc547('0x75'),_0xc547('0x76'),'reopened_time',_0xc547('0x77'),_0xc547('0x78'),'approval_set','subcategory',_0xc547('0x79'),_0xc547('0x7a'),_0xc547('0x5c'),_0xc547('0x7b'),'delivery_task','work_start',_0xc547('0x7c'),_0xc547('0x7d'),_0xc547('0x7e'),_0xc547('0x7f'),_0xc547('0x80'),_0xc547('0x81'),_0xc547('0x82'),_0xc547('0x83'),_0xc547('0x84'),_0xc547('0x85'),_0xc547('0x86'),'sys_id',_0xc547('0x87'),'reopened_by',_0xc547('0x5d'),'urgency',_0xc547('0x88'),_0xc547('0x89'),_0xc547('0x8a'),_0xc547('0x8b'),_0xc547('0x8c'),'severity',_0xc547('0x8d'),_0xc547('0x8e'),_0xc547('0x8f'),'comments_and_work_notes','due_date',_0xc547('0x90'),'reopen_count',_0xc547('0x91'),_0xc547('0x92'),_0xc547('0x93'),_0xc547('0x94'),_0xc547('0x95'),_0xc547('0x96')];var _0x4de84e='';var _0x324222='';var _0x375183=[];var _0x127dad='';var _0x42f1aa='';var _0xcfbaeb=[];var _0x55295f='';var _0x43bdfe='';var _0x950be7={};var _0x153a54='';return db['ServicenowAccount'][_0xc547('0x97')]({'where':{'id':_0x457a06[_0xc547('0x49')]['id']},'attributes':['id',_0xc547('0x98'),_0xc547('0x99'),_0xc547('0x9a'),_0xc547('0x9b'),_0xc547('0x9c')]})['then'](handleEntityNotFound(_0x2c948e,null))['then'](function(_0x3de985){if(_0x3de985){_0x153a54=_0x3de985[_0xc547('0x9b')];var _0xf325ca=_0x153a54[_0xc547('0x9d')](-0x1);if(_0xf325ca==='/'){_0x153a54=_0x153a54[_0xc547('0x9e')](0x0,_0x153a54['lastIndexOf'](_0xf325ca));}_0x43bdfe=util[_0xc547('0x9f')]('%s/api/now/doc/table/schema/',_0x153a54);_0x55295f=util[_0xc547('0x9f')]('%s/api/now/table/',_0x153a54);_0x950be7={'user':_0x3de985[_0xc547('0x98')],'pass':_0x3de985[_0xc547('0x99')]};var _0x5160cf={'method':_0xc547('0xa0'),'uri':_0x43bdfe+_0xc547('0xa1'),'auth':_0x950be7,'json':!![]};return rp(_0x5160cf);}})[_0xc547('0x27')](function(_0x293b5d){if(_0x293b5d[_0xc547('0xa2')][_0xc547('0x3a')]>0x0){_0x4de84e=_0x293b5d['result'];}console[_0xc547('0xa3')]('incident\x20table\x20objects',_0x4de84e);_0xcfbaeb=[];_0x324222=Object[_0xc547('0xa4')]([],_0x4de84e);_['remove'](_0x324222,function(_0x2c83c){return!_0x1c09d8[_0xc547('0xa5')](_0x2c83c[_0xc547('0x34')]);});_0x324222['forEach'](function(_0xeb17b3){var _0x284d5d=createFieldObject(_0x55295f,_0x950be7,_0xeb17b3[_0xc547('0xa6')],_0xeb17b3['name'],_0xeb17b3[_0xc547('0xa7')],![]);_0xcfbaeb[_0xc547('0xa8')](_0x284d5d);});return Promise[_0xc547('0xa9')](_0xcfbaeb);})[_0xc547('0x27')](function(_0x313eb9){_0x375183=_0x313eb9;_0x127dad=Object[_0xc547('0xa4')]([],_0x4de84e);console[_0xc547('0xa3')](_0xc547('0xaa'),_0x4de84e);_[_0xc547('0xab')](_0x127dad,function(_0xcb633a){return _0x3d3903['includes'](_0xcb633a['name']);});console[_0xc547('0xa3')](_0xc547('0xac'),_0x127dad);_0xcfbaeb=[];_0x127dad[_0xc547('0xad')](function(_0x1750c9){var _0xfa9df2=createFieldObject(_0x55295f,_0x950be7,_0x1750c9[_0xc547('0xa6')],_0x1750c9[_0xc547('0x34')],_0x1750c9[_0xc547('0xa7')],!![]);_0xcfbaeb[_0xc547('0xa8')](_0xfa9df2);});return Promise[_0xc547('0xa9')](_0xcfbaeb);})[_0xc547('0x27')](function(_0x21a480){_0x42f1aa=_0x21a480;var _0xc100f0=_0x375183[_0xc547('0xae')](_0x42f1aa);return{'count':_0xc100f0['length'],'rows':_0xc100f0};})[_0xc547('0x27')](respondWithResult(_0x2c948e,null))[_0xc547('0x48')](function(_0x233c7a){console['log'](_0xc547('0xaf')+_0x233c7a);var _0x162de9=_0x457a06[_0xc547('0x35')][_0xc547('0xb0')]?0x1f4:_0x233c7a[_0xc547('0xb1')]||0x1f4;logger[_0xc547('0x2b')](_0x233c7a[_0xc547('0x2c')]);delete _0x233c7a[_0xc547('0x34')];if(_0x162de9===0x191){_0x162de9=0x190;}_0x2c948e[_0xc547('0x29')](_0x162de9)[_0xc547('0x2d')](_0x457a06[_0xc547('0x35')]['test']?{'message':_0xc547('0xb2'),'statusCode':_0x233c7a[_0xc547('0xb1')]}:_0x233c7a);});};function createFieldObject(_0x253c3b,_0x184bf9,_0x276d3e,_0x5d5b35,_0x1314a5,_0x4ff6a7){return new Promise(function(_0x38f052,_0x3dd319){var _0x2dcbe5={'id':_0x5d5b35,'name':_0x1314a5,'custom':_0x4ff6a7};if(_0x276d3e===_0xc547('0xb3')){_0x2dcbe5[_0xc547('0x43')]=[{'name':_0xc547('0xb4'),'value':_0xc547('0xb5')},{'name':_0xc547('0xb6'),'value':_0xc547('0xb7')}];_0x38f052(_0x2dcbe5);}else{var _0xb6d290={'method':_0xc547('0xa0'),'uri':_0x253c3b+_0xc547('0xb8')+_0x5d5b35,'auth':_0x184bf9,'json':!![]};return rp(_0xb6d290)[_0xc547('0x27')](function(_0x493a3c){var _0x58be8b=[];if(_0x493a3c['result']['length']>0x0){_0x493a3c[_0xc547('0xa2')][_0xc547('0xad')](function(_0xb3ecd1){if(_0xb3ecd1[_0xc547('0xb9')]==='false'){var _0x43e54c={'name':_0xb3ecd1[_0xc547('0xa7')],'value':_0xb3ecd1[_0xc547('0xba')]};_0x58be8b[_0xc547('0xa8')](_0x43e54c);}});}_0x2dcbe5[_0xc547('0x43')]=_0x58be8b;if(_0x2dcbe5[_0xc547('0x43')][_0xc547('0x3a')]>0x0){_0x38f052(_0x2dcbe5);}else{if(_0x4ff6a7==![]){_0x38f052();}else{_0x38f052(_0x2dcbe5);}}});}});} \ No newline at end of file +var _0x62be=['VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','catch','params','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','closed_at','cmdb_ci','delivery_plan','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','escalation','correlation_id','location','username','email','remoteUri','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','assign','includes','internalType','label','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','True','true','sys_choice?sysparm_query=name=incident^element=','false','value','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type'];(function(_0x52b52f,_0x447c49){var _0x596a28=function(_0x5d75ce){while(--_0x5d75ce){_0x52b52f['push'](_0x52b52f['shift']());}};_0x596a28(++_0x447c49);}(_0x62be,0x7f));var _0xe62b=function(_0x2e1a04,_0x2e1e41){_0x2e1a04=_0x2e1a04-0x0;var _0x1ccb80=_0x62be[_0x2e1a04];return _0x1ccb80;};'use strict';var emlformat=require(_0xe62b('0x0'));var rimraf=require(_0xe62b('0x1'));var zipdir=require(_0xe62b('0x2'));var jsonpatch=require(_0xe62b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe62b('0x4'));var Mustache=require(_0xe62b('0x5'));var util=require(_0xe62b('0x6'));var path=require(_0xe62b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe62b('0x8'));var fs=require('fs');var fs_extra=require(_0xe62b('0x9'));var _=require('lodash');var squel=require(_0xe62b('0xa'));var crypto=require('crypto');var jsforce=require(_0xe62b('0xb'));var deskjs=require(_0xe62b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe62b('0xd'));var Papa=require('papaparse');var Redis=require(_0xe62b('0xe'));var authService=require(_0xe62b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe62b('0x10'));var hardwareService=require(_0xe62b('0x11'));var logger=require('../../config/logger')(_0xe62b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe62b('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe62b('0x14'));function respondWithStatusCode(_0x97092c,_0x3f0b5d){_0x3f0b5d=_0x3f0b5d||0xcc;return function(_0x1c8806){if(_0x1c8806){return _0x97092c[_0xe62b('0x15')](_0x3f0b5d);}return _0x97092c[_0xe62b('0x16')](_0x3f0b5d)['end']();};}function respondWithResult(_0x4e95ac,_0x5d335f){_0x5d335f=_0x5d335f||0xc8;return function(_0x5378cb){if(_0x5378cb){return _0x4e95ac['status'](_0x5d335f)[_0xe62b('0x17')](_0x5378cb);}};}function respondWithFilteredResult(_0x4f8f51,_0x1554c5){return function(_0x1e4a09){if(_0x1e4a09){var _0x3f52e1=typeof _0x1554c5[_0xe62b('0x18')]===_0xe62b('0x19')&&typeof _0x1554c5[_0xe62b('0x1a')]===_0xe62b('0x19');var _0x2bdf55=_0x1e4a09[_0xe62b('0x1b')];var _0x4582d0=_0x3f52e1?0x0:_0x1554c5[_0xe62b('0x18')];var _0x859444=_0x3f52e1?_0x1e4a09['count']:_0x1554c5[_0xe62b('0x18')]+_0x1554c5['limit'];var _0x280b39;if(_0x859444>=_0x2bdf55){_0x859444=_0x2bdf55;_0x280b39=0xc8;}else{_0x280b39=0xce;}_0x4f8f51['status'](_0x280b39);return _0x4f8f51[_0xe62b('0x1c')](_0xe62b('0x1d'),_0x4582d0+'-'+_0x859444+'/'+_0x2bdf55)[_0xe62b('0x17')](_0x1e4a09);}return null;};}function patchUpdates(_0x4e8eb7){return function(_0x49be80){try{jsonpatch['apply'](_0x49be80,_0x4e8eb7,!![]);}catch(_0x34e03d){return BPromise['reject'](_0x34e03d);}return _0x49be80['save']();};}function saveUpdates(_0x2d0780,_0x1ab229){return function(_0x4eeff3){if(_0x4eeff3){return _0x4eeff3['update'](_0x2d0780)[_0xe62b('0x1e')](function(_0x461c40){return _0x461c40;});}return null;};}function removeEntity(_0x58c2ae,_0x77e356){return function(_0x21b227){if(_0x21b227){return _0x21b227[_0xe62b('0x1f')]()['then'](function(){_0x58c2ae[_0xe62b('0x16')](0xcc)[_0xe62b('0x20')]();});}};}function handleEntityNotFound(_0x37de3e,_0x162884){return function(_0x3dfc68){if(!_0x3dfc68){_0x37de3e['sendStatus'](0x194);}return _0x3dfc68;};}function handleError(_0x26d054,_0xd2c1fd){_0xd2c1fd=_0xd2c1fd||0x1f4;return function(_0x45a594){logger[_0xe62b('0x21')](_0x45a594['stack']);if(_0x45a594[_0xe62b('0x22')]){delete _0x45a594[_0xe62b('0x22')];}_0x26d054[_0xe62b('0x16')](_0xd2c1fd)[_0xe62b('0x23')](_0x45a594);};}exports['index']=function(_0x12f26d,_0x1b8f68){var _0x2c6911={},_0x57377b={},_0x7c20f4={'count':0x0,'rows':[]};var _0x3fcbc0=_[_0xe62b('0x24')](db['ServicenowAccount'][_0xe62b('0x25')],function(_0x1eaefe){return{'name':_0x1eaefe[_0xe62b('0x26')],'type':_0x1eaefe['type'][_0xe62b('0x27')]};});_0x57377b[_0xe62b('0x28')]=_[_0xe62b('0x24')](_0x3fcbc0,_0xe62b('0x22'));_0x57377b[_0xe62b('0x29')]=_[_0xe62b('0x2a')](_0x12f26d[_0xe62b('0x29')]);_0x57377b[_0xe62b('0x2b')]=_[_0xe62b('0x2c')](_0x57377b[_0xe62b('0x28')],_0x57377b['query']);_0x2c6911[_0xe62b('0x2d')]=_[_0xe62b('0x2c')](_0x57377b['model'],qs[_0xe62b('0x2e')](_0x12f26d[_0xe62b('0x29')][_0xe62b('0x2e')]));_0x2c6911[_0xe62b('0x2d')]=_0x2c6911[_0xe62b('0x2d')][_0xe62b('0x2f')]?_0x2c6911[_0xe62b('0x2d')]:_0x57377b[_0xe62b('0x28')];if(!_0x12f26d[_0xe62b('0x29')][_0xe62b('0x30')]('nolimit')){_0x2c6911[_0xe62b('0x1a')]=qs[_0xe62b('0x1a')](_0x12f26d[_0xe62b('0x29')][_0xe62b('0x1a')]);_0x2c6911[_0xe62b('0x18')]=qs['offset'](_0x12f26d['query'][_0xe62b('0x18')]);}_0x2c6911['order']=qs['sort'](_0x12f26d[_0xe62b('0x29')][_0xe62b('0x31')]);_0x2c6911['where']=qs['filters'](_[_0xe62b('0x32')](_0x12f26d['query'],_0x57377b[_0xe62b('0x2b')]),_0x3fcbc0);if(_0x12f26d['query'][_0xe62b('0x33')]){_0x2c6911[_0xe62b('0x34')]=_[_0xe62b('0x35')](_0x2c6911['where'],{'$or':_[_0xe62b('0x24')](_0x3fcbc0,function(_0x1b8d78){if(_0x1b8d78[_0xe62b('0x36')]!==_0xe62b('0x37')){var _0x2d0da3={};_0x2d0da3[_0x1b8d78['name']]={'$like':'%'+_0x12f26d[_0xe62b('0x29')][_0xe62b('0x33')]+'%'};return _0x2d0da3;}})});}_0x2c6911=_[_0xe62b('0x35')]({},_0x2c6911,_0x12f26d[_0xe62b('0x38')]);var _0x54c8d0={'where':_0x2c6911[_0xe62b('0x34')]};return db[_0xe62b('0x39')][_0xe62b('0x1b')](_0x54c8d0)['then'](function(_0x152793){_0x7c20f4[_0xe62b('0x1b')]=_0x152793;if(_0x12f26d[_0xe62b('0x29')][_0xe62b('0x3a')]){_0x2c6911[_0xe62b('0x3b')]=[{'all':!![]}];}return db[_0xe62b('0x39')][_0xe62b('0x3c')](_0x2c6911);})[_0xe62b('0x1e')](function(_0xa10d23){_0x7c20f4['rows']=_0xa10d23;return _0x7c20f4;})[_0xe62b('0x1e')](respondWithFilteredResult(_0x1b8f68,_0x2c6911))[_0xe62b('0x3d')](handleError(_0x1b8f68,null));};exports['show']=function(_0xeee056,_0x2b2225){var _0x448357={'raw':![],'where':{'id':_0xeee056[_0xe62b('0x3e')]['id']}},_0x41bdc4={};_0x41bdc4[_0xe62b('0x28')]=_[_0xe62b('0x2a')](db[_0xe62b('0x39')][_0xe62b('0x25')]);_0x41bdc4['query']=_[_0xe62b('0x2a')](_0xeee056[_0xe62b('0x29')]);_0x41bdc4['filters']=_['intersection'](_0x41bdc4['model'],_0x41bdc4[_0xe62b('0x29')]);_0x448357['attributes']=_[_0xe62b('0x2c')](_0x41bdc4[_0xe62b('0x28')],qs[_0xe62b('0x2e')](_0xeee056['query'][_0xe62b('0x2e')]));_0x448357[_0xe62b('0x2d')]=_0x448357[_0xe62b('0x2d')][_0xe62b('0x2f')]?_0x448357[_0xe62b('0x2d')]:_0x41bdc4[_0xe62b('0x28')];if(_0xeee056[_0xe62b('0x29')][_0xe62b('0x3a')]){_0x448357[_0xe62b('0x3b')]=[{'all':!![]}];}_0x448357=_[_0xe62b('0x35')]({},_0x448357,_0xeee056[_0xe62b('0x38')]);return db['ServicenowAccount'][_0xe62b('0x3f')](_0x448357)[_0xe62b('0x1e')](handleEntityNotFound(_0x2b2225,null))[_0xe62b('0x1e')](respondWithResult(_0x2b2225,null))['catch'](handleError(_0x2b2225,null));};exports[_0xe62b('0x40')]=function(_0x52dd6f,_0x1669a1){return db[_0xe62b('0x39')]['create'](_0x52dd6f[_0xe62b('0x41')],{})[_0xe62b('0x1e')](respondWithResult(_0x1669a1,0xc9))[_0xe62b('0x3d')](handleError(_0x1669a1,null));};exports[_0xe62b('0x42')]=function(_0x42c95b,_0x3c6734){if(_0x42c95b[_0xe62b('0x41')]['id']){delete _0x42c95b['body']['id'];}return db['ServicenowAccount'][_0xe62b('0x3f')]({'where':{'id':_0x42c95b[_0xe62b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3c6734,null))[_0xe62b('0x1e')](saveUpdates(_0x42c95b[_0xe62b('0x41')],null))[_0xe62b('0x1e')](respondWithResult(_0x3c6734,null))[_0xe62b('0x3d')](handleError(_0x3c6734,null));};exports[_0xe62b('0x1f')]=function(_0x2b2895,_0x15cf82){return db[_0xe62b('0x39')][_0xe62b('0x3f')]({'where':{'id':_0x2b2895['params']['id']}})[_0xe62b('0x1e')](handleEntityNotFound(_0x15cf82,null))[_0xe62b('0x1e')](removeEntity(_0x15cf82,null))[_0xe62b('0x3d')](handleError(_0x15cf82,null));};exports[_0xe62b('0x43')]=function(_0x5871f0,_0x372345,_0x4b869c){var _0x578ff8={};var _0x34afe3={};var _0x232210;var _0x369cbc;return db[_0xe62b('0x39')][_0xe62b('0x44')]({'where':{'id':_0x5871f0['params']['id']}})['then'](handleEntityNotFound(_0x372345,null))[_0xe62b('0x1e')](function(_0x7c384f){if(_0x7c384f){_0x232210=_0x7c384f;_0x34afe3[_0xe62b('0x28')]=_['keys'](db[_0xe62b('0x45')][_0xe62b('0x25')]);_0x34afe3['query']=_[_0xe62b('0x2a')](_0x5871f0['query']);_0x34afe3['filters']=_['intersection'](_0x34afe3[_0xe62b('0x28')],_0x34afe3[_0xe62b('0x29')]);_0x578ff8[_0xe62b('0x2d')]=_['intersection'](_0x34afe3['model'],qs['fields'](_0x5871f0[_0xe62b('0x29')][_0xe62b('0x2e')]));_0x578ff8['attributes']=_0x578ff8[_0xe62b('0x2d')]['length']?_0x578ff8[_0xe62b('0x2d')]:_0x34afe3[_0xe62b('0x28')];_0x578ff8[_0xe62b('0x46')]=qs[_0xe62b('0x31')](_0x5871f0[_0xe62b('0x29')]['sort']);_0x578ff8[_0xe62b('0x34')]=qs['filters'](_[_0xe62b('0x32')](_0x5871f0['query'],_0x34afe3[_0xe62b('0x2b')]));if(_0x5871f0[_0xe62b('0x29')][_0xe62b('0x33')]){_0x578ff8[_0xe62b('0x34')]=_[_0xe62b('0x35')](_0x578ff8[_0xe62b('0x34')],{'$or':_[_0xe62b('0x24')](_0x578ff8[_0xe62b('0x2d')],function(_0x3cac14){var _0x4e1db3={};_0x4e1db3[_0x3cac14]={'$like':'%'+_0x5871f0[_0xe62b('0x29')][_0xe62b('0x33')]+'%'};return _0x4e1db3;})});}_0x578ff8=_[_0xe62b('0x35')]({},_0x578ff8,_0x5871f0[_0xe62b('0x38')]);return _0x232210['getConfigurations'](_0x578ff8);}})[_0xe62b('0x1e')](function(_0x203ce9){if(_0x203ce9){_0x369cbc=_0x203ce9[_0xe62b('0x2f')];if(!_0x5871f0[_0xe62b('0x29')][_0xe62b('0x30')](_0xe62b('0x47'))){_0x578ff8['limit']=qs[_0xe62b('0x1a')](_0x5871f0[_0xe62b('0x29')][_0xe62b('0x1a')]);_0x578ff8['offset']=qs[_0xe62b('0x18')](_0x5871f0[_0xe62b('0x29')][_0xe62b('0x18')]);}return _0x232210['getConfigurations'](_0x578ff8);}})['then'](function(_0x19af9a){if(_0x19af9a){return _0x19af9a?{'count':_0x369cbc,'rows':_0x19af9a}:null;}})[_0xe62b('0x1e')](respondWithResult(_0x372345,null))['catch'](handleError(_0x372345,null));};exports[_0xe62b('0x48')]=function(_0x270837,_0x4698ea,_0x54e018){if(_0x270837['body']['id']){delete _0x270837[_0xe62b('0x41')]['id'];}return db[_0xe62b('0x39')][_0xe62b('0x44')]({'where':{'id':_0x270837[_0xe62b('0x3e')]['id']}})[_0xe62b('0x1e')](handleEntityNotFound(_0x4698ea,null))[_0xe62b('0x1e')](function(_0x2d6544){if(_0x2d6544){_0x270837[_0xe62b('0x41')][_0xe62b('0x49')]=_0x2d6544['id'];_0x270837[_0xe62b('0x41')][_0xe62b('0x4a')]=integrations[_0xe62b('0x4b')](_0x270837[_0xe62b('0x41')][_0xe62b('0x4c')],_0x270837[_0xe62b('0x41')][_0xe62b('0x36')]);_0x270837[_0xe62b('0x41')]['Descriptions']=integrations[_0xe62b('0x4d')](_0x270837['body'][_0xe62b('0x4c')],_0x270837[_0xe62b('0x41')][_0xe62b('0x36')]);return db[_0xe62b('0x45')][_0xe62b('0x40')](_0x270837[_0xe62b('0x41')],{'include':[{'model':db[_0xe62b('0x4e')],'as':_0xe62b('0x4a')},{'model':db[_0xe62b('0x4e')],'as':_0xe62b('0x4f')}]});}return null;})['then'](respondWithResult(_0x4698ea,null))[_0xe62b('0x3d')](handleError(_0x4698ea,null));};exports[_0xe62b('0x50')]=function(_0x528be0,_0xdfc901,_0xe5f4e){var _0x456159=['made_sla',_0xe62b('0x51'),_0xe62b('0x52'),'subcategory',_0xe62b('0x53'),_0xe62b('0x54'),_0xe62b('0x55'),_0xe62b('0x56'),_0xe62b('0x57')];var _0x31565b=[_0xe62b('0x58'),_0xe62b('0x59'),_0xe62b('0x5a'),_0xe62b('0x5b'),_0xe62b('0x5c'),_0xe62b('0x5d'),_0xe62b('0x5e'),_0xe62b('0x51'),_0xe62b('0x5f'),_0xe62b('0x60'),_0xe62b('0x61'),'sys_updated_by',_0xe62b('0x62'),'user_input',_0xe62b('0x63'),_0xe62b('0x64'),_0xe62b('0x65'),'sys_created_by',_0xe62b('0x52'),_0xe62b('0x46'),'calendar_stc',_0xe62b('0x66'),_0xe62b('0x67'),_0xe62b('0x68'),'impact','active',_0xe62b('0x69'),_0xe62b('0x6a'),'priority',_0xe62b('0x6b'),_0xe62b('0x6c'),_0xe62b('0x6d'),_0xe62b('0x6e'),_0xe62b('0x6f'),_0xe62b('0x70'),'group_list',_0xe62b('0x71'),_0xe62b('0x72'),'resolved_at','caller_id',_0xe62b('0x73'),_0xe62b('0x74'),_0xe62b('0x75'),_0xe62b('0x76'),_0xe62b('0x53'),_0xe62b('0x77'),_0xe62b('0x78'),_0xe62b('0x79'),_0xe62b('0x7a'),'business_stc',_0xe62b('0x7b'),_0xe62b('0x7c'),_0xe62b('0x7d'),_0xe62b('0x54'),_0xe62b('0x7e'),_0xe62b('0x7f'),_0xe62b('0x80'),_0xe62b('0x81'),_0xe62b('0x82'),_0xe62b('0x83'),'contact_type',_0xe62b('0x84'),'incident_state','urgency',_0xe62b('0x85'),_0xe62b('0x86'),_0xe62b('0x87'),_0xe62b('0x88'),_0xe62b('0x89'),'severity',_0xe62b('0x8a'),_0xe62b('0x8b'),_0xe62b('0x8c'),_0xe62b('0x8d'),_0xe62b('0x8e'),_0xe62b('0x8f'),'reopen_count','sys_tags',_0xe62b('0x90'),'upon_approval',_0xe62b('0x91'),_0xe62b('0x92'),'category'];var _0x421088='';var _0x264e72='';var _0x3166af=[];var _0x4d5b97='';var _0x5a9daf='';var _0x42f1bb=[];var _0x35d6ce='';var _0x44ae98='';var _0x5b0975={};var _0x4584f1='';return db[_0xe62b('0x39')][_0xe62b('0x44')]({'where':{'id':_0x528be0[_0xe62b('0x3e')]['id']},'attributes':['id',_0xe62b('0x93'),'password',_0xe62b('0x94'),_0xe62b('0x95'),_0xe62b('0x96')]})[_0xe62b('0x1e')](handleEntityNotFound(_0xdfc901,null))['then'](function(_0x3f048c){if(_0x3f048c){_0x4584f1=_0x3f048c[_0xe62b('0x95')];var _0x50534a=_0x4584f1[_0xe62b('0x97')](-0x1);if(_0x50534a==='/'){_0x4584f1=_0x4584f1['substring'](0x0,_0x4584f1[_0xe62b('0x98')](_0x50534a));}_0x44ae98=util['format'](_0xe62b('0x99'),_0x4584f1);_0x35d6ce=util['format'](_0xe62b('0x9a'),_0x4584f1);_0x5b0975={'user':_0x3f048c[_0xe62b('0x93')],'pass':_0x3f048c[_0xe62b('0x9b')]};var _0x1056d2={'method':_0xe62b('0x9c'),'uri':_0x44ae98+'incident?sysparm_display_value=all','auth':_0x5b0975,'json':!![]};return rp(_0x1056d2);}})['then'](function(_0x22e642){if(_0x22e642[_0xe62b('0x9d')][_0xe62b('0x2f')]>0x0){_0x421088=_0x22e642[_0xe62b('0x9d')];}console[_0xe62b('0x9e')](_0xe62b('0x9f'),_0x421088);_0x42f1bb=[];_0x264e72=Object[_0xe62b('0xa0')]([],_0x421088);_['remove'](_0x264e72,function(_0x31fb1c){return!_0x456159[_0xe62b('0xa1')](_0x31fb1c[_0xe62b('0x22')]);});_0x264e72['forEach'](function(_0xd11838){var _0x4b9c1d=createFieldObject(_0x35d6ce,_0x5b0975,_0xd11838[_0xe62b('0xa2')],_0xd11838['name'],_0xd11838[_0xe62b('0xa3')],![]);_0x42f1bb['push'](_0x4b9c1d);});return Promise[_0xe62b('0xa4')](_0x42f1bb);})[_0xe62b('0x1e')](function(_0x58beaa){_0x3166af=_0x58beaa;_0x4d5b97=Object['assign']([],_0x421088);console['log'](_0xe62b('0xa5'),_0x421088);_[_0xe62b('0xa6')](_0x4d5b97,function(_0x42fa7a){return _0x31565b[_0xe62b('0xa1')](_0x42fa7a[_0xe62b('0x22')]);});console[_0xe62b('0x9e')](_0xe62b('0xa7'),_0x4d5b97);_0x42f1bb=[];_0x4d5b97[_0xe62b('0xa8')](function(_0x254a7a){var _0x142fb2=createFieldObject(_0x35d6ce,_0x5b0975,_0x254a7a['internalType'],_0x254a7a[_0xe62b('0x22')],_0x254a7a[_0xe62b('0xa3')],!![]);_0x42f1bb['push'](_0x142fb2);});return Promise[_0xe62b('0xa4')](_0x42f1bb);})[_0xe62b('0x1e')](function(_0x50b7ad){_0x5a9daf=_0x50b7ad;var _0x204ae2=_0x3166af[_0xe62b('0xa9')](_0x5a9daf);return{'count':_0x204ae2[_0xe62b('0x2f')],'rows':_0x204ae2};})['then'](respondWithResult(_0xdfc901,null))['catch'](function(_0x396588){console['log'](_0xe62b('0xaa')+_0x396588);var _0x53468b=_0x528be0['query'][_0xe62b('0xab')]?0x1f4:_0x396588['statusCode']||0x1f4;logger[_0xe62b('0x21')](_0x396588[_0xe62b('0xac')]);delete _0x396588[_0xe62b('0x22')];if(_0x53468b===0x191){_0x53468b=0x190;}_0xdfc901['status'](_0x53468b)[_0xe62b('0x23')](_0x528be0[_0xe62b('0x29')]['test']?{'message':_0xe62b('0xad'),'statusCode':_0x396588[_0xe62b('0xae')]}:_0x396588);});};function createFieldObject(_0x28210d,_0x47c7b5,_0x47a586,_0x4d0768,_0x27aebf,_0x152a98){return new Promise(function(_0x28ed1e,_0x3b836a){var _0x541182={'id':_0x4d0768,'name':_0x27aebf,'custom':_0x152a98};if(_0x47a586===_0xe62b('0xaf')){_0x541182[_0xe62b('0x38')]=[{'name':_0xe62b('0xb0'),'value':_0xe62b('0xb1')},{'name':'False','value':'false'}];_0x28ed1e(_0x541182);}else{var _0x6ec87a={'method':_0xe62b('0x9c'),'uri':_0x28210d+_0xe62b('0xb2')+_0x4d0768,'auth':_0x47c7b5,'json':!![]};return rp(_0x6ec87a)[_0xe62b('0x1e')](function(_0x9959a9){var _0x3770fd=[];if(_0x9959a9[_0xe62b('0x9d')]['length']>0x0){_0x9959a9[_0xe62b('0x9d')][_0xe62b('0xa8')](function(_0x2166b7){if(_0x2166b7['inactive']===_0xe62b('0xb3')){var _0x2c94fe={'name':_0x2166b7['label'],'value':_0x2166b7[_0xe62b('0xb4')]};_0x3770fd[_0xe62b('0xb5')](_0x2c94fe);}});}_0x541182['options']=_0x3770fd;if(_0x541182[_0xe62b('0x38')][_0xe62b('0x2f')]>0x0){_0x28ed1e(_0x541182);}else{if(_0x152a98==![]){_0x28ed1e();}else{_0x28ed1e(_0x541182);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1e7a61d..ab72799 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 _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x16a013,_0x518fdd){var _0x5c7fdb=function(_0x635253){while(--_0x635253){_0x16a013['push'](_0x16a013['shift']());}};_0x5c7fdb(++_0x518fdd);}(_0xb138,0x1dd));var _0x8b13=function(_0x350213,_0x5d71f8){_0x350213=_0x350213-0x0;var _0x3fcae2=_0xb138[_0x350213];return _0x3fcae2;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x326f,0xd1));var _0xf326=function(_0x57e553,_0x4d0947){_0x57e553=_0x57e553-0x0;var _0x553c54=_0x326f[_0x57e553];return _0x553c54;};'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'));var integrations=require(_0xf326('0x9'));module[_0xf326('0xa')]=function(_0x4c2249,_0x3c254d){return _0x4c2249[_0xf326('0xb')](_0xf326('0xc'),attributes,{'tableName':_0xf326('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index bcd1350..f4f9f82 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 _0xf48d=['stringify','error','code','message','result','ServicenowAccount','options','raw','where','attributes','map','include','model','GetServicenowAccount','catch','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b4b01,_0x5a6c91){var _0x49745e=function(_0x2013f6){while(--_0x2013f6){_0x4b4b01['push'](_0x4b4b01['shift']());}};_0x49745e(++_0x5a6c91);}(_0xf48d,0xc0));var _0xdf48=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0xf48d[_0x4d45c1];return _0x244478;};'use strict';var _=require('lodash');var util=require(_0xdf48('0x0'));var moment=require(_0xdf48('0x1'));var BPromise=require(_0xdf48('0x2'));var rs=require(_0xdf48('0x3'));var fs=require('fs');var Redis=require(_0xdf48('0x4'));var db=require(_0xdf48('0x5'))['db'];var utils=require(_0xdf48('0x6'));var logger=require('../../config/logger')(_0xdf48('0x7'));var config=require(_0xdf48('0x8'));var jayson=require(_0xdf48('0x9'));var client=jayson[_0xdf48('0xa')][_0xdf48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a93ba,_0x3944b0,_0x28ea63){return new BPromise(function(_0x81a6a0,_0x506699){return client[_0xdf48('0xc')](_0x3a93ba,_0x28ea63)[_0xdf48('0xd')](function(_0x375900){logger[_0xdf48('0xe')](_0xdf48('0xf'),_0x3944b0,_0xdf48('0x10'));logger[_0xdf48('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3944b0,_0xdf48('0x10'),JSON[_0xdf48('0x12')](_0x375900));if(_0x375900[_0xdf48('0x13')]){if(_0x375900[_0xdf48('0x13')][_0xdf48('0x14')]===0x1f4){logger[_0xdf48('0x13')](_0xdf48('0xf'),_0x3944b0,_0x375900[_0xdf48('0x13')][_0xdf48('0x15')]);return _0x506699(_0x375900[_0xdf48('0x13')][_0xdf48('0x15')]);}logger[_0xdf48('0x13')](_0xdf48('0xf'),_0x3944b0,_0x375900['error'][_0xdf48('0x15')]);return _0x81a6a0(_0x375900[_0xdf48('0x13')]['message']);}else{logger[_0xdf48('0xe')](_0xdf48('0xf'),_0x3944b0,_0xdf48('0x10'));_0x81a6a0(_0x375900[_0xdf48('0x16')]['message']);}})['catch'](function(_0x2836b4){logger[_0xdf48('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x3944b0,_0x2836b4);_0x506699(_0x2836b4);});});}exports['GetServicenowAccount']=function(_0x285e68){var _0x2f676e=this;return new Promise(function(_0x2271fc,_0x1d4da4){return db[_0xdf48('0x17')]['findAll']({'raw':_0x285e68[_0xdf48('0x18')]?_0x285e68[_0xdf48('0x18')][_0xdf48('0x19')]===undefined?!![]:![]:!![],'where':_0x285e68[_0xdf48('0x18')]?_0x285e68['options'][_0xdf48('0x1a')]||null:null,'attributes':_0x285e68[_0xdf48('0x18')]?_0x285e68[_0xdf48('0x18')][_0xdf48('0x1b')]||null:null,'limit':_0x285e68['options']?_0x285e68[_0xdf48('0x18')]['limit']||null:null,'include':_0x285e68[_0xdf48('0x18')]?_0x285e68[_0xdf48('0x18')]['include']?_[_0xdf48('0x1c')](_0x285e68[_0xdf48('0x18')][_0xdf48('0x1d')],function(_0x202e59){return{'model':db[_0x202e59[_0xdf48('0x1e')]],'as':_0x202e59['as'],'attributes':_0x202e59['attributes'],'include':_0x202e59['include']?_['map'](_0x202e59['include'],function(_0x5b2c4a){return{'model':db[_0x5b2c4a['model']],'as':_0x5b2c4a['as'],'attributes':_0x5b2c4a[_0xdf48('0x1b')],'include':_0x5b2c4a[_0xdf48('0x1d')]?_[_0xdf48('0x1c')](_0x5b2c4a[_0xdf48('0x1d')],function(_0x3ccb4a){return{'model':db[_0x3ccb4a['model']],'as':_0x3ccb4a['as'],'attributes':_0x3ccb4a[_0xdf48('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x621da1){logger['info'](_0xdf48('0x1f'),_0x285e68);logger[_0xdf48('0x11')](_0xdf48('0x1f'),_0x285e68,JSON[_0xdf48('0x12')](_0x621da1));_0x2271fc(_0x621da1);})[_0xdf48('0x20')](function(_0xbf5ef0){logger[_0xdf48('0x13')](_0xdf48('0x1f'),_0xbf5ef0[_0xdf48('0x15')],_0x285e68);_0x1d4da4(_0x2f676e[_0xdf48('0x13')](0x1f4,_0xbf5ef0[_0xdf48('0x15')]));});});};exports[_0xdf48('0x21')]=function(_0x3674fe){var _0x3adff6=this;return new Promise(function(_0xf2989e,_0xe2e740){return db['ServicenowAccount'][_0xdf48('0x22')]({'raw':_0x3674fe[_0xdf48('0x18')]?_0x3674fe[_0xdf48('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3674fe[_0xdf48('0x18')]?_0x3674fe[_0xdf48('0x18')][_0xdf48('0x1a')]||null:null,'attributes':_0x3674fe[_0xdf48('0x18')]?_0x3674fe[_0xdf48('0x18')][_0xdf48('0x1b')]||null:null,'include':_0x3674fe['options']?_0x3674fe[_0xdf48('0x18')]['include']?_['map'](_0x3674fe[_0xdf48('0x18')][_0xdf48('0x1d')],function(_0x4089c6){return{'model':db[_0x4089c6[_0xdf48('0x1e')]],'as':_0x4089c6['as'],'attributes':_0x4089c6[_0xdf48('0x1b')],'include':_0x4089c6[_0xdf48('0x1d')]?_[_0xdf48('0x1c')](_0x4089c6['include'],function(_0x49ab5c){return{'model':db[_0x49ab5c[_0xdf48('0x1e')]],'as':_0x49ab5c['as'],'attributes':_0x49ab5c[_0xdf48('0x1b')],'include':_0x49ab5c[_0xdf48('0x1d')]?_[_0xdf48('0x1c')](_0x49ab5c[_0xdf48('0x1d')],function(_0x37d503){return{'model':db[_0x37d503[_0xdf48('0x1e')]],'as':_0x37d503['as'],'attributes':_0x37d503[_0xdf48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdf48('0xd')](function(_0x27807f){logger[_0xdf48('0xe')](_0xdf48('0x21'),_0x3674fe);logger['debug']('ShowServicenowAccount',_0x3674fe,JSON[_0xdf48('0x12')](_0x27807f));_0xf2989e(_0x27807f);})[_0xdf48('0x20')](function(_0x209e73){logger['error'](_0xdf48('0x21'),_0x209e73[_0xdf48('0x15')],_0x3674fe);_0xe2e740(_0x3adff6[_0xdf48('0x13')](0x1f4,_0x209e73['message']));});});}; \ No newline at end of file +var _0xaf3e=['randomstring','../../mysqldb','rpc','../../config/environment','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','map','model','debug','ShowServicenowAccount','find','moment','bluebird'];(function(_0x4114c6,_0x32b67e){var _0x3df309=function(_0x103514){while(--_0x103514){_0x4114c6['push'](_0x4114c6['shift']());}};_0x3df309(++_0x32b67e);}(_0xaf3e,0xb2));var _0xeaf3=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0xaf3e[_0x4e8286];return _0x44a440;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeaf3('0x0'));var BPromise=require(_0xeaf3('0x1'));var rs=require(_0xeaf3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaf3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeaf3('0x4'));var config=require(_0xeaf3('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad2a7,_0x2d25c2,_0x391cc7){return new BPromise(function(_0x2b6599,_0xcffe57){return client['request'](_0x1ad2a7,_0x391cc7)[_0xeaf3('0x6')](function(_0x5163ac){logger[_0xeaf3('0x7')]('ServicenowAccount,\x20%s,\x20%s',_0x2d25c2,_0xeaf3('0x8'));logger['debug'](_0xeaf3('0x9'),_0x2d25c2,_0xeaf3('0x8'),JSON[_0xeaf3('0xa')](_0x5163ac));if(_0x5163ac[_0xeaf3('0xb')]){if(_0x5163ac['error'][_0xeaf3('0xc')]===0x1f4){logger['error'](_0xeaf3('0xd'),_0x2d25c2,_0x5163ac[_0xeaf3('0xb')][_0xeaf3('0xe')]);return _0xcffe57(_0x5163ac['error'][_0xeaf3('0xe')]);}logger['error'](_0xeaf3('0xd'),_0x2d25c2,_0x5163ac[_0xeaf3('0xb')]['message']);return _0x2b6599(_0x5163ac['error'][_0xeaf3('0xe')]);}else{logger[_0xeaf3('0x7')]('ServicenowAccount,\x20%s,\x20%s',_0x2d25c2,_0xeaf3('0x8'));_0x2b6599(_0x5163ac[_0xeaf3('0xf')]['message']);}})[_0xeaf3('0x10')](function(_0x203510){logger[_0xeaf3('0xb')](_0xeaf3('0xd'),_0x2d25c2,_0x203510);_0xcffe57(_0x203510);});});}exports[_0xeaf3('0x11')]=function(_0x50b65a){var _0x4dfb9f=this;return new Promise(function(_0x1f7649,_0x5389ab){return db[_0xeaf3('0x12')]['findAll']({'raw':_0x50b65a[_0xeaf3('0x13')]?_0x50b65a[_0xeaf3('0x13')][_0xeaf3('0x14')]===undefined?!![]:![]:!![],'where':_0x50b65a['options']?_0x50b65a[_0xeaf3('0x13')][_0xeaf3('0x15')]||null:null,'attributes':_0x50b65a[_0xeaf3('0x13')]?_0x50b65a['options'][_0xeaf3('0x16')]||null:null,'limit':_0x50b65a[_0xeaf3('0x13')]?_0x50b65a[_0xeaf3('0x13')][_0xeaf3('0x17')]||null:null,'include':_0x50b65a['options']?_0x50b65a[_0xeaf3('0x13')][_0xeaf3('0x18')]?_[_0xeaf3('0x19')](_0x50b65a[_0xeaf3('0x13')][_0xeaf3('0x18')],function(_0x30ce30){return{'model':db[_0x30ce30[_0xeaf3('0x1a')]],'as':_0x30ce30['as'],'attributes':_0x30ce30[_0xeaf3('0x16')],'include':_0x30ce30['include']?_[_0xeaf3('0x19')](_0x30ce30[_0xeaf3('0x18')],function(_0x440718){return{'model':db[_0x440718[_0xeaf3('0x1a')]],'as':_0x440718['as'],'attributes':_0x440718[_0xeaf3('0x16')],'include':_0x440718[_0xeaf3('0x18')]?_['map'](_0x440718[_0xeaf3('0x18')],function(_0x5a9e32){return{'model':db[_0x5a9e32[_0xeaf3('0x1a')]],'as':_0x5a9e32['as'],'attributes':_0x5a9e32['attributes']};}):[]};}):[]};}):[]:[]})[_0xeaf3('0x6')](function(_0x2e4c08){logger[_0xeaf3('0x7')](_0xeaf3('0x11'),_0x50b65a);logger[_0xeaf3('0x1b')](_0xeaf3('0x11'),_0x50b65a,JSON[_0xeaf3('0xa')](_0x2e4c08));_0x1f7649(_0x2e4c08);})[_0xeaf3('0x10')](function(_0x1c44d4){logger[_0xeaf3('0xb')](_0xeaf3('0x11'),_0x1c44d4[_0xeaf3('0xe')],_0x50b65a);_0x5389ab(_0x4dfb9f[_0xeaf3('0xb')](0x1f4,_0x1c44d4['message']));});});};exports[_0xeaf3('0x1c')]=function(_0x135df0){var _0x286b6d=this;return new Promise(function(_0x14af82,_0x5dad81){return db[_0xeaf3('0x12')][_0xeaf3('0x1d')]({'raw':_0x135df0[_0xeaf3('0x13')]?_0x135df0[_0xeaf3('0x13')][_0xeaf3('0x14')]===undefined?!![]:![]:!![],'where':_0x135df0[_0xeaf3('0x13')]?_0x135df0[_0xeaf3('0x13')][_0xeaf3('0x15')]||null:null,'attributes':_0x135df0['options']?_0x135df0[_0xeaf3('0x13')][_0xeaf3('0x16')]||null:null,'include':_0x135df0['options']?_0x135df0[_0xeaf3('0x13')][_0xeaf3('0x18')]?_[_0xeaf3('0x19')](_0x135df0[_0xeaf3('0x13')][_0xeaf3('0x18')],function(_0x59269c){return{'model':db[_0x59269c[_0xeaf3('0x1a')]],'as':_0x59269c['as'],'attributes':_0x59269c[_0xeaf3('0x16')],'include':_0x59269c[_0xeaf3('0x18')]?_[_0xeaf3('0x19')](_0x59269c[_0xeaf3('0x18')],function(_0x1f18c2){return{'model':db[_0x1f18c2[_0xeaf3('0x1a')]],'as':_0x1f18c2['as'],'attributes':_0x1f18c2[_0xeaf3('0x16')],'include':_0x1f18c2[_0xeaf3('0x18')]?_['map'](_0x1f18c2['include'],function(_0x7d1222){return{'model':db[_0x7d1222['model']],'as':_0x7d1222['as'],'attributes':_0x7d1222['attributes']};}):[]};}):[]};}):[]:[]})[_0xeaf3('0x6')](function(_0x2ee8a7){logger[_0xeaf3('0x7')](_0xeaf3('0x1c'),_0x135df0);logger[_0xeaf3('0x1b')](_0xeaf3('0x1c'),_0x135df0,JSON[_0xeaf3('0xa')](_0x2ee8a7));_0x14af82(_0x2ee8a7);})[_0xeaf3('0x10')](function(_0x10bcd7){logger[_0xeaf3('0xb')](_0xeaf3('0x1c'),_0x10bcd7[_0xeaf3('0xe')],_0x135df0);_0x5dad81(_0x286b6d[_0xeaf3('0xb')](0x1f4,_0x10bcd7['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 888607e..12c0b81 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 _0x0990=['./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x0990,0xe7));var _0x0099=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x0990[_0x1aba25];return _0x47d997;};'use strict';var multer=require(_0x0099('0x0'));var util=require(_0x0099('0x1'));var path=require(_0x0099('0x2'));var timeout=require(_0x0099('0x3'));var express=require(_0x0099('0x4'));var router=express[_0x0099('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0099('0x6'));var interaction=require(_0x0099('0x7'));var config=require(_0x0099('0x8'));var controller=require(_0x0099('0x9'));router[_0x0099('0xa')]('/',auth[_0x0099('0xb')](),controller[_0x0099('0xc')]);router[_0x0099('0xa')](_0x0099('0xd'),auth['isAuthenticated'](),controller[_0x0099('0xe')]);router['get'](_0x0099('0xf'),auth[_0x0099('0xb')](),controller[_0x0099('0x10')]);router[_0x0099('0xa')](_0x0099('0x11'),auth[_0x0099('0xb')](),controller[_0x0099('0x12')]);router['get'](_0x0099('0x13'),auth[_0x0099('0xb')](),controller['getDescriptions']);router[_0x0099('0x14')]('/',auth[_0x0099('0xb')](),controller['create']);router['put'](_0x0099('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0099('0x15')](_0x0099('0xd'),auth[_0x0099('0xb')](),controller[_0x0099('0x16')]);module[_0x0099('0x17')]=router; \ No newline at end of file +var _0xeca0=['/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2f3cc8,_0x573a07){var _0x3d3b29=function(_0x58eabb){while(--_0x58eabb){_0x2f3cc8['push'](_0x2f3cc8['shift']());}};_0x3d3b29(++_0x573a07);}(_0xeca0,0xda));var _0x0eca=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xeca0[_0xbb091];return _0x467a04;};'use strict';var multer=require('multer');var util=require(_0x0eca('0x0'));var path=require(_0x0eca('0x1'));var timeout=require('connect-timeout');var express=require(_0x0eca('0x2'));var router=express[_0x0eca('0x3')]();var fs_extra=require(_0x0eca('0x4'));var auth=require(_0x0eca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0eca('0x6'));var controller=require(_0x0eca('0x7'));router[_0x0eca('0x8')]('/',auth[_0x0eca('0x9')](),controller[_0x0eca('0xa')]);router[_0x0eca('0x8')](_0x0eca('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0eca('0x8')](_0x0eca('0xc'),auth['isAuthenticated'](),controller[_0x0eca('0xd')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x0eca('0xe')]);router[_0x0eca('0x8')](_0x0eca('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x0eca('0x10')]('/',auth[_0x0eca('0x9')](),controller[_0x0eca('0x11')]);router[_0x0eca('0x12')](_0x0eca('0xb'),auth['isAuthenticated'](),controller[_0x0eca('0x13')]);router[_0x0eca('0x14')](_0x0eca('0xb'),auth[_0x0eca('0x9')](),controller[_0x0eca('0x15')]);module[_0x0eca('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index e15cb34..051eceb 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 _0x377f=['exports','STRING','sequelize'];(function(_0x295572,_0x58a177){var _0x285bef=function(_0x3d284e){while(--_0x3d284e){_0x295572['push'](_0x295572['shift']());}};_0x285bef(++_0x58a177);}(_0x377f,0x104));var _0xf377=function(_0x441373,_0x15b94){_0x441373=_0x441373-0x0;var _0x4a61b2=_0x377f[_0x441373];return _0x4a61b2;};'use strict';var Sequelize=require(_0xf377('0x0'));module[_0xf377('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf377('0x2')]}}; \ No newline at end of file +var _0x6dec=['STRING','sequelize'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x6dec,0xcf));var _0xc6de=function(_0x562b4a,_0x1d0dc4){_0x562b4a=_0x562b4a-0x0;var _0x1cc1e5=_0x6dec[_0x562b4a];return _0x1cc1e5;};'use strict';var Sequelize=require(_0xc6de('0x0'));module['exports']={'name':{'type':Sequelize[_0xc6de('0x1')]},'description':{'type':Sequelize[_0xc6de('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b12aaad..95bde2a 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 _0x4e6d=['body','params','keys','ServicenowField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','include','findAll','rows','catch','find','create'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x4e6d,0xa3));var _0xd4e6=function(_0x25c92b,_0x41b368){_0x25c92b=_0x25c92b-0x0;var _0xc59d85=_0x4e6d[_0x25c92b];return _0xc59d85;};'use strict';var emlformat=require(_0xd4e6('0x0'));var rimraf=require(_0xd4e6('0x1'));var zipdir=require(_0xd4e6('0x2'));var jsonpatch=require(_0xd4e6('0x3'));var rp=require(_0xd4e6('0x4'));var moment=require('moment');var BPromise=require(_0xd4e6('0x5'));var Mustache=require(_0xd4e6('0x6'));var util=require('util');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(_0xd4e6('0x7'));var _=require(_0xd4e6('0x8'));var squel=require('squel');var crypto=require(_0xd4e6('0x9'));var jsforce=require(_0xd4e6('0xa'));var deskjs=require(_0xd4e6('0xb'));var toCsv=require(_0xd4e6('0xc'));var querystring=require(_0xd4e6('0xd'));var Papa=require(_0xd4e6('0xe'));var Redis=require(_0xd4e6('0xf'));var authService=require(_0xd4e6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd4e6('0x11'));var hardwareService=require(_0xd4e6('0x12'));var logger=require(_0xd4e6('0x13'))(_0xd4e6('0x14'));var utils=require(_0xd4e6('0x15'));var config=require(_0xd4e6('0x16'));var licenseUtil=require(_0xd4e6('0x17'));var db=require(_0xd4e6('0x18'))['db'];function respondWithStatusCode(_0x4c7e28,_0x56e0a3){_0x56e0a3=_0x56e0a3||0xcc;return function(_0x2b0276){if(_0x2b0276){return _0x4c7e28['sendStatus'](_0x56e0a3);}return _0x4c7e28['status'](_0x56e0a3)[_0xd4e6('0x19')]();};}function respondWithResult(_0xebda6a,_0x319839){_0x319839=_0x319839||0xc8;return function(_0xe3c03f){if(_0xe3c03f){return _0xebda6a[_0xd4e6('0x1a')](_0x319839)[_0xd4e6('0x1b')](_0xe3c03f);}};}function respondWithFilteredResult(_0x3c0c06,_0x490208){return function(_0x12e348){if(_0x12e348){var _0xae0dd3=typeof _0x490208[_0xd4e6('0x1c')]===_0xd4e6('0x1d')&&typeof _0x490208[_0xd4e6('0x1e')]===_0xd4e6('0x1d');var _0x571327=_0x12e348[_0xd4e6('0x1f')];var _0x21dd19=_0xae0dd3?0x0:_0x490208['offset'];var _0x5eeb88=_0xae0dd3?_0x12e348['count']:_0x490208['offset']+_0x490208[_0xd4e6('0x1e')];var _0x26a5f1;if(_0x5eeb88>=_0x571327){_0x5eeb88=_0x571327;_0x26a5f1=0xc8;}else{_0x26a5f1=0xce;}_0x3c0c06[_0xd4e6('0x1a')](_0x26a5f1);return _0x3c0c06[_0xd4e6('0x20')]('Content-Range',_0x21dd19+'-'+_0x5eeb88+'/'+_0x571327)[_0xd4e6('0x1b')](_0x12e348);}return null;};}function patchUpdates(_0x254df3){return function(_0x2ddc80){try{jsonpatch['apply'](_0x2ddc80,_0x254df3,!![]);}catch(_0x2501e9){return BPromise['reject'](_0x2501e9);}return _0x2ddc80[_0xd4e6('0x21')]();};}function saveUpdates(_0x282b36,_0x5948df){return function(_0x443541){if(_0x443541){return _0x443541[_0xd4e6('0x22')](_0x282b36)[_0xd4e6('0x23')](function(_0x2b5dbb){return _0x2b5dbb;});}return null;};}function removeEntity(_0x285cbf,_0x33b9e4){return function(_0x41b1cf){if(_0x41b1cf){return _0x41b1cf[_0xd4e6('0x24')]()['then'](function(){_0x285cbf[_0xd4e6('0x1a')](0xcc)[_0xd4e6('0x19')]();});}};}function handleEntityNotFound(_0x118d6b,_0x33d0c1){return function(_0x2790c3){if(!_0x2790c3){_0x118d6b[_0xd4e6('0x25')](0x194);}return _0x2790c3;};}function handleError(_0x3b4433,_0x3f970b){_0x3f970b=_0x3f970b||0x1f4;return function(_0x6343bb){logger[_0xd4e6('0x26')](_0x6343bb[_0xd4e6('0x27')]);if(_0x6343bb[_0xd4e6('0x28')]){delete _0x6343bb['name'];}_0x3b4433['status'](_0x3f970b)[_0xd4e6('0x29')](_0x6343bb);};}exports[_0xd4e6('0x2a')]=function(_0x40467b,_0x5baca8){var _0x4a223a={},_0x3c33d2={},_0x5e9349={'count':0x0,'rows':[]};var _0x4ef26c=_[_0xd4e6('0x2b')](db['ServicenowConfiguration'][_0xd4e6('0x2c')],function(_0xe5c87e){return{'name':_0xe5c87e[_0xd4e6('0x2d')],'type':_0xe5c87e['type']['key']};});_0x3c33d2[_0xd4e6('0x2e')]=_[_0xd4e6('0x2b')](_0x4ef26c,_0xd4e6('0x28'));_0x3c33d2[_0xd4e6('0x2f')]=_['keys'](_0x40467b[_0xd4e6('0x2f')]);_0x3c33d2[_0xd4e6('0x30')]=_[_0xd4e6('0x31')](_0x3c33d2[_0xd4e6('0x2e')],_0x3c33d2[_0xd4e6('0x2f')]);_0x4a223a[_0xd4e6('0x32')]=_['intersection'](_0x3c33d2[_0xd4e6('0x2e')],qs[_0xd4e6('0x33')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x4a223a[_0xd4e6('0x32')]=_0x4a223a[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x4a223a[_0xd4e6('0x32')]:_0x3c33d2[_0xd4e6('0x2e')];if(!_0x40467b['query']['hasOwnProperty']('nolimit')){_0x4a223a[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x1e')]);_0x4a223a[_0xd4e6('0x1c')]=qs[_0xd4e6('0x1c')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x1c')]);}_0x4a223a[_0xd4e6('0x35')]=qs[_0xd4e6('0x36')](_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x36')]);_0x4a223a[_0xd4e6('0x37')]=qs[_0xd4e6('0x30')](_[_0xd4e6('0x38')](_0x40467b[_0xd4e6('0x2f')],_0x3c33d2[_0xd4e6('0x30')]),_0x4ef26c);if(_0x40467b[_0xd4e6('0x2f')][_0xd4e6('0x39')]){_0x4a223a['where']=_[_0xd4e6('0x3a')](_0x4a223a['where'],{'$or':_['map'](_0x4ef26c,function(_0x2c0a76){if(_0x2c0a76['type']!==_0xd4e6('0x3b')){var _0x5ee6ef={};_0x5ee6ef[_0x2c0a76[_0xd4e6('0x28')]]={'$like':'%'+_0x40467b['query'][_0xd4e6('0x39')]+'%'};return _0x5ee6ef;}})});}_0x4a223a=_[_0xd4e6('0x3a')]({},_0x4a223a,_0x40467b[_0xd4e6('0x3c')]);var _0x143be1={'where':_0x4a223a['where']};return db[_0xd4e6('0x3d')][_0xd4e6('0x1f')](_0x143be1)[_0xd4e6('0x23')](function(_0x454bb8){_0x5e9349[_0xd4e6('0x1f')]=_0x454bb8;if(_0x40467b[_0xd4e6('0x2f')]['includeAll']){_0x4a223a[_0xd4e6('0x3e')]=[{'all':!![]}];}return db[_0xd4e6('0x3d')][_0xd4e6('0x3f')](_0x4a223a);})[_0xd4e6('0x23')](function(_0x57dacc){_0x5e9349[_0xd4e6('0x40')]=_0x57dacc;return _0x5e9349;})[_0xd4e6('0x23')](respondWithFilteredResult(_0x5baca8,_0x4a223a))[_0xd4e6('0x41')](handleError(_0x5baca8,null));};exports['show']=function(_0x19f252,_0x40d004){var _0x313e9c={'raw':![],'where':{'id':_0x19f252['params']['id']}},_0x571777={};_0x571777[_0xd4e6('0x2e')]=_['keys'](db[_0xd4e6('0x3d')][_0xd4e6('0x2c')]);_0x571777[_0xd4e6('0x2f')]=_['keys'](_0x19f252['query']);_0x571777[_0xd4e6('0x30')]=_[_0xd4e6('0x31')](_0x571777['model'],_0x571777['query']);_0x313e9c[_0xd4e6('0x32')]=_[_0xd4e6('0x31')](_0x571777[_0xd4e6('0x2e')],qs['fields'](_0x19f252['query']['fields']));_0x313e9c[_0xd4e6('0x32')]=_0x313e9c['attributes'][_0xd4e6('0x34')]?_0x313e9c[_0xd4e6('0x32')]:_0x571777[_0xd4e6('0x2e')];if(_0x19f252[_0xd4e6('0x2f')]['includeAll']){_0x313e9c[_0xd4e6('0x3e')]=[{'all':!![]}];}_0x313e9c=_['merge']({},_0x313e9c,_0x19f252['options']);return db[_0xd4e6('0x3d')][_0xd4e6('0x42')](_0x313e9c)[_0xd4e6('0x23')](handleEntityNotFound(_0x40d004,null))['then'](respondWithResult(_0x40d004,null))['catch'](handleError(_0x40d004,null));};exports[_0xd4e6('0x43')]=function(_0x3a3ec5,_0x1cf3a2){return db[_0xd4e6('0x3d')][_0xd4e6('0x43')](_0x3a3ec5[_0xd4e6('0x44')],{})[_0xd4e6('0x23')](respondWithResult(_0x1cf3a2,0xc9))[_0xd4e6('0x41')](handleError(_0x1cf3a2,null));};exports[_0xd4e6('0x22')]=function(_0x415bdd,_0x338011){if(_0x415bdd[_0xd4e6('0x44')]['id']){delete _0x415bdd[_0xd4e6('0x44')]['id'];}return db[_0xd4e6('0x3d')][_0xd4e6('0x42')]({'where':{'id':_0x415bdd[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0x338011,null))[_0xd4e6('0x23')](saveUpdates(_0x415bdd['body'],null))[_0xd4e6('0x23')](respondWithResult(_0x338011,null))[_0xd4e6('0x41')](handleError(_0x338011,null));};exports[_0xd4e6('0x24')]=function(_0x3e6582,_0xfc1101){return db['ServicenowConfiguration'][_0xd4e6('0x42')]({'where':{'id':_0x3e6582[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0xfc1101,null))[_0xd4e6('0x23')](removeEntity(_0xfc1101,null))['catch'](handleError(_0xfc1101,null));};exports['getFields']=function(_0x5dd307,_0x82e5b6,_0x27dec1){var _0x4c8ad3={};var _0xad38d3={};var _0x582f76;var _0x4c1d7b;return db[_0xd4e6('0x3d')]['findOne']({'where':{'id':_0x5dd307[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0x82e5b6,null))[_0xd4e6('0x23')](function(_0xffa5c3){if(_0xffa5c3){_0x582f76=_0xffa5c3;_0xad38d3['model']=_[_0xd4e6('0x46')](db[_0xd4e6('0x47')][_0xd4e6('0x2c')]);_0xad38d3['query']=_[_0xd4e6('0x46')](_0x5dd307[_0xd4e6('0x2f')]);_0xad38d3[_0xd4e6('0x30')]=_['intersection'](_0xad38d3[_0xd4e6('0x2e')],_0xad38d3[_0xd4e6('0x2f')]);_0x4c8ad3['attributes']=_['intersection'](_0xad38d3['model'],qs[_0xd4e6('0x33')](_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x4c8ad3[_0xd4e6('0x32')]=_0x4c8ad3[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x4c8ad3['attributes']:_0xad38d3[_0xd4e6('0x2e')];_0x4c8ad3['order']=qs[_0xd4e6('0x36')](_0x5dd307['query']['sort']);_0x4c8ad3[_0xd4e6('0x37')]=qs[_0xd4e6('0x30')](_[_0xd4e6('0x38')](_0x5dd307[_0xd4e6('0x2f')],_0xad38d3[_0xd4e6('0x30')]));if(_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x39')]){_0x4c8ad3['where']=_['merge'](_0x4c8ad3[_0xd4e6('0x37')],{'$or':_[_0xd4e6('0x2b')](_0x4c8ad3[_0xd4e6('0x32')],function(_0x40c97c){var _0x1a8834={};_0x1a8834[_0x40c97c]={'$like':'%'+_0x5dd307['query'][_0xd4e6('0x39')]+'%'};return _0x1a8834;})});}_0x4c8ad3=_[_0xd4e6('0x3a')]({},_0x4c8ad3,_0x5dd307[_0xd4e6('0x3c')]);return _0x582f76[_0xd4e6('0x48')](_0x4c8ad3);}})[_0xd4e6('0x23')](function(_0x3ca978){if(_0x3ca978){_0x4c1d7b=_0x3ca978[_0xd4e6('0x34')];if(!_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x49')](_0xd4e6('0x4a'))){_0x4c8ad3['limit']=qs[_0xd4e6('0x1e')](_0x5dd307['query'][_0xd4e6('0x1e')]);_0x4c8ad3[_0xd4e6('0x1c')]=qs[_0xd4e6('0x1c')](_0x5dd307[_0xd4e6('0x2f')][_0xd4e6('0x1c')]);}return _0x582f76[_0xd4e6('0x48')](_0x4c8ad3);}})[_0xd4e6('0x23')](function(_0x15345d){if(_0x15345d){return _0x15345d?{'count':_0x4c1d7b,'rows':_0x15345d}:null;}})['then'](respondWithResult(_0x82e5b6,null))[_0xd4e6('0x41')](handleError(_0x82e5b6,null));};exports[_0xd4e6('0x4b')]=function(_0x20a280,_0x311024,_0x3009fd){var _0x185a05={};var _0x47c522={};var _0x334856;var _0x5192f3;return db[_0xd4e6('0x3d')]['findOne']({'where':{'id':_0x20a280[_0xd4e6('0x45')]['id']}})[_0xd4e6('0x23')](handleEntityNotFound(_0x311024,null))[_0xd4e6('0x23')](function(_0x310110){if(_0x310110){_0x334856=_0x310110;_0x47c522[_0xd4e6('0x2e')]=_['keys'](db[_0xd4e6('0x47')][_0xd4e6('0x2c')]);_0x47c522[_0xd4e6('0x2f')]=_[_0xd4e6('0x46')](_0x20a280[_0xd4e6('0x2f')]);_0x47c522['filters']=_[_0xd4e6('0x31')](_0x47c522[_0xd4e6('0x2e')],_0x47c522[_0xd4e6('0x2f')]);_0x185a05['attributes']=_[_0xd4e6('0x31')](_0x47c522[_0xd4e6('0x2e')],qs[_0xd4e6('0x33')](_0x20a280[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x185a05[_0xd4e6('0x32')]=_0x185a05[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x185a05['attributes']:_0x47c522[_0xd4e6('0x2e')];_0x185a05[_0xd4e6('0x35')]=qs[_0xd4e6('0x36')](_0x20a280[_0xd4e6('0x2f')]['sort']);_0x185a05['where']=qs[_0xd4e6('0x30')](_[_0xd4e6('0x38')](_0x20a280['query'],_0x47c522['filters']));if(_0x20a280[_0xd4e6('0x2f')][_0xd4e6('0x39')]){_0x185a05[_0xd4e6('0x37')]=_['merge'](_0x185a05[_0xd4e6('0x37')],{'$or':_[_0xd4e6('0x2b')](_0x185a05[_0xd4e6('0x32')],function(_0x561c19){var _0x1cedee={};_0x1cedee[_0x561c19]={'$like':'%'+_0x20a280['query'][_0xd4e6('0x39')]+'%'};return _0x1cedee;})});}_0x185a05=_['merge']({},_0x185a05,_0x20a280[_0xd4e6('0x3c')]);return _0x334856[_0xd4e6('0x4b')](_0x185a05);}})[_0xd4e6('0x23')](function(_0x2aab16){if(_0x2aab16){_0x5192f3=_0x2aab16[_0xd4e6('0x34')];if(!_0x20a280['query'][_0xd4e6('0x49')](_0xd4e6('0x4a'))){_0x185a05[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x20a280['query'][_0xd4e6('0x1e')]);_0x185a05[_0xd4e6('0x1c')]=qs[_0xd4e6('0x1c')](_0x20a280[_0xd4e6('0x2f')][_0xd4e6('0x1c')]);}return _0x334856[_0xd4e6('0x4b')](_0x185a05);}})['then'](function(_0x46933f){if(_0x46933f){return _0x46933f?{'count':_0x5192f3,'rows':_0x46933f}:null;}})[_0xd4e6('0x23')](respondWithResult(_0x311024,null))[_0xd4e6('0x41')](handleError(_0x311024,null));};exports[_0xd4e6('0x4c')]=function(_0x51ed2c,_0x1c0c2a,_0x381ae1){var _0x44318c={};var _0x59e5bd={};var _0x36920a;var _0x258528;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x51ed2c['params']['id']}})['then'](handleEntityNotFound(_0x1c0c2a,null))[_0xd4e6('0x23')](function(_0x472151){if(_0x472151){_0x36920a=_0x472151;_0x59e5bd[_0xd4e6('0x2e')]=_[_0xd4e6('0x46')](db[_0xd4e6('0x47')]['rawAttributes']);_0x59e5bd[_0xd4e6('0x2f')]=_[_0xd4e6('0x46')](_0x51ed2c[_0xd4e6('0x2f')]);_0x59e5bd['filters']=_[_0xd4e6('0x31')](_0x59e5bd[_0xd4e6('0x2e')],_0x59e5bd[_0xd4e6('0x2f')]);_0x44318c[_0xd4e6('0x32')]=_[_0xd4e6('0x31')](_0x59e5bd[_0xd4e6('0x2e')],qs[_0xd4e6('0x33')](_0x51ed2c[_0xd4e6('0x2f')][_0xd4e6('0x33')]));_0x44318c[_0xd4e6('0x32')]=_0x44318c[_0xd4e6('0x32')][_0xd4e6('0x34')]?_0x44318c[_0xd4e6('0x32')]:_0x59e5bd['model'];_0x44318c[_0xd4e6('0x35')]=qs['sort'](_0x51ed2c[_0xd4e6('0x2f')]['sort']);_0x44318c[_0xd4e6('0x37')]=qs['filters'](_[_0xd4e6('0x38')](_0x51ed2c[_0xd4e6('0x2f')],_0x59e5bd[_0xd4e6('0x30')]));if(_0x51ed2c['query'][_0xd4e6('0x39')]){_0x44318c[_0xd4e6('0x37')]=_['merge'](_0x44318c[_0xd4e6('0x37')],{'$or':_[_0xd4e6('0x2b')](_0x44318c['attributes'],function(_0x51ba82){var _0x270d1d={};_0x270d1d[_0x51ba82]={'$like':'%'+_0x51ed2c[_0xd4e6('0x2f')][_0xd4e6('0x39')]+'%'};return _0x270d1d;})});}_0x44318c=_[_0xd4e6('0x3a')]({},_0x44318c,_0x51ed2c[_0xd4e6('0x3c')]);return _0x36920a[_0xd4e6('0x4c')](_0x44318c);}})[_0xd4e6('0x23')](function(_0x1804d3){if(_0x1804d3){_0x258528=_0x1804d3[_0xd4e6('0x34')];if(!_0x51ed2c[_0xd4e6('0x2f')]['hasOwnProperty'](_0xd4e6('0x4a'))){_0x44318c[_0xd4e6('0x1e')]=qs[_0xd4e6('0x1e')](_0x51ed2c[_0xd4e6('0x2f')][_0xd4e6('0x1e')]);_0x44318c[_0xd4e6('0x1c')]=qs['offset'](_0x51ed2c[_0xd4e6('0x2f')]['offset']);}return _0x36920a['getDescriptions'](_0x44318c);}})[_0xd4e6('0x23')](function(_0x963a61){if(_0x963a61){return _0x963a61?{'count':_0x258528,'rows':_0x963a61}:null;}})['then'](respondWithResult(_0x1c0c2a,null))[_0xd4e6('0x41')](handleError(_0x1c0c2a,null));}; \ No newline at end of file +var _0x55dc=['pick','getFields','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','rawAttributes','include','find','create','body','params','findOne','ServicenowField'];(function(_0x33d538,_0x1b5605){var _0x2fca45=function(_0x190877){while(--_0x190877){_0x33d538['push'](_0x33d538['shift']());}};_0x2fca45(++_0x1b5605);}(_0x55dc,0x1e3));var _0xc55d=function(_0xcd4e86,_0x10338c){_0xcd4e86=_0xcd4e86-0x0;var _0x3b10ed=_0x55dc[_0xcd4e86];return _0x3b10ed;};'use strict';var emlformat=require(_0xc55d('0x0'));var rimraf=require(_0xc55d('0x1'));var zipdir=require(_0xc55d('0x2'));var jsonpatch=require(_0xc55d('0x3'));var rp=require(_0xc55d('0x4'));var moment=require(_0xc55d('0x5'));var BPromise=require(_0xc55d('0x6'));var Mustache=require('mustache');var util=require(_0xc55d('0x7'));var path=require(_0xc55d('0x8'));var sox=require(_0xc55d('0x9'));var csv=require(_0xc55d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc55d('0xb'));var _=require(_0xc55d('0xc'));var squel=require(_0xc55d('0xd'));var crypto=require(_0xc55d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc55d('0xf'));var toCsv=require(_0xc55d('0xa'));var querystring=require(_0xc55d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc55d('0x11'));var qs=require(_0xc55d('0x12'));var as=require(_0xc55d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc55d('0x14'))(_0xc55d('0x15'));var utils=require(_0xc55d('0x16'));var config=require(_0xc55d('0x17'));var licenseUtil=require(_0xc55d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28c20f,_0x410465){_0x410465=_0x410465||0xcc;return function(_0x47c94c){if(_0x47c94c){return _0x28c20f['sendStatus'](_0x410465);}return _0x28c20f['status'](_0x410465)[_0xc55d('0x19')]();};}function respondWithResult(_0x15ae35,_0x5aeb3a){_0x5aeb3a=_0x5aeb3a||0xc8;return function(_0x3c5b4b){if(_0x3c5b4b){return _0x15ae35[_0xc55d('0x1a')](_0x5aeb3a)[_0xc55d('0x1b')](_0x3c5b4b);}};}function respondWithFilteredResult(_0x15705a,_0x229970){return function(_0x55c832){if(_0x55c832){var _0x22adee=typeof _0x229970[_0xc55d('0x1c')]===_0xc55d('0x1d')&&typeof _0x229970[_0xc55d('0x1e')]===_0xc55d('0x1d');var _0x4772e8=_0x55c832[_0xc55d('0x1f')];var _0x39d597=_0x22adee?0x0:_0x229970[_0xc55d('0x1c')];var _0x28c8d0=_0x22adee?_0x55c832[_0xc55d('0x1f')]:_0x229970['offset']+_0x229970['limit'];var _0x2db224;if(_0x28c8d0>=_0x4772e8){_0x28c8d0=_0x4772e8;_0x2db224=0xc8;}else{_0x2db224=0xce;}_0x15705a[_0xc55d('0x1a')](_0x2db224);return _0x15705a[_0xc55d('0x20')]('Content-Range',_0x39d597+'-'+_0x28c8d0+'/'+_0x4772e8)[_0xc55d('0x1b')](_0x55c832);}return null;};}function patchUpdates(_0x43ad50){return function(_0x38c048){try{jsonpatch[_0xc55d('0x21')](_0x38c048,_0x43ad50,!![]);}catch(_0x5b9a8d){return BPromise[_0xc55d('0x22')](_0x5b9a8d);}return _0x38c048[_0xc55d('0x23')]();};}function saveUpdates(_0x4a5b2b,_0x89ec9d){return function(_0x4cb9d0){if(_0x4cb9d0){return _0x4cb9d0[_0xc55d('0x24')](_0x4a5b2b)[_0xc55d('0x25')](function(_0x343ab6){return _0x343ab6;});}return null;};}function removeEntity(_0x1938f0,_0x1d27c8){return function(_0x21a91f){if(_0x21a91f){return _0x21a91f[_0xc55d('0x26')]()[_0xc55d('0x25')](function(){_0x1938f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b2c5,_0x406ef6){return function(_0x530415){if(!_0x530415){_0x53b2c5[_0xc55d('0x27')](0x194);}return _0x530415;};}function handleError(_0x148e31,_0x40c7fe){_0x40c7fe=_0x40c7fe||0x1f4;return function(_0x33ae45){logger['error'](_0x33ae45[_0xc55d('0x28')]);if(_0x33ae45[_0xc55d('0x29')]){delete _0x33ae45[_0xc55d('0x29')];}_0x148e31[_0xc55d('0x1a')](_0x40c7fe)[_0xc55d('0x2a')](_0x33ae45);};}exports[_0xc55d('0x2b')]=function(_0x457040,_0x454222){var _0x4db568={},_0x5229b6={},_0x6c4623={'count':0x0,'rows':[]};var _0x43bd8f=_[_0xc55d('0x2c')](db[_0xc55d('0x2d')]['rawAttributes'],function(_0x132c20){return{'name':_0x132c20[_0xc55d('0x2e')],'type':_0x132c20[_0xc55d('0x2f')][_0xc55d('0x30')]};});_0x5229b6[_0xc55d('0x31')]=_[_0xc55d('0x2c')](_0x43bd8f,_0xc55d('0x29'));_0x5229b6[_0xc55d('0x32')]=_[_0xc55d('0x33')](_0x457040[_0xc55d('0x32')]);_0x5229b6['filters']=_[_0xc55d('0x34')](_0x5229b6[_0xc55d('0x31')],_0x5229b6[_0xc55d('0x32')]);_0x4db568[_0xc55d('0x35')]=_[_0xc55d('0x34')](_0x5229b6['model'],qs['fields'](_0x457040[_0xc55d('0x32')][_0xc55d('0x36')]));_0x4db568[_0xc55d('0x35')]=_0x4db568[_0xc55d('0x35')][_0xc55d('0x37')]?_0x4db568[_0xc55d('0x35')]:_0x5229b6[_0xc55d('0x31')];if(!_0x457040[_0xc55d('0x32')][_0xc55d('0x38')](_0xc55d('0x39'))){_0x4db568[_0xc55d('0x1e')]=qs[_0xc55d('0x1e')](_0x457040[_0xc55d('0x32')]['limit']);_0x4db568[_0xc55d('0x1c')]=qs[_0xc55d('0x1c')](_0x457040[_0xc55d('0x32')][_0xc55d('0x1c')]);}_0x4db568[_0xc55d('0x3a')]=qs[_0xc55d('0x3b')](_0x457040[_0xc55d('0x32')][_0xc55d('0x3b')]);_0x4db568[_0xc55d('0x3c')]=qs['filters'](_['pick'](_0x457040[_0xc55d('0x32')],_0x5229b6[_0xc55d('0x3d')]),_0x43bd8f);if(_0x457040[_0xc55d('0x32')][_0xc55d('0x3e')]){_0x4db568['where']=_[_0xc55d('0x3f')](_0x4db568[_0xc55d('0x3c')],{'$or':_[_0xc55d('0x2c')](_0x43bd8f,function(_0x14ef04){if(_0x14ef04['type']!==_0xc55d('0x40')){var _0x23b21d={};_0x23b21d[_0x14ef04['name']]={'$like':'%'+_0x457040[_0xc55d('0x32')]['filter']+'%'};return _0x23b21d;}})});}_0x4db568=_[_0xc55d('0x3f')]({},_0x4db568,_0x457040[_0xc55d('0x41')]);var _0x26f715={'where':_0x4db568[_0xc55d('0x3c')]};return db[_0xc55d('0x2d')][_0xc55d('0x1f')](_0x26f715)[_0xc55d('0x25')](function(_0x2950b3){_0x6c4623[_0xc55d('0x1f')]=_0x2950b3;if(_0x457040[_0xc55d('0x32')][_0xc55d('0x42')]){_0x4db568['include']=[{'all':!![]}];}return db[_0xc55d('0x2d')][_0xc55d('0x43')](_0x4db568);})['then'](function(_0x4fe90b){_0x6c4623['rows']=_0x4fe90b;return _0x6c4623;})['then'](respondWithFilteredResult(_0x454222,_0x4db568))[_0xc55d('0x44')](handleError(_0x454222,null));};exports['show']=function(_0x3d2cdd,_0x7cb595){var _0x88e685={'raw':![],'where':{'id':_0x3d2cdd['params']['id']}},_0x484d80={};_0x484d80[_0xc55d('0x31')]=_[_0xc55d('0x33')](db[_0xc55d('0x2d')][_0xc55d('0x45')]);_0x484d80[_0xc55d('0x32')]=_['keys'](_0x3d2cdd['query']);_0x484d80[_0xc55d('0x3d')]=_[_0xc55d('0x34')](_0x484d80[_0xc55d('0x31')],_0x484d80['query']);_0x88e685[_0xc55d('0x35')]=_[_0xc55d('0x34')](_0x484d80[_0xc55d('0x31')],qs[_0xc55d('0x36')](_0x3d2cdd['query'][_0xc55d('0x36')]));_0x88e685['attributes']=_0x88e685[_0xc55d('0x35')]['length']?_0x88e685[_0xc55d('0x35')]:_0x484d80['model'];if(_0x3d2cdd[_0xc55d('0x32')]['includeAll']){_0x88e685[_0xc55d('0x46')]=[{'all':!![]}];}_0x88e685=_[_0xc55d('0x3f')]({},_0x88e685,_0x3d2cdd['options']);return db[_0xc55d('0x2d')][_0xc55d('0x47')](_0x88e685)['then'](handleEntityNotFound(_0x7cb595,null))[_0xc55d('0x25')](respondWithResult(_0x7cb595,null))[_0xc55d('0x44')](handleError(_0x7cb595,null));};exports[_0xc55d('0x48')]=function(_0x4d971c,_0x2a97aa){return db[_0xc55d('0x2d')][_0xc55d('0x48')](_0x4d971c['body'],{})[_0xc55d('0x25')](respondWithResult(_0x2a97aa,0xc9))[_0xc55d('0x44')](handleError(_0x2a97aa,null));};exports[_0xc55d('0x24')]=function(_0x24420a,_0x157e02){if(_0x24420a[_0xc55d('0x49')]['id']){delete _0x24420a[_0xc55d('0x49')]['id'];}return db[_0xc55d('0x2d')][_0xc55d('0x47')]({'where':{'id':_0x24420a[_0xc55d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x157e02,null))[_0xc55d('0x25')](saveUpdates(_0x24420a[_0xc55d('0x49')],null))['then'](respondWithResult(_0x157e02,null))[_0xc55d('0x44')](handleError(_0x157e02,null));};exports['destroy']=function(_0x3fb0e5,_0x599332){return db[_0xc55d('0x2d')][_0xc55d('0x47')]({'where':{'id':_0x3fb0e5['params']['id']}})[_0xc55d('0x25')](handleEntityNotFound(_0x599332,null))[_0xc55d('0x25')](removeEntity(_0x599332,null))[_0xc55d('0x44')](handleError(_0x599332,null));};exports['getFields']=function(_0x3e44e9,_0x27c47d,_0x5478d7){var _0x12cf06={};var _0x3317fe={};var _0x553f21;var _0x460454;return db[_0xc55d('0x2d')][_0xc55d('0x4b')]({'where':{'id':_0x3e44e9[_0xc55d('0x4a')]['id']}})[_0xc55d('0x25')](handleEntityNotFound(_0x27c47d,null))['then'](function(_0x56fb30){if(_0x56fb30){_0x553f21=_0x56fb30;_0x3317fe[_0xc55d('0x31')]=_['keys'](db[_0xc55d('0x4c')]['rawAttributes']);_0x3317fe[_0xc55d('0x32')]=_[_0xc55d('0x33')](_0x3e44e9['query']);_0x3317fe['filters']=_[_0xc55d('0x34')](_0x3317fe[_0xc55d('0x31')],_0x3317fe['query']);_0x12cf06[_0xc55d('0x35')]=_[_0xc55d('0x34')](_0x3317fe[_0xc55d('0x31')],qs[_0xc55d('0x36')](_0x3e44e9[_0xc55d('0x32')][_0xc55d('0x36')]));_0x12cf06[_0xc55d('0x35')]=_0x12cf06[_0xc55d('0x35')][_0xc55d('0x37')]?_0x12cf06[_0xc55d('0x35')]:_0x3317fe[_0xc55d('0x31')];_0x12cf06['order']=qs['sort'](_0x3e44e9['query'][_0xc55d('0x3b')]);_0x12cf06[_0xc55d('0x3c')]=qs[_0xc55d('0x3d')](_[_0xc55d('0x4d')](_0x3e44e9[_0xc55d('0x32')],_0x3317fe['filters']));if(_0x3e44e9[_0xc55d('0x32')][_0xc55d('0x3e')]){_0x12cf06[_0xc55d('0x3c')]=_['merge'](_0x12cf06[_0xc55d('0x3c')],{'$or':_[_0xc55d('0x2c')](_0x12cf06[_0xc55d('0x35')],function(_0x238bfe){var _0x5490e1={};_0x5490e1[_0x238bfe]={'$like':'%'+_0x3e44e9[_0xc55d('0x32')]['filter']+'%'};return _0x5490e1;})});}_0x12cf06=_[_0xc55d('0x3f')]({},_0x12cf06,_0x3e44e9[_0xc55d('0x41')]);return _0x553f21[_0xc55d('0x4e')](_0x12cf06);}})[_0xc55d('0x25')](function(_0x305265){if(_0x305265){_0x460454=_0x305265[_0xc55d('0x37')];if(!_0x3e44e9['query']['hasOwnProperty'](_0xc55d('0x39'))){_0x12cf06[_0xc55d('0x1e')]=qs['limit'](_0x3e44e9[_0xc55d('0x32')]['limit']);_0x12cf06['offset']=qs[_0xc55d('0x1c')](_0x3e44e9[_0xc55d('0x32')][_0xc55d('0x1c')]);}return _0x553f21[_0xc55d('0x4e')](_0x12cf06);}})[_0xc55d('0x25')](function(_0xe2d3af){if(_0xe2d3af){return _0xe2d3af?{'count':_0x460454,'rows':_0xe2d3af}:null;}})[_0xc55d('0x25')](respondWithResult(_0x27c47d,null))[_0xc55d('0x44')](handleError(_0x27c47d,null));};exports[_0xc55d('0x4f')]=function(_0xd34bb,_0x45af42,_0x20f884){var _0xaebd9f={};var _0x529a5f={};var _0x4c2509;var _0x31d8cf;return db[_0xc55d('0x2d')][_0xc55d('0x4b')]({'where':{'id':_0xd34bb[_0xc55d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45af42,null))['then'](function(_0x1f507b){if(_0x1f507b){_0x4c2509=_0x1f507b;_0x529a5f[_0xc55d('0x31')]=_[_0xc55d('0x33')](db[_0xc55d('0x4c')]['rawAttributes']);_0x529a5f[_0xc55d('0x32')]=_[_0xc55d('0x33')](_0xd34bb[_0xc55d('0x32')]);_0x529a5f['filters']=_[_0xc55d('0x34')](_0x529a5f[_0xc55d('0x31')],_0x529a5f[_0xc55d('0x32')]);_0xaebd9f[_0xc55d('0x35')]=_[_0xc55d('0x34')](_0x529a5f[_0xc55d('0x31')],qs[_0xc55d('0x36')](_0xd34bb[_0xc55d('0x32')][_0xc55d('0x36')]));_0xaebd9f[_0xc55d('0x35')]=_0xaebd9f[_0xc55d('0x35')][_0xc55d('0x37')]?_0xaebd9f[_0xc55d('0x35')]:_0x529a5f['model'];_0xaebd9f[_0xc55d('0x3a')]=qs[_0xc55d('0x3b')](_0xd34bb[_0xc55d('0x32')]['sort']);_0xaebd9f[_0xc55d('0x3c')]=qs[_0xc55d('0x3d')](_[_0xc55d('0x4d')](_0xd34bb[_0xc55d('0x32')],_0x529a5f[_0xc55d('0x3d')]));if(_0xd34bb[_0xc55d('0x32')][_0xc55d('0x3e')]){_0xaebd9f[_0xc55d('0x3c')]=_['merge'](_0xaebd9f[_0xc55d('0x3c')],{'$or':_[_0xc55d('0x2c')](_0xaebd9f[_0xc55d('0x35')],function(_0x353c6c){var _0x51e4d5={};_0x51e4d5[_0x353c6c]={'$like':'%'+_0xd34bb[_0xc55d('0x32')][_0xc55d('0x3e')]+'%'};return _0x51e4d5;})});}_0xaebd9f=_[_0xc55d('0x3f')]({},_0xaebd9f,_0xd34bb['options']);return _0x4c2509[_0xc55d('0x4f')](_0xaebd9f);}})['then'](function(_0x514eae){if(_0x514eae){_0x31d8cf=_0x514eae[_0xc55d('0x37')];if(!_0xd34bb[_0xc55d('0x32')]['hasOwnProperty'](_0xc55d('0x39'))){_0xaebd9f[_0xc55d('0x1e')]=qs[_0xc55d('0x1e')](_0xd34bb[_0xc55d('0x32')][_0xc55d('0x1e')]);_0xaebd9f[_0xc55d('0x1c')]=qs[_0xc55d('0x1c')](_0xd34bb[_0xc55d('0x32')][_0xc55d('0x1c')]);}return _0x4c2509[_0xc55d('0x4f')](_0xaebd9f);}})[_0xc55d('0x25')](function(_0x46e34e){if(_0x46e34e){return _0x46e34e?{'count':_0x31d8cf,'rows':_0x46e34e}:null;}})[_0xc55d('0x25')](respondWithResult(_0x45af42,null))['catch'](handleError(_0x45af42,null));};exports['getDescriptions']=function(_0x38276f,_0x32deeb,_0x402c6c){var _0x25b767={};var _0x3ba527={};var _0x58dfff;var _0x4c0507;return db[_0xc55d('0x2d')][_0xc55d('0x4b')]({'where':{'id':_0x38276f['params']['id']}})[_0xc55d('0x25')](handleEntityNotFound(_0x32deeb,null))[_0xc55d('0x25')](function(_0x151abf){if(_0x151abf){_0x58dfff=_0x151abf;_0x3ba527[_0xc55d('0x31')]=_[_0xc55d('0x33')](db['ServicenowField']['rawAttributes']);_0x3ba527[_0xc55d('0x32')]=_[_0xc55d('0x33')](_0x38276f['query']);_0x3ba527[_0xc55d('0x3d')]=_[_0xc55d('0x34')](_0x3ba527[_0xc55d('0x31')],_0x3ba527[_0xc55d('0x32')]);_0x25b767[_0xc55d('0x35')]=_[_0xc55d('0x34')](_0x3ba527[_0xc55d('0x31')],qs['fields'](_0x38276f[_0xc55d('0x32')][_0xc55d('0x36')]));_0x25b767[_0xc55d('0x35')]=_0x25b767[_0xc55d('0x35')][_0xc55d('0x37')]?_0x25b767[_0xc55d('0x35')]:_0x3ba527[_0xc55d('0x31')];_0x25b767[_0xc55d('0x3a')]=qs[_0xc55d('0x3b')](_0x38276f[_0xc55d('0x32')][_0xc55d('0x3b')]);_0x25b767[_0xc55d('0x3c')]=qs[_0xc55d('0x3d')](_[_0xc55d('0x4d')](_0x38276f['query'],_0x3ba527[_0xc55d('0x3d')]));if(_0x38276f[_0xc55d('0x32')]['filter']){_0x25b767['where']=_['merge'](_0x25b767['where'],{'$or':_[_0xc55d('0x2c')](_0x25b767[_0xc55d('0x35')],function(_0x324b7e){var _0x4c50c1={};_0x4c50c1[_0x324b7e]={'$like':'%'+_0x38276f[_0xc55d('0x32')][_0xc55d('0x3e')]+'%'};return _0x4c50c1;})});}_0x25b767=_[_0xc55d('0x3f')]({},_0x25b767,_0x38276f[_0xc55d('0x41')]);return _0x58dfff['getDescriptions'](_0x25b767);}})['then'](function(_0x4939e1){if(_0x4939e1){_0x4c0507=_0x4939e1[_0xc55d('0x37')];if(!_0x38276f[_0xc55d('0x32')][_0xc55d('0x38')]('nolimit')){_0x25b767[_0xc55d('0x1e')]=qs['limit'](_0x38276f[_0xc55d('0x32')][_0xc55d('0x1e')]);_0x25b767[_0xc55d('0x1c')]=qs[_0xc55d('0x1c')](_0x38276f[_0xc55d('0x32')][_0xc55d('0x1c')]);}return _0x58dfff['getDescriptions'](_0x25b767);}})[_0xc55d('0x25')](function(_0x5f37ac){if(_0x5f37ac){return _0x5f37ac?{'count':_0x4c0507,'rows':_0x5f37ac}:null;}})[_0xc55d('0x25')](respondWithResult(_0x32deeb,null))[_0xc55d('0x44')](handleError(_0x32deeb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 05359b9..731785a 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 _0xfd6f=['rimraf','../../config/environment','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x565e4d,_0x23d683){var _0x47e665=function(_0x85d9e){while(--_0x85d9e){_0x565e4d['push'](_0x565e4d['shift']());}};_0x47e665(++_0x23d683);}(_0xfd6f,0x19d));var _0xffd6=function(_0x7e70ab,_0x4aeaf5){_0x7e70ab=_0x7e70ab-0x0;var _0x24e291=_0xfd6f[_0x7e70ab];return _0x24e291;};'use strict';var _=require(_0xffd6('0x0'));var util=require(_0xffd6('0x1'));var logger=require(_0xffd6('0x2'))(_0xffd6('0x3'));var moment=require(_0xffd6('0x4'));var BPromise=require('bluebird');var rp=require(_0xffd6('0x5'));var fs=require('fs');var path=require(_0xffd6('0x6'));var rimraf=require(_0xffd6('0x7'));var config=require(_0xffd6('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xffd6('0x9')]=function(_0x380073,_0x3f3cd8){return _0x380073[_0xffd6('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0xffd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x37a528,_0x39e1e5){var _0x2f24b3=function(_0xb6f341){while(--_0xb6f341){_0x37a528['push'](_0x37a528['shift']());}};_0x2f24b3(++_0x39e1e5);}(_0x14a0,0x8e));var _0x014a=function(_0x44c078,_0x2d9cd3){_0x44c078=_0x44c078-0x0;var _0xdef368=_0x14a0[_0x44c078];return _0xdef368;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('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 b14717a..9131de5 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 _0x4c58=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','code','message','error','result'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0x4c58,0x18f));var _0x84c5=function(_0x54ba9d,_0x3adcce){_0x54ba9d=_0x54ba9d-0x0;var _0x37c24e=_0x4c58[_0x54ba9d];return _0x37c24e;};'use strict';var _=require(_0x84c5('0x0'));var util=require(_0x84c5('0x1'));var moment=require(_0x84c5('0x2'));var BPromise=require(_0x84c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84c5('0x4'));var db=require(_0x84c5('0x5'))['db'];var utils=require(_0x84c5('0x6'));var logger=require(_0x84c5('0x7'))(_0x84c5('0x8'));var config=require(_0x84c5('0x9'));var jayson=require(_0x84c5('0xa'));var client=jayson[_0x84c5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4eba35,_0x2bfbc7,_0x1dee32){return new BPromise(function(_0x187b1d,_0x358c72){return client[_0x84c5('0xc')](_0x4eba35,_0x1dee32)[_0x84c5('0xd')](function(_0x56868e){logger[_0x84c5('0xe')](_0x84c5('0xf'),_0x2bfbc7,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2bfbc7,_0x84c5('0x10'),JSON['stringify'](_0x56868e));if(_0x56868e['error']){if(_0x56868e['error'][_0x84c5('0x11')]===0x1f4){logger['error'](_0x84c5('0xf'),_0x2bfbc7,_0x56868e['error'][_0x84c5('0x12')]);return _0x358c72(_0x56868e[_0x84c5('0x13')]['message']);}logger[_0x84c5('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2bfbc7,_0x56868e[_0x84c5('0x13')][_0x84c5('0x12')]);return _0x187b1d(_0x56868e[_0x84c5('0x13')][_0x84c5('0x12')]);}else{logger[_0x84c5('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2bfbc7,_0x84c5('0x10'));_0x187b1d(_0x56868e[_0x84c5('0x14')][_0x84c5('0x12')]);}})['catch'](function(_0x5e2b95){logger[_0x84c5('0x13')](_0x84c5('0xf'),_0x2bfbc7,_0x5e2b95);_0x358c72(_0x5e2b95);});});} \ No newline at end of file +var _0x022e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment'];(function(_0x598fc5,_0x36a47d){var _0x562451=function(_0x5a5047){while(--_0x5a5047){_0x598fc5['push'](_0x598fc5['shift']());}};_0x562451(++_0x36a47d);}(_0x022e,0xc4));var _0xe022=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x022e[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xe022('0x0'));var util=require('util');var moment=require(_0xe022('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe022('0x2'))['db'];var utils=require(_0xe022('0x3'));var logger=require('../../config/logger')(_0xe022('0x4'));var config=require(_0xe022('0x5'));var jayson=require(_0xe022('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24513d,_0x56bcb5,_0x52c7ec){return new BPromise(function(_0x39d424,_0xce6f15){return client[_0xe022('0x7')](_0x24513d,_0x52c7ec)[_0xe022('0x8')](function(_0x38f264){logger[_0xe022('0x9')](_0xe022('0xa'),_0x56bcb5,_0xe022('0xb'));logger[_0xe022('0xc')](_0xe022('0xd'),_0x56bcb5,_0xe022('0xb'),JSON[_0xe022('0xe')](_0x38f264));if(_0x38f264[_0xe022('0xf')]){if(_0x38f264[_0xe022('0xf')]['code']===0x1f4){logger[_0xe022('0xf')](_0xe022('0xa'),_0x56bcb5,_0x38f264['error']['message']);return _0xce6f15(_0x38f264['error'][_0xe022('0x10')]);}logger[_0xe022('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x56bcb5,_0x38f264[_0xe022('0xf')]['message']);return _0x39d424(_0x38f264['error'][_0xe022('0x10')]);}else{logger[_0xe022('0x9')](_0xe022('0xa'),_0x56bcb5,'request\x20sent');_0x39d424(_0x38f264['result']['message']);}})[_0xe022('0x11')](function(_0x3444d3){logger[_0xe022('0xf')](_0xe022('0xa'),_0x56bcb5,_0x3444d3);_0xce6f15(_0x3444d3);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c721a6d..0a798e7 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 _0x9181=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5553ea,_0x38287b){var _0x50ee2c=function(_0x9d54be){while(--_0x9d54be){_0x5553ea['push'](_0x5553ea['shift']());}};_0x50ee2c(++_0x38287b);}(_0x9181,0x1f4));var _0x1918=function(_0x775736,_0x2ba67d){_0x775736=_0x775736-0x0;var _0x5b032f=_0x9181[_0x775736];return _0x5b032f;};'use strict';var multer=require('multer');var util=require(_0x1918('0x0'));var path=require(_0x1918('0x1'));var timeout=require(_0x1918('0x2'));var express=require(_0x1918('0x3'));var router=express[_0x1918('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1918('0x5'));var interaction=require(_0x1918('0x6'));var config=require(_0x1918('0x7'));var controller=require(_0x1918('0x8'));router[_0x1918('0x9')]('/',auth[_0x1918('0xa')](),controller['index']);router[_0x1918('0x9')](_0x1918('0xb'),auth['isAuthenticated'](),controller[_0x1918('0xc')]);router['post']('/',auth[_0x1918('0xa')](),controller[_0x1918('0xd')]);router['put'](_0x1918('0xb'),auth[_0x1918('0xa')](),controller[_0x1918('0xe')]);router[_0x1918('0xf')]('/:id',auth[_0x1918('0xa')](),controller[_0x1918('0x10')]);module[_0x1918('0x11')]=router; \ No newline at end of file +var _0x1bc8=['/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create'];(function(_0x15badf,_0x48c1d7){var _0x547965=function(_0x40ffa6){while(--_0x40ffa6){_0x15badf['push'](_0x15badf['shift']());}};_0x547965(++_0x48c1d7);}(_0x1bc8,0x70));var _0x81bc=function(_0x170941,_0x38d105){_0x170941=_0x170941-0x0;var _0x50e48d=_0x1bc8[_0x170941];return _0x50e48d;};'use strict';var multer=require(_0x81bc('0x0'));var util=require(_0x81bc('0x1'));var path=require(_0x81bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x81bc('0x3'));var router=express[_0x81bc('0x4')]();var fs_extra=require(_0x81bc('0x5'));var auth=require(_0x81bc('0x6'));var interaction=require(_0x81bc('0x7'));var config=require(_0x81bc('0x8'));var controller=require('./intServicenowField.controller');router[_0x81bc('0x9')]('/',auth[_0x81bc('0xa')](),controller['index']);router[_0x81bc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x81bc('0xb')]);router[_0x81bc('0xc')]('/',auth[_0x81bc('0xa')](),controller[_0x81bc('0xd')]);router['put'](_0x81bc('0xe'),auth[_0x81bc('0xa')](),controller['update']);router[_0x81bc('0xf')]('/:id',auth[_0x81bc('0xa')](),controller[_0x81bc('0x10')]);module[_0x81bc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 67e7ba6..ed108ce 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 _0xbb19=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x3c10e0,_0x4e4524){var _0x4a16be=function(_0x477b19){while(--_0x477b19){_0x3c10e0['push'](_0x3c10e0['shift']());}};_0x4a16be(++_0x4e4524);}(_0xbb19,0x1d1));var _0x9bb1=function(_0x94eff1,_0x47ced5){_0x94eff1=_0x94eff1-0x0;var _0x3c2dac=_0xbb19[_0x94eff1];return _0x3c2dac;};'use strict';var Sequelize=require(_0x9bb1('0x0'));module[_0x9bb1('0x1')]={'type':{'type':Sequelize[_0x9bb1('0x2')](_0x9bb1('0x3'),_0x9bb1('0x4'),_0x9bb1('0x5'),_0x9bb1('0x6'),_0x9bb1('0x7')),'defaultValue':_0x9bb1('0x3')},'content':{'type':Sequelize[_0x9bb1('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9bb1('0x2')](_0x9bb1('0x3'),'variable',_0x9bb1('0x5'))},'keyContent':{'type':Sequelize[_0x9bb1('0x8')]},'idField':{'type':Sequelize[_0x9bb1('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9bb1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9bb1('0x8')]}}; \ No newline at end of file +var _0x1662=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x1662,0xea));var _0x2166=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1662[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x2166('0x0'));module[_0x2166('0x1')]={'type':{'type':Sequelize[_0x2166('0x2')](_0x2166('0x3'),_0x2166('0x4'),_0x2166('0x5'),_0x2166('0x6'),_0x2166('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2166('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2166('0x2')](_0x2166('0x3'),_0x2166('0x4'),_0x2166('0x5'))},'keyContent':{'type':Sequelize[_0x2166('0x8')]},'idField':{'type':Sequelize[_0x2166('0x8')]},'nameField':{'type':Sequelize[_0x2166('0x8')]},'customField':{'type':Sequelize[_0x2166('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2166('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 8be0b69..d1c31bb 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 _0x5d0e=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','intersection','attributes','nolimit','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','ServicenowField','rawAttributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x5d0e,0x1af));var _0xe5d0=function(_0x1b06e8,_0x40463){_0x1b06e8=_0x1b06e8-0x0;var _0x219a98=_0x5d0e[_0x1b06e8];return _0x219a98;};'use strict';var emlformat=require(_0xe5d0('0x0'));var rimraf=require(_0xe5d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe5d0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe5d0('0x3'));var Mustache=require('mustache');var util=require(_0xe5d0('0x4'));var path=require(_0xe5d0('0x5'));var sox=require(_0xe5d0('0x6'));var csv=require('to-csv');var ejs=require(_0xe5d0('0x7'));var fs=require('fs');var fs_extra=require(_0xe5d0('0x8'));var _=require('lodash');var squel=require(_0xe5d0('0x9'));var crypto=require(_0xe5d0('0xa'));var jsforce=require(_0xe5d0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe5d0('0xc'));var querystring=require(_0xe5d0('0xd'));var Papa=require('papaparse');var Redis=require(_0xe5d0('0xe'));var authService=require(_0xe5d0('0xf'));var qs=require(_0xe5d0('0x10'));var as=require(_0xe5d0('0x11'));var hardwareService=require(_0xe5d0('0x12'));var logger=require(_0xe5d0('0x13'))(_0xe5d0('0x14'));var utils=require(_0xe5d0('0x15'));var config=require(_0xe5d0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5d0('0x17'))['db'];function respondWithStatusCode(_0x880026,_0xcd8cd6){_0xcd8cd6=_0xcd8cd6||0xcc;return function(_0x39a783){if(_0x39a783){return _0x880026['sendStatus'](_0xcd8cd6);}return _0x880026['status'](_0xcd8cd6)[_0xe5d0('0x18')]();};}function respondWithResult(_0x205529,_0x405e0e){_0x405e0e=_0x405e0e||0xc8;return function(_0x57b21c){if(_0x57b21c){return _0x205529[_0xe5d0('0x19')](_0x405e0e)[_0xe5d0('0x1a')](_0x57b21c);}};}function respondWithFilteredResult(_0x34278d,_0x95900e){return function(_0x58faf5){if(_0x58faf5){var _0x5571a8=typeof _0x95900e[_0xe5d0('0x1b')]===_0xe5d0('0x1c')&&typeof _0x95900e[_0xe5d0('0x1d')]===_0xe5d0('0x1c');var _0x4f5e62=_0x58faf5[_0xe5d0('0x1e')];var _0x5e12ed=_0x5571a8?0x0:_0x95900e['offset'];var _0x167c27=_0x5571a8?_0x58faf5[_0xe5d0('0x1e')]:_0x95900e[_0xe5d0('0x1b')]+_0x95900e[_0xe5d0('0x1d')];var _0x2b5ec7;if(_0x167c27>=_0x4f5e62){_0x167c27=_0x4f5e62;_0x2b5ec7=0xc8;}else{_0x2b5ec7=0xce;}_0x34278d[_0xe5d0('0x19')](_0x2b5ec7);return _0x34278d[_0xe5d0('0x1f')]('Content-Range',_0x5e12ed+'-'+_0x167c27+'/'+_0x4f5e62)[_0xe5d0('0x1a')](_0x58faf5);}return null;};}function patchUpdates(_0x5a4e1a){return function(_0x453428){try{jsonpatch[_0xe5d0('0x20')](_0x453428,_0x5a4e1a,!![]);}catch(_0x12eda1){return BPromise[_0xe5d0('0x21')](_0x12eda1);}return _0x453428[_0xe5d0('0x22')]();};}function saveUpdates(_0x1822b1,_0x251507){return function(_0x11874d){if(_0x11874d){return _0x11874d[_0xe5d0('0x23')](_0x1822b1)[_0xe5d0('0x24')](function(_0x2075b5){return _0x2075b5;});}return null;};}function removeEntity(_0x33bebd,_0x3e04bd){return function(_0x30f0e9){if(_0x30f0e9){return _0x30f0e9[_0xe5d0('0x25')]()['then'](function(){_0x33bebd[_0xe5d0('0x19')](0xcc)[_0xe5d0('0x18')]();});}};}function handleEntityNotFound(_0x52934b,_0x3f6c5c){return function(_0x4d22bc){if(!_0x4d22bc){_0x52934b['sendStatus'](0x194);}return _0x4d22bc;};}function handleError(_0x143c34,_0x59a36f){_0x59a36f=_0x59a36f||0x1f4;return function(_0x5934bc){logger[_0xe5d0('0x26')](_0x5934bc[_0xe5d0('0x27')]);if(_0x5934bc[_0xe5d0('0x28')]){delete _0x5934bc['name'];}_0x143c34[_0xe5d0('0x19')](_0x59a36f)[_0xe5d0('0x29')](_0x5934bc);};}exports[_0xe5d0('0x2a')]=function(_0x5c250c,_0x46a53e){var _0x4da934={},_0x485d3c={},_0x238c16={'count':0x0,'rows':[]};var _0xd45184=_['map'](db['ServicenowField']['rawAttributes'],function(_0x1ebca9){return{'name':_0x1ebca9[_0xe5d0('0x2b')],'type':_0x1ebca9[_0xe5d0('0x2c')][_0xe5d0('0x2d')]};});_0x485d3c[_0xe5d0('0x2e')]=_[_0xe5d0('0x2f')](_0xd45184,'name');_0x485d3c[_0xe5d0('0x30')]=_[_0xe5d0('0x31')](_0x5c250c['query']);_0x485d3c['filters']=_[_0xe5d0('0x32')](_0x485d3c[_0xe5d0('0x2e')],_0x485d3c[_0xe5d0('0x30')]);_0x4da934[_0xe5d0('0x33')]=_[_0xe5d0('0x32')](_0x485d3c[_0xe5d0('0x2e')],qs['fields'](_0x5c250c[_0xe5d0('0x30')]['fields']));_0x4da934['attributes']=_0x4da934['attributes']['length']?_0x4da934[_0xe5d0('0x33')]:_0x485d3c[_0xe5d0('0x2e')];if(!_0x5c250c[_0xe5d0('0x30')]['hasOwnProperty'](_0xe5d0('0x34'))){_0x4da934[_0xe5d0('0x1d')]=qs[_0xe5d0('0x1d')](_0x5c250c[_0xe5d0('0x30')]['limit']);_0x4da934[_0xe5d0('0x1b')]=qs[_0xe5d0('0x1b')](_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x1b')]);}_0x4da934['order']=qs[_0xe5d0('0x35')](_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x35')]);_0x4da934[_0xe5d0('0x36')]=qs['filters'](_[_0xe5d0('0x37')](_0x5c250c[_0xe5d0('0x30')],_0x485d3c[_0xe5d0('0x38')]),_0xd45184);if(_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x39')]){_0x4da934[_0xe5d0('0x36')]=_['merge'](_0x4da934[_0xe5d0('0x36')],{'$or':_[_0xe5d0('0x2f')](_0xd45184,function(_0x1aa89c){if(_0x1aa89c[_0xe5d0('0x2c')]!==_0xe5d0('0x3a')){var _0x530228={};_0x530228[_0x1aa89c['name']]={'$like':'%'+_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x39')]+'%'};return _0x530228;}})});}_0x4da934=_['merge']({},_0x4da934,_0x5c250c[_0xe5d0('0x3b')]);var _0xf0af53={'where':_0x4da934[_0xe5d0('0x36')]};return db['ServicenowField']['count'](_0xf0af53)['then'](function(_0xf18537){_0x238c16[_0xe5d0('0x1e')]=_0xf18537;if(_0x5c250c[_0xe5d0('0x30')][_0xe5d0('0x3c')]){_0x4da934[_0xe5d0('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0xe5d0('0x3e')](_0x4da934);})['then'](function(_0x5d552b){_0x238c16[_0xe5d0('0x3f')]=_0x5d552b;return _0x238c16;})[_0xe5d0('0x24')](respondWithFilteredResult(_0x46a53e,_0x4da934))['catch'](handleError(_0x46a53e,null));};exports['show']=function(_0x2fb4eb,_0x142066){var _0x24f1b1={'raw':!![],'where':{'id':_0x2fb4eb[_0xe5d0('0x40')]['id']}},_0x2c55dc={};_0x2c55dc[_0xe5d0('0x2e')]=_[_0xe5d0('0x31')](db[_0xe5d0('0x41')][_0xe5d0('0x42')]);_0x2c55dc['query']=_[_0xe5d0('0x31')](_0x2fb4eb[_0xe5d0('0x30')]);_0x2c55dc['filters']=_['intersection'](_0x2c55dc[_0xe5d0('0x2e')],_0x2c55dc[_0xe5d0('0x30')]);_0x24f1b1[_0xe5d0('0x33')]=_[_0xe5d0('0x32')](_0x2c55dc['model'],qs['fields'](_0x2fb4eb['query'][_0xe5d0('0x43')]));_0x24f1b1[_0xe5d0('0x33')]=_0x24f1b1[_0xe5d0('0x33')][_0xe5d0('0x44')]?_0x24f1b1[_0xe5d0('0x33')]:_0x2c55dc[_0xe5d0('0x2e')];if(_0x2fb4eb[_0xe5d0('0x30')]['includeAll']){_0x24f1b1['include']=[{'all':!![]}];}_0x24f1b1=_[_0xe5d0('0x45')]({},_0x24f1b1,_0x2fb4eb[_0xe5d0('0x3b')]);return db['ServicenowField'][_0xe5d0('0x46')](_0x24f1b1)[_0xe5d0('0x24')](handleEntityNotFound(_0x142066,null))[_0xe5d0('0x24')](respondWithResult(_0x142066,null))[_0xe5d0('0x47')](handleError(_0x142066,null));};exports[_0xe5d0('0x48')]=function(_0x4fa3b7,_0x1890a){return db[_0xe5d0('0x41')][_0xe5d0('0x48')](_0x4fa3b7[_0xe5d0('0x49')],{})[_0xe5d0('0x24')](respondWithResult(_0x1890a,0xc9))[_0xe5d0('0x47')](handleError(_0x1890a,null));};exports['update']=function(_0x551d07,_0x10e76c){if(_0x551d07[_0xe5d0('0x49')]['id']){delete _0x551d07[_0xe5d0('0x49')]['id'];}return db[_0xe5d0('0x41')][_0xe5d0('0x46')]({'where':{'id':_0x551d07[_0xe5d0('0x40')]['id']}})[_0xe5d0('0x24')](handleEntityNotFound(_0x10e76c,null))[_0xe5d0('0x24')](saveUpdates(_0x551d07['body'],null))[_0xe5d0('0x24')](respondWithResult(_0x10e76c,null))[_0xe5d0('0x47')](handleError(_0x10e76c,null));};exports['destroy']=function(_0x175fcd,_0x9e2085){return db[_0xe5d0('0x41')]['find']({'where':{'id':_0x175fcd[_0xe5d0('0x40')]['id']}})[_0xe5d0('0x24')](handleEntityNotFound(_0x9e2085,null))[_0xe5d0('0x24')](removeEntity(_0x9e2085,null))['catch'](handleError(_0x9e2085,null));}; \ No newline at end of file +var _0x5a70=['count','offset','set','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','options','ServicenowField','include','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined'];(function(_0x114596,_0x4b4a6b){var _0x3075e8=function(_0x270de0){while(--_0x270de0){_0x114596['push'](_0x114596['shift']());}};_0x3075e8(++_0x4b4a6b);}(_0x5a70,0x183));var _0x05a7=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x5a70[_0x8c1005];return _0x175354;};'use strict';var emlformat=require(_0x05a7('0x0'));var rimraf=require(_0x05a7('0x1'));var zipdir=require(_0x05a7('0x2'));var jsonpatch=require(_0x05a7('0x3'));var rp=require(_0x05a7('0x4'));var moment=require('moment');var BPromise=require(_0x05a7('0x5'));var Mustache=require(_0x05a7('0x6'));var util=require(_0x05a7('0x7'));var path=require(_0x05a7('0x8'));var sox=require('sox');var csv=require(_0x05a7('0x9'));var ejs=require(_0x05a7('0xa'));var fs=require('fs');var fs_extra=require(_0x05a7('0xb'));var _=require(_0x05a7('0xc'));var squel=require(_0x05a7('0xd'));var crypto=require('crypto');var jsforce=require(_0x05a7('0xe'));var deskjs=require(_0x05a7('0xf'));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(_0x05a7('0x10'));var as=require(_0x05a7('0x11'));var hardwareService=require(_0x05a7('0x12'));var logger=require('../../config/logger')(_0x05a7('0x13'));var utils=require('../../config/utils');var config=require(_0x05a7('0x14'));var licenseUtil=require(_0x05a7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f1e5f,_0x5c9aa4){_0x5c9aa4=_0x5c9aa4||0xcc;return function(_0x15965a){if(_0x15965a){return _0x5f1e5f[_0x05a7('0x16')](_0x5c9aa4);}return _0x5f1e5f[_0x05a7('0x17')](_0x5c9aa4)[_0x05a7('0x18')]();};}function respondWithResult(_0x3a3a34,_0x57fa97){_0x57fa97=_0x57fa97||0xc8;return function(_0x5a18ba){if(_0x5a18ba){return _0x3a3a34[_0x05a7('0x17')](_0x57fa97)[_0x05a7('0x19')](_0x5a18ba);}};}function respondWithFilteredResult(_0x3f6dd7,_0x5e4a8e){return function(_0x5a969d){if(_0x5a969d){var _0x239a8f=typeof _0x5e4a8e['offset']==='undefined'&&typeof _0x5e4a8e['limit']===_0x05a7('0x1a');var _0x5b7523=_0x5a969d[_0x05a7('0x1b')];var _0x488e62=_0x239a8f?0x0:_0x5e4a8e[_0x05a7('0x1c')];var _0x162cc9=_0x239a8f?_0x5a969d[_0x05a7('0x1b')]:_0x5e4a8e['offset']+_0x5e4a8e['limit'];var _0x86cb88;if(_0x162cc9>=_0x5b7523){_0x162cc9=_0x5b7523;_0x86cb88=0xc8;}else{_0x86cb88=0xce;}_0x3f6dd7[_0x05a7('0x17')](_0x86cb88);return _0x3f6dd7[_0x05a7('0x1d')]('Content-Range',_0x488e62+'-'+_0x162cc9+'/'+_0x5b7523)[_0x05a7('0x19')](_0x5a969d);}return null;};}function patchUpdates(_0x3e4318){return function(_0xdea8e6){try{jsonpatch['apply'](_0xdea8e6,_0x3e4318,!![]);}catch(_0x5d029d){return BPromise['reject'](_0x5d029d);}return _0xdea8e6[_0x05a7('0x1e')]();};}function saveUpdates(_0x7bacbf,_0x449b90){return function(_0x1241a2){if(_0x1241a2){return _0x1241a2[_0x05a7('0x1f')](_0x7bacbf)[_0x05a7('0x20')](function(_0x5642ab){return _0x5642ab;});}return null;};}function removeEntity(_0x127109,_0x3ffaf1){return function(_0x1a6937){if(_0x1a6937){return _0x1a6937['destroy']()[_0x05a7('0x20')](function(){_0x127109[_0x05a7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3a05,_0x40346a){return function(_0x4f92b1){if(!_0x4f92b1){_0x2e3a05[_0x05a7('0x16')](0x194);}return _0x4f92b1;};}function handleError(_0x3521f9,_0x77e8e7){_0x77e8e7=_0x77e8e7||0x1f4;return function(_0x16226c){logger[_0x05a7('0x21')](_0x16226c[_0x05a7('0x22')]);if(_0x16226c[_0x05a7('0x23')]){delete _0x16226c[_0x05a7('0x23')];}_0x3521f9[_0x05a7('0x17')](_0x77e8e7)[_0x05a7('0x24')](_0x16226c);};}exports[_0x05a7('0x25')]=function(_0xee0edd,_0x2eb100){var _0x3d8e51={},_0x208da6={},_0x5cc23c={'count':0x0,'rows':[]};var _0x4d1992=_[_0x05a7('0x26')](db['ServicenowField'][_0x05a7('0x27')],function(_0x4bbc84){return{'name':_0x4bbc84[_0x05a7('0x28')],'type':_0x4bbc84[_0x05a7('0x29')][_0x05a7('0x2a')]};});_0x208da6['model']=_[_0x05a7('0x26')](_0x4d1992,'name');_0x208da6['query']=_[_0x05a7('0x2b')](_0xee0edd[_0x05a7('0x2c')]);_0x208da6['filters']=_[_0x05a7('0x2d')](_0x208da6[_0x05a7('0x2e')],_0x208da6[_0x05a7('0x2c')]);_0x3d8e51[_0x05a7('0x2f')]=_[_0x05a7('0x2d')](_0x208da6[_0x05a7('0x2e')],qs['fields'](_0xee0edd[_0x05a7('0x2c')][_0x05a7('0x30')]));_0x3d8e51[_0x05a7('0x2f')]=_0x3d8e51[_0x05a7('0x2f')][_0x05a7('0x31')]?_0x3d8e51[_0x05a7('0x2f')]:_0x208da6[_0x05a7('0x2e')];if(!_0xee0edd['query'][_0x05a7('0x32')](_0x05a7('0x33'))){_0x3d8e51['limit']=qs[_0x05a7('0x34')](_0xee0edd[_0x05a7('0x2c')][_0x05a7('0x34')]);_0x3d8e51[_0x05a7('0x1c')]=qs['offset'](_0xee0edd['query']['offset']);}_0x3d8e51[_0x05a7('0x35')]=qs['sort'](_0xee0edd[_0x05a7('0x2c')][_0x05a7('0x36')]);_0x3d8e51[_0x05a7('0x37')]=qs['filters'](_['pick'](_0xee0edd[_0x05a7('0x2c')],_0x208da6[_0x05a7('0x38')]),_0x4d1992);if(_0xee0edd[_0x05a7('0x2c')]['filter']){_0x3d8e51['where']=_[_0x05a7('0x39')](_0x3d8e51[_0x05a7('0x37')],{'$or':_[_0x05a7('0x26')](_0x4d1992,function(_0x13817e){if(_0x13817e[_0x05a7('0x29')]!=='VIRTUAL'){var _0x3ec95c={};_0x3ec95c[_0x13817e[_0x05a7('0x23')]]={'$like':'%'+_0xee0edd[_0x05a7('0x2c')]['filter']+'%'};return _0x3ec95c;}})});}_0x3d8e51=_[_0x05a7('0x39')]({},_0x3d8e51,_0xee0edd[_0x05a7('0x3a')]);var _0x3d1827={'where':_0x3d8e51[_0x05a7('0x37')]};return db[_0x05a7('0x3b')][_0x05a7('0x1b')](_0x3d1827)[_0x05a7('0x20')](function(_0x1de0f0){_0x5cc23c[_0x05a7('0x1b')]=_0x1de0f0;if(_0xee0edd[_0x05a7('0x2c')]['includeAll']){_0x3d8e51[_0x05a7('0x3c')]=[{'all':!![]}];}return db[_0x05a7('0x3b')]['findAll'](_0x3d8e51);})[_0x05a7('0x20')](function(_0x24ca9d){_0x5cc23c[_0x05a7('0x3d')]=_0x24ca9d;return _0x5cc23c;})[_0x05a7('0x20')](respondWithFilteredResult(_0x2eb100,_0x3d8e51))[_0x05a7('0x3e')](handleError(_0x2eb100,null));};exports[_0x05a7('0x3f')]=function(_0x4aa7f4,_0x4b3144){var _0x31bd98={'raw':!![],'where':{'id':_0x4aa7f4['params']['id']}},_0x3919f9={};_0x3919f9[_0x05a7('0x2e')]=_[_0x05a7('0x2b')](db['ServicenowField'][_0x05a7('0x27')]);_0x3919f9[_0x05a7('0x2c')]=_[_0x05a7('0x2b')](_0x4aa7f4[_0x05a7('0x2c')]);_0x3919f9[_0x05a7('0x38')]=_['intersection'](_0x3919f9[_0x05a7('0x2e')],_0x3919f9['query']);_0x31bd98[_0x05a7('0x2f')]=_[_0x05a7('0x2d')](_0x3919f9[_0x05a7('0x2e')],qs[_0x05a7('0x30')](_0x4aa7f4[_0x05a7('0x2c')][_0x05a7('0x30')]));_0x31bd98['attributes']=_0x31bd98[_0x05a7('0x2f')][_0x05a7('0x31')]?_0x31bd98[_0x05a7('0x2f')]:_0x3919f9[_0x05a7('0x2e')];if(_0x4aa7f4[_0x05a7('0x2c')]['includeAll']){_0x31bd98['include']=[{'all':!![]}];}_0x31bd98=_['merge']({},_0x31bd98,_0x4aa7f4[_0x05a7('0x3a')]);return db[_0x05a7('0x3b')][_0x05a7('0x40')](_0x31bd98)[_0x05a7('0x20')](handleEntityNotFound(_0x4b3144,null))['then'](respondWithResult(_0x4b3144,null))[_0x05a7('0x3e')](handleError(_0x4b3144,null));};exports[_0x05a7('0x41')]=function(_0x1e233f,_0x1b9bbd){return db['ServicenowField'][_0x05a7('0x41')](_0x1e233f[_0x05a7('0x42')],{})[_0x05a7('0x20')](respondWithResult(_0x1b9bbd,0xc9))[_0x05a7('0x3e')](handleError(_0x1b9bbd,null));};exports[_0x05a7('0x1f')]=function(_0x52a45c,_0x4a2f52){if(_0x52a45c[_0x05a7('0x42')]['id']){delete _0x52a45c['body']['id'];}return db[_0x05a7('0x3b')][_0x05a7('0x40')]({'where':{'id':_0x52a45c[_0x05a7('0x43')]['id']}})[_0x05a7('0x20')](handleEntityNotFound(_0x4a2f52,null))[_0x05a7('0x20')](saveUpdates(_0x52a45c[_0x05a7('0x42')],null))[_0x05a7('0x20')](respondWithResult(_0x4a2f52,null))['catch'](handleError(_0x4a2f52,null));};exports[_0x05a7('0x44')]=function(_0x51f8e6,_0x73703c){return db[_0x05a7('0x3b')][_0x05a7('0x40')]({'where':{'id':_0x51f8e6['params']['id']}})[_0x05a7('0x20')](handleEntityNotFound(_0x73703c,null))[_0x05a7('0x20')](removeEntity(_0x73703c,null))[_0x05a7('0x3e')](handleError(_0x73703c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ed392c3..a382b62 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 _0x6dc6=['exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x3c63f3,_0x3130ac){var _0x1c1296=function(_0x15e74c){while(--_0x15e74c){_0x3c63f3['push'](_0x3c63f3['shift']());}};_0x1c1296(++_0x3130ac);}(_0x6dc6,0xd8));var _0x66dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6dc6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x66dc('0x0'));var logger=require('../../config/logger')(_0x66dc('0x1'));var moment=require(_0x66dc('0x2'));var BPromise=require('bluebird');var rp=require(_0x66dc('0x3'));var fs=require('fs');var path=require(_0x66dc('0x4'));var rimraf=require(_0x66dc('0x5'));var config=require(_0x66dc('0x6'));var attributes=require(_0x66dc('0x7'));module[_0x66dc('0x8')]=function(_0x484087,_0x1fe7d7){return _0x484087[_0x66dc('0x9')](_0x66dc('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x66dc('0xb'),'fields':[_0x66dc('0xc'),_0x66dc('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae14=['servicenow_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xae14,0x152));var _0x4ae1=function(_0x99f2b5,_0xfe1b39){_0x99f2b5=_0x99f2b5-0x0;var _0x564380=_0xae14[_0x99f2b5];return _0x564380;};'use strict';var _=require(_0x4ae1('0x0'));var util=require('util');var logger=require(_0x4ae1('0x1'))(_0x4ae1('0x2'));var moment=require(_0x4ae1('0x3'));var BPromise=require(_0x4ae1('0x4'));var rp=require(_0x4ae1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4ae1('0x6'));var attributes=require(_0x4ae1('0x7'));module[_0x4ae1('0x8')]=function(_0x3a3643,_0x417088){return _0x3a3643['define']('ServicenowField',attributes,{'tableName':_0x4ae1('0x9'),'paranoid':![],'indexes':[{'name':_0x4ae1('0xa'),'fields':['idField',_0x4ae1('0xb')],'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 009e148..dbe82e5 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 _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(_0x46b573,_0x388f6d){var _0x3bcf35=function(_0x531d44){while(--_0x531d44){_0x46b573['push'](_0x46b573['shift']());}};_0x3bcf35(++_0x388f6d);}(_0xaa88,0x137));var _0x8aa8=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0xaa88[_0x48cb1f];return _0x172c4d;};'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 +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ae9a2,_0x36e838){var _0x1d3436=function(_0x4837f8){while(--_0x4837f8){_0x3ae9a2['push'](_0x3ae9a2['shift']());}};_0x1d3436(++_0x36e838);}(_0x70e0,0x17b));var _0x070e=function(_0x59e3cc,_0x4b283f){_0x59e3cc=_0x59e3cc-0x0;var _0x36fd33=_0x70e0[_0x59e3cc];return _0x36fd33;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ee7f568..90a6fc6 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(_0x46e6cc,_0x217b45){var _0x9be343=function(_0x56be01){while(--_0x56be01){_0x46e6cc['push'](_0x46e6cc['shift']());}};_0x9be343(++_0x217b45);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xa11108,_0x1cbaf1){var _0x108bd3=function(_0x3c0ee3){while(--_0x3c0ee3){_0xa11108['push'](_0xa11108['shift']());}};_0x108bd3(++_0x1cbaf1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 515cb57..5fd7d3f 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(_0x5e9d1a,_0x584217){var _0x43f617=function(_0x79b1c9){while(--_0x79b1c9){_0x5e9d1a['push'](_0x5e9d1a['shift']());}};_0x43f617(++_0x584217);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x4faf01,_0x46af65){var _0xacfcc=function(_0x5206f7){while(--_0x5206f7){_0x4faf01['push'](_0x4faf01['shift']());}};_0xacfcc(++_0x46af65);}(_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 7b7728f..33b2232 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 _0x2bdb=['username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','stringify','Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_type','parent_name','direction'];(function(_0x20eeff,_0x532c16){var _0x7db88f=function(_0x36b56b){while(--_0x36b56b){_0x20eeff['push'](_0x20eeff['shift']());}};_0x7db88f(++_0x532c16);}(_0x2bdb,0x105));var _0xb2bd=function(_0x29a08d,_0x551eca){_0x29a08d=_0x29a08d-0x0;var _0x10fc1a=_0x2bdb[_0x29a08d];return _0x10fc1a;};'use strict';var emlformat=require(_0xb2bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2bd('0x2'));var moment=require(_0xb2bd('0x3'));var BPromise=require(_0xb2bd('0x4'));var Mustache=require('mustache');var util=require(_0xb2bd('0x5'));var path=require(_0xb2bd('0x6'));var sox=require(_0xb2bd('0x7'));var csv=require(_0xb2bd('0x8'));var ejs=require(_0xb2bd('0x9'));var fs=require('fs');var fs_extra=require(_0xb2bd('0xa'));var _=require(_0xb2bd('0xb'));var squel=require('squel');var crypto=require(_0xb2bd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb2bd('0xd'));var toCsv=require(_0xb2bd('0x8'));var querystring=require(_0xb2bd('0xe'));var Papa=require(_0xb2bd('0xf'));var Redis=require(_0xb2bd('0x10'));var authService=require(_0xb2bd('0x11'));var qs=require(_0xb2bd('0x12'));var as=require(_0xb2bd('0x13'));var hardwareService=require(_0xb2bd('0x14'));var logger=require('../../config/logger')(_0xb2bd('0x15'));var utils=require(_0xb2bd('0x16'));var config=require(_0xb2bd('0x17'));var licenseUtil=require(_0xb2bd('0x18'));var db=require(_0xb2bd('0x19'))['db'];var integrations=require(_0xb2bd('0x1a'));function respondWithStatusCode(_0x6d2212,_0x452cd6){_0x452cd6=_0x452cd6||0xcc;return function(_0x58425a){if(_0x58425a){return _0x6d2212[_0xb2bd('0x1b')](_0x452cd6);}return _0x6d2212['status'](_0x452cd6)[_0xb2bd('0x1c')]();};}function respondWithResult(_0x2adda1,_0x17e238){_0x17e238=_0x17e238||0xc8;return function(_0x259053){if(_0x259053){return _0x2adda1[_0xb2bd('0x1d')](_0x17e238)['json'](_0x259053);}};}function respondWithFilteredResult(_0x23c440,_0x315ecc){return function(_0x2091d2){if(_0x2091d2){var _0x991fe=typeof _0x315ecc['offset']===_0xb2bd('0x1e')&&typeof _0x315ecc[_0xb2bd('0x1f')]==='undefined';var _0x1ad53e=_0x2091d2[_0xb2bd('0x20')];var _0x387897=_0x991fe?0x0:_0x315ecc[_0xb2bd('0x21')];var _0x5d848d=_0x991fe?_0x2091d2[_0xb2bd('0x20')]:_0x315ecc[_0xb2bd('0x21')]+_0x315ecc['limit'];var _0xd89760;if(_0x5d848d>=_0x1ad53e){_0x5d848d=_0x1ad53e;_0xd89760=0xc8;}else{_0xd89760=0xce;}_0x23c440[_0xb2bd('0x1d')](_0xd89760);return _0x23c440['set']('Content-Range',_0x387897+'-'+_0x5d848d+'/'+_0x1ad53e)['json'](_0x2091d2);}return null;};}function patchUpdates(_0x31a69f){return function(_0x4dfda8){try{jsonpatch[_0xb2bd('0x22')](_0x4dfda8,_0x31a69f,!![]);}catch(_0x48fc57){return BPromise[_0xb2bd('0x23')](_0x48fc57);}return _0x4dfda8[_0xb2bd('0x24')]();};}function saveUpdates(_0x505c35,_0x246f71){return function(_0x5e55f1){if(_0x5e55f1){return _0x5e55f1[_0xb2bd('0x25')](_0x505c35)[_0xb2bd('0x26')](function(_0x2d281c){return _0x2d281c;});}return null;};}function removeEntity(_0x7517de,_0x5665ae){return function(_0x44635a){if(_0x44635a){return _0x44635a[_0xb2bd('0x27')]()[_0xb2bd('0x26')](function(){_0x7517de[_0xb2bd('0x1d')](0xcc)[_0xb2bd('0x1c')]();});}};}function handleEntityNotFound(_0x284da5,_0x5fd563){return function(_0x5bc22e){if(!_0x5bc22e){_0x284da5[_0xb2bd('0x1b')](0x194);}return _0x5bc22e;};}function handleError(_0x18859a,_0xdba731){_0xdba731=_0xdba731||0x1f4;return function(_0x38a954){logger[_0xb2bd('0x28')](_0x38a954[_0xb2bd('0x29')]);if(_0x38a954[_0xb2bd('0x2a')]){delete _0x38a954['name'];}_0x18859a[_0xb2bd('0x1d')](_0xdba731)['send'](_0x38a954);};}exports[_0xb2bd('0x2b')]=function(_0x5a7a7c,_0xbfae89){var _0x41ba8f={},_0x65211d={},_0x5628c3={'count':0x0,'rows':[]};var _0x321c13=_[_0xb2bd('0x2c')](db[_0xb2bd('0x2d')][_0xb2bd('0x2e')],function(_0x2976b6){return{'name':_0x2976b6[_0xb2bd('0x2f')],'type':_0x2976b6['type']['key']};});_0x65211d[_0xb2bd('0x30')]=_['map'](_0x321c13,_0xb2bd('0x2a'));_0x65211d[_0xb2bd('0x31')]=_[_0xb2bd('0x32')](_0x5a7a7c['query']);_0x65211d[_0xb2bd('0x33')]=_[_0xb2bd('0x34')](_0x65211d[_0xb2bd('0x30')],_0x65211d[_0xb2bd('0x31')]);_0x41ba8f[_0xb2bd('0x35')]=_[_0xb2bd('0x34')](_0x65211d[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x36')]));_0x41ba8f['attributes']=_0x41ba8f[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0x41ba8f[_0xb2bd('0x35')]:_0x65211d[_0xb2bd('0x30')];if(!_0x5a7a7c['query'][_0xb2bd('0x38')](_0xb2bd('0x39'))){_0x41ba8f[_0xb2bd('0x1f')]=qs[_0xb2bd('0x1f')](_0x5a7a7c[_0xb2bd('0x31')]['limit']);_0x41ba8f['offset']=qs[_0xb2bd('0x21')](_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x21')]);}_0x41ba8f[_0xb2bd('0x3a')]=qs[_0xb2bd('0x3b')](_0x5a7a7c['query'][_0xb2bd('0x3b')]);_0x41ba8f[_0xb2bd('0x3c')]=qs[_0xb2bd('0x33')](_[_0xb2bd('0x3d')](_0x5a7a7c[_0xb2bd('0x31')],_0x65211d[_0xb2bd('0x33')]),_0x321c13);if(_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x3e')]){_0x41ba8f[_0xb2bd('0x3c')]=_[_0xb2bd('0x3f')](_0x41ba8f[_0xb2bd('0x3c')],{'$or':_[_0xb2bd('0x2c')](_0x321c13,function(_0x368db7){if(_0x368db7['type']!==_0xb2bd('0x40')){var _0x2576c5={};_0x2576c5[_0x368db7[_0xb2bd('0x2a')]]={'$like':'%'+_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x3e')]+'%'};return _0x2576c5;}})});}_0x41ba8f=_[_0xb2bd('0x3f')]({},_0x41ba8f,_0x5a7a7c[_0xb2bd('0x41')]);var _0x3257a4={'where':_0x41ba8f['where']};return db['SugarcrmAccount'][_0xb2bd('0x20')](_0x3257a4)[_0xb2bd('0x26')](function(_0x555f4a){_0x5628c3[_0xb2bd('0x20')]=_0x555f4a;if(_0x5a7a7c[_0xb2bd('0x31')][_0xb2bd('0x42')]){_0x41ba8f[_0xb2bd('0x43')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xb2bd('0x44')](_0x41ba8f);})[_0xb2bd('0x26')](function(_0xa2a52){_0x5628c3['rows']=_0xa2a52;return _0x5628c3;})[_0xb2bd('0x26')](respondWithFilteredResult(_0xbfae89,_0x41ba8f))[_0xb2bd('0x45')](handleError(_0xbfae89,null));};exports['show']=function(_0xbbfd15,_0x5c316f){var _0x285599={'raw':![],'where':{'id':_0xbbfd15['params']['id']}},_0x4050a5={};_0x4050a5[_0xb2bd('0x30')]=_[_0xb2bd('0x32')](db[_0xb2bd('0x2d')][_0xb2bd('0x2e')]);_0x4050a5[_0xb2bd('0x31')]=_['keys'](_0xbbfd15[_0xb2bd('0x31')]);_0x4050a5[_0xb2bd('0x33')]=_[_0xb2bd('0x34')](_0x4050a5[_0xb2bd('0x30')],_0x4050a5[_0xb2bd('0x31')]);_0x285599[_0xb2bd('0x35')]=_[_0xb2bd('0x34')](_0x4050a5[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0xbbfd15[_0xb2bd('0x31')]['fields']));_0x285599[_0xb2bd('0x35')]=_0x285599[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0x285599[_0xb2bd('0x35')]:_0x4050a5[_0xb2bd('0x30')];if(_0xbbfd15['query'][_0xb2bd('0x42')]){_0x285599[_0xb2bd('0x43')]=[{'all':!![]}];}_0x285599=_['merge']({},_0x285599,_0xbbfd15[_0xb2bd('0x41')]);return db['SugarcrmAccount'][_0xb2bd('0x46')](_0x285599)[_0xb2bd('0x26')](handleEntityNotFound(_0x5c316f,null))[_0xb2bd('0x26')](respondWithResult(_0x5c316f,null))[_0xb2bd('0x45')](handleError(_0x5c316f,null));};exports[_0xb2bd('0x47')]=function(_0x4a35f4,_0x3cef0a){return db[_0xb2bd('0x2d')]['create'](_0x4a35f4[_0xb2bd('0x48')],{})['then'](respondWithResult(_0x3cef0a,0xc9))[_0xb2bd('0x45')](handleError(_0x3cef0a,null));};exports[_0xb2bd('0x25')]=function(_0x311ab8,_0x112f45){if(_0x311ab8[_0xb2bd('0x48')]['id']){delete _0x311ab8[_0xb2bd('0x48')]['id'];}return db[_0xb2bd('0x2d')][_0xb2bd('0x46')]({'where':{'id':_0x311ab8[_0xb2bd('0x49')]['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x112f45,null))[_0xb2bd('0x26')](saveUpdates(_0x311ab8[_0xb2bd('0x48')],null))[_0xb2bd('0x26')](respondWithResult(_0x112f45,null))[_0xb2bd('0x45')](handleError(_0x112f45,null));};exports[_0xb2bd('0x27')]=function(_0x5037d4,_0x49ebd0){return db[_0xb2bd('0x2d')]['find']({'where':{'id':_0x5037d4[_0xb2bd('0x49')]['id']}})['then'](handleEntityNotFound(_0x49ebd0,null))[_0xb2bd('0x26')](removeEntity(_0x49ebd0,null))[_0xb2bd('0x45')](handleError(_0x49ebd0,null));};exports[_0xb2bd('0x4a')]=function(_0x4b65a9,_0x5f56eb,_0x35d378){var _0xf8189a={};var _0x3a86d5={};var _0x322863;var _0x338789;return db['SugarcrmAccount'][_0xb2bd('0x4b')]({'where':{'id':_0x4b65a9[_0xb2bd('0x49')]['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x5f56eb,null))[_0xb2bd('0x26')](function(_0x49c180){if(_0x49c180){_0x322863=_0x49c180;_0x3a86d5[_0xb2bd('0x30')]=_['keys'](db[_0xb2bd('0x4c')][_0xb2bd('0x2e')]);_0x3a86d5['query']=_[_0xb2bd('0x32')](_0x4b65a9[_0xb2bd('0x31')]);_0x3a86d5[_0xb2bd('0x33')]=_['intersection'](_0x3a86d5[_0xb2bd('0x30')],_0x3a86d5[_0xb2bd('0x31')]);_0xf8189a['attributes']=_[_0xb2bd('0x34')](_0x3a86d5[_0xb2bd('0x30')],qs[_0xb2bd('0x36')](_0x4b65a9['query']['fields']));_0xf8189a[_0xb2bd('0x35')]=_0xf8189a[_0xb2bd('0x35')][_0xb2bd('0x37')]?_0xf8189a[_0xb2bd('0x35')]:_0x3a86d5[_0xb2bd('0x30')];_0xf8189a[_0xb2bd('0x3a')]=qs[_0xb2bd('0x3b')](_0x4b65a9[_0xb2bd('0x31')]['sort']);_0xf8189a[_0xb2bd('0x3c')]=qs['filters'](_[_0xb2bd('0x3d')](_0x4b65a9[_0xb2bd('0x31')],_0x3a86d5['filters']));if(_0x4b65a9['query'][_0xb2bd('0x3e')]){_0xf8189a[_0xb2bd('0x3c')]=_['merge'](_0xf8189a['where'],{'$or':_[_0xb2bd('0x2c')](_0xf8189a['attributes'],function(_0x54d42a){var _0x481e2e={};_0x481e2e[_0x54d42a]={'$like':'%'+_0x4b65a9[_0xb2bd('0x31')]['filter']+'%'};return _0x481e2e;})});}_0xf8189a=_[_0xb2bd('0x3f')]({},_0xf8189a,_0x4b65a9['options']);return _0x322863[_0xb2bd('0x4a')](_0xf8189a);}})[_0xb2bd('0x26')](function(_0x2a7b50){if(_0x2a7b50){_0x338789=_0x2a7b50[_0xb2bd('0x37')];if(!_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x38')](_0xb2bd('0x39'))){_0xf8189a['limit']=qs[_0xb2bd('0x1f')](_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x1f')]);_0xf8189a[_0xb2bd('0x21')]=qs['offset'](_0x4b65a9[_0xb2bd('0x31')][_0xb2bd('0x21')]);}return _0x322863[_0xb2bd('0x4a')](_0xf8189a);}})[_0xb2bd('0x26')](function(_0xb4b5c3){if(_0xb4b5c3){return _0xb4b5c3?{'count':_0x338789,'rows':_0xb4b5c3}:null;}})[_0xb2bd('0x26')](respondWithResult(_0x5f56eb,null))['catch'](handleError(_0x5f56eb,null));};exports[_0xb2bd('0x4d')]=function(_0xb164b5,_0x4c3120,_0x2971bc){if(_0xb164b5[_0xb2bd('0x48')]['id']){delete _0xb164b5[_0xb2bd('0x48')]['id'];}return db[_0xb2bd('0x2d')]['findOne']({'where':{'id':_0xb164b5['params']['id']}})[_0xb2bd('0x26')](handleEntityNotFound(_0x4c3120,null))[_0xb2bd('0x26')](function(_0x54d736){if(_0x54d736){_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x4e')]=_0x54d736['id'];_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x4f')]=integrations[_0xb2bd('0x50')](_0xb164b5['body'][_0xb2bd('0x51')],_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x52')]);_0xb164b5['body'][_0xb2bd('0x53')]=integrations['getDescriptions'](_0xb164b5['body'][_0xb2bd('0x51')],_0xb164b5[_0xb2bd('0x48')][_0xb2bd('0x52')]);return db[_0xb2bd('0x4c')]['create'](_0xb164b5[_0xb2bd('0x48')],{'include':[{'model':db['SugarcrmField'],'as':_0xb2bd('0x4f')},{'model':db[_0xb2bd('0x54')],'as':'Descriptions'}]});}return null;})[_0xb2bd('0x26')](respondWithResult(_0x4c3120,null))[_0xb2bd('0x45')](handleError(_0x4c3120,null));};exports[_0xb2bd('0x55')]=function(_0x2cbac2,_0x1d62e4,_0x6cb1d9){var _0x5c01f3='';var _0x2165c3=['id',_0xb2bd('0x2a'),_0xb2bd('0x56'),_0xb2bd('0x57'),'description',_0xb2bd('0x58'),'duration_hours',_0xb2bd('0x59'),'parent_id',_0xb2bd('0x5a'),_0xb2bd('0x5b'),_0xb2bd('0x5c')];return db[_0xb2bd('0x2d')][_0xb2bd('0x4b')]({'where':{'id':_0x2cbac2['params']['id']},'attributes':['id',_0xb2bd('0x5d'),_0xb2bd('0x5e'),_0xb2bd('0x5f')]})[_0xb2bd('0x26')](handleEntityNotFound(_0x1d62e4,null))[_0xb2bd('0x26')](function(_0x5d5f5e){if(_0x5d5f5e){_0x5c01f3=_0x5d5f5e['remoteUri'];var _0x1dba45=_0x5c01f3[_0xb2bd('0x60')](-0x1);if(_0x1dba45==='/'){_0x5c01f3=_0x5c01f3[_0xb2bd('0x61')](0x0,_0x5c01f3['lastIndexOf'](_0x1dba45));}return rp({'method':_0xb2bd('0x62'),'uri':util[_0xb2bd('0x63')](_0xb2bd('0x64'),_0x5c01f3,_0xb2bd('0x65')),'json':!![],'form':{'method':_0xb2bd('0x66'),'input_type':'JSON','response_type':_0xb2bd('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5d5f5e['username'],'password':_0x5d5f5e[_0xb2bd('0x5e')],'encryption':'PLAIN'},'application':_0xb2bd('0x68')})}});}})[_0xb2bd('0x26')](function(_0x2d910d){if(_0x2d910d&&_0x2d910d['name']!==_0xb2bd('0x69')&&_0x2d910d[_0xb2bd('0x2a')]!==_0xb2bd('0x6a')){return rp({'method':_0xb2bd('0x62'),'uri':util[_0xb2bd('0x63')](_0xb2bd('0x64'),_0x5c01f3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb2bd('0x67'),'response_type':'JSON','rest_data':JSON[_0xb2bd('0x6b')]({'session':_0x2d910d['id'],'module_name':_0xb2bd('0x6c')})}})['then'](function(_0x343a3f){if(_0x343a3f){var _0xe6f688=_[_0xb2bd('0x6d')](_0x343a3f[_0xb2bd('0x6e')]);_['remove'](_0xe6f688,function(_0x2be7a6){return _0x2165c3['includes'](_0x2be7a6[_0xb2bd('0x2a')]);});return{'count':_0xe6f688['length'],'rows':_[_0xb2bd('0x2c')](_0xe6f688,function(_0x4f997d){return{'id':_0x4f997d[_0xb2bd('0x2a')],'name':_0x4f997d[_0xb2bd('0x6f')],'custom':_[_0xb2bd('0x70')](_0x4f997d[_0xb2bd('0x2a')],'_c')?!![]:![],'options':_0x4f997d['options']?_[_0xb2bd('0x2c')](_[_0xb2bd('0x6d')](_0x4f997d[_0xb2bd('0x41')]),function(_0x1120ee){return{'name':_0x1120ee[_0xb2bd('0x71')],'value':_0x1120ee['name']};}):[]};})};}})[_0xb2bd('0x26')](respondWithResult(_0x1d62e4,null))[_0xb2bd('0x45')](function(_0x3bcd58){var _0x355094=_0x2cbac2['query'][_0xb2bd('0x72')]?0x1f4:_0x3bcd58[_0xb2bd('0x73')]||0x1f4;logger['error'](_0xb2bd('0x74'),_0xb2bd('0x55'),_0x355094,JSON[_0xb2bd('0x6b')](_0x3bcd58));delete _0x3bcd58['name'];if(_0x355094===0x191){_0x355094=0x190;}_0x1d62e4[_0xb2bd('0x1d')](_0x355094)[_0xb2bd('0x75')](_0x2cbac2[_0xb2bd('0x31')][_0xb2bd('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x3bcd58['statusCode']}:_0x3bcd58);});}else{var _0x1517e7=0x1f4;_0x1d62e4['status'](_0x1517e7)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x5872=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','catch','show','params','keys','create','body','destroy','find','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','channel','type','Descriptions','getDescriptions','SugarcrmField','Subjects','assigned_user_id','created_by','description','parent_type','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','%s%s','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields','Wrong\x20credentials','zip-dir','request-promise','moment','util','sox','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','end','error','name','send','map','SugarcrmAccount','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x47cad6,_0x9d41e7){var _0x2a70b6=function(_0x224590){while(--_0x224590){_0x47cad6['push'](_0x47cad6['shift']());}};_0x2a70b6(++_0x9d41e7);}(_0x5872,0x18b));var _0x2587=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x5872[_0x31a938];return _0x1bf341;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2587('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2587('0x1'));var moment=require(_0x2587('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2587('0x3'));var path=require('path');var sox=require(_0x2587('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2587('0x5'));var _=require('lodash');var squel=require(_0x2587('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2587('0x7'));var toCsv=require(_0x2587('0x8'));var querystring=require(_0x2587('0x9'));var Papa=require(_0x2587('0xa'));var Redis=require(_0x2587('0xb'));var authService=require(_0x2587('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2587('0xd'));var utils=require('../../config/utils');var config=require(_0x2587('0xe'));var licenseUtil=require(_0x2587('0xf'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2587('0x10'));function respondWithStatusCode(_0x32438a,_0xe18dac){_0xe18dac=_0xe18dac||0xcc;return function(_0x23b409){if(_0x23b409){return _0x32438a[_0x2587('0x11')](_0xe18dac);}return _0x32438a['status'](_0xe18dac)['end']();};}function respondWithResult(_0x164ef3,_0x44a9c1){_0x44a9c1=_0x44a9c1||0xc8;return function(_0x38b6a3){if(_0x38b6a3){return _0x164ef3[_0x2587('0x12')](_0x44a9c1)[_0x2587('0x13')](_0x38b6a3);}};}function respondWithFilteredResult(_0x13c657,_0x33b8af){return function(_0x3f2a87){if(_0x3f2a87){var _0x30dbef=typeof _0x33b8af[_0x2587('0x14')]===_0x2587('0x15')&&typeof _0x33b8af[_0x2587('0x16')]===_0x2587('0x15');var _0x32cac4=_0x3f2a87[_0x2587('0x17')];var _0xa8f90c=_0x30dbef?0x0:_0x33b8af[_0x2587('0x14')];var _0x2dc93e=_0x30dbef?_0x3f2a87[_0x2587('0x17')]:_0x33b8af[_0x2587('0x14')]+_0x33b8af[_0x2587('0x16')];var _0xa1348f;if(_0x2dc93e>=_0x32cac4){_0x2dc93e=_0x32cac4;_0xa1348f=0xc8;}else{_0xa1348f=0xce;}_0x13c657[_0x2587('0x12')](_0xa1348f);return _0x13c657[_0x2587('0x18')](_0x2587('0x19'),_0xa8f90c+'-'+_0x2dc93e+'/'+_0x32cac4)[_0x2587('0x13')](_0x3f2a87);}return null;};}function patchUpdates(_0xd086db){return function(_0x105715){try{jsonpatch['apply'](_0x105715,_0xd086db,!![]);}catch(_0x2c74e0){return BPromise[_0x2587('0x1a')](_0x2c74e0);}return _0x105715[_0x2587('0x1b')]();};}function saveUpdates(_0x3458aa,_0x1c9d3a){return function(_0x329922){if(_0x329922){return _0x329922[_0x2587('0x1c')](_0x3458aa)['then'](function(_0x203b2d){return _0x203b2d;});}return null;};}function removeEntity(_0x50dc2b,_0x550b4b){return function(_0x43d877){if(_0x43d877){return _0x43d877['destroy']()['then'](function(){_0x50dc2b[_0x2587('0x12')](0xcc)[_0x2587('0x1d')]();});}};}function handleEntityNotFound(_0x580c17,_0x3deb7a){return function(_0x1c4b14){if(!_0x1c4b14){_0x580c17['sendStatus'](0x194);}return _0x1c4b14;};}function handleError(_0x2648c5,_0x269925){_0x269925=_0x269925||0x1f4;return function(_0x54fb1a){logger[_0x2587('0x1e')](_0x54fb1a['stack']);if(_0x54fb1a['name']){delete _0x54fb1a[_0x2587('0x1f')];}_0x2648c5[_0x2587('0x12')](_0x269925)[_0x2587('0x20')](_0x54fb1a);};}exports['index']=function(_0x3eebb0,_0x558e51){var _0x3ef176={},_0x22342e={},_0x2e556b={'count':0x0,'rows':[]};var _0x2d2f65=_[_0x2587('0x21')](db[_0x2587('0x22')][_0x2587('0x23')],function(_0x4a4a88){return{'name':_0x4a4a88['fieldName'],'type':_0x4a4a88['type'][_0x2587('0x24')]};});_0x22342e['model']=_['map'](_0x2d2f65,_0x2587('0x1f'));_0x22342e[_0x2587('0x25')]=_['keys'](_0x3eebb0[_0x2587('0x25')]);_0x22342e[_0x2587('0x26')]=_[_0x2587('0x27')](_0x22342e[_0x2587('0x28')],_0x22342e[_0x2587('0x25')]);_0x3ef176[_0x2587('0x29')]=_[_0x2587('0x27')](_0x22342e[_0x2587('0x28')],qs[_0x2587('0x2a')](_0x3eebb0['query'][_0x2587('0x2a')]));_0x3ef176[_0x2587('0x29')]=_0x3ef176[_0x2587('0x29')][_0x2587('0x2b')]?_0x3ef176[_0x2587('0x29')]:_0x22342e[_0x2587('0x28')];if(!_0x3eebb0[_0x2587('0x25')][_0x2587('0x2c')](_0x2587('0x2d'))){_0x3ef176[_0x2587('0x16')]=qs[_0x2587('0x16')](_0x3eebb0[_0x2587('0x25')]['limit']);_0x3ef176[_0x2587('0x14')]=qs[_0x2587('0x14')](_0x3eebb0[_0x2587('0x25')][_0x2587('0x14')]);}_0x3ef176[_0x2587('0x2e')]=qs[_0x2587('0x2f')](_0x3eebb0[_0x2587('0x25')][_0x2587('0x2f')]);_0x3ef176[_0x2587('0x30')]=qs[_0x2587('0x26')](_[_0x2587('0x31')](_0x3eebb0[_0x2587('0x25')],_0x22342e[_0x2587('0x26')]),_0x2d2f65);if(_0x3eebb0['query']['filter']){_0x3ef176[_0x2587('0x30')]=_[_0x2587('0x32')](_0x3ef176['where'],{'$or':_[_0x2587('0x21')](_0x2d2f65,function(_0x5d1c69){if(_0x5d1c69['type']!==_0x2587('0x33')){var _0x94fa8f={};_0x94fa8f[_0x5d1c69[_0x2587('0x1f')]]={'$like':'%'+_0x3eebb0[_0x2587('0x25')][_0x2587('0x34')]+'%'};return _0x94fa8f;}})});}_0x3ef176=_[_0x2587('0x32')]({},_0x3ef176,_0x3eebb0[_0x2587('0x35')]);var _0x3e81b2={'where':_0x3ef176[_0x2587('0x30')]};return db[_0x2587('0x22')][_0x2587('0x17')](_0x3e81b2)['then'](function(_0x3fa310){_0x2e556b[_0x2587('0x17')]=_0x3fa310;if(_0x3eebb0['query'][_0x2587('0x36')]){_0x3ef176[_0x2587('0x37')]=[{'all':!![]}];}return db[_0x2587('0x22')][_0x2587('0x38')](_0x3ef176);})[_0x2587('0x39')](function(_0x5dfbac){_0x2e556b[_0x2587('0x3a')]=_0x5dfbac;return _0x2e556b;})[_0x2587('0x39')](respondWithFilteredResult(_0x558e51,_0x3ef176))[_0x2587('0x3b')](handleError(_0x558e51,null));};exports[_0x2587('0x3c')]=function(_0xdc103b,_0x5a504d){var _0x2ca5ee={'raw':![],'where':{'id':_0xdc103b[_0x2587('0x3d')]['id']}},_0x57fa6e={};_0x57fa6e[_0x2587('0x28')]=_[_0x2587('0x3e')](db['SugarcrmAccount'][_0x2587('0x23')]);_0x57fa6e['query']=_[_0x2587('0x3e')](_0xdc103b[_0x2587('0x25')]);_0x57fa6e[_0x2587('0x26')]=_['intersection'](_0x57fa6e[_0x2587('0x28')],_0x57fa6e[_0x2587('0x25')]);_0x2ca5ee[_0x2587('0x29')]=_[_0x2587('0x27')](_0x57fa6e[_0x2587('0x28')],qs[_0x2587('0x2a')](_0xdc103b[_0x2587('0x25')][_0x2587('0x2a')]));_0x2ca5ee[_0x2587('0x29')]=_0x2ca5ee[_0x2587('0x29')][_0x2587('0x2b')]?_0x2ca5ee[_0x2587('0x29')]:_0x57fa6e[_0x2587('0x28')];if(_0xdc103b[_0x2587('0x25')][_0x2587('0x36')]){_0x2ca5ee[_0x2587('0x37')]=[{'all':!![]}];}_0x2ca5ee=_[_0x2587('0x32')]({},_0x2ca5ee,_0xdc103b['options']);return db[_0x2587('0x22')]['find'](_0x2ca5ee)['then'](handleEntityNotFound(_0x5a504d,null))['then'](respondWithResult(_0x5a504d,null))[_0x2587('0x3b')](handleError(_0x5a504d,null));};exports['create']=function(_0x5578ab,_0x402970){return db['SugarcrmAccount'][_0x2587('0x3f')](_0x5578ab['body'],{})[_0x2587('0x39')](respondWithResult(_0x402970,0xc9))[_0x2587('0x3b')](handleError(_0x402970,null));};exports['update']=function(_0x307777,_0x2cf484){if(_0x307777[_0x2587('0x40')]['id']){delete _0x307777[_0x2587('0x40')]['id'];}return db[_0x2587('0x22')]['find']({'where':{'id':_0x307777[_0x2587('0x3d')]['id']}})[_0x2587('0x39')](handleEntityNotFound(_0x2cf484,null))['then'](saveUpdates(_0x307777[_0x2587('0x40')],null))[_0x2587('0x39')](respondWithResult(_0x2cf484,null))[_0x2587('0x3b')](handleError(_0x2cf484,null));};exports[_0x2587('0x41')]=function(_0x5e3dc7,_0x93d08c){return db[_0x2587('0x22')][_0x2587('0x42')]({'where':{'id':_0x5e3dc7[_0x2587('0x3d')]['id']}})[_0x2587('0x39')](handleEntityNotFound(_0x93d08c,null))[_0x2587('0x39')](removeEntity(_0x93d08c,null))[_0x2587('0x3b')](handleError(_0x93d08c,null));};exports[_0x2587('0x43')]=function(_0x3a377a,_0x2a318c,_0x1f0ed9){var _0x4ce379={};var _0x5445b5={};var _0x46e908;var _0x341ea9;return db[_0x2587('0x22')][_0x2587('0x44')]({'where':{'id':_0x3a377a[_0x2587('0x3d')]['id']}})[_0x2587('0x39')](handleEntityNotFound(_0x2a318c,null))[_0x2587('0x39')](function(_0x997c0a){if(_0x997c0a){_0x46e908=_0x997c0a;_0x5445b5[_0x2587('0x28')]=_[_0x2587('0x3e')](db[_0x2587('0x45')][_0x2587('0x23')]);_0x5445b5['query']=_[_0x2587('0x3e')](_0x3a377a[_0x2587('0x25')]);_0x5445b5[_0x2587('0x26')]=_[_0x2587('0x27')](_0x5445b5[_0x2587('0x28')],_0x5445b5['query']);_0x4ce379[_0x2587('0x29')]=_['intersection'](_0x5445b5['model'],qs[_0x2587('0x2a')](_0x3a377a[_0x2587('0x25')][_0x2587('0x2a')]));_0x4ce379['attributes']=_0x4ce379[_0x2587('0x29')]['length']?_0x4ce379[_0x2587('0x29')]:_0x5445b5[_0x2587('0x28')];_0x4ce379[_0x2587('0x2e')]=qs[_0x2587('0x2f')](_0x3a377a[_0x2587('0x25')][_0x2587('0x2f')]);_0x4ce379[_0x2587('0x30')]=qs['filters'](_[_0x2587('0x31')](_0x3a377a[_0x2587('0x25')],_0x5445b5['filters']));if(_0x3a377a['query']['filter']){_0x4ce379[_0x2587('0x30')]=_[_0x2587('0x32')](_0x4ce379[_0x2587('0x30')],{'$or':_['map'](_0x4ce379['attributes'],function(_0x588aba){var _0x5b5410={};_0x5b5410[_0x588aba]={'$like':'%'+_0x3a377a[_0x2587('0x25')][_0x2587('0x34')]+'%'};return _0x5b5410;})});}_0x4ce379=_[_0x2587('0x32')]({},_0x4ce379,_0x3a377a['options']);return _0x46e908['getConfigurations'](_0x4ce379);}})[_0x2587('0x39')](function(_0x150f5e){if(_0x150f5e){_0x341ea9=_0x150f5e[_0x2587('0x2b')];if(!_0x3a377a[_0x2587('0x25')][_0x2587('0x2c')](_0x2587('0x2d'))){_0x4ce379[_0x2587('0x16')]=qs[_0x2587('0x16')](_0x3a377a[_0x2587('0x25')][_0x2587('0x16')]);_0x4ce379[_0x2587('0x14')]=qs[_0x2587('0x14')](_0x3a377a[_0x2587('0x25')][_0x2587('0x14')]);}return _0x46e908[_0x2587('0x43')](_0x4ce379);}})[_0x2587('0x39')](function(_0x741b6a){if(_0x741b6a){return _0x741b6a?{'count':_0x341ea9,'rows':_0x741b6a}:null;}})[_0x2587('0x39')](respondWithResult(_0x2a318c,null))[_0x2587('0x3b')](handleError(_0x2a318c,null));};exports[_0x2587('0x46')]=function(_0x373196,_0x59a714,_0xbd4c76){if(_0x373196['body']['id']){delete _0x373196[_0x2587('0x40')]['id'];}return db[_0x2587('0x22')][_0x2587('0x44')]({'where':{'id':_0x373196[_0x2587('0x3d')]['id']}})[_0x2587('0x39')](handleEntityNotFound(_0x59a714,null))[_0x2587('0x39')](function(_0x25edda){if(_0x25edda){_0x373196['body'][_0x2587('0x47')]=_0x25edda['id'];_0x373196[_0x2587('0x40')]['Subjects']=integrations['getSubjects'](_0x373196[_0x2587('0x40')][_0x2587('0x48')],_0x373196['body'][_0x2587('0x49')]);_0x373196[_0x2587('0x40')][_0x2587('0x4a')]=integrations[_0x2587('0x4b')](_0x373196['body'][_0x2587('0x48')],_0x373196[_0x2587('0x40')][_0x2587('0x49')]);return db[_0x2587('0x45')]['create'](_0x373196['body'],{'include':[{'model':db[_0x2587('0x4c')],'as':_0x2587('0x4d')},{'model':db[_0x2587('0x4c')],'as':_0x2587('0x4a')}]});}return null;})['then'](respondWithResult(_0x59a714,null))[_0x2587('0x3b')](handleError(_0x59a714,null));};exports['getFields']=function(_0x59c376,_0x9fc06,_0x36cae4){var _0x574cab='';var _0x4d559f=['id','name',_0x2587('0x4e'),_0x2587('0x4f'),_0x2587('0x50'),'date_start','duration_hours','duration_minutes','parent_id',_0x2587('0x51'),'parent_name',_0x2587('0x52')];return db[_0x2587('0x22')]['findOne']({'where':{'id':_0x59c376[_0x2587('0x3d')]['id']},'attributes':['id',_0x2587('0x53'),_0x2587('0x54'),'remoteUri']})[_0x2587('0x39')](handleEntityNotFound(_0x9fc06,null))[_0x2587('0x39')](function(_0x273b21){if(_0x273b21){_0x574cab=_0x273b21[_0x2587('0x55')];var _0x58a079=_0x574cab[_0x2587('0x56')](-0x1);if(_0x58a079==='/'){_0x574cab=_0x574cab[_0x2587('0x57')](0x0,_0x574cab[_0x2587('0x58')](_0x58a079));}return rp({'method':'POST','uri':util[_0x2587('0x59')]('%s%s',_0x574cab,_0x2587('0x5a')),'json':!![],'form':{'method':_0x2587('0x5b'),'input_type':_0x2587('0x5c'),'response_type':'JSON','rest_data':JSON[_0x2587('0x5d')]({'user_auth':{'user_name':_0x273b21[_0x2587('0x53')],'password':_0x273b21[_0x2587('0x54')],'encryption':_0x2587('0x5e')},'application':_0x2587('0x5f')})}});}})[_0x2587('0x39')](function(_0x4f8ee1){if(_0x4f8ee1&&_0x4f8ee1[_0x2587('0x1f')]!==_0x2587('0x60')&&_0x4f8ee1[_0x2587('0x1f')]!==_0x2587('0x61')){return rp({'method':_0x2587('0x62'),'uri':util[_0x2587('0x59')](_0x2587('0x63'),_0x574cab,_0x2587('0x5a')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x2587('0x5c'),'response_type':_0x2587('0x5c'),'rest_data':JSON[_0x2587('0x5d')]({'session':_0x4f8ee1['id'],'module_name':'Calls'})}})[_0x2587('0x39')](function(_0x3ac5b1){if(_0x3ac5b1){var _0x15da6b=_[_0x2587('0x64')](_0x3ac5b1[_0x2587('0x65')]);_[_0x2587('0x66')](_0x15da6b,function(_0x5a92ee){return _0x4d559f[_0x2587('0x67')](_0x5a92ee[_0x2587('0x1f')]);});return{'count':_0x15da6b[_0x2587('0x2b')],'rows':_[_0x2587('0x21')](_0x15da6b,function(_0x9118dc){return{'id':_0x9118dc[_0x2587('0x1f')],'name':_0x9118dc[_0x2587('0x68')],'custom':_[_0x2587('0x69')](_0x9118dc[_0x2587('0x1f')],'_c')?!![]:![],'options':_0x9118dc[_0x2587('0x35')]?_[_0x2587('0x21')](_['values'](_0x9118dc[_0x2587('0x35')]),function(_0x3f6d8c){return{'name':_0x3f6d8c[_0x2587('0x6a')],'value':_0x3f6d8c[_0x2587('0x1f')]};}):[]};})};}})['then'](respondWithResult(_0x9fc06,null))['catch'](function(_0x331f16){var _0x161b11=_0x59c376[_0x2587('0x25')][_0x2587('0x6b')]?0x1f4:_0x331f16[_0x2587('0x6c')]||0x1f4;logger[_0x2587('0x1e')]('getFields,\x20%s,\x20%s,\x20%s',_0x2587('0x6d'),_0x161b11,JSON[_0x2587('0x5d')](_0x331f16));delete _0x331f16[_0x2587('0x1f')];if(_0x161b11===0x191){_0x161b11=0x190;}_0x9fc06[_0x2587('0x12')](_0x161b11)[_0x2587('0x20')](_0x59c376[_0x2587('0x25')][_0x2587('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x331f16[_0x2587('0x6c')]}:_0x331f16);});}else{var _0x4ef690=0x1f4;_0x9fc06['status'](_0x4ef690)[_0x2587('0x20')]({'message':_0x2587('0x6e'),'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 3a8d02d..4bbb05e 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 _0xaf73=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x25cd5d,_0x460c61){var _0x3d300c=function(_0x4f4c9c){while(--_0x4f4c9c){_0x25cd5d['push'](_0x25cd5d['shift']());}};_0x3d300c(++_0x460c61);}(_0xaf73,0x149));var _0x3af7=function(_0x5d573b,_0x2fa77d){_0x5d573b=_0x5d573b-0x0;var _0x5b87b6=_0xaf73[_0x5d573b];return _0x5b87b6;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var logger=require(_0x3af7('0x2'))(_0x3af7('0x3'));var moment=require(_0x3af7('0x4'));var BPromise=require(_0x3af7('0x5'));var rp=require(_0x3af7('0x6'));var fs=require('fs');var path=require(_0x3af7('0x7'));var rimraf=require(_0x3af7('0x8'));var config=require(_0x3af7('0x9'));var attributes=require(_0x3af7('0xa'));var integrations=require(_0x3af7('0xb'));module[_0x3af7('0xc')]=function(_0x1508f0,_0x3cc0bc){return _0x1508f0[_0x3af7('0xd')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c82=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b84e8,_0xab1d30){var _0x441ef8=function(_0x14b25e){while(--_0x14b25e){_0x5b84e8['push'](_0x5b84e8['shift']());}};_0x441ef8(++_0xab1d30);}(_0x5c82,0x198));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x25c8('0x0'));var util=require(_0x25c8('0x1'));var logger=require(_0x25c8('0x2'))(_0x25c8('0x3'));var moment=require(_0x25c8('0x4'));var BPromise=require(_0x25c8('0x5'));var rp=require(_0x25c8('0x6'));var fs=require('fs');var path=require(_0x25c8('0x7'));var rimraf=require(_0x25c8('0x8'));var config=require(_0x25c8('0x9'));var attributes=require(_0x25c8('0xa'));var integrations=require(_0x25c8('0xb'));module[_0x25c8('0xc')]=function(_0x131ee7,_0x33f1ba){return _0x131ee7[_0x25c8('0xd')](_0x25c8('0xe'),attributes,{'tableName':_0x25c8('0xf'),'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 f9305ec..6823b23 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 _0xd360=['request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SugarcrmAccount','findAll','options','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x479282,_0x580ef0){var _0x37e4cb=function(_0xdb8be8){while(--_0xdb8be8){_0x479282['push'](_0x479282['shift']());}};_0x37e4cb(++_0x580ef0);}(_0xd360,0x11d));var _0x0d36=function(_0x225828,_0x3bb4f7){_0x225828=_0x225828-0x0;var _0x5a743c=_0xd360[_0x225828];return _0x5a743c;};'use strict';var _=require('lodash');var util=require(_0x0d36('0x0'));var moment=require('moment');var BPromise=require(_0x0d36('0x1'));var rs=require(_0x0d36('0x2'));var fs=require('fs');var Redis=require(_0x0d36('0x3'));var db=require(_0x0d36('0x4'))['db'];var utils=require(_0x0d36('0x5'));var logger=require(_0x0d36('0x6'))(_0x0d36('0x7'));var config=require(_0x0d36('0x8'));var jayson=require(_0x0d36('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1210de,_0x356e27,_0x2ca3cd){return new BPromise(function(_0x24ecf7,_0x50be40){return client['request'](_0x1210de,_0x2ca3cd)[_0x0d36('0xa')](function(_0x1b0477){logger['info'](_0x0d36('0xb'),_0x356e27,_0x0d36('0xc'));logger[_0x0d36('0xd')](_0x0d36('0xe'),_0x356e27,'request\x20sent',JSON[_0x0d36('0xf')](_0x1b0477));if(_0x1b0477[_0x0d36('0x10')]){if(_0x1b0477[_0x0d36('0x10')][_0x0d36('0x11')]===0x1f4){logger['error'](_0x0d36('0xb'),_0x356e27,_0x1b0477['error'][_0x0d36('0x12')]);return _0x50be40(_0x1b0477[_0x0d36('0x10')][_0x0d36('0x12')]);}logger[_0x0d36('0x10')](_0x0d36('0xb'),_0x356e27,_0x1b0477['error'][_0x0d36('0x12')]);return _0x24ecf7(_0x1b0477[_0x0d36('0x10')][_0x0d36('0x12')]);}else{logger[_0x0d36('0x13')](_0x0d36('0xb'),_0x356e27,_0x0d36('0xc'));_0x24ecf7(_0x1b0477[_0x0d36('0x14')][_0x0d36('0x12')]);}})[_0x0d36('0x15')](function(_0x8f032a){logger[_0x0d36('0x10')](_0x0d36('0xb'),_0x356e27,_0x8f032a);_0x50be40(_0x8f032a);});});}exports['GetSugarcrmAccount']=function(_0x326570){var _0x26f4e3=this;return new Promise(function(_0x147725,_0x2a9a58){return db[_0x0d36('0x16')][_0x0d36('0x17')]({'raw':_0x326570[_0x0d36('0x18')]?_0x326570[_0x0d36('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x326570[_0x0d36('0x18')]?_0x326570[_0x0d36('0x18')][_0x0d36('0x19')]||null:null,'attributes':_0x326570[_0x0d36('0x18')]?_0x326570[_0x0d36('0x18')][_0x0d36('0x1a')]||null:null,'limit':_0x326570['options']?_0x326570['options']['limit']||null:null,'include':_0x326570[_0x0d36('0x18')]?_0x326570['options'][_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x326570['options']['include'],function(_0x5059ea){return{'model':db[_0x5059ea[_0x0d36('0x1d')]],'as':_0x5059ea['as'],'attributes':_0x5059ea[_0x0d36('0x1a')],'include':_0x5059ea[_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x5059ea['include'],function(_0x2983d6){return{'model':db[_0x2983d6[_0x0d36('0x1d')]],'as':_0x2983d6['as'],'attributes':_0x2983d6[_0x0d36('0x1a')],'include':_0x2983d6['include']?_[_0x0d36('0x1c')](_0x2983d6[_0x0d36('0x1b')],function(_0x5c443d){return{'model':db[_0x5c443d['model']],'as':_0x5c443d['as'],'attributes':_0x5c443d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d36('0xa')](function(_0x4187c3){logger[_0x0d36('0x13')](_0x0d36('0x1e'),_0x326570);logger[_0x0d36('0xd')]('GetSugarcrmAccount',_0x326570,JSON[_0x0d36('0xf')](_0x4187c3));_0x147725(_0x4187c3);})[_0x0d36('0x15')](function(_0xfb6087){logger[_0x0d36('0x10')]('GetSugarcrmAccount',_0xfb6087[_0x0d36('0x12')],_0x326570);_0x2a9a58(_0x26f4e3['error'](0x1f4,_0xfb6087[_0x0d36('0x12')]));});});};exports[_0x0d36('0x1f')]=function(_0x2f6479){var _0x4b143b=this;return new Promise(function(_0x3fffa0,_0x19a4ed){return db[_0x0d36('0x16')]['find']({'raw':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x20')]===undefined?!![]:![]:!![],'where':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x19')]||null:null,'attributes':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x1a')]||null:null,'include':_0x2f6479[_0x0d36('0x18')]?_0x2f6479[_0x0d36('0x18')][_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x2f6479[_0x0d36('0x18')][_0x0d36('0x1b')],function(_0x4bcf84){return{'model':db[_0x4bcf84[_0x0d36('0x1d')]],'as':_0x4bcf84['as'],'attributes':_0x4bcf84[_0x0d36('0x1a')],'include':_0x4bcf84[_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x4bcf84['include'],function(_0x1d1bf1){return{'model':db[_0x1d1bf1[_0x0d36('0x1d')]],'as':_0x1d1bf1['as'],'attributes':_0x1d1bf1[_0x0d36('0x1a')],'include':_0x1d1bf1[_0x0d36('0x1b')]?_[_0x0d36('0x1c')](_0x1d1bf1['include'],function(_0x45571b){return{'model':db[_0x45571b[_0x0d36('0x1d')]],'as':_0x45571b['as'],'attributes':_0x45571b[_0x0d36('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3181b7){logger[_0x0d36('0x13')]('ShowSugarcrmAccount',_0x2f6479);logger['debug']('ShowSugarcrmAccount',_0x2f6479,JSON['stringify'](_0x3181b7));_0x3fffa0(_0x3181b7);})[_0x0d36('0x15')](function(_0x1bc007){logger[_0x0d36('0x10')](_0x0d36('0x1f'),_0x1bc007[_0x0d36('0x12')],_0x2f6479);_0x19a4ed(_0x4b143b[_0x0d36('0x10')](0x1f4,_0x1bc007[_0x0d36('0x12')]));});});}; \ No newline at end of file +var _0xe148=['attributes','catch','ShowSugarcrmAccount','find','util','bluebird','ioredis','../../mysqldb','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','map','model'];(function(_0x1782ae,_0x9bcc0c){var _0x1d7cfc=function(_0xa10d16){while(--_0xa10d16){_0x1782ae['push'](_0x1782ae['shift']());}};_0x1d7cfc(++_0x9bcc0c);}(_0xe148,0xfc));var _0x8e14=function(_0xd60031,_0x5efb93){_0xd60031=_0xd60031-0x0;var _0x43d00a=_0xe148[_0xd60031];return _0x43d00a;};'use strict';var _=require('lodash');var util=require(_0x8e14('0x0'));var moment=require('moment');var BPromise=require(_0x8e14('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e14('0x2'));var db=require(_0x8e14('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8e14('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8e14('0x5')][_0x8e14('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x479e3e,_0x17461b,_0x3ce933){return new BPromise(function(_0x108344,_0x78c49d){return client[_0x8e14('0x7')](_0x479e3e,_0x3ce933)[_0x8e14('0x8')](function(_0x38c8aa){logger['info'](_0x8e14('0x9'),_0x17461b,_0x8e14('0xa'));logger[_0x8e14('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x17461b,'request\x20sent',JSON[_0x8e14('0xc')](_0x38c8aa));if(_0x38c8aa[_0x8e14('0xd')]){if(_0x38c8aa[_0x8e14('0xd')]['code']===0x1f4){logger[_0x8e14('0xd')](_0x8e14('0x9'),_0x17461b,_0x38c8aa[_0x8e14('0xd')][_0x8e14('0xe')]);return _0x78c49d(_0x38c8aa['error']['message']);}logger[_0x8e14('0xd')](_0x8e14('0x9'),_0x17461b,_0x38c8aa['error'][_0x8e14('0xe')]);return _0x108344(_0x38c8aa[_0x8e14('0xd')][_0x8e14('0xe')]);}else{logger[_0x8e14('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x17461b,_0x8e14('0xa'));_0x108344(_0x38c8aa[_0x8e14('0x10')][_0x8e14('0xe')]);}})['catch'](function(_0x2600bc){logger[_0x8e14('0xd')](_0x8e14('0x9'),_0x17461b,_0x2600bc);_0x78c49d(_0x2600bc);});});}exports[_0x8e14('0x11')]=function(_0x4eba39){var _0x1a63d6=this;return new Promise(function(_0x4c05a7,_0x39f9fa){return db[_0x8e14('0x12')][_0x8e14('0x13')]({'raw':_0x4eba39[_0x8e14('0x14')]?_0x4eba39[_0x8e14('0x14')][_0x8e14('0x15')]===undefined?!![]:![]:!![],'where':_0x4eba39[_0x8e14('0x14')]?_0x4eba39[_0x8e14('0x14')][_0x8e14('0x16')]||null:null,'attributes':_0x4eba39[_0x8e14('0x14')]?_0x4eba39['options']['attributes']||null:null,'limit':_0x4eba39[_0x8e14('0x14')]?_0x4eba39[_0x8e14('0x14')][_0x8e14('0x17')]||null:null,'include':_0x4eba39['options']?_0x4eba39[_0x8e14('0x14')][_0x8e14('0x18')]?_[_0x8e14('0x19')](_0x4eba39['options'][_0x8e14('0x18')],function(_0x3411a8){return{'model':db[_0x3411a8['model']],'as':_0x3411a8['as'],'attributes':_0x3411a8['attributes'],'include':_0x3411a8[_0x8e14('0x18')]?_[_0x8e14('0x19')](_0x3411a8[_0x8e14('0x18')],function(_0x12716f){return{'model':db[_0x12716f[_0x8e14('0x1a')]],'as':_0x12716f['as'],'attributes':_0x12716f[_0x8e14('0x1b')],'include':_0x12716f[_0x8e14('0x18')]?_[_0x8e14('0x19')](_0x12716f[_0x8e14('0x18')],function(_0x6d742b){return{'model':db[_0x6d742b[_0x8e14('0x1a')]],'as':_0x6d742b['as'],'attributes':_0x6d742b[_0x8e14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8e14('0x8')](function(_0x23dbe6){logger[_0x8e14('0xf')](_0x8e14('0x11'),_0x4eba39);logger[_0x8e14('0xb')](_0x8e14('0x11'),_0x4eba39,JSON[_0x8e14('0xc')](_0x23dbe6));_0x4c05a7(_0x23dbe6);})[_0x8e14('0x1c')](function(_0x4a6ebc){logger[_0x8e14('0xd')](_0x8e14('0x11'),_0x4a6ebc[_0x8e14('0xe')],_0x4eba39);_0x39f9fa(_0x1a63d6[_0x8e14('0xd')](0x1f4,_0x4a6ebc[_0x8e14('0xe')]));});});};exports[_0x8e14('0x1d')]=function(_0x229487){var _0x58861d=this;return new Promise(function(_0x2e86a7,_0x476ea4){return db[_0x8e14('0x12')][_0x8e14('0x1e')]({'raw':_0x229487[_0x8e14('0x14')]?_0x229487[_0x8e14('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x229487[_0x8e14('0x14')]?_0x229487[_0x8e14('0x14')][_0x8e14('0x16')]||null:null,'attributes':_0x229487[_0x8e14('0x14')]?_0x229487['options']['attributes']||null:null,'include':_0x229487['options']?_0x229487[_0x8e14('0x14')]['include']?_[_0x8e14('0x19')](_0x229487[_0x8e14('0x14')][_0x8e14('0x18')],function(_0x463c8d){return{'model':db[_0x463c8d[_0x8e14('0x1a')]],'as':_0x463c8d['as'],'attributes':_0x463c8d[_0x8e14('0x1b')],'include':_0x463c8d[_0x8e14('0x18')]?_[_0x8e14('0x19')](_0x463c8d[_0x8e14('0x18')],function(_0x1770c0){return{'model':db[_0x1770c0[_0x8e14('0x1a')]],'as':_0x1770c0['as'],'attributes':_0x1770c0[_0x8e14('0x1b')],'include':_0x1770c0[_0x8e14('0x18')]?_[_0x8e14('0x19')](_0x1770c0[_0x8e14('0x18')],function(_0x119d4c){return{'model':db[_0x119d4c[_0x8e14('0x1a')]],'as':_0x119d4c['as'],'attributes':_0x119d4c[_0x8e14('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8e14('0x8')](function(_0xc79f58){logger[_0x8e14('0xf')](_0x8e14('0x1d'),_0x229487);logger['debug'](_0x8e14('0x1d'),_0x229487,JSON[_0x8e14('0xc')](_0xc79f58));_0x2e86a7(_0xc79f58);})['catch'](function(_0x4388e2){logger[_0x8e14('0xd')](_0x8e14('0x1d'),_0x4388e2['message'],_0x229487);_0x476ea4(_0x58861d[_0x8e14('0xd')](0x1f4,_0x4388e2['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 917f36a..a610b2c 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 _0xb713=['../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x48bc67,_0x3b2b80){var _0x5f0651=function(_0x2640ed){while(--_0x2640ed){_0x48bc67['push'](_0x48bc67['shift']());}};_0x5f0651(++_0x3b2b80);}(_0xb713,0x144));var _0x3b71=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0xb713[_0x4503df];return _0x3f1b2b;};'use strict';var multer=require(_0x3b71('0x0'));var util=require(_0x3b71('0x1'));var path=require(_0x3b71('0x2'));var timeout=require(_0x3b71('0x3'));var express=require('express');var router=express[_0x3b71('0x4')]();var fs_extra=require(_0x3b71('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b71('0x6'));var config=require('../../config/environment');var controller=require(_0x3b71('0x7'));router[_0x3b71('0x8')]('/',auth[_0x3b71('0x9')](),controller['index']);router['get']('/:id',auth[_0x3b71('0x9')](),controller['show']);router[_0x3b71('0x8')](_0x3b71('0xa'),auth[_0x3b71('0x9')](),controller['getFields']);router['get'](_0x3b71('0xb'),auth[_0x3b71('0x9')](),controller[_0x3b71('0xc')]);router[_0x3b71('0x8')](_0x3b71('0xd'),auth['isAuthenticated'](),controller[_0x3b71('0xe')]);router[_0x3b71('0xf')]('/',auth[_0x3b71('0x9')](),controller['create']);router[_0x3b71('0x10')](_0x3b71('0x11'),auth[_0x3b71('0x9')](),controller[_0x3b71('0x12')]);router[_0x3b71('0x13')](_0x3b71('0x11'),auth[_0x3b71('0x9')](),controller[_0x3b71('0x14')]);module[_0x3b71('0x15')]=router; \ No newline at end of file +var _0x68ee=['get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x301cd1,_0x18d147){var _0xfd7391=function(_0x2f0bc6){while(--_0x2f0bc6){_0x301cd1['push'](_0x301cd1['shift']());}};_0xfd7391(++_0x18d147);}(_0x68ee,0xd3));var _0xe68e=function(_0x3d8633,_0x4641d8){_0x3d8633=_0x3d8633-0x0;var _0x13536b=_0x68ee[_0x3d8633];return _0x13536b;};'use strict';var multer=require(_0xe68e('0x0'));var util=require(_0xe68e('0x1'));var path=require(_0xe68e('0x2'));var timeout=require(_0xe68e('0x3'));var express=require(_0xe68e('0x4'));var router=express[_0xe68e('0x5')]();var fs_extra=require(_0xe68e('0x6'));var auth=require(_0xe68e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe68e('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xe68e('0x9')]('/',auth[_0xe68e('0xa')](),controller['index']);router[_0xe68e('0x9')](_0xe68e('0xb'),auth['isAuthenticated'](),controller[_0xe68e('0xc')]);router[_0xe68e('0x9')]('/:id/fields',auth[_0xe68e('0xa')](),controller[_0xe68e('0xd')]);router['get'](_0xe68e('0xe'),auth[_0xe68e('0xa')](),controller[_0xe68e('0xf')]);router[_0xe68e('0x9')](_0xe68e('0x10'),auth[_0xe68e('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0xe68e('0xa')](),controller[_0xe68e('0x11')]);router[_0xe68e('0x12')](_0xe68e('0xb'),auth[_0xe68e('0xa')](),controller['update']);router[_0xe68e('0x13')]('/:id',auth[_0xe68e('0xa')](),controller[_0xe68e('0x14')]);module[_0xe68e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 062002d..47bccc0 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 _0xd2a3=['STRING','sequelize','exports'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd2a3,0xa3));var _0x3d2a=function(_0x3817e2,_0x229c03){_0x3817e2=_0x3817e2-0x0;var _0x3ee4e6=_0xd2a3[_0x3817e2];return _0x3ee4e6;};'use strict';var Sequelize=require(_0x3d2a('0x0'));module[_0x3d2a('0x1')]={'name':{'type':Sequelize[_0x3d2a('0x2')]},'description':{'type':Sequelize[_0x3d2a('0x2')]}}; \ No newline at end of file +var _0x90e2=['sequelize','exports','STRING'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x90e2,0x18f));var _0x290e=function(_0x2b1874,_0x3310ed){_0x2b1874=_0x2b1874-0x0;var _0xdb3d1a=_0x90e2[_0x2b1874];return _0xdb3d1a;};'use strict';var Sequelize=require(_0x290e('0x0'));module[_0x290e('0x1')]={'name':{'type':Sequelize[_0x290e('0x2')]},'description':{'type':Sequelize[_0x290e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 1da0f5d..93b8104 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 _0xe519=['eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','limit','sort','where','pick','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','getFields','findOne','SugarcrmField','order','filter','hasOwnProperty','nolimit','getSubjects','getDescriptions'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xe519,0xa4));var _0x9e51=function(_0x237703,_0x102d58){_0x237703=_0x237703-0x0;var _0x3728c4=_0xe519[_0x237703];return _0x3728c4;};'use strict';var emlformat=require(_0x9e51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e51('0x1'));var jsonpatch=require(_0x9e51('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e51('0x3'));var Mustache=require(_0x9e51('0x4'));var util=require(_0x9e51('0x5'));var path=require(_0x9e51('0x6'));var sox=require('sox');var csv=require(_0x9e51('0x7'));var ejs=require(_0x9e51('0x8'));var fs=require('fs');var fs_extra=require(_0x9e51('0x9'));var _=require(_0x9e51('0xa'));var squel=require('squel');var crypto=require(_0x9e51('0xb'));var jsforce=require(_0x9e51('0xc'));var deskjs=require(_0x9e51('0xd'));var toCsv=require(_0x9e51('0x7'));var querystring=require(_0x9e51('0xe'));var Papa=require(_0x9e51('0xf'));var Redis=require(_0x9e51('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9e51('0x11'));var as=require(_0x9e51('0x12'));var hardwareService=require(_0x9e51('0x13'));var logger=require('../../config/logger')(_0x9e51('0x14'));var utils=require(_0x9e51('0x15'));var config=require(_0x9e51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e51('0x17'))['db'];function respondWithStatusCode(_0x4f98d6,_0x48ff8d){_0x48ff8d=_0x48ff8d||0xcc;return function(_0x220bc4){if(_0x220bc4){return _0x4f98d6[_0x9e51('0x18')](_0x48ff8d);}return _0x4f98d6[_0x9e51('0x19')](_0x48ff8d)[_0x9e51('0x1a')]();};}function respondWithResult(_0xe90296,_0x5c3644){_0x5c3644=_0x5c3644||0xc8;return function(_0x3231c0){if(_0x3231c0){return _0xe90296[_0x9e51('0x19')](_0x5c3644)[_0x9e51('0x1b')](_0x3231c0);}};}function respondWithFilteredResult(_0x5bd4f4,_0x28e686){return function(_0x49535b){if(_0x49535b){var _0x5de61f=typeof _0x28e686[_0x9e51('0x1c')]==='undefined'&&typeof _0x28e686['limit']===_0x9e51('0x1d');var _0x5d7b9e=_0x49535b['count'];var _0x2c9fc7=_0x5de61f?0x0:_0x28e686[_0x9e51('0x1c')];var _0x1c94b5=_0x5de61f?_0x49535b['count']:_0x28e686[_0x9e51('0x1c')]+_0x28e686['limit'];var _0x12bef7;if(_0x1c94b5>=_0x5d7b9e){_0x1c94b5=_0x5d7b9e;_0x12bef7=0xc8;}else{_0x12bef7=0xce;}_0x5bd4f4[_0x9e51('0x19')](_0x12bef7);return _0x5bd4f4[_0x9e51('0x1e')](_0x9e51('0x1f'),_0x2c9fc7+'-'+_0x1c94b5+'/'+_0x5d7b9e)['json'](_0x49535b);}return null;};}function patchUpdates(_0x170eb8){return function(_0x2ecf48){try{jsonpatch[_0x9e51('0x20')](_0x2ecf48,_0x170eb8,!![]);}catch(_0x58d799){return BPromise[_0x9e51('0x21')](_0x58d799);}return _0x2ecf48[_0x9e51('0x22')]();};}function saveUpdates(_0x4feee8,_0x4fb2da){return function(_0x448ed4){if(_0x448ed4){return _0x448ed4['update'](_0x4feee8)[_0x9e51('0x23')](function(_0x5b4f32){return _0x5b4f32;});}return null;};}function removeEntity(_0x4216bc,_0x18f7e5){return function(_0x39f44e){if(_0x39f44e){return _0x39f44e[_0x9e51('0x24')]()[_0x9e51('0x23')](function(){_0x4216bc[_0x9e51('0x19')](0xcc)[_0x9e51('0x1a')]();});}};}function handleEntityNotFound(_0x47c97f,_0xa5e1a0){return function(_0x323f37){if(!_0x323f37){_0x47c97f[_0x9e51('0x18')](0x194);}return _0x323f37;};}function handleError(_0x3ca2f2,_0x34afe6){_0x34afe6=_0x34afe6||0x1f4;return function(_0x1edb85){logger[_0x9e51('0x25')](_0x1edb85[_0x9e51('0x26')]);if(_0x1edb85['name']){delete _0x1edb85[_0x9e51('0x27')];}_0x3ca2f2['status'](_0x34afe6)[_0x9e51('0x28')](_0x1edb85);};}exports[_0x9e51('0x29')]=function(_0x3ae0c2,_0x97d32d){var _0x13fa01={},_0x32f818={},_0x4f76f5={'count':0x0,'rows':[]};var _0x16afea=_[_0x9e51('0x2a')](db[_0x9e51('0x2b')]['rawAttributes'],function(_0x11894d){return{'name':_0x11894d[_0x9e51('0x2c')],'type':_0x11894d[_0x9e51('0x2d')][_0x9e51('0x2e')]};});_0x32f818['model']=_[_0x9e51('0x2a')](_0x16afea,_0x9e51('0x27'));_0x32f818[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x3ae0c2[_0x9e51('0x2f')]);_0x32f818[_0x9e51('0x31')]=_['intersection'](_0x32f818[_0x9e51('0x32')],_0x32f818[_0x9e51('0x2f')]);_0x13fa01[_0x9e51('0x33')]=_[_0x9e51('0x34')](_0x32f818['model'],qs[_0x9e51('0x35')](_0x3ae0c2['query']['fields']));_0x13fa01[_0x9e51('0x33')]=_0x13fa01[_0x9e51('0x33')][_0x9e51('0x36')]?_0x13fa01[_0x9e51('0x33')]:_0x32f818['model'];if(!_0x3ae0c2[_0x9e51('0x2f')]['hasOwnProperty']('nolimit')){_0x13fa01[_0x9e51('0x37')]=qs[_0x9e51('0x37')](_0x3ae0c2[_0x9e51('0x2f')][_0x9e51('0x37')]);_0x13fa01[_0x9e51('0x1c')]=qs[_0x9e51('0x1c')](_0x3ae0c2[_0x9e51('0x2f')]['offset']);}_0x13fa01['order']=qs[_0x9e51('0x38')](_0x3ae0c2[_0x9e51('0x2f')][_0x9e51('0x38')]);_0x13fa01[_0x9e51('0x39')]=qs[_0x9e51('0x31')](_[_0x9e51('0x3a')](_0x3ae0c2[_0x9e51('0x2f')],_0x32f818[_0x9e51('0x31')]),_0x16afea);if(_0x3ae0c2[_0x9e51('0x2f')]['filter']){_0x13fa01[_0x9e51('0x39')]=_[_0x9e51('0x3b')](_0x13fa01['where'],{'$or':_['map'](_0x16afea,function(_0x541d40){if(_0x541d40[_0x9e51('0x2d')]!==_0x9e51('0x3c')){var _0x1dcb12={};_0x1dcb12[_0x541d40[_0x9e51('0x27')]]={'$like':'%'+_0x3ae0c2[_0x9e51('0x2f')]['filter']+'%'};return _0x1dcb12;}})});}_0x13fa01=_['merge']({},_0x13fa01,_0x3ae0c2[_0x9e51('0x3d')]);var _0x90c09e={'where':_0x13fa01[_0x9e51('0x39')]};return db[_0x9e51('0x2b')]['count'](_0x90c09e)['then'](function(_0x1ae21c){_0x4f76f5[_0x9e51('0x3e')]=_0x1ae21c;if(_0x3ae0c2[_0x9e51('0x2f')]['includeAll']){_0x13fa01[_0x9e51('0x3f')]=[{'all':!![]}];}return db[_0x9e51('0x2b')][_0x9e51('0x40')](_0x13fa01);})[_0x9e51('0x23')](function(_0x100949){_0x4f76f5[_0x9e51('0x41')]=_0x100949;return _0x4f76f5;})['then'](respondWithFilteredResult(_0x97d32d,_0x13fa01))[_0x9e51('0x42')](handleError(_0x97d32d,null));};exports[_0x9e51('0x43')]=function(_0x2c2030,_0x224344){var _0x5b77af={'raw':![],'where':{'id':_0x2c2030['params']['id']}},_0x4f9df5={};_0x4f9df5[_0x9e51('0x32')]=_[_0x9e51('0x30')](db['SugarcrmConfiguration'][_0x9e51('0x44')]);_0x4f9df5[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x2c2030[_0x9e51('0x2f')]);_0x4f9df5['filters']=_[_0x9e51('0x34')](_0x4f9df5[_0x9e51('0x32')],_0x4f9df5[_0x9e51('0x2f')]);_0x5b77af[_0x9e51('0x33')]=_[_0x9e51('0x34')](_0x4f9df5[_0x9e51('0x32')],qs['fields'](_0x2c2030[_0x9e51('0x2f')][_0x9e51('0x35')]));_0x5b77af[_0x9e51('0x33')]=_0x5b77af[_0x9e51('0x33')][_0x9e51('0x36')]?_0x5b77af[_0x9e51('0x33')]:_0x4f9df5[_0x9e51('0x32')];if(_0x2c2030[_0x9e51('0x2f')]['includeAll']){_0x5b77af[_0x9e51('0x3f')]=[{'all':!![]}];}_0x5b77af=_['merge']({},_0x5b77af,_0x2c2030[_0x9e51('0x3d')]);return db[_0x9e51('0x2b')][_0x9e51('0x45')](_0x5b77af)['then'](handleEntityNotFound(_0x224344,null))[_0x9e51('0x23')](respondWithResult(_0x224344,null))['catch'](handleError(_0x224344,null));};exports[_0x9e51('0x46')]=function(_0x64e9f4,_0x208d29){return db[_0x9e51('0x2b')]['create'](_0x64e9f4[_0x9e51('0x47')],{})['then'](respondWithResult(_0x208d29,0xc9))[_0x9e51('0x42')](handleError(_0x208d29,null));};exports['update']=function(_0x9b964b,_0x453bc3){if(_0x9b964b[_0x9e51('0x47')]['id']){delete _0x9b964b[_0x9e51('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x9e51('0x45')]({'where':{'id':_0x9b964b[_0x9e51('0x48')]['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x453bc3,null))['then'](saveUpdates(_0x9b964b[_0x9e51('0x47')],null))[_0x9e51('0x23')](respondWithResult(_0x453bc3,null))['catch'](handleError(_0x453bc3,null));};exports[_0x9e51('0x24')]=function(_0x36a1b2,_0x52407c){return db[_0x9e51('0x2b')]['find']({'where':{'id':_0x36a1b2['params']['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x52407c,null))[_0x9e51('0x23')](removeEntity(_0x52407c,null))[_0x9e51('0x42')](handleError(_0x52407c,null));};exports[_0x9e51('0x49')]=function(_0x4caf62,_0x2a0712,_0x1bdefa){var _0x3e5b47={};var _0x4cdaf6={};var _0x1af7bf;var _0x3edb67;return db[_0x9e51('0x2b')][_0x9e51('0x4a')]({'where':{'id':_0x4caf62['params']['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x2a0712,null))[_0x9e51('0x23')](function(_0x4e952a){if(_0x4e952a){_0x1af7bf=_0x4e952a;_0x4cdaf6[_0x9e51('0x32')]=_[_0x9e51('0x30')](db[_0x9e51('0x4b')][_0x9e51('0x44')]);_0x4cdaf6[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x4caf62[_0x9e51('0x2f')]);_0x4cdaf6[_0x9e51('0x31')]=_[_0x9e51('0x34')](_0x4cdaf6['model'],_0x4cdaf6['query']);_0x3e5b47['attributes']=_[_0x9e51('0x34')](_0x4cdaf6['model'],qs[_0x9e51('0x35')](_0x4caf62['query'][_0x9e51('0x35')]));_0x3e5b47[_0x9e51('0x33')]=_0x3e5b47['attributes'][_0x9e51('0x36')]?_0x3e5b47[_0x9e51('0x33')]:_0x4cdaf6[_0x9e51('0x32')];_0x3e5b47[_0x9e51('0x4c')]=qs[_0x9e51('0x38')](_0x4caf62['query']['sort']);_0x3e5b47['where']=qs['filters'](_[_0x9e51('0x3a')](_0x4caf62['query'],_0x4cdaf6['filters']));if(_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x4d')]){_0x3e5b47[_0x9e51('0x39')]=_[_0x9e51('0x3b')](_0x3e5b47[_0x9e51('0x39')],{'$or':_['map'](_0x3e5b47[_0x9e51('0x33')],function(_0x2e50e2){var _0x450498={};_0x450498[_0x2e50e2]={'$like':'%'+_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x4d')]+'%'};return _0x450498;})});}_0x3e5b47=_['merge']({},_0x3e5b47,_0x4caf62[_0x9e51('0x3d')]);return _0x1af7bf[_0x9e51('0x49')](_0x3e5b47);}})['then'](function(_0x1a677a){if(_0x1a677a){_0x3edb67=_0x1a677a['length'];if(!_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x4e')](_0x9e51('0x4f'))){_0x3e5b47[_0x9e51('0x37')]=qs[_0x9e51('0x37')](_0x4caf62['query'][_0x9e51('0x37')]);_0x3e5b47[_0x9e51('0x1c')]=qs[_0x9e51('0x1c')](_0x4caf62[_0x9e51('0x2f')][_0x9e51('0x1c')]);}return _0x1af7bf[_0x9e51('0x49')](_0x3e5b47);}})[_0x9e51('0x23')](function(_0x28bd01){if(_0x28bd01){return _0x28bd01?{'count':_0x3edb67,'rows':_0x28bd01}:null;}})[_0x9e51('0x23')](respondWithResult(_0x2a0712,null))[_0x9e51('0x42')](handleError(_0x2a0712,null));};exports[_0x9e51('0x50')]=function(_0x4418ef,_0x55ff26,_0x346766){var _0x2aa46c={};var _0x44f570={};var _0x4fa70f;var _0xb44cdb;return db[_0x9e51('0x2b')][_0x9e51('0x4a')]({'where':{'id':_0x4418ef[_0x9e51('0x48')]['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0x55ff26,null))['then'](function(_0x598220){if(_0x598220){_0x4fa70f=_0x598220;_0x44f570['model']=_['keys'](db[_0x9e51('0x4b')][_0x9e51('0x44')]);_0x44f570[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x4418ef[_0x9e51('0x2f')]);_0x44f570[_0x9e51('0x31')]=_[_0x9e51('0x34')](_0x44f570[_0x9e51('0x32')],_0x44f570[_0x9e51('0x2f')]);_0x2aa46c[_0x9e51('0x33')]=_[_0x9e51('0x34')](_0x44f570['model'],qs[_0x9e51('0x35')](_0x4418ef['query']['fields']));_0x2aa46c[_0x9e51('0x33')]=_0x2aa46c['attributes']['length']?_0x2aa46c[_0x9e51('0x33')]:_0x44f570[_0x9e51('0x32')];_0x2aa46c[_0x9e51('0x4c')]=qs[_0x9e51('0x38')](_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x38')]);_0x2aa46c[_0x9e51('0x39')]=qs[_0x9e51('0x31')](_[_0x9e51('0x3a')](_0x4418ef[_0x9e51('0x2f')],_0x44f570['filters']));if(_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x4d')]){_0x2aa46c[_0x9e51('0x39')]=_[_0x9e51('0x3b')](_0x2aa46c[_0x9e51('0x39')],{'$or':_[_0x9e51('0x2a')](_0x2aa46c[_0x9e51('0x33')],function(_0x29da5d){var _0x17c47b={};_0x17c47b[_0x29da5d]={'$like':'%'+_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x4d')]+'%'};return _0x17c47b;})});}_0x2aa46c=_[_0x9e51('0x3b')]({},_0x2aa46c,_0x4418ef[_0x9e51('0x3d')]);return _0x4fa70f[_0x9e51('0x50')](_0x2aa46c);}})[_0x9e51('0x23')](function(_0x2dc504){if(_0x2dc504){_0xb44cdb=_0x2dc504[_0x9e51('0x36')];if(!_0x4418ef['query'][_0x9e51('0x4e')](_0x9e51('0x4f'))){_0x2aa46c[_0x9e51('0x37')]=qs['limit'](_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x37')]);_0x2aa46c['offset']=qs[_0x9e51('0x1c')](_0x4418ef[_0x9e51('0x2f')][_0x9e51('0x1c')]);}return _0x4fa70f[_0x9e51('0x50')](_0x2aa46c);}})[_0x9e51('0x23')](function(_0x1cda8f){if(_0x1cda8f){return _0x1cda8f?{'count':_0xb44cdb,'rows':_0x1cda8f}:null;}})[_0x9e51('0x23')](respondWithResult(_0x55ff26,null))['catch'](handleError(_0x55ff26,null));};exports[_0x9e51('0x51')]=function(_0x5c9430,_0xdaf213,_0x44604d){var _0x542f24={};var _0x1a42a0={};var _0x22baf6;var _0x1f155a;return db['SugarcrmConfiguration'][_0x9e51('0x4a')]({'where':{'id':_0x5c9430[_0x9e51('0x48')]['id']}})[_0x9e51('0x23')](handleEntityNotFound(_0xdaf213,null))[_0x9e51('0x23')](function(_0x326e04){if(_0x326e04){_0x22baf6=_0x326e04;_0x1a42a0[_0x9e51('0x32')]=_[_0x9e51('0x30')](db[_0x9e51('0x4b')][_0x9e51('0x44')]);_0x1a42a0[_0x9e51('0x2f')]=_[_0x9e51('0x30')](_0x5c9430[_0x9e51('0x2f')]);_0x1a42a0['filters']=_['intersection'](_0x1a42a0[_0x9e51('0x32')],_0x1a42a0['query']);_0x542f24[_0x9e51('0x33')]=_['intersection'](_0x1a42a0['model'],qs[_0x9e51('0x35')](_0x5c9430['query']['fields']));_0x542f24[_0x9e51('0x33')]=_0x542f24[_0x9e51('0x33')][_0x9e51('0x36')]?_0x542f24[_0x9e51('0x33')]:_0x1a42a0[_0x9e51('0x32')];_0x542f24[_0x9e51('0x4c')]=qs['sort'](_0x5c9430[_0x9e51('0x2f')]['sort']);_0x542f24[_0x9e51('0x39')]=qs[_0x9e51('0x31')](_[_0x9e51('0x3a')](_0x5c9430[_0x9e51('0x2f')],_0x1a42a0[_0x9e51('0x31')]));if(_0x5c9430['query'][_0x9e51('0x4d')]){_0x542f24['where']=_[_0x9e51('0x3b')](_0x542f24[_0x9e51('0x39')],{'$or':_[_0x9e51('0x2a')](_0x542f24[_0x9e51('0x33')],function(_0x3d849a){var _0x24509f={};_0x24509f[_0x3d849a]={'$like':'%'+_0x5c9430[_0x9e51('0x2f')][_0x9e51('0x4d')]+'%'};return _0x24509f;})});}_0x542f24=_[_0x9e51('0x3b')]({},_0x542f24,_0x5c9430[_0x9e51('0x3d')]);return _0x22baf6[_0x9e51('0x51')](_0x542f24);}})[_0x9e51('0x23')](function(_0x350613){if(_0x350613){_0x1f155a=_0x350613[_0x9e51('0x36')];if(!_0x5c9430['query'][_0x9e51('0x4e')]('nolimit')){_0x542f24[_0x9e51('0x37')]=qs[_0x9e51('0x37')](_0x5c9430[_0x9e51('0x2f')][_0x9e51('0x37')]);_0x542f24[_0x9e51('0x1c')]=qs[_0x9e51('0x1c')](_0x5c9430[_0x9e51('0x2f')]['offset']);}return _0x22baf6[_0x9e51('0x51')](_0x542f24);}})[_0x9e51('0x23')](function(_0x3bd6b4){if(_0x3bd6b4){return _0x3bd6b4?{'count':_0x1f155a,'rows':_0x3bd6b4}:null;}})[_0x9e51('0x23')](respondWithResult(_0xdaf213,null))['catch'](handleError(_0xdaf213,null));}; \ No newline at end of file +var _0x1e7f=['getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','create','body','find','params','catch','findOne','SugarcrmField'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x1e7f,0xac));var _0xf1e7=function(_0x57f19e,_0x2d6f6b){_0x57f19e=_0x57f19e-0x0;var _0x2c362d=_0x1e7f[_0x57f19e];return _0x2c362d;};'use strict';var emlformat=require(_0xf1e7('0x0'));var rimraf=require(_0xf1e7('0x1'));var zipdir=require(_0xf1e7('0x2'));var jsonpatch=require(_0xf1e7('0x3'));var rp=require(_0xf1e7('0x4'));var moment=require(_0xf1e7('0x5'));var BPromise=require(_0xf1e7('0x6'));var Mustache=require(_0xf1e7('0x7'));var util=require(_0xf1e7('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf1e7('0x9'));var ejs=require(_0xf1e7('0xa'));var fs=require('fs');var fs_extra=require(_0xf1e7('0xb'));var _=require(_0xf1e7('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf1e7('0xd'));var deskjs=require(_0xf1e7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf1e7('0xf'));var Papa=require(_0xf1e7('0x10'));var Redis=require(_0xf1e7('0x11'));var authService=require(_0xf1e7('0x12'));var qs=require(_0xf1e7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1e7('0x14'));var logger=require(_0xf1e7('0x15'))(_0xf1e7('0x16'));var utils=require(_0xf1e7('0x17'));var config=require(_0xf1e7('0x18'));var licenseUtil=require(_0xf1e7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2282b9,_0x44a559){_0x44a559=_0x44a559||0xcc;return function(_0x59af38){if(_0x59af38){return _0x2282b9[_0xf1e7('0x1a')](_0x44a559);}return _0x2282b9[_0xf1e7('0x1b')](_0x44a559)[_0xf1e7('0x1c')]();};}function respondWithResult(_0x38ccb8,_0x13918a){_0x13918a=_0x13918a||0xc8;return function(_0x9eadfa){if(_0x9eadfa){return _0x38ccb8[_0xf1e7('0x1b')](_0x13918a)[_0xf1e7('0x1d')](_0x9eadfa);}};}function respondWithFilteredResult(_0x1c25e9,_0x41ba9b){return function(_0x5341b1){if(_0x5341b1){var _0x2418d5=typeof _0x41ba9b['offset']==='undefined'&&typeof _0x41ba9b[_0xf1e7('0x1e')]===_0xf1e7('0x1f');var _0x1edf87=_0x5341b1[_0xf1e7('0x20')];var _0x1acdc9=_0x2418d5?0x0:_0x41ba9b[_0xf1e7('0x21')];var _0x4e653f=_0x2418d5?_0x5341b1[_0xf1e7('0x20')]:_0x41ba9b[_0xf1e7('0x21')]+_0x41ba9b[_0xf1e7('0x1e')];var _0x589c6f;if(_0x4e653f>=_0x1edf87){_0x4e653f=_0x1edf87;_0x589c6f=0xc8;}else{_0x589c6f=0xce;}_0x1c25e9['status'](_0x589c6f);return _0x1c25e9[_0xf1e7('0x22')](_0xf1e7('0x23'),_0x1acdc9+'-'+_0x4e653f+'/'+_0x1edf87)[_0xf1e7('0x1d')](_0x5341b1);}return null;};}function patchUpdates(_0x38c11a){return function(_0x38425d){try{jsonpatch[_0xf1e7('0x24')](_0x38425d,_0x38c11a,!![]);}catch(_0x59aa71){return BPromise[_0xf1e7('0x25')](_0x59aa71);}return _0x38425d['save']();};}function saveUpdates(_0x485e47,_0x18807b){return function(_0x1910ad){if(_0x1910ad){return _0x1910ad[_0xf1e7('0x26')](_0x485e47)[_0xf1e7('0x27')](function(_0x396992){return _0x396992;});}return null;};}function removeEntity(_0x135a77,_0x5b251a){return function(_0x317df1){if(_0x317df1){return _0x317df1[_0xf1e7('0x28')]()[_0xf1e7('0x27')](function(){_0x135a77[_0xf1e7('0x1b')](0xcc)[_0xf1e7('0x1c')]();});}};}function handleEntityNotFound(_0x2d8ee4,_0x27761b){return function(_0x1018bd){if(!_0x1018bd){_0x2d8ee4[_0xf1e7('0x1a')](0x194);}return _0x1018bd;};}function handleError(_0x3b33d8,_0x34cb83){_0x34cb83=_0x34cb83||0x1f4;return function(_0x4e6a8d){logger[_0xf1e7('0x29')](_0x4e6a8d[_0xf1e7('0x2a')]);if(_0x4e6a8d['name']){delete _0x4e6a8d[_0xf1e7('0x2b')];}_0x3b33d8[_0xf1e7('0x1b')](_0x34cb83)[_0xf1e7('0x2c')](_0x4e6a8d);};}exports[_0xf1e7('0x2d')]=function(_0x45b767,_0x38f938){var _0x14dd46={},_0x3875ec={},_0xd40bc3={'count':0x0,'rows':[]};var _0x511470=_[_0xf1e7('0x2e')](db[_0xf1e7('0x2f')][_0xf1e7('0x30')],function(_0x3fa0d4){return{'name':_0x3fa0d4[_0xf1e7('0x31')],'type':_0x3fa0d4[_0xf1e7('0x32')][_0xf1e7('0x33')]};});_0x3875ec['model']=_[_0xf1e7('0x2e')](_0x511470,_0xf1e7('0x2b'));_0x3875ec[_0xf1e7('0x34')]=_[_0xf1e7('0x35')](_0x45b767[_0xf1e7('0x34')]);_0x3875ec['filters']=_['intersection'](_0x3875ec[_0xf1e7('0x36')],_0x3875ec[_0xf1e7('0x34')]);_0x14dd46[_0xf1e7('0x37')]=_[_0xf1e7('0x38')](_0x3875ec[_0xf1e7('0x36')],qs[_0xf1e7('0x39')](_0x45b767[_0xf1e7('0x34')][_0xf1e7('0x39')]));_0x14dd46['attributes']=_0x14dd46[_0xf1e7('0x37')][_0xf1e7('0x3a')]?_0x14dd46[_0xf1e7('0x37')]:_0x3875ec[_0xf1e7('0x36')];if(!_0x45b767[_0xf1e7('0x34')]['hasOwnProperty'](_0xf1e7('0x3b'))){_0x14dd46[_0xf1e7('0x1e')]=qs[_0xf1e7('0x1e')](_0x45b767[_0xf1e7('0x34')][_0xf1e7('0x1e')]);_0x14dd46[_0xf1e7('0x21')]=qs[_0xf1e7('0x21')](_0x45b767[_0xf1e7('0x34')]['offset']);}_0x14dd46[_0xf1e7('0x3c')]=qs[_0xf1e7('0x3d')](_0x45b767[_0xf1e7('0x34')][_0xf1e7('0x3d')]);_0x14dd46[_0xf1e7('0x3e')]=qs[_0xf1e7('0x3f')](_[_0xf1e7('0x40')](_0x45b767[_0xf1e7('0x34')],_0x3875ec['filters']),_0x511470);if(_0x45b767[_0xf1e7('0x34')][_0xf1e7('0x41')]){_0x14dd46['where']=_['merge'](_0x14dd46['where'],{'$or':_[_0xf1e7('0x2e')](_0x511470,function(_0x236dfb){if(_0x236dfb[_0xf1e7('0x32')]!=='VIRTUAL'){var _0x457ed0={};_0x457ed0[_0x236dfb[_0xf1e7('0x2b')]]={'$like':'%'+_0x45b767['query'][_0xf1e7('0x41')]+'%'};return _0x457ed0;}})});}_0x14dd46=_[_0xf1e7('0x42')]({},_0x14dd46,_0x45b767[_0xf1e7('0x43')]);var _0x4a79b6={'where':_0x14dd46[_0xf1e7('0x3e')]};return db['SugarcrmConfiguration'][_0xf1e7('0x20')](_0x4a79b6)[_0xf1e7('0x27')](function(_0x9bd007){_0xd40bc3[_0xf1e7('0x20')]=_0x9bd007;if(_0x45b767[_0xf1e7('0x34')][_0xf1e7('0x44')]){_0x14dd46[_0xf1e7('0x45')]=[{'all':!![]}];}return db[_0xf1e7('0x2f')][_0xf1e7('0x46')](_0x14dd46);})[_0xf1e7('0x27')](function(_0x518bdc){_0xd40bc3[_0xf1e7('0x47')]=_0x518bdc;return _0xd40bc3;})[_0xf1e7('0x27')](respondWithFilteredResult(_0x38f938,_0x14dd46))['catch'](handleError(_0x38f938,null));};exports[_0xf1e7('0x48')]=function(_0x4bee2b,_0xdd6bc5){var _0x7164dc={'raw':![],'where':{'id':_0x4bee2b['params']['id']}},_0x232f9b={};_0x232f9b[_0xf1e7('0x36')]=_[_0xf1e7('0x35')](db[_0xf1e7('0x2f')]['rawAttributes']);_0x232f9b[_0xf1e7('0x34')]=_[_0xf1e7('0x35')](_0x4bee2b[_0xf1e7('0x34')]);_0x232f9b[_0xf1e7('0x3f')]=_['intersection'](_0x232f9b[_0xf1e7('0x36')],_0x232f9b[_0xf1e7('0x34')]);_0x7164dc[_0xf1e7('0x37')]=_[_0xf1e7('0x38')](_0x232f9b[_0xf1e7('0x36')],qs[_0xf1e7('0x39')](_0x4bee2b[_0xf1e7('0x34')]['fields']));_0x7164dc['attributes']=_0x7164dc[_0xf1e7('0x37')][_0xf1e7('0x3a')]?_0x7164dc[_0xf1e7('0x37')]:_0x232f9b[_0xf1e7('0x36')];if(_0x4bee2b['query'][_0xf1e7('0x44')]){_0x7164dc[_0xf1e7('0x45')]=[{'all':!![]}];}_0x7164dc=_[_0xf1e7('0x42')]({},_0x7164dc,_0x4bee2b[_0xf1e7('0x43')]);return db['SugarcrmConfiguration']['find'](_0x7164dc)[_0xf1e7('0x27')](handleEntityNotFound(_0xdd6bc5,null))[_0xf1e7('0x27')](respondWithResult(_0xdd6bc5,null))['catch'](handleError(_0xdd6bc5,null));};exports['create']=function(_0x57340e,_0x1176dc){return db[_0xf1e7('0x2f')][_0xf1e7('0x49')](_0x57340e[_0xf1e7('0x4a')],{})['then'](respondWithResult(_0x1176dc,0xc9))['catch'](handleError(_0x1176dc,null));};exports[_0xf1e7('0x26')]=function(_0x3c3436,_0x361e05){if(_0x3c3436[_0xf1e7('0x4a')]['id']){delete _0x3c3436['body']['id'];}return db[_0xf1e7('0x2f')][_0xf1e7('0x4b')]({'where':{'id':_0x3c3436[_0xf1e7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x361e05,null))[_0xf1e7('0x27')](saveUpdates(_0x3c3436[_0xf1e7('0x4a')],null))[_0xf1e7('0x27')](respondWithResult(_0x361e05,null))[_0xf1e7('0x4d')](handleError(_0x361e05,null));};exports[_0xf1e7('0x28')]=function(_0x459153,_0x69233f){return db[_0xf1e7('0x2f')][_0xf1e7('0x4b')]({'where':{'id':_0x459153['params']['id']}})['then'](handleEntityNotFound(_0x69233f,null))[_0xf1e7('0x27')](removeEntity(_0x69233f,null))['catch'](handleError(_0x69233f,null));};exports['getFields']=function(_0x281ca7,_0x19bbd3,_0x23919b){var _0x1d9378={};var _0x53b7de={};var _0x9188a;var _0x20ab33;return db[_0xf1e7('0x2f')][_0xf1e7('0x4e')]({'where':{'id':_0x281ca7[_0xf1e7('0x4c')]['id']}})[_0xf1e7('0x27')](handleEntityNotFound(_0x19bbd3,null))[_0xf1e7('0x27')](function(_0x58841e){if(_0x58841e){_0x9188a=_0x58841e;_0x53b7de[_0xf1e7('0x36')]=_[_0xf1e7('0x35')](db[_0xf1e7('0x4f')][_0xf1e7('0x30')]);_0x53b7de[_0xf1e7('0x34')]=_[_0xf1e7('0x35')](_0x281ca7[_0xf1e7('0x34')]);_0x53b7de[_0xf1e7('0x3f')]=_['intersection'](_0x53b7de[_0xf1e7('0x36')],_0x53b7de[_0xf1e7('0x34')]);_0x1d9378[_0xf1e7('0x37')]=_[_0xf1e7('0x38')](_0x53b7de[_0xf1e7('0x36')],qs[_0xf1e7('0x39')](_0x281ca7[_0xf1e7('0x34')]['fields']));_0x1d9378[_0xf1e7('0x37')]=_0x1d9378[_0xf1e7('0x37')][_0xf1e7('0x3a')]?_0x1d9378[_0xf1e7('0x37')]:_0x53b7de[_0xf1e7('0x36')];_0x1d9378[_0xf1e7('0x3c')]=qs[_0xf1e7('0x3d')](_0x281ca7[_0xf1e7('0x34')]['sort']);_0x1d9378[_0xf1e7('0x3e')]=qs[_0xf1e7('0x3f')](_[_0xf1e7('0x40')](_0x281ca7[_0xf1e7('0x34')],_0x53b7de[_0xf1e7('0x3f')]));if(_0x281ca7[_0xf1e7('0x34')][_0xf1e7('0x41')]){_0x1d9378[_0xf1e7('0x3e')]=_[_0xf1e7('0x42')](_0x1d9378[_0xf1e7('0x3e')],{'$or':_[_0xf1e7('0x2e')](_0x1d9378[_0xf1e7('0x37')],function(_0x4d29c9){var _0x5b8008={};_0x5b8008[_0x4d29c9]={'$like':'%'+_0x281ca7['query'][_0xf1e7('0x41')]+'%'};return _0x5b8008;})});}_0x1d9378=_[_0xf1e7('0x42')]({},_0x1d9378,_0x281ca7[_0xf1e7('0x43')]);return _0x9188a[_0xf1e7('0x50')](_0x1d9378);}})['then'](function(_0x1acc91){if(_0x1acc91){_0x20ab33=_0x1acc91['length'];if(!_0x281ca7[_0xf1e7('0x34')][_0xf1e7('0x51')](_0xf1e7('0x3b'))){_0x1d9378['limit']=qs[_0xf1e7('0x1e')](_0x281ca7[_0xf1e7('0x34')][_0xf1e7('0x1e')]);_0x1d9378['offset']=qs[_0xf1e7('0x21')](_0x281ca7['query'][_0xf1e7('0x21')]);}return _0x9188a[_0xf1e7('0x50')](_0x1d9378);}})[_0xf1e7('0x27')](function(_0x5a7baa){if(_0x5a7baa){return _0x5a7baa?{'count':_0x20ab33,'rows':_0x5a7baa}:null;}})[_0xf1e7('0x27')](respondWithResult(_0x19bbd3,null))[_0xf1e7('0x4d')](handleError(_0x19bbd3,null));};exports[_0xf1e7('0x52')]=function(_0x1ecce0,_0x191098,_0x462ab3){var _0x3b5a10={};var _0x2848c9={};var _0x4f695d;var _0x115019;return db[_0xf1e7('0x2f')]['findOne']({'where':{'id':_0x1ecce0['params']['id']}})[_0xf1e7('0x27')](handleEntityNotFound(_0x191098,null))[_0xf1e7('0x27')](function(_0x28e284){if(_0x28e284){_0x4f695d=_0x28e284;_0x2848c9['model']=_['keys'](db['SugarcrmField'][_0xf1e7('0x30')]);_0x2848c9[_0xf1e7('0x34')]=_[_0xf1e7('0x35')](_0x1ecce0[_0xf1e7('0x34')]);_0x2848c9[_0xf1e7('0x3f')]=_[_0xf1e7('0x38')](_0x2848c9['model'],_0x2848c9['query']);_0x3b5a10[_0xf1e7('0x37')]=_[_0xf1e7('0x38')](_0x2848c9['model'],qs[_0xf1e7('0x39')](_0x1ecce0[_0xf1e7('0x34')][_0xf1e7('0x39')]));_0x3b5a10[_0xf1e7('0x37')]=_0x3b5a10['attributes']['length']?_0x3b5a10[_0xf1e7('0x37')]:_0x2848c9[_0xf1e7('0x36')];_0x3b5a10[_0xf1e7('0x3c')]=qs[_0xf1e7('0x3d')](_0x1ecce0[_0xf1e7('0x34')][_0xf1e7('0x3d')]);_0x3b5a10['where']=qs['filters'](_['pick'](_0x1ecce0['query'],_0x2848c9[_0xf1e7('0x3f')]));if(_0x1ecce0['query'][_0xf1e7('0x41')]){_0x3b5a10[_0xf1e7('0x3e')]=_['merge'](_0x3b5a10[_0xf1e7('0x3e')],{'$or':_['map'](_0x3b5a10[_0xf1e7('0x37')],function(_0xa3234e){var _0x34f9d1={};_0x34f9d1[_0xa3234e]={'$like':'%'+_0x1ecce0['query']['filter']+'%'};return _0x34f9d1;})});}_0x3b5a10=_[_0xf1e7('0x42')]({},_0x3b5a10,_0x1ecce0['options']);return _0x4f695d[_0xf1e7('0x52')](_0x3b5a10);}})[_0xf1e7('0x27')](function(_0x23fb67){if(_0x23fb67){_0x115019=_0x23fb67['length'];if(!_0x1ecce0[_0xf1e7('0x34')][_0xf1e7('0x51')](_0xf1e7('0x3b'))){_0x3b5a10[_0xf1e7('0x1e')]=qs[_0xf1e7('0x1e')](_0x1ecce0['query'][_0xf1e7('0x1e')]);_0x3b5a10[_0xf1e7('0x21')]=qs['offset'](_0x1ecce0[_0xf1e7('0x34')][_0xf1e7('0x21')]);}return _0x4f695d['getSubjects'](_0x3b5a10);}})['then'](function(_0x499374){if(_0x499374){return _0x499374?{'count':_0x115019,'rows':_0x499374}:null;}})[_0xf1e7('0x27')](respondWithResult(_0x191098,null))[_0xf1e7('0x4d')](handleError(_0x191098,null));};exports[_0xf1e7('0x53')]=function(_0x266808,_0x4a8c1a,_0x3696e4){var _0x1ca63f={};var _0x116921={};var _0x4e3d2f;var _0x362a34;return db[_0xf1e7('0x2f')][_0xf1e7('0x4e')]({'where':{'id':_0x266808[_0xf1e7('0x4c')]['id']}})[_0xf1e7('0x27')](handleEntityNotFound(_0x4a8c1a,null))[_0xf1e7('0x27')](function(_0x1ccee){if(_0x1ccee){_0x4e3d2f=_0x1ccee;_0x116921[_0xf1e7('0x36')]=_[_0xf1e7('0x35')](db[_0xf1e7('0x4f')][_0xf1e7('0x30')]);_0x116921[_0xf1e7('0x34')]=_[_0xf1e7('0x35')](_0x266808[_0xf1e7('0x34')]);_0x116921['filters']=_[_0xf1e7('0x38')](_0x116921[_0xf1e7('0x36')],_0x116921['query']);_0x1ca63f[_0xf1e7('0x37')]=_['intersection'](_0x116921[_0xf1e7('0x36')],qs[_0xf1e7('0x39')](_0x266808[_0xf1e7('0x34')][_0xf1e7('0x39')]));_0x1ca63f[_0xf1e7('0x37')]=_0x1ca63f[_0xf1e7('0x37')][_0xf1e7('0x3a')]?_0x1ca63f[_0xf1e7('0x37')]:_0x116921[_0xf1e7('0x36')];_0x1ca63f[_0xf1e7('0x3c')]=qs[_0xf1e7('0x3d')](_0x266808[_0xf1e7('0x34')][_0xf1e7('0x3d')]);_0x1ca63f['where']=qs[_0xf1e7('0x3f')](_['pick'](_0x266808[_0xf1e7('0x34')],_0x116921['filters']));if(_0x266808[_0xf1e7('0x34')]['filter']){_0x1ca63f[_0xf1e7('0x3e')]=_[_0xf1e7('0x42')](_0x1ca63f[_0xf1e7('0x3e')],{'$or':_[_0xf1e7('0x2e')](_0x1ca63f['attributes'],function(_0x5ed6f0){var _0x2e049f={};_0x2e049f[_0x5ed6f0]={'$like':'%'+_0x266808[_0xf1e7('0x34')][_0xf1e7('0x41')]+'%'};return _0x2e049f;})});}_0x1ca63f=_[_0xf1e7('0x42')]({},_0x1ca63f,_0x266808['options']);return _0x4e3d2f['getDescriptions'](_0x1ca63f);}})[_0xf1e7('0x27')](function(_0x20b8fa){if(_0x20b8fa){_0x362a34=_0x20b8fa[_0xf1e7('0x3a')];if(!_0x266808[_0xf1e7('0x34')][_0xf1e7('0x51')](_0xf1e7('0x3b'))){_0x1ca63f[_0xf1e7('0x1e')]=qs[_0xf1e7('0x1e')](_0x266808[_0xf1e7('0x34')]['limit']);_0x1ca63f[_0xf1e7('0x21')]=qs[_0xf1e7('0x21')](_0x266808[_0xf1e7('0x34')][_0xf1e7('0x21')]);}return _0x4e3d2f[_0xf1e7('0x53')](_0x1ca63f);}})[_0xf1e7('0x27')](function(_0xf4e77d){if(_0xf4e77d){return _0xf4e77d?{'count':_0x362a34,'rows':_0xf4e77d}:null;}})['then'](respondWithResult(_0x4a8c1a,null))[_0xf1e7('0x4d')](handleError(_0x4a8c1a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index ed7580f..c494c8e 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 _0x5277=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x597713,_0x5db9c8){var _0x248946=function(_0x547ce0){while(--_0x547ce0){_0x597713['push'](_0x597713['shift']());}};_0x248946(++_0x5db9c8);}(_0x5277,0xde));var _0x7527=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5277[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x7527('0x0'));var logger=require(_0x7527('0x1'))(_0x7527('0x2'));var moment=require(_0x7527('0x3'));var BPromise=require(_0x7527('0x4'));var rp=require(_0x7527('0x5'));var fs=require('fs');var path=require(_0x7527('0x6'));var rimraf=require(_0x7527('0x7'));var config=require(_0x7527('0x8'));var attributes=require(_0x7527('0x9'));module['exports']=function(_0x46e0e6,_0x3e5c75){return _0x46e0e6[_0x7527('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x7527('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0475=['int_sugarcrm_configurations','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x1f0f52,_0x563ada){var _0x25e4e6=function(_0x2054be){while(--_0x2054be){_0x1f0f52['push'](_0x1f0f52['shift']());}};_0x25e4e6(++_0x563ada);}(_0x0475,0xbc));var _0x5047=function(_0x5bd8f5,_0x5afd11){_0x5bd8f5=_0x5bd8f5-0x0;var _0x33d43b=_0x0475[_0x5bd8f5];return _0x33d43b;};'use strict';var _=require(_0x5047('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5047('0x1'));var moment=require(_0x5047('0x2'));var BPromise=require(_0x5047('0x3'));var rp=require(_0x5047('0x4'));var fs=require('fs');var path=require(_0x5047('0x5'));var rimraf=require('rimraf');var config=require(_0x5047('0x6'));var attributes=require(_0x5047('0x7'));module[_0x5047('0x8')]=function(_0x356712,_0x29e9b6){return _0x356712[_0x5047('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x5047('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index f928ac3..367ce7c 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 _0x9b83=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x245801,_0x3d8556){var _0xbbe558=function(_0x112791){while(--_0x112791){_0x245801['push'](_0x245801['shift']());}};_0xbbe558(++_0x3d8556);}(_0x9b83,0x1e6));var _0x39b8=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9b83[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var moment=require('moment');var BPromise=require(_0x39b8('0x2'));var rs=require(_0x39b8('0x3'));var fs=require('fs');var Redis=require(_0x39b8('0x4'));var db=require(_0x39b8('0x5'))['db'];var utils=require(_0x39b8('0x6'));var logger=require(_0x39b8('0x7'))(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var jayson=require(_0x39b8('0xa'));var client=jayson[_0x39b8('0xb')][_0x39b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58e98c,_0x2c1d10,_0x3014f9){return new BPromise(function(_0xc7d24b,_0x579ac7){return client[_0x39b8('0xd')](_0x58e98c,_0x3014f9)['then'](function(_0x3779ec){logger[_0x39b8('0xe')](_0x39b8('0xf'),_0x2c1d10,_0x39b8('0x10'));logger[_0x39b8('0x11')](_0x39b8('0x12'),_0x2c1d10,_0x39b8('0x10'),JSON['stringify'](_0x3779ec));if(_0x3779ec[_0x39b8('0x13')]){if(_0x3779ec[_0x39b8('0x13')][_0x39b8('0x14')]===0x1f4){logger[_0x39b8('0x13')](_0x39b8('0xf'),_0x2c1d10,_0x3779ec['error'][_0x39b8('0x15')]);return _0x579ac7(_0x3779ec['error'][_0x39b8('0x15')]);}logger[_0x39b8('0x13')](_0x39b8('0xf'),_0x2c1d10,_0x3779ec[_0x39b8('0x13')][_0x39b8('0x15')]);return _0xc7d24b(_0x3779ec[_0x39b8('0x13')][_0x39b8('0x15')]);}else{logger[_0x39b8('0xe')](_0x39b8('0xf'),_0x2c1d10,_0x39b8('0x10'));_0xc7d24b(_0x3779ec[_0x39b8('0x16')][_0x39b8('0x15')]);}})['catch'](function(_0x477210){logger[_0x39b8('0x13')](_0x39b8('0xf'),_0x2c1d10,_0x477210);_0x579ac7(_0x477210);});});} \ No newline at end of file +var _0xd54b=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xce5fa9,_0x1988e1){var _0x137403=function(_0x484d90){while(--_0x484d90){_0xce5fa9['push'](_0xce5fa9['shift']());}};_0x137403(++_0x1988e1);}(_0xd54b,0x19d));var _0xbd54=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd54b[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xbd54('0x0'));var util=require(_0xbd54('0x1'));var moment=require(_0xbd54('0x2'));var BPromise=require(_0xbd54('0x3'));var rs=require(_0xbd54('0x4'));var fs=require('fs');var Redis=require(_0xbd54('0x5'));var db=require(_0xbd54('0x6'))['db'];var utils=require(_0xbd54('0x7'));var logger=require('../../config/logger')(_0xbd54('0x8'));var config=require('../../config/environment');var jayson=require(_0xbd54('0x9'));var client=jayson[_0xbd54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24be82,_0x23d72e,_0x237d44){return new BPromise(function(_0x3b920c,_0x31439d){return client[_0xbd54('0xb')](_0x24be82,_0x237d44)[_0xbd54('0xc')](function(_0x432734){logger[_0xbd54('0xd')](_0xbd54('0xe'),_0x23d72e,_0xbd54('0xf'));logger['debug'](_0xbd54('0x10'),_0x23d72e,_0xbd54('0xf'),JSON[_0xbd54('0x11')](_0x432734));if(_0x432734[_0xbd54('0x12')]){if(_0x432734['error']['code']===0x1f4){logger[_0xbd54('0x12')](_0xbd54('0xe'),_0x23d72e,_0x432734['error'][_0xbd54('0x13')]);return _0x31439d(_0x432734[_0xbd54('0x12')][_0xbd54('0x13')]);}logger[_0xbd54('0x12')](_0xbd54('0xe'),_0x23d72e,_0x432734[_0xbd54('0x12')]['message']);return _0x3b920c(_0x432734[_0xbd54('0x12')][_0xbd54('0x13')]);}else{logger[_0xbd54('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x23d72e,_0xbd54('0xf'));_0x3b920c(_0x432734[_0xbd54('0x14')][_0xbd54('0x13')]);}})[_0xbd54('0x15')](function(_0x5caad3){logger[_0xbd54('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x23d72e,_0x5caad3);_0x31439d(_0x5caad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index ba1aebd..a2fca48 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 _0xe18f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','create','delete','destroy','exports','multer'];(function(_0x3c8f7d,_0x2dda8b){var _0x32d77e=function(_0x4aafb0){while(--_0x4aafb0){_0x3c8f7d['push'](_0x3c8f7d['shift']());}};_0x32d77e(++_0x2dda8b);}(_0xe18f,0x176));var _0xfe18=function(_0x55e103,_0x1afde9){_0x55e103=_0x55e103-0x0;var _0x248786=_0xe18f[_0x55e103];return _0x248786;};'use strict';var multer=require(_0xfe18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfe18('0x1'));var express=require('express');var router=express[_0xfe18('0x2')]();var fs_extra=require(_0xfe18('0x3'));var auth=require(_0xfe18('0x4'));var interaction=require(_0xfe18('0x5'));var config=require(_0xfe18('0x6'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfe18('0x7')]);router['get'](_0xfe18('0x8'),auth[_0xfe18('0x9')](),controller[_0xfe18('0xa')]);router['post']('/',auth[_0xfe18('0x9')](),controller[_0xfe18('0xb')]);router['put']('/:id',auth[_0xfe18('0x9')](),controller['update']);router[_0xfe18('0xc')](_0xfe18('0x8'),auth[_0xfe18('0x9')](),controller[_0xfe18('0xd')]);module[_0xfe18('0xe')]=router; \ No newline at end of file +var _0xb5d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x17de3a,_0x1102ba){var _0x456315=function(_0x6ac0d1){while(--_0x6ac0d1){_0x17de3a['push'](_0x17de3a['shift']());}};_0x456315(++_0x1102ba);}(_0xb5d1,0x14a));var _0x1b5d=function(_0x335840,_0xd1b8de){_0x335840=_0x335840-0x0;var _0x5e133f=_0xb5d1[_0x335840];return _0x5e133f;};'use strict';var multer=require(_0x1b5d('0x0'));var util=require(_0x1b5d('0x1'));var path=require(_0x1b5d('0x2'));var timeout=require(_0x1b5d('0x3'));var express=require(_0x1b5d('0x4'));var router=express[_0x1b5d('0x5')]();var fs_extra=require(_0x1b5d('0x6'));var auth=require(_0x1b5d('0x7'));var interaction=require(_0x1b5d('0x8'));var config=require(_0x1b5d('0x9'));var controller=require(_0x1b5d('0xa'));router[_0x1b5d('0xb')]('/',auth[_0x1b5d('0xc')](),controller[_0x1b5d('0xd')]);router['get'](_0x1b5d('0xe'),auth[_0x1b5d('0xc')](),controller[_0x1b5d('0xf')]);router[_0x1b5d('0x10')]('/',auth['isAuthenticated'](),controller[_0x1b5d('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1b5d('0x12')]);router[_0x1b5d('0x13')](_0x1b5d('0xe'),auth['isAuthenticated'](),controller[_0x1b5d('0x14')]);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 fa4d240..94fa97f 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 _0xc525=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0xf57918,_0x5e46bc){var _0x35401a=function(_0x5813c0){while(--_0x5813c0){_0xf57918['push'](_0xf57918['shift']());}};_0x35401a(++_0x5e46bc);}(_0xc525,0x116));var _0x5c52=function(_0x9e4716,_0x41a790){_0x9e4716=_0x9e4716-0x0;var _0x53d306=_0xc525[_0x9e4716];return _0x53d306;};'use strict';var Sequelize=require(_0x5c52('0x0'));module[_0x5c52('0x1')]={'type':{'type':Sequelize[_0x5c52('0x2')](_0x5c52('0x3'),_0x5c52('0x4'),_0x5c52('0x5'),'keyValue',_0x5c52('0x6')),'defaultValue':_0x5c52('0x3')},'content':{'type':Sequelize[_0x5c52('0x7')]},'key':{'type':Sequelize[_0x5c52('0x7')]},'keyType':{'type':Sequelize[_0x5c52('0x2')]('string',_0x5c52('0x4'),_0x5c52('0x5'))},'keyContent':{'type':Sequelize[_0x5c52('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5c52('0x7')]},'customField':{'type':Sequelize[_0x5c52('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c52('0x7')]}}; \ No newline at end of file +var _0x365a=['STRING','customVariable','ENUM','string','keyValue','picklist'];(function(_0x22e5e2,_0x71f805){var _0x153885=function(_0x41fb3b){while(--_0x41fb3b){_0x22e5e2['push'](_0x22e5e2['shift']());}};_0x153885(++_0x71f805);}(_0x365a,0xb6));var _0xa365=function(_0x24fc6a,_0x2cbf56){_0x24fc6a=_0x24fc6a-0x0;var _0x166299=_0x365a[_0x24fc6a];return _0x166299;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa365('0x0')](_0xa365('0x1'),'variable','customVariable',_0xa365('0x2'),_0xa365('0x3')),'defaultValue':_0xa365('0x1')},'content':{'type':Sequelize[_0xa365('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa365('0x0')]('string','variable',_0xa365('0x5'))},'keyContent':{'type':Sequelize[_0xa365('0x4')]},'idField':{'type':Sequelize[_0xa365('0x4')]},'nameField':{'type':Sequelize[_0xa365('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa365('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 0ea9f0a..a343375 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 _0x188a=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','keys','length','includeAll','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x3c904b,_0x2923b9){var _0x5d6a4e=function(_0x246a62){while(--_0x246a62){_0x3c904b['push'](_0x3c904b['shift']());}};_0x5d6a4e(++_0x2923b9);}(_0x188a,0x178));var _0xa188=function(_0x3b6b24,_0xc17156){_0x3b6b24=_0x3b6b24-0x0;var _0x477940=_0x188a[_0x3b6b24];return _0x477940;};'use strict';var emlformat=require(_0xa188('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa188('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa188('0x2'));var moment=require(_0xa188('0x3'));var BPromise=require(_0xa188('0x4'));var Mustache=require('mustache');var util=require(_0xa188('0x5'));var path=require(_0xa188('0x6'));var sox=require(_0xa188('0x7'));var csv=require(_0xa188('0x8'));var ejs=require(_0xa188('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa188('0xa'));var squel=require(_0xa188('0xb'));var crypto=require(_0xa188('0xc'));var jsforce=require(_0xa188('0xd'));var deskjs=require(_0xa188('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa188('0xf'));var Papa=require(_0xa188('0x10'));var Redis=require(_0xa188('0x11'));var authService=require(_0xa188('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa188('0x13'));var hardwareService=require(_0xa188('0x14'));var logger=require(_0xa188('0x15'))(_0xa188('0x16'));var utils=require(_0xa188('0x17'));var config=require(_0xa188('0x18'));var licenseUtil=require(_0xa188('0x19'));var db=require(_0xa188('0x1a'))['db'];function respondWithStatusCode(_0x5bf8d8,_0x3c0163){_0x3c0163=_0x3c0163||0xcc;return function(_0x5d22f3){if(_0x5d22f3){return _0x5bf8d8[_0xa188('0x1b')](_0x3c0163);}return _0x5bf8d8['status'](_0x3c0163)['end']();};}function respondWithResult(_0x36d7ae,_0x2c1dc9){_0x2c1dc9=_0x2c1dc9||0xc8;return function(_0xec2f06){if(_0xec2f06){return _0x36d7ae[_0xa188('0x1c')](_0x2c1dc9)[_0xa188('0x1d')](_0xec2f06);}};}function respondWithFilteredResult(_0x1d6616,_0x42125e){return function(_0x16efcc){if(_0x16efcc){var _0x42d741=typeof _0x42125e['offset']===_0xa188('0x1e')&&typeof _0x42125e[_0xa188('0x1f')]===_0xa188('0x1e');var _0x3068ac=_0x16efcc[_0xa188('0x20')];var _0x572ece=_0x42d741?0x0:_0x42125e[_0xa188('0x21')];var _0x13e32e=_0x42d741?_0x16efcc[_0xa188('0x20')]:_0x42125e[_0xa188('0x21')]+_0x42125e['limit'];var _0x1b9d07;if(_0x13e32e>=_0x3068ac){_0x13e32e=_0x3068ac;_0x1b9d07=0xc8;}else{_0x1b9d07=0xce;}_0x1d6616[_0xa188('0x1c')](_0x1b9d07);return _0x1d6616[_0xa188('0x22')](_0xa188('0x23'),_0x572ece+'-'+_0x13e32e+'/'+_0x3068ac)[_0xa188('0x1d')](_0x16efcc);}return null;};}function patchUpdates(_0x540c71){return function(_0x1f5b06){try{jsonpatch['apply'](_0x1f5b06,_0x540c71,!![]);}catch(_0x1f5cba){return BPromise['reject'](_0x1f5cba);}return _0x1f5b06[_0xa188('0x24')]();};}function saveUpdates(_0xcf8a1,_0x3bcddc){return function(_0x54bb35){if(_0x54bb35){return _0x54bb35[_0xa188('0x25')](_0xcf8a1)[_0xa188('0x26')](function(_0x3e8d5d){return _0x3e8d5d;});}return null;};}function removeEntity(_0x4a0260,_0xc4563c){return function(_0x3662f6){if(_0x3662f6){return _0x3662f6[_0xa188('0x27')]()[_0xa188('0x26')](function(){_0x4a0260[_0xa188('0x1c')](0xcc)[_0xa188('0x28')]();});}};}function handleEntityNotFound(_0x144695,_0x283514){return function(_0x3c7034){if(!_0x3c7034){_0x144695[_0xa188('0x1b')](0x194);}return _0x3c7034;};}function handleError(_0x224699,_0x41f36e){_0x41f36e=_0x41f36e||0x1f4;return function(_0x410ee5){logger[_0xa188('0x29')](_0x410ee5[_0xa188('0x2a')]);if(_0x410ee5[_0xa188('0x2b')]){delete _0x410ee5[_0xa188('0x2b')];}_0x224699[_0xa188('0x1c')](_0x41f36e)[_0xa188('0x2c')](_0x410ee5);};}exports['index']=function(_0x40702e,_0x4c96c2){var _0x515516={},_0x177565={},_0x4dc31d={'count':0x0,'rows':[]};var _0x17af37=_['map'](db[_0xa188('0x2d')][_0xa188('0x2e')],function(_0xcedfa4){return{'name':_0xcedfa4[_0xa188('0x2f')],'type':_0xcedfa4[_0xa188('0x30')][_0xa188('0x31')]};});_0x177565[_0xa188('0x32')]=_[_0xa188('0x33')](_0x17af37,_0xa188('0x2b'));_0x177565[_0xa188('0x34')]=_['keys'](_0x40702e[_0xa188('0x34')]);_0x177565[_0xa188('0x35')]=_['intersection'](_0x177565[_0xa188('0x32')],_0x177565[_0xa188('0x34')]);_0x515516[_0xa188('0x36')]=_[_0xa188('0x37')](_0x177565[_0xa188('0x32')],qs[_0xa188('0x38')](_0x40702e[_0xa188('0x34')][_0xa188('0x38')]));_0x515516['attributes']=_0x515516['attributes']['length']?_0x515516[_0xa188('0x36')]:_0x177565[_0xa188('0x32')];if(!_0x40702e[_0xa188('0x34')]['hasOwnProperty'](_0xa188('0x39'))){_0x515516[_0xa188('0x1f')]=qs[_0xa188('0x1f')](_0x40702e['query'][_0xa188('0x1f')]);_0x515516[_0xa188('0x21')]=qs[_0xa188('0x21')](_0x40702e[_0xa188('0x34')]['offset']);}_0x515516[_0xa188('0x3a')]=qs['sort'](_0x40702e['query'][_0xa188('0x3b')]);_0x515516[_0xa188('0x3c')]=qs[_0xa188('0x35')](_[_0xa188('0x3d')](_0x40702e['query'],_0x177565[_0xa188('0x35')]),_0x17af37);if(_0x40702e[_0xa188('0x34')][_0xa188('0x3e')]){_0x515516[_0xa188('0x3c')]=_['merge'](_0x515516[_0xa188('0x3c')],{'$or':_[_0xa188('0x33')](_0x17af37,function(_0x2e405b){if(_0x2e405b[_0xa188('0x30')]!==_0xa188('0x3f')){var _0x315098={};_0x315098[_0x2e405b[_0xa188('0x2b')]]={'$like':'%'+_0x40702e[_0xa188('0x34')][_0xa188('0x3e')]+'%'};return _0x315098;}})});}_0x515516=_[_0xa188('0x40')]({},_0x515516,_0x40702e['options']);var _0x563ace={'where':_0x515516['where']};return db[_0xa188('0x2d')][_0xa188('0x20')](_0x563ace)[_0xa188('0x26')](function(_0x920225){_0x4dc31d[_0xa188('0x20')]=_0x920225;if(_0x40702e[_0xa188('0x34')]['includeAll']){_0x515516['include']=[{'all':!![]}];}return db[_0xa188('0x2d')][_0xa188('0x41')](_0x515516);})[_0xa188('0x26')](function(_0x7da14a){_0x4dc31d[_0xa188('0x42')]=_0x7da14a;return _0x4dc31d;})[_0xa188('0x26')](respondWithFilteredResult(_0x4c96c2,_0x515516))[_0xa188('0x43')](handleError(_0x4c96c2,null));};exports[_0xa188('0x44')]=function(_0x24e50f,_0x4852bc){var _0x133e3f={'raw':!![],'where':{'id':_0x24e50f['params']['id']}},_0x311553={};_0x311553[_0xa188('0x32')]=_[_0xa188('0x45')](db[_0xa188('0x2d')][_0xa188('0x2e')]);_0x311553['query']=_[_0xa188('0x45')](_0x24e50f[_0xa188('0x34')]);_0x311553[_0xa188('0x35')]=_['intersection'](_0x311553[_0xa188('0x32')],_0x311553[_0xa188('0x34')]);_0x133e3f[_0xa188('0x36')]=_['intersection'](_0x311553[_0xa188('0x32')],qs[_0xa188('0x38')](_0x24e50f[_0xa188('0x34')][_0xa188('0x38')]));_0x133e3f[_0xa188('0x36')]=_0x133e3f['attributes'][_0xa188('0x46')]?_0x133e3f['attributes']:_0x311553[_0xa188('0x32')];if(_0x24e50f['query'][_0xa188('0x47')]){_0x133e3f['include']=[{'all':!![]}];}_0x133e3f=_[_0xa188('0x40')]({},_0x133e3f,_0x24e50f[_0xa188('0x48')]);return db[_0xa188('0x2d')][_0xa188('0x49')](_0x133e3f)[_0xa188('0x26')](handleEntityNotFound(_0x4852bc,null))['then'](respondWithResult(_0x4852bc,null))[_0xa188('0x43')](handleError(_0x4852bc,null));};exports[_0xa188('0x4a')]=function(_0x38c4ff,_0x54cad2){return db[_0xa188('0x2d')][_0xa188('0x4a')](_0x38c4ff[_0xa188('0x4b')],{})['then'](respondWithResult(_0x54cad2,0xc9))['catch'](handleError(_0x54cad2,null));};exports[_0xa188('0x25')]=function(_0x2b6807,_0x4baeae){if(_0x2b6807[_0xa188('0x4b')]['id']){delete _0x2b6807[_0xa188('0x4b')]['id'];}return db[_0xa188('0x2d')][_0xa188('0x49')]({'where':{'id':_0x2b6807[_0xa188('0x4c')]['id']}})[_0xa188('0x26')](handleEntityNotFound(_0x4baeae,null))[_0xa188('0x26')](saveUpdates(_0x2b6807[_0xa188('0x4b')],null))[_0xa188('0x26')](respondWithResult(_0x4baeae,null))[_0xa188('0x43')](handleError(_0x4baeae,null));};exports[_0xa188('0x27')]=function(_0x40b8cf,_0x4ca13a){return db[_0xa188('0x2d')][_0xa188('0x49')]({'where':{'id':_0x40b8cf['params']['id']}})[_0xa188('0x26')](handleEntityNotFound(_0x4ca13a,null))[_0xa188('0x26')](removeEntity(_0x4ca13a,null))[_0xa188('0x43')](handleError(_0x4ca13a,null));}; \ No newline at end of file +var _0xff0f=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','SugarcrmField','count','includeAll','include','findAll','catch','params','model','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','status','end','sendStatus','error','name','rawAttributes','fieldName','key','map'];(function(_0x936f18,_0x110725){var _0x36b3b7=function(_0x5cd86b){while(--_0x5cd86b){_0x936f18['push'](_0x936f18['shift']());}};_0x36b3b7(++_0x110725);}(_0xff0f,0xfa));var _0xfff0=function(_0x3ab179,_0x3207a4){_0x3ab179=_0x3ab179-0x0;var _0x5e61c8=_0xff0f[_0x3ab179];return _0x5e61c8;};'use strict';var emlformat=require(_0xfff0('0x0'));var rimraf=require(_0xfff0('0x1'));var zipdir=require(_0xfff0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfff0('0x3'));var moment=require(_0xfff0('0x4'));var BPromise=require(_0xfff0('0x5'));var Mustache=require(_0xfff0('0x6'));var util=require(_0xfff0('0x7'));var path=require(_0xfff0('0x8'));var sox=require(_0xfff0('0x9'));var csv=require(_0xfff0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfff0('0xb'));var squel=require(_0xfff0('0xc'));var crypto=require(_0xfff0('0xd'));var jsforce=require(_0xfff0('0xe'));var deskjs=require(_0xfff0('0xf'));var toCsv=require(_0xfff0('0xa'));var querystring=require(_0xfff0('0x10'));var Papa=require('papaparse');var Redis=require(_0xfff0('0x11'));var authService=require(_0xfff0('0x12'));var qs=require(_0xfff0('0x13'));var as=require(_0xfff0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfff0('0x15'));var utils=require(_0xfff0('0x16'));var config=require(_0xfff0('0x17'));var licenseUtil=require(_0xfff0('0x18'));var db=require(_0xfff0('0x19'))['db'];function respondWithStatusCode(_0xe18a0,_0x1b073e){_0x1b073e=_0x1b073e||0xcc;return function(_0x3dd23e){if(_0x3dd23e){return _0xe18a0['sendStatus'](_0x1b073e);}return _0xe18a0['status'](_0x1b073e)['end']();};}function respondWithResult(_0xbc671d,_0x225834){_0x225834=_0x225834||0xc8;return function(_0x53cff2){if(_0x53cff2){return _0xbc671d['status'](_0x225834)[_0xfff0('0x1a')](_0x53cff2);}};}function respondWithFilteredResult(_0x3c0955,_0x48e1ac){return function(_0x276014){if(_0x276014){var _0x53a0ac=typeof _0x48e1ac[_0xfff0('0x1b')]===_0xfff0('0x1c')&&typeof _0x48e1ac[_0xfff0('0x1d')]===_0xfff0('0x1c');var _0x4f1bc8=_0x276014['count'];var _0x54c817=_0x53a0ac?0x0:_0x48e1ac[_0xfff0('0x1b')];var _0x4ec89b=_0x53a0ac?_0x276014['count']:_0x48e1ac[_0xfff0('0x1b')]+_0x48e1ac[_0xfff0('0x1d')];var _0x3b8b47;if(_0x4ec89b>=_0x4f1bc8){_0x4ec89b=_0x4f1bc8;_0x3b8b47=0xc8;}else{_0x3b8b47=0xce;}_0x3c0955['status'](_0x3b8b47);return _0x3c0955['set'](_0xfff0('0x1e'),_0x54c817+'-'+_0x4ec89b+'/'+_0x4f1bc8)[_0xfff0('0x1a')](_0x276014);}return null;};}function patchUpdates(_0x1f291f){return function(_0x8cb825){try{jsonpatch[_0xfff0('0x1f')](_0x8cb825,_0x1f291f,!![]);}catch(_0x422f69){return BPromise[_0xfff0('0x20')](_0x422f69);}return _0x8cb825[_0xfff0('0x21')]();};}function saveUpdates(_0x1bd1a3,_0x283df2){return function(_0x2e8ea8){if(_0x2e8ea8){return _0x2e8ea8[_0xfff0('0x22')](_0x1bd1a3)[_0xfff0('0x23')](function(_0x31973a){return _0x31973a;});}return null;};}function removeEntity(_0x4c1ebb,_0x38eeab){return function(_0x3fc8a0){if(_0x3fc8a0){return _0x3fc8a0[_0xfff0('0x24')]()['then'](function(){_0x4c1ebb[_0xfff0('0x25')](0xcc)[_0xfff0('0x26')]();});}};}function handleEntityNotFound(_0x9e7573,_0x514142){return function(_0x3d554f){if(!_0x3d554f){_0x9e7573[_0xfff0('0x27')](0x194);}return _0x3d554f;};}function handleError(_0x15578e,_0x12c890){_0x12c890=_0x12c890||0x1f4;return function(_0x411ce4){logger[_0xfff0('0x28')](_0x411ce4['stack']);if(_0x411ce4['name']){delete _0x411ce4[_0xfff0('0x29')];}_0x15578e[_0xfff0('0x25')](_0x12c890)['send'](_0x411ce4);};}exports['index']=function(_0x44ffd6,_0xc24fab){var _0xd9299a={},_0x34cc90={},_0x1bbefa={'count':0x0,'rows':[]};var _0x1fe416=_['map'](db['SugarcrmField'][_0xfff0('0x2a')],function(_0x54e9f7){return{'name':_0x54e9f7[_0xfff0('0x2b')],'type':_0x54e9f7['type'][_0xfff0('0x2c')]};});_0x34cc90['model']=_[_0xfff0('0x2d')](_0x1fe416,'name');_0x34cc90[_0xfff0('0x2e')]=_[_0xfff0('0x2f')](_0x44ffd6[_0xfff0('0x2e')]);_0x34cc90[_0xfff0('0x30')]=_[_0xfff0('0x31')](_0x34cc90['model'],_0x34cc90['query']);_0xd9299a[_0xfff0('0x32')]=_[_0xfff0('0x31')](_0x34cc90['model'],qs[_0xfff0('0x33')](_0x44ffd6[_0xfff0('0x2e')][_0xfff0('0x33')]));_0xd9299a[_0xfff0('0x32')]=_0xd9299a[_0xfff0('0x32')][_0xfff0('0x34')]?_0xd9299a[_0xfff0('0x32')]:_0x34cc90['model'];if(!_0x44ffd6[_0xfff0('0x2e')][_0xfff0('0x35')](_0xfff0('0x36'))){_0xd9299a[_0xfff0('0x1d')]=qs['limit'](_0x44ffd6[_0xfff0('0x2e')]['limit']);_0xd9299a[_0xfff0('0x1b')]=qs['offset'](_0x44ffd6['query'][_0xfff0('0x1b')]);}_0xd9299a[_0xfff0('0x37')]=qs[_0xfff0('0x38')](_0x44ffd6[_0xfff0('0x2e')][_0xfff0('0x38')]);_0xd9299a[_0xfff0('0x39')]=qs[_0xfff0('0x30')](_['pick'](_0x44ffd6['query'],_0x34cc90[_0xfff0('0x30')]),_0x1fe416);if(_0x44ffd6[_0xfff0('0x2e')]['filter']){_0xd9299a[_0xfff0('0x39')]=_['merge'](_0xd9299a['where'],{'$or':_[_0xfff0('0x2d')](_0x1fe416,function(_0x196bee){if(_0x196bee[_0xfff0('0x3a')]!==_0xfff0('0x3b')){var _0x31578e={};_0x31578e[_0x196bee[_0xfff0('0x29')]]={'$like':'%'+_0x44ffd6[_0xfff0('0x2e')][_0xfff0('0x3c')]+'%'};return _0x31578e;}})});}_0xd9299a=_[_0xfff0('0x3d')]({},_0xd9299a,_0x44ffd6[_0xfff0('0x3e')]);var _0x2ae6b0={'where':_0xd9299a[_0xfff0('0x39')]};return db[_0xfff0('0x3f')]['count'](_0x2ae6b0)[_0xfff0('0x23')](function(_0xf66464){_0x1bbefa[_0xfff0('0x40')]=_0xf66464;if(_0x44ffd6[_0xfff0('0x2e')][_0xfff0('0x41')]){_0xd9299a[_0xfff0('0x42')]=[{'all':!![]}];}return db[_0xfff0('0x3f')][_0xfff0('0x43')](_0xd9299a);})[_0xfff0('0x23')](function(_0x43ac11){_0x1bbefa['rows']=_0x43ac11;return _0x1bbefa;})['then'](respondWithFilteredResult(_0xc24fab,_0xd9299a))[_0xfff0('0x44')](handleError(_0xc24fab,null));};exports['show']=function(_0x568288,_0x5aac1f){var _0x270f74={'raw':!![],'where':{'id':_0x568288[_0xfff0('0x45')]['id']}},_0x45b149={};_0x45b149[_0xfff0('0x46')]=_[_0xfff0('0x2f')](db['SugarcrmField']['rawAttributes']);_0x45b149['query']=_[_0xfff0('0x2f')](_0x568288[_0xfff0('0x2e')]);_0x45b149[_0xfff0('0x30')]=_[_0xfff0('0x31')](_0x45b149[_0xfff0('0x46')],_0x45b149[_0xfff0('0x2e')]);_0x270f74[_0xfff0('0x32')]=_[_0xfff0('0x31')](_0x45b149[_0xfff0('0x46')],qs[_0xfff0('0x33')](_0x568288[_0xfff0('0x2e')][_0xfff0('0x33')]));_0x270f74[_0xfff0('0x32')]=_0x270f74['attributes'][_0xfff0('0x34')]?_0x270f74[_0xfff0('0x32')]:_0x45b149[_0xfff0('0x46')];if(_0x568288[_0xfff0('0x2e')][_0xfff0('0x41')]){_0x270f74[_0xfff0('0x42')]=[{'all':!![]}];}_0x270f74=_[_0xfff0('0x3d')]({},_0x270f74,_0x568288[_0xfff0('0x3e')]);return db['SugarcrmField'][_0xfff0('0x47')](_0x270f74)[_0xfff0('0x23')](handleEntityNotFound(_0x5aac1f,null))[_0xfff0('0x23')](respondWithResult(_0x5aac1f,null))[_0xfff0('0x44')](handleError(_0x5aac1f,null));};exports[_0xfff0('0x48')]=function(_0x43aba2,_0x1b8a94){return db['SugarcrmField'][_0xfff0('0x48')](_0x43aba2[_0xfff0('0x49')],{})[_0xfff0('0x23')](respondWithResult(_0x1b8a94,0xc9))['catch'](handleError(_0x1b8a94,null));};exports[_0xfff0('0x22')]=function(_0x4a56a7,_0x23c694){if(_0x4a56a7['body']['id']){delete _0x4a56a7[_0xfff0('0x49')]['id'];}return db[_0xfff0('0x3f')][_0xfff0('0x47')]({'where':{'id':_0x4a56a7[_0xfff0('0x45')]['id']}})[_0xfff0('0x23')](handleEntityNotFound(_0x23c694,null))[_0xfff0('0x23')](saveUpdates(_0x4a56a7[_0xfff0('0x49')],null))[_0xfff0('0x23')](respondWithResult(_0x23c694,null))[_0xfff0('0x44')](handleError(_0x23c694,null));};exports[_0xfff0('0x24')]=function(_0x143a2b,_0xf1911d){return db['SugarcrmField'][_0xfff0('0x47')]({'where':{'id':_0x143a2b['params']['id']}})['then'](handleEntityNotFound(_0xf1911d,null))['then'](removeEntity(_0xf1911d,null))[_0xfff0('0x44')](handleError(_0xf1911d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 91faa3f..0aff2c2 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 _0x85dd=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x85dd,0x9b));var _0xd85d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x85dd[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xd85d('0x0'));var util=require(_0xd85d('0x1'));var logger=require(_0xd85d('0x2'))(_0xd85d('0x3'));var moment=require('moment');var BPromise=require(_0xd85d('0x4'));var rp=require(_0xd85d('0x5'));var fs=require('fs');var path=require(_0xd85d('0x6'));var rimraf=require(_0xd85d('0x7'));var config=require(_0xd85d('0x8'));var attributes=require(_0xd85d('0x9'));module[_0xd85d('0xa')]=function(_0x327db8,_0x396549){return _0x327db8[_0xd85d('0xb')](_0xd85d('0xc'),attributes,{'tableName':_0xd85d('0xd'),'paranoid':![],'indexes':[{'name':_0xd85d('0xe'),'fields':[_0xd85d('0xf'),_0xd85d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9cc=['exports','SugarcrmField','sugarcrm_unique_index','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x41afaa,_0x290e0d){var _0x2b57c6=function(_0x467c9b){while(--_0x467c9b){_0x41afaa['push'](_0x41afaa['shift']());}};_0x2b57c6(++_0x290e0d);}(_0xf9cc,0xa8));var _0xcf9c=function(_0x51486a,_0x250856){_0x51486a=_0x51486a-0x0;var _0x7756d9=_0xf9cc[_0x51486a];return _0x7756d9;};'use strict';var _=require(_0xcf9c('0x0'));var util=require('util');var logger=require(_0xcf9c('0x1'))(_0xcf9c('0x2'));var moment=require(_0xcf9c('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf9c('0x4'));var fs=require('fs');var path=require(_0xcf9c('0x5'));var rimraf=require(_0xcf9c('0x6'));var config=require(_0xcf9c('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0xcf9c('0x8')]=function(_0x2a3e3a,_0x376b28){return _0x2a3e3a['define'](_0xcf9c('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xcf9c('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 9243944..42e89b0 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 _0x752e=['request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x167a3f,_0x3c707c){var _0x35802e=function(_0xc8435a){while(--_0xc8435a){_0x167a3f['push'](_0x167a3f['shift']());}};_0x35802e(++_0x3c707c);}(_0x752e,0xcc));var _0xe752=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x752e[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xe752('0x0'));var util=require(_0xe752('0x1'));var moment=require(_0xe752('0x2'));var BPromise=require(_0xe752('0x3'));var rs=require(_0xe752('0x4'));var fs=require('fs');var Redis=require(_0xe752('0x5'));var db=require(_0xe752('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe752('0x7'))(_0xe752('0x8'));var config=require(_0xe752('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe752('0xa')][_0xe752('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272cdb,_0x5acef6,_0x31edd4){return new BPromise(function(_0x56a9f3,_0x32fced){return client[_0xe752('0xc')](_0x272cdb,_0x31edd4)[_0xe752('0xd')](function(_0x2ec341){logger[_0xe752('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5acef6,_0xe752('0xf'));logger[_0xe752('0x10')](_0xe752('0x11'),_0x5acef6,_0xe752('0xf'),JSON['stringify'](_0x2ec341));if(_0x2ec341['error']){if(_0x2ec341[_0xe752('0x12')][_0xe752('0x13')]===0x1f4){logger[_0xe752('0x12')](_0xe752('0x14'),_0x5acef6,_0x2ec341['error']['message']);return _0x32fced(_0x2ec341[_0xe752('0x12')][_0xe752('0x15')]);}logger[_0xe752('0x12')](_0xe752('0x14'),_0x5acef6,_0x2ec341[_0xe752('0x12')][_0xe752('0x15')]);return _0x56a9f3(_0x2ec341['error']['message']);}else{logger['info'](_0xe752('0x14'),_0x5acef6,_0xe752('0xf'));_0x56a9f3(_0x2ec341[_0xe752('0x16')][_0xe752('0x15')]);}})[_0xe752('0x17')](function(_0x57393c){logger[_0xe752('0x12')](_0xe752('0x14'),_0x5acef6,_0x57393c);_0x32fced(_0x57393c);});});} \ No newline at end of file +var _0x7202=['error','code','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2ecb85,_0x4e24e0){var _0x37b245=function(_0x4211af){while(--_0x4211af){_0x2ecb85['push'](_0x2ecb85['shift']());}};_0x37b245(++_0x4e24e0);}(_0x7202,0x180));var _0x2720=function(_0x38b8c,_0x4a0c9f){_0x38b8c=_0x38b8c-0x0;var _0x41f904=_0x7202[_0x38b8c];return _0x41f904;};'use strict';var _=require('lodash');var util=require(_0x2720('0x0'));var moment=require(_0x2720('0x1'));var BPromise=require(_0x2720('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2720('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2720('0x4'));var logger=require(_0x2720('0x5'))('rpc');var config=require(_0x2720('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2720('0x7')][_0x2720('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe2537,_0x1d8680,_0xa9506a){return new BPromise(function(_0xa181f2,_0x4026ad){return client['request'](_0xe2537,_0xa9506a)[_0x2720('0x9')](function(_0x543cd1){logger[_0x2720('0xa')](_0x2720('0xb'),_0x1d8680,'request\x20sent');logger[_0x2720('0xc')](_0x2720('0xd'),_0x1d8680,_0x2720('0xe'),JSON['stringify'](_0x543cd1));if(_0x543cd1['error']){if(_0x543cd1[_0x2720('0xf')][_0x2720('0x10')]===0x1f4){logger['error'](_0x2720('0xb'),_0x1d8680,_0x543cd1['error']['message']);return _0x4026ad(_0x543cd1[_0x2720('0xf')][_0x2720('0x11')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1d8680,_0x543cd1[_0x2720('0xf')][_0x2720('0x11')]);return _0xa181f2(_0x543cd1[_0x2720('0xf')][_0x2720('0x11')]);}else{logger[_0x2720('0xa')](_0x2720('0xb'),_0x1d8680,_0x2720('0xe'));_0xa181f2(_0x543cd1[_0x2720('0x12')][_0x2720('0x11')]);}})['catch'](function(_0x50f9ce){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1d8680,_0x50f9ce);_0x4026ad(_0x50f9ce);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 50766c6..f6444bc 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 _0xd5d3=['show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x41a025,_0x10712a){var _0x2a5245=function(_0x21a7ee){while(--_0x21a7ee){_0x41a025['push'](_0x41a025['shift']());}};_0x2a5245(++_0x10712a);}(_0xd5d3,0x113));var _0x3d5d=function(_0x566dc7,_0x4a887b){_0x566dc7=_0x566dc7-0x0;var _0x53d62b=_0xd5d3[_0x566dc7];return _0x53d62b;};'use strict';var multer=require(_0x3d5d('0x0'));var util=require(_0x3d5d('0x1'));var path=require(_0x3d5d('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d5d('0x3'));var router=express[_0x3d5d('0x4')]();var fs_extra=require(_0x3d5d('0x5'));var auth=require(_0x3d5d('0x6'));var interaction=require(_0x3d5d('0x7'));var config=require(_0x3d5d('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x3d5d('0x9')]('/',auth[_0x3d5d('0xa')](),controller[_0x3d5d('0xb')]);router[_0x3d5d('0x9')](_0x3d5d('0xc'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0xd')]);router[_0x3d5d('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3d5d('0xe')]);router[_0x3d5d('0x9')](_0x3d5d('0xf'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x10')]);router[_0x3d5d('0x11')]('/',auth['isAuthenticated'](),controller[_0x3d5d('0x12')]);router[_0x3d5d('0x11')](_0x3d5d('0x13'),auth['isAuthenticated'](),controller[_0x3d5d('0x14')]);router[_0x3d5d('0x15')](_0x3d5d('0xc'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x16')]);router['delete'](_0x3d5d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d5d('0x17')]=router; \ No newline at end of file +var _0x2f42=['post','put','update','destroy','multer','util','path','express','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create'];(function(_0x43f2aa,_0x48a4e5){var _0x262eb4=function(_0x1484b7){while(--_0x1484b7){_0x43f2aa['push'](_0x43f2aa['shift']());}};_0x262eb4(++_0x48a4e5);}(_0x2f42,0x90));var _0x22f4=function(_0x3b770f,_0x1cd2b4){_0x3b770f=_0x3b770f-0x0;var _0x37b33d=_0x2f42[_0x3b770f];return _0x37b33d;};'use strict';var multer=require(_0x22f4('0x0'));var util=require(_0x22f4('0x1'));var path=require(_0x22f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x22f4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x22f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x22f4('0x5'));var controller=require(_0x22f4('0x6'));router[_0x22f4('0x7')]('/',auth[_0x22f4('0x8')](),controller[_0x22f4('0x9')]);router[_0x22f4('0x7')](_0x22f4('0xa'),auth[_0x22f4('0x8')](),controller[_0x22f4('0xb')]);router['get'](_0x22f4('0xc'),auth[_0x22f4('0x8')](),controller[_0x22f4('0xd')]);router[_0x22f4('0x7')](_0x22f4('0xe'),auth[_0x22f4('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x22f4('0xf')]);router[_0x22f4('0x10')](_0x22f4('0xc'),auth[_0x22f4('0x8')](),controller['addConfiguration']);router[_0x22f4('0x11')](_0x22f4('0xa'),auth[_0x22f4('0x8')](),controller[_0x22f4('0x12')]);router['delete'](_0x22f4('0xa'),auth[_0x22f4('0x8')](),controller[_0x22f4('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index cd7fd6a..c6d5b47 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 _0x5e1f=['exports','STRING','HelpDesk'];(function(_0x199249,_0x3cd1b1){var _0x51119d=function(_0x5dc96e){while(--_0x5dc96e){_0x199249['push'](_0x199249['shift']());}};_0x51119d(++_0x3cd1b1);}(_0x5e1f,0x18f));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf5e1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf5e1('0x1')]},'username':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![],'defaultValue':_0xf5e1('0x2')},'remoteUri':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf5e1('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8e34=['sequelize','exports','STRING','HelpDesk'];(function(_0x252bac,_0x4cdbfe){var _0x2b43d4=function(_0x2e38e3){while(--_0x2e38e3){_0x252bac['push'](_0x252bac['shift']());}};_0x2b43d4(++_0x4cdbfe);}(_0x8e34,0x1cc));var _0x48e3=function(_0x44976c,_0x5132c4){_0x44976c=_0x44976c-0x0;var _0x332682=_0x8e34[_0x44976c];return _0x332682;};'use strict';var Sequelize=require(_0x48e3('0x0'));module[_0x48e3('0x1')]={'name':{'type':Sequelize[_0x48e3('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x48e3('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x48e3('0x2')],'allowNull':![],'defaultValue':_0x48e3('0x3')},'remoteUri':{'type':Sequelize[_0x48e3('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x48e3('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index e0470ca..652d345 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 _0x466b=['api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','getConfigurations','VtigerConfiguration','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','username','description','serverUrl','accessKey','remoteUri','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','reference','remove','editable','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x56e904,_0x4b72e0){var _0x484505=function(_0x5e95af){while(--_0x5e95af){_0x56e904['push'](_0x56e904['shift']());}};_0x484505(++_0x4b72e0);}(_0x466b,0xe6));var _0xb466=function(_0x267b9e,_0x5249b3){_0x267b9e=_0x267b9e-0x0;var _0x2b3f61=_0x466b[_0x267b9e];return _0x2b3f61;};'use strict';var emlformat=require(_0xb466('0x0'));var rimraf=require(_0xb466('0x1'));var zipdir=require(_0xb466('0x2'));var jsonpatch=require(_0xb466('0x3'));var rp=require(_0xb466('0x4'));var moment=require(_0xb466('0x5'));var BPromise=require(_0xb466('0x6'));var Mustache=require(_0xb466('0x7'));var util=require(_0xb466('0x8'));var path=require(_0xb466('0x9'));var sox=require(_0xb466('0xa'));var csv=require(_0xb466('0xb'));var ejs=require(_0xb466('0xc'));var fs=require('fs');var fs_extra=require(_0xb466('0xd'));var _=require(_0xb466('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb466('0xf'));var toCsv=require(_0xb466('0xb'));var querystring=require(_0xb466('0x10'));var Papa=require(_0xb466('0x11'));var Redis=require('ioredis');var authService=require(_0xb466('0x12'));var qs=require(_0xb466('0x13'));var as=require(_0xb466('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb466('0x15'))(_0xb466('0x16'));var utils=require(_0xb466('0x17'));var config=require(_0xb466('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb466('0x19'))['db'];var integrations=require(_0xb466('0x1a'));function respondWithStatusCode(_0x1651a5,_0x192e67){_0x192e67=_0x192e67||0xcc;return function(_0x1ef31c){if(_0x1ef31c){return _0x1651a5[_0xb466('0x1b')](_0x192e67);}return _0x1651a5[_0xb466('0x1c')](_0x192e67)[_0xb466('0x1d')]();};}function respondWithResult(_0x4ca733,_0x5c7072){_0x5c7072=_0x5c7072||0xc8;return function(_0x2e307f){if(_0x2e307f){return _0x4ca733['status'](_0x5c7072)[_0xb466('0x1e')](_0x2e307f);}};}function respondWithFilteredResult(_0x463658,_0x5eed74){return function(_0x2108b0){if(_0x2108b0){var _0x2adf16=typeof _0x5eed74['offset']==='undefined'&&typeof _0x5eed74['limit']===_0xb466('0x1f');var _0x3cc43f=_0x2108b0[_0xb466('0x20')];var _0x4cbf89=_0x2adf16?0x0:_0x5eed74[_0xb466('0x21')];var _0x5abcbc=_0x2adf16?_0x2108b0[_0xb466('0x20')]:_0x5eed74[_0xb466('0x21')]+_0x5eed74[_0xb466('0x22')];var _0x128d32;if(_0x5abcbc>=_0x3cc43f){_0x5abcbc=_0x3cc43f;_0x128d32=0xc8;}else{_0x128d32=0xce;}_0x463658['status'](_0x128d32);return _0x463658[_0xb466('0x23')](_0xb466('0x24'),_0x4cbf89+'-'+_0x5abcbc+'/'+_0x3cc43f)[_0xb466('0x1e')](_0x2108b0);}return null;};}function patchUpdates(_0x54e219){return function(_0x47f31a){try{jsonpatch[_0xb466('0x25')](_0x47f31a,_0x54e219,!![]);}catch(_0x4917c3){return BPromise[_0xb466('0x26')](_0x4917c3);}return _0x47f31a[_0xb466('0x27')]();};}function saveUpdates(_0x135fcd,_0x225de3){return function(_0x4a1292){if(_0x4a1292){return _0x4a1292[_0xb466('0x28')](_0x135fcd)['then'](function(_0x7282d0){return _0x7282d0;});}return null;};}function removeEntity(_0x2a9b1d,_0x5a1aa8){return function(_0x76dc05){if(_0x76dc05){return _0x76dc05[_0xb466('0x29')]()[_0xb466('0x2a')](function(){_0x2a9b1d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x587f91,_0x2e9fab){return function(_0x2705b9){if(!_0x2705b9){_0x587f91['sendStatus'](0x194);}return _0x2705b9;};}function handleError(_0x4e5206,_0x5869ce){_0x5869ce=_0x5869ce||0x1f4;return function(_0x3c8c47){logger[_0xb466('0x2b')](_0x3c8c47[_0xb466('0x2c')]);if(_0x3c8c47[_0xb466('0x2d')]){delete _0x3c8c47[_0xb466('0x2d')];}_0x4e5206['status'](_0x5869ce)[_0xb466('0x2e')](_0x3c8c47);};}exports[_0xb466('0x2f')]=function(_0x126c99,_0x959cb){var _0x57cc25={},_0x59e806={},_0x4027a4={'count':0x0,'rows':[]};var _0x5cf82b=_[_0xb466('0x30')](db[_0xb466('0x31')][_0xb466('0x32')],function(_0x4a5b7d){return{'name':_0x4a5b7d[_0xb466('0x33')],'type':_0x4a5b7d[_0xb466('0x34')][_0xb466('0x35')]};});_0x59e806[_0xb466('0x36')]=_['map'](_0x5cf82b,_0xb466('0x2d'));_0x59e806[_0xb466('0x37')]=_[_0xb466('0x38')](_0x126c99[_0xb466('0x37')]);_0x59e806[_0xb466('0x39')]=_['intersection'](_0x59e806[_0xb466('0x36')],_0x59e806[_0xb466('0x37')]);_0x57cc25[_0xb466('0x3a')]=_[_0xb466('0x3b')](_0x59e806[_0xb466('0x36')],qs[_0xb466('0x3c')](_0x126c99['query']['fields']));_0x57cc25[_0xb466('0x3a')]=_0x57cc25['attributes'][_0xb466('0x3d')]?_0x57cc25[_0xb466('0x3a')]:_0x59e806[_0xb466('0x36')];if(!_0x126c99['query'][_0xb466('0x3e')]('nolimit')){_0x57cc25[_0xb466('0x22')]=qs[_0xb466('0x22')](_0x126c99[_0xb466('0x37')][_0xb466('0x22')]);_0x57cc25['offset']=qs[_0xb466('0x21')](_0x126c99['query'][_0xb466('0x21')]);}_0x57cc25['order']=qs[_0xb466('0x3f')](_0x126c99['query'][_0xb466('0x3f')]);_0x57cc25[_0xb466('0x40')]=qs[_0xb466('0x39')](_[_0xb466('0x41')](_0x126c99[_0xb466('0x37')],_0x59e806[_0xb466('0x39')]),_0x5cf82b);if(_0x126c99[_0xb466('0x37')][_0xb466('0x42')]){_0x57cc25[_0xb466('0x40')]=_[_0xb466('0x43')](_0x57cc25['where'],{'$or':_[_0xb466('0x30')](_0x5cf82b,function(_0x2ab189){if(_0x2ab189[_0xb466('0x34')]!==_0xb466('0x44')){var _0x47714a={};_0x47714a[_0x2ab189[_0xb466('0x2d')]]={'$like':'%'+_0x126c99[_0xb466('0x37')][_0xb466('0x42')]+'%'};return _0x47714a;}})});}_0x57cc25=_[_0xb466('0x43')]({},_0x57cc25,_0x126c99[_0xb466('0x45')]);var _0x5273db={'where':_0x57cc25['where']};return db[_0xb466('0x31')]['count'](_0x5273db)['then'](function(_0x2eadea){_0x4027a4[_0xb466('0x20')]=_0x2eadea;if(_0x126c99['query']['includeAll']){_0x57cc25[_0xb466('0x46')]=[{'all':!![]}];}return db[_0xb466('0x31')]['findAll'](_0x57cc25);})[_0xb466('0x2a')](function(_0x2f1653){_0x4027a4[_0xb466('0x47')]=_0x2f1653;return _0x4027a4;})[_0xb466('0x2a')](respondWithFilteredResult(_0x959cb,_0x57cc25))[_0xb466('0x48')](handleError(_0x959cb,null));};exports[_0xb466('0x49')]=function(_0x1b85f3,_0x6827c7){var _0x58ec14={'raw':![],'where':{'id':_0x1b85f3['params']['id']}},_0x38ceed={};_0x38ceed[_0xb466('0x36')]=_[_0xb466('0x38')](db[_0xb466('0x31')][_0xb466('0x32')]);_0x38ceed['query']=_[_0xb466('0x38')](_0x1b85f3[_0xb466('0x37')]);_0x38ceed[_0xb466('0x39')]=_[_0xb466('0x3b')](_0x38ceed[_0xb466('0x36')],_0x38ceed[_0xb466('0x37')]);_0x58ec14[_0xb466('0x3a')]=_[_0xb466('0x3b')](_0x38ceed[_0xb466('0x36')],qs[_0xb466('0x3c')](_0x1b85f3[_0xb466('0x37')][_0xb466('0x3c')]));_0x58ec14[_0xb466('0x3a')]=_0x58ec14[_0xb466('0x3a')][_0xb466('0x3d')]?_0x58ec14[_0xb466('0x3a')]:_0x38ceed[_0xb466('0x36')];if(_0x1b85f3[_0xb466('0x37')][_0xb466('0x4a')]){_0x58ec14['include']=[{'all':!![]}];}_0x58ec14=_[_0xb466('0x43')]({},_0x58ec14,_0x1b85f3[_0xb466('0x45')]);return db[_0xb466('0x31')][_0xb466('0x4b')](_0x58ec14)['then'](handleEntityNotFound(_0x6827c7,null))['then'](respondWithResult(_0x6827c7,null))[_0xb466('0x48')](handleError(_0x6827c7,null));};exports['create']=function(_0x1a4938,_0x488485){return db[_0xb466('0x31')][_0xb466('0x4c')](_0x1a4938['body'],{})['then'](respondWithResult(_0x488485,0xc9))[_0xb466('0x48')](handleError(_0x488485,null));};exports[_0xb466('0x28')]=function(_0x29ca2b,_0x50c7cf){if(_0x29ca2b[_0xb466('0x4d')]['id']){delete _0x29ca2b[_0xb466('0x4d')]['id'];}return db['VtigerAccount'][_0xb466('0x4b')]({'where':{'id':_0x29ca2b['params']['id']}})['then'](handleEntityNotFound(_0x50c7cf,null))[_0xb466('0x2a')](saveUpdates(_0x29ca2b['body'],null))[_0xb466('0x2a')](respondWithResult(_0x50c7cf,null))['catch'](handleError(_0x50c7cf,null));};exports[_0xb466('0x29')]=function(_0x2f7232,_0x243cf8){return db[_0xb466('0x31')][_0xb466('0x4b')]({'where':{'id':_0x2f7232[_0xb466('0x4e')]['id']}})[_0xb466('0x2a')](handleEntityNotFound(_0x243cf8,null))[_0xb466('0x2a')](removeEntity(_0x243cf8,null))[_0xb466('0x48')](handleError(_0x243cf8,null));};exports[_0xb466('0x4f')]=function(_0x15abcb,_0x6e3375,_0x1933b4){var _0x4b75fe={};var _0x5812f4={};var _0x374103;var _0x4bd5dd;return db['VtigerAccount']['findOne']({'where':{'id':_0x15abcb[_0xb466('0x4e')]['id']}})[_0xb466('0x2a')](handleEntityNotFound(_0x6e3375,null))[_0xb466('0x2a')](function(_0x4cd9d7){if(_0x4cd9d7){_0x374103=_0x4cd9d7;_0x5812f4['model']=_['keys'](db[_0xb466('0x50')][_0xb466('0x32')]);_0x5812f4[_0xb466('0x37')]=_['keys'](_0x15abcb[_0xb466('0x37')]);_0x5812f4[_0xb466('0x39')]=_[_0xb466('0x3b')](_0x5812f4[_0xb466('0x36')],_0x5812f4['query']);_0x4b75fe[_0xb466('0x3a')]=_['intersection'](_0x5812f4['model'],qs['fields'](_0x15abcb[_0xb466('0x37')]['fields']));_0x4b75fe[_0xb466('0x3a')]=_0x4b75fe[_0xb466('0x3a')][_0xb466('0x3d')]?_0x4b75fe[_0xb466('0x3a')]:_0x5812f4[_0xb466('0x36')];_0x4b75fe[_0xb466('0x51')]=qs[_0xb466('0x3f')](_0x15abcb[_0xb466('0x37')][_0xb466('0x3f')]);_0x4b75fe[_0xb466('0x40')]=qs[_0xb466('0x39')](_[_0xb466('0x41')](_0x15abcb[_0xb466('0x37')],_0x5812f4[_0xb466('0x39')]));if(_0x15abcb[_0xb466('0x37')][_0xb466('0x42')]){_0x4b75fe[_0xb466('0x40')]=_[_0xb466('0x43')](_0x4b75fe[_0xb466('0x40')],{'$or':_[_0xb466('0x30')](_0x4b75fe[_0xb466('0x3a')],function(_0x1b2587){var _0x5032e0={};_0x5032e0[_0x1b2587]={'$like':'%'+_0x15abcb[_0xb466('0x37')][_0xb466('0x42')]+'%'};return _0x5032e0;})});}_0x4b75fe=_['merge']({},_0x4b75fe,_0x15abcb[_0xb466('0x45')]);return _0x374103[_0xb466('0x4f')](_0x4b75fe);}})[_0xb466('0x2a')](function(_0x6fed6){if(_0x6fed6){_0x4bd5dd=_0x6fed6[_0xb466('0x3d')];if(!_0x15abcb['query'][_0xb466('0x3e')](_0xb466('0x52'))){_0x4b75fe[_0xb466('0x22')]=qs[_0xb466('0x22')](_0x15abcb[_0xb466('0x37')][_0xb466('0x22')]);_0x4b75fe[_0xb466('0x21')]=qs['offset'](_0x15abcb[_0xb466('0x37')][_0xb466('0x21')]);}return _0x374103['getConfigurations'](_0x4b75fe);}})['then'](function(_0x3bb1c5){if(_0x3bb1c5){return _0x3bb1c5?{'count':_0x4bd5dd,'rows':_0x3bb1c5}:null;}})['then'](respondWithResult(_0x6e3375,null))[_0xb466('0x48')](handleError(_0x6e3375,null));};exports[_0xb466('0x53')]=function(_0x3d84f9,_0x1626fe,_0x44c65a){if(_0x3d84f9['body']['id']){delete _0x3d84f9['body']['id'];}return db[_0xb466('0x31')][_0xb466('0x54')]({'where':{'id':_0x3d84f9['params']['id']}})[_0xb466('0x2a')](handleEntityNotFound(_0x1626fe,null))['then'](function(_0x23a54b){if(_0x23a54b){_0x3d84f9[_0xb466('0x4d')][_0xb466('0x55')]=_0x23a54b['id'];_0x3d84f9[_0xb466('0x4d')][_0xb466('0x56')]=integrations[_0xb466('0x57')](_0x3d84f9[_0xb466('0x4d')][_0xb466('0x58')],_0x3d84f9[_0xb466('0x4d')][_0xb466('0x34')]);_0x3d84f9[_0xb466('0x4d')][_0xb466('0x59')]=integrations['getDescriptions'](_0x3d84f9['body'][_0xb466('0x58')],_0x3d84f9[_0xb466('0x4d')][_0xb466('0x34')]);return db[_0xb466('0x50')][_0xb466('0x4c')](_0x3d84f9[_0xb466('0x4d')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0xb466('0x5a')],'as':_0xb466('0x59')}]});}return null;})[_0xb466('0x2a')](respondWithResult(_0x1626fe,null))[_0xb466('0x48')](handleError(_0x1626fe,null));};var md5=require(_0xb466('0x5b'));exports['getFields']=function(_0x44fd64,_0x272631,_0x33e098){var _0x2c64a5=null;var _0x5551bc=null;var _0x3f88d1=null;var _0x45d61a=null;var _0x45e0b1='';return db['VtigerAccount'][_0xb466('0x54')]({'where':{'id':_0x44fd64[_0xb466('0x4e')]['id']},'attributes':['id',_0xb466('0x2d'),_0xb466('0x5c'),_0xb466('0x5d'),'moduleName','remoteUri',_0xb466('0x5e'),_0xb466('0x5f')]})[_0xb466('0x2a')](handleEntityNotFound(_0x272631,null))[_0xb466('0x2a')](function(_0x2e54ab){if(_0x2e54ab){_0x2c64a5=_0x2e54ab['username'];_0x5551bc=_0x2e54ab[_0xb466('0x5f')];_0x3f88d1=_0x2e54ab['moduleName'];_0x45e0b1=_0x2e54ab[_0xb466('0x60')];var _0x52c763=_0x45e0b1[_0xb466('0x61')](-0x1);if(_0x52c763==='/'){_0x45e0b1=_0x45e0b1[_0xb466('0x62')](0x0,_0x45e0b1['lastIndexOf'](_0x52c763));}_0x45d61a=util[_0xb466('0x63')](_0xb466('0x64'),_0x45e0b1);var _0x40558b={'method':_0xb466('0x65'),'uri':_0x45d61a,'qs':{'operation':_0xb466('0x66'),'username':_0x2e54ab[_0xb466('0x5c')]},'json':!![]};return rp(_0x40558b);}})[_0xb466('0x2a')](function(_0x5783be){if(_0x5783be[_0xb466('0x67')]){var _0x57950d={'method':_0xb466('0x68'),'uri':_0x45d61a,'form':{'operation':_0xb466('0x69'),'username':_0x2c64a5,'accessKey':md5(_0x5783be[_0xb466('0x6a')][_0xb466('0x6b')]+_0x5551bc)},'json':!![]};return rp(_0x57950d);}})[_0xb466('0x2a')](function(_0x32de97){if(_0x32de97['success']){var _0x2e2c75={'method':_0xb466('0x65'),'uri':_0x45d61a,'qs':{'operation':_0xb466('0x6c'),'username':_0x2c64a5,'sessionName':_0x32de97[_0xb466('0x6a')]['sessionName'],'elementType':_0x3f88d1},'json':!![]};return rp(_0x2e2c75);}})[_0xb466('0x2a')](function(_0x3cd818){if(_0x3cd818[_0xb466('0x67')]){var _0x1f23a3=[_0xb466('0x6d'),_0xb466('0x6e'),'owner'];_[_0xb466('0x6f')](_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')],function(_0x52ec14){return _0x1f23a3['includes'](_0x52ec14[_0xb466('0x34')]['name']);});_['remove'](_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')],function(_0x59e978){return _0x59e978[_0xb466('0x70')]===_0xb466('0x71');});return{'count':_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')][_0xb466('0x3d')],'rows':_['map'](_0x3cd818[_0xb466('0x6a')][_0xb466('0x3c')],function(_0x260ecc){return{'id':_0x260ecc[_0xb466('0x2d')],'name':_0x260ecc[_0xb466('0x72')],'custom':_['startsWith'](_0x260ecc['name'],_0xb466('0x73'))?!![]:![],'options':_0x260ecc[_0xb466('0x34')][_0xb466('0x2d')]==='picklist'&&_0x260ecc['type']['picklistValues'][_0xb466('0x3d')]>0x0?_[_0xb466('0x30')](_0x260ecc['type'][_0xb466('0x74')],function(_0x281aca){return{'name':_0x281aca[_0xb466('0x72')],'value':_0x281aca[_0xb466('0x75')]};}):[]};})};}})[_0xb466('0x2a')](respondWithResult(_0x272631,null))[_0xb466('0x48')](function(_0x220647){console[_0xb466('0x76')](_0xb466('0x77')+_0x220647);var _0x5ce692=_0x44fd64['query']['test']?0x1f4:_0x220647[_0xb466('0x78')]||0x1f4;logger[_0xb466('0x2b')](_0xb466('0x79'),_0xb466('0x7a'),_0x5ce692,JSON[_0xb466('0x7b')](_0x220647));delete _0x220647[_0xb466('0x2d')];if(_0x5ce692===0x191){_0x5ce692=0x190;}_0x272631[_0xb466('0x1c')](_0x5ce692)['send'](_0x44fd64[_0xb466('0x37')][_0xb466('0x7c')]?{'message':_0xb466('0x7d'),'statusCode':_0x220647[_0xb466('0x78')]}:_0x220647);});}; \ No newline at end of file +var _0xc5a9=['apply','reject','save','update','then','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','getConfigurations','findOne','VtigerConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','VtigerField','md5','getFields','username','description','moduleName','remoteUri','slice','lastIndexOf','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','owner','remove','result','editable','false','startsWith','picklistValues','length','label','value','log','vTiger\x20error:\x20','test','stringify','statusCode','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range'];(function(_0x139dcd,_0x4f6f73){var _0x11308d=function(_0x139756){while(--_0x139756){_0x139dcd['push'](_0x139dcd['shift']());}};_0x11308d(++_0x4f6f73);}(_0xc5a9,0xc8));var _0x9c5a=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xc5a9[_0xa60623];return _0x4a6487;};'use strict';var emlformat=require(_0x9c5a('0x0'));var rimraf=require(_0x9c5a('0x1'));var zipdir=require(_0x9c5a('0x2'));var jsonpatch=require(_0x9c5a('0x3'));var rp=require(_0x9c5a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9c5a('0x5'));var util=require(_0x9c5a('0x6'));var path=require(_0x9c5a('0x7'));var sox=require(_0x9c5a('0x8'));var csv=require(_0x9c5a('0x9'));var ejs=require(_0x9c5a('0xa'));var fs=require('fs');var fs_extra=require(_0x9c5a('0xb'));var _=require(_0x9c5a('0xc'));var squel=require(_0x9c5a('0xd'));var crypto=require(_0x9c5a('0xe'));var jsforce=require(_0x9c5a('0xf'));var deskjs=require(_0x9c5a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9c5a('0x11'));var Papa=require(_0x9c5a('0x12'));var Redis=require(_0x9c5a('0x13'));var authService=require(_0x9c5a('0x14'));var qs=require(_0x9c5a('0x15'));var as=require(_0x9c5a('0x16'));var hardwareService=require(_0x9c5a('0x17'));var logger=require(_0x9c5a('0x18'))(_0x9c5a('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9c5a('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9c5a('0x1b'));function respondWithStatusCode(_0x54dbaa,_0x33ffc5){_0x33ffc5=_0x33ffc5||0xcc;return function(_0xe7ca51){if(_0xe7ca51){return _0x54dbaa[_0x9c5a('0x1c')](_0x33ffc5);}return _0x54dbaa['status'](_0x33ffc5)[_0x9c5a('0x1d')]();};}function respondWithResult(_0x1772c3,_0x278302){_0x278302=_0x278302||0xc8;return function(_0x9b1194){if(_0x9b1194){return _0x1772c3['status'](_0x278302)[_0x9c5a('0x1e')](_0x9b1194);}};}function respondWithFilteredResult(_0x46f7be,_0x52a15c){return function(_0x3ec9b1){if(_0x3ec9b1){var _0x49e687=typeof _0x52a15c[_0x9c5a('0x1f')]==='undefined'&&typeof _0x52a15c[_0x9c5a('0x20')]===_0x9c5a('0x21');var _0x1997da=_0x3ec9b1['count'];var _0x5e84aa=_0x49e687?0x0:_0x52a15c[_0x9c5a('0x1f')];var _0x1fbc27=_0x49e687?_0x3ec9b1[_0x9c5a('0x22')]:_0x52a15c['offset']+_0x52a15c[_0x9c5a('0x20')];var _0x12e624;if(_0x1fbc27>=_0x1997da){_0x1fbc27=_0x1997da;_0x12e624=0xc8;}else{_0x12e624=0xce;}_0x46f7be[_0x9c5a('0x23')](_0x12e624);return _0x46f7be[_0x9c5a('0x24')](_0x9c5a('0x25'),_0x5e84aa+'-'+_0x1fbc27+'/'+_0x1997da)[_0x9c5a('0x1e')](_0x3ec9b1);}return null;};}function patchUpdates(_0x164509){return function(_0x556e48){try{jsonpatch[_0x9c5a('0x26')](_0x556e48,_0x164509,!![]);}catch(_0x20f8fe){return BPromise[_0x9c5a('0x27')](_0x20f8fe);}return _0x556e48[_0x9c5a('0x28')]();};}function saveUpdates(_0x58b8f0,_0x4dab14){return function(_0x1c05d4){if(_0x1c05d4){return _0x1c05d4[_0x9c5a('0x29')](_0x58b8f0)['then'](function(_0x18647d){return _0x18647d;});}return null;};}function removeEntity(_0x295c57,_0x23297d){return function(_0x360628){if(_0x360628){return _0x360628['destroy']()[_0x9c5a('0x2a')](function(){_0x295c57[_0x9c5a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7b6d,_0x585cec){return function(_0x1d6891){if(!_0x1d6891){_0x4c7b6d[_0x9c5a('0x1c')](0x194);}return _0x1d6891;};}function handleError(_0x3f9888,_0xc6cad8){_0xc6cad8=_0xc6cad8||0x1f4;return function(_0x299715){logger['error'](_0x299715['stack']);if(_0x299715[_0x9c5a('0x2b')]){delete _0x299715[_0x9c5a('0x2b')];}_0x3f9888['status'](_0xc6cad8)[_0x9c5a('0x2c')](_0x299715);};}exports[_0x9c5a('0x2d')]=function(_0x2ff7ff,_0x1d0e74){var _0x49794e={},_0x519156={},_0x470ac4={'count':0x0,'rows':[]};var _0x41d24e=_['map'](db[_0x9c5a('0x2e')][_0x9c5a('0x2f')],function(_0x460bf1){return{'name':_0x460bf1[_0x9c5a('0x30')],'type':_0x460bf1[_0x9c5a('0x31')]['key']};});_0x519156[_0x9c5a('0x32')]=_[_0x9c5a('0x33')](_0x41d24e,_0x9c5a('0x2b'));_0x519156[_0x9c5a('0x34')]=_[_0x9c5a('0x35')](_0x2ff7ff[_0x9c5a('0x34')]);_0x519156[_0x9c5a('0x36')]=_[_0x9c5a('0x37')](_0x519156[_0x9c5a('0x32')],_0x519156[_0x9c5a('0x34')]);_0x49794e[_0x9c5a('0x38')]=_[_0x9c5a('0x37')](_0x519156[_0x9c5a('0x32')],qs[_0x9c5a('0x39')](_0x2ff7ff['query'][_0x9c5a('0x39')]));_0x49794e[_0x9c5a('0x38')]=_0x49794e[_0x9c5a('0x38')]['length']?_0x49794e['attributes']:_0x519156[_0x9c5a('0x32')];if(!_0x2ff7ff['query']['hasOwnProperty'](_0x9c5a('0x3a'))){_0x49794e['limit']=qs[_0x9c5a('0x20')](_0x2ff7ff[_0x9c5a('0x34')]['limit']);_0x49794e['offset']=qs['offset'](_0x2ff7ff[_0x9c5a('0x34')][_0x9c5a('0x1f')]);}_0x49794e[_0x9c5a('0x3b')]=qs[_0x9c5a('0x3c')](_0x2ff7ff[_0x9c5a('0x34')][_0x9c5a('0x3c')]);_0x49794e[_0x9c5a('0x3d')]=qs['filters'](_[_0x9c5a('0x3e')](_0x2ff7ff[_0x9c5a('0x34')],_0x519156[_0x9c5a('0x36')]),_0x41d24e);if(_0x2ff7ff[_0x9c5a('0x34')][_0x9c5a('0x3f')]){_0x49794e['where']=_[_0x9c5a('0x40')](_0x49794e[_0x9c5a('0x3d')],{'$or':_['map'](_0x41d24e,function(_0x1ab3be){if(_0x1ab3be[_0x9c5a('0x31')]!==_0x9c5a('0x41')){var _0x49fb51={};_0x49fb51[_0x1ab3be[_0x9c5a('0x2b')]]={'$like':'%'+_0x2ff7ff['query'][_0x9c5a('0x3f')]+'%'};return _0x49fb51;}})});}_0x49794e=_[_0x9c5a('0x40')]({},_0x49794e,_0x2ff7ff[_0x9c5a('0x42')]);var _0x1548be={'where':_0x49794e[_0x9c5a('0x3d')]};return db[_0x9c5a('0x2e')][_0x9c5a('0x22')](_0x1548be)[_0x9c5a('0x2a')](function(_0x55c265){_0x470ac4[_0x9c5a('0x22')]=_0x55c265;if(_0x2ff7ff[_0x9c5a('0x34')][_0x9c5a('0x43')]){_0x49794e[_0x9c5a('0x44')]=[{'all':!![]}];}return db[_0x9c5a('0x2e')][_0x9c5a('0x45')](_0x49794e);})[_0x9c5a('0x2a')](function(_0x5d8ab9){_0x470ac4[_0x9c5a('0x46')]=_0x5d8ab9;return _0x470ac4;})['then'](respondWithFilteredResult(_0x1d0e74,_0x49794e))[_0x9c5a('0x47')](handleError(_0x1d0e74,null));};exports[_0x9c5a('0x48')]=function(_0x280a23,_0x41df58){var _0xc362e4={'raw':![],'where':{'id':_0x280a23[_0x9c5a('0x49')]['id']}},_0x5c3244={};_0x5c3244[_0x9c5a('0x32')]=_['keys'](db[_0x9c5a('0x2e')][_0x9c5a('0x2f')]);_0x5c3244[_0x9c5a('0x34')]=_[_0x9c5a('0x35')](_0x280a23['query']);_0x5c3244[_0x9c5a('0x36')]=_[_0x9c5a('0x37')](_0x5c3244[_0x9c5a('0x32')],_0x5c3244[_0x9c5a('0x34')]);_0xc362e4[_0x9c5a('0x38')]=_[_0x9c5a('0x37')](_0x5c3244[_0x9c5a('0x32')],qs[_0x9c5a('0x39')](_0x280a23[_0x9c5a('0x34')][_0x9c5a('0x39')]));_0xc362e4[_0x9c5a('0x38')]=_0xc362e4[_0x9c5a('0x38')]['length']?_0xc362e4[_0x9c5a('0x38')]:_0x5c3244['model'];if(_0x280a23[_0x9c5a('0x34')]['includeAll']){_0xc362e4[_0x9c5a('0x44')]=[{'all':!![]}];}_0xc362e4=_[_0x9c5a('0x40')]({},_0xc362e4,_0x280a23[_0x9c5a('0x42')]);return db['VtigerAccount'][_0x9c5a('0x4a')](_0xc362e4)['then'](handleEntityNotFound(_0x41df58,null))[_0x9c5a('0x2a')](respondWithResult(_0x41df58,null))['catch'](handleError(_0x41df58,null));};exports['create']=function(_0x1e7c79,_0x54faee){return db['VtigerAccount']['create'](_0x1e7c79[_0x9c5a('0x4b')],{})[_0x9c5a('0x2a')](respondWithResult(_0x54faee,0xc9))['catch'](handleError(_0x54faee,null));};exports[_0x9c5a('0x29')]=function(_0x43f5cf,_0x3c7db4){if(_0x43f5cf[_0x9c5a('0x4b')]['id']){delete _0x43f5cf['body']['id'];}return db[_0x9c5a('0x2e')]['find']({'where':{'id':_0x43f5cf['params']['id']}})[_0x9c5a('0x2a')](handleEntityNotFound(_0x3c7db4,null))[_0x9c5a('0x2a')](saveUpdates(_0x43f5cf[_0x9c5a('0x4b')],null))[_0x9c5a('0x2a')](respondWithResult(_0x3c7db4,null))['catch'](handleError(_0x3c7db4,null));};exports[_0x9c5a('0x4c')]=function(_0x5d58d3,_0xc5f13d){return db[_0x9c5a('0x2e')][_0x9c5a('0x4a')]({'where':{'id':_0x5d58d3['params']['id']}})['then'](handleEntityNotFound(_0xc5f13d,null))[_0x9c5a('0x2a')](removeEntity(_0xc5f13d,null))[_0x9c5a('0x47')](handleError(_0xc5f13d,null));};exports[_0x9c5a('0x4d')]=function(_0x27a099,_0x580065,_0x372790){var _0x14e38f={};var _0x461f0f={};var _0x4013e4;var _0x12fe8c;return db[_0x9c5a('0x2e')][_0x9c5a('0x4e')]({'where':{'id':_0x27a099[_0x9c5a('0x49')]['id']}})[_0x9c5a('0x2a')](handleEntityNotFound(_0x580065,null))[_0x9c5a('0x2a')](function(_0x25b316){if(_0x25b316){_0x4013e4=_0x25b316;_0x461f0f[_0x9c5a('0x32')]=_[_0x9c5a('0x35')](db[_0x9c5a('0x4f')][_0x9c5a('0x2f')]);_0x461f0f[_0x9c5a('0x34')]=_[_0x9c5a('0x35')](_0x27a099['query']);_0x461f0f[_0x9c5a('0x36')]=_['intersection'](_0x461f0f[_0x9c5a('0x32')],_0x461f0f['query']);_0x14e38f[_0x9c5a('0x38')]=_[_0x9c5a('0x37')](_0x461f0f[_0x9c5a('0x32')],qs[_0x9c5a('0x39')](_0x27a099[_0x9c5a('0x34')][_0x9c5a('0x39')]));_0x14e38f['attributes']=_0x14e38f['attributes']['length']?_0x14e38f['attributes']:_0x461f0f['model'];_0x14e38f['order']=qs[_0x9c5a('0x3c')](_0x27a099[_0x9c5a('0x34')][_0x9c5a('0x3c')]);_0x14e38f[_0x9c5a('0x3d')]=qs['filters'](_[_0x9c5a('0x3e')](_0x27a099['query'],_0x461f0f[_0x9c5a('0x36')]));if(_0x27a099[_0x9c5a('0x34')][_0x9c5a('0x3f')]){_0x14e38f[_0x9c5a('0x3d')]=_['merge'](_0x14e38f[_0x9c5a('0x3d')],{'$or':_['map'](_0x14e38f[_0x9c5a('0x38')],function(_0x16ebfc){var _0x8c2d05={};_0x8c2d05[_0x16ebfc]={'$like':'%'+_0x27a099[_0x9c5a('0x34')][_0x9c5a('0x3f')]+'%'};return _0x8c2d05;})});}_0x14e38f=_[_0x9c5a('0x40')]({},_0x14e38f,_0x27a099[_0x9c5a('0x42')]);return _0x4013e4[_0x9c5a('0x4d')](_0x14e38f);}})[_0x9c5a('0x2a')](function(_0x277cbe){if(_0x277cbe){_0x12fe8c=_0x277cbe['length'];if(!_0x27a099[_0x9c5a('0x34')]['hasOwnProperty'](_0x9c5a('0x3a'))){_0x14e38f[_0x9c5a('0x20')]=qs[_0x9c5a('0x20')](_0x27a099['query'][_0x9c5a('0x20')]);_0x14e38f[_0x9c5a('0x1f')]=qs[_0x9c5a('0x1f')](_0x27a099[_0x9c5a('0x34')][_0x9c5a('0x1f')]);}return _0x4013e4[_0x9c5a('0x4d')](_0x14e38f);}})[_0x9c5a('0x2a')](function(_0x2eb513){if(_0x2eb513){return _0x2eb513?{'count':_0x12fe8c,'rows':_0x2eb513}:null;}})['then'](respondWithResult(_0x580065,null))[_0x9c5a('0x47')](handleError(_0x580065,null));};exports['addConfiguration']=function(_0x361ca4,_0x537d4a,_0x1afaf8){if(_0x361ca4[_0x9c5a('0x4b')]['id']){delete _0x361ca4[_0x9c5a('0x4b')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x361ca4[_0x9c5a('0x49')]['id']}})['then'](handleEntityNotFound(_0x537d4a,null))[_0x9c5a('0x2a')](function(_0x2ec1fe){if(_0x2ec1fe){_0x361ca4[_0x9c5a('0x4b')]['AccountId']=_0x2ec1fe['id'];_0x361ca4[_0x9c5a('0x4b')][_0x9c5a('0x50')]=integrations[_0x9c5a('0x51')](_0x361ca4['body']['channel'],_0x361ca4[_0x9c5a('0x4b')][_0x9c5a('0x31')]);_0x361ca4[_0x9c5a('0x4b')][_0x9c5a('0x52')]=integrations[_0x9c5a('0x53')](_0x361ca4[_0x9c5a('0x4b')][_0x9c5a('0x54')],_0x361ca4[_0x9c5a('0x4b')]['type']);return db[_0x9c5a('0x4f')][_0x9c5a('0x55')](_0x361ca4[_0x9c5a('0x4b')],{'include':[{'model':db[_0x9c5a('0x56')],'as':_0x9c5a('0x50')},{'model':db[_0x9c5a('0x56')],'as':_0x9c5a('0x52')}]});}return null;})[_0x9c5a('0x2a')](respondWithResult(_0x537d4a,null))[_0x9c5a('0x47')](handleError(_0x537d4a,null));};var md5=require(_0x9c5a('0x57'));exports[_0x9c5a('0x58')]=function(_0x14708e,_0x70073f,_0x34230d){var _0x584911=null;var _0x2cd360=null;var _0x292b81=null;var _0x144643=null;var _0x59dd64='';return db[_0x9c5a('0x2e')]['findOne']({'where':{'id':_0x14708e[_0x9c5a('0x49')]['id']},'attributes':['id','name',_0x9c5a('0x59'),_0x9c5a('0x5a'),_0x9c5a('0x5b'),'remoteUri','serverUrl','accessKey']})[_0x9c5a('0x2a')](handleEntityNotFound(_0x70073f,null))[_0x9c5a('0x2a')](function(_0x3b1240){if(_0x3b1240){_0x584911=_0x3b1240[_0x9c5a('0x59')];_0x2cd360=_0x3b1240['accessKey'];_0x292b81=_0x3b1240[_0x9c5a('0x5b')];_0x59dd64=_0x3b1240[_0x9c5a('0x5c')];var _0x2388dc=_0x59dd64[_0x9c5a('0x5d')](-0x1);if(_0x2388dc==='/'){_0x59dd64=_0x59dd64['substring'](0x0,_0x59dd64[_0x9c5a('0x5e')](_0x2388dc));}_0x144643=util['format']('%s/webservice.php',_0x59dd64);var _0x5e3cbb={'method':_0x9c5a('0x5f'),'uri':_0x144643,'qs':{'operation':_0x9c5a('0x60'),'username':_0x3b1240['username']},'json':!![]};return rp(_0x5e3cbb);}})[_0x9c5a('0x2a')](function(_0x50bff4){if(_0x50bff4[_0x9c5a('0x61')]){var _0x5dbf6b={'method':_0x9c5a('0x62'),'uri':_0x144643,'form':{'operation':_0x9c5a('0x63'),'username':_0x584911,'accessKey':md5(_0x50bff4['result'][_0x9c5a('0x64')]+_0x2cd360)},'json':!![]};return rp(_0x5dbf6b);}})['then'](function(_0xe3a426){if(_0xe3a426[_0x9c5a('0x61')]){var _0x3536d9={'method':_0x9c5a('0x5f'),'uri':_0x144643,'qs':{'operation':_0x9c5a('0x65'),'username':_0x584911,'sessionName':_0xe3a426['result'][_0x9c5a('0x66')],'elementType':_0x292b81},'json':!![]};return rp(_0x3536d9);}})[_0x9c5a('0x2a')](function(_0x58cf72){if(_0x58cf72['success']){var _0x2ca742=[_0x9c5a('0x67'),'reference',_0x9c5a('0x68')];_[_0x9c5a('0x69')](_0x58cf72[_0x9c5a('0x6a')]['fields'],function(_0x4aedd2){return _0x2ca742['includes'](_0x4aedd2['type'][_0x9c5a('0x2b')]);});_[_0x9c5a('0x69')](_0x58cf72[_0x9c5a('0x6a')][_0x9c5a('0x39')],function(_0x4c7388){return _0x4c7388[_0x9c5a('0x6b')]===_0x9c5a('0x6c');});return{'count':_0x58cf72['result'][_0x9c5a('0x39')]['length'],'rows':_[_0x9c5a('0x33')](_0x58cf72['result'][_0x9c5a('0x39')],function(_0x46d1fc){return{'id':_0x46d1fc[_0x9c5a('0x2b')],'name':_0x46d1fc['label'],'custom':_[_0x9c5a('0x6d')](_0x46d1fc[_0x9c5a('0x2b')],'cf_')?!![]:![],'options':_0x46d1fc[_0x9c5a('0x31')]['name']==='picklist'&&_0x46d1fc[_0x9c5a('0x31')][_0x9c5a('0x6e')][_0x9c5a('0x6f')]>0x0?_[_0x9c5a('0x33')](_0x46d1fc[_0x9c5a('0x31')][_0x9c5a('0x6e')],function(_0x3906ef){return{'name':_0x3906ef[_0x9c5a('0x70')],'value':_0x3906ef[_0x9c5a('0x71')]};}):[]};})};}})[_0x9c5a('0x2a')](respondWithResult(_0x70073f,null))['catch'](function(_0x348d7c){console[_0x9c5a('0x72')](_0x9c5a('0x73')+_0x348d7c);var _0x198bd9=_0x14708e[_0x9c5a('0x34')][_0x9c5a('0x74')]?0x1f4:_0x348d7c['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9c5a('0x58'),_0x198bd9,JSON[_0x9c5a('0x75')](_0x348d7c));delete _0x348d7c[_0x9c5a('0x2b')];if(_0x198bd9===0x191){_0x198bd9=0x190;}_0x70073f['status'](_0x198bd9)['send'](_0x14708e[_0x9c5a('0x34')][_0x9c5a('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x348d7c[_0x9c5a('0x76')]}:_0x348d7c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index debdcce..8a5fec4 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 _0x4135=['VtigerAccount','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x16c0b7,_0x42e87f){var _0xd16ec8=function(_0x3c175c){while(--_0x3c175c){_0x16c0b7['push'](_0x16c0b7['shift']());}};_0xd16ec8(++_0x42e87f);}(_0x4135,0x1ae));var _0x5413=function(_0x119de7,_0x3d1fbb){_0x119de7=_0x119de7-0x0;var _0x4a3ea3=_0x4135[_0x119de7];return _0x4a3ea3;};'use strict';var _=require('lodash');var util=require(_0x5413('0x0'));var logger=require(_0x5413('0x1'))(_0x5413('0x2'));var moment=require(_0x5413('0x3'));var BPromise=require('bluebird');var rp=require(_0x5413('0x4'));var fs=require('fs');var path=require(_0x5413('0x5'));var rimraf=require(_0x5413('0x6'));var config=require(_0x5413('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5413('0x8')]=function(_0x1a1fbd,_0x6b2da2){return _0x1a1fbd[_0x5413('0x9')](_0x5413('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d4a=['../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x2f34d5,_0x5cecda){var _0x5e79ea=function(_0x731662){while(--_0x731662){_0x2f34d5['push'](_0x2f34d5['shift']());}};_0x5e79ea(++_0x5cecda);}(_0x6d4a,0xc7));var _0xa6d4=function(_0x32026f,_0x183ee9){_0x32026f=_0x32026f-0x0;var _0x29153f=_0x6d4a[_0x32026f];return _0x29153f;};'use strict';var _=require(_0xa6d4('0x0'));var util=require(_0xa6d4('0x1'));var logger=require(_0xa6d4('0x2'))('api');var moment=require(_0xa6d4('0x3'));var BPromise=require(_0xa6d4('0x4'));var rp=require(_0xa6d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6d4('0x6'));var config=require(_0xa6d4('0x7'));var attributes=require(_0xa6d4('0x8'));var integrations=require(_0xa6d4('0x9'));module['exports']=function(_0x13bec2,_0x5c4a2b){return _0x13bec2[_0xa6d4('0xa')](_0xa6d4('0xb'),attributes,{'tableName':_0xa6d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 962f836..933c28d 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 _0x373d=['VtigerAccount','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetVtigerAccount'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0x373d,0x1e2));var _0xd373=function(_0x27fdf9,_0x2ea7bd){_0x27fdf9=_0x27fdf9-0x0;var _0x13a909=_0x373d[_0x27fdf9];return _0x13a909;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var moment=require(_0xd373('0x1'));var BPromise=require(_0xd373('0x2'));var rs=require(_0xd373('0x3'));var fs=require('fs');var Redis=require(_0xd373('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x8')][_0xd373('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446be6,_0x4008c5,_0x48d977){return new BPromise(function(_0xe79819,_0x51c074){return client['request'](_0x446be6,_0x48d977)['then'](function(_0x14472a){logger[_0xd373('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0xd373('0xb'));logger[_0xd373('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4008c5,'request\x20sent',JSON[_0xd373('0xd')](_0x14472a));if(_0x14472a[_0xd373('0xe')]){if(_0x14472a[_0xd373('0xe')][_0xd373('0xf')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0x14472a['error'][_0xd373('0x10')]);return _0x51c074(_0x14472a[_0xd373('0xe')]['message']);}logger[_0xd373('0xe')](_0xd373('0x11'),_0x4008c5,_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);return _0xe79819(_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);}else{logger[_0xd373('0xa')](_0xd373('0x11'),_0x4008c5,_0xd373('0xb'));_0xe79819(_0x14472a[_0xd373('0x12')][_0xd373('0x10')]);}})[_0xd373('0x13')](function(_0x1921dd){logger['error'](_0xd373('0x11'),_0x4008c5,_0x1921dd);_0x51c074(_0x1921dd);});});}exports['GetVtigerAccount']=function(_0x460259){var _0x36d47a=this;return new Promise(function(_0x55c5c7,_0x1bbdbd){return db['VtigerAccount']['findAll']({'raw':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x15')]===undefined?!![]:![]:!![],'where':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0x460259['options']?_0x460259[_0xd373('0x14')][_0xd373('0x17')]||null:null,'limit':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x18')]||null:null,'include':_0x460259[_0xd373('0x14')]?_0x460259['options'][_0xd373('0x19')]?_[_0xd373('0x1a')](_0x460259[_0xd373('0x14')][_0xd373('0x19')],function(_0x217ee7){return{'model':db[_0x217ee7[_0xd373('0x1b')]],'as':_0x217ee7['as'],'attributes':_0x217ee7[_0xd373('0x17')],'include':_0x217ee7[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x217ee7[_0xd373('0x19')],function(_0x437110){return{'model':db[_0x437110[_0xd373('0x1b')]],'as':_0x437110['as'],'attributes':_0x437110[_0xd373('0x17')],'include':_0x437110[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x437110[_0xd373('0x19')],function(_0x50b987){return{'model':db[_0x50b987[_0xd373('0x1b')]],'as':_0x50b987['as'],'attributes':_0x50b987[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x45ee58){logger[_0xd373('0xa')](_0xd373('0x1d'),_0x460259);logger[_0xd373('0xc')](_0xd373('0x1d'),_0x460259,JSON[_0xd373('0xd')](_0x45ee58));_0x55c5c7(_0x45ee58);})[_0xd373('0x13')](function(_0xbc420b){logger[_0xd373('0xe')](_0xd373('0x1d'),_0xbc420b['message'],_0x460259);_0x1bbdbd(_0x36d47a[_0xd373('0xe')](0x1f4,_0xbc420b['message']));});});};exports['ShowVtigerAccount']=function(_0xedc8f3){var _0x15da6c=this;return new Promise(function(_0x25e016,_0x23024c){return db[_0xd373('0x1e')]['find']({'raw':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x17')]||null:null,'include':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')]?_['map'](_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')],function(_0x420c73){return{'model':db[_0x420c73[_0xd373('0x1b')]],'as':_0x420c73['as'],'attributes':_0x420c73[_0xd373('0x17')],'include':_0x420c73[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x420c73[_0xd373('0x19')],function(_0xaa62aa){return{'model':db[_0xaa62aa[_0xd373('0x1b')]],'as':_0xaa62aa['as'],'attributes':_0xaa62aa[_0xd373('0x17')],'include':_0xaa62aa[_0xd373('0x19')]?_[_0xd373('0x1a')](_0xaa62aa[_0xd373('0x19')],function(_0x22429c){return{'model':db[_0x22429c['model']],'as':_0x22429c['as'],'attributes':_0x22429c[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x186e39){logger[_0xd373('0xa')]('ShowVtigerAccount',_0xedc8f3);logger[_0xd373('0xc')](_0xd373('0x1f'),_0xedc8f3,JSON[_0xd373('0xd')](_0x186e39));_0x25e016(_0x186e39);})[_0xd373('0x13')](function(_0x38d8ec){logger[_0xd373('0xe')]('ShowVtigerAccount',_0x38d8ec['message'],_0xedc8f3);_0x23024c(_0x15da6c[_0xd373('0xe')](0x1f4,_0x38d8ec['message']));});});}; \ No newline at end of file +var _0xe511=['find','attributes','ShowVtigerAccount','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','options','raw','where','include','map','model','then'];(function(_0x3360f3,_0x344f01){var _0x45e856=function(_0x588d0c){while(--_0x588d0c){_0x3360f3['push'](_0x3360f3['shift']());}};_0x45e856(++_0x344f01);}(_0xe511,0x16f));var _0x1e51=function(_0x5440e5,_0x56fac9){_0x5440e5=_0x5440e5-0x0;var _0x6c5beb=_0xe511[_0x5440e5];return _0x6c5beb;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['findAll']({'raw':_0x27dcad[_0x1e51('0x16')]?_0x27dcad['options'][_0x1e51('0x17')]===undefined?!![]:![]:!![],'where':_0x27dcad[_0x1e51('0x16')]?_0x27dcad[_0x1e51('0x16')][_0x1e51('0x18')]||null:null,'attributes':_0x27dcad['options']?_0x27dcad['options']['attributes']||null:null,'limit':_0x27dcad['options']?_0x27dcad[_0x1e51('0x16')]['limit']||null:null,'include':_0x27dcad[_0x1e51('0x16')]?_0x27dcad[_0x1e51('0x16')][_0x1e51('0x19')]?_[_0x1e51('0x1a')](_0x27dcad[_0x1e51('0x16')][_0x1e51('0x19')],function(_0x270adf){return{'model':db[_0x270adf[_0x1e51('0x1b')]],'as':_0x270adf['as'],'attributes':_0x270adf['attributes'],'include':_0x270adf['include']?_[_0x1e51('0x1a')](_0x270adf[_0x1e51('0x19')],function(_0x2e42b1){return{'model':db[_0x2e42b1[_0x1e51('0x1b')]],'as':_0x2e42b1['as'],'attributes':_0x2e42b1['attributes'],'include':_0x2e42b1['include']?_['map'](_0x2e42b1[_0x1e51('0x19')],function(_0x2a1561){return{'model':db[_0x2a1561[_0x1e51('0x1b')]],'as':_0x2a1561['as'],'attributes':_0x2a1561['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e51('0x1c')](function(_0x49c507){logger['info'](_0x1e51('0x14'),_0x27dcad);logger['debug'](_0x1e51('0x14'),_0x27dcad,JSON[_0x1e51('0xf')](_0x49c507));_0x4785a5(_0x49c507);})['catch'](function(_0x3e6ef2){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3e6ef2[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c['error'](0x1f4,_0x3e6ef2['message']));});});};exports['ShowVtigerAccount']=function(_0x20eb9b){var _0x288b50=this;return new Promise(function(_0x1ba84a,_0x36dabe){return db[_0x1e51('0x15')][_0x1e51('0x1d')]({'raw':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')][_0x1e51('0x17')]===undefined?!![]:![]:!![],'where':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')]['where']||null:null,'attributes':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')][_0x1e51('0x1e')]||null:null,'include':_0x20eb9b[_0x1e51('0x16')]?_0x20eb9b[_0x1e51('0x16')]['include']?_[_0x1e51('0x1a')](_0x20eb9b['options'][_0x1e51('0x19')],function(_0x3fb57e){return{'model':db[_0x3fb57e[_0x1e51('0x1b')]],'as':_0x3fb57e['as'],'attributes':_0x3fb57e['attributes'],'include':_0x3fb57e[_0x1e51('0x19')]?_['map'](_0x3fb57e[_0x1e51('0x19')],function(_0x4e0187){return{'model':db[_0x4e0187['model']],'as':_0x4e0187['as'],'attributes':_0x4e0187[_0x1e51('0x1e')],'include':_0x4e0187[_0x1e51('0x19')]?_[_0x1e51('0x1a')](_0x4e0187['include'],function(_0x42ac30){return{'model':db[_0x42ac30['model']],'as':_0x42ac30['as'],'attributes':_0x42ac30[_0x1e51('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1e51('0x1c')](function(_0x5760ba){logger[_0x1e51('0xa')](_0x1e51('0x1f'),_0x20eb9b);logger[_0x1e51('0xd')](_0x1e51('0x1f'),_0x20eb9b,JSON[_0x1e51('0xf')](_0x5760ba));_0x1ba84a(_0x5760ba);})[_0x1e51('0x20')](function(_0x5c57a6){logger['error'](_0x1e51('0x1f'),_0x5c57a6['message'],_0x20eb9b);_0x36dabe(_0x288b50[_0x1e51('0x10')](0x1f4,_0x5c57a6[_0x1e51('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9ec864c..99f85c8 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 _0x523c=['isAuthenticated','index','get','/:id','show','getSubjects','/:id/descriptions','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x406d39,_0xd3c8f1){var _0x2eb792=function(_0x572291){while(--_0x572291){_0x406d39['push'](_0x406d39['shift']());}};_0x2eb792(++_0xd3c8f1);}(_0x523c,0x1db));var _0xc523=function(_0x225d28,_0x23c2c4){_0x225d28=_0x225d28-0x0;var _0x599ecd=_0x523c[_0x225d28];return _0x599ecd;};'use strict';var multer=require(_0xc523('0x0'));var util=require(_0xc523('0x1'));var path=require(_0xc523('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc523('0x3')]();var fs_extra=require(_0xc523('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc523('0x5'));var config=require(_0xc523('0x6'));var controller=require(_0xc523('0x7'));router['get']('/',auth[_0xc523('0x8')](),controller[_0xc523('0x9')]);router[_0xc523('0xa')](_0xc523('0xb'),auth['isAuthenticated'](),controller[_0xc523('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0xc523('0x8')](),controller[_0xc523('0xd')]);router[_0xc523('0xa')](_0xc523('0xe'),auth[_0xc523('0x8')](),controller['getDescriptions']);router[_0xc523('0xf')]('/',auth[_0xc523('0x8')](),controller[_0xc523('0x10')]);router[_0xc523('0x11')]('/:id',auth[_0xc523('0x8')](),controller[_0xc523('0x12')]);router[_0xc523('0x13')](_0xc523('0xb'),auth[_0xc523('0x8')](),controller['destroy']);module[_0xc523('0x14')]=router; \ No newline at end of file +var _0xed9f=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x1ee1ff,_0x2e7079){var _0x106003=function(_0x1347bc){while(--_0x1347bc){_0x1ee1ff['push'](_0x1ee1ff['shift']());}};_0x106003(++_0x2e7079);}(_0xed9f,0x191));var _0xfed9=function(_0x5c4178,_0x11471c){_0x5c4178=_0x5c4178-0x0;var _0x384e71=_0xed9f[_0x5c4178];return _0x384e71;};'use strict';var multer=require(_0xfed9('0x0'));var util=require('util');var path=require(_0xfed9('0x1'));var timeout=require(_0xfed9('0x2'));var express=require(_0xfed9('0x3'));var router=express[_0xfed9('0x4')]();var fs_extra=require(_0xfed9('0x5'));var auth=require(_0xfed9('0x6'));var interaction=require(_0xfed9('0x7'));var config=require(_0xfed9('0x8'));var controller=require(_0xfed9('0x9'));router['get']('/',auth[_0xfed9('0xa')](),controller[_0xfed9('0xb')]);router[_0xfed9('0xc')](_0xfed9('0xd'),auth[_0xfed9('0xa')](),controller[_0xfed9('0xe')]);router['get'](_0xfed9('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xfed9('0xc')](_0xfed9('0x10'),auth[_0xfed9('0xa')](),controller['getSubjects']);router[_0xfed9('0xc')](_0xfed9('0x11'),auth[_0xfed9('0xa')](),controller[_0xfed9('0x12')]);router[_0xfed9('0x13')]('/',auth[_0xfed9('0xa')](),controller[_0xfed9('0x14')]);router[_0xfed9('0x15')]('/:id',auth[_0xfed9('0xa')](),controller[_0xfed9('0x16')]);router[_0xfed9('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xfed9('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7c23bd0..866dba2 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 _0xcbed=['STRING','sequelize'];(function(_0x7b7b9d,_0x2bda49){var _0x523496=function(_0x562a70){while(--_0x562a70){_0x7b7b9d['push'](_0x7b7b9d['shift']());}};_0x523496(++_0x2bda49);}(_0xcbed,0x187));var _0xdcbe=function(_0x5d49d8,_0x735b38){_0x5d49d8=_0x5d49d8-0x0;var _0x41afa6=_0xcbed[_0x5d49d8];return _0x41afa6;};'use strict';var Sequelize=require(_0xdcbe('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdcbe('0x1')]}}; \ No newline at end of file +var _0x11c9=['sequelize','exports','STRING'];(function(_0xe1ae98,_0x20d529){var _0x2e0255=function(_0x39f7d7){while(--_0x39f7d7){_0xe1ae98['push'](_0xe1ae98['shift']());}};_0x2e0255(++_0x20d529);}(_0x11c9,0x1e3));var _0x911c=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x11c9[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0x911c('0x0'));module[_0x911c('0x1')]={'name':{'type':Sequelize[_0x911c('0x2')]},'description':{'type':Sequelize[_0x911c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index c3659e1..6542087 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 _0x05b0=['options','includeAll','include','rows','catch','show','params','model','length','body','find','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x53ef6a,_0xa3df06){var _0x4749f0=function(_0x1f12df){while(--_0x1f12df){_0x53ef6a['push'](_0x53ef6a['shift']());}};_0x4749f0(++_0xa3df06);}(_0x05b0,0x188));var _0x005b=function(_0x18d864,_0x625694){_0x18d864=_0x18d864-0x0;var _0x504046=_0x05b0[_0x18d864];return _0x504046;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];function respondWithStatusCode(_0x10f9bb,_0xce7212){_0xce7212=_0xce7212||0xcc;return function(_0xe2674e){if(_0xe2674e){return _0x10f9bb[_0x005b('0x14')](_0xce7212);}return _0x10f9bb['status'](_0xce7212)['end']();};}function respondWithResult(_0x52ad9c,_0x309c8f){_0x309c8f=_0x309c8f||0xc8;return function(_0x50b7ce){if(_0x50b7ce){return _0x52ad9c[_0x005b('0x15')](_0x309c8f)['json'](_0x50b7ce);}};}function respondWithFilteredResult(_0x1c8eed,_0x1f7743){return function(_0x2ce01e){if(_0x2ce01e){var _0x1991e8=typeof _0x1f7743[_0x005b('0x16')]==='undefined'&&typeof _0x1f7743[_0x005b('0x17')]===_0x005b('0x18');var _0xf3cf84=_0x2ce01e['count'];var _0x206c0a=_0x1991e8?0x0:_0x1f7743[_0x005b('0x16')];var _0x50a6eb=_0x1991e8?_0x2ce01e[_0x005b('0x19')]:_0x1f7743[_0x005b('0x16')]+_0x1f7743[_0x005b('0x17')];var _0x434874;if(_0x50a6eb>=_0xf3cf84){_0x50a6eb=_0xf3cf84;_0x434874=0xc8;}else{_0x434874=0xce;}_0x1c8eed[_0x005b('0x15')](_0x434874);return _0x1c8eed['set'](_0x005b('0x1a'),_0x206c0a+'-'+_0x50a6eb+'/'+_0xf3cf84)[_0x005b('0x1b')](_0x2ce01e);}return null;};}function patchUpdates(_0x4ae164){return function(_0x24637d){try{jsonpatch[_0x005b('0x1c')](_0x24637d,_0x4ae164,!![]);}catch(_0xd97375){return BPromise['reject'](_0xd97375);}return _0x24637d[_0x005b('0x1d')]();};}function saveUpdates(_0x145c36,_0x319981){return function(_0x3521c9){if(_0x3521c9){return _0x3521c9[_0x005b('0x1e')](_0x145c36)[_0x005b('0x1f')](function(_0x4f632f){return _0x4f632f;});}return null;};}function removeEntity(_0x322229,_0x169428){return function(_0x1fef26){if(_0x1fef26){return _0x1fef26['destroy']()[_0x005b('0x1f')](function(){_0x322229['status'](0xcc)[_0x005b('0x20')]();});}};}function handleEntityNotFound(_0x527294,_0x542fa2){return function(_0x2dc341){if(!_0x2dc341){_0x527294[_0x005b('0x14')](0x194);}return _0x2dc341;};}function handleError(_0x3effd5,_0x267f10){_0x267f10=_0x267f10||0x1f4;return function(_0x6730d4){logger[_0x005b('0x21')](_0x6730d4[_0x005b('0x22')]);if(_0x6730d4[_0x005b('0x23')]){delete _0x6730d4['name'];}_0x3effd5[_0x005b('0x15')](_0x267f10)[_0x005b('0x24')](_0x6730d4);};}exports[_0x005b('0x25')]=function(_0x13e834,_0x2e92d1){var _0x1d8f93={},_0x4775a2={},_0x49561a={'count':0x0,'rows':[]};var _0xaf7c71=_[_0x005b('0x26')](db[_0x005b('0x27')][_0x005b('0x28')],function(_0x545a2b){return{'name':_0x545a2b['fieldName'],'type':_0x545a2b[_0x005b('0x29')][_0x005b('0x2a')]};});_0x4775a2['model']=_['map'](_0xaf7c71,_0x005b('0x23'));_0x4775a2['query']=_[_0x005b('0x2b')](_0x13e834[_0x005b('0x2c')]);_0x4775a2[_0x005b('0x2d')]=_['intersection'](_0x4775a2['model'],_0x4775a2[_0x005b('0x2c')]);_0x1d8f93[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x4775a2['model'],qs['fields'](_0x13e834[_0x005b('0x2c')][_0x005b('0x30')]));_0x1d8f93['attributes']=_0x1d8f93[_0x005b('0x2e')]['length']?_0x1d8f93[_0x005b('0x2e')]:_0x4775a2['model'];if(!_0x13e834['query'][_0x005b('0x31')](_0x005b('0x32'))){_0x1d8f93[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x13e834[_0x005b('0x2c')]['limit']);_0x1d8f93['offset']=qs[_0x005b('0x16')](_0x13e834[_0x005b('0x2c')][_0x005b('0x16')]);}_0x1d8f93[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x13e834[_0x005b('0x2c')]['sort']);_0x1d8f93[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x13e834['query'],_0x4775a2[_0x005b('0x2d')]),_0xaf7c71);if(_0x13e834[_0x005b('0x2c')][_0x005b('0x37')]){_0x1d8f93[_0x005b('0x35')]=_[_0x005b('0x38')](_0x1d8f93[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0xaf7c71,function(_0x9f4d6){if(_0x9f4d6[_0x005b('0x29')]!==_0x005b('0x39')){var _0x4d6064={};_0x4d6064[_0x9f4d6[_0x005b('0x23')]]={'$like':'%'+_0x13e834[_0x005b('0x2c')]['filter']+'%'};return _0x4d6064;}})});}_0x1d8f93=_[_0x005b('0x38')]({},_0x1d8f93,_0x13e834[_0x005b('0x3a')]);var _0x1f29de={'where':_0x1d8f93[_0x005b('0x35')]};return db['VtigerConfiguration'][_0x005b('0x19')](_0x1f29de)[_0x005b('0x1f')](function(_0x4b0a10){_0x49561a[_0x005b('0x19')]=_0x4b0a10;if(_0x13e834[_0x005b('0x2c')][_0x005b('0x3b')]){_0x1d8f93[_0x005b('0x3c')]=[{'all':!![]}];}return db[_0x005b('0x27')]['findAll'](_0x1d8f93);})['then'](function(_0x1dfe28){_0x49561a[_0x005b('0x3d')]=_0x1dfe28;return _0x49561a;})[_0x005b('0x1f')](respondWithFilteredResult(_0x2e92d1,_0x1d8f93))[_0x005b('0x3e')](handleError(_0x2e92d1,null));};exports[_0x005b('0x3f')]=function(_0x59fefd,_0x182e3a){var _0x14bd15={'raw':![],'where':{'id':_0x59fefd[_0x005b('0x40')]['id']}},_0x2bbb8a={};_0x2bbb8a[_0x005b('0x41')]=_[_0x005b('0x2b')](db['VtigerConfiguration'][_0x005b('0x28')]);_0x2bbb8a['query']=_[_0x005b('0x2b')](_0x59fefd[_0x005b('0x2c')]);_0x2bbb8a['filters']=_[_0x005b('0x2f')](_0x2bbb8a[_0x005b('0x41')],_0x2bbb8a[_0x005b('0x2c')]);_0x14bd15[_0x005b('0x2e')]=_['intersection'](_0x2bbb8a[_0x005b('0x41')],qs[_0x005b('0x30')](_0x59fefd[_0x005b('0x2c')][_0x005b('0x30')]));_0x14bd15[_0x005b('0x2e')]=_0x14bd15[_0x005b('0x2e')][_0x005b('0x42')]?_0x14bd15[_0x005b('0x2e')]:_0x2bbb8a[_0x005b('0x41')];if(_0x59fefd['query'][_0x005b('0x3b')]){_0x14bd15[_0x005b('0x3c')]=[{'all':!![]}];}_0x14bd15=_[_0x005b('0x38')]({},_0x14bd15,_0x59fefd[_0x005b('0x3a')]);return db[_0x005b('0x27')]['find'](_0x14bd15)[_0x005b('0x1f')](handleEntityNotFound(_0x182e3a,null))[_0x005b('0x1f')](respondWithResult(_0x182e3a,null))[_0x005b('0x3e')](handleError(_0x182e3a,null));};exports['create']=function(_0x10a141,_0x50d178){return db['VtigerConfiguration']['create'](_0x10a141['body'],{})[_0x005b('0x1f')](respondWithResult(_0x50d178,0xc9))[_0x005b('0x3e')](handleError(_0x50d178,null));};exports[_0x005b('0x1e')]=function(_0xb1898,_0x4e19cd){if(_0xb1898[_0x005b('0x43')]['id']){delete _0xb1898[_0x005b('0x43')]['id'];}return db['VtigerConfiguration'][_0x005b('0x44')]({'where':{'id':_0xb1898[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4e19cd,null))[_0x005b('0x1f')](saveUpdates(_0xb1898[_0x005b('0x43')],null))['then'](respondWithResult(_0x4e19cd,null))[_0x005b('0x3e')](handleError(_0x4e19cd,null));};exports[_0x005b('0x45')]=function(_0x2aebe9,_0x11dc21){return db[_0x005b('0x27')][_0x005b('0x44')]({'where':{'id':_0x2aebe9['params']['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x11dc21,null))[_0x005b('0x1f')](removeEntity(_0x11dc21,null))[_0x005b('0x3e')](handleError(_0x11dc21,null));};exports[_0x005b('0x46')]=function(_0x288935,_0x1be7c2,_0x4c6eb0){var _0x2f5096={};var _0x13a680={};var _0x5cea23;var _0x5bbc78;return db[_0x005b('0x27')][_0x005b('0x47')]({'where':{'id':_0x288935[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x1be7c2,null))[_0x005b('0x1f')](function(_0x224143){if(_0x224143){_0x5cea23=_0x224143;_0x13a680[_0x005b('0x41')]=_['keys'](db[_0x005b('0x48')]['rawAttributes']);_0x13a680['query']=_[_0x005b('0x2b')](_0x288935[_0x005b('0x2c')]);_0x13a680[_0x005b('0x2d')]=_['intersection'](_0x13a680[_0x005b('0x41')],_0x13a680[_0x005b('0x2c')]);_0x2f5096[_0x005b('0x2e')]=_['intersection'](_0x13a680[_0x005b('0x41')],qs['fields'](_0x288935[_0x005b('0x2c')][_0x005b('0x30')]));_0x2f5096['attributes']=_0x2f5096[_0x005b('0x2e')][_0x005b('0x42')]?_0x2f5096[_0x005b('0x2e')]:_0x13a680[_0x005b('0x41')];_0x2f5096[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x288935['query'][_0x005b('0x34')]);_0x2f5096[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x288935[_0x005b('0x2c')],_0x13a680[_0x005b('0x2d')]));if(_0x288935['query'][_0x005b('0x37')]){_0x2f5096['where']=_[_0x005b('0x38')](_0x2f5096[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0x2f5096[_0x005b('0x2e')],function(_0x31e6f5){var _0x2ee675={};_0x2ee675[_0x31e6f5]={'$like':'%'+_0x288935[_0x005b('0x2c')][_0x005b('0x37')]+'%'};return _0x2ee675;})});}_0x2f5096=_[_0x005b('0x38')]({},_0x2f5096,_0x288935[_0x005b('0x3a')]);return _0x5cea23[_0x005b('0x46')](_0x2f5096);}})[_0x005b('0x1f')](function(_0x303621){if(_0x303621){_0x5bbc78=_0x303621[_0x005b('0x42')];if(!_0x288935[_0x005b('0x2c')]['hasOwnProperty'](_0x005b('0x32'))){_0x2f5096[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x288935[_0x005b('0x2c')][_0x005b('0x17')]);_0x2f5096[_0x005b('0x16')]=qs[_0x005b('0x16')](_0x288935['query'][_0x005b('0x16')]);}return _0x5cea23['getFields'](_0x2f5096);}})[_0x005b('0x1f')](function(_0x4bd368){if(_0x4bd368){return _0x4bd368?{'count':_0x5bbc78,'rows':_0x4bd368}:null;}})[_0x005b('0x1f')](respondWithResult(_0x1be7c2,null))[_0x005b('0x3e')](handleError(_0x1be7c2,null));};exports['getSubjects']=function(_0x30a886,_0x275094,_0x10d9d2){var _0x2b7f3e={};var _0x2d3aeb={};var _0x6fc481;var _0x4729aa;return db[_0x005b('0x27')][_0x005b('0x47')]({'where':{'id':_0x30a886[_0x005b('0x40')]['id']}})['then'](handleEntityNotFound(_0x275094,null))['then'](function(_0xb96c87){if(_0xb96c87){_0x6fc481=_0xb96c87;_0x2d3aeb[_0x005b('0x41')]=_[_0x005b('0x2b')](db[_0x005b('0x48')][_0x005b('0x28')]);_0x2d3aeb[_0x005b('0x2c')]=_[_0x005b('0x2b')](_0x30a886[_0x005b('0x2c')]);_0x2d3aeb[_0x005b('0x2d')]=_[_0x005b('0x2f')](_0x2d3aeb[_0x005b('0x41')],_0x2d3aeb[_0x005b('0x2c')]);_0x2b7f3e[_0x005b('0x2e')]=_['intersection'](_0x2d3aeb[_0x005b('0x41')],qs[_0x005b('0x30')](_0x30a886['query'][_0x005b('0x30')]));_0x2b7f3e[_0x005b('0x2e')]=_0x2b7f3e[_0x005b('0x2e')][_0x005b('0x42')]?_0x2b7f3e[_0x005b('0x2e')]:_0x2d3aeb[_0x005b('0x41')];_0x2b7f3e[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x30a886[_0x005b('0x2c')]['sort']);_0x2b7f3e[_0x005b('0x35')]=qs[_0x005b('0x2d')](_[_0x005b('0x36')](_0x30a886[_0x005b('0x2c')],_0x2d3aeb[_0x005b('0x2d')]));if(_0x30a886[_0x005b('0x2c')][_0x005b('0x37')]){_0x2b7f3e[_0x005b('0x35')]=_[_0x005b('0x38')](_0x2b7f3e[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0x2b7f3e[_0x005b('0x2e')],function(_0x287924){var _0x5f2ef1={};_0x5f2ef1[_0x287924]={'$like':'%'+_0x30a886[_0x005b('0x2c')]['filter']+'%'};return _0x5f2ef1;})});}_0x2b7f3e=_[_0x005b('0x38')]({},_0x2b7f3e,_0x30a886['options']);return _0x6fc481[_0x005b('0x49')](_0x2b7f3e);}})[_0x005b('0x1f')](function(_0x38ff2b){if(_0x38ff2b){_0x4729aa=_0x38ff2b[_0x005b('0x42')];if(!_0x30a886[_0x005b('0x2c')][_0x005b('0x31')](_0x005b('0x32'))){_0x2b7f3e['limit']=qs['limit'](_0x30a886[_0x005b('0x2c')][_0x005b('0x17')]);_0x2b7f3e['offset']=qs[_0x005b('0x16')](_0x30a886[_0x005b('0x2c')]['offset']);}return _0x6fc481[_0x005b('0x49')](_0x2b7f3e);}})['then'](function(_0x46e257){if(_0x46e257){return _0x46e257?{'count':_0x4729aa,'rows':_0x46e257}:null;}})['then'](respondWithResult(_0x275094,null))[_0x005b('0x3e')](handleError(_0x275094,null));};exports[_0x005b('0x4a')]=function(_0x4a68b6,_0x21f97a,_0x1db928){var _0x1cd0b6={};var _0x3eacfe={};var _0x1b3d90;var _0x2ac534;return db[_0x005b('0x27')]['findOne']({'where':{'id':_0x4a68b6[_0x005b('0x40')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x21f97a,null))[_0x005b('0x1f')](function(_0xd9eb57){if(_0xd9eb57){_0x1b3d90=_0xd9eb57;_0x3eacfe[_0x005b('0x41')]=_[_0x005b('0x2b')](db[_0x005b('0x48')][_0x005b('0x28')]);_0x3eacfe[_0x005b('0x2c')]=_[_0x005b('0x2b')](_0x4a68b6[_0x005b('0x2c')]);_0x3eacfe[_0x005b('0x2d')]=_[_0x005b('0x2f')](_0x3eacfe[_0x005b('0x41')],_0x3eacfe['query']);_0x1cd0b6['attributes']=_[_0x005b('0x2f')](_0x3eacfe[_0x005b('0x41')],qs['fields'](_0x4a68b6['query'][_0x005b('0x30')]));_0x1cd0b6[_0x005b('0x2e')]=_0x1cd0b6[_0x005b('0x2e')][_0x005b('0x42')]?_0x1cd0b6[_0x005b('0x2e')]:_0x3eacfe[_0x005b('0x41')];_0x1cd0b6[_0x005b('0x33')]=qs[_0x005b('0x34')](_0x4a68b6[_0x005b('0x2c')][_0x005b('0x34')]);_0x1cd0b6['where']=qs[_0x005b('0x2d')](_['pick'](_0x4a68b6[_0x005b('0x2c')],_0x3eacfe[_0x005b('0x2d')]));if(_0x4a68b6[_0x005b('0x2c')]['filter']){_0x1cd0b6[_0x005b('0x35')]=_[_0x005b('0x38')](_0x1cd0b6[_0x005b('0x35')],{'$or':_[_0x005b('0x26')](_0x1cd0b6[_0x005b('0x2e')],function(_0x3433f9){var _0x44dd54={};_0x44dd54[_0x3433f9]={'$like':'%'+_0x4a68b6['query'][_0x005b('0x37')]+'%'};return _0x44dd54;})});}_0x1cd0b6=_['merge']({},_0x1cd0b6,_0x4a68b6[_0x005b('0x3a')]);return _0x1b3d90[_0x005b('0x4a')](_0x1cd0b6);}})['then'](function(_0x2de5b6){if(_0x2de5b6){_0x2ac534=_0x2de5b6[_0x005b('0x42')];if(!_0x4a68b6[_0x005b('0x2c')][_0x005b('0x31')](_0x005b('0x32'))){_0x1cd0b6[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x4a68b6[_0x005b('0x2c')][_0x005b('0x17')]);_0x1cd0b6[_0x005b('0x16')]=qs[_0x005b('0x16')](_0x4a68b6[_0x005b('0x2c')]['offset']);}return _0x1b3d90[_0x005b('0x4a')](_0x1cd0b6);}})[_0x005b('0x1f')](function(_0x34c2ff){if(_0x34c2ff){return _0x34c2ff?{'count':_0x2ac534,'rows':_0x34c2ff}:null;}})[_0x005b('0x1f')](respondWithResult(_0x21f97a,null))[_0x005b('0x3e')](handleError(_0x21f97a,null));}; \ No newline at end of file +var _0xc474=['moment','util','path','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','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','name','index','map','VtigerConfiguration','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','keys','rawAttributes','create','body','find','params','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','request-promise'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xc474,0x174));var _0x4c47=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xc474[_0x5f3f88];return _0xd08119;};'use strict';var emlformat=require(_0x4c47('0x0'));var rimraf=require(_0x4c47('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4c47('0x2'));var moment=require(_0x4c47('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4c47('0x4'));var path=require(_0x4c47('0x5'));var sox=require('sox');var csv=require(_0x4c47('0x6'));var ejs=require(_0x4c47('0x7'));var fs=require('fs');var fs_extra=require(_0x4c47('0x8'));var _=require(_0x4c47('0x9'));var squel=require(_0x4c47('0xa'));var crypto=require(_0x4c47('0xb'));var jsforce=require(_0x4c47('0xc'));var deskjs=require(_0x4c47('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4c47('0xe'));var Redis=require(_0x4c47('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4c47('0x10'));var as=require(_0x4c47('0x11'));var hardwareService=require(_0x4c47('0x12'));var logger=require('../../config/logger')(_0x4c47('0x13'));var utils=require(_0x4c47('0x14'));var config=require(_0x4c47('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5de2a3,_0x59a1e0){_0x59a1e0=_0x59a1e0||0xcc;return function(_0x2a33fa){if(_0x2a33fa){return _0x5de2a3[_0x4c47('0x16')](_0x59a1e0);}return _0x5de2a3[_0x4c47('0x17')](_0x59a1e0)[_0x4c47('0x18')]();};}function respondWithResult(_0x4a83ac,_0x18e897){_0x18e897=_0x18e897||0xc8;return function(_0xfe8d43){if(_0xfe8d43){return _0x4a83ac[_0x4c47('0x17')](_0x18e897)[_0x4c47('0x19')](_0xfe8d43);}};}function respondWithFilteredResult(_0x21e834,_0x416851){return function(_0x50fbac){if(_0x50fbac){var _0x35b949=typeof _0x416851[_0x4c47('0x1a')]===_0x4c47('0x1b')&&typeof _0x416851['limit']===_0x4c47('0x1b');var _0x4daafb=_0x50fbac[_0x4c47('0x1c')];var _0x92aea2=_0x35b949?0x0:_0x416851[_0x4c47('0x1a')];var _0x48047f=_0x35b949?_0x50fbac[_0x4c47('0x1c')]:_0x416851[_0x4c47('0x1a')]+_0x416851['limit'];var _0x36dd4e;if(_0x48047f>=_0x4daafb){_0x48047f=_0x4daafb;_0x36dd4e=0xc8;}else{_0x36dd4e=0xce;}_0x21e834[_0x4c47('0x17')](_0x36dd4e);return _0x21e834[_0x4c47('0x1d')](_0x4c47('0x1e'),_0x92aea2+'-'+_0x48047f+'/'+_0x4daafb)[_0x4c47('0x19')](_0x50fbac);}return null;};}function patchUpdates(_0x342453){return function(_0x26315f){try{jsonpatch[_0x4c47('0x1f')](_0x26315f,_0x342453,!![]);}catch(_0x3dd6b1){return BPromise['reject'](_0x3dd6b1);}return _0x26315f['save']();};}function saveUpdates(_0x5a7f13,_0x1c162d){return function(_0x2884b4){if(_0x2884b4){return _0x2884b4[_0x4c47('0x20')](_0x5a7f13)[_0x4c47('0x21')](function(_0x3bcec2){return _0x3bcec2;});}return null;};}function removeEntity(_0xd238e8,_0x331614){return function(_0x3b6db7){if(_0x3b6db7){return _0x3b6db7[_0x4c47('0x22')]()['then'](function(){_0xd238e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x414977,_0x20e450){return function(_0x1cf25a){if(!_0x1cf25a){_0x414977[_0x4c47('0x16')](0x194);}return _0x1cf25a;};}function handleError(_0x1c5a24,_0x4d2d99){_0x4d2d99=_0x4d2d99||0x1f4;return function(_0x3449be){logger['error'](_0x3449be['stack']);if(_0x3449be[_0x4c47('0x23')]){delete _0x3449be[_0x4c47('0x23')];}_0x1c5a24['status'](_0x4d2d99)['send'](_0x3449be);};}exports[_0x4c47('0x24')]=function(_0x18f71a,_0xac33c5){var _0x3ca24a={},_0x207692={},_0x1904f8={'count':0x0,'rows':[]};var _0x399f54=_[_0x4c47('0x25')](db[_0x4c47('0x26')]['rawAttributes'],function(_0x2bb19c){return{'name':_0x2bb19c[_0x4c47('0x27')],'type':_0x2bb19c[_0x4c47('0x28')][_0x4c47('0x29')]};});_0x207692['model']=_[_0x4c47('0x25')](_0x399f54,'name');_0x207692['query']=_['keys'](_0x18f71a[_0x4c47('0x2a')]);_0x207692[_0x4c47('0x2b')]=_[_0x4c47('0x2c')](_0x207692[_0x4c47('0x2d')],_0x207692['query']);_0x3ca24a[_0x4c47('0x2e')]=_[_0x4c47('0x2c')](_0x207692[_0x4c47('0x2d')],qs['fields'](_0x18f71a[_0x4c47('0x2a')][_0x4c47('0x2f')]));_0x3ca24a[_0x4c47('0x2e')]=_0x3ca24a[_0x4c47('0x2e')][_0x4c47('0x30')]?_0x3ca24a[_0x4c47('0x2e')]:_0x207692[_0x4c47('0x2d')];if(!_0x18f71a[_0x4c47('0x2a')][_0x4c47('0x31')](_0x4c47('0x32'))){_0x3ca24a[_0x4c47('0x33')]=qs[_0x4c47('0x33')](_0x18f71a[_0x4c47('0x2a')][_0x4c47('0x33')]);_0x3ca24a[_0x4c47('0x1a')]=qs['offset'](_0x18f71a[_0x4c47('0x2a')][_0x4c47('0x1a')]);}_0x3ca24a['order']=qs[_0x4c47('0x34')](_0x18f71a[_0x4c47('0x2a')]['sort']);_0x3ca24a[_0x4c47('0x35')]=qs['filters'](_[_0x4c47('0x36')](_0x18f71a[_0x4c47('0x2a')],_0x207692['filters']),_0x399f54);if(_0x18f71a[_0x4c47('0x2a')]['filter']){_0x3ca24a[_0x4c47('0x35')]=_[_0x4c47('0x37')](_0x3ca24a[_0x4c47('0x35')],{'$or':_[_0x4c47('0x25')](_0x399f54,function(_0x46d6ce){if(_0x46d6ce[_0x4c47('0x28')]!==_0x4c47('0x38')){var _0x232d33={};_0x232d33[_0x46d6ce['name']]={'$like':'%'+_0x18f71a[_0x4c47('0x2a')][_0x4c47('0x39')]+'%'};return _0x232d33;}})});}_0x3ca24a=_[_0x4c47('0x37')]({},_0x3ca24a,_0x18f71a[_0x4c47('0x3a')]);var _0x8f654a={'where':_0x3ca24a[_0x4c47('0x35')]};return db['VtigerConfiguration']['count'](_0x8f654a)['then'](function(_0xa6d44e){_0x1904f8[_0x4c47('0x1c')]=_0xa6d44e;if(_0x18f71a[_0x4c47('0x2a')]['includeAll']){_0x3ca24a[_0x4c47('0x3b')]=[{'all':!![]}];}return db[_0x4c47('0x26')]['findAll'](_0x3ca24a);})[_0x4c47('0x21')](function(_0x40f2e1){_0x1904f8[_0x4c47('0x3c')]=_0x40f2e1;return _0x1904f8;})[_0x4c47('0x21')](respondWithFilteredResult(_0xac33c5,_0x3ca24a))[_0x4c47('0x3d')](handleError(_0xac33c5,null));};exports[_0x4c47('0x3e')]=function(_0x2a3459,_0x4329d9){var _0x57ab00={'raw':![],'where':{'id':_0x2a3459['params']['id']}},_0x38c81={};_0x38c81['model']=_[_0x4c47('0x3f')](db[_0x4c47('0x26')][_0x4c47('0x40')]);_0x38c81[_0x4c47('0x2a')]=_[_0x4c47('0x3f')](_0x2a3459[_0x4c47('0x2a')]);_0x38c81['filters']=_[_0x4c47('0x2c')](_0x38c81['model'],_0x38c81[_0x4c47('0x2a')]);_0x57ab00[_0x4c47('0x2e')]=_[_0x4c47('0x2c')](_0x38c81[_0x4c47('0x2d')],qs['fields'](_0x2a3459[_0x4c47('0x2a')][_0x4c47('0x2f')]));_0x57ab00[_0x4c47('0x2e')]=_0x57ab00['attributes'][_0x4c47('0x30')]?_0x57ab00[_0x4c47('0x2e')]:_0x38c81[_0x4c47('0x2d')];if(_0x2a3459[_0x4c47('0x2a')]['includeAll']){_0x57ab00[_0x4c47('0x3b')]=[{'all':!![]}];}_0x57ab00=_['merge']({},_0x57ab00,_0x2a3459[_0x4c47('0x3a')]);return db[_0x4c47('0x26')]['find'](_0x57ab00)[_0x4c47('0x21')](handleEntityNotFound(_0x4329d9,null))[_0x4c47('0x21')](respondWithResult(_0x4329d9,null))[_0x4c47('0x3d')](handleError(_0x4329d9,null));};exports[_0x4c47('0x41')]=function(_0x49f28b,_0x4d6fbb){return db[_0x4c47('0x26')][_0x4c47('0x41')](_0x49f28b[_0x4c47('0x42')],{})['then'](respondWithResult(_0x4d6fbb,0xc9))['catch'](handleError(_0x4d6fbb,null));};exports[_0x4c47('0x20')]=function(_0x5a9004,_0x5124c3){if(_0x5a9004['body']['id']){delete _0x5a9004[_0x4c47('0x42')]['id'];}return db[_0x4c47('0x26')]['find']({'where':{'id':_0x5a9004['params']['id']}})[_0x4c47('0x21')](handleEntityNotFound(_0x5124c3,null))[_0x4c47('0x21')](saveUpdates(_0x5a9004[_0x4c47('0x42')],null))[_0x4c47('0x21')](respondWithResult(_0x5124c3,null))[_0x4c47('0x3d')](handleError(_0x5124c3,null));};exports[_0x4c47('0x22')]=function(_0xceb97d,_0x49bc97){return db[_0x4c47('0x26')][_0x4c47('0x43')]({'where':{'id':_0xceb97d[_0x4c47('0x44')]['id']}})[_0x4c47('0x21')](handleEntityNotFound(_0x49bc97,null))[_0x4c47('0x21')](removeEntity(_0x49bc97,null))[_0x4c47('0x3d')](handleError(_0x49bc97,null));};exports[_0x4c47('0x45')]=function(_0x1059b8,_0x35756c,_0x3c666f){var _0x3fc29={};var _0x52de18={};var _0x25752c;var _0x4e1ad3;return db['VtigerConfiguration'][_0x4c47('0x46')]({'where':{'id':_0x1059b8['params']['id']}})[_0x4c47('0x21')](handleEntityNotFound(_0x35756c,null))[_0x4c47('0x21')](function(_0xf46838){if(_0xf46838){_0x25752c=_0xf46838;_0x52de18[_0x4c47('0x2d')]=_[_0x4c47('0x3f')](db[_0x4c47('0x47')][_0x4c47('0x40')]);_0x52de18[_0x4c47('0x2a')]=_[_0x4c47('0x3f')](_0x1059b8['query']);_0x52de18[_0x4c47('0x2b')]=_[_0x4c47('0x2c')](_0x52de18[_0x4c47('0x2d')],_0x52de18[_0x4c47('0x2a')]);_0x3fc29[_0x4c47('0x2e')]=_[_0x4c47('0x2c')](_0x52de18[_0x4c47('0x2d')],qs[_0x4c47('0x2f')](_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x2f')]));_0x3fc29[_0x4c47('0x2e')]=_0x3fc29[_0x4c47('0x2e')][_0x4c47('0x30')]?_0x3fc29[_0x4c47('0x2e')]:_0x52de18[_0x4c47('0x2d')];_0x3fc29[_0x4c47('0x48')]=qs[_0x4c47('0x34')](_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x34')]);_0x3fc29['where']=qs[_0x4c47('0x2b')](_[_0x4c47('0x36')](_0x1059b8[_0x4c47('0x2a')],_0x52de18[_0x4c47('0x2b')]));if(_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x39')]){_0x3fc29['where']=_['merge'](_0x3fc29['where'],{'$or':_[_0x4c47('0x25')](_0x3fc29[_0x4c47('0x2e')],function(_0x5b26d5){var _0x506a28={};_0x506a28[_0x5b26d5]={'$like':'%'+_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x39')]+'%'};return _0x506a28;})});}_0x3fc29=_['merge']({},_0x3fc29,_0x1059b8[_0x4c47('0x3a')]);return _0x25752c[_0x4c47('0x45')](_0x3fc29);}})['then'](function(_0x32be2f){if(_0x32be2f){_0x4e1ad3=_0x32be2f[_0x4c47('0x30')];if(!_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x31')](_0x4c47('0x32'))){_0x3fc29[_0x4c47('0x33')]=qs['limit'](_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x33')]);_0x3fc29[_0x4c47('0x1a')]=qs[_0x4c47('0x1a')](_0x1059b8[_0x4c47('0x2a')][_0x4c47('0x1a')]);}return _0x25752c[_0x4c47('0x45')](_0x3fc29);}})[_0x4c47('0x21')](function(_0x4de003){if(_0x4de003){return _0x4de003?{'count':_0x4e1ad3,'rows':_0x4de003}:null;}})['then'](respondWithResult(_0x35756c,null))['catch'](handleError(_0x35756c,null));};exports[_0x4c47('0x49')]=function(_0x4ee57d,_0x36750b,_0x556bd5){var _0x5f53ff={};var _0xd8a93e={};var _0xfe806b;var _0x120844;return db[_0x4c47('0x26')][_0x4c47('0x46')]({'where':{'id':_0x4ee57d[_0x4c47('0x44')]['id']}})[_0x4c47('0x21')](handleEntityNotFound(_0x36750b,null))[_0x4c47('0x21')](function(_0x3d433a){if(_0x3d433a){_0xfe806b=_0x3d433a;_0xd8a93e['model']=_['keys'](db[_0x4c47('0x47')][_0x4c47('0x40')]);_0xd8a93e[_0x4c47('0x2a')]=_[_0x4c47('0x3f')](_0x4ee57d['query']);_0xd8a93e[_0x4c47('0x2b')]=_[_0x4c47('0x2c')](_0xd8a93e[_0x4c47('0x2d')],_0xd8a93e[_0x4c47('0x2a')]);_0x5f53ff[_0x4c47('0x2e')]=_[_0x4c47('0x2c')](_0xd8a93e[_0x4c47('0x2d')],qs[_0x4c47('0x2f')](_0x4ee57d[_0x4c47('0x2a')]['fields']));_0x5f53ff[_0x4c47('0x2e')]=_0x5f53ff[_0x4c47('0x2e')][_0x4c47('0x30')]?_0x5f53ff[_0x4c47('0x2e')]:_0xd8a93e[_0x4c47('0x2d')];_0x5f53ff['order']=qs[_0x4c47('0x34')](_0x4ee57d[_0x4c47('0x2a')][_0x4c47('0x34')]);_0x5f53ff['where']=qs[_0x4c47('0x2b')](_[_0x4c47('0x36')](_0x4ee57d[_0x4c47('0x2a')],_0xd8a93e['filters']));if(_0x4ee57d[_0x4c47('0x2a')][_0x4c47('0x39')]){_0x5f53ff[_0x4c47('0x35')]=_[_0x4c47('0x37')](_0x5f53ff[_0x4c47('0x35')],{'$or':_[_0x4c47('0x25')](_0x5f53ff[_0x4c47('0x2e')],function(_0x144baf){var _0x2a704={};_0x2a704[_0x144baf]={'$like':'%'+_0x4ee57d['query'][_0x4c47('0x39')]+'%'};return _0x2a704;})});}_0x5f53ff=_[_0x4c47('0x37')]({},_0x5f53ff,_0x4ee57d[_0x4c47('0x3a')]);return _0xfe806b[_0x4c47('0x49')](_0x5f53ff);}})[_0x4c47('0x21')](function(_0x47ee10){if(_0x47ee10){_0x120844=_0x47ee10['length'];if(!_0x4ee57d[_0x4c47('0x2a')]['hasOwnProperty'](_0x4c47('0x32'))){_0x5f53ff[_0x4c47('0x33')]=qs[_0x4c47('0x33')](_0x4ee57d[_0x4c47('0x2a')]['limit']);_0x5f53ff[_0x4c47('0x1a')]=qs[_0x4c47('0x1a')](_0x4ee57d[_0x4c47('0x2a')][_0x4c47('0x1a')]);}return _0xfe806b['getSubjects'](_0x5f53ff);}})[_0x4c47('0x21')](function(_0x42a58f){if(_0x42a58f){return _0x42a58f?{'count':_0x120844,'rows':_0x42a58f}:null;}})[_0x4c47('0x21')](respondWithResult(_0x36750b,null))[_0x4c47('0x3d')](handleError(_0x36750b,null));};exports['getDescriptions']=function(_0x210cc7,_0x3754c9,_0x1a85cb){var _0x24ffa1={};var _0x44102b={};var _0x583190;var _0x41cb54;return db[_0x4c47('0x26')][_0x4c47('0x46')]({'where':{'id':_0x210cc7[_0x4c47('0x44')]['id']}})[_0x4c47('0x21')](handleEntityNotFound(_0x3754c9,null))['then'](function(_0x580faa){if(_0x580faa){_0x583190=_0x580faa;_0x44102b[_0x4c47('0x2d')]=_[_0x4c47('0x3f')](db[_0x4c47('0x47')][_0x4c47('0x40')]);_0x44102b[_0x4c47('0x2a')]=_['keys'](_0x210cc7['query']);_0x44102b[_0x4c47('0x2b')]=_[_0x4c47('0x2c')](_0x44102b[_0x4c47('0x2d')],_0x44102b[_0x4c47('0x2a')]);_0x24ffa1[_0x4c47('0x2e')]=_['intersection'](_0x44102b['model'],qs[_0x4c47('0x2f')](_0x210cc7[_0x4c47('0x2a')][_0x4c47('0x2f')]));_0x24ffa1['attributes']=_0x24ffa1[_0x4c47('0x2e')][_0x4c47('0x30')]?_0x24ffa1['attributes']:_0x44102b[_0x4c47('0x2d')];_0x24ffa1[_0x4c47('0x48')]=qs[_0x4c47('0x34')](_0x210cc7['query'][_0x4c47('0x34')]);_0x24ffa1[_0x4c47('0x35')]=qs[_0x4c47('0x2b')](_[_0x4c47('0x36')](_0x210cc7[_0x4c47('0x2a')],_0x44102b[_0x4c47('0x2b')]));if(_0x210cc7[_0x4c47('0x2a')][_0x4c47('0x39')]){_0x24ffa1[_0x4c47('0x35')]=_['merge'](_0x24ffa1[_0x4c47('0x35')],{'$or':_['map'](_0x24ffa1[_0x4c47('0x2e')],function(_0x163e6a){var _0x595295={};_0x595295[_0x163e6a]={'$like':'%'+_0x210cc7[_0x4c47('0x2a')][_0x4c47('0x39')]+'%'};return _0x595295;})});}_0x24ffa1=_[_0x4c47('0x37')]({},_0x24ffa1,_0x210cc7[_0x4c47('0x3a')]);return _0x583190[_0x4c47('0x4a')](_0x24ffa1);}})['then'](function(_0x3cfe95){if(_0x3cfe95){_0x41cb54=_0x3cfe95['length'];if(!_0x210cc7[_0x4c47('0x2a')][_0x4c47('0x31')]('nolimit')){_0x24ffa1[_0x4c47('0x33')]=qs['limit'](_0x210cc7[_0x4c47('0x2a')][_0x4c47('0x33')]);_0x24ffa1['offset']=qs[_0x4c47('0x1a')](_0x210cc7[_0x4c47('0x2a')]['offset']);}return _0x583190['getDescriptions'](_0x24ffa1);}})[_0x4c47('0x21')](function(_0x169712){if(_0x169712){return _0x169712?{'count':_0x41cb54,'rows':_0x169712}:null;}})[_0x4c47('0x21')](respondWithResult(_0x3754c9,null))[_0x4c47('0x3d')](handleError(_0x3754c9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d4dc7d0..91285a6 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 _0x6221=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes','exports','define'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x6221,0x77));var _0x1622=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x6221[_0x5ec454];return _0x5ebf50;};'use strict';var _=require(_0x1622('0x0'));var util=require(_0x1622('0x1'));var logger=require(_0x1622('0x2'))(_0x1622('0x3'));var moment=require(_0x1622('0x4'));var BPromise=require(_0x1622('0x5'));var rp=require(_0x1622('0x6'));var fs=require('fs');var path=require(_0x1622('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1622('0x8'));module[_0x1622('0x9')]=function(_0x36bf32,_0x2699aa){return _0x36bf32[_0x1622('0xa')](_0x1622('0xb'),attributes,{'tableName':_0x1622('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca5=['bluebird','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0ca5,0x15b));var _0x50ca=function(_0x40b7b5,_0x349fc6){_0x40b7b5=_0x40b7b5-0x0;var _0x4feab9=_0x0ca5[_0x40b7b5];return _0x4feab9;};'use strict';var _=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50ca('0x2'));var BPromise=require(_0x50ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x50ca('0x4'));var attributes=require(_0x50ca('0x5'));module[_0x50ca('0x6')]=function(_0x4ef224,_0x17d645){return _0x4ef224[_0x50ca('0x7')](_0x50ca('0x8'),attributes,{'tableName':_0x50ca('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 81f05f7..9fd115d 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 _0x0e6e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3fa451,_0x32acff){var _0x19980e=function(_0xd68c1f){while(--_0xd68c1f){_0x3fa451['push'](_0x3fa451['shift']());}};_0x19980e(++_0x32acff);}(_0x0e6e,0x19a));var _0xe0e6=function(_0x3e2513,_0x4cea28){_0x3e2513=_0x3e2513-0x0;var _0x217185=_0x0e6e[_0x3e2513];return _0x217185;};'use strict';var _=require(_0xe0e6('0x0'));var util=require(_0xe0e6('0x1'));var moment=require(_0xe0e6('0x2'));var BPromise=require(_0xe0e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0e6('0x4'));var db=require(_0xe0e6('0x5'))['db'];var utils=require(_0xe0e6('0x6'));var logger=require(_0xe0e6('0x7'))(_0xe0e6('0x8'));var config=require(_0xe0e6('0x9'));var jayson=require(_0xe0e6('0xa'));var client=jayson[_0xe0e6('0xb')][_0xe0e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f445d,_0x5c7757,_0x17204b){return new BPromise(function(_0x5071bf,_0x48fac5){return client[_0xe0e6('0xd')](_0x5f445d,_0x17204b)[_0xe0e6('0xe')](function(_0x4e2a41){logger[_0xe0e6('0xf')](_0xe0e6('0x10'),_0x5c7757,_0xe0e6('0x11'));logger[_0xe0e6('0x12')](_0xe0e6('0x13'),_0x5c7757,_0xe0e6('0x11'),JSON[_0xe0e6('0x14')](_0x4e2a41));if(_0x4e2a41[_0xe0e6('0x15')]){if(_0x4e2a41[_0xe0e6('0x15')][_0xe0e6('0x16')]===0x1f4){logger['error'](_0xe0e6('0x10'),_0x5c7757,_0x4e2a41[_0xe0e6('0x15')][_0xe0e6('0x17')]);return _0x48fac5(_0x4e2a41['error'][_0xe0e6('0x17')]);}logger[_0xe0e6('0x15')](_0xe0e6('0x10'),_0x5c7757,_0x4e2a41[_0xe0e6('0x15')][_0xe0e6('0x17')]);return _0x5071bf(_0x4e2a41[_0xe0e6('0x15')]['message']);}else{logger[_0xe0e6('0xf')](_0xe0e6('0x10'),_0x5c7757,_0xe0e6('0x11'));_0x5071bf(_0x4e2a41[_0xe0e6('0x18')][_0xe0e6('0x17')]);}})[_0xe0e6('0x19')](function(_0x372250){logger['error'](_0xe0e6('0x10'),_0x5c7757,_0x372250);_0x48fac5(_0x372250);});});} \ No newline at end of file +var _0xc27a=['error','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','stringify'];(function(_0x4b3ec4,_0x3c573c){var _0x192836=function(_0x498cc0){while(--_0x498cc0){_0x4b3ec4['push'](_0x4b3ec4['shift']());}};_0x192836(++_0x3c573c);}(_0xc27a,0x11c));var _0xac27=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0xc27a[_0x546aaf];return _0x1cbf6d;};'use strict';var _=require(_0xac27('0x0'));var util=require(_0xac27('0x1'));var moment=require(_0xac27('0x2'));var BPromise=require(_0xac27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac27('0x4'));var db=require(_0xac27('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xac27('0x6'))(_0xac27('0x7'));var config=require(_0xac27('0x8'));var jayson=require(_0xac27('0x9'));var client=jayson[_0xac27('0xa')][_0xac27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57e440,_0x175003,_0x4504c5){return new BPromise(function(_0x23217f,_0x3bd07a){return client[_0xac27('0xc')](_0x57e440,_0x4504c5)[_0xac27('0xd')](function(_0x86f88c){logger['info'](_0xac27('0xe'),_0x175003,'request\x20sent');logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x175003,'request\x20sent',JSON[_0xac27('0xf')](_0x86f88c));if(_0x86f88c[_0xac27('0x10')]){if(_0x86f88c[_0xac27('0x10')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x175003,_0x86f88c['error'][_0xac27('0x11')]);return _0x3bd07a(_0x86f88c['error']['message']);}logger['error'](_0xac27('0xe'),_0x175003,_0x86f88c[_0xac27('0x10')][_0xac27('0x11')]);return _0x23217f(_0x86f88c[_0xac27('0x10')][_0xac27('0x11')]);}else{logger['info'](_0xac27('0xe'),_0x175003,_0xac27('0x12'));_0x23217f(_0x86f88c[_0xac27('0x13')][_0xac27('0x11')]);}})['catch'](function(_0x1f59e6){logger[_0xac27('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x175003,_0x1f59e6);_0x3bd07a(_0x1f59e6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 28bb7ba..bb4a30b 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 _0x82be=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy','exports','path'];(function(_0x13ee11,_0x129ca5){var _0xfe3915=function(_0x11b6c6){while(--_0x11b6c6){_0x13ee11['push'](_0x13ee11['shift']());}};_0xfe3915(++_0x129ca5);}(_0x82be,0x10d));var _0xe82b=function(_0x27e8ff,_0x2824e7){_0x27e8ff=_0x27e8ff-0x0;var _0x5d59fc=_0x82be[_0x27e8ff];return _0x5d59fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe82b('0x0'));var timeout=require(_0xe82b('0x1'));var express=require(_0xe82b('0x2'));var router=express[_0xe82b('0x3')]();var fs_extra=require(_0xe82b('0x4'));var auth=require(_0xe82b('0x5'));var interaction=require(_0xe82b('0x6'));var config=require('../../config/environment');var controller=require(_0xe82b('0x7'));router[_0xe82b('0x8')]('/',auth[_0xe82b('0x9')](),controller[_0xe82b('0xa')]);router[_0xe82b('0x8')]('/:id',auth[_0xe82b('0x9')](),controller[_0xe82b('0xb')]);router['post']('/',auth[_0xe82b('0x9')](),controller[_0xe82b('0xc')]);router[_0xe82b('0xd')](_0xe82b('0xe'),auth[_0xe82b('0x9')](),controller[_0xe82b('0xf')]);router['delete'](_0xe82b('0xe'),auth[_0xe82b('0x9')](),controller[_0xe82b('0x10')]);module[_0xe82b('0x11')]=router; \ No newline at end of file +var _0x8744=['../../config/environment','./intVtigerField.controller','get','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x6bd60c,_0x56f363){var _0x5e0e84=function(_0x57f08f){while(--_0x57f08f){_0x6bd60c['push'](_0x6bd60c['shift']());}};_0x5e0e84(++_0x56f363);}(_0x8744,0x12a));var _0x4874=function(_0x43daa8,_0x47f028){_0x43daa8=_0x43daa8-0x0;var _0x389155=_0x8744[_0x43daa8];return _0x389155;};'use strict';var multer=require(_0x4874('0x0'));var util=require(_0x4874('0x1'));var path=require('path');var timeout=require(_0x4874('0x2'));var express=require(_0x4874('0x3'));var router=express['Router']();var fs_extra=require(_0x4874('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4874('0x5'));var config=require(_0x4874('0x6'));var controller=require(_0x4874('0x7'));router[_0x4874('0x8')]('/',auth['isAuthenticated'](),controller[_0x4874('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4874('0xa')]);router[_0x4874('0xb')]('/',auth[_0x4874('0xc')](),controller[_0x4874('0xd')]);router[_0x4874('0xe')](_0x4874('0xf'),auth[_0x4874('0xc')](),controller[_0x4874('0x10')]);router[_0x4874('0x11')]('/:id',auth[_0x4874('0xc')](),controller[_0x4874('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 254b0dc..c1a8cbd 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 _0xdb95=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0xdb95,0x1b4));var _0x5db9=function(_0x542de4,_0x2a6669){_0x542de4=_0x542de4-0x0;var _0x41397f=_0xdb95[_0x542de4];return _0x41397f;};'use strict';var Sequelize=require(_0x5db9('0x0'));module[_0x5db9('0x1')]={'type':{'type':Sequelize[_0x5db9('0x2')](_0x5db9('0x3'),_0x5db9('0x4'),_0x5db9('0x5'),_0x5db9('0x6'),_0x5db9('0x7')),'defaultValue':_0x5db9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5db9('0x8')]},'keyType':{'type':Sequelize[_0x5db9('0x2')]('string',_0x5db9('0x4'),_0x5db9('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5db9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5db9('0x8')]}}; \ No newline at end of file +var _0xdfc4=['customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xdfc4,0x1ec));var _0x4dfc=function(_0x48a3bc,_0x28c428){_0x48a3bc=_0x48a3bc-0x0;var _0x2d3c15=_0xdfc4[_0x48a3bc];return _0x2d3c15;};'use strict';var Sequelize=require(_0x4dfc('0x0'));module[_0x4dfc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4dfc('0x2'),_0x4dfc('0x3'),'customVariable',_0x4dfc('0x4'),_0x4dfc('0x5')),'defaultValue':_0x4dfc('0x2')},'content':{'type':Sequelize[_0x4dfc('0x6')]},'key':{'type':Sequelize[_0x4dfc('0x6')]},'keyType':{'type':Sequelize[_0x4dfc('0x7')](_0x4dfc('0x2'),_0x4dfc('0x3'),_0x4dfc('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4dfc('0x6')]},'nameField':{'type':Sequelize[_0x4dfc('0x6')]},'customField':{'type':Sequelize[_0x4dfc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4dfc('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0037a92..670e7d5 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 _0x5e8a=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x362a7b,_0x3ccd6a){var _0x272ac2=function(_0x4643d2){while(--_0x4643d2){_0x362a7b['push'](_0x362a7b['shift']());}};_0x272ac2(++_0x3ccd6a);}(_0x5e8a,0x134));var _0xa5e8=function(_0x5270a1,_0x47ece1){_0x5270a1=_0x5270a1-0x0;var _0x9c4694=_0x5e8a[_0x5270a1];return _0x9c4694;};'use strict';var emlformat=require(_0xa5e8('0x0'));var rimraf=require(_0xa5e8('0x1'));var zipdir=require(_0xa5e8('0x2'));var jsonpatch=require(_0xa5e8('0x3'));var rp=require(_0xa5e8('0x4'));var moment=require(_0xa5e8('0x5'));var BPromise=require(_0xa5e8('0x6'));var Mustache=require(_0xa5e8('0x7'));var util=require('util');var path=require(_0xa5e8('0x8'));var sox=require(_0xa5e8('0x9'));var csv=require(_0xa5e8('0xa'));var ejs=require(_0xa5e8('0xb'));var fs=require('fs');var fs_extra=require(_0xa5e8('0xc'));var _=require(_0xa5e8('0xd'));var squel=require(_0xa5e8('0xe'));var crypto=require(_0xa5e8('0xf'));var jsforce=require(_0xa5e8('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa5e8('0xa'));var querystring=require(_0xa5e8('0x11'));var Papa=require('papaparse');var Redis=require(_0xa5e8('0x12'));var authService=require(_0xa5e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa5e8('0x14'));var hardwareService=require(_0xa5e8('0x15'));var logger=require(_0xa5e8('0x16'))(_0xa5e8('0x17'));var utils=require(_0xa5e8('0x18'));var config=require(_0xa5e8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5e8('0x1a'))['db'];function respondWithStatusCode(_0x2c9893,_0x1ba9aa){_0x1ba9aa=_0x1ba9aa||0xcc;return function(_0x2bec87){if(_0x2bec87){return _0x2c9893[_0xa5e8('0x1b')](_0x1ba9aa);}return _0x2c9893['status'](_0x1ba9aa)['end']();};}function respondWithResult(_0x33ca89,_0x3be4b2){_0x3be4b2=_0x3be4b2||0xc8;return function(_0x56d14a){if(_0x56d14a){return _0x33ca89[_0xa5e8('0x1c')](_0x3be4b2)[_0xa5e8('0x1d')](_0x56d14a);}};}function respondWithFilteredResult(_0x124b0e,_0x32274d){return function(_0x173949){if(_0x173949){var _0x12b3c2=typeof _0x32274d[_0xa5e8('0x1e')]==='undefined'&&typeof _0x32274d[_0xa5e8('0x1f')]===_0xa5e8('0x20');var _0x3476d9=_0x173949[_0xa5e8('0x21')];var _0x19cc9f=_0x12b3c2?0x0:_0x32274d[_0xa5e8('0x1e')];var _0x534965=_0x12b3c2?_0x173949['count']:_0x32274d[_0xa5e8('0x1e')]+_0x32274d['limit'];var _0x571902;if(_0x534965>=_0x3476d9){_0x534965=_0x3476d9;_0x571902=0xc8;}else{_0x571902=0xce;}_0x124b0e[_0xa5e8('0x1c')](_0x571902);return _0x124b0e['set'](_0xa5e8('0x22'),_0x19cc9f+'-'+_0x534965+'/'+_0x3476d9)['json'](_0x173949);}return null;};}function patchUpdates(_0x50f0cc){return function(_0x284534){try{jsonpatch[_0xa5e8('0x23')](_0x284534,_0x50f0cc,!![]);}catch(_0x154899){return BPromise[_0xa5e8('0x24')](_0x154899);}return _0x284534[_0xa5e8('0x25')]();};}function saveUpdates(_0x2b3b5c,_0x1ae320){return function(_0x566261){if(_0x566261){return _0x566261[_0xa5e8('0x26')](_0x2b3b5c)[_0xa5e8('0x27')](function(_0x513458){return _0x513458;});}return null;};}function removeEntity(_0x13ecf5,_0x21d20a){return function(_0x3d8aca){if(_0x3d8aca){return _0x3d8aca[_0xa5e8('0x28')]()[_0xa5e8('0x27')](function(){_0x13ecf5[_0xa5e8('0x1c')](0xcc)[_0xa5e8('0x29')]();});}};}function handleEntityNotFound(_0x2a06fb,_0x4db4f8){return function(_0x2d2771){if(!_0x2d2771){_0x2a06fb[_0xa5e8('0x1b')](0x194);}return _0x2d2771;};}function handleError(_0x504aa0,_0x277292){_0x277292=_0x277292||0x1f4;return function(_0x1c06f0){logger[_0xa5e8('0x2a')](_0x1c06f0[_0xa5e8('0x2b')]);if(_0x1c06f0[_0xa5e8('0x2c')]){delete _0x1c06f0[_0xa5e8('0x2c')];}_0x504aa0[_0xa5e8('0x1c')](_0x277292)[_0xa5e8('0x2d')](_0x1c06f0);};}exports[_0xa5e8('0x2e')]=function(_0x217848,_0x546629){var _0x6c6290={},_0x226a82={},_0x2d78ec={'count':0x0,'rows':[]};var _0x5b1688=_[_0xa5e8('0x2f')](db[_0xa5e8('0x30')][_0xa5e8('0x31')],function(_0x565ba4){return{'name':_0x565ba4[_0xa5e8('0x32')],'type':_0x565ba4[_0xa5e8('0x33')][_0xa5e8('0x34')]};});_0x226a82[_0xa5e8('0x35')]=_['map'](_0x5b1688,_0xa5e8('0x2c'));_0x226a82[_0xa5e8('0x36')]=_[_0xa5e8('0x37')](_0x217848[_0xa5e8('0x36')]);_0x226a82['filters']=_[_0xa5e8('0x38')](_0x226a82[_0xa5e8('0x35')],_0x226a82[_0xa5e8('0x36')]);_0x6c6290[_0xa5e8('0x39')]=_[_0xa5e8('0x38')](_0x226a82[_0xa5e8('0x35')],qs[_0xa5e8('0x3a')](_0x217848[_0xa5e8('0x36')]['fields']));_0x6c6290['attributes']=_0x6c6290[_0xa5e8('0x39')][_0xa5e8('0x3b')]?_0x6c6290[_0xa5e8('0x39')]:_0x226a82['model'];if(!_0x217848['query'][_0xa5e8('0x3c')]('nolimit')){_0x6c6290['limit']=qs[_0xa5e8('0x1f')](_0x217848[_0xa5e8('0x36')][_0xa5e8('0x1f')]);_0x6c6290[_0xa5e8('0x1e')]=qs[_0xa5e8('0x1e')](_0x217848[_0xa5e8('0x36')][_0xa5e8('0x1e')]);}_0x6c6290[_0xa5e8('0x3d')]=qs[_0xa5e8('0x3e')](_0x217848[_0xa5e8('0x36')][_0xa5e8('0x3e')]);_0x6c6290[_0xa5e8('0x3f')]=qs[_0xa5e8('0x40')](_[_0xa5e8('0x41')](_0x217848[_0xa5e8('0x36')],_0x226a82[_0xa5e8('0x40')]),_0x5b1688);if(_0x217848[_0xa5e8('0x36')][_0xa5e8('0x42')]){_0x6c6290[_0xa5e8('0x3f')]=_[_0xa5e8('0x43')](_0x6c6290[_0xa5e8('0x3f')],{'$or':_[_0xa5e8('0x2f')](_0x5b1688,function(_0x5a6f29){if(_0x5a6f29['type']!==_0xa5e8('0x44')){var _0x1e980d={};_0x1e980d[_0x5a6f29[_0xa5e8('0x2c')]]={'$like':'%'+_0x217848[_0xa5e8('0x36')][_0xa5e8('0x42')]+'%'};return _0x1e980d;}})});}_0x6c6290=_[_0xa5e8('0x43')]({},_0x6c6290,_0x217848[_0xa5e8('0x45')]);var _0x5a660e={'where':_0x6c6290[_0xa5e8('0x3f')]};return db['VtigerField']['count'](_0x5a660e)[_0xa5e8('0x27')](function(_0x2ddf1a){_0x2d78ec[_0xa5e8('0x21')]=_0x2ddf1a;if(_0x217848[_0xa5e8('0x36')][_0xa5e8('0x46')]){_0x6c6290[_0xa5e8('0x47')]=[{'all':!![]}];}return db[_0xa5e8('0x30')][_0xa5e8('0x48')](_0x6c6290);})[_0xa5e8('0x27')](function(_0x564d29){_0x2d78ec['rows']=_0x564d29;return _0x2d78ec;})[_0xa5e8('0x27')](respondWithFilteredResult(_0x546629,_0x6c6290))[_0xa5e8('0x49')](handleError(_0x546629,null));};exports['show']=function(_0x198610,_0x566fc6){var _0x3b7927={'raw':!![],'where':{'id':_0x198610[_0xa5e8('0x4a')]['id']}},_0x17a11d={};_0x17a11d[_0xa5e8('0x35')]=_[_0xa5e8('0x37')](db[_0xa5e8('0x30')][_0xa5e8('0x31')]);_0x17a11d['query']=_[_0xa5e8('0x37')](_0x198610[_0xa5e8('0x36')]);_0x17a11d[_0xa5e8('0x40')]=_['intersection'](_0x17a11d[_0xa5e8('0x35')],_0x17a11d[_0xa5e8('0x36')]);_0x3b7927[_0xa5e8('0x39')]=_[_0xa5e8('0x38')](_0x17a11d[_0xa5e8('0x35')],qs['fields'](_0x198610['query'][_0xa5e8('0x3a')]));_0x3b7927['attributes']=_0x3b7927['attributes']['length']?_0x3b7927[_0xa5e8('0x39')]:_0x17a11d[_0xa5e8('0x35')];if(_0x198610['query'][_0xa5e8('0x46')]){_0x3b7927[_0xa5e8('0x47')]=[{'all':!![]}];}_0x3b7927=_[_0xa5e8('0x43')]({},_0x3b7927,_0x198610['options']);return db[_0xa5e8('0x30')][_0xa5e8('0x4b')](_0x3b7927)[_0xa5e8('0x27')](handleEntityNotFound(_0x566fc6,null))['then'](respondWithResult(_0x566fc6,null))[_0xa5e8('0x49')](handleError(_0x566fc6,null));};exports[_0xa5e8('0x4c')]=function(_0x4a2345,_0x1c7a44){return db['VtigerField'][_0xa5e8('0x4c')](_0x4a2345[_0xa5e8('0x4d')],{})[_0xa5e8('0x27')](respondWithResult(_0x1c7a44,0xc9))[_0xa5e8('0x49')](handleError(_0x1c7a44,null));};exports[_0xa5e8('0x26')]=function(_0x445bc9,_0x4bdf31){if(_0x445bc9[_0xa5e8('0x4d')]['id']){delete _0x445bc9[_0xa5e8('0x4d')]['id'];}return db[_0xa5e8('0x30')]['find']({'where':{'id':_0x445bc9[_0xa5e8('0x4a')]['id']}})[_0xa5e8('0x27')](handleEntityNotFound(_0x4bdf31,null))[_0xa5e8('0x27')](saveUpdates(_0x445bc9[_0xa5e8('0x4d')],null))[_0xa5e8('0x27')](respondWithResult(_0x4bdf31,null))['catch'](handleError(_0x4bdf31,null));};exports['destroy']=function(_0x5d31a0,_0x272696){return db[_0xa5e8('0x30')]['find']({'where':{'id':_0x5d31a0[_0xa5e8('0x4a')]['id']}})[_0xa5e8('0x27')](handleEntityNotFound(_0x272696,null))[_0xa5e8('0x27')](removeEntity(_0x272696,null))[_0xa5e8('0x49')](handleError(_0x272696,null));}; \ No newline at end of file +var _0x29c5=['index','map','VtigerField','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','catch','show','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send'];(function(_0x1c16a4,_0xbba97c){var _0xa47eb7=function(_0x3f4893){while(--_0x3f4893){_0x1c16a4['push'](_0x1c16a4['shift']());}};_0xa47eb7(++_0xbba97c);}(_0x29c5,0xb3));var _0x529c=function(_0x58bf21,_0x41f9f9){_0x58bf21=_0x58bf21-0x0;var _0x542d59=_0x29c5[_0x58bf21];return _0x542d59;};'use strict';var emlformat=require(_0x529c('0x0'));var rimraf=require(_0x529c('0x1'));var zipdir=require(_0x529c('0x2'));var jsonpatch=require(_0x529c('0x3'));var rp=require('request-promise');var moment=require(_0x529c('0x4'));var BPromise=require(_0x529c('0x5'));var Mustache=require(_0x529c('0x6'));var util=require(_0x529c('0x7'));var path=require(_0x529c('0x8'));var sox=require('sox');var csv=require(_0x529c('0x9'));var ejs=require(_0x529c('0xa'));var fs=require('fs');var fs_extra=require(_0x529c('0xb'));var _=require('lodash');var squel=require(_0x529c('0xc'));var crypto=require(_0x529c('0xd'));var jsforce=require(_0x529c('0xe'));var deskjs=require(_0x529c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x529c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x529c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x529c('0x12'))(_0x529c('0x13'));var utils=require(_0x529c('0x14'));var config=require(_0x529c('0x15'));var licenseUtil=require(_0x529c('0x16'));var db=require(_0x529c('0x17'))['db'];function respondWithStatusCode(_0x1a39ba,_0x5eb3a8){_0x5eb3a8=_0x5eb3a8||0xcc;return function(_0x5bf789){if(_0x5bf789){return _0x1a39ba[_0x529c('0x18')](_0x5eb3a8);}return _0x1a39ba[_0x529c('0x19')](_0x5eb3a8)[_0x529c('0x1a')]();};}function respondWithResult(_0x2cdb92,_0x5d8231){_0x5d8231=_0x5d8231||0xc8;return function(_0x1172af){if(_0x1172af){return _0x2cdb92[_0x529c('0x19')](_0x5d8231)[_0x529c('0x1b')](_0x1172af);}};}function respondWithFilteredResult(_0x41e3f1,_0x555d9d){return function(_0x1d60f4){if(_0x1d60f4){var _0xa7b7a5=typeof _0x555d9d[_0x529c('0x1c')]==='undefined'&&typeof _0x555d9d['limit']===_0x529c('0x1d');var _0x5da3b6=_0x1d60f4['count'];var _0x179a86=_0xa7b7a5?0x0:_0x555d9d[_0x529c('0x1c')];var _0x18e6f3=_0xa7b7a5?_0x1d60f4[_0x529c('0x1e')]:_0x555d9d[_0x529c('0x1c')]+_0x555d9d[_0x529c('0x1f')];var _0x28cf9d;if(_0x18e6f3>=_0x5da3b6){_0x18e6f3=_0x5da3b6;_0x28cf9d=0xc8;}else{_0x28cf9d=0xce;}_0x41e3f1[_0x529c('0x19')](_0x28cf9d);return _0x41e3f1[_0x529c('0x20')](_0x529c('0x21'),_0x179a86+'-'+_0x18e6f3+'/'+_0x5da3b6)[_0x529c('0x1b')](_0x1d60f4);}return null;};}function patchUpdates(_0x130c91){return function(_0x338dd7){try{jsonpatch[_0x529c('0x22')](_0x338dd7,_0x130c91,!![]);}catch(_0x2d7aa5){return BPromise['reject'](_0x2d7aa5);}return _0x338dd7[_0x529c('0x23')]();};}function saveUpdates(_0x17ade9,_0x4fcd3f){return function(_0x2f08b2){if(_0x2f08b2){return _0x2f08b2[_0x529c('0x24')](_0x17ade9)[_0x529c('0x25')](function(_0x50559d){return _0x50559d;});}return null;};}function removeEntity(_0x2ad946,_0x154122){return function(_0x342bbf){if(_0x342bbf){return _0x342bbf[_0x529c('0x26')]()[_0x529c('0x25')](function(){_0x2ad946['status'](0xcc)[_0x529c('0x1a')]();});}};}function handleEntityNotFound(_0xccfe24,_0x515704){return function(_0x4e7048){if(!_0x4e7048){_0xccfe24['sendStatus'](0x194);}return _0x4e7048;};}function handleError(_0x2f7352,_0x1f6fd1){_0x1f6fd1=_0x1f6fd1||0x1f4;return function(_0x3d28a2){logger[_0x529c('0x27')](_0x3d28a2[_0x529c('0x28')]);if(_0x3d28a2[_0x529c('0x29')]){delete _0x3d28a2[_0x529c('0x29')];}_0x2f7352[_0x529c('0x19')](_0x1f6fd1)[_0x529c('0x2a')](_0x3d28a2);};}exports[_0x529c('0x2b')]=function(_0x1aa56f,_0x18cfd9){var _0x538cad={},_0x4ab9f5={},_0x2069cd={'count':0x0,'rows':[]};var _0x1c9a3d=_[_0x529c('0x2c')](db[_0x529c('0x2d')]['rawAttributes'],function(_0xf4f59a){return{'name':_0xf4f59a[_0x529c('0x2e')],'type':_0xf4f59a[_0x529c('0x2f')][_0x529c('0x30')]};});_0x4ab9f5['model']=_[_0x529c('0x2c')](_0x1c9a3d,'name');_0x4ab9f5['query']=_[_0x529c('0x31')](_0x1aa56f[_0x529c('0x32')]);_0x4ab9f5['filters']=_[_0x529c('0x33')](_0x4ab9f5[_0x529c('0x34')],_0x4ab9f5[_0x529c('0x32')]);_0x538cad['attributes']=_['intersection'](_0x4ab9f5[_0x529c('0x34')],qs[_0x529c('0x35')](_0x1aa56f[_0x529c('0x32')][_0x529c('0x35')]));_0x538cad[_0x529c('0x36')]=_0x538cad['attributes'][_0x529c('0x37')]?_0x538cad[_0x529c('0x36')]:_0x4ab9f5[_0x529c('0x34')];if(!_0x1aa56f[_0x529c('0x32')][_0x529c('0x38')](_0x529c('0x39'))){_0x538cad['limit']=qs[_0x529c('0x1f')](_0x1aa56f[_0x529c('0x32')][_0x529c('0x1f')]);_0x538cad[_0x529c('0x1c')]=qs[_0x529c('0x1c')](_0x1aa56f[_0x529c('0x32')]['offset']);}_0x538cad[_0x529c('0x3a')]=qs[_0x529c('0x3b')](_0x1aa56f[_0x529c('0x32')]['sort']);_0x538cad[_0x529c('0x3c')]=qs['filters'](_[_0x529c('0x3d')](_0x1aa56f['query'],_0x4ab9f5[_0x529c('0x3e')]),_0x1c9a3d);if(_0x1aa56f[_0x529c('0x32')][_0x529c('0x3f')]){_0x538cad[_0x529c('0x3c')]=_[_0x529c('0x40')](_0x538cad[_0x529c('0x3c')],{'$or':_['map'](_0x1c9a3d,function(_0x1349c7){if(_0x1349c7[_0x529c('0x2f')]!=='VIRTUAL'){var _0x47bebd={};_0x47bebd[_0x1349c7[_0x529c('0x29')]]={'$like':'%'+_0x1aa56f[_0x529c('0x32')]['filter']+'%'};return _0x47bebd;}})});}_0x538cad=_[_0x529c('0x40')]({},_0x538cad,_0x1aa56f['options']);var _0x29f46d={'where':_0x538cad['where']};return db[_0x529c('0x2d')][_0x529c('0x1e')](_0x29f46d)[_0x529c('0x25')](function(_0x32d01c){_0x2069cd[_0x529c('0x1e')]=_0x32d01c;if(_0x1aa56f[_0x529c('0x32')][_0x529c('0x41')]){_0x538cad[_0x529c('0x42')]=[{'all':!![]}];}return db['VtigerField'][_0x529c('0x43')](_0x538cad);})['then'](function(_0x38c8f1){_0x2069cd['rows']=_0x38c8f1;return _0x2069cd;})[_0x529c('0x25')](respondWithFilteredResult(_0x18cfd9,_0x538cad))[_0x529c('0x44')](handleError(_0x18cfd9,null));};exports[_0x529c('0x45')]=function(_0x128ffd,_0x50c737){var _0x31df86={'raw':!![],'where':{'id':_0x128ffd['params']['id']}},_0x1ce335={};_0x1ce335['model']=_[_0x529c('0x31')](db[_0x529c('0x2d')][_0x529c('0x46')]);_0x1ce335[_0x529c('0x32')]=_[_0x529c('0x31')](_0x128ffd[_0x529c('0x32')]);_0x1ce335[_0x529c('0x3e')]=_[_0x529c('0x33')](_0x1ce335[_0x529c('0x34')],_0x1ce335['query']);_0x31df86[_0x529c('0x36')]=_[_0x529c('0x33')](_0x1ce335[_0x529c('0x34')],qs[_0x529c('0x35')](_0x128ffd[_0x529c('0x32')][_0x529c('0x35')]));_0x31df86['attributes']=_0x31df86[_0x529c('0x36')][_0x529c('0x37')]?_0x31df86[_0x529c('0x36')]:_0x1ce335[_0x529c('0x34')];if(_0x128ffd['query'][_0x529c('0x41')]){_0x31df86['include']=[{'all':!![]}];}_0x31df86=_[_0x529c('0x40')]({},_0x31df86,_0x128ffd['options']);return db[_0x529c('0x2d')]['find'](_0x31df86)[_0x529c('0x25')](handleEntityNotFound(_0x50c737,null))[_0x529c('0x25')](respondWithResult(_0x50c737,null))[_0x529c('0x44')](handleError(_0x50c737,null));};exports[_0x529c('0x47')]=function(_0x483ffb,_0x15891f){return db['VtigerField'][_0x529c('0x47')](_0x483ffb['body'],{})[_0x529c('0x25')](respondWithResult(_0x15891f,0xc9))[_0x529c('0x44')](handleError(_0x15891f,null));};exports[_0x529c('0x24')]=function(_0x102d0f,_0xe59ddc){if(_0x102d0f[_0x529c('0x48')]['id']){delete _0x102d0f[_0x529c('0x48')]['id'];}return db[_0x529c('0x2d')]['find']({'where':{'id':_0x102d0f['params']['id']}})['then'](handleEntityNotFound(_0xe59ddc,null))[_0x529c('0x25')](saveUpdates(_0x102d0f['body'],null))[_0x529c('0x25')](respondWithResult(_0xe59ddc,null))[_0x529c('0x44')](handleError(_0xe59ddc,null));};exports['destroy']=function(_0x1b2e91,_0x449ef1){return db[_0x529c('0x2d')][_0x529c('0x49')]({'where':{'id':_0x1b2e91['params']['id']}})[_0x529c('0x25')](handleEntityNotFound(_0x449ef1,null))[_0x529c('0x25')](removeEntity(_0x449ef1,null))[_0x529c('0x44')](handleError(_0x449ef1,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d2cca38..0d4c654 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 _0x1151=['path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b1cd3,_0x2a3f47){var _0x1cb019=function(_0x30e479){while(--_0x30e479){_0x2b1cd3['push'](_0x2b1cd3['shift']());}};_0x1cb019(++_0x2a3f47);}(_0x1151,0x1ea));var _0x1115=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x1151[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x1115('0x0'));var util=require('util');var logger=require(_0x1115('0x1'))(_0x1115('0x2'));var moment=require(_0x1115('0x3'));var BPromise=require(_0x1115('0x4'));var rp=require(_0x1115('0x5'));var fs=require('fs');var path=require(_0x1115('0x6'));var rimraf=require(_0x1115('0x7'));var config=require(_0x1115('0x8'));var attributes=require(_0x1115('0x9'));module[_0x1115('0xa')]=function(_0x11c714,_0x58b8c7){return _0x11c714[_0x1115('0xb')]('VtigerField',attributes,{'tableName':_0x1115('0xc'),'paranoid':![],'indexes':[{'name':_0x1115('0xd'),'fields':[_0x1115('0xe'),_0x1115('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x316d=['int_vtiger_fields','vtiger_unique_index','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x316d,0x72));var _0xd316=function(_0x3ec170,_0x4bd32b){_0x3ec170=_0x3ec170-0x0;var _0x49ab8b=_0x316d[_0x3ec170];return _0x49ab8b;};'use strict';var _=require(_0xd316('0x0'));var util=require(_0xd316('0x1'));var logger=require('../../config/logger')(_0xd316('0x2'));var moment=require(_0xd316('0x3'));var BPromise=require(_0xd316('0x4'));var rp=require(_0xd316('0x5'));var fs=require('fs');var path=require(_0xd316('0x6'));var rimraf=require(_0xd316('0x7'));var config=require(_0xd316('0x8'));var attributes=require(_0xd316('0x9'));module['exports']=function(_0x134c9a,_0x5989f6){return _0x134c9a[_0xd316('0xa')](_0xd316('0xb'),attributes,{'tableName':_0xd316('0xc'),'paranoid':![],'indexes':[{'name':_0xd316('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 833487f..3da6333 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 _0xb759=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x37682b,_0x25cba2){var _0x34173c=function(_0x5584a9){while(--_0x5584a9){_0x37682b['push'](_0x37682b['shift']());}};_0x34173c(++_0x25cba2);}(_0xb759,0x19e));var _0x9b75=function(_0x4b2c46,_0x301d59){_0x4b2c46=_0x4b2c46-0x0;var _0x439f6f=_0xb759[_0x4b2c46];return _0x439f6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9b75('0x0'));var BPromise=require(_0x9b75('0x1'));var rs=require(_0x9b75('0x2'));var fs=require('fs');var Redis=require(_0x9b75('0x3'));var db=require(_0x9b75('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9b75('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b75('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a97b4,_0x3c21c6,_0x3bde33){return new BPromise(function(_0x2ac3ce,_0x35eb3d){return client[_0x9b75('0x7')](_0x5a97b4,_0x3bde33)['then'](function(_0x4ee461){logger[_0x9b75('0x8')](_0x9b75('0x9'),_0x3c21c6,_0x9b75('0xa'));logger[_0x9b75('0xb')](_0x9b75('0xc'),_0x3c21c6,_0x9b75('0xa'),JSON[_0x9b75('0xd')](_0x4ee461));if(_0x4ee461['error']){if(_0x4ee461['error'][_0x9b75('0xe')]===0x1f4){logger[_0x9b75('0xf')](_0x9b75('0x9'),_0x3c21c6,_0x4ee461[_0x9b75('0xf')][_0x9b75('0x10')]);return _0x35eb3d(_0x4ee461[_0x9b75('0xf')][_0x9b75('0x10')]);}logger[_0x9b75('0xf')](_0x9b75('0x9'),_0x3c21c6,_0x4ee461['error']['message']);return _0x2ac3ce(_0x4ee461[_0x9b75('0xf')][_0x9b75('0x10')]);}else{logger['info'](_0x9b75('0x9'),_0x3c21c6,_0x9b75('0xa'));_0x2ac3ce(_0x4ee461['result']['message']);}})['catch'](function(_0x2446b0){logger[_0x9b75('0xf')]('VtigerField,\x20%s,\x20%s',_0x3c21c6,_0x2446b0);_0x35eb3d(_0x2446b0);});});} \ No newline at end of file +var _0x4cad=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1a6fc2,_0x4f7795){var _0x49d635=function(_0x315158){while(--_0x315158){_0x1a6fc2['push'](_0x1a6fc2['shift']());}};_0x49d635(++_0x4f7795);}(_0x4cad,0x1d8));var _0xd4ca=function(_0x3f2294,_0x1922e2){_0x3f2294=_0x3f2294-0x0;var _0x10f9a1=_0x4cad[_0x3f2294];return _0x10f9a1;};'use strict';var _=require(_0xd4ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd4ca('0x1'));var rs=require(_0xd4ca('0x2'));var fs=require('fs');var Redis=require(_0xd4ca('0x3'));var db=require(_0xd4ca('0x4'))['db'];var utils=require(_0xd4ca('0x5'));var logger=require(_0xd4ca('0x6'))(_0xd4ca('0x7'));var config=require('../../config/environment');var jayson=require(_0xd4ca('0x8'));var client=jayson[_0xd4ca('0x9')][_0xd4ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x132efb,_0x579acc,_0x5060e3){return new BPromise(function(_0x429270,_0x4e9832){return client[_0xd4ca('0xb')](_0x132efb,_0x5060e3)[_0xd4ca('0xc')](function(_0x203dc1){logger[_0xd4ca('0xd')](_0xd4ca('0xe'),_0x579acc,_0xd4ca('0xf'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x579acc,_0xd4ca('0xf'),JSON[_0xd4ca('0x10')](_0x203dc1));if(_0x203dc1['error']){if(_0x203dc1['error'][_0xd4ca('0x11')]===0x1f4){logger['error'](_0xd4ca('0xe'),_0x579acc,_0x203dc1[_0xd4ca('0x12')][_0xd4ca('0x13')]);return _0x4e9832(_0x203dc1[_0xd4ca('0x12')][_0xd4ca('0x13')]);}logger[_0xd4ca('0x12')](_0xd4ca('0xe'),_0x579acc,_0x203dc1[_0xd4ca('0x12')]['message']);return _0x429270(_0x203dc1[_0xd4ca('0x12')][_0xd4ca('0x13')]);}else{logger[_0xd4ca('0xd')]('VtigerField,\x20%s,\x20%s',_0x579acc,_0xd4ca('0xf'));_0x429270(_0x203dc1[_0xd4ca('0x14')][_0xd4ca('0x13')]);}})[_0xd4ca('0x15')](function(_0x445bf1){logger['error'](_0xd4ca('0xe'),_0x579acc,_0x445bf1);_0x4e9832(_0x445bf1);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 16dd77d..f73e8bb 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 _0x7ef3=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x7ef3,0x106));var _0x37ef=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7ef3[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x37ef('0x0'));var util=require(_0x37ef('0x1'));var path=require(_0x37ef('0x2'));var timeout=require(_0x37ef('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37ef('0x4'));var interaction=require(_0x37ef('0x5'));var config=require(_0x37ef('0x6'));var controller=require(_0x37ef('0x7'));router[_0x37ef('0x8')]('/',auth[_0x37ef('0x9')](),controller[_0x37ef('0xa')]);router[_0x37ef('0x8')](_0x37ef('0xb'),auth['isAuthenticated'](),controller[_0x37ef('0xc')]);router[_0x37ef('0x8')](_0x37ef('0xd'),auth[_0x37ef('0x9')](),controller['getConfigurations']);router[_0x37ef('0x8')](_0x37ef('0xe'),auth['isAuthenticated'](),controller[_0x37ef('0xf')]);router[_0x37ef('0x10')]('/',auth[_0x37ef('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0x37ef('0x9')](),controller[_0x37ef('0x11')]);router[_0x37ef('0x12')]('/:id',auth[_0x37ef('0x9')](),controller[_0x37ef('0x13')]);router['delete'](_0x37ef('0xb'),auth[_0x37ef('0x9')](),controller[_0x37ef('0x14')]);module[_0x37ef('0x15')]=router; \ No newline at end of file +var _0x7ffb=['connect-timeout','Router','fs-extra','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','update','delete','destroy','multer'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x7ffb,0x197));var _0xb7ff=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x7ffb[_0xe4bb3d];return _0xd9e51;};'use strict';var multer=require(_0xb7ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb7ff('0x1'));var express=require('express');var router=express[_0xb7ff('0x2')]();var fs_extra=require(_0xb7ff('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb7ff('0x4'));var config=require('../../config/environment');var controller=require(_0xb7ff('0x5'));router[_0xb7ff('0x6')]('/',auth[_0xb7ff('0x7')](),controller[_0xb7ff('0x8')]);router[_0xb7ff('0x6')](_0xb7ff('0x9'),auth[_0xb7ff('0x7')](),controller[_0xb7ff('0xa')]);router[_0xb7ff('0x6')](_0xb7ff('0xb'),auth[_0xb7ff('0x7')](),controller['getConfigurations']);router[_0xb7ff('0x6')]('/:id/fields',auth[_0xb7ff('0x7')](),controller[_0xb7ff('0xc')]);router[_0xb7ff('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb7ff('0xd')](_0xb7ff('0xb'),auth[_0xb7ff('0x7')](),controller['addConfiguration']);router['put'](_0xb7ff('0x9'),auth[_0xb7ff('0x7')](),controller[_0xb7ff('0xe')]);router[_0xb7ff('0xf')](_0xb7ff('0x9'),auth[_0xb7ff('0x7')](),controller[_0xb7ff('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 16bf259..7ef3bea 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 _0xfd2e=['password','integrationTab','sequelize','STRING','remoteUri','ENUM'];(function(_0x2a5d7a,_0x47b143){var _0x231c09=function(_0x48a2a6){while(--_0x48a2a6){_0x2a5d7a['push'](_0x2a5d7a['shift']());}};_0x231c09(++_0x47b143);}(_0xfd2e,0x6e));var _0xefd2=function(_0x5ddb5a,_0x31972c){_0x5ddb5a=_0x5ddb5a-0x0;var _0x5dc45e=_0xfd2e[_0x5ddb5a];return _0x5dc45e;};'use strict';var Sequelize=require(_0xefd2('0x0'));module['exports']={'name':{'type':Sequelize[_0xefd2('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xefd2('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xefd2('0x1')]},'token':{'type':Sequelize[_0xefd2('0x1')]},'remoteUri':{'type':Sequelize[_0xefd2('0x1')],'unique':_0xefd2('0x2')},'authType':{'type':Sequelize[_0xefd2('0x3')]('password','token'),'defaultValue':_0xefd2('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xefd2('0x5'),'newTab'),'defaultValue':_0xefd2('0x5')}}; \ No newline at end of file +var _0x9c63=['exports','STRING','ENUM','password','token','newTab','integrationTab','sequelize'];(function(_0x329940,_0x5ce09a){var _0x5eebc6=function(_0x1e0585){while(--_0x1e0585){_0x329940['push'](_0x329940['shift']());}};_0x5eebc6(++_0x5ce09a);}(_0x9c63,0x1a7));var _0x39c6=function(_0x1c1b62,_0x3e1da4){_0x1c1b62=_0x1c1b62-0x0;var _0x44bf5f=_0x9c63[_0x1c1b62];return _0x44bf5f;};'use strict';var Sequelize=require(_0x39c6('0x0'));module[_0x39c6('0x1')]={'name':{'type':Sequelize[_0x39c6('0x2')]},'description':{'type':Sequelize[_0x39c6('0x2')]},'username':{'type':Sequelize[_0x39c6('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x39c6('0x2')]},'token':{'type':Sequelize[_0x39c6('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x39c6('0x3')](_0x39c6('0x4'),_0x39c6('0x5')),'defaultValue':_0x39c6('0x4')},'serverUrl':{'type':Sequelize[_0x39c6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x39c6('0x3')]('integrationTab',_0x39c6('0x6')),'defaultValue':_0x39c6('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 1bf71eb..8dff128 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 _0xab40=['../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','name','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','findOne','ZendeskConfiguration','order','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x5eb874,_0x3d849f){var _0x5bbbd0=function(_0x54c86a){while(--_0x54c86a){_0x5eb874['push'](_0x5eb874['shift']());}};_0x5bbbd0(++_0x3d849f);}(_0xab40,0xcd));var _0x0ab4=function(_0x199482,_0x21c2b4){_0x199482=_0x199482-0x0;var _0x2d9637=_0xab40[_0x199482];return _0x2d9637;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0ab4('0x15'));function respondWithStatusCode(_0x45e6fd,_0x1e7555){_0x1e7555=_0x1e7555||0xcc;return function(_0x1e2b56){if(_0x1e2b56){return _0x45e6fd[_0x0ab4('0x16')](_0x1e7555);}return _0x45e6fd[_0x0ab4('0x17')](_0x1e7555)[_0x0ab4('0x18')]();};}function respondWithResult(_0x2cc644,_0x3cb1df){_0x3cb1df=_0x3cb1df||0xc8;return function(_0x2033c8){if(_0x2033c8){return _0x2cc644[_0x0ab4('0x17')](_0x3cb1df)[_0x0ab4('0x19')](_0x2033c8);}};}function respondWithFilteredResult(_0x293e20,_0x45fad1){return function(_0x2a83a8){if(_0x2a83a8){var _0x2403db=typeof _0x45fad1[_0x0ab4('0x1a')]===_0x0ab4('0x1b')&&typeof _0x45fad1['limit']==='undefined';var _0x49634f=_0x2a83a8[_0x0ab4('0x1c')];var _0x30d5df=_0x2403db?0x0:_0x45fad1[_0x0ab4('0x1a')];var _0x53723c=_0x2403db?_0x2a83a8[_0x0ab4('0x1c')]:_0x45fad1[_0x0ab4('0x1a')]+_0x45fad1[_0x0ab4('0x1d')];var _0x31ee29;if(_0x53723c>=_0x49634f){_0x53723c=_0x49634f;_0x31ee29=0xc8;}else{_0x31ee29=0xce;}_0x293e20['status'](_0x31ee29);return _0x293e20['set'](_0x0ab4('0x1e'),_0x30d5df+'-'+_0x53723c+'/'+_0x49634f)['json'](_0x2a83a8);}return null;};}function patchUpdates(_0x2b0e29){return function(_0x30abff){try{jsonpatch['apply'](_0x30abff,_0x2b0e29,!![]);}catch(_0xacd68e){return BPromise[_0x0ab4('0x1f')](_0xacd68e);}return _0x30abff[_0x0ab4('0x20')]();};}function saveUpdates(_0x1d5c14,_0x12d06d){return function(_0x52d7d3){if(_0x52d7d3){return _0x52d7d3['update'](_0x1d5c14)[_0x0ab4('0x21')](function(_0x14087f){return _0x14087f;});}return null;};}function removeEntity(_0x392afe,_0x13c882){return function(_0x4e4b80){if(_0x4e4b80){return _0x4e4b80[_0x0ab4('0x22')]()[_0x0ab4('0x21')](function(){_0x392afe[_0x0ab4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(!_0x1c132c){_0x4c5caf[_0x0ab4('0x16')](0x194);}return _0x1c132c;};}function handleError(_0x4ae515,_0x519b23){_0x519b23=_0x519b23||0x1f4;return function(_0x49c72d){logger[_0x0ab4('0x23')](_0x49c72d['stack']);if(_0x49c72d[_0x0ab4('0x24')]){delete _0x49c72d[_0x0ab4('0x24')];}_0x4ae515['status'](_0x519b23)['send'](_0x49c72d);};}exports['index']=function(_0x3d38a4,_0x183bac){var _0x1cfdad={},_0x3f61cb={},_0x25385e={'count':0x0,'rows':[]};var _0x588e0d=_['map'](db['ZendeskAccount'][_0x0ab4('0x25')],function(_0x2b66d5){return{'name':_0x2b66d5[_0x0ab4('0x26')],'type':_0x2b66d5[_0x0ab4('0x27')][_0x0ab4('0x28')]};});_0x3f61cb['model']=_['map'](_0x588e0d,_0x0ab4('0x24'));_0x3f61cb[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x3d38a4['query']);_0x3f61cb['filters']=_[_0x0ab4('0x2b')](_0x3f61cb['model'],_0x3f61cb[_0x0ab4('0x29')]);_0x1cfdad[_0x0ab4('0x2c')]=_[_0x0ab4('0x2b')](_0x3f61cb[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0x3d38a4[_0x0ab4('0x29')]['fields']));_0x1cfdad[_0x0ab4('0x2c')]=_0x1cfdad[_0x0ab4('0x2c')][_0x0ab4('0x2f')]?_0x1cfdad[_0x0ab4('0x2c')]:_0x3f61cb['model'];if(!_0x3d38a4['query'][_0x0ab4('0x30')](_0x0ab4('0x31'))){_0x1cfdad[_0x0ab4('0x1d')]=qs['limit'](_0x3d38a4['query']['limit']);_0x1cfdad[_0x0ab4('0x1a')]=qs[_0x0ab4('0x1a')](_0x3d38a4[_0x0ab4('0x29')]['offset']);}_0x1cfdad['order']=qs['sort'](_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x1cfdad[_0x0ab4('0x33')]=qs[_0x0ab4('0x34')](_[_0x0ab4('0x35')](_0x3d38a4[_0x0ab4('0x29')],_0x3f61cb[_0x0ab4('0x34')]),_0x588e0d);if(_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x36')]){_0x1cfdad[_0x0ab4('0x33')]=_['merge'](_0x1cfdad[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x588e0d,function(_0xb6bc6a){if(_0xb6bc6a[_0x0ab4('0x27')]!==_0x0ab4('0x38')){var _0x34c74f={};_0x34c74f[_0xb6bc6a[_0x0ab4('0x24')]]={'$like':'%'+_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x36')]+'%'};return _0x34c74f;}})});}_0x1cfdad=_[_0x0ab4('0x39')]({},_0x1cfdad,_0x3d38a4[_0x0ab4('0x3a')]);var _0x1974ce={'where':_0x1cfdad['where']};return db[_0x0ab4('0x3b')][_0x0ab4('0x1c')](_0x1974ce)[_0x0ab4('0x21')](function(_0x3acb8d){_0x25385e['count']=_0x3acb8d;if(_0x3d38a4[_0x0ab4('0x29')]['includeAll']){_0x1cfdad[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3b')][_0x0ab4('0x3d')](_0x1cfdad);})[_0x0ab4('0x21')](function(_0xd2293){_0x25385e[_0x0ab4('0x3e')]=_0xd2293;return _0x25385e;})['then'](respondWithFilteredResult(_0x183bac,_0x1cfdad))[_0x0ab4('0x3f')](handleError(_0x183bac,null));};exports[_0x0ab4('0x40')]=function(_0xe3df73,_0x48029f){var _0x395e0b={'raw':![],'where':{'id':_0xe3df73[_0x0ab4('0x41')]['id']}},_0xeac8ad={};_0xeac8ad[_0x0ab4('0x2d')]=_[_0x0ab4('0x2a')](db['ZendeskAccount']['rawAttributes']);_0xeac8ad['query']=_[_0x0ab4('0x2a')](_0xe3df73[_0x0ab4('0x29')]);_0xeac8ad['filters']=_[_0x0ab4('0x2b')](_0xeac8ad['model'],_0xeac8ad[_0x0ab4('0x29')]);_0x395e0b['attributes']=_[_0x0ab4('0x2b')](_0xeac8ad[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0xe3df73[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x395e0b[_0x0ab4('0x2c')]=_0x395e0b['attributes'][_0x0ab4('0x2f')]?_0x395e0b[_0x0ab4('0x2c')]:_0xeac8ad[_0x0ab4('0x2d')];if(_0xe3df73[_0x0ab4('0x29')][_0x0ab4('0x42')]){_0x395e0b[_0x0ab4('0x3c')]=[{'all':!![]}];}_0x395e0b=_['merge']({},_0x395e0b,_0xe3df73[_0x0ab4('0x3a')]);return db['ZendeskAccount'][_0x0ab4('0x43')](_0x395e0b)[_0x0ab4('0x21')](handleEntityNotFound(_0x48029f,null))[_0x0ab4('0x21')](respondWithResult(_0x48029f,null))['catch'](handleError(_0x48029f,null));};exports[_0x0ab4('0x44')]=function(_0x1fcc3b,_0x1ce096){return db[_0x0ab4('0x3b')][_0x0ab4('0x44')](_0x1fcc3b[_0x0ab4('0x45')],{})['then'](respondWithResult(_0x1ce096,0xc9))[_0x0ab4('0x3f')](handleError(_0x1ce096,null));};exports[_0x0ab4('0x46')]=function(_0x302894,_0x2801ff){if(_0x302894[_0x0ab4('0x45')]['id']){delete _0x302894[_0x0ab4('0x45')]['id'];}return db[_0x0ab4('0x3b')][_0x0ab4('0x43')]({'where':{'id':_0x302894[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0x2801ff,null))[_0x0ab4('0x21')](saveUpdates(_0x302894[_0x0ab4('0x45')],null))[_0x0ab4('0x21')](respondWithResult(_0x2801ff,null))['catch'](handleError(_0x2801ff,null));};exports[_0x0ab4('0x22')]=function(_0x354bc,_0x5800cc){return db[_0x0ab4('0x3b')]['find']({'where':{'id':_0x354bc['params']['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0x5800cc,null))[_0x0ab4('0x21')](removeEntity(_0x5800cc,null))[_0x0ab4('0x3f')](handleError(_0x5800cc,null));};exports['getConfigurations']=function(_0x12a2df,_0xb3bd1e,_0xeddaa1){var _0xaed2d={};var _0x30ba95={};var _0x3f20de;var _0x1eea3b;return db['ZendeskAccount'][_0x0ab4('0x47')]({'where':{'id':_0x12a2df['params']['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0xb3bd1e,null))['then'](function(_0x2597f2){if(_0x2597f2){_0x3f20de=_0x2597f2;_0x30ba95['model']=_['keys'](db[_0x0ab4('0x48')][_0x0ab4('0x25')]);_0x30ba95[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x12a2df['query']);_0x30ba95[_0x0ab4('0x34')]=_[_0x0ab4('0x2b')](_0x30ba95[_0x0ab4('0x2d')],_0x30ba95[_0x0ab4('0x29')]);_0xaed2d[_0x0ab4('0x2c')]=_[_0x0ab4('0x2b')](_0x30ba95[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0xaed2d[_0x0ab4('0x2c')]=_0xaed2d[_0x0ab4('0x2c')][_0x0ab4('0x2f')]?_0xaed2d[_0x0ab4('0x2c')]:_0x30ba95[_0x0ab4('0x2d')];_0xaed2d[_0x0ab4('0x49')]=qs[_0x0ab4('0x32')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0xaed2d['where']=qs[_0x0ab4('0x34')](_[_0x0ab4('0x35')](_0x12a2df[_0x0ab4('0x29')],_0x30ba95[_0x0ab4('0x34')]));if(_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x36')]){_0xaed2d[_0x0ab4('0x33')]=_[_0x0ab4('0x39')](_0xaed2d['where'],{'$or':_[_0x0ab4('0x37')](_0xaed2d[_0x0ab4('0x2c')],function(_0x54ea92){var _0x48191f={};_0x48191f[_0x54ea92]={'$like':'%'+_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x36')]+'%'};return _0x48191f;})});}_0xaed2d=_['merge']({},_0xaed2d,_0x12a2df['options']);return _0x3f20de[_0x0ab4('0x4a')](_0xaed2d);}})['then'](function(_0x597d26){if(_0x597d26){_0x1eea3b=_0x597d26[_0x0ab4('0x2f')];if(!_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x30')](_0x0ab4('0x31'))){_0xaed2d[_0x0ab4('0x1d')]=qs[_0x0ab4('0x1d')](_0x12a2df[_0x0ab4('0x29')]['limit']);_0xaed2d[_0x0ab4('0x1a')]=qs[_0x0ab4('0x1a')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x1a')]);}return _0x3f20de[_0x0ab4('0x4a')](_0xaed2d);}})[_0x0ab4('0x21')](function(_0x4f1847){if(_0x4f1847){return _0x4f1847?{'count':_0x1eea3b,'rows':_0x4f1847}:null;}})[_0x0ab4('0x21')](respondWithResult(_0xb3bd1e,null))[_0x0ab4('0x3f')](handleError(_0xb3bd1e,null));};exports['addConfiguration']=function(_0x66364c,_0x5b41af,_0x410198){if(_0x66364c['body']['id']){delete _0x66364c[_0x0ab4('0x45')]['id'];}return db[_0x0ab4('0x3b')][_0x0ab4('0x47')]({'where':{'id':_0x66364c[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b41af,null))['then'](function(_0x10dd5b){if(_0x10dd5b){_0x66364c[_0x0ab4('0x45')]['AccountId']=_0x10dd5b['id'];_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4b')]=integrations[_0x0ab4('0x4c')](_0x66364c['body'][_0x0ab4('0x4d')],_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x27')]);_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4e')]=integrations[_0x0ab4('0x4f')](_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4d')],_0x66364c['body']['type']);return db[_0x0ab4('0x48')][_0x0ab4('0x44')](_0x66364c[_0x0ab4('0x45')],{'include':[{'model':db[_0x0ab4('0x50')],'as':'Subjects'},{'model':db[_0x0ab4('0x50')],'as':'Descriptions'}]});}return null;})[_0x0ab4('0x21')](respondWithResult(_0x5b41af,null))[_0x0ab4('0x3f')](handleError(_0x5b41af,null));};exports[_0x0ab4('0x51')]=function(_0x3e5f11,_0x340129,_0x41b65f){var _0x46a008='';return db[_0x0ab4('0x3b')][_0x0ab4('0x47')]({'where':{'id':_0x3e5f11['params']['id']},'attributes':['id',_0x0ab4('0x52'),'password',_0x0ab4('0x53'),_0x0ab4('0x54'),_0x0ab4('0x55')]})[_0x0ab4('0x21')](handleEntityNotFound(_0x340129,null))[_0x0ab4('0x21')](function(_0x32282c){if(_0x32282c){_0x46a008=_0x32282c[_0x0ab4('0x55')];var _0xa3a87c=_0x46a008[_0x0ab4('0x56')](-0x1);if(_0xa3a87c==='/'){_0x46a008=_0x46a008['substring'](0x0,_0x46a008[_0x0ab4('0x57')](_0xa3a87c));}var _0x9b1a87={'method':'GET','uri':util[_0x0ab4('0x58')](_0x0ab4('0x59'),_0x46a008,_0x0ab4('0x5a')),'json':!![]};switch(_0x32282c['authType']){case _0x0ab4('0x5b'):_0x9b1a87[_0x0ab4('0x5c')]={'Authorization':util[_0x0ab4('0x58')](_0x0ab4('0x5d'),new Buffer(util['format']('%s:%s',_0x32282c[_0x0ab4('0x52')],_0x32282c[_0x0ab4('0x5b')]))[_0x0ab4('0x5e')](_0x0ab4('0x5f')))};break;case'token':_0x9b1a87[_0x0ab4('0x5c')]={'Authorization':util[_0x0ab4('0x58')](_0x0ab4('0x5d'),new Buffer(util['format']('%s/token:%s',_0x32282c[_0x0ab4('0x52')],_0x32282c[_0x0ab4('0x53')]))[_0x0ab4('0x5e')](_0x0ab4('0x5f')))};break;default:throw new db[(_0x0ab4('0x60'))][(_0x0ab4('0x61'))](_0x0ab4('0x62'));}return rp(_0x9b1a87);}})['then'](function(_0xe18f04){if(_0xe18f04){var _0x57ed73=['subject',_0x0ab4('0x63'),'group',_0x0ab4('0x64')];_[_0x0ab4('0x65')](_0xe18f04[_0x0ab4('0x5a')],function(_0x368573){return _0x57ed73[_0x0ab4('0x66')](_0x368573['type']);});return{'count':_0xe18f04['ticket_fields'][_0x0ab4('0x2f')],'rows':_[_0x0ab4('0x37')](_0xe18f04['ticket_fields'],function(_0x550cc5){return{'id':_0x550cc5['id'],'name':_0x550cc5[_0x0ab4('0x67')]>0x7?_0x550cc5[_0x0ab4('0x68')]:_0x550cc5['type'],'custom':_0x550cc5[_0x0ab4('0x67')]>0x7?!![]:![],'options':_0x550cc5[_0x0ab4('0x69')]?_0x550cc5[_0x0ab4('0x69')]:_0x550cc5['custom_field_options']?_0x550cc5[_0x0ab4('0x6a')]:[]};})};}})[_0x0ab4('0x21')](respondWithResult(_0x340129,null))[_0x0ab4('0x3f')](function(_0x1be1b9){var _0x4f745e=_0x3e5f11[_0x0ab4('0x29')][_0x0ab4('0x6b')]?0x1f4:_0x1be1b9[_0x0ab4('0x6c')]||0x1f4;logger[_0x0ab4('0x23')](_0x0ab4('0x6d'),_0x0ab4('0x51'),_0x4f745e,JSON[_0x0ab4('0x6e')](_0x1be1b9));delete _0x1be1b9[_0x0ab4('0x24')];if(_0x4f745e===0x191){_0x4f745e=0x190;}_0x340129[_0x0ab4('0x17')](_0x4f745e)[_0x0ab4('0x6f')](_0x3e5f11['query'][_0x0ab4('0x6b')]?{'message':_0x0ab4('0x70'),'statusCode':_0x1be1b9[_0x0ab4('0x6c')]}:_0x1be1b9);});}; \ No newline at end of file +var _0xbfcc=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','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','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZendeskAccount','count','include','findAll','rows','then','catch','show','params','includeAll','find','create','body','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','Basic\x20%s','format','%s:%s','password','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','includes'];(function(_0x3213b7,_0x6789ca){var _0xb960bf=function(_0x2f7f04){while(--_0x2f7f04){_0x3213b7['push'](_0x3213b7['shift']());}};_0xb960bf(++_0x6789ca);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xbfcc[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bfd05,_0x86f67c){_0x86f67c=_0x86f67c||0xcc;return function(_0x80d08d){if(_0x80d08d){return _0x3bfd05['sendStatus'](_0x86f67c);}return _0x3bfd05[_0xcbfc('0x16')](_0x86f67c)[_0xcbfc('0x17')]();};}function respondWithResult(_0x2f2bdd,_0x45a5cc){_0x45a5cc=_0x45a5cc||0xc8;return function(_0x16b659){if(_0x16b659){return _0x2f2bdd['status'](_0x45a5cc)[_0xcbfc('0x18')](_0x16b659);}};}function respondWithFilteredResult(_0x1963de,_0x1ec8c4){return function(_0x4317e4){if(_0x4317e4){var _0x50c6b6=typeof _0x1ec8c4['offset']===_0xcbfc('0x19')&&typeof _0x1ec8c4[_0xcbfc('0x1a')]===_0xcbfc('0x19');var _0x4d6946=_0x4317e4['count'];var _0x33f731=_0x50c6b6?0x0:_0x1ec8c4[_0xcbfc('0x1b')];var _0x344510=_0x50c6b6?_0x4317e4['count']:_0x1ec8c4[_0xcbfc('0x1b')]+_0x1ec8c4['limit'];var _0x28f7fb;if(_0x344510>=_0x4d6946){_0x344510=_0x4d6946;_0x28f7fb=0xc8;}else{_0x28f7fb=0xce;}_0x1963de[_0xcbfc('0x16')](_0x28f7fb);return _0x1963de[_0xcbfc('0x1c')](_0xcbfc('0x1d'),_0x33f731+'-'+_0x344510+'/'+_0x4d6946)[_0xcbfc('0x18')](_0x4317e4);}return null;};}function patchUpdates(_0x2653b1){return function(_0x5f09b0){try{jsonpatch[_0xcbfc('0x1e')](_0x5f09b0,_0x2653b1,!![]);}catch(_0x37ec3e){return BPromise['reject'](_0x37ec3e);}return _0x5f09b0[_0xcbfc('0x1f')]();};}function saveUpdates(_0x5a449b,_0x4cc8b3){return function(_0x4e2427){if(_0x4e2427){return _0x4e2427[_0xcbfc('0x20')](_0x5a449b)['then'](function(_0x4a1915){return _0x4a1915;});}return null;};}function removeEntity(_0x1b3e42,_0x34cffa){return function(_0x3ceeff){if(_0x3ceeff){return _0x3ceeff[_0xcbfc('0x21')]()['then'](function(){_0x1b3e42[_0xcbfc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280b78,_0x75bca0){return function(_0x53951a){if(!_0x53951a){_0x280b78[_0xcbfc('0x22')](0x194);}return _0x53951a;};}function handleError(_0x3b73a3,_0x4ab48e){_0x4ab48e=_0x4ab48e||0x1f4;return function(_0x1b2c01){logger[_0xcbfc('0x23')](_0x1b2c01[_0xcbfc('0x24')]);if(_0x1b2c01[_0xcbfc('0x25')]){delete _0x1b2c01['name'];}_0x3b73a3[_0xcbfc('0x16')](_0x4ab48e)[_0xcbfc('0x26')](_0x1b2c01);};}exports['index']=function(_0x1f6a14,_0x26463f){var _0x7cbdfa={},_0x388d41={},_0x2b4286={'count':0x0,'rows':[]};var _0x19d2e=_[_0xcbfc('0x27')](db['ZendeskAccount'][_0xcbfc('0x28')],function(_0x433300){return{'name':_0x433300[_0xcbfc('0x29')],'type':_0x433300[_0xcbfc('0x2a')]['key']};});_0x388d41[_0xcbfc('0x2b')]=_[_0xcbfc('0x27')](_0x19d2e,_0xcbfc('0x25'));_0x388d41[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x1f6a14[_0xcbfc('0x2c')]);_0x388d41[_0xcbfc('0x2e')]=_['intersection'](_0x388d41[_0xcbfc('0x2b')],_0x388d41[_0xcbfc('0x2c')]);_0x7cbdfa['attributes']=_[_0xcbfc('0x2f')](_0x388d41[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x1f6a14['query']['fields']));_0x7cbdfa['attributes']=_0x7cbdfa[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x7cbdfa[_0xcbfc('0x31')]:_0x388d41[_0xcbfc('0x2b')];if(!_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x33')](_0xcbfc('0x34'))){_0x7cbdfa[_0xcbfc('0x1a')]=qs['limit'](_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x1a')]);_0x7cbdfa['offset']=qs[_0xcbfc('0x1b')](_0x1f6a14['query'][_0xcbfc('0x1b')]);}_0x7cbdfa[_0xcbfc('0x35')]=qs[_0xcbfc('0x36')](_0x1f6a14['query'][_0xcbfc('0x36')]);_0x7cbdfa['where']=qs['filters'](_[_0xcbfc('0x37')](_0x1f6a14[_0xcbfc('0x2c')],_0x388d41[_0xcbfc('0x2e')]),_0x19d2e);if(_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x38')]){_0x7cbdfa[_0xcbfc('0x39')]=_[_0xcbfc('0x3a')](_0x7cbdfa[_0xcbfc('0x39')],{'$or':_['map'](_0x19d2e,function(_0x15fb08){if(_0x15fb08['type']!==_0xcbfc('0x3b')){var _0x44064d={};_0x44064d[_0x15fb08[_0xcbfc('0x25')]]={'$like':'%'+_0x1f6a14[_0xcbfc('0x2c')]['filter']+'%'};return _0x44064d;}})});}_0x7cbdfa=_['merge']({},_0x7cbdfa,_0x1f6a14[_0xcbfc('0x3c')]);var _0x1c678b={'where':_0x7cbdfa[_0xcbfc('0x39')]};return db[_0xcbfc('0x3d')][_0xcbfc('0x3e')](_0x1c678b)['then'](function(_0x1901b4){_0x2b4286[_0xcbfc('0x3e')]=_0x1901b4;if(_0x1f6a14[_0xcbfc('0x2c')]['includeAll']){_0x7cbdfa[_0xcbfc('0x3f')]=[{'all':!![]}];}return db[_0xcbfc('0x3d')][_0xcbfc('0x40')](_0x7cbdfa);})['then'](function(_0x28266c){_0x2b4286[_0xcbfc('0x41')]=_0x28266c;return _0x2b4286;})[_0xcbfc('0x42')](respondWithFilteredResult(_0x26463f,_0x7cbdfa))[_0xcbfc('0x43')](handleError(_0x26463f,null));};exports[_0xcbfc('0x44')]=function(_0x28447a,_0x1e14bb){var _0x561544={'raw':![],'where':{'id':_0x28447a[_0xcbfc('0x45')]['id']}},_0x2de7fe={};_0x2de7fe['model']=_[_0xcbfc('0x2d')](db[_0xcbfc('0x3d')][_0xcbfc('0x28')]);_0x2de7fe[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x28447a[_0xcbfc('0x2c')]);_0x2de7fe[_0xcbfc('0x2e')]=_[_0xcbfc('0x2f')](_0x2de7fe['model'],_0x2de7fe[_0xcbfc('0x2c')]);_0x561544[_0xcbfc('0x31')]=_[_0xcbfc('0x2f')](_0x2de7fe[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x28447a[_0xcbfc('0x2c')][_0xcbfc('0x30')]));_0x561544['attributes']=_0x561544[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x561544['attributes']:_0x2de7fe[_0xcbfc('0x2b')];if(_0x28447a[_0xcbfc('0x2c')][_0xcbfc('0x46')]){_0x561544['include']=[{'all':!![]}];}_0x561544=_[_0xcbfc('0x3a')]({},_0x561544,_0x28447a[_0xcbfc('0x3c')]);return db[_0xcbfc('0x3d')][_0xcbfc('0x47')](_0x561544)[_0xcbfc('0x42')](handleEntityNotFound(_0x1e14bb,null))[_0xcbfc('0x42')](respondWithResult(_0x1e14bb,null))[_0xcbfc('0x43')](handleError(_0x1e14bb,null));};exports['create']=function(_0x5a87b6,_0x237f30){return db[_0xcbfc('0x3d')][_0xcbfc('0x48')](_0x5a87b6[_0xcbfc('0x49')],{})['then'](respondWithResult(_0x237f30,0xc9))['catch'](handleError(_0x237f30,null));};exports[_0xcbfc('0x20')]=function(_0xe5c5ef,_0x12340f){if(_0xe5c5ef['body']['id']){delete _0xe5c5ef[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x3d')][_0xcbfc('0x47')]({'where':{'id':_0xe5c5ef['params']['id']}})[_0xcbfc('0x42')](handleEntityNotFound(_0x12340f,null))[_0xcbfc('0x42')](saveUpdates(_0xe5c5ef[_0xcbfc('0x49')],null))[_0xcbfc('0x42')](respondWithResult(_0x12340f,null))[_0xcbfc('0x43')](handleError(_0x12340f,null));};exports[_0xcbfc('0x21')]=function(_0x222b58,_0x374998){return db[_0xcbfc('0x3d')][_0xcbfc('0x47')]({'where':{'id':_0x222b58['params']['id']}})[_0xcbfc('0x42')](handleEntityNotFound(_0x374998,null))[_0xcbfc('0x42')](removeEntity(_0x374998,null))[_0xcbfc('0x43')](handleError(_0x374998,null));};exports['getConfigurations']=function(_0x28ae7f,_0x1a89c1,_0x4b7038){var _0x54de8={};var _0x5ce8e3={};var _0x38db76;var _0x25e48d;return db['ZendeskAccount'][_0xcbfc('0x4a')]({'where':{'id':_0x28ae7f[_0xcbfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a89c1,null))[_0xcbfc('0x42')](function(_0x34db13){if(_0x34db13){_0x38db76=_0x34db13;_0x5ce8e3[_0xcbfc('0x2b')]=_[_0xcbfc('0x2d')](db[_0xcbfc('0x4b')][_0xcbfc('0x28')]);_0x5ce8e3[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x28ae7f[_0xcbfc('0x2c')]);_0x5ce8e3[_0xcbfc('0x2e')]=_['intersection'](_0x5ce8e3[_0xcbfc('0x2b')],_0x5ce8e3['query']);_0x54de8['attributes']=_['intersection'](_0x5ce8e3[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x30')]));_0x54de8[_0xcbfc('0x31')]=_0x54de8[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x54de8[_0xcbfc('0x31')]:_0x5ce8e3['model'];_0x54de8[_0xcbfc('0x35')]=qs[_0xcbfc('0x36')](_0x28ae7f[_0xcbfc('0x2c')]['sort']);_0x54de8[_0xcbfc('0x39')]=qs[_0xcbfc('0x2e')](_[_0xcbfc('0x37')](_0x28ae7f[_0xcbfc('0x2c')],_0x5ce8e3[_0xcbfc('0x2e')]));if(_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x38')]){_0x54de8['where']=_[_0xcbfc('0x3a')](_0x54de8['where'],{'$or':_[_0xcbfc('0x27')](_0x54de8[_0xcbfc('0x31')],function(_0x5de047){var _0x2c6b23={};_0x2c6b23[_0x5de047]={'$like':'%'+_0x28ae7f['query'][_0xcbfc('0x38')]+'%'};return _0x2c6b23;})});}_0x54de8=_[_0xcbfc('0x3a')]({},_0x54de8,_0x28ae7f[_0xcbfc('0x3c')]);return _0x38db76[_0xcbfc('0x4c')](_0x54de8);}})[_0xcbfc('0x42')](function(_0x1b2b24){if(_0x1b2b24){_0x25e48d=_0x1b2b24['length'];if(!_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x33')]('nolimit')){_0x54de8[_0xcbfc('0x1a')]=qs[_0xcbfc('0x1a')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x1a')]);_0x54de8[_0xcbfc('0x1b')]=qs[_0xcbfc('0x1b')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x1b')]);}return _0x38db76['getConfigurations'](_0x54de8);}})[_0xcbfc('0x42')](function(_0x3f01da){if(_0x3f01da){return _0x3f01da?{'count':_0x25e48d,'rows':_0x3f01da}:null;}})[_0xcbfc('0x42')](respondWithResult(_0x1a89c1,null))[_0xcbfc('0x43')](handleError(_0x1a89c1,null));};exports[_0xcbfc('0x4d')]=function(_0x2fb0c2,_0x209d61,_0x380539){if(_0x2fb0c2[_0xcbfc('0x49')]['id']){delete _0x2fb0c2[_0xcbfc('0x49')]['id'];}return db['ZendeskAccount'][_0xcbfc('0x4a')]({'where':{'id':_0x2fb0c2[_0xcbfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x209d61,null))[_0xcbfc('0x42')](function(_0x510a43){if(_0x510a43){_0x2fb0c2['body'][_0xcbfc('0x4e')]=_0x510a43['id'];_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x4f')]=integrations[_0xcbfc('0x50')](_0x2fb0c2[_0xcbfc('0x49')]['channel'],_0x2fb0c2['body'][_0xcbfc('0x2a')]);_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x51')]=integrations[_0xcbfc('0x52')](_0x2fb0c2[_0xcbfc('0x49')]['channel'],_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x2a')]);return db[_0xcbfc('0x4b')]['create'](_0x2fb0c2['body'],{'include':[{'model':db['ZendeskField'],'as':_0xcbfc('0x4f')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xcbfc('0x42')](respondWithResult(_0x209d61,null))['catch'](handleError(_0x209d61,null));};exports[_0xcbfc('0x53')]=function(_0x34e671,_0xed28ff,_0x461e5b){var _0x16d91a='';return db[_0xcbfc('0x3d')][_0xcbfc('0x4a')]({'where':{'id':_0x34e671[_0xcbfc('0x45')]['id']},'attributes':['id',_0xcbfc('0x54'),'password',_0xcbfc('0x55'),_0xcbfc('0x56'),_0xcbfc('0x57')]})['then'](handleEntityNotFound(_0xed28ff,null))[_0xcbfc('0x42')](function(_0x1640e9){if(_0x1640e9){_0x16d91a=_0x1640e9[_0xcbfc('0x57')];var _0x318346=_0x16d91a[_0xcbfc('0x58')](-0x1);if(_0x318346==='/'){_0x16d91a=_0x16d91a[_0xcbfc('0x59')](0x0,_0x16d91a[_0xcbfc('0x5a')](_0x318346));}var _0x562380={'method':_0xcbfc('0x5b'),'uri':util['format'](_0xcbfc('0x5c'),_0x16d91a,_0xcbfc('0x5d')),'json':!![]};switch(_0x1640e9[_0xcbfc('0x56')]){case'password':_0x562380[_0xcbfc('0x5e')]={'Authorization':util['format'](_0xcbfc('0x5f'),new Buffer(util[_0xcbfc('0x60')](_0xcbfc('0x61'),_0x1640e9[_0xcbfc('0x54')],_0x1640e9[_0xcbfc('0x62')]))[_0xcbfc('0x63')](_0xcbfc('0x64')))};break;case'token':_0x562380[_0xcbfc('0x5e')]={'Authorization':util[_0xcbfc('0x60')](_0xcbfc('0x5f'),new Buffer(util['format'](_0xcbfc('0x65'),_0x1640e9['username'],_0x1640e9[_0xcbfc('0x55')]))[_0xcbfc('0x63')](_0xcbfc('0x64')))};break;default:throw new db['Sequelize'][(_0xcbfc('0x66'))](_0xcbfc('0x67'));}return rp(_0x562380);}})['then'](function(_0xb3378d){if(_0xb3378d){var _0x58be73=[_0xcbfc('0x68'),'description',_0xcbfc('0x69'),_0xcbfc('0x6a')];_['remove'](_0xb3378d[_0xcbfc('0x5d')],function(_0x4cf2e1){return _0x58be73[_0xcbfc('0x6b')](_0x4cf2e1[_0xcbfc('0x2a')]);});return{'count':_0xb3378d[_0xcbfc('0x5d')][_0xcbfc('0x32')],'rows':_['map'](_0xb3378d[_0xcbfc('0x5d')],function(_0x4c1e0a){return{'id':_0x4c1e0a['id'],'name':_0x4c1e0a[_0xcbfc('0x6c')]>0x7?_0x4c1e0a[_0xcbfc('0x6d')]:_0x4c1e0a[_0xcbfc('0x2a')],'custom':_0x4c1e0a[_0xcbfc('0x6c')]>0x7?!![]:![],'options':_0x4c1e0a[_0xcbfc('0x6e')]?_0x4c1e0a[_0xcbfc('0x6e')]:_0x4c1e0a[_0xcbfc('0x6f')]?_0x4c1e0a[_0xcbfc('0x6f')]:[]};})};}})[_0xcbfc('0x42')](respondWithResult(_0xed28ff,null))[_0xcbfc('0x43')](function(_0x3a3b24){var _0x297513=_0x34e671[_0xcbfc('0x2c')][_0xcbfc('0x70')]?0x1f4:_0x3a3b24[_0xcbfc('0x71')]||0x1f4;logger[_0xcbfc('0x23')](_0xcbfc('0x72'),'getFields',_0x297513,JSON[_0xcbfc('0x73')](_0x3a3b24));delete _0x3a3b24['name'];if(_0x297513===0x191){_0x297513=0x190;}_0xed28ff[_0xcbfc('0x16')](_0x297513)['send'](_0x34e671[_0xcbfc('0x2c')][_0xcbfc('0x70')]?{'message':_0xcbfc('0x74'),'statusCode':_0x3a3b24[_0xcbfc('0x71')]}:_0x3a3b24);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 5d5ad98..af873f4 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 _0x3add=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xcecf6d,_0x17a2cb){var _0x333654=function(_0x5b9a68){while(--_0x5b9a68){_0xcecf6d['push'](_0xcecf6d['shift']());}};_0x333654(++_0x17a2cb);}(_0x3add,0x186));var _0xd3ad=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x3add[_0x213518];return _0x1baf75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd3ad('0x0'))('api');var moment=require(_0xd3ad('0x1'));var BPromise=require(_0xd3ad('0x2'));var rp=require(_0xd3ad('0x3'));var fs=require('fs');var path=require(_0xd3ad('0x4'));var rimraf=require(_0xd3ad('0x5'));var config=require(_0xd3ad('0x6'));var attributes=require(_0xd3ad('0x7'));var integrations=require(_0xd3ad('0x8'));module[_0xd3ad('0x9')]=function(_0x1b96b1,_0x51749d){return _0x1b96b1[_0xd3ad('0xa')](_0xd3ad('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f2d=['./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0xa90e10,_0x377ff7){var _0xe61724=function(_0x3695b4){while(--_0x3695b4){_0xa90e10['push'](_0xa90e10['shift']());}};_0xe61724(++_0x377ff7);}(_0x2f2d,0x1c0));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd2f2('0x0'));var util=require(_0xd2f2('0x1'));var logger=require(_0xd2f2('0x2'))(_0xd2f2('0x3'));var moment=require('moment');var BPromise=require(_0xd2f2('0x4'));var rp=require(_0xd2f2('0x5'));var fs=require('fs');var path=require(_0xd2f2('0x6'));var rimraf=require('rimraf');var config=require(_0xd2f2('0x7'));var attributes=require(_0xd2f2('0x8'));var integrations=require(_0xd2f2('0x9'));module['exports']=function(_0x2dce8e,_0x9ee940){return _0x2dce8e[_0xd2f2('0xa')](_0xd2f2('0xb'),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 1962bd5..9341608 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 _0x4670=['http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetZendeskAccount','options','raw','where','limit','include','map','model','attributes','catch','ShowZendeskAccount','find','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3bd292,_0x5321e2){var _0x2720d0=function(_0x397e7c){while(--_0x397e7c){_0x3bd292['push'](_0x3bd292['shift']());}};_0x2720d0(++_0x5321e2);}(_0x4670,0xf0));var _0x0467=function(_0x16b46d,_0x54a2f5){_0x16b46d=_0x16b46d-0x0;var _0x516cf3=_0x4670[_0x16b46d];return _0x516cf3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0467('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0467('0x1'))['db'];var utils=require(_0x0467('0x2'));var logger=require(_0x0467('0x3'))(_0x0467('0x4'));var config=require(_0x0467('0x5'));var jayson=require(_0x0467('0x6'));var client=jayson[_0x0467('0x7')][_0x0467('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a93d1,_0x48dc7d,_0x1b0367){return new BPromise(function(_0x379b8a,_0x536688){return client['request'](_0x4a93d1,_0x1b0367)[_0x0467('0x9')](function(_0x335078){logger[_0x0467('0xa')](_0x0467('0xb'),_0x48dc7d,_0x0467('0xc'));logger[_0x0467('0xd')](_0x0467('0xe'),_0x48dc7d,_0x0467('0xc'),JSON[_0x0467('0xf')](_0x335078));if(_0x335078['error']){if(_0x335078[_0x0467('0x10')][_0x0467('0x11')]===0x1f4){logger[_0x0467('0x10')](_0x0467('0xb'),_0x48dc7d,_0x335078[_0x0467('0x10')]['message']);return _0x536688(_0x335078['error']['message']);}logger[_0x0467('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x48dc7d,_0x335078[_0x0467('0x10')][_0x0467('0x12')]);return _0x379b8a(_0x335078[_0x0467('0x10')][_0x0467('0x12')]);}else{logger['info'](_0x0467('0xb'),_0x48dc7d,_0x0467('0xc'));_0x379b8a(_0x335078['result'][_0x0467('0x12')]);}})['catch'](function(_0x5abe20){logger[_0x0467('0x10')](_0x0467('0xb'),_0x48dc7d,_0x5abe20);_0x536688(_0x5abe20);});});}exports[_0x0467('0x13')]=function(_0x530527){var _0x47dad6=this;return new Promise(function(_0x3cf613,_0x1018a8){return db['ZendeskAccount']['findAll']({'raw':_0x530527['options']?_0x530527[_0x0467('0x14')][_0x0467('0x15')]===undefined?!![]:![]:!![],'where':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')][_0x0467('0x16')]||null:null,'attributes':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')]['attributes']||null:null,'limit':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')][_0x0467('0x17')]||null:null,'include':_0x530527[_0x0467('0x14')]?_0x530527[_0x0467('0x14')][_0x0467('0x18')]?_[_0x0467('0x19')](_0x530527['options'][_0x0467('0x18')],function(_0x584747){return{'model':db[_0x584747[_0x0467('0x1a')]],'as':_0x584747['as'],'attributes':_0x584747[_0x0467('0x1b')],'include':_0x584747[_0x0467('0x18')]?_[_0x0467('0x19')](_0x584747[_0x0467('0x18')],function(_0x519de9){return{'model':db[_0x519de9[_0x0467('0x1a')]],'as':_0x519de9['as'],'attributes':_0x519de9[_0x0467('0x1b')],'include':_0x519de9['include']?_['map'](_0x519de9['include'],function(_0x263b58){return{'model':db[_0x263b58[_0x0467('0x1a')]],'as':_0x263b58['as'],'attributes':_0x263b58[_0x0467('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0467('0x9')](function(_0xc4861e){logger[_0x0467('0xa')](_0x0467('0x13'),_0x530527);logger[_0x0467('0xd')](_0x0467('0x13'),_0x530527,JSON['stringify'](_0xc4861e));_0x3cf613(_0xc4861e);})[_0x0467('0x1c')](function(_0x315267){logger[_0x0467('0x10')](_0x0467('0x13'),_0x315267[_0x0467('0x12')],_0x530527);_0x1018a8(_0x47dad6[_0x0467('0x10')](0x1f4,_0x315267[_0x0467('0x12')]));});});};exports[_0x0467('0x1d')]=function(_0x153e3e){var _0x3f13eb=this;return new Promise(function(_0xe48638,_0x43e5b2){return db['ZendeskAccount'][_0x0467('0x1e')]({'raw':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')][_0x0467('0x16')]||null:null,'attributes':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')][_0x0467('0x1b')]||null:null,'include':_0x153e3e[_0x0467('0x14')]?_0x153e3e[_0x0467('0x14')][_0x0467('0x18')]?_['map'](_0x153e3e[_0x0467('0x14')]['include'],function(_0x14ef4e){return{'model':db[_0x14ef4e[_0x0467('0x1a')]],'as':_0x14ef4e['as'],'attributes':_0x14ef4e['attributes'],'include':_0x14ef4e[_0x0467('0x18')]?_[_0x0467('0x19')](_0x14ef4e[_0x0467('0x18')],function(_0x24b842){return{'model':db[_0x24b842[_0x0467('0x1a')]],'as':_0x24b842['as'],'attributes':_0x24b842[_0x0467('0x1b')],'include':_0x24b842[_0x0467('0x18')]?_[_0x0467('0x19')](_0x24b842[_0x0467('0x18')],function(_0x1d16b2){return{'model':db[_0x1d16b2['model']],'as':_0x1d16b2['as'],'attributes':_0x1d16b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x0467('0x9')](function(_0x5b72ac){logger['info'](_0x0467('0x1d'),_0x153e3e);logger[_0x0467('0xd')](_0x0467('0x1d'),_0x153e3e,JSON[_0x0467('0xf')](_0x5b72ac));_0xe48638(_0x5b72ac);})[_0x0467('0x1c')](function(_0x356a36){logger[_0x0467('0x10')](_0x0467('0x1d'),_0x356a36[_0x0467('0x12')],_0x153e3e);_0x43e5b2(_0x3f13eb['error'](0x1f4,_0x356a36[_0x0467('0x12')]));});});}; \ No newline at end of file +var _0x5554=['ZendeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','limit','map','include','attributes','model','ShowZendeskAccount','find','raw','where','lodash','util','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x5554,0xfc));var _0x4555=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x5554[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x4555('0x0'));var util=require(_0x4555('0x1'));var moment=require(_0x4555('0x2'));var BPromise=require(_0x4555('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4555('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4555('0x5'));var jayson=require(_0x4555('0x6'));var client=jayson[_0x4555('0x7')][_0x4555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x94b9ff,_0x336a9c,_0x165016){return new BPromise(function(_0x2e1b43,_0x394927){return client[_0x4555('0x9')](_0x94b9ff,_0x165016)[_0x4555('0xa')](function(_0x19669d){logger[_0x4555('0xb')](_0x4555('0xc'),_0x336a9c,'request\x20sent');logger[_0x4555('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x336a9c,_0x4555('0xe'),JSON[_0x4555('0xf')](_0x19669d));if(_0x19669d[_0x4555('0x10')]){if(_0x19669d[_0x4555('0x10')][_0x4555('0x11')]===0x1f4){logger[_0x4555('0x10')](_0x4555('0xc'),_0x336a9c,_0x19669d['error'][_0x4555('0x12')]);return _0x394927(_0x19669d[_0x4555('0x10')][_0x4555('0x12')]);}logger[_0x4555('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x336a9c,_0x19669d['error'][_0x4555('0x12')]);return _0x2e1b43(_0x19669d[_0x4555('0x10')][_0x4555('0x12')]);}else{logger[_0x4555('0xb')](_0x4555('0xc'),_0x336a9c,_0x4555('0xe'));_0x2e1b43(_0x19669d[_0x4555('0x13')][_0x4555('0x12')]);}})[_0x4555('0x14')](function(_0x393f4a){logger[_0x4555('0x10')](_0x4555('0xc'),_0x336a9c,_0x393f4a);_0x394927(_0x393f4a);});});}exports[_0x4555('0x15')]=function(_0x55ed4c){var _0x526cb6=this;return new Promise(function(_0x17fec6,_0x4e351d){return db['ZendeskAccount'][_0x4555('0x16')]({'raw':_0x55ed4c[_0x4555('0x17')]?_0x55ed4c[_0x4555('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x55ed4c[_0x4555('0x17')]?_0x55ed4c[_0x4555('0x17')]['where']||null:null,'attributes':_0x55ed4c['options']?_0x55ed4c[_0x4555('0x17')]['attributes']||null:null,'limit':_0x55ed4c[_0x4555('0x17')]?_0x55ed4c[_0x4555('0x17')][_0x4555('0x18')]||null:null,'include':_0x55ed4c[_0x4555('0x17')]?_0x55ed4c['options']['include']?_[_0x4555('0x19')](_0x55ed4c['options'][_0x4555('0x1a')],function(_0x1e8e25){return{'model':db[_0x1e8e25['model']],'as':_0x1e8e25['as'],'attributes':_0x1e8e25[_0x4555('0x1b')],'include':_0x1e8e25[_0x4555('0x1a')]?_['map'](_0x1e8e25['include'],function(_0x211b47){return{'model':db[_0x211b47[_0x4555('0x1c')]],'as':_0x211b47['as'],'attributes':_0x211b47['attributes'],'include':_0x211b47['include']?_[_0x4555('0x19')](_0x211b47[_0x4555('0x1a')],function(_0x1af6f1){return{'model':db[_0x1af6f1[_0x4555('0x1c')]],'as':_0x1af6f1['as'],'attributes':_0x1af6f1[_0x4555('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4555('0xa')](function(_0x242a43){logger[_0x4555('0xb')](_0x4555('0x15'),_0x55ed4c);logger[_0x4555('0xd')](_0x4555('0x15'),_0x55ed4c,JSON['stringify'](_0x242a43));_0x17fec6(_0x242a43);})[_0x4555('0x14')](function(_0x263d75){logger[_0x4555('0x10')](_0x4555('0x15'),_0x263d75[_0x4555('0x12')],_0x55ed4c);_0x4e351d(_0x526cb6[_0x4555('0x10')](0x1f4,_0x263d75[_0x4555('0x12')]));});});};exports[_0x4555('0x1d')]=function(_0x44f196){var _0x1ab041=this;return new Promise(function(_0x367124,_0x42bbeb){return db['ZendeskAccount'][_0x4555('0x1e')]({'raw':_0x44f196[_0x4555('0x17')]?_0x44f196[_0x4555('0x17')][_0x4555('0x1f')]===undefined?!![]:![]:!![],'where':_0x44f196[_0x4555('0x17')]?_0x44f196[_0x4555('0x17')][_0x4555('0x20')]||null:null,'attributes':_0x44f196['options']?_0x44f196[_0x4555('0x17')]['attributes']||null:null,'include':_0x44f196[_0x4555('0x17')]?_0x44f196['options'][_0x4555('0x1a')]?_[_0x4555('0x19')](_0x44f196[_0x4555('0x17')][_0x4555('0x1a')],function(_0x265ccc){return{'model':db[_0x265ccc[_0x4555('0x1c')]],'as':_0x265ccc['as'],'attributes':_0x265ccc[_0x4555('0x1b')],'include':_0x265ccc[_0x4555('0x1a')]?_[_0x4555('0x19')](_0x265ccc[_0x4555('0x1a')],function(_0x4ad440){return{'model':db[_0x4ad440[_0x4555('0x1c')]],'as':_0x4ad440['as'],'attributes':_0x4ad440[_0x4555('0x1b')],'include':_0x4ad440['include']?_[_0x4555('0x19')](_0x4ad440[_0x4555('0x1a')],function(_0x1d036e){return{'model':db[_0x1d036e[_0x4555('0x1c')]],'as':_0x1d036e['as'],'attributes':_0x1d036e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4555('0xa')](function(_0x3eb71b){logger[_0x4555('0xb')]('ShowZendeskAccount',_0x44f196);logger[_0x4555('0xd')](_0x4555('0x1d'),_0x44f196,JSON[_0x4555('0xf')](_0x3eb71b));_0x367124(_0x3eb71b);})[_0x4555('0x14')](function(_0x5c4f9e){logger['error']('ShowZendeskAccount',_0x5c4f9e[_0x4555('0x12')],_0x44f196);_0x42bbeb(_0x1ab041[_0x4555('0x10')](0x1f4,_0x5c4f9e[_0x4555('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 775368b..abf8bc4 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 _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb7e7,0x121));var _0x7b7e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb7e7[_0x173441];return _0x2423a8;};'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('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file +var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0xa3d2d8,_0x2b23c7){var _0x1c4b8a=function(_0x51bd4d){while(--_0x51bd4d){_0xa3d2d8['push'](_0xa3d2d8['shift']());}};_0x1c4b8a(++_0x2b23c7);}(_0xa571,0x107));var _0x1a57=function(_0xcd40f6,_0x45e0df){_0xcd40f6=_0xcd40f6-0x0;var _0x464ee5=_0xa571[_0xcd40f6];return _0x464ee5;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9ab653a..700443c 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 _0x573f=['sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x573f,0x111));var _0xf573=function(_0x318aed,_0x1ff597){_0x318aed=_0x318aed-0x0;var _0x175447=_0x573f[_0x318aed];return _0x175447;};'use strict';var Sequelize=require(_0xf573('0x0'));module[_0xf573('0x1')]={'name':{'type':Sequelize[_0xf573('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbc8d=['STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbc8d,0x15a));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdbc8('0x0'));module[_0xdbc8('0x1')]={'name':{'type':Sequelize[_0xdbc8('0x2')]},'description':{'type':Sequelize[_0xdbc8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 202ab7d..6b21aa6 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 _0x7331=['mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','offset','count','set','apply','reject','save','then','destroy','end','error','name','send','index','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','include','findAll','rows','catch','show','params','filters','create','body','find','getFields','ZendeskField','length','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x50a9d6,_0x12e0a5){var _0x300536=function(_0x4c6afd){while(--_0x4c6afd){_0x50a9d6['push'](_0x50a9d6['shift']());}};_0x300536(++_0x12e0a5);}(_0x7331,0x1e1));var _0x1733=function(_0x51b655,_0x2c9c79){_0x51b655=_0x51b655-0x0;var _0x4e130b=_0x7331[_0x51b655];return _0x4e130b;};'use strict';var emlformat=require(_0x1733('0x0'));var rimraf=require(_0x1733('0x1'));var zipdir=require(_0x1733('0x2'));var jsonpatch=require(_0x1733('0x3'));var rp=require(_0x1733('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1733('0x5'));var util=require(_0x1733('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1733('0x7'));var fs=require('fs');var fs_extra=require(_0x1733('0x8'));var _=require('lodash');var squel=require(_0x1733('0x9'));var crypto=require(_0x1733('0xa'));var jsforce=require(_0x1733('0xb'));var deskjs=require(_0x1733('0xc'));var toCsv=require(_0x1733('0xd'));var querystring=require(_0x1733('0xe'));var Papa=require(_0x1733('0xf'));var Redis=require(_0x1733('0x10'));var authService=require(_0x1733('0x11'));var qs=require(_0x1733('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1733('0x13'))(_0x1733('0x14'));var utils=require('../../config/utils');var config=require(_0x1733('0x15'));var licenseUtil=require(_0x1733('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x202461,_0x394402){_0x394402=_0x394402||0xcc;return function(_0x4fed5e){if(_0x4fed5e){return _0x202461[_0x1733('0x17')](_0x394402);}return _0x202461[_0x1733('0x18')](_0x394402)['end']();};}function respondWithResult(_0x56d757,_0x3398fd){_0x3398fd=_0x3398fd||0xc8;return function(_0xb1077){if(_0xb1077){return _0x56d757[_0x1733('0x18')](_0x3398fd)[_0x1733('0x19')](_0xb1077);}};}function respondWithFilteredResult(_0x58fe51,_0x757b33){return function(_0x277341){if(_0x277341){var _0x4d6f6c=typeof _0x757b33['offset']==='undefined'&&typeof _0x757b33[_0x1733('0x1a')]===_0x1733('0x1b');var _0x3e3911=_0x277341['count'];var _0x26c322=_0x4d6f6c?0x0:_0x757b33[_0x1733('0x1c')];var _0x1494e8=_0x4d6f6c?_0x277341[_0x1733('0x1d')]:_0x757b33['offset']+_0x757b33[_0x1733('0x1a')];var _0x24bea3;if(_0x1494e8>=_0x3e3911){_0x1494e8=_0x3e3911;_0x24bea3=0xc8;}else{_0x24bea3=0xce;}_0x58fe51['status'](_0x24bea3);return _0x58fe51[_0x1733('0x1e')]('Content-Range',_0x26c322+'-'+_0x1494e8+'/'+_0x3e3911)[_0x1733('0x19')](_0x277341);}return null;};}function patchUpdates(_0x3deaf9){return function(_0x553a42){try{jsonpatch[_0x1733('0x1f')](_0x553a42,_0x3deaf9,!![]);}catch(_0x243878){return BPromise[_0x1733('0x20')](_0x243878);}return _0x553a42[_0x1733('0x21')]();};}function saveUpdates(_0x5f30bc,_0x13a288){return function(_0x54887a){if(_0x54887a){return _0x54887a['update'](_0x5f30bc)[_0x1733('0x22')](function(_0x49d382){return _0x49d382;});}return null;};}function removeEntity(_0x58be1b,_0x526b29){return function(_0x5c74bd){if(_0x5c74bd){return _0x5c74bd[_0x1733('0x23')]()[_0x1733('0x22')](function(){_0x58be1b[_0x1733('0x18')](0xcc)[_0x1733('0x24')]();});}};}function handleEntityNotFound(_0x35ee4c,_0x244848){return function(_0x34fde7){if(!_0x34fde7){_0x35ee4c[_0x1733('0x17')](0x194);}return _0x34fde7;};}function handleError(_0x1e1595,_0x1a5b48){_0x1a5b48=_0x1a5b48||0x1f4;return function(_0x5b629a){logger[_0x1733('0x25')](_0x5b629a['stack']);if(_0x5b629a[_0x1733('0x26')]){delete _0x5b629a[_0x1733('0x26')];}_0x1e1595[_0x1733('0x18')](_0x1a5b48)[_0x1733('0x27')](_0x5b629a);};}exports[_0x1733('0x28')]=function(_0x91d051,_0x25dd7c){var _0x540d12={},_0x132d30={},_0x1ada43={'count':0x0,'rows':[]};var _0x1fccfd=_['map'](db['ZendeskConfiguration'][_0x1733('0x29')],function(_0x435052){return{'name':_0x435052['fieldName'],'type':_0x435052[_0x1733('0x2a')]['key']};});_0x132d30[_0x1733('0x2b')]=_[_0x1733('0x2c')](_0x1fccfd,_0x1733('0x26'));_0x132d30[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x91d051[_0x1733('0x2d')]);_0x132d30['filters']=_[_0x1733('0x2f')](_0x132d30[_0x1733('0x2b')],_0x132d30[_0x1733('0x2d')]);_0x540d12[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x132d30['model'],qs[_0x1733('0x31')](_0x91d051[_0x1733('0x2d')][_0x1733('0x31')]));_0x540d12['attributes']=_0x540d12[_0x1733('0x30')]['length']?_0x540d12[_0x1733('0x30')]:_0x132d30['model'];if(!_0x91d051[_0x1733('0x2d')][_0x1733('0x32')](_0x1733('0x33'))){_0x540d12[_0x1733('0x1a')]=qs['limit'](_0x91d051[_0x1733('0x2d')][_0x1733('0x1a')]);_0x540d12[_0x1733('0x1c')]=qs[_0x1733('0x1c')](_0x91d051[_0x1733('0x2d')][_0x1733('0x1c')]);}_0x540d12[_0x1733('0x34')]=qs[_0x1733('0x35')](_0x91d051[_0x1733('0x2d')][_0x1733('0x35')]);_0x540d12[_0x1733('0x36')]=qs['filters'](_[_0x1733('0x37')](_0x91d051[_0x1733('0x2d')],_0x132d30['filters']),_0x1fccfd);if(_0x91d051[_0x1733('0x2d')][_0x1733('0x38')]){_0x540d12[_0x1733('0x36')]=_[_0x1733('0x39')](_0x540d12['where'],{'$or':_[_0x1733('0x2c')](_0x1fccfd,function(_0x24d577){if(_0x24d577[_0x1733('0x2a')]!==_0x1733('0x3a')){var _0x12dadc={};_0x12dadc[_0x24d577[_0x1733('0x26')]]={'$like':'%'+_0x91d051[_0x1733('0x2d')][_0x1733('0x38')]+'%'};return _0x12dadc;}})});}_0x540d12=_[_0x1733('0x39')]({},_0x540d12,_0x91d051[_0x1733('0x3b')]);var _0xff311={'where':_0x540d12['where']};return db[_0x1733('0x3c')][_0x1733('0x1d')](_0xff311)[_0x1733('0x22')](function(_0x4d292c){_0x1ada43[_0x1733('0x1d')]=_0x4d292c;if(_0x91d051[_0x1733('0x2d')]['includeAll']){_0x540d12[_0x1733('0x3d')]=[{'all':!![]}];}return db[_0x1733('0x3c')][_0x1733('0x3e')](_0x540d12);})[_0x1733('0x22')](function(_0x920d9f){_0x1ada43[_0x1733('0x3f')]=_0x920d9f;return _0x1ada43;})[_0x1733('0x22')](respondWithFilteredResult(_0x25dd7c,_0x540d12))[_0x1733('0x40')](handleError(_0x25dd7c,null));};exports[_0x1733('0x41')]=function(_0x1dc4e0,_0x188568){var _0x523dc0={'raw':![],'where':{'id':_0x1dc4e0[_0x1733('0x42')]['id']}},_0x284b7f={};_0x284b7f['model']=_[_0x1733('0x2e')](db[_0x1733('0x3c')][_0x1733('0x29')]);_0x284b7f[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x1dc4e0[_0x1733('0x2d')]);_0x284b7f[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x284b7f[_0x1733('0x2b')],_0x284b7f['query']);_0x523dc0[_0x1733('0x30')]=_['intersection'](_0x284b7f['model'],qs[_0x1733('0x31')](_0x1dc4e0[_0x1733('0x2d')][_0x1733('0x31')]));_0x523dc0[_0x1733('0x30')]=_0x523dc0[_0x1733('0x30')]['length']?_0x523dc0[_0x1733('0x30')]:_0x284b7f['model'];if(_0x1dc4e0[_0x1733('0x2d')]['includeAll']){_0x523dc0[_0x1733('0x3d')]=[{'all':!![]}];}_0x523dc0=_[_0x1733('0x39')]({},_0x523dc0,_0x1dc4e0[_0x1733('0x3b')]);return db[_0x1733('0x3c')]['find'](_0x523dc0)[_0x1733('0x22')](handleEntityNotFound(_0x188568,null))[_0x1733('0x22')](respondWithResult(_0x188568,null))['catch'](handleError(_0x188568,null));};exports[_0x1733('0x44')]=function(_0x36b955,_0x333caa){return db[_0x1733('0x3c')][_0x1733('0x44')](_0x36b955['body'],{})[_0x1733('0x22')](respondWithResult(_0x333caa,0xc9))['catch'](handleError(_0x333caa,null));};exports['update']=function(_0xa004bb,_0x23adc1){if(_0xa004bb['body']['id']){delete _0xa004bb[_0x1733('0x45')]['id'];}return db[_0x1733('0x3c')][_0x1733('0x46')]({'where':{'id':_0xa004bb[_0x1733('0x42')]['id']}})['then'](handleEntityNotFound(_0x23adc1,null))[_0x1733('0x22')](saveUpdates(_0xa004bb[_0x1733('0x45')],null))[_0x1733('0x22')](respondWithResult(_0x23adc1,null))['catch'](handleError(_0x23adc1,null));};exports['destroy']=function(_0x3ac097,_0xffc99a){return db['ZendeskConfiguration'][_0x1733('0x46')]({'where':{'id':_0x3ac097[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0xffc99a,null))[_0x1733('0x22')](removeEntity(_0xffc99a,null))[_0x1733('0x40')](handleError(_0xffc99a,null));};exports[_0x1733('0x47')]=function(_0x3829ea,_0x15f579,_0x2ecbf4){var _0x54981f={};var _0x38786a={};var _0x386973;var _0x511cf1;return db[_0x1733('0x3c')]['findOne']({'where':{'id':_0x3829ea[_0x1733('0x42')]['id']}})['then'](handleEntityNotFound(_0x15f579,null))['then'](function(_0x50be41){if(_0x50be41){_0x386973=_0x50be41;_0x38786a['model']=_[_0x1733('0x2e')](db[_0x1733('0x48')]['rawAttributes']);_0x38786a[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x3829ea[_0x1733('0x2d')]);_0x38786a[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x38786a['model'],_0x38786a[_0x1733('0x2d')]);_0x54981f[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x38786a[_0x1733('0x2b')],qs['fields'](_0x3829ea['query']['fields']));_0x54981f['attributes']=_0x54981f[_0x1733('0x30')][_0x1733('0x49')]?_0x54981f['attributes']:_0x38786a[_0x1733('0x2b')];_0x54981f[_0x1733('0x34')]=qs[_0x1733('0x35')](_0x3829ea[_0x1733('0x2d')][_0x1733('0x35')]);_0x54981f[_0x1733('0x36')]=qs[_0x1733('0x43')](_[_0x1733('0x37')](_0x3829ea[_0x1733('0x2d')],_0x38786a['filters']));if(_0x3829ea[_0x1733('0x2d')][_0x1733('0x38')]){_0x54981f[_0x1733('0x36')]=_[_0x1733('0x39')](_0x54981f[_0x1733('0x36')],{'$or':_[_0x1733('0x2c')](_0x54981f['attributes'],function(_0x4e0e3e){var _0x465fe8={};_0x465fe8[_0x4e0e3e]={'$like':'%'+_0x3829ea[_0x1733('0x2d')][_0x1733('0x38')]+'%'};return _0x465fe8;})});}_0x54981f=_[_0x1733('0x39')]({},_0x54981f,_0x3829ea['options']);return _0x386973['getFields'](_0x54981f);}})[_0x1733('0x22')](function(_0x4d1b59){if(_0x4d1b59){_0x511cf1=_0x4d1b59[_0x1733('0x49')];if(!_0x3829ea[_0x1733('0x2d')][_0x1733('0x32')](_0x1733('0x33'))){_0x54981f[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x3829ea[_0x1733('0x2d')]['limit']);_0x54981f['offset']=qs[_0x1733('0x1c')](_0x3829ea[_0x1733('0x2d')]['offset']);}return _0x386973[_0x1733('0x47')](_0x54981f);}})['then'](function(_0x333e9c){if(_0x333e9c){return _0x333e9c?{'count':_0x511cf1,'rows':_0x333e9c}:null;}})[_0x1733('0x22')](respondWithResult(_0x15f579,null))[_0x1733('0x40')](handleError(_0x15f579,null));};exports[_0x1733('0x4a')]=function(_0x3e4fde,_0x30de7a,_0x49defe){var _0x3c3622={};var _0x1c705b={};var _0x23155d;var _0x26ae09;return db[_0x1733('0x3c')][_0x1733('0x4b')]({'where':{'id':_0x3e4fde[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0x30de7a,null))[_0x1733('0x22')](function(_0x352e1c){if(_0x352e1c){_0x23155d=_0x352e1c;_0x1c705b[_0x1733('0x2b')]=_[_0x1733('0x2e')](db[_0x1733('0x48')]['rawAttributes']);_0x1c705b[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x3e4fde[_0x1733('0x2d')]);_0x1c705b[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x1c705b[_0x1733('0x2b')],_0x1c705b['query']);_0x3c3622['attributes']=_[_0x1733('0x2f')](_0x1c705b[_0x1733('0x2b')],qs['fields'](_0x3e4fde['query'][_0x1733('0x31')]));_0x3c3622[_0x1733('0x30')]=_0x3c3622[_0x1733('0x30')][_0x1733('0x49')]?_0x3c3622['attributes']:_0x1c705b[_0x1733('0x2b')];_0x3c3622[_0x1733('0x34')]=qs['sort'](_0x3e4fde[_0x1733('0x2d')][_0x1733('0x35')]);_0x3c3622[_0x1733('0x36')]=qs[_0x1733('0x43')](_[_0x1733('0x37')](_0x3e4fde['query'],_0x1c705b[_0x1733('0x43')]));if(_0x3e4fde[_0x1733('0x2d')][_0x1733('0x38')]){_0x3c3622[_0x1733('0x36')]=_[_0x1733('0x39')](_0x3c3622[_0x1733('0x36')],{'$or':_[_0x1733('0x2c')](_0x3c3622['attributes'],function(_0xe32662){var _0x4ad96b={};_0x4ad96b[_0xe32662]={'$like':'%'+_0x3e4fde[_0x1733('0x2d')][_0x1733('0x38')]+'%'};return _0x4ad96b;})});}_0x3c3622=_[_0x1733('0x39')]({},_0x3c3622,_0x3e4fde['options']);return _0x23155d[_0x1733('0x4a')](_0x3c3622);}})['then'](function(_0x29edcd){if(_0x29edcd){_0x26ae09=_0x29edcd[_0x1733('0x49')];if(!_0x3e4fde[_0x1733('0x2d')][_0x1733('0x32')](_0x1733('0x33'))){_0x3c3622[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x3e4fde[_0x1733('0x2d')][_0x1733('0x1a')]);_0x3c3622['offset']=qs[_0x1733('0x1c')](_0x3e4fde[_0x1733('0x2d')][_0x1733('0x1c')]);}return _0x23155d['getSubjects'](_0x3c3622);}})[_0x1733('0x22')](function(_0x494306){if(_0x494306){return _0x494306?{'count':_0x26ae09,'rows':_0x494306}:null;}})[_0x1733('0x22')](respondWithResult(_0x30de7a,null))['catch'](handleError(_0x30de7a,null));};exports[_0x1733('0x4c')]=function(_0x97e07a,_0x39da11,_0xc17f65){var _0x4df492={};var _0x1a8816={};var _0x551c04;var _0x2ee534;return db[_0x1733('0x3c')][_0x1733('0x4b')]({'where':{'id':_0x97e07a[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0x39da11,null))[_0x1733('0x22')](function(_0x35dbb1){if(_0x35dbb1){_0x551c04=_0x35dbb1;_0x1a8816[_0x1733('0x2b')]=_['keys'](db[_0x1733('0x48')]['rawAttributes']);_0x1a8816[_0x1733('0x2d')]=_[_0x1733('0x2e')](_0x97e07a['query']);_0x1a8816[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x1a8816[_0x1733('0x2b')],_0x1a8816[_0x1733('0x2d')]);_0x4df492[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x1a8816[_0x1733('0x2b')],qs[_0x1733('0x31')](_0x97e07a[_0x1733('0x2d')]['fields']));_0x4df492[_0x1733('0x30')]=_0x4df492[_0x1733('0x30')]['length']?_0x4df492[_0x1733('0x30')]:_0x1a8816[_0x1733('0x2b')];_0x4df492['order']=qs[_0x1733('0x35')](_0x97e07a[_0x1733('0x2d')][_0x1733('0x35')]);_0x4df492[_0x1733('0x36')]=qs[_0x1733('0x43')](_[_0x1733('0x37')](_0x97e07a[_0x1733('0x2d')],_0x1a8816[_0x1733('0x43')]));if(_0x97e07a['query']['filter']){_0x4df492[_0x1733('0x36')]=_[_0x1733('0x39')](_0x4df492['where'],{'$or':_[_0x1733('0x2c')](_0x4df492['attributes'],function(_0x169cde){var _0x10bf36={};_0x10bf36[_0x169cde]={'$like':'%'+_0x97e07a[_0x1733('0x2d')]['filter']+'%'};return _0x10bf36;})});}_0x4df492=_[_0x1733('0x39')]({},_0x4df492,_0x97e07a['options']);return _0x551c04['getDescriptions'](_0x4df492);}})['then'](function(_0x264cbb){if(_0x264cbb){_0x2ee534=_0x264cbb[_0x1733('0x49')];if(!_0x97e07a[_0x1733('0x2d')][_0x1733('0x32')]('nolimit')){_0x4df492[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x97e07a[_0x1733('0x2d')][_0x1733('0x1a')]);_0x4df492[_0x1733('0x1c')]=qs[_0x1733('0x1c')](_0x97e07a[_0x1733('0x2d')][_0x1733('0x1c')]);}return _0x551c04[_0x1733('0x4c')](_0x4df492);}})[_0x1733('0x22')](function(_0x1c5354){if(_0x1c5354){return _0x1c5354?{'count':_0x2ee534,'rows':_0x1c5354}:null;}})[_0x1733('0x22')](respondWithResult(_0x39da11,null))['catch'](handleError(_0x39da11,null));};exports[_0x1733('0x4d')]=function(_0x464f23,_0x3ee952,_0x1301dd){var _0x162696={};var _0x46fd41={};var _0x11ba10;var _0x4b4149;return db['ZendeskConfiguration'][_0x1733('0x4b')]({'where':{'id':_0x464f23[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0x3ee952,null))[_0x1733('0x22')](function(_0x4271d8){if(_0x4271d8){_0x11ba10=_0x4271d8;_0x46fd41[_0x1733('0x2b')]=_[_0x1733('0x2e')](db[_0x1733('0x4e')]['rawAttributes']);_0x46fd41[_0x1733('0x2d')]=_['keys'](_0x464f23[_0x1733('0x2d')]);_0x46fd41[_0x1733('0x43')]=_[_0x1733('0x2f')](_0x46fd41[_0x1733('0x2b')],_0x46fd41['query']);_0x162696[_0x1733('0x30')]=_[_0x1733('0x2f')](_0x46fd41[_0x1733('0x2b')],qs[_0x1733('0x31')](_0x464f23[_0x1733('0x2d')][_0x1733('0x31')]));_0x162696[_0x1733('0x30')]=_0x162696['attributes'][_0x1733('0x49')]?_0x162696[_0x1733('0x30')]:_0x46fd41['model'];_0x162696[_0x1733('0x34')]=qs[_0x1733('0x35')](_0x464f23[_0x1733('0x2d')]['sort']);_0x162696['where']=qs[_0x1733('0x43')](_['pick'](_0x464f23[_0x1733('0x2d')],_0x46fd41['filters']));if(_0x464f23['query']['filter']){_0x162696['where']=_['merge'](_0x162696[_0x1733('0x36')],{'$or':_[_0x1733('0x2c')](_0x162696[_0x1733('0x30')],function(_0x498d88){var _0x4bd242={};_0x4bd242[_0x498d88]={'$like':'%'+_0x464f23['query']['filter']+'%'};return _0x4bd242;})});}_0x162696=_[_0x1733('0x39')]({},_0x162696,_0x464f23['options']);return _0x11ba10[_0x1733('0x4d')](_0x162696);}})[_0x1733('0x22')](function(_0x213baa){if(_0x213baa){_0x4b4149=_0x213baa['length'];if(!_0x464f23[_0x1733('0x2d')]['hasOwnProperty'](_0x1733('0x33'))){_0x162696[_0x1733('0x1a')]=qs[_0x1733('0x1a')](_0x464f23[_0x1733('0x2d')][_0x1733('0x1a')]);_0x162696[_0x1733('0x1c')]=qs[_0x1733('0x1c')](_0x464f23[_0x1733('0x2d')]['offset']);}return _0x11ba10[_0x1733('0x4d')](_0x162696);}})[_0x1733('0x22')](function(_0x18f815){if(_0x18f815){return _0x18f815?{'count':_0x4b4149,'rows':_0x18f815}:null;}})[_0x1733('0x22')](respondWithResult(_0x3ee952,null))['catch'](handleError(_0x3ee952,null));};exports[_0x1733('0x4f')]=function(_0x315c2b,_0xcd5830,_0x218b6c){if(_0x315c2b[_0x1733('0x45')]['id']){delete _0x315c2b[_0x1733('0x45')]['id'];}return db[_0x1733('0x3c')]['findOne']({'where':{'id':_0x315c2b[_0x1733('0x42')]['id']}})[_0x1733('0x22')](handleEntityNotFound(_0xcd5830,null))[_0x1733('0x22')](function(_0x3ef9e1){if(_0x3ef9e1){return _0x3ef9e1[_0x1733('0x4f')](_0x315c2b[_0x1733('0x45')][_0x1733('0x50')]||[]);}return null;})[_0x1733('0x22')](respondWithResult(_0xcd5830,null))[_0x1733('0x40')](handleError(_0xcd5830,null));}; \ No newline at end of file +var _0x1d2c=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','include','findAll','rows','show','params','keys','catch','create','body','findOne','ZendeskField','order','options','getFields','getSubjects','getDescriptions','getTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0x1d2c,0x132));var _0xc1d2=function(_0x12cc45,_0x19d57b){_0x12cc45=_0x12cc45-0x0;var _0xf12864=_0x1d2c[_0x12cc45];return _0xf12864;};'use strict';var emlformat=require(_0xc1d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1d2('0x2'));var moment=require(_0xc1d2('0x3'));var BPromise=require(_0xc1d2('0x4'));var Mustache=require(_0xc1d2('0x5'));var util=require(_0xc1d2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc1d2('0x7'));var ejs=require(_0xc1d2('0x8'));var fs=require('fs');var fs_extra=require(_0xc1d2('0x9'));var _=require(_0xc1d2('0xa'));var squel=require(_0xc1d2('0xb'));var crypto=require(_0xc1d2('0xc'));var jsforce=require(_0xc1d2('0xd'));var deskjs=require(_0xc1d2('0xe'));var toCsv=require(_0xc1d2('0x7'));var querystring=require(_0xc1d2('0xf'));var Papa=require(_0xc1d2('0x10'));var Redis=require(_0xc1d2('0x11'));var authService=require(_0xc1d2('0x12'));var qs=require(_0xc1d2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1d2('0x14'))(_0xc1d2('0x15'));var utils=require(_0xc1d2('0x16'));var config=require(_0xc1d2('0x17'));var licenseUtil=require(_0xc1d2('0x18'));var db=require(_0xc1d2('0x19'))['db'];function respondWithStatusCode(_0x122b22,_0xd0abdf){_0xd0abdf=_0xd0abdf||0xcc;return function(_0x4aa5b4){if(_0x4aa5b4){return _0x122b22[_0xc1d2('0x1a')](_0xd0abdf);}return _0x122b22[_0xc1d2('0x1b')](_0xd0abdf)[_0xc1d2('0x1c')]();};}function respondWithResult(_0xbfd38,_0x4084b8){_0x4084b8=_0x4084b8||0xc8;return function(_0x47a727){if(_0x47a727){return _0xbfd38[_0xc1d2('0x1b')](_0x4084b8)[_0xc1d2('0x1d')](_0x47a727);}};}function respondWithFilteredResult(_0x43c4bc,_0x10a01b){return function(_0x2537a2){if(_0x2537a2){var _0x43ec61=typeof _0x10a01b[_0xc1d2('0x1e')]===_0xc1d2('0x1f')&&typeof _0x10a01b[_0xc1d2('0x20')]==='undefined';var _0x4c760c=_0x2537a2[_0xc1d2('0x21')];var _0x4c9ab8=_0x43ec61?0x0:_0x10a01b['offset'];var _0x3cfc7f=_0x43ec61?_0x2537a2[_0xc1d2('0x21')]:_0x10a01b['offset']+_0x10a01b[_0xc1d2('0x20')];var _0x1074ac;if(_0x3cfc7f>=_0x4c760c){_0x3cfc7f=_0x4c760c;_0x1074ac=0xc8;}else{_0x1074ac=0xce;}_0x43c4bc[_0xc1d2('0x1b')](_0x1074ac);return _0x43c4bc[_0xc1d2('0x22')](_0xc1d2('0x23'),_0x4c9ab8+'-'+_0x3cfc7f+'/'+_0x4c760c)[_0xc1d2('0x1d')](_0x2537a2);}return null;};}function patchUpdates(_0x26fc30){return function(_0x5857ee){try{jsonpatch[_0xc1d2('0x24')](_0x5857ee,_0x26fc30,!![]);}catch(_0x523c8c){return BPromise[_0xc1d2('0x25')](_0x523c8c);}return _0x5857ee[_0xc1d2('0x26')]();};}function saveUpdates(_0x163396,_0xb38cd7){return function(_0x10abdf){if(_0x10abdf){return _0x10abdf[_0xc1d2('0x27')](_0x163396)[_0xc1d2('0x28')](function(_0x386a61){return _0x386a61;});}return null;};}function removeEntity(_0x5ad9d8,_0x3cc78e){return function(_0x112b88){if(_0x112b88){return _0x112b88[_0xc1d2('0x29')]()['then'](function(){_0x5ad9d8[_0xc1d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8041,_0x5efc32){return function(_0x955b90){if(!_0x955b90){_0x2c8041[_0xc1d2('0x1a')](0x194);}return _0x955b90;};}function handleError(_0x528332,_0xc646fa){_0xc646fa=_0xc646fa||0x1f4;return function(_0x99a646){logger[_0xc1d2('0x2a')](_0x99a646['stack']);if(_0x99a646[_0xc1d2('0x2b')]){delete _0x99a646[_0xc1d2('0x2b')];}_0x528332[_0xc1d2('0x1b')](_0xc646fa)[_0xc1d2('0x2c')](_0x99a646);};}exports[_0xc1d2('0x2d')]=function(_0x5e4a21,_0x4488cc){var _0x44ce5a={},_0x4d4413={},_0x51a63a={'count':0x0,'rows':[]};var _0x320721=_['map'](db[_0xc1d2('0x2e')][_0xc1d2('0x2f')],function(_0x50d5d1){return{'name':_0x50d5d1[_0xc1d2('0x30')],'type':_0x50d5d1['type'][_0xc1d2('0x31')]};});_0x4d4413[_0xc1d2('0x32')]=_['map'](_0x320721,'name');_0x4d4413[_0xc1d2('0x33')]=_['keys'](_0x5e4a21['query']);_0x4d4413[_0xc1d2('0x34')]=_[_0xc1d2('0x35')](_0x4d4413['model'],_0x4d4413['query']);_0x44ce5a[_0xc1d2('0x36')]=_['intersection'](_0x4d4413[_0xc1d2('0x32')],qs[_0xc1d2('0x37')](_0x5e4a21['query']['fields']));_0x44ce5a[_0xc1d2('0x36')]=_0x44ce5a['attributes'][_0xc1d2('0x38')]?_0x44ce5a['attributes']:_0x4d4413['model'];if(!_0x5e4a21[_0xc1d2('0x33')][_0xc1d2('0x39')](_0xc1d2('0x3a'))){_0x44ce5a[_0xc1d2('0x20')]=qs[_0xc1d2('0x20')](_0x5e4a21['query'][_0xc1d2('0x20')]);_0x44ce5a[_0xc1d2('0x1e')]=qs['offset'](_0x5e4a21[_0xc1d2('0x33')][_0xc1d2('0x1e')]);}_0x44ce5a['order']=qs[_0xc1d2('0x3b')](_0x5e4a21[_0xc1d2('0x33')][_0xc1d2('0x3b')]);_0x44ce5a[_0xc1d2('0x3c')]=qs[_0xc1d2('0x34')](_[_0xc1d2('0x3d')](_0x5e4a21[_0xc1d2('0x33')],_0x4d4413[_0xc1d2('0x34')]),_0x320721);if(_0x5e4a21[_0xc1d2('0x33')][_0xc1d2('0x3e')]){_0x44ce5a['where']=_[_0xc1d2('0x3f')](_0x44ce5a[_0xc1d2('0x3c')],{'$or':_[_0xc1d2('0x40')](_0x320721,function(_0x2fd4cb){if(_0x2fd4cb[_0xc1d2('0x41')]!=='VIRTUAL'){var _0x464cfe={};_0x464cfe[_0x2fd4cb[_0xc1d2('0x2b')]]={'$like':'%'+_0x5e4a21['query'][_0xc1d2('0x3e')]+'%'};return _0x464cfe;}})});}_0x44ce5a=_[_0xc1d2('0x3f')]({},_0x44ce5a,_0x5e4a21['options']);var _0x304e8b={'where':_0x44ce5a['where']};return db['ZendeskConfiguration'][_0xc1d2('0x21')](_0x304e8b)[_0xc1d2('0x28')](function(_0x2addd4){_0x51a63a[_0xc1d2('0x21')]=_0x2addd4;if(_0x5e4a21['query']['includeAll']){_0x44ce5a[_0xc1d2('0x42')]=[{'all':!![]}];}return db[_0xc1d2('0x2e')][_0xc1d2('0x43')](_0x44ce5a);})[_0xc1d2('0x28')](function(_0x37e11d){_0x51a63a[_0xc1d2('0x44')]=_0x37e11d;return _0x51a63a;})[_0xc1d2('0x28')](respondWithFilteredResult(_0x4488cc,_0x44ce5a))['catch'](handleError(_0x4488cc,null));};exports[_0xc1d2('0x45')]=function(_0x52b10f,_0x5a2c20){var _0x4d9b8c={'raw':![],'where':{'id':_0x52b10f[_0xc1d2('0x46')]['id']}},_0x34bd92={};_0x34bd92['model']=_[_0xc1d2('0x47')](db[_0xc1d2('0x2e')][_0xc1d2('0x2f')]);_0x34bd92['query']=_[_0xc1d2('0x47')](_0x52b10f['query']);_0x34bd92['filters']=_['intersection'](_0x34bd92[_0xc1d2('0x32')],_0x34bd92[_0xc1d2('0x33')]);_0x4d9b8c['attributes']=_[_0xc1d2('0x35')](_0x34bd92['model'],qs['fields'](_0x52b10f[_0xc1d2('0x33')][_0xc1d2('0x37')]));_0x4d9b8c['attributes']=_0x4d9b8c[_0xc1d2('0x36')][_0xc1d2('0x38')]?_0x4d9b8c[_0xc1d2('0x36')]:_0x34bd92[_0xc1d2('0x32')];if(_0x52b10f[_0xc1d2('0x33')]['includeAll']){_0x4d9b8c[_0xc1d2('0x42')]=[{'all':!![]}];}_0x4d9b8c=_[_0xc1d2('0x3f')]({},_0x4d9b8c,_0x52b10f['options']);return db[_0xc1d2('0x2e')]['find'](_0x4d9b8c)[_0xc1d2('0x28')](handleEntityNotFound(_0x5a2c20,null))[_0xc1d2('0x28')](respondWithResult(_0x5a2c20,null))[_0xc1d2('0x48')](handleError(_0x5a2c20,null));};exports[_0xc1d2('0x49')]=function(_0x2a3746,_0x4535f8){return db[_0xc1d2('0x2e')][_0xc1d2('0x49')](_0x2a3746[_0xc1d2('0x4a')],{})['then'](respondWithResult(_0x4535f8,0xc9))[_0xc1d2('0x48')](handleError(_0x4535f8,null));};exports[_0xc1d2('0x27')]=function(_0x55d029,_0x59b01a){if(_0x55d029[_0xc1d2('0x4a')]['id']){delete _0x55d029[_0xc1d2('0x4a')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x55d029['params']['id']}})[_0xc1d2('0x28')](handleEntityNotFound(_0x59b01a,null))[_0xc1d2('0x28')](saveUpdates(_0x55d029[_0xc1d2('0x4a')],null))[_0xc1d2('0x28')](respondWithResult(_0x59b01a,null))[_0xc1d2('0x48')](handleError(_0x59b01a,null));};exports[_0xc1d2('0x29')]=function(_0x169f4b,_0x4bf774){return db['ZendeskConfiguration']['find']({'where':{'id':_0x169f4b[_0xc1d2('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bf774,null))[_0xc1d2('0x28')](removeEntity(_0x4bf774,null))['catch'](handleError(_0x4bf774,null));};exports['getFields']=function(_0x5616b8,_0x338828,_0x2defe9){var _0x3457a7={};var _0x20d8d6={};var _0x2628f9;var _0x1f4637;return db[_0xc1d2('0x2e')][_0xc1d2('0x4b')]({'where':{'id':_0x5616b8[_0xc1d2('0x46')]['id']}})[_0xc1d2('0x28')](handleEntityNotFound(_0x338828,null))[_0xc1d2('0x28')](function(_0x8f40c1){if(_0x8f40c1){_0x2628f9=_0x8f40c1;_0x20d8d6[_0xc1d2('0x32')]=_[_0xc1d2('0x47')](db[_0xc1d2('0x4c')][_0xc1d2('0x2f')]);_0x20d8d6[_0xc1d2('0x33')]=_[_0xc1d2('0x47')](_0x5616b8[_0xc1d2('0x33')]);_0x20d8d6['filters']=_[_0xc1d2('0x35')](_0x20d8d6[_0xc1d2('0x32')],_0x20d8d6[_0xc1d2('0x33')]);_0x3457a7[_0xc1d2('0x36')]=_[_0xc1d2('0x35')](_0x20d8d6[_0xc1d2('0x32')],qs[_0xc1d2('0x37')](_0x5616b8[_0xc1d2('0x33')][_0xc1d2('0x37')]));_0x3457a7[_0xc1d2('0x36')]=_0x3457a7[_0xc1d2('0x36')][_0xc1d2('0x38')]?_0x3457a7[_0xc1d2('0x36')]:_0x20d8d6[_0xc1d2('0x32')];_0x3457a7[_0xc1d2('0x4d')]=qs[_0xc1d2('0x3b')](_0x5616b8[_0xc1d2('0x33')][_0xc1d2('0x3b')]);_0x3457a7[_0xc1d2('0x3c')]=qs[_0xc1d2('0x34')](_[_0xc1d2('0x3d')](_0x5616b8['query'],_0x20d8d6['filters']));if(_0x5616b8[_0xc1d2('0x33')]['filter']){_0x3457a7[_0xc1d2('0x3c')]=_[_0xc1d2('0x3f')](_0x3457a7['where'],{'$or':_[_0xc1d2('0x40')](_0x3457a7[_0xc1d2('0x36')],function(_0x4adb7d){var _0x461037={};_0x461037[_0x4adb7d]={'$like':'%'+_0x5616b8[_0xc1d2('0x33')][_0xc1d2('0x3e')]+'%'};return _0x461037;})});}_0x3457a7=_[_0xc1d2('0x3f')]({},_0x3457a7,_0x5616b8[_0xc1d2('0x4e')]);return _0x2628f9[_0xc1d2('0x4f')](_0x3457a7);}})[_0xc1d2('0x28')](function(_0x3334dd){if(_0x3334dd){_0x1f4637=_0x3334dd[_0xc1d2('0x38')];if(!_0x5616b8['query'][_0xc1d2('0x39')](_0xc1d2('0x3a'))){_0x3457a7[_0xc1d2('0x20')]=qs[_0xc1d2('0x20')](_0x5616b8[_0xc1d2('0x33')][_0xc1d2('0x20')]);_0x3457a7[_0xc1d2('0x1e')]=qs[_0xc1d2('0x1e')](_0x5616b8['query']['offset']);}return _0x2628f9[_0xc1d2('0x4f')](_0x3457a7);}})['then'](function(_0xd3dd54){if(_0xd3dd54){return _0xd3dd54?{'count':_0x1f4637,'rows':_0xd3dd54}:null;}})['then'](respondWithResult(_0x338828,null))['catch'](handleError(_0x338828,null));};exports['getSubjects']=function(_0x4e6be3,_0x5670af,_0x493e52){var _0x5b3782={};var _0xe82439={};var _0x42c2db;var _0x1a751a;return db[_0xc1d2('0x2e')][_0xc1d2('0x4b')]({'where':{'id':_0x4e6be3[_0xc1d2('0x46')]['id']}})[_0xc1d2('0x28')](handleEntityNotFound(_0x5670af,null))[_0xc1d2('0x28')](function(_0x246ada){if(_0x246ada){_0x42c2db=_0x246ada;_0xe82439['model']=_[_0xc1d2('0x47')](db[_0xc1d2('0x4c')][_0xc1d2('0x2f')]);_0xe82439[_0xc1d2('0x33')]=_[_0xc1d2('0x47')](_0x4e6be3[_0xc1d2('0x33')]);_0xe82439['filters']=_[_0xc1d2('0x35')](_0xe82439[_0xc1d2('0x32')],_0xe82439[_0xc1d2('0x33')]);_0x5b3782[_0xc1d2('0x36')]=_[_0xc1d2('0x35')](_0xe82439[_0xc1d2('0x32')],qs[_0xc1d2('0x37')](_0x4e6be3['query'][_0xc1d2('0x37')]));_0x5b3782[_0xc1d2('0x36')]=_0x5b3782[_0xc1d2('0x36')][_0xc1d2('0x38')]?_0x5b3782[_0xc1d2('0x36')]:_0xe82439[_0xc1d2('0x32')];_0x5b3782['order']=qs[_0xc1d2('0x3b')](_0x4e6be3[_0xc1d2('0x33')][_0xc1d2('0x3b')]);_0x5b3782[_0xc1d2('0x3c')]=qs['filters'](_[_0xc1d2('0x3d')](_0x4e6be3[_0xc1d2('0x33')],_0xe82439['filters']));if(_0x4e6be3[_0xc1d2('0x33')][_0xc1d2('0x3e')]){_0x5b3782[_0xc1d2('0x3c')]=_[_0xc1d2('0x3f')](_0x5b3782[_0xc1d2('0x3c')],{'$or':_[_0xc1d2('0x40')](_0x5b3782[_0xc1d2('0x36')],function(_0x5d9593){var _0x334a39={};_0x334a39[_0x5d9593]={'$like':'%'+_0x4e6be3['query']['filter']+'%'};return _0x334a39;})});}_0x5b3782=_[_0xc1d2('0x3f')]({},_0x5b3782,_0x4e6be3['options']);return _0x42c2db[_0xc1d2('0x50')](_0x5b3782);}})[_0xc1d2('0x28')](function(_0x27a9a3){if(_0x27a9a3){_0x1a751a=_0x27a9a3[_0xc1d2('0x38')];if(!_0x4e6be3[_0xc1d2('0x33')][_0xc1d2('0x39')]('nolimit')){_0x5b3782[_0xc1d2('0x20')]=qs['limit'](_0x4e6be3[_0xc1d2('0x33')][_0xc1d2('0x20')]);_0x5b3782[_0xc1d2('0x1e')]=qs[_0xc1d2('0x1e')](_0x4e6be3[_0xc1d2('0x33')][_0xc1d2('0x1e')]);}return _0x42c2db[_0xc1d2('0x50')](_0x5b3782);}})['then'](function(_0x3df29d){if(_0x3df29d){return _0x3df29d?{'count':_0x1a751a,'rows':_0x3df29d}:null;}})['then'](respondWithResult(_0x5670af,null))[_0xc1d2('0x48')](handleError(_0x5670af,null));};exports[_0xc1d2('0x51')]=function(_0x5e7751,_0x49c48e,_0x2bacb3){var _0x5a0eef={};var _0x2d582a={};var _0x4287c1;var _0x12c16a;return db['ZendeskConfiguration'][_0xc1d2('0x4b')]({'where':{'id':_0x5e7751[_0xc1d2('0x46')]['id']}})[_0xc1d2('0x28')](handleEntityNotFound(_0x49c48e,null))[_0xc1d2('0x28')](function(_0x97d660){if(_0x97d660){_0x4287c1=_0x97d660;_0x2d582a[_0xc1d2('0x32')]=_[_0xc1d2('0x47')](db['ZendeskField'][_0xc1d2('0x2f')]);_0x2d582a[_0xc1d2('0x33')]=_['keys'](_0x5e7751['query']);_0x2d582a[_0xc1d2('0x34')]=_['intersection'](_0x2d582a[_0xc1d2('0x32')],_0x2d582a['query']);_0x5a0eef[_0xc1d2('0x36')]=_['intersection'](_0x2d582a[_0xc1d2('0x32')],qs['fields'](_0x5e7751[_0xc1d2('0x33')]['fields']));_0x5a0eef[_0xc1d2('0x36')]=_0x5a0eef[_0xc1d2('0x36')][_0xc1d2('0x38')]?_0x5a0eef[_0xc1d2('0x36')]:_0x2d582a[_0xc1d2('0x32')];_0x5a0eef['order']=qs[_0xc1d2('0x3b')](_0x5e7751[_0xc1d2('0x33')][_0xc1d2('0x3b')]);_0x5a0eef['where']=qs[_0xc1d2('0x34')](_['pick'](_0x5e7751[_0xc1d2('0x33')],_0x2d582a['filters']));if(_0x5e7751[_0xc1d2('0x33')][_0xc1d2('0x3e')]){_0x5a0eef[_0xc1d2('0x3c')]=_[_0xc1d2('0x3f')](_0x5a0eef[_0xc1d2('0x3c')],{'$or':_[_0xc1d2('0x40')](_0x5a0eef[_0xc1d2('0x36')],function(_0x121d00){var _0x517cc1={};_0x517cc1[_0x121d00]={'$like':'%'+_0x5e7751[_0xc1d2('0x33')][_0xc1d2('0x3e')]+'%'};return _0x517cc1;})});}_0x5a0eef=_[_0xc1d2('0x3f')]({},_0x5a0eef,_0x5e7751[_0xc1d2('0x4e')]);return _0x4287c1['getDescriptions'](_0x5a0eef);}})[_0xc1d2('0x28')](function(_0x126b22){if(_0x126b22){_0x12c16a=_0x126b22[_0xc1d2('0x38')];if(!_0x5e7751[_0xc1d2('0x33')][_0xc1d2('0x39')]('nolimit')){_0x5a0eef['limit']=qs[_0xc1d2('0x20')](_0x5e7751[_0xc1d2('0x33')][_0xc1d2('0x20')]);_0x5a0eef[_0xc1d2('0x1e')]=qs[_0xc1d2('0x1e')](_0x5e7751[_0xc1d2('0x33')][_0xc1d2('0x1e')]);}return _0x4287c1['getDescriptions'](_0x5a0eef);}})[_0xc1d2('0x28')](function(_0x2f46ab){if(_0x2f46ab){return _0x2f46ab?{'count':_0x12c16a,'rows':_0x2f46ab}:null;}})[_0xc1d2('0x28')](respondWithResult(_0x49c48e,null))[_0xc1d2('0x48')](handleError(_0x49c48e,null));};exports['getTags']=function(_0x51eb95,_0x3ef561,_0x40df40){var _0x4713a6={};var _0x20201b={};var _0x572529;var _0xeaf975;return db[_0xc1d2('0x2e')]['findOne']({'where':{'id':_0x51eb95['params']['id']}})['then'](handleEntityNotFound(_0x3ef561,null))[_0xc1d2('0x28')](function(_0x37af36){if(_0x37af36){_0x572529=_0x37af36;_0x20201b[_0xc1d2('0x32')]=_[_0xc1d2('0x47')](db['Tag']['rawAttributes']);_0x20201b[_0xc1d2('0x33')]=_[_0xc1d2('0x47')](_0x51eb95['query']);_0x20201b[_0xc1d2('0x34')]=_[_0xc1d2('0x35')](_0x20201b['model'],_0x20201b[_0xc1d2('0x33')]);_0x4713a6[_0xc1d2('0x36')]=_['intersection'](_0x20201b['model'],qs[_0xc1d2('0x37')](_0x51eb95[_0xc1d2('0x33')]['fields']));_0x4713a6[_0xc1d2('0x36')]=_0x4713a6['attributes']['length']?_0x4713a6[_0xc1d2('0x36')]:_0x20201b[_0xc1d2('0x32')];_0x4713a6['order']=qs[_0xc1d2('0x3b')](_0x51eb95[_0xc1d2('0x33')][_0xc1d2('0x3b')]);_0x4713a6[_0xc1d2('0x3c')]=qs[_0xc1d2('0x34')](_[_0xc1d2('0x3d')](_0x51eb95[_0xc1d2('0x33')],_0x20201b[_0xc1d2('0x34')]));if(_0x51eb95['query'][_0xc1d2('0x3e')]){_0x4713a6['where']=_[_0xc1d2('0x3f')](_0x4713a6[_0xc1d2('0x3c')],{'$or':_[_0xc1d2('0x40')](_0x4713a6[_0xc1d2('0x36')],function(_0x179870){var _0x93f285={};_0x93f285[_0x179870]={'$like':'%'+_0x51eb95[_0xc1d2('0x33')][_0xc1d2('0x3e')]+'%'};return _0x93f285;})});}_0x4713a6=_['merge']({},_0x4713a6,_0x51eb95[_0xc1d2('0x4e')]);return _0x572529[_0xc1d2('0x52')](_0x4713a6);}})[_0xc1d2('0x28')](function(_0x5c28f5){if(_0x5c28f5){_0xeaf975=_0x5c28f5[_0xc1d2('0x38')];if(!_0x51eb95[_0xc1d2('0x33')][_0xc1d2('0x39')](_0xc1d2('0x3a'))){_0x4713a6[_0xc1d2('0x20')]=qs[_0xc1d2('0x20')](_0x51eb95[_0xc1d2('0x33')][_0xc1d2('0x20')]);_0x4713a6[_0xc1d2('0x1e')]=qs[_0xc1d2('0x1e')](_0x51eb95['query'][_0xc1d2('0x1e')]);}return _0x572529[_0xc1d2('0x52')](_0x4713a6);}})[_0xc1d2('0x28')](function(_0xfa6cf7){if(_0xfa6cf7){return _0xfa6cf7?{'count':_0xeaf975,'rows':_0xfa6cf7}:null;}})[_0xc1d2('0x28')](respondWithResult(_0x3ef561,null))[_0xc1d2('0x48')](handleError(_0x3ef561,null));};exports['setTags']=function(_0x5e4ad2,_0x1236cc,_0x9d9a14){if(_0x5e4ad2[_0xc1d2('0x4a')]['id']){delete _0x5e4ad2[_0xc1d2('0x4a')]['id'];}return db[_0xc1d2('0x2e')][_0xc1d2('0x4b')]({'where':{'id':_0x5e4ad2[_0xc1d2('0x46')]['id']}})[_0xc1d2('0x28')](handleEntityNotFound(_0x1236cc,null))[_0xc1d2('0x28')](function(_0x4c1aeb){if(_0x4c1aeb){return _0x4c1aeb['setTags'](_0x5e4ad2[_0xc1d2('0x4a')][_0xc1d2('0x53')]||[]);}return null;})[_0xc1d2('0x28')](respondWithResult(_0x1236cc,null))['catch'](handleError(_0x1236cc,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1520cab..9c8b05d 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 _0x1775=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x45c9ec,_0xc40f0a){var _0x3b1a05=function(_0xc2fbb0){while(--_0xc2fbb0){_0x45c9ec['push'](_0x45c9ec['shift']());}};_0x3b1a05(++_0xc40f0a);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda3f=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','request-promise','rimraf'];(function(_0x39fb6c,_0x5113f3){var _0x2192db=function(_0x267d61){while(--_0x267d61){_0x39fb6c['push'](_0x39fb6c['shift']());}};_0x2192db(++_0x5113f3);}(_0xda3f,0xec));var _0xfda3=function(_0x529a21,_0x5bcddf){_0x529a21=_0x529a21-0x0;var _0x2c3267=_0xda3f[_0x529a21];return _0x2c3267;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'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 74ed3b0..28086d2 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 _0x84c6=['client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b0fc6,_0xee3377){var _0x1eee3c=function(_0x2c3a17){while(--_0x2c3a17){_0x3b0fc6['push'](_0x3b0fc6['shift']());}};_0x1eee3c(++_0xee3377);}(_0x84c6,0x1c4));var _0x684c=function(_0x4a28c4,_0x3927ba){_0x4a28c4=_0x4a28c4-0x0;var _0x3c2338=_0x84c6[_0x4a28c4];return _0x3c2338;};'use strict';var _=require('lodash');var util=require(_0x684c('0x0'));var moment=require(_0x684c('0x1'));var BPromise=require(_0x684c('0x2'));var rs=require(_0x684c('0x3'));var fs=require('fs');var Redis=require(_0x684c('0x4'));var db=require(_0x684c('0x5'))['db'];var utils=require(_0x684c('0x6'));var logger=require(_0x684c('0x7'))(_0x684c('0x8'));var config=require(_0x684c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x684c('0xa')][_0x684c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x101686,_0x1489d2,_0x275e6b){return new BPromise(function(_0x19f346,_0x6e068e){return client[_0x684c('0xc')](_0x101686,_0x275e6b)['then'](function(_0x334a0e){logger[_0x684c('0xd')](_0x684c('0xe'),_0x1489d2,_0x684c('0xf'));logger[_0x684c('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1489d2,_0x684c('0xf'),JSON['stringify'](_0x334a0e));if(_0x334a0e[_0x684c('0x11')]){if(_0x334a0e[_0x684c('0x11')][_0x684c('0x12')]===0x1f4){logger[_0x684c('0x11')](_0x684c('0xe'),_0x1489d2,_0x334a0e[_0x684c('0x11')][_0x684c('0x13')]);return _0x6e068e(_0x334a0e[_0x684c('0x11')][_0x684c('0x13')]);}logger['error'](_0x684c('0xe'),_0x1489d2,_0x334a0e[_0x684c('0x11')]['message']);return _0x19f346(_0x334a0e['error']['message']);}else{logger[_0x684c('0xd')](_0x684c('0xe'),_0x1489d2,_0x684c('0xf'));_0x19f346(_0x334a0e[_0x684c('0x14')]['message']);}})['catch'](function(_0x352534){logger[_0x684c('0x11')](_0x684c('0xe'),_0x1489d2,_0x352534);_0x6e068e(_0x352534);});});} \ No newline at end of file +var _0xbc28=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5f53f3,_0x1c2d96){var _0x4f1458=function(_0x22fd82){while(--_0x22fd82){_0x5f53f3['push'](_0x5f53f3['shift']());}};_0x4f1458(++_0x1c2d96);}(_0xbc28,0x70));var _0x8bc2=function(_0x46de2c,_0x242db0){_0x46de2c=_0x46de2c-0x0;var _0x2c2449=_0xbc28[_0x46de2c];return _0x2c2449;};'use strict';var _=require(_0x8bc2('0x0'));var util=require('util');var moment=require(_0x8bc2('0x1'));var BPromise=require(_0x8bc2('0x2'));var rs=require(_0x8bc2('0x3'));var fs=require('fs');var Redis=require(_0x8bc2('0x4'));var db=require(_0x8bc2('0x5'))['db'];var utils=require(_0x8bc2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8bc2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8bc2('0x8')][_0x8bc2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32034a,_0x39d2e2,_0x313bbe){return new BPromise(function(_0x383717,_0x3c23a0){return client[_0x8bc2('0xa')](_0x32034a,_0x313bbe)[_0x8bc2('0xb')](function(_0x3f6396){logger[_0x8bc2('0xc')](_0x8bc2('0xd'),_0x39d2e2,_0x8bc2('0xe'));logger[_0x8bc2('0xf')](_0x8bc2('0x10'),_0x39d2e2,'request\x20sent',JSON[_0x8bc2('0x11')](_0x3f6396));if(_0x3f6396[_0x8bc2('0x12')]){if(_0x3f6396[_0x8bc2('0x12')]['code']===0x1f4){logger[_0x8bc2('0x12')](_0x8bc2('0xd'),_0x39d2e2,_0x3f6396[_0x8bc2('0x12')][_0x8bc2('0x13')]);return _0x3c23a0(_0x3f6396[_0x8bc2('0x12')][_0x8bc2('0x13')]);}logger[_0x8bc2('0x12')](_0x8bc2('0xd'),_0x39d2e2,_0x3f6396[_0x8bc2('0x12')][_0x8bc2('0x13')]);return _0x383717(_0x3f6396[_0x8bc2('0x12')][_0x8bc2('0x13')]);}else{logger[_0x8bc2('0xc')](_0x8bc2('0xd'),_0x39d2e2,_0x8bc2('0xe'));_0x383717(_0x3f6396[_0x8bc2('0x14')]['message']);}})[_0x8bc2('0x15')](function(_0x3b2413){logger[_0x8bc2('0x12')](_0x8bc2('0xd'),_0x39d2e2,_0x3b2413);_0x3c23a0(_0x3b2413);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c6cb7bf..629b826 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 _0xf2ca=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf2ca,0x78));var _0xaf2c=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0xf2ca[_0x37a0ab];return _0x13ca1d;};'use strict';var multer=require('multer');var util=require(_0xaf2c('0x0'));var path=require(_0xaf2c('0x1'));var timeout=require(_0xaf2c('0x2'));var express=require('express');var router=express[_0xaf2c('0x3')]();var fs_extra=require(_0xaf2c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf2c('0x5'));var controller=require('./intZendeskField.controller');router[_0xaf2c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaf2c('0x7'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaf2c('0xa')](_0xaf2c('0x7'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0xc')](_0xaf2c('0x7'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0xd')]);module[_0xaf2c('0xe')]=router; \ No newline at end of file +var _0x9cb4=['index','/:id','show','post','create','put','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x475138,_0x4389e4){var _0x40a51c=function(_0x1ee297){while(--_0x1ee297){_0x475138['push'](_0x475138['shift']());}};_0x40a51c(++_0x4389e4);}(_0x9cb4,0x80));var _0x49cb=function(_0xe98a29,_0x52fde8){_0xe98a29=_0xe98a29-0x0;var _0x3b516a=_0x9cb4[_0xe98a29];return _0x3b516a;};'use strict';var multer=require(_0x49cb('0x0'));var util=require(_0x49cb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x49cb('0x2'));var router=express['Router']();var fs_extra=require(_0x49cb('0x3'));var auth=require(_0x49cb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x49cb('0x5'));var controller=require('./intZendeskField.controller');router[_0x49cb('0x6')]('/',auth[_0x49cb('0x7')](),controller[_0x49cb('0x8')]);router[_0x49cb('0x6')](_0x49cb('0x9'),auth[_0x49cb('0x7')](),controller[_0x49cb('0xa')]);router[_0x49cb('0xb')]('/',auth[_0x49cb('0x7')](),controller[_0x49cb('0xc')]);router[_0x49cb('0xd')](_0x49cb('0x9'),auth[_0x49cb('0x7')](),controller[_0x49cb('0xe')]);router['delete'](_0x49cb('0x9'),auth['isAuthenticated'](),controller[_0x49cb('0xf')]);module[_0x49cb('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index bccb35d..ed3c4ed 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 _0xcbbf=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x50e97f,_0x1b09a0){var _0x599d0f=function(_0x210a71){while(--_0x210a71){_0x50e97f['push'](_0x50e97f['shift']());}};_0x599d0f(++_0x1b09a0);}(_0xcbbf,0x170));var _0xfcbb=function(_0x3bd750,_0x15f616){_0x3bd750=_0x3bd750-0x0;var _0x574288=_0xcbbf[_0x3bd750];return _0x574288;};'use strict';var Sequelize=require(_0xfcbb('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xfcbb('0x1'),_0xfcbb('0x2'),_0xfcbb('0x3'),_0xfcbb('0x4'),_0xfcbb('0x5')),'defaultValue':_0xfcbb('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfcbb('0x6')]},'keyType':{'type':Sequelize[_0xfcbb('0x7')]('string',_0xfcbb('0x2'),_0xfcbb('0x3'))},'keyContent':{'type':Sequelize[_0xfcbb('0x6')]},'idField':{'type':Sequelize[_0xfcbb('0x6')]},'nameField':{'type':Sequelize[_0xfcbb('0x6')]},'customField':{'type':Sequelize[_0xfcbb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfcbb('0x6')]}}; \ No newline at end of file +var _0xf0e5=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5de944,_0x508cd5){var _0x4d55bc=function(_0x324277){while(--_0x324277){_0x5de944['push'](_0x5de944['shift']());}};_0x4d55bc(++_0x508cd5);}(_0xf0e5,0x124));var _0x5f0e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xf0e5[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x5f0e('0x0'));module[_0x5f0e('0x1')]={'type':{'type':Sequelize[_0x5f0e('0x2')](_0x5f0e('0x3'),_0x5f0e('0x4'),_0x5f0e('0x5'),_0x5f0e('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5f0e('0x7')]},'key':{'type':Sequelize[_0x5f0e('0x7')]},'keyType':{'type':Sequelize[_0x5f0e('0x2')](_0x5f0e('0x3'),_0x5f0e('0x4'),_0x5f0e('0x5'))},'keyContent':{'type':Sequelize[_0x5f0e('0x7')]},'idField':{'type':Sequelize[_0x5f0e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5f0e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5f0e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 9590da0..33b365f 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 _0x8e94=['then','end','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','moment','mustache','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy'];(function(_0x1d16dc,_0x452b61){var _0x2e68b8=function(_0x41dd7f){while(--_0x41dd7f){_0x1d16dc['push'](_0x1d16dc['shift']());}};_0x2e68b8(++_0x452b61);}(_0x8e94,0xf8));var _0x48e9=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0x8e94[_0x26a818];return _0x5d8ca0;};'use strict';var emlformat=require(_0x48e9('0x0'));var rimraf=require(_0x48e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48e9('0x2'));var rp=require('request-promise');var moment=require(_0x48e9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x48e9('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x48e9('0x5'));var ejs=require(_0x48e9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48e9('0x7'));var squel=require('squel');var crypto=require(_0x48e9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x48e9('0x9'));var toCsv=require(_0x48e9('0x5'));var querystring=require(_0x48e9('0xa'));var Papa=require(_0x48e9('0xb'));var Redis=require('ioredis');var authService=require(_0x48e9('0xc'));var qs=require(_0x48e9('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48e9('0xe'));var logger=require('../../config/logger')(_0x48e9('0xf'));var utils=require(_0x48e9('0x10'));var config=require(_0x48e9('0x11'));var licenseUtil=require(_0x48e9('0x12'));var db=require(_0x48e9('0x13'))['db'];function respondWithStatusCode(_0x956ebd,_0x567600){_0x567600=_0x567600||0xcc;return function(_0x28fcc0){if(_0x28fcc0){return _0x956ebd[_0x48e9('0x14')](_0x567600);}return _0x956ebd[_0x48e9('0x15')](_0x567600)['end']();};}function respondWithResult(_0x49ef9b,_0x38ee14){_0x38ee14=_0x38ee14||0xc8;return function(_0x29bb11){if(_0x29bb11){return _0x49ef9b[_0x48e9('0x15')](_0x38ee14)[_0x48e9('0x16')](_0x29bb11);}};}function respondWithFilteredResult(_0x1a5fd6,_0x18f318){return function(_0x421862){if(_0x421862){var _0x223884=typeof _0x18f318[_0x48e9('0x17')]===_0x48e9('0x18')&&typeof _0x18f318[_0x48e9('0x19')]===_0x48e9('0x18');var _0x5a7470=_0x421862[_0x48e9('0x1a')];var _0x421508=_0x223884?0x0:_0x18f318[_0x48e9('0x17')];var _0x51ab2d=_0x223884?_0x421862[_0x48e9('0x1a')]:_0x18f318[_0x48e9('0x17')]+_0x18f318[_0x48e9('0x19')];var _0xc7f638;if(_0x51ab2d>=_0x5a7470){_0x51ab2d=_0x5a7470;_0xc7f638=0xc8;}else{_0xc7f638=0xce;}_0x1a5fd6[_0x48e9('0x15')](_0xc7f638);return _0x1a5fd6[_0x48e9('0x1b')](_0x48e9('0x1c'),_0x421508+'-'+_0x51ab2d+'/'+_0x5a7470)[_0x48e9('0x16')](_0x421862);}return null;};}function patchUpdates(_0x54f07d){return function(_0x351fc5){try{jsonpatch[_0x48e9('0x1d')](_0x351fc5,_0x54f07d,!![]);}catch(_0xe985e6){return BPromise['reject'](_0xe985e6);}return _0x351fc5['save']();};}function saveUpdates(_0x1501ab,_0x5fa95d){return function(_0x422d40){if(_0x422d40){return _0x422d40[_0x48e9('0x1e')](_0x1501ab)['then'](function(_0x2c864d){return _0x2c864d;});}return null;};}function removeEntity(_0x27a61a,_0x56f782){return function(_0x2035dd){if(_0x2035dd){return _0x2035dd[_0x48e9('0x1f')]()[_0x48e9('0x20')](function(){_0x27a61a['status'](0xcc)[_0x48e9('0x21')]();});}};}function handleEntityNotFound(_0x361bff,_0x502d3d){return function(_0x588daa){if(!_0x588daa){_0x361bff['sendStatus'](0x194);}return _0x588daa;};}function handleError(_0x4e2e95,_0x338aa9){_0x338aa9=_0x338aa9||0x1f4;return function(_0x1ac2e8){logger['error'](_0x1ac2e8[_0x48e9('0x22')]);if(_0x1ac2e8[_0x48e9('0x23')]){delete _0x1ac2e8['name'];}_0x4e2e95[_0x48e9('0x15')](_0x338aa9)[_0x48e9('0x24')](_0x1ac2e8);};}exports[_0x48e9('0x25')]=function(_0x2fe15b,_0x976ae1){var _0x5565c5={},_0x64c551={},_0x3f7196={'count':0x0,'rows':[]};var _0x5e37aa=_[_0x48e9('0x26')](db[_0x48e9('0x27')][_0x48e9('0x28')],function(_0x509be8){return{'name':_0x509be8[_0x48e9('0x29')],'type':_0x509be8['type'][_0x48e9('0x2a')]};});_0x64c551[_0x48e9('0x2b')]=_[_0x48e9('0x26')](_0x5e37aa,_0x48e9('0x23'));_0x64c551[_0x48e9('0x2c')]=_[_0x48e9('0x2d')](_0x2fe15b[_0x48e9('0x2c')]);_0x64c551[_0x48e9('0x2e')]=_[_0x48e9('0x2f')](_0x64c551[_0x48e9('0x2b')],_0x64c551[_0x48e9('0x2c')]);_0x5565c5['attributes']=_['intersection'](_0x64c551[_0x48e9('0x2b')],qs[_0x48e9('0x30')](_0x2fe15b['query']['fields']));_0x5565c5[_0x48e9('0x31')]=_0x5565c5[_0x48e9('0x31')]['length']?_0x5565c5[_0x48e9('0x31')]:_0x64c551[_0x48e9('0x2b')];if(!_0x2fe15b['query'][_0x48e9('0x32')](_0x48e9('0x33'))){_0x5565c5['limit']=qs[_0x48e9('0x19')](_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x19')]);_0x5565c5[_0x48e9('0x17')]=qs[_0x48e9('0x17')](_0x2fe15b[_0x48e9('0x2c')]['offset']);}_0x5565c5[_0x48e9('0x34')]=qs[_0x48e9('0x35')](_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x35')]);_0x5565c5[_0x48e9('0x36')]=qs[_0x48e9('0x2e')](_[_0x48e9('0x37')](_0x2fe15b[_0x48e9('0x2c')],_0x64c551[_0x48e9('0x2e')]),_0x5e37aa);if(_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x38')]){_0x5565c5['where']=_[_0x48e9('0x39')](_0x5565c5[_0x48e9('0x36')],{'$or':_[_0x48e9('0x26')](_0x5e37aa,function(_0x155c4e){if(_0x155c4e['type']!==_0x48e9('0x3a')){var _0x44f4ab={};_0x44f4ab[_0x155c4e[_0x48e9('0x23')]]={'$like':'%'+_0x2fe15b[_0x48e9('0x2c')][_0x48e9('0x38')]+'%'};return _0x44f4ab;}})});}_0x5565c5=_[_0x48e9('0x39')]({},_0x5565c5,_0x2fe15b['options']);var _0x5de597={'where':_0x5565c5[_0x48e9('0x36')]};return db[_0x48e9('0x27')][_0x48e9('0x1a')](_0x5de597)[_0x48e9('0x20')](function(_0x3411c0){_0x3f7196[_0x48e9('0x1a')]=_0x3411c0;if(_0x2fe15b['query'][_0x48e9('0x3b')]){_0x5565c5[_0x48e9('0x3c')]=[{'all':!![]}];}return db[_0x48e9('0x27')]['findAll'](_0x5565c5);})[_0x48e9('0x20')](function(_0x83154c){_0x3f7196[_0x48e9('0x3d')]=_0x83154c;return _0x3f7196;})[_0x48e9('0x20')](respondWithFilteredResult(_0x976ae1,_0x5565c5))['catch'](handleError(_0x976ae1,null));};exports[_0x48e9('0x3e')]=function(_0xf85bf1,_0xf34683){var _0x133fa5={'raw':!![],'where':{'id':_0xf85bf1[_0x48e9('0x3f')]['id']}},_0x24fcce={};_0x24fcce[_0x48e9('0x2b')]=_[_0x48e9('0x2d')](db[_0x48e9('0x27')][_0x48e9('0x28')]);_0x24fcce[_0x48e9('0x2c')]=_['keys'](_0xf85bf1['query']);_0x24fcce[_0x48e9('0x2e')]=_[_0x48e9('0x2f')](_0x24fcce['model'],_0x24fcce[_0x48e9('0x2c')]);_0x133fa5[_0x48e9('0x31')]=_[_0x48e9('0x2f')](_0x24fcce[_0x48e9('0x2b')],qs[_0x48e9('0x30')](_0xf85bf1[_0x48e9('0x2c')][_0x48e9('0x30')]));_0x133fa5[_0x48e9('0x31')]=_0x133fa5['attributes'][_0x48e9('0x40')]?_0x133fa5[_0x48e9('0x31')]:_0x24fcce[_0x48e9('0x2b')];if(_0xf85bf1[_0x48e9('0x2c')]['includeAll']){_0x133fa5['include']=[{'all':!![]}];}_0x133fa5=_[_0x48e9('0x39')]({},_0x133fa5,_0xf85bf1[_0x48e9('0x41')]);return db[_0x48e9('0x27')][_0x48e9('0x42')](_0x133fa5)[_0x48e9('0x20')](handleEntityNotFound(_0xf34683,null))[_0x48e9('0x20')](respondWithResult(_0xf34683,null))['catch'](handleError(_0xf34683,null));};exports[_0x48e9('0x43')]=function(_0x12b347,_0x172bad){return db[_0x48e9('0x27')][_0x48e9('0x43')](_0x12b347[_0x48e9('0x44')],{})[_0x48e9('0x20')](respondWithResult(_0x172bad,0xc9))[_0x48e9('0x45')](handleError(_0x172bad,null));};exports[_0x48e9('0x1e')]=function(_0x2ef1b7,_0x1ba6a0){if(_0x2ef1b7[_0x48e9('0x44')]['id']){delete _0x2ef1b7['body']['id'];}return db[_0x48e9('0x27')]['find']({'where':{'id':_0x2ef1b7[_0x48e9('0x3f')]['id']}})[_0x48e9('0x20')](handleEntityNotFound(_0x1ba6a0,null))[_0x48e9('0x20')](saveUpdates(_0x2ef1b7[_0x48e9('0x44')],null))['then'](respondWithResult(_0x1ba6a0,null))[_0x48e9('0x45')](handleError(_0x1ba6a0,null));};exports[_0x48e9('0x1f')]=function(_0x36dc16,_0x1a727b){return db[_0x48e9('0x27')]['find']({'where':{'id':_0x36dc16[_0x48e9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a727b,null))[_0x48e9('0x20')](removeEntity(_0x1a727b,null))[_0x48e9('0x45')](handleError(_0x1a727b,null));}; \ No newline at end of file +var _0x770e=['path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','ZendeskField','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','fields','find','create','body','catch','params','rimraf','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x594cea,_0x1142c3){var _0xe0a5e4=function(_0x51933f){while(--_0x51933f){_0x594cea['push'](_0x594cea['shift']());}};_0xe0a5e4(++_0x1142c3);}(_0x770e,0x1b0));var _0xe770=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x770e[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe770('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe770('0x1'));var rp=require('request-promise');var moment=require(_0xe770('0x2'));var BPromise=require(_0xe770('0x3'));var Mustache=require(_0xe770('0x4'));var util=require(_0xe770('0x5'));var path=require(_0xe770('0x6'));var sox=require('sox');var csv=require(_0xe770('0x7'));var ejs=require(_0xe770('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe770('0x9'));var deskjs=require(_0xe770('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe770('0xb'));var Papa=require(_0xe770('0xc'));var Redis=require('ioredis');var authService=require(_0xe770('0xd'));var qs=require(_0xe770('0xe'));var as=require(_0xe770('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe770('0x10'))('api');var utils=require(_0xe770('0x11'));var config=require(_0xe770('0x12'));var licenseUtil=require(_0xe770('0x13'));var db=require(_0xe770('0x14'))['db'];function respondWithStatusCode(_0x3057c3,_0x47dc3c){_0x47dc3c=_0x47dc3c||0xcc;return function(_0x3c1f6c){if(_0x3c1f6c){return _0x3057c3['sendStatus'](_0x47dc3c);}return _0x3057c3[_0xe770('0x15')](_0x47dc3c)[_0xe770('0x16')]();};}function respondWithResult(_0x3d12e0,_0x43e70a){_0x43e70a=_0x43e70a||0xc8;return function(_0x150fc0){if(_0x150fc0){return _0x3d12e0[_0xe770('0x15')](_0x43e70a)[_0xe770('0x17')](_0x150fc0);}};}function respondWithFilteredResult(_0x47fcab,_0x70efc6){return function(_0x55ccde){if(_0x55ccde){var _0x208690=typeof _0x70efc6[_0xe770('0x18')]===_0xe770('0x19')&&typeof _0x70efc6['limit']===_0xe770('0x19');var _0x272965=_0x55ccde[_0xe770('0x1a')];var _0x5f5d8c=_0x208690?0x0:_0x70efc6['offset'];var _0x93b6e2=_0x208690?_0x55ccde[_0xe770('0x1a')]:_0x70efc6['offset']+_0x70efc6[_0xe770('0x1b')];var _0x14106a;if(_0x93b6e2>=_0x272965){_0x93b6e2=_0x272965;_0x14106a=0xc8;}else{_0x14106a=0xce;}_0x47fcab[_0xe770('0x15')](_0x14106a);return _0x47fcab[_0xe770('0x1c')](_0xe770('0x1d'),_0x5f5d8c+'-'+_0x93b6e2+'/'+_0x272965)[_0xe770('0x17')](_0x55ccde);}return null;};}function patchUpdates(_0x4fb8a4){return function(_0x325b40){try{jsonpatch[_0xe770('0x1e')](_0x325b40,_0x4fb8a4,!![]);}catch(_0x273b29){return BPromise[_0xe770('0x1f')](_0x273b29);}return _0x325b40['save']();};}function saveUpdates(_0x4ccd62,_0x3d4c50){return function(_0x136b59){if(_0x136b59){return _0x136b59[_0xe770('0x20')](_0x4ccd62)[_0xe770('0x21')](function(_0x164ff7){return _0x164ff7;});}return null;};}function removeEntity(_0x1cdae5,_0x81a553){return function(_0x4b20ae){if(_0x4b20ae){return _0x4b20ae[_0xe770('0x22')]()[_0xe770('0x21')](function(){_0x1cdae5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb053b7,_0xcc40c9){return function(_0x42d66f){if(!_0x42d66f){_0xb053b7[_0xe770('0x23')](0x194);}return _0x42d66f;};}function handleError(_0x2f9bc6,_0x3f2394){_0x3f2394=_0x3f2394||0x1f4;return function(_0x1905ca){logger['error'](_0x1905ca[_0xe770('0x24')]);if(_0x1905ca[_0xe770('0x25')]){delete _0x1905ca['name'];}_0x2f9bc6[_0xe770('0x15')](_0x3f2394)[_0xe770('0x26')](_0x1905ca);};}exports['index']=function(_0x4e445f,_0x30834e){var _0x28dca5={},_0x649dc6={},_0x57fcc4={'count':0x0,'rows':[]};var _0x3526fa=_[_0xe770('0x27')](db[_0xe770('0x28')][_0xe770('0x29')],function(_0x11bf10){return{'name':_0x11bf10[_0xe770('0x2a')],'type':_0x11bf10['type'][_0xe770('0x2b')]};});_0x649dc6[_0xe770('0x2c')]=_['map'](_0x3526fa,_0xe770('0x25'));_0x649dc6['query']=_[_0xe770('0x2d')](_0x4e445f[_0xe770('0x2e')]);_0x649dc6[_0xe770('0x2f')]=_['intersection'](_0x649dc6[_0xe770('0x2c')],_0x649dc6[_0xe770('0x2e')]);_0x28dca5[_0xe770('0x30')]=_[_0xe770('0x31')](_0x649dc6[_0xe770('0x2c')],qs['fields'](_0x4e445f[_0xe770('0x2e')]['fields']));_0x28dca5[_0xe770('0x30')]=_0x28dca5[_0xe770('0x30')][_0xe770('0x32')]?_0x28dca5[_0xe770('0x30')]:_0x649dc6[_0xe770('0x2c')];if(!_0x4e445f['query'][_0xe770('0x33')](_0xe770('0x34'))){_0x28dca5[_0xe770('0x1b')]=qs['limit'](_0x4e445f[_0xe770('0x2e')][_0xe770('0x1b')]);_0x28dca5[_0xe770('0x18')]=qs['offset'](_0x4e445f['query'][_0xe770('0x18')]);}_0x28dca5[_0xe770('0x35')]=qs[_0xe770('0x36')](_0x4e445f[_0xe770('0x2e')]['sort']);_0x28dca5['where']=qs[_0xe770('0x2f')](_[_0xe770('0x37')](_0x4e445f[_0xe770('0x2e')],_0x649dc6[_0xe770('0x2f')]),_0x3526fa);if(_0x4e445f[_0xe770('0x2e')]['filter']){_0x28dca5[_0xe770('0x38')]=_[_0xe770('0x39')](_0x28dca5[_0xe770('0x38')],{'$or':_[_0xe770('0x27')](_0x3526fa,function(_0x1ed45e){if(_0x1ed45e[_0xe770('0x3a')]!==_0xe770('0x3b')){var _0x4fbf0d={};_0x4fbf0d[_0x1ed45e[_0xe770('0x25')]]={'$like':'%'+_0x4e445f['query'][_0xe770('0x3c')]+'%'};return _0x4fbf0d;}})});}_0x28dca5=_[_0xe770('0x39')]({},_0x28dca5,_0x4e445f[_0xe770('0x3d')]);var _0x37febb={'where':_0x28dca5[_0xe770('0x38')]};return db[_0xe770('0x28')][_0xe770('0x1a')](_0x37febb)[_0xe770('0x21')](function(_0x3fe5a7){_0x57fcc4[_0xe770('0x1a')]=_0x3fe5a7;if(_0x4e445f[_0xe770('0x2e')][_0xe770('0x3e')]){_0x28dca5[_0xe770('0x3f')]=[{'all':!![]}];}return db[_0xe770('0x28')][_0xe770('0x40')](_0x28dca5);})[_0xe770('0x21')](function(_0x4b4215){_0x57fcc4[_0xe770('0x41')]=_0x4b4215;return _0x57fcc4;})[_0xe770('0x21')](respondWithFilteredResult(_0x30834e,_0x28dca5))['catch'](handleError(_0x30834e,null));};exports[_0xe770('0x42')]=function(_0x248178,_0x3050ca){var _0x3fa103={'raw':!![],'where':{'id':_0x248178['params']['id']}},_0x27451e={};_0x27451e[_0xe770('0x2c')]=_[_0xe770('0x2d')](db[_0xe770('0x28')][_0xe770('0x29')]);_0x27451e['query']=_['keys'](_0x248178['query']);_0x27451e[_0xe770('0x2f')]=_[_0xe770('0x31')](_0x27451e[_0xe770('0x2c')],_0x27451e[_0xe770('0x2e')]);_0x3fa103[_0xe770('0x30')]=_[_0xe770('0x31')](_0x27451e[_0xe770('0x2c')],qs['fields'](_0x248178[_0xe770('0x2e')][_0xe770('0x43')]));_0x3fa103['attributes']=_0x3fa103['attributes'][_0xe770('0x32')]?_0x3fa103[_0xe770('0x30')]:_0x27451e[_0xe770('0x2c')];if(_0x248178['query']['includeAll']){_0x3fa103[_0xe770('0x3f')]=[{'all':!![]}];}_0x3fa103=_['merge']({},_0x3fa103,_0x248178[_0xe770('0x3d')]);return db['ZendeskField'][_0xe770('0x44')](_0x3fa103)['then'](handleEntityNotFound(_0x3050ca,null))[_0xe770('0x21')](respondWithResult(_0x3050ca,null))['catch'](handleError(_0x3050ca,null));};exports['create']=function(_0x5e0f5f,_0x6c659b){return db[_0xe770('0x28')][_0xe770('0x45')](_0x5e0f5f[_0xe770('0x46')],{})[_0xe770('0x21')](respondWithResult(_0x6c659b,0xc9))[_0xe770('0x47')](handleError(_0x6c659b,null));};exports[_0xe770('0x20')]=function(_0x164ced,_0x84c9bd){if(_0x164ced[_0xe770('0x46')]['id']){delete _0x164ced[_0xe770('0x46')]['id'];}return db[_0xe770('0x28')]['find']({'where':{'id':_0x164ced[_0xe770('0x48')]['id']}})['then'](handleEntityNotFound(_0x84c9bd,null))[_0xe770('0x21')](saveUpdates(_0x164ced[_0xe770('0x46')],null))['then'](respondWithResult(_0x84c9bd,null))[_0xe770('0x47')](handleError(_0x84c9bd,null));};exports[_0xe770('0x22')]=function(_0x508f46,_0x309fc3){return db[_0xe770('0x28')][_0xe770('0x44')]({'where':{'id':_0x508f46[_0xe770('0x48')]['id']}})[_0xe770('0x21')](handleEntityNotFound(_0x309fc3,null))[_0xe770('0x21')](removeEntity(_0x309fc3,null))[_0xe770('0x47')](handleError(_0x309fc3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e7037fc..41269b2 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 _0xb650=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0xcdf6cc,_0x25af05){var _0x39fbfb=function(_0x623e74){while(--_0x623e74){_0xcdf6cc['push'](_0xcdf6cc['shift']());}};_0x39fbfb(++_0x25af05);}(_0xb650,0xb7));var _0x0b65=function(_0xcb0ff2,_0xebce23){_0xcb0ff2=_0xcb0ff2-0x0;var _0x544e99=_0xb650[_0xcb0ff2];return _0x544e99;};'use strict';var _=require(_0x0b65('0x0'));var util=require(_0x0b65('0x1'));var logger=require(_0x0b65('0x2'))(_0x0b65('0x3'));var moment=require(_0x0b65('0x4'));var BPromise=require(_0x0b65('0x5'));var rp=require(_0x0b65('0x6'));var fs=require('fs');var path=require(_0x0b65('0x7'));var rimraf=require(_0x0b65('0x8'));var config=require(_0x0b65('0x9'));var attributes=require(_0x0b65('0xa'));module[_0x0b65('0xb')]=function(_0x439636,_0x4b358d){return _0x439636[_0x0b65('0xc')](_0x0b65('0xd'),attributes,{'tableName':_0x0b65('0xe'),'paranoid':![],'indexes':[{'name':_0x0b65('0xf'),'fields':[_0x0b65('0x10'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33fd=['request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','idField','lodash','../../config/logger','api','bluebird'];(function(_0x1337be,_0x1e0176){var _0x5e4df9=function(_0x204027){while(--_0x204027){_0x1337be['push'](_0x1337be['shift']());}};_0x5e4df9(++_0x1e0176);}(_0x33fd,0x11c));var _0xd33f=function(_0x4a10a9,_0x27635f){_0x4a10a9=_0x4a10a9-0x0;var _0x1f60f9=_0x33fd[_0x4a10a9];return _0x1f60f9;};'use strict';var _=require(_0xd33f('0x0'));var util=require('util');var logger=require(_0xd33f('0x1'))(_0xd33f('0x2'));var moment=require('moment');var BPromise=require(_0xd33f('0x3'));var rp=require(_0xd33f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd33f('0x5'));var config=require(_0xd33f('0x6'));var attributes=require(_0xd33f('0x7'));module[_0xd33f('0x8')]=function(_0x142ac6,_0x56c1fc){return _0x142ac6['define'](_0xd33f('0x9'),attributes,{'tableName':_0xd33f('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xd33f('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index e13b026..04eef7c 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 _0x0898=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x2adb63,_0x25666a){var _0x128939=function(_0x5f5c52){while(--_0x5f5c52){_0x2adb63['push'](_0x2adb63['shift']());}};_0x128939(++_0x25666a);}(_0x0898,0x1ac));var _0x8089=function(_0x103553,_0x1ae77d){_0x103553=_0x103553-0x0;var _0x4540fa=_0x0898[_0x103553];return _0x4540fa;};'use strict';var _=require(_0x8089('0x0'));var util=require(_0x8089('0x1'));var moment=require('moment');var BPromise=require(_0x8089('0x2'));var rs=require(_0x8089('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8089('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8089('0x5'));var config=require('../../config/environment');var jayson=require(_0x8089('0x6'));var client=jayson[_0x8089('0x7')][_0x8089('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13d586,_0x567cc6,_0x2b4b05){return new BPromise(function(_0x5a8da7,_0xce3dbd){return client[_0x8089('0x9')](_0x13d586,_0x2b4b05)[_0x8089('0xa')](function(_0x1c9c8a){logger[_0x8089('0xb')](_0x8089('0xc'),_0x567cc6,_0x8089('0xd'));logger[_0x8089('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x567cc6,_0x8089('0xd'),JSON[_0x8089('0xf')](_0x1c9c8a));if(_0x1c9c8a[_0x8089('0x10')]){if(_0x1c9c8a[_0x8089('0x10')][_0x8089('0x11')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x567cc6,_0x1c9c8a['error'][_0x8089('0x12')]);return _0xce3dbd(_0x1c9c8a[_0x8089('0x10')][_0x8089('0x12')]);}logger[_0x8089('0x10')](_0x8089('0xc'),_0x567cc6,_0x1c9c8a[_0x8089('0x10')]['message']);return _0x5a8da7(_0x1c9c8a[_0x8089('0x10')]['message']);}else{logger[_0x8089('0xb')]('ZendeskField,\x20%s,\x20%s',_0x567cc6,_0x8089('0xd'));_0x5a8da7(_0x1c9c8a[_0x8089('0x13')][_0x8089('0x12')]);}})[_0x8089('0x14')](function(_0x414bca){logger[_0x8089('0x10')]('ZendeskField,\x20%s,\x20%s',_0x567cc6,_0x414bca);_0xce3dbd(_0x414bca);});});} \ No newline at end of file +var _0xd074=['ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','debug'];(function(_0x58719f,_0x42ed40){var _0x2d2b3c=function(_0xf4590d){while(--_0xf4590d){_0x58719f['push'](_0x58719f['shift']());}};_0x2d2b3c(++_0x42ed40);}(_0xd074,0x1d6));var _0x4d07=function(_0x137ae3,_0x4e93bf){_0x137ae3=_0x137ae3-0x0;var _0x3de34c=_0xd074[_0x137ae3];return _0x3de34c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d07('0x0'));var BPromise=require(_0x4d07('0x1'));var rs=require(_0x4d07('0x2'));var fs=require('fs');var Redis=require(_0x4d07('0x3'));var db=require(_0x4d07('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d07('0x5'))(_0x4d07('0x6'));var config=require(_0x4d07('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4d07('0x8')][_0x4d07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x254d00,_0x4457ac,_0x48136a){return new BPromise(function(_0x349543,_0x583070){return client[_0x4d07('0xa')](_0x254d00,_0x48136a)['then'](function(_0x35738f){logger[_0x4d07('0xb')](_0x4d07('0xc'),_0x4457ac,'request\x20sent');logger[_0x4d07('0xd')](_0x4d07('0xe'),_0x4457ac,_0x4d07('0xf'),JSON[_0x4d07('0x10')](_0x35738f));if(_0x35738f['error']){if(_0x35738f[_0x4d07('0x11')][_0x4d07('0x12')]===0x1f4){logger[_0x4d07('0x11')](_0x4d07('0xc'),_0x4457ac,_0x35738f[_0x4d07('0x11')][_0x4d07('0x13')]);return _0x583070(_0x35738f[_0x4d07('0x11')]['message']);}logger[_0x4d07('0x11')](_0x4d07('0xc'),_0x4457ac,_0x35738f['error'][_0x4d07('0x13')]);return _0x349543(_0x35738f[_0x4d07('0x11')][_0x4d07('0x13')]);}else{logger[_0x4d07('0xb')]('ZendeskField,\x20%s,\x20%s',_0x4457ac,_0x4d07('0xf'));_0x349543(_0x35738f[_0x4d07('0x14')][_0x4d07('0x13')]);}})[_0x4d07('0x15')](function(_0xeef012){logger[_0x4d07('0x11')]('ZendeskField,\x20%s,\x20%s',_0x4457ac,_0xeef012);_0x583070(_0xeef012);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ea016db..37b1b08 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 _0x99e2=['/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x884bbd,_0x20947){var _0x2c9034=function(_0x203d0a){while(--_0x203d0a){_0x884bbd['push'](_0x884bbd['shift']());}};_0x2c9034(++_0x20947);}(_0x99e2,0x13c));var _0x299e=function(_0x5429af,_0x28b710){_0x5429af=_0x5429af-0x0;var _0x288a7a=_0x99e2[_0x5429af];return _0x288a7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x299e('0x0'));var timeout=require(_0x299e('0x1'));var express=require(_0x299e('0x2'));var router=express['Router']();var fs_extra=require(_0x299e('0x3'));var auth=require(_0x299e('0x4'));var interaction=require(_0x299e('0x5'));var config=require(_0x299e('0x6'));var controller=require(_0x299e('0x7'));router[_0x299e('0x8')]('/',auth[_0x299e('0x9')](),controller[_0x299e('0xa')]);router[_0x299e('0x8')](_0x299e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x299e('0x8')](_0x299e('0xc'),auth['isAuthenticated'](),controller[_0x299e('0xd')]);router['get'](_0x299e('0xe'),auth[_0x299e('0x9')](),controller[_0x299e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x299e('0x10')](_0x299e('0xc'),auth[_0x299e('0x9')](),controller[_0x299e('0x11')]);router[_0x299e('0x12')](_0x299e('0xb'),auth[_0x299e('0x9')](),controller['update']);router[_0x299e('0x13')](_0x299e('0xb'),auth['isAuthenticated'](),controller[_0x299e('0x14')]);module[_0x299e('0x15')]=router; \ No newline at end of file +var _0xe33c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe33c,0xbc));var _0xce33=function(_0x22ff24,_0x26a5d0){_0x22ff24=_0x22ff24-0x0;var _0xd3d287=_0xe33c[_0x22ff24];return _0xd3d287;};'use strict';var multer=require('multer');var util=require(_0xce33('0x0'));var path=require('path');var timeout=require(_0xce33('0x1'));var express=require(_0xce33('0x2'));var router=express[_0xce33('0x3')]();var fs_extra=require(_0xce33('0x4'));var auth=require(_0xce33('0x5'));var interaction=require(_0xce33('0x6'));var config=require(_0xce33('0x7'));var controller=require(_0xce33('0x8'));router[_0xce33('0x9')]('/',auth[_0xce33('0xa')](),controller[_0xce33('0xb')]);router[_0xce33('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xce33('0xc')]);router[_0xce33('0x9')]('/:id/configurations',auth[_0xce33('0xa')](),controller[_0xce33('0xd')]);router[_0xce33('0x9')](_0xce33('0xe'),auth[_0xce33('0xa')](),controller[_0xce33('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xce33('0x10')](_0xce33('0x11'),auth[_0xce33('0xa')](),controller[_0xce33('0x12')]);router['put'](_0xce33('0x13'),auth[_0xce33('0xa')](),controller[_0xce33('0x14')]);router[_0xce33('0x15')](_0xce33('0x13'),auth[_0xce33('0xa')](),controller[_0xce33('0x16')]);module[_0xce33('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 6a46354..5c4bc02 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 _0xa9e0=['sequelize','exports','STRING'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xd64b=['STRING','sequelize'];(function(_0x4cd9c1,_0x5b2f7e){var _0x458183=function(_0xb696da){while(--_0xb696da){_0x4cd9c1['push'](_0x4cd9c1['shift']());}};_0x458183(++_0x5b2f7e);}(_0xd64b,0xc1));var _0xbd64=function(_0x24e3aa,_0x12af36){_0x24e3aa=_0x24e3aa-0x0;var _0x3d9a41=_0xd64b[_0x24e3aa];return _0x3d9a41;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6826af4..ae5ddee 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 _0x0f0e=['to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','then','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','create','body','update','getConfigurations','params','ZohoConfiguration','pick','filter','hasOwnProperty','addConfiguration','Subjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','serverUrl','code','refreshToken','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x48461c,_0x4075e4){var _0x271e5b=function(_0x5f03a5){while(--_0x5f03a5){_0x48461c['push'](_0x48461c['shift']());}};_0x271e5b(++_0x4075e4);}(_0x0f0e,0x17e));var _0xe0f0=function(_0xeeedb5,_0x1aeb6e){_0xeeedb5=_0xeeedb5-0x0;var _0x10eef6=_0x0f0e[_0xeeedb5];return _0x10eef6;};'use strict';var emlformat=require(_0xe0f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0f0('0x1'));var jsonpatch=require(_0xe0f0('0x2'));var rp=require(_0xe0f0('0x3'));var moment=require(_0xe0f0('0x4'));var BPromise=require(_0xe0f0('0x5'));var Mustache=require(_0xe0f0('0x6'));var util=require(_0xe0f0('0x7'));var path=require(_0xe0f0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe0f0('0x9'));var fs=require('fs');var fs_extra=require(_0xe0f0('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe0f0('0xb'));var jsforce=require(_0xe0f0('0xc'));var deskjs=require(_0xe0f0('0xd'));var toCsv=require(_0xe0f0('0xe'));var querystring=require(_0xe0f0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe0f0('0x11'));var as=require(_0xe0f0('0x12'));var hardwareService=require(_0xe0f0('0x13'));var logger=require(_0xe0f0('0x14'))(_0xe0f0('0x15'));var utils=require(_0xe0f0('0x16'));var config=require(_0xe0f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0f0('0x18'))['db'];var integrations=require(_0xe0f0('0x19'));function respondWithStatusCode(_0x2d6deb,_0x5923cb){_0x5923cb=_0x5923cb||0xcc;return function(_0x3a4a83){if(_0x3a4a83){return _0x2d6deb[_0xe0f0('0x1a')](_0x5923cb);}return _0x2d6deb[_0xe0f0('0x1b')](_0x5923cb)[_0xe0f0('0x1c')]();};}function respondWithResult(_0x2e75f2,_0x47029c){_0x47029c=_0x47029c||0xc8;return function(_0x13e31c){if(_0x13e31c){return _0x2e75f2[_0xe0f0('0x1b')](_0x47029c)['json'](_0x13e31c);}};}function respondWithFilteredResult(_0x1cb9df,_0x32904c){return function(_0x22ef4f){if(_0x22ef4f){var _0x5660ea=typeof _0x32904c['offset']===_0xe0f0('0x1d')&&typeof _0x32904c[_0xe0f0('0x1e')]==='undefined';var _0x1c829a=_0x22ef4f[_0xe0f0('0x1f')];var _0x25e401=_0x5660ea?0x0:_0x32904c[_0xe0f0('0x20')];var _0x3c5b2a=_0x5660ea?_0x22ef4f['count']:_0x32904c['offset']+_0x32904c[_0xe0f0('0x1e')];var _0xd07c91;if(_0x3c5b2a>=_0x1c829a){_0x3c5b2a=_0x1c829a;_0xd07c91=0xc8;}else{_0xd07c91=0xce;}_0x1cb9df[_0xe0f0('0x1b')](_0xd07c91);return _0x1cb9df[_0xe0f0('0x21')]('Content-Range',_0x25e401+'-'+_0x3c5b2a+'/'+_0x1c829a)[_0xe0f0('0x22')](_0x22ef4f);}return null;};}function patchUpdates(_0x19c52b){return function(_0x2b35a7){try{jsonpatch[_0xe0f0('0x23')](_0x2b35a7,_0x19c52b,!![]);}catch(_0x39f178){return BPromise[_0xe0f0('0x24')](_0x39f178);}return _0x2b35a7['save']();};}function saveUpdates(_0xc04ce3,_0x29d132){return function(_0x3965db){if(_0x3965db){return _0x3965db['update'](_0xc04ce3)[_0xe0f0('0x25')](function(_0x399aa4){return _0x399aa4;});}return null;};}function removeEntity(_0x460335,_0xb33a8f){return function(_0x29d04b){if(_0x29d04b){return _0x29d04b[_0xe0f0('0x26')]()[_0xe0f0('0x25')](function(){_0x460335['status'](0xcc)[_0xe0f0('0x1c')]();});}};}function handleEntityNotFound(_0x3237dd,_0x1c18fc){return function(_0x129225){if(!_0x129225){_0x3237dd[_0xe0f0('0x1a')](0x194);}return _0x129225;};}function handleError(_0x308706,_0x2b27fc){_0x2b27fc=_0x2b27fc||0x1f4;return function(_0x31a5c9){logger['error'](_0x31a5c9[_0xe0f0('0x27')]);if(_0x31a5c9[_0xe0f0('0x28')]){delete _0x31a5c9[_0xe0f0('0x28')];}_0x308706['status'](_0x2b27fc)[_0xe0f0('0x29')](_0x31a5c9);};}exports[_0xe0f0('0x2a')]=function(_0x75147b,_0x225630){var _0x27acde={},_0x579f5c={},_0xf2d194={'count':0x0,'rows':[]};var _0x117831=_[_0xe0f0('0x2b')](db[_0xe0f0('0x2c')][_0xe0f0('0x2d')],function(_0x360497){return{'name':_0x360497['fieldName'],'type':_0x360497[_0xe0f0('0x2e')][_0xe0f0('0x2f')]};});_0x579f5c[_0xe0f0('0x30')]=_[_0xe0f0('0x2b')](_0x117831,'name');_0x579f5c[_0xe0f0('0x31')]=_[_0xe0f0('0x32')](_0x75147b[_0xe0f0('0x31')]);_0x579f5c[_0xe0f0('0x33')]=_['intersection'](_0x579f5c[_0xe0f0('0x30')],_0x579f5c[_0xe0f0('0x31')]);_0x27acde[_0xe0f0('0x34')]=_[_0xe0f0('0x35')](_0x579f5c[_0xe0f0('0x30')],qs[_0xe0f0('0x36')](_0x75147b[_0xe0f0('0x31')]['fields']));_0x27acde['attributes']=_0x27acde['attributes'][_0xe0f0('0x37')]?_0x27acde[_0xe0f0('0x34')]:_0x579f5c[_0xe0f0('0x30')];if(!_0x75147b[_0xe0f0('0x31')]['hasOwnProperty'](_0xe0f0('0x38'))){_0x27acde[_0xe0f0('0x1e')]=qs[_0xe0f0('0x1e')](_0x75147b[_0xe0f0('0x31')][_0xe0f0('0x1e')]);_0x27acde[_0xe0f0('0x20')]=qs[_0xe0f0('0x20')](_0x75147b[_0xe0f0('0x31')][_0xe0f0('0x20')]);}_0x27acde['order']=qs[_0xe0f0('0x39')](_0x75147b['query'][_0xe0f0('0x39')]);_0x27acde[_0xe0f0('0x3a')]=qs[_0xe0f0('0x33')](_['pick'](_0x75147b['query'],_0x579f5c[_0xe0f0('0x33')]),_0x117831);if(_0x75147b['query']['filter']){_0x27acde[_0xe0f0('0x3a')]=_['merge'](_0x27acde[_0xe0f0('0x3a')],{'$or':_[_0xe0f0('0x2b')](_0x117831,function(_0x599341){if(_0x599341['type']!==_0xe0f0('0x3b')){var _0x42f482={};_0x42f482[_0x599341['name']]={'$like':'%'+_0x75147b[_0xe0f0('0x31')]['filter']+'%'};return _0x42f482;}})});}_0x27acde=_[_0xe0f0('0x3c')]({},_0x27acde,_0x75147b[_0xe0f0('0x3d')]);var _0x11a8ff={'where':_0x27acde[_0xe0f0('0x3a')]};return db[_0xe0f0('0x2c')][_0xe0f0('0x1f')](_0x11a8ff)[_0xe0f0('0x25')](function(_0x22312a){_0xf2d194[_0xe0f0('0x1f')]=_0x22312a;if(_0x75147b[_0xe0f0('0x31')][_0xe0f0('0x3e')]){_0x27acde[_0xe0f0('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0xe0f0('0x40')](_0x27acde);})[_0xe0f0('0x25')](function(_0x422f97){_0xf2d194['rows']=_0x422f97;return _0xf2d194;})[_0xe0f0('0x25')](respondWithFilteredResult(_0x225630,_0x27acde))[_0xe0f0('0x41')](handleError(_0x225630,null));};exports[_0xe0f0('0x42')]=function(_0x42032a,_0x4ea0bb){var _0x30eea6={'raw':![],'where':{'id':_0x42032a['params']['id']}},_0x57f835={};_0x57f835[_0xe0f0('0x30')]=_[_0xe0f0('0x32')](db[_0xe0f0('0x2c')][_0xe0f0('0x2d')]);_0x57f835['query']=_['keys'](_0x42032a[_0xe0f0('0x31')]);_0x57f835['filters']=_[_0xe0f0('0x35')](_0x57f835[_0xe0f0('0x30')],_0x57f835[_0xe0f0('0x31')]);_0x30eea6[_0xe0f0('0x34')]=_['intersection'](_0x57f835[_0xe0f0('0x30')],qs[_0xe0f0('0x36')](_0x42032a['query'][_0xe0f0('0x36')]));_0x30eea6[_0xe0f0('0x34')]=_0x30eea6[_0xe0f0('0x34')][_0xe0f0('0x37')]?_0x30eea6['attributes']:_0x57f835['model'];if(_0x42032a[_0xe0f0('0x31')][_0xe0f0('0x3e')]){_0x30eea6[_0xe0f0('0x3f')]=[{'all':!![]}];}_0x30eea6=_[_0xe0f0('0x3c')]({},_0x30eea6,_0x42032a['options']);return db[_0xe0f0('0x2c')]['find'](_0x30eea6)['then'](handleEntityNotFound(_0x4ea0bb,null))['then'](respondWithResult(_0x4ea0bb,null))['catch'](handleError(_0x4ea0bb,null));};exports['create']=function(_0x2d6979,_0x47a5a6){return db[_0xe0f0('0x2c')][_0xe0f0('0x43')](_0x2d6979[_0xe0f0('0x44')],{})[_0xe0f0('0x25')](respondWithResult(_0x47a5a6,0xc9))['catch'](handleError(_0x47a5a6,null));};exports[_0xe0f0('0x45')]=function(_0x45bdf0,_0x2d1638){if(_0x45bdf0[_0xe0f0('0x44')]['id']){delete _0x45bdf0[_0xe0f0('0x44')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x45bdf0['params']['id']}})[_0xe0f0('0x25')](handleEntityNotFound(_0x2d1638,null))[_0xe0f0('0x25')](saveUpdates(_0x45bdf0[_0xe0f0('0x44')],null))[_0xe0f0('0x25')](respondWithResult(_0x2d1638,null))[_0xe0f0('0x41')](handleError(_0x2d1638,null));};exports['destroy']=function(_0x5d1470,_0x3380d2){return db[_0xe0f0('0x2c')]['find']({'where':{'id':_0x5d1470['params']['id']}})[_0xe0f0('0x25')](handleEntityNotFound(_0x3380d2,null))[_0xe0f0('0x25')](removeEntity(_0x3380d2,null))[_0xe0f0('0x41')](handleError(_0x3380d2,null));};exports[_0xe0f0('0x46')]=function(_0x3d62dc,_0x1c9a70,_0x57dacc){var _0x3d25ad={};var _0x3fd1e5={};var _0x3fe0fa;var _0xd339a2;return db['ZohoAccount']['findOne']({'where':{'id':_0x3d62dc[_0xe0f0('0x47')]['id']}})[_0xe0f0('0x25')](handleEntityNotFound(_0x1c9a70,null))[_0xe0f0('0x25')](function(_0x3701da){if(_0x3701da){_0x3fe0fa=_0x3701da;_0x3fd1e5['model']=_['keys'](db[_0xe0f0('0x48')][_0xe0f0('0x2d')]);_0x3fd1e5[_0xe0f0('0x31')]=_[_0xe0f0('0x32')](_0x3d62dc[_0xe0f0('0x31')]);_0x3fd1e5[_0xe0f0('0x33')]=_['intersection'](_0x3fd1e5['model'],_0x3fd1e5[_0xe0f0('0x31')]);_0x3d25ad[_0xe0f0('0x34')]=_['intersection'](_0x3fd1e5[_0xe0f0('0x30')],qs[_0xe0f0('0x36')](_0x3d62dc[_0xe0f0('0x31')]['fields']));_0x3d25ad[_0xe0f0('0x34')]=_0x3d25ad[_0xe0f0('0x34')][_0xe0f0('0x37')]?_0x3d25ad[_0xe0f0('0x34')]:_0x3fd1e5[_0xe0f0('0x30')];_0x3d25ad['order']=qs[_0xe0f0('0x39')](_0x3d62dc[_0xe0f0('0x31')]['sort']);_0x3d25ad['where']=qs[_0xe0f0('0x33')](_[_0xe0f0('0x49')](_0x3d62dc[_0xe0f0('0x31')],_0x3fd1e5[_0xe0f0('0x33')]));if(_0x3d62dc[_0xe0f0('0x31')][_0xe0f0('0x4a')]){_0x3d25ad[_0xe0f0('0x3a')]=_[_0xe0f0('0x3c')](_0x3d25ad['where'],{'$or':_[_0xe0f0('0x2b')](_0x3d25ad[_0xe0f0('0x34')],function(_0x9e9230){var _0x376dd4={};_0x376dd4[_0x9e9230]={'$like':'%'+_0x3d62dc['query']['filter']+'%'};return _0x376dd4;})});}_0x3d25ad=_['merge']({},_0x3d25ad,_0x3d62dc[_0xe0f0('0x3d')]);return _0x3fe0fa['getConfigurations'](_0x3d25ad);}})[_0xe0f0('0x25')](function(_0x17bfac){if(_0x17bfac){_0xd339a2=_0x17bfac[_0xe0f0('0x37')];if(!_0x3d62dc['query'][_0xe0f0('0x4b')](_0xe0f0('0x38'))){_0x3d25ad[_0xe0f0('0x1e')]=qs[_0xe0f0('0x1e')](_0x3d62dc[_0xe0f0('0x31')][_0xe0f0('0x1e')]);_0x3d25ad[_0xe0f0('0x20')]=qs['offset'](_0x3d62dc[_0xe0f0('0x31')]['offset']);}return _0x3fe0fa[_0xe0f0('0x46')](_0x3d25ad);}})[_0xe0f0('0x25')](function(_0x42a0d5){if(_0x42a0d5){return _0x42a0d5?{'count':_0xd339a2,'rows':_0x42a0d5}:null;}})['then'](respondWithResult(_0x1c9a70,null))[_0xe0f0('0x41')](handleError(_0x1c9a70,null));};exports[_0xe0f0('0x4c')]=function(_0x5c45ec,_0x40a92c,_0x647f1c){if(_0x5c45ec[_0xe0f0('0x44')]['id']){delete _0x5c45ec[_0xe0f0('0x44')]['id'];}return db[_0xe0f0('0x2c')]['findOne']({'where':{'id':_0x5c45ec[_0xe0f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x40a92c,null))[_0xe0f0('0x25')](function(_0x4ff2d7){if(_0x4ff2d7){_0x5c45ec['body']['AccountId']=_0x4ff2d7['id'];_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x4d')]=integrations['getSubjects'](_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x4e')],_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x2e')]);_0x5c45ec[_0xe0f0('0x44')]['Descriptions']=integrations[_0xe0f0('0x4f')](_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x4e')],_0x5c45ec[_0xe0f0('0x44')][_0xe0f0('0x2e')]);return db[_0xe0f0('0x48')][_0xe0f0('0x43')](_0x5c45ec[_0xe0f0('0x44')],{'include':[{'model':db[_0xe0f0('0x50')],'as':_0xe0f0('0x4d')},{'model':db[_0xe0f0('0x50')],'as':_0xe0f0('0x51')}]});}return null;})[_0xe0f0('0x25')](respondWithResult(_0x40a92c,null))[_0xe0f0('0x41')](handleError(_0x40a92c,null));};function getAccessToken(_0x31d475){return new Promise(function(_0x45817b,_0x509aac){var _0x2b4a1a;switch(_0x31d475[_0xe0f0('0x52')]){case'US':_0x2b4a1a=_0xe0f0('0x53');break;case'AU':_0x2b4a1a=_0xe0f0('0x54');break;case'EU':_0x2b4a1a='https://accounts.zoho.eu';break;case'IN':_0x2b4a1a=_0xe0f0('0x55');break;case'CN':_0x2b4a1a=_0xe0f0('0x56');break;default:_0x2b4a1a=_0xe0f0('0x57');break;}var _0x1d2f2b={'method':_0xe0f0('0x58'),'uri':_0x2b4a1a+_0xe0f0('0x59'),'qs':{'refresh_token':_0x31d475['refreshToken'],'client_id':_0x31d475[_0xe0f0('0x5a')],'client_secret':_0x31d475[_0xe0f0('0x5b')],'grant_type':_0xe0f0('0x5c')},'json':!![]};return rp(_0x1d2f2b)[_0xe0f0('0x25')](function(_0x227812){if(_0x227812[_0xe0f0('0x5d')]){_0x45817b(_0x227812['access_token']);}else{_0x509aac(_0xe0f0('0x5e'));}})[_0xe0f0('0x41')](function(_0x316645){_0x509aac(_0x316645);});});}exports[_0xe0f0('0x5f')]=function(_0x479d4c,_0x54eeb3,_0x46ed7d){var _0x527459,_0x4e3bb0,_0x6255ff,_0x436d59,_0x336839;return db[_0xe0f0('0x2c')][_0xe0f0('0x60')]({'where':{'id':_0x479d4c[_0xe0f0('0x47')]['id']},'attributes':['id',_0xe0f0('0x61'),'zone',_0xe0f0('0x5a'),_0xe0f0('0x5b'),_0xe0f0('0x62'),_0xe0f0('0x63'),_0xe0f0('0x64')]})[_0xe0f0('0x25')](handleEntityNotFound(_0x54eeb3,null))[_0xe0f0('0x25')](function(_0x3333a3){_0x336839=_0x3333a3;_0x527459=_0x336839[_0xe0f0('0x61')];_0x4e3bb0=_0x527459===_0xe0f0('0x65')?'eu':'com';_0x6255ff=_0x336839[_0xe0f0('0x62')];var _0x5ef8b5=_0x6255ff[_0xe0f0('0x66')](-0x1);if(_0x5ef8b5==='/'||_0x5ef8b5==='\x5c'||_0x5ef8b5===':'){_0x6255ff=_0x6255ff[_0xe0f0('0x67')](0x0,_0x6255ff[_0xe0f0('0x68')](_0x5ef8b5));}if(!_0x336839[_0xe0f0('0x64')]){throw new Error(_0xe0f0('0x69'));}return getAccessToken(_0x336839);})[_0xe0f0('0x25')](function(_0x19a3d3){if(_0x19a3d3){return rp({'method':'GET','uri':util[_0xe0f0('0x6a')](_0xe0f0('0x6b'),_0x4e3bb0),'qs':{'module':_0xe0f0('0x6c')},'headers':{'Authorization':_0xe0f0('0x6d')+_0x19a3d3},'json':!![]});}})['then'](function(_0x875ce7){if(_0x875ce7){if(_0x875ce7[_0xe0f0('0x6e')]&&_0x875ce7[_0xe0f0('0x6e')][_0xe0f0('0x6f')]){throw new Error(_0x875ce7[_0xe0f0('0x6e')][_0xe0f0('0x6f')][_0xe0f0('0x70')]);}var _0x497d75=[];var _0x5f3862=[];var _0x9f04a0=[_0xe0f0('0x71'),_0xe0f0('0x72'),_0xe0f0('0x73'),_0xe0f0('0x74'),_0xe0f0('0x75'),'Call_Result',_0xe0f0('0x76'),_0xe0f0('0x77')];_0x5f3862=_['remove'](_0x875ce7[_0xe0f0('0x36')],function(_0x33152c){return _0x9f04a0[_0xe0f0('0x78')](_0x33152c[_0xe0f0('0x79')]);});for(var _0x93b780=0x0;_0x93b780<_0x5f3862[_0xe0f0('0x37')];_0x93b780++){if(_0x5f3862[_0x93b780][_0xe0f0('0x7a')]===![]){_0x497d75[_0xe0f0('0x7b')]({'id':_0x5f3862[_0x93b780]['id'],'name':_0x5f3862[_0x93b780][_0xe0f0('0x7c')],'custom':_0x5f3862[_0x93b780]['custom_field'],'options':_0x5f3862[_0x93b780][_0xe0f0('0x7d')]==='picklist'&&_0x5f3862[_0x93b780][_0xe0f0('0x7e')][_0xe0f0('0x37')]>-0x1?_['map'](_0x5f3862[_0x93b780][_0xe0f0('0x7e')],function(_0x139283){return{'name':_0x139283,'value':_0x139283};}):[]});}}return{'count':_0x497d75[_0xe0f0('0x37')],'rows':_0x497d75};}else{return{'count':0x0,'rows':[]};}})[_0xe0f0('0x25')](respondWithResult(_0x54eeb3,null))[_0xe0f0('0x41')](function(_0x2e4085){var _0x5ed7c6=_0x479d4c[_0xe0f0('0x31')][_0xe0f0('0x7f')]?0x1f4:_0x2e4085[_0xe0f0('0x80')]||0x1f4;logger['error'](_0xe0f0('0x81'),_0xe0f0('0x5f'),_0x5ed7c6,JSON[_0xe0f0('0x82')](_0x2e4085));delete _0x2e4085[_0xe0f0('0x28')];if(_0x5ed7c6===0x191){_0x5ed7c6=0x190;}_0x54eeb3[_0xe0f0('0x1b')](_0x5ed7c6)[_0xe0f0('0x29')](_0x479d4c['query'][_0xe0f0('0x7f')]?{'message':_0xe0f0('0x83'),'statusCode':_0x2e4085[_0xe0f0('0x80')]}:_0x2e4085);});}; \ No newline at end of file +var _0x5ba8=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','limit','undefined','count','offset','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','params','getConfigurations','AccountId','Subjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','clientSecret','serverUrl','host','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra'];(function(_0x45d691,_0x87e6fe){var _0x582b1b=function(_0x1bc8c2){while(--_0x1bc8c2){_0x45d691['push'](_0x45d691['shift']());}};_0x582b1b(++_0x87e6fe);}(_0x5ba8,0x79));var _0x85ba=function(_0x296359,_0x20d196){_0x296359=_0x296359-0x0;var _0x4b593d=_0x5ba8[_0x296359];return _0x4b593d;};'use strict';var emlformat=require(_0x85ba('0x0'));var rimraf=require(_0x85ba('0x1'));var zipdir=require(_0x85ba('0x2'));var jsonpatch=require(_0x85ba('0x3'));var rp=require('request-promise');var moment=require(_0x85ba('0x4'));var BPromise=require(_0x85ba('0x5'));var Mustache=require(_0x85ba('0x6'));var util=require(_0x85ba('0x7'));var path=require(_0x85ba('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x85ba('0x9'));var fs=require('fs');var fs_extra=require(_0x85ba('0xa'));var _=require(_0x85ba('0xb'));var squel=require(_0x85ba('0xc'));var crypto=require(_0x85ba('0xd'));var jsforce=require(_0x85ba('0xe'));var deskjs=require(_0x85ba('0xf'));var toCsv=require(_0x85ba('0x10'));var querystring=require(_0x85ba('0x11'));var Papa=require(_0x85ba('0x12'));var Redis=require(_0x85ba('0x13'));var authService=require(_0x85ba('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x85ba('0x15'));var hardwareService=require(_0x85ba('0x16'));var logger=require(_0x85ba('0x17'))(_0x85ba('0x18'));var utils=require('../../config/utils');var config=require(_0x85ba('0x19'));var licenseUtil=require(_0x85ba('0x1a'));var db=require(_0x85ba('0x1b'))['db'];var integrations=require(_0x85ba('0x1c'));function respondWithStatusCode(_0x3b9541,_0x43b953){_0x43b953=_0x43b953||0xcc;return function(_0x9cc258){if(_0x9cc258){return _0x3b9541['sendStatus'](_0x43b953);}return _0x3b9541[_0x85ba('0x1d')](_0x43b953)['end']();};}function respondWithResult(_0x279a41,_0x3d8d3e){_0x3d8d3e=_0x3d8d3e||0xc8;return function(_0x22070e){if(_0x22070e){return _0x279a41[_0x85ba('0x1d')](_0x3d8d3e)['json'](_0x22070e);}};}function respondWithFilteredResult(_0x43788f,_0x1dad9c){return function(_0x20fb6e){if(_0x20fb6e){var _0x5e3dc1=typeof _0x1dad9c['offset']==='undefined'&&typeof _0x1dad9c[_0x85ba('0x1e')]===_0x85ba('0x1f');var _0x128fc1=_0x20fb6e[_0x85ba('0x20')];var _0x33a59b=_0x5e3dc1?0x0:_0x1dad9c[_0x85ba('0x21')];var _0x4e806e=_0x5e3dc1?_0x20fb6e[_0x85ba('0x20')]:_0x1dad9c[_0x85ba('0x21')]+_0x1dad9c[_0x85ba('0x1e')];var _0x28919a;if(_0x4e806e>=_0x128fc1){_0x4e806e=_0x128fc1;_0x28919a=0xc8;}else{_0x28919a=0xce;}_0x43788f[_0x85ba('0x1d')](_0x28919a);return _0x43788f['set'](_0x85ba('0x22'),_0x33a59b+'-'+_0x4e806e+'/'+_0x128fc1)[_0x85ba('0x23')](_0x20fb6e);}return null;};}function patchUpdates(_0x15fb74){return function(_0x280bec){try{jsonpatch[_0x85ba('0x24')](_0x280bec,_0x15fb74,!![]);}catch(_0x287249){return BPromise[_0x85ba('0x25')](_0x287249);}return _0x280bec['save']();};}function saveUpdates(_0x530ffa,_0x167a52){return function(_0x14da1e){if(_0x14da1e){return _0x14da1e[_0x85ba('0x26')](_0x530ffa)[_0x85ba('0x27')](function(_0x276a88){return _0x276a88;});}return null;};}function removeEntity(_0xa6b7e9,_0x10fefe){return function(_0x40f219){if(_0x40f219){return _0x40f219[_0x85ba('0x28')]()[_0x85ba('0x27')](function(){_0xa6b7e9[_0x85ba('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ff3,_0x19bc03){return function(_0x2d257c){if(!_0x2d257c){_0x269ff3[_0x85ba('0x29')](0x194);}return _0x2d257c;};}function handleError(_0x294261,_0x152d55){_0x152d55=_0x152d55||0x1f4;return function(_0x292037){logger[_0x85ba('0x2a')](_0x292037[_0x85ba('0x2b')]);if(_0x292037[_0x85ba('0x2c')]){delete _0x292037[_0x85ba('0x2c')];}_0x294261[_0x85ba('0x1d')](_0x152d55)[_0x85ba('0x2d')](_0x292037);};}exports[_0x85ba('0x2e')]=function(_0x3132ef,_0x85f8b1){var _0x4baf69={},_0x367dc2={},_0x40cd26={'count':0x0,'rows':[]};var _0x55ec54=_[_0x85ba('0x2f')](db[_0x85ba('0x30')][_0x85ba('0x31')],function(_0x5bf363){return{'name':_0x5bf363[_0x85ba('0x32')],'type':_0x5bf363[_0x85ba('0x33')][_0x85ba('0x34')]};});_0x367dc2[_0x85ba('0x35')]=_['map'](_0x55ec54,_0x85ba('0x2c'));_0x367dc2[_0x85ba('0x36')]=_[_0x85ba('0x37')](_0x3132ef['query']);_0x367dc2['filters']=_[_0x85ba('0x38')](_0x367dc2[_0x85ba('0x35')],_0x367dc2['query']);_0x4baf69[_0x85ba('0x39')]=_[_0x85ba('0x38')](_0x367dc2[_0x85ba('0x35')],qs[_0x85ba('0x3a')](_0x3132ef[_0x85ba('0x36')][_0x85ba('0x3a')]));_0x4baf69[_0x85ba('0x39')]=_0x4baf69['attributes'][_0x85ba('0x3b')]?_0x4baf69[_0x85ba('0x39')]:_0x367dc2[_0x85ba('0x35')];if(!_0x3132ef[_0x85ba('0x36')][_0x85ba('0x3c')](_0x85ba('0x3d'))){_0x4baf69[_0x85ba('0x1e')]=qs[_0x85ba('0x1e')](_0x3132ef['query'][_0x85ba('0x1e')]);_0x4baf69[_0x85ba('0x21')]=qs[_0x85ba('0x21')](_0x3132ef['query'][_0x85ba('0x21')]);}_0x4baf69[_0x85ba('0x3e')]=qs['sort'](_0x3132ef[_0x85ba('0x36')][_0x85ba('0x3f')]);_0x4baf69[_0x85ba('0x40')]=qs[_0x85ba('0x41')](_[_0x85ba('0x42')](_0x3132ef[_0x85ba('0x36')],_0x367dc2[_0x85ba('0x41')]),_0x55ec54);if(_0x3132ef[_0x85ba('0x36')][_0x85ba('0x43')]){_0x4baf69[_0x85ba('0x40')]=_[_0x85ba('0x44')](_0x4baf69[_0x85ba('0x40')],{'$or':_[_0x85ba('0x2f')](_0x55ec54,function(_0x36a8bb){if(_0x36a8bb[_0x85ba('0x33')]!==_0x85ba('0x45')){var _0x4bb8f6={};_0x4bb8f6[_0x36a8bb[_0x85ba('0x2c')]]={'$like':'%'+_0x3132ef[_0x85ba('0x36')][_0x85ba('0x43')]+'%'};return _0x4bb8f6;}})});}_0x4baf69=_['merge']({},_0x4baf69,_0x3132ef[_0x85ba('0x46')]);var _0xabe352={'where':_0x4baf69[_0x85ba('0x40')]};return db[_0x85ba('0x30')][_0x85ba('0x20')](_0xabe352)['then'](function(_0x2c416b){_0x40cd26['count']=_0x2c416b;if(_0x3132ef[_0x85ba('0x36')]['includeAll']){_0x4baf69[_0x85ba('0x47')]=[{'all':!![]}];}return db[_0x85ba('0x30')][_0x85ba('0x48')](_0x4baf69);})[_0x85ba('0x27')](function(_0x12ef31){_0x40cd26[_0x85ba('0x49')]=_0x12ef31;return _0x40cd26;})[_0x85ba('0x27')](respondWithFilteredResult(_0x85f8b1,_0x4baf69))[_0x85ba('0x4a')](handleError(_0x85f8b1,null));};exports['show']=function(_0x193358,_0x2c5d6b){var _0x2ef8b0={'raw':![],'where':{'id':_0x193358['params']['id']}},_0x380ee0={};_0x380ee0[_0x85ba('0x35')]=_[_0x85ba('0x37')](db[_0x85ba('0x30')][_0x85ba('0x31')]);_0x380ee0['query']=_[_0x85ba('0x37')](_0x193358[_0x85ba('0x36')]);_0x380ee0['filters']=_[_0x85ba('0x38')](_0x380ee0[_0x85ba('0x35')],_0x380ee0[_0x85ba('0x36')]);_0x2ef8b0[_0x85ba('0x39')]=_['intersection'](_0x380ee0[_0x85ba('0x35')],qs[_0x85ba('0x3a')](_0x193358['query']['fields']));_0x2ef8b0['attributes']=_0x2ef8b0['attributes'][_0x85ba('0x3b')]?_0x2ef8b0[_0x85ba('0x39')]:_0x380ee0[_0x85ba('0x35')];if(_0x193358['query'][_0x85ba('0x4b')]){_0x2ef8b0[_0x85ba('0x47')]=[{'all':!![]}];}_0x2ef8b0=_[_0x85ba('0x44')]({},_0x2ef8b0,_0x193358['options']);return db[_0x85ba('0x30')][_0x85ba('0x4c')](_0x2ef8b0)['then'](handleEntityNotFound(_0x2c5d6b,null))[_0x85ba('0x27')](respondWithResult(_0x2c5d6b,null))[_0x85ba('0x4a')](handleError(_0x2c5d6b,null));};exports[_0x85ba('0x4d')]=function(_0x3d92ec,_0x2ad9de){return db[_0x85ba('0x30')][_0x85ba('0x4d')](_0x3d92ec['body'],{})['then'](respondWithResult(_0x2ad9de,0xc9))[_0x85ba('0x4a')](handleError(_0x2ad9de,null));};exports[_0x85ba('0x26')]=function(_0x5f31c2,_0x237da5){if(_0x5f31c2['body']['id']){delete _0x5f31c2[_0x85ba('0x4e')]['id'];}return db['ZohoAccount'][_0x85ba('0x4c')]({'where':{'id':_0x5f31c2['params']['id']}})[_0x85ba('0x27')](handleEntityNotFound(_0x237da5,null))[_0x85ba('0x27')](saveUpdates(_0x5f31c2[_0x85ba('0x4e')],null))[_0x85ba('0x27')](respondWithResult(_0x237da5,null))[_0x85ba('0x4a')](handleError(_0x237da5,null));};exports[_0x85ba('0x28')]=function(_0x549f05,_0x4a9d7d){return db[_0x85ba('0x30')][_0x85ba('0x4c')]({'where':{'id':_0x549f05[_0x85ba('0x4f')]['id']}})[_0x85ba('0x27')](handleEntityNotFound(_0x4a9d7d,null))[_0x85ba('0x27')](removeEntity(_0x4a9d7d,null))[_0x85ba('0x4a')](handleError(_0x4a9d7d,null));};exports[_0x85ba('0x50')]=function(_0x56a66b,_0x4ddf10,_0x3e7980){var _0x14fa0a={};var _0x457916={};var _0xe87209;var _0x180cd9;return db[_0x85ba('0x30')]['findOne']({'where':{'id':_0x56a66b[_0x85ba('0x4f')]['id']}})[_0x85ba('0x27')](handleEntityNotFound(_0x4ddf10,null))[_0x85ba('0x27')](function(_0x397fb6){if(_0x397fb6){_0xe87209=_0x397fb6;_0x457916['model']=_[_0x85ba('0x37')](db['ZohoConfiguration'][_0x85ba('0x31')]);_0x457916[_0x85ba('0x36')]=_[_0x85ba('0x37')](_0x56a66b[_0x85ba('0x36')]);_0x457916[_0x85ba('0x41')]=_[_0x85ba('0x38')](_0x457916[_0x85ba('0x35')],_0x457916[_0x85ba('0x36')]);_0x14fa0a[_0x85ba('0x39')]=_[_0x85ba('0x38')](_0x457916['model'],qs['fields'](_0x56a66b[_0x85ba('0x36')][_0x85ba('0x3a')]));_0x14fa0a[_0x85ba('0x39')]=_0x14fa0a[_0x85ba('0x39')][_0x85ba('0x3b')]?_0x14fa0a['attributes']:_0x457916[_0x85ba('0x35')];_0x14fa0a[_0x85ba('0x3e')]=qs['sort'](_0x56a66b[_0x85ba('0x36')][_0x85ba('0x3f')]);_0x14fa0a[_0x85ba('0x40')]=qs[_0x85ba('0x41')](_[_0x85ba('0x42')](_0x56a66b[_0x85ba('0x36')],_0x457916[_0x85ba('0x41')]));if(_0x56a66b[_0x85ba('0x36')]['filter']){_0x14fa0a[_0x85ba('0x40')]=_[_0x85ba('0x44')](_0x14fa0a[_0x85ba('0x40')],{'$or':_[_0x85ba('0x2f')](_0x14fa0a['attributes'],function(_0xa03eb0){var _0x211f97={};_0x211f97[_0xa03eb0]={'$like':'%'+_0x56a66b[_0x85ba('0x36')][_0x85ba('0x43')]+'%'};return _0x211f97;})});}_0x14fa0a=_['merge']({},_0x14fa0a,_0x56a66b[_0x85ba('0x46')]);return _0xe87209[_0x85ba('0x50')](_0x14fa0a);}})[_0x85ba('0x27')](function(_0x448d41){if(_0x448d41){_0x180cd9=_0x448d41[_0x85ba('0x3b')];if(!_0x56a66b[_0x85ba('0x36')]['hasOwnProperty']('nolimit')){_0x14fa0a[_0x85ba('0x1e')]=qs[_0x85ba('0x1e')](_0x56a66b[_0x85ba('0x36')]['limit']);_0x14fa0a[_0x85ba('0x21')]=qs[_0x85ba('0x21')](_0x56a66b[_0x85ba('0x36')][_0x85ba('0x21')]);}return _0xe87209['getConfigurations'](_0x14fa0a);}})['then'](function(_0x38e72f){if(_0x38e72f){return _0x38e72f?{'count':_0x180cd9,'rows':_0x38e72f}:null;}})['then'](respondWithResult(_0x4ddf10,null))['catch'](handleError(_0x4ddf10,null));};exports['addConfiguration']=function(_0x5b4e6c,_0x1ffcd5,_0x3b1b60){if(_0x5b4e6c[_0x85ba('0x4e')]['id']){delete _0x5b4e6c[_0x85ba('0x4e')]['id'];}return db[_0x85ba('0x30')]['findOne']({'where':{'id':_0x5b4e6c[_0x85ba('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ffcd5,null))[_0x85ba('0x27')](function(_0x39a43f){if(_0x39a43f){_0x5b4e6c[_0x85ba('0x4e')][_0x85ba('0x51')]=_0x39a43f['id'];_0x5b4e6c[_0x85ba('0x4e')][_0x85ba('0x52')]=integrations['getSubjects'](_0x5b4e6c[_0x85ba('0x4e')][_0x85ba('0x53')],_0x5b4e6c[_0x85ba('0x4e')][_0x85ba('0x33')]);_0x5b4e6c['body']['Descriptions']=integrations[_0x85ba('0x54')](_0x5b4e6c[_0x85ba('0x4e')][_0x85ba('0x53')],_0x5b4e6c[_0x85ba('0x4e')][_0x85ba('0x33')]);return db[_0x85ba('0x55')][_0x85ba('0x4d')](_0x5b4e6c[_0x85ba('0x4e')],{'include':[{'model':db[_0x85ba('0x56')],'as':_0x85ba('0x52')},{'model':db[_0x85ba('0x56')],'as':_0x85ba('0x57')}]});}return null;})[_0x85ba('0x27')](respondWithResult(_0x1ffcd5,null))[_0x85ba('0x4a')](handleError(_0x1ffcd5,null));};function getAccessToken(_0x236db6){return new Promise(function(_0x24beeb,_0x2dbc46){var _0x26069e;switch(_0x236db6['zone']){case'US':_0x26069e=_0x85ba('0x58');break;case'AU':_0x26069e=_0x85ba('0x59');break;case'EU':_0x26069e=_0x85ba('0x5a');break;case'IN':_0x26069e='https://accounts.zoho.in';break;case'CN':_0x26069e='https://accounts.zoho.com.cn';break;default:_0x26069e=_0x85ba('0x5a');break;}var _0xf96d36={'method':_0x85ba('0x5b'),'uri':_0x26069e+_0x85ba('0x5c'),'qs':{'refresh_token':_0x236db6[_0x85ba('0x5d')],'client_id':_0x236db6[_0x85ba('0x5e')],'client_secret':_0x236db6['clientSecret'],'grant_type':_0x85ba('0x5f')},'json':!![]};return rp(_0xf96d36)[_0x85ba('0x27')](function(_0x46b8b9){if(_0x46b8b9[_0x85ba('0x60')]){_0x24beeb(_0x46b8b9[_0x85ba('0x60')]);}else{_0x2dbc46(_0x85ba('0x61'));}})['catch'](function(_0x7545c6){_0x2dbc46(_0x7545c6);});});}exports[_0x85ba('0x62')]=function(_0x420cca,_0x5c4369,_0x38ed26){var _0x43a2a8,_0x3c0352,_0x330f7f,_0x4f11a0,_0x545f05;return db['ZohoAccount']['findOne']({'where':{'id':_0x420cca[_0x85ba('0x4f')]['id']},'attributes':['id','host',_0x85ba('0x63'),_0x85ba('0x5e'),_0x85ba('0x64'),_0x85ba('0x65'),'code',_0x85ba('0x5d')]})[_0x85ba('0x27')](handleEntityNotFound(_0x5c4369,null))[_0x85ba('0x27')](function(_0xa4f3fe){_0x545f05=_0xa4f3fe;_0x43a2a8=_0x545f05[_0x85ba('0x66')];_0x3c0352=_0x43a2a8===_0x85ba('0x67')?'eu':'com';_0x330f7f=_0x545f05['serverUrl'];var _0xede593=_0x330f7f[_0x85ba('0x68')](-0x1);if(_0xede593==='/'||_0xede593==='\x5c'||_0xede593===':'){_0x330f7f=_0x330f7f[_0x85ba('0x69')](0x0,_0x330f7f[_0x85ba('0x6a')](_0xede593));}if(!_0x545f05[_0x85ba('0x5d')]){throw new Error(_0x85ba('0x6b'));}return getAccessToken(_0x545f05);})[_0x85ba('0x27')](function(_0xd67821){if(_0xd67821){return rp({'method':_0x85ba('0x6c'),'uri':util[_0x85ba('0x6d')](_0x85ba('0x6e'),_0x3c0352),'qs':{'module':_0x85ba('0x6f')},'headers':{'Authorization':_0x85ba('0x70')+_0xd67821},'json':!![]});}})['then'](function(_0x11fe4f){if(_0x11fe4f){if(_0x11fe4f[_0x85ba('0x71')]&&_0x11fe4f['response'][_0x85ba('0x2a')]){throw new Error(_0x11fe4f['response'][_0x85ba('0x2a')][_0x85ba('0x72')]);}var _0xba6204=[];var _0x474c82=[];var _0x1a0f4d=['Owner',_0x85ba('0x73'),_0x85ba('0x74'),_0x85ba('0x75'),'Call_Duration',_0x85ba('0x76'),_0x85ba('0x77'),'Call_Type'];_0x474c82=_[_0x85ba('0x78')](_0x11fe4f[_0x85ba('0x3a')],function(_0x1e2755){return _0x1a0f4d[_0x85ba('0x79')](_0x1e2755[_0x85ba('0x7a')]);});for(var _0x2b3745=0x0;_0x2b3745<_0x474c82[_0x85ba('0x3b')];_0x2b3745++){if(_0x474c82[_0x2b3745][_0x85ba('0x7b')]===![]){_0xba6204[_0x85ba('0x7c')]({'id':_0x474c82[_0x2b3745]['id'],'name':_0x474c82[_0x2b3745][_0x85ba('0x7d')],'custom':_0x474c82[_0x2b3745]['custom_field'],'options':_0x474c82[_0x2b3745]['data_type']==='picklist'&&_0x474c82[_0x2b3745][_0x85ba('0x7e')][_0x85ba('0x3b')]>-0x1?_[_0x85ba('0x2f')](_0x474c82[_0x2b3745][_0x85ba('0x7e')],function(_0x20b2fc){return{'name':_0x20b2fc,'value':_0x20b2fc};}):[]});}}return{'count':_0xba6204[_0x85ba('0x3b')],'rows':_0xba6204};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5c4369,null))[_0x85ba('0x4a')](function(_0x51f5ff){var _0x3606f8=_0x420cca['query']['test']?0x1f4:_0x51f5ff[_0x85ba('0x7f')]||0x1f4;logger[_0x85ba('0x2a')](_0x85ba('0x80'),'getFields',_0x3606f8,JSON[_0x85ba('0x81')](_0x51f5ff));delete _0x51f5ff['name'];if(_0x3606f8===0x191){_0x3606f8=0x190;}_0x5c4369[_0x85ba('0x1d')](_0x3606f8)[_0x85ba('0x2d')](_0x420cca[_0x85ba('0x36')][_0x85ba('0x82')]?{'message':_0x85ba('0x83'),'statusCode':_0x51f5ff[_0x85ba('0x7f')]}:_0x51f5ff);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 27241ea..c99daf7 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 _0xfb16=['int_zoho_accounts','changed','zone','clientSecret','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','serverUrl','code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','substring','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','parse','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','request-promise','path','./intZohoAccount.attributes','exports','define'];(function(_0x412516,_0x5e24aa){var _0x12e7b4=function(_0x137fc7){while(--_0x137fc7){_0x412516['push'](_0x412516['shift']());}};_0x12e7b4(++_0x5e24aa);}(_0xfb16,0x9e));var _0x6fb1=function(_0x392086,_0xd6adc7){_0x392086=_0x392086-0x0;var _0x10fc06=_0xfb16[_0x392086];return _0x10fc06;};'use strict';var _=require(_0x6fb1('0x0'));var util=require(_0x6fb1('0x1'));var logger=require(_0x6fb1('0x2'))(_0x6fb1('0x3'));var moment=require(_0x6fb1('0x4'));var BPromise=require('bluebird');var rp=require(_0x6fb1('0x5'));var fs=require('fs');var path=require(_0x6fb1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6fb1('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x6fb1('0x8')]=function(_0x5b6cfd,_0x7823c2){return _0x5b6cfd[_0x6fb1('0x9')]('ZohoAccount',attributes,{'tableName':_0x6fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b928a,_0x593a92,_0x56abc9){if(_0x4b928a[_0x6fb1('0xb')](_0x6fb1('0xc'))||_0x4b928a[_0x6fb1('0xb')]('serverUrl')||_0x4b928a[_0x6fb1('0xb')]('clientId')||_0x4b928a['changed'](_0x6fb1('0xd'))||_0x4b928a[_0x6fb1('0xb')]('code')||_0x4b928a[_0x6fb1('0xb')]('host')){var _0x225438,_0x18a9c2;_0x225438=_0x4b928a['serverUrl'];var _0x2fe2b6=_0x225438[_0x6fb1('0xe')](-0x1);if(_0x2fe2b6==='/'||_0x2fe2b6==='\x5c'||_0x2fe2b6===':'){_0x225438=_0x225438['substring'](0x0,_0x225438[_0x6fb1('0xf')](_0x2fe2b6));}switch(_0x4b928a[_0x6fb1('0xc')]){case'US':_0x18a9c2=_0x6fb1('0x10');break;case'AU':_0x18a9c2=_0x6fb1('0x11');break;case'IN':_0x18a9c2='https://accounts.zoho.in';break;case'CN':_0x18a9c2='https://accounts.zoho.com.cn';break;default:_0x18a9c2=_0x6fb1('0x12');break;}var _0x5ba7b8={'method':'POST','uri':_0x18a9c2+_0x6fb1('0x13'),'form':{'grant_type':_0x6fb1('0x14'),'client_id':_0x4b928a[_0x6fb1('0x15')],'client_secret':_0x4b928a[_0x6fb1('0xd')],'redirect_uri':_0x4b928a[_0x6fb1('0x16')],'code':_0x4b928a[_0x6fb1('0x17')]},'headers':{'Content-Type':_0x6fb1('0x18')}};return rp(_0x5ba7b8)[_0x6fb1('0x19')](function(_0x33f208){var _0x17feb8=JSON['parse'](_0x33f208);if(_0x17feb8[_0x6fb1('0x1a')]){_0x4b928a[_0x6fb1('0x1b')]=_0x17feb8['refresh_token'];logger[_0x6fb1('0x1c')](util[_0x6fb1('0x1d')](_0x6fb1('0x1e'),_0x4b928a['name'],_0x4b928a['id']));}else{logger['error'](util[_0x6fb1('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b928a[_0x6fb1('0x1f')],_0x4b928a['id']),util[_0x6fb1('0x20')](_0x17feb8,{'showHidden':![],'depth':null}));}return _0x56abc9(null,_0x593a92);})[_0x6fb1('0x21')](function(_0x2c5277){logger['error'](util[_0x6fb1('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b928a['name'],_0x4b928a['id']),util[_0x6fb1('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x56abc9(_0x2c5277);});}else{return _0x56abc9(null,_0x593a92);}},'beforeUpdate':function(_0xb8215d,_0x1803be,_0x34b4ec){if(_0xb8215d[_0x6fb1('0xb')]('zone')||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x16'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x15'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0xd'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x17'))||_0xb8215d[_0x6fb1('0xb')](_0x6fb1('0x22'))){var _0x25ccd3,_0x20d77f;_0x25ccd3=_0xb8215d[_0x6fb1('0x16')];var _0x33d608=_0x25ccd3[_0x6fb1('0xe')](-0x1);if(_0x33d608==='/'||_0x33d608==='\x5c'||_0x33d608===':'){_0x25ccd3=_0x25ccd3[_0x6fb1('0x23')](0x0,_0x25ccd3[_0x6fb1('0xf')](_0x33d608));}switch(_0xb8215d['zone']){case'US':_0x20d77f=_0x6fb1('0x10');break;case'AU':_0x20d77f=_0x6fb1('0x11');break;case'IN':_0x20d77f=_0x6fb1('0x24');break;case'CN':_0x20d77f=_0x6fb1('0x25');break;default:_0x20d77f='https://accounts.zoho.eu';break;}var _0x2fe5d9={'method':_0x6fb1('0x26'),'uri':_0x20d77f+_0x6fb1('0x13'),'form':{'grant_type':_0x6fb1('0x14'),'client_id':_0xb8215d[_0x6fb1('0x15')],'client_secret':_0xb8215d[_0x6fb1('0xd')],'redirect_uri':_0xb8215d[_0x6fb1('0x16')],'code':_0xb8215d['code']},'headers':{'Content-Type':_0x6fb1('0x18')}};return rp(_0x2fe5d9)[_0x6fb1('0x19')](function(_0x436c9d){var _0x316c76=JSON[_0x6fb1('0x27')](_0x436c9d);if(_0x316c76[_0x6fb1('0x1a')]){_0xb8215d[_0x6fb1('0x1b')]=_0x316c76['refresh_token'];logger[_0x6fb1('0x1c')](util[_0x6fb1('0x1d')](_0x6fb1('0x1e'),_0xb8215d['name'],_0xb8215d['id']));}else{logger[_0x6fb1('0x28')](util[_0x6fb1('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xb8215d[_0x6fb1('0x1f')],_0xb8215d['id']),util[_0x6fb1('0x20')](_0x316c76,{'showHidden':![],'depth':null}));}return _0x34b4ec(null,_0x1803be);})[_0x6fb1('0x21')](function(_0x12ca9e){logger[_0x6fb1('0x28')](util[_0x6fb1('0x1d')](_0x6fb1('0x29'),_0xb8215d['name'],_0xb8215d['id']),util[_0x6fb1('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x34b4ec(_0x12ca9e);});}else{return _0x34b4ec(null,_0x1803be);}}}});}; \ No newline at end of file +var _0xe378=['then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','authorization_code','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded'];(function(_0x5c10fc,_0x1116d9){var _0x44391b=function(_0x2de5b2){while(--_0x2de5b2){_0x5c10fc['push'](_0x5c10fc['shift']());}};_0x44391b(++_0x1116d9);}(_0xe378,0x1d0));var _0x8e37=function(_0x3e6166,_0x25b64b){_0x3e6166=_0x3e6166-0x0;var _0x1d10f5=_0xe378[_0x3e6166];return _0x1d10f5;};'use strict';var _=require('lodash');var util=require(_0x8e37('0x0'));var logger=require(_0x8e37('0x1'))(_0x8e37('0x2'));var moment=require('moment');var BPromise=require(_0x8e37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e37('0x4'));var rimraf=require(_0x8e37('0x5'));var config=require(_0x8e37('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8e37('0x7'));module[_0x8e37('0x8')]=function(_0x21821a,_0x478d2e){return _0x21821a[_0x8e37('0x9')]('ZohoAccount',attributes,{'tableName':_0x8e37('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x490e79,_0x4a0f6d,_0x1efab7){if(_0x490e79[_0x8e37('0xb')](_0x8e37('0xc'))||_0x490e79['changed'](_0x8e37('0xd'))||_0x490e79[_0x8e37('0xb')]('clientId')||_0x490e79[_0x8e37('0xb')](_0x8e37('0xe'))||_0x490e79[_0x8e37('0xb')](_0x8e37('0xf'))||_0x490e79[_0x8e37('0xb')](_0x8e37('0x10'))){var _0x5e5446,_0x32a7b4;_0x5e5446=_0x490e79[_0x8e37('0xd')];var _0x23071e=_0x5e5446[_0x8e37('0x11')](-0x1);if(_0x23071e==='/'||_0x23071e==='\x5c'||_0x23071e===':'){_0x5e5446=_0x5e5446[_0x8e37('0x12')](0x0,_0x5e5446[_0x8e37('0x13')](_0x23071e));}switch(_0x490e79['zone']){case'US':_0x32a7b4=_0x8e37('0x14');break;case'AU':_0x32a7b4=_0x8e37('0x15');break;case'IN':_0x32a7b4=_0x8e37('0x16');break;case'CN':_0x32a7b4=_0x8e37('0x17');break;default:_0x32a7b4='https://accounts.zoho.eu';break;}var _0x3c7936={'method':_0x8e37('0x18'),'uri':_0x32a7b4+_0x8e37('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x490e79[_0x8e37('0x1a')],'client_secret':_0x490e79[_0x8e37('0xe')],'redirect_uri':_0x490e79[_0x8e37('0xd')],'code':_0x490e79[_0x8e37('0xf')]},'headers':{'Content-Type':_0x8e37('0x1b')}};return rp(_0x3c7936)[_0x8e37('0x1c')](function(_0x5a2c7d){var _0x749484=JSON[_0x8e37('0x1d')](_0x5a2c7d);if(_0x749484[_0x8e37('0x1e')]){_0x490e79[_0x8e37('0x1f')]=_0x749484[_0x8e37('0x1e')];logger[_0x8e37('0x20')](util['format'](_0x8e37('0x21'),_0x490e79[_0x8e37('0x22')],_0x490e79['id']));}else{logger[_0x8e37('0x23')](util[_0x8e37('0x24')](_0x8e37('0x25'),_0x490e79['name'],_0x490e79['id']),util[_0x8e37('0x26')](_0x749484,{'showHidden':![],'depth':null}));}return _0x1efab7(null,_0x4a0f6d);})[_0x8e37('0x27')](function(_0xbc7c26){logger['error'](util[_0x8e37('0x24')](_0x8e37('0x25'),_0x490e79['name'],_0x490e79['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1efab7(_0xbc7c26);});}else{return _0x1efab7(null,_0x4a0f6d);}},'beforeUpdate':function(_0x2b05a3,_0x32b778,_0x599ee1){if(_0x2b05a3[_0x8e37('0xb')](_0x8e37('0xc'))||_0x2b05a3[_0x8e37('0xb')]('serverUrl')||_0x2b05a3[_0x8e37('0xb')](_0x8e37('0x1a'))||_0x2b05a3['changed']('clientSecret')||_0x2b05a3['changed']('code')||_0x2b05a3[_0x8e37('0xb')]('host')){var _0x504991,_0x569321;_0x504991=_0x2b05a3[_0x8e37('0xd')];var _0x49879e=_0x504991[_0x8e37('0x11')](-0x1);if(_0x49879e==='/'||_0x49879e==='\x5c'||_0x49879e===':'){_0x504991=_0x504991[_0x8e37('0x12')](0x0,_0x504991[_0x8e37('0x13')](_0x49879e));}switch(_0x2b05a3['zone']){case'US':_0x569321=_0x8e37('0x14');break;case'AU':_0x569321='https://accounts.zoho.com.au';break;case'IN':_0x569321=_0x8e37('0x16');break;case'CN':_0x569321=_0x8e37('0x17');break;default:_0x569321='https://accounts.zoho.eu';break;}var _0x510b87={'method':_0x8e37('0x18'),'uri':_0x569321+'/oauth/v2/token','form':{'grant_type':_0x8e37('0x28'),'client_id':_0x2b05a3[_0x8e37('0x1a')],'client_secret':_0x2b05a3[_0x8e37('0xe')],'redirect_uri':_0x2b05a3[_0x8e37('0xd')],'code':_0x2b05a3[_0x8e37('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x510b87)[_0x8e37('0x1c')](function(_0x1a6561){var _0x2e79f4=JSON[_0x8e37('0x1d')](_0x1a6561);if(_0x2e79f4[_0x8e37('0x1e')]){_0x2b05a3[_0x8e37('0x1f')]=_0x2e79f4[_0x8e37('0x1e')];logger['info'](util[_0x8e37('0x24')](_0x8e37('0x21'),_0x2b05a3[_0x8e37('0x22')],_0x2b05a3['id']));}else{logger['error'](util[_0x8e37('0x24')](_0x8e37('0x25'),_0x2b05a3[_0x8e37('0x22')],_0x2b05a3['id']),util[_0x8e37('0x26')](_0x2e79f4,{'showHidden':![],'depth':null}));}return _0x599ee1(null,_0x32b778);})[_0x8e37('0x27')](function(_0x1350f2){logger[_0x8e37('0x23')](util[_0x8e37('0x24')](_0x8e37('0x25'),_0x2b05a3[_0x8e37('0x22')],_0x2b05a3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x599ee1(_0x1350f2);});}else{return _0x599ee1(null,_0x32b778);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 6ad1202..6ba0c1b 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 _0xdb7e=['info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','map','include','model','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x133d17,_0x4b40a4){var _0xba9b1f=function(_0x7c8f89){while(--_0x7c8f89){_0x133d17['push'](_0x133d17['shift']());}};_0xba9b1f(++_0x4b40a4);}(_0xdb7e,0x11a));var _0xedb7=function(_0x379829,_0x395977){_0x379829=_0x379829-0x0;var _0x72a0b8=_0xdb7e[_0x379829];return _0x72a0b8;};'use strict';var _=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var moment=require(_0xedb7('0x2'));var BPromise=require('bluebird');var rs=require(_0xedb7('0x3'));var fs=require('fs');var Redis=require(_0xedb7('0x4'));var db=require(_0xedb7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xedb7('0x6'))(_0xedb7('0x7'));var config=require(_0xedb7('0x8'));var jayson=require(_0xedb7('0x9'));var client=jayson[_0xedb7('0xa')][_0xedb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x87bf4b,_0x20a7c7,_0x26774f){return new BPromise(function(_0x2ae0f7,_0x5a8650){return client[_0xedb7('0xc')](_0x87bf4b,_0x26774f)[_0xedb7('0xd')](function(_0x12c7ba){logger[_0xedb7('0xe')](_0xedb7('0xf'),_0x20a7c7,_0xedb7('0x10'));logger[_0xedb7('0x11')](_0xedb7('0x12'),_0x20a7c7,_0xedb7('0x10'),JSON[_0xedb7('0x13')](_0x12c7ba));if(_0x12c7ba[_0xedb7('0x14')]){if(_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x15')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x20a7c7,_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);return _0x5a8650(_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);}logger[_0xedb7('0x14')](_0xedb7('0xf'),_0x20a7c7,_0x12c7ba[_0xedb7('0x14')][_0xedb7('0x16')]);return _0x2ae0f7(_0x12c7ba[_0xedb7('0x14')]['message']);}else{logger['info'](_0xedb7('0xf'),_0x20a7c7,_0xedb7('0x10'));_0x2ae0f7(_0x12c7ba[_0xedb7('0x17')]['message']);}})[_0xedb7('0x18')](function(_0x3ce7c5){logger[_0xedb7('0x14')](_0xedb7('0xf'),_0x20a7c7,_0x3ce7c5);_0x5a8650(_0x3ce7c5);});});}exports[_0xedb7('0x19')]=function(_0x50f579){var _0x5d2d6a=this;return new Promise(function(_0x3d8f2a,_0xa8aae0){return db[_0xedb7('0x1a')][_0xedb7('0x1b')]({'raw':_0x50f579['options']?_0x50f579[_0xedb7('0x1c')][_0xedb7('0x1d')]===undefined?!![]:![]:!![],'where':_0x50f579[_0xedb7('0x1c')]?_0x50f579['options'][_0xedb7('0x1e')]||null:null,'attributes':_0x50f579['options']?_0x50f579[_0xedb7('0x1c')][_0xedb7('0x1f')]||null:null,'limit':_0x50f579[_0xedb7('0x1c')]?_0x50f579['options']['limit']||null:null,'include':_0x50f579[_0xedb7('0x1c')]?_0x50f579[_0xedb7('0x1c')]['include']?_[_0xedb7('0x20')](_0x50f579[_0xedb7('0x1c')]['include'],function(_0x16d887){return{'model':db[_0x16d887['model']],'as':_0x16d887['as'],'attributes':_0x16d887['attributes'],'include':_0x16d887[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x16d887['include'],function(_0x1ad4e9){return{'model':db[_0x1ad4e9[_0xedb7('0x22')]],'as':_0x1ad4e9['as'],'attributes':_0x1ad4e9[_0xedb7('0x1f')],'include':_0x1ad4e9[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x1ad4e9[_0xedb7('0x21')],function(_0xfcc7ee){return{'model':db[_0xfcc7ee[_0xedb7('0x22')]],'as':_0xfcc7ee['as'],'attributes':_0xfcc7ee['attributes']};}):[]};}):[]};}):[]:[]})[_0xedb7('0xd')](function(_0x509106){logger['info'](_0xedb7('0x19'),_0x50f579);logger[_0xedb7('0x11')]('GetZohoAccount',_0x50f579,JSON['stringify'](_0x509106));_0x3d8f2a(_0x509106);})[_0xedb7('0x18')](function(_0x515ab1){logger[_0xedb7('0x14')](_0xedb7('0x19'),_0x515ab1[_0xedb7('0x16')],_0x50f579);_0xa8aae0(_0x5d2d6a['error'](0x1f4,_0x515ab1[_0xedb7('0x16')]));});});};exports[_0xedb7('0x23')]=function(_0x320c92){var _0x2202bd=this;return new Promise(function(_0xe9293,_0xb5a7ba){return db['ZohoAccount'][_0xedb7('0x24')]({'raw':_0x320c92['options']?_0x320c92[_0xedb7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x320c92[_0xedb7('0x1c')]?_0x320c92['options'][_0xedb7('0x1e')]||null:null,'attributes':_0x320c92[_0xedb7('0x1c')]?_0x320c92[_0xedb7('0x1c')]['attributes']||null:null,'include':_0x320c92['options']?_0x320c92[_0xedb7('0x1c')][_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x320c92['options'][_0xedb7('0x21')],function(_0x572e30){return{'model':db[_0x572e30[_0xedb7('0x22')]],'as':_0x572e30['as'],'attributes':_0x572e30[_0xedb7('0x1f')],'include':_0x572e30[_0xedb7('0x21')]?_[_0xedb7('0x20')](_0x572e30[_0xedb7('0x21')],function(_0x1c2b0c){return{'model':db[_0x1c2b0c['model']],'as':_0x1c2b0c['as'],'attributes':_0x1c2b0c[_0xedb7('0x1f')],'include':_0x1c2b0c[_0xedb7('0x21')]?_['map'](_0x1c2b0c[_0xedb7('0x21')],function(_0x251875){return{'model':db[_0x251875[_0xedb7('0x22')]],'as':_0x251875['as'],'attributes':_0x251875[_0xedb7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xedb7('0xd')](function(_0x24b2b0){logger[_0xedb7('0xe')](_0xedb7('0x23'),_0x320c92);logger[_0xedb7('0x11')](_0xedb7('0x23'),_0x320c92,JSON[_0xedb7('0x13')](_0x24b2b0));_0xe9293(_0x24b2b0);})[_0xedb7('0x18')](function(_0x262199){logger[_0xedb7('0x14')]('ShowZohoAccount',_0x262199[_0xedb7('0x16')],_0x320c92);_0xb5a7ba(_0x2202bd[_0xedb7('0x14')](0x1f4,_0x262199[_0xedb7('0x16')]));});});}; \ No newline at end of file +var _0x8ff9=['model','then','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x31117b,_0xc8183a){var _0x287cb7=function(_0x20b8d6){while(--_0x20b8d6){_0x31117b['push'](_0x31117b['shift']());}};_0x287cb7(++_0xc8183a);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x4d91de,_0xc151ae){_0x4d91de=_0x4d91de-0x0;var _0x49da69=_0x8ff9[_0x4d91de];return _0x49da69;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var moment=require(_0x98ff('0x2'));var BPromise=require(_0x98ff('0x3'));var rs=require(_0x98ff('0x4'));var fs=require('fs');var Redis=require(_0x98ff('0x5'));var db=require(_0x98ff('0x6'))['db'];var utils=require(_0x98ff('0x7'));var logger=require(_0x98ff('0x8'))(_0x98ff('0x9'));var config=require(_0x98ff('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x98ff('0xb')][_0x98ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13537e,_0x21d840,_0x12d3fe){return new BPromise(function(_0xbe13f3,_0x51fbd8){return client[_0x98ff('0xd')](_0x13537e,_0x12d3fe)['then'](function(_0x4bbf37){logger[_0x98ff('0xe')](_0x98ff('0xf'),_0x21d840,_0x98ff('0x10'));logger[_0x98ff('0x11')](_0x98ff('0x12'),_0x21d840,'request\x20sent',JSON[_0x98ff('0x13')](_0x4bbf37));if(_0x4bbf37['error']){if(_0x4bbf37[_0x98ff('0x14')]['code']===0x1f4){logger['error'](_0x98ff('0xf'),_0x21d840,_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);return _0x51fbd8(_0x4bbf37['error'][_0x98ff('0x15')]);}logger['error'](_0x98ff('0xf'),_0x21d840,_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);return _0xbe13f3(_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);}else{logger[_0x98ff('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x21d840,_0x98ff('0x10'));_0xbe13f3(_0x4bbf37[_0x98ff('0x16')][_0x98ff('0x15')]);}})[_0x98ff('0x17')](function(_0x3751b9){logger[_0x98ff('0x14')](_0x98ff('0xf'),_0x21d840,_0x3751b9);_0x51fbd8(_0x3751b9);});});}exports[_0x98ff('0x18')]=function(_0x268121){var _0x3c04d4=this;return new Promise(function(_0x91e31c,_0x1611b5){return db[_0x98ff('0x19')][_0x98ff('0x1a')]({'raw':_0x268121['options']?_0x268121[_0x98ff('0x1b')][_0x98ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x268121[_0x98ff('0x1b')]?_0x268121[_0x98ff('0x1b')][_0x98ff('0x1d')]||null:null,'attributes':_0x268121[_0x98ff('0x1b')]?_0x268121[_0x98ff('0x1b')][_0x98ff('0x1e')]||null:null,'limit':_0x268121[_0x98ff('0x1b')]?_0x268121[_0x98ff('0x1b')][_0x98ff('0x1f')]||null:null,'include':_0x268121[_0x98ff('0x1b')]?_0x268121[_0x98ff('0x1b')]['include']?_['map'](_0x268121['options'][_0x98ff('0x20')],function(_0x3ee01b){return{'model':db[_0x3ee01b['model']],'as':_0x3ee01b['as'],'attributes':_0x3ee01b[_0x98ff('0x1e')],'include':_0x3ee01b['include']?_[_0x98ff('0x21')](_0x3ee01b[_0x98ff('0x20')],function(_0x308efd){return{'model':db[_0x308efd[_0x98ff('0x22')]],'as':_0x308efd['as'],'attributes':_0x308efd[_0x98ff('0x1e')],'include':_0x308efd['include']?_['map'](_0x308efd[_0x98ff('0x20')],function(_0x1a4ebd){return{'model':db[_0x1a4ebd[_0x98ff('0x22')]],'as':_0x1a4ebd['as'],'attributes':_0x1a4ebd[_0x98ff('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x98ff('0x23')](function(_0x231e00){logger[_0x98ff('0xe')](_0x98ff('0x18'),_0x268121);logger[_0x98ff('0x11')](_0x98ff('0x18'),_0x268121,JSON['stringify'](_0x231e00));_0x91e31c(_0x231e00);})[_0x98ff('0x17')](function(_0x256823){logger[_0x98ff('0x14')](_0x98ff('0x18'),_0x256823[_0x98ff('0x15')],_0x268121);_0x1611b5(_0x3c04d4[_0x98ff('0x14')](0x1f4,_0x256823[_0x98ff('0x15')]));});});};exports[_0x98ff('0x24')]=function(_0x42213a){var _0x205d85=this;return new Promise(function(_0x3fa70c,_0x1472cb){return db[_0x98ff('0x19')][_0x98ff('0x25')]({'raw':_0x42213a[_0x98ff('0x1b')]?_0x42213a[_0x98ff('0x1b')][_0x98ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x42213a[_0x98ff('0x1b')]?_0x42213a[_0x98ff('0x1b')][_0x98ff('0x1d')]||null:null,'attributes':_0x42213a[_0x98ff('0x1b')]?_0x42213a['options'][_0x98ff('0x1e')]||null:null,'include':_0x42213a[_0x98ff('0x1b')]?_0x42213a[_0x98ff('0x1b')][_0x98ff('0x20')]?_[_0x98ff('0x21')](_0x42213a['options'][_0x98ff('0x20')],function(_0x56b676){return{'model':db[_0x56b676[_0x98ff('0x22')]],'as':_0x56b676['as'],'attributes':_0x56b676[_0x98ff('0x1e')],'include':_0x56b676[_0x98ff('0x20')]?_[_0x98ff('0x21')](_0x56b676[_0x98ff('0x20')],function(_0x8dfe4d){return{'model':db[_0x8dfe4d[_0x98ff('0x22')]],'as':_0x8dfe4d['as'],'attributes':_0x8dfe4d[_0x98ff('0x1e')],'include':_0x8dfe4d[_0x98ff('0x20')]?_[_0x98ff('0x21')](_0x8dfe4d['include'],function(_0x20c907){return{'model':db[_0x20c907[_0x98ff('0x22')]],'as':_0x20c907['as'],'attributes':_0x20c907[_0x98ff('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x98ff('0x23')](function(_0x34219e){logger[_0x98ff('0xe')](_0x98ff('0x24'),_0x42213a);logger[_0x98ff('0x11')]('ShowZohoAccount',_0x42213a,JSON[_0x98ff('0x13')](_0x34219e));_0x3fa70c(_0x34219e);})['catch'](function(_0x13f7b1){logger[_0x98ff('0x14')](_0x98ff('0x24'),_0x13f7b1[_0x98ff('0x15')],_0x42213a);_0x1472cb(_0x205d85[_0x98ff('0x14')](0x1f4,_0x13f7b1['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index d20a680..bb855f4 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 _0x589e=['/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x47cc35,_0x3c310e){var _0x95ec4c=function(_0xf8f369){while(--_0xf8f369){_0x47cc35['push'](_0x47cc35['shift']());}};_0x95ec4c(++_0x3c310e);}(_0x589e,0xdc));var _0xe589=function(_0x1d1793,_0x1cc47c){_0x1d1793=_0x1d1793-0x0;var _0x42af2f=_0x589e[_0x1d1793];return _0x42af2f;};'use strict';var multer=require(_0xe589('0x0'));var util=require(_0xe589('0x1'));var path=require(_0xe589('0x2'));var timeout=require(_0xe589('0x3'));var express=require(_0xe589('0x4'));var router=express[_0xe589('0x5')]();var fs_extra=require(_0xe589('0x6'));var auth=require(_0xe589('0x7'));var interaction=require(_0xe589('0x8'));var config=require(_0xe589('0x9'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xe589('0xa')](),controller[_0xe589('0xb')]);router['get']('/:id',auth[_0xe589('0xa')](),controller[_0xe589('0xc')]);router[_0xe589('0xd')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xe589('0xd')](_0xe589('0xe'),auth['isAuthenticated'](),controller[_0xe589('0xf')]);router['get'](_0xe589('0x10'),auth[_0xe589('0xa')](),controller[_0xe589('0x11')]);router[_0xe589('0x12')]('/',auth[_0xe589('0xa')](),controller['create']);router[_0xe589('0x13')](_0xe589('0x14'),auth[_0xe589('0xa')](),controller[_0xe589('0x15')]);router[_0xe589('0x16')](_0xe589('0x14'),auth['isAuthenticated'](),controller[_0xe589('0x17')]);module['exports']=router; \ No newline at end of file +var _0xc0a2=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util'];(function(_0x824a17,_0x3fa294){var _0x582c92=function(_0x5b26c7){while(--_0x5b26c7){_0x824a17['push'](_0x824a17['shift']());}};_0x582c92(++_0x3fa294);}(_0xc0a2,0xb6));var _0x2c0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc0a2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2c0a('0x0'));var util=require(_0x2c0a('0x1'));var path=require(_0x2c0a('0x2'));var timeout=require(_0x2c0a('0x3'));var express=require('express');var router=express[_0x2c0a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2c0a('0x5'));var interaction=require(_0x2c0a('0x6'));var config=require(_0x2c0a('0x7'));var controller=require(_0x2c0a('0x8'));router[_0x2c0a('0x9')]('/',auth[_0x2c0a('0xa')](),controller[_0x2c0a('0xb')]);router['get'](_0x2c0a('0xc'),auth[_0x2c0a('0xa')](),controller[_0x2c0a('0xd')]);router[_0x2c0a('0x9')](_0x2c0a('0xe'),auth[_0x2c0a('0xa')](),controller['getFields']);router[_0x2c0a('0x9')]('/:id/subjects',auth[_0x2c0a('0xa')](),controller[_0x2c0a('0xf')]);router[_0x2c0a('0x9')](_0x2c0a('0x10'),auth[_0x2c0a('0xa')](),controller[_0x2c0a('0x11')]);router[_0x2c0a('0x12')]('/',auth[_0x2c0a('0xa')](),controller['create']);router[_0x2c0a('0x13')]('/:id',auth[_0x2c0a('0xa')](),controller['update']);router[_0x2c0a('0x14')]('/:id',auth[_0x2c0a('0xa')](),controller[_0x2c0a('0x15')]);module[_0x2c0a('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 3e4a090..dbcf666 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 _0x5455=['STRING','ENUM','lead','contact','nothing','exports'];(function(_0x3d8c1d,_0x2fe3f0){var _0x1e08e3=function(_0x13b62d){while(--_0x13b62d){_0x3d8c1d['push'](_0x3d8c1d['shift']());}};_0x1e08e3(++_0x2fe3f0);}(_0x5455,0x197));var _0x5545=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5455[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module[_0x5545('0x0')]={'name':{'type':Sequelize[_0x5545('0x1')]},'moduleCreate':{'type':Sequelize[_0x5545('0x2')](_0x5545('0x3'),_0x5545('0x4'),_0x5545('0x5')),'defaultValue':_0x5545('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x5545('0x4'),_0x5545('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8435=['STRING','ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x228abe,_0x446343){var _0x5e2475=function(_0x424f72){while(--_0x424f72){_0x228abe['push'](_0x228abe['shift']());}};_0x5e2475(++_0x446343);}(_0x8435,0xf6));var _0x5843=function(_0x128967,_0x51778b){_0x128967=_0x128967-0x0;var _0x3d49b4=_0x8435[_0x128967];return _0x3d49b4;};'use strict';var Sequelize=require(_0x5843('0x0'));module[_0x5843('0x1')]={'name':{'type':Sequelize[_0x5843('0x2')]},'moduleCreate':{'type':Sequelize[_0x5843('0x3')](_0x5843('0x4'),_0x5843('0x5'),_0x5843('0x6')),'defaultValue':_0x5843('0x4')},'moduleSearch':{'type':Sequelize[_0x5843('0x3')](_0x5843('0x7'),_0x5843('0x5'),_0x5843('0x4')),'defaultValue':_0x5843('0x7')},'description':{'type':Sequelize[_0x5843('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6835a4b..8808ca5 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 _0xf67d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','ZohoField','getFields','getSubjects','findOne','getDescriptions','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0xf67d,0x12d));var _0xdf67=function(_0x1b3077,_0x226c8e){_0x1b3077=_0x1b3077-0x0;var _0x1a2288=_0xf67d[_0x1b3077];return _0x1a2288;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdf67('0x0'));var rp=require(_0xdf67('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdf67('0x2'));var util=require(_0xdf67('0x3'));var path=require(_0xdf67('0x4'));var sox=require(_0xdf67('0x5'));var csv=require(_0xdf67('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf67('0x7'));var squel=require(_0xdf67('0x8'));var crypto=require(_0xdf67('0x9'));var jsforce=require(_0xdf67('0xa'));var deskjs=require(_0xdf67('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf67('0xc'));var Redis=require(_0xdf67('0xd'));var authService=require(_0xdf67('0xe'));var qs=require(_0xdf67('0xf'));var as=require(_0xdf67('0x10'));var hardwareService=require(_0xdf67('0x11'));var logger=require('../../config/logger')(_0xdf67('0x12'));var utils=require(_0xdf67('0x13'));var config=require(_0xdf67('0x14'));var licenseUtil=require(_0xdf67('0x15'));var db=require(_0xdf67('0x16'))['db'];function respondWithStatusCode(_0x29b49b,_0x135b79){_0x135b79=_0x135b79||0xcc;return function(_0x4ffe37){if(_0x4ffe37){return _0x29b49b['sendStatus'](_0x135b79);}return _0x29b49b[_0xdf67('0x17')](_0x135b79)[_0xdf67('0x18')]();};}function respondWithResult(_0x506b2b,_0x501566){_0x501566=_0x501566||0xc8;return function(_0x3b58ee){if(_0x3b58ee){return _0x506b2b['status'](_0x501566)[_0xdf67('0x19')](_0x3b58ee);}};}function respondWithFilteredResult(_0x21b53c,_0x539e9b){return function(_0x3a0f50){if(_0x3a0f50){var _0x25b158=typeof _0x539e9b[_0xdf67('0x1a')]===_0xdf67('0x1b')&&typeof _0x539e9b[_0xdf67('0x1c')]===_0xdf67('0x1b');var _0x56f851=_0x3a0f50[_0xdf67('0x1d')];var _0x5c0255=_0x25b158?0x0:_0x539e9b[_0xdf67('0x1a')];var _0xb2ef5a=_0x25b158?_0x3a0f50[_0xdf67('0x1d')]:_0x539e9b[_0xdf67('0x1a')]+_0x539e9b[_0xdf67('0x1c')];var _0x49521e;if(_0xb2ef5a>=_0x56f851){_0xb2ef5a=_0x56f851;_0x49521e=0xc8;}else{_0x49521e=0xce;}_0x21b53c['status'](_0x49521e);return _0x21b53c[_0xdf67('0x1e')](_0xdf67('0x1f'),_0x5c0255+'-'+_0xb2ef5a+'/'+_0x56f851)[_0xdf67('0x19')](_0x3a0f50);}return null;};}function patchUpdates(_0x57c617){return function(_0xc76ac6){try{jsonpatch['apply'](_0xc76ac6,_0x57c617,!![]);}catch(_0xa1ba79){return BPromise[_0xdf67('0x20')](_0xa1ba79);}return _0xc76ac6[_0xdf67('0x21')]();};}function saveUpdates(_0x5a22a9,_0x39545c){return function(_0x36383c){if(_0x36383c){return _0x36383c[_0xdf67('0x22')](_0x5a22a9)[_0xdf67('0x23')](function(_0x3a1f2d){return _0x3a1f2d;});}return null;};}function removeEntity(_0x2d85c7,_0x5c313a){return function(_0x43a7a8){if(_0x43a7a8){return _0x43a7a8[_0xdf67('0x24')]()[_0xdf67('0x23')](function(){_0x2d85c7[_0xdf67('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4325be,_0x3d5e8b){return function(_0x1dda7f){if(!_0x1dda7f){_0x4325be[_0xdf67('0x25')](0x194);}return _0x1dda7f;};}function handleError(_0x12cfe3,_0x51cf81){_0x51cf81=_0x51cf81||0x1f4;return function(_0x4c2571){logger[_0xdf67('0x26')](_0x4c2571[_0xdf67('0x27')]);if(_0x4c2571[_0xdf67('0x28')]){delete _0x4c2571[_0xdf67('0x28')];}_0x12cfe3[_0xdf67('0x17')](_0x51cf81)[_0xdf67('0x29')](_0x4c2571);};}exports[_0xdf67('0x2a')]=function(_0xb36374,_0x19bb77){var _0x4103a8={},_0x215685={},_0x36b293={'count':0x0,'rows':[]};var _0x206786=_[_0xdf67('0x2b')](db[_0xdf67('0x2c')]['rawAttributes'],function(_0x1527c8){return{'name':_0x1527c8['fieldName'],'type':_0x1527c8[_0xdf67('0x2d')][_0xdf67('0x2e')]};});_0x215685[_0xdf67('0x2f')]=_[_0xdf67('0x2b')](_0x206786,_0xdf67('0x28'));_0x215685['query']=_[_0xdf67('0x30')](_0xb36374['query']);_0x215685[_0xdf67('0x31')]=_[_0xdf67('0x32')](_0x215685[_0xdf67('0x2f')],_0x215685[_0xdf67('0x33')]);_0x4103a8['attributes']=_[_0xdf67('0x32')](_0x215685[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0xb36374[_0xdf67('0x33')]['fields']));_0x4103a8['attributes']=_0x4103a8[_0xdf67('0x35')][_0xdf67('0x36')]?_0x4103a8[_0xdf67('0x35')]:_0x215685['model'];if(!_0xb36374['query'][_0xdf67('0x37')](_0xdf67('0x38'))){_0x4103a8['limit']=qs[_0xdf67('0x1c')](_0xb36374[_0xdf67('0x33')][_0xdf67('0x1c')]);_0x4103a8[_0xdf67('0x1a')]=qs['offset'](_0xb36374[_0xdf67('0x33')][_0xdf67('0x1a')]);}_0x4103a8[_0xdf67('0x39')]=qs[_0xdf67('0x3a')](_0xb36374[_0xdf67('0x33')][_0xdf67('0x3a')]);_0x4103a8[_0xdf67('0x3b')]=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0xb36374[_0xdf67('0x33')],_0x215685[_0xdf67('0x31')]),_0x206786);if(_0xb36374[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x4103a8[_0xdf67('0x3b')]=_[_0xdf67('0x3e')](_0x4103a8[_0xdf67('0x3b')],{'$or':_['map'](_0x206786,function(_0x451239){if(_0x451239[_0xdf67('0x2d')]!=='VIRTUAL'){var _0x2c4960={};_0x2c4960[_0x451239[_0xdf67('0x28')]]={'$like':'%'+_0xb36374[_0xdf67('0x33')][_0xdf67('0x3d')]+'%'};return _0x2c4960;}})});}_0x4103a8=_[_0xdf67('0x3e')]({},_0x4103a8,_0xb36374[_0xdf67('0x3f')]);var _0x3ed1dc={'where':_0x4103a8[_0xdf67('0x3b')]};return db['ZohoConfiguration'][_0xdf67('0x1d')](_0x3ed1dc)[_0xdf67('0x23')](function(_0x1593fd){_0x36b293['count']=_0x1593fd;if(_0xb36374[_0xdf67('0x33')]['includeAll']){_0x4103a8[_0xdf67('0x40')]=[{'all':!![]}];}return db[_0xdf67('0x2c')][_0xdf67('0x41')](_0x4103a8);})[_0xdf67('0x23')](function(_0x1205df){_0x36b293[_0xdf67('0x42')]=_0x1205df;return _0x36b293;})['then'](respondWithFilteredResult(_0x19bb77,_0x4103a8))[_0xdf67('0x43')](handleError(_0x19bb77,null));};exports[_0xdf67('0x44')]=function(_0xdd4000,_0x11f255){var _0x633d5b={'raw':![],'where':{'id':_0xdd4000[_0xdf67('0x45')]['id']}},_0x3c13c0={};_0x3c13c0['model']=_[_0xdf67('0x30')](db[_0xdf67('0x2c')][_0xdf67('0x46')]);_0x3c13c0[_0xdf67('0x33')]=_['keys'](_0xdd4000[_0xdf67('0x33')]);_0x3c13c0[_0xdf67('0x31')]=_[_0xdf67('0x32')](_0x3c13c0[_0xdf67('0x2f')],_0x3c13c0[_0xdf67('0x33')]);_0x633d5b[_0xdf67('0x35')]=_[_0xdf67('0x32')](_0x3c13c0[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0xdd4000[_0xdf67('0x33')][_0xdf67('0x34')]));_0x633d5b[_0xdf67('0x35')]=_0x633d5b[_0xdf67('0x35')][_0xdf67('0x36')]?_0x633d5b['attributes']:_0x3c13c0['model'];if(_0xdd4000['query']['includeAll']){_0x633d5b[_0xdf67('0x40')]=[{'all':!![]}];}_0x633d5b=_[_0xdf67('0x3e')]({},_0x633d5b,_0xdd4000[_0xdf67('0x3f')]);return db[_0xdf67('0x2c')][_0xdf67('0x47')](_0x633d5b)['then'](handleEntityNotFound(_0x11f255,null))[_0xdf67('0x23')](respondWithResult(_0x11f255,null))[_0xdf67('0x43')](handleError(_0x11f255,null));};exports['create']=function(_0x1345e4,_0x1ef9c0){return db[_0xdf67('0x2c')][_0xdf67('0x48')](_0x1345e4[_0xdf67('0x49')],{})[_0xdf67('0x23')](respondWithResult(_0x1ef9c0,0xc9))['catch'](handleError(_0x1ef9c0,null));};exports[_0xdf67('0x22')]=function(_0x2593f8,_0x138ba8){if(_0x2593f8[_0xdf67('0x49')]['id']){delete _0x2593f8[_0xdf67('0x49')]['id'];}return db[_0xdf67('0x2c')][_0xdf67('0x47')]({'where':{'id':_0x2593f8[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x138ba8,null))['then'](saveUpdates(_0x2593f8[_0xdf67('0x49')],null))[_0xdf67('0x23')](respondWithResult(_0x138ba8,null))['catch'](handleError(_0x138ba8,null));};exports[_0xdf67('0x24')]=function(_0x111b87,_0x33a204){return db[_0xdf67('0x2c')][_0xdf67('0x47')]({'where':{'id':_0x111b87[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x33a204,null))[_0xdf67('0x23')](removeEntity(_0x33a204,null))[_0xdf67('0x43')](handleError(_0x33a204,null));};exports['getFields']=function(_0x4d5e7c,_0x162640,_0x281c10){var _0x40eb31={};var _0x178c5d={};var _0x48468b;var _0x5b45e1;return db[_0xdf67('0x2c')]['findOne']({'where':{'id':_0x4d5e7c[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x162640,null))['then'](function(_0x1bb281){if(_0x1bb281){_0x48468b=_0x1bb281;_0x178c5d[_0xdf67('0x2f')]=_[_0xdf67('0x30')](db[_0xdf67('0x4a')]['rawAttributes']);_0x178c5d[_0xdf67('0x33')]=_['keys'](_0x4d5e7c[_0xdf67('0x33')]);_0x178c5d[_0xdf67('0x31')]=_[_0xdf67('0x32')](_0x178c5d['model'],_0x178c5d[_0xdf67('0x33')]);_0x40eb31[_0xdf67('0x35')]=_[_0xdf67('0x32')](_0x178c5d[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0x4d5e7c[_0xdf67('0x33')]['fields']));_0x40eb31[_0xdf67('0x35')]=_0x40eb31['attributes']['length']?_0x40eb31[_0xdf67('0x35')]:_0x178c5d['model'];_0x40eb31[_0xdf67('0x39')]=qs[_0xdf67('0x3a')](_0x4d5e7c[_0xdf67('0x33')]['sort']);_0x40eb31[_0xdf67('0x3b')]=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0x4d5e7c[_0xdf67('0x33')],_0x178c5d['filters']));if(_0x4d5e7c[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x40eb31['where']=_['merge'](_0x40eb31[_0xdf67('0x3b')],{'$or':_['map'](_0x40eb31[_0xdf67('0x35')],function(_0x1f37f1){var _0x1d0446={};_0x1d0446[_0x1f37f1]={'$like':'%'+_0x4d5e7c[_0xdf67('0x33')]['filter']+'%'};return _0x1d0446;})});}_0x40eb31=_[_0xdf67('0x3e')]({},_0x40eb31,_0x4d5e7c[_0xdf67('0x3f')]);return _0x48468b[_0xdf67('0x4b')](_0x40eb31);}})[_0xdf67('0x23')](function(_0x2435a7){if(_0x2435a7){_0x5b45e1=_0x2435a7['length'];if(!_0x4d5e7c['query'][_0xdf67('0x37')](_0xdf67('0x38'))){_0x40eb31[_0xdf67('0x1c')]=qs['limit'](_0x4d5e7c[_0xdf67('0x33')]['limit']);_0x40eb31[_0xdf67('0x1a')]=qs[_0xdf67('0x1a')](_0x4d5e7c[_0xdf67('0x33')][_0xdf67('0x1a')]);}return _0x48468b[_0xdf67('0x4b')](_0x40eb31);}})[_0xdf67('0x23')](function(_0x23fd9a){if(_0x23fd9a){return _0x23fd9a?{'count':_0x5b45e1,'rows':_0x23fd9a}:null;}})[_0xdf67('0x23')](respondWithResult(_0x162640,null))['catch'](handleError(_0x162640,null));};exports[_0xdf67('0x4c')]=function(_0x42caf1,_0x452815,_0x118f8b){var _0x2f6f17={};var _0x1f9fe1={};var _0x415119;var _0x29c5b0;return db[_0xdf67('0x2c')][_0xdf67('0x4d')]({'where':{'id':_0x42caf1['params']['id']}})['then'](handleEntityNotFound(_0x452815,null))[_0xdf67('0x23')](function(_0x7b7f2e){if(_0x7b7f2e){_0x415119=_0x7b7f2e;_0x1f9fe1[_0xdf67('0x2f')]=_[_0xdf67('0x30')](db[_0xdf67('0x4a')][_0xdf67('0x46')]);_0x1f9fe1['query']=_[_0xdf67('0x30')](_0x42caf1[_0xdf67('0x33')]);_0x1f9fe1['filters']=_[_0xdf67('0x32')](_0x1f9fe1[_0xdf67('0x2f')],_0x1f9fe1[_0xdf67('0x33')]);_0x2f6f17[_0xdf67('0x35')]=_['intersection'](_0x1f9fe1['model'],qs[_0xdf67('0x34')](_0x42caf1[_0xdf67('0x33')][_0xdf67('0x34')]));_0x2f6f17[_0xdf67('0x35')]=_0x2f6f17[_0xdf67('0x35')][_0xdf67('0x36')]?_0x2f6f17['attributes']:_0x1f9fe1[_0xdf67('0x2f')];_0x2f6f17[_0xdf67('0x39')]=qs[_0xdf67('0x3a')](_0x42caf1[_0xdf67('0x33')][_0xdf67('0x3a')]);_0x2f6f17[_0xdf67('0x3b')]=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0x42caf1[_0xdf67('0x33')],_0x1f9fe1[_0xdf67('0x31')]));if(_0x42caf1[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x2f6f17['where']=_[_0xdf67('0x3e')](_0x2f6f17[_0xdf67('0x3b')],{'$or':_[_0xdf67('0x2b')](_0x2f6f17[_0xdf67('0x35')],function(_0x5a3da5){var _0x220664={};_0x220664[_0x5a3da5]={'$like':'%'+_0x42caf1['query'][_0xdf67('0x3d')]+'%'};return _0x220664;})});}_0x2f6f17=_[_0xdf67('0x3e')]({},_0x2f6f17,_0x42caf1[_0xdf67('0x3f')]);return _0x415119[_0xdf67('0x4c')](_0x2f6f17);}})['then'](function(_0x44644e){if(_0x44644e){_0x29c5b0=_0x44644e[_0xdf67('0x36')];if(!_0x42caf1[_0xdf67('0x33')][_0xdf67('0x37')](_0xdf67('0x38'))){_0x2f6f17['limit']=qs['limit'](_0x42caf1[_0xdf67('0x33')][_0xdf67('0x1c')]);_0x2f6f17['offset']=qs[_0xdf67('0x1a')](_0x42caf1['query'][_0xdf67('0x1a')]);}return _0x415119[_0xdf67('0x4c')](_0x2f6f17);}})[_0xdf67('0x23')](function(_0x3035f9){if(_0x3035f9){return _0x3035f9?{'count':_0x29c5b0,'rows':_0x3035f9}:null;}})[_0xdf67('0x23')](respondWithResult(_0x452815,null))[_0xdf67('0x43')](handleError(_0x452815,null));};exports[_0xdf67('0x4e')]=function(_0x224ff6,_0x5dac21,_0x130660){var _0x21e691={};var _0x45a187={};var _0x3568f5;var _0x1a1c08;return db['ZohoConfiguration'][_0xdf67('0x4d')]({'where':{'id':_0x224ff6[_0xdf67('0x45')]['id']}})[_0xdf67('0x23')](handleEntityNotFound(_0x5dac21,null))['then'](function(_0x550fb3){if(_0x550fb3){_0x3568f5=_0x550fb3;_0x45a187['model']=_[_0xdf67('0x30')](db[_0xdf67('0x4a')][_0xdf67('0x46')]);_0x45a187[_0xdf67('0x33')]=_[_0xdf67('0x30')](_0x224ff6[_0xdf67('0x33')]);_0x45a187[_0xdf67('0x31')]=_['intersection'](_0x45a187[_0xdf67('0x2f')],_0x45a187['query']);_0x21e691['attributes']=_[_0xdf67('0x32')](_0x45a187[_0xdf67('0x2f')],qs[_0xdf67('0x34')](_0x224ff6['query']['fields']));_0x21e691[_0xdf67('0x35')]=_0x21e691['attributes']['length']?_0x21e691['attributes']:_0x45a187[_0xdf67('0x2f')];_0x21e691['order']=qs[_0xdf67('0x3a')](_0x224ff6[_0xdf67('0x33')][_0xdf67('0x3a')]);_0x21e691['where']=qs[_0xdf67('0x31')](_[_0xdf67('0x3c')](_0x224ff6['query'],_0x45a187[_0xdf67('0x31')]));if(_0x224ff6[_0xdf67('0x33')][_0xdf67('0x3d')]){_0x21e691['where']=_['merge'](_0x21e691[_0xdf67('0x3b')],{'$or':_['map'](_0x21e691['attributes'],function(_0x145d0e){var _0x5ed732={};_0x5ed732[_0x145d0e]={'$like':'%'+_0x224ff6[_0xdf67('0x33')]['filter']+'%'};return _0x5ed732;})});}_0x21e691=_['merge']({},_0x21e691,_0x224ff6['options']);return _0x3568f5[_0xdf67('0x4e')](_0x21e691);}})[_0xdf67('0x23')](function(_0xa3c2c3){if(_0xa3c2c3){_0x1a1c08=_0xa3c2c3[_0xdf67('0x36')];if(!_0x224ff6[_0xdf67('0x33')][_0xdf67('0x37')](_0xdf67('0x38'))){_0x21e691[_0xdf67('0x1c')]=qs['limit'](_0x224ff6[_0xdf67('0x33')][_0xdf67('0x1c')]);_0x21e691[_0xdf67('0x1a')]=qs[_0xdf67('0x1a')](_0x224ff6[_0xdf67('0x33')]['offset']);}return _0x3568f5[_0xdf67('0x4e')](_0x21e691);}})[_0xdf67('0x23')](function(_0x20714e){if(_0x20714e){return _0x20714e?{'count':_0x1a1c08,'rows':_0x20714e}:null;}})[_0xdf67('0x23')](respondWithResult(_0x5dac21,null))[_0xdf67('0x43')](handleError(_0x5dac21,null));}; \ No newline at end of file +var _0x0d73=['keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','find','create','body','update','catch','order','pick','map','getFields','getSubjects','findOne','getDescriptions','ZohoField','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','send','index','ZohoConfiguration','rawAttributes','type','key','model','query'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0d73,0x74));var _0x30d7=function(_0x5e2750,_0x2596a4){_0x5e2750=_0x5e2750-0x0;var _0x4cf8b9=_0x0d73[_0x5e2750];return _0x4cf8b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30d7('0x0'));var zipdir=require(_0x30d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30d7('0x2'));var moment=require(_0x30d7('0x3'));var BPromise=require(_0x30d7('0x4'));var Mustache=require('mustache');var util=require(_0x30d7('0x5'));var path=require(_0x30d7('0x6'));var sox=require(_0x30d7('0x7'));var csv=require(_0x30d7('0x8'));var ejs=require(_0x30d7('0x9'));var fs=require('fs');var fs_extra=require(_0x30d7('0xa'));var _=require(_0x30d7('0xb'));var squel=require(_0x30d7('0xc'));var crypto=require(_0x30d7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x30d7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x30d7('0xf'));var Papa=require(_0x30d7('0x10'));var Redis=require(_0x30d7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x30d7('0x12'));var as=require(_0x30d7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30d7('0x14'))(_0x30d7('0x15'));var utils=require('../../config/utils');var config=require(_0x30d7('0x16'));var licenseUtil=require(_0x30d7('0x17'));var db=require(_0x30d7('0x18'))['db'];function respondWithStatusCode(_0x2ba6ca,_0xedd32f){_0xedd32f=_0xedd32f||0xcc;return function(_0x215a57){if(_0x215a57){return _0x2ba6ca['sendStatus'](_0xedd32f);}return _0x2ba6ca[_0x30d7('0x19')](_0xedd32f)['end']();};}function respondWithResult(_0x597138,_0x4af145){_0x4af145=_0x4af145||0xc8;return function(_0x1f5805){if(_0x1f5805){return _0x597138[_0x30d7('0x19')](_0x4af145)[_0x30d7('0x1a')](_0x1f5805);}};}function respondWithFilteredResult(_0x3c5193,_0x70b33f){return function(_0x555352){if(_0x555352){var _0x1a00b9=typeof _0x70b33f[_0x30d7('0x1b')]===_0x30d7('0x1c')&&typeof _0x70b33f[_0x30d7('0x1d')]===_0x30d7('0x1c');var _0x5c7a74=_0x555352[_0x30d7('0x1e')];var _0x4a4c3a=_0x1a00b9?0x0:_0x70b33f[_0x30d7('0x1b')];var _0xe78637=_0x1a00b9?_0x555352[_0x30d7('0x1e')]:_0x70b33f[_0x30d7('0x1b')]+_0x70b33f['limit'];var _0x3f404d;if(_0xe78637>=_0x5c7a74){_0xe78637=_0x5c7a74;_0x3f404d=0xc8;}else{_0x3f404d=0xce;}_0x3c5193[_0x30d7('0x19')](_0x3f404d);return _0x3c5193[_0x30d7('0x1f')]('Content-Range',_0x4a4c3a+'-'+_0xe78637+'/'+_0x5c7a74)[_0x30d7('0x1a')](_0x555352);}return null;};}function patchUpdates(_0x4b4573){return function(_0x39b59d){try{jsonpatch[_0x30d7('0x20')](_0x39b59d,_0x4b4573,!![]);}catch(_0x358c79){return BPromise[_0x30d7('0x21')](_0x358c79);}return _0x39b59d[_0x30d7('0x22')]();};}function saveUpdates(_0xb1e17f,_0x4752f6){return function(_0x3a4e30){if(_0x3a4e30){return _0x3a4e30['update'](_0xb1e17f)['then'](function(_0x5b2b73){return _0x5b2b73;});}return null;};}function removeEntity(_0x40b264,_0x541fb7){return function(_0x336a51){if(_0x336a51){return _0x336a51[_0x30d7('0x23')]()[_0x30d7('0x24')](function(){_0x40b264[_0x30d7('0x19')](0xcc)[_0x30d7('0x25')]();});}};}function handleEntityNotFound(_0x5a4e3c,_0x1bee27){return function(_0x3ef860){if(!_0x3ef860){_0x5a4e3c[_0x30d7('0x26')](0x194);}return _0x3ef860;};}function handleError(_0x57f114,_0x29f2e9){_0x29f2e9=_0x29f2e9||0x1f4;return function(_0x4f5095){logger[_0x30d7('0x27')](_0x4f5095[_0x30d7('0x28')]);if(_0x4f5095[_0x30d7('0x29')]){delete _0x4f5095[_0x30d7('0x29')];}_0x57f114['status'](_0x29f2e9)[_0x30d7('0x2a')](_0x4f5095);};}exports[_0x30d7('0x2b')]=function(_0x29fed6,_0x3a1158){var _0xb1f3de={},_0xba0e3d={},_0xee711e={'count':0x0,'rows':[]};var _0x19698b=_['map'](db[_0x30d7('0x2c')][_0x30d7('0x2d')],function(_0x2d42f5){return{'name':_0x2d42f5['fieldName'],'type':_0x2d42f5[_0x30d7('0x2e')][_0x30d7('0x2f')]};});_0xba0e3d[_0x30d7('0x30')]=_['map'](_0x19698b,_0x30d7('0x29'));_0xba0e3d[_0x30d7('0x31')]=_[_0x30d7('0x32')](_0x29fed6[_0x30d7('0x31')]);_0xba0e3d['filters']=_[_0x30d7('0x33')](_0xba0e3d[_0x30d7('0x30')],_0xba0e3d[_0x30d7('0x31')]);_0xb1f3de['attributes']=_['intersection'](_0xba0e3d[_0x30d7('0x30')],qs['fields'](_0x29fed6['query'][_0x30d7('0x34')]));_0xb1f3de[_0x30d7('0x35')]=_0xb1f3de[_0x30d7('0x35')][_0x30d7('0x36')]?_0xb1f3de[_0x30d7('0x35')]:_0xba0e3d[_0x30d7('0x30')];if(!_0x29fed6[_0x30d7('0x31')][_0x30d7('0x37')](_0x30d7('0x38'))){_0xb1f3de['limit']=qs[_0x30d7('0x1d')](_0x29fed6['query'][_0x30d7('0x1d')]);_0xb1f3de[_0x30d7('0x1b')]=qs[_0x30d7('0x1b')](_0x29fed6['query'][_0x30d7('0x1b')]);}_0xb1f3de['order']=qs[_0x30d7('0x39')](_0x29fed6[_0x30d7('0x31')][_0x30d7('0x39')]);_0xb1f3de[_0x30d7('0x3a')]=qs['filters'](_['pick'](_0x29fed6[_0x30d7('0x31')],_0xba0e3d['filters']),_0x19698b);if(_0x29fed6[_0x30d7('0x31')][_0x30d7('0x3b')]){_0xb1f3de['where']=_[_0x30d7('0x3c')](_0xb1f3de[_0x30d7('0x3a')],{'$or':_['map'](_0x19698b,function(_0xf66685){if(_0xf66685[_0x30d7('0x2e')]!==_0x30d7('0x3d')){var _0x68badb={};_0x68badb[_0xf66685[_0x30d7('0x29')]]={'$like':'%'+_0x29fed6[_0x30d7('0x31')][_0x30d7('0x3b')]+'%'};return _0x68badb;}})});}_0xb1f3de=_[_0x30d7('0x3c')]({},_0xb1f3de,_0x29fed6[_0x30d7('0x3e')]);var _0x940b3c={'where':_0xb1f3de[_0x30d7('0x3a')]};return db[_0x30d7('0x2c')][_0x30d7('0x1e')](_0x940b3c)[_0x30d7('0x24')](function(_0xdcc082){_0xee711e[_0x30d7('0x1e')]=_0xdcc082;if(_0x29fed6[_0x30d7('0x31')][_0x30d7('0x3f')]){_0xb1f3de[_0x30d7('0x40')]=[{'all':!![]}];}return db[_0x30d7('0x2c')][_0x30d7('0x41')](_0xb1f3de);})[_0x30d7('0x24')](function(_0x3026bb){_0xee711e[_0x30d7('0x42')]=_0x3026bb;return _0xee711e;})[_0x30d7('0x24')](respondWithFilteredResult(_0x3a1158,_0xb1f3de))['catch'](handleError(_0x3a1158,null));};exports[_0x30d7('0x43')]=function(_0x1a3d6e,_0x5add32){var _0x3bd064={'raw':![],'where':{'id':_0x1a3d6e[_0x30d7('0x44')]['id']}},_0x208788={};_0x208788['model']=_[_0x30d7('0x32')](db[_0x30d7('0x2c')][_0x30d7('0x2d')]);_0x208788[_0x30d7('0x31')]=_[_0x30d7('0x32')](_0x1a3d6e['query']);_0x208788[_0x30d7('0x45')]=_['intersection'](_0x208788[_0x30d7('0x30')],_0x208788[_0x30d7('0x31')]);_0x3bd064[_0x30d7('0x35')]=_[_0x30d7('0x33')](_0x208788['model'],qs['fields'](_0x1a3d6e[_0x30d7('0x31')]['fields']));_0x3bd064[_0x30d7('0x35')]=_0x3bd064['attributes'][_0x30d7('0x36')]?_0x3bd064[_0x30d7('0x35')]:_0x208788['model'];if(_0x1a3d6e[_0x30d7('0x31')][_0x30d7('0x3f')]){_0x3bd064[_0x30d7('0x40')]=[{'all':!![]}];}_0x3bd064=_[_0x30d7('0x3c')]({},_0x3bd064,_0x1a3d6e['options']);return db[_0x30d7('0x2c')][_0x30d7('0x46')](_0x3bd064)[_0x30d7('0x24')](handleEntityNotFound(_0x5add32,null))[_0x30d7('0x24')](respondWithResult(_0x5add32,null))['catch'](handleError(_0x5add32,null));};exports[_0x30d7('0x47')]=function(_0x50f100,_0x1d1928){return db[_0x30d7('0x2c')][_0x30d7('0x47')](_0x50f100[_0x30d7('0x48')],{})[_0x30d7('0x24')](respondWithResult(_0x1d1928,0xc9))['catch'](handleError(_0x1d1928,null));};exports[_0x30d7('0x49')]=function(_0x1a9701,_0x2d0d72){if(_0x1a9701[_0x30d7('0x48')]['id']){delete _0x1a9701[_0x30d7('0x48')]['id'];}return db[_0x30d7('0x2c')][_0x30d7('0x46')]({'where':{'id':_0x1a9701['params']['id']}})['then'](handleEntityNotFound(_0x2d0d72,null))[_0x30d7('0x24')](saveUpdates(_0x1a9701[_0x30d7('0x48')],null))[_0x30d7('0x24')](respondWithResult(_0x2d0d72,null))['catch'](handleError(_0x2d0d72,null));};exports['destroy']=function(_0x507727,_0x182d16){return db[_0x30d7('0x2c')][_0x30d7('0x46')]({'where':{'id':_0x507727[_0x30d7('0x44')]['id']}})[_0x30d7('0x24')](handleEntityNotFound(_0x182d16,null))[_0x30d7('0x24')](removeEntity(_0x182d16,null))[_0x30d7('0x4a')](handleError(_0x182d16,null));};exports['getFields']=function(_0x2c511f,_0x51f030,_0x3a99c3){var _0x11e5a6={};var _0x27477f={};var _0x3d13d8;var _0x30125c;return db[_0x30d7('0x2c')]['findOne']({'where':{'id':_0x2c511f[_0x30d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x51f030,null))[_0x30d7('0x24')](function(_0xf5ceaa){if(_0xf5ceaa){_0x3d13d8=_0xf5ceaa;_0x27477f['model']=_[_0x30d7('0x32')](db['ZohoField'][_0x30d7('0x2d')]);_0x27477f[_0x30d7('0x31')]=_[_0x30d7('0x32')](_0x2c511f['query']);_0x27477f['filters']=_['intersection'](_0x27477f[_0x30d7('0x30')],_0x27477f[_0x30d7('0x31')]);_0x11e5a6['attributes']=_[_0x30d7('0x33')](_0x27477f[_0x30d7('0x30')],qs[_0x30d7('0x34')](_0x2c511f['query'][_0x30d7('0x34')]));_0x11e5a6[_0x30d7('0x35')]=_0x11e5a6['attributes'][_0x30d7('0x36')]?_0x11e5a6[_0x30d7('0x35')]:_0x27477f['model'];_0x11e5a6[_0x30d7('0x4b')]=qs[_0x30d7('0x39')](_0x2c511f[_0x30d7('0x31')][_0x30d7('0x39')]);_0x11e5a6[_0x30d7('0x3a')]=qs['filters'](_[_0x30d7('0x4c')](_0x2c511f[_0x30d7('0x31')],_0x27477f[_0x30d7('0x45')]));if(_0x2c511f[_0x30d7('0x31')][_0x30d7('0x3b')]){_0x11e5a6[_0x30d7('0x3a')]=_[_0x30d7('0x3c')](_0x11e5a6[_0x30d7('0x3a')],{'$or':_[_0x30d7('0x4d')](_0x11e5a6['attributes'],function(_0x1188ba){var _0x45d3cd={};_0x45d3cd[_0x1188ba]={'$like':'%'+_0x2c511f[_0x30d7('0x31')]['filter']+'%'};return _0x45d3cd;})});}_0x11e5a6=_[_0x30d7('0x3c')]({},_0x11e5a6,_0x2c511f[_0x30d7('0x3e')]);return _0x3d13d8[_0x30d7('0x4e')](_0x11e5a6);}})[_0x30d7('0x24')](function(_0x4c5edb){if(_0x4c5edb){_0x30125c=_0x4c5edb[_0x30d7('0x36')];if(!_0x2c511f[_0x30d7('0x31')][_0x30d7('0x37')]('nolimit')){_0x11e5a6[_0x30d7('0x1d')]=qs[_0x30d7('0x1d')](_0x2c511f[_0x30d7('0x31')]['limit']);_0x11e5a6[_0x30d7('0x1b')]=qs[_0x30d7('0x1b')](_0x2c511f['query'][_0x30d7('0x1b')]);}return _0x3d13d8[_0x30d7('0x4e')](_0x11e5a6);}})[_0x30d7('0x24')](function(_0x1125fa){if(_0x1125fa){return _0x1125fa?{'count':_0x30125c,'rows':_0x1125fa}:null;}})['then'](respondWithResult(_0x51f030,null))[_0x30d7('0x4a')](handleError(_0x51f030,null));};exports[_0x30d7('0x4f')]=function(_0x4e98d9,_0x193246,_0x2a42ff){var _0x2391eb={};var _0x469251={};var _0x35188e;var _0x59acd9;return db[_0x30d7('0x2c')][_0x30d7('0x50')]({'where':{'id':_0x4e98d9[_0x30d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x193246,null))['then'](function(_0x24f5fd){if(_0x24f5fd){_0x35188e=_0x24f5fd;_0x469251[_0x30d7('0x30')]=_[_0x30d7('0x32')](db['ZohoField']['rawAttributes']);_0x469251[_0x30d7('0x31')]=_[_0x30d7('0x32')](_0x4e98d9['query']);_0x469251[_0x30d7('0x45')]=_[_0x30d7('0x33')](_0x469251[_0x30d7('0x30')],_0x469251[_0x30d7('0x31')]);_0x2391eb['attributes']=_[_0x30d7('0x33')](_0x469251[_0x30d7('0x30')],qs[_0x30d7('0x34')](_0x4e98d9[_0x30d7('0x31')][_0x30d7('0x34')]));_0x2391eb['attributes']=_0x2391eb[_0x30d7('0x35')][_0x30d7('0x36')]?_0x2391eb[_0x30d7('0x35')]:_0x469251['model'];_0x2391eb[_0x30d7('0x4b')]=qs[_0x30d7('0x39')](_0x4e98d9[_0x30d7('0x31')][_0x30d7('0x39')]);_0x2391eb[_0x30d7('0x3a')]=qs[_0x30d7('0x45')](_[_0x30d7('0x4c')](_0x4e98d9[_0x30d7('0x31')],_0x469251[_0x30d7('0x45')]));if(_0x4e98d9[_0x30d7('0x31')][_0x30d7('0x3b')]){_0x2391eb[_0x30d7('0x3a')]=_['merge'](_0x2391eb[_0x30d7('0x3a')],{'$or':_['map'](_0x2391eb[_0x30d7('0x35')],function(_0x2ba7ec){var _0x21f863={};_0x21f863[_0x2ba7ec]={'$like':'%'+_0x4e98d9['query']['filter']+'%'};return _0x21f863;})});}_0x2391eb=_['merge']({},_0x2391eb,_0x4e98d9['options']);return _0x35188e[_0x30d7('0x4f')](_0x2391eb);}})[_0x30d7('0x24')](function(_0x1bc93b){if(_0x1bc93b){_0x59acd9=_0x1bc93b[_0x30d7('0x36')];if(!_0x4e98d9[_0x30d7('0x31')][_0x30d7('0x37')](_0x30d7('0x38'))){_0x2391eb[_0x30d7('0x1d')]=qs[_0x30d7('0x1d')](_0x4e98d9[_0x30d7('0x31')][_0x30d7('0x1d')]);_0x2391eb[_0x30d7('0x1b')]=qs[_0x30d7('0x1b')](_0x4e98d9[_0x30d7('0x31')][_0x30d7('0x1b')]);}return _0x35188e[_0x30d7('0x4f')](_0x2391eb);}})[_0x30d7('0x24')](function(_0x2f7c0f){if(_0x2f7c0f){return _0x2f7c0f?{'count':_0x59acd9,'rows':_0x2f7c0f}:null;}})[_0x30d7('0x24')](respondWithResult(_0x193246,null))[_0x30d7('0x4a')](handleError(_0x193246,null));};exports[_0x30d7('0x51')]=function(_0x289a3e,_0x55ee1a,_0x4ea435){var _0xc4d8c={};var _0xc36ede={};var _0x11768c;var _0x4219bf;return db[_0x30d7('0x2c')][_0x30d7('0x50')]({'where':{'id':_0x289a3e[_0x30d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x55ee1a,null))['then'](function(_0x292fb6){if(_0x292fb6){_0x11768c=_0x292fb6;_0xc36ede[_0x30d7('0x30')]=_[_0x30d7('0x32')](db[_0x30d7('0x52')]['rawAttributes']);_0xc36ede[_0x30d7('0x31')]=_[_0x30d7('0x32')](_0x289a3e[_0x30d7('0x31')]);_0xc36ede[_0x30d7('0x45')]=_['intersection'](_0xc36ede['model'],_0xc36ede[_0x30d7('0x31')]);_0xc4d8c[_0x30d7('0x35')]=_[_0x30d7('0x33')](_0xc36ede[_0x30d7('0x30')],qs['fields'](_0x289a3e[_0x30d7('0x31')][_0x30d7('0x34')]));_0xc4d8c['attributes']=_0xc4d8c['attributes'][_0x30d7('0x36')]?_0xc4d8c[_0x30d7('0x35')]:_0xc36ede[_0x30d7('0x30')];_0xc4d8c['order']=qs['sort'](_0x289a3e[_0x30d7('0x31')][_0x30d7('0x39')]);_0xc4d8c['where']=qs[_0x30d7('0x45')](_[_0x30d7('0x4c')](_0x289a3e['query'],_0xc36ede['filters']));if(_0x289a3e[_0x30d7('0x31')][_0x30d7('0x3b')]){_0xc4d8c[_0x30d7('0x3a')]=_[_0x30d7('0x3c')](_0xc4d8c[_0x30d7('0x3a')],{'$or':_[_0x30d7('0x4d')](_0xc4d8c[_0x30d7('0x35')],function(_0x2f9d12){var _0x4ee3c5={};_0x4ee3c5[_0x2f9d12]={'$like':'%'+_0x289a3e[_0x30d7('0x31')][_0x30d7('0x3b')]+'%'};return _0x4ee3c5;})});}_0xc4d8c=_[_0x30d7('0x3c')]({},_0xc4d8c,_0x289a3e[_0x30d7('0x3e')]);return _0x11768c[_0x30d7('0x51')](_0xc4d8c);}})['then'](function(_0x359cea){if(_0x359cea){_0x4219bf=_0x359cea[_0x30d7('0x36')];if(!_0x289a3e['query'][_0x30d7('0x37')]('nolimit')){_0xc4d8c['limit']=qs['limit'](_0x289a3e['query'][_0x30d7('0x1d')]);_0xc4d8c[_0x30d7('0x1b')]=qs['offset'](_0x289a3e[_0x30d7('0x31')][_0x30d7('0x1b')]);}return _0x11768c[_0x30d7('0x51')](_0xc4d8c);}})[_0x30d7('0x24')](function(_0x226373){if(_0x226373){return _0x226373?{'count':_0x4219bf,'rows':_0x226373}:null;}})[_0x30d7('0x24')](respondWithResult(_0x55ee1a,null))[_0x30d7('0x4a')](handleError(_0x55ee1a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 49cb67d..4be8ff2 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 _0x7030=['./intZohoConfiguration.attributes','ZohoConfiguration','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7030,0xc8));var _0x0703=function(_0x59e834,_0x471eea){_0x59e834=_0x59e834-0x0;var _0x4e87d1=_0x7030[_0x59e834];return _0x4e87d1;};'use strict';var _=require('lodash');var util=require(_0x0703('0x0'));var logger=require(_0x0703('0x1'))(_0x0703('0x2'));var moment=require('moment');var BPromise=require(_0x0703('0x3'));var rp=require(_0x0703('0x4'));var fs=require('fs');var path=require(_0x0703('0x5'));var rimraf=require(_0x0703('0x6'));var config=require('../../config/environment');var attributes=require(_0x0703('0x7'));module['exports']=function(_0x1a0bca,_0x4fe820){return _0x1a0bca['define'](_0x0703('0x8'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x948e=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4f81c9,_0x141654){var _0x5e86ae=function(_0x348b70){while(--_0x348b70){_0x4f81c9['push'](_0x4f81c9['shift']());}};_0x5e86ae(++_0x141654);}(_0x948e,0x1f0));var _0xe948=function(_0x4345e2,_0x1df6dc){_0x4345e2=_0x4345e2-0x0;var _0x2a8718=_0x948e[_0x4345e2];return _0x2a8718;};'use strict';var _=require('lodash');var util=require(_0xe948('0x0'));var logger=require(_0xe948('0x1'))(_0xe948('0x2'));var moment=require(_0xe948('0x3'));var BPromise=require(_0xe948('0x4'));var rp=require(_0xe948('0x5'));var fs=require('fs');var path=require(_0xe948('0x6'));var rimraf=require(_0xe948('0x7'));var config=require(_0xe948('0x8'));var attributes=require(_0xe948('0x9'));module[_0xe948('0xa')]=function(_0xc001c4,_0x205594){return _0xc001c4[_0xe948('0xb')](_0xe948('0xc'),attributes,{'tableName':_0xe948('0xd'),'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 3402448..d2ca695 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 _0x1bc5=['code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x11c30d,_0x566175){var _0x43c1b3=function(_0x29941d){while(--_0x29941d){_0x11c30d['push'](_0x11c30d['shift']());}};_0x43c1b3(++_0x566175);}(_0x1bc5,0xa2));var _0x51bc=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1bc5[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x51bc('0x0'));var util=require('util');var moment=require(_0x51bc('0x1'));var BPromise=require(_0x51bc('0x2'));var rs=require(_0x51bc('0x3'));var fs=require('fs');var Redis=require(_0x51bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x51bc('0x5'))(_0x51bc('0x6'));var config=require(_0x51bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x51bc('0x8')][_0x51bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2892c6,_0x34e550,_0x4c66b5){return new BPromise(function(_0x175e47,_0x252177){return client[_0x51bc('0xa')](_0x2892c6,_0x4c66b5)[_0x51bc('0xb')](function(_0x36d271){logger[_0x51bc('0xc')](_0x51bc('0xd'),_0x34e550,'request\x20sent');logger['debug'](_0x51bc('0xe'),_0x34e550,_0x51bc('0xf'),JSON[_0x51bc('0x10')](_0x36d271));if(_0x36d271[_0x51bc('0x11')]){if(_0x36d271[_0x51bc('0x11')][_0x51bc('0x12')]===0x1f4){logger[_0x51bc('0x11')](_0x51bc('0xd'),_0x34e550,_0x36d271['error'][_0x51bc('0x13')]);return _0x252177(_0x36d271['error'][_0x51bc('0x13')]);}logger[_0x51bc('0x11')](_0x51bc('0xd'),_0x34e550,_0x36d271[_0x51bc('0x11')][_0x51bc('0x13')]);return _0x175e47(_0x36d271[_0x51bc('0x11')][_0x51bc('0x13')]);}else{logger[_0x51bc('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x34e550,'request\x20sent');_0x175e47(_0x36d271['result'][_0x51bc('0x13')]);}})['catch'](function(_0x21181e){logger[_0x51bc('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x34e550,_0x21181e);_0x252177(_0x21181e);});});} \ No newline at end of file +var _0xa479=['code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3da4b9,_0xe815f6){var _0x26d7d7=function(_0x177cdf){while(--_0x177cdf){_0x3da4b9['push'](_0x3da4b9['shift']());}};_0x26d7d7(++_0xe815f6);}(_0xa479,0x184));var _0x9a47=function(_0x4b13f8,_0x3ed4e1){_0x4b13f8=_0x4b13f8-0x0;var _0x2136d2=_0xa479[_0x4b13f8];return _0x2136d2;};'use strict';var _=require(_0x9a47('0x0'));var util=require(_0x9a47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a47('0x2'));var fs=require('fs');var Redis=require(_0x9a47('0x3'));var db=require(_0x9a47('0x4'))['db'];var utils=require(_0x9a47('0x5'));var logger=require(_0x9a47('0x6'))(_0x9a47('0x7'));var config=require(_0x9a47('0x8'));var jayson=require(_0x9a47('0x9'));var client=jayson['client'][_0x9a47('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fc7d7,_0x346f7f,_0x517d31){return new BPromise(function(_0x5b923f,_0x263c90){return client[_0x9a47('0xb')](_0x4fc7d7,_0x517d31)[_0x9a47('0xc')](function(_0x411f92){logger[_0x9a47('0xd')](_0x9a47('0xe'),_0x346f7f,_0x9a47('0xf'));logger[_0x9a47('0x10')](_0x9a47('0x11'),_0x346f7f,_0x9a47('0xf'),JSON[_0x9a47('0x12')](_0x411f92));if(_0x411f92[_0x9a47('0x13')]){if(_0x411f92[_0x9a47('0x13')][_0x9a47('0x14')]===0x1f4){logger[_0x9a47('0x13')](_0x9a47('0xe'),_0x346f7f,_0x411f92[_0x9a47('0x13')][_0x9a47('0x15')]);return _0x263c90(_0x411f92[_0x9a47('0x13')]['message']);}logger[_0x9a47('0x13')](_0x9a47('0xe'),_0x346f7f,_0x411f92[_0x9a47('0x13')][_0x9a47('0x15')]);return _0x5b923f(_0x411f92['error']['message']);}else{logger['info'](_0x9a47('0xe'),_0x346f7f,_0x9a47('0xf'));_0x5b923f(_0x411f92[_0x9a47('0x16')][_0x9a47('0x15')]);}})[_0x9a47('0x17')](function(_0x9e03a1){logger[_0x9a47('0x13')](_0x9a47('0xe'),_0x346f7f,_0x9e03a1);_0x263c90(_0x9e03a1);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0a135e0..74d71c2 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 _0x1e72=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x315ba9,_0x365e0d){var _0x5d4545=function(_0x271985){while(--_0x271985){_0x315ba9['push'](_0x315ba9['shift']());}};_0x5d4545(++_0x365e0d);}(_0x1e72,0x163));var _0x21e7=function(_0x2024a8,_0x4713e3){_0x2024a8=_0x2024a8-0x0;var _0x45e43a=_0x1e72[_0x2024a8];return _0x45e43a;};'use strict';var multer=require(_0x21e7('0x0'));var util=require(_0x21e7('0x1'));var path=require(_0x21e7('0x2'));var timeout=require(_0x21e7('0x3'));var express=require('express');var router=express[_0x21e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x21e7('0x5'));var interaction=require(_0x21e7('0x6'));var config=require('../../config/environment');var controller=require(_0x21e7('0x7'));router[_0x21e7('0x8')]('/',auth[_0x21e7('0x9')](),controller[_0x21e7('0xa')]);router[_0x21e7('0x8')](_0x21e7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x21e7('0xc')]('/',auth[_0x21e7('0x9')](),controller[_0x21e7('0xd')]);router[_0x21e7('0xe')](_0x21e7('0xb'),auth[_0x21e7('0x9')](),controller['update']);router[_0x21e7('0xf')]('/:id',auth[_0x21e7('0x9')](),controller[_0x21e7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1772=['fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x731a26,_0x456ed7){var _0x5245fc=function(_0x2c179f){while(--_0x2c179f){_0x731a26['push'](_0x731a26['shift']());}};_0x5245fc(++_0x456ed7);}(_0x1772,0x12d));var _0x2177=function(_0x3d587f,_0x1b9be9){_0x3d587f=_0x3d587f-0x0;var _0x2ecac2=_0x1772[_0x3d587f];return _0x2ecac2;};'use strict';var multer=require(_0x2177('0x0'));var util=require(_0x2177('0x1'));var path=require(_0x2177('0x2'));var timeout=require('connect-timeout');var express=require(_0x2177('0x3'));var router=express[_0x2177('0x4')]();var fs_extra=require(_0x2177('0x5'));var auth=require(_0x2177('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2177('0x7'));var controller=require(_0x2177('0x8'));router[_0x2177('0x9')]('/',auth[_0x2177('0xa')](),controller['index']);router[_0x2177('0x9')]('/:id',auth[_0x2177('0xa')](),controller['show']);router[_0x2177('0xb')]('/',auth[_0x2177('0xa')](),controller[_0x2177('0xc')]);router['put'](_0x2177('0xd'),auth[_0x2177('0xa')](),controller[_0x2177('0xe')]);router[_0x2177('0xf')](_0x2177('0xd'),auth[_0x2177('0xa')](),controller[_0x2177('0x10')]);module[_0x2177('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f95191d..a9389e3 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 _0x8c18=['keyValue','picklist','string','STRING','variable','BOOLEAN','exports','ENUM','customVariable'];(function(_0x261e7e,_0x1d9fa9){var _0x402e95=function(_0x2b0dae){while(--_0x2b0dae){_0x261e7e['push'](_0x261e7e['shift']());}};_0x402e95(++_0x1d9fa9);}(_0x8c18,0x19b));var _0x88c1=function(_0xa7f143,_0x58cd69){_0xa7f143=_0xa7f143-0x0;var _0x18e29c=_0x8c18[_0xa7f143];return _0x18e29c;};'use strict';var Sequelize=require('sequelize');module[_0x88c1('0x0')]={'type':{'type':Sequelize[_0x88c1('0x1')]('string','variable',_0x88c1('0x2'),_0x88c1('0x3'),_0x88c1('0x4')),'defaultValue':_0x88c1('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x88c1('0x6')]},'keyType':{'type':Sequelize[_0x88c1('0x1')](_0x88c1('0x5'),_0x88c1('0x7'),_0x88c1('0x2'))},'keyContent':{'type':Sequelize[_0x88c1('0x6')]},'idField':{'type':Sequelize[_0x88c1('0x6')]},'nameField':{'type':Sequelize[_0x88c1('0x6')]},'customField':{'type':Sequelize[_0x88c1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88c1('0x6')]}}; \ No newline at end of file +var _0x2ae0=['ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x44a3e1,_0x4084b4){var _0x493faa=function(_0x406529){while(--_0x406529){_0x44a3e1['push'](_0x44a3e1['shift']());}};_0x493faa(++_0x4084b4);}(_0x2ae0,0x18a));var _0x02ae=function(_0x1d69ba,_0x4090c9){_0x1d69ba=_0x1d69ba-0x0;var _0x8bab8c=_0x2ae0[_0x1d69ba];return _0x8bab8c;};'use strict';var Sequelize=require(_0x02ae('0x0'));module[_0x02ae('0x1')]={'type':{'type':Sequelize[_0x02ae('0x2')](_0x02ae('0x3'),'variable',_0x02ae('0x4'),_0x02ae('0x5'),_0x02ae('0x6')),'defaultValue':_0x02ae('0x3')},'content':{'type':Sequelize[_0x02ae('0x7')]},'key':{'type':Sequelize[_0x02ae('0x7')]},'keyType':{'type':Sequelize[_0x02ae('0x2')](_0x02ae('0x3'),'variable',_0x02ae('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x02ae('0x7')]},'nameField':{'type':Sequelize[_0x02ae('0x7')]},'customField':{'type':Sequelize[_0x02ae('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02ae('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index fe77060..018af50 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 _0xca0f=['ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x5b7534,_0x1e9bb7){var _0x18730d=function(_0x51eff9){while(--_0x51eff9){_0x5b7534['push'](_0x5b7534['shift']());}};_0x18730d(++_0x1e9bb7);}(_0xca0f,0x1b0));var _0xfca0=function(_0x29c234,_0x572d10){_0x29c234=_0x29c234-0x0;var _0x4dc7b9=_0xca0f[_0x29c234];return _0x4dc7b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfca0('0x0'));var zipdir=require(_0xfca0('0x1'));var jsonpatch=require(_0xfca0('0x2'));var rp=require(_0xfca0('0x3'));var moment=require(_0xfca0('0x4'));var BPromise=require(_0xfca0('0x5'));var Mustache=require('mustache');var util=require(_0xfca0('0x6'));var path=require('path');var sox=require(_0xfca0('0x7'));var csv=require(_0xfca0('0x8'));var ejs=require(_0xfca0('0x9'));var fs=require('fs');var fs_extra=require(_0xfca0('0xa'));var _=require('lodash');var squel=require(_0xfca0('0xb'));var crypto=require(_0xfca0('0xc'));var jsforce=require(_0xfca0('0xd'));var deskjs=require(_0xfca0('0xe'));var toCsv=require(_0xfca0('0x8'));var querystring=require(_0xfca0('0xf'));var Papa=require(_0xfca0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfca0('0x11'));var as=require(_0xfca0('0x12'));var hardwareService=require(_0xfca0('0x13'));var logger=require(_0xfca0('0x14'))(_0xfca0('0x15'));var utils=require(_0xfca0('0x16'));var config=require(_0xfca0('0x17'));var licenseUtil=require(_0xfca0('0x18'));var db=require(_0xfca0('0x19'))['db'];function respondWithStatusCode(_0x27fc56,_0x317772){_0x317772=_0x317772||0xcc;return function(_0x26277c){if(_0x26277c){return _0x27fc56[_0xfca0('0x1a')](_0x317772);}return _0x27fc56['status'](_0x317772)[_0xfca0('0x1b')]();};}function respondWithResult(_0x647fa3,_0xaddb0){_0xaddb0=_0xaddb0||0xc8;return function(_0x3f5d38){if(_0x3f5d38){return _0x647fa3[_0xfca0('0x1c')](_0xaddb0)['json'](_0x3f5d38);}};}function respondWithFilteredResult(_0x1a3ff7,_0x3dd22d){return function(_0x52b194){if(_0x52b194){var _0x23f787=typeof _0x3dd22d['offset']===_0xfca0('0x1d')&&typeof _0x3dd22d['limit']==='undefined';var _0x96417a=_0x52b194['count'];var _0xef080e=_0x23f787?0x0:_0x3dd22d['offset'];var _0x42358a=_0x23f787?_0x52b194[_0xfca0('0x1e')]:_0x3dd22d[_0xfca0('0x1f')]+_0x3dd22d[_0xfca0('0x20')];var _0x5ec314;if(_0x42358a>=_0x96417a){_0x42358a=_0x96417a;_0x5ec314=0xc8;}else{_0x5ec314=0xce;}_0x1a3ff7[_0xfca0('0x1c')](_0x5ec314);return _0x1a3ff7[_0xfca0('0x21')](_0xfca0('0x22'),_0xef080e+'-'+_0x42358a+'/'+_0x96417a)[_0xfca0('0x23')](_0x52b194);}return null;};}function patchUpdates(_0x5bdedf){return function(_0x18cd9d){try{jsonpatch[_0xfca0('0x24')](_0x18cd9d,_0x5bdedf,!![]);}catch(_0x5d7d65){return BPromise[_0xfca0('0x25')](_0x5d7d65);}return _0x18cd9d[_0xfca0('0x26')]();};}function saveUpdates(_0x53f1b9,_0x3b169f){return function(_0x159508){if(_0x159508){return _0x159508[_0xfca0('0x27')](_0x53f1b9)[_0xfca0('0x28')](function(_0x5c4dfd){return _0x5c4dfd;});}return null;};}function removeEntity(_0x3c5258,_0x494ebb){return function(_0x182e27){if(_0x182e27){return _0x182e27[_0xfca0('0x29')]()[_0xfca0('0x28')](function(){_0x3c5258[_0xfca0('0x1c')](0xcc)[_0xfca0('0x1b')]();});}};}function handleEntityNotFound(_0x56cba3,_0x588858){return function(_0x3643f0){if(!_0x3643f0){_0x56cba3['sendStatus'](0x194);}return _0x3643f0;};}function handleError(_0x1ff9fb,_0x46c7a6){_0x46c7a6=_0x46c7a6||0x1f4;return function(_0x4cae14){logger[_0xfca0('0x2a')](_0x4cae14[_0xfca0('0x2b')]);if(_0x4cae14[_0xfca0('0x2c')]){delete _0x4cae14[_0xfca0('0x2c')];}_0x1ff9fb[_0xfca0('0x1c')](_0x46c7a6)[_0xfca0('0x2d')](_0x4cae14);};}exports[_0xfca0('0x2e')]=function(_0x244338,_0x24dfa6){var _0x7832ac={},_0x32f7ce={},_0x14a242={'count':0x0,'rows':[]};var _0x14889d=_[_0xfca0('0x2f')](db[_0xfca0('0x30')][_0xfca0('0x31')],function(_0x54282d){return{'name':_0x54282d[_0xfca0('0x32')],'type':_0x54282d[_0xfca0('0x33')][_0xfca0('0x34')]};});_0x32f7ce['model']=_[_0xfca0('0x2f')](_0x14889d,_0xfca0('0x2c'));_0x32f7ce[_0xfca0('0x35')]=_[_0xfca0('0x36')](_0x244338[_0xfca0('0x35')]);_0x32f7ce[_0xfca0('0x37')]=_['intersection'](_0x32f7ce[_0xfca0('0x38')],_0x32f7ce[_0xfca0('0x35')]);_0x7832ac['attributes']=_[_0xfca0('0x39')](_0x32f7ce['model'],qs[_0xfca0('0x3a')](_0x244338['query']['fields']));_0x7832ac[_0xfca0('0x3b')]=_0x7832ac[_0xfca0('0x3b')][_0xfca0('0x3c')]?_0x7832ac[_0xfca0('0x3b')]:_0x32f7ce['model'];if(!_0x244338[_0xfca0('0x35')][_0xfca0('0x3d')](_0xfca0('0x3e'))){_0x7832ac['limit']=qs['limit'](_0x244338[_0xfca0('0x35')]['limit']);_0x7832ac[_0xfca0('0x1f')]=qs[_0xfca0('0x1f')](_0x244338['query'][_0xfca0('0x1f')]);}_0x7832ac[_0xfca0('0x3f')]=qs[_0xfca0('0x40')](_0x244338[_0xfca0('0x35')]['sort']);_0x7832ac[_0xfca0('0x41')]=qs[_0xfca0('0x37')](_['pick'](_0x244338['query'],_0x32f7ce[_0xfca0('0x37')]),_0x14889d);if(_0x244338[_0xfca0('0x35')][_0xfca0('0x42')]){_0x7832ac[_0xfca0('0x41')]=_[_0xfca0('0x43')](_0x7832ac[_0xfca0('0x41')],{'$or':_[_0xfca0('0x2f')](_0x14889d,function(_0x3dcd9d){if(_0x3dcd9d[_0xfca0('0x33')]!==_0xfca0('0x44')){var _0x52a9e3={};_0x52a9e3[_0x3dcd9d['name']]={'$like':'%'+_0x244338[_0xfca0('0x35')][_0xfca0('0x42')]+'%'};return _0x52a9e3;}})});}_0x7832ac=_[_0xfca0('0x43')]({},_0x7832ac,_0x244338[_0xfca0('0x45')]);var _0x1db7e8={'where':_0x7832ac[_0xfca0('0x41')]};return db[_0xfca0('0x30')]['count'](_0x1db7e8)[_0xfca0('0x28')](function(_0x3055a2){_0x14a242['count']=_0x3055a2;if(_0x244338[_0xfca0('0x35')][_0xfca0('0x46')]){_0x7832ac[_0xfca0('0x47')]=[{'all':!![]}];}return db[_0xfca0('0x30')][_0xfca0('0x48')](_0x7832ac);})['then'](function(_0x53d9d7){_0x14a242[_0xfca0('0x49')]=_0x53d9d7;return _0x14a242;})[_0xfca0('0x28')](respondWithFilteredResult(_0x24dfa6,_0x7832ac))['catch'](handleError(_0x24dfa6,null));};exports[_0xfca0('0x4a')]=function(_0xe27635,_0x2e9a0e){var _0x445af2={'raw':!![],'where':{'id':_0xe27635['params']['id']}},_0x3d34e3={};_0x3d34e3[_0xfca0('0x38')]=_[_0xfca0('0x36')](db['ZohoField'][_0xfca0('0x31')]);_0x3d34e3[_0xfca0('0x35')]=_[_0xfca0('0x36')](_0xe27635['query']);_0x3d34e3[_0xfca0('0x37')]=_[_0xfca0('0x39')](_0x3d34e3['model'],_0x3d34e3[_0xfca0('0x35')]);_0x445af2[_0xfca0('0x3b')]=_['intersection'](_0x3d34e3[_0xfca0('0x38')],qs['fields'](_0xe27635[_0xfca0('0x35')][_0xfca0('0x3a')]));_0x445af2['attributes']=_0x445af2[_0xfca0('0x3b')][_0xfca0('0x3c')]?_0x445af2[_0xfca0('0x3b')]:_0x3d34e3[_0xfca0('0x38')];if(_0xe27635[_0xfca0('0x35')]['includeAll']){_0x445af2[_0xfca0('0x47')]=[{'all':!![]}];}_0x445af2=_[_0xfca0('0x43')]({},_0x445af2,_0xe27635[_0xfca0('0x45')]);return db[_0xfca0('0x30')][_0xfca0('0x4b')](_0x445af2)[_0xfca0('0x28')](handleEntityNotFound(_0x2e9a0e,null))[_0xfca0('0x28')](respondWithResult(_0x2e9a0e,null))[_0xfca0('0x4c')](handleError(_0x2e9a0e,null));};exports['create']=function(_0x17162d,_0x49ef1f){return db[_0xfca0('0x30')][_0xfca0('0x4d')](_0x17162d[_0xfca0('0x4e')],{})[_0xfca0('0x28')](respondWithResult(_0x49ef1f,0xc9))[_0xfca0('0x4c')](handleError(_0x49ef1f,null));};exports[_0xfca0('0x27')]=function(_0x4f16f8,_0xe871e5){if(_0x4f16f8[_0xfca0('0x4e')]['id']){delete _0x4f16f8[_0xfca0('0x4e')]['id'];}return db[_0xfca0('0x30')][_0xfca0('0x4b')]({'where':{'id':_0x4f16f8['params']['id']}})[_0xfca0('0x28')](handleEntityNotFound(_0xe871e5,null))[_0xfca0('0x28')](saveUpdates(_0x4f16f8[_0xfca0('0x4e')],null))[_0xfca0('0x28')](respondWithResult(_0xe871e5,null))[_0xfca0('0x4c')](handleError(_0xe871e5,null));};exports[_0xfca0('0x29')]=function(_0x2e06b0,_0xcf0dee){return db[_0xfca0('0x30')]['find']({'where':{'id':_0x2e06b0[_0xfca0('0x4f')]['id']}})[_0xfca0('0x28')](handleEntityNotFound(_0xcf0dee,null))[_0xfca0('0x28')](removeEntity(_0xcf0dee,null))['catch'](handleError(_0xcf0dee,null));}; \ No newline at end of file +var _0x8946=['where','pick','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8946,0x130));var _0x6894=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x8946[_0x42bc91];return _0x3f5507;};'use strict';var emlformat=require(_0x6894('0x0'));var rimraf=require(_0x6894('0x1'));var zipdir=require(_0x6894('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6894('0x3'));var moment=require(_0x6894('0x4'));var BPromise=require(_0x6894('0x5'));var Mustache=require(_0x6894('0x6'));var util=require(_0x6894('0x7'));var path=require(_0x6894('0x8'));var sox=require(_0x6894('0x9'));var csv=require(_0x6894('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6894('0xa'));var querystring=require('querystring');var Papa=require(_0x6894('0xb'));var Redis=require(_0x6894('0xc'));var authService=require(_0x6894('0xd'));var qs=require(_0x6894('0xe'));var as=require(_0x6894('0xf'));var hardwareService=require(_0x6894('0x10'));var logger=require(_0x6894('0x11'))(_0x6894('0x12'));var utils=require(_0x6894('0x13'));var config=require(_0x6894('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6894('0x15'))['db'];function respondWithStatusCode(_0x14abbb,_0x33c038){_0x33c038=_0x33c038||0xcc;return function(_0x486d81){if(_0x486d81){return _0x14abbb['sendStatus'](_0x33c038);}return _0x14abbb[_0x6894('0x16')](_0x33c038)[_0x6894('0x17')]();};}function respondWithResult(_0xe12efd,_0x242b4b){_0x242b4b=_0x242b4b||0xc8;return function(_0x5be040){if(_0x5be040){return _0xe12efd[_0x6894('0x16')](_0x242b4b)[_0x6894('0x18')](_0x5be040);}};}function respondWithFilteredResult(_0x1d9cac,_0x358eef){return function(_0x3aec8f){if(_0x3aec8f){var _0x45b9b7=typeof _0x358eef[_0x6894('0x19')]==='undefined'&&typeof _0x358eef[_0x6894('0x1a')]==='undefined';var _0x13d99c=_0x3aec8f[_0x6894('0x1b')];var _0x53e9f2=_0x45b9b7?0x0:_0x358eef['offset'];var _0x1960e6=_0x45b9b7?_0x3aec8f[_0x6894('0x1b')]:_0x358eef[_0x6894('0x19')]+_0x358eef[_0x6894('0x1a')];var _0x2d1064;if(_0x1960e6>=_0x13d99c){_0x1960e6=_0x13d99c;_0x2d1064=0xc8;}else{_0x2d1064=0xce;}_0x1d9cac[_0x6894('0x16')](_0x2d1064);return _0x1d9cac[_0x6894('0x1c')](_0x6894('0x1d'),_0x53e9f2+'-'+_0x1960e6+'/'+_0x13d99c)[_0x6894('0x18')](_0x3aec8f);}return null;};}function patchUpdates(_0x48d636){return function(_0xab6d62){try{jsonpatch[_0x6894('0x1e')](_0xab6d62,_0x48d636,!![]);}catch(_0x6be790){return BPromise[_0x6894('0x1f')](_0x6be790);}return _0xab6d62[_0x6894('0x20')]();};}function saveUpdates(_0x1da127,_0x36c589){return function(_0x19fd58){if(_0x19fd58){return _0x19fd58[_0x6894('0x21')](_0x1da127)['then'](function(_0x7e7703){return _0x7e7703;});}return null;};}function removeEntity(_0xbeede0,_0x4fb52e){return function(_0x1efa03){if(_0x1efa03){return _0x1efa03[_0x6894('0x22')]()[_0x6894('0x23')](function(){_0xbeede0[_0x6894('0x16')](0xcc)[_0x6894('0x17')]();});}};}function handleEntityNotFound(_0x57aa38,_0x44b453){return function(_0x241d46){if(!_0x241d46){_0x57aa38[_0x6894('0x24')](0x194);}return _0x241d46;};}function handleError(_0x305cc2,_0x5b0193){_0x5b0193=_0x5b0193||0x1f4;return function(_0x5826da){logger[_0x6894('0x25')](_0x5826da[_0x6894('0x26')]);if(_0x5826da[_0x6894('0x27')]){delete _0x5826da[_0x6894('0x27')];}_0x305cc2[_0x6894('0x16')](_0x5b0193)['send'](_0x5826da);};}exports[_0x6894('0x28')]=function(_0x46141e,_0x3b7716){var _0x4f56cd={},_0x278ff3={},_0x193954={'count':0x0,'rows':[]};var _0x890e75=_[_0x6894('0x29')](db[_0x6894('0x2a')][_0x6894('0x2b')],function(_0x219a2c){return{'name':_0x219a2c[_0x6894('0x2c')],'type':_0x219a2c['type'][_0x6894('0x2d')]};});_0x278ff3[_0x6894('0x2e')]=_[_0x6894('0x29')](_0x890e75,'name');_0x278ff3['query']=_['keys'](_0x46141e[_0x6894('0x2f')]);_0x278ff3[_0x6894('0x30')]=_[_0x6894('0x31')](_0x278ff3['model'],_0x278ff3[_0x6894('0x2f')]);_0x4f56cd[_0x6894('0x32')]=_['intersection'](_0x278ff3[_0x6894('0x2e')],qs[_0x6894('0x33')](_0x46141e['query'][_0x6894('0x33')]));_0x4f56cd[_0x6894('0x32')]=_0x4f56cd[_0x6894('0x32')][_0x6894('0x34')]?_0x4f56cd[_0x6894('0x32')]:_0x278ff3[_0x6894('0x2e')];if(!_0x46141e[_0x6894('0x2f')][_0x6894('0x35')]('nolimit')){_0x4f56cd[_0x6894('0x1a')]=qs[_0x6894('0x1a')](_0x46141e[_0x6894('0x2f')][_0x6894('0x1a')]);_0x4f56cd[_0x6894('0x19')]=qs['offset'](_0x46141e['query']['offset']);}_0x4f56cd[_0x6894('0x36')]=qs[_0x6894('0x37')](_0x46141e[_0x6894('0x2f')]['sort']);_0x4f56cd[_0x6894('0x38')]=qs[_0x6894('0x30')](_[_0x6894('0x39')](_0x46141e['query'],_0x278ff3[_0x6894('0x30')]),_0x890e75);if(_0x46141e[_0x6894('0x2f')]['filter']){_0x4f56cd['where']=_[_0x6894('0x3a')](_0x4f56cd[_0x6894('0x38')],{'$or':_[_0x6894('0x29')](_0x890e75,function(_0x3a1932){if(_0x3a1932[_0x6894('0x3b')]!==_0x6894('0x3c')){var _0x1d876a={};_0x1d876a[_0x3a1932[_0x6894('0x27')]]={'$like':'%'+_0x46141e[_0x6894('0x2f')]['filter']+'%'};return _0x1d876a;}})});}_0x4f56cd=_[_0x6894('0x3a')]({},_0x4f56cd,_0x46141e[_0x6894('0x3d')]);var _0x590052={'where':_0x4f56cd[_0x6894('0x38')]};return db[_0x6894('0x2a')]['count'](_0x590052)['then'](function(_0x3f0c26){_0x193954['count']=_0x3f0c26;if(_0x46141e[_0x6894('0x2f')]['includeAll']){_0x4f56cd[_0x6894('0x3e')]=[{'all':!![]}];}return db[_0x6894('0x2a')][_0x6894('0x3f')](_0x4f56cd);})[_0x6894('0x23')](function(_0x988a36){_0x193954[_0x6894('0x40')]=_0x988a36;return _0x193954;})['then'](respondWithFilteredResult(_0x3b7716,_0x4f56cd))[_0x6894('0x41')](handleError(_0x3b7716,null));};exports[_0x6894('0x42')]=function(_0x112dfc,_0x55795c){var _0x527dab={'raw':!![],'where':{'id':_0x112dfc[_0x6894('0x43')]['id']}},_0x5628c1={};_0x5628c1[_0x6894('0x2e')]=_[_0x6894('0x44')](db['ZohoField'][_0x6894('0x2b')]);_0x5628c1[_0x6894('0x2f')]=_[_0x6894('0x44')](_0x112dfc['query']);_0x5628c1[_0x6894('0x30')]=_['intersection'](_0x5628c1[_0x6894('0x2e')],_0x5628c1[_0x6894('0x2f')]);_0x527dab[_0x6894('0x32')]=_[_0x6894('0x31')](_0x5628c1['model'],qs['fields'](_0x112dfc['query'][_0x6894('0x33')]));_0x527dab['attributes']=_0x527dab['attributes']['length']?_0x527dab[_0x6894('0x32')]:_0x5628c1[_0x6894('0x2e')];if(_0x112dfc['query']['includeAll']){_0x527dab[_0x6894('0x3e')]=[{'all':!![]}];}_0x527dab=_[_0x6894('0x3a')]({},_0x527dab,_0x112dfc[_0x6894('0x3d')]);return db['ZohoField'][_0x6894('0x45')](_0x527dab)[_0x6894('0x23')](handleEntityNotFound(_0x55795c,null))['then'](respondWithResult(_0x55795c,null))['catch'](handleError(_0x55795c,null));};exports[_0x6894('0x46')]=function(_0x4884d5,_0x22ae94){return db[_0x6894('0x2a')][_0x6894('0x46')](_0x4884d5['body'],{})[_0x6894('0x23')](respondWithResult(_0x22ae94,0xc9))[_0x6894('0x41')](handleError(_0x22ae94,null));};exports['update']=function(_0x2b95c7,_0x144b93){if(_0x2b95c7[_0x6894('0x47')]['id']){delete _0x2b95c7['body']['id'];}return db['ZohoField'][_0x6894('0x45')]({'where':{'id':_0x2b95c7[_0x6894('0x43')]['id']}})[_0x6894('0x23')](handleEntityNotFound(_0x144b93,null))[_0x6894('0x23')](saveUpdates(_0x2b95c7[_0x6894('0x47')],null))['then'](respondWithResult(_0x144b93,null))[_0x6894('0x41')](handleError(_0x144b93,null));};exports[_0x6894('0x22')]=function(_0x3057c6,_0x5f049d){return db[_0x6894('0x2a')][_0x6894('0x45')]({'where':{'id':_0x3057c6[_0x6894('0x43')]['id']}})[_0x6894('0x23')](handleEntityNotFound(_0x5f049d,null))[_0x6894('0x23')](removeEntity(_0x5f049d,null))['catch'](handleError(_0x5f049d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2cdad70..fe81e0d 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 _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId'];(function(_0x2853dd,_0x254e87){var _0x1f60c1=function(_0x417c63){while(--_0x417c63){_0x2853dd['push'](_0x2853dd['shift']());}};_0x1f60c1(++_0x254e87);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f6f04,_0x59c6ba){_0x4f6f04=_0x4f6f04-0x0;var _0x606b2c=_0x5fab[_0x4f6f04];return _0x606b2c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['idField',_0xb5fa('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x2e3650,_0x9d261){var _0x475a09=function(_0xfe19bb){while(--_0xfe19bb){_0x2e3650['push'](_0x2e3650['shift']());}};_0x475a09(++_0x9d261);}(_0x896e,0x1e9));var _0xe896=function(_0x277c90,_0x105d19){_0x277c90=_0x277c90-0x0;var _0x28b283=_0x896e[_0x277c90];return _0x28b283;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[{'name':_0xe896('0xf'),'fields':['idField',_0xe896('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 1e8387b..f0687ea 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 _0x16d9=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x384bdf,_0x1af8b4){var _0x5a7ae4=function(_0x50cc9a){while(--_0x50cc9a){_0x384bdf['push'](_0x384bdf['shift']());}};_0x5a7ae4(++_0x1af8b4);}(_0x16d9,0x18c));var _0x916d=function(_0x34ac63,_0x40f4da){_0x34ac63=_0x34ac63-0x0;var _0x44aee2=_0x16d9[_0x34ac63];return _0x44aee2;};'use strict';var _=require(_0x916d('0x0'));var util=require(_0x916d('0x1'));var moment=require(_0x916d('0x2'));var BPromise=require(_0x916d('0x3'));var rs=require(_0x916d('0x4'));var fs=require('fs');var Redis=require(_0x916d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x916d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x916d('0x7'));var jayson=require(_0x916d('0x8'));var client=jayson[_0x916d('0x9')][_0x916d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a974,_0x71d80e,_0xa65aa){return new BPromise(function(_0x2a67de,_0x22212e){return client[_0x916d('0xb')](_0x18a974,_0xa65aa)[_0x916d('0xc')](function(_0x4a270b){logger[_0x916d('0xd')](_0x916d('0xe'),_0x71d80e,_0x916d('0xf'));logger[_0x916d('0x10')](_0x916d('0x11'),_0x71d80e,'request\x20sent',JSON[_0x916d('0x12')](_0x4a270b));if(_0x4a270b['error']){if(_0x4a270b[_0x916d('0x13')]['code']===0x1f4){logger[_0x916d('0x13')]('ZohoField,\x20%s,\x20%s',_0x71d80e,_0x4a270b[_0x916d('0x13')][_0x916d('0x14')]);return _0x22212e(_0x4a270b[_0x916d('0x13')][_0x916d('0x14')]);}logger[_0x916d('0x13')](_0x916d('0xe'),_0x71d80e,_0x4a270b[_0x916d('0x13')]['message']);return _0x2a67de(_0x4a270b[_0x916d('0x13')]['message']);}else{logger[_0x916d('0xd')](_0x916d('0xe'),_0x71d80e,_0x916d('0xf'));_0x2a67de(_0x4a270b[_0x916d('0x15')]['message']);}})[_0x916d('0x16')](function(_0x20ea43){logger[_0x916d('0x13')](_0x916d('0xe'),_0x71d80e,_0x20ea43);_0x22212e(_0x20ea43);});});} \ No newline at end of file +var _0x71c2=['moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util'];(function(_0x508166,_0x342a28){var _0x2dafe0=function(_0x2f209b){while(--_0x2f209b){_0x508166['push'](_0x508166['shift']());}};_0x2dafe0(++_0x342a28);}(_0x71c2,0x112));var _0x271c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x271c('0x0'));var util=require(_0x271c('0x1'));var moment=require(_0x271c('0x2'));var BPromise=require(_0x271c('0x3'));var rs=require(_0x271c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x271c('0x5'))(_0x271c('0x6'));var config=require(_0x271c('0x7'));var jayson=require(_0x271c('0x8'));var client=jayson[_0x271c('0x9')][_0x271c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdd544a,_0x4a5e55,_0x5d3857){return new BPromise(function(_0x54e86c,_0x18c9c3){return client[_0x271c('0xb')](_0xdd544a,_0x5d3857)[_0x271c('0xc')](function(_0x441fec){logger[_0x271c('0xd')](_0x271c('0xe'),_0x4a5e55,_0x271c('0xf'));logger['debug'](_0x271c('0x10'),_0x4a5e55,_0x271c('0xf'),JSON[_0x271c('0x11')](_0x441fec));if(_0x441fec['error']){if(_0x441fec['error'][_0x271c('0x12')]===0x1f4){logger['error'](_0x271c('0xe'),_0x4a5e55,_0x441fec[_0x271c('0x13')][_0x271c('0x14')]);return _0x18c9c3(_0x441fec[_0x271c('0x13')][_0x271c('0x14')]);}logger[_0x271c('0x13')](_0x271c('0xe'),_0x4a5e55,_0x441fec['error'][_0x271c('0x14')]);return _0x54e86c(_0x441fec[_0x271c('0x13')][_0x271c('0x14')]);}else{logger['info'](_0x271c('0xe'),_0x4a5e55,_0x271c('0xf'));_0x54e86c(_0x441fec[_0x271c('0x15')][_0x271c('0x14')]);}})[_0x271c('0x16')](function(_0x165234){logger[_0x271c('0x13')]('ZohoField,\x20%s,\x20%s',_0x4a5e55,_0x165234);_0x18c9c3(_0x165234);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 44dbb58..1d89c81 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x53af8c,_0x18e612){var _0x2104f8=function(_0x22c98b){while(--_0x22c98b){_0x53af8c['push'](_0x53af8c['shift']());}};_0x2104f8(++_0x18e612);}(_0x70e0,0x17b));var _0x070e=function(_0x419bf6,_0x38314f){_0x419bf6=_0x419bf6-0x0;var _0x3df441=_0x70e0[_0x419bf6];return _0x3df441;};'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(_0x5c1b05,_0x213768){var _0x1a65e7=function(_0x2845d7){while(--_0x2845d7){_0x5c1b05['push'](_0x5c1b05['shift']());}};_0x1a65e7(++_0x213768);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e91a045..d215a73 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 _0xbc48=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports'];(function(_0x33c14b,_0x4179ed){var _0x2ca50d=function(_0x26857d){while(--_0x26857d){_0x33c14b['push'](_0x33c14b['shift']());}};_0x2ca50d(++_0x4179ed);}(_0xbc48,0x16b));var _0x8bc4=function(_0x4572f9,_0x4c9d5a){_0x4572f9=_0x4572f9-0x0;var _0x33784c=_0xbc48[_0x4572f9];return _0x33784c;};'use strict';var Sequelize=require('sequelize');module[_0x8bc4('0x0')]={'name':{'type':Sequelize[_0x8bc4('0x1')],'allowNull':![],'unique':_0x8bc4('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8bc4('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x8bc4('0x3')},'filename':{'type':Sequelize[_0x8bc4('0x1')]},'path':{'type':Sequelize[_0x8bc4('0x1')]},'type':{'type':Sequelize[_0x8bc4('0x1')]},'size':{'type':Sequelize[_0x8bc4('0x4')]},'active':{'type':Sequelize[_0x8bc4('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8bc4('0x1')]},'logo':{'type':Sequelize[_0x8bc4('0x1')]},'state':{'type':Sequelize[_0x8bc4('0x1')],'unique':_0x8bc4('0x6')},'description':{'type':Sequelize[_0x8bc4('0x1')]},'title':{'type':Sequelize[_0x8bc4('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x8bc4('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x1036=['STRING','INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version'];(function(_0x311997,_0x4c2cc7){var _0x3be163=function(_0x289cfb){while(--_0x289cfb){_0x311997['push'](_0x311997['shift']());}};_0x3be163(++_0x4c2cc7);}(_0x1036,0x18f));var _0x6103=function(_0x58db59,_0x3844a5){_0x58db59=_0x58db59-0x0;var _0x439faa=_0x1036[_0x58db59];return _0x439faa;};'use strict';var Sequelize=require(_0x6103('0x0'));module[_0x6103('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6103('0x2')},'version':{'type':Sequelize[_0x6103('0x3')],'allowNull':![],'unique':_0x6103('0x2')},'main':{'type':Sequelize[_0x6103('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x6103('0x3')]},'type':{'type':Sequelize[_0x6103('0x3')]},'size':{'type':Sequelize[_0x6103('0x4')]},'active':{'type':Sequelize[_0x6103('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x6103('0x3')]},'logo':{'type':Sequelize[_0x6103('0x3')]},'state':{'type':Sequelize[_0x6103('0x3')],'unique':'state'},'description':{'type':Sequelize[_0x6103('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6103('0x3')]},'link':{'type':Sequelize[_0x6103('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 95ac88e..06b855d 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x290ad6,_0x15f536){var _0x28f091=function(_0x5222c9){while(--_0x5222c9){_0x290ad6['push'](_0x290ad6['shift']());}};_0x28f091(++_0x15f536);}(_0x7a54,0x106));var _0x47a5=function(_0x1b2ec0,_0x3f97d8){_0x1b2ec0=_0x1b2ec0-0x0;var _0x43e031=_0x7a54[_0x1b2ec0];return _0x43e031;};'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['Integration'][_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['Integration']['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['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x7096=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','Integration','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x2684d3,_0x464630){var _0x385a3e=function(_0x12f592){while(--_0x12f592){_0x2684d3['push'](_0x2684d3['shift']());}};_0x385a3e(++_0x464630);}(_0x7096,0x10c));var _0x6709=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7096[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['Integration'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['Integration'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['Integration'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['Integration']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['Integration'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b2c30f7..b277266 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 _0x5251=['exports','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x2f487d,_0x31ba82){var _0x75f77f=function(_0x286567){while(--_0x286567){_0x2f487d['push'](_0x2f487d['shift']());}};_0x75f77f(++_0x31ba82);}(_0x5251,0xd5));var _0x1525=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5251[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1525('0x0'));var util=require(_0x1525('0x1'));var logger=require(_0x1525('0x2'))(_0x1525('0x3'));var moment=require(_0x1525('0x4'));var BPromise=require(_0x1525('0x5'));var rp=require(_0x1525('0x6'));var fs=require('fs');var path=require(_0x1525('0x7'));var rimraf=require(_0x1525('0x8'));var config=require(_0x1525('0x9'));var attributes=require(_0x1525('0xa'));module[_0x1525('0xb')]=function(_0x45e4af,_0x55a139){return _0x45e4af[_0x1525('0xc')](_0x1525('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd25b=['request-promise','path','rimraf','../../config/environment','define','Integration','integrations','lodash','util','api','moment','bluebird'];(function(_0x3f7d2e,_0x3dc447){var _0x440c3f=function(_0x42b5bc){while(--_0x42b5bc){_0x3f7d2e['push'](_0x3f7d2e['shift']());}};_0x440c3f(++_0x3dc447);}(_0xd25b,0x1c3));var _0xbd25=function(_0x1d2e67,_0x1a7f78){_0x1d2e67=_0x1d2e67-0x0;var _0x486d3c=_0xd25b[_0x1d2e67];return _0x486d3c;};'use strict';var _=require(_0xbd25('0x0'));var util=require(_0xbd25('0x1'));var logger=require('../../config/logger')(_0xbd25('0x2'));var moment=require(_0xbd25('0x3'));var BPromise=require(_0xbd25('0x4'));var rp=require(_0xbd25('0x5'));var fs=require('fs');var path=require(_0xbd25('0x6'));var rimraf=require(_0xbd25('0x7'));var config=require(_0xbd25('0x8'));var attributes=require('./integration.attributes');module['exports']=function(_0x3c0552,_0x24f2d2){return _0x3c0552[_0xbd25('0x9')](_0xbd25('0xa'),attributes,{'tableName':_0xbd25('0xb'),'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 fbb2f20..894aaca 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 _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e3618,_0x30c851){var _0x30dc0f=function(_0x47d892){while(--_0x47d892){_0x1e3618['push'](_0x1e3618['shift']());}};_0x30dc0f(++_0x30c851);}(_0x0295,0x1f0));var _0x5029=function(_0x2b92ec,_0x18e0e3){_0x2b92ec=_0x2b92ec-0x0;var _0x12be46=_0x0295[_0x2b92ec];return _0x12be46;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x2cad63,_0x15a505){var _0x2ac69e=function(_0x5557d9){while(--_0x5557d9){_0x2cad63['push'](_0x2cad63['shift']());}};_0x2ac69e(++_0x15a505);}(_0xd943,0x15d));var _0x3d94=function(_0x29d60c,_0x1d9c2f){_0x29d60c=_0x29d60c-0x0;var _0x49c74c=_0xd943[_0x29d60c];return _0x49c74c;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index cdf82ef..f849f68 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 _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x44da61,_0x4bb310){var _0x24dc30=function(_0x12a6b0){while(--_0x12a6b0){_0x44da61['push'](_0x44da61['shift']());}};_0x24dc30(++_0x4bb310);}(_0x1261,0x144));var _0x1126=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0x1261[_0x4e7c1c];return _0x47adb2;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0xbb4e02,_0x1cac95){var _0x50ac16=function(_0xa64de2){while(--_0xa64de2){_0xbb4e02['push'](_0xbb4e02['shift']());}};_0x50ac16(++_0x1cac95);}(_0x4975,0x86));var _0x5497=function(_0x1fe70c,_0x5f357d){_0x1fe70c=_0x1fe70c-0x0;var _0x57a4f5=_0x4975[_0x1fe70c];return _0x57a4f5;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index d41e07c..df8a0af 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 _0xb19e=['STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','sequelize','exports'];(function(_0x2177eb,_0x153d3c){var _0x19d48a=function(_0x34d8dd){while(--_0x34d8dd){_0x2177eb['push'](_0x2177eb['shift']());}};_0x19d48a(++_0x153d3c);}(_0xb19e,0xd0));var _0xeb19=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0xb19e[_0x21205e];return _0x136ebb;};'use strict';var Sequelize=require(_0xeb19('0x0'));module[_0xeb19('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xeb19('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xeb19('0x2')]},'uniqueid':{'type':Sequelize[_0xeb19('0x2')]},'calleridnum':{'type':Sequelize[_0xeb19('0x2')]},'calleridname':{'type':Sequelize[_0xeb19('0x2')]},'queue':{'type':Sequelize[_0xeb19('0x2')]},'interface':{'type':Sequelize[_0xeb19('0x2')]},'membername':{'type':Sequelize[_0xeb19('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeb19('0x3')]},'agentconnectAt':{'type':Sequelize[_0xeb19('0x3')]},'holdtime':{'type':Sequelize[_0xeb19('0x4')]},'agentcomplete':{'type':Sequelize[_0xeb19('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xeb19('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xeb19('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeb19('0x4')]},'reason':{'type':Sequelize[_0xeb19('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xeb19('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xeb19('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xeb19('0x2')]},'channel':{'type':Sequelize[_0xeb19('0x2')]},'channelstate':{'type':Sequelize[_0xeb19('0x4')]},'channelstatedesc':{'type':Sequelize[_0xeb19('0x2')]},'connectedlinenum':{'type':Sequelize[_0xeb19('0x2')]},'connectedlinename':{'type':Sequelize[_0xeb19('0x2')]},'language':{'type':Sequelize[_0xeb19('0x2')]},'accountcode':{'type':Sequelize[_0xeb19('0x2')]},'context':{'type':Sequelize[_0xeb19('0x2')]},'exten':{'type':Sequelize[_0xeb19('0x2')]},'priority':{'type':Sequelize[_0xeb19('0x2')]},'destchannel':{'type':Sequelize[_0xeb19('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xeb19('0x2')]},'destcalleridname':{'type':Sequelize[_0xeb19('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xeb19('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeb19('0x2')]},'destlanguage':{'type':Sequelize[_0xeb19('0x2')]},'destaccountcode':{'type':Sequelize[_0xeb19('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xeb19('0x2')]},'destpriority':{'type':Sequelize[_0xeb19('0x2')]},'destuniqueid':{'type':Sequelize[_0xeb19('0x2')]},'messageId':{'type':Sequelize[_0xeb19('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xeb19('0x2')]},'cc':{'type':Sequelize[_0xeb19('0x2')]},'attachment':{'type':Sequelize[_0xeb19('0x6')]},'html':{'type':Sequelize[_0xeb19('0x6')]},'text':{'type':Sequelize[_0xeb19('0x6')]},'status':{'type':Sequelize['ENUM'](_0xeb19('0x7'),_0xeb19('0x8'),_0xeb19('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xeb19('0x2')]},'appdata':{'type':Sequelize[_0xeb19('0x2')]},'projectId':{'type':Sequelize[_0xeb19('0x4')]}}; \ No newline at end of file +var _0x3c00=['TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3c00,0x73));var _0x03c0=function(_0x588d05,_0xd0060c){_0x588d05=_0x588d05-0x0;var _0x44a8f4=_0x3c00[_0x588d05];return _0x44a8f4;};'use strict';var Sequelize=require(_0x03c0('0x0'));module[_0x03c0('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x03c0('0x2')]},'exitStatus':{'type':Sequelize[_0x03c0('0x2')]},'ticketId':{'type':Sequelize[_0x03c0('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x03c0('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x03c0('0x2')]},'calleridname':{'type':Sequelize[_0x03c0('0x2')]},'queue':{'type':Sequelize[_0x03c0('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x03c0('0x3')]},'holdtime':{'type':Sequelize[_0x03c0('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x03c0('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x03c0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x03c0('0x4')]},'reason':{'type':Sequelize[_0x03c0('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x03c0('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x03c0('0x3')]},'agentdump':{'type':Sequelize[_0x03c0('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x03c0('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x03c0('0x4')]},'channelstatedesc':{'type':Sequelize[_0x03c0('0x2')]},'connectedlinenum':{'type':Sequelize[_0x03c0('0x2')]},'connectedlinename':{'type':Sequelize[_0x03c0('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x03c0('0x2')]},'exten':{'type':Sequelize[_0x03c0('0x2')]},'priority':{'type':Sequelize[_0x03c0('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x03c0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x03c0('0x2')]},'destcalleridnum':{'type':Sequelize[_0x03c0('0x2')]},'destcalleridname':{'type':Sequelize[_0x03c0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x03c0('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x03c0('0x2')]},'destcontext':{'type':Sequelize[_0x03c0('0x2')]},'destexten':{'type':Sequelize[_0x03c0('0x2')]},'destpriority':{'type':Sequelize[_0x03c0('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x03c0('0x2')]},'inReplyTo':{'type':Sequelize[_0x03c0('0x2')]},'subject':{'type':Sequelize[_0x03c0('0x2')]},'from':{'type':Sequelize[_0x03c0('0x2')]},'to':{'type':Sequelize[_0x03c0('0x2')]},'cc':{'type':Sequelize[_0x03c0('0x2')]},'attachment':{'type':Sequelize[_0x03c0('0x6')]},'html':{'type':Sequelize[_0x03c0('0x6')]},'text':{'type':Sequelize[_0x03c0('0x6')]},'status':{'type':Sequelize[_0x03c0('0x7')](_0x03c0('0x8'),_0x03c0('0x9'),_0x03c0('0xa'),'FAILED')},'url':{'type':Sequelize[_0x03c0('0x2')]},'app':{'type':Sequelize[_0x03c0('0x2')]},'appdata':{'type':Sequelize[_0x03c0('0x2')]},'projectId':{'type':Sequelize[_0x03c0('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 155051f..d6c8208 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 _0x7cbd=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','findAll','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','then','error','stack','name','index','map','IntegrationReport','key','keys','filters','intersection','model','query'];(function(_0x5842c3,_0x56bd74){var _0x44bf8c=function(_0x79551f){while(--_0x79551f){_0x5842c3['push'](_0x5842c3['shift']());}};_0x44bf8c(++_0x56bd74);}(_0x7cbd,0xb0));var _0xd7cb=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7cbd[_0x40bffc];return _0x3007e9;};'use strict';var emlformat=require(_0xd7cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7cb('0x1'));var jsonpatch=require(_0xd7cb('0x2'));var rp=require(_0xd7cb('0x3'));var moment=require(_0xd7cb('0x4'));var BPromise=require(_0xd7cb('0x5'));var Mustache=require(_0xd7cb('0x6'));var util=require(_0xd7cb('0x7'));var path=require(_0xd7cb('0x8'));var sox=require(_0xd7cb('0x9'));var csv=require(_0xd7cb('0xa'));var ejs=require(_0xd7cb('0xb'));var fs=require('fs');var fs_extra=require(_0xd7cb('0xc'));var _=require(_0xd7cb('0xd'));var squel=require(_0xd7cb('0xe'));var crypto=require(_0xd7cb('0xf'));var jsforce=require(_0xd7cb('0x10'));var deskjs=require(_0xd7cb('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd7cb('0x12'));var Papa=require(_0xd7cb('0x13'));var Redis=require('ioredis');var authService=require(_0xd7cb('0x14'));var qs=require(_0xd7cb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7cb('0x16'));var logger=require(_0xd7cb('0x17'))(_0xd7cb('0x18'));var utils=require(_0xd7cb('0x19'));var config=require(_0xd7cb('0x1a'));var licenseUtil=require(_0xd7cb('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5291cd,_0x16faf7){_0x16faf7=_0x16faf7||0xcc;return function(_0x2184d5){if(_0x2184d5){return _0x5291cd[_0xd7cb('0x1c')](_0x16faf7);}return _0x5291cd[_0xd7cb('0x1d')](_0x16faf7)[_0xd7cb('0x1e')]();};}function respondWithResult(_0x2212d0,_0x4698fb){_0x4698fb=_0x4698fb||0xc8;return function(_0x452359){if(_0x452359){return _0x2212d0[_0xd7cb('0x1d')](_0x4698fb)['json'](_0x452359);}};}function respondWithFilteredResult(_0x316df2,_0x3d131d){return function(_0x11fb06){if(_0x11fb06){var _0x554ef4=typeof _0x3d131d['offset']===_0xd7cb('0x1f')&&typeof _0x3d131d['limit']==='undefined';var _0x48830e=_0x11fb06[_0xd7cb('0x20')];var _0x243085=_0x554ef4?0x0:_0x3d131d[_0xd7cb('0x21')];var _0x2727c3=_0x554ef4?_0x11fb06[_0xd7cb('0x20')]:_0x3d131d['offset']+_0x3d131d[_0xd7cb('0x22')];var _0x35b47c;if(_0x2727c3>=_0x48830e){_0x2727c3=_0x48830e;_0x35b47c=0xc8;}else{_0x35b47c=0xce;}_0x316df2[_0xd7cb('0x1d')](_0x35b47c);return _0x316df2[_0xd7cb('0x23')](_0xd7cb('0x24'),_0x243085+'-'+_0x2727c3+'/'+_0x48830e)[_0xd7cb('0x25')](_0x11fb06);}return null;};}function patchUpdates(_0x165127){return function(_0x57f24a){try{jsonpatch['apply'](_0x57f24a,_0x165127,!![]);}catch(_0x4789f9){return BPromise['reject'](_0x4789f9);}return _0x57f24a['save']();};}function saveUpdates(_0x2f6725,_0x4c4b92){return function(_0x6e5109){if(_0x6e5109){return _0x6e5109[_0xd7cb('0x26')](_0x2f6725)[_0xd7cb('0x27')](function(_0x3b1ebb){return _0x3b1ebb;});}return null;};}function removeEntity(_0x3303a4,_0x9d8634){return function(_0x50775c){if(_0x50775c){return _0x50775c['destroy']()[_0xd7cb('0x27')](function(){_0x3303a4[_0xd7cb('0x1d')](0xcc)[_0xd7cb('0x1e')]();});}};}function handleEntityNotFound(_0x533b4e,_0x3e23cb){return function(_0x251860){if(!_0x251860){_0x533b4e[_0xd7cb('0x1c')](0x194);}return _0x251860;};}function handleError(_0x23b0c5,_0x209e4d){_0x209e4d=_0x209e4d||0x1f4;return function(_0x2125dc){logger[_0xd7cb('0x28')](_0x2125dc[_0xd7cb('0x29')]);if(_0x2125dc['name']){delete _0x2125dc[_0xd7cb('0x2a')];}_0x23b0c5[_0xd7cb('0x1d')](_0x209e4d)['send'](_0x2125dc);};}exports[_0xd7cb('0x2b')]=function(_0x5dbd84,_0xe86bc4){var _0x4f3020={},_0x55c62a={},_0x1d3b2c={'count':0x0,'rows':[]};var _0x21af58=_[_0xd7cb('0x2c')](db[_0xd7cb('0x2d')]['rawAttributes'],function(_0x1ce0d3){return{'name':_0x1ce0d3['fieldName'],'type':_0x1ce0d3['type'][_0xd7cb('0x2e')]};});_0x55c62a['model']=_[_0xd7cb('0x2c')](_0x21af58,_0xd7cb('0x2a'));_0x55c62a['query']=_[_0xd7cb('0x2f')](_0x5dbd84['query']);_0x55c62a[_0xd7cb('0x30')]=_[_0xd7cb('0x31')](_0x55c62a[_0xd7cb('0x32')],_0x55c62a[_0xd7cb('0x33')]);_0x4f3020[_0xd7cb('0x34')]=_[_0xd7cb('0x31')](_0x55c62a[_0xd7cb('0x32')],qs[_0xd7cb('0x35')](_0x5dbd84['query']['fields']));_0x4f3020['attributes']=_0x4f3020[_0xd7cb('0x34')]['length']?_0x4f3020[_0xd7cb('0x34')]:_0x55c62a[_0xd7cb('0x32')];if(!_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x36')](_0xd7cb('0x37'))){_0x4f3020['limit']=qs[_0xd7cb('0x22')](_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x22')]);_0x4f3020[_0xd7cb('0x21')]=qs[_0xd7cb('0x21')](_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x21')]);}_0x4f3020[_0xd7cb('0x38')]=qs[_0xd7cb('0x39')](_0x5dbd84['query'][_0xd7cb('0x39')]);_0x4f3020[_0xd7cb('0x3a')]=qs['filters'](_[_0xd7cb('0x3b')](_0x5dbd84[_0xd7cb('0x33')],_0x55c62a[_0xd7cb('0x30')]),_0x21af58);if(_0x5dbd84[_0xd7cb('0x33')]['filter']){_0x4f3020[_0xd7cb('0x3a')]=_[_0xd7cb('0x3c')](_0x4f3020[_0xd7cb('0x3a')],{'$or':_[_0xd7cb('0x2c')](_0x21af58,function(_0x43710d){if(_0x43710d[_0xd7cb('0x3d')]!=='VIRTUAL'){var _0x38b598={};_0x38b598[_0x43710d[_0xd7cb('0x2a')]]={'$like':'%'+_0x5dbd84[_0xd7cb('0x33')][_0xd7cb('0x3e')]+'%'};return _0x38b598;}})});}_0x4f3020=_[_0xd7cb('0x3c')]({},_0x4f3020,_0x5dbd84[_0xd7cb('0x3f')]);var _0x28dd8e={'where':_0x4f3020[_0xd7cb('0x3a')]};return db[_0xd7cb('0x2d')][_0xd7cb('0x20')](_0x28dd8e)[_0xd7cb('0x27')](function(_0x83022c){_0x1d3b2c['count']=_0x83022c;if(_0x5dbd84['query'][_0xd7cb('0x40')]){_0x4f3020['include']=[{'all':!![]}];}return db[_0xd7cb('0x2d')][_0xd7cb('0x41')](_0x4f3020);})[_0xd7cb('0x27')](function(_0x4f7635){_0x1d3b2c['rows']=_0x4f7635;return _0x1d3b2c;})['then'](respondWithFilteredResult(_0xe86bc4,_0x4f3020))[_0xd7cb('0x42')](handleError(_0xe86bc4,null));};exports[_0xd7cb('0x43')]=function(_0x786775,_0x55c5a6){var _0x151aa2={'raw':![],'where':{'id':_0x786775[_0xd7cb('0x44')]['id']}},_0x1e6c15={};_0x1e6c15[_0xd7cb('0x32')]=_[_0xd7cb('0x2f')](db[_0xd7cb('0x2d')][_0xd7cb('0x45')]);_0x1e6c15[_0xd7cb('0x33')]=_[_0xd7cb('0x2f')](_0x786775[_0xd7cb('0x33')]);_0x1e6c15[_0xd7cb('0x30')]=_[_0xd7cb('0x31')](_0x1e6c15[_0xd7cb('0x32')],_0x1e6c15[_0xd7cb('0x33')]);_0x151aa2[_0xd7cb('0x34')]=_['intersection'](_0x1e6c15[_0xd7cb('0x32')],qs[_0xd7cb('0x35')](_0x786775['query'][_0xd7cb('0x35')]));_0x151aa2[_0xd7cb('0x34')]=_0x151aa2['attributes'][_0xd7cb('0x46')]?_0x151aa2[_0xd7cb('0x34')]:_0x1e6c15['model'];if(_0x786775[_0xd7cb('0x33')]['includeAll']){_0x151aa2['include']=[{'all':!![]}];}_0x151aa2=_['merge']({},_0x151aa2,_0x786775[_0xd7cb('0x3f')]);return db[_0xd7cb('0x2d')][_0xd7cb('0x47')](_0x151aa2)['then'](handleEntityNotFound(_0x55c5a6,null))[_0xd7cb('0x27')](respondWithResult(_0x55c5a6,null))[_0xd7cb('0x42')](handleError(_0x55c5a6,null));};exports[_0xd7cb('0x48')]=function(_0x428a49,_0x2de4f1){return db[_0xd7cb('0x2d')][_0xd7cb('0x48')](_0x428a49[_0xd7cb('0x49')],{})[_0xd7cb('0x27')](respondWithResult(_0x2de4f1,0xc9))[_0xd7cb('0x42')](handleError(_0x2de4f1,null));};exports[_0xd7cb('0x26')]=function(_0x204033,_0x346167){if(_0x204033[_0xd7cb('0x49')]['id']){delete _0x204033[_0xd7cb('0x49')]['id'];}return db[_0xd7cb('0x2d')]['find']({'where':{'id':_0x204033['params']['id']}})[_0xd7cb('0x27')](handleEntityNotFound(_0x346167,null))['then'](saveUpdates(_0x204033[_0xd7cb('0x49')],null))['then'](respondWithResult(_0x346167,null))['catch'](handleError(_0x346167,null));};exports[_0xd7cb('0x4a')]=function(_0x41b8a8,_0x210585){return db['IntegrationReport'][_0xd7cb('0x47')]({'where':{'id':_0x41b8a8[_0xd7cb('0x44')]['id']}})[_0xd7cb('0x27')](handleEntityNotFound(_0x210585,null))[_0xd7cb('0x27')](removeEntity(_0x210585,null))[_0xd7cb('0x42')](handleError(_0x210585,null));};exports[_0xd7cb('0x4b')]=function(_0x207868,_0x2a209d){return db[_0xd7cb('0x2d')]['describe']()[_0xd7cb('0x27')](respondWithResult(_0x2a209d,null))['catch'](handleError(_0x2a209d,null));}; \ No newline at end of file +var _0x2cd3=['rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','IntegrationReport'];(function(_0x18be13,_0x12f269){var _0x17317b=function(_0x449d31){while(--_0x449d31){_0x18be13['push'](_0x18be13['shift']());}};_0x17317b(++_0x12f269);}(_0x2cd3,0x6e));var _0x32cd=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x2cd3[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x32cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x32cd('0x1'));var rp=require(_0x32cd('0x2'));var moment=require(_0x32cd('0x3'));var BPromise=require(_0x32cd('0x4'));var Mustache=require(_0x32cd('0x5'));var util=require('util');var path=require(_0x32cd('0x6'));var sox=require('sox');var csv=require(_0x32cd('0x7'));var ejs=require(_0x32cd('0x8'));var fs=require('fs');var fs_extra=require(_0x32cd('0x9'));var _=require(_0x32cd('0xa'));var squel=require(_0x32cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x32cd('0xc'));var deskjs=require(_0x32cd('0xd'));var toCsv=require(_0x32cd('0x7'));var querystring=require(_0x32cd('0xe'));var Papa=require(_0x32cd('0xf'));var Redis=require(_0x32cd('0x10'));var authService=require(_0x32cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x32cd('0x12'));var hardwareService=require(_0x32cd('0x13'));var logger=require(_0x32cd('0x14'))(_0x32cd('0x15'));var utils=require(_0x32cd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32cd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x130ab3,_0x371a98){_0x371a98=_0x371a98||0xcc;return function(_0x240b02){if(_0x240b02){return _0x130ab3[_0x32cd('0x18')](_0x371a98);}return _0x130ab3[_0x32cd('0x19')](_0x371a98)['end']();};}function respondWithResult(_0x1e1cdb,_0x4cbf05){_0x4cbf05=_0x4cbf05||0xc8;return function(_0x9662b8){if(_0x9662b8){return _0x1e1cdb[_0x32cd('0x19')](_0x4cbf05)[_0x32cd('0x1a')](_0x9662b8);}};}function respondWithFilteredResult(_0x10b0aa,_0x1f218a){return function(_0xcb76de){if(_0xcb76de){var _0x5aab84=typeof _0x1f218a['offset']===_0x32cd('0x1b')&&typeof _0x1f218a['limit']===_0x32cd('0x1b');var _0x29fac9=_0xcb76de[_0x32cd('0x1c')];var _0x48135c=_0x5aab84?0x0:_0x1f218a[_0x32cd('0x1d')];var _0x52b343=_0x5aab84?_0xcb76de[_0x32cd('0x1c')]:_0x1f218a[_0x32cd('0x1d')]+_0x1f218a[_0x32cd('0x1e')];var _0x224947;if(_0x52b343>=_0x29fac9){_0x52b343=_0x29fac9;_0x224947=0xc8;}else{_0x224947=0xce;}_0x10b0aa[_0x32cd('0x19')](_0x224947);return _0x10b0aa[_0x32cd('0x1f')](_0x32cd('0x20'),_0x48135c+'-'+_0x52b343+'/'+_0x29fac9)[_0x32cd('0x1a')](_0xcb76de);}return null;};}function patchUpdates(_0x142a3c){return function(_0x3eb6e9){try{jsonpatch[_0x32cd('0x21')](_0x3eb6e9,_0x142a3c,!![]);}catch(_0x3a3d7e){return BPromise[_0x32cd('0x22')](_0x3a3d7e);}return _0x3eb6e9[_0x32cd('0x23')]();};}function saveUpdates(_0x2a6354,_0x29e51b){return function(_0x392739){if(_0x392739){return _0x392739[_0x32cd('0x24')](_0x2a6354)[_0x32cd('0x25')](function(_0x5496d9){return _0x5496d9;});}return null;};}function removeEntity(_0x15477b,_0x4e39e5){return function(_0x1c5e25){if(_0x1c5e25){return _0x1c5e25[_0x32cd('0x26')]()[_0x32cd('0x25')](function(){_0x15477b[_0x32cd('0x19')](0xcc)[_0x32cd('0x27')]();});}};}function handleEntityNotFound(_0xeb78d8,_0x12beec){return function(_0x3c2211){if(!_0x3c2211){_0xeb78d8[_0x32cd('0x18')](0x194);}return _0x3c2211;};}function handleError(_0x2b4dab,_0x4210b5){_0x4210b5=_0x4210b5||0x1f4;return function(_0x160fea){logger[_0x32cd('0x28')](_0x160fea['stack']);if(_0x160fea[_0x32cd('0x29')]){delete _0x160fea[_0x32cd('0x29')];}_0x2b4dab[_0x32cd('0x19')](_0x4210b5)[_0x32cd('0x2a')](_0x160fea);};}exports[_0x32cd('0x2b')]=function(_0x31932a,_0x3add90){var _0x328abf={},_0xcda990={},_0x268a83={'count':0x0,'rows':[]};var _0x4d3570=_[_0x32cd('0x2c')](db[_0x32cd('0x2d')][_0x32cd('0x2e')],function(_0x12c45e){return{'name':_0x12c45e[_0x32cd('0x2f')],'type':_0x12c45e[_0x32cd('0x30')][_0x32cd('0x31')]};});_0xcda990[_0x32cd('0x32')]=_[_0x32cd('0x2c')](_0x4d3570,_0x32cd('0x29'));_0xcda990[_0x32cd('0x33')]=_[_0x32cd('0x34')](_0x31932a['query']);_0xcda990[_0x32cd('0x35')]=_['intersection'](_0xcda990[_0x32cd('0x32')],_0xcda990[_0x32cd('0x33')]);_0x328abf[_0x32cd('0x36')]=_[_0x32cd('0x37')](_0xcda990[_0x32cd('0x32')],qs['fields'](_0x31932a[_0x32cd('0x33')]['fields']));_0x328abf[_0x32cd('0x36')]=_0x328abf['attributes'][_0x32cd('0x38')]?_0x328abf['attributes']:_0xcda990['model'];if(!_0x31932a[_0x32cd('0x33')][_0x32cd('0x39')](_0x32cd('0x3a'))){_0x328abf[_0x32cd('0x1e')]=qs[_0x32cd('0x1e')](_0x31932a[_0x32cd('0x33')][_0x32cd('0x1e')]);_0x328abf[_0x32cd('0x1d')]=qs[_0x32cd('0x1d')](_0x31932a[_0x32cd('0x33')][_0x32cd('0x1d')]);}_0x328abf[_0x32cd('0x3b')]=qs[_0x32cd('0x3c')](_0x31932a[_0x32cd('0x33')][_0x32cd('0x3c')]);_0x328abf[_0x32cd('0x3d')]=qs[_0x32cd('0x35')](_['pick'](_0x31932a[_0x32cd('0x33')],_0xcda990[_0x32cd('0x35')]),_0x4d3570);if(_0x31932a[_0x32cd('0x33')][_0x32cd('0x3e')]){_0x328abf['where']=_[_0x32cd('0x3f')](_0x328abf[_0x32cd('0x3d')],{'$or':_['map'](_0x4d3570,function(_0x15c3b1){if(_0x15c3b1[_0x32cd('0x30')]!==_0x32cd('0x40')){var _0x1fbcbb={};_0x1fbcbb[_0x15c3b1['name']]={'$like':'%'+_0x31932a[_0x32cd('0x33')]['filter']+'%'};return _0x1fbcbb;}})});}_0x328abf=_[_0x32cd('0x3f')]({},_0x328abf,_0x31932a[_0x32cd('0x41')]);var _0x1036a9={'where':_0x328abf[_0x32cd('0x3d')]};return db[_0x32cd('0x2d')][_0x32cd('0x1c')](_0x1036a9)['then'](function(_0x27a40e){_0x268a83[_0x32cd('0x1c')]=_0x27a40e;if(_0x31932a[_0x32cd('0x33')][_0x32cd('0x42')]){_0x328abf[_0x32cd('0x43')]=[{'all':!![]}];}return db[_0x32cd('0x2d')][_0x32cd('0x44')](_0x328abf);})[_0x32cd('0x25')](function(_0x532760){_0x268a83[_0x32cd('0x45')]=_0x532760;return _0x268a83;})[_0x32cd('0x25')](respondWithFilteredResult(_0x3add90,_0x328abf))['catch'](handleError(_0x3add90,null));};exports[_0x32cd('0x46')]=function(_0x3bdf04,_0x1edb38){var _0x4970e0={'raw':![],'where':{'id':_0x3bdf04[_0x32cd('0x47')]['id']}},_0x583228={};_0x583228[_0x32cd('0x32')]=_[_0x32cd('0x34')](db[_0x32cd('0x2d')][_0x32cd('0x2e')]);_0x583228['query']=_[_0x32cd('0x34')](_0x3bdf04[_0x32cd('0x33')]);_0x583228[_0x32cd('0x35')]=_[_0x32cd('0x37')](_0x583228[_0x32cd('0x32')],_0x583228[_0x32cd('0x33')]);_0x4970e0['attributes']=_['intersection'](_0x583228[_0x32cd('0x32')],qs[_0x32cd('0x48')](_0x3bdf04[_0x32cd('0x33')][_0x32cd('0x48')]));_0x4970e0[_0x32cd('0x36')]=_0x4970e0['attributes']['length']?_0x4970e0[_0x32cd('0x36')]:_0x583228[_0x32cd('0x32')];if(_0x3bdf04[_0x32cd('0x33')]['includeAll']){_0x4970e0['include']=[{'all':!![]}];}_0x4970e0=_[_0x32cd('0x3f')]({},_0x4970e0,_0x3bdf04[_0x32cd('0x41')]);return db[_0x32cd('0x2d')][_0x32cd('0x49')](_0x4970e0)[_0x32cd('0x25')](handleEntityNotFound(_0x1edb38,null))['then'](respondWithResult(_0x1edb38,null))[_0x32cd('0x4a')](handleError(_0x1edb38,null));};exports[_0x32cd('0x4b')]=function(_0x4b0408,_0x28a37b){return db[_0x32cd('0x2d')]['create'](_0x4b0408[_0x32cd('0x4c')],{})[_0x32cd('0x25')](respondWithResult(_0x28a37b,0xc9))[_0x32cd('0x4a')](handleError(_0x28a37b,null));};exports[_0x32cd('0x24')]=function(_0x547780,_0x5498cc){if(_0x547780['body']['id']){delete _0x547780[_0x32cd('0x4c')]['id'];}return db[_0x32cd('0x2d')][_0x32cd('0x49')]({'where':{'id':_0x547780[_0x32cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x5498cc,null))[_0x32cd('0x25')](saveUpdates(_0x547780[_0x32cd('0x4c')],null))[_0x32cd('0x25')](respondWithResult(_0x5498cc,null))[_0x32cd('0x4a')](handleError(_0x5498cc,null));};exports[_0x32cd('0x26')]=function(_0x5bf1ed,_0x5929de){return db[_0x32cd('0x2d')][_0x32cd('0x49')]({'where':{'id':_0x5bf1ed[_0x32cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x5929de,null))['then'](removeEntity(_0x5929de,null))['catch'](handleError(_0x5929de,null));};exports[_0x32cd('0x4d')]=function(_0x1fe9c7,_0x9c2aa0){return db[_0x32cd('0x2d')][_0x32cd('0x4d')]()[_0x32cd('0x25')](respondWithResult(_0x9c2aa0,null))[_0x32cd('0x4a')](handleError(_0x9c2aa0,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 144aabb..9d259bc 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 _0x92bc=['exports','define','IntegrationReport','report_integration','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x92bc,0x159));var _0xc92b=function(_0x7ef830,_0x38cb58){_0x7ef830=_0x7ef830-0x0;var _0x3f015f=_0x92bc[_0x7ef830];return _0x3f015f;};'use strict';var _=require('lodash');var util=require(_0xc92b('0x0'));var logger=require('../../config/logger')(_0xc92b('0x1'));var moment=require(_0xc92b('0x2'));var BPromise=require(_0xc92b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc92b('0x4'));var rimraf=require(_0xc92b('0x5'));var config=require(_0xc92b('0x6'));var attributes=require('./integrationReport.attributes');module[_0xc92b('0x7')]=function(_0x1e2628,_0x3ce728){return _0x1e2628[_0xc92b('0x8')](_0xc92b('0x9'),attributes,{'tableName':_0xc92b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0663=['bluebird','request-promise','rimraf','../../config/environment','exports','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0663,0x193));var _0x3066=function(_0xe554bf,_0x4d68fc){_0xe554bf=_0xe554bf-0x0;var _0x2ed500=_0x0663[_0xe554bf];return _0x2ed500;};'use strict';var _=require(_0x3066('0x0'));var util=require(_0x3066('0x1'));var logger=require(_0x3066('0x2'))(_0x3066('0x3'));var moment=require(_0x3066('0x4'));var BPromise=require(_0x3066('0x5'));var rp=require(_0x3066('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3066('0x7'));var config=require(_0x3066('0x8'));var attributes=require('./integrationReport.attributes');module[_0x3066('0x9')]=function(_0x47714c,_0xb3cf0f){return _0x47714c['define'](_0x3066('0xa'),attributes,{'tableName':_0x3066('0xb'),'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 9b7cf05..91109f4 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x4975,0x86));var _0x5497=function(_0x1805e9,_0x5d7073){_0x1805e9=_0x1805e9-0x0;var _0x12f9fa=_0x4975[_0x1805e9];return _0x12f9fa;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xa7dd32,_0x35561f){var _0x20f2f8=function(_0xe228c1){while(--_0xe228c1){_0xa7dd32['push'](_0xa7dd32['shift']());}};_0x20f2f8(++_0x35561f);}(_0x2ef3,0xba));var _0x32ef=function(_0xe9b377,_0x2121b6){_0xe9b377=_0xe9b377-0x0;var _0x1734f7=_0x2ef3[_0xe9b377];return _0x1734f7;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index da5b0e7..bf38da2 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 _0x6a9a=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','create','post'];(function(_0x1b74c2,_0x2a1c53){var _0x170e1b=function(_0x41619f){while(--_0x41619f){_0x1b74c2['push'](_0x1b74c2['shift']());}};_0x170e1b(++_0x2a1c53);}(_0x6a9a,0x1bd));var _0xa6a9=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x6a9a[_0x562f3b];return _0x1edd55;};'use strict';var multer=require(_0xa6a9('0x0'));var util=require(_0xa6a9('0x1'));var path=require('path');var timeout=require(_0xa6a9('0x2'));var express=require(_0xa6a9('0x3'));var router=express['Router']();var fs_extra=require(_0xa6a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa6a9('0x5'));var config=require(_0xa6a9('0x6'));var controller=require('./interval.controller');router[_0xa6a9('0x7')]('/',auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x9')]);router[_0xa6a9('0x7')](_0xa6a9('0xa'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0xb')]);router[_0xa6a9('0x7')](_0xa6a9('0xc'),auth[_0xa6a9('0x8')](),controller['getIntervals']);router['post']('/',auth[_0xa6a9('0x8')](),controller[_0xa6a9('0xd')]);router[_0xa6a9('0xe')](_0xa6a9('0xc'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0xf')]);router[_0xa6a9('0xe')](_0xa6a9('0x10'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x11')]);router[_0xa6a9('0x12')](_0xa6a9('0xa'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x13')]);router[_0xa6a9('0x14')](_0xa6a9('0xa'),auth[_0xa6a9('0x8')](),controller[_0xa6a9('0x15')]);module[_0xa6a9('0x16')]=router; \ No newline at end of file +var _0xe57d=['../../components/interaction/service','./interval.controller','isAuthenticated','index','get','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe57d,0xd7));var _0xde57=function(_0x3ee244,_0x2e67db){_0x3ee244=_0x3ee244-0x0;var _0x2e75ee=_0xe57d[_0x3ee244];return _0x2e75ee;};'use strict';var multer=require(_0xde57('0x0'));var util=require('util');var path=require(_0xde57('0x1'));var timeout=require(_0xde57('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xde57('0x3'));var auth=require(_0xde57('0x4'));var interaction=require(_0xde57('0x5'));var config=require('../../config/environment');var controller=require(_0xde57('0x6'));router['get']('/',auth[_0xde57('0x7')](),controller[_0xde57('0x8')]);router[_0xde57('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xde57('0xa')]);router['get'](_0xde57('0xb'),auth[_0xde57('0x7')](),controller[_0xde57('0xc')]);router['post']('/',auth[_0xde57('0x7')](),controller['create']);router[_0xde57('0xd')](_0xde57('0xb'),auth[_0xde57('0x7')](),controller[_0xde57('0xe')]);router['post']('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller['addIntervals']);router['put'](_0xde57('0xf'),auth[_0xde57('0x7')](),controller[_0xde57('0x10')]);router[_0xde57('0x11')]('/:id',auth[_0xde57('0x7')](),controller[_0xde57('0x12')]);module[_0xde57('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ccce9ca..e9f2da4 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 _0x153e=['sequelize','exports','STRING'];(function(_0x532476,_0x4499df){var _0x84eeae=function(_0x2e64e9){while(--_0x2e64e9){_0x532476['push'](_0x532476['shift']());}};_0x84eeae(++_0x4499df);}(_0x153e,0x144));var _0xe153=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x153e[_0x374ada];return _0x449ed8;};'use strict';var Sequelize=require(_0xe153('0x0'));module[_0xe153('0x1')]={'name':{'type':Sequelize[_0xe153('0x2')]},'description':{'type':Sequelize[_0xe153('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd111=['sequelize','exports','STRING'];(function(_0x4b3bf6,_0x96c151){var _0x4a1aa0=function(_0x3abf2b){while(--_0x3abf2b){_0x4b3bf6['push'](_0x4b3bf6['shift']());}};_0x4a1aa0(++_0x96c151);}(_0xd111,0x10e));var _0x1d11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd111[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1d11('0x0'));module[_0x1d11('0x1')]={'name':{'type':Sequelize[_0x1d11('0x2')]},'description':{'type':Sequelize[_0x1d11('0x2')]},'interval':{'type':Sequelize[_0x1d11('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8d1cb93..817386c 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 _0xa36e=['model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','Interval','include','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','transaction','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','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','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Intervals','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key'];(function(_0x256b1e,_0x4573f4){var _0x724522=function(_0xf047d9){while(--_0xf047d9){_0x256b1e['push'](_0x256b1e['shift']());}};_0x724522(++_0x4573f4);}(_0xa36e,0x1ef));var _0xea36=function(_0x42f8e7,_0x4c5af4){_0x42f8e7=_0x42f8e7-0x0;var _0x152117=_0xa36e[_0x42f8e7];return _0x152117;};'use strict';var emlformat=require(_0xea36('0x0'));var rimraf=require(_0xea36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea36('0x2'));var rp=require('request-promise');var moment=require(_0xea36('0x3'));var BPromise=require(_0xea36('0x4'));var Mustache=require(_0xea36('0x5'));var util=require(_0xea36('0x6'));var path=require('path');var sox=require(_0xea36('0x7'));var csv=require('to-csv');var ejs=require(_0xea36('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea36('0x9'));var crypto=require(_0xea36('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xea36('0xb'));var toCsv=require(_0xea36('0xc'));var querystring=require(_0xea36('0xd'));var Papa=require(_0xea36('0xe'));var Redis=require(_0xea36('0xf'));var authService=require(_0xea36('0x10'));var qs=require(_0xea36('0x11'));var as=require(_0xea36('0x12'));var hardwareService=require(_0xea36('0x13'));var logger=require(_0xea36('0x14'))('api');var utils=require(_0xea36('0x15'));var config=require(_0xea36('0x16'));var licenseUtil=require(_0xea36('0x17'));var db=require(_0xea36('0x18'))['db'];var extensions=require(_0xea36('0x19'));function respondWithStatusCode(_0x356c4f,_0x5ae86d){_0x5ae86d=_0x5ae86d||0xcc;return function(_0x4f0878){if(_0x4f0878){return _0x356c4f[_0xea36('0x1a')](_0x5ae86d);}return _0x356c4f[_0xea36('0x1b')](_0x5ae86d)[_0xea36('0x1c')]();};}function respondWithResult(_0x4fde88,_0x20b943){_0x20b943=_0x20b943||0xc8;return function(_0x4082eb){if(_0x4082eb){return _0x4fde88[_0xea36('0x1b')](_0x20b943)[_0xea36('0x1d')](_0x4082eb);}};}function respondWithFilteredResult(_0x3d6aa1,_0x3d27dc){return function(_0x5dce5c){if(_0x5dce5c){var _0x2f9bee=typeof _0x3d27dc[_0xea36('0x1e')]===_0xea36('0x1f')&&typeof _0x3d27dc[_0xea36('0x20')]===_0xea36('0x1f');var _0x320906=_0x5dce5c[_0xea36('0x21')];var _0x4af38f=_0x2f9bee?0x0:_0x3d27dc[_0xea36('0x1e')];var _0x371ace=_0x2f9bee?_0x5dce5c[_0xea36('0x21')]:_0x3d27dc[_0xea36('0x1e')]+_0x3d27dc['limit'];var _0x59e4ca;if(_0x371ace>=_0x320906){_0x371ace=_0x320906;_0x59e4ca=0xc8;}else{_0x59e4ca=0xce;}_0x3d6aa1[_0xea36('0x1b')](_0x59e4ca);return _0x3d6aa1[_0xea36('0x22')]('Content-Range',_0x4af38f+'-'+_0x371ace+'/'+_0x320906)['json'](_0x5dce5c);}return null;};}function patchUpdates(_0xa4bf08){return function(_0xf216c9){try{jsonpatch[_0xea36('0x23')](_0xf216c9,_0xa4bf08,!![]);}catch(_0xe99e9f){return BPromise[_0xea36('0x24')](_0xe99e9f);}return _0xf216c9[_0xea36('0x25')]();};}function saveUpdates(_0x1ed2bc,_0x3f1964){return function(_0x20902a){if(_0x20902a){return _0x20902a[_0xea36('0x26')](_0x1ed2bc)[_0xea36('0x27')](function(_0x194d22){return _0x194d22;});}return null;};}function removeEntity(_0x3d1a9f,_0x3ca07a){return function(_0x19e90c){if(_0x19e90c){return _0x19e90c['destroy']()[_0xea36('0x27')](function(){var _0x323c63=_0x19e90c[_0xea36('0x28')]({'plain':!![]});var _0x4cb74a=_0xea36('0x29');return db[_0xea36('0x2a')]['destroy']({'where':{'type':_0x4cb74a,'resourceId':_0x323c63['id']}})[_0xea36('0x27')](function(){return _0x19e90c;});})[_0xea36('0x27')](function(){_0x3d1a9f[_0xea36('0x1b')](0xcc)[_0xea36('0x1c')]();});}};}function handleEntityNotFound(_0x1f4bce,_0x4d002d){return function(_0x6a2cce){if(!_0x6a2cce){_0x1f4bce[_0xea36('0x1a')](0x194);}return _0x6a2cce;};}function handleError(_0x2cf59a,_0xb6e376){_0xb6e376=_0xb6e376||0x1f4;return function(_0x3a37a9){logger['error'](_0x3a37a9[_0xea36('0x2b')]);if(_0x3a37a9[_0xea36('0x2c')]){delete _0x3a37a9['name'];}_0x2cf59a[_0xea36('0x1b')](_0xb6e376)[_0xea36('0x2d')](_0x3a37a9);};}exports[_0xea36('0x2e')]=function(_0x2ca65a,_0x399175){var _0x2a004b={},_0x2009aa={},_0x5a4d29={'count':0x0,'rows':[]};var _0x460eb5=_[_0xea36('0x2f')](db['Interval'][_0xea36('0x30')],function(_0x2708d4){return{'name':_0x2708d4[_0xea36('0x31')],'type':_0x2708d4['type'][_0xea36('0x32')]};});_0x2009aa[_0xea36('0x33')]=_[_0xea36('0x2f')](_0x460eb5,_0xea36('0x2c'));_0x2009aa[_0xea36('0x34')]=_['keys'](_0x2ca65a[_0xea36('0x34')]);_0x2009aa[_0xea36('0x35')]=_[_0xea36('0x36')](_0x2009aa[_0xea36('0x33')],_0x2009aa[_0xea36('0x34')]);_0x2a004b['attributes']=_[_0xea36('0x36')](_0x2009aa[_0xea36('0x33')],qs[_0xea36('0x37')](_0x2ca65a[_0xea36('0x34')][_0xea36('0x37')]));_0x2a004b[_0xea36('0x38')]=_0x2a004b['attributes'][_0xea36('0x39')]?_0x2a004b[_0xea36('0x38')]:_0x2009aa[_0xea36('0x33')];if(!_0x2ca65a[_0xea36('0x34')][_0xea36('0x3a')](_0xea36('0x3b'))){_0x2a004b['limit']=qs[_0xea36('0x20')](_0x2ca65a[_0xea36('0x34')][_0xea36('0x20')]);_0x2a004b[_0xea36('0x1e')]=qs['offset'](_0x2ca65a[_0xea36('0x34')]['offset']);}_0x2a004b['order']=qs[_0xea36('0x3c')](_0x2ca65a[_0xea36('0x34')][_0xea36('0x3c')]);_0x2a004b[_0xea36('0x3d')]=qs[_0xea36('0x35')](_[_0xea36('0x3e')](_0x2ca65a[_0xea36('0x34')],_0x2009aa[_0xea36('0x35')]),_0x460eb5);if(_0x2ca65a[_0xea36('0x34')][_0xea36('0x3f')]){_0x2a004b[_0xea36('0x3d')]=_[_0xea36('0x40')](_0x2a004b['where'],{'$or':_[_0xea36('0x2f')](_0x460eb5,function(_0x251df0){if(_0x251df0[_0xea36('0x41')]!==_0xea36('0x42')){var _0x1bf5e1={};_0x1bf5e1[_0x251df0['name']]={'$like':'%'+_0x2ca65a['query']['filter']+'%'};return _0x1bf5e1;}})});}_0x2a004b=_['merge']({},_0x2a004b,_0x2ca65a[_0xea36('0x43')]);var _0x447873={'where':_0x2a004b[_0xea36('0x3d')]};return db[_0xea36('0x44')]['count'](_0x447873)[_0xea36('0x27')](function(_0x2096cd){_0x5a4d29[_0xea36('0x21')]=_0x2096cd;if(_0x2ca65a[_0xea36('0x34')]['includeAll']){_0x2a004b[_0xea36('0x45')]=[{'all':!![]}];}return db[_0xea36('0x44')]['findAll'](_0x2a004b);})[_0xea36('0x27')](function(_0x4010e3){_0x5a4d29['rows']=_0x4010e3;return _0x5a4d29;})[_0xea36('0x27')](respondWithFilteredResult(_0x399175,_0x2a004b))[_0xea36('0x46')](handleError(_0x399175,null));};exports['show']=function(_0x27dd41,_0x215d1f){var _0xc8a55e={'raw':!![],'where':{'id':_0x27dd41[_0xea36('0x47')]['id']}},_0x197eca={};_0x197eca[_0xea36('0x33')]=_[_0xea36('0x48')](db[_0xea36('0x44')][_0xea36('0x30')]);_0x197eca[_0xea36('0x34')]=_[_0xea36('0x48')](_0x27dd41[_0xea36('0x34')]);_0x197eca[_0xea36('0x35')]=_[_0xea36('0x36')](_0x197eca[_0xea36('0x33')],_0x197eca[_0xea36('0x34')]);_0xc8a55e[_0xea36('0x38')]=_[_0xea36('0x36')](_0x197eca[_0xea36('0x33')],qs[_0xea36('0x37')](_0x27dd41[_0xea36('0x34')][_0xea36('0x37')]));_0xc8a55e[_0xea36('0x38')]=_0xc8a55e[_0xea36('0x38')]['length']?_0xc8a55e[_0xea36('0x38')]:_0x197eca['model'];if(_0x27dd41[_0xea36('0x34')]['includeAll']){_0xc8a55e[_0xea36('0x45')]=[{'all':!![]}];}_0xc8a55e=_['merge']({},_0xc8a55e,_0x27dd41[_0xea36('0x43')]);return db[_0xea36('0x44')][_0xea36('0x49')](_0xc8a55e)[_0xea36('0x27')](handleEntityNotFound(_0x215d1f,null))[_0xea36('0x27')](respondWithResult(_0x215d1f,null))[_0xea36('0x46')](handleError(_0x215d1f,null));};exports[_0xea36('0x4a')]=function(_0x3e8be3,_0xfb858a){return db['Interval']['create'](_0x3e8be3['body'],{})['then'](function(_0x4d6495){var _0x26314e=_0x3e8be3[_0xea36('0x4b')][_0xea36('0x28')]({'plain':!![]});if(!_0x26314e)throw new Error(_0xea36('0x4c'));if(_0x26314e[_0xea36('0x4d')]===_0xea36('0x4b')){var _0x23ff73=_0x4d6495[_0xea36('0x28')]({'plain':!![]});var _0x2a6214=_0xea36('0x29');return db[_0xea36('0x4e')][_0xea36('0x49')]({'where':{'name':_0x2a6214,'userProfileId':_0x26314e[_0xea36('0x4f')]},'raw':!![]})[_0xea36('0x27')](function(_0x4ecc1a){if(_0x4ecc1a&&_0x4ecc1a['autoAssociation']===0x0){return db[_0xea36('0x2a')]['create']({'name':_0x23ff73[_0xea36('0x2c')],'resourceId':_0x23ff73['id'],'type':_0x4ecc1a['name'],'sectionId':_0x4ecc1a['id']},{})[_0xea36('0x27')](function(){return _0x4d6495;});}else{return _0x4d6495;}})[_0xea36('0x46')](function(_0x555253){logger[_0xea36('0x50')](_0xea36('0x51'),_0x555253);throw _0x555253;});}return _0x4d6495;})[_0xea36('0x27')](respondWithResult(_0xfb858a,0xc9))[_0xea36('0x46')](handleError(_0xfb858a,null));};exports[_0xea36('0x26')]=function(_0x5efa28,_0x3d1c31){if(_0x5efa28[_0xea36('0x52')]['id']){delete _0x5efa28[_0xea36('0x52')]['id'];}return db[_0xea36('0x44')][_0xea36('0x49')]({'where':{'id':_0x5efa28[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x3d1c31,null))[_0xea36('0x27')](saveUpdates(_0x5efa28['body'],null))[_0xea36('0x27')](respondWithResult(_0x3d1c31,null))[_0xea36('0x46')](handleError(_0x3d1c31,null));};exports[_0xea36('0x53')]=function(_0x222c46,_0x1e1151){return db[_0xea36('0x44')][_0xea36('0x49')]({'where':{'id':_0x222c46[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x1e1151,null))[_0xea36('0x27')](removeEntity(_0x1e1151,null))[_0xea36('0x46')](handleError(_0x1e1151,null));};exports[_0xea36('0x54')]=function(_0x3a9032,_0x434239,_0xbde81b){if(_0x3a9032[_0xea36('0x52')]['id']){delete _0x3a9032[_0xea36('0x52')]['id'];}return db[_0xea36('0x44')][_0xea36('0x49')]({'where':{'id':_0x3a9032['params']['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x434239,null))['then'](function(_0x43beb6){if(_0x43beb6){_0x3a9032[_0xea36('0x52')][_0xea36('0x55')]=_0x43beb6['id'];return db['Interval'][_0xea36('0x4a')](_0x3a9032['body']);}})[_0xea36('0x27')](respondWithResult(_0x434239,null))['catch'](handleError(_0x434239,null));};exports[_0xea36('0x56')]=function(_0x5ce46e,_0x2c741a,_0x7daf3c){var _0x20d44f={};var _0x20d559={};var _0x14c702;var _0x5c2376;return db[_0xea36('0x44')][_0xea36('0x57')]({'where':{'id':_0x5ce46e[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x2c741a,null))[_0xea36('0x27')](function(_0x3630fb){if(_0x3630fb){_0x14c702=_0x3630fb;_0x20d559[_0xea36('0x33')]=_['keys'](db[_0xea36('0x44')]['rawAttributes']);_0x20d559[_0xea36('0x34')]=_[_0xea36('0x48')](_0x5ce46e[_0xea36('0x34')]);_0x20d559[_0xea36('0x35')]=_['intersection'](_0x20d559[_0xea36('0x33')],_0x20d559[_0xea36('0x34')]);_0x20d44f['attributes']=_[_0xea36('0x36')](_0x20d559[_0xea36('0x33')],qs[_0xea36('0x37')](_0x5ce46e['query'][_0xea36('0x37')]));_0x20d44f[_0xea36('0x38')]=_0x20d44f[_0xea36('0x38')]['length']?_0x20d44f[_0xea36('0x38')]:_0x20d559[_0xea36('0x33')];_0x20d44f[_0xea36('0x58')]=qs['sort'](_0x5ce46e[_0xea36('0x34')][_0xea36('0x3c')]);_0x20d44f[_0xea36('0x3d')]=qs['filters'](_['pick'](_0x5ce46e['query'],_0x20d559[_0xea36('0x35')]));if(_0x5ce46e[_0xea36('0x34')][_0xea36('0x3f')]){_0x20d44f['where']=_[_0xea36('0x40')](_0x20d44f[_0xea36('0x3d')],{'$or':_[_0xea36('0x2f')](_0x20d44f['attributes'],function(_0x25aa3c){var _0x3e9d00={};_0x3e9d00[_0x25aa3c]={'$like':'%'+_0x5ce46e[_0xea36('0x34')][_0xea36('0x3f')]+'%'};return _0x3e9d00;})});}_0x20d44f=_[_0xea36('0x40')]({},_0x20d44f,_0x5ce46e[_0xea36('0x43')]);return _0x14c702[_0xea36('0x56')](_0x20d44f);}})[_0xea36('0x27')](function(_0x55542b){if(_0x55542b){_0x5c2376=_0x55542b[_0xea36('0x39')];if(!_0x5ce46e[_0xea36('0x34')]['hasOwnProperty'](_0xea36('0x3b'))){_0x20d44f['limit']=qs[_0xea36('0x20')](_0x5ce46e[_0xea36('0x34')][_0xea36('0x20')]);_0x20d44f[_0xea36('0x1e')]=qs[_0xea36('0x1e')](_0x5ce46e['query'][_0xea36('0x1e')]);}return _0x14c702[_0xea36('0x56')](_0x20d44f);}})[_0xea36('0x27')](function(_0x1218e7){if(_0x1218e7){return _0x1218e7?{'count':_0x5c2376,'rows':_0x1218e7}:null;}})[_0xea36('0x27')](respondWithResult(_0x2c741a,null))['catch'](handleError(_0x2c741a,null));};exports[_0xea36('0x59')]=function(_0x405664,_0x14e54e,_0xed4bd1){return db['Interval'][_0xea36('0x57')]({'where':{'id':_0x405664[_0xea36('0x47')]['id']}})[_0xea36('0x27')](handleEntityNotFound(_0x14e54e,null))['then'](function(_0x2f5b4d){if(_0x2f5b4d){return db['sequelize'][_0xea36('0x5a')](function(_0x403f4f){return db[_0xea36('0x44')]['destroy']({'where':{'IntervalId':_0x405664[_0xea36('0x47')]['id']},'transaction':_0x403f4f})[_0xea36('0x27')](function(_0xffe78d){var _0x1fa313=_[_0xea36('0x2f')](_0x405664['body'],function(_0x7543cc){delete _0x7543cc['id'];_0x7543cc[_0xea36('0x55')]=_0x405664[_0xea36('0x47')]['id'];return _0x7543cc;});return db[_0xea36('0x44')]['bulkCreate'](_0x1fa313,{'transaction':_0x403f4f});});})[_0xea36('0x27')](function(){return db[_0xea36('0x44')]['findAll']({'where':{'IntervalId':_0x405664[_0xea36('0x47')]['id']}});});}})['then'](respondWithResult(_0x14e54e,null))[_0xea36('0x46')](handleError(_0x14e54e,null));}; \ No newline at end of file +var _0x8da1=['order','sort','where','pick','merge','VIRTUAL','options','Interval','includeAll','include','rows','catch','show','params','rawAttributes','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','create','error','body','IntervalId','findOne','length','filter','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','end','sendStatus','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x32f562,_0x1543e2){var _0x4799b9=function(_0x40395c){while(--_0x40395c){_0x32f562['push'](_0x32f562['shift']());}};_0x4799b9(++_0x1543e2);}(_0x8da1,0x7a));var _0x18da=function(_0x3209f2,_0x5c51e2){_0x3209f2=_0x3209f2-0x0;var _0x56aabc=_0x8da1[_0x3209f2];return _0x56aabc;};'use strict';var emlformat=require(_0x18da('0x0'));var rimraf=require(_0x18da('0x1'));var zipdir=require(_0x18da('0x2'));var jsonpatch=require(_0x18da('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x18da('0x4'));var util=require(_0x18da('0x5'));var path=require(_0x18da('0x6'));var sox=require(_0x18da('0x7'));var csv=require(_0x18da('0x8'));var ejs=require(_0x18da('0x9'));var fs=require('fs');var fs_extra=require(_0x18da('0xa'));var _=require('lodash');var squel=require(_0x18da('0xb'));var crypto=require(_0x18da('0xc'));var jsforce=require(_0x18da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x18da('0x8'));var querystring=require(_0x18da('0xe'));var Papa=require(_0x18da('0xf'));var Redis=require(_0x18da('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x18da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x18da('0x12'))('api');var utils=require(_0x18da('0x13'));var config=require(_0x18da('0x14'));var licenseUtil=require(_0x18da('0x15'));var db=require('../../mysqldb')['db'];var extensions=require(_0x18da('0x16'));function respondWithStatusCode(_0x25f2ba,_0x5c1ca4){_0x5c1ca4=_0x5c1ca4||0xcc;return function(_0x150801){if(_0x150801){return _0x25f2ba['sendStatus'](_0x5c1ca4);}return _0x25f2ba[_0x18da('0x17')](_0x5c1ca4)['end']();};}function respondWithResult(_0x5ec917,_0xc1d62a){_0xc1d62a=_0xc1d62a||0xc8;return function(_0x3db3bf){if(_0x3db3bf){return _0x5ec917[_0x18da('0x17')](_0xc1d62a)[_0x18da('0x18')](_0x3db3bf);}};}function respondWithFilteredResult(_0x38c988,_0x34a727){return function(_0x21fba5){if(_0x21fba5){var _0x4052d4=typeof _0x34a727[_0x18da('0x19')]===_0x18da('0x1a')&&typeof _0x34a727['limit']===_0x18da('0x1a');var _0x383587=_0x21fba5[_0x18da('0x1b')];var _0x44c531=_0x4052d4?0x0:_0x34a727[_0x18da('0x19')];var _0x2b7501=_0x4052d4?_0x21fba5[_0x18da('0x1b')]:_0x34a727[_0x18da('0x19')]+_0x34a727[_0x18da('0x1c')];var _0x245744;if(_0x2b7501>=_0x383587){_0x2b7501=_0x383587;_0x245744=0xc8;}else{_0x245744=0xce;}_0x38c988[_0x18da('0x17')](_0x245744);return _0x38c988['set']('Content-Range',_0x44c531+'-'+_0x2b7501+'/'+_0x383587)['json'](_0x21fba5);}return null;};}function patchUpdates(_0x4c32a6){return function(_0x1d49cd){try{jsonpatch[_0x18da('0x1d')](_0x1d49cd,_0x4c32a6,!![]);}catch(_0x12d197){return BPromise[_0x18da('0x1e')](_0x12d197);}return _0x1d49cd[_0x18da('0x1f')]();};}function saveUpdates(_0x3d1ce6,_0x5e65bb){return function(_0x1600bb){if(_0x1600bb){return _0x1600bb[_0x18da('0x20')](_0x3d1ce6)[_0x18da('0x21')](function(_0x174ba5){return _0x174ba5;});}return null;};}function removeEntity(_0x3e602a,_0xb0deb9){return function(_0x2123fc){if(_0x2123fc){return _0x2123fc[_0x18da('0x22')]()[_0x18da('0x21')](function(){var _0x2df9d4=_0x2123fc[_0x18da('0x23')]({'plain':!![]});var _0x164318=_0x18da('0x24');return db[_0x18da('0x25')][_0x18da('0x22')]({'where':{'type':_0x164318,'resourceId':_0x2df9d4['id']}})['then'](function(){return _0x2123fc;});})[_0x18da('0x21')](function(){_0x3e602a[_0x18da('0x17')](0xcc)[_0x18da('0x26')]();});}};}function handleEntityNotFound(_0x14ec9e,_0xccb29){return function(_0x571b07){if(!_0x571b07){_0x14ec9e[_0x18da('0x27')](0x194);}return _0x571b07;};}function handleError(_0x4b29ba,_0x3e85cb){_0x3e85cb=_0x3e85cb||0x1f4;return function(_0x1762f6){logger['error'](_0x1762f6[_0x18da('0x28')]);if(_0x1762f6[_0x18da('0x29')]){delete _0x1762f6[_0x18da('0x29')];}_0x4b29ba[_0x18da('0x17')](_0x3e85cb)[_0x18da('0x2a')](_0x1762f6);};}exports[_0x18da('0x2b')]=function(_0x379d08,_0xe03e47){var _0x5a8d03={},_0x5c6e1d={},_0x464ce0={'count':0x0,'rows':[]};var _0x4101f0=_[_0x18da('0x2c')](db['Interval']['rawAttributes'],function(_0x5f060f){return{'name':_0x5f060f[_0x18da('0x2d')],'type':_0x5f060f[_0x18da('0x2e')][_0x18da('0x2f')]};});_0x5c6e1d[_0x18da('0x30')]=_[_0x18da('0x2c')](_0x4101f0,'name');_0x5c6e1d['query']=_[_0x18da('0x31')](_0x379d08[_0x18da('0x32')]);_0x5c6e1d[_0x18da('0x33')]=_[_0x18da('0x34')](_0x5c6e1d['model'],_0x5c6e1d[_0x18da('0x32')]);_0x5a8d03['attributes']=_[_0x18da('0x34')](_0x5c6e1d[_0x18da('0x30')],qs[_0x18da('0x35')](_0x379d08['query'][_0x18da('0x35')]));_0x5a8d03[_0x18da('0x36')]=_0x5a8d03[_0x18da('0x36')]['length']?_0x5a8d03[_0x18da('0x36')]:_0x5c6e1d[_0x18da('0x30')];if(!_0x379d08[_0x18da('0x32')][_0x18da('0x37')]('nolimit')){_0x5a8d03[_0x18da('0x1c')]=qs['limit'](_0x379d08[_0x18da('0x32')][_0x18da('0x1c')]);_0x5a8d03['offset']=qs[_0x18da('0x19')](_0x379d08['query'][_0x18da('0x19')]);}_0x5a8d03[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x379d08[_0x18da('0x32')][_0x18da('0x39')]);_0x5a8d03[_0x18da('0x3a')]=qs[_0x18da('0x33')](_[_0x18da('0x3b')](_0x379d08[_0x18da('0x32')],_0x5c6e1d[_0x18da('0x33')]),_0x4101f0);if(_0x379d08['query']['filter']){_0x5a8d03['where']=_[_0x18da('0x3c')](_0x5a8d03['where'],{'$or':_[_0x18da('0x2c')](_0x4101f0,function(_0x3d5983){if(_0x3d5983[_0x18da('0x2e')]!==_0x18da('0x3d')){var _0x2907c2={};_0x2907c2[_0x3d5983[_0x18da('0x29')]]={'$like':'%'+_0x379d08[_0x18da('0x32')]['filter']+'%'};return _0x2907c2;}})});}_0x5a8d03=_[_0x18da('0x3c')]({},_0x5a8d03,_0x379d08[_0x18da('0x3e')]);var _0x30cec6={'where':_0x5a8d03[_0x18da('0x3a')]};return db[_0x18da('0x3f')]['count'](_0x30cec6)[_0x18da('0x21')](function(_0x899c51){_0x464ce0[_0x18da('0x1b')]=_0x899c51;if(_0x379d08[_0x18da('0x32')][_0x18da('0x40')]){_0x5a8d03[_0x18da('0x41')]=[{'all':!![]}];}return db[_0x18da('0x3f')]['findAll'](_0x5a8d03);})[_0x18da('0x21')](function(_0x4c210e){_0x464ce0[_0x18da('0x42')]=_0x4c210e;return _0x464ce0;})['then'](respondWithFilteredResult(_0xe03e47,_0x5a8d03))[_0x18da('0x43')](handleError(_0xe03e47,null));};exports[_0x18da('0x44')]=function(_0x1659a1,_0x169631){var _0x450539={'raw':!![],'where':{'id':_0x1659a1[_0x18da('0x45')]['id']}},_0x4bfafb={};_0x4bfafb['model']=_['keys'](db['Interval'][_0x18da('0x46')]);_0x4bfafb[_0x18da('0x32')]=_[_0x18da('0x31')](_0x1659a1[_0x18da('0x32')]);_0x4bfafb[_0x18da('0x33')]=_[_0x18da('0x34')](_0x4bfafb[_0x18da('0x30')],_0x4bfafb[_0x18da('0x32')]);_0x450539['attributes']=_[_0x18da('0x34')](_0x4bfafb[_0x18da('0x30')],qs[_0x18da('0x35')](_0x1659a1[_0x18da('0x32')][_0x18da('0x35')]));_0x450539[_0x18da('0x36')]=_0x450539['attributes']['length']?_0x450539[_0x18da('0x36')]:_0x4bfafb['model'];if(_0x1659a1[_0x18da('0x32')][_0x18da('0x40')]){_0x450539[_0x18da('0x41')]=[{'all':!![]}];}_0x450539=_[_0x18da('0x3c')]({},_0x450539,_0x1659a1['options']);return db[_0x18da('0x3f')][_0x18da('0x47')](_0x450539)[_0x18da('0x21')](handleEntityNotFound(_0x169631,null))[_0x18da('0x21')](respondWithResult(_0x169631,null))[_0x18da('0x43')](handleError(_0x169631,null));};exports['create']=function(_0x39d0ea,_0x1108ff){return db[_0x18da('0x3f')]['create'](_0x39d0ea['body'],{})['then'](function(_0x37da26){var _0x1a7b3b=_0x39d0ea['user'][_0x18da('0x23')]({'plain':!![]});if(!_0x1a7b3b)throw new Error(_0x18da('0x48'));if(_0x1a7b3b[_0x18da('0x49')]===_0x18da('0x4a')){var _0x2f5b7f=_0x37da26['get']({'plain':!![]});var _0x298de5='Intervals';return db[_0x18da('0x4b')][_0x18da('0x47')]({'where':{'name':_0x298de5,'userProfileId':_0x1a7b3b[_0x18da('0x4c')]},'raw':!![]})[_0x18da('0x21')](function(_0x3af336){if(_0x3af336&&_0x3af336['autoAssociation']===0x0){return db[_0x18da('0x25')][_0x18da('0x4d')]({'name':_0x2f5b7f[_0x18da('0x29')],'resourceId':_0x2f5b7f['id'],'type':_0x3af336[_0x18da('0x29')],'sectionId':_0x3af336['id']},{})[_0x18da('0x21')](function(){return _0x37da26;});}else{return _0x37da26;}})[_0x18da('0x43')](function(_0x4bc978){logger[_0x18da('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bc978);throw _0x4bc978;});}return _0x37da26;})['then'](respondWithResult(_0x1108ff,0xc9))[_0x18da('0x43')](handleError(_0x1108ff,null));};exports[_0x18da('0x20')]=function(_0x3dc61c,_0x57e03b){if(_0x3dc61c['body']['id']){delete _0x3dc61c[_0x18da('0x4f')]['id'];}return db[_0x18da('0x3f')]['find']({'where':{'id':_0x3dc61c[_0x18da('0x45')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x57e03b,null))[_0x18da('0x21')](saveUpdates(_0x3dc61c[_0x18da('0x4f')],null))[_0x18da('0x21')](respondWithResult(_0x57e03b,null))[_0x18da('0x43')](handleError(_0x57e03b,null));};exports[_0x18da('0x22')]=function(_0x5edb0f,_0x2bc0e7){return db[_0x18da('0x3f')]['find']({'where':{'id':_0x5edb0f['params']['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x2bc0e7,null))[_0x18da('0x21')](removeEntity(_0x2bc0e7,null))[_0x18da('0x43')](handleError(_0x2bc0e7,null));};exports['addInterval']=function(_0x10088a,_0x4a129c,_0xf0258e){if(_0x10088a[_0x18da('0x4f')]['id']){delete _0x10088a['body']['id'];}return db[_0x18da('0x3f')]['find']({'where':{'id':_0x10088a[_0x18da('0x45')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x4a129c,null))[_0x18da('0x21')](function(_0x183611){if(_0x183611){_0x10088a[_0x18da('0x4f')][_0x18da('0x50')]=_0x183611['id'];return db[_0x18da('0x3f')][_0x18da('0x4d')](_0x10088a[_0x18da('0x4f')]);}})['then'](respondWithResult(_0x4a129c,null))[_0x18da('0x43')](handleError(_0x4a129c,null));};exports['getIntervals']=function(_0x753683,_0x11113d,_0x1765b1){var _0x35b689={};var _0x414c83={};var _0xbca052;var _0xae305f;return db[_0x18da('0x3f')][_0x18da('0x51')]({'where':{'id':_0x753683['params']['id']}})['then'](handleEntityNotFound(_0x11113d,null))[_0x18da('0x21')](function(_0x1aedf1){if(_0x1aedf1){_0xbca052=_0x1aedf1;_0x414c83[_0x18da('0x30')]=_[_0x18da('0x31')](db['Interval']['rawAttributes']);_0x414c83[_0x18da('0x32')]=_[_0x18da('0x31')](_0x753683['query']);_0x414c83[_0x18da('0x33')]=_[_0x18da('0x34')](_0x414c83[_0x18da('0x30')],_0x414c83[_0x18da('0x32')]);_0x35b689[_0x18da('0x36')]=_[_0x18da('0x34')](_0x414c83['model'],qs[_0x18da('0x35')](_0x753683['query'][_0x18da('0x35')]));_0x35b689[_0x18da('0x36')]=_0x35b689['attributes'][_0x18da('0x52')]?_0x35b689[_0x18da('0x36')]:_0x414c83[_0x18da('0x30')];_0x35b689['order']=qs[_0x18da('0x39')](_0x753683[_0x18da('0x32')][_0x18da('0x39')]);_0x35b689[_0x18da('0x3a')]=qs[_0x18da('0x33')](_[_0x18da('0x3b')](_0x753683['query'],_0x414c83[_0x18da('0x33')]));if(_0x753683['query'][_0x18da('0x53')]){_0x35b689[_0x18da('0x3a')]=_['merge'](_0x35b689[_0x18da('0x3a')],{'$or':_['map'](_0x35b689['attributes'],function(_0x481183){var _0x489ccb={};_0x489ccb[_0x481183]={'$like':'%'+_0x753683[_0x18da('0x32')]['filter']+'%'};return _0x489ccb;})});}_0x35b689=_[_0x18da('0x3c')]({},_0x35b689,_0x753683[_0x18da('0x3e')]);return _0xbca052[_0x18da('0x54')](_0x35b689);}})['then'](function(_0x4b4dc9){if(_0x4b4dc9){_0xae305f=_0x4b4dc9[_0x18da('0x52')];if(!_0x753683['query'][_0x18da('0x37')]('nolimit')){_0x35b689[_0x18da('0x1c')]=qs[_0x18da('0x1c')](_0x753683[_0x18da('0x32')]['limit']);_0x35b689[_0x18da('0x19')]=qs[_0x18da('0x19')](_0x753683[_0x18da('0x32')][_0x18da('0x19')]);}return _0xbca052[_0x18da('0x54')](_0x35b689);}})[_0x18da('0x21')](function(_0x512594){if(_0x512594){return _0x512594?{'count':_0xae305f,'rows':_0x512594}:null;}})[_0x18da('0x21')](respondWithResult(_0x11113d,null))['catch'](handleError(_0x11113d,null));};exports[_0x18da('0x55')]=function(_0x223e40,_0x332d5e,_0x597411){return db[_0x18da('0x3f')][_0x18da('0x51')]({'where':{'id':_0x223e40[_0x18da('0x45')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x332d5e,null))['then'](function(_0x2d3a62){if(_0x2d3a62){return db[_0x18da('0x56')][_0x18da('0x57')](function(_0x4ca33a){return db[_0x18da('0x3f')][_0x18da('0x22')]({'where':{'IntervalId':_0x223e40[_0x18da('0x45')]['id']},'transaction':_0x4ca33a})[_0x18da('0x21')](function(_0x1f5c64){var _0x2a643c=_[_0x18da('0x2c')](_0x223e40[_0x18da('0x4f')],function(_0x8d519f){delete _0x8d519f['id'];_0x8d519f[_0x18da('0x50')]=_0x223e40[_0x18da('0x45')]['id'];return _0x8d519f;});return db[_0x18da('0x3f')][_0x18da('0x58')](_0x2a643c,{'transaction':_0x4ca33a});});})[_0x18da('0x21')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x223e40['params']['id']}});});}})[_0x18da('0x21')](respondWithResult(_0x332d5e,null))[_0x18da('0x43')](handleError(_0x332d5e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6a4ce96..bef9683 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 _0x1f88=['tools_intervals','rewrite','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','Interval'];(function(_0x44b616,_0x3069bf){var _0x47efbf=function(_0x1375ba){while(--_0x1375ba){_0x44b616['push'](_0x44b616['shift']());}};_0x47efbf(++_0x3069bf);}(_0x1f88,0x1a2));var _0x81f8=function(_0x15b590,_0x287a22){_0x15b590=_0x15b590-0x0;var _0x35035e=_0x1f88[_0x15b590];return _0x35035e;};'use strict';var _=require(_0x81f8('0x0'));var util=require(_0x81f8('0x1'));var logger=require('../../config/logger')(_0x81f8('0x2'));var moment=require(_0x81f8('0x3'));var BPromise=require(_0x81f8('0x4'));var rp=require(_0x81f8('0x5'));var fs=require('fs');var path=require(_0x81f8('0x6'));var rimraf=require(_0x81f8('0x7'));var config=require(_0x81f8('0x8'));var attributes=require(_0x81f8('0x9'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x52cbb8,_0xb61a1c){return _0x52cbb8['define'](_0x81f8('0xa'),attributes,{'tableName':_0x81f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dee15,_0x578825){extensions[_0x81f8('0xc')](_0x52cbb8,_0x3dee15);},'afterBulkCreate':function(_0x5ef820,_0x2eadc5,_0xe2dbba){_0xe2dbba();extensions[_0x81f8('0xc')](_0x52cbb8,_0x5ef820[0x0]);},'afterUpdate':function(_0x473aa3,_0x37c20f){extensions[_0x81f8('0xc')](_0x52cbb8,_0x473aa3);},'afterDestroy':function(_0xe346b7,_0x18738c){extensions[_0x81f8('0xc')](_0x52cbb8,_0xe346b7);}}});}; \ No newline at end of file +var _0xcac3=['Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x331bd7,_0x452028){var _0x5d025b=function(_0x39328e){while(--_0x39328e){_0x331bd7['push'](_0x331bd7['shift']());}};_0x5d025b(++_0x452028);}(_0xcac3,0x193));var _0x3cac=function(_0x47c53e,_0x35f7f3){_0x47c53e=_0x47c53e-0x0;var _0x306afd=_0xcac3[_0x47c53e];return _0x306afd;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var logger=require(_0x3cac('0x1'))(_0x3cac('0x2'));var moment=require(_0x3cac('0x3'));var BPromise=require(_0x3cac('0x4'));var rp=require(_0x3cac('0x5'));var fs=require('fs');var path=require(_0x3cac('0x6'));var rimraf=require(_0x3cac('0x7'));var config=require(_0x3cac('0x8'));var attributes=require(_0x3cac('0x9'));var extensions=require(_0x3cac('0xa'));module[_0x3cac('0xb')]=function(_0x35c687,_0x1e2560){return _0x35c687[_0x3cac('0xc')](_0x3cac('0xd'),attributes,{'tableName':_0x3cac('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55670d,_0x3cbf8d){extensions[_0x3cac('0xf')](_0x35c687,_0x55670d);},'afterBulkCreate':function(_0x3bcbed,_0x306664,_0x131e0d){_0x131e0d();extensions['rewrite'](_0x35c687,_0x3bcbed[0x0]);},'afterUpdate':function(_0x1e8fef,_0x169e39){extensions[_0x3cac('0xf')](_0x35c687,_0x1e8fef);},'afterDestroy':function(_0x2fa907,_0x1c5c70){extensions['rewrite'](_0x35c687,_0x2fa907);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 2f67ca9..394bf90 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_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 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(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 2848a39..d71737b 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0xfd7a7c,_0x2dba3e){var _0xf2cb93=function(_0x1dff14){while(--_0x1dff14){_0xfd7a7c['push'](_0xfd7a7c['shift']());}};_0xf2cb93(++_0x2dba3e);}(_0xadb5,0xad));var _0x5adb=function(_0x57ea42,_0x2c79ea){_0x57ea42=_0x57ea42-0x0;var _0x5ceedb=_0xadb5[_0x57ea42];return _0x5ceedb;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x1969f4,_0x533bc3){var _0x1fc47b=function(_0x115a5b){while(--_0x115a5b){_0x1969f4['push'](_0x1969f4['shift']());}};_0x1fc47b(++_0x533bc3);}(_0x2ef3,0xba));var _0x32ef=function(_0x243829,_0x53a2db){_0x243829=_0x243829-0x0;var _0x452490=_0x2ef3[_0x243829];return _0x452490;};'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 4701d11..ec127aa 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 _0xd85e=['fields','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','issuetype','Bug','customfield_11500','email'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd85e,0x135));var _0xed85=function(_0x548bfc,_0x3fcb77){_0x548bfc=_0x548bfc-0x0;var _0x12cf16=_0xd85e[_0x548bfc];return _0x12cf16;};'use strict';var BPromise=require(_0xed85('0x0'));var https=require(_0xed85('0x1'));var logger=require(_0xed85('0x2'))('api');var USERNAME=_0xed85('0x3');var PASSWORD=_0xed85('0x4');function openIssue(_0x34d2a0,_0x1cfcb5){var _0x17586b={'fields':{'project':{'key':_0x34d2a0[_0xed85('0x5')]||_0xed85('0x6')},'summary':(_0x34d2a0[_0xed85('0x7')]||_0xed85('0x8'))+'\x20from\x20'+_0x34d2a0['ip'],'description':_0x34d2a0['description']||JSON['stringify'](_0x34d2a0),'issuetype':{'name':_0x34d2a0[_0xed85('0x9')]||_0xed85('0xa')}}};_0x17586b['fields'][_0xed85('0xb')]=_0x34d2a0[_0xed85('0xc')];_0x17586b[_0xed85('0xd')][_0xed85('0xe')]=_0x34d2a0[_0xed85('0xf')];_0x17586b[_0xed85('0xd')][_0xed85('0x10')]=_0x34d2a0[_0xed85('0x11')];_0x17586b[_0xed85('0xd')]['customfield_11503']=_0x34d2a0[_0xed85('0x12')];_0x17586b[_0xed85('0xd')][_0xed85('0x13')]=_0x34d2a0[_0xed85('0x14')];_0x17586b['fields'][_0xed85('0x15')]=_0x34d2a0['ip'];var _0x27996e={'host':_0xed85('0x16'),'port':0x1bb,'path':_0xed85('0x17'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xed85('0x18'),'Authorization':_0xed85('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xed85('0x1a')](_0xed85('0x1b'))}};var _0x1b0637=JSON['stringify'](_0x17586b);var _0x42a0b1=https[_0xed85('0x1c')](_0x27996e,function(_0x199342){_0x199342[_0xed85('0x1d')](_0xed85('0x1e'));var _0x3a2db2='';_0x199342['on'](_0xed85('0x1f'),function(_0x200c32){_0x3a2db2+=_0x200c32;});_0x199342['on'](_0xed85('0x20'),function(){if(_0x1cfcb5){return _0x1cfcb5[_0xed85('0x21')](_0x199342[_0xed85('0x22')])[_0xed85('0x23')](JSON[_0xed85('0x24')](_0x3a2db2));}});});_0x42a0b1['on'](_0xed85('0x25'),function(_0x2358c1){if(_0x1cfcb5){return _0x1cfcb5[_0xed85('0x21')](0x1f4)[_0xed85('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xed85('0x26')}]});}});_0x42a0b1[_0xed85('0x27')](_0x1b0637);_0x42a0b1[_0xed85('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0xf5988,_0x4044a8){_0xf5988[_0xed85('0x28')]['ip']=_0xf5988[_0xed85('0x29')][_0xed85('0x2a')]||_0xf5988['connection'][_0xed85('0x2b')]||_0xf5988[_0xed85('0x2c')]['remoteAddress']||_0xf5988[_0xed85('0x2d')][_0xed85('0x2c')][_0xed85('0x2b')];return openIssue(_0xf5988[_0xed85('0x28')],_0x4044a8);}; \ No newline at end of file +var _0xfb3d=['../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','name','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https'];(function(_0x1e5324,_0x7f93b5){var _0x45e348=function(_0x3e607b){while(--_0x3e607b){_0x1e5324['push'](_0x1e5324['shift']());}};_0x45e348(++_0x7f93b5);}(_0xfb3d,0x19c));var _0xdfb3=function(_0x50e63a,_0x564f77){_0x50e63a=_0x50e63a-0x0;var _0x534f37=_0xfb3d[_0x50e63a];return _0x534f37;};'use strict';var BPromise=require(_0xdfb3('0x0'));var https=require(_0xdfb3('0x1'));var logger=require(_0xdfb3('0x2'))(_0xdfb3('0x3'));var USERNAME=_0xdfb3('0x4');var PASSWORD=_0xdfb3('0x5');function openIssue(_0x29cc65,_0x460634){var _0x32d026={'fields':{'project':{'key':_0x29cc65[_0xdfb3('0x6')]||_0xdfb3('0x7')},'summary':(_0x29cc65[_0xdfb3('0x8')]||_0xdfb3('0x9'))+_0xdfb3('0xa')+_0x29cc65['ip'],'description':_0x29cc65[_0xdfb3('0xb')]||JSON[_0xdfb3('0xc')](_0x29cc65),'issuetype':{'name':_0x29cc65[_0xdfb3('0xd')]||_0xdfb3('0xe')}}};_0x32d026[_0xdfb3('0xf')][_0xdfb3('0x10')]=_0x29cc65[_0xdfb3('0x11')];_0x32d026[_0xdfb3('0xf')][_0xdfb3('0x12')]=_0x29cc65[_0xdfb3('0x13')];_0x32d026['fields']['customfield_11502']=_0x29cc65[_0xdfb3('0x14')];_0x32d026['fields']['customfield_11503']=_0x29cc65[_0xdfb3('0x15')];_0x32d026[_0xdfb3('0xf')]['customfield_11504']=_0x29cc65[_0xdfb3('0x16')];_0x32d026[_0xdfb3('0xf')]['customfield_10102']=_0x29cc65['ip'];var _0x484065={'host':_0xdfb3('0x17'),'port':0x1bb,'path':_0xdfb3('0x18'),'method':_0xdfb3('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0xdfb3('0x1a'),'Authorization':_0xdfb3('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0xdfb3('0x1c')](_0xdfb3('0x1d'))}};var _0x2e03e5=JSON['stringify'](_0x32d026);var _0x2e8618=https[_0xdfb3('0x1e')](_0x484065,function(_0x39bc24){_0x39bc24[_0xdfb3('0x1f')](_0xdfb3('0x20'));var _0x644d52='';_0x39bc24['on'](_0xdfb3('0x21'),function(_0x485895){_0x644d52+=_0x485895;});_0x39bc24['on'](_0xdfb3('0x22'),function(){if(_0x460634){return _0x460634[_0xdfb3('0x23')](_0x39bc24['statusCode'])[_0xdfb3('0x24')](JSON[_0xdfb3('0x25')](_0x644d52));}});});_0x2e8618['on']('error',function(_0x1b976d){if(_0x460634){return _0x460634['status'](0x1f4)[_0xdfb3('0x24')]({'errors':[{'message':_0xdfb3('0x26'),'type':'api.jira'}]});}});_0x2e8618[_0xdfb3('0x27')](_0x2e03e5);_0x2e8618['end']();}exports['openIssue']=openIssue;exports[_0xdfb3('0x28')]=function(_0x1a9b85,_0x2ad6a1){_0x1a9b85[_0xdfb3('0x29')]['ip']=_0x1a9b85['headers'][_0xdfb3('0x2a')]||_0x1a9b85[_0xdfb3('0x2b')][_0xdfb3('0x2c')]||_0x1a9b85[_0xdfb3('0x2d')][_0xdfb3('0x2c')]||_0x1a9b85[_0xdfb3('0x2b')][_0xdfb3('0x2d')][_0xdfb3('0x2c')];return openIssue(_0x1a9b85[_0xdfb3('0x29')],_0x2ad6a1);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index c3034d1..3d16b5f 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 _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x3b516c,_0x60d7ea){var _0xef2c01=function(_0x249550){while(--_0x249550){_0x3b516c['push'](_0x3b516c['shift']());}};_0xef2c01(++_0x60d7ea);}(_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')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x3213bf,_0x1c32b6){var _0x1a62a9=function(_0x51edc8){while(--_0x51edc8){_0x3213bf['push'](_0x3213bf['shift']());}};_0x1a62a9(++_0x1c32b6);}(_0x0bb5,0x148));var _0x50bb=function(_0x4fd23c,_0x5b911e){_0x4fd23c=_0x4fd23c-0x0;var _0x24462f=_0x0bb5[_0x4fd23c];return _0x24462f;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 875dcd1..2ed033d 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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x402f38,_0x241309){_0x402f38=_0x402f38-0x0;var _0x5bf1b2=_0x7a54[_0x402f38];return _0x5bf1b2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x56538d,_0x382c90){_0x56538d=_0x56538d-0x0;var _0x258281=_0x7a54[_0x56538d];return _0x258281;};'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 dac4df2..6ab166c 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 _0x044a=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','apply','reject','update','then','stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','create','body','params','destroy'];(function(_0x52966e,_0x529901){var _0xc948f3=function(_0xa51438){while(--_0xa51438){_0x52966e['push'](_0x52966e['shift']());}};_0xc948f3(++_0x529901);}(_0x044a,0x173));var _0xa044=function(_0x252d5c,_0x453602){_0x252d5c=_0x252d5c-0x0;var _0x5bd321=_0x044a[_0x252d5c];return _0x5bd321;};'use strict';var emlformat=require(_0xa044('0x0'));var rimraf=require(_0xa044('0x1'));var zipdir=require(_0xa044('0x2'));var jsonpatch=require(_0xa044('0x3'));var rp=require(_0xa044('0x4'));var moment=require(_0xa044('0x5'));var BPromise=require(_0xa044('0x6'));var Mustache=require(_0xa044('0x7'));var util=require(_0xa044('0x8'));var path=require(_0xa044('0x9'));var sox=require('sox');var csv=require(_0xa044('0xa'));var ejs=require(_0xa044('0xb'));var fs=require('fs');var fs_extra=require(_0xa044('0xc'));var _=require(_0xa044('0xd'));var squel=require('squel');var crypto=require(_0xa044('0xe'));var jsforce=require(_0xa044('0xf'));var deskjs=require(_0xa044('0x10'));var toCsv=require(_0xa044('0xa'));var querystring=require('querystring');var Papa=require(_0xa044('0x11'));var Redis=require(_0xa044('0x12'));var authService=require(_0xa044('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa044('0x14'));var hardwareService=require(_0xa044('0x15'));var logger=require(_0xa044('0x16'))(_0xa044('0x17'));var utils=require('../../config/utils');var config=require(_0xa044('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ee43,_0x3e05cf){_0x3e05cf=_0x3e05cf||0xcc;return function(_0x2b73a1){if(_0x2b73a1){return _0x1ee43[_0xa044('0x19')](_0x3e05cf);}return _0x1ee43[_0xa044('0x1a')](_0x3e05cf)[_0xa044('0x1b')]();};}function respondWithResult(_0xe9a838,_0x4bec52){_0x4bec52=_0x4bec52||0xc8;return function(_0x31c5ae){if(_0x31c5ae){return _0xe9a838['status'](_0x4bec52)[_0xa044('0x1c')](_0x31c5ae);}};}function respondWithFilteredResult(_0x44c658,_0x141d1a){return function(_0x3bc2c9){if(_0x3bc2c9){var _0xeb7e4e=typeof _0x141d1a['offset']==='undefined'&&typeof _0x141d1a[_0xa044('0x1d')]==='undefined';var _0x3ca144=_0x3bc2c9[_0xa044('0x1e')];var _0x1b43c1=_0xeb7e4e?0x0:_0x141d1a[_0xa044('0x1f')];var _0x3ccbd3=_0xeb7e4e?_0x3bc2c9['count']:_0x141d1a['offset']+_0x141d1a['limit'];var _0x39422b;if(_0x3ccbd3>=_0x3ca144){_0x3ccbd3=_0x3ca144;_0x39422b=0xc8;}else{_0x39422b=0xce;}_0x44c658[_0xa044('0x1a')](_0x39422b);return _0x44c658[_0xa044('0x20')]('Content-Range',_0x1b43c1+'-'+_0x3ccbd3+'/'+_0x3ca144)[_0xa044('0x1c')](_0x3bc2c9);}return null;};}function patchUpdates(_0x19854d){return function(_0x4e0202){try{jsonpatch[_0xa044('0x21')](_0x4e0202,_0x19854d,!![]);}catch(_0x40999a){return BPromise[_0xa044('0x22')](_0x40999a);}return _0x4e0202['save']();};}function saveUpdates(_0x2e3468,_0x966548){return function(_0x26747b){if(_0x26747b){return _0x26747b[_0xa044('0x23')](_0x2e3468)[_0xa044('0x24')](function(_0x3f4d03){return _0x3f4d03;});}return null;};}function removeEntity(_0x18af4c,_0x46f14c){return function(_0x36c237){if(_0x36c237){return _0x36c237['destroy']()['then'](function(){_0x18af4c[_0xa044('0x1a')](0xcc)[_0xa044('0x1b')]();});}};}function handleEntityNotFound(_0x228d5e,_0x4c3d4b){return function(_0x418756){if(!_0x418756){_0x228d5e[_0xa044('0x19')](0x194);}return _0x418756;};}function handleError(_0x4e9357,_0x38bdd7){_0x38bdd7=_0x38bdd7||0x1f4;return function(_0x6746e8){logger['error'](_0x6746e8[_0xa044('0x25')]);if(_0x6746e8[_0xa044('0x26')]){delete _0x6746e8['name'];}_0x4e9357['status'](_0x38bdd7)['send'](_0x6746e8);};}exports[_0xa044('0x27')]=function(_0x159519,_0x1362ef){var _0x4c72f3={},_0x267512={},_0x300b6e={'count':0x0,'rows':[]};var _0x485212=_[_0xa044('0x28')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x1cb1be){return{'name':_0x1cb1be['fieldName'],'type':_0x1cb1be[_0xa044('0x29')][_0xa044('0x2a')]};});_0x267512[_0xa044('0x2b')]=_[_0xa044('0x28')](_0x485212,_0xa044('0x26'));_0x267512[_0xa044('0x2c')]=_['keys'](_0x159519[_0xa044('0x2c')]);_0x267512[_0xa044('0x2d')]=_[_0xa044('0x2e')](_0x267512[_0xa044('0x2b')],_0x267512['query']);_0x4c72f3[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x267512['model'],qs['fields'](_0x159519[_0xa044('0x2c')][_0xa044('0x30')]));_0x4c72f3['attributes']=_0x4c72f3[_0xa044('0x2f')][_0xa044('0x31')]?_0x4c72f3[_0xa044('0x2f')]:_0x267512['model'];if(!_0x159519[_0xa044('0x2c')][_0xa044('0x32')](_0xa044('0x33'))){_0x4c72f3[_0xa044('0x1d')]=qs[_0xa044('0x1d')](_0x159519['query'][_0xa044('0x1d')]);_0x4c72f3[_0xa044('0x1f')]=qs[_0xa044('0x1f')](_0x159519['query'][_0xa044('0x1f')]);}_0x4c72f3[_0xa044('0x34')]=qs['sort'](_0x159519[_0xa044('0x2c')][_0xa044('0x35')]);_0x4c72f3[_0xa044('0x36')]=qs[_0xa044('0x2d')](_[_0xa044('0x37')](_0x159519[_0xa044('0x2c')],_0x267512[_0xa044('0x2d')]),_0x485212);if(_0x159519[_0xa044('0x2c')]['filter']){_0x4c72f3[_0xa044('0x36')]=_[_0xa044('0x38')](_0x4c72f3[_0xa044('0x36')],{'$or':_[_0xa044('0x28')](_0x485212,function(_0x20509c){if(_0x20509c['type']!==_0xa044('0x39')){var _0x529be2={};_0x529be2[_0x20509c[_0xa044('0x26')]]={'$like':'%'+_0x159519[_0xa044('0x2c')]['filter']+'%'};return _0x529be2;}})});}_0x4c72f3=_['merge']({},_0x4c72f3,_0x159519['options']);var _0x22386d={'where':_0x4c72f3[_0xa044('0x36')]};return db[_0xa044('0x3a')][_0xa044('0x1e')](_0x22386d)[_0xa044('0x24')](function(_0x73aa8b){_0x300b6e[_0xa044('0x1e')]=_0x73aa8b;if(_0x159519[_0xa044('0x2c')][_0xa044('0x3b')]){_0x4c72f3[_0xa044('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa044('0x3d')](_0x4c72f3);})[_0xa044('0x24')](function(_0x1e84c1){_0x300b6e[_0xa044('0x3e')]=_0x1e84c1;return _0x300b6e;})[_0xa044('0x24')](respondWithFilteredResult(_0x1362ef,_0x4c72f3))[_0xa044('0x3f')](handleError(_0x1362ef,null));};exports[_0xa044('0x40')]=function(_0xc9246f,_0x2863a5){var _0x1f1c35={'raw':!![],'where':{'id':_0xc9246f['params']['id']}},_0x4b9cf6={};_0x4b9cf6[_0xa044('0x2b')]=_['keys'](db[_0xa044('0x3a')][_0xa044('0x41')]);_0x4b9cf6[_0xa044('0x2c')]=_[_0xa044('0x42')](_0xc9246f[_0xa044('0x2c')]);_0x4b9cf6[_0xa044('0x2d')]=_['intersection'](_0x4b9cf6[_0xa044('0x2b')],_0x4b9cf6['query']);_0x1f1c35[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x4b9cf6[_0xa044('0x2b')],qs['fields'](_0xc9246f['query'][_0xa044('0x30')]));_0x1f1c35[_0xa044('0x2f')]=_0x1f1c35[_0xa044('0x2f')][_0xa044('0x31')]?_0x1f1c35[_0xa044('0x2f')]:_0x4b9cf6[_0xa044('0x2b')];if(_0xc9246f['query'][_0xa044('0x3b')]){_0x1f1c35[_0xa044('0x3c')]=[{'all':!![]}];}_0x1f1c35=_[_0xa044('0x38')]({},_0x1f1c35,_0xc9246f[_0xa044('0x43')]);return db[_0xa044('0x3a')][_0xa044('0x44')](_0x1f1c35)[_0xa044('0x24')](handleEntityNotFound(_0x2863a5,null))[_0xa044('0x24')](respondWithResult(_0x2863a5,null))[_0xa044('0x3f')](handleError(_0x2863a5,null));};exports[_0xa044('0x45')]=function(_0x13e4e3,_0x3d303a){return db[_0xa044('0x3a')]['create'](_0x13e4e3[_0xa044('0x46')],{})[_0xa044('0x24')](respondWithResult(_0x3d303a,0xc9))[_0xa044('0x3f')](handleError(_0x3d303a,null));};exports[_0xa044('0x23')]=function(_0x6bf8a0,_0x230ecf){if(_0x6bf8a0[_0xa044('0x46')]['id']){delete _0x6bf8a0['body']['id'];}return db['JscriptyAnswerReport'][_0xa044('0x44')]({'where':{'id':_0x6bf8a0[_0xa044('0x47')]['id']}})[_0xa044('0x24')](handleEntityNotFound(_0x230ecf,null))[_0xa044('0x24')](saveUpdates(_0x6bf8a0['body'],null))[_0xa044('0x24')](respondWithResult(_0x230ecf,null))[_0xa044('0x3f')](handleError(_0x230ecf,null));};exports[_0xa044('0x48')]=function(_0x390d24,_0x1b7877){return db[_0xa044('0x3a')]['find']({'where':{'id':_0x390d24[_0xa044('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7877,null))['then'](removeEntity(_0x1b7877,null))[_0xa044('0x3f')](handleError(_0x1b7877,null));};exports[_0xa044('0x49')]=function(_0x3ea870,_0x187ebd){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x187ebd,null))[_0xa044('0x3f')](handleError(_0x187ebd,null));}; \ No newline at end of file +var _0x565f=['JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','merge','where','count','include','findAll','rows','catch','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../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','set','apply','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x541ff1,_0x423d89){var _0x3f6f=function(_0x15b160){while(--_0x15b160){_0x541ff1['push'](_0x541ff1['shift']());}};_0x3f6f(++_0x423d89);}(_0x565f,0x68));var _0xf565=function(_0x2a82d3,_0x3d708d){_0x2a82d3=_0x2a82d3-0x0;var _0x46396b=_0x565f[_0x2a82d3];return _0x46396b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf565('0x0'));var zipdir=require(_0xf565('0x1'));var jsonpatch=require(_0xf565('0x2'));var rp=require('request-promise');var moment=require(_0xf565('0x3'));var BPromise=require(_0xf565('0x4'));var Mustache=require(_0xf565('0x5'));var util=require(_0xf565('0x6'));var path=require(_0xf565('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf565('0x8'));var _=require('lodash');var squel=require(_0xf565('0x9'));var crypto=require(_0xf565('0xa'));var jsforce=require(_0xf565('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf565('0xc'));var querystring=require('querystring');var Papa=require(_0xf565('0xd'));var Redis=require('ioredis');var authService=require(_0xf565('0xe'));var qs=require(_0xf565('0xf'));var as=require(_0xf565('0x10'));var hardwareService=require(_0xf565('0x11'));var logger=require(_0xf565('0x12'))(_0xf565('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf565('0x14'));var db=require(_0xf565('0x15'))['db'];function respondWithStatusCode(_0xd29dae,_0xb66e55){_0xb66e55=_0xb66e55||0xcc;return function(_0xa56a8b){if(_0xa56a8b){return _0xd29dae[_0xf565('0x16')](_0xb66e55);}return _0xd29dae[_0xf565('0x17')](_0xb66e55)[_0xf565('0x18')]();};}function respondWithResult(_0x3b7abc,_0x366ac2){_0x366ac2=_0x366ac2||0xc8;return function(_0x4f926d){if(_0x4f926d){return _0x3b7abc[_0xf565('0x17')](_0x366ac2)[_0xf565('0x19')](_0x4f926d);}};}function respondWithFilteredResult(_0x4c209f,_0x394e33){return function(_0x2cd6a8){if(_0x2cd6a8){var _0x468d80=typeof _0x394e33[_0xf565('0x1a')]===_0xf565('0x1b')&&typeof _0x394e33['limit']===_0xf565('0x1b');var _0x4e7abb=_0x2cd6a8['count'];var _0x3d0412=_0x468d80?0x0:_0x394e33[_0xf565('0x1a')];var _0x4fb154=_0x468d80?_0x2cd6a8['count']:_0x394e33[_0xf565('0x1a')]+_0x394e33['limit'];var _0x248111;if(_0x4fb154>=_0x4e7abb){_0x4fb154=_0x4e7abb;_0x248111=0xc8;}else{_0x248111=0xce;}_0x4c209f[_0xf565('0x17')](_0x248111);return _0x4c209f[_0xf565('0x1c')]('Content-Range',_0x3d0412+'-'+_0x4fb154+'/'+_0x4e7abb)['json'](_0x2cd6a8);}return null;};}function patchUpdates(_0xb7b197){return function(_0x3a8a09){try{jsonpatch[_0xf565('0x1d')](_0x3a8a09,_0xb7b197,!![]);}catch(_0x4114d0){return BPromise[_0xf565('0x1e')](_0x4114d0);}return _0x3a8a09['save']();};}function saveUpdates(_0x436a7d,_0x24aa90){return function(_0x282f3a){if(_0x282f3a){return _0x282f3a[_0xf565('0x1f')](_0x436a7d)[_0xf565('0x20')](function(_0x2c67a6){return _0x2c67a6;});}return null;};}function removeEntity(_0xe23d61,_0x139915){return function(_0x11d948){if(_0x11d948){return _0x11d948[_0xf565('0x21')]()['then'](function(){_0xe23d61[_0xf565('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46da9b,_0x2df868){return function(_0x50da32){if(!_0x50da32){_0x46da9b[_0xf565('0x16')](0x194);}return _0x50da32;};}function handleError(_0xe06651,_0x2e8f6b){_0x2e8f6b=_0x2e8f6b||0x1f4;return function(_0x33e81c){logger[_0xf565('0x22')](_0x33e81c[_0xf565('0x23')]);if(_0x33e81c[_0xf565('0x24')]){delete _0x33e81c[_0xf565('0x24')];}_0xe06651['status'](_0x2e8f6b)[_0xf565('0x25')](_0x33e81c);};}exports[_0xf565('0x26')]=function(_0x18082a,_0x2e41e7){var _0x28f75d={},_0x5ecd01={},_0x2288db={'count':0x0,'rows':[]};var _0x2ce91d=_[_0xf565('0x27')](db[_0xf565('0x28')][_0xf565('0x29')],function(_0x5a292c){return{'name':_0x5a292c[_0xf565('0x2a')],'type':_0x5a292c[_0xf565('0x2b')][_0xf565('0x2c')]};});_0x5ecd01[_0xf565('0x2d')]=_[_0xf565('0x27')](_0x2ce91d,_0xf565('0x24'));_0x5ecd01['query']=_[_0xf565('0x2e')](_0x18082a[_0xf565('0x2f')]);_0x5ecd01['filters']=_[_0xf565('0x30')](_0x5ecd01[_0xf565('0x2d')],_0x5ecd01[_0xf565('0x2f')]);_0x28f75d[_0xf565('0x31')]=_[_0xf565('0x30')](_0x5ecd01[_0xf565('0x2d')],qs[_0xf565('0x32')](_0x18082a[_0xf565('0x2f')]['fields']));_0x28f75d[_0xf565('0x31')]=_0x28f75d[_0xf565('0x31')][_0xf565('0x33')]?_0x28f75d['attributes']:_0x5ecd01[_0xf565('0x2d')];if(!_0x18082a[_0xf565('0x2f')][_0xf565('0x34')](_0xf565('0x35'))){_0x28f75d[_0xf565('0x36')]=qs['limit'](_0x18082a[_0xf565('0x2f')]['limit']);_0x28f75d[_0xf565('0x1a')]=qs[_0xf565('0x1a')](_0x18082a['query']['offset']);}_0x28f75d[_0xf565('0x37')]=qs[_0xf565('0x38')](_0x18082a['query'][_0xf565('0x38')]);_0x28f75d['where']=qs['filters'](_['pick'](_0x18082a['query'],_0x5ecd01[_0xf565('0x39')]),_0x2ce91d);if(_0x18082a[_0xf565('0x2f')][_0xf565('0x3a')]){_0x28f75d['where']=_[_0xf565('0x3b')](_0x28f75d[_0xf565('0x3c')],{'$or':_[_0xf565('0x27')](_0x2ce91d,function(_0x5e6c27){if(_0x5e6c27[_0xf565('0x2b')]!=='VIRTUAL'){var _0x2d09fb={};_0x2d09fb[_0x5e6c27[_0xf565('0x24')]]={'$like':'%'+_0x18082a[_0xf565('0x2f')]['filter']+'%'};return _0x2d09fb;}})});}_0x28f75d=_[_0xf565('0x3b')]({},_0x28f75d,_0x18082a['options']);var _0x1da55c={'where':_0x28f75d['where']};return db[_0xf565('0x28')][_0xf565('0x3d')](_0x1da55c)['then'](function(_0x36d030){_0x2288db[_0xf565('0x3d')]=_0x36d030;if(_0x18082a[_0xf565('0x2f')]['includeAll']){_0x28f75d[_0xf565('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xf565('0x3f')](_0x28f75d);})[_0xf565('0x20')](function(_0x3c43ff){_0x2288db[_0xf565('0x40')]=_0x3c43ff;return _0x2288db;})[_0xf565('0x20')](respondWithFilteredResult(_0x2e41e7,_0x28f75d))[_0xf565('0x41')](handleError(_0x2e41e7,null));};exports['show']=function(_0x58cea5,_0x42ebdd){var _0x27cc58={'raw':!![],'where':{'id':_0x58cea5[_0xf565('0x42')]['id']}},_0x40920b={};_0x40920b[_0xf565('0x2d')]=_['keys'](db[_0xf565('0x28')][_0xf565('0x29')]);_0x40920b[_0xf565('0x2f')]=_[_0xf565('0x2e')](_0x58cea5['query']);_0x40920b[_0xf565('0x39')]=_['intersection'](_0x40920b['model'],_0x40920b[_0xf565('0x2f')]);_0x27cc58[_0xf565('0x31')]=_['intersection'](_0x40920b['model'],qs['fields'](_0x58cea5[_0xf565('0x2f')][_0xf565('0x32')]));_0x27cc58[_0xf565('0x31')]=_0x27cc58[_0xf565('0x31')][_0xf565('0x33')]?_0x27cc58[_0xf565('0x31')]:_0x40920b[_0xf565('0x2d')];if(_0x58cea5[_0xf565('0x2f')][_0xf565('0x43')]){_0x27cc58[_0xf565('0x3e')]=[{'all':!![]}];}_0x27cc58=_[_0xf565('0x3b')]({},_0x27cc58,_0x58cea5['options']);return db['JscriptyAnswerReport']['find'](_0x27cc58)[_0xf565('0x20')](handleEntityNotFound(_0x42ebdd,null))[_0xf565('0x20')](respondWithResult(_0x42ebdd,null))[_0xf565('0x41')](handleError(_0x42ebdd,null));};exports['create']=function(_0x4ded10,_0xfd4b53){return db[_0xf565('0x28')][_0xf565('0x44')](_0x4ded10['body'],{})[_0xf565('0x20')](respondWithResult(_0xfd4b53,0xc9))[_0xf565('0x41')](handleError(_0xfd4b53,null));};exports[_0xf565('0x1f')]=function(_0x483632,_0x5b6cbb){if(_0x483632[_0xf565('0x45')]['id']){delete _0x483632['body']['id'];}return db[_0xf565('0x28')][_0xf565('0x46')]({'where':{'id':_0x483632[_0xf565('0x42')]['id']}})[_0xf565('0x20')](handleEntityNotFound(_0x5b6cbb,null))[_0xf565('0x20')](saveUpdates(_0x483632[_0xf565('0x45')],null))[_0xf565('0x20')](respondWithResult(_0x5b6cbb,null))[_0xf565('0x41')](handleError(_0x5b6cbb,null));};exports[_0xf565('0x21')]=function(_0x1a3751,_0x47464e){return db[_0xf565('0x28')][_0xf565('0x46')]({'where':{'id':_0x1a3751[_0xf565('0x42')]['id']}})['then'](handleEntityNotFound(_0x47464e,null))['then'](removeEntity(_0x47464e,null))[_0xf565('0x41')](handleError(_0x47464e,null));};exports[_0xf565('0x47')]=function(_0x567c8e,_0x186f3e){return db[_0xf565('0x28')]['describe']()['then'](respondWithResult(_0x186f3e,null))[_0xf565('0x41')](handleError(_0x186f3e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c431847..1bc30ce 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 _0xb8b5=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util'];(function(_0x5c4297,_0xab577b){var _0x7d19bd=function(_0x4d046a){while(--_0x4d046a){_0x5c4297['push'](_0x5c4297['shift']());}};_0x7d19bd(++_0xab577b);}(_0xb8b5,0xee));var _0x5b8b=function(_0x4f18dd,_0x1f0c8d){_0x4f18dd=_0x4f18dd-0x0;var _0x13c2bc=_0xb8b5[_0x4f18dd];return _0x13c2bc;};'use strict';var _=require(_0x5b8b('0x0'));var util=require(_0x5b8b('0x1'));var logger=require(_0x5b8b('0x2'))('api');var moment=require(_0x5b8b('0x3'));var BPromise=require(_0x5b8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b8b('0x5'));var rimraf=require(_0x5b8b('0x6'));var config=require(_0x5b8b('0x7'));var attributes=require(_0x5b8b('0x8'));module[_0x5b8b('0x9')]=function(_0x46be30,_0x432fbb){return _0x46be30[_0x5b8b('0xa')](_0x5b8b('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5c7=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe5c7,0x18f));var _0x7e5c=function(_0xf2cc8e,_0x17a712){_0xf2cc8e=_0xf2cc8e-0x0;var _0x592804=_0xe5c7[_0xf2cc8e];return _0x592804;};'use strict';var _=require(_0x7e5c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7e5c('0x1'));var moment=require(_0x7e5c('0x2'));var BPromise=require(_0x7e5c('0x3'));var rp=require(_0x7e5c('0x4'));var fs=require('fs');var path=require(_0x7e5c('0x5'));var rimraf=require(_0x7e5c('0x6'));var config=require(_0x7e5c('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0xd859dd,_0x3117c3){return _0xd859dd[_0x7e5c('0x8')](_0x7e5c('0x9'),attributes,{'tableName':_0x7e5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 063a2e7..f02cd00 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 _0x6f4c=['http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x6f4c,0x1f0));var _0xc6f4=function(_0x1a1a1a,_0x606b90){_0x1a1a1a=_0x1a1a1a-0x0;var _0x57cc4a=_0x6f4c[_0x1a1a1a];return _0x57cc4a;};'use strict';var _=require(_0xc6f4('0x0'));var util=require('util');var moment=require(_0xc6f4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc6f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6f4('0x3'))['db'];var utils=require(_0xc6f4('0x4'));var logger=require(_0xc6f4('0x5'))(_0xc6f4('0x6'));var config=require(_0xc6f4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc6f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c0b9a,_0x30c144,_0x5c10d9){return new BPromise(function(_0x3634ae,_0x2b3763){return client[_0xc6f4('0x9')](_0x3c0b9a,_0x5c10d9)[_0xc6f4('0xa')](function(_0x216d1b){logger[_0xc6f4('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30c144,_0xc6f4('0xc'));logger[_0xc6f4('0xd')](_0xc6f4('0xe'),_0x30c144,_0xc6f4('0xc'),JSON[_0xc6f4('0xf')](_0x216d1b));if(_0x216d1b['error']){if(_0x216d1b[_0xc6f4('0x10')]['code']===0x1f4){logger[_0xc6f4('0x10')](_0xc6f4('0x11'),_0x30c144,_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);return _0x2b3763(_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);}logger[_0xc6f4('0x10')](_0xc6f4('0x11'),_0x30c144,_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);return _0x3634ae(_0x216d1b[_0xc6f4('0x10')][_0xc6f4('0x12')]);}else{logger[_0xc6f4('0xb')](_0xc6f4('0x11'),_0x30c144,'request\x20sent');_0x3634ae(_0x216d1b[_0xc6f4('0x13')][_0xc6f4('0x12')]);}})[_0xc6f4('0x14')](function(_0x13c59a){logger[_0xc6f4('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30c144,_0x13c59a);_0x2b3763(_0x13c59a);});});} \ No newline at end of file +var _0x889e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x889e,0x91));var _0xe889=function(_0x1b0343,_0x30d887){_0x1b0343=_0x1b0343-0x0;var _0x55bacd=_0x889e[_0x1b0343];return _0x55bacd;};'use strict';var _=require(_0xe889('0x0'));var util=require(_0xe889('0x1'));var moment=require(_0xe889('0x2'));var BPromise=require(_0xe889('0x3'));var rs=require(_0xe889('0x4'));var fs=require('fs');var Redis=require(_0xe889('0x5'));var db=require(_0xe889('0x6'))['db'];var utils=require(_0xe889('0x7'));var logger=require(_0xe889('0x8'))(_0xe889('0x9'));var config=require(_0xe889('0xa'));var jayson=require(_0xe889('0xb'));var client=jayson[_0xe889('0xc')][_0xe889('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x16b753,_0x2f9174,_0x3bc77c){return new BPromise(function(_0x50f926,_0x3b3ff1){return client[_0xe889('0xe')](_0x16b753,_0x3bc77c)[_0xe889('0xf')](function(_0xf23a2c){logger[_0xe889('0x10')](_0xe889('0x11'),_0x2f9174,_0xe889('0x12'));logger[_0xe889('0x13')](_0xe889('0x14'),_0x2f9174,_0xe889('0x12'),JSON[_0xe889('0x15')](_0xf23a2c));if(_0xf23a2c[_0xe889('0x16')]){if(_0xf23a2c[_0xe889('0x16')][_0xe889('0x17')]===0x1f4){logger[_0xe889('0x16')](_0xe889('0x11'),_0x2f9174,_0xf23a2c[_0xe889('0x16')][_0xe889('0x18')]);return _0x3b3ff1(_0xf23a2c[_0xe889('0x16')]['message']);}logger[_0xe889('0x16')](_0xe889('0x11'),_0x2f9174,_0xf23a2c[_0xe889('0x16')][_0xe889('0x18')]);return _0x50f926(_0xf23a2c[_0xe889('0x16')][_0xe889('0x18')]);}else{logger['info'](_0xe889('0x11'),_0x2f9174,_0xe889('0x12'));_0x50f926(_0xf23a2c['result'][_0xe889('0x18')]);}})['catch'](function(_0x361f21){logger[_0xe889('0x16')](_0xe889('0x11'),_0x2f9174,_0x361f21);_0x3b3ff1(_0x361f21);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e419eb8..b4a8cf8 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 _0x611b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra'];(function(_0x2e6f0f,_0x21a10c){var _0x13c137=function(_0x4c4274){while(--_0x4c4274){_0x2e6f0f['push'](_0x2e6f0f['shift']());}};_0x13c137(++_0x21a10c);}(_0x611b,0x175));var _0xb611=function(_0x1e643a,_0x252f5c){_0x1e643a=_0x1e643a-0x0;var _0x47bb38=_0x611b[_0x1e643a];return _0x47bb38;};'use strict';var multer=require('multer');var util=require(_0xb611('0x0'));var path=require(_0xb611('0x1'));var timeout=require(_0xb611('0x2'));var express=require('express');var router=express[_0xb611('0x3')]();var fs_extra=require(_0xb611('0x4'));var auth=require(_0xb611('0x5'));var interaction=require(_0xb611('0x6'));var config=require(_0xb611('0x7'));var controller=require(_0xb611('0x8'));router[_0xb611('0x9')]('/',auth[_0xb611('0xa')](),controller[_0xb611('0xb')]);router[_0xb611('0x9')](_0xb611('0xc'),auth[_0xb611('0xa')](),controller[_0xb611('0xd')]);router[_0xb611('0x9')]('/:id/sessions',auth[_0xb611('0xa')](),controller[_0xb611('0xe')]);router[_0xb611('0x9')](_0xb611('0xf'),auth[_0xb611('0xa')](),controller[_0xb611('0x10')]);router[_0xb611('0x9')](_0xb611('0x11'),auth[_0xb611('0xa')](),timeout(_0xb611('0x12')),controller[_0xb611('0x13')]);router[_0xb611('0x14')]('/',auth['isAuthenticated'](),controller[_0xb611('0x15')]);router['post'](_0xb611('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0xb611('0x17')](_0xb611('0xc'),auth[_0xb611('0xa')](),controller[_0xb611('0x18')]);router[_0xb611('0x19')](_0xb611('0xc'),auth[_0xb611('0xa')](),controller[_0xb611('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x7ec5=['/:id/clone','clone','put','update','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','post','create'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0x7ec5,0x185));var _0x57ec=function(_0x3a5248,_0x34e201){_0x3a5248=_0x3a5248-0x0;var _0x4175a1=_0x7ec5[_0x3a5248];return _0x4175a1;};'use strict';var multer=require(_0x57ec('0x0'));var util=require(_0x57ec('0x1'));var path=require('path');var timeout=require(_0x57ec('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x57ec('0x3'));var auth=require(_0x57ec('0x4'));var interaction=require(_0x57ec('0x5'));var config=require(_0x57ec('0x6'));var controller=require(_0x57ec('0x7'));router[_0x57ec('0x8')]('/',auth[_0x57ec('0x9')](),controller['index']);router[_0x57ec('0x8')](_0x57ec('0xa'),auth['isAuthenticated'](),controller[_0x57ec('0xb')]);router[_0x57ec('0x8')](_0x57ec('0xc'),auth[_0x57ec('0x9')](),controller[_0x57ec('0xd')]);router[_0x57ec('0x8')](_0x57ec('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x57ec('0x8')](_0x57ec('0xf'),auth[_0x57ec('0x9')](),timeout(_0x57ec('0x10')),controller['getSummary']);router[_0x57ec('0x11')]('/',auth[_0x57ec('0x9')](),controller[_0x57ec('0x12')]);router[_0x57ec('0x11')](_0x57ec('0x13'),auth[_0x57ec('0x9')](),controller[_0x57ec('0x14')]);router[_0x57ec('0x15')](_0x57ec('0xa'),auth[_0x57ec('0x9')](),controller[_0x57ec('0x16')]);router['delete'](_0x57ec('0xa'),auth[_0x57ec('0x9')](),controller[_0x57ec('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 7c8a889..3dcf870 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 _0x7b80=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString','format'];(function(_0x28874a,_0x5e61ac){var _0x4f7b0d=function(_0x17899e){while(--_0x17899e){_0x28874a['push'](_0x28874a['shift']());}};_0x4f7b0d(++_0x5e61ac);}(_0x7b80,0x1b6));var _0x07b8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7b80[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x07b8('0x0'));var _=require(_0x07b8('0x1'));var util=require(_0x07b8('0x2'));module['exports']={'name':{'type':Sequelize[_0x07b8('0x3')],'unique':_0x07b8('0x4')},'description':{'type':Sequelize[_0x07b8('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x07b8('0x5')),'set':function(_0x40fd4){if(_[_0x07b8('0x6')](_0x40fd4)){this[_0x07b8('0x7')](_0x07b8('0x8'),JSON[_0x07b8('0x9')](_0x40fd4));}else if(_[_0x07b8('0xa')](_0x40fd4)){this[_0x07b8('0x7')](_0x07b8('0x8'),_0x40fd4);}else{this[_0x07b8('0x7')](_0x07b8('0x8'),util[_0x07b8('0xb')](_0x07b8('0xc'),this[_0x07b8('0xd')](_0x07b8('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x07b8('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x07b8('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x96e2=['setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','isObjectLike'];(function(_0x479aa5,_0x4cd458){var _0x4b6655=function(_0x4ca32){while(--_0x4ca32){_0x479aa5['push'](_0x479aa5['shift']());}};_0x4b6655(++_0x4cd458);}(_0x96e2,0xe6));var _0x296e=function(_0x48d007,_0x446953){_0x48d007=_0x48d007-0x0;var _0x412d80=_0x96e2[_0x48d007];return _0x412d80;};'use strict';var Sequelize=require(_0x296e('0x0'));var _=require(_0x296e('0x1'));var util=require(_0x296e('0x2'));module[_0x296e('0x3')]={'name':{'type':Sequelize[_0x296e('0x4')],'unique':_0x296e('0x5')},'description':{'type':Sequelize[_0x296e('0x4')]},'formData':{'type':Sequelize[_0x296e('0x6')]('long'),'set':function(_0x16ec2d){if(_[_0x296e('0x7')](_0x16ec2d)){this[_0x296e('0x8')](_0x296e('0x9'),JSON[_0x296e('0xa')](_0x16ec2d));}else if(_[_0x296e('0xb')](_0x16ec2d)){this[_0x296e('0x8')](_0x296e('0x9'),_0x16ec2d);}else{this[_0x296e('0x8')]('formData',util[_0x296e('0xc')](_0x296e('0xd'),this[_0x296e('0xe')](_0x296e('0x5'))||'',this[_0x296e('0xe')](_0x296e('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x296e('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 4091b9f..a1a987b 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 _0x094c=['attributes','length','hasOwnProperty','nolimit','order','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','getSessions','findOne','JscriptySessionReport','sort','pick','filter','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields'];(function(_0x20bdcf,_0x5cc6d8){var _0x429595=function(_0x799b8f){while(--_0x799b8f){_0x20bdcf['push'](_0x20bdcf['shift']());}};_0x429595(++_0x5cc6d8);}(_0x094c,0x131));var _0xc094=function(_0x2e87e4,_0x591ef7){_0x2e87e4=_0x2e87e4-0x0;var _0x3c9855=_0x094c[_0x2e87e4];return _0x3c9855;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc094('0x0'));var zipdir=require(_0xc094('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc094('0x2'));var moment=require(_0xc094('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc094('0x4'));var util=require(_0xc094('0x5'));var path=require(_0xc094('0x6'));var sox=require(_0xc094('0x7'));var csv=require(_0xc094('0x8'));var ejs=require(_0xc094('0x9'));var fs=require('fs');var fs_extra=require(_0xc094('0xa'));var _=require('lodash');var squel=require(_0xc094('0xb'));var crypto=require('crypto');var jsforce=require(_0xc094('0xc'));var deskjs=require(_0xc094('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc094('0xe'));var Papa=require(_0xc094('0xf'));var Redis=require(_0xc094('0x10'));var authService=require(_0xc094('0x11'));var qs=require(_0xc094('0x12'));var as=require(_0xc094('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc094('0x14'))(_0xc094('0x15'));var utils=require(_0xc094('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc094('0x17'))['db'];function respondWithStatusCode(_0x453ed2,_0x384005){_0x384005=_0x384005||0xcc;return function(_0x458315){if(_0x458315){return _0x453ed2[_0xc094('0x18')](_0x384005);}return _0x453ed2[_0xc094('0x19')](_0x384005)['end']();};}function respondWithResult(_0x425f56,_0x5dee69){_0x5dee69=_0x5dee69||0xc8;return function(_0x3c47f6){if(_0x3c47f6){return _0x425f56[_0xc094('0x19')](_0x5dee69)[_0xc094('0x1a')](_0x3c47f6);}};}function respondWithFilteredResult(_0x43625e,_0x188418){return function(_0x147dc9){if(_0x147dc9){var _0x3b6fe2=typeof _0x188418[_0xc094('0x1b')]===_0xc094('0x1c')&&typeof _0x188418[_0xc094('0x1d')]==='undefined';var _0x5bde5d=_0x147dc9[_0xc094('0x1e')];var _0x384170=_0x3b6fe2?0x0:_0x188418[_0xc094('0x1b')];var _0x3290d4=_0x3b6fe2?_0x147dc9['count']:_0x188418[_0xc094('0x1b')]+_0x188418['limit'];var _0x3eec46;if(_0x3290d4>=_0x5bde5d){_0x3290d4=_0x5bde5d;_0x3eec46=0xc8;}else{_0x3eec46=0xce;}_0x43625e[_0xc094('0x19')](_0x3eec46);return _0x43625e[_0xc094('0x1f')](_0xc094('0x20'),_0x384170+'-'+_0x3290d4+'/'+_0x5bde5d)[_0xc094('0x1a')](_0x147dc9);}return null;};}function patchUpdates(_0x97dba8){return function(_0x5e2cc8){try{jsonpatch[_0xc094('0x21')](_0x5e2cc8,_0x97dba8,!![]);}catch(_0x54c1a9){return BPromise[_0xc094('0x22')](_0x54c1a9);}return _0x5e2cc8[_0xc094('0x23')]();};}function saveUpdates(_0x4d814d,_0x5bbc42){return function(_0x321bb3){if(_0x321bb3){return _0x321bb3['update'](_0x4d814d)[_0xc094('0x24')](function(_0x17f044){return _0x17f044;});}return null;};}function removeEntity(_0x249a32,_0x228b93){return function(_0x364ede){if(_0x364ede){return _0x364ede['destroy']()['then'](function(){var _0x59f5a6=_0x364ede['get']({'plain':!![]});var _0xa85298='Projects';return db[_0xc094('0x25')][_0xc094('0x26')]({'where':{'type':_0xa85298,'resourceId':_0x59f5a6['id']}})[_0xc094('0x24')](function(){return _0x364ede;});})[_0xc094('0x24')](function(){_0x249a32[_0xc094('0x19')](0xcc)[_0xc094('0x27')]();});}};}function handleEntityNotFound(_0x1f9675,_0xaa6ff0){return function(_0x1000e6){if(!_0x1000e6){_0x1f9675[_0xc094('0x18')](0x194);}return _0x1000e6;};}function handleError(_0x5a92d8,_0x203f94){_0x203f94=_0x203f94||0x1f4;return function(_0x1936f3){logger['error'](_0x1936f3[_0xc094('0x28')]);if(_0x1936f3[_0xc094('0x29')]){delete _0x1936f3[_0xc094('0x29')];}_0x5a92d8[_0xc094('0x19')](_0x203f94)[_0xc094('0x2a')](_0x1936f3);};}exports[_0xc094('0x2b')]=function(_0x23790f,_0x27614c){var _0x5090e3={},_0xb267a4={},_0x56ef51={'count':0x0,'rows':[]};var _0x5bf460=_[_0xc094('0x2c')](db[_0xc094('0x2d')][_0xc094('0x2e')],function(_0x421b78){return{'name':_0x421b78[_0xc094('0x2f')],'type':_0x421b78[_0xc094('0x30')][_0xc094('0x31')]};});_0xb267a4['model']=_['map'](_0x5bf460,_0xc094('0x29'));_0xb267a4[_0xc094('0x32')]=_['keys'](_0x23790f['query']);_0xb267a4[_0xc094('0x33')]=_[_0xc094('0x34')](_0xb267a4['model'],_0xb267a4[_0xc094('0x32')]);_0x5090e3['attributes']=_[_0xc094('0x34')](_0xb267a4[_0xc094('0x35')],qs[_0xc094('0x36')](_0x23790f[_0xc094('0x32')][_0xc094('0x36')]));_0x5090e3['attributes']=_0x5090e3[_0xc094('0x37')][_0xc094('0x38')]?_0x5090e3['attributes']:_0xb267a4[_0xc094('0x35')];if(!_0x23790f[_0xc094('0x32')][_0xc094('0x39')](_0xc094('0x3a'))){_0x5090e3[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x23790f[_0xc094('0x32')]['limit']);_0x5090e3['offset']=qs[_0xc094('0x1b')](_0x23790f[_0xc094('0x32')][_0xc094('0x1b')]);}_0x5090e3[_0xc094('0x3b')]=qs['sort'](_0x23790f[_0xc094('0x32')]['sort']);_0x5090e3['where']=qs['filters'](_['pick'](_0x23790f[_0xc094('0x32')],_0xb267a4[_0xc094('0x33')]),_0x5bf460);if(_0x23790f['query']['filter']){_0x5090e3[_0xc094('0x3c')]=_[_0xc094('0x3d')](_0x5090e3[_0xc094('0x3c')],{'$or':_['map'](_0x5bf460,function(_0x484e63){if(_0x484e63[_0xc094('0x30')]!=='VIRTUAL'){var _0x2337c3={};_0x2337c3[_0x484e63[_0xc094('0x29')]]={'$like':'%'+_0x23790f[_0xc094('0x32')]['filter']+'%'};return _0x2337c3;}})});}_0x5090e3=_[_0xc094('0x3d')]({},_0x5090e3,_0x23790f[_0xc094('0x3e')]);var _0x299494={'where':_0x5090e3[_0xc094('0x3c')]};return db['JscriptyProject'][_0xc094('0x1e')](_0x299494)[_0xc094('0x24')](function(_0x109a09){_0x56ef51[_0xc094('0x1e')]=_0x109a09;if(_0x23790f[_0xc094('0x32')][_0xc094('0x3f')]){_0x5090e3[_0xc094('0x40')]=[{'all':!![]}];}return db['JscriptyProject'][_0xc094('0x41')](_0x5090e3);})['then'](function(_0x5082df){_0x56ef51[_0xc094('0x42')]=_0x5082df;return _0x56ef51;})['then'](respondWithFilteredResult(_0x27614c,_0x5090e3))[_0xc094('0x43')](handleError(_0x27614c,null));};exports[_0xc094('0x44')]=function(_0x43600e,_0x1c97e6){var _0x388e76={'raw':![],'where':{'id':_0x43600e['params']['id']}},_0x1bf5f1={};_0x1bf5f1[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x1bf5f1['query']=_['keys'](_0x43600e[_0xc094('0x32')]);_0x1bf5f1[_0xc094('0x33')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],_0x1bf5f1['query']);_0x388e76[_0xc094('0x37')]=_[_0xc094('0x34')](_0x1bf5f1[_0xc094('0x35')],qs[_0xc094('0x36')](_0x43600e['query'][_0xc094('0x36')]));_0x388e76[_0xc094('0x37')]=_0x388e76[_0xc094('0x37')][_0xc094('0x38')]?_0x388e76[_0xc094('0x37')]:_0x1bf5f1[_0xc094('0x35')];if(_0x43600e['query']['includeAll']){_0x388e76[_0xc094('0x40')]=[{'all':!![]}];}_0x388e76=_['merge']({},_0x388e76,_0x43600e[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x388e76)['then'](handleEntityNotFound(_0x1c97e6,null))[_0xc094('0x24')](respondWithResult(_0x1c97e6,null))['catch'](handleError(_0x1c97e6,null));};exports[_0xc094('0x47')]=function(_0x56dc51,_0x46aa3b){return db[_0xc094('0x2d')][_0xc094('0x47')](_0x56dc51[_0xc094('0x48')],{})['then'](function(_0x43cab6){var _0x5f1f2a=_0x56dc51[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x5f1f2a)throw new Error(_0xc094('0x4b'));if(_0x5f1f2a[_0xc094('0x4c')]===_0xc094('0x49')){var _0xb7ba29=_0x43cab6[_0xc094('0x4a')]({'plain':!![]});var _0xac85c5=_0xc094('0x4d');return db[_0xc094('0x4e')]['find']({'where':{'name':_0xac85c5,'userProfileId':_0x5f1f2a[_0xc094('0x4f')]},'raw':!![]})['then'](function(_0x2ba0a9){if(_0x2ba0a9&&_0x2ba0a9[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')]['create']({'name':_0xb7ba29[_0xc094('0x29')],'resourceId':_0xb7ba29['id'],'type':_0x2ba0a9[_0xc094('0x29')],'sectionId':_0x2ba0a9['id']},{})[_0xc094('0x24')](function(){return _0x43cab6;});}else{return _0x43cab6;}})[_0xc094('0x43')](function(_0x5b38ef){logger[_0xc094('0x51')](_0xc094('0x52'),_0x5b38ef);throw _0x5b38ef;});}return _0x43cab6;})['then'](respondWithResult(_0x46aa3b,0xc9))[_0xc094('0x43')](handleError(_0x46aa3b,null));};exports[_0xc094('0x53')]=function(_0x5ac606,_0x1a2db9){var _0x54fc6b={'where':{'id':_0x5ac606[_0xc094('0x54')]['id']}},_0x5e7a51={};_0x5e7a51[_0xc094('0x35')]=_[_0xc094('0x45')](db['JscriptyProject'][_0xc094('0x2e')]);_0x54fc6b[_0xc094('0x37')]=_[_0xc094('0x34')](_0x5e7a51[_0xc094('0x35')],qs[_0xc094('0x36')](_0x5ac606[_0xc094('0x32')][_0xc094('0x36')]));_0x54fc6b[_0xc094('0x37')]=_0x54fc6b[_0xc094('0x37')][_0xc094('0x38')]?_0x54fc6b['attributes']:_0x5e7a51[_0xc094('0x35')];if(_0x5ac606[_0xc094('0x32')][_0xc094('0x3f')]){_0x54fc6b['include']=[{'all':!![]}];}_0x54fc6b=_[_0xc094('0x3d')]({},_0x54fc6b,_0x5ac606[_0xc094('0x3e')]);return db['JscriptyProject'][_0xc094('0x46')](_0x54fc6b)[_0xc094('0x24')](handleEntityNotFound(_0x1a2db9,null))[_0xc094('0x24')](function(_0x5f2bba){if(_0x5f2bba){var _0x1a0b90=_0x5f2bba['get']({'plain':!![]});_0x1a0b90=qs[_0xc094('0x55')](_0x1a0b90,['id',_0xc094('0x56'),_0xc094('0x57')]);_0x5ac606[_0xc094('0x48')]=_[_0xc094('0x55')](_0x5ac606[_0xc094('0x48')],['id',_0xc094('0x56'),_0xc094('0x57')]);return db[_0xc094('0x2d')][_0xc094('0x47')](_[_0xc094('0x3d')](_0x1a0b90,_0x5ac606[_0xc094('0x48')]),{'include':_0x5ac606['query'][_0xc094('0x3f')]?[{'all':!![]}]:undefined})[_0xc094('0x24')](function(_0xc9d8){var _0x465b28=_0x5ac606[_0xc094('0x49')][_0xc094('0x4a')]({'plain':!![]});if(!_0x465b28)throw new Error(_0xc094('0x4b'));if(_0x465b28[_0xc094('0x4c')]===_0xc094('0x49')){var _0x419006=_0xc9d8[_0xc094('0x4a')]({'plain':!![]});var _0x22d1f3=_0xc094('0x4d');return db[_0xc094('0x4e')][_0xc094('0x46')]({'where':{'name':_0x22d1f3,'userProfileId':_0x465b28[_0xc094('0x4f')]},'raw':!![]})[_0xc094('0x24')](function(_0x401f4b){if(_0x401f4b&&_0x401f4b[_0xc094('0x50')]===0x0){return db[_0xc094('0x25')][_0xc094('0x47')]({'name':_0x419006[_0xc094('0x29')],'resourceId':_0x419006['id'],'type':_0x401f4b[_0xc094('0x29')],'sectionId':_0x401f4b['id']},{})[_0xc094('0x24')](function(){return _0xc9d8;});}else{return _0xc9d8;}})['catch'](function(_0x11c69d){logger[_0xc094('0x51')](_0xc094('0x52'),_0x11c69d);throw _0x11c69d;});}return _0xc9d8;});}})[_0xc094('0x24')](respondWithResult(_0x1a2db9,0xc9))[_0xc094('0x43')](handleError(_0x1a2db9,null));};exports[_0xc094('0x58')]=function(_0x2aae68,_0xbc704c){if(_0x2aae68[_0xc094('0x48')]['id']){delete _0x2aae68['body']['id'];}return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x2aae68[_0xc094('0x54')]['id']}})[_0xc094('0x24')](handleEntityNotFound(_0xbc704c,null))[_0xc094('0x24')](saveUpdates(_0x2aae68[_0xc094('0x48')],null))['then'](respondWithResult(_0xbc704c,null))[_0xc094('0x43')](handleError(_0xbc704c,null));};exports['destroy']=function(_0x3fbd46,_0x6df9b3){return db[_0xc094('0x2d')][_0xc094('0x46')]({'where':{'id':_0x3fbd46[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x6df9b3,null))[_0xc094('0x24')](removeEntity(_0x6df9b3,null))[_0xc094('0x43')](handleError(_0x6df9b3,null));};exports[_0xc094('0x59')]=function(_0x2168ab,_0x443857,_0x42f14e){var _0x3b81d2={'raw':!![],'where':{}};var _0x5b56dd={};var _0x519713={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x2168ab['params']['id']}})['then'](handleEntityNotFound(_0x443857,null))[_0xc094('0x24')](function(_0x1575d0){if(_0x1575d0){_0x5b56dd[_0xc094('0x35')]=_['keys'](db[_0xc094('0x5b')][_0xc094('0x2e')]);_0x5b56dd[_0xc094('0x32')]=_[_0xc094('0x45')](_0x2168ab['query']);_0x5b56dd['filters']=_[_0xc094('0x34')](_0x5b56dd['model'],_0x5b56dd[_0xc094('0x32')]);_0x3b81d2['attributes']=_[_0xc094('0x34')](_0x5b56dd['model'],qs[_0xc094('0x36')](_0x2168ab[_0xc094('0x32')][_0xc094('0x36')]));_0x3b81d2[_0xc094('0x37')]=_0x3b81d2[_0xc094('0x37')][_0xc094('0x38')]?_0x3b81d2['attributes']:_0x5b56dd[_0xc094('0x35')];if(!_0x2168ab[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0x3b81d2[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x2168ab['query'][_0xc094('0x1d')]);_0x3b81d2[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x2168ab['query']['offset']);}_0x3b81d2['order']=qs[_0xc094('0x5c')](_0x2168ab['query'][_0xc094('0x5c')]);_0x3b81d2['where']=qs['filters'](_[_0xc094('0x5d')](_0x2168ab[_0xc094('0x32')],_0x5b56dd[_0xc094('0x33')]));_0x3b81d2['where']['ProjectId']=_0x1575d0['id'];if(_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]){_0x3b81d2[_0xc094('0x3c')]=_['merge'](_0x3b81d2[_0xc094('0x3c')],{'$or':_['map'](_0x3b81d2[_0xc094('0x37')],function(_0x5abe4a){var _0x20f456={};_0x20f456[_0x5abe4a]={'$like':'%'+_0x2168ab[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x20f456;})});}_0x3b81d2=_[_0xc094('0x3d')]({},_0x3b81d2,_0x2168ab['options']);return db[_0xc094('0x5b')][_0xc094('0x1e')]({'where':_0x3b81d2['where']})[_0xc094('0x24')](function(_0x53b4c0){_0x519713['count']=_0x53b4c0;if(_0x2168ab[_0xc094('0x32')][_0xc094('0x3f')]){_0x3b81d2[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x5b')]['findAll'](_0x3b81d2);})['then'](function(_0x6db787){_0x519713['rows']=_0x6db787;return _0x519713;});}})['then'](respondWithFilteredResult(_0x443857,_0x3b81d2))[_0xc094('0x43')](handleError(_0x443857,null));};exports[_0xc094('0x5f')]=function(_0x20d0a6,_0x93ed7e,_0x19a5a0){var _0xd61d85={'raw':!![],'where':{}};var _0x272d5f={};var _0x2905cf={'count':0x0,'rows':[]};return db[_0xc094('0x2d')][_0xc094('0x5a')]({'where':{'id':_0x20d0a6[_0xc094('0x54')]['id']}})['then'](handleEntityNotFound(_0x93ed7e,null))[_0xc094('0x24')](function(_0x11db0f){if(_0x11db0f){_0x272d5f[_0xc094('0x35')]=_[_0xc094('0x45')](db[_0xc094('0x60')]['rawAttributes']);_0x272d5f['query']=_['keys'](_0x20d0a6[_0xc094('0x32')]);_0x272d5f[_0xc094('0x33')]=_[_0xc094('0x34')](_0x272d5f[_0xc094('0x35')],_0x272d5f[_0xc094('0x32')]);_0xd61d85[_0xc094('0x37')]=_['intersection'](_0x272d5f[_0xc094('0x35')],qs[_0xc094('0x36')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x36')]));_0xd61d85[_0xc094('0x37')]=_0xd61d85[_0xc094('0x37')][_0xc094('0x38')]?_0xd61d85[_0xc094('0x37')]:_0x272d5f['model'];if(!_0x20d0a6[_0xc094('0x32')][_0xc094('0x39')]('nolimit')){_0xd61d85[_0xc094('0x1d')]=qs[_0xc094('0x1d')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x1d')]);_0xd61d85[_0xc094('0x1b')]=qs[_0xc094('0x1b')](_0x20d0a6['query'][_0xc094('0x1b')]);}_0xd61d85[_0xc094('0x3b')]=qs[_0xc094('0x5c')](_0x20d0a6[_0xc094('0x32')][_0xc094('0x5c')]);_0xd61d85[_0xc094('0x3c')]=qs['filters'](_[_0xc094('0x5d')](_0x20d0a6['query'],_0x272d5f[_0xc094('0x33')]));_0xd61d85[_0xc094('0x3c')]['ProjectId']=_0x11db0f['id'];if(_0x20d0a6['query']['filter']){_0xd61d85[_0xc094('0x3c')]=_['merge'](_0xd61d85[_0xc094('0x3c')],{'$or':_['map'](_0xd61d85[_0xc094('0x37')],function(_0x19a16a){var _0x53e9b5={};_0x53e9b5[_0x19a16a]={'$like':'%'+_0x20d0a6[_0xc094('0x32')][_0xc094('0x5e')]+'%'};return _0x53e9b5;})});}_0xd61d85=_[_0xc094('0x3d')]({},_0xd61d85,_0x20d0a6['options']);return db[_0xc094('0x60')][_0xc094('0x1e')]({'where':_0xd61d85[_0xc094('0x3c')]})[_0xc094('0x24')](function(_0x550f2e){_0x2905cf[_0xc094('0x1e')]=_0x550f2e;if(_0x20d0a6['query'][_0xc094('0x3f')]){_0xd61d85[_0xc094('0x40')]=[{'all':!![]}];}return db[_0xc094('0x60')]['findAll'](_0xd61d85);})['then'](function(_0x1b5c26){_0x2905cf[_0xc094('0x42')]=_0x1b5c26;return _0x2905cf;});}})[_0xc094('0x24')](respondWithFilteredResult(_0x93ed7e,_0xd61d85))['catch'](handleError(_0x93ed7e,null));};function char(_0x56626c){return _0xc094('0x61')===typeof _0x56626c?String[_0xc094('0x62')][_0xc094('0x21')](null,arguments):_0x56626c;}function needsEncapsulation(_0x2fd2a9){return!!_0x2fd2a9&&(_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xd))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0xa))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x2c))>=0x0||_0x2fd2a9[_0xc094('0x63')]()[_0xc094('0x64')](char(0x22))>=0x0);}function encapsulate(_0xffec0a){var _0x105e4d=char(0x22),_0x2aa2f1='\x5c'+char(0x22),_0x4d8b71=_0xffec0a[_0xc094('0x63')]()['replace'](new RegExp(_0x105e4d,'g'),_0x2aa2f1);return _0x105e4d+_0x4d8b71+_0x105e4d;}exports[_0xc094('0x65')]=function(_0x45b875,_0x1b9316,_0x955189){var _0x1366cf,_0x23f273;var _0x565ba7={'where':{'ProjectId':_0x45b875[_0xc094('0x54')]['id']}};if(_0x45b875[_0xc094('0x32')]['startTime']){_0x565ba7['where'][_0xc094('0x66')]=JSON[_0xc094('0x67')](_0x45b875['query']['startTime']);}return db[_0xc094('0x5b')][_0xc094('0x41')](_0x565ba7)[_0xc094('0x24')](handleEntityNotFound(_0x1b9316,null))[_0xc094('0x24')](function(_0x5a27e1){if(_0x5a27e1){_0x1366cf=_0x5a27e1;return db[_0xc094('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0xc094('0x2c')](_0x1366cf,'id')},'ProjectId':_0x45b875[_0xc094('0x54')]['id']},'order':_0xc094('0x69')});}})['then'](handleEntityNotFound(_0x1b9316,null))['then'](function(_0x387cb0){if(_0x387cb0){_0x23f273=_0x387cb0;var _0x53109f={};for(var _0x245e38=0x0,_0x5624f3=_0x23f273[_0xc094('0x38')];_0x245e38<_0x5624f3;_0x245e38++){if(!_0x53109f[_0xc094('0x39')](_0x23f273[_0x245e38][_0xc094('0x6a')])){_0x53109f[_0x23f273[_0x245e38][_0xc094('0x6a')]]=needsEncapsulation(_0x23f273[_0x245e38][_0xc094('0x6b')])?encapsulate(_0x23f273[_0x245e38][_0xc094('0x6b')]):_0x23f273[_0x245e38][_0xc094('0x6b')];}}var _0x32bc4b=[],_0x51eda7={};for(var _0x26885b=0x0,_0x350538=_0x1366cf[_0xc094('0x38')];_0x26885b<_0x350538;_0x26885b++){_0x51eda7={'ProjectId':_0x45b875[_0xc094('0x54')]['id'],'SessionId':_0x1366cf[_0x26885b]['id'],'StartTime':moment(_0x1366cf[_0x26885b][_0xc094('0x66')])['format'](_0xc094('0x6c'))};for(var _0x34ca8a=0x0,_0x27492b=_0x23f273[_0xc094('0x38')];_0x34ca8a<_0x27492b;_0x34ca8a++){if(_0x23f273[_0x34ca8a][_0xc094('0x6d')]==_0x1366cf[_0x26885b]['id']&&_0x53109f[_0xc094('0x39')](_0x23f273[_0x34ca8a][_0xc094('0x6a')])){_0x51eda7[_0x53109f[_0x23f273[_0x34ca8a][_0xc094('0x6a')]]]=_0x23f273[_0x34ca8a][_0xc094('0x6e')];}}for(var _0xf24a1e in _0x53109f){if(!_0x51eda7[_0xc094('0x39')](_0x53109f[_0xf24a1e])){_0x51eda7[_0x53109f[_0xf24a1e]]=null;}}_0x32bc4b['push'](_0x51eda7);}return _0x32bc4b;}})[_0xc094('0x24')](function(_0x321652){if(!_[_0xc094('0x6f')](_0x321652)){var _0x14b39b=toCsv(_0x321652);var _0x24f12d=Date[_0xc094('0x70')]();fs['writeFileSync'](util['format'](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d),_0x14b39b);_0x1b9316[_0xc094('0x72')](_0xc094('0x73'),'attachment;\x20filename='+util[_0xc094('0x74')](_0xc094('0x75'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));_0x1b9316[_0xc094('0x72')](_0xc094('0x76'),'text/csv');return _0x1b9316[_0xc094('0x77')](util[_0xc094('0x74')](_0xc094('0x71'),_0x45b875[_0xc094('0x54')]['id'],_0x24f12d));}else{return _0x1b9316[_0xc094('0x18')](0xcc);}})[_0xc094('0x43')](handleError(_0x1b9316,null));}; \ No newline at end of file +var _0x8603=['params','find','catch','create','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','user','Projects','UserProfileSection','autoAssociation','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','JscriptyProject','includeAll','include','findAll','rows'];(function(_0x215692,_0x344ee3){var _0x2214fe=function(_0x41c809){while(--_0x41c809){_0x215692['push'](_0x215692['shift']());}};_0x2214fe(++_0x344ee3);}(_0x8603,0x190));var _0x3860=function(_0x250858,_0x4381dc){_0x250858=_0x250858-0x0;var _0x4ba9f8=_0x8603[_0x250858];return _0x4ba9f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];function respondWithStatusCode(_0x8ad61d,_0x2428f6){_0x2428f6=_0x2428f6||0xcc;return function(_0x1ea619){if(_0x1ea619){return _0x8ad61d[_0x3860('0x15')](_0x2428f6);}return _0x8ad61d[_0x3860('0x16')](_0x2428f6)[_0x3860('0x17')]();};}function respondWithResult(_0x12b23b,_0x465d8d){_0x465d8d=_0x465d8d||0xc8;return function(_0x46264d){if(_0x46264d){return _0x12b23b['status'](_0x465d8d)[_0x3860('0x18')](_0x46264d);}};}function respondWithFilteredResult(_0x21eaf1,_0x122e40){return function(_0x37d9ab){if(_0x37d9ab){var _0x1055b3=typeof _0x122e40[_0x3860('0x19')]===_0x3860('0x1a')&&typeof _0x122e40[_0x3860('0x1b')]===_0x3860('0x1a');var _0x3c0d91=_0x37d9ab[_0x3860('0x1c')];var _0x45b799=_0x1055b3?0x0:_0x122e40['offset'];var _0x4863bd=_0x1055b3?_0x37d9ab[_0x3860('0x1c')]:_0x122e40[_0x3860('0x19')]+_0x122e40[_0x3860('0x1b')];var _0x53fc63;if(_0x4863bd>=_0x3c0d91){_0x4863bd=_0x3c0d91;_0x53fc63=0xc8;}else{_0x53fc63=0xce;}_0x21eaf1[_0x3860('0x16')](_0x53fc63);return _0x21eaf1[_0x3860('0x1d')](_0x3860('0x1e'),_0x45b799+'-'+_0x4863bd+'/'+_0x3c0d91)[_0x3860('0x18')](_0x37d9ab);}return null;};}function patchUpdates(_0x20a5b0){return function(_0x45081f){try{jsonpatch[_0x3860('0x1f')](_0x45081f,_0x20a5b0,!![]);}catch(_0x1f8891){return BPromise[_0x3860('0x20')](_0x1f8891);}return _0x45081f[_0x3860('0x21')]();};}function saveUpdates(_0xacd57f,_0x2e0b6e){return function(_0x280ea9){if(_0x280ea9){return _0x280ea9[_0x3860('0x22')](_0xacd57f)[_0x3860('0x23')](function(_0x564efd){return _0x564efd;});}return null;};}function removeEntity(_0xfc10a5,_0x133093){return function(_0x2b91f2){if(_0x2b91f2){return _0x2b91f2[_0x3860('0x24')]()[_0x3860('0x23')](function(){var _0x56a6d1=_0x2b91f2[_0x3860('0x25')]({'plain':!![]});var _0x568515='Projects';return db[_0x3860('0x26')][_0x3860('0x24')]({'where':{'type':_0x568515,'resourceId':_0x56a6d1['id']}})['then'](function(){return _0x2b91f2;});})['then'](function(){_0xfc10a5['status'](0xcc)[_0x3860('0x17')]();});}};}function handleEntityNotFound(_0x3ebc5b,_0xb25cc2){return function(_0x371f3a){if(!_0x371f3a){_0x3ebc5b[_0x3860('0x15')](0x194);}return _0x371f3a;};}function handleError(_0x228d34,_0x544b9a){_0x544b9a=_0x544b9a||0x1f4;return function(_0x4c4314){logger[_0x3860('0x27')](_0x4c4314[_0x3860('0x28')]);if(_0x4c4314['name']){delete _0x4c4314[_0x3860('0x29')];}_0x228d34[_0x3860('0x16')](_0x544b9a)[_0x3860('0x2a')](_0x4c4314);};}exports[_0x3860('0x2b')]=function(_0x3628f7,_0x4bbae9){var _0x36ae2b={},_0xf624ba={},_0x367b14={'count':0x0,'rows':[]};var _0x4bd90c=_[_0x3860('0x2c')](db['JscriptyProject'][_0x3860('0x2d')],function(_0x4825f0){return{'name':_0x4825f0[_0x3860('0x2e')],'type':_0x4825f0[_0x3860('0x2f')][_0x3860('0x30')]};});_0xf624ba['model']=_[_0x3860('0x2c')](_0x4bd90c,_0x3860('0x29'));_0xf624ba['query']=_[_0x3860('0x31')](_0x3628f7['query']);_0xf624ba[_0x3860('0x32')]=_[_0x3860('0x33')](_0xf624ba[_0x3860('0x34')],_0xf624ba[_0x3860('0x35')]);_0x36ae2b[_0x3860('0x36')]=_[_0x3860('0x33')](_0xf624ba[_0x3860('0x34')],qs['fields'](_0x3628f7[_0x3860('0x35')][_0x3860('0x37')]));_0x36ae2b['attributes']=_0x36ae2b[_0x3860('0x36')][_0x3860('0x38')]?_0x36ae2b[_0x3860('0x36')]:_0xf624ba['model'];if(!_0x3628f7['query'][_0x3860('0x39')](_0x3860('0x3a'))){_0x36ae2b[_0x3860('0x1b')]=qs[_0x3860('0x1b')](_0x3628f7['query']['limit']);_0x36ae2b[_0x3860('0x19')]=qs[_0x3860('0x19')](_0x3628f7[_0x3860('0x35')][_0x3860('0x19')]);}_0x36ae2b[_0x3860('0x3b')]=qs['sort'](_0x3628f7[_0x3860('0x35')][_0x3860('0x3c')]);_0x36ae2b['where']=qs['filters'](_[_0x3860('0x3d')](_0x3628f7[_0x3860('0x35')],_0xf624ba[_0x3860('0x32')]),_0x4bd90c);if(_0x3628f7[_0x3860('0x35')][_0x3860('0x3e')]){_0x36ae2b['where']=_[_0x3860('0x3f')](_0x36ae2b['where'],{'$or':_[_0x3860('0x2c')](_0x4bd90c,function(_0x35bf7a){if(_0x35bf7a['type']!==_0x3860('0x40')){var _0x162e65={};_0x162e65[_0x35bf7a['name']]={'$like':'%'+_0x3628f7[_0x3860('0x35')][_0x3860('0x3e')]+'%'};return _0x162e65;}})});}_0x36ae2b=_[_0x3860('0x3f')]({},_0x36ae2b,_0x3628f7[_0x3860('0x41')]);var _0x4f486e={'where':_0x36ae2b[_0x3860('0x42')]};return db[_0x3860('0x43')][_0x3860('0x1c')](_0x4f486e)['then'](function(_0x3a87e5){_0x367b14['count']=_0x3a87e5;if(_0x3628f7[_0x3860('0x35')][_0x3860('0x44')]){_0x36ae2b[_0x3860('0x45')]=[{'all':!![]}];}return db[_0x3860('0x43')][_0x3860('0x46')](_0x36ae2b);})[_0x3860('0x23')](function(_0x4e0a44){_0x367b14[_0x3860('0x47')]=_0x4e0a44;return _0x367b14;})[_0x3860('0x23')](respondWithFilteredResult(_0x4bbae9,_0x36ae2b))['catch'](handleError(_0x4bbae9,null));};exports['show']=function(_0x2938d4,_0x5840f7){var _0x4f2f53={'raw':![],'where':{'id':_0x2938d4[_0x3860('0x48')]['id']}},_0x164a77={};_0x164a77['model']=_[_0x3860('0x31')](db[_0x3860('0x43')][_0x3860('0x2d')]);_0x164a77[_0x3860('0x35')]=_[_0x3860('0x31')](_0x2938d4[_0x3860('0x35')]);_0x164a77[_0x3860('0x32')]=_[_0x3860('0x33')](_0x164a77[_0x3860('0x34')],_0x164a77[_0x3860('0x35')]);_0x4f2f53[_0x3860('0x36')]=_[_0x3860('0x33')](_0x164a77[_0x3860('0x34')],qs['fields'](_0x2938d4[_0x3860('0x35')]['fields']));_0x4f2f53[_0x3860('0x36')]=_0x4f2f53[_0x3860('0x36')][_0x3860('0x38')]?_0x4f2f53[_0x3860('0x36')]:_0x164a77[_0x3860('0x34')];if(_0x2938d4[_0x3860('0x35')][_0x3860('0x44')]){_0x4f2f53[_0x3860('0x45')]=[{'all':!![]}];}_0x4f2f53=_['merge']({},_0x4f2f53,_0x2938d4[_0x3860('0x41')]);return db[_0x3860('0x43')][_0x3860('0x49')](_0x4f2f53)['then'](handleEntityNotFound(_0x5840f7,null))[_0x3860('0x23')](respondWithResult(_0x5840f7,null))[_0x3860('0x4a')](handleError(_0x5840f7,null));};exports[_0x3860('0x4b')]=function(_0x3dc957,_0x5ed2db){return db['JscriptyProject'][_0x3860('0x4b')](_0x3dc957['body'],{})[_0x3860('0x23')](function(_0x4226da){var _0x410dab=_0x3dc957['user'][_0x3860('0x25')]({'plain':!![]});if(!_0x410dab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410dab[_0x3860('0x4c')]==='user'){var _0xf9edb4=_0x4226da[_0x3860('0x25')]({'plain':!![]});var _0x39b2e0='Projects';return db['UserProfileSection'][_0x3860('0x49')]({'where':{'name':_0x39b2e0,'userProfileId':_0x410dab[_0x3860('0x4d')]},'raw':!![]})['then'](function(_0x3910f5){if(_0x3910f5&&_0x3910f5['autoAssociation']===0x0){return db[_0x3860('0x26')][_0x3860('0x4b')]({'name':_0xf9edb4[_0x3860('0x29')],'resourceId':_0xf9edb4['id'],'type':_0x3910f5[_0x3860('0x29')],'sectionId':_0x3910f5['id']},{})[_0x3860('0x23')](function(){return _0x4226da;});}else{return _0x4226da;}})[_0x3860('0x4a')](function(_0x3fad85){logger['error'](_0x3860('0x4e'),_0x3fad85);throw _0x3fad85;});}return _0x4226da;})[_0x3860('0x23')](respondWithResult(_0x5ed2db,0xc9))[_0x3860('0x4a')](handleError(_0x5ed2db,null));};exports[_0x3860('0x4f')]=function(_0x279e6f,_0x447163){var _0x47ff99={'where':{'id':_0x279e6f[_0x3860('0x48')]['id']}},_0x2cf48c={};_0x2cf48c[_0x3860('0x34')]=_[_0x3860('0x31')](db[_0x3860('0x43')][_0x3860('0x2d')]);_0x47ff99[_0x3860('0x36')]=_[_0x3860('0x33')](_0x2cf48c['model'],qs[_0x3860('0x37')](_0x279e6f[_0x3860('0x35')]['fields']));_0x47ff99[_0x3860('0x36')]=_0x47ff99[_0x3860('0x36')][_0x3860('0x38')]?_0x47ff99['attributes']:_0x2cf48c[_0x3860('0x34')];if(_0x279e6f['query'][_0x3860('0x44')]){_0x47ff99[_0x3860('0x45')]=[{'all':!![]}];}_0x47ff99=_[_0x3860('0x3f')]({},_0x47ff99,_0x279e6f[_0x3860('0x41')]);return db[_0x3860('0x43')][_0x3860('0x49')](_0x47ff99)[_0x3860('0x23')](handleEntityNotFound(_0x447163,null))[_0x3860('0x23')](function(_0x67e6b8){if(_0x67e6b8){var _0x151492=_0x67e6b8[_0x3860('0x25')]({'plain':!![]});_0x151492=qs[_0x3860('0x50')](_0x151492,['id','createdAt','updatedAt']);_0x279e6f['body']=_[_0x3860('0x50')](_0x279e6f['body'],['id','createdAt',_0x3860('0x51')]);return db[_0x3860('0x43')][_0x3860('0x4b')](_[_0x3860('0x3f')](_0x151492,_0x279e6f[_0x3860('0x52')]),{'include':_0x279e6f[_0x3860('0x35')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4df47b){var _0x1d6c70=_0x279e6f[_0x3860('0x53')][_0x3860('0x25')]({'plain':!![]});if(!_0x1d6c70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d6c70[_0x3860('0x4c')]==='user'){var _0x4714c5=_0x4df47b[_0x3860('0x25')]({'plain':!![]});var _0x5176ff=_0x3860('0x54');return db[_0x3860('0x55')][_0x3860('0x49')]({'where':{'name':_0x5176ff,'userProfileId':_0x1d6c70[_0x3860('0x4d')]},'raw':!![]})['then'](function(_0x18cc37){if(_0x18cc37&&_0x18cc37[_0x3860('0x56')]===0x0){return db[_0x3860('0x26')]['create']({'name':_0x4714c5['name'],'resourceId':_0x4714c5['id'],'type':_0x18cc37[_0x3860('0x29')],'sectionId':_0x18cc37['id']},{})[_0x3860('0x23')](function(){return _0x4df47b;});}else{return _0x4df47b;}})[_0x3860('0x4a')](function(_0x1ca0e7){logger[_0x3860('0x27')](_0x3860('0x4e'),_0x1ca0e7);throw _0x1ca0e7;});}return _0x4df47b;});}})['then'](respondWithResult(_0x447163,0xc9))[_0x3860('0x4a')](handleError(_0x447163,null));};exports[_0x3860('0x22')]=function(_0x5db8f9,_0x15fa2d){if(_0x5db8f9[_0x3860('0x52')]['id']){delete _0x5db8f9[_0x3860('0x52')]['id'];}return db[_0x3860('0x43')][_0x3860('0x49')]({'where':{'id':_0x5db8f9[_0x3860('0x48')]['id']}})['then'](handleEntityNotFound(_0x15fa2d,null))[_0x3860('0x23')](saveUpdates(_0x5db8f9[_0x3860('0x52')],null))[_0x3860('0x23')](respondWithResult(_0x15fa2d,null))[_0x3860('0x4a')](handleError(_0x15fa2d,null));};exports[_0x3860('0x24')]=function(_0x2a5c06,_0x5f2c66){return db[_0x3860('0x43')][_0x3860('0x49')]({'where':{'id':_0x2a5c06[_0x3860('0x48')]['id']}})['then'](handleEntityNotFound(_0x5f2c66,null))['then'](removeEntity(_0x5f2c66,null))[_0x3860('0x4a')](handleError(_0x5f2c66,null));};exports[_0x3860('0x57')]=function(_0x11c2c8,_0x3b7a76,_0x3fe275){var _0x501ed0={'raw':!![],'where':{}};var _0x48ade7={};var _0x2db53f={'count':0x0,'rows':[]};return db[_0x3860('0x43')]['findOne']({'where':{'id':_0x11c2c8['params']['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x3b7a76,null))[_0x3860('0x23')](function(_0x4ca6de){if(_0x4ca6de){_0x48ade7[_0x3860('0x34')]=_[_0x3860('0x31')](db[_0x3860('0x58')][_0x3860('0x2d')]);_0x48ade7['query']=_[_0x3860('0x31')](_0x11c2c8[_0x3860('0x35')]);_0x48ade7['filters']=_['intersection'](_0x48ade7[_0x3860('0x34')],_0x48ade7[_0x3860('0x35')]);_0x501ed0['attributes']=_[_0x3860('0x33')](_0x48ade7['model'],qs[_0x3860('0x37')](_0x11c2c8['query']['fields']));_0x501ed0[_0x3860('0x36')]=_0x501ed0['attributes'][_0x3860('0x38')]?_0x501ed0[_0x3860('0x36')]:_0x48ade7[_0x3860('0x34')];if(!_0x11c2c8[_0x3860('0x35')][_0x3860('0x39')](_0x3860('0x3a'))){_0x501ed0['limit']=qs[_0x3860('0x1b')](_0x11c2c8[_0x3860('0x35')][_0x3860('0x1b')]);_0x501ed0['offset']=qs[_0x3860('0x19')](_0x11c2c8['query'][_0x3860('0x19')]);}_0x501ed0[_0x3860('0x3b')]=qs['sort'](_0x11c2c8[_0x3860('0x35')][_0x3860('0x3c')]);_0x501ed0[_0x3860('0x42')]=qs['filters'](_['pick'](_0x11c2c8['query'],_0x48ade7['filters']));_0x501ed0[_0x3860('0x42')][_0x3860('0x59')]=_0x4ca6de['id'];if(_0x11c2c8[_0x3860('0x35')][_0x3860('0x3e')]){_0x501ed0['where']=_['merge'](_0x501ed0[_0x3860('0x42')],{'$or':_[_0x3860('0x2c')](_0x501ed0[_0x3860('0x36')],function(_0x61798b){var _0x4b0652={};_0x4b0652[_0x61798b]={'$like':'%'+_0x11c2c8[_0x3860('0x35')][_0x3860('0x3e')]+'%'};return _0x4b0652;})});}_0x501ed0=_['merge']({},_0x501ed0,_0x11c2c8['options']);return db[_0x3860('0x58')][_0x3860('0x1c')]({'where':_0x501ed0[_0x3860('0x42')]})[_0x3860('0x23')](function(_0x54739a){_0x2db53f['count']=_0x54739a;if(_0x11c2c8[_0x3860('0x35')]['includeAll']){_0x501ed0[_0x3860('0x45')]=[{'all':!![]}];}return db[_0x3860('0x58')]['findAll'](_0x501ed0);})['then'](function(_0x51b775){_0x2db53f[_0x3860('0x47')]=_0x51b775;return _0x2db53f;});}})[_0x3860('0x23')](respondWithFilteredResult(_0x3b7a76,_0x501ed0))['catch'](handleError(_0x3b7a76,null));};exports[_0x3860('0x5a')]=function(_0x1371b5,_0x2351fe,_0x3c5ad8){var _0x5b8867={'raw':!![],'where':{}};var _0x481e20={};var _0x1426c4={'count':0x0,'rows':[]};return db[_0x3860('0x43')][_0x3860('0x5b')]({'where':{'id':_0x1371b5[_0x3860('0x48')]['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x2351fe,null))['then'](function(_0x313366){if(_0x313366){_0x481e20[_0x3860('0x34')]=_[_0x3860('0x31')](db[_0x3860('0x5c')][_0x3860('0x2d')]);_0x481e20['query']=_['keys'](_0x1371b5[_0x3860('0x35')]);_0x481e20[_0x3860('0x32')]=_[_0x3860('0x33')](_0x481e20[_0x3860('0x34')],_0x481e20[_0x3860('0x35')]);_0x5b8867[_0x3860('0x36')]=_[_0x3860('0x33')](_0x481e20['model'],qs[_0x3860('0x37')](_0x1371b5[_0x3860('0x35')]['fields']));_0x5b8867[_0x3860('0x36')]=_0x5b8867[_0x3860('0x36')][_0x3860('0x38')]?_0x5b8867['attributes']:_0x481e20[_0x3860('0x34')];if(!_0x1371b5[_0x3860('0x35')]['hasOwnProperty'](_0x3860('0x3a'))){_0x5b8867['limit']=qs[_0x3860('0x1b')](_0x1371b5[_0x3860('0x35')]['limit']);_0x5b8867[_0x3860('0x19')]=qs[_0x3860('0x19')](_0x1371b5[_0x3860('0x35')][_0x3860('0x19')]);}_0x5b8867[_0x3860('0x3b')]=qs['sort'](_0x1371b5[_0x3860('0x35')][_0x3860('0x3c')]);_0x5b8867[_0x3860('0x42')]=qs[_0x3860('0x32')](_[_0x3860('0x3d')](_0x1371b5['query'],_0x481e20['filters']));_0x5b8867[_0x3860('0x42')][_0x3860('0x59')]=_0x313366['id'];if(_0x1371b5['query'][_0x3860('0x3e')]){_0x5b8867[_0x3860('0x42')]=_[_0x3860('0x3f')](_0x5b8867[_0x3860('0x42')],{'$or':_['map'](_0x5b8867[_0x3860('0x36')],function(_0x5a2f99){var _0x1a0768={};_0x1a0768[_0x5a2f99]={'$like':'%'+_0x1371b5[_0x3860('0x35')][_0x3860('0x3e')]+'%'};return _0x1a0768;})});}_0x5b8867=_[_0x3860('0x3f')]({},_0x5b8867,_0x1371b5[_0x3860('0x41')]);return db[_0x3860('0x5c')][_0x3860('0x1c')]({'where':_0x5b8867['where']})[_0x3860('0x23')](function(_0x47396d){_0x1426c4['count']=_0x47396d;if(_0x1371b5['query']['includeAll']){_0x5b8867['include']=[{'all':!![]}];}return db[_0x3860('0x5c')][_0x3860('0x46')](_0x5b8867);})[_0x3860('0x23')](function(_0x1482cd){_0x1426c4[_0x3860('0x47')]=_0x1482cd;return _0x1426c4;});}})[_0x3860('0x23')](respondWithFilteredResult(_0x2351fe,_0x5b8867))['catch'](handleError(_0x2351fe,null));};function char(_0x204da6){return'number'===typeof _0x204da6?String[_0x3860('0x5d')][_0x3860('0x1f')](null,arguments):_0x204da6;}function needsEncapsulation(_0x897ea0){return!!_0x897ea0&&(_0x897ea0[_0x3860('0x5e')]()[_0x3860('0x5f')](char(0xd))>=0x0||_0x897ea0[_0x3860('0x5e')]()[_0x3860('0x5f')](char(0xa))>=0x0||_0x897ea0[_0x3860('0x5e')]()[_0x3860('0x5f')](char(0x2c))>=0x0||_0x897ea0[_0x3860('0x5e')]()[_0x3860('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x5bdd94){var _0x1ab3fa=char(0x22),_0x304c95='\x5c'+char(0x22),_0x1c87bd=_0x5bdd94['toString']()[_0x3860('0x60')](new RegExp(_0x1ab3fa,'g'),_0x304c95);return _0x1ab3fa+_0x1c87bd+_0x1ab3fa;}exports[_0x3860('0x61')]=function(_0x1a9f4e,_0x3d4469,_0x4a3e1a){var _0x16a462,_0x19ace1;var _0x18e1ef={'where':{'ProjectId':_0x1a9f4e['params']['id']}};if(_0x1a9f4e[_0x3860('0x35')][_0x3860('0x62')]){_0x18e1ef[_0x3860('0x42')]['starttime']=JSON[_0x3860('0x63')](_0x1a9f4e[_0x3860('0x35')][_0x3860('0x62')]);}return db['JscriptySessionReport'][_0x3860('0x46')](_0x18e1ef)[_0x3860('0x23')](handleEntityNotFound(_0x3d4469,null))[_0x3860('0x23')](function(_0x5c2003){if(_0x5c2003){_0x16a462=_0x5c2003;return db[_0x3860('0x64')][_0x3860('0x46')]({'where':{'SessionId':{'$in':_[_0x3860('0x2c')](_0x16a462,'id')},'ProjectId':_0x1a9f4e['params']['id']},'order':_0x3860('0x65')});}})['then'](handleEntityNotFound(_0x3d4469,null))[_0x3860('0x23')](function(_0x581e7b){if(_0x581e7b){_0x19ace1=_0x581e7b;var _0x256156={};for(var _0x418bb1=0x0,_0x33e7c1=_0x19ace1[_0x3860('0x38')];_0x418bb1<_0x33e7c1;_0x418bb1++){if(!_0x256156[_0x3860('0x39')](_0x19ace1[_0x418bb1][_0x3860('0x66')])){_0x256156[_0x19ace1[_0x418bb1][_0x3860('0x66')]]=needsEncapsulation(_0x19ace1[_0x418bb1][_0x3860('0x67')])?encapsulate(_0x19ace1[_0x418bb1][_0x3860('0x67')]):_0x19ace1[_0x418bb1][_0x3860('0x67')];}}var _0x10b4e8=[],_0x33fed2={};for(var _0x300837=0x0,_0x192136=_0x16a462[_0x3860('0x38')];_0x300837<_0x192136;_0x300837++){_0x33fed2={'ProjectId':_0x1a9f4e[_0x3860('0x48')]['id'],'SessionId':_0x16a462[_0x300837]['id'],'StartTime':moment(_0x16a462[_0x300837][_0x3860('0x68')])[_0x3860('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x37575b=0x0,_0x1d6d2b=_0x19ace1[_0x3860('0x38')];_0x37575b<_0x1d6d2b;_0x37575b++){if(_0x19ace1[_0x37575b][_0x3860('0x6a')]==_0x16a462[_0x300837]['id']&&_0x256156[_0x3860('0x39')](_0x19ace1[_0x37575b][_0x3860('0x66')])){_0x33fed2[_0x256156[_0x19ace1[_0x37575b][_0x3860('0x66')]]]=_0x19ace1[_0x37575b][_0x3860('0x6b')];}}for(var _0x222e5a in _0x256156){if(!_0x33fed2[_0x3860('0x39')](_0x256156[_0x222e5a])){_0x33fed2[_0x256156[_0x222e5a]]=null;}}_0x10b4e8[_0x3860('0x6c')](_0x33fed2);}return _0x10b4e8;}})['then'](function(_0x252c19){if(!_[_0x3860('0x6d')](_0x252c19)){var _0x666daa=toCsv(_0x252c19);var _0x6334ca=Date['now']();fs[_0x3860('0x6e')](util[_0x3860('0x69')](_0x3860('0x6f'),_0x1a9f4e[_0x3860('0x48')]['id'],_0x6334ca),_0x666daa);_0x3d4469['setHeader'](_0x3860('0x70'),'attachment;\x20filename='+util['format'](_0x3860('0x71'),_0x1a9f4e[_0x3860('0x48')]['id'],_0x6334ca));_0x3d4469[_0x3860('0x72')](_0x3860('0x73'),_0x3860('0x74'));return _0x3d4469[_0x3860('0x75')](util[_0x3860('0x69')](_0x3860('0x6f'),_0x1a9f4e[_0x3860('0x48')]['id'],_0x6334ca));}else{return _0x3d4469[_0x3860('0x15')](0xcc);}})[_0x3860('0x4a')](handleError(_0x3d4469,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index cbf414b..5ead04d 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 _0xff2a=['bluebird','path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','util','../../config/logger','moment'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0xff2a,0x93));var _0xaff2=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0xff2a[_0x28611e];return _0x530f69;};'use strict';var _=require('lodash');var util=require(_0xaff2('0x0'));var logger=require(_0xaff2('0x1'))('api');var moment=require(_0xaff2('0x2'));var BPromise=require(_0xaff2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaff2('0x4'));var rimraf=require('rimraf');var config=require(_0xaff2('0x5'));var attributes=require(_0xaff2('0x6'));module['exports']=function(_0x70cadf,_0x8313e5){return _0x70cadf[_0xaff2('0x7')](_0xaff2('0x8'),attributes,{'tableName':_0xaff2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadf0=['JscriptyProject','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xadf0,0x12d));var _0x0adf=function(_0x599a5e,_0x186da8){_0x599a5e=_0x599a5e-0x0;var _0x2c29e5=_0xadf0[_0x599a5e];return _0x2c29e5;};'use strict';var _=require('lodash');var util=require(_0x0adf('0x0'));var logger=require(_0x0adf('0x1'))(_0x0adf('0x2'));var moment=require(_0x0adf('0x3'));var BPromise=require(_0x0adf('0x4'));var rp=require(_0x0adf('0x5'));var fs=require('fs');var path=require(_0x0adf('0x6'));var rimraf=require('rimraf');var config=require(_0x0adf('0x7'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x5b01b9,_0x516b05){return _0x5b01b9[_0x0adf('0x8')](_0x0adf('0x9'),attributes,{'tableName':'jscripty_projects','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 684360c..21f713c 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x305b28,_0x32af9e){var _0x2d62fd=function(_0x17ce9a){while(--_0x17ce9a){_0x305b28['push'](_0x305b28['shift']());}};_0x2d62fd(++_0x32af9e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xcb91[_0x57e00e];return _0x415e60;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x4d1e90,_0x58536f){var _0x427263=function(_0x1d5f39){while(--_0x1d5f39){_0x4d1e90['push'](_0x4d1e90['shift']());}};_0x427263(++_0x58536f);}(_0x54ef,0x112));var _0xf54e=function(_0x3565c2,_0x41d17d){_0x3565c2=_0x3565c2-0x0;var _0x18a620=_0x54ef[_0x3565c2];return _0x18a620;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 63d36fc..c263b1e 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 _0x5d12=['/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index'];(function(_0x9039e6,_0x939aaf){var _0x777cd7=function(_0x4b0c6f){while(--_0x4b0c6f){_0x9039e6['push'](_0x9039e6['shift']());}};_0x777cd7(++_0x939aaf);}(_0x5d12,0x155));var _0x25d1=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x5d12[_0x342baa];return _0x1208f3;};'use strict';var multer=require(_0x25d1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x25d1('0x1'));var express=require(_0x25d1('0x2'));var router=express['Router']();var fs_extra=require(_0x25d1('0x3'));var auth=require(_0x25d1('0x4'));var interaction=require(_0x25d1('0x5'));var config=require(_0x25d1('0x6'));var controller=require(_0x25d1('0x7'));router[_0x25d1('0x8')]('/',auth[_0x25d1('0x9')](),controller[_0x25d1('0xa')]);router[_0x25d1('0x8')](_0x25d1('0xb'),auth[_0x25d1('0x9')](),controller[_0x25d1('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x25d1('0xd')]);router[_0x25d1('0xe')]('/',auth['isAuthenticated'](),controller[_0x25d1('0xf')]);router[_0x25d1('0x10')](_0x25d1('0x11'),auth[_0x25d1('0x9')](),controller[_0x25d1('0x12')]);router[_0x25d1('0x13')](_0x25d1('0x11'),auth[_0x25d1('0x9')](),controller[_0x25d1('0x14')]);module[_0x25d1('0x15')]=router; \ No newline at end of file +var _0x76f2=['/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe'];(function(_0x5286b4,_0x1d0d05){var _0x2b7fa9=function(_0x45eb15){while(--_0x45eb15){_0x5286b4['push'](_0x5286b4['shift']());}};_0x2b7fa9(++_0x1d0d05);}(_0x76f2,0x184));var _0x276f=function(_0x3b0c7d,_0x366c62){_0x3b0c7d=_0x3b0c7d-0x0;var _0x342b64=_0x76f2[_0x3b0c7d];return _0x342b64;};'use strict';var multer=require('multer');var util=require(_0x276f('0x0'));var path=require(_0x276f('0x1'));var timeout=require(_0x276f('0x2'));var express=require('express');var router=express[_0x276f('0x3')]();var fs_extra=require(_0x276f('0x4'));var auth=require(_0x276f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x276f('0x6'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x276f('0x7')](),controller[_0x276f('0x8')]);router['get'](_0x276f('0x9'),auth[_0x276f('0x7')](),controller[_0x276f('0xa')]);router['get'](_0x276f('0xb'),auth[_0x276f('0x7')](),controller[_0x276f('0xc')]);router[_0x276f('0xd')]('/',auth['isAuthenticated'](),controller[_0x276f('0xe')]);router[_0x276f('0xf')]('/:id',auth[_0x276f('0x7')](),controller[_0x276f('0x10')]);router[_0x276f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x276f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index fbb3ca1..90ea25d 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x18c8af,_0x240e66){_0x18c8af=_0x18c8af-0x0;var _0x245826=_0x7a54[_0x18c8af];return _0x245826;};'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(_0x537af8,_0x17d66e){_0x537af8=_0x537af8-0x0;var _0x25b234=_0x7a54[_0x537af8];return _0x25b234;};'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 2274cea..23a9e86 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 _0x3958=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','JscriptyQuestionReport','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','rawAttributes','find','catch','create','body','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x20d057,_0x1f77a9){var _0x1694df=function(_0x436b50){while(--_0x436b50){_0x20d057['push'](_0x20d057['shift']());}};_0x1694df(++_0x1f77a9);}(_0x3958,0xe0));var _0x8395=function(_0x211a04,_0x12dd63){_0x211a04=_0x211a04-0x0;var _0x39b04d=_0x3958[_0x211a04];return _0x39b04d;};'use strict';var emlformat=require(_0x8395('0x0'));var rimraf=require(_0x8395('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8395('0x2'));var moment=require(_0x8395('0x3'));var BPromise=require(_0x8395('0x4'));var Mustache=require(_0x8395('0x5'));var util=require(_0x8395('0x6'));var path=require(_0x8395('0x7'));var sox=require(_0x8395('0x8'));var csv=require('to-csv');var ejs=require(_0x8395('0x9'));var fs=require('fs');var fs_extra=require(_0x8395('0xa'));var _=require(_0x8395('0xb'));var squel=require(_0x8395('0xc'));var crypto=require(_0x8395('0xd'));var jsforce=require(_0x8395('0xe'));var deskjs=require(_0x8395('0xf'));var toCsv=require(_0x8395('0x10'));var querystring=require(_0x8395('0x11'));var Papa=require(_0x8395('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8395('0x13'));var as=require(_0x8395('0x14'));var hardwareService=require(_0x8395('0x15'));var logger=require(_0x8395('0x16'))(_0x8395('0x17'));var utils=require(_0x8395('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8395('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fd0b5,_0x5e1680){_0x5e1680=_0x5e1680||0xcc;return function(_0xc8c441){if(_0xc8c441){return _0x4fd0b5[_0x8395('0x1a')](_0x5e1680);}return _0x4fd0b5[_0x8395('0x1b')](_0x5e1680)[_0x8395('0x1c')]();};}function respondWithResult(_0x1d4fb8,_0xb2be1d){_0xb2be1d=_0xb2be1d||0xc8;return function(_0x390399){if(_0x390399){return _0x1d4fb8[_0x8395('0x1b')](_0xb2be1d)[_0x8395('0x1d')](_0x390399);}};}function respondWithFilteredResult(_0xfc43ea,_0x15c6b8){return function(_0x4df943){if(_0x4df943){var _0x287778=typeof _0x15c6b8[_0x8395('0x1e')]===_0x8395('0x1f')&&typeof _0x15c6b8[_0x8395('0x20')]===_0x8395('0x1f');var _0x373086=_0x4df943[_0x8395('0x21')];var _0x1edd63=_0x287778?0x0:_0x15c6b8[_0x8395('0x1e')];var _0x5ac169=_0x287778?_0x4df943['count']:_0x15c6b8[_0x8395('0x1e')]+_0x15c6b8[_0x8395('0x20')];var _0x1a0d00;if(_0x5ac169>=_0x373086){_0x5ac169=_0x373086;_0x1a0d00=0xc8;}else{_0x1a0d00=0xce;}_0xfc43ea[_0x8395('0x1b')](_0x1a0d00);return _0xfc43ea[_0x8395('0x22')](_0x8395('0x23'),_0x1edd63+'-'+_0x5ac169+'/'+_0x373086)['json'](_0x4df943);}return null;};}function patchUpdates(_0x102226){return function(_0x388c3f){try{jsonpatch[_0x8395('0x24')](_0x388c3f,_0x102226,!![]);}catch(_0x33bb13){return BPromise[_0x8395('0x25')](_0x33bb13);}return _0x388c3f[_0x8395('0x26')]();};}function saveUpdates(_0x2775e7,_0x300d1b){return function(_0xb31203){if(_0xb31203){return _0xb31203[_0x8395('0x27')](_0x2775e7)[_0x8395('0x28')](function(_0x283a31){return _0x283a31;});}return null;};}function removeEntity(_0x81a2e0,_0x1eb2cd){return function(_0x29074b){if(_0x29074b){return _0x29074b['destroy']()[_0x8395('0x28')](function(){_0x81a2e0[_0x8395('0x1b')](0xcc)[_0x8395('0x1c')]();});}};}function handleEntityNotFound(_0x19116b,_0x5523d6){return function(_0x5d0a17){if(!_0x5d0a17){_0x19116b['sendStatus'](0x194);}return _0x5d0a17;};}function handleError(_0x3dde13,_0x31308f){_0x31308f=_0x31308f||0x1f4;return function(_0x2f3665){logger[_0x8395('0x29')](_0x2f3665[_0x8395('0x2a')]);if(_0x2f3665['name']){delete _0x2f3665[_0x8395('0x2b')];}_0x3dde13[_0x8395('0x1b')](_0x31308f)['send'](_0x2f3665);};}exports[_0x8395('0x2c')]=function(_0x4c9478,_0xa6c92f){var _0x487741={},_0x2a69c9={},_0x5caee3={'count':0x0,'rows':[]};var _0x353e06=_['map'](db[_0x8395('0x2d')]['rawAttributes'],function(_0x88c6fd){return{'name':_0x88c6fd[_0x8395('0x2e')],'type':_0x88c6fd[_0x8395('0x2f')][_0x8395('0x30')]};});_0x2a69c9['model']=_[_0x8395('0x31')](_0x353e06,_0x8395('0x2b'));_0x2a69c9[_0x8395('0x32')]=_[_0x8395('0x33')](_0x4c9478[_0x8395('0x32')]);_0x2a69c9[_0x8395('0x34')]=_[_0x8395('0x35')](_0x2a69c9['model'],_0x2a69c9['query']);_0x487741[_0x8395('0x36')]=_[_0x8395('0x35')](_0x2a69c9[_0x8395('0x37')],qs[_0x8395('0x38')](_0x4c9478[_0x8395('0x32')]['fields']));_0x487741[_0x8395('0x36')]=_0x487741[_0x8395('0x36')][_0x8395('0x39')]?_0x487741[_0x8395('0x36')]:_0x2a69c9[_0x8395('0x37')];if(!_0x4c9478[_0x8395('0x32')][_0x8395('0x3a')](_0x8395('0x3b'))){_0x487741[_0x8395('0x20')]=qs[_0x8395('0x20')](_0x4c9478[_0x8395('0x32')]['limit']);_0x487741['offset']=qs[_0x8395('0x1e')](_0x4c9478[_0x8395('0x32')][_0x8395('0x1e')]);}_0x487741[_0x8395('0x3c')]=qs[_0x8395('0x3d')](_0x4c9478['query'][_0x8395('0x3d')]);_0x487741[_0x8395('0x3e')]=qs[_0x8395('0x34')](_[_0x8395('0x3f')](_0x4c9478[_0x8395('0x32')],_0x2a69c9[_0x8395('0x34')]),_0x353e06);if(_0x4c9478[_0x8395('0x32')][_0x8395('0x40')]){_0x487741[_0x8395('0x3e')]=_[_0x8395('0x41')](_0x487741[_0x8395('0x3e')],{'$or':_[_0x8395('0x31')](_0x353e06,function(_0xbd5e37){if(_0xbd5e37['type']!==_0x8395('0x42')){var _0x5684bc={};_0x5684bc[_0xbd5e37['name']]={'$like':'%'+_0x4c9478['query']['filter']+'%'};return _0x5684bc;}})});}_0x487741=_[_0x8395('0x41')]({},_0x487741,_0x4c9478['options']);var _0x4c7cce={'where':_0x487741[_0x8395('0x3e')]};return db['JscriptyQuestionReport'][_0x8395('0x21')](_0x4c7cce)[_0x8395('0x28')](function(_0x1831bf){_0x5caee3['count']=_0x1831bf;if(_0x4c9478[_0x8395('0x32')][_0x8395('0x43')]){_0x487741['include']=[{'all':!![]}];}return db[_0x8395('0x2d')][_0x8395('0x44')](_0x487741);})[_0x8395('0x28')](function(_0x56e763){_0x5caee3[_0x8395('0x45')]=_0x56e763;return _0x5caee3;})[_0x8395('0x28')](respondWithFilteredResult(_0xa6c92f,_0x487741))['catch'](handleError(_0xa6c92f,null));};exports[_0x8395('0x46')]=function(_0x467eae,_0x7ef70b){var _0x10a308={'raw':!![],'where':{'id':_0x467eae['params']['id']}},_0x287101={};_0x287101[_0x8395('0x37')]=_[_0x8395('0x33')](db[_0x8395('0x2d')][_0x8395('0x47')]);_0x287101[_0x8395('0x32')]=_[_0x8395('0x33')](_0x467eae[_0x8395('0x32')]);_0x287101[_0x8395('0x34')]=_[_0x8395('0x35')](_0x287101[_0x8395('0x37')],_0x287101[_0x8395('0x32')]);_0x10a308[_0x8395('0x36')]=_[_0x8395('0x35')](_0x287101['model'],qs[_0x8395('0x38')](_0x467eae[_0x8395('0x32')]['fields']));_0x10a308['attributes']=_0x10a308[_0x8395('0x36')]['length']?_0x10a308[_0x8395('0x36')]:_0x287101['model'];if(_0x467eae['query'][_0x8395('0x43')]){_0x10a308['include']=[{'all':!![]}];}_0x10a308=_[_0x8395('0x41')]({},_0x10a308,_0x467eae['options']);return db[_0x8395('0x2d')][_0x8395('0x48')](_0x10a308)[_0x8395('0x28')](handleEntityNotFound(_0x7ef70b,null))[_0x8395('0x28')](respondWithResult(_0x7ef70b,null))[_0x8395('0x49')](handleError(_0x7ef70b,null));};exports[_0x8395('0x4a')]=function(_0x30fe62,_0x2ed6a8){return db[_0x8395('0x2d')]['create'](_0x30fe62['body'],{})['then'](respondWithResult(_0x2ed6a8,0xc9))[_0x8395('0x49')](handleError(_0x2ed6a8,null));};exports[_0x8395('0x27')]=function(_0x2aafa,_0x3d22e8){if(_0x2aafa[_0x8395('0x4b')]['id']){delete _0x2aafa[_0x8395('0x4b')]['id'];}return db[_0x8395('0x2d')][_0x8395('0x48')]({'where':{'id':_0x2aafa[_0x8395('0x4c')]['id']}})[_0x8395('0x28')](handleEntityNotFound(_0x3d22e8,null))[_0x8395('0x28')](saveUpdates(_0x2aafa[_0x8395('0x4b')],null))[_0x8395('0x28')](respondWithResult(_0x3d22e8,null))[_0x8395('0x49')](handleError(_0x3d22e8,null));};exports[_0x8395('0x4d')]=function(_0x3dc467,_0x13449c){return db[_0x8395('0x2d')]['find']({'where':{'id':_0x3dc467[_0x8395('0x4c')]['id']}})['then'](handleEntityNotFound(_0x13449c,null))[_0x8395('0x28')](removeEntity(_0x13449c,null))[_0x8395('0x49')](handleError(_0x13449c,null));};exports['describe']=function(_0x32acba,_0x842de2){return db['JscriptyQuestionReport']['describe']()[_0x8395('0x28')](respondWithResult(_0x842de2,null))[_0x8395('0x49')](handleError(_0x842de2,null));}; \ No newline at end of file +var _0x0171=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','order','where','filter','VIRTUAL','merge','options','count','includeAll','include','JscriptyQuestionReport','findAll','rows','show','params','keys','length','find','catch','create'];(function(_0x4a7b64,_0x16733c){var _0x500da6=function(_0x3454da){while(--_0x3454da){_0x4a7b64['push'](_0x4a7b64['shift']());}};_0x500da6(++_0x16733c);}(_0x0171,0xe0));var _0x1017=function(_0x497403,_0x14ae9b){_0x497403=_0x497403-0x0;var _0x14ace7=_0x0171[_0x497403];return _0x14ace7;};'use strict';var emlformat=require(_0x1017('0x0'));var rimraf=require(_0x1017('0x1'));var zipdir=require(_0x1017('0x2'));var jsonpatch=require(_0x1017('0x3'));var rp=require('request-promise');var moment=require(_0x1017('0x4'));var BPromise=require(_0x1017('0x5'));var Mustache=require(_0x1017('0x6'));var util=require(_0x1017('0x7'));var path=require(_0x1017('0x8'));var sox=require(_0x1017('0x9'));var csv=require(_0x1017('0xa'));var ejs=require(_0x1017('0xb'));var fs=require('fs');var fs_extra=require(_0x1017('0xc'));var _=require(_0x1017('0xd'));var squel=require(_0x1017('0xe'));var crypto=require(_0x1017('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1017('0xa'));var querystring=require(_0x1017('0x10'));var Papa=require(_0x1017('0x11'));var Redis=require(_0x1017('0x12'));var authService=require(_0x1017('0x13'));var qs=require(_0x1017('0x14'));var as=require(_0x1017('0x15'));var hardwareService=require(_0x1017('0x16'));var logger=require(_0x1017('0x17'))('api');var utils=require(_0x1017('0x18'));var config=require(_0x1017('0x19'));var licenseUtil=require(_0x1017('0x1a'));var db=require(_0x1017('0x1b'))['db'];function respondWithStatusCode(_0x3f3a7c,_0x4ffe8b){_0x4ffe8b=_0x4ffe8b||0xcc;return function(_0x394695){if(_0x394695){return _0x3f3a7c[_0x1017('0x1c')](_0x4ffe8b);}return _0x3f3a7c[_0x1017('0x1d')](_0x4ffe8b)[_0x1017('0x1e')]();};}function respondWithResult(_0x239e5d,_0xb98a50){_0xb98a50=_0xb98a50||0xc8;return function(_0xfe6927){if(_0xfe6927){return _0x239e5d[_0x1017('0x1d')](_0xb98a50)[_0x1017('0x1f')](_0xfe6927);}};}function respondWithFilteredResult(_0x379557,_0x32ba1f){return function(_0x4132b6){if(_0x4132b6){var _0x3d57a9=typeof _0x32ba1f[_0x1017('0x20')]==='undefined'&&typeof _0x32ba1f[_0x1017('0x21')]==='undefined';var _0x43a97a=_0x4132b6['count'];var _0x344020=_0x3d57a9?0x0:_0x32ba1f[_0x1017('0x20')];var _0x834cc3=_0x3d57a9?_0x4132b6['count']:_0x32ba1f[_0x1017('0x20')]+_0x32ba1f['limit'];var _0x33c78c;if(_0x834cc3>=_0x43a97a){_0x834cc3=_0x43a97a;_0x33c78c=0xc8;}else{_0x33c78c=0xce;}_0x379557['status'](_0x33c78c);return _0x379557[_0x1017('0x22')](_0x1017('0x23'),_0x344020+'-'+_0x834cc3+'/'+_0x43a97a)[_0x1017('0x1f')](_0x4132b6);}return null;};}function patchUpdates(_0x42d1d1){return function(_0x18f338){try{jsonpatch['apply'](_0x18f338,_0x42d1d1,!![]);}catch(_0x242b6c){return BPromise[_0x1017('0x24')](_0x242b6c);}return _0x18f338['save']();};}function saveUpdates(_0x2c2c67,_0x173f8c){return function(_0x3c4df4){if(_0x3c4df4){return _0x3c4df4[_0x1017('0x25')](_0x2c2c67)[_0x1017('0x26')](function(_0x3af002){return _0x3af002;});}return null;};}function removeEntity(_0x2f34a7,_0x4920fb){return function(_0x3d9741){if(_0x3d9741){return _0x3d9741[_0x1017('0x27')]()['then'](function(){_0x2f34a7[_0x1017('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ae7e4,_0x3cca3b){return function(_0x3e6d74){if(!_0x3e6d74){_0x4ae7e4['sendStatus'](0x194);}return _0x3e6d74;};}function handleError(_0x37028a,_0x32e420){_0x32e420=_0x32e420||0x1f4;return function(_0x2fd4ab){logger[_0x1017('0x28')](_0x2fd4ab['stack']);if(_0x2fd4ab[_0x1017('0x29')]){delete _0x2fd4ab[_0x1017('0x29')];}_0x37028a[_0x1017('0x1d')](_0x32e420)[_0x1017('0x2a')](_0x2fd4ab);};}exports['index']=function(_0x519ad7,_0x2cb2b4){var _0x55621b={},_0x27d349={},_0x81a020={'count':0x0,'rows':[]};var _0x5af889=_[_0x1017('0x2b')](db['JscriptyQuestionReport'][_0x1017('0x2c')],function(_0x5bdfee){return{'name':_0x5bdfee[_0x1017('0x2d')],'type':_0x5bdfee[_0x1017('0x2e')]['key']};});_0x27d349['model']=_[_0x1017('0x2b')](_0x5af889,_0x1017('0x29'));_0x27d349[_0x1017('0x2f')]=_['keys'](_0x519ad7[_0x1017('0x2f')]);_0x27d349[_0x1017('0x30')]=_[_0x1017('0x31')](_0x27d349[_0x1017('0x32')],_0x27d349['query']);_0x55621b[_0x1017('0x33')]=_[_0x1017('0x31')](_0x27d349['model'],qs[_0x1017('0x34')](_0x519ad7[_0x1017('0x2f')][_0x1017('0x34')]));_0x55621b['attributes']=_0x55621b[_0x1017('0x33')]['length']?_0x55621b[_0x1017('0x33')]:_0x27d349[_0x1017('0x32')];if(!_0x519ad7[_0x1017('0x2f')]['hasOwnProperty']('nolimit')){_0x55621b[_0x1017('0x21')]=qs[_0x1017('0x21')](_0x519ad7['query']['limit']);_0x55621b[_0x1017('0x20')]=qs['offset'](_0x519ad7['query'][_0x1017('0x20')]);}_0x55621b[_0x1017('0x35')]=qs['sort'](_0x519ad7['query']['sort']);_0x55621b[_0x1017('0x36')]=qs[_0x1017('0x30')](_['pick'](_0x519ad7[_0x1017('0x2f')],_0x27d349['filters']),_0x5af889);if(_0x519ad7[_0x1017('0x2f')][_0x1017('0x37')]){_0x55621b['where']=_['merge'](_0x55621b[_0x1017('0x36')],{'$or':_[_0x1017('0x2b')](_0x5af889,function(_0x496f97){if(_0x496f97[_0x1017('0x2e')]!==_0x1017('0x38')){var _0x45303b={};_0x45303b[_0x496f97['name']]={'$like':'%'+_0x519ad7['query']['filter']+'%'};return _0x45303b;}})});}_0x55621b=_[_0x1017('0x39')]({},_0x55621b,_0x519ad7[_0x1017('0x3a')]);var _0x10d1e3={'where':_0x55621b[_0x1017('0x36')]};return db['JscriptyQuestionReport'][_0x1017('0x3b')](_0x10d1e3)[_0x1017('0x26')](function(_0x36e518){_0x81a020['count']=_0x36e518;if(_0x519ad7[_0x1017('0x2f')][_0x1017('0x3c')]){_0x55621b[_0x1017('0x3d')]=[{'all':!![]}];}return db[_0x1017('0x3e')][_0x1017('0x3f')](_0x55621b);})['then'](function(_0x2995dd){_0x81a020[_0x1017('0x40')]=_0x2995dd;return _0x81a020;})[_0x1017('0x26')](respondWithFilteredResult(_0x2cb2b4,_0x55621b))['catch'](handleError(_0x2cb2b4,null));};exports[_0x1017('0x41')]=function(_0x15b60f,_0x411589){var _0x746469={'raw':!![],'where':{'id':_0x15b60f[_0x1017('0x42')]['id']}},_0xf4282d={};_0xf4282d[_0x1017('0x32')]=_[_0x1017('0x43')](db['JscriptyQuestionReport']['rawAttributes']);_0xf4282d[_0x1017('0x2f')]=_['keys'](_0x15b60f['query']);_0xf4282d['filters']=_[_0x1017('0x31')](_0xf4282d[_0x1017('0x32')],_0xf4282d[_0x1017('0x2f')]);_0x746469[_0x1017('0x33')]=_[_0x1017('0x31')](_0xf4282d[_0x1017('0x32')],qs['fields'](_0x15b60f[_0x1017('0x2f')][_0x1017('0x34')]));_0x746469[_0x1017('0x33')]=_0x746469[_0x1017('0x33')][_0x1017('0x44')]?_0x746469[_0x1017('0x33')]:_0xf4282d[_0x1017('0x32')];if(_0x15b60f['query'][_0x1017('0x3c')]){_0x746469[_0x1017('0x3d')]=[{'all':!![]}];}_0x746469=_['merge']({},_0x746469,_0x15b60f[_0x1017('0x3a')]);return db[_0x1017('0x3e')][_0x1017('0x45')](_0x746469)[_0x1017('0x26')](handleEntityNotFound(_0x411589,null))[_0x1017('0x26')](respondWithResult(_0x411589,null))[_0x1017('0x46')](handleError(_0x411589,null));};exports[_0x1017('0x47')]=function(_0x5f0cce,_0x501532){return db[_0x1017('0x3e')][_0x1017('0x47')](_0x5f0cce[_0x1017('0x48')],{})[_0x1017('0x26')](respondWithResult(_0x501532,0xc9))['catch'](handleError(_0x501532,null));};exports[_0x1017('0x25')]=function(_0x50eaf1,_0x1bf2c5){if(_0x50eaf1[_0x1017('0x48')]['id']){delete _0x50eaf1['body']['id'];}return db[_0x1017('0x3e')][_0x1017('0x45')]({'where':{'id':_0x50eaf1[_0x1017('0x42')]['id']}})[_0x1017('0x26')](handleEntityNotFound(_0x1bf2c5,null))[_0x1017('0x26')](saveUpdates(_0x50eaf1[_0x1017('0x48')],null))[_0x1017('0x26')](respondWithResult(_0x1bf2c5,null))[_0x1017('0x46')](handleError(_0x1bf2c5,null));};exports[_0x1017('0x27')]=function(_0x1214ed,_0x2d2dad){return db[_0x1017('0x3e')]['find']({'where':{'id':_0x1214ed[_0x1017('0x42')]['id']}})[_0x1017('0x26')](handleEntityNotFound(_0x2d2dad,null))[_0x1017('0x26')](removeEntity(_0x2d2dad,null))[_0x1017('0x46')](handleError(_0x2d2dad,null));};exports['describe']=function(_0x3fcb5e,_0x9286cc){return db[_0x1017('0x3e')][_0x1017('0x49')]()['then'](respondWithResult(_0x9286cc,null))[_0x1017('0x46')](handleError(_0x9286cc,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 97bab9e..dfd88a7 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 _0x5568=['api','bluebird','request-promise','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x4df0fd,_0x32e558){var _0x1fabf6=function(_0x13d985){while(--_0x13d985){_0x4df0fd['push'](_0x4df0fd['shift']());}};_0x1fabf6(++_0x32e558);}(_0x5568,0x7d));var _0x8556=function(_0x19090d,_0x5351e3){_0x19090d=_0x19090d-0x0;var _0x10ea35=_0x5568[_0x19090d];return _0x10ea35;};'use strict';var _=require('lodash');var util=require(_0x8556('0x0'));var logger=require('../../config/logger')(_0x8556('0x1'));var moment=require('moment');var BPromise=require(_0x8556('0x2'));var rp=require(_0x8556('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8556('0x4'));module[_0x8556('0x5')]=function(_0x303f85,_0x5efe45){return _0x303f85[_0x8556('0x6')](_0x8556('0x7'),attributes,{'tableName':_0x8556('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0e=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a726e,_0x165940){var _0x3c70e4=function(_0x11b65d){while(--_0x11b65d){_0x5a726e['push'](_0x5a726e['shift']());}};_0x3c70e4(++_0x165940);}(_0x0b0e,0x13c));var _0xe0b0=function(_0x1699e9,_0x1f2652){_0x1699e9=_0x1699e9-0x0;var _0x14b104=_0x0b0e[_0x1699e9];return _0x14b104;};'use strict';var _=require('lodash');var util=require(_0xe0b0('0x0'));var logger=require(_0xe0b0('0x1'))(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var rp=require(_0xe0b0('0x5'));var fs=require('fs');var path=require(_0xe0b0('0x6'));var rimraf=require(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var attributes=require(_0xe0b0('0x9'));module[_0xe0b0('0xa')]=function(_0x36de9e,_0x1efff9){return _0x36de9e[_0xe0b0('0xb')](_0xe0b0('0xc'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index bae3957..a7fdaa2 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 _0x61ca=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2c869d,_0x139e0f){var _0xd36b5c=function(_0x1a0b4e){while(--_0x1a0b4e){_0x2c869d['push'](_0x2c869d['shift']());}};_0xd36b5c(++_0x139e0f);}(_0x61ca,0x1cc));var _0xa61c=function(_0x265094,_0x18c961){_0x265094=_0x265094-0x0;var _0x71f9c2=_0x61ca[_0x265094];return _0x71f9c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa61c('0x0'));var BPromise=require(_0xa61c('0x1'));var rs=require(_0xa61c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa61c('0x3'))['db'];var utils=require(_0xa61c('0x4'));var logger=require(_0xa61c('0x5'))(_0xa61c('0x6'));var config=require(_0xa61c('0x7'));var jayson=require(_0xa61c('0x8'));var client=jayson[_0xa61c('0x9')][_0xa61c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3db793,_0x434657,_0x3104bc){return new BPromise(function(_0x26b6c5,_0x50a958){return client['request'](_0x3db793,_0x3104bc)[_0xa61c('0xb')](function(_0x4ff021){logger[_0xa61c('0xc')](_0xa61c('0xd'),_0x434657,_0xa61c('0xe'));logger[_0xa61c('0xf')](_0xa61c('0x10'),_0x434657,_0xa61c('0xe'),JSON[_0xa61c('0x11')](_0x4ff021));if(_0x4ff021[_0xa61c('0x12')]){if(_0x4ff021['error'][_0xa61c('0x13')]===0x1f4){logger[_0xa61c('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x434657,_0x4ff021[_0xa61c('0x12')]['message']);return _0x50a958(_0x4ff021['error'][_0xa61c('0x14')]);}logger[_0xa61c('0x12')](_0xa61c('0xd'),_0x434657,_0x4ff021[_0xa61c('0x12')][_0xa61c('0x14')]);return _0x26b6c5(_0x4ff021['error'][_0xa61c('0x14')]);}else{logger['info'](_0xa61c('0xd'),_0x434657,_0xa61c('0xe'));_0x26b6c5(_0x4ff021[_0xa61c('0x15')][_0xa61c('0x14')]);}})[_0xa61c('0x16')](function(_0x5ad89e){logger['error'](_0xa61c('0xd'),_0x434657,_0x5ad89e);_0x50a958(_0x5ad89e);});});} \ No newline at end of file +var _0x4aaf=['JscriptyQuestionReport,\x20%s,\x20%s','message','catch','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x73313f,_0x51ea6d){var _0x388218=function(_0x5943dd){while(--_0x5943dd){_0x73313f['push'](_0x73313f['shift']());}};_0x388218(++_0x51ea6d);}(_0x4aaf,0x1a7));var _0xf4aa=function(_0x1dd038,_0xc6ea1c){_0x1dd038=_0x1dd038-0x0;var _0x2ce62b=_0x4aaf[_0x1dd038];return _0x2ce62b;};'use strict';var _=require('lodash');var util=require(_0xf4aa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4aa('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4aa('0x2'));var logger=require(_0xf4aa('0x3'))(_0xf4aa('0x4'));var config=require(_0xf4aa('0x5'));var jayson=require(_0xf4aa('0x6'));var client=jayson[_0xf4aa('0x7')][_0xf4aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x164b5e,_0x223231,_0x319eb4){return new BPromise(function(_0x4b86c6,_0x29c4d0){return client[_0xf4aa('0x9')](_0x164b5e,_0x319eb4)[_0xf4aa('0xa')](function(_0x563775){logger[_0xf4aa('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x223231,_0xf4aa('0xc'));logger[_0xf4aa('0xd')](_0xf4aa('0xe'),_0x223231,_0xf4aa('0xc'),JSON[_0xf4aa('0xf')](_0x563775));if(_0x563775[_0xf4aa('0x10')]){if(_0x563775[_0xf4aa('0x10')]['code']===0x1f4){logger[_0xf4aa('0x10')](_0xf4aa('0x11'),_0x223231,_0x563775['error'][_0xf4aa('0x12')]);return _0x29c4d0(_0x563775[_0xf4aa('0x10')][_0xf4aa('0x12')]);}logger[_0xf4aa('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x223231,_0x563775[_0xf4aa('0x10')][_0xf4aa('0x12')]);return _0x4b86c6(_0x563775[_0xf4aa('0x10')][_0xf4aa('0x12')]);}else{logger[_0xf4aa('0xb')](_0xf4aa('0x11'),_0x223231,_0xf4aa('0xc'));_0x4b86c6(_0x563775['result'][_0xf4aa('0x12')]);}})[_0xf4aa('0x13')](function(_0x2a621e){logger['error'](_0xf4aa('0x11'),_0x223231,_0x2a621e);_0x29c4d0(_0x2a621e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ad4aff8..40ffd43 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 _0xef2d=['post','update','delete','exports','util','express','fs-extra','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/questions','getQuestions'];(function(_0x205c87,_0x215e6a){var _0x4d231f=function(_0x3179c0){while(--_0x3179c0){_0x205c87['push'](_0x205c87['shift']());}};_0x4d231f(++_0x215e6a);}(_0xef2d,0x1f4));var _0xdef2=function(_0x248704,_0x35b41f){_0x248704=_0x248704-0x0;var _0x5dafb0=_0xef2d[_0x248704];return _0x5dafb0;};'use strict';var multer=require('multer');var util=require(_0xdef2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdef2('0x1'));var router=express['Router']();var fs_extra=require(_0xdef2('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdef2('0x3'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xdef2('0x4')](),controller[_0xdef2('0x5')]);router[_0xdef2('0x6')]('/describe',auth[_0xdef2('0x4')](),controller[_0xdef2('0x7')]);router[_0xdef2('0x6')](_0xdef2('0x8'),auth[_0xdef2('0x4')](),controller[_0xdef2('0x9')]);router[_0xdef2('0x6')](_0xdef2('0xa'),auth[_0xdef2('0x4')](),controller[_0xdef2('0xb')]);router[_0xdef2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xdef2('0x8'),auth[_0xdef2('0x4')](),controller[_0xdef2('0xd')]);router[_0xdef2('0xe')](_0xdef2('0x8'),auth[_0xdef2('0x4')](),controller['destroy']);module[_0xdef2('0xf')]=router; \ No newline at end of file +var _0x51dd=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/:id/questions'];(function(_0x1c62ab,_0x68fbdf){var _0x21c46c=function(_0x59608e){while(--_0x59608e){_0x1c62ab['push'](_0x1c62ab['shift']());}};_0x21c46c(++_0x68fbdf);}(_0x51dd,0x1f2));var _0xd51d=function(_0x4bbc3a,_0x3a6945){_0x4bbc3a=_0x4bbc3a-0x0;var _0x579d56=_0x51dd[_0x4bbc3a];return _0x579d56;};'use strict';var multer=require(_0xd51d('0x0'));var util=require(_0xd51d('0x1'));var path=require('path');var timeout=require(_0xd51d('0x2'));var express=require(_0xd51d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd51d('0x4'));var interaction=require(_0xd51d('0x5'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xd51d('0x6')]('/',auth[_0xd51d('0x7')](),controller['index']);router[_0xd51d('0x6')](_0xd51d('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xd51d('0x6')](_0xd51d('0x9'),auth['isAuthenticated'](),controller[_0xd51d('0xa')]);router['get'](_0xd51d('0xb'),auth[_0xd51d('0x7')](),controller['getQuestions']);router['post']('/',auth[_0xd51d('0x7')](),controller[_0xd51d('0xc')]);router['put'](_0xd51d('0x9'),auth[_0xd51d('0x7')](),controller[_0xd51d('0xd')]);router[_0xd51d('0xe')]('/:id',auth[_0xd51d('0x7')](),controller[_0xd51d('0xf')]);module[_0xd51d('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7223d83..c39d8e8 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 _0xbd41=['DATE','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports'];(function(_0x3af203,_0x628dc1){var _0x29efb5=function(_0x3e72f0){while(--_0x3e72f0){_0x3af203['push'](_0x3af203['shift']());}};_0x29efb5(++_0x628dc1);}(_0xbd41,0x124));var _0x1bd4=function(_0x542d80,_0x150561){_0x542d80=_0x542d80-0x0;var _0x1f4492=_0xbd41[_0x542d80];return _0x1f4492;};'use strict';var moment=require(_0x1bd4('0x0'));var Sequelize=require('sequelize');module[_0x1bd4('0x1')]={'starttime':{'type':Sequelize[_0x1bd4('0x2')],'set':function(_0xd5a3b4){this[_0x1bd4('0x3')]('starttime',_0xd5a3b4);this[_0x1bd4('0x3')]('endtime',moment()[_0x1bd4('0x4')](_0x1bd4('0x5')));}},'endtime':{'type':Sequelize[_0x1bd4('0x2')]},'membername':{'type':Sequelize[_0x1bd4('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1bd4('0x6')]},'uniqueid':{'type':Sequelize[_0x1bd4('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8558=['DATE','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x32cc8c,_0x45e37b){var _0xd9df6=function(_0x350b99){while(--_0x350b99){_0x32cc8c['push'](_0x32cc8c['shift']());}};_0xd9df6(++_0x45e37b);}(_0x8558,0x1b1));var _0x8855=function(_0xd9c06b,_0x43b095){_0xd9c06b=_0xd9c06b-0x0;var _0x393435=_0x8558[_0xd9c06b];return _0x393435;};'use strict';var moment=require(_0x8855('0x0'));var Sequelize=require(_0x8855('0x1'));module[_0x8855('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x40dad9){this[_0x8855('0x3')]('starttime',_0x40dad9);this['setDataValue'](_0x8855('0x4'),moment()[_0x8855('0x5')](_0x8855('0x6')));}},'endtime':{'type':Sequelize[_0x8855('0x7')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8855('0x8')]},'calleridnum':{'type':Sequelize[_0x8855('0x8')]},'completed':{'type':Sequelize[_0x8855('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index ff306e7..0f03d4d 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 _0x1a76=['VIRTUAL','merge','options','findAll','rows','catch','params','length','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','includeAll','include','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a76,0x10b));var _0x61a7=function(_0x2460d9,_0x15da87){_0x2460d9=_0x2460d9-0x0;var _0x4bc204=_0x1a76[_0x2460d9];return _0x4bc204;};'use strict';var emlformat=require(_0x61a7('0x0'));var rimraf=require(_0x61a7('0x1'));var zipdir=require(_0x61a7('0x2'));var jsonpatch=require(_0x61a7('0x3'));var rp=require('request-promise');var moment=require(_0x61a7('0x4'));var BPromise=require(_0x61a7('0x5'));var Mustache=require(_0x61a7('0x6'));var util=require('util');var path=require(_0x61a7('0x7'));var sox=require(_0x61a7('0x8'));var csv=require('to-csv');var ejs=require(_0x61a7('0x9'));var fs=require('fs');var fs_extra=require(_0x61a7('0xa'));var _=require('lodash');var squel=require(_0x61a7('0xb'));var crypto=require(_0x61a7('0xc'));var jsforce=require(_0x61a7('0xd'));var deskjs=require(_0x61a7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x61a7('0xf'));var Papa=require(_0x61a7('0x10'));var Redis=require(_0x61a7('0x11'));var authService=require(_0x61a7('0x12'));var qs=require(_0x61a7('0x13'));var as=require(_0x61a7('0x14'));var hardwareService=require(_0x61a7('0x15'));var logger=require(_0x61a7('0x16'))(_0x61a7('0x17'));var utils=require(_0x61a7('0x18'));var config=require(_0x61a7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x61a7('0x1a'))['db'];function respondWithStatusCode(_0x5e55bc,_0x29cf1c){_0x29cf1c=_0x29cf1c||0xcc;return function(_0x3650a0){if(_0x3650a0){return _0x5e55bc[_0x61a7('0x1b')](_0x29cf1c);}return _0x5e55bc[_0x61a7('0x1c')](_0x29cf1c)['end']();};}function respondWithResult(_0x47db08,_0x35c1ca){_0x35c1ca=_0x35c1ca||0xc8;return function(_0x14ee10){if(_0x14ee10){return _0x47db08['status'](_0x35c1ca)[_0x61a7('0x1d')](_0x14ee10);}};}function respondWithFilteredResult(_0x42be0f,_0x40da6f){return function(_0x53cb1d){if(_0x53cb1d){var _0x19ce8b=typeof _0x40da6f[_0x61a7('0x1e')]===_0x61a7('0x1f')&&typeof _0x40da6f[_0x61a7('0x20')]==='undefined';var _0x182c29=_0x53cb1d['count'];var _0x49dc84=_0x19ce8b?0x0:_0x40da6f[_0x61a7('0x1e')];var _0x42bdd2=_0x19ce8b?_0x53cb1d[_0x61a7('0x21')]:_0x40da6f['offset']+_0x40da6f[_0x61a7('0x20')];var _0x1e1c92;if(_0x42bdd2>=_0x182c29){_0x42bdd2=_0x182c29;_0x1e1c92=0xc8;}else{_0x1e1c92=0xce;}_0x42be0f[_0x61a7('0x1c')](_0x1e1c92);return _0x42be0f[_0x61a7('0x22')](_0x61a7('0x23'),_0x49dc84+'-'+_0x42bdd2+'/'+_0x182c29)[_0x61a7('0x1d')](_0x53cb1d);}return null;};}function patchUpdates(_0x5e5013){return function(_0x9217b){try{jsonpatch['apply'](_0x9217b,_0x5e5013,!![]);}catch(_0x25bed6){return BPromise[_0x61a7('0x24')](_0x25bed6);}return _0x9217b[_0x61a7('0x25')]();};}function saveUpdates(_0x19963d,_0x204b9a){return function(_0x5d664b){if(_0x5d664b){return _0x5d664b[_0x61a7('0x26')](_0x19963d)[_0x61a7('0x27')](function(_0x20e37d){return _0x20e37d;});}return null;};}function removeEntity(_0x205dad,_0x1f1d18){return function(_0x5a3c49){if(_0x5a3c49){return _0x5a3c49[_0x61a7('0x28')]()[_0x61a7('0x27')](function(){_0x205dad[_0x61a7('0x1c')](0xcc)[_0x61a7('0x29')]();});}};}function handleEntityNotFound(_0x1509b8,_0x329000){return function(_0x376024){if(!_0x376024){_0x1509b8['sendStatus'](0x194);}return _0x376024;};}function handleError(_0x2f35a0,_0x1c813f){_0x1c813f=_0x1c813f||0x1f4;return function(_0x4e3aea){logger[_0x61a7('0x2a')](_0x4e3aea[_0x61a7('0x2b')]);if(_0x4e3aea[_0x61a7('0x2c')]){delete _0x4e3aea[_0x61a7('0x2c')];}_0x2f35a0['status'](_0x1c813f)['send'](_0x4e3aea);};}exports[_0x61a7('0x2d')]=function(_0x3d89fc,_0x2ccbc6){var _0x12cce3={},_0x196208={},_0x475973={'count':0x0,'rows':[]};var _0xfce67f=_[_0x61a7('0x2e')](db[_0x61a7('0x2f')][_0x61a7('0x30')],function(_0x24a76e){return{'name':_0x24a76e[_0x61a7('0x31')],'type':_0x24a76e['type'][_0x61a7('0x32')]};});_0x196208[_0x61a7('0x33')]=_[_0x61a7('0x2e')](_0xfce67f,'name');_0x196208[_0x61a7('0x34')]=_[_0x61a7('0x35')](_0x3d89fc[_0x61a7('0x34')]);_0x196208[_0x61a7('0x36')]=_[_0x61a7('0x37')](_0x196208[_0x61a7('0x33')],_0x196208['query']);_0x12cce3[_0x61a7('0x38')]=_[_0x61a7('0x37')](_0x196208[_0x61a7('0x33')],qs[_0x61a7('0x39')](_0x3d89fc['query'][_0x61a7('0x39')]));_0x12cce3['attributes']=_0x12cce3[_0x61a7('0x38')]['length']?_0x12cce3[_0x61a7('0x38')]:_0x196208['model'];if(!_0x3d89fc[_0x61a7('0x34')][_0x61a7('0x3a')](_0x61a7('0x3b'))){_0x12cce3[_0x61a7('0x20')]=qs[_0x61a7('0x20')](_0x3d89fc[_0x61a7('0x34')][_0x61a7('0x20')]);_0x12cce3['offset']=qs[_0x61a7('0x1e')](_0x3d89fc['query'][_0x61a7('0x1e')]);}_0x12cce3[_0x61a7('0x3c')]=qs[_0x61a7('0x3d')](_0x3d89fc[_0x61a7('0x34')][_0x61a7('0x3d')]);_0x12cce3[_0x61a7('0x3e')]=qs['filters'](_[_0x61a7('0x3f')](_0x3d89fc[_0x61a7('0x34')],_0x196208[_0x61a7('0x36')]),_0xfce67f);if(_0x3d89fc[_0x61a7('0x34')]['filter']){_0x12cce3[_0x61a7('0x3e')]=_['merge'](_0x12cce3[_0x61a7('0x3e')],{'$or':_[_0x61a7('0x2e')](_0xfce67f,function(_0x295657){if(_0x295657[_0x61a7('0x40')]!==_0x61a7('0x41')){var _0x30b36d={};_0x30b36d[_0x295657[_0x61a7('0x2c')]]={'$like':'%'+_0x3d89fc[_0x61a7('0x34')]['filter']+'%'};return _0x30b36d;}})});}_0x12cce3=_[_0x61a7('0x42')]({},_0x12cce3,_0x3d89fc[_0x61a7('0x43')]);var _0x2a5c7f={'where':_0x12cce3[_0x61a7('0x3e')]};return db[_0x61a7('0x2f')][_0x61a7('0x21')](_0x2a5c7f)['then'](function(_0x1544fc){_0x475973[_0x61a7('0x21')]=_0x1544fc;if(_0x3d89fc['query']['includeAll']){_0x12cce3['include']=[{'all':!![]}];}return db[_0x61a7('0x2f')][_0x61a7('0x44')](_0x12cce3);})[_0x61a7('0x27')](function(_0x4632b1){_0x475973[_0x61a7('0x45')]=_0x4632b1;return _0x475973;})[_0x61a7('0x27')](respondWithFilteredResult(_0x2ccbc6,_0x12cce3))[_0x61a7('0x46')](handleError(_0x2ccbc6,null));};exports['show']=function(_0x783a6c,_0x1e638e){var _0x2bf65c={'raw':!![],'where':{'id':_0x783a6c[_0x61a7('0x47')]['id']}},_0x6ff4e4={};_0x6ff4e4['model']=_[_0x61a7('0x35')](db[_0x61a7('0x2f')][_0x61a7('0x30')]);_0x6ff4e4[_0x61a7('0x34')]=_['keys'](_0x783a6c[_0x61a7('0x34')]);_0x6ff4e4[_0x61a7('0x36')]=_['intersection'](_0x6ff4e4[_0x61a7('0x33')],_0x6ff4e4['query']);_0x2bf65c[_0x61a7('0x38')]=_[_0x61a7('0x37')](_0x6ff4e4[_0x61a7('0x33')],qs[_0x61a7('0x39')](_0x783a6c['query'][_0x61a7('0x39')]));_0x2bf65c['attributes']=_0x2bf65c[_0x61a7('0x38')][_0x61a7('0x48')]?_0x2bf65c[_0x61a7('0x38')]:_0x6ff4e4[_0x61a7('0x33')];if(_0x783a6c[_0x61a7('0x34')]['includeAll']){_0x2bf65c['include']=[{'all':!![]}];}_0x2bf65c=_[_0x61a7('0x42')]({},_0x2bf65c,_0x783a6c[_0x61a7('0x43')]);return db['JscriptySessionReport'][_0x61a7('0x49')](_0x2bf65c)[_0x61a7('0x27')](handleEntityNotFound(_0x1e638e,null))[_0x61a7('0x27')](respondWithResult(_0x1e638e,null))['catch'](handleError(_0x1e638e,null));};exports[_0x61a7('0x4a')]=function(_0x20df57,_0x5ba7ed){return db[_0x61a7('0x2f')][_0x61a7('0x4a')](_0x20df57['body'],{})[_0x61a7('0x27')](respondWithResult(_0x5ba7ed,0xc9))[_0x61a7('0x46')](handleError(_0x5ba7ed,null));};exports[_0x61a7('0x26')]=function(_0x848d01,_0x56cea0){if(_0x848d01[_0x61a7('0x4b')]['id']){delete _0x848d01[_0x61a7('0x4b')]['id'];}return db[_0x61a7('0x2f')][_0x61a7('0x49')]({'where':{'id':_0x848d01[_0x61a7('0x47')]['id']}})[_0x61a7('0x27')](handleEntityNotFound(_0x56cea0,null))['then'](saveUpdates(_0x848d01[_0x61a7('0x4b')],null))[_0x61a7('0x27')](respondWithResult(_0x56cea0,null))['catch'](handleError(_0x56cea0,null));};exports[_0x61a7('0x28')]=function(_0x2f58f3,_0x2a6e5d){return db[_0x61a7('0x2f')][_0x61a7('0x49')]({'where':{'id':_0x2f58f3[_0x61a7('0x47')]['id']}})[_0x61a7('0x27')](handleEntityNotFound(_0x2a6e5d,null))[_0x61a7('0x27')](removeEntity(_0x2a6e5d,null))[_0x61a7('0x46')](handleError(_0x2a6e5d,null));};exports[_0x61a7('0x4c')]=function(_0x21c30f,_0x5e7b0b){return db[_0x61a7('0x2f')][_0x61a7('0x4c')]()[_0x61a7('0x27')](respondWithResult(_0x5e7b0b,null))['catch'](handleError(_0x5e7b0b,null));};exports[_0x61a7('0x4d')]=function(_0x56d5e2,_0x43ded2,_0xa8d7d8){var _0x2aee01={'raw':!![],'where':{}};var _0x2fd776={};var _0x9824c7={'count':0x0,'rows':[]};return db[_0x61a7('0x2f')][_0x61a7('0x4e')]({'where':{'id':_0x56d5e2[_0x61a7('0x47')]['id']}})['then'](handleEntityNotFound(_0x43ded2,null))[_0x61a7('0x27')](function(_0x5adc37){if(_0x5adc37){_0x2fd776['model']=_['keys'](db[_0x61a7('0x4f')][_0x61a7('0x30')]);_0x2fd776[_0x61a7('0x34')]=_[_0x61a7('0x35')](_0x56d5e2[_0x61a7('0x34')]);_0x2fd776[_0x61a7('0x36')]=_[_0x61a7('0x37')](_0x2fd776['model'],_0x2fd776['query']);_0x2aee01[_0x61a7('0x38')]=_[_0x61a7('0x37')](_0x2fd776[_0x61a7('0x33')],qs[_0x61a7('0x39')](_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x39')]));_0x2aee01['attributes']=_0x2aee01[_0x61a7('0x38')]['length']?_0x2aee01[_0x61a7('0x38')]:_0x2fd776[_0x61a7('0x33')];if(!_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x3a')](_0x61a7('0x3b'))){_0x2aee01[_0x61a7('0x20')]=qs[_0x61a7('0x20')](_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x20')]);_0x2aee01['offset']=qs['offset'](_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x1e')]);}_0x2aee01[_0x61a7('0x3c')]=qs['sort'](_0x56d5e2['query']['sort']);_0x2aee01[_0x61a7('0x3e')]=qs['filters'](_[_0x61a7('0x3f')](_0x56d5e2['query'],_0x2fd776[_0x61a7('0x36')]));_0x2aee01[_0x61a7('0x3e')][_0x61a7('0x50')]=_0x5adc37['id'];if(_0x56d5e2[_0x61a7('0x34')]['filter']){_0x2aee01[_0x61a7('0x3e')]=_[_0x61a7('0x42')](_0x2aee01[_0x61a7('0x3e')],{'$or':_[_0x61a7('0x2e')](_0x2aee01[_0x61a7('0x38')],function(_0x4b1482){var _0x161d32={};_0x161d32[_0x4b1482]={'$like':'%'+_0x56d5e2[_0x61a7('0x34')]['filter']+'%'};return _0x161d32;})});}_0x2aee01=_['merge']({},_0x2aee01,_0x56d5e2[_0x61a7('0x43')]);return db[_0x61a7('0x4f')][_0x61a7('0x21')]({'where':_0x2aee01[_0x61a7('0x3e')]})[_0x61a7('0x27')](function(_0x2315d2){_0x9824c7[_0x61a7('0x21')]=_0x2315d2;if(_0x56d5e2[_0x61a7('0x34')][_0x61a7('0x51')]){_0x2aee01[_0x61a7('0x52')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x61a7('0x44')](_0x2aee01);})[_0x61a7('0x27')](function(_0x1c188c){_0x9824c7[_0x61a7('0x45')]=_0x1c188c;return _0x9824c7;});}})['then'](respondWithFilteredResult(_0x43ded2,_0x2aee01))[_0x61a7('0x46')](handleError(_0x43ded2,null));}; \ No newline at end of file +var _0xd4c4=['model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','rawAttributes','find','catch','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','include','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','update','then','error','name','send','map','JscriptySessionReport','fieldName','type','key'];(function(_0x5f265e,_0x5f29c3){var _0x197592=function(_0x2b02d3){while(--_0x2b02d3){_0x5f265e['push'](_0x5f265e['shift']());}};_0x197592(++_0x5f29c3);}(_0xd4c4,0xb5));var _0x4d4c=function(_0x1e6e39,_0x3c98ed){_0x1e6e39=_0x1e6e39-0x0;var _0x2d9029=_0xd4c4[_0x1e6e39];return _0x2d9029;};'use strict';var emlformat=require(_0x4d4c('0x0'));var rimraf=require(_0x4d4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d4c('0x2'));var rp=require(_0x4d4c('0x3'));var moment=require(_0x4d4c('0x4'));var BPromise=require(_0x4d4c('0x5'));var Mustache=require(_0x4d4c('0x6'));var util=require(_0x4d4c('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('lodash');var squel=require(_0x4d4c('0x8'));var crypto=require(_0x4d4c('0x9'));var jsforce=require(_0x4d4c('0xa'));var deskjs=require(_0x4d4c('0xb'));var toCsv=require(_0x4d4c('0xc'));var querystring=require(_0x4d4c('0xd'));var Papa=require('papaparse');var Redis=require(_0x4d4c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4d4c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d4c('0x10'))(_0x4d4c('0x11'));var utils=require(_0x4d4c('0x12'));var config=require(_0x4d4c('0x13'));var licenseUtil=require(_0x4d4c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ca727,_0x4838be){_0x4838be=_0x4838be||0xcc;return function(_0x25b798){if(_0x25b798){return _0x1ca727[_0x4d4c('0x15')](_0x4838be);}return _0x1ca727[_0x4d4c('0x16')](_0x4838be)[_0x4d4c('0x17')]();};}function respondWithResult(_0x520bc6,_0x3430fb){_0x3430fb=_0x3430fb||0xc8;return function(_0x39551b){if(_0x39551b){return _0x520bc6[_0x4d4c('0x16')](_0x3430fb)[_0x4d4c('0x18')](_0x39551b);}};}function respondWithFilteredResult(_0xcf153f,_0x53038){return function(_0x17c134){if(_0x17c134){var _0x1143a6=typeof _0x53038['offset']==='undefined'&&typeof _0x53038[_0x4d4c('0x19')]==='undefined';var _0x3b460c=_0x17c134['count'];var _0x1d8140=_0x1143a6?0x0:_0x53038['offset'];var _0x4462fb=_0x1143a6?_0x17c134[_0x4d4c('0x1a')]:_0x53038[_0x4d4c('0x1b')]+_0x53038['limit'];var _0x3f7e23;if(_0x4462fb>=_0x3b460c){_0x4462fb=_0x3b460c;_0x3f7e23=0xc8;}else{_0x3f7e23=0xce;}_0xcf153f[_0x4d4c('0x16')](_0x3f7e23);return _0xcf153f[_0x4d4c('0x1c')](_0x4d4c('0x1d'),_0x1d8140+'-'+_0x4462fb+'/'+_0x3b460c)[_0x4d4c('0x18')](_0x17c134);}return null;};}function patchUpdates(_0x15c0ac){return function(_0x411aaf){try{jsonpatch['apply'](_0x411aaf,_0x15c0ac,!![]);}catch(_0x3eeaf2){return BPromise[_0x4d4c('0x1e')](_0x3eeaf2);}return _0x411aaf['save']();};}function saveUpdates(_0x445946,_0x11a470){return function(_0x5c76e1){if(_0x5c76e1){return _0x5c76e1[_0x4d4c('0x1f')](_0x445946)[_0x4d4c('0x20')](function(_0x35e320){return _0x35e320;});}return null;};}function removeEntity(_0x6f7ef7,_0x394f1b){return function(_0x55bc9e){if(_0x55bc9e){return _0x55bc9e['destroy']()[_0x4d4c('0x20')](function(){_0x6f7ef7['status'](0xcc)[_0x4d4c('0x17')]();});}};}function handleEntityNotFound(_0x3ab86a,_0x22fe8e){return function(_0x112805){if(!_0x112805){_0x3ab86a[_0x4d4c('0x15')](0x194);}return _0x112805;};}function handleError(_0x55beaa,_0x43cbd4){_0x43cbd4=_0x43cbd4||0x1f4;return function(_0x1e9e56){logger[_0x4d4c('0x21')](_0x1e9e56['stack']);if(_0x1e9e56[_0x4d4c('0x22')]){delete _0x1e9e56['name'];}_0x55beaa[_0x4d4c('0x16')](_0x43cbd4)[_0x4d4c('0x23')](_0x1e9e56);};}exports['index']=function(_0x3dbf72,_0x56e128){var _0x272933={},_0x274c8d={},_0x159967={'count':0x0,'rows':[]};var _0x28d9be=_[_0x4d4c('0x24')](db[_0x4d4c('0x25')]['rawAttributes'],function(_0x1726d5){return{'name':_0x1726d5[_0x4d4c('0x26')],'type':_0x1726d5[_0x4d4c('0x27')][_0x4d4c('0x28')]};});_0x274c8d[_0x4d4c('0x29')]=_[_0x4d4c('0x24')](_0x28d9be,'name');_0x274c8d[_0x4d4c('0x2a')]=_[_0x4d4c('0x2b')](_0x3dbf72[_0x4d4c('0x2a')]);_0x274c8d[_0x4d4c('0x2c')]=_[_0x4d4c('0x2d')](_0x274c8d['model'],_0x274c8d[_0x4d4c('0x2a')]);_0x272933[_0x4d4c('0x2e')]=_[_0x4d4c('0x2d')](_0x274c8d[_0x4d4c('0x29')],qs[_0x4d4c('0x2f')](_0x3dbf72['query'][_0x4d4c('0x2f')]));_0x272933[_0x4d4c('0x2e')]=_0x272933[_0x4d4c('0x2e')][_0x4d4c('0x30')]?_0x272933[_0x4d4c('0x2e')]:_0x274c8d[_0x4d4c('0x29')];if(!_0x3dbf72[_0x4d4c('0x2a')]['hasOwnProperty'](_0x4d4c('0x31'))){_0x272933[_0x4d4c('0x19')]=qs[_0x4d4c('0x19')](_0x3dbf72[_0x4d4c('0x2a')][_0x4d4c('0x19')]);_0x272933[_0x4d4c('0x1b')]=qs[_0x4d4c('0x1b')](_0x3dbf72[_0x4d4c('0x2a')]['offset']);}_0x272933[_0x4d4c('0x32')]=qs[_0x4d4c('0x33')](_0x3dbf72[_0x4d4c('0x2a')][_0x4d4c('0x33')]);_0x272933[_0x4d4c('0x34')]=qs['filters'](_[_0x4d4c('0x35')](_0x3dbf72[_0x4d4c('0x2a')],_0x274c8d['filters']),_0x28d9be);if(_0x3dbf72[_0x4d4c('0x2a')][_0x4d4c('0x36')]){_0x272933['where']=_[_0x4d4c('0x37')](_0x272933[_0x4d4c('0x34')],{'$or':_[_0x4d4c('0x24')](_0x28d9be,function(_0x676d13){if(_0x676d13['type']!==_0x4d4c('0x38')){var _0x519077={};_0x519077[_0x676d13[_0x4d4c('0x22')]]={'$like':'%'+_0x3dbf72[_0x4d4c('0x2a')][_0x4d4c('0x36')]+'%'};return _0x519077;}})});}_0x272933=_['merge']({},_0x272933,_0x3dbf72[_0x4d4c('0x39')]);var _0x30cc5c={'where':_0x272933['where']};return db[_0x4d4c('0x25')][_0x4d4c('0x1a')](_0x30cc5c)['then'](function(_0x3ff1ef){_0x159967[_0x4d4c('0x1a')]=_0x3ff1ef;if(_0x3dbf72[_0x4d4c('0x2a')][_0x4d4c('0x3a')]){_0x272933['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4d4c('0x3b')](_0x272933);})[_0x4d4c('0x20')](function(_0x5a4abe){_0x159967['rows']=_0x5a4abe;return _0x159967;})[_0x4d4c('0x20')](respondWithFilteredResult(_0x56e128,_0x272933))['catch'](handleError(_0x56e128,null));};exports['show']=function(_0x6c4a7a,_0x10cd38){var _0x285caa={'raw':!![],'where':{'id':_0x6c4a7a[_0x4d4c('0x3c')]['id']}},_0x5c3869={};_0x5c3869[_0x4d4c('0x29')]=_[_0x4d4c('0x2b')](db[_0x4d4c('0x25')][_0x4d4c('0x3d')]);_0x5c3869[_0x4d4c('0x2a')]=_[_0x4d4c('0x2b')](_0x6c4a7a[_0x4d4c('0x2a')]);_0x5c3869[_0x4d4c('0x2c')]=_[_0x4d4c('0x2d')](_0x5c3869[_0x4d4c('0x29')],_0x5c3869[_0x4d4c('0x2a')]);_0x285caa[_0x4d4c('0x2e')]=_[_0x4d4c('0x2d')](_0x5c3869[_0x4d4c('0x29')],qs[_0x4d4c('0x2f')](_0x6c4a7a['query'][_0x4d4c('0x2f')]));_0x285caa['attributes']=_0x285caa[_0x4d4c('0x2e')][_0x4d4c('0x30')]?_0x285caa[_0x4d4c('0x2e')]:_0x5c3869['model'];if(_0x6c4a7a[_0x4d4c('0x2a')][_0x4d4c('0x3a')]){_0x285caa['include']=[{'all':!![]}];}_0x285caa=_[_0x4d4c('0x37')]({},_0x285caa,_0x6c4a7a[_0x4d4c('0x39')]);return db[_0x4d4c('0x25')][_0x4d4c('0x3e')](_0x285caa)[_0x4d4c('0x20')](handleEntityNotFound(_0x10cd38,null))[_0x4d4c('0x20')](respondWithResult(_0x10cd38,null))[_0x4d4c('0x3f')](handleError(_0x10cd38,null));};exports['create']=function(_0x4335b4,_0x4d605d){return db['JscriptySessionReport'][_0x4d4c('0x40')](_0x4335b4[_0x4d4c('0x41')],{})['then'](respondWithResult(_0x4d605d,0xc9))[_0x4d4c('0x3f')](handleError(_0x4d605d,null));};exports['update']=function(_0x2fb267,_0x50c0e7){if(_0x2fb267['body']['id']){delete _0x2fb267[_0x4d4c('0x41')]['id'];}return db[_0x4d4c('0x25')][_0x4d4c('0x3e')]({'where':{'id':_0x2fb267['params']['id']}})[_0x4d4c('0x20')](handleEntityNotFound(_0x50c0e7,null))['then'](saveUpdates(_0x2fb267[_0x4d4c('0x41')],null))['then'](respondWithResult(_0x50c0e7,null))[_0x4d4c('0x3f')](handleError(_0x50c0e7,null));};exports[_0x4d4c('0x42')]=function(_0x2e15ba,_0x426ee8){return db[_0x4d4c('0x25')][_0x4d4c('0x3e')]({'where':{'id':_0x2e15ba[_0x4d4c('0x3c')]['id']}})[_0x4d4c('0x20')](handleEntityNotFound(_0x426ee8,null))[_0x4d4c('0x20')](removeEntity(_0x426ee8,null))[_0x4d4c('0x3f')](handleError(_0x426ee8,null));};exports['describe']=function(_0x4b42fb,_0xc673e6){return db['JscriptySessionReport'][_0x4d4c('0x43')]()[_0x4d4c('0x20')](respondWithResult(_0xc673e6,null))[_0x4d4c('0x3f')](handleError(_0xc673e6,null));};exports[_0x4d4c('0x44')]=function(_0x2992be,_0x5596c0,_0x191df4){var _0x357d8f={'raw':!![],'where':{}};var _0x3d4d34={};var _0x3b225a={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4d4c('0x45')]({'where':{'id':_0x2992be[_0x4d4c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5596c0,null))[_0x4d4c('0x20')](function(_0x32f997){if(_0x32f997){_0x3d4d34[_0x4d4c('0x29')]=_[_0x4d4c('0x2b')](db[_0x4d4c('0x46')][_0x4d4c('0x3d')]);_0x3d4d34['query']=_[_0x4d4c('0x2b')](_0x2992be['query']);_0x3d4d34[_0x4d4c('0x2c')]=_[_0x4d4c('0x2d')](_0x3d4d34['model'],_0x3d4d34[_0x4d4c('0x2a')]);_0x357d8f[_0x4d4c('0x2e')]=_[_0x4d4c('0x2d')](_0x3d4d34[_0x4d4c('0x29')],qs[_0x4d4c('0x2f')](_0x2992be[_0x4d4c('0x2a')][_0x4d4c('0x2f')]));_0x357d8f[_0x4d4c('0x2e')]=_0x357d8f[_0x4d4c('0x2e')]['length']?_0x357d8f[_0x4d4c('0x2e')]:_0x3d4d34[_0x4d4c('0x29')];if(!_0x2992be[_0x4d4c('0x2a')][_0x4d4c('0x47')]('nolimit')){_0x357d8f['limit']=qs[_0x4d4c('0x19')](_0x2992be['query'][_0x4d4c('0x19')]);_0x357d8f[_0x4d4c('0x1b')]=qs[_0x4d4c('0x1b')](_0x2992be[_0x4d4c('0x2a')][_0x4d4c('0x1b')]);}_0x357d8f[_0x4d4c('0x32')]=qs[_0x4d4c('0x33')](_0x2992be[_0x4d4c('0x2a')]['sort']);_0x357d8f[_0x4d4c('0x34')]=qs[_0x4d4c('0x2c')](_[_0x4d4c('0x35')](_0x2992be['query'],_0x3d4d34['filters']));_0x357d8f[_0x4d4c('0x34')][_0x4d4c('0x48')]=_0x32f997['id'];if(_0x2992be[_0x4d4c('0x2a')][_0x4d4c('0x36')]){_0x357d8f[_0x4d4c('0x34')]=_[_0x4d4c('0x37')](_0x357d8f['where'],{'$or':_[_0x4d4c('0x24')](_0x357d8f[_0x4d4c('0x2e')],function(_0x31682e){var _0x3a8e6e={};_0x3a8e6e[_0x31682e]={'$like':'%'+_0x2992be['query'][_0x4d4c('0x36')]+'%'};return _0x3a8e6e;})});}_0x357d8f=_['merge']({},_0x357d8f,_0x2992be[_0x4d4c('0x39')]);return db[_0x4d4c('0x46')][_0x4d4c('0x1a')]({'where':_0x357d8f[_0x4d4c('0x34')]})[_0x4d4c('0x20')](function(_0x401cce){_0x3b225a[_0x4d4c('0x1a')]=_0x401cce;if(_0x2992be['query'][_0x4d4c('0x3a')]){_0x357d8f[_0x4d4c('0x49')]=[{'all':!![]}];}return db[_0x4d4c('0x46')][_0x4d4c('0x3b')](_0x357d8f);})[_0x4d4c('0x20')](function(_0x1dd68d){_0x3b225a['rows']=_0x1dd68d;return _0x3b225a;});}})['then'](respondWithFilteredResult(_0x5596c0,_0x357d8f))[_0x4d4c('0x3f')](handleError(_0x5596c0,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 36271c8..0bd8899 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 _0xafc4=['path','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xafc4,0x69));var _0x4afc=function(_0x261b08,_0x563d91){_0x261b08=_0x261b08-0x0;var _0xeeaf84=_0xafc4[_0x261b08];return _0xeeaf84;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5334=['moment','request-promise','rimraf','../../config/environment','lodash','util','../../config/logger','api'];(function(_0x3e5b04,_0x8aee4c){var _0x21a534=function(_0x3f4f1a){while(--_0x3f4f1a){_0x3e5b04['push'](_0x3e5b04['shift']());}};_0x21a534(++_0x8aee4c);}(_0x5334,0x84));var _0x4533=function(_0x50c642,_0x251984){_0x50c642=_0x50c642-0x0;var _0x15034d=_0x5334[_0x50c642];return _0x15034d;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require('bluebird');var rp=require(_0x4533('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4533('0x6'));var config=require(_0x4533('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x51b4ce,_0x201673){return _0x51b4ce['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index cd8cb3f..481a96f 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 _0x5c3c=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4bdee6,_0x28f35e){var _0x1333c4=function(_0x45d3dd){while(--_0x45d3dd){_0x4bdee6['push'](_0x4bdee6['shift']());}};_0x1333c4(++_0x28f35e);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5c3c[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});} \ No newline at end of file +var _0x1261=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x39ce5e,_0x3aae30){var _0x93b4f=function(_0x458426){while(--_0x458426){_0x39ce5e['push'](_0x39ce5e['shift']());}};_0x93b4f(++_0x3aae30);}(_0x1261,0x144));var _0x1126=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0x1261[_0xe7281f];return _0x90dc99;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 00af191..14c51e5 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 _0xb68a=['put','/:id','isAuthenticated','exports','multer','util','path','express','Router','../../config/environment','get','index'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb68a,0x1a8));var _0xab68=function(_0x2a3829,_0x415203){_0x2a3829=_0x2a3829-0x0;var _0x2f3112=_0xb68a[_0x2a3829];return _0x2f3112;};'use strict';var multer=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var path=require(_0xab68('0x2'));var timeout=require('connect-timeout');var express=require(_0xab68('0x3'));var router=express[_0xab68('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab68('0x5'));var controller=require('./license.controller');router[_0xab68('0x6')]('/',controller[_0xab68('0x7')]);router[_0xab68('0x8')](_0xab68('0x9'),auth[_0xab68('0xa')](),controller['update']);module[_0xab68('0xb')]=router; \ No newline at end of file +var _0x607b=['index','isAuthenticated','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0x607b,0x18f));var _0xb607=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x607b[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xb607('0x0'));var util=require('util');var path=require(_0xb607('0x1'));var timeout=require(_0xb607('0x2'));var express=require(_0xb607('0x3'));var router=express[_0xb607('0x4')]();var fs_extra=require(_0xb607('0x5'));var auth=require(_0xb607('0x6'));var interaction=require(_0xb607('0x7'));var config=require(_0xb607('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0xb607('0x9')]);router['put']('/:id',auth[_0xb607('0xa')](),controller[_0xb607('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 75a66ae..a19bc1f 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 _0x403b=['STRING','INTEGER','sequelize','TEXT'];(function(_0x5f170c,_0x4a2e40){var _0x43dd18=function(_0x4758d7){while(--_0x4758d7){_0x5f170c['push'](_0x5f170c['shift']());}};_0x43dd18(++_0x4a2e40);}(_0x403b,0x9a));var _0xb403=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x403b[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xb403('0x0'));module['exports']={'license':{'type':Sequelize[_0xb403('0x1')]},'data1':{'type':Sequelize[_0xb403('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xb403('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xca4b=['STRING','sequelize','TEXT'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xca4b,0xdc));var _0xbca4=function(_0x1dc163,_0x502e0d){_0x1dc163=_0x1dc163-0x0;var _0x29dbaf=_0xca4b[_0x1dc163];return _0x29dbaf;};'use strict';var Sequelize=require(_0xbca4('0x0'));module['exports']={'license':{'type':Sequelize[_0xbca4('0x1')]},'data1':{'type':Sequelize[_0xbca4('0x2')]},'data2':{'type':Sequelize[_0xbca4('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 4a4129b..60feb73 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 _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4cd910,_0x3da0d1){var _0x186f8a=function(_0x3e149a){while(--_0x3e149a){_0x4cd910['push'](_0x4cd910['shift']());}};_0x186f8a(++_0x3da0d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1a6921,_0xfeb121){_0x1a6921=_0x1a6921-0x0;var _0xb546f0=_0x7a54[_0x1a6921];return _0xb546f0;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));}; \ No newline at end of file +var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x0295,0x1f0));var _0x5029=function(_0x273bb2,_0x319264){_0x273bb2=_0x273bb2-0x0;var _0x22f932=_0x0295[_0x273bb2];return _0x22f932;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 00861c1..933ae86 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 _0xe7f6=['../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2976da,_0x50996d){var _0x56e62b=function(_0x1b1b22){while(--_0x1b1b22){_0x2976da['push'](_0x2976da['shift']());}};_0x56e62b(++_0x50996d);}(_0xe7f6,0x118));var _0x6e7f=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0xe7f6[_0x1a8ff0];return _0x3588bf;};'use strict';var _=require(_0x6e7f('0x0'));var util=require('util');var logger=require(_0x6e7f('0x1'))('api');var moment=require(_0x6e7f('0x2'));var BPromise=require(_0x6e7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e7f('0x4'));var rimraf=require(_0x6e7f('0x5'));var config=require(_0x6e7f('0x6'));var attributes=require(_0x6e7f('0x7'));module[_0x6e7f('0x8')]=function(_0x3a2e0d,_0x18af0d){return _0x3a2e0d[_0x6e7f('0x9')]('License',attributes,{'tableName':_0x6e7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef9a=['bluebird','../../config/environment','define','License','license','util','../../config/logger','api','moment'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xef9a,0x152));var _0xaef9=function(_0x3fc710,_0x6645c2){_0x3fc710=_0x3fc710-0x0;var _0x5727b7=_0xef9a[_0x3fc710];return _0x5727b7;};'use strict';var _=require('lodash');var util=require(_0xaef9('0x0'));var logger=require(_0xaef9('0x1'))(_0xaef9('0x2'));var moment=require(_0xaef9('0x3'));var BPromise=require(_0xaef9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaef9('0x5'));var attributes=require('./license.attributes');module['exports']=function(_0x1d2d3a,_0x2f1495){return _0x1d2d3a[_0xaef9('0x6')](_0xaef9('0x7'),attributes,{'tableName':_0xaef9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index d3a629b..28edc8f 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 _0xa88f=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1ce803,_0x16389f){var _0x1771e9=function(_0x2db3b6){while(--_0x2db3b6){_0x1ce803['push'](_0x1ce803['shift']());}};_0x1771e9(++_0x16389f);}(_0xa88f,0x1a8));var _0xfa88=function(_0x27fc03,_0x30c398){_0x27fc03=_0x27fc03-0x0;var _0xeb4523=_0xa88f[_0x27fc03];return _0xeb4523;};'use strict';var _=require(_0xfa88('0x0'));var util=require(_0xfa88('0x1'));var moment=require('moment');var BPromise=require(_0xfa88('0x2'));var rs=require(_0xfa88('0x3'));var fs=require('fs');var Redis=require(_0xfa88('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa88('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfa88('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfa88('0x7')][_0xfa88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b5153,_0x1677a6,_0x46fcba){return new BPromise(function(_0x18d7af,_0x387db0){return client[_0xfa88('0x9')](_0x2b5153,_0x46fcba)[_0xfa88('0xa')](function(_0x349a68){logger[_0xfa88('0xb')](_0xfa88('0xc'),_0x1677a6,'request\x20sent');logger[_0xfa88('0xd')](_0xfa88('0xe'),_0x1677a6,_0xfa88('0xf'),JSON['stringify'](_0x349a68));if(_0x349a68[_0xfa88('0x10')]){if(_0x349a68[_0xfa88('0x10')][_0xfa88('0x11')]===0x1f4){logger[_0xfa88('0x10')](_0xfa88('0xc'),_0x1677a6,_0x349a68['error'][_0xfa88('0x12')]);return _0x387db0(_0x349a68[_0xfa88('0x10')]['message']);}logger[_0xfa88('0x10')](_0xfa88('0xc'),_0x1677a6,_0x349a68[_0xfa88('0x10')][_0xfa88('0x12')]);return _0x18d7af(_0x349a68[_0xfa88('0x10')][_0xfa88('0x12')]);}else{logger[_0xfa88('0xb')](_0xfa88('0xc'),_0x1677a6,'request\x20sent');_0x18d7af(_0x349a68[_0xfa88('0x13')]['message']);}})[_0xfa88('0x14')](function(_0x563e2b){logger[_0xfa88('0x10')](_0xfa88('0xc'),_0x1677a6,_0x563e2b);_0x387db0(_0x563e2b);});});} \ No newline at end of file +var _0xd45b=['License,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x222d2d,_0x592278){var _0xb7cc9b=function(_0x5cf8e6){while(--_0x5cf8e6){_0x222d2d['push'](_0x222d2d['shift']());}};_0xb7cc9b(++_0x592278);}(_0xd45b,0xe1));var _0xbd45=function(_0x240e56,_0x4b71b9){_0x240e56=_0x240e56-0x0;var _0x2fd5b4=_0xd45b[_0x240e56];return _0x2fd5b4;};'use strict';var _=require('lodash');var util=require(_0xbd45('0x0'));var moment=require('moment');var BPromise=require(_0xbd45('0x1'));var rs=require(_0xbd45('0x2'));var fs=require('fs');var Redis=require(_0xbd45('0x3'));var db=require(_0xbd45('0x4'))['db'];var utils=require(_0xbd45('0x5'));var logger=require(_0xbd45('0x6'))(_0xbd45('0x7'));var config=require('../../config/environment');var jayson=require(_0xbd45('0x8'));var client=jayson[_0xbd45('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516ac4,_0xbb5952,_0x392905){return new BPromise(function(_0x2ab2f9,_0xf1693a){return client[_0xbd45('0xa')](_0x516ac4,_0x392905)[_0xbd45('0xb')](function(_0x105949){logger[_0xbd45('0xc')](_0xbd45('0xd'),_0xbb5952,_0xbd45('0xe'));logger['debug'](_0xbd45('0xf'),_0xbb5952,'request\x20sent',JSON['stringify'](_0x105949));if(_0x105949[_0xbd45('0x10')]){if(_0x105949[_0xbd45('0x10')][_0xbd45('0x11')]===0x1f4){logger[_0xbd45('0x10')](_0xbd45('0xd'),_0xbb5952,_0x105949['error']['message']);return _0xf1693a(_0x105949[_0xbd45('0x10')][_0xbd45('0x12')]);}logger[_0xbd45('0x10')](_0xbd45('0xd'),_0xbb5952,_0x105949[_0xbd45('0x10')]['message']);return _0x2ab2f9(_0x105949[_0xbd45('0x10')][_0xbd45('0x12')]);}else{logger[_0xbd45('0xc')](_0xbd45('0xd'),_0xbb5952,_0xbd45('0xe'));_0x2ab2f9(_0x105949['result']['message']);}})[_0xbd45('0x13')](function(_0x13e2e3){logger[_0xbd45('0x10')](_0xbd45('0xd'),_0xbb5952,_0x13e2e3);_0xf1693a(_0x13e2e3);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 605eded..fd0a0f8 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 _0x4b93=['send','update','delete','removeAnswers','removeImap','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','/:id/users','getAgents','/:id/dispositions','post','/:id/canned_answers','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/send'];(function(_0x1d6f0d,_0xe970f0){var _0x48dde1=function(_0x2b39f6){while(--_0x2b39f6){_0x1d6f0d['push'](_0x1d6f0d['shift']());}};_0x48dde1(++_0xe970f0);}(_0x4b93,0xa3));var _0x34b9=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x4b93[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x34b9('0x0'));var util=require(_0x34b9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x34b9('0x2'));var router=express[_0x34b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x34b9('0x4'));var interaction=require(_0x34b9('0x5'));var config=require(_0x34b9('0x6'));var controller=require(_0x34b9('0x7'));router[_0x34b9('0x8')]('/',auth[_0x34b9('0x9')](),controller[_0x34b9('0xa')]);router[_0x34b9('0x8')]('/describe',auth[_0x34b9('0x9')](),controller['describe']);router['get'](_0x34b9('0xb'),auth[_0x34b9('0x9')](),controller['show']);router[_0x34b9('0x8')]('/:id/dispositions',auth[_0x34b9('0x9')](),controller['getDispositions']);router[_0x34b9('0x8')]('/:id/canned_answers',auth[_0x34b9('0x9')](),controller[_0x34b9('0xc')]);router['get'](_0x34b9('0xd'),auth[_0x34b9('0x9')](),controller['getImap']);router[_0x34b9('0x8')]('/:id/out_servers',auth[_0x34b9('0x9')](),controller[_0x34b9('0xe')]);router[_0x34b9('0x8')](_0x34b9('0xf'),auth['isAuthenticated'](),controller[_0x34b9('0x10')]);router['get'](_0x34b9('0x11'),auth[_0x34b9('0x9')](),controller['getApplications']);router[_0x34b9('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x34b9('0x12')]);router[_0x34b9('0x8')](_0x34b9('0x13'),auth[_0x34b9('0x9')](),controller['verifySmtp']);router[_0x34b9('0x8')](_0x34b9('0x14'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x15')]);router['post'](_0x34b9('0x16'),auth[_0x34b9('0x9')](),controller['addDisposition']);router[_0x34b9('0x17')](_0x34b9('0x18'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x19')]);router[_0x34b9('0x17')]('/',auth[_0x34b9('0x9')](),controller[_0x34b9('0x1a')]);router['post'](_0x34b9('0xd'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x1b')]);router[_0x34b9('0x17')](_0x34b9('0x1c'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x1d')]);router[_0x34b9('0x17')](_0x34b9('0xf'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x1e')]);router['post'](_0x34b9('0x11'),auth[_0x34b9('0x9')](),controller['addApplications']);router[_0x34b9('0x17')](_0x34b9('0x1f'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x20')]);router['post']('/:id/users',auth[_0x34b9('0x9')](),controller['addAgents']);router['put'](_0x34b9('0xb'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x21')]);router[_0x34b9('0x22')](_0x34b9('0x16'),auth[_0x34b9('0x9')](),controller['removeDispositions']);router[_0x34b9('0x22')](_0x34b9('0x18'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x23')]);router[_0x34b9('0x22')](_0x34b9('0xd'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x24')]);router[_0x34b9('0x22')]('/:id/out_servers',auth[_0x34b9('0x9')](),controller['removeSmtp']);router['delete'](_0x34b9('0xb'),auth[_0x34b9('0x9')](),controller[_0x34b9('0x25')]);router['delete'](_0x34b9('0x14'),auth[_0x34b9('0x9')](),controller['removeAgents']);module[_0x34b9('0x26')]=router; \ No newline at end of file +var _0xc96d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addInteraction','addApplications','/:id/send','addAgents','put','delete','removeAnswers','removeImap','/:id/out_servers','/:id','destroy','removeAgents','exports','util','path','connect-timeout'];(function(_0x5da169,_0x50fa43){var _0x239a2b=function(_0xe64e17){while(--_0xe64e17){_0x5da169['push'](_0x5da169['shift']());}};_0x239a2b(++_0x50fa43);}(_0xc96d,0xad));var _0xdc96=function(_0x22c46e,_0x1b35e2){_0x22c46e=_0x22c46e-0x0;var _0x36a4c8=_0xc96d[_0x22c46e];return _0x36a4c8;};'use strict';var multer=require('multer');var util=require(_0xdc96('0x0'));var path=require(_0xdc96('0x1'));var timeout=require(_0xdc96('0x2'));var express=require('express');var router=express[_0xdc96('0x3')]();var fs_extra=require(_0xdc96('0x4'));var auth=require(_0xdc96('0x5'));var interaction=require(_0xdc96('0x6'));var config=require('../../config/environment');var controller=require(_0xdc96('0x7'));router[_0xdc96('0x8')]('/',auth[_0xdc96('0x9')](),controller[_0xdc96('0xa')]);router[_0xdc96('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xdc96('0xb')]);router[_0xdc96('0x8')]('/:id',auth[_0xdc96('0x9')](),controller[_0xdc96('0xc')]);router[_0xdc96('0x8')](_0xdc96('0xd'),auth['isAuthenticated'](),controller[_0xdc96('0xe')]);router[_0xdc96('0x8')](_0xdc96('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xdc96('0x8')](_0xdc96('0x10'),auth[_0xdc96('0x9')](),controller['getImap']);router[_0xdc96('0x8')]('/:id/out_servers',auth[_0xdc96('0x9')](),controller[_0xdc96('0x11')]);router[_0xdc96('0x8')](_0xdc96('0x12'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x13')]);router[_0xdc96('0x8')](_0xdc96('0x14'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x15')]);router['get'](_0xdc96('0x16'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x17')]);router[_0xdc96('0x8')]('/:id/verify',auth[_0xdc96('0x9')](),controller[_0xdc96('0x18')]);router[_0xdc96('0x8')](_0xdc96('0x19'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x1a')]);router[_0xdc96('0x1b')](_0xdc96('0xd'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x1c')]);router[_0xdc96('0x1b')](_0xdc96('0xf'),auth['isAuthenticated'](),controller[_0xdc96('0x1d')]);router[_0xdc96('0x1b')]('/',auth[_0xdc96('0x9')](),controller['create']);router[_0xdc96('0x1b')](_0xdc96('0x10'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x1e')]);router[_0xdc96('0x1b')]('/:id/out_servers',auth['isAuthenticated'](),controller['addSmtp']);router[_0xdc96('0x1b')](_0xdc96('0x12'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x1f')]);router[_0xdc96('0x1b')]('/:id/applications',auth['isAuthenticated'](),controller[_0xdc96('0x20')]);router[_0xdc96('0x1b')](_0xdc96('0x21'),auth[_0xdc96('0x9')](),controller['send']);router[_0xdc96('0x1b')](_0xdc96('0x19'),auth[_0xdc96('0x9')](),controller[_0xdc96('0x22')]);router[_0xdc96('0x23')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdc96('0x24')](_0xdc96('0xd'),auth[_0xdc96('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0xdc96('0x9')](),controller[_0xdc96('0x25')]);router[_0xdc96('0x24')]('/:id/in_servers',auth[_0xdc96('0x9')](),controller[_0xdc96('0x26')]);router[_0xdc96('0x24')](_0xdc96('0x27'),auth[_0xdc96('0x9')](),controller['removeSmtp']);router[_0xdc96('0x24')](_0xdc96('0x28'),auth['isAuthenticated'](),controller[_0xdc96('0x29')]);router[_0xdc96('0x24')](_0xdc96('0x19'),auth['isAuthenticated'](),controller[_0xdc96('0x2a')]);module[_0xdc96('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 1fa462f..a39722e 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 _0xd9d1=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xd9d1,0x1b7));var _0x1d9d=function(_0x5a6b80,_0x5bee8f){_0x5a6b80=_0x5a6b80-0x0;var _0x3972e0=_0xd9d1[_0x5a6b80];return _0x3972e0;};'use strict';var Sequelize=require(_0x1d9d('0x0'));module[_0x1d9d('0x1')]={'description':{'type':Sequelize[_0x1d9d('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x1d9d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x1d9d('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1d9d('0x2')],'allowNull':![],'defaultValue':_0x1d9d('0x4')},'fontSize':{'type':Sequelize[_0x1d9d('0x5')](0x2)[_0x1d9d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1d9d('0x7');}},'notificationSound':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1d9d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1d9d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1d9d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1d9d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1d9d('0x3')],'defaultValue':![],'comment':_0x1d9d('0x9'),'set':function(_0x1601e4){if(!_0x1601e4)this[_0x1d9d('0xa')](_0x1d9d('0xb'),null);this['setDataValue'](_0x1d9d('0xc'),_0x1601e4);}},'provider':{'type':Sequelize[_0x1d9d('0xd')](_0x1d9d('0xe'),_0x1d9d('0xf'),_0x1d9d('0x10'),_0x1d9d('0x11')),'defaultValue':null,'get':function(){if(!this[_0x1d9d('0x12')](_0x1d9d('0x13')))return _0x1d9d('0x14');return this['getDataValue'](_0x1d9d('0x13'));}}}; \ No newline at end of file +var _0x41c1=['outlook365','getDataValue','provider','custom','sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','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','mandatoryDisposition','gmail'];(function(_0x2c9c08,_0x3a81dc){var _0x4db51f=function(_0x42e730){while(--_0x42e730){_0x2c9c08['push'](_0x2c9c08['shift']());}};_0x4db51f(++_0x3a81dc);}(_0x41c1,0x1cf));var _0x141c=function(_0x4b4ce5,_0x573d2d){_0x4b4ce5=_0x4b4ce5-0x0;var _0x6522f3=_0x41c1[_0x4b4ce5];return _0x6522f3;};'use strict';var Sequelize=require(_0x141c('0x0'));module[_0x141c('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x141c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x141c('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x141c('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x141c('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x141c('0x5')},'fontSize':{'type':Sequelize[_0x141c('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x141c('0x4')],'defaultValue':function(){return _0x141c('0x7');}},'notificationSound':{'type':Sequelize[_0x141c('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x141c('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x141c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x141c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x141c('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x141c('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x141c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x141c('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3447d7){if(!_0x3447d7)this[_0x141c('0x9')](_0x141c('0xa'),null);this['setDataValue'](_0x141c('0xb'),_0x3447d7);}},'provider':{'type':Sequelize['ENUM'](_0x141c('0xc'),'hotmail','yahoo',_0x141c('0xd')),'defaultValue':null,'get':function(){if(!this[_0x141c('0xe')](_0x141c('0xf')))return _0x141c('0x10');return this[_0x141c('0xe')](_0x141c('0xf'));}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 6bb85da..ca70c7a 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 _0x28c2=['username','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','MailApplication','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','CmList','Contacts','updatedAt','DESC','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','OAuth2','CloudProvider','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','destroy','UserProfileResource','end','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','rows','show','MailServerIn','mandatoryDispositionPause','include','find','update','body','params','describe','addDisposition','MailAccountId','Disposition','create','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','provider','custom','email','ListId','active','user','password','pass','modernAuthentication','CloudProviderId'];(function(_0x509be2,_0x300194){var _0x5e160a=function(_0x25987f){while(--_0x25987f){_0x509be2['push'](_0x509be2['shift']());}};_0x5e160a(++_0x300194);}(_0x28c2,0x10b));var _0x228c=function(_0x57deb5,_0x30964e){_0x57deb5=_0x57deb5-0x0;var _0x452cf7=_0x28c2[_0x57deb5];return _0x452cf7;};'use strict';var moment=require(_0x228c('0x0'));var BPromise=require('bluebird');var util=require(_0x228c('0x1'));var path=require(_0x228c('0x2'));var _=require(_0x228c('0x3'));var juice=require('juice');var Redis=require(_0x228c('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x228c('0x5'))('api');var config=require(_0x228c('0x6'));var db=require(_0x228c('0x7'))['db'];config[_0x228c('0x8')]=_[_0x228c('0x9')](config[_0x228c('0x8')],{'host':_0x228c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x228c('0x8')]));require(_0x228c('0xb'))[_0x228c('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x765b14,_0x512106,_0x41087e,_0x42f943){return new BPromise(function(_0x46f7a2,_0x3c433f){var _0x246e02=_0x42f943||client;return _0x246e02['request'](_0x765b14,_0x41087e)[_0x228c('0xd')](function(_0x8e3168){logger[_0x228c('0xe')]('MailAccount,\x20%s,\x20%s',_0x512106,_0x228c('0xf'));logger['debug'](_0x228c('0x10'),_0x512106,_0x228c('0xf'),JSON[_0x228c('0x11')](_0x8e3168));if(_0x8e3168[_0x228c('0x12')]){if(_0x8e3168[_0x228c('0x12')]['code']===0x1f4){logger[_0x228c('0x12')]('MailAccount,\x20%s,\x20%s',_0x512106,_0x8e3168[_0x228c('0x12')][_0x228c('0x13')]);return _0x3c433f(_0x8e3168[_0x228c('0x12')][_0x228c('0x13')]);}logger[_0x228c('0x12')](_0x228c('0x14'),_0x512106,_0x8e3168[_0x228c('0x12')][_0x228c('0x13')]);return _0x46f7a2(_0x8e3168['error'][_0x228c('0x13')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x512106,'request\x20sent');_0x46f7a2(_0x8e3168[_0x228c('0x15')][_0x228c('0x13')]);}})[_0x228c('0x16')](function(_0x5e70b0){logger[_0x228c('0x12')]('MailAccount,\x20%s,\x20%s',_0x512106,_0x5e70b0);_0x3c433f(_0x5e70b0);});});}function respondWithStatusCode(_0x14c706,_0x28de4c){_0x28de4c=_0x28de4c||0xcc;return function(_0x3c6539){if(_0x3c6539){return _0x14c706[_0x228c('0x17')](_0x28de4c);}return _0x14c706[_0x228c('0x18')](_0x28de4c)['end']();};}function respondWithResult(_0x22892c,_0x30827b){_0x30827b=_0x30827b||0xc8;return function(_0x42f1de){if(_0x42f1de){return _0x22892c[_0x228c('0x18')](_0x30827b)['json'](_0x42f1de);}};}function respondWithFilteredResult(_0x5154ad,_0x5bb87d){return function(_0x2d6309){if(_0x2d6309){var _0x4084f5=typeof _0x5bb87d[_0x228c('0x19')]===_0x228c('0x1a')&&typeof _0x5bb87d[_0x228c('0x1b')]===_0x228c('0x1a');var _0x16176b=_0x2d6309['count'];var _0x238759=_0x4084f5?0x0:_0x5bb87d['offset'];var _0x12f343=_0x4084f5?_0x2d6309[_0x228c('0x1c')]:_0x5bb87d[_0x228c('0x19')]+_0x5bb87d[_0x228c('0x1b')];var _0x22f8f6;if(_0x12f343>=_0x16176b){_0x12f343=_0x16176b;_0x22f8f6=0xc8;}else{_0x22f8f6=0xce;}_0x5154ad['status'](_0x22f8f6);return _0x5154ad['set'](_0x228c('0x1d'),_0x238759+'-'+_0x12f343+'/'+_0x16176b)['json'](_0x2d6309);}return null;};}function saveUpdates(_0x365b90){return function(_0x541c39){if(_0x541c39){return _0x541c39['update'](_0x365b90)['then'](function(_0x2b5722){return _0x2b5722;});}return null;};}function removeEntity(_0x5284d9){return function(_0x40ce9a){if(_0x40ce9a){return _0x40ce9a[_0x228c('0x1e')]()[_0x228c('0xd')](function(){var _0x146b0b=_0x40ce9a['get']({'plain':!![]});var _0x3d3c19='MailAccounts';return db[_0x228c('0x1f')][_0x228c('0x1e')]({'where':{'type':_0x3d3c19,'resourceId':_0x146b0b['id']}})[_0x228c('0xd')](function(){return _0x40ce9a;});})[_0x228c('0xd')](function(){_0x5284d9['status'](0xcc)[_0x228c('0x20')]();});}};}function handleEntityNotFound(_0x3c28ee){return function(_0x7fe9){if(!_0x7fe9){_0x3c28ee['sendStatus'](0x194);}return _0x7fe9;};}function handleError(_0xb8ef4f,_0x3971f6){_0x3971f6=_0x3971f6||0x1f4;return function(_0x13b041){logger[_0x228c('0x12')](_0x13b041[_0x228c('0x21')]);if(_0x13b041[_0x228c('0x22')]){delete _0x13b041[_0x228c('0x22')];}_0xb8ef4f[_0x228c('0x18')](_0x3971f6)[_0x228c('0x23')](_0x13b041);};}exports[_0x228c('0x24')]=function(_0x2ea036,_0x4e0979){var _0x502d0d={'include':[{'model':db['MailServerIn'],'as':_0x228c('0x25')},{'model':db[_0x228c('0x26')],'as':_0x228c('0x27')},{'model':db[_0x228c('0x28')],'as':'mandatoryDispositionPause'}]},_0x3b48de={},_0x1cb31a={'count':0x0,'rows':[]};var _0x3440f3=_['map'](db[_0x228c('0x29')][_0x228c('0x2a')],function(_0x7ff8bc){return{'name':_0x7ff8bc[_0x228c('0x2b')],'type':_0x7ff8bc[_0x228c('0x2c')][_0x228c('0x2d')]};});_0x3b48de[_0x228c('0x2e')]=_[_0x228c('0x2f')](_0x3440f3,_0x228c('0x22'));_0x3b48de[_0x228c('0x30')]=_[_0x228c('0x31')](_0x2ea036[_0x228c('0x30')]);_0x3b48de[_0x228c('0x32')]=_[_0x228c('0x33')](_0x3b48de[_0x228c('0x2e')],_0x3b48de[_0x228c('0x30')]);_0x502d0d[_0x228c('0x34')]=_[_0x228c('0x33')](_0x3b48de['model'],qs[_0x228c('0x35')](_0x2ea036[_0x228c('0x30')][_0x228c('0x35')]));_0x502d0d['attributes']=_0x502d0d[_0x228c('0x34')][_0x228c('0x36')]?_0x502d0d[_0x228c('0x34')]:_0x3b48de[_0x228c('0x2e')];if(!_0x2ea036[_0x228c('0x30')]['hasOwnProperty'](_0x228c('0x37'))){_0x502d0d[_0x228c('0x1b')]=qs['limit'](_0x2ea036[_0x228c('0x30')]['limit']);_0x502d0d[_0x228c('0x19')]=qs['offset'](_0x2ea036['query']['offset']);}_0x502d0d[_0x228c('0x38')]=qs[_0x228c('0x39')](_0x2ea036['query'][_0x228c('0x39')]);_0x502d0d['where']=qs[_0x228c('0x32')](_[_0x228c('0x3a')](_0x2ea036[_0x228c('0x30')],_0x3b48de[_0x228c('0x32')]),_0x3440f3);if(_0x2ea036[_0x228c('0x30')][_0x228c('0x3b')]){_0x502d0d['where']=_[_0x228c('0x3c')](_0x502d0d[_0x228c('0x3d')],{'$or':_['map'](_0x3440f3,function(_0x2bcec5){if(_0x2bcec5[_0x228c('0x2c')]!=='VIRTUAL'){var _0x2bb29a={};_0x2bb29a[_0x2bcec5['name']]={'$like':'%'+_0x2ea036[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x2bb29a;}})});}_0x502d0d=_[_0x228c('0x3c')]({},_0x502d0d,_0x2ea036[_0x228c('0x3e')]);var _0x5b2e89={'where':_0x502d0d[_0x228c('0x3d')]};return db[_0x228c('0x29')][_0x228c('0x1c')](_0x5b2e89)['then'](function(_0x5b2dc3){_0x1cb31a['count']=_0x5b2dc3;if(_0x2ea036[_0x228c('0x30')][_0x228c('0x3f')]){_0x502d0d['include']=[{'all':!![]}];}return db[_0x228c('0x29')][_0x228c('0x40')](_0x502d0d);})[_0x228c('0xd')](function(_0x555069){_0x1cb31a[_0x228c('0x41')]=_0x555069;return _0x1cb31a;})[_0x228c('0xd')](respondWithFilteredResult(_0x4e0979,_0x502d0d))[_0x228c('0x16')](handleError(_0x4e0979,null));};exports[_0x228c('0x42')]=function(_0x273657,_0x49f9b1){var _0x42cd37={'raw':![],'where':{'id':_0x273657['params']['id']},'include':[{'model':db[_0x228c('0x43')],'as':_0x228c('0x25')},{'model':db[_0x228c('0x26')],'as':_0x228c('0x27')},{'model':db[_0x228c('0x28')],'as':_0x228c('0x44')}]},_0x5097a6={};_0x5097a6[_0x228c('0x2e')]=_['keys'](db[_0x228c('0x29')][_0x228c('0x2a')]);_0x5097a6[_0x228c('0x30')]=_[_0x228c('0x31')](_0x273657['query']);_0x5097a6[_0x228c('0x32')]=_[_0x228c('0x33')](_0x5097a6[_0x228c('0x2e')],_0x5097a6[_0x228c('0x30')]);_0x42cd37[_0x228c('0x34')]=_['intersection'](_0x5097a6[_0x228c('0x2e')],qs[_0x228c('0x35')](_0x273657[_0x228c('0x30')][_0x228c('0x35')]));_0x42cd37[_0x228c('0x34')]=_0x42cd37[_0x228c('0x34')]['length']?_0x42cd37[_0x228c('0x34')]:_0x5097a6['model'];if(_0x273657[_0x228c('0x30')][_0x228c('0x3f')]){_0x42cd37[_0x228c('0x45')]=[{'all':!![]}];}_0x42cd37=_[_0x228c('0x3c')]({},_0x42cd37,_0x273657[_0x228c('0x3e')]);return db[_0x228c('0x29')][_0x228c('0x46')](_0x42cd37)[_0x228c('0xd')](handleEntityNotFound(_0x49f9b1,null))[_0x228c('0xd')](respondWithResult(_0x49f9b1,null))[_0x228c('0x16')](handleError(_0x49f9b1,null));};exports[_0x228c('0x47')]=function(_0x51e817,_0x1e8a6f){if(_0x51e817[_0x228c('0x48')]['id']){delete _0x51e817[_0x228c('0x48')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x51e817[_0x228c('0x49')]['id']},'include':[{'model':db[_0x228c('0x43')],'as':_0x228c('0x25')},{'model':db['MailServerOut'],'as':_0x228c('0x27')},{'model':db[_0x228c('0x28')],'as':'mandatoryDispositionPause'}]})[_0x228c('0xd')](handleEntityNotFound(_0x1e8a6f,null))[_0x228c('0xd')](saveUpdates(_0x51e817[_0x228c('0x48')],null))['then'](function(_0x457117){if(_0x457117&&_0x51e817[_0x228c('0x48')][_0x228c('0x25')]){return db[_0x228c('0x43')]['update'](_0x51e817[_0x228c('0x48')][_0x228c('0x25')],{'where':{'MailAccountId':_0x457117['id']}})[_0x228c('0xd')](function(){return _0x457117;});}return _0x457117;})[_0x228c('0xd')](function(_0xf6e8d3){if(_0xf6e8d3&&_0x51e817['body'][_0x228c('0x27')]){return db[_0x228c('0x26')][_0x228c('0x47')](_0x51e817['body'][_0x228c('0x27')],{'where':{'MailAccountId':_0xf6e8d3['id']}})[_0x228c('0xd')](function(){return _0xf6e8d3;});}return _0xf6e8d3;})[_0x228c('0xd')](respondWithResult(_0x1e8a6f,null))[_0x228c('0x16')](handleError(_0x1e8a6f,null));};exports['describe']=function(_0x3fca4f,_0x41da60){return db[_0x228c('0x29')][_0x228c('0x4a')]()[_0x228c('0xd')](respondWithResult(_0x41da60,null))['catch'](handleError(_0x41da60,null));};exports[_0x228c('0x4b')]=function(_0x35c4e6,_0x48608f){if(_0x35c4e6['body']['id']){delete _0x35c4e6[_0x228c('0x48')]['id'];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x35c4e6[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x48608f,null))['then'](function(_0x1c1c77){if(_0x1c1c77){_0x35c4e6[_0x228c('0x48')][_0x228c('0x4c')]=_0x1c1c77['id'];return db[_0x228c('0x4d')][_0x228c('0x4e')](_0x35c4e6['body']);}})['then'](respondWithResult(_0x48608f,null))[_0x228c('0x16')](handleError(_0x48608f,null));};exports['getDispositions']=function(_0x55b1eb,_0x23c30d){var _0x22544a={'raw':![],'where':{}};var _0x596264={};var _0x410a68={'count':0x0,'rows':[]};return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x55b1eb[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x23c30d,null))[_0x228c('0xd')](function(_0x41212f){if(_0x41212f){_0x596264['model']=_[_0x228c('0x31')](db[_0x228c('0x4d')][_0x228c('0x2a')]);_0x596264[_0x228c('0x30')]=_['keys'](_0x55b1eb[_0x228c('0x30')]);_0x596264[_0x228c('0x32')]=_[_0x228c('0x33')](_0x596264[_0x228c('0x2e')],_0x596264['query']);_0x22544a[_0x228c('0x34')]=_[_0x228c('0x33')](_0x596264[_0x228c('0x2e')],qs[_0x228c('0x35')](_0x55b1eb[_0x228c('0x30')][_0x228c('0x35')]));_0x22544a[_0x228c('0x34')]=_0x22544a[_0x228c('0x34')]['length']?_0x22544a[_0x228c('0x34')]:_0x596264[_0x228c('0x2e')];if(!_0x55b1eb['query'][_0x228c('0x50')](_0x228c('0x37'))){_0x22544a[_0x228c('0x1b')]=qs[_0x228c('0x1b')](_0x55b1eb[_0x228c('0x30')][_0x228c('0x1b')]);_0x22544a[_0x228c('0x19')]=qs[_0x228c('0x19')](_0x55b1eb['query']['offset']);}_0x22544a[_0x228c('0x38')]=qs['sort'](_0x55b1eb[_0x228c('0x30')][_0x228c('0x39')]);_0x22544a['where']=qs[_0x228c('0x32')](_['pick'](_0x55b1eb[_0x228c('0x30')],_0x596264[_0x228c('0x32')]));_0x22544a[_0x228c('0x3d')][_0x228c('0x4c')]=_0x41212f['id'];if(_0x55b1eb[_0x228c('0x30')][_0x228c('0x3b')]){_0x22544a[_0x228c('0x3d')]=_[_0x228c('0x3c')](_0x22544a['where'],{'$or':_[_0x228c('0x2f')](_0x22544a[_0x228c('0x34')],function(_0x3fed26){var _0x2a8ce3={};_0x2a8ce3[_0x3fed26]={'$like':'%'+_0x55b1eb['query'][_0x228c('0x3b')]+'%'};return _0x2a8ce3;})});}_0x22544a=_[_0x228c('0x3c')]({},_0x22544a,_0x55b1eb['options']);return db[_0x228c('0x4d')]['count']({'where':_0x22544a[_0x228c('0x3d')]})[_0x228c('0xd')](function(_0x4e661f){_0x410a68[_0x228c('0x1c')]=_0x4e661f;if(_0x55b1eb[_0x228c('0x30')][_0x228c('0x3f')]){_0x22544a[_0x228c('0x45')]=[{'all':!![]}];}return db[_0x228c('0x4d')][_0x228c('0x40')](_0x22544a);})[_0x228c('0xd')](function(_0x1538b8){_0x410a68[_0x228c('0x41')]=_0x1538b8;return _0x410a68;});}})['then'](respondWithFilteredResult(_0x23c30d,_0x22544a))[_0x228c('0x16')](handleError(_0x23c30d,null));};exports[_0x228c('0x51')]=function(_0x5367d8,_0x555c53){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x5367d8[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x555c53,null))[_0x228c('0xd')](function(_0x361280){if(_0x361280){return _0x361280[_0x228c('0x51')](_0x5367d8[_0x228c('0x30')][_0x228c('0x52')]);}})[_0x228c('0xd')](respondWithStatusCode(_0x555c53,null))[_0x228c('0x16')](handleError(_0x555c53,null));};exports[_0x228c('0x53')]=function(_0x2aa7a6,_0x33d4c4){if(_0x2aa7a6['body']['id']){delete _0x2aa7a6['body']['id'];}return db['MailAccount'][_0x228c('0x46')]({'where':{'id':_0x2aa7a6[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x33d4c4,null))[_0x228c('0xd')](function(_0x1770f5){if(_0x1770f5){_0x2aa7a6[_0x228c('0x48')]['MailAccountId']=_0x1770f5['id'];return db[_0x228c('0x54')][_0x228c('0x4e')](_0x2aa7a6['body']);}})[_0x228c('0xd')](respondWithResult(_0x33d4c4,null))[_0x228c('0x16')](handleError(_0x33d4c4,null));};exports[_0x228c('0x55')]=function(_0x4ba1b6,_0x5a62c8){var _0x1deb9c={'raw':![],'where':{}};var _0x1e9070={};var _0x322e82={'count':0x0,'rows':[]};return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x4ba1b6[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x5a62c8,null))['then'](function(_0x1caa31){if(_0x1caa31){_0x1e9070['model']=_['keys'](db[_0x228c('0x54')][_0x228c('0x2a')]);_0x1e9070['query']=_[_0x228c('0x31')](_0x4ba1b6[_0x228c('0x30')]);_0x1e9070[_0x228c('0x32')]=_[_0x228c('0x33')](_0x1e9070[_0x228c('0x2e')],_0x1e9070['query']);_0x1deb9c[_0x228c('0x34')]=_[_0x228c('0x33')](_0x1e9070['model'],qs[_0x228c('0x35')](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x35')]));_0x1deb9c[_0x228c('0x34')]=_0x1deb9c[_0x228c('0x34')][_0x228c('0x36')]?_0x1deb9c['attributes']:_0x1e9070[_0x228c('0x2e')];if(!_0x4ba1b6[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x1deb9c['limit']=qs[_0x228c('0x1b')](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x1b')]);_0x1deb9c[_0x228c('0x19')]=qs['offset'](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x19')]);}_0x1deb9c[_0x228c('0x38')]=qs[_0x228c('0x39')](_0x4ba1b6[_0x228c('0x30')][_0x228c('0x39')]);_0x1deb9c[_0x228c('0x3d')]=qs[_0x228c('0x32')](_['pick'](_0x4ba1b6[_0x228c('0x30')],_0x1e9070['filters']));_0x1deb9c[_0x228c('0x3d')][_0x228c('0x4c')]=_0x1caa31['id'];if(_0x4ba1b6['query'][_0x228c('0x3b')]){_0x1deb9c['where']=_['merge'](_0x1deb9c[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x1deb9c[_0x228c('0x34')],function(_0x2085a3){var _0x43ed0a={};_0x43ed0a[_0x2085a3]={'$like':'%'+_0x4ba1b6[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x43ed0a;})});}_0x1deb9c=_['merge']({},_0x1deb9c,_0x4ba1b6['options']);return db[_0x228c('0x54')][_0x228c('0x1c')]({'where':_0x1deb9c[_0x228c('0x3d')]})['then'](function(_0x3fb6fe){_0x322e82[_0x228c('0x1c')]=_0x3fb6fe;if(_0x4ba1b6[_0x228c('0x30')][_0x228c('0x3f')]){_0x1deb9c[_0x228c('0x45')]=[{'all':!![]}];}return db[_0x228c('0x54')][_0x228c('0x40')](_0x1deb9c);})['then'](function(_0x3c6c97){_0x322e82[_0x228c('0x41')]=_0x3c6c97;return _0x322e82;});}})[_0x228c('0xd')](respondWithFilteredResult(_0x5a62c8,_0x1deb9c))[_0x228c('0x16')](handleError(_0x5a62c8,null));};exports[_0x228c('0x56')]=function(_0x63c110,_0x19ecf7){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x63c110[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x19ecf7,null))[_0x228c('0xd')](function(_0x48276e){if(_0x48276e){return _0x48276e[_0x228c('0x56')](_0x63c110[_0x228c('0x30')][_0x228c('0x52')]);}})[_0x228c('0xd')](respondWithStatusCode(_0x19ecf7,null))[_0x228c('0x16')](handleError(_0x19ecf7,null));};exports[_0x228c('0x4e')]=function(_0x35b7d8,_0x4d9179){var _0x144365={'name':_0x35b7d8[_0x228c('0x48')][_0x228c('0x22')],'key':_0x35b7d8[_0x228c('0x48')][_0x228c('0x2d')],'provider':_0x35b7d8[_0x228c('0x48')][_0x228c('0x57')]===_0x228c('0x58')?null:_0x35b7d8[_0x228c('0x48')][_0x228c('0x57')],'email':_0x35b7d8[_0x228c('0x48')][_0x228c('0x59')],'ListId':_0x35b7d8['body'][_0x228c('0x5a')],'active':!_['isNil'](_0x35b7d8[_0x228c('0x48')][_0x228c('0x5b')])?_0x35b7d8[_0x228c('0x48')][_0x228c('0x5b')]:!![],'description':_0x35b7d8[_0x228c('0x48')]['description']||null,'Imap':{},'Smtp':{}};if(_0x144365['provider']){_0x144365[_0x228c('0x25')][_0x228c('0x5c')]=_0x144365['Smtp']['user']=_0x35b7d8[_0x228c('0x48')]['username'];_0x144365[_0x228c('0x25')][_0x228c('0x5d')]=_0x144365['Smtp'][_0x228c('0x5e')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x5d')];if(_0x35b7d8[_0x228c('0x48')][_0x228c('0x5f')]){_0x144365[_0x228c('0x25')][_0x228c('0x5f')]=_0x144365[_0x228c('0x27')][_0x228c('0x5f')]=!![];_0x144365['Imap'][_0x228c('0x60')]=_0x144365[_0x228c('0x27')][_0x228c('0x60')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x60')];_0x144365[_0x228c('0x25')][_0x228c('0x5c')]=_0x144365[_0x228c('0x27')]['user']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x61')];}_0x144365[_0x228c('0x25')][_0x228c('0x62')]=_0x144365['Smtp'][_0x228c('0x62')]=null;_0x144365[_0x228c('0x25')][_0x228c('0x63')]=_0x144365[_0x228c('0x27')][_0x228c('0x63')]=null;_0x144365[_0x228c('0x25')][_0x228c('0x64')]=_0x144365[_0x228c('0x27')]['port']=null;}else{if(_0x35b7d8['body']['authentication']){_0x144365[_0x228c('0x25')][_0x228c('0x5c')]=_0x144365['Smtp']['user']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x61')];_0x144365['Imap'][_0x228c('0x5d')]=_0x144365[_0x228c('0x27')][_0x228c('0x5e')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x5d')];}else{_0x144365[_0x228c('0x25')][_0x228c('0x65')]=_0x144365['Smtp'][_0x228c('0x65')]=![];}_0x144365['Imap'][_0x228c('0x63')]=_0x35b7d8[_0x228c('0x48')][_0x228c('0x25')]['host'];_0x144365[_0x228c('0x25')]['port']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x25')][_0x228c('0x64')];_0x144365[_0x228c('0x27')]['host']=_0x35b7d8[_0x228c('0x48')]['Smtp'][_0x228c('0x63')];_0x144365[_0x228c('0x27')]['port']=_0x35b7d8[_0x228c('0x48')][_0x228c('0x27')]['port'];}return db[_0x228c('0x29')][_0x228c('0x4e')](_0x144365,{'include':[{'model':db[_0x228c('0x26')],'as':'Smtp'},{'model':db[_0x228c('0x43')],'as':_0x228c('0x25')}]})[_0x228c('0xd')](function(_0x178b13){var _0x3a35a4=_0x35b7d8['user']['get']({'plain':!![]});if(!_0x3a35a4)throw new Error(_0x228c('0x66'));if(_0x3a35a4[_0x228c('0x67')]===_0x228c('0x5c')){var _0x2113ab=_0x178b13[_0x228c('0x68')]({'plain':!![]});return db[_0x228c('0x69')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x3a35a4[_0x228c('0x6a')]},'raw':!![]})[_0x228c('0xd')](function(_0x3d013d){if(_0x3d013d&&_0x3d013d[_0x228c('0x6b')]===0x0){return db[_0x228c('0x1f')][_0x228c('0x4e')]({'name':_0x2113ab['name'],'resourceId':_0x2113ab['id'],'type':_0x3d013d[_0x228c('0x22')],'sectionId':_0x3d013d['id']},{})[_0x228c('0xd')](function(){return _0x178b13;});}else{return _0x178b13;}})['catch'](function(_0x43847b){logger[_0x228c('0x12')](_0x228c('0x6c'),_0x43847b);throw _0x43847b;});}return _0x178b13;})['then'](respondWithResult(_0x4d9179,0xc9))[_0x228c('0x16')](handleError(_0x4d9179,null));};exports[_0x228c('0x6d')]=function(_0x53728f,_0x410298){return db['MailAccount']['findOne']({'where':{'id':_0x53728f[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x410298,null))[_0x228c('0xd')](function(_0x393eca){if(_0x393eca){return _0x393eca[_0x228c('0x6d')]();}return null;})[_0x228c('0xd')](respondWithResult(_0x410298,null))[_0x228c('0x16')](handleError(_0x410298,null));};exports[_0x228c('0x6e')]=function(_0x1822f2,_0x336b5e){if(_0x1822f2[_0x228c('0x48')]['id']){delete _0x1822f2[_0x228c('0x48')]['id'];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x1822f2[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x336b5e,null))[_0x228c('0xd')](function(_0x19a8aa){if(_0x19a8aa){_0x1822f2['body'][_0x228c('0x4c')]=_0x19a8aa['id'];return db[_0x228c('0x43')][_0x228c('0x4e')](_0x1822f2[_0x228c('0x48')]);}})['then'](respondWithResult(_0x336b5e,null))['catch'](handleError(_0x336b5e,null));};exports[_0x228c('0x6f')]=function(_0x2d157b,_0x2ee521){return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x2d157b[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x2ee521,null))[_0x228c('0xd')](function(_0x142ea4){if(_0x142ea4){return _0x142ea4[_0x228c('0x70')](null);}return null;})[_0x228c('0xd')](respondWithStatusCode(_0x2ee521,null))[_0x228c('0x16')](handleError(_0x2ee521,null));};exports[_0x228c('0x71')]=function(_0x1580e4,_0x399726){return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x1580e4['params']['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x399726,null))[_0x228c('0xd')](function(_0x10867e){if(_0x10867e){return _0x10867e[_0x228c('0x71')]();}return null;})['then'](respondWithResult(_0x399726,null))[_0x228c('0x16')](handleError(_0x399726,null));};exports[_0x228c('0x72')]=function(_0xc53797,_0x61321e){if(_0xc53797[_0x228c('0x48')]['id']){delete _0xc53797[_0x228c('0x48')]['id'];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0xc53797[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x61321e,null))['then'](function(_0x3a8be0){if(_0x3a8be0){_0xc53797[_0x228c('0x48')]['MailAccountId']=_0x3a8be0['id'];return db[_0x228c('0x26')][_0x228c('0x4e')](_0xc53797[_0x228c('0x48')]);}})[_0x228c('0xd')](respondWithResult(_0x61321e,null))[_0x228c('0x16')](handleError(_0x61321e,null));};exports['removeSmtp']=function(_0x3c11cd,_0x228c08){return db['MailAccount'][_0x228c('0x4f')]({'where':{'id':_0x3c11cd[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x228c08,null))[_0x228c('0xd')](function(_0x34a967){if(_0x34a967){return _0x34a967[_0x228c('0x73')](null);}return null;})[_0x228c('0xd')](respondWithStatusCode(_0x228c08,null))['catch'](handleError(_0x228c08,null));};exports[_0x228c('0x74')]=function(_0x196b45,_0x3a5806){return db[_0x228c('0x75')][_0x228c('0x46')]({'where':{'id':_0x196b45['params']['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x3a5806,null))['then'](function(_0x43d73a){if(_0x43d73a){return _0x43d73a['addInteraction'](_0x196b45[_0x228c('0x48')][_0x228c('0x52')],_[_0x228c('0x76')](_0x196b45[_0x228c('0x48')],['ids','id'])||{});}})[_0x228c('0xd')](respondWithResult(_0x3a5806,null))[_0x228c('0x16')](handleError(_0x3a5806,null));};exports[_0x228c('0x77')]=function(_0x4385f2,_0x1db5ef){var _0x19e4bd={'raw':![],'where':{}};var _0x413d03={};var _0x110f96={'count':0x0,'rows':[]};return db['MailAccount'][_0x228c('0x4f')]({'where':{'id':_0x4385f2[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x1db5ef,null))['then'](function(_0x15718e){if(_0x15718e){_0x413d03[_0x228c('0x2e')]=_[_0x228c('0x31')](db['MailInteraction'][_0x228c('0x2a')]);_0x413d03['query']=_['keys'](_0x4385f2[_0x228c('0x30')]);_0x413d03['filters']=_['intersection'](_0x413d03[_0x228c('0x2e')],_0x413d03[_0x228c('0x30')]);_0x19e4bd[_0x228c('0x34')]=_[_0x228c('0x33')](_0x413d03[_0x228c('0x2e')],qs['fields'](_0x4385f2[_0x228c('0x30')]['fields']));_0x19e4bd['attributes']=_0x19e4bd[_0x228c('0x34')][_0x228c('0x36')]?_0x19e4bd[_0x228c('0x34')]:_0x413d03['model'];if(!_0x4385f2[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x19e4bd['limit']=qs[_0x228c('0x1b')](_0x4385f2[_0x228c('0x30')][_0x228c('0x1b')]);_0x19e4bd[_0x228c('0x19')]=qs[_0x228c('0x19')](_0x4385f2[_0x228c('0x30')][_0x228c('0x19')]);}_0x19e4bd[_0x228c('0x38')]=qs[_0x228c('0x39')](_0x4385f2[_0x228c('0x30')][_0x228c('0x39')]);_0x19e4bd[_0x228c('0x3d')]=qs[_0x228c('0x32')](_[_0x228c('0x3a')](_0x4385f2['query'],_0x413d03[_0x228c('0x32')]));_0x19e4bd[_0x228c('0x3d')][_0x228c('0x4c')]=_0x15718e['id'];if(_0x4385f2['query'][_0x228c('0x3b')]){_0x19e4bd['where']=_[_0x228c('0x3c')](_0x19e4bd[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x19e4bd[_0x228c('0x34')],function(_0x3980d6){var _0x173a70={};_0x173a70[_0x3980d6]={'$like':'%'+_0x4385f2[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x173a70;})});}_0x19e4bd=_[_0x228c('0x3c')]({},_0x19e4bd,_0x4385f2[_0x228c('0x3e')]);return db['MailInteraction'][_0x228c('0x1c')]({'where':_0x19e4bd['where']})[_0x228c('0xd')](function(_0x1ec5d5){_0x110f96[_0x228c('0x1c')]=_0x1ec5d5;if(_0x4385f2['query']['includeAll']){_0x19e4bd[_0x228c('0x45')]=[{'model':db[_0x228c('0x78')],'as':_0x228c('0x79'),'required':![]},{'model':db[_0x228c('0x7a')],'as':_0x228c('0x7b'),'attributes':['name',_0x228c('0x7c'),_0x228c('0x7d')],'required':![]},{'model':db[_0x228c('0x7e')],'as':_0x228c('0x7f'),'attributes':['id',_0x228c('0x22'),_0x228c('0x80')],'where':_0x4385f2['query'][_0x228c('0x81')]?{'id':_0x4385f2['query'][_0x228c('0x81')]}:undefined,'required':_0x4385f2[_0x228c('0x30')][_0x228c('0x81')]?!![]:![]}];}return db['MailInteraction'][_0x228c('0x40')](_0x19e4bd);})[_0x228c('0xd')](function(_0x182216){_0x110f96[_0x228c('0x41')]=_0x182216;return _0x110f96;});}})[_0x228c('0xd')](respondWithFilteredResult(_0x1db5ef,_0x19e4bd))[_0x228c('0x16')](handleError(_0x1db5ef,null));};exports['addApplications']=function addApplications(_0x30cd26,_0x345934){var _0xa1506d=_0x30cd26['params']['id'];var _0x31bf07=_0x30cd26[_0x228c('0x48')];var _0x27e554=0xc8;var _0x4b6d84=null;return db[_0x228c('0x82')][_0x228c('0x83')]({'isolationLevel':db[_0x228c('0x82')][_0x228c('0x84')][_0x228c('0x85')][_0x228c('0x86')]},function(_0x269a53){return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0xa1506d},'transaction':_0x269a53})[_0x228c('0xd')](function(_0x1c9556){if(_0x1c9556){return db['MailApplication'][_0x228c('0x1e')]({'where':{'MailAccountId':_0xa1506d},'transaction':_0x269a53})[_0x228c('0xd')](function(){var _0x191ca5=_[_0x228c('0x2f')](_0x31bf07,function(_0xa8c352){_0xa8c352[_0x228c('0x4c')]=_0xa1506d;return _0xa8c352;});return db['MailApplication'][_0x228c('0x87')](_0x191ca5,{'transaction':_0x269a53});});}else{_0x27e554=0x194;_0x4b6d84=[];}});})[_0x228c('0xd')](function(){if(_0x27e554!==0x194){return db[_0x228c('0x88')][_0x228c('0x89')]({'where':{'MailAccountId':_0xa1506d},'order':_0x228c('0x8a')})[_0x228c('0xd')](function(_0x4338f4){_0x4b6d84=_0x4338f4;});}})[_0x228c('0x16')](function(_0xacfc7f){_0x27e554=0x1f4;logger[_0x228c('0x12')](_0xacfc7f[_0x228c('0x21')]);if(_0xacfc7f[_0x228c('0x22')]){delete _0xacfc7f[_0x228c('0x22')];}_0x4b6d84=_0xacfc7f;})[_0x228c('0x8b')](function(){if(_0x4b6d84===null){_0x345934[_0x228c('0x17')](_0x27e554);}else{if(_0x27e554===0x1f4){_0x345934[_0x228c('0x18')](_0x27e554)[_0x228c('0x23')](_0x4b6d84);}else{_0x345934[_0x228c('0x18')](_0x27e554)['json'](_0x4b6d84);}}});};exports[_0x228c('0x8c')]=function(_0x25210d,_0xf37be0){var _0x5d85b8={};var _0x321134={};var _0x16ca08;var _0x2b12ac;return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x25210d[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0xf37be0,null))['then'](function(_0x108e34){if(_0x108e34){_0x16ca08=_0x108e34;_0x321134[_0x228c('0x2e')]=_[_0x228c('0x31')](db[_0x228c('0x88')]['rawAttributes']);_0x321134[_0x228c('0x30')]=_['keys'](_0x25210d[_0x228c('0x30')]);_0x321134[_0x228c('0x32')]=_['intersection'](_0x321134['model'],_0x321134[_0x228c('0x30')]);_0x5d85b8[_0x228c('0x34')]=_[_0x228c('0x33')](_0x321134['model'],qs['fields'](_0x25210d[_0x228c('0x30')][_0x228c('0x35')]));_0x5d85b8[_0x228c('0x34')]=_0x5d85b8[_0x228c('0x34')]['length']?_0x5d85b8[_0x228c('0x34')]:_0x321134[_0x228c('0x2e')];_0x5d85b8['order']=qs['sort'](_0x25210d['query']['sort']);_0x5d85b8[_0x228c('0x3d')]=qs['filters'](_[_0x228c('0x3a')](_0x25210d[_0x228c('0x30')],_0x321134['filters']));if(_0x25210d[_0x228c('0x30')][_0x228c('0x3b')]){_0x5d85b8[_0x228c('0x3d')]=_['merge'](_0x5d85b8[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x5d85b8[_0x228c('0x34')],function(_0x34793a){var _0x38d90f={};_0x38d90f[_0x34793a]={'$like':'%'+_0x25210d[_0x228c('0x30')]['filter']+'%'};return _0x38d90f;})});}_0x5d85b8=_[_0x228c('0x3c')]({},_0x5d85b8,_0x25210d[_0x228c('0x3e')]);return _0x16ca08['getApplications'](_0x5d85b8);}})[_0x228c('0xd')](function(_0x443f98){if(_0x443f98){_0x2b12ac=_0x443f98[_0x228c('0x36')];if(!_0x25210d['query'][_0x228c('0x50')](_0x228c('0x37'))){_0x5d85b8[_0x228c('0x1b')]=qs[_0x228c('0x1b')](_0x25210d[_0x228c('0x30')][_0x228c('0x1b')]);_0x5d85b8[_0x228c('0x19')]=qs['offset'](_0x25210d[_0x228c('0x30')][_0x228c('0x19')]);}return _0x16ca08[_0x228c('0x8c')](_0x5d85b8);}})[_0x228c('0xd')](function(_0x461ac9){if(_0x461ac9){return _0x461ac9?{'count':_0x2b12ac,'rows':_0x461ac9}:null;}})[_0x228c('0xd')](respondWithResult(_0xf37be0,null))[_0x228c('0x16')](handleError(_0xf37be0,null));};exports['getMessages']=function(_0x4b0401,_0x5dda5e){var _0x2e0a80={'raw':!![],'where':{}};var _0x2a1e9f={};var _0x1ab412={'count':0x0,'rows':[]};return db[_0x228c('0x29')]['findOne']({'where':{'id':_0x4b0401[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x5dda5e,null))[_0x228c('0xd')](function(_0x58d3c0){if(_0x58d3c0){_0x2a1e9f['model']=_[_0x228c('0x31')](db[_0x228c('0x8d')][_0x228c('0x2a')]);_0x2a1e9f[_0x228c('0x30')]=_[_0x228c('0x31')](_0x4b0401[_0x228c('0x30')]);_0x2a1e9f[_0x228c('0x32')]=_[_0x228c('0x33')](_0x2a1e9f[_0x228c('0x2e')],_0x2a1e9f[_0x228c('0x30')]);_0x2e0a80['attributes']=_[_0x228c('0x33')](_0x2a1e9f[_0x228c('0x2e')],qs['fields'](_0x4b0401[_0x228c('0x30')][_0x228c('0x35')]));_0x2e0a80['attributes']=_0x2e0a80[_0x228c('0x34')][_0x228c('0x36')]?_0x2e0a80['attributes']:_0x2a1e9f[_0x228c('0x2e')];if(!_0x4b0401[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x2e0a80[_0x228c('0x1b')]=qs[_0x228c('0x1b')](_0x4b0401[_0x228c('0x30')][_0x228c('0x1b')]);_0x2e0a80[_0x228c('0x19')]=qs[_0x228c('0x19')](_0x4b0401[_0x228c('0x30')][_0x228c('0x19')]);}_0x2e0a80['order']=qs['sort'](_0x4b0401['query'][_0x228c('0x39')]);_0x2e0a80[_0x228c('0x3d')]=qs[_0x228c('0x32')](_['pick'](_0x4b0401[_0x228c('0x30')],_0x2a1e9f[_0x228c('0x32')]));_0x2e0a80['where'][_0x228c('0x4c')]=_0x58d3c0['id'];if(_0x4b0401['query'][_0x228c('0x3b')]){_0x2e0a80['where']=_[_0x228c('0x3c')](_0x2e0a80[_0x228c('0x3d')],{'$or':_['map'](_0x2e0a80[_0x228c('0x34')],function(_0xbd3fd0){var _0x2f9372={};_0x2f9372[_0xbd3fd0]={'$like':'%'+_0x4b0401['query']['filter']+'%'};return _0x2f9372;})});}if(_0x4b0401[_0x228c('0x30')][_0x228c('0x8e')]){var _0xd3505c=_0x4b0401['query']['$gte']['split'](',');var _0x37c855={};_0x37c855[_0xd3505c[0x0]]={'$gte':moment(_0xd3505c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2e0a80[_0x228c('0x3d')]=_[_0x228c('0x3c')](_0x2e0a80[_0x228c('0x3d')],_0x37c855);}_0x2e0a80=_['merge']({},_0x2e0a80,_0x4b0401[_0x228c('0x3e')]);return db['MailMessage'][_0x228c('0x1c')]({'where':_0x2e0a80[_0x228c('0x3d')]})[_0x228c('0xd')](function(_0x34205c){_0x1ab412[_0x228c('0x1c')]=_0x34205c;if(_0x4b0401[_0x228c('0x30')][_0x228c('0x3f')]){_0x2e0a80[_0x228c('0x45')]=[{'all':!![]}];}return db[_0x228c('0x8d')]['findAll'](_0x2e0a80);})[_0x228c('0xd')](function(_0x143371){if(_0x4b0401[_0x228c('0x30')]['inlineCss']==='true'){for(var _0xc56ea6=0x0;_0xc56ea6<_0x143371[_0x228c('0x36')];_0xc56ea6++){_0x143371[_0xc56ea6][_0x228c('0x48')]=juice(_0x143371[_0xc56ea6][_0x228c('0x48')]);}}_0x1ab412['rows']=_0x143371;return _0x1ab412;});}})[_0x228c('0xd')](respondWithFilteredResult(_0x5dda5e,_0x2e0a80))[_0x228c('0x16')](handleError(_0x5dda5e,null));};exports[_0x228c('0x23')]=function(_0x484b03,_0xd2fb92){var _0x52c6fa,_0x4a8f4e={},_0x48f3df;if(_0x484b03[_0x228c('0x48')]['to']){_0x48f3df=_0x484b03['body']['to'][_0x228c('0x8f')](',')[0x0];}return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x484b03[_0x228c('0x49')]['id']},'include':[{'model':db[_0x228c('0x90')],'as':'List','include':[{'model':db['CmContact'],'as':_0x228c('0x91'),'where':{'email':_0x48f3df},'limit':0x1,'order':[[_0x228c('0x92'),_0x228c('0x93')]]}]},{'model':db[_0x228c('0x26')],'as':_0x228c('0x27'),'raw':!![]}]})[_0x228c('0xd')](handleEntityNotFound(_0xd2fb92,null))[_0x228c('0xd')](function(_0x2aa210){if(_0x2aa210){_0x52c6fa=_0x2aa210;if(_0x2aa210['Smtp']){if(_[_0x228c('0x94')](_0x484b03[_0x228c('0x48')][_0x228c('0x95')])){_0x484b03[_0x228c('0x48')][_0x228c('0x95')]=util['format'](_0x228c('0x96'),_0x2aa210[_0x228c('0x22')],_0x2aa210[_0x228c('0x59')]||_0x2aa210[_0x228c('0x27')]['user']);}if(_0x484b03[_0x228c('0x48')][_0x228c('0x97')]&&_0x484b03['body'][_0x228c('0x97')][_0x228c('0x36')]){for(var _0x596234=0x0;_0x596234<_0x484b03[_0x228c('0x48')][_0x228c('0x97')]['length'];_0x596234+=0x1){_0x484b03['body'][_0x228c('0x97')][_0x596234]={'filename':_0x484b03[_0x228c('0x48')][_0x228c('0x97')][_0x596234][_0x228c('0x22')],'path':path[_0x228c('0x98')](config[_0x228c('0x99')],_0x228c('0x9a'),_0x484b03['body'][_0x228c('0x97')][_0x596234][_0x228c('0x9b')])};}}var _0x1aa411={'tls':{'rejectUnauthorized':![]}};if(_[_0x228c('0x94')](_0x2aa210['Smtp'][_0x228c('0x62')])){if(_0x2aa210[_0x228c('0x27')][_0x228c('0x65')]){_0x1aa411[_0x228c('0x9c')]={'user':_0x2aa210[_0x228c('0x27')][_0x228c('0x5c')],'pass':_0x2aa210[_0x228c('0x27')][_0x228c('0x5e')]};}_0x1aa411[_0x228c('0x63')]=_0x2aa210[_0x228c('0x27')]['host'];_0x1aa411[_0x228c('0x64')]=_0x2aa210['Smtp'][_0x228c('0x64')];_0x1aa411['secure']=_0x2aa210['Smtp'][_0x228c('0x9d')];}else{_0x1aa411[_0x228c('0x62')]=_0x2aa210[_0x228c('0x27')][_0x228c('0x62')];_0x1aa411[_0x228c('0x9c')]={'user':_0x2aa210['Smtp'][_0x228c('0x5c')],'pass':_0x2aa210[_0x228c('0x27')][_0x228c('0x5e')]};}return respondWithRpcPromise('SendMail',_0x228c('0x9e'),{'account':_0x1aa411,'message':_0x484b03[_0x228c('0x48')]});}else{throw new Error(_0x228c('0x9f'));}}})[_0x228c('0xd')](function(_0x1ff53d){if(_0x1ff53d){_0x4a8f4e=_0x1ff53d;if(_0x52c6fa[_0x228c('0xa0')]){if(_0x52c6fa['List'][_0x228c('0x91')][_0x228c('0x36')]){return _0x52c6fa[_0x228c('0xa0')][_0x228c('0x91')][0x0];}else{return db[_0x228c('0x78')]['create'](_[_0x228c('0x9')](_0x484b03[_0x228c('0x48')],{'firstName':_0x484b03[_0x228c('0x48')]['to'],'email':_0x484b03[_0x228c('0x48')]['to'],'phone':_0x484b03['body']['to'],'ListId':_0x52c6fa[_0x228c('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x59c6d8){if(_0x59c6d8){var _0x2fe3e5={'UserId':_0x484b03[_0x228c('0x5c')]['id'],'ContactId':_0x59c6d8['id'],'MailAccountId':_0x52c6fa['id'],'inReplyTo':_0x4a8f4e[_0x228c('0xa1')],'to':_0x484b03['body'][_0x228c('0x95')],'cc':_0x484b03['body']['cc'],'subject':_0x484b03[_0x228c('0x48')][_0x228c('0xa2')],'attach':_0x484b03[_0x228c('0x48')][_0x228c('0xa3')],'firstMsgDirection':_0x228c('0xa4'),'lastMsgAt':moment()[_0x228c('0xa5')](_0x228c('0xa6')),'lastMsgDirection':_0x228c('0xa4'),'Messages':[_[_0x228c('0x3c')](_0x484b03[_0x228c('0x48')],{'messageId':_0x4a8f4e[_0x228c('0xa1')],'sentAt':moment()[_0x228c('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x52c6fa['id'],'UserId':_0x484b03['user']['id'],'ContactId':_0x59c6d8['id']})]};if(_0x484b03[_0x228c('0x48')][_0x228c('0xa7')]){_0x2fe3e5=_[_0x228c('0x3c')](_0x2fe3e5,_0x484b03[_0x228c('0x48')][_0x228c('0xa7')]);}return db[_0x228c('0x75')][_0x228c('0x4e')](_0x2fe3e5,{'include':[{'model':db[_0x228c('0x8d')],'as':_0x228c('0xa8')}]});}})[_0x228c('0xd')](respondWithResult(_0xd2fb92,null))[_0x228c('0x16')](handleError(_0xd2fb92,null));};exports['verifySmtp']=function(_0x1ebe7c,_0x55fdc7){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x1ebe7c[_0x228c('0x49')]['id']},'include':[{'model':db[_0x228c('0x26')],'as':_0x228c('0x27'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x228c('0xd')](handleEntityNotFound(_0x55fdc7,null))[_0x228c('0xd')](function(_0x2a05fb){if(_0x2a05fb&&_0x2a05fb[_0x228c('0x27')]){var _0x3b5e55={'id':_0x2a05fb['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2a05fb[_0x228c('0x27')][_0x228c('0x62')]){_0x3b5e55[_0x228c('0x62')]=_0x2a05fb[_0x228c('0x27')][_0x228c('0x62')];}else{_0x3b5e55[_0x228c('0x63')]=_0x2a05fb[_0x228c('0x27')][_0x228c('0x63')];_0x3b5e55[_0x228c('0x64')]=_0x2a05fb[_0x228c('0x27')][_0x228c('0x64')];_0x3b5e55['secure']=_0x2a05fb['Smtp'][_0x228c('0x9d')];}if(_0x2a05fb[_0x228c('0x27')]['authentication']){if(_0x2a05fb['Smtp']['modernAuthentication']){_0x3b5e55[_0x228c('0x9c')]={'type':_0x228c('0xa9'),'user':_0x2a05fb['Smtp'][_0x228c('0x5c')],'accessToken':_0x2a05fb['Smtp'][_0x228c('0xaa')]['data5']};}else{_0x3b5e55['auth']={'user':_0x2a05fb[_0x228c('0x27')][_0x228c('0x5c')],'pass':_0x2a05fb[_0x228c('0x27')]['pass']};}}return respondWithRpcPromise(_0x228c('0xab'),'verifySmtp',{'account':_0x3b5e55});}})[_0x228c('0xd')](respondWithResult(_0x55fdc7,null))['catch'](handleError(_0x55fdc7,null));};exports[_0x228c('0x1e')]=function(_0x1f1ce2,_0x39d6a3){return db[_0x228c('0x29')][_0x228c('0x46')]({'where':{'id':_0x1f1ce2['params']['id']}})['then'](handleEntityNotFound(_0x39d6a3,null))[_0x228c('0xd')](function(_0x1443b7){if(_0x1443b7&&_0x1443b7[_0x228c('0x62')]){throw new db[(_0x228c('0xac'))][(_0x228c('0xad'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1443b7;})[_0x228c('0xd')](removeEntity(_0x39d6a3,null))[_0x228c('0x16')](handleError(_0x39d6a3,null));};exports['addAgents']=function(_0x324129,_0x1fe139){return db['MailAccount'][_0x228c('0x46')]({'where':{'id':_0x324129[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x1fe139,null))[_0x228c('0xd')](function(_0x4d168e){if(_0x4d168e){return _0x4d168e[_0x228c('0xae')](_0x324129['body'][_0x228c('0x52')],_[_0x228c('0x76')](_0x324129[_0x228c('0x48')],['ids','id'])||{})[_0x228c('0xaf')](function(_0x2e38db){for(var _0x4419a4=0x0;_0x4419a4<_0x324129['body'][_0x228c('0x52')][_0x228c('0x36')];_0x4419a4+=0x1){socket[_0x228c('0xb0')](_0x228c('0xb1'),{'UserId':Number(_0x324129[_0x228c('0x48')][_0x228c('0x52')][_0x4419a4]),'MailAccountId':Number(_0x324129[_0x228c('0x49')]['id'])});}return _0x2e38db;});}})['then'](respondWithResult(_0x1fe139,null))[_0x228c('0x16')](handleError(_0x1fe139,null));};exports[_0x228c('0xb2')]=function(_0x253e63,_0x25c0e0){return db['MailAccount']['find']({'where':{'id':_0x253e63[_0x228c('0x49')]['id']}})['then'](handleEntityNotFound(_0x25c0e0,null))[_0x228c('0xd')](function(_0x300190){if(_0x300190){return _0x300190[_0x228c('0xb2')](_0x253e63[_0x228c('0x30')][_0x228c('0x52')])[_0x228c('0xd')](function(){if(_[_0x228c('0xb3')](_0x253e63[_0x228c('0x30')]['ids'])){for(var _0x2404e4=0x0;_0x2404e4<_0x253e63['query'][_0x228c('0x52')][_0x228c('0x36')];_0x2404e4+=0x1){socket[_0x228c('0xb0')](_0x228c('0xb4'),{'UserId':Number(_0x253e63[_0x228c('0x30')][_0x228c('0x52')][_0x2404e4]),'MailAccountId':Number(_0x253e63[_0x228c('0x49')]['id'])});}}else{socket[_0x228c('0xb0')](_0x228c('0xb4'),{'UserId':Number(_0x253e63['query'][_0x228c('0x52')]),'MailAccountId':Number(_0x253e63[_0x228c('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x25c0e0,null))[_0x228c('0x16')](handleError(_0x25c0e0,null));};exports[_0x228c('0xb5')]=function(_0x2b8af8,_0x19e4fb){var _0x2c8ed1={};var _0x14646f={};var _0x44c221;var _0xbe74b3;return db[_0x228c('0x29')][_0x228c('0x4f')]({'where':{'id':_0x2b8af8[_0x228c('0x49')]['id']}})[_0x228c('0xd')](handleEntityNotFound(_0x19e4fb,null))[_0x228c('0xd')](function(_0x55875f){if(_0x55875f){_0x44c221=_0x55875f;_0x14646f[_0x228c('0x2e')]=_[_0x228c('0x31')](db[_0x228c('0x7a')][_0x228c('0x2a')]);_0x14646f[_0x228c('0x30')]=_[_0x228c('0x31')](_0x2b8af8[_0x228c('0x30')]);_0x14646f[_0x228c('0x32')]=_[_0x228c('0x33')](_0x14646f['model'],_0x14646f[_0x228c('0x30')]);_0x2c8ed1['attributes']=_[_0x228c('0x33')](_0x14646f[_0x228c('0x2e')],qs['fields'](_0x2b8af8['query']['fields']));_0x2c8ed1[_0x228c('0x34')]=_0x2c8ed1[_0x228c('0x34')][_0x228c('0x36')]?_0x2c8ed1[_0x228c('0x34')]:_0x14646f[_0x228c('0x2e')];_0x2c8ed1[_0x228c('0x38')]=qs['sort'](_0x2b8af8['query']['sort']);_0x2c8ed1['where']=qs[_0x228c('0x32')](_[_0x228c('0x3a')](_0x2b8af8[_0x228c('0x30')],_0x14646f[_0x228c('0x32')]));if(_0x2b8af8[_0x228c('0x30')][_0x228c('0x3b')]){_0x2c8ed1[_0x228c('0x3d')]=_[_0x228c('0x3c')](_0x2c8ed1[_0x228c('0x3d')],{'$or':_[_0x228c('0x2f')](_0x2c8ed1['attributes'],function(_0x276526){var _0x2f21c4={};_0x2f21c4[_0x276526]={'$like':'%'+_0x2b8af8[_0x228c('0x30')][_0x228c('0x3b')]+'%'};return _0x2f21c4;})});}_0x2c8ed1=_['merge']({},_0x2c8ed1,_0x2b8af8[_0x228c('0x3e')]);return _0x44c221[_0x228c('0xb5')](_0x2c8ed1);}})[_0x228c('0xd')](function(_0x183fc1){if(_0x183fc1){_0xbe74b3=_0x183fc1[_0x228c('0x36')];if(!_0x2b8af8[_0x228c('0x30')][_0x228c('0x50')](_0x228c('0x37'))){_0x2c8ed1[_0x228c('0x1b')]=qs['limit'](_0x2b8af8[_0x228c('0x30')][_0x228c('0x1b')]);_0x2c8ed1['offset']=qs[_0x228c('0x19')](_0x2b8af8[_0x228c('0x30')][_0x228c('0x19')]);}return _0x44c221[_0x228c('0xb5')](_0x2c8ed1);}})[_0x228c('0xd')](function(_0x56fc71){if(_0x56fc71){return _0x56fc71?{'count':_0xbe74b3,'rows':_0x56fc71}:null;}})['then'](respondWithResult(_0x19e4fb,null))[_0x228c('0x16')](handleError(_0x19e4fb,null));}; \ No newline at end of file +var _0xba08=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','MailServerIn','Smtp','mandatoryDispositionPause','rawAttributes','includeAll','update','body','params','describe','addDisposition','find','MailAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','create','getAnswers','nolimit','CannedAnswer','removeAnswers','provider','custom','active','description','user','username','password','pass','modernAuthentication','CloudProviderId','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','Contacts','updatedAt','DESC','isNil','from','format','email','attachments','join','root','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','data5','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','json','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','send','index','Imap','MailServerOut','Pause','map','MailAccount','fieldName','type'];(function(_0x48c1bf,_0x2e76bf){var _0x3172b7=function(_0x1f2a6f){while(--_0x1f2a6f){_0x48c1bf['push'](_0x48c1bf['shift']());}};_0x3172b7(++_0x2e76bf);}(_0xba08,0x13d));var _0x8ba0=function(_0x28d6e2,_0x51fac0){_0x28d6e2=_0x28d6e2-0x0;var _0x7dc05b=_0xba08[_0x28d6e2];return _0x7dc05b;};'use strict';var moment=require(_0x8ba0('0x0'));var BPromise=require(_0x8ba0('0x1'));var util=require(_0x8ba0('0x2'));var path=require(_0x8ba0('0x3'));var _=require(_0x8ba0('0x4'));var juice=require(_0x8ba0('0x5'));var Redis=require(_0x8ba0('0x6'));var qs=require(_0x8ba0('0x7'));var logger=require(_0x8ba0('0x8'))(_0x8ba0('0x9'));var config=require(_0x8ba0('0xa'));var db=require(_0x8ba0('0xb'))['db'];config[_0x8ba0('0xc')]=_[_0x8ba0('0xd')](config[_0x8ba0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ba0('0xe'))(new Redis(config[_0x8ba0('0xc')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0x8ba0('0xf'));var client=jayson['client'][_0x8ba0('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x25f82c,_0x42499d,_0x51ade9,_0x44cf31){return new BPromise(function(_0x1fb742,_0x187e38){var _0x3c11dd=_0x44cf31||client;return _0x3c11dd[_0x8ba0('0x11')](_0x25f82c,_0x51ade9)[_0x8ba0('0x12')](function(_0x42d713){logger[_0x8ba0('0x13')](_0x8ba0('0x14'),_0x42499d,_0x8ba0('0x15'));logger[_0x8ba0('0x16')](_0x8ba0('0x17'),_0x42499d,'request\x20sent',JSON['stringify'](_0x42d713));if(_0x42d713[_0x8ba0('0x18')]){if(_0x42d713[_0x8ba0('0x18')][_0x8ba0('0x19')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x42499d,_0x42d713[_0x8ba0('0x18')][_0x8ba0('0x1a')]);return _0x187e38(_0x42d713[_0x8ba0('0x18')]['message']);}logger[_0x8ba0('0x18')](_0x8ba0('0x14'),_0x42499d,_0x42d713[_0x8ba0('0x18')][_0x8ba0('0x1a')]);return _0x1fb742(_0x42d713[_0x8ba0('0x18')][_0x8ba0('0x1a')]);}else{logger[_0x8ba0('0x13')](_0x8ba0('0x14'),_0x42499d,_0x8ba0('0x15'));_0x1fb742(_0x42d713[_0x8ba0('0x1b')][_0x8ba0('0x1a')]);}})[_0x8ba0('0x1c')](function(_0xedaaef){logger[_0x8ba0('0x18')](_0x8ba0('0x14'),_0x42499d,_0xedaaef);_0x187e38(_0xedaaef);});});}function respondWithStatusCode(_0x5c4756,_0x323003){_0x323003=_0x323003||0xcc;return function(_0x54c191){if(_0x54c191){return _0x5c4756['sendStatus'](_0x323003);}return _0x5c4756[_0x8ba0('0x1d')](_0x323003)[_0x8ba0('0x1e')]();};}function respondWithResult(_0x465690,_0x1f12ec){_0x1f12ec=_0x1f12ec||0xc8;return function(_0x3cd6e0){if(_0x3cd6e0){return _0x465690[_0x8ba0('0x1d')](_0x1f12ec)['json'](_0x3cd6e0);}};}function respondWithFilteredResult(_0xe5ad69,_0x2970f8){return function(_0x2e4318){if(_0x2e4318){var _0x314f6c=typeof _0x2970f8[_0x8ba0('0x1f')]===_0x8ba0('0x20')&&typeof _0x2970f8[_0x8ba0('0x21')]===_0x8ba0('0x20');var _0x1fa800=_0x2e4318[_0x8ba0('0x22')];var _0x537745=_0x314f6c?0x0:_0x2970f8['offset'];var _0x48c78d=_0x314f6c?_0x2e4318[_0x8ba0('0x22')]:_0x2970f8['offset']+_0x2970f8[_0x8ba0('0x21')];var _0x284b8a;if(_0x48c78d>=_0x1fa800){_0x48c78d=_0x1fa800;_0x284b8a=0xc8;}else{_0x284b8a=0xce;}_0xe5ad69['status'](_0x284b8a);return _0xe5ad69[_0x8ba0('0x23')]('Content-Range',_0x537745+'-'+_0x48c78d+'/'+_0x1fa800)[_0x8ba0('0x24')](_0x2e4318);}return null;};}function saveUpdates(_0x52f537){return function(_0x19b441){if(_0x19b441){return _0x19b441['update'](_0x52f537)[_0x8ba0('0x12')](function(_0x17e5c6){return _0x17e5c6;});}return null;};}function removeEntity(_0x3ec601){return function(_0x5d8831){if(_0x5d8831){return _0x5d8831[_0x8ba0('0x25')]()['then'](function(){var _0x188cb4=_0x5d8831[_0x8ba0('0x26')]({'plain':!![]});var _0x34a3f3=_0x8ba0('0x27');return db[_0x8ba0('0x28')][_0x8ba0('0x25')]({'where':{'type':_0x34a3f3,'resourceId':_0x188cb4['id']}})[_0x8ba0('0x12')](function(){return _0x5d8831;});})[_0x8ba0('0x12')](function(){_0x3ec601[_0x8ba0('0x1d')](0xcc)[_0x8ba0('0x1e')]();});}};}function handleEntityNotFound(_0x1cb316){return function(_0x27bcfe){if(!_0x27bcfe){_0x1cb316[_0x8ba0('0x29')](0x194);}return _0x27bcfe;};}function handleError(_0x57b645,_0x2c258f){_0x2c258f=_0x2c258f||0x1f4;return function(_0x4cf5c4){logger['error'](_0x4cf5c4[_0x8ba0('0x2a')]);if(_0x4cf5c4[_0x8ba0('0x2b')]){delete _0x4cf5c4[_0x8ba0('0x2b')];}_0x57b645[_0x8ba0('0x1d')](_0x2c258f)[_0x8ba0('0x2c')](_0x4cf5c4);};}exports[_0x8ba0('0x2d')]=function(_0x50ed48,_0x35c5a1){var _0x7fe88e={'include':[{'model':db['MailServerIn'],'as':_0x8ba0('0x2e')},{'model':db[_0x8ba0('0x2f')],'as':'Smtp'},{'model':db[_0x8ba0('0x30')],'as':'mandatoryDispositionPause'}]},_0x561f4c={},_0x460889={'count':0x0,'rows':[]};var _0x502eb8=_[_0x8ba0('0x31')](db[_0x8ba0('0x32')]['rawAttributes'],function(_0x3e5817){return{'name':_0x3e5817[_0x8ba0('0x33')],'type':_0x3e5817[_0x8ba0('0x34')][_0x8ba0('0x35')]};});_0x561f4c[_0x8ba0('0x36')]=_[_0x8ba0('0x31')](_0x502eb8,_0x8ba0('0x2b'));_0x561f4c[_0x8ba0('0x37')]=_[_0x8ba0('0x38')](_0x50ed48[_0x8ba0('0x37')]);_0x561f4c[_0x8ba0('0x39')]=_[_0x8ba0('0x3a')](_0x561f4c[_0x8ba0('0x36')],_0x561f4c['query']);_0x7fe88e[_0x8ba0('0x3b')]=_['intersection'](_0x561f4c[_0x8ba0('0x36')],qs[_0x8ba0('0x3c')](_0x50ed48[_0x8ba0('0x37')][_0x8ba0('0x3c')]));_0x7fe88e[_0x8ba0('0x3b')]=_0x7fe88e['attributes'][_0x8ba0('0x3d')]?_0x7fe88e[_0x8ba0('0x3b')]:_0x561f4c[_0x8ba0('0x36')];if(!_0x50ed48[_0x8ba0('0x37')][_0x8ba0('0x3e')]('nolimit')){_0x7fe88e[_0x8ba0('0x21')]=qs[_0x8ba0('0x21')](_0x50ed48['query'][_0x8ba0('0x21')]);_0x7fe88e[_0x8ba0('0x1f')]=qs[_0x8ba0('0x1f')](_0x50ed48[_0x8ba0('0x37')]['offset']);}_0x7fe88e['order']=qs[_0x8ba0('0x3f')](_0x50ed48[_0x8ba0('0x37')][_0x8ba0('0x3f')]);_0x7fe88e['where']=qs[_0x8ba0('0x39')](_[_0x8ba0('0x40')](_0x50ed48[_0x8ba0('0x37')],_0x561f4c['filters']),_0x502eb8);if(_0x50ed48[_0x8ba0('0x37')][_0x8ba0('0x41')]){_0x7fe88e[_0x8ba0('0x42')]=_[_0x8ba0('0x43')](_0x7fe88e[_0x8ba0('0x42')],{'$or':_[_0x8ba0('0x31')](_0x502eb8,function(_0xde2089){if(_0xde2089[_0x8ba0('0x34')]!==_0x8ba0('0x44')){var _0x309a60={};_0x309a60[_0xde2089[_0x8ba0('0x2b')]]={'$like':'%'+_0x50ed48[_0x8ba0('0x37')][_0x8ba0('0x41')]+'%'};return _0x309a60;}})});}_0x7fe88e=_[_0x8ba0('0x43')]({},_0x7fe88e,_0x50ed48[_0x8ba0('0x45')]);var _0x3b2ba8={'where':_0x7fe88e[_0x8ba0('0x42')]};return db[_0x8ba0('0x32')][_0x8ba0('0x22')](_0x3b2ba8)[_0x8ba0('0x12')](function(_0x77c3a5){_0x460889[_0x8ba0('0x22')]=_0x77c3a5;if(_0x50ed48[_0x8ba0('0x37')]['includeAll']){_0x7fe88e[_0x8ba0('0x46')]=[{'all':!![]}];}return db['MailAccount'][_0x8ba0('0x47')](_0x7fe88e);})[_0x8ba0('0x12')](function(_0x55b5c1){_0x460889[_0x8ba0('0x48')]=_0x55b5c1;return _0x460889;})['then'](respondWithFilteredResult(_0x35c5a1,_0x7fe88e))[_0x8ba0('0x1c')](handleError(_0x35c5a1,null));};exports['show']=function(_0xd681e9,_0x1cc501){var _0x3dffcc={'raw':![],'where':{'id':_0xd681e9['params']['id']},'include':[{'model':db[_0x8ba0('0x49')],'as':'Imap'},{'model':db[_0x8ba0('0x2f')],'as':_0x8ba0('0x4a')},{'model':db[_0x8ba0('0x30')],'as':_0x8ba0('0x4b')}]},_0x2d0f47={};_0x2d0f47[_0x8ba0('0x36')]=_[_0x8ba0('0x38')](db[_0x8ba0('0x32')][_0x8ba0('0x4c')]);_0x2d0f47[_0x8ba0('0x37')]=_[_0x8ba0('0x38')](_0xd681e9['query']);_0x2d0f47[_0x8ba0('0x39')]=_['intersection'](_0x2d0f47[_0x8ba0('0x36')],_0x2d0f47[_0x8ba0('0x37')]);_0x3dffcc[_0x8ba0('0x3b')]=_[_0x8ba0('0x3a')](_0x2d0f47[_0x8ba0('0x36')],qs[_0x8ba0('0x3c')](_0xd681e9[_0x8ba0('0x37')][_0x8ba0('0x3c')]));_0x3dffcc[_0x8ba0('0x3b')]=_0x3dffcc[_0x8ba0('0x3b')]['length']?_0x3dffcc[_0x8ba0('0x3b')]:_0x2d0f47['model'];if(_0xd681e9[_0x8ba0('0x37')][_0x8ba0('0x4d')]){_0x3dffcc[_0x8ba0('0x46')]=[{'all':!![]}];}_0x3dffcc=_[_0x8ba0('0x43')]({},_0x3dffcc,_0xd681e9[_0x8ba0('0x45')]);return db[_0x8ba0('0x32')]['find'](_0x3dffcc)[_0x8ba0('0x12')](handleEntityNotFound(_0x1cc501,null))[_0x8ba0('0x12')](respondWithResult(_0x1cc501,null))[_0x8ba0('0x1c')](handleError(_0x1cc501,null));};exports[_0x8ba0('0x4e')]=function(_0x25feef,_0x24a00f){if(_0x25feef[_0x8ba0('0x4f')]['id']){delete _0x25feef[_0x8ba0('0x4f')]['id'];}return db[_0x8ba0('0x32')]['find']({'where':{'id':_0x25feef[_0x8ba0('0x50')]['id']},'include':[{'model':db[_0x8ba0('0x49')],'as':_0x8ba0('0x2e')},{'model':db[_0x8ba0('0x2f')],'as':_0x8ba0('0x4a')},{'model':db[_0x8ba0('0x30')],'as':_0x8ba0('0x4b')}]})['then'](handleEntityNotFound(_0x24a00f,null))['then'](saveUpdates(_0x25feef[_0x8ba0('0x4f')],null))['then'](function(_0x2aecc5){if(_0x2aecc5&&_0x25feef[_0x8ba0('0x4f')]['Imap']){return db['MailServerIn'][_0x8ba0('0x4e')](_0x25feef[_0x8ba0('0x4f')][_0x8ba0('0x2e')],{'where':{'MailAccountId':_0x2aecc5['id']}})[_0x8ba0('0x12')](function(){return _0x2aecc5;});}return _0x2aecc5;})['then'](function(_0x48f4ce){if(_0x48f4ce&&_0x25feef['body']['Smtp']){return db['MailServerOut'][_0x8ba0('0x4e')](_0x25feef[_0x8ba0('0x4f')][_0x8ba0('0x4a')],{'where':{'MailAccountId':_0x48f4ce['id']}})['then'](function(){return _0x48f4ce;});}return _0x48f4ce;})[_0x8ba0('0x12')](respondWithResult(_0x24a00f,null))[_0x8ba0('0x1c')](handleError(_0x24a00f,null));};exports[_0x8ba0('0x51')]=function(_0x5b7c23,_0x899fd7){return db[_0x8ba0('0x32')][_0x8ba0('0x51')]()['then'](respondWithResult(_0x899fd7,null))['catch'](handleError(_0x899fd7,null));};exports[_0x8ba0('0x52')]=function(_0x5a1de5,_0x5366db){if(_0x5a1de5[_0x8ba0('0x4f')]['id']){delete _0x5a1de5[_0x8ba0('0x4f')]['id'];}return db[_0x8ba0('0x32')][_0x8ba0('0x53')]({'where':{'id':_0x5a1de5['params']['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x5366db,null))[_0x8ba0('0x12')](function(_0x5a649a){if(_0x5a649a){_0x5a1de5['body'][_0x8ba0('0x54')]=_0x5a649a['id'];return db[_0x8ba0('0x55')]['create'](_0x5a1de5[_0x8ba0('0x4f')]);}})[_0x8ba0('0x12')](respondWithResult(_0x5366db,null))[_0x8ba0('0x1c')](handleError(_0x5366db,null));};exports[_0x8ba0('0x56')]=function(_0x59c808,_0x1c6b2e){var _0x5a66a7={'raw':![],'where':{}};var _0x29b56a={};var _0x159fad={'count':0x0,'rows':[]};return db['MailAccount'][_0x8ba0('0x57')]({'where':{'id':_0x59c808['params']['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x1c6b2e,null))['then'](function(_0x18a84e){if(_0x18a84e){_0x29b56a[_0x8ba0('0x36')]=_['keys'](db[_0x8ba0('0x55')][_0x8ba0('0x4c')]);_0x29b56a[_0x8ba0('0x37')]=_[_0x8ba0('0x38')](_0x59c808[_0x8ba0('0x37')]);_0x29b56a['filters']=_[_0x8ba0('0x3a')](_0x29b56a[_0x8ba0('0x36')],_0x29b56a[_0x8ba0('0x37')]);_0x5a66a7['attributes']=_['intersection'](_0x29b56a[_0x8ba0('0x36')],qs[_0x8ba0('0x3c')](_0x59c808['query'][_0x8ba0('0x3c')]));_0x5a66a7[_0x8ba0('0x3b')]=_0x5a66a7[_0x8ba0('0x3b')][_0x8ba0('0x3d')]?_0x5a66a7[_0x8ba0('0x3b')]:_0x29b56a[_0x8ba0('0x36')];if(!_0x59c808[_0x8ba0('0x37')][_0x8ba0('0x3e')]('nolimit')){_0x5a66a7['limit']=qs[_0x8ba0('0x21')](_0x59c808['query']['limit']);_0x5a66a7[_0x8ba0('0x1f')]=qs[_0x8ba0('0x1f')](_0x59c808[_0x8ba0('0x37')][_0x8ba0('0x1f')]);}_0x5a66a7[_0x8ba0('0x58')]=qs['sort'](_0x59c808[_0x8ba0('0x37')]['sort']);_0x5a66a7[_0x8ba0('0x42')]=qs['filters'](_[_0x8ba0('0x40')](_0x59c808['query'],_0x29b56a[_0x8ba0('0x39')]));_0x5a66a7[_0x8ba0('0x42')][_0x8ba0('0x54')]=_0x18a84e['id'];if(_0x59c808['query'][_0x8ba0('0x41')]){_0x5a66a7['where']=_['merge'](_0x5a66a7[_0x8ba0('0x42')],{'$or':_[_0x8ba0('0x31')](_0x5a66a7['attributes'],function(_0x176532){var _0xbedbb6={};_0xbedbb6[_0x176532]={'$like':'%'+_0x59c808[_0x8ba0('0x37')][_0x8ba0('0x41')]+'%'};return _0xbedbb6;})});}_0x5a66a7=_[_0x8ba0('0x43')]({},_0x5a66a7,_0x59c808[_0x8ba0('0x45')]);return db[_0x8ba0('0x55')][_0x8ba0('0x22')]({'where':_0x5a66a7[_0x8ba0('0x42')]})[_0x8ba0('0x12')](function(_0x592ab2){_0x159fad[_0x8ba0('0x22')]=_0x592ab2;if(_0x59c808[_0x8ba0('0x37')][_0x8ba0('0x4d')]){_0x5a66a7[_0x8ba0('0x46')]=[{'all':!![]}];}return db[_0x8ba0('0x55')][_0x8ba0('0x47')](_0x5a66a7);})['then'](function(_0x11f9cf){_0x159fad[_0x8ba0('0x48')]=_0x11f9cf;return _0x159fad;});}})[_0x8ba0('0x12')](respondWithFilteredResult(_0x1c6b2e,_0x5a66a7))[_0x8ba0('0x1c')](handleError(_0x1c6b2e,null));};exports[_0x8ba0('0x59')]=function(_0x241eee,_0x4146ec){return db[_0x8ba0('0x32')][_0x8ba0('0x53')]({'where':{'id':_0x241eee[_0x8ba0('0x50')]['id']}})['then'](handleEntityNotFound(_0x4146ec,null))[_0x8ba0('0x12')](function(_0x50a471){if(_0x50a471){return _0x50a471[_0x8ba0('0x59')](_0x241eee['query'][_0x8ba0('0x5a')]);}})['then'](respondWithStatusCode(_0x4146ec,null))['catch'](handleError(_0x4146ec,null));};exports[_0x8ba0('0x5b')]=function(_0x3617f5,_0x1ee33f){if(_0x3617f5[_0x8ba0('0x4f')]['id']){delete _0x3617f5[_0x8ba0('0x4f')]['id'];}return db['MailAccount'][_0x8ba0('0x53')]({'where':{'id':_0x3617f5[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x1ee33f,null))['then'](function(_0x1cbe2c){if(_0x1cbe2c){_0x3617f5[_0x8ba0('0x4f')][_0x8ba0('0x54')]=_0x1cbe2c['id'];return db['CannedAnswer'][_0x8ba0('0x5c')](_0x3617f5[_0x8ba0('0x4f')]);}})[_0x8ba0('0x12')](respondWithResult(_0x1ee33f,null))[_0x8ba0('0x1c')](handleError(_0x1ee33f,null));};exports[_0x8ba0('0x5d')]=function(_0x4bfcfd,_0x3adcd4){var _0x420c3c={'raw':![],'where':{}};var _0x2a049c={};var _0x1d2136={'count':0x0,'rows':[]};return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x4bfcfd['params']['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x3adcd4,null))[_0x8ba0('0x12')](function(_0x18d9ab){if(_0x18d9ab){_0x2a049c[_0x8ba0('0x36')]=_[_0x8ba0('0x38')](db['CannedAnswer']['rawAttributes']);_0x2a049c['query']=_['keys'](_0x4bfcfd[_0x8ba0('0x37')]);_0x2a049c[_0x8ba0('0x39')]=_['intersection'](_0x2a049c[_0x8ba0('0x36')],_0x2a049c[_0x8ba0('0x37')]);_0x420c3c[_0x8ba0('0x3b')]=_[_0x8ba0('0x3a')](_0x2a049c[_0x8ba0('0x36')],qs[_0x8ba0('0x3c')](_0x4bfcfd['query']['fields']));_0x420c3c[_0x8ba0('0x3b')]=_0x420c3c[_0x8ba0('0x3b')][_0x8ba0('0x3d')]?_0x420c3c[_0x8ba0('0x3b')]:_0x2a049c[_0x8ba0('0x36')];if(!_0x4bfcfd[_0x8ba0('0x37')][_0x8ba0('0x3e')](_0x8ba0('0x5e'))){_0x420c3c[_0x8ba0('0x21')]=qs['limit'](_0x4bfcfd['query'][_0x8ba0('0x21')]);_0x420c3c['offset']=qs['offset'](_0x4bfcfd[_0x8ba0('0x37')][_0x8ba0('0x1f')]);}_0x420c3c['order']=qs['sort'](_0x4bfcfd['query'][_0x8ba0('0x3f')]);_0x420c3c[_0x8ba0('0x42')]=qs[_0x8ba0('0x39')](_[_0x8ba0('0x40')](_0x4bfcfd[_0x8ba0('0x37')],_0x2a049c[_0x8ba0('0x39')]));_0x420c3c[_0x8ba0('0x42')]['MailAccountId']=_0x18d9ab['id'];if(_0x4bfcfd[_0x8ba0('0x37')]['filter']){_0x420c3c[_0x8ba0('0x42')]=_[_0x8ba0('0x43')](_0x420c3c[_0x8ba0('0x42')],{'$or':_[_0x8ba0('0x31')](_0x420c3c[_0x8ba0('0x3b')],function(_0x3eb6bc){var _0x2808c1={};_0x2808c1[_0x3eb6bc]={'$like':'%'+_0x4bfcfd[_0x8ba0('0x37')][_0x8ba0('0x41')]+'%'};return _0x2808c1;})});}_0x420c3c=_[_0x8ba0('0x43')]({},_0x420c3c,_0x4bfcfd['options']);return db[_0x8ba0('0x5f')][_0x8ba0('0x22')]({'where':_0x420c3c[_0x8ba0('0x42')]})[_0x8ba0('0x12')](function(_0xa6afe1){_0x1d2136[_0x8ba0('0x22')]=_0xa6afe1;if(_0x4bfcfd['query'][_0x8ba0('0x4d')]){_0x420c3c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8ba0('0x47')](_0x420c3c);})['then'](function(_0x595cef){_0x1d2136[_0x8ba0('0x48')]=_0x595cef;return _0x1d2136;});}})[_0x8ba0('0x12')](respondWithFilteredResult(_0x3adcd4,_0x420c3c))['catch'](handleError(_0x3adcd4,null));};exports[_0x8ba0('0x60')]=function(_0x1f4d57,_0x32048b){return db[_0x8ba0('0x32')][_0x8ba0('0x53')]({'where':{'id':_0x1f4d57[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x32048b,null))['then'](function(_0x3ee342){if(_0x3ee342){return _0x3ee342['removeAnswers'](_0x1f4d57[_0x8ba0('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x32048b,null))[_0x8ba0('0x1c')](handleError(_0x32048b,null));};exports[_0x8ba0('0x5c')]=function(_0x2c5667,_0x27c0f5){var _0x1b54a9={'name':_0x2c5667['body'][_0x8ba0('0x2b')],'key':_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x35')],'provider':_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x61')]===_0x8ba0('0x62')?null:_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x61')],'email':_0x2c5667[_0x8ba0('0x4f')]['email'],'ListId':_0x2c5667[_0x8ba0('0x4f')]['ListId'],'active':!_['isNil'](_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x63')])?_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x63')]:!![],'description':_0x2c5667['body'][_0x8ba0('0x64')]||null,'Imap':{},'Smtp':{}};if(_0x1b54a9['provider']){_0x1b54a9[_0x8ba0('0x2e')]['user']=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x65')]=_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x66')];_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x67')]=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x68')]=_0x2c5667[_0x8ba0('0x4f')]['password'];if(_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x69')]){_0x1b54a9['Imap'][_0x8ba0('0x69')]=_0x1b54a9[_0x8ba0('0x4a')]['modernAuthentication']=!![];_0x1b54a9['Imap'][_0x8ba0('0x6a')]=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x6a')]=_0x2c5667['body'][_0x8ba0('0x6a')];_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x65')]=_0x1b54a9['Smtp'][_0x8ba0('0x65')]=_0x2c5667[_0x8ba0('0x4f')]['username'];}_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x6b')]=_0x1b54a9['Smtp'][_0x8ba0('0x6b')]=null;_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x6c')]=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x6c')]=null;_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x6d')]=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x6d')]=null;}else{if(_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x6e')]){_0x1b54a9['Imap'][_0x8ba0('0x65')]=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x65')]=_0x2c5667['body']['username'];_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x67')]=_0x1b54a9[_0x8ba0('0x4a')]['pass']=_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x67')];}else{_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x6e')]=_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x6e')]=![];}_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x6c')]=_0x2c5667[_0x8ba0('0x4f')]['Imap'][_0x8ba0('0x6c')];_0x1b54a9[_0x8ba0('0x2e')][_0x8ba0('0x6d')]=_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x2e')][_0x8ba0('0x6d')];_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x6c')]=_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x4a')][_0x8ba0('0x6c')];_0x1b54a9[_0x8ba0('0x4a')][_0x8ba0('0x6d')]=_0x2c5667[_0x8ba0('0x4f')][_0x8ba0('0x4a')]['port'];}return db[_0x8ba0('0x32')][_0x8ba0('0x5c')](_0x1b54a9,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x8ba0('0x49')],'as':'Imap'}]})[_0x8ba0('0x12')](function(_0x23e740){var _0x1f6f97=_0x2c5667['user'][_0x8ba0('0x26')]({'plain':!![]});if(!_0x1f6f97)throw new Error(_0x8ba0('0x6f'));if(_0x1f6f97[_0x8ba0('0x70')]===_0x8ba0('0x65')){var _0x6ce2cf=_0x23e740[_0x8ba0('0x26')]({'plain':!![]});return db[_0x8ba0('0x71')][_0x8ba0('0x53')]({'where':{'name':_0x8ba0('0x27'),'userProfileId':_0x1f6f97[_0x8ba0('0x72')]},'raw':!![]})[_0x8ba0('0x12')](function(_0x579e9f){if(_0x579e9f&&_0x579e9f[_0x8ba0('0x73')]===0x0){return db[_0x8ba0('0x28')]['create']({'name':_0x6ce2cf['name'],'resourceId':_0x6ce2cf['id'],'type':_0x579e9f[_0x8ba0('0x2b')],'sectionId':_0x579e9f['id']},{})['then'](function(){return _0x23e740;});}else{return _0x23e740;}})['catch'](function(_0x4196d9){logger[_0x8ba0('0x18')](_0x8ba0('0x74'),_0x4196d9);throw _0x4196d9;});}return _0x23e740;})['then'](respondWithResult(_0x27c0f5,0xc9))['catch'](handleError(_0x27c0f5,null));};exports['getImap']=function(_0xa2db53,_0x7187fd){return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0xa2db53['params']['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x7187fd,null))[_0x8ba0('0x12')](function(_0x27dc09){if(_0x27dc09){return _0x27dc09[_0x8ba0('0x75')]();}return null;})['then'](respondWithResult(_0x7187fd,null))['catch'](handleError(_0x7187fd,null));};exports[_0x8ba0('0x76')]=function(_0x3c9248,_0x28372c){if(_0x3c9248[_0x8ba0('0x4f')]['id']){delete _0x3c9248[_0x8ba0('0x4f')]['id'];}return db[_0x8ba0('0x32')][_0x8ba0('0x53')]({'where':{'id':_0x3c9248[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x28372c,null))['then'](function(_0x4fbed1){if(_0x4fbed1){_0x3c9248[_0x8ba0('0x4f')][_0x8ba0('0x54')]=_0x4fbed1['id'];return db[_0x8ba0('0x49')]['create'](_0x3c9248['body']);}})[_0x8ba0('0x12')](respondWithResult(_0x28372c,null))['catch'](handleError(_0x28372c,null));};exports['removeImap']=function(_0x21187e,_0x3a35a7){return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x21187e[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x3a35a7,null))[_0x8ba0('0x12')](function(_0x1d622c){if(_0x1d622c){return _0x1d622c['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x3a35a7,null))[_0x8ba0('0x1c')](handleError(_0x3a35a7,null));};exports[_0x8ba0('0x77')]=function(_0xcb6ecc,_0x4fe789){return db['MailAccount'][_0x8ba0('0x57')]({'where':{'id':_0xcb6ecc[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x4fe789,null))['then'](function(_0x514cd6){if(_0x514cd6){return _0x514cd6[_0x8ba0('0x77')]();}return null;})[_0x8ba0('0x12')](respondWithResult(_0x4fe789,null))['catch'](handleError(_0x4fe789,null));};exports['addSmtp']=function(_0x20245f,_0x3fe2fd){if(_0x20245f[_0x8ba0('0x4f')]['id']){delete _0x20245f['body']['id'];}return db[_0x8ba0('0x32')]['find']({'where':{'id':_0x20245f['params']['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x3fe2fd,null))[_0x8ba0('0x12')](function(_0x1525f5){if(_0x1525f5){_0x20245f[_0x8ba0('0x4f')][_0x8ba0('0x54')]=_0x1525f5['id'];return db['MailServerOut'][_0x8ba0('0x5c')](_0x20245f['body']);}})['then'](respondWithResult(_0x3fe2fd,null))[_0x8ba0('0x1c')](handleError(_0x3fe2fd,null));};exports[_0x8ba0('0x78')]=function(_0x39b282,_0x306c23){return db['MailAccount'][_0x8ba0('0x57')]({'where':{'id':_0x39b282[_0x8ba0('0x50')]['id']}})['then'](handleEntityNotFound(_0x306c23,null))[_0x8ba0('0x12')](function(_0x644c5e){if(_0x644c5e){return _0x644c5e[_0x8ba0('0x79')](null);}return null;})[_0x8ba0('0x12')](respondWithStatusCode(_0x306c23,null))['catch'](handleError(_0x306c23,null));};exports['addInteraction']=function(_0x56a17e,_0x49ddfa){return db[_0x8ba0('0x7a')]['find']({'where':{'id':_0x56a17e[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x49ddfa,null))[_0x8ba0('0x12')](function(_0x4a2142){if(_0x4a2142){return _0x4a2142[_0x8ba0('0x7b')](_0x56a17e[_0x8ba0('0x4f')][_0x8ba0('0x5a')],_[_0x8ba0('0x7c')](_0x56a17e['body'],[_0x8ba0('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x49ddfa,null))['catch'](handleError(_0x49ddfa,null));};exports[_0x8ba0('0x7d')]=function(_0x123840,_0x2f6a8c){var _0x407a34={'raw':![],'where':{}};var _0x59b655={};var _0x22392c={'count':0x0,'rows':[]};return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x123840['params']['id']}})['then'](handleEntityNotFound(_0x2f6a8c,null))[_0x8ba0('0x12')](function(_0x4a0c78){if(_0x4a0c78){_0x59b655[_0x8ba0('0x36')]=_['keys'](db[_0x8ba0('0x7a')]['rawAttributes']);_0x59b655[_0x8ba0('0x37')]=_[_0x8ba0('0x38')](_0x123840[_0x8ba0('0x37')]);_0x59b655[_0x8ba0('0x39')]=_[_0x8ba0('0x3a')](_0x59b655[_0x8ba0('0x36')],_0x59b655[_0x8ba0('0x37')]);_0x407a34[_0x8ba0('0x3b')]=_[_0x8ba0('0x3a')](_0x59b655['model'],qs[_0x8ba0('0x3c')](_0x123840[_0x8ba0('0x37')]['fields']));_0x407a34[_0x8ba0('0x3b')]=_0x407a34[_0x8ba0('0x3b')][_0x8ba0('0x3d')]?_0x407a34['attributes']:_0x59b655['model'];if(!_0x123840[_0x8ba0('0x37')][_0x8ba0('0x3e')](_0x8ba0('0x5e'))){_0x407a34[_0x8ba0('0x21')]=qs[_0x8ba0('0x21')](_0x123840['query'][_0x8ba0('0x21')]);_0x407a34[_0x8ba0('0x1f')]=qs['offset'](_0x123840[_0x8ba0('0x37')][_0x8ba0('0x1f')]);}_0x407a34[_0x8ba0('0x58')]=qs[_0x8ba0('0x3f')](_0x123840[_0x8ba0('0x37')][_0x8ba0('0x3f')]);_0x407a34[_0x8ba0('0x42')]=qs[_0x8ba0('0x39')](_[_0x8ba0('0x40')](_0x123840[_0x8ba0('0x37')],_0x59b655[_0x8ba0('0x39')]));_0x407a34[_0x8ba0('0x42')][_0x8ba0('0x54')]=_0x4a0c78['id'];if(_0x123840[_0x8ba0('0x37')][_0x8ba0('0x41')]){_0x407a34['where']=_[_0x8ba0('0x43')](_0x407a34[_0x8ba0('0x42')],{'$or':_[_0x8ba0('0x31')](_0x407a34[_0x8ba0('0x3b')],function(_0x5a1c48){var _0x121c18={};_0x121c18[_0x5a1c48]={'$like':'%'+_0x123840[_0x8ba0('0x37')][_0x8ba0('0x41')]+'%'};return _0x121c18;})});}_0x407a34=_[_0x8ba0('0x43')]({},_0x407a34,_0x123840[_0x8ba0('0x45')]);return db[_0x8ba0('0x7a')][_0x8ba0('0x22')]({'where':_0x407a34[_0x8ba0('0x42')]})[_0x8ba0('0x12')](function(_0x227856){_0x22392c['count']=_0x227856;if(_0x123840[_0x8ba0('0x37')][_0x8ba0('0x4d')]){_0x407a34[_0x8ba0('0x46')]=[{'model':db['CmContact'],'as':_0x8ba0('0x7e'),'required':![]},{'model':db[_0x8ba0('0x7f')],'as':'Owner','attributes':[_0x8ba0('0x2b'),_0x8ba0('0x80'),_0x8ba0('0x81')],'required':![]},{'model':db[_0x8ba0('0x82')],'as':'Tags','attributes':['id',_0x8ba0('0x2b'),'color'],'where':_0x123840[_0x8ba0('0x37')][_0x8ba0('0x83')]?{'id':_0x123840[_0x8ba0('0x37')]['tag']}:undefined,'required':_0x123840[_0x8ba0('0x37')][_0x8ba0('0x83')]?!![]:![]}];}return db[_0x8ba0('0x7a')][_0x8ba0('0x47')](_0x407a34);})['then'](function(_0x289f06){_0x22392c[_0x8ba0('0x48')]=_0x289f06;return _0x22392c;});}})[_0x8ba0('0x12')](respondWithFilteredResult(_0x2f6a8c,_0x407a34))[_0x8ba0('0x1c')](handleError(_0x2f6a8c,null));};exports[_0x8ba0('0x84')]=function addApplications(_0x48047b,_0x3f47fa){var _0x4b30ea=_0x48047b[_0x8ba0('0x50')]['id'];var _0x4e5edf=_0x48047b[_0x8ba0('0x4f')];var _0x356542=0xc8;var _0x118112=null;return db[_0x8ba0('0x85')]['transaction']({'isolationLevel':db[_0x8ba0('0x85')][_0x8ba0('0x86')][_0x8ba0('0x87')]['READ_COMMITTED']},function(_0x3e57e2){return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x4b30ea},'transaction':_0x3e57e2})[_0x8ba0('0x12')](function(_0x4250f6){if(_0x4250f6){return db['MailApplication'][_0x8ba0('0x25')]({'where':{'MailAccountId':_0x4b30ea},'transaction':_0x3e57e2})[_0x8ba0('0x12')](function(){var _0x468ba9=_['map'](_0x4e5edf,function(_0x52ddc1){_0x52ddc1[_0x8ba0('0x54')]=_0x4b30ea;return _0x52ddc1;});return db[_0x8ba0('0x88')][_0x8ba0('0x89')](_0x468ba9,{'transaction':_0x3e57e2});});}else{_0x356542=0x194;_0x118112=[];}});})[_0x8ba0('0x12')](function(){if(_0x356542!==0x194){return db[_0x8ba0('0x88')]['findAndCountAll']({'where':{'MailAccountId':_0x4b30ea},'order':_0x8ba0('0x8a')})[_0x8ba0('0x12')](function(_0x24e82a){_0x118112=_0x24e82a;});}})[_0x8ba0('0x1c')](function(_0x9d11b1){_0x356542=0x1f4;logger[_0x8ba0('0x18')](_0x9d11b1[_0x8ba0('0x2a')]);if(_0x9d11b1['name']){delete _0x9d11b1[_0x8ba0('0x2b')];}_0x118112=_0x9d11b1;})[_0x8ba0('0x8b')](function(){if(_0x118112===null){_0x3f47fa[_0x8ba0('0x29')](_0x356542);}else{if(_0x356542===0x1f4){_0x3f47fa[_0x8ba0('0x1d')](_0x356542)['send'](_0x118112);}else{_0x3f47fa[_0x8ba0('0x1d')](_0x356542)['json'](_0x118112);}}});};exports['getApplications']=function(_0x1aba14,_0x4b5eab){var _0x3ee2a6={};var _0x5e7b5a={};var _0x3994ac;var _0x532464;return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x1aba14[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x4b5eab,null))['then'](function(_0x5a5d64){if(_0x5a5d64){_0x3994ac=_0x5a5d64;_0x5e7b5a[_0x8ba0('0x36')]=_[_0x8ba0('0x38')](db[_0x8ba0('0x88')][_0x8ba0('0x4c')]);_0x5e7b5a[_0x8ba0('0x37')]=_[_0x8ba0('0x38')](_0x1aba14['query']);_0x5e7b5a[_0x8ba0('0x39')]=_[_0x8ba0('0x3a')](_0x5e7b5a[_0x8ba0('0x36')],_0x5e7b5a[_0x8ba0('0x37')]);_0x3ee2a6['attributes']=_[_0x8ba0('0x3a')](_0x5e7b5a['model'],qs['fields'](_0x1aba14[_0x8ba0('0x37')][_0x8ba0('0x3c')]));_0x3ee2a6[_0x8ba0('0x3b')]=_0x3ee2a6['attributes']['length']?_0x3ee2a6[_0x8ba0('0x3b')]:_0x5e7b5a[_0x8ba0('0x36')];_0x3ee2a6[_0x8ba0('0x58')]=qs['sort'](_0x1aba14[_0x8ba0('0x37')][_0x8ba0('0x3f')]);_0x3ee2a6['where']=qs['filters'](_['pick'](_0x1aba14[_0x8ba0('0x37')],_0x5e7b5a['filters']));if(_0x1aba14[_0x8ba0('0x37')][_0x8ba0('0x41')]){_0x3ee2a6['where']=_[_0x8ba0('0x43')](_0x3ee2a6['where'],{'$or':_['map'](_0x3ee2a6['attributes'],function(_0x4c0242){var _0x434eca={};_0x434eca[_0x4c0242]={'$like':'%'+_0x1aba14[_0x8ba0('0x37')][_0x8ba0('0x41')]+'%'};return _0x434eca;})});}_0x3ee2a6=_['merge']({},_0x3ee2a6,_0x1aba14[_0x8ba0('0x45')]);return _0x3994ac[_0x8ba0('0x8c')](_0x3ee2a6);}})[_0x8ba0('0x12')](function(_0x37761d){if(_0x37761d){_0x532464=_0x37761d['length'];if(!_0x1aba14['query'][_0x8ba0('0x3e')]('nolimit')){_0x3ee2a6[_0x8ba0('0x21')]=qs[_0x8ba0('0x21')](_0x1aba14['query']['limit']);_0x3ee2a6[_0x8ba0('0x1f')]=qs[_0x8ba0('0x1f')](_0x1aba14[_0x8ba0('0x37')]['offset']);}return _0x3994ac['getApplications'](_0x3ee2a6);}})['then'](function(_0x53ceee){if(_0x53ceee){return _0x53ceee?{'count':_0x532464,'rows':_0x53ceee}:null;}})[_0x8ba0('0x12')](respondWithResult(_0x4b5eab,null))['catch'](handleError(_0x4b5eab,null));};exports[_0x8ba0('0x8d')]=function(_0x235b7c,_0x59d141){var _0x295fd8={'raw':!![],'where':{}};var _0x5a0b16={};var _0x2f10d8={'count':0x0,'rows':[]};return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x235b7c[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x59d141,null))[_0x8ba0('0x12')](function(_0x4563b0){if(_0x4563b0){_0x5a0b16[_0x8ba0('0x36')]=_[_0x8ba0('0x38')](db['MailMessage'][_0x8ba0('0x4c')]);_0x5a0b16[_0x8ba0('0x37')]=_['keys'](_0x235b7c[_0x8ba0('0x37')]);_0x5a0b16['filters']=_['intersection'](_0x5a0b16[_0x8ba0('0x36')],_0x5a0b16[_0x8ba0('0x37')]);_0x295fd8['attributes']=_['intersection'](_0x5a0b16[_0x8ba0('0x36')],qs[_0x8ba0('0x3c')](_0x235b7c['query'][_0x8ba0('0x3c')]));_0x295fd8['attributes']=_0x295fd8[_0x8ba0('0x3b')][_0x8ba0('0x3d')]?_0x295fd8[_0x8ba0('0x3b')]:_0x5a0b16[_0x8ba0('0x36')];if(!_0x235b7c[_0x8ba0('0x37')][_0x8ba0('0x3e')](_0x8ba0('0x5e'))){_0x295fd8['limit']=qs[_0x8ba0('0x21')](_0x235b7c[_0x8ba0('0x37')]['limit']);_0x295fd8[_0x8ba0('0x1f')]=qs[_0x8ba0('0x1f')](_0x235b7c[_0x8ba0('0x37')][_0x8ba0('0x1f')]);}_0x295fd8[_0x8ba0('0x58')]=qs[_0x8ba0('0x3f')](_0x235b7c[_0x8ba0('0x37')][_0x8ba0('0x3f')]);_0x295fd8['where']=qs[_0x8ba0('0x39')](_[_0x8ba0('0x40')](_0x235b7c[_0x8ba0('0x37')],_0x5a0b16[_0x8ba0('0x39')]));_0x295fd8[_0x8ba0('0x42')]['MailAccountId']=_0x4563b0['id'];if(_0x235b7c['query'][_0x8ba0('0x41')]){_0x295fd8[_0x8ba0('0x42')]=_['merge'](_0x295fd8[_0x8ba0('0x42')],{'$or':_[_0x8ba0('0x31')](_0x295fd8[_0x8ba0('0x3b')],function(_0x202155){var _0x3f6e8d={};_0x3f6e8d[_0x202155]={'$like':'%'+_0x235b7c[_0x8ba0('0x37')][_0x8ba0('0x41')]+'%'};return _0x3f6e8d;})});}if(_0x235b7c[_0x8ba0('0x37')]['$gte']){var _0x9c6a62=_0x235b7c[_0x8ba0('0x37')][_0x8ba0('0x8e')][_0x8ba0('0x8f')](',');var _0x31c2d0={};_0x31c2d0[_0x9c6a62[0x0]]={'$gte':moment(_0x9c6a62[0x1])['format'](_0x8ba0('0x90'))};_0x295fd8[_0x8ba0('0x42')]=_[_0x8ba0('0x43')](_0x295fd8['where'],_0x31c2d0);}_0x295fd8=_[_0x8ba0('0x43')]({},_0x295fd8,_0x235b7c[_0x8ba0('0x45')]);return db[_0x8ba0('0x91')]['count']({'where':_0x295fd8[_0x8ba0('0x42')]})[_0x8ba0('0x12')](function(_0x203ee7){_0x2f10d8[_0x8ba0('0x22')]=_0x203ee7;if(_0x235b7c['query'][_0x8ba0('0x4d')]){_0x295fd8[_0x8ba0('0x46')]=[{'all':!![]}];}return db[_0x8ba0('0x91')][_0x8ba0('0x47')](_0x295fd8);})[_0x8ba0('0x12')](function(_0x80f7c4){if(_0x235b7c[_0x8ba0('0x37')]['inlineCss']===_0x8ba0('0x92')){for(var _0x5e7934=0x0;_0x5e7934<_0x80f7c4[_0x8ba0('0x3d')];_0x5e7934++){_0x80f7c4[_0x5e7934][_0x8ba0('0x4f')]=juice(_0x80f7c4[_0x5e7934]['body']);}}_0x2f10d8['rows']=_0x80f7c4;return _0x2f10d8;});}})[_0x8ba0('0x12')](respondWithFilteredResult(_0x59d141,_0x295fd8))['catch'](handleError(_0x59d141,null));};exports['send']=function(_0x348fcb,_0x4c0f94){var _0x111a7f,_0x105248={},_0x147e36;if(_0x348fcb[_0x8ba0('0x4f')]['to']){_0x147e36=_0x348fcb[_0x8ba0('0x4f')]['to'][_0x8ba0('0x8f')](',')[0x0];}return db[_0x8ba0('0x32')]['find']({'where':{'id':_0x348fcb[_0x8ba0('0x50')]['id']},'include':[{'model':db[_0x8ba0('0x93')],'as':_0x8ba0('0x94'),'include':[{'model':db['CmContact'],'as':_0x8ba0('0x95'),'where':{'email':_0x147e36},'limit':0x1,'order':[[_0x8ba0('0x96'),_0x8ba0('0x97')]]}]},{'model':db[_0x8ba0('0x2f')],'as':_0x8ba0('0x4a'),'raw':!![]}]})['then'](handleEntityNotFound(_0x4c0f94,null))[_0x8ba0('0x12')](function(_0x490385){if(_0x490385){_0x111a7f=_0x490385;if(_0x490385[_0x8ba0('0x4a')]){if(_[_0x8ba0('0x98')](_0x348fcb['body'][_0x8ba0('0x99')])){_0x348fcb[_0x8ba0('0x4f')][_0x8ba0('0x99')]=util[_0x8ba0('0x9a')]('%s\x20<%s>',_0x490385[_0x8ba0('0x2b')],_0x490385[_0x8ba0('0x9b')]||_0x490385[_0x8ba0('0x4a')]['user']);}if(_0x348fcb[_0x8ba0('0x4f')][_0x8ba0('0x9c')]&&_0x348fcb['body']['attachments'][_0x8ba0('0x3d')]){for(var _0x12eef6=0x0;_0x12eef6<_0x348fcb[_0x8ba0('0x4f')][_0x8ba0('0x9c')][_0x8ba0('0x3d')];_0x12eef6+=0x1){_0x348fcb[_0x8ba0('0x4f')]['attachments'][_0x12eef6]={'filename':_0x348fcb['body'][_0x8ba0('0x9c')][_0x12eef6][_0x8ba0('0x2b')],'path':path[_0x8ba0('0x9d')](config[_0x8ba0('0x9e')],'server/files/attachments',_0x348fcb[_0x8ba0('0x4f')][_0x8ba0('0x9c')][_0x12eef6]['basename'])};}}var _0x3612dd={'tls':{'rejectUnauthorized':![]}};if(_[_0x8ba0('0x98')](_0x490385[_0x8ba0('0x4a')][_0x8ba0('0x6b')])){if(_0x490385[_0x8ba0('0x4a')]['authentication']){_0x3612dd[_0x8ba0('0x9f')]={'user':_0x490385['Smtp'][_0x8ba0('0x65')],'pass':_0x490385[_0x8ba0('0x4a')]['pass']};}_0x3612dd[_0x8ba0('0x6c')]=_0x490385[_0x8ba0('0x4a')][_0x8ba0('0x6c')];_0x3612dd['port']=_0x490385[_0x8ba0('0x4a')]['port'];_0x3612dd[_0x8ba0('0xa0')]=_0x490385[_0x8ba0('0x4a')]['secure'];}else{_0x3612dd[_0x8ba0('0x6b')]=_0x490385['Smtp']['service'];_0x3612dd[_0x8ba0('0x9f')]={'user':_0x490385[_0x8ba0('0x4a')][_0x8ba0('0x65')],'pass':_0x490385[_0x8ba0('0x4a')][_0x8ba0('0x68')]};}return respondWithRpcPromise(_0x8ba0('0xa1'),_0x8ba0('0xa2'),{'account':_0x3612dd,'message':_0x348fcb[_0x8ba0('0x4f')]});}else{throw new Error(_0x8ba0('0xa3'));}}})['then'](function(_0x54e39c){if(_0x54e39c){_0x105248=_0x54e39c;if(_0x111a7f[_0x8ba0('0x94')]){if(_0x111a7f[_0x8ba0('0x94')][_0x8ba0('0x95')][_0x8ba0('0x3d')]){return _0x111a7f[_0x8ba0('0x94')][_0x8ba0('0x95')][0x0];}else{return db[_0x8ba0('0xa4')][_0x8ba0('0x5c')](_[_0x8ba0('0xd')](_0x348fcb['body'],{'firstName':_0x348fcb[_0x8ba0('0x4f')]['to'],'email':_0x348fcb[_0x8ba0('0x4f')]['to'],'phone':_0x348fcb[_0x8ba0('0x4f')]['to'],'ListId':_0x111a7f[_0x8ba0('0xa5')]}));}}else{throw new Error(_0x8ba0('0xa3'));}}})[_0x8ba0('0x12')](function(_0x3fa555){if(_0x3fa555){var _0x12a6e9={'UserId':_0x348fcb[_0x8ba0('0x65')]['id'],'ContactId':_0x3fa555['id'],'MailAccountId':_0x111a7f['id'],'inReplyTo':_0x105248[_0x8ba0('0xa6')],'to':_0x348fcb['body'][_0x8ba0('0x99')],'cc':_0x348fcb[_0x8ba0('0x4f')]['cc'],'subject':_0x348fcb[_0x8ba0('0x4f')][_0x8ba0('0xa7')],'attach':_0x348fcb['body'][_0x8ba0('0xa8')],'firstMsgDirection':_0x8ba0('0xa9'),'lastMsgAt':moment()['format'](_0x8ba0('0x90')),'lastMsgDirection':_0x8ba0('0xa9'),'Messages':[_['merge'](_0x348fcb[_0x8ba0('0x4f')],{'messageId':_0x105248[_0x8ba0('0xa6')],'sentAt':moment()[_0x8ba0('0x9a')](_0x8ba0('0x90')),'read':!![],'MailAccountId':_0x111a7f['id'],'UserId':_0x348fcb['user']['id'],'ContactId':_0x3fa555['id']})]};if(_0x348fcb['body'][_0x8ba0('0xaa')]){_0x12a6e9=_[_0x8ba0('0x43')](_0x12a6e9,_0x348fcb['body']['Interaction']);}return db['MailInteraction'][_0x8ba0('0x5c')](_0x12a6e9,{'include':[{'model':db[_0x8ba0('0x91')],'as':_0x8ba0('0xab')}]});}})[_0x8ba0('0x12')](respondWithResult(_0x4c0f94,null))[_0x8ba0('0x1c')](handleError(_0x4c0f94,null));};exports[_0x8ba0('0xac')]=function(_0x477a46,_0x2ec815){return db['MailAccount'][_0x8ba0('0x53')]({'where':{'id':_0x477a46['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0x8ba0('0x4a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8ba0('0xad'),'raw':!![]}]}]})[_0x8ba0('0x12')](handleEntityNotFound(_0x2ec815,null))['then'](function(_0x31d43d){if(_0x31d43d&&_0x31d43d[_0x8ba0('0x4a')]){var _0x186e22={'id':_0x31d43d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0x6b')]){_0x186e22[_0x8ba0('0x6b')]=_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0x6b')];}else{_0x186e22['host']=_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0x6c')];_0x186e22[_0x8ba0('0x6d')]=_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0x6d')];_0x186e22['secure']=_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0xa0')];}if(_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0x6e')]){if(_0x31d43d['Smtp'][_0x8ba0('0x69')]){_0x186e22[_0x8ba0('0x9f')]={'type':_0x8ba0('0xae'),'user':_0x31d43d[_0x8ba0('0x4a')]['user'],'accessToken':_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0xad')][_0x8ba0('0xaf')]};}else{_0x186e22[_0x8ba0('0x9f')]={'user':_0x31d43d[_0x8ba0('0x4a')][_0x8ba0('0x65')],'pass':_0x31d43d[_0x8ba0('0x4a')]['pass']};}}return respondWithRpcPromise('VerifySmtp',_0x8ba0('0xac'),{'account':_0x186e22});}})[_0x8ba0('0x12')](respondWithResult(_0x2ec815,null))[_0x8ba0('0x1c')](handleError(_0x2ec815,null));};exports[_0x8ba0('0x25')]=function(_0xe9911d,_0x3498ad){return db[_0x8ba0('0x32')][_0x8ba0('0x53')]({'where':{'id':_0xe9911d['params']['id']}})['then'](handleEntityNotFound(_0x3498ad,null))[_0x8ba0('0x12')](function(_0x2767ac){if(_0x2767ac&&_0x2767ac[_0x8ba0('0x6b')]){throw new db[(_0x8ba0('0xb0'))]['ValidationError'](_0x8ba0('0xb1'));}return _0x2767ac;})['then'](removeEntity(_0x3498ad,null))[_0x8ba0('0x1c')](handleError(_0x3498ad,null));};exports['addAgents']=function(_0x1e49e3,_0x2b05e9){return db[_0x8ba0('0x32')][_0x8ba0('0x53')]({'where':{'id':_0x1e49e3[_0x8ba0('0x50')]['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x2b05e9,null))['then'](function(_0x27974f){if(_0x27974f){return _0x27974f[_0x8ba0('0xb2')](_0x1e49e3[_0x8ba0('0x4f')][_0x8ba0('0x5a')],_[_0x8ba0('0x7c')](_0x1e49e3[_0x8ba0('0x4f')],[_0x8ba0('0x5a'),'id'])||{})[_0x8ba0('0xb3')](function(_0x3e7305){for(var _0x1d55d3=0x0;_0x1d55d3<_0x1e49e3[_0x8ba0('0x4f')][_0x8ba0('0x5a')][_0x8ba0('0x3d')];_0x1d55d3+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x1e49e3['body'][_0x8ba0('0x5a')][_0x1d55d3]),'MailAccountId':Number(_0x1e49e3[_0x8ba0('0x50')]['id'])});}return _0x3e7305;});}})[_0x8ba0('0x12')](respondWithResult(_0x2b05e9,null))[_0x8ba0('0x1c')](handleError(_0x2b05e9,null));};exports[_0x8ba0('0xb4')]=function(_0x5e6ec4,_0x256c31){return db['MailAccount'][_0x8ba0('0x53')]({'where':{'id':_0x5e6ec4['params']['id']}})[_0x8ba0('0x12')](handleEntityNotFound(_0x256c31,null))[_0x8ba0('0x12')](function(_0x1a2bf6){if(_0x1a2bf6){return _0x1a2bf6[_0x8ba0('0xb4')](_0x5e6ec4[_0x8ba0('0x37')]['ids'])['then'](function(){if(_[_0x8ba0('0xb5')](_0x5e6ec4[_0x8ba0('0x37')][_0x8ba0('0x5a')])){for(var _0xde08aa=0x0;_0xde08aa<_0x5e6ec4[_0x8ba0('0x37')][_0x8ba0('0x5a')]['length'];_0xde08aa+=0x1){socket[_0x8ba0('0xb6')](_0x8ba0('0xb7'),{'UserId':Number(_0x5e6ec4[_0x8ba0('0x37')][_0x8ba0('0x5a')][_0xde08aa]),'MailAccountId':Number(_0x5e6ec4[_0x8ba0('0x50')]['id'])});}}else{socket[_0x8ba0('0xb6')](_0x8ba0('0xb7'),{'UserId':Number(_0x5e6ec4[_0x8ba0('0x37')][_0x8ba0('0x5a')]),'MailAccountId':Number(_0x5e6ec4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x256c31,null))[_0x8ba0('0x1c')](handleError(_0x256c31,null));};exports['getAgents']=function(_0x10e853,_0x282bbd){var _0x16d71e={};var _0xca1082={};var _0x4ede78;var _0x24ffe6;return db[_0x8ba0('0x32')][_0x8ba0('0x57')]({'where':{'id':_0x10e853['params']['id']}})['then'](handleEntityNotFound(_0x282bbd,null))[_0x8ba0('0x12')](function(_0x28e721){if(_0x28e721){_0x4ede78=_0x28e721;_0xca1082[_0x8ba0('0x36')]=_[_0x8ba0('0x38')](db[_0x8ba0('0x7f')]['rawAttributes']);_0xca1082[_0x8ba0('0x37')]=_['keys'](_0x10e853[_0x8ba0('0x37')]);_0xca1082['filters']=_[_0x8ba0('0x3a')](_0xca1082['model'],_0xca1082[_0x8ba0('0x37')]);_0x16d71e[_0x8ba0('0x3b')]=_[_0x8ba0('0x3a')](_0xca1082['model'],qs[_0x8ba0('0x3c')](_0x10e853[_0x8ba0('0x37')][_0x8ba0('0x3c')]));_0x16d71e['attributes']=_0x16d71e[_0x8ba0('0x3b')][_0x8ba0('0x3d')]?_0x16d71e['attributes']:_0xca1082['model'];_0x16d71e[_0x8ba0('0x58')]=qs[_0x8ba0('0x3f')](_0x10e853[_0x8ba0('0x37')][_0x8ba0('0x3f')]);_0x16d71e[_0x8ba0('0x42')]=qs[_0x8ba0('0x39')](_['pick'](_0x10e853[_0x8ba0('0x37')],_0xca1082[_0x8ba0('0x39')]));if(_0x10e853[_0x8ba0('0x37')][_0x8ba0('0x41')]){_0x16d71e['where']=_['merge'](_0x16d71e[_0x8ba0('0x42')],{'$or':_['map'](_0x16d71e['attributes'],function(_0x3b7f01){var _0x5e33ac={};_0x5e33ac[_0x3b7f01]={'$like':'%'+_0x10e853[_0x8ba0('0x37')]['filter']+'%'};return _0x5e33ac;})});}_0x16d71e=_[_0x8ba0('0x43')]({},_0x16d71e,_0x10e853['options']);return _0x4ede78['getAgents'](_0x16d71e);}})['then'](function(_0x3cfad0){if(_0x3cfad0){_0x24ffe6=_0x3cfad0[_0x8ba0('0x3d')];if(!_0x10e853[_0x8ba0('0x37')][_0x8ba0('0x3e')](_0x8ba0('0x5e'))){_0x16d71e[_0x8ba0('0x21')]=qs['limit'](_0x10e853[_0x8ba0('0x37')][_0x8ba0('0x21')]);_0x16d71e[_0x8ba0('0x1f')]=qs[_0x8ba0('0x1f')](_0x10e853[_0x8ba0('0x37')]['offset']);}return _0x4ede78[_0x8ba0('0xb8')](_0x16d71e);}})[_0x8ba0('0x12')](function(_0x166bda){if(_0x166bda){return _0x166bda?{'count':_0x24ffe6,'rows':_0x166bda}:null;}})['then'](respondWithResult(_0x282bbd,null))[_0x8ba0('0x1c')](handleError(_0x282bbd,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index a1fcc82..af02295 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 _0x9120=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','remove','emit'];(function(_0xd24b43,_0x11caa4){var _0x2b1b44=function(_0x5b84af){while(--_0x5b84af){_0xd24b43['push'](_0xd24b43['shift']());}};_0x2b1b44(++_0x11caa4);}(_0x9120,0x1b3));var _0x0912=function(_0x5d03b2,_0x2e6094){_0x5d03b2=_0x5d03b2-0x0;var _0x1b463e=_0x9120[_0x5d03b2];return _0x1b463e;};'use strict';var EventEmitter=require(_0x0912('0x0'));var MailAccount=require(_0x0912('0x1'))['db'][_0x0912('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0912('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0912('0x4')};function emitEvent(_0x3f15a8){return function(_0x24fc0a,_0x217a2e,_0x3c1cdb){MailAccountEvents[_0x0912('0x5')](_0x3f15a8+':'+_0x24fc0a['id'],_0x24fc0a);MailAccountEvents['emit'](_0x3f15a8,_0x24fc0a);_0x3c1cdb(null);};}for(var e in events){if(events[_0x0912('0x6')](e)){var event=events[e];MailAccount[_0x0912('0x7')](e,emitEvent(event));}}module[_0x0912('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x8004=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x8004,0x176));var _0x4800=function(_0x2f6d14,_0x487eee){_0x2f6d14=_0x2f6d14-0x0;var _0x5b74f9=_0x8004[_0x2f6d14];return _0x5b74f9;};'use strict';var EventEmitter=require(_0x4800('0x0'));var MailAccount=require(_0x4800('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4800('0x2')](0x0);var events={'afterCreate':_0x4800('0x3'),'afterUpdate':_0x4800('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f2ad3){return function(_0x20ac3a,_0x2aceee,_0x53e9f8){MailAccountEvents[_0x4800('0x5')](_0x2f2ad3+':'+_0x20ac3a['id'],_0x20ac3a);MailAccountEvents[_0x4800('0x5')](_0x2f2ad3,_0x20ac3a);_0x53e9f8(null);};}for(var e in events){if(events[_0x4800('0x6')](e)){var event=events[e];MailAccount[_0x4800('0x7')](e,emitEvent(event));}}module[_0x4800('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 36649fc..a8b1d8c 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 _0x65e6=['request-promise','path','rimraf','../../config/environment','exports','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xfe2c60,_0x1866fd){var _0x1da88e=function(_0x50e59d){while(--_0x50e59d){_0xfe2c60['push'](_0xfe2c60['shift']());}};_0x1da88e(++_0x1866fd);}(_0x65e6,0x89));var _0x665e=function(_0x577fac,_0x3ab39f){_0x577fac=_0x577fac-0x0;var _0x4fea74=_0x65e6[_0x577fac];return _0x4fea74;};'use strict';var _=require(_0x665e('0x0'));var util=require(_0x665e('0x1'));var logger=require(_0x665e('0x2'))(_0x665e('0x3'));var moment=require(_0x665e('0x4'));var BPromise=require(_0x665e('0x5'));var rp=require(_0x665e('0x6'));var fs=require('fs');var path=require(_0x665e('0x7'));var rimraf=require(_0x665e('0x8'));var config=require(_0x665e('0x9'));var attributes=require('./mailAccount.attributes');module[_0x665e('0xa')]=function(_0x319b19,_0x4d1073){return _0x319b19['define'](_0x665e('0xb'),attributes,{'tableName':_0x665e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bb3=['mail_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bb3,0xe5));var _0x32bb=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x2bb3[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require(_0x32bb('0x0'));var logger=require(_0x32bb('0x1'))(_0x32bb('0x2'));var moment=require(_0x32bb('0x3'));var BPromise=require(_0x32bb('0x4'));var rp=require(_0x32bb('0x5'));var fs=require('fs');var path=require(_0x32bb('0x6'));var rimraf=require(_0x32bb('0x7'));var config=require(_0x32bb('0x8'));var attributes=require(_0x32bb('0x9'));module[_0x32bb('0xa')]=function(_0x30e04d,_0x4593cc){return _0x30e04d['define']('MailAccount',attributes,{'tableName':_0x32bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 9d46e63..5a7d501 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 _0x107c=['request\x20sent','stringify','error','message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','model','attributes','map','catch','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','get','omit','applications','list','orderBy','priority','asc','account','autoclose','length','close','create','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','update','interaction','contact','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug'];(function(_0x330a57,_0x5f27ba){var _0x59bca2=function(_0x2a1785){while(--_0x2a1785){_0x330a57['push'](_0x330a57['shift']());}};_0x59bca2(++_0x5f27ba);}(_0x107c,0x118));var _0xc107=function(_0x4d572e,_0x59ceb7){_0x4d572e=_0x4d572e-0x0;var _0x43a969=_0x107c[_0x4d572e];return _0x43a969;};'use strict';var _=require(_0xc107('0x0'));var util=require('util');var moment=require(_0xc107('0x1'));var BPromise=require(_0xc107('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc107('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc107('0x4'));var logger=require('../../config/logger')(_0xc107('0x5'));var config=require(_0xc107('0x6'));var jayson=require(_0xc107('0x7'));var client=jayson[_0xc107('0x8')][_0xc107('0x9')]({'port':0x232c});config['redis']=_[_0xc107('0xa')](config['redis'],{'host':_0xc107('0xb'),'port':0x18eb});var socket=require(_0xc107('0xc'))(new Redis(config['redis']));require(_0xc107('0xd'))['register'](socket);function respondWithRpcPromise(_0x51e77a,_0x41d1c3,_0x233fb3){return new BPromise(function(_0x502b29,_0x145a97){return client['request'](_0x51e77a,_0x233fb3)[_0xc107('0xe')](function(_0x1032ac){logger['info'](_0xc107('0xf'),_0x41d1c3,'request\x20sent');logger[_0xc107('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x41d1c3,_0xc107('0x11'),JSON[_0xc107('0x12')](_0x1032ac));if(_0x1032ac[_0xc107('0x13')]){if(_0x1032ac[_0xc107('0x13')]['code']===0x1f4){logger[_0xc107('0x13')](_0xc107('0xf'),_0x41d1c3,_0x1032ac['error'][_0xc107('0x14')]);return _0x145a97(_0x1032ac[_0xc107('0x13')][_0xc107('0x14')]);}logger[_0xc107('0x13')]('MailAccount,\x20%s,\x20%s',_0x41d1c3,_0x1032ac['error'][_0xc107('0x14')]);return _0x502b29(_0x1032ac['error']['message']);}else{logger[_0xc107('0x15')](_0xc107('0xf'),_0x41d1c3,_0xc107('0x11'));_0x502b29(_0x1032ac[_0xc107('0x16')][_0xc107('0x14')]);}})['catch'](function(_0x56406b){logger[_0xc107('0x13')](_0xc107('0xf'),_0x41d1c3,_0x56406b);_0x145a97(_0x56406b);});});}exports[_0xc107('0x17')]=function(_0x55b5cb){var _0x4dc738=this;return new Promise(function(_0x401f62,_0x12fc65){return db[_0xc107('0x18')][_0xc107('0x19')]({'raw':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1b')]===undefined?!![]:![]:!![],'where':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1c')]||null:null,'attributes':_0x55b5cb['options']?_0x55b5cb[_0xc107('0x1a')]['attributes']||null:null,'limit':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1d')]||null:null,'include':_0x55b5cb[_0xc107('0x1a')]?_0x55b5cb[_0xc107('0x1a')]['include']?_['map'](_0x55b5cb[_0xc107('0x1a')][_0xc107('0x1e')],function(_0x248d72){return{'model':db[_0x248d72[_0xc107('0x1f')]],'as':_0x248d72['as'],'attributes':_0x248d72[_0xc107('0x20')],'include':_0x248d72['include']?_[_0xc107('0x21')](_0x248d72[_0xc107('0x1e')],function(_0x49d638){return{'model':db[_0x49d638['model']],'as':_0x49d638['as'],'attributes':_0x49d638['attributes'],'include':_0x49d638[_0xc107('0x1e')]?_[_0xc107('0x21')](_0x49d638[_0xc107('0x1e')],function(_0x450b28){return{'model':db[_0x450b28[_0xc107('0x1f')]],'as':_0x450b28['as'],'attributes':_0x450b28[_0xc107('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc107('0xe')](function(_0x6ceb5c){logger[_0xc107('0x15')](_0xc107('0x17'),_0x55b5cb);logger[_0xc107('0x10')]('GetMailAccount',_0x55b5cb,JSON[_0xc107('0x12')](_0x6ceb5c));_0x401f62(_0x6ceb5c);})[_0xc107('0x22')](function(_0x1e85b6){logger['error'](_0xc107('0x17'),_0x1e85b6[_0xc107('0x14')],_0x55b5cb);_0x12fc65(_0x4dc738[_0xc107('0x13')](0x1f4,_0x1e85b6[_0xc107('0x14')]));});});};exports[_0xc107('0x23')]=function(_0x3a806f){var _0x2ce5f0=this;return new Promise(function(_0x2394a1,_0x597e80){return db[_0xc107('0x18')][_0xc107('0x24')]({'raw':_0x3a806f['options']?_0x3a806f[_0xc107('0x1a')][_0xc107('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a806f[_0xc107('0x1a')]?_0x3a806f[_0xc107('0x1a')][_0xc107('0x1c')]||null:null,'attributes':_0x3a806f[_0xc107('0x1a')]?_0x3a806f[_0xc107('0x1a')][_0xc107('0x20')]||null:null,'include':_0x3a806f[_0xc107('0x1a')]?_0x3a806f[_0xc107('0x1a')][_0xc107('0x1e')]?_[_0xc107('0x21')](_0x3a806f['options'][_0xc107('0x1e')],function(_0x365b20){return{'model':db[_0x365b20[_0xc107('0x1f')]],'as':_0x365b20['as'],'attributes':_0x365b20[_0xc107('0x20')],'include':_0x365b20[_0xc107('0x1e')]?_[_0xc107('0x21')](_0x365b20[_0xc107('0x1e')],function(_0xc4a0dc){return{'model':db[_0xc4a0dc[_0xc107('0x1f')]],'as':_0xc4a0dc['as'],'attributes':_0xc4a0dc[_0xc107('0x20')],'include':_0xc4a0dc[_0xc107('0x1e')]?_[_0xc107('0x21')](_0xc4a0dc['include'],function(_0x451d80){return{'model':db[_0x451d80[_0xc107('0x1f')]],'as':_0x451d80['as'],'attributes':_0x451d80['attributes']};}):[]};}):[]};}):[]:[]})[_0xc107('0xe')](function(_0x42aeb3){logger[_0xc107('0x15')](_0xc107('0x23'),_0x3a806f);logger[_0xc107('0x10')]('ShowMailAccount',_0x3a806f,JSON['stringify'](_0x42aeb3));_0x2394a1(_0x42aeb3);})[_0xc107('0x22')](function(_0x4a0ac8){logger[_0xc107('0x13')](_0xc107('0x23'),_0x4a0ac8[_0xc107('0x14')],_0x3a806f);_0x597e80(_0x2ce5f0[_0xc107('0x13')](0x1f4,_0x4a0ac8['message']));});});};exports[_0xc107('0x25')]=function(_0x3fe5b2){var _0x4eba8f=this;return new Promise(function(_0x3bb683,_0x11f4e5){var _0x3ef368={'body':_0x3fe5b2[_0xc107('0x26')],'channel':_0xc107('0x27')};var _0x1d6624=_[_0xc107('0x28')](_[_0xc107('0x29')](db[_0xc107('0x2a')][_0xc107('0x2b')]),[_0xc107('0x2c'),_0xc107('0x2d'),_0xc107('0x2e'),_0xc107('0x2f')]);var _0x223836=![];if(_0x3fe5b2[_0xc107('0x26')]['id']){delete _0x3fe5b2[_0xc107('0x26')]['id'];}if(_['isNil'](_0x3fe5b2[_0xc107('0x26')]['from'])){return _0x11f4e5(_0x4eba8f['error'](0x1f4,_0xc107('0x30')));}if(_[_0xc107('0x31')](_0x3fe5b2[_0xc107('0x26')][_0xc107('0x26')])||_0x3fe5b2[_0xc107('0x26')][_0xc107('0x26')]===''){return _0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0xc107('0x32')));}if(_[_0xc107('0x31')](_0x3fe5b2[_0xc107('0x26')][_0xc107('0x33')])){return _0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0xc107('0x34')+_0x1d6624));}if(!_[_0xc107('0x35')](_0x1d6624,_0x3fe5b2[_0xc107('0x26')]['mapKey'])){return _0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0xc107('0x36')+_0x1d6624));}var _0x2135a2={};_0x2135a2[_0x3fe5b2[_0xc107('0x26')][_0xc107('0x33')]]=_0x3fe5b2[_0xc107('0x26')][_0xc107('0x37')];return db[_0xc107('0x18')][_0xc107('0x24')]({'where':{'id':_0x3fe5b2['account']['id']},'include':[{'model':db[_0xc107('0x38')],'as':_0xc107('0x39'),'include':[{'model':db['CmContact'],'as':_0xc107('0x3a'),'where':_0x2135a2,'limit':0x1,'order':[['updatedAt',_0xc107('0x3b')]]}]},{'model':db['MailApplication'],'as':_0xc107('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xc107('0xe')](function(_0x509818){if(_0x509818&&_0x509818['List']){var _0xbb9064=_0x509818[_0xc107('0x3d')]({'plain':!![]});_0x3ef368['account']=_[_0xc107('0x3e')](_0xbb9064,[_0xc107('0x3c'),'List']);_0x3ef368[_0xc107('0x3f')]=_0xbb9064['Applications'];_0x3ef368[_0xc107('0x40')]=_0xbb9064[_0xc107('0x39')];_0x3ef368[_0xc107('0x3f')]=_[_0xc107('0x41')](_0x3ef368['applications'],[_0xc107('0x42')],[_0xc107('0x43')]);if(_0x3ef368[_0xc107('0x44')]&&_0x3ef368[_0xc107('0x44')][_0xc107('0x45')]){_0x3ef368[_0xc107('0x3f')]['push']({'id':0x0,'priority':_0x3ef368[_0xc107('0x3f')][_0xc107('0x46')]+0x1,'app':_0xc107('0x47'),'appdata':_0xc107('0x45'),'interval':'*,*,*,*'});}if(_0x3ef368[_0xc107('0x44')][_0xc107('0x3c')]){delete _0x3ef368[_0xc107('0x44')]['Applications'];}if(_0x3ef368[_0xc107('0x44')][_0xc107('0x39')]){delete _0x3ef368['account'][_0xc107('0x39')];}if(_0xbb9064[_0xc107('0x39')]['Contacts'][_0xc107('0x46')]){return _0xbb9064[_0xc107('0x39')]['Contacts'][0x0];}var _0x1c777c=_[_0xc107('0xa')](_0x3fe5b2[_0xc107('0x26')],{'firstName':_0x3fe5b2[_0xc107('0x26')]['from'],'ListId':_0xbb9064[_0xc107('0x2f')]});_0x1c777c[_0x3fe5b2[_0xc107('0x26')][_0xc107('0x33')]]=_0x3fe5b2[_0xc107('0x26')][_0xc107('0x37')];return db[_0xc107('0x2a')][_0xc107('0x48')](_0x1c777c);}else{throw new Error('List\x20not\x20found');}})[_0xc107('0xe')](function(_0x3d866e){_0x3ef368['contact']=_0x3d866e;if(_0x3d866e){if(!_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x49')]){_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x49')]=rs[_0xc107('0x4a')]()+'\x20'+_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['from'];}var _0x4b59f3={'ContactId':_0x3d866e['id'],'MailAccountId':_0x3fe5b2[_0xc107('0x44')]['id'],'inReplyTo':_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x49')],'to':_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x37')],'cc':_0x3fe5b2[_0xc107('0x26')]['message']['cc'],'subject':_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x4b')],'attach':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x4c')],'lastMsgAt':moment()[_0xc107('0x4d')](_0xc107('0x4e')),'lastMsgDirection':'in'};return db[_0xc107('0x4f')][_0xc107('0x24')]({'where':{'closed':![],'MailAccountId':_0x3fe5b2['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xc107('0x50'),'attributes':[_0xc107('0x49')],'where':{'messageId':_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x51')]}}]})[_0xc107('0xe')](function(_0x4c165e){if(_0x4c165e){return[_0x4c165e,![]];}return db['MailInteraction']['create'](_0x4b59f3)[_0xc107('0xe')](function(_0x22351a){return[_0x22351a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x4ea722,_0x156545){if(_0x4ea722){_0x223836=_0x156545;if(!_0x156545){return _0x4ea722[_0xc107('0x52')]({'inReplyTo':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x49')],'to':_0x3fe5b2['body'][_0xc107('0x14')]['from'],'cc':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['cc'],'subject':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x4b')],'attach':_0x4ea722[_0xc107('0x4c')]?_0x4ea722['attach']:_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x4c')],'substatus':null,'substatusAt':moment()[_0xc107('0x4d')](_0xc107('0x4e')),'lastMsgAt':moment()[_0xc107('0x4d')](_0xc107('0x4e')),'lastMsgDirection':'in'});}else{return _0x4ea722;}}})['then'](function(_0x206b3f){_0x3ef368[_0xc107('0x53')]=_0x206b3f[_0xc107('0x3d')]({'plain':!![]});_0x3ef368['interaction']['created']=_0x223836;return db['MailMessage'][_0xc107('0x48')]({'body':_0x3fe5b2[_0xc107('0x26')]['body'],'MailAccountId':_0x3fe5b2[_0xc107('0x44')]['id'],'MailInteractionId':_0x206b3f['id'],'direction':'in','ContactId':_0x3ef368[_0xc107('0x54')]['id'],'messageId':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x49')],'from':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x37')],'to':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['to'],'cc':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['cc'],'subject':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x4b')],'attach':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['attach'],'Attachments':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['attachments'],'originTo':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x55')],'originCc':_0x3fe5b2['body'][_0xc107('0x14')][_0xc107('0x56')],'bcc':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')]['bcc'],'ChatWebsiteId':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x57')]||null,'originChannel':_0x3fe5b2[_0xc107('0x26')]['message'][_0xc107('0x58')]||_0xc107('0x59'),'ChatOfflineMessageId':_0x3fe5b2[_0xc107('0x26')][_0xc107('0x14')][_0xc107('0x5a')]||null},{'include':[{'model':db['Attachment'],'as':_0xc107('0x5b')}]});})[_0xc107('0xe')](function(_0xc02681){_0x3ef368['message']=_0xc02681;if(_0x3ef368[_0xc107('0x53')]['UserId']){return db['User']['find']({'attributes':['id',_0xc107('0x5c')],'where':{'id':_0x3ef368[_0xc107('0x53')]['UserId']}})[_0xc107('0xe')](function(_0x26810f){if(_0x26810f){_0x3ef368[_0xc107('0x3f')][_0xc107('0x5d')]({'id':0x0,'priority':0x0,'app':_0xc107('0x5e'),'appdata':_0x26810f[_0xc107('0x5c')]+','+(_0x3ef368['account'][_0xc107('0x5f')]||0xa),'interval':_0xc107('0x60')});}return respondWithRpcPromise(_0xc107('0x61'),_0xc107('0x62'),_0x3ef368);});}return respondWithRpcPromise('Start',_0xc107('0x62'),_0x3ef368);})[_0xc107('0xe')](function(_0x4c8c42){_0x3bb683(_0x4c8c42);})[_0xc107('0x22')](function(_0x41b560){_0x11f4e5(_0x4eba8f[_0xc107('0x13')](0x1f4,_0x41b560[_0xc107('0x14')]));});});}; \ No newline at end of file +var _0xb265=['code','message','result','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','include','map','model','find','raw','debug','ShowMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','Applications','MailServerOut','List','get','account','list','applications','orderBy','asc','autoclose','push','close','*,*,*,*','length','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','originTo','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost','register','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x37d76d,_0x14ab7e){var _0x486c89=function(_0xb25ab6){while(--_0xb25ab6){_0x37d76d['push'](_0x37d76d['shift']());}};_0x486c89(++_0x14ab7e);}(_0xb265,0x10d));var _0x5b26=function(_0x1117f2,_0xfd69){_0x1117f2=_0x1117f2-0x0;var _0x2db0cf=_0xb265[_0x1117f2];return _0x2db0cf;};'use strict';var _=require(_0x5b26('0x0'));var util=require(_0x5b26('0x1'));var moment=require('moment');var BPromise=require(_0x5b26('0x2'));var rs=require(_0x5b26('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b26('0x4'))['db'];var utils=require(_0x5b26('0x5'));var logger=require(_0x5b26('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b26('0x7'));var client=jayson[_0x5b26('0x8')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0x5b26('0x9')],{'host':_0x5b26('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b26('0x9')]));require('./mailAccount.socket')[_0x5b26('0xb')](socket);function respondWithRpcPromise(_0x2b1675,_0x1c89e5,_0x3103c5){return new BPromise(function(_0xf17033,_0x2b1b27){return client['request'](_0x2b1675,_0x3103c5)[_0x5b26('0xc')](function(_0x11dd2a){logger[_0x5b26('0xd')](_0x5b26('0xe'),_0x1c89e5,'request\x20sent');logger['debug'](_0x5b26('0xf'),_0x1c89e5,_0x5b26('0x10'),JSON[_0x5b26('0x11')](_0x11dd2a));if(_0x11dd2a[_0x5b26('0x12')]){if(_0x11dd2a[_0x5b26('0x12')][_0x5b26('0x13')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1c89e5,_0x11dd2a['error'][_0x5b26('0x14')]);return _0x2b1b27(_0x11dd2a['error'][_0x5b26('0x14')]);}logger[_0x5b26('0x12')](_0x5b26('0xe'),_0x1c89e5,_0x11dd2a[_0x5b26('0x12')][_0x5b26('0x14')]);return _0xf17033(_0x11dd2a[_0x5b26('0x12')][_0x5b26('0x14')]);}else{logger[_0x5b26('0xd')]('MailAccount,\x20%s,\x20%s',_0x1c89e5,'request\x20sent');_0xf17033(_0x11dd2a[_0x5b26('0x15')]['message']);}})[_0x5b26('0x16')](function(_0x550aaf){logger[_0x5b26('0x12')](_0x5b26('0xe'),_0x1c89e5,_0x550aaf);_0x2b1b27(_0x550aaf);});});}exports[_0x5b26('0x17')]=function(_0x3b06ae){var _0x9b5b44=this;return new Promise(function(_0x1baea5,_0x1e5eb9){return db[_0x5b26('0x18')][_0x5b26('0x19')]({'raw':_0x3b06ae['options']?_0x3b06ae['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b06ae[_0x5b26('0x1a')]?_0x3b06ae['options'][_0x5b26('0x1b')]||null:null,'attributes':_0x3b06ae['options']?_0x3b06ae['options'][_0x5b26('0x1c')]||null:null,'limit':_0x3b06ae[_0x5b26('0x1a')]?_0x3b06ae[_0x5b26('0x1a')]['limit']||null:null,'include':_0x3b06ae[_0x5b26('0x1a')]?_0x3b06ae[_0x5b26('0x1a')][_0x5b26('0x1d')]?_[_0x5b26('0x1e')](_0x3b06ae[_0x5b26('0x1a')][_0x5b26('0x1d')],function(_0x1825c5){return{'model':db[_0x1825c5[_0x5b26('0x1f')]],'as':_0x1825c5['as'],'attributes':_0x1825c5[_0x5b26('0x1c')],'include':_0x1825c5[_0x5b26('0x1d')]?_[_0x5b26('0x1e')](_0x1825c5['include'],function(_0x13d9e1){return{'model':db[_0x13d9e1['model']],'as':_0x13d9e1['as'],'attributes':_0x13d9e1[_0x5b26('0x1c')],'include':_0x13d9e1[_0x5b26('0x1d')]?_[_0x5b26('0x1e')](_0x13d9e1[_0x5b26('0x1d')],function(_0x2711a1){return{'model':db[_0x2711a1['model']],'as':_0x2711a1['as'],'attributes':_0x2711a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b26('0xc')](function(_0x7d1a56){logger[_0x5b26('0xd')](_0x5b26('0x17'),_0x3b06ae);logger['debug'](_0x5b26('0x17'),_0x3b06ae,JSON[_0x5b26('0x11')](_0x7d1a56));_0x1baea5(_0x7d1a56);})[_0x5b26('0x16')](function(_0x26608b){logger[_0x5b26('0x12')](_0x5b26('0x17'),_0x26608b[_0x5b26('0x14')],_0x3b06ae);_0x1e5eb9(_0x9b5b44[_0x5b26('0x12')](0x1f4,_0x26608b[_0x5b26('0x14')]));});});};exports['ShowMailAccount']=function(_0x467970){var _0x539af7=this;return new Promise(function(_0x5b4b8c,_0xb66174){return db['MailAccount'][_0x5b26('0x20')]({'raw':_0x467970[_0x5b26('0x1a')]?_0x467970[_0x5b26('0x1a')][_0x5b26('0x21')]===undefined?!![]:![]:!![],'where':_0x467970[_0x5b26('0x1a')]?_0x467970[_0x5b26('0x1a')]['where']||null:null,'attributes':_0x467970[_0x5b26('0x1a')]?_0x467970['options'][_0x5b26('0x1c')]||null:null,'include':_0x467970[_0x5b26('0x1a')]?_0x467970[_0x5b26('0x1a')]['include']?_[_0x5b26('0x1e')](_0x467970['options']['include'],function(_0x2614c2){return{'model':db[_0x2614c2[_0x5b26('0x1f')]],'as':_0x2614c2['as'],'attributes':_0x2614c2[_0x5b26('0x1c')],'include':_0x2614c2['include']?_['map'](_0x2614c2[_0x5b26('0x1d')],function(_0x2ef642){return{'model':db[_0x2ef642[_0x5b26('0x1f')]],'as':_0x2ef642['as'],'attributes':_0x2ef642['attributes'],'include':_0x2ef642[_0x5b26('0x1d')]?_[_0x5b26('0x1e')](_0x2ef642['include'],function(_0x2874e0){return{'model':db[_0x2874e0[_0x5b26('0x1f')]],'as':_0x2874e0['as'],'attributes':_0x2874e0[_0x5b26('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5b26('0xc')](function(_0x5ea3d6){logger[_0x5b26('0xd')]('ShowMailAccount',_0x467970);logger[_0x5b26('0x22')](_0x5b26('0x23'),_0x467970,JSON['stringify'](_0x5ea3d6));_0x5b4b8c(_0x5ea3d6);})[_0x5b26('0x16')](function(_0x5c3b09){logger[_0x5b26('0x12')](_0x5b26('0x23'),_0x5c3b09[_0x5b26('0x14')],_0x467970);_0xb66174(_0x539af7['error'](0x1f4,_0x5c3b09[_0x5b26('0x14')]));});});};exports['NotifyMailAccount']=function(_0x139356){var _0x3383ea=this;return new Promise(function(_0x3f435f,_0x5c7bde){var _0x4b3e38={'body':_0x139356[_0x5b26('0x24')],'channel':_0x5b26('0x25')};var _0x5a8f74=_[_0x5b26('0x26')](_[_0x5b26('0x27')](db[_0x5b26('0x28')][_0x5b26('0x29')]),[_0x5b26('0x2a'),_0x5b26('0x2b'),_0x5b26('0x2c'),_0x5b26('0x2d')]);var _0x14a2cf=![];if(_0x139356[_0x5b26('0x24')]['id']){delete _0x139356[_0x5b26('0x24')]['id'];}if(_[_0x5b26('0x2e')](_0x139356[_0x5b26('0x24')]['from'])){return _0x5c7bde(_0x3383ea[_0x5b26('0x12')](0x1f4,_0x5b26('0x2f')));}if(_['isNil'](_0x139356[_0x5b26('0x24')][_0x5b26('0x24')])||_0x139356[_0x5b26('0x24')][_0x5b26('0x24')]===''){return _0x5c7bde(_0x3383ea[_0x5b26('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5b26('0x2e')](_0x139356[_0x5b26('0x24')]['mapKey'])){return _0x5c7bde(_0x3383ea['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a8f74));}if(!_[_0x5b26('0x30')](_0x5a8f74,_0x139356[_0x5b26('0x24')][_0x5b26('0x31')])){return _0x5c7bde(_0x3383ea[_0x5b26('0x12')](0x1f4,_0x5b26('0x32')+_0x5a8f74));}var _0x599b54={};_0x599b54[_0x139356[_0x5b26('0x24')]['mapKey']]=_0x139356[_0x5b26('0x24')][_0x5b26('0x33')];return db[_0x5b26('0x18')][_0x5b26('0x20')]({'where':{'id':_0x139356['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x5b26('0x34'),'where':_0x599b54,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailApplication'],'as':_0x5b26('0x35')},{'model':db[_0x5b26('0x36')],'as':'Smtp'}]})[_0x5b26('0xc')](function(_0x466a4b){if(_0x466a4b&&_0x466a4b[_0x5b26('0x37')]){var _0x544ed0=_0x466a4b[_0x5b26('0x38')]({'plain':!![]});_0x4b3e38[_0x5b26('0x39')]=_['omit'](_0x544ed0,[_0x5b26('0x35'),_0x5b26('0x37')]);_0x4b3e38['applications']=_0x544ed0[_0x5b26('0x35')];_0x4b3e38[_0x5b26('0x3a')]=_0x544ed0[_0x5b26('0x37')];_0x4b3e38[_0x5b26('0x3b')]=_[_0x5b26('0x3c')](_0x4b3e38[_0x5b26('0x3b')],['priority'],[_0x5b26('0x3d')]);if(_0x4b3e38[_0x5b26('0x39')]&&_0x4b3e38[_0x5b26('0x39')][_0x5b26('0x3e')]){_0x4b3e38[_0x5b26('0x3b')][_0x5b26('0x3f')]({'id':0x0,'priority':_0x4b3e38[_0x5b26('0x3b')]['length']+0x1,'app':_0x5b26('0x40'),'appdata':'autoclose','interval':_0x5b26('0x41')});}if(_0x4b3e38[_0x5b26('0x39')][_0x5b26('0x35')]){delete _0x4b3e38[_0x5b26('0x39')][_0x5b26('0x35')];}if(_0x4b3e38['account'][_0x5b26('0x37')]){delete _0x4b3e38['account'][_0x5b26('0x37')];}if(_0x544ed0['List']['Contacts'][_0x5b26('0x42')]){return _0x544ed0[_0x5b26('0x37')][_0x5b26('0x34')][0x0];}var _0x202707=_['defaults'](_0x139356['body'],{'firstName':_0x139356[_0x5b26('0x24')][_0x5b26('0x33')],'ListId':_0x544ed0[_0x5b26('0x2d')]});_0x202707[_0x139356[_0x5b26('0x24')][_0x5b26('0x31')]]=_0x139356[_0x5b26('0x24')][_0x5b26('0x33')];return db['CmContact'][_0x5b26('0x43')](_0x202707);}else{throw new Error(_0x5b26('0x44'));}})['then'](function(_0x57d1e8){_0x4b3e38['contact']=_0x57d1e8;if(_0x57d1e8){if(!_0x139356['body'][_0x5b26('0x14')]['messageId']){_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x45')]=rs[_0x5b26('0x46')]()+'\x20'+_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x33')];}var _0x398d98={'ContactId':_0x57d1e8['id'],'MailAccountId':_0x139356[_0x5b26('0x39')]['id'],'inReplyTo':_0x139356['body'][_0x5b26('0x14')]['messageId'],'to':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x33')],'cc':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')]['cc'],'subject':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x47')],'attach':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x48')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x5b26('0x49')]['find']({'where':{'closed':![],'MailAccountId':_0x139356[_0x5b26('0x39')]['id']},'include':[{'model':db[_0x5b26('0x4a')],'as':_0x5b26('0x4b'),'attributes':[_0x5b26('0x45')],'where':{'messageId':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')]['inReplyTo']}}]})['then'](function(_0x141ec1){if(_0x141ec1){return[_0x141ec1,![]];}return db[_0x5b26('0x49')][_0x5b26('0x43')](_0x398d98)[_0x5b26('0xc')](function(_0x21dc99){return[_0x21dc99,!![]];});});}else{throw new Error(_0x5b26('0x4c'));}})['spread'](function(_0x3e89fa,_0xb89276){if(_0x3e89fa){_0x14a2cf=_0xb89276;if(!_0xb89276){return _0x3e89fa['update']({'inReplyTo':_0x139356['body']['message'][_0x5b26('0x45')],'to':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x33')],'cc':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')]['cc'],'subject':_0x139356[_0x5b26('0x24')]['message'][_0x5b26('0x47')],'attach':_0x3e89fa[_0x5b26('0x48')]?_0x3e89fa['attach']:_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x48')],'substatus':null,'substatusAt':moment()[_0x5b26('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x5b26('0x4d')](_0x5b26('0x4e')),'lastMsgDirection':'in'});}else{return _0x3e89fa;}}})[_0x5b26('0xc')](function(_0x3c4a4a){_0x4b3e38['interaction']=_0x3c4a4a['get']({'plain':!![]});_0x4b3e38[_0x5b26('0x4f')][_0x5b26('0x50')]=_0x14a2cf;return db['MailMessage'][_0x5b26('0x43')]({'body':_0x139356[_0x5b26('0x24')]['body'],'MailAccountId':_0x139356['account']['id'],'MailInteractionId':_0x3c4a4a['id'],'direction':'in','ContactId':_0x4b3e38[_0x5b26('0x51')]['id'],'messageId':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x45')],'from':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x33')],'to':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')]['to'],'cc':_0x139356[_0x5b26('0x24')]['message']['cc'],'subject':_0x139356['body'][_0x5b26('0x14')]['subject'],'attach':_0x139356['body'][_0x5b26('0x14')]['attach'],'Attachments':_0x139356['body'][_0x5b26('0x14')]['attachments'],'originTo':_0x139356['body']['message'][_0x5b26('0x52')],'originCc':_0x139356['body'][_0x5b26('0x14')]['originCc'],'bcc':_0x139356['body']['message'][_0x5b26('0x53')],'ChatWebsiteId':_0x139356['body'][_0x5b26('0x14')][_0x5b26('0x54')]||null,'originChannel':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')]['originChannel']||'Email','ChatOfflineMessageId':_0x139356[_0x5b26('0x24')][_0x5b26('0x14')][_0x5b26('0x55')]||null},{'include':[{'model':db[_0x5b26('0x56')],'as':_0x5b26('0x57')}]});})[_0x5b26('0xc')](function(_0x5de000){_0x4b3e38[_0x5b26('0x14')]=_0x5de000;if(_0x4b3e38[_0x5b26('0x4f')]['UserId']){return db[_0x5b26('0x58')][_0x5b26('0x20')]({'attributes':['id','name'],'where':{'id':_0x4b3e38[_0x5b26('0x4f')][_0x5b26('0x59')]}})[_0x5b26('0xc')](function(_0x18d9cc){if(_0x18d9cc){_0x4b3e38[_0x5b26('0x3b')][_0x5b26('0x5a')]({'id':0x0,'priority':0x0,'app':_0x5b26('0x5b'),'appdata':_0x18d9cc[_0x5b26('0x5c')]+','+(_0x4b3e38[_0x5b26('0x39')][_0x5b26('0x5d')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x4b3e38);});}return respondWithRpcPromise(_0x5b26('0x5e'),_0x5b26('0x5f'),_0x4b3e38);})['then'](function(_0x586d86){_0x3f435f(_0x586d86);})[_0x5b26('0x16')](function(_0x33ce99){_0x5c7bde(_0x3383ea['error'](0x1f4,_0x33ce99[_0x5b26('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f848f5a..807aecc 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 _0x1cbc=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x63cac0,_0x11672f){var _0x5e2d01=function(_0x481ba4){while(--_0x481ba4){_0x63cac0['push'](_0x63cac0['shift']());}};_0x5e2d01(++_0x11672f);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0x1cbc[_0x105a8a];return _0x105a0e;};'use strict';var MailAccountEvents=require(_0xc1cb('0x0'));var events=['save',_0xc1cb('0x1'),_0xc1cb('0x2')];function createListener(_0x29a7a6,_0x1da6d8){return function(_0x199b45){_0x1da6d8[_0xc1cb('0x3')](_0x29a7a6,_0x199b45);};}function removeListener(_0x13a9a0,_0x71a222){return function(){MailAccountEvents[_0xc1cb('0x4')](_0x13a9a0,_0x71a222);};}exports[_0xc1cb('0x5')]=function(_0x1dacec){for(var _0x27423b=0x0,_0x56f1c8=events[_0xc1cb('0x6')];_0x27423b<_0x56f1c8;_0x27423b++){var _0x54cd03=events[_0x27423b];var _0xe5da07=createListener(_0xc1cb('0x7')+_0x54cd03,_0x1dacec);MailAccountEvents['on'](_0x54cd03,_0xe5da07);}}; \ No newline at end of file +var _0x1c9e=['length','save','remove','emit','removeListener'];(function(_0x2a8c9d,_0x2193da){var _0x29fbc0=function(_0x4b410f){while(--_0x4b410f){_0x2a8c9d['push'](_0x2a8c9d['shift']());}};_0x29fbc0(++_0x2193da);}(_0x1c9e,0x146));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe1c9('0x0'),_0xe1c9('0x1'),'update'];function createListener(_0xf1089c,_0x3baca1){return function(_0xd2967a){_0x3baca1[_0xe1c9('0x2')](_0xf1089c,_0xd2967a);};}function removeListener(_0x186359,_0x1b8a78){return function(){MailAccountEvents[_0xe1c9('0x3')](_0x186359,_0x1b8a78);};}exports['register']=function(_0x4183ec){for(var _0x5d17c3=0x0,_0x11334d=events[_0xe1c9('0x4')];_0x5d17c3<_0x11334d;_0x5d17c3++){var _0x16fcfe=events[_0x5d17c3];var _0x1b8811=createListener('mailAccount:'+_0x16fcfe,_0x4183ec);MailAccountEvents['on'](_0x16fcfe,_0x1b8811);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index c85460a..237b00e 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 _0x7c74=['isAuthenticated','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x3e9d0f,_0x291760){var _0x215d13=function(_0x2ae831){while(--_0x2ae831){_0x3e9d0f['push'](_0x3e9d0f['shift']());}};_0x215d13(++_0x291760);}(_0x7c74,0x1f4));var _0x47c7=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x7c74[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require(_0x47c7('0x0'));var util=require(_0x47c7('0x1'));var path=require(_0x47c7('0x2'));var timeout=require(_0x47c7('0x3'));var express=require(_0x47c7('0x4'));var router=express[_0x47c7('0x5')]();var fs_extra=require(_0x47c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47c7('0x7'));var config=require(_0x47c7('0x8'));var controller=require(_0x47c7('0x9'));router['get']('/:id',auth[_0x47c7('0xa')](),controller[_0x47c7('0xb')]);router[_0x47c7('0xc')](_0x47c7('0xd'),auth[_0x47c7('0xa')](),controller[_0x47c7('0xe')]);router['delete'](_0x47c7('0xd'),auth[_0x47c7('0xa')](),controller[_0x47c7('0xf')]);module[_0x47c7('0x10')]=router; \ No newline at end of file +var _0xb323=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','update','delete','exports','multer'];(function(_0xa2c6ee,_0x43f94d){var _0xc316be=function(_0x11dc55){while(--_0x11dc55){_0xa2c6ee['push'](_0xa2c6ee['shift']());}};_0xc316be(++_0x43f94d);}(_0xb323,0x86));var _0x3b32=function(_0x5d0211,_0x3f602a){_0x5d0211=_0x5d0211-0x0;var _0xe6b14=_0xb323[_0x5d0211];return _0xe6b14;};'use strict';var multer=require(_0x3b32('0x0'));var util=require(_0x3b32('0x1'));var path=require(_0x3b32('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b32('0x3')]();var fs_extra=require(_0x3b32('0x4'));var auth=require(_0x3b32('0x5'));var interaction=require(_0x3b32('0x6'));var config=require(_0x3b32('0x7'));var controller=require('./mailApplication.controller');router['get'](_0x3b32('0x8'),auth[_0x3b32('0x9')](),controller[_0x3b32('0xa')]);router[_0x3b32('0xb')](_0x3b32('0x8'),auth['isAuthenticated'](),controller[_0x3b32('0xc')]);router[_0x3b32('0xd')](_0x3b32('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x3b32('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index be71124..526d644 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 _0xdf4b=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x39a16f,_0x30feb2){var _0x559f9f=function(_0x1bc4a2){while(--_0x1bc4a2){_0x39a16f['push'](_0x39a16f['shift']());}};_0x559f9f(++_0x30feb2);}(_0xdf4b,0xb9));var _0xbdf4=function(_0x3b4548,_0x437b7a){_0x3b4548=_0x3b4548-0x0;var _0x28a404=_0xdf4b[_0x3b4548];return _0x28a404;};'use strict';var Sequelize=require(_0xbdf4('0x0'));module[_0xbdf4('0x1')]={'priority':{'type':Sequelize[_0xbdf4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbdf4('0x3')],'allowNull':![],'defaultValue':_0xbdf4('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbdf4('0x3')],'defaultValue':_0xbdf4('0x5')}}; \ No newline at end of file +var _0x4e81=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x5b366f,_0x1393d5){var _0x7e2eab=function(_0x1031bf){while(--_0x1031bf){_0x5b366f['push'](_0x5b366f['shift']());}};_0x7e2eab(++_0x1393d5);}(_0x4e81,0xe5));var _0x14e8=function(_0x127783,_0x258715){_0x127783=_0x127783-0x0;var _0x14f298=_0x4e81[_0x127783];return _0x14f298;};'use strict';var Sequelize=require(_0x14e8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x14e8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':_0x14e8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x14e8('0x2')]},'interval':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':_0x14e8('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index df81b58..8ffee95 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xaa88[_0x32729c];return _0x482cfd;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x4a60a9,_0x3ff815){var _0x2704f9=function(_0x2cbf59){while(--_0x2cbf59){_0x4a60a9['push'](_0x4a60a9['shift']());}};_0x2704f9(++_0x3ff815);}(_0xb43b,0x1b2));var _0xbb43=function(_0x33af2e,_0x85cf7d){_0x33af2e=_0x33af2e-0x0;var _0x1655d9=_0xb43b[_0x33af2e];return _0x1655d9;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 1445b7a..f8092fb 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 _0xa650=['utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','../../config/environment','mail_applications','utf8mb4'];(function(_0x3ba844,_0x42d868){var _0x416f06=function(_0x46c5e8){while(--_0x46c5e8){_0x3ba844['push'](_0x3ba844['shift']());}};_0x416f06(++_0x42d868);}(_0xa650,0x1e9));var _0x0a65=function(_0x346da8,_0x50af51){_0x346da8=_0x346da8-0x0;var _0x266788=_0xa650[_0x346da8];return _0x266788;};'use strict';var _=require(_0x0a65('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a65('0x1'));var rp=require(_0x0a65('0x2'));var fs=require('fs');var path=require(_0x0a65('0x3'));var rimraf=require('rimraf');var config=require(_0x0a65('0x4'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x467dd9,_0x59c552){return _0x467dd9['define']('MailApplication',attributes,{'tableName':_0x0a65('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a65('0x6'),'collate':_0x0a65('0x7')});}; \ No newline at end of file +var _0xdb03=['exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes'];(function(_0x26fe07,_0x5d0f24){var _0x27fbfc=function(_0x23df0c){while(--_0x23df0c){_0x26fe07['push'](_0x26fe07['shift']());}};_0x27fbfc(++_0x5d0f24);}(_0xdb03,0xba));var _0x3db0=function(_0x1558e1,_0x1ea306){_0x1558e1=_0x1558e1-0x0;var _0x4c33d5=_0xdb03[_0x1558e1];return _0x4c33d5;};'use strict';var _=require('lodash');var util=require(_0x3db0('0x0'));var logger=require(_0x3db0('0x1'))(_0x3db0('0x2'));var moment=require(_0x3db0('0x3'));var BPromise=require(_0x3db0('0x4'));var rp=require(_0x3db0('0x5'));var fs=require('fs');var path=require(_0x3db0('0x6'));var rimraf=require(_0x3db0('0x7'));var config=require('../../config/environment');var attributes=require(_0x3db0('0x8'));module[_0x3db0('0x9')]=function(_0x74b89d,_0x36098c){return _0x74b89d[_0x3db0('0xa')](_0x3db0('0xb'),attributes,{'tableName':_0x3db0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3db0('0xd'),'collate':_0x3db0('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7a54d2b..227bae3 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 _0x2e3a=['raw','where','attributes','stringify','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','result','UpdateMailApplication','MailApplication','body','options'];(function(_0x13babe,_0x51c48e){var _0x2ab002=function(_0x42e33a){while(--_0x42e33a){_0x13babe['push'](_0x13babe['shift']());}};_0x2ab002(++_0x51c48e);}(_0x2e3a,0x145));var _0xa2e3=function(_0x4a0875,_0x5ed913){_0x4a0875=_0x4a0875-0x0;var _0x385131=_0x2e3a[_0x4a0875];return _0x385131;};'use strict';var _=require(_0xa2e3('0x0'));var util=require('util');var moment=require(_0xa2e3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2e3('0x2'));var fs=require('fs');var Redis=require(_0xa2e3('0x3'));var db=require(_0xa2e3('0x4'))['db'];var utils=require(_0xa2e3('0x5'));var logger=require(_0xa2e3('0x6'))(_0xa2e3('0x7'));var config=require(_0xa2e3('0x8'));var jayson=require(_0xa2e3('0x9'));var client=jayson[_0xa2e3('0xa')][_0xa2e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1258a2,_0x3ff4dd,_0x271e45){return new BPromise(function(_0x2f8508,_0x49f29f){return client[_0xa2e3('0xc')](_0x1258a2,_0x271e45)[_0xa2e3('0xd')](function(_0x7042b5){logger['info'](_0xa2e3('0xe'),_0x3ff4dd,_0xa2e3('0xf'));logger[_0xa2e3('0x10')](_0xa2e3('0x11'),_0x3ff4dd,_0xa2e3('0xf'),JSON['stringify'](_0x7042b5));if(_0x7042b5[_0xa2e3('0x12')]){if(_0x7042b5[_0xa2e3('0x12')][_0xa2e3('0x13')]===0x1f4){logger[_0xa2e3('0x12')](_0xa2e3('0xe'),_0x3ff4dd,_0x7042b5[_0xa2e3('0x12')][_0xa2e3('0x14')]);return _0x49f29f(_0x7042b5['error'][_0xa2e3('0x14')]);}logger['error'](_0xa2e3('0xe'),_0x3ff4dd,_0x7042b5[_0xa2e3('0x12')]['message']);return _0x2f8508(_0x7042b5['error'][_0xa2e3('0x14')]);}else{logger[_0xa2e3('0x15')](_0xa2e3('0xe'),_0x3ff4dd,_0xa2e3('0xf'));_0x2f8508(_0x7042b5[_0xa2e3('0x16')][_0xa2e3('0x14')]);}})['catch'](function(_0x1274e0){logger[_0xa2e3('0x12')](_0xa2e3('0xe'),_0x3ff4dd,_0x1274e0);_0x49f29f(_0x1274e0);});});}exports[_0xa2e3('0x17')]=function(_0x3f7370){var _0x18e60e=this;return new Promise(function(_0x3af347,_0x7e6667){return db[_0xa2e3('0x18')]['update'](_0x3f7370[_0xa2e3('0x19')],{'raw':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')][_0xa2e3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')][_0xa2e3('0x1c')]||null:null,'attributes':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')][_0xa2e3('0x1d')]||null:null,'limit':_0x3f7370[_0xa2e3('0x1a')]?_0x3f7370[_0xa2e3('0x1a')]['limit']||null:null})['then'](function(_0xc3127){logger[_0xa2e3('0x15')](_0xa2e3('0x17'),_0x3f7370);logger['debug'](_0xa2e3('0x17'),_0x3f7370,JSON[_0xa2e3('0x1e')](_0xc3127));_0x3af347(_0xc3127);})[_0xa2e3('0x1f')](function(_0x44559a){logger[_0xa2e3('0x12')]('UpdateMailApplication',_0x44559a[_0xa2e3('0x14')],_0x3f7370);_0x7e6667(_0x18e60e['error'](0x1f4,_0x44559a['message']));});});}; \ No newline at end of file +var _0x57df=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','info','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x50d0dc,_0x23bcb0){var _0x49f2a9=function(_0x58cb36){while(--_0x58cb36){_0x50d0dc['push'](_0x50d0dc['shift']());}};_0x49f2a9(++_0x23bcb0);}(_0x57df,0xd4));var _0xf57d=function(_0x3052f0,_0x1ebfa3){_0x3052f0=_0x3052f0-0x0;var _0x20363a=_0x57df[_0x3052f0];return _0x20363a;};'use strict';var _=require(_0xf57d('0x0'));var util=require('util');var moment=require(_0xf57d('0x1'));var BPromise=require('bluebird');var rs=require(_0xf57d('0x2'));var fs=require('fs');var Redis=require(_0xf57d('0x3'));var db=require(_0xf57d('0x4'))['db'];var utils=require(_0xf57d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf57d('0x6'));var jayson=require(_0xf57d('0x7'));var client=jayson[_0xf57d('0x8')][_0xf57d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c5f7b,_0x204be8,_0x12cf71){return new BPromise(function(_0x59979e,_0x17ce6c){return client[_0xf57d('0xa')](_0x2c5f7b,_0x12cf71)[_0xf57d('0xb')](function(_0x262deb){logger['info'](_0xf57d('0xc'),_0x204be8,_0xf57d('0xd'));logger[_0xf57d('0xe')](_0xf57d('0xf'),_0x204be8,_0xf57d('0xd'),JSON['stringify'](_0x262deb));if(_0x262deb[_0xf57d('0x10')]){if(_0x262deb[_0xf57d('0x10')][_0xf57d('0x11')]===0x1f4){logger[_0xf57d('0x10')](_0xf57d('0xc'),_0x204be8,_0x262deb[_0xf57d('0x10')][_0xf57d('0x12')]);return _0x17ce6c(_0x262deb[_0xf57d('0x10')][_0xf57d('0x12')]);}logger[_0xf57d('0x10')]('MailApplication,\x20%s,\x20%s',_0x204be8,_0x262deb[_0xf57d('0x10')][_0xf57d('0x12')]);return _0x59979e(_0x262deb[_0xf57d('0x10')][_0xf57d('0x12')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x204be8,_0xf57d('0xd'));_0x59979e(_0x262deb[_0xf57d('0x13')][_0xf57d('0x12')]);}})[_0xf57d('0x14')](function(_0x51b6dc){logger['error'](_0xf57d('0xc'),_0x204be8,_0x51b6dc);_0x17ce6c(_0x51b6dc);});});}exports[_0xf57d('0x15')]=function(_0x5971d3){var _0x46a907=this;return new Promise(function(_0x48b714,_0x5cd029){return db[_0xf57d('0x16')][_0xf57d('0x17')](_0x5971d3[_0xf57d('0x18')],{'raw':_0x5971d3['options']?_0x5971d3[_0xf57d('0x19')][_0xf57d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5971d3[_0xf57d('0x19')]?_0x5971d3[_0xf57d('0x19')][_0xf57d('0x1b')]||null:null,'attributes':_0x5971d3['options']?_0x5971d3[_0xf57d('0x19')][_0xf57d('0x1c')]||null:null,'limit':_0x5971d3['options']?_0x5971d3[_0xf57d('0x19')][_0xf57d('0x1d')]||null:null})[_0xf57d('0xb')](function(_0x396557){logger[_0xf57d('0x1e')](_0xf57d('0x15'),_0x5971d3);logger[_0xf57d('0xe')]('UpdateMailApplication',_0x5971d3,JSON[_0xf57d('0x1f')](_0x396557));_0x48b714(_0x396557);})[_0xf57d('0x14')](function(_0x5e2daf){logger[_0xf57d('0x10')](_0xf57d('0x15'),_0x5e2daf['message'],_0x5971d3);_0x5cd029(_0x46a907[_0xf57d('0x10')](0x1f4,_0x5e2daf[_0xf57d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c6d547a..0f42f9c 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 _0x3a6a=['exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','/:id/tags','removeTags'];(function(_0x43ce48,_0x2d15d3){var _0x35f492=function(_0x221d9a){while(--_0x221d9a){_0x43ce48['push'](_0x43ce48['shift']());}};_0x35f492(++_0x2d15d3);}(_0x3a6a,0x106));var _0xa3a6=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x3a6a[_0xd511d];return _0x3f148e;};'use strict';var express=require(_0xa3a6('0x0'));var router=express[_0xa3a6('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xa3a6('0x2'));var controller=require(_0xa3a6('0x3'));router[_0xa3a6('0x4')]('/',auth[_0xa3a6('0x5')](),controller[_0xa3a6('0x6')]);router[_0xa3a6('0x4')](_0xa3a6('0x7'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0x8')]);router[_0xa3a6('0x4')](_0xa3a6('0x9'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0xa')]);router[_0xa3a6('0x4')](_0xa3a6('0xb'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0xc')]);router[_0xa3a6('0x4')](_0xa3a6('0xd'),auth['isAuthenticated'](),controller[_0xa3a6('0xe')]);router['post']('/',auth[_0xa3a6('0x5')](),controller[_0xa3a6('0xf')]);router['post'](_0xa3a6('0xb'),auth[_0xa3a6('0x5')](),controller['addMessage']);router[_0xa3a6('0x10')]('/:id/tags',auth[_0xa3a6('0x5')](),interaction['tracked'](_0xa3a6('0x11'),_0xa3a6('0x12')),controller[_0xa3a6('0x13')]);router['put'](_0xa3a6('0x9'),auth[_0xa3a6('0x5')](),interaction[_0xa3a6('0x14')]('mail',_0xa3a6('0x15')),controller[_0xa3a6('0x16')]);router['delete'](_0xa3a6('0x9'),auth[_0xa3a6('0x5')](),interaction['tracked']('mail',_0xa3a6('0x17')),controller[_0xa3a6('0x18')]);router[_0xa3a6('0x19')](_0xa3a6('0x1a'),auth[_0xa3a6('0x5')](),controller[_0xa3a6('0x1b')]);module[_0xa3a6('0x1c')]=router; \ No newline at end of file +var _0x74dd=['exports','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy'];(function(_0x19c61a,_0x54161a){var _0x57378e=function(_0x3ec8b0){while(--_0x3ec8b0){_0x19c61a['push'](_0x19c61a['shift']());}};_0x57378e(++_0x54161a);}(_0x74dd,0x9d));var _0xd74d=function(_0x4756d5,_0x20560a){_0x4756d5=_0x4756d5-0x0;var _0xf834a8=_0x74dd[_0x4756d5];return _0xf834a8;};'use strict';var express=require(_0xd74d('0x0'));var router=express[_0xd74d('0x1')]();var auth=require(_0xd74d('0x2'));var interaction=require(_0xd74d('0x3'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0xd74d('0x4')](),controller[_0xd74d('0x5')]);router[_0xd74d('0x6')]('/describe',auth[_0xd74d('0x4')](),controller[_0xd74d('0x7')]);router[_0xd74d('0x6')]('/:id',auth[_0xd74d('0x4')](),controller['show']);router['get'](_0xd74d('0x8'),auth[_0xd74d('0x4')](),controller[_0xd74d('0x9')]);router[_0xd74d('0x6')](_0xd74d('0xa'),auth[_0xd74d('0x4')](),controller[_0xd74d('0xb')]);router[_0xd74d('0xc')]('/',auth[_0xd74d('0x4')](),controller['create']);router['post'](_0xd74d('0x8'),auth['isAuthenticated'](),controller[_0xd74d('0xd')]);router[_0xd74d('0xc')](_0xd74d('0xe'),auth[_0xd74d('0x4')](),interaction[_0xd74d('0xf')](_0xd74d('0x10'),_0xd74d('0x11')),controller['addTags']);router[_0xd74d('0x12')]('/:id',auth[_0xd74d('0x4')](),interaction[_0xd74d('0xf')](_0xd74d('0x10'),_0xd74d('0x13')),controller[_0xd74d('0x14')]);router[_0xd74d('0x15')](_0xd74d('0x16'),auth[_0xd74d('0x4')](),interaction['tracked'](_0xd74d('0x10'),_0xd74d('0x17')),controller[_0xd74d('0x18')]);router[_0xd74d('0x15')](_0xd74d('0xe'),auth['isAuthenticated'](),controller['removeTags']);module[_0xd74d('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 53c2ef6..55bbc8a 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 _0xe31a=['out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM'];(function(_0x4592d7,_0x1a7832){var _0x2072b7=function(_0x40bfbb){while(--_0x40bfbb){_0x4592d7['push'](_0x4592d7['shift']());}};_0x2072b7(++_0x1a7832);}(_0xe31a,0xd0));var _0xae31=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe31a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xae31('0x0'));var iconv=require(_0xae31('0x1'));module[_0xae31('0x2')]={'closed':{'type':Sequelize[_0xae31('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae31('0x4')]},'disposition':{'type':Sequelize[_0xae31('0x5')]},'secondDisposition':{'type':Sequelize[_0xae31('0x5')]},'thirdDisposition':{'type':Sequelize[_0xae31('0x5')]},'note':{'type':Sequelize[_0xae31('0x5')]},'inReplyTo':{'type':Sequelize[_0xae31('0x5')](0x1fe)},'to':{'type':Sequelize[_0xae31('0x5')]},'cc':{'type':Sequelize[_0xae31('0x6')]('long')},'subject':{'type':Sequelize[_0xae31('0x6')]()},'attach':{'type':Sequelize[_0xae31('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xae31('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xae31('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xae31('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae31('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xae31('0x7')]('in',_0xae31('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xae31('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x802c=['STRING','TEXT','long','BOOLEAN','DATE','ENUM','out','sequelize','iconv','exports'];(function(_0x10a7da,_0x1c4002){var _0x5c13cb=function(_0x551eb1){while(--_0x551eb1){_0x10a7da['push'](_0x10a7da['shift']());}};_0x5c13cb(++_0x1c4002);}(_0x802c,0x1dd));var _0xc802=function(_0x4ea55b,_0x4e69a2){_0x4ea55b=_0x4ea55b-0x0;var _0x43bfef=_0x802c[_0x4ea55b];return _0x43bfef;};'use strict';var Sequelize=require(_0xc802('0x0'));var iconv=require(_0xc802('0x1'));module[_0xc802('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc802('0x3')]},'secondDisposition':{'type':Sequelize[_0xc802('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc802('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xc802('0x3')](0x1fe)},'to':{'type':Sequelize[_0xc802('0x3')]},'cc':{'type':Sequelize[_0xc802('0x4')](_0xc802('0x5'))},'subject':{'type':Sequelize[_0xc802('0x4')]()},'attach':{'type':Sequelize[_0xc802('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xc802('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xc802('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xc802('0x8')]('in',_0xc802('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc802('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc802('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index dfbd77e..9b63b3b 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 _0xbe85=['where','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','isEmpty','MailAccountId','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','MailInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','c.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.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','params','keys','includeAll','include','options','create','body','addMessage','MailMessage','ids','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','forEach','Tags','push','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','closed','UserId','unmanaged','total','index','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x268e0c,_0x1ef7d1){var _0x97a5fb=function(_0x58ccb2){while(--_0x58ccb2){_0x268e0c['push'](_0x268e0c['shift']());}};_0x97a5fb(++_0x1ef7d1);}(_0xbe85,0x197));var _0x5be8=function(_0x40443c,_0x14ce7c){_0x40443c=_0x40443c-0x0;var _0x15f59d=_0xbe85[_0x40443c];return _0x15f59d;};'use strict';var emlformat=require(_0x5be8('0x0'));var rimraf=require(_0x5be8('0x1'));var zipdir=require(_0x5be8('0x2'));var moment=require(_0x5be8('0x3'));var BPromise=require(_0x5be8('0x4'));var util=require('util');var path=require(_0x5be8('0x5'));var fs=require('fs');var _=require(_0x5be8('0x6'));var squel=require(_0x5be8('0x7'));var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x5be8('0x8'));var logger=require(_0x5be8('0x9'))('api');var config=require(_0x5be8('0xa'));var db=require(_0x5be8('0xb'))['db'];var htmlEntities=require('html-entities');config['redis']=_['defaults'](config[_0x5be8('0xc')],{'host':_0x5be8('0xd'),'port':0x18eb});var socket=require(_0x5be8('0xe'))(new Redis(config[_0x5be8('0xc')]));require('./mailInteraction.socket')[_0x5be8('0xf')](socket);function respondWithStatusCode(_0x266104,_0x281b24){_0x281b24=_0x281b24||0xcc;return function(_0x536b68){if(_0x536b68){return _0x266104['sendStatus'](_0x281b24);}return _0x266104['status'](_0x281b24)[_0x5be8('0x10')]();};}function respondWithResult(_0x1799a0,_0x39497c){_0x39497c=_0x39497c||0xc8;return function(_0x20635f){if(_0x20635f){return _0x1799a0[_0x5be8('0x11')](_0x39497c)[_0x5be8('0x12')](_0x20635f);}};}function respondWithFilteredResult(_0x1deabd,_0x363620){return function(_0x5643f2){if(_0x5643f2){var _0x230210=typeof _0x363620[_0x5be8('0x13')]===_0x5be8('0x14')&&typeof _0x363620[_0x5be8('0x15')]===_0x5be8('0x14');var _0x2f00e9=_0x5643f2[_0x5be8('0x16')];var _0x39d023=_0x230210?0x0:_0x363620['offset'];var _0x42fbe8=_0x230210?_0x5643f2[_0x5be8('0x16')]:_0x363620['offset']+_0x363620[_0x5be8('0x15')];var _0x50506d;if(_0x42fbe8>=_0x2f00e9){_0x42fbe8=_0x2f00e9;_0x50506d=0xc8;}else{_0x50506d=0xce;}_0x1deabd[_0x5be8('0x11')](_0x50506d);return _0x1deabd[_0x5be8('0x17')]('Content-Range',_0x39d023+'-'+_0x42fbe8+'/'+_0x2f00e9)[_0x5be8('0x12')](_0x5643f2);}return null;};}function saveUpdates(_0x1da45b){return function(_0x9228c2){if(_0x9228c2){return _0x9228c2[_0x5be8('0x18')](_0x1da45b)[_0x5be8('0x19')](function(_0x3f8c46){return _0x3f8c46;});}return null;};}function removeEntity(_0x15431b){return function(_0x2c43b6){if(_0x2c43b6){return _0x2c43b6[_0x5be8('0x1a')]()[_0x5be8('0x19')](function(){_0x15431b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd00eac){return function(_0x36157e){if(!_0x36157e){_0xd00eac[_0x5be8('0x1b')](0x194);}return _0x36157e;};}function handleError(_0x4f1286,_0x22e71e){_0x22e71e=_0x22e71e||0x1f4;return function(_0x3bfd9b){logger[_0x5be8('0x1c')](_0x3bfd9b[_0x5be8('0x1d')]);if(_0x3bfd9b[_0x5be8('0x1e')]){delete _0x3bfd9b[_0x5be8('0x1e')];}_0x4f1286[_0x5be8('0x11')](_0x22e71e)['send'](_0x3bfd9b);};}function getInteractionUsers(_0x3a7712,_0x121ed9){return new BPromise(function(_0x1fdccf,_0x31d455){try{if(_0x121ed9[_0x3a7712['id']]){_0x3a7712[_0x5be8('0x1f')]=_[_0x5be8('0x20')](_0x121ed9[_0x3a7712['id']],function(_0x4f7dbe){return{'id':_0x4f7dbe['id'],'fullname':_0x4f7dbe[_0x5be8('0x21')]};});}}catch(_0x258c59){_0x31d455(_0x258c59);}_0x1fdccf(_0x3a7712);});}function getInteractionTags(_0x2e3cb3,_0x38005a){return new BPromise(function(_0xc1b9f1,_0x231984){try{if(_0x2e3cb3[_0x5be8('0x22')]){_0x2e3cb3['Tags']=[];_0x2e3cb3[_0x5be8('0x22')]['split'](',')[_0x5be8('0x23')](function(_0x2f8a8f){_0x2e3cb3[_0x5be8('0x24')][_0x5be8('0x25')](_0x38005a[_0x2f8a8f]);});}delete _0x2e3cb3[_0x5be8('0x22')];}catch(_0x56f2fa){_0x231984(_0x56f2fa);}_0xc1b9f1(_0x2e3cb3);});}function getLastMessageText(_0x1b6121){return new BPromise(function(_0x262a6f,_0x558a74){return db['MailMessage'][_0x5be8('0x26')]({'where':{'$and':[{'MailInteractionId':_0x1b6121['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5be8('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x5be8('0x19')](function(_0x394b3c){if(_0x394b3c&&_0x394b3c[_0x5be8('0x28')]){_0x1b6121[_0x5be8('0x29')]=_[_0x5be8('0x2a')](_0x394b3c['plainBody']);}_0x262a6f(_0x1b6121);})['catch'](function(_0x440a68){_0x558a74(_0x440a68);});});}function updateMailInteraction(_0x709289,_0x3ecf04,_0x3267d1,_0x5b1082){return new BPromise(function(_0x520db7,_0x5ca677){return getInteractionUsers(_0x709289,_0x3267d1)[_0x5be8('0x19')](function(_0x4aae93){return getInteractionTags(_0x4aae93,_0x3ecf04);})['then'](function(_0x10d114){return getStateInteraction(_0x10d114);})['then'](function(_0x2d0db5){if(_0x5b1082){_0x520db7(getLastMessageText(_0x2d0db5));}else{_0x520db7(_0x2d0db5);}})[_0x5be8('0x2b')](function(_0x25b217){_0x5ca677(_0x25b217);});});}function getStateInteraction(_0x2e76ab){return new BPromise(function(_0xfd6b74){_0x2e76ab[_0x5be8('0x2c')]=0x0;_0x2e76ab[_0x5be8('0x2d')]=0x0;_0x2e76ab[_0x5be8('0x2e')]=0x0;_0x2e76ab['unmanaged']=0x0;_0x2e76ab['total']=0x0;if(!_0x2e76ab[_0x5be8('0x2f')]&&!_0x2e76ab[_0x5be8('0x30')]){_0x2e76ab[_0x5be8('0x2c')]+=0x1;}if(!_0x2e76ab[_0x5be8('0x2f')]&&_0x2e76ab[_0x5be8('0x30')]){_0x2e76ab['talking']+=0x1;if(_0x2e76ab[_0x5be8('0x2c')]){_0x2e76ab['waiting']-=0x1;}}if(_0x2e76ab[_0x5be8('0x2f')]&&_0x2e76ab['UserId']){_0x2e76ab[_0x5be8('0x2e')]+=0x1;if(_0x2e76ab[_0x5be8('0x2d')]){_0x2e76ab[_0x5be8('0x2d')]-=0x1;}}if(_0x2e76ab[_0x5be8('0x2f')]&&!_0x2e76ab[_0x5be8('0x30')]){_0x2e76ab[_0x5be8('0x31')]+=0x1;if(_0x2e76ab[_0x5be8('0x2c')]){_0x2e76ab['waiting']-=0x1;}}_0x2e76ab[_0x5be8('0x32')]+=0x1;_0xfd6b74(_0x2e76ab);});}exports[_0x5be8('0x33')]=function(_0x2ab07c,_0x12a2f0){var _0x466a85={},_0x388f45={},_0x2257e7={'count':0x0,'rows':[]};var _0x1f9ac7=_[_0x5be8('0x20')](db['MailInteraction'][_0x5be8('0x34')],function(_0x467862){return{'name':_0x467862[_0x5be8('0x35')],'type':_0x467862[_0x5be8('0x36')]['key']};});_0x388f45[_0x5be8('0x37')]=_[_0x5be8('0x20')](_0x1f9ac7,_0x5be8('0x1e'));_0x388f45[_0x5be8('0x38')]=_['keys'](_0x2ab07c[_0x5be8('0x38')]);_0x388f45[_0x5be8('0x39')]=_[_0x5be8('0x3a')](_0x388f45['model'],_0x388f45[_0x5be8('0x38')]);_0x466a85[_0x5be8('0x3b')]=_['intersection'](_0x388f45[_0x5be8('0x37')],qs['fields'](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x3c')]));_0x466a85[_0x5be8('0x3b')]=_0x466a85[_0x5be8('0x3b')][_0x5be8('0x3d')]?_0x466a85['attributes']:_0x388f45['model'];if(!_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x3e')](_0x5be8('0x3f'))){_0x466a85[_0x5be8('0x15')]=qs[_0x5be8('0x15')](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x15')]);_0x466a85[_0x5be8('0x13')]=qs['offset'](_0x2ab07c[_0x5be8('0x38')]['offset']);}_0x466a85['order']=qs['sort'](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x40')]);_0x466a85[_0x5be8('0x41')]=qs[_0x5be8('0x39')](_['pick'](_0x2ab07c[_0x5be8('0x38')],_0x388f45[_0x5be8('0x39')]),_0x1f9ac7);var _0x19f31a=[];var _0x37abc8=squel[_0x5be8('0x42')]()['field']('id')[_0x5be8('0x43')](_0x5be8('0x1e'))[_0x5be8('0x43')](_0x5be8('0x44'))[_0x5be8('0x45')](_0x5be8('0x46'));var _0x1aef03=squel[_0x5be8('0x42')]()[_0x5be8('0x43')](_0x5be8('0x47'))['field'](_0x5be8('0x48'))['field'](_0x5be8('0x49'))['from'](_0x5be8('0x4a'),'ui')[_0x5be8('0x4b')](_0x5be8('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x1d1622=squel[_0x5be8('0x42')]()[_0x5be8('0x45')](_0x5be8('0x4d'),'i')[_0x5be8('0x4b')]('cm_contacts','c',_0x5be8('0x4e'))[_0x5be8('0x4b')]('users','o',_0x5be8('0x4f'))[_0x5be8('0x4b')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x5be8('0x4b')]('mail_messages','me',_0x5be8('0x50'))[_0x5be8('0x4b')](_0x5be8('0x51'),'it',_0x5be8('0x52'))[_0x5be8('0x4b')](_0x5be8('0x46'),'t',_0x5be8('0x53'));var _0x376a80=squel[_0x5be8('0x54')]();var _0x15f1e0=[];var _0x530ab4=squel[_0x5be8('0x54')]();var _0xa5c591;if(_0x2ab07c[_0x5be8('0x38')]['search']){_0xa5c591=as[_0x5be8('0x55')](_0x2ab07c[_0x5be8('0x38')]['search']);var _0x250da2=_0xa5c591[_0x5be8('0x56')];for(var _0x3cac8f=0x0;_0x3cac8f<_0xa5c591[_0x5be8('0x57')][_0x5be8('0x3d')];_0x3cac8f++){var _0x167f5b=_0xa5c591[_0x5be8('0x57')][_0x3cac8f];var _0x195184='i';var _0x12f528=_[_0x5be8('0x58')](_0x1f9ac7,[_0x5be8('0x1e'),_0x167f5b[_0x5be8('0x43')]]);if(!_0x12f528){switch(_0x167f5b[_0x5be8('0x43')]){case _0x5be8('0x59'):if(_0x167f5b[_0x5be8('0x5a')]==0x1){_0x1d1622['having']('`'+_0x167f5b[_0x5be8('0x43')]+'`\x20=\x200');}else{_0x1d1622[_0x5be8('0x5b')]('`'+_0x167f5b[_0x5be8('0x43')]+_0x5be8('0x5c'));}break;case _0x5be8('0x5d'):if(_0x167f5b[_0x5be8('0x5e')]===_0x5be8('0x5f')){if(_0x167f5b[_0x5be8('0x5a')]['split']('\x20')['length']>0x1){_0x376a80[_0x250da2](_0x5be8('0x60'),qs[_0x5be8('0x61')](_0x167f5b[_0x5be8('0x5a')]),null);}else{var _0x55063b='%'+_0x167f5b[_0x5be8('0x5a')]+'%';_0x376a80[_0x250da2](_0x5be8('0x62'),_0x55063b,_0x55063b,_0x55063b);}}else{_0x12f528=_[_0x5be8('0x58')](_0x1f9ac7,[_0x5be8('0x1e'),'ContactId']);_0x167f5b['field']=_0x5be8('0x63');_0x1833f0=as[_0x5be8('0x64')](_0x195184,_0x12f528['type'],_0x167f5b);_0x376a80[_0x250da2](_0x1833f0['text'],_0x1833f0['value'][_0x5be8('0x65')],_0x1833f0[_0x5be8('0x5a')][_0x5be8('0x10')]);}break;case _0x5be8('0x66'):var _0x245b21=_0x167f5b[_0x5be8('0x5a')][_0x5be8('0x67')](',')[_0x5be8('0x20')](function(_0x5c6b0){return Number(_0x5c6b0);});_0x245b21[_0x5be8('0x23')](function(_0x4c55aa){_0x530ab4['or'](_0x5be8('0x68'),'%,'+_0x4c55aa+',%');});_0x15f1e0=_[_0x5be8('0x69')](_0x15f1e0,_0x245b21);break;case _0x5be8('0x6a'):if(_0x167f5b[_0x5be8('0x5e')]===_0x5be8('0x5f')){_0x376a80[_0x250da2](_0x5be8('0x6b'),'%'+_0x167f5b[_0x5be8('0x5a')]+'%',null);}else{_0x12f528=_[_0x5be8('0x58')](_0x1f9ac7,[_0x5be8('0x1e'),'UserId']);_0x167f5b[_0x5be8('0x43')]=_0x5be8('0x30');_0x1833f0=as[_0x5be8('0x64')](_0x195184,_0x12f528[_0x5be8('0x36')],_0x167f5b);_0x376a80[_0x250da2](_0x1833f0[_0x5be8('0x6c')],_0x1833f0['value']['start'],_0x1833f0[_0x5be8('0x5a')][_0x5be8('0x10')]);}break;case _0x5be8('0x28'):_0x1833f0=as['buildExpression']('me',null,_0x167f5b);_0x376a80[_0x250da2](_0x1833f0[_0x5be8('0x6c')],_0x1833f0['value'][_0x5be8('0x65')],_0x1833f0[_0x5be8('0x5a')][_0x5be8('0x10')]);break;}}else{var _0x1833f0=as[_0x5be8('0x64')](_0x195184,_0x12f528[_0x5be8('0x36')],_0x167f5b);_0x376a80[_0x250da2](_0x1833f0[_0x5be8('0x6c')],_0x1833f0['value'][_0x5be8('0x65')],_0x1833f0['value']['end']);}}}else{var _0x3f3a03=_(_0x2ab07c['query'])['keys']()[_0x5be8('0x20')](function(_0x12d307){return _[_0x5be8('0x6d')](_0x1f9ac7,[_0x5be8('0x1e'),_0x12d307])?_0x12d307:undefined;})['compact']()[_0x5be8('0x5a')]();if(!_[_0x5be8('0x6e')](_0x3f3a03)){_0x3f3a03[_0x5be8('0x23')](function(_0x373510){if(_0x373510===_0x5be8('0x6f')){_0x1d1622[_0x5be8('0x41')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x2ab07c['query'][_0x373510]));}else if(_0x373510==='createdAt'){var _0x448701=JSON[_0x5be8('0x70')](_0x2ab07c['query'][_0x373510])[_0x5be8('0x71')];var _0x4e141e=JSON[_0x5be8('0x70')](_0x2ab07c[_0x5be8('0x38')][_0x373510])[_0x5be8('0x72')];_0x1d1622['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x448701,_0x4e141e);}else{if(_0x2ab07c[_0x5be8('0x38')][_0x373510]===_0x5be8('0x73')){_0x1d1622[_0x5be8('0x41')]('i.'+_0x373510+'\x20IS\x20NULL');}else{_0x1d1622[_0x5be8('0x41')]('i.'+_0x373510+_0x5be8('0x74'),_0x2ab07c[_0x5be8('0x38')][_0x373510]);}}});}if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x75')]){if(_0x2ab07c['query']['read']==0x1){_0x1d1622[_0x5be8('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x1d1622['having'](_0x5be8('0x76'));}}if(_0x2ab07c[_0x5be8('0x38')]['tag']){_0x15f1e0=_[_0x5be8('0x77')](_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x78')])?_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x78')]:new Array(_0x2ab07c['query'][_0x5be8('0x78')]);_0x15f1e0[_0x5be8('0x23')](function(_0x3ca806){_0x530ab4['or'](_0x5be8('0x68'),'%,'+_0x3ca806+',%');});}if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x79')]){var _0x45b8b6=_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x79')][_0x5be8('0x7a')]('\x5c','\x5c\x5c')[_0x5be8('0x7a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x45b8b6)){_0x376a80['or'](_0x5be8('0x7b'),_0x45b8b6+'%');}else if(qs[_0x5be8('0x7c')](_0x45b8b6)){_0x376a80['or']('c.email\x20LIKE\x20?',_0x45b8b6+'%');}else{_0x376a80['or'](_0x5be8('0x7d'),qs[_0x5be8('0x61')](_0x45b8b6))['or'](_0x5be8('0x7e'),qs['getFullTextValue'](_0x45b8b6));}}}_0x1d1622[_0x5be8('0x41')](_0x376a80);_0x1d1622['group'](_0x5be8('0x7f'));var _0x33632b={'type':db['Sequelize']['QueryTypes'][_0x5be8('0x80')],'raw':!![]};var _0x5f8094=_0x1d1622[_0x5be8('0x81')]();_0x5f8094[_0x5be8('0x43')]('i.id');_0x5f8094[_0x5be8('0x43')](_0x5be8('0x82'),_0x5be8('0x59'));if(_0x466a85[_0x5be8('0x83')]){_0x466a85[_0x5be8('0x83')][_0x5be8('0x23')](function(_0x47dfa4){var _0x4d0201=_0x47dfa4[0x0]===_0x5be8('0x84')?_0x47dfa4[0x0]:'i.'+_0x47dfa4[0x0];_0x1d1622[_0x5be8('0x83')](_0x4d0201,_0x47dfa4[0x1]===_0x5be8('0x85')?![]:!![]);});}if(!_[_0x5be8('0x6e')](_0x15f1e0)){_0x1d1622['having'](_0x530ab4);_0x5f8094[_0x5be8('0x41')](_0x5be8('0x86'),_0x15f1e0);}BPromise[_0x5be8('0x87')]()[_0x5be8('0x19')](function(){if(!_0xa5c591){if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x6f')])return;_0x5f8094[_0x5be8('0x41')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x1d1622['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2ab07c[_0x5be8('0x88')][_0x5be8('0x89')]!==_0x5be8('0x8a'))return;return _0x2ab07c[_0x5be8('0x88')][_0x5be8('0x8b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ec32e){if(_[_0x5be8('0x6e')](_0x3ec32e)){_0x5f8094[_0x5be8('0x41')](_0x5be8('0x8c'));_0x1d1622[_0x5be8('0x41')](_0x5be8('0x8c'));}else{_0x5f8094[_0x5be8('0x41')]('i.MailAccountId\x20IN\x20?',_[_0x5be8('0x20')](_0x3ec32e,'id'));_0x1d1622[_0x5be8('0x41')](_0x5be8('0x8d'),_['map'](_0x3ec32e,'id'));}});})['then'](function(){if(_0x2ab07c[_0x5be8('0x88')][_0x5be8('0x89')]===_0x5be8('0x8a')&&!_0xa5c591&&!_0x2ab07c['query'][_0x5be8('0x6f')])return[];return db[_0x5be8('0x8e')][_0x5be8('0x38')](_0x5f8094[_0x5be8('0x8f')](),_0x33632b);})[_0x5be8('0x19')](function(_0x3693b0){_0x2257e7[_0x5be8('0x16')]=_0x3693b0[_0x5be8('0x3d')];if(_0x2257e7['count']===0x0)return[];return db['sequelize'][_0x5be8('0x38')](_0x37abc8['toString'](),_0x33632b)[_0x5be8('0x19')](function(_0x23ccb3){_0x19f31a=_['keyBy'](_0x23ccb3,'id');_0x33632b=_[_0x5be8('0x90')](_0x33632b,{'model':db[_0x5be8('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ab07c[_0x5be8('0x38')][_0x5be8('0x3c')]){_0x466a85[_0x5be8('0x3b')]['forEach'](function(_0xf93b24){_0x1d1622[_0x5be8('0x43')]('i.'+_0xf93b24);});}else{_0x1d1622[_0x5be8('0x43')](_0x5be8('0x82'),_0x5be8('0x59'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x92'),_0x5be8('0x93'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x94'),_0x5be8('0x95'));_0x1d1622['field'](_0x5be8('0x96'),'contactName');_0x1d1622[_0x5be8('0x43')]('i.id');_0x1d1622[_0x5be8('0x43')](_0x5be8('0x97'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x98'));_0x1d1622['field'](_0x5be8('0x99'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9a'));_0x1d1622['field'](_0x5be8('0x9b'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9c'));_0x1d1622[_0x5be8('0x43')]('i.lastMsgDirection');_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9d'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9e'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0x9f'));_0x1d1622[_0x5be8('0x43')]('i.thirdDisposition');_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa0'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa1'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa2'));_0x1d1622['field'](_0x5be8('0xa3'));_0x1d1622[_0x5be8('0x43')]('i.UserId');_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa4'),'Contact.firstName');_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa5'),_0x5be8('0xa6'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa7'),_0x5be8('0xa8'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xa9'),_0x5be8('0xaa'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xab'),_0x5be8('0xac'));_0x1d1622['field'](_0x5be8('0xad'),_0x5be8('0xae'));_0x1d1622[_0x5be8('0x43')](_0x5be8('0xaf'),_0x5be8('0xb0'));_0x1d1622['field'](_0x5be8('0xb1'),_0x5be8('0xb2'));_0x1d1622[_0x5be8('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5be8('0x22'));}if(_0x466a85[_0x5be8('0x15')])_0x1d1622[_0x5be8('0x15')](_0x466a85[_0x5be8('0x15')]);if(_0x466a85[_0x5be8('0x13')])_0x1d1622['offset'](_0x466a85['offset']);return db['sequelize'][_0x5be8('0x38')](_0x1d1622[_0x5be8('0x8f')](),_0x33632b);})['then'](function(_0x50caff){if(_0x50caff[_0x5be8('0x3d')]>0x0)_0x1aef03[_0x5be8('0x41')](_0x5be8('0xb3'),_[_0x5be8('0x20')](_0x50caff,'id'));return db[_0x5be8('0x8e')][_0x5be8('0x38')](_0x1aef03[_0x5be8('0x8f')](),_0x33632b)[_0x5be8('0x19')](function(_0x5dfa9d){var _0x29ee5c=_[_0x5be8('0xb4')](_0x5dfa9d,_0x5be8('0xb5'));var _0xbc74f1=[];return db[_0x5be8('0xb6')]['findOne']({'attributes':[_0x5be8('0xb7')],'raw':!![]})[_0x5be8('0x19')](function(_0x3fd77b){var _0x3bfb9c=_0x3fd77b[_0x5be8('0xb7')];_0x50caff['forEach'](function(_0x57cb26){_0xbc74f1['push'](updateMailInteraction(_0x57cb26,_0x19f31a,_0x29ee5c,_0x3bfb9c));});return BPromise[_0x5be8('0xb8')](_0xbc74f1);});});});})['then'](function(_0x2cb38e){_0x2257e7['rows']=_0x2cb38e;return _0x2257e7;})['then'](respondWithFilteredResult(_0x12a2f0,_0x466a85))[_0x5be8('0x2b')](handleError(_0x12a2f0,null));};exports[_0x5be8('0xb9')]=function(_0x558a0b,_0xa5c764){var _0x3e525a={'raw':![],'where':{'id':_0x558a0b[_0x5be8('0xba')]['id']}},_0x51d553={};_0x51d553[_0x5be8('0x37')]=_[_0x5be8('0xbb')](db[_0x5be8('0x91')][_0x5be8('0x34')]);_0x51d553['query']=_['keys'](_0x558a0b[_0x5be8('0x38')]);_0x51d553[_0x5be8('0x39')]=_[_0x5be8('0x3a')](_0x51d553[_0x5be8('0x37')],_0x51d553['query']);_0x3e525a['attributes']=_['intersection'](_0x51d553[_0x5be8('0x37')],qs['fields'](_0x558a0b[_0x5be8('0x38')][_0x5be8('0x3c')]));_0x3e525a[_0x5be8('0x3b')]=_0x3e525a[_0x5be8('0x3b')][_0x5be8('0x3d')]?_0x3e525a['attributes']:_0x51d553[_0x5be8('0x37')];if(_0x558a0b[_0x5be8('0x38')][_0x5be8('0xbc')]){_0x3e525a[_0x5be8('0xbd')]=[{'all':!![]}];}_0x3e525a=_[_0x5be8('0x90')]({},_0x3e525a,_0x558a0b[_0x5be8('0xbe')]);return db[_0x5be8('0x91')][_0x5be8('0x58')](_0x3e525a)['then'](handleEntityNotFound(_0xa5c764,null))['then'](respondWithResult(_0xa5c764,null))[_0x5be8('0x2b')](handleError(_0xa5c764,null));};exports[_0x5be8('0xbf')]=function(_0x48958a,_0x23bcd9){return db[_0x5be8('0x91')][_0x5be8('0xbf')](_0x48958a[_0x5be8('0xc0')],{})[_0x5be8('0x19')](respondWithResult(_0x23bcd9,0xc9))[_0x5be8('0x2b')](handleError(_0x23bcd9,null));};exports[_0x5be8('0x18')]=function(_0x4c5015,_0x297443){if(_0x4c5015[_0x5be8('0xc0')]['id']){delete _0x4c5015[_0x5be8('0xc0')]['id'];}return db[_0x5be8('0x91')][_0x5be8('0x58')]({'where':{'id':_0x4c5015[_0x5be8('0xba')]['id']}})['then'](handleEntityNotFound(_0x297443,null))[_0x5be8('0x19')](saveUpdates(_0x4c5015[_0x5be8('0xc0')],null))[_0x5be8('0x19')](respondWithResult(_0x297443,null))['catch'](handleError(_0x297443,null));};exports[_0x5be8('0x1a')]=function(_0x3ce1d9,_0x230128){return db[_0x5be8('0x91')]['find']({'where':{'id':_0x3ce1d9[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x230128,null))['then'](removeEntity(_0x230128,null))['catch'](handleError(_0x230128,null));};exports['describe']=function(_0x5cba64,_0x203cc5){return db[_0x5be8('0x91')]['describe']()[_0x5be8('0x19')](respondWithResult(_0x203cc5,null))['catch'](handleError(_0x203cc5,null));};exports[_0x5be8('0xc1')]=function(_0x41c350,_0x21168f){return db[_0x5be8('0xc2')]['find']({'where':{'id':_0x41c350[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x21168f,null))[_0x5be8('0x19')](function(_0x196b59){if(_0x196b59){return _0x196b59['addMessage'](_0x41c350[_0x5be8('0xc0')][_0x5be8('0xc3')],_['omit'](_0x41c350[_0x5be8('0xc0')],['ids','id'])||{});}})[_0x5be8('0x19')](respondWithResult(_0x21168f,null))['catch'](handleError(_0x21168f,null));};exports['getMessages']=function(_0x5e5eb6,_0x2ba20b){var _0x42d8a2={'raw':![],'where':{}};var _0x551d1b={};var _0x1db14a={'count':0x0,'rows':[]};return db[_0x5be8('0x91')][_0x5be8('0x26')]({'where':{'id':_0x5e5eb6[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x2ba20b,null))[_0x5be8('0x19')](function(_0x48c2bf){if(_0x48c2bf){_0x551d1b[_0x5be8('0x37')]=_[_0x5be8('0xbb')](db[_0x5be8('0xc2')]['rawAttributes']);_0x551d1b[_0x5be8('0x38')]=_[_0x5be8('0xbb')](_0x5e5eb6['query']);_0x551d1b[_0x5be8('0x39')]=_[_0x5be8('0x3a')](_0x551d1b[_0x5be8('0x37')],_0x551d1b[_0x5be8('0x38')]);_0x42d8a2['attributes']=_[_0x5be8('0x3a')](_0x551d1b[_0x5be8('0x37')],qs['fields'](_0x5e5eb6[_0x5be8('0x38')]['fields']));_0x42d8a2[_0x5be8('0x3b')]=_0x42d8a2[_0x5be8('0x3b')][_0x5be8('0x3d')]?_0x42d8a2['attributes']:_0x551d1b[_0x5be8('0x37')];if(!_0x5e5eb6[_0x5be8('0x38')]['hasOwnProperty'](_0x5be8('0x3f'))){_0x42d8a2[_0x5be8('0x15')]=qs[_0x5be8('0x15')](_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x15')]);_0x42d8a2[_0x5be8('0x13')]=qs['offset'](_0x5e5eb6['query'][_0x5be8('0x13')]);}_0x42d8a2[_0x5be8('0x83')]=qs[_0x5be8('0x40')](_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x40')]);_0x42d8a2[_0x5be8('0x41')]=qs[_0x5be8('0x39')](_[_0x5be8('0xc4')](_0x5e5eb6[_0x5be8('0x38')],_0x551d1b[_0x5be8('0x39')]));_0x42d8a2[_0x5be8('0x41')][_0x5be8('0xb5')]=_0x48c2bf['id'];if(_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x79')]){_0x42d8a2[_0x5be8('0x41')]=_[_0x5be8('0x90')](_0x42d8a2['where'],{'$or':_[_0x5be8('0x20')](_0x42d8a2[_0x5be8('0x3b')],function(_0x312250){var _0x401a37={};_0x401a37[_0x312250]={'$like':'%'+_0x5e5eb6[_0x5be8('0x38')]['filter']+'%'};return _0x401a37;})});}if(_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x71')]){var _0x487603=_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0x71')][_0x5be8('0x67')](',');var _0x28c8b6={};_0x28c8b6[_0x487603[0x0]]={'$gte':moment(_0x487603[0x1])['format'](_0x5be8('0xc5'))};_0x42d8a2['where']=_[_0x5be8('0x90')](_0x42d8a2[_0x5be8('0x41')],_0x28c8b6);}_0x42d8a2=_[_0x5be8('0x90')]({},_0x42d8a2,_0x5e5eb6['options']);return db['MailMessage'][_0x5be8('0x16')]({'where':_0x42d8a2[_0x5be8('0x41')]})[_0x5be8('0x19')](function(_0x19a6d0){_0x1db14a[_0x5be8('0x16')]=_0x19a6d0;if(_0x5e5eb6[_0x5be8('0x38')][_0x5be8('0xbc')]){_0x42d8a2['include']=[{'all':!![]}];}return db[_0x5be8('0xc2')][_0x5be8('0xc6')](_0x42d8a2);})[_0x5be8('0x19')](function(_0x3d08f3){if(_0x5e5eb6['query'][_0x5be8('0xc7')]===_0x5be8('0xc8')){for(var _0x4c21ef=0x0;_0x4c21ef<_0x3d08f3[_0x5be8('0x3d')];_0x4c21ef++){_0x3d08f3[_0x4c21ef][_0x5be8('0xc0')]=juice(_0x3d08f3[_0x4c21ef][_0x5be8('0xc0')]);}}_0x1db14a[_0x5be8('0xc9')]=_0x3d08f3;return _0x1db14a;});}})['then'](respondWithFilteredResult(_0x2ba20b,_0x42d8a2))[_0x5be8('0x2b')](handleError(_0x2ba20b,null));};exports[_0x5be8('0xca')]=function(_0x445ccb,_0x5219a1){return db[_0x5be8('0x91')][_0x5be8('0x58')]({'where':{'id':_0x445ccb[_0x5be8('0xba')]['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x5219a1,null))[_0x5be8('0x19')](function(_0xc623f2){if(_0xc623f2){return _0xc623f2[_0x5be8('0xcb')](_0x445ccb[_0x5be8('0xc0')][_0x5be8('0xc3')],_['omit'](_0x445ccb[_0x5be8('0xc0')],[_0x5be8('0xc3'),'id'])||{})[_0x5be8('0xcc')](function(){return db[_0x5be8('0x66')][_0x5be8('0xc6')]({'attributes':['id',_0x5be8('0x1e'),_0x5be8('0x44')],'where':{'id':_0x445ccb['body']['ids']}});})[_0x5be8('0x19')](function(_0x5a8871){socket[_0x5be8('0xcd')](_0x5be8('0xce'),{'id':Number(_0x445ccb[_0x5be8('0xba')]['id']),'tags':_0x5a8871||[]});return{'id':Number(_0x445ccb[_0x5be8('0xba')]['id']),'tags':_0x5a8871||[]};});}})['then'](respondWithResult(_0x5219a1,null))[_0x5be8('0x2b')](handleError(_0x5219a1,null));};exports['removeTags']=function(_0x1f6738,_0x3ab40b){return db[_0x5be8('0x91')][_0x5be8('0x58')]({'where':{'id':_0x1f6738['params']['id']}})[_0x5be8('0x19')](handleEntityNotFound(_0x3ab40b,null))['then'](function(_0x5287e9){if(_0x5287e9){return _0x5287e9[_0x5be8('0xcf')](_0x1f6738[_0x5be8('0x38')][_0x5be8('0xc3')]);}})[_0x5be8('0x19')](respondWithStatusCode(_0x3ab40b,null))[_0x5be8('0x2b')](handleError(_0x3ab40b,null));};exports[_0x5be8('0xd0')]=function(_0x385097,_0xe17932){var _0x25b312=moment()[_0x5be8('0xd1')]()[_0x5be8('0x8f')]();var _0xbee289=path[_0x5be8('0xd2')](config[_0x5be8('0xd3')],_0x5be8('0xd4'),_0x5be8('0xd5'),'tmp');var _0x26f6d4=path['join'](config[_0x5be8('0xd3')],'server',_0x5be8('0xd5'),_0x5be8('0xd6'));var _0x1c6acb=path['join'](_0xbee289,_0x25b312);var _0x308e6=util[_0x5be8('0xd7')](_0x5be8('0xd8'),_0x385097[_0x5be8('0xba')]['id'],_0x25b312);var _0x59d341=path[_0x5be8('0xd2')](_0xbee289,_0x308e6);var _0x25b06b=[];if(_0x385097['query'][_0x5be8('0xd6')]){_0x25b06b[_0x5be8('0x25')]({'model':db[_0x5be8('0xd9')],'as':_0x5be8('0xda'),'raw':!![]});}var _0x29a4b3=[{'model':db[_0x5be8('0xc2')],'as':_0x5be8('0xdb'),'attributes':['id',_0x5be8('0xc0'),_0x5be8('0x45'),'to','cc',_0x5be8('0xdc'),_0x5be8('0xdd'),'createdAt'],'where':{'secret':![]},'order':qs[_0x5be8('0x40')]('id'),'include':_0x25b06b}];return db['MailInteraction'][_0x5be8('0x58')]({'where':{'id':_0x385097[_0x5be8('0xba')]['id']},'include':_0x29a4b3})[_0x5be8('0x19')](handleEntityNotFound(_0xe17932,null))[_0x5be8('0x19')](function(_0x4c7e58){if(_0x4c7e58&&_0x4c7e58['Messages']){var _0x2f2d40=_0x4c7e58[_0x5be8('0xde')]({'plain':!![]});fs[_0x5be8('0xdf')](_0x1c6acb);return BPromise[_0x5be8('0xe0')](_0x2f2d40[_0x5be8('0xdb')],function(_0x12c6af,_0x5aef86){var _0xc04f9c={'from':_0x12c6af[_0x5be8('0x45')],'to':_0x12c6af['to'],'subject':_0x12c6af[_0x5be8('0xdd')],'html':htmlEntities[_0x5be8('0xe1')](_0x12c6af[_0x5be8('0xc0')]),'headers':{'Date':moment(_0x12c6af[_0x5be8('0xe2')])['format'](_0x5be8('0xe3'))},'attachments':[]};if(_0x12c6af['cc']){_0xc04f9c[_0x5be8('0xe4')]['Cc']=_0x12c6af['cc'];}if(_0x12c6af[_0x5be8('0xdc')]){_0xc04f9c['headers'][_0x5be8('0xe5')]=_0x12c6af[_0x5be8('0xdc')];}return new BPromise(function(_0x11fa4b,_0x19df74){if(_0x12c6af[_0x5be8('0xda')]){for(var _0x490ad6=0x0;_0x490ad6<_0x12c6af[_0x5be8('0xda')]['length'];_0x490ad6++){var _0x3f63cc=_0x12c6af[_0x5be8('0xda')][_0x490ad6];var _0x16c5d5=path['join'](_0x26f6d4,_0x3f63cc[_0x5be8('0xe6')]);if(fs[_0x5be8('0xe7')](_0x16c5d5)){_0xc04f9c[_0x5be8('0xd6')][_0x5be8('0x25')]({'name':_0x3f63cc[_0x5be8('0x1e')],'contentType':_0x3f63cc['type'],'data':fs[_0x5be8('0xe8')](_0x16c5d5)});}}}emlformat['build'](_0xc04f9c,function(_0x575caf,_0x3525c0){if(_0x575caf)return _0x19df74(_0x575caf);fs[_0x5be8('0xe9')](path[_0x5be8('0xd2')](_0x1c6acb,util[_0x5be8('0xd7')](_0x5be8('0xea'),_0x5aef86)),_0x3525c0);return _0x11fa4b(_0x3525c0);});});})[_0x5be8('0x19')](function(){return new BPromise(function(_0x2cb61a,_0x4eb987){zipdir(_0x1c6acb,{'saveTo':_0x59d341},function(_0x9c9a3c,_0x5e540a){if(_0x9c9a3c)return _0x4eb987(_0x9c9a3c);return _0x2cb61a(_0x5e540a);});})['then'](function(){return new BPromise(function(_0x5ef69f,_0x13a092){rimraf(_0x1c6acb,function(_0x508591){if(_0x508591)_0x13a092(_0x508591);return _0x5ef69f();});});})[_0x5be8('0x19')](function(){return _0xe17932[_0x5be8('0xd0')](_0x59d341,_0x308e6,function(_0x2433e0){if(!_0x2433e0)fs[_0x5be8('0xeb')](_0x59d341);});});});}else{return _0xe17932[_0x5be8('0x1b')](0xc8);}})['catch'](handleError(_0xe17932,null));}; \ No newline at end of file +var _0x6bac=['transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','attachments','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','localhost','./mailInteraction.socket','register','status','end','offset','undefined','limit','count','json','update','destroy','then','name','Users','fullname','TagIds','split','forEach','Tags','push','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','talking','answered','total','UserId','waiting','closed','unmanaged','MailInteraction','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','field','from','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','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?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','keys','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SELECT','order','contactName','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.UserId','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','rows','show','includeAll','include','create','body','params','describe','addMessage','MailMessage','ids','omit','getMessages','MailInteractionId','format','inlineCss','addTags','spread','findAll','color','mailInteractionTags:save','removeTags','unix','server','join','root','files'];(function(_0x9b46b9,_0x3f6df3){var _0x898d24=function(_0x2d9e48){while(--_0x2d9e48){_0x9b46b9['push'](_0x9b46b9['shift']());}};_0x898d24(++_0x3f6df3);}(_0x6bac,0xf1));var _0xc6ba=function(_0x5a8351,_0x39a736){_0x5a8351=_0x5a8351-0x0;var _0x5166ba=_0x6bac[_0x5a8351];return _0x5166ba;};'use strict';var emlformat=require(_0xc6ba('0x0'));var rimraf=require(_0xc6ba('0x1'));var zipdir=require('zip-dir');var moment=require(_0xc6ba('0x2'));var BPromise=require('bluebird');var util=require(_0xc6ba('0x3'));var path=require(_0xc6ba('0x4'));var fs=require('fs');var _=require(_0xc6ba('0x5'));var squel=require(_0xc6ba('0x6'));var juice=require('juice');var Redis=require(_0xc6ba('0x7'));var qs=require(_0xc6ba('0x8'));var as=require(_0xc6ba('0x9'));var logger=require('../../config/logger')(_0xc6ba('0xa'));var config=require(_0xc6ba('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0xc6ba('0xc')]=_['defaults'](config[_0xc6ba('0xc')],{'host':_0xc6ba('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc6ba('0xe'))[_0xc6ba('0xf')](socket);function respondWithStatusCode(_0x4ca215,_0x209eb0){_0x209eb0=_0x209eb0||0xcc;return function(_0x562e5b){if(_0x562e5b){return _0x4ca215['sendStatus'](_0x209eb0);}return _0x4ca215[_0xc6ba('0x10')](_0x209eb0)[_0xc6ba('0x11')]();};}function respondWithResult(_0x23f232,_0x294479){_0x294479=_0x294479||0xc8;return function(_0x2450d9){if(_0x2450d9){return _0x23f232[_0xc6ba('0x10')](_0x294479)['json'](_0x2450d9);}};}function respondWithFilteredResult(_0x1790d1,_0x85f881){return function(_0x42da5f){if(_0x42da5f){var _0x3262f2=typeof _0x85f881[_0xc6ba('0x12')]===_0xc6ba('0x13')&&typeof _0x85f881[_0xc6ba('0x14')]===_0xc6ba('0x13');var _0x77c71d=_0x42da5f['count'];var _0x173a66=_0x3262f2?0x0:_0x85f881[_0xc6ba('0x12')];var _0x52b308=_0x3262f2?_0x42da5f[_0xc6ba('0x15')]:_0x85f881[_0xc6ba('0x12')]+_0x85f881[_0xc6ba('0x14')];var _0x173e31;if(_0x52b308>=_0x77c71d){_0x52b308=_0x77c71d;_0x173e31=0xc8;}else{_0x173e31=0xce;}_0x1790d1['status'](_0x173e31);return _0x1790d1['set']('Content-Range',_0x173a66+'-'+_0x52b308+'/'+_0x77c71d)[_0xc6ba('0x16')](_0x42da5f);}return null;};}function saveUpdates(_0x2e9a96){return function(_0x2bd237){if(_0x2bd237){return _0x2bd237[_0xc6ba('0x17')](_0x2e9a96)['then'](function(_0x2f4cfd){return _0x2f4cfd;});}return null;};}function removeEntity(_0x576f8a){return function(_0x102f54){if(_0x102f54){return _0x102f54[_0xc6ba('0x18')]()[_0xc6ba('0x19')](function(){_0x576f8a[_0xc6ba('0x10')](0xcc)[_0xc6ba('0x11')]();});}};}function handleEntityNotFound(_0x527658){return function(_0x4c2a84){if(!_0x4c2a84){_0x527658['sendStatus'](0x194);}return _0x4c2a84;};}function handleError(_0x3a65dc,_0x5567fe){_0x5567fe=_0x5567fe||0x1f4;return function(_0x1bbb7a){logger['error'](_0x1bbb7a['stack']);if(_0x1bbb7a[_0xc6ba('0x1a')]){delete _0x1bbb7a[_0xc6ba('0x1a')];}_0x3a65dc[_0xc6ba('0x10')](_0x5567fe)['send'](_0x1bbb7a);};}function getInteractionUsers(_0x4d68f0,_0xbd14c7){return new BPromise(function(_0x2c61bc,_0x2ba99e){try{if(_0xbd14c7[_0x4d68f0['id']]){_0x4d68f0[_0xc6ba('0x1b')]=_['map'](_0xbd14c7[_0x4d68f0['id']],function(_0x4eb951){return{'id':_0x4eb951['id'],'fullname':_0x4eb951[_0xc6ba('0x1c')]};});}}catch(_0x4b2157){_0x2ba99e(_0x4b2157);}_0x2c61bc(_0x4d68f0);});}function getInteractionTags(_0xd30dce,_0x26ed02){return new BPromise(function(_0x459033,_0x4ee003){try{if(_0xd30dce[_0xc6ba('0x1d')]){_0xd30dce['Tags']=[];_0xd30dce[_0xc6ba('0x1d')][_0xc6ba('0x1e')](',')[_0xc6ba('0x1f')](function(_0x98e6d2){_0xd30dce[_0xc6ba('0x20')][_0xc6ba('0x21')](_0x26ed02[_0x98e6d2]);});}delete _0xd30dce[_0xc6ba('0x1d')];}catch(_0xc952da){_0x4ee003(_0xc952da);}_0x459033(_0xd30dce);});}function getLastMessageText(_0x3916d9){return new BPromise(function(_0x569329,_0x55c737){return db['MailMessage'][_0xc6ba('0x22')]({'where':{'$and':[{'MailInteractionId':_0x3916d9['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xc6ba('0x23')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xc6ba('0x24'),'raw':!![]})[_0xc6ba('0x19')](function(_0x2460c4){if(_0x2460c4&&_0x2460c4[_0xc6ba('0x25')]){_0x3916d9[_0xc6ba('0x26')]=_[_0xc6ba('0x27')](_0x2460c4[_0xc6ba('0x25')]);}_0x569329(_0x3916d9);})[_0xc6ba('0x28')](function(_0x20665c){_0x55c737(_0x20665c);});});}function updateMailInteraction(_0x274cd4,_0x2c55c3,_0x152e90,_0x29538c){return new BPromise(function(_0x5d9282,_0x1c0b68){return getInteractionUsers(_0x274cd4,_0x152e90)[_0xc6ba('0x19')](function(_0x2431f9){return getInteractionTags(_0x2431f9,_0x2c55c3);})[_0xc6ba('0x19')](function(_0x438b59){return getStateInteraction(_0x438b59);})['then'](function(_0x4ed8af){if(_0x29538c){_0x5d9282(getLastMessageText(_0x4ed8af));}else{_0x5d9282(_0x4ed8af);}})['catch'](function(_0x2939c1){_0x1c0b68(_0x2939c1);});});}function getStateInteraction(_0x198de6){return new BPromise(function(_0x8bc3b5){_0x198de6['waiting']=0x0;_0x198de6[_0xc6ba('0x29')]=0x0;_0x198de6[_0xc6ba('0x2a')]=0x0;_0x198de6['unmanaged']=0x0;_0x198de6[_0xc6ba('0x2b')]=0x0;if(!_0x198de6['closed']&&!_0x198de6[_0xc6ba('0x2c')]){_0x198de6[_0xc6ba('0x2d')]+=0x1;}if(!_0x198de6[_0xc6ba('0x2e')]&&_0x198de6['UserId']){_0x198de6[_0xc6ba('0x29')]+=0x1;if(_0x198de6[_0xc6ba('0x2d')]){_0x198de6['waiting']-=0x1;}}if(_0x198de6['closed']&&_0x198de6[_0xc6ba('0x2c')]){_0x198de6['answered']+=0x1;if(_0x198de6[_0xc6ba('0x29')]){_0x198de6[_0xc6ba('0x29')]-=0x1;}}if(_0x198de6[_0xc6ba('0x2e')]&&!_0x198de6['UserId']){_0x198de6[_0xc6ba('0x2f')]+=0x1;if(_0x198de6['waiting']){_0x198de6[_0xc6ba('0x2d')]-=0x1;}}_0x198de6[_0xc6ba('0x2b')]+=0x1;_0x8bc3b5(_0x198de6);});}exports['index']=function(_0x46d01f,_0x29ef15){var _0x4cce75={},_0x19dfe4={},_0x1d5f65={'count':0x0,'rows':[]};var _0x52077c=_['map'](db[_0xc6ba('0x30')][_0xc6ba('0x31')],function(_0x3b23af){return{'name':_0x3b23af[_0xc6ba('0x32')],'type':_0x3b23af[_0xc6ba('0x33')][_0xc6ba('0x34')]};});_0x19dfe4[_0xc6ba('0x35')]=_[_0xc6ba('0x36')](_0x52077c,_0xc6ba('0x1a'));_0x19dfe4[_0xc6ba('0x37')]=_['keys'](_0x46d01f[_0xc6ba('0x37')]);_0x19dfe4[_0xc6ba('0x38')]=_['intersection'](_0x19dfe4[_0xc6ba('0x35')],_0x19dfe4[_0xc6ba('0x37')]);_0x4cce75[_0xc6ba('0x39')]=_[_0xc6ba('0x3a')](_0x19dfe4['model'],qs[_0xc6ba('0x3b')](_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x3b')]));_0x4cce75[_0xc6ba('0x39')]=_0x4cce75['attributes'][_0xc6ba('0x3c')]?_0x4cce75[_0xc6ba('0x39')]:_0x19dfe4[_0xc6ba('0x35')];if(!_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x3d')](_0xc6ba('0x3e'))){_0x4cce75[_0xc6ba('0x14')]=qs[_0xc6ba('0x14')](_0x46d01f['query'][_0xc6ba('0x14')]);_0x4cce75['offset']=qs[_0xc6ba('0x12')](_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x12')]);}_0x4cce75['order']=qs[_0xc6ba('0x3f')](_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x3f')]);_0x4cce75['where']=qs[_0xc6ba('0x38')](_[_0xc6ba('0x40')](_0x46d01f['query'],_0x19dfe4[_0xc6ba('0x38')]),_0x52077c);var _0x44d20f=[];var _0x47c7fd=squel['select']()[_0xc6ba('0x41')]('id')[_0xc6ba('0x41')]('name')[_0xc6ba('0x41')]('color')[_0xc6ba('0x42')]('tools_tags');var _0x3120d8=squel['select']()[_0xc6ba('0x41')](_0xc6ba('0x43'))[_0xc6ba('0x41')]('u.fullname')[_0xc6ba('0x41')](_0xc6ba('0x44'))[_0xc6ba('0x42')](_0xc6ba('0x45'),'ui')[_0xc6ba('0x46')]('users','u',_0xc6ba('0x47'));var _0x45c567=squel['select']()[_0xc6ba('0x42')]('mail_interactions','i')[_0xc6ba('0x46')](_0xc6ba('0x48'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xc6ba('0x46')]('users','o',_0xc6ba('0x49'))[_0xc6ba('0x46')](_0xc6ba('0x4a'),'a',_0xc6ba('0x4b'))[_0xc6ba('0x46')](_0xc6ba('0x4c'),'me',_0xc6ba('0x4d'))[_0xc6ba('0x46')](_0xc6ba('0x4e'),'it',_0xc6ba('0x4f'))[_0xc6ba('0x46')]('tools_tags','t',_0xc6ba('0x50'));var _0x2a0d8b=squel[_0xc6ba('0x51')]();var _0x11cf9b=[];var _0x5f771e=squel[_0xc6ba('0x51')]();var _0x4dcf7e;if(_0x46d01f[_0xc6ba('0x37')]['search']){_0x4dcf7e=as['parseSearch'](_0x46d01f[_0xc6ba('0x37')]['search']);var _0x4211f3=_0x4dcf7e[_0xc6ba('0x52')];for(var _0x12a5e7=0x0;_0x12a5e7<_0x4dcf7e[_0xc6ba('0x53')]['length'];_0x12a5e7++){var _0x559d37=_0x4dcf7e[_0xc6ba('0x53')][_0x12a5e7];var _0x48ab9b='i';var _0x53864d=_['find'](_0x52077c,[_0xc6ba('0x1a'),_0x559d37[_0xc6ba('0x41')]]);if(!_0x53864d){switch(_0x559d37[_0xc6ba('0x41')]){case _0xc6ba('0x54'):if(_0x559d37[_0xc6ba('0x55')]==0x1){_0x45c567[_0xc6ba('0x56')]('`'+_0x559d37[_0xc6ba('0x41')]+_0xc6ba('0x57'));}else{_0x45c567[_0xc6ba('0x56')]('`'+_0x559d37[_0xc6ba('0x41')]+'`\x20>\x200');}break;case _0xc6ba('0x58'):if(_0x559d37[_0xc6ba('0x59')]===_0xc6ba('0x5a')){if(_0x559d37[_0xc6ba('0x55')]['split']('\x20')['length']>0x1){_0x2a0d8b[_0x4211f3](_0xc6ba('0x5b'),qs[_0xc6ba('0x5c')](_0x559d37[_0xc6ba('0x55')]),null);}else{var _0x450a32='%'+_0x559d37[_0xc6ba('0x55')]+'%';_0x2a0d8b[_0x4211f3](_0xc6ba('0x5d'),_0x450a32,_0x450a32,_0x450a32);}}else{_0x53864d=_[_0xc6ba('0x5e')](_0x52077c,['name',_0xc6ba('0x5f')]);_0x559d37['field']=_0xc6ba('0x5f');_0x37f009=as['buildExpression'](_0x48ab9b,_0x53864d[_0xc6ba('0x33')],_0x559d37);_0x2a0d8b[_0x4211f3](_0x37f009[_0xc6ba('0x60')],_0x37f009[_0xc6ba('0x55')][_0xc6ba('0x61')],_0x37f009[_0xc6ba('0x55')][_0xc6ba('0x11')]);}break;case _0xc6ba('0x62'):var _0x5a94b0=_0x559d37[_0xc6ba('0x55')]['split'](',')['map'](function(_0x198da4){return Number(_0x198da4);});_0x5a94b0[_0xc6ba('0x1f')](function(_0x1684ae){_0x5f771e['or'](_0xc6ba('0x63'),'%,'+_0x1684ae+',%');});_0x11cf9b=_[_0xc6ba('0x64')](_0x11cf9b,_0x5a94b0);break;case _0xc6ba('0x65'):if(_0x559d37[_0xc6ba('0x59')]==='$substring'){_0x2a0d8b[_0x4211f3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x559d37['value']+'%',null);}else{_0x53864d=_['find'](_0x52077c,[_0xc6ba('0x1a'),_0xc6ba('0x2c')]);_0x559d37['field']='UserId';_0x37f009=as[_0xc6ba('0x66')](_0x48ab9b,_0x53864d[_0xc6ba('0x33')],_0x559d37);_0x2a0d8b[_0x4211f3](_0x37f009[_0xc6ba('0x60')],_0x37f009['value'][_0xc6ba('0x61')],_0x37f009[_0xc6ba('0x55')][_0xc6ba('0x11')]);}break;case _0xc6ba('0x25'):_0x37f009=as['buildExpression']('me',null,_0x559d37);_0x2a0d8b[_0x4211f3](_0x37f009[_0xc6ba('0x60')],_0x37f009[_0xc6ba('0x55')][_0xc6ba('0x61')],_0x37f009['value'][_0xc6ba('0x11')]);break;}}else{var _0x37f009=as[_0xc6ba('0x66')](_0x48ab9b,_0x53864d['type'],_0x559d37);_0x2a0d8b[_0x4211f3](_0x37f009['text'],_0x37f009[_0xc6ba('0x55')]['start'],_0x37f009[_0xc6ba('0x55')][_0xc6ba('0x11')]);}}}else{var _0xaaa750=_(_0x46d01f[_0xc6ba('0x37')])[_0xc6ba('0x67')]()[_0xc6ba('0x36')](function(_0x41610c){return _[_0xc6ba('0x68')](_0x52077c,['name',_0x41610c])?_0x41610c:undefined;})[_0xc6ba('0x69')]()[_0xc6ba('0x55')]();if(!_[_0xc6ba('0x6a')](_0xaaa750)){_0xaaa750[_0xc6ba('0x1f')](function(_0x3e08e9){if(_0x3e08e9===_0xc6ba('0x6b')){_0x45c567[_0xc6ba('0x6c')](_0xc6ba('0x6d'),[][_0xc6ba('0x6e')](_0x46d01f[_0xc6ba('0x37')][_0x3e08e9]));}else if(_0x3e08e9===_0xc6ba('0x6f')){var _0x5cc819=JSON[_0xc6ba('0x70')](_0x46d01f[_0xc6ba('0x37')][_0x3e08e9])[_0xc6ba('0x71')];var _0x230a74=JSON['parse'](_0x46d01f[_0xc6ba('0x37')][_0x3e08e9])[_0xc6ba('0x72')];_0x45c567[_0xc6ba('0x6c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5cc819,_0x230a74);}else{if(_0x46d01f[_0xc6ba('0x37')][_0x3e08e9]===_0xc6ba('0x73')){_0x45c567['where']('i.'+_0x3e08e9+_0xc6ba('0x74'));}else{_0x45c567[_0xc6ba('0x6c')]('i.'+_0x3e08e9+_0xc6ba('0x75'),_0x46d01f[_0xc6ba('0x37')][_0x3e08e9]);}}});}if(_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x76')]){if(_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x76')]==0x1){_0x45c567[_0xc6ba('0x56')](_0xc6ba('0x77'));}else{_0x45c567[_0xc6ba('0x56')](_0xc6ba('0x78'));}}if(_0x46d01f['query'][_0xc6ba('0x79')]){_0x11cf9b=_[_0xc6ba('0x7a')](_0x46d01f[_0xc6ba('0x37')]['tag'])?_0x46d01f[_0xc6ba('0x37')]['tag']:new Array(_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x79')]);_0x11cf9b[_0xc6ba('0x1f')](function(_0x315a28){_0x5f771e['or'](_0xc6ba('0x63'),'%,'+_0x315a28+',%');});}if(_0x46d01f[_0xc6ba('0x37')]['filter']){var _0x3c2b8d=_0x46d01f[_0xc6ba('0x37')][_0xc6ba('0x7b')][_0xc6ba('0x7c')]('\x5c','\x5c\x5c')[_0xc6ba('0x7c')](/'/g,'\x27\x27');if(qs[_0xc6ba('0x7d')](_0x3c2b8d)){_0x2a0d8b['or']('i.id\x20LIKE\x20?',_0x3c2b8d+'%');}else if(qs[_0xc6ba('0x7e')](_0x3c2b8d)){_0x2a0d8b['or']('c.email\x20LIKE\x20?',_0x3c2b8d+'%');}else{_0x2a0d8b['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc6ba('0x5c')](_0x3c2b8d))['or'](_0xc6ba('0x7f'),qs[_0xc6ba('0x5c')](_0x3c2b8d));}}}_0x45c567['where'](_0x2a0d8b);_0x45c567['group'](_0xc6ba('0x80'));var _0x1a373e={'type':db['Sequelize'][_0xc6ba('0x81')][_0xc6ba('0x82')],'raw':!![]};var _0x35a119=_0x45c567['clone']();_0x35a119[_0xc6ba('0x41')](_0xc6ba('0x80'));_0x35a119['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc6ba('0x54'));if(_0x4cce75[_0xc6ba('0x83')]){_0x4cce75['order'][_0xc6ba('0x1f')](function(_0x1248c5){var _0x5b7597=_0x1248c5[0x0]===_0xc6ba('0x84')?_0x1248c5[0x0]:'i.'+_0x1248c5[0x0];_0x45c567[_0xc6ba('0x83')](_0x5b7597,_0x1248c5[0x1]===_0xc6ba('0x85')?![]:!![]);});}if(!_['isEmpty'](_0x11cf9b)){_0x45c567['having'](_0x5f771e);_0x35a119['where']('t.id\x20IN\x20?',_0x11cf9b);}BPromise[_0xc6ba('0x86')]()[_0xc6ba('0x19')](function(){if(!_0x4dcf7e){if(_0x46d01f['query']['MailAccountId'])return;_0x35a119['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x45c567[_0xc6ba('0x6c')](_0xc6ba('0x87'));return;}if(_0x46d01f[_0xc6ba('0x88')][_0xc6ba('0x89')]!==_0xc6ba('0x8a'))return;return _0x46d01f[_0xc6ba('0x88')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xc6ba('0x19')](function(_0x4fd40f){if(_[_0xc6ba('0x6a')](_0x4fd40f)){_0x35a119[_0xc6ba('0x6c')](_0xc6ba('0x8b'));_0x45c567[_0xc6ba('0x6c')]('i.MailAccountId\x20IS\x20NULL');}else{_0x35a119['where'](_0xc6ba('0x6d'),_[_0xc6ba('0x36')](_0x4fd40f,'id'));_0x45c567[_0xc6ba('0x6c')](_0xc6ba('0x6d'),_[_0xc6ba('0x36')](_0x4fd40f,'id'));}});})[_0xc6ba('0x19')](function(){if(_0x46d01f[_0xc6ba('0x88')][_0xc6ba('0x89')]===_0xc6ba('0x8a')&&!_0x4dcf7e&&!_0x46d01f[_0xc6ba('0x37')]['MailAccountId'])return[];return db['sequelize']['query'](_0x35a119['toString'](),_0x1a373e);})[_0xc6ba('0x19')](function(_0x342a85){_0x1d5f65['count']=_0x342a85[_0xc6ba('0x3c')];if(_0x1d5f65['count']===0x0)return[];return db[_0xc6ba('0x8c')][_0xc6ba('0x37')](_0x47c7fd[_0xc6ba('0x8d')](),_0x1a373e)['then'](function(_0x11952b){_0x44d20f=_[_0xc6ba('0x8e')](_0x11952b,'id');_0x1a373e=_[_0xc6ba('0x8f')](_0x1a373e,{'model':db[_0xc6ba('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46d01f['query'][_0xc6ba('0x3b')]){_0x4cce75['attributes'][_0xc6ba('0x1f')](function(_0x3011f6){_0x45c567[_0xc6ba('0x41')]('i.'+_0x3011f6);});}else{_0x45c567['field'](_0xc6ba('0x90'),_0xc6ba('0x54'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x91'),'Account.key');_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x92'),_0xc6ba('0x93'));_0x45c567[_0xc6ba('0x41')]('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');_0x45c567[_0xc6ba('0x41')]('i.id');_0x45c567['field'](_0xc6ba('0x94'));_0x45c567['field']('i.updatedAt');_0x45c567['field'](_0xc6ba('0x95'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x96'));_0x45c567['field']('i.attach');_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x97'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x98'));_0x45c567[_0xc6ba('0x41')]('i.subject');_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x99'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x9a'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x9b'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x9c'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0x9d'));_0x45c567[_0xc6ba('0x41')]('i.ContactId');_0x45c567[_0xc6ba('0x41')]('i.MailAccountId');_0x45c567['field'](_0xc6ba('0x9e'));_0x45c567[_0xc6ba('0x41')]('c.firstName',_0xc6ba('0x9f'));_0x45c567['field'](_0xc6ba('0xa0'),_0xc6ba('0xa1'));_0x45c567[_0xc6ba('0x41')]('c.email',_0xc6ba('0xa2'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0xa3'),_0xc6ba('0xa4'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0xa5'),_0xc6ba('0xa6'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0xa7'),'Contact.fax');_0x45c567[_0xc6ba('0x41')](_0xc6ba('0xa8'),_0xc6ba('0xa9'));_0x45c567['field'](_0xc6ba('0xaa'),_0xc6ba('0xab'));_0x45c567[_0xc6ba('0x41')](_0xc6ba('0xac'),'TagIds');}if(_0x4cce75[_0xc6ba('0x14')])_0x45c567[_0xc6ba('0x14')](_0x4cce75[_0xc6ba('0x14')]);if(_0x4cce75[_0xc6ba('0x12')])_0x45c567[_0xc6ba('0x12')](_0x4cce75[_0xc6ba('0x12')]);return db['sequelize'][_0xc6ba('0x37')](_0x45c567[_0xc6ba('0x8d')](),_0x1a373e);})['then'](function(_0x24d251){if(_0x24d251['length']>0x0)_0x3120d8['where']('ui.MailInteractionId\x20IN\x20?',_['map'](_0x24d251,'id'));return db[_0xc6ba('0x8c')][_0xc6ba('0x37')](_0x3120d8[_0xc6ba('0x8d')](),_0x1a373e)[_0xc6ba('0x19')](function(_0x26e520){var _0x4ba8cd=_[_0xc6ba('0xad')](_0x26e520,'MailInteractionId');var _0x3ad8a8=[];return db[_0xc6ba('0xae')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]})[_0xc6ba('0x19')](function(_0x127a23){var _0x1a9b1c=_0x127a23[_0xc6ba('0xaf')];_0x24d251[_0xc6ba('0x1f')](function(_0x3defb5){_0x3ad8a8[_0xc6ba('0x21')](updateMailInteraction(_0x3defb5,_0x44d20f,_0x4ba8cd,_0x1a9b1c));});return BPromise['all'](_0x3ad8a8);});});});})[_0xc6ba('0x19')](function(_0x4fcb8f){_0x1d5f65[_0xc6ba('0xb0')]=_0x4fcb8f;return _0x1d5f65;})[_0xc6ba('0x19')](respondWithFilteredResult(_0x29ef15,_0x4cce75))[_0xc6ba('0x28')](handleError(_0x29ef15,null));};exports[_0xc6ba('0xb1')]=function(_0x3cca8f,_0x1ce26e){var _0x4a46e9={'raw':![],'where':{'id':_0x3cca8f['params']['id']}},_0x6b7745={};_0x6b7745[_0xc6ba('0x35')]=_['keys'](db[_0xc6ba('0x30')][_0xc6ba('0x31')]);_0x6b7745['query']=_[_0xc6ba('0x67')](_0x3cca8f[_0xc6ba('0x37')]);_0x6b7745[_0xc6ba('0x38')]=_['intersection'](_0x6b7745[_0xc6ba('0x35')],_0x6b7745[_0xc6ba('0x37')]);_0x4a46e9[_0xc6ba('0x39')]=_[_0xc6ba('0x3a')](_0x6b7745[_0xc6ba('0x35')],qs['fields'](_0x3cca8f[_0xc6ba('0x37')][_0xc6ba('0x3b')]));_0x4a46e9[_0xc6ba('0x39')]=_0x4a46e9[_0xc6ba('0x39')][_0xc6ba('0x3c')]?_0x4a46e9[_0xc6ba('0x39')]:_0x6b7745[_0xc6ba('0x35')];if(_0x3cca8f[_0xc6ba('0x37')][_0xc6ba('0xb2')]){_0x4a46e9[_0xc6ba('0xb3')]=[{'all':!![]}];}_0x4a46e9=_['merge']({},_0x4a46e9,_0x3cca8f['options']);return db[_0xc6ba('0x30')][_0xc6ba('0x5e')](_0x4a46e9)[_0xc6ba('0x19')](handleEntityNotFound(_0x1ce26e,null))[_0xc6ba('0x19')](respondWithResult(_0x1ce26e,null))[_0xc6ba('0x28')](handleError(_0x1ce26e,null));};exports[_0xc6ba('0xb4')]=function(_0x13e8fc,_0x3adf82){return db[_0xc6ba('0x30')]['create'](_0x13e8fc[_0xc6ba('0xb5')],{})[_0xc6ba('0x19')](respondWithResult(_0x3adf82,0xc9))['catch'](handleError(_0x3adf82,null));};exports[_0xc6ba('0x17')]=function(_0x9a6186,_0x5f2539){if(_0x9a6186[_0xc6ba('0xb5')]['id']){delete _0x9a6186[_0xc6ba('0xb5')]['id'];}return db[_0xc6ba('0x30')]['find']({'where':{'id':_0x9a6186['params']['id']}})['then'](handleEntityNotFound(_0x5f2539,null))['then'](saveUpdates(_0x9a6186[_0xc6ba('0xb5')],null))[_0xc6ba('0x19')](respondWithResult(_0x5f2539,null))[_0xc6ba('0x28')](handleError(_0x5f2539,null));};exports[_0xc6ba('0x18')]=function(_0x4e6e9f,_0xcb364f){return db[_0xc6ba('0x30')][_0xc6ba('0x5e')]({'where':{'id':_0x4e6e9f[_0xc6ba('0xb6')]['id']}})[_0xc6ba('0x19')](handleEntityNotFound(_0xcb364f,null))['then'](removeEntity(_0xcb364f,null))[_0xc6ba('0x28')](handleError(_0xcb364f,null));};exports[_0xc6ba('0xb7')]=function(_0x248660,_0x3374ba){return db[_0xc6ba('0x30')][_0xc6ba('0xb7')]()[_0xc6ba('0x19')](respondWithResult(_0x3374ba,null))[_0xc6ba('0x28')](handleError(_0x3374ba,null));};exports[_0xc6ba('0xb8')]=function(_0x35cac2,_0x23235e){return db[_0xc6ba('0xb9')][_0xc6ba('0x5e')]({'where':{'id':_0x35cac2[_0xc6ba('0xb6')]['id']}})[_0xc6ba('0x19')](handleEntityNotFound(_0x23235e,null))[_0xc6ba('0x19')](function(_0x1272e4){if(_0x1272e4){return _0x1272e4[_0xc6ba('0xb8')](_0x35cac2[_0xc6ba('0xb5')][_0xc6ba('0xba')],_[_0xc6ba('0xbb')](_0x35cac2[_0xc6ba('0xb5')],[_0xc6ba('0xba'),'id'])||{});}})['then'](respondWithResult(_0x23235e,null))[_0xc6ba('0x28')](handleError(_0x23235e,null));};exports[_0xc6ba('0xbc')]=function(_0x2aeaa7,_0x21cf92){var _0x13e238={'raw':![],'where':{}};var _0x1aba41={};var _0x175a6d={'count':0x0,'rows':[]};return db[_0xc6ba('0x30')][_0xc6ba('0x22')]({'where':{'id':_0x2aeaa7['params']['id']}})[_0xc6ba('0x19')](handleEntityNotFound(_0x21cf92,null))['then'](function(_0x5ad9be){if(_0x5ad9be){_0x1aba41[_0xc6ba('0x35')]=_[_0xc6ba('0x67')](db[_0xc6ba('0xb9')][_0xc6ba('0x31')]);_0x1aba41[_0xc6ba('0x37')]=_[_0xc6ba('0x67')](_0x2aeaa7['query']);_0x1aba41[_0xc6ba('0x38')]=_[_0xc6ba('0x3a')](_0x1aba41['model'],_0x1aba41[_0xc6ba('0x37')]);_0x13e238['attributes']=_[_0xc6ba('0x3a')](_0x1aba41[_0xc6ba('0x35')],qs[_0xc6ba('0x3b')](_0x2aeaa7['query'][_0xc6ba('0x3b')]));_0x13e238[_0xc6ba('0x39')]=_0x13e238[_0xc6ba('0x39')][_0xc6ba('0x3c')]?_0x13e238[_0xc6ba('0x39')]:_0x1aba41['model'];if(!_0x2aeaa7[_0xc6ba('0x37')][_0xc6ba('0x3d')](_0xc6ba('0x3e'))){_0x13e238['limit']=qs[_0xc6ba('0x14')](_0x2aeaa7[_0xc6ba('0x37')]['limit']);_0x13e238['offset']=qs[_0xc6ba('0x12')](_0x2aeaa7[_0xc6ba('0x37')]['offset']);}_0x13e238[_0xc6ba('0x83')]=qs['sort'](_0x2aeaa7[_0xc6ba('0x37')][_0xc6ba('0x3f')]);_0x13e238[_0xc6ba('0x6c')]=qs[_0xc6ba('0x38')](_['pick'](_0x2aeaa7[_0xc6ba('0x37')],_0x1aba41[_0xc6ba('0x38')]));_0x13e238[_0xc6ba('0x6c')][_0xc6ba('0xbd')]=_0x5ad9be['id'];if(_0x2aeaa7[_0xc6ba('0x37')][_0xc6ba('0x7b')]){_0x13e238[_0xc6ba('0x6c')]=_[_0xc6ba('0x8f')](_0x13e238['where'],{'$or':_[_0xc6ba('0x36')](_0x13e238[_0xc6ba('0x39')],function(_0x503719){var _0x6845e8={};_0x6845e8[_0x503719]={'$like':'%'+_0x2aeaa7[_0xc6ba('0x37')][_0xc6ba('0x7b')]+'%'};return _0x6845e8;})});}if(_0x2aeaa7['query'][_0xc6ba('0x71')]){var _0x2c42be=_0x2aeaa7['query'][_0xc6ba('0x71')][_0xc6ba('0x1e')](',');var _0x5aff57={};_0x5aff57[_0x2c42be[0x0]]={'$gte':moment(_0x2c42be[0x1])[_0xc6ba('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x13e238[_0xc6ba('0x6c')]=_[_0xc6ba('0x8f')](_0x13e238[_0xc6ba('0x6c')],_0x5aff57);}_0x13e238=_[_0xc6ba('0x8f')]({},_0x13e238,_0x2aeaa7['options']);return db[_0xc6ba('0xb9')]['count']({'where':_0x13e238[_0xc6ba('0x6c')]})[_0xc6ba('0x19')](function(_0x27f1a8){_0x175a6d['count']=_0x27f1a8;if(_0x2aeaa7[_0xc6ba('0x37')][_0xc6ba('0xb2')]){_0x13e238[_0xc6ba('0xb3')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x13e238);})[_0xc6ba('0x19')](function(_0x1a34d3){if(_0x2aeaa7[_0xc6ba('0x37')][_0xc6ba('0xbf')]==='true'){for(var _0x385448=0x0;_0x385448<_0x1a34d3[_0xc6ba('0x3c')];_0x385448++){_0x1a34d3[_0x385448]['body']=juice(_0x1a34d3[_0x385448][_0xc6ba('0xb5')]);}}_0x175a6d['rows']=_0x1a34d3;return _0x175a6d;});}})[_0xc6ba('0x19')](respondWithFilteredResult(_0x21cf92,_0x13e238))[_0xc6ba('0x28')](handleError(_0x21cf92,null));};exports[_0xc6ba('0xc0')]=function(_0x559d25,_0x13873c){return db[_0xc6ba('0x30')][_0xc6ba('0x5e')]({'where':{'id':_0x559d25['params']['id']}})[_0xc6ba('0x19')](handleEntityNotFound(_0x13873c,null))[_0xc6ba('0x19')](function(_0x2c24f3){if(_0x2c24f3){return _0x2c24f3['setTags'](_0x559d25[_0xc6ba('0xb5')][_0xc6ba('0xba')],_[_0xc6ba('0xbb')](_0x559d25['body'],[_0xc6ba('0xba'),'id'])||{})[_0xc6ba('0xc1')](function(){return db['Tag'][_0xc6ba('0xc2')]({'attributes':['id',_0xc6ba('0x1a'),_0xc6ba('0xc3')],'where':{'id':_0x559d25[_0xc6ba('0xb5')]['ids']}});})[_0xc6ba('0x19')](function(_0x79b32f){socket['emit'](_0xc6ba('0xc4'),{'id':Number(_0x559d25[_0xc6ba('0xb6')]['id']),'tags':_0x79b32f||[]});return{'id':Number(_0x559d25[_0xc6ba('0xb6')]['id']),'tags':_0x79b32f||[]};});}})['then'](respondWithResult(_0x13873c,null))['catch'](handleError(_0x13873c,null));};exports[_0xc6ba('0xc5')]=function(_0x5019d8,_0x544601){return db['MailInteraction'][_0xc6ba('0x5e')]({'where':{'id':_0x5019d8['params']['id']}})[_0xc6ba('0x19')](handleEntityNotFound(_0x544601,null))[_0xc6ba('0x19')](function(_0x39b9ff){if(_0x39b9ff){return _0x39b9ff[_0xc6ba('0xc5')](_0x5019d8[_0xc6ba('0x37')][_0xc6ba('0xba')]);}})[_0xc6ba('0x19')](respondWithStatusCode(_0x544601,null))[_0xc6ba('0x28')](handleError(_0x544601,null));};exports['download']=function(_0x1fe6c2,_0x364cba){var _0x3d24a6=moment()[_0xc6ba('0xc6')]()['toString']();var _0x485761=path['join'](config['root'],_0xc6ba('0xc7'),'files','tmp');var _0x136f44=path[_0xc6ba('0xc8')](config[_0xc6ba('0xc9')],'server',_0xc6ba('0xca'),'attachments');var _0x278722=path[_0xc6ba('0xc8')](_0x485761,_0x3d24a6);var _0x3821dc=util['format'](_0xc6ba('0xcb'),_0x1fe6c2[_0xc6ba('0xb6')]['id'],_0x3d24a6);var _0x3e3dc5=path[_0xc6ba('0xc8')](_0x485761,_0x3821dc);var _0x2da738=[];if(_0x1fe6c2[_0xc6ba('0x37')]['attachments']){_0x2da738[_0xc6ba('0x21')]({'model':db[_0xc6ba('0xcc')],'as':_0xc6ba('0xcd'),'raw':!![]});}var _0x133beb=[{'model':db[_0xc6ba('0xb9')],'as':'Messages','attributes':['id',_0xc6ba('0xb5'),'from','to','cc',_0xc6ba('0xce'),_0xc6ba('0xcf'),_0xc6ba('0x6f')],'where':{'secret':![]},'order':qs[_0xc6ba('0x3f')]('id'),'include':_0x2da738}];return db[_0xc6ba('0x30')][_0xc6ba('0x5e')]({'where':{'id':_0x1fe6c2[_0xc6ba('0xb6')]['id']},'include':_0x133beb})[_0xc6ba('0x19')](handleEntityNotFound(_0x364cba,null))[_0xc6ba('0x19')](function(_0x5a4572){if(_0x5a4572&&_0x5a4572[_0xc6ba('0xd0')]){var _0x4a671d=_0x5a4572[_0xc6ba('0xd1')]({'plain':!![]});fs[_0xc6ba('0xd2')](_0x278722);return BPromise[_0xc6ba('0xd3')](_0x4a671d[_0xc6ba('0xd0')],function(_0x28f129,_0x345aa3){var _0x234b90={'from':_0x28f129[_0xc6ba('0x42')],'to':_0x28f129['to'],'subject':_0x28f129[_0xc6ba('0xcf')],'html':htmlEntities['decode'](_0x28f129[_0xc6ba('0xb5')]),'headers':{'Date':moment(_0x28f129['createdAt'])[_0xc6ba('0xbe')](_0xc6ba('0xd4'))},'attachments':[]};if(_0x28f129['cc']){_0x234b90[_0xc6ba('0xd5')]['Cc']=_0x28f129['cc'];}if(_0x28f129[_0xc6ba('0xce')]){_0x234b90[_0xc6ba('0xd5')][_0xc6ba('0xd6')]=_0x28f129[_0xc6ba('0xce')];}return new BPromise(function(_0x4bcd4c,_0x1a8292){if(_0x28f129[_0xc6ba('0xcd')]){for(var _0x22750d=0x0;_0x22750d<_0x28f129['Attachments'][_0xc6ba('0x3c')];_0x22750d++){var _0x494e86=_0x28f129[_0xc6ba('0xcd')][_0x22750d];var _0x3ff809=path[_0xc6ba('0xc8')](_0x136f44,_0x494e86['basename']);if(fs[_0xc6ba('0xd7')](_0x3ff809)){_0x234b90[_0xc6ba('0xd8')][_0xc6ba('0x21')]({'name':_0x494e86[_0xc6ba('0x1a')],'contentType':_0x494e86[_0xc6ba('0x33')],'data':fs[_0xc6ba('0xd9')](_0x3ff809)});}}}emlformat[_0xc6ba('0xda')](_0x234b90,function(_0x42414f,_0x3d4b6e){if(_0x42414f)return _0x1a8292(_0x42414f);fs['writeFileSync'](path[_0xc6ba('0xc8')](_0x278722,util[_0xc6ba('0xbe')](_0xc6ba('0xdb'),_0x345aa3)),_0x3d4b6e);return _0x4bcd4c(_0x3d4b6e);});});})[_0xc6ba('0x19')](function(){return new BPromise(function(_0x33ce30,_0x2874e4){zipdir(_0x278722,{'saveTo':_0x3e3dc5},function(_0x12ec2b,_0x308e07){if(_0x12ec2b)return _0x2874e4(_0x12ec2b);return _0x33ce30(_0x308e07);});})[_0xc6ba('0x19')](function(){return new BPromise(function(_0x342309,_0x2be351){rimraf(_0x278722,function(_0xb10b72){if(_0xb10b72)_0x2be351(_0xb10b72);return _0x342309();});});})['then'](function(){return _0x364cba[_0xc6ba('0xdc')](_0x3e3dc5,_0x3821dc,function(_0x1b0c2f){if(!_0x1b0c2f)fs[_0xc6ba('0xdd')](_0x3e3dc5);});});});}else{return _0x364cba['sendStatus'](0xc8);}})[_0xc6ba('0x28')](handleError(_0x364cba,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c8367a6..2242754 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 _0x8892=['update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','save'];(function(_0xf427d2,_0x3e2721){var _0x352990=function(_0x3b1aef){while(--_0x3b1aef){_0xf427d2['push'](_0xf427d2['shift']());}};_0x352990(++_0x3e2721);}(_0x8892,0xce));var _0x2889=function(_0x56c9aa,_0xfa2960){_0x56c9aa=_0x56c9aa-0x0;var _0x212157=_0x8892[_0x56c9aa];return _0x212157;};'use strict';var EventEmitter=require(_0x2889('0x0'));var MailInteraction=require(_0x2889('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x2889('0x1'))['db'][_0x2889('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2889('0x3'),'afterUpdate':_0x2889('0x4'),'afterDestroy':_0x2889('0x5')};function emitEvent(_0x53e71f){return function(_0x2dd3dd,_0x3a2995,_0x3b36fe){_0x2dd3dd['getUsers']({'attributes':['id'],'raw':!![]})[_0x2889('0x6')](function(_0x517b1d){_0x2dd3dd[_0x2889('0x7')](_0x2889('0x8'),_0x517b1d['map'](function(_0x7399dc){return{'id':_0x7399dc['id']};}));return MailMessage[_0x2889('0x9')]({'where':{'MailInteractionId':_0x2dd3dd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2889('0x6')](function(_0x57b3ea){_0x2dd3dd[_0x2889('0x7')](_0x2889('0xa'),_0x57b3ea[_0x2889('0xb')]);MailInteractionEvents[_0x2889('0xc')](_0x53e71f+':'+_0x2dd3dd['id'],_0x2dd3dd);MailInteractionEvents['emit'](_0x53e71f,_0x2dd3dd);_0x3b36fe(null);})['catch'](_0x3b36fe(null));};}for(var e in events){if(events[_0x2889('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x2889('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0xf7eb=['Users','findAll','unreadMessages','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x4fb92f,_0x4ba277){var _0x479bef=function(_0x590789){while(--_0x590789){_0x4fb92f['push'](_0x4fb92f['shift']());}};_0x479bef(++_0x4ba277);}(_0xf7eb,0x13a));var _0xbf7e=function(_0x2cb39a,_0x161aa1){_0x2cb39a=_0x2cb39a-0x0;var _0x14f3b0=_0xf7eb[_0x2cb39a];return _0x14f3b0;};'use strict';var EventEmitter=require(_0xbf7e('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xbf7e('0x1')];var MailMessage=require(_0xbf7e('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbf7e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf7e('0x4'),'afterDestroy':_0xbf7e('0x5')};function emitEvent(_0x56887f){return function(_0x116882,_0x57b18b,_0xe66ae0){_0x116882[_0xbf7e('0x6')]({'attributes':['id'],'raw':!![]})[_0xbf7e('0x7')](function(_0x3e0c96){_0x116882[_0xbf7e('0x8')](_0xbf7e('0x9'),_0x3e0c96['map'](function(_0x1fbe36){return{'id':_0x1fbe36['id']};}));return MailMessage[_0xbf7e('0xa')]({'where':{'MailInteractionId':_0x116882['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbf7e('0x7')](function(_0x1f959e){_0x116882['setDataValue'](_0xbf7e('0xb'),_0x1f959e[_0xbf7e('0xc')]);MailInteractionEvents[_0xbf7e('0xd')](_0x56887f+':'+_0x116882['id'],_0x116882);MailInteractionEvents[_0xbf7e('0xd')](_0x56887f,_0x116882);_0xe66ae0(null);})[_0xbf7e('0xe')](_0xe66ae0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xbf7e('0xf')](e,emitEvent(event));}}module[_0xbf7e('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ea59bfc..385c0df 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 _0x796f=['YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','update','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format'];(function(_0x489618,_0x233987){var _0x3d34b8=function(_0xe4ffd0){while(--_0xe4ffd0){_0x489618['push'](_0x489618['shift']());}};_0x3d34b8(++_0x233987);}(_0x796f,0x104));var _0xf796=function(_0x3bd405,_0x2da8a2){_0x3bd405=_0x3bd405-0x0;var _0x3ad0b3=_0x796f[_0x3bd405];return _0x3ad0b3;};'use strict';var _=require(_0xf796('0x0'));var util=require(_0xf796('0x1'));var logger=require(_0xf796('0x2'))('api');var moment=require(_0xf796('0x3'));var BPromise=require(_0xf796('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf796('0x5'));var rimraf=require(_0xf796('0x6'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xf796('0x7')]=function(_0x3458dc,_0x318f56){return _0x3458dc[_0xf796('0x8')](_0xf796('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xf796('0xa'),'fields':[_0xf796('0xb'),'to'],'type':_0xf796('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x24d05d,_0x2505b1,_0x34c736){if(_0x24d05d[_0xf796('0xd')]){_0x24d05d[_0xf796('0xe')]=moment()[_0xf796('0xf')](_0xf796('0x10'));}if(_0x24d05d['closed']){_0x24d05d['closedAt']=moment()[_0xf796('0xf')](_0xf796('0x10'));}_0x34c736(null,_0x2505b1);},'beforeUpdate':function(_0x2b8c36,_0x2e5c06,_0x4c0a6f){if(_0x2b8c36['changed'](_0xf796('0xd'))){_0x2b8c36[_0xf796('0xe')]=_0x2b8c36[_0xf796('0xd')]?moment()[_0xf796('0xf')](_0xf796('0x10')):null;}if(_0x2b8c36[_0xf796('0x11')]('closed')){_0x2b8c36[_0xf796('0x12')]=moment()['format'](_0xf796('0x10'));_0x2b8c36['substatus']=null;_0x2b8c36['substatusAt']=null;}_0x4c0a6f(null,_0x2b8c36);},'afterUpdate':function(_0x9859b9,_0x480d47,_0x464c0b){var _0x447ece=_0x3458dc[_0xf796('0x13')];var _0x5aa92f=_0x9859b9[_0xf796('0x14')]({'plain':!![]});if(_0x5aa92f['closed']){return _0x447ece['MailMessage'][_0xf796('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x5aa92f['id']}})['then'](function(){_0x464c0b();})['catch'](function(_0x3cf9b2){_0x464c0b(_0x3cf9b2);});}else{_0x464c0b();}}},'charset':'utf8mb4','collate':_0xf796('0x16')});}; \ No newline at end of file +var _0x1f4c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f4c,0xfb));var _0xc1f4=function(_0x457175,_0x29e638){_0x457175=_0x457175-0x0;var _0x521db2=_0x1f4c[_0x457175];return _0x521db2;};'use strict';var _=require('lodash');var util=require(_0xc1f4('0x0'));var logger=require('../../config/logger')(_0xc1f4('0x1'));var moment=require(_0xc1f4('0x2'));var BPromise=require(_0xc1f4('0x3'));var rp=require(_0xc1f4('0x4'));var fs=require('fs');var path=require(_0xc1f4('0x5'));var rimraf=require(_0xc1f4('0x6'));var config=require(_0xc1f4('0x7'));var attributes=require(_0xc1f4('0x8'));module[_0xc1f4('0x9')]=function(_0x29b9f5,_0x394220){return _0x29b9f5[_0xc1f4('0xa')](_0xc1f4('0xb'),attributes,{'tableName':_0xc1f4('0xc'),'paranoid':![],'indexes':[{'name':_0xc1f4('0xd'),'fields':['subject','to'],'type':_0xc1f4('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe2f0c2,_0x81bb59,_0x5e9ecf){if(_0xe2f0c2[_0xc1f4('0xf')]){_0xe2f0c2[_0xc1f4('0x10')]=moment()[_0xc1f4('0x11')](_0xc1f4('0x12'));}if(_0xe2f0c2[_0xc1f4('0x13')]){_0xe2f0c2[_0xc1f4('0x14')]=moment()[_0xc1f4('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e9ecf(null,_0x81bb59);},'beforeUpdate':function(_0x26a44f,_0x2748b1,_0x3d618f){if(_0x26a44f[_0xc1f4('0x15')]('substatus')){_0x26a44f['substatusAt']=_0x26a44f['substatus']?moment()[_0xc1f4('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x26a44f[_0xc1f4('0x15')](_0xc1f4('0x13'))){_0x26a44f[_0xc1f4('0x14')]=moment()[_0xc1f4('0x11')](_0xc1f4('0x12'));_0x26a44f['substatus']=null;_0x26a44f[_0xc1f4('0x10')]=null;}_0x3d618f(null,_0x26a44f);},'afterUpdate':function(_0x1a5442,_0x4a84cd,_0x569ba0){var _0x40c45f=_0x29b9f5['models'];var _0x24cb5b=_0x1a5442[_0xc1f4('0x16')]({'plain':!![]});if(_0x24cb5b[_0xc1f4('0x13')]){return _0x40c45f[_0xc1f4('0x17')][_0xc1f4('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x24cb5b['id']}})[_0xc1f4('0x19')](function(){_0x569ba0();})['catch'](function(_0x3ee2a6){_0x569ba0(_0x3ee2a6);});}else{_0x569ba0();}}},'charset':_0xc1f4('0x1a'),'collate':_0xc1f4('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index a606107..3e5197b 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 _0x14f8=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateMailInteraction','update','body','options','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x493bba,_0x2eb3b2){var _0x765204=function(_0x45dbd1){while(--_0x45dbd1){_0x493bba['push'](_0x493bba['shift']());}};_0x765204(++_0x2eb3b2);}(_0x14f8,0x66));var _0x814f=function(_0x3a3bb6,_0xe8f13b){_0x3a3bb6=_0x3a3bb6-0x0;var _0x2c340c=_0x14f8[_0x3a3bb6];return _0x2c340c;};'use strict';var _=require('lodash');var util=require(_0x814f('0x0'));var moment=require(_0x814f('0x1'));var BPromise=require(_0x814f('0x2'));var rs=require(_0x814f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x814f('0x4'))(_0x814f('0x5'));var config=require('../../config/environment');var jayson=require(_0x814f('0x6'));var client=jayson['client'][_0x814f('0x7')]({'port':0x232a});config[_0x814f('0x8')]=_[_0x814f('0x9')](config['redis'],{'host':_0x814f('0xa'),'port':0x18eb});var socket=require(_0x814f('0xb'))(new Redis(config['redis']));require(_0x814f('0xc'))['register'](socket);function respondWithRpcPromise(_0x32644e,_0x411c5e,_0x3bfaf2){return new BPromise(function(_0x2ac7b9,_0x8e1a45){return client[_0x814f('0xd')](_0x32644e,_0x3bfaf2)[_0x814f('0xe')](function(_0x5bcb95){logger[_0x814f('0xf')](_0x814f('0x10'),_0x411c5e,_0x814f('0x11'));logger[_0x814f('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x411c5e,_0x814f('0x11'),JSON[_0x814f('0x13')](_0x5bcb95));if(_0x5bcb95[_0x814f('0x14')]){if(_0x5bcb95[_0x814f('0x14')]['code']===0x1f4){logger[_0x814f('0x14')](_0x814f('0x10'),_0x411c5e,_0x5bcb95[_0x814f('0x14')][_0x814f('0x15')]);return _0x8e1a45(_0x5bcb95[_0x814f('0x14')][_0x814f('0x15')]);}logger[_0x814f('0x14')](_0x814f('0x10'),_0x411c5e,_0x5bcb95[_0x814f('0x14')]['message']);return _0x2ac7b9(_0x5bcb95[_0x814f('0x14')][_0x814f('0x15')]);}else{logger[_0x814f('0xf')]('MailInteraction,\x20%s,\x20%s',_0x411c5e,_0x814f('0x11'));_0x2ac7b9(_0x5bcb95['result'][_0x814f('0x15')]);}})[_0x814f('0x16')](function(_0x1b86ce){logger['error']('MailInteraction,\x20%s,\x20%s',_0x411c5e,_0x1b86ce);_0x8e1a45(_0x1b86ce);});});}exports[_0x814f('0x17')]=function(_0x2b0f6b){var _0x549245=this;return new Promise(function(_0x3224b1,_0x383959){return db['MailInteraction'][_0x814f('0x18')](_0x2b0f6b[_0x814f('0x19')],{'raw':_0x2b0f6b['options']?_0x2b0f6b[_0x814f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b0f6b['options']?_0x2b0f6b['options'][_0x814f('0x1b')]||null:null,'attributes':_0x2b0f6b['options']?_0x2b0f6b['options'][_0x814f('0x1c')]||null:null,'limit':_0x2b0f6b[_0x814f('0x1a')]?_0x2b0f6b[_0x814f('0x1a')]['limit']||null:null})['then'](function(_0x48c846){logger[_0x814f('0xf')]('UpdateMailInteraction',_0x2b0f6b);logger['debug'](_0x814f('0x17'),_0x2b0f6b,JSON[_0x814f('0x13')](_0x48c846));_0x3224b1(_0x48c846);})[_0x814f('0x16')](function(_0x1cb724){logger['error'](_0x814f('0x17'),_0x1cb724[_0x814f('0x15')],_0x2b0f6b);_0x383959(_0x549245[_0x814f('0x14')](0x1f4,_0x1cb724['message']));});});};exports[_0x814f('0x1d')]=function(_0x275d46){return new Promise(function(_0x41b1f9,_0x106332){return db['MailInteraction'][_0x814f('0x1e')]({'where':_0x275d46[_0x814f('0x1a')]?_0x275d46[_0x814f('0x1a')]['where']||null:null})['then'](function(_0x5a749f){if(_0x5a749f){return _0x5a749f[_0x814f('0x1f')](_0x275d46[_0x814f('0x19')][_0x814f('0x20')],_[_0x814f('0x21')](_0x275d46['body'],[_0x814f('0x20'),'id'])||{});}})[_0x814f('0x22')](function(_0x3ba0f5){logger[_0x814f('0xf')](_0x814f('0x23'),_0x275d46);logger['debug']('AddTags',_0x275d46,JSON[_0x814f('0x13')](_0x3ba0f5));_0x41b1f9(_0x3ba0f5);})[_0x814f('0x16')](function(_0x542848){logger['error'](_0x814f('0x23'),_0x542848[_0x814f('0x15')],_0x275d46);_0x106332(_this['error'](0x1f4,_0x542848[_0x814f('0x15')]));});});}; \ No newline at end of file +var _0x7cbc=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateMailInteraction','update','body','options','raw','attributes','stringify','catch','AddTagsToMailInteraction','MailInteraction','find','where','addTags','ids','spread','AddTags'];(function(_0xd26500,_0xfa64ae){var _0x16cdba=function(_0x398c67){while(--_0x398c67){_0xd26500['push'](_0xd26500['shift']());}};_0x16cdba(++_0xfa64ae);}(_0x7cbc,0xa4));var _0xc7cb=function(_0x3eb04d,_0x10b9f9){_0x3eb04d=_0x3eb04d-0x0;var _0x1d8fd2=_0x7cbc[_0x3eb04d];return _0x1d8fd2;};'use strict';var _=require(_0xc7cb('0x0'));var util=require(_0xc7cb('0x1'));var moment=require(_0xc7cb('0x2'));var BPromise=require(_0xc7cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7cb('0x5'));var logger=require(_0xc7cb('0x6'))(_0xc7cb('0x7'));var config=require(_0xc7cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc7cb('0x9')]['http']({'port':0x232a});config[_0xc7cb('0xa')]=_[_0xc7cb('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc7cb('0xc'))(new Redis(config[_0xc7cb('0xa')]));require(_0xc7cb('0xd'))[_0xc7cb('0xe')](socket);function respondWithRpcPromise(_0x3aa449,_0xbad7b4,_0x227a0e){return new BPromise(function(_0x10bd25,_0x87af64){return client[_0xc7cb('0xf')](_0x3aa449,_0x227a0e)[_0xc7cb('0x10')](function(_0x106c53){logger[_0xc7cb('0x11')](_0xc7cb('0x12'),_0xbad7b4,_0xc7cb('0x13'));logger[_0xc7cb('0x14')](_0xc7cb('0x15'),_0xbad7b4,_0xc7cb('0x13'),JSON['stringify'](_0x106c53));if(_0x106c53[_0xc7cb('0x16')]){if(_0x106c53[_0xc7cb('0x16')][_0xc7cb('0x17')]===0x1f4){logger[_0xc7cb('0x16')](_0xc7cb('0x12'),_0xbad7b4,_0x106c53[_0xc7cb('0x16')][_0xc7cb('0x18')]);return _0x87af64(_0x106c53[_0xc7cb('0x16')]['message']);}logger[_0xc7cb('0x16')](_0xc7cb('0x12'),_0xbad7b4,_0x106c53[_0xc7cb('0x16')][_0xc7cb('0x18')]);return _0x10bd25(_0x106c53[_0xc7cb('0x16')][_0xc7cb('0x18')]);}else{logger[_0xc7cb('0x11')]('MailInteraction,\x20%s,\x20%s',_0xbad7b4,_0xc7cb('0x13'));_0x10bd25(_0x106c53['result'][_0xc7cb('0x18')]);}})['catch'](function(_0x2f8aec){logger[_0xc7cb('0x16')](_0xc7cb('0x12'),_0xbad7b4,_0x2f8aec);_0x87af64(_0x2f8aec);});});}exports[_0xc7cb('0x19')]=function(_0x564de6){var _0x1b0ee8=this;return new Promise(function(_0x3eeb9c,_0x13ebe9){return db['MailInteraction'][_0xc7cb('0x1a')](_0x564de6[_0xc7cb('0x1b')],{'raw':_0x564de6[_0xc7cb('0x1c')]?_0x564de6[_0xc7cb('0x1c')][_0xc7cb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x564de6[_0xc7cb('0x1c')]?_0x564de6[_0xc7cb('0x1c')]['where']||null:null,'attributes':_0x564de6[_0xc7cb('0x1c')]?_0x564de6[_0xc7cb('0x1c')][_0xc7cb('0x1e')]||null:null,'limit':_0x564de6[_0xc7cb('0x1c')]?_0x564de6[_0xc7cb('0x1c')]['limit']||null:null})[_0xc7cb('0x10')](function(_0x2f29c6){logger[_0xc7cb('0x11')](_0xc7cb('0x19'),_0x564de6);logger[_0xc7cb('0x14')](_0xc7cb('0x19'),_0x564de6,JSON[_0xc7cb('0x1f')](_0x2f29c6));_0x3eeb9c(_0x2f29c6);})[_0xc7cb('0x20')](function(_0x4d6a9a){logger[_0xc7cb('0x16')](_0xc7cb('0x19'),_0x4d6a9a[_0xc7cb('0x18')],_0x564de6);_0x13ebe9(_0x1b0ee8[_0xc7cb('0x16')](0x1f4,_0x4d6a9a[_0xc7cb('0x18')]));});});};exports[_0xc7cb('0x21')]=function(_0x1c1691){return new Promise(function(_0x3c59e3,_0x10273c){return db[_0xc7cb('0x22')][_0xc7cb('0x23')]({'where':_0x1c1691[_0xc7cb('0x1c')]?_0x1c1691[_0xc7cb('0x1c')][_0xc7cb('0x24')]||null:null})[_0xc7cb('0x10')](function(_0xf40af){if(_0xf40af){return _0xf40af[_0xc7cb('0x25')](_0x1c1691[_0xc7cb('0x1b')][_0xc7cb('0x26')],_['omit'](_0x1c1691[_0xc7cb('0x1b')],[_0xc7cb('0x26'),'id'])||{});}})[_0xc7cb('0x27')](function(_0xacf9a7){logger[_0xc7cb('0x11')](_0xc7cb('0x28'),_0x1c1691);logger[_0xc7cb('0x14')]('AddTags',_0x1c1691,JSON[_0xc7cb('0x1f')](_0xacf9a7));_0x3c59e3(_0xacf9a7);})['catch'](function(_0x13ffbc){logger['error'](_0xc7cb('0x28'),_0x13ffbc[_0xc7cb('0x18')],_0x1c1691);_0x10273c(_this[_0xc7cb('0x16')](0x1f4,_0x13ffbc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 114a23d..686c213 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 _0xda6c=['emit','removeListener','register','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x14f904,_0x3290e8){var _0x538469=function(_0x39bd8f){while(--_0x39bd8f){_0x14f904['push'](_0x14f904['shift']());}};_0x538469(++_0x3290e8);}(_0xda6c,0x15c));var _0xcda6=function(_0x1258ab,_0x62395){_0x1258ab=_0x1258ab-0x0;var _0x1aaece=_0xda6c[_0x1258ab];return _0x1aaece;};'use strict';var MailInteractionEvents=require(_0xcda6('0x0'));var events=[_0xcda6('0x1'),_0xcda6('0x2'),_0xcda6('0x3')];function createListener(_0x2c5f47,_0x163ab5){return function(_0x561e91){_0x163ab5[_0xcda6('0x4')](_0x2c5f47,_0x561e91);};}function removeListener(_0x28e980,_0xbbafc9){return function(){MailInteractionEvents[_0xcda6('0x5')](_0x28e980,_0xbbafc9);};}exports[_0xcda6('0x6')]=function(_0x39cce4){for(var _0x26f7e4=0x0,_0x53a067=events['length'];_0x26f7e4<_0x53a067;_0x26f7e4++){var _0x525d28=events[_0x26f7e4];var _0x46a5a4=createListener(_0xcda6('0x7')+_0x525d28,_0x39cce4);MailInteractionEvents['on'](_0x525d28,_0x46a5a4);}}; \ No newline at end of file +var _0xa496=['update','register','mailInteraction:','save','remove'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0xa496,0x16b));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x6a49('0x0'),_0x6a49('0x1'),_0x6a49('0x2')];function createListener(_0x34cfe8,_0x5a5ee3){return function(_0x3a081f){_0x5a5ee3['emit'](_0x34cfe8,_0x3a081f);};}function removeListener(_0x22a111,_0x6c13da){return function(){MailInteractionEvents['removeListener'](_0x22a111,_0x6c13da);};}exports[_0x6a49('0x3')]=function(_0x4be477){for(var _0x311f27=0x0,_0x3399ac=events['length'];_0x311f27<_0x3399ac;_0x311f27++){var _0x5e42a9=events[_0x311f27];var _0xaab31=createListener(_0x6a49('0x4')+_0x5e42a9,_0x4be477);MailInteractionEvents['on'](_0x5e42a9,_0xaab31);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 147e923..61fc16c 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 _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x50a0b7,_0x5a25f6){var _0x1a7e9a=function(_0xad49b2){while(--_0xad49b2){_0x50a0b7['push'](_0x50a0b7['shift']());}};_0x1a7e9a(++_0x5a25f6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x315bc4,_0x5e8c84){_0x315bc4=_0x315bc4-0x0;var _0x2ec682=_0xec56[_0x315bc4];return _0x2ec682;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'mailmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router; \ No newline at end of file +var _0xdadf=['delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x3bc35b,_0x3e6454){var _0x1e68a1=function(_0x4565c2){while(--_0x4565c2){_0x3bc35b['push'](_0x3bc35b['shift']());}};_0x1e68a1(++_0x3e6454);}(_0xdadf,0x175));var _0xfdad=function(_0x2671f0,_0x5709ec){_0x2671f0=_0x2671f0-0x0;var _0x50ea0e=_0xdadf[_0x2671f0];return _0x50ea0e;};'use strict';var multer=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var path=require('path');var timeout=require(_0xfdad('0x2'));var express=require(_0xfdad('0x3'));var router=express[_0xfdad('0x4')]();var fs_extra=require(_0xfdad('0x5'));var auth=require(_0xfdad('0x6'));var interaction=require(_0xfdad('0x7'));var config=require(_0xfdad('0x8'));var controller=require(_0xfdad('0x9'));router[_0xfdad('0xa')]('/',auth[_0xfdad('0xb')](),controller[_0xfdad('0xc')]);router[_0xfdad('0xa')](_0xfdad('0xd'),auth[_0xfdad('0xb')](),controller[_0xfdad('0xe')]);router[_0xfdad('0xa')](_0xfdad('0xf'),auth[_0xfdad('0xb')](),controller[_0xfdad('0x10')]);router[_0xfdad('0xa')](_0xfdad('0x11'),auth[_0xfdad('0xb')](),controller[_0xfdad('0x12')]);router[_0xfdad('0x13')]('/',auth[_0xfdad('0xb')](),interaction[_0xfdad('0x14')](_0xfdad('0x15'),_0xfdad('0x16')),controller[_0xfdad('0x17')]);router[_0xfdad('0x18')](_0xfdad('0xf'),auth['isAuthenticated'](),controller[_0xfdad('0x19')]);router['put'](_0xfdad('0x1a'),auth[_0xfdad('0xb')](),controller[_0xfdad('0x1b')]);router[_0xfdad('0x18')](_0xfdad('0x1c'),auth[_0xfdad('0xb')](),controller[_0xfdad('0x1d')]);router[_0xfdad('0x1e')]('/:id',auth[_0xfdad('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 98a373b..9931e6e 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 _0xa456=['INTEGER','Email','Chat','sequelize','lodash','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa456,0x1d7));var _0x6a45=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xa456[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x6a45('0x0'));var _=require(_0x6a45('0x1'));module['exports']={'body':{'type':Sequelize[_0x6a45('0x2')](_0x6a45('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6a45('0x2')]('medium')},'read':{'type':Sequelize[_0x6a45('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6a45('0x5')]('in',_0x6a45('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x6a45('0x7')](0x1fe)},'from':{'type':Sequelize[_0x6a45('0x7')]},'to':{'type':Sequelize[_0x6a45('0x2')]('long')},'cc':{'type':Sequelize[_0x6a45('0x2')](_0x6a45('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x6a45('0x3'))},'subject':{'type':Sequelize[_0x6a45('0x2')]},'sentAt':{'type':Sequelize[_0x6a45('0x8')]},'attach':{'type':Sequelize[_0x6a45('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x6a45('0x2')]('long')},'originCc':{'type':Sequelize[_0x6a45('0x2')](_0x6a45('0x3'))},'originChannel':{'type':Sequelize[_0x6a45('0x5')](_0x6a45('0xa'),_0x6a45('0xb')),'defaultValue':_0x6a45('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x314e=['DATE','Chat','Email','sequelize','exports','medium','BOOLEAN','ENUM','out','STRING','TEXT','long','INTEGER'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x314e,0x12e));var _0xe314=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x314e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe314('0x0'));var _=require('lodash');module[_0xe314('0x1')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xe314('0x2'))},'read':{'type':Sequelize[_0xe314('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe314('0x4')]('in','out'),'defaultValue':_0xe314('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xe314('0x6')]},'to':{'type':Sequelize[_0xe314('0x7')](_0xe314('0x8'))},'cc':{'type':Sequelize[_0xe314('0x7')](_0xe314('0x8'))},'bcc':{'type':Sequelize[_0xe314('0x7')]('long')},'subject':{'type':Sequelize[_0xe314('0x7')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xe314('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe314('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe314('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0xe314('0x8'))},'originCc':{'type':Sequelize[_0xe314('0x7')]('long')},'originChannel':{'type':Sequelize['ENUM']('Email',_0xe314('0xb')),'defaultValue':_0xe314('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index aad505d..f07c500 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 _0x79ff=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','stack','name','send','index','MailMessage','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','show','params','includeAll','include','find','catch','body','describe','create','direction','secret','split','MailAccount','CmList','List','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','CmContact','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','role','RejectMessage','rejectMessage','Sequelize','fullname','reject','rejectmessage','download','unix','toString','server','files','from','bcc','subject','Attachments','decode','headers','Bcc','existsSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x298054,_0x6144fe){var _0x250552=function(_0x2fa3b2){while(--_0x2fa3b2){_0x298054['push'](_0x298054['shift']());}};_0x250552(++_0x6144fe);}(_0x79ff,0x87));var _0xf79f=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x79ff[_0x27beea];return _0x122645;};'use strict';var emlformat=require(_0xf79f('0x0'));var moment=require(_0xf79f('0x1'));var BPromise=require(_0xf79f('0x2'));var util=require(_0xf79f('0x3'));var path=require(_0xf79f('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xf79f('0x5'));var qs=require(_0xf79f('0x6'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xf79f('0x7'))(_0xf79f('0x8'));var config=require(_0xf79f('0x9'));var db=require(_0xf79f('0xa'))['db'];config[_0xf79f('0xb')]=_[_0xf79f('0xc')](config[_0xf79f('0xb')],{'host':_0xf79f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf79f('0xb')]));var htmlEntities=require('html-entities');require(_0xf79f('0xe'))[_0xf79f('0xf')](socket);var jayson=require(_0xf79f('0x10'));var client=jayson[_0xf79f('0x11')][_0xf79f('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xf79f('0x12')]({'port':0x232b});var client9002=jayson[_0xf79f('0x11')][_0xf79f('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x89b10a,_0xb689d6,_0x920097,_0x3ac08e){return new BPromise(function(_0x3f60d6,_0x2d54d8){var _0x48e107=_0x3ac08e||client;return _0x48e107[_0xf79f('0x13')](_0x89b10a,_0x920097)[_0xf79f('0x14')](function(_0x180115){logger['info']('MailMessage,\x20%s,\x20%s',_0xb689d6,_0xf79f('0x15'));logger[_0xf79f('0x16')](_0xf79f('0x17'),_0xb689d6,_0xf79f('0x15'),JSON[_0xf79f('0x18')](_0x180115));if(_0x180115[_0xf79f('0x19')]){if(_0x180115['error'][_0xf79f('0x1a')]===0x1f4){logger[_0xf79f('0x19')](_0xf79f('0x1b'),_0xb689d6,_0x180115[_0xf79f('0x19')]['message']);return _0x2d54d8(_0x180115[_0xf79f('0x19')][_0xf79f('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0xb689d6,_0x180115[_0xf79f('0x19')][_0xf79f('0x1c')]);return _0x3f60d6(_0x180115['error'][_0xf79f('0x1c')]);}else{logger['info'](_0xf79f('0x1b'),_0xb689d6,_0xf79f('0x15'));_0x3f60d6(_0x180115[_0xf79f('0x1d')][_0xf79f('0x1c')]);}})['catch'](function(_0x165f2d){logger[_0xf79f('0x19')](_0xf79f('0x1b'),_0xb689d6,_0x165f2d);_0x2d54d8(_0x165f2d);});});}function respondWithResult(_0xe7d25b,_0x5d11c4){_0x5d11c4=_0x5d11c4||0xc8;return function(_0xe441c4){if(_0xe441c4){return _0xe7d25b[_0xf79f('0x1e')](_0x5d11c4)[_0xf79f('0x1f')](_0xe441c4);}};}function respondWithFilteredResult(_0x38527f,_0x1dc15b){return function(_0xbdace3){if(_0xbdace3){var _0x51c3d5=typeof _0x1dc15b[_0xf79f('0x20')]==='undefined'&&typeof _0x1dc15b[_0xf79f('0x21')]===_0xf79f('0x22');var _0x55e91a=_0xbdace3[_0xf79f('0x23')];var _0x3c1be1=_0x51c3d5?0x0:_0x1dc15b[_0xf79f('0x20')];var _0x43ee85=_0x51c3d5?_0xbdace3[_0xf79f('0x23')]:_0x1dc15b['offset']+_0x1dc15b[_0xf79f('0x21')];var _0x3248b5;if(_0x43ee85>=_0x55e91a){_0x43ee85=_0x55e91a;_0x3248b5=0xc8;}else{_0x3248b5=0xce;}_0x38527f[_0xf79f('0x1e')](_0x3248b5);return _0x38527f[_0xf79f('0x24')](_0xf79f('0x25'),_0x3c1be1+'-'+_0x43ee85+'/'+_0x55e91a)[_0xf79f('0x1f')](_0xbdace3);}return null;};}function saveUpdates(_0x672a93){return function(_0x45e4b4){if(_0x45e4b4){return _0x45e4b4[_0xf79f('0x26')](_0x672a93)[_0xf79f('0x14')](function(_0xc7835e){return _0xc7835e;});}return null;};}function removeEntity(_0x1ab92a){return function(_0xb13329){if(_0xb13329){return _0xb13329[_0xf79f('0x27')]()['then'](function(){_0x1ab92a[_0xf79f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29cfb2){return function(_0x5a360f){if(!_0x5a360f){_0x29cfb2['sendStatus'](0x194);}return _0x5a360f;};}function handleError(_0x1f3c5c,_0x336c52){_0x336c52=_0x336c52||0x1f4;return function(_0x94c7e1){logger[_0xf79f('0x19')](_0x94c7e1[_0xf79f('0x28')]);if(_0x94c7e1[_0xf79f('0x29')]){delete _0x94c7e1[_0xf79f('0x29')];}_0x1f3c5c[_0xf79f('0x1e')](_0x336c52)[_0xf79f('0x2a')](_0x94c7e1);};}exports[_0xf79f('0x2b')]=function(_0x345259,_0xfcb51b){var _0x3b9e9b={},_0x5ee664={},_0x39a577={'count':0x0,'rows':[]};var _0x2add12=_['map'](db[_0xf79f('0x2c')]['rawAttributes'],function(_0x315749){return{'name':_0x315749[_0xf79f('0x2d')],'type':_0x315749[_0xf79f('0x2e')][_0xf79f('0x2f')]};});_0x5ee664[_0xf79f('0x30')]=_[_0xf79f('0x31')](_0x2add12,'name');_0x5ee664[_0xf79f('0x32')]=_[_0xf79f('0x33')](_0x345259[_0xf79f('0x32')]);_0x5ee664['filters']=_[_0xf79f('0x34')](_0x5ee664[_0xf79f('0x30')],_0x5ee664[_0xf79f('0x32')]);_0x3b9e9b[_0xf79f('0x35')]=_[_0xf79f('0x34')](_0x5ee664[_0xf79f('0x30')],qs[_0xf79f('0x36')](_0x345259['query'][_0xf79f('0x36')]));_0x3b9e9b[_0xf79f('0x35')]=_0x3b9e9b['attributes'][_0xf79f('0x37')]?_0x3b9e9b[_0xf79f('0x35')]:_0x5ee664[_0xf79f('0x30')];if(!_0x345259[_0xf79f('0x32')][_0xf79f('0x38')](_0xf79f('0x39'))){_0x3b9e9b['limit']=qs['limit'](_0x345259[_0xf79f('0x32')][_0xf79f('0x21')]);_0x3b9e9b[_0xf79f('0x20')]=qs[_0xf79f('0x20')](_0x345259[_0xf79f('0x32')][_0xf79f('0x20')]);}_0x3b9e9b[_0xf79f('0x3a')]=qs['sort'](_0x345259[_0xf79f('0x32')][_0xf79f('0x3b')]);_0x3b9e9b[_0xf79f('0x3c')]=qs['filters'](_[_0xf79f('0x3d')](_0x345259[_0xf79f('0x32')],_0x5ee664[_0xf79f('0x3e')]),_0x2add12);if(_0x345259[_0xf79f('0x32')][_0xf79f('0x3f')]){_0x3b9e9b[_0xf79f('0x3c')]=_[_0xf79f('0x40')](_0x3b9e9b['where'],{'$or':_[_0xf79f('0x31')](_0x2add12,function(_0x4fd612){if(_0x4fd612[_0xf79f('0x2e')]!=='VIRTUAL'){var _0x5665a4={};_0x5665a4[_0x4fd612[_0xf79f('0x29')]]={'$like':'%'+_0x345259['query'][_0xf79f('0x3f')]+'%'};return _0x5665a4;}})});}_0x3b9e9b=_[_0xf79f('0x40')]({},_0x3b9e9b,_0x345259[_0xf79f('0x41')]);var _0x53443e={'where':_0x3b9e9b[_0xf79f('0x3c')]};return db['MailMessage'][_0xf79f('0x23')](_0x53443e)[_0xf79f('0x14')](function(_0x503061){_0x39a577[_0xf79f('0x23')]=_0x503061;if(_0x345259[_0xf79f('0x32')]['includeAll']){_0x3b9e9b['include']=[{'all':!![]}];}return db[_0xf79f('0x2c')]['findAll'](_0x3b9e9b);})[_0xf79f('0x14')](function(_0x381417){_0x39a577['rows']=_0x381417;return _0x39a577;})[_0xf79f('0x14')](respondWithFilteredResult(_0xfcb51b,_0x3b9e9b))['catch'](handleError(_0xfcb51b,null));};exports[_0xf79f('0x42')]=function(_0x44b1a0,_0x1462e6){var _0x265673={'raw':!![],'where':{'id':_0x44b1a0[_0xf79f('0x43')]['id']}},_0x35dd9d={};_0x35dd9d[_0xf79f('0x30')]=_[_0xf79f('0x33')](db[_0xf79f('0x2c')]['rawAttributes']);_0x35dd9d['query']=_[_0xf79f('0x33')](_0x44b1a0['query']);_0x35dd9d[_0xf79f('0x3e')]=_[_0xf79f('0x34')](_0x35dd9d['model'],_0x35dd9d['query']);_0x265673[_0xf79f('0x35')]=_[_0xf79f('0x34')](_0x35dd9d[_0xf79f('0x30')],qs['fields'](_0x44b1a0[_0xf79f('0x32')][_0xf79f('0x36')]));_0x265673[_0xf79f('0x35')]=_0x265673[_0xf79f('0x35')][_0xf79f('0x37')]?_0x265673[_0xf79f('0x35')]:_0x35dd9d[_0xf79f('0x30')];if(_0x44b1a0[_0xf79f('0x32')][_0xf79f('0x44')]){_0x265673[_0xf79f('0x45')]=[{'all':!![]}];}_0x265673=_[_0xf79f('0x40')]({},_0x265673,_0x44b1a0[_0xf79f('0x41')]);return db[_0xf79f('0x2c')][_0xf79f('0x46')](_0x265673)[_0xf79f('0x14')](handleEntityNotFound(_0x1462e6,null))[_0xf79f('0x14')](respondWithResult(_0x1462e6,null))[_0xf79f('0x47')](handleError(_0x1462e6,null));};exports[_0xf79f('0x26')]=function(_0x19e40f,_0x100554){if(_0x19e40f[_0xf79f('0x48')]['id']){delete _0x19e40f['body']['id'];}return db[_0xf79f('0x2c')][_0xf79f('0x46')]({'where':{'id':_0x19e40f[_0xf79f('0x43')]['id']}})['then'](handleEntityNotFound(_0x100554,null))[_0xf79f('0x14')](saveUpdates(_0x19e40f[_0xf79f('0x48')],null))['then'](respondWithResult(_0x100554,null))[_0xf79f('0x47')](handleError(_0x100554,null));};exports['destroy']=function(_0x5aaa78,_0x3e7792){return db['MailMessage'][_0xf79f('0x46')]({'where':{'id':_0x5aaa78[_0xf79f('0x43')]['id']}})[_0xf79f('0x14')](handleEntityNotFound(_0x3e7792,null))[_0xf79f('0x14')](removeEntity(_0x3e7792,null))[_0xf79f('0x47')](handleError(_0x3e7792,null));};exports[_0xf79f('0x49')]=function(_0x5f04d5,_0x2d2cf2){return db[_0xf79f('0x2c')]['describe']()[_0xf79f('0x14')](respondWithResult(_0x2d2cf2,null))['catch'](handleError(_0x2d2cf2,null));};exports[_0xf79f('0x4a')]=function(_0x5ea299,_0x30a2e2){return db['MailMessage'][_0xf79f('0x4a')](_0x5ea299['body'])[_0xf79f('0x14')](function(_0x5b34a8){if(_0x5b34a8){if(_0x5b34a8[_0xf79f('0x4b')]==='out'&&!_0x5b34a8[_0xf79f('0x4c')]){var _0x391cbe,_0xca15f7,_0x543816;if(_0x5ea299[_0xf79f('0x48')]['to']){_0xca15f7=_0x5ea299['body']['to'][_0xf79f('0x4d')](',')[0x0];}return db[_0xf79f('0x4e')]['findOne']({'where':{'id':_0x5b34a8['MailAccountId']},'include':[{'model':db[_0xf79f('0x4f')],'as':_0xf79f('0x50'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0xca15f7},'limit':0x1,'order':[[_0xf79f('0x51'),'DESC']]}]},{'model':db[_0xf79f('0x52')],'as':_0xf79f('0x53'),'raw':!![]}]})['then'](function(_0xd18f05){_0x391cbe=_0xd18f05;if(_0x391cbe&&_0x391cbe[_0xf79f('0x53')]){var _0x1a871f={'tls':{'rejectUnauthorized':![]}};if(_[_0xf79f('0x54')](_0x391cbe[_0xf79f('0x53')][_0xf79f('0x55')])){_0x1a871f[_0xf79f('0x56')]=_0x391cbe[_0xf79f('0x53')]['host'];_0x1a871f[_0xf79f('0x57')]=_0x391cbe[_0xf79f('0x53')]['port'];_0x1a871f[_0xf79f('0x58')]=_0x391cbe[_0xf79f('0x53')]['secure'];if(_0x391cbe[_0xf79f('0x53')][_0xf79f('0x59')]){_0x1a871f['auth']={'user':_0x391cbe[_0xf79f('0x53')][_0xf79f('0x5a')],'pass':_0x391cbe[_0xf79f('0x53')][_0xf79f('0x5b')]};}}else{_0x1a871f[_0xf79f('0x55')]=_0x391cbe[_0xf79f('0x53')][_0xf79f('0x55')];_0x1a871f['auth']={'user':_0x391cbe[_0xf79f('0x53')]['user'],'pass':_0x391cbe['Smtp'][_0xf79f('0x5b')]};_0x1a871f['secure']=_0x391cbe[_0xf79f('0x53')]['secure'];}if(_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')]&&_0x5ea299[_0xf79f('0x48')]['attachments'][_0xf79f('0x37')]){for(var _0x3988cc=0x0;_0x3988cc<_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')][_0xf79f('0x37')];_0x3988cc+=0x1){_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')][_0x3988cc]={'filename':_0x5ea299[_0xf79f('0x48')][_0xf79f('0x5c')][_0x3988cc]['name'],'path':path[_0xf79f('0x5d')](config[_0xf79f('0x5e')],_0xf79f('0x5f'),_0x5ea299['body'][_0xf79f('0x5c')][_0x3988cc][_0xf79f('0x60')])};}}_0x543816={'account':_0x1a871f,'message':_0x5ea299[_0xf79f('0x48')]};return;}})[_0xf79f('0x14')](function(){if(_0x391cbe[_0xf79f('0x50')]){if(_0x391cbe[_0xf79f('0x50')]['Contacts'][_0xf79f('0x37')]){return _0x391cbe[_0xf79f('0x50')][_0xf79f('0x61')][0x0];}else{return db[_0xf79f('0x62')][_0xf79f('0x4a')](_[_0xf79f('0xc')](_0x5ea299[_0xf79f('0x48')],{'firstName':_0x5ea299[_0xf79f('0x48')]['to'],'email':_0x5ea299[_0xf79f('0x48')]['to'],'phone':_0x5ea299['body']['to'],'ListId':_0x391cbe[_0xf79f('0x63')]}));}}else{throw new Error(_0xf79f('0x64'));}})[_0xf79f('0x14')](function(){if(_0x543816){return respondWithRpcPromise(_0xf79f('0x65'),'sendMail',_0x543816,client9003)[_0xf79f('0x14')](function(_0x210980){return _0x5b34a8[_0xf79f('0x26')]({'read':!![],'messageId':_0x210980[_0xf79f('0x66')],'sentAt':moment()[_0xf79f('0x67')](_0xf79f('0x68'))});})[_0xf79f('0x47')](function(_0xbf43bb){logger[_0xf79f('0x19')]('%s',JSON['stringify'](_0xbf43bb));return _0x5b34a8;});}return _0x5b34a8;});}return _0x5b34a8;}})[_0xf79f('0x14')](respondWithResult(_0x30a2e2,0xc9))[_0xf79f('0x47')](handleError(_0x30a2e2,null));};exports[_0xf79f('0x69')]=function(_0xef4d55,_0x4ae489){var _0x5ea359={'agent':{},'channel':_0xf79f('0x6a')};if(_0xef4d55[_0xf79f('0x48')]['id']){delete _0xef4d55['body']['id'];}_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6b')]=!![];_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6c')]=moment()['format'](_0xf79f('0x68'));_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6d')]=_0xef4d55['body'][_0xf79f('0x6d')]||_0xef4d55[_0xf79f('0x5a')]['id'];_0x5ea359[_0xf79f('0x6e')]['id']=_0xef4d55['body'][_0xf79f('0x6d')];return db['MailMessage'][_0xf79f('0x46')]({'where':{'id':_0xef4d55[_0xf79f('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ae489,null))['then'](saveUpdates(_0xef4d55[_0xf79f('0x48')],null))[_0xf79f('0x14')](function(_0x24abf0){if(_0x24abf0){_0x5ea359['message']=_0x24abf0[_0xf79f('0x6f')]({'plain':!![]});return db[_0xf79f('0x70')][_0xf79f('0x46')]({'where':{'id':_0x24abf0['MailInteractionId']}});}return null;})[_0xf79f('0x14')](handleEntityNotFound(_0x4ae489,null))[_0xf79f('0x14')](function(_0x25edfc){if(_0x25edfc){return _0x25edfc['update']({'UserId':_0xef4d55[_0xf79f('0x48')]['UserId'],'read1stAt':_[_0xf79f('0x54')](_0x25edfc[_0xf79f('0x71')])?moment()[_0xf79f('0x67')](_0xf79f('0x68')):undefined});}return null;})[_0xf79f('0x14')](function(_0x4b24a7){if(_0x4b24a7){_0x5ea359[_0xf79f('0x72')]=_0x4b24a7[_0xf79f('0x6f')]({'plain':!![]});interaction_log[_0xf79f('0x73')](_0xf79f('0x74'),_0xef4d55['user']['id'],_0xef4d55['user'][_0xf79f('0x29')],_0xef4d55[_0xf79f('0x5a')]['role'],_0x5ea359['interaction']['id'],_0xef4d55[_0xf79f('0x48')]?JSON['stringify'](_0xef4d55[_0xf79f('0x48')]):_0xf79f('0x75'));return respondWithRpcPromise(_0xf79f('0x76'),'acceptMessage',_0x5ea359);}return null;})['then'](function(_0x404837){var _0x14bd43=_0xf79f('0x77')+_0x404837[_0xf79f('0x1c')][_0xf79f('0x78')];return db[_0xf79f('0x79')][_0xf79f('0x32')](_0x14bd43,{'type':db['Sequelize'][_0xf79f('0x7a')][_0xf79f('0x7b')],'raw':!![]})[_0xf79f('0x14')](function(_0x5d3639){return _0x5d3639;});})[_0xf79f('0x14')](function(_0x206179){if(_0x206179){_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x7c')]=_0x206179[0x0];if(!_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6d')])return;return db[_0xf79f('0x7d')][_0xf79f('0x46')]({'where':{'id':_0xef4d55[_0xf79f('0x48')][_0xf79f('0x6d')],'role':_0xf79f('0x6e')},'attributes':['id',_0xf79f('0x29'),'fullname',_0xf79f('0x7e'),_0xf79f('0x7f')],'raw':!![]});}return null;})[_0xf79f('0x14')](function(_0x204dc6){if(!_0x204dc6)return null;_0x5ea359['message']['agent']=_0x204dc6;return _0x5ea359;})['then'](function(_0x3e9a2d){if(_0x3e9a2d){if(_0xef4d55[_0xf79f('0x48')]['manual']){_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x80')]=util['format'](_0xf79f('0x81'),_0xef4d55[_0xf79f('0x5a')]['name']);_0x5ea359[_0xf79f('0x1c')]['channel']=_0x5ea359[_0xf79f('0x82')];_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x83')]=_0x5ea359[_0xf79f('0x82')];_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x84')]=_0xf79f('0x69');_0x5ea359[_0xf79f('0x1c')]['body']=htmlToText[_0xf79f('0x85')](_0x5ea359[_0xf79f('0x1c')][_0xf79f('0x48')]);return respondWithRpcPromise(_0xf79f('0x86'),_0xf79f('0x86'),{'event':'acceptmessage','message':_0x5ea359[_0xf79f('0x1c')]},client9002)['then'](function(){return _0x5ea359;});}return _0x5ea359;}return null;})['then'](respondWithResult(_0x4ae489,null))['catch'](handleError(_0x4ae489,null));};exports['reject']=function(_0x813cd1,_0x15ec0f){var _0x395c80={'agent':{},'channel':_0xf79f('0x6a')};if(_0x813cd1[_0xf79f('0x48')]['id']){delete _0x813cd1['body']['id'];}_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')]=_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')]||_0x813cd1[_0xf79f('0x5a')]['id'];_0x395c80[_0xf79f('0x6e')]['id']=_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')];return db['MailMessage'][_0xf79f('0x46')]({'where':{'id':_0x813cd1['params']['id'],'UserId':null}})[_0xf79f('0x14')](handleEntityNotFound(_0x15ec0f,null))[_0xf79f('0x14')](function(_0x8a1a69){if(_0x8a1a69){_0x395c80[_0xf79f('0x1c')]=_0x8a1a69[_0xf79f('0x6f')]({'plain':!![]});return db[_0xf79f('0x70')][_0xf79f('0x46')]({'where':{'id':_0x8a1a69['MailInteractionId']}});}return null;})[_0xf79f('0x14')](handleEntityNotFound(_0x15ec0f,null))['then'](function(_0x188261){if(_0x188261){_0x395c80[_0xf79f('0x72')]=_0x188261[_0xf79f('0x6f')]({'plain':!![]});interaction_log[_0xf79f('0x73')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x813cd1[_0xf79f('0x5a')]['id'],_0x813cd1[_0xf79f('0x5a')][_0xf79f('0x29')],_0x813cd1[_0xf79f('0x5a')][_0xf79f('0x87')],_0x395c80['interaction']['id'],_0x813cd1[_0xf79f('0x48')]?JSON[_0xf79f('0x18')](_0x813cd1['body']):_0xf79f('0x75'));return respondWithRpcPromise(_0xf79f('0x88'),_0xf79f('0x89'),_0x395c80);}return null;})[_0xf79f('0x14')](function(_0x17a05e){var _0x42a1ec='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17a05e[_0xf79f('0x1c')][_0xf79f('0x78')];return db[_0xf79f('0x79')][_0xf79f('0x32')](_0x42a1ec,{'type':db[_0xf79f('0x8a')][_0xf79f('0x7a')][_0xf79f('0x7b')],'raw':!![]})[_0xf79f('0x14')](function(_0x2fd4a4){return _0x2fd4a4;});})['then'](function(_0x514b23){if(_0x514b23){_0x395c80[_0xf79f('0x1c')][_0xf79f('0x7c')]=_0x514b23[0x0];if(!_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')])return;return db[_0xf79f('0x7d')][_0xf79f('0x46')]({'where':{'id':_0x813cd1[_0xf79f('0x48')][_0xf79f('0x6d')],'role':_0xf79f('0x6e')},'attributes':['id','name',_0xf79f('0x8b'),_0xf79f('0x7e'),_0xf79f('0x7f')],'raw':!![]});}return null;})[_0xf79f('0x14')](function(_0x3bf82e){if(!_0x3bf82e)return null;_0x395c80['message'][_0xf79f('0x6e')]=_0x3bf82e;return _0x395c80;})['then'](function(_0x12d129){if(_0x12d129){_0x12d129[_0xf79f('0x1c')][_0xf79f('0x80')]=util[_0xf79f('0x67')](_0xf79f('0x81'),_0x813cd1['user'][_0xf79f('0x29')]);_0x12d129[_0xf79f('0x1c')][_0xf79f('0x82')]=_0x395c80[_0xf79f('0x82')];_0x12d129['message'][_0xf79f('0x83')]=_0x395c80[_0xf79f('0x82')];_0x12d129['message'][_0xf79f('0x84')]=_0xf79f('0x8c');_0x12d129[_0xf79f('0x1c')][_0xf79f('0x48')]=htmlToText[_0xf79f('0x85')](_0x395c80[_0xf79f('0x1c')]['body']);respondWithRpcPromise(_0xf79f('0x86'),_0xf79f('0x86'),{'event':_0xf79f('0x8d'),'message':_0x12d129[_0xf79f('0x1c')]},client9002);return _0x395c80;}return null;})[_0xf79f('0x14')](respondWithResult(_0x15ec0f,null))[_0xf79f('0x47')](handleError(_0x15ec0f,null));};exports[_0xf79f('0x8e')]=function(_0xe1f8e2,_0x36d386){var _0x48326b=moment()[_0xf79f('0x8f')]()[_0xf79f('0x90')]();var _0x24ee7b=path['join'](config[_0xf79f('0x5e')],_0xf79f('0x91'),_0xf79f('0x92'),'tmp');var _0x26dfd5=path[_0xf79f('0x5d')](config[_0xf79f('0x5e')],_0xf79f('0x91'),_0xf79f('0x92'),'attachments');var _0x5962e=util[_0xf79f('0x67')]('message-%s.eml',_0x48326b);return db[_0xf79f('0x2c')][_0xf79f('0x46')]({'where':{'id':_0xe1f8e2[_0xf79f('0x43')]['id']},'attributes':['id',_0xf79f('0x48'),_0xf79f('0x93'),'to','cc',_0xf79f('0x94'),_0xf79f('0x95'),'createdAt'],'include':_0xe1f8e2['query'][_0xf79f('0x5c')]?[{'model':db['Attachment'],'as':_0xf79f('0x96')}]:undefined})[_0xf79f('0x14')](handleEntityNotFound(_0x36d386,null))['then'](function(_0xc7855e){if(_0xc7855e){var _0xcb7145=_0xc7855e;var _0x369ab3={'from':_0xcb7145[_0xf79f('0x93')],'to':_0xcb7145['to'],'subject':_0xcb7145[_0xf79f('0x95')],'html':htmlEntities[_0xf79f('0x97')](_0xcb7145[_0xf79f('0x48')]),'headers':{'Date':moment(_0xcb7145['createdAt'])[_0xf79f('0x67')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xc7855e['cc']){_0x369ab3[_0xf79f('0x98')]['Cc']=_0xc7855e['cc'];}if(_0xc7855e[_0xf79f('0x94')]){_0x369ab3[_0xf79f('0x98')][_0xf79f('0x99')]=_0xc7855e[_0xf79f('0x94')];}return new BPromise(function(_0x27a68f,_0x1ff1ba){if(_0xc7855e['Attachments']){for(var _0x537c7a=0x0;_0x537c7a<_0xc7855e[_0xf79f('0x96')][_0xf79f('0x37')];_0x537c7a++){var _0xc058ce=_0xc7855e[_0xf79f('0x96')][_0x537c7a];var _0x118014=path[_0xf79f('0x5d')](_0x26dfd5,_0xc058ce[_0xf79f('0x60')]);if(fs[_0xf79f('0x9a')](_0x118014)){_0x369ab3['attachments']['push']({'name':_0xc058ce['name'],'contentType':_0xc058ce[_0xf79f('0x2e')],'data':fs['readFileSync'](_0x118014)});}}}emlformat[_0xf79f('0x9b')](_0x369ab3,function(_0x5ce2cf,_0x4febd6){if(_0x5ce2cf)return _0x1ff1ba(_0x5ce2cf);fs[_0xf79f('0x9c')](path[_0xf79f('0x5d')](_0x24ee7b,_0x5962e),_0x4febd6);return _0x27a68f(_0x4febd6);});});}})[_0xf79f('0x14')](function(_0x2f5d9c){if(_0x2f5d9c){return _0x36d386[_0xf79f('0x8e')](path['join'](_0x24ee7b,_0x5962e),_0x5962e,function(_0x5408eb){if(!_0x5408eb)fs[_0xf79f('0x9d')](path[_0xf79f('0x5d')](_0x24ee7b,_0x5962e));});}})[_0xf79f('0x47')](handleError(_0x36d386,null));}; \ No newline at end of file +var _0x5062=['options','includeAll','rows','params','keys','length','include','find','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','secure','authentication','auth','user','attachments','join','root','basename','CmContact','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','get','MailInteraction','MailInteractionId','UserId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','internal','agent','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','Sequelize','fullname','email','interface','download','toString','server','tmp','message-%s.eml','from','bcc','subject','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','util','path','ioredis','html-to-text','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','stack','name','send','index','MailMessage','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL'];(function(_0x4105a8,_0x198324){var _0x553f0c=function(_0x3720f5){while(--_0x3720f5){_0x4105a8['push'](_0x4105a8['shift']());}};_0x553f0c(++_0x198324);}(_0x5062,0x19b));var _0x2506=function(_0x3ae237,_0xfb5aaf){_0x3ae237=_0x3ae237-0x0;var _0xa6d62a=_0x5062[_0x3ae237];return _0xa6d62a;};'use strict';var emlformat=require(_0x2506('0x0'));var moment=require(_0x2506('0x1'));var BPromise=require('bluebird');var util=require(_0x2506('0x2'));var path=require(_0x2506('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2506('0x4'));var htmlToText=require(_0x2506('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x2506('0x6'))('api');var interaction_log=require('../../config/logger')(_0x2506('0x7'));var config=require(_0x2506('0x8'));var db=require('../../mysqldb')['db'];config[_0x2506('0x9')]=_[_0x2506('0xa')](config[_0x2506('0x9')],{'host':_0x2506('0xb'),'port':0x18eb});var socket=require(_0x2506('0xc'))(new Redis(config[_0x2506('0x9')]));var htmlEntities=require(_0x2506('0xd'));require('./mailMessage.socket')[_0x2506('0xe')](socket);var jayson=require(_0x2506('0xf'));var client=jayson[_0x2506('0x10')][_0x2506('0x11')]({'port':0x232c});var client9003=jayson[_0x2506('0x10')][_0x2506('0x11')]({'port':0x232b});var client9002=jayson['client'][_0x2506('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x2fcf5c,_0x5a44c2,_0x1dc445,_0x5cc04e){return new BPromise(function(_0xfea0d3,_0x457bbb){var _0x5d8ad6=_0x5cc04e||client;return _0x5d8ad6[_0x2506('0x12')](_0x2fcf5c,_0x1dc445)['then'](function(_0x1eb72f){logger[_0x2506('0x13')](_0x2506('0x14'),_0x5a44c2,_0x2506('0x15'));logger['debug'](_0x2506('0x16'),_0x5a44c2,_0x2506('0x15'),JSON[_0x2506('0x17')](_0x1eb72f));if(_0x1eb72f['error']){if(_0x1eb72f[_0x2506('0x18')][_0x2506('0x19')]===0x1f4){logger['error'](_0x2506('0x14'),_0x5a44c2,_0x1eb72f[_0x2506('0x18')][_0x2506('0x1a')]);return _0x457bbb(_0x1eb72f[_0x2506('0x18')]['message']);}logger[_0x2506('0x18')]('MailMessage,\x20%s,\x20%s',_0x5a44c2,_0x1eb72f[_0x2506('0x18')]['message']);return _0xfea0d3(_0x1eb72f[_0x2506('0x18')][_0x2506('0x1a')]);}else{logger['info'](_0x2506('0x14'),_0x5a44c2,_0x2506('0x15'));_0xfea0d3(_0x1eb72f[_0x2506('0x1b')][_0x2506('0x1a')]);}})[_0x2506('0x1c')](function(_0x2c83cb){logger[_0x2506('0x18')](_0x2506('0x14'),_0x5a44c2,_0x2c83cb);_0x457bbb(_0x2c83cb);});});}function respondWithResult(_0x2e68d0,_0x367f7f){_0x367f7f=_0x367f7f||0xc8;return function(_0x18f485){if(_0x18f485){return _0x2e68d0[_0x2506('0x1d')](_0x367f7f)[_0x2506('0x1e')](_0x18f485);}};}function respondWithFilteredResult(_0x13ec8b,_0x3eb938){return function(_0x3aade3){if(_0x3aade3){var _0x5a4ccd=typeof _0x3eb938[_0x2506('0x1f')]===_0x2506('0x20')&&typeof _0x3eb938[_0x2506('0x21')]==='undefined';var _0x3fcbef=_0x3aade3['count'];var _0x33c338=_0x5a4ccd?0x0:_0x3eb938[_0x2506('0x1f')];var _0x46841d=_0x5a4ccd?_0x3aade3[_0x2506('0x22')]:_0x3eb938[_0x2506('0x1f')]+_0x3eb938[_0x2506('0x21')];var _0x5daee9;if(_0x46841d>=_0x3fcbef){_0x46841d=_0x3fcbef;_0x5daee9=0xc8;}else{_0x5daee9=0xce;}_0x13ec8b[_0x2506('0x1d')](_0x5daee9);return _0x13ec8b['set'](_0x2506('0x23'),_0x33c338+'-'+_0x46841d+'/'+_0x3fcbef)[_0x2506('0x1e')](_0x3aade3);}return null;};}function saveUpdates(_0x47cd87){return function(_0x2413d5){if(_0x2413d5){return _0x2413d5[_0x2506('0x24')](_0x47cd87)[_0x2506('0x25')](function(_0x5c580e){return _0x5c580e;});}return null;};}function removeEntity(_0x429eb6){return function(_0x3e8d6b){if(_0x3e8d6b){return _0x3e8d6b[_0x2506('0x26')]()[_0x2506('0x25')](function(){_0x429eb6['status'](0xcc)[_0x2506('0x27')]();});}};}function handleEntityNotFound(_0x1bf46a){return function(_0x36451b){if(!_0x36451b){_0x1bf46a['sendStatus'](0x194);}return _0x36451b;};}function handleError(_0x2cbb00,_0x5c1a14){_0x5c1a14=_0x5c1a14||0x1f4;return function(_0x174b4b){logger[_0x2506('0x18')](_0x174b4b[_0x2506('0x28')]);if(_0x174b4b[_0x2506('0x29')]){delete _0x174b4b[_0x2506('0x29')];}_0x2cbb00['status'](_0x5c1a14)[_0x2506('0x2a')](_0x174b4b);};}exports[_0x2506('0x2b')]=function(_0x8d79b5,_0x58bc73){var _0x142650={},_0xf9ebc6={},_0x325039={'count':0x0,'rows':[]};var _0x22c910=_['map'](db[_0x2506('0x2c')][_0x2506('0x2d')],function(_0x50f3fa){return{'name':_0x50f3fa[_0x2506('0x2e')],'type':_0x50f3fa['type']['key']};});_0xf9ebc6[_0x2506('0x2f')]=_[_0x2506('0x30')](_0x22c910,_0x2506('0x29'));_0xf9ebc6['query']=_['keys'](_0x8d79b5[_0x2506('0x31')]);_0xf9ebc6[_0x2506('0x32')]=_[_0x2506('0x33')](_0xf9ebc6[_0x2506('0x2f')],_0xf9ebc6['query']);_0x142650[_0x2506('0x34')]=_[_0x2506('0x33')](_0xf9ebc6[_0x2506('0x2f')],qs[_0x2506('0x35')](_0x8d79b5[_0x2506('0x31')]['fields']));_0x142650[_0x2506('0x34')]=_0x142650[_0x2506('0x34')]['length']?_0x142650['attributes']:_0xf9ebc6['model'];if(!_0x8d79b5[_0x2506('0x31')][_0x2506('0x36')](_0x2506('0x37'))){_0x142650[_0x2506('0x21')]=qs['limit'](_0x8d79b5['query']['limit']);_0x142650[_0x2506('0x1f')]=qs['offset'](_0x8d79b5['query'][_0x2506('0x1f')]);}_0x142650[_0x2506('0x38')]=qs[_0x2506('0x39')](_0x8d79b5[_0x2506('0x31')]['sort']);_0x142650[_0x2506('0x3a')]=qs[_0x2506('0x32')](_['pick'](_0x8d79b5[_0x2506('0x31')],_0xf9ebc6[_0x2506('0x32')]),_0x22c910);if(_0x8d79b5['query'][_0x2506('0x3b')]){_0x142650[_0x2506('0x3a')]=_[_0x2506('0x3c')](_0x142650[_0x2506('0x3a')],{'$or':_['map'](_0x22c910,function(_0x492553){if(_0x492553[_0x2506('0x3d')]!==_0x2506('0x3e')){var _0x3d1130={};_0x3d1130[_0x492553[_0x2506('0x29')]]={'$like':'%'+_0x8d79b5['query'][_0x2506('0x3b')]+'%'};return _0x3d1130;}})});}_0x142650=_[_0x2506('0x3c')]({},_0x142650,_0x8d79b5[_0x2506('0x3f')]);var _0x308865={'where':_0x142650[_0x2506('0x3a')]};return db['MailMessage'][_0x2506('0x22')](_0x308865)[_0x2506('0x25')](function(_0x1ca46f){_0x325039[_0x2506('0x22')]=_0x1ca46f;if(_0x8d79b5[_0x2506('0x31')][_0x2506('0x40')]){_0x142650['include']=[{'all':!![]}];}return db[_0x2506('0x2c')]['findAll'](_0x142650);})[_0x2506('0x25')](function(_0x1d115e){_0x325039[_0x2506('0x41')]=_0x1d115e;return _0x325039;})['then'](respondWithFilteredResult(_0x58bc73,_0x142650))['catch'](handleError(_0x58bc73,null));};exports['show']=function(_0x41b581,_0x171976){var _0xbd226b={'raw':!![],'where':{'id':_0x41b581[_0x2506('0x42')]['id']}},_0x4d7b5d={};_0x4d7b5d[_0x2506('0x2f')]=_[_0x2506('0x43')](db[_0x2506('0x2c')][_0x2506('0x2d')]);_0x4d7b5d[_0x2506('0x31')]=_[_0x2506('0x43')](_0x41b581[_0x2506('0x31')]);_0x4d7b5d['filters']=_['intersection'](_0x4d7b5d['model'],_0x4d7b5d['query']);_0xbd226b[_0x2506('0x34')]=_[_0x2506('0x33')](_0x4d7b5d[_0x2506('0x2f')],qs[_0x2506('0x35')](_0x41b581['query'][_0x2506('0x35')]));_0xbd226b[_0x2506('0x34')]=_0xbd226b[_0x2506('0x34')][_0x2506('0x44')]?_0xbd226b[_0x2506('0x34')]:_0x4d7b5d[_0x2506('0x2f')];if(_0x41b581[_0x2506('0x31')][_0x2506('0x40')]){_0xbd226b[_0x2506('0x45')]=[{'all':!![]}];}_0xbd226b=_[_0x2506('0x3c')]({},_0xbd226b,_0x41b581[_0x2506('0x3f')]);return db[_0x2506('0x2c')][_0x2506('0x46')](_0xbd226b)[_0x2506('0x25')](handleEntityNotFound(_0x171976,null))['then'](respondWithResult(_0x171976,null))['catch'](handleError(_0x171976,null));};exports[_0x2506('0x24')]=function(_0x21ad19,_0x29c664){if(_0x21ad19['body']['id']){delete _0x21ad19[_0x2506('0x47')]['id'];}return db['MailMessage'][_0x2506('0x46')]({'where':{'id':_0x21ad19[_0x2506('0x42')]['id']}})['then'](handleEntityNotFound(_0x29c664,null))[_0x2506('0x25')](saveUpdates(_0x21ad19[_0x2506('0x47')],null))['then'](respondWithResult(_0x29c664,null))[_0x2506('0x1c')](handleError(_0x29c664,null));};exports[_0x2506('0x26')]=function(_0x37740f,_0x1df881){return db[_0x2506('0x2c')][_0x2506('0x46')]({'where':{'id':_0x37740f[_0x2506('0x42')]['id']}})[_0x2506('0x25')](handleEntityNotFound(_0x1df881,null))['then'](removeEntity(_0x1df881,null))[_0x2506('0x1c')](handleError(_0x1df881,null));};exports[_0x2506('0x48')]=function(_0x270d98,_0x1abcd1){return db['MailMessage'][_0x2506('0x48')]()['then'](respondWithResult(_0x1abcd1,null))['catch'](handleError(_0x1abcd1,null));};exports[_0x2506('0x49')]=function(_0x3c8ca2,_0x4a8fde){return db[_0x2506('0x2c')][_0x2506('0x49')](_0x3c8ca2[_0x2506('0x47')])[_0x2506('0x25')](function(_0x5f0957){if(_0x5f0957){if(_0x5f0957[_0x2506('0x4a')]===_0x2506('0x4b')&&!_0x5f0957['secret']){var _0x98690c,_0x51efe5,_0x314d0c;if(_0x3c8ca2['body']['to']){_0x51efe5=_0x3c8ca2['body']['to'][_0x2506('0x4c')](',')[0x0];}return db[_0x2506('0x4d')][_0x2506('0x4e')]({'where':{'id':_0x5f0957[_0x2506('0x4f')]},'include':[{'model':db['CmList'],'as':_0x2506('0x50'),'include':[{'model':db['CmContact'],'as':_0x2506('0x51'),'where':{'email':_0x51efe5},'limit':0x1,'order':[[_0x2506('0x52'),_0x2506('0x53')]]}]},{'model':db[_0x2506('0x54')],'as':'Smtp','raw':!![]}]})[_0x2506('0x25')](function(_0x43277d){_0x98690c=_0x43277d;if(_0x98690c&&_0x98690c[_0x2506('0x55')]){var _0x33065e={'tls':{'rejectUnauthorized':![]}};if(_[_0x2506('0x56')](_0x98690c[_0x2506('0x55')][_0x2506('0x57')])){_0x33065e[_0x2506('0x58')]=_0x98690c[_0x2506('0x55')][_0x2506('0x58')];_0x33065e['port']=_0x98690c[_0x2506('0x55')]['port'];_0x33065e['secure']=_0x98690c[_0x2506('0x55')][_0x2506('0x59')];if(_0x98690c[_0x2506('0x55')][_0x2506('0x5a')]){_0x33065e[_0x2506('0x5b')]={'user':_0x98690c[_0x2506('0x55')][_0x2506('0x5c')],'pass':_0x98690c[_0x2506('0x55')]['pass']};}}else{_0x33065e[_0x2506('0x57')]=_0x98690c['Smtp']['service'];_0x33065e[_0x2506('0x5b')]={'user':_0x98690c[_0x2506('0x55')][_0x2506('0x5c')],'pass':_0x98690c[_0x2506('0x55')]['pass']};_0x33065e[_0x2506('0x59')]=_0x98690c['Smtp'][_0x2506('0x59')];}if(_0x3c8ca2[_0x2506('0x47')][_0x2506('0x5d')]&&_0x3c8ca2[_0x2506('0x47')][_0x2506('0x5d')][_0x2506('0x44')]){for(var _0x45ced3=0x0;_0x45ced3<_0x3c8ca2[_0x2506('0x47')][_0x2506('0x5d')]['length'];_0x45ced3+=0x1){_0x3c8ca2['body'][_0x2506('0x5d')][_0x45ced3]={'filename':_0x3c8ca2['body'][_0x2506('0x5d')][_0x45ced3][_0x2506('0x29')],'path':path[_0x2506('0x5e')](config[_0x2506('0x5f')],'server/files/attachments',_0x3c8ca2[_0x2506('0x47')][_0x2506('0x5d')][_0x45ced3][_0x2506('0x60')])};}}_0x314d0c={'account':_0x33065e,'message':_0x3c8ca2[_0x2506('0x47')]};return;}})[_0x2506('0x25')](function(){if(_0x98690c[_0x2506('0x50')]){if(_0x98690c[_0x2506('0x50')][_0x2506('0x51')][_0x2506('0x44')]){return _0x98690c[_0x2506('0x50')][_0x2506('0x51')][0x0];}else{return db[_0x2506('0x61')]['create'](_[_0x2506('0xa')](_0x3c8ca2[_0x2506('0x47')],{'firstName':_0x3c8ca2['body']['to'],'email':_0x3c8ca2[_0x2506('0x47')]['to'],'phone':_0x3c8ca2[_0x2506('0x47')]['to'],'ListId':_0x98690c['ListId']}));}}else{throw new Error(_0x2506('0x62'));}})[_0x2506('0x25')](function(){if(_0x314d0c){return respondWithRpcPromise(_0x2506('0x63'),_0x2506('0x64'),_0x314d0c,client9003)[_0x2506('0x25')](function(_0x473f13){return _0x5f0957[_0x2506('0x24')]({'read':!![],'messageId':_0x473f13[_0x2506('0x65')],'sentAt':moment()[_0x2506('0x66')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x398878){logger[_0x2506('0x18')]('%s',JSON[_0x2506('0x17')](_0x398878));return _0x5f0957;});}return _0x5f0957;});}return _0x5f0957;}})[_0x2506('0x25')](respondWithResult(_0x4a8fde,0xc9))['catch'](handleError(_0x4a8fde,null));};exports[_0x2506('0x67')]=function(_0x47f0fc,_0x450d68){var _0x2c2bbe={'agent':{},'channel':_0x2506('0x68')};if(_0x47f0fc['body']['id']){delete _0x47f0fc[_0x2506('0x47')]['id'];}_0x47f0fc[_0x2506('0x47')]['read']=!![];_0x47f0fc[_0x2506('0x47')][_0x2506('0x69')]=moment()[_0x2506('0x66')](_0x2506('0x6a'));_0x47f0fc[_0x2506('0x47')]['UserId']=_0x47f0fc[_0x2506('0x47')]['UserId']||_0x47f0fc[_0x2506('0x5c')]['id'];_0x2c2bbe['agent']['id']=_0x47f0fc['body']['UserId'];return db['MailMessage']['find']({'where':{'id':_0x47f0fc[_0x2506('0x42')]['id'],'UserId':null}})[_0x2506('0x25')](handleEntityNotFound(_0x450d68,null))[_0x2506('0x25')](saveUpdates(_0x47f0fc['body'],null))[_0x2506('0x25')](function(_0x1b8824){if(_0x1b8824){_0x2c2bbe[_0x2506('0x1a')]=_0x1b8824[_0x2506('0x6b')]({'plain':!![]});return db[_0x2506('0x6c')][_0x2506('0x46')]({'where':{'id':_0x1b8824[_0x2506('0x6d')]}});}return null;})[_0x2506('0x25')](handleEntityNotFound(_0x450d68,null))[_0x2506('0x25')](function(_0x3c8787){if(_0x3c8787){return _0x3c8787[_0x2506('0x24')]({'UserId':_0x47f0fc[_0x2506('0x47')][_0x2506('0x6e')],'read1stAt':_['isNil'](_0x3c8787[_0x2506('0x6f')])?moment()[_0x2506('0x66')](_0x2506('0x6a')):undefined});}return null;})[_0x2506('0x25')](function(_0x5b1897){if(_0x5b1897){_0x2c2bbe[_0x2506('0x70')]=_0x5b1897[_0x2506('0x6b')]({'plain':!![]});interaction_log[_0x2506('0x13')](_0x2506('0x71'),_0x47f0fc[_0x2506('0x5c')]['id'],_0x47f0fc['user'][_0x2506('0x29')],_0x47f0fc['user'][_0x2506('0x72')],_0x2c2bbe['interaction']['id'],_0x47f0fc[_0x2506('0x47')]?JSON['stringify'](_0x47f0fc['body']):_0x2506('0x73'));return respondWithRpcPromise(_0x2506('0x74'),_0x2506('0x75'),_0x2c2bbe);}return null;})[_0x2506('0x25')](function(_0x3031c9){var _0x42a511=_0x2506('0x76')+_0x3031c9['message'][_0x2506('0x77')];return db[_0x2506('0x78')][_0x2506('0x31')](_0x42a511,{'type':db['Sequelize'][_0x2506('0x79')][_0x2506('0x7a')],'raw':!![]})[_0x2506('0x25')](function(_0x13c386){return _0x13c386;});})[_0x2506('0x25')](function(_0x39c1bc){if(_0x39c1bc){_0x2c2bbe[_0x2506('0x1a')][_0x2506('0x7b')]=_0x39c1bc[0x0];if(!_0x47f0fc[_0x2506('0x47')][_0x2506('0x6e')])return;return db[_0x2506('0x7c')][_0x2506('0x46')]({'where':{'id':_0x47f0fc[_0x2506('0x47')]['UserId'],'role':'agent'},'attributes':['id',_0x2506('0x29'),'fullname','email',_0x2506('0x7d')],'raw':!![]});}return null;})[_0x2506('0x25')](function(_0x188543){if(!_0x188543)return null;_0x2c2bbe[_0x2506('0x1a')][_0x2506('0x7e')]=_0x188543;return _0x2c2bbe;})['then'](function(_0x681280){if(_0x681280){if(_0x47f0fc['body'][_0x2506('0x7f')]){_0x2c2bbe[_0x2506('0x1a')]['interface']=util[_0x2506('0x66')](_0x2506('0x80'),_0x47f0fc[_0x2506('0x5c')][_0x2506('0x29')]);_0x2c2bbe[_0x2506('0x1a')][_0x2506('0x81')]=_0x2c2bbe['channel'];_0x2c2bbe[_0x2506('0x1a')][_0x2506('0x82')]=_0x2c2bbe[_0x2506('0x81')];_0x2c2bbe[_0x2506('0x1a')][_0x2506('0x83')]=_0x2506('0x67');_0x2c2bbe[_0x2506('0x1a')][_0x2506('0x47')]=htmlToText[_0x2506('0x84')](_0x2c2bbe['message'][_0x2506('0x47')]);return respondWithRpcPromise(_0x2506('0x85'),_0x2506('0x85'),{'event':_0x2506('0x86'),'message':_0x2c2bbe[_0x2506('0x1a')]},client9002)[_0x2506('0x25')](function(){return _0x2c2bbe;});}return _0x2c2bbe;}return null;})[_0x2506('0x25')](respondWithResult(_0x450d68,null))[_0x2506('0x1c')](handleError(_0x450d68,null));};exports[_0x2506('0x87')]=function(_0x1062ee,_0x16652c){var _0x118a54={'agent':{},'channel':_0x2506('0x68')};if(_0x1062ee[_0x2506('0x47')]['id']){delete _0x1062ee['body']['id'];}_0x1062ee['body'][_0x2506('0x6e')]=_0x1062ee[_0x2506('0x47')][_0x2506('0x6e')]||_0x1062ee[_0x2506('0x5c')]['id'];_0x118a54[_0x2506('0x7e')]['id']=_0x1062ee['body'][_0x2506('0x6e')];return db[_0x2506('0x2c')][_0x2506('0x46')]({'where':{'id':_0x1062ee[_0x2506('0x42')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x16652c,null))['then'](function(_0x5a9ba4){if(_0x5a9ba4){_0x118a54[_0x2506('0x1a')]=_0x5a9ba4[_0x2506('0x6b')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5a9ba4[_0x2506('0x6d')]}});}return null;})[_0x2506('0x25')](handleEntityNotFound(_0x16652c,null))['then'](function(_0x342fb4){if(_0x342fb4){_0x118a54[_0x2506('0x70')]=_0x342fb4[_0x2506('0x6b')]({'plain':!![]});interaction_log[_0x2506('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1062ee[_0x2506('0x5c')]['id'],_0x1062ee[_0x2506('0x5c')][_0x2506('0x29')],_0x1062ee['user']['role'],_0x118a54[_0x2506('0x70')]['id'],_0x1062ee['body']?JSON[_0x2506('0x17')](_0x1062ee[_0x2506('0x47')]):_0x2506('0x73'));return respondWithRpcPromise(_0x2506('0x88'),_0x2506('0x89'),_0x118a54);}return null;})[_0x2506('0x25')](function(_0x27e891){var _0x44e511=_0x2506('0x76')+_0x27e891[_0x2506('0x1a')][_0x2506('0x77')];return db['sequelize'][_0x2506('0x31')](_0x44e511,{'type':db[_0x2506('0x8a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x2cab17){return _0x2cab17;});})[_0x2506('0x25')](function(_0x440815){if(_0x440815){_0x118a54[_0x2506('0x1a')][_0x2506('0x7b')]=_0x440815[0x0];if(!_0x1062ee[_0x2506('0x47')][_0x2506('0x6e')])return;return db[_0x2506('0x7c')][_0x2506('0x46')]({'where':{'id':_0x1062ee['body'][_0x2506('0x6e')],'role':_0x2506('0x7e')},'attributes':['id',_0x2506('0x29'),_0x2506('0x8b'),_0x2506('0x8c'),_0x2506('0x7d')],'raw':!![]});}return null;})[_0x2506('0x25')](function(_0x426560){if(!_0x426560)return null;_0x118a54['message'][_0x2506('0x7e')]=_0x426560;return _0x118a54;})[_0x2506('0x25')](function(_0x3b7652){if(_0x3b7652){_0x3b7652['message'][_0x2506('0x8d')]=util[_0x2506('0x66')](_0x2506('0x80'),_0x1062ee[_0x2506('0x5c')][_0x2506('0x29')]);_0x3b7652[_0x2506('0x1a')][_0x2506('0x81')]=_0x118a54['channel'];_0x3b7652[_0x2506('0x1a')][_0x2506('0x82')]=_0x118a54[_0x2506('0x81')];_0x3b7652[_0x2506('0x1a')][_0x2506('0x83')]='reject';_0x3b7652[_0x2506('0x1a')]['body']=htmlToText[_0x2506('0x84')](_0x118a54[_0x2506('0x1a')]['body']);respondWithRpcPromise(_0x2506('0x85'),_0x2506('0x85'),{'event':'rejectmessage','message':_0x3b7652['message']},client9002);return _0x118a54;}return null;})[_0x2506('0x25')](respondWithResult(_0x16652c,null))['catch'](handleError(_0x16652c,null));};exports[_0x2506('0x8e')]=function(_0x72614e,_0x24375a){var _0x2094f3=moment()['unix']()[_0x2506('0x8f')]();var _0x2551de=path['join'](config['root'],_0x2506('0x90'),'files',_0x2506('0x91'));var _0x123d31=path[_0x2506('0x5e')](config[_0x2506('0x5f')],_0x2506('0x90'),'files',_0x2506('0x5d'));var _0x25ee92=util[_0x2506('0x66')](_0x2506('0x92'),_0x2094f3);return db[_0x2506('0x2c')][_0x2506('0x46')]({'where':{'id':_0x72614e[_0x2506('0x42')]['id']},'attributes':['id',_0x2506('0x47'),_0x2506('0x93'),'to','cc',_0x2506('0x94'),_0x2506('0x95'),'createdAt'],'include':_0x72614e[_0x2506('0x31')][_0x2506('0x5d')]?[{'model':db['Attachment'],'as':_0x2506('0x96')}]:undefined})[_0x2506('0x25')](handleEntityNotFound(_0x24375a,null))[_0x2506('0x25')](function(_0x1ec2c5){if(_0x1ec2c5){var _0x365ab7=_0x1ec2c5;var _0x30a516={'from':_0x365ab7[_0x2506('0x93')],'to':_0x365ab7['to'],'subject':_0x365ab7['subject'],'html':htmlEntities[_0x2506('0x97')](_0x365ab7[_0x2506('0x47')]),'headers':{'Date':moment(_0x365ab7['createdAt'])[_0x2506('0x66')](_0x2506('0x98'))},'attachments':[]};if(_0x1ec2c5['cc']){_0x30a516['headers']['Cc']=_0x1ec2c5['cc'];}if(_0x1ec2c5[_0x2506('0x94')]){_0x30a516[_0x2506('0x99')]['Bcc']=_0x1ec2c5['bcc'];}return new BPromise(function(_0x2a2c5f,_0x302067){if(_0x1ec2c5[_0x2506('0x96')]){for(var _0x2a5e1b=0x0;_0x2a5e1b<_0x1ec2c5['Attachments'][_0x2506('0x44')];_0x2a5e1b++){var _0x461867=_0x1ec2c5[_0x2506('0x96')][_0x2a5e1b];var _0xf1ad34=path[_0x2506('0x5e')](_0x123d31,_0x461867[_0x2506('0x60')]);if(fs['existsSync'](_0xf1ad34)){_0x30a516['attachments'][_0x2506('0x9a')]({'name':_0x461867[_0x2506('0x29')],'contentType':_0x461867['type'],'data':fs[_0x2506('0x9b')](_0xf1ad34)});}}}emlformat['build'](_0x30a516,function(_0x4ed38f,_0x43c688){if(_0x4ed38f)return _0x302067(_0x4ed38f);fs[_0x2506('0x9c')](path[_0x2506('0x5e')](_0x2551de,_0x25ee92),_0x43c688);return _0x2a2c5f(_0x43c688);});});}})[_0x2506('0x25')](function(_0x55701a){if(_0x55701a){return _0x24375a[_0x2506('0x8e')](path[_0x2506('0x5e')](_0x2551de,_0x25ee92),_0x25ee92,function(_0x1fecdd){if(!_0x1fecdd)fs[_0x2506('0x9d')](path[_0x2506('0x5e')](_0x2551de,_0x25ee92));});}})[_0x2506('0x1c')](handleError(_0x24375a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1a554aa..e464ddc 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 _0x7092=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7092,0xbf));var _0x2709=function(_0x45190b,_0x3c50c1){_0x45190b=_0x45190b-0x0;var _0x5d840a=_0x7092[_0x45190b];return _0x5d840a;};'use strict';var EventEmitter=require(_0x2709('0x0'));var MailMessage=require(_0x2709('0x1'))['db'][_0x2709('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2709('0x3')](0x0);var events={'afterCreate':_0x2709('0x4'),'afterUpdate':_0x2709('0x5'),'afterDestroy':'remove'};function emitEvent(_0x13bb18){return function(_0x1b9184,_0x14089d,_0x1c9982){MailMessageEvents[_0x2709('0x6')](_0x13bb18+':'+_0x1b9184['id'],_0x1b9184);MailMessageEvents[_0x2709('0x6')](_0x13bb18,_0x1b9184);_0x1c9982(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x2709('0x7')](e,emitEvent(event));}}module[_0x2709('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x98f0=['update','remove','emit','hook','exports','MailMessage','setMaxListeners','save'];(function(_0x34d635,_0x2784fc){var _0x3ab288=function(_0x41589b){while(--_0x41589b){_0x34d635['push'](_0x34d635['shift']());}};_0x3ab288(++_0x2784fc);}(_0x98f0,0x75));var _0x098f=function(_0x322139,_0x30bda7){_0x322139=_0x322139-0x0;var _0x3d433e=_0x98f0[_0x322139];return _0x3d433e;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x098f('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x098f('0x1')](0x0);var events={'afterCreate':_0x098f('0x2'),'afterUpdate':_0x098f('0x3'),'afterDestroy':_0x098f('0x4')};function emitEvent(_0x22cbee){return function(_0x3a2e59,_0x44c6ec,_0x220894){MailMessageEvents[_0x098f('0x5')](_0x22cbee+':'+_0x3a2e59['id'],_0x3a2e59);MailMessageEvents[_0x098f('0x5')](_0x22cbee,_0x3a2e59);_0x220894(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x098f('0x6')](e,emitEvent(event));}}module[_0x098f('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 efb2cc5..7b291dd 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 _0x259d=['MailInteraction','MailInteractionId','then','createdAt','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','models','get','secret','isNil','UserId'];(function(_0x4f8a6b,_0x304a9c){var _0x477b4a=function(_0x280771){while(--_0x280771){_0x4f8a6b['push'](_0x4f8a6b['shift']());}};_0x477b4a(++_0x304a9c);}(_0x259d,0xd3));var _0xd259=function(_0x344724,_0x3c17a9){_0x344724=_0x344724-0x0;var _0x59c303=_0x259d[_0x344724];return _0x59c303;};'use strict';var _=require(_0xd259('0x0'));var util=require(_0xd259('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd259('0x2'));var rp=require('request-promise');var htmlToText=require(_0xd259('0x3'));var fs=require('fs');var path=require(_0xd259('0x4'));var rimraf=require(_0xd259('0x5'));var config=require('../../config/environment');var attributes=require(_0xd259('0x6'));module[_0xd259('0x7')]=function(_0x96c415,_0x580de9){return _0x96c415[_0xd259('0x8')](_0xd259('0x9'),attributes,{'tableName':_0xd259('0xa'),'paranoid':![],'indexes':[{'name':_0xd259('0xb'),'fields':[_0xd259('0xb')]},{'name':_0xd259('0xc'),'fields':[_0xd259('0xd'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x807942,_0x33d9ad,_0x2e036d){if(_0x807942[_0xd259('0xe')]){_0x807942['plainBody']=htmlToText[_0xd259('0xf')](_0x807942['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2e036d(null,_0x33d9ad);},'afterCreate':function(_0x3cbeb5,_0x5e02c8,_0x139435){var _0x256214=_0x96c415[_0xd259('0x10')];var _0x543c1a=_0x3cbeb5[_0xd259('0x11')]({'plain':!![]});if(_0x543c1a['direction']['toLowerCase']()==='in'||_0x543c1a['direction']['toLowerCase']()==='out'&&!_0x543c1a[_0xd259('0x12')]&&!_[_0xd259('0x13')](_0x543c1a[_0xd259('0x14')])){_0x256214[_0xd259('0x15')]['findOne']({'where':{'id':_0x543c1a[_0xd259('0x16')]}})[_0xd259('0x17')](function(_0x1ca614){if(_0x1ca614){_0x1ca614['update']({'lastMsgAt':_0x543c1a[_0xd259('0x18')],'lastMsgDirection':_0x543c1a['direction'][_0xd259('0x19')]()});}})['catch'](function(_0x11b93b){console[_0xd259('0x1a')](_0x11b93b);});}_0x139435();}},'charset':_0xd259('0x1b'),'collate':_0xd259('0x1c')});}; \ No newline at end of file +var _0xf3f6=['request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','direction','toLowerCase','out','UserId','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x85149b,_0x450b32){var _0x50f33c=function(_0x428f4a){while(--_0x428f4a){_0x85149b['push'](_0x85149b['shift']());}};_0x50f33c(++_0x450b32);}(_0xf3f6,0x12f));var _0x6f3f=function(_0x3473ae,_0xa2b419){_0x3473ae=_0x3473ae-0x0;var _0x22278c=_0xf3f6[_0x3473ae];return _0x22278c;};'use strict';var _=require(_0x6f3f('0x0'));var util=require(_0x6f3f('0x1'));var logger=require('../../config/logger')(_0x6f3f('0x2'));var moment=require(_0x6f3f('0x3'));var BPromise=require(_0x6f3f('0x4'));var rp=require(_0x6f3f('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x6f3f('0x6'));var rimraf=require(_0x6f3f('0x7'));var config=require(_0x6f3f('0x8'));var attributes=require(_0x6f3f('0x9'));module['exports']=function(_0x14dfa3,_0x254cb5){return _0x14dfa3['define'](_0x6f3f('0xa'),attributes,{'tableName':_0x6f3f('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x6f3f('0xc')]},{'name':_0x6f3f('0xd'),'fields':[_0x6f3f('0xe'),_0x6f3f('0xf')],'type':_0x6f3f('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53c83e,_0x59efef,_0xd3d9ba){if(_0x53c83e[_0x6f3f('0x11')]){_0x53c83e['plainBody']=htmlToText['fromString'](_0x53c83e[_0x6f3f('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xd3d9ba(null,_0x59efef);},'afterCreate':function(_0x4bcf47,_0x4c4986,_0x23be7a){var _0x2c12e9=_0x14dfa3['models'];var _0x25c965=_0x4bcf47['get']({'plain':!![]});if(_0x25c965[_0x6f3f('0x12')][_0x6f3f('0x13')]()==='in'||_0x25c965[_0x6f3f('0x12')][_0x6f3f('0x13')]()===_0x6f3f('0x14')&&!_0x25c965['secret']&&!_['isNil'](_0x25c965[_0x6f3f('0x15')])){_0x2c12e9['MailInteraction'][_0x6f3f('0x16')]({'where':{'id':_0x25c965['MailInteractionId']}})['then'](function(_0x5e49a5){if(_0x5e49a5){_0x5e49a5['update']({'lastMsgAt':_0x25c965[_0x6f3f('0x17')],'lastMsgDirection':_0x25c965['direction'][_0x6f3f('0x13')]()});}})[_0x6f3f('0x18')](function(_0x3b8bfd){console[_0x6f3f('0x19')](_0x3b8bfd);});}_0x23be7a();}},'charset':_0x6f3f('0x1a'),'collate':_0x6f3f('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index de6680b..83f2320 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 _0xd824=['request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x32b5ca,_0x43e981){var _0x3ca5ab=function(_0x46bd8d){while(--_0x46bd8d){_0x32b5ca['push'](_0x32b5ca['shift']());}};_0x3ca5ab(++_0x43e981);}(_0xd824,0xc2));var _0x4d82=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd824[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4d82('0x9')](config[_0x4d82('0xa')],{'host':_0x4d82('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d82('0xa')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x580bbd,_0x27b777,_0x392f17){return new BPromise(function(_0x480c05,_0x318d1d){return client['request'](_0x580bbd,_0x392f17)[_0x4d82('0xc')](function(_0x303645){logger[_0x4d82('0xd')]('MailMessage,\x20%s,\x20%s',_0x27b777,'request\x20sent');logger[_0x4d82('0xe')](_0x4d82('0xf'),_0x27b777,_0x4d82('0x10'),JSON[_0x4d82('0x11')](_0x303645));if(_0x303645['error']){if(_0x303645[_0x4d82('0x12')][_0x4d82('0x13')]===0x1f4){logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')]['message']);return _0x318d1d(_0x303645[_0x4d82('0x12')]['message']);}logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);return _0x480c05(_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);}else{logger[_0x4d82('0xd')](_0x4d82('0x15'),_0x27b777,_0x4d82('0x10'));_0x480c05(_0x303645[_0x4d82('0x16')][_0x4d82('0x14')]);}})['catch'](function(_0x2919b0){logger[_0x4d82('0x12')](_0x4d82('0x15'),_0x27b777,_0x2919b0);_0x318d1d(_0x2919b0);});});}exports[_0x4d82('0x17')]=function(_0xe6260){var _0xd5f47=this;return new Promise(function(_0x1a513d,_0x64669c){return db[_0x4d82('0x18')][_0x4d82('0x19')](_0xe6260[_0x4d82('0x1a')],{'raw':_0xe6260['options']?_0xe6260[_0x4d82('0x1b')][_0x4d82('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1a419f){logger[_0x4d82('0xd')](_0x4d82('0x17'),_0xe6260);logger[_0x4d82('0xe')](_0x4d82('0x17'),_0xe6260,JSON[_0x4d82('0x11')](_0x1a419f));_0x1a513d(_0x1a419f);})[_0x4d82('0x1d')](function(_0x462258){logger[_0x4d82('0x12')](_0x4d82('0x17'),_0x462258[_0x4d82('0x14')],_0xe6260);_0x64669c(_0xd5f47[_0x4d82('0x12')](0x1f4,_0x462258[_0x4d82('0x14')]));});});}; \ No newline at end of file +var _0x1775=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});config[_0x5177('0xd')]=_[_0x5177('0xe')](config[_0x5177('0xd')],{'host':_0x5177('0xf'),'port':0x18eb});var socket=require(_0x5177('0x10'))(new Redis(config[_0x5177('0xd')]));require(_0x5177('0x11'))[_0x5177('0x12')](socket);function respondWithRpcPromise(_0x206035,_0x5bdca9,_0x4ae3d2){return new BPromise(function(_0x13c7f6,_0x1d7116){return client[_0x5177('0x13')](_0x206035,_0x4ae3d2)[_0x5177('0x14')](function(_0x301db2){logger['info'](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));logger[_0x5177('0x17')](_0x5177('0x18'),_0x5bdca9,_0x5177('0x16'),JSON[_0x5177('0x19')](_0x301db2));if(_0x301db2[_0x5177('0x1a')]){if(_0x301db2[_0x5177('0x1a')][_0x5177('0x1b')]===0x1f4){logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x1d7116(_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);}logger[_0x5177('0x1a')](_0x5177('0x15'),_0x5bdca9,_0x301db2[_0x5177('0x1a')][_0x5177('0x1c')]);return _0x13c7f6(_0x301db2['error'][_0x5177('0x1c')]);}else{logger[_0x5177('0x1d')](_0x5177('0x15'),_0x5bdca9,_0x5177('0x16'));_0x13c7f6(_0x301db2['result'][_0x5177('0x1c')]);}})[_0x5177('0x1e')](function(_0x13d5d4){logger['error'](_0x5177('0x15'),_0x5bdca9,_0x13d5d4);_0x1d7116(_0x13d5d4);});});}exports['CreateMailMessage']=function(_0xc2b2b5){var _0xe221b3=this;return new Promise(function(_0x219744,_0x27b732){return db[_0x5177('0x1f')][_0x5177('0x20')](_0xc2b2b5[_0x5177('0x21')],{'raw':_0xc2b2b5[_0x5177('0x22')]?_0xc2b2b5[_0x5177('0x22')][_0x5177('0x23')]===undefined?!![]:![]:!![]})[_0x5177('0x14')](function(_0x3b0c37){logger['info'](_0x5177('0x24'),_0xc2b2b5);logger['debug'](_0x5177('0x24'),_0xc2b2b5,JSON[_0x5177('0x19')](_0x3b0c37));_0x219744(_0x3b0c37);})[_0x5177('0x1e')](function(_0x2d51d0){logger['error'](_0x5177('0x24'),_0x2d51d0['message'],_0xc2b2b5);_0x27b732(_0xe221b3['error'](0x1f4,_0x2d51d0[_0x5177('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 820af4a..832d218 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 _0x6ed3=['remove','update','emit','removeListener','length','./mailMessage.events'];(function(_0x28a3df,_0xd83252){var _0x33aac3=function(_0x2f56cd){while(--_0x2f56cd){_0x28a3df['push'](_0x28a3df['shift']());}};_0x33aac3(++_0xd83252);}(_0x6ed3,0x1d9));var _0x36ed=function(_0x2eb47c,_0x43bdf3){_0x2eb47c=_0x2eb47c-0x0;var _0x13097b=_0x6ed3[_0x2eb47c];return _0x13097b;};'use strict';var MailMessageEvents=require(_0x36ed('0x0'));var events=['save',_0x36ed('0x1'),_0x36ed('0x2')];function createListener(_0x1a15ab,_0x18d463){return function(_0x33a125){_0x18d463[_0x36ed('0x3')](_0x1a15ab,_0x33a125);};}function removeListener(_0x1b1b69,_0x2d6aa6){return function(){MailMessageEvents[_0x36ed('0x4')](_0x1b1b69,_0x2d6aa6);};}exports['register']=function(_0x2646c0){for(var _0x47dafa=0x0,_0x26a498=events[_0x36ed('0x5')];_0x47dafa<_0x26a498;_0x47dafa++){var _0x3a55d0=events[_0x47dafa];var _0xf4796f=createListener('mailMessage:'+_0x3a55d0,_0x2646c0);MailMessageEvents['on'](_0x3a55d0,_0xf4796f);}}; \ No newline at end of file +var _0x5bac=['mailMessage:','remove','update','emit','register','length'];(function(_0x2bb5a7,_0x437c11){var _0x280d97=function(_0xcc7372){while(--_0xcc7372){_0x2bb5a7['push'](_0x2bb5a7['shift']());}};_0x280d97(++_0x437c11);}(_0x5bac,0x19f));var _0xc5ba=function(_0x495ae8,_0x3e4a1b){_0x495ae8=_0x495ae8-0x0;var _0x3eff9b=_0x5bac[_0x495ae8];return _0x3eff9b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xc5ba('0x0'),_0xc5ba('0x1')];function createListener(_0x129c10,_0x858ce3){return function(_0x5d88ba){_0x858ce3[_0xc5ba('0x2')](_0x129c10,_0x5d88ba);};}function removeListener(_0xf23e8a,_0x5b6a3d){return function(){MailMessageEvents['removeListener'](_0xf23e8a,_0x5b6a3d);};}exports[_0xc5ba('0x3')]=function(_0xf7fb9a){for(var _0x25ca44=0x0,_0x4c211e=events[_0xc5ba('0x4')];_0x25ca44<_0x4c211e;_0x25ca44++){var _0x1ffd78=events[_0x25ca44];var _0x381332=createListener(_0xc5ba('0x5')+_0x1ffd78,_0xf7fb9a);MailMessageEvents['on'](_0x1ffd78,_0x381332);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8b70159..fb844f9 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 _0x7b8c=['exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b8c,0x145));var _0xc7b8=function(_0xa7e180,_0x180503){_0xa7e180=_0xa7e180-0x0;var _0x5afd65=_0x7b8c[_0xa7e180];return _0x5afd65;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc7b8('0x0'));var timeout=require(_0xc7b8('0x1'));var express=require(_0xc7b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc7b8('0x3'));var interaction=require(_0xc7b8('0x4'));var config=require('../../config/environment');var controller=require(_0xc7b8('0x5'));router['get']('/',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x7')]);router[_0xc7b8('0x8')](_0xc7b8('0x9'),auth['isAuthenticated'](),controller[_0xc7b8('0xa')]);router['get'](_0xc7b8('0xb'),auth[_0xc7b8('0x6')](),controller[_0xc7b8('0xc')]);router[_0xc7b8('0x8')](_0xc7b8('0xd'),auth[_0xc7b8('0x6')](),controller['getMembers']);router['get'](_0xc7b8('0xe'),auth[_0xc7b8('0x6')](),controller[_0xc7b8('0xf')]);router['get'](_0xc7b8('0x10'),auth['isAuthenticated'](),controller[_0xc7b8('0x11')]);router[_0xc7b8('0x12')]('/',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x13')]);router[_0xc7b8('0x12')](_0xc7b8('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x14')]);router[_0xc7b8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc7b8('0x16')]);router[_0xc7b8('0x17')](_0xc7b8('0xb'),auth[_0xc7b8('0x6')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xc7b8('0x6')](),controller[_0xc7b8('0x18')]);router[_0xc7b8('0x17')](_0xc7b8('0x10'),auth['isAuthenticated'](),controller[_0xc7b8('0x19')]);module[_0xc7b8('0x1a')]=router; \ No newline at end of file +var _0x4025=['addTeams','addAgents','put','update','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','create','post'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4025,0x115));var _0x5402=function(_0x16ff45,_0x269e92){_0x16ff45=_0x16ff45-0x0;var _0x211adb=_0x4025[_0x16ff45];return _0x211adb;};'use strict';var multer=require(_0x5402('0x0'));var util=require(_0x5402('0x1'));var path=require(_0x5402('0x2'));var timeout=require(_0x5402('0x3'));var express=require(_0x5402('0x4'));var router=express[_0x5402('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5402('0x6'));var interaction=require(_0x5402('0x7'));var config=require(_0x5402('0x8'));var controller=require(_0x5402('0x9'));router[_0x5402('0xa')]('/',auth[_0x5402('0xb')](),controller[_0x5402('0xc')]);router[_0x5402('0xa')](_0x5402('0xd'),auth['isAuthenticated'](),controller[_0x5402('0xe')]);router['get'](_0x5402('0xf'),auth['isAuthenticated'](),controller[_0x5402('0x10')]);router[_0x5402('0xa')](_0x5402('0x11'),auth[_0x5402('0xb')](),controller['getMembers']);router[_0x5402('0xa')](_0x5402('0x12'),auth[_0x5402('0xb')](),controller[_0x5402('0x13')]);router[_0x5402('0xa')](_0x5402('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x5402('0xb')](),controller[_0x5402('0x15')]);router[_0x5402('0x16')](_0x5402('0x12'),auth[_0x5402('0xb')](),controller[_0x5402('0x17')]);router[_0x5402('0x16')](_0x5402('0x14'),auth[_0x5402('0xb')](),controller[_0x5402('0x18')]);router[_0x5402('0x19')](_0x5402('0xf'),auth[_0x5402('0xb')](),controller[_0x5402('0x1a')]);router[_0x5402('0x1b')](_0x5402('0xf'),auth[_0x5402('0xb')](),controller['destroy']);router['delete'](_0x5402('0x12'),auth[_0x5402('0xb')](),controller[_0x5402('0x1c')]);router['delete'](_0x5402('0x14'),auth[_0x5402('0xb')](),controller['removeAgents']);module[_0x5402('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 797e461..1987bc9 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 _0x1cc8=['sequelize','exports','name','STRING','INTEGER','beepall','roundrobin'];(function(_0x28c11f,_0xc74dea){var _0x4ffbbf=function(_0x5e60f8){while(--_0x5e60f8){_0x28c11f['push'](_0x28c11f['shift']());}};_0x4ffbbf(++_0xc74dea);}(_0x1cc8,0x165));var _0x81cc=function(_0x3057b4,_0x16ecdc){_0x3057b4=_0x3057b4-0x0;var _0x2a0ac0=_0x1cc8[_0x3057b4];return _0x2a0ac0;};'use strict';var Sequelize=require(_0x81cc('0x0'));module[_0x81cc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x81cc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81cc('0x3')]},'timeout':{'type':Sequelize[_0x81cc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x81cc('0x5'),_0x81cc('0x6'))}}; \ No newline at end of file +var _0x5057=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x34df21,_0x159374){var _0x596aa6=function(_0x4ac322){while(--_0x4ac322){_0x34df21['push'](_0x34df21['shift']());}};_0x596aa6(++_0x159374);}(_0x5057,0xb4));var _0x7505=function(_0x5b9dd7,_0x43a06e){_0x5b9dd7=_0x5b9dd7-0x0;var _0x49ec19=_0x5057[_0x5b9dd7];return _0x49ec19;};'use strict';var Sequelize=require(_0x7505('0x0'));module['exports']={'name':{'type':Sequelize[_0x7505('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7505('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7505('0x3')](_0x7505('0x4'),_0x7505('0x5'),_0x7505('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c912eb2..a80b1e1 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 _0xe334=['bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','MailQueues','UserProfileResource','sendStatus','error','send','index','map','MailQueue','rawAttributes','type','key','model','name','keys','intersection','attributes','query','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','fields','length','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','User','findAndCountAll','UserId','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','userMailQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','QueryTypes','TeamId','includes','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0xe334,0x199));var _0x4e33=function(_0x65b2ea,_0x54b861){_0x65b2ea=_0x65b2ea-0x0;var _0x54041d=_0xe334[_0x65b2ea];return _0x54041d;};'use strict';var emlformat=require(_0x4e33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e33('0x1'));var jsonpatch=require(_0x4e33('0x2'));var rp=require(_0x4e33('0x3'));var moment=require(_0x4e33('0x4'));var BPromise=require(_0x4e33('0x5'));var Mustache=require(_0x4e33('0x6'));var util=require(_0x4e33('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4e33('0x8'));var ejs=require(_0x4e33('0x9'));var fs=require('fs');var fs_extra=require(_0x4e33('0xa'));var _=require('lodash');var squel=require(_0x4e33('0xb'));var crypto=require(_0x4e33('0xc'));var jsforce=require(_0x4e33('0xd'));var deskjs=require(_0x4e33('0xe'));var toCsv=require(_0x4e33('0x8'));var querystring=require(_0x4e33('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e33('0x10'));var authService=require(_0x4e33('0x11'));var qs=require(_0x4e33('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e33('0x13'));var logger=require(_0x4e33('0x14'))(_0x4e33('0x15'));var utils=require('../../config/utils');var config=require(_0x4e33('0x16'));var licenseUtil=require(_0x4e33('0x17'));var db=require(_0x4e33('0x18'))['db'];config['redis']=_[_0x4e33('0x19')](config[_0x4e33('0x1a')],{'host':_0x4e33('0x1b'),'port':0x18eb});var socket=require(_0x4e33('0x1c'))(new Redis(config['redis']));require(_0x4e33('0x1d'))[_0x4e33('0x1e')](socket);function respondWithStatusCode(_0x459a00,_0x531fe0){_0x531fe0=_0x531fe0||0xcc;return function(_0x4f1bf1){if(_0x4f1bf1){return _0x459a00['sendStatus'](_0x531fe0);}return _0x459a00[_0x4e33('0x1f')](_0x531fe0)[_0x4e33('0x20')]();};}function respondWithResult(_0x40749b,_0x568f95){_0x568f95=_0x568f95||0xc8;return function(_0x43af71){if(_0x43af71){return _0x40749b[_0x4e33('0x1f')](_0x568f95)[_0x4e33('0x21')](_0x43af71);}};}function respondWithFilteredResult(_0x596068,_0x239ad9){return function(_0x4a8d0f){if(_0x4a8d0f){var _0x1c46e2=typeof _0x239ad9[_0x4e33('0x22')]==='undefined'&&typeof _0x239ad9[_0x4e33('0x23')]===_0x4e33('0x24');var _0x5d83fa=_0x4a8d0f[_0x4e33('0x25')];var _0x3ee1d7=_0x1c46e2?0x0:_0x239ad9[_0x4e33('0x22')];var _0xdd5cf7=_0x1c46e2?_0x4a8d0f['count']:_0x239ad9[_0x4e33('0x22')]+_0x239ad9[_0x4e33('0x23')];var _0x24c220;if(_0xdd5cf7>=_0x5d83fa){_0xdd5cf7=_0x5d83fa;_0x24c220=0xc8;}else{_0x24c220=0xce;}_0x596068[_0x4e33('0x1f')](_0x24c220);return _0x596068[_0x4e33('0x26')](_0x4e33('0x27'),_0x3ee1d7+'-'+_0xdd5cf7+'/'+_0x5d83fa)['json'](_0x4a8d0f);}return null;};}function patchUpdates(_0x488736){return function(_0x1328e3){try{jsonpatch[_0x4e33('0x28')](_0x1328e3,_0x488736,!![]);}catch(_0x28b069){return BPromise['reject'](_0x28b069);}return _0x1328e3['save']();};}function saveUpdates(_0x2ec1e5,_0xfec6b1){return function(_0x4bdc28){if(_0x4bdc28){return _0x4bdc28[_0x4e33('0x29')](_0x2ec1e5)[_0x4e33('0x2a')](function(_0x343b22){return _0x343b22;});}return null;};}function removeEntity(_0x269a8c,_0x1aef6b){return function(_0x255e77){if(_0x255e77){return _0x255e77[_0x4e33('0x2b')]()[_0x4e33('0x2a')](function(){var _0x2a5530=_0x255e77['get']({'plain':!![]});var _0x23f8f5=_0x4e33('0x2c');return db[_0x4e33('0x2d')][_0x4e33('0x2b')]({'where':{'type':_0x23f8f5,'resourceId':_0x2a5530['id']}})[_0x4e33('0x2a')](function(){return _0x255e77;});})[_0x4e33('0x2a')](function(){_0x269a8c[_0x4e33('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18069e,_0x104b58){return function(_0x482c4d){if(!_0x482c4d){_0x18069e[_0x4e33('0x2e')](0x194);}return _0x482c4d;};}function handleError(_0x50a427,_0x1e8589){_0x1e8589=_0x1e8589||0x1f4;return function(_0x570396){logger[_0x4e33('0x2f')](_0x570396['stack']);if(_0x570396['name']){delete _0x570396['name'];}_0x50a427['status'](_0x1e8589)[_0x4e33('0x30')](_0x570396);};}exports[_0x4e33('0x31')]=function(_0x325179,_0x4dc9c7){var _0x373923={},_0x426c5a={},_0x4afae3={'count':0x0,'rows':[]};var _0x2b4fc6=_[_0x4e33('0x32')](db[_0x4e33('0x33')][_0x4e33('0x34')],function(_0x2ed4e4){return{'name':_0x2ed4e4['fieldName'],'type':_0x2ed4e4[_0x4e33('0x35')][_0x4e33('0x36')]};});_0x426c5a[_0x4e33('0x37')]=_[_0x4e33('0x32')](_0x2b4fc6,_0x4e33('0x38'));_0x426c5a['query']=_[_0x4e33('0x39')](_0x325179['query']);_0x426c5a['filters']=_[_0x4e33('0x3a')](_0x426c5a[_0x4e33('0x37')],_0x426c5a['query']);_0x373923[_0x4e33('0x3b')]=_['intersection'](_0x426c5a[_0x4e33('0x37')],qs['fields'](_0x325179[_0x4e33('0x3c')]['fields']));_0x373923[_0x4e33('0x3b')]=_0x373923[_0x4e33('0x3b')]['length']?_0x373923[_0x4e33('0x3b')]:_0x426c5a[_0x4e33('0x37')];if(!_0x325179[_0x4e33('0x3c')][_0x4e33('0x3d')]('nolimit')){_0x373923[_0x4e33('0x23')]=qs[_0x4e33('0x23')](_0x325179['query'][_0x4e33('0x23')]);_0x373923[_0x4e33('0x22')]=qs['offset'](_0x325179['query'][_0x4e33('0x22')]);}_0x373923[_0x4e33('0x3e')]=qs[_0x4e33('0x3f')](_0x325179['query'][_0x4e33('0x3f')]);_0x373923[_0x4e33('0x40')]=qs[_0x4e33('0x41')](_['pick'](_0x325179[_0x4e33('0x3c')],_0x426c5a[_0x4e33('0x41')]),_0x2b4fc6);if(_0x325179[_0x4e33('0x3c')][_0x4e33('0x42')]){_0x373923['where']=_['merge'](_0x373923['where'],{'$or':_[_0x4e33('0x32')](_0x2b4fc6,function(_0x362ce5){if(_0x362ce5[_0x4e33('0x35')]!==_0x4e33('0x43')){var _0x119eec={};_0x119eec[_0x362ce5['name']]={'$like':'%'+_0x325179[_0x4e33('0x3c')]['filter']+'%'};return _0x119eec;}})});}_0x373923=_[_0x4e33('0x44')]({},_0x373923,_0x325179[_0x4e33('0x45')]);var _0x1c5b82={'where':_0x373923[_0x4e33('0x40')]};return db[_0x4e33('0x33')][_0x4e33('0x25')](_0x1c5b82)[_0x4e33('0x2a')](function(_0x1933dd){_0x4afae3[_0x4e33('0x25')]=_0x1933dd;if(_0x325179[_0x4e33('0x3c')]['includeAll']){_0x373923[_0x4e33('0x46')]=[{'all':!![]}];}return db[_0x4e33('0x33')][_0x4e33('0x47')](_0x373923);})[_0x4e33('0x2a')](function(_0x38f254){_0x4afae3[_0x4e33('0x48')]=_0x38f254;return _0x4afae3;})[_0x4e33('0x2a')](respondWithFilteredResult(_0x4dc9c7,_0x373923))[_0x4e33('0x49')](handleError(_0x4dc9c7,null));};exports['show']=function(_0x398b26,_0x454d5f){var _0x56b589={'raw':!![],'where':{'id':_0x398b26[_0x4e33('0x4a')]['id']}},_0xc3a650={};_0xc3a650['model']=_[_0x4e33('0x39')](db[_0x4e33('0x33')][_0x4e33('0x34')]);_0xc3a650[_0x4e33('0x3c')]=_['keys'](_0x398b26['query']);_0xc3a650[_0x4e33('0x41')]=_[_0x4e33('0x3a')](_0xc3a650[_0x4e33('0x37')],_0xc3a650[_0x4e33('0x3c')]);_0x56b589[_0x4e33('0x3b')]=_['intersection'](_0xc3a650['model'],qs[_0x4e33('0x4b')](_0x398b26[_0x4e33('0x3c')][_0x4e33('0x4b')]));_0x56b589[_0x4e33('0x3b')]=_0x56b589['attributes'][_0x4e33('0x4c')]?_0x56b589[_0x4e33('0x3b')]:_0xc3a650[_0x4e33('0x37')];if(_0x398b26[_0x4e33('0x3c')][_0x4e33('0x4d')]){_0x56b589[_0x4e33('0x46')]=[{'all':!![]}];}_0x56b589=_['merge']({},_0x56b589,_0x398b26[_0x4e33('0x45')]);return db[_0x4e33('0x33')]['find'](_0x56b589)['then'](handleEntityNotFound(_0x454d5f,null))['then'](respondWithResult(_0x454d5f,null))[_0x4e33('0x49')](handleError(_0x454d5f,null));};exports[_0x4e33('0x4e')]=function(_0x57f3f1,_0x30fca6){return db['MailQueue']['create'](_0x57f3f1[_0x4e33('0x4f')],{})['then'](function(_0x426473){var _0x2fc140=_0x57f3f1[_0x4e33('0x50')][_0x4e33('0x51')]({'plain':!![]});if(!_0x2fc140)throw new Error(_0x4e33('0x52'));if(_0x2fc140['role']===_0x4e33('0x50')){var _0x3ce626=_0x426473[_0x4e33('0x51')]({'plain':!![]});var _0x5ccda5=_0x4e33('0x2c');return db[_0x4e33('0x53')][_0x4e33('0x54')]({'where':{'name':_0x5ccda5,'userProfileId':_0x2fc140['userProfileId']},'raw':!![]})[_0x4e33('0x2a')](function(_0x1f997c){if(_0x1f997c&&_0x1f997c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3ce626[_0x4e33('0x38')],'resourceId':_0x3ce626['id'],'type':_0x1f997c[_0x4e33('0x38')],'sectionId':_0x1f997c['id']},{})[_0x4e33('0x2a')](function(){return _0x426473;});}else{return _0x426473;}})['catch'](function(_0x5a9872){logger[_0x4e33('0x2f')](_0x4e33('0x55'),_0x5a9872);throw _0x5a9872;});}return _0x426473;})[_0x4e33('0x2a')](respondWithResult(_0x30fca6,0xc9))['catch'](handleError(_0x30fca6,null));};exports['update']=function(_0x41849d,_0x394d31){if(_0x41849d[_0x4e33('0x4f')]['id']){delete _0x41849d[_0x4e33('0x4f')]['id'];}return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x41849d[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x394d31,null))[_0x4e33('0x2a')](saveUpdates(_0x41849d['body'],null))['then'](respondWithResult(_0x394d31,null))[_0x4e33('0x49')](handleError(_0x394d31,null));};exports[_0x4e33('0x2b')]=function(_0x79d8e,_0x5c4041){return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x79d8e[_0x4e33('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c4041,null))['then'](removeEntity(_0x5c4041,null))[_0x4e33('0x49')](handleError(_0x5c4041,null));};exports[_0x4e33('0x56')]=function(_0x109a84,_0x515c31){return db['MailQueue'][_0x4e33('0x56')]()[_0x4e33('0x2a')](respondWithResult(_0x515c31,null))['catch'](handleError(_0x515c31,null));};exports[_0x4e33('0x57')]=function(_0xe37871,_0x2a86ab,_0x6a7e9c){var _0x4b96bb={'raw':!![],'where':{}},_0x32def9={},_0x432f41;return db['MailQueue'][_0x4e33('0x58')]({'where':{'id':_0xe37871['params']['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x2a86ab,null))[_0x4e33('0x2a')](function(_0x4cfad8){if(_0x4cfad8){_0x432f41=_0x4cfad8[_0x4e33('0x51')]({'plain':!![]});_0x32def9['model']=_[_0x4e33('0x39')](db[_0x4e33('0x59')][_0x4e33('0x34')]);_0x32def9['query']=_[_0x4e33('0x39')](_0xe37871[_0x4e33('0x3c')]);_0x32def9['filters']=_[_0x4e33('0x3a')](_0x32def9[_0x4e33('0x37')],_0x32def9[_0x4e33('0x3c')]);_0x4b96bb[_0x4e33('0x3b')]=_[_0x4e33('0x3a')](_0x32def9[_0x4e33('0x37')],qs[_0x4e33('0x4b')](_0xe37871['query'][_0x4e33('0x4b')]));_0x4b96bb[_0x4e33('0x3b')]=_0x4b96bb[_0x4e33('0x3b')][_0x4e33('0x4c')]?_0x4b96bb['attributes']:_0x32def9['model'];if(!_0xe37871['query'][_0x4e33('0x3d')](_0x4e33('0x5a'))){_0x4b96bb[_0x4e33('0x23')]=qs[_0x4e33('0x23')](_0xe37871[_0x4e33('0x3c')]['limit']);_0x4b96bb[_0x4e33('0x22')]=qs[_0x4e33('0x22')](_0xe37871[_0x4e33('0x3c')]['offset']);}_0x4b96bb[_0x4e33('0x3e')]=qs[_0x4e33('0x3f')](_0xe37871[_0x4e33('0x3c')][_0x4e33('0x3f')]);_0x4b96bb['where']=qs['filters'](_['pick'](_0xe37871[_0x4e33('0x3c')],_0x32def9['filters']));_0x4b96bb[_0x4e33('0x40')]['MailQueueId']=_0x4cfad8['id'];if(_0xe37871['query'][_0x4e33('0x42')]){_0x4b96bb[_0x4e33('0x40')]=_['merge'](_0x4b96bb[_0x4e33('0x40')],{'$or':_[_0x4e33('0x32')](_0x4b96bb[_0x4e33('0x3b')],function(_0x24a7bc){var _0x44dd65={};_0x44dd65[_0x24a7bc]={'$like':'%'+_0xe37871[_0x4e33('0x3c')][_0x4e33('0x42')]+'%'};return _0x44dd65;})});}_0x4b96bb=_['merge']({},_0x4b96bb,_0xe37871[_0x4e33('0x45')]);return db[_0x4e33('0x59')][_0x4e33('0x47')](_0x4b96bb);}})[_0x4e33('0x2a')](function(_0x121488){if(_0x121488){return db[_0x4e33('0x5b')][_0x4e33('0x5c')]({'where':{'id':_[_0x4e33('0x32')](_0x121488,_0x4e33('0x5d')),'role':'agent'},'attributes':['id',_0x4e33('0x38'),_0x4e33('0x5e'),'updatedAt','createdAt']});}})[_0x4e33('0x2a')](function(_0xd4fd3){if(_0xd4fd3){return{'count':_0xd4fd3[_0x4e33('0x25')],'rows':_[_0x4e33('0x32')](_0xd4fd3[_0x4e33('0x48')],function(_0x3f8e6d){return{'membername':_0x3f8e6d['name'],'UserId':_0x3f8e6d['id'],'queue_name':_0x432f41[_0x4e33('0x38')],'MailQueueId':_0x432f41['id'],'interface':util[_0x4e33('0x5f')](_0x4e33('0x60'),_0x4e33('0x61'),_0x3f8e6d[_0x4e33('0x38')]),'penalty':0x0,'paused':_0x3f8e6d[_0x4e33('0x5e')],'createdAt':_0x3f8e6d[_0x4e33('0x62')],'updatedAt':_0x3f8e6d[_0x4e33('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4e33('0x2a')](respondWithFilteredResult(_0x2a86ab,_0x4b96bb))[_0x4e33('0x49')](handleError(_0x2a86ab,null));};exports[_0x4e33('0x64')]=function(_0x132dec,_0x574baf,_0x10e721){var _0xd0763c={};var _0x3ee183={};var _0x4e8a5d;var _0x5778c1;return db['MailQueue']['findOne']({'where':{'id':_0x132dec[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x574baf,null))[_0x4e33('0x2a')](function(_0x3ed683){if(_0x3ed683){_0x4e8a5d=_0x3ed683;_0x3ee183[_0x4e33('0x37')]=_[_0x4e33('0x39')](db[_0x4e33('0x65')]['rawAttributes']);_0x3ee183[_0x4e33('0x3c')]=_['keys'](_0x132dec[_0x4e33('0x3c')]);_0x3ee183[_0x4e33('0x41')]=_[_0x4e33('0x3a')](_0x3ee183['model'],_0x3ee183[_0x4e33('0x3c')]);_0xd0763c['attributes']=_[_0x4e33('0x3a')](_0x3ee183[_0x4e33('0x37')],qs[_0x4e33('0x4b')](_0x132dec[_0x4e33('0x3c')][_0x4e33('0x4b')]));_0xd0763c[_0x4e33('0x3b')]=_0xd0763c[_0x4e33('0x3b')]['length']?_0xd0763c[_0x4e33('0x3b')]:_0x3ee183['model'];_0xd0763c[_0x4e33('0x3e')]=qs[_0x4e33('0x3f')](_0x132dec[_0x4e33('0x3c')][_0x4e33('0x3f')]);_0xd0763c['where']=qs[_0x4e33('0x41')](_['pick'](_0x132dec[_0x4e33('0x3c')],_0x3ee183[_0x4e33('0x41')]));if(_0x132dec[_0x4e33('0x3c')]['filter']){_0xd0763c['where']=_['merge'](_0xd0763c[_0x4e33('0x40')],{'$or':_['map'](_0xd0763c['attributes'],function(_0x10a1bf){var _0x24a91f={};_0x24a91f[_0x10a1bf]={'$like':'%'+_0x132dec[_0x4e33('0x3c')][_0x4e33('0x42')]+'%'};return _0x24a91f;})});}_0xd0763c=_[_0x4e33('0x44')]({},_0xd0763c,_0x132dec['options']);return _0x4e8a5d[_0x4e33('0x64')](_0xd0763c);}})[_0x4e33('0x2a')](function(_0xabbba6){if(_0xabbba6){_0x5778c1=_0xabbba6[_0x4e33('0x4c')];if(!_0x132dec[_0x4e33('0x3c')][_0x4e33('0x3d')](_0x4e33('0x5a'))){_0xd0763c['limit']=qs[_0x4e33('0x23')](_0x132dec['query']['limit']);_0xd0763c[_0x4e33('0x22')]=qs[_0x4e33('0x22')](_0x132dec[_0x4e33('0x3c')][_0x4e33('0x22')]);}return _0x4e8a5d[_0x4e33('0x64')](_0xd0763c);}})[_0x4e33('0x2a')](function(_0x5130e5){if(_0x5130e5){return _0x5130e5?{'count':_0x5778c1,'rows':_0x5130e5}:null;}})[_0x4e33('0x2a')](respondWithResult(_0x574baf,null))['catch'](handleError(_0x574baf,null));};exports[_0x4e33('0x66')]=function(_0x110949,_0x360e9b,_0x24cb29){var _0x27f6db=_0x110949[_0x4e33('0x4f')]['ids'];return db[_0x4e33('0x65')][_0x4e33('0x47')]({'where':{'id':_0x27f6db},'attributes':['id'],'include':[{'model':db[_0x4e33('0x5b')],'as':_0x4e33('0x67'),'attributes':['id',_0x4e33('0x38'),_0x4e33('0x68'),_0x4e33('0x69'),_0x4e33('0x6a')],'raw':!![]}]})['then'](function(_0x2d22b1){if(_0x2d22b1){var _0x44bd79=_[_0x4e33('0x6b')](_0x2d22b1,function(_0x45249c){var _0xf17d7b=_0x45249c['get']({'plain':!![]});return _0xf17d7b[_0x4e33('0x67')];});return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x110949['params']['id']}})[_0x4e33('0x2a')](function(_0x58cd17){return db[_0x4e33('0x6c')][_0x4e33('0x6d')](function(_0x43bcf5){return _0x58cd17[_0x4e33('0x66')](_0x27f6db,{'transaction':_0x43bcf5})[_0x4e33('0x2a')](function(){return BPromise['each'](_0x44bd79,function(_0x30151c){return db[_0x4e33('0x59')][_0x4e33('0x6e')]({'where':{'UserId':_0x30151c['id'],'MailQueueId':_0x110949['params']['id']},'transaction':_0x43bcf5});});})['then'](function(){_0x44bd79['forEach'](function(_0x102d29){socket['emit'](_0x4e33('0x6f'),{'UserId':_0x102d29['id'],'MailQueueId':_0x58cd17['id']});});});});});}})[_0x4e33('0x2a')](respondWithStatusCode(_0x360e9b,null))['catch'](handleError(_0x360e9b,null));};exports[_0x4e33('0x70')]=function(_0x40a071,_0x2469c7,_0xc5b826){return db[_0x4e33('0x65')]['findAll']({'where':{'id':_0x40a071[_0x4e33('0x3c')][_0x4e33('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4e33('0x67'),'attributes':['id'],'raw':!![]}]})[_0x4e33('0x2a')](handleEntityNotFound(_0x2469c7,null))[_0x4e33('0x2a')](function(_0x3a2e71){var _0x824133=_[_0x4e33('0x32')](_0x3a2e71,'id');var _0x1123d0=[];var _0x1abfd0=[];var _0xe56c79=squel['select']();_0xe56c79[_0x4e33('0x72')](_0x4e33('0x73'))[_0x4e33('0x74')](_0x4e33('0x75'),'tq')['join'](_0x4e33('0x76'),'ut',_0x4e33('0x77'))[_0x4e33('0x40')](_0x4e33('0x78'),_0x40a071[_0x4e33('0x4a')]['id']);for(var _0x2797e4=0x0;_0x2797e4<_0x3a2e71[_0x4e33('0x4c')];_0x2797e4+=0x1){let _0x1a5759=_0x3a2e71[_0x2797e4];for(var _0x296cea=0x0;_0x296cea<_0x1a5759[_0x4e33('0x67')][_0x4e33('0x4c')];_0x296cea+=0x1){let _0x40a771=_0x1a5759[_0x4e33('0x67')][_0x296cea];var _0x396415=_0xe56c79[_0x4e33('0x79')]();_0x396415['where']('ut.UserId\x20=\x20?',_0x40a771['id']);_0x1abfd0['push'](db[_0x4e33('0x6c')]['query'](_0x396415['toString'](),{'type':db['sequelize'][_0x4e33('0x7a')]['SELECT']})[_0x4e33('0x2a')](function(_0x554444){if(_0x554444[_0x4e33('0x4c')]===0x1){return _0x40a771['id'];}else{var _0xc6fdeb=_['every'](_[_0x4e33('0x32')](_0x554444,_0x4e33('0x7b')),function(_0x133f36){return _[_0x4e33('0x7c')](_0x824133,_0x133f36);});if(_0xc6fdeb){return _0x40a771['id'];}}}));}}return BPromise['all'](_0x1abfd0)[_0x4e33('0x2a')](function(_0x2c87a3){_0x1123d0=_(_0x1123d0)[_0x4e33('0x7d')](_0x2c87a3)['compact']()[_0x4e33('0x7e')]();return db['MailQueue'][_0x4e33('0x54')]({'where':{'id':_0x40a071[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](function(_0x7756cf){return db[_0x4e33('0x6c')][_0x4e33('0x6d')](function(_0xb5ed6a){return _0x7756cf[_0x4e33('0x70')](_0x40a071[_0x4e33('0x3c')][_0x4e33('0x71')],{'transaction':_0xb5ed6a})[_0x4e33('0x2a')](function(){if(!_[_0x4e33('0x7f')](_0x1123d0)){return _0x7756cf[_0x4e33('0x80')](_0x1123d0,{'transaction':_0xb5ed6a});}})[_0x4e33('0x2a')](function(){_0x1123d0[_0x4e33('0x81')](function(_0x40970d){socket['emit'](_0x4e33('0x82'),{'UserId':_0x40970d,'MailQueueId':_0x7756cf['id']});});});});});});})['then'](respondWithStatusCode(_0x2469c7,null))[_0x4e33('0x49')](handleError(_0x2469c7,null));};exports[_0x4e33('0x83')]=function(_0x4c85b6,_0x590f19,_0x175615){return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x4c85b6[_0x4e33('0x4a')]['id']}})['then'](handleEntityNotFound(_0x590f19,null))[_0x4e33('0x2a')](function(_0x53cb60){if(_0x53cb60){return _0x53cb60['addAgents'](_0x4c85b6[_0x4e33('0x4f')][_0x4e33('0x71')],_[_0x4e33('0x84')](_0x4c85b6[_0x4e33('0x4f')],['ids','id'])||{})[_0x4e33('0x85')](function(_0x35dfd4){for(var _0x4e768b=0x0;_0x4e768b<_0x4c85b6[_0x4e33('0x4f')][_0x4e33('0x71')]['length'];_0x4e768b+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x4c85b6[_0x4e33('0x4f')][_0x4e33('0x71')][_0x4e768b]),'MailQueueId':Number(_0x4c85b6[_0x4e33('0x4a')]['id'])});}return _0x35dfd4;});}})[_0x4e33('0x2a')](respondWithResult(_0x590f19,null))[_0x4e33('0x49')](handleError(_0x590f19,null));};exports[_0x4e33('0x80')]=function(_0x79e003,_0x5b1d26,_0x2e6f9d){return db[_0x4e33('0x33')][_0x4e33('0x54')]({'where':{'id':_0x79e003[_0x4e33('0x4a')]['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x5b1d26,null))[_0x4e33('0x2a')](function(_0x45b7f1){if(_0x45b7f1){return _0x45b7f1[_0x4e33('0x80')](_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')])[_0x4e33('0x2a')](function(){if(_[_0x4e33('0x86')](_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')])){for(var _0x1093a9=0x0;_0x1093a9<_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')][_0x4e33('0x4c')];_0x1093a9+=0x1){socket[_0x4e33('0x87')](_0x4e33('0x82'),{'UserId':Number(_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')][_0x1093a9]),'MailQueueId':Number(_0x79e003['params']['id'])});}}else{socket[_0x4e33('0x87')]('userMailQueue:remove',{'UserId':Number(_0x79e003[_0x4e33('0x3c')][_0x4e33('0x71')]),'MailQueueId':Number(_0x79e003[_0x4e33('0x4a')]['id'])});}});}})[_0x4e33('0x2a')](respondWithStatusCode(_0x5b1d26,null))[_0x4e33('0x49')](handleError(_0x5b1d26,null));};exports[_0x4e33('0x88')]=function(_0x48fdee,_0x2498c5,_0x5aad16){var _0x3f3415={};var _0x468dfb={};var _0x3d6988;var _0x1d8c9d;return db['MailQueue'][_0x4e33('0x58')]({'where':{'id':_0x48fdee['params']['id']}})[_0x4e33('0x2a')](handleEntityNotFound(_0x2498c5,null))[_0x4e33('0x2a')](function(_0x22acb4){if(_0x22acb4){_0x3d6988=_0x22acb4;_0x468dfb[_0x4e33('0x37')]=_['keys'](db['User']['rawAttributes']);_0x468dfb[_0x4e33('0x3c')]=_[_0x4e33('0x39')](_0x48fdee[_0x4e33('0x3c')]);_0x468dfb[_0x4e33('0x41')]=_[_0x4e33('0x3a')](_0x468dfb[_0x4e33('0x37')],_0x468dfb[_0x4e33('0x3c')]);_0x3f3415[_0x4e33('0x3b')]=_[_0x4e33('0x3a')](_0x468dfb[_0x4e33('0x37')],qs[_0x4e33('0x4b')](_0x48fdee[_0x4e33('0x3c')]['fields']));_0x3f3415[_0x4e33('0x3b')]=_0x3f3415[_0x4e33('0x3b')][_0x4e33('0x4c')]?_0x3f3415[_0x4e33('0x3b')]:_0x468dfb[_0x4e33('0x37')];_0x3f3415['order']=qs['sort'](_0x48fdee[_0x4e33('0x3c')][_0x4e33('0x3f')]);_0x3f3415[_0x4e33('0x40')]=qs['filters'](_[_0x4e33('0x89')](_0x48fdee[_0x4e33('0x3c')],_0x468dfb['filters']));if(_0x48fdee['query'][_0x4e33('0x42')]){_0x3f3415[_0x4e33('0x40')]=_['merge'](_0x3f3415[_0x4e33('0x40')],{'$or':_['map'](_0x3f3415[_0x4e33('0x3b')],function(_0x56ff26){var _0x436951={};_0x436951[_0x56ff26]={'$like':'%'+_0x48fdee['query'][_0x4e33('0x42')]+'%'};return _0x436951;})});}_0x3f3415=_[_0x4e33('0x44')]({},_0x3f3415,_0x48fdee['options']);return _0x3d6988[_0x4e33('0x88')](_0x3f3415);}})[_0x4e33('0x2a')](function(_0x2326b2){if(_0x2326b2){_0x1d8c9d=_0x2326b2[_0x4e33('0x4c')];if(!_0x48fdee['query'][_0x4e33('0x3d')](_0x4e33('0x5a'))){_0x3f3415[_0x4e33('0x23')]=qs['limit'](_0x48fdee[_0x4e33('0x3c')][_0x4e33('0x23')]);_0x3f3415['offset']=qs[_0x4e33('0x22')](_0x48fdee['query'][_0x4e33('0x22')]);}return _0x3d6988[_0x4e33('0x88')](_0x3f3415);}})[_0x4e33('0x2a')](function(_0x27cfbc){if(_0x27cfbc){return _0x27cfbc?{'count':_0x1d8c9d,'rows':_0x27cfbc}:null;}})[_0x4e33('0x2a')](respondWithResult(_0x2498c5,null))['catch'](handleError(_0x2498c5,null));}; \ No newline at end of file +var _0x92aa=['then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','MailQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','UserMailQueue','order','User','findAndCountAll','UserId','updatedAt','format','%s/%s','SIP','mailPause','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x92aa,0xf3));var _0xa92a=function(_0x3ec736,_0x4689a6){_0x3ec736=_0x3ec736-0x0;var _0xe934ba=_0x92aa[_0x3ec736];return _0xe934ba;};'use strict';var emlformat=require(_0xa92a('0x0'));var rimraf=require(_0xa92a('0x1'));var zipdir=require(_0xa92a('0x2'));var jsonpatch=require(_0xa92a('0x3'));var rp=require(_0xa92a('0x4'));var moment=require('moment');var BPromise=require(_0xa92a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa92a('0x6'));var sox=require('sox');var csv=require(_0xa92a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa92a('0x8'));var squel=require(_0xa92a('0x9'));var crypto=require('crypto');var jsforce=require(_0xa92a('0xa'));var deskjs=require(_0xa92a('0xb'));var toCsv=require(_0xa92a('0x7'));var querystring=require(_0xa92a('0xc'));var Papa=require(_0xa92a('0xd'));var Redis=require('ioredis');var authService=require(_0xa92a('0xe'));var qs=require(_0xa92a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa92a('0x10'));var logger=require(_0xa92a('0x11'))(_0xa92a('0x12'));var utils=require('../../config/utils');var config=require(_0xa92a('0x13'));var licenseUtil=require(_0xa92a('0x14'));var db=require(_0xa92a('0x15'))['db'];config[_0xa92a('0x16')]=_[_0xa92a('0x17')](config[_0xa92a('0x16')],{'host':_0xa92a('0x18'),'port':0x18eb});var socket=require(_0xa92a('0x19'))(new Redis(config[_0xa92a('0x16')]));require(_0xa92a('0x1a'))[_0xa92a('0x1b')](socket);function respondWithStatusCode(_0x3ae339,_0x4e09bd){_0x4e09bd=_0x4e09bd||0xcc;return function(_0x5ed07c){if(_0x5ed07c){return _0x3ae339['sendStatus'](_0x4e09bd);}return _0x3ae339[_0xa92a('0x1c')](_0x4e09bd)[_0xa92a('0x1d')]();};}function respondWithResult(_0x2508eb,_0x45f89c){_0x45f89c=_0x45f89c||0xc8;return function(_0x1a8c3d){if(_0x1a8c3d){return _0x2508eb[_0xa92a('0x1c')](_0x45f89c)[_0xa92a('0x1e')](_0x1a8c3d);}};}function respondWithFilteredResult(_0x296713,_0xf0665f){return function(_0x371f1a){if(_0x371f1a){var _0x5284de=typeof _0xf0665f[_0xa92a('0x1f')]===_0xa92a('0x20')&&typeof _0xf0665f['limit']==='undefined';var _0x3d0365=_0x371f1a[_0xa92a('0x21')];var _0x54a0da=_0x5284de?0x0:_0xf0665f[_0xa92a('0x1f')];var _0x49b393=_0x5284de?_0x371f1a[_0xa92a('0x21')]:_0xf0665f['offset']+_0xf0665f[_0xa92a('0x22')];var _0x394ddc;if(_0x49b393>=_0x3d0365){_0x49b393=_0x3d0365;_0x394ddc=0xc8;}else{_0x394ddc=0xce;}_0x296713[_0xa92a('0x1c')](_0x394ddc);return _0x296713[_0xa92a('0x23')](_0xa92a('0x24'),_0x54a0da+'-'+_0x49b393+'/'+_0x3d0365)[_0xa92a('0x1e')](_0x371f1a);}return null;};}function patchUpdates(_0x26f7f3){return function(_0x4b1c13){try{jsonpatch[_0xa92a('0x25')](_0x4b1c13,_0x26f7f3,!![]);}catch(_0x1596fc){return BPromise['reject'](_0x1596fc);}return _0x4b1c13[_0xa92a('0x26')]();};}function saveUpdates(_0x2f69c4,_0x4d44de){return function(_0x3fe260){if(_0x3fe260){return _0x3fe260['update'](_0x2f69c4)[_0xa92a('0x27')](function(_0x120508){return _0x120508;});}return null;};}function removeEntity(_0x3d54c0,_0x3c4ab6){return function(_0x2668ba){if(_0x2668ba){return _0x2668ba[_0xa92a('0x28')]()[_0xa92a('0x27')](function(){var _0x53d560=_0x2668ba[_0xa92a('0x29')]({'plain':!![]});var _0x52b039=_0xa92a('0x2a');return db[_0xa92a('0x2b')][_0xa92a('0x28')]({'where':{'type':_0x52b039,'resourceId':_0x53d560['id']}})[_0xa92a('0x27')](function(){return _0x2668ba;});})['then'](function(){_0x3d54c0[_0xa92a('0x1c')](0xcc)[_0xa92a('0x1d')]();});}};}function handleEntityNotFound(_0x3a88e5,_0x3c099b){return function(_0x45a77d){if(!_0x45a77d){_0x3a88e5[_0xa92a('0x2c')](0x194);}return _0x45a77d;};}function handleError(_0x2767b8,_0x14b096){_0x14b096=_0x14b096||0x1f4;return function(_0x1fc7fa){logger[_0xa92a('0x2d')](_0x1fc7fa[_0xa92a('0x2e')]);if(_0x1fc7fa[_0xa92a('0x2f')]){delete _0x1fc7fa['name'];}_0x2767b8[_0xa92a('0x1c')](_0x14b096)[_0xa92a('0x30')](_0x1fc7fa);};}exports['index']=function(_0x56aa62,_0x3a9ac1){var _0xfc97eb={},_0x2db05a={},_0x15fc49={'count':0x0,'rows':[]};var _0x32fef4=_['map'](db[_0xa92a('0x31')][_0xa92a('0x32')],function(_0x1d2d74){return{'name':_0x1d2d74['fieldName'],'type':_0x1d2d74[_0xa92a('0x33')][_0xa92a('0x34')]};});_0x2db05a[_0xa92a('0x35')]=_['map'](_0x32fef4,_0xa92a('0x2f'));_0x2db05a[_0xa92a('0x36')]=_[_0xa92a('0x37')](_0x56aa62[_0xa92a('0x36')]);_0x2db05a[_0xa92a('0x38')]=_[_0xa92a('0x39')](_0x2db05a[_0xa92a('0x35')],_0x2db05a['query']);_0xfc97eb['attributes']=_['intersection'](_0x2db05a[_0xa92a('0x35')],qs[_0xa92a('0x3a')](_0x56aa62[_0xa92a('0x36')]['fields']));_0xfc97eb[_0xa92a('0x3b')]=_0xfc97eb['attributes']['length']?_0xfc97eb['attributes']:_0x2db05a['model'];if(!_0x56aa62[_0xa92a('0x36')][_0xa92a('0x3c')](_0xa92a('0x3d'))){_0xfc97eb[_0xa92a('0x22')]=qs[_0xa92a('0x22')](_0x56aa62['query'][_0xa92a('0x22')]);_0xfc97eb[_0xa92a('0x1f')]=qs[_0xa92a('0x1f')](_0x56aa62[_0xa92a('0x36')][_0xa92a('0x1f')]);}_0xfc97eb['order']=qs[_0xa92a('0x3e')](_0x56aa62['query'][_0xa92a('0x3e')]);_0xfc97eb[_0xa92a('0x3f')]=qs[_0xa92a('0x38')](_[_0xa92a('0x40')](_0x56aa62[_0xa92a('0x36')],_0x2db05a['filters']),_0x32fef4);if(_0x56aa62[_0xa92a('0x36')]['filter']){_0xfc97eb[_0xa92a('0x3f')]=_[_0xa92a('0x41')](_0xfc97eb['where'],{'$or':_[_0xa92a('0x42')](_0x32fef4,function(_0x197aa9){if(_0x197aa9[_0xa92a('0x33')]!==_0xa92a('0x43')){var _0x4ef6ac={};_0x4ef6ac[_0x197aa9[_0xa92a('0x2f')]]={'$like':'%'+_0x56aa62['query'][_0xa92a('0x44')]+'%'};return _0x4ef6ac;}})});}_0xfc97eb=_[_0xa92a('0x41')]({},_0xfc97eb,_0x56aa62[_0xa92a('0x45')]);var _0x4c348c={'where':_0xfc97eb['where']};return db[_0xa92a('0x31')][_0xa92a('0x21')](_0x4c348c)['then'](function(_0x1945e1){_0x15fc49['count']=_0x1945e1;if(_0x56aa62['query'][_0xa92a('0x46')]){_0xfc97eb[_0xa92a('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0xa92a('0x48')](_0xfc97eb);})[_0xa92a('0x27')](function(_0x2bbaa3){_0x15fc49[_0xa92a('0x49')]=_0x2bbaa3;return _0x15fc49;})[_0xa92a('0x27')](respondWithFilteredResult(_0x3a9ac1,_0xfc97eb))['catch'](handleError(_0x3a9ac1,null));};exports[_0xa92a('0x4a')]=function(_0x3990cd,_0x5a83ea){var _0x4187ee={'raw':!![],'where':{'id':_0x3990cd['params']['id']}},_0x15d843={};_0x15d843[_0xa92a('0x35')]=_[_0xa92a('0x37')](db[_0xa92a('0x31')][_0xa92a('0x32')]);_0x15d843['query']=_[_0xa92a('0x37')](_0x3990cd[_0xa92a('0x36')]);_0x15d843['filters']=_[_0xa92a('0x39')](_0x15d843[_0xa92a('0x35')],_0x15d843['query']);_0x4187ee[_0xa92a('0x3b')]=_[_0xa92a('0x39')](_0x15d843[_0xa92a('0x35')],qs[_0xa92a('0x3a')](_0x3990cd['query']['fields']));_0x4187ee[_0xa92a('0x3b')]=_0x4187ee[_0xa92a('0x3b')][_0xa92a('0x4b')]?_0x4187ee['attributes']:_0x15d843[_0xa92a('0x35')];if(_0x3990cd[_0xa92a('0x36')][_0xa92a('0x46')]){_0x4187ee[_0xa92a('0x47')]=[{'all':!![]}];}_0x4187ee=_['merge']({},_0x4187ee,_0x3990cd['options']);return db[_0xa92a('0x31')][_0xa92a('0x4c')](_0x4187ee)['then'](handleEntityNotFound(_0x5a83ea,null))['then'](respondWithResult(_0x5a83ea,null))[_0xa92a('0x4d')](handleError(_0x5a83ea,null));};exports[_0xa92a('0x4e')]=function(_0x57c05a,_0x396375){return db[_0xa92a('0x31')][_0xa92a('0x4e')](_0x57c05a['body'],{})[_0xa92a('0x27')](function(_0x41ab32){var _0x3c0ffa=_0x57c05a[_0xa92a('0x4f')]['get']({'plain':!![]});if(!_0x3c0ffa)throw new Error(_0xa92a('0x50'));if(_0x3c0ffa['role']==='user'){var _0x294094=_0x41ab32['get']({'plain':!![]});var _0x38d359=_0xa92a('0x2a');return db[_0xa92a('0x51')][_0xa92a('0x4c')]({'where':{'name':_0x38d359,'userProfileId':_0x3c0ffa['userProfileId']},'raw':!![]})[_0xa92a('0x27')](function(_0x134acb){if(_0x134acb&&_0x134acb[_0xa92a('0x52')]===0x0){return db[_0xa92a('0x2b')][_0xa92a('0x4e')]({'name':_0x294094[_0xa92a('0x2f')],'resourceId':_0x294094['id'],'type':_0x134acb[_0xa92a('0x2f')],'sectionId':_0x134acb['id']},{})[_0xa92a('0x27')](function(){return _0x41ab32;});}else{return _0x41ab32;}})['catch'](function(_0x3b1a12){logger[_0xa92a('0x2d')](_0xa92a('0x53'),_0x3b1a12);throw _0x3b1a12;});}return _0x41ab32;})[_0xa92a('0x27')](respondWithResult(_0x396375,0xc9))[_0xa92a('0x4d')](handleError(_0x396375,null));};exports[_0xa92a('0x54')]=function(_0x75e033,_0x2b61e2){if(_0x75e033['body']['id']){delete _0x75e033[_0xa92a('0x55')]['id'];}return db['MailQueue'][_0xa92a('0x4c')]({'where':{'id':_0x75e033[_0xa92a('0x56')]['id']}})[_0xa92a('0x27')](handleEntityNotFound(_0x2b61e2,null))[_0xa92a('0x27')](saveUpdates(_0x75e033[_0xa92a('0x55')],null))[_0xa92a('0x27')](respondWithResult(_0x2b61e2,null))['catch'](handleError(_0x2b61e2,null));};exports[_0xa92a('0x28')]=function(_0x329962,_0x442850){return db[_0xa92a('0x31')][_0xa92a('0x4c')]({'where':{'id':_0x329962[_0xa92a('0x56')]['id']}})[_0xa92a('0x27')](handleEntityNotFound(_0x442850,null))[_0xa92a('0x27')](removeEntity(_0x442850,null))['catch'](handleError(_0x442850,null));};exports[_0xa92a('0x57')]=function(_0x30eaca,_0x11d71b){return db[_0xa92a('0x31')][_0xa92a('0x57')]()[_0xa92a('0x27')](respondWithResult(_0x11d71b,null))['catch'](handleError(_0x11d71b,null));};exports[_0xa92a('0x58')]=function(_0x58cbfe,_0x211ed9,_0x2e94ff){var _0x23a71d={'raw':!![],'where':{}},_0x234821={},_0x29e9ef;return db[_0xa92a('0x31')][_0xa92a('0x59')]({'where':{'id':_0x58cbfe[_0xa92a('0x56')]['id']}})[_0xa92a('0x27')](handleEntityNotFound(_0x211ed9,null))['then'](function(_0x1b5d8d){if(_0x1b5d8d){_0x29e9ef=_0x1b5d8d[_0xa92a('0x29')]({'plain':!![]});_0x234821[_0xa92a('0x35')]=_[_0xa92a('0x37')](db[_0xa92a('0x5a')][_0xa92a('0x32')]);_0x234821[_0xa92a('0x36')]=_[_0xa92a('0x37')](_0x58cbfe[_0xa92a('0x36')]);_0x234821[_0xa92a('0x38')]=_[_0xa92a('0x39')](_0x234821['model'],_0x234821[_0xa92a('0x36')]);_0x23a71d['attributes']=_['intersection'](_0x234821[_0xa92a('0x35')],qs[_0xa92a('0x3a')](_0x58cbfe['query']['fields']));_0x23a71d[_0xa92a('0x3b')]=_0x23a71d[_0xa92a('0x3b')][_0xa92a('0x4b')]?_0x23a71d[_0xa92a('0x3b')]:_0x234821[_0xa92a('0x35')];if(!_0x58cbfe[_0xa92a('0x36')][_0xa92a('0x3c')](_0xa92a('0x3d'))){_0x23a71d[_0xa92a('0x22')]=qs[_0xa92a('0x22')](_0x58cbfe[_0xa92a('0x36')]['limit']);_0x23a71d['offset']=qs[_0xa92a('0x1f')](_0x58cbfe[_0xa92a('0x36')][_0xa92a('0x1f')]);}_0x23a71d[_0xa92a('0x5b')]=qs['sort'](_0x58cbfe[_0xa92a('0x36')]['sort']);_0x23a71d[_0xa92a('0x3f')]=qs['filters'](_[_0xa92a('0x40')](_0x58cbfe[_0xa92a('0x36')],_0x234821[_0xa92a('0x38')]));_0x23a71d[_0xa92a('0x3f')]['MailQueueId']=_0x1b5d8d['id'];if(_0x58cbfe[_0xa92a('0x36')]['filter']){_0x23a71d[_0xa92a('0x3f')]=_['merge'](_0x23a71d['where'],{'$or':_[_0xa92a('0x42')](_0x23a71d[_0xa92a('0x3b')],function(_0x255470){var _0x5e7490={};_0x5e7490[_0x255470]={'$like':'%'+_0x58cbfe[_0xa92a('0x36')][_0xa92a('0x44')]+'%'};return _0x5e7490;})});}_0x23a71d=_[_0xa92a('0x41')]({},_0x23a71d,_0x58cbfe[_0xa92a('0x45')]);return db[_0xa92a('0x5a')][_0xa92a('0x48')](_0x23a71d);}})[_0xa92a('0x27')](function(_0x397ac0){if(_0x397ac0){return db[_0xa92a('0x5c')][_0xa92a('0x5d')]({'where':{'id':_[_0xa92a('0x42')](_0x397ac0,_0xa92a('0x5e')),'role':'agent'},'attributes':['id','name','mailPause',_0xa92a('0x5f'),'createdAt']});}})['then'](function(_0x502076){if(_0x502076){return{'count':_0x502076[_0xa92a('0x21')],'rows':_['map'](_0x502076['rows'],function(_0x4a42a4){return{'membername':_0x4a42a4[_0xa92a('0x2f')],'UserId':_0x4a42a4['id'],'queue_name':_0x29e9ef[_0xa92a('0x2f')],'MailQueueId':_0x29e9ef['id'],'interface':util[_0xa92a('0x60')](_0xa92a('0x61'),_0xa92a('0x62'),_0x4a42a4[_0xa92a('0x2f')]),'penalty':0x0,'paused':_0x4a42a4[_0xa92a('0x63')],'createdAt':_0x4a42a4[_0xa92a('0x64')],'updatedAt':_0x4a42a4[_0xa92a('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa92a('0x27')](respondWithFilteredResult(_0x211ed9,_0x23a71d))[_0xa92a('0x4d')](handleError(_0x211ed9,null));};exports[_0xa92a('0x65')]=function(_0x4a39ba,_0x3b2294,_0x23fd09){var _0x3e8d7d={};var _0x339ebf={};var _0x21dd17;var _0x40ae03;return db[_0xa92a('0x31')][_0xa92a('0x59')]({'where':{'id':_0x4a39ba[_0xa92a('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b2294,null))[_0xa92a('0x27')](function(_0x499aa4){if(_0x499aa4){_0x21dd17=_0x499aa4;_0x339ebf[_0xa92a('0x35')]=_['keys'](db[_0xa92a('0x66')][_0xa92a('0x32')]);_0x339ebf['query']=_[_0xa92a('0x37')](_0x4a39ba[_0xa92a('0x36')]);_0x339ebf[_0xa92a('0x38')]=_[_0xa92a('0x39')](_0x339ebf['model'],_0x339ebf[_0xa92a('0x36')]);_0x3e8d7d[_0xa92a('0x3b')]=_[_0xa92a('0x39')](_0x339ebf['model'],qs[_0xa92a('0x3a')](_0x4a39ba[_0xa92a('0x36')]['fields']));_0x3e8d7d[_0xa92a('0x3b')]=_0x3e8d7d[_0xa92a('0x3b')][_0xa92a('0x4b')]?_0x3e8d7d[_0xa92a('0x3b')]:_0x339ebf[_0xa92a('0x35')];_0x3e8d7d[_0xa92a('0x5b')]=qs[_0xa92a('0x3e')](_0x4a39ba['query']['sort']);_0x3e8d7d['where']=qs['filters'](_[_0xa92a('0x40')](_0x4a39ba[_0xa92a('0x36')],_0x339ebf[_0xa92a('0x38')]));if(_0x4a39ba[_0xa92a('0x36')]['filter']){_0x3e8d7d['where']=_[_0xa92a('0x41')](_0x3e8d7d[_0xa92a('0x3f')],{'$or':_[_0xa92a('0x42')](_0x3e8d7d[_0xa92a('0x3b')],function(_0x4cce09){var _0x1f8a0b={};_0x1f8a0b[_0x4cce09]={'$like':'%'+_0x4a39ba['query']['filter']+'%'};return _0x1f8a0b;})});}_0x3e8d7d=_[_0xa92a('0x41')]({},_0x3e8d7d,_0x4a39ba['options']);return _0x21dd17['getTeams'](_0x3e8d7d);}})[_0xa92a('0x27')](function(_0x2ae688){if(_0x2ae688){_0x40ae03=_0x2ae688[_0xa92a('0x4b')];if(!_0x4a39ba[_0xa92a('0x36')][_0xa92a('0x3c')]('nolimit')){_0x3e8d7d[_0xa92a('0x22')]=qs['limit'](_0x4a39ba[_0xa92a('0x36')][_0xa92a('0x22')]);_0x3e8d7d[_0xa92a('0x1f')]=qs[_0xa92a('0x1f')](_0x4a39ba[_0xa92a('0x36')][_0xa92a('0x1f')]);}return _0x21dd17[_0xa92a('0x65')](_0x3e8d7d);}})[_0xa92a('0x27')](function(_0x475f45){if(_0x475f45){return _0x475f45?{'count':_0x40ae03,'rows':_0x475f45}:null;}})[_0xa92a('0x27')](respondWithResult(_0x3b2294,null))[_0xa92a('0x4d')](handleError(_0x3b2294,null));};exports[_0xa92a('0x67')]=function(_0x598fd9,_0x3224f5,_0x1ac685){var _0x5b32c0=_0x598fd9[_0xa92a('0x55')][_0xa92a('0x68')];return db[_0xa92a('0x66')][_0xa92a('0x48')]({'where':{'id':_0x5b32c0},'attributes':['id'],'include':[{'model':db[_0xa92a('0x5c')],'as':'Agents','attributes':['id','name',_0xa92a('0x69'),_0xa92a('0x6a'),_0xa92a('0x6b')],'raw':!![]}]})[_0xa92a('0x27')](function(_0x21759d){if(_0x21759d){var _0x348c2b=_[_0xa92a('0x6c')](_0x21759d,function(_0x35574b){var _0x49b4d8=_0x35574b[_0xa92a('0x29')]({'plain':!![]});return _0x49b4d8[_0xa92a('0x6d')];});return db['MailQueue'][_0xa92a('0x4c')]({'where':{'id':_0x598fd9['params']['id']}})['then'](function(_0x20053d){return db['sequelize']['transaction'](function(_0x2289d7){return _0x20053d[_0xa92a('0x67')](_0x5b32c0,{'transaction':_0x2289d7})[_0xa92a('0x27')](function(){return BPromise['each'](_0x348c2b,function(_0x48ad3b){return db[_0xa92a('0x5a')][_0xa92a('0x6e')]({'where':{'UserId':_0x48ad3b['id'],'MailQueueId':_0x598fd9['params']['id']},'transaction':_0x2289d7});});})[_0xa92a('0x27')](function(){_0x348c2b[_0xa92a('0x6f')](function(_0x20cea2){socket['emit']('userMailQueue:save',{'UserId':_0x20cea2['id'],'MailQueueId':_0x20053d['id']});});});});});}})[_0xa92a('0x27')](respondWithStatusCode(_0x3224f5,null))[_0xa92a('0x4d')](handleError(_0x3224f5,null));};exports['removeTeams']=function(_0x1d0ffb,_0x51d9c1,_0xc95e25){return db[_0xa92a('0x66')]['findAll']({'where':{'id':_0x1d0ffb[_0xa92a('0x36')][_0xa92a('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa92a('0x5c')],'as':_0xa92a('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa92a('0x27')](handleEntityNotFound(_0x51d9c1,null))[_0xa92a('0x27')](function(_0x182392){var _0x22098c=_[_0xa92a('0x42')](_0x182392,'id');var _0x5dcb02=[];var _0x447174=[];var _0x854d34=squel[_0xa92a('0x70')]();_0x854d34[_0xa92a('0x71')](_0xa92a('0x72'))[_0xa92a('0x73')](_0xa92a('0x74'),'tq')[_0xa92a('0x75')]('user_has_teams','ut',_0xa92a('0x76'))[_0xa92a('0x3f')](_0xa92a('0x77'),_0x1d0ffb['params']['id']);for(var _0x45eb91=0x0;_0x45eb91<_0x182392['length'];_0x45eb91+=0x1){let _0x1227c9=_0x182392[_0x45eb91];for(var _0x422292=0x0;_0x422292<_0x1227c9[_0xa92a('0x6d')][_0xa92a('0x4b')];_0x422292+=0x1){let _0x140011=_0x1227c9['Agents'][_0x422292];var _0x4e08cd=_0x854d34['clone']();_0x4e08cd[_0xa92a('0x3f')](_0xa92a('0x78'),_0x140011['id']);_0x447174['push'](db[_0xa92a('0x79')]['query'](_0x4e08cd[_0xa92a('0x7a')](),{'type':db[_0xa92a('0x79')][_0xa92a('0x7b')][_0xa92a('0x7c')]})[_0xa92a('0x27')](function(_0xfbdc14){if(_0xfbdc14[_0xa92a('0x4b')]===0x1){return _0x140011['id'];}else{var _0x457589=_[_0xa92a('0x7d')](_[_0xa92a('0x42')](_0xfbdc14,_0xa92a('0x7e')),function(_0x45530c){return _['includes'](_0x22098c,_0x45530c);});if(_0x457589){return _0x140011['id'];}}}));}}return BPromise[_0xa92a('0x7f')](_0x447174)[_0xa92a('0x27')](function(_0x454856){_0x5dcb02=_(_0x5dcb02)[_0xa92a('0x80')](_0x454856)[_0xa92a('0x81')]()[_0xa92a('0x82')]();return db[_0xa92a('0x31')][_0xa92a('0x4c')]({'where':{'id':_0x1d0ffb['params']['id']}})[_0xa92a('0x27')](function(_0x42a03e){return db['sequelize']['transaction'](function(_0x59162a){return _0x42a03e[_0xa92a('0x83')](_0x1d0ffb['query'][_0xa92a('0x68')],{'transaction':_0x59162a})[_0xa92a('0x27')](function(){if(!_[_0xa92a('0x84')](_0x5dcb02)){return _0x42a03e[_0xa92a('0x85')](_0x5dcb02,{'transaction':_0x59162a});}})['then'](function(){_0x5dcb02['forEach'](function(_0xf87576){socket[_0xa92a('0x86')](_0xa92a('0x87'),{'UserId':_0xf87576,'MailQueueId':_0x42a03e['id']});});});});});});})[_0xa92a('0x27')](respondWithStatusCode(_0x51d9c1,null))[_0xa92a('0x4d')](handleError(_0x51d9c1,null));};exports[_0xa92a('0x88')]=function(_0x2f8b15,_0x54d9b1,_0x1c49ad){return db['MailQueue'][_0xa92a('0x4c')]({'where':{'id':_0x2f8b15[_0xa92a('0x56')]['id']}})[_0xa92a('0x27')](handleEntityNotFound(_0x54d9b1,null))[_0xa92a('0x27')](function(_0x1acdb7){if(_0x1acdb7){return _0x1acdb7['addAgents'](_0x2f8b15[_0xa92a('0x55')][_0xa92a('0x68')],_[_0xa92a('0x89')](_0x2f8b15[_0xa92a('0x55')],['ids','id'])||{})[_0xa92a('0x8a')](function(_0x47627d){for(var _0x51a10c=0x0;_0x51a10c<_0x2f8b15[_0xa92a('0x55')]['ids'][_0xa92a('0x4b')];_0x51a10c+=0x1){socket[_0xa92a('0x86')](_0xa92a('0x8b'),{'UserId':Number(_0x2f8b15[_0xa92a('0x55')][_0xa92a('0x68')][_0x51a10c]),'MailQueueId':Number(_0x2f8b15['params']['id'])});}return _0x47627d;});}})[_0xa92a('0x27')](respondWithResult(_0x54d9b1,null))['catch'](handleError(_0x54d9b1,null));};exports['removeAgents']=function(_0x2c66ae,_0x259647,_0x17e988){return db[_0xa92a('0x31')]['find']({'where':{'id':_0x2c66ae[_0xa92a('0x56')]['id']}})[_0xa92a('0x27')](handleEntityNotFound(_0x259647,null))[_0xa92a('0x27')](function(_0x32e31d){if(_0x32e31d){return _0x32e31d['removeAgents'](_0x2c66ae[_0xa92a('0x36')][_0xa92a('0x68')])[_0xa92a('0x27')](function(){if(_['isArray'](_0x2c66ae[_0xa92a('0x36')][_0xa92a('0x68')])){for(var _0x11785f=0x0;_0x11785f<_0x2c66ae['query'][_0xa92a('0x68')][_0xa92a('0x4b')];_0x11785f+=0x1){socket[_0xa92a('0x86')]('userMailQueue:remove',{'UserId':Number(_0x2c66ae[_0xa92a('0x36')][_0xa92a('0x68')][_0x11785f]),'MailQueueId':Number(_0x2c66ae[_0xa92a('0x56')]['id'])});}}else{socket['emit'](_0xa92a('0x87'),{'UserId':Number(_0x2c66ae[_0xa92a('0x36')]['ids']),'MailQueueId':Number(_0x2c66ae[_0xa92a('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x259647,null))[_0xa92a('0x4d')](handleError(_0x259647,null));};exports[_0xa92a('0x8c')]=function(_0x4192ce,_0x4e47aa,_0x491cdc){var _0x14f2c7={};var _0x4f37b4={};var _0x38d2f5;var _0x37a446;return db['MailQueue'][_0xa92a('0x59')]({'where':{'id':_0x4192ce['params']['id']}})[_0xa92a('0x27')](handleEntityNotFound(_0x4e47aa,null))[_0xa92a('0x27')](function(_0x4ac9bb){if(_0x4ac9bb){_0x38d2f5=_0x4ac9bb;_0x4f37b4['model']=_[_0xa92a('0x37')](db[_0xa92a('0x5c')]['rawAttributes']);_0x4f37b4['query']=_['keys'](_0x4192ce[_0xa92a('0x36')]);_0x4f37b4[_0xa92a('0x38')]=_['intersection'](_0x4f37b4[_0xa92a('0x35')],_0x4f37b4[_0xa92a('0x36')]);_0x14f2c7[_0xa92a('0x3b')]=_[_0xa92a('0x39')](_0x4f37b4[_0xa92a('0x35')],qs[_0xa92a('0x3a')](_0x4192ce[_0xa92a('0x36')][_0xa92a('0x3a')]));_0x14f2c7['attributes']=_0x14f2c7[_0xa92a('0x3b')]['length']?_0x14f2c7['attributes']:_0x4f37b4[_0xa92a('0x35')];_0x14f2c7[_0xa92a('0x5b')]=qs[_0xa92a('0x3e')](_0x4192ce[_0xa92a('0x36')][_0xa92a('0x3e')]);_0x14f2c7[_0xa92a('0x3f')]=qs[_0xa92a('0x38')](_[_0xa92a('0x40')](_0x4192ce[_0xa92a('0x36')],_0x4f37b4[_0xa92a('0x38')]));if(_0x4192ce[_0xa92a('0x36')][_0xa92a('0x44')]){_0x14f2c7[_0xa92a('0x3f')]=_[_0xa92a('0x41')](_0x14f2c7['where'],{'$or':_[_0xa92a('0x42')](_0x14f2c7[_0xa92a('0x3b')],function(_0x42f105){var _0xffabc={};_0xffabc[_0x42f105]={'$like':'%'+_0x4192ce['query']['filter']+'%'};return _0xffabc;})});}_0x14f2c7=_['merge']({},_0x14f2c7,_0x4192ce[_0xa92a('0x45')]);return _0x38d2f5[_0xa92a('0x8c')](_0x14f2c7);}})[_0xa92a('0x27')](function(_0xace0ed){if(_0xace0ed){_0x37a446=_0xace0ed['length'];if(!_0x4192ce[_0xa92a('0x36')]['hasOwnProperty'](_0xa92a('0x3d'))){_0x14f2c7[_0xa92a('0x22')]=qs['limit'](_0x4192ce[_0xa92a('0x36')]['limit']);_0x14f2c7['offset']=qs[_0xa92a('0x1f')](_0x4192ce[_0xa92a('0x36')][_0xa92a('0x1f')]);}return _0x38d2f5[_0xa92a('0x8c')](_0x14f2c7);}})[_0xa92a('0x27')](function(_0xe86501){if(_0xe86501){return _0xe86501?{'count':_0x37a446,'rows':_0xe86501}:null;}})['then'](respondWithResult(_0x4e47aa,null))[_0xa92a('0x4d')](handleError(_0x4e47aa,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 723efa6..fcb7c7a 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 _0xdad9=['update','remove','emit','hasOwnProperty','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x3859b2,_0x25cbd0){var _0x3c1afe=function(_0x456d65){while(--_0x456d65){_0x3859b2['push'](_0x3859b2['shift']());}};_0x3c1afe(++_0x25cbd0);}(_0xdad9,0x1b4));var _0x9dad=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdad9[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x9dad('0x0'))['db'][_0x9dad('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9dad('0x2')](0x0);var events={'afterCreate':_0x9dad('0x3'),'afterUpdate':_0x9dad('0x4'),'afterDestroy':_0x9dad('0x5')};function emitEvent(_0x33fa63){return function(_0x2855d2,_0x48359b,_0x5e00cf){MailQueueEvents[_0x9dad('0x6')](_0x33fa63+':'+_0x2855d2['id'],_0x2855d2);MailQueueEvents[_0x9dad('0x6')](_0x33fa63,_0x2855d2);_0x5e00cf(null);};}for(var e in events){if(events[_0x9dad('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xcd8f=['save','remove','emit','hook','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xcd8f,0x15b));var _0xfcd8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcd8f[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xfcd8('0x0'))['db'][_0xfcd8('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xfcd8('0x2')](0x0);var events={'afterCreate':_0xfcd8('0x3'),'afterUpdate':'update','afterDestroy':_0xfcd8('0x4')};function emitEvent(_0x30397f){return function(_0x5b5f66,_0x190115,_0x176b0a){MailQueueEvents[_0xfcd8('0x5')](_0x30397f+':'+_0x5b5f66['id'],_0x5b5f66);MailQueueEvents[_0xfcd8('0x5')](_0x30397f,_0x5b5f66);_0x176b0a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xfcd8('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 2d38b99..6d059bc 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 _0xffa7=['moment','request-promise','path','rimraf','../../config/environment','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0xffa7,0xc3));var _0x7ffa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xffa7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7ffa('0x0'));var util=require(_0x7ffa('0x1'));var logger=require(_0x7ffa('0x2'))('api');var moment=require(_0x7ffa('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ffa('0x4'));var fs=require('fs');var path=require(_0x7ffa('0x5'));var rimraf=require(_0x7ffa('0x6'));var config=require(_0x7ffa('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x4e97aa,_0x218451){return _0x4e97aa[_0x7ffa('0x8')](_0x7ffa('0x9'),attributes,{'tableName':_0x7ffa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4044=['rimraf','exports','define','mail_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4dc313,_0x2cf543){var _0x38f09=function(_0xf2283c){while(--_0xf2283c){_0x4dc313['push'](_0x4dc313['shift']());}};_0x38f09(++_0x2cf543);}(_0x4044,0xe0));var _0x4404=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4044[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x4404('0x0'));var util=require(_0x4404('0x1'));var logger=require(_0x4404('0x2'))('api');var moment=require(_0x4404('0x3'));var BPromise=require('bluebird');var rp=require(_0x4404('0x4'));var fs=require('fs');var path=require(_0x4404('0x5'));var rimraf=require(_0x4404('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x4404('0x7')]=function(_0x47217f,_0x42fae1){return _0x47217f[_0x4404('0x8')]('MailQueue',attributes,{'tableName':_0x4404('0x9'),'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 396929e..d1e29a5 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 _0x0879=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','include','map','model','ShowMailQueue','stringify','lodash','util','bluebird','randomstring','ioredis'];(function(_0x48deac,_0x4d8ab8){var _0x3b5eaa=function(_0x91c61e){while(--_0x91c61e){_0x48deac['push'](_0x48deac['shift']());}};_0x3b5eaa(++_0x4d8ab8);}(_0x0879,0x1e9));var _0x9087=function(_0x4a01bd,_0x172e88){_0x4a01bd=_0x4a01bd-0x0;var _0x2c01e7=_0x0879[_0x4a01bd];return _0x2c01e7;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var moment=require('moment');var BPromise=require(_0x9087('0x2'));var rs=require(_0x9087('0x3'));var fs=require('fs');var Redis=require(_0x9087('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9087('0x5'));var logger=require(_0x9087('0x6'))(_0x9087('0x7'));var config=require(_0x9087('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9087('0x9')][_0x9087('0xa')]({'port':0x232a});config[_0x9087('0xb')]=_[_0x9087('0xc')](config[_0x9087('0xb')],{'host':_0x9087('0xd'),'port':0x18eb});var socket=require(_0x9087('0xe'))(new Redis(config['redis']));require(_0x9087('0xf'))['register'](socket);function respondWithRpcPromise(_0x2e4c2d,_0x538308,_0x495ff4){return new BPromise(function(_0x280156,_0xfa47c3){return client['request'](_0x2e4c2d,_0x495ff4)[_0x9087('0x10')](function(_0x460a92){logger[_0x9087('0x11')](_0x9087('0x12'),_0x538308,'request\x20sent');logger[_0x9087('0x13')](_0x9087('0x14'),_0x538308,_0x9087('0x15'),JSON['stringify'](_0x460a92));if(_0x460a92[_0x9087('0x16')]){if(_0x460a92[_0x9087('0x16')][_0x9087('0x17')]===0x1f4){logger['error'](_0x9087('0x12'),_0x538308,_0x460a92[_0x9087('0x16')][_0x9087('0x18')]);return _0xfa47c3(_0x460a92[_0x9087('0x16')]['message']);}logger[_0x9087('0x16')](_0x9087('0x12'),_0x538308,_0x460a92[_0x9087('0x16')]['message']);return _0x280156(_0x460a92[_0x9087('0x16')]['message']);}else{logger['info'](_0x9087('0x12'),_0x538308,'request\x20sent');_0x280156(_0x460a92[_0x9087('0x19')][_0x9087('0x18')]);}})[_0x9087('0x1a')](function(_0x4d3030){logger[_0x9087('0x16')](_0x9087('0x12'),_0x538308,_0x4d3030);_0xfa47c3(_0x4d3030);});});}exports[_0x9087('0x1b')]=function(_0x2b36ad){var _0x5173c9=this;return new Promise(function(_0x54b512,_0x3f9329){return db[_0x9087('0x1c')][_0x9087('0x1d')]({'raw':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')][_0x9087('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b36ad['options']?_0x2b36ad[_0x9087('0x1e')]['where']||null:null,'attributes':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')][_0x9087('0x20')]||null:null,'limit':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')]['limit']||null:null,'include':_0x2b36ad[_0x9087('0x1e')]?_0x2b36ad[_0x9087('0x1e')][_0x9087('0x21')]?_[_0x9087('0x22')](_0x2b36ad['options'][_0x9087('0x21')],function(_0x4ca6b7){return{'model':db[_0x4ca6b7[_0x9087('0x23')]],'as':_0x4ca6b7['as'],'attributes':_0x4ca6b7[_0x9087('0x20')],'include':_0x4ca6b7[_0x9087('0x21')]?_[_0x9087('0x22')](_0x4ca6b7[_0x9087('0x21')],function(_0x5c25c7){return{'model':db[_0x5c25c7[_0x9087('0x23')]],'as':_0x5c25c7['as'],'attributes':_0x5c25c7[_0x9087('0x20')],'include':_0x5c25c7['include']?_[_0x9087('0x22')](_0x5c25c7[_0x9087('0x21')],function(_0x46c9ce){return{'model':db[_0x46c9ce[_0x9087('0x23')]],'as':_0x46c9ce['as'],'attributes':_0x46c9ce[_0x9087('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9087('0x10')](function(_0x306386){logger[_0x9087('0x11')]('GetMailQueue',_0x2b36ad);logger[_0x9087('0x13')](_0x9087('0x1b'),_0x2b36ad,JSON['stringify'](_0x306386));_0x54b512(_0x306386);})[_0x9087('0x1a')](function(_0x44fc65){logger['error'](_0x9087('0x1b'),_0x44fc65['message'],_0x2b36ad);_0x3f9329(_0x5173c9[_0x9087('0x16')](0x1f4,_0x44fc65['message']));});});};exports[_0x9087('0x24')]=function(_0x51fc25){var _0x18a83b=this;return new Promise(function(_0x5484ee,_0x3f6625){return db['MailQueue']['find']({'raw':_0x51fc25[_0x9087('0x1e')]?_0x51fc25['options'][_0x9087('0x1f')]===undefined?!![]:![]:!![],'where':_0x51fc25['options']?_0x51fc25[_0x9087('0x1e')]['where']||null:null,'attributes':_0x51fc25['options']?_0x51fc25[_0x9087('0x1e')][_0x9087('0x20')]||null:null,'include':_0x51fc25[_0x9087('0x1e')]?_0x51fc25[_0x9087('0x1e')][_0x9087('0x21')]?_['map'](_0x51fc25['options'][_0x9087('0x21')],function(_0x328c41){return{'model':db[_0x328c41[_0x9087('0x23')]],'as':_0x328c41['as'],'attributes':_0x328c41[_0x9087('0x20')],'include':_0x328c41[_0x9087('0x21')]?_[_0x9087('0x22')](_0x328c41[_0x9087('0x21')],function(_0x46208b){return{'model':db[_0x46208b['model']],'as':_0x46208b['as'],'attributes':_0x46208b[_0x9087('0x20')],'include':_0x46208b['include']?_[_0x9087('0x22')](_0x46208b[_0x9087('0x21')],function(_0x4e792e){return{'model':db[_0x4e792e[_0x9087('0x23')]],'as':_0x4e792e['as'],'attributes':_0x4e792e[_0x9087('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9087('0x10')](function(_0x1a6eb6){logger[_0x9087('0x11')](_0x9087('0x24'),_0x51fc25);logger['debug'](_0x9087('0x24'),_0x51fc25,JSON[_0x9087('0x25')](_0x1a6eb6));_0x5484ee(_0x1a6eb6);})[_0x9087('0x1a')](function(_0x20d676){logger[_0x9087('0x16')]('ShowMailQueue',_0x20d676[_0x9087('0x18')],_0x51fc25);_0x3f6625(_0x18a83b['error'](0x1f4,_0x20d676['message']));});});}; \ No newline at end of file +var _0xe35f=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailQueue','MailQueue','findAll','options','raw','where','limit','model','include','map','attributes','info','catch','ShowMailQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./mailQueue.socket','register','then'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0xe35f,0x1a7));var _0xfe35=function(_0x1cde9b,_0xa137c6){_0x1cde9b=_0x1cde9b-0x0;var _0xe2d687=_0xe35f[_0x1cde9b];return _0xe2d687;};'use strict';var _=require(_0xfe35('0x0'));var util=require('util');var moment=require(_0xfe35('0x1'));var BPromise=require(_0xfe35('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe35('0x3'));var db=require(_0xfe35('0x4'))['db'];var utils=require(_0xfe35('0x5'));var logger=require(_0xfe35('0x6'))(_0xfe35('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe35('0x8'));var client=jayson[_0xfe35('0x9')][_0xfe35('0xa')]({'port':0x232a});config['redis']=_[_0xfe35('0xb')](config[_0xfe35('0xc')],{'host':_0xfe35('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe35('0xc')]));require(_0xfe35('0xe'))[_0xfe35('0xf')](socket);function respondWithRpcPromise(_0x6616b5,_0x4f2c8a,_0x1b865a){return new BPromise(function(_0x4569de,_0x47696){return client['request'](_0x6616b5,_0x1b865a)[_0xfe35('0x10')](function(_0x2b285f){logger['info'](_0xfe35('0x11'),_0x4f2c8a,_0xfe35('0x12'));logger[_0xfe35('0x13')](_0xfe35('0x14'),_0x4f2c8a,'request\x20sent',JSON[_0xfe35('0x15')](_0x2b285f));if(_0x2b285f[_0xfe35('0x16')]){if(_0x2b285f['error']['code']===0x1f4){logger['error'](_0xfe35('0x11'),_0x4f2c8a,_0x2b285f[_0xfe35('0x16')][_0xfe35('0x17')]);return _0x47696(_0x2b285f[_0xfe35('0x16')][_0xfe35('0x17')]);}logger[_0xfe35('0x16')](_0xfe35('0x11'),_0x4f2c8a,_0x2b285f[_0xfe35('0x16')]['message']);return _0x4569de(_0x2b285f[_0xfe35('0x16')][_0xfe35('0x17')]);}else{logger['info'](_0xfe35('0x11'),_0x4f2c8a,_0xfe35('0x12'));_0x4569de(_0x2b285f[_0xfe35('0x18')]['message']);}})['catch'](function(_0x4becd5){logger[_0xfe35('0x16')](_0xfe35('0x11'),_0x4f2c8a,_0x4becd5);_0x47696(_0x4becd5);});});}exports[_0xfe35('0x19')]=function(_0x3094a0){var _0x249a57=this;return new Promise(function(_0x4ffc8e,_0x5069ff){return db[_0xfe35('0x1a')][_0xfe35('0x1b')]({'raw':_0x3094a0[_0xfe35('0x1c')]?_0x3094a0['options'][_0xfe35('0x1d')]===undefined?!![]:![]:!![],'where':_0x3094a0[_0xfe35('0x1c')]?_0x3094a0[_0xfe35('0x1c')][_0xfe35('0x1e')]||null:null,'attributes':_0x3094a0[_0xfe35('0x1c')]?_0x3094a0[_0xfe35('0x1c')]['attributes']||null:null,'limit':_0x3094a0[_0xfe35('0x1c')]?_0x3094a0['options'][_0xfe35('0x1f')]||null:null,'include':_0x3094a0[_0xfe35('0x1c')]?_0x3094a0[_0xfe35('0x1c')]['include']?_['map'](_0x3094a0[_0xfe35('0x1c')]['include'],function(_0x432c45){return{'model':db[_0x432c45[_0xfe35('0x20')]],'as':_0x432c45['as'],'attributes':_0x432c45['attributes'],'include':_0x432c45[_0xfe35('0x21')]?_[_0xfe35('0x22')](_0x432c45[_0xfe35('0x21')],function(_0x8e23b1){return{'model':db[_0x8e23b1[_0xfe35('0x20')]],'as':_0x8e23b1['as'],'attributes':_0x8e23b1[_0xfe35('0x23')],'include':_0x8e23b1[_0xfe35('0x21')]?_[_0xfe35('0x22')](_0x8e23b1['include'],function(_0x2ffdb0){return{'model':db[_0x2ffdb0[_0xfe35('0x20')]],'as':_0x2ffdb0['as'],'attributes':_0x2ffdb0[_0xfe35('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfe35('0x10')](function(_0x97a7b5){logger[_0xfe35('0x24')]('GetMailQueue',_0x3094a0);logger[_0xfe35('0x13')](_0xfe35('0x19'),_0x3094a0,JSON[_0xfe35('0x15')](_0x97a7b5));_0x4ffc8e(_0x97a7b5);})[_0xfe35('0x25')](function(_0x5f53ac){logger['error'](_0xfe35('0x19'),_0x5f53ac[_0xfe35('0x17')],_0x3094a0);_0x5069ff(_0x249a57[_0xfe35('0x16')](0x1f4,_0x5f53ac[_0xfe35('0x17')]));});});};exports[_0xfe35('0x26')]=function(_0x619482){var _0x2ea0df=this;return new Promise(function(_0x1d89b8,_0xb8772e){return db[_0xfe35('0x1a')][_0xfe35('0x27')]({'raw':_0x619482[_0xfe35('0x1c')]?_0x619482[_0xfe35('0x1c')][_0xfe35('0x1d')]===undefined?!![]:![]:!![],'where':_0x619482[_0xfe35('0x1c')]?_0x619482[_0xfe35('0x1c')][_0xfe35('0x1e')]||null:null,'attributes':_0x619482[_0xfe35('0x1c')]?_0x619482[_0xfe35('0x1c')][_0xfe35('0x23')]||null:null,'include':_0x619482[_0xfe35('0x1c')]?_0x619482[_0xfe35('0x1c')]['include']?_[_0xfe35('0x22')](_0x619482[_0xfe35('0x1c')][_0xfe35('0x21')],function(_0x379969){return{'model':db[_0x379969[_0xfe35('0x20')]],'as':_0x379969['as'],'attributes':_0x379969['attributes'],'include':_0x379969[_0xfe35('0x21')]?_[_0xfe35('0x22')](_0x379969[_0xfe35('0x21')],function(_0xce086a){return{'model':db[_0xce086a[_0xfe35('0x20')]],'as':_0xce086a['as'],'attributes':_0xce086a['attributes'],'include':_0xce086a[_0xfe35('0x21')]?_[_0xfe35('0x22')](_0xce086a[_0xfe35('0x21')],function(_0x1f9252){return{'model':db[_0x1f9252['model']],'as':_0x1f9252['as'],'attributes':_0x1f9252[_0xfe35('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1db753){logger[_0xfe35('0x24')]('ShowMailQueue',_0x619482);logger[_0xfe35('0x13')](_0xfe35('0x26'),_0x619482,JSON['stringify'](_0x1db753));_0x1d89b8(_0x1db753);})[_0xfe35('0x25')](function(_0x491316){logger[_0xfe35('0x16')](_0xfe35('0x26'),_0x491316['message'],_0x619482);_0xb8772e(_0x2ea0df[_0xfe35('0x16')](0x1f4,_0x491316['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d375913..df9bcf6 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 _0x4e52=['remove','update','emit','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x624801,_0x3ed2e4){var _0x47300c=function(_0x222426){while(--_0x222426){_0x624801['push'](_0x624801['shift']());}};_0x47300c(++_0x3ed2e4);}(_0x4e52,0x6e));var _0x24e5=function(_0x308b6c,_0x2a7e3d){_0x308b6c=_0x308b6c-0x0;var _0x10dd0e=_0x4e52[_0x308b6c];return _0x10dd0e;};'use strict';var MailQueueEvents=require(_0x24e5('0x0'));var events=[_0x24e5('0x1'),_0x24e5('0x2'),_0x24e5('0x3')];function createListener(_0x2f104d,_0x51e148){return function(_0x1d669f){_0x51e148[_0x24e5('0x4')](_0x2f104d,_0x1d669f);};}function removeListener(_0x860b70,_0x37bbd4){return function(){MailQueueEvents['removeListener'](_0x860b70,_0x37bbd4);};}exports[_0x24e5('0x5')]=function(_0x10f78d){for(var _0x539a1a=0x0,_0x43d53a=events[_0x24e5('0x6')];_0x539a1a<_0x43d53a;_0x539a1a++){var _0x2acfae=events[_0x539a1a];var _0x172210=createListener(_0x24e5('0x7')+_0x2acfae,_0x10f78d);MailQueueEvents['on'](_0x2acfae,_0x172210);}}; \ No newline at end of file +var _0x6aec=['./mailQueue.events','remove','update','register','mailQueue:'];(function(_0x3aabef,_0x19c811){var _0x27b8f4=function(_0x2d19f9){while(--_0x2d19f9){_0x3aabef['push'](_0x3aabef['shift']());}};_0x27b8f4(++_0x19c811);}(_0x6aec,0x10e));var _0xc6ae=function(_0x4bb298,_0x39bf91){_0x4bb298=_0x4bb298-0x0;var _0xbb5177=_0x6aec[_0x4bb298];return _0xbb5177;};'use strict';var MailQueueEvents=require(_0xc6ae('0x0'));var events=['save',_0xc6ae('0x1'),_0xc6ae('0x2')];function createListener(_0x1fc238,_0xa62104){return function(_0x4e8724){_0xa62104['emit'](_0x1fc238,_0x4e8724);};}function removeListener(_0x2816cc,_0x59b530){return function(){MailQueueEvents['removeListener'](_0x2816cc,_0x59b530);};}exports[_0xc6ae('0x3')]=function(_0x4269df){for(var _0x305b8d=0x0,_0x56daf4=events['length'];_0x305b8d<_0x56daf4;_0x305b8d++){var _0x448296=events[_0x305b8d];var _0x369fbe=createListener(_0xc6ae('0x4')+_0x448296,_0x4269df);MailQueueEvents['on'](_0x448296,_0x369fbe);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 30e41ec..64e7c66 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 _0x07ad=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x25ba40,_0x174567){var _0xa31493=function(_0x35ae4b){while(--_0x35ae4b){_0x25ba40['push'](_0x25ba40['shift']());}};_0xa31493(++_0x174567);}(_0x07ad,0xd5));var _0xd07a=function(_0x3d77d8,_0x491e92){_0x3d77d8=_0x3d77d8-0x0;var _0x3e4724=_0x07ad[_0x3d77d8];return _0x3e4724;};'use strict';var multer=require(_0xd07a('0x0'));var util=require('util');var path=require(_0xd07a('0x1'));var timeout=require(_0xd07a('0x2'));var express=require(_0xd07a('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(_0xd07a('0x4'));var controller=require(_0xd07a('0x5'));router[_0xd07a('0x6')]('/',auth[_0xd07a('0x7')](),controller[_0xd07a('0x8')]);router[_0xd07a('0x6')](_0xd07a('0x9'),auth[_0xd07a('0x7')](),controller[_0xd07a('0xa')]);router[_0xd07a('0x6')](_0xd07a('0xb'),auth[_0xd07a('0x7')](),controller[_0xd07a('0xc')]);router[_0xd07a('0xd')]('/',auth['isAuthenticated'](),controller[_0xd07a('0xe')]);router['put'](_0xd07a('0xb'),auth[_0xd07a('0x7')](),controller[_0xd07a('0xf')]);router[_0xd07a('0x10')](_0xd07a('0xb'),auth['isAuthenticated'](),controller[_0xd07a('0x11')]);module[_0xd07a('0x12')]=router; \ No newline at end of file +var _0xdaba=['index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0xdaba,0x1d9));var _0xadab=function(_0x2892fc,_0x3ec503){_0x2892fc=_0x2892fc-0x0;var _0x4e83a6=_0xdaba[_0x2892fc];return _0x4e83a6;};'use strict';var multer=require('multer');var util=require(_0xadab('0x0'));var path=require(_0xadab('0x1'));var timeout=require('connect-timeout');var express=require(_0xadab('0x2'));var router=express[_0xadab('0x3')]();var fs_extra=require(_0xadab('0x4'));var auth=require(_0xadab('0x5'));var interaction=require(_0xadab('0x6'));var config=require('../../config/environment');var controller=require(_0xadab('0x7'));router[_0xadab('0x8')]('/',auth[_0xadab('0x9')](),controller[_0xadab('0xa')]);router[_0xadab('0x8')](_0xadab('0xb'),auth['isAuthenticated'](),controller[_0xadab('0xc')]);router['get']('/:id',auth[_0xadab('0x9')](),controller[_0xadab('0xd')]);router[_0xadab('0xe')]('/',auth[_0xadab('0x9')](),controller[_0xadab('0xf')]);router[_0xadab('0x10')](_0xadab('0x11'),auth[_0xadab('0x9')](),controller[_0xadab('0x12')]);router[_0xadab('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xadab('0x14')]);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 51f648a..dd71281 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 _0xdbf5=['sequelize','STRING','DATE'];(function(_0x4fbc20,_0x33bbc4){var _0x419740=function(_0x2a692a){while(--_0x2a692a){_0x4fbc20['push'](_0x4fbc20['shift']());}};_0x419740(++_0x33bbc4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x41a515,_0x571e5a){_0x41a515=_0x41a515-0x0;var _0x40403b=_0xdbf5[_0x41a515];return _0x40403b;};'use strict';var moment=require('moment');var Sequelize=require(_0x5dbf('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5dbf('0x1')]},'joinAt':{'type':Sequelize[_0x5dbf('0x2')]},'leaveAt':{'type':Sequelize[_0x5dbf('0x2')]},'acceptAt':{'type':Sequelize[_0x5dbf('0x2')]},'exitAt':{'type':Sequelize[_0x5dbf('0x2')]},'reason':{'type':Sequelize[_0x5dbf('0x1')]}}; \ No newline at end of file +var _0x3c22=['moment','sequelize','STRING','DATE'];(function(_0x31cdf3,_0x4f2183){var _0x5623f8=function(_0x4377bc){while(--_0x4377bc){_0x31cdf3['push'](_0x31cdf3['shift']());}};_0x5623f8(++_0x4f2183);}(_0x3c22,0x184));var _0x23c2=function(_0x3776db,_0x436083){_0x3776db=_0x3776db-0x0;var _0x1ce854=_0x3c22[_0x3776db];return _0x1ce854;};'use strict';var moment=require(_0x23c2('0x0'));var Sequelize=require(_0x23c2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x23c2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x23c2('0x2')]},'joinAt':{'type':Sequelize[_0x23c2('0x3')]},'leaveAt':{'type':Sequelize[_0x23c2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x23c2('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 fb23fa8..98b27c0 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 _0x4888=['../../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','MailQueueReport','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x4888,0x198));var _0x8488=function(_0x38d92b,_0x1be181){_0x38d92b=_0x38d92b-0x0;var _0x56c746=_0x4888[_0x38d92b];return _0x56c746;};'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['MailQueueReport']['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));};exports[_0x8488('0x46')]=function(_0x313e00,_0x186747){return db[_0x8488('0x3a')]['describe']()[_0x8488('0x21')](respondWithResult(_0x186747,null))[_0x8488('0x3e')](handleError(_0x186747,null));}; \ No newline at end of file +var _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','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','sendStatus','status','end','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x1bf004,_0x484305){var _0x2ab10d=function(_0x4093a8){while(--_0x4093a8){_0x1bf004['push'](_0x1bf004['shift']());}};_0x2ab10d(++_0x484305);}(_0x5b12,0xa3));var _0x25b1=function(_0x4d3045,_0x1523bb){_0x4d3045=_0x4d3045-0x0;var _0x135d2a=_0x5b12[_0x4d3045];return _0x135d2a;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['MailQueueReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c67f2b3..3d28fed 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 _0x3c55=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','path'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x3c55,0x163));var _0x53c5=function(_0x2d9461,_0x2bd9a4){_0x2d9461=_0x2d9461-0x0;var _0x1b3e2b=_0x3c55[_0x2d9461];return _0x1b3e2b;};'use strict';var _=require(_0x53c5('0x0'));var util=require(_0x53c5('0x1'));var logger=require(_0x53c5('0x2'))(_0x53c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c5('0x4'));var rimraf=require(_0x53c5('0x5'));var config=require(_0x53c5('0x6'));var attributes=require(_0x53c5('0x7'));module[_0x53c5('0x8')]=function(_0x21103a,_0x27b154){return _0x21103a['define'](_0x53c5('0x9'),attributes,{'tableName':_0x53c5('0xa'),'paranoid':![],'indexes':[{'name':_0x53c5('0xb'),'fields':[_0x53c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a41=['rimraf','./mailQueueReport.attributes','define','report_mail_queue','uniqueid','util','moment','bluebird','path'];(function(_0x2e4dce,_0x43ad28){var _0x5966fa=function(_0x1d17ba){while(--_0x1d17ba){_0x2e4dce['push'](_0x2e4dce['shift']());}};_0x5966fa(++_0x43ad28);}(_0x0a41,0xe6));var _0x10a4=function(_0xeef94c,_0x1db3f7){_0xeef94c=_0xeef94c-0x0;var _0x447522=_0x0a41[_0xeef94c];return _0x447522;};'use strict';var _=require('lodash');var util=require(_0x10a4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x10a4('0x1'));var BPromise=require(_0x10a4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10a4('0x3'));var rimraf=require(_0x10a4('0x4'));var config=require('../../config/environment');var attributes=require(_0x10a4('0x5'));module['exports']=function(_0x574b49,_0x115220){return _0x574b49[_0x10a4('0x6')]('MailQueueReport',attributes,{'tableName':_0x10a4('0x7'),'paranoid':![],'indexes':[{'name':_0x10a4('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 872319e..1f31c45 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x166d97,_0x6b02cb){var _0xffed60=function(_0x41a4cd){while(--_0x41a4cd){_0x166d97['push'](_0x166d97['shift']());}};_0xffed60(++_0x6b02cb);}(_0x1261,0x144));var _0x1126=function(_0x26a51d,_0x5aaa3a){_0x26a51d=_0x26a51d-0x0;var _0x1d8bef=_0x1261[_0x26a51d];return _0x1d8bef;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1373c4,_0xbf80ac){var _0x330cd4=function(_0x24bb2d){while(--_0x24bb2d){_0x1373c4['push'](_0x1373c4['shift']());}};_0x330cd4(++_0xbf80ac);}(_0x326f,0xd1));var _0xf326=function(_0xe0b145,_0x234d44){_0xe0b145=_0xe0b145-0x0;var _0xeced22=_0x326f[_0xe0b145];return _0xeced22;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 0aab132..34394a6 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x54cc3d,_0x3a4c0d){var _0x427dff=function(_0x11be6c){while(--_0x11be6c){_0x54cc3d['push'](_0x54cc3d['shift']());}};_0x427dff(++_0x3a4c0d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xcb91[_0x28a5ad];return _0x176b8a;};'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(_0x21d562,_0x501e02){var _0x3b6c88=function(_0x18f396){while(--_0x18f396){_0x21d562['push'](_0x21d562['shift']());}};_0x3b6c88(++_0x501e02);}(_0x70e0,0x17b));var _0x070e=function(_0x45e11b,_0x4d1595){_0x45e11b=_0x45e11b-0x0;var _0x40bb7b=_0x70e0[_0x45e11b];return _0x40bb7b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 6fa4ae7..be3e1ee 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 _0xbede=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0xbede,0x9f));var _0xebed=function(_0x205f91,_0x2b80e9){_0x205f91=_0x205f91-0x0;var _0x8f02c3=_0xbede[_0x205f91];return _0x8f02c3;};'use strict';var Sequelize=require(_0xebed('0x0'));module[_0xebed('0x1')]={'description':{'type':Sequelize[_0xebed('0x2')]},'host':{'type':Sequelize[_0xebed('0x2')]},'authentication':{'type':Sequelize[_0xebed('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xebed('0x2')]},'password':{'type':Sequelize[_0xebed('0x2')]},'port':{'type':Sequelize[_0xebed('0x4')]},'tls':{'type':Sequelize[_0xebed('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xebed('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xebed('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xebed('0x2')]},'modernAuthentication':{'type':Sequelize[_0xebed('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x26c1=['BOOLEAN','INTEGER','INBOX','exports','STRING'];(function(_0x5e0aa0,_0x106eca){var _0x52d133=function(_0xe7699b){while(--_0xe7699b){_0x5e0aa0['push'](_0x5e0aa0['shift']());}};_0x52d133(++_0x106eca);}(_0x26c1,0x161));var _0x126c=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x26c1[_0x28107d];return _0x2b1cbe;};'use strict';var Sequelize=require('sequelize');module[_0x126c('0x0')]={'description':{'type':Sequelize[_0x126c('0x1')]},'host':{'type':Sequelize[_0x126c('0x1')]},'authentication':{'type':Sequelize[_0x126c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x126c('0x1')]},'password':{'type':Sequelize[_0x126c('0x1')]},'port':{'type':Sequelize[_0x126c('0x3')]},'tls':{'type':Sequelize[_0x126c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x126c('0x1')],'defaultValue':_0x126c('0x4')},'connTimeout':{'type':Sequelize[_0x126c('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x126c('0x1')]},'modernAuthentication':{'type':Sequelize[_0x126c('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 562d0d3..330f0ad 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 _0x719d=['rimraf','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4323a5,_0x4eb292){var _0x14dede=function(_0x3f3e1b){while(--_0x3f3e1b){_0x4323a5['push'](_0x4323a5['shift']());}};_0x14dede(++_0x4eb292);}(_0x719d,0xd1));var _0xd719=function(_0x33ad9f,_0x5a51b6){_0x33ad9f=_0x33ad9f-0x0;var _0x1d3107=_0x719d[_0x33ad9f];return _0x1d3107;};'use strict';var _=require(_0xd719('0x0'));var util=require(_0xd719('0x1'));var logger=require(_0xd719('0x2'))(_0xd719('0x3'));var moment=require(_0xd719('0x4'));var BPromise=require('bluebird');var rp=require(_0xd719('0x5'));var fs=require('fs');var path=require(_0xd719('0x6'));var rimraf=require(_0xd719('0x7'));var config=require('../../config/environment');var attributes=require(_0xd719('0x8'));module[_0xd719('0x9')]=function(_0x307b6f,_0x45185f){return _0x307b6f[_0xd719('0xa')]('MailServerIn',attributes,{'tableName':_0xd719('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec52=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','MailServerIn'];(function(_0x25ae1d,_0x31d03f){var _0x48cd67=function(_0x35367e){while(--_0x35367e){_0x25ae1d['push'](_0x25ae1d['shift']());}};_0x48cd67(++_0x31d03f);}(_0xec52,0x15e));var _0x2ec5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xec52[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2ec5('0x0'));var util=require('util');var logger=require(_0x2ec5('0x1'))(_0x2ec5('0x2'));var moment=require('moment');var BPromise=require(_0x2ec5('0x3'));var rp=require(_0x2ec5('0x4'));var fs=require('fs');var path=require(_0x2ec5('0x5'));var rimraf=require(_0x2ec5('0x6'));var config=require(_0x2ec5('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x16e159,_0x3eee47){return _0x16e159[_0x2ec5('0x8')](_0x2ec5('0x9'),attributes,{'tableName':'mail_servers_in','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 77c17da..a75065f 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 _0xd139=['rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47b776,_0x479abe){var _0xb1e973=function(_0x4f62a5){while(--_0x4f62a5){_0x47b776['push'](_0x47b776['shift']());}};_0xb1e973(++_0x479abe);}(_0xd139,0x14e));var _0x9d13=function(_0x375d0f,_0x26c984){_0x375d0f=_0x375d0f-0x0;var _0x5e20aa=_0xd139[_0x375d0f];return _0x5e20aa;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50294b,_0x198d7d,_0x4b3db0){return new BPromise(function(_0x434ef6,_0x524947){return client['request'](_0x50294b,_0x4b3db0)['then'](function(_0x3ccdf9){logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,_0x9d13('0xd'));logger[_0x9d13('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x198d7d,_0x9d13('0xd'),JSON[_0x9d13('0xf')](_0x3ccdf9));if(_0x3ccdf9[_0x9d13('0x10')]){if(_0x3ccdf9['error']['code']===0x1f4){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x524947(_0x3ccdf9[_0x9d13('0x10')]['message']);}logger['error'](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x434ef6(_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);}else{logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,'request\x20sent');_0x434ef6(_0x3ccdf9[_0x9d13('0x12')][_0x9d13('0x11')]);}})[_0x9d13('0x13')](function(_0x250234){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x250234);_0x524947(_0x250234);});});}exports[_0x9d13('0x14')]=function(_0x10aa89){var _0x45a07a=this;return new Promise(function(_0x2acb0b,_0xa1de89){return db[_0x9d13('0x15')][_0x9d13('0x16')]({'raw':_0x10aa89['options']?_0x10aa89[_0x9d13('0x17')][_0x9d13('0x18')]===undefined?!![]:![]:!![],'where':_0x10aa89[_0x9d13('0x17')]?_0x10aa89[_0x9d13('0x17')]['where']||null:null,'attributes':_0x10aa89['options']?_0x10aa89['options'][_0x9d13('0x19')]||null:null,'limit':_0x10aa89[_0x9d13('0x17')]?_0x10aa89[_0x9d13('0x17')][_0x9d13('0x1a')]||null:null,'include':_0x10aa89[_0x9d13('0x17')]?_0x10aa89[_0x9d13('0x17')][_0x9d13('0x1b')]?_[_0x9d13('0x1c')](_0x10aa89['options'][_0x9d13('0x1b')],function(_0xd5a981){return{'model':db[_0xd5a981[_0x9d13('0x1d')]],'as':_0xd5a981['as'],'attributes':_0xd5a981[_0x9d13('0x19')],'include':_0xd5a981['include']?_[_0x9d13('0x1c')](_0xd5a981['include'],function(_0x40c673){return{'model':db[_0x40c673[_0x9d13('0x1d')]],'as':_0x40c673['as'],'attributes':_0x40c673[_0x9d13('0x19')],'include':_0x40c673[_0x9d13('0x1b')]?_[_0x9d13('0x1c')](_0x40c673[_0x9d13('0x1b')],function(_0x1c36e5){return{'model':db[_0x1c36e5[_0x9d13('0x1d')]],'as':_0x1c36e5['as'],'attributes':_0x1c36e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d13('0x1e')](function(_0x4edc05){logger[_0x9d13('0xb')](_0x9d13('0x14'),_0x10aa89);logger[_0x9d13('0xe')](_0x9d13('0x14'),_0x10aa89,JSON[_0x9d13('0xf')](_0x4edc05));_0x2acb0b(_0x4edc05);})[_0x9d13('0x13')](function(_0x441118){logger[_0x9d13('0x10')](_0x9d13('0x14'),_0x441118[_0x9d13('0x11')],_0x10aa89);_0xa1de89(_0x45a07a[_0x9d13('0x10')](0x1f4,_0x441118[_0x9d13('0x11')]));});});}; \ No newline at end of file +var _0xc16a=['MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','GetMailServerIn'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc16a,0x160));var _0xac16=function(_0x55c5d0,_0x52c8ae){_0x55c5d0=_0x55c5d0-0x0;var _0x18c701=_0xc16a[_0x55c5d0];return _0x18c701;};'use strict';var _=require(_0xac16('0x0'));var util=require(_0xac16('0x1'));var moment=require(_0xac16('0x2'));var BPromise=require(_0xac16('0x3'));var rs=require(_0xac16('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac16('0x5'))['db'];var utils=require(_0xac16('0x6'));var logger=require(_0xac16('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac16('0x8')][_0xac16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56c57d,_0x36cd59,_0x2778ec){return new BPromise(function(_0x14d622,_0x4afe86){return client[_0xac16('0xa')](_0x56c57d,_0x2778ec)[_0xac16('0xb')](function(_0x4f677c){logger[_0xac16('0xc')](_0xac16('0xd'),_0x36cd59,'request\x20sent');logger[_0xac16('0xe')](_0xac16('0xf'),_0x36cd59,'request\x20sent',JSON['stringify'](_0x4f677c));if(_0x4f677c[_0xac16('0x10')]){if(_0x4f677c[_0xac16('0x10')][_0xac16('0x11')]===0x1f4){logger[_0xac16('0x10')]('MailServerIn,\x20%s,\x20%s',_0x36cd59,_0x4f677c[_0xac16('0x10')][_0xac16('0x12')]);return _0x4afe86(_0x4f677c[_0xac16('0x10')][_0xac16('0x12')]);}logger[_0xac16('0x10')]('MailServerIn,\x20%s,\x20%s',_0x36cd59,_0x4f677c[_0xac16('0x10')][_0xac16('0x12')]);return _0x14d622(_0x4f677c[_0xac16('0x10')]['message']);}else{logger[_0xac16('0xc')](_0xac16('0xd'),_0x36cd59,_0xac16('0x13'));_0x14d622(_0x4f677c[_0xac16('0x14')][_0xac16('0x12')]);}})['catch'](function(_0xea3103){logger[_0xac16('0x10')](_0xac16('0xd'),_0x36cd59,_0xea3103);_0x4afe86(_0xea3103);});});}exports[_0xac16('0x15')]=function(_0x2326b5){var _0x410d75=this;return new Promise(function(_0x4cd874,_0x300362){return db[_0xac16('0x16')][_0xac16('0x17')]({'raw':_0x2326b5[_0xac16('0x18')]?_0x2326b5[_0xac16('0x18')][_0xac16('0x19')]===undefined?!![]:![]:!![],'where':_0x2326b5[_0xac16('0x18')]?_0x2326b5[_0xac16('0x18')][_0xac16('0x1a')]||null:null,'attributes':_0x2326b5['options']?_0x2326b5[_0xac16('0x18')][_0xac16('0x1b')]||null:null,'limit':_0x2326b5[_0xac16('0x18')]?_0x2326b5[_0xac16('0x18')][_0xac16('0x1c')]||null:null,'include':_0x2326b5[_0xac16('0x18')]?_0x2326b5[_0xac16('0x18')][_0xac16('0x1d')]?_['map'](_0x2326b5[_0xac16('0x18')][_0xac16('0x1d')],function(_0x409871){return{'model':db[_0x409871[_0xac16('0x1e')]],'as':_0x409871['as'],'attributes':_0x409871[_0xac16('0x1b')],'include':_0x409871['include']?_[_0xac16('0x1f')](_0x409871['include'],function(_0x38b577){return{'model':db[_0x38b577['model']],'as':_0x38b577['as'],'attributes':_0x38b577[_0xac16('0x1b')],'include':_0x38b577[_0xac16('0x1d')]?_[_0xac16('0x1f')](_0x38b577[_0xac16('0x1d')],function(_0x5a6bdd){return{'model':db[_0x5a6bdd[_0xac16('0x1e')]],'as':_0x5a6bdd['as'],'attributes':_0x5a6bdd[_0xac16('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e587d){logger['info'](_0xac16('0x15'),_0x2326b5);logger[_0xac16('0xe')](_0xac16('0x15'),_0x2326b5,JSON[_0xac16('0x20')](_0x1e587d));_0x4cd874(_0x1e587d);})[_0xac16('0x21')](function(_0x5b7592){logger[_0xac16('0x10')](_0xac16('0x15'),_0x5b7592[_0xac16('0x12')],_0x2326b5);_0x300362(_0x410d75[_0xac16('0x10')](0x1f4,_0x5b7592[_0xac16('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index bc0da5a..6883588 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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x5e540f,_0x56487b){_0x5e540f=_0x5e540f-0x0;var _0x3fc4ed=_0x7a54[_0x5e540f];return _0x3fc4ed;};'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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x5a786e,_0x5375a9){_0x5a786e=_0x5a786e-0x0;var _0x65f8d=_0x7a54[_0x5a786e];return _0x65f8d;};'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 70abe16..a871d27 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 _0x2f68=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x562dcd,_0x2353fd){var _0x4e675b=function(_0xa57123){while(--_0xa57123){_0x562dcd['push'](_0x562dcd['shift']());}};_0x4e675b(++_0x2353fd);}(_0x2f68,0x9a));var _0x82f6=function(_0x539ed7,_0x1f6fce){_0x539ed7=_0x539ed7-0x0;var _0x26fc30=_0x2f68[_0x539ed7];return _0x26fc30;};'use strict';var Sequelize=require('sequelize');module[_0x82f6('0x0')]={'description':{'type':Sequelize[_0x82f6('0x1')]},'host':{'type':Sequelize[_0x82f6('0x1')]},'user':{'type':Sequelize[_0x82f6('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x82f6('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x82f6('0x1')]},'authentication':{'type':Sequelize[_0x82f6('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3423=['INTEGER','BOOLEAN','STRING'];(function(_0x12a0a3,_0x2652d1){var _0x1c47c4=function(_0x22261b){while(--_0x22261b){_0x12a0a3['push'](_0x12a0a3['shift']());}};_0x1c47c4(++_0x2652d1);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x3342('0x0')]},'host':{'type':Sequelize[_0x3342('0x0')]},'user':{'type':Sequelize[_0x3342('0x0')]},'pass':{'type':Sequelize[_0x3342('0x0')]},'port':{'type':Sequelize[_0x3342('0x1')]},'secure':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x3342('0x0')]},'authentication':{'type':Sequelize[_0x3342('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 99586d4..7ac6dcf 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 _0xdb54=['stack','name','map','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','MailServerOut','rows','catch','show','params','keys','rawAttributes','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','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0xdb54,0x14c));var _0x4db5=function(_0x17451b,_0x2a078d){_0x17451b=_0x17451b-0x0;var _0x146155=_0xdb54[_0x17451b];return _0x146155;};'use strict';var emlformat=require(_0x4db5('0x0'));var rimraf=require(_0x4db5('0x1'));var zipdir=require(_0x4db5('0x2'));var jsonpatch=require(_0x4db5('0x3'));var rp=require(_0x4db5('0x4'));var moment=require(_0x4db5('0x5'));var BPromise=require(_0x4db5('0x6'));var Mustache=require(_0x4db5('0x7'));var util=require(_0x4db5('0x8'));var path=require(_0x4db5('0x9'));var sox=require(_0x4db5('0xa'));var csv=require(_0x4db5('0xb'));var ejs=require(_0x4db5('0xc'));var fs=require('fs');var fs_extra=require(_0x4db5('0xd'));var _=require(_0x4db5('0xe'));var squel=require(_0x4db5('0xf'));var crypto=require(_0x4db5('0x10'));var jsforce=require(_0x4db5('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x4db5('0xb'));var querystring=require('querystring');var Papa=require(_0x4db5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4db5('0x13'));var hardwareService=require(_0x4db5('0x14'));var logger=require(_0x4db5('0x15'))('api');var utils=require(_0x4db5('0x16'));var config=require(_0x4db5('0x17'));var licenseUtil=require(_0x4db5('0x18'));var db=require(_0x4db5('0x19'))['db'];function respondWithStatusCode(_0x493089,_0x4fc672){_0x4fc672=_0x4fc672||0xcc;return function(_0x218f69){if(_0x218f69){return _0x493089[_0x4db5('0x1a')](_0x4fc672);}return _0x493089[_0x4db5('0x1b')](_0x4fc672)['end']();};}function respondWithResult(_0x4ecc1b,_0x447dc6){_0x447dc6=_0x447dc6||0xc8;return function(_0x338bc){if(_0x338bc){return _0x4ecc1b[_0x4db5('0x1b')](_0x447dc6)[_0x4db5('0x1c')](_0x338bc);}};}function respondWithFilteredResult(_0x2860a1,_0x2cde3a){return function(_0x48d157){if(_0x48d157){var _0x12a09a=typeof _0x2cde3a['offset']===_0x4db5('0x1d')&&typeof _0x2cde3a[_0x4db5('0x1e')]===_0x4db5('0x1d');var _0x3a6d7b=_0x48d157[_0x4db5('0x1f')];var _0x20e99c=_0x12a09a?0x0:_0x2cde3a[_0x4db5('0x20')];var _0x462de2=_0x12a09a?_0x48d157[_0x4db5('0x1f')]:_0x2cde3a[_0x4db5('0x20')]+_0x2cde3a[_0x4db5('0x1e')];var _0x3199e0;if(_0x462de2>=_0x3a6d7b){_0x462de2=_0x3a6d7b;_0x3199e0=0xc8;}else{_0x3199e0=0xce;}_0x2860a1['status'](_0x3199e0);return _0x2860a1[_0x4db5('0x21')](_0x4db5('0x22'),_0x20e99c+'-'+_0x462de2+'/'+_0x3a6d7b)['json'](_0x48d157);}return null;};}function patchUpdates(_0x40fa1f){return function(_0x588c24){try{jsonpatch[_0x4db5('0x23')](_0x588c24,_0x40fa1f,!![]);}catch(_0x56c7fe){return BPromise[_0x4db5('0x24')](_0x56c7fe);}return _0x588c24[_0x4db5('0x25')]();};}function saveUpdates(_0x115f6f,_0xd8fca6){return function(_0x81c842){if(_0x81c842){return _0x81c842[_0x4db5('0x26')](_0x115f6f)[_0x4db5('0x27')](function(_0x485fed){return _0x485fed;});}return null;};}function removeEntity(_0x3e4c10,_0x13fd76){return function(_0x4df519){if(_0x4df519){return _0x4df519[_0x4db5('0x28')]()[_0x4db5('0x27')](function(){_0x3e4c10[_0x4db5('0x1b')](0xcc)[_0x4db5('0x29')]();});}};}function handleEntityNotFound(_0x4664a9,_0x3a8c12){return function(_0x4b1103){if(!_0x4b1103){_0x4664a9[_0x4db5('0x1a')](0x194);}return _0x4b1103;};}function handleError(_0x5a39e8,_0x6d3119){_0x6d3119=_0x6d3119||0x1f4;return function(_0x1535c5){logger[_0x4db5('0x2a')](_0x1535c5[_0x4db5('0x2b')]);if(_0x1535c5['name']){delete _0x1535c5[_0x4db5('0x2c')];}_0x5a39e8['status'](_0x6d3119)['send'](_0x1535c5);};}exports['index']=function(_0x4ffbd5,_0x215978){var _0x4a9eed={},_0x505f3d={},_0x3f203c={'count':0x0,'rows':[]};var _0x9fdabe=_[_0x4db5('0x2d')](db['MailServerOut']['rawAttributes'],function(_0x43e1c5){return{'name':_0x43e1c5[_0x4db5('0x2e')],'type':_0x43e1c5['type'][_0x4db5('0x2f')]};});_0x505f3d['model']=_['map'](_0x9fdabe,'name');_0x505f3d[_0x4db5('0x30')]=_['keys'](_0x4ffbd5[_0x4db5('0x30')]);_0x505f3d[_0x4db5('0x31')]=_[_0x4db5('0x32')](_0x505f3d[_0x4db5('0x33')],_0x505f3d[_0x4db5('0x30')]);_0x4a9eed['attributes']=_[_0x4db5('0x32')](_0x505f3d['model'],qs[_0x4db5('0x34')](_0x4ffbd5['query'][_0x4db5('0x34')]));_0x4a9eed[_0x4db5('0x35')]=_0x4a9eed['attributes'][_0x4db5('0x36')]?_0x4a9eed[_0x4db5('0x35')]:_0x505f3d['model'];if(!_0x4ffbd5['query']['hasOwnProperty'](_0x4db5('0x37'))){_0x4a9eed[_0x4db5('0x1e')]=qs[_0x4db5('0x1e')](_0x4ffbd5['query'][_0x4db5('0x1e')]);_0x4a9eed[_0x4db5('0x20')]=qs[_0x4db5('0x20')](_0x4ffbd5['query'][_0x4db5('0x20')]);}_0x4a9eed['order']=qs[_0x4db5('0x38')](_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x38')]);_0x4a9eed['where']=qs[_0x4db5('0x31')](_[_0x4db5('0x39')](_0x4ffbd5[_0x4db5('0x30')],_0x505f3d[_0x4db5('0x31')]),_0x9fdabe);if(_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x3a')]){_0x4a9eed['where']=_[_0x4db5('0x3b')](_0x4a9eed[_0x4db5('0x3c')],{'$or':_[_0x4db5('0x2d')](_0x9fdabe,function(_0x3d7c2c){if(_0x3d7c2c['type']!==_0x4db5('0x3d')){var _0x3a6b37={};_0x3a6b37[_0x3d7c2c[_0x4db5('0x2c')]]={'$like':'%'+_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x3a')]+'%'};return _0x3a6b37;}})});}_0x4a9eed=_[_0x4db5('0x3b')]({},_0x4a9eed,_0x4ffbd5[_0x4db5('0x3e')]);var _0xd3a379={'where':_0x4a9eed['where']};return db['MailServerOut'][_0x4db5('0x1f')](_0xd3a379)[_0x4db5('0x27')](function(_0x469e7a){_0x3f203c[_0x4db5('0x1f')]=_0x469e7a;if(_0x4ffbd5[_0x4db5('0x30')][_0x4db5('0x3f')]){_0x4a9eed[_0x4db5('0x40')]=[{'all':!![]}];}return db[_0x4db5('0x41')]['findAll'](_0x4a9eed);})[_0x4db5('0x27')](function(_0x41c855){_0x3f203c[_0x4db5('0x42')]=_0x41c855;return _0x3f203c;})[_0x4db5('0x27')](respondWithFilteredResult(_0x215978,_0x4a9eed))[_0x4db5('0x43')](handleError(_0x215978,null));};exports[_0x4db5('0x44')]=function(_0x42ac34,_0x454cbe){var _0xbe61e2={'raw':!![],'where':{'id':_0x42ac34[_0x4db5('0x45')]['id']}},_0x144b3b={};_0x144b3b[_0x4db5('0x33')]=_[_0x4db5('0x46')](db[_0x4db5('0x41')][_0x4db5('0x47')]);_0x144b3b[_0x4db5('0x30')]=_[_0x4db5('0x46')](_0x42ac34[_0x4db5('0x30')]);_0x144b3b[_0x4db5('0x31')]=_['intersection'](_0x144b3b[_0x4db5('0x33')],_0x144b3b[_0x4db5('0x30')]);_0xbe61e2[_0x4db5('0x35')]=_[_0x4db5('0x32')](_0x144b3b[_0x4db5('0x33')],qs[_0x4db5('0x34')](_0x42ac34[_0x4db5('0x30')][_0x4db5('0x34')]));_0xbe61e2[_0x4db5('0x35')]=_0xbe61e2[_0x4db5('0x35')][_0x4db5('0x36')]?_0xbe61e2[_0x4db5('0x35')]:_0x144b3b[_0x4db5('0x33')];if(_0x42ac34['query'][_0x4db5('0x3f')]){_0xbe61e2['include']=[{'all':!![]}];}_0xbe61e2=_['merge']({},_0xbe61e2,_0x42ac34[_0x4db5('0x3e')]);return db[_0x4db5('0x41')][_0x4db5('0x48')](_0xbe61e2)['then'](handleEntityNotFound(_0x454cbe,null))[_0x4db5('0x27')](respondWithResult(_0x454cbe,null))['catch'](handleError(_0x454cbe,null));};exports[_0x4db5('0x49')]=function(_0x1cc4da,_0x291a78){return db['MailServerOut']['create'](_0x1cc4da[_0x4db5('0x4a')],{})[_0x4db5('0x27')](respondWithResult(_0x291a78,0xc9))['catch'](handleError(_0x291a78,null));};exports['update']=function(_0x4bb4ef,_0x125969){if(_0x4bb4ef['body']['id']){delete _0x4bb4ef['body']['id'];}return db[_0x4db5('0x41')][_0x4db5('0x48')]({'where':{'id':_0x4bb4ef['params']['id']}})[_0x4db5('0x27')](handleEntityNotFound(_0x125969,null))['then'](saveUpdates(_0x4bb4ef[_0x4db5('0x4a')],null))[_0x4db5('0x27')](respondWithResult(_0x125969,null))[_0x4db5('0x43')](handleError(_0x125969,null));};exports[_0x4db5('0x28')]=function(_0x52897c,_0x923c73){return db[_0x4db5('0x41')]['find']({'where':{'id':_0x52897c['params']['id']}})['then'](handleEntityNotFound(_0x923c73,null))[_0x4db5('0x27')](removeEntity(_0x923c73,null))[_0x4db5('0x43')](handleError(_0x923c73,null));}; \ No newline at end of file +var _0x702a=['offset','set','apply','reject','save','update','then','end','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit'];(function(_0x64bec,_0x37225c){var _0x46b9c6=function(_0x4cd9af){while(--_0x4cd9af){_0x64bec['push'](_0x64bec['shift']());}};_0x46b9c6(++_0x37225c);}(_0x702a,0x190));var _0xa702=function(_0x517931,_0x42877f){_0x517931=_0x517931-0x0;var _0x558bc5=_0x702a[_0x517931];return _0x558bc5;};'use strict';var emlformat=require(_0xa702('0x0'));var rimraf=require(_0xa702('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa702('0x2'));var rp=require(_0xa702('0x3'));var moment=require(_0xa702('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa702('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa702('0x6'));var csv=require(_0xa702('0x7'));var ejs=require(_0xa702('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa702('0x9'));var squel=require(_0xa702('0xa'));var crypto=require(_0xa702('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa702('0xc'));var toCsv=require(_0xa702('0x7'));var querystring=require(_0xa702('0xd'));var Papa=require(_0xa702('0xe'));var Redis=require(_0xa702('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa702('0x10'));var as=require(_0xa702('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa702('0x12'));var config=require(_0xa702('0x13'));var licenseUtil=require(_0xa702('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38dccd,_0x42ef77){_0x42ef77=_0x42ef77||0xcc;return function(_0x336a47){if(_0x336a47){return _0x38dccd[_0xa702('0x15')](_0x42ef77);}return _0x38dccd[_0xa702('0x16')](_0x42ef77)['end']();};}function respondWithResult(_0x441ec5,_0x275e2a){_0x275e2a=_0x275e2a||0xc8;return function(_0x1abb85){if(_0x1abb85){return _0x441ec5[_0xa702('0x16')](_0x275e2a)[_0xa702('0x17')](_0x1abb85);}};}function respondWithFilteredResult(_0x4005be,_0x433878){return function(_0x314191){if(_0x314191){var _0xb15ce3=typeof _0x433878['offset']===_0xa702('0x18')&&typeof _0x433878[_0xa702('0x19')]===_0xa702('0x18');var _0x1ca80a=_0x314191['count'];var _0x33e95d=_0xb15ce3?0x0:_0x433878[_0xa702('0x1a')];var _0x329055=_0xb15ce3?_0x314191['count']:_0x433878['offset']+_0x433878['limit'];var _0x5e59d3;if(_0x329055>=_0x1ca80a){_0x329055=_0x1ca80a;_0x5e59d3=0xc8;}else{_0x5e59d3=0xce;}_0x4005be[_0xa702('0x16')](_0x5e59d3);return _0x4005be[_0xa702('0x1b')]('Content-Range',_0x33e95d+'-'+_0x329055+'/'+_0x1ca80a)[_0xa702('0x17')](_0x314191);}return null;};}function patchUpdates(_0x39ef09){return function(_0x303eef){try{jsonpatch[_0xa702('0x1c')](_0x303eef,_0x39ef09,!![]);}catch(_0x398386){return BPromise[_0xa702('0x1d')](_0x398386);}return _0x303eef[_0xa702('0x1e')]();};}function saveUpdates(_0x183ec5,_0x53ba98){return function(_0x5bb4d3){if(_0x5bb4d3){return _0x5bb4d3[_0xa702('0x1f')](_0x183ec5)[_0xa702('0x20')](function(_0x13e506){return _0x13e506;});}return null;};}function removeEntity(_0x385822,_0x53a4de){return function(_0x4c8050){if(_0x4c8050){return _0x4c8050['destroy']()[_0xa702('0x20')](function(){_0x385822[_0xa702('0x16')](0xcc)[_0xa702('0x21')]();});}};}function handleEntityNotFound(_0x5c3e0a,_0x193fba){return function(_0x875e9c){if(!_0x875e9c){_0x5c3e0a[_0xa702('0x15')](0x194);}return _0x875e9c;};}function handleError(_0x3c1e9e,_0x3db134){_0x3db134=_0x3db134||0x1f4;return function(_0xdb59fa){logger['error'](_0xdb59fa[_0xa702('0x22')]);if(_0xdb59fa[_0xa702('0x23')]){delete _0xdb59fa[_0xa702('0x23')];}_0x3c1e9e[_0xa702('0x16')](_0x3db134)[_0xa702('0x24')](_0xdb59fa);};}exports[_0xa702('0x25')]=function(_0x2594d3,_0x49b00d){var _0x4973d0={},_0x5a7f43={},_0x295c3b={'count':0x0,'rows':[]};var _0x57af88=_[_0xa702('0x26')](db[_0xa702('0x27')]['rawAttributes'],function(_0x49d948){return{'name':_0x49d948[_0xa702('0x28')],'type':_0x49d948[_0xa702('0x29')][_0xa702('0x2a')]};});_0x5a7f43[_0xa702('0x2b')]=_[_0xa702('0x26')](_0x57af88,'name');_0x5a7f43[_0xa702('0x2c')]=_[_0xa702('0x2d')](_0x2594d3['query']);_0x5a7f43[_0xa702('0x2e')]=_['intersection'](_0x5a7f43[_0xa702('0x2b')],_0x5a7f43[_0xa702('0x2c')]);_0x4973d0[_0xa702('0x2f')]=_[_0xa702('0x30')](_0x5a7f43[_0xa702('0x2b')],qs[_0xa702('0x31')](_0x2594d3[_0xa702('0x2c')][_0xa702('0x31')]));_0x4973d0['attributes']=_0x4973d0[_0xa702('0x2f')][_0xa702('0x32')]?_0x4973d0[_0xa702('0x2f')]:_0x5a7f43['model'];if(!_0x2594d3[_0xa702('0x2c')]['hasOwnProperty'](_0xa702('0x33'))){_0x4973d0[_0xa702('0x19')]=qs['limit'](_0x2594d3['query'][_0xa702('0x19')]);_0x4973d0[_0xa702('0x1a')]=qs[_0xa702('0x1a')](_0x2594d3['query'][_0xa702('0x1a')]);}_0x4973d0[_0xa702('0x34')]=qs['sort'](_0x2594d3['query'][_0xa702('0x35')]);_0x4973d0[_0xa702('0x36')]=qs[_0xa702('0x2e')](_[_0xa702('0x37')](_0x2594d3['query'],_0x5a7f43[_0xa702('0x2e')]),_0x57af88);if(_0x2594d3[_0xa702('0x2c')][_0xa702('0x38')]){_0x4973d0[_0xa702('0x36')]=_[_0xa702('0x39')](_0x4973d0[_0xa702('0x36')],{'$or':_['map'](_0x57af88,function(_0x57ced4){if(_0x57ced4[_0xa702('0x29')]!==_0xa702('0x3a')){var _0x27da50={};_0x27da50[_0x57ced4[_0xa702('0x23')]]={'$like':'%'+_0x2594d3[_0xa702('0x2c')][_0xa702('0x38')]+'%'};return _0x27da50;}})});}_0x4973d0=_[_0xa702('0x39')]({},_0x4973d0,_0x2594d3[_0xa702('0x3b')]);var _0x556889={'where':_0x4973d0[_0xa702('0x36')]};return db['MailServerOut']['count'](_0x556889)[_0xa702('0x20')](function(_0x12a631){_0x295c3b[_0xa702('0x3c')]=_0x12a631;if(_0x2594d3[_0xa702('0x2c')][_0xa702('0x3d')]){_0x4973d0[_0xa702('0x3e')]=[{'all':!![]}];}return db[_0xa702('0x27')]['findAll'](_0x4973d0);})[_0xa702('0x20')](function(_0x44ca7f){_0x295c3b[_0xa702('0x3f')]=_0x44ca7f;return _0x295c3b;})[_0xa702('0x20')](respondWithFilteredResult(_0x49b00d,_0x4973d0))[_0xa702('0x40')](handleError(_0x49b00d,null));};exports[_0xa702('0x41')]=function(_0x5b1f88,_0x36cc08){var _0x5d387e={'raw':!![],'where':{'id':_0x5b1f88[_0xa702('0x42')]['id']}},_0x4365a1={};_0x4365a1[_0xa702('0x2b')]=_[_0xa702('0x2d')](db[_0xa702('0x27')][_0xa702('0x43')]);_0x4365a1[_0xa702('0x2c')]=_[_0xa702('0x2d')](_0x5b1f88[_0xa702('0x2c')]);_0x4365a1[_0xa702('0x2e')]=_[_0xa702('0x30')](_0x4365a1[_0xa702('0x2b')],_0x4365a1[_0xa702('0x2c')]);_0x5d387e[_0xa702('0x2f')]=_[_0xa702('0x30')](_0x4365a1['model'],qs[_0xa702('0x31')](_0x5b1f88['query'][_0xa702('0x31')]));_0x5d387e[_0xa702('0x2f')]=_0x5d387e[_0xa702('0x2f')]['length']?_0x5d387e[_0xa702('0x2f')]:_0x4365a1[_0xa702('0x2b')];if(_0x5b1f88['query']['includeAll']){_0x5d387e[_0xa702('0x3e')]=[{'all':!![]}];}_0x5d387e=_[_0xa702('0x39')]({},_0x5d387e,_0x5b1f88['options']);return db[_0xa702('0x27')][_0xa702('0x44')](_0x5d387e)[_0xa702('0x20')](handleEntityNotFound(_0x36cc08,null))[_0xa702('0x20')](respondWithResult(_0x36cc08,null))[_0xa702('0x40')](handleError(_0x36cc08,null));};exports['create']=function(_0x31f8ea,_0x120fef){return db[_0xa702('0x27')][_0xa702('0x45')](_0x31f8ea[_0xa702('0x46')],{})[_0xa702('0x20')](respondWithResult(_0x120fef,0xc9))[_0xa702('0x40')](handleError(_0x120fef,null));};exports[_0xa702('0x1f')]=function(_0x19808d,_0x57a20b){if(_0x19808d['body']['id']){delete _0x19808d['body']['id'];}return db[_0xa702('0x27')][_0xa702('0x44')]({'where':{'id':_0x19808d[_0xa702('0x42')]['id']}})['then'](handleEntityNotFound(_0x57a20b,null))[_0xa702('0x20')](saveUpdates(_0x19808d[_0xa702('0x46')],null))[_0xa702('0x20')](respondWithResult(_0x57a20b,null))[_0xa702('0x40')](handleError(_0x57a20b,null));};exports['destroy']=function(_0xfa8ba7,_0x166293){return db[_0xa702('0x27')][_0xa702('0x44')]({'where':{'id':_0xfa8ba7['params']['id']}})[_0xa702('0x20')](handleEntityNotFound(_0x166293,null))['then'](removeEntity(_0x166293,null))[_0xa702('0x40')](handleError(_0x166293,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 86fd0ae..f91e828 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 _0xce71=['moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','api'];(function(_0x401f3e,_0x2ef680){var _0x53f9b1=function(_0x159f68){while(--_0x159f68){_0x401f3e['push'](_0x401f3e['shift']());}};_0x53f9b1(++_0x2ef680);}(_0xce71,0x1ad));var _0x1ce7=function(_0x1c6412,_0x143f92){_0x1c6412=_0x1c6412-0x0;var _0xc2872=_0xce71[_0x1c6412];return _0xc2872;};'use strict';var _=require(_0x1ce7('0x0'));var util=require(_0x1ce7('0x1'));var logger=require('../../config/logger')(_0x1ce7('0x2'));var moment=require(_0x1ce7('0x3'));var BPromise=require(_0x1ce7('0x4'));var rp=require(_0x1ce7('0x5'));var fs=require('fs');var path=require(_0x1ce7('0x6'));var rimraf=require('rimraf');var config=require(_0x1ce7('0x7'));var attributes=require(_0x1ce7('0x8'));module[_0x1ce7('0x9')]=function(_0x2c6e21,_0x345870){return _0x2c6e21[_0x1ce7('0xa')](_0x1ce7('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf40e=['define','MailServerOut','mail_servers_out','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x83d0ad,_0x36efe7){var _0x5077aa=function(_0x240784){while(--_0x240784){_0x83d0ad['push'](_0x83d0ad['shift']());}};_0x5077aa(++_0x36efe7);}(_0xf40e,0xab));var _0xef40=function(_0x257b0e,_0x23d0eb){_0x257b0e=_0x257b0e-0x0;var _0x186f35=_0xf40e[_0x257b0e];return _0x186f35;};'use strict';var _=require('lodash');var util=require(_0xef40('0x0'));var logger=require('../../config/logger')(_0xef40('0x1'));var moment=require(_0xef40('0x2'));var BPromise=require(_0xef40('0x3'));var rp=require(_0xef40('0x4'));var fs=require('fs');var path=require(_0xef40('0x5'));var rimraf=require('rimraf');var config=require(_0xef40('0x6'));var attributes=require(_0xef40('0x7'));module[_0xef40('0x8')]=function(_0x5da240,_0xa0c311){return _0x5da240[_0xef40('0x9')](_0xef40('0xa'),attributes,{'tableName':_0xef40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index a192717..ae27704 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(_0x3a9f3d,_0x1475cd){var _0x1c0878=function(_0x433ba2){while(--_0x433ba2){_0x3a9f3d['push'](_0x3a9f3d['shift']());}};_0x1c0878(++_0x1475cd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x25b0ca,_0x560c07){var _0x24e3ba=function(_0x1d3e66){while(--_0x1d3e66){_0x25b0ca['push'](_0x25b0ca['shift']());}};_0x24e3ba(++_0x560c07);}(_0xdb28,0x106));var _0x8db2=function(_0xda6589,_0x441a66){_0xda6589=_0xda6589-0x0;var _0x4beb52=_0xdb28[_0xda6589];return _0x4beb52;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 1382eba..36f9aec 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 _0x1ec6=['update','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x348c3f,_0x24d2d4){var _0x511f00=function(_0x4e8d4e){while(--_0x4e8d4e){_0x348c3f['push'](_0x348c3f['shift']());}};_0x511f00(++_0x24d2d4);}(_0x1ec6,0x89));var _0x61ec=function(_0x49fa98,_0x11accf){_0x49fa98=_0x49fa98-0x0;var _0x1698f1=_0x1ec6[_0x49fa98];return _0x1698f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x61ec('0x0'));var timeout=require(_0x61ec('0x1'));var express=require(_0x61ec('0x2'));var router=express[_0x61ec('0x3')]();var fs_extra=require(_0x61ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x61ec('0x5'));var config=require('../../config/environment');var controller=require(_0x61ec('0x6'));router[_0x61ec('0x7')]('/',auth['isAuthenticated'](),controller[_0x61ec('0x8')]);router['get'](_0x61ec('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x61ec('0x7')](_0x61ec('0xa'),auth[_0x61ec('0xb')](),controller[_0x61ec('0xc')]);router[_0x61ec('0xd')]('/',auth[_0x61ec('0xb')](),controller[_0x61ec('0xe')]);router[_0x61ec('0xf')](_0x61ec('0xa'),auth[_0x61ec('0xb')](),controller[_0x61ec('0x10')]);router['delete'](_0x61ec('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0703=['/:id','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x49c771,_0x8abc21){var _0x29dd48=function(_0x1ac0cb){while(--_0x1ac0cb){_0x49c771['push'](_0x49c771['shift']());}};_0x29dd48(++_0x8abc21);}(_0x0703,0x11d));var _0x3070=function(_0x38ed84,_0x31718d){_0x38ed84=_0x38ed84-0x0;var _0x4bb181=_0x0703[_0x38ed84];return _0x4bb181;};'use strict';var multer=require(_0x3070('0x0'));var util=require(_0x3070('0x1'));var path=require(_0x3070('0x2'));var timeout=require(_0x3070('0x3'));var express=require(_0x3070('0x4'));var router=express[_0x3070('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3070('0x6'));var interaction=require(_0x3070('0x7'));var config=require(_0x3070('0x8'));var controller=require(_0x3070('0x9'));router[_0x3070('0xa')]('/',auth[_0x3070('0xb')](),controller[_0x3070('0xc')]);router[_0x3070('0xa')](_0x3070('0xd'),auth[_0x3070('0xb')](),controller[_0x3070('0xe')]);router['get'](_0x3070('0xf'),auth[_0x3070('0xb')](),controller['show']);router['post']('/',auth[_0x3070('0xb')](),controller[_0x3070('0x10')]);router[_0x3070('0x11')](_0x3070('0xf'),auth[_0x3070('0xb')](),controller['update']);router['delete'](_0x3070('0xf'),auth[_0x3070('0xb')](),controller[_0x3070('0x12')]);module[_0x3070('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 74c1bbd..103c6ca 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 _0x885a=['exports','STRING','name'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xa885('0x0')]={'name':{'type':Sequelize[_0xa885('0x1')],'unique':_0xa885('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa885('0x1')]}}; \ No newline at end of file +var _0x2bd8=['name','sequelize','STRING'];(function(_0x4a10cc,_0x54d474){var _0xc8c61a=function(_0x15c93e){while(--_0x15c93e){_0x4a10cc['push'](_0x4a10cc['shift']());}};_0xc8c61a(++_0x54d474);}(_0x2bd8,0x130));var _0x82bd=function(_0x1695a3,_0x44f929){_0x1695a3=_0x1695a3-0x0;var _0x2f61de=_0x2bd8[_0x1695a3];return _0x2f61de;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'unique':_0x82bd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x82bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 62ba4d8..e85b1f2 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 _0x6a91=['end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailSubstatus','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x6a91,0x83));var _0x16a9=function(_0x570837,_0x5764a8){_0x570837=_0x570837-0x0;var _0x25cc0c=_0x6a91[_0x570837];return _0x25cc0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16a9('0x0'));var zipdir=require(_0x16a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16a9('0x2'));var moment=require(_0x16a9('0x3'));var BPromise=require(_0x16a9('0x4'));var Mustache=require(_0x16a9('0x5'));var util=require(_0x16a9('0x6'));var path=require(_0x16a9('0x7'));var sox=require(_0x16a9('0x8'));var csv=require(_0x16a9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16a9('0xa'));var _=require(_0x16a9('0xb'));var squel=require(_0x16a9('0xc'));var crypto=require(_0x16a9('0xd'));var jsforce=require(_0x16a9('0xe'));var deskjs=require(_0x16a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x16a9('0x10'));var Papa=require(_0x16a9('0x11'));var Redis=require(_0x16a9('0x12'));var authService=require(_0x16a9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x16a9('0x14'));var hardwareService=require(_0x16a9('0x15'));var logger=require('../../config/logger')(_0x16a9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x16a9('0x17'));var db=require(_0x16a9('0x18'))['db'];function respondWithStatusCode(_0x34aa75,_0x2616bb){_0x2616bb=_0x2616bb||0xcc;return function(_0x3e5615){if(_0x3e5615){return _0x34aa75[_0x16a9('0x19')](_0x2616bb);}return _0x34aa75[_0x16a9('0x1a')](_0x2616bb)[_0x16a9('0x1b')]();};}function respondWithResult(_0x445690,_0x4d5bc5){_0x4d5bc5=_0x4d5bc5||0xc8;return function(_0x28f0be){if(_0x28f0be){return _0x445690['status'](_0x4d5bc5)[_0x16a9('0x1c')](_0x28f0be);}};}function respondWithFilteredResult(_0x11978d,_0x540aa8){return function(_0x2b666e){if(_0x2b666e){var _0x31cf5a=typeof _0x540aa8[_0x16a9('0x1d')]===_0x16a9('0x1e')&&typeof _0x540aa8['limit']===_0x16a9('0x1e');var _0x1c4edd=_0x2b666e[_0x16a9('0x1f')];var _0xa69768=_0x31cf5a?0x0:_0x540aa8[_0x16a9('0x1d')];var _0x2a255a=_0x31cf5a?_0x2b666e[_0x16a9('0x1f')]:_0x540aa8[_0x16a9('0x1d')]+_0x540aa8[_0x16a9('0x20')];var _0x233777;if(_0x2a255a>=_0x1c4edd){_0x2a255a=_0x1c4edd;_0x233777=0xc8;}else{_0x233777=0xce;}_0x11978d['status'](_0x233777);return _0x11978d['set'](_0x16a9('0x21'),_0xa69768+'-'+_0x2a255a+'/'+_0x1c4edd)[_0x16a9('0x1c')](_0x2b666e);}return null;};}function patchUpdates(_0x4fa3df){return function(_0x53b818){try{jsonpatch[_0x16a9('0x22')](_0x53b818,_0x4fa3df,!![]);}catch(_0x15c34e){return BPromise[_0x16a9('0x23')](_0x15c34e);}return _0x53b818[_0x16a9('0x24')]();};}function saveUpdates(_0x4ca4fc,_0x308515){return function(_0x4ac422){if(_0x4ac422){return _0x4ac422[_0x16a9('0x25')](_0x4ca4fc)[_0x16a9('0x26')](function(_0x4b07d3){return _0x4b07d3;});}return null;};}function removeEntity(_0x1c2c93,_0x91f594){return function(_0x2ba96b){if(_0x2ba96b){return _0x2ba96b[_0x16a9('0x27')]()[_0x16a9('0x26')](function(){_0x1c2c93[_0x16a9('0x1a')](0xcc)[_0x16a9('0x1b')]();});}};}function handleEntityNotFound(_0x3b2c91,_0x10546a){return function(_0x2669de){if(!_0x2669de){_0x3b2c91['sendStatus'](0x194);}return _0x2669de;};}function handleError(_0x379ae6,_0x5e7fc2){_0x5e7fc2=_0x5e7fc2||0x1f4;return function(_0x1d16d7){logger[_0x16a9('0x28')](_0x1d16d7['stack']);if(_0x1d16d7[_0x16a9('0x29')]){delete _0x1d16d7['name'];}_0x379ae6[_0x16a9('0x1a')](_0x5e7fc2)[_0x16a9('0x2a')](_0x1d16d7);};}exports[_0x16a9('0x2b')]=function(_0xc5b817,_0x1e7f77){var _0x6df7e1={},_0x2cecab={},_0x54f1ed={'count':0x0,'rows':[]};var _0x4cbd1a=_[_0x16a9('0x2c')](db['MailSubstatus']['rawAttributes'],function(_0xb22898){return{'name':_0xb22898[_0x16a9('0x2d')],'type':_0xb22898[_0x16a9('0x2e')][_0x16a9('0x2f')]};});_0x2cecab[_0x16a9('0x30')]=_[_0x16a9('0x2c')](_0x4cbd1a,_0x16a9('0x29'));_0x2cecab[_0x16a9('0x31')]=_[_0x16a9('0x32')](_0xc5b817['query']);_0x2cecab[_0x16a9('0x33')]=_[_0x16a9('0x34')](_0x2cecab[_0x16a9('0x30')],_0x2cecab[_0x16a9('0x31')]);_0x6df7e1[_0x16a9('0x35')]=_[_0x16a9('0x34')](_0x2cecab[_0x16a9('0x30')],qs[_0x16a9('0x36')](_0xc5b817['query'][_0x16a9('0x36')]));_0x6df7e1['attributes']=_0x6df7e1[_0x16a9('0x35')][_0x16a9('0x37')]?_0x6df7e1['attributes']:_0x2cecab['model'];if(!_0xc5b817['query'][_0x16a9('0x38')](_0x16a9('0x39'))){_0x6df7e1[_0x16a9('0x20')]=qs['limit'](_0xc5b817[_0x16a9('0x31')][_0x16a9('0x20')]);_0x6df7e1[_0x16a9('0x1d')]=qs[_0x16a9('0x1d')](_0xc5b817[_0x16a9('0x31')][_0x16a9('0x1d')]);}_0x6df7e1[_0x16a9('0x3a')]=qs[_0x16a9('0x3b')](_0xc5b817[_0x16a9('0x31')][_0x16a9('0x3b')]);_0x6df7e1[_0x16a9('0x3c')]=qs['filters'](_[_0x16a9('0x3d')](_0xc5b817['query'],_0x2cecab['filters']),_0x4cbd1a);if(_0xc5b817[_0x16a9('0x31')][_0x16a9('0x3e')]){_0x6df7e1[_0x16a9('0x3c')]=_[_0x16a9('0x3f')](_0x6df7e1['where'],{'$or':_[_0x16a9('0x2c')](_0x4cbd1a,function(_0x4943c2){if(_0x4943c2['type']!==_0x16a9('0x40')){var _0x5e8d52={};_0x5e8d52[_0x4943c2[_0x16a9('0x29')]]={'$like':'%'+_0xc5b817['query'][_0x16a9('0x3e')]+'%'};return _0x5e8d52;}})});}_0x6df7e1=_[_0x16a9('0x3f')]({},_0x6df7e1,_0xc5b817['options']);var _0x575218={'where':_0x6df7e1[_0x16a9('0x3c')]};return db[_0x16a9('0x41')]['count'](_0x575218)[_0x16a9('0x26')](function(_0x4f188a){_0x54f1ed[_0x16a9('0x1f')]=_0x4f188a;if(_0xc5b817[_0x16a9('0x31')][_0x16a9('0x42')]){_0x6df7e1[_0x16a9('0x43')]=[{'all':!![]}];}return db[_0x16a9('0x41')][_0x16a9('0x44')](_0x6df7e1);})[_0x16a9('0x26')](function(_0x35f917){_0x54f1ed[_0x16a9('0x45')]=_0x35f917;return _0x54f1ed;})[_0x16a9('0x26')](respondWithFilteredResult(_0x1e7f77,_0x6df7e1))[_0x16a9('0x46')](handleError(_0x1e7f77,null));};exports[_0x16a9('0x47')]=function(_0x551a8f,_0x20a590){var _0x1174f2={'raw':!![],'where':{'id':_0x551a8f['params']['id']}},_0x2bfb47={};_0x2bfb47[_0x16a9('0x30')]=_[_0x16a9('0x32')](db[_0x16a9('0x41')][_0x16a9('0x48')]);_0x2bfb47[_0x16a9('0x31')]=_[_0x16a9('0x32')](_0x551a8f[_0x16a9('0x31')]);_0x2bfb47[_0x16a9('0x33')]=_['intersection'](_0x2bfb47[_0x16a9('0x30')],_0x2bfb47['query']);_0x1174f2['attributes']=_[_0x16a9('0x34')](_0x2bfb47[_0x16a9('0x30')],qs[_0x16a9('0x36')](_0x551a8f[_0x16a9('0x31')]['fields']));_0x1174f2[_0x16a9('0x35')]=_0x1174f2[_0x16a9('0x35')][_0x16a9('0x37')]?_0x1174f2['attributes']:_0x2bfb47[_0x16a9('0x30')];if(_0x551a8f[_0x16a9('0x31')][_0x16a9('0x42')]){_0x1174f2[_0x16a9('0x43')]=[{'all':!![]}];}_0x1174f2=_[_0x16a9('0x3f')]({},_0x1174f2,_0x551a8f[_0x16a9('0x49')]);return db['MailSubstatus'][_0x16a9('0x4a')](_0x1174f2)[_0x16a9('0x26')](handleEntityNotFound(_0x20a590,null))['then'](respondWithResult(_0x20a590,null))[_0x16a9('0x46')](handleError(_0x20a590,null));};exports[_0x16a9('0x4b')]=function(_0x4dacd2,_0x24b759){return db[_0x16a9('0x41')]['create'](_0x4dacd2[_0x16a9('0x4c')],{})[_0x16a9('0x26')](respondWithResult(_0x24b759,0xc9))[_0x16a9('0x46')](handleError(_0x24b759,null));};exports[_0x16a9('0x25')]=function(_0xa14c50,_0x4ee285){if(_0xa14c50[_0x16a9('0x4c')]['id']){delete _0xa14c50[_0x16a9('0x4c')]['id'];}return db[_0x16a9('0x41')]['find']({'where':{'id':_0xa14c50[_0x16a9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ee285,null))['then'](saveUpdates(_0xa14c50[_0x16a9('0x4c')],null))[_0x16a9('0x26')](respondWithResult(_0x4ee285,null))['catch'](handleError(_0x4ee285,null));};exports[_0x16a9('0x27')]=function(_0x1023af,_0x643eb5){return db[_0x16a9('0x41')][_0x16a9('0x4a')]({'where':{'id':_0x1023af[_0x16a9('0x4d')]['id']}})[_0x16a9('0x26')](handleEntityNotFound(_0x643eb5,null))[_0x16a9('0x26')](removeEntity(_0x643eb5,null))[_0x16a9('0x46')](handleError(_0x643eb5,null));};exports[_0x16a9('0x4e')]=function(_0x80f7e5,_0x5d2b08){return db[_0x16a9('0x41')]['describe']()[_0x16a9('0x26')](respondWithResult(_0x5d2b08,null))['catch'](handleError(_0x5d2b08,null));}; \ No newline at end of file +var _0x8d2a=['create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x8d2a,0x1bf));var _0xa8d2=function(_0x5f2b46,_0x599333){_0x5f2b46=_0x5f2b46-0x0;var _0x33fe8b=_0x8d2a[_0x5f2b46];return _0x33fe8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8d2('0x0'));var zipdir=require(_0xa8d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8d2('0x2'));var moment=require(_0xa8d2('0x3'));var BPromise=require(_0xa8d2('0x4'));var Mustache=require(_0xa8d2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa8d2('0x6'));var csv=require(_0xa8d2('0x7'));var ejs=require(_0xa8d2('0x8'));var fs=require('fs');var fs_extra=require(_0xa8d2('0x9'));var _=require(_0xa8d2('0xa'));var squel=require(_0xa8d2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa8d2('0xc'));var toCsv=require(_0xa8d2('0x7'));var querystring=require(_0xa8d2('0xd'));var Papa=require(_0xa8d2('0xe'));var Redis=require('ioredis');var authService=require(_0xa8d2('0xf'));var qs=require(_0xa8d2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8d2('0x11'));var logger=require(_0xa8d2('0x12'))(_0xa8d2('0x13'));var utils=require(_0xa8d2('0x14'));var config=require(_0xa8d2('0x15'));var licenseUtil=require(_0xa8d2('0x16'));var db=require(_0xa8d2('0x17'))['db'];function respondWithStatusCode(_0xeb8439,_0xd4294c){_0xd4294c=_0xd4294c||0xcc;return function(_0x1ee85a){if(_0x1ee85a){return _0xeb8439['sendStatus'](_0xd4294c);}return _0xeb8439[_0xa8d2('0x18')](_0xd4294c)[_0xa8d2('0x19')]();};}function respondWithResult(_0x49f79d,_0x5d43eb){_0x5d43eb=_0x5d43eb||0xc8;return function(_0x480fea){if(_0x480fea){return _0x49f79d[_0xa8d2('0x18')](_0x5d43eb)['json'](_0x480fea);}};}function respondWithFilteredResult(_0x5d22b5,_0x2cd40d){return function(_0xbacea3){if(_0xbacea3){var _0x423742=typeof _0x2cd40d[_0xa8d2('0x1a')]===_0xa8d2('0x1b')&&typeof _0x2cd40d[_0xa8d2('0x1c')]===_0xa8d2('0x1b');var _0x99a172=_0xbacea3[_0xa8d2('0x1d')];var _0x24e6e7=_0x423742?0x0:_0x2cd40d[_0xa8d2('0x1a')];var _0x24a785=_0x423742?_0xbacea3['count']:_0x2cd40d[_0xa8d2('0x1a')]+_0x2cd40d[_0xa8d2('0x1c')];var _0x49e386;if(_0x24a785>=_0x99a172){_0x24a785=_0x99a172;_0x49e386=0xc8;}else{_0x49e386=0xce;}_0x5d22b5['status'](_0x49e386);return _0x5d22b5[_0xa8d2('0x1e')](_0xa8d2('0x1f'),_0x24e6e7+'-'+_0x24a785+'/'+_0x99a172)['json'](_0xbacea3);}return null;};}function patchUpdates(_0x166a7c){return function(_0x5857de){try{jsonpatch[_0xa8d2('0x20')](_0x5857de,_0x166a7c,!![]);}catch(_0x51b643){return BPromise[_0xa8d2('0x21')](_0x51b643);}return _0x5857de['save']();};}function saveUpdates(_0x4291d9,_0x549e2b){return function(_0xb0580d){if(_0xb0580d){return _0xb0580d[_0xa8d2('0x22')](_0x4291d9)[_0xa8d2('0x23')](function(_0x193534){return _0x193534;});}return null;};}function removeEntity(_0x25af96,_0x5b8dec){return function(_0x2c4671){if(_0x2c4671){return _0x2c4671[_0xa8d2('0x24')]()[_0xa8d2('0x23')](function(){_0x25af96['status'](0xcc)[_0xa8d2('0x19')]();});}};}function handleEntityNotFound(_0x2d09b9,_0x318859){return function(_0x5f174e){if(!_0x5f174e){_0x2d09b9[_0xa8d2('0x25')](0x194);}return _0x5f174e;};}function handleError(_0x403337,_0x56fd71){_0x56fd71=_0x56fd71||0x1f4;return function(_0x2e81ad){logger['error'](_0x2e81ad[_0xa8d2('0x26')]);if(_0x2e81ad[_0xa8d2('0x27')]){delete _0x2e81ad[_0xa8d2('0x27')];}_0x403337[_0xa8d2('0x18')](_0x56fd71)[_0xa8d2('0x28')](_0x2e81ad);};}exports[_0xa8d2('0x29')]=function(_0x2439dc,_0x437963){var _0x265edd={},_0x380022={},_0x4059c8={'count':0x0,'rows':[]};var _0x450a71=_[_0xa8d2('0x2a')](db[_0xa8d2('0x2b')][_0xa8d2('0x2c')],function(_0xacaeb6){return{'name':_0xacaeb6[_0xa8d2('0x2d')],'type':_0xacaeb6[_0xa8d2('0x2e')][_0xa8d2('0x2f')]};});_0x380022[_0xa8d2('0x30')]=_[_0xa8d2('0x2a')](_0x450a71,_0xa8d2('0x27'));_0x380022[_0xa8d2('0x31')]=_[_0xa8d2('0x32')](_0x2439dc[_0xa8d2('0x31')]);_0x380022['filters']=_[_0xa8d2('0x33')](_0x380022[_0xa8d2('0x30')],_0x380022[_0xa8d2('0x31')]);_0x265edd[_0xa8d2('0x34')]=_[_0xa8d2('0x33')](_0x380022[_0xa8d2('0x30')],qs[_0xa8d2('0x35')](_0x2439dc[_0xa8d2('0x31')]['fields']));_0x265edd[_0xa8d2('0x34')]=_0x265edd[_0xa8d2('0x34')][_0xa8d2('0x36')]?_0x265edd[_0xa8d2('0x34')]:_0x380022[_0xa8d2('0x30')];if(!_0x2439dc[_0xa8d2('0x31')]['hasOwnProperty'](_0xa8d2('0x37'))){_0x265edd['limit']=qs[_0xa8d2('0x1c')](_0x2439dc[_0xa8d2('0x31')][_0xa8d2('0x1c')]);_0x265edd[_0xa8d2('0x1a')]=qs[_0xa8d2('0x1a')](_0x2439dc['query'][_0xa8d2('0x1a')]);}_0x265edd['order']=qs[_0xa8d2('0x38')](_0x2439dc[_0xa8d2('0x31')][_0xa8d2('0x38')]);_0x265edd[_0xa8d2('0x39')]=qs[_0xa8d2('0x3a')](_['pick'](_0x2439dc[_0xa8d2('0x31')],_0x380022[_0xa8d2('0x3a')]),_0x450a71);if(_0x2439dc[_0xa8d2('0x31')][_0xa8d2('0x3b')]){_0x265edd[_0xa8d2('0x39')]=_[_0xa8d2('0x3c')](_0x265edd['where'],{'$or':_['map'](_0x450a71,function(_0x8b028d){if(_0x8b028d[_0xa8d2('0x2e')]!==_0xa8d2('0x3d')){var _0x1874a9={};_0x1874a9[_0x8b028d[_0xa8d2('0x27')]]={'$like':'%'+_0x2439dc[_0xa8d2('0x31')]['filter']+'%'};return _0x1874a9;}})});}_0x265edd=_['merge']({},_0x265edd,_0x2439dc['options']);var _0x38d2d4={'where':_0x265edd['where']};return db[_0xa8d2('0x2b')][_0xa8d2('0x1d')](_0x38d2d4)['then'](function(_0x4a034a){_0x4059c8[_0xa8d2('0x1d')]=_0x4a034a;if(_0x2439dc[_0xa8d2('0x31')][_0xa8d2('0x3e')]){_0x265edd[_0xa8d2('0x3f')]=[{'all':!![]}];}return db[_0xa8d2('0x2b')][_0xa8d2('0x40')](_0x265edd);})['then'](function(_0x33e652){_0x4059c8[_0xa8d2('0x41')]=_0x33e652;return _0x4059c8;})[_0xa8d2('0x23')](respondWithFilteredResult(_0x437963,_0x265edd))[_0xa8d2('0x42')](handleError(_0x437963,null));};exports[_0xa8d2('0x43')]=function(_0x40b19d,_0x4b45ac){var _0x513368={'raw':!![],'where':{'id':_0x40b19d[_0xa8d2('0x44')]['id']}},_0x2822e5={};_0x2822e5[_0xa8d2('0x30')]=_['keys'](db[_0xa8d2('0x2b')][_0xa8d2('0x2c')]);_0x2822e5[_0xa8d2('0x31')]=_['keys'](_0x40b19d[_0xa8d2('0x31')]);_0x2822e5['filters']=_['intersection'](_0x2822e5['model'],_0x2822e5[_0xa8d2('0x31')]);_0x513368[_0xa8d2('0x34')]=_['intersection'](_0x2822e5[_0xa8d2('0x30')],qs[_0xa8d2('0x35')](_0x40b19d['query'][_0xa8d2('0x35')]));_0x513368[_0xa8d2('0x34')]=_0x513368['attributes'][_0xa8d2('0x36')]?_0x513368['attributes']:_0x2822e5[_0xa8d2('0x30')];if(_0x40b19d[_0xa8d2('0x31')][_0xa8d2('0x3e')]){_0x513368[_0xa8d2('0x3f')]=[{'all':!![]}];}_0x513368=_[_0xa8d2('0x3c')]({},_0x513368,_0x40b19d[_0xa8d2('0x45')]);return db[_0xa8d2('0x2b')][_0xa8d2('0x46')](_0x513368)[_0xa8d2('0x23')](handleEntityNotFound(_0x4b45ac,null))[_0xa8d2('0x23')](respondWithResult(_0x4b45ac,null))[_0xa8d2('0x42')](handleError(_0x4b45ac,null));};exports[_0xa8d2('0x47')]=function(_0x5779d4,_0x332197){return db['MailSubstatus'][_0xa8d2('0x47')](_0x5779d4[_0xa8d2('0x48')],{})['then'](respondWithResult(_0x332197,0xc9))[_0xa8d2('0x42')](handleError(_0x332197,null));};exports[_0xa8d2('0x22')]=function(_0xe45df6,_0xcb821d){if(_0xe45df6['body']['id']){delete _0xe45df6[_0xa8d2('0x48')]['id'];}return db[_0xa8d2('0x2b')][_0xa8d2('0x46')]({'where':{'id':_0xe45df6[_0xa8d2('0x44')]['id']}})[_0xa8d2('0x23')](handleEntityNotFound(_0xcb821d,null))[_0xa8d2('0x23')](saveUpdates(_0xe45df6[_0xa8d2('0x48')],null))['then'](respondWithResult(_0xcb821d,null))[_0xa8d2('0x42')](handleError(_0xcb821d,null));};exports[_0xa8d2('0x24')]=function(_0x1f0bc5,_0x52b197){return db[_0xa8d2('0x2b')]['find']({'where':{'id':_0x1f0bc5[_0xa8d2('0x44')]['id']}})['then'](handleEntityNotFound(_0x52b197,null))[_0xa8d2('0x23')](removeEntity(_0x52b197,null))[_0xa8d2('0x42')](handleError(_0x52b197,null));};exports[_0xa8d2('0x49')]=function(_0x16f9ba,_0x194bcb){return db['MailSubstatus'][_0xa8d2('0x49')]()[_0xa8d2('0x23')](respondWithResult(_0x194bcb,null))[_0xa8d2('0x42')](handleError(_0x194bcb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 4085438..27eefcf 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2872=['hook','exports','events','../../mysqldb','MailSubstatus','update','hasOwnProperty'];(function(_0x4b0503,_0x2e7fb8){var _0x1d621f=function(_0x1e3d69){while(--_0x1e3d69){_0x4b0503['push'](_0x4b0503['shift']());}};_0x1d621f(++_0x2e7fb8);}(_0x2872,0xdb));var _0x2287=function(_0x1f22f7,_0x20576a){_0x1f22f7=_0x1f22f7-0x0;var _0x39b170=_0x2872[_0x1f22f7];return _0x39b170;};'use strict';var EventEmitter=require(_0x2287('0x0'));var MailSubstatus=require(_0x2287('0x1'))['db'][_0x2287('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x2287('0x3')};function emitEvent(_0x135929){return function(_0x189707,_0x1531fc,_0x408469){MailSubstatusEvents['emit'](_0x135929+':'+_0x189707['id'],_0x189707);MailSubstatusEvents['emit'](_0x135929,_0x189707);_0x408469(null);};}for(var e in events){if(events[_0x2287('0x4')](e)){var event=events[e];MailSubstatus[_0x2287('0x5')](e,emitEvent(event));}}module[_0x2287('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x101c=['MailSubstatus','setMaxListeners','update','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2b7389,_0x478af5){var _0x581223=function(_0x2afb34){while(--_0x2afb34){_0x2b7389['push'](_0x2b7389['shift']());}};_0x581223(++_0x478af5);}(_0x101c,0x66));var _0xc101=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x101c[_0x210d7f];return _0x42d687;};'use strict';var EventEmitter=require(_0xc101('0x0'));var MailSubstatus=require(_0xc101('0x1'))['db'][_0xc101('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xc101('0x3')](0x0);var events={'afterUpdate':_0xc101('0x4')};function emitEvent(_0x3b505f){return function(_0x9c4c2c,_0x3e6011,_0x5cdf41){MailSubstatusEvents['emit'](_0x3b505f+':'+_0x9c4c2c['id'],_0x9c4c2c);MailSubstatusEvents['emit'](_0x3b505f,_0x9c4c2c);_0x5cdf41(null);};}for(var e in events){if(events[_0xc101('0x5')](e)){var event=events[e];MailSubstatus[_0xc101('0x6')](e,emitEvent(event));}}module[_0xc101('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4db2452..a94c0a9 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 _0xb475=['_previousDataValues','name','./mailSubstatus.attributes','models','MailSubstatus','mail_substatuses','Condition','update'];(function(_0x126ba2,_0x295ebf){var _0x8a9bff=function(_0x367093){while(--_0x367093){_0x126ba2['push'](_0x126ba2['shift']());}};_0x8a9bff(++_0x295ebf);}(_0xb475,0x1e2));var _0x5b47=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xb475[_0x4ed1d4];return _0x28e363;};'use strict';var attributes=require(_0x5b47('0x0'));module['exports']=function(_0x2541e6){var _0x47c547=_0x2541e6[_0x5b47('0x1')];return _0x2541e6['define'](_0x5b47('0x2'),attributes,{'tableName':_0x5b47('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x23233b,_0x25a931,_0x2a3581){return _0x47c547[_0x5b47('0x4')][_0x5b47('0x5')]({'value':_0x23233b['name']},{'where':{'field':'mailSubstatus','value':_0x23233b[_0x5b47('0x6')][_0x5b47('0x7')]}})['then'](function(){_0x2a3581();})['catch'](function(_0x58c8e7){_0x2a3581(_0x58c8e7);});}}});}; \ No newline at end of file +var _0xa264=['define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','models'];(function(_0x18d55e,_0x3aad08){var _0x22f977=function(_0x27d445){while(--_0x27d445){_0x18d55e['push'](_0x18d55e['shift']());}};_0x22f977(++_0x3aad08);}(_0xa264,0x148));var _0x4a26=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0xa264[_0x30033a];return _0x5e3518;};'use strict';var attributes=require(_0x4a26('0x0'));module['exports']=function(_0x3b356c){var _0xaffb93=_0x3b356c[_0x4a26('0x1')];return _0x3b356c[_0x4a26('0x2')](_0x4a26('0x3'),attributes,{'tableName':_0x4a26('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x511409,_0x9084fe,_0x17d652){return _0xaffb93[_0x4a26('0x5')][_0x4a26('0x6')]({'value':_0x511409[_0x4a26('0x7')]},{'where':{'field':_0x4a26('0x8'),'value':_0x511409[_0x4a26('0x9')]['name']}})[_0x4a26('0xa')](function(){_0x17d652();})['catch'](function(_0xca5fa8){_0x17d652(_0xca5fa8);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9bb1952..4367fb0 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 _0x46a0=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailSubstatus,\x20%s,\x20%s','result','lodash'];(function(_0x58afbb,_0x388ccb){var _0x354a04=function(_0x265ddb){while(--_0x265ddb){_0x58afbb['push'](_0x58afbb['shift']());}};_0x354a04(++_0x388ccb);}(_0x46a0,0xe3));var _0x046a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46a0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x046a('0x0'));var util=require('util');var moment=require(_0x046a('0x1'));var BPromise=require('bluebird');var rs=require(_0x046a('0x2'));var fs=require('fs');var Redis=require(_0x046a('0x3'));var db=require(_0x046a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x046a('0x5'))(_0x046a('0x6'));var config=require(_0x046a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x046a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x368dea,_0x6e3311,_0x1fd243){return new BPromise(function(_0x5a2b3d,_0x15f932){return client[_0x046a('0x9')](_0x368dea,_0x1fd243)[_0x046a('0xa')](function(_0x4db3a3){logger[_0x046a('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x6e3311,'request\x20sent');logger['debug'](_0x046a('0xc'),_0x6e3311,_0x046a('0xd'),JSON[_0x046a('0xe')](_0x4db3a3));if(_0x4db3a3[_0x046a('0xf')]){if(_0x4db3a3[_0x046a('0xf')]['code']===0x1f4){logger[_0x046a('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x6e3311,_0x4db3a3[_0x046a('0xf')][_0x046a('0x10')]);return _0x15f932(_0x4db3a3[_0x046a('0xf')]['message']);}logger[_0x046a('0xf')](_0x046a('0x11'),_0x6e3311,_0x4db3a3[_0x046a('0xf')]['message']);return _0x5a2b3d(_0x4db3a3[_0x046a('0xf')][_0x046a('0x10')]);}else{logger[_0x046a('0xb')](_0x046a('0x11'),_0x6e3311,_0x046a('0xd'));_0x5a2b3d(_0x4db3a3[_0x046a('0x12')][_0x046a('0x10')]);}})['catch'](function(_0x42a37b){logger[_0x046a('0xf')](_0x046a('0x11'),_0x6e3311,_0x42a37b);_0x15f932(_0x42a37b);});});} \ No newline at end of file +var _0x548b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','MailSubstatus,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x548b,0x14f));var _0xb548=function(_0x203cfe,_0x5064b1){_0x203cfe=_0x203cfe-0x0;var _0x5ae83e=_0x548b[_0x203cfe];return _0x5ae83e;};'use strict';var _=require(_0xb548('0x0'));var util=require('util');var moment=require(_0xb548('0x1'));var BPromise=require(_0xb548('0x2'));var rs=require(_0xb548('0x3'));var fs=require('fs');var Redis=require(_0xb548('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb548('0x5'))(_0xb548('0x6'));var config=require(_0xb548('0x7'));var jayson=require(_0xb548('0x8'));var client=jayson[_0xb548('0x9')][_0xb548('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19b4bd,_0x235ca8,_0x37eac1){return new BPromise(function(_0x1aee82,_0x3b0a54){return client['request'](_0x19b4bd,_0x37eac1)[_0xb548('0xb')](function(_0x1e9a75){logger[_0xb548('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x235ca8,_0xb548('0xd'));logger[_0xb548('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x235ca8,'request\x20sent',JSON['stringify'](_0x1e9a75));if(_0x1e9a75[_0xb548('0xf')]){if(_0x1e9a75[_0xb548('0xf')][_0xb548('0x10')]===0x1f4){logger['error'](_0xb548('0x11'),_0x235ca8,_0x1e9a75[_0xb548('0xf')]['message']);return _0x3b0a54(_0x1e9a75[_0xb548('0xf')][_0xb548('0x12')]);}logger[_0xb548('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x235ca8,_0x1e9a75[_0xb548('0xf')][_0xb548('0x12')]);return _0x1aee82(_0x1e9a75[_0xb548('0xf')][_0xb548('0x12')]);}else{logger[_0xb548('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x235ca8,'request\x20sent');_0x1aee82(_0x1e9a75[_0xb548('0x13')]['message']);}})['catch'](function(_0x48c6f4){logger[_0xb548('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x235ca8,_0x48c6f4);_0x3b0a54(_0x48c6f4);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index bdbcc09..90a8b29 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 _0x2ca9=['index','/describe','describe','/:id','show','post','create','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5bd5fc,_0x57597){var _0x420110=function(_0x3d99d8){while(--_0x3d99d8){_0x5bd5fc['push'](_0x5bd5fc['shift']());}};_0x420110(++_0x57597);}(_0x2ca9,0xe6));var _0x92ca=function(_0x5e334a,_0x28d858){_0x5e334a=_0x5e334a-0x0;var _0x2e37e7=_0x2ca9[_0x5e334a];return _0x2e37e7;};'use strict';var multer=require('multer');var util=require(_0x92ca('0x0'));var path=require(_0x92ca('0x1'));var timeout=require(_0x92ca('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x92ca('0x3'));var interaction=require(_0x92ca('0x4'));var config=require(_0x92ca('0x5'));var controller=require('./mailTransferReport.controller');router[_0x92ca('0x6')]('/',auth[_0x92ca('0x7')](),controller[_0x92ca('0x8')]);router[_0x92ca('0x6')](_0x92ca('0x9'),auth[_0x92ca('0x7')](),controller[_0x92ca('0xa')]);router[_0x92ca('0x6')](_0x92ca('0xb'),auth[_0x92ca('0x7')](),controller[_0x92ca('0xc')]);router[_0x92ca('0xd')]('/',auth['isAuthenticated'](),controller[_0x92ca('0xe')]);router['put'](_0x92ca('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x92ca('0xb'),auth['isAuthenticated'](),controller[_0x92ca('0xf')]);module[_0x92ca('0x10')]=router; \ No newline at end of file +var _0xdc91=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','./mailTransferReport.controller'];(function(_0x12c8bd,_0x2110d0){var _0x2d5faf=function(_0x19434e){while(--_0x19434e){_0x12c8bd['push'](_0x12c8bd['shift']());}};_0x2d5faf(++_0x2110d0);}(_0xdc91,0x109));var _0x1dc9=function(_0x15117c,_0x1a6b3d){_0x15117c=_0x15117c-0x0;var _0x28a74f=_0xdc91[_0x15117c];return _0x28a74f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1dc9('0x0'));var timeout=require(_0x1dc9('0x1'));var express=require(_0x1dc9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1dc9('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1dc9('0x4'));router[_0x1dc9('0x5')]('/',auth[_0x1dc9('0x6')](),controller[_0x1dc9('0x7')]);router['get'](_0x1dc9('0x8'),auth[_0x1dc9('0x6')](),controller[_0x1dc9('0x9')]);router[_0x1dc9('0x5')](_0x1dc9('0xa'),auth['isAuthenticated'](),controller[_0x1dc9('0xb')]);router['post']('/',auth[_0x1dc9('0x6')](),controller[_0x1dc9('0xc')]);router[_0x1dc9('0xd')]('/:id',auth[_0x1dc9('0x6')](),controller[_0x1dc9('0xe')]);router[_0x1dc9('0xf')](_0x1dc9('0xa'),auth[_0x1dc9('0x6')](),controller[_0x1dc9('0x10')]);module[_0x1dc9('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 7d4976e..164cadf 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xee50c8,_0x1d426e){var _0x279f00=function(_0x148604){while(--_0x148604){_0xee50c8['push'](_0xee50c8['shift']());}};_0x279f00(++_0x1d426e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2c36ac,_0x246f01){_0x2c36ac=_0x2c36ac-0x0;var _0x29503e=_0x9bde[_0x2c36ac];return _0x29503e;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 570bd6b..4c6c959 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 _0xe5fb=['params','keys','include','find','create','update','body','describe','eml-format','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','end','stack','name','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','MailTransferReport','includeAll','findAll','catch','show'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe5fb,0xd7));var _0xbe5f=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0xe5fb[_0x60286b];return _0x5dff69;};'use strict';var emlformat=require(_0xbe5f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe5f('0x1'));var BPromise=require(_0xbe5f('0x2'));var Mustache=require(_0xbe5f('0x3'));var util=require(_0xbe5f('0x4'));var path=require(_0xbe5f('0x5'));var sox=require('sox');var csv=require(_0xbe5f('0x6'));var ejs=require(_0xbe5f('0x7'));var fs=require('fs');var fs_extra=require(_0xbe5f('0x8'));var _=require(_0xbe5f('0x9'));var squel=require(_0xbe5f('0xa'));var crypto=require('crypto');var jsforce=require(_0xbe5f('0xb'));var deskjs=require(_0xbe5f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe5f('0xd'));var Papa=require(_0xbe5f('0xe'));var Redis=require(_0xbe5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbe5f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe5f('0x11'));var logger=require('../../config/logger')(_0xbe5f('0x12'));var utils=require(_0xbe5f('0x13'));var config=require(_0xbe5f('0x14'));var licenseUtil=require(_0xbe5f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fa261,_0x1fd4e5){_0x1fd4e5=_0x1fd4e5||0xcc;return function(_0x454340){if(_0x454340){return _0x4fa261[_0xbe5f('0x16')](_0x1fd4e5);}return _0x4fa261[_0xbe5f('0x17')](_0x1fd4e5)['end']();};}function respondWithResult(_0x4a56a3,_0x1b7dd6){_0x1b7dd6=_0x1b7dd6||0xc8;return function(_0x7d546d){if(_0x7d546d){return _0x4a56a3['status'](_0x1b7dd6)['json'](_0x7d546d);}};}function respondWithFilteredResult(_0x22e379,_0x3f490a){return function(_0x4f5a05){if(_0x4f5a05){var _0x1cc6f5=typeof _0x3f490a['offset']===_0xbe5f('0x18')&&typeof _0x3f490a[_0xbe5f('0x19')]===_0xbe5f('0x18');var _0x4b4eaf=_0x4f5a05[_0xbe5f('0x1a')];var _0x2a089b=_0x1cc6f5?0x0:_0x3f490a['offset'];var _0x11e1b5=_0x1cc6f5?_0x4f5a05[_0xbe5f('0x1a')]:_0x3f490a[_0xbe5f('0x1b')]+_0x3f490a['limit'];var _0x1df3e4;if(_0x11e1b5>=_0x4b4eaf){_0x11e1b5=_0x4b4eaf;_0x1df3e4=0xc8;}else{_0x1df3e4=0xce;}_0x22e379[_0xbe5f('0x17')](_0x1df3e4);return _0x22e379[_0xbe5f('0x1c')](_0xbe5f('0x1d'),_0x2a089b+'-'+_0x11e1b5+'/'+_0x4b4eaf)[_0xbe5f('0x1e')](_0x4f5a05);}return null;};}function patchUpdates(_0x44852c){return function(_0x46dcf4){try{jsonpatch[_0xbe5f('0x1f')](_0x46dcf4,_0x44852c,!![]);}catch(_0x416104){return BPromise['reject'](_0x416104);}return _0x46dcf4['save']();};}function saveUpdates(_0x5ce72f,_0x5399ca){return function(_0x43fcc4){if(_0x43fcc4){return _0x43fcc4['update'](_0x5ce72f)[_0xbe5f('0x20')](function(_0x6db52f){return _0x6db52f;});}return null;};}function removeEntity(_0x4b8aad,_0x54b3e1){return function(_0x5841d5){if(_0x5841d5){return _0x5841d5[_0xbe5f('0x21')]()[_0xbe5f('0x20')](function(){_0x4b8aad[_0xbe5f('0x17')](0xcc)[_0xbe5f('0x22')]();});}};}function handleEntityNotFound(_0x8495f0,_0x361c3f){return function(_0x4c952b){if(!_0x4c952b){_0x8495f0[_0xbe5f('0x16')](0x194);}return _0x4c952b;};}function handleError(_0x142e15,_0x184d46){_0x184d46=_0x184d46||0x1f4;return function(_0x1d4bd7){logger['error'](_0x1d4bd7[_0xbe5f('0x23')]);if(_0x1d4bd7[_0xbe5f('0x24')]){delete _0x1d4bd7['name'];}_0x142e15['status'](_0x184d46)['send'](_0x1d4bd7);};}exports['index']=function(_0x2bd8b9,_0x4749e8){var _0x12bc5e={},_0x4bfd9c={},_0x43d220={'count':0x0,'rows':[]};var _0x374954=_['map'](db['MailTransferReport'][_0xbe5f('0x25')],function(_0x4f372c){return{'name':_0x4f372c['fieldName'],'type':_0x4f372c[_0xbe5f('0x26')][_0xbe5f('0x27')]};});_0x4bfd9c[_0xbe5f('0x28')]=_['map'](_0x374954,_0xbe5f('0x24'));_0x4bfd9c[_0xbe5f('0x29')]=_['keys'](_0x2bd8b9[_0xbe5f('0x29')]);_0x4bfd9c[_0xbe5f('0x2a')]=_[_0xbe5f('0x2b')](_0x4bfd9c['model'],_0x4bfd9c[_0xbe5f('0x29')]);_0x12bc5e['attributes']=_[_0xbe5f('0x2b')](_0x4bfd9c[_0xbe5f('0x28')],qs['fields'](_0x2bd8b9[_0xbe5f('0x29')]['fields']));_0x12bc5e[_0xbe5f('0x2c')]=_0x12bc5e[_0xbe5f('0x2c')][_0xbe5f('0x2d')]?_0x12bc5e[_0xbe5f('0x2c')]:_0x4bfd9c[_0xbe5f('0x28')];if(!_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x2e')](_0xbe5f('0x2f'))){_0x12bc5e[_0xbe5f('0x19')]=qs[_0xbe5f('0x19')](_0x2bd8b9[_0xbe5f('0x29')]['limit']);_0x12bc5e['offset']=qs[_0xbe5f('0x1b')](_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x1b')]);}_0x12bc5e[_0xbe5f('0x30')]=qs[_0xbe5f('0x31')](_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x31')]);_0x12bc5e[_0xbe5f('0x32')]=qs['filters'](_[_0xbe5f('0x33')](_0x2bd8b9[_0xbe5f('0x29')],_0x4bfd9c['filters']),_0x374954);if(_0x2bd8b9[_0xbe5f('0x29')]['filter']){_0x12bc5e[_0xbe5f('0x32')]=_['merge'](_0x12bc5e['where'],{'$or':_['map'](_0x374954,function(_0x57e46d){if(_0x57e46d[_0xbe5f('0x26')]!==_0xbe5f('0x34')){var _0x1efe2b={};_0x1efe2b[_0x57e46d['name']]={'$like':'%'+_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x35')]+'%'};return _0x1efe2b;}})});}_0x12bc5e=_[_0xbe5f('0x36')]({},_0x12bc5e,_0x2bd8b9[_0xbe5f('0x37')]);var _0x28c3b6={'where':_0x12bc5e[_0xbe5f('0x32')]};return db[_0xbe5f('0x38')][_0xbe5f('0x1a')](_0x28c3b6)['then'](function(_0x3e1b1f){_0x43d220[_0xbe5f('0x1a')]=_0x3e1b1f;if(_0x2bd8b9[_0xbe5f('0x29')][_0xbe5f('0x39')]){_0x12bc5e['include']=[{'all':!![]}];}return db[_0xbe5f('0x38')][_0xbe5f('0x3a')](_0x12bc5e);})[_0xbe5f('0x20')](function(_0x55421f){_0x43d220['rows']=_0x55421f;return _0x43d220;})[_0xbe5f('0x20')](respondWithFilteredResult(_0x4749e8,_0x12bc5e))[_0xbe5f('0x3b')](handleError(_0x4749e8,null));};exports[_0xbe5f('0x3c')]=function(_0x1f4d6b,_0x151818){var _0x2d452c={'raw':!![],'where':{'id':_0x1f4d6b[_0xbe5f('0x3d')]['id']}},_0x515833={};_0x515833[_0xbe5f('0x28')]=_['keys'](db[_0xbe5f('0x38')][_0xbe5f('0x25')]);_0x515833['query']=_[_0xbe5f('0x3e')](_0x1f4d6b[_0xbe5f('0x29')]);_0x515833[_0xbe5f('0x2a')]=_[_0xbe5f('0x2b')](_0x515833['model'],_0x515833[_0xbe5f('0x29')]);_0x2d452c['attributes']=_[_0xbe5f('0x2b')](_0x515833[_0xbe5f('0x28')],qs['fields'](_0x1f4d6b[_0xbe5f('0x29')]['fields']));_0x2d452c[_0xbe5f('0x2c')]=_0x2d452c[_0xbe5f('0x2c')][_0xbe5f('0x2d')]?_0x2d452c[_0xbe5f('0x2c')]:_0x515833['model'];if(_0x1f4d6b['query'][_0xbe5f('0x39')]){_0x2d452c[_0xbe5f('0x3f')]=[{'all':!![]}];}_0x2d452c=_[_0xbe5f('0x36')]({},_0x2d452c,_0x1f4d6b[_0xbe5f('0x37')]);return db['MailTransferReport'][_0xbe5f('0x40')](_0x2d452c)[_0xbe5f('0x20')](handleEntityNotFound(_0x151818,null))['then'](respondWithResult(_0x151818,null))[_0xbe5f('0x3b')](handleError(_0x151818,null));};exports['create']=function(_0x15e1bd,_0x18f64b){return db['MailTransferReport'][_0xbe5f('0x41')](_0x15e1bd['body'],{})[_0xbe5f('0x20')](respondWithResult(_0x18f64b,0xc9))[_0xbe5f('0x3b')](handleError(_0x18f64b,null));};exports[_0xbe5f('0x42')]=function(_0x452672,_0x24f79b){if(_0x452672[_0xbe5f('0x43')]['id']){delete _0x452672[_0xbe5f('0x43')]['id'];}return db['MailTransferReport'][_0xbe5f('0x40')]({'where':{'id':_0x452672[_0xbe5f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x24f79b,null))[_0xbe5f('0x20')](saveUpdates(_0x452672[_0xbe5f('0x43')],null))['then'](respondWithResult(_0x24f79b,null))[_0xbe5f('0x3b')](handleError(_0x24f79b,null));};exports[_0xbe5f('0x21')]=function(_0x464dff,_0x4a4c9b){return db[_0xbe5f('0x38')]['find']({'where':{'id':_0x464dff['params']['id']}})[_0xbe5f('0x20')](handleEntityNotFound(_0x4a4c9b,null))['then'](removeEntity(_0x4a4c9b,null))['catch'](handleError(_0x4a4c9b,null));};exports[_0xbe5f('0x44')]=function(_0x593e9a,_0x5d45c7){return db[_0xbe5f('0x38')][_0xbe5f('0x44')]()[_0xbe5f('0x20')](respondWithResult(_0x5d45c7,null))[_0xbe5f('0x3b')](handleError(_0x5d45c7,null));}; \ No newline at end of file +var _0x2980=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','MailTransferReport','includeAll','findAll','rows','catch','params','include','find','create','body','update','describe','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','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','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x590ed3,_0x4e3dcf){var _0x474362=function(_0x52db58){while(--_0x52db58){_0x590ed3['push'](_0x590ed3['shift']());}};_0x474362(++_0x4e3dcf);}(_0x2980,0x189));var _0x0298=function(_0x1b9a73,_0x5654b1){_0x1b9a73=_0x1b9a73-0x0;var _0x2f7a25=_0x2980[_0x1b9a73];return _0x2f7a25;};'use strict';var emlformat=require(_0x0298('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0298('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0298('0x2'));var BPromise=require(_0x0298('0x3'));var Mustache=require('mustache');var util=require(_0x0298('0x4'));var path=require(_0x0298('0x5'));var sox=require(_0x0298('0x6'));var csv=require(_0x0298('0x7'));var ejs=require(_0x0298('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0298('0x9'));var squel=require(_0x0298('0xa'));var crypto=require(_0x0298('0xb'));var jsforce=require(_0x0298('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0298('0x7'));var querystring=require('querystring');var Papa=require(_0x0298('0xd'));var Redis=require(_0x0298('0xe'));var authService=require(_0x0298('0xf'));var qs=require(_0x0298('0x10'));var as=require(_0x0298('0x11'));var hardwareService=require(_0x0298('0x12'));var logger=require(_0x0298('0x13'))(_0x0298('0x14'));var utils=require(_0x0298('0x15'));var config=require(_0x0298('0x16'));var licenseUtil=require(_0x0298('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b2bc3,_0xd5cc0a){_0xd5cc0a=_0xd5cc0a||0xcc;return function(_0x119c5c){if(_0x119c5c){return _0x3b2bc3[_0x0298('0x18')](_0xd5cc0a);}return _0x3b2bc3['status'](_0xd5cc0a)[_0x0298('0x19')]();};}function respondWithResult(_0x49ba9c,_0x417a81){_0x417a81=_0x417a81||0xc8;return function(_0x1230cf){if(_0x1230cf){return _0x49ba9c['status'](_0x417a81)[_0x0298('0x1a')](_0x1230cf);}};}function respondWithFilteredResult(_0xa37095,_0x26ff4e){return function(_0x3dd0f8){if(_0x3dd0f8){var _0x45bc24=typeof _0x26ff4e[_0x0298('0x1b')]===_0x0298('0x1c')&&typeof _0x26ff4e['limit']===_0x0298('0x1c');var _0x463954=_0x3dd0f8[_0x0298('0x1d')];var _0x4c2dc0=_0x45bc24?0x0:_0x26ff4e['offset'];var _0x71cf18=_0x45bc24?_0x3dd0f8[_0x0298('0x1d')]:_0x26ff4e[_0x0298('0x1b')]+_0x26ff4e[_0x0298('0x1e')];var _0x3af4fc;if(_0x71cf18>=_0x463954){_0x71cf18=_0x463954;_0x3af4fc=0xc8;}else{_0x3af4fc=0xce;}_0xa37095[_0x0298('0x1f')](_0x3af4fc);return _0xa37095[_0x0298('0x20')]('Content-Range',_0x4c2dc0+'-'+_0x71cf18+'/'+_0x463954)[_0x0298('0x1a')](_0x3dd0f8);}return null;};}function patchUpdates(_0x5371ab){return function(_0xc73064){try{jsonpatch[_0x0298('0x21')](_0xc73064,_0x5371ab,!![]);}catch(_0x3bb85c){return BPromise[_0x0298('0x22')](_0x3bb85c);}return _0xc73064['save']();};}function saveUpdates(_0x2b6ff1,_0xd8062e){return function(_0x231d4f){if(_0x231d4f){return _0x231d4f['update'](_0x2b6ff1)['then'](function(_0x5eb63e){return _0x5eb63e;});}return null;};}function removeEntity(_0x56f07a,_0x45b3f9){return function(_0x29c70b){if(_0x29c70b){return _0x29c70b['destroy']()[_0x0298('0x23')](function(){_0x56f07a[_0x0298('0x1f')](0xcc)[_0x0298('0x19')]();});}};}function handleEntityNotFound(_0x301f5c,_0x209f77){return function(_0x27654c){if(!_0x27654c){_0x301f5c[_0x0298('0x18')](0x194);}return _0x27654c;};}function handleError(_0x98886d,_0x7eb7ef){_0x7eb7ef=_0x7eb7ef||0x1f4;return function(_0x37b99b){logger[_0x0298('0x24')](_0x37b99b['stack']);if(_0x37b99b[_0x0298('0x25')]){delete _0x37b99b[_0x0298('0x25')];}_0x98886d[_0x0298('0x1f')](_0x7eb7ef)[_0x0298('0x26')](_0x37b99b);};}exports[_0x0298('0x27')]=function(_0x24e00f,_0x492141){var _0x5c286f={},_0x3370c0={},_0x5eb133={'count':0x0,'rows':[]};var _0x48c371=_[_0x0298('0x28')](db['MailTransferReport'][_0x0298('0x29')],function(_0x5daa57){return{'name':_0x5daa57[_0x0298('0x2a')],'type':_0x5daa57[_0x0298('0x2b')][_0x0298('0x2c')]};});_0x3370c0[_0x0298('0x2d')]=_[_0x0298('0x28')](_0x48c371,_0x0298('0x25'));_0x3370c0[_0x0298('0x2e')]=_[_0x0298('0x2f')](_0x24e00f[_0x0298('0x2e')]);_0x3370c0[_0x0298('0x30')]=_[_0x0298('0x31')](_0x3370c0['model'],_0x3370c0[_0x0298('0x2e')]);_0x5c286f[_0x0298('0x32')]=_['intersection'](_0x3370c0[_0x0298('0x2d')],qs[_0x0298('0x33')](_0x24e00f[_0x0298('0x2e')][_0x0298('0x33')]));_0x5c286f[_0x0298('0x32')]=_0x5c286f[_0x0298('0x32')][_0x0298('0x34')]?_0x5c286f[_0x0298('0x32')]:_0x3370c0[_0x0298('0x2d')];if(!_0x24e00f[_0x0298('0x2e')][_0x0298('0x35')](_0x0298('0x36'))){_0x5c286f[_0x0298('0x1e')]=qs[_0x0298('0x1e')](_0x24e00f[_0x0298('0x2e')][_0x0298('0x1e')]);_0x5c286f['offset']=qs['offset'](_0x24e00f[_0x0298('0x2e')][_0x0298('0x1b')]);}_0x5c286f[_0x0298('0x37')]=qs[_0x0298('0x38')](_0x24e00f[_0x0298('0x2e')][_0x0298('0x38')]);_0x5c286f[_0x0298('0x39')]=qs['filters'](_[_0x0298('0x3a')](_0x24e00f[_0x0298('0x2e')],_0x3370c0[_0x0298('0x30')]),_0x48c371);if(_0x24e00f[_0x0298('0x2e')][_0x0298('0x3b')]){_0x5c286f[_0x0298('0x39')]=_[_0x0298('0x3c')](_0x5c286f['where'],{'$or':_[_0x0298('0x28')](_0x48c371,function(_0x4e24a3){if(_0x4e24a3[_0x0298('0x2b')]!=='VIRTUAL'){var _0x2f39b7={};_0x2f39b7[_0x4e24a3[_0x0298('0x25')]]={'$like':'%'+_0x24e00f[_0x0298('0x2e')]['filter']+'%'};return _0x2f39b7;}})});}_0x5c286f=_[_0x0298('0x3c')]({},_0x5c286f,_0x24e00f[_0x0298('0x3d')]);var _0x222494={'where':_0x5c286f[_0x0298('0x39')]};return db[_0x0298('0x3e')][_0x0298('0x1d')](_0x222494)[_0x0298('0x23')](function(_0x113142){_0x5eb133[_0x0298('0x1d')]=_0x113142;if(_0x24e00f['query'][_0x0298('0x3f')]){_0x5c286f['include']=[{'all':!![]}];}return db[_0x0298('0x3e')][_0x0298('0x40')](_0x5c286f);})[_0x0298('0x23')](function(_0x3b54de){_0x5eb133[_0x0298('0x41')]=_0x3b54de;return _0x5eb133;})[_0x0298('0x23')](respondWithFilteredResult(_0x492141,_0x5c286f))[_0x0298('0x42')](handleError(_0x492141,null));};exports['show']=function(_0x1c859c,_0x39ee9b){var _0x35d343={'raw':!![],'where':{'id':_0x1c859c[_0x0298('0x43')]['id']}},_0x1f706b={};_0x1f706b[_0x0298('0x2d')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x1f706b[_0x0298('0x2e')]=_[_0x0298('0x2f')](_0x1c859c[_0x0298('0x2e')]);_0x1f706b[_0x0298('0x30')]=_['intersection'](_0x1f706b[_0x0298('0x2d')],_0x1f706b[_0x0298('0x2e')]);_0x35d343[_0x0298('0x32')]=_[_0x0298('0x31')](_0x1f706b['model'],qs[_0x0298('0x33')](_0x1c859c[_0x0298('0x2e')][_0x0298('0x33')]));_0x35d343[_0x0298('0x32')]=_0x35d343[_0x0298('0x32')]['length']?_0x35d343['attributes']:_0x1f706b[_0x0298('0x2d')];if(_0x1c859c['query'][_0x0298('0x3f')]){_0x35d343[_0x0298('0x44')]=[{'all':!![]}];}_0x35d343=_[_0x0298('0x3c')]({},_0x35d343,_0x1c859c['options']);return db[_0x0298('0x3e')][_0x0298('0x45')](_0x35d343)[_0x0298('0x23')](handleEntityNotFound(_0x39ee9b,null))['then'](respondWithResult(_0x39ee9b,null))['catch'](handleError(_0x39ee9b,null));};exports[_0x0298('0x46')]=function(_0x339e19,_0x13dd05){return db[_0x0298('0x3e')][_0x0298('0x46')](_0x339e19[_0x0298('0x47')],{})[_0x0298('0x23')](respondWithResult(_0x13dd05,0xc9))[_0x0298('0x42')](handleError(_0x13dd05,null));};exports[_0x0298('0x48')]=function(_0x3ba8ee,_0x46735a){if(_0x3ba8ee[_0x0298('0x47')]['id']){delete _0x3ba8ee[_0x0298('0x47')]['id'];}return db[_0x0298('0x3e')][_0x0298('0x45')]({'where':{'id':_0x3ba8ee[_0x0298('0x43')]['id']}})[_0x0298('0x23')](handleEntityNotFound(_0x46735a,null))[_0x0298('0x23')](saveUpdates(_0x3ba8ee[_0x0298('0x47')],null))['then'](respondWithResult(_0x46735a,null))[_0x0298('0x42')](handleError(_0x46735a,null));};exports['destroy']=function(_0x12d527,_0x1ad2cf){return db[_0x0298('0x3e')]['find']({'where':{'id':_0x12d527[_0x0298('0x43')]['id']}})[_0x0298('0x23')](handleEntityNotFound(_0x1ad2cf,null))['then'](removeEntity(_0x1ad2cf,null))[_0x0298('0x42')](handleError(_0x1ad2cf,null));};exports['describe']=function(_0x50a6d2,_0x3f7a50){return db[_0x0298('0x3e')][_0x0298('0x49')]()[_0x0298('0x23')](respondWithResult(_0x3f7a50,null))['catch'](handleError(_0x3f7a50,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 07fc4c9..6866f56 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 _0xb2ef=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x2fbc48,_0x2b9ff4){var _0x5db015=function(_0x9d3124){while(--_0x9d3124){_0x2fbc48['push'](_0x2fbc48['shift']());}};_0x5db015(++_0x2b9ff4);}(_0xb2ef,0xa7));var _0xfb2e=function(_0xb419b0,_0x2c7a74){_0xb419b0=_0xb419b0-0x0;var _0x4eb455=_0xb2ef[_0xb419b0];return _0x4eb455;};'use strict';var _=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var logger=require(_0xfb2e('0x2'))('api');var moment=require(_0xfb2e('0x3'));var BPromise=require(_0xfb2e('0x4'));var rp=require(_0xfb2e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var attributes=require(_0xfb2e('0x8'));module[_0xfb2e('0x9')]=function(_0x3069a,_0x2a1c23){return _0x3069a[_0xfb2e('0xa')](_0xfb2e('0xb'),attributes,{'tableName':_0xfb2e('0xc'),'paranoid':![],'indexes':[{'name':_0xfb2e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa990=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailTransferReport.attributes'];(function(_0x324e1a,_0x4577ad){var _0x23d252=function(_0x557a85){while(--_0x557a85){_0x324e1a['push'](_0x324e1a['shift']());}};_0x23d252(++_0x4577ad);}(_0xa990,0xc9));var _0x0a99=function(_0x53eaf8,_0x218d42){_0x53eaf8=_0x53eaf8-0x0;var _0x2d76b2=_0xa990[_0x53eaf8];return _0x2d76b2;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var rp=require(_0x0a99('0x6'));var fs=require('fs');var path=require(_0x0a99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a99('0x8'));module[_0x0a99('0x9')]=function(_0xfdb594,_0x320560){return _0xfdb594[_0x0a99('0xa')](_0x0a99('0xb'),attributes,{'tableName':_0x0a99('0xc'),'paranoid':![],'indexes':[{'name':_0x0a99('0xd'),'fields':[_0x0a99('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 1c0a079..b8d2a67 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 _0xe07b=['code','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x436fb2,_0x5cba16){var _0x3cb885=function(_0x1ba810){while(--_0x1ba810){_0x436fb2['push'](_0x436fb2['shift']());}};_0x3cb885(++_0x5cba16);}(_0xe07b,0x1c7));var _0xbe07=function(_0x23c97e,_0x53e757){_0x23c97e=_0x23c97e-0x0;var _0x13db38=_0xe07b[_0x23c97e];return _0x13db38;};'use strict';var _=require(_0xbe07('0x0'));var util=require(_0xbe07('0x1'));var moment=require(_0xbe07('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe07('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe07('0x4'))(_0xbe07('0x5'));var config=require('../../config/environment');var jayson=require(_0xbe07('0x6'));var client=jayson[_0xbe07('0x7')][_0xbe07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb837ad,_0x815f12,_0x5c4ba2){return new BPromise(function(_0x144830,_0x1cbb26){return client['request'](_0xb837ad,_0x5c4ba2)['then'](function(_0x3b256e){logger[_0xbe07('0x9')](_0xbe07('0xa'),_0x815f12,_0xbe07('0xb'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x815f12,_0xbe07('0xb'),JSON[_0xbe07('0xc')](_0x3b256e));if(_0x3b256e['error']){if(_0x3b256e['error'][_0xbe07('0xd')]===0x1f4){logger[_0xbe07('0xe')](_0xbe07('0xa'),_0x815f12,_0x3b256e[_0xbe07('0xe')][_0xbe07('0xf')]);return _0x1cbb26(_0x3b256e[_0xbe07('0xe')]['message']);}logger[_0xbe07('0xe')](_0xbe07('0xa'),_0x815f12,_0x3b256e[_0xbe07('0xe')][_0xbe07('0xf')]);return _0x144830(_0x3b256e['error'][_0xbe07('0xf')]);}else{logger['info'](_0xbe07('0xa'),_0x815f12,_0xbe07('0xb'));_0x144830(_0x3b256e[_0xbe07('0x10')][_0xbe07('0xf')]);}})[_0xbe07('0x11')](function(_0x2d03af){logger[_0xbe07('0xe')](_0xbe07('0xa'),_0x815f12,_0x2d03af);_0x1cbb26(_0x2d03af);});});} \ No newline at end of file +var _0x0552=['error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x33275b,_0xfd4b17){var _0x59addf=function(_0x17da09){while(--_0x17da09){_0x33275b['push'](_0x33275b['shift']());}};_0x59addf(++_0xfd4b17);}(_0x0552,0x142));var _0x2055=function(_0x35f0bb,_0x1b00f4){_0x35f0bb=_0x35f0bb-0x0;var _0x479e9d=_0x0552[_0x35f0bb];return _0x479e9d;};'use strict';var _=require('lodash');var util=require(_0x2055('0x0'));var moment=require(_0x2055('0x1'));var BPromise=require(_0x2055('0x2'));var rs=require(_0x2055('0x3'));var fs=require('fs');var Redis=require(_0x2055('0x4'));var db=require(_0x2055('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2055('0x6'))('rpc');var config=require(_0x2055('0x7'));var jayson=require(_0x2055('0x8'));var client=jayson['client'][_0x2055('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3869aa,_0x21c4fd,_0x49762f){return new BPromise(function(_0x2f644a,_0x8b2bf3){return client[_0x2055('0xa')](_0x3869aa,_0x49762f)['then'](function(_0x21f340){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x21c4fd,_0x2055('0xb'));logger[_0x2055('0xc')](_0x2055('0xd'),_0x21c4fd,_0x2055('0xb'),JSON['stringify'](_0x21f340));if(_0x21f340[_0x2055('0xe')]){if(_0x21f340['error'][_0x2055('0xf')]===0x1f4){logger['error'](_0x2055('0x10'),_0x21c4fd,_0x21f340[_0x2055('0xe')]['message']);return _0x8b2bf3(_0x21f340[_0x2055('0xe')][_0x2055('0x11')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x21c4fd,_0x21f340[_0x2055('0xe')]['message']);return _0x2f644a(_0x21f340[_0x2055('0xe')][_0x2055('0x11')]);}else{logger[_0x2055('0x12')](_0x2055('0x10'),_0x21c4fd,_0x2055('0xb'));_0x2f644a(_0x21f340[_0x2055('0x13')][_0x2055('0x11')]);}})[_0x2055('0x14')](function(_0x37184d){logger['error'](_0x2055('0x10'),_0x21c4fd,_0x37184d);_0x8b2bf3(_0x37184d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5a38f15..b8330ba 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 _0x83d2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1b6599,_0x2620e6){var _0x2d3616=function(_0x4f1ea6){while(--_0x4f1ea6){_0x1b6599['push'](_0x1b6599['shift']());}};_0x2d3616(++_0x2620e6);}(_0x83d2,0x157));var _0x283d=function(_0x28ab58,_0x6263ba){_0x28ab58=_0x28ab58-0x0;var _0x414e41=_0x83d2[_0x28ab58];return _0x414e41;};'use strict';var multer=require(_0x283d('0x0'));var util=require(_0x283d('0x1'));var path=require(_0x283d('0x2'));var timeout=require(_0x283d('0x3'));var express=require(_0x283d('0x4'));var router=express[_0x283d('0x5')]();var fs_extra=require(_0x283d('0x6'));var auth=require(_0x283d('0x7'));var interaction=require(_0x283d('0x8'));var config=require('../../config/environment');var controller=require(_0x283d('0x9'));router[_0x283d('0xa')]('/',auth[_0x283d('0xb')](),controller[_0x283d('0xc')]);router[_0x283d('0xa')](_0x283d('0xd'),auth[_0x283d('0xb')](),controller[_0x283d('0xe')]);router[_0x283d('0xa')](_0x283d('0xf'),auth[_0x283d('0xb')](),controller[_0x283d('0x10')]);router[_0x283d('0x11')]('/',auth[_0x283d('0xb')](),controller[_0x283d('0x12')]);router[_0x283d('0x13')](_0x283d('0xf'),auth[_0x283d('0xb')](),controller['update']);router[_0x283d('0x14')](_0x283d('0xf'),auth[_0x283d('0xb')](),controller[_0x283d('0x15')]);module[_0x283d('0x16')]=router; \ No newline at end of file +var _0x215b=['/:id','show','create','update','delete','multer','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x2e4c68,_0x7b9d88){var _0x45fe22=function(_0x5bde9b){while(--_0x5bde9b){_0x2e4c68['push'](_0x2e4c68['shift']());}};_0x45fe22(++_0x7b9d88);}(_0x215b,0xf5));var _0xb215=function(_0x3edf3f,_0x33f781){_0x3edf3f=_0x3edf3f-0x0;var _0x4f6820=_0x215b[_0x3edf3f];return _0x4f6820;};'use strict';var multer=require(_0xb215('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb215('0x1'));var router=express[_0xb215('0x2')]();var fs_extra=require(_0xb215('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb215('0x4'));var controller=require('./memberReport.controller');router[_0xb215('0x5')]('/',auth[_0xb215('0x6')](),controller[_0xb215('0x7')]);router[_0xb215('0x5')](_0xb215('0x8'),auth['isAuthenticated'](),controller[_0xb215('0x9')]);router['get'](_0xb215('0xa'),auth[_0xb215('0x6')](),controller[_0xb215('0xb')]);router['post']('/',auth[_0xb215('0x6')](),controller[_0xb215('0xc')]);router['put'](_0xb215('0xa'),auth['isAuthenticated'](),controller[_0xb215('0xd')]);router[_0xb215('0xe')](_0xb215('0xa'),auth[_0xb215('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 1e57716..e36c948 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 _0x4266=['moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]'];(function(_0x20ec57,_0x2c51b6){var _0x2859f3=function(_0x5173c1){while(--_0x5173c1){_0x20ec57['push'](_0x20ec57['shift']());}};_0x2859f3(++_0x2c51b6);}(_0x4266,0x13b));var _0x6426=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x4266[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6426('0x0'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6426('0x1')]},'interface':{'type':Sequelize[_0x6426('0x1')]},'type':{'type':Sequelize[_0x6426('0x1')],'defaultValue':_0x6426('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6426('0x3')]},'enterAt':{'type':Sequelize[_0x6426('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3f08a4){var _0x364a2c=moment(_0x3f08a4);var _0x4f462d=moment(this[_0x6426('0x5')](_0x6426('0x6')));var _0x540af3=_0x364a2c[_0x6426('0x7')](_0x4f462d,'seconds');this[_0x6426('0x8')](_0x6426('0x9'),_0x3f08a4);this[_0x6426('0x8')](_0x6426('0xa'),_0x540af3>=0x0?_0x540af3:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6426('0xb')},'data2':{'type':Sequelize[_0x6426('0x1')],'comment':_0x6426('0xc')},'data3':{'type':Sequelize[_0x6426('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x6426('0xd')},'data5':{'type':Sequelize[_0x6426('0x1')],'comment':_0x6426('0xe')},'role':{'type':Sequelize[_0x6426('0x1')]},'internal':{'type':Sequelize[_0x6426('0x3')]},'uniqueid':{'type':Sequelize[_0x6426('0x1')]}}; \ No newline at end of file +var _0x9501=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x43214e,_0x3a8f04){var _0x14e0c8=function(_0x17c739){while(--_0x17c739){_0x43214e['push'](_0x43214e['shift']());}};_0x14e0c8(++_0x3a8f04);}(_0x9501,0xe0));var _0x1950=function(_0x5f556a,_0x1e7458){_0x5f556a=_0x5f556a-0x0;var _0xa02e51=_0x9501[_0x5f556a];return _0xa02e51;};'use strict';var Sequelize=require(_0x1950('0x0'));var moment=require(_0x1950('0x1'));module['exports']={'channel':{'type':Sequelize[_0x1950('0x2')]},'membername':{'type':Sequelize[_0x1950('0x2')]},'interface':{'type':Sequelize[_0x1950('0x2')]},'type':{'type':Sequelize[_0x1950('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x1950('0x3')},'duration':{'type':Sequelize[_0x1950('0x4')]},'enterAt':{'type':Sequelize[_0x1950('0x5')]},'exitAt':{'type':Sequelize[_0x1950('0x5')],'set':function(_0x4a81ef){var _0xced548=moment(_0x4a81ef);var _0x28070c=moment(this[_0x1950('0x6')](_0x1950('0x7')));var _0x3ea22f=_0xced548['diff'](_0x28070c,_0x1950('0x8'));this[_0x1950('0x9')](_0x1950('0xa'),_0x4a81ef);this[_0x1950('0x9')](_0x1950('0xb'),_0x3ea22f>=0x0?_0x3ea22f:null);}},'data1':{'type':Sequelize[_0x1950('0x2')],'comment':_0x1950('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x1950('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x1950('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x1950('0xf')},'data5':{'type':Sequelize[_0x1950('0x2')],'comment':_0x1950('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x1950('0x4')]},'uniqueid':{'type':Sequelize[_0x1950('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 42420ed..82c4e8e 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x34e8,0x12c));var _0x834e=function(_0x329bb9,_0x267c83){_0x329bb9=_0x329bb9-0x0;var _0x204bdc=_0x34e8[_0x329bb9];return _0x204bdc;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x45bee0,_0x42bf09){var _0x1fcfd5=function(_0x235b6a){while(--_0x235b6a){_0x45bee0['push'](_0x45bee0['shift']());}};_0x1fcfd5(++_0x42bf09);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 6866e0c..d3fd4d0 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 _0xf22c=['path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x901043,_0x560885){var _0x4d1889=function(_0xf8396b){while(--_0xf8396b){_0x901043['push'](_0x901043['shift']());}};_0x4d1889(++_0x560885);}(_0xf22c,0x19f));var _0xcf22=function(_0x6f9a83,_0x254ed6){_0x6f9a83=_0x6f9a83-0x0;var _0x2f8c29=_0xf22c[_0x6f9a83];return _0x2f8c29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf22('0x0'))(_0xcf22('0x1'));var moment=require(_0xcf22('0x2'));var BPromise=require(_0xcf22('0x3'));var rp=require(_0xcf22('0x4'));var fs=require('fs');var path=require(_0xcf22('0x5'));var rimraf=require(_0xcf22('0x6'));var config=require(_0xcf22('0x7'));var attributes=require(_0xcf22('0x8'));module['exports']=function(_0x62d436,_0x48a28b){return _0x62d436[_0xcf22('0x9')](_0xcf22('0xa'),attributes,{'tableName':_0xcf22('0xb'),'paranoid':![],'indexes':[{'name':_0xcf22('0xc'),'fields':[_0xcf22('0xd'),_0xcf22('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8cc=['./memberReport.attributes','report_member','membername_interface','interface','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x14cb91,_0x569fa7){var _0x16af91=function(_0x509be9){while(--_0x509be9){_0x14cb91['push'](_0x14cb91['shift']());}};_0x16af91(++_0x569fa7);}(_0xf8cc,0x1e4));var _0xcf8c=function(_0x168230,_0x696a35){_0x168230=_0x168230-0x0;var _0x3daa18=_0xf8cc[_0x168230];return _0x3daa18;};'use strict';var _=require(_0xcf8c('0x0'));var util=require(_0xcf8c('0x1'));var logger=require(_0xcf8c('0x2'))('api');var moment=require(_0xcf8c('0x3'));var BPromise=require(_0xcf8c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf8c('0x5'));var rimraf=require(_0xcf8c('0x6'));var config=require(_0xcf8c('0x7'));var attributes=require(_0xcf8c('0x8'));module['exports']=function(_0x4d9b27,_0x5a2c60){return _0x4d9b27['define']('MemberReport',attributes,{'tableName':_0xcf8c('0x9'),'paranoid':![],'indexes':[{'name':_0xcf8c('0xa'),'fields':['membername',_0xcf8c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 753321e..f7c3956 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 _0x9b69=['GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0x9b69,0xa3));var _0x99b6=function(_0x55abeb,_0x194aa7){_0x55abeb=_0x55abeb-0x0;var _0x2162e1=_0x9b69[_0x55abeb];return _0x2162e1;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var moment=require(_0x99b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x4'));var logger=require(_0x99b6('0x5'))(_0x99b6('0x6'));var config=require('../../config/environment');var jayson=require(_0x99b6('0x7'));var client=jayson['client'][_0x99b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x319215,_0x3d96ae,_0x18647f){return new BPromise(function(_0x29155e,_0x1d188d){return client[_0x99b6('0x9')](_0x319215,_0x18647f)[_0x99b6('0xa')](function(_0x1e8826){logger[_0x99b6('0xb')](_0x99b6('0xc'),_0x3d96ae,_0x99b6('0xd'));logger[_0x99b6('0xe')](_0x99b6('0xf'),_0x3d96ae,_0x99b6('0xd'),JSON[_0x99b6('0x10')](_0x1e8826));if(_0x1e8826[_0x99b6('0x11')]){if(_0x1e8826[_0x99b6('0x11')][_0x99b6('0x12')]===0x1f4){logger[_0x99b6('0x11')]('MemberReport,\x20%s,\x20%s',_0x3d96ae,_0x1e8826['error']['message']);return _0x1d188d(_0x1e8826['error']['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3d96ae,_0x1e8826[_0x99b6('0x11')][_0x99b6('0x13')]);return _0x29155e(_0x1e8826[_0x99b6('0x11')]['message']);}else{logger[_0x99b6('0xb')](_0x99b6('0xc'),_0x3d96ae,_0x99b6('0xd'));_0x29155e(_0x1e8826[_0x99b6('0x14')]['message']);}})[_0x99b6('0x15')](function(_0x52a4da){logger[_0x99b6('0x11')](_0x99b6('0xc'),_0x3d96ae,_0x52a4da);_0x1d188d(_0x52a4da);});});}exports[_0x99b6('0x16')]=function(_0x3fd5ad){var _0x1a6436=this;return new Promise(function(_0x4cb2e7,_0x2873c8){return db['MemberReport'][_0x99b6('0x17')]({'raw':_0x3fd5ad[_0x99b6('0x18')]?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x19')]===undefined?!![]:![]:!![],'where':_0x3fd5ad[_0x99b6('0x18')]?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1a')]||null:null,'attributes':_0x3fd5ad['options']?_0x3fd5ad['options'][_0x99b6('0x1b')]||null:null,'limit':_0x3fd5ad[_0x99b6('0x18')]?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1c')]||null:null,'include':_0x3fd5ad['options']?_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1d')]?_[_0x99b6('0x1e')](_0x3fd5ad[_0x99b6('0x18')][_0x99b6('0x1d')],function(_0x22db3f){return{'model':db[_0x22db3f[_0x99b6('0x1f')]],'as':_0x22db3f['as'],'attributes':_0x22db3f[_0x99b6('0x1b')],'include':_0x22db3f[_0x99b6('0x1d')]?_[_0x99b6('0x1e')](_0x22db3f[_0x99b6('0x1d')],function(_0x2d92a6){return{'model':db[_0x2d92a6[_0x99b6('0x1f')]],'as':_0x2d92a6['as'],'attributes':_0x2d92a6['attributes'],'include':_0x2d92a6[_0x99b6('0x1d')]?_['map'](_0x2d92a6[_0x99b6('0x1d')],function(_0x486a7f){return{'model':db[_0x486a7f[_0x99b6('0x1f')]],'as':_0x486a7f['as'],'attributes':_0x486a7f[_0x99b6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dcf7f){logger[_0x99b6('0xb')](_0x99b6('0x16'),_0x3fd5ad);logger[_0x99b6('0xe')]('GetMemberReport',_0x3fd5ad,JSON['stringify'](_0x5dcf7f));_0x4cb2e7(_0x5dcf7f);})['catch'](function(_0x55e859){logger[_0x99b6('0x11')](_0x99b6('0x16'),_0x55e859['message'],_0x3fd5ad);_0x2873c8(_0x1a6436[_0x99b6('0x11')](0x1f4,_0x55e859[_0x99b6('0x13')]));});});};exports[_0x99b6('0x20')]=function(_0x311351){var _0x200caf=this;return new Promise(function(_0x4be34f,_0x197565){return db[_0x99b6('0x21')][_0x99b6('0x22')](_0x311351[_0x99b6('0x23')],{'raw':_0x311351[_0x99b6('0x18')]?_0x311351['options'][_0x99b6('0x19')]===undefined?!![]:![]:!![]})[_0x99b6('0xa')](function(_0x210ba7){logger[_0x99b6('0xb')](_0x99b6('0x20'),_0x311351);logger[_0x99b6('0xe')](_0x99b6('0x20'),_0x311351,JSON[_0x99b6('0x10')](_0x210ba7));_0x4be34f(_0x210ba7);})['catch'](function(_0x21552d){logger[_0x99b6('0x11')](_0x99b6('0x20'),_0x21552d[_0x99b6('0x13')],_0x311351);_0x197565(_0x200caf[_0x99b6('0x11')](0x1f4,_0x21552d[_0x99b6('0x13')]));});});};exports[_0x99b6('0x24')]=function(_0xd54d55){var _0x33c47a=this;return new Promise(function(_0x489fee,_0x27c82e){return db[_0x99b6('0x21')]['update'](_0xd54d55[_0x99b6('0x23')],{'raw':_0xd54d55['options']?_0xd54d55[_0x99b6('0x18')][_0x99b6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd54d55[_0x99b6('0x18')]?_0xd54d55[_0x99b6('0x18')]['where']||null:null,'attributes':_0xd54d55[_0x99b6('0x18')]?_0xd54d55['options'][_0x99b6('0x1b')]||null:null,'limit':_0xd54d55[_0x99b6('0x18')]?_0xd54d55[_0x99b6('0x18')][_0x99b6('0x1c')]||null:null})[_0x99b6('0xa')](function(_0x383f1b){logger[_0x99b6('0xb')](_0x99b6('0x24'),_0xd54d55);logger[_0x99b6('0xe')](_0x99b6('0x24'),_0xd54d55,JSON[_0x99b6('0x10')](_0x383f1b));_0x489fee(_0x383f1b);})[_0x99b6('0x15')](function(_0x5db557){logger['error'](_0x99b6('0x24'),_0x5db557[_0x99b6('0x13')],_0xd54d55);_0x27c82e(_0x33c47a[_0x99b6('0x11')](0x1f4,_0x5db557[_0x99b6('0x13')]));});});}; \ No newline at end of file +var _0x522b=['CreateMemberReport','create','body','then','UpdateMemberReport','update','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','MemberReport,\x20%s,\x20%s','message','MemberReport','findAll','options','raw','attributes','limit','include','map','model','GetMemberReport','stringify'];(function(_0x2de26f,_0x54ca77){var _0x40827c=function(_0x61a812){while(--_0x61a812){_0x2de26f['push'](_0x2de26f['shift']());}};_0x40827c(++_0x54ca77);}(_0x522b,0x1c3));var _0xb522=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x522b[_0x32d457];return _0x338386;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var moment=require('moment');var BPromise=require(_0xb522('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb522('0x3'))['db'];var utils=require(_0xb522('0x4'));var logger=require('../../config/logger')(_0xb522('0x5'));var config=require(_0xb522('0x6'));var jayson=require(_0xb522('0x7'));var client=jayson[_0xb522('0x8')][_0xb522('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55a5f0,_0x446229,_0x2f289f){return new BPromise(function(_0x5a5cd3,_0x55259d){return client[_0xb522('0xa')](_0x55a5f0,_0x2f289f)['then'](function(_0x3f4f63){logger[_0xb522('0xb')]('MemberReport,\x20%s,\x20%s',_0x446229,_0xb522('0xc'));logger[_0xb522('0xd')](_0xb522('0xe'),_0x446229,'request\x20sent',JSON['stringify'](_0x3f4f63));if(_0x3f4f63[_0xb522('0xf')]){if(_0x3f4f63[_0xb522('0xf')][_0xb522('0x10')]===0x1f4){logger['error'](_0xb522('0x11'),_0x446229,_0x3f4f63['error'][_0xb522('0x12')]);return _0x55259d(_0x3f4f63[_0xb522('0xf')]['message']);}logger[_0xb522('0xf')]('MemberReport,\x20%s,\x20%s',_0x446229,_0x3f4f63[_0xb522('0xf')][_0xb522('0x12')]);return _0x5a5cd3(_0x3f4f63[_0xb522('0xf')][_0xb522('0x12')]);}else{logger[_0xb522('0xb')](_0xb522('0x11'),_0x446229,_0xb522('0xc'));_0x5a5cd3(_0x3f4f63['result'][_0xb522('0x12')]);}})['catch'](function(_0x435f25){logger[_0xb522('0xf')](_0xb522('0x11'),_0x446229,_0x435f25);_0x55259d(_0x435f25);});});}exports['GetMemberReport']=function(_0x2077e8){var _0x49a898=this;return new Promise(function(_0x2bdf4f,_0x27c6eb){return db[_0xb522('0x13')][_0xb522('0x14')]({'raw':_0x2077e8[_0xb522('0x15')]?_0x2077e8[_0xb522('0x15')][_0xb522('0x16')]===undefined?!![]:![]:!![],'where':_0x2077e8['options']?_0x2077e8['options']['where']||null:null,'attributes':_0x2077e8[_0xb522('0x15')]?_0x2077e8[_0xb522('0x15')][_0xb522('0x17')]||null:null,'limit':_0x2077e8[_0xb522('0x15')]?_0x2077e8[_0xb522('0x15')][_0xb522('0x18')]||null:null,'include':_0x2077e8[_0xb522('0x15')]?_0x2077e8[_0xb522('0x15')][_0xb522('0x19')]?_[_0xb522('0x1a')](_0x2077e8[_0xb522('0x15')][_0xb522('0x19')],function(_0x3799ec){return{'model':db[_0x3799ec['model']],'as':_0x3799ec['as'],'attributes':_0x3799ec[_0xb522('0x17')],'include':_0x3799ec[_0xb522('0x19')]?_['map'](_0x3799ec[_0xb522('0x19')],function(_0x149abf){return{'model':db[_0x149abf[_0xb522('0x1b')]],'as':_0x149abf['as'],'attributes':_0x149abf['attributes'],'include':_0x149abf[_0xb522('0x19')]?_['map'](_0x149abf[_0xb522('0x19')],function(_0x313c8d){return{'model':db[_0x313c8d[_0xb522('0x1b')]],'as':_0x313c8d['as'],'attributes':_0x313c8d[_0xb522('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x518f56){logger[_0xb522('0xb')]('GetMemberReport',_0x2077e8);logger[_0xb522('0xd')](_0xb522('0x1c'),_0x2077e8,JSON[_0xb522('0x1d')](_0x518f56));_0x2bdf4f(_0x518f56);})['catch'](function(_0x1a5f9d){logger[_0xb522('0xf')]('GetMemberReport',_0x1a5f9d[_0xb522('0x12')],_0x2077e8);_0x27c6eb(_0x49a898[_0xb522('0xf')](0x1f4,_0x1a5f9d[_0xb522('0x12')]));});});};exports[_0xb522('0x1e')]=function(_0x139a9a){var _0x5bc250=this;return new Promise(function(_0x162ac7,_0x2e7449){return db[_0xb522('0x13')][_0xb522('0x1f')](_0x139a9a[_0xb522('0x20')],{'raw':_0x139a9a[_0xb522('0x15')]?_0x139a9a[_0xb522('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xb522('0x21')](function(_0x15c4af){logger[_0xb522('0xb')]('CreateMemberReport',_0x139a9a);logger[_0xb522('0xd')](_0xb522('0x1e'),_0x139a9a,JSON['stringify'](_0x15c4af));_0x162ac7(_0x15c4af);})['catch'](function(_0xbfedfb){logger[_0xb522('0xf')](_0xb522('0x1e'),_0xbfedfb[_0xb522('0x12')],_0x139a9a);_0x2e7449(_0x5bc250[_0xb522('0xf')](0x1f4,_0xbfedfb[_0xb522('0x12')]));});});};exports[_0xb522('0x22')]=function(_0x13527e){var _0x2824f6=this;return new Promise(function(_0x187f57,_0x392d50){return db[_0xb522('0x13')][_0xb522('0x23')](_0x13527e[_0xb522('0x20')],{'raw':_0x13527e[_0xb522('0x15')]?_0x13527e[_0xb522('0x15')][_0xb522('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13527e[_0xb522('0x15')]?_0x13527e[_0xb522('0x15')]['where']||null:null,'attributes':_0x13527e['options']?_0x13527e['options'][_0xb522('0x17')]||null:null,'limit':_0x13527e[_0xb522('0x15')]?_0x13527e[_0xb522('0x15')][_0xb522('0x18')]||null:null})[_0xb522('0x21')](function(_0x2cc288){logger[_0xb522('0xb')]('UpdateMemberReport',_0x13527e);logger['debug'](_0xb522('0x22'),_0x13527e,JSON['stringify'](_0x2cc288));_0x187f57(_0x2cc288);})[_0xb522('0x24')](function(_0x2257f4){logger[_0xb522('0xf')](_0xb522('0x22'),_0x2257f4[_0xb522('0x12')],_0x13527e);_0x392d50(_0x2824f6[_0xb522('0xf')](0x1f4,_0x2257f4[_0xb522('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d8cd1ab..496bc8c 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 _0xd121=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x17ec3b,_0x3d08d2){var _0x45c6fd=function(_0x15c760){while(--_0x15c760){_0x17ec3b['push'](_0x17ec3b['shift']());}};_0x45c6fd(++_0x3d08d2);}(_0xd121,0x112));var _0x1d12=function(_0x2eb1fe,_0x250b5a){_0x2eb1fe=_0x2eb1fe-0x0;var _0x10b81a=_0xd121[_0x2eb1fe];return _0x10b81a;};'use strict';var multer=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var path=require('path');var timeout=require(_0x1d12('0x2'));var express=require(_0x1d12('0x3'));var router=express[_0x1d12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d12('0x5'));var interaction=require(_0x1d12('0x6'));var config=require(_0x1d12('0x7'));var controller=require(_0x1d12('0x8'));router[_0x1d12('0x9')]('/',controller[_0x1d12('0xa')]);module[_0x1d12('0xb')]=router; \ No newline at end of file +var _0x2d66=['fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','util','path','connect-timeout','Router'];(function(_0x181bac,_0x2efb40){var _0x2d2693=function(_0x592af7){while(--_0x592af7){_0x181bac['push'](_0x181bac['shift']());}};_0x2d2693(++_0x2efb40);}(_0x2d66,0x18c));var _0x62d6=function(_0x50fc13,_0x1eb5f0){_0x50fc13=_0x50fc13-0x0;var _0x242f8a=_0x2d66[_0x50fc13];return _0x242f8a;};'use strict';var multer=require('multer');var util=require(_0x62d6('0x0'));var path=require(_0x62d6('0x1'));var timeout=require(_0x62d6('0x2'));var express=require('express');var router=express[_0x62d6('0x3')]();var fs_extra=require(_0x62d6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x62d6('0x5'));var config=require(_0x62d6('0x6'));var controller=require(_0x62d6('0x7'));router[_0x62d6('0x8')]('/',controller['index']);module[_0x62d6('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 3aa22f9..7dc2273 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 _0x22ef=['sequelize','exports','version'];(function(_0x1b099b,_0x46766c){var _0x1b2cf2=function(_0x129299){while(--_0x129299){_0x1b099b['push'](_0x1b099b['shift']());}};_0x1b2cf2(++_0x46766c);}(_0x22ef,0x17d));var _0xf22e=function(_0x5bbfbc,_0x1d38f2){_0x5bbfbc=_0x5bbfbc-0x0;var _0x41ac46=_0x22ef[_0x5bbfbc];return _0x41ac46;};'use strict';var Sequelize=require(_0xf22e('0x0'));module[_0xf22e('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xf22e('0x2')}}; \ No newline at end of file +var _0x0a64=['version','exports','STRING'];(function(_0x343c93,_0x172d05){var _0x82b3f5=function(_0x583fe5){while(--_0x583fe5){_0x343c93['push'](_0x343c93['shift']());}};_0x82b3f5(++_0x172d05);}(_0x0a64,0x1f3));var _0x40a6=function(_0x3b8d3d,_0x22758b){_0x3b8d3d=_0x3b8d3d-0x0;var _0x4f10aa=_0x0a64[_0x3b8d3d];return _0x4f10aa;};'use strict';var Sequelize=require('sequelize');module[_0x40a6('0x0')]={'version':{'type':Sequelize[_0x40a6('0x1')],'unique':_0x40a6('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index aee9ea6..7623c1b 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 _0xaefe=['name','send','index','map','Migration','rawAttributes','type','model','keys','filters','intersection','query','attributes','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','where','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','error','stack'];(function(_0x5b5410,_0x47277a){var _0x9c2c09=function(_0x38fa04){while(--_0x38fa04){_0x5b5410['push'](_0x5b5410['shift']());}};_0x9c2c09(++_0x47277a);}(_0xaefe,0x91));var _0xeaef=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0xaefe[_0x42bafd];return _0x2ed705;};'use strict';var emlformat=require(_0xeaef('0x0'));var rimraf=require(_0xeaef('0x1'));var zipdir=require(_0xeaef('0x2'));var jsonpatch=require(_0xeaef('0x3'));var rp=require(_0xeaef('0x4'));var moment=require('moment');var BPromise=require(_0xeaef('0x5'));var Mustache=require(_0xeaef('0x6'));var util=require('util');var path=require('path');var sox=require(_0xeaef('0x7'));var csv=require(_0xeaef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeaef('0x9'));var _=require(_0xeaef('0xa'));var squel=require(_0xeaef('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeaef('0xc'));var toCsv=require(_0xeaef('0x8'));var querystring=require(_0xeaef('0xd'));var Papa=require(_0xeaef('0xe'));var Redis=require(_0xeaef('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeaef('0x10'));var hardwareService=require(_0xeaef('0x11'));var logger=require('../../config/logger')(_0xeaef('0x12'));var utils=require('../../config/utils');var config=require(_0xeaef('0x13'));var licenseUtil=require(_0xeaef('0x14'));var db=require(_0xeaef('0x15'))['db'];function respondWithStatusCode(_0x3c5e61,_0x2c14ce){_0x2c14ce=_0x2c14ce||0xcc;return function(_0x893dc4){if(_0x893dc4){return _0x3c5e61[_0xeaef('0x16')](_0x2c14ce);}return _0x3c5e61[_0xeaef('0x17')](_0x2c14ce)[_0xeaef('0x18')]();};}function respondWithResult(_0xa985ad,_0x19eac0){_0x19eac0=_0x19eac0||0xc8;return function(_0x518268){if(_0x518268){return _0xa985ad[_0xeaef('0x17')](_0x19eac0)[_0xeaef('0x19')](_0x518268);}};}function respondWithFilteredResult(_0x58f1e9,_0x41d07c){return function(_0x36c22f){if(_0x36c22f){var _0x3487de=typeof _0x41d07c['offset']===_0xeaef('0x1a')&&typeof _0x41d07c[_0xeaef('0x1b')]===_0xeaef('0x1a');var _0x34ce10=_0x36c22f['count'];var _0x21ba48=_0x3487de?0x0:_0x41d07c[_0xeaef('0x1c')];var _0x4462e0=_0x3487de?_0x36c22f[_0xeaef('0x1d')]:_0x41d07c[_0xeaef('0x1c')]+_0x41d07c[_0xeaef('0x1b')];var _0xbf168;if(_0x4462e0>=_0x34ce10){_0x4462e0=_0x34ce10;_0xbf168=0xc8;}else{_0xbf168=0xce;}_0x58f1e9[_0xeaef('0x17')](_0xbf168);return _0x58f1e9['set'](_0xeaef('0x1e'),_0x21ba48+'-'+_0x4462e0+'/'+_0x34ce10)[_0xeaef('0x19')](_0x36c22f);}return null;};}function patchUpdates(_0x4bfa88){return function(_0x34fa2d){try{jsonpatch[_0xeaef('0x1f')](_0x34fa2d,_0x4bfa88,!![]);}catch(_0xd3440f){return BPromise[_0xeaef('0x20')](_0xd3440f);}return _0x34fa2d[_0xeaef('0x21')]();};}function saveUpdates(_0x2c3ff3,_0x49c6dd){return function(_0x3689ae){if(_0x3689ae){return _0x3689ae[_0xeaef('0x22')](_0x2c3ff3)['then'](function(_0x29ece3){return _0x29ece3;});}return null;};}function removeEntity(_0x22bacb,_0x1a1251){return function(_0x1ba6c8){if(_0x1ba6c8){return _0x1ba6c8['destroy']()[_0xeaef('0x23')](function(){_0x22bacb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x60377d,_0x70b609){return function(_0x4684ab){if(!_0x4684ab){_0x60377d['sendStatus'](0x194);}return _0x4684ab;};}function handleError(_0x2d45b1,_0x17da48){_0x17da48=_0x17da48||0x1f4;return function(_0x5d6722){logger[_0xeaef('0x24')](_0x5d6722[_0xeaef('0x25')]);if(_0x5d6722[_0xeaef('0x26')]){delete _0x5d6722[_0xeaef('0x26')];}_0x2d45b1[_0xeaef('0x17')](_0x17da48)[_0xeaef('0x27')](_0x5d6722);};}exports[_0xeaef('0x28')]=function(_0x353139,_0x31ad80){var _0x282bb8={},_0x1102fc={},_0x119ae3={'count':0x0,'rows':[]};var _0x92bd72=_[_0xeaef('0x29')](db[_0xeaef('0x2a')][_0xeaef('0x2b')],function(_0x15c308){return{'name':_0x15c308['fieldName'],'type':_0x15c308[_0xeaef('0x2c')]['key']};});_0x1102fc[_0xeaef('0x2d')]=_['map'](_0x92bd72,_0xeaef('0x26'));_0x1102fc['query']=_[_0xeaef('0x2e')](_0x353139['query']);_0x1102fc[_0xeaef('0x2f')]=_[_0xeaef('0x30')](_0x1102fc[_0xeaef('0x2d')],_0x1102fc[_0xeaef('0x31')]);_0x282bb8[_0xeaef('0x32')]=_['intersection'](_0x1102fc[_0xeaef('0x2d')],qs['fields'](_0x353139[_0xeaef('0x31')]['fields']));_0x282bb8[_0xeaef('0x32')]=_0x282bb8[_0xeaef('0x32')]['length']?_0x282bb8[_0xeaef('0x32')]:_0x1102fc[_0xeaef('0x2d')];if(!_0x353139[_0xeaef('0x31')][_0xeaef('0x33')](_0xeaef('0x34'))){_0x282bb8[_0xeaef('0x1b')]=qs[_0xeaef('0x1b')](_0x353139[_0xeaef('0x31')][_0xeaef('0x1b')]);_0x282bb8[_0xeaef('0x1c')]=qs[_0xeaef('0x1c')](_0x353139[_0xeaef('0x31')]['offset']);}_0x282bb8['order']=qs['sort'](_0x353139[_0xeaef('0x31')][_0xeaef('0x35')]);_0x282bb8['where']=qs[_0xeaef('0x2f')](_['pick'](_0x353139[_0xeaef('0x31')],_0x1102fc['filters']),_0x92bd72);if(_0x353139[_0xeaef('0x31')][_0xeaef('0x36')]){_0x282bb8['where']=_[_0xeaef('0x37')](_0x282bb8['where'],{'$or':_[_0xeaef('0x29')](_0x92bd72,function(_0x416440){if(_0x416440['type']!==_0xeaef('0x38')){var _0x5d80f9={};_0x5d80f9[_0x416440['name']]={'$like':'%'+_0x353139[_0xeaef('0x31')][_0xeaef('0x36')]+'%'};return _0x5d80f9;}})});}_0x282bb8=_[_0xeaef('0x37')]({},_0x282bb8,_0x353139['options']);var _0x590b24={'where':_0x282bb8[_0xeaef('0x39')]};return db[_0xeaef('0x2a')]['count'](_0x590b24)['then'](function(_0x504184){_0x119ae3[_0xeaef('0x1d')]=_0x504184;if(_0x353139[_0xeaef('0x31')]['includeAll']){_0x282bb8[_0xeaef('0x3a')]=[{'all':!![]}];}return db[_0xeaef('0x2a')]['findAll'](_0x282bb8);})[_0xeaef('0x23')](function(_0xda4f23){_0x119ae3[_0xeaef('0x3b')]=_0xda4f23;return _0x119ae3;})[_0xeaef('0x23')](respondWithFilteredResult(_0x31ad80,_0x282bb8))[_0xeaef('0x3c')](handleError(_0x31ad80,null));}; \ No newline at end of file +var _0xd9e9=['query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','rows','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','save','update','error','stack','name','send','map','Migration','fieldName','type','key','model'];(function(_0x40e91f,_0x363e6e){var _0x1ff001=function(_0x3ad0b4){while(--_0x3ad0b4){_0x40e91f['push'](_0x40e91f['shift']());}};_0x1ff001(++_0x363e6e);}(_0xd9e9,0x1a0));var _0x9d9e=function(_0x544e45,_0x10a5b3){_0x544e45=_0x544e45-0x0;var _0x43daa3=_0xd9e9[_0x544e45];return _0x43daa3;};'use strict';var emlformat=require(_0x9d9e('0x0'));var rimraf=require(_0x9d9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d9e('0x2'));var moment=require(_0x9d9e('0x3'));var BPromise=require(_0x9d9e('0x4'));var Mustache=require(_0x9d9e('0x5'));var util=require(_0x9d9e('0x6'));var path=require('path');var sox=require(_0x9d9e('0x7'));var csv=require(_0x9d9e('0x8'));var ejs=require(_0x9d9e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d9e('0xa'));var squel=require(_0x9d9e('0xb'));var crypto=require(_0x9d9e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9d9e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9d9e('0xe'));var Papa=require(_0x9d9e('0xf'));var Redis=require(_0x9d9e('0x10'));var authService=require(_0x9d9e('0x11'));var qs=require(_0x9d9e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d9e('0x13'));var logger=require('../../config/logger')(_0x9d9e('0x14'));var utils=require('../../config/utils');var config=require(_0x9d9e('0x15'));var licenseUtil=require(_0x9d9e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaef0fe,_0x16405a){_0x16405a=_0x16405a||0xcc;return function(_0x594ac4){if(_0x594ac4){return _0xaef0fe[_0x9d9e('0x17')](_0x16405a);}return _0xaef0fe['status'](_0x16405a)[_0x9d9e('0x18')]();};}function respondWithResult(_0x2c8b26,_0x3ead01){_0x3ead01=_0x3ead01||0xc8;return function(_0x3ecec6){if(_0x3ecec6){return _0x2c8b26['status'](_0x3ead01)[_0x9d9e('0x19')](_0x3ecec6);}};}function respondWithFilteredResult(_0x4ab24f,_0xc0ad7d){return function(_0x2b326f){if(_0x2b326f){var _0x248a2b=typeof _0xc0ad7d['offset']==='undefined'&&typeof _0xc0ad7d['limit']===_0x9d9e('0x1a');var _0x22d53f=_0x2b326f[_0x9d9e('0x1b')];var _0x2705f9=_0x248a2b?0x0:_0xc0ad7d[_0x9d9e('0x1c')];var _0x3ca4d4=_0x248a2b?_0x2b326f[_0x9d9e('0x1b')]:_0xc0ad7d['offset']+_0xc0ad7d[_0x9d9e('0x1d')];var _0x4d3fdb;if(_0x3ca4d4>=_0x22d53f){_0x3ca4d4=_0x22d53f;_0x4d3fdb=0xc8;}else{_0x4d3fdb=0xce;}_0x4ab24f[_0x9d9e('0x1e')](_0x4d3fdb);return _0x4ab24f[_0x9d9e('0x1f')](_0x9d9e('0x20'),_0x2705f9+'-'+_0x3ca4d4+'/'+_0x22d53f)[_0x9d9e('0x19')](_0x2b326f);}return null;};}function patchUpdates(_0x3788cc){return function(_0x54fdfc){try{jsonpatch[_0x9d9e('0x21')](_0x54fdfc,_0x3788cc,!![]);}catch(_0x2af27c){return BPromise['reject'](_0x2af27c);}return _0x54fdfc[_0x9d9e('0x22')]();};}function saveUpdates(_0x2634c9,_0x3c72e7){return function(_0x4e3a21){if(_0x4e3a21){return _0x4e3a21[_0x9d9e('0x23')](_0x2634c9)['then'](function(_0x416b3f){return _0x416b3f;});}return null;};}function removeEntity(_0x2fe695,_0x4347c1){return function(_0x118744){if(_0x118744){return _0x118744['destroy']()['then'](function(){_0x2fe695[_0x9d9e('0x1e')](0xcc)[_0x9d9e('0x18')]();});}};}function handleEntityNotFound(_0x5f4ddd,_0x3ee0d3){return function(_0xca42f1){if(!_0xca42f1){_0x5f4ddd[_0x9d9e('0x17')](0x194);}return _0xca42f1;};}function handleError(_0x464f29,_0x49f75f){_0x49f75f=_0x49f75f||0x1f4;return function(_0x2968d1){logger[_0x9d9e('0x24')](_0x2968d1[_0x9d9e('0x25')]);if(_0x2968d1[_0x9d9e('0x26')]){delete _0x2968d1[_0x9d9e('0x26')];}_0x464f29[_0x9d9e('0x1e')](_0x49f75f)[_0x9d9e('0x27')](_0x2968d1);};}exports['index']=function(_0x47a08b,_0x5e86e9){var _0x401306={},_0x1ea146={},_0x42b1a7={'count':0x0,'rows':[]};var _0x55b20c=_[_0x9d9e('0x28')](db[_0x9d9e('0x29')]['rawAttributes'],function(_0x48d5c1){return{'name':_0x48d5c1[_0x9d9e('0x2a')],'type':_0x48d5c1[_0x9d9e('0x2b')][_0x9d9e('0x2c')]};});_0x1ea146[_0x9d9e('0x2d')]=_['map'](_0x55b20c,_0x9d9e('0x26'));_0x1ea146[_0x9d9e('0x2e')]=_[_0x9d9e('0x2f')](_0x47a08b[_0x9d9e('0x2e')]);_0x1ea146['filters']=_[_0x9d9e('0x30')](_0x1ea146[_0x9d9e('0x2d')],_0x1ea146['query']);_0x401306[_0x9d9e('0x31')]=_[_0x9d9e('0x30')](_0x1ea146['model'],qs[_0x9d9e('0x32')](_0x47a08b[_0x9d9e('0x2e')]['fields']));_0x401306[_0x9d9e('0x31')]=_0x401306[_0x9d9e('0x31')]['length']?_0x401306['attributes']:_0x1ea146[_0x9d9e('0x2d')];if(!_0x47a08b[_0x9d9e('0x2e')][_0x9d9e('0x33')](_0x9d9e('0x34'))){_0x401306[_0x9d9e('0x1d')]=qs[_0x9d9e('0x1d')](_0x47a08b[_0x9d9e('0x2e')][_0x9d9e('0x1d')]);_0x401306['offset']=qs[_0x9d9e('0x1c')](_0x47a08b['query'][_0x9d9e('0x1c')]);}_0x401306[_0x9d9e('0x35')]=qs[_0x9d9e('0x36')](_0x47a08b[_0x9d9e('0x2e')][_0x9d9e('0x36')]);_0x401306[_0x9d9e('0x37')]=qs[_0x9d9e('0x38')](_[_0x9d9e('0x39')](_0x47a08b[_0x9d9e('0x2e')],_0x1ea146[_0x9d9e('0x38')]),_0x55b20c);if(_0x47a08b[_0x9d9e('0x2e')][_0x9d9e('0x3a')]){_0x401306[_0x9d9e('0x37')]=_[_0x9d9e('0x3b')](_0x401306[_0x9d9e('0x37')],{'$or':_['map'](_0x55b20c,function(_0x34b27f){if(_0x34b27f[_0x9d9e('0x2b')]!==_0x9d9e('0x3c')){var _0x3421c3={};_0x3421c3[_0x34b27f[_0x9d9e('0x26')]]={'$like':'%'+_0x47a08b[_0x9d9e('0x2e')]['filter']+'%'};return _0x3421c3;}})});}_0x401306=_[_0x9d9e('0x3b')]({},_0x401306,_0x47a08b[_0x9d9e('0x3d')]);var _0xee6b37={'where':_0x401306[_0x9d9e('0x37')]};return db[_0x9d9e('0x29')][_0x9d9e('0x1b')](_0xee6b37)[_0x9d9e('0x3e')](function(_0x3763a8){_0x42b1a7[_0x9d9e('0x1b')]=_0x3763a8;if(_0x47a08b[_0x9d9e('0x2e')][_0x9d9e('0x3f')]){_0x401306['include']=[{'all':!![]}];}return db[_0x9d9e('0x29')]['findAll'](_0x401306);})[_0x9d9e('0x3e')](function(_0x7b40ef){_0x42b1a7[_0x9d9e('0x40')]=_0x7b40ef;return _0x42b1a7;})[_0x9d9e('0x3e')](respondWithFilteredResult(_0x5e86e9,_0x401306))[_0x9d9e('0x41')](handleError(_0x5e86e9,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 481dea7..e2ad1de 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 _0x44c1=['bluebird','request-promise','path','rimraf','./migration.attributes','Migration','lodash','util','../../config/logger'];(function(_0xf1499b,_0x4e8f51){var _0x2c589c=function(_0x1039fa){while(--_0x1039fa){_0xf1499b['push'](_0xf1499b['shift']());}};_0x2c589c(++_0x4e8f51);}(_0x44c1,0x19b));var _0x144c=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x44c1[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x144c('0x0'));var util=require(_0x144c('0x1'));var logger=require(_0x144c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x144c('0x3'));var rp=require(_0x144c('0x4'));var fs=require('fs');var path=require(_0x144c('0x5'));var rimraf=require(_0x144c('0x6'));var config=require('../../config/environment');var attributes=require(_0x144c('0x7'));module['exports']=function(_0x36c88f,_0x239c01){return _0x36c88f['define'](_0x144c('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3f1=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','Migration','lodash','util'];(function(_0x57318d,_0x16bc7e){var _0x28c146=function(_0x40b0f9){while(--_0x40b0f9){_0x57318d['push'](_0x57318d['shift']());}};_0x28c146(++_0x16bc7e);}(_0xf3f1,0x169));var _0x1f3f=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xf3f1[_0x368587];return _0x42d33c;};'use strict';var _=require(_0x1f3f('0x0'));var util=require(_0x1f3f('0x1'));var logger=require(_0x1f3f('0x2'))(_0x1f3f('0x3'));var moment=require('moment');var BPromise=require(_0x1f3f('0x4'));var rp=require(_0x1f3f('0x5'));var fs=require('fs');var path=require(_0x1f3f('0x6'));var rimraf=require(_0x1f3f('0x7'));var config=require(_0x1f3f('0x8'));var attributes=require(_0x1f3f('0x9'));module['exports']=function(_0x517aa1,_0x28a2d8){return _0x517aa1['define'](_0x1f3f('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 7464d9f..f7508bb 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 _0xcc73=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xcc73[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var moment=require(_0x3cc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cc7('0x4'));var jayson=require(_0x3cc7('0x5'));var client=jayson[_0x3cc7('0x6')][_0x3cc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x127590,_0x5604df,_0x416c48){return new BPromise(function(_0x37c184,_0x3f2dd7){return client[_0x3cc7('0x8')](_0x127590,_0x416c48)['then'](function(_0x2ff7ba){logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));logger[_0x3cc7('0xc')](_0x3cc7('0xd'),_0x5604df,_0x3cc7('0xb'),JSON['stringify'](_0x2ff7ba));if(_0x2ff7ba['error']){if(_0x2ff7ba[_0x3cc7('0xe')]['code']===0x1f4){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x3f2dd7(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x37c184(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}else{logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));_0x37c184(_0x2ff7ba[_0x3cc7('0x10')][_0x3cc7('0xf')]);}})[_0x3cc7('0x11')](function(_0x386a31){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x386a31);_0x3f2dd7(_0x386a31);});});} \ No newline at end of file +var _0x7fce=['Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error'];(function(_0xe299ae,_0x494c4b){var _0x258685=function(_0x598a46){while(--_0x598a46){_0xe299ae['push'](_0xe299ae['shift']());}};_0x258685(++_0x494c4b);}(_0x7fce,0xdc));var _0xe7fc=function(_0x14b44c,_0x5056ca){_0x14b44c=_0x14b44c-0x0;var _0x1c205f=_0x7fce[_0x14b44c];return _0x1c205f;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4665f6,_0x161dca,_0x296b2e){return new BPromise(function(_0x19eeef,_0x22fabf){return client['request'](_0x4665f6,_0x296b2e)[_0xe7fc('0x8')](function(_0x4a1209){logger[_0xe7fc('0x9')]('Migration,\x20%s,\x20%s',_0x161dca,_0xe7fc('0xa'));logger[_0xe7fc('0xb')](_0xe7fc('0xc'),_0x161dca,_0xe7fc('0xa'),JSON['stringify'](_0x4a1209));if(_0x4a1209[_0xe7fc('0xd')]){if(_0x4a1209[_0xe7fc('0xd')]['code']===0x1f4){logger['error'](_0xe7fc('0xe'),_0x161dca,_0x4a1209['error'][_0xe7fc('0xf')]);return _0x22fabf(_0x4a1209['error']['message']);}logger[_0xe7fc('0xd')](_0xe7fc('0xe'),_0x161dca,_0x4a1209[_0xe7fc('0xd')][_0xe7fc('0xf')]);return _0x19eeef(_0x4a1209[_0xe7fc('0xd')]['message']);}else{logger[_0xe7fc('0x9')]('Migration,\x20%s,\x20%s',_0x161dca,'request\x20sent');_0x19eeef(_0x4a1209[_0xe7fc('0x10')][_0xe7fc('0xf')]);}})[_0xe7fc('0x11')](function(_0x3a44a6){logger['error']('Migration,\x20%s,\x20%s',_0x161dca,_0x3a44a6);_0x22fabf(_0x3a44a6);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 75a172b..8f8ce2e 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 _0x8ce1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x7303c,_0x2d7803){var _0x367cc7=function(_0x333990){while(--_0x333990){_0x7303c['push'](_0x7303c['shift']());}};_0x367cc7(++_0x2d7803);}(_0x8ce1,0x152));var _0x18ce=function(_0x29589d,_0x5ba6a6){_0x29589d=_0x29589d-0x0;var _0x5b06d2=_0x8ce1[_0x29589d];return _0x5b06d2;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth['isAuthenticated'](),controller[_0x18ce('0xb')]);router[_0x18ce('0xa')]('/:id',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router['post']('/',auth[_0x18ce('0xc')](),controller['create']);router[_0x18ce('0xe')](_0x18ce('0xf'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x10')]);router[_0x18ce('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x12')]);module['exports']=router; \ No newline at end of file +var _0x078a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x2db237,_0x2f4dfa){var _0xae6db8=function(_0x2cf86a){while(--_0x2cf86a){_0x2db237['push'](_0x2db237['shift']());}};_0xae6db8(++_0x2f4dfa);}(_0x078a,0x12d));var _0xa078=function(_0x141eff,_0x16776c){_0x141eff=_0x141eff-0x0;var _0x35841f=_0x078a[_0x141eff];return _0x35841f;};'use strict';var multer=require(_0xa078('0x0'));var util=require(_0xa078('0x1'));var path=require(_0xa078('0x2'));var timeout=require(_0xa078('0x3'));var express=require(_0xa078('0x4'));var router=express[_0xa078('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa078('0x6'));var interaction=require(_0xa078('0x7'));var config=require(_0xa078('0x8'));var controller=require('./network.controller');router[_0xa078('0x9')]('/',auth['isAuthenticated'](),controller[_0xa078('0xa')]);router[_0xa078('0x9')](_0xa078('0xb'),auth[_0xa078('0xc')](),controller[_0xa078('0xd')]);router[_0xa078('0xe')]('/',auth[_0xa078('0xc')](),controller[_0xa078('0xf')]);router['put'](_0xa078('0xb'),auth[_0xa078('0xc')](),controller[_0xa078('0x10')]);router[_0xa078('0x11')]('/:id',auth[_0xa078('0xc')](),controller[_0xa078('0x12')]);module[_0xa078('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 46baff7..32569f5 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 _0x6d92=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x202055,_0x344111){var _0x5d7e21=function(_0x1d3d5d){while(--_0x1d3d5d){_0x202055['push'](_0x202055['shift']());}};_0x5d7e21(++_0x344111);}(_0x6d92,0x6c));var _0x26d9=function(_0x475c37,_0x386f90){_0x475c37=_0x475c37-0x0;var _0x711fdc=_0x6d92[_0x475c37];return _0x711fdc;};'use strict';var Sequelize=require(_0x26d9('0x0'));module[_0x26d9('0x1')]={'type':{'type':Sequelize[_0x26d9('0x2')](_0x26d9('0x3'),_0x26d9('0x4'),_0x26d9('0x5'),_0x26d9('0x6'))},'value':{'type':Sequelize[_0x26d9('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x26d9('0x7')]}}; \ No newline at end of file +var _0x9b1d=['turn','STRING','sequelize','exports','ENUM','localnet','externip','stun'];(function(_0x49bd66,_0x114f96){var _0x7a7c08=function(_0x96a3d1){while(--_0x96a3d1){_0x49bd66['push'](_0x49bd66['shift']());}};_0x7a7c08(++_0x114f96);}(_0x9b1d,0x9a));var _0xd9b1=function(_0x12e020,_0x3e35cb){_0x12e020=_0x12e020-0x0;var _0x37d087=_0x9b1d[_0x12e020];return _0x37d087;};'use strict';var Sequelize=require(_0xd9b1('0x0'));module[_0xd9b1('0x1')]={'type':{'type':Sequelize[_0xd9b1('0x2')](_0xd9b1('0x3'),_0xd9b1('0x4'),_0xd9b1('0x5'),_0xd9b1('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd9b1('0x7')]},'password':{'type':Sequelize[_0xd9b1('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 97df008..c9c877c 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 _0xd6d2=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','Network,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','end','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','res_stun_monitor.so','TURN','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x535ca6,_0x30ed67){var _0x4e78a8=function(_0x4c83a3){while(--_0x4c83a3){_0x535ca6['push'](_0x535ca6['shift']());}};_0x4e78a8(++_0x30ed67);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x183843,_0x211b10){_0x183843=_0x183843-0x0;var _0x27f65e=_0xd6d2[_0x183843];return _0x27f65e;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];var jayson=require(_0x2d6d('0x1b'));var client=jayson[_0x2d6d('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2275,_0x156188,_0x46c909,_0x3528de){return new BPromise(function(_0x58bd29,_0x1ec6aa){var _0x40a6a9=_0x3528de||client;return _0x40a6a9['request'](_0x1a2275,_0x46c909)['then'](function(_0x370096){logger[_0x2d6d('0x1d')](_0x2d6d('0x1e'),_0x156188,'request\x20sent');logger[_0x2d6d('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0x156188,'request\x20sent',JSON['stringify'](_0x370096));if(_0x370096[_0x2d6d('0x20')]){if(_0x370096[_0x2d6d('0x20')][_0x2d6d('0x21')]===0x1f4){logger[_0x2d6d('0x20')](_0x2d6d('0x1e'),_0x156188,_0x370096[_0x2d6d('0x20')][_0x2d6d('0x22')]);return _0x1ec6aa(_0x370096[_0x2d6d('0x20')][_0x2d6d('0x22')]);}logger['error'](_0x2d6d('0x1e'),_0x156188,_0x370096[_0x2d6d('0x20')]['message']);return _0x58bd29(_0x370096[_0x2d6d('0x20')][_0x2d6d('0x22')]);}else{logger[_0x2d6d('0x1d')](_0x2d6d('0x1e'),_0x156188,_0x2d6d('0x23'));_0x58bd29(_0x370096[_0x2d6d('0x24')]['message']);}})[_0x2d6d('0x25')](function(_0xe6e992){logger[_0x2d6d('0x20')]('Network,\x20%s,\x20%s',_0x156188,_0xe6e992);_0x1ec6aa(_0xe6e992);});});}function respondWithStatusCode(_0x47eb0e,_0x3ae8ad){_0x3ae8ad=_0x3ae8ad||0xcc;return function(_0x4e7ec8){if(_0x4e7ec8){return _0x47eb0e['sendStatus'](_0x3ae8ad);}return _0x47eb0e['status'](_0x3ae8ad)[_0x2d6d('0x26')]();};}function respondWithResult(_0xaca9c7,_0x3da83d){_0x3da83d=_0x3da83d||0xc8;return function(_0x3f89dd){if(_0x3f89dd){return _0xaca9c7[_0x2d6d('0x27')](_0x3da83d)['json'](_0x3f89dd);}};}function respondWithFilteredResult(_0x16634d,_0x1b4964){return function(_0x455e71){if(_0x455e71){var _0x1a9aff=typeof _0x1b4964[_0x2d6d('0x28')]===_0x2d6d('0x29')&&typeof _0x1b4964[_0x2d6d('0x2a')]===_0x2d6d('0x29');var _0x27b7d2=_0x455e71['count'];var _0x1016e1=_0x1a9aff?0x0:_0x1b4964[_0x2d6d('0x28')];var _0x2e7b32=_0x1a9aff?_0x455e71[_0x2d6d('0x2b')]:_0x1b4964['offset']+_0x1b4964[_0x2d6d('0x2a')];var _0x49bb56;if(_0x2e7b32>=_0x27b7d2){_0x2e7b32=_0x27b7d2;_0x49bb56=0xc8;}else{_0x49bb56=0xce;}_0x16634d[_0x2d6d('0x27')](_0x49bb56);return _0x16634d['set']('Content-Range',_0x1016e1+'-'+_0x2e7b32+'/'+_0x27b7d2)[_0x2d6d('0x2c')](_0x455e71);}return null;};}function patchUpdates(_0x557ad8){return function(_0x2fe536){try{jsonpatch[_0x2d6d('0x2d')](_0x2fe536,_0x557ad8,!![]);}catch(_0x479320){return BPromise[_0x2d6d('0x2e')](_0x479320);}return _0x2fe536['save']();};}function saveUpdates(_0xfbf3dc,_0x422153){return function(_0xafd15a){if(_0xafd15a){return _0xafd15a[_0x2d6d('0x2f')](_0xfbf3dc)[_0x2d6d('0x30')](function(_0x29394e){return _0x29394e;});}return null;};}function removeEntity(_0x27ac32,_0x3450fc){return function(_0x598d8b){if(_0x598d8b){return _0x598d8b[_0x2d6d('0x31')]()[_0x2d6d('0x30')](function(){_0x27ac32['status'](0xcc)[_0x2d6d('0x26')]();});}};}function handleEntityNotFound(_0xf2b497,_0x1d363a){return function(_0x3aed80){if(!_0x3aed80){_0xf2b497[_0x2d6d('0x32')](0x194);}return _0x3aed80;};}function handleError(_0x4b2c0a,_0x4c8fc1){_0x4c8fc1=_0x4c8fc1||0x1f4;return function(_0x512615){logger[_0x2d6d('0x20')](_0x512615[_0x2d6d('0x33')]);if(_0x512615[_0x2d6d('0x34')]){delete _0x512615['name'];}_0x4b2c0a[_0x2d6d('0x27')](_0x4c8fc1)[_0x2d6d('0x35')](_0x512615);};}exports[_0x2d6d('0x36')]=function(_0x2eaf46,_0x4b416b){var _0x78354={},_0x2bdc1b={},_0x23cc39={'count':0x0,'rows':[]};var _0x15f9af=_[_0x2d6d('0x37')](db[_0x2d6d('0x38')][_0x2d6d('0x39')],function(_0x5b0674){return{'name':_0x5b0674[_0x2d6d('0x3a')],'type':_0x5b0674[_0x2d6d('0x3b')][_0x2d6d('0x3c')]};});_0x2bdc1b[_0x2d6d('0x3d')]=_[_0x2d6d('0x37')](_0x15f9af,'name');_0x2bdc1b[_0x2d6d('0x3e')]=_[_0x2d6d('0x3f')](_0x2eaf46[_0x2d6d('0x3e')]);_0x2bdc1b[_0x2d6d('0x40')]=_[_0x2d6d('0x41')](_0x2bdc1b[_0x2d6d('0x3d')],_0x2bdc1b[_0x2d6d('0x3e')]);_0x78354[_0x2d6d('0x42')]=_[_0x2d6d('0x41')](_0x2bdc1b[_0x2d6d('0x3d')],qs[_0x2d6d('0x43')](_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x43')]));_0x78354[_0x2d6d('0x42')]=_0x78354[_0x2d6d('0x42')][_0x2d6d('0x44')]?_0x78354[_0x2d6d('0x42')]:_0x2bdc1b['model'];if(!_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x45')](_0x2d6d('0x46'))){_0x78354[_0x2d6d('0x2a')]=qs[_0x2d6d('0x2a')](_0x2eaf46['query'][_0x2d6d('0x2a')]);_0x78354[_0x2d6d('0x28')]=qs[_0x2d6d('0x28')](_0x2eaf46[_0x2d6d('0x3e')]['offset']);}_0x78354[_0x2d6d('0x47')]=qs[_0x2d6d('0x48')](_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x48')]);_0x78354[_0x2d6d('0x49')]=qs['filters'](_[_0x2d6d('0x4a')](_0x2eaf46[_0x2d6d('0x3e')],_0x2bdc1b['filters']),_0x15f9af);if(_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x4b')]){_0x78354[_0x2d6d('0x49')]=_['merge'](_0x78354[_0x2d6d('0x49')],{'$or':_[_0x2d6d('0x37')](_0x15f9af,function(_0x552129){if(_0x552129['type']!=='VIRTUAL'){var _0x7d85d6={};_0x7d85d6[_0x552129[_0x2d6d('0x34')]]={'$like':'%'+_0x2eaf46['query'][_0x2d6d('0x4b')]+'%'};return _0x7d85d6;}})});}_0x78354=_[_0x2d6d('0x4c')]({},_0x78354,_0x2eaf46[_0x2d6d('0x4d')]);var _0x470fb5={'where':_0x78354['where']};return db[_0x2d6d('0x38')][_0x2d6d('0x2b')](_0x470fb5)['then'](function(_0x322f48){_0x23cc39[_0x2d6d('0x2b')]=_0x322f48;if(_0x2eaf46[_0x2d6d('0x3e')][_0x2d6d('0x4e')]){_0x78354[_0x2d6d('0x4f')]=[{'all':!![]}];}return db[_0x2d6d('0x38')][_0x2d6d('0x50')](_0x78354);})['then'](function(_0xe6b038){_0x23cc39[_0x2d6d('0x51')]=_0xe6b038;return _0x23cc39;})[_0x2d6d('0x30')](respondWithFilteredResult(_0x4b416b,_0x78354))['catch'](handleError(_0x4b416b,null));};exports['show']=function(_0xa7300,_0x3f600b){var _0x422198={'raw':!![],'where':{'id':_0xa7300[_0x2d6d('0x52')]['id']}},_0x4e5203={};_0x4e5203[_0x2d6d('0x3d')]=_['keys'](db[_0x2d6d('0x38')][_0x2d6d('0x39')]);_0x4e5203[_0x2d6d('0x3e')]=_[_0x2d6d('0x3f')](_0xa7300[_0x2d6d('0x3e')]);_0x4e5203[_0x2d6d('0x40')]=_[_0x2d6d('0x41')](_0x4e5203[_0x2d6d('0x3d')],_0x4e5203[_0x2d6d('0x3e')]);_0x422198[_0x2d6d('0x42')]=_['intersection'](_0x4e5203[_0x2d6d('0x3d')],qs[_0x2d6d('0x43')](_0xa7300[_0x2d6d('0x3e')]['fields']));_0x422198[_0x2d6d('0x42')]=_0x422198[_0x2d6d('0x42')][_0x2d6d('0x44')]?_0x422198[_0x2d6d('0x42')]:_0x4e5203[_0x2d6d('0x3d')];if(_0xa7300[_0x2d6d('0x3e')][_0x2d6d('0x4e')]){_0x422198['include']=[{'all':!![]}];}_0x422198=_[_0x2d6d('0x4c')]({},_0x422198,_0xa7300[_0x2d6d('0x4d')]);return db['Network'][_0x2d6d('0x53')](_0x422198)[_0x2d6d('0x30')](handleEntityNotFound(_0x3f600b,null))['then'](respondWithResult(_0x3f600b,null))[_0x2d6d('0x25')](handleError(_0x3f600b,null));};exports[_0x2d6d('0x54')]=function(_0x5102de,_0x8cf75,_0x1af749){var _0xe2c5d8;return db[_0x2d6d('0x55')][_0x2d6d('0x56')](function(_0x18cccb){return db[_0x2d6d('0x38')]['create'](_0x5102de['body'],{'raw':!![]})[_0x2d6d('0x30')](function(_0x5ac91b){_0xe2c5d8=_0x5ac91b;return db[_0x2d6d('0x38')][_0x2d6d('0x50')]({'where':{'type':_0x5102de[_0x2d6d('0x57')]['type']},'raw':!![]});})[_0x2d6d('0x30')](function(_0x49cd6f){if(_0xe2c5d8[_0x2d6d('0x3b')][_0x2d6d('0x58')]()==_0x2d6d('0x59')){var _0xe75206=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],_0x2d6d('0x5d')),'utf8');var _0x33d375=ejs[_0x2d6d('0x5e')](_0xe75206,{'networks':_0x49cd6f||[]});fs[_0x2d6d('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x33d375);return respondWithRpcPromise('Reload','create',{'module':_0x2d6d('0x60')});}else if(_0xe2c5d8['type'][_0x2d6d('0x58')]()==_0x2d6d('0x61')){var _0x1dacbf=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],'server/files/templates/turn_multiple.ejs'),_0x2d6d('0x62'));var _0x389d3a=ejs[_0x2d6d('0x5e')](_0x1dacbf,{'networks':_0x49cd6f||[]});fs[_0x2d6d('0x5f')](_0x2d6d('0x63'),_0x389d3a);return respondWithRpcPromise(_0x2d6d('0x64'),'create',{'module':_0x2d6d('0x60')});}else{var _0x3535af=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config['root'],_0x2d6d('0x65')),_0x2d6d('0x62'));var _0xb7ae2b=ejs['render'](_0x3535af,{'networks':_0x49cd6f||[]});fs[_0x2d6d('0x5f')](util[_0x2d6d('0x66')](_0x2d6d('0x67'),_0x5102de['body'][_0x2d6d('0x3b')]['toLowerCase']()),_0xb7ae2b);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x54'),{'module':_0x2d6d('0x68')});}return null;})[_0x2d6d('0x30')](function(){return _0xe2c5d8;});})[_0x2d6d('0x30')](respondWithResult(_0x8cf75,0xc9))[_0x2d6d('0x25')](handleError(_0x8cf75,null));};exports[_0x2d6d('0x2f')]=function(_0x1021f0,_0x4b046a,_0x3ef8b1){var _0x19926c;return db[_0x2d6d('0x55')][_0x2d6d('0x56')](function(_0x2145ea){return db['Network'][_0x2d6d('0x53')]({'where':{'id':_0x1021f0['params']['id']}})[_0x2d6d('0x30')](handleEntityNotFound(_0x4b046a,null))[_0x2d6d('0x30')](saveUpdates(_0x1021f0[_0x2d6d('0x57')],null))[_0x2d6d('0x30')](function(_0x200ef4){if(_0x200ef4){_0x19926c=_0x200ef4;return db[_0x2d6d('0x38')][_0x2d6d('0x50')]({'where':{'type':_0x19926c[_0x2d6d('0x3b')]},'raw':!![]});}return null;})['then'](function(_0x2a4f38){if(_0x19926c[_0x2d6d('0x3b')][_0x2d6d('0x58')]()==_0x2d6d('0x59')){var _0x18904a=fs['readFileSync'](path['join'](config['root'],_0x2d6d('0x5d')),_0x2d6d('0x62'));var _0x13f041=ejs[_0x2d6d('0x5e')](_0x18904a,{'networks':_0x2a4f38||[]});fs[_0x2d6d('0x5f')](_0x2d6d('0x69'),_0x13f041);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x2f'),{'module':_0x2d6d('0x60')});}else if(_0x19926c['type'][_0x2d6d('0x58')]()=='TURN'){var _0x5c071f=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],_0x2d6d('0x6a')),_0x2d6d('0x62'));var _0x4d0f9b=ejs[_0x2d6d('0x5e')](_0x5c071f,{'networks':_0x2a4f38||[]});fs[_0x2d6d('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x4d0f9b);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x2f'),{'module':_0x2d6d('0x60')});}else{var _0x1e5e40=fs[_0x2d6d('0x5a')](path['join'](config[_0x2d6d('0x5c')],_0x2d6d('0x65')),_0x2d6d('0x62'));var _0x609d97=ejs[_0x2d6d('0x5e')](_0x1e5e40,{'networks':_0x2a4f38||[]});fs[_0x2d6d('0x5f')](util[_0x2d6d('0x66')](_0x2d6d('0x67'),_0x1021f0['body'][_0x2d6d('0x3b')][_0x2d6d('0x6b')]()),_0x609d97);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x2d6d('0x30')](function(_0x4cc4c2){if(_0x4cc4c2){return _0x19926c;}return null;});})['then'](respondWithResult(_0x4b046a,null))['catch'](handleError(_0x4b046a,null));};exports['destroy']=function(_0x54b0e0,_0x3b07e5,_0x309a9c){var _0x32dd62;return db[_0x2d6d('0x38')][_0x2d6d('0x53')]({'where':{'id':_0x54b0e0[_0x2d6d('0x52')]['id']}})[_0x2d6d('0x30')](function(_0x5c4d32){_0x32dd62=_0x5c4d32;return _0x5c4d32;})[_0x2d6d('0x30')](handleEntityNotFound(_0x3b07e5,null))[_0x2d6d('0x30')](removeEntity(_0x3b07e5,null))['then'](function(){if(_0x32dd62){return db[_0x2d6d('0x38')][_0x2d6d('0x50')]({'where':{'type':_0x32dd62['type']},'raw':!![]});}})[_0x2d6d('0x30')](function(_0x3c2ccd){if(_0x32dd62[_0x2d6d('0x3b')]['toUpperCase']()==_0x2d6d('0x59')){var _0x45ad0a=fs[_0x2d6d('0x5a')](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],'server/files/templates/stun_multiple.ejs'),_0x2d6d('0x62'));var _0x5de755=ejs[_0x2d6d('0x5e')](_0x45ad0a,{'networks':_0x3c2ccd||[]});fs[_0x2d6d('0x5f')](_0x2d6d('0x69'),_0x5de755);return respondWithRpcPromise('Reload','destroy',{'module':_0x2d6d('0x60')});}else if(_0x32dd62[_0x2d6d('0x3b')]['toUpperCase']()==_0x2d6d('0x61')){var _0x1080a9=fs['readFileSync'](path[_0x2d6d('0x5b')](config[_0x2d6d('0x5c')],_0x2d6d('0x6a')),_0x2d6d('0x62'));var _0x314d98=ejs[_0x2d6d('0x5e')](_0x1080a9,{'networks':_0x3c2ccd||[]});fs['writeFileSync'](_0x2d6d('0x63'),_0x314d98);return respondWithRpcPromise(_0x2d6d('0x64'),_0x2d6d('0x31'),{'module':_0x2d6d('0x60')});}else{var _0x547272=fs[_0x2d6d('0x5a')](path['join'](config[_0x2d6d('0x5c')],'server/files/templates/network.ejs'),_0x2d6d('0x62'));var _0x264d57=ejs['render'](_0x547272,{'networks':_0x3c2ccd||[]});fs[_0x2d6d('0x5f')](util['format'](_0x2d6d('0x67'),_0x54b0e0['body']['type'][_0x2d6d('0x6b')]()),_0x264d57);return respondWithRpcPromise(_0x2d6d('0x64'),'destroy',{'module':_0x2d6d('0x68')});}return null;})[_0x2d6d('0x25')](handleError(_0x3b07e5,null));}; \ No newline at end of file +var _0x1d1a=['rimraf','zip-dir','fast-json-patch','moment','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','Network','includeAll','include','findAll','rows','show','params','keys','find','create','transaction','body','toUpperCase','STUN','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','join','server/files/templates/network.ejs','format','chan_sip.so','update','sequelize','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','destroy','eml-format'];(function(_0x23d2f1,_0x265017){var _0x4aa0a6=function(_0x1499bc){while(--_0x1499bc){_0x23d2f1['push'](_0x23d2f1['shift']());}};_0x4aa0a6(++_0x265017);}(_0x1d1a,0x1da));var _0xa1d1=function(_0x110b70,_0x41e5a2){_0x110b70=_0x110b70-0x0;var _0x46297d=_0x1d1a[_0x110b70];return _0x46297d;};'use strict';var emlformat=require(_0xa1d1('0x0'));var rimraf=require(_0xa1d1('0x1'));var zipdir=require(_0xa1d1('0x2'));var jsonpatch=require(_0xa1d1('0x3'));var rp=require('request-promise');var moment=require(_0xa1d1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa1d1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa1d1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1d1('0x7'));var _=require(_0xa1d1('0x8'));var squel=require(_0xa1d1('0x9'));var crypto=require('crypto');var jsforce=require(_0xa1d1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa1d1('0x6'));var querystring=require(_0xa1d1('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa1d1('0xc'));var as=require(_0xa1d1('0xd'));var hardwareService=require(_0xa1d1('0xe'));var logger=require(_0xa1d1('0xf'))('api');var utils=require(_0xa1d1('0x10'));var config=require(_0xa1d1('0x11'));var licenseUtil=require(_0xa1d1('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa1d1('0x13'));var client=jayson[_0xa1d1('0x14')][_0xa1d1('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x55d7f2,_0x5c5aa8,_0xd5ba9,_0x5e1ee4){return new BPromise(function(_0x9d333f,_0x1ca2bf){var _0x4548d2=_0x5e1ee4||client;return _0x4548d2[_0xa1d1('0x16')](_0x55d7f2,_0xd5ba9)[_0xa1d1('0x17')](function(_0x252bdd){logger['info'](_0xa1d1('0x18'),_0x5c5aa8,'request\x20sent');logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x5c5aa8,_0xa1d1('0x19'),JSON[_0xa1d1('0x1a')](_0x252bdd));if(_0x252bdd[_0xa1d1('0x1b')]){if(_0x252bdd['error']['code']===0x1f4){logger[_0xa1d1('0x1b')](_0xa1d1('0x18'),_0x5c5aa8,_0x252bdd[_0xa1d1('0x1b')][_0xa1d1('0x1c')]);return _0x1ca2bf(_0x252bdd[_0xa1d1('0x1b')]['message']);}logger[_0xa1d1('0x1b')]('Network,\x20%s,\x20%s',_0x5c5aa8,_0x252bdd[_0xa1d1('0x1b')]['message']);return _0x9d333f(_0x252bdd[_0xa1d1('0x1b')][_0xa1d1('0x1c')]);}else{logger['info'](_0xa1d1('0x18'),_0x5c5aa8,_0xa1d1('0x19'));_0x9d333f(_0x252bdd['result'][_0xa1d1('0x1c')]);}})[_0xa1d1('0x1d')](function(_0x340874){logger[_0xa1d1('0x1b')](_0xa1d1('0x18'),_0x5c5aa8,_0x340874);_0x1ca2bf(_0x340874);});});}function respondWithStatusCode(_0x330dda,_0x1553bb){_0x1553bb=_0x1553bb||0xcc;return function(_0x2607f3){if(_0x2607f3){return _0x330dda['sendStatus'](_0x1553bb);}return _0x330dda[_0xa1d1('0x1e')](_0x1553bb)[_0xa1d1('0x1f')]();};}function respondWithResult(_0xe9dff1,_0x331ef5){_0x331ef5=_0x331ef5||0xc8;return function(_0x394005){if(_0x394005){return _0xe9dff1['status'](_0x331ef5)[_0xa1d1('0x20')](_0x394005);}};}function respondWithFilteredResult(_0x5296da,_0x2d0fad){return function(_0x307188){if(_0x307188){var _0x120aa6=typeof _0x2d0fad[_0xa1d1('0x21')]===_0xa1d1('0x22')&&typeof _0x2d0fad[_0xa1d1('0x23')]==='undefined';var _0xe9af53=_0x307188[_0xa1d1('0x24')];var _0x1a89fe=_0x120aa6?0x0:_0x2d0fad[_0xa1d1('0x21')];var _0x629cb7=_0x120aa6?_0x307188[_0xa1d1('0x24')]:_0x2d0fad[_0xa1d1('0x21')]+_0x2d0fad[_0xa1d1('0x23')];var _0x33efe0;if(_0x629cb7>=_0xe9af53){_0x629cb7=_0xe9af53;_0x33efe0=0xc8;}else{_0x33efe0=0xce;}_0x5296da[_0xa1d1('0x1e')](_0x33efe0);return _0x5296da[_0xa1d1('0x25')](_0xa1d1('0x26'),_0x1a89fe+'-'+_0x629cb7+'/'+_0xe9af53)[_0xa1d1('0x20')](_0x307188);}return null;};}function patchUpdates(_0x16c386){return function(_0x286103){try{jsonpatch['apply'](_0x286103,_0x16c386,!![]);}catch(_0x3244c2){return BPromise[_0xa1d1('0x27')](_0x3244c2);}return _0x286103[_0xa1d1('0x28')]();};}function saveUpdates(_0x1055c6,_0x74903e){return function(_0x3bdba6){if(_0x3bdba6){return _0x3bdba6['update'](_0x1055c6)[_0xa1d1('0x17')](function(_0x3bcf35){return _0x3bcf35;});}return null;};}function removeEntity(_0x11e02b,_0x3ec4bc){return function(_0x5d775c){if(_0x5d775c){return _0x5d775c['destroy']()[_0xa1d1('0x17')](function(){_0x11e02b['status'](0xcc)[_0xa1d1('0x1f')]();});}};}function handleEntityNotFound(_0x2a4108,_0x2ada48){return function(_0x5b9465){if(!_0x5b9465){_0x2a4108['sendStatus'](0x194);}return _0x5b9465;};}function handleError(_0x29b6c5,_0x127e37){_0x127e37=_0x127e37||0x1f4;return function(_0x2e7087){logger[_0xa1d1('0x1b')](_0x2e7087[_0xa1d1('0x29')]);if(_0x2e7087[_0xa1d1('0x2a')]){delete _0x2e7087[_0xa1d1('0x2a')];}_0x29b6c5[_0xa1d1('0x1e')](_0x127e37)['send'](_0x2e7087);};}exports[_0xa1d1('0x2b')]=function(_0x5347c8,_0x23d2f4){var _0x7ada9c={},_0x491ccc={},_0x20f4f5={'count':0x0,'rows':[]};var _0x9e49c8=_[_0xa1d1('0x2c')](db['Network'][_0xa1d1('0x2d')],function(_0x2fabbf){return{'name':_0x2fabbf['fieldName'],'type':_0x2fabbf[_0xa1d1('0x2e')][_0xa1d1('0x2f')]};});_0x491ccc[_0xa1d1('0x30')]=_['map'](_0x9e49c8,_0xa1d1('0x2a'));_0x491ccc['query']=_['keys'](_0x5347c8[_0xa1d1('0x31')]);_0x491ccc[_0xa1d1('0x32')]=_[_0xa1d1('0x33')](_0x491ccc[_0xa1d1('0x30')],_0x491ccc['query']);_0x7ada9c[_0xa1d1('0x34')]=_['intersection'](_0x491ccc[_0xa1d1('0x30')],qs[_0xa1d1('0x35')](_0x5347c8[_0xa1d1('0x31')][_0xa1d1('0x35')]));_0x7ada9c['attributes']=_0x7ada9c['attributes'][_0xa1d1('0x36')]?_0x7ada9c['attributes']:_0x491ccc['model'];if(!_0x5347c8['query'][_0xa1d1('0x37')]('nolimit')){_0x7ada9c[_0xa1d1('0x23')]=qs[_0xa1d1('0x23')](_0x5347c8[_0xa1d1('0x31')][_0xa1d1('0x23')]);_0x7ada9c[_0xa1d1('0x21')]=qs[_0xa1d1('0x21')](_0x5347c8[_0xa1d1('0x31')][_0xa1d1('0x21')]);}_0x7ada9c[_0xa1d1('0x38')]=qs['sort'](_0x5347c8['query'][_0xa1d1('0x39')]);_0x7ada9c[_0xa1d1('0x3a')]=qs[_0xa1d1('0x32')](_['pick'](_0x5347c8[_0xa1d1('0x31')],_0x491ccc[_0xa1d1('0x32')]),_0x9e49c8);if(_0x5347c8[_0xa1d1('0x31')][_0xa1d1('0x3b')]){_0x7ada9c[_0xa1d1('0x3a')]=_['merge'](_0x7ada9c['where'],{'$or':_[_0xa1d1('0x2c')](_0x9e49c8,function(_0xa03ebd){if(_0xa03ebd[_0xa1d1('0x2e')]!=='VIRTUAL'){var _0x2c8f18={};_0x2c8f18[_0xa03ebd['name']]={'$like':'%'+_0x5347c8[_0xa1d1('0x31')][_0xa1d1('0x3b')]+'%'};return _0x2c8f18;}})});}_0x7ada9c=_['merge']({},_0x7ada9c,_0x5347c8['options']);var _0x2cab09={'where':_0x7ada9c[_0xa1d1('0x3a')]};return db[_0xa1d1('0x3c')][_0xa1d1('0x24')](_0x2cab09)[_0xa1d1('0x17')](function(_0x5dee14){_0x20f4f5[_0xa1d1('0x24')]=_0x5dee14;if(_0x5347c8[_0xa1d1('0x31')][_0xa1d1('0x3d')]){_0x7ada9c[_0xa1d1('0x3e')]=[{'all':!![]}];}return db[_0xa1d1('0x3c')][_0xa1d1('0x3f')](_0x7ada9c);})['then'](function(_0x2f0140){_0x20f4f5[_0xa1d1('0x40')]=_0x2f0140;return _0x20f4f5;})[_0xa1d1('0x17')](respondWithFilteredResult(_0x23d2f4,_0x7ada9c))[_0xa1d1('0x1d')](handleError(_0x23d2f4,null));};exports[_0xa1d1('0x41')]=function(_0x17201d,_0xf845ee){var _0x1c637c={'raw':!![],'where':{'id':_0x17201d[_0xa1d1('0x42')]['id']}},_0x237bc4={};_0x237bc4['model']=_[_0xa1d1('0x43')](db[_0xa1d1('0x3c')][_0xa1d1('0x2d')]);_0x237bc4[_0xa1d1('0x31')]=_['keys'](_0x17201d[_0xa1d1('0x31')]);_0x237bc4[_0xa1d1('0x32')]=_['intersection'](_0x237bc4[_0xa1d1('0x30')],_0x237bc4[_0xa1d1('0x31')]);_0x1c637c['attributes']=_[_0xa1d1('0x33')](_0x237bc4[_0xa1d1('0x30')],qs[_0xa1d1('0x35')](_0x17201d[_0xa1d1('0x31')][_0xa1d1('0x35')]));_0x1c637c[_0xa1d1('0x34')]=_0x1c637c[_0xa1d1('0x34')][_0xa1d1('0x36')]?_0x1c637c[_0xa1d1('0x34')]:_0x237bc4[_0xa1d1('0x30')];if(_0x17201d[_0xa1d1('0x31')][_0xa1d1('0x3d')]){_0x1c637c['include']=[{'all':!![]}];}_0x1c637c=_['merge']({},_0x1c637c,_0x17201d['options']);return db['Network'][_0xa1d1('0x44')](_0x1c637c)['then'](handleEntityNotFound(_0xf845ee,null))[_0xa1d1('0x17')](respondWithResult(_0xf845ee,null))['catch'](handleError(_0xf845ee,null));};exports[_0xa1d1('0x45')]=function(_0x475bf8,_0x5c1c23,_0x5dcb6b){var _0x1f05c7;return db['sequelize'][_0xa1d1('0x46')](function(_0x290918){return db[_0xa1d1('0x3c')][_0xa1d1('0x45')](_0x475bf8[_0xa1d1('0x47')],{'raw':!![]})[_0xa1d1('0x17')](function(_0x495fd8){_0x1f05c7=_0x495fd8;return db[_0xa1d1('0x3c')][_0xa1d1('0x3f')]({'where':{'type':_0x475bf8['body'][_0xa1d1('0x2e')]},'raw':!![]});})[_0xa1d1('0x17')](function(_0x495426){if(_0x1f05c7['type'][_0xa1d1('0x48')]()==_0xa1d1('0x49')){var _0xd74d99=fs['readFileSync'](path['join'](config[_0xa1d1('0x4a')],'server/files/templates/stun_multiple.ejs'),_0xa1d1('0x4b'));var _0x56d77=ejs[_0xa1d1('0x4c')](_0xd74d99,{'networks':_0x495426||[]});fs[_0xa1d1('0x4d')](_0xa1d1('0x4e'),_0x56d77);return respondWithRpcPromise(_0xa1d1('0x4f'),_0xa1d1('0x45'),{'module':'res_stun_monitor.so'});}else if(_0x1f05c7[_0xa1d1('0x2e')]['toUpperCase']()==_0xa1d1('0x50')){var _0x599cf7=fs[_0xa1d1('0x51')](path['join'](config[_0xa1d1('0x4a')],'server/files/templates/turn_multiple.ejs'),_0xa1d1('0x4b'));var _0x45799a=ejs[_0xa1d1('0x4c')](_0x599cf7,{'networks':_0x495426||[]});fs[_0xa1d1('0x4d')](_0xa1d1('0x52'),_0x45799a);return respondWithRpcPromise(_0xa1d1('0x4f'),'create',{'module':_0xa1d1('0x53')});}else{var _0x436577=fs[_0xa1d1('0x51')](path[_0xa1d1('0x54')](config[_0xa1d1('0x4a')],_0xa1d1('0x55')),_0xa1d1('0x4b'));var _0x2b17b1=ejs[_0xa1d1('0x4c')](_0x436577,{'networks':_0x495426||[]});fs[_0xa1d1('0x4d')](util[_0xa1d1('0x56')]('/etc/asterisk/sip_xcally_%s.conf',_0x475bf8[_0xa1d1('0x47')][_0xa1d1('0x2e')]['toLowerCase']()),_0x2b17b1);return respondWithRpcPromise('Reload',_0xa1d1('0x45'),{'module':_0xa1d1('0x57')});}return null;})[_0xa1d1('0x17')](function(){return _0x1f05c7;});})[_0xa1d1('0x17')](respondWithResult(_0x5c1c23,0xc9))[_0xa1d1('0x1d')](handleError(_0x5c1c23,null));};exports[_0xa1d1('0x58')]=function(_0x291caa,_0x1a905c,_0x5f54f1){var _0x2fab26;return db[_0xa1d1('0x59')][_0xa1d1('0x46')](function(_0x7a6a7d){return db[_0xa1d1('0x3c')][_0xa1d1('0x44')]({'where':{'id':_0x291caa[_0xa1d1('0x42')]['id']}})[_0xa1d1('0x17')](handleEntityNotFound(_0x1a905c,null))[_0xa1d1('0x17')](saveUpdates(_0x291caa[_0xa1d1('0x47')],null))[_0xa1d1('0x17')](function(_0x1d527d){if(_0x1d527d){_0x2fab26=_0x1d527d;return db[_0xa1d1('0x3c')][_0xa1d1('0x3f')]({'where':{'type':_0x2fab26[_0xa1d1('0x2e')]},'raw':!![]});}return null;})[_0xa1d1('0x17')](function(_0x3deeff){if(_0x2fab26[_0xa1d1('0x2e')][_0xa1d1('0x48')]()==_0xa1d1('0x49')){var _0x185df9=fs[_0xa1d1('0x51')](path[_0xa1d1('0x54')](config[_0xa1d1('0x4a')],_0xa1d1('0x5a')),_0xa1d1('0x4b'));var _0x4b507d=ejs[_0xa1d1('0x4c')](_0x185df9,{'networks':_0x3deeff||[]});fs[_0xa1d1('0x4d')](_0xa1d1('0x4e'),_0x4b507d);return respondWithRpcPromise(_0xa1d1('0x4f'),_0xa1d1('0x58'),{'module':_0xa1d1('0x53')});}else if(_0x2fab26['type']['toUpperCase']()=='TURN'){var _0x22f455=fs[_0xa1d1('0x51')](path[_0xa1d1('0x54')](config[_0xa1d1('0x4a')],_0xa1d1('0x5b')),_0xa1d1('0x4b'));var _0x335843=ejs[_0xa1d1('0x4c')](_0x22f455,{'networks':_0x3deeff||[]});fs[_0xa1d1('0x4d')](_0xa1d1('0x52'),_0x335843);return respondWithRpcPromise(_0xa1d1('0x4f'),'update',{'module':_0xa1d1('0x53')});}else{var _0x41c6dc=fs['readFileSync'](path[_0xa1d1('0x54')](config[_0xa1d1('0x4a')],'server/files/templates/network.ejs'),_0xa1d1('0x4b'));var _0x5eac24=ejs[_0xa1d1('0x4c')](_0x41c6dc,{'networks':_0x3deeff||[]});fs[_0xa1d1('0x4d')](util[_0xa1d1('0x56')](_0xa1d1('0x5c'),_0x291caa[_0xa1d1('0x47')]['type'][_0xa1d1('0x5d')]()),_0x5eac24);return respondWithRpcPromise(_0xa1d1('0x4f'),_0xa1d1('0x58'),{'module':_0xa1d1('0x57')});}return null;})[_0xa1d1('0x17')](function(_0x44278a){if(_0x44278a){return _0x2fab26;}return null;});})[_0xa1d1('0x17')](respondWithResult(_0x1a905c,null))[_0xa1d1('0x1d')](handleError(_0x1a905c,null));};exports[_0xa1d1('0x5e')]=function(_0x103650,_0x343f5a,_0x9f74f){var _0x3e22b7;return db['Network']['find']({'where':{'id':_0x103650[_0xa1d1('0x42')]['id']}})[_0xa1d1('0x17')](function(_0x4d76ae){_0x3e22b7=_0x4d76ae;return _0x4d76ae;})['then'](handleEntityNotFound(_0x343f5a,null))[_0xa1d1('0x17')](removeEntity(_0x343f5a,null))[_0xa1d1('0x17')](function(){if(_0x3e22b7){return db['Network']['findAll']({'where':{'type':_0x3e22b7['type']},'raw':!![]});}})[_0xa1d1('0x17')](function(_0x3ff0a8){if(_0x3e22b7['type'][_0xa1d1('0x48')]()==_0xa1d1('0x49')){var _0x22cc7a=fs['readFileSync'](path['join'](config[_0xa1d1('0x4a')],'server/files/templates/stun_multiple.ejs'),_0xa1d1('0x4b'));var _0xc92087=ejs[_0xa1d1('0x4c')](_0x22cc7a,{'networks':_0x3ff0a8||[]});fs[_0xa1d1('0x4d')](_0xa1d1('0x4e'),_0xc92087);return respondWithRpcPromise(_0xa1d1('0x4f'),_0xa1d1('0x5e'),{'module':_0xa1d1('0x53')});}else if(_0x3e22b7['type']['toUpperCase']()=='TURN'){var _0xcf3092=fs[_0xa1d1('0x51')](path[_0xa1d1('0x54')](config[_0xa1d1('0x4a')],'server/files/templates/turn_multiple.ejs'),_0xa1d1('0x4b'));var _0x2aecf3=ejs[_0xa1d1('0x4c')](_0xcf3092,{'networks':_0x3ff0a8||[]});fs['writeFileSync'](_0xa1d1('0x52'),_0x2aecf3);return respondWithRpcPromise(_0xa1d1('0x4f'),_0xa1d1('0x5e'),{'module':'res_stun_monitor.so'});}else{var _0x4fb913=fs[_0xa1d1('0x51')](path[_0xa1d1('0x54')](config[_0xa1d1('0x4a')],_0xa1d1('0x55')),_0xa1d1('0x4b'));var _0xc1791b=ejs['render'](_0x4fb913,{'networks':_0x3ff0a8||[]});fs['writeFileSync'](util['format'](_0xa1d1('0x5c'),_0x103650[_0xa1d1('0x47')]['type'][_0xa1d1('0x5d')]()),_0xc1791b);return respondWithRpcPromise(_0xa1d1('0x4f'),_0xa1d1('0x5e'),{'module':'chan_sip.so'});}return null;})[_0xa1d1('0x1d')](handleError(_0x343f5a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4cea5d6..01c2ffc 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 _0x593e=['path','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36d1b6,_0x1903ba){var _0x33cbe4=function(_0x54e788){while(--_0x54e788){_0x36d1b6['push'](_0x36d1b6['shift']());}};_0x33cbe4(++_0x1903ba);}(_0x593e,0xcb));var _0xe593=function(_0x457bb0,_0x3dbd58){_0x457bb0=_0x457bb0-0x0;var _0x11e64c=_0x593e[_0x457bb0];return _0x11e64c;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var rp=require(_0xe593('0x6'));var fs=require('fs');var path=require(_0xe593('0x7'));var rimraf=require('rimraf');var config=require(_0xe593('0x8'));var attributes=require(_0xe593('0x9'));module[_0xe593('0xa')]=function(_0x1e50d3,_0x3b7082){return _0x1e50d3[_0xe593('0xb')](_0xe593('0xc'),attributes,{'tableName':_0xe593('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0db9=['network','lodash','moment','bluebird','path','../../config/environment','./network.attributes','define','Network'];(function(_0x578801,_0x20ed8b){var _0x55eaf7=function(_0x3f2df2){while(--_0x3f2df2){_0x578801['push'](_0x578801['shift']());}};_0x55eaf7(++_0x20ed8b);}(_0x0db9,0xa3));var _0x90db=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x0db9[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x90db('0x1'));var BPromise=require(_0x90db('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90db('0x3'));var rimraf=require('rimraf');var config=require(_0x90db('0x4'));var attributes=require(_0x90db('0x5'));module['exports']=function(_0x2d02a1,_0x242774){return _0x2d02a1[_0x90db('0x6')](_0x90db('0x7'),attributes,{'tableName':_0x90db('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 8d75119..bd3e99d 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x118b1a,_0x12693c){var _0x2ba1d3=function(_0x48b1ae){while(--_0x48b1ae){_0x118b1a['push'](_0x118b1a['shift']());}};_0x2ba1d3(++_0x12693c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5c5198,_0x443deb){_0x5c5198=_0x5c5198-0x0;var _0x38a349=_0x7a54[_0x5c5198];return _0x38a349;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4769a0f..d1674dd 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 _0xfe0f=['/:id/canned_answers','addAnswer','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','show','/:id/dispositions','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','create','addDisposition'];(function(_0xc73724,_0x163a90){var _0x3960fa=function(_0x928fd){while(--_0x928fd){_0xc73724['push'](_0xc73724['shift']());}};_0x3960fa(++_0x163a90);}(_0xfe0f,0x11e));var _0xffe0=function(_0x2054f2,_0x39dd16){_0x2054f2=_0x2054f2-0x0;var _0x2a1701=_0xfe0f[_0x2054f2];return _0x2a1701;};'use strict';var multer=require(_0xffe0('0x0'));var util=require(_0xffe0('0x1'));var path=require(_0xffe0('0x2'));var timeout=require(_0xffe0('0x3'));var express=require(_0xffe0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xffe0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffe0('0x6'));var controller=require('./openchannelAccount.controller');router[_0xffe0('0x7')]('/',auth[_0xffe0('0x8')](),controller['index']);router[_0xffe0('0x7')](_0xffe0('0x9'),auth[_0xffe0('0x8')](),controller['describe']);router['get']('/:id',auth[_0xffe0('0x8')](),controller[_0xffe0('0xa')]);router[_0xffe0('0x7')](_0xffe0('0xb'),auth[_0xffe0('0x8')](),controller['getDispositions']);router[_0xffe0('0x7')]('/:id/canned_answers',auth[_0xffe0('0x8')](),controller[_0xffe0('0xc')]);router[_0xffe0('0x7')](_0xffe0('0xd'),auth['isAuthenticated'](),controller[_0xffe0('0xe')]);router[_0xffe0('0x7')]('/:id/interactions',auth[_0xffe0('0x8')](),controller[_0xffe0('0xf')]);router[_0xffe0('0x7')]('/:id/users',auth[_0xffe0('0x8')](),controller[_0xffe0('0x10')]);router[_0xffe0('0x11')]('/',auth[_0xffe0('0x8')](),controller[_0xffe0('0x12')]);router['post']('/:id/dispositions',auth[_0xffe0('0x8')](),controller[_0xffe0('0x13')]);router[_0xffe0('0x11')](_0xffe0('0x14'),auth['isAuthenticated'](),controller[_0xffe0('0x15')]);router[_0xffe0('0x11')]('/:id/notify',controller['notify']);router[_0xffe0('0x11')](_0xffe0('0xd'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xffe0('0x17')]);router['post'](_0xffe0('0x18'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x19')]);router[_0xffe0('0x1a')](_0xffe0('0x1b'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x1c')]);router[_0xffe0('0x1d')]('/:id',auth[_0xffe0('0x8')](),controller['destroy']);router[_0xffe0('0x1d')](_0xffe0('0xb'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x1e')]);router[_0xffe0('0x1d')](_0xffe0('0x14'),auth['isAuthenticated'](),controller[_0xffe0('0x1f')]);router[_0xffe0('0x1d')](_0xffe0('0x20'),auth[_0xffe0('0x8')](),controller[_0xffe0('0x21')]);module['exports']=router; \ No newline at end of file +var _0x616e=['addAnswer','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x616e,0x1ae));var _0xe616=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x616e[_0x4bcf38];return _0x4a89be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe616('0x0'));var timeout=require(_0xe616('0x1'));var express=require('express');var router=express[_0xe616('0x2')]();var fs_extra=require(_0xe616('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe616('0x4'));var config=require(_0xe616('0x5'));var controller=require(_0xe616('0x6'));router[_0xe616('0x7')]('/',auth[_0xe616('0x8')](),controller[_0xe616('0x9')]);router[_0xe616('0x7')](_0xe616('0xa'),auth['isAuthenticated'](),controller[_0xe616('0xb')]);router[_0xe616('0x7')](_0xe616('0xc'),auth[_0xe616('0x8')](),controller[_0xe616('0xd')]);router[_0xe616('0x7')](_0xe616('0xe'),auth['isAuthenticated'](),controller[_0xe616('0xf')]);router[_0xe616('0x7')](_0xe616('0x10'),auth['isAuthenticated'](),controller[_0xe616('0x11')]);router[_0xe616('0x7')](_0xe616('0x12'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0xe616('0x13'),auth['isAuthenticated'](),controller[_0xe616('0x14')]);router[_0xe616('0x7')](_0xe616('0x15'),auth[_0xe616('0x8')](),controller[_0xe616('0x16')]);router[_0xe616('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe616('0x17')](_0xe616('0xe'),auth[_0xe616('0x8')](),controller[_0xe616('0x18')]);router[_0xe616('0x17')]('/:id/canned_answers',auth[_0xe616('0x8')](),controller[_0xe616('0x19')]);router[_0xe616('0x17')]('/:id/notify',controller['notify']);router[_0xe616('0x17')](_0xe616('0x12'),auth[_0xe616('0x8')](),controller['addApplications']);router[_0xe616('0x17')]('/:id/users',auth[_0xe616('0x8')](),controller[_0xe616('0x1a')]);router[_0xe616('0x17')](_0xe616('0x1b'),auth[_0xe616('0x8')](),controller[_0xe616('0x1c')]);router[_0xe616('0x1d')](_0xe616('0xc'),auth['isAuthenticated'](),controller[_0xe616('0x1e')]);router[_0xe616('0x1f')](_0xe616('0xc'),auth[_0xe616('0x8')](),controller[_0xe616('0x20')]);router[_0xe616('0x1f')](_0xe616('0xe'),auth[_0xe616('0x8')](),controller[_0xe616('0x21')]);router[_0xe616('0x1f')](_0xe616('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xe616('0x1f')](_0xe616('0x15'),auth['isAuthenticated'](),controller[_0xe616('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index f0630a0..a67046d 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 _0xe296=['sequelize','randomstring','exports','name','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe296,0xd2));var _0x6e29=function(_0xa4486b,_0x573f1e){_0xa4486b=_0xa4486b-0x0;var _0x5dabeb=_0xe296[_0xa4486b];return _0x5dabeb;};'use strict';var Sequelize=require(_0x6e29('0x0'));var rs=require(_0x6e29('0x1'));module[_0x6e29('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x6e29('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x6e29('0x4')],'defaultValue':function(){return rs[_0x6e29('0x5')]();}},'replyUri':{'type':Sequelize[_0x6e29('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6e29('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6e29('0x6');}},'notificationSound':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x6e29('0x4')]},'queueTransfer':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e29('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e29('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x6e29('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x6e29('0x7')],'defaultValue':![],'comment':_0x6e29('0xa'),'set':function(_0x34d0f8){if(!_0x34d0f8)this['setDataValue'](_0x6e29('0xb'),null);this[_0x6e29('0xc')](_0x6e29('0xd'),_0x34d0f8);}}}; \ No newline at end of file +var _0xfa9b=['generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x14dee7,_0x3df77f){var _0xa683e2=function(_0x6c0bd1){while(--_0x6c0bd1){_0x14dee7['push'](_0x14dee7['shift']());}};_0xa683e2(++_0x3df77f);}(_0xfa9b,0x1dc));var _0xbfa9=function(_0x195451,_0x4ffff4){_0x195451=_0x195451-0x0;var _0x4ad12e=_0xfa9b[_0x195451];return _0x4ad12e;};'use strict';var Sequelize=require(_0xbfa9('0x0'));var rs=require(_0xbfa9('0x1'));module[_0xbfa9('0x2')]={'name':{'type':Sequelize[_0xbfa9('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbfa9('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbfa9('0x4')]();}},'replyUri':{'type':Sequelize[_0xbfa9('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xbfa9('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbfa9('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xbfa9('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xbfa9('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfa9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbfa9('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbfa9('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbfa9('0x9'),'set':function(_0x24815c){if(!_0x24815c)this[_0xbfa9('0xa')]('mandatoryDispositionPauseId',null);this[_0xbfa9('0xa')](_0xbfa9('0xb'),_0x24815c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ac91570..c9ade1d 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 _0x6f31=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','order','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','Contact','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','get','out','dataValues','Messages','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','options','find','create','user','role','userProfileId'];(function(_0x46639f,_0xfc3ea8){var _0x26e1c4=function(_0x8c3d3f){while(--_0x8c3d3f){_0x46639f['push'](_0x46639f['shift']());}};_0x26e1c4(++_0xfc3ea8);}(_0x6f31,0x1d9));var _0x16f3=function(_0x3d331f,_0x1c4425){_0x3d331f=_0x3d331f-0x0;var _0xf42483=_0x6f31[_0x3d331f];return _0xf42483;};'use strict';var emlformat=require(_0x16f3('0x0'));var rimraf=require(_0x16f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x16f3('0x2'));var moment=require(_0x16f3('0x3'));var BPromise=require(_0x16f3('0x4'));var Mustache=require(_0x16f3('0x5'));var util=require(_0x16f3('0x6'));var path=require(_0x16f3('0x7'));var sox=require(_0x16f3('0x8'));var csv=require(_0x16f3('0x9'));var ejs=require(_0x16f3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x16f3('0xb'));var crypto=require('crypto');var jsforce=require(_0x16f3('0xc'));var deskjs=require(_0x16f3('0xd'));var toCsv=require(_0x16f3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x16f3('0xe'));var authService=require(_0x16f3('0xf'));var qs=require(_0x16f3('0x10'));var as=require(_0x16f3('0x11'));var hardwareService=require(_0x16f3('0x12'));var logger=require('../../config/logger')(_0x16f3('0x13'));var utils=require(_0x16f3('0x14'));var config=require(_0x16f3('0x15'));var licenseUtil=require(_0x16f3('0x16'));var db=require(_0x16f3('0x17'))['db'];config['redis']=_[_0x16f3('0x18')](config[_0x16f3('0x19')],{'host':_0x16f3('0x1a'),'port':0x18eb});var socket=require(_0x16f3('0x1b'))(new Redis(config['redis']));require(_0x16f3('0x1c'))[_0x16f3('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x16f3('0x1e')]({'port':0x232c});var client9002=jayson[_0x16f3('0x1f')][_0x16f3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3a5b39,_0x526a04,_0x1fe23c,_0x29c933){return new BPromise(function(_0x529c88,_0x2dac71){var _0x112d1a=_0x29c933||client;return _0x112d1a[_0x16f3('0x20')](_0x3a5b39,_0x1fe23c)[_0x16f3('0x21')](function(_0x3497c9){logger[_0x16f3('0x22')](_0x16f3('0x23'),_0x526a04,_0x16f3('0x24'));logger['debug'](_0x16f3('0x25'),_0x526a04,'request\x20sent',JSON[_0x16f3('0x26')](_0x3497c9));if(_0x3497c9[_0x16f3('0x27')]){if(_0x3497c9[_0x16f3('0x27')]['code']===0x1f4){logger[_0x16f3('0x27')](_0x16f3('0x23'),_0x526a04,_0x3497c9[_0x16f3('0x27')][_0x16f3('0x28')]);return _0x2dac71(_0x3497c9[_0x16f3('0x27')][_0x16f3('0x28')]);}logger[_0x16f3('0x27')](_0x16f3('0x23'),_0x526a04,_0x3497c9[_0x16f3('0x27')]['message']);return _0x529c88(_0x3497c9['error'][_0x16f3('0x28')]);}else{logger[_0x16f3('0x22')](_0x16f3('0x23'),_0x526a04,'request\x20sent');_0x529c88(_0x3497c9['result'][_0x16f3('0x28')]);}})[_0x16f3('0x29')](function(_0x453508){logger[_0x16f3('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x526a04,_0x453508);_0x2dac71(_0x453508);});});}function respondWithStatusCode(_0xa8d54b,_0x432d9d){_0x432d9d=_0x432d9d||0xcc;return function(_0x22b169){if(_0x22b169){return _0xa8d54b[_0x16f3('0x2a')](_0x432d9d);}return _0xa8d54b['status'](_0x432d9d)[_0x16f3('0x2b')]();};}function respondWithResult(_0x4d152f,_0x2aea15){_0x2aea15=_0x2aea15||0xc8;return function(_0x587f41){if(_0x587f41){return _0x4d152f[_0x16f3('0x2c')](_0x2aea15)[_0x16f3('0x2d')](_0x587f41);}};}function respondWithFilteredResult(_0x5363b9,_0x5ab348){return function(_0x2f93cf){if(_0x2f93cf){var _0x4f10d3=typeof _0x5ab348['offset']===_0x16f3('0x2e')&&typeof _0x5ab348['limit']===_0x16f3('0x2e');var _0x2abf1a=_0x2f93cf[_0x16f3('0x2f')];var _0x1ae30e=_0x4f10d3?0x0:_0x5ab348[_0x16f3('0x30')];var _0xdef760=_0x4f10d3?_0x2f93cf[_0x16f3('0x2f')]:_0x5ab348[_0x16f3('0x30')]+_0x5ab348[_0x16f3('0x31')];var _0x152152;if(_0xdef760>=_0x2abf1a){_0xdef760=_0x2abf1a;_0x152152=0xc8;}else{_0x152152=0xce;}_0x5363b9[_0x16f3('0x2c')](_0x152152);return _0x5363b9[_0x16f3('0x32')](_0x16f3('0x33'),_0x1ae30e+'-'+_0xdef760+'/'+_0x2abf1a)[_0x16f3('0x2d')](_0x2f93cf);}return null;};}function patchUpdates(_0x925df7){return function(_0x5cb0bc){try{jsonpatch[_0x16f3('0x34')](_0x5cb0bc,_0x925df7,!![]);}catch(_0xb4f59a){return BPromise[_0x16f3('0x35')](_0xb4f59a);}return _0x5cb0bc['save']();};}function saveUpdates(_0x17441b,_0x2d6409){return function(_0x3e5607){if(_0x3e5607){return _0x3e5607[_0x16f3('0x36')](_0x17441b)[_0x16f3('0x21')](function(_0x1d3cc1){return _0x1d3cc1;});}return null;};}function removeEntity(_0x5ccaef,_0x36efef){return function(_0x190cbc){if(_0x190cbc){return _0x190cbc[_0x16f3('0x37')]()[_0x16f3('0x21')](function(){var _0x37b566=_0x190cbc['get']({'plain':!![]});var _0x40e6b3=_0x16f3('0x38');return db[_0x16f3('0x39')][_0x16f3('0x37')]({'where':{'type':_0x40e6b3,'resourceId':_0x37b566['id']}})[_0x16f3('0x21')](function(){return _0x190cbc;});})['then'](function(){_0x5ccaef[_0x16f3('0x2c')](0xcc)[_0x16f3('0x2b')]();});}};}function handleEntityNotFound(_0x5044b5,_0xf55a37){return function(_0x65c60f){if(!_0x65c60f){_0x5044b5[_0x16f3('0x2a')](0x194);}return _0x65c60f;};}function handleError(_0x24c353,_0x75b2bc){_0x75b2bc=_0x75b2bc||0x1f4;return function(_0x1356a5){logger['error'](_0x1356a5[_0x16f3('0x3a')]);if(_0x1356a5[_0x16f3('0x3b')]){delete _0x1356a5[_0x16f3('0x3b')];}_0x24c353[_0x16f3('0x2c')](_0x75b2bc)['send'](_0x1356a5);};}exports[_0x16f3('0x3c')]=function(_0x5310ef,_0x1d837b){var _0x2d0ebb={'include':[{'model':db['Pause'],'as':_0x16f3('0x3d')}]},_0x5b7a8c={},_0x3e74db={'count':0x0,'rows':[]};var _0xf5f336=_[_0x16f3('0x3e')](db['OpenchannelAccount'][_0x16f3('0x3f')],function(_0x4e0f50){return{'name':_0x4e0f50[_0x16f3('0x40')],'type':_0x4e0f50[_0x16f3('0x41')]['key']};});_0x5b7a8c[_0x16f3('0x42')]=_[_0x16f3('0x3e')](_0xf5f336,_0x16f3('0x3b'));_0x5b7a8c['query']=_[_0x16f3('0x43')](_0x5310ef['query']);_0x5b7a8c['filters']=_[_0x16f3('0x44')](_0x5b7a8c['model'],_0x5b7a8c[_0x16f3('0x45')]);_0x2d0ebb[_0x16f3('0x46')]=_[_0x16f3('0x44')](_0x5b7a8c[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x5310ef[_0x16f3('0x45')]['fields']));_0x2d0ebb[_0x16f3('0x46')]=_0x2d0ebb[_0x16f3('0x46')][_0x16f3('0x48')]?_0x2d0ebb[_0x16f3('0x46')]:_0x5b7a8c[_0x16f3('0x42')];if(!_0x5310ef['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x2d0ebb[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x5310ef['query'][_0x16f3('0x31')]);_0x2d0ebb[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x5310ef['query']['offset']);}_0x2d0ebb['order']=qs[_0x16f3('0x4b')](_0x5310ef['query'][_0x16f3('0x4b')]);_0x2d0ebb[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_[_0x16f3('0x4e')](_0x5310ef[_0x16f3('0x45')],_0x5b7a8c[_0x16f3('0x4d')]),_0xf5f336);if(_0x5310ef[_0x16f3('0x45')]['filter']){_0x2d0ebb[_0x16f3('0x4c')]=_[_0x16f3('0x4f')](_0x2d0ebb[_0x16f3('0x4c')],{'$or':_[_0x16f3('0x3e')](_0xf5f336,function(_0x4fe30c){if(_0x4fe30c[_0x16f3('0x41')]!=='VIRTUAL'){var _0x4d68a1={};_0x4d68a1[_0x4fe30c['name']]={'$like':'%'+_0x5310ef[_0x16f3('0x45')]['filter']+'%'};return _0x4d68a1;}})});}_0x2d0ebb=_['merge']({},_0x2d0ebb,_0x5310ef['options']);var _0x46dd9f={'where':_0x2d0ebb[_0x16f3('0x4c')]};return db[_0x16f3('0x50')][_0x16f3('0x2f')](_0x46dd9f)[_0x16f3('0x21')](function(_0x156616){_0x3e74db[_0x16f3('0x2f')]=_0x156616;if(_0x5310ef[_0x16f3('0x45')][_0x16f3('0x51')]){_0x2d0ebb[_0x16f3('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x16f3('0x53')](_0x2d0ebb);})[_0x16f3('0x21')](function(_0xb5855e){_0x3e74db[_0x16f3('0x54')]=_0xb5855e;return _0x3e74db;})[_0x16f3('0x21')](respondWithFilteredResult(_0x1d837b,_0x2d0ebb))[_0x16f3('0x29')](handleError(_0x1d837b,null));};exports[_0x16f3('0x55')]=function(_0x48e6e6,_0x1b2ab3){var _0x55d810={'raw':![],'where':{'id':_0x48e6e6[_0x16f3('0x56')]['id']},'include':[{'model':db[_0x16f3('0x57')],'as':_0x16f3('0x3d')}]},_0x207bbe={};_0x207bbe['model']=_[_0x16f3('0x43')](db[_0x16f3('0x50')][_0x16f3('0x3f')]);_0x207bbe['query']=_[_0x16f3('0x43')](_0x48e6e6[_0x16f3('0x45')]);_0x207bbe[_0x16f3('0x4d')]=_['intersection'](_0x207bbe[_0x16f3('0x42')],_0x207bbe['query']);_0x55d810[_0x16f3('0x46')]=_['intersection'](_0x207bbe['model'],qs[_0x16f3('0x47')](_0x48e6e6[_0x16f3('0x45')][_0x16f3('0x47')]));_0x55d810[_0x16f3('0x46')]=_0x55d810[_0x16f3('0x46')][_0x16f3('0x48')]?_0x55d810[_0x16f3('0x46')]:_0x207bbe[_0x16f3('0x42')];if(_0x48e6e6[_0x16f3('0x45')][_0x16f3('0x51')]){_0x55d810[_0x16f3('0x52')]=[{'all':!![]}];}_0x55d810=_['merge']({},_0x55d810,_0x48e6e6[_0x16f3('0x58')]);return db[_0x16f3('0x50')][_0x16f3('0x59')](_0x55d810)[_0x16f3('0x21')](handleEntityNotFound(_0x1b2ab3,null))[_0x16f3('0x21')](respondWithResult(_0x1b2ab3,null))['catch'](handleError(_0x1b2ab3,null));};exports[_0x16f3('0x5a')]=function(_0x339fcb,_0xd92911){return db[_0x16f3('0x50')]['create'](_0x339fcb['body'],{})[_0x16f3('0x21')](function(_0x577eb0){var _0x14ce7b=_0x339fcb[_0x16f3('0x5b')]['get']({'plain':!![]});if(!_0x14ce7b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14ce7b[_0x16f3('0x5c')]==='user'){var _0x4fb51b=_0x577eb0['get']({'plain':!![]});var _0x5a995d=_0x16f3('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x5a995d,'userProfileId':_0x14ce7b[_0x16f3('0x5d')]},'raw':!![]})[_0x16f3('0x21')](function(_0x1f28f2){if(_0x1f28f2&&_0x1f28f2[_0x16f3('0x5e')]===0x0){return db[_0x16f3('0x39')]['create']({'name':_0x4fb51b[_0x16f3('0x3b')],'resourceId':_0x4fb51b['id'],'type':_0x1f28f2[_0x16f3('0x3b')],'sectionId':_0x1f28f2['id']},{})[_0x16f3('0x21')](function(){return _0x577eb0;});}else{return _0x577eb0;}})[_0x16f3('0x29')](function(_0x202ff6){logger[_0x16f3('0x27')](_0x16f3('0x5f'),_0x202ff6);throw _0x202ff6;});}return _0x577eb0;})[_0x16f3('0x21')](respondWithResult(_0xd92911,0xc9))['catch'](handleError(_0xd92911,null));};exports[_0x16f3('0x36')]=function(_0x2082ee,_0x54b5a5){if(_0x2082ee[_0x16f3('0x60')]['id']){delete _0x2082ee[_0x16f3('0x60')]['id'];}return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x2082ee[_0x16f3('0x56')]['id']},'include':[{'model':db[_0x16f3('0x57')],'as':_0x16f3('0x3d')}]})[_0x16f3('0x21')](handleEntityNotFound(_0x54b5a5,null))['then'](saveUpdates(_0x2082ee[_0x16f3('0x60')],null))[_0x16f3('0x21')](respondWithResult(_0x54b5a5,null))[_0x16f3('0x29')](handleError(_0x54b5a5,null));};exports[_0x16f3('0x37')]=function(_0x52c1d7,_0x63b2ea){return db['OpenchannelAccount']['find']({'where':{'id':_0x52c1d7[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x63b2ea,null))[_0x16f3('0x21')](removeEntity(_0x63b2ea,null))[_0x16f3('0x29')](handleError(_0x63b2ea,null));};exports[_0x16f3('0x61')]=function(_0x3373f0,_0x17b09d){return db[_0x16f3('0x50')]['describe']()[_0x16f3('0x21')](respondWithResult(_0x17b09d,null))[_0x16f3('0x29')](handleError(_0x17b09d,null));};exports['addDisposition']=function(_0x4a6c45,_0x32feb9,_0x40a0df){if(_0x4a6c45[_0x16f3('0x60')]['id']){delete _0x4a6c45[_0x16f3('0x60')]['id'];}return db[_0x16f3('0x50')]['find']({'where':{'id':_0x4a6c45[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x32feb9,null))[_0x16f3('0x21')](function(_0x4d2054){if(_0x4d2054){_0x4a6c45['body'][_0x16f3('0x62')]=_0x4d2054['id'];return db[_0x16f3('0x63')][_0x16f3('0x5a')](_0x4a6c45[_0x16f3('0x60')]);}})['then'](respondWithResult(_0x32feb9,null))[_0x16f3('0x29')](handleError(_0x32feb9,null));};exports[_0x16f3('0x64')]=function(_0x4fcceb,_0x53dd06,_0x542390){var _0x20b343={'raw':![],'where':{}};var _0x5606fd={};var _0x40a0a2={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x16f3('0x65')]({'where':{'id':_0x4fcceb[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x53dd06,null))[_0x16f3('0x21')](function(_0x4ed158){if(_0x4ed158){_0x5606fd[_0x16f3('0x42')]=_[_0x16f3('0x43')](db[_0x16f3('0x63')][_0x16f3('0x3f')]);_0x5606fd[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x4fcceb['query']);_0x5606fd[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x5606fd[_0x16f3('0x42')],_0x5606fd[_0x16f3('0x45')]);_0x20b343['attributes']=_[_0x16f3('0x44')](_0x5606fd[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x4fcceb[_0x16f3('0x45')]['fields']));_0x20b343[_0x16f3('0x46')]=_0x20b343[_0x16f3('0x46')][_0x16f3('0x48')]?_0x20b343[_0x16f3('0x46')]:_0x5606fd[_0x16f3('0x42')];if(!_0x4fcceb['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x20b343[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x4fcceb[_0x16f3('0x45')][_0x16f3('0x31')]);_0x20b343['offset']=qs[_0x16f3('0x30')](_0x4fcceb[_0x16f3('0x45')][_0x16f3('0x30')]);}_0x20b343[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x4fcceb['query']['sort']);_0x20b343[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_[_0x16f3('0x4e')](_0x4fcceb[_0x16f3('0x45')],_0x5606fd[_0x16f3('0x4d')]));_0x20b343[_0x16f3('0x4c')][_0x16f3('0x62')]=_0x4ed158['id'];if(_0x4fcceb[_0x16f3('0x45')]['filter']){_0x20b343[_0x16f3('0x4c')]=_['merge'](_0x20b343[_0x16f3('0x4c')],{'$or':_['map'](_0x20b343[_0x16f3('0x46')],function(_0x106ff0){var _0x342cc5={};_0x342cc5[_0x106ff0]={'$like':'%'+_0x4fcceb['query'][_0x16f3('0x67')]+'%'};return _0x342cc5;})});}_0x20b343=_[_0x16f3('0x4f')]({},_0x20b343,_0x4fcceb['options']);return db[_0x16f3('0x63')][_0x16f3('0x2f')]({'where':_0x20b343[_0x16f3('0x4c')]})[_0x16f3('0x21')](function(_0x10ea5f){_0x40a0a2['count']=_0x10ea5f;if(_0x4fcceb[_0x16f3('0x45')]['includeAll']){_0x20b343[_0x16f3('0x52')]=[{'all':!![]}];}return db[_0x16f3('0x63')][_0x16f3('0x53')](_0x20b343);})[_0x16f3('0x21')](function(_0x503544){_0x40a0a2[_0x16f3('0x54')]=_0x503544;return _0x40a0a2;});}})[_0x16f3('0x21')](respondWithFilteredResult(_0x53dd06,_0x20b343))[_0x16f3('0x29')](handleError(_0x53dd06,null));};exports[_0x16f3('0x68')]=function(_0x216844,_0x1ce3bf,_0x1737dc){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x216844[_0x16f3('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ce3bf,null))['then'](function(_0x5814a9){if(_0x5814a9){return _0x5814a9[_0x16f3('0x68')](_0x216844[_0x16f3('0x45')][_0x16f3('0x69')]);}})[_0x16f3('0x21')](respondWithStatusCode(_0x1ce3bf,null))[_0x16f3('0x29')](handleError(_0x1ce3bf,null));};exports[_0x16f3('0x6a')]=function(_0x1cb132,_0x2ac498,_0x12ef1c){if(_0x1cb132['body']['id']){delete _0x1cb132[_0x16f3('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1cb132[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x2ac498,null))[_0x16f3('0x21')](function(_0x408c01){if(_0x408c01){_0x1cb132[_0x16f3('0x60')][_0x16f3('0x62')]=_0x408c01['id'];return db[_0x16f3('0x6b')][_0x16f3('0x5a')](_0x1cb132[_0x16f3('0x60')]);}})['then'](respondWithResult(_0x2ac498,null))[_0x16f3('0x29')](handleError(_0x2ac498,null));};exports[_0x16f3('0x6c')]=function(_0x2daba1,_0x558df3,_0x41e96a){var _0x6e05ab={'raw':![],'where':{}};var _0x589f8b={};var _0x2d2191={'count':0x0,'rows':[]};return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x2daba1[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x558df3,null))[_0x16f3('0x21')](function(_0x26c85d){if(_0x26c85d){_0x589f8b[_0x16f3('0x42')]=_[_0x16f3('0x43')](db['CannedAnswer'][_0x16f3('0x3f')]);_0x589f8b[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x2daba1['query']);_0x589f8b[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x589f8b['model'],_0x589f8b[_0x16f3('0x45')]);_0x6e05ab[_0x16f3('0x46')]=_[_0x16f3('0x44')](_0x589f8b[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x47')]));_0x6e05ab[_0x16f3('0x46')]=_0x6e05ab[_0x16f3('0x46')][_0x16f3('0x48')]?_0x6e05ab[_0x16f3('0x46')]:_0x589f8b[_0x16f3('0x42')];if(!_0x2daba1['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x6e05ab['limit']=qs[_0x16f3('0x31')](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x31')]);_0x6e05ab[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x30')]);}_0x6e05ab['order']=qs['sort'](_0x2daba1[_0x16f3('0x45')][_0x16f3('0x4b')]);_0x6e05ab[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_[_0x16f3('0x4e')](_0x2daba1[_0x16f3('0x45')],_0x589f8b[_0x16f3('0x4d')]));_0x6e05ab[_0x16f3('0x4c')][_0x16f3('0x62')]=_0x26c85d['id'];if(_0x2daba1['query'][_0x16f3('0x67')]){_0x6e05ab[_0x16f3('0x4c')]=_[_0x16f3('0x4f')](_0x6e05ab[_0x16f3('0x4c')],{'$or':_[_0x16f3('0x3e')](_0x6e05ab['attributes'],function(_0x57aa5b){var _0x3f6f5f={};_0x3f6f5f[_0x57aa5b]={'$like':'%'+_0x2daba1[_0x16f3('0x45')][_0x16f3('0x67')]+'%'};return _0x3f6f5f;})});}_0x6e05ab=_['merge']({},_0x6e05ab,_0x2daba1[_0x16f3('0x58')]);return db[_0x16f3('0x6b')][_0x16f3('0x2f')]({'where':_0x6e05ab[_0x16f3('0x4c')]})[_0x16f3('0x21')](function(_0x317994){_0x2d2191['count']=_0x317994;if(_0x2daba1[_0x16f3('0x45')]['includeAll']){_0x6e05ab[_0x16f3('0x52')]=[{'all':!![]}];}return db[_0x16f3('0x6b')][_0x16f3('0x53')](_0x6e05ab);})['then'](function(_0xe8120c){_0x2d2191['rows']=_0xe8120c;return _0x2d2191;});}})[_0x16f3('0x21')](respondWithFilteredResult(_0x558df3,_0x6e05ab))[_0x16f3('0x29')](handleError(_0x558df3,null));};exports[_0x16f3('0x6d')]=function(_0x5926c3,_0x2eefa9,_0x1b59d3){return db[_0x16f3('0x50')]['find']({'where':{'id':_0x5926c3[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x2eefa9,null))['then'](function(_0x32d0c4){if(_0x32d0c4){return _0x32d0c4['removeAnswers'](_0x5926c3[_0x16f3('0x45')][_0x16f3('0x69')]);}})[_0x16f3('0x21')](respondWithStatusCode(_0x2eefa9,null))[_0x16f3('0x29')](handleError(_0x2eefa9,null));};exports[_0x16f3('0x6e')]=function(_0x271138,_0x52847f,_0xde3476){var _0x1597af={'body':_0x271138['body'],'channel':_0x16f3('0x6f')};var _0x2eab0c=[];var _0x3ed0bf=[];var _0x83c736={};var _0x2acbcf=![];return db[_0x16f3('0x70')][_0x16f3('0x61')]()[_0x16f3('0x21')](function(_0x51f4bc){if(!_0x51f4bc){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))]('no\x20available\x20attributes');}_0x2eab0c=_['difference'](_['keys'](_0x51f4bc),[_0x16f3('0x73'),'updatedAt']);_0x3ed0bf=_['difference'](_[_0x16f3('0x43')](_0x51f4bc),[_0x16f3('0x73'),'updatedAt',_0x16f3('0x74'),_0x16f3('0x75')]);if(_0x271138[_0x16f3('0x60')]['id']){delete _0x271138['body']['id'];}if(_[_0x16f3('0x76')](_0x271138[_0x16f3('0x60')][_0x16f3('0x77')])){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))](_0x16f3('0x78'));}if(_['isNil'](_0x271138[_0x16f3('0x60')][_0x16f3('0x60')])||_0x271138[_0x16f3('0x60')][_0x16f3('0x60')]===''){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))](_0x16f3('0x79'));}if(_['isNil'](_0x271138['body'][_0x16f3('0x7a')])){throw new db['Sequelize'][(_0x16f3('0x72'))](_0x16f3('0x7b')+_0x3ed0bf);}if(!_[_0x16f3('0x7c')](_0x3ed0bf,_0x271138['body'][_0x16f3('0x7a')])){throw new db[(_0x16f3('0x71'))][(_0x16f3('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ed0bf);}_0x83c736[_0x271138[_0x16f3('0x60')][_0x16f3('0x7a')]]=_0x271138[_0x16f3('0x60')]['from'];})[_0x16f3('0x21')](function(){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x271138[_0x16f3('0x56')]['id']},'include':[{'model':db[_0x16f3('0x7d')],'as':'List','include':[{'model':db[_0x16f3('0x70')],'as':_0x16f3('0x7e'),'where':_0x83c736,'limit':0x1,'order':[[_0x16f3('0x7f'),_0x16f3('0x80')]]}]},{'model':db[_0x16f3('0x81')],'as':_0x16f3('0x82')}]});})['then'](handleEntityNotFound(_0x52847f,null))['then'](function(_0x502c85){if(_0x502c85&&_0x502c85[_0x16f3('0x83')]){_0x1597af[_0x16f3('0x84')]=_0x502c85;_0x1597af[_0x16f3('0x85')]=_0x502c85[_0x16f3('0x82')];_0x1597af['list']=_0x502c85[_0x16f3('0x83')];_0x1597af['applications']=_[_0x16f3('0x86')](_0x1597af[_0x16f3('0x85')],[_0x16f3('0x87')],[_0x16f3('0x88')]);if(_0x1597af[_0x16f3('0x84')][_0x16f3('0x82')]){delete _0x1597af[_0x16f3('0x84')]['Applications'];}if(_0x1597af[_0x16f3('0x84')]['List']&&_0x1597af[_0x16f3('0x84')][_0x16f3('0x83')][_0x16f3('0x7e')]['length']){return _0x1597af['account']['List']['Contacts'][0x0];}var _0x120954=_[_0x16f3('0x18')](_0x271138[_0x16f3('0x60')],{'firstName':_0x271138[_0x16f3('0x60')][_0x16f3('0x77')],'ListId':_0x502c85[_0x16f3('0x75')]});_0x120954[_0x271138[_0x16f3('0x60')][_0x16f3('0x7a')]]=_0x271138[_0x16f3('0x60')]['from'];return db[_0x16f3('0x70')][_0x16f3('0x5a')](_0x120954,{'fields':_0x2eab0c,'raw':!![]});}})[_0x16f3('0x21')](handleEntityNotFound(_0x52847f,null))['then'](function(_0x15d28f){_0x1597af['contact']=_0x15d28f;if(_0x15d28f){var _0x21f8c1={'ContactId':_0x15d28f['id'],'OpenchannelAccountId':_0x271138[_0x16f3('0x56')]['id'],'from':(_0x15d28f[_0x16f3('0x89')]||'')+'\x20'+(_0x15d28f[_0x16f3('0x8a')]||'')};var _0x511f55={'OpenchannelAccountId':_0x271138[_0x16f3('0x56')]['id'],'closed':![]};if(_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')]){_0x511f55[_0x16f3('0x8b')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')];return db[_0x16f3('0x8c')][_0x16f3('0x59')]({'where':_0x511f55})[_0x16f3('0x21')](function(_0x5f3d1a){if(_0x5f3d1a){return[_0x5f3d1a,![]];}_0x21f8c1[_0x16f3('0x8b')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')];_0x21f8c1[_0x16f3('0x8d')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x8d')];return db[_0x16f3('0x8c')][_0x16f3('0x5a')](_0x21f8c1)[_0x16f3('0x21')](function(_0x21edee){return[_0x21edee,!![]];});});}else{_0x511f55['threadId']=null;}_0x511f55['ContactId']=_0x15d28f['id'];return db[_0x16f3('0x8c')][_0x16f3('0x59')]({'where':_0x511f55})[_0x16f3('0x21')](function(_0x3b1107){if(_0x3b1107){return[_0x3b1107,![]];}return db[_0x16f3('0x8c')][_0x16f3('0x5a')](_0x21f8c1)[_0x16f3('0x21')](function(_0x2c9950){return[_0x2c9950,!![]];});});}})[_0x16f3('0x8e')](function(_0x1ac0e5,_0x3b774f){if(_0x1ac0e5){_0x2acbcf=_0x3b774f;if(!_0x3b774f){var _0x28d296={'from':(_0x1597af['contact'][_0x16f3('0x89')]||'')+'\x20'+(_0x1597af[_0x16f3('0x8f')][_0x16f3('0x8a')]||'')};if(_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')]&&_0x271138[_0x16f3('0x60')][_0x16f3('0x90')]&&_0x271138[_0x16f3('0x60')][_0x16f3('0x8b')]!=_0x271138[_0x16f3('0x60')]['messageId']){_0x28d296[_0x16f3('0x8b')]=_0x271138[_0x16f3('0x60')][_0x16f3('0x90')];}return _0x1ac0e5[_0x16f3('0x36')](_0x28d296);}else{return _0x1ac0e5;}}})['then'](function(_0x5013c3){_0x1597af[_0x16f3('0x91')]=_0x5013c3['get']({'plain':!![]});_0x1597af[_0x16f3('0x91')][_0x16f3('0x92')]=_0x2acbcf;if(_0x1597af[_0x16f3('0x91')][_0x16f3('0x92')]){if(_0x1597af[_0x16f3('0x84')][_0x16f3('0x93')]){_0x1597af['applications'][_0x16f3('0x94')]({'id':0x0,'priority':_0x1597af[_0x16f3('0x85')][_0x16f3('0x48')]+0x1,'app':_0x16f3('0x95'),'appdata':_0x16f3('0x96'),'interval':'*,*,*,*'});}}return db[_0x16f3('0x97')]['create']({'body':_0x271138[_0x16f3('0x60')][_0x16f3('0x60')],'OpenchannelAccountId':_0x271138['params']['id'],'OpenchannelInteractionId':_0x5013c3['id'],'direction':'in','ContactId':_0x1597af[_0x16f3('0x8f')]['id'],'AttachmentId':_0x271138[_0x16f3('0x60')][_0x16f3('0x98')]});})[_0x16f3('0x21')](function(_0x10bb12){_0x1597af[_0x16f3('0x28')]=_0x10bb12;if(_0x1597af[_0x16f3('0x91')][_0x16f3('0x99')]){return db[_0x16f3('0x9a')][_0x16f3('0x59')]({'attributes':['id',_0x16f3('0x3b')],'where':{'id':_0x1597af['interaction'][_0x16f3('0x99')]}})[_0x16f3('0x21')](function(_0x1878ae){if(_0x1878ae){_0x1597af[_0x16f3('0x85')][_0x16f3('0x9b')]({'id':0x0,'priority':0x0,'app':_0x16f3('0x9c'),'appdata':_0x1878ae[_0x16f3('0x3b')]+','+(_0x1597af['account'][_0x16f3('0x9d')]||0xa),'interval':_0x16f3('0x9e')});_0x1597af[_0x16f3('0x9f')]=![];}return respondWithRpcPromise(_0x16f3('0xa0'),_0x16f3('0xa1'),_0x1597af);});}return respondWithRpcPromise(_0x16f3('0xa0'),_0x16f3('0xa1'),_0x1597af);})[_0x16f3('0x21')](function(_0x189832){respondWithRpcPromise(_0x16f3('0xa2'),'EventManager',{'event':_0x16f3('0x6e'),'message':_0x189832},client9002);return _0x189832;})['then'](respondWithResult(_0x52847f,null))[_0x16f3('0x29')](handleError(_0x52847f,null));};exports[_0x16f3('0xa3')]=function(_0x5d00ec,_0x12fb09){var _0x428c84=_0x5d00ec[_0x16f3('0x56')]['id'];var _0x320a07=_0x5d00ec[_0x16f3('0x60')];var _0x42f3ce=0xc8;var _0x26e03f=null;return db[_0x16f3('0xa4')][_0x16f3('0xa5')]({'isolationLevel':db[_0x16f3('0xa4')]['Transaction']['ISOLATION_LEVELS'][_0x16f3('0xa6')]},function(_0x4fa846){return db[_0x16f3('0x50')]['findOne']({'where':{'id':_0x428c84},'transaction':_0x4fa846})['then'](function(_0x3575d1){if(_0x3575d1){return db[_0x16f3('0x81')][_0x16f3('0x37')]({'where':{'OpenchannelAccountId':_0x428c84},'transaction':_0x4fa846})[_0x16f3('0x21')](function(){var _0x4cba92=_[_0x16f3('0x3e')](_0x320a07,function(_0x1ae6d3){_0x1ae6d3[_0x16f3('0x62')]=_0x428c84;return _0x1ae6d3;});return db[_0x16f3('0x81')][_0x16f3('0xa7')](_0x4cba92,{'transaction':_0x4fa846});});}else{_0x42f3ce=0x194;_0x26e03f=[];}});})[_0x16f3('0x21')](function(){if(_0x42f3ce!==0x194){return db[_0x16f3('0x81')][_0x16f3('0xa8')]({'where':{'OpenchannelAccountId':_0x428c84},'order':_0x16f3('0x87')})[_0x16f3('0x21')](function(_0x1d4cf2){_0x26e03f=_0x1d4cf2;});}})[_0x16f3('0x29')](function(_0x185c4f){_0x42f3ce=0x1f4;logger[_0x16f3('0x27')](_0x185c4f['stack']);if(_0x185c4f[_0x16f3('0x3b')]){delete _0x185c4f[_0x16f3('0x3b')];}_0x26e03f=_0x185c4f;})[_0x16f3('0xa9')](function(){if(_0x26e03f===null){_0x12fb09[_0x16f3('0x2a')](_0x42f3ce);}else{if(_0x42f3ce===0x1f4){_0x12fb09[_0x16f3('0x2c')](_0x42f3ce)[_0x16f3('0xaa')](_0x26e03f);}else{_0x12fb09[_0x16f3('0x2c')](_0x42f3ce)[_0x16f3('0x2d')](_0x26e03f);}}});};exports['getApplications']=function(_0x1baaf1,_0x1d37d5,_0x4c74f1){var _0x287fe7={};var _0x4bf409={};var _0x16b5e6;var _0x3a7705;return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x1baaf1['params']['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x1d37d5,null))[_0x16f3('0x21')](function(_0x1c6ccd){if(_0x1c6ccd){_0x16b5e6=_0x1c6ccd;_0x4bf409['model']=_['keys'](db[_0x16f3('0x81')][_0x16f3('0x3f')]);_0x4bf409['query']=_[_0x16f3('0x43')](_0x1baaf1['query']);_0x4bf409[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x4bf409[_0x16f3('0x42')],_0x4bf409[_0x16f3('0x45')]);_0x287fe7['attributes']=_[_0x16f3('0x44')](_0x4bf409[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x1baaf1[_0x16f3('0x45')]['fields']));_0x287fe7[_0x16f3('0x46')]=_0x287fe7[_0x16f3('0x46')]['length']?_0x287fe7[_0x16f3('0x46')]:_0x4bf409[_0x16f3('0x42')];_0x287fe7[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x1baaf1[_0x16f3('0x45')]['sort']);_0x287fe7[_0x16f3('0x4c')]=qs[_0x16f3('0x4d')](_['pick'](_0x1baaf1[_0x16f3('0x45')],_0x4bf409[_0x16f3('0x4d')]));if(_0x1baaf1[_0x16f3('0x45')][_0x16f3('0x67')]){_0x287fe7[_0x16f3('0x4c')]=_['merge'](_0x287fe7[_0x16f3('0x4c')],{'$or':_['map'](_0x287fe7['attributes'],function(_0x2246de){var _0x14664b={};_0x14664b[_0x2246de]={'$like':'%'+_0x1baaf1['query'][_0x16f3('0x67')]+'%'};return _0x14664b;})});}_0x287fe7=_[_0x16f3('0x4f')]({},_0x287fe7,_0x1baaf1[_0x16f3('0x58')]);return _0x16b5e6[_0x16f3('0xab')](_0x287fe7);}})[_0x16f3('0x21')](function(_0x244043){if(_0x244043){_0x3a7705=_0x244043[_0x16f3('0x48')];if(!_0x1baaf1[_0x16f3('0x45')]['hasOwnProperty']('nolimit')){_0x287fe7[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x1baaf1['query']['limit']);_0x287fe7[_0x16f3('0x30')]=qs['offset'](_0x1baaf1[_0x16f3('0x45')][_0x16f3('0x30')]);}return _0x16b5e6[_0x16f3('0xab')](_0x287fe7);}})[_0x16f3('0x21')](function(_0x2d1d1f){if(_0x2d1d1f){return _0x2d1d1f?{'count':_0x3a7705,'rows':_0x2d1d1f}:null;}})[_0x16f3('0x21')](respondWithResult(_0x1d37d5,null))[_0x16f3('0x29')](handleError(_0x1d37d5,null));};exports[_0x16f3('0xac')]=function(_0x1e0224,_0x4902d1,_0x536977){var _0x745b08={'raw':![],'where':{}};var _0x1bc1b8={};var _0x716d2d={'count':0x0,'rows':[]};return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x1e0224[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x4902d1,null))[_0x16f3('0x21')](function(_0x25d008){if(_0x25d008){_0x1bc1b8['model']=_[_0x16f3('0x43')](db['OpenchannelInteraction'][_0x16f3('0x3f')]);_0x1bc1b8[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x1e0224[_0x16f3('0x45')]);_0x1bc1b8[_0x16f3('0x4d')]=_[_0x16f3('0x44')](_0x1bc1b8[_0x16f3('0x42')],_0x1bc1b8[_0x16f3('0x45')]);_0x745b08['attributes']=_[_0x16f3('0x44')](_0x1bc1b8[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x1e0224[_0x16f3('0x45')][_0x16f3('0x47')]));_0x745b08[_0x16f3('0x46')]=_0x745b08[_0x16f3('0x46')][_0x16f3('0x48')]?_0x745b08[_0x16f3('0x46')]:_0x1bc1b8[_0x16f3('0x42')];if(!_0x1e0224['query'][_0x16f3('0x49')]('nolimit')){_0x745b08[_0x16f3('0x31')]=qs['limit'](_0x1e0224['query']['limit']);_0x745b08[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x1e0224['query'][_0x16f3('0x30')]);}_0x745b08[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x1e0224[_0x16f3('0x45')][_0x16f3('0x4b')]);_0x745b08[_0x16f3('0x4c')]=qs['filters'](_[_0x16f3('0x4e')](_0x1e0224[_0x16f3('0x45')],_0x1bc1b8['filters']));_0x745b08[_0x16f3('0x4c')][_0x16f3('0x62')]=_0x25d008['id'];if(_0x1e0224[_0x16f3('0x45')][_0x16f3('0x67')]){_0x745b08['where']=_[_0x16f3('0x4f')](_0x745b08[_0x16f3('0x4c')],{'$or':_[_0x16f3('0x3e')](_0x745b08[_0x16f3('0x46')],function(_0x1bf808){var _0x7a73b6={};_0x7a73b6[_0x1bf808]={'$like':'%'+_0x1e0224['query'][_0x16f3('0x67')]+'%'};return _0x7a73b6;})});}_0x745b08=_[_0x16f3('0x4f')]({},_0x745b08,_0x1e0224[_0x16f3('0x58')]);return db[_0x16f3('0x8c')][_0x16f3('0x2f')]({'where':_0x745b08[_0x16f3('0x4c')]})['then'](function(_0x3855f1){_0x716d2d[_0x16f3('0x2f')]=_0x3855f1;if(_0x1e0224[_0x16f3('0x45')][_0x16f3('0x51')]){_0x745b08[_0x16f3('0x52')]=[{'model':db['CmContact'],'as':_0x16f3('0xad'),'required':![]},{'model':db[_0x16f3('0x9a')],'as':'Owner','attributes':[_0x16f3('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0x16f3('0xae')],'as':_0x16f3('0xaf'),'attributes':['id',_0x16f3('0x3b'),_0x16f3('0xb0')],'where':_0x1e0224[_0x16f3('0x45')]['tag']?{'id':_0x1e0224['query'][_0x16f3('0xb1')]}:undefined,'required':_0x1e0224['query']['tag']?!![]:![]}];}return db[_0x16f3('0x8c')][_0x16f3('0x53')](_0x745b08);})[_0x16f3('0x21')](function(_0xfd3e45){_0x716d2d[_0x16f3('0x54')]=_0xfd3e45;return _0x716d2d;});}})[_0x16f3('0x21')](respondWithFilteredResult(_0x4902d1,_0x745b08))['catch'](handleError(_0x4902d1,null));};exports['addAgents']=function(_0x1cc6a6,_0x4696af,_0x3047c6){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x1cc6a6['params']['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x4696af,null))[_0x16f3('0x21')](function(_0x5db2be){if(_0x5db2be){return _0x5db2be[_0x16f3('0xb2')](_0x1cc6a6['body'][_0x16f3('0x69')],_[_0x16f3('0xb3')](_0x1cc6a6[_0x16f3('0x60')],[_0x16f3('0x69'),'id'])||{})[_0x16f3('0x8e')](function(_0x15245e){for(var _0x167dcc=0x0;_0x167dcc<_0x1cc6a6[_0x16f3('0x60')][_0x16f3('0x69')]['length'];_0x167dcc+=0x1){socket[_0x16f3('0xb4')]('userOpenchannelAccount:save',{'UserId':Number(_0x1cc6a6[_0x16f3('0x60')][_0x16f3('0x69')][_0x167dcc]),'OpenchannelAccountId':Number(_0x1cc6a6[_0x16f3('0x56')]['id'])});}return _0x15245e;});}})[_0x16f3('0x21')](respondWithResult(_0x4696af,null))[_0x16f3('0x29')](handleError(_0x4696af,null));};exports[_0x16f3('0xb5')]=function(_0x8d1303,_0x339864,_0x1b2cc8){return db[_0x16f3('0x50')][_0x16f3('0x59')]({'where':{'id':_0x8d1303[_0x16f3('0x56')]['id']}})['then'](handleEntityNotFound(_0x339864,null))[_0x16f3('0x21')](function(_0x32ee6c){if(_0x32ee6c){return _0x32ee6c[_0x16f3('0xb5')](_0x8d1303['query'][_0x16f3('0x69')])[_0x16f3('0x21')](function(){if(_[_0x16f3('0xb6')](_0x8d1303['query'][_0x16f3('0x69')])){for(var _0x33b27a=0x0;_0x33b27a<_0x8d1303['query'][_0x16f3('0x69')][_0x16f3('0x48')];_0x33b27a+=0x1){socket[_0x16f3('0xb4')](_0x16f3('0xb7'),{'UserId':Number(_0x8d1303[_0x16f3('0x45')]['ids'][_0x33b27a]),'OpenchannelAccountId':Number(_0x8d1303[_0x16f3('0x56')]['id'])});}}else{socket[_0x16f3('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x8d1303[_0x16f3('0x45')][_0x16f3('0x69')]),'OpenchannelAccountId':Number(_0x8d1303[_0x16f3('0x56')]['id'])});}});}})[_0x16f3('0x21')](respondWithStatusCode(_0x339864,null))[_0x16f3('0x29')](handleError(_0x339864,null));};exports['getAgents']=function(_0x3bc8cc,_0x185642,_0x137a69){var _0x5bd031={};var _0x2b0608={};var _0x24d1d2;var _0x9b824f;return db[_0x16f3('0x50')][_0x16f3('0x65')]({'where':{'id':_0x3bc8cc[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x185642,null))[_0x16f3('0x21')](function(_0x2fee48){if(_0x2fee48){_0x24d1d2=_0x2fee48;_0x2b0608[_0x16f3('0x42')]=_['keys'](db[_0x16f3('0x9a')]['rawAttributes']);_0x2b0608[_0x16f3('0x45')]=_[_0x16f3('0x43')](_0x3bc8cc[_0x16f3('0x45')]);_0x2b0608[_0x16f3('0x4d')]=_['intersection'](_0x2b0608[_0x16f3('0x42')],_0x2b0608[_0x16f3('0x45')]);_0x5bd031['attributes']=_[_0x16f3('0x44')](_0x2b0608[_0x16f3('0x42')],qs[_0x16f3('0x47')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x47')]));_0x5bd031[_0x16f3('0x46')]=_0x5bd031[_0x16f3('0x46')][_0x16f3('0x48')]?_0x5bd031[_0x16f3('0x46')]:_0x2b0608[_0x16f3('0x42')];_0x5bd031[_0x16f3('0x66')]=qs[_0x16f3('0x4b')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x4b')]);_0x5bd031[_0x16f3('0x4c')]=qs['filters'](_[_0x16f3('0x4e')](_0x3bc8cc[_0x16f3('0x45')],_0x2b0608[_0x16f3('0x4d')]));if(_0x3bc8cc['query']['filter']){_0x5bd031[_0x16f3('0x4c')]=_['merge'](_0x5bd031['where'],{'$or':_[_0x16f3('0x3e')](_0x5bd031[_0x16f3('0x46')],function(_0x761a23){var _0x195e34={};_0x195e34[_0x761a23]={'$like':'%'+_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x67')]+'%'};return _0x195e34;})});}_0x5bd031=_[_0x16f3('0x4f')]({},_0x5bd031,_0x3bc8cc[_0x16f3('0x58')]);return _0x24d1d2[_0x16f3('0xb8')](_0x5bd031);}})[_0x16f3('0x21')](function(_0x3f4621){if(_0x3f4621){_0x9b824f=_0x3f4621[_0x16f3('0x48')];if(!_0x3bc8cc['query'][_0x16f3('0x49')](_0x16f3('0x4a'))){_0x5bd031[_0x16f3('0x31')]=qs[_0x16f3('0x31')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x31')]);_0x5bd031[_0x16f3('0x30')]=qs[_0x16f3('0x30')](_0x3bc8cc[_0x16f3('0x45')][_0x16f3('0x30')]);}return _0x24d1d2['getAgents'](_0x5bd031);}})['then'](function(_0x3cf5f0){if(_0x3cf5f0){return _0x3cf5f0?{'count':_0x9b824f,'rows':_0x3cf5f0}:null;}})['then'](respondWithResult(_0x185642,null))[_0x16f3('0x29')](handleError(_0x185642,null));};exports['send']=function(_0x13f3bd,_0x236f12,_0xec72cd){var _0x57a844,_0x297147,_0x385916;if(_[_0x16f3('0x76')](_0x13f3bd['body'][_0x16f3('0x60')])||_0x13f3bd[_0x16f3('0x60')][_0x16f3('0x60')]===''){throw new db['Sequelize'][(_0x16f3('0x72'))](_0x16f3('0x79'));}if(_[_0x16f3('0x76')](_0x13f3bd[_0x16f3('0x60')]['to'])){}_0x57a844=_0x13f3bd[_0x16f3('0x60')]['to'];return db['OpenchannelAccount'][_0x16f3('0x65')]({'where':{'id':_0x13f3bd[_0x16f3('0x56')]['id']}})[_0x16f3('0x21')](handleEntityNotFound(_0x236f12,null))[_0x16f3('0x21')](function(_0x481c5f){if(_0x481c5f){return db[_0x16f3('0x50')]['find']({'where':{'id':_0x481c5f['id']},'include':[{'model':db[_0x16f3('0x7d')],'as':_0x16f3('0x83'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x481c5f['mapKey']]:_0x57a844},'limit':0x1,'order':[[_0x16f3('0x7f'),_0x16f3('0x80')]]}]}]})[_0x16f3('0x21')](handleEntityNotFound(_0x236f12,null))[_0x16f3('0x21')](function(_0xafcd88){if(_0xafcd88&&_0xafcd88[_0x16f3('0x83')]){_0x297147=_0xafcd88[_0x16f3('0xb9')]({'plain':!![]});if(_0x297147[_0x16f3('0x83')]&&_0x297147[_0x16f3('0x83')][_0x16f3('0x7e')][_0x16f3('0x48')]){return _0x297147[_0x16f3('0x83')]['Contacts'][0x0];}return db[_0x16f3('0x70')][_0x16f3('0x5a')](_[_0x16f3('0x18')](_0x13f3bd[_0x16f3('0x60')],{'firstName':_0x57a844,[_0xafcd88[_0x16f3('0x7a')]]:_0x57a844,'phone':_0x57a844,'ListId':_0x297147[_0x16f3('0x75')]}));}})[_0x16f3('0x21')](handleEntityNotFound(_0x236f12,null))['then'](function(_0x44e2a4){if(_0x44e2a4){_0x385916=_0x44e2a4;return db[_0x16f3('0x8c')][_0x16f3('0x59')]({'where':{'ContactId':_0x385916['id'],'closed':![],'OpenchannelAccountId':_0x297147['id']}})['then'](function(_0x5bffd9){if(_0x5bffd9){return[_0x5bffd9,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x13f3bd[_0x16f3('0x5b')]['id'],'ContactId':_0x385916['id'],'OpenchannelAccountId':_0x297147['id'],'lastMsgDirection':_0x16f3('0xba'),'Messages':[_[_0x16f3('0x4f')](_0x13f3bd[_0x16f3('0x60')],{'read':![],'body':_0x13f3bd[_0x16f3('0x60')][_0x16f3('0x60')],'OpenchannelAccountId':_0x297147['id'],'UserId':_0x13f3bd[_0x16f3('0x5b')]['id'],'ContactId':_0x385916['id']})]},{'include':[{'model':db[_0x16f3('0x97')],'as':'Messages'}]})[_0x16f3('0x21')](function(_0x724710){return[_0x724710,!![]];});});}})[_0x16f3('0x8e')](function(_0x859399,_0x29c7d3){if(_0x29c7d3){return _0x859399;}return db[_0x16f3('0x97')][_0x16f3('0x5a')](_['merge'](_0x13f3bd['body'],{'read':![],'body':_0x13f3bd[_0x16f3('0x60')]['body'],'OpenchannelAccountId':_0x297147['id'],'OpenchannelInteractionId':_0x859399['id'],'UserId':_0x13f3bd[_0x16f3('0x5b')]['id'],'ContactId':_0x385916['id']}))[_0x16f3('0x21')](function(_0x435d8b){_0x859399[_0x16f3('0xbb')][_0x16f3('0xbc')]=[];_0x859399['dataValues']['Messages'][_0x16f3('0x94')](_0x435d8b[_0x16f3('0xbb')]);return _0x859399;});});}})['then'](respondWithResult(_0x236f12,null))[_0x16f3('0x29')](handleError(_0x236f12,null));}; \ No newline at end of file +var _0x7a68=['dataValues','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','destroy','get','OpenchannelAccounts','name','send','index','Pause','map','OpenchannelAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','include','rows','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','getDispositions','rawAttributes','Disposition','findAll','addAnswer','findOne','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','OpenchannelApplication','List','account','applications','orderBy','priority','asc','Applications','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','options','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages'];(function(_0x21310f,_0x2b178d){var _0x5bb5a3=function(_0x5ea0ff){while(--_0x5ea0ff){_0x21310f['push'](_0x21310f['shift']());}};_0x5bb5a3(++_0x2b178d);}(_0x7a68,0x195));var _0x87a6=function(_0x5aec3b,_0x412bb5){_0x5aec3b=_0x5aec3b-0x0;var _0x23a5b8=_0x7a68[_0x5aec3b];return _0x23a5b8;};'use strict';var emlformat=require(_0x87a6('0x0'));var rimraf=require(_0x87a6('0x1'));var zipdir=require(_0x87a6('0x2'));var jsonpatch=require(_0x87a6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x87a6('0x4'));var Mustache=require(_0x87a6('0x5'));var util=require(_0x87a6('0x6'));var path=require(_0x87a6('0x7'));var sox=require(_0x87a6('0x8'));var csv=require('to-csv');var ejs=require(_0x87a6('0x9'));var fs=require('fs');var fs_extra=require(_0x87a6('0xa'));var _=require(_0x87a6('0xb'));var squel=require(_0x87a6('0xc'));var crypto=require(_0x87a6('0xd'));var jsforce=require(_0x87a6('0xe'));var deskjs=require(_0x87a6('0xf'));var toCsv=require(_0x87a6('0x10'));var querystring=require(_0x87a6('0x11'));var Papa=require(_0x87a6('0x12'));var Redis=require(_0x87a6('0x13'));var authService=require(_0x87a6('0x14'));var qs=require(_0x87a6('0x15'));var as=require(_0x87a6('0x16'));var hardwareService=require(_0x87a6('0x17'));var logger=require(_0x87a6('0x18'))(_0x87a6('0x19'));var utils=require('../../config/utils');var config=require(_0x87a6('0x1a'));var licenseUtil=require(_0x87a6('0x1b'));var db=require(_0x87a6('0x1c'))['db'];config[_0x87a6('0x1d')]=_[_0x87a6('0x1e')](config[_0x87a6('0x1d')],{'host':_0x87a6('0x1f'),'port':0x18eb});var socket=require(_0x87a6('0x20'))(new Redis(config[_0x87a6('0x1d')]));require(_0x87a6('0x21'))[_0x87a6('0x22')](socket);var jayson=require('jayson/promise');var client=jayson[_0x87a6('0x23')][_0x87a6('0x24')]({'port':0x232c});var client9002=jayson[_0x87a6('0x23')][_0x87a6('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x11c16a,_0x3c5fee,_0x5628f0,_0x4466d4){return new BPromise(function(_0x2b5360,_0x27112c){var _0x5ebcd4=_0x4466d4||client;return _0x5ebcd4[_0x87a6('0x25')](_0x11c16a,_0x5628f0)[_0x87a6('0x26')](function(_0x3b86d8){logger[_0x87a6('0x27')](_0x87a6('0x28'),_0x3c5fee,_0x87a6('0x29'));logger['debug'](_0x87a6('0x2a'),_0x3c5fee,_0x87a6('0x29'),JSON['stringify'](_0x3b86d8));if(_0x3b86d8[_0x87a6('0x2b')]){if(_0x3b86d8[_0x87a6('0x2b')][_0x87a6('0x2c')]===0x1f4){logger[_0x87a6('0x2b')](_0x87a6('0x28'),_0x3c5fee,_0x3b86d8[_0x87a6('0x2b')]['message']);return _0x27112c(_0x3b86d8['error']['message']);}logger[_0x87a6('0x2b')](_0x87a6('0x28'),_0x3c5fee,_0x3b86d8['error'][_0x87a6('0x2d')]);return _0x2b5360(_0x3b86d8[_0x87a6('0x2b')][_0x87a6('0x2d')]);}else{logger['info'](_0x87a6('0x28'),_0x3c5fee,'request\x20sent');_0x2b5360(_0x3b86d8['result'][_0x87a6('0x2d')]);}})[_0x87a6('0x2e')](function(_0xd900a2){logger[_0x87a6('0x2b')](_0x87a6('0x28'),_0x3c5fee,_0xd900a2);_0x27112c(_0xd900a2);});});}function respondWithStatusCode(_0x3b908f,_0x1d6641){_0x1d6641=_0x1d6641||0xcc;return function(_0x38013c){if(_0x38013c){return _0x3b908f[_0x87a6('0x2f')](_0x1d6641);}return _0x3b908f[_0x87a6('0x30')](_0x1d6641)[_0x87a6('0x31')]();};}function respondWithResult(_0xc2838b,_0xee4d63){_0xee4d63=_0xee4d63||0xc8;return function(_0x236cfe){if(_0x236cfe){return _0xc2838b[_0x87a6('0x30')](_0xee4d63)[_0x87a6('0x32')](_0x236cfe);}};}function respondWithFilteredResult(_0x31997b,_0x1e7bc9){return function(_0x3e2e6f){if(_0x3e2e6f){var _0x56004c=typeof _0x1e7bc9[_0x87a6('0x33')]===_0x87a6('0x34')&&typeof _0x1e7bc9[_0x87a6('0x35')]===_0x87a6('0x34');var _0x94781c=_0x3e2e6f['count'];var _0x345649=_0x56004c?0x0:_0x1e7bc9[_0x87a6('0x33')];var _0x44ab8a=_0x56004c?_0x3e2e6f['count']:_0x1e7bc9['offset']+_0x1e7bc9[_0x87a6('0x35')];var _0x36f717;if(_0x44ab8a>=_0x94781c){_0x44ab8a=_0x94781c;_0x36f717=0xc8;}else{_0x36f717=0xce;}_0x31997b[_0x87a6('0x30')](_0x36f717);return _0x31997b[_0x87a6('0x36')](_0x87a6('0x37'),_0x345649+'-'+_0x44ab8a+'/'+_0x94781c)[_0x87a6('0x32')](_0x3e2e6f);}return null;};}function patchUpdates(_0x381dff){return function(_0x51c3a0){try{jsonpatch[_0x87a6('0x38')](_0x51c3a0,_0x381dff,!![]);}catch(_0x2bbfb0){return BPromise[_0x87a6('0x39')](_0x2bbfb0);}return _0x51c3a0['save']();};}function saveUpdates(_0xf7f1fe,_0x4551e8){return function(_0xd2a42e){if(_0xd2a42e){return _0xd2a42e['update'](_0xf7f1fe)[_0x87a6('0x26')](function(_0x431926){return _0x431926;});}return null;};}function removeEntity(_0x2d0658,_0x39ef8a){return function(_0x493b67){if(_0x493b67){return _0x493b67[_0x87a6('0x3a')]()[_0x87a6('0x26')](function(){var _0x45654b=_0x493b67[_0x87a6('0x3b')]({'plain':!![]});var _0x57c1b4=_0x87a6('0x3c');return db['UserProfileResource'][_0x87a6('0x3a')]({'where':{'type':_0x57c1b4,'resourceId':_0x45654b['id']}})['then'](function(){return _0x493b67;});})[_0x87a6('0x26')](function(){_0x2d0658['status'](0xcc)[_0x87a6('0x31')]();});}};}function handleEntityNotFound(_0x1cf7f1,_0x5bd3ae){return function(_0x30d16a){if(!_0x30d16a){_0x1cf7f1[_0x87a6('0x2f')](0x194);}return _0x30d16a;};}function handleError(_0x1daeb4,_0x4e1286){_0x4e1286=_0x4e1286||0x1f4;return function(_0x2b5b47){logger[_0x87a6('0x2b')](_0x2b5b47['stack']);if(_0x2b5b47[_0x87a6('0x3d')]){delete _0x2b5b47['name'];}_0x1daeb4[_0x87a6('0x30')](_0x4e1286)[_0x87a6('0x3e')](_0x2b5b47);};}exports[_0x87a6('0x3f')]=function(_0x43ff18,_0x9e15c7){var _0x201aae={'include':[{'model':db[_0x87a6('0x40')],'as':'mandatoryDispositionPause'}]},_0x3eb26b={},_0x16ae96={'count':0x0,'rows':[]};var _0x37c0a5=_[_0x87a6('0x41')](db[_0x87a6('0x42')]['rawAttributes'],function(_0x283c2f){return{'name':_0x283c2f[_0x87a6('0x43')],'type':_0x283c2f[_0x87a6('0x44')][_0x87a6('0x45')]};});_0x3eb26b[_0x87a6('0x46')]=_[_0x87a6('0x41')](_0x37c0a5,_0x87a6('0x3d'));_0x3eb26b[_0x87a6('0x47')]=_[_0x87a6('0x48')](_0x43ff18['query']);_0x3eb26b['filters']=_[_0x87a6('0x49')](_0x3eb26b[_0x87a6('0x46')],_0x3eb26b[_0x87a6('0x47')]);_0x201aae[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0x3eb26b['model'],qs[_0x87a6('0x4b')](_0x43ff18[_0x87a6('0x47')][_0x87a6('0x4b')]));_0x201aae[_0x87a6('0x4a')]=_0x201aae[_0x87a6('0x4a')][_0x87a6('0x4c')]?_0x201aae['attributes']:_0x3eb26b[_0x87a6('0x46')];if(!_0x43ff18[_0x87a6('0x47')][_0x87a6('0x4d')](_0x87a6('0x4e'))){_0x201aae[_0x87a6('0x35')]=qs[_0x87a6('0x35')](_0x43ff18['query']['limit']);_0x201aae[_0x87a6('0x33')]=qs['offset'](_0x43ff18[_0x87a6('0x47')]['offset']);}_0x201aae[_0x87a6('0x4f')]=qs[_0x87a6('0x50')](_0x43ff18[_0x87a6('0x47')][_0x87a6('0x50')]);_0x201aae[_0x87a6('0x51')]=qs[_0x87a6('0x52')](_[_0x87a6('0x53')](_0x43ff18['query'],_0x3eb26b[_0x87a6('0x52')]),_0x37c0a5);if(_0x43ff18[_0x87a6('0x47')][_0x87a6('0x54')]){_0x201aae[_0x87a6('0x51')]=_['merge'](_0x201aae[_0x87a6('0x51')],{'$or':_[_0x87a6('0x41')](_0x37c0a5,function(_0x4261c0){if(_0x4261c0[_0x87a6('0x44')]!==_0x87a6('0x55')){var _0x2a33f8={};_0x2a33f8[_0x4261c0[_0x87a6('0x3d')]]={'$like':'%'+_0x43ff18['query']['filter']+'%'};return _0x2a33f8;}})});}_0x201aae=_[_0x87a6('0x56')]({},_0x201aae,_0x43ff18['options']);var _0x4a1be9={'where':_0x201aae['where']};return db[_0x87a6('0x42')][_0x87a6('0x57')](_0x4a1be9)['then'](function(_0x1566cb){_0x16ae96[_0x87a6('0x57')]=_0x1566cb;if(_0x43ff18[_0x87a6('0x47')][_0x87a6('0x58')]){_0x201aae[_0x87a6('0x59')]=[{'all':!![]}];}return db[_0x87a6('0x42')]['findAll'](_0x201aae);})[_0x87a6('0x26')](function(_0x48bb5d){_0x16ae96[_0x87a6('0x5a')]=_0x48bb5d;return _0x16ae96;})[_0x87a6('0x26')](respondWithFilteredResult(_0x9e15c7,_0x201aae))[_0x87a6('0x2e')](handleError(_0x9e15c7,null));};exports[_0x87a6('0x5b')]=function(_0xba36c,_0x1ab0d5){var _0x4291c1={'raw':![],'where':{'id':_0xba36c[_0x87a6('0x5c')]['id']},'include':[{'model':db[_0x87a6('0x40')],'as':_0x87a6('0x5d')}]},_0x57e629={};_0x57e629[_0x87a6('0x46')]=_['keys'](db[_0x87a6('0x42')]['rawAttributes']);_0x57e629[_0x87a6('0x47')]=_[_0x87a6('0x48')](_0xba36c[_0x87a6('0x47')]);_0x57e629[_0x87a6('0x52')]=_[_0x87a6('0x49')](_0x57e629[_0x87a6('0x46')],_0x57e629[_0x87a6('0x47')]);_0x4291c1[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0x57e629[_0x87a6('0x46')],qs[_0x87a6('0x4b')](_0xba36c[_0x87a6('0x47')][_0x87a6('0x4b')]));_0x4291c1[_0x87a6('0x4a')]=_0x4291c1['attributes'][_0x87a6('0x4c')]?_0x4291c1[_0x87a6('0x4a')]:_0x57e629[_0x87a6('0x46')];if(_0xba36c['query'][_0x87a6('0x58')]){_0x4291c1[_0x87a6('0x59')]=[{'all':!![]}];}_0x4291c1=_[_0x87a6('0x56')]({},_0x4291c1,_0xba36c['options']);return db[_0x87a6('0x42')][_0x87a6('0x5e')](_0x4291c1)[_0x87a6('0x26')](handleEntityNotFound(_0x1ab0d5,null))[_0x87a6('0x26')](respondWithResult(_0x1ab0d5,null))[_0x87a6('0x2e')](handleError(_0x1ab0d5,null));};exports[_0x87a6('0x5f')]=function(_0x5cec69,_0x32a569){return db[_0x87a6('0x42')]['create'](_0x5cec69[_0x87a6('0x60')],{})['then'](function(_0x3b5d2d){var _0x438653=_0x5cec69[_0x87a6('0x61')]['get']({'plain':!![]});if(!_0x438653)throw new Error(_0x87a6('0x62'));if(_0x438653[_0x87a6('0x63')]===_0x87a6('0x61')){var _0x454636=_0x3b5d2d[_0x87a6('0x3b')]({'plain':!![]});var _0x595056=_0x87a6('0x3c');return db[_0x87a6('0x64')]['find']({'where':{'name':_0x595056,'userProfileId':_0x438653['userProfileId']},'raw':!![]})['then'](function(_0x2791d1){if(_0x2791d1&&_0x2791d1[_0x87a6('0x65')]===0x0){return db[_0x87a6('0x66')][_0x87a6('0x5f')]({'name':_0x454636[_0x87a6('0x3d')],'resourceId':_0x454636['id'],'type':_0x2791d1[_0x87a6('0x3d')],'sectionId':_0x2791d1['id']},{})['then'](function(){return _0x3b5d2d;});}else{return _0x3b5d2d;}})[_0x87a6('0x2e')](function(_0x493686){logger[_0x87a6('0x2b')](_0x87a6('0x67'),_0x493686);throw _0x493686;});}return _0x3b5d2d;})['then'](respondWithResult(_0x32a569,0xc9))[_0x87a6('0x2e')](handleError(_0x32a569,null));};exports[_0x87a6('0x68')]=function(_0x1b354e,_0x50cccc){if(_0x1b354e['body']['id']){delete _0x1b354e[_0x87a6('0x60')]['id'];}return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x1b354e[_0x87a6('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x87a6('0x5d')}]})[_0x87a6('0x26')](handleEntityNotFound(_0x50cccc,null))['then'](saveUpdates(_0x1b354e[_0x87a6('0x60')],null))['then'](respondWithResult(_0x50cccc,null))['catch'](handleError(_0x50cccc,null));};exports['destroy']=function(_0x3f6a1c,_0x183e42){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x3f6a1c['params']['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x183e42,null))[_0x87a6('0x26')](removeEntity(_0x183e42,null))[_0x87a6('0x2e')](handleError(_0x183e42,null));};exports[_0x87a6('0x69')]=function(_0x554206,_0x158305){return db[_0x87a6('0x42')]['describe']()[_0x87a6('0x26')](respondWithResult(_0x158305,null))['catch'](handleError(_0x158305,null));};exports[_0x87a6('0x6a')]=function(_0x3246da,_0x3b2a91,_0x294284){if(_0x3246da[_0x87a6('0x60')]['id']){delete _0x3246da[_0x87a6('0x60')]['id'];}return db['OpenchannelAccount'][_0x87a6('0x5e')]({'where':{'id':_0x3246da[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x3b2a91,null))['then'](function(_0x1b96b7){if(_0x1b96b7){_0x3246da[_0x87a6('0x60')][_0x87a6('0x6b')]=_0x1b96b7['id'];return db['Disposition'][_0x87a6('0x5f')](_0x3246da[_0x87a6('0x60')]);}})[_0x87a6('0x26')](respondWithResult(_0x3b2a91,null))[_0x87a6('0x2e')](handleError(_0x3b2a91,null));};exports[_0x87a6('0x6c')]=function(_0x1b759b,_0x55f4e3,_0x24388c){var _0x4a6139={'raw':![],'where':{}};var _0x1f3611={};var _0x53a9e5={'count':0x0,'rows':[]};return db[_0x87a6('0x42')]['findOne']({'where':{'id':_0x1b759b[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x55f4e3,null))['then'](function(_0x30add7){if(_0x30add7){_0x1f3611[_0x87a6('0x46')]=_[_0x87a6('0x48')](db['Disposition'][_0x87a6('0x6d')]);_0x1f3611['query']=_['keys'](_0x1b759b[_0x87a6('0x47')]);_0x1f3611[_0x87a6('0x52')]=_['intersection'](_0x1f3611[_0x87a6('0x46')],_0x1f3611['query']);_0x4a6139[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0x1f3611[_0x87a6('0x46')],qs[_0x87a6('0x4b')](_0x1b759b[_0x87a6('0x47')]['fields']));_0x4a6139['attributes']=_0x4a6139[_0x87a6('0x4a')][_0x87a6('0x4c')]?_0x4a6139[_0x87a6('0x4a')]:_0x1f3611[_0x87a6('0x46')];if(!_0x1b759b[_0x87a6('0x47')]['hasOwnProperty'](_0x87a6('0x4e'))){_0x4a6139['limit']=qs['limit'](_0x1b759b[_0x87a6('0x47')]['limit']);_0x4a6139[_0x87a6('0x33')]=qs[_0x87a6('0x33')](_0x1b759b[_0x87a6('0x47')][_0x87a6('0x33')]);}_0x4a6139[_0x87a6('0x4f')]=qs['sort'](_0x1b759b[_0x87a6('0x47')][_0x87a6('0x50')]);_0x4a6139['where']=qs[_0x87a6('0x52')](_[_0x87a6('0x53')](_0x1b759b[_0x87a6('0x47')],_0x1f3611['filters']));_0x4a6139[_0x87a6('0x51')][_0x87a6('0x6b')]=_0x30add7['id'];if(_0x1b759b[_0x87a6('0x47')][_0x87a6('0x54')]){_0x4a6139['where']=_[_0x87a6('0x56')](_0x4a6139[_0x87a6('0x51')],{'$or':_[_0x87a6('0x41')](_0x4a6139[_0x87a6('0x4a')],function(_0x33b6e0){var _0x4da9d5={};_0x4da9d5[_0x33b6e0]={'$like':'%'+_0x1b759b['query'][_0x87a6('0x54')]+'%'};return _0x4da9d5;})});}_0x4a6139=_[_0x87a6('0x56')]({},_0x4a6139,_0x1b759b['options']);return db[_0x87a6('0x6e')]['count']({'where':_0x4a6139[_0x87a6('0x51')]})['then'](function(_0x56aa4c){_0x53a9e5[_0x87a6('0x57')]=_0x56aa4c;if(_0x1b759b[_0x87a6('0x47')][_0x87a6('0x58')]){_0x4a6139[_0x87a6('0x59')]=[{'all':!![]}];}return db[_0x87a6('0x6e')][_0x87a6('0x6f')](_0x4a6139);})['then'](function(_0x51d21a){_0x53a9e5[_0x87a6('0x5a')]=_0x51d21a;return _0x53a9e5;});}})[_0x87a6('0x26')](respondWithFilteredResult(_0x55f4e3,_0x4a6139))[_0x87a6('0x2e')](handleError(_0x55f4e3,null));};exports['removeDispositions']=function(_0x25f65f,_0x49d689,_0x2e0cf0){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x25f65f['params']['id']}})['then'](handleEntityNotFound(_0x49d689,null))[_0x87a6('0x26')](function(_0x4ebe85){if(_0x4ebe85){return _0x4ebe85['removeDispositions'](_0x25f65f[_0x87a6('0x47')]['ids']);}})[_0x87a6('0x26')](respondWithStatusCode(_0x49d689,null))[_0x87a6('0x2e')](handleError(_0x49d689,null));};exports[_0x87a6('0x70')]=function(_0x31582c,_0x46aaa5,_0x480dd3){if(_0x31582c[_0x87a6('0x60')]['id']){delete _0x31582c[_0x87a6('0x60')]['id'];}return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x31582c['params']['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x46aaa5,null))['then'](function(_0x1f7bae){if(_0x1f7bae){_0x31582c[_0x87a6('0x60')][_0x87a6('0x6b')]=_0x1f7bae['id'];return db['CannedAnswer'][_0x87a6('0x5f')](_0x31582c[_0x87a6('0x60')]);}})[_0x87a6('0x26')](respondWithResult(_0x46aaa5,null))['catch'](handleError(_0x46aaa5,null));};exports['getAnswers']=function(_0x26380b,_0x42ac0e,_0x4ee3b4){var _0x246c9f={'raw':![],'where':{}};var _0x294884={};var _0x3365ea={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x87a6('0x71')]({'where':{'id':_0x26380b[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x42ac0e,null))[_0x87a6('0x26')](function(_0x27dd9e){if(_0x27dd9e){_0x294884['model']=_[_0x87a6('0x48')](db['CannedAnswer'][_0x87a6('0x6d')]);_0x294884[_0x87a6('0x47')]=_['keys'](_0x26380b['query']);_0x294884['filters']=_[_0x87a6('0x49')](_0x294884[_0x87a6('0x46')],_0x294884['query']);_0x246c9f[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0x294884[_0x87a6('0x46')],qs['fields'](_0x26380b[_0x87a6('0x47')][_0x87a6('0x4b')]));_0x246c9f[_0x87a6('0x4a')]=_0x246c9f[_0x87a6('0x4a')]['length']?_0x246c9f['attributes']:_0x294884[_0x87a6('0x46')];if(!_0x26380b['query'][_0x87a6('0x4d')](_0x87a6('0x4e'))){_0x246c9f[_0x87a6('0x35')]=qs[_0x87a6('0x35')](_0x26380b[_0x87a6('0x47')][_0x87a6('0x35')]);_0x246c9f[_0x87a6('0x33')]=qs[_0x87a6('0x33')](_0x26380b[_0x87a6('0x47')][_0x87a6('0x33')]);}_0x246c9f[_0x87a6('0x4f')]=qs[_0x87a6('0x50')](_0x26380b[_0x87a6('0x47')][_0x87a6('0x50')]);_0x246c9f[_0x87a6('0x51')]=qs[_0x87a6('0x52')](_[_0x87a6('0x53')](_0x26380b[_0x87a6('0x47')],_0x294884[_0x87a6('0x52')]));_0x246c9f['where'][_0x87a6('0x6b')]=_0x27dd9e['id'];if(_0x26380b[_0x87a6('0x47')][_0x87a6('0x54')]){_0x246c9f['where']=_[_0x87a6('0x56')](_0x246c9f[_0x87a6('0x51')],{'$or':_[_0x87a6('0x41')](_0x246c9f[_0x87a6('0x4a')],function(_0x1e59f0){var _0x59ea04={};_0x59ea04[_0x1e59f0]={'$like':'%'+_0x26380b[_0x87a6('0x47')][_0x87a6('0x54')]+'%'};return _0x59ea04;})});}_0x246c9f=_[_0x87a6('0x56')]({},_0x246c9f,_0x26380b['options']);return db['CannedAnswer'][_0x87a6('0x57')]({'where':_0x246c9f[_0x87a6('0x51')]})[_0x87a6('0x26')](function(_0x26313a){_0x3365ea[_0x87a6('0x57')]=_0x26313a;if(_0x26380b['query'][_0x87a6('0x58')]){_0x246c9f[_0x87a6('0x59')]=[{'all':!![]}];}return db[_0x87a6('0x72')][_0x87a6('0x6f')](_0x246c9f);})[_0x87a6('0x26')](function(_0x29ded5){_0x3365ea[_0x87a6('0x5a')]=_0x29ded5;return _0x3365ea;});}})[_0x87a6('0x26')](respondWithFilteredResult(_0x42ac0e,_0x246c9f))[_0x87a6('0x2e')](handleError(_0x42ac0e,null));};exports[_0x87a6('0x73')]=function(_0x3e8be2,_0x1d7301,_0x1b75e1){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x3e8be2['params']['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x1d7301,null))['then'](function(_0x414521){if(_0x414521){return _0x414521[_0x87a6('0x73')](_0x3e8be2[_0x87a6('0x47')][_0x87a6('0x74')]);}})['then'](respondWithStatusCode(_0x1d7301,null))['catch'](handleError(_0x1d7301,null));};exports[_0x87a6('0x75')]=function(_0x38a69e,_0x4f5af4,_0x119ec7){var _0x3630d1={'body':_0x38a69e['body'],'channel':_0x87a6('0x76')};var _0x28218d=[];var _0x3f81c2=[];var _0x519fd9={};var _0x51b85c=![];return db[_0x87a6('0x77')]['describe']()[_0x87a6('0x26')](function(_0x33bcf8){if(!_0x33bcf8){throw new db[(_0x87a6('0x78'))][(_0x87a6('0x79'))](_0x87a6('0x7a'));}_0x28218d=_[_0x87a6('0x7b')](_[_0x87a6('0x48')](_0x33bcf8),[_0x87a6('0x7c'),_0x87a6('0x7d')]);_0x3f81c2=_['difference'](_[_0x87a6('0x48')](_0x33bcf8),['createdAt',_0x87a6('0x7d'),_0x87a6('0x7e'),'ListId']);if(_0x38a69e[_0x87a6('0x60')]['id']){delete _0x38a69e['body']['id'];}if(_[_0x87a6('0x7f')](_0x38a69e['body']['from'])){throw new db[(_0x87a6('0x78'))][(_0x87a6('0x79'))](_0x87a6('0x80'));}if(_['isNil'](_0x38a69e[_0x87a6('0x60')]['body'])||_0x38a69e[_0x87a6('0x60')][_0x87a6('0x60')]===''){throw new db[(_0x87a6('0x78'))][(_0x87a6('0x79'))](_0x87a6('0x81'));}if(_[_0x87a6('0x7f')](_0x38a69e['body'][_0x87a6('0x82')])){throw new db[(_0x87a6('0x78'))][(_0x87a6('0x79'))](_0x87a6('0x83')+_0x3f81c2);}if(!_[_0x87a6('0x84')](_0x3f81c2,_0x38a69e['body'][_0x87a6('0x82')])){throw new db[(_0x87a6('0x78'))][(_0x87a6('0x79'))](_0x87a6('0x85')+_0x3f81c2);}_0x519fd9[_0x38a69e[_0x87a6('0x60')][_0x87a6('0x82')]]=_0x38a69e[_0x87a6('0x60')][_0x87a6('0x86')];})[_0x87a6('0x26')](function(){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x38a69e[_0x87a6('0x5c')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x87a6('0x77')],'as':_0x87a6('0x87'),'where':_0x519fd9,'limit':0x1,'order':[[_0x87a6('0x7d'),_0x87a6('0x88')]]}]},{'model':db[_0x87a6('0x89')],'as':'Applications'}]});})[_0x87a6('0x26')](handleEntityNotFound(_0x4f5af4,null))[_0x87a6('0x26')](function(_0x3d3ae6){if(_0x3d3ae6&&_0x3d3ae6[_0x87a6('0x8a')]){_0x3630d1[_0x87a6('0x8b')]=_0x3d3ae6;_0x3630d1[_0x87a6('0x8c')]=_0x3d3ae6['Applications'];_0x3630d1['list']=_0x3d3ae6[_0x87a6('0x8a')];_0x3630d1['applications']=_[_0x87a6('0x8d')](_0x3630d1[_0x87a6('0x8c')],[_0x87a6('0x8e')],[_0x87a6('0x8f')]);if(_0x3630d1[_0x87a6('0x8b')][_0x87a6('0x90')]){delete _0x3630d1['account']['Applications'];}if(_0x3630d1['account'][_0x87a6('0x8a')]&&_0x3630d1[_0x87a6('0x8b')]['List'][_0x87a6('0x87')]['length']){return _0x3630d1['account']['List']['Contacts'][0x0];}var _0x129eb1=_['defaults'](_0x38a69e[_0x87a6('0x60')],{'firstName':_0x38a69e[_0x87a6('0x60')][_0x87a6('0x86')],'ListId':_0x3d3ae6[_0x87a6('0x91')]});_0x129eb1[_0x38a69e[_0x87a6('0x60')][_0x87a6('0x82')]]=_0x38a69e[_0x87a6('0x60')][_0x87a6('0x86')];return db[_0x87a6('0x77')]['create'](_0x129eb1,{'fields':_0x28218d,'raw':!![]});}})[_0x87a6('0x26')](handleEntityNotFound(_0x4f5af4,null))[_0x87a6('0x26')](function(_0x2e5a01){_0x3630d1[_0x87a6('0x92')]=_0x2e5a01;if(_0x2e5a01){var _0x42305f={'ContactId':_0x2e5a01['id'],'OpenchannelAccountId':_0x38a69e[_0x87a6('0x5c')]['id'],'from':(_0x2e5a01[_0x87a6('0x93')]||'')+'\x20'+(_0x2e5a01[_0x87a6('0x94')]||'')};var _0x5cf1fe={'OpenchannelAccountId':_0x38a69e[_0x87a6('0x5c')]['id'],'closed':![]};if(_0x38a69e[_0x87a6('0x60')][_0x87a6('0x95')]){_0x5cf1fe['threadId']=_0x38a69e[_0x87a6('0x60')][_0x87a6('0x95')];return db[_0x87a6('0x96')][_0x87a6('0x5e')]({'where':_0x5cf1fe})[_0x87a6('0x26')](function(_0x355f7d){if(_0x355f7d){return[_0x355f7d,![]];}_0x42305f[_0x87a6('0x95')]=_0x38a69e[_0x87a6('0x60')]['threadId'];_0x42305f[_0x87a6('0x97')]=_0x38a69e[_0x87a6('0x60')][_0x87a6('0x97')];return db['OpenchannelInteraction']['create'](_0x42305f)[_0x87a6('0x26')](function(_0xffd6ba){return[_0xffd6ba,!![]];});});}else{_0x5cf1fe[_0x87a6('0x95')]=null;}_0x5cf1fe['ContactId']=_0x2e5a01['id'];return db['OpenchannelInteraction'][_0x87a6('0x5e')]({'where':_0x5cf1fe})[_0x87a6('0x26')](function(_0x2fa8a8){if(_0x2fa8a8){return[_0x2fa8a8,![]];}return db[_0x87a6('0x96')][_0x87a6('0x5f')](_0x42305f)[_0x87a6('0x26')](function(_0x25e73e){return[_0x25e73e,!![]];});});}})[_0x87a6('0x98')](function(_0x52a8b2,_0x10283e){if(_0x52a8b2){_0x51b85c=_0x10283e;if(!_0x10283e){var _0x38947e={'from':(_0x3630d1[_0x87a6('0x92')][_0x87a6('0x93')]||'')+'\x20'+(_0x3630d1[_0x87a6('0x92')][_0x87a6('0x94')]||'')};if(_0x38a69e['body']['threadId']&&_0x38a69e[_0x87a6('0x60')]['messageId']&&_0x38a69e[_0x87a6('0x60')][_0x87a6('0x95')]!=_0x38a69e[_0x87a6('0x60')]['messageId']){_0x38947e[_0x87a6('0x95')]=_0x38a69e['body'][_0x87a6('0x99')];}return _0x52a8b2[_0x87a6('0x68')](_0x38947e);}else{return _0x52a8b2;}}})[_0x87a6('0x26')](function(_0x1b0c0d){_0x3630d1[_0x87a6('0x9a')]=_0x1b0c0d[_0x87a6('0x3b')]({'plain':!![]});_0x3630d1['interaction'][_0x87a6('0x9b')]=_0x51b85c;if(_0x3630d1[_0x87a6('0x9a')][_0x87a6('0x9b')]){if(_0x3630d1[_0x87a6('0x8b')]['autoclose']){_0x3630d1[_0x87a6('0x8c')][_0x87a6('0x9c')]({'id':0x0,'priority':_0x3630d1[_0x87a6('0x8c')][_0x87a6('0x4c')]+0x1,'app':_0x87a6('0x9d'),'appdata':_0x87a6('0x9e'),'interval':_0x87a6('0x9f')});}}return db[_0x87a6('0xa0')]['create']({'body':_0x38a69e['body'][_0x87a6('0x60')],'OpenchannelAccountId':_0x38a69e[_0x87a6('0x5c')]['id'],'OpenchannelInteractionId':_0x1b0c0d['id'],'direction':'in','ContactId':_0x3630d1['contact']['id'],'AttachmentId':_0x38a69e[_0x87a6('0x60')][_0x87a6('0xa1')]});})[_0x87a6('0x26')](function(_0x94f0d3){_0x3630d1[_0x87a6('0x2d')]=_0x94f0d3;if(_0x3630d1[_0x87a6('0x9a')][_0x87a6('0xa2')]){return db[_0x87a6('0xa3')][_0x87a6('0x5e')]({'attributes':['id',_0x87a6('0x3d')],'where':{'id':_0x3630d1[_0x87a6('0x9a')][_0x87a6('0xa2')]}})[_0x87a6('0x26')](function(_0x3b6e53){if(_0x3b6e53){_0x3630d1[_0x87a6('0x8c')][_0x87a6('0xa4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b6e53[_0x87a6('0x3d')]+','+(_0x3630d1[_0x87a6('0x8b')]['waitForTheAssignedAgent']||0xa),'interval':_0x87a6('0x9f')});_0x3630d1[_0x87a6('0xa5')]=![];}return respondWithRpcPromise(_0x87a6('0xa6'),_0x87a6('0xa7'),_0x3630d1);});}return respondWithRpcPromise(_0x87a6('0xa6'),'startRouting',_0x3630d1);})[_0x87a6('0x26')](function(_0x5c3477){respondWithRpcPromise(_0x87a6('0xa8'),_0x87a6('0xa8'),{'event':_0x87a6('0x75'),'message':_0x5c3477},client9002);return _0x5c3477;})['then'](respondWithResult(_0x4f5af4,null))['catch'](handleError(_0x4f5af4,null));};exports[_0x87a6('0xa9')]=function(_0xd0e5,_0x13c4ea){var _0x517f95=_0xd0e5[_0x87a6('0x5c')]['id'];var _0x42d615=_0xd0e5[_0x87a6('0x60')];var _0x4f78b4=0xc8;var _0x4c1afd=null;return db[_0x87a6('0xaa')][_0x87a6('0xab')]({'isolationLevel':db[_0x87a6('0xaa')][_0x87a6('0xac')][_0x87a6('0xad')][_0x87a6('0xae')]},function(_0x1b6248){return db[_0x87a6('0x42')][_0x87a6('0x71')]({'where':{'id':_0x517f95},'transaction':_0x1b6248})[_0x87a6('0x26')](function(_0x1dc7b2){if(_0x1dc7b2){return db[_0x87a6('0x89')][_0x87a6('0x3a')]({'where':{'OpenchannelAccountId':_0x517f95},'transaction':_0x1b6248})['then'](function(){var _0x41763e=_['map'](_0x42d615,function(_0x435aa1){_0x435aa1[_0x87a6('0x6b')]=_0x517f95;return _0x435aa1;});return db[_0x87a6('0x89')][_0x87a6('0xaf')](_0x41763e,{'transaction':_0x1b6248});});}else{_0x4f78b4=0x194;_0x4c1afd=[];}});})[_0x87a6('0x26')](function(){if(_0x4f78b4!==0x194){return db[_0x87a6('0x89')][_0x87a6('0xb0')]({'where':{'OpenchannelAccountId':_0x517f95},'order':'priority'})[_0x87a6('0x26')](function(_0x2ee548){_0x4c1afd=_0x2ee548;});}})[_0x87a6('0x2e')](function(_0x446bff){_0x4f78b4=0x1f4;logger['error'](_0x446bff[_0x87a6('0xb1')]);if(_0x446bff[_0x87a6('0x3d')]){delete _0x446bff[_0x87a6('0x3d')];}_0x4c1afd=_0x446bff;})[_0x87a6('0xb2')](function(){if(_0x4c1afd===null){_0x13c4ea[_0x87a6('0x2f')](_0x4f78b4);}else{if(_0x4f78b4===0x1f4){_0x13c4ea['status'](_0x4f78b4)[_0x87a6('0x3e')](_0x4c1afd);}else{_0x13c4ea[_0x87a6('0x30')](_0x4f78b4)[_0x87a6('0x32')](_0x4c1afd);}}});};exports[_0x87a6('0xb3')]=function(_0x4ecdb9,_0x4a8432,_0xb5c883){var _0x54769a={};var _0x16c59f={};var _0xc5f90d;var _0x4c3ac5;return db[_0x87a6('0x42')][_0x87a6('0x71')]({'where':{'id':_0x4ecdb9[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x4a8432,null))['then'](function(_0x5d512e){if(_0x5d512e){_0xc5f90d=_0x5d512e;_0x16c59f[_0x87a6('0x46')]=_[_0x87a6('0x48')](db[_0x87a6('0x89')][_0x87a6('0x6d')]);_0x16c59f[_0x87a6('0x47')]=_[_0x87a6('0x48')](_0x4ecdb9['query']);_0x16c59f[_0x87a6('0x52')]=_['intersection'](_0x16c59f[_0x87a6('0x46')],_0x16c59f[_0x87a6('0x47')]);_0x54769a[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0x16c59f[_0x87a6('0x46')],qs['fields'](_0x4ecdb9[_0x87a6('0x47')]['fields']));_0x54769a[_0x87a6('0x4a')]=_0x54769a['attributes'][_0x87a6('0x4c')]?_0x54769a['attributes']:_0x16c59f[_0x87a6('0x46')];_0x54769a[_0x87a6('0x4f')]=qs[_0x87a6('0x50')](_0x4ecdb9[_0x87a6('0x47')][_0x87a6('0x50')]);_0x54769a['where']=qs[_0x87a6('0x52')](_[_0x87a6('0x53')](_0x4ecdb9[_0x87a6('0x47')],_0x16c59f['filters']));if(_0x4ecdb9['query'][_0x87a6('0x54')]){_0x54769a[_0x87a6('0x51')]=_[_0x87a6('0x56')](_0x54769a['where'],{'$or':_[_0x87a6('0x41')](_0x54769a[_0x87a6('0x4a')],function(_0x1a93f2){var _0x5953c1={};_0x5953c1[_0x1a93f2]={'$like':'%'+_0x4ecdb9[_0x87a6('0x47')]['filter']+'%'};return _0x5953c1;})});}_0x54769a=_[_0x87a6('0x56')]({},_0x54769a,_0x4ecdb9[_0x87a6('0xb4')]);return _0xc5f90d['getApplications'](_0x54769a);}})[_0x87a6('0x26')](function(_0x32b862){if(_0x32b862){_0x4c3ac5=_0x32b862['length'];if(!_0x4ecdb9[_0x87a6('0x47')][_0x87a6('0x4d')](_0x87a6('0x4e'))){_0x54769a[_0x87a6('0x35')]=qs[_0x87a6('0x35')](_0x4ecdb9[_0x87a6('0x47')]['limit']);_0x54769a[_0x87a6('0x33')]=qs[_0x87a6('0x33')](_0x4ecdb9['query'][_0x87a6('0x33')]);}return _0xc5f90d[_0x87a6('0xb3')](_0x54769a);}})[_0x87a6('0x26')](function(_0x5d32a0){if(_0x5d32a0){return _0x5d32a0?{'count':_0x4c3ac5,'rows':_0x5d32a0}:null;}})['then'](respondWithResult(_0x4a8432,null))['catch'](handleError(_0x4a8432,null));};exports[_0x87a6('0xb5')]=function(_0x37571e,_0x22c5a2,_0x333fa0){var _0x37475c={'raw':![],'where':{}};var _0xfa59ef={};var _0x2609ad={'count':0x0,'rows':[]};return db[_0x87a6('0x42')][_0x87a6('0x71')]({'where':{'id':_0x37571e[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x22c5a2,null))[_0x87a6('0x26')](function(_0x29383b){if(_0x29383b){_0xfa59ef[_0x87a6('0x46')]=_[_0x87a6('0x48')](db['OpenchannelInteraction'][_0x87a6('0x6d')]);_0xfa59ef[_0x87a6('0x47')]=_[_0x87a6('0x48')](_0x37571e[_0x87a6('0x47')]);_0xfa59ef['filters']=_[_0x87a6('0x49')](_0xfa59ef[_0x87a6('0x46')],_0xfa59ef[_0x87a6('0x47')]);_0x37475c[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0xfa59ef[_0x87a6('0x46')],qs[_0x87a6('0x4b')](_0x37571e[_0x87a6('0x47')]['fields']));_0x37475c[_0x87a6('0x4a')]=_0x37475c[_0x87a6('0x4a')][_0x87a6('0x4c')]?_0x37475c[_0x87a6('0x4a')]:_0xfa59ef['model'];if(!_0x37571e['query'][_0x87a6('0x4d')](_0x87a6('0x4e'))){_0x37475c[_0x87a6('0x35')]=qs['limit'](_0x37571e[_0x87a6('0x47')]['limit']);_0x37475c['offset']=qs[_0x87a6('0x33')](_0x37571e['query'][_0x87a6('0x33')]);}_0x37475c[_0x87a6('0x4f')]=qs[_0x87a6('0x50')](_0x37571e['query'][_0x87a6('0x50')]);_0x37475c['where']=qs['filters'](_[_0x87a6('0x53')](_0x37571e[_0x87a6('0x47')],_0xfa59ef[_0x87a6('0x52')]));_0x37475c[_0x87a6('0x51')][_0x87a6('0x6b')]=_0x29383b['id'];if(_0x37571e[_0x87a6('0x47')][_0x87a6('0x54')]){_0x37475c[_0x87a6('0x51')]=_['merge'](_0x37475c['where'],{'$or':_[_0x87a6('0x41')](_0x37475c['attributes'],function(_0x34b3f4){var _0x88638c={};_0x88638c[_0x34b3f4]={'$like':'%'+_0x37571e['query'][_0x87a6('0x54')]+'%'};return _0x88638c;})});}_0x37475c=_[_0x87a6('0x56')]({},_0x37475c,_0x37571e[_0x87a6('0xb4')]);return db['OpenchannelInteraction']['count']({'where':_0x37475c[_0x87a6('0x51')]})[_0x87a6('0x26')](function(_0x2c0a36){_0x2609ad[_0x87a6('0x57')]=_0x2c0a36;if(_0x37571e[_0x87a6('0x47')]['includeAll']){_0x37475c['include']=[{'model':db['CmContact'],'as':_0x87a6('0xb6'),'required':![]},{'model':db[_0x87a6('0xa3')],'as':_0x87a6('0xb7'),'attributes':[_0x87a6('0x3d'),_0x87a6('0xb8'),_0x87a6('0xb9')],'required':![]},{'model':db[_0x87a6('0xba')],'as':_0x87a6('0xbb'),'attributes':['id',_0x87a6('0x3d'),_0x87a6('0xbc')],'where':_0x37571e[_0x87a6('0x47')][_0x87a6('0xbd')]?{'id':_0x37571e[_0x87a6('0x47')][_0x87a6('0xbd')]}:undefined,'required':_0x37571e[_0x87a6('0x47')][_0x87a6('0xbd')]?!![]:![]}];}return db[_0x87a6('0x96')][_0x87a6('0x6f')](_0x37475c);})[_0x87a6('0x26')](function(_0x1a68f7){_0x2609ad[_0x87a6('0x5a')]=_0x1a68f7;return _0x2609ad;});}})['then'](respondWithFilteredResult(_0x22c5a2,_0x37475c))[_0x87a6('0x2e')](handleError(_0x22c5a2,null));};exports[_0x87a6('0xbe')]=function(_0x25d67b,_0x20e42a,_0x5db0d0){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x25d67b[_0x87a6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x20e42a,null))[_0x87a6('0x26')](function(_0x994c11){if(_0x994c11){return _0x994c11[_0x87a6('0xbe')](_0x25d67b['body'][_0x87a6('0x74')],_[_0x87a6('0xbf')](_0x25d67b[_0x87a6('0x60')],[_0x87a6('0x74'),'id'])||{})[_0x87a6('0x98')](function(_0x339b5c){for(var _0x2a54aa=0x0;_0x2a54aa<_0x25d67b[_0x87a6('0x60')][_0x87a6('0x74')][_0x87a6('0x4c')];_0x2a54aa+=0x1){socket[_0x87a6('0xc0')](_0x87a6('0xc1'),{'UserId':Number(_0x25d67b[_0x87a6('0x60')][_0x87a6('0x74')][_0x2a54aa]),'OpenchannelAccountId':Number(_0x25d67b[_0x87a6('0x5c')]['id'])});}return _0x339b5c;});}})[_0x87a6('0x26')](respondWithResult(_0x20e42a,null))[_0x87a6('0x2e')](handleError(_0x20e42a,null));};exports[_0x87a6('0xc2')]=function(_0x2e0947,_0x38ad4f,_0x13e624){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x2e0947[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x38ad4f,null))[_0x87a6('0x26')](function(_0x280fb3){if(_0x280fb3){return _0x280fb3[_0x87a6('0xc2')](_0x2e0947[_0x87a6('0x47')][_0x87a6('0x74')])[_0x87a6('0x26')](function(){if(_[_0x87a6('0xc3')](_0x2e0947['query'][_0x87a6('0x74')])){for(var _0x3f4ceb=0x0;_0x3f4ceb<_0x2e0947[_0x87a6('0x47')][_0x87a6('0x74')][_0x87a6('0x4c')];_0x3f4ceb+=0x1){socket[_0x87a6('0xc0')](_0x87a6('0xc4'),{'UserId':Number(_0x2e0947[_0x87a6('0x47')][_0x87a6('0x74')][_0x3f4ceb]),'OpenchannelAccountId':Number(_0x2e0947[_0x87a6('0x5c')]['id'])});}}else{socket[_0x87a6('0xc0')](_0x87a6('0xc4'),{'UserId':Number(_0x2e0947[_0x87a6('0x47')]['ids']),'OpenchannelAccountId':Number(_0x2e0947['params']['id'])});}});}})[_0x87a6('0x26')](respondWithStatusCode(_0x38ad4f,null))['catch'](handleError(_0x38ad4f,null));};exports[_0x87a6('0xc5')]=function(_0x375828,_0x248da8,_0x647c11){var _0x1cb7a6={};var _0x287b4e={};var _0x4238e5;var _0x1243fd;return db['OpenchannelAccount'][_0x87a6('0x71')]({'where':{'id':_0x375828[_0x87a6('0x5c')]['id']}})[_0x87a6('0x26')](handleEntityNotFound(_0x248da8,null))['then'](function(_0x44a9de){if(_0x44a9de){_0x4238e5=_0x44a9de;_0x287b4e['model']=_[_0x87a6('0x48')](db['User'][_0x87a6('0x6d')]);_0x287b4e[_0x87a6('0x47')]=_[_0x87a6('0x48')](_0x375828[_0x87a6('0x47')]);_0x287b4e['filters']=_[_0x87a6('0x49')](_0x287b4e[_0x87a6('0x46')],_0x287b4e[_0x87a6('0x47')]);_0x1cb7a6[_0x87a6('0x4a')]=_[_0x87a6('0x49')](_0x287b4e[_0x87a6('0x46')],qs[_0x87a6('0x4b')](_0x375828[_0x87a6('0x47')][_0x87a6('0x4b')]));_0x1cb7a6[_0x87a6('0x4a')]=_0x1cb7a6[_0x87a6('0x4a')][_0x87a6('0x4c')]?_0x1cb7a6['attributes']:_0x287b4e['model'];_0x1cb7a6[_0x87a6('0x4f')]=qs[_0x87a6('0x50')](_0x375828[_0x87a6('0x47')]['sort']);_0x1cb7a6[_0x87a6('0x51')]=qs[_0x87a6('0x52')](_[_0x87a6('0x53')](_0x375828[_0x87a6('0x47')],_0x287b4e[_0x87a6('0x52')]));if(_0x375828[_0x87a6('0x47')][_0x87a6('0x54')]){_0x1cb7a6[_0x87a6('0x51')]=_['merge'](_0x1cb7a6[_0x87a6('0x51')],{'$or':_['map'](_0x1cb7a6[_0x87a6('0x4a')],function(_0x32bfe1){var _0x33e99f={};_0x33e99f[_0x32bfe1]={'$like':'%'+_0x375828[_0x87a6('0x47')][_0x87a6('0x54')]+'%'};return _0x33e99f;})});}_0x1cb7a6=_['merge']({},_0x1cb7a6,_0x375828[_0x87a6('0xb4')]);return _0x4238e5['getAgents'](_0x1cb7a6);}})[_0x87a6('0x26')](function(_0x25be5c){if(_0x25be5c){_0x1243fd=_0x25be5c['length'];if(!_0x375828['query'][_0x87a6('0x4d')](_0x87a6('0x4e'))){_0x1cb7a6['limit']=qs[_0x87a6('0x35')](_0x375828[_0x87a6('0x47')][_0x87a6('0x35')]);_0x1cb7a6[_0x87a6('0x33')]=qs[_0x87a6('0x33')](_0x375828[_0x87a6('0x47')][_0x87a6('0x33')]);}return _0x4238e5[_0x87a6('0xc5')](_0x1cb7a6);}})['then'](function(_0x215d56){if(_0x215d56){return _0x215d56?{'count':_0x1243fd,'rows':_0x215d56}:null;}})[_0x87a6('0x26')](respondWithResult(_0x248da8,null))['catch'](handleError(_0x248da8,null));};exports[_0x87a6('0x3e')]=function(_0x27e4d8,_0x2e7f30,_0x23766a){var _0x4c0b15,_0x598521,_0xad4fb8;if(_['isNil'](_0x27e4d8[_0x87a6('0x60')][_0x87a6('0x60')])||_0x27e4d8[_0x87a6('0x60')]['body']===''){throw new db[(_0x87a6('0x78'))][(_0x87a6('0x79'))](_0x87a6('0x81'));}if(_[_0x87a6('0x7f')](_0x27e4d8['body']['to'])){}_0x4c0b15=_0x27e4d8['body']['to'];return db[_0x87a6('0x42')]['findOne']({'where':{'id':_0x27e4d8['params']['id']}})['then'](handleEntityNotFound(_0x2e7f30,null))['then'](function(_0x435e4e){if(_0x435e4e){return db[_0x87a6('0x42')][_0x87a6('0x5e')]({'where':{'id':_0x435e4e['id']},'include':[{'model':db[_0x87a6('0xc6')],'as':_0x87a6('0x8a'),'include':[{'model':db[_0x87a6('0x77')],'as':_0x87a6('0x87'),'where':{[_0x435e4e[_0x87a6('0x82')]]:_0x4c0b15},'limit':0x1,'order':[['updatedAt',_0x87a6('0x88')]]}]}]})[_0x87a6('0x26')](handleEntityNotFound(_0x2e7f30,null))[_0x87a6('0x26')](function(_0x1a87e4){if(_0x1a87e4&&_0x1a87e4[_0x87a6('0x8a')]){_0x598521=_0x1a87e4['get']({'plain':!![]});if(_0x598521['List']&&_0x598521[_0x87a6('0x8a')][_0x87a6('0x87')][_0x87a6('0x4c')]){return _0x598521[_0x87a6('0x8a')][_0x87a6('0x87')][0x0];}return db['CmContact'][_0x87a6('0x5f')](_[_0x87a6('0x1e')](_0x27e4d8['body'],{'firstName':_0x4c0b15,[_0x1a87e4[_0x87a6('0x82')]]:_0x4c0b15,'phone':_0x4c0b15,'ListId':_0x598521[_0x87a6('0x91')]}));}})[_0x87a6('0x26')](handleEntityNotFound(_0x2e7f30,null))['then'](function(_0x201321){if(_0x201321){_0xad4fb8=_0x201321;return db['OpenchannelInteraction'][_0x87a6('0x5e')]({'where':{'ContactId':_0xad4fb8['id'],'closed':![],'OpenchannelAccountId':_0x598521['id']}})[_0x87a6('0x26')](function(_0x227063){if(_0x227063){return[_0x227063,![]];}return db[_0x87a6('0x96')]['create']({'UserId':_0x27e4d8[_0x87a6('0x61')]['id'],'ContactId':_0xad4fb8['id'],'OpenchannelAccountId':_0x598521['id'],'lastMsgDirection':_0x87a6('0xc7'),'Messages':[_[_0x87a6('0x56')](_0x27e4d8[_0x87a6('0x60')],{'read':![],'body':_0x27e4d8[_0x87a6('0x60')][_0x87a6('0x60')],'OpenchannelAccountId':_0x598521['id'],'UserId':_0x27e4d8[_0x87a6('0x61')]['id'],'ContactId':_0xad4fb8['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x87a6('0xc8')}]})['then'](function(_0x2fe9f5){return[_0x2fe9f5,!![]];});});}})['spread'](function(_0x485941,_0x1cc5c7){if(_0x1cc5c7){return _0x485941;}return db[_0x87a6('0xa0')][_0x87a6('0x5f')](_['merge'](_0x27e4d8[_0x87a6('0x60')],{'read':![],'body':_0x27e4d8['body']['body'],'OpenchannelAccountId':_0x598521['id'],'OpenchannelInteractionId':_0x485941['id'],'UserId':_0x27e4d8[_0x87a6('0x61')]['id'],'ContactId':_0xad4fb8['id']}))['then'](function(_0x1db2c2){_0x485941[_0x87a6('0xc9')][_0x87a6('0xc8')]=[];_0x485941['dataValues']['Messages']['push'](_0x1db2c2[_0x87a6('0xc9')]);return _0x485941;});});}})[_0x87a6('0x26')](respondWithResult(_0x2e7f30,null))[_0x87a6('0x2e')](handleError(_0x2e7f30,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 82aca93..add697e 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 _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x22fb,0x192));var _0xb22f=function(_0x2e8107,_0x5edd0c){_0x2e8107=_0x2e8107-0x0;var _0x2027ce=_0x22fb[_0x2e8107];return _0x2027ce;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb22f('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb22f('0x1'),'afterUpdate':_0xb22f('0x2'),'afterDestroy':_0xb22f('0x3')};function emitEvent(_0x10d2c4){return function(_0x201512,_0x50cdab,_0x44717d){OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4+':'+_0x201512['id'],_0x201512);OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4,_0x201512);_0x44717d(null);};}for(var e in events){if(events[_0xb22f('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb22f('0x6')](e,emitEvent(event));}}module[_0xb22f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x2d92e7,_0xb16f8c){var _0x467b42=function(_0x22f926){while(--_0x22f926){_0x2d92e7['push'](_0x2d92e7['shift']());}};_0x467b42(++_0xb16f8c);}(_0x1339,0x1ed));var _0x9133=function(_0x228134,_0x3be2fa){_0x228134=_0x228134-0x0;var _0x88e326=_0x1339[_0x228134];return _0x88e326;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 4df39df..6f86c93 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(_0x32ca34,_0x1bb8c6){var _0x23e3fb=function(_0x3e705d){while(--_0x3e705d){_0x32ca34['push'](_0x32ca34['shift']());}};_0x23e3fb(++_0x1bb8c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x36b969,_0xb8b479){var _0x6678e6=function(_0x13f763){while(--_0x13f763){_0x36b969['push'](_0x36b969['shift']());}};_0x6678e6(++_0xb8b479);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 fac4887..2f7575e 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 _0x4e81=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4e81,0x1bc));var _0x14e8=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4e81[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x14e8('0x9')]=_[_0x14e8('0xa')](config[_0x14e8('0x9')],{'host':_0x14e8('0xb'),'port':0x18eb});var socket=require(_0x14e8('0xc'))(new Redis(config[_0x14e8('0x9')]));require(_0x14e8('0xd'))[_0x14e8('0xe')](socket);function respondWithRpcPromise(_0x294b39,_0x5602cc,_0xbd3b87){return new BPromise(function(_0x3c6bdd,_0x43bfcd){return client[_0x14e8('0xf')](_0x294b39,_0xbd3b87)[_0x14e8('0x10')](function(_0x3ce648){logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,'request\x20sent');logger[_0x14e8('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5602cc,_0x14e8('0x14'),JSON[_0x14e8('0x15')](_0x3ce648));if(_0x3ce648[_0x14e8('0x16')]){if(_0x3ce648['error'][_0x14e8('0x17')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x5602cc,_0x3ce648['error'][_0x14e8('0x18')]);return _0x43bfcd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}logger[_0x14e8('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5602cc,_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);return _0x3c6bdd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}else{logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,_0x14e8('0x14'));_0x3c6bdd(_0x3ce648[_0x14e8('0x19')]['message']);}})[_0x14e8('0x1a')](function(_0x233cd8){logger[_0x14e8('0x16')](_0x14e8('0x12'),_0x5602cc,_0x233cd8);_0x43bfcd(_0x233cd8);});});} \ No newline at end of file +var _0x44a3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4f06b6,_0x2cc180){var _0x1aee24=function(_0x4c2ca6){while(--_0x4c2ca6){_0x4f06b6['push'](_0x4f06b6['shift']());}};_0x1aee24(++_0x2cc180);}(_0x44a3,0x1a9));var _0x344a=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0x44a3[_0x5be8cc];return _0x5f1b7e;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x344a('0xd'))(new Redis(config[_0x344a('0xe')]));require(_0x344a('0xf'))[_0x344a('0x10')](socket);function respondWithRpcPromise(_0x2afc37,_0x54288d,_0x6e04a9){return new BPromise(function(_0x13588c,_0x559406){return client[_0x344a('0x11')](_0x2afc37,_0x6e04a9)['then'](function(_0x397476){logger['info'](_0x344a('0x12'),_0x54288d,_0x344a('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x54288d,_0x344a('0x13'),JSON[_0x344a('0x14')](_0x397476));if(_0x397476[_0x344a('0x15')]){if(_0x397476[_0x344a('0x15')][_0x344a('0x16')]===0x1f4){logger[_0x344a('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x54288d,_0x397476[_0x344a('0x15')][_0x344a('0x17')]);return _0x559406(_0x397476[_0x344a('0x15')][_0x344a('0x17')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x54288d,_0x397476[_0x344a('0x15')][_0x344a('0x17')]);return _0x13588c(_0x397476[_0x344a('0x15')][_0x344a('0x17')]);}else{logger['info'](_0x344a('0x12'),_0x54288d,_0x344a('0x13'));_0x13588c(_0x397476['result'][_0x344a('0x17')]);}})[_0x344a('0x18')](function(_0x3e936c){logger[_0x344a('0x15')](_0x344a('0x12'),_0x54288d,_0x3e936c);_0x559406(_0x3e936c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index fa4da7b..fefc81f 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 _0x35a9=['register','length','openchannelAccount:','save','remove','update','emit','removeListener'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x35a9,0x73));var _0x935a=function(_0xd5f218,_0x5e0c7b){_0xd5f218=_0xd5f218-0x0;var _0x2bb114=_0x35a9[_0xd5f218];return _0x2bb114;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x935a('0x0'),_0x935a('0x1'),_0x935a('0x2')];function createListener(_0x27befc,_0x50d208){return function(_0x495439){_0x50d208[_0x935a('0x3')](_0x27befc,_0x495439);};}function removeListener(_0x5f5170,_0x33ac0a){return function(){OpenchannelAccountEvents[_0x935a('0x4')](_0x5f5170,_0x33ac0a);};}exports[_0x935a('0x5')]=function(_0x45994c){for(var _0x28970b=0x0,_0xca82cf=events[_0x935a('0x6')];_0x28970b<_0xca82cf;_0x28970b++){var _0x16a5c2=events[_0x28970b];var _0x534830=createListener(_0x935a('0x7')+_0x16a5c2,_0x45994c);OpenchannelAccountEvents['on'](_0x16a5c2,_0x534830);}}; \ No newline at end of file +var _0x97a2=['remove','update','emit','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x574db4,_0x50d15a){var _0x310b28=function(_0x4165bd){while(--_0x4165bd){_0x574db4['push'](_0x574db4['shift']());}};_0x310b28(++_0x50d15a);}(_0x97a2,0x1b1));var _0x297a=function(_0x3fc5e7,_0x3883a7){_0x3fc5e7=_0x3fc5e7-0x0;var _0x35c2dc=_0x97a2[_0x3fc5e7];return _0x35c2dc;};'use strict';var OpenchannelAccountEvents=require(_0x297a('0x0'));var events=['save',_0x297a('0x1'),_0x297a('0x2')];function createListener(_0x25fc7c,_0xfb9aa2){return function(_0x14d6d3){_0xfb9aa2[_0x297a('0x3')](_0x25fc7c,_0x14d6d3);};}function removeListener(_0x2cf730,_0x42a0a0){return function(){OpenchannelAccountEvents['removeListener'](_0x2cf730,_0x42a0a0);};}exports[_0x297a('0x4')]=function(_0x2a420b){for(var _0x2c1f41=0x0,_0x8cbc92=events[_0x297a('0x5')];_0x2c1f41<_0x8cbc92;_0x2c1f41++){var _0x3d9c6a=events[_0x2c1f41];var _0x5ab57b=createListener(_0x297a('0x6')+_0x3d9c6a,_0x2a420b);OpenchannelAccountEvents['on'](_0x3d9c6a,_0x5ab57b);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c5bb0cd..65c5edd 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 _0xb4e1=['util','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x254b7d,_0x13c2f1){var _0x5c6ece=function(_0x1bb506){while(--_0x1bb506){_0x254b7d['push'](_0x254b7d['shift']());}};_0x5c6ece(++_0x13c2f1);}(_0xb4e1,0x164));var _0x1b4e=function(_0xc2e888,_0x494185){_0xc2e888=_0xc2e888-0x0;var _0x20cedc=_0xb4e1[_0xc2e888];return _0x20cedc;};'use strict';var multer=require(_0x1b4e('0x0'));var util=require(_0x1b4e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1b4e('0x2'));var router=express['Router']();var fs_extra=require(_0x1b4e('0x3'));var auth=require(_0x1b4e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b4e('0x5'));var controller=require(_0x1b4e('0x6'));router[_0x1b4e('0x7')]('/',auth[_0x1b4e('0x8')](),controller['index']);router['get']('/:id',auth[_0x1b4e('0x8')](),controller[_0x1b4e('0x9')]);router[_0x1b4e('0xa')]('/',auth[_0x1b4e('0x8')](),controller[_0x1b4e('0xb')]);router[_0x1b4e('0xc')](_0x1b4e('0xd'),auth[_0x1b4e('0x8')](),controller['update']);router[_0x1b4e('0xe')]('/:id',auth[_0x1b4e('0x8')](),controller[_0x1b4e('0xf')]);module[_0x1b4e('0x10')]=router; \ No newline at end of file +var _0x4409=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','post'];(function(_0x4a47a3,_0x4a6cf1){var _0x3a9702=function(_0x38afa9){while(--_0x38afa9){_0x4a47a3['push'](_0x4a47a3['shift']());}};_0x3a9702(++_0x4a6cf1);}(_0x4409,0x16e));var _0x9440=function(_0x3029bc,_0x4f6bb4){_0x3029bc=_0x3029bc-0x0;var _0x847f3a=_0x4409[_0x3029bc];return _0x847f3a;};'use strict';var multer=require('multer');var util=require(_0x9440('0x0'));var path=require(_0x9440('0x1'));var timeout=require(_0x9440('0x2'));var express=require(_0x9440('0x3'));var router=express[_0x9440('0x4')]();var fs_extra=require(_0x9440('0x5'));var auth=require(_0x9440('0x6'));var interaction=require(_0x9440('0x7'));var config=require(_0x9440('0x8'));var controller=require(_0x9440('0x9'));router[_0x9440('0xa')]('/',auth[_0x9440('0xb')](),controller['index']);router['get'](_0x9440('0xc'),auth[_0x9440('0xb')](),controller['show']);router[_0x9440('0xd')]('/',auth[_0x9440('0xb')](),controller[_0x9440('0xe')]);router[_0x9440('0xf')]('/:id',auth[_0x9440('0xb')](),controller[_0x9440('0x10')]);router['delete'](_0x9440('0xc'),auth[_0x9440('0xb')](),controller[_0x9440('0x11')]);module[_0x9440('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c3968bd..370fa0e 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 _0x4a12=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xcf8adf,_0x574dcf){var _0x4bf283=function(_0x7f975f){while(--_0x7f975f){_0xcf8adf['push'](_0xcf8adf['shift']());}};_0x4bf283(++_0x574dcf);}(_0x4a12,0x97));var _0x24a1=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0x4a12[_0x4cd4e4];return _0x18cf3b;};'use strict';var Sequelize=require(_0x24a1('0x0'));module[_0x24a1('0x1')]={'priority':{'type':Sequelize[_0x24a1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x24a1('0x3')},'appdata':{'type':Sequelize[_0x24a1('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x24a1('0x5')],'defaultValue':_0x24a1('0x6')}}; \ No newline at end of file +var _0x39da=['noop','INTEGER','STRING'];(function(_0x70cf13,_0x5a64b1){var _0x58510c=function(_0x3155d1){while(--_0x3155d1){_0x70cf13['push'](_0x70cf13['shift']());}};_0x58510c(++_0x5a64b1);}(_0x39da,0x88));var _0xa39d=function(_0x299dc3,_0x7dcb8c){_0x299dc3=_0x299dc3-0x0;var _0x49530d=_0x39da[_0x299dc3];return _0x49530d;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xa39d('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xa39d('0x1')],'allowNull':![],'defaultValue':_0xa39d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa39d('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b3687f4..8ef1143 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 _0xd169=['count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','name','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined'];(function(_0x40bc96,_0x34eb43){var _0x1f4c23=function(_0x541648){while(--_0x541648){_0x40bc96['push'](_0x40bc96['shift']());}};_0x1f4c23(++_0x34eb43);}(_0xd169,0x155));var _0x9d16=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xd169[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0x9d16('0x0'));var rimraf=require(_0x9d16('0x1'));var zipdir=require(_0x9d16('0x2'));var jsonpatch=require(_0x9d16('0x3'));var rp=require(_0x9d16('0x4'));var moment=require(_0x9d16('0x5'));var BPromise=require(_0x9d16('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9d16('0x7'));var fs=require('fs');var fs_extra=require(_0x9d16('0x8'));var _=require(_0x9d16('0x9'));var squel=require(_0x9d16('0xa'));var crypto=require(_0x9d16('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9d16('0xc'));var toCsv=require(_0x9d16('0xd'));var querystring=require(_0x9d16('0xe'));var Papa=require(_0x9d16('0xf'));var Redis=require(_0x9d16('0x10'));var authService=require(_0x9d16('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d16('0x12'));var hardwareService=require(_0x9d16('0x13'));var logger=require('../../config/logger')(_0x9d16('0x14'));var utils=require(_0x9d16('0x15'));var config=require(_0x9d16('0x16'));var licenseUtil=require(_0x9d16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52abbc,_0x44e9df){_0x44e9df=_0x44e9df||0xcc;return function(_0x227de1){if(_0x227de1){return _0x52abbc['sendStatus'](_0x44e9df);}return _0x52abbc[_0x9d16('0x18')](_0x44e9df)[_0x9d16('0x19')]();};}function respondWithResult(_0x3465a2,_0x2c9741){_0x2c9741=_0x2c9741||0xc8;return function(_0x38ab5e){if(_0x38ab5e){return _0x3465a2[_0x9d16('0x18')](_0x2c9741)[_0x9d16('0x1a')](_0x38ab5e);}};}function respondWithFilteredResult(_0xffccdc,_0x2fbcb7){return function(_0x73575a){if(_0x73575a){var _0x4fd02f=typeof _0x2fbcb7[_0x9d16('0x1b')]==='undefined'&&typeof _0x2fbcb7['limit']===_0x9d16('0x1c');var _0x51d1e9=_0x73575a[_0x9d16('0x1d')];var _0x39c35d=_0x4fd02f?0x0:_0x2fbcb7[_0x9d16('0x1b')];var _0x409ef6=_0x4fd02f?_0x73575a[_0x9d16('0x1d')]:_0x2fbcb7[_0x9d16('0x1b')]+_0x2fbcb7[_0x9d16('0x1e')];var _0x479d1b;if(_0x409ef6>=_0x51d1e9){_0x409ef6=_0x51d1e9;_0x479d1b=0xc8;}else{_0x479d1b=0xce;}_0xffccdc[_0x9d16('0x18')](_0x479d1b);return _0xffccdc['set'](_0x9d16('0x1f'),_0x39c35d+'-'+_0x409ef6+'/'+_0x51d1e9)[_0x9d16('0x1a')](_0x73575a);}return null;};}function patchUpdates(_0x116fe6){return function(_0x4daaf0){try{jsonpatch['apply'](_0x4daaf0,_0x116fe6,!![]);}catch(_0x1fb74e){return BPromise[_0x9d16('0x20')](_0x1fb74e);}return _0x4daaf0[_0x9d16('0x21')]();};}function saveUpdates(_0x4e3155,_0x2ed6fd){return function(_0x5c1395){if(_0x5c1395){return _0x5c1395[_0x9d16('0x22')](_0x4e3155)[_0x9d16('0x23')](function(_0x184f3a){return _0x184f3a;});}return null;};}function removeEntity(_0x3e38d0,_0x1b9ba7){return function(_0x486515){if(_0x486515){return _0x486515[_0x9d16('0x24')]()['then'](function(){_0x3e38d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6db3,_0x45306e){return function(_0x349a36){if(!_0x349a36){_0x1c6db3[_0x9d16('0x25')](0x194);}return _0x349a36;};}function handleError(_0x475f9a,_0x4dfca9){_0x4dfca9=_0x4dfca9||0x1f4;return function(_0x8fd541){logger[_0x9d16('0x26')](_0x8fd541[_0x9d16('0x27')]);if(_0x8fd541['name']){delete _0x8fd541['name'];}_0x475f9a[_0x9d16('0x18')](_0x4dfca9)['send'](_0x8fd541);};}exports[_0x9d16('0x28')]=function(_0x5d0931,_0x5d212f){var _0x30aff3={},_0x4f1a26={},_0x61bad2={'count':0x0,'rows':[]};var _0x25a9c7=_[_0x9d16('0x29')](db[_0x9d16('0x2a')][_0x9d16('0x2b')],function(_0x16f190){return{'name':_0x16f190[_0x9d16('0x2c')],'type':_0x16f190[_0x9d16('0x2d')][_0x9d16('0x2e')]};});_0x4f1a26['model']=_[_0x9d16('0x29')](_0x25a9c7,_0x9d16('0x2f'));_0x4f1a26['query']=_['keys'](_0x5d0931[_0x9d16('0x30')]);_0x4f1a26['filters']=_[_0x9d16('0x31')](_0x4f1a26['model'],_0x4f1a26[_0x9d16('0x30')]);_0x30aff3['attributes']=_[_0x9d16('0x31')](_0x4f1a26[_0x9d16('0x32')],qs[_0x9d16('0x33')](_0x5d0931['query']['fields']));_0x30aff3[_0x9d16('0x34')]=_0x30aff3[_0x9d16('0x34')][_0x9d16('0x35')]?_0x30aff3[_0x9d16('0x34')]:_0x4f1a26['model'];if(!_0x5d0931[_0x9d16('0x30')][_0x9d16('0x36')](_0x9d16('0x37'))){_0x30aff3[_0x9d16('0x1e')]=qs['limit'](_0x5d0931[_0x9d16('0x30')][_0x9d16('0x1e')]);_0x30aff3[_0x9d16('0x1b')]=qs['offset'](_0x5d0931[_0x9d16('0x30')]['offset']);}_0x30aff3[_0x9d16('0x38')]=qs[_0x9d16('0x39')](_0x5d0931[_0x9d16('0x30')]['sort']);_0x30aff3[_0x9d16('0x3a')]=qs[_0x9d16('0x3b')](_[_0x9d16('0x3c')](_0x5d0931[_0x9d16('0x30')],_0x4f1a26['filters']),_0x25a9c7);if(_0x5d0931[_0x9d16('0x30')][_0x9d16('0x3d')]){_0x30aff3[_0x9d16('0x3a')]=_[_0x9d16('0x3e')](_0x30aff3[_0x9d16('0x3a')],{'$or':_['map'](_0x25a9c7,function(_0x454279){if(_0x454279[_0x9d16('0x2d')]!=='VIRTUAL'){var _0x388a69={};_0x388a69[_0x454279[_0x9d16('0x2f')]]={'$like':'%'+_0x5d0931[_0x9d16('0x30')][_0x9d16('0x3d')]+'%'};return _0x388a69;}})});}_0x30aff3=_[_0x9d16('0x3e')]({},_0x30aff3,_0x5d0931[_0x9d16('0x3f')]);var _0x7f8dbd={'where':_0x30aff3[_0x9d16('0x3a')]};return db['OpenchannelApplication'][_0x9d16('0x1d')](_0x7f8dbd)['then'](function(_0x53dc74){_0x61bad2[_0x9d16('0x1d')]=_0x53dc74;if(_0x5d0931[_0x9d16('0x30')][_0x9d16('0x40')]){_0x30aff3[_0x9d16('0x41')]=[{'all':!![]}];}return db[_0x9d16('0x2a')][_0x9d16('0x42')](_0x30aff3);})[_0x9d16('0x23')](function(_0x36f8d9){_0x61bad2[_0x9d16('0x43')]=_0x36f8d9;return _0x61bad2;})[_0x9d16('0x23')](respondWithFilteredResult(_0x5d212f,_0x30aff3))['catch'](handleError(_0x5d212f,null));};exports['show']=function(_0x1598e2,_0x3d1e50){var _0x15391b={'raw':!![],'where':{'id':_0x1598e2[_0x9d16('0x44')]['id']}},_0x18c23e={};_0x18c23e['model']=_[_0x9d16('0x45')](db[_0x9d16('0x2a')][_0x9d16('0x2b')]);_0x18c23e[_0x9d16('0x30')]=_['keys'](_0x1598e2[_0x9d16('0x30')]);_0x18c23e[_0x9d16('0x3b')]=_[_0x9d16('0x31')](_0x18c23e[_0x9d16('0x32')],_0x18c23e[_0x9d16('0x30')]);_0x15391b[_0x9d16('0x34')]=_[_0x9d16('0x31')](_0x18c23e[_0x9d16('0x32')],qs[_0x9d16('0x33')](_0x1598e2[_0x9d16('0x30')][_0x9d16('0x33')]));_0x15391b['attributes']=_0x15391b['attributes']['length']?_0x15391b[_0x9d16('0x34')]:_0x18c23e[_0x9d16('0x32')];if(_0x1598e2['query']['includeAll']){_0x15391b[_0x9d16('0x41')]=[{'all':!![]}];}_0x15391b=_['merge']({},_0x15391b,_0x1598e2[_0x9d16('0x3f')]);return db[_0x9d16('0x2a')][_0x9d16('0x46')](_0x15391b)[_0x9d16('0x23')](handleEntityNotFound(_0x3d1e50,null))[_0x9d16('0x23')](respondWithResult(_0x3d1e50,null))[_0x9d16('0x47')](handleError(_0x3d1e50,null));};exports['create']=function(_0x516e2c,_0x402002){return db['OpenchannelApplication'][_0x9d16('0x48')](_0x516e2c[_0x9d16('0x49')],{})[_0x9d16('0x23')](respondWithResult(_0x402002,0xc9))[_0x9d16('0x47')](handleError(_0x402002,null));};exports[_0x9d16('0x22')]=function(_0x4621dd,_0x23b6fa){if(_0x4621dd[_0x9d16('0x49')]['id']){delete _0x4621dd[_0x9d16('0x49')]['id'];}return db['OpenchannelApplication'][_0x9d16('0x46')]({'where':{'id':_0x4621dd['params']['id']}})[_0x9d16('0x23')](handleEntityNotFound(_0x23b6fa,null))[_0x9d16('0x23')](saveUpdates(_0x4621dd[_0x9d16('0x49')],null))[_0x9d16('0x23')](respondWithResult(_0x23b6fa,null))[_0x9d16('0x47')](handleError(_0x23b6fa,null));};exports[_0x9d16('0x24')]=function(_0x270cb7,_0x2a5e8c){return db[_0x9d16('0x2a')][_0x9d16('0x46')]({'where':{'id':_0x270cb7[_0x9d16('0x44')]['id']}})[_0x9d16('0x23')](handleEntityNotFound(_0x2a5e8c,null))['then'](removeEntity(_0x2a5e8c,null))[_0x9d16('0x47')](handleError(_0x2a5e8c,null));}; \ No newline at end of file +var _0xbabf=['end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','OpenchannelApplication','rawAttributes','type','model','map','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x2d6e7d,_0x9c7588){var _0x401986=function(_0x5ad450){while(--_0x5ad450){_0x2d6e7d['push'](_0x2d6e7d['shift']());}};_0x401986(++_0x9c7588);}(_0xbabf,0x110));var _0xfbab=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xbabf[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xfbab('0x0'));var rimraf=require(_0xfbab('0x1'));var zipdir=require(_0xfbab('0x2'));var jsonpatch=require(_0xfbab('0x3'));var rp=require(_0xfbab('0x4'));var moment=require(_0xfbab('0x5'));var BPromise=require(_0xfbab('0x6'));var Mustache=require('mustache');var util=require(_0xfbab('0x7'));var path=require('path');var sox=require(_0xfbab('0x8'));var csv=require(_0xfbab('0x9'));var ejs=require(_0xfbab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbab('0xb'));var squel=require(_0xfbab('0xc'));var crypto=require(_0xfbab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfbab('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfbab('0xf'));var Papa=require('papaparse');var Redis=require(_0xfbab('0x10'));var authService=require(_0xfbab('0x11'));var qs=require(_0xfbab('0x12'));var as=require(_0xfbab('0x13'));var hardwareService=require(_0xfbab('0x14'));var logger=require(_0xfbab('0x15'))(_0xfbab('0x16'));var utils=require(_0xfbab('0x17'));var config=require(_0xfbab('0x18'));var licenseUtil=require(_0xfbab('0x19'));var db=require(_0xfbab('0x1a'))['db'];function respondWithStatusCode(_0x2c88b3,_0x26fd3a){_0x26fd3a=_0x26fd3a||0xcc;return function(_0x2fca92){if(_0x2fca92){return _0x2c88b3['sendStatus'](_0x26fd3a);}return _0x2c88b3[_0xfbab('0x1b')](_0x26fd3a)[_0xfbab('0x1c')]();};}function respondWithResult(_0x1dc41d,_0x2c717a){_0x2c717a=_0x2c717a||0xc8;return function(_0x43a642){if(_0x43a642){return _0x1dc41d[_0xfbab('0x1b')](_0x2c717a)[_0xfbab('0x1d')](_0x43a642);}};}function respondWithFilteredResult(_0x2f0ead,_0x2d4ff2){return function(_0x519f5b){if(_0x519f5b){var _0x52b957=typeof _0x2d4ff2['offset']===_0xfbab('0x1e')&&typeof _0x2d4ff2[_0xfbab('0x1f')]==='undefined';var _0x19168f=_0x519f5b[_0xfbab('0x20')];var _0x49c717=_0x52b957?0x0:_0x2d4ff2[_0xfbab('0x21')];var _0x42fcc3=_0x52b957?_0x519f5b['count']:_0x2d4ff2[_0xfbab('0x21')]+_0x2d4ff2['limit'];var _0x37bbcd;if(_0x42fcc3>=_0x19168f){_0x42fcc3=_0x19168f;_0x37bbcd=0xc8;}else{_0x37bbcd=0xce;}_0x2f0ead[_0xfbab('0x1b')](_0x37bbcd);return _0x2f0ead[_0xfbab('0x22')](_0xfbab('0x23'),_0x49c717+'-'+_0x42fcc3+'/'+_0x19168f)[_0xfbab('0x1d')](_0x519f5b);}return null;};}function patchUpdates(_0x37ea68){return function(_0x28eae2){try{jsonpatch['apply'](_0x28eae2,_0x37ea68,!![]);}catch(_0x3ce4c6){return BPromise[_0xfbab('0x24')](_0x3ce4c6);}return _0x28eae2[_0xfbab('0x25')]();};}function saveUpdates(_0x2e6cfa,_0x470153){return function(_0x312a98){if(_0x312a98){return _0x312a98[_0xfbab('0x26')](_0x2e6cfa)[_0xfbab('0x27')](function(_0x5d2a77){return _0x5d2a77;});}return null;};}function removeEntity(_0x27f019,_0xb53e3b){return function(_0x374d95){if(_0x374d95){return _0x374d95[_0xfbab('0x28')]()[_0xfbab('0x27')](function(){_0x27f019[_0xfbab('0x1b')](0xcc)[_0xfbab('0x1c')]();});}};}function handleEntityNotFound(_0x4b0d60,_0x2e3d9e){return function(_0x2ca57d){if(!_0x2ca57d){_0x4b0d60['sendStatus'](0x194);}return _0x2ca57d;};}function handleError(_0x4451c1,_0x1ce78d){_0x1ce78d=_0x1ce78d||0x1f4;return function(_0x104f70){logger[_0xfbab('0x29')](_0x104f70[_0xfbab('0x2a')]);if(_0x104f70[_0xfbab('0x2b')]){delete _0x104f70['name'];}_0x4451c1[_0xfbab('0x1b')](_0x1ce78d)[_0xfbab('0x2c')](_0x104f70);};}exports['index']=function(_0x2d753e,_0x42c1c6){var _0x540a79={},_0x2f6578={},_0x324504={'count':0x0,'rows':[]};var _0x5a1c16=_['map'](db[_0xfbab('0x2d')][_0xfbab('0x2e')],function(_0x1ffc2a){return{'name':_0x1ffc2a['fieldName'],'type':_0x1ffc2a[_0xfbab('0x2f')]['key']};});_0x2f6578[_0xfbab('0x30')]=_[_0xfbab('0x31')](_0x5a1c16,_0xfbab('0x2b'));_0x2f6578['query']=_['keys'](_0x2d753e[_0xfbab('0x32')]);_0x2f6578['filters']=_['intersection'](_0x2f6578[_0xfbab('0x30')],_0x2f6578[_0xfbab('0x32')]);_0x540a79[_0xfbab('0x33')]=_[_0xfbab('0x34')](_0x2f6578[_0xfbab('0x30')],qs[_0xfbab('0x35')](_0x2d753e[_0xfbab('0x32')][_0xfbab('0x35')]));_0x540a79[_0xfbab('0x33')]=_0x540a79[_0xfbab('0x33')][_0xfbab('0x36')]?_0x540a79['attributes']:_0x2f6578['model'];if(!_0x2d753e[_0xfbab('0x32')][_0xfbab('0x37')]('nolimit')){_0x540a79[_0xfbab('0x1f')]=qs[_0xfbab('0x1f')](_0x2d753e[_0xfbab('0x32')][_0xfbab('0x1f')]);_0x540a79['offset']=qs[_0xfbab('0x21')](_0x2d753e['query'][_0xfbab('0x21')]);}_0x540a79[_0xfbab('0x38')]=qs[_0xfbab('0x39')](_0x2d753e[_0xfbab('0x32')][_0xfbab('0x39')]);_0x540a79[_0xfbab('0x3a')]=qs[_0xfbab('0x3b')](_[_0xfbab('0x3c')](_0x2d753e[_0xfbab('0x32')],_0x2f6578[_0xfbab('0x3b')]),_0x5a1c16);if(_0x2d753e[_0xfbab('0x32')]['filter']){_0x540a79['where']=_[_0xfbab('0x3d')](_0x540a79[_0xfbab('0x3a')],{'$or':_[_0xfbab('0x31')](_0x5a1c16,function(_0x503fec){if(_0x503fec[_0xfbab('0x2f')]!==_0xfbab('0x3e')){var _0x193722={};_0x193722[_0x503fec[_0xfbab('0x2b')]]={'$like':'%'+_0x2d753e[_0xfbab('0x32')][_0xfbab('0x3f')]+'%'};return _0x193722;}})});}_0x540a79=_[_0xfbab('0x3d')]({},_0x540a79,_0x2d753e['options']);var _0x48b6cf={'where':_0x540a79[_0xfbab('0x3a')]};return db[_0xfbab('0x2d')][_0xfbab('0x20')](_0x48b6cf)[_0xfbab('0x27')](function(_0x4c7f25){_0x324504[_0xfbab('0x20')]=_0x4c7f25;if(_0x2d753e[_0xfbab('0x32')][_0xfbab('0x40')]){_0x540a79[_0xfbab('0x41')]=[{'all':!![]}];}return db[_0xfbab('0x2d')][_0xfbab('0x42')](_0x540a79);})[_0xfbab('0x27')](function(_0x729e53){_0x324504[_0xfbab('0x43')]=_0x729e53;return _0x324504;})[_0xfbab('0x27')](respondWithFilteredResult(_0x42c1c6,_0x540a79))[_0xfbab('0x44')](handleError(_0x42c1c6,null));};exports[_0xfbab('0x45')]=function(_0x544f7d,_0x41a2dc){var _0x5ea02d={'raw':!![],'where':{'id':_0x544f7d['params']['id']}},_0x1f11c7={};_0x1f11c7[_0xfbab('0x30')]=_['keys'](db['OpenchannelApplication'][_0xfbab('0x2e')]);_0x1f11c7[_0xfbab('0x32')]=_[_0xfbab('0x46')](_0x544f7d[_0xfbab('0x32')]);_0x1f11c7[_0xfbab('0x3b')]=_[_0xfbab('0x34')](_0x1f11c7['model'],_0x1f11c7[_0xfbab('0x32')]);_0x5ea02d[_0xfbab('0x33')]=_[_0xfbab('0x34')](_0x1f11c7[_0xfbab('0x30')],qs['fields'](_0x544f7d[_0xfbab('0x32')]['fields']));_0x5ea02d[_0xfbab('0x33')]=_0x5ea02d[_0xfbab('0x33')]['length']?_0x5ea02d[_0xfbab('0x33')]:_0x1f11c7['model'];if(_0x544f7d[_0xfbab('0x32')][_0xfbab('0x40')]){_0x5ea02d[_0xfbab('0x41')]=[{'all':!![]}];}_0x5ea02d=_[_0xfbab('0x3d')]({},_0x5ea02d,_0x544f7d['options']);return db[_0xfbab('0x2d')][_0xfbab('0x47')](_0x5ea02d)['then'](handleEntityNotFound(_0x41a2dc,null))['then'](respondWithResult(_0x41a2dc,null))[_0xfbab('0x44')](handleError(_0x41a2dc,null));};exports[_0xfbab('0x48')]=function(_0x5d4465,_0x1eae08){return db['OpenchannelApplication'][_0xfbab('0x48')](_0x5d4465['body'],{})[_0xfbab('0x27')](respondWithResult(_0x1eae08,0xc9))[_0xfbab('0x44')](handleError(_0x1eae08,null));};exports[_0xfbab('0x26')]=function(_0x2392a7,_0x1fcd2f){if(_0x2392a7['body']['id']){delete _0x2392a7[_0xfbab('0x49')]['id'];}return db[_0xfbab('0x2d')]['find']({'where':{'id':_0x2392a7['params']['id']}})[_0xfbab('0x27')](handleEntityNotFound(_0x1fcd2f,null))[_0xfbab('0x27')](saveUpdates(_0x2392a7[_0xfbab('0x49')],null))['then'](respondWithResult(_0x1fcd2f,null))[_0xfbab('0x44')](handleError(_0x1fcd2f,null));};exports['destroy']=function(_0x57b442,_0x3e997b){return db[_0xfbab('0x2d')][_0xfbab('0x47')]({'where':{'id':_0x57b442[_0xfbab('0x4a')]['id']}})[_0xfbab('0x27')](handleEntityNotFound(_0x3e997b,null))[_0xfbab('0x27')](removeEntity(_0x3e997b,null))[_0xfbab('0x44')](handleError(_0x3e997b,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a3000d2..feeeeb9 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 _0x68b9=['openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x39010b,_0x17e844){var _0x3d8797=function(_0x33924a){while(--_0x33924a){_0x39010b['push'](_0x39010b['shift']());}};_0x3d8797(++_0x17e844);}(_0x68b9,0x12b));var _0x968b=function(_0x249f8c,_0xfb3946){_0x249f8c=_0x249f8c-0x0;var _0x5e224a=_0x68b9[_0x249f8c];return _0x5e224a;};'use strict';var _=require(_0x968b('0x0'));var util=require(_0x968b('0x1'));var logger=require(_0x968b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x968b('0x3'));var rp=require(_0x968b('0x4'));var fs=require('fs');var path=require(_0x968b('0x5'));var rimraf=require(_0x968b('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x968b('0x7')]=function(_0x5a1329,_0x4bac61){return _0x5a1329[_0x968b('0x8')]('OpenchannelApplication',attributes,{'tableName':_0x968b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x968b('0xa')});}; \ No newline at end of file +var _0x9479=['exports','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x352180,_0x2b23c1){var _0x5eeb9a=function(_0x1cc9ea){while(--_0x1cc9ea){_0x352180['push'](_0x352180['shift']());}};_0x5eeb9a(++_0x2b23c1);}(_0x9479,0x1b4));var _0x9947=function(_0xdeb064,_0x2bd0eb){_0xdeb064=_0xdeb064-0x0;var _0x191b7d=_0x9479[_0xdeb064];return _0x191b7d;};'use strict';var _=require(_0x9947('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9947('0x1'));var BPromise=require(_0x9947('0x2'));var rp=require(_0x9947('0x3'));var fs=require('fs');var path=require(_0x9947('0x4'));var rimraf=require(_0x9947('0x5'));var config=require(_0x9947('0x6'));var attributes=require(_0x9947('0x7'));module[_0x9947('0x8')]=function(_0x550636,_0x4542d0){return _0x550636['define'](_0x9947('0x9'),attributes,{'tableName':_0x9947('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9947('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 25b9810..b100f82 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 _0xcf01=['update','body','options','raw','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication'];(function(_0x38b6b5,_0x4d8ed5){var _0x470e92=function(_0x7b7d3a){while(--_0x7b7d3a){_0x38b6b5['push'](_0x38b6b5['shift']());}};_0x470e92(++_0x4d8ed5);}(_0xcf01,0xef));var _0x1cf0=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xcf01[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x1cf0('0x0'));var util=require(_0x1cf0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1cf0('0x2'));var fs=require('fs');var Redis=require(_0x1cf0('0x3'));var db=require(_0x1cf0('0x4'))['db'];var utils=require(_0x1cf0('0x5'));var logger=require(_0x1cf0('0x6'))(_0x1cf0('0x7'));var config=require('../../config/environment');var jayson=require(_0x1cf0('0x8'));var client=jayson[_0x1cf0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b6b5c,_0xef8e2b,_0x35a869){return new BPromise(function(_0x179ae6,_0xe5a426){return client[_0x1cf0('0xa')](_0x1b6b5c,_0x35a869)[_0x1cf0('0xb')](function(_0x44b2ce){logger[_0x1cf0('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0xef8e2b,_0x1cf0('0xd'));logger[_0x1cf0('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xef8e2b,_0x1cf0('0xd'),JSON[_0x1cf0('0xf')](_0x44b2ce));if(_0x44b2ce[_0x1cf0('0x10')]){if(_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x11')]===0x1f4){logger['error'](_0x1cf0('0x12'),_0xef8e2b,_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x13')]);return _0xe5a426(_0x44b2ce[_0x1cf0('0x10')]['message']);}logger[_0x1cf0('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0xef8e2b,_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x13')]);return _0x179ae6(_0x44b2ce[_0x1cf0('0x10')][_0x1cf0('0x13')]);}else{logger[_0x1cf0('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0xef8e2b,_0x1cf0('0xd'));_0x179ae6(_0x44b2ce[_0x1cf0('0x14')][_0x1cf0('0x13')]);}})['catch'](function(_0xbd4a59){logger[_0x1cf0('0x10')](_0x1cf0('0x12'),_0xef8e2b,_0xbd4a59);_0xe5a426(_0xbd4a59);});});}exports[_0x1cf0('0x15')]=function(_0x41b1bd){var _0x5a7bd3=this;return new Promise(function(_0x290f57,_0x20aa20){return db['OpenchannelApplication'][_0x1cf0('0x16')](_0x41b1bd[_0x1cf0('0x17')],{'raw':_0x41b1bd[_0x1cf0('0x18')]?_0x41b1bd[_0x1cf0('0x18')][_0x1cf0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41b1bd['options']?_0x41b1bd[_0x1cf0('0x18')][_0x1cf0('0x1a')]||null:null,'attributes':_0x41b1bd['options']?_0x41b1bd[_0x1cf0('0x18')][_0x1cf0('0x1b')]||null:null,'limit':_0x41b1bd[_0x1cf0('0x18')]?_0x41b1bd['options'][_0x1cf0('0x1c')]||null:null})[_0x1cf0('0xb')](function(_0x4a7f7d){logger['info'](_0x1cf0('0x15'),_0x41b1bd);logger[_0x1cf0('0xe')](_0x1cf0('0x15'),_0x41b1bd,JSON['stringify'](_0x4a7f7d));_0x290f57(_0x4a7f7d);})['catch'](function(_0x1fd7c1){logger[_0x1cf0('0x10')](_0x1cf0('0x15'),_0x1fd7c1['message'],_0x41b1bd);_0x20aa20(_0x5a7bd3[_0x1cf0('0x10')](0x1f4,_0x1fd7c1[_0x1cf0('0x13')]));});});}; \ No newline at end of file +var _0xfc1a=['jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','OpenchannelApplication','update','body','options','raw','attributes','UpdateOpenchannelApplication','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ab687,_0x2f3a18){var _0x512596=function(_0x981ef2){while(--_0x981ef2){_0x3ab687['push'](_0x3ab687['shift']());}};_0x512596(++_0x2f3a18);}(_0xfc1a,0x141));var _0xafc1=function(_0x53980c,_0x3ab14a){_0x53980c=_0x53980c-0x0;var _0x13822a=_0xfc1a[_0x53980c];return _0x13822a;};'use strict';var _=require(_0xafc1('0x0'));var util=require(_0xafc1('0x1'));var moment=require(_0xafc1('0x2'));var BPromise=require(_0xafc1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafc1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafc1('0x5'));var logger=require(_0xafc1('0x6'))(_0xafc1('0x7'));var config=require(_0xafc1('0x8'));var jayson=require(_0xafc1('0x9'));var client=jayson[_0xafc1('0xa')][_0xafc1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4235ed,_0x492ee9,_0x1ff776){return new BPromise(function(_0x3cb7d7,_0x397ce3){return client['request'](_0x4235ed,_0x1ff776)[_0xafc1('0xc')](function(_0x4d2380){logger[_0xafc1('0xd')](_0xafc1('0xe'),_0x492ee9,_0xafc1('0xf'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x492ee9,_0xafc1('0xf'),JSON['stringify'](_0x4d2380));if(_0x4d2380[_0xafc1('0x10')]){if(_0x4d2380[_0xafc1('0x10')][_0xafc1('0x11')]===0x1f4){logger['error'](_0xafc1('0xe'),_0x492ee9,_0x4d2380[_0xafc1('0x10')][_0xafc1('0x12')]);return _0x397ce3(_0x4d2380[_0xafc1('0x10')]['message']);}logger['error'](_0xafc1('0xe'),_0x492ee9,_0x4d2380[_0xafc1('0x10')][_0xafc1('0x12')]);return _0x3cb7d7(_0x4d2380[_0xafc1('0x10')][_0xafc1('0x12')]);}else{logger[_0xafc1('0xd')](_0xafc1('0xe'),_0x492ee9,_0xafc1('0xf'));_0x3cb7d7(_0x4d2380[_0xafc1('0x13')][_0xafc1('0x12')]);}})[_0xafc1('0x14')](function(_0x554c83){logger['error'](_0xafc1('0xe'),_0x492ee9,_0x554c83);_0x397ce3(_0x554c83);});});}exports['UpdateOpenchannelApplication']=function(_0x2ff8bb){var _0x59cc4c=this;return new Promise(function(_0x214c2f,_0x9c183b){return db[_0xafc1('0x15')][_0xafc1('0x16')](_0x2ff8bb[_0xafc1('0x17')],{'raw':_0x2ff8bb[_0xafc1('0x18')]?_0x2ff8bb['options'][_0xafc1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff8bb['options']?_0x2ff8bb[_0xafc1('0x18')]['where']||null:null,'attributes':_0x2ff8bb[_0xafc1('0x18')]?_0x2ff8bb['options'][_0xafc1('0x1a')]||null:null,'limit':_0x2ff8bb[_0xafc1('0x18')]?_0x2ff8bb[_0xafc1('0x18')]['limit']||null:null})['then'](function(_0x35d068){logger[_0xafc1('0xd')](_0xafc1('0x1b'),_0x2ff8bb);logger[_0xafc1('0x1c')](_0xafc1('0x1b'),_0x2ff8bb,JSON[_0xafc1('0x1d')](_0x35d068));_0x214c2f(_0x35d068);})[_0xafc1('0x14')](function(_0x4fb16a){logger[_0xafc1('0x10')](_0xafc1('0x1b'),_0x4fb16a[_0xafc1('0x12')],_0x2ff8bb);_0x9c183b(_0x59cc4c['error'](0x1f4,_0x4fb16a[_0xafc1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e96fa99..181c83e 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 _0xb41e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','addMessage','/:id/tags','openchannel','addTags','put','tracked','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','express'];(function(_0x3e38c1,_0x4f9c74){var _0x4586df=function(_0x8d5b12){while(--_0x8d5b12){_0x3e38c1['push'](_0x3e38c1['shift']());}};_0x4586df(++_0x4f9c74);}(_0xb41e,0x11e));var _0xeb41=function(_0x340d6e,_0x10fdd4){_0x340d6e=_0x340d6e-0x0;var _0x27f273=_0xb41e[_0x340d6e];return _0x27f273;};'use strict';var multer=require(_0xeb41('0x0'));var util=require(_0xeb41('0x1'));var path=require(_0xeb41('0x2'));var timeout=require('connect-timeout');var express=require(_0xeb41('0x3'));var router=express[_0xeb41('0x4')]();var fs_extra=require(_0xeb41('0x5'));var auth=require(_0xeb41('0x6'));var interaction=require(_0xeb41('0x7'));var config=require('../../config/environment');var controller=require(_0xeb41('0x8'));router['get']('/',auth[_0xeb41('0x9')](),controller[_0xeb41('0xa')]);router[_0xeb41('0xb')](_0xeb41('0xc'),auth[_0xeb41('0x9')](),controller[_0xeb41('0xd')]);router[_0xeb41('0xb')](_0xeb41('0xe'),auth[_0xeb41('0x9')](),controller['show']);router[_0xeb41('0xb')]('/:id/messages',auth[_0xeb41('0x9')](),controller['getMessages']);router[_0xeb41('0xb')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xeb41('0xf')]('/',auth['isAuthenticated'](),controller[_0xeb41('0x10')]);router[_0xeb41('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0xeb41('0x11')]);router[_0xeb41('0xf')](_0xeb41('0x12'),auth[_0xeb41('0x9')](),interaction['tracked'](_0xeb41('0x13'),'openchannelinteraction:addtags'),controller[_0xeb41('0x14')]);router[_0xeb41('0x15')](_0xeb41('0xe'),auth[_0xeb41('0x9')](),interaction[_0xeb41('0x16')](_0xeb41('0x13'),_0xeb41('0x17')),controller[_0xeb41('0x18')]);router[_0xeb41('0x19')]('/:id',auth[_0xeb41('0x9')](),interaction[_0xeb41('0x16')]('openchannel','openchannelinteraction:destroy'),controller[_0xeb41('0x1a')]);router[_0xeb41('0x19')](_0xeb41('0x12'),auth[_0xeb41('0x9')](),controller[_0xeb41('0x1b')]);module[_0xeb41('0x1c')]=router; \ No newline at end of file +var _0xc733=['/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','tracked','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','describe'];(function(_0x42e2a0,_0xd2a7e1){var _0x3dbf06=function(_0x1a8ed6){while(--_0x1a8ed6){_0x42e2a0['push'](_0x42e2a0['shift']());}};_0x3dbf06(++_0xd2a7e1);}(_0xc733,0xc6));var _0x3c73=function(_0xfa2938,_0xa81fa7){_0xfa2938=_0xfa2938-0x0;var _0x5b5bdb=_0xc733[_0xfa2938];return _0x5b5bdb;};'use strict';var multer=require(_0x3c73('0x0'));var util=require(_0x3c73('0x1'));var path=require(_0x3c73('0x2'));var timeout=require(_0x3c73('0x3'));var express=require('express');var router=express[_0x3c73('0x4')]();var fs_extra=require(_0x3c73('0x5'));var auth=require(_0x3c73('0x6'));var interaction=require(_0x3c73('0x7'));var config=require('../../config/environment');var controller=require(_0x3c73('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3c73('0x9')]('/describe',auth[_0x3c73('0xa')](),controller[_0x3c73('0xb')]);router[_0x3c73('0x9')](_0x3c73('0xc'),auth[_0x3c73('0xa')](),controller[_0x3c73('0xd')]);router[_0x3c73('0x9')](_0x3c73('0xe'),auth[_0x3c73('0xa')](),controller['getMessages']);router[_0x3c73('0x9')](_0x3c73('0xf'),auth['isAuthenticated'](),controller[_0x3c73('0x10')]);router[_0x3c73('0x11')]('/',auth[_0x3c73('0xa')](),controller[_0x3c73('0x12')]);router[_0x3c73('0x11')](_0x3c73('0xe'),auth[_0x3c73('0xa')](),controller[_0x3c73('0x13')]);router[_0x3c73('0x11')](_0x3c73('0x14'),auth[_0x3c73('0xa')](),interaction['tracked'](_0x3c73('0x15'),_0x3c73('0x16')),controller[_0x3c73('0x17')]);router[_0x3c73('0x18')](_0x3c73('0xc'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x3c73('0x19')),controller['update']);router[_0x3c73('0x1a')](_0x3c73('0xc'),auth[_0x3c73('0xa')](),interaction[_0x3c73('0x1b')](_0x3c73('0x15'),'openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0x3c73('0x14'),auth[_0x3c73('0xa')](),controller[_0x3c73('0x1c')]);module[_0x3c73('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index f7825dd..487ba88 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 _0x6183=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x508063,_0x38f50e){var _0x3101fc=function(_0x92d6ff){while(--_0x92d6ff){_0x508063['push'](_0x508063['shift']());}};_0x3101fc(++_0x38f50e);}(_0x6183,0x19b));var _0x3618=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x6183[_0x23c73d];return _0x36ba47;};'use strict';var Sequelize=require('sequelize');module[_0x3618('0x0')]={'closed':{'type':Sequelize[_0x3618('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3618('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3618('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3618('0x3')]},'note':{'type':Sequelize[_0x3618('0x3')]},'read1stAt':{'type':Sequelize[_0x3618('0x2')]},'threadId':{'type':Sequelize[_0x3618('0x3')]},'externalUrl':{'type':Sequelize[_0x3618('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3618('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3618('0x4')]('in',_0x3618('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3618('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3204=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x219536,_0x8e0b9b){var _0x231e4d=function(_0x37b376){while(--_0x37b376){_0x219536['push'](_0x219536['shift']());}};_0x231e4d(++_0x8e0b9b);}(_0x3204,0x12e));var _0x4320=function(_0x3acc63,_0x290eac){_0x3acc63=_0x3acc63-0x0;var _0x47502b=_0x3204[_0x3acc63];return _0x47502b;};'use strict';var Sequelize=require(_0x4320('0x0'));module[_0x4320('0x1')]={'closed':{'type':Sequelize[_0x4320('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4320('0x3')]},'disposition':{'type':Sequelize[_0x4320('0x4')]},'secondDisposition':{'type':Sequelize[_0x4320('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4320('0x4')]},'note':{'type':Sequelize[_0x4320('0x4')]},'read1stAt':{'type':Sequelize[_0x4320('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x4320('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4320('0x5')]('in',_0x4320('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4320('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4320('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 361357b..ed7e973 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 _0x6465=['i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','show','params','includeAll','options','create','update','describe','addMessage','OpenchannelMessage','ids','getMessages','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','download','unix','join','root','files','attachments','format','transcript-%d-%s.zip','CmContact','Contact','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','basename','existsSync','createWriteStream','out','System','firstName','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','talking','unmanaged','total','closed','UserId','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20>\x200','operator','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','isEmpty','forEach','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','OpenchannelAccountId'];(function(_0x5c052b,_0x3bd2b9){var _0x5856a6=function(_0x2b8e4d){while(--_0x2b8e4d){_0x5c052b['push'](_0x5c052b['shift']());}};_0x5856a6(++_0x3bd2b9);}(_0x6465,0x142));var _0x5646=function(_0x2aece6,_0x43cc7b){_0x2aece6=_0x2aece6-0x0;var _0x1fe1ff=_0x6465[_0x2aece6];return _0x1fe1ff;};'use strict';var emlformat=require(_0x5646('0x0'));var rimraf=require(_0x5646('0x1'));var zipdir=require(_0x5646('0x2'));var jsonpatch=require(_0x5646('0x3'));var rp=require('request-promise');var moment=require(_0x5646('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5646('0x5'));var util=require(_0x5646('0x6'));var path=require(_0x5646('0x7'));var sox=require(_0x5646('0x8'));var csv=require(_0x5646('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5646('0xa'));var _=require('lodash');var squel=require(_0x5646('0xb'));var crypto=require(_0x5646('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5646('0x9'));var querystring=require(_0x5646('0xd'));var Papa=require('papaparse');var Redis=require(_0x5646('0xe'));var authService=require(_0x5646('0xf'));var qs=require(_0x5646('0x10'));var as=require(_0x5646('0x11'));var pdf=require(_0x5646('0x12'));var hardwareService=require(_0x5646('0x13'));var logger=require(_0x5646('0x14'))('api');var utils=require(_0x5646('0x15'));var config=require(_0x5646('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5646('0x17')]=_[_0x5646('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5646('0x19'))(new Redis(config[_0x5646('0x17')]));require(_0x5646('0x1a'))['register'](socket);function respondWithStatusCode(_0x37c982,_0x316789){_0x316789=_0x316789||0xcc;return function(_0x2858a5){if(_0x2858a5){return _0x37c982[_0x5646('0x1b')](_0x316789);}return _0x37c982[_0x5646('0x1c')](_0x316789)[_0x5646('0x1d')]();};}function respondWithResult(_0xa1cfe8,_0x1bfdc1){_0x1bfdc1=_0x1bfdc1||0xc8;return function(_0x28cca1){if(_0x28cca1){return _0xa1cfe8[_0x5646('0x1c')](_0x1bfdc1)[_0x5646('0x1e')](_0x28cca1);}};}function respondWithFilteredResult(_0x371938,_0x87895){return function(_0x4ead98){if(_0x4ead98){var _0x2fc0f0=typeof _0x87895['offset']==='undefined'&&typeof _0x87895[_0x5646('0x1f')]===_0x5646('0x20');var _0x5071e8=_0x4ead98[_0x5646('0x21')];var _0x4de2a0=_0x2fc0f0?0x0:_0x87895[_0x5646('0x22')];var _0x240b87=_0x2fc0f0?_0x4ead98[_0x5646('0x21')]:_0x87895[_0x5646('0x22')]+_0x87895[_0x5646('0x1f')];var _0xf66179;if(_0x240b87>=_0x5071e8){_0x240b87=_0x5071e8;_0xf66179=0xc8;}else{_0xf66179=0xce;}_0x371938[_0x5646('0x1c')](_0xf66179);return _0x371938[_0x5646('0x23')]('Content-Range',_0x4de2a0+'-'+_0x240b87+'/'+_0x5071e8)[_0x5646('0x1e')](_0x4ead98);}return null;};}function patchUpdates(_0x1dee05){return function(_0x1d0c0a){try{jsonpatch[_0x5646('0x24')](_0x1d0c0a,_0x1dee05,!![]);}catch(_0x556442){return BPromise[_0x5646('0x25')](_0x556442);}return _0x1d0c0a[_0x5646('0x26')]();};}function saveUpdates(_0x1e4b17,_0x503bfa){return function(_0x4720ab){if(_0x4720ab){return _0x4720ab['update'](_0x1e4b17)[_0x5646('0x27')](function(_0x2cbc31){return _0x2cbc31;});}return null;};}function removeEntity(_0x296a41,_0x598af1){return function(_0x16a299){if(_0x16a299){return _0x16a299[_0x5646('0x28')]()[_0x5646('0x27')](function(){_0x296a41[_0x5646('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221fcf,_0x16622f){return function(_0x16815b){if(!_0x16815b){_0x221fcf['sendStatus'](0x194);}return _0x16815b;};}function handleError(_0x38024c,_0x50ece3){_0x50ece3=_0x50ece3||0x1f4;return function(_0xf27c0d){logger[_0x5646('0x29')](_0xf27c0d[_0x5646('0x2a')]);if(_0xf27c0d[_0x5646('0x2b')]){delete _0xf27c0d['name'];}_0x38024c[_0x5646('0x1c')](_0x50ece3)[_0x5646('0x2c')](_0xf27c0d);};}function getInteractionUsers(_0xac86bb,_0x25097a){return new BPromise(function(_0x1c80d,_0x2ee708){try{if(_0x25097a[_0xac86bb['id']]){_0xac86bb[_0x5646('0x2d')]=_[_0x5646('0x2e')](_0x25097a[_0xac86bb['id']],function(_0x3b9339){return{'id':_0x3b9339['id'],'fullname':_0x3b9339[_0x5646('0x2f')]};});}}catch(_0x113e6d){_0x2ee708(_0x113e6d);}_0x1c80d(_0xac86bb);});}function getInteractionTags(_0x5bcbd1,_0x20ffb5){return new BPromise(function(_0x4e483e,_0x409fdd){try{if(_0x5bcbd1[_0x5646('0x30')]){_0x5bcbd1[_0x5646('0x31')]=[];_0x5bcbd1['TagIds']['split'](',')['forEach'](function(_0x4bcb82){_0x5bcbd1[_0x5646('0x31')][_0x5646('0x32')](_0x20ffb5[_0x4bcb82]);});}delete _0x5bcbd1[_0x5646('0x30')];}catch(_0x131c9d){_0x409fdd(_0x131c9d);}_0x4e483e(_0x5bcbd1);});}function updateOpenchannelInteraction(_0x1cd9e5,_0x1d2ae5,_0x1a2508){return new BPromise(function(_0x3dcfff,_0x463b7b){return getInteractionUsers(_0x1cd9e5,_0x1a2508)[_0x5646('0x27')](function(_0x8149ec){return getInteractionTags(_0x8149ec,_0x1d2ae5);})[_0x5646('0x27')](function(_0x428075){return getStateInteraction(_0x428075);})['then'](function(_0x6b3997){_0x3dcfff(_0x6b3997);})[_0x5646('0x33')](function(_0x1a10b9){_0x463b7b(_0x1a10b9);});});}function getStateInteraction(_0x4935af){return new BPromise(function(_0x320303){_0x4935af[_0x5646('0x34')]=0x0;_0x4935af[_0x5646('0x35')]=0x0;_0x4935af['answered']=0x0;_0x4935af[_0x5646('0x36')]=0x0;_0x4935af[_0x5646('0x37')]=0x0;if(!_0x4935af[_0x5646('0x38')]&&!_0x4935af[_0x5646('0x39')]){_0x4935af[_0x5646('0x34')]+=0x1;}if(!_0x4935af[_0x5646('0x38')]&&_0x4935af[_0x5646('0x39')]){_0x4935af[_0x5646('0x35')]+=0x1;ids[_0x5646('0x32')](_0x4935af['id']);if(_0x4935af[_0x5646('0x34')]){_0x4935af[_0x5646('0x34')]-=0x1;}}if(_0x4935af[_0x5646('0x38')]&&_0x4935af[_0x5646('0x39')]){_0x4935af['answered']+=0x1;if(_0x4935af[_0x5646('0x35')]){_0x4935af[_0x5646('0x35')]-=0x1;}}if(_0x4935af[_0x5646('0x38')]&&!_0x4935af[_0x5646('0x39')]){_0x4935af[_0x5646('0x36')]+=0x1;if(_0x4935af[_0x5646('0x34')]){_0x4935af[_0x5646('0x34')]-=0x1;}}_0x4935af[_0x5646('0x37')]+=0x1;_0x320303(_0x4935af);});}exports['index']=function(_0x310c7f,_0x2edda1){var _0x3cefa2={},_0x221ef1={},_0x1e06b9={'count':0x0,'rows':[]};var _0x56909d=_[_0x5646('0x2e')](db['OpenchannelInteraction'][_0x5646('0x3a')],function(_0x5394f9){return{'name':_0x5394f9[_0x5646('0x3b')],'type':_0x5394f9[_0x5646('0x3c')]['key']};});_0x221ef1[_0x5646('0x3d')]=_['map'](_0x56909d,_0x5646('0x2b'));_0x221ef1['query']=_[_0x5646('0x3e')](_0x310c7f[_0x5646('0x3f')]);_0x221ef1[_0x5646('0x40')]=_[_0x5646('0x41')](_0x221ef1[_0x5646('0x3d')],_0x221ef1[_0x5646('0x3f')]);_0x3cefa2[_0x5646('0x42')]=_[_0x5646('0x41')](_0x221ef1[_0x5646('0x3d')],qs[_0x5646('0x43')](_0x310c7f[_0x5646('0x3f')][_0x5646('0x43')]));_0x3cefa2['attributes']=_0x3cefa2[_0x5646('0x42')][_0x5646('0x44')]?_0x3cefa2[_0x5646('0x42')]:_0x221ef1[_0x5646('0x3d')];if(!_0x310c7f[_0x5646('0x3f')][_0x5646('0x45')](_0x5646('0x46'))){_0x3cefa2[_0x5646('0x1f')]=qs[_0x5646('0x1f')](_0x310c7f[_0x5646('0x3f')][_0x5646('0x1f')]);_0x3cefa2[_0x5646('0x22')]=qs[_0x5646('0x22')](_0x310c7f[_0x5646('0x3f')]['offset']);}_0x3cefa2[_0x5646('0x47')]=qs[_0x5646('0x48')](_0x310c7f[_0x5646('0x3f')][_0x5646('0x48')]);_0x3cefa2[_0x5646('0x49')]=qs[_0x5646('0x40')](_[_0x5646('0x4a')](_0x310c7f[_0x5646('0x3f')],_0x221ef1[_0x5646('0x40')]),_0x56909d);var _0x411076=[];var _0x3a8711=squel[_0x5646('0x4b')]()[_0x5646('0x4c')]('id')[_0x5646('0x4c')](_0x5646('0x2b'))['field'](_0x5646('0x4d'))['from'](_0x5646('0x4e'));var _0x3ef104=squel[_0x5646('0x4b')]()['field']('u.id')['field'](_0x5646('0x4f'))[_0x5646('0x4c')](_0x5646('0x50'))[_0x5646('0x51')](_0x5646('0x52'),'ui')[_0x5646('0x53')](_0x5646('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x358063=squel[_0x5646('0x4b')]()['from'](_0x5646('0x55'),'i')[_0x5646('0x53')]('cm_contacts','c',_0x5646('0x56'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x5646('0x57'),'a',_0x5646('0x58'))[_0x5646('0x53')](_0x5646('0x59'),'me',_0x5646('0x5a'))[_0x5646('0x53')](_0x5646('0x5b'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x5646('0x53')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x29f85b=squel[_0x5646('0x5c')]();var _0x207665=[];var _0x27fffc=squel[_0x5646('0x5c')]();var _0x607486;if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x5d')]){_0x607486=as[_0x5646('0x5e')](_0x310c7f[_0x5646('0x3f')]['search']);var _0x1cc99c=_0x607486[_0x5646('0x5f')];for(var _0x22ca93=0x0;_0x22ca93<_0x607486['conditions'][_0x5646('0x44')];_0x22ca93++){var _0x6c81e4=_0x607486[_0x5646('0x60')][_0x22ca93];var _0x348ca5='i';var _0x547d6e=_[_0x5646('0x61')](_0x56909d,[_0x5646('0x2b'),_0x6c81e4[_0x5646('0x4c')]]);if(!_0x547d6e){switch(_0x6c81e4[_0x5646('0x4c')]){case'unreadMessages':if(_0x6c81e4['value']==0x1){_0x358063[_0x5646('0x62')]('`'+_0x6c81e4['field']+'`\x20=\x200');}else{_0x358063[_0x5646('0x62')]('`'+_0x6c81e4[_0x5646('0x4c')]+_0x5646('0x63'));}break;case'Contact':if(_0x6c81e4[_0x5646('0x64')]==='$substring'){if(_0x6c81e4[_0x5646('0x65')][_0x5646('0x66')]('\x20')[_0x5646('0x44')]>0x1){_0x29f85b[_0x1cc99c](_0x5646('0x67'),qs[_0x5646('0x68')](_0x6c81e4[_0x5646('0x65')]),null);}else{var _0x12e141='%'+_0x6c81e4[_0x5646('0x65')]+'%';_0x29f85b[_0x1cc99c](_0x5646('0x69'),_0x12e141,_0x12e141,_0x12e141);}}else{_0x547d6e=_[_0x5646('0x61')](_0x56909d,[_0x5646('0x2b'),_0x5646('0x6a')]);_0x6c81e4[_0x5646('0x4c')]='ContactId';_0x26d026=as[_0x5646('0x6b')](_0x348ca5,_0x547d6e[_0x5646('0x3c')],_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')]['start'],_0x26d026[_0x5646('0x65')][_0x5646('0x1d')]);}break;case _0x5646('0x6d'):var _0x1b5b9e=_0x6c81e4[_0x5646('0x65')][_0x5646('0x66')](',')['map'](function(_0xfe7f2d){return Number(_0xfe7f2d);});_0x1b5b9e['forEach'](function(_0x34fb4a){_0x27fffc['or'](_0x5646('0x6e'),'%,'+_0x34fb4a+',%');});_0x207665=_['union'](_0x207665,_0x1b5b9e);break;case _0x5646('0x6f'):if(_0x6c81e4[_0x5646('0x64')]===_0x5646('0x70')){_0x29f85b[_0x1cc99c](_0x5646('0x71'),'%'+_0x6c81e4[_0x5646('0x65')]+'%',null);}else{_0x547d6e=_[_0x5646('0x61')](_0x56909d,[_0x5646('0x2b'),'UserId']);_0x6c81e4['field']=_0x5646('0x39');_0x26d026=as[_0x5646('0x6b')](_0x348ca5,_0x547d6e[_0x5646('0x3c')],_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')][_0x5646('0x72')],_0x26d026[_0x5646('0x65')]['end']);}break;case _0x5646('0x73'):_0x26d026=as['buildExpression']('me',null,_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')]['start'],_0x26d026[_0x5646('0x65')][_0x5646('0x1d')]);break;}}else{var _0x26d026=as[_0x5646('0x6b')](_0x348ca5,_0x547d6e[_0x5646('0x3c')],_0x6c81e4);_0x29f85b[_0x1cc99c](_0x26d026[_0x5646('0x6c')],_0x26d026[_0x5646('0x65')]['start'],_0x26d026[_0x5646('0x65')][_0x5646('0x1d')]);}}}else{var _0x4ed2b7=_(_0x310c7f[_0x5646('0x3f')])[_0x5646('0x3e')]()[_0x5646('0x2e')](function(_0x387051){return _['some'](_0x56909d,[_0x5646('0x2b'),_0x387051])?_0x387051:undefined;})['compact']()['value']();if(!_[_0x5646('0x74')](_0x4ed2b7)){_0x4ed2b7[_0x5646('0x75')](function(_0x19c7ea){if(_0x19c7ea==='OpenchannelAccountId'){_0x358063[_0x5646('0x49')](_0x5646('0x76'),[][_0x5646('0x77')](_0x310c7f[_0x5646('0x3f')][_0x19c7ea]));}else if(_0x19c7ea===_0x5646('0x78')){var _0x3eda41=JSON[_0x5646('0x79')](_0x310c7f[_0x5646('0x3f')][_0x19c7ea])[_0x5646('0x7a')];var _0x6afdd3=JSON[_0x5646('0x79')](_0x310c7f[_0x5646('0x3f')][_0x19c7ea])[_0x5646('0x7b')];_0x358063[_0x5646('0x49')](_0x5646('0x7c'),_0x3eda41,_0x6afdd3);}else{if(_0x310c7f[_0x5646('0x3f')][_0x19c7ea]===_0x5646('0x7d')){_0x358063[_0x5646('0x49')]('i.'+_0x19c7ea+_0x5646('0x7e'));}else{_0x358063[_0x5646('0x49')]('i.'+_0x19c7ea+_0x5646('0x7f'),_0x310c7f['query'][_0x19c7ea]);}}});}if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x80')]){if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x80')]==0x1){_0x358063[_0x5646('0x62')](_0x5646('0x81'));}else{_0x358063['having'](_0x5646('0x82'));}}if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x83')]){_0x207665=_[_0x5646('0x84')](_0x310c7f[_0x5646('0x3f')]['tag'])?_0x310c7f['query'][_0x5646('0x83')]:new Array(_0x310c7f[_0x5646('0x3f')][_0x5646('0x83')]);_0x207665['forEach'](function(_0x37844a){_0x27fffc['or'](_0x5646('0x6e'),'%,'+_0x37844a+',%');});}if(_0x310c7f[_0x5646('0x3f')]['filter']){var _0x2892c9=_0x310c7f[_0x5646('0x3f')][_0x5646('0x85')]['replace']('\x5c','\x5c\x5c')[_0x5646('0x86')](/'/g,'\x27\x27');if(qs[_0x5646('0x87')](_0x2892c9)){_0x29f85b['or'](_0x5646('0x88'),_0x2892c9+'%');}else{_0x29f85b['or'](_0x5646('0x89'),qs[_0x5646('0x68')](_0x2892c9))['or'](_0x5646('0x8a'),_0x2892c9+'%')['or'](_0x5646('0x8b'),_0x2892c9+'%');}}}_0x358063[_0x5646('0x49')](_0x29f85b);_0x358063[_0x5646('0x8c')](_0x5646('0x8d'));var _0x38ca73={'type':db[_0x5646('0x8e')][_0x5646('0x8f')][_0x5646('0x90')],'raw':!![]};var _0x221e28=_0x358063[_0x5646('0x91')]();_0x221e28[_0x5646('0x4c')]('i.id');_0x221e28['field'](_0x5646('0x92'),_0x5646('0x93'));if(_0x3cefa2[_0x5646('0x47')]){_0x3cefa2[_0x5646('0x47')]['forEach'](function(_0x3b5005){var _0x56d637=_0x3b5005[0x0]===_0x5646('0x94')?_0x3b5005[0x0]:'i.'+_0x3b5005[0x0];_0x358063['order'](_0x56d637,_0x3b5005[0x1]===_0x5646('0x95')?![]:!![]);});}if(!_[_0x5646('0x74')](_0x207665)){_0x358063[_0x5646('0x62')](_0x27fffc);_0x221e28[_0x5646('0x49')](_0x5646('0x96'),_0x207665);}BPromise['resolve']()[_0x5646('0x27')](function(){if(!_0x607486){if(_0x310c7f[_0x5646('0x3f')][_0x5646('0x97')])return;_0x221e28['where'](_0x5646('0x98'));_0x358063[_0x5646('0x49')](_0x5646('0x98'));return;}if(_0x310c7f['user'][_0x5646('0x99')]!==_0x5646('0x9a'))return;return _0x310c7f[_0x5646('0x9b')][_0x5646('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47b41e){if(_['isEmpty'](_0x47b41e)){_0x221e28[_0x5646('0x49')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x358063[_0x5646('0x49')](_0x5646('0x9d'));}else{_0x221e28[_0x5646('0x49')](_0x5646('0x76'),_[_0x5646('0x2e')](_0x47b41e,'id'));_0x358063[_0x5646('0x49')](_0x5646('0x76'),_[_0x5646('0x2e')](_0x47b41e,'id'));}});})[_0x5646('0x27')](function(){if(_0x310c7f[_0x5646('0x9b')][_0x5646('0x99')]===_0x5646('0x9a')&&!_0x607486&&!_0x310c7f[_0x5646('0x3f')][_0x5646('0x97')])return[];return db[_0x5646('0x9e')][_0x5646('0x3f')](_0x221e28['toString'](),_0x38ca73);})[_0x5646('0x27')](function(_0x5cef6c){_0x1e06b9['count']=_0x5cef6c[_0x5646('0x44')];if(_0x1e06b9[_0x5646('0x21')]===0x0)return[];return db['sequelize']['query'](_0x3a8711[_0x5646('0x9f')](),_0x38ca73)[_0x5646('0x27')](function(_0x2ef0a4){_0x411076=_[_0x5646('0xa0')](_0x2ef0a4,'id');_0x38ca73=_[_0x5646('0xa1')](_0x38ca73,{'model':db[_0x5646('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x310c7f['query'][_0x5646('0x43')]){_0x3cefa2[_0x5646('0x42')]['forEach'](function(_0x248fcf){_0x358063[_0x5646('0x4c')]('i.'+_0x248fcf);});}else{_0x358063[_0x5646('0x4c')](_0x5646('0x92'),_0x5646('0x93'));_0x358063[_0x5646('0x4c')](_0x5646('0xa3'),_0x5646('0xa4'));_0x358063['field']('a.mandatoryDisposition',_0x5646('0xa5'));_0x358063['field'](_0x5646('0xa6'),_0x5646('0x94'));_0x358063[_0x5646('0x4c')](_0x5646('0xa7'));_0x358063[_0x5646('0x4c')](_0x5646('0xa8'),_0x5646('0xa9'));_0x358063[_0x5646('0x4c')](_0x5646('0xaa'),'Contact.lastName');_0x358063['field'](_0x5646('0xab'),'Contact.email');_0x358063['field'](_0x5646('0xac'),_0x5646('0xad'));_0x358063[_0x5646('0x4c')]('c.mobile',_0x5646('0xae'));_0x358063['field']('c.fax',_0x5646('0xaf'));_0x358063[_0x5646('0x4c')](_0x5646('0xb0'),_0x5646('0xb1'));_0x358063[_0x5646('0x4c')]('o.internal',_0x5646('0xb2'));_0x358063[_0x5646('0x4c')](_0x5646('0xb3'),'TagIds');}if(_0x3cefa2[_0x5646('0x1f')])_0x358063['limit'](_0x3cefa2['limit']);if(_0x3cefa2['offset'])_0x358063[_0x5646('0x22')](_0x3cefa2['offset']);return db[_0x5646('0x9e')][_0x5646('0x3f')](_0x358063['toString'](),_0x38ca73);})[_0x5646('0x27')](function(_0x2a4cec){if(_0x2a4cec[_0x5646('0x44')]>0x0)_0x3ef104['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x5646('0x2e')](_0x2a4cec,'id'));return db[_0x5646('0x9e')]['query'](_0x3ef104[_0x5646('0x9f')](),_0x38ca73)[_0x5646('0x27')](function(_0x437c9a){var _0x24bccd=_['groupBy'](_0x437c9a,'OpenchannelInteractionId');var _0x46de9=[];_0x2a4cec['forEach'](function(_0x1ae88e){_0x46de9[_0x5646('0x32')](updateOpenchannelInteraction(_0x1ae88e,_0x411076,_0x24bccd));});return BPromise[_0x5646('0xb4')](_0x46de9);});});})[_0x5646('0x27')](function(_0x52dc18){_0x1e06b9[_0x5646('0xb5')]=_0x52dc18;return _0x1e06b9;})[_0x5646('0x27')](respondWithFilteredResult(_0x2edda1,_0x3cefa2))[_0x5646('0x33')](handleError(_0x2edda1,null));};exports[_0x5646('0xb6')]=function(_0x11d66b,_0xd7f140){var _0x40f2e2={};if(_0x11d66b[_0x5646('0x3f')]['type']&&_0x11d66b[_0x5646('0x3f')][_0x5646('0x3c')]==='from'){_0x40f2e2[_0x5646('0x51')]=_0x11d66b[_0x5646('0xb7')]['id'];}else{_0x40f2e2['id']=_0x11d66b[_0x5646('0xb7')]['id'];}var _0x198153={'raw':![],'where':_0x40f2e2},_0x400fe9={};_0x400fe9[_0x5646('0x3d')]=_[_0x5646('0x3e')](db['OpenchannelInteraction'][_0x5646('0x3a')]);_0x400fe9[_0x5646('0x3f')]=_[_0x5646('0x3e')](_0x11d66b[_0x5646('0x3f')]);_0x400fe9[_0x5646('0x40')]=_[_0x5646('0x41')](_0x400fe9[_0x5646('0x3d')],_0x400fe9[_0x5646('0x3f')]);_0x198153[_0x5646('0x42')]=_['intersection'](_0x400fe9['model'],qs[_0x5646('0x43')](_0x11d66b[_0x5646('0x3f')][_0x5646('0x43')]));_0x198153[_0x5646('0x42')]=_0x198153['attributes'][_0x5646('0x44')]?_0x198153[_0x5646('0x42')]:_0x400fe9[_0x5646('0x3d')];if(_0x11d66b[_0x5646('0x3f')][_0x5646('0xb8')]){_0x198153['include']=[{'all':!![]}];}_0x198153=_['merge']({},_0x198153,_0x11d66b[_0x5646('0xb9')]);return db[_0x5646('0xa2')][_0x5646('0x61')](_0x198153)[_0x5646('0x27')](handleEntityNotFound(_0xd7f140,null))[_0x5646('0x27')](respondWithResult(_0xd7f140,null))[_0x5646('0x33')](handleError(_0xd7f140,null));};exports['create']=function(_0x2fc76b,_0x985e9a){return db[_0x5646('0xa2')][_0x5646('0xba')](_0x2fc76b[_0x5646('0x73')],{})[_0x5646('0x27')](respondWithResult(_0x985e9a,0xc9))[_0x5646('0x33')](handleError(_0x985e9a,null));};exports[_0x5646('0xbb')]=function(_0x2c0292,_0x43fa1d){if(_0x2c0292[_0x5646('0x73')]['id']){delete _0x2c0292['body']['id'];}return db[_0x5646('0xa2')][_0x5646('0x61')]({'where':{'id':_0x2c0292[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x43fa1d,null))['then'](saveUpdates(_0x2c0292[_0x5646('0x73')],null))['then'](respondWithResult(_0x43fa1d,null))['catch'](handleError(_0x43fa1d,null));};exports[_0x5646('0x28')]=function(_0x1af399,_0x3910fc){return db[_0x5646('0xa2')]['find']({'where':{'id':_0x1af399[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x3910fc,null))[_0x5646('0x27')](removeEntity(_0x3910fc,null))['catch'](handleError(_0x3910fc,null));};exports[_0x5646('0xbc')]=function(_0x1ebdb2,_0x2cf868){return db[_0x5646('0xa2')]['describe']()['then'](respondWithResult(_0x2cf868,null))[_0x5646('0x33')](handleError(_0x2cf868,null));};exports[_0x5646('0xbd')]=function(_0x1a4622,_0x5e6696,_0x1d67e2){return db[_0x5646('0xbe')][_0x5646('0x61')]({'where':{'id':_0x1a4622[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x5e6696,null))[_0x5646('0x27')](function(_0x2fd00d){if(_0x2fd00d){return _0x2fd00d[_0x5646('0xbd')](_0x1a4622['body'][_0x5646('0xbf')],_['omit'](_0x1a4622[_0x5646('0x73')],['ids','id'])||{});}})[_0x5646('0x27')](respondWithResult(_0x5e6696,null))[_0x5646('0x33')](handleError(_0x5e6696,null));};exports[_0x5646('0xc0')]=function(_0x126b75,_0x39d930,_0x158416){var _0x22fd33={'raw':![],'where':{}};var _0xf07653={};var _0x3f9ca6={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x126b75[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x39d930,null))[_0x5646('0x27')](function(_0x2c57d6){if(_0x2c57d6){_0xf07653[_0x5646('0x3d')]=_[_0x5646('0x3e')](db[_0x5646('0xbe')][_0x5646('0x3a')]);_0xf07653[_0x5646('0x3f')]=_[_0x5646('0x3e')](_0x126b75['query']);_0xf07653[_0x5646('0x40')]=_[_0x5646('0x41')](_0xf07653[_0x5646('0x3d')],_0xf07653[_0x5646('0x3f')]);_0x22fd33[_0x5646('0x42')]=_['intersection'](_0xf07653['model'],qs[_0x5646('0x43')](_0x126b75[_0x5646('0x3f')][_0x5646('0x43')]));_0x22fd33[_0x5646('0x42')]=_0x22fd33[_0x5646('0x42')][_0x5646('0x44')]?_0x22fd33[_0x5646('0x42')]:_0xf07653['model'];if(!_0x126b75['query'][_0x5646('0x45')](_0x5646('0x46'))){_0x22fd33[_0x5646('0x1f')]=qs[_0x5646('0x1f')](_0x126b75['query']['limit']);_0x22fd33['offset']=qs[_0x5646('0x22')](_0x126b75[_0x5646('0x3f')][_0x5646('0x22')]);}_0x22fd33['order']=qs[_0x5646('0x48')](_0x126b75[_0x5646('0x3f')]['sort']);_0x22fd33[_0x5646('0x49')]=qs[_0x5646('0x40')](_['pick'](_0x126b75['query'],_0xf07653[_0x5646('0x40')]));_0x22fd33['where'][_0x5646('0xc1')]=_0x2c57d6['id'];if(_0x126b75['query'][_0x5646('0x85')]){_0x22fd33[_0x5646('0x49')]=_[_0x5646('0xa1')](_0x22fd33[_0x5646('0x49')],{'$or':_[_0x5646('0x2e')](_0x22fd33[_0x5646('0x42')],function(_0x36c139){var _0x32696d={};_0x32696d[_0x36c139]={'$like':'%'+_0x126b75['query'][_0x5646('0x85')]+'%'};return _0x32696d;})});}if(_0x126b75[_0x5646('0x3f')][_0x5646('0x7a')]){var _0x551e91=_0x126b75['query']['$gte'][_0x5646('0x66')](',');var _0x14ba74={};_0x14ba74[_0x551e91[0x0]]={'$gte':moment(_0x551e91[0x1])['format'](_0x5646('0xc2'))};_0x22fd33['where']=_[_0x5646('0xa1')](_0x22fd33['where'],_0x14ba74);}_0x22fd33=_[_0x5646('0xa1')]({},_0x22fd33,_0x126b75[_0x5646('0xb9')]);return db[_0x5646('0xbe')][_0x5646('0x21')]({'where':_0x22fd33['where']})[_0x5646('0x27')](function(_0x4ac538){_0x3f9ca6[_0x5646('0x21')]=_0x4ac538;if(_0x126b75[_0x5646('0x3f')]['includeAll']){_0x22fd33[_0x5646('0xc3')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x22fd33);})[_0x5646('0x27')](function(_0x575b62){_0x3f9ca6[_0x5646('0xb5')]=_0x575b62;return _0x3f9ca6;});}})[_0x5646('0x27')](respondWithFilteredResult(_0x39d930,_0x22fd33))[_0x5646('0x33')](handleError(_0x39d930,null));};exports[_0x5646('0xc4')]=function(_0x307a60,_0x1dec9f,_0x4657e1){return db[_0x5646('0xa2')]['find']({'where':{'id':_0x307a60[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x1dec9f,null))[_0x5646('0x27')](function(_0x228509){if(_0x228509){return _0x228509[_0x5646('0xc5')](_0x307a60['body'][_0x5646('0xbf')],_[_0x5646('0xc6')](_0x307a60[_0x5646('0x73')],[_0x5646('0xbf'),'id'])||{})[_0x5646('0xc7')](function(){return db[_0x5646('0x6d')]['findAll']({'attributes':['id',_0x5646('0x2b'),_0x5646('0x4d')],'where':{'id':_0x307a60['body'][_0x5646('0xbf')]}});})[_0x5646('0x27')](function(_0x1088d4){socket[_0x5646('0xc8')](_0x5646('0xc9'),{'id':Number(_0x307a60[_0x5646('0xb7')]['id']),'tags':_0x1088d4||[]});return{'id':Number(_0x307a60[_0x5646('0xb7')]['id']),'tags':_0x1088d4||[]};});}})[_0x5646('0x27')](respondWithResult(_0x1dec9f,null))[_0x5646('0x33')](handleError(_0x1dec9f,null));};exports['removeTags']=function(_0x3f0950,_0x3793ba,_0x4db686){return db[_0x5646('0xa2')][_0x5646('0x61')]({'where':{'id':_0x3f0950[_0x5646('0xb7')]['id']}})[_0x5646('0x27')](handleEntityNotFound(_0x3793ba,null))['then'](function(_0x49dc44){if(_0x49dc44){return _0x49dc44['removeTags'](_0x3f0950['query'][_0x5646('0xbf')]);}})[_0x5646('0x27')](respondWithStatusCode(_0x3793ba,null))[_0x5646('0x33')](handleError(_0x3793ba,null));};exports[_0x5646('0xca')]=function(_0x36109a,_0x984ec){var _0x151320=moment()[_0x5646('0xcb')]()['toString']();var _0x5c033c=path[_0x5646('0xcc')](config[_0x5646('0xcd')],'server',_0x5646('0xce'),'tmp');var _0x5a3c4d=path[_0x5646('0xcc')](config['root'],'server',_0x5646('0xce'),_0x5646('0xcf'));var _0x5abf81=path[_0x5646('0xcc')](_0x5c033c,_0x151320);var _0x193df8=util[_0x5646('0xd0')](_0x5646('0xd1'),_0x36109a[_0x5646('0xb7')]['id'],_0x151320);var _0xe98661=path['join'](_0x5c033c,_0x193df8);var _0x5f5091=[];_0x5f5091['push']({'model':db[_0x5646('0x6f')],'as':_0x5646('0x6f'),'attributes':['id',_0x5646('0x2f')],'raw':!![]});_0x5f5091[_0x5646('0x32')]({'model':db[_0x5646('0xd2')],'as':_0x5646('0xd3'),'attributes':['id','firstName',_0x5646('0xd4')],'raw':!![]});if(_0x36109a[_0x5646('0x3f')]['attachments']){_0x5f5091[_0x5646('0x32')]({'model':db[_0x5646('0xd5')],'as':_0x5646('0xd5'),'raw':!![]});}var _0x1381e6=[{'model':db[_0x5646('0xbe')],'as':'Messages','attributes':['id',_0x5646('0x73'),'createdAt',_0x5646('0xd6'),_0x5646('0xd7'),_0x5646('0x80')],'include':_0x5f5091}];_0x1381e6['push']({'model':db[_0x5646('0xd8')],'as':_0x5646('0xd9'),'attributes':['id',_0x5646('0x2b')]});_0x1381e6[_0x5646('0x32')]({'model':db[_0x5646('0x6f')],'as':_0x5646('0xda'),'attributes':['id',_0x5646('0x2f')]});return db[_0x5646('0xa2')]['find']({'where':{'id':_0x36109a[_0x5646('0xb7')]['id']},'include':_0x1381e6})[_0x5646('0x27')](handleEntityNotFound(_0x984ec,null))[_0x5646('0x27')](function(_0x4cb9a7){if(_0x4cb9a7){var _0x33eec2=_0x4cb9a7['get']({'plain':!![]});fs['mkdirSync'](_0x5abf81);var _0x3aff6a={'channel':_0x5646('0xdb'),'account':_0x33eec2['Account'][_0x5646('0x2b')],'agent':_0x33eec2[_0x5646('0xda')]?_0x33eec2['Owner'][_0x5646('0x2f')]:_0x5646('0xdc'),'createdAt':moment(_0x33eec2[_0x5646('0x78')])[_0x5646('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x33eec2[_0x5646('0x38')]?moment(_0x33eec2[_0x5646('0xdd')])[_0x5646('0xd0')](_0x5646('0xc2'))[_0x5646('0x9f')]():'','disposition':_0x33eec2[_0x5646('0xde')],'visibility':_0x33eec2[_0x5646('0xdf')]?_0x5646('0xe0'):_0x5646('0xe1'),'messages':_(_0x33eec2['Messages'])[_0x5646('0x85')]({'secret':![]})['map'](function(_0x57a165){if(_0x57a165[_0x5646('0xd5')]){var _0x35cf31=path[_0x5646('0xcc')](_0x5a3c4d,_0x57a165['Attachment'][_0x5646('0xe2')]);if(fs[_0x5646('0xe3')](_0x35cf31)){fs['createReadStream'](_0x35cf31)['pipe'](fs[_0x5646('0xe4')](path[_0x5646('0xcc')](_0x5abf81,_0x57a165[_0x5646('0xd5')][_0x5646('0xe2')])));}}return{'date':moment(_0x57a165[_0x5646('0x78')])[_0x5646('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5646('0x9f')](),'sender':_0x57a165[_0x5646('0xd6')]===_0x5646('0xe5')?_0x57a165[_0x5646('0x6f')]?_0x57a165[_0x5646('0x6f')]['fullname']:_0x5646('0xe6'):_0x57a165['Contact'][_0x5646('0xe7')]+(_0x57a165[_0x5646('0xd3')][_0x5646('0xd4')]?'\x20'+_0x57a165['Contact'][_0x5646('0xd4')]:''),'body':_0x57a165[_0x5646('0xd5')]?_0x57a165[_0x5646('0xd5')][_0x5646('0xe2')]:_0x57a165[_0x5646('0x73')],'direction':_0x57a165[_0x5646('0xd6')]===_0x5646('0xe5')?'A':'C','secret':_0x57a165[_0x5646('0xd7')],'read':_0x57a165['read'],'attachment':_0x57a165[_0x5646('0xd5')]};})[_0x5646('0x65')]()};return ejs['renderFile'](path['join'](config[_0x5646('0xcd')],'server',_0x5646('0xe8'),_0x5646('0xe9')),{'interaction':_0x3aff6a})['then'](function(_0x1e1c13){var _0x29a75d=path[_0x5646('0xcc')](_0x5abf81,_0x5646('0xea')+_0x33eec2['id']+'-'+_0x151320+'.pdf');var _0x55c85e={'path':_0x29a75d,'channel':_0x5646('0xdb'),'interactionId':_0x33eec2['id']};return pdf[_0x5646('0xeb')](_0x1e1c13,_0x55c85e);})['then'](function(){return new BPromise(function(_0x3c8fc0,_0x24580d){zipdir(_0x5abf81,{'saveTo':_0xe98661},function(_0x42d641,_0x1a2b6c){if(_0x42d641)return _0x24580d(_0x42d641);return _0x3c8fc0(_0x1a2b6c);});})[_0x5646('0x27')](function(){return new BPromise(function(_0x2c6ed5,_0x2c9c32){rimraf(_0x5abf81,function(_0x12cd16){if(_0x12cd16)_0x2c9c32(_0x12cd16);return _0x2c6ed5();});});})['then'](function(){return _0x984ec[_0x5646('0xca')](_0xe98661,_0x193df8,function(_0xd4e5f9){if(_0xd4e5f9){console['log'](_0x5646('0xec'),_0xd4e5f9);}else{fs['unlinkSync'](_0xe98661);}});});});}else{return _0x984ec[_0x5646('0x1b')](0xc8);}})['catch'](handleError(_0x984ec,null));}; \ No newline at end of file +var _0x4a12=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','end','stack','name','send','Users','map','split','forEach','Tags','push','TagIds','catch','waiting','answered','unmanaged','total','closed','UserId','talking','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','select','field','color','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','show','params','includeAll','include','merge','options','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','emit','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','direction','secret','Account','Owner','mkdirSync','Openchannel','N.A.','createdAt','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv'];(function(_0x4e23a8,_0x5e76c0){var _0x1c8947=function(_0x1f5b0e){while(--_0x1f5b0e){_0x4e23a8['push'](_0x4e23a8['shift']());}};_0x1c8947(++_0x5e76c0);}(_0x4a12,0x1d6));var _0x24a1=function(_0x602436,_0xbf433){_0x602436=_0x602436-0x0;var _0x504c33=_0x4a12[_0x602436];return _0x504c33;};'use strict';var emlformat=require(_0x24a1('0x0'));var rimraf=require(_0x24a1('0x1'));var zipdir=require(_0x24a1('0x2'));var jsonpatch=require(_0x24a1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x24a1('0x4'));var Mustache=require(_0x24a1('0x5'));var util=require(_0x24a1('0x6'));var path=require(_0x24a1('0x7'));var sox=require(_0x24a1('0x8'));var csv=require('to-csv');var ejs=require(_0x24a1('0x9'));var fs=require('fs');var fs_extra=require(_0x24a1('0xa'));var _=require('lodash');var squel=require(_0x24a1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x24a1('0xc'));var toCsv=require(_0x24a1('0xd'));var querystring=require(_0x24a1('0xe'));var Papa=require(_0x24a1('0xf'));var Redis=require(_0x24a1('0x10'));var authService=require(_0x24a1('0x11'));var qs=require(_0x24a1('0x12'));var as=require(_0x24a1('0x13'));var pdf=require(_0x24a1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24a1('0x15'))(_0x24a1('0x16'));var utils=require(_0x24a1('0x17'));var config=require(_0x24a1('0x18'));var licenseUtil=require(_0x24a1('0x19'));var db=require(_0x24a1('0x1a'))['db'];config['redis']=_[_0x24a1('0x1b')](config[_0x24a1('0x1c')],{'host':_0x24a1('0x1d'),'port':0x18eb});var socket=require(_0x24a1('0x1e'))(new Redis(config[_0x24a1('0x1c')]));require(_0x24a1('0x1f'))['register'](socket);function respondWithStatusCode(_0x81764f,_0x25a60a){_0x25a60a=_0x25a60a||0xcc;return function(_0x114cbc){if(_0x114cbc){return _0x81764f[_0x24a1('0x20')](_0x25a60a);}return _0x81764f[_0x24a1('0x21')](_0x25a60a)['end']();};}function respondWithResult(_0x463e73,_0x415a72){_0x415a72=_0x415a72||0xc8;return function(_0x441fe9){if(_0x441fe9){return _0x463e73[_0x24a1('0x21')](_0x415a72)[_0x24a1('0x22')](_0x441fe9);}};}function respondWithFilteredResult(_0x33e74f,_0x660f35){return function(_0x512aca){if(_0x512aca){var _0x36785d=typeof _0x660f35[_0x24a1('0x23')]===_0x24a1('0x24')&&typeof _0x660f35['limit']==='undefined';var _0x3b3ddc=_0x512aca[_0x24a1('0x25')];var _0x34e292=_0x36785d?0x0:_0x660f35[_0x24a1('0x23')];var _0x412a0d=_0x36785d?_0x512aca[_0x24a1('0x25')]:_0x660f35[_0x24a1('0x23')]+_0x660f35[_0x24a1('0x26')];var _0x43d1cc;if(_0x412a0d>=_0x3b3ddc){_0x412a0d=_0x3b3ddc;_0x43d1cc=0xc8;}else{_0x43d1cc=0xce;}_0x33e74f[_0x24a1('0x21')](_0x43d1cc);return _0x33e74f[_0x24a1('0x27')]('Content-Range',_0x34e292+'-'+_0x412a0d+'/'+_0x3b3ddc)['json'](_0x512aca);}return null;};}function patchUpdates(_0x16ec9a){return function(_0x253611){try{jsonpatch[_0x24a1('0x28')](_0x253611,_0x16ec9a,!![]);}catch(_0x51399f){return BPromise[_0x24a1('0x29')](_0x51399f);}return _0x253611[_0x24a1('0x2a')]();};}function saveUpdates(_0x19bf04,_0x6afa8e){return function(_0x1e1dca){if(_0x1e1dca){return _0x1e1dca[_0x24a1('0x2b')](_0x19bf04)[_0x24a1('0x2c')](function(_0x1f8be0){return _0x1f8be0;});}return null;};}function removeEntity(_0x4216f1,_0x390327){return function(_0x262530){if(_0x262530){return _0x262530['destroy']()['then'](function(){_0x4216f1['status'](0xcc)[_0x24a1('0x2d')]();});}};}function handleEntityNotFound(_0xb5c4d7,_0x1b03f0){return function(_0x45956d){if(!_0x45956d){_0xb5c4d7[_0x24a1('0x20')](0x194);}return _0x45956d;};}function handleError(_0x3a04fa,_0x4e1510){_0x4e1510=_0x4e1510||0x1f4;return function(_0x408218){logger['error'](_0x408218[_0x24a1('0x2e')]);if(_0x408218[_0x24a1('0x2f')]){delete _0x408218[_0x24a1('0x2f')];}_0x3a04fa[_0x24a1('0x21')](_0x4e1510)[_0x24a1('0x30')](_0x408218);};}function getInteractionUsers(_0x5a21f5,_0x50b9de){return new BPromise(function(_0x44fa7c,_0x5c34d3){try{if(_0x50b9de[_0x5a21f5['id']]){_0x5a21f5[_0x24a1('0x31')]=_[_0x24a1('0x32')](_0x50b9de[_0x5a21f5['id']],function(_0x16480d){return{'id':_0x16480d['id'],'fullname':_0x16480d['fullname']};});}}catch(_0x2447fa){_0x5c34d3(_0x2447fa);}_0x44fa7c(_0x5a21f5);});}function getInteractionTags(_0x2a99d4,_0x4ec0f7){return new BPromise(function(_0x564532,_0x2d343c){try{if(_0x2a99d4['TagIds']){_0x2a99d4['Tags']=[];_0x2a99d4['TagIds'][_0x24a1('0x33')](',')[_0x24a1('0x34')](function(_0x1830e0){_0x2a99d4[_0x24a1('0x35')][_0x24a1('0x36')](_0x4ec0f7[_0x1830e0]);});}delete _0x2a99d4[_0x24a1('0x37')];}catch(_0x5ac9b0){_0x2d343c(_0x5ac9b0);}_0x564532(_0x2a99d4);});}function updateOpenchannelInteraction(_0x3cc8b9,_0x509ce3,_0x57a4ea){return new BPromise(function(_0x2caf66,_0x306bd4){return getInteractionUsers(_0x3cc8b9,_0x57a4ea)[_0x24a1('0x2c')](function(_0x3c02a0){return getInteractionTags(_0x3c02a0,_0x509ce3);})[_0x24a1('0x2c')](function(_0x1fa3b3){return getStateInteraction(_0x1fa3b3);})['then'](function(_0x2f980f){_0x2caf66(_0x2f980f);})[_0x24a1('0x38')](function(_0x264cd2){_0x306bd4(_0x264cd2);});});}function getStateInteraction(_0x3c46db){return new BPromise(function(_0x271480){_0x3c46db[_0x24a1('0x39')]=0x0;_0x3c46db['talking']=0x0;_0x3c46db[_0x24a1('0x3a')]=0x0;_0x3c46db[_0x24a1('0x3b')]=0x0;_0x3c46db[_0x24a1('0x3c')]=0x0;if(!_0x3c46db[_0x24a1('0x3d')]&&!_0x3c46db[_0x24a1('0x3e')]){_0x3c46db[_0x24a1('0x39')]+=0x1;}if(!_0x3c46db[_0x24a1('0x3d')]&&_0x3c46db[_0x24a1('0x3e')]){_0x3c46db['talking']+=0x1;ids['push'](_0x3c46db['id']);if(_0x3c46db['waiting']){_0x3c46db['waiting']-=0x1;}}if(_0x3c46db[_0x24a1('0x3d')]&&_0x3c46db[_0x24a1('0x3e')]){_0x3c46db[_0x24a1('0x3a')]+=0x1;if(_0x3c46db[_0x24a1('0x3f')]){_0x3c46db[_0x24a1('0x3f')]-=0x1;}}if(_0x3c46db[_0x24a1('0x3d')]&&!_0x3c46db['UserId']){_0x3c46db[_0x24a1('0x3b')]+=0x1;if(_0x3c46db['waiting']){_0x3c46db[_0x24a1('0x39')]-=0x1;}}_0x3c46db[_0x24a1('0x3c')]+=0x1;_0x271480(_0x3c46db);});}exports['index']=function(_0x1de44e,_0x1c5ae0){var _0x490fdf={},_0xf54678={},_0x3bbddf={'count':0x0,'rows':[]};var _0x2563c0=_['map'](db[_0x24a1('0x40')][_0x24a1('0x41')],function(_0x5638cb){return{'name':_0x5638cb[_0x24a1('0x42')],'type':_0x5638cb[_0x24a1('0x43')]['key']};});_0xf54678[_0x24a1('0x44')]=_['map'](_0x2563c0,_0x24a1('0x2f'));_0xf54678[_0x24a1('0x45')]=_[_0x24a1('0x46')](_0x1de44e[_0x24a1('0x45')]);_0xf54678[_0x24a1('0x47')]=_['intersection'](_0xf54678['model'],_0xf54678[_0x24a1('0x45')]);_0x490fdf[_0x24a1('0x48')]=_[_0x24a1('0x49')](_0xf54678[_0x24a1('0x44')],qs[_0x24a1('0x4a')](_0x1de44e['query'][_0x24a1('0x4a')]));_0x490fdf[_0x24a1('0x48')]=_0x490fdf['attributes'][_0x24a1('0x4b')]?_0x490fdf[_0x24a1('0x48')]:_0xf54678[_0x24a1('0x44')];if(!_0x1de44e['query']['hasOwnProperty'](_0x24a1('0x4c'))){_0x490fdf[_0x24a1('0x26')]=qs[_0x24a1('0x26')](_0x1de44e[_0x24a1('0x45')]['limit']);_0x490fdf[_0x24a1('0x23')]=qs['offset'](_0x1de44e['query'][_0x24a1('0x23')]);}_0x490fdf[_0x24a1('0x4d')]=qs[_0x24a1('0x4e')](_0x1de44e[_0x24a1('0x45')][_0x24a1('0x4e')]);_0x490fdf[_0x24a1('0x4f')]=qs[_0x24a1('0x47')](_[_0x24a1('0x50')](_0x1de44e[_0x24a1('0x45')],_0xf54678[_0x24a1('0x47')]),_0x2563c0);var _0x152a20=[];var _0x24165f=squel[_0x24a1('0x51')]()[_0x24a1('0x52')]('id')[_0x24a1('0x52')](_0x24a1('0x2f'))['field'](_0x24a1('0x53'))['from']('tools_tags');var _0x130269=squel[_0x24a1('0x51')]()['field']('u.id')['field'](_0x24a1('0x54'))[_0x24a1('0x52')](_0x24a1('0x55'))[_0x24a1('0x56')](_0x24a1('0x57'),'ui')[_0x24a1('0x58')](_0x24a1('0x59'),'u',_0x24a1('0x5a'));var _0x33e5a8=squel['select']()[_0x24a1('0x56')]('openchannel_interactions','i')['left_join'](_0x24a1('0x5b'),'c',_0x24a1('0x5c'))[_0x24a1('0x58')]('users','o',_0x24a1('0x5d'))[_0x24a1('0x58')]('openchannel_accounts','a',_0x24a1('0x5e'))[_0x24a1('0x58')](_0x24a1('0x5f'),'me',_0x24a1('0x60'))[_0x24a1('0x58')](_0x24a1('0x61'),'it',_0x24a1('0x62'))[_0x24a1('0x58')]('tools_tags','t',_0x24a1('0x63'));var _0x39845c=squel['expr']();var _0x1643fd=[];var _0x43487d=squel[_0x24a1('0x64')]();var _0x4d255d;if(_0x1de44e[_0x24a1('0x45')][_0x24a1('0x65')]){_0x4d255d=as[_0x24a1('0x66')](_0x1de44e[_0x24a1('0x45')][_0x24a1('0x65')]);var _0x428270=_0x4d255d['sqlOperator'];for(var _0x1aeeef=0x0;_0x1aeeef<_0x4d255d[_0x24a1('0x67')][_0x24a1('0x4b')];_0x1aeeef++){var _0x79af29=_0x4d255d[_0x24a1('0x67')][_0x1aeeef];var _0x259d46='i';var _0x570670=_[_0x24a1('0x68')](_0x2563c0,[_0x24a1('0x2f'),_0x79af29[_0x24a1('0x52')]]);if(!_0x570670){switch(_0x79af29['field']){case _0x24a1('0x69'):if(_0x79af29[_0x24a1('0x6a')]==0x1){_0x33e5a8['having']('`'+_0x79af29['field']+_0x24a1('0x6b'));}else{_0x33e5a8[_0x24a1('0x6c')]('`'+_0x79af29[_0x24a1('0x52')]+_0x24a1('0x6d'));}break;case _0x24a1('0x6e'):if(_0x79af29[_0x24a1('0x6f')]===_0x24a1('0x70')){if(_0x79af29[_0x24a1('0x6a')][_0x24a1('0x33')]('\x20')['length']>0x1){_0x39845c[_0x428270](_0x24a1('0x71'),qs[_0x24a1('0x72')](_0x79af29[_0x24a1('0x6a')]),null);}else{var _0x498177='%'+_0x79af29[_0x24a1('0x6a')]+'%';_0x39845c[_0x428270](_0x24a1('0x73'),_0x498177,_0x498177,_0x498177);}}else{_0x570670=_['find'](_0x2563c0,[_0x24a1('0x2f'),_0x24a1('0x74')]);_0x79af29['field']=_0x24a1('0x74');_0x566a9a=as[_0x24a1('0x75')](_0x259d46,_0x570670[_0x24a1('0x43')],_0x79af29);_0x39845c[_0x428270](_0x566a9a[_0x24a1('0x76')],_0x566a9a['value'][_0x24a1('0x77')],_0x566a9a[_0x24a1('0x6a')][_0x24a1('0x2d')]);}break;case _0x24a1('0x78'):var _0x2eee58=_0x79af29['value'][_0x24a1('0x33')](',')[_0x24a1('0x32')](function(_0x16bdb4){return Number(_0x16bdb4);});_0x2eee58[_0x24a1('0x34')](function(_0x408009){_0x43487d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x408009+',%');});_0x1643fd=_['union'](_0x1643fd,_0x2eee58);break;case _0x24a1('0x79'):if(_0x79af29[_0x24a1('0x6f')]===_0x24a1('0x70')){_0x39845c[_0x428270](_0x24a1('0x7a'),'%'+_0x79af29[_0x24a1('0x6a')]+'%',null);}else{_0x570670=_[_0x24a1('0x68')](_0x2563c0,[_0x24a1('0x2f'),_0x24a1('0x3e')]);_0x79af29['field']='UserId';_0x566a9a=as['buildExpression'](_0x259d46,_0x570670[_0x24a1('0x43')],_0x79af29);_0x39845c[_0x428270](_0x566a9a[_0x24a1('0x76')],_0x566a9a[_0x24a1('0x6a')][_0x24a1('0x77')],_0x566a9a[_0x24a1('0x6a')][_0x24a1('0x2d')]);}break;case _0x24a1('0x7b'):_0x566a9a=as[_0x24a1('0x75')]('me',null,_0x79af29);_0x39845c[_0x428270](_0x566a9a[_0x24a1('0x76')],_0x566a9a['value'][_0x24a1('0x77')],_0x566a9a[_0x24a1('0x6a')][_0x24a1('0x2d')]);break;}}else{var _0x566a9a=as['buildExpression'](_0x259d46,_0x570670[_0x24a1('0x43')],_0x79af29);_0x39845c[_0x428270](_0x566a9a[_0x24a1('0x76')],_0x566a9a[_0x24a1('0x6a')][_0x24a1('0x77')],_0x566a9a[_0x24a1('0x6a')][_0x24a1('0x2d')]);}}}else{var _0x31aead=_(_0x1de44e[_0x24a1('0x45')])[_0x24a1('0x46')]()[_0x24a1('0x32')](function(_0x44dc36){return _['some'](_0x2563c0,['name',_0x44dc36])?_0x44dc36:undefined;})[_0x24a1('0x7c')]()[_0x24a1('0x6a')]();if(!_[_0x24a1('0x7d')](_0x31aead)){_0x31aead['forEach'](function(_0x360a9c){if(_0x360a9c===_0x24a1('0x7e')){_0x33e5a8[_0x24a1('0x4f')](_0x24a1('0x7f'),[]['concat'](_0x1de44e[_0x24a1('0x45')][_0x360a9c]));}else if(_0x360a9c==='createdAt'){var _0x11c525=JSON[_0x24a1('0x80')](_0x1de44e[_0x24a1('0x45')][_0x360a9c])['$gte'];var _0x505bd2=JSON[_0x24a1('0x80')](_0x1de44e[_0x24a1('0x45')][_0x360a9c])['$lte'];_0x33e5a8[_0x24a1('0x4f')](_0x24a1('0x81'),_0x11c525,_0x505bd2);}else{if(_0x1de44e[_0x24a1('0x45')][_0x360a9c]===_0x24a1('0x82')){_0x33e5a8[_0x24a1('0x4f')]('i.'+_0x360a9c+_0x24a1('0x83'));}else{_0x33e5a8['where']('i.'+_0x360a9c+'\x20=\x20?',_0x1de44e[_0x24a1('0x45')][_0x360a9c]);}}});}if(_0x1de44e['query'][_0x24a1('0x84')]){if(_0x1de44e[_0x24a1('0x45')][_0x24a1('0x84')]==0x1){_0x33e5a8['having'](_0x24a1('0x85'));}else{_0x33e5a8[_0x24a1('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x1de44e[_0x24a1('0x45')][_0x24a1('0x86')]){_0x1643fd=_[_0x24a1('0x87')](_0x1de44e[_0x24a1('0x45')][_0x24a1('0x86')])?_0x1de44e[_0x24a1('0x45')][_0x24a1('0x86')]:new Array(_0x1de44e['query'][_0x24a1('0x86')]);_0x1643fd[_0x24a1('0x34')](function(_0x55579a){_0x43487d['or'](_0x24a1('0x88'),'%,'+_0x55579a+',%');});}if(_0x1de44e[_0x24a1('0x45')][_0x24a1('0x89')]){var _0x3a4fa=_0x1de44e[_0x24a1('0x45')][_0x24a1('0x89')]['replace']('\x5c','\x5c\x5c')[_0x24a1('0x8a')](/'/g,'\x27\x27');if(qs[_0x24a1('0x8b')](_0x3a4fa)){_0x39845c['or'](_0x24a1('0x8c'),_0x3a4fa+'%');}else{_0x39845c['or'](_0x24a1('0x8d'),qs[_0x24a1('0x72')](_0x3a4fa))['or']('i.from\x20LIKE\x20?',_0x3a4fa+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3a4fa+'%');}}}_0x33e5a8[_0x24a1('0x4f')](_0x39845c);_0x33e5a8[_0x24a1('0x8e')](_0x24a1('0x8f'));var _0x303db2={'type':db[_0x24a1('0x90')][_0x24a1('0x91')]['SELECT'],'raw':!![]};var _0x2ff18d=_0x33e5a8[_0x24a1('0x92')]();_0x2ff18d[_0x24a1('0x52')](_0x24a1('0x8f'));_0x2ff18d[_0x24a1('0x52')](_0x24a1('0x93'),_0x24a1('0x69'));if(_0x490fdf[_0x24a1('0x4d')]){_0x490fdf[_0x24a1('0x4d')][_0x24a1('0x34')](function(_0x225143){var _0x408812=_0x225143[0x0]===_0x24a1('0x94')?_0x225143[0x0]:'i.'+_0x225143[0x0];_0x33e5a8[_0x24a1('0x4d')](_0x408812,_0x225143[0x1]==='DESC'?![]:!![]);});}if(!_[_0x24a1('0x7d')](_0x1643fd)){_0x33e5a8['having'](_0x43487d);_0x2ff18d[_0x24a1('0x4f')](_0x24a1('0x95'),_0x1643fd);}BPromise['resolve']()[_0x24a1('0x2c')](function(){if(!_0x4d255d){if(_0x1de44e['query'][_0x24a1('0x7e')])return;_0x2ff18d['where'](_0x24a1('0x96'));_0x33e5a8[_0x24a1('0x4f')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1de44e[_0x24a1('0x97')]['role']!==_0x24a1('0x98'))return;return _0x1de44e[_0x24a1('0x97')][_0x24a1('0x99')]({'attributes':['id'],'raw':!![]})[_0x24a1('0x2c')](function(_0x11e634){if(_[_0x24a1('0x7d')](_0x11e634)){_0x2ff18d[_0x24a1('0x4f')](_0x24a1('0x9a'));_0x33e5a8[_0x24a1('0x4f')](_0x24a1('0x9a'));}else{_0x2ff18d[_0x24a1('0x4f')](_0x24a1('0x7f'),_['map'](_0x11e634,'id'));_0x33e5a8[_0x24a1('0x4f')](_0x24a1('0x7f'),_[_0x24a1('0x32')](_0x11e634,'id'));}});})['then'](function(){if(_0x1de44e[_0x24a1('0x97')][_0x24a1('0x9b')]===_0x24a1('0x98')&&!_0x4d255d&&!_0x1de44e[_0x24a1('0x45')][_0x24a1('0x7e')])return[];return db[_0x24a1('0x9c')]['query'](_0x2ff18d['toString'](),_0x303db2);})[_0x24a1('0x2c')](function(_0x547c98){_0x3bbddf['count']=_0x547c98[_0x24a1('0x4b')];if(_0x3bbddf['count']===0x0)return[];return db['sequelize'][_0x24a1('0x45')](_0x24165f[_0x24a1('0x9d')](),_0x303db2)[_0x24a1('0x2c')](function(_0x2a3617){_0x152a20=_[_0x24a1('0x9e')](_0x2a3617,'id');_0x303db2=_['merge'](_0x303db2,{'model':db[_0x24a1('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1de44e[_0x24a1('0x45')][_0x24a1('0x4a')]){_0x490fdf[_0x24a1('0x48')][_0x24a1('0x34')](function(_0x3243c2){_0x33e5a8[_0x24a1('0x52')]('i.'+_0x3243c2);});}else{_0x33e5a8[_0x24a1('0x52')](_0x24a1('0x93'),_0x24a1('0x69'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0x9f'),_0x24a1('0xa0'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xa1'),'Account.mandatoryDisposition');_0x33e5a8['field']('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',_0x24a1('0x94'));_0x33e5a8['field'](_0x24a1('0xa2'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xa3'),_0x24a1('0xa4'));_0x33e5a8[_0x24a1('0x52')]('c.lastName',_0x24a1('0xa5'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xa6'),_0x24a1('0xa7'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xa8'),_0x24a1('0xa9'));_0x33e5a8[_0x24a1('0x52')]('c.mobile',_0x24a1('0xaa'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xab'),'Contact.fax');_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xac'),_0x24a1('0xad'));_0x33e5a8[_0x24a1('0x52')]('o.internal',_0x24a1('0xae'));_0x33e5a8[_0x24a1('0x52')](_0x24a1('0xaf'),_0x24a1('0x37'));}if(_0x490fdf[_0x24a1('0x26')])_0x33e5a8[_0x24a1('0x26')](_0x490fdf[_0x24a1('0x26')]);if(_0x490fdf[_0x24a1('0x23')])_0x33e5a8['offset'](_0x490fdf[_0x24a1('0x23')]);return db[_0x24a1('0x9c')][_0x24a1('0x45')](_0x33e5a8[_0x24a1('0x9d')](),_0x303db2);})[_0x24a1('0x2c')](function(_0xf1d946){if(_0xf1d946[_0x24a1('0x4b')]>0x0)_0x130269[_0x24a1('0x4f')](_0x24a1('0xb0'),_[_0x24a1('0x32')](_0xf1d946,'id'));return db[_0x24a1('0x9c')][_0x24a1('0x45')](_0x130269[_0x24a1('0x9d')](),_0x303db2)['then'](function(_0x896930){var _0x10785a=_[_0x24a1('0xb1')](_0x896930,_0x24a1('0xb2'));var _0x8ecade=[];_0xf1d946[_0x24a1('0x34')](function(_0x5c9e7a){_0x8ecade[_0x24a1('0x36')](updateOpenchannelInteraction(_0x5c9e7a,_0x152a20,_0x10785a));});return BPromise[_0x24a1('0xb3')](_0x8ecade);});});})[_0x24a1('0x2c')](function(_0x3ff694){_0x3bbddf['rows']=_0x3ff694;return _0x3bbddf;})['then'](respondWithFilteredResult(_0x1c5ae0,_0x490fdf))[_0x24a1('0x38')](handleError(_0x1c5ae0,null));};exports[_0x24a1('0xb4')]=function(_0x16a8ba,_0x347f1f){var _0x4307a3={};if(_0x16a8ba[_0x24a1('0x45')][_0x24a1('0x43')]&&_0x16a8ba[_0x24a1('0x45')][_0x24a1('0x43')]===_0x24a1('0x56')){_0x4307a3[_0x24a1('0x56')]=_0x16a8ba[_0x24a1('0xb5')]['id'];}else{_0x4307a3['id']=_0x16a8ba[_0x24a1('0xb5')]['id'];}var _0x34c639={'raw':![],'where':_0x4307a3},_0x39edee={};_0x39edee['model']=_['keys'](db[_0x24a1('0x40')][_0x24a1('0x41')]);_0x39edee[_0x24a1('0x45')]=_[_0x24a1('0x46')](_0x16a8ba[_0x24a1('0x45')]);_0x39edee[_0x24a1('0x47')]=_[_0x24a1('0x49')](_0x39edee[_0x24a1('0x44')],_0x39edee[_0x24a1('0x45')]);_0x34c639[_0x24a1('0x48')]=_[_0x24a1('0x49')](_0x39edee[_0x24a1('0x44')],qs[_0x24a1('0x4a')](_0x16a8ba['query'][_0x24a1('0x4a')]));_0x34c639[_0x24a1('0x48')]=_0x34c639[_0x24a1('0x48')]['length']?_0x34c639[_0x24a1('0x48')]:_0x39edee[_0x24a1('0x44')];if(_0x16a8ba[_0x24a1('0x45')][_0x24a1('0xb6')]){_0x34c639[_0x24a1('0xb7')]=[{'all':!![]}];}_0x34c639=_[_0x24a1('0xb8')]({},_0x34c639,_0x16a8ba[_0x24a1('0xb9')]);return db[_0x24a1('0x40')][_0x24a1('0x68')](_0x34c639)['then'](handleEntityNotFound(_0x347f1f,null))[_0x24a1('0x2c')](respondWithResult(_0x347f1f,null))[_0x24a1('0x38')](handleError(_0x347f1f,null));};exports[_0x24a1('0xba')]=function(_0x306200,_0x5846c4){return db[_0x24a1('0x40')][_0x24a1('0xba')](_0x306200[_0x24a1('0x7b')],{})[_0x24a1('0x2c')](respondWithResult(_0x5846c4,0xc9))[_0x24a1('0x38')](handleError(_0x5846c4,null));};exports[_0x24a1('0x2b')]=function(_0x2078fa,_0x5e86fb){if(_0x2078fa['body']['id']){delete _0x2078fa[_0x24a1('0x7b')]['id'];}return db[_0x24a1('0x40')][_0x24a1('0x68')]({'where':{'id':_0x2078fa[_0x24a1('0xb5')]['id']}})[_0x24a1('0x2c')](handleEntityNotFound(_0x5e86fb,null))[_0x24a1('0x2c')](saveUpdates(_0x2078fa['body'],null))[_0x24a1('0x2c')](respondWithResult(_0x5e86fb,null))[_0x24a1('0x38')](handleError(_0x5e86fb,null));};exports[_0x24a1('0xbb')]=function(_0x4ac65b,_0x11f899){return db['OpenchannelInteraction']['find']({'where':{'id':_0x4ac65b[_0x24a1('0xb5')]['id']}})['then'](handleEntityNotFound(_0x11f899,null))[_0x24a1('0x2c')](removeEntity(_0x11f899,null))[_0x24a1('0x38')](handleError(_0x11f899,null));};exports['describe']=function(_0x3ae278,_0x22e520){return db['OpenchannelInteraction'][_0x24a1('0xbc')]()['then'](respondWithResult(_0x22e520,null))[_0x24a1('0x38')](handleError(_0x22e520,null));};exports[_0x24a1('0xbd')]=function(_0x192404,_0x293ecb,_0x53ec3c){return db[_0x24a1('0xbe')]['find']({'where':{'id':_0x192404[_0x24a1('0xb5')]['id']}})[_0x24a1('0x2c')](handleEntityNotFound(_0x293ecb,null))[_0x24a1('0x2c')](function(_0x25ae10){if(_0x25ae10){return _0x25ae10['addMessage'](_0x192404['body'][_0x24a1('0xbf')],_[_0x24a1('0xc0')](_0x192404[_0x24a1('0x7b')],[_0x24a1('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x293ecb,null))[_0x24a1('0x38')](handleError(_0x293ecb,null));};exports[_0x24a1('0xc1')]=function(_0x50c0c5,_0x47e5ba,_0x561b32){var _0x4f6482={'raw':![],'where':{}};var _0x5f0ff4={};var _0x21729e={'count':0x0,'rows':[]};return db[_0x24a1('0x40')][_0x24a1('0xc2')]({'where':{'id':_0x50c0c5[_0x24a1('0xb5')]['id']}})[_0x24a1('0x2c')](handleEntityNotFound(_0x47e5ba,null))[_0x24a1('0x2c')](function(_0x40a20e){if(_0x40a20e){_0x5f0ff4['model']=_[_0x24a1('0x46')](db[_0x24a1('0xbe')][_0x24a1('0x41')]);_0x5f0ff4['query']=_[_0x24a1('0x46')](_0x50c0c5[_0x24a1('0x45')]);_0x5f0ff4['filters']=_[_0x24a1('0x49')](_0x5f0ff4[_0x24a1('0x44')],_0x5f0ff4[_0x24a1('0x45')]);_0x4f6482[_0x24a1('0x48')]=_['intersection'](_0x5f0ff4[_0x24a1('0x44')],qs[_0x24a1('0x4a')](_0x50c0c5[_0x24a1('0x45')][_0x24a1('0x4a')]));_0x4f6482[_0x24a1('0x48')]=_0x4f6482['attributes'][_0x24a1('0x4b')]?_0x4f6482[_0x24a1('0x48')]:_0x5f0ff4['model'];if(!_0x50c0c5['query']['hasOwnProperty'](_0x24a1('0x4c'))){_0x4f6482[_0x24a1('0x26')]=qs['limit'](_0x50c0c5[_0x24a1('0x45')][_0x24a1('0x26')]);_0x4f6482[_0x24a1('0x23')]=qs[_0x24a1('0x23')](_0x50c0c5[_0x24a1('0x45')]['offset']);}_0x4f6482['order']=qs[_0x24a1('0x4e')](_0x50c0c5[_0x24a1('0x45')][_0x24a1('0x4e')]);_0x4f6482[_0x24a1('0x4f')]=qs[_0x24a1('0x47')](_[_0x24a1('0x50')](_0x50c0c5['query'],_0x5f0ff4['filters']));_0x4f6482[_0x24a1('0x4f')][_0x24a1('0xb2')]=_0x40a20e['id'];if(_0x50c0c5[_0x24a1('0x45')]['filter']){_0x4f6482['where']=_[_0x24a1('0xb8')](_0x4f6482['where'],{'$or':_[_0x24a1('0x32')](_0x4f6482[_0x24a1('0x48')],function(_0xc3b288){var _0x5b9270={};_0x5b9270[_0xc3b288]={'$like':'%'+_0x50c0c5[_0x24a1('0x45')][_0x24a1('0x89')]+'%'};return _0x5b9270;})});}if(_0x50c0c5[_0x24a1('0x45')][_0x24a1('0xc3')]){var _0x4426b2=_0x50c0c5['query']['$gte']['split'](',');var _0x446464={};_0x446464[_0x4426b2[0x0]]={'$gte':moment(_0x4426b2[0x1])[_0x24a1('0xc4')](_0x24a1('0xc5'))};_0x4f6482['where']=_[_0x24a1('0xb8')](_0x4f6482[_0x24a1('0x4f')],_0x446464);}_0x4f6482=_[_0x24a1('0xb8')]({},_0x4f6482,_0x50c0c5[_0x24a1('0xb9')]);return db[_0x24a1('0xbe')][_0x24a1('0x25')]({'where':_0x4f6482['where']})[_0x24a1('0x2c')](function(_0x403354){_0x21729e[_0x24a1('0x25')]=_0x403354;if(_0x50c0c5[_0x24a1('0x45')][_0x24a1('0xb6')]){_0x4f6482[_0x24a1('0xb7')]=[{'all':!![]}];}return db[_0x24a1('0xbe')][_0x24a1('0xc6')](_0x4f6482);})[_0x24a1('0x2c')](function(_0x35421c){_0x21729e[_0x24a1('0xc7')]=_0x35421c;return _0x21729e;});}})[_0x24a1('0x2c')](respondWithFilteredResult(_0x47e5ba,_0x4f6482))[_0x24a1('0x38')](handleError(_0x47e5ba,null));};exports[_0x24a1('0xc8')]=function(_0x323c4b,_0x21b84b,_0x3b8f2a){return db[_0x24a1('0x40')][_0x24a1('0x68')]({'where':{'id':_0x323c4b[_0x24a1('0xb5')]['id']}})['then'](handleEntityNotFound(_0x21b84b,null))[_0x24a1('0x2c')](function(_0x1f53b5){if(_0x1f53b5){return _0x1f53b5['setTags'](_0x323c4b['body'][_0x24a1('0xbf')],_[_0x24a1('0xc0')](_0x323c4b[_0x24a1('0x7b')],[_0x24a1('0xbf'),'id'])||{})[_0x24a1('0xc9')](function(){return db[_0x24a1('0x78')][_0x24a1('0xc6')]({'attributes':['id',_0x24a1('0x2f'),_0x24a1('0x53')],'where':{'id':_0x323c4b[_0x24a1('0x7b')][_0x24a1('0xbf')]}});})[_0x24a1('0x2c')](function(_0x32f924){socket[_0x24a1('0xca')]('openchannelInteractionTags:save',{'id':Number(_0x323c4b[_0x24a1('0xb5')]['id']),'tags':_0x32f924||[]});return{'id':Number(_0x323c4b[_0x24a1('0xb5')]['id']),'tags':_0x32f924||[]};});}})[_0x24a1('0x2c')](respondWithResult(_0x21b84b,null))[_0x24a1('0x38')](handleError(_0x21b84b,null));};exports[_0x24a1('0xcb')]=function(_0x34a6ef,_0x3a4a80,_0x120c32){return db[_0x24a1('0x40')]['find']({'where':{'id':_0x34a6ef[_0x24a1('0xb5')]['id']}})[_0x24a1('0x2c')](handleEntityNotFound(_0x3a4a80,null))[_0x24a1('0x2c')](function(_0x13e588){if(_0x13e588){return _0x13e588[_0x24a1('0xcb')](_0x34a6ef[_0x24a1('0x45')][_0x24a1('0xbf')]);}})[_0x24a1('0x2c')](respondWithStatusCode(_0x3a4a80,null))[_0x24a1('0x38')](handleError(_0x3a4a80,null));};exports[_0x24a1('0xcc')]=function(_0x346cf2,_0x5f542b){var _0x4475c2=moment()[_0x24a1('0xcd')]()[_0x24a1('0x9d')]();var _0x3e5490=path[_0x24a1('0xce')](config[_0x24a1('0xcf')],'server',_0x24a1('0xd0'),'tmp');var _0x35f05c=path[_0x24a1('0xce')](config[_0x24a1('0xcf')],_0x24a1('0xd1'),_0x24a1('0xd0'),_0x24a1('0xd2'));var _0x38ad13=path[_0x24a1('0xce')](_0x3e5490,_0x4475c2);var _0x255da6=util[_0x24a1('0xc4')](_0x24a1('0xd3'),_0x346cf2[_0x24a1('0xb5')]['id'],_0x4475c2);var _0x397c63=path[_0x24a1('0xce')](_0x3e5490,_0x255da6);var _0x4439bc=[];_0x4439bc[_0x24a1('0x36')]({'model':db[_0x24a1('0x79')],'as':_0x24a1('0x79'),'attributes':['id',_0x24a1('0xd4')],'raw':!![]});_0x4439bc[_0x24a1('0x36')]({'model':db[_0x24a1('0xd5')],'as':_0x24a1('0x6e'),'attributes':['id',_0x24a1('0xd6'),_0x24a1('0xd7')],'raw':!![]});if(_0x346cf2[_0x24a1('0x45')][_0x24a1('0xd2')]){_0x4439bc[_0x24a1('0x36')]({'model':db[_0x24a1('0xd8')],'as':_0x24a1('0xd8'),'raw':!![]});}var _0x54c95c=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x24a1('0x7b'),'createdAt',_0x24a1('0xd9'),_0x24a1('0xda'),_0x24a1('0x84')],'include':_0x4439bc}];_0x54c95c['push']({'model':db['OpenchannelAccount'],'as':_0x24a1('0xdb'),'attributes':['id','name']});_0x54c95c[_0x24a1('0x36')]({'model':db[_0x24a1('0x79')],'as':_0x24a1('0xdc'),'attributes':['id',_0x24a1('0xd4')]});return db[_0x24a1('0x40')]['find']({'where':{'id':_0x346cf2[_0x24a1('0xb5')]['id']},'include':_0x54c95c})[_0x24a1('0x2c')](handleEntityNotFound(_0x5f542b,null))[_0x24a1('0x2c')](function(_0x128d16){if(_0x128d16){var _0x24bbec=_0x128d16['get']({'plain':!![]});fs[_0x24a1('0xdd')](_0x38ad13);var _0x49ad4f={'channel':_0x24a1('0xde'),'account':_0x24bbec[_0x24a1('0xdb')][_0x24a1('0x2f')],'agent':_0x24bbec[_0x24a1('0xdc')]?_0x24bbec[_0x24a1('0xdc')][_0x24a1('0xd4')]:_0x24a1('0xdf'),'createdAt':moment(_0x24bbec[_0x24a1('0xe0')])[_0x24a1('0xc4')](_0x24a1('0xc5'))[_0x24a1('0x9d')](),'closedAt':_0x24bbec['closed']?moment(_0x24bbec['closedAt'])[_0x24a1('0xc4')](_0x24a1('0xc5'))[_0x24a1('0x9d')]():'','disposition':_0x24bbec[_0x24a1('0xe1')],'visibility':_0x24bbec[_0x24a1('0xe2')]?_0x24a1('0xe3'):'Private','messages':_(_0x24bbec['Messages'])['filter']({'secret':![]})[_0x24a1('0x32')](function(_0x28f8dc){if(_0x28f8dc[_0x24a1('0xd8')]){var _0x389c52=path[_0x24a1('0xce')](_0x35f05c,_0x28f8dc['Attachment'][_0x24a1('0xe4')]);if(fs[_0x24a1('0xe5')](_0x389c52)){fs[_0x24a1('0xe6')](_0x389c52)[_0x24a1('0xe7')](fs[_0x24a1('0xe8')](path['join'](_0x38ad13,_0x28f8dc[_0x24a1('0xd8')][_0x24a1('0xe4')])));}}return{'date':moment(_0x28f8dc['createdAt'])[_0x24a1('0xc4')](_0x24a1('0xc5'))[_0x24a1('0x9d')](),'sender':_0x28f8dc[_0x24a1('0xd9')]===_0x24a1('0xe9')?_0x28f8dc[_0x24a1('0x79')]?_0x28f8dc[_0x24a1('0x79')][_0x24a1('0xd4')]:'System':_0x28f8dc[_0x24a1('0x6e')][_0x24a1('0xd6')]+(_0x28f8dc['Contact'][_0x24a1('0xd7')]?'\x20'+_0x28f8dc[_0x24a1('0x6e')][_0x24a1('0xd7')]:''),'body':_0x28f8dc[_0x24a1('0xd8')]?_0x28f8dc[_0x24a1('0xd8')][_0x24a1('0xe4')]:_0x28f8dc[_0x24a1('0x7b')],'direction':_0x28f8dc[_0x24a1('0xd9')]===_0x24a1('0xe9')?'A':'C','secret':_0x28f8dc[_0x24a1('0xda')],'read':_0x28f8dc[_0x24a1('0x84')],'attachment':_0x28f8dc['Attachment']};})['value']()};return ejs[_0x24a1('0xea')](path[_0x24a1('0xce')](config[_0x24a1('0xcf')],_0x24a1('0xd1'),_0x24a1('0xeb'),_0x24a1('0xec')),{'interaction':_0x49ad4f})[_0x24a1('0x2c')](function(_0x2b980c){var _0x362f95=path[_0x24a1('0xce')](_0x38ad13,_0x24a1('0xed')+_0x24bbec['id']+'-'+_0x4475c2+_0x24a1('0xee'));var _0xccc084={'path':_0x362f95,'channel':_0x24a1('0xde'),'interactionId':_0x24bbec['id']};return pdf[_0x24a1('0xef')](_0x2b980c,_0xccc084);})[_0x24a1('0x2c')](function(){return new BPromise(function(_0x456ac7,_0x1a2987){zipdir(_0x38ad13,{'saveTo':_0x397c63},function(_0x1f8b2d,_0x11b209){if(_0x1f8b2d)return _0x1a2987(_0x1f8b2d);return _0x456ac7(_0x11b209);});})[_0x24a1('0x2c')](function(){return new BPromise(function(_0x27b9f8,_0x5407ec){rimraf(_0x38ad13,function(_0x58af36){if(_0x58af36)_0x5407ec(_0x58af36);return _0x27b9f8();});});})['then'](function(){return _0x5f542b['download'](_0x397c63,_0x255da6,function(_0x42a40e){if(_0x42a40e){console['log'](_0x24a1('0xf0'),_0x42a40e);}else{fs[_0x24a1('0xf1')](_0x397c63);}});});});}else{return _0x5f542b[_0x24a1('0x20')](0xc8);}})[_0x24a1('0x38')](handleError(_0x5f542b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0459e3c..ee5e011 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 _0x7a0b=['getUsers','then','Users','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','update','remove'];(function(_0x16906e,_0x238f5d){var _0x5e1d74=function(_0x724fba){while(--_0x724fba){_0x16906e['push'](_0x16906e['shift']());}};_0x5e1d74(++_0x238f5d);}(_0x7a0b,0x13d));var _0xb7a0=function(_0x2e41b5,_0x9a9a69){_0x2e41b5=_0x2e41b5-0x0;var _0x1d74a9=_0x7a0b[_0x2e41b5];return _0x1d74a9;};'use strict';var EventEmitter=require(_0xb7a0('0x0'));var OpenchannelInteraction=require(_0xb7a0('0x1'))['db'][_0xb7a0('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb7a0('0x3'),'afterDestroy':_0xb7a0('0x4')};function emitEvent(_0x21373c){return function(_0x1adabc,_0x280f50,_0x303069){_0x1adabc[_0xb7a0('0x5')]({'attributes':['id'],'raw':!![]})[_0xb7a0('0x6')](function(_0x202b87){_0x1adabc['setDataValue'](_0xb7a0('0x7'),_0x202b87['map'](function(_0x120db4){return{'id':_0x120db4['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1adabc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb7a0('0x6')](function(_0x44aa13){_0x1adabc['setDataValue'](_0xb7a0('0x8'),_0x44aa13[_0xb7a0('0x9')]);OpenchannelInteractionEvents[_0xb7a0('0xa')](_0x21373c+':'+_0x1adabc['id'],_0x1adabc);OpenchannelInteractionEvents[_0xb7a0('0xa')](_0x21373c,_0x1adabc);_0x303069(null);})[_0xb7a0('0xb')](_0x303069(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xb7a0('0xc')](e,emitEvent(event));}}module[_0xb7a0('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xcf33=['exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x120ce0,_0x445485){var _0x236062=function(_0x4fc7e6){while(--_0x4fc7e6){_0x120ce0['push'](_0x120ce0['shift']());}};_0x236062(++_0x445485);}(_0xcf33,0x1dc));var _0x3cf3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcf33[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x3cf3('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3cf3('0x1')];var OpenchannelMessage=require(_0x3cf3('0x2'))['db'][_0x3cf3('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3cf3('0x4')](0x0);var events={'afterCreate':_0x3cf3('0x5'),'afterUpdate':'update','afterDestroy':_0x3cf3('0x6')};function emitEvent(_0xdb9d52){return function(_0x435ef9,_0x3a37d2,_0x46c498){_0x435ef9[_0x3cf3('0x7')]({'attributes':['id'],'raw':!![]})[_0x3cf3('0x8')](function(_0xba9522){_0x435ef9[_0x3cf3('0x9')](_0x3cf3('0xa'),_0xba9522[_0x3cf3('0xb')](function(_0x4b7274){return{'id':_0x4b7274['id']};}));return OpenchannelMessage[_0x3cf3('0xc')]({'where':{'OpenchannelInteractionId':_0x435ef9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b09ad){_0x435ef9['setDataValue'](_0x3cf3('0xd'),_0x5b09ad['length']);OpenchannelInteractionEvents[_0x3cf3('0xe')](_0xdb9d52+':'+_0x435ef9['id'],_0x435ef9);OpenchannelInteractionEvents[_0x3cf3('0xe')](_0xdb9d52,_0x435ef9);_0x46c498(null);})[_0x3cf3('0xf')](_0x46c498(null));};}for(var e in events){if(events[_0x3cf3('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x3cf3('0x11')](e,emitEvent(event));}}module[_0x3cf3('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 8a177ff..4b41da7 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 _0xd142=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x349110,_0x33274a){var _0x449a11=function(_0x3c9d52){while(--_0x3c9d52){_0x349110['push'](_0x349110['shift']());}};_0x449a11(++_0x33274a);}(_0xd142,0x6f));var _0x2d14=function(_0x142be6,_0x55f613){_0x142be6=_0x142be6-0x0;var _0x3630d9=_0xd142[_0x142be6];return _0x3630d9;};'use strict';var _=require(_0x2d14('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2d14('0x1'));var BPromise=require(_0x2d14('0x2'));var rp=require(_0x2d14('0x3'));var fs=require('fs');var path=require(_0x2d14('0x4'));var rimraf=require('rimraf');var config=require(_0x2d14('0x5'));var attributes=require(_0x2d14('0x6'));module[_0x2d14('0x7')]=function(_0x4a1c34,_0x47a0f3){return _0x4a1c34['define'](_0x2d14('0x8'),attributes,{'tableName':_0x2d14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d14('0xa'),'collate':_0x2d14('0xb'),'hooks':{'beforeUpdate':function(_0x6a7116,_0x39be7a,_0x26bb29){if(_0x6a7116[_0x2d14('0xc')](_0x2d14('0xd'))){_0x6a7116[_0x2d14('0xe')]=moment()[_0x2d14('0xf')](_0x2d14('0x10'));}_0x26bb29(null,_0x6a7116);}}});}; \ No newline at end of file +var _0x323f=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path'];(function(_0x159eab,_0x22d972){var _0x47e933=function(_0x58e802){while(--_0x58e802){_0x159eab['push'](_0x159eab['shift']());}};_0x47e933(++_0x22d972);}(_0x323f,0x1ee));var _0xf323=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x323f[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));module[_0xf323('0x9')]=function(_0x371707,_0x5d7d60){return _0x371707[_0xf323('0xa')](_0xf323('0xb'),attributes,{'tableName':_0xf323('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf323('0xd'),'collate':_0xf323('0xe'),'hooks':{'beforeUpdate':function(_0x3c416a,_0x105b93,_0x2b24a2){if(_0x3c416a[_0xf323('0xf')](_0xf323('0x10'))){_0x3c416a[_0xf323('0x11')]=moment()[_0xf323('0x12')](_0xf323('0x13'));}_0x2b24a2(null,_0x3c416a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index cc87721..6d94b8e 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 _0x6ab7=['update','body','raw','options','where','attributes','limit','info','ids','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x4ebc8f,_0x71255){var _0x1b94a8=function(_0x4f3f7c){while(--_0x4f3f7c){_0x4ebc8f['push'](_0x4ebc8f['shift']());}};_0x1b94a8(++_0x71255);}(_0x6ab7,0xcd));var _0x76ab=function(_0x18dc8f,_0x174df0){_0x18dc8f=_0x18dc8f-0x0;var _0x2e1d30=_0x6ab7[_0x18dc8f];return _0x2e1d30;};'use strict';var _=require(_0x76ab('0x0'));var util=require('util');var moment=require(_0x76ab('0x1'));var BPromise=require('bluebird');var rs=require(_0x76ab('0x2'));var fs=require('fs');var Redis=require(_0x76ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x76ab('0x4'));var logger=require('../../config/logger')(_0x76ab('0x5'));var config=require(_0x76ab('0x6'));var jayson=require(_0x76ab('0x7'));var client=jayson[_0x76ab('0x8')][_0x76ab('0x9')]({'port':0x232a});config[_0x76ab('0xa')]=_[_0x76ab('0xb')](config[_0x76ab('0xa')],{'host':_0x76ab('0xc'),'port':0x18eb});var socket=require(_0x76ab('0xd'))(new Redis(config[_0x76ab('0xa')]));require(_0x76ab('0xe'))[_0x76ab('0xf')](socket);function respondWithRpcPromise(_0x599a64,_0x2dc764,_0x398280){return new BPromise(function(_0x1fa2bf,_0x50879c){return client[_0x76ab('0x10')](_0x599a64,_0x398280)[_0x76ab('0x11')](function(_0x1c7e39){logger['info'](_0x76ab('0x12'),_0x2dc764,'request\x20sent');logger[_0x76ab('0x13')](_0x76ab('0x14'),_0x2dc764,'request\x20sent',JSON[_0x76ab('0x15')](_0x1c7e39));if(_0x1c7e39[_0x76ab('0x16')]){if(_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x17')]===0x1f4){logger[_0x76ab('0x16')](_0x76ab('0x12'),_0x2dc764,_0x1c7e39[_0x76ab('0x16')]['message']);return _0x50879c(_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x18')]);}logger[_0x76ab('0x16')](_0x76ab('0x12'),_0x2dc764,_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x18')]);return _0x1fa2bf(_0x1c7e39[_0x76ab('0x16')][_0x76ab('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x2dc764,'request\x20sent');_0x1fa2bf(_0x1c7e39[_0x76ab('0x19')][_0x76ab('0x18')]);}})[_0x76ab('0x1a')](function(_0x447a6f){logger[_0x76ab('0x16')](_0x76ab('0x12'),_0x2dc764,_0x447a6f);_0x50879c(_0x447a6f);});});}exports[_0x76ab('0x1b')]=function(_0x4c97dc){var _0x38df06=this;return new Promise(function(_0x23bc88,_0x3766ca){return db[_0x76ab('0x1c')][_0x76ab('0x1d')](_0x4c97dc[_0x76ab('0x1e')],{'raw':_0x4c97dc['options']?_0x4c97dc['options'][_0x76ab('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c97dc[_0x76ab('0x20')]?_0x4c97dc[_0x76ab('0x20')][_0x76ab('0x21')]||null:null,'attributes':_0x4c97dc[_0x76ab('0x20')]?_0x4c97dc[_0x76ab('0x20')][_0x76ab('0x22')]||null:null,'limit':_0x4c97dc[_0x76ab('0x20')]?_0x4c97dc[_0x76ab('0x20')][_0x76ab('0x23')]||null:null})[_0x76ab('0x11')](function(_0x2a1f68){logger[_0x76ab('0x24')](_0x76ab('0x1b'),_0x4c97dc);logger[_0x76ab('0x13')](_0x76ab('0x1b'),_0x4c97dc,JSON[_0x76ab('0x15')](_0x2a1f68));_0x23bc88(_0x2a1f68);})[_0x76ab('0x1a')](function(_0xf48b5e){logger[_0x76ab('0x16')](_0x76ab('0x1b'),_0xf48b5e[_0x76ab('0x18')],_0x4c97dc);_0x3766ca(_0x38df06[_0x76ab('0x16')](0x1f4,_0xf48b5e['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x41994c){return new Promise(function(_0x459cac,_0x18ef36){return db[_0x76ab('0x1c')]['find']({'where':_0x41994c['options']?_0x41994c[_0x76ab('0x20')]['where']||null:null})['then'](function(_0x477170){if(_0x477170){return _0x477170['addTags'](_0x41994c['body'][_0x76ab('0x25')],_['omit'](_0x41994c['body'],[_0x76ab('0x25'),'id'])||{});}})['spread'](function(_0x188459){logger[_0x76ab('0x24')]('AddTags',_0x41994c);logger['debug'](_0x76ab('0x26'),_0x41994c,JSON[_0x76ab('0x15')](_0x188459));_0x459cac(_0x188459);})['catch'](function(_0x4180f1){logger['error'](_0x76ab('0x26'),_0x4180f1['message'],_0x41994c);_0x18ef36(_this[_0x76ab('0x16')](0x1f4,_0x4180f1[_0x76ab('0x18')]));});});}; \ No newline at end of file +var _0xbdef=['http','redis','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x13250b,_0x1db5d7){var _0x2d0e53=function(_0x59db27){while(--_0x59db27){_0x13250b['push'](_0x13250b['shift']());}};_0x2d0e53(++_0x1db5d7);}(_0xbdef,0x1a3));var _0xfbde=function(_0x41348e,_0x2d14a2){_0x41348e=_0x41348e-0x0;var _0x27891e=_0xbdef[_0x41348e];return _0x27891e;};'use strict';var _=require(_0xfbde('0x0'));var util=require(_0xfbde('0x1'));var moment=require(_0xfbde('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbde('0x3'));var db=require(_0xfbde('0x4'))['db'];var utils=require(_0xfbde('0x5'));var logger=require(_0xfbde('0x6'))(_0xfbde('0x7'));var config=require(_0xfbde('0x8'));var jayson=require(_0xfbde('0x9'));var client=jayson[_0xfbde('0xa')][_0xfbde('0xb')]({'port':0x232a});config[_0xfbde('0xc')]=_['defaults'](config[_0xfbde('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfbde('0xd'))(new Redis(config[_0xfbde('0xc')]));require('./openchannelInteraction.socket')[_0xfbde('0xe')](socket);function respondWithRpcPromise(_0x36dcc0,_0x4836b7,_0x2b3d9b){return new BPromise(function(_0x19f7c0,_0x2b1bd6){return client[_0xfbde('0xf')](_0x36dcc0,_0x2b3d9b)[_0xfbde('0x10')](function(_0x1ac8dc){logger['info'](_0xfbde('0x11'),_0x4836b7,_0xfbde('0x12'));logger[_0xfbde('0x13')](_0xfbde('0x14'),_0x4836b7,'request\x20sent',JSON['stringify'](_0x1ac8dc));if(_0x1ac8dc[_0xfbde('0x15')]){if(_0x1ac8dc['error'][_0xfbde('0x16')]===0x1f4){logger['error'](_0xfbde('0x11'),_0x4836b7,_0x1ac8dc[_0xfbde('0x15')]['message']);return _0x2b1bd6(_0x1ac8dc[_0xfbde('0x15')][_0xfbde('0x17')]);}logger[_0xfbde('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4836b7,_0x1ac8dc[_0xfbde('0x15')][_0xfbde('0x17')]);return _0x19f7c0(_0x1ac8dc[_0xfbde('0x15')][_0xfbde('0x17')]);}else{logger[_0xfbde('0x18')](_0xfbde('0x11'),_0x4836b7,_0xfbde('0x12'));_0x19f7c0(_0x1ac8dc[_0xfbde('0x19')][_0xfbde('0x17')]);}})['catch'](function(_0x2f7618){logger[_0xfbde('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4836b7,_0x2f7618);_0x2b1bd6(_0x2f7618);});});}exports[_0xfbde('0x1a')]=function(_0x401274){var _0x2fc055=this;return new Promise(function(_0x4ab321,_0x9e1d5e){return db[_0xfbde('0x1b')][_0xfbde('0x1c')](_0x401274[_0xfbde('0x1d')],{'raw':_0x401274[_0xfbde('0x1e')]?_0x401274['options'][_0xfbde('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x401274['options']?_0x401274[_0xfbde('0x1e')][_0xfbde('0x20')]||null:null,'attributes':_0x401274['options']?_0x401274[_0xfbde('0x1e')]['attributes']||null:null,'limit':_0x401274[_0xfbde('0x1e')]?_0x401274[_0xfbde('0x1e')][_0xfbde('0x21')]||null:null})['then'](function(_0x3125fa){logger[_0xfbde('0x18')](_0xfbde('0x1a'),_0x401274);logger[_0xfbde('0x13')](_0xfbde('0x1a'),_0x401274,JSON[_0xfbde('0x22')](_0x3125fa));_0x4ab321(_0x3125fa);})['catch'](function(_0x6bdc0c){logger['error'](_0xfbde('0x1a'),_0x6bdc0c['message'],_0x401274);_0x9e1d5e(_0x2fc055['error'](0x1f4,_0x6bdc0c[_0xfbde('0x17')]));});});};exports[_0xfbde('0x23')]=function(_0x52ea7b){return new Promise(function(_0x4e280f,_0x559a69){return db['OpenchannelInteraction'][_0xfbde('0x24')]({'where':_0x52ea7b[_0xfbde('0x1e')]?_0x52ea7b[_0xfbde('0x1e')][_0xfbde('0x20')]||null:null})[_0xfbde('0x10')](function(_0x1be7fd){if(_0x1be7fd){return _0x1be7fd[_0xfbde('0x25')](_0x52ea7b[_0xfbde('0x1d')][_0xfbde('0x26')],_[_0xfbde('0x27')](_0x52ea7b['body'],[_0xfbde('0x26'),'id'])||{});}})[_0xfbde('0x28')](function(_0x1e6a25){logger[_0xfbde('0x18')](_0xfbde('0x29'),_0x52ea7b);logger[_0xfbde('0x13')](_0xfbde('0x29'),_0x52ea7b,JSON[_0xfbde('0x22')](_0x1e6a25));_0x4e280f(_0x1e6a25);})[_0xfbde('0x2a')](function(_0x393199){logger[_0xfbde('0x15')]('AddTags',_0x393199['message'],_0x52ea7b);_0x559a69(_this['error'](0x1f4,_0x393199['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index bf89d1f..83161f2 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 _0x5e79=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove','emit'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x5e79,0x18c));var _0x95e7=function(_0xc7ff3,_0x2d2003){_0xc7ff3=_0xc7ff3-0x0;var _0x266e6f=_0x5e79[_0xc7ff3];return _0x266e6f;};'use strict';var OpenchannelInteractionEvents=require(_0x95e7('0x0'));var events=['save',_0x95e7('0x1'),'update'];function createListener(_0x43d49b,_0xd95b25){return function(_0x5ce327){_0xd95b25[_0x95e7('0x2')](_0x43d49b,_0x5ce327);};}function removeListener(_0x54fd40,_0xaf6215){return function(){OpenchannelInteractionEvents[_0x95e7('0x3')](_0x54fd40,_0xaf6215);};}exports[_0x95e7('0x4')]=function(_0x5a92bd){for(var _0x37abef=0x0,_0x132634=events[_0x95e7('0x5')];_0x37abef<_0x132634;_0x37abef++){var _0x5d01bc=events[_0x37abef];var _0x5b425f=createListener(_0x95e7('0x6')+_0x5d01bc,_0x5a92bd);OpenchannelInteractionEvents['on'](_0x5d01bc,_0x5b425f);}}; \ No newline at end of file +var _0x59c7=['remove','update','removeListener','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x28732e,_0x4d734a){var _0x45bc15=function(_0xd21122){while(--_0xd21122){_0x28732e['push'](_0x28732e['shift']());}};_0x45bc15(++_0x4d734a);}(_0x59c7,0x1c6));var _0x759c=function(_0x2edd80,_0xfb96bb){_0x2edd80=_0x2edd80-0x0;var _0x10f6df=_0x59c7[_0x2edd80];return _0x10f6df;};'use strict';var OpenchannelInteractionEvents=require(_0x759c('0x0'));var events=[_0x759c('0x1'),_0x759c('0x2'),_0x759c('0x3')];function createListener(_0x54ebbc,_0x37cb98){return function(_0x4c42fa){_0x37cb98['emit'](_0x54ebbc,_0x4c42fa);};}function removeListener(_0xa179ca,_0x392096){return function(){OpenchannelInteractionEvents[_0x759c('0x4')](_0xa179ca,_0x392096);};}exports['register']=function(_0x210902){for(var _0x6df109=0x0,_0x92a556=events['length'];_0x6df109<_0x92a556;_0x6df109++){var _0x5a7ce5=events[_0x6df109];var _0x4bc777=createListener(_0x759c('0x5')+_0x5a7ce5,_0x210902);OpenchannelInteractionEvents['on'](_0x5a7ce5,_0x4bc777);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 1f3a5b8..3fa0746 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(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_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(_0x5e84cd,_0xb0d9f3){var _0xafd3e6=function(_0x2babeb){while(--_0x2babeb){_0x5e84cd['push'](_0x5e84cd['shift']());}};_0xafd3e6(++_0xb0d9f3);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'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 0741f18..ebfdc17 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 _0x26f9=['exports','medium','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x1e22bf,_0x1a4c51){var _0xce29fc=function(_0x2a2477){while(--_0x2a2477){_0x1e22bf['push'](_0x1e22bf['shift']());}};_0xce29fc(++_0x1a4c51);}(_0x26f9,0x16f));var _0x926f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x26f9[_0x95ac8b];return _0x5b0792;};'use strict';var Sequelize=require(_0x926f('0x0'));module[_0x926f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x926f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x926f('0x3')]('in',_0x926f('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x926f('0x5')]},'providerName':{'type':Sequelize[_0x926f('0x6')]},'providerResponse':{'type':Sequelize[_0x926f('0x7')]}}; \ No newline at end of file +var _0x8383=['sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x3872df,_0x1c56a3){var _0x43bf44=function(_0x1dca13){while(--_0x1dca13){_0x3872df['push'](_0x3872df['shift']());}};_0x43bf44(++_0x1c56a3);}(_0x8383,0x98));var _0x3838=function(_0x5d145f,_0x5a789b){_0x5d145f=_0x5d145f-0x0;var _0x44a343=_0x8383[_0x5d145f];return _0x44a343;};'use strict';var Sequelize=require(_0x3838('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3838('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3838('0x3')]('in',_0x3838('0x4')),'defaultValue':_0x3838('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3838('0x5')]},'providerName':{'type':Sequelize[_0x3838('0x6')]},'providerResponse':{'type':Sequelize[_0x3838('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index f399d65..8a747ac 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 _0xb931=['catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','OpenchannelMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','params','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','UserId','agent','get','OpenchannelInteractionId','read1stAt','format','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','email','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x2c448b,_0x3681ef){var _0x6f2002=function(_0x36aa57){while(--_0x36aa57){_0x2c448b['push'](_0x2c448b['shift']());}};_0x6f2002(++_0x3681ef);}(_0xb931,0x155));var _0x1b93=function(_0x5699c5,_0x2cd71e){_0x5699c5=_0x5699c5-0x0;var _0x40dabf=_0xb931[_0x5699c5];return _0x40dabf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b93('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b93('0x1'));var BPromise=require(_0x1b93('0x2'));var Mustache=require(_0x1b93('0x3'));var util=require(_0x1b93('0x4'));var path=require(_0x1b93('0x5'));var sox=require(_0x1b93('0x6'));var csv=require(_0x1b93('0x7'));var ejs=require(_0x1b93('0x8'));var fs=require('fs');var fs_extra=require(_0x1b93('0x9'));var _=require(_0x1b93('0xa'));var squel=require(_0x1b93('0xb'));var crypto=require(_0x1b93('0xc'));var jsforce=require(_0x1b93('0xd'));var deskjs=require(_0x1b93('0xe'));var toCsv=require(_0x1b93('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b93('0xf'));var authService=require(_0x1b93('0x10'));var qs=require(_0x1b93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b93('0x12'));var logger=require('../../config/logger')(_0x1b93('0x13'));var utils=require(_0x1b93('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b93('0x15'))['db'];config[_0x1b93('0x16')]=_[_0x1b93('0x17')](config['redis'],{'host':_0x1b93('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b93('0x16')]));require(_0x1b93('0x19'))[_0x1b93('0x1a')](socket);var jayson=require(_0x1b93('0x1b'));var client=jayson[_0x1b93('0x1c')][_0x1b93('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x1b93('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x267527,_0x240b8f,_0x23d687,_0x4d4c47){return new BPromise(function(_0x294be5,_0x42b8d4){var _0x4f7199=_0x4d4c47||client;return _0x4f7199[_0x1b93('0x1e')](_0x267527,_0x23d687)[_0x1b93('0x1f')](function(_0x4ed0d5){logger['info'](_0x1b93('0x20'),_0x240b8f,_0x1b93('0x21'));logger[_0x1b93('0x22')](_0x1b93('0x23'),_0x240b8f,_0x1b93('0x21'),JSON['stringify'](_0x4ed0d5));if(_0x4ed0d5[_0x1b93('0x24')]){if(_0x4ed0d5[_0x1b93('0x24')]['code']===0x1f4){logger['error'](_0x1b93('0x20'),_0x240b8f,_0x4ed0d5[_0x1b93('0x24')][_0x1b93('0x25')]);return _0x42b8d4(_0x4ed0d5[_0x1b93('0x24')][_0x1b93('0x25')]);}logger[_0x1b93('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x240b8f,_0x4ed0d5[_0x1b93('0x24')][_0x1b93('0x25')]);return _0x294be5(_0x4ed0d5[_0x1b93('0x24')]['message']);}else{logger[_0x1b93('0x26')](_0x1b93('0x20'),_0x240b8f,_0x1b93('0x21'));_0x294be5(_0x4ed0d5[_0x1b93('0x27')][_0x1b93('0x25')]);}})[_0x1b93('0x28')](function(_0x13cddc){logger[_0x1b93('0x24')](_0x1b93('0x20'),_0x240b8f,_0x13cddc);_0x42b8d4(_0x13cddc);});});}function respondWithStatusCode(_0x24f04e,_0x8010e6){_0x8010e6=_0x8010e6||0xcc;return function(_0x189869){if(_0x189869){return _0x24f04e[_0x1b93('0x29')](_0x8010e6);}return _0x24f04e[_0x1b93('0x2a')](_0x8010e6)[_0x1b93('0x2b')]();};}function respondWithResult(_0x5ce57b,_0x56e2d3){_0x56e2d3=_0x56e2d3||0xc8;return function(_0x5dccf3){if(_0x5dccf3){return _0x5ce57b[_0x1b93('0x2a')](_0x56e2d3)[_0x1b93('0x2c')](_0x5dccf3);}};}function respondWithFilteredResult(_0x2501ee,_0x20b035){return function(_0xc47d69){if(_0xc47d69){var _0x59983e=typeof _0x20b035['offset']===_0x1b93('0x2d')&&typeof _0x20b035[_0x1b93('0x2e')]===_0x1b93('0x2d');var _0x4d504c=_0xc47d69[_0x1b93('0x2f')];var _0x49873d=_0x59983e?0x0:_0x20b035[_0x1b93('0x30')];var _0x3d18c8=_0x59983e?_0xc47d69[_0x1b93('0x2f')]:_0x20b035['offset']+_0x20b035['limit'];var _0xa0f296;if(_0x3d18c8>=_0x4d504c){_0x3d18c8=_0x4d504c;_0xa0f296=0xc8;}else{_0xa0f296=0xce;}_0x2501ee['status'](_0xa0f296);return _0x2501ee[_0x1b93('0x31')](_0x1b93('0x32'),_0x49873d+'-'+_0x3d18c8+'/'+_0x4d504c)[_0x1b93('0x2c')](_0xc47d69);}return null;};}function patchUpdates(_0x49c445){return function(_0x21e053){try{jsonpatch[_0x1b93('0x33')](_0x21e053,_0x49c445,!![]);}catch(_0x1b5cac){return BPromise[_0x1b93('0x34')](_0x1b5cac);}return _0x21e053[_0x1b93('0x35')]();};}function saveUpdates(_0x113528,_0xe46935){return function(_0x26cf9b){if(_0x26cf9b){return _0x26cf9b[_0x1b93('0x36')](_0x113528)[_0x1b93('0x1f')](function(_0x3efd5e){return _0x3efd5e;});}return null;};}function removeEntity(_0x52302d,_0x5b55dc){return function(_0x1b0afa){if(_0x1b0afa){return _0x1b0afa[_0x1b93('0x37')]()[_0x1b93('0x1f')](function(){_0x52302d[_0x1b93('0x2a')](0xcc)[_0x1b93('0x2b')]();});}};}function handleEntityNotFound(_0x12627b,_0x2e6f54){return function(_0x568aba){if(!_0x568aba){_0x12627b['sendStatus'](0x194);}return _0x568aba;};}function handleError(_0x4de705,_0x20e6c2){_0x20e6c2=_0x20e6c2||0x1f4;return function(_0x457674){logger['error'](_0x457674['stack']);if(_0x457674[_0x1b93('0x38')]){delete _0x457674[_0x1b93('0x38')];}_0x4de705['status'](_0x20e6c2)[_0x1b93('0x39')](_0x457674);};}exports['index']=function(_0x413013,_0x3da1b5){var _0x2e0b7e={},_0xc9df19={},_0x1929e7={'count':0x0,'rows':[]};var _0x2b292f=_['map'](db[_0x1b93('0x3a')]['rawAttributes'],function(_0x3755cc){return{'name':_0x3755cc['fieldName'],'type':_0x3755cc[_0x1b93('0x3b')][_0x1b93('0x3c')]};});_0xc9df19[_0x1b93('0x3d')]=_[_0x1b93('0x3e')](_0x2b292f,_0x1b93('0x38'));_0xc9df19[_0x1b93('0x3f')]=_[_0x1b93('0x40')](_0x413013[_0x1b93('0x3f')]);_0xc9df19[_0x1b93('0x41')]=_[_0x1b93('0x42')](_0xc9df19[_0x1b93('0x3d')],_0xc9df19[_0x1b93('0x3f')]);_0x2e0b7e[_0x1b93('0x43')]=_[_0x1b93('0x42')](_0xc9df19['model'],qs[_0x1b93('0x44')](_0x413013[_0x1b93('0x3f')][_0x1b93('0x44')]));_0x2e0b7e['attributes']=_0x2e0b7e[_0x1b93('0x43')][_0x1b93('0x45')]?_0x2e0b7e[_0x1b93('0x43')]:_0xc9df19[_0x1b93('0x3d')];if(!_0x413013[_0x1b93('0x3f')]['hasOwnProperty']('nolimit')){_0x2e0b7e['limit']=qs[_0x1b93('0x2e')](_0x413013['query']['limit']);_0x2e0b7e[_0x1b93('0x30')]=qs[_0x1b93('0x30')](_0x413013[_0x1b93('0x3f')][_0x1b93('0x30')]);}_0x2e0b7e[_0x1b93('0x46')]=qs[_0x1b93('0x47')](_0x413013[_0x1b93('0x3f')]['sort']);_0x2e0b7e['where']=qs[_0x1b93('0x41')](_[_0x1b93('0x48')](_0x413013['query'],_0xc9df19[_0x1b93('0x41')]),_0x2b292f);if(_0x413013[_0x1b93('0x3f')]['filter']){_0x2e0b7e[_0x1b93('0x49')]=_['merge'](_0x2e0b7e[_0x1b93('0x49')],{'$or':_[_0x1b93('0x3e')](_0x2b292f,function(_0x4fa0ff){if(_0x4fa0ff[_0x1b93('0x3b')]!==_0x1b93('0x4a')){var _0x401a52={};_0x401a52[_0x4fa0ff[_0x1b93('0x38')]]={'$like':'%'+_0x413013['query'][_0x1b93('0x4b')]+'%'};return _0x401a52;}})});}_0x2e0b7e=_[_0x1b93('0x4c')]({},_0x2e0b7e,_0x413013[_0x1b93('0x4d')]);var _0x32110c={'where':_0x2e0b7e['where']};return db[_0x1b93('0x3a')][_0x1b93('0x2f')](_0x32110c)['then'](function(_0x11e5e7){_0x1929e7['count']=_0x11e5e7;if(_0x413013[_0x1b93('0x3f')][_0x1b93('0x4e')]){_0x2e0b7e[_0x1b93('0x4f')]=[{'all':!![]}];}return db[_0x1b93('0x3a')]['findAll'](_0x2e0b7e);})[_0x1b93('0x1f')](function(_0x4476f1){_0x1929e7[_0x1b93('0x50')]=_0x4476f1;return _0x1929e7;})[_0x1b93('0x1f')](respondWithFilteredResult(_0x3da1b5,_0x2e0b7e))[_0x1b93('0x28')](handleError(_0x3da1b5,null));};exports['show']=function(_0x34d5a8,_0x56efde){var _0x4d6ea7={'raw':!![],'where':{'id':_0x34d5a8[_0x1b93('0x51')]['id']}},_0x3b8a89={};_0x3b8a89[_0x1b93('0x3d')]=_[_0x1b93('0x40')](db[_0x1b93('0x3a')]['rawAttributes']);_0x3b8a89[_0x1b93('0x3f')]=_[_0x1b93('0x40')](_0x34d5a8[_0x1b93('0x3f')]);_0x3b8a89[_0x1b93('0x41')]=_[_0x1b93('0x42')](_0x3b8a89['model'],_0x3b8a89[_0x1b93('0x3f')]);_0x4d6ea7['attributes']=_[_0x1b93('0x42')](_0x3b8a89['model'],qs['fields'](_0x34d5a8[_0x1b93('0x3f')]['fields']));_0x4d6ea7[_0x1b93('0x43')]=_0x4d6ea7['attributes']['length']?_0x4d6ea7[_0x1b93('0x43')]:_0x3b8a89[_0x1b93('0x3d')];if(_0x34d5a8['query'][_0x1b93('0x4e')]){_0x4d6ea7[_0x1b93('0x4f')]=[{'all':!![]}];}_0x4d6ea7=_[_0x1b93('0x4c')]({},_0x4d6ea7,_0x34d5a8['options']);return db[_0x1b93('0x3a')][_0x1b93('0x52')](_0x4d6ea7)['then'](handleEntityNotFound(_0x56efde,null))[_0x1b93('0x1f')](respondWithResult(_0x56efde,null))[_0x1b93('0x28')](handleError(_0x56efde,null));};exports[_0x1b93('0x53')]=function(_0x2c1436,_0x5e3921){return db[_0x1b93('0x3a')][_0x1b93('0x53')](_0x2c1436[_0x1b93('0x54')],{})[_0x1b93('0x1f')](respondWithResult(_0x5e3921,0xc9))['catch'](handleError(_0x5e3921,null));};exports[_0x1b93('0x36')]=function(_0x583b2a,_0x5b2605){if(_0x583b2a['body']['id']){delete _0x583b2a[_0x1b93('0x54')]['id'];}return db[_0x1b93('0x3a')][_0x1b93('0x52')]({'where':{'id':_0x583b2a[_0x1b93('0x51')]['id']}})[_0x1b93('0x1f')](handleEntityNotFound(_0x5b2605,null))[_0x1b93('0x1f')](saveUpdates(_0x583b2a[_0x1b93('0x54')],null))[_0x1b93('0x1f')](respondWithResult(_0x5b2605,null))[_0x1b93('0x28')](handleError(_0x5b2605,null));};exports['destroy']=function(_0x1e4551,_0xcc189e){return db['OpenchannelMessage']['find']({'where':{'id':_0x1e4551[_0x1b93('0x51')]['id']}})[_0x1b93('0x1f')](handleEntityNotFound(_0xcc189e,null))[_0x1b93('0x1f')](removeEntity(_0xcc189e,null))[_0x1b93('0x28')](handleError(_0xcc189e,null));};exports[_0x1b93('0x55')]=function(_0x20965e,_0x2050da){return db[_0x1b93('0x3a')]['describe']()[_0x1b93('0x1f')](respondWithResult(_0x2050da,null))[_0x1b93('0x28')](handleError(_0x2050da,null));};var interaction_log=require(_0x1b93('0x56'))(_0x1b93('0x57'));exports[_0x1b93('0x58')]=function(_0x32cf6c,_0x1c6054,_0x259a2c){var _0x55bcee={'agent':{},'channel':_0x1b93('0x59')};if(_0x32cf6c[_0x1b93('0x54')]['id']){delete _0x32cf6c[_0x1b93('0x54')]['id'];}_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5a')]=!![];_0x32cf6c['body'][_0x1b93('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')]=_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')]||_0x32cf6c['user']['id'];_0x55bcee[_0x1b93('0x5d')]['id']=_0x32cf6c['body']['UserId'];return db[_0x1b93('0x3a')]['find']({'where':{'id':_0x32cf6c[_0x1b93('0x51')]['id'],'UserId':null}})[_0x1b93('0x1f')](handleEntityNotFound(_0x1c6054,null))[_0x1b93('0x1f')](saveUpdates(_0x32cf6c[_0x1b93('0x54')],null))[_0x1b93('0x1f')](function(_0x3e09aa){if(_0x3e09aa){_0x55bcee[_0x1b93('0x25')]=_0x3e09aa[_0x1b93('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0x1b93('0x52')]({'where':{'id':_0x3e09aa[_0x1b93('0x5f')]}});}return null;})[_0x1b93('0x1f')](handleEntityNotFound(_0x1c6054,null))[_0x1b93('0x1f')](function(_0x12fb39){if(_0x12fb39){return _0x12fb39[_0x1b93('0x36')]({'UserId':_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')],'read1stAt':_['isNil'](_0x12fb39[_0x1b93('0x60')])?moment()[_0x1b93('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1b93('0x1f')](function(_0x369497){if(_0x369497){_0x55bcee['interaction']=_0x369497['get']({'plain':!![]});interaction_log['info'](_0x1b93('0x62'),_0x32cf6c[_0x1b93('0x63')]['id'],_0x32cf6c['user'][_0x1b93('0x38')],_0x32cf6c[_0x1b93('0x63')][_0x1b93('0x64')],_0x55bcee[_0x1b93('0x65')]['id'],_0x32cf6c['body']?JSON[_0x1b93('0x66')](_0x32cf6c[_0x1b93('0x54')]):_0x1b93('0x67'));return respondWithRpcPromise('AcceptMessage',_0x1b93('0x68'),_0x55bcee);}return null;})['then'](function(_0x5612c2){var _0xc22563='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5612c2[_0x1b93('0x25')]['ContactId'];return db[_0x1b93('0x69')][_0x1b93('0x3f')](_0xc22563,{'type':db[_0x1b93('0x6a')]['QueryTypes'][_0x1b93('0x6b')],'raw':!![]})[_0x1b93('0x1f')](function(_0x16a9d0){return _0x16a9d0;});})[_0x1b93('0x1f')](function(_0x80edbe){if(_0x80edbe){_0x55bcee[_0x1b93('0x25')][_0x1b93('0x6c')]=_0x80edbe[0x0];if(!_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')])return;return db[_0x1b93('0x6d')]['find']({'where':{'id':_0x32cf6c[_0x1b93('0x54')][_0x1b93('0x5c')],'role':'agent'},'attributes':['id',_0x1b93('0x38'),_0x1b93('0x6e'),'email',_0x1b93('0x6f')],'raw':!![]});}return null;})[_0x1b93('0x1f')](function(_0x51fc34){if(!_0x51fc34)return null;_0x55bcee[_0x1b93('0x25')][_0x1b93('0x5d')]=_0x51fc34;return _0x55bcee;})['then'](function(_0x571f2e){if(_0x571f2e){if(_0x32cf6c['body'][_0x1b93('0x70')]){_0x55bcee[_0x1b93('0x25')][_0x1b93('0x71')]=util[_0x1b93('0x61')](_0x1b93('0x72'),_0x32cf6c[_0x1b93('0x63')][_0x1b93('0x38')]);_0x55bcee[_0x1b93('0x25')][_0x1b93('0x73')]=_0x55bcee[_0x1b93('0x73')];_0x55bcee[_0x1b93('0x25')][_0x1b93('0x74')]=_0x55bcee[_0x1b93('0x73')];_0x55bcee[_0x1b93('0x25')][_0x1b93('0x75')]=_0x1b93('0x58');return respondWithRpcPromise(_0x1b93('0x76'),_0x1b93('0x76'),{'event':_0x1b93('0x77'),'message':_0x55bcee[_0x1b93('0x25')]},client9002)[_0x1b93('0x1f')](function(){return _0x55bcee;});}return _0x55bcee;}return null;})[_0x1b93('0x1f')](respondWithResult(_0x1c6054,null))['catch'](handleError(_0x1c6054,null));};var interaction_log=require(_0x1b93('0x56'))(_0x1b93('0x57'));exports['reject']=function(_0x1cc006,_0x453bd3,_0x40657c){var _0x598eae={'agent':{},'channel':_0x1b93('0x59')};if(_0x1cc006['body']['id']){delete _0x1cc006[_0x1b93('0x54')]['id'];}_0x1cc006['body'][_0x1b93('0x5c')]=_0x1cc006['body'][_0x1b93('0x5c')]||_0x1cc006[_0x1b93('0x63')]['id'];_0x598eae[_0x1b93('0x5d')]['id']=_0x1cc006['body'][_0x1b93('0x5c')];return db[_0x1b93('0x3a')][_0x1b93('0x52')]({'where':{'id':_0x1cc006['params']['id'],'UserId':null}})[_0x1b93('0x1f')](handleEntityNotFound(_0x453bd3,null))[_0x1b93('0x1f')](function(_0x27863c){if(_0x27863c){_0x598eae[_0x1b93('0x25')]=_0x27863c[_0x1b93('0x5e')]({'plain':!![]});return db[_0x1b93('0x78')]['find']({'where':{'id':_0x27863c[_0x1b93('0x5f')]}});}return null;})[_0x1b93('0x1f')](handleEntityNotFound(_0x453bd3,null))[_0x1b93('0x1f')](function(_0x3badf4){if(_0x3badf4){_0x598eae[_0x1b93('0x65')]=_0x3badf4[_0x1b93('0x5e')]({'plain':!![]});interaction_log[_0x1b93('0x26')](_0x1b93('0x79'),_0x1cc006[_0x1b93('0x63')]['id'],_0x1cc006[_0x1b93('0x63')]['name'],_0x1cc006[_0x1b93('0x63')][_0x1b93('0x64')],_0x598eae[_0x1b93('0x65')]['id'],_0x1cc006[_0x1b93('0x54')]?JSON[_0x1b93('0x66')](_0x1cc006['body']):_0x1b93('0x67'));return respondWithRpcPromise('RejectMessage',_0x1b93('0x7a'),_0x598eae);}return null;})['then'](function(_0x5db261){var _0x21aa38=_0x1b93('0x7b')+_0x5db261[_0x1b93('0x25')][_0x1b93('0x7c')];return db['sequelize']['query'](_0x21aa38,{'type':db[_0x1b93('0x6a')][_0x1b93('0x7d')]['SELECT'],'raw':!![]})[_0x1b93('0x1f')](function(_0x50ed33){return _0x50ed33;});})[_0x1b93('0x1f')](function(_0x1af304){if(_0x1af304){_0x598eae[_0x1b93('0x25')]['contact']=_0x1af304[0x0];if(!_0x1cc006[_0x1b93('0x54')]['UserId'])return;return db[_0x1b93('0x6d')][_0x1b93('0x52')]({'where':{'id':_0x1cc006['body'][_0x1b93('0x5c')],'role':'agent'},'attributes':['id',_0x1b93('0x38'),'fullname',_0x1b93('0x7e'),'internal'],'raw':!![]});}return null;})[_0x1b93('0x1f')](function(_0x27f984){if(!_0x27f984)return null;_0x598eae[_0x1b93('0x25')][_0x1b93('0x5d')]=_0x27f984;return _0x598eae;})[_0x1b93('0x1f')](function(_0x23afdc){if(_0x23afdc){_0x23afdc['message'][_0x1b93('0x71')]=util['format'](_0x1b93('0x72'),_0x1cc006['user']['name']);_0x23afdc[_0x1b93('0x25')][_0x1b93('0x73')]=_0x598eae[_0x1b93('0x73')];_0x23afdc[_0x1b93('0x25')][_0x1b93('0x74')]=_0x598eae[_0x1b93('0x73')];_0x23afdc[_0x1b93('0x25')]['event']=_0x1b93('0x34');respondWithRpcPromise(_0x1b93('0x76'),_0x1b93('0x76'),{'event':'rejectmessage','message':_0x23afdc['message']},client9002);return _0x598eae;}return null;})['then'](respondWithResult(_0x453bd3,null))[_0x1b93('0x28')](handleError(_0x453bd3,null));}; \ No newline at end of file +var _0xcd3b=['length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','internal','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes'];(function(_0x4fcbbe,_0x55a068){var _0x2ac729=function(_0x44aa09){while(--_0x44aa09){_0x4fcbbe['push'](_0x4fcbbe['shift']());}};_0x2ac729(++_0x55a068);}(_0xcd3b,0x145));var _0xbcd3=function(_0x3657bd,_0x10afb8){_0x3657bd=_0x3657bd-0x0;var _0x4f808a=_0xcd3b[_0x3657bd];return _0x4f808a;};'use strict';var emlformat=require(_0xbcd3('0x0'));var rimraf=require(_0xbcd3('0x1'));var zipdir=require(_0xbcd3('0x2'));var jsonpatch=require(_0xbcd3('0x3'));var rp=require(_0xbcd3('0x4'));var moment=require(_0xbcd3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcd3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbcd3('0x7'));var ejs=require(_0xbcd3('0x8'));var fs=require('fs');var fs_extra=require(_0xbcd3('0x9'));var _=require(_0xbcd3('0xa'));var squel=require(_0xbcd3('0xb'));var crypto=require(_0xbcd3('0xc'));var jsforce=require(_0xbcd3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbcd3('0x7'));var querystring=require(_0xbcd3('0xe'));var Papa=require(_0xbcd3('0xf'));var Redis=require(_0xbcd3('0x10'));var authService=require(_0xbcd3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbcd3('0x12'));var hardwareService=require(_0xbcd3('0x13'));var logger=require(_0xbcd3('0x14'))(_0xbcd3('0x15'));var utils=require(_0xbcd3('0x16'));var config=require(_0xbcd3('0x17'));var licenseUtil=require(_0xbcd3('0x18'));var db=require(_0xbcd3('0x19'))['db'];config[_0xbcd3('0x1a')]=_[_0xbcd3('0x1b')](config[_0xbcd3('0x1a')],{'host':_0xbcd3('0x1c'),'port':0x18eb});var socket=require(_0xbcd3('0x1d'))(new Redis(config[_0xbcd3('0x1a')]));require(_0xbcd3('0x1e'))['register'](socket);var jayson=require(_0xbcd3('0x1f'));var client=jayson['client'][_0xbcd3('0x20')]({'port':0x232c});var client9002=jayson[_0xbcd3('0x21')][_0xbcd3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5e4ac8,_0x27dbfc,_0x2a0b6a,_0x2ad7e6){return new BPromise(function(_0x3387fc,_0x2adb52){var _0x24051f=_0x2ad7e6||client;return _0x24051f[_0xbcd3('0x22')](_0x5e4ac8,_0x2a0b6a)[_0xbcd3('0x23')](function(_0x202981){logger[_0xbcd3('0x24')](_0xbcd3('0x25'),_0x27dbfc,_0xbcd3('0x26'));logger[_0xbcd3('0x27')](_0xbcd3('0x28'),_0x27dbfc,'request\x20sent',JSON['stringify'](_0x202981));if(_0x202981[_0xbcd3('0x29')]){if(_0x202981[_0xbcd3('0x29')][_0xbcd3('0x2a')]===0x1f4){logger['error'](_0xbcd3('0x25'),_0x27dbfc,_0x202981[_0xbcd3('0x29')]['message']);return _0x2adb52(_0x202981['error']['message']);}logger[_0xbcd3('0x29')](_0xbcd3('0x25'),_0x27dbfc,_0x202981[_0xbcd3('0x29')][_0xbcd3('0x2b')]);return _0x3387fc(_0x202981[_0xbcd3('0x29')][_0xbcd3('0x2b')]);}else{logger[_0xbcd3('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x27dbfc,'request\x20sent');_0x3387fc(_0x202981[_0xbcd3('0x2c')][_0xbcd3('0x2b')]);}})[_0xbcd3('0x2d')](function(_0x8017ab){logger[_0xbcd3('0x29')](_0xbcd3('0x25'),_0x27dbfc,_0x8017ab);_0x2adb52(_0x8017ab);});});}function respondWithStatusCode(_0x46e3e7,_0x232637){_0x232637=_0x232637||0xcc;return function(_0x18410){if(_0x18410){return _0x46e3e7[_0xbcd3('0x2e')](_0x232637);}return _0x46e3e7[_0xbcd3('0x2f')](_0x232637)[_0xbcd3('0x30')]();};}function respondWithResult(_0x2c13bf,_0x29935b){_0x29935b=_0x29935b||0xc8;return function(_0x11bf4f){if(_0x11bf4f){return _0x2c13bf[_0xbcd3('0x2f')](_0x29935b)[_0xbcd3('0x31')](_0x11bf4f);}};}function respondWithFilteredResult(_0xda1bbf,_0x571874){return function(_0x4a639d){if(_0x4a639d){var _0x219309=typeof _0x571874[_0xbcd3('0x32')]===_0xbcd3('0x33')&&typeof _0x571874['limit']===_0xbcd3('0x33');var _0x8e5a4=_0x4a639d[_0xbcd3('0x34')];var _0x3cbfc4=_0x219309?0x0:_0x571874[_0xbcd3('0x32')];var _0x4abe50=_0x219309?_0x4a639d[_0xbcd3('0x34')]:_0x571874[_0xbcd3('0x32')]+_0x571874[_0xbcd3('0x35')];var _0x45f40a;if(_0x4abe50>=_0x8e5a4){_0x4abe50=_0x8e5a4;_0x45f40a=0xc8;}else{_0x45f40a=0xce;}_0xda1bbf[_0xbcd3('0x2f')](_0x45f40a);return _0xda1bbf['set'](_0xbcd3('0x36'),_0x3cbfc4+'-'+_0x4abe50+'/'+_0x8e5a4)['json'](_0x4a639d);}return null;};}function patchUpdates(_0x40ed60){return function(_0x206a77){try{jsonpatch[_0xbcd3('0x37')](_0x206a77,_0x40ed60,!![]);}catch(_0x387b69){return BPromise[_0xbcd3('0x38')](_0x387b69);}return _0x206a77['save']();};}function saveUpdates(_0x3c00f1,_0x4eb6c5){return function(_0x43d551){if(_0x43d551){return _0x43d551[_0xbcd3('0x39')](_0x3c00f1)[_0xbcd3('0x23')](function(_0x8c2255){return _0x8c2255;});}return null;};}function removeEntity(_0x223834,_0x1876d1){return function(_0x51866a){if(_0x51866a){return _0x51866a[_0xbcd3('0x3a')]()[_0xbcd3('0x23')](function(){_0x223834[_0xbcd3('0x2f')](0xcc)[_0xbcd3('0x30')]();});}};}function handleEntityNotFound(_0x3f1ead,_0x90e55d){return function(_0x17e4f5){if(!_0x17e4f5){_0x3f1ead[_0xbcd3('0x2e')](0x194);}return _0x17e4f5;};}function handleError(_0x2a0653,_0xd249ec){_0xd249ec=_0xd249ec||0x1f4;return function(_0x4d18ea){logger[_0xbcd3('0x29')](_0x4d18ea[_0xbcd3('0x3b')]);if(_0x4d18ea[_0xbcd3('0x3c')]){delete _0x4d18ea[_0xbcd3('0x3c')];}_0x2a0653[_0xbcd3('0x2f')](_0xd249ec)[_0xbcd3('0x3d')](_0x4d18ea);};}exports[_0xbcd3('0x3e')]=function(_0x32cd0d,_0x20dd02){var _0x1ac999={},_0x4d41e3={},_0x543548={'count':0x0,'rows':[]};var _0xc56d5=_[_0xbcd3('0x3f')](db[_0xbcd3('0x40')][_0xbcd3('0x41')],function(_0x44c3ff){return{'name':_0x44c3ff[_0xbcd3('0x42')],'type':_0x44c3ff[_0xbcd3('0x43')][_0xbcd3('0x44')]};});_0x4d41e3[_0xbcd3('0x45')]=_[_0xbcd3('0x3f')](_0xc56d5,'name');_0x4d41e3['query']=_['keys'](_0x32cd0d['query']);_0x4d41e3[_0xbcd3('0x46')]=_[_0xbcd3('0x47')](_0x4d41e3[_0xbcd3('0x45')],_0x4d41e3[_0xbcd3('0x48')]);_0x1ac999[_0xbcd3('0x49')]=_[_0xbcd3('0x47')](_0x4d41e3[_0xbcd3('0x45')],qs['fields'](_0x32cd0d[_0xbcd3('0x48')]['fields']));_0x1ac999[_0xbcd3('0x49')]=_0x1ac999['attributes'][_0xbcd3('0x4a')]?_0x1ac999[_0xbcd3('0x49')]:_0x4d41e3[_0xbcd3('0x45')];if(!_0x32cd0d['query']['hasOwnProperty']('nolimit')){_0x1ac999[_0xbcd3('0x35')]=qs[_0xbcd3('0x35')](_0x32cd0d['query'][_0xbcd3('0x35')]);_0x1ac999[_0xbcd3('0x32')]=qs[_0xbcd3('0x32')](_0x32cd0d['query'][_0xbcd3('0x32')]);}_0x1ac999['order']=qs[_0xbcd3('0x4b')](_0x32cd0d[_0xbcd3('0x48')][_0xbcd3('0x4b')]);_0x1ac999[_0xbcd3('0x4c')]=qs['filters'](_[_0xbcd3('0x4d')](_0x32cd0d[_0xbcd3('0x48')],_0x4d41e3[_0xbcd3('0x46')]),_0xc56d5);if(_0x32cd0d['query'][_0xbcd3('0x4e')]){_0x1ac999[_0xbcd3('0x4c')]=_[_0xbcd3('0x4f')](_0x1ac999[_0xbcd3('0x4c')],{'$or':_[_0xbcd3('0x3f')](_0xc56d5,function(_0x3808a6){if(_0x3808a6['type']!==_0xbcd3('0x50')){var _0x39a673={};_0x39a673[_0x3808a6[_0xbcd3('0x3c')]]={'$like':'%'+_0x32cd0d[_0xbcd3('0x48')]['filter']+'%'};return _0x39a673;}})});}_0x1ac999=_['merge']({},_0x1ac999,_0x32cd0d[_0xbcd3('0x51')]);var _0x3a15c1={'where':_0x1ac999[_0xbcd3('0x4c')]};return db[_0xbcd3('0x40')][_0xbcd3('0x34')](_0x3a15c1)[_0xbcd3('0x23')](function(_0x1f2596){_0x543548[_0xbcd3('0x34')]=_0x1f2596;if(_0x32cd0d['query'][_0xbcd3('0x52')]){_0x1ac999[_0xbcd3('0x53')]=[{'all':!![]}];}return db[_0xbcd3('0x40')][_0xbcd3('0x54')](_0x1ac999);})[_0xbcd3('0x23')](function(_0x42d04a){_0x543548[_0xbcd3('0x55')]=_0x42d04a;return _0x543548;})[_0xbcd3('0x23')](respondWithFilteredResult(_0x20dd02,_0x1ac999))[_0xbcd3('0x2d')](handleError(_0x20dd02,null));};exports[_0xbcd3('0x56')]=function(_0x18fe2b,_0x92fe4){var _0x51e928={'raw':!![],'where':{'id':_0x18fe2b[_0xbcd3('0x57')]['id']}},_0x2c0195={};_0x2c0195[_0xbcd3('0x45')]=_[_0xbcd3('0x58')](db[_0xbcd3('0x40')][_0xbcd3('0x41')]);_0x2c0195[_0xbcd3('0x48')]=_[_0xbcd3('0x58')](_0x18fe2b[_0xbcd3('0x48')]);_0x2c0195[_0xbcd3('0x46')]=_[_0xbcd3('0x47')](_0x2c0195['model'],_0x2c0195[_0xbcd3('0x48')]);_0x51e928[_0xbcd3('0x49')]=_[_0xbcd3('0x47')](_0x2c0195[_0xbcd3('0x45')],qs['fields'](_0x18fe2b['query']['fields']));_0x51e928[_0xbcd3('0x49')]=_0x51e928[_0xbcd3('0x49')]['length']?_0x51e928[_0xbcd3('0x49')]:_0x2c0195[_0xbcd3('0x45')];if(_0x18fe2b['query'][_0xbcd3('0x52')]){_0x51e928[_0xbcd3('0x53')]=[{'all':!![]}];}_0x51e928=_[_0xbcd3('0x4f')]({},_0x51e928,_0x18fe2b[_0xbcd3('0x51')]);return db['OpenchannelMessage'][_0xbcd3('0x59')](_0x51e928)['then'](handleEntityNotFound(_0x92fe4,null))['then'](respondWithResult(_0x92fe4,null))[_0xbcd3('0x2d')](handleError(_0x92fe4,null));};exports[_0xbcd3('0x5a')]=function(_0x15eb58,_0x558fb0){return db['OpenchannelMessage'][_0xbcd3('0x5a')](_0x15eb58[_0xbcd3('0x5b')],{})['then'](respondWithResult(_0x558fb0,0xc9))[_0xbcd3('0x2d')](handleError(_0x558fb0,null));};exports['update']=function(_0x323d0e,_0x368506){if(_0x323d0e[_0xbcd3('0x5b')]['id']){delete _0x323d0e[_0xbcd3('0x5b')]['id'];}return db[_0xbcd3('0x40')][_0xbcd3('0x59')]({'where':{'id':_0x323d0e[_0xbcd3('0x57')]['id']}})[_0xbcd3('0x23')](handleEntityNotFound(_0x368506,null))[_0xbcd3('0x23')](saveUpdates(_0x323d0e[_0xbcd3('0x5b')],null))['then'](respondWithResult(_0x368506,null))[_0xbcd3('0x2d')](handleError(_0x368506,null));};exports[_0xbcd3('0x3a')]=function(_0x469c8e,_0x3daeb0){return db[_0xbcd3('0x40')][_0xbcd3('0x59')]({'where':{'id':_0x469c8e['params']['id']}})[_0xbcd3('0x23')](handleEntityNotFound(_0x3daeb0,null))[_0xbcd3('0x23')](removeEntity(_0x3daeb0,null))['catch'](handleError(_0x3daeb0,null));};exports[_0xbcd3('0x5c')]=function(_0x1870ef,_0x1e1141){return db[_0xbcd3('0x40')][_0xbcd3('0x5c')]()['then'](respondWithResult(_0x1e1141,null))['catch'](handleError(_0x1e1141,null));};var interaction_log=require(_0xbcd3('0x14'))(_0xbcd3('0x5d'));exports[_0xbcd3('0x5e')]=function(_0x2324b8,_0x805df4,_0x1e2eb9){var _0x2a4aba={'agent':{},'channel':_0xbcd3('0x5f')};if(_0x2324b8[_0xbcd3('0x5b')]['id']){delete _0x2324b8['body']['id'];}_0x2324b8['body']['read']=!![];_0x2324b8[_0xbcd3('0x5b')][_0xbcd3('0x60')]=moment()[_0xbcd3('0x61')](_0xbcd3('0x62'));_0x2324b8[_0xbcd3('0x5b')][_0xbcd3('0x63')]=_0x2324b8['body']['UserId']||_0x2324b8[_0xbcd3('0x64')]['id'];_0x2a4aba['agent']['id']=_0x2324b8[_0xbcd3('0x5b')]['UserId'];return db[_0xbcd3('0x40')][_0xbcd3('0x59')]({'where':{'id':_0x2324b8[_0xbcd3('0x57')]['id'],'UserId':null}})[_0xbcd3('0x23')](handleEntityNotFound(_0x805df4,null))[_0xbcd3('0x23')](saveUpdates(_0x2324b8[_0xbcd3('0x5b')],null))['then'](function(_0x2dd46a){if(_0x2dd46a){_0x2a4aba[_0xbcd3('0x2b')]=_0x2dd46a['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xbcd3('0x59')]({'where':{'id':_0x2dd46a['OpenchannelInteractionId']}});}return null;})[_0xbcd3('0x23')](handleEntityNotFound(_0x805df4,null))[_0xbcd3('0x23')](function(_0x4fb211){if(_0x4fb211){return _0x4fb211[_0xbcd3('0x39')]({'UserId':_0x2324b8['body']['UserId'],'read1stAt':_['isNil'](_0x4fb211[_0xbcd3('0x65')])?moment()[_0xbcd3('0x61')](_0xbcd3('0x62')):undefined});}return null;})[_0xbcd3('0x23')](function(_0x3d3c87){if(_0x3d3c87){_0x2a4aba[_0xbcd3('0x66')]=_0x3d3c87[_0xbcd3('0x67')]({'plain':!![]});interaction_log[_0xbcd3('0x24')](_0xbcd3('0x68'),_0x2324b8['user']['id'],_0x2324b8[_0xbcd3('0x64')][_0xbcd3('0x3c')],_0x2324b8[_0xbcd3('0x64')][_0xbcd3('0x69')],_0x2a4aba[_0xbcd3('0x66')]['id'],_0x2324b8['body']?JSON[_0xbcd3('0x6a')](_0x2324b8[_0xbcd3('0x5b')]):_0xbcd3('0x6b'));return respondWithRpcPromise('AcceptMessage',_0xbcd3('0x6c'),_0x2a4aba);}return null;})[_0xbcd3('0x23')](function(_0x349472){var _0x312ee0=_0xbcd3('0x6d')+_0x349472[_0xbcd3('0x2b')][_0xbcd3('0x6e')];return db['sequelize'][_0xbcd3('0x48')](_0x312ee0,{'type':db['Sequelize'][_0xbcd3('0x6f')][_0xbcd3('0x70')],'raw':!![]})[_0xbcd3('0x23')](function(_0x31efcd){return _0x31efcd;});})[_0xbcd3('0x23')](function(_0x529422){if(_0x529422){_0x2a4aba['message'][_0xbcd3('0x71')]=_0x529422[0x0];if(!_0x2324b8['body']['UserId'])return;return db[_0xbcd3('0x72')][_0xbcd3('0x59')]({'where':{'id':_0x2324b8[_0xbcd3('0x5b')]['UserId'],'role':_0xbcd3('0x73')},'attributes':['id',_0xbcd3('0x3c'),_0xbcd3('0x74'),_0xbcd3('0x75'),'internal'],'raw':!![]});}return null;})[_0xbcd3('0x23')](function(_0x529f7d){if(!_0x529f7d)return null;_0x2a4aba[_0xbcd3('0x2b')][_0xbcd3('0x73')]=_0x529f7d;return _0x2a4aba;})['then'](function(_0x23a7d1){if(_0x23a7d1){if(_0x2324b8[_0xbcd3('0x5b')][_0xbcd3('0x76')]){_0x2a4aba['message'][_0xbcd3('0x77')]=util['format'](_0xbcd3('0x78'),_0x2324b8[_0xbcd3('0x64')][_0xbcd3('0x3c')]);_0x2a4aba[_0xbcd3('0x2b')][_0xbcd3('0x79')]=_0x2a4aba[_0xbcd3('0x79')];_0x2a4aba[_0xbcd3('0x2b')][_0xbcd3('0x7a')]=_0x2a4aba[_0xbcd3('0x79')];_0x2a4aba[_0xbcd3('0x2b')][_0xbcd3('0x7b')]='accept';return respondWithRpcPromise(_0xbcd3('0x7c'),_0xbcd3('0x7c'),{'event':_0xbcd3('0x7d'),'message':_0x2a4aba[_0xbcd3('0x2b')]},client9002)['then'](function(){return _0x2a4aba;});}return _0x2a4aba;}return null;})[_0xbcd3('0x23')](respondWithResult(_0x805df4,null))[_0xbcd3('0x2d')](handleError(_0x805df4,null));};var interaction_log=require(_0xbcd3('0x14'))(_0xbcd3('0x5d'));exports[_0xbcd3('0x38')]=function(_0x2234f9,_0x41b318,_0x14fd07){var _0x23000d={'agent':{},'channel':_0xbcd3('0x5f')};if(_0x2234f9[_0xbcd3('0x5b')]['id']){delete _0x2234f9[_0xbcd3('0x5b')]['id'];}_0x2234f9[_0xbcd3('0x5b')]['UserId']=_0x2234f9[_0xbcd3('0x5b')]['UserId']||_0x2234f9[_0xbcd3('0x64')]['id'];_0x23000d['agent']['id']=_0x2234f9['body'][_0xbcd3('0x63')];return db[_0xbcd3('0x40')]['find']({'where':{'id':_0x2234f9[_0xbcd3('0x57')]['id'],'UserId':null}})[_0xbcd3('0x23')](handleEntityNotFound(_0x41b318,null))['then'](function(_0xab5d3e){if(_0xab5d3e){_0x23000d['message']=_0xab5d3e[_0xbcd3('0x67')]({'plain':!![]});return db[_0xbcd3('0x7e')][_0xbcd3('0x59')]({'where':{'id':_0xab5d3e[_0xbcd3('0x7f')]}});}return null;})[_0xbcd3('0x23')](handleEntityNotFound(_0x41b318,null))[_0xbcd3('0x23')](function(_0x30f8d8){if(_0x30f8d8){_0x23000d[_0xbcd3('0x66')]=_0x30f8d8[_0xbcd3('0x67')]({'plain':!![]});interaction_log[_0xbcd3('0x24')](_0xbcd3('0x80'),_0x2234f9[_0xbcd3('0x64')]['id'],_0x2234f9['user'][_0xbcd3('0x3c')],_0x2234f9[_0xbcd3('0x64')][_0xbcd3('0x69')],_0x23000d[_0xbcd3('0x66')]['id'],_0x2234f9[_0xbcd3('0x5b')]?JSON[_0xbcd3('0x6a')](_0x2234f9[_0xbcd3('0x5b')]):_0xbcd3('0x6b'));return respondWithRpcPromise(_0xbcd3('0x81'),_0xbcd3('0x82'),_0x23000d);}return null;})[_0xbcd3('0x23')](function(_0x35c433){var _0x10ad35='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x35c433[_0xbcd3('0x2b')][_0xbcd3('0x6e')];return db[_0xbcd3('0x83')][_0xbcd3('0x48')](_0x10ad35,{'type':db['Sequelize'][_0xbcd3('0x6f')][_0xbcd3('0x70')],'raw':!![]})[_0xbcd3('0x23')](function(_0x50eab1){return _0x50eab1;});})[_0xbcd3('0x23')](function(_0x26f2a4){if(_0x26f2a4){_0x23000d[_0xbcd3('0x2b')][_0xbcd3('0x71')]=_0x26f2a4[0x0];if(!_0x2234f9[_0xbcd3('0x5b')][_0xbcd3('0x63')])return;return db[_0xbcd3('0x72')][_0xbcd3('0x59')]({'where':{'id':_0x2234f9['body'][_0xbcd3('0x63')],'role':_0xbcd3('0x73')},'attributes':['id',_0xbcd3('0x3c'),_0xbcd3('0x74'),'email',_0xbcd3('0x84')],'raw':!![]});}return null;})[_0xbcd3('0x23')](function(_0x17cb43){if(!_0x17cb43)return null;_0x23000d[_0xbcd3('0x2b')][_0xbcd3('0x73')]=_0x17cb43;return _0x23000d;})['then'](function(_0x37f1d3){if(_0x37f1d3){_0x37f1d3[_0xbcd3('0x2b')][_0xbcd3('0x77')]=util[_0xbcd3('0x61')]('SIP/%s',_0x2234f9[_0xbcd3('0x64')][_0xbcd3('0x3c')]);_0x37f1d3['message']['channel']=_0x23000d[_0xbcd3('0x79')];_0x37f1d3[_0xbcd3('0x2b')][_0xbcd3('0x7a')]=_0x23000d[_0xbcd3('0x79')];_0x37f1d3[_0xbcd3('0x2b')]['event']='reject';respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x37f1d3[_0xbcd3('0x2b')]},client9002);return _0x23000d;}return null;})[_0xbcd3('0x23')](respondWithResult(_0x41b318,null))[_0xbcd3('0x2d')](handleError(_0x41b318,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2b98602..0987b24 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 _0x31c9=['save','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage'];(function(_0x3e29c4,_0x22e6e9){var _0x5adaee=function(_0x1ed936){while(--_0x1ed936){_0x3e29c4['push'](_0x3e29c4['shift']());}};_0x5adaee(++_0x22e6e9);}(_0x31c9,0x7e));var _0x931c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x31c9[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x931c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x931c('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x931c('0x2'),'afterUpdate':'update','afterDestroy':_0x931c('0x3')};function emitEvent(_0x1cc887){return function(_0x9df802,_0xdf2b12,_0x1f1637){OpenchannelMessageEvents['emit'](_0x1cc887+':'+_0x9df802['id'],_0x9df802);OpenchannelMessageEvents[_0x931c('0x4')](_0x1cc887,_0x9df802);_0x1f1637(null);};}for(var e in events){if(events[_0x931c('0x5')](e)){var event=events[e];OpenchannelMessage[_0x931c('0x6')](e,emitEvent(event));}}module[_0x931c('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x8d0b=['hasOwnProperty','hook','exports','../../mysqldb','save','update','emit'];(function(_0x4a6fa3,_0x3ac68d){var _0xe2f728=function(_0x4cc05b){while(--_0x4cc05b){_0x4a6fa3['push'](_0x4a6fa3['shift']());}};_0xe2f728(++_0x3ac68d);}(_0x8d0b,0xea));var _0xb8d0=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x8d0b[_0x2f9467];return _0x39894c;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xb8d0('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8d0('0x1'),'afterUpdate':_0xb8d0('0x2'),'afterDestroy':'remove'};function emitEvent(_0x419283){return function(_0x221fef,_0xe6ea93,_0x2d4eaf){OpenchannelMessageEvents[_0xb8d0('0x3')](_0x419283+':'+_0x221fef['id'],_0x221fef);OpenchannelMessageEvents[_0xb8d0('0x3')](_0x419283,_0x221fef);_0x2d4eaf(null);};}for(var e in events){if(events[_0xb8d0('0x4')](e)){var event=events[e];OpenchannelMessage[_0xb8d0('0x5')](e,emitEvent(event));}}module[_0xb8d0('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 57fbec8..4f8f345 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 _0x5eb8=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','omit','POST','method','GET','info','body','Interaction','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys'];(function(_0x2d682b,_0x2bd648){var _0x258253=function(_0x5bf9e8){while(--_0x5bf9e8){_0x2d682b['push'](_0x2d682b['shift']());}};_0x258253(++_0x2bd648);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x5eb8[_0x2ed8f3];return _0x525a55;};'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':[{'name':_0x85eb('0xc'),'fields':['body'],'type':_0x85eb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50ea77,_0x1f0036,_0x40d6b6){var _0x673228=_0x2bf83c[_0x85eb('0xe')];var _0x1dacf2=_0x50ea77[_0x85eb('0xf')]({'plain':!![]});if(_0x1dacf2[_0x85eb('0x10')]['toLowerCase']()==='in'||_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()==='out'&&!_0x1dacf2[_0x85eb('0x12')]&&!_[_0x85eb('0x13')](_0x1dacf2[_0x85eb('0x14')])){_0x673228[_0x85eb('0x15')]['findOne']({'where':{'id':_0x1dacf2['OpenchannelInteractionId']}})[_0x85eb('0x16')](function(_0x5c760a){if(_0x5c760a){_0x5c760a[_0x85eb('0x17')]({'lastMsgAt':_0x1dacf2[_0x85eb('0x18')],'lastMsgDirection':_0x1dacf2[_0x85eb('0x10')][_0x85eb('0x11')]()});}})[_0x85eb('0x19')](function(_0x49efdf){console[_0x85eb('0x1a')](_0x49efdf);});}if(_0x1dacf2['direction']===_0x85eb('0x1b')&&!_0x1dacf2[_0x85eb('0x12')]){var _0x3e23e8;_0x673228[_0x85eb('0x1c')]['describe']()['then'](function(_0x50d2a8){return _0x673228[_0x85eb('0x1d')][_0x85eb('0x1e')]({'where':{'id':_0x1dacf2[_0x85eb('0x1f')]},'include':[{'model':_0x673228[_0x85eb('0x15')],'as':_0x85eb('0x20'),'where':{'id':_0x1dacf2[_0x85eb('0x21')]},'limit':0x1,'include':[{'model':_0x673228['CmContact'],'as':_0x85eb('0x22'),'attributes':_[_0x85eb('0x23')](_0x50d2a8)}]}]});})[_0x85eb('0x16')](function(_0x4e8041){_0x3e23e8=_0x4e8041['get']({'plain':!![]});if(_0x3e23e8&&_0x3e23e8['replyUri']){logger['info'](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')](_0x85eb('0x27'),_0x1dacf2['id'],_0x3e23e8[_0x85eb('0x28')]));if(_0x3e23e8[_0x85eb('0x20')]&&_0x3e23e8['Interactions']['length']){_0x1dacf2['Interaction']=_[_0x85eb('0x29')](_0x3e23e8[_0x85eb('0x20')][0x0],_0x85eb('0x22'));_0x1dacf2[_0x85eb('0x22')]=_0x3e23e8[_0x85eb('0x20')][0x0][_0x85eb('0x22')];}var _0x1f0036={'method':_0x85eb('0x2a'),'uri':encodeURI(_0x3e23e8[_0x85eb('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f0036[_0x85eb('0x2b')]){case _0x85eb('0x2c'):_0x1f0036['qs']=_0x1dacf2;break;case _0x85eb('0x2a'):_0x1f0036['body']=_0x1dacf2;break;}return rp(_0x1f0036)[_0x85eb('0x16')](function(_0x792d3a){logger[_0x85eb('0x2d')](_0x85eb('0x24'),_0x85eb('0x25'),util[_0x85eb('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x1dacf2['id'],_0x3e23e8['replyUri']));if(_0x792d3a[_0x85eb('0x2e')]['threadId']&&_0x792d3a[_0x85eb('0x2e')]['threadId']!=_0x1dacf2[_0x85eb('0x2f')][_0x85eb('0x30')]){return _0x673228[_0x85eb('0x15')][_0x85eb('0x17')]({'threadId':_0x792d3a[_0x85eb('0x2e')][_0x85eb('0x30')]},{'logging':!![],'where':{'id':_0x1dacf2[_0x85eb('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x50ea77[_0x85eb('0x17')]({'read':!![]});})[_0x85eb('0x19')](function(_0x515ee9){logger[_0x85eb('0x1a')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x85eb('0x31')](_0x515ee9,{'showHidden':![],'depth':null}));_0x40d6b6();});}else{_0x40d6b6();}})[_0x85eb('0x32')](function(){_0x40d6b6();});}else{_0x40d6b6();}}},'charset':_0x85eb('0x33'),'collate':_0x85eb('0x34')});}; \ No newline at end of file +var _0x9348=['catch','error','CmContact','describe','find','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt'];(function(_0x48679e,_0x27cfd9){var _0xf6ebf1=function(_0xae0ef0){while(--_0xae0ef0){_0x48679e['push'](_0x48679e['shift']());}};_0xf6ebf1(++_0x27cfd9);}(_0x9348,0x10d));var _0x8934=function(_0x13b80b,_0x170454){_0x13b80b=_0x13b80b-0x0;var _0xf3430a=_0x9348[_0x13b80b];return _0xf3430a;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[{'name':_0x8934('0xc'),'fields':[_0x8934('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b470d,_0x5ec16d,_0x5336f0){var _0x2c722b=_0x2bce03['models'];var _0xe1adf4=_0x4b470d[_0x8934('0xe')]({'plain':!![]});if(_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()==='in'||_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()===_0x8934('0x11')&&!_0xe1adf4[_0x8934('0x12')]&&!_['isNil'](_0xe1adf4[_0x8934('0x13')])){_0x2c722b[_0x8934('0x14')][_0x8934('0x15')]({'where':{'id':_0xe1adf4[_0x8934('0x16')]}})[_0x8934('0x17')](function(_0xdf59f4){if(_0xdf59f4){_0xdf59f4['update']({'lastMsgAt':_0xe1adf4[_0x8934('0x18')],'lastMsgDirection':_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()});}})[_0x8934('0x19')](function(_0x34d4dc){console[_0x8934('0x1a')](_0x34d4dc);});}if(_0xe1adf4[_0x8934('0xf')]===_0x8934('0x11')&&!_0xe1adf4['secret']){var _0xb86bc9;_0x2c722b[_0x8934('0x1b')][_0x8934('0x1c')]()['then'](function(_0x47f25e){return _0x2c722b['OpenchannelAccount'][_0x8934('0x1d')]({'where':{'id':_0xe1adf4['OpenchannelAccountId']},'include':[{'model':_0x2c722b[_0x8934('0x14')],'as':_0x8934('0x1e'),'where':{'id':_0xe1adf4[_0x8934('0x16')]},'limit':0x1,'include':[{'model':_0x2c722b[_0x8934('0x1b')],'as':_0x8934('0x1f'),'attributes':_['keys'](_0x47f25e)}]}]});})[_0x8934('0x17')](function(_0x5ae49f){_0xb86bc9=_0x5ae49f[_0x8934('0xe')]({'plain':!![]});if(_0xb86bc9&&_0xb86bc9[_0x8934('0x20')]){logger[_0x8934('0x21')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x25'),_0xe1adf4['id'],_0xb86bc9['replyUri']));if(_0xb86bc9[_0x8934('0x1e')]&&_0xb86bc9[_0x8934('0x1e')][_0x8934('0x26')]){_0xe1adf4[_0x8934('0x27')]=_[_0x8934('0x28')](_0xb86bc9['Interactions'][0x0],_0x8934('0x1f'));_0xe1adf4[_0x8934('0x1f')]=_0xb86bc9[_0x8934('0x1e')][0x0]['Contact'];}var _0x5ec16d={'method':'POST','uri':encodeURI(_0xb86bc9[_0x8934('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5ec16d[_0x8934('0x29')]){case _0x8934('0x2a'):_0x5ec16d['qs']=_0xe1adf4;break;case'POST':_0x5ec16d[_0x8934('0xd')]=_0xe1adf4;break;}return rp(_0x5ec16d)[_0x8934('0x17')](function(_0x310454){logger[_0x8934('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x2b'),_0xe1adf4['id'],_0xb86bc9[_0x8934('0x20')]));if(_0x310454[_0x8934('0xd')][_0x8934('0x2c')]&&_0x310454[_0x8934('0xd')][_0x8934('0x2c')]!=_0xe1adf4[_0x8934('0x27')][_0x8934('0x2c')]){return _0x2c722b['OpenchannelInteraction'][_0x8934('0x2d')]({'threadId':_0x310454[_0x8934('0xd')]['threadId']},{'logging':!![],'where':{'id':_0xe1adf4[_0x8934('0x27')]['id']}});}else{return;}})[_0x8934('0x17')](function(){return _0x4b470d[_0x8934('0x2d')]({'read':!![]});})[_0x8934('0x19')](function(_0x4b3cb9){logger[_0x8934('0x1a')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x2e')](_0x4b3cb9,{'showHidden':![],'depth':null}));_0x5336f0();});}else{_0x5336f0();}})[_0x8934('0x2f')](function(){_0x5336f0();});}else{_0x5336f0();}}},'charset':'utf8mb4','collate':_0x8934('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 7d19c3c..20ffef9 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x52f498,_0xeec0c3){var _0x2a97cb=function(_0x43ad5d){while(--_0x43ad5d){_0x52f498['push'](_0x52f498['shift']());}};_0x2a97cb(++_0xeec0c3);}(_0x2ef3,0xba));var _0x32ef=function(_0x102582,_0x3cc038){_0x102582=_0x102582-0x0;var _0x63e2c5=_0x2ef3[_0x102582];return _0x63e2c5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x443947,_0x20911f){var _0x392ee6=function(_0x36c6b6){while(--_0x36c6b6){_0x443947['push'](_0x443947['shift']());}};_0x392ee6(++_0x20911f);}(_0x7a54,0x106));var _0x47a5=function(_0x527afc,_0x2a0fd1){_0x527afc=_0x527afc-0x0;var _0x45239d=_0x7a54[_0x527afc];return _0x45239d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 193e436..9a67728 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 _0xd4f4=['./openchannelMessage.events','update','emit','removeListener','register','openchannelMessage:'];(function(_0x2d7a8b,_0x7193d1){var _0x11c28e=function(_0x402455){while(--_0x402455){_0x2d7a8b['push'](_0x2d7a8b['shift']());}};_0x11c28e(++_0x7193d1);}(_0xd4f4,0x1bc));var _0x4d4f=function(_0x5c4442,_0x3536f6){_0x5c4442=_0x5c4442-0x0;var _0x15707a=_0xd4f4[_0x5c4442];return _0x15707a;};'use strict';var OpenchannelMessageEvents=require(_0x4d4f('0x0'));var events=['save','remove',_0x4d4f('0x1')];function createListener(_0x3abe87,_0x490a34){return function(_0x4c519c){_0x490a34[_0x4d4f('0x2')](_0x3abe87,_0x4c519c);};}function removeListener(_0x48e54e,_0x49f0ac){return function(){OpenchannelMessageEvents[_0x4d4f('0x3')](_0x48e54e,_0x49f0ac);};}exports[_0x4d4f('0x4')]=function(_0x23168c){for(var _0x4d3e22=0x0,_0x370640=events['length'];_0x4d3e22<_0x370640;_0x4d3e22++){var _0x54c172=events[_0x4d3e22];var _0x4b93d3=createListener(_0x4d4f('0x5')+_0x54c172,_0x23168c);OpenchannelMessageEvents['on'](_0x54c172,_0x4b93d3);}}; \ No newline at end of file +var _0xdd48=['openchannelMessage:','./openchannelMessage.events','save','update','register'];(function(_0x1315e2,_0xd8ae26){var _0x45dbe6=function(_0x3c3964){while(--_0x3c3964){_0x1315e2['push'](_0x1315e2['shift']());}};_0x45dbe6(++_0xd8ae26);}(_0xdd48,0xec));var _0x8dd4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdd48[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelMessageEvents=require(_0x8dd4('0x0'));var events=[_0x8dd4('0x1'),'remove',_0x8dd4('0x2')];function createListener(_0x488cd7,_0x20bd32){return function(_0x320d62){_0x20bd32['emit'](_0x488cd7,_0x320d62);};}function removeListener(_0x3201a5,_0x34ac5f){return function(){OpenchannelMessageEvents['removeListener'](_0x3201a5,_0x34ac5f);};}exports[_0x8dd4('0x3')]=function(_0x12d1c3){for(var _0x3d495e=0x0,_0x33b6db=events['length'];_0x3d495e<_0x33b6db;_0x3d495e++){var _0x1d8571=events[_0x3d495e];var _0x460b2f=createListener(_0x8dd4('0x4')+_0x1d8571,_0x12d1c3);OpenchannelMessageEvents['on'](_0x1d8571,_0x460b2f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 36409bc..79ce276 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 _0x387a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra'];(function(_0x1d3019,_0x8dbbd5){var _0x36458e=function(_0x5d60db){while(--_0x5d60db){_0x1d3019['push'](_0x1d3019['shift']());}};_0x36458e(++_0x8dbbd5);}(_0x387a,0xd4));var _0xa387=function(_0x1880f5,_0x18418a){_0x1880f5=_0x1880f5-0x0;var _0x3f0957=_0x387a[_0x1880f5];return _0x3f0957;};'use strict';var multer=require('multer');var util=require(_0xa387('0x0'));var path=require(_0xa387('0x1'));var timeout=require('connect-timeout');var express=require(_0xa387('0x2'));var router=express[_0xa387('0x3')]();var fs_extra=require(_0xa387('0x4'));var auth=require(_0xa387('0x5'));var interaction=require(_0xa387('0x6'));var config=require(_0xa387('0x7'));var controller=require('./openchannelQueue.controller');router[_0xa387('0x8')]('/',auth[_0xa387('0x9')](),controller[_0xa387('0xa')]);router['get'](_0xa387('0xb'),auth[_0xa387('0x9')](),controller[_0xa387('0xc')]);router['get'](_0xa387('0xd'),auth[_0xa387('0x9')](),controller[_0xa387('0xe')]);router[_0xa387('0x8')](_0xa387('0xf'),auth[_0xa387('0x9')](),controller[_0xa387('0x10')]);router['get'](_0xa387('0x11'),auth['isAuthenticated'](),controller[_0xa387('0x12')]);router[_0xa387('0x8')]('/:id/users',auth[_0xa387('0x9')](),controller['getAgents']);router[_0xa387('0x13')]('/',auth[_0xa387('0x9')](),controller[_0xa387('0x14')]);router[_0xa387('0x13')](_0xa387('0x11'),auth[_0xa387('0x9')](),controller[_0xa387('0x15')]);router[_0xa387('0x13')](_0xa387('0x16'),auth['isAuthenticated'](),controller[_0xa387('0x17')]);router[_0xa387('0x18')](_0xa387('0xd'),auth[_0xa387('0x9')](),controller[_0xa387('0x19')]);router['delete'](_0xa387('0xd'),auth[_0xa387('0x9')](),controller[_0xa387('0x1a')]);router[_0xa387('0x1b')](_0xa387('0x11'),auth[_0xa387('0x9')](),controller[_0xa387('0x1c')]);router[_0xa387('0x1b')](_0xa387('0x16'),auth[_0xa387('0x9')](),controller[_0xa387('0x1d')]);module[_0xa387('0x1e')]=router; \ No newline at end of file +var _0xc676=['/describe','describe','/:id','show','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc676,0xe0));var _0x6c67=function(_0x5526ed,_0x21fef8){_0x5526ed=_0x5526ed-0x0;var _0x5dd4c4=_0xc676[_0x5526ed];return _0x5dd4c4;};'use strict';var multer=require(_0x6c67('0x0'));var util=require('util');var path=require(_0x6c67('0x1'));var timeout=require(_0x6c67('0x2'));var express=require(_0x6c67('0x3'));var router=express[_0x6c67('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6c67('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c67('0x6'));router[_0x6c67('0x7')]('/',auth[_0x6c67('0x8')](),controller[_0x6c67('0x9')]);router[_0x6c67('0x7')](_0x6c67('0xa'),auth[_0x6c67('0x8')](),controller[_0x6c67('0xb')]);router[_0x6c67('0x7')](_0x6c67('0xc'),auth[_0x6c67('0x8')](),controller[_0x6c67('0xd')]);router['get'](_0x6c67('0xe'),auth[_0x6c67('0x8')](),controller['getMembers']);router[_0x6c67('0x7')]('/:id/teams',auth[_0x6c67('0x8')](),controller['getTeams']);router['get'](_0x6c67('0xf'),auth[_0x6c67('0x8')](),controller[_0x6c67('0x10')]);router[_0x6c67('0x11')]('/',auth[_0x6c67('0x8')](),controller[_0x6c67('0x12')]);router[_0x6c67('0x11')](_0x6c67('0x13'),auth[_0x6c67('0x8')](),controller[_0x6c67('0x14')]);router[_0x6c67('0x11')](_0x6c67('0xf'),auth[_0x6c67('0x8')](),controller[_0x6c67('0x15')]);router['put'](_0x6c67('0xc'),auth[_0x6c67('0x8')](),controller['update']);router[_0x6c67('0x16')](_0x6c67('0xc'),auth[_0x6c67('0x8')](),controller[_0x6c67('0x17')]);router[_0x6c67('0x16')](_0x6c67('0x13'),auth[_0x6c67('0x8')](),controller['removeTeams']);router[_0x6c67('0x16')](_0x6c67('0xf'),auth[_0x6c67('0x8')](),controller[_0x6c67('0x18')]);module[_0x6c67('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 10755e2..668baea 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 _0x502b=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x38ac39,_0x44d712){var _0x24097c=function(_0x2132d1){while(--_0x2132d1){_0x38ac39['push'](_0x38ac39['shift']());}};_0x24097c(++_0x44d712);}(_0x502b,0x99));var _0xb502=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0x502b[_0x23e33d];return _0x818fc;};'use strict';var Sequelize=require(_0xb502('0x0'));module[_0xb502('0x1')]={'name':{'type':Sequelize[_0xb502('0x2')],'unique':_0xb502('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[_0xb502('0x4')](_0xb502('0x5'),_0xb502('0x6'),_0xb502('0x7'))}}; \ No newline at end of file +var _0xcaf8=['INTEGER','beepall','STRING','name'];(function(_0x159c2f,_0xd39d20){var _0x591f68=function(_0x161ba6){while(--_0x161ba6){_0x159c2f['push'](_0x159c2f['shift']());}};_0x591f68(++_0xd39d20);}(_0xcaf8,0x11a));var _0x8caf=function(_0x4a17f7,_0x50e32c){_0x4a17f7=_0x4a17f7-0x0;var _0x58a045=_0xcaf8[_0x4a17f7];return _0x58a045;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8caf('0x0')],'unique':_0x8caf('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8caf('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x8caf('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 22e35f4..35b15c3 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 _0x6c10=['model','attributes','intersection','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','OpenchannelQueue','findAll','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','params','hasOwnProperty','order','sort','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0x6c10,0x1ef));var _0x06c1=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0x6c10[_0x1aab74];return _0x396af2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06c1('0x0'));var zipdir=require(_0x06c1('0x1'));var jsonpatch=require(_0x06c1('0x2'));var rp=require(_0x06c1('0x3'));var moment=require(_0x06c1('0x4'));var BPromise=require(_0x06c1('0x5'));var Mustache=require('mustache');var util=require(_0x06c1('0x6'));var path=require(_0x06c1('0x7'));var sox=require(_0x06c1('0x8'));var csv=require(_0x06c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06c1('0xa'));var _=require(_0x06c1('0xb'));var squel=require(_0x06c1('0xc'));var crypto=require(_0x06c1('0xd'));var jsforce=require(_0x06c1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x06c1('0x9'));var querystring=require(_0x06c1('0xf'));var Papa=require('papaparse');var Redis=require(_0x06c1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06c1('0x11'));var hardwareService=require(_0x06c1('0x12'));var logger=require('../../config/logger')(_0x06c1('0x13'));var utils=require(_0x06c1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x06c1('0x15'));var db=require(_0x06c1('0x16'))['db'];config[_0x06c1('0x17')]=_['defaults'](config[_0x06c1('0x17')],{'host':_0x06c1('0x18'),'port':0x18eb});var socket=require(_0x06c1('0x19'))(new Redis(config[_0x06c1('0x17')]));require(_0x06c1('0x1a'))[_0x06c1('0x1b')](socket);function respondWithStatusCode(_0x46666b,_0x562c27){_0x562c27=_0x562c27||0xcc;return function(_0x261d58){if(_0x261d58){return _0x46666b[_0x06c1('0x1c')](_0x562c27);}return _0x46666b[_0x06c1('0x1d')](_0x562c27)['end']();};}function respondWithResult(_0x5e05d0,_0x40580e){_0x40580e=_0x40580e||0xc8;return function(_0x264bd5){if(_0x264bd5){return _0x5e05d0['status'](_0x40580e)[_0x06c1('0x1e')](_0x264bd5);}};}function respondWithFilteredResult(_0x40ccbe,_0x374951){return function(_0x37b3bf){if(_0x37b3bf){var _0x226b95=typeof _0x374951[_0x06c1('0x1f')]===_0x06c1('0x20')&&typeof _0x374951['limit']==='undefined';var _0x2e9399=_0x37b3bf[_0x06c1('0x21')];var _0xb19c8e=_0x226b95?0x0:_0x374951[_0x06c1('0x1f')];var _0x27723b=_0x226b95?_0x37b3bf[_0x06c1('0x21')]:_0x374951['offset']+_0x374951[_0x06c1('0x22')];var _0x4f60dd;if(_0x27723b>=_0x2e9399){_0x27723b=_0x2e9399;_0x4f60dd=0xc8;}else{_0x4f60dd=0xce;}_0x40ccbe['status'](_0x4f60dd);return _0x40ccbe[_0x06c1('0x23')](_0x06c1('0x24'),_0xb19c8e+'-'+_0x27723b+'/'+_0x2e9399)[_0x06c1('0x1e')](_0x37b3bf);}return null;};}function patchUpdates(_0x32ae9d){return function(_0x38982a){try{jsonpatch['apply'](_0x38982a,_0x32ae9d,!![]);}catch(_0x19230c){return BPromise[_0x06c1('0x25')](_0x19230c);}return _0x38982a[_0x06c1('0x26')]();};}function saveUpdates(_0x16116b,_0x448677){return function(_0x473ddf){if(_0x473ddf){return _0x473ddf[_0x06c1('0x27')](_0x16116b)[_0x06c1('0x28')](function(_0xe1a70f){return _0xe1a70f;});}return null;};}function removeEntity(_0x47dc97,_0x27f14b){return function(_0x3d0392){if(_0x3d0392){return _0x3d0392[_0x06c1('0x29')]()[_0x06c1('0x28')](function(){var _0x105a82=_0x3d0392[_0x06c1('0x2a')]({'plain':!![]});var _0x484984=_0x06c1('0x2b');return db[_0x06c1('0x2c')][_0x06c1('0x29')]({'where':{'type':_0x484984,'resourceId':_0x105a82['id']}})[_0x06c1('0x28')](function(){return _0x3d0392;});})['then'](function(){_0x47dc97['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f2b4,_0x16f809){return function(_0x5e41f1){if(!_0x5e41f1){_0x51f2b4[_0x06c1('0x1c')](0x194);}return _0x5e41f1;};}function handleError(_0x4103dd,_0x1c7f18){_0x1c7f18=_0x1c7f18||0x1f4;return function(_0x433554){logger[_0x06c1('0x2d')](_0x433554[_0x06c1('0x2e')]);if(_0x433554['name']){delete _0x433554[_0x06c1('0x2f')];}_0x4103dd['status'](_0x1c7f18)['send'](_0x433554);};}exports[_0x06c1('0x30')]=function(_0x10354d,_0x464fea){var _0x374308={},_0x4ab11f={},_0x133511={'count':0x0,'rows':[]};var _0x2d8ad7=_['map'](db['OpenchannelQueue'][_0x06c1('0x31')],function(_0x3aba51){return{'name':_0x3aba51[_0x06c1('0x32')],'type':_0x3aba51[_0x06c1('0x33')][_0x06c1('0x34')]};});_0x4ab11f['model']=_[_0x06c1('0x35')](_0x2d8ad7,_0x06c1('0x2f'));_0x4ab11f[_0x06c1('0x36')]=_[_0x06c1('0x37')](_0x10354d[_0x06c1('0x36')]);_0x4ab11f[_0x06c1('0x38')]=_['intersection'](_0x4ab11f[_0x06c1('0x39')],_0x4ab11f[_0x06c1('0x36')]);_0x374308[_0x06c1('0x3a')]=_[_0x06c1('0x3b')](_0x4ab11f[_0x06c1('0x39')],qs['fields'](_0x10354d[_0x06c1('0x36')][_0x06c1('0x3c')]));_0x374308['attributes']=_0x374308[_0x06c1('0x3a')][_0x06c1('0x3d')]?_0x374308[_0x06c1('0x3a')]:_0x4ab11f[_0x06c1('0x39')];if(!_0x10354d[_0x06c1('0x36')]['hasOwnProperty'](_0x06c1('0x3e'))){_0x374308['limit']=qs[_0x06c1('0x22')](_0x10354d[_0x06c1('0x36')][_0x06c1('0x22')]);_0x374308[_0x06c1('0x1f')]=qs['offset'](_0x10354d[_0x06c1('0x36')]['offset']);}_0x374308['order']=qs['sort'](_0x10354d[_0x06c1('0x36')]['sort']);_0x374308[_0x06c1('0x3f')]=qs[_0x06c1('0x38')](_[_0x06c1('0x40')](_0x10354d['query'],_0x4ab11f[_0x06c1('0x38')]),_0x2d8ad7);if(_0x10354d['query'][_0x06c1('0x41')]){_0x374308[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x374308[_0x06c1('0x3f')],{'$or':_[_0x06c1('0x35')](_0x2d8ad7,function(_0x5c2461){if(_0x5c2461['type']!==_0x06c1('0x43')){var _0x110285={};_0x110285[_0x5c2461['name']]={'$like':'%'+_0x10354d['query']['filter']+'%'};return _0x110285;}})});}_0x374308=_[_0x06c1('0x42')]({},_0x374308,_0x10354d[_0x06c1('0x44')]);var _0x2e136a={'where':_0x374308[_0x06c1('0x3f')]};return db['OpenchannelQueue']['count'](_0x2e136a)['then'](function(_0x578643){_0x133511[_0x06c1('0x21')]=_0x578643;if(_0x10354d[_0x06c1('0x36')][_0x06c1('0x45')]){_0x374308[_0x06c1('0x46')]=[{'all':!![]}];}return db[_0x06c1('0x47')][_0x06c1('0x48')](_0x374308);})[_0x06c1('0x28')](function(_0x384f6d){_0x133511[_0x06c1('0x49')]=_0x384f6d;return _0x133511;})[_0x06c1('0x28')](respondWithFilteredResult(_0x464fea,_0x374308))['catch'](handleError(_0x464fea,null));};exports[_0x06c1('0x4a')]=function(_0x4784fe,_0x27aea3){var _0x2b6545={'raw':!![],'where':{'id':_0x4784fe['params']['id']}},_0x4cf4f0={};_0x4cf4f0[_0x06c1('0x39')]=_[_0x06c1('0x37')](db[_0x06c1('0x47')][_0x06c1('0x31')]);_0x4cf4f0['query']=_[_0x06c1('0x37')](_0x4784fe[_0x06c1('0x36')]);_0x4cf4f0[_0x06c1('0x38')]=_[_0x06c1('0x3b')](_0x4cf4f0[_0x06c1('0x39')],_0x4cf4f0[_0x06c1('0x36')]);_0x2b6545[_0x06c1('0x3a')]=_[_0x06c1('0x3b')](_0x4cf4f0[_0x06c1('0x39')],qs[_0x06c1('0x3c')](_0x4784fe['query'][_0x06c1('0x3c')]));_0x2b6545['attributes']=_0x2b6545[_0x06c1('0x3a')]['length']?_0x2b6545['attributes']:_0x4cf4f0[_0x06c1('0x39')];if(_0x4784fe['query']['includeAll']){_0x2b6545[_0x06c1('0x46')]=[{'all':!![]}];}_0x2b6545=_['merge']({},_0x2b6545,_0x4784fe['options']);return db[_0x06c1('0x47')][_0x06c1('0x4b')](_0x2b6545)['then'](handleEntityNotFound(_0x27aea3,null))[_0x06c1('0x28')](respondWithResult(_0x27aea3,null))['catch'](handleError(_0x27aea3,null));};exports['create']=function(_0xeeb2f5,_0x13355d){return db[_0x06c1('0x47')][_0x06c1('0x4c')](_0xeeb2f5[_0x06c1('0x4d')],{})[_0x06c1('0x28')](function(_0x120a3b){var _0x1b96d1=_0xeeb2f5[_0x06c1('0x4e')][_0x06c1('0x2a')]({'plain':!![]});if(!_0x1b96d1)throw new Error(_0x06c1('0x4f'));if(_0x1b96d1[_0x06c1('0x50')]===_0x06c1('0x4e')){var _0x2146c2=_0x120a3b[_0x06c1('0x2a')]({'plain':!![]});var _0x2fca11=_0x06c1('0x2b');return db[_0x06c1('0x51')]['find']({'where':{'name':_0x2fca11,'userProfileId':_0x1b96d1[_0x06c1('0x52')]},'raw':!![]})[_0x06c1('0x28')](function(_0xb93d6e){if(_0xb93d6e&&_0xb93d6e[_0x06c1('0x53')]===0x0){return db[_0x06c1('0x2c')]['create']({'name':_0x2146c2[_0x06c1('0x2f')],'resourceId':_0x2146c2['id'],'type':_0xb93d6e[_0x06c1('0x2f')],'sectionId':_0xb93d6e['id']},{})['then'](function(){return _0x120a3b;});}else{return _0x120a3b;}})[_0x06c1('0x54')](function(_0x29c9e3){logger[_0x06c1('0x2d')](_0x06c1('0x55'),_0x29c9e3);throw _0x29c9e3;});}return _0x120a3b;})['then'](respondWithResult(_0x13355d,0xc9))['catch'](handleError(_0x13355d,null));};exports[_0x06c1('0x27')]=function(_0x1e6f1a,_0x1d0722){if(_0x1e6f1a[_0x06c1('0x4d')]['id']){delete _0x1e6f1a[_0x06c1('0x4d')]['id'];}return db[_0x06c1('0x47')]['find']({'where':{'id':_0x1e6f1a['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x1d0722,null))['then'](saveUpdates(_0x1e6f1a[_0x06c1('0x4d')],null))[_0x06c1('0x28')](respondWithResult(_0x1d0722,null))[_0x06c1('0x54')](handleError(_0x1d0722,null));};exports['destroy']=function(_0x5d7c5e,_0x493e0e){return db[_0x06c1('0x47')][_0x06c1('0x4b')]({'where':{'id':_0x5d7c5e['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x493e0e,null))[_0x06c1('0x28')](removeEntity(_0x493e0e,null))[_0x06c1('0x54')](handleError(_0x493e0e,null));};exports[_0x06c1('0x56')]=function(_0x29d9e8,_0xc15784){return db[_0x06c1('0x47')]['describe']()[_0x06c1('0x28')](respondWithResult(_0xc15784,null))['catch'](handleError(_0xc15784,null));};exports['getMembers']=function(_0x392aba,_0x1e255f,_0x900073){var _0x41575f={'raw':!![],'where':{}},_0x28c471={},_0x26f75b;return db[_0x06c1('0x47')][_0x06c1('0x57')]({'where':{'id':_0x392aba[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x1e255f,null))[_0x06c1('0x28')](function(_0x1bc5d8){if(_0x1bc5d8){_0x26f75b=_0x1bc5d8[_0x06c1('0x2a')]({'plain':!![]});_0x28c471[_0x06c1('0x39')]=_[_0x06c1('0x37')](db['UserOpenchannelQueue'][_0x06c1('0x31')]);_0x28c471[_0x06c1('0x36')]=_[_0x06c1('0x37')](_0x392aba[_0x06c1('0x36')]);_0x28c471[_0x06c1('0x38')]=_['intersection'](_0x28c471[_0x06c1('0x39')],_0x28c471[_0x06c1('0x36')]);_0x41575f[_0x06c1('0x3a')]=_[_0x06c1('0x3b')](_0x28c471[_0x06c1('0x39')],qs[_0x06c1('0x3c')](_0x392aba[_0x06c1('0x36')]['fields']));_0x41575f[_0x06c1('0x3a')]=_0x41575f[_0x06c1('0x3a')][_0x06c1('0x3d')]?_0x41575f[_0x06c1('0x3a')]:_0x28c471[_0x06c1('0x39')];if(!_0x392aba['query'][_0x06c1('0x59')]('nolimit')){_0x41575f[_0x06c1('0x22')]=qs[_0x06c1('0x22')](_0x392aba[_0x06c1('0x36')][_0x06c1('0x22')]);_0x41575f['offset']=qs[_0x06c1('0x1f')](_0x392aba[_0x06c1('0x36')]['offset']);}_0x41575f[_0x06c1('0x5a')]=qs[_0x06c1('0x5b')](_0x392aba[_0x06c1('0x36')]['sort']);_0x41575f[_0x06c1('0x3f')]=qs[_0x06c1('0x38')](_['pick'](_0x392aba[_0x06c1('0x36')],_0x28c471[_0x06c1('0x38')]));_0x41575f[_0x06c1('0x3f')][_0x06c1('0x5c')]=_0x1bc5d8['id'];if(_0x392aba[_0x06c1('0x36')][_0x06c1('0x41')]){_0x41575f[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x41575f[_0x06c1('0x3f')],{'$or':_[_0x06c1('0x35')](_0x41575f[_0x06c1('0x3a')],function(_0x5d508f){var _0x31ae56={};_0x31ae56[_0x5d508f]={'$like':'%'+_0x392aba[_0x06c1('0x36')][_0x06c1('0x41')]+'%'};return _0x31ae56;})});}_0x41575f=_[_0x06c1('0x42')]({},_0x41575f,_0x392aba['options']);return db[_0x06c1('0x5d')][_0x06c1('0x48')](_0x41575f);}})['then'](function(_0x22e254){if(_0x22e254){return db[_0x06c1('0x5e')][_0x06c1('0x5f')]({'where':{'id':_[_0x06c1('0x35')](_0x22e254,_0x06c1('0x60')),'role':_0x06c1('0x61')},'attributes':['id',_0x06c1('0x2f'),_0x06c1('0x62'),_0x06c1('0x63'),_0x06c1('0x64')]});}})['then'](function(_0x64e0c3){if(_0x64e0c3){return{'count':_0x64e0c3[_0x06c1('0x21')],'rows':_[_0x06c1('0x35')](_0x64e0c3['rows'],function(_0x1e3585){return{'membername':_0x1e3585[_0x06c1('0x2f')],'UserId':_0x1e3585['id'],'queue_name':_0x26f75b[_0x06c1('0x2f')],'OpenchannelQueueId':_0x26f75b['id'],'interface':util[_0x06c1('0x65')]('%s/%s','SIP',_0x1e3585[_0x06c1('0x2f')]),'penalty':0x0,'paused':_0x1e3585[_0x06c1('0x62')],'createdAt':_0x1e3585[_0x06c1('0x64')],'updatedAt':_0x1e3585[_0x06c1('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x06c1('0x28')](respondWithFilteredResult(_0x1e255f,_0x41575f))[_0x06c1('0x54')](handleError(_0x1e255f,null));};exports[_0x06c1('0x66')]=function(_0x5200c0,_0x21d384,_0x95b353){var _0x2039db={};var _0x397013={};var _0x534bf7;var _0x442b26;return db[_0x06c1('0x47')][_0x06c1('0x57')]({'where':{'id':_0x5200c0[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x21d384,null))['then'](function(_0x35b0a4){if(_0x35b0a4){_0x534bf7=_0x35b0a4;_0x397013['model']=_[_0x06c1('0x37')](db[_0x06c1('0x67')][_0x06c1('0x31')]);_0x397013[_0x06c1('0x36')]=_['keys'](_0x5200c0[_0x06c1('0x36')]);_0x397013[_0x06c1('0x38')]=_[_0x06c1('0x3b')](_0x397013[_0x06c1('0x39')],_0x397013[_0x06c1('0x36')]);_0x2039db['attributes']=_[_0x06c1('0x3b')](_0x397013['model'],qs[_0x06c1('0x3c')](_0x5200c0[_0x06c1('0x36')][_0x06c1('0x3c')]));_0x2039db[_0x06c1('0x3a')]=_0x2039db['attributes']['length']?_0x2039db[_0x06c1('0x3a')]:_0x397013['model'];_0x2039db[_0x06c1('0x5a')]=qs[_0x06c1('0x5b')](_0x5200c0['query'][_0x06c1('0x5b')]);_0x2039db['where']=qs[_0x06c1('0x38')](_['pick'](_0x5200c0[_0x06c1('0x36')],_0x397013[_0x06c1('0x38')]));if(_0x5200c0[_0x06c1('0x36')]['filter']){_0x2039db[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x2039db[_0x06c1('0x3f')],{'$or':_['map'](_0x2039db[_0x06c1('0x3a')],function(_0x4f0409){var _0x5cea64={};_0x5cea64[_0x4f0409]={'$like':'%'+_0x5200c0[_0x06c1('0x36')][_0x06c1('0x41')]+'%'};return _0x5cea64;})});}_0x2039db=_[_0x06c1('0x42')]({},_0x2039db,_0x5200c0['options']);return _0x534bf7['getTeams'](_0x2039db);}})['then'](function(_0x2b0017){if(_0x2b0017){_0x442b26=_0x2b0017[_0x06c1('0x3d')];if(!_0x5200c0[_0x06c1('0x36')][_0x06c1('0x59')](_0x06c1('0x3e'))){_0x2039db[_0x06c1('0x22')]=qs['limit'](_0x5200c0['query'][_0x06c1('0x22')]);_0x2039db[_0x06c1('0x1f')]=qs[_0x06c1('0x1f')](_0x5200c0[_0x06c1('0x36')][_0x06c1('0x1f')]);}return _0x534bf7['getTeams'](_0x2039db);}})[_0x06c1('0x28')](function(_0x1b8da0){if(_0x1b8da0){return _0x1b8da0?{'count':_0x442b26,'rows':_0x1b8da0}:null;}})['then'](respondWithResult(_0x21d384,null))[_0x06c1('0x54')](handleError(_0x21d384,null));};exports[_0x06c1('0x68')]=function(_0x3dea22,_0x2f308d,_0x1e4a35){var _0x446759=_0x3dea22[_0x06c1('0x4d')][_0x06c1('0x69')];return db['Team'][_0x06c1('0x48')]({'where':{'id':_0x446759},'attributes':['id'],'include':[{'model':db[_0x06c1('0x5e')],'as':_0x06c1('0x6a'),'attributes':['id','name',_0x06c1('0x6b'),_0x06c1('0x6c'),_0x06c1('0x6d')],'raw':!![]}]})[_0x06c1('0x28')](function(_0x1ffcb4){if(_0x1ffcb4){var _0x2e8ced=_[_0x06c1('0x6e')](_0x1ffcb4,function(_0x2d6b82){var _0xd4741e=_0x2d6b82[_0x06c1('0x2a')]({'plain':!![]});return _0xd4741e['Agents'];});return db['OpenchannelQueue'][_0x06c1('0x4b')]({'where':{'id':_0x3dea22[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](function(_0x5bc527){return db[_0x06c1('0x6f')][_0x06c1('0x70')](function(_0x106a5c){return _0x5bc527['addTeams'](_0x446759,{'transaction':_0x106a5c})['then'](function(){return BPromise[_0x06c1('0x71')](_0x2e8ced,function(_0x383810){return db['UserOpenchannelQueue'][_0x06c1('0x72')]({'where':{'UserId':_0x383810['id'],'OpenchannelQueueId':_0x3dea22[_0x06c1('0x58')]['id']},'transaction':_0x106a5c});});})[_0x06c1('0x28')](function(){_0x2e8ced[_0x06c1('0x73')](function(_0x1681ad){socket[_0x06c1('0x74')](_0x06c1('0x75'),{'UserId':_0x1681ad['id'],'OpenchannelQueueId':_0x5bc527['id']});});});});});}})[_0x06c1('0x28')](respondWithStatusCode(_0x2f308d,null))[_0x06c1('0x54')](handleError(_0x2f308d,null));};exports['removeTeams']=function(_0x3b2970,_0x472a5a,_0x5cbf65){return db[_0x06c1('0x67')][_0x06c1('0x48')]({'where':{'id':_0x3b2970[_0x06c1('0x36')][_0x06c1('0x69')]},'attributes':['id'],'include':[{'model':db[_0x06c1('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x06c1('0x28')](handleEntityNotFound(_0x472a5a,null))[_0x06c1('0x28')](function(_0x17a9a2){var _0x2b32c3=_[_0x06c1('0x35')](_0x17a9a2,'id');var _0x1fcf89=[];var _0x528a31=[];var _0x46326f=squel[_0x06c1('0x76')]();_0x46326f[_0x06c1('0x77')](_0x06c1('0x78'))[_0x06c1('0x79')](_0x06c1('0x7a'),'tq')['join']('user_has_teams','ut',_0x06c1('0x7b'))[_0x06c1('0x3f')](_0x06c1('0x7c'),_0x3b2970[_0x06c1('0x58')]['id']);for(var _0x3aad9f=0x0;_0x3aad9f<_0x17a9a2[_0x06c1('0x3d')];_0x3aad9f+=0x1){let _0x11625e=_0x17a9a2[_0x3aad9f];for(var _0x19258d=0x0;_0x19258d<_0x11625e[_0x06c1('0x6a')][_0x06c1('0x3d')];_0x19258d+=0x1){let _0x46add5=_0x11625e[_0x06c1('0x6a')][_0x19258d];var _0x17a060=_0x46326f['clone']();_0x17a060[_0x06c1('0x3f')]('ut.UserId\x20=\x20?',_0x46add5['id']);_0x528a31[_0x06c1('0x7d')](db[_0x06c1('0x6f')][_0x06c1('0x36')](_0x17a060['toString'](),{'type':db[_0x06c1('0x6f')]['QueryTypes']['SELECT']})[_0x06c1('0x28')](function(_0x467a30){if(_0x467a30[_0x06c1('0x3d')]===0x1){return _0x46add5['id'];}else{var _0x2489e2=_['every'](_[_0x06c1('0x35')](_0x467a30,_0x06c1('0x7e')),function(_0x389f0d){return _[_0x06c1('0x7f')](_0x2b32c3,_0x389f0d);});if(_0x2489e2){return _0x46add5['id'];}}}));}}return BPromise[_0x06c1('0x80')](_0x528a31)[_0x06c1('0x28')](function(_0x14ed5e){_0x1fcf89=_(_0x1fcf89)['union'](_0x14ed5e)[_0x06c1('0x81')]()[_0x06c1('0x82')]();return db[_0x06c1('0x47')][_0x06c1('0x4b')]({'where':{'id':_0x3b2970[_0x06c1('0x58')]['id']}})[_0x06c1('0x28')](function(_0x2bf3ae){return db[_0x06c1('0x6f')]['transaction'](function(_0x56e3dd){return _0x2bf3ae['removeTeams'](_0x3b2970[_0x06c1('0x36')][_0x06c1('0x69')],{'transaction':_0x56e3dd})[_0x06c1('0x28')](function(){if(!_[_0x06c1('0x83')](_0x1fcf89)){return _0x2bf3ae[_0x06c1('0x84')](_0x1fcf89,{'transaction':_0x56e3dd});}})[_0x06c1('0x28')](function(){_0x1fcf89[_0x06c1('0x73')](function(_0x7068d5){socket[_0x06c1('0x74')]('userOpenchannelQueue:remove',{'UserId':_0x7068d5,'OpenchannelQueueId':_0x2bf3ae['id']});});});});});});})[_0x06c1('0x28')](respondWithStatusCode(_0x472a5a,null))[_0x06c1('0x54')](handleError(_0x472a5a,null));};exports[_0x06c1('0x85')]=function(_0x55e239,_0x5b7115,_0x1309dd){return db['OpenchannelQueue']['find']({'where':{'id':_0x55e239['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x5b7115,null))['then'](function(_0xbe4971){if(_0xbe4971){return _0xbe4971[_0x06c1('0x85')](_0x55e239['body'][_0x06c1('0x69')],_[_0x06c1('0x86')](_0x55e239[_0x06c1('0x4d')],[_0x06c1('0x69'),'id'])||{})['spread'](function(_0x1534c3){for(var _0x2fdfc4=0x0;_0x2fdfc4<_0x55e239[_0x06c1('0x4d')][_0x06c1('0x69')][_0x06c1('0x3d')];_0x2fdfc4+=0x1){socket[_0x06c1('0x74')](_0x06c1('0x75'),{'UserId':Number(_0x55e239[_0x06c1('0x4d')]['ids'][_0x2fdfc4]),'OpenchannelQueueId':Number(_0x55e239['params']['id'])});}return _0x1534c3;});}})[_0x06c1('0x28')](respondWithResult(_0x5b7115,null))[_0x06c1('0x54')](handleError(_0x5b7115,null));};exports[_0x06c1('0x84')]=function(_0x180e99,_0x16ffd2,_0x7b74d6){return db[_0x06c1('0x47')]['find']({'where':{'id':_0x180e99['params']['id']}})[_0x06c1('0x28')](handleEntityNotFound(_0x16ffd2,null))[_0x06c1('0x28')](function(_0x186b8c){if(_0x186b8c){return _0x186b8c[_0x06c1('0x84')](_0x180e99[_0x06c1('0x36')]['ids'])['then'](function(){if(_[_0x06c1('0x87')](_0x180e99[_0x06c1('0x36')][_0x06c1('0x69')])){for(var _0x3633ed=0x0;_0x3633ed<_0x180e99['query']['ids'][_0x06c1('0x3d')];_0x3633ed+=0x1){socket[_0x06c1('0x74')](_0x06c1('0x88'),{'UserId':Number(_0x180e99[_0x06c1('0x36')][_0x06c1('0x69')][_0x3633ed]),'OpenchannelQueueId':Number(_0x180e99[_0x06c1('0x58')]['id'])});}}else{socket[_0x06c1('0x74')](_0x06c1('0x88'),{'UserId':Number(_0x180e99[_0x06c1('0x36')]['ids']),'OpenchannelQueueId':Number(_0x180e99[_0x06c1('0x58')]['id'])});}});}})[_0x06c1('0x28')](respondWithStatusCode(_0x16ffd2,null))[_0x06c1('0x54')](handleError(_0x16ffd2,null));};exports[_0x06c1('0x89')]=function(_0x1bd03f,_0x1c33be,_0x340a0e){var _0x3d537e={};var _0x6009dd={};var _0x3a5588;var _0x526229;return db[_0x06c1('0x47')]['findOne']({'where':{'id':_0x1bd03f[_0x06c1('0x58')]['id']}})['then'](handleEntityNotFound(_0x1c33be,null))[_0x06c1('0x28')](function(_0x546b12){if(_0x546b12){_0x3a5588=_0x546b12;_0x6009dd[_0x06c1('0x39')]=_['keys'](db[_0x06c1('0x5e')][_0x06c1('0x31')]);_0x6009dd[_0x06c1('0x36')]=_['keys'](_0x1bd03f[_0x06c1('0x36')]);_0x6009dd[_0x06c1('0x38')]=_['intersection'](_0x6009dd['model'],_0x6009dd['query']);_0x3d537e[_0x06c1('0x3a')]=_['intersection'](_0x6009dd[_0x06c1('0x39')],qs['fields'](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x3c')]));_0x3d537e[_0x06c1('0x3a')]=_0x3d537e[_0x06c1('0x3a')][_0x06c1('0x3d')]?_0x3d537e[_0x06c1('0x3a')]:_0x6009dd[_0x06c1('0x39')];_0x3d537e['order']=qs[_0x06c1('0x5b')](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x5b')]);_0x3d537e[_0x06c1('0x3f')]=qs['filters'](_['pick'](_0x1bd03f['query'],_0x6009dd[_0x06c1('0x38')]));if(_0x1bd03f[_0x06c1('0x36')]['filter']){_0x3d537e[_0x06c1('0x3f')]=_[_0x06c1('0x42')](_0x3d537e[_0x06c1('0x3f')],{'$or':_[_0x06c1('0x35')](_0x3d537e[_0x06c1('0x3a')],function(_0x1136e7){var _0x36bfee={};_0x36bfee[_0x1136e7]={'$like':'%'+_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x41')]+'%'};return _0x36bfee;})});}_0x3d537e=_[_0x06c1('0x42')]({},_0x3d537e,_0x1bd03f['options']);return _0x3a5588['getAgents'](_0x3d537e);}})[_0x06c1('0x28')](function(_0x14d48c){if(_0x14d48c){_0x526229=_0x14d48c[_0x06c1('0x3d')];if(!_0x1bd03f[_0x06c1('0x36')]['hasOwnProperty'](_0x06c1('0x3e'))){_0x3d537e['limit']=qs[_0x06c1('0x22')](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x22')]);_0x3d537e[_0x06c1('0x1f')]=qs['offset'](_0x1bd03f[_0x06c1('0x36')][_0x06c1('0x1f')]);}return _0x3a5588[_0x06c1('0x89')](_0x3d537e);}})['then'](function(_0x2c7942){if(_0x2c7942){return _0x2c7942?{'count':_0x526229,'rows':_0x2c7942}:null;}})[_0x06c1('0x28')](respondWithResult(_0x1c33be,null))[_0x06c1('0x54')](handleError(_0x1c33be,null));}; \ No newline at end of file +var _0xe568=['ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','union','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','order','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','fieldName','type','query','intersection','model','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','count','includeAll','include','findAll','rows','catch','keys','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','rawAttributes','hasOwnProperty','OpenchannelQueueId','UserOpenchannelQueue','User','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','interface','transaction','addTeams','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone'];(function(_0x5da7e1,_0x2ae2f8){var _0x4737d9=function(_0x240d89){while(--_0x240d89){_0x5da7e1['push'](_0x5da7e1['shift']());}};_0x4737d9(++_0x2ae2f8);}(_0xe568,0x12f));var _0x8e56=function(_0x3f52a1,_0x1aaa20){_0x3f52a1=_0x3f52a1-0x0;var _0xf98fb7=_0xe568[_0x3f52a1];return _0xf98fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e56('0x0'));var jsonpatch=require(_0x8e56('0x1'));var rp=require(_0x8e56('0x2'));var moment=require(_0x8e56('0x3'));var BPromise=require(_0x8e56('0x4'));var Mustache=require(_0x8e56('0x5'));var util=require(_0x8e56('0x6'));var path=require(_0x8e56('0x7'));var sox=require(_0x8e56('0x8'));var csv=require('to-csv');var ejs=require(_0x8e56('0x9'));var fs=require('fs');var fs_extra=require(_0x8e56('0xa'));var _=require(_0x8e56('0xb'));var squel=require(_0x8e56('0xc'));var crypto=require(_0x8e56('0xd'));var jsforce=require(_0x8e56('0xe'));var deskjs=require(_0x8e56('0xf'));var toCsv=require(_0x8e56('0x10'));var querystring=require(_0x8e56('0x11'));var Papa=require(_0x8e56('0x12'));var Redis=require(_0x8e56('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8e56('0x14'));var hardwareService=require(_0x8e56('0x15'));var logger=require(_0x8e56('0x16'))(_0x8e56('0x17'));var utils=require(_0x8e56('0x18'));var config=require(_0x8e56('0x19'));var licenseUtil=require(_0x8e56('0x1a'));var db=require(_0x8e56('0x1b'))['db'];config[_0x8e56('0x1c')]=_[_0x8e56('0x1d')](config[_0x8e56('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e56('0x1e'))(new Redis(config[_0x8e56('0x1c')]));require('./openchannelQueue.socket')[_0x8e56('0x1f')](socket);function respondWithStatusCode(_0x14b8a0,_0x3b2418){_0x3b2418=_0x3b2418||0xcc;return function(_0x332dd2){if(_0x332dd2){return _0x14b8a0[_0x8e56('0x20')](_0x3b2418);}return _0x14b8a0[_0x8e56('0x21')](_0x3b2418)[_0x8e56('0x22')]();};}function respondWithResult(_0x4adb49,_0x12aaf9){_0x12aaf9=_0x12aaf9||0xc8;return function(_0x5b697c){if(_0x5b697c){return _0x4adb49[_0x8e56('0x21')](_0x12aaf9)[_0x8e56('0x23')](_0x5b697c);}};}function respondWithFilteredResult(_0x17e4f9,_0x3d8432){return function(_0x5659f0){if(_0x5659f0){var _0x5cd64b=typeof _0x3d8432[_0x8e56('0x24')]==='undefined'&&typeof _0x3d8432[_0x8e56('0x25')]===_0x8e56('0x26');var _0x356ff2=_0x5659f0['count'];var _0x2bf2a7=_0x5cd64b?0x0:_0x3d8432[_0x8e56('0x24')];var _0x41da8d=_0x5cd64b?_0x5659f0['count']:_0x3d8432[_0x8e56('0x24')]+_0x3d8432[_0x8e56('0x25')];var _0x319f91;if(_0x41da8d>=_0x356ff2){_0x41da8d=_0x356ff2;_0x319f91=0xc8;}else{_0x319f91=0xce;}_0x17e4f9['status'](_0x319f91);return _0x17e4f9['set'](_0x8e56('0x27'),_0x2bf2a7+'-'+_0x41da8d+'/'+_0x356ff2)['json'](_0x5659f0);}return null;};}function patchUpdates(_0x1d8f9d){return function(_0xb52d96){try{jsonpatch['apply'](_0xb52d96,_0x1d8f9d,!![]);}catch(_0x335356){return BPromise[_0x8e56('0x28')](_0x335356);}return _0xb52d96[_0x8e56('0x29')]();};}function saveUpdates(_0x5c1cb7,_0x16e1dc){return function(_0x36b10c){if(_0x36b10c){return _0x36b10c[_0x8e56('0x2a')](_0x5c1cb7)['then'](function(_0x5742f6){return _0x5742f6;});}return null;};}function removeEntity(_0x133d6a,_0x35dce1){return function(_0xcd731a){if(_0xcd731a){return _0xcd731a[_0x8e56('0x2b')]()[_0x8e56('0x2c')](function(){var _0x11f86e=_0xcd731a[_0x8e56('0x2d')]({'plain':!![]});var _0x3fa0ff='OpenchannelQueues';return db[_0x8e56('0x2e')][_0x8e56('0x2b')]({'where':{'type':_0x3fa0ff,'resourceId':_0x11f86e['id']}})[_0x8e56('0x2c')](function(){return _0xcd731a;});})[_0x8e56('0x2c')](function(){_0x133d6a[_0x8e56('0x21')](0xcc)[_0x8e56('0x22')]();});}};}function handleEntityNotFound(_0x481c9d,_0x397cfa){return function(_0x51dd8c){if(!_0x51dd8c){_0x481c9d[_0x8e56('0x20')](0x194);}return _0x51dd8c;};}function handleError(_0x2d79fe,_0x3fdee2){_0x3fdee2=_0x3fdee2||0x1f4;return function(_0x370525){logger['error'](_0x370525[_0x8e56('0x2f')]);if(_0x370525['name']){delete _0x370525[_0x8e56('0x30')];}_0x2d79fe[_0x8e56('0x21')](_0x3fdee2)[_0x8e56('0x31')](_0x370525);};}exports[_0x8e56('0x32')]=function(_0x21bab9,_0x270690){var _0x29c561={},_0x1f0fe2={},_0xdaec17={'count':0x0,'rows':[]};var _0x11252d=_[_0x8e56('0x33')](db['OpenchannelQueue']['rawAttributes'],function(_0x15d0be){return{'name':_0x15d0be[_0x8e56('0x34')],'type':_0x15d0be[_0x8e56('0x35')]['key']};});_0x1f0fe2['model']=_['map'](_0x11252d,'name');_0x1f0fe2[_0x8e56('0x36')]=_['keys'](_0x21bab9['query']);_0x1f0fe2['filters']=_[_0x8e56('0x37')](_0x1f0fe2[_0x8e56('0x38')],_0x1f0fe2[_0x8e56('0x36')]);_0x29c561[_0x8e56('0x39')]=_[_0x8e56('0x37')](_0x1f0fe2[_0x8e56('0x38')],qs[_0x8e56('0x3a')](_0x21bab9[_0x8e56('0x36')][_0x8e56('0x3a')]));_0x29c561[_0x8e56('0x39')]=_0x29c561['attributes']['length']?_0x29c561[_0x8e56('0x39')]:_0x1f0fe2[_0x8e56('0x38')];if(!_0x21bab9['query']['hasOwnProperty'](_0x8e56('0x3b'))){_0x29c561[_0x8e56('0x25')]=qs[_0x8e56('0x25')](_0x21bab9['query'][_0x8e56('0x25')]);_0x29c561[_0x8e56('0x24')]=qs[_0x8e56('0x24')](_0x21bab9['query'][_0x8e56('0x24')]);}_0x29c561['order']=qs[_0x8e56('0x3c')](_0x21bab9[_0x8e56('0x36')][_0x8e56('0x3c')]);_0x29c561[_0x8e56('0x3d')]=qs[_0x8e56('0x3e')](_[_0x8e56('0x3f')](_0x21bab9[_0x8e56('0x36')],_0x1f0fe2[_0x8e56('0x3e')]),_0x11252d);if(_0x21bab9[_0x8e56('0x36')][_0x8e56('0x40')]){_0x29c561[_0x8e56('0x3d')]=_[_0x8e56('0x41')](_0x29c561[_0x8e56('0x3d')],{'$or':_[_0x8e56('0x33')](_0x11252d,function(_0x4da3e0){if(_0x4da3e0['type']!==_0x8e56('0x42')){var _0x498f16={};_0x498f16[_0x4da3e0['name']]={'$like':'%'+_0x21bab9[_0x8e56('0x36')][_0x8e56('0x40')]+'%'};return _0x498f16;}})});}_0x29c561=_['merge']({},_0x29c561,_0x21bab9[_0x8e56('0x43')]);var _0x1ba9b2={'where':_0x29c561['where']};return db[_0x8e56('0x44')][_0x8e56('0x45')](_0x1ba9b2)[_0x8e56('0x2c')](function(_0x1e86c2){_0xdaec17['count']=_0x1e86c2;if(_0x21bab9[_0x8e56('0x36')][_0x8e56('0x46')]){_0x29c561[_0x8e56('0x47')]=[{'all':!![]}];}return db[_0x8e56('0x44')][_0x8e56('0x48')](_0x29c561);})['then'](function(_0x468001){_0xdaec17[_0x8e56('0x49')]=_0x468001;return _0xdaec17;})[_0x8e56('0x2c')](respondWithFilteredResult(_0x270690,_0x29c561))[_0x8e56('0x4a')](handleError(_0x270690,null));};exports['show']=function(_0x3e24f0,_0x561758){var _0x686d03={'raw':!![],'where':{'id':_0x3e24f0['params']['id']}},_0x1b7000={};_0x1b7000[_0x8e56('0x38')]=_['keys'](db[_0x8e56('0x44')]['rawAttributes']);_0x1b7000[_0x8e56('0x36')]=_[_0x8e56('0x4b')](_0x3e24f0[_0x8e56('0x36')]);_0x1b7000['filters']=_[_0x8e56('0x37')](_0x1b7000[_0x8e56('0x38')],_0x1b7000['query']);_0x686d03[_0x8e56('0x39')]=_['intersection'](_0x1b7000[_0x8e56('0x38')],qs[_0x8e56('0x3a')](_0x3e24f0[_0x8e56('0x36')][_0x8e56('0x3a')]));_0x686d03[_0x8e56('0x39')]=_0x686d03[_0x8e56('0x39')][_0x8e56('0x4c')]?_0x686d03[_0x8e56('0x39')]:_0x1b7000['model'];if(_0x3e24f0['query'][_0x8e56('0x46')]){_0x686d03['include']=[{'all':!![]}];}_0x686d03=_[_0x8e56('0x41')]({},_0x686d03,_0x3e24f0[_0x8e56('0x43')]);return db['OpenchannelQueue'][_0x8e56('0x4d')](_0x686d03)[_0x8e56('0x2c')](handleEntityNotFound(_0x561758,null))[_0x8e56('0x2c')](respondWithResult(_0x561758,null))[_0x8e56('0x4a')](handleError(_0x561758,null));};exports['create']=function(_0x1a9d24,_0x3a5699){return db['OpenchannelQueue']['create'](_0x1a9d24[_0x8e56('0x4e')],{})['then'](function(_0x515e27){var _0x2806c1=_0x1a9d24['user']['get']({'plain':!![]});if(!_0x2806c1)throw new Error(_0x8e56('0x4f'));if(_0x2806c1[_0x8e56('0x50')]===_0x8e56('0x51')){var _0x3bbc27=_0x515e27['get']({'plain':!![]});var _0x2ae1b3=_0x8e56('0x52');return db[_0x8e56('0x53')][_0x8e56('0x4d')]({'where':{'name':_0x2ae1b3,'userProfileId':_0x2806c1['userProfileId']},'raw':!![]})[_0x8e56('0x2c')](function(_0xbc0364){if(_0xbc0364&&_0xbc0364[_0x8e56('0x54')]===0x0){return db[_0x8e56('0x2e')]['create']({'name':_0x3bbc27[_0x8e56('0x30')],'resourceId':_0x3bbc27['id'],'type':_0xbc0364[_0x8e56('0x30')],'sectionId':_0xbc0364['id']},{})[_0x8e56('0x2c')](function(){return _0x515e27;});}else{return _0x515e27;}})[_0x8e56('0x4a')](function(_0x1c2ce6){logger[_0x8e56('0x55')](_0x8e56('0x56'),_0x1c2ce6);throw _0x1c2ce6;});}return _0x515e27;})['then'](respondWithResult(_0x3a5699,0xc9))[_0x8e56('0x4a')](handleError(_0x3a5699,null));};exports[_0x8e56('0x2a')]=function(_0x12b379,_0xaafef2){if(_0x12b379['body']['id']){delete _0x12b379[_0x8e56('0x4e')]['id'];}return db['OpenchannelQueue'][_0x8e56('0x4d')]({'where':{'id':_0x12b379[_0x8e56('0x57')]['id']}})[_0x8e56('0x2c')](handleEntityNotFound(_0xaafef2,null))[_0x8e56('0x2c')](saveUpdates(_0x12b379[_0x8e56('0x4e')],null))[_0x8e56('0x2c')](respondWithResult(_0xaafef2,null))[_0x8e56('0x4a')](handleError(_0xaafef2,null));};exports['destroy']=function(_0x2f68b4,_0x55a4af){return db[_0x8e56('0x44')][_0x8e56('0x4d')]({'where':{'id':_0x2f68b4[_0x8e56('0x57')]['id']}})[_0x8e56('0x2c')](handleEntityNotFound(_0x55a4af,null))[_0x8e56('0x2c')](removeEntity(_0x55a4af,null))['catch'](handleError(_0x55a4af,null));};exports[_0x8e56('0x58')]=function(_0x47d1e6,_0x557c7c){return db[_0x8e56('0x44')][_0x8e56('0x58')]()[_0x8e56('0x2c')](respondWithResult(_0x557c7c,null))[_0x8e56('0x4a')](handleError(_0x557c7c,null));};exports[_0x8e56('0x59')]=function(_0x11b07b,_0x5d6d1e,_0x5675f1){var _0x4e19e0={'raw':!![],'where':{}},_0x2e82bb={},_0x4f18f0;return db[_0x8e56('0x44')][_0x8e56('0x5a')]({'where':{'id':_0x11b07b[_0x8e56('0x57')]['id']}})['then'](handleEntityNotFound(_0x5d6d1e,null))[_0x8e56('0x2c')](function(_0x1b6e37){if(_0x1b6e37){_0x4f18f0=_0x1b6e37['get']({'plain':!![]});_0x2e82bb[_0x8e56('0x38')]=_[_0x8e56('0x4b')](db['UserOpenchannelQueue'][_0x8e56('0x5b')]);_0x2e82bb[_0x8e56('0x36')]=_[_0x8e56('0x4b')](_0x11b07b[_0x8e56('0x36')]);_0x2e82bb['filters']=_['intersection'](_0x2e82bb[_0x8e56('0x38')],_0x2e82bb[_0x8e56('0x36')]);_0x4e19e0[_0x8e56('0x39')]=_[_0x8e56('0x37')](_0x2e82bb[_0x8e56('0x38')],qs[_0x8e56('0x3a')](_0x11b07b[_0x8e56('0x36')]['fields']));_0x4e19e0[_0x8e56('0x39')]=_0x4e19e0[_0x8e56('0x39')][_0x8e56('0x4c')]?_0x4e19e0[_0x8e56('0x39')]:_0x2e82bb['model'];if(!_0x11b07b[_0x8e56('0x36')][_0x8e56('0x5c')](_0x8e56('0x3b'))){_0x4e19e0[_0x8e56('0x25')]=qs['limit'](_0x11b07b['query'][_0x8e56('0x25')]);_0x4e19e0[_0x8e56('0x24')]=qs[_0x8e56('0x24')](_0x11b07b[_0x8e56('0x36')]['offset']);}_0x4e19e0['order']=qs[_0x8e56('0x3c')](_0x11b07b[_0x8e56('0x36')]['sort']);_0x4e19e0[_0x8e56('0x3d')]=qs[_0x8e56('0x3e')](_[_0x8e56('0x3f')](_0x11b07b[_0x8e56('0x36')],_0x2e82bb[_0x8e56('0x3e')]));_0x4e19e0[_0x8e56('0x3d')][_0x8e56('0x5d')]=_0x1b6e37['id'];if(_0x11b07b[_0x8e56('0x36')]['filter']){_0x4e19e0['where']=_[_0x8e56('0x41')](_0x4e19e0['where'],{'$or':_[_0x8e56('0x33')](_0x4e19e0['attributes'],function(_0x3cb1e7){var _0x346f30={};_0x346f30[_0x3cb1e7]={'$like':'%'+_0x11b07b[_0x8e56('0x36')][_0x8e56('0x40')]+'%'};return _0x346f30;})});}_0x4e19e0=_[_0x8e56('0x41')]({},_0x4e19e0,_0x11b07b['options']);return db[_0x8e56('0x5e')][_0x8e56('0x48')](_0x4e19e0);}})[_0x8e56('0x2c')](function(_0x2356da){if(_0x2356da){return db[_0x8e56('0x5f')]['findAndCountAll']({'where':{'id':_[_0x8e56('0x33')](_0x2356da,_0x8e56('0x60')),'role':_0x8e56('0x61')},'attributes':['id',_0x8e56('0x30'),_0x8e56('0x62'),_0x8e56('0x63'),_0x8e56('0x64')]});}})[_0x8e56('0x2c')](function(_0x5885f6){if(_0x5885f6){return{'count':_0x5885f6[_0x8e56('0x45')],'rows':_[_0x8e56('0x33')](_0x5885f6[_0x8e56('0x49')],function(_0xc808ad){return{'membername':_0xc808ad['name'],'UserId':_0xc808ad['id'],'queue_name':_0x4f18f0[_0x8e56('0x30')],'OpenchannelQueueId':_0x4f18f0['id'],'interface':util['format'](_0x8e56('0x65'),_0x8e56('0x66'),_0xc808ad['name']),'penalty':0x0,'paused':_0xc808ad['openchannelPause'],'createdAt':_0xc808ad[_0x8e56('0x64')],'updatedAt':_0xc808ad[_0x8e56('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5d6d1e,_0x4e19e0))[_0x8e56('0x4a')](handleError(_0x5d6d1e,null));};exports[_0x8e56('0x67')]=function(_0xb94e55,_0x491e95,_0x394b82){var _0x455285={};var _0x3d625d={};var _0x419a35;var _0x36242d;return db[_0x8e56('0x44')][_0x8e56('0x5a')]({'where':{'id':_0xb94e55[_0x8e56('0x57')]['id']}})[_0x8e56('0x2c')](handleEntityNotFound(_0x491e95,null))[_0x8e56('0x2c')](function(_0x3829e2){if(_0x3829e2){_0x419a35=_0x3829e2;_0x3d625d[_0x8e56('0x38')]=_[_0x8e56('0x4b')](db['Team'][_0x8e56('0x5b')]);_0x3d625d[_0x8e56('0x36')]=_['keys'](_0xb94e55[_0x8e56('0x36')]);_0x3d625d[_0x8e56('0x3e')]=_[_0x8e56('0x37')](_0x3d625d[_0x8e56('0x38')],_0x3d625d[_0x8e56('0x36')]);_0x455285[_0x8e56('0x39')]=_['intersection'](_0x3d625d[_0x8e56('0x38')],qs[_0x8e56('0x3a')](_0xb94e55['query'][_0x8e56('0x3a')]));_0x455285['attributes']=_0x455285[_0x8e56('0x39')][_0x8e56('0x4c')]?_0x455285[_0x8e56('0x39')]:_0x3d625d[_0x8e56('0x38')];_0x455285['order']=qs[_0x8e56('0x3c')](_0xb94e55[_0x8e56('0x36')][_0x8e56('0x3c')]);_0x455285['where']=qs['filters'](_[_0x8e56('0x3f')](_0xb94e55['query'],_0x3d625d[_0x8e56('0x3e')]));if(_0xb94e55[_0x8e56('0x36')][_0x8e56('0x40')]){_0x455285[_0x8e56('0x3d')]=_['merge'](_0x455285[_0x8e56('0x3d')],{'$or':_['map'](_0x455285[_0x8e56('0x39')],function(_0x42b2c8){var _0x31b7df={};_0x31b7df[_0x42b2c8]={'$like':'%'+_0xb94e55[_0x8e56('0x36')][_0x8e56('0x40')]+'%'};return _0x31b7df;})});}_0x455285=_[_0x8e56('0x41')]({},_0x455285,_0xb94e55[_0x8e56('0x43')]);return _0x419a35[_0x8e56('0x67')](_0x455285);}})[_0x8e56('0x2c')](function(_0x174cbf){if(_0x174cbf){_0x36242d=_0x174cbf[_0x8e56('0x4c')];if(!_0xb94e55[_0x8e56('0x36')][_0x8e56('0x5c')](_0x8e56('0x3b'))){_0x455285['limit']=qs[_0x8e56('0x25')](_0xb94e55[_0x8e56('0x36')][_0x8e56('0x25')]);_0x455285[_0x8e56('0x24')]=qs[_0x8e56('0x24')](_0xb94e55[_0x8e56('0x36')]['offset']);}return _0x419a35[_0x8e56('0x67')](_0x455285);}})['then'](function(_0x6bee63){if(_0x6bee63){return _0x6bee63?{'count':_0x36242d,'rows':_0x6bee63}:null;}})[_0x8e56('0x2c')](respondWithResult(_0x491e95,null))[_0x8e56('0x4a')](handleError(_0x491e95,null));};exports['addTeams']=function(_0x33550e,_0x3161e7,_0x61bd58){var _0x4948c9=_0x33550e[_0x8e56('0x4e')][_0x8e56('0x68')];return db[_0x8e56('0x69')][_0x8e56('0x48')]({'where':{'id':_0x4948c9},'attributes':['id'],'include':[{'model':db[_0x8e56('0x5f')],'as':_0x8e56('0x6a'),'attributes':['id','name',_0x8e56('0x6b'),_0x8e56('0x6c'),_0x8e56('0x6d')],'raw':!![]}]})[_0x8e56('0x2c')](function(_0x101d8c){if(_0x101d8c){var _0x51e15c=_['flatMap'](_0x101d8c,function(_0x42f242){var _0x3f6d2b=_0x42f242[_0x8e56('0x2d')]({'plain':!![]});return _0x3f6d2b['Agents'];});return db[_0x8e56('0x44')][_0x8e56('0x4d')]({'where':{'id':_0x33550e['params']['id']}})[_0x8e56('0x2c')](function(_0x5f0441){return db['sequelize'][_0x8e56('0x6e')](function(_0x550885){return _0x5f0441[_0x8e56('0x6f')](_0x4948c9,{'transaction':_0x550885})['then'](function(){return BPromise[_0x8e56('0x70')](_0x51e15c,function(_0x5695eb){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x5695eb['id'],'OpenchannelQueueId':_0x33550e[_0x8e56('0x57')]['id']},'transaction':_0x550885});});})['then'](function(){_0x51e15c[_0x8e56('0x71')](function(_0x8a4156){socket[_0x8e56('0x72')](_0x8e56('0x73'),{'UserId':_0x8a4156['id'],'OpenchannelQueueId':_0x5f0441['id']});});});});});}})[_0x8e56('0x2c')](respondWithStatusCode(_0x3161e7,null))[_0x8e56('0x4a')](handleError(_0x3161e7,null));};exports[_0x8e56('0x74')]=function(_0xda6e03,_0x54fbac,_0x1bca27){return db[_0x8e56('0x69')][_0x8e56('0x48')]({'where':{'id':_0xda6e03[_0x8e56('0x36')][_0x8e56('0x68')]},'attributes':['id'],'include':[{'model':db[_0x8e56('0x5f')],'as':_0x8e56('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x8e56('0x2c')](handleEntityNotFound(_0x54fbac,null))['then'](function(_0x4dafcf){var _0x12112f=_[_0x8e56('0x33')](_0x4dafcf,'id');var _0x9bab47=[];var _0x254c45=[];var _0x9589eb=squel[_0x8e56('0x75')]();_0x9589eb[_0x8e56('0x76')](_0x8e56('0x77'))[_0x8e56('0x78')]('team_has_openchannel_queues','tq')[_0x8e56('0x79')](_0x8e56('0x7a'),'ut',_0x8e56('0x7b'))[_0x8e56('0x3d')](_0x8e56('0x7c'),_0xda6e03[_0x8e56('0x57')]['id']);for(var _0x35368c=0x0;_0x35368c<_0x4dafcf[_0x8e56('0x4c')];_0x35368c+=0x1){let _0x1905fa=_0x4dafcf[_0x35368c];for(var _0x53745e=0x0;_0x53745e<_0x1905fa[_0x8e56('0x6a')][_0x8e56('0x4c')];_0x53745e+=0x1){let _0x406f0e=_0x1905fa['Agents'][_0x53745e];var _0x4e4c1b=_0x9589eb[_0x8e56('0x7d')]();_0x4e4c1b[_0x8e56('0x3d')](_0x8e56('0x7e'),_0x406f0e['id']);_0x254c45[_0x8e56('0x7f')](db[_0x8e56('0x80')][_0x8e56('0x36')](_0x4e4c1b['toString'](),{'type':db[_0x8e56('0x80')][_0x8e56('0x81')][_0x8e56('0x82')]})['then'](function(_0x37dae6){if(_0x37dae6[_0x8e56('0x4c')]===0x1){return _0x406f0e['id'];}else{var _0x4ceb82=_[_0x8e56('0x83')](_[_0x8e56('0x33')](_0x37dae6,'TeamId'),function(_0x61d4cf){return _['includes'](_0x12112f,_0x61d4cf);});if(_0x4ceb82){return _0x406f0e['id'];}}}));}}return BPromise['all'](_0x254c45)[_0x8e56('0x2c')](function(_0x535852){_0x9bab47=_(_0x9bab47)[_0x8e56('0x84')](_0x535852)['compact']()[_0x8e56('0x85')]();return db['OpenchannelQueue'][_0x8e56('0x4d')]({'where':{'id':_0xda6e03[_0x8e56('0x57')]['id']}})[_0x8e56('0x2c')](function(_0x339fe5){return db[_0x8e56('0x80')]['transaction'](function(_0x205a6d){return _0x339fe5[_0x8e56('0x74')](_0xda6e03[_0x8e56('0x36')][_0x8e56('0x68')],{'transaction':_0x205a6d})[_0x8e56('0x2c')](function(){if(!_[_0x8e56('0x86')](_0x9bab47)){return _0x339fe5[_0x8e56('0x87')](_0x9bab47,{'transaction':_0x205a6d});}})[_0x8e56('0x2c')](function(){_0x9bab47[_0x8e56('0x71')](function(_0x33c2b4){socket[_0x8e56('0x72')](_0x8e56('0x88'),{'UserId':_0x33c2b4,'OpenchannelQueueId':_0x339fe5['id']});});});});});});})['then'](respondWithStatusCode(_0x54fbac,null))[_0x8e56('0x4a')](handleError(_0x54fbac,null));};exports[_0x8e56('0x89')]=function(_0xcbcc6f,_0x3598d2,_0x27e1d7){return db[_0x8e56('0x44')][_0x8e56('0x4d')]({'where':{'id':_0xcbcc6f[_0x8e56('0x57')]['id']}})['then'](handleEntityNotFound(_0x3598d2,null))[_0x8e56('0x2c')](function(_0x41f1de){if(_0x41f1de){return _0x41f1de['addAgents'](_0xcbcc6f[_0x8e56('0x4e')][_0x8e56('0x68')],_[_0x8e56('0x8a')](_0xcbcc6f[_0x8e56('0x4e')],[_0x8e56('0x68'),'id'])||{})[_0x8e56('0x8b')](function(_0x488147){for(var _0xf61325=0x0;_0xf61325<_0xcbcc6f['body'][_0x8e56('0x68')][_0x8e56('0x4c')];_0xf61325+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0xcbcc6f[_0x8e56('0x4e')][_0x8e56('0x68')][_0xf61325]),'OpenchannelQueueId':Number(_0xcbcc6f[_0x8e56('0x57')]['id'])});}return _0x488147;});}})[_0x8e56('0x2c')](respondWithResult(_0x3598d2,null))[_0x8e56('0x4a')](handleError(_0x3598d2,null));};exports[_0x8e56('0x87')]=function(_0x80200d,_0x15da60,_0x2af053){return db['OpenchannelQueue'][_0x8e56('0x4d')]({'where':{'id':_0x80200d[_0x8e56('0x57')]['id']}})[_0x8e56('0x2c')](handleEntityNotFound(_0x15da60,null))[_0x8e56('0x2c')](function(_0x3cb6cb){if(_0x3cb6cb){return _0x3cb6cb[_0x8e56('0x87')](_0x80200d['query']['ids'])['then'](function(){if(_[_0x8e56('0x8c')](_0x80200d[_0x8e56('0x36')]['ids'])){for(var _0x525d9e=0x0;_0x525d9e<_0x80200d['query'][_0x8e56('0x68')][_0x8e56('0x4c')];_0x525d9e+=0x1){socket[_0x8e56('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0x80200d['query'][_0x8e56('0x68')][_0x525d9e]),'OpenchannelQueueId':Number(_0x80200d['params']['id'])});}}else{socket['emit'](_0x8e56('0x88'),{'UserId':Number(_0x80200d[_0x8e56('0x36')][_0x8e56('0x68')]),'OpenchannelQueueId':Number(_0x80200d[_0x8e56('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x15da60,null))['catch'](handleError(_0x15da60,null));};exports[_0x8e56('0x8d')]=function(_0x643cb5,_0x5bfcd2,_0xf7224){var _0x87491e={};var _0x3041fe={};var _0x30b742;var _0x27a0c3;return db[_0x8e56('0x44')][_0x8e56('0x5a')]({'where':{'id':_0x643cb5[_0x8e56('0x57')]['id']}})['then'](handleEntityNotFound(_0x5bfcd2,null))[_0x8e56('0x2c')](function(_0x5b9142){if(_0x5b9142){_0x30b742=_0x5b9142;_0x3041fe[_0x8e56('0x38')]=_[_0x8e56('0x4b')](db[_0x8e56('0x5f')]['rawAttributes']);_0x3041fe[_0x8e56('0x36')]=_[_0x8e56('0x4b')](_0x643cb5[_0x8e56('0x36')]);_0x3041fe['filters']=_[_0x8e56('0x37')](_0x3041fe['model'],_0x3041fe['query']);_0x87491e['attributes']=_[_0x8e56('0x37')](_0x3041fe[_0x8e56('0x38')],qs[_0x8e56('0x3a')](_0x643cb5[_0x8e56('0x36')][_0x8e56('0x3a')]));_0x87491e[_0x8e56('0x39')]=_0x87491e[_0x8e56('0x39')][_0x8e56('0x4c')]?_0x87491e['attributes']:_0x3041fe[_0x8e56('0x38')];_0x87491e[_0x8e56('0x8e')]=qs[_0x8e56('0x3c')](_0x643cb5[_0x8e56('0x36')][_0x8e56('0x3c')]);_0x87491e[_0x8e56('0x3d')]=qs['filters'](_[_0x8e56('0x3f')](_0x643cb5[_0x8e56('0x36')],_0x3041fe[_0x8e56('0x3e')]));if(_0x643cb5[_0x8e56('0x36')][_0x8e56('0x40')]){_0x87491e[_0x8e56('0x3d')]=_[_0x8e56('0x41')](_0x87491e[_0x8e56('0x3d')],{'$or':_['map'](_0x87491e[_0x8e56('0x39')],function(_0x15e549){var _0x55ad46={};_0x55ad46[_0x15e549]={'$like':'%'+_0x643cb5[_0x8e56('0x36')][_0x8e56('0x40')]+'%'};return _0x55ad46;})});}_0x87491e=_[_0x8e56('0x41')]({},_0x87491e,_0x643cb5[_0x8e56('0x43')]);return _0x30b742['getAgents'](_0x87491e);}})[_0x8e56('0x2c')](function(_0x54b514){if(_0x54b514){_0x27a0c3=_0x54b514[_0x8e56('0x4c')];if(!_0x643cb5[_0x8e56('0x36')][_0x8e56('0x5c')](_0x8e56('0x3b'))){_0x87491e[_0x8e56('0x25')]=qs[_0x8e56('0x25')](_0x643cb5['query']['limit']);_0x87491e[_0x8e56('0x24')]=qs[_0x8e56('0x24')](_0x643cb5[_0x8e56('0x36')][_0x8e56('0x24')]);}return _0x30b742['getAgents'](_0x87491e);}})[_0x8e56('0x2c')](function(_0x10ca83){if(_0x10ca83){return _0x10ca83?{'count':_0x27a0c3,'rows':_0x10ca83}:null;}})[_0x8e56('0x2c')](respondWithResult(_0x5bfcd2,null))[_0x8e56('0x4a')](handleError(_0x5bfcd2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 911504d..51e4774 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 _0x6c8d=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x57e4dd,_0xd6901f){var _0x31ad4a=function(_0x40f8a6){while(--_0x40f8a6){_0x57e4dd['push'](_0x57e4dd['shift']());}};_0x31ad4a(++_0xd6901f);}(_0x6c8d,0xc8));var _0xd6c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6c8d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd6c8('0x0'));var OpenchannelQueue=require(_0xd6c8('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd6c8('0x2'),'afterUpdate':'update','afterDestroy':_0xd6c8('0x3')};function emitEvent(_0x3254ac){return function(_0xf7a198,_0xfedf49,_0x1753ff){OpenchannelQueueEvents['emit'](_0x3254ac+':'+_0xf7a198['id'],_0xf7a198);OpenchannelQueueEvents[_0xd6c8('0x4')](_0x3254ac,_0xf7a198);_0x1753ff(null);};}for(var e in events){if(events[_0xd6c8('0x5')](e)){var event=events[e];OpenchannelQueue[_0xd6c8('0x6')](e,emitEvent(event));}}module[_0xd6c8('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2222=['remove','emit','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x311246,_0x49c786){var _0xe92782=function(_0x1e58e7){while(--_0x1e58e7){_0x311246['push'](_0x311246['shift']());}};_0xe92782(++_0x49c786);}(_0x2222,0x113));var _0x2222=function(_0xddd7e4,_0x5d3706){_0xddd7e4=_0xddd7e4-0x0;var _0x56f1b9=_0x2222[_0xddd7e4];return _0x56f1b9;};'use strict';var EventEmitter=require(_0x2222('0x0'));var OpenchannelQueue=require(_0x2222('0x1'))['db'][_0x2222('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2222('0x3')](0x0);var events={'afterCreate':_0x2222('0x4'),'afterUpdate':'update','afterDestroy':_0x2222('0x5')};function emitEvent(_0x44b57b){return function(_0x4c1907,_0x4da4a0,_0x126b7a){OpenchannelQueueEvents['emit'](_0x44b57b+':'+_0x4c1907['id'],_0x4c1907);OpenchannelQueueEvents[_0x2222('0x6')](_0x44b57b,_0x4c1907);_0x126b7a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x2222('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 14420d2..838588e 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 _0x67e4=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4cf616,_0x6a30ad){var _0x1737c1=function(_0x5e3855){while(--_0x5e3855){_0x4cf616['push'](_0x4cf616['shift']());}};_0x1737c1(++_0x6a30ad);}(_0x67e4,0xa2));var _0x467e=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x67e4[_0x35fabd];return _0x61a8ee;};'use strict';var _=require(_0x467e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x467e('0x1'));var moment=require(_0x467e('0x2'));var BPromise=require(_0x467e('0x3'));var rp=require(_0x467e('0x4'));var fs=require('fs');var path=require(_0x467e('0x5'));var rimraf=require(_0x467e('0x6'));var config=require(_0x467e('0x7'));var attributes=require(_0x467e('0x8'));module[_0x467e('0x9')]=function(_0x47ab15,_0x3965af){return _0x47ab15[_0x467e('0xa')](_0x467e('0xb'),attributes,{'tableName':_0x467e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf484=['openchannel_queues','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xf484,0xa9));var _0x4f48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf484[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4f48('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f48('0x1'));var moment=require(_0x4f48('0x2'));var BPromise=require('bluebird');var rp=require(_0x4f48('0x3'));var fs=require('fs');var path=require(_0x4f48('0x4'));var rimraf=require(_0x4f48('0x5'));var config=require(_0x4f48('0x6'));var attributes=require(_0x4f48('0x7'));module[_0x4f48('0x8')]=function(_0x28365b,_0x55ec47){return _0x28365b[_0x4f48('0x9')](_0x4f48('0xa'),attributes,{'tableName':_0x4f48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 28207d6..b1b4e00 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 _0x53c4=['message','result','catch','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0x53c4,0x146));var _0x453c=function(_0x5ecb5b,_0x42f9ef){_0x5ecb5b=_0x5ecb5b-0x0;var _0x2d00ed=_0x53c4[_0x5ecb5b];return _0x2d00ed;};'use strict';var _=require('lodash');var util=require(_0x453c('0x0'));var moment=require(_0x453c('0x1'));var BPromise=require(_0x453c('0x2'));var rs=require(_0x453c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x453c('0x4'));var logger=require(_0x453c('0x5'))('rpc');var config=require(_0x453c('0x6'));var jayson=require(_0x453c('0x7'));var client=jayson['client'][_0x453c('0x8')]({'port':0x232a});config[_0x453c('0x9')]=_[_0x453c('0xa')](config['redis'],{'host':_0x453c('0xb'),'port':0x18eb});var socket=require(_0x453c('0xc'))(new Redis(config[_0x453c('0x9')]));require(_0x453c('0xd'))[_0x453c('0xe')](socket);function respondWithRpcPromise(_0x15e573,_0x5691b9,_0x533f6c){return new BPromise(function(_0x581f16,_0x446050){return client[_0x453c('0xf')](_0x15e573,_0x533f6c)[_0x453c('0x10')](function(_0x466ecc){logger[_0x453c('0x11')](_0x453c('0x12'),_0x5691b9,_0x453c('0x13'));logger[_0x453c('0x14')](_0x453c('0x15'),_0x5691b9,_0x453c('0x13'),JSON[_0x453c('0x16')](_0x466ecc));if(_0x466ecc[_0x453c('0x17')]){if(_0x466ecc['error'][_0x453c('0x18')]===0x1f4){logger[_0x453c('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x5691b9,_0x466ecc[_0x453c('0x17')][_0x453c('0x19')]);return _0x446050(_0x466ecc[_0x453c('0x17')][_0x453c('0x19')]);}logger['error'](_0x453c('0x12'),_0x5691b9,_0x466ecc[_0x453c('0x17')][_0x453c('0x19')]);return _0x581f16(_0x466ecc['error'][_0x453c('0x19')]);}else{logger[_0x453c('0x11')](_0x453c('0x12'),_0x5691b9,_0x453c('0x13'));_0x581f16(_0x466ecc[_0x453c('0x1a')][_0x453c('0x19')]);}})[_0x453c('0x1b')](function(_0x4511f1){logger[_0x453c('0x17')](_0x453c('0x12'),_0x5691b9,_0x4511f1);_0x446050(_0x4511f1);});});}exports['GetOpenchannelQueue']=function(_0x4b90ac){var _0x3a8028=this;return new Promise(function(_0xbeebb2,_0x219c1b){return db['OpenchannelQueue'][_0x453c('0x1c')]({'raw':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac['options'][_0x453c('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')][_0x453c('0x1f')]||null:null,'attributes':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')][_0x453c('0x20')]||null:null,'limit':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')]['limit']||null:null,'include':_0x4b90ac[_0x453c('0x1d')]?_0x4b90ac[_0x453c('0x1d')]['include']?_['map'](_0x4b90ac['options'][_0x453c('0x21')],function(_0x1928ca){return{'model':db[_0x1928ca[_0x453c('0x22')]],'as':_0x1928ca['as'],'attributes':_0x1928ca[_0x453c('0x20')],'include':_0x1928ca[_0x453c('0x21')]?_[_0x453c('0x23')](_0x1928ca[_0x453c('0x21')],function(_0xc6720d){return{'model':db[_0xc6720d[_0x453c('0x22')]],'as':_0xc6720d['as'],'attributes':_0xc6720d[_0x453c('0x20')],'include':_0xc6720d[_0x453c('0x21')]?_[_0x453c('0x23')](_0xc6720d[_0x453c('0x21')],function(_0x36dcc9){return{'model':db[_0x36dcc9[_0x453c('0x22')]],'as':_0x36dcc9['as'],'attributes':_0x36dcc9[_0x453c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x453c('0x10')](function(_0x44e6ee){logger[_0x453c('0x11')](_0x453c('0x24'),_0x4b90ac);logger[_0x453c('0x14')](_0x453c('0x24'),_0x4b90ac,JSON[_0x453c('0x16')](_0x44e6ee));_0xbeebb2(_0x44e6ee);})[_0x453c('0x1b')](function(_0x5ab9c6){logger[_0x453c('0x17')](_0x453c('0x24'),_0x5ab9c6[_0x453c('0x19')],_0x4b90ac);_0x219c1b(_0x3a8028[_0x453c('0x17')](0x1f4,_0x5ab9c6[_0x453c('0x19')]));});});};exports[_0x453c('0x25')]=function(_0x2e02f8){var _0x16184c=this;return new Promise(function(_0x3faa40,_0x480dd6){return db['OpenchannelQueue'][_0x453c('0x26')]({'raw':_0x2e02f8['options']?_0x2e02f8[_0x453c('0x1d')][_0x453c('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e02f8['options']?_0x2e02f8['options'][_0x453c('0x1f')]||null:null,'attributes':_0x2e02f8['options']?_0x2e02f8['options'][_0x453c('0x20')]||null:null,'include':_0x2e02f8[_0x453c('0x1d')]?_0x2e02f8[_0x453c('0x1d')]['include']?_[_0x453c('0x23')](_0x2e02f8[_0x453c('0x1d')][_0x453c('0x21')],function(_0x53a2f2){return{'model':db[_0x53a2f2[_0x453c('0x22')]],'as':_0x53a2f2['as'],'attributes':_0x53a2f2[_0x453c('0x20')],'include':_0x53a2f2[_0x453c('0x21')]?_[_0x453c('0x23')](_0x53a2f2[_0x453c('0x21')],function(_0xc22b15){return{'model':db[_0xc22b15[_0x453c('0x22')]],'as':_0xc22b15['as'],'attributes':_0xc22b15[_0x453c('0x20')],'include':_0xc22b15[_0x453c('0x21')]?_[_0x453c('0x23')](_0xc22b15[_0x453c('0x21')],function(_0x399ec8){return{'model':db[_0x399ec8[_0x453c('0x22')]],'as':_0x399ec8['as'],'attributes':_0x399ec8[_0x453c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x453c('0x10')](function(_0x2f419d){logger[_0x453c('0x11')](_0x453c('0x25'),_0x2e02f8);logger['debug'](_0x453c('0x25'),_0x2e02f8,JSON[_0x453c('0x16')](_0x2f419d));_0x3faa40(_0x2f419d);})[_0x453c('0x1b')](function(_0x3fd73c){logger[_0x453c('0x17')](_0x453c('0x25'),_0x3fd73c['message'],_0x2e02f8);_0x480dd6(_0x16184c[_0x453c('0x17')](0x1f4,_0x3fd73c[_0x453c('0x19')]));});});}; \ No newline at end of file +var _0x34e1=['GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','map','include','model','ShowOpenchannelQueue','find','then','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x34e1,0x1c5));var _0x134e=function(_0x3eac77,_0x3153c1){_0x3eac77=_0x3eac77-0x0;var _0x180cf2=_0x34e1[_0x3eac77];return _0x180cf2;};'use strict';var _=require(_0x134e('0x0'));var util=require(_0x134e('0x1'));var moment=require(_0x134e('0x2'));var BPromise=require(_0x134e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x134e('0x4'))['db'];var utils=require(_0x134e('0x5'));var logger=require(_0x134e('0x6'))(_0x134e('0x7'));var config=require(_0x134e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x134e('0x9')][_0x134e('0xa')]({'port':0x232a});config[_0x134e('0xb')]=_[_0x134e('0xc')](config['redis'],{'host':_0x134e('0xd'),'port':0x18eb});var socket=require(_0x134e('0xe'))(new Redis(config[_0x134e('0xb')]));require(_0x134e('0xf'))[_0x134e('0x10')](socket);function respondWithRpcPromise(_0x16a1f3,_0x2a1e95,_0x55d9fd){return new BPromise(function(_0x43f21d,_0x2e6e44){return client[_0x134e('0x11')](_0x16a1f3,_0x55d9fd)['then'](function(_0x1eb15f){logger[_0x134e('0x12')](_0x134e('0x13'),_0x2a1e95,_0x134e('0x14'));logger[_0x134e('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2a1e95,'request\x20sent',JSON[_0x134e('0x16')](_0x1eb15f));if(_0x1eb15f[_0x134e('0x17')]){if(_0x1eb15f[_0x134e('0x17')][_0x134e('0x18')]===0x1f4){logger['error'](_0x134e('0x13'),_0x2a1e95,_0x1eb15f[_0x134e('0x17')]['message']);return _0x2e6e44(_0x1eb15f[_0x134e('0x17')][_0x134e('0x19')]);}logger[_0x134e('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x2a1e95,_0x1eb15f[_0x134e('0x17')][_0x134e('0x19')]);return _0x43f21d(_0x1eb15f[_0x134e('0x17')][_0x134e('0x19')]);}else{logger[_0x134e('0x12')](_0x134e('0x13'),_0x2a1e95,_0x134e('0x14'));_0x43f21d(_0x1eb15f['result'][_0x134e('0x19')]);}})[_0x134e('0x1a')](function(_0x61c4b1){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2a1e95,_0x61c4b1);_0x2e6e44(_0x61c4b1);});});}exports[_0x134e('0x1b')]=function(_0x4c76f6){var _0xaf09ed=this;return new Promise(function(_0x37f942,_0x470ef1){return db[_0x134e('0x1c')][_0x134e('0x1d')]({'raw':_0x4c76f6[_0x134e('0x1e')]?_0x4c76f6['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c76f6[_0x134e('0x1e')]?_0x4c76f6[_0x134e('0x1e')][_0x134e('0x1f')]||null:null,'attributes':_0x4c76f6['options']?_0x4c76f6[_0x134e('0x1e')][_0x134e('0x20')]||null:null,'limit':_0x4c76f6[_0x134e('0x1e')]?_0x4c76f6[_0x134e('0x1e')][_0x134e('0x21')]||null:null,'include':_0x4c76f6['options']?_0x4c76f6[_0x134e('0x1e')]['include']?_[_0x134e('0x22')](_0x4c76f6[_0x134e('0x1e')][_0x134e('0x23')],function(_0x4b5007){return{'model':db[_0x4b5007['model']],'as':_0x4b5007['as'],'attributes':_0x4b5007[_0x134e('0x20')],'include':_0x4b5007[_0x134e('0x23')]?_['map'](_0x4b5007['include'],function(_0x100fb2){return{'model':db[_0x100fb2['model']],'as':_0x100fb2['as'],'attributes':_0x100fb2['attributes'],'include':_0x100fb2['include']?_[_0x134e('0x22')](_0x100fb2[_0x134e('0x23')],function(_0x2e4c16){return{'model':db[_0x2e4c16[_0x134e('0x24')]],'as':_0x2e4c16['as'],'attributes':_0x2e4c16[_0x134e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8b26f){logger[_0x134e('0x12')](_0x134e('0x1b'),_0x4c76f6);logger[_0x134e('0x15')]('GetOpenchannelQueue',_0x4c76f6,JSON[_0x134e('0x16')](_0x8b26f));_0x37f942(_0x8b26f);})[_0x134e('0x1a')](function(_0x1364a0){logger['error'](_0x134e('0x1b'),_0x1364a0[_0x134e('0x19')],_0x4c76f6);_0x470ef1(_0xaf09ed[_0x134e('0x17')](0x1f4,_0x1364a0[_0x134e('0x19')]));});});};exports[_0x134e('0x25')]=function(_0x2f75c4){var _0x2ccbaa=this;return new Promise(function(_0x525f5c,_0x5b591b){return db[_0x134e('0x1c')][_0x134e('0x26')]({'raw':_0x2f75c4[_0x134e('0x1e')]?_0x2f75c4[_0x134e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2f75c4[_0x134e('0x1e')]?_0x2f75c4[_0x134e('0x1e')]['where']||null:null,'attributes':_0x2f75c4[_0x134e('0x1e')]?_0x2f75c4['options'][_0x134e('0x20')]||null:null,'include':_0x2f75c4[_0x134e('0x1e')]?_0x2f75c4[_0x134e('0x1e')][_0x134e('0x23')]?_[_0x134e('0x22')](_0x2f75c4[_0x134e('0x1e')]['include'],function(_0x46068e){return{'model':db[_0x46068e[_0x134e('0x24')]],'as':_0x46068e['as'],'attributes':_0x46068e[_0x134e('0x20')],'include':_0x46068e[_0x134e('0x23')]?_[_0x134e('0x22')](_0x46068e[_0x134e('0x23')],function(_0x8bf28d){return{'model':db[_0x8bf28d[_0x134e('0x24')]],'as':_0x8bf28d['as'],'attributes':_0x8bf28d[_0x134e('0x20')],'include':_0x8bf28d[_0x134e('0x23')]?_[_0x134e('0x22')](_0x8bf28d[_0x134e('0x23')],function(_0x459819){return{'model':db[_0x459819[_0x134e('0x24')]],'as':_0x459819['as'],'attributes':_0x459819[_0x134e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x134e('0x27')](function(_0x4afa1f){logger[_0x134e('0x12')](_0x134e('0x25'),_0x2f75c4);logger[_0x134e('0x15')](_0x134e('0x25'),_0x2f75c4,JSON[_0x134e('0x16')](_0x4afa1f));_0x525f5c(_0x4afa1f);})[_0x134e('0x1a')](function(_0x115405){logger[_0x134e('0x17')](_0x134e('0x25'),_0x115405[_0x134e('0x19')],_0x2f75c4);_0x5b591b(_0x2ccbaa['error'](0x1f4,_0x115405[_0x134e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 95ce8d8..5e06b23 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 _0x5e10=['save','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events'];(function(_0x52c7f4,_0x2b3ad5){var _0x513d5b=function(_0x39bb23){while(--_0x39bb23){_0x52c7f4['push'](_0x52c7f4['shift']());}};_0x513d5b(++_0x2b3ad5);}(_0x5e10,0x89));var _0x05e1=function(_0x5a5276,_0x262d69){_0x5a5276=_0x5a5276-0x0;var _0x3e8ee2=_0x5e10[_0x5a5276];return _0x3e8ee2;};'use strict';var OpenchannelQueueEvents=require(_0x05e1('0x0'));var events=[_0x05e1('0x1'),'remove','update'];function createListener(_0x48de84,_0x21bed0){return function(_0x123f8d){_0x21bed0[_0x05e1('0x2')](_0x48de84,_0x123f8d);};}function removeListener(_0x3d0da5,_0x6767ed){return function(){OpenchannelQueueEvents[_0x05e1('0x3')](_0x3d0da5,_0x6767ed);};}exports[_0x05e1('0x4')]=function(_0x22dcfc){for(var _0x5bfcc8=0x0,_0x2f3dc8=events['length'];_0x5bfcc8<_0x2f3dc8;_0x5bfcc8++){var _0x5609eb=events[_0x5bfcc8];var _0x18fc3e=createListener(_0x05e1('0x5')+_0x5609eb,_0x22dcfc);OpenchannelQueueEvents['on'](_0x5609eb,_0x18fc3e);}}; \ No newline at end of file +var _0x5e64=['update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x3d1867,_0x42339a){var _0xc07c65=function(_0x1779b5){while(--_0x1779b5){_0x3d1867['push'](_0x3d1867['shift']());}};_0xc07c65(++_0x42339a);}(_0x5e64,0x15c));var _0x45e6=function(_0x22de63,_0x1c83ae){_0x22de63=_0x22de63-0x0;var _0x466811=_0x5e64[_0x22de63];return _0x466811;};'use strict';var OpenchannelQueueEvents=require(_0x45e6('0x0'));var events=[_0x45e6('0x1'),'remove',_0x45e6('0x2')];function createListener(_0xf3bd2d,_0x42dde5){return function(_0x402ef5){_0x42dde5[_0x45e6('0x3')](_0xf3bd2d,_0x402ef5);};}function removeListener(_0x587538,_0x437922){return function(){OpenchannelQueueEvents[_0x45e6('0x4')](_0x587538,_0x437922);};}exports[_0x45e6('0x5')]=function(_0x21dd07){for(var _0x5c4606=0x0,_0x1abd54=events['length'];_0x5c4606<_0x1abd54;_0x5c4606++){var _0x4ef5bf=events[_0x5c4606];var _0x25aef2=createListener(_0x45e6('0x6')+_0x4ef5bf,_0x21dd07);OpenchannelQueueEvents['on'](_0x4ef5bf,_0x25aef2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 7037770..0c4b6b9 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 _0xa034=['show','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x7bcf27,_0x57f183){var _0x15d436=function(_0x3f767c){while(--_0x3f767c){_0x7bcf27['push'](_0x7bcf27['shift']());}};_0x15d436(++_0x57f183);}(_0xa034,0x191));var _0x4a03=function(_0x1ce8b9,_0x39078b){_0x1ce8b9=_0x1ce8b9-0x0;var _0x105887=_0xa034[_0x1ce8b9];return _0x105887;};'use strict';var multer=require(_0x4a03('0x0'));var util=require('util');var path=require(_0x4a03('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a03('0x2'));var router=express[_0x4a03('0x3')]();var fs_extra=require(_0x4a03('0x4'));var auth=require(_0x4a03('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4a03('0x6'));var controller=require(_0x4a03('0x7'));router[_0x4a03('0x8')]('/',auth[_0x4a03('0x9')](),controller['index']);router[_0x4a03('0x8')](_0x4a03('0xa'),auth[_0x4a03('0x9')](),controller[_0x4a03('0xb')]);router[_0x4a03('0x8')](_0x4a03('0xc'),auth[_0x4a03('0x9')](),controller[_0x4a03('0xd')]);router['post']('/',auth[_0x4a03('0x9')](),controller[_0x4a03('0xe')]);router[_0x4a03('0xf')](_0x4a03('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4a03('0x10')](_0x4a03('0xc'),auth[_0x4a03('0x9')](),controller[_0x4a03('0x11')]);module['exports']=router; \ No newline at end of file +var _0x76f4=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5d8502,_0x3a7146){var _0x58804c=function(_0x4cbd38){while(--_0x4cbd38){_0x5d8502['push'](_0x5d8502['shift']());}};_0x58804c(++_0x3a7146);}(_0x76f4,0xb5));var _0x476f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x76f4[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x476f('0x0'));var util=require('util');var path=require(_0x476f('0x1'));var timeout=require(_0x476f('0x2'));var express=require(_0x476f('0x3'));var router=express[_0x476f('0x4')]();var fs_extra=require(_0x476f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x476f('0x6'));var config=require(_0x476f('0x7'));var controller=require(_0x476f('0x8'));router[_0x476f('0x9')]('/',auth[_0x476f('0xa')](),controller[_0x476f('0xb')]);router[_0x476f('0x9')](_0x476f('0xc'),auth[_0x476f('0xa')](),controller[_0x476f('0xd')]);router['get'](_0x476f('0xe'),auth['isAuthenticated'](),controller[_0x476f('0xf')]);router[_0x476f('0x10')]('/',auth[_0x476f('0xa')](),controller[_0x476f('0x11')]);router[_0x476f('0x12')]('/:id',auth[_0x476f('0xa')](),controller[_0x476f('0x13')]);router[_0x476f('0x14')](_0x476f('0xe'),auth[_0x476f('0xa')](),controller[_0x476f('0x15')]);module[_0x476f('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b87991e..729e53d 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 _0x3691=['sequelize','exports','STRING','DATE'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x3691,0x98));var _0x1369=function(_0x5682f8,_0x3d9c4e){_0x5682f8=_0x5682f8-0x0;var _0x1dfa41=_0x3691[_0x5682f8];return _0x1dfa41;};'use strict';var moment=require('moment');var Sequelize=require(_0x1369('0x0'));module[_0x1369('0x1')]={'uniqueid':{'type':Sequelize[_0x1369('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1369('0x2')]},'joinAt':{'type':Sequelize[_0x1369('0x3')]},'leaveAt':{'type':Sequelize[_0x1369('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1369('0x3')]},'reason':{'type':Sequelize[_0x1369('0x2')]}}; \ No newline at end of file +var _0xef2e=['DATE','sequelize','exports','STRING'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xef2e,0x141));var _0xeef2=function(_0x1e3923,_0x477ce9){_0x1e3923=_0x1e3923-0x0;var _0x36cd0f=_0xef2e[_0x1e3923];return _0x36cd0f;};'use strict';var moment=require('moment');var Sequelize=require(_0xeef2('0x0'));module[_0xeef2('0x1')]={'uniqueid':{'type':Sequelize[_0xeef2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xeef2('0x2')]},'joinAt':{'type':Sequelize[_0xeef2('0x3')]},'leaveAt':{'type':Sequelize[_0xeef2('0x3')]},'acceptAt':{'type':Sequelize[_0xeef2('0x3')]},'exitAt':{'type':Sequelize[_0xeef2('0x3')]},'reason':{'type':Sequelize[_0xeef2('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index cb405e0..8544913 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 _0x633c=['save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply'];(function(_0x2b324b,_0xdb76b2){var _0x1c05a4=function(_0x195be3){while(--_0x195be3){_0x2b324b['push'](_0x2b324b['shift']());}};_0x1c05a4(++_0xdb76b2);}(_0x633c,0xb9));var _0xc633=function(_0x54da98,_0x322aeb){_0x54da98=_0x54da98-0x0;var _0x1daa90=_0x633c[_0x54da98];return _0x1daa90;};'use strict';var emlformat=require(_0xc633('0x0'));var rimraf=require(_0xc633('0x1'));var zipdir=require(_0xc633('0x2'));var jsonpatch=require(_0xc633('0x3'));var rp=require(_0xc633('0x4'));var moment=require(_0xc633('0x5'));var BPromise=require(_0xc633('0x6'));var Mustache=require(_0xc633('0x7'));var util=require(_0xc633('0x8'));var path=require(_0xc633('0x9'));var sox=require('sox');var csv=require(_0xc633('0xa'));var ejs=require(_0xc633('0xb'));var fs=require('fs');var fs_extra=require(_0xc633('0xc'));var _=require('lodash');var squel=require(_0xc633('0xd'));var crypto=require(_0xc633('0xe'));var jsforce=require(_0xc633('0xf'));var deskjs=require(_0xc633('0x10'));var toCsv=require(_0xc633('0xa'));var querystring=require('querystring');var Papa=require(_0xc633('0x11'));var Redis=require(_0xc633('0x12'));var authService=require(_0xc633('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc633('0x15'));var utils=require(_0xc633('0x16'));var config=require(_0xc633('0x17'));var licenseUtil=require(_0xc633('0x18'));var db=require(_0xc633('0x19'))['db'];function respondWithStatusCode(_0x28f27c,_0x444f1a){_0x444f1a=_0x444f1a||0xcc;return function(_0x80d93f){if(_0x80d93f){return _0x28f27c[_0xc633('0x1a')](_0x444f1a);}return _0x28f27c['status'](_0x444f1a)[_0xc633('0x1b')]();};}function respondWithResult(_0x176ec5,_0x45f250){_0x45f250=_0x45f250||0xc8;return function(_0x325339){if(_0x325339){return _0x176ec5[_0xc633('0x1c')](_0x45f250)[_0xc633('0x1d')](_0x325339);}};}function respondWithFilteredResult(_0x4f732f,_0x21f600){return function(_0x2b4882){if(_0x2b4882){var _0x14c9a1=typeof _0x21f600['offset']==='undefined'&&typeof _0x21f600[_0xc633('0x1e')]===_0xc633('0x1f');var _0x4881ee=_0x2b4882[_0xc633('0x20')];var _0x55df98=_0x14c9a1?0x0:_0x21f600[_0xc633('0x21')];var _0x229697=_0x14c9a1?_0x2b4882[_0xc633('0x20')]:_0x21f600[_0xc633('0x21')]+_0x21f600[_0xc633('0x1e')];var _0x3bfc22;if(_0x229697>=_0x4881ee){_0x229697=_0x4881ee;_0x3bfc22=0xc8;}else{_0x3bfc22=0xce;}_0x4f732f['status'](_0x3bfc22);return _0x4f732f[_0xc633('0x22')](_0xc633('0x23'),_0x55df98+'-'+_0x229697+'/'+_0x4881ee)[_0xc633('0x1d')](_0x2b4882);}return null;};}function patchUpdates(_0x44c4d6){return function(_0x1fb029){try{jsonpatch[_0xc633('0x24')](_0x1fb029,_0x44c4d6,!![]);}catch(_0x3405d3){return BPromise['reject'](_0x3405d3);}return _0x1fb029[_0xc633('0x25')]();};}function saveUpdates(_0x1ca83d,_0x26b4bd){return function(_0x12eb68){if(_0x12eb68){return _0x12eb68['update'](_0x1ca83d)[_0xc633('0x26')](function(_0x65a4c1){return _0x65a4c1;});}return null;};}function removeEntity(_0x4a7874,_0x53ab88){return function(_0x1899ba){if(_0x1899ba){return _0x1899ba['destroy']()['then'](function(){_0x4a7874[_0xc633('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcef2eb,_0x1305ef){return function(_0x16226b){if(!_0x16226b){_0xcef2eb['sendStatus'](0x194);}return _0x16226b;};}function handleError(_0x448f63,_0x3d9e80){_0x3d9e80=_0x3d9e80||0x1f4;return function(_0x48610e){logger[_0xc633('0x27')](_0x48610e[_0xc633('0x28')]);if(_0x48610e['name']){delete _0x48610e[_0xc633('0x29')];}_0x448f63['status'](_0x3d9e80)[_0xc633('0x2a')](_0x48610e);};}exports[_0xc633('0x2b')]=function(_0xd5f7fd,_0x48e7e1){var _0x151998={},_0xc2dbde={},_0x50a121={'count':0x0,'rows':[]};var _0x25fbaf=_[_0xc633('0x2c')](db[_0xc633('0x2d')][_0xc633('0x2e')],function(_0x67a2c2){return{'name':_0x67a2c2['fieldName'],'type':_0x67a2c2['type']['key']};});_0xc2dbde[_0xc633('0x2f')]=_[_0xc633('0x2c')](_0x25fbaf,_0xc633('0x29'));_0xc2dbde['query']=_[_0xc633('0x30')](_0xd5f7fd[_0xc633('0x31')]);_0xc2dbde[_0xc633('0x32')]=_['intersection'](_0xc2dbde['model'],_0xc2dbde[_0xc633('0x31')]);_0x151998[_0xc633('0x33')]=_[_0xc633('0x34')](_0xc2dbde['model'],qs[_0xc633('0x35')](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x35')]));_0x151998['attributes']=_0x151998[_0xc633('0x33')]['length']?_0x151998[_0xc633('0x33')]:_0xc2dbde[_0xc633('0x2f')];if(!_0xd5f7fd[_0xc633('0x31')]['hasOwnProperty']('nolimit')){_0x151998[_0xc633('0x1e')]=qs['limit'](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x1e')]);_0x151998[_0xc633('0x21')]=qs[_0xc633('0x21')](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x21')]);}_0x151998['order']=qs[_0xc633('0x36')](_0xd5f7fd[_0xc633('0x31')][_0xc633('0x36')]);_0x151998[_0xc633('0x37')]=qs[_0xc633('0x32')](_[_0xc633('0x38')](_0xd5f7fd[_0xc633('0x31')],_0xc2dbde[_0xc633('0x32')]),_0x25fbaf);if(_0xd5f7fd[_0xc633('0x31')][_0xc633('0x39')]){_0x151998['where']=_[_0xc633('0x3a')](_0x151998[_0xc633('0x37')],{'$or':_[_0xc633('0x2c')](_0x25fbaf,function(_0x57431e){if(_0x57431e[_0xc633('0x3b')]!=='VIRTUAL'){var _0x5770bd={};_0x5770bd[_0x57431e['name']]={'$like':'%'+_0xd5f7fd['query'][_0xc633('0x39')]+'%'};return _0x5770bd;}})});}_0x151998=_['merge']({},_0x151998,_0xd5f7fd['options']);var _0xc6e46a={'where':_0x151998['where']};return db['OpenchannelQueueReport'][_0xc633('0x20')](_0xc6e46a)[_0xc633('0x26')](function(_0xbe8baf){_0x50a121[_0xc633('0x20')]=_0xbe8baf;if(_0xd5f7fd[_0xc633('0x31')][_0xc633('0x3c')]){_0x151998[_0xc633('0x3d')]=[{'all':!![]}];}return db[_0xc633('0x2d')][_0xc633('0x3e')](_0x151998);})[_0xc633('0x26')](function(_0x40305f){_0x50a121[_0xc633('0x3f')]=_0x40305f;return _0x50a121;})[_0xc633('0x26')](respondWithFilteredResult(_0x48e7e1,_0x151998))[_0xc633('0x40')](handleError(_0x48e7e1,null));};exports[_0xc633('0x41')]=function(_0x77141f,_0xaa5d5e){var _0x2cb260={'raw':!![],'where':{'id':_0x77141f[_0xc633('0x42')]['id']}},_0x5b3319={};_0x5b3319[_0xc633('0x2f')]=_['keys'](db[_0xc633('0x2d')][_0xc633('0x2e')]);_0x5b3319['query']=_[_0xc633('0x30')](_0x77141f['query']);_0x5b3319['filters']=_[_0xc633('0x34')](_0x5b3319[_0xc633('0x2f')],_0x5b3319[_0xc633('0x31')]);_0x2cb260[_0xc633('0x33')]=_[_0xc633('0x34')](_0x5b3319[_0xc633('0x2f')],qs['fields'](_0x77141f[_0xc633('0x31')][_0xc633('0x35')]));_0x2cb260[_0xc633('0x33')]=_0x2cb260[_0xc633('0x33')][_0xc633('0x43')]?_0x2cb260[_0xc633('0x33')]:_0x5b3319[_0xc633('0x2f')];if(_0x77141f['query'][_0xc633('0x3c')]){_0x2cb260[_0xc633('0x3d')]=[{'all':!![]}];}_0x2cb260=_[_0xc633('0x3a')]({},_0x2cb260,_0x77141f[_0xc633('0x44')]);return db[_0xc633('0x2d')][_0xc633('0x45')](_0x2cb260)[_0xc633('0x26')](handleEntityNotFound(_0xaa5d5e,null))[_0xc633('0x26')](respondWithResult(_0xaa5d5e,null))['catch'](handleError(_0xaa5d5e,null));};exports[_0xc633('0x46')]=function(_0x5330e2,_0x4f3d35){return db[_0xc633('0x2d')][_0xc633('0x46')](_0x5330e2['body'],{})['then'](respondWithResult(_0x4f3d35,0xc9))['catch'](handleError(_0x4f3d35,null));};exports['update']=function(_0x5e87b3,_0x565dd4){if(_0x5e87b3[_0xc633('0x47')]['id']){delete _0x5e87b3[_0xc633('0x47')]['id'];}return db[_0xc633('0x2d')][_0xc633('0x45')]({'where':{'id':_0x5e87b3[_0xc633('0x42')]['id']}})['then'](handleEntityNotFound(_0x565dd4,null))[_0xc633('0x26')](saveUpdates(_0x5e87b3[_0xc633('0x47')],null))[_0xc633('0x26')](respondWithResult(_0x565dd4,null))[_0xc633('0x40')](handleError(_0x565dd4,null));};exports[_0xc633('0x48')]=function(_0x17bf73,_0x335d23){return db[_0xc633('0x2d')][_0xc633('0x45')]({'where':{'id':_0x17bf73[_0xc633('0x42')]['id']}})[_0xc633('0x26')](handleEntityNotFound(_0x335d23,null))[_0xc633('0x26')](removeEntity(_0x335d23,null))['catch'](handleError(_0x335d23,null));};exports[_0xc633('0x49')]=function(_0x1d3402,_0xa33e35){return db[_0xc633('0x2d')][_0xc633('0x49')]()[_0xc633('0x26')](respondWithResult(_0xa33e35,null))['catch'](handleError(_0xa33e35,null));}; \ No newline at end of file +var _0xecbb=['sendStatus','error','name','send','index','map','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','where','merge','type','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','include','catch','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x5a5dd3,_0x440504){var _0x22f0ce=function(_0x459960){while(--_0x459960){_0x5a5dd3['push'](_0x5a5dd3['shift']());}};_0x22f0ce(++_0x440504);}(_0xecbb,0x1e9));var _0xbecb=function(_0xc5b0a0,_0x1eb174){_0xc5b0a0=_0xc5b0a0-0x0;var _0x39148f=_0xecbb[_0xc5b0a0];return _0x39148f;};'use strict';var emlformat=require(_0xbecb('0x0'));var rimraf=require(_0xbecb('0x1'));var zipdir=require(_0xbecb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbecb('0x3'));var moment=require(_0xbecb('0x4'));var BPromise=require(_0xbecb('0x5'));var Mustache=require(_0xbecb('0x6'));var util=require(_0xbecb('0x7'));var path=require(_0xbecb('0x8'));var sox=require(_0xbecb('0x9'));var csv=require(_0xbecb('0xa'));var ejs=require(_0xbecb('0xb'));var fs=require('fs');var fs_extra=require(_0xbecb('0xc'));var _=require(_0xbecb('0xd'));var squel=require(_0xbecb('0xe'));var crypto=require(_0xbecb('0xf'));var jsforce=require(_0xbecb('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbecb('0xa'));var querystring=require(_0xbecb('0x11'));var Papa=require(_0xbecb('0x12'));var Redis=require(_0xbecb('0x13'));var authService=require(_0xbecb('0x14'));var qs=require(_0xbecb('0x15'));var as=require(_0xbecb('0x16'));var hardwareService=require(_0xbecb('0x17'));var logger=require(_0xbecb('0x18'))(_0xbecb('0x19'));var utils=require(_0xbecb('0x1a'));var config=require(_0xbecb('0x1b'));var licenseUtil=require(_0xbecb('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fd1fa,_0x448380){_0x448380=_0x448380||0xcc;return function(_0x576110){if(_0x576110){return _0x3fd1fa['sendStatus'](_0x448380);}return _0x3fd1fa['status'](_0x448380)[_0xbecb('0x1d')]();};}function respondWithResult(_0x5072d7,_0x3b4911){_0x3b4911=_0x3b4911||0xc8;return function(_0x2c545f){if(_0x2c545f){return _0x5072d7['status'](_0x3b4911)[_0xbecb('0x1e')](_0x2c545f);}};}function respondWithFilteredResult(_0x52930e,_0x41182c){return function(_0x153cce){if(_0x153cce){var _0x1d6e7c=typeof _0x41182c['offset']==='undefined'&&typeof _0x41182c['limit']===_0xbecb('0x1f');var _0x531449=_0x153cce[_0xbecb('0x20')];var _0x7b41cd=_0x1d6e7c?0x0:_0x41182c[_0xbecb('0x21')];var _0x52dfb1=_0x1d6e7c?_0x153cce[_0xbecb('0x20')]:_0x41182c['offset']+_0x41182c[_0xbecb('0x22')];var _0x313e19;if(_0x52dfb1>=_0x531449){_0x52dfb1=_0x531449;_0x313e19=0xc8;}else{_0x313e19=0xce;}_0x52930e[_0xbecb('0x23')](_0x313e19);return _0x52930e[_0xbecb('0x24')](_0xbecb('0x25'),_0x7b41cd+'-'+_0x52dfb1+'/'+_0x531449)[_0xbecb('0x1e')](_0x153cce);}return null;};}function patchUpdates(_0x2ecec6){return function(_0x1fc17f){try{jsonpatch[_0xbecb('0x26')](_0x1fc17f,_0x2ecec6,!![]);}catch(_0xcdaef1){return BPromise[_0xbecb('0x27')](_0xcdaef1);}return _0x1fc17f['save']();};}function saveUpdates(_0x356e16,_0x5ef48b){return function(_0x1b9c48){if(_0x1b9c48){return _0x1b9c48[_0xbecb('0x28')](_0x356e16)[_0xbecb('0x29')](function(_0x1e7771){return _0x1e7771;});}return null;};}function removeEntity(_0x136ddb,_0x2fc3b6){return function(_0xf55100){if(_0xf55100){return _0xf55100[_0xbecb('0x2a')]()[_0xbecb('0x29')](function(){_0x136ddb[_0xbecb('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b43ff,_0x43f2fa){return function(_0x5a2853){if(!_0x5a2853){_0x2b43ff[_0xbecb('0x2b')](0x194);}return _0x5a2853;};}function handleError(_0x2c5893,_0x1172dd){_0x1172dd=_0x1172dd||0x1f4;return function(_0x470fb1){logger[_0xbecb('0x2c')](_0x470fb1['stack']);if(_0x470fb1[_0xbecb('0x2d')]){delete _0x470fb1[_0xbecb('0x2d')];}_0x2c5893[_0xbecb('0x23')](_0x1172dd)[_0xbecb('0x2e')](_0x470fb1);};}exports[_0xbecb('0x2f')]=function(_0x59dc0b,_0x176632){var _0x1959b6={},_0x5e0aa1={},_0x228ab9={'count':0x0,'rows':[]};var _0xb68823=_[_0xbecb('0x30')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x5dd7de){return{'name':_0x5dd7de['fieldName'],'type':_0x5dd7de['type']['key']};});_0x5e0aa1[_0xbecb('0x31')]=_[_0xbecb('0x30')](_0xb68823,_0xbecb('0x2d'));_0x5e0aa1[_0xbecb('0x32')]=_[_0xbecb('0x33')](_0x59dc0b[_0xbecb('0x32')]);_0x5e0aa1['filters']=_['intersection'](_0x5e0aa1[_0xbecb('0x31')],_0x5e0aa1['query']);_0x1959b6['attributes']=_[_0xbecb('0x34')](_0x5e0aa1[_0xbecb('0x31')],qs[_0xbecb('0x35')](_0x59dc0b[_0xbecb('0x32')][_0xbecb('0x35')]));_0x1959b6[_0xbecb('0x36')]=_0x1959b6['attributes'][_0xbecb('0x37')]?_0x1959b6[_0xbecb('0x36')]:_0x5e0aa1[_0xbecb('0x31')];if(!_0x59dc0b['query'][_0xbecb('0x38')](_0xbecb('0x39'))){_0x1959b6['limit']=qs['limit'](_0x59dc0b[_0xbecb('0x32')][_0xbecb('0x22')]);_0x1959b6[_0xbecb('0x21')]=qs['offset'](_0x59dc0b[_0xbecb('0x32')][_0xbecb('0x21')]);}_0x1959b6['order']=qs['sort'](_0x59dc0b[_0xbecb('0x32')][_0xbecb('0x3a')]);_0x1959b6['where']=qs[_0xbecb('0x3b')](_['pick'](_0x59dc0b[_0xbecb('0x32')],_0x5e0aa1[_0xbecb('0x3b')]),_0xb68823);if(_0x59dc0b['query']['filter']){_0x1959b6[_0xbecb('0x3c')]=_[_0xbecb('0x3d')](_0x1959b6['where'],{'$or':_[_0xbecb('0x30')](_0xb68823,function(_0x534a31){if(_0x534a31[_0xbecb('0x3e')]!==_0xbecb('0x3f')){var _0x10ebe9={};_0x10ebe9[_0x534a31[_0xbecb('0x2d')]]={'$like':'%'+_0x59dc0b[_0xbecb('0x32')][_0xbecb('0x40')]+'%'};return _0x10ebe9;}})});}_0x1959b6=_[_0xbecb('0x3d')]({},_0x1959b6,_0x59dc0b[_0xbecb('0x41')]);var _0x550523={'where':_0x1959b6['where']};return db[_0xbecb('0x42')][_0xbecb('0x20')](_0x550523)[_0xbecb('0x29')](function(_0x5b3535){_0x228ab9[_0xbecb('0x20')]=_0x5b3535;if(_0x59dc0b[_0xbecb('0x32')][_0xbecb('0x43')]){_0x1959b6[_0xbecb('0x44')]=[{'all':!![]}];}return db[_0xbecb('0x42')]['findAll'](_0x1959b6);})[_0xbecb('0x29')](function(_0x196f02){_0x228ab9['rows']=_0x196f02;return _0x228ab9;})[_0xbecb('0x29')](respondWithFilteredResult(_0x176632,_0x1959b6))[_0xbecb('0x45')](handleError(_0x176632,null));};exports['show']=function(_0x1de797,_0x50cd2c){var _0x318350={'raw':!![],'where':{'id':_0x1de797[_0xbecb('0x46')]['id']}},_0x2a29bc={};_0x2a29bc[_0xbecb('0x31')]=_[_0xbecb('0x33')](db[_0xbecb('0x42')][_0xbecb('0x47')]);_0x2a29bc[_0xbecb('0x32')]=_[_0xbecb('0x33')](_0x1de797[_0xbecb('0x32')]);_0x2a29bc['filters']=_['intersection'](_0x2a29bc[_0xbecb('0x31')],_0x2a29bc[_0xbecb('0x32')]);_0x318350[_0xbecb('0x36')]=_[_0xbecb('0x34')](_0x2a29bc[_0xbecb('0x31')],qs[_0xbecb('0x35')](_0x1de797[_0xbecb('0x32')]['fields']));_0x318350['attributes']=_0x318350['attributes'][_0xbecb('0x37')]?_0x318350[_0xbecb('0x36')]:_0x2a29bc['model'];if(_0x1de797[_0xbecb('0x32')][_0xbecb('0x43')]){_0x318350['include']=[{'all':!![]}];}_0x318350=_[_0xbecb('0x3d')]({},_0x318350,_0x1de797[_0xbecb('0x41')]);return db[_0xbecb('0x42')]['find'](_0x318350)[_0xbecb('0x29')](handleEntityNotFound(_0x50cd2c,null))[_0xbecb('0x29')](respondWithResult(_0x50cd2c,null))[_0xbecb('0x45')](handleError(_0x50cd2c,null));};exports['create']=function(_0x495f7d,_0x53528f){return db[_0xbecb('0x42')][_0xbecb('0x48')](_0x495f7d[_0xbecb('0x49')],{})[_0xbecb('0x29')](respondWithResult(_0x53528f,0xc9))['catch'](handleError(_0x53528f,null));};exports['update']=function(_0x220795,_0x42876b){if(_0x220795[_0xbecb('0x49')]['id']){delete _0x220795[_0xbecb('0x49')]['id'];}return db[_0xbecb('0x42')]['find']({'where':{'id':_0x220795[_0xbecb('0x46')]['id']}})[_0xbecb('0x29')](handleEntityNotFound(_0x42876b,null))['then'](saveUpdates(_0x220795[_0xbecb('0x49')],null))['then'](respondWithResult(_0x42876b,null))['catch'](handleError(_0x42876b,null));};exports[_0xbecb('0x2a')]=function(_0x284640,_0x4d1da8){return db['OpenchannelQueueReport'][_0xbecb('0x4a')]({'where':{'id':_0x284640[_0xbecb('0x46')]['id']}})[_0xbecb('0x29')](handleEntityNotFound(_0x4d1da8,null))['then'](removeEntity(_0x4d1da8,null))[_0xbecb('0x45')](handleError(_0x4d1da8,null));};exports['describe']=function(_0x7f3e1f,_0x333cd5){return db[_0xbecb('0x42')][_0xbecb('0x4b')]()[_0xbecb('0x29')](respondWithResult(_0x333cd5,null))[_0xbecb('0x45')](handleError(_0x333cd5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c5a900b..cd8a3cf 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x497038,_0x480501){var _0x478fae=function(_0x49cb72){while(--_0x49cb72){_0x497038['push'](_0x497038['shift']());}};_0x478fae(++_0x480501);}(_0x5fc3,0xa8));var _0x35fc=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x5fc3[_0xbe40ad];return _0x50fac9;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x814b,0x1a2));var _0xb814=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x814b[_0x30c649];return _0x3edfb9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 6676363..eb80dcf 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 _0xe820=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','update','where','attributes','limit','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ff6da,_0x1acdc1){var _0x63edf7=function(_0x3710eb){while(--_0x3710eb){_0x2ff6da['push'](_0x2ff6da['shift']());}};_0x63edf7(++_0x1acdc1);}(_0xe820,0xd2));var _0x0e82=function(_0x573b3e,_0x591d3e){_0x573b3e=_0x573b3e-0x0;var _0x21abf6=_0xe820[_0x573b3e];return _0x21abf6;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')](_0x53622b[_0x0e82('0x16')],{'raw':_0x53622b[_0x0e82('0x17')]?_0x53622b[_0x0e82('0x17')][_0x0e82('0x18')]===undefined?!![]:![]:!![]})[_0x0e82('0xa')](function(_0x5903c){logger['info']('CreateOpenchannelQueueReport',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON[_0x0e82('0xf')](_0x5903c));_0x310aac(_0x5903c);})[_0x0e82('0x19')](function(_0xd48046){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0xd48046[_0x0e82('0x12')],_0x53622b);_0x3a3ddf(_0x25ac21['error'](0x1f4,_0xd48046[_0x0e82('0x12')]));});});};exports[_0x0e82('0x1a')]=function(_0x3d6c28){var _0x24f883=this;return new Promise(function(_0x507f08,_0xee85dd){return db[_0x0e82('0x14')][_0x0e82('0x1b')](_0x3d6c28[_0x0e82('0x16')],{'raw':_0x3d6c28['options']?_0x3d6c28[_0x0e82('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d6c28['options']?_0x3d6c28[_0x0e82('0x17')][_0x0e82('0x1c')]||null:null,'attributes':_0x3d6c28['options']?_0x3d6c28[_0x0e82('0x17')][_0x0e82('0x1d')]||null:null,'limit':_0x3d6c28[_0x0e82('0x17')]?_0x3d6c28['options'][_0x0e82('0x1e')]||null:null})[_0x0e82('0xa')](function(_0x4ee65a){logger[_0x0e82('0x1f')]('UpdateOpenchannelQueueReport',_0x3d6c28);logger[_0x0e82('0xd')](_0x0e82('0x1a'),_0x3d6c28,JSON['stringify'](_0x4ee65a));_0x507f08(_0x4ee65a);})[_0x0e82('0x19')](function(_0x268af5){logger[_0x0e82('0x10')]('UpdateOpenchannelQueueReport',_0x268af5['message'],_0x3d6c28);_0xee85dd(_0x24f883[_0x0e82('0x10')](0x1f4,_0x268af5['message']));});});}; \ No newline at end of file +var _0x0abf=['debug','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','then','UpdateOpenchannelQueueReport','where','attributes','limit'];(function(_0x3b583,_0x17b2c4){var _0x5b3e66=function(_0x3052e2){while(--_0x3052e2){_0x3b583['push'](_0x3b583['shift']());}};_0x5b3e66(++_0x17b2c4);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')](_0x1803f0[_0xf0ab('0x18')],{'raw':_0x1803f0[_0xf0ab('0x19')]?_0x1803f0[_0xf0ab('0x19')][_0xf0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xf0ab('0x1b')](function(_0x22a205){logger[_0xf0ab('0xb')](_0xf0ab('0x15'),_0x1803f0);logger['debug'](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x22a205));_0x776619(_0x22a205);})[_0xf0ab('0x14')](function(_0x11ab3a){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x11ab3a[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x11ab3a[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x1c')]=function(_0x43119f){var _0x5645b2=this;return new Promise(function(_0x585841,_0x4eee21){return db[_0xf0ab('0x16')]['update'](_0x43119f[_0xf0ab('0x18')],{'raw':_0x43119f[_0xf0ab('0x19')]?_0x43119f['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':_0x43119f[_0xf0ab('0x19')]?_0x43119f['options'][_0xf0ab('0x1e')]||null:null,'limit':_0x43119f['options']?_0x43119f['options'][_0xf0ab('0x1f')]||null:null})[_0xf0ab('0x1b')](function(_0x1b223d){logger[_0xf0ab('0xb')](_0xf0ab('0x1c'),_0x43119f);logger[_0xf0ab('0x20')](_0xf0ab('0x1c'),_0x43119f,JSON[_0xf0ab('0xe')](_0x1b223d));_0x585841(_0x1b223d);})[_0xf0ab('0x14')](function(_0x2f0fcd){logger[_0xf0ab('0xf')](_0xf0ab('0x1c'),_0x2f0fcd['message'],_0x43119f);_0x4eee21(_0x5645b2[_0xf0ab('0xf')](0x1f4,_0x2f0fcd[_0xf0ab('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cc11b3d..448368c 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 _0xc20c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','describe','/:id','isAuthenticated','show','create','put','update','delete','util'];(function(_0x4218d0,_0x18aa4c){var _0x2c142c=function(_0x27a612){while(--_0x27a612){_0x4218d0['push'](_0x4218d0['shift']());}};_0x2c142c(++_0x18aa4c);}(_0xc20c,0x1cb));var _0xcc20=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xc20c[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require('multer');var util=require(_0xcc20('0x0'));var path=require(_0xcc20('0x1'));var timeout=require(_0xcc20('0x2'));var express=require(_0xcc20('0x3'));var router=express[_0xcc20('0x4')]();var fs_extra=require(_0xcc20('0x5'));var auth=require(_0xcc20('0x6'));var interaction=require(_0xcc20('0x7'));var config=require(_0xcc20('0x8'));var controller=require(_0xcc20('0x9'));router[_0xcc20('0xa')]('/',auth['isAuthenticated'](),controller[_0xcc20('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xcc20('0xc')]);router[_0xcc20('0xa')](_0xcc20('0xd'),auth[_0xcc20('0xe')](),controller[_0xcc20('0xf')]);router['post']('/',auth[_0xcc20('0xe')](),controller[_0xcc20('0x10')]);router[_0xcc20('0x11')](_0xcc20('0xd'),auth['isAuthenticated'](),controller[_0xcc20('0x12')]);router[_0xcc20('0x13')]('/:id',auth[_0xcc20('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x49e7=['create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x49e7,0x194));var _0x749e=function(_0x570b34,_0x537c5c){_0x570b34=_0x570b34-0x0;var _0x325f61=_0x49e7[_0x570b34];return _0x325f61;};'use strict';var multer=require(_0x749e('0x0'));var util=require(_0x749e('0x1'));var path=require('path');var timeout=require(_0x749e('0x2'));var express=require(_0x749e('0x3'));var router=express[_0x749e('0x4')]();var fs_extra=require(_0x749e('0x5'));var auth=require(_0x749e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x749e('0x7'));var controller=require(_0x749e('0x8'));router['get']('/',auth[_0x749e('0x9')](),controller['index']);router[_0x749e('0xa')](_0x749e('0xb'),auth['isAuthenticated'](),controller[_0x749e('0xc')]);router[_0x749e('0xa')](_0x749e('0xd'),auth['isAuthenticated'](),controller[_0x749e('0xe')]);router[_0x749e('0xf')]('/',auth[_0x749e('0x9')](),controller[_0x749e('0x10')]);router[_0x749e('0x11')](_0x749e('0xd'),auth[_0x749e('0x9')](),controller[_0x749e('0x12')]);router[_0x749e('0x13')](_0x749e('0xd'),auth[_0x749e('0x9')](),controller['destroy']);module[_0x749e('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4f47822..63c3eab 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x343182,_0x550093){var _0x18ae91=function(_0x1c36e7){while(--_0x1c36e7){_0x343182['push'](_0x343182['shift']());}};_0x18ae91(++_0x550093);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x9bde,0xe1));var _0xe9bd=function(_0xb1e0e6,_0x5bb567){_0xb1e0e6=_0xb1e0e6-0x0;var _0x5af99b=_0x9bde[_0xb1e0e6];return _0x5af99b;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 3b04843..630f925 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 _0x2e87=['intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','show','options','create','body','catch','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters'];(function(_0x202179,_0x3c0588){var _0x4ebe14=function(_0x203bdf){while(--_0x203bdf){_0x202179['push'](_0x202179['shift']());}};_0x4ebe14(++_0x3c0588);}(_0x2e87,0x68));var _0x72e8=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x2e87[_0x1dac7a];return _0x4cb363;};'use strict';var emlformat=require(_0x72e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72e8('0x1'));var jsonpatch=require(_0x72e8('0x2'));var rp=require(_0x72e8('0x3'));var moment=require(_0x72e8('0x4'));var BPromise=require(_0x72e8('0x5'));var Mustache=require('mustache');var util=require(_0x72e8('0x6'));var path=require(_0x72e8('0x7'));var sox=require(_0x72e8('0x8'));var csv=require(_0x72e8('0x9'));var ejs=require(_0x72e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72e8('0xb'));var squel=require(_0x72e8('0xc'));var crypto=require(_0x72e8('0xd'));var jsforce=require(_0x72e8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x72e8('0x9'));var querystring=require(_0x72e8('0xf'));var Papa=require(_0x72e8('0x10'));var Redis=require(_0x72e8('0x11'));var authService=require(_0x72e8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72e8('0x13'));var logger=require(_0x72e8('0x14'))(_0x72e8('0x15'));var utils=require(_0x72e8('0x16'));var config=require(_0x72e8('0x17'));var licenseUtil=require(_0x72e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x822622,_0x2d6dc7){_0x2d6dc7=_0x2d6dc7||0xcc;return function(_0x457fa7){if(_0x457fa7){return _0x822622[_0x72e8('0x19')](_0x2d6dc7);}return _0x822622[_0x72e8('0x1a')](_0x2d6dc7)[_0x72e8('0x1b')]();};}function respondWithResult(_0x182782,_0x3630f1){_0x3630f1=_0x3630f1||0xc8;return function(_0x1c5035){if(_0x1c5035){return _0x182782[_0x72e8('0x1a')](_0x3630f1)[_0x72e8('0x1c')](_0x1c5035);}};}function respondWithFilteredResult(_0x3723e2,_0x864bb0){return function(_0x3270ab){if(_0x3270ab){var _0x286da2=typeof _0x864bb0[_0x72e8('0x1d')]===_0x72e8('0x1e')&&typeof _0x864bb0['limit']==='undefined';var _0x1d4e68=_0x3270ab[_0x72e8('0x1f')];var _0x456003=_0x286da2?0x0:_0x864bb0[_0x72e8('0x1d')];var _0xb4575=_0x286da2?_0x3270ab[_0x72e8('0x1f')]:_0x864bb0['offset']+_0x864bb0['limit'];var _0x47e3dd;if(_0xb4575>=_0x1d4e68){_0xb4575=_0x1d4e68;_0x47e3dd=0xc8;}else{_0x47e3dd=0xce;}_0x3723e2[_0x72e8('0x1a')](_0x47e3dd);return _0x3723e2[_0x72e8('0x20')](_0x72e8('0x21'),_0x456003+'-'+_0xb4575+'/'+_0x1d4e68)[_0x72e8('0x1c')](_0x3270ab);}return null;};}function patchUpdates(_0x393f45){return function(_0x48d166){try{jsonpatch['apply'](_0x48d166,_0x393f45,!![]);}catch(_0x56aac3){return BPromise[_0x72e8('0x22')](_0x56aac3);}return _0x48d166[_0x72e8('0x23')]();};}function saveUpdates(_0x2189f8,_0x533394){return function(_0x544c0f){if(_0x544c0f){return _0x544c0f[_0x72e8('0x24')](_0x2189f8)[_0x72e8('0x25')](function(_0x425e4f){return _0x425e4f;});}return null;};}function removeEntity(_0x4dfbe0,_0x24220b){return function(_0x4b50d){if(_0x4b50d){return _0x4b50d[_0x72e8('0x26')]()[_0x72e8('0x25')](function(){_0x4dfbe0[_0x72e8('0x1a')](0xcc)[_0x72e8('0x1b')]();});}};}function handleEntityNotFound(_0x38d04c,_0x57ae20){return function(_0x405ce0){if(!_0x405ce0){_0x38d04c[_0x72e8('0x19')](0x194);}return _0x405ce0;};}function handleError(_0x4be735,_0x4db77c){_0x4db77c=_0x4db77c||0x1f4;return function(_0x302081){logger[_0x72e8('0x27')](_0x302081[_0x72e8('0x28')]);if(_0x302081[_0x72e8('0x29')]){delete _0x302081[_0x72e8('0x29')];}_0x4be735[_0x72e8('0x1a')](_0x4db77c)[_0x72e8('0x2a')](_0x302081);};}exports[_0x72e8('0x2b')]=function(_0x3d35b6,_0x3668af){var _0x1a2927={},_0x27ba5a={},_0x529a8c={'count':0x0,'rows':[]};var _0x116d62=_[_0x72e8('0x2c')](db[_0x72e8('0x2d')][_0x72e8('0x2e')],function(_0x203417){return{'name':_0x203417['fieldName'],'type':_0x203417['type'][_0x72e8('0x2f')]};});_0x27ba5a[_0x72e8('0x30')]=_['map'](_0x116d62,'name');_0x27ba5a[_0x72e8('0x31')]=_[_0x72e8('0x32')](_0x3d35b6['query']);_0x27ba5a[_0x72e8('0x33')]=_[_0x72e8('0x34')](_0x27ba5a[_0x72e8('0x30')],_0x27ba5a[_0x72e8('0x31')]);_0x1a2927['attributes']=_[_0x72e8('0x34')](_0x27ba5a[_0x72e8('0x30')],qs[_0x72e8('0x35')](_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x35')]));_0x1a2927[_0x72e8('0x36')]=_0x1a2927[_0x72e8('0x36')][_0x72e8('0x37')]?_0x1a2927[_0x72e8('0x36')]:_0x27ba5a[_0x72e8('0x30')];if(!_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x38')](_0x72e8('0x39'))){_0x1a2927['limit']=qs['limit'](_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x3a')]);_0x1a2927[_0x72e8('0x1d')]=qs[_0x72e8('0x1d')](_0x3d35b6['query'][_0x72e8('0x1d')]);}_0x1a2927[_0x72e8('0x3b')]=qs[_0x72e8('0x3c')](_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x3c')]);_0x1a2927[_0x72e8('0x3d')]=qs[_0x72e8('0x33')](_['pick'](_0x3d35b6[_0x72e8('0x31')],_0x27ba5a['filters']),_0x116d62);if(_0x3d35b6[_0x72e8('0x31')]['filter']){_0x1a2927[_0x72e8('0x3d')]=_[_0x72e8('0x3e')](_0x1a2927[_0x72e8('0x3d')],{'$or':_[_0x72e8('0x2c')](_0x116d62,function(_0x26cf3d){if(_0x26cf3d[_0x72e8('0x3f')]!==_0x72e8('0x40')){var _0x440579={};_0x440579[_0x26cf3d[_0x72e8('0x29')]]={'$like':'%'+_0x3d35b6[_0x72e8('0x31')][_0x72e8('0x41')]+'%'};return _0x440579;}})});}_0x1a2927=_[_0x72e8('0x3e')]({},_0x1a2927,_0x3d35b6['options']);var _0xb12767={'where':_0x1a2927['where']};return db[_0x72e8('0x2d')][_0x72e8('0x1f')](_0xb12767)[_0x72e8('0x25')](function(_0x388838){_0x529a8c['count']=_0x388838;if(_0x3d35b6['query'][_0x72e8('0x42')]){_0x1a2927[_0x72e8('0x43')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x72e8('0x44')](_0x1a2927);})[_0x72e8('0x25')](function(_0x38a1bf){_0x529a8c[_0x72e8('0x45')]=_0x38a1bf;return _0x529a8c;})[_0x72e8('0x25')](respondWithFilteredResult(_0x3668af,_0x1a2927))['catch'](handleError(_0x3668af,null));};exports[_0x72e8('0x46')]=function(_0x3c4fe8,_0x274432){var _0x4c85d2={'raw':!![],'where':{'id':_0x3c4fe8['params']['id']}},_0x4ab4a5={};_0x4ab4a5[_0x72e8('0x30')]=_[_0x72e8('0x32')](db['OpenchannelTransferReport'][_0x72e8('0x2e')]);_0x4ab4a5['query']=_[_0x72e8('0x32')](_0x3c4fe8[_0x72e8('0x31')]);_0x4ab4a5[_0x72e8('0x33')]=_[_0x72e8('0x34')](_0x4ab4a5[_0x72e8('0x30')],_0x4ab4a5['query']);_0x4c85d2['attributes']=_[_0x72e8('0x34')](_0x4ab4a5[_0x72e8('0x30')],qs['fields'](_0x3c4fe8[_0x72e8('0x31')][_0x72e8('0x35')]));_0x4c85d2['attributes']=_0x4c85d2[_0x72e8('0x36')][_0x72e8('0x37')]?_0x4c85d2['attributes']:_0x4ab4a5[_0x72e8('0x30')];if(_0x3c4fe8['query'][_0x72e8('0x42')]){_0x4c85d2['include']=[{'all':!![]}];}_0x4c85d2=_['merge']({},_0x4c85d2,_0x3c4fe8[_0x72e8('0x47')]);return db['OpenchannelTransferReport']['find'](_0x4c85d2)['then'](handleEntityNotFound(_0x274432,null))[_0x72e8('0x25')](respondWithResult(_0x274432,null))['catch'](handleError(_0x274432,null));};exports[_0x72e8('0x48')]=function(_0x15c25d,_0xd0f5bf){return db[_0x72e8('0x2d')][_0x72e8('0x48')](_0x15c25d[_0x72e8('0x49')],{})[_0x72e8('0x25')](respondWithResult(_0xd0f5bf,0xc9))[_0x72e8('0x4a')](handleError(_0xd0f5bf,null));};exports[_0x72e8('0x24')]=function(_0x56583d,_0x15b3fc){if(_0x56583d[_0x72e8('0x49')]['id']){delete _0x56583d[_0x72e8('0x49')]['id'];}return db[_0x72e8('0x2d')][_0x72e8('0x4b')]({'where':{'id':_0x56583d['params']['id']}})[_0x72e8('0x25')](handleEntityNotFound(_0x15b3fc,null))[_0x72e8('0x25')](saveUpdates(_0x56583d['body'],null))['then'](respondWithResult(_0x15b3fc,null))[_0x72e8('0x4a')](handleError(_0x15b3fc,null));};exports[_0x72e8('0x26')]=function(_0x4351f9,_0x1deae1){return db[_0x72e8('0x2d')][_0x72e8('0x4b')]({'where':{'id':_0x4351f9[_0x72e8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1deae1,null))[_0x72e8('0x25')](removeEntity(_0x1deae1,null))[_0x72e8('0x4a')](handleError(_0x1deae1,null));};exports[_0x72e8('0x4d')]=function(_0x468875,_0x13c4cd){return db['OpenchannelTransferReport'][_0x72e8('0x4d')]()['then'](respondWithResult(_0x13c4cd,null))[_0x72e8('0x4a')](handleError(_0x13c4cd,null));}; \ No newline at end of file +var _0x71d1=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','VIRTUAL','merge','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','length','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2b1d64,_0x26cf26){var _0x564387=function(_0x8e63dc){while(--_0x8e63dc){_0x2b1d64['push'](_0x2b1d64['shift']());}};_0x564387(++_0x26cf26);}(_0x71d1,0x110));var _0x171d=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0x71d1[_0x233cb1];return _0x29ee7e;};'use strict';var emlformat=require(_0x171d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x171d('0x1'));var rp=require(_0x171d('0x2'));var moment=require(_0x171d('0x3'));var BPromise=require(_0x171d('0x4'));var Mustache=require(_0x171d('0x5'));var util=require(_0x171d('0x6'));var path=require('path');var sox=require(_0x171d('0x7'));var csv=require(_0x171d('0x8'));var ejs=require(_0x171d('0x9'));var fs=require('fs');var fs_extra=require(_0x171d('0xa'));var _=require(_0x171d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x171d('0xc'));var deskjs=require(_0x171d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x171d('0xe'));var Papa=require(_0x171d('0xf'));var Redis=require(_0x171d('0x10'));var authService=require(_0x171d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x171d('0x12'));var hardwareService=require(_0x171d('0x13'));var logger=require(_0x171d('0x14'))(_0x171d('0x15'));var utils=require(_0x171d('0x16'));var config=require(_0x171d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef23f,_0x5f1823){_0x5f1823=_0x5f1823||0xcc;return function(_0x39b908){if(_0x39b908){return _0x1ef23f[_0x171d('0x18')](_0x5f1823);}return _0x1ef23f[_0x171d('0x19')](_0x5f1823)[_0x171d('0x1a')]();};}function respondWithResult(_0x1bf8d8,_0xdb685f){_0xdb685f=_0xdb685f||0xc8;return function(_0x3796d4){if(_0x3796d4){return _0x1bf8d8[_0x171d('0x19')](_0xdb685f)['json'](_0x3796d4);}};}function respondWithFilteredResult(_0x16acd5,_0x931093){return function(_0x288c86){if(_0x288c86){var _0xc67a42=typeof _0x931093[_0x171d('0x1b')]===_0x171d('0x1c')&&typeof _0x931093[_0x171d('0x1d')]===_0x171d('0x1c');var _0x5a0cc0=_0x288c86[_0x171d('0x1e')];var _0x239281=_0xc67a42?0x0:_0x931093['offset'];var _0x30acbf=_0xc67a42?_0x288c86[_0x171d('0x1e')]:_0x931093[_0x171d('0x1b')]+_0x931093['limit'];var _0x28f9c3;if(_0x30acbf>=_0x5a0cc0){_0x30acbf=_0x5a0cc0;_0x28f9c3=0xc8;}else{_0x28f9c3=0xce;}_0x16acd5['status'](_0x28f9c3);return _0x16acd5['set'](_0x171d('0x1f'),_0x239281+'-'+_0x30acbf+'/'+_0x5a0cc0)['json'](_0x288c86);}return null;};}function patchUpdates(_0x3b9791){return function(_0x4b84d2){try{jsonpatch['apply'](_0x4b84d2,_0x3b9791,!![]);}catch(_0x5e620c){return BPromise[_0x171d('0x20')](_0x5e620c);}return _0x4b84d2[_0x171d('0x21')]();};}function saveUpdates(_0x43b8eb,_0x5563ee){return function(_0x4b67ea){if(_0x4b67ea){return _0x4b67ea[_0x171d('0x22')](_0x43b8eb)['then'](function(_0x36b662){return _0x36b662;});}return null;};}function removeEntity(_0x18f968,_0x2f0b09){return function(_0x42d528){if(_0x42d528){return _0x42d528[_0x171d('0x23')]()[_0x171d('0x24')](function(){_0x18f968[_0x171d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ab80,_0x1a69c3){return function(_0x36d1d4){if(!_0x36d1d4){_0x9ab80['sendStatus'](0x194);}return _0x36d1d4;};}function handleError(_0x343656,_0x9ea33a){_0x9ea33a=_0x9ea33a||0x1f4;return function(_0x47ef37){logger[_0x171d('0x25')](_0x47ef37[_0x171d('0x26')]);if(_0x47ef37[_0x171d('0x27')]){delete _0x47ef37[_0x171d('0x27')];}_0x343656[_0x171d('0x19')](_0x9ea33a)[_0x171d('0x28')](_0x47ef37);};}exports['index']=function(_0x5d7754,_0x303b60){var _0x4a85ac={},_0x1999e5={},_0x25c80b={'count':0x0,'rows':[]};var _0x5e15b0=_['map'](db['OpenchannelTransferReport'][_0x171d('0x29')],function(_0x2c00e3){return{'name':_0x2c00e3[_0x171d('0x2a')],'type':_0x2c00e3[_0x171d('0x2b')][_0x171d('0x2c')]};});_0x1999e5[_0x171d('0x2d')]=_['map'](_0x5e15b0,_0x171d('0x27'));_0x1999e5[_0x171d('0x2e')]=_[_0x171d('0x2f')](_0x5d7754[_0x171d('0x2e')]);_0x1999e5['filters']=_['intersection'](_0x1999e5['model'],_0x1999e5[_0x171d('0x2e')]);_0x4a85ac['attributes']=_[_0x171d('0x30')](_0x1999e5[_0x171d('0x2d')],qs[_0x171d('0x31')](_0x5d7754[_0x171d('0x2e')][_0x171d('0x31')]));_0x4a85ac[_0x171d('0x32')]=_0x4a85ac[_0x171d('0x32')]['length']?_0x4a85ac[_0x171d('0x32')]:_0x1999e5[_0x171d('0x2d')];if(!_0x5d7754[_0x171d('0x2e')][_0x171d('0x33')](_0x171d('0x34'))){_0x4a85ac[_0x171d('0x1d')]=qs['limit'](_0x5d7754[_0x171d('0x2e')]['limit']);_0x4a85ac['offset']=qs[_0x171d('0x1b')](_0x5d7754[_0x171d('0x2e')]['offset']);}_0x4a85ac[_0x171d('0x35')]=qs[_0x171d('0x36')](_0x5d7754[_0x171d('0x2e')][_0x171d('0x36')]);_0x4a85ac[_0x171d('0x37')]=qs[_0x171d('0x38')](_['pick'](_0x5d7754[_0x171d('0x2e')],_0x1999e5[_0x171d('0x38')]),_0x5e15b0);if(_0x5d7754[_0x171d('0x2e')][_0x171d('0x39')]){_0x4a85ac[_0x171d('0x37')]=_['merge'](_0x4a85ac[_0x171d('0x37')],{'$or':_[_0x171d('0x3a')](_0x5e15b0,function(_0x3968ee){if(_0x3968ee[_0x171d('0x2b')]!==_0x171d('0x3b')){var _0x56c4e0={};_0x56c4e0[_0x3968ee[_0x171d('0x27')]]={'$like':'%'+_0x5d7754['query'][_0x171d('0x39')]+'%'};return _0x56c4e0;}})});}_0x4a85ac=_[_0x171d('0x3c')]({},_0x4a85ac,_0x5d7754[_0x171d('0x3d')]);var _0x280422={'where':_0x4a85ac[_0x171d('0x37')]};return db[_0x171d('0x3e')][_0x171d('0x1e')](_0x280422)['then'](function(_0x1c0d36){_0x25c80b[_0x171d('0x1e')]=_0x1c0d36;if(_0x5d7754[_0x171d('0x2e')][_0x171d('0x3f')]){_0x4a85ac[_0x171d('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x171d('0x41')](_0x4a85ac);})['then'](function(_0x38f7a1){_0x25c80b[_0x171d('0x42')]=_0x38f7a1;return _0x25c80b;})[_0x171d('0x24')](respondWithFilteredResult(_0x303b60,_0x4a85ac))[_0x171d('0x43')](handleError(_0x303b60,null));};exports[_0x171d('0x44')]=function(_0x201223,_0x2cdb2d){var _0x3a043d={'raw':!![],'where':{'id':_0x201223['params']['id']}},_0xc4e3ca={};_0xc4e3ca[_0x171d('0x2d')]=_['keys'](db[_0x171d('0x3e')][_0x171d('0x29')]);_0xc4e3ca[_0x171d('0x2e')]=_[_0x171d('0x2f')](_0x201223[_0x171d('0x2e')]);_0xc4e3ca[_0x171d('0x38')]=_[_0x171d('0x30')](_0xc4e3ca[_0x171d('0x2d')],_0xc4e3ca[_0x171d('0x2e')]);_0x3a043d[_0x171d('0x32')]=_[_0x171d('0x30')](_0xc4e3ca[_0x171d('0x2d')],qs[_0x171d('0x31')](_0x201223[_0x171d('0x2e')][_0x171d('0x31')]));_0x3a043d['attributes']=_0x3a043d[_0x171d('0x32')][_0x171d('0x45')]?_0x3a043d['attributes']:_0xc4e3ca[_0x171d('0x2d')];if(_0x201223['query'][_0x171d('0x3f')]){_0x3a043d[_0x171d('0x40')]=[{'all':!![]}];}_0x3a043d=_['merge']({},_0x3a043d,_0x201223[_0x171d('0x3d')]);return db['OpenchannelTransferReport'][_0x171d('0x46')](_0x3a043d)[_0x171d('0x24')](handleEntityNotFound(_0x2cdb2d,null))[_0x171d('0x24')](respondWithResult(_0x2cdb2d,null))[_0x171d('0x43')](handleError(_0x2cdb2d,null));};exports[_0x171d('0x47')]=function(_0x12818b,_0x1af0bb){return db[_0x171d('0x3e')][_0x171d('0x47')](_0x12818b[_0x171d('0x48')],{})[_0x171d('0x24')](respondWithResult(_0x1af0bb,0xc9))['catch'](handleError(_0x1af0bb,null));};exports['update']=function(_0x3c3406,_0x4dc7a1){if(_0x3c3406[_0x171d('0x48')]['id']){delete _0x3c3406[_0x171d('0x48')]['id'];}return db['OpenchannelTransferReport'][_0x171d('0x46')]({'where':{'id':_0x3c3406['params']['id']}})[_0x171d('0x24')](handleEntityNotFound(_0x4dc7a1,null))[_0x171d('0x24')](saveUpdates(_0x3c3406[_0x171d('0x48')],null))[_0x171d('0x24')](respondWithResult(_0x4dc7a1,null))[_0x171d('0x43')](handleError(_0x4dc7a1,null));};exports['destroy']=function(_0x44fa1f,_0x163c30){return db[_0x171d('0x3e')][_0x171d('0x46')]({'where':{'id':_0x44fa1f['params']['id']}})[_0x171d('0x24')](handleEntityNotFound(_0x163c30,null))['then'](removeEntity(_0x163c30,null))['catch'](handleError(_0x163c30,null));};exports['describe']=function(_0xd08a1c,_0x40c28b){return db[_0x171d('0x3e')]['describe']()[_0x171d('0x24')](respondWithResult(_0x40c28b,null))[_0x171d('0x43')](handleError(_0x40c28b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 2f628f5..be6b24d 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 _0x688c=['OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','bluebird','path','rimraf','./openchannelTransferReport.attributes','define'];(function(_0x3ffb4c,_0x2f9caa){var _0x194a24=function(_0x2c808f){while(--_0x2c808f){_0x3ffb4c['push'](_0x3ffb4c['shift']());}};_0x194a24(++_0x2f9caa);}(_0x688c,0x84));var _0xc688=function(_0x1ca25c,_0x231b67){_0x1ca25c=_0x1ca25c-0x0;var _0x271eb6=_0x688c[_0x1ca25c];return _0x271eb6;};'use strict';var _=require(_0xc688('0x0'));var util=require(_0xc688('0x1'));var logger=require(_0xc688('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc688('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc688('0x4'));var rimraf=require(_0xc688('0x5'));var config=require('../../config/environment');var attributes=require(_0xc688('0x6'));module['exports']=function(_0x196b53,_0x15dca0){return _0x196b53[_0xc688('0x7')](_0xc688('0x8'),attributes,{'tableName':_0xc688('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x483f=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x483f,0x1c6));var _0xf483=function(_0x125adf,_0x2b49f8){_0x125adf=_0x125adf-0x0;var _0x4231de=_0x483f[_0x125adf];return _0x4231de;};'use strict';var _=require(_0xf483('0x0'));var util=require(_0xf483('0x1'));var logger=require('../../config/logger')(_0xf483('0x2'));var moment=require(_0xf483('0x3'));var BPromise=require(_0xf483('0x4'));var rp=require(_0xf483('0x5'));var fs=require('fs');var path=require(_0xf483('0x6'));var rimraf=require(_0xf483('0x7'));var config=require(_0xf483('0x8'));var attributes=require(_0xf483('0x9'));module['exports']=function(_0x119fe7,_0x622499){return _0x119fe7[_0xf483('0xa')](_0xf483('0xb'),attributes,{'tableName':_0xf483('0xc'),'paranoid':![],'indexes':[{'name':_0xf483('0xd'),'fields':[_0xf483('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index ac60c58..255e6d7 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 _0x7d9f=['../../config/environment','http','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47af5c,_0x40643c){var _0x14e664=function(_0xca3726){while(--_0xca3726){_0x47af5c['push'](_0x47af5c['shift']());}};_0x14e664(++_0x40643c);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x58df3b,_0x182132){_0x58df3b=_0x58df3b-0x0;var _0x1c82d6=_0x7d9f[_0x58df3b];return _0x1c82d6;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var moment=require(_0xf7d9('0x2'));var BPromise=require(_0xf7d9('0x3'));var rs=require(_0xf7d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7d9('0x5'))['db'];var utils=require(_0xf7d9('0x6'));var logger=require(_0xf7d9('0x7'))(_0xf7d9('0x8'));var config=require(_0xf7d9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x250675,_0x5772b4,_0x21c654){return new BPromise(function(_0x1685a6,_0x5e4087){return client[_0xf7d9('0xb')](_0x250675,_0x21c654)['then'](function(_0x265548){logger[_0xf7d9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5772b4,'request\x20sent');logger[_0xf7d9('0xd')](_0xf7d9('0xe'),_0x5772b4,_0xf7d9('0xf'),JSON['stringify'](_0x265548));if(_0x265548['error']){if(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x11')]===0x1f4){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x265548['error'][_0xf7d9('0x13')]);return _0x5e4087(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}logger[_0xf7d9('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5772b4,_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);return _0x1685a6(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}else{logger['info'](_0xf7d9('0x12'),_0x5772b4,_0xf7d9('0xf'));_0x1685a6(_0x265548[_0xf7d9('0x14')]['message']);}})['catch'](function(_0x35751e){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x35751e);_0x5e4087(_0x35751e);});});} \ No newline at end of file +var _0x2975=['http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x26224c,_0x1a354c){var _0x4c2bc5=function(_0x179343){while(--_0x179343){_0x26224c['push'](_0x26224c['shift']());}};_0x4c2bc5(++_0x1a354c);}(_0x2975,0x1c5));var _0x5297=function(_0x2be399,_0x14aeff){_0x2be399=_0x2be399-0x0;var _0x2fd8bc=_0x2975[_0x2be399];return _0x2fd8bc;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var moment=require(_0x5297('0x1'));var BPromise=require(_0x5297('0x2'));var rs=require(_0x5297('0x3'));var fs=require('fs');var Redis=require(_0x5297('0x4'));var db=require(_0x5297('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5297('0x6'));var jayson=require(_0x5297('0x7'));var client=jayson[_0x5297('0x8')][_0x5297('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1d2c,_0x1f6762,_0x1b72a7){return new BPromise(function(_0x4f12b0,_0x2c015c){return client[_0x5297('0xa')](_0x4d1d2c,_0x1b72a7)[_0x5297('0xb')](function(_0x2f3b24){logger[_0x5297('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x5297('0xd'));logger[_0x5297('0xe')](_0x5297('0xf'),_0x1f6762,'request\x20sent',JSON[_0x5297('0x10')](_0x2f3b24));if(_0x2f3b24[_0x5297('0x11')]){if(_0x2f3b24[_0x5297('0x11')]['code']===0x1f4){logger[_0x5297('0x11')](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error']['message']);return _0x2c015c(_0x2f3b24[_0x5297('0x11')][_0x5297('0x13')]);}logger['error'](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error'][_0x5297('0x13')]);return _0x4f12b0(_0x2f3b24[_0x5297('0x11')]['message']);}else{logger[_0x5297('0xc')](_0x5297('0x12'),_0x1f6762,_0x5297('0xd'));_0x4f12b0(_0x2f3b24[_0x5297('0x14')][_0x5297('0x13')]);}})[_0x5297('0x15')](function(_0x1fb138){logger[_0x5297('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x1fb138);_0x2c015c(_0x1fb138);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2356e95..8f3e2c4 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 _0xea67=['./pause.controller','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xa46b86,_0x5c1465){var _0x417360=function(_0x4800d1){while(--_0x4800d1){_0xa46b86['push'](_0xa46b86['shift']());}};_0x417360(++_0x5c1465);}(_0xea67,0x172));var _0x7ea6=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0xea67[_0x2d4065];return _0xef6016;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require('express');var router=express[_0x7ea6('0x4')]();var fs_extra=require(_0x7ea6('0x5'));var auth=require(_0x7ea6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ea6('0x7'));var controller=require(_0x7ea6('0x8'));router[_0x7ea6('0x9')]('/',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xb')]);router[_0x7ea6('0x9')](_0x7ea6('0xc'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xd')]);router['post']('/',auth[_0x7ea6('0xa')](),controller['create']);router[_0x7ea6('0xe')](_0x7ea6('0xc'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xf')]);router['delete']('/:id',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x10')]);module[_0x7ea6('0x11')]=router; \ No newline at end of file +var _0x34eb=['put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x200bd1,_0x4b8663){var _0x3af85d=function(_0x1e8b5f){while(--_0x1e8b5f){_0x200bd1['push'](_0x200bd1['shift']());}};_0x3af85d(++_0x4b8663);}(_0x34eb,0x180));var _0xb34e=function(_0x16f5db,_0x281a74){_0x16f5db=_0x16f5db-0x0;var _0x152def=_0x34eb[_0x16f5db];return _0x152def;};'use strict';var multer=require(_0xb34e('0x0'));var util=require(_0xb34e('0x1'));var path=require(_0xb34e('0x2'));var timeout=require(_0xb34e('0x3'));var express=require('express');var router=express[_0xb34e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb34e('0x5'));var interaction=require(_0xb34e('0x6'));var config=require(_0xb34e('0x7'));var controller=require(_0xb34e('0x8'));router[_0xb34e('0x9')]('/',auth[_0xb34e('0xa')](),controller[_0xb34e('0xb')]);router['get'](_0xb34e('0xc'),auth[_0xb34e('0xa')](),controller[_0xb34e('0xd')]);router[_0xb34e('0xe')]('/',auth[_0xb34e('0xa')](),controller[_0xb34e('0xf')]);router[_0xb34e('0x10')](_0xb34e('0xc'),auth[_0xb34e('0xa')](),controller[_0xb34e('0x11')]);router[_0xb34e('0x12')](_0xb34e('0xc'),auth[_0xb34e('0xa')](),controller['destroy']);module[_0xb34e('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 7aaed9c..0df3794 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 _0x4a5a=['STRING','name','exports'];(function(_0x258c92,_0x5e0703){var _0x4fd293=function(_0x2f8d29){while(--_0x2f8d29){_0x258c92['push'](_0x258c92['shift']());}};_0x4fd293(++_0x5e0703);}(_0x4a5a,0x110));var _0xa4a5=function(_0x2037ca,_0x2b9aff){_0x2037ca=_0x2037ca-0x0;var _0x2aac8a=_0x4a5a[_0x2037ca];return _0x2aac8a;};'use strict';var Sequelize=require('sequelize');module[_0xa4a5('0x0')]={'name':{'type':Sequelize[_0xa4a5('0x1')],'unique':_0xa4a5('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa4a5('0x1')]}}; \ No newline at end of file +var _0x7b8c=['sequelize','exports','STRING','name'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x7b8c,0x144));var _0xc7b8=function(_0x21e7c5,_0x53f50e){_0x21e7c5=_0x21e7c5-0x0;var _0x209c26=_0x7b8c[_0x21e7c5];return _0x209c26;};'use strict';var Sequelize=require(_0xc7b8('0x0'));module[_0xc7b8('0x1')]={'name':{'type':Sequelize[_0xc7b8('0x2')],'unique':_0xc7b8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc7b8('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8f255f9..4f3d12f 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 _0xd0fc=['reject','save','then','destroy','get','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Pause','count','includeAll','findAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0xd0fc,0x129));var _0xcd0f=function(_0x432394,_0x4b2305){_0x432394=_0x432394-0x0;var _0x2bb7a8=_0xd0fc[_0x432394];return _0x2bb7a8;};'use strict';var emlformat=require(_0xcd0f('0x0'));var rimraf=require(_0xcd0f('0x1'));var zipdir=require(_0xcd0f('0x2'));var jsonpatch=require(_0xcd0f('0x3'));var rp=require(_0xcd0f('0x4'));var moment=require(_0xcd0f('0x5'));var BPromise=require(_0xcd0f('0x6'));var Mustache=require(_0xcd0f('0x7'));var util=require('util');var path=require(_0xcd0f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcd0f('0x9'));var fs=require('fs');var fs_extra=require(_0xcd0f('0xa'));var _=require(_0xcd0f('0xb'));var squel=require('squel');var crypto=require(_0xcd0f('0xc'));var jsforce=require(_0xcd0f('0xd'));var deskjs=require(_0xcd0f('0xe'));var toCsv=require(_0xcd0f('0xf'));var querystring=require('querystring');var Papa=require(_0xcd0f('0x10'));var Redis=require(_0xcd0f('0x11'));var authService=require(_0xcd0f('0x12'));var qs=require(_0xcd0f('0x13'));var as=require(_0xcd0f('0x14'));var hardwareService=require(_0xcd0f('0x15'));var logger=require(_0xcd0f('0x16'))(_0xcd0f('0x17'));var utils=require(_0xcd0f('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcd0f('0x19'))['db'];function respondWithStatusCode(_0x5b7688,_0xbc807a){_0xbc807a=_0xbc807a||0xcc;return function(_0x14cfe6){if(_0x14cfe6){return _0x5b7688[_0xcd0f('0x1a')](_0xbc807a);}return _0x5b7688['status'](_0xbc807a)[_0xcd0f('0x1b')]();};}function respondWithResult(_0x477bbf,_0x2502d0){_0x2502d0=_0x2502d0||0xc8;return function(_0x449f6b){if(_0x449f6b){return _0x477bbf[_0xcd0f('0x1c')](_0x2502d0)[_0xcd0f('0x1d')](_0x449f6b);}};}function respondWithFilteredResult(_0x437fba,_0x2cdbe1){return function(_0x71f302){if(_0x71f302){var _0x5d0df6=typeof _0x2cdbe1[_0xcd0f('0x1e')]==='undefined'&&typeof _0x2cdbe1['limit']===_0xcd0f('0x1f');var _0x2cb5ee=_0x71f302['count'];var _0x58225c=_0x5d0df6?0x0:_0x2cdbe1[_0xcd0f('0x1e')];var _0x35ffe5=_0x5d0df6?_0x71f302['count']:_0x2cdbe1[_0xcd0f('0x1e')]+_0x2cdbe1[_0xcd0f('0x20')];var _0x4b1eb2;if(_0x35ffe5>=_0x2cb5ee){_0x35ffe5=_0x2cb5ee;_0x4b1eb2=0xc8;}else{_0x4b1eb2=0xce;}_0x437fba['status'](_0x4b1eb2);return _0x437fba['set'](_0xcd0f('0x21'),_0x58225c+'-'+_0x35ffe5+'/'+_0x2cb5ee)[_0xcd0f('0x1d')](_0x71f302);}return null;};}function patchUpdates(_0x4b5252){return function(_0x14a79a){try{jsonpatch[_0xcd0f('0x22')](_0x14a79a,_0x4b5252,!![]);}catch(_0x92618f){return BPromise[_0xcd0f('0x23')](_0x92618f);}return _0x14a79a[_0xcd0f('0x24')]();};}function saveUpdates(_0x238cd4,_0x2cdc9c){return function(_0xd61d3){if(_0xd61d3){return _0xd61d3['update'](_0x238cd4)[_0xcd0f('0x25')](function(_0x5585ba){return _0x5585ba;});}return null;};}function removeEntity(_0xbeade6,_0x4e5a41){return function(_0x412fe7){if(_0x412fe7){return _0x412fe7[_0xcd0f('0x26')]()[_0xcd0f('0x25')](function(){var _0x4da61f=_0x412fe7[_0xcd0f('0x27')]({'plain':!![]});var _0x335eef='Pauses';return db[_0xcd0f('0x28')][_0xcd0f('0x26')]({'where':{'type':_0x335eef,'resourceId':_0x4da61f['id']}})[_0xcd0f('0x25')](function(){return _0x412fe7;});})[_0xcd0f('0x25')](function(){_0xbeade6[_0xcd0f('0x1c')](0xcc)[_0xcd0f('0x1b')]();});}};}function handleEntityNotFound(_0x53a570,_0x58785a){return function(_0xea26d9){if(!_0xea26d9){_0x53a570[_0xcd0f('0x1a')](0x194);}return _0xea26d9;};}function handleError(_0xc201f7,_0x1469fb){_0x1469fb=_0x1469fb||0x1f4;return function(_0x12903f){logger[_0xcd0f('0x29')](_0x12903f['stack']);if(_0x12903f[_0xcd0f('0x2a')]){delete _0x12903f['name'];}_0xc201f7['status'](_0x1469fb)[_0xcd0f('0x2b')](_0x12903f);};}exports['index']=function(_0x4c3c93,_0xd6e12e){var _0x1abbdf={},_0x1c3b1d={},_0x14ea98={'count':0x0,'rows':[]};var _0x9e0280=_[_0xcd0f('0x2c')](db['Pause'][_0xcd0f('0x2d')],function(_0x312b8e){return{'name':_0x312b8e[_0xcd0f('0x2e')],'type':_0x312b8e[_0xcd0f('0x2f')][_0xcd0f('0x30')]};});_0x1c3b1d[_0xcd0f('0x31')]=_['map'](_0x9e0280,_0xcd0f('0x2a'));_0x1c3b1d[_0xcd0f('0x32')]=_[_0xcd0f('0x33')](_0x4c3c93[_0xcd0f('0x32')]);_0x1c3b1d[_0xcd0f('0x34')]=_['intersection'](_0x1c3b1d['model'],_0x1c3b1d[_0xcd0f('0x32')]);_0x1abbdf[_0xcd0f('0x35')]=_[_0xcd0f('0x36')](_0x1c3b1d[_0xcd0f('0x31')],qs[_0xcd0f('0x37')](_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x37')]));_0x1abbdf[_0xcd0f('0x35')]=_0x1abbdf[_0xcd0f('0x35')][_0xcd0f('0x38')]?_0x1abbdf[_0xcd0f('0x35')]:_0x1c3b1d[_0xcd0f('0x31')];if(!_0x4c3c93['query']['hasOwnProperty'](_0xcd0f('0x39'))){_0x1abbdf[_0xcd0f('0x20')]=qs['limit'](_0x4c3c93['query'][_0xcd0f('0x20')]);_0x1abbdf[_0xcd0f('0x1e')]=qs[_0xcd0f('0x1e')](_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x1e')]);}_0x1abbdf['order']=qs['sort'](_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x3a')]);_0x1abbdf[_0xcd0f('0x3b')]=qs[_0xcd0f('0x34')](_[_0xcd0f('0x3c')](_0x4c3c93[_0xcd0f('0x32')],_0x1c3b1d[_0xcd0f('0x34')]),_0x9e0280);if(_0x4c3c93['query'][_0xcd0f('0x3d')]){_0x1abbdf['where']=_[_0xcd0f('0x3e')](_0x1abbdf[_0xcd0f('0x3b')],{'$or':_[_0xcd0f('0x2c')](_0x9e0280,function(_0x1b9596){if(_0x1b9596['type']!==_0xcd0f('0x3f')){var _0x5953d8={};_0x5953d8[_0x1b9596[_0xcd0f('0x2a')]]={'$like':'%'+_0x4c3c93['query'][_0xcd0f('0x3d')]+'%'};return _0x5953d8;}})});}_0x1abbdf=_[_0xcd0f('0x3e')]({},_0x1abbdf,_0x4c3c93[_0xcd0f('0x40')]);var _0x454d0f={'where':_0x1abbdf[_0xcd0f('0x3b')]};return db[_0xcd0f('0x41')][_0xcd0f('0x42')](_0x454d0f)[_0xcd0f('0x25')](function(_0x599685){_0x14ea98[_0xcd0f('0x42')]=_0x599685;if(_0x4c3c93[_0xcd0f('0x32')][_0xcd0f('0x43')]){_0x1abbdf['include']=[{'all':!![]}];}return db['Pause'][_0xcd0f('0x44')](_0x1abbdf);})[_0xcd0f('0x25')](function(_0x515fc3){_0x14ea98[_0xcd0f('0x45')]=_0x515fc3;return _0x14ea98;})[_0xcd0f('0x25')](respondWithFilteredResult(_0xd6e12e,_0x1abbdf))[_0xcd0f('0x46')](handleError(_0xd6e12e,null));};exports['show']=function(_0x142926,_0x3488b4){var _0x1e0018={'raw':!![],'where':{'id':_0x142926[_0xcd0f('0x47')]['id']}},_0x2da259={};_0x2da259[_0xcd0f('0x31')]=_['keys'](db['Pause'][_0xcd0f('0x2d')]);_0x2da259['query']=_[_0xcd0f('0x33')](_0x142926['query']);_0x2da259[_0xcd0f('0x34')]=_[_0xcd0f('0x36')](_0x2da259['model'],_0x2da259[_0xcd0f('0x32')]);_0x1e0018[_0xcd0f('0x35')]=_[_0xcd0f('0x36')](_0x2da259['model'],qs[_0xcd0f('0x37')](_0x142926[_0xcd0f('0x32')][_0xcd0f('0x37')]));_0x1e0018[_0xcd0f('0x35')]=_0x1e0018[_0xcd0f('0x35')]['length']?_0x1e0018['attributes']:_0x2da259['model'];if(_0x142926[_0xcd0f('0x32')]['includeAll']){_0x1e0018[_0xcd0f('0x48')]=[{'all':!![]}];}_0x1e0018=_[_0xcd0f('0x3e')]({},_0x1e0018,_0x142926[_0xcd0f('0x40')]);return db[_0xcd0f('0x41')][_0xcd0f('0x49')](_0x1e0018)[_0xcd0f('0x25')](handleEntityNotFound(_0x3488b4,null))[_0xcd0f('0x25')](respondWithResult(_0x3488b4,null))['catch'](handleError(_0x3488b4,null));};exports[_0xcd0f('0x4a')]=function(_0x470482,_0x57ba50){return db[_0xcd0f('0x41')]['create'](_0x470482['body'],{})[_0xcd0f('0x25')](function(_0x454218){var _0x45f58e=_0x470482[_0xcd0f('0x4b')]['get']({'plain':!![]});if(!_0x45f58e)throw new Error(_0xcd0f('0x4c'));if(_0x45f58e[_0xcd0f('0x4d')]===_0xcd0f('0x4b')){var _0x128842=_0x454218[_0xcd0f('0x27')]({'plain':!![]});var _0x424c62='Pauses';return db[_0xcd0f('0x4e')][_0xcd0f('0x49')]({'where':{'name':_0x424c62,'userProfileId':_0x45f58e[_0xcd0f('0x4f')]},'raw':!![]})[_0xcd0f('0x25')](function(_0x399a5c){if(_0x399a5c&&_0x399a5c[_0xcd0f('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x128842[_0xcd0f('0x2a')],'resourceId':_0x128842['id'],'type':_0x399a5c[_0xcd0f('0x2a')],'sectionId':_0x399a5c['id']},{})[_0xcd0f('0x25')](function(){return _0x454218;});}else{return _0x454218;}})[_0xcd0f('0x46')](function(_0x2c3704){logger[_0xcd0f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c3704);throw _0x2c3704;});}return _0x454218;})[_0xcd0f('0x25')](respondWithResult(_0x57ba50,0xc9))[_0xcd0f('0x46')](handleError(_0x57ba50,null));};exports[_0xcd0f('0x51')]=function(_0x2d0ebe,_0xcae58d){if(_0x2d0ebe[_0xcd0f('0x52')]['id']){delete _0x2d0ebe[_0xcd0f('0x52')]['id'];}return db[_0xcd0f('0x41')][_0xcd0f('0x49')]({'where':{'id':_0x2d0ebe[_0xcd0f('0x47')]['id']}})[_0xcd0f('0x25')](handleEntityNotFound(_0xcae58d,null))[_0xcd0f('0x25')](saveUpdates(_0x2d0ebe[_0xcd0f('0x52')],null))[_0xcd0f('0x25')](respondWithResult(_0xcae58d,null))['catch'](handleError(_0xcae58d,null));};exports[_0xcd0f('0x26')]=function(_0x3ae4ce,_0x1da3ee){return db[_0xcd0f('0x41')]['find']({'where':{'id':_0x3ae4ce['params']['id']}})['then'](handleEntityNotFound(_0x1da3ee,null))['then'](removeEntity(_0x1da3ee,null))['catch'](handleError(_0x1da3ee,null));}; \ No newline at end of file +var _0xf076=['stack','name','Pause','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','get','Pauses','UserProfileResource','destroy','error'];(function(_0x46ad22,_0x5dd46e){var _0x20fe9c=function(_0x5b7aff){while(--_0x5b7aff){_0x46ad22['push'](_0x46ad22['shift']());}};_0x20fe9c(++_0x5dd46e);}(_0xf076,0x72));var _0x6f07=function(_0x182d1a,_0x20981e){_0x182d1a=_0x182d1a-0x0;var _0xf1e587=_0xf076[_0x182d1a];return _0xf1e587;};'use strict';var emlformat=require(_0x6f07('0x0'));var rimraf=require(_0x6f07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6f07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6f07('0x3'));var util=require(_0x6f07('0x4'));var path=require(_0x6f07('0x5'));var sox=require(_0x6f07('0x6'));var csv=require(_0x6f07('0x7'));var ejs=require(_0x6f07('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f07('0x9'));var squel=require('squel');var crypto=require(_0x6f07('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6f07('0xb'));var toCsv=require(_0x6f07('0x7'));var querystring=require(_0x6f07('0xc'));var Papa=require(_0x6f07('0xd'));var Redis=require(_0x6f07('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f07('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f07('0x10'));var logger=require(_0x6f07('0x11'))(_0x6f07('0x12'));var utils=require('../../config/utils');var config=require(_0x6f07('0x13'));var licenseUtil=require(_0x6f07('0x14'));var db=require(_0x6f07('0x15'))['db'];function respondWithStatusCode(_0xca11a5,_0x24c5e1){_0x24c5e1=_0x24c5e1||0xcc;return function(_0xa2bad5){if(_0xa2bad5){return _0xca11a5[_0x6f07('0x16')](_0x24c5e1);}return _0xca11a5[_0x6f07('0x17')](_0x24c5e1)[_0x6f07('0x18')]();};}function respondWithResult(_0x1540e3,_0x1317dd){_0x1317dd=_0x1317dd||0xc8;return function(_0x191188){if(_0x191188){return _0x1540e3[_0x6f07('0x17')](_0x1317dd)['json'](_0x191188);}};}function respondWithFilteredResult(_0x255ede,_0x5355c5){return function(_0x40e1be){if(_0x40e1be){var _0x1e5a74=typeof _0x5355c5[_0x6f07('0x19')]===_0x6f07('0x1a')&&typeof _0x5355c5[_0x6f07('0x1b')]==='undefined';var _0x3e2e35=_0x40e1be[_0x6f07('0x1c')];var _0x15cd4e=_0x1e5a74?0x0:_0x5355c5[_0x6f07('0x19')];var _0x238713=_0x1e5a74?_0x40e1be[_0x6f07('0x1c')]:_0x5355c5[_0x6f07('0x19')]+_0x5355c5[_0x6f07('0x1b')];var _0x4c9b51;if(_0x238713>=_0x3e2e35){_0x238713=_0x3e2e35;_0x4c9b51=0xc8;}else{_0x4c9b51=0xce;}_0x255ede[_0x6f07('0x17')](_0x4c9b51);return _0x255ede[_0x6f07('0x1d')](_0x6f07('0x1e'),_0x15cd4e+'-'+_0x238713+'/'+_0x3e2e35)[_0x6f07('0x1f')](_0x40e1be);}return null;};}function patchUpdates(_0x475326){return function(_0x41b9bc){try{jsonpatch['apply'](_0x41b9bc,_0x475326,!![]);}catch(_0x19297f){return BPromise[_0x6f07('0x20')](_0x19297f);}return _0x41b9bc['save']();};}function saveUpdates(_0x291d08,_0x558a3b){return function(_0x3b3fd6){if(_0x3b3fd6){return _0x3b3fd6[_0x6f07('0x21')](_0x291d08)[_0x6f07('0x22')](function(_0x57528f){return _0x57528f;});}return null;};}function removeEntity(_0x3a9670,_0x1cd1df){return function(_0x57b0bb){if(_0x57b0bb){return _0x57b0bb['destroy']()[_0x6f07('0x22')](function(){var _0x585963=_0x57b0bb[_0x6f07('0x23')]({'plain':!![]});var _0xd19440=_0x6f07('0x24');return db[_0x6f07('0x25')][_0x6f07('0x26')]({'where':{'type':_0xd19440,'resourceId':_0x585963['id']}})[_0x6f07('0x22')](function(){return _0x57b0bb;});})[_0x6f07('0x22')](function(){_0x3a9670[_0x6f07('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4717ba,_0x555fd5){return function(_0x3b7ff4){if(!_0x3b7ff4){_0x4717ba[_0x6f07('0x16')](0x194);}return _0x3b7ff4;};}function handleError(_0x672611,_0x209c48){_0x209c48=_0x209c48||0x1f4;return function(_0x33ba02){logger[_0x6f07('0x27')](_0x33ba02[_0x6f07('0x28')]);if(_0x33ba02[_0x6f07('0x29')]){delete _0x33ba02[_0x6f07('0x29')];}_0x672611[_0x6f07('0x17')](_0x209c48)['send'](_0x33ba02);};}exports['index']=function(_0x5ec30b,_0x462161){var _0x57bed2={},_0x2baa00={},_0x530a03={'count':0x0,'rows':[]};var _0x865f7c=_['map'](db[_0x6f07('0x2a')][_0x6f07('0x2b')],function(_0x3e86f6){return{'name':_0x3e86f6[_0x6f07('0x2c')],'type':_0x3e86f6['type']['key']};});_0x2baa00[_0x6f07('0x2d')]=_[_0x6f07('0x2e')](_0x865f7c,_0x6f07('0x29'));_0x2baa00[_0x6f07('0x2f')]=_[_0x6f07('0x30')](_0x5ec30b['query']);_0x2baa00[_0x6f07('0x31')]=_[_0x6f07('0x32')](_0x2baa00[_0x6f07('0x2d')],_0x2baa00['query']);_0x57bed2[_0x6f07('0x33')]=_[_0x6f07('0x32')](_0x2baa00[_0x6f07('0x2d')],qs[_0x6f07('0x34')](_0x5ec30b['query']['fields']));_0x57bed2[_0x6f07('0x33')]=_0x57bed2['attributes'][_0x6f07('0x35')]?_0x57bed2[_0x6f07('0x33')]:_0x2baa00[_0x6f07('0x2d')];if(!_0x5ec30b[_0x6f07('0x2f')][_0x6f07('0x36')](_0x6f07('0x37'))){_0x57bed2[_0x6f07('0x1b')]=qs['limit'](_0x5ec30b[_0x6f07('0x2f')]['limit']);_0x57bed2[_0x6f07('0x19')]=qs['offset'](_0x5ec30b['query'][_0x6f07('0x19')]);}_0x57bed2[_0x6f07('0x38')]=qs[_0x6f07('0x39')](_0x5ec30b[_0x6f07('0x2f')][_0x6f07('0x39')]);_0x57bed2['where']=qs[_0x6f07('0x31')](_[_0x6f07('0x3a')](_0x5ec30b[_0x6f07('0x2f')],_0x2baa00[_0x6f07('0x31')]),_0x865f7c);if(_0x5ec30b[_0x6f07('0x2f')][_0x6f07('0x3b')]){_0x57bed2['where']=_[_0x6f07('0x3c')](_0x57bed2[_0x6f07('0x3d')],{'$or':_['map'](_0x865f7c,function(_0x16cbb2){if(_0x16cbb2['type']!==_0x6f07('0x3e')){var _0x29e093={};_0x29e093[_0x16cbb2[_0x6f07('0x29')]]={'$like':'%'+_0x5ec30b['query'][_0x6f07('0x3b')]+'%'};return _0x29e093;}})});}_0x57bed2=_[_0x6f07('0x3c')]({},_0x57bed2,_0x5ec30b['options']);var _0x52ecbd={'where':_0x57bed2[_0x6f07('0x3d')]};return db[_0x6f07('0x2a')][_0x6f07('0x1c')](_0x52ecbd)[_0x6f07('0x22')](function(_0x59e6d9){_0x530a03[_0x6f07('0x1c')]=_0x59e6d9;if(_0x5ec30b[_0x6f07('0x2f')][_0x6f07('0x3f')]){_0x57bed2[_0x6f07('0x40')]=[{'all':!![]}];}return db['Pause'][_0x6f07('0x41')](_0x57bed2);})[_0x6f07('0x22')](function(_0x38833d){_0x530a03[_0x6f07('0x42')]=_0x38833d;return _0x530a03;})[_0x6f07('0x22')](respondWithFilteredResult(_0x462161,_0x57bed2))[_0x6f07('0x43')](handleError(_0x462161,null));};exports['show']=function(_0x327582,_0x367790){var _0xe6963a={'raw':!![],'where':{'id':_0x327582[_0x6f07('0x44')]['id']}},_0x456396={};_0x456396['model']=_[_0x6f07('0x30')](db[_0x6f07('0x2a')][_0x6f07('0x2b')]);_0x456396[_0x6f07('0x2f')]=_[_0x6f07('0x30')](_0x327582[_0x6f07('0x2f')]);_0x456396[_0x6f07('0x31')]=_[_0x6f07('0x32')](_0x456396[_0x6f07('0x2d')],_0x456396[_0x6f07('0x2f')]);_0xe6963a[_0x6f07('0x33')]=_[_0x6f07('0x32')](_0x456396['model'],qs[_0x6f07('0x34')](_0x327582[_0x6f07('0x2f')][_0x6f07('0x34')]));_0xe6963a[_0x6f07('0x33')]=_0xe6963a[_0x6f07('0x33')][_0x6f07('0x35')]?_0xe6963a[_0x6f07('0x33')]:_0x456396[_0x6f07('0x2d')];if(_0x327582[_0x6f07('0x2f')][_0x6f07('0x3f')]){_0xe6963a[_0x6f07('0x40')]=[{'all':!![]}];}_0xe6963a=_[_0x6f07('0x3c')]({},_0xe6963a,_0x327582[_0x6f07('0x45')]);return db[_0x6f07('0x2a')][_0x6f07('0x46')](_0xe6963a)['then'](handleEntityNotFound(_0x367790,null))[_0x6f07('0x22')](respondWithResult(_0x367790,null))['catch'](handleError(_0x367790,null));};exports['create']=function(_0x57ae68,_0xe0ace){return db['Pause'][_0x6f07('0x47')](_0x57ae68[_0x6f07('0x48')],{})[_0x6f07('0x22')](function(_0x129283){var _0x43bf97=_0x57ae68[_0x6f07('0x49')]['get']({'plain':!![]});if(!_0x43bf97)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43bf97['role']===_0x6f07('0x49')){var _0x29150f=_0x129283[_0x6f07('0x23')]({'plain':!![]});var _0x29aa81=_0x6f07('0x24');return db[_0x6f07('0x4a')]['find']({'where':{'name':_0x29aa81,'userProfileId':_0x43bf97['userProfileId']},'raw':!![]})['then'](function(_0x166bc9){if(_0x166bc9&&_0x166bc9[_0x6f07('0x4b')]===0x0){return db['UserProfileResource'][_0x6f07('0x47')]({'name':_0x29150f['name'],'resourceId':_0x29150f['id'],'type':_0x166bc9[_0x6f07('0x29')],'sectionId':_0x166bc9['id']},{})['then'](function(){return _0x129283;});}else{return _0x129283;}})[_0x6f07('0x43')](function(_0x5c53f0){logger[_0x6f07('0x27')](_0x6f07('0x4c'),_0x5c53f0);throw _0x5c53f0;});}return _0x129283;})[_0x6f07('0x22')](respondWithResult(_0xe0ace,0xc9))[_0x6f07('0x43')](handleError(_0xe0ace,null));};exports['update']=function(_0x17ca43,_0x44cd1d){if(_0x17ca43['body']['id']){delete _0x17ca43[_0x6f07('0x48')]['id'];}return db[_0x6f07('0x2a')][_0x6f07('0x46')]({'where':{'id':_0x17ca43[_0x6f07('0x44')]['id']}})[_0x6f07('0x22')](handleEntityNotFound(_0x44cd1d,null))[_0x6f07('0x22')](saveUpdates(_0x17ca43['body'],null))[_0x6f07('0x22')](respondWithResult(_0x44cd1d,null))[_0x6f07('0x43')](handleError(_0x44cd1d,null));};exports[_0x6f07('0x26')]=function(_0x4a3b51,_0x578004){return db[_0x6f07('0x2a')][_0x6f07('0x46')]({'where':{'id':_0x4a3b51[_0x6f07('0x44')]['id']}})[_0x6f07('0x22')](handleEntityNotFound(_0x578004,null))[_0x6f07('0x22')](removeEntity(_0x578004,null))[_0x6f07('0x43')](handleError(_0x578004,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6e45f95..4206fed 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x12e5ca,_0x2d0158){var _0x9e5b6b=function(_0x38ad22){while(--_0x38ad22){_0x12e5ca['push'](_0x12e5ca['shift']());}};_0x9e5b6b(++_0x2d0158);}(_0xf494,0x1c6));var _0x4f49=function(_0x4f97bb,_0x3506c0){_0x4f97bb=_0x4f97bb-0x0;var _0x371e09=_0xf494[_0x4f97bb];return _0x371e09;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x5f1b79,_0x49d61d){var _0x2f87ae=function(_0x3879c9){while(--_0x3879c9){_0x5f1b79['push'](_0x5f1b79['shift']());}};_0x2f87ae(++_0x49d61d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x5fc3[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 027f5b8..c73c059 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(_0x5e4e99,_0x3ef596){var _0x181632=function(_0x5cba8a){while(--_0x5cba8a){_0x5e4e99['push'](_0x5e4e99['shift']());}};_0x181632(++_0x3ef596);}(_0xb10b,0x12a));var _0xbb10=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0xb10b[_0x52980f];return _0x1f52a1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x579da3,_0x4108ea){var _0x5c0fbd=function(_0x489a1e){while(--_0x489a1e){_0x579da3['push'](_0x579da3['shift']());}};_0x5c0fbd(++_0x4108ea);}(_0x7a54,0x106));var _0x47a5=function(_0x3101b2,_0x1a66cc){_0x3101b2=_0x3101b2-0x0;var _0x5b832b=_0x7a54[_0x3101b2];return _0x5b832b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a4c85ee..515ab2e 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 _0xca66=['file','upload','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single'];(function(_0x37a8f5,_0x5037d9){var _0x49c3b5=function(_0x5ad2e3){while(--_0x5ad2e3){_0x37a8f5['push'](_0x37a8f5['shift']());}};_0x49c3b5(++_0x5037d9);}(_0xca66,0x8b));var _0x6ca6=function(_0x4d3e29,_0x3b1037){_0x4d3e29=_0x4d3e29-0x0;var _0x50a0d6=_0xca66[_0x4d3e29];return _0x50a0d6;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./plugin.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),controller[_0x6ca6('0xa')]);router[_0x6ca6('0x6')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xb')]);router[_0x6ca6('0x6')](_0x6ca6('0xc'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xd')]);var upload=multer({'storage':multer[_0x6ca6('0xe')]({'destination':function(_0x55a626,_0x38678e,_0xe39235){_0xe39235(null,path[_0x6ca6('0xf')](config[_0x6ca6('0x10')],_0x6ca6('0x11')));},'filename':function(_0x41e903,_0x4c05e9,_0x152e63){_0x4c05e9[_0x6ca6('0x12')]=_0x4c05e9['originalname'][_0x6ca6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x152e63(null,util[_0x6ca6('0x14')](_0x6ca6('0x15'),path[_0x6ca6('0x16')](_0x4c05e9[_0x6ca6('0x12')],path[_0x6ca6('0x17')](_0x4c05e9['originalname'])),Date['now'](),path['extname'](_0x4c05e9[_0x6ca6('0x12')])));}})});router[_0x6ca6('0x18')]('/',upload[_0x6ca6('0x19')](_0x6ca6('0x1a')),controller[_0x6ca6('0x1b')]);router[_0x6ca6('0x18')](_0x6ca6('0x9'),controller['webhookPost']);router[_0x6ca6('0x1c')](_0x6ca6('0x1d'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x1e')]);router[_0x6ca6('0x1f')](_0x6ca6('0x1d'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x1f')]);module[_0x6ca6('0x20')]=router; \ No newline at end of file +var _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x2daf7b,_0x310791){var _0x4a1f8c=function(_0x1cb2f8){while(--_0x1cb2f8){_0x2daf7b['push'](_0x2daf7b['shift']());}};_0x4a1f8c(++_0x310791);}(_0x4c4e,0x152));var _0xe4c4=function(_0x190643,_0x384072){_0x190643=_0x190643-0x0;var _0x37082e=_0x4c4e[_0x190643];return _0x37082e;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 6137d08..d7b1230 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 _0x3d78=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','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.'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3d78,0xf4));var _0x83d7=function(_0x92db67,_0x40d125){_0x92db67=_0x92db67-0x0;var _0x3372b8=_0x3d78[_0x92db67];return _0x3372b8;};'use strict';var Sequelize=require(_0x83d7('0x0'));module[_0x83d7('0x1')]={'name':{'type':Sequelize[_0x83d7('0x2')]},'type':{'type':Sequelize[_0x83d7('0x3')](_0x83d7('0x4'),_0x83d7('0x5'))},'description':{'type':Sequelize[_0x83d7('0x6')]},'version':{'type':Sequelize[_0x83d7('0x6')]},'path':{'type':Sequelize[_0x83d7('0x2')],'comment':_0x83d7('0x7')},'active':{'type':Sequelize[_0x83d7('0x8')],'defaultValue':0x0,'comment':_0x83d7('0x9')},'sidebar':{'type':Sequelize[_0x83d7('0x3')](_0x83d7('0xa'),_0x83d7('0xb'),_0x83d7('0xc'),'never'),'defaultValue':'always','comment':_0x83d7('0xd')},'icon':{'type':Sequelize[_0x83d7('0x2')]},'adminUrl':{'type':Sequelize[_0x83d7('0x2')]},'agentUrl':{'type':Sequelize[_0x83d7('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x83d7('0x2')]}}; \ No newline at end of file +var _0x3112=['ENUM','agentOnly','always','exports','STRING','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.'];(function(_0x43cbe3,_0xcdcc47){var _0x4e9b69=function(_0x2ce368){while(--_0x2ce368){_0x43cbe3['push'](_0x43cbe3['shift']());}};_0x4e9b69(++_0xcdcc47);}(_0x3112,0xbe));var _0x2311=function(_0x3c0095,_0x301a4e){_0x3c0095=_0x3c0095-0x0;var _0xb03aab=_0x3112[_0x3c0095];return _0xb03aab;};'use strict';var Sequelize=require('sequelize');module[_0x2311('0x0')]={'name':{'type':Sequelize[_0x2311('0x1')]},'type':{'type':Sequelize['ENUM'](_0x2311('0x2'),_0x2311('0x3'))},'description':{'type':Sequelize[_0x2311('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x2311('0x1')],'comment':_0x2311('0x5')},'active':{'type':Sequelize[_0x2311('0x6')],'defaultValue':0x0,'comment':_0x2311('0x7')},'sidebar':{'type':Sequelize[_0x2311('0x8')]('adminOnly',_0x2311('0x9'),_0x2311('0xa'),'never'),'defaultValue':_0x2311('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x2311('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x2311('0x1')]},'scriptName':{'type':Sequelize[_0x2311('0x1')]},'scriptPath':{'type':Sequelize[_0x2311('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 4054c96..21eee10 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 _0xa223=['where','pick','filter','merge','options','show','params','rawAttributes','length','includeAll','include','find','download','path','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','attachments/**/*','finalize','existsSync','Sequelize','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','file','filename','extname','root','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','Plugins','UserProfileResource','error','send','index','map','Plugin','fieldName','type','name','keys','query','filters','model','attributes','intersection','fields','order','sort'];(function(_0x37ad5a,_0x55b590){var _0x1ab506=function(_0xef28bc){while(--_0xef28bc){_0x37ad5a['push'](_0x37ad5a['shift']());}};_0x1ab506(++_0x55b590);}(_0xa223,0x6a));var _0x3a22=function(_0x473cfd,_0x2d1735){_0x473cfd=_0x473cfd-0x0;var _0x32871d=_0xa223[_0x473cfd];return _0x32871d;};'use strict';var emlformat=require(_0x3a22('0x0'));var rimraf=require(_0x3a22('0x1'));var zipdir=require(_0x3a22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a22('0x3'));var moment=require('moment');var BPromise=require(_0x3a22('0x4'));var Mustache=require('mustache');var util=require(_0x3a22('0x5'));var path=require('path');var sox=require(_0x3a22('0x6'));var csv=require('to-csv');var ejs=require(_0x3a22('0x7'));var fs=require('fs');var fs_extra=require(_0x3a22('0x8'));var _=require(_0x3a22('0x9'));var squel=require(_0x3a22('0xa'));var crypto=require(_0x3a22('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3a22('0xc'));var toCsv=require(_0x3a22('0xd'));var querystring=require(_0x3a22('0xe'));var Papa=require(_0x3a22('0xf'));var extract=require(_0x3a22('0x10'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x3a22('0x11'));var authService=require(_0x3a22('0x12'));var qs=require(_0x3a22('0x13'));var as=require(_0x3a22('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a22('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3a22('0x16'));var licenseUtil=require(_0x3a22('0x17'));var db=require(_0x3a22('0x18'))['db'];config['redis']=_[_0x3a22('0x19')](config[_0x3a22('0x1a')],{'host':_0x3a22('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3a22('0x1c'))[_0x3a22('0x1d')](socket);function respondWithStatusCode(_0x5732d2,_0x564687){_0x564687=_0x564687||0xcc;return function(_0x390710){if(_0x390710){return _0x5732d2[_0x3a22('0x1e')](_0x564687);}return _0x5732d2[_0x3a22('0x1f')](_0x564687)[_0x3a22('0x20')]();};}function respondWithResult(_0x63453c,_0xc4e427){_0xc4e427=_0xc4e427||0xc8;return function(_0x21342e){if(_0x21342e){return _0x63453c['status'](_0xc4e427)[_0x3a22('0x21')](_0x21342e);}};}function respondWithFilteredResult(_0x18301a,_0x5b89b7){return function(_0x503bbc){if(_0x503bbc){var _0x458811=typeof _0x5b89b7[_0x3a22('0x22')]===_0x3a22('0x23')&&typeof _0x5b89b7[_0x3a22('0x24')]===_0x3a22('0x23');var _0xd3bb02=_0x503bbc[_0x3a22('0x25')];var _0x52d4ad=_0x458811?0x0:_0x5b89b7[_0x3a22('0x22')];var _0x41875e=_0x458811?_0x503bbc[_0x3a22('0x25')]:_0x5b89b7['offset']+_0x5b89b7[_0x3a22('0x24')];var _0x57b36f;if(_0x41875e>=_0xd3bb02){_0x41875e=_0xd3bb02;_0x57b36f=0xc8;}else{_0x57b36f=0xce;}_0x18301a['status'](_0x57b36f);return _0x18301a[_0x3a22('0x26')](_0x3a22('0x27'),_0x52d4ad+'-'+_0x41875e+'/'+_0xd3bb02)['json'](_0x503bbc);}return null;};}function patchUpdates(_0x2e3440){return function(_0x459a35){try{jsonpatch['apply'](_0x459a35,_0x2e3440,!![]);}catch(_0x1a589f){return BPromise[_0x3a22('0x28')](_0x1a589f);}return _0x459a35[_0x3a22('0x29')]();};}function saveUpdates(_0x239e66,_0x18fd62){return function(_0xfd24fe){if(_0xfd24fe){return _0xfd24fe['update'](_0x239e66)[_0x3a22('0x2a')](function(_0x5e68bc){return _0x5e68bc;});}return null;};}function removeEntity(_0x4024f9,_0x21c168){return function(_0x23de01){if(_0x23de01){return _0x23de01[_0x3a22('0x2b')]()[_0x3a22('0x2a')](function(){var _0x468f08=_0x23de01[_0x3a22('0x2c')]({'plain':!![]});var _0x1eb69b=_0x3a22('0x2d');return db[_0x3a22('0x2e')][_0x3a22('0x2b')]({'where':{'type':_0x1eb69b,'resourceId':_0x468f08['id']}})[_0x3a22('0x2a')](function(){return _0x23de01;});})[_0x3a22('0x2a')](function(){_0x4024f9[_0x3a22('0x1f')](0xcc)[_0x3a22('0x20')]();});}};}function handleEntityNotFound(_0x151201,_0x31afa6){return function(_0x18bcfe){if(!_0x18bcfe){_0x151201['sendStatus'](0x194);}return _0x18bcfe;};}function handleError(_0x2fccdd,_0x298ba5){_0x298ba5=_0x298ba5||0x1f4;return function(_0x2ad96e){logger[_0x3a22('0x2f')](_0x2ad96e['stack']);if(_0x2ad96e['name']){delete _0x2ad96e['name'];}_0x2fccdd[_0x3a22('0x1f')](_0x298ba5)[_0x3a22('0x30')](_0x2ad96e);};}exports[_0x3a22('0x31')]=function(_0x31b3cf,_0x6329d4){var _0x4bff21={},_0x1d0018={},_0xa068b3={'count':0x0,'rows':[]};var _0x77f255=_[_0x3a22('0x32')](db[_0x3a22('0x33')]['rawAttributes'],function(_0x25c43d){return{'name':_0x25c43d[_0x3a22('0x34')],'type':_0x25c43d[_0x3a22('0x35')]['key']};});_0x1d0018['model']=_[_0x3a22('0x32')](_0x77f255,_0x3a22('0x36'));_0x1d0018['query']=_[_0x3a22('0x37')](_0x31b3cf[_0x3a22('0x38')]);_0x1d0018[_0x3a22('0x39')]=_['intersection'](_0x1d0018[_0x3a22('0x3a')],_0x1d0018['query']);_0x4bff21[_0x3a22('0x3b')]=_[_0x3a22('0x3c')](_0x1d0018[_0x3a22('0x3a')],qs[_0x3a22('0x3d')](_0x31b3cf['query'][_0x3a22('0x3d')]));_0x4bff21[_0x3a22('0x3b')]=_0x4bff21[_0x3a22('0x3b')]['length']?_0x4bff21[_0x3a22('0x3b')]:_0x1d0018['model'];if(!_0x31b3cf[_0x3a22('0x38')]['hasOwnProperty']('nolimit')){_0x4bff21['limit']=qs[_0x3a22('0x24')](_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x24')]);_0x4bff21['offset']=qs['offset'](_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x22')]);}_0x4bff21[_0x3a22('0x3e')]=qs['sort'](_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x3f')]);_0x4bff21[_0x3a22('0x40')]=qs['filters'](_[_0x3a22('0x41')](_0x31b3cf[_0x3a22('0x38')],_0x1d0018[_0x3a22('0x39')]),_0x77f255);if(_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x42')]){_0x4bff21[_0x3a22('0x40')]=_[_0x3a22('0x43')](_0x4bff21['where'],{'$or':_[_0x3a22('0x32')](_0x77f255,function(_0x1d5b55){if(_0x1d5b55['type']!=='VIRTUAL'){var _0x2b781b={};_0x2b781b[_0x1d5b55['name']]={'$like':'%'+_0x31b3cf[_0x3a22('0x38')][_0x3a22('0x42')]+'%'};return _0x2b781b;}})});}_0x4bff21=_[_0x3a22('0x43')]({},_0x4bff21,_0x31b3cf[_0x3a22('0x44')]);var _0x5d8dcd={'where':_0x4bff21[_0x3a22('0x40')]};return db[_0x3a22('0x33')]['count'](_0x5d8dcd)[_0x3a22('0x2a')](function(_0x2bc135){_0xa068b3[_0x3a22('0x25')]=_0x2bc135;if(_0x31b3cf[_0x3a22('0x38')]['includeAll']){_0x4bff21['include']=[{'all':!![]}];}return db[_0x3a22('0x33')]['findAll'](_0x4bff21);})[_0x3a22('0x2a')](function(_0x3e6c4d){_0xa068b3['rows']=_0x3e6c4d;return _0xa068b3;})[_0x3a22('0x2a')](respondWithFilteredResult(_0x6329d4,_0x4bff21))['catch'](handleError(_0x6329d4,null));};exports[_0x3a22('0x45')]=function(_0x54a6f7,_0x4eca8d){var _0x57c991={'raw':!![],'where':{'id':_0x54a6f7[_0x3a22('0x46')]['id']}},_0x896545={};_0x896545['model']=_['keys'](db[_0x3a22('0x33')][_0x3a22('0x47')]);_0x896545[_0x3a22('0x38')]=_['keys'](_0x54a6f7[_0x3a22('0x38')]);_0x896545['filters']=_['intersection'](_0x896545[_0x3a22('0x3a')],_0x896545['query']);_0x57c991['attributes']=_[_0x3a22('0x3c')](_0x896545[_0x3a22('0x3a')],qs['fields'](_0x54a6f7[_0x3a22('0x38')][_0x3a22('0x3d')]));_0x57c991['attributes']=_0x57c991[_0x3a22('0x3b')][_0x3a22('0x48')]?_0x57c991[_0x3a22('0x3b')]:_0x896545['model'];if(_0x54a6f7[_0x3a22('0x38')][_0x3a22('0x49')]){_0x57c991[_0x3a22('0x4a')]=[{'all':!![]}];}_0x57c991=_[_0x3a22('0x43')]({},_0x57c991,_0x54a6f7['options']);return db[_0x3a22('0x33')][_0x3a22('0x4b')](_0x57c991)[_0x3a22('0x2a')](handleEntityNotFound(_0x4eca8d,null))[_0x3a22('0x2a')](respondWithResult(_0x4eca8d,null))['catch'](handleError(_0x4eca8d,null));};exports[_0x3a22('0x4c')]=function(_0x2c8697,_0x3f70eb,_0x278d44){return db[_0x3a22('0x33')][_0x3a22('0x4b')]({'where':{'id':_0x2c8697[_0x3a22('0x46')]['id']},'attributes':[_0x3a22('0x36'),_0x3a22('0x4d')],'raw':!![]})[_0x3a22('0x2a')](handleEntityNotFound(_0x3f70eb,null))[_0x3a22('0x2a')](function(_0x43f5bf){if(_0x43f5bf){var _0x5dee46=path[_0x3a22('0x4e')](config['root'],_0x3a22('0x4f'),util[_0x3a22('0x50')](_0x3a22('0x51'),path[_0x3a22('0x52')](_0x43f5bf['path'])));var _0x594b28=fs[_0x3a22('0x53')](_0x5dee46);var _0xa84a14=archiver(_0x3a22('0x54'),{'zlib':{'level':0x9}});_0xa84a14['on'](_0x3a22('0x55'),function(_0x18f5a6){if(_0x18f5a6[_0x3a22('0x56')]===_0x3a22('0x57')){logger['error'](_0x18f5a6);}else{throw new db['Sequelize']['Error'](_0x3a22('0x58'));}});_0xa84a14['on'](_0x3a22('0x2f'),function(_0x5c22fe){throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xa84a14[_0x3a22('0x59')](_0x594b28);_0xa84a14[_0x3a22('0x5a')](_0x3a22('0x5b'),{'cwd':path[_0x3a22('0x4e')](config['root'],'server/files/plugins',path[_0x3a22('0x5c')](_0x43f5bf[_0x3a22('0x4d')])),'ignore':[path[_0x3a22('0x4e')](path[_0x3a22('0x52')](_0x43f5bf[_0x3a22('0x4d')]),'node_modules/**/*'),path[_0x3a22('0x4e')](path[_0x3a22('0x52')](_0x43f5bf[_0x3a22('0x4d')]),_0x3a22('0x5d'))],'nodir':!![]})[_0x3a22('0x5e')]();_0x594b28['on']('close',function(){if(!fs[_0x3a22('0x5f')](_0x5dee46)){throw new db[(_0x3a22('0x60'))][(_0x3a22('0x61'))](_0x3a22('0x62'));}return _0x3f70eb['download'](_0x5dee46,util[_0x3a22('0x50')](_0x3a22('0x51'),path['basename'](_0x43f5bf['path'])),function(_0x4e3238){if(_0x4e3238){throw new db[(_0x3a22('0x60'))]['Error'](_0x3a22('0x63'));}fs[_0x3a22('0x64')](_0x5dee46);logger[_0x3a22('0x65')](_0x3a22('0x66'));logger[_0x3a22('0x65')](_0x3a22('0x67'));});});}return null;})[_0x3a22('0x68')](handleError(_0x3f70eb,null));};exports[_0x3a22('0x69')]=function(_0x1550c9,_0x5ca7fb,_0xd1971e){var _0x119bb3=path['basename'](_0x1550c9[_0x3a22('0x6a')][_0x3a22('0x6b')],path[_0x3a22('0x6c')](_0x1550c9['file'][_0x3a22('0x6b')]));var _0x41526f=path[_0x3a22('0x4e')](config[_0x3a22('0x6d')],_0x3a22('0x4f'),_0x1550c9[_0x3a22('0x6a')][_0x3a22('0x6b')]);var _0x3765cd=path['join'](config[_0x3a22('0x6d')],_0x3a22('0x4f'),_0x119bb3);logger[_0x3a22('0x65')]('Plugin\x20upload\x20filepath:\x20%s',_0x41526f);logger[_0x3a22('0x65')](_0x3a22('0x6e'),_0x3765cd);try{fs['chmodSync'](_0x41526f,parseInt(_0x3a22('0x6f'),0x8));extract(_0x41526f,{'dir':_0x3765cd},function(_0x597d77){if(_0x597d77){logger['error'](_0x597d77);handleError(_0x597d77,!![]);};var _0x429978=fs['readdirSync'](_0x3765cd);if(_0x429978[_0x3a22('0x48')]>0x1){removeReferences(_0x41526f,_0x3765cd);logger[_0x3a22('0x2f')](_0x3a22('0x70'));return _0xd1971e(new Error(_0x3a22('0x70')));}var _0x41d2ad=fs[_0x3a22('0x71')](path[_0x3a22('0x4e')](_0x3765cd,_0x429978[0x0]));if(_0x41d2ad[_0x3a22('0x72')]()){removeReferences(_0x41526f,_0x3765cd);logger[_0x3a22('0x2f')](_0x3a22('0x70'));return _0xd1971e(new Error(_0x3a22('0x70')));}if(_0x41d2ad['isDirectory']()){var _0x33d192=fs[_0x3a22('0x73')](path[_0x3a22('0x4e')](_0x3765cd,_0x429978[0x0]));if(_0x33d192['length']===0x0){removeReferences(_0x41526f,_0x3765cd);logger[_0x3a22('0x2f')](_0x3a22('0x70'));return _0xd1971e(new Error(_0x3a22('0x70')));}var _0x58a34f=_0x33d192[_0x3a22('0x74')](function(_0x3a82b6){return _0x3a82b6===_0x3a22('0x75');});if(!_0x58a34f){return _0xd1971e(new Error(_0x3a22('0x76')));}var _0x313d65=fs[_0x3a22('0x77')](path['join'](_0x3765cd,_0x429978[0x0],'manifest.json'));var _0xdd0805=JSON[_0x3a22('0x78')](_0x313d65);if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x36')]){return _0xd1971e(new Error(_0x3a22('0x79')));}if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x35')]){return _0xd1971e(new Error(_0x3a22('0x7a')));}if('undefined'==typeof _0xdd0805[_0x3a22('0x7b')]){return _0xd1971e(new Error(_0x3a22('0x7c')));}if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x7d')]){return _0xd1971e(new Error(_0x3a22('0x7e')));}if(_0xdd0805[_0x3a22('0x35')]===_0x3a22('0x7f')){if(_0x3a22('0x23')==typeof _0xdd0805[_0x3a22('0x7d')]['views']){return _0xd1971e(new Error(_0x3a22('0x80')));}if(_0x3a22('0x23')==typeof _0xdd0805['parameters'][_0x3a22('0x81')][_0x3a22('0x82')]&&_0x3a22('0x23')==typeof _0xdd0805['parameters'][_0x3a22('0x81')]['agent']){return _0xd1971e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0xdd0805[_0x3a22('0x35')]===_0x3a22('0x83')){if(_0x3a22('0x23')==typeof _0xdd0805['parameters']['scriptName']){return _0xd1971e(new Error(_0x3a22('0x84')));}if('undefined'==typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x85')]){return _0xd1971e(new Error(_0x3a22('0x86')));}}else{return _0xd1971e(new Error(_0x3a22('0x87')));}var _0x1f117a=_0xdd0805[_0x3a22('0x36')];var _0x16cdd6=_0xdd0805[_0x3a22('0x88')];var _0x17f8c6=_0xdd0805['type'];var _0x1dd295=_0xdd0805[_0x3a22('0x89')]?_0xdd0805[_0x3a22('0x89')]:'always';var _0x4be524=_0xdd0805[_0x3a22('0x8a')]?_0xdd0805[_0x3a22('0x8a')]:_0x3a22('0x8b');var _0x424e43='';var _0x371f55='';var _0x2d3587='';var _0x2a858d='';var _0x42fee5=_0xdd0805[_0x3a22('0x7b')];if(_0x17f8c6===_0x3a22('0x7f')){if('undefined'!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x82')]){var _0xad601f=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x3a22('0x8c')](_0xad601f)){_0x424e43=path[_0x3a22('0x4e')]('plugins',_0x119bb3,_0x429978[0x0],_0xad601f);}else{_0x424e43=_0xad601f;}}else{logger[_0x3a22('0x65')](_0x3a22('0x8d'));}if(_0x3a22('0x23')!=typeof _0xdd0805[_0x3a22('0x7d')]['views'][_0x3a22('0x8e')]){var _0x4a3dc1=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x8e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4a3dc1)){_0x371f55=path[_0x3a22('0x4e')](_0x3a22('0x8f'),_0x119bb3,_0x429978[0x0],_0x4a3dc1);}else{_0x371f55=_0x4a3dc1;}}else{logger[_0x3a22('0x65')](_0x3a22('0x90'));}}else if(_0x17f8c6===_0x3a22('0x83')){_0x2d3587=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x91')];_0x2a858d=_0xdd0805['parameters'][_0x3a22('0x85')];if(_0x3a22('0x23')!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')]){if(_0x3a22('0x23')!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')][_0x3a22('0x82')]){var _0xad601f=_0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0xad601f)){_0x424e43=path['join']('plugins',_0x119bb3,_0x429978[0x0],_0xad601f);}else{_0x424e43=_0xad601f;}}if('undefined'!=typeof _0xdd0805[_0x3a22('0x7d')][_0x3a22('0x81')]['agent']){var _0x4a3dc1=_0xdd0805[_0x3a22('0x7d')]['views'][_0x3a22('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x3a22('0x8c')](_0x4a3dc1)){_0x371f55=path[_0x3a22('0x4e')](_0x3a22('0x8f'),_0x119bb3,_0x429978[0x0],_0x4a3dc1);}else{_0x371f55=_0x4a3dc1;}}}}var _0x36ffa5={'name':_0x1f117a,'description':_0x16cdd6,'path':path[_0x3a22('0x4e')](_0x119bb3,_0x429978[0x0]),'type':_0x17f8c6,'sidebar':_0x1dd295,'icon':_0x4be524,'adminUrl':_0x424e43,'agentUrl':_0x371f55,'scriptName':_0x2d3587,'scriptPath':_0x2a858d,'version':_0x42fee5};removeReferences(_0x41526f,null);return db[_0x3a22('0x33')][_0x3a22('0x92')](_0x36ffa5)[_0x3a22('0x2a')](function(_0x2ffb1f){var _0x34bb4e={'role':_0x1550c9['body'][_0x3a22('0x93')],'userProfileId':_0x1550c9[_0x3a22('0x94')][_0x3a22('0x95')]};if(!_0x34bb4e)throw new Error(_0x3a22('0x96'));if(_0x34bb4e['role']==='user'){var _0x5f544a=_0x2ffb1f[_0x3a22('0x2c')]({'plain':!![]});return db[_0x3a22('0x97')][_0x3a22('0x4b')]({'where':{'name':_0x3a22('0x2d'),'userProfileId':_0x34bb4e[_0x3a22('0x95')]},'raw':!![]})[_0x3a22('0x2a')](function(_0x54bb58){if(_0x54bb58&&_0x54bb58[_0x3a22('0x98')]===0x0){return db['UserProfileResource'][_0x3a22('0x92')]({'name':_0x5f544a[_0x3a22('0x36')],'resourceId':_0x5f544a['id'],'type':_0x54bb58[_0x3a22('0x36')],'sectionId':_0x54bb58['id']},{})['then'](function(){return _0x2ffb1f;});}else{return _0x2ffb1f;}})['catch'](function(_0x324696){logger[_0x3a22('0x2f')](_0x3a22('0x99'),_0x324696);throw _0x324696;});}return _0x2ffb1f;})[_0x3a22('0x2a')](respondWithResult(_0x5ca7fb,null))[_0x3a22('0x68')](handleError(_0x5ca7fb,null));}});}catch(_0x255411){_0x5ca7fb[_0x3a22('0x1f')](0x1f4)[_0x3a22('0x30')](_0x255411);}};function removeReferences(_0x106123,_0x3da539){try{if(_0x106123){fs['unlinkSync'](_0x106123);logger['info'](_0x3a22('0x9a'));}if(_0x3da539){rimraf(_0x3da539,function(){});logger[_0x3a22('0x65')]('Extracted\x20folder\x20removed');}}catch(_0x27bd17){logger[_0x3a22('0x2f')](_0x27bd17);}}exports['update']=function(_0x2bfd88,_0x8b1b1f,_0x27f4db){return db['Plugin']['find']({'where':{'id':_0x2bfd88[_0x3a22('0x46')]['id']}})[_0x3a22('0x2a')](handleEntityNotFound(_0x8b1b1f,null))[_0x3a22('0x2a')](saveUpdates(_0x2bfd88[_0x3a22('0x94')],null))[_0x3a22('0x2a')](respondWithResult(_0x8b1b1f,null))[_0x3a22('0x68')](handleError(_0x8b1b1f,null));};exports[_0x3a22('0x9b')]=function(_0x1c7545,_0x1c47a0,_0x409c03){return db['Plugin'][_0x3a22('0x4b')]({'where':{'id':_0x1c7545['params']['id']}})[_0x3a22('0x2a')](function(_0x558526){if(_0x558526){return _0x558526['destroy']();}})[_0x3a22('0x2a')](function(_0x48d743){rimraf(path['join'](config[_0x3a22('0x6d')],'server/files/plugins',path[_0x3a22('0x5c')](_0x48d743[_0x3a22('0x4d')])),function(){});return _0x48d743;})[_0x3a22('0x2a')](handleEntityNotFound(_0x1c47a0,null))[_0x3a22('0x2a')](respondWithStatusCode(_0x1c47a0,null))['catch'](handleError(_0x1c47a0,null));};exports['webhookGet']=function(_0x2297ff,_0x121e4a,_0x31475d){return BPromise[_0x3a22('0x9c')]()[_0x3a22('0x2a')](function(){if(!_0x2297ff[_0x3a22('0x38')][_0x3a22('0x4d')]){throw new Error(_0x3a22('0x9d'));}if(!_0x2297ff[_0x3a22('0x38')][_0x3a22('0x9e')]){throw new Error(_0x3a22('0x9f'));}var _0x3fc401=_0x2297ff[_0x3a22('0x38')][_0x3a22('0xa0')]?_0x2297ff['query'][_0x3a22('0xa0')]+':'+_0x2297ff[_0x3a22('0x38')]['port']:_0x3a22('0xa1')+_0x2297ff['query']['port'];var _0xe1e544=_0x2297ff['query']['json']?_0x2297ff['query'][_0x3a22('0x21')]:!![];var _0xa743dc=_0x2297ff[_0x3a22('0x38')]['encoding']?_0x2297ff[_0x3a22('0x38')][_0x3a22('0xa2')]:null;var _0x4f8303={'method':_0x2297ff[_0x3a22('0xa3')],'uri':util['format'](_0x3a22('0xa4'),_0x3fc401,_0x2297ff['query'][_0x3a22('0x4d')]),'json':_0xe1e544,'resolveWithFullResponse':!![],'encoding':_0xa743dc,'qs':_0x2297ff[_0x3a22('0x38')]};if(_0x2297ff[_0x3a22('0xa5')]){_0x4f8303[_0x3a22('0xa5')]=_0x2297ff['headers'];if(_0x4f8303[_0x3a22('0xa5')][_0x3a22('0xa6')]){delete _0x4f8303['headers']['content-length'];}}if(_0x4f8303['headers'][_0x3a22('0xa7')]){delete _0x4f8303[_0x3a22('0xa5')][_0x3a22('0xa7')];}return rp(_0x4f8303);})[_0x3a22('0x2a')](function(_0xa33d6){if(_0xa33d6){_0x121e4a[_0x3a22('0x26')](_0xa33d6['headers']);logger[_0x3a22('0x65')](_0xa33d6['body']);if(_[_0x3a22('0xa8')](_0x2297ff['query'][_0x3a22('0x4d')],_0x3a22('0x4c'))&&_0xa33d6[_0x3a22('0xa9')]==0x1f4){return _0x121e4a[_0x3a22('0x1e')](_0xa33d6[_0x3a22('0xa9')]);}else{return _0x121e4a[_0x3a22('0x1f')](_0xa33d6['statusCode'])['send'](_0xa33d6[_0x3a22('0x94')]);}}else{return _0x121e4a[_0x3a22('0x1e')](0xc8);}})['catch'](handleError(_0x121e4a,null));};exports['webhookPost']=function(_0x4036c1,_0x347cc3,_0x1d9c2e){return BPromise[_0x3a22('0x9c')]()[_0x3a22('0x2a')](function(){if(!_0x4036c1['query'][_0x3a22('0x4d')]){throw new Error(_0x3a22('0x9d'));}if(!_0x4036c1[_0x3a22('0x38')][_0x3a22('0x9e')]){throw new Error(_0x3a22('0x9f'));}var _0x5eaa63=_0x4036c1[_0x3a22('0x38')]['hostname']?_0x4036c1[_0x3a22('0x38')][_0x3a22('0xa0')]+':'+_0x4036c1[_0x3a22('0x38')]['port']:_0x3a22('0xa1')+_0x4036c1[_0x3a22('0x38')][_0x3a22('0x9e')];var _0x4e251b=_0x4036c1[_0x3a22('0x38')]['json']?_0x4036c1[_0x3a22('0x38')][_0x3a22('0x21')]:!![];var _0x5f5301=_0x4036c1[_0x3a22('0x38')][_0x3a22('0xa2')]?_0x4036c1['query'][_0x3a22('0xa2')]:null;var _0x3232c9={'method':_0x4036c1['method'],'uri':util['format'](_0x3a22('0xa4'),_0x5eaa63,_0x4036c1['query'][_0x3a22('0x4d')]),'json':_0x4e251b,'resolveWithFullResponse':!![],'encoding':_0x5f5301,'body':_0x4036c1[_0x3a22('0x94')]};if(_0x4036c1[_0x3a22('0xa5')]){_0x3232c9[_0x3a22('0xa5')]=_0x4036c1[_0x3a22('0xa5')];if(_0x3232c9['headers'][_0x3a22('0xa6')]){delete _0x3232c9['headers'][_0x3a22('0xa6')];}}if(_0x3232c9['headers'][_0x3a22('0xa7')]){delete _0x3232c9[_0x3a22('0xa5')][_0x3a22('0xa7')];}return rp(_0x3232c9);})[_0x3a22('0x2a')](function(_0x24b2c5){if(_0x24b2c5){_0x347cc3['set'](_0x24b2c5[_0x3a22('0xa5')]);logger[_0x3a22('0x65')](_0x24b2c5[_0x3a22('0x94')]);return _0x347cc3[_0x3a22('0x1f')](_0x24b2c5[_0x3a22('0xa9')])[_0x3a22('0x30')](_0x24b2c5[_0x3a22('0x94')]);}else{return _0x347cc3[_0x3a22('0x1e')](0xc8);}})[_0x3a22('0x68')](handleError(_0x347cc3,null));}; \ No newline at end of file +var _0x251d=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Plugins','UserProfileResource','sendStatus','stack','name','index','map','Plugin','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','rawAttributes','length','include','find','download','params','root','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','server/files/plugins','dirname','node_modules/**/*','finalize','existsSync','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','admin','views','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','create','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','method','eml-format','zip-dir','fast-json-patch'];(function(_0x2eaf6a,_0x175fec){var _0x32fa66=function(_0x3e1722){while(--_0x3e1722){_0x2eaf6a['push'](_0x2eaf6a['shift']());}};_0x32fa66(++_0x175fec);}(_0x251d,0xa4));var _0xd251=function(_0x1135cb,_0x354b1e){_0x1135cb=_0x1135cb-0x0;var _0x3b8562=_0x251d[_0x1135cb];return _0x3b8562;};'use strict';var emlformat=require(_0xd251('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd251('0x1'));var jsonpatch=require(_0xd251('0x2'));var rp=require(_0xd251('0x3'));var moment=require(_0xd251('0x4'));var BPromise=require(_0xd251('0x5'));var Mustache=require(_0xd251('0x6'));var util=require(_0xd251('0x7'));var path=require(_0xd251('0x8'));var sox=require(_0xd251('0x9'));var csv=require('to-csv');var ejs=require(_0xd251('0xa'));var fs=require('fs');var fs_extra=require(_0xd251('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd251('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd251('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd251('0xe'));var Papa=require(_0xd251('0xf'));var extract=require(_0xd251('0x10'));var rimraf=require(_0xd251('0x11'));var archiver=require('archiver');var Redis=require(_0xd251('0x12'));var authService=require(_0xd251('0x13'));var qs=require(_0xd251('0x14'));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(_0xd251('0x15'));var licenseUtil=require(_0xd251('0x16'));var db=require(_0xd251('0x17'))['db'];config[_0xd251('0x18')]=_[_0xd251('0x19')](config['redis'],{'host':_0xd251('0x1a'),'port':0x18eb});var socket=require(_0xd251('0x1b'))(new Redis(config[_0xd251('0x18')]));require(_0xd251('0x1c'))[_0xd251('0x1d')](socket);function respondWithStatusCode(_0x4054de,_0x34dcb0){_0x34dcb0=_0x34dcb0||0xcc;return function(_0x5609f1){if(_0x5609f1){return _0x4054de['sendStatus'](_0x34dcb0);}return _0x4054de[_0xd251('0x1e')](_0x34dcb0)[_0xd251('0x1f')]();};}function respondWithResult(_0x758406,_0x4d02f3){_0x4d02f3=_0x4d02f3||0xc8;return function(_0x24e6ee){if(_0x24e6ee){return _0x758406['status'](_0x4d02f3)['json'](_0x24e6ee);}};}function respondWithFilteredResult(_0x49ba49,_0x64eff2){return function(_0x5f5cc6){if(_0x5f5cc6){var _0x45a596=typeof _0x64eff2[_0xd251('0x20')]===_0xd251('0x21')&&typeof _0x64eff2[_0xd251('0x22')]===_0xd251('0x21');var _0x433c2d=_0x5f5cc6[_0xd251('0x23')];var _0x5d5330=_0x45a596?0x0:_0x64eff2[_0xd251('0x20')];var _0x30529b=_0x45a596?_0x5f5cc6['count']:_0x64eff2[_0xd251('0x20')]+_0x64eff2[_0xd251('0x22')];var _0x4902ce;if(_0x30529b>=_0x433c2d){_0x30529b=_0x433c2d;_0x4902ce=0xc8;}else{_0x4902ce=0xce;}_0x49ba49[_0xd251('0x1e')](_0x4902ce);return _0x49ba49[_0xd251('0x24')](_0xd251('0x25'),_0x5d5330+'-'+_0x30529b+'/'+_0x433c2d)[_0xd251('0x26')](_0x5f5cc6);}return null;};}function patchUpdates(_0x410eb1){return function(_0x2e7d83){try{jsonpatch[_0xd251('0x27')](_0x2e7d83,_0x410eb1,!![]);}catch(_0x50e363){return BPromise[_0xd251('0x28')](_0x50e363);}return _0x2e7d83[_0xd251('0x29')]();};}function saveUpdates(_0x2919a5,_0x1b4af0){return function(_0x5c91f6){if(_0x5c91f6){return _0x5c91f6[_0xd251('0x2a')](_0x2919a5)[_0xd251('0x2b')](function(_0x3d5291){return _0x3d5291;});}return null;};}function removeEntity(_0x127da6,_0x2b47b7){return function(_0x53d68e){if(_0x53d68e){return _0x53d68e['destroy']()[_0xd251('0x2b')](function(){var _0x450cb3=_0x53d68e[_0xd251('0x2c')]({'plain':!![]});var _0x408b4c=_0xd251('0x2d');return db[_0xd251('0x2e')]['destroy']({'where':{'type':_0x408b4c,'resourceId':_0x450cb3['id']}})[_0xd251('0x2b')](function(){return _0x53d68e;});})[_0xd251('0x2b')](function(){_0x127da6[_0xd251('0x1e')](0xcc)[_0xd251('0x1f')]();});}};}function handleEntityNotFound(_0x5ac19f,_0x2d2347){return function(_0x2bf961){if(!_0x2bf961){_0x5ac19f[_0xd251('0x2f')](0x194);}return _0x2bf961;};}function handleError(_0x5f573f,_0x473730){_0x473730=_0x473730||0x1f4;return function(_0x1b8b94){logger['error'](_0x1b8b94[_0xd251('0x30')]);if(_0x1b8b94[_0xd251('0x31')]){delete _0x1b8b94[_0xd251('0x31')];}_0x5f573f[_0xd251('0x1e')](_0x473730)['send'](_0x1b8b94);};}exports[_0xd251('0x32')]=function(_0x5e7104,_0x2decba){var _0x5aad64={},_0x1f358f={},_0x5705d5={'count':0x0,'rows':[]};var _0x448176=_[_0xd251('0x33')](db[_0xd251('0x34')]['rawAttributes'],function(_0x157bd0){return{'name':_0x157bd0[_0xd251('0x35')],'type':_0x157bd0[_0xd251('0x36')][_0xd251('0x37')]};});_0x1f358f[_0xd251('0x38')]=_[_0xd251('0x33')](_0x448176,'name');_0x1f358f[_0xd251('0x39')]=_[_0xd251('0x3a')](_0x5e7104[_0xd251('0x39')]);_0x1f358f['filters']=_[_0xd251('0x3b')](_0x1f358f[_0xd251('0x38')],_0x1f358f['query']);_0x5aad64[_0xd251('0x3c')]=_['intersection'](_0x1f358f[_0xd251('0x38')],qs[_0xd251('0x3d')](_0x5e7104[_0xd251('0x39')]['fields']));_0x5aad64[_0xd251('0x3c')]=_0x5aad64['attributes']['length']?_0x5aad64[_0xd251('0x3c')]:_0x1f358f[_0xd251('0x38')];if(!_0x5e7104[_0xd251('0x39')][_0xd251('0x3e')]('nolimit')){_0x5aad64[_0xd251('0x22')]=qs['limit'](_0x5e7104['query'][_0xd251('0x22')]);_0x5aad64[_0xd251('0x20')]=qs['offset'](_0x5e7104[_0xd251('0x39')]['offset']);}_0x5aad64[_0xd251('0x3f')]=qs[_0xd251('0x40')](_0x5e7104['query'][_0xd251('0x40')]);_0x5aad64[_0xd251('0x41')]=qs[_0xd251('0x42')](_[_0xd251('0x43')](_0x5e7104[_0xd251('0x39')],_0x1f358f['filters']),_0x448176);if(_0x5e7104[_0xd251('0x39')][_0xd251('0x44')]){_0x5aad64[_0xd251('0x41')]=_[_0xd251('0x45')](_0x5aad64[_0xd251('0x41')],{'$or':_[_0xd251('0x33')](_0x448176,function(_0x459e57){if(_0x459e57['type']!==_0xd251('0x46')){var _0x22fe6e={};_0x22fe6e[_0x459e57[_0xd251('0x31')]]={'$like':'%'+_0x5e7104[_0xd251('0x39')][_0xd251('0x44')]+'%'};return _0x22fe6e;}})});}_0x5aad64=_['merge']({},_0x5aad64,_0x5e7104[_0xd251('0x47')]);var _0x1f2a6c={'where':_0x5aad64[_0xd251('0x41')]};return db[_0xd251('0x34')]['count'](_0x1f2a6c)[_0xd251('0x2b')](function(_0x5420ad){_0x5705d5[_0xd251('0x23')]=_0x5420ad;if(_0x5e7104[_0xd251('0x39')][_0xd251('0x48')]){_0x5aad64['include']=[{'all':!![]}];}return db[_0xd251('0x34')][_0xd251('0x49')](_0x5aad64);})['then'](function(_0x353d78){_0x5705d5['rows']=_0x353d78;return _0x5705d5;})[_0xd251('0x2b')](respondWithFilteredResult(_0x2decba,_0x5aad64))[_0xd251('0x4a')](handleError(_0x2decba,null));};exports[_0xd251('0x4b')]=function(_0x37af82,_0x244e84){var _0x37f5fc={'raw':!![],'where':{'id':_0x37af82['params']['id']}},_0x3edca6={};_0x3edca6[_0xd251('0x38')]=_[_0xd251('0x3a')](db[_0xd251('0x34')][_0xd251('0x4c')]);_0x3edca6[_0xd251('0x39')]=_[_0xd251('0x3a')](_0x37af82['query']);_0x3edca6[_0xd251('0x42')]=_[_0xd251('0x3b')](_0x3edca6[_0xd251('0x38')],_0x3edca6['query']);_0x37f5fc[_0xd251('0x3c')]=_[_0xd251('0x3b')](_0x3edca6[_0xd251('0x38')],qs['fields'](_0x37af82[_0xd251('0x39')][_0xd251('0x3d')]));_0x37f5fc['attributes']=_0x37f5fc[_0xd251('0x3c')][_0xd251('0x4d')]?_0x37f5fc[_0xd251('0x3c')]:_0x3edca6[_0xd251('0x38')];if(_0x37af82[_0xd251('0x39')][_0xd251('0x48')]){_0x37f5fc[_0xd251('0x4e')]=[{'all':!![]}];}_0x37f5fc=_[_0xd251('0x45')]({},_0x37f5fc,_0x37af82[_0xd251('0x47')]);return db[_0xd251('0x34')][_0xd251('0x4f')](_0x37f5fc)[_0xd251('0x2b')](handleEntityNotFound(_0x244e84,null))[_0xd251('0x2b')](respondWithResult(_0x244e84,null))[_0xd251('0x4a')](handleError(_0x244e84,null));};exports[_0xd251('0x50')]=function(_0x26cc7d,_0xc7bd56,_0x2f08a6){return db[_0xd251('0x34')][_0xd251('0x4f')]({'where':{'id':_0x26cc7d[_0xd251('0x51')]['id']},'attributes':['name',_0xd251('0x8')],'raw':!![]})[_0xd251('0x2b')](handleEntityNotFound(_0xc7bd56,null))['then'](function(_0x5be406){if(_0x5be406){var _0x4fdedb=path['join'](config[_0xd251('0x52')],'server/files/plugins',util[_0xd251('0x53')](_0xd251('0x54'),path[_0xd251('0x55')](_0x5be406[_0xd251('0x8')])));var _0x4dacc8=fs[_0xd251('0x56')](_0x4fdedb);var _0x446b1f=archiver('zip',{'zlib':{'level':0x9}});_0x446b1f['on'](_0xd251('0x57'),function(_0x17c36b){if(_0x17c36b[_0xd251('0x58')]===_0xd251('0x59')){logger[_0xd251('0x5a')](_0x17c36b);}else{throw new db[(_0xd251('0x5b'))][(_0xd251('0x5c'))](_0xd251('0x5d'));}});_0x446b1f['on'](_0xd251('0x5a'),function(_0x47ffed){throw new db[(_0xd251('0x5b'))]['Error'](_0xd251('0x5d'));});_0x446b1f['pipe'](_0x4dacc8);_0x446b1f[_0xd251('0x5e')](_0xd251('0x5f'),{'cwd':path[_0xd251('0x60')](config['root'],_0xd251('0x61'),path[_0xd251('0x62')](_0x5be406[_0xd251('0x8')])),'ignore':[path[_0xd251('0x60')](path['basename'](_0x5be406[_0xd251('0x8')]),_0xd251('0x63')),path['join'](path[_0xd251('0x55')](_0x5be406['path']),'attachments/**/*')],'nodir':!![]})[_0xd251('0x64')]();_0x4dacc8['on']('close',function(){if(!fs[_0xd251('0x65')](_0x4fdedb)){throw new db[(_0xd251('0x5b'))][(_0xd251('0x5c'))]('Plugin\x20not\x20found');}return _0xc7bd56[_0xd251('0x50')](_0x4fdedb,util[_0xd251('0x53')](_0xd251('0x54'),path[_0xd251('0x55')](_0x5be406[_0xd251('0x8')])),function(_0x271599){if(_0x271599){throw new db[(_0xd251('0x5b'))][(_0xd251('0x5c'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xd251('0x66')](_0x4fdedb);logger[_0xd251('0x67')](_0xd251('0x68'));logger[_0xd251('0x67')](_0xd251('0x69'));});});}return null;})['catch'](handleError(_0xc7bd56,null));};exports['upload']=function(_0x3f6fe1,_0x3149c0,_0x389f79){var _0x52a8e8=path[_0xd251('0x55')](_0x3f6fe1[_0xd251('0x6a')][_0xd251('0x6b')],path[_0xd251('0x6c')](_0x3f6fe1[_0xd251('0x6a')][_0xd251('0x6b')]));var _0x39d470=path[_0xd251('0x60')](config[_0xd251('0x52')],_0xd251('0x61'),_0x3f6fe1[_0xd251('0x6a')][_0xd251('0x6b')]);var _0x2b4a16=path['join'](config['root'],_0xd251('0x61'),_0x52a8e8);logger[_0xd251('0x67')](_0xd251('0x6d'),_0x39d470);logger[_0xd251('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x2b4a16);try{fs[_0xd251('0x6e')](_0x39d470,parseInt(_0xd251('0x6f'),0x8));extract(_0x39d470,{'dir':_0x2b4a16},function(_0x39d800){if(_0x39d800){logger[_0xd251('0x5a')](_0x39d800);handleError(_0x39d800,!![]);};var _0x3b6b1c=fs['readdirSync'](_0x2b4a16);if(_0x3b6b1c[_0xd251('0x4d')]>0x1){removeReferences(_0x39d470,_0x2b4a16);logger[_0xd251('0x5a')](_0xd251('0x70'));return _0x389f79(new Error('Invalid\x20plugin\x20structure'));}var _0x1ca825=fs[_0xd251('0x71')](path['join'](_0x2b4a16,_0x3b6b1c[0x0]));if(_0x1ca825[_0xd251('0x72')]()){removeReferences(_0x39d470,_0x2b4a16);logger[_0xd251('0x5a')]('Invalid\x20plugin\x20structure');return _0x389f79(new Error(_0xd251('0x70')));}if(_0x1ca825[_0xd251('0x73')]()){var _0x13ee0e=fs[_0xd251('0x74')](path[_0xd251('0x60')](_0x2b4a16,_0x3b6b1c[0x0]));if(_0x13ee0e['length']===0x0){removeReferences(_0x39d470,_0x2b4a16);logger['error'](_0xd251('0x70'));return _0x389f79(new Error(_0xd251('0x70')));}var _0x101419=_0x13ee0e[_0xd251('0x75')](function(_0x3aec18){return _0x3aec18===_0xd251('0x76');});if(!_0x101419){return _0x389f79(new Error(_0xd251('0x77')));}var _0x2fe4e4=fs[_0xd251('0x78')](path[_0xd251('0x60')](_0x2b4a16,_0x3b6b1c[0x0],_0xd251('0x76')));var _0x54572c=JSON['parse'](_0x2fe4e4);if(_0xd251('0x21')==typeof _0x54572c[_0xd251('0x31')]){return _0x389f79(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xd251('0x21')==typeof _0x54572c[_0xd251('0x36')]){return _0x389f79(new Error(_0xd251('0x79')));}if(_0xd251('0x21')==typeof _0x54572c['version']){return _0x389f79(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x54572c[_0xd251('0x7a')]){return _0x389f79(new Error(_0xd251('0x7b')));}if(_0x54572c[_0xd251('0x36')]===_0xd251('0x7c')){if('undefined'==typeof _0x54572c['parameters']['views']){return _0x389f79(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xd251('0x21')==typeof _0x54572c[_0xd251('0x7a')]['views'][_0xd251('0x7d')]&&_0xd251('0x21')==typeof _0x54572c[_0xd251('0x7a')][_0xd251('0x7e')]['agent']){return _0x389f79(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x54572c[_0xd251('0x36')]===_0xd251('0x7f')){if(_0xd251('0x21')==typeof _0x54572c[_0xd251('0x7a')]['scriptName']){return _0x389f79(new Error(_0xd251('0x80')));}if(_0xd251('0x21')==typeof _0x54572c[_0xd251('0x7a')][_0xd251('0x81')]){return _0x389f79(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x389f79(new Error(_0xd251('0x82')));}var _0xc0d17d=_0x54572c[_0xd251('0x31')];var _0x5a3d06=_0x54572c['description'];var _0x2847af=_0x54572c[_0xd251('0x36')];var _0x1f3d55=_0x54572c[_0xd251('0x83')]?_0x54572c['sidebar']:_0xd251('0x84');var _0x40cd87=_0x54572c[_0xd251('0x85')]?_0x54572c[_0xd251('0x85')]:_0xd251('0x86');var _0x4c2a6f='';var _0x4ca770='';var _0x48919e='';var _0x3684a5='';var _0x537d89=_0x54572c[_0xd251('0x87')];if(_0x2847af===_0xd251('0x7c')){if(_0xd251('0x21')!=typeof _0x54572c[_0xd251('0x7a')][_0xd251('0x7e')][_0xd251('0x7d')]){var _0xecb11=_0x54572c[_0xd251('0x7a')]['views'][_0xd251('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xd251('0x88')](_0xecb11)){_0x4c2a6f=path[_0xd251('0x60')]('plugins',_0x52a8e8,_0x3b6b1c[0x0],_0xecb11);}else{_0x4c2a6f=_0xecb11;}}else{logger[_0xd251('0x67')](_0xd251('0x89'));}if(_0xd251('0x21')!=typeof _0x54572c[_0xd251('0x7a')]['views'][_0xd251('0x8a')]){var _0x3d6355=_0x54572c[_0xd251('0x7a')][_0xd251('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd251('0x88')](_0x3d6355)){_0x4ca770=path[_0xd251('0x60')](_0xd251('0x8b'),_0x52a8e8,_0x3b6b1c[0x0],_0x3d6355);}else{_0x4ca770=_0x3d6355;}}else{logger[_0xd251('0x67')](_0xd251('0x8c'));}}else if(_0x2847af===_0xd251('0x7f')){_0x48919e=_0x54572c[_0xd251('0x7a')][_0xd251('0x8d')];_0x3684a5=_0x54572c[_0xd251('0x7a')]['scriptPath'];if('undefined'!=typeof _0x54572c['parameters'][_0xd251('0x7e')]){if(_0xd251('0x21')!=typeof _0x54572c[_0xd251('0x7a')][_0xd251('0x7e')]['admin']){var _0xecb11=_0x54572c[_0xd251('0x7a')]['views'][_0xd251('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xd251('0x88')](_0xecb11)){_0x4c2a6f=path['join'](_0xd251('0x8b'),_0x52a8e8,_0x3b6b1c[0x0],_0xecb11);}else{_0x4c2a6f=_0xecb11;}}if(_0xd251('0x21')!=typeof _0x54572c['parameters'][_0xd251('0x7e')][_0xd251('0x8a')]){var _0x3d6355=_0x54572c[_0xd251('0x7a')][_0xd251('0x7e')][_0xd251('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xd251('0x88')](_0x3d6355)){_0x4ca770=path['join'](_0xd251('0x8b'),_0x52a8e8,_0x3b6b1c[0x0],_0x3d6355);}else{_0x4ca770=_0x3d6355;}}}}var _0x1cb5af={'name':_0xc0d17d,'description':_0x5a3d06,'path':path['join'](_0x52a8e8,_0x3b6b1c[0x0]),'type':_0x2847af,'sidebar':_0x1f3d55,'icon':_0x40cd87,'adminUrl':_0x4c2a6f,'agentUrl':_0x4ca770,'scriptName':_0x48919e,'scriptPath':_0x3684a5,'version':_0x537d89};removeReferences(_0x39d470,null);return db[_0xd251('0x34')]['create'](_0x1cb5af)[_0xd251('0x2b')](function(_0x5854a1){var _0x225006={'role':_0x3f6fe1[_0xd251('0x8e')][_0xd251('0x8f')],'userProfileId':_0x3f6fe1['body']['userProfileId']};if(!_0x225006)throw new Error(_0xd251('0x90'));if(_0x225006[_0xd251('0x8f')]===_0xd251('0x91')){var _0x40b9ad=_0x5854a1[_0xd251('0x2c')]({'plain':!![]});return db[_0xd251('0x92')][_0xd251('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x225006['userProfileId']},'raw':!![]})['then'](function(_0x532826){if(_0x532826&&_0x532826['autoAssociation']===0x0){return db[_0xd251('0x2e')][_0xd251('0x93')]({'name':_0x40b9ad[_0xd251('0x31')],'resourceId':_0x40b9ad['id'],'type':_0x532826[_0xd251('0x31')],'sectionId':_0x532826['id']},{})['then'](function(){return _0x5854a1;});}else{return _0x5854a1;}})[_0xd251('0x4a')](function(_0x509778){logger[_0xd251('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x509778);throw _0x509778;});}return _0x5854a1;})[_0xd251('0x2b')](respondWithResult(_0x3149c0,null))[_0xd251('0x4a')](handleError(_0x3149c0,null));}});}catch(_0x183b10){_0x3149c0[_0xd251('0x1e')](0x1f4)[_0xd251('0x94')](_0x183b10);}};function removeReferences(_0x2e9814,_0x5c32df){try{if(_0x2e9814){fs[_0xd251('0x66')](_0x2e9814);logger[_0xd251('0x67')](_0xd251('0x95'));}if(_0x5c32df){rimraf(_0x5c32df,function(){});logger['info'](_0xd251('0x96'));}}catch(_0x4af1c7){logger[_0xd251('0x5a')](_0x4af1c7);}}exports[_0xd251('0x2a')]=function(_0x511e9e,_0x1ace49,_0xe4bda9){return db[_0xd251('0x34')][_0xd251('0x4f')]({'where':{'id':_0x511e9e[_0xd251('0x51')]['id']}})[_0xd251('0x2b')](handleEntityNotFound(_0x1ace49,null))[_0xd251('0x2b')](saveUpdates(_0x511e9e[_0xd251('0x8e')],null))[_0xd251('0x2b')](respondWithResult(_0x1ace49,null))['catch'](handleError(_0x1ace49,null));};exports['delete']=function(_0x436f5c,_0x231c64,_0x2875fc){return db[_0xd251('0x34')][_0xd251('0x4f')]({'where':{'id':_0x436f5c[_0xd251('0x51')]['id']}})['then'](function(_0x482de1){if(_0x482de1){return _0x482de1[_0xd251('0x97')]();}})[_0xd251('0x2b')](function(_0x3d498b){rimraf(path['join'](config[_0xd251('0x52')],_0xd251('0x61'),path[_0xd251('0x62')](_0x3d498b[_0xd251('0x8')])),function(){});return _0x3d498b;})['then'](handleEntityNotFound(_0x231c64,null))['then'](respondWithStatusCode(_0x231c64,null))['catch'](handleError(_0x231c64,null));};exports[_0xd251('0x98')]=function(_0x411c4e,_0x319e1e,_0x40c239){return BPromise[_0xd251('0x99')]()[_0xd251('0x2b')](function(){if(!_0x411c4e['query']['path']){throw new Error(_0xd251('0x9a'));}if(!_0x411c4e['query']['port']){throw new Error(_0xd251('0x9b'));}var _0xb23a0c=_0x411c4e[_0xd251('0x39')]['hostname']?_0x411c4e[_0xd251('0x39')][_0xd251('0x9c')]+':'+_0x411c4e['query']['port']:_0xd251('0x9d')+_0x411c4e['query'][_0xd251('0x9e')];var _0x146b67=_0x411c4e[_0xd251('0x39')][_0xd251('0x26')]?_0x411c4e[_0xd251('0x39')][_0xd251('0x26')]:!![];var _0x16c042=_0x411c4e[_0xd251('0x39')][_0xd251('0x9f')]?_0x411c4e[_0xd251('0x39')][_0xd251('0x9f')]:null;var _0x532412={'method':_0x411c4e['method'],'uri':util[_0xd251('0x53')](_0xd251('0xa0'),_0xb23a0c,_0x411c4e[_0xd251('0x39')][_0xd251('0x8')]),'json':_0x146b67,'resolveWithFullResponse':!![],'encoding':_0x16c042,'qs':_0x411c4e[_0xd251('0x39')]};if(_0x411c4e[_0xd251('0xa1')]){_0x532412['headers']=_0x411c4e[_0xd251('0xa1')];if(_0x532412[_0xd251('0xa1')][_0xd251('0xa2')]){delete _0x532412['headers'][_0xd251('0xa2')];}}if(_0x532412['headers'][_0xd251('0xa3')]){delete _0x532412['headers'][_0xd251('0xa3')];}return rp(_0x532412);})['then'](function(_0x884c9e){if(_0x884c9e){_0x319e1e[_0xd251('0x24')](_0x884c9e[_0xd251('0xa1')]);logger[_0xd251('0x67')](_0x884c9e[_0xd251('0x8e')]);if(_[_0xd251('0xa4')](_0x411c4e[_0xd251('0x39')]['path'],_0xd251('0x50'))&&_0x884c9e[_0xd251('0xa5')]==0x1f4){return _0x319e1e[_0xd251('0x2f')](_0x884c9e[_0xd251('0xa5')]);}else{return _0x319e1e['status'](_0x884c9e[_0xd251('0xa5')])['send'](_0x884c9e[_0xd251('0x8e')]);}}else{return _0x319e1e['sendStatus'](0xc8);}})[_0xd251('0x4a')](handleError(_0x319e1e,null));};exports['webhookPost']=function(_0x102397,_0x29cf1a,_0x5e37aa){return BPromise['resolve']()['then'](function(){if(!_0x102397['query']['path']){throw new Error(_0xd251('0x9a'));}if(!_0x102397['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x21b358=_0x102397['query']['hostname']?_0x102397[_0xd251('0x39')][_0xd251('0x9c')]+':'+_0x102397['query'][_0xd251('0x9e')]:_0xd251('0x9d')+_0x102397[_0xd251('0x39')][_0xd251('0x9e')];var _0x1c6035=_0x102397[_0xd251('0x39')][_0xd251('0x26')]?_0x102397['query'][_0xd251('0x26')]:!![];var _0x3758ce=_0x102397[_0xd251('0x39')][_0xd251('0x9f')]?_0x102397[_0xd251('0x39')][_0xd251('0x9f')]:null;var _0x22c842={'method':_0x102397[_0xd251('0xa6')],'uri':util[_0xd251('0x53')](_0xd251('0xa0'),_0x21b358,_0x102397[_0xd251('0x39')]['path']),'json':_0x1c6035,'resolveWithFullResponse':!![],'encoding':_0x3758ce,'body':_0x102397['body']};if(_0x102397['headers']){_0x22c842[_0xd251('0xa1')]=_0x102397[_0xd251('0xa1')];if(_0x22c842[_0xd251('0xa1')][_0xd251('0xa2')]){delete _0x22c842[_0xd251('0xa1')][_0xd251('0xa2')];}}if(_0x22c842[_0xd251('0xa1')][_0xd251('0xa3')]){delete _0x22c842['headers'][_0xd251('0xa3')];}return rp(_0x22c842);})[_0xd251('0x2b')](function(_0x51f7f6){if(_0x51f7f6){_0x29cf1a[_0xd251('0x24')](_0x51f7f6['headers']);logger[_0xd251('0x67')](_0x51f7f6[_0xd251('0x8e')]);return _0x29cf1a[_0xd251('0x1e')](_0x51f7f6[_0xd251('0xa5')])[_0xd251('0x94')](_0x51f7f6[_0xd251('0x8e')]);}else{return _0x29cf1a[_0xd251('0x2f')](0xc8);}})['catch'](handleError(_0x29cf1a,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8dcc3f2..8f8ec39 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 _0x4312=['Plugin','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0x4312,0xaf));var _0x2431=function(_0x3d9ba7,_0x1c8b5f){_0x3d9ba7=_0x3d9ba7-0x0;var _0x4621ce=_0x4312[_0x3d9ba7];return _0x4621ce;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x2431('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x2431('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2431('0x2'),'afterDestroy':_0x2431('0x3')};function emitEvent(_0x728b00){return function(_0x237ac5,_0x22db34,_0xbf4fd6){PluginEvents['emit'](_0x728b00+':'+_0x237ac5['id'],_0x237ac5);PluginEvents[_0x2431('0x4')](_0x728b00,_0x237ac5);_0xbf4fd6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x2431('0x5')](e,emitEvent(event));}}module[_0x2431('0x6')]=PluginEvents; \ No newline at end of file +var _0xc627=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x44582d,_0x2c15c1){var _0x50a8ad=function(_0x2ab522){while(--_0x2ab522){_0x44582d['push'](_0x44582d['shift']());}};_0x50a8ad(++_0x2c15c1);}(_0xc627,0x14a));var _0x7c62=function(_0x38aa65,_0x161fd2){_0x38aa65=_0x38aa65-0x0;var _0x5d9b55=_0xc627[_0x38aa65];return _0x5d9b55;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x7c62('0x0'))['db'][_0x7c62('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x7c62('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c62('0x3'),'afterDestroy':_0x7c62('0x4')};function emitEvent(_0x2f79e5){return function(_0x313d80,_0x121766,_0x35859a){PluginEvents[_0x7c62('0x5')](_0x2f79e5+':'+_0x313d80['id'],_0x313d80);PluginEvents[_0x7c62('0x5')](_0x2f79e5,_0x313d80);_0x35859a(null);};}for(var e in events){if(events[_0x7c62('0x6')](e)){var event=events[e];Plugin[_0x7c62('0x7')](e,emitEvent(event));}}module[_0x7c62('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 2d283de..afac1f7 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 _0xca26=['exports','define','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./plugin.attributes'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xca26,0x1b3));var _0x6ca2=function(_0x4b67cc,_0x48e7bc){_0x4b67cc=_0x4b67cc-0x0;var _0x3f1a32=_0xca26[_0x4b67cc];return _0x3f1a32;};'use strict';var _=require(_0x6ca2('0x0'));var util=require(_0x6ca2('0x1'));var logger=require(_0x6ca2('0x2'))(_0x6ca2('0x3'));var moment=require('moment');var BPromise=require(_0x6ca2('0x4'));var rp=require(_0x6ca2('0x5'));var fs=require('fs');var path=require(_0x6ca2('0x6'));var rimraf=require(_0x6ca2('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ca2('0x8'));module[_0x6ca2('0x9')]=function(_0x26d5a6,_0x10eae2){return _0x26d5a6[_0x6ca2('0xa')]('Plugin',attributes,{'tableName':_0x6ca2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8db=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','Plugin','plugins','lodash','util'];(function(_0x588ed0,_0x53dc09){var _0x5d23cc=function(_0x153884){while(--_0x153884){_0x588ed0['push'](_0x588ed0['shift']());}};_0x5d23cc(++_0x53dc09);}(_0xa8db,0x12a));var _0xba8d=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xa8db[_0x4c4037];return _0x357862;};'use strict';var _=require(_0xba8d('0x0'));var util=require(_0xba8d('0x1'));var logger=require(_0xba8d('0x2'))(_0xba8d('0x3'));var moment=require(_0xba8d('0x4'));var BPromise=require('bluebird');var rp=require(_0xba8d('0x5'));var fs=require('fs');var path=require(_0xba8d('0x6'));var rimraf=require(_0xba8d('0x7'));var config=require(_0xba8d('0x8'));var attributes=require(_0xba8d('0x9'));module['exports']=function(_0x5dd30,_0x51f070){return _0x5dd30['define'](_0xba8d('0xa'),attributes,{'tableName':_0xba8d('0xb'),'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 5b5c7d1..0d958ae 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 _0x81f6=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','body','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x465223,_0x16a1e1){var _0xdbb6d4=function(_0x3a4409){while(--_0x3a4409){_0x465223['push'](_0x465223['shift']());}};_0xdbb6d4(++_0x16a1e1);}(_0x81f6,0x107));var _0x681f=function(_0x383d3a,_0xc9739c){_0x383d3a=_0x383d3a-0x0;var _0x485633=_0x81f6[_0x383d3a];return _0x485633;};'use strict';var _=require(_0x681f('0x0'));var util=require('util');var moment=require(_0x681f('0x1'));var BPromise=require('bluebird');var rs=require(_0x681f('0x2'));var fs=require('fs');var Redis=require(_0x681f('0x3'));var db=require(_0x681f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x681f('0x5'))(_0x681f('0x6'));var config=require(_0x681f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x681f('0x8')]['http']({'port':0x232a});config[_0x681f('0x9')]=_[_0x681f('0xa')](config[_0x681f('0x9')],{'host':_0x681f('0xb'),'port':0x18eb});var socket=require(_0x681f('0xc'))(new Redis(config['redis']));require(_0x681f('0xd'))[_0x681f('0xe')](socket);function respondWithRpcPromise(_0x33197,_0x40b240,_0x1d684b){return new BPromise(function(_0x5506a5,_0x78e260){return client[_0x681f('0xf')](_0x33197,_0x1d684b)[_0x681f('0x10')](function(_0x3ffbe7){logger[_0x681f('0x11')]('Plugin,\x20%s,\x20%s',_0x40b240,_0x681f('0x12'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x40b240,_0x681f('0x12'),JSON[_0x681f('0x13')](_0x3ffbe7));if(_0x3ffbe7[_0x681f('0x14')]){if(_0x3ffbe7[_0x681f('0x14')][_0x681f('0x15')]===0x1f4){logger['error'](_0x681f('0x16'),_0x40b240,_0x3ffbe7[_0x681f('0x14')]['message']);return _0x78e260(_0x3ffbe7[_0x681f('0x14')]['message']);}logger['error']('Plugin,\x20%s,\x20%s',_0x40b240,_0x3ffbe7[_0x681f('0x14')][_0x681f('0x17')]);return _0x5506a5(_0x3ffbe7['error'][_0x681f('0x17')]);}else{logger[_0x681f('0x11')](_0x681f('0x16'),_0x40b240,_0x681f('0x12'));_0x5506a5(_0x3ffbe7[_0x681f('0x18')][_0x681f('0x17')]);}})[_0x681f('0x19')](function(_0xf0b5bb){logger[_0x681f('0x14')]('Plugin,\x20%s,\x20%s',_0x40b240,_0xf0b5bb);_0x78e260(_0xf0b5bb);});});}exports[_0x681f('0x1a')]=function(_0x14c9a8){var _0x5c8e6e=this;return new Promise(function(_0x1a8124,_0x43857b){return db['Plugin'][_0x681f('0x1b')](_0x14c9a8[_0x681f('0x1c')],{'raw':_0x14c9a8['options']?_0x14c9a8[_0x681f('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5807fe){logger[_0x681f('0x11')](_0x681f('0x1a'),_0x14c9a8);logger['debug'](_0x681f('0x1a'),_0x14c9a8,JSON['stringify'](_0x5807fe));_0x1a8124(_0x5807fe);})['catch'](function(_0x2560b8){logger['error'](_0x681f('0x1a'),_0x2560b8['message'],_0x14c9a8);_0x43857b(_0x5c8e6e[_0x681f('0x14')](0x1f4,_0x2560b8['message']));});});}; \ No newline at end of file +var _0x1588=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','Plugin','create','body','options','raw','CreatePlugin','stringify','catch','util'];(function(_0xa54510,_0x213db3){var _0x210dd3=function(_0x305ca3){while(--_0x305ca3){_0xa54510['push'](_0xa54510['shift']());}};_0x210dd3(++_0x213db3);}(_0x1588,0x195));var _0x8158=function(_0x26de0a,_0x1e5f07){_0x26de0a=_0x26de0a-0x0;var _0x5f3a00=_0x1588[_0x26de0a];return _0x5f3a00;};'use strict';var _=require('lodash');var util=require(_0x8158('0x0'));var moment=require(_0x8158('0x1'));var BPromise=require(_0x8158('0x2'));var rs=require(_0x8158('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8158('0x4'));var logger=require(_0x8158('0x5'))(_0x8158('0x6'));var config=require(_0x8158('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8158('0x8')][_0x8158('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8158('0xa')],{'host':_0x8158('0xb'),'port':0x18eb});var socket=require(_0x8158('0xc'))(new Redis(config[_0x8158('0xa')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x468a20,_0x5a40bc,_0x166952){return new BPromise(function(_0x6a30b7,_0x47eee3){return client['request'](_0x468a20,_0x166952)[_0x8158('0xd')](function(_0x31589b){logger[_0x8158('0xe')](_0x8158('0xf'),_0x5a40bc,_0x8158('0x10'));logger[_0x8158('0x11')](_0x8158('0x12'),_0x5a40bc,'request\x20sent',JSON['stringify'](_0x31589b));if(_0x31589b[_0x8158('0x13')]){if(_0x31589b[_0x8158('0x13')]['code']===0x1f4){logger[_0x8158('0x13')](_0x8158('0xf'),_0x5a40bc,_0x31589b[_0x8158('0x13')][_0x8158('0x14')]);return _0x47eee3(_0x31589b[_0x8158('0x13')][_0x8158('0x14')]);}logger[_0x8158('0x13')](_0x8158('0xf'),_0x5a40bc,_0x31589b[_0x8158('0x13')][_0x8158('0x14')]);return _0x6a30b7(_0x31589b[_0x8158('0x13')]['message']);}else{logger[_0x8158('0xe')](_0x8158('0xf'),_0x5a40bc,'request\x20sent');_0x6a30b7(_0x31589b['result'][_0x8158('0x14')]);}})['catch'](function(_0x13191d){logger['error'](_0x8158('0xf'),_0x5a40bc,_0x13191d);_0x47eee3(_0x13191d);});});}exports['CreatePlugin']=function(_0x38c0e2){var _0x23ec99=this;return new Promise(function(_0x2ae2e4,_0x1cc9e6){return db[_0x8158('0x15')][_0x8158('0x16')](_0x38c0e2[_0x8158('0x17')],{'raw':_0x38c0e2[_0x8158('0x18')]?_0x38c0e2['options'][_0x8158('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2988b0){logger['info'](_0x8158('0x1a'),_0x38c0e2);logger[_0x8158('0x11')](_0x8158('0x1a'),_0x38c0e2,JSON[_0x8158('0x1b')](_0x2988b0));_0x2ae2e4(_0x2988b0);})[_0x8158('0x1c')](function(_0x3459fe){logger[_0x8158('0x13')](_0x8158('0x1a'),_0x3459fe[_0x8158('0x14')],_0x38c0e2);_0x1cc9e6(_0x23ec99[_0x8158('0x13')](0x1f4,_0x3459fe[_0x8158('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 83f3ff6..f209ae2 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 _0xacc2=['register','plugin:','save','remove','emit','removeListener'];(function(_0x166a39,_0x26980d){var _0x401703=function(_0x52d622){while(--_0x52d622){_0x166a39['push'](_0x166a39['shift']());}};_0x401703(++_0x26980d);}(_0xacc2,0x104));var _0x2acc=function(_0x385870,_0x4518b2){_0x385870=_0x385870-0x0;var _0x2ff8be=_0xacc2[_0x385870];return _0x2ff8be;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2acc('0x0'),_0x2acc('0x1'),'update'];function createListener(_0x206f64,_0x532493){return function(_0x450cc0){_0x532493[_0x2acc('0x2')](_0x206f64,_0x450cc0);};}function removeListener(_0x4ba539,_0x41b03d){return function(){PluginEvents[_0x2acc('0x3')](_0x4ba539,_0x41b03d);};}exports[_0x2acc('0x4')]=function(_0x461dca){for(var _0x1a7864=0x0,_0xa0350a=events['length'];_0x1a7864<_0xa0350a;_0x1a7864++){var _0x39a7fb=events[_0x1a7864];var _0x2f7435=createListener(_0x2acc('0x5')+_0x39a7fb,_0x461dca);PluginEvents['on'](_0x39a7fb,_0x2f7435);}}; \ No newline at end of file +var _0xa458=['removeListener','register','length','plugin:','save','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa458,0x185));var _0x8a45=function(_0x301a0a,_0x46839e){_0x301a0a=_0x301a0a-0x0;var _0x19bda4=_0xa458[_0x301a0a];return _0x19bda4;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x8a45('0x0'),_0x8a45('0x1'),'update'];function createListener(_0x476fca,_0xc03f3b){return function(_0x13e880){_0xc03f3b[_0x8a45('0x2')](_0x476fca,_0x13e880);};}function removeListener(_0x55e5f8,_0x6b1dc2){return function(){PluginEvents[_0x8a45('0x3')](_0x55e5f8,_0x6b1dc2);};}exports[_0x8a45('0x4')]=function(_0x573285){for(var _0x286cf9=0x0,_0x52aa57=events[_0x8a45('0x5')];_0x286cf9<_0x52aa57;_0x286cf9++){var _0x8134ac=events[_0x286cf9];var _0x2c5b0a=createListener(_0x8a45('0x6')+_0x8134ac,_0x573285);PluginEvents['on'](_0x8134ac,_0x2c5b0a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0aca96a..43390d6 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(_0x586952,_0x20ffa4){var _0x2a7e83=function(_0x4ee120){while(--_0x4ee120){_0x586952['push'](_0x586952['shift']());}};_0x2a7e83(++_0x20ffa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x59ae95,_0x5c3671){var _0x5276f7=function(_0x4094ee){while(--_0x4094ee){_0x59ae95['push'](_0x59ae95['shift']());}};_0x5276f7(++_0x5c3671);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 ec7026c..69e7bdc 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 _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x51e395,_0x5bfe2c){var _0x12ccef=function(_0x2ed6d1){while(--_0x2ed6d1){_0x51e395['push'](_0x51e395['shift']());}};_0x12ccef(++_0x5bfe2c);}(_0xc788,0xc4));var _0x8c78=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0xc788[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file +var _0xf72b=['hasOwnProperty','Unknown\x20status','destroy','params','delete','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','json','stack','name','npm\x20install','info','index','then','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf72b,0x1d9));var _0xbf72=function(_0x3c8315,_0x2b014e){_0x3c8315=_0x3c8315-0x0;var _0x1c9df5=_0xf72b[_0x3c8315];return _0x1c9df5;};'use strict';var _=require(_0xbf72('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbf72('0x1'))('api');var path=require(_0xbf72('0x2'));var exec=require(_0xbf72('0x3'))['exec'];var BPromise=require(_0xbf72('0x4'));function handleEntityNotFound(_0x550a9e,_0x37afc8){return function(_0x3d3a6f){if(!_0x3d3a6f){_0x550a9e[_0xbf72('0x5')](0x194);;}return _0x3d3a6f;};}function respondWithResult(_0x2b8440,_0x5ee060){_0x5ee060=_0x5ee060||0xc8;return function(_0x41c11d){if(_0x41c11d){return _0x2b8440[_0xbf72('0x6')](_0x5ee060)[_0xbf72('0x7')](_0x41c11d);}return null;};}function handleError(_0xd0402c,_0xdd6177){_0xdd6177=_0xdd6177||0x1f4;return function(_0x1b6d38){logger['error'](_0x1b6d38[_0xbf72('0x8')]);if(_0x1b6d38['name']){delete _0x1b6d38[_0xbf72('0x9')];}_0xd0402c[_0xbf72('0x6')](_0xdd6177)['send'](_0x1b6d38);};}function execChildProcess(){return new BPromise(function(_0xaec095,_0x1c3453){exec(_0xbf72('0xa'),function(_0x145acb,_0x2957c5,_0x44ce73){logger[_0xbf72('0xb')](_0x2957c5);logger[_0xbf72('0xb')](_0x44ce73);if(_0x145acb){logger['error'](_0x145acb);return _0x1c3453(_0x145acb);}return _0xaec095(_0x2957c5);});});}exports[_0xbf72('0xc')]=function(_0x227a35,_0x57cccf){return pm2['list']()[_0xbf72('0xd')](function(_0x4f4fa5){if(_0x4f4fa5){var _0x5625b3=_['reject'](_0x4f4fa5,function(_0x32a0a5){return _0x32a0a5[_0xbf72('0x9')]===_0xbf72('0xe')||_0x32a0a5[_0xbf72('0x9')]===_0xbf72('0xf');});return{'rows':_0x5625b3,'count':_0x5625b3[_0xbf72('0x10')]};}return null;})['then'](respondWithResult(_0x57cccf,null))[_0xbf72('0x11')](handleError(_0x57cccf,null));};exports[_0xbf72('0x12')]=function(_0x2a8609,_0x3d4dea){return pm2[_0xbf72('0x13')](_0x2a8609['params']['id'])['then'](respondWithResult(_0x3d4dea,null))[_0xbf72('0xd')](handleEntityNotFound(_0x3d4dea,null))[_0xbf72('0x11')](handleError(_0x3d4dea,null));};exports[_0xbf72('0x14')]=function(_0x2584d9,_0x27e58e){if(_0x2584d9[_0xbf72('0x15')][_0xbf72('0x9')]&&_0x2584d9['body'][_0xbf72('0x16')]){var _0x42a193=path[_0xbf72('0x17')](__dirname,_0xbf72('0x18'),_0x2584d9[_0xbf72('0x15')]['script']);var _0x3cd181=process[_0xbf72('0x19')]();process['chdir'](path[_0xbf72('0x1a')](_0x42a193));return execChildProcess()[_0xbf72('0xd')](function(_0x267c41){process['chdir'](_0x3cd181);return pm2[_0xbf72('0x1b')]({'name':_0x2584d9[_0xbf72('0x15')][_0xbf72('0x9')],'script':_0x42a193});})[_0xbf72('0xd')](function(_0x4f4dc0){pm2[_0xbf72('0x1c')]();return _0x4f4dc0[0x0];})[_0xbf72('0xd')](respondWithResult(_0x27e58e,0xc9))[_0xbf72('0x11')](handleError(_0x27e58e,null));}else{return _0x27e58e['status'](0x1f4)[_0xbf72('0x1d')]({'message':_0xbf72('0x1e')});}};exports[_0xbf72('0x1f')]=function(_0x1a2f55,_0x15d60d){if(_0x1a2f55[_0xbf72('0x15')]['id']){delete _0x1a2f55[_0xbf72('0x15')]['id'];}var _0x25ecdf={'online':_0xbf72('0x20'),'stopped':_0xbf72('0x21')};if(_0x25ecdf[_0xbf72('0x22')](_0x1a2f55[_0xbf72('0x15')][_0xbf72('0x6')])){return pm2[_0x25ecdf[_0x1a2f55[_0xbf72('0x15')][_0xbf72('0x6')]]](_0x1a2f55['params']['id'])[_0xbf72('0xd')](respondWithResult(_0x15d60d,0xc8))[_0xbf72('0x11')](handleError(_0x15d60d,null));}else{return _0x15d60d[_0xbf72('0x6')](0x1f4)[_0xbf72('0x1d')]({'message':_0xbf72('0x23')});}};exports[_0xbf72('0x24')]=function(_0x35ecdc,_0x209b2b){if(_0x35ecdc[_0xbf72('0x15')]['id']){delete _0x35ecdc[_0xbf72('0x15')]['id'];}if(_0x35ecdc[_0xbf72('0x25')]['id']){return pm2[_0xbf72('0x26')](_0x35ecdc[_0xbf72('0x25')]['id'])[_0xbf72('0xd')](function(_0x4e2472){pm2[_0xbf72('0x1c')]();return _0x4e2472[0x0];})[_0xbf72('0xd')](respondWithResult(_0x209b2b,null))[_0xbf72('0x11')](handleError(_0x209b2b,null));}else{return _0x209b2b['status'](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a89a86d..74b0ed1 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 _0x33c9=['/queues','getQueues','Router','../../components/auth/service','./realtime.controller','get','/agents','getAgents'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x33c9,0x152));var _0x933c=function(_0x1fefa5,_0x57fe6b){_0x1fefa5=_0x1fefa5-0x0;var _0x1ce7c0=_0x33c9[_0x1fefa5];return _0x1ce7c0;};'use strict';var express=require('express');var router=express[_0x933c('0x0')]();var auth=require(_0x933c('0x1'));var controller=require(_0x933c('0x2'));router[_0x933c('0x3')](_0x933c('0x4'),auth['isAuthenticated'](),controller[_0x933c('0x5')]);router[_0x933c('0x3')](_0x933c('0x6'),auth['isAuthenticated'](),controller[_0x933c('0x7')]);module['exports']=router; \ No newline at end of file +var _0xf833=['./realtime.controller','get','isAuthenticated','getAgents','/queues','exports'];(function(_0x40f4d3,_0x2c163c){var _0x342be1=function(_0x26c186){while(--_0x26c186){_0x40f4d3['push'](_0x40f4d3['shift']());}};_0x342be1(++_0x2c163c);}(_0xf833,0x1ec));var _0x3f83=function(_0x35a552,_0x56629b){_0x35a552=_0x35a552-0x0;var _0x457ea2=_0xf833[_0x35a552];return _0x457ea2;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x3f83('0x0'));router[_0x3f83('0x1')]('/agents',auth[_0x3f83('0x2')](),controller[_0x3f83('0x3')]);router[_0x3f83('0x1')](_0x3f83('0x4'),auth[_0x3f83('0x2')](),controller['getQueues']);module[_0x3f83('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 9581727..1afa562 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 _0x3bed=['dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','paused','loggedInDb','talking','busy','merge','pick','filter','queue','length','internal','find','UserId','accountcode','voiceStatus','User','Pause','findAll','startCase','QueueId','online','unknown','unavailable','ringing','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','idle','pause','every','chatStatus','smsStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','pauseType','address','openchannelCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','openchannelPause','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','user','userProfileId','query','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','globalStatusFilter','globalStatus','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','resolve','channel','includes','toLowerCase','Invalid\x20channel','Queue','QueueCampaigns','all','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','set','Content-Range','json','error','stack','name','status','send','request','Agents','then','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','voice','Queues','format','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','outbound','push','originated','message','dialActive'];(function(_0x3830c9,_0x5bac14){var _0x73c1ae=function(_0xc9f53){while(--_0xc9f53){_0x3830c9['push'](_0x3830c9['shift']());}};_0x73c1ae(++_0x5bac14);}(_0x3bed,0x192));var _0xd3be=function(_0xb971a9,_0xbe6b9c){_0xb971a9=_0xb971a9-0x0;var _0x1920fd=_0x3bed[_0xb971a9];return _0x1920fd;};'use strict';var util=require('util');var _=require(_0xd3be('0x0'));var jayson=require(_0xd3be('0x1'));var qs=require(_0xd3be('0x2'));var logger=require(_0xd3be('0x3'))(_0xd3be('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd3be('0x5')][_0xd3be('0x6')]({'port':0x232a});var routingClient=jayson[_0xd3be('0x5')][_0xd3be('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x23e3dc,_0x150765){return function(_0x52c382){if(_0x52c382){var _0x55f27c=typeof _0x150765[_0xd3be('0x7')]===_0xd3be('0x8')&&typeof _0x150765[_0xd3be('0x9')]==='undefined';var _0x302906=_0x52c382[_0xd3be('0xa')];var _0x327484=_0x55f27c?0x0:_0x150765[_0xd3be('0x7')];var _0x21da66=_0x55f27c?_0x52c382['count']:_0x150765[_0xd3be('0x7')]+_0x150765['limit'];var _0x583e5c;if(_0x21da66>=_0x302906){_0x21da66=_0x302906;_0x583e5c=0xc8;}else{_0x583e5c=0xce;}_0x23e3dc['status'](_0x583e5c);return _0x23e3dc[_0xd3be('0xb')](_0xd3be('0xc'),_0x327484+'-'+_0x21da66+'/'+_0x302906)[_0xd3be('0xd')](_0x52c382);}return null;};}function handleError(_0x4cac25,_0x57f304){_0x57f304=_0x57f304||0x1f4;return function(_0x38744f){logger[_0xd3be('0xe')](_0x38744f[_0xd3be('0xf')]);if(_0x38744f[_0xd3be('0x10')]){delete _0x38744f[_0xd3be('0x10')];}_0x4cac25[_0xd3be('0x11')](_0x57f304)[_0xd3be('0x12')](_0x38744f);};}function getRealtimeAgents(){return new Promise(function(_0x24f557,_0x5c9b39){return amiClient[_0xd3be('0x13')](_0xd3be('0x14'),{})[_0xd3be('0x15')](function(_0x4a13fc){if(_0x4a13fc[_0xd3be('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x52f7e1=_0x4a13fc[_0xd3be('0x16')];return routingClient['request'](_0xd3be('0x14'),{})[_0xd3be('0x15')](function(_0x2d6c29){if(_0x2d6c29[_0xd3be('0xe')])throw new Error(_0xd3be('0x17'));var _0x1c6905=_0x2d6c29[_0xd3be('0x16')];return _0x24f557(_['merge']({},_0x52f7e1,_0x1c6905));});})['catch'](function(_0x24e399){_0x5c9b39(_0x24e399);});});}function getRealtimeQueues(_0x2506c7,_0x198754){return new Promise(function(_0x13accb,_0x1a3031){var _0x56d417=_0x198754===_0xd3be('0x18')?amiClient:routingClient;return _0x56d417['request'](_['startCase'](_0x198754)+_0xd3be('0x19'),_0x2506c7)['then'](function(_0x12ce45){if(_0x12ce45[_0xd3be('0xe')])throw new Error(util[_0xd3be('0x1a')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x198754));return _0x13accb(_0x12ce45[_0xd3be('0x16')]);})[_0xd3be('0x1b')](function(_0x7794b9){_0x1a3031(_0x7794b9);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x350bd3,_0x465021){return amiClient[_0xd3be('0x13')]('VoiceQueuesChannels',{})[_0xd3be('0x15')](function(_0x21f16e){if(_0x21f16e[_0xd3be('0xe')])throw new Error(_0xd3be('0x1c'));return _0x350bd3(_0x21f16e[_0xd3be('0x16')]);})[_0xd3be('0x1b')](function(_0x5c25dd){_0x465021(_0x5c25dd);});});}function initializeQueues(_0x4b94c4,_0xe173da,_0x2aca11,_0x1eb9c1){var _0x5357f0=['loggedIn',_0xd3be('0x1d'),_0xd3be('0x1e'),'talking','paused'];if(_0x2aca11===_0xd3be('0x18')&&_0x1eb9c1===_0xd3be('0x1f')){_0x5357f0[_0xd3be('0x20')]('pTalking',_0xd3be('0x21'),_0xd3be('0x22'),_0xd3be('0x23'),_0xd3be('0x24'),_0xd3be('0x25'),'startPredictive',_0xd3be('0x26'),_0xd3be('0x27'),_0xd3be('0x28'),_0xd3be('0x29'),_0xd3be('0x2a'),_0xd3be('0x2b'),_0xd3be('0x2c'),'dialPredictiveIntervalMinThreshold',_0xd3be('0x2d'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xd3be('0x2e'),_0xd3be('0x2f'),'predictiveIntervalAvgHoldtime',_0xd3be('0x30'));}return _0x4b94c4[_0xd3be('0x31')](function(_0x39d376){var _0xe43fbd=_0x39d376[_0xd3be('0x32')]({'plain':!![]});_0xe43fbd[_0xd3be('0x33')]=[];_0xe43fbd[_0xd3be('0x34')]=0x0;_0xe43fbd[_0xd3be('0x35')]=0x0;_0xe43fbd['loggedIn']=0x0;_0xe43fbd[_0xd3be('0x1d')]=0x0;_0xe43fbd[_0xd3be('0x1e')]=0x0;if(_0x2aca11===_0xd3be('0x18')){_0xe43fbd[_0xd3be('0x36')]=0x0;_0xe43fbd[_0xd3be('0x37')]=0x0;if(_0x1eb9c1===_0xd3be('0x1f')){_0xe43fbd['pTalking']=0x0;_0xe43fbd[_0xd3be('0x21')]=0x0;}}var _0x145146=_['find'](_0xe173da,['id',_0xe43fbd['id']]);if(_0x145146)_[_0xd3be('0x38')](_0xe43fbd,_[_0xd3be('0x39')](_0x145146,_0x5357f0));return _0xe43fbd;});}function updateAgentVoiceStatus(_0x146a61,_0x1b8eaa,_0x572029){var _0x2615ab=_[_0xd3be('0x3a')](_0x572029,[_0xd3be('0x3b'),_0x1b8eaa[_0xd3be('0x10')]]);if(_0x2615ab[_0xd3be('0x3c')]===0x0)return _0x146a61['busy']=!![];if(_['some'](_0x2615ab,['connectedlinenum',_0x146a61[_0xd3be('0x3d')]['toString']()]))return _0x146a61[_0xd3be('0x36')]=!![];if(!_0x146a61[_0xd3be('0x36')])return _0x146a61[_0xd3be('0x37')]=!![];}function getVoiceQueueAgents(_0x5f4166,_0x584a02,_0x31f64a,_0x17fca8){var _0x125b50=_[_0xd3be('0x3e')](_0x584a02,['id',_0x5f4166['id']]);if(!_0x125b50)return _0x5f4166;return _0x125b50['getMembers']({'raw':!![]})['then'](function(_0x5b60cd){for(var _0x3b7f3a=0x0;_0x3b7f3a<_0x5b60cd['length'];_0x3b7f3a++){var _0x2541d7=_['find'](_0x31f64a,['id',_0x5b60cd[_0x3b7f3a][_0xd3be('0x3f')]]);if(!_0x2541d7){_0x2541d7={'id':_0x5b60cd[_0x3b7f3a]['UserId'],'name':_0x5b60cd[_0x3b7f3a]['UserId'],'accountcode':'','online':![]};}var _0x5c9263={'id':_0x2541d7['id'],'name':_0x2541d7[_0xd3be('0x10')],'internal':_0x2541d7[_0xd3be('0x40')],'online':Boolean(_0x2541d7['online']),'paused':Boolean(_0x5b60cd[_0x3b7f3a]['paused'])};if(_0x2541d7[_0xd3be('0x41')]===_0xd3be('0x36'))updateAgentVoiceStatus(_0x5c9263,_0x5f4166,_0x17fca8);if(_0x5c9263['online'])_0x5f4166['loggedInDb']++;if(_0x5c9263[_0xd3be('0x37')])_0x5f4166['busy']++;if(_0x5c9263['paused']&&!_0x5c9263[_0xd3be('0x37')]&&!_0x5c9263['talking'])_0x5f4166[_0xd3be('0x34')]++;_0x5f4166['agents'][_0xd3be('0x20')](_0x5c9263);}return _0x5f4166;});}function getQueueAgents(_0x44b67f,_0x46b751,_0x103fbc){var _0x3bfcac=_0xd3be('0x42')+_['startCase'](_0x103fbc)+'Queue';var _0x1b06ac=_0x103fbc+_0xd3be('0x43');return db[_0x3bfcac][_0xd3be('0x44')]({'where':{[_[_0xd3be('0x45')](_0x103fbc)+_0xd3be('0x46')]:_0x44b67f['id']},'raw':!![]})[_0xd3be('0x15')](function(_0x20f2fd){for(var _0x46f3dc=0x0;_0x46f3dc<_0x20f2fd[_0xd3be('0x3c')];_0x46f3dc++){var _0x50fb3c=_[_0xd3be('0x3e')](_0x46b751,['id',_0x20f2fd[_0x46f3dc][_0xd3be('0x3f')]]);if(!_0x50fb3c){_0x50fb3c={'id':_0x20f2fd[_0x46f3dc][_0xd3be('0x3f')],'name':_0x20f2fd[_0x46f3dc][_0xd3be('0x3f')],'online':![],['pauseField']:![]};}var _0x198eb0={'id':_0x50fb3c['id'],'name':_0x50fb3c[_0xd3be('0x10')],'online':Boolean(_0x50fb3c[_0xd3be('0x47')]),'paused':Boolean(_0x50fb3c[_0x1b06ac])};if(_0x198eb0[_0xd3be('0x47')])_0x44b67f[_0xd3be('0x35')]++;_0x44b67f[_0xd3be('0x33')][_0xd3be('0x20')](_0x198eb0);}return _0x44b67f;});}function isIdle(_0x1103df){return _0x1103df==='idle'||_0x1103df===_0xd3be('0x48')||_0x1103df===_0xd3be('0x49')||_0x1103df===_0xd3be('0x4a')||_['isNil'](_0x1103df);}function isAgentPaused(_0x17ca4b,_0x4e2738){var _0x189029=[_0x17ca4b[_0xd3be('0x4b')],_0x17ca4b[_0xd3be('0x4c')],_0x17ca4b[_0xd3be('0x4d')],_0x17ca4b['openchannelPause'],_0x17ca4b[_0xd3be('0x4e')],_0x17ca4b[_0xd3be('0x4f')],_0x17ca4b[_0xd3be('0x50')]];if(!_0x4e2738)return _['every'](_0x189029);var _0x2dcabf=_[_0xd3be('0x3a')](_0x189029);return _0x2dcabf[_0xd3be('0x3c')]>0x0&&_0x2dcabf[_0xd3be('0x3c')]<_0x189029[_0xd3be('0x3c')]?!![]:![];}function isAgentIdle(_0x2a30a1){if(_0x2a30a1['voiceStatus']!==_0xd3be('0x51')&&_0x2a30a1['voicePause']){_0x2a30a1[_0xd3be('0x41')]=_0xd3be('0x52');return![];}return _[_0xd3be('0x53')]([_0x2a30a1[_0xd3be('0x54')],_0x2a30a1['faxStatus'],_0x2a30a1['mailStatus'],_0x2a30a1['openchannelStatus'],_0x2a30a1[_0xd3be('0x55')],_0x2a30a1[_0xd3be('0x41')],_0x2a30a1[_0xd3be('0x56')]],isIdle);}function getAgentStatus(_0x4a731b){var _0x51635c='unknown';if(isAgentPaused(_0x4a731b))_0x51635c=_0xd3be('0x52');else if(isAgentPaused(_0x4a731b,!![]))_0x51635c=_0xd3be('0x57');else if(isAgentIdle(_0x4a731b))_0x51635c=_0xd3be('0x51');else _0x51635c=_0xd3be('0x37');return _0x51635c;}exports[_0xd3be('0x58')]=function(_0x37616f,_0xc89a0e){var _0x1b1663={'count':0x0,'rows':[]},_0x155bd9={},_0x4bc594,_0x36b676,_0xff7ef7=[_0xd3be('0x59'),_0xd3be('0x47'),_0xd3be('0x5a'),'lastPauseAt',_0xd3be('0x5b'),'lastPauseAt',_0xd3be('0x3d'),_0xd3be('0x5c'),'chatPause','openchannelPause',_0xd3be('0x4d'),_0xd3be('0x4e'),_0xd3be('0x50'),_0xd3be('0x4c'),'voicePause','chatCapacity',_0xd3be('0x5d'),'mailCapacity',_0xd3be('0x5e'),'whatsappCapacity',_0xd3be('0x5f'),_0xd3be('0x60'),_0xd3be('0x61'),_0xd3be('0x62'),_0xd3be('0x63'),_0xd3be('0x64'),_0xd3be('0x65'),'chatStatus','openchannelStatus','mailStatus','smsStatus',_0xd3be('0x56'),'faxStatus',_0xd3be('0x41'),_0xd3be('0x66'),_0xd3be('0x67'),_0xd3be('0x68'),'smsStatusTime',_0xd3be('0x69'),_0xd3be('0x6a'),'voiceStatusTime',_0xd3be('0x3b'),'destconnectedlinenum',_0xd3be('0x6b'),_0xd3be('0x6c'),_0xd3be('0x6d'),_0xd3be('0x6e')],_0x4e3eee=[_0xd3be('0x4b'),_0xd3be('0x6f'),_0xd3be('0x4d'),'smsPause','whatsappPause',_0xd3be('0x4c'),'voicePause',_0xd3be('0x47')];Promise['resolve']()['then'](function(){var _0x5051de=_[_0xd3be('0x31')](db['User'][_0xd3be('0x70')],function(_0x4374f1){return{'name':_0x4374f1[_0xd3be('0x71')],'type':_0x4374f1[_0xd3be('0x72')][_0xd3be('0x73')]};});_0x37616f['query'][_0xd3be('0x74')]=_0xd3be('0x75');_0x37616f['query'][_0xd3be('0x47')]=!![];_0x155bd9=qs[_0xd3be('0x76')](_0x5051de,_0x37616f);_0x155bd9[_0xd3be('0x77')]=!![];if(_0x37616f[_0xd3be('0x78')]['role']===_0xd3be('0x78')){var _0x32e5e7={'params':{'id':_0x37616f[_0xd3be('0x78')][_0xd3be('0x79')]},'query':{'section':_0xd3be('0x14'),'role':'agent','online':!![],'nolimit':_0x37616f[_0xd3be('0x7a')][_0xd3be('0x7b')],'sort':_0x37616f[_0xd3be('0x7a')][_0xd3be('0x7c')],'filter':_0x37616f['query']['filter']},'raw':!![]};return db[_0xd3be('0x7d')][_0xd3be('0x7e')](_0x32e5e7);}return db['User'][_0xd3be('0x7f')](_0x155bd9);})[_0xd3be('0x15')](function(_0x49caae){_0x1b1663['count']=_0x49caae['count'];_0x4bc594=_0x49caae[_0xd3be('0x80')];return getRealtimeAgents();})['then'](function(_0x37d8de){_0x36b676=_0x37d8de[_0xd3be('0x80')];return _0x4bc594[_0xd3be('0x31')](function(_0x39e0c5){var _0x2ffcb9=_[_0xd3be('0x3e')](_0x36b676,['id',_0x39e0c5['id']]);if(_0x2ffcb9)_['merge'](_0x39e0c5,_[_0xd3be('0x39')](_['omit'](_0x2ffcb9,_0x4e3eee),_0xff7ef7));_0x39e0c5['globalStatus']=getAgentStatus(_0x39e0c5);return _0x39e0c5;});})[_0xd3be('0x15')](function(_0x200933){if(_0x37616f['query'][_0xd3be('0x81')]){var _0x367937=_[_0xd3be('0x3a')](_0x200933,[_0xd3be('0x82'),_0x37616f[_0xd3be('0x7a')][_0xd3be('0x81')]]);if(_0x37616f['query'][_0xd3be('0x83')]){_0x367937=_[_0xd3be('0x3a')](_0x367937,[_0xd3be('0x5b'),_0x37616f[_0xd3be('0x7a')][_0xd3be('0x83')]]);}}_0x1b1663['rows']=_0x367937||_0x200933;return _0x1b1663;})[_0xd3be('0x15')](respondWithFilteredResult(_0xc89a0e,_0x155bd9))[_0xd3be('0x1b')](handleError(_0xc89a0e,null));};exports[_0xd3be('0x84')]=function(_0x5038e7,_0x15e1e0){var _0x202317=[_0xd3be('0x85'),_0xd3be('0x86'),_0xd3be('0x87'),_0xd3be('0x88'),_0xd3be('0x89'),'whatsapp',_0xd3be('0x18')];var _0x534827={'count':0x0,'rows':[]},_0x35d66e={},_0x3ede70,_0x49ed26,_0x4e6f9c,_0x46573d,_0x429164;Promise[_0xd3be('0x8a')]()['then'](function(){if(_0x5038e7['query'][_0xd3be('0x8b')]){if(!_[_0xd3be('0x8c')](_0x202317,_0x5038e7['query'][_0xd3be('0x8b')][_0xd3be('0x8d')]()))throw new Error(_0xd3be('0x8e'));_0x3ede70=_0x5038e7['query'][_0xd3be('0x8b')][_0xd3be('0x8d')]();}var _0xe1c49c=_[_0xd3be('0x45')](_0x3ede70)+_0xd3be('0x8f');var _0x382c37=_['map'](db[_0xe1c49c][_0xd3be('0x70')],function(_0x1ab679){return{'name':_0x1ab679[_0xd3be('0x71')],'type':_0x1ab679[_0xd3be('0x72')][_0xd3be('0x73')]};});_0x35d66e=qs['getOptions'](_0x382c37,_0x5038e7);if(_0x5038e7['user'][_0xd3be('0x74')]===_0xd3be('0x78')){var _0x3091dd={'params':{'id':_0x5038e7[_0xd3be('0x78')][_0xd3be('0x79')]},'query':{'section':_0x3ede70===_0xd3be('0x18')&&_0x5038e7[_0xd3be('0x7a')][_0xd3be('0x72')]===_0xd3be('0x1f')?_0xd3be('0x90'):_[_0xd3be('0x45')](_0x3ede70)+_0xd3be('0x19'),'type':_0x5038e7['query']['type'],'nolimit':!![],'sort':_0xd3be('0x10'),'filter':_0x5038e7['query'][_0xd3be('0x3a')]}};return db[_0xd3be('0x7d')][_0xd3be('0x7e')](_0x3091dd);}return db[_0xe1c49c][_0xd3be('0x7f')](_0x35d66e);})[_0xd3be('0x15')](function(_0x482cc1){_0x534827[_0xd3be('0xa')]=_0x482cc1['count'];_0x49ed26=_0x482cc1[_0xd3be('0x80')];return getRealtimeQueues(_0x5038e7,_0x3ede70);})['then'](function(_0x573354){_0x46573d=_0x573354['rows'];return getRealtimeAgents();})[_0xd3be('0x15')](function(_0x35c2c7){_0x4e6f9c=_0x35c2c7[_0xd3be('0x80')];if(_0x3ede70!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xd3be('0x15')](function(_0x31fa06){_0x429164=_0x31fa06?_0x31fa06['rows']:[];return initializeQueues(_0x49ed26,_0x46573d,_0x3ede70,_0x5038e7[_0xd3be('0x7a')][_0xd3be('0x72')]);})['then'](function(_0x1124a1){var _0x16b504=_0x1124a1[_0xd3be('0x31')](function(_0x330afb){if(_0x3ede70===_0xd3be('0x18'))return getVoiceQueueAgents(_0x330afb,_0x49ed26,_0x4e6f9c,_0x429164);else return getQueueAgents(_0x330afb,_0x4e6f9c,_0x3ede70);});return Promise[_0xd3be('0x91')](_0x16b504);})[_0xd3be('0x15')](function(_0x255c57){_0x534827[_0xd3be('0x80')]=_0x255c57;return _0x534827;})[_0xd3be('0x15')](respondWithFilteredResult(_0x15e1e0,_0x35d66e))[_0xd3be('0x1b')](handleError(_0x15e1e0,null));}; \ No newline at end of file +var _0x299d=['mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','openchannelStatus','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','rawAttributes','fieldName','type','key','query','agent','getOptions','raw','user','role','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','whatsapp','toLowerCase','Invalid\x20channel','map','QueueCampaigns','all','jayson/promise','../../components/parsers/qs','../../config/logger','api','http','offset','undefined','count','limit','set','Content-Range','error','stack','name','status','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','outbound','push','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','get','agents','loggedInDb','loggedIn','busy','pTalking','find','merge','pick','filter','some','connectedlinenum','internal','toString','getMembers','length','UserId','accountcode','online','voiceStatus','User','Queue','findAll','QueueId','idle','unavailable','ringing','isNil','chatPause','mailPause','smsPause','whatsappPause','every','voicePause','pause','faxStatus','smsStatus','whatsappStatus','unknown','*pause','userpic','lastLoginAt','lastPauseAt','pauseType','openchannelPause','faxPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity'];(function(_0x929c7e,_0x38c4cc){var _0x5de099=function(_0xc4e8d8){while(--_0xc4e8d8){_0x929c7e['push'](_0x929c7e['shift']());}};_0x5de099(++_0x38c4cc);}(_0x299d,0x168));var _0xd299=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x299d[_0x15bc81];return _0x59440e;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0xd299('0x0'));var qs=require(_0xd299('0x1'));var logger=require(_0xd299('0x2'))(_0xd299('0x3'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0xd299('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x32a8d6,_0x29b113){return function(_0x4a6b4d){if(_0x4a6b4d){var _0x138ec7=typeof _0x29b113[_0xd299('0x5')]===_0xd299('0x6')&&typeof _0x29b113['limit']===_0xd299('0x6');var _0x4bfa65=_0x4a6b4d[_0xd299('0x7')];var _0x311ccc=_0x138ec7?0x0:_0x29b113[_0xd299('0x5')];var _0x26a6f0=_0x138ec7?_0x4a6b4d[_0xd299('0x7')]:_0x29b113['offset']+_0x29b113[_0xd299('0x8')];var _0x32deb9;if(_0x26a6f0>=_0x4bfa65){_0x26a6f0=_0x4bfa65;_0x32deb9=0xc8;}else{_0x32deb9=0xce;}_0x32a8d6['status'](_0x32deb9);return _0x32a8d6[_0xd299('0x9')](_0xd299('0xa'),_0x311ccc+'-'+_0x26a6f0+'/'+_0x4bfa65)['json'](_0x4a6b4d);}return null;};}function handleError(_0x1591d5,_0x5d656e){_0x5d656e=_0x5d656e||0x1f4;return function(_0x4cfbc6){logger[_0xd299('0xb')](_0x4cfbc6[_0xd299('0xc')]);if(_0x4cfbc6[_0xd299('0xd')]){delete _0x4cfbc6[_0xd299('0xd')];}_0x1591d5[_0xd299('0xe')](_0x5d656e)[_0xd299('0xf')](_0x4cfbc6);};}function getRealtimeAgents(){return new Promise(function(_0x5fe55f,_0xe45c22){return amiClient['request'](_0xd299('0x10'),{})[_0xd299('0x11')](function(_0x54a4ff){if(_0x54a4ff[_0xd299('0xb')])throw new Error(_0xd299('0x12'));var _0x46bacd=_0x54a4ff[_0xd299('0x13')];return routingClient[_0xd299('0x14')](_0xd299('0x10'),{})[_0xd299('0x11')](function(_0x1cb63e){if(_0x1cb63e[_0xd299('0xb')])throw new Error(_0xd299('0x15'));var _0x410016=_0x1cb63e[_0xd299('0x13')];return _0x5fe55f(_['merge']({},_0x46bacd,_0x410016));});})[_0xd299('0x16')](function(_0x17aca4){_0xe45c22(_0x17aca4);});});}function getRealtimeQueues(_0x32f17e,_0x3e91fb){return new Promise(function(_0x403a5f,_0x2bd3f2){var _0x2767e8=_0x3e91fb===_0xd299('0x17')?amiClient:routingClient;return _0x2767e8['request'](_[_0xd299('0x18')](_0x3e91fb)+_0xd299('0x19'),_0x32f17e)[_0xd299('0x11')](function(_0x2ddd06){if(_0x2ddd06[_0xd299('0xb')])throw new Error(util['format'](_0xd299('0x1a'),_0x3e91fb));return _0x403a5f(_0x2ddd06['result']);})[_0xd299('0x16')](function(_0x4a2e6c){_0x2bd3f2(_0x4a2e6c);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5914ab,_0x5e54e1){return amiClient['request'](_0xd299('0x1b'),{})[_0xd299('0x11')](function(_0x56595e){if(_0x56595e[_0xd299('0xb')])throw new Error(_0xd299('0x1c'));return _0x5914ab(_0x56595e['result']);})[_0xd299('0x16')](function(_0x2063ca){_0x5e54e1(_0x2063ca);});});}function initializeQueues(_0xab115b,_0x52cbc6,_0x186c92,_0x21a171){var _0x2b81bc=['loggedIn',_0xd299('0x1d'),_0xd299('0x1e'),_0xd299('0x1f'),_0xd299('0x20')];if(_0x186c92===_0xd299('0x17')&&_0x21a171===_0xd299('0x21')){_0x2b81bc[_0xd299('0x22')]('pTalking',_0xd299('0x23'),_0xd299('0x24'),_0xd299('0x25'),_0xd299('0x26'),_0xd299('0x27'),'startPredictive',_0xd299('0x28'),_0xd299('0x29'),_0xd299('0x2a'),'erlangAbandonmentRate',_0xd299('0x2b'),_0xd299('0x2c'),_0xd299('0x2d'),_0xd299('0x2e'),_0xd299('0x2f'),_0xd299('0x30'),_0xd299('0x31'),_0xd299('0x32'),_0xd299('0x33'),_0xd299('0x34'),'predictiveIntervalAvgTalktime');}return _0xab115b['map'](function(_0x1f5c8f){var _0x5ba803=_0x1f5c8f[_0xd299('0x35')]({'plain':!![]});_0x5ba803[_0xd299('0x36')]=[];_0x5ba803['paused']=0x0;_0x5ba803[_0xd299('0x37')]=0x0;_0x5ba803[_0xd299('0x38')]=0x0;_0x5ba803[_0xd299('0x1d')]=0x0;_0x5ba803[_0xd299('0x1e')]=0x0;if(_0x186c92===_0xd299('0x17')){_0x5ba803[_0xd299('0x1f')]=0x0;_0x5ba803[_0xd299('0x39')]=0x0;if(_0x21a171===_0xd299('0x21')){_0x5ba803[_0xd299('0x3a')]=0x0;_0x5ba803['originated']=0x0;}}var _0x3dc5dd=_[_0xd299('0x3b')](_0x52cbc6,['id',_0x5ba803['id']]);if(_0x3dc5dd)_[_0xd299('0x3c')](_0x5ba803,_[_0xd299('0x3d')](_0x3dc5dd,_0x2b81bc));return _0x5ba803;});}function updateAgentVoiceStatus(_0xfc9dc3,_0x1f559a,_0x38d07e){var _0x9d5b41=_[_0xd299('0x3e')](_0x38d07e,['queue',_0x1f559a[_0xd299('0xd')]]);if(_0x9d5b41['length']===0x0)return _0xfc9dc3[_0xd299('0x39')]=!![];if(_[_0xd299('0x3f')](_0x9d5b41,[_0xd299('0x40'),_0xfc9dc3[_0xd299('0x41')][_0xd299('0x42')]()]))return _0xfc9dc3[_0xd299('0x1f')]=!![];if(!_0xfc9dc3[_0xd299('0x1f')])return _0xfc9dc3[_0xd299('0x39')]=!![];}function getVoiceQueueAgents(_0x4a8dc1,_0x5c23aa,_0x3e85cc,_0x3ff46d){var _0x58096e=_[_0xd299('0x3b')](_0x5c23aa,['id',_0x4a8dc1['id']]);if(!_0x58096e)return _0x4a8dc1;return _0x58096e[_0xd299('0x43')]({'raw':!![]})[_0xd299('0x11')](function(_0x262324){for(var _0xee101a=0x0;_0xee101a<_0x262324[_0xd299('0x44')];_0xee101a++){var _0x368ee7=_['find'](_0x3e85cc,['id',_0x262324[_0xee101a]['UserId']]);if(!_0x368ee7){_0x368ee7={'id':_0x262324[_0xee101a][_0xd299('0x45')],'name':_0x262324[_0xee101a]['UserId'],'accountcode':'','online':![]};}var _0x38e089={'id':_0x368ee7['id'],'name':_0x368ee7['name'],'internal':_0x368ee7[_0xd299('0x46')],'online':Boolean(_0x368ee7[_0xd299('0x47')]),'paused':Boolean(_0x262324[_0xee101a]['paused'])};if(_0x368ee7[_0xd299('0x48')]===_0xd299('0x1f'))updateAgentVoiceStatus(_0x38e089,_0x4a8dc1,_0x3ff46d);if(_0x38e089['online'])_0x4a8dc1[_0xd299('0x37')]++;if(_0x38e089[_0xd299('0x39')])_0x4a8dc1[_0xd299('0x39')]++;if(_0x38e089[_0xd299('0x20')]&&!_0x38e089[_0xd299('0x39')]&&!_0x38e089[_0xd299('0x1f')])_0x4a8dc1[_0xd299('0x20')]++;_0x4a8dc1[_0xd299('0x36')]['push'](_0x38e089);}return _0x4a8dc1;});}function getQueueAgents(_0x172ae6,_0x5e5895,_0x4c7f9e){var _0x5c1a9f=_0xd299('0x49')+_['startCase'](_0x4c7f9e)+_0xd299('0x4a');var _0x221762=_0x4c7f9e+'Pause';return db[_0x5c1a9f][_0xd299('0x4b')]({'where':{[_[_0xd299('0x18')](_0x4c7f9e)+_0xd299('0x4c')]:_0x172ae6['id']},'raw':!![]})[_0xd299('0x11')](function(_0x538c72){for(var _0x38dc45=0x0;_0x38dc45<_0x538c72[_0xd299('0x44')];_0x38dc45++){var _0x41d601=_[_0xd299('0x3b')](_0x5e5895,['id',_0x538c72[_0x38dc45][_0xd299('0x45')]]);if(!_0x41d601){_0x41d601={'id':_0x538c72[_0x38dc45]['UserId'],'name':_0x538c72[_0x38dc45][_0xd299('0x45')],'online':![],['pauseField']:![]};}var _0x51c0d9={'id':_0x41d601['id'],'name':_0x41d601[_0xd299('0xd')],'online':Boolean(_0x41d601[_0xd299('0x47')]),'paused':Boolean(_0x41d601[_0x221762])};if(_0x51c0d9[_0xd299('0x47')])_0x172ae6[_0xd299('0x37')]++;_0x172ae6['agents'][_0xd299('0x22')](_0x51c0d9);}return _0x172ae6;});}function isIdle(_0x141d5c){return _0x141d5c===_0xd299('0x4d')||_0x141d5c==='unknown'||_0x141d5c===_0xd299('0x4e')||_0x141d5c===_0xd299('0x4f')||_[_0xd299('0x50')](_0x141d5c);}function isAgentPaused(_0x2de93b,_0x535d07){var _0x128ff2=[_0x2de93b[_0xd299('0x51')],_0x2de93b['faxPause'],_0x2de93b[_0xd299('0x52')],_0x2de93b['openchannelPause'],_0x2de93b[_0xd299('0x53')],_0x2de93b['voicePause'],_0x2de93b[_0xd299('0x54')]];if(!_0x535d07)return _[_0xd299('0x55')](_0x128ff2);var _0x2f604c=_[_0xd299('0x3e')](_0x128ff2);return _0x2f604c['length']>0x0&&_0x2f604c[_0xd299('0x44')]<_0x128ff2['length']?!![]:![];}function isAgentIdle(_0x54e988){if(_0x54e988[_0xd299('0x48')]!==_0xd299('0x4d')&&_0x54e988[_0xd299('0x56')]){_0x54e988[_0xd299('0x48')]=_0xd299('0x57');return![];}return _[_0xd299('0x55')]([_0x54e988['chatStatus'],_0x54e988[_0xd299('0x58')],_0x54e988['mailStatus'],_0x54e988['openchannelStatus'],_0x54e988[_0xd299('0x59')],_0x54e988[_0xd299('0x48')],_0x54e988[_0xd299('0x5a')]],isIdle);}function getAgentStatus(_0x31f635){var _0x184526=_0xd299('0x5b');if(isAgentPaused(_0x31f635))_0x184526='pause';else if(isAgentPaused(_0x31f635,!![]))_0x184526=_0xd299('0x5c');else if(isAgentIdle(_0x31f635))_0x184526=_0xd299('0x4d');else _0x184526=_0xd299('0x39');return _0x184526;}exports['getAgents']=function(_0x4cf8fb,_0x3a85c0){var _0x1da15c={'count':0x0,'rows':[]},_0x2aac36={},_0x4d517b,_0x619911,_0x2f4f4f=[_0xd299('0x5d'),_0xd299('0x47'),_0xd299('0x5e'),_0xd299('0x5f'),_0xd299('0x60'),_0xd299('0x5f'),_0xd299('0x41'),'address','chatPause',_0xd299('0x61'),_0xd299('0x52'),_0xd299('0x53'),_0xd299('0x54'),_0xd299('0x62'),_0xd299('0x56'),'chatCapacity',_0xd299('0x63'),_0xd299('0x64'),_0xd299('0x65'),_0xd299('0x66'),_0xd299('0x67'),_0xd299('0x68'),'openchannelCurrentCapacity',_0xd299('0x69'),_0xd299('0x6a'),_0xd299('0x6b'),_0xd299('0x6c'),_0xd299('0x6d'),_0xd299('0x6e'),_0xd299('0x6f'),_0xd299('0x59'),_0xd299('0x5a'),_0xd299('0x58'),_0xd299('0x48'),_0xd299('0x70'),_0xd299('0x71'),_0xd299('0x72'),_0xd299('0x73'),_0xd299('0x74'),'faxStatusTime',_0xd299('0x75'),_0xd299('0x76'),_0xd299('0x77'),_0xd299('0x78'),_0xd299('0x79'),_0xd299('0x7a'),_0xd299('0x7b')],_0x3b6069=[_0xd299('0x51'),_0xd299('0x61'),_0xd299('0x52'),'smsPause',_0xd299('0x54'),_0xd299('0x62'),_0xd299('0x56'),'online'];Promise['resolve']()[_0xd299('0x11')](function(){var _0x428cab=_['map'](db[_0xd299('0x49')][_0xd299('0x7c')],function(_0x9ca007){return{'name':_0x9ca007[_0xd299('0x7d')],'type':_0x9ca007[_0xd299('0x7e')][_0xd299('0x7f')]};});_0x4cf8fb[_0xd299('0x80')]['role']=_0xd299('0x81');_0x4cf8fb[_0xd299('0x80')][_0xd299('0x47')]=!![];_0x2aac36=qs[_0xd299('0x82')](_0x428cab,_0x4cf8fb);_0x2aac36[_0xd299('0x83')]=!![];if(_0x4cf8fb[_0xd299('0x84')][_0xd299('0x85')]===_0xd299('0x84')){var _0x1eca79={'params':{'id':_0x4cf8fb['user']['userProfileId']},'query':{'section':_0xd299('0x10'),'role':'agent','online':!![],'nolimit':_0x4cf8fb[_0xd299('0x80')][_0xd299('0x86')],'sort':_0x4cf8fb[_0xd299('0x80')][_0xd299('0x87')],'filter':_0x4cf8fb[_0xd299('0x80')][_0xd299('0x3e')]},'raw':!![]};return db[_0xd299('0x88')][_0xd299('0x89')](_0x1eca79);}return db[_0xd299('0x49')][_0xd299('0x8a')](_0x2aac36);})[_0xd299('0x11')](function(_0x53d172){_0x1da15c['count']=_0x53d172[_0xd299('0x7')];_0x4d517b=_0x53d172[_0xd299('0x8b')];return getRealtimeAgents();})[_0xd299('0x11')](function(_0xd06694){_0x619911=_0xd06694[_0xd299('0x8b')];return _0x4d517b['map'](function(_0x583c03){var _0x1b2762=_[_0xd299('0x3b')](_0x619911,['id',_0x583c03['id']]);if(_0x1b2762)_[_0xd299('0x3c')](_0x583c03,_[_0xd299('0x3d')](_[_0xd299('0x8c')](_0x1b2762,_0x3b6069),_0x2f4f4f));_0x583c03[_0xd299('0x8d')]=getAgentStatus(_0x583c03);return _0x583c03;});})[_0xd299('0x11')](function(_0x4185ed){if(_0x4cf8fb['query']['globalStatusFilter']){var _0x1ea128=_[_0xd299('0x3e')](_0x4185ed,[_0xd299('0x8d'),_0x4cf8fb[_0xd299('0x80')][_0xd299('0x8e')]]);if(_0x4cf8fb[_0xd299('0x80')]['pauseTypeFilter']){_0x1ea128=_[_0xd299('0x3e')](_0x1ea128,[_0xd299('0x60'),_0x4cf8fb[_0xd299('0x80')][_0xd299('0x8f')]]);}}_0x1da15c[_0xd299('0x8b')]=_0x1ea128||_0x4185ed;return _0x1da15c;})[_0xd299('0x11')](respondWithFilteredResult(_0x3a85c0,_0x2aac36))[_0xd299('0x16')](handleError(_0x3a85c0,null));};exports[_0xd299('0x90')]=function(_0x249580,_0x5aa0ce){var _0x53f29f=[_0xd299('0x91'),_0xd299('0x92'),_0xd299('0x93'),_0xd299('0x94'),'fax',_0xd299('0x95'),_0xd299('0x17')];var _0x5ca065={'count':0x0,'rows':[]},_0xb0afc9={},_0x8f4a09,_0x38c873,_0x1de8ea,_0x4861d4,_0x34cde6;Promise['resolve']()[_0xd299('0x11')](function(){if(_0x249580[_0xd299('0x80')]['channel']){if(!_['includes'](_0x53f29f,_0x249580[_0xd299('0x80')]['channel'][_0xd299('0x96')]()))throw new Error(_0xd299('0x97'));_0x8f4a09=_0x249580['query']['channel'][_0xd299('0x96')]();}var _0x27403c=_[_0xd299('0x18')](_0x8f4a09)+_0xd299('0x4a');var _0x25e397=_[_0xd299('0x98')](db[_0x27403c][_0xd299('0x7c')],function(_0xfbefff){return{'name':_0xfbefff[_0xd299('0x7d')],'type':_0xfbefff[_0xd299('0x7e')][_0xd299('0x7f')]};});_0xb0afc9=qs[_0xd299('0x82')](_0x25e397,_0x249580);if(_0x249580['user']['role']===_0xd299('0x84')){var _0x4e4b70={'params':{'id':_0x249580['user']['userProfileId']},'query':{'section':_0x8f4a09===_0xd299('0x17')&&_0x249580[_0xd299('0x80')]['type']==='outbound'?_0xd299('0x99'):_['startCase'](_0x8f4a09)+_0xd299('0x19'),'type':_0x249580[_0xd299('0x80')][_0xd299('0x7e')],'nolimit':!![],'sort':_0xd299('0xd'),'filter':_0x249580[_0xd299('0x80')][_0xd299('0x3e')]}};return db[_0xd299('0x88')][_0xd299('0x89')](_0x4e4b70);}return db[_0x27403c][_0xd299('0x8a')](_0xb0afc9);})[_0xd299('0x11')](function(_0x26043e){_0x5ca065['count']=_0x26043e[_0xd299('0x7')];_0x38c873=_0x26043e[_0xd299('0x8b')];return getRealtimeQueues(_0x249580,_0x8f4a09);})[_0xd299('0x11')](function(_0x54ea7a){_0x4861d4=_0x54ea7a[_0xd299('0x8b')];return getRealtimeAgents();})[_0xd299('0x11')](function(_0x383507){_0x1de8ea=_0x383507[_0xd299('0x8b')];if(_0x8f4a09!=_0xd299('0x17'))return;return getRealtimeVoiceQueueChannels();})[_0xd299('0x11')](function(_0x5d8e29){_0x34cde6=_0x5d8e29?_0x5d8e29['rows']:[];return initializeQueues(_0x38c873,_0x4861d4,_0x8f4a09,_0x249580[_0xd299('0x80')]['type']);})[_0xd299('0x11')](function(_0x525db4){var _0x1f65dc=_0x525db4[_0xd299('0x98')](function(_0x1f516f){if(_0x8f4a09==='voice')return getVoiceQueueAgents(_0x1f516f,_0x38c873,_0x1de8ea,_0x34cde6);else return getQueueAgents(_0x1f516f,_0x1de8ea,_0x8f4a09);});return Promise[_0xd299('0x9a')](_0x1f65dc);})[_0xd299('0x11')](function(_0x2ce6a2){_0x5ca065[_0xd299('0x8b')]=_0x2ce6a2;return _0x5ca065;})[_0xd299('0x11')](respondWithFilteredResult(_0x5aa0ce,_0xb0afc9))['catch'](handleError(_0x5aa0ce,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3d694c7..fe9c26e 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3a8ec5,_0x378f44){var _0x483caf=function(_0x559670){while(--_0x559670){_0x3a8ec5['push'](_0x3a8ec5['shift']());}};_0x483caf(++_0x378f44);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4d150a,_0x25f904){var _0x885bd4=function(_0x552a7d){while(--_0x552a7d){_0x4d150a['push'](_0x4d150a['shift']());}};_0x885bd4(++_0x25f904);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 39034d2..e84137f 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 _0x15c6=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x361cef,_0x4098a1){var _0x49c01e=function(_0x13ac63){while(--_0x13ac63){_0x361cef['push'](_0x361cef['shift']());}};_0x49c01e(++_0x4098a1);}(_0x15c6,0x1cd));var _0x615c=function(_0x4fb9ed,_0x187ea0){_0x4fb9ed=_0x4fb9ed-0x0;var _0x263645=_0x15c6[_0x4fb9ed];return _0x263645;};'use strict';var Sequelize=require(_0x615c('0x0'));module[_0x615c('0x1')]={'state':{'type':Sequelize[_0x615c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x615c('0x3')]},'scheduledat':{'type':Sequelize[_0x615c('0x4')]},'uniqueid':{'type':Sequelize[_0x615c('0x3')]},'starttime':{'type':Sequelize[_0x615c('0x4')]},'responsetime':{'type':Sequelize[_0x615c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x615c('0x3')]}}; \ No newline at end of file +var _0x3c94=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x596234,_0x19d3f0){var _0x247b5f=function(_0x5b8ae7){while(--_0x5b8ae7){_0x596234['push'](_0x596234['shift']());}};_0x247b5f(++_0x19d3f0);}(_0x3c94,0xcd));var _0x43c9=function(_0x1f5d35,_0x13db91){_0x1f5d35=_0x1f5d35-0x0;var _0x27355a=_0x3c94[_0x1f5d35];return _0x27355a;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'state':{'type':Sequelize[_0x43c9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x43c9('0x3')]},'scheduledat':{'type':Sequelize[_0x43c9('0x4')]},'uniqueid':{'type':Sequelize[_0x43c9('0x3')]},'starttime':{'type':Sequelize[_0x43c9('0x4')]},'responsetime':{'type':Sequelize[_0x43c9('0x4')]},'ringtime':{'type':Sequelize[_0x43c9('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x43c9('0x3')]},'campaigntype':{'type':Sequelize[_0x43c9('0x3')]},'membername':{'type':Sequelize[_0x43c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 51952c4..9e61ec4 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 _0xb040=['./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb040,0x189));var _0x0b04=function(_0x38f02f,_0x33288a){_0x38f02f=_0x38f02f-0x0;var _0x54f533=_0xb040[_0x38f02f];return _0x54f533;};'use strict';var _=require(_0x0b04('0x0'));var util=require(_0x0b04('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0b04('0x2'));var BPromise=require(_0x0b04('0x3'));var rp=require(_0x0b04('0x4'));var fs=require('fs');var path=require(_0x0b04('0x5'));var rimraf=require(_0x0b04('0x6'));var config=require('../../config/environment');var attributes=require(_0x0b04('0x7'));module['exports']=function(_0x1722ea,_0x33e9d6){return _0x1722ea['define'](_0x0b04('0x8'),attributes,{'tableName':_0x0b04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaee4=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaee4,0x1ad));var _0x4aee=function(_0x306cbf,_0x5dbf2b){_0x306cbf=_0x306cbf-0x0;var _0x3e62=_0xaee4[_0x306cbf];return _0x3e62;};'use strict';var _=require('lodash');var util=require(_0x4aee('0x0'));var logger=require(_0x4aee('0x1'))(_0x4aee('0x2'));var moment=require(_0x4aee('0x3'));var BPromise=require(_0x4aee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aee('0x5'));var rimraf=require(_0x4aee('0x6'));var config=require(_0x4aee('0x7'));var attributes=require(_0x4aee('0x8'));module[_0x4aee('0x9')]=function(_0x256d6c,_0x230c8e){return _0x256d6c[_0x4aee('0xa')](_0x4aee('0xb'),attributes,{'tableName':_0x4aee('0xc'),'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 5b0227b..19d8f2e 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 _0xfa57=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xfa57,0xe6));var _0x7fa5=function(_0x24a5b0,_0x521a8c){_0x24a5b0=_0x24a5b0-0x0;var _0x3d7fff=_0xfa57[_0x24a5b0];return _0x3d7fff;};'use strict';var _=require(_0x7fa5('0x0'));var util=require(_0x7fa5('0x1'));var moment=require(_0x7fa5('0x2'));var BPromise=require(_0x7fa5('0x3'));var rs=require(_0x7fa5('0x4'));var fs=require('fs');var Redis=require(_0x7fa5('0x5'));var db=require(_0x7fa5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fa5('0x7'))(_0x7fa5('0x8'));var config=require(_0x7fa5('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x120d1e,_0x38dafa,_0x282ed4){return new BPromise(function(_0x20d2be,_0x5d2d4a){return client[_0x7fa5('0xa')](_0x120d1e,_0x282ed4)[_0x7fa5('0xb')](function(_0xc8e7bc){logger[_0x7fa5('0xc')](_0x7fa5('0xd'),_0x38dafa,_0x7fa5('0xe'));logger[_0x7fa5('0xf')](_0x7fa5('0x10'),_0x38dafa,_0x7fa5('0xe'),JSON[_0x7fa5('0x11')](_0xc8e7bc));if(_0xc8e7bc[_0x7fa5('0x12')]){if(_0xc8e7bc[_0x7fa5('0x12')][_0x7fa5('0x13')]===0x1f4){logger[_0x7fa5('0x12')](_0x7fa5('0xd'),_0x38dafa,_0xc8e7bc['error'][_0x7fa5('0x14')]);return _0x5d2d4a(_0xc8e7bc['error'][_0x7fa5('0x14')]);}logger[_0x7fa5('0x12')](_0x7fa5('0xd'),_0x38dafa,_0xc8e7bc['error'][_0x7fa5('0x14')]);return _0x20d2be(_0xc8e7bc[_0x7fa5('0x12')][_0x7fa5('0x14')]);}else{logger[_0x7fa5('0xc')](_0x7fa5('0xd'),_0x38dafa,_0x7fa5('0xe'));_0x20d2be(_0xc8e7bc['result'][_0x7fa5('0x14')]);}})[_0x7fa5('0x15')](function(_0x15dd2a){logger['error'](_0x7fa5('0xd'),_0x38dafa,_0x15dd2a);_0x5d2d4a(_0x15dd2a);});});}exports[_0x7fa5('0x16')]=function(_0x3f2b34){var _0x4f74d8=this;return new Promise(function(_0x287aa4,_0x80d320){return db[_0x7fa5('0x17')][_0x7fa5('0x18')](_0x3f2b34[_0x7fa5('0x19')],{'raw':_0x3f2b34[_0x7fa5('0x1a')]?_0x3f2b34[_0x7fa5('0x1a')][_0x7fa5('0x1b')]===undefined?!![]:![]:!![]})[_0x7fa5('0xb')](function(_0x49400c){logger[_0x7fa5('0xc')](_0x7fa5('0x16'),_0x3f2b34);logger[_0x7fa5('0xf')](_0x7fa5('0x16'),_0x3f2b34,JSON[_0x7fa5('0x11')](_0x49400c));_0x287aa4(_0x49400c);})[_0x7fa5('0x15')](function(_0x276820){logger[_0x7fa5('0x12')](_0x7fa5('0x16'),_0x276820[_0x7fa5('0x14')],_0x3f2b34);_0x80d320(_0x4f74d8[_0x7fa5('0x12')](0x1f4,_0x276820[_0x7fa5('0x14')]));});});}; \ No newline at end of file +var _0x2b29=['options','raw','info','CreateReportAgentPreview','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ReportAgentPreview','create','body'];(function(_0x3353a8,_0x185497){var _0x32c9b8=function(_0x1b377b){while(--_0x1b377b){_0x3353a8['push'](_0x3353a8['shift']());}};_0x32c9b8(++_0x185497);}(_0x2b29,0x160));var _0x92b2=function(_0x539665,_0x4f631d){_0x539665=_0x539665-0x0;var _0x522bdf=_0x2b29[_0x539665];return _0x522bdf;};'use strict';var _=require(_0x92b2('0x0'));var util=require(_0x92b2('0x1'));var moment=require('moment');var BPromise=require(_0x92b2('0x2'));var rs=require(_0x92b2('0x3'));var fs=require('fs');var Redis=require(_0x92b2('0x4'));var db=require(_0x92b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92b2('0x6'))(_0x92b2('0x7'));var config=require(_0x92b2('0x8'));var jayson=require(_0x92b2('0x9'));var client=jayson['client'][_0x92b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b93be,_0x4fd42f,_0x5ba3e8){return new BPromise(function(_0x551275,_0x17da0d){return client[_0x92b2('0xb')](_0x2b93be,_0x5ba3e8)['then'](function(_0x468ada){logger['info'](_0x92b2('0xc'),_0x4fd42f,_0x92b2('0xd'));logger[_0x92b2('0xe')](_0x92b2('0xf'),_0x4fd42f,'request\x20sent',JSON[_0x92b2('0x10')](_0x468ada));if(_0x468ada[_0x92b2('0x11')]){if(_0x468ada['error'][_0x92b2('0x12')]===0x1f4){logger[_0x92b2('0x11')](_0x92b2('0xc'),_0x4fd42f,_0x468ada['error'][_0x92b2('0x13')]);return _0x17da0d(_0x468ada['error'][_0x92b2('0x13')]);}logger[_0x92b2('0x11')](_0x92b2('0xc'),_0x4fd42f,_0x468ada[_0x92b2('0x11')][_0x92b2('0x13')]);return _0x551275(_0x468ada[_0x92b2('0x11')][_0x92b2('0x13')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x4fd42f,'request\x20sent');_0x551275(_0x468ada[_0x92b2('0x14')]['message']);}})[_0x92b2('0x15')](function(_0x250730){logger[_0x92b2('0x11')](_0x92b2('0xc'),_0x4fd42f,_0x250730);_0x17da0d(_0x250730);});});}exports['CreateReportAgentPreview']=function(_0x58f535){var _0xc3dfe9=this;return new Promise(function(_0x5bbb4c,_0x535136){return db[_0x92b2('0x16')][_0x92b2('0x17')](_0x58f535[_0x92b2('0x18')],{'raw':_0x58f535[_0x92b2('0x19')]?_0x58f535[_0x92b2('0x19')][_0x92b2('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xbe1b78){logger[_0x92b2('0x1b')](_0x92b2('0x1c'),_0x58f535);logger[_0x92b2('0xe')](_0x92b2('0x1c'),_0x58f535,JSON[_0x92b2('0x10')](_0xbe1b78));_0x5bbb4c(_0xbe1b78);})['catch'](function(_0x42f765){logger['error'](_0x92b2('0x1c'),_0x42f765[_0x92b2('0x13')],_0x58f535);_0x535136(_0xc3dfe9[_0x92b2('0x11')](0x1f4,_0x42f765['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 5d700b0..f943d27 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 _0x8149=['/agents/:id/notify','agentNotify','exports','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','/fax/accounts','faxAccounts','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','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','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues'];(function(_0x4dcc12,_0x344082){var _0x46f066=function(_0x165d78){while(--_0x165d78){_0x4dcc12['push'](_0x4dcc12['shift']());}};_0x46f066(++_0x344082);}(_0x8149,0x9d));var _0x9814=function(_0x259a6b,_0x391bd7){_0x259a6b=_0x259a6b-0x0;var _0x742738=_0x8149[_0x259a6b];return _0x742738;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9814('0x0'));var express=require(_0x9814('0x1'));var router=express['Router']();var auth=require(_0x9814('0x2'));var controller=require(_0x9814('0x3'));router[_0x9814('0x4')](_0x9814('0x5'),auth[_0x9814('0x6')](),controller[_0x9814('0x7')]);router['get'](_0x9814('0x8'),auth[_0x9814('0x6')](),controller['voiceChannelMixMonitor']);router[_0x9814('0x4')](_0x9814('0x9'),auth['isAuthenticated'](),controller[_0x9814('0xa')]);router[_0x9814('0x4')]('/voice/queues',auth[_0x9814('0x6')](),controller['voiceQueues']);router[_0x9814('0x4')](_0x9814('0xb'),auth[_0x9814('0x6')](),controller[_0x9814('0xc')]);router[_0x9814('0x4')](_0x9814('0xd'),auth['isAuthenticated'](),controller[_0x9814('0xe')]);router['get'](_0x9814('0xf'),auth[_0x9814('0x6')](),controller[_0x9814('0x10')]);router[_0x9814('0x4')](_0x9814('0x11'),auth[_0x9814('0x6')](),controller[_0x9814('0x12')]);router[_0x9814('0x4')](_0x9814('0x13'),auth[_0x9814('0x6')](),controller[_0x9814('0x14')]);router[_0x9814('0x4')](_0x9814('0x15'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0x9814('0x16'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x9814('0x4')]('/voice/queues/preview/:id',auth[_0x9814('0x6')](),controller[_0x9814('0x17')]);router[_0x9814('0x4')]('/voice/queues/channels',auth[_0x9814('0x6')](),controller[_0x9814('0x18')]);router[_0x9814('0x4')](_0x9814('0x19'),auth[_0x9814('0x6')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x9814('0x6')](),controller[_0x9814('0x1a')]);router[_0x9814('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x9814('0x1b')](_0x9814('0x1c'),auth[_0x9814('0x6')](),controller[_0x9814('0x1d')]);router[_0x9814('0x4')](_0x9814('0x1e'),auth[_0x9814('0x6')](),controller[_0x9814('0x1f')]);router[_0x9814('0x4')]('/outbound/channels',auth[_0x9814('0x6')](),controller[_0x9814('0x20')]);router[_0x9814('0x4')](_0x9814('0x21'),auth['isAuthenticated'](),controller[_0x9814('0x22')]);router['put'](_0x9814('0x23'),auth[_0x9814('0x6')](),controller[_0x9814('0x24')]);router[_0x9814('0x4')]('/telephones',auth[_0x9814('0x6')](),controller[_0x9814('0x25')]);router['get'](_0x9814('0x26'),auth[_0x9814('0x6')](),controller['trunks']);router[_0x9814('0x4')]('/campaigns',auth[_0x9814('0x6')](),controller['campaigns']);router[_0x9814('0x4')](_0x9814('0x27'),auth[_0x9814('0x6')](),controller[_0x9814('0x28')]);router[_0x9814('0x4')]('/chat/queues/waitinginteractions',auth[_0x9814('0x6')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0x9814('0x6')](),controller[_0x9814('0x29')]);router[_0x9814('0x4')](_0x9814('0x2a'),auth[_0x9814('0x6')](),controller[_0x9814('0x2b')]);router[_0x9814('0x4')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x9814('0x2c')]);router[_0x9814('0x4')](_0x9814('0x2d'),auth[_0x9814('0x6')](),controller[_0x9814('0x2e')]);router['get'](_0x9814('0x2f'),auth[_0x9814('0x6')](),controller[_0x9814('0x30')]);router[_0x9814('0x4')](_0x9814('0x31'),auth[_0x9814('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0x9814('0x32')](_0x9814('0x33'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')](_0x9814('0x35')));router[_0x9814('0x4')](_0x9814('0x36'),auth[_0x9814('0x6')](),controller['showMailQueues']);router['post'](_0x9814('0x37'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')](_0x9814('0x38')));router[_0x9814('0x4')](_0x9814('0x39'),auth[_0x9814('0x6')](),controller[_0x9814('0x3a')]);router[_0x9814('0x32')](_0x9814('0x3b'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')](_0x9814('0x3c')));router[_0x9814('0x4')](_0x9814('0x3d'),auth[_0x9814('0x6')](),controller[_0x9814('0x3e')]);router[_0x9814('0x32')](_0x9814('0x3f'),auth['isAuthenticated'](),controller[_0x9814('0x34')](_0x9814('0x40')));router[_0x9814('0x4')](_0x9814('0x41'),auth[_0x9814('0x6')](),controller[_0x9814('0x42')]);router[_0x9814('0x32')](_0x9814('0x43'),auth[_0x9814('0x6')](),controller[_0x9814('0x34')]('sms'));router[_0x9814('0x32')](_0x9814('0x44'),auth[_0x9814('0x6')](),controller['queueNotify'](_0x9814('0x45')));router[_0x9814('0x4')](_0x9814('0x46'),auth[_0x9814('0x6')](),controller[_0x9814('0x47')]);router['get'](_0x9814('0x48'),auth['isAuthenticated'](),controller[_0x9814('0x49')]);router[_0x9814('0x32')](_0x9814('0x4a'),auth['isAuthenticated'](),controller[_0x9814('0x4b')]);module[_0x9814('0x4c')]=router; \ No newline at end of file +var _0xd05a=['path','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0xd05a,0x143));var _0xad05=function(_0x2ec72f,_0x30ec10){_0x2ec72f=_0x2ec72f-0x0;var _0x365c2a=_0xd05a[_0x2ec72f];return _0x365c2a;};'use strict';var multer=require('multer');var util=require(_0xad05('0x0'));var path=require(_0xad05('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xad05('0x2')](_0xad05('0x3'),auth[_0xad05('0x4')](),controller[_0xad05('0x5')]);router[_0xad05('0x2')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xad05('0x6')]);router[_0xad05('0x2')](_0xad05('0x7'),auth['isAuthenticated'](),controller[_0xad05('0x8')]);router[_0xad05('0x2')](_0xad05('0x9'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0xad05('0x2')]('/chat/queues',auth[_0xad05('0x4')](),controller[_0xad05('0xa')]);router[_0xad05('0x2')](_0xad05('0xb'),auth[_0xad05('0x4')](),controller[_0xad05('0xc')]);router[_0xad05('0x2')](_0xad05('0xd'),auth[_0xad05('0x4')](),controller[_0xad05('0xe')]);router['get'](_0xad05('0xf'),auth['isAuthenticated'](),controller[_0xad05('0x10')]);router['get'](_0xad05('0x11'),auth[_0xad05('0x4')](),controller[_0xad05('0x12')]);router['get'](_0xad05('0x13'),auth['isAuthenticated'](),controller[_0xad05('0x14')]);router[_0xad05('0x2')](_0xad05('0x15'),auth[_0xad05('0x4')](),controller[_0xad05('0x16')]);router[_0xad05('0x2')]('/voice/queues/preview/:id',auth[_0xad05('0x4')](),controller[_0xad05('0x17')]);router[_0xad05('0x2')](_0xad05('0x18'),auth[_0xad05('0x4')](),controller[_0xad05('0x19')]);router[_0xad05('0x2')](_0xad05('0x1a'),auth[_0xad05('0x4')](),controller[_0xad05('0x1b')]);router[_0xad05('0x2')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xad05('0x4')](),controller[_0xad05('0x1c')]);router[_0xad05('0x2')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xad05('0x4')](),controller['voiceQueuesChannelRedirect']);router[_0xad05('0x2')](_0xad05('0x1d'),auth[_0xad05('0x4')](),controller[_0xad05('0x1e')]);router[_0xad05('0x1f')](_0xad05('0x1d'),auth[_0xad05('0x4')](),controller[_0xad05('0x20')]);router[_0xad05('0x2')](_0xad05('0x21'),auth['isAuthenticated'](),controller[_0xad05('0x22')]);router[_0xad05('0x2')](_0xad05('0x23'),auth[_0xad05('0x4')](),controller['outboundChannels']);router[_0xad05('0x2')](_0xad05('0x24'),auth[_0xad05('0x4')](),controller[_0xad05('0x25')]);router[_0xad05('0x1f')](_0xad05('0x26'),auth[_0xad05('0x4')](),controller['agentCapacity']);router['get'](_0xad05('0x27'),auth[_0xad05('0x4')](),controller[_0xad05('0x28')]);router['get']('/trunks',auth[_0xad05('0x4')](),controller[_0xad05('0x29')]);router[_0xad05('0x2')]('/campaigns',auth[_0xad05('0x4')](),controller[_0xad05('0x2a')]);router['get'](_0xad05('0x2b'),auth[_0xad05('0x4')](),controller[_0xad05('0x2c')]);router[_0xad05('0x2')](_0xad05('0x2d'),auth[_0xad05('0x4')](),controller[_0xad05('0x2e')]);router['get'](_0xad05('0x2f'),auth[_0xad05('0x4')](),controller['mailQueuesWaitingInteractions']);router[_0xad05('0x2')](_0xad05('0x30'),auth['isAuthenticated'](),controller[_0xad05('0x31')]);router[_0xad05('0x2')](_0xad05('0x32'),auth[_0xad05('0x4')](),controller[_0xad05('0x33')]);router[_0xad05('0x2')](_0xad05('0x34'),auth[_0xad05('0x4')](),controller[_0xad05('0x35')]);router[_0xad05('0x2')](_0xad05('0x36'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth[_0xad05('0x4')](),controller[_0xad05('0x37')]);router[_0xad05('0x38')](_0xad05('0x39'),auth['isAuthenticated'](),controller[_0xad05('0x3a')](_0xad05('0x3b')));router[_0xad05('0x2')](_0xad05('0x3c'),auth['isAuthenticated'](),controller[_0xad05('0x3d')]);router['post'](_0xad05('0x3e'),auth[_0xad05('0x4')](),controller[_0xad05('0x3a')]('chat'));router[_0xad05('0x2')](_0xad05('0x3f'),auth[_0xad05('0x4')](),controller[_0xad05('0x40')]);router[_0xad05('0x38')](_0xad05('0x41'),auth[_0xad05('0x4')](),controller[_0xad05('0x3a')]('fax'));router[_0xad05('0x2')](_0xad05('0x42'),auth[_0xad05('0x4')](),controller[_0xad05('0x43')]);router[_0xad05('0x38')](_0xad05('0x44'),auth[_0xad05('0x4')](),controller[_0xad05('0x3a')](_0xad05('0x45')));router['get'](_0xad05('0x46'),auth[_0xad05('0x4')](),controller[_0xad05('0x47')]);router[_0xad05('0x38')](_0xad05('0x48'),auth[_0xad05('0x4')](),controller[_0xad05('0x3a')](_0xad05('0x49')));router['post'](_0xad05('0x4a'),auth[_0xad05('0x4')](),controller['queueNotify'](_0xad05('0x4b')));router[_0xad05('0x2')]('/sms/queues/:id',auth[_0xad05('0x4')](),controller[_0xad05('0x4c')]);router[_0xad05('0x2')]('/whatsapp/queues/:id',auth[_0xad05('0x4')](),controller[_0xad05('0x4d')]);router[_0xad05('0x38')](_0xad05('0x4e'),auth['isAuthenticated'](),controller[_0xad05('0x4f')]);module[_0xad05('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index b325a58..57f7224 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 _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x3128c8,_0x5edbf0){var _0x5ea178=function(_0x5daac2){while(--_0x5daac2){_0x3128c8['push'](_0x3128c8['shift']());}};_0x5ea178(++_0x5edbf0);}(_0x2d17,0x17e));var _0x72d1=function(_0x10a22e,_0x59f0c2){_0x10a22e=_0x10a22e-0x0;var _0x7a972a=_0x2d17[_0x10a22e];return _0x7a972a;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file +var _0x7bae=['agent','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','MessageId','From','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','json','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','MemberReport','findOrCreate','interface','SIP/%s'];(function(_0x5056b6,_0x49fdcf){var _0x2d448f=function(_0x14dd86){while(--_0x14dd86){_0x5056b6['push'](_0x5056b6['shift']());}};_0x2d448f(++_0x49fdcf);}(_0x7bae,0x13b));var _0xe7ba=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7bae[_0x288f5e];return _0x476cc9;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xe7ba('0x2'))('api');var jayson=require(_0xe7ba('0x3'));var amiClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232a});var mailClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232b});var routingClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){var _0x41c39d=_0x34fb18?_0x34fb18:amiClient;return _0x41c39d[_0xe7ba('0x6')](_0x3c5e59,_0x10b307)['then'](function(_0x3df8bf){if(_0x3df8bf[_0xe7ba('0x7')]){if(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x8')]===0x1f4){return _0x27b1d5(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}return _0x160565(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}else{_0x160565(_0x3df8bf[_0xe7ba('0xa')]);}})['catch'](function(_0xf4fcb0){_0x27b1d5(_0xf4fcb0);});});}function respondWithResult(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xc8;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0xb')](_0x602b1)[_0xe7ba('0xc')](_0x45229c);}return _0x588c8b[_0xe7ba('0xd')](0x194);};}function handleError(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0x1f4;return function(_0x561c48){logger[_0xe7ba('0x7')](_0x561c48[_0xe7ba('0xe')]);if(_0x561c48[_0xe7ba('0xf')]){delete _0x561c48['name'];}_0x41369f[_0xe7ba('0xb')](_0x561dbb)['send'](_0x561c48);};}function findById(_0x590bab){return function(_0x5e9176){if(!_[_0xe7ba('0x10')](_0x590bab)&&!_['isNil'](_0x5e9176)&&!_[_0xe7ba('0x10')](_0x5e9176['rows'])){return _['find'](_0x5e9176['rows'],function(_0x3f326a){return _0x3f326a['id']==_0x590bab;});}return null;};}exports[_0xe7ba('0x11')]=function(_0x39ca38,_0x3c06c3){return respondWithRpcPromise(_0xe7ba('0x12'),_0x39ca38['query'])[_0xe7ba('0x13')](respondWithResult(_0x3c06c3,null))[_0xe7ba('0x14')](handleError(_0x3c06c3,null));};exports[_0xe7ba('0x15')]=function(_0x136ec6,_0x4aaf35){return respondWithRpcPromise(_0xe7ba('0x16'),_[_0xe7ba('0x17')](_0x136ec6['query'],_0x136ec6[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x4aaf35,null))[_0xe7ba('0x14')](handleError(_0x4aaf35,null));};exports[_0xe7ba('0x19')]=function(_0x394b69,_0x2acfc2){return respondWithRpcPromise(_0xe7ba('0x1a'),_[_0xe7ba('0x17')](_0x394b69[_0xe7ba('0x1b')],_0x394b69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x2acfc2,null))['catch'](handleError(_0x2acfc2,null));};exports['voiceQueues']=function(_0x4cd124,_0x4363a8){return respondWithRpcPromise('VoiceQueues',_0x4cd124['query'])['then'](respondWithResult(_0x4363a8,null))[_0xe7ba('0x14')](handleError(_0x4363a8,null));};exports[_0xe7ba('0x1c')]=function(_0xe32862,_0x2ea78a){return respondWithRpcPromise(_0xe7ba('0x1d'),_0xe32862[_0xe7ba('0x1b')])[_0xe7ba('0x13')](findById(_0xe32862[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x2ea78a,null))[_0xe7ba('0x14')](handleError(_0x2ea78a,null));};exports['updateVoiceQueue']=function(_0x102925,_0x92fe7){return respondWithRpcPromise(_0xe7ba('0x1e'),_['merge'](_0x102925['body'],_0x102925[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x92fe7,null))[_0xe7ba('0x14')](handleError(_0x92fe7,null));};exports[_0xe7ba('0x1f')]=function(_0x268308,_0x5279dd){return respondWithRpcPromise(_0xe7ba('0x20'),_[_0xe7ba('0x17')](_0x268308['query'],_0x268308[_0xe7ba('0x18')]))['then'](respondWithResult(_0x5279dd,null))['catch'](handleError(_0x5279dd,null));};exports[_0xe7ba('0x21')]=function(_0x134f21,_0x1be947){return respondWithRpcPromise('VoiceQueuesChannels',_0x134f21[_0xe7ba('0x1b')])['then'](respondWithResult(_0x1be947,null))[_0xe7ba('0x14')](handleError(_0x1be947,null));};exports[_0xe7ba('0x22')]=function(_0x3b0a69,_0x27a8d4){return respondWithRpcPromise(_0xe7ba('0x23'),_['merge'](_0x3b0a69[_0xe7ba('0x1b')],_0x3b0a69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x27a8d4,null))[_0xe7ba('0x14')](handleError(_0x27a8d4,null));};exports[_0xe7ba('0x24')]=function(_0x499d3b,_0x524726){return respondWithRpcPromise(_0xe7ba('0x25'),_[_0xe7ba('0x17')](_0x499d3b['query'],_0x499d3b[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x524726,null))[_0xe7ba('0x14')](handleError(_0x524726,null));};exports['voiceQueuesChannelRedirect']=function(_0x3e6eb7,_0x43b313){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe7ba('0x17')](_0x3e6eb7[_0xe7ba('0x1b')],_0x3e6eb7[_0xe7ba('0x18')]))['then'](respondWithResult(_0x43b313,null))['catch'](handleError(_0x43b313,null));};exports[_0xe7ba('0x26')]=function(_0x2ebb27,_0x58d2a){return respondWithRpcPromise(_0xe7ba('0x27'),_0x2ebb27[_0xe7ba('0x1b')])['then'](respondWithResult(_0x58d2a,null))[_0xe7ba('0x14')](handleError(_0x58d2a,null));};exports[_0xe7ba('0x28')]=function(_0x3139a6,_0x23a912){return respondWithRpcPromise('OutboundChannels',_0x3139a6[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x23a912,null))[_0xe7ba('0x14')](handleError(_0x23a912,null));};exports[_0xe7ba('0x29')]=function(_0x35a5f3,_0x3793c6){var _0x124cc4;return respondWithRpcPromise('Agents',_0x35a5f3[_0xe7ba('0x1b')])[_0xe7ba('0x13')](function(_0x359a4d){_0x124cc4=_0x359a4d;return respondWithRpcPromise(_0xe7ba('0x2a'),_0x35a5f3[_0xe7ba('0x1b')],routingClient);})[_0xe7ba('0x13')](function(_0x220c3b){return _[_0xe7ba('0x17')]({},_0x220c3b,_0x124cc4);})[_0xe7ba('0x13')](respondWithResult(_0x3793c6,null))['catch'](handleError(_0x3793c6,null));};exports[_0xe7ba('0x2b')]=function(_0x417734,_0x5d4be2){if(_0x417734['body']&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]&&_0x417734[_0xe7ba('0x2e')]&&_0x417734['user'][_0xe7ba('0xf')]){for(var _0x82246e in _0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]){if(_0x417734[_0xe7ba('0x2c')]['interaction'][_0xe7ba('0x2f')](_0x82246e)){db['MemberReport'][_0xe7ba('0x30')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':_0xe7ba('0x31'),'exitAt':null,'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]['length']?{'$notIn':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]}:{'$ne':null}}})[_0xe7ba('0x13')](function(_0x37dcaa){var _0x3620bc=moment()[_0xe7ba('0x32')](_0xe7ba('0x33'));for(var _0x2c54ac=0x0,_0x45f49a=_0x37dcaa[_0xe7ba('0x34')];_0x2c54ac<_0x45f49a;_0x2c54ac+=0x1){_0x37dcaa[_0x2c54ac]['updateAttributes']({'exitAt':_0x3620bc});}});for(var _0x19ccde=0x0;_0x19ccde<_0x417734['body'][_0xe7ba('0x2d')][_0x82246e][_0xe7ba('0x34')];_0x19ccde+=0x1){db[_0xe7ba('0x35')][_0xe7ba('0x36')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':'INTERACTION','uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde],'exitAt':null},'defaults':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'interface':_[_0xe7ba('0x10')](_0x417734[_0xe7ba('0x2e')][_0xe7ba('0x37')])?util[_0xe7ba('0x32')](_0xe7ba('0x38'),_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')]):_0x417734['user'][_0xe7ba('0x37')],'type':_0xe7ba('0x31'),'enterAt':moment()[_0xe7ba('0x32')](_0xe7ba('0x33')),'role':_0xe7ba('0x39'),'internal':_0x417734[_0xe7ba('0x2e')]['internal'],'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x417734[_0xe7ba('0x18')]['id'],'capacity':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x3a')]},routingClient)[_0xe7ba('0x13')](respondWithResult(_0x5d4be2,null))['catch'](handleError(_0x5d4be2,null));};exports['telephones']=function(_0xa80cf,_0x2cfdc3){return respondWithRpcPromise(_0xe7ba('0x3b'),_0xa80cf['query'])[_0xe7ba('0x13')](respondWithResult(_0x2cfdc3,null))[_0xe7ba('0x14')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x3c')]=function(_0x45bcbd,_0x14beb3){return respondWithRpcPromise(_0xe7ba('0x3d'),_0x45bcbd[_0xe7ba('0x1b')])['then'](respondWithResult(_0x14beb3,null))[_0xe7ba('0x14')](handleError(_0x14beb3,null));};exports[_0xe7ba('0x3e')]=function(_0x316b51,_0x5863c8){return respondWithRpcPromise(_0xe7ba('0x3f'),_0x316b51[_0xe7ba('0x1b')])['then'](respondWithResult(_0x5863c8,null))[_0xe7ba('0x14')](handleError(_0x5863c8,null));};exports[_0xe7ba('0x40')]=function(_0x4da728,_0x3b4ae4){return respondWithRpcPromise('ChatQueues',_0x4da728[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x3b4ae4,null))[_0xe7ba('0x14')](handleError(_0x3b4ae4,null));};exports['showChatQueues']=function(_0x38829a,_0x1128be){return respondWithRpcPromise(_0xe7ba('0x41'),_0x38829a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x38829a['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x1128be,null))[_0xe7ba('0x14')](handleError(_0x1128be,null));};exports[_0xe7ba('0x42')]=function(_0x19159c,_0x435dee){return respondWithRpcPromise('MailQueues',_0x19159c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x435dee,null))[_0xe7ba('0x14')](handleError(_0x435dee,null));};exports[_0xe7ba('0x43')]=function(_0x57b23e,_0x3e31c1){return respondWithRpcPromise(_0xe7ba('0x44'),_0x57b23e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x57b23e[_0xe7ba('0x18')]['id']))[_0xe7ba('0x13')](respondWithResult(_0x3e31c1,null))['catch'](handleError(_0x3e31c1,null));};exports[_0xe7ba('0x45')]=function(_0x103762,_0x3bd82f){return respondWithRpcPromise('MailAccounts',_0x103762[_0xe7ba('0x1b')],mailClient)[_0xe7ba('0x13')](respondWithResult(_0x3bd82f,null))[_0xe7ba('0x14')](handleError(_0x3bd82f,null));};exports[_0xe7ba('0x46')]=function(_0x45fb0f,_0x162d7f){return respondWithRpcPromise(_0xe7ba('0x47'),_0x45fb0f[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x162d7f,null))[_0xe7ba('0x14')](handleError(_0x162d7f,null));};exports[_0xe7ba('0x48')]=function(_0x27422d,_0x4a5c8c){return respondWithRpcPromise(_0xe7ba('0x47'),_0x27422d[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x27422d['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x4a5c8c,null))['catch'](handleError(_0x4a5c8c,null));};exports[_0xe7ba('0x49')]=function(_0x194dff,_0x781e04){return respondWithRpcPromise('SmsQueues',_0x194dff['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x781e04,null))[_0xe7ba('0x14')](handleError(_0x781e04,null));};exports[_0xe7ba('0x4a')]=function(_0x4de4c9,_0x3ba4fd){return respondWithRpcPromise(_0xe7ba('0x4b'),_0x4de4c9[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x4de4c9[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x3ba4fd,null))[_0xe7ba('0x14')](handleError(_0x3ba4fd,null));};exports[_0xe7ba('0x4c')]=function(_0x70ce9c,_0x50cc8b){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x70ce9c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x50cc8b,null))[_0xe7ba('0x14')](handleError(_0x50cc8b,null));};exports[_0xe7ba('0x4e')]=function(_0x29c046,_0x6c8738){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x29c046[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x29c046['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x6c8738,null))[_0xe7ba('0x14')](handleError(_0x6c8738,null));};exports[_0xe7ba('0x4f')]=function(_0xa6da9e,_0x4d8773){return respondWithRpcPromise('FaxQueues',_0xa6da9e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x4d8773,null))[_0xe7ba('0x14')](handleError(_0x4d8773,null));};exports['showFaxQueues']=function(_0x53ebd1,_0x5561cc){return respondWithRpcPromise(_0xe7ba('0x50'),_0x53ebd1[_0xe7ba('0x1b')],routingClient)['then'](findById(_0x53ebd1[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x5561cc,null))[_0xe7ba('0x14')](handleError(_0x5561cc,null));};exports['faxAccounts']=function(_0x11aded,_0x4ebe4a){return respondWithRpcPromise('FaxAccounts',_0x11aded[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x4ebe4a,null))[_0xe7ba('0x14')](handleError(_0x4ebe4a,null));};exports[_0xe7ba('0x51')]=function(_0x157d41,_0x35b755){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x157d41['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x35b755,null))[_0xe7ba('0x14')](handleError(_0x35b755,null));};exports[_0xe7ba('0x52')]=function(_0x2e6e90,_0x18f23e){return respondWithRpcPromise(_0xe7ba('0x53'),_0x2e6e90[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x18f23e,null))[_0xe7ba('0x14')](handleError(_0x18f23e,null));};exports[_0xe7ba('0x54')]=function(_0x325ecb,_0x246f91){return respondWithRpcPromise(_0xe7ba('0x55'),_0x325ecb[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x246f91,null))['catch'](handleError(_0x246f91,null));};exports[_0xe7ba('0x56')]=function(_0x3acb1a,_0x5e16f1){return respondWithRpcPromise(_0xe7ba('0x55'),_0x3acb1a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](function(_0x2471c8){if(_0x3acb1a[_0xe7ba('0x1b')][_0xe7ba('0x57')]!==undefined){var _0x24c94a=_(_0x2471c8[_0xe7ba('0x58')])[_0xe7ba('0x59')]([_0x3acb1a['query'][_0xe7ba('0x57')],_0x3acb1a['params']['id']])[_0xe7ba('0x5a')](_0xe7ba('0x5b'))[_0xe7ba('0x5c')]()['value']();return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x2f1938){return _0x24c94a[_0xe7ba('0x5d')](_0x2f1938['queue_id'])>-0x1;});}else{return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x433644){return _0x433644[_0xe7ba('0x5b')]===parseInt(_0x3acb1a['params']['id']);});}})[_0xe7ba('0x13')](respondWithResult(_0x5e16f1,null))[_0xe7ba('0x14')](handleError(_0x5e16f1,null));};exports[_0xe7ba('0x5e')]=function(_0x1bfb80,_0x16af73){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1bfb80['query'],routingClient)['then'](respondWithResult(_0x16af73,null))[_0xe7ba('0x14')](handleError(_0x16af73,null));};exports[_0xe7ba('0x5f')]=function(_0x41a346,_0x27e7a5){return respondWithRpcPromise(_0xe7ba('0x60'),_0x41a346[_0xe7ba('0x1b')],routingClient)['then'](respondWithResult(_0x27e7a5,null))[_0xe7ba('0x14')](handleError(_0x27e7a5,null));};exports['faxQueuesWaitingInteractions']=function(_0x439c96,_0x2e3e28){return respondWithRpcPromise(_0xe7ba('0x61'),_0x439c96[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x2e3e28,null))[_0xe7ba('0x14')](handleError(_0x2e3e28,null));};exports['queueNotify']=function(_0x44563b){return function(_0x4904d2,_0x8cba2c){var _0x18e715,_0x1d3035;var _0x5e70d9=_[_0xe7ba('0x62')](_0x44563b);var _0x52d73a=_0x44563b===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0x5e70d9+_0xe7ba('0x66')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x4904d2[_0xe7ba('0x18')]['id']}})[_0xe7ba('0x13')](function(_0x3bf6b8){if(_[_0xe7ba('0x10')](_0x3bf6b8)){throw new Error(_0x5e70d9+_0xe7ba('0x68'));}_0x18e715=_0x3bf6b8;return db[_0x5e70d9+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x4904d2[_0xe7ba('0x2c')][_0xe7ba('0x6a')]},'include':[{'model':db[_0x5e70d9+_0xe7ba('0x6b')],'as':_0xe7ba('0x6b')},{'model':db[_0x5e70d9+_0x52d73a],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x691f8c){if(_[_0xe7ba('0x10')](_0x691f8c)){throw new Error(_0x5e70d9+_0xe7ba('0x6c'));}_0x1d3035=_0x691f8c;return _0x691f8c[_0xe7ba('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe7ba('0x13')](function(){var _0x36cf6d={'uniqueid':_0x44563b+'.'+_0x1d3035['id']+'.'+_0x1d3035[_0xe7ba('0x6b')]['id'],'FromUserId':_0x4904d2['user']['id'],'type':'queue'};_0x36cf6d[_0x5e70d9+'MessageId']=_0x1d3035['id'];_0x36cf6d[_0x5e70d9+_0xe7ba('0x6e')]=_0x1d3035[_0xe7ba('0x6b')]['id'];_0x36cf6d['From'+_0x5e70d9+_0x52d73a+'Id']=_0x1d3035['Account']['id'];_0x36cf6d['To'+_0x5e70d9+_0xe7ba('0x6f')]=_0x18e715['id'];return db[_0x5e70d9+_0xe7ba('0x70')]['create'](_0x36cf6d);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise('Start',{'channel':_0x44563b,'interaction':_0x1d3035['Interaction'],'message':_0x1d3035,'account':_0x1d3035['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7ba('0x71'),'appdata':_0x18e715[_0xe7ba('0xf')]+','+(_0x1d3035[_0xe7ba('0x65')][_0xe7ba('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7ba('0x13')](respondWithResult(_0x8cba2c,null))[_0xe7ba('0x14')](handleError(_0x8cba2c,null));};};exports['agentNotify']=function(_0x575170,_0x459b0c){var _0x5d5722,_0x40ae10;if(_[_0xe7ba('0x10')](_0x575170[_0xe7ba('0x2c')]['channel'])){throw new Error(_0xe7ba('0x73'));}var _0x17391f=_0x575170[_0xe7ba('0x2c')][_0xe7ba('0x74')];var _0x34b5d8=_[_0xe7ba('0x62')](_0x17391f);var _0x44c657=_0x17391f===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0xe7ba('0x75')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x575170[_0xe7ba('0x18')]['id'],'role':_0xe7ba('0x39')}})[_0xe7ba('0x13')](function(_0x16b3df){if(_[_0xe7ba('0x10')](_0x16b3df)){throw new Error(_0xe7ba('0x76'));}_0x5d5722=_0x16b3df;return db[_0x34b5d8+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x575170[_0xe7ba('0x2c')]['messageId']},'include':[{'model':db[_0x34b5d8+'Interaction'],'as':'Interaction'},{'model':db[_0x34b5d8+_0x44c657],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x34f0f9){if(_[_0xe7ba('0x10')](_0x34f0f9)){throw new Error(_0x34b5d8+_0xe7ba('0x6c'));}_0x40ae10=_0x34f0f9;return _0x34f0f9['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c86d2={'uniqueid':_0x17391f+'.'+_0x40ae10['id']+'.'+_0x40ae10['Interaction']['id'],'FromUserId':_0x575170[_0xe7ba('0x2e')]['id'],'type':_0xe7ba('0x71'),'ToUserId':_0x5d5722['id']};_0x2c86d2[_0x34b5d8+_0xe7ba('0x77')]=_0x40ae10['id'];_0x2c86d2[_0x34b5d8+_0xe7ba('0x6e')]=_0x40ae10[_0xe7ba('0x6b')]['id'];_0x2c86d2[_0xe7ba('0x78')+_0x34b5d8+_0x44c657+'Id']=_0x40ae10[_0xe7ba('0x65')]['id'];return db[_0x34b5d8+_0xe7ba('0x70')]['create'](_0x2c86d2);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise(_0xe7ba('0x79'),{'channel':_0x17391f,'interaction':_0x40ae10[_0xe7ba('0x6b')],'message':_0x40ae10,'account':_0x40ae10['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5d5722[_0xe7ba('0xf')]+','+(_0x40ae10[_0xe7ba('0x65')][_0xe7ba('0x7a')]||0x12c),'interval':_0xe7ba('0x7b')}]},routingClient);})['then'](respondWithResult(_0x459b0c,null))[_0xe7ba('0x14')](handleError(_0x459b0c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a8bc868..0b66b28 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 _0xf375=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','post','create'];(function(_0x4f3684,_0x51913d){var _0x3b73d7=function(_0x3dfb5d){while(--_0x3dfb5d){_0x4f3684['push'](_0x4f3684['shift']());}};_0x3b73d7(++_0x51913d);}(_0xf375,0x6a));var _0x5f37=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf375[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x5f37('0x0'));var util=require(_0x5f37('0x1'));var path=require('path');var timeout=require(_0x5f37('0x2'));var express=require(_0x5f37('0x3'));var router=express[_0x5f37('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5f37('0x5'));router[_0x5f37('0x6')]('/',auth[_0x5f37('0x7')](),controller['index']);router[_0x5f37('0x6')](_0x5f37('0x8'),auth[_0x5f37('0x7')](),controller[_0x5f37('0x9')]);router['get'](_0x5f37('0xa'),auth[_0x5f37('0x7')](),controller['run']);router[_0x5f37('0xb')]('/',auth[_0x5f37('0x7')](),controller[_0x5f37('0xc')]);router[_0x5f37('0xd')](_0x5f37('0x8'),auth[_0x5f37('0x7')](),controller['update']);router[_0x5f37('0xe')](_0x5f37('0x8'),auth[_0x5f37('0x7')](),controller[_0x5f37('0xf')]);module[_0x5f37('0x10')]=router; \ No newline at end of file +var _0xe876=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','put','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe876,0x152));var _0x6e87=function(_0x430c7e,_0x289fba){_0x430c7e=_0x430c7e-0x0;var _0x21e758=_0xe876[_0x430c7e];return _0x21e758;};'use strict';var multer=require(_0x6e87('0x0'));var util=require(_0x6e87('0x1'));var path=require(_0x6e87('0x2'));var timeout=require(_0x6e87('0x3'));var express=require(_0x6e87('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e87('0x5'));var interaction=require(_0x6e87('0x6'));var config=require(_0x6e87('0x7'));var controller=require(_0x6e87('0x8'));router[_0x6e87('0x9')]('/',auth['isAuthenticated'](),controller[_0x6e87('0xa')]);router[_0x6e87('0x9')](_0x6e87('0xb'),auth[_0x6e87('0xc')](),controller[_0x6e87('0xd')]);router[_0x6e87('0x9')](_0x6e87('0xe'),auth[_0x6e87('0xc')](),controller[_0x6e87('0xf')]);router['post']('/',auth[_0x6e87('0xc')](),controller['create']);router[_0x6e87('0x10')](_0x6e87('0xb'),auth[_0x6e87('0xc')](),controller['update']);router[_0x6e87('0x11')]('/:id',auth[_0x6e87('0xc')](),controller[_0x6e87('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 0c9c8f0..8f3ee23 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 _0x6efc=['weeks','days','hours','minutes','ENUM','pdf','csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','years','quarters','months'];(function(_0x5a7f65,_0x3a6f0a){var _0x5bea13=function(_0x14576f){while(--_0x14576f){_0x5a7f65['push'](_0x5a7f65['shift']());}};_0x5bea13(++_0x3a6f0a);}(_0x6efc,0x14d));var _0xc6ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6efc[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc6ef('0x0'));module[_0xc6ef('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc6ef('0x2')]},'active':{'type':Sequelize[_0xc6ef('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc6ef('0x2')],'allowNull':![],'defaultValue':_0xc6ef('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc6ef('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xc6ef('0x6'),_0xc6ef('0x7'),_0xc6ef('0x8'),_0xc6ef('0x9'),_0xc6ef('0xa'),_0xc6ef('0xb'),_0xc6ef('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xc6ef('0xd')]('csv',_0xc6ef('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0xc6ef('0xf')},'type':{'type':Sequelize[_0xc6ef('0xd')]('custom','default'),'allowNull':![],'defaultValue':_0xc6ef('0x10')},'sendMail':{'type':Sequelize[_0xc6ef('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc6ef('0x2')]},'cc':{'type':Sequelize[_0xc6ef('0x11')]},'bcc':{'type':Sequelize[_0xc6ef('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x8c8c=['STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','minutes','csv','custom','default','TEXT','sequelize'];(function(_0x46cc44,_0x52b73c){var _0x54d8f0=function(_0x4d8584){while(--_0x4d8584){_0x46cc44['push'](_0x46cc44['shift']());}};_0x54d8f0(++_0x52b73c);}(_0x8c8c,0x7f));var _0xc8c8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8c8c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc8c8('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8c8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc8c8('0x1')]},'active':{'type':Sequelize[_0xc8c8('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc8c8('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xc8c8('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc8c8('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc8c8('0x5')](_0xc8c8('0x6'),_0xc8c8('0x7'),'months',_0xc8c8('0x8'),_0xc8c8('0x9'),_0xc8c8('0xa'),_0xc8c8('0xb')),'allowNull':![],'defaultValue':_0xc8c8('0x9')},'output':{'type':Sequelize['ENUM'](_0xc8c8('0xc'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xc8c8('0xc')},'type':{'type':Sequelize[_0xc8c8('0x5')](_0xc8c8('0xd'),_0xc8c8('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xc8c8('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc8c8('0xf')]},'bcc':{'type':Sequelize[_0xc8c8('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xc8c8('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8219963..53ade66 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 _0xa150=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','UserProfileResource','then','stack','name','status','index','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Schedule','includeAll','catch','show','params','keys','include','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','error','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x32623b,_0x4a0bca){var _0x1cf4e3=function(_0x571500){while(--_0x571500){_0x32623b['push'](_0x32623b['shift']());}};_0x1cf4e3(++_0x4a0bca);}(_0xa150,0x190));var _0x0a15=function(_0x138d27,_0x21d292){_0x138d27=_0x138d27-0x0;var _0x386fae=_0xa150[_0x138d27];return _0x386fae;};'use strict';var emlformat=require(_0x0a15('0x0'));var rimraf=require(_0x0a15('0x1'));var zipdir=require(_0x0a15('0x2'));var jsonpatch=require(_0x0a15('0x3'));var rp=require(_0x0a15('0x4'));var moment=require(_0x0a15('0x5'));var BPromise=require(_0x0a15('0x6'));var Mustache=require(_0x0a15('0x7'));var util=require('util');var path=require(_0x0a15('0x8'));var sox=require(_0x0a15('0x9'));var csv=require(_0x0a15('0xa'));var ejs=require(_0x0a15('0xb'));var fs=require('fs');var fs_extra=require(_0x0a15('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0a15('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0a15('0xe'));var toCsv=require(_0x0a15('0xa'));var querystring=require(_0x0a15('0xf'));var Papa=require(_0x0a15('0x10'));var Redis=require(_0x0a15('0x11'));var authService=require(_0x0a15('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0a15('0x13'));var hardwareService=require(_0x0a15('0x14'));var logger=require(_0x0a15('0x15'))(_0x0a15('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a15('0x17'));var db=require(_0x0a15('0x18'))['db'];function respondWithStatusCode(_0x95cad2,_0x31c3f4){_0x31c3f4=_0x31c3f4||0xcc;return function(_0x522b93){if(_0x522b93){return _0x95cad2[_0x0a15('0x19')](_0x31c3f4);}return _0x95cad2['status'](_0x31c3f4)[_0x0a15('0x1a')]();};}function respondWithResult(_0x3f5b5e,_0x177c7b){_0x177c7b=_0x177c7b||0xc8;return function(_0x33ab0f){if(_0x33ab0f){return _0x3f5b5e['status'](_0x177c7b)[_0x0a15('0x1b')](_0x33ab0f);}};}function respondWithFilteredResult(_0x4c3ca3,_0x4554d3){return function(_0x52ced8){if(_0x52ced8){var _0x10355d=typeof _0x4554d3['offset']===_0x0a15('0x1c')&&typeof _0x4554d3[_0x0a15('0x1d')]===_0x0a15('0x1c');var _0x5573d5=_0x52ced8[_0x0a15('0x1e')];var _0x318baa=_0x10355d?0x0:_0x4554d3['offset'];var _0x26af99=_0x10355d?_0x52ced8[_0x0a15('0x1e')]:_0x4554d3[_0x0a15('0x1f')]+_0x4554d3[_0x0a15('0x1d')];var _0x1a6527;if(_0x26af99>=_0x5573d5){_0x26af99=_0x5573d5;_0x1a6527=0xc8;}else{_0x1a6527=0xce;}_0x4c3ca3['status'](_0x1a6527);return _0x4c3ca3[_0x0a15('0x20')](_0x0a15('0x21'),_0x318baa+'-'+_0x26af99+'/'+_0x5573d5)[_0x0a15('0x1b')](_0x52ced8);}return null;};}function patchUpdates(_0x433884){return function(_0x36e82e){try{jsonpatch[_0x0a15('0x22')](_0x36e82e,_0x433884,!![]);}catch(_0x34d854){return BPromise['reject'](_0x34d854);}return _0x36e82e[_0x0a15('0x23')]();};}function saveUpdates(_0xf98d0,_0x30106e){return function(_0x12a17b){if(_0x12a17b){return _0x12a17b[_0x0a15('0x24')](_0xf98d0)['then'](function(_0x396eb0){return _0x396eb0;});}return null;};}function removeEntity(_0x5aaffe,_0x5f4338){return function(_0x507f82){if(_0x507f82){return _0x507f82[_0x0a15('0x25')]()['then'](function(){var _0x2339ec=_0x507f82['get']({'plain':!![]});var _0x59b7b5='Scheduler';return db[_0x0a15('0x26')]['destroy']({'where':{'type':_0x59b7b5,'resourceId':_0x2339ec['id']}})[_0x0a15('0x27')](function(){return _0x507f82;});})[_0x0a15('0x27')](function(){_0x5aaffe['status'](0xcc)[_0x0a15('0x1a')]();});}};}function handleEntityNotFound(_0x6edba2,_0x1e8e63){return function(_0x1377af){if(!_0x1377af){_0x6edba2[_0x0a15('0x19')](0x194);}return _0x1377af;};}function handleError(_0x13bfb9,_0x53b8ad){_0x53b8ad=_0x53b8ad||0x1f4;return function(_0x467f98){logger['error'](_0x467f98[_0x0a15('0x28')]);if(_0x467f98['name']){delete _0x467f98[_0x0a15('0x29')];}_0x13bfb9[_0x0a15('0x2a')](_0x53b8ad)['send'](_0x467f98);};}exports[_0x0a15('0x2b')]=function(_0x281d55,_0x1fe634){var _0x2b11d0={},_0x328527={},_0x5d1e89={'count':0x0,'rows':[]};var _0x5c24bd=_['map'](db['Schedule'][_0x0a15('0x2c')],function(_0x264210){return{'name':_0x264210['fieldName'],'type':_0x264210[_0x0a15('0x2d')]['key']};});_0x328527[_0x0a15('0x2e')]=_['map'](_0x5c24bd,_0x0a15('0x29'));_0x328527[_0x0a15('0x2f')]=_['keys'](_0x281d55[_0x0a15('0x2f')]);_0x328527[_0x0a15('0x30')]=_['intersection'](_0x328527[_0x0a15('0x2e')],_0x328527[_0x0a15('0x2f')]);_0x2b11d0['attributes']=_[_0x0a15('0x31')](_0x328527[_0x0a15('0x2e')],qs[_0x0a15('0x32')](_0x281d55[_0x0a15('0x2f')][_0x0a15('0x32')]));_0x2b11d0['attributes']=_0x2b11d0[_0x0a15('0x33')][_0x0a15('0x34')]?_0x2b11d0[_0x0a15('0x33')]:_0x328527[_0x0a15('0x2e')];if(!_0x281d55[_0x0a15('0x2f')]['hasOwnProperty'](_0x0a15('0x35'))){_0x2b11d0[_0x0a15('0x1d')]=qs[_0x0a15('0x1d')](_0x281d55[_0x0a15('0x2f')]['limit']);_0x2b11d0[_0x0a15('0x1f')]=qs[_0x0a15('0x1f')](_0x281d55[_0x0a15('0x2f')][_0x0a15('0x1f')]);}_0x2b11d0[_0x0a15('0x36')]=qs[_0x0a15('0x37')](_0x281d55['query'][_0x0a15('0x37')]);_0x2b11d0[_0x0a15('0x38')]=qs[_0x0a15('0x30')](_[_0x0a15('0x39')](_0x281d55['query'],_0x328527[_0x0a15('0x30')]),_0x5c24bd);if(_0x281d55[_0x0a15('0x2f')][_0x0a15('0x3a')]){_0x2b11d0[_0x0a15('0x38')]=_['merge'](_0x2b11d0[_0x0a15('0x38')],{'$or':_['map'](_0x5c24bd,function(_0x248d33){if(_0x248d33[_0x0a15('0x2d')]!==_0x0a15('0x3b')){var _0x522b35={};_0x522b35[_0x248d33[_0x0a15('0x29')]]={'$like':'%'+_0x281d55[_0x0a15('0x2f')][_0x0a15('0x3a')]+'%'};return _0x522b35;}})});}_0x2b11d0=_[_0x0a15('0x3c')]({},_0x2b11d0,_0x281d55[_0x0a15('0x3d')]);var _0x32e824={'where':_0x2b11d0[_0x0a15('0x38')]};return db[_0x0a15('0x3e')]['count'](_0x32e824)[_0x0a15('0x27')](function(_0x19f019){_0x5d1e89[_0x0a15('0x1e')]=_0x19f019;if(_0x281d55[_0x0a15('0x2f')][_0x0a15('0x3f')]){_0x2b11d0['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0x2b11d0);})[_0x0a15('0x27')](function(_0x42ebea){_0x5d1e89['rows']=_0x42ebea;return _0x5d1e89;})[_0x0a15('0x27')](respondWithFilteredResult(_0x1fe634,_0x2b11d0))[_0x0a15('0x40')](handleError(_0x1fe634,null));};exports[_0x0a15('0x41')]=function(_0x4a667d,_0x3ee956){var _0xa0f658={'raw':![],'where':{'id':_0x4a667d[_0x0a15('0x42')]['id']}},_0x5c9b4b={};_0x5c9b4b[_0x0a15('0x2e')]=_[_0x0a15('0x43')](db[_0x0a15('0x3e')][_0x0a15('0x2c')]);_0x5c9b4b[_0x0a15('0x2f')]=_[_0x0a15('0x43')](_0x4a667d[_0x0a15('0x2f')]);_0x5c9b4b[_0x0a15('0x30')]=_[_0x0a15('0x31')](_0x5c9b4b[_0x0a15('0x2e')],_0x5c9b4b['query']);_0xa0f658[_0x0a15('0x33')]=_['intersection'](_0x5c9b4b[_0x0a15('0x2e')],qs[_0x0a15('0x32')](_0x4a667d[_0x0a15('0x2f')]['fields']));_0xa0f658['attributes']=_0xa0f658[_0x0a15('0x33')]['length']?_0xa0f658['attributes']:_0x5c9b4b[_0x0a15('0x2e')];if(_0x4a667d[_0x0a15('0x2f')][_0x0a15('0x3f')]){_0xa0f658[_0x0a15('0x44')]=[{'all':!![]}];}_0xa0f658=_[_0x0a15('0x3c')]({},_0xa0f658,_0x4a667d[_0x0a15('0x3d')]);return db[_0x0a15('0x3e')][_0x0a15('0x45')](_0xa0f658)[_0x0a15('0x27')](handleEntityNotFound(_0x3ee956,null))[_0x0a15('0x27')](respondWithResult(_0x3ee956,null))['catch'](handleError(_0x3ee956,null));};exports[_0x0a15('0x46')]=function(_0x3ebc80,_0x248bea){return db[_0x0a15('0x3e')][_0x0a15('0x46')](_0x3ebc80['body'],{})[_0x0a15('0x27')](function(_0x10683e){var _0x56525c=_0x3ebc80['user'][_0x0a15('0x47')]({'plain':!![]});if(!_0x56525c)throw new Error(_0x0a15('0x48'));if(_0x56525c['role']===_0x0a15('0x49')){var _0x447c0d=_0x10683e['get']({'plain':!![]});var _0xd827e6=_0x0a15('0x4a');return db[_0x0a15('0x4b')][_0x0a15('0x45')]({'where':{'name':_0xd827e6,'userProfileId':_0x56525c[_0x0a15('0x4c')]},'raw':!![]})[_0x0a15('0x27')](function(_0x141329){if(_0x141329&&_0x141329[_0x0a15('0x4d')]===0x0){return db[_0x0a15('0x26')][_0x0a15('0x46')]({'name':_0x447c0d[_0x0a15('0x29')],'resourceId':_0x447c0d['id'],'type':_0x141329[_0x0a15('0x29')],'sectionId':_0x141329['id']},{})[_0x0a15('0x27')](function(){return _0x10683e;});}else{return _0x10683e;}})[_0x0a15('0x40')](function(_0x2f5bbc){logger[_0x0a15('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f5bbc);throw _0x2f5bbc;});}return _0x10683e;})[_0x0a15('0x27')](respondWithResult(_0x248bea,0xc9))[_0x0a15('0x40')](handleError(_0x248bea,null));};exports[_0x0a15('0x24')]=function(_0x96e9f9,_0x177dfa){if(_0x96e9f9[_0x0a15('0x4f')]['id']){delete _0x96e9f9[_0x0a15('0x4f')]['id'];}return db[_0x0a15('0x3e')][_0x0a15('0x45')]({'where':{'id':_0x96e9f9[_0x0a15('0x42')]['id']}})[_0x0a15('0x27')](handleEntityNotFound(_0x177dfa,null))[_0x0a15('0x27')](saveUpdates(_0x96e9f9[_0x0a15('0x4f')],null))[_0x0a15('0x27')](respondWithResult(_0x177dfa,null))[_0x0a15('0x40')](handleError(_0x177dfa,null));};exports['destroy']=function(_0x2e30ef,_0x3a13ad){return db[_0x0a15('0x3e')][_0x0a15('0x45')]({'where':{'id':_0x2e30ef[_0x0a15('0x42')]['id']}})[_0x0a15('0x27')](handleEntityNotFound(_0x3a13ad,null))[_0x0a15('0x27')](removeEntity(_0x3a13ad,null))[_0x0a15('0x40')](handleError(_0x3a13ad,null));};exports[_0x0a15('0x50')]=function(_0x57d262,_0x361d13,_0x2be6d9){var _0x497afd=require('../../config/schedule');return db[_0x0a15('0x3e')][_0x0a15('0x45')]({'where':{'id':_0x57d262['params']['id']},'raw':!![]})[_0x0a15('0x27')](handleEntityNotFound(_0x361d13,null))['then'](function(){_0x497afd[_0x0a15('0x50')](_0x57d262['params']['id']);})[_0x0a15('0x27')](respondWithStatusCode(_0x361d13,null))[_0x0a15('0x40')](handleError(_0x361d13,null));}; \ No newline at end of file +var _0x282d=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','get','Scheduler','UserProfileResource','then','error','stack','name','send','map','Schedule','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','create','body','user','role','find','userProfileId','autoAssociation','update','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x4f3efa,_0xa7d512){var _0x5622ab=function(_0x212b1c){while(--_0x212b1c){_0x4f3efa['push'](_0x4f3efa['shift']());}};_0x5622ab(++_0xa7d512);}(_0x282d,0x1d3));var _0xd282=function(_0x285716,_0x42c462){_0x285716=_0x285716-0x0;var _0x44e6c9=_0x282d[_0x285716];return _0x44e6c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd282('0x0'));var zipdir=require(_0xd282('0x1'));var jsonpatch=require(_0xd282('0x2'));var rp=require(_0xd282('0x3'));var moment=require(_0xd282('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd282('0x5'));var util=require(_0xd282('0x6'));var path=require(_0xd282('0x7'));var sox=require(_0xd282('0x8'));var csv=require(_0xd282('0x9'));var ejs=require(_0xd282('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd282('0xb'));var crypto=require(_0xd282('0xc'));var jsforce=require(_0xd282('0xd'));var deskjs=require(_0xd282('0xe'));var toCsv=require(_0xd282('0x9'));var querystring=require(_0xd282('0xf'));var Papa=require('papaparse');var Redis=require(_0xd282('0x10'));var authService=require(_0xd282('0x11'));var qs=require(_0xd282('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd282('0x13'));var logger=require(_0xd282('0x14'))('api');var utils=require(_0xd282('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x286005,_0x5ccb3a){_0x5ccb3a=_0x5ccb3a||0xcc;return function(_0x287a0c){if(_0x287a0c){return _0x286005['sendStatus'](_0x5ccb3a);}return _0x286005['status'](_0x5ccb3a)[_0xd282('0x16')]();};}function respondWithResult(_0x33db5a,_0x594020){_0x594020=_0x594020||0xc8;return function(_0x569b13){if(_0x569b13){return _0x33db5a[_0xd282('0x17')](_0x594020)[_0xd282('0x18')](_0x569b13);}};}function respondWithFilteredResult(_0x357174,_0x174604){return function(_0x3de674){if(_0x3de674){var _0x4c8ace=typeof _0x174604[_0xd282('0x19')]===_0xd282('0x1a')&&typeof _0x174604[_0xd282('0x1b')]===_0xd282('0x1a');var _0xeb622e=_0x3de674['count'];var _0x5ddb18=_0x4c8ace?0x0:_0x174604[_0xd282('0x19')];var _0x1f75bb=_0x4c8ace?_0x3de674['count']:_0x174604[_0xd282('0x19')]+_0x174604[_0xd282('0x1b')];var _0x24d393;if(_0x1f75bb>=_0xeb622e){_0x1f75bb=_0xeb622e;_0x24d393=0xc8;}else{_0x24d393=0xce;}_0x357174[_0xd282('0x17')](_0x24d393);return _0x357174[_0xd282('0x1c')](_0xd282('0x1d'),_0x5ddb18+'-'+_0x1f75bb+'/'+_0xeb622e)['json'](_0x3de674);}return null;};}function patchUpdates(_0x514e40){return function(_0x185640){try{jsonpatch[_0xd282('0x1e')](_0x185640,_0x514e40,!![]);}catch(_0x3586dd){return BPromise[_0xd282('0x1f')](_0x3586dd);}return _0x185640[_0xd282('0x20')]();};}function saveUpdates(_0x1e0ffe,_0x40755e){return function(_0x102de7){if(_0x102de7){return _0x102de7['update'](_0x1e0ffe)['then'](function(_0x1fb5b7){return _0x1fb5b7;});}return null;};}function removeEntity(_0x5ccba7,_0x2de86e){return function(_0x438332){if(_0x438332){return _0x438332[_0xd282('0x21')]()['then'](function(){var _0x12a77f=_0x438332[_0xd282('0x22')]({'plain':!![]});var _0x46c38f=_0xd282('0x23');return db[_0xd282('0x24')][_0xd282('0x21')]({'where':{'type':_0x46c38f,'resourceId':_0x12a77f['id']}})['then'](function(){return _0x438332;});})[_0xd282('0x25')](function(){_0x5ccba7[_0xd282('0x17')](0xcc)[_0xd282('0x16')]();});}};}function handleEntityNotFound(_0x141931,_0x1b401d){return function(_0xd584e9){if(!_0xd584e9){_0x141931['sendStatus'](0x194);}return _0xd584e9;};}function handleError(_0x3954cb,_0x4c3a5d){_0x4c3a5d=_0x4c3a5d||0x1f4;return function(_0x1b7a27){logger[_0xd282('0x26')](_0x1b7a27[_0xd282('0x27')]);if(_0x1b7a27[_0xd282('0x28')]){delete _0x1b7a27[_0xd282('0x28')];}_0x3954cb[_0xd282('0x17')](_0x4c3a5d)[_0xd282('0x29')](_0x1b7a27);};}exports['index']=function(_0x50486c,_0x52ab78){var _0x344a50={},_0x73d2d8={},_0x3e4cea={'count':0x0,'rows':[]};var _0x57eaac=_[_0xd282('0x2a')](db[_0xd282('0x2b')]['rawAttributes'],function(_0x3c367b){return{'name':_0x3c367b[_0xd282('0x2c')],'type':_0x3c367b[_0xd282('0x2d')][_0xd282('0x2e')]};});_0x73d2d8[_0xd282('0x2f')]=_[_0xd282('0x2a')](_0x57eaac,_0xd282('0x28'));_0x73d2d8['query']=_['keys'](_0x50486c[_0xd282('0x30')]);_0x73d2d8['filters']=_[_0xd282('0x31')](_0x73d2d8['model'],_0x73d2d8[_0xd282('0x30')]);_0x344a50[_0xd282('0x32')]=_[_0xd282('0x31')](_0x73d2d8['model'],qs[_0xd282('0x33')](_0x50486c[_0xd282('0x30')]['fields']));_0x344a50[_0xd282('0x32')]=_0x344a50[_0xd282('0x32')]['length']?_0x344a50[_0xd282('0x32')]:_0x73d2d8['model'];if(!_0x50486c[_0xd282('0x30')]['hasOwnProperty'](_0xd282('0x34'))){_0x344a50['limit']=qs[_0xd282('0x1b')](_0x50486c[_0xd282('0x30')][_0xd282('0x1b')]);_0x344a50[_0xd282('0x19')]=qs[_0xd282('0x19')](_0x50486c[_0xd282('0x30')]['offset']);}_0x344a50['order']=qs['sort'](_0x50486c[_0xd282('0x30')][_0xd282('0x35')]);_0x344a50[_0xd282('0x36')]=qs[_0xd282('0x37')](_['pick'](_0x50486c[_0xd282('0x30')],_0x73d2d8[_0xd282('0x37')]),_0x57eaac);if(_0x50486c['query'][_0xd282('0x38')]){_0x344a50[_0xd282('0x36')]=_[_0xd282('0x39')](_0x344a50['where'],{'$or':_[_0xd282('0x2a')](_0x57eaac,function(_0x5267dd){if(_0x5267dd[_0xd282('0x2d')]!==_0xd282('0x3a')){var _0x53bee0={};_0x53bee0[_0x5267dd[_0xd282('0x28')]]={'$like':'%'+_0x50486c[_0xd282('0x30')][_0xd282('0x38')]+'%'};return _0x53bee0;}})});}_0x344a50=_[_0xd282('0x39')]({},_0x344a50,_0x50486c[_0xd282('0x3b')]);var _0x550f13={'where':_0x344a50[_0xd282('0x36')]};return db[_0xd282('0x2b')][_0xd282('0x3c')](_0x550f13)[_0xd282('0x25')](function(_0x402015){_0x3e4cea['count']=_0x402015;if(_0x50486c['query']['includeAll']){_0x344a50[_0xd282('0x3d')]=[{'all':!![]}];}return db[_0xd282('0x2b')][_0xd282('0x3e')](_0x344a50);})[_0xd282('0x25')](function(_0x36ed2a){_0x3e4cea[_0xd282('0x3f')]=_0x36ed2a;return _0x3e4cea;})[_0xd282('0x25')](respondWithFilteredResult(_0x52ab78,_0x344a50))[_0xd282('0x40')](handleError(_0x52ab78,null));};exports[_0xd282('0x41')]=function(_0x79390e,_0x24778e){var _0x1ac688={'raw':![],'where':{'id':_0x79390e[_0xd282('0x42')]['id']}},_0x2a0f8a={};_0x2a0f8a[_0xd282('0x2f')]=_[_0xd282('0x43')](db[_0xd282('0x2b')][_0xd282('0x44')]);_0x2a0f8a[_0xd282('0x30')]=_['keys'](_0x79390e[_0xd282('0x30')]);_0x2a0f8a[_0xd282('0x37')]=_['intersection'](_0x2a0f8a['model'],_0x2a0f8a['query']);_0x1ac688['attributes']=_[_0xd282('0x31')](_0x2a0f8a[_0xd282('0x2f')],qs['fields'](_0x79390e[_0xd282('0x30')][_0xd282('0x33')]));_0x1ac688['attributes']=_0x1ac688['attributes']['length']?_0x1ac688[_0xd282('0x32')]:_0x2a0f8a[_0xd282('0x2f')];if(_0x79390e[_0xd282('0x30')][_0xd282('0x45')]){_0x1ac688[_0xd282('0x3d')]=[{'all':!![]}];}_0x1ac688=_['merge']({},_0x1ac688,_0x79390e['options']);return db['Schedule']['find'](_0x1ac688)['then'](handleEntityNotFound(_0x24778e,null))['then'](respondWithResult(_0x24778e,null))[_0xd282('0x40')](handleError(_0x24778e,null));};exports[_0xd282('0x46')]=function(_0xf43234,_0x5b6125){return db[_0xd282('0x2b')][_0xd282('0x46')](_0xf43234[_0xd282('0x47')],{})[_0xd282('0x25')](function(_0x2b02b0){var _0x39e88d=_0xf43234[_0xd282('0x48')][_0xd282('0x22')]({'plain':!![]});if(!_0x39e88d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39e88d[_0xd282('0x49')]===_0xd282('0x48')){var _0x531f41=_0x2b02b0[_0xd282('0x22')]({'plain':!![]});var _0x2796d1=_0xd282('0x23');return db['UserProfileSection'][_0xd282('0x4a')]({'where':{'name':_0x2796d1,'userProfileId':_0x39e88d[_0xd282('0x4b')]},'raw':!![]})[_0xd282('0x25')](function(_0x43f779){if(_0x43f779&&_0x43f779[_0xd282('0x4c')]===0x0){return db[_0xd282('0x24')]['create']({'name':_0x531f41[_0xd282('0x28')],'resourceId':_0x531f41['id'],'type':_0x43f779['name'],'sectionId':_0x43f779['id']},{})[_0xd282('0x25')](function(){return _0x2b02b0;});}else{return _0x2b02b0;}})[_0xd282('0x40')](function(_0x3108e1){logger[_0xd282('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3108e1);throw _0x3108e1;});}return _0x2b02b0;})[_0xd282('0x25')](respondWithResult(_0x5b6125,0xc9))[_0xd282('0x40')](handleError(_0x5b6125,null));};exports[_0xd282('0x4d')]=function(_0x2b05eb,_0x3cca89){if(_0x2b05eb[_0xd282('0x47')]['id']){delete _0x2b05eb['body']['id'];}return db[_0xd282('0x2b')][_0xd282('0x4a')]({'where':{'id':_0x2b05eb['params']['id']}})['then'](handleEntityNotFound(_0x3cca89,null))[_0xd282('0x25')](saveUpdates(_0x2b05eb[_0xd282('0x47')],null))[_0xd282('0x25')](respondWithResult(_0x3cca89,null))['catch'](handleError(_0x3cca89,null));};exports[_0xd282('0x21')]=function(_0x436ffc,_0x3763d9){return db[_0xd282('0x2b')]['find']({'where':{'id':_0x436ffc[_0xd282('0x42')]['id']}})[_0xd282('0x25')](handleEntityNotFound(_0x3763d9,null))['then'](removeEntity(_0x3763d9,null))[_0xd282('0x40')](handleError(_0x3763d9,null));};exports[_0xd282('0x4e')]=function(_0x649bb6,_0x37e42a,_0x1372b1){var _0x19b374=require(_0xd282('0x4f'));return db[_0xd282('0x2b')][_0xd282('0x4a')]({'where':{'id':_0x649bb6[_0xd282('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x37e42a,null))[_0xd282('0x25')](function(){_0x19b374['run'](_0x649bb6['params']['id']);})[_0xd282('0x25')](respondWithStatusCode(_0x37e42a,null))[_0xd282('0x40')](handleError(_0x37e42a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 0974a97..907d391 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 _0x6120=['rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x6120,0x10e));var _0x0612=function(_0x2b8760,_0x37ae41){_0x2b8760=_0x2b8760-0x0;var _0x41bd30=_0x6120[_0x2b8760];return _0x41bd30;};'use strict';var _=require(_0x0612('0x0'));var util=require(_0x0612('0x1'));var logger=require(_0x0612('0x2'))(_0x0612('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0612('0x4'));var fs=require('fs');var path=require(_0x0612('0x5'));var rimraf=require(_0x0612('0x6'));var config=require(_0x0612('0x7'));var attributes=require(_0x0612('0x8'));module[_0x0612('0x9')]=function(_0x3abb0b,_0x1d1328){return _0x3abb0b[_0x0612('0xa')](_0x0612('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x622f=['moment','bluebird','path','rimraf','../../config/environment','exports','define','Schedule','tools_schedules','lodash','api'];(function(_0x5dfc06,_0x11a761){var _0x5824be=function(_0x3d4df0){while(--_0x3d4df0){_0x5dfc06['push'](_0x5dfc06['shift']());}};_0x5824be(++_0x11a761);}(_0x622f,0x1b6));var _0xf622=function(_0x4a3f01,_0x20687d){_0x4a3f01=_0x4a3f01-0x0;var _0x14fd54=_0x622f[_0x4a3f01];return _0x14fd54;};'use strict';var _=require(_0xf622('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf622('0x1'));var moment=require(_0xf622('0x2'));var BPromise=require(_0xf622('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf622('0x4'));var rimraf=require(_0xf622('0x5'));var config=require(_0xf622('0x6'));var attributes=require('./schedule.attributes');module[_0xf622('0x7')]=function(_0xd97e1d,_0x11e81d){return _0xd97e1d[_0xf622('0x8')](_0xf622('0x9'),attributes,{'tableName':_0xf622('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 90ac966..00ef454 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 _0xe678=['../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','ioredis','../../config/logger'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0xe678,0x12f));var _0x8e67=function(_0x1bea8c,_0x2bc951){_0x1bea8c=_0x1bea8c-0x0;var _0x1d1dd6=_0xe678[_0x1bea8c];return _0x1d1dd6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8e67('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e67('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e67('0x2'))('rpc');var config=require(_0x8e67('0x3'));var jayson=require(_0x8e67('0x4'));var client=jayson['client'][_0x8e67('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5c677c,_0x360687,_0x5d0b5e){return new BPromise(function(_0x192037,_0x2993cb){return client[_0x8e67('0x6')](_0x5c677c,_0x5d0b5e)[_0x8e67('0x7')](function(_0x5e727f){logger[_0x8e67('0x8')](_0x8e67('0x9'),_0x360687,_0x8e67('0xa'));logger[_0x8e67('0xb')](_0x8e67('0xc'),_0x360687,_0x8e67('0xa'),JSON[_0x8e67('0xd')](_0x5e727f));if(_0x5e727f[_0x8e67('0xe')]){if(_0x5e727f['error'][_0x8e67('0xf')]===0x1f4){logger[_0x8e67('0xe')]('Schedule,\x20%s,\x20%s',_0x360687,_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);return _0x2993cb(_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);}logger['error'](_0x8e67('0x9'),_0x360687,_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);return _0x192037(_0x5e727f[_0x8e67('0xe')][_0x8e67('0x10')]);}else{logger[_0x8e67('0x8')](_0x8e67('0x9'),_0x360687,_0x8e67('0xa'));_0x192037(_0x5e727f['result'][_0x8e67('0x10')]);}})[_0x8e67('0x11')](function(_0x4cd911){logger[_0x8e67('0xe')](_0x8e67('0x9'),_0x360687,_0x4cd911);_0x2993cb(_0x4cd911);});});} \ No newline at end of file +var _0x4853=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x1b3101,_0x337dce){var _0x5e7fc6=function(_0x22854c){while(--_0x22854c){_0x1b3101['push'](_0x1b3101['shift']());}};_0x5e7fc6(++_0x337dce);}(_0x4853,0x120));var _0x3485=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4853[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3485('0x0'));var moment=require(_0x3485('0x1'));var BPromise=require(_0x3485('0x2'));var rs=require(_0x3485('0x3'));var fs=require('fs');var Redis=require(_0x3485('0x4'));var db=require(_0x3485('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3485('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3485('0x7')][_0x3485('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5477b2,_0x6735d6,_0x42c9e3){return new BPromise(function(_0x2469ce,_0x359863){return client['request'](_0x5477b2,_0x42c9e3)['then'](function(_0x4edf35){logger['info'](_0x3485('0x9'),_0x6735d6,_0x3485('0xa'));logger['debug'](_0x3485('0xb'),_0x6735d6,'request\x20sent',JSON[_0x3485('0xc')](_0x4edf35));if(_0x4edf35['error']){if(_0x4edf35[_0x3485('0xd')][_0x3485('0xe')]===0x1f4){logger[_0x3485('0xd')](_0x3485('0x9'),_0x6735d6,_0x4edf35[_0x3485('0xd')][_0x3485('0xf')]);return _0x359863(_0x4edf35[_0x3485('0xd')][_0x3485('0xf')]);}logger[_0x3485('0xd')](_0x3485('0x9'),_0x6735d6,_0x4edf35['error']['message']);return _0x2469ce(_0x4edf35[_0x3485('0xd')]['message']);}else{logger[_0x3485('0x10')]('Schedule,\x20%s,\x20%s',_0x6735d6,_0x3485('0xa'));_0x2469ce(_0x4edf35['result'][_0x3485('0xf')]);}})[_0x3485('0x11')](function(_0x44eb9a){logger['error']('Schedule,\x20%s,\x20%s',_0x6735d6,_0x44eb9a);_0x359863(_0x44eb9a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 6b05124..eef6678 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 _0x6bcd=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','post','put','update'];(function(_0x335137,_0x536888){var _0x188ada=function(_0x963946){while(--_0x963946){_0x335137['push'](_0x335137['shift']());}};_0x188ada(++_0x536888);}(_0x6bcd,0x14d));var _0xd6bc=function(_0x45e0fc,_0x5eaa25){_0x45e0fc=_0x45e0fc-0x0;var _0x450d09=_0x6bcd[_0x45e0fc];return _0x450d09;};'use strict';var multer=require(_0xd6bc('0x0'));var util=require(_0xd6bc('0x1'));var path=require(_0xd6bc('0x2'));var timeout=require(_0xd6bc('0x3'));var express=require(_0xd6bc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd6bc('0x5'));var interaction=require(_0xd6bc('0x6'));var config=require('../../config/environment');var controller=require(_0xd6bc('0x7'));router['get']('/',auth[_0xd6bc('0x8')](),controller[_0xd6bc('0x9')]);router[_0xd6bc('0xa')](_0xd6bc('0xb'),auth[_0xd6bc('0x8')](),controller['describe']);router[_0xd6bc('0xa')](_0xd6bc('0xc'),auth[_0xd6bc('0x8')](),controller[_0xd6bc('0xd')]);router[_0xd6bc('0xa')](_0xd6bc('0xe'),auth[_0xd6bc('0x8')](),controller[_0xd6bc('0xf')]);router[_0xd6bc('0x10')]('/',auth[_0xd6bc('0x8')](),controller['create']);router[_0xd6bc('0x11')](_0xd6bc('0xc'),auth['isAuthenticated'](),controller[_0xd6bc('0x12')]);router[_0xd6bc('0x13')](_0xd6bc('0xc'),auth[_0xd6bc('0x8')](),controller[_0xd6bc('0x14')]);module[_0xd6bc('0x15')]=router; \ No newline at end of file +var _0x1b25=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','download','put','update','delete'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b25,0x79));var _0x51b2=function(_0x3b48ee,_0x47ff10){_0x3b48ee=_0x3b48ee-0x0;var _0x50023d=_0x1b25[_0x3b48ee];return _0x50023d;};'use strict';var multer=require('multer');var util=require(_0x51b2('0x0'));var path=require('path');var timeout=require(_0x51b2('0x1'));var express=require(_0x51b2('0x2'));var router=express[_0x51b2('0x3')]();var fs_extra=require(_0x51b2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x51b2('0x5'));var controller=require('./screenRecording.controller');router[_0x51b2('0x6')]('/',auth[_0x51b2('0x7')](),controller[_0x51b2('0x8')]);router[_0x51b2('0x6')]('/describe',auth[_0x51b2('0x7')](),controller['describe']);router[_0x51b2('0x6')](_0x51b2('0x9'),auth[_0x51b2('0x7')](),controller[_0x51b2('0xa')]);router['get']('/:id/download',auth[_0x51b2('0x7')](),controller[_0x51b2('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x51b2('0xc')]('/:id',auth[_0x51b2('0x7')](),controller[_0x51b2('0xd')]);router[_0x51b2('0xe')](_0x51b2('0x9'),auth[_0x51b2('0x7')](),controller[_0x51b2('0xf')]);module[_0x51b2('0x10')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index abb51f0..7f81f0a 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 _0x0c6b=['closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','startedAt','subtract'];(function(_0x22407e,_0x2a8907){var _0x846747=function(_0x120acd){while(--_0x120acd){_0x22407e['push'](_0x22407e['shift']());}};_0x846747(++_0x2a8907);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x3ab45a,_0x1f147a){_0x3ab45a=_0x3ab45a-0x0;var _0x46b76b=_0x0c6b[_0x3ab45a];return _0x46b76b;};'use strict';var Sequelize=require(_0xb0c6('0x0'));var moment=require('moment');var path=require(_0xb0c6('0x1'));var config=require(_0xb0c6('0x2'));module[_0xb0c6('0x3')]={'format':{'type':Sequelize[_0xb0c6('0x4')],'get':function(){return this[_0xb0c6('0x5')](_0xb0c6('0x6'))?path[_0xb0c6('0x7')](this[_0xb0c6('0x5')](_0xb0c6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb0c6('0x8')]},'channel':{'type':Sequelize[_0xb0c6('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x590ef9){var _0x5ec174=_0x590ef9['replace'](/\\/g,'/');this[_0xb0c6('0x9')](_0xb0c6('0x6'),_0x5ec174);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x2beb18){this[_0xb0c6('0x9')](_0xb0c6('0xa'),moment()[_0xb0c6('0xb')](_0x2beb18,'ms'));this[_0xb0c6('0x9')](_0xb0c6('0xc'),moment());this[_0xb0c6('0x9')](_0xb0c6('0xd'),_0x2beb18);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb0c6('0x5')]('startedAt'))[_0xb0c6('0xe')](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb0c6('0x5')](_0xb0c6('0xc')))[_0xb0c6('0xe')](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}},'createdAt':{'type':Sequelize[_0xb0c6('0x11')],'get':function(){return moment(this[_0xb0c6('0x5')](_0xb0c6('0x12')))['format'](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}},'updatedAt':{'type':Sequelize[_0xb0c6('0x11')],'get':function(){return moment(this[_0xb0c6('0x5')]('updatedAt'))[_0xb0c6('0xe')](_0xb0c6('0xf'))[_0xb0c6('0x10')]();}}}; \ No newline at end of file +var _0x18c9=['createdAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','value','extname','STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','getDataValue'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x18c9,0x13c));var _0x918c=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x18c9[_0x3f4891];return _0x54f2d8;};'use strict';var Sequelize=require(_0x918c('0x0'));var moment=require(_0x918c('0x1'));var path=require(_0x918c('0x2'));var config=require(_0x918c('0x3'));module[_0x918c('0x4')]={'format':{'type':Sequelize[_0x918c('0x5')],'get':function(){return this['getDataValue'](_0x918c('0x6'))?path[_0x918c('0x7')](this['getDataValue'](_0x918c('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x918c('0x8')]},'value':{'type':Sequelize[_0x918c('0x8')],'set':function(_0x467d0b){var _0x2aa435=_0x467d0b[_0x918c('0x9')](/\\/g,'/');this['setDataValue'](_0x918c('0x6'),_0x2aa435);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xc0b338){this[_0x918c('0xa')](_0x918c('0xb'),moment()[_0x918c('0xc')](_0xc0b338,'ms'));this[_0x918c('0xa')](_0x918c('0xd'),moment());this[_0x918c('0xa')](_0x918c('0xe'),_0xc0b338);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x918c('0xb')))[_0x918c('0xf')](_0x918c('0x10'))[_0x918c('0x11')]();}},'closedAt':{'type':Sequelize[_0x918c('0x12')],'get':function(){return moment(this['getDataValue'](_0x918c('0xd')))[_0x918c('0xf')](_0x918c('0x10'))[_0x918c('0x11')]();}},'createdAt':{'type':Sequelize[_0x918c('0x12')],'get':function(){return moment(this[_0x918c('0x13')](_0x918c('0x14')))[_0x918c('0xf')](_0x918c('0x10'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('updatedAt'))['format'](_0x918c('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 963811c..6755cad 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 _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x13bdf2,_0x220793){var _0x5583df=function(_0x2ee7a1){while(--_0x2ee7a1){_0x13bdf2['push'](_0x13bdf2['shift']());}};_0x5583df(++_0x220793);}(_0x33c5,0xe6));var _0x533c=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x33c5[_0x1dc24d];return _0x5d7fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));}; \ No newline at end of file +var _0x5fd1=['body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','join','value','format','%s.cypher','decryptFile','secrets','recording','root','server/files/screen_recordings','existsSync','Sequelize','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ScreenRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create'];(function(_0x4668a6,_0x4e8a1f){var _0x23215d=function(_0x4f4cfc){while(--_0x4f4cfc){_0x4668a6['push'](_0x4668a6['shift']());}};_0x23215d(++_0x4e8a1f);}(_0x5fd1,0x155));var _0x15fd=function(_0x55a046,_0x2d0ad1){_0x55a046=_0x55a046-0x0;var _0x2489b0=_0x5fd1[_0x55a046];return _0x2489b0;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['differenceBy'](_[_0x15fd('0x26')](_0x4590a1,_0x15fd('0x23')),['format']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],_0x218034['query']);_0x6c213b[_0x15fd('0x2f')]=_[_0x15fd('0x2e')](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x30')](_0x27d2c4['query'][_0x15fd('0x30')]));_0x6c213b[_0x15fd('0x2f')]=_0x6c213b[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x6c213b[_0x15fd('0x2f')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4['query'][_0x15fd('0x32')](_0x15fd('0x33'))){_0x6c213b['limit']=qs[_0x15fd('0x19')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x19')]);_0x6c213b['offset']=qs[_0x15fd('0x1a')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x34')]=qs[_0x15fd('0x35')](_0x27d2c4[_0x15fd('0x2b')]['sort']);_0x6c213b['where']=qs['filters'](_[_0x15fd('0x36')](_0x27d2c4[_0x15fd('0x2b')],_0x218034[_0x15fd('0x2d')]),_0x4590a1);if(_0x27d2c4['query']['filter']){_0x6c213b[_0x15fd('0x37')]=_['merge'](_0x6c213b['where'],{'$or':_['map'](_0x4590a1,function(_0x2edb0d){if(_0x2edb0d[_0x15fd('0x38')]!==_0x15fd('0x39')){var _0x59d0d7={};_0x59d0d7[_0x2edb0d[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]+'%'};return _0x59d0d7;}})});}_0x6c213b=_['merge']({},_0x6c213b,_0x27d2c4[_0x15fd('0x3b')]);var _0x1c4d40={'where':_0x6c213b[_0x15fd('0x37')]};return db[_0x15fd('0x27')][_0x15fd('0x3c')](_0x1c4d40)[_0x15fd('0x1f')](function(_0x19a29f){_0xe650a3[_0x15fd('0x3c')]=_0x19a29f;if(_0x27d2c4[_0x15fd('0x2b')]['includeAll']){_0x6c213b[_0x15fd('0x3d')]=[{'all':!![]}];}return db[_0x15fd('0x27')][_0x15fd('0x3e')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x2d2b6f){_0xe650a3[_0x15fd('0x3f')]=_0x2d2b6f;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x40')](handleError(_0x233ed3,null));};exports[_0x15fd('0x41')]=function(_0x104eef,_0x2eb6b6){var _0x145eab={'raw':![],'where':{'id':_0x104eef[_0x15fd('0x42')]['id']}},_0x269aae={};_0x269aae[_0x15fd('0x2a')]=_['keys'](db[_0x15fd('0x27')][_0x15fd('0x43')]);_0x269aae[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x104eef[_0x15fd('0x2b')]);_0x269aae[_0x15fd('0x2d')]=_[_0x15fd('0x2e')](_0x269aae[_0x15fd('0x2a')],_0x269aae['query']);_0x145eab['attributes']=_[_0x15fd('0x2e')](_0x269aae['model'],qs[_0x15fd('0x30')](_0x104eef[_0x15fd('0x2b')]['fields']));_0x145eab[_0x15fd('0x2f')]=_0x145eab[_0x15fd('0x2f')][_0x15fd('0x31')]?_0x145eab[_0x15fd('0x2f')]:_0x269aae[_0x15fd('0x2a')];if(_0x104eef[_0x15fd('0x2b')]['includeAll']){_0x145eab[_0x15fd('0x3d')]=[{'all':!![]}];}_0x145eab=_[_0x15fd('0x44')]({},_0x145eab,_0x104eef[_0x15fd('0x3b')]);return db[_0x15fd('0x27')][_0x15fd('0x45')](_0x145eab)[_0x15fd('0x1f')](handleEntityNotFound(_0x2eb6b6,null))[_0x15fd('0x1f')](respondWithResult(_0x2eb6b6,null))[_0x15fd('0x40')](handleError(_0x2eb6b6,null));};exports[_0x15fd('0x46')]=function(_0x1d3beb,_0x16b4f5){return db[_0x15fd('0x27')]['create'](_0x1d3beb[_0x15fd('0x47')],{})['then'](respondWithResult(_0x16b4f5,0xc9))[_0x15fd('0x40')](handleError(_0x16b4f5,null));};exports[_0x15fd('0x1e')]=function(_0xeb1e06,_0x5a1f32){if(_0xeb1e06[_0x15fd('0x47')]['id']){delete _0xeb1e06[_0x15fd('0x47')]['id'];}delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x48')];delete _0xeb1e06['body'][_0x15fd('0x49')];delete _0xeb1e06[_0x15fd('0x47')][_0x15fd('0x4a')];delete _0xeb1e06[_0x15fd('0x47')]['value'];return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xeb1e06['params']['id']}})['then'](handleEntityNotFound(_0x5a1f32,null))['then'](saveUpdates(_0xeb1e06[_0x15fd('0x47')],null))[_0x15fd('0x1f')](respondWithResult(_0x5a1f32,null))[_0x15fd('0x40')](handleError(_0x5a1f32,null));};exports[_0x15fd('0x4b')]=function(_0x292174,_0x33a128){return db['ScreenRecording'][_0x15fd('0x4b')]()[_0x15fd('0x1f')](respondWithResult(_0x33a128,null))[_0x15fd('0x40')](handleError(_0x33a128,null));};exports['download']=function(_0x30c4e3,_0x4dd1d5,_0x3a48e7){var _0x2886e3=require(_0x15fd('0x4c'));var _0x42d4de=![];var _0x332df7={};if(_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]&&_0x30c4e3[_0x15fd('0x2b')][_0x15fd('0x38')]===_0x15fd('0x4d')){_0x332df7[_0x15fd('0x4d')]=_0x30c4e3[_0x15fd('0x42')]['id'];}else{_0x332df7['id']=_0x30c4e3[_0x15fd('0x42')]['id'];}return db['ScreenRecording'][_0x15fd('0x45')]({'where':_0x332df7,'attributes':['id','value'],'raw':!![]})[_0x15fd('0x1f')](handleEntityNotFound(_0x4dd1d5,null))['then'](function(_0x25bdea){if(_0x25bdea){var _0x1fac7f=path[_0x15fd('0x4e')](config['root'],'server/files/screen_recordings',_0x25bdea[_0x15fd('0x4f')]);var _0xc9c5ef=util[_0x15fd('0x50')](_0x15fd('0x51'),_0x1fac7f);if(fs['existsSync'](_0xc9c5ef)){_0x42d4de=!![];return _0x2886e3[_0x15fd('0x52')](_0xc9c5ef,_0x1fac7f,config[_0x15fd('0x53')][_0x15fd('0x54')])[_0x15fd('0x1f')](function(){return _0x25bdea;});}return _0x25bdea;}})[_0x15fd('0x1f')](function(_0x321fe7){if(_0x321fe7){var _0x59b3b4=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x321fe7[_0x15fd('0x4f')]);if(!fs[_0x15fd('0x57')](_0x59b3b4)){throw new db[(_0x15fd('0x58'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x321fe7[_0x15fd('0x59')]){return _0x4dd1d5[_0x15fd('0x5a')](_0x59b3b4,_0x321fe7['filename']+path[_0x15fd('0x5b')](_0x59b3b4),function(){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}else{return _0x4dd1d5['download'](_0x59b3b4,function(_0x285fd5){if(_0x42d4de){fs[_0x15fd('0x5c')](_0x59b3b4);}});}}})[_0x15fd('0x40')](function(_0x53bfd7){if(_0x53bfd7[_0x15fd('0x5d')]===_0x15fd('0x5e')){_0x4dd1d5[_0x15fd('0x17')](0x194)[_0x15fd('0x24')](_0x15fd('0x5f'));}else{return handleError(_0x4dd1d5,null);}});};exports[_0x15fd('0x20')]=function(_0xa1bb5c,_0x290497){return db[_0x15fd('0x27')][_0x15fd('0x45')]({'where':{'id':_0xa1bb5c['params']['id']}})[_0x15fd('0x1f')](function(_0x3a26c8){if(_['isNil'](_0x3a26c8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3a26c8;})[_0x15fd('0x1f')](function(_0x39e6ee){var _0x2bd6ef=path[_0x15fd('0x4e')](config[_0x15fd('0x55')],_0x15fd('0x56'),_0x39e6ee['value']);logger[_0x15fd('0x60')](_0x15fd('0x61'),_0x2bd6ef);if(!_[_0x15fd('0x62')](_0x39e6ee[_0x15fd('0x4f')])&&fs[_0x15fd('0x57')](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}_0x2bd6ef=_0x2bd6ef+_0x15fd('0x66');if(!_[_0x15fd('0x62')](_0x39e6ee['value'])&&fs['existsSync'](_0x2bd6ef)){logger[_0x15fd('0x60')](_0x15fd('0x63')+_0x2bd6ef+_0x15fd('0x64'));fs[_0x15fd('0x65')](_0x2bd6ef);}return _0x39e6ee;})[_0x15fd('0x1f')](function(_0xfa3aa1){if(!_0xfa3aa1)throw new InternalError();return _0xfa3aa1[_0x15fd('0x20')]();})['then'](function(){_0x290497[_0x15fd('0x17')](0xcc)['end']();})[_0x15fd('0x40')](handleError(_0x290497,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index cfb1615..b9e4fde 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 _0x733f=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash'];(function(_0xa927fa,_0x398c20){var _0x77bf78=function(_0x11d422){while(--_0x11d422){_0xa927fa['push'](_0xa927fa['shift']());}};_0x77bf78(++_0x398c20);}(_0x733f,0xb5));var _0xf733=function(_0x115844,_0x75e9ad){_0x115844=_0x115844-0x0;var _0xc21943=_0x733f[_0x115844];return _0xc21943;};'use strict';var _=require(_0xf733('0x0'));var util=require('util');var logger=require(_0xf733('0x1'))(_0xf733('0x2'));var moment=require(_0xf733('0x3'));var BPromise=require(_0xf733('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf733('0x5'));var rimraf=require(_0xf733('0x6'));var config=require(_0xf733('0x7'));var attributes=require(_0xf733('0x8'));module[_0xf733('0x9')]=function(_0x28b46a,_0x3acba4){return _0x28b46a[_0xf733('0xa')](_0xf733('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xf733('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6298=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x45d879,_0x8ecd5d){var _0x40e469=function(_0x3c017c){while(--_0x3c017c){_0x45d879['push'](_0x45d879['shift']());}};_0x40e469(++_0x8ecd5d);}(_0x6298,0xd2));var _0x8629=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6298[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8629('0x0'));var util=require(_0x8629('0x1'));var logger=require(_0x8629('0x2'))(_0x8629('0x3'));var moment=require(_0x8629('0x4'));var BPromise=require(_0x8629('0x5'));var rp=require(_0x8629('0x6'));var fs=require('fs');var path=require(_0x8629('0x7'));var rimraf=require(_0x8629('0x8'));var config=require(_0x8629('0x9'));var attributes=require(_0x8629('0xa'));module[_0x8629('0xb')]=function(_0x18d992,_0x56a8f2){return _0x18d992[_0x8629('0xc')](_0x8629('0xd'),attributes,{'tableName':_0x8629('0xe'),'paranoid':![],'indexes':[{'name':_0x8629('0xf'),'fields':[_0x8629('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 34b26e9..d6e45b4 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 _0xc577=['../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xc577,0x12f));var _0x7c57=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0xc577[_0x5e6cb8];return _0x41754f;};'use strict';var _=require(_0x7c57('0x0'));var util=require(_0x7c57('0x1'));var moment=require(_0x7c57('0x2'));var BPromise=require(_0x7c57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c57('0x4'));var db=require(_0x7c57('0x5'))['db'];var utils=require(_0x7c57('0x6'));var logger=require(_0x7c57('0x7'))(_0x7c57('0x8'));var config=require(_0x7c57('0x9'));var jayson=require(_0x7c57('0xa'));var client=jayson[_0x7c57('0xb')][_0x7c57('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x157005,_0x1659d2,_0x55ae99){return new BPromise(function(_0x288a5a,_0x47183e){return client[_0x7c57('0xd')](_0x157005,_0x55ae99)[_0x7c57('0xe')](function(_0x45e482){logger[_0x7c57('0xf')](_0x7c57('0x10'),_0x1659d2,_0x7c57('0x11'));logger[_0x7c57('0x12')](_0x7c57('0x13'),_0x1659d2,'request\x20sent',JSON['stringify'](_0x45e482));if(_0x45e482['error']){if(_0x45e482[_0x7c57('0x14')][_0x7c57('0x15')]===0x1f4){logger['error'](_0x7c57('0x10'),_0x1659d2,_0x45e482[_0x7c57('0x14')][_0x7c57('0x16')]);return _0x47183e(_0x45e482[_0x7c57('0x14')][_0x7c57('0x16')]);}logger['error'](_0x7c57('0x10'),_0x1659d2,_0x45e482['error']['message']);return _0x288a5a(_0x45e482['error']['message']);}else{logger[_0x7c57('0xf')](_0x7c57('0x10'),_0x1659d2,_0x7c57('0x11'));_0x288a5a(_0x45e482['result']['message']);}})[_0x7c57('0x17')](function(_0x4fbf47){logger[_0x7c57('0x14')](_0x7c57('0x10'),_0x1659d2,_0x4fbf47);_0x47183e(_0x4fbf47);});});} \ No newline at end of file +var _0xb07a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash'];(function(_0x113fa0,_0xa3bb7){var _0xf6e9af=function(_0x42c987){while(--_0x42c987){_0x113fa0['push'](_0x113fa0['shift']());}};_0xf6e9af(++_0xa3bb7);}(_0xb07a,0x11f));var _0xab07=function(_0x296db4,_0x3244dc){_0x296db4=_0x296db4-0x0;var _0x44e41c=_0xb07a[_0x296db4];return _0x44e41c;};'use strict';var _=require(_0xab07('0x0'));var util=require(_0xab07('0x1'));var moment=require(_0xab07('0x2'));var BPromise=require(_0xab07('0x3'));var rs=require(_0xab07('0x4'));var fs=require('fs');var Redis=require(_0xab07('0x5'));var db=require(_0xab07('0x6'))['db'];var utils=require(_0xab07('0x7'));var logger=require(_0xab07('0x8'))('rpc');var config=require(_0xab07('0x9'));var jayson=require(_0xab07('0xa'));var client=jayson[_0xab07('0xb')][_0xab07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55bf56,_0x451f73,_0x3efe31){return new BPromise(function(_0x53f08c,_0x39849b){return client['request'](_0x55bf56,_0x3efe31)[_0xab07('0xd')](function(_0x43b0c0){logger[_0xab07('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x451f73,_0xab07('0xf'));logger['debug'](_0xab07('0x10'),_0x451f73,_0xab07('0xf'),JSON[_0xab07('0x11')](_0x43b0c0));if(_0x43b0c0[_0xab07('0x12')]){if(_0x43b0c0[_0xab07('0x12')][_0xab07('0x13')]===0x1f4){logger[_0xab07('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x451f73,_0x43b0c0['error']['message']);return _0x39849b(_0x43b0c0['error'][_0xab07('0x14')]);}logger[_0xab07('0x12')](_0xab07('0x15'),_0x451f73,_0x43b0c0['error'][_0xab07('0x14')]);return _0x53f08c(_0x43b0c0['error'][_0xab07('0x14')]);}else{logger[_0xab07('0xe')](_0xab07('0x15'),_0x451f73,_0xab07('0xf'));_0x53f08c(_0x43b0c0[_0xab07('0x16')][_0xab07('0x14')]);}})[_0xab07('0x17')](function(_0x1fc4fe){logger[_0xab07('0x12')](_0xab07('0x15'),_0x451f73,_0x1fc4fe);_0x39849b(_0x1fc4fe);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 99d6442..1ed8075 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 _0xb347=['addPreferred','favicon','addFavicon','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','getDate','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','/:id/logo','single','addLogo','logologin','file','addLogoLogin','preferred'];(function(_0x2549c8,_0x461046){var _0x2f5231=function(_0x4302f4){while(--_0x4302f4){_0x2549c8['push'](_0x2549c8['shift']());}};_0x2f5231(++_0x461046);}(_0xb347,0x188));var _0x7b34=function(_0x38a3f8,_0x3482ec){_0x38a3f8=_0x38a3f8-0x0;var _0x2a8ac1=_0xb347[_0x38a3f8];return _0x2a8ac1;};'use strict';var multer=require(_0x7b34('0x0'));var util=require(_0x7b34('0x1'));var path=require(_0x7b34('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b34('0x3'));var router=express[_0x7b34('0x4')]();var fs_extra=require(_0x7b34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7b34('0x6'));var config=require(_0x7b34('0x7'));var controller=require(_0x7b34('0x8'));router['get']('/',auth[_0x7b34('0x9')](),controller['index']);router[_0x7b34('0xa')](_0x7b34('0xb'),controller[_0x7b34('0xc')]);router[_0x7b34('0xa')](_0x7b34('0xd'),controller['show']);router['get']('/:id/logo',controller[_0x7b34('0xe')]);router[_0x7b34('0xa')](_0x7b34('0xf'),controller[_0x7b34('0x10')]);router[_0x7b34('0xa')](_0x7b34('0x11'),controller[_0x7b34('0x12')]);router['get'](_0x7b34('0x13'),controller[_0x7b34('0x14')]);router[_0x7b34('0xa')]('/:id/favicon',controller[_0x7b34('0x15')]);var upload=multer({'storage':multer[_0x7b34('0x16')]({'destination':function(_0x5d2fac,_0x25c5ca,_0x1031ca){_0x1031ca(null,path[_0x7b34('0x17')](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x36d8a5,_0x52a197,_0x3410fb){_0x3410fb(null,util[_0x7b34('0x1a')](_0x7b34('0x1b'),'logo',path[_0x7b34('0x1c')](_0x52a197[_0x7b34('0x1d')])));}})});router[_0x7b34('0x1e')](_0x7b34('0x1f'),upload[_0x7b34('0x20')]('file'),controller[_0x7b34('0x21')]);var upload=multer({'storage':multer[_0x7b34('0x16')]({'destination':function(_0x16a179,_0x50db52,_0x341145){_0x341145(null,path[_0x7b34('0x17')](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x2efa24,_0x287d92,_0x264ccb){_0x264ccb(null,util[_0x7b34('0x1a')](_0x7b34('0x1b'),_0x7b34('0x22'),path['extname'](_0x287d92[_0x7b34('0x1d')])));}})});router[_0x7b34('0x1e')]('/:id/logo_login',upload[_0x7b34('0x20')](_0x7b34('0x23')),controller[_0x7b34('0x24')]);var upload=multer({'storage':multer[_0x7b34('0x16')]({'destination':function(_0x28c74c,_0x1331fd,_0x1760af){_0x1760af(null,path['join'](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x4dbe02,_0x248457,_0x3d5351){_0x3d5351(null,util['format']('%s%s',_0x7b34('0x25'),path['extname'](_0x248457['originalname'])));}})});router[_0x7b34('0x1e')](_0x7b34('0x13'),upload[_0x7b34('0x20')](_0x7b34('0x23')),controller[_0x7b34('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45e7a2,_0xeaf52f,_0x446f7d){_0x446f7d(null,path[_0x7b34('0x17')](config[_0x7b34('0x18')],_0x7b34('0x19')));},'filename':function(_0x40ea15,_0x37b0ff,_0x30c547){_0x30c547(null,util['format']('%s%s',_0x7b34('0x27'),path[_0x7b34('0x1c')](_0x37b0ff['originalname'])));}})});router[_0x7b34('0x1e')]('/:id/favicon',upload[_0x7b34('0x20')]('file'),controller[_0x7b34('0x28')]);router['put'](_0x7b34('0xd'),auth[_0x7b34('0x9')](),controller[_0x7b34('0x29')]);module[_0x7b34('0x2a')]=router; \ No newline at end of file +var _0xc424=['/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','extname','originalname','post','single','file','addLogo','%s%s','addLogoLogin','preferred','addPreferred','favicon','addFavicon','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index'];(function(_0x53b89e,_0x271dba){var _0xfade=function(_0x56b93b){while(--_0x56b93b){_0x53b89e['push'](_0x53b89e['shift']());}};_0xfade(++_0x271dba);}(_0xc424,0x1ab));var _0x4c42=function(_0x15f32f,_0x2521e9){_0x15f32f=_0x15f32f-0x0;var _0x5cc53c=_0xc424[_0x15f32f];return _0x5cc53c;};'use strict';var multer=require(_0x4c42('0x0'));var util=require(_0x4c42('0x1'));var path=require(_0x4c42('0x2'));var timeout=require(_0x4c42('0x3'));var express=require(_0x4c42('0x4'));var router=express[_0x4c42('0x5')]();var fs_extra=require(_0x4c42('0x6'));var auth=require(_0x4c42('0x7'));var interaction=require(_0x4c42('0x8'));var config=require('../../config/environment');var controller=require(_0x4c42('0x9'));router[_0x4c42('0xa')]('/',auth[_0x4c42('0xb')](),controller[_0x4c42('0xc')]);router[_0x4c42('0xa')](_0x4c42('0xd'),controller[_0x4c42('0xe')]);router[_0x4c42('0xa')](_0x4c42('0xf'),controller[_0x4c42('0x10')]);router[_0x4c42('0xa')](_0x4c42('0x11'),controller[_0x4c42('0x12')]);router[_0x4c42('0xa')](_0x4c42('0x13'),controller[_0x4c42('0x14')]);router[_0x4c42('0xa')](_0x4c42('0x15'),controller['gdpr']);router['get'](_0x4c42('0x16'),controller[_0x4c42('0x17')]);router[_0x4c42('0xa')](_0x4c42('0x18'),controller[_0x4c42('0x19')]);var upload=multer({'storage':multer[_0x4c42('0x1a')]({'destination':function(_0x18e5d9,_0xf2da7,_0x2e5517){_0x2e5517(null,path[_0x4c42('0x1b')](config[_0x4c42('0x1c')],_0x4c42('0x1d')));},'filename':function(_0xf10d44,_0x3a85c8,_0xe9938){_0xe9938(null,util[_0x4c42('0x1e')]('%s%s','logo',path[_0x4c42('0x1f')](_0x3a85c8[_0x4c42('0x20')])));}})});router[_0x4c42('0x21')](_0x4c42('0x11'),upload[_0x4c42('0x22')](_0x4c42('0x23')),controller[_0x4c42('0x24')]);var upload=multer({'storage':multer[_0x4c42('0x1a')]({'destination':function(_0x4512df,_0x420f37,_0x12137c){_0x12137c(null,path[_0x4c42('0x1b')](config['root'],_0x4c42('0x1d')));},'filename':function(_0x178044,_0x1fc7f5,_0x3081c8){_0x3081c8(null,util['format'](_0x4c42('0x25'),'logologin',path[_0x4c42('0x1f')](_0x1fc7f5['originalname'])));}})});router['post'](_0x4c42('0x13'),upload[_0x4c42('0x22')](_0x4c42('0x23')),controller[_0x4c42('0x26')]);var upload=multer({'storage':multer[_0x4c42('0x1a')]({'destination':function(_0x1f9796,_0x2d3b81,_0x38d665){_0x38d665(null,path[_0x4c42('0x1b')](config[_0x4c42('0x1c')],_0x4c42('0x1d')));},'filename':function(_0x21be86,_0x277db1,_0x142662){_0x142662(null,util[_0x4c42('0x1e')](_0x4c42('0x25'),_0x4c42('0x27'),path[_0x4c42('0x1f')](_0x277db1['originalname'])));}})});router[_0x4c42('0x21')](_0x4c42('0x16'),upload['single'](_0x4c42('0x23')),controller[_0x4c42('0x28')]);var upload=multer({'storage':multer[_0x4c42('0x1a')]({'destination':function(_0x14ea7f,_0x17cc93,_0x2da606){_0x2da606(null,path[_0x4c42('0x1b')](config['root'],_0x4c42('0x1d')));},'filename':function(_0x18ab13,_0x31cf74,_0x354b6a){_0x354b6a(null,util[_0x4c42('0x1e')]('%s%s',_0x4c42('0x29'),path['extname'](_0x31cf74[_0x4c42('0x20')])));}})});router[_0x4c42('0x21')](_0x4c42('0x18'),upload[_0x4c42('0x22')](_0x4c42('0x23')),controller[_0x4c42('0x2a')]);router['put'](_0x4c42('0xf'),auth['isAuthenticated'](),controller[_0x4c42('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 2601a95..8bd9199 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 _0x27c9=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','rawAttributes','model','includeAll','options','find','body','addLogo','file','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','join','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','getLicense','defaultLogo','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','stack','name','send','Setting','fieldName','type','key','map','query','filters','intersection'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x27c9,0x1af));var _0x927c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x27c9[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x927c('0x0'));var rimraf=require(_0x927c('0x1'));var zipdir=require(_0x927c('0x2'));var jsonpatch=require(_0x927c('0x3'));var rp=require('request-promise');var moment=require(_0x927c('0x4'));var BPromise=require(_0x927c('0x5'));var Mustache=require('mustache');var util=require(_0x927c('0x6'));var path=require(_0x927c('0x7'));var sox=require(_0x927c('0x8'));var csv=require(_0x927c('0x9'));var ejs=require(_0x927c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x927c('0xb'));var squel=require(_0x927c('0xc'));var crypto=require(_0x927c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x927c('0xe'));var toCsv=require(_0x927c('0x9'));var querystring=require(_0x927c('0xf'));var Papa=require('papaparse');var Redis=require(_0x927c('0x10'));var authService=require(_0x927c('0x11'));var qs=require(_0x927c('0x12'));var as=require(_0x927c('0x13'));var hardwareService=require(_0x927c('0x14'));var logger=require(_0x927c('0x15'))(_0x927c('0x16'));var utils=require(_0x927c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x927c('0x18'))['db'];var jayson=require(_0x927c('0x19'));var client=jayson[_0x927c('0x1a')][_0x927c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4c5d45,_0x175494,_0x4ffdc6,_0x4dd414){return new BPromise(function(_0x3011c5,_0x5c8549){var _0x3751a2=_0x4dd414||client;return _0x3751a2[_0x927c('0x1c')](_0x4c5d45,_0x4ffdc6)[_0x927c('0x1d')](function(_0x3e7d43){logger[_0x927c('0x1e')](_0x927c('0x1f'),_0x175494,_0x927c('0x20'));logger[_0x927c('0x21')](_0x927c('0x22'),_0x175494,_0x927c('0x20'),JSON['stringify'](_0x3e7d43));if(_0x3e7d43[_0x927c('0x23')]){if(_0x3e7d43[_0x927c('0x23')]['code']===0x1f4){logger[_0x927c('0x23')](_0x927c('0x1f'),_0x175494,_0x3e7d43['error'][_0x927c('0x24')]);return _0x5c8549(_0x3e7d43[_0x927c('0x23')][_0x927c('0x24')]);}logger[_0x927c('0x23')](_0x927c('0x1f'),_0x175494,_0x3e7d43['error']['message']);return _0x3011c5(_0x3e7d43['error'][_0x927c('0x24')]);}else{logger[_0x927c('0x1e')](_0x927c('0x1f'),_0x175494,_0x927c('0x20'));_0x3011c5(_0x3e7d43[_0x927c('0x25')][_0x927c('0x24')]);}})['catch'](function(_0x18a437){logger[_0x927c('0x23')](_0x927c('0x1f'),_0x175494,_0x18a437);_0x5c8549(_0x18a437);});});}function respondWithStatusCode(_0x271158,_0x72e3a0){_0x72e3a0=_0x72e3a0||0xcc;return function(_0x1f672a){if(_0x1f672a){return _0x271158['sendStatus'](_0x72e3a0);}return _0x271158[_0x927c('0x26')](_0x72e3a0)[_0x927c('0x27')]();};}function respondWithResult(_0x46273e,_0x40cf57){_0x40cf57=_0x40cf57||0xc8;return function(_0x52851b){if(_0x52851b){return _0x46273e[_0x927c('0x26')](_0x40cf57)[_0x927c('0x28')](_0x52851b);}};}function respondWithFilteredResult(_0xad49c0,_0xaa518a){return function(_0x32727f){if(_0x32727f){var _0x4c194b=typeof _0xaa518a[_0x927c('0x29')]===_0x927c('0x2a')&&typeof _0xaa518a[_0x927c('0x2b')]==='undefined';var _0x1e020a=_0x32727f[_0x927c('0x2c')];var _0x1116ca=_0x4c194b?0x0:_0xaa518a[_0x927c('0x29')];var _0x86ffe5=_0x4c194b?_0x32727f[_0x927c('0x2c')]:_0xaa518a[_0x927c('0x29')]+_0xaa518a['limit'];var _0x2d80c9;if(_0x86ffe5>=_0x1e020a){_0x86ffe5=_0x1e020a;_0x2d80c9=0xc8;}else{_0x2d80c9=0xce;}_0xad49c0[_0x927c('0x26')](_0x2d80c9);return _0xad49c0[_0x927c('0x2d')](_0x927c('0x2e'),_0x1116ca+'-'+_0x86ffe5+'/'+_0x1e020a)[_0x927c('0x28')](_0x32727f);}return null;};}function patchUpdates(_0x2577cf){return function(_0x31fd00){try{jsonpatch[_0x927c('0x2f')](_0x31fd00,_0x2577cf,!![]);}catch(_0x38a026){return BPromise[_0x927c('0x30')](_0x38a026);}return _0x31fd00['save']();};}function saveUpdates(_0x953a7e,_0x93f673){return function(_0x2482df){if(_0x2482df){return _0x2482df['update'](_0x953a7e)[_0x927c('0x1d')](function(_0x26b7be){return _0x26b7be;});}return null;};}function removeEntity(_0x536f65,_0xed9e08){return function(_0x5a3d48){if(_0x5a3d48){return _0x5a3d48[_0x927c('0x31')]()[_0x927c('0x1d')](function(){_0x536f65[_0x927c('0x26')](0xcc)[_0x927c('0x27')]();});}};}function handleEntityNotFound(_0x4fa200,_0x3f07ce){return function(_0x5363cc){if(!_0x5363cc){_0x4fa200['sendStatus'](0x194);}return _0x5363cc;};}function handleError(_0x3168bd,_0x537b5f){_0x537b5f=_0x537b5f||0x1f4;return function(_0xf14b96){logger['error'](_0xf14b96[_0x927c('0x32')]);if(_0xf14b96[_0x927c('0x33')]){delete _0xf14b96[_0x927c('0x33')];}_0x3168bd[_0x927c('0x26')](_0x537b5f)[_0x927c('0x34')](_0xf14b96);};}exports['index']=function(_0x1e010a,_0x11e3f0){var _0x2dc51c={},_0x55e093={},_0xe8b53a={'count':0x0,'rows':[]};var _0x49b72a=_['map'](db[_0x927c('0x35')]['rawAttributes'],function(_0x5acaa2){return{'name':_0x5acaa2[_0x927c('0x36')],'type':_0x5acaa2[_0x927c('0x37')][_0x927c('0x38')]};});_0x55e093['model']=_[_0x927c('0x39')](_0x49b72a,_0x927c('0x33'));_0x55e093[_0x927c('0x3a')]=_['keys'](_0x1e010a[_0x927c('0x3a')]);_0x55e093[_0x927c('0x3b')]=_[_0x927c('0x3c')](_0x55e093['model'],_0x55e093[_0x927c('0x3a')]);_0x2dc51c[_0x927c('0x3d')]=_[_0x927c('0x3c')](_0x55e093['model'],qs[_0x927c('0x3e')](_0x1e010a[_0x927c('0x3a')][_0x927c('0x3e')]));_0x2dc51c['attributes']=_0x2dc51c['attributes'][_0x927c('0x3f')]?_0x2dc51c[_0x927c('0x3d')]:_0x55e093['model'];if(!_0x1e010a['query'][_0x927c('0x40')]('nolimit')){_0x2dc51c[_0x927c('0x2b')]=qs[_0x927c('0x2b')](_0x1e010a[_0x927c('0x3a')]['limit']);_0x2dc51c[_0x927c('0x29')]=qs['offset'](_0x1e010a[_0x927c('0x3a')][_0x927c('0x29')]);}_0x2dc51c[_0x927c('0x41')]=qs[_0x927c('0x42')](_0x1e010a[_0x927c('0x3a')]['sort']);_0x2dc51c[_0x927c('0x43')]=qs[_0x927c('0x3b')](_[_0x927c('0x44')](_0x1e010a['query'],_0x55e093['filters']),_0x49b72a);if(_0x1e010a['query']['filter']){_0x2dc51c['where']=_[_0x927c('0x45')](_0x2dc51c[_0x927c('0x43')],{'$or':_[_0x927c('0x39')](_0x49b72a,function(_0x3ee9f8){if(_0x3ee9f8[_0x927c('0x37')]!=='VIRTUAL'){var _0x76a7c2={};_0x76a7c2[_0x3ee9f8['name']]={'$like':'%'+_0x1e010a[_0x927c('0x3a')][_0x927c('0x46')]+'%'};return _0x76a7c2;}})});}_0x2dc51c=_[_0x927c('0x45')]({},_0x2dc51c,_0x1e010a['options']);var _0x4d2549={'where':_0x2dc51c[_0x927c('0x43')]};return db[_0x927c('0x35')][_0x927c('0x2c')](_0x4d2549)['then'](function(_0x514233){_0xe8b53a[_0x927c('0x2c')]=_0x514233;if(_0x1e010a[_0x927c('0x3a')]['includeAll']){_0x2dc51c[_0x927c('0x47')]=[{'all':!![]}];}return db[_0x927c('0x35')][_0x927c('0x48')](_0x2dc51c);})[_0x927c('0x1d')](function(_0x4375d2){_0xe8b53a[_0x927c('0x49')]=_0x4375d2;return _0xe8b53a;})[_0x927c('0x1d')](respondWithFilteredResult(_0x11e3f0,_0x2dc51c))[_0x927c('0x4a')](handleError(_0x11e3f0,null));};exports[_0x927c('0x4b')]=function(_0x44b3da,_0x4f0bb4){var _0x372d00={'raw':![],'where':{'id':_0x44b3da[_0x927c('0x4c')]['id']}},_0xc3845b={};_0xc3845b['model']=_['keys'](db[_0x927c('0x35')][_0x927c('0x4d')]);_0xc3845b['query']=_['keys'](_0x44b3da[_0x927c('0x3a')]);_0xc3845b[_0x927c('0x3b')]=_['intersection'](_0xc3845b[_0x927c('0x4e')],_0xc3845b[_0x927c('0x3a')]);_0x372d00['attributes']=_[_0x927c('0x3c')](_0xc3845b[_0x927c('0x4e')],qs[_0x927c('0x3e')](_0x44b3da[_0x927c('0x3a')]['fields']));_0x372d00[_0x927c('0x3d')]=_0x372d00[_0x927c('0x3d')][_0x927c('0x3f')]?_0x372d00[_0x927c('0x3d')]:_0xc3845b[_0x927c('0x4e')];if(_0x44b3da['query'][_0x927c('0x4f')]){_0x372d00[_0x927c('0x47')]=[{'all':!![]}];}_0x372d00=_['merge']({},_0x372d00,_0x44b3da[_0x927c('0x50')]);return db['Setting'][_0x927c('0x51')](_0x372d00)[_0x927c('0x1d')](handleEntityNotFound(_0x4f0bb4,null))['then'](respondWithResult(_0x4f0bb4,null))[_0x927c('0x4a')](handleError(_0x4f0bb4,null));};exports['update']=function(_0x388283,_0x4ec5f7){if(_0x388283[_0x927c('0x52')]['id']){delete _0x388283[_0x927c('0x52')]['id'];}return db[_0x927c('0x35')]['find']({'where':{'id':_0x388283[_0x927c('0x4c')]['id']}})[_0x927c('0x1d')](handleEntityNotFound(_0x4ec5f7,null))['then'](saveUpdates(_0x388283['body'],null))[_0x927c('0x1d')](respondWithResult(_0x4ec5f7,null))[_0x927c('0x4a')](handleError(_0x4ec5f7,null));};exports[_0x927c('0x53')]=function(_0x19d6cd,_0x5b2a72,_0x2777c9){if(_0x19d6cd[_0x927c('0x54')]&&_0x19d6cd['file']['filename']){_0x19d6cd[_0x927c('0x52')]['logo']=_0x19d6cd[_0x927c('0x54')][_0x927c('0x55')];}return db['Setting'][_0x927c('0x51')]({'where':{'id':_0x19d6cd['params']['id']}})[_0x927c('0x1d')](handleEntityNotFound(_0x5b2a72,null))[_0x927c('0x1d')](saveUpdates(_0x19d6cd[_0x927c('0x52')],null))[_0x927c('0x1d')](respondWithResult(_0x5b2a72,null))[_0x927c('0x4a')](handleError(_0x5b2a72,null));};exports['addLogoLogin']=function(_0x2a5fd3,_0x468071,_0xd81870){if(_0x2a5fd3['file']&&_0x2a5fd3[_0x927c('0x54')]['filename']){_0x2a5fd3['body'][_0x927c('0x56')]=_0x2a5fd3['file'][_0x927c('0x55')];}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x2a5fd3[_0x927c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x468071,null))[_0x927c('0x1d')](saveUpdates(_0x2a5fd3[_0x927c('0x52')],null))['then'](respondWithResult(_0x468071,null))[_0x927c('0x4a')](handleError(_0x468071,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x58')]=function(_0x2debe0,_0x632842,_0x111f6a){var _0x1cf120=_0x927c('0x59');var _0x23e561={'custom':![]};return utilLicense['getLicense']()[_0x927c('0x1d')](function(_0x14d173){if(_0x14d173){_0x23e561=_0x14d173;}return db['Setting'][_0x927c('0x51')]({'where':{'id':_0x2debe0[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x5a'),_0x927c('0x56'),_0x927c('0x5b'),_0x927c('0x5c'),'defaultLogo',_0x927c('0x5d'),_0x927c('0x5e'),_0x927c('0x5f')],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x632842,null))['then'](function(_0x17294e){if(_0x17294e){var _0x25d597=_0x17294e['logo']&&fs[_0x927c('0x60')](path['join'](config['root'],_0x1cf120,_[_0x927c('0x61')](_0x17294e['logo'])))?path[_0x927c('0x62')](config['root'],_0x1cf120,_[_0x927c('0x61')](_0x17294e[_0x927c('0x5a')])):path['join'](config[_0x927c('0x63')],_0x1cf120,_[_0x927c('0x61')](_0x927c('0x64')));var _0x440116=_0x927c('0x65')+_[_0x927c('0x66')](_0x927c('0x5a'));if(_0x17294e[_0x440116]||!_0x23e561[_0x927c('0x67')]){_0x25d597=path[_0x927c('0x62')](config['root'],_0x1cf120,_['toLower']('default_logo.svg'));}if(!fs[_0x927c('0x60')](_0x25d597)){throw new db[(_0x927c('0x68'))][(_0x927c('0x69'))](_[_0x927c('0x66')](_0x927c('0x5a'))+_0x927c('0x6a'));}return _0x632842['download'](_0x25d597);}})[_0x927c('0x4a')](handleError(_0x632842,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x6b')]=function(_0x10bb11,_0x12752e,_0xc5f6f){var _0x5ba8fc=_0x927c('0x59');var _0x383802={'custom':![]};return utilLicense[_0x927c('0x6c')]()[_0x927c('0x1d')](function(_0x7086fd){if(_0x7086fd){_0x383802=_0x7086fd;}return db['Setting'][_0x927c('0x51')]({'where':{'id':_0x10bb11[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x5a'),'loginLogo',_0x927c('0x5b'),'favicon',_0x927c('0x6d'),_0x927c('0x5d'),_0x927c('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x12752e,null))[_0x927c('0x1d')](function(_0xe52835){if(_0xe52835){var _0x2e7812=_0xe52835[_0x927c('0x56')]&&fs[_0x927c('0x60')](path['join'](config[_0x927c('0x63')],_0x5ba8fc,_['toLower'](_0xe52835['loginLogo'])))?path[_0x927c('0x62')](config['root'],_0x5ba8fc,_[_0x927c('0x61')](_0xe52835['loginLogo'])):path[_0x927c('0x62')](config['root'],_0x5ba8fc,_[_0x927c('0x61')](_0x927c('0x6e')));var _0x127f29='default'+_['upperFirst'](_0x927c('0x56'));if(_0xe52835[_0x127f29]||!_0x383802['custom']){_0x2e7812=path[_0x927c('0x62')](config['root'],_0x5ba8fc,_[_0x927c('0x61')](_0x927c('0x6e')));}if(!fs[_0x927c('0x60')](_0x2e7812)){throw new db[(_0x927c('0x68'))]['ValidationError'](_['upperFirst'](_0x927c('0x56'))+_0x927c('0x6a'));}return _0x12752e[_0x927c('0x6f')](_0x2e7812);}})[_0x927c('0x4a')](handleError(_0x12752e,null));};exports[_0x927c('0x70')]=function(_0x2b2428,_0x4f42e5){return db[_0x927c('0x35')]['find']({'where':{'id':_0x2b2428[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x71')]})[_0x927c('0x1d')](respondWithResult(_0x4f42e5,null))['catch'](handleError(_0x4f42e5,null));};exports[_0x927c('0x72')]=function(_0x552204,_0x279a9e,_0xddda73){if(_0x552204[_0x927c('0x54')]&&_0x552204[_0x927c('0x54')][_0x927c('0x55')]){_0x552204['body']['preferred']=_0x552204['file']['filename'];}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x552204[_0x927c('0x4c')]['id']}})[_0x927c('0x1d')](handleEntityNotFound(_0x279a9e,null))['then'](saveUpdates(_0x552204['body'],null))['then'](respondWithResult(_0x279a9e,null))[_0x927c('0x4a')](handleError(_0x279a9e,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x73')]=function(_0x2fa970,_0x5e1262,_0x11a3ab){var _0x4b562a=_0x927c('0x59');var _0x1c8e81={'custom':![]};return utilLicense[_0x927c('0x6c')]()[_0x927c('0x1d')](function(_0x596e4e){if(_0x596e4e){_0x1c8e81=_0x596e4e;}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x2fa970[_0x927c('0x4c')]['id']},'attributes':[_0x927c('0x5a'),_0x927c('0x56'),_0x927c('0x5b'),_0x927c('0x5c'),_0x927c('0x6d'),_0x927c('0x5d'),_0x927c('0x5e'),_0x927c('0x5f')],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x5e1262,null))[_0x927c('0x1d')](function(_0x555b5c){if(_0x555b5c){var _0x58cc17=_0x555b5c[_0x927c('0x5b')]&&fs['existsSync'](path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_['toLower'](_0x555b5c[_0x927c('0x5b')])))?path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_[_0x927c('0x61')](_0x555b5c[_0x927c('0x5b')])):path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_[_0x927c('0x61')](_0x927c('0x74')));var _0x599cbd=_0x927c('0x65')+_[_0x927c('0x66')](_0x927c('0x5b'));if(_0x555b5c[_0x599cbd]||!_0x1c8e81[_0x927c('0x67')]||!_0x1c8e81[_0x927c('0x5b')]){_0x58cc17=path[_0x927c('0x62')](config[_0x927c('0x63')],_0x4b562a,_['toLower']('default_preferred.png'));}if(!fs[_0x927c('0x60')](_0x58cc17)){throw new db[(_0x927c('0x68'))][(_0x927c('0x69'))](_[_0x927c('0x66')](_0x927c('0x5b'))+_0x927c('0x6a'));}return _0x5e1262['download'](_0x58cc17);}})['catch'](handleError(_0x5e1262,null));};exports[_0x927c('0x75')]=function(_0x34378f,_0x29e59f,_0x462ea0){if(_0x34378f[_0x927c('0x54')]&&_0x34378f[_0x927c('0x54')][_0x927c('0x55')]){_0x34378f['body']['favicon']=_0x34378f['file'][_0x927c('0x55')];}return db['Setting']['find']({'where':{'id':_0x34378f[_0x927c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29e59f,null))[_0x927c('0x1d')](saveUpdates(_0x34378f[_0x927c('0x52')],null))[_0x927c('0x1d')](respondWithResult(_0x29e59f,null))[_0x927c('0x4a')](handleError(_0x29e59f,null));};var utilLicense=require(_0x927c('0x57'));exports[_0x927c('0x76')]=function(_0x1b41a1,_0x52ea4c,_0x16b8d8){var _0x42920a='server/files/images/logos';var _0x1bed9e={'custom':![]};return utilLicense[_0x927c('0x6c')]()[_0x927c('0x1d')](function(_0x472dc2){if(_0x472dc2){_0x1bed9e=_0x472dc2;}return db[_0x927c('0x35')][_0x927c('0x51')]({'where':{'id':_0x1b41a1['params']['id']},'attributes':[_0x927c('0x5a'),_0x927c('0x56'),_0x927c('0x5b'),_0x927c('0x5c'),_0x927c('0x6d'),_0x927c('0x5d'),_0x927c('0x5e'),_0x927c('0x5f')],'raw':!![]});})[_0x927c('0x1d')](handleEntityNotFound(_0x52ea4c,null))['then'](function(_0x15ebc6){if(_0x15ebc6){var _0x14e200=_0x15ebc6[_0x927c('0x5c')]&&fs[_0x927c('0x60')](path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x15ebc6['favicon'])))?path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x15ebc6[_0x927c('0x5c')])):path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x927c('0x77')));var _0x2cddce=_0x927c('0x65')+_[_0x927c('0x66')](_0x927c('0x5c'));if(_0x15ebc6[_0x2cddce]||!_0x1bed9e[_0x927c('0x67')]){_0x14e200=path[_0x927c('0x62')](config[_0x927c('0x63')],_0x42920a,_[_0x927c('0x61')](_0x927c('0x77')));}if(!fs['existsSync'](_0x14e200)){throw new db['Sequelize']['ValidationError'](_[_0x927c('0x66')](_0x927c('0x5c'))+_0x927c('0x6a'));}return _0x52ea4c[_0x927c('0x6f')](_0x14e200);}})[_0x927c('0x4a')](handleError(_0x52ea4c,null));};exports['getDate']=function(_0x3d68c7,_0x332085){var _0x34f1a0={'offset':moment()['utcOffset']()};_0x34f1a0['now']=moment()[_0x927c('0x78')](_0x34f1a0[_0x927c('0x29')])[_0x927c('0x79')](_0x927c('0x7a'));return _0x332085[_0x927c('0x26')](0xc8)[_0x927c('0x34')](_0x34f1a0);}; \ No newline at end of file +var _0x0dec=['server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','upperFirst','custom','root','Sequelize','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','offset','undefined','count','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','body','addLogo','file','logo','addLogoLogin','filename','loginLogo','getLogo'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x0dec,0x11c));var _0xc0de=function(_0x4a7871,_0x53087f){_0x4a7871=_0x4a7871-0x0;var _0x2573fc=_0x0dec[_0x4a7871];return _0x2573fc;};'use strict';var emlformat=require(_0xc0de('0x0'));var rimraf=require(_0xc0de('0x1'));var zipdir=require(_0xc0de('0x2'));var jsonpatch=require(_0xc0de('0x3'));var rp=require('request-promise');var moment=require(_0xc0de('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc0de('0x5'));var path=require(_0xc0de('0x6'));var sox=require(_0xc0de('0x7'));var csv=require(_0xc0de('0x8'));var ejs=require(_0xc0de('0x9'));var fs=require('fs');var fs_extra=require(_0xc0de('0xa'));var _=require(_0xc0de('0xb'));var squel=require(_0xc0de('0xc'));var crypto=require(_0xc0de('0xd'));var jsforce=require(_0xc0de('0xe'));var deskjs=require(_0xc0de('0xf'));var toCsv=require(_0xc0de('0x8'));var querystring=require(_0xc0de('0x10'));var Papa=require(_0xc0de('0x11'));var Redis=require(_0xc0de('0x12'));var authService=require(_0xc0de('0x13'));var qs=require(_0xc0de('0x14'));var as=require(_0xc0de('0x15'));var hardwareService=require(_0xc0de('0x16'));var logger=require(_0xc0de('0x17'))(_0xc0de('0x18'));var utils=require(_0xc0de('0x19'));var config=require(_0xc0de('0x1a'));var licenseUtil=require(_0xc0de('0x1b'));var db=require(_0xc0de('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc0de('0x1d')][_0xc0de('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x386133,_0x258c5a,_0x173756,_0x7fae0c){return new BPromise(function(_0x297171,_0x3330e0){var _0x3546f4=_0x7fae0c||client;return _0x3546f4[_0xc0de('0x1f')](_0x386133,_0x173756)[_0xc0de('0x20')](function(_0x7f1e4d){logger['info'](_0xc0de('0x21'),_0x258c5a,_0xc0de('0x22'));logger['debug'](_0xc0de('0x23'),_0x258c5a,_0xc0de('0x22'),JSON[_0xc0de('0x24')](_0x7f1e4d));if(_0x7f1e4d['error']){if(_0x7f1e4d[_0xc0de('0x25')]['code']===0x1f4){logger[_0xc0de('0x25')]('Setting,\x20%s,\x20%s',_0x258c5a,_0x7f1e4d[_0xc0de('0x25')][_0xc0de('0x26')]);return _0x3330e0(_0x7f1e4d['error'][_0xc0de('0x26')]);}logger[_0xc0de('0x25')](_0xc0de('0x21'),_0x258c5a,_0x7f1e4d[_0xc0de('0x25')][_0xc0de('0x26')]);return _0x297171(_0x7f1e4d[_0xc0de('0x25')][_0xc0de('0x26')]);}else{logger[_0xc0de('0x27')]('Setting,\x20%s,\x20%s',_0x258c5a,_0xc0de('0x22'));_0x297171(_0x7f1e4d[_0xc0de('0x28')][_0xc0de('0x26')]);}})[_0xc0de('0x29')](function(_0x337342){logger['error'](_0xc0de('0x21'),_0x258c5a,_0x337342);_0x3330e0(_0x337342);});});}function respondWithStatusCode(_0xf5a756,_0x11252c){_0x11252c=_0x11252c||0xcc;return function(_0x27243b){if(_0x27243b){return _0xf5a756['sendStatus'](_0x11252c);}return _0xf5a756[_0xc0de('0x2a')](_0x11252c)[_0xc0de('0x2b')]();};}function respondWithResult(_0x2d8f43,_0x1f6ef1){_0x1f6ef1=_0x1f6ef1||0xc8;return function(_0x301d65){if(_0x301d65){return _0x2d8f43[_0xc0de('0x2a')](_0x1f6ef1)[_0xc0de('0x2c')](_0x301d65);}};}function respondWithFilteredResult(_0x2d62a0,_0x3a80e6){return function(_0x304660){if(_0x304660){var _0x32fb9d=typeof _0x3a80e6[_0xc0de('0x2d')]===_0xc0de('0x2e')&&typeof _0x3a80e6['limit']==='undefined';var _0x285669=_0x304660[_0xc0de('0x2f')];var _0x59fed0=_0x32fb9d?0x0:_0x3a80e6['offset'];var _0x6022ed=_0x32fb9d?_0x304660[_0xc0de('0x2f')]:_0x3a80e6['offset']+_0x3a80e6['limit'];var _0x428089;if(_0x6022ed>=_0x285669){_0x6022ed=_0x285669;_0x428089=0xc8;}else{_0x428089=0xce;}_0x2d62a0[_0xc0de('0x2a')](_0x428089);return _0x2d62a0[_0xc0de('0x30')]('Content-Range',_0x59fed0+'-'+_0x6022ed+'/'+_0x285669)[_0xc0de('0x2c')](_0x304660);}return null;};}function patchUpdates(_0x4eb14d){return function(_0x1d6a49){try{jsonpatch[_0xc0de('0x31')](_0x1d6a49,_0x4eb14d,!![]);}catch(_0x61c92e){return BPromise['reject'](_0x61c92e);}return _0x1d6a49[_0xc0de('0x32')]();};}function saveUpdates(_0x542801,_0x44b8a5){return function(_0x2fea76){if(_0x2fea76){return _0x2fea76[_0xc0de('0x33')](_0x542801)['then'](function(_0xfee0be){return _0xfee0be;});}return null;};}function removeEntity(_0x10a4d4,_0x104730){return function(_0x2e317a){if(_0x2e317a){return _0x2e317a[_0xc0de('0x34')]()[_0xc0de('0x20')](function(){_0x10a4d4[_0xc0de('0x2a')](0xcc)[_0xc0de('0x2b')]();});}};}function handleEntityNotFound(_0x197807,_0xe2a4f){return function(_0x47a8b9){if(!_0x47a8b9){_0x197807[_0xc0de('0x35')](0x194);}return _0x47a8b9;};}function handleError(_0x5f4949,_0xaca7e7){_0xaca7e7=_0xaca7e7||0x1f4;return function(_0x11dc25){logger[_0xc0de('0x25')](_0x11dc25[_0xc0de('0x36')]);if(_0x11dc25[_0xc0de('0x37')]){delete _0x11dc25[_0xc0de('0x37')];}_0x5f4949[_0xc0de('0x2a')](_0xaca7e7)[_0xc0de('0x38')](_0x11dc25);};}exports[_0xc0de('0x39')]=function(_0x270708,_0x4499e6){var _0x2fd83e={},_0x52303d={},_0x534069={'count':0x0,'rows':[]};var _0x199aff=_[_0xc0de('0x3a')](db[_0xc0de('0x3b')][_0xc0de('0x3c')],function(_0x1ab3c8){return{'name':_0x1ab3c8[_0xc0de('0x3d')],'type':_0x1ab3c8[_0xc0de('0x3e')]['key']};});_0x52303d['model']=_['map'](_0x199aff,_0xc0de('0x37'));_0x52303d[_0xc0de('0x3f')]=_[_0xc0de('0x40')](_0x270708[_0xc0de('0x3f')]);_0x52303d[_0xc0de('0x41')]=_[_0xc0de('0x42')](_0x52303d['model'],_0x52303d[_0xc0de('0x3f')]);_0x2fd83e[_0xc0de('0x43')]=_['intersection'](_0x52303d[_0xc0de('0x44')],qs['fields'](_0x270708[_0xc0de('0x3f')][_0xc0de('0x45')]));_0x2fd83e[_0xc0de('0x43')]=_0x2fd83e[_0xc0de('0x43')][_0xc0de('0x46')]?_0x2fd83e[_0xc0de('0x43')]:_0x52303d[_0xc0de('0x44')];if(!_0x270708[_0xc0de('0x3f')][_0xc0de('0x47')](_0xc0de('0x48'))){_0x2fd83e[_0xc0de('0x49')]=qs['limit'](_0x270708[_0xc0de('0x3f')][_0xc0de('0x49')]);_0x2fd83e[_0xc0de('0x2d')]=qs[_0xc0de('0x2d')](_0x270708[_0xc0de('0x3f')]['offset']);}_0x2fd83e['order']=qs[_0xc0de('0x4a')](_0x270708[_0xc0de('0x3f')][_0xc0de('0x4a')]);_0x2fd83e[_0xc0de('0x4b')]=qs['filters'](_['pick'](_0x270708['query'],_0x52303d[_0xc0de('0x41')]),_0x199aff);if(_0x270708['query'][_0xc0de('0x4c')]){_0x2fd83e[_0xc0de('0x4b')]=_[_0xc0de('0x4d')](_0x2fd83e[_0xc0de('0x4b')],{'$or':_[_0xc0de('0x3a')](_0x199aff,function(_0x2e772f){if(_0x2e772f['type']!==_0xc0de('0x4e')){var _0x393966={};_0x393966[_0x2e772f[_0xc0de('0x37')]]={'$like':'%'+_0x270708[_0xc0de('0x3f')]['filter']+'%'};return _0x393966;}})});}_0x2fd83e=_[_0xc0de('0x4d')]({},_0x2fd83e,_0x270708[_0xc0de('0x4f')]);var _0x408314={'where':_0x2fd83e['where']};return db[_0xc0de('0x3b')][_0xc0de('0x2f')](_0x408314)[_0xc0de('0x20')](function(_0x523c87){_0x534069[_0xc0de('0x2f')]=_0x523c87;if(_0x270708['query'][_0xc0de('0x50')]){_0x2fd83e['include']=[{'all':!![]}];}return db[_0xc0de('0x3b')][_0xc0de('0x51')](_0x2fd83e);})[_0xc0de('0x20')](function(_0x3814f8){_0x534069['rows']=_0x3814f8;return _0x534069;})[_0xc0de('0x20')](respondWithFilteredResult(_0x4499e6,_0x2fd83e))[_0xc0de('0x29')](handleError(_0x4499e6,null));};exports[_0xc0de('0x52')]=function(_0x3b2447,_0x4490a4){var _0x2974b0={'raw':![],'where':{'id':_0x3b2447[_0xc0de('0x53')]['id']}},_0x36d8be={};_0x36d8be[_0xc0de('0x44')]=_['keys'](db[_0xc0de('0x3b')][_0xc0de('0x3c')]);_0x36d8be[_0xc0de('0x3f')]=_['keys'](_0x3b2447[_0xc0de('0x3f')]);_0x36d8be[_0xc0de('0x41')]=_[_0xc0de('0x42')](_0x36d8be['model'],_0x36d8be[_0xc0de('0x3f')]);_0x2974b0[_0xc0de('0x43')]=_[_0xc0de('0x42')](_0x36d8be['model'],qs['fields'](_0x3b2447[_0xc0de('0x3f')]['fields']));_0x2974b0[_0xc0de('0x43')]=_0x2974b0[_0xc0de('0x43')]['length']?_0x2974b0['attributes']:_0x36d8be['model'];if(_0x3b2447[_0xc0de('0x3f')][_0xc0de('0x50')]){_0x2974b0[_0xc0de('0x54')]=[{'all':!![]}];}_0x2974b0=_[_0xc0de('0x4d')]({},_0x2974b0,_0x3b2447['options']);return db[_0xc0de('0x3b')][_0xc0de('0x55')](_0x2974b0)[_0xc0de('0x20')](handleEntityNotFound(_0x4490a4,null))[_0xc0de('0x20')](respondWithResult(_0x4490a4,null))[_0xc0de('0x29')](handleError(_0x4490a4,null));};exports[_0xc0de('0x33')]=function(_0x338db3,_0x5f09a0){if(_0x338db3[_0xc0de('0x56')]['id']){delete _0x338db3[_0xc0de('0x56')]['id'];}return db[_0xc0de('0x3b')][_0xc0de('0x55')]({'where':{'id':_0x338db3['params']['id']}})['then'](handleEntityNotFound(_0x5f09a0,null))[_0xc0de('0x20')](saveUpdates(_0x338db3[_0xc0de('0x56')],null))[_0xc0de('0x20')](respondWithResult(_0x5f09a0,null))[_0xc0de('0x29')](handleError(_0x5f09a0,null));};exports[_0xc0de('0x57')]=function(_0x13b76f,_0x18faa0,_0x1c5110){if(_0x13b76f[_0xc0de('0x58')]&&_0x13b76f[_0xc0de('0x58')]['filename']){_0x13b76f[_0xc0de('0x56')][_0xc0de('0x59')]=_0x13b76f['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x13b76f[_0xc0de('0x53')]['id']}})[_0xc0de('0x20')](handleEntityNotFound(_0x18faa0,null))['then'](saveUpdates(_0x13b76f['body'],null))[_0xc0de('0x20')](respondWithResult(_0x18faa0,null))[_0xc0de('0x29')](handleError(_0x18faa0,null));};exports[_0xc0de('0x5a')]=function(_0x3be584,_0x329adb,_0x3bb525){if(_0x3be584['file']&&_0x3be584[_0xc0de('0x58')][_0xc0de('0x5b')]){_0x3be584[_0xc0de('0x56')][_0xc0de('0x5c')]=_0x3be584[_0xc0de('0x58')][_0xc0de('0x5b')];}return db[_0xc0de('0x3b')][_0xc0de('0x55')]({'where':{'id':_0x3be584[_0xc0de('0x53')]['id']}})['then'](handleEntityNotFound(_0x329adb,null))['then'](saveUpdates(_0x3be584[_0xc0de('0x56')],null))[_0xc0de('0x20')](respondWithResult(_0x329adb,null))[_0xc0de('0x29')](handleError(_0x329adb,null));};var utilLicense=require(_0xc0de('0x1b'));exports[_0xc0de('0x5d')]=function(_0x534674,_0x170621,_0x2060b2){var _0x230665=_0xc0de('0x5e');var _0x313759={'custom':![]};return utilLicense[_0xc0de('0x5f')]()[_0xc0de('0x20')](function(_0x365edb){if(_0x365edb){_0x313759=_0x365edb;}return db[_0xc0de('0x3b')][_0xc0de('0x55')]({'where':{'id':_0x534674['params']['id']},'attributes':[_0xc0de('0x59'),'loginLogo','preferred',_0xc0de('0x60'),_0xc0de('0x61'),_0xc0de('0x62'),_0xc0de('0x63'),_0xc0de('0x64')],'raw':!![]});})[_0xc0de('0x20')](handleEntityNotFound(_0x170621,null))[_0xc0de('0x20')](function(_0x185ae3){if(_0x185ae3){var _0x21a936=_0x185ae3['logo']&&fs[_0xc0de('0x65')](path[_0xc0de('0x66')](config['root'],_0x230665,_['toLower'](_0x185ae3['logo'])))?path[_0xc0de('0x66')](config['root'],_0x230665,_[_0xc0de('0x67')](_0x185ae3['logo'])):path['join'](config['root'],_0x230665,_[_0xc0de('0x67')](_0xc0de('0x68')));var _0xfecd2b=_0xc0de('0x69')+_[_0xc0de('0x6a')](_0xc0de('0x59'));if(_0x185ae3[_0xfecd2b]||!_0x313759[_0xc0de('0x6b')]){_0x21a936=path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x230665,_[_0xc0de('0x67')](_0xc0de('0x68')));}if(!fs[_0xc0de('0x65')](_0x21a936)){throw new db[(_0xc0de('0x6d'))]['ValidationError'](_['upperFirst']('logo')+_0xc0de('0x6e'));}return _0x170621[_0xc0de('0x6f')](_0x21a936);}})[_0xc0de('0x29')](handleError(_0x170621,null));};var utilLicense=require(_0xc0de('0x1b'));exports[_0xc0de('0x70')]=function(_0x530eeb,_0x23e03b,_0x3c808c){var _0x168505=_0xc0de('0x5e');var _0x492809={'custom':![]};return utilLicense['getLicense']()[_0xc0de('0x20')](function(_0x50911e){if(_0x50911e){_0x492809=_0x50911e;}return db[_0xc0de('0x3b')]['find']({'where':{'id':_0x530eeb[_0xc0de('0x53')]['id']},'attributes':['logo',_0xc0de('0x5c'),_0xc0de('0x71'),_0xc0de('0x60'),'defaultLogo','defaultLoginLogo',_0xc0de('0x63'),_0xc0de('0x64')],'raw':!![]});})[_0xc0de('0x20')](handleEntityNotFound(_0x23e03b,null))[_0xc0de('0x20')](function(_0x9b7bab){if(_0x9b7bab){var _0x31443c=_0x9b7bab[_0xc0de('0x5c')]&&fs['existsSync'](path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x168505,_['toLower'](_0x9b7bab[_0xc0de('0x5c')])))?path[_0xc0de('0x66')](config['root'],_0x168505,_[_0xc0de('0x67')](_0x9b7bab['loginLogo'])):path[_0xc0de('0x66')](config['root'],_0x168505,_[_0xc0de('0x67')](_0xc0de('0x72')));var _0x140630=_0xc0de('0x69')+_['upperFirst']('loginLogo');if(_0x9b7bab[_0x140630]||!_0x492809['custom']){_0x31443c=path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x168505,_[_0xc0de('0x67')](_0xc0de('0x72')));}if(!fs[_0xc0de('0x65')](_0x31443c)){throw new db['Sequelize'][(_0xc0de('0x73'))](_[_0xc0de('0x6a')](_0xc0de('0x5c'))+_0xc0de('0x6e'));}return _0x23e03b['download'](_0x31443c);}})[_0xc0de('0x29')](handleError(_0x23e03b,null));};exports[_0xc0de('0x74')]=function(_0x5925dd,_0x2038af){return db[_0xc0de('0x3b')][_0xc0de('0x55')]({'where':{'id':_0x5925dd[_0xc0de('0x53')]['id']},'attributes':[_0xc0de('0x75')]})[_0xc0de('0x20')](respondWithResult(_0x2038af,null))['catch'](handleError(_0x2038af,null));};exports[_0xc0de('0x76')]=function(_0x2b0595,_0x3fa856,_0x5acb8){if(_0x2b0595[_0xc0de('0x58')]&&_0x2b0595[_0xc0de('0x58')][_0xc0de('0x5b')]){_0x2b0595['body'][_0xc0de('0x71')]=_0x2b0595['file'][_0xc0de('0x5b')];}return db[_0xc0de('0x3b')][_0xc0de('0x55')]({'where':{'id':_0x2b0595[_0xc0de('0x53')]['id']}})[_0xc0de('0x20')](handleEntityNotFound(_0x3fa856,null))[_0xc0de('0x20')](saveUpdates(_0x2b0595[_0xc0de('0x56')],null))[_0xc0de('0x20')](respondWithResult(_0x3fa856,null))[_0xc0de('0x29')](handleError(_0x3fa856,null));};var utilLicense=require(_0xc0de('0x1b'));exports[_0xc0de('0x77')]=function(_0xad2202,_0x4465b0,_0x12bac6){var _0x1979ee=_0xc0de('0x5e');var _0x5719e1={'custom':![]};return utilLicense[_0xc0de('0x5f')]()[_0xc0de('0x20')](function(_0x4aa9fc){if(_0x4aa9fc){_0x5719e1=_0x4aa9fc;}return db['Setting'][_0xc0de('0x55')]({'where':{'id':_0xad2202[_0xc0de('0x53')]['id']},'attributes':[_0xc0de('0x59'),_0xc0de('0x5c'),_0xc0de('0x71'),_0xc0de('0x60'),_0xc0de('0x61'),_0xc0de('0x62'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xc0de('0x20')](handleEntityNotFound(_0x4465b0,null))[_0xc0de('0x20')](function(_0x4e623a){if(_0x4e623a){var _0x206ddc=_0x4e623a[_0xc0de('0x71')]&&fs['existsSync'](path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x1979ee,_[_0xc0de('0x67')](_0x4e623a[_0xc0de('0x71')])))?path[_0xc0de('0x66')](config['root'],_0x1979ee,_[_0xc0de('0x67')](_0x4e623a[_0xc0de('0x71')])):path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x1979ee,_[_0xc0de('0x67')](_0xc0de('0x78')));var _0x42c321=_0xc0de('0x69')+_['upperFirst'](_0xc0de('0x71'));if(_0x4e623a[_0x42c321]||!_0x5719e1['custom']||!_0x5719e1[_0xc0de('0x71')]){_0x206ddc=path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x1979ee,_[_0xc0de('0x67')]('default_preferred.png'));}if(!fs['existsSync'](_0x206ddc)){throw new db['Sequelize'][(_0xc0de('0x73'))](_['upperFirst'](_0xc0de('0x71'))+'\x20not\x20found');}return _0x4465b0[_0xc0de('0x6f')](_0x206ddc);}})[_0xc0de('0x29')](handleError(_0x4465b0,null));};exports[_0xc0de('0x79')]=function(_0x180636,_0xbc78b5,_0xf0c8e1){if(_0x180636[_0xc0de('0x58')]&&_0x180636[_0xc0de('0x58')]['filename']){_0x180636[_0xc0de('0x56')][_0xc0de('0x60')]=_0x180636[_0xc0de('0x58')]['filename'];}return db[_0xc0de('0x3b')]['find']({'where':{'id':_0x180636[_0xc0de('0x53')]['id']}})[_0xc0de('0x20')](handleEntityNotFound(_0xbc78b5,null))[_0xc0de('0x20')](saveUpdates(_0x180636[_0xc0de('0x56')],null))[_0xc0de('0x20')](respondWithResult(_0xbc78b5,null))['catch'](handleError(_0xbc78b5,null));};var utilLicense=require(_0xc0de('0x1b'));exports[_0xc0de('0x7a')]=function(_0x330a1b,_0x405bbe,_0x1e6f94){var _0x132935='server/files/images/logos';var _0x430054={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x11160a){if(_0x11160a){_0x430054=_0x11160a;}return db['Setting']['find']({'where':{'id':_0x330a1b['params']['id']},'attributes':[_0xc0de('0x59'),_0xc0de('0x5c'),_0xc0de('0x71'),_0xc0de('0x60'),'defaultLogo',_0xc0de('0x62'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xc0de('0x20')](handleEntityNotFound(_0x405bbe,null))['then'](function(_0x627533){if(_0x627533){var _0x57755e=_0x627533[_0xc0de('0x60')]&&fs['existsSync'](path[_0xc0de('0x66')](config['root'],_0x132935,_[_0xc0de('0x67')](_0x627533['favicon'])))?path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x132935,_[_0xc0de('0x67')](_0x627533[_0xc0de('0x60')])):path[_0xc0de('0x66')](config[_0xc0de('0x6c')],_0x132935,_[_0xc0de('0x67')](_0xc0de('0x7b')));var _0x2dff2d=_0xc0de('0x69')+_['upperFirst']('favicon');if(_0x627533[_0x2dff2d]||!_0x430054['custom']){_0x57755e=path['join'](config[_0xc0de('0x6c')],_0x132935,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x57755e)){throw new db[(_0xc0de('0x6d'))][(_0xc0de('0x73'))](_[_0xc0de('0x6a')](_0xc0de('0x60'))+_0xc0de('0x6e'));}return _0x405bbe[_0xc0de('0x6f')](_0x57755e);}})[_0xc0de('0x29')](handleError(_0x405bbe,null));};exports['getDate']=function(_0xfb63e4,_0x5dbc1a){var _0x106106={'offset':moment()[_0xc0de('0x7c')]()};_0x106106[_0xc0de('0x7d')]=moment()[_0xc0de('0x7c')](_0x106106[_0xc0de('0x2d')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x5dbc1a[_0xc0de('0x2a')](0xc8)['send'](_0x106106);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 07df002..cff03f2 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x23b0aa,_0x25dbf7){var _0x5e9ea5=function(_0x14b59b){while(--_0x14b59b){_0x23b0aa['push'](_0x23b0aa['shift']());}};_0x5e9ea5(++_0x25dbf7);}(_0xe14b,0x93));var _0xbe14=function(_0x52d5a1,_0xff05d5){_0x52d5a1=_0x52d5a1-0x0;var _0x176c31=_0xe14b[_0x52d5a1];return _0x176c31;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x217940,_0x986fc2){var _0x3df61d=function(_0x15b946){while(--_0x15b946){_0x217940['push'](_0x217940['shift']());}};_0x3df61d(++_0x986fc2);}(_0x34e8,0x12c));var _0x834e=function(_0x2c22a9,_0x2c9bb8){_0x2c22a9=_0x2c22a9-0x0;var _0x3b3e22=_0x34e8[_0x2c22a9];return _0x3b3e22;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 948665d..25f493c 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 _0x90cd=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Setting','find','options','attributes','include','map','model','ShowSetting','lodash','util','moment'];(function(_0x47e3f8,_0x517bcd){var _0x4742d5=function(_0x2a4f20){while(--_0x2a4f20){_0x47e3f8['push'](_0x47e3f8['shift']());}};_0x4742d5(++_0x517bcd);}(_0x90cd,0xb7));var _0xd90c=function(_0x54fedc,_0x23d477){_0x54fedc=_0x54fedc-0x0;var _0x5164d0=_0x90cd[_0x54fedc];return _0x5164d0;};'use strict';var _=require(_0xd90c('0x0'));var util=require(_0xd90c('0x1'));var moment=require(_0xd90c('0x2'));var BPromise=require(_0xd90c('0x3'));var rs=require(_0xd90c('0x4'));var fs=require('fs');var Redis=require(_0xd90c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd90c('0x6'));var logger=require('../../config/logger')(_0xd90c('0x7'));var config=require(_0xd90c('0x8'));var jayson=require(_0xd90c('0x9'));var client=jayson[_0xd90c('0xa')][_0xd90c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35f108,_0x149fb3,_0x1793fc){return new BPromise(function(_0x2bfbc4,_0x2dd1d2){return client[_0xd90c('0xc')](_0x35f108,_0x1793fc)[_0xd90c('0xd')](function(_0x15844a){logger[_0xd90c('0xe')](_0xd90c('0xf'),_0x149fb3,'request\x20sent');logger[_0xd90c('0x10')](_0xd90c('0x11'),_0x149fb3,'request\x20sent',JSON[_0xd90c('0x12')](_0x15844a));if(_0x15844a[_0xd90c('0x13')]){if(_0x15844a[_0xd90c('0x13')]['code']===0x1f4){logger[_0xd90c('0x13')](_0xd90c('0xf'),_0x149fb3,_0x15844a[_0xd90c('0x13')]['message']);return _0x2dd1d2(_0x15844a[_0xd90c('0x13')][_0xd90c('0x14')]);}logger[_0xd90c('0x13')]('Setting,\x20%s,\x20%s',_0x149fb3,_0x15844a[_0xd90c('0x13')]['message']);return _0x2bfbc4(_0x15844a['error'][_0xd90c('0x14')]);}else{logger[_0xd90c('0xe')](_0xd90c('0xf'),_0x149fb3,'request\x20sent');_0x2bfbc4(_0x15844a[_0xd90c('0x15')]['message']);}})[_0xd90c('0x16')](function(_0x5843d2){logger[_0xd90c('0x13')](_0xd90c('0xf'),_0x149fb3,_0x5843d2);_0x2dd1d2(_0x5843d2);});});}exports['ShowSetting']=function(_0x3e645b){var _0xde20ed=this;return new Promise(function(_0x264778,_0x378449){return db[_0xd90c('0x17')][_0xd90c('0x18')]({'raw':_0x3e645b['options']?_0x3e645b['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e645b['options']?_0x3e645b[_0xd90c('0x19')]['where']||null:null,'attributes':_0x3e645b[_0xd90c('0x19')]?_0x3e645b[_0xd90c('0x19')][_0xd90c('0x1a')]||null:null,'include':_0x3e645b[_0xd90c('0x19')]?_0x3e645b['options'][_0xd90c('0x1b')]?_[_0xd90c('0x1c')](_0x3e645b[_0xd90c('0x19')]['include'],function(_0x12cf87){return{'model':db[_0x12cf87[_0xd90c('0x1d')]],'as':_0x12cf87['as'],'attributes':_0x12cf87[_0xd90c('0x1a')],'include':_0x12cf87['include']?_['map'](_0x12cf87['include'],function(_0x437288){return{'model':db[_0x437288['model']],'as':_0x437288['as'],'attributes':_0x437288['attributes'],'include':_0x437288[_0xd90c('0x1b')]?_[_0xd90c('0x1c')](_0x437288[_0xd90c('0x1b')],function(_0x479213){return{'model':db[_0x479213['model']],'as':_0x479213['as'],'attributes':_0x479213['attributes']};}):[]};}):[]};}):[]:[]})[_0xd90c('0xd')](function(_0x1575aa){logger[_0xd90c('0xe')](_0xd90c('0x1e'),_0x3e645b);logger[_0xd90c('0x10')](_0xd90c('0x1e'),_0x3e645b,JSON[_0xd90c('0x12')](_0x1575aa));_0x264778(_0x1575aa);})[_0xd90c('0x16')](function(_0x4e4b2c){logger[_0xd90c('0x13')]('ShowSetting',_0x4e4b2c[_0xd90c('0x14')],_0x3e645b);_0x378449(_0xde20ed[_0xd90c('0x13')](0x1f4,_0x4e4b2c[_0xd90c('0x14')]));});});}; \ No newline at end of file +var _0x3295=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ShowSetting','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3295,0x1f2));var _0x5329=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x3295[_0x383356];return _0x32ee5a;};'use strict';var _=require(_0x5329('0x0'));var util=require(_0x5329('0x1'));var moment=require(_0x5329('0x2'));var BPromise=require(_0x5329('0x3'));var rs=require(_0x5329('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5329('0x5'))['db'];var utils=require(_0x5329('0x6'));var logger=require(_0x5329('0x7'))(_0x5329('0x8'));var config=require(_0x5329('0x9'));var jayson=require(_0x5329('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ee10a,_0x5c0b31,_0x28a99c){return new BPromise(function(_0x3307df,_0x565862){return client['request'](_0x4ee10a,_0x28a99c)[_0x5329('0xb')](function(_0x1fd9fc){logger[_0x5329('0xc')](_0x5329('0xd'),_0x5c0b31,_0x5329('0xe'));logger[_0x5329('0xf')](_0x5329('0x10'),_0x5c0b31,_0x5329('0xe'),JSON[_0x5329('0x11')](_0x1fd9fc));if(_0x1fd9fc['error']){if(_0x1fd9fc['error'][_0x5329('0x12')]===0x1f4){logger[_0x5329('0x13')](_0x5329('0xd'),_0x5c0b31,_0x1fd9fc[_0x5329('0x13')][_0x5329('0x14')]);return _0x565862(_0x1fd9fc[_0x5329('0x13')]['message']);}logger[_0x5329('0x13')](_0x5329('0xd'),_0x5c0b31,_0x1fd9fc['error']['message']);return _0x3307df(_0x1fd9fc['error']['message']);}else{logger[_0x5329('0xc')](_0x5329('0xd'),_0x5c0b31,_0x5329('0xe'));_0x3307df(_0x1fd9fc[_0x5329('0x15')]['message']);}})[_0x5329('0x16')](function(_0x3d87e5){logger[_0x5329('0x13')]('Setting,\x20%s,\x20%s',_0x5c0b31,_0x3d87e5);_0x565862(_0x3d87e5);});});}exports[_0x5329('0x17')]=function(_0x5987fb){var _0x30ecc0=this;return new Promise(function(_0x3b406f,_0xbb5081){return db['Setting']['find']({'raw':_0x5987fb[_0x5329('0x18')]?_0x5987fb[_0x5329('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5987fb[_0x5329('0x18')]?_0x5987fb[_0x5329('0x18')][_0x5329('0x19')]||null:null,'attributes':_0x5987fb[_0x5329('0x18')]?_0x5987fb[_0x5329('0x18')][_0x5329('0x1a')]||null:null,'include':_0x5987fb['options']?_0x5987fb[_0x5329('0x18')][_0x5329('0x1b')]?_[_0x5329('0x1c')](_0x5987fb[_0x5329('0x18')][_0x5329('0x1b')],function(_0x3bd1e4){return{'model':db[_0x3bd1e4[_0x5329('0x1d')]],'as':_0x3bd1e4['as'],'attributes':_0x3bd1e4[_0x5329('0x1a')],'include':_0x3bd1e4[_0x5329('0x1b')]?_[_0x5329('0x1c')](_0x3bd1e4[_0x5329('0x1b')],function(_0x4666ea){return{'model':db[_0x4666ea[_0x5329('0x1d')]],'as':_0x4666ea['as'],'attributes':_0x4666ea[_0x5329('0x1a')],'include':_0x4666ea['include']?_[_0x5329('0x1c')](_0x4666ea['include'],function(_0x50d93a){return{'model':db[_0x50d93a[_0x5329('0x1d')]],'as':_0x50d93a['as'],'attributes':_0x50d93a[_0x5329('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x223f9d){logger[_0x5329('0xc')]('ShowSetting',_0x5987fb);logger[_0x5329('0xf')](_0x5329('0x17'),_0x5987fb,JSON[_0x5329('0x11')](_0x223f9d));_0x3b406f(_0x223f9d);})[_0x5329('0x16')](function(_0x489a7d){logger[_0x5329('0x13')](_0x5329('0x17'),_0x489a7d[_0x5329('0x14')],_0x5987fb);_0xbb5081(_0x30ecc0[_0x5329('0x13')](0x1f4,_0x489a7d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 0293bd6..fb9c071 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 _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x5db977,_0x3bb74a){var _0x2e2b20=function(_0x566980){while(--_0x566980){_0x5db977['push'](_0x5db977['shift']());}};_0x2e2b20(++_0x3bb74a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x5fc3[_0x40b493];return _0x548365;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x5219bf,_0x1a4a45){var _0x46c790=function(_0x52d2b4){while(--_0x52d2b4){_0x5219bf['push'](_0x5219bf['shift']());}};_0x46c790(++_0x1a4a45);}(_0x8ef6,0xf2));var _0x68ef=function(_0x479d95,_0x2d03d7){_0x479d95=_0x479d95-0x0;var _0x35137c=_0x8ef6[_0x479d95];return _0x35137c;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ec76af7..26d8f2b 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 _0x00ce=['infobip','intelepeer','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','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','plivo','clickatell','csc'];(function(_0x2d0ddd,_0x1b9b91){var _0x27db88=function(_0x139eed){while(--_0x139eed){_0x2d0ddd['push'](_0x2d0ddd['shift']());}};_0x27db88(++_0x1b9b91);}(_0x00ce,0x1d5));var _0xe00c=function(_0x324ac2,_0x549f01){_0x324ac2=_0x324ac2-0x0;var _0x48e30c=_0x00ce[_0x324ac2];return _0x48e30c;};'use strict';var Sequelize=require(_0xe00c('0x0'));var rs=require(_0xe00c('0x1'));module[_0xe00c('0x2')]={'name':{'type':Sequelize[_0xe00c('0x3')],'unique':_0xe00c('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe00c('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe00c('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe00c('0x5')](_0xe00c('0x6'),_0xe00c('0x7'),'connectel','clicksend',_0xe00c('0x8'),_0xe00c('0x9'),'bandwidth',_0xe00c('0xa'),_0xe00c('0xb'),_0xe00c('0xc'))},'accountSid':{'type':Sequelize[_0xe00c('0x3')]},'authId':{'type':Sequelize[_0xe00c('0x3')]},'authToken':{'type':Sequelize[_0xe00c('0x3')]},'smsMethod':{'type':Sequelize[_0xe00c('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xe00c('0x3')]},'password':{'type':Sequelize[_0xe00c('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xe00c('0x3')]},'accountId':{'type':Sequelize[_0xe00c('0x3')]},'senderString':{'type':Sequelize[_0xe00c('0x3')]},'deliveryReport':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xe00c('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe00c('0xe')],'defaultValue':function(){return _0xe00c('0xf');}},'notificationSound':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe00c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe00c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe00c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe00c('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe00c('0x10')],'comment':_0xe00c('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xe00c('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28b8ed){if(!_0x28b8ed)this[_0xe00c('0x12')](_0xe00c('0x13'),null);this['setDataValue']('mandatoryDisposition',_0x28b8ed);}}}; \ No newline at end of file +var _0x5c6d=['plivo','clickatell','bandwidth','infobip','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','STRING','generate','twilio','skebby','connectel','clicksend'];(function(_0x1ca7a1,_0x167f46){var _0x50f711=function(_0x1cfdb2){while(--_0x1cfdb2){_0x1ca7a1['push'](_0x1ca7a1['shift']());}};_0x50f711(++_0x167f46);}(_0x5c6d,0xf4));var _0xd5c6=function(_0x219e37,_0x4d94fa){_0x219e37=_0x219e37-0x0;var _0x27fd77=_0x5c6d[_0x219e37];return _0x27fd77;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd5c6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd5c6('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xd5c6('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd5c6('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xd5c6('0x2')],'defaultValue':function(){return rs[_0xd5c6('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xd5c6('0x4'),_0xd5c6('0x5'),_0xd5c6('0x6'),_0xd5c6('0x7'),_0xd5c6('0x8'),_0xd5c6('0x9'),_0xd5c6('0xa'),'csc',_0xd5c6('0xb'),_0xd5c6('0xc'))},'accountSid':{'type':Sequelize[_0xd5c6('0x2')]},'authId':{'type':Sequelize[_0xd5c6('0x2')]},'authToken':{'type':Sequelize[_0xd5c6('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd5c6('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xd5c6('0x2')]},'accountId':{'type':Sequelize[_0xd5c6('0x2')]},'senderString':{'type':Sequelize[_0xd5c6('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd5c6('0xd');}},'notificationSound':{'type':Sequelize[_0xd5c6('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd5c6('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd5c6('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd5c6('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd5c6('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd5c6('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd5c6('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd5c6('0xf')],'comment':_0xd5c6('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xd5c6('0xe')],'defaultValue':![],'comment':_0xd5c6('0x11'),'set':function(_0x2002a7){if(!_0x2002a7)this[_0xd5c6('0x12')](_0xd5c6('0x13'),null);this[_0xd5c6('0x12')](_0xd5c6('0x14'),_0x2002a7);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 0f212f3..17cc309 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 _0x7ed8=['isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','push','dataValues','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','intelepeer','redif','inspect','DELIVERED_TO_GATEWAY','DELIVRD','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','SmsAccount','findAll','rows','show','params','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','SmsAccountId','Disposition','nolimit','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','Applications','account','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','text','connectel','clicksend','message_id','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid'];(function(_0x12e084,_0x445d1d){var _0x4f67b2=function(_0x165a60){while(--_0x165a60){_0x12e084['push'](_0x12e084['shift']());}};_0x4f67b2(++_0x445d1d);}(_0x7ed8,0x134));var _0x87ed=function(_0xbb0ae3,_0x3e539f){_0xbb0ae3=_0xbb0ae3-0x0;var _0x26379d=_0x7ed8[_0xbb0ae3];return _0x26379d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87ed('0x1'));var rp=require(_0x87ed('0x2'));var moment=require(_0x87ed('0x3'));var BPromise=require(_0x87ed('0x4'));var Mustache=require(_0x87ed('0x5'));var util=require(_0x87ed('0x6'));var path=require('path');var sox=require(_0x87ed('0x7'));var csv=require(_0x87ed('0x8'));var ejs=require(_0x87ed('0x9'));var fs=require('fs');var fs_extra=require(_0x87ed('0xa'));var _=require(_0x87ed('0xb'));var squel=require(_0x87ed('0xc'));var crypto=require(_0x87ed('0xd'));var jsforce=require(_0x87ed('0xe'));var deskjs=require(_0x87ed('0xf'));var toCsv=require(_0x87ed('0x8'));var querystring=require(_0x87ed('0x10'));var Papa=require(_0x87ed('0x11'));var Redis=require(_0x87ed('0x12'));var authService=require(_0x87ed('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87ed('0x14'));var logger=require(_0x87ed('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x87ed('0x16'));var licenseUtil=require(_0x87ed('0x17'));var db=require(_0x87ed('0x18'))['db'];config[_0x87ed('0x19')]=_[_0x87ed('0x1a')](config[_0x87ed('0x19')],{'host':_0x87ed('0x1b'),'port':0x18eb});var socket=require(_0x87ed('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x87ed('0x1d'));var client=jayson[_0x87ed('0x1e')][_0x87ed('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x740245,_0x28cf0c,_0x2b0ac0,_0x1c76a5){return new BPromise(function(_0x4d4820,_0x486a15){var _0x1abbe3=_0x1c76a5||client;return _0x1abbe3['request'](_0x740245,_0x2b0ac0)['then'](function(_0x15e2a9){logger[_0x87ed('0x20')](_0x87ed('0x21'),_0x28cf0c,_0x87ed('0x22'));logger[_0x87ed('0x23')](_0x87ed('0x24'),_0x28cf0c,_0x87ed('0x22'),JSON[_0x87ed('0x25')](_0x15e2a9));if(_0x15e2a9[_0x87ed('0x26')]){if(_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x27')]===0x1f4){logger[_0x87ed('0x26')](_0x87ed('0x21'),_0x28cf0c,_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x28')]);return _0x486a15(_0x15e2a9[_0x87ed('0x26')]['message']);}logger[_0x87ed('0x26')](_0x87ed('0x21'),_0x28cf0c,_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x28')]);return _0x4d4820(_0x15e2a9[_0x87ed('0x26')][_0x87ed('0x28')]);}else{logger[_0x87ed('0x20')](_0x87ed('0x21'),_0x28cf0c,_0x87ed('0x22'));_0x4d4820(_0x15e2a9[_0x87ed('0x29')][_0x87ed('0x28')]);}})[_0x87ed('0x2a')](function(_0x100b19){logger[_0x87ed('0x26')](_0x87ed('0x21'),_0x28cf0c,_0x100b19);_0x486a15(_0x100b19);});});}function respondWithStatusCode(_0x71f807,_0x27a410){_0x27a410=_0x27a410||0xcc;return function(_0x432a7c){if(_0x432a7c){return _0x71f807[_0x87ed('0x2b')](_0x27a410);}return _0x71f807[_0x87ed('0x2c')](_0x27a410)[_0x87ed('0x2d')]();};}function respondWithResult(_0x4bd357,_0x1dcfe2){_0x1dcfe2=_0x1dcfe2||0xc8;return function(_0x105f93){if(_0x105f93){return _0x4bd357['status'](_0x1dcfe2)[_0x87ed('0x2e')](_0x105f93);}};}function respondWithFilteredResult(_0x2c53b6,_0x3af109){return function(_0x710889){if(_0x710889){var _0x248059=typeof _0x3af109[_0x87ed('0x2f')]==='undefined'&&typeof _0x3af109[_0x87ed('0x30')]===_0x87ed('0x31');var _0x2827cd=_0x710889['count'];var _0xfa4627=_0x248059?0x0:_0x3af109['offset'];var _0x2fe01f=_0x248059?_0x710889['count']:_0x3af109[_0x87ed('0x2f')]+_0x3af109['limit'];var _0x2584dc;if(_0x2fe01f>=_0x2827cd){_0x2fe01f=_0x2827cd;_0x2584dc=0xc8;}else{_0x2584dc=0xce;}_0x2c53b6[_0x87ed('0x2c')](_0x2584dc);return _0x2c53b6[_0x87ed('0x32')](_0x87ed('0x33'),_0xfa4627+'-'+_0x2fe01f+'/'+_0x2827cd)['json'](_0x710889);}return null;};}function patchUpdates(_0x716f3e){return function(_0x4c630a){try{jsonpatch[_0x87ed('0x34')](_0x4c630a,_0x716f3e,!![]);}catch(_0x486bc2){return BPromise[_0x87ed('0x35')](_0x486bc2);}return _0x4c630a[_0x87ed('0x36')]();};}function saveUpdates(_0x2eed16,_0x16a670){return function(_0x27d3eb){if(_0x27d3eb){return _0x27d3eb[_0x87ed('0x37')](_0x2eed16)['then'](function(_0x5d07ae){return _0x5d07ae;});}return null;};}function removeEntity(_0x29aa67,_0x973f4e){return function(_0x25c84b){if(_0x25c84b){return _0x25c84b[_0x87ed('0x38')]()[_0x87ed('0x39')](function(){var _0x3584a7=_0x25c84b['get']({'plain':!![]});var _0x2a3908=_0x87ed('0x3a');return db[_0x87ed('0x3b')]['destroy']({'where':{'type':_0x2a3908,'resourceId':_0x3584a7['id']}})[_0x87ed('0x39')](function(){return _0x25c84b;});})[_0x87ed('0x39')](function(){_0x29aa67['status'](0xcc)[_0x87ed('0x2d')]();});}};}function handleEntityNotFound(_0xd50bfc,_0x2a5135){return function(_0x51d848){if(!_0x51d848){_0xd50bfc['sendStatus'](0x194);}return _0x51d848;};}function handleError(_0x586089,_0x2e5ce6){_0x2e5ce6=_0x2e5ce6||0x1f4;return function(_0x362969){logger[_0x87ed('0x26')](_0x362969[_0x87ed('0x3c')]);if(_0x362969[_0x87ed('0x3d')]){delete _0x362969['name'];}_0x586089[_0x87ed('0x2c')](_0x2e5ce6)[_0x87ed('0x3e')](_0x362969);};}exports['index']=function(_0x5104aa,_0x355cf9){var _0x294ace={'include':[{'model':db['Pause'],'as':_0x87ed('0x3f')}]},_0x327e1b={},_0x10bdad={'count':0x0,'rows':[]};var _0x3a9881=_[_0x87ed('0x40')](db['SmsAccount'][_0x87ed('0x41')],function(_0x21b9c1){return{'name':_0x21b9c1[_0x87ed('0x42')],'type':_0x21b9c1[_0x87ed('0x43')][_0x87ed('0x44')]};});_0x327e1b[_0x87ed('0x45')]=_[_0x87ed('0x40')](_0x3a9881,_0x87ed('0x3d'));_0x327e1b[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x5104aa[_0x87ed('0x46')]);_0x327e1b[_0x87ed('0x48')]=_['intersection'](_0x327e1b['model'],_0x327e1b[_0x87ed('0x46')]);_0x294ace[_0x87ed('0x49')]=_['intersection'](_0x327e1b[_0x87ed('0x45')],qs['fields'](_0x5104aa[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x294ace[_0x87ed('0x49')]=_0x294ace[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x294ace[_0x87ed('0x49')]:_0x327e1b['model'];if(!_0x5104aa[_0x87ed('0x46')][_0x87ed('0x4c')]('nolimit')){_0x294ace[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x5104aa[_0x87ed('0x46')]['limit']);_0x294ace[_0x87ed('0x2f')]=qs[_0x87ed('0x2f')](_0x5104aa[_0x87ed('0x46')]['offset']);}_0x294ace[_0x87ed('0x4d')]=qs[_0x87ed('0x4e')](_0x5104aa[_0x87ed('0x46')][_0x87ed('0x4e')]);_0x294ace[_0x87ed('0x4f')]=qs[_0x87ed('0x48')](_[_0x87ed('0x50')](_0x5104aa[_0x87ed('0x46')],_0x327e1b['filters']),_0x3a9881);if(_0x5104aa['query'][_0x87ed('0x51')]){_0x294ace[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x294ace[_0x87ed('0x4f')],{'$or':_['map'](_0x3a9881,function(_0x44d632){if(_0x44d632[_0x87ed('0x43')]!==_0x87ed('0x53')){var _0x1a9ce2={};_0x1a9ce2[_0x44d632['name']]={'$like':'%'+_0x5104aa['query'][_0x87ed('0x51')]+'%'};return _0x1a9ce2;}})});}_0x294ace=_[_0x87ed('0x52')]({},_0x294ace,_0x5104aa[_0x87ed('0x54')]);var _0xc86fa0={'where':_0x294ace['where']};return db['SmsAccount'][_0x87ed('0x55')](_0xc86fa0)[_0x87ed('0x39')](function(_0x31ee16){_0x10bdad[_0x87ed('0x55')]=_0x31ee16;if(_0x5104aa[_0x87ed('0x46')][_0x87ed('0x56')]){_0x294ace[_0x87ed('0x57')]=[{'all':!![]}];}return db[_0x87ed('0x58')][_0x87ed('0x59')](_0x294ace);})[_0x87ed('0x39')](function(_0x48823a){_0x10bdad[_0x87ed('0x5a')]=_0x48823a;return _0x10bdad;})[_0x87ed('0x39')](respondWithFilteredResult(_0x355cf9,_0x294ace))[_0x87ed('0x2a')](handleError(_0x355cf9,null));};exports[_0x87ed('0x5b')]=function(_0x336fa0,_0x5d3742){var _0x1c5e68={'raw':![],'where':{'id':_0x336fa0[_0x87ed('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x87ed('0x3f')}]},_0x59e277={};_0x59e277[_0x87ed('0x45')]=_[_0x87ed('0x47')](db[_0x87ed('0x58')]['rawAttributes']);_0x59e277['query']=_[_0x87ed('0x47')](_0x336fa0[_0x87ed('0x46')]);_0x59e277[_0x87ed('0x48')]=_['intersection'](_0x59e277[_0x87ed('0x45')],_0x59e277[_0x87ed('0x46')]);_0x1c5e68[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x59e277[_0x87ed('0x45')],qs['fields'](_0x336fa0[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x1c5e68[_0x87ed('0x49')]=_0x1c5e68[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x1c5e68[_0x87ed('0x49')]:_0x59e277['model'];if(_0x336fa0[_0x87ed('0x46')][_0x87ed('0x56')]){_0x1c5e68[_0x87ed('0x57')]=[{'all':!![]}];}_0x1c5e68=_[_0x87ed('0x52')]({},_0x1c5e68,_0x336fa0[_0x87ed('0x54')]);return db[_0x87ed('0x58')]['find'](_0x1c5e68)[_0x87ed('0x39')](handleEntityNotFound(_0x5d3742,null))[_0x87ed('0x39')](respondWithResult(_0x5d3742,null))[_0x87ed('0x2a')](handleError(_0x5d3742,null));};exports[_0x87ed('0x5e')]=function(_0x27907f,_0x3979e3){return db[_0x87ed('0x58')][_0x87ed('0x5e')](_0x27907f[_0x87ed('0x5f')],{})[_0x87ed('0x39')](function(_0x26a4fb){var _0x10a036=_0x27907f[_0x87ed('0x60')][_0x87ed('0x61')]({'plain':!![]});if(!_0x10a036)throw new Error(_0x87ed('0x62'));if(_0x10a036[_0x87ed('0x63')]===_0x87ed('0x60')){var _0x13f9d2=_0x26a4fb['get']({'plain':!![]});var _0x1ab9cf=_0x87ed('0x3a');return db[_0x87ed('0x64')][_0x87ed('0x65')]({'where':{'name':_0x1ab9cf,'userProfileId':_0x10a036[_0x87ed('0x66')]},'raw':!![]})[_0x87ed('0x39')](function(_0x1b9a80){if(_0x1b9a80&&_0x1b9a80[_0x87ed('0x67')]===0x0){return db['UserProfileResource'][_0x87ed('0x5e')]({'name':_0x13f9d2[_0x87ed('0x3d')],'resourceId':_0x13f9d2['id'],'type':_0x1b9a80[_0x87ed('0x3d')],'sectionId':_0x1b9a80['id']},{})['then'](function(){return _0x26a4fb;});}else{return _0x26a4fb;}})[_0x87ed('0x2a')](function(_0x4ff4df){logger['error'](_0x87ed('0x68'),_0x4ff4df);throw _0x4ff4df;});}return _0x26a4fb;})[_0x87ed('0x39')](respondWithResult(_0x3979e3,0xc9))['catch'](handleError(_0x3979e3,null));};exports[_0x87ed('0x37')]=function(_0x359390,_0x4bc092){if(_0x359390[_0x87ed('0x5f')]['id']){delete _0x359390[_0x87ed('0x5f')]['id'];}return db['SmsAccount'][_0x87ed('0x65')]({'where':{'id':_0x359390[_0x87ed('0x5c')]['id']},'include':[{'model':db[_0x87ed('0x69')],'as':_0x87ed('0x3f')}]})[_0x87ed('0x39')](handleEntityNotFound(_0x4bc092,null))[_0x87ed('0x39')](saveUpdates(_0x359390[_0x87ed('0x5f')],null))['then'](respondWithResult(_0x4bc092,null))[_0x87ed('0x2a')](handleError(_0x4bc092,null));};exports[_0x87ed('0x38')]=function(_0x2500ba,_0x4ba5f8){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x2500ba[_0x87ed('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ba5f8,null))[_0x87ed('0x39')](removeEntity(_0x4ba5f8,null))[_0x87ed('0x2a')](handleError(_0x4ba5f8,null));};exports[_0x87ed('0x6a')]=function(_0x29daae,_0x1860d3){return db['SmsAccount']['describe']()[_0x87ed('0x39')](respondWithResult(_0x1860d3,null))[_0x87ed('0x2a')](handleError(_0x1860d3,null));};exports['addDisposition']=function(_0x476a4d,_0x5c2e8f,_0x431065){if(_0x476a4d['body']['id']){delete _0x476a4d[_0x87ed('0x5f')]['id'];}return db[_0x87ed('0x58')]['find']({'where':{'id':_0x476a4d[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x5c2e8f,null))[_0x87ed('0x39')](function(_0x15945b){if(_0x15945b){_0x476a4d[_0x87ed('0x5f')][_0x87ed('0x6b')]=_0x15945b['id'];return db[_0x87ed('0x6c')][_0x87ed('0x5e')](_0x476a4d[_0x87ed('0x5f')]);}})[_0x87ed('0x39')](respondWithResult(_0x5c2e8f,null))[_0x87ed('0x2a')](handleError(_0x5c2e8f,null));};exports['getDispositions']=function(_0x57f5e5,_0x3e17ab,_0x1f9fab){var _0x57e98e={'raw':![],'where':{}};var _0xa3265e={};var _0x558c04={'count':0x0,'rows':[]};return db[_0x87ed('0x58')]['findOne']({'where':{'id':_0x57f5e5['params']['id']}})['then'](handleEntityNotFound(_0x3e17ab,null))[_0x87ed('0x39')](function(_0x432eb6){if(_0x432eb6){_0xa3265e[_0x87ed('0x45')]=_[_0x87ed('0x47')](db[_0x87ed('0x6c')][_0x87ed('0x41')]);_0xa3265e[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x57f5e5[_0x87ed('0x46')]);_0xa3265e[_0x87ed('0x48')]=_['intersection'](_0xa3265e[_0x87ed('0x45')],_0xa3265e[_0x87ed('0x46')]);_0x57e98e[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0xa3265e['model'],qs[_0x87ed('0x4a')](_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x57e98e[_0x87ed('0x49')]=_0x57e98e['attributes'][_0x87ed('0x4b')]?_0x57e98e[_0x87ed('0x49')]:_0xa3265e[_0x87ed('0x45')];if(!_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x4c')](_0x87ed('0x6d'))){_0x57e98e[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x57f5e5['query'][_0x87ed('0x30')]);_0x57e98e[_0x87ed('0x2f')]=qs['offset'](_0x57f5e5['query'][_0x87ed('0x2f')]);}_0x57e98e[_0x87ed('0x4d')]=qs[_0x87ed('0x4e')](_0x57f5e5[_0x87ed('0x46')]['sort']);_0x57e98e[_0x87ed('0x4f')]=qs['filters'](_[_0x87ed('0x50')](_0x57f5e5[_0x87ed('0x46')],_0xa3265e[_0x87ed('0x48')]));_0x57e98e[_0x87ed('0x4f')][_0x87ed('0x6b')]=_0x432eb6['id'];if(_0x57f5e5[_0x87ed('0x46')]['filter']){_0x57e98e['where']=_[_0x87ed('0x52')](_0x57e98e['where'],{'$or':_['map'](_0x57e98e[_0x87ed('0x49')],function(_0x2e8160){var _0x91b1df={};_0x91b1df[_0x2e8160]={'$like':'%'+_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x51')]+'%'};return _0x91b1df;})});}_0x57e98e=_[_0x87ed('0x52')]({},_0x57e98e,_0x57f5e5[_0x87ed('0x54')]);return db[_0x87ed('0x6c')]['count']({'where':_0x57e98e['where']})['then'](function(_0x4dac28){_0x558c04[_0x87ed('0x55')]=_0x4dac28;if(_0x57f5e5[_0x87ed('0x46')][_0x87ed('0x56')]){_0x57e98e[_0x87ed('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x87ed('0x59')](_0x57e98e);})['then'](function(_0x27bf62){_0x558c04[_0x87ed('0x5a')]=_0x27bf62;return _0x558c04;});}})[_0x87ed('0x39')](respondWithFilteredResult(_0x3e17ab,_0x57e98e))['catch'](handleError(_0x3e17ab,null));};exports['removeDispositions']=function(_0x91c7ce,_0x22ba6a,_0x403289){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x91c7ce[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x22ba6a,null))['then'](function(_0x2dd0f9){if(_0x2dd0f9){return _0x2dd0f9[_0x87ed('0x6e')](_0x91c7ce[_0x87ed('0x46')]['ids']);}})[_0x87ed('0x39')](respondWithStatusCode(_0x22ba6a,null))[_0x87ed('0x2a')](handleError(_0x22ba6a,null));};exports['addAnswer']=function(_0x4a2360,_0x1a5e26,_0x1779de){if(_0x4a2360[_0x87ed('0x5f')]['id']){delete _0x4a2360[_0x87ed('0x5f')]['id'];}return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x4a2360['params']['id']}})['then'](handleEntityNotFound(_0x1a5e26,null))['then'](function(_0x6e20eb){if(_0x6e20eb){_0x4a2360[_0x87ed('0x5f')][_0x87ed('0x6b')]=_0x6e20eb['id'];return db[_0x87ed('0x6f')][_0x87ed('0x5e')](_0x4a2360[_0x87ed('0x5f')]);}})[_0x87ed('0x39')](respondWithResult(_0x1a5e26,null))[_0x87ed('0x2a')](handleError(_0x1a5e26,null));};exports[_0x87ed('0x70')]=function(_0x799564,_0xfb512c,_0x828f9c){var _0x10557d={'raw':![],'where':{}};var _0x115f82={};var _0x5c4ac6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x87ed('0x71')]({'where':{'id':_0x799564[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0xfb512c,null))[_0x87ed('0x39')](function(_0x31d6ad){if(_0x31d6ad){_0x115f82[_0x87ed('0x45')]=_['keys'](db[_0x87ed('0x6f')][_0x87ed('0x41')]);_0x115f82[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x799564[_0x87ed('0x46')]);_0x115f82['filters']=_[_0x87ed('0x5d')](_0x115f82[_0x87ed('0x45')],_0x115f82['query']);_0x10557d[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x115f82['model'],qs[_0x87ed('0x4a')](_0x799564[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x10557d[_0x87ed('0x49')]=_0x10557d[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x10557d[_0x87ed('0x49')]:_0x115f82[_0x87ed('0x45')];if(!_0x799564[_0x87ed('0x46')]['hasOwnProperty'](_0x87ed('0x6d'))){_0x10557d[_0x87ed('0x30')]=qs['limit'](_0x799564[_0x87ed('0x46')][_0x87ed('0x30')]);_0x10557d[_0x87ed('0x2f')]=qs['offset'](_0x799564[_0x87ed('0x46')][_0x87ed('0x2f')]);}_0x10557d[_0x87ed('0x4d')]=qs['sort'](_0x799564['query'][_0x87ed('0x4e')]);_0x10557d[_0x87ed('0x4f')]=qs['filters'](_['pick'](_0x799564[_0x87ed('0x46')],_0x115f82['filters']));_0x10557d['where']['SmsAccountId']=_0x31d6ad['id'];if(_0x799564[_0x87ed('0x46')][_0x87ed('0x51')]){_0x10557d[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x10557d[_0x87ed('0x4f')],{'$or':_['map'](_0x10557d[_0x87ed('0x49')],function(_0x7dfe8f){var _0x282ff1={};_0x282ff1[_0x7dfe8f]={'$like':'%'+_0x799564['query'][_0x87ed('0x51')]+'%'};return _0x282ff1;})});}_0x10557d=_[_0x87ed('0x52')]({},_0x10557d,_0x799564[_0x87ed('0x54')]);return db['CannedAnswer']['count']({'where':_0x10557d[_0x87ed('0x4f')]})['then'](function(_0x4ce8a1){_0x5c4ac6[_0x87ed('0x55')]=_0x4ce8a1;if(_0x799564[_0x87ed('0x46')][_0x87ed('0x56')]){_0x10557d[_0x87ed('0x57')]=[{'all':!![]}];}return db[_0x87ed('0x6f')][_0x87ed('0x59')](_0x10557d);})['then'](function(_0x50513d){_0x5c4ac6['rows']=_0x50513d;return _0x5c4ac6;});}})[_0x87ed('0x39')](respondWithFilteredResult(_0xfb512c,_0x10557d))[_0x87ed('0x2a')](handleError(_0xfb512c,null));};exports[_0x87ed('0x72')]=function(_0x401bda,_0x539c26,_0x44cb1f){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x401bda[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x539c26,null))['then'](function(_0x27868d){if(_0x27868d){return _0x27868d[_0x87ed('0x72')](_0x401bda[_0x87ed('0x46')]['ids']);}})[_0x87ed('0x39')](respondWithStatusCode(_0x539c26,null))[_0x87ed('0x2a')](handleError(_0x539c26,null));};exports[_0x87ed('0x73')]=function(_0x5a57b6,_0x5ee127,_0x25266c){var _0x266e5b={'channel':_0x87ed('0x74')};var _0x5e7857=[];var _0x223685=[];var _0x3719bd={};return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x5a57b6[_0x87ed('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x87ed('0x75')}]})[_0x87ed('0x39')](handleEntityNotFound(_0x5ee127,null))[_0x87ed('0x39')](function(_0x1eb298){_0x266e5b[_0x87ed('0x76')]=_0x1eb298;_0x266e5b['applications']=_[_0x87ed('0x77')](_0x1eb298[_0x87ed('0x75')],['priority'],[_0x87ed('0x78')]);if(_0x266e5b[_0x87ed('0x76')][_0x87ed('0x75')]){delete _0x266e5b['account'][_0x87ed('0x75')];}return db[_0x87ed('0x79')][_0x87ed('0x6a')]();})['then'](function(_0x37fffa){if(!_0x37fffa){throw new db['Sequelize'][(_0x87ed('0x7a'))](_0x87ed('0x7b'));}_0x5e7857=_[_0x87ed('0x7c')](_[_0x87ed('0x47')](_0x37fffa),[_0x87ed('0x7d'),_0x87ed('0x7e')]);_0x223685=_[_0x87ed('0x7c')](_[_0x87ed('0x47')](_0x37fffa),['createdAt','updatedAt',_0x87ed('0x7f'),'ListId']);_0x266e5b[_0x87ed('0x5f')]={'mapKey':_0x87ed('0x80')};if(_0x266e5b[_0x87ed('0x76')]['type']){switch(_0x266e5b[_0x87ed('0x76')][_0x87ed('0x43')]){case _0x87ed('0x81'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6['body'][_0x87ed('0x83')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x84')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')]['MessageSid'];break;case _0x87ed('0x86'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]='+'+_0x5a57b6['body']['sender'];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x87')];break;case _0x87ed('0x88'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')]['body']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x28')];break;case _0x87ed('0x89'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')]['body'];_0x266e5b['body'][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8a')];break;case'plivo':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x83')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8b')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8c')];break;case'infobip':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]='+'+_0x5a57b6[_0x87ed('0x5f')]['results'][0x0][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')]['body']=_0x5a57b6[_0x87ed('0x5f')]['results'][0x0]['text'];_0x266e5b['body']['messageId']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8d')][0x0]['messageId'];break;case _0x87ed('0x8e'):_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x8f')];_0x266e5b[_0x87ed('0x5f')]['body']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x90')][_0x87ed('0x28')];break;case _0x87ed('0x91'):_0x266e5b['body']['from']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x92')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')]['text'];_0x266e5b[_0x87ed('0x5f')]['messageId']=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x93')];break;case _0x87ed('0x94'):_0x266e5b[_0x87ed('0x5f')]['messageId']=_0x5a57b6[_0x87ed('0x5f')][0x0][_0x87ed('0x28')]['id'];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')][0x0]['message'][_0x87ed('0x82')];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6[_0x87ed('0x5f')][0x0][_0x87ed('0x28')][_0x87ed('0x87')];break;case'intelepeer':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')]=_0x5a57b6[_0x87ed('0x5f')]['from'];_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')]=_0x5a57b6['body'][_0x87ed('0x28')];_0x266e5b['body'][_0x87ed('0x85')]=_0x5a57b6[_0x87ed('0x5f')][_0x87ed('0x95')];break;}}if(_0x266e5b[_0x87ed('0x5f')]['id']){delete _0x266e5b[_0x87ed('0x5f')]['id'];}if(_[_0x87ed('0x96')](_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')])){throw new db['Sequelize'][(_0x87ed('0x7a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x266e5b['body'][_0x87ed('0x5f')])||_0x266e5b['body']['body']===''){throw new db[(_0x87ed('0x97'))][(_0x87ed('0x7a'))](_0x87ed('0x98'));}if(_[_0x87ed('0x96')](_0x266e5b['body'][_0x87ed('0x99')])){throw new db[(_0x87ed('0x97'))]['ValidationError'](_0x87ed('0x9a')+_0x223685);}if(!_['includes'](_0x223685,_0x266e5b[_0x87ed('0x5f')]['mapKey'])){throw new db[(_0x87ed('0x97'))][(_0x87ed('0x7a'))](_0x87ed('0x9b')+_0x223685);}_0x3719bd[_0x266e5b['body']['mapKey']]=_0x266e5b[_0x87ed('0x5f')]['from'];return db['CmList'][_0x87ed('0x65')]({'where':{'id':_0x266e5b[_0x87ed('0x76')][_0x87ed('0x9c')]},'include':[{'model':db['CmContact'],'as':_0x87ed('0x9d'),'where':_0x3719bd,'limit':0x1,'order':[[_0x87ed('0x7e'),_0x87ed('0x9e')]]}]});})[_0x87ed('0x39')](handleEntityNotFound(_0x5ee127,null))[_0x87ed('0x39')](function(_0x22144f){if(_0x22144f){_0x266e5b['list']=_['omit'](_0x22144f,[_0x87ed('0x9d')]);if(_0x22144f[_0x87ed('0x9d')]['length']){return _0x22144f[_0x87ed('0x9d')][0x0];}var _0xfe8df8=_['defaults'](_0x266e5b[_0x87ed('0x5f')],{'firstName':_0x266e5b[_0x87ed('0x5f')]['from'],'ListId':_0x22144f['id']});_0xfe8df8[_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x99')]]=_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x82')];return db[_0x87ed('0x79')][_0x87ed('0x5e')](_0xfe8df8,{'fields':_0x5e7857,'raw':!![]});}})[_0x87ed('0x39')](handleEntityNotFound(_0x5ee127,null))[_0x87ed('0x39')](function(_0x189783){if(_0x189783){_0x266e5b[_0x87ed('0x9f')]=_0x189783;var _0x2cff3c={'ContactId':_0x189783['id'],'phone':_0x266e5b['body']['from'],'SmsAccountId':_0x5a57b6[_0x87ed('0x5c')]['id']};var _0x423f5f={'ContactId':_0x189783['id'],'SmsAccountId':_0x5a57b6['params']['id'],'closed':![]};return db[_0x87ed('0xa0')][_0x87ed('0x65')]({'where':_0x423f5f})[_0x87ed('0x39')](function(_0xd16d77){if(_0xd16d77){return[_0xd16d77,![]];}return db['SmsInteraction'][_0x87ed('0x5e')](_0x2cff3c)[_0x87ed('0x39')](function(_0xba6a48){return[_0xba6a48,!![]];});});}})[_0x87ed('0xa1')](function(_0x4fdf8f,_0x213adf){_0x266e5b[_0x87ed('0xa2')]=_0x4fdf8f[_0x87ed('0x61')]({'plain':!![]});_0x266e5b['interaction'][_0x87ed('0xa3')]=![];if(_0x213adf){if(_0x266e5b[_0x87ed('0x76')][_0x87ed('0xa4')]){_0x266e5b[_0x87ed('0xa5')]['push']({'id':0x0,'priority':_0x266e5b[_0x87ed('0xa5')][_0x87ed('0x4b')]+0x1,'app':_0x87ed('0xa6'),'appdata':_0x87ed('0xa7'),'interval':'*,*,*,*'});}_0x266e5b[_0x87ed('0xa2')][_0x87ed('0xa3')]=!![];}return db[_0x87ed('0xa8')][_0x87ed('0x5e')]({'phone':_0x266e5b['body'][_0x87ed('0x82')],'messageId':_0x266e5b['body'][_0x87ed('0x85')],'body':_0x266e5b[_0x87ed('0x5f')][_0x87ed('0x5f')],'SmsAccountId':_0x5a57b6['params']['id'],'SmsInteractionId':_0x4fdf8f['id'],'direction':'in','ContactId':_0x4fdf8f[_0x87ed('0xa9')],'AttachmentId':_0x266e5b[_0x87ed('0x5f')]['AttachmentId']});})['then'](function(_0x34ab1d){_0x266e5b[_0x87ed('0x28')]=_0x34ab1d;if(_0x266e5b['interaction'][_0x87ed('0xaa')]){return db[_0x87ed('0xab')]['find']({'attributes':['id',_0x87ed('0x3d')],'where':{'id':_0x266e5b[_0x87ed('0xa2')][_0x87ed('0xaa')]}})[_0x87ed('0x39')](function(_0x2e2508){if(_0x2e2508){_0x266e5b['applications'][_0x87ed('0xac')]({'id':0x0,'priority':0x0,'app':_0x87ed('0xad'),'appdata':_0x2e2508['name']+','+(_0x266e5b[_0x87ed('0x76')][_0x87ed('0xae')]||0xa),'interval':_0x87ed('0xaf')});}return respondWithRpcPromise(_0x87ed('0xb0'),_0x87ed('0xb1'),_0x266e5b);});}return respondWithRpcPromise(_0x87ed('0xb0'),'startRouting',_0x266e5b);})['then'](function(_0x29940d){if(_0x29940d){var _0x2f7faf=0xc8;var _0x34a5fc='receiveMessage';logger['info'](_0x87ed('0x24'),_0x34a5fc,_0x2f7faf,_0x87ed('0xb2'));logger['debug'](_0x87ed('0xb3'),_0x34a5fc,_0x2f7faf,_0x87ed('0xb2'),JSON[_0x87ed('0x25')](_0x29940d));if(_0x266e5b[_0x87ed('0x76')][_0x87ed('0x43')]==='twilio'){return _0x5ee127[_0x87ed('0x2c')](_0x2f7faf)[_0x87ed('0x32')](_0x87ed('0xb4'),_0x87ed('0xb5'))[_0x87ed('0x3e')]('\x0a');}else{return _0x5ee127['status'](_0x2f7faf)[_0x87ed('0x2e')](_0x29940d);}}})[_0x87ed('0x2a')](handleError(_0x5ee127,null));};exports[_0x87ed('0xb6')]=function(_0x15b245,_0x58a44d){var _0x32ecec=_0x15b245['params']['id'];var _0x41a8c5=_0x15b245[_0x87ed('0x5f')];var _0xfe2cc6=0xc8;var _0x4d4059=null;return db[_0x87ed('0xb7')]['transaction']({'isolationLevel':db[_0x87ed('0xb7')][_0x87ed('0xb8')][_0x87ed('0xb9')][_0x87ed('0xba')]},function(_0x10256c){return db[_0x87ed('0x58')][_0x87ed('0x71')]({'where':{'id':_0x32ecec},'transaction':_0x10256c})['then'](function(_0x207bc9){if(_0x207bc9){return db[_0x87ed('0xbb')][_0x87ed('0x38')]({'where':{'SmsAccountId':_0x32ecec},'transaction':_0x10256c})[_0x87ed('0x39')](function(){var _0x2225ef=_['map'](_0x41a8c5,function(_0x397213){_0x397213[_0x87ed('0x6b')]=_0x32ecec;return _0x397213;});return db[_0x87ed('0xbb')][_0x87ed('0xbc')](_0x2225ef,{'transaction':_0x10256c});});}else{_0xfe2cc6=0x194;_0x4d4059=[];}});})[_0x87ed('0x39')](function(){if(_0xfe2cc6!==0x194){return db['SmsApplication'][_0x87ed('0xbd')]({'where':{'SmsAccountId':_0x32ecec},'order':_0x87ed('0xbe')})[_0x87ed('0x39')](function(_0x120fc2){_0x4d4059=_0x120fc2;});}})['catch'](function(_0x2a0d26){_0xfe2cc6=0x1f4;logger['error'](_0x2a0d26[_0x87ed('0x3c')]);if(_0x2a0d26[_0x87ed('0x3d')]){delete _0x2a0d26['name'];}_0x4d4059=_0x2a0d26;})[_0x87ed('0xbf')](function(){if(_0x4d4059===null){_0x58a44d[_0x87ed('0x2b')](_0xfe2cc6);}else{if(_0xfe2cc6===0x1f4){_0x58a44d[_0x87ed('0x2c')](_0xfe2cc6)[_0x87ed('0x3e')](_0x4d4059);}else{_0x58a44d[_0x87ed('0x2c')](_0xfe2cc6)[_0x87ed('0x2e')](_0x4d4059);}}});};exports[_0x87ed('0xc0')]=function(_0x1f1cc3,_0x19fb79,_0x546ee3){var _0x76e0f9={};var _0x1c2e1a={};var _0xba9f03;var _0x64b22c;return db['SmsAccount'][_0x87ed('0x71')]({'where':{'id':_0x1f1cc3[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x19fb79,null))[_0x87ed('0x39')](function(_0x3bf877){if(_0x3bf877){_0xba9f03=_0x3bf877;_0x1c2e1a['model']=_[_0x87ed('0x47')](db['SmsApplication'][_0x87ed('0x41')]);_0x1c2e1a['query']=_['keys'](_0x1f1cc3[_0x87ed('0x46')]);_0x1c2e1a['filters']=_[_0x87ed('0x5d')](_0x1c2e1a['model'],_0x1c2e1a[_0x87ed('0x46')]);_0x76e0f9[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x1c2e1a['model'],qs[_0x87ed('0x4a')](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x76e0f9[_0x87ed('0x49')]=_0x76e0f9[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x76e0f9[_0x87ed('0x49')]:_0x1c2e1a[_0x87ed('0x45')];_0x76e0f9[_0x87ed('0x4d')]=qs[_0x87ed('0x4e')](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x4e')]);_0x76e0f9['where']=qs[_0x87ed('0x48')](_['pick'](_0x1f1cc3[_0x87ed('0x46')],_0x1c2e1a[_0x87ed('0x48')]));if(_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x51')]){_0x76e0f9[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x76e0f9[_0x87ed('0x4f')],{'$or':_[_0x87ed('0x40')](_0x76e0f9['attributes'],function(_0x4b6e00){var _0x3971b6={};_0x3971b6[_0x4b6e00]={'$like':'%'+_0x1f1cc3['query'][_0x87ed('0x51')]+'%'};return _0x3971b6;})});}_0x76e0f9=_[_0x87ed('0x52')]({},_0x76e0f9,_0x1f1cc3[_0x87ed('0x54')]);return _0xba9f03[_0x87ed('0xc0')](_0x76e0f9);}})['then'](function(_0x4c5ff4){if(_0x4c5ff4){_0x64b22c=_0x4c5ff4[_0x87ed('0x4b')];if(!_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x4c')](_0x87ed('0x6d'))){_0x76e0f9[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x30')]);_0x76e0f9[_0x87ed('0x2f')]=qs['offset'](_0x1f1cc3[_0x87ed('0x46')][_0x87ed('0x2f')]);}return _0xba9f03[_0x87ed('0xc0')](_0x76e0f9);}})[_0x87ed('0x39')](function(_0x45b3a1){if(_0x45b3a1){return _0x45b3a1?{'count':_0x64b22c,'rows':_0x45b3a1}:null;}})['then'](respondWithResult(_0x19fb79,null))['catch'](handleError(_0x19fb79,null));};exports[_0x87ed('0xc1')]=function(_0x577b02,_0x5122b1,_0x35bd94){var _0x2c7930={'raw':![],'where':{}};var _0x529803={};var _0x3b694f={'count':0x0,'rows':[]};return db[_0x87ed('0x58')][_0x87ed('0x71')]({'where':{'id':_0x577b02['params']['id']}})['then'](handleEntityNotFound(_0x5122b1,null))['then'](function(_0x31fcce){if(_0x31fcce){_0x529803[_0x87ed('0x45')]=_[_0x87ed('0x47')](db['SmsInteraction'][_0x87ed('0x41')]);_0x529803[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x577b02['query']);_0x529803[_0x87ed('0x48')]=_['intersection'](_0x529803[_0x87ed('0x45')],_0x529803[_0x87ed('0x46')]);_0x2c7930[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x529803[_0x87ed('0x45')],qs[_0x87ed('0x4a')](_0x577b02[_0x87ed('0x46')][_0x87ed('0x4a')]));_0x2c7930[_0x87ed('0x49')]=_0x2c7930[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x2c7930[_0x87ed('0x49')]:_0x529803[_0x87ed('0x45')];if(!_0x577b02[_0x87ed('0x46')][_0x87ed('0x4c')](_0x87ed('0x6d'))){_0x2c7930['limit']=qs[_0x87ed('0x30')](_0x577b02[_0x87ed('0x46')]['limit']);_0x2c7930[_0x87ed('0x2f')]=qs[_0x87ed('0x2f')](_0x577b02[_0x87ed('0x46')][_0x87ed('0x2f')]);}_0x2c7930[_0x87ed('0x4d')]=qs['sort'](_0x577b02['query'][_0x87ed('0x4e')]);_0x2c7930['where']=qs[_0x87ed('0x48')](_[_0x87ed('0x50')](_0x577b02[_0x87ed('0x46')],_0x529803[_0x87ed('0x48')]));_0x2c7930[_0x87ed('0x4f')][_0x87ed('0x6b')]=_0x31fcce['id'];if(_0x577b02[_0x87ed('0x46')]['filter']){_0x2c7930[_0x87ed('0x4f')]=_[_0x87ed('0x52')](_0x2c7930[_0x87ed('0x4f')],{'$or':_[_0x87ed('0x40')](_0x2c7930[_0x87ed('0x49')],function(_0x1f164d){var _0x44596e={};_0x44596e[_0x1f164d]={'$like':'%'+_0x577b02[_0x87ed('0x46')][_0x87ed('0x51')]+'%'};return _0x44596e;})});}_0x2c7930=_[_0x87ed('0x52')]({},_0x2c7930,_0x577b02[_0x87ed('0x54')]);return db['SmsInteraction'][_0x87ed('0x55')]({'where':_0x2c7930[_0x87ed('0x4f')]})[_0x87ed('0x39')](function(_0x538f66){_0x3b694f[_0x87ed('0x55')]=_0x538f66;if(_0x577b02[_0x87ed('0x46')]['includeAll']){_0x2c7930[_0x87ed('0x57')]=[{'model':db[_0x87ed('0x79')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x87ed('0xc2'),'attributes':['name',_0x87ed('0xc3'),_0x87ed('0xc4')],'required':![]},{'model':db[_0x87ed('0xc5')],'as':_0x87ed('0xc6'),'attributes':['id',_0x87ed('0x3d'),_0x87ed('0xc7')],'where':_0x577b02[_0x87ed('0x46')]['tag']?{'id':_0x577b02[_0x87ed('0x46')][_0x87ed('0xc8')]}:undefined,'required':_0x577b02[_0x87ed('0x46')][_0x87ed('0xc8')]?!![]:![]}];}return db[_0x87ed('0xa0')]['findAll'](_0x2c7930);})[_0x87ed('0x39')](function(_0x52a454){_0x3b694f['rows']=_0x52a454;return _0x3b694f;});}})[_0x87ed('0x39')](respondWithFilteredResult(_0x5122b1,_0x2c7930))[_0x87ed('0x2a')](handleError(_0x5122b1,null));};exports[_0x87ed('0x3e')]=function(_0x3f09b1,_0x143716,_0x149996){var _0x28005f,_0x36dc0a,_0x3a88ac;if(_[_0x87ed('0x96')](_0x3f09b1['body'][_0x87ed('0x5f')])||_0x3f09b1[_0x87ed('0x5f')]['body']===''){throw new db[(_0x87ed('0x97'))]['ValidationError'](_0x87ed('0x98'));}if(_[_0x87ed('0x96')](_0x3f09b1['body']['to'])){throw new db[(_0x87ed('0x97'))][(_0x87ed('0x7a'))](_0x87ed('0xc9'));}_0x28005f=_0x3f09b1[_0x87ed('0x5f')]['to'];return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x3f09b1[_0x87ed('0x5c')]['id']},'include':[{'model':db[_0x87ed('0xca')],'as':_0x87ed('0xcb'),'include':[{'model':db['CmContact'],'as':_0x87ed('0x9d'),'where':{'mobile':_0x28005f},'limit':0x1,'order':[[_0x87ed('0x7e'),_0x87ed('0x9e')]]}]}]})['then'](handleEntityNotFound(_0x143716,null))[_0x87ed('0x39')](function(_0x24e738){if(_0x24e738&&_0x24e738[_0x87ed('0xcb')]){_0x36dc0a=_0x24e738['get']({'plain':!![]});if(_0x36dc0a[_0x87ed('0xcb')]&&_0x36dc0a[_0x87ed('0xcb')][_0x87ed('0x9d')][_0x87ed('0x4b')]){return _0x36dc0a[_0x87ed('0xcb')][_0x87ed('0x9d')][0x0];}return db[_0x87ed('0x79')]['create'](_[_0x87ed('0x1a')](_0x3f09b1['body'],{'firstName':_0x28005f,'mobile':_0x28005f,'phone':_0x28005f,'ListId':_0x36dc0a['ListId']}));}})[_0x87ed('0x39')](handleEntityNotFound(_0x143716,null))[_0x87ed('0x39')](function(_0x1f66e8){if(_0x1f66e8){_0x3a88ac=_0x1f66e8;return db[_0x87ed('0xa0')][_0x87ed('0x65')]({'where':{'ContactId':_0x3a88ac['id'],'closed':![],'SmsAccountId':_0x36dc0a['id']}})['then'](function(_0x2c8fb4){if(_0x2c8fb4){return[_0x2c8fb4,![]];}return db[_0x87ed('0xa0')][_0x87ed('0x5e')]({'UserId':_0x3f09b1[_0x87ed('0x60')]['id'],'ContactId':_0x3a88ac['id'],'SmsAccountId':_0x36dc0a['id'],'phone':_0x28005f,'firstMsgDirection':_0x87ed('0xcc'),'Messages':[_['merge'](_0x3f09b1[_0x87ed('0x5f')],{'read':![],'body':_0x3f09b1['body'][_0x87ed('0x5f')],'phone':_0x28005f,'SmsAccountId':_0x36dc0a['id'],'UserId':_0x3f09b1[_0x87ed('0x60')]['id'],'ContactId':_0x3a88ac['id']})]},{'include':[{'model':db[_0x87ed('0xa8')],'as':_0x87ed('0xcd')}]})[_0x87ed('0x39')](function(_0x425fad){return[_0x425fad,!![]];});});}})[_0x87ed('0xa1')](function(_0x5a9df0,_0x47db25){if(_0x47db25){return _0x5a9df0;}return db['SmsMessage'][_0x87ed('0x5e')](_[_0x87ed('0x52')](_0x3f09b1[_0x87ed('0x5f')],{'read':![],'body':_0x3f09b1[_0x87ed('0x5f')][_0x87ed('0x5f')],'phone':_0x28005f,'SmsAccountId':_0x36dc0a['id'],'SmsInteractionId':_0x5a9df0['id'],'UserId':_0x3f09b1[_0x87ed('0x60')]['id'],'ContactId':_0x3a88ac['id']}))[_0x87ed('0x39')](function(_0x31f35e){_0x5a9df0['dataValues']['Messages']=[];_0x5a9df0['dataValues'][_0x87ed('0xcd')][_0x87ed('0xce')](_0x31f35e[_0x87ed('0xcf')]);return _0x5a9df0;});})[_0x87ed('0x39')](respondWithResult(_0x143716,null))['catch'](handleError(_0x143716,null));};exports[_0x87ed('0x2c')]=function(_0x140ca2,_0x21f404,_0x320733){if(_0x140ca2[_0x87ed('0x5f')]['id']){delete _0x140ca2[_0x87ed('0x5f')]['id'];}var _0x41c1aa,_0x4f10dd,_0x32699d;return db['SmsAccount'][_0x87ed('0x65')]({'where':{'id':_0x140ca2[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x21f404,null))[_0x87ed('0x39')](function(_0x4720fa){if(_0x4720fa){_0x32699d=_0x4720fa;logger[_0x87ed('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87ed('0x2c'),'received\x20delivery\x20report\x20from',_0x4720fa[_0x87ed('0x43')],util['inspect'](_0x140ca2['body'],{'showHidden':![],'depth':null}));switch(_0x4720fa[_0x87ed('0x43')]){case'skebby':if(_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd0')]&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x2c')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x2c')];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2['body'][_0x87ed('0xd0')]}});}break;case'connectel':if(_0x140ca2['body'][_0x87ed('0xd1')]&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd2')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')]['statusInt'];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd1')]}});}break;case _0x87ed('0x89'):if(_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x8a')]&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd3')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd3')];return db[_0x87ed('0xa8')]['find']({'where':{'messageId':_0x140ca2['body']['message_id']}});}break;case _0x87ed('0xd4'):var _0x5e66fd=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x8d')][0x0];if(_0x5e66fd[_0x87ed('0x85')]&&_0x5e66fd[_0x87ed('0x2c')][_0x87ed('0xd5')]===_0x87ed('0xd6')){_0x4f10dd=_0x5e66fd['status'][_0x87ed('0xd5')];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x5e66fd[_0x87ed('0x85')]}});}break;case _0x87ed('0x91'):if(_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x85')]&&_0x140ca2['body'][_0x87ed('0x2c')]){_0x4f10dd=_0x140ca2['body'][_0x87ed('0x2c')];return db[_0x87ed('0xa8')]['find']({'where':{'messageId':_0x140ca2['body']['messageId']}});}break;case _0x87ed('0x94'):if(_0x140ca2['body'][0x0][_0x87ed('0x28')]['id']){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')][0x0]['type'];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2[_0x87ed('0x5f')][0x0]['message']['id']}});}break;case _0x87ed('0xd7'):if(_0x140ca2[_0x87ed('0x5f')]['redif']&&_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x2c')]){_0x4f10dd=_0x140ca2[_0x87ed('0x5f')]['status'];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x140ca2[_0x87ed('0x5f')][_0x87ed('0xd8')]}});}break;}}})[_0x87ed('0x39')](handleEntityNotFound(_0x21f404,null))[_0x87ed('0x39')](function(_0x40d26d){if(_0x40d26d){_0x41c1aa=_0x40d26d;switch(_0x32699d[_0x87ed('0x43')]){case'skebby':if(_0x4f10dd===_0x87ed('0xd6')){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87ed('0x2c'),_0x87ed('0x86'),util['inspect'](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x88'):if(_0x4f10dd==='1'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0x86'),util[_0x87ed('0xd9')](_0x140ca2['body'],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x89'):if(!_0x140ca2[_0x87ed('0x5f')]['error_code']&&_0x4f10dd>=0xc8&&_0x4f10dd<=0xce){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),'status','clicksend',util['inspect'](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0xd4'):var _0x1f1b4c=_0x140ca2[_0x87ed('0x5f')][_0x87ed('0x8d')][0x0];if(_0x1f1b4c['status'][_0x87ed('0xd5')]===_0x87ed('0xd6')){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger['error'](_0x87ed('0x24'),'status',_0x87ed('0xd4'),util[_0x87ed('0xd9')](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x91'):if(_0x4f10dd==_0x87ed('0xda')||_0x4f10dd=='RECEIVED_BY_RECIPIENT'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0x91'),util[_0x87ed('0xd9')](_0x140ca2['body'],{'showHidden':![],'depth':null}));}break;case _0x87ed('0x94'):if(_0x4f10dd=='message-delivered'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0x94'),util[_0x87ed('0xd9')](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x87ed('0xd7'):if(_0x4f10dd===_0x87ed('0xdb')||_0x4f10dd==='ACCEPTD'){return _0x41c1aa[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')](_0x87ed('0x24'),_0x87ed('0x2c'),_0x87ed('0xd7'),util['inspect'](_0x140ca2[_0x87ed('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x41c1aa;}})['then'](respondWithResult(_0x21f404,null))[_0x87ed('0x2a')](handleError(_0x21f404,null));};exports['statusGet']=function(_0x416723,_0xa5b2a3,_0x4366a8){var _0x3053ff,_0x514bfe,_0x56ae88;return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x416723[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0xa5b2a3,null))['then'](function(_0x3ede1f){if(_0x3ede1f){_0x56ae88=_0x3ede1f;logger['debug'](_0x87ed('0x24'),_0x87ed('0x2c'),'received\x20delivery\x20report\x20from',_0x3ede1f[_0x87ed('0x43')],util[_0x87ed('0xd9')](_0x416723['query'],{'showHidden':![],'depth':null}));switch(_0x3ede1f[_0x87ed('0x43')]){case _0x87ed('0x8e'):if(_0x416723[_0x87ed('0x46')][_0x87ed('0xdc')]&&_0x416723[_0x87ed('0x46')]['state']){_0x514bfe=_0x416723[_0x87ed('0x46')][_0x87ed('0xdd')];return db[_0x87ed('0xa8')][_0x87ed('0x65')]({'where':{'messageId':_0x416723[_0x87ed('0x46')][_0x87ed('0xdc')]}});}break;}}})[_0x87ed('0x39')](handleEntityNotFound(_0xa5b2a3,null))[_0x87ed('0x39')](function(_0x890209){if(_0x890209){_0x3053ff=_0x890209;switch(_0x56ae88[_0x87ed('0x43')]){case'csc':if(_0x514bfe==='2'||_0x514bfe==='6'){return _0x3053ff[_0x87ed('0x37')]({'read':!![]});}else{logger[_0x87ed('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87ed('0x2c'),_0x87ed('0x8e'),util[_0x87ed('0xd9')](_0x416723[_0x87ed('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x3053ff;}})[_0x87ed('0x39')](respondWithResult(_0xa5b2a3,null))['catch'](handleError(_0xa5b2a3,null));};exports[_0x87ed('0xde')]=function(_0x114d75,_0x5e8471,_0x41ad47){return db[_0x87ed('0x58')][_0x87ed('0x65')]({'where':{'id':_0x114d75['params']['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x5e8471,null))[_0x87ed('0x39')](function(_0x1ce420){if(_0x1ce420){return _0x1ce420[_0x87ed('0xde')](_0x114d75[_0x87ed('0x5f')][_0x87ed('0xdf')],_['omit'](_0x114d75['body'],['ids','id'])||{})[_0x87ed('0xa1')](function(_0x51833c){for(var _0x2a46d1=0x0;_0x2a46d1<_0x114d75[_0x87ed('0x5f')][_0x87ed('0xdf')][_0x87ed('0x4b')];_0x2a46d1+=0x1){socket[_0x87ed('0xe0')](_0x87ed('0xe1'),{'UserId':Number(_0x114d75[_0x87ed('0x5f')][_0x87ed('0xdf')][_0x2a46d1]),'SmsAccountId':Number(_0x114d75[_0x87ed('0x5c')]['id'])});}return _0x51833c;});}})[_0x87ed('0x39')](respondWithResult(_0x5e8471,null))[_0x87ed('0x2a')](handleError(_0x5e8471,null));};exports['removeAgents']=function(_0x54e421,_0x19a938,_0x42e12e){return db['SmsAccount']['find']({'where':{'id':_0x54e421[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x19a938,null))['then'](function(_0x5d6b54){if(_0x5d6b54){return _0x5d6b54[_0x87ed('0xe2')](_0x54e421['query'][_0x87ed('0xdf')])['then'](function(){if(_['isArray'](_0x54e421['query']['ids'])){for(var _0xa6b98c=0x0;_0xa6b98c<_0x54e421[_0x87ed('0x46')]['ids'][_0x87ed('0x4b')];_0xa6b98c+=0x1){socket[_0x87ed('0xe0')](_0x87ed('0xe3'),{'UserId':Number(_0x54e421[_0x87ed('0x46')][_0x87ed('0xdf')][_0xa6b98c]),'SmsAccountId':Number(_0x54e421[_0x87ed('0x5c')]['id'])});}}else{socket[_0x87ed('0xe0')](_0x87ed('0xe3'),{'UserId':Number(_0x54e421[_0x87ed('0x46')]['ids']),'SmsAccountId':Number(_0x54e421[_0x87ed('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x19a938,null))['catch'](handleError(_0x19a938,null));};exports[_0x87ed('0xe4')]=function(_0x5171aa,_0x5541db,_0x1ca9af){var _0x43e30d={};var _0x586ae9={};var _0x1fb29f;var _0x32d20d;return db[_0x87ed('0x58')][_0x87ed('0x71')]({'where':{'id':_0x5171aa[_0x87ed('0x5c')]['id']}})[_0x87ed('0x39')](handleEntityNotFound(_0x5541db,null))[_0x87ed('0x39')](function(_0x313ef7){if(_0x313ef7){_0x1fb29f=_0x313ef7;_0x586ae9[_0x87ed('0x45')]=_[_0x87ed('0x47')](db[_0x87ed('0xab')][_0x87ed('0x41')]);_0x586ae9[_0x87ed('0x46')]=_[_0x87ed('0x47')](_0x5171aa[_0x87ed('0x46')]);_0x586ae9['filters']=_['intersection'](_0x586ae9[_0x87ed('0x45')],_0x586ae9['query']);_0x43e30d[_0x87ed('0x49')]=_[_0x87ed('0x5d')](_0x586ae9[_0x87ed('0x45')],qs[_0x87ed('0x4a')](_0x5171aa['query']['fields']));_0x43e30d[_0x87ed('0x49')]=_0x43e30d[_0x87ed('0x49')][_0x87ed('0x4b')]?_0x43e30d[_0x87ed('0x49')]:_0x586ae9[_0x87ed('0x45')];_0x43e30d['order']=qs[_0x87ed('0x4e')](_0x5171aa['query']['sort']);_0x43e30d[_0x87ed('0x4f')]=qs['filters'](_[_0x87ed('0x50')](_0x5171aa['query'],_0x586ae9[_0x87ed('0x48')]));if(_0x5171aa[_0x87ed('0x46')][_0x87ed('0x51')]){_0x43e30d['where']=_[_0x87ed('0x52')](_0x43e30d[_0x87ed('0x4f')],{'$or':_['map'](_0x43e30d[_0x87ed('0x49')],function(_0x251914){var _0x1fb163={};_0x1fb163[_0x251914]={'$like':'%'+_0x5171aa['query']['filter']+'%'};return _0x1fb163;})});}_0x43e30d=_[_0x87ed('0x52')]({},_0x43e30d,_0x5171aa[_0x87ed('0x54')]);return _0x1fb29f[_0x87ed('0xe4')](_0x43e30d);}})['then'](function(_0xa0022b){if(_0xa0022b){_0x32d20d=_0xa0022b[_0x87ed('0x4b')];if(!_0x5171aa[_0x87ed('0x46')]['hasOwnProperty']('nolimit')){_0x43e30d[_0x87ed('0x30')]=qs[_0x87ed('0x30')](_0x5171aa[_0x87ed('0x46')]['limit']);_0x43e30d[_0x87ed('0x2f')]=qs[_0x87ed('0x2f')](_0x5171aa[_0x87ed('0x46')][_0x87ed('0x2f')]);}return _0x1fb29f[_0x87ed('0xe4')](_0x43e30d);}})[_0x87ed('0x39')](function(_0x2e0b0d){if(_0x2e0b0d){return _0x2e0b0d?{'count':_0x32d20d,'rows':_0x2e0b0d}:null;}})[_0x87ed('0x39')](respondWithResult(_0x5541db,null))[_0x87ed('0x2a')](handleError(_0x5541db,null));}; \ No newline at end of file +var _0x4dbc=['catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SmsAccount','includeAll','findAll','rows','Pause','attributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','From','Body','MessageSid','skebby','sender','text','clicksend','Text','messageId','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','SmsMessage','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','message_id','status_code','groupName','bandwidth','redif','DELIVERED','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x368e31,_0x17280a){var _0xe762a4=function(_0x5ea1f2){while(--_0x5ea1f2){_0x368e31['push'](_0x368e31['shift']());}};_0xe762a4(++_0x17280a);}(_0x4dbc,0x1a7));var _0xc4db=function(_0x58d528,_0xadd2c4){_0x58d528=_0x58d528-0x0;var _0xf6b6c5=_0x4dbc[_0x58d528];return _0xf6b6c5;};'use strict';var emlformat=require(_0xc4db('0x0'));var rimraf=require(_0xc4db('0x1'));var zipdir=require(_0xc4db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4db('0x3'));var moment=require(_0xc4db('0x4'));var BPromise=require(_0xc4db('0x5'));var Mustache=require(_0xc4db('0x6'));var util=require(_0xc4db('0x7'));var path=require(_0xc4db('0x8'));var sox=require(_0xc4db('0x9'));var csv=require(_0xc4db('0xa'));var ejs=require(_0xc4db('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc4db('0xc'));var crypto=require(_0xc4db('0xd'));var jsforce=require(_0xc4db('0xe'));var deskjs=require(_0xc4db('0xf'));var toCsv=require(_0xc4db('0xa'));var querystring=require(_0xc4db('0x10'));var Papa=require(_0xc4db('0x11'));var Redis=require(_0xc4db('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc4db('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4db('0x14'));var logger=require('../../config/logger')(_0xc4db('0x15'));var utils=require(_0xc4db('0x16'));var config=require(_0xc4db('0x17'));var licenseUtil=require(_0xc4db('0x18'));var db=require(_0xc4db('0x19'))['db'];config['redis']=_[_0xc4db('0x1a')](config[_0xc4db('0x1b')],{'host':_0xc4db('0x1c'),'port':0x18eb});var socket=require(_0xc4db('0x1d'))(new Redis(config[_0xc4db('0x1b')]));require(_0xc4db('0x1e'))[_0xc4db('0x1f')](socket);var jayson=require(_0xc4db('0x20'));var client=jayson[_0xc4db('0x21')][_0xc4db('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x343b27,_0x3b3e73,_0x429b18,_0x1b561a){return new BPromise(function(_0x323882,_0x1def5c){var _0x1b61f9=_0x1b561a||client;return _0x1b61f9[_0xc4db('0x23')](_0x343b27,_0x429b18)['then'](function(_0x1ee968){logger[_0xc4db('0x24')](_0xc4db('0x25'),_0x3b3e73,'request\x20sent');logger['debug'](_0xc4db('0x26'),_0x3b3e73,_0xc4db('0x27'),JSON[_0xc4db('0x28')](_0x1ee968));if(_0x1ee968[_0xc4db('0x29')]){if(_0x1ee968[_0xc4db('0x29')][_0xc4db('0x2a')]===0x1f4){logger['error'](_0xc4db('0x25'),_0x3b3e73,_0x1ee968[_0xc4db('0x29')][_0xc4db('0x2b')]);return _0x1def5c(_0x1ee968['error'][_0xc4db('0x2b')]);}logger[_0xc4db('0x29')](_0xc4db('0x25'),_0x3b3e73,_0x1ee968[_0xc4db('0x29')][_0xc4db('0x2b')]);return _0x323882(_0x1ee968[_0xc4db('0x29')][_0xc4db('0x2b')]);}else{logger[_0xc4db('0x24')](_0xc4db('0x25'),_0x3b3e73,_0xc4db('0x27'));_0x323882(_0x1ee968[_0xc4db('0x2c')][_0xc4db('0x2b')]);}})[_0xc4db('0x2d')](function(_0x42d4f8){logger['error'](_0xc4db('0x25'),_0x3b3e73,_0x42d4f8);_0x1def5c(_0x42d4f8);});});}function respondWithStatusCode(_0xda21ca,_0x32b6a9){_0x32b6a9=_0x32b6a9||0xcc;return function(_0x5c64b1){if(_0x5c64b1){return _0xda21ca[_0xc4db('0x2e')](_0x32b6a9);}return _0xda21ca[_0xc4db('0x2f')](_0x32b6a9)[_0xc4db('0x30')]();};}function respondWithResult(_0x36f6e4,_0x4ab9ce){_0x4ab9ce=_0x4ab9ce||0xc8;return function(_0x27b215){if(_0x27b215){return _0x36f6e4[_0xc4db('0x2f')](_0x4ab9ce)[_0xc4db('0x31')](_0x27b215);}};}function respondWithFilteredResult(_0x2883e0,_0x271936){return function(_0x11cb96){if(_0x11cb96){var _0x5688c8=typeof _0x271936['offset']===_0xc4db('0x32')&&typeof _0x271936[_0xc4db('0x33')]===_0xc4db('0x32');var _0x114cc6=_0x11cb96[_0xc4db('0x34')];var _0x5108ae=_0x5688c8?0x0:_0x271936[_0xc4db('0x35')];var _0x44292f=_0x5688c8?_0x11cb96[_0xc4db('0x34')]:_0x271936[_0xc4db('0x35')]+_0x271936[_0xc4db('0x33')];var _0x59e936;if(_0x44292f>=_0x114cc6){_0x44292f=_0x114cc6;_0x59e936=0xc8;}else{_0x59e936=0xce;}_0x2883e0[_0xc4db('0x2f')](_0x59e936);return _0x2883e0[_0xc4db('0x36')](_0xc4db('0x37'),_0x5108ae+'-'+_0x44292f+'/'+_0x114cc6)['json'](_0x11cb96);}return null;};}function patchUpdates(_0x30d093){return function(_0x23f2f1){try{jsonpatch[_0xc4db('0x38')](_0x23f2f1,_0x30d093,!![]);}catch(_0xeec3fe){return BPromise['reject'](_0xeec3fe);}return _0x23f2f1[_0xc4db('0x39')]();};}function saveUpdates(_0x2e958d,_0x51e9aa){return function(_0x3b8153){if(_0x3b8153){return _0x3b8153['update'](_0x2e958d)[_0xc4db('0x3a')](function(_0x33869c){return _0x33869c;});}return null;};}function removeEntity(_0x4d56a0,_0x255400){return function(_0x976527){if(_0x976527){return _0x976527[_0xc4db('0x3b')]()[_0xc4db('0x3a')](function(){var _0x486ad0=_0x976527[_0xc4db('0x3c')]({'plain':!![]});var _0x354c10=_0xc4db('0x3d');return db[_0xc4db('0x3e')]['destroy']({'where':{'type':_0x354c10,'resourceId':_0x486ad0['id']}})[_0xc4db('0x3a')](function(){return _0x976527;});})[_0xc4db('0x3a')](function(){_0x4d56a0[_0xc4db('0x2f')](0xcc)[_0xc4db('0x30')]();});}};}function handleEntityNotFound(_0x599974,_0x49f532){return function(_0x37d5fb){if(!_0x37d5fb){_0x599974[_0xc4db('0x2e')](0x194);}return _0x37d5fb;};}function handleError(_0x2d2c60,_0x512ad9){_0x512ad9=_0x512ad9||0x1f4;return function(_0x504f6e){logger[_0xc4db('0x29')](_0x504f6e[_0xc4db('0x3f')]);if(_0x504f6e['name']){delete _0x504f6e[_0xc4db('0x40')];}_0x2d2c60[_0xc4db('0x2f')](_0x512ad9)[_0xc4db('0x41')](_0x504f6e);};}exports['index']=function(_0x1ff510,_0xad12eb){var _0x5d6e4a={'include':[{'model':db['Pause'],'as':_0xc4db('0x42')}]},_0x2e95b4={},_0x585326={'count':0x0,'rows':[]};var _0x5b31d6=_['map'](db['SmsAccount'][_0xc4db('0x43')],function(_0x253e84){return{'name':_0x253e84[_0xc4db('0x44')],'type':_0x253e84['type']['key']};});_0x2e95b4[_0xc4db('0x45')]=_[_0xc4db('0x46')](_0x5b31d6,'name');_0x2e95b4[_0xc4db('0x47')]=_[_0xc4db('0x48')](_0x1ff510[_0xc4db('0x47')]);_0x2e95b4[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x2e95b4[_0xc4db('0x45')],_0x2e95b4[_0xc4db('0x47')]);_0x5d6e4a['attributes']=_['intersection'](_0x2e95b4[_0xc4db('0x45')],qs[_0xc4db('0x4b')](_0x1ff510[_0xc4db('0x47')][_0xc4db('0x4b')]));_0x5d6e4a['attributes']=_0x5d6e4a['attributes'][_0xc4db('0x4c')]?_0x5d6e4a['attributes']:_0x2e95b4[_0xc4db('0x45')];if(!_0x1ff510[_0xc4db('0x47')][_0xc4db('0x4d')](_0xc4db('0x4e'))){_0x5d6e4a[_0xc4db('0x33')]=qs['limit'](_0x1ff510[_0xc4db('0x47')]['limit']);_0x5d6e4a[_0xc4db('0x35')]=qs['offset'](_0x1ff510[_0xc4db('0x47')]['offset']);}_0x5d6e4a[_0xc4db('0x4f')]=qs[_0xc4db('0x50')](_0x1ff510[_0xc4db('0x47')][_0xc4db('0x50')]);_0x5d6e4a[_0xc4db('0x51')]=qs[_0xc4db('0x49')](_[_0xc4db('0x52')](_0x1ff510[_0xc4db('0x47')],_0x2e95b4[_0xc4db('0x49')]),_0x5b31d6);if(_0x1ff510[_0xc4db('0x47')]['filter']){_0x5d6e4a[_0xc4db('0x51')]=_[_0xc4db('0x53')](_0x5d6e4a[_0xc4db('0x51')],{'$or':_[_0xc4db('0x46')](_0x5b31d6,function(_0x2592f2){if(_0x2592f2[_0xc4db('0x54')]!==_0xc4db('0x55')){var _0x31ae42={};_0x31ae42[_0x2592f2[_0xc4db('0x40')]]={'$like':'%'+_0x1ff510[_0xc4db('0x47')][_0xc4db('0x56')]+'%'};return _0x31ae42;}})});}_0x5d6e4a=_[_0xc4db('0x53')]({},_0x5d6e4a,_0x1ff510[_0xc4db('0x57')]);var _0x3b9df6={'where':_0x5d6e4a['where']};return db[_0xc4db('0x58')][_0xc4db('0x34')](_0x3b9df6)['then'](function(_0x4a921e){_0x585326[_0xc4db('0x34')]=_0x4a921e;if(_0x1ff510[_0xc4db('0x47')][_0xc4db('0x59')]){_0x5d6e4a['include']=[{'all':!![]}];}return db[_0xc4db('0x58')][_0xc4db('0x5a')](_0x5d6e4a);})[_0xc4db('0x3a')](function(_0x2ebe48){_0x585326[_0xc4db('0x5b')]=_0x2ebe48;return _0x585326;})[_0xc4db('0x3a')](respondWithFilteredResult(_0xad12eb,_0x5d6e4a))[_0xc4db('0x2d')](handleError(_0xad12eb,null));};exports['show']=function(_0x5c48f0,_0x312d82){var _0x42f149={'raw':![],'where':{'id':_0x5c48f0['params']['id']},'include':[{'model':db[_0xc4db('0x5c')],'as':_0xc4db('0x42')}]},_0x2f9bb0={};_0x2f9bb0['model']=_[_0xc4db('0x48')](db[_0xc4db('0x58')][_0xc4db('0x43')]);_0x2f9bb0['query']=_['keys'](_0x5c48f0[_0xc4db('0x47')]);_0x2f9bb0[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x2f9bb0['model'],_0x2f9bb0[_0xc4db('0x47')]);_0x42f149[_0xc4db('0x5d')]=_[_0xc4db('0x4a')](_0x2f9bb0[_0xc4db('0x45')],qs['fields'](_0x5c48f0['query'][_0xc4db('0x4b')]));_0x42f149['attributes']=_0x42f149[_0xc4db('0x5d')][_0xc4db('0x4c')]?_0x42f149[_0xc4db('0x5d')]:_0x2f9bb0[_0xc4db('0x45')];if(_0x5c48f0[_0xc4db('0x47')][_0xc4db('0x59')]){_0x42f149[_0xc4db('0x5e')]=[{'all':!![]}];}_0x42f149=_[_0xc4db('0x53')]({},_0x42f149,_0x5c48f0['options']);return db[_0xc4db('0x58')][_0xc4db('0x5f')](_0x42f149)[_0xc4db('0x3a')](handleEntityNotFound(_0x312d82,null))['then'](respondWithResult(_0x312d82,null))['catch'](handleError(_0x312d82,null));};exports[_0xc4db('0x60')]=function(_0x4d3f27,_0x2508b8){return db['SmsAccount'][_0xc4db('0x60')](_0x4d3f27[_0xc4db('0x61')],{})[_0xc4db('0x3a')](function(_0x300ca6){var _0x2d308b=_0x4d3f27['user']['get']({'plain':!![]});if(!_0x2d308b)throw new Error(_0xc4db('0x62'));if(_0x2d308b[_0xc4db('0x63')]===_0xc4db('0x64')){var _0x56ca6b=_0x300ca6['get']({'plain':!![]});var _0x1c132b=_0xc4db('0x3d');return db['UserProfileSection']['find']({'where':{'name':_0x1c132b,'userProfileId':_0x2d308b[_0xc4db('0x65')]},'raw':!![]})[_0xc4db('0x3a')](function(_0x5d0ae0){if(_0x5d0ae0&&_0x5d0ae0[_0xc4db('0x66')]===0x0){return db[_0xc4db('0x3e')][_0xc4db('0x60')]({'name':_0x56ca6b[_0xc4db('0x40')],'resourceId':_0x56ca6b['id'],'type':_0x5d0ae0[_0xc4db('0x40')],'sectionId':_0x5d0ae0['id']},{})['then'](function(){return _0x300ca6;});}else{return _0x300ca6;}})['catch'](function(_0x5f3ea9){logger[_0xc4db('0x29')](_0xc4db('0x67'),_0x5f3ea9);throw _0x5f3ea9;});}return _0x300ca6;})['then'](respondWithResult(_0x2508b8,0xc9))[_0xc4db('0x2d')](handleError(_0x2508b8,null));};exports[_0xc4db('0x68')]=function(_0x75d5f0,_0x3bced9){if(_0x75d5f0[_0xc4db('0x61')]['id']){delete _0x75d5f0['body']['id'];}return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x75d5f0[_0xc4db('0x69')]['id']},'include':[{'model':db[_0xc4db('0x5c')],'as':_0xc4db('0x42')}]})['then'](handleEntityNotFound(_0x3bced9,null))['then'](saveUpdates(_0x75d5f0[_0xc4db('0x61')],null))[_0xc4db('0x3a')](respondWithResult(_0x3bced9,null))['catch'](handleError(_0x3bced9,null));};exports[_0xc4db('0x3b')]=function(_0x4c639d,_0x5bb965){return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x4c639d[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x5bb965,null))[_0xc4db('0x3a')](removeEntity(_0x5bb965,null))[_0xc4db('0x2d')](handleError(_0x5bb965,null));};exports[_0xc4db('0x6a')]=function(_0x95f683,_0x297c1d){return db[_0xc4db('0x58')][_0xc4db('0x6a')]()['then'](respondWithResult(_0x297c1d,null))[_0xc4db('0x2d')](handleError(_0x297c1d,null));};exports['addDisposition']=function(_0x173822,_0xdd3e1e,_0x162ef4){if(_0x173822[_0xc4db('0x61')]['id']){delete _0x173822['body']['id'];}return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x173822[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0xdd3e1e,null))[_0xc4db('0x3a')](function(_0x5a6380){if(_0x5a6380){_0x173822[_0xc4db('0x61')][_0xc4db('0x6b')]=_0x5a6380['id'];return db[_0xc4db('0x6c')]['create'](_0x173822[_0xc4db('0x61')]);}})[_0xc4db('0x3a')](respondWithResult(_0xdd3e1e,null))[_0xc4db('0x2d')](handleError(_0xdd3e1e,null));};exports[_0xc4db('0x6d')]=function(_0x1636dc,_0x38e0ea,_0x43cbf9){var _0x324683={'raw':![],'where':{}};var _0x11d2f9={};var _0x42be7c={'count':0x0,'rows':[]};return db[_0xc4db('0x58')][_0xc4db('0x6e')]({'where':{'id':_0x1636dc[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x38e0ea,null))['then'](function(_0xa52679){if(_0xa52679){_0x11d2f9['model']=_[_0xc4db('0x48')](db['Disposition'][_0xc4db('0x43')]);_0x11d2f9['query']=_['keys'](_0x1636dc[_0xc4db('0x47')]);_0x11d2f9[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x11d2f9['model'],_0x11d2f9['query']);_0x324683['attributes']=_[_0xc4db('0x4a')](_0x11d2f9[_0xc4db('0x45')],qs[_0xc4db('0x4b')](_0x1636dc['query'][_0xc4db('0x4b')]));_0x324683['attributes']=_0x324683[_0xc4db('0x5d')]['length']?_0x324683[_0xc4db('0x5d')]:_0x11d2f9[_0xc4db('0x45')];if(!_0x1636dc[_0xc4db('0x47')]['hasOwnProperty'](_0xc4db('0x4e'))){_0x324683['limit']=qs[_0xc4db('0x33')](_0x1636dc[_0xc4db('0x47')]['limit']);_0x324683[_0xc4db('0x35')]=qs[_0xc4db('0x35')](_0x1636dc[_0xc4db('0x47')][_0xc4db('0x35')]);}_0x324683[_0xc4db('0x4f')]=qs[_0xc4db('0x50')](_0x1636dc[_0xc4db('0x47')][_0xc4db('0x50')]);_0x324683[_0xc4db('0x51')]=qs[_0xc4db('0x49')](_['pick'](_0x1636dc[_0xc4db('0x47')],_0x11d2f9[_0xc4db('0x49')]));_0x324683[_0xc4db('0x51')]['SmsAccountId']=_0xa52679['id'];if(_0x1636dc[_0xc4db('0x47')][_0xc4db('0x56')]){_0x324683['where']=_['merge'](_0x324683['where'],{'$or':_[_0xc4db('0x46')](_0x324683['attributes'],function(_0x1710b5){var _0x5cb02a={};_0x5cb02a[_0x1710b5]={'$like':'%'+_0x1636dc[_0xc4db('0x47')]['filter']+'%'};return _0x5cb02a;})});}_0x324683=_[_0xc4db('0x53')]({},_0x324683,_0x1636dc[_0xc4db('0x57')]);return db[_0xc4db('0x6c')][_0xc4db('0x34')]({'where':_0x324683[_0xc4db('0x51')]})['then'](function(_0x273acc){_0x42be7c['count']=_0x273acc;if(_0x1636dc[_0xc4db('0x47')]['includeAll']){_0x324683['include']=[{'all':!![]}];}return db[_0xc4db('0x6c')][_0xc4db('0x5a')](_0x324683);})['then'](function(_0x43501e){_0x42be7c[_0xc4db('0x5b')]=_0x43501e;return _0x42be7c;});}})[_0xc4db('0x3a')](respondWithFilteredResult(_0x38e0ea,_0x324683))['catch'](handleError(_0x38e0ea,null));};exports[_0xc4db('0x6f')]=function(_0x1f6cb7,_0x555252,_0x367680){return db[_0xc4db('0x58')]['find']({'where':{'id':_0x1f6cb7[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x555252,null))[_0xc4db('0x3a')](function(_0x4f28c7){if(_0x4f28c7){return _0x4f28c7[_0xc4db('0x6f')](_0x1f6cb7[_0xc4db('0x47')][_0xc4db('0x70')]);}})['then'](respondWithStatusCode(_0x555252,null))['catch'](handleError(_0x555252,null));};exports['addAnswer']=function(_0x236a41,_0x5425ee,_0x383332){if(_0x236a41[_0xc4db('0x61')]['id']){delete _0x236a41[_0xc4db('0x61')]['id'];}return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x236a41[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x5425ee,null))['then'](function(_0xfb1979){if(_0xfb1979){_0x236a41[_0xc4db('0x61')][_0xc4db('0x6b')]=_0xfb1979['id'];return db[_0xc4db('0x71')]['create'](_0x236a41[_0xc4db('0x61')]);}})['then'](respondWithResult(_0x5425ee,null))[_0xc4db('0x2d')](handleError(_0x5425ee,null));};exports[_0xc4db('0x72')]=function(_0x39b0a0,_0x2380c3,_0x34ed4b){var _0x3e63c3={'raw':![],'where':{}};var _0x5335ad={};var _0x25f6fa={'count':0x0,'rows':[]};return db[_0xc4db('0x58')][_0xc4db('0x6e')]({'where':{'id':_0x39b0a0[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x2380c3,null))[_0xc4db('0x3a')](function(_0x5e8755){if(_0x5e8755){_0x5335ad[_0xc4db('0x45')]=_['keys'](db[_0xc4db('0x71')][_0xc4db('0x43')]);_0x5335ad[_0xc4db('0x47')]=_[_0xc4db('0x48')](_0x39b0a0[_0xc4db('0x47')]);_0x5335ad[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x5335ad[_0xc4db('0x45')],_0x5335ad[_0xc4db('0x47')]);_0x3e63c3[_0xc4db('0x5d')]=_[_0xc4db('0x4a')](_0x5335ad[_0xc4db('0x45')],qs[_0xc4db('0x4b')](_0x39b0a0['query'][_0xc4db('0x4b')]));_0x3e63c3[_0xc4db('0x5d')]=_0x3e63c3['attributes'][_0xc4db('0x4c')]?_0x3e63c3[_0xc4db('0x5d')]:_0x5335ad['model'];if(!_0x39b0a0[_0xc4db('0x47')][_0xc4db('0x4d')](_0xc4db('0x4e'))){_0x3e63c3[_0xc4db('0x33')]=qs[_0xc4db('0x33')](_0x39b0a0[_0xc4db('0x47')][_0xc4db('0x33')]);_0x3e63c3[_0xc4db('0x35')]=qs[_0xc4db('0x35')](_0x39b0a0[_0xc4db('0x47')][_0xc4db('0x35')]);}_0x3e63c3[_0xc4db('0x4f')]=qs[_0xc4db('0x50')](_0x39b0a0[_0xc4db('0x47')][_0xc4db('0x50')]);_0x3e63c3[_0xc4db('0x51')]=qs[_0xc4db('0x49')](_['pick'](_0x39b0a0[_0xc4db('0x47')],_0x5335ad[_0xc4db('0x49')]));_0x3e63c3[_0xc4db('0x51')]['SmsAccountId']=_0x5e8755['id'];if(_0x39b0a0['query']['filter']){_0x3e63c3[_0xc4db('0x51')]=_[_0xc4db('0x53')](_0x3e63c3['where'],{'$or':_['map'](_0x3e63c3['attributes'],function(_0x4d2de1){var _0x1af530={};_0x1af530[_0x4d2de1]={'$like':'%'+_0x39b0a0[_0xc4db('0x47')][_0xc4db('0x56')]+'%'};return _0x1af530;})});}_0x3e63c3=_['merge']({},_0x3e63c3,_0x39b0a0[_0xc4db('0x57')]);return db[_0xc4db('0x71')][_0xc4db('0x34')]({'where':_0x3e63c3[_0xc4db('0x51')]})[_0xc4db('0x3a')](function(_0x3d6d8b){_0x25f6fa[_0xc4db('0x34')]=_0x3d6d8b;if(_0x39b0a0[_0xc4db('0x47')][_0xc4db('0x59')]){_0x3e63c3['include']=[{'all':!![]}];}return db[_0xc4db('0x71')]['findAll'](_0x3e63c3);})['then'](function(_0x3018f2){_0x25f6fa[_0xc4db('0x5b')]=_0x3018f2;return _0x25f6fa;});}})[_0xc4db('0x3a')](respondWithFilteredResult(_0x2380c3,_0x3e63c3))[_0xc4db('0x2d')](handleError(_0x2380c3,null));};exports[_0xc4db('0x73')]=function(_0x596cac,_0x178ec8,_0x454b14){return db['SmsAccount'][_0xc4db('0x5f')]({'where':{'id':_0x596cac['params']['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x178ec8,null))[_0xc4db('0x3a')](function(_0x4d09e9){if(_0x4d09e9){return _0x4d09e9[_0xc4db('0x73')](_0x596cac[_0xc4db('0x47')][_0xc4db('0x70')]);}})[_0xc4db('0x3a')](respondWithStatusCode(_0x178ec8,null))['catch'](handleError(_0x178ec8,null));};exports[_0xc4db('0x74')]=function(_0x4a50e9,_0x302c20,_0x11a2c4){var _0x19fc18={'channel':_0xc4db('0x75')};var _0x8a30f2=[];var _0x322117=[];var _0x3e3fbc={};return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x4a50e9[_0xc4db('0x69')]['id']},'include':[{'model':db[_0xc4db('0x76')],'as':_0xc4db('0x77')}]})[_0xc4db('0x3a')](handleEntityNotFound(_0x302c20,null))[_0xc4db('0x3a')](function(_0x5d8095){_0x19fc18[_0xc4db('0x78')]=_0x5d8095;_0x19fc18[_0xc4db('0x79')]=_[_0xc4db('0x7a')](_0x5d8095[_0xc4db('0x77')],[_0xc4db('0x7b')],['asc']);if(_0x19fc18['account']['Applications']){delete _0x19fc18[_0xc4db('0x78')][_0xc4db('0x77')];}return db[_0xc4db('0x7c')][_0xc4db('0x6a')]();})[_0xc4db('0x3a')](function(_0x2540d0){if(!_0x2540d0){throw new db[(_0xc4db('0x7d'))]['ValidationError'](_0xc4db('0x7e'));}_0x8a30f2=_[_0xc4db('0x7f')](_['keys'](_0x2540d0),[_0xc4db('0x80'),_0xc4db('0x81')]);_0x322117=_[_0xc4db('0x7f')](_[_0xc4db('0x48')](_0x2540d0),['createdAt','updatedAt','CompanyId',_0xc4db('0x82')]);_0x19fc18[_0xc4db('0x61')]={'mapKey':'mobile'};if(_0x19fc18[_0xc4db('0x78')][_0xc4db('0x54')]){switch(_0x19fc18['account'][_0xc4db('0x54')]){case'twilio':_0x19fc18['body'][_0xc4db('0x83')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x84')];_0x19fc18['body'][_0xc4db('0x61')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x85')];_0x19fc18[_0xc4db('0x61')]['messageId']=_0x4a50e9['body'][_0xc4db('0x86')];break;case _0xc4db('0x87'):_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]='+'+_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x88')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x61')]=_0x4a50e9['body'][_0xc4db('0x89')];break;case'connectel':_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x83')];_0x19fc18['body'][_0xc4db('0x61')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x2b')];break;case _0xc4db('0x8a'):_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]=_0x4a50e9['body'][_0xc4db('0x83')];_0x19fc18['body'][_0xc4db('0x61')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x61')];_0x19fc18[_0xc4db('0x61')]['messageId']=_0x4a50e9[_0xc4db('0x61')]['message_id'];break;case'plivo':_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x84')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x61')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x8b')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x8c')]=_0x4a50e9['body'][_0xc4db('0x8d')];break;case _0xc4db('0x8e'):_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]='+'+_0x4a50e9['body'][_0xc4db('0x8f')][0x0][_0xc4db('0x83')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x61')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x8f')][0x0][_0xc4db('0x89')];_0x19fc18[_0xc4db('0x61')]['messageId']=_0x4a50e9['body']['results'][0x0]['messageId'];break;case _0xc4db('0x90'):_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x91')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x61')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x92')][_0xc4db('0x2b')];break;case _0xc4db('0x93'):_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]=_0x4a50e9[_0xc4db('0x61')]['fromNumber'];_0x19fc18['body']['body']=_0x4a50e9['body'][_0xc4db('0x89')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x8c')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x94')];break;case'bandwidth':_0x19fc18[_0xc4db('0x61')][_0xc4db('0x8c')]=_0x4a50e9[_0xc4db('0x61')][0x0][_0xc4db('0x2b')]['id'];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')]=_0x4a50e9[_0xc4db('0x61')][0x0][_0xc4db('0x2b')][_0xc4db('0x83')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x61')]=_0x4a50e9['body'][0x0][_0xc4db('0x2b')][_0xc4db('0x89')];break;case _0xc4db('0x95'):_0x19fc18[_0xc4db('0x61')]['from']=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x83')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x61')]=_0x4a50e9['body'][_0xc4db('0x2b')];_0x19fc18[_0xc4db('0x61')][_0xc4db('0x8c')]=_0x4a50e9[_0xc4db('0x61')][_0xc4db('0x96')];break;}}if(_0x19fc18['body']['id']){delete _0x19fc18[_0xc4db('0x61')]['id'];}if(_[_0xc4db('0x97')](_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')])){throw new db[(_0xc4db('0x7d'))][(_0xc4db('0x98'))](_0xc4db('0x99'));}if(_[_0xc4db('0x97')](_0x19fc18['body'][_0xc4db('0x61')])||_0x19fc18['body'][_0xc4db('0x61')]===''){throw new db[(_0xc4db('0x7d'))][(_0xc4db('0x98'))](_0xc4db('0x9a'));}if(_[_0xc4db('0x97')](_0x19fc18[_0xc4db('0x61')][_0xc4db('0x9b')])){throw new db[(_0xc4db('0x7d'))][(_0xc4db('0x98'))](_0xc4db('0x9c')+_0x322117);}if(!_[_0xc4db('0x9d')](_0x322117,_0x19fc18[_0xc4db('0x61')][_0xc4db('0x9b')])){throw new db[(_0xc4db('0x7d'))][(_0xc4db('0x98'))](_0xc4db('0x9e')+_0x322117);}_0x3e3fbc[_0x19fc18[_0xc4db('0x61')][_0xc4db('0x9b')]]=_0x19fc18['body'][_0xc4db('0x83')];return db[_0xc4db('0x9f')][_0xc4db('0x5f')]({'where':{'id':_0x19fc18[_0xc4db('0x78')][_0xc4db('0x82')]},'include':[{'model':db[_0xc4db('0x7c')],'as':_0xc4db('0xa0'),'where':_0x3e3fbc,'limit':0x1,'order':[[_0xc4db('0x81'),_0xc4db('0xa1')]]}]});})['then'](handleEntityNotFound(_0x302c20,null))['then'](function(_0x1cc8d7){if(_0x1cc8d7){_0x19fc18[_0xc4db('0xa2')]=_['omit'](_0x1cc8d7,[_0xc4db('0xa0')]);if(_0x1cc8d7[_0xc4db('0xa0')][_0xc4db('0x4c')]){return _0x1cc8d7['Contacts'][0x0];}var _0x25ed37=_['defaults'](_0x19fc18['body'],{'firstName':_0x19fc18['body'][_0xc4db('0x83')],'ListId':_0x1cc8d7['id']});_0x25ed37[_0x19fc18[_0xc4db('0x61')][_0xc4db('0x9b')]]=_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')];return db['CmContact'][_0xc4db('0x60')](_0x25ed37,{'fields':_0x8a30f2,'raw':!![]});}})[_0xc4db('0x3a')](handleEntityNotFound(_0x302c20,null))['then'](function(_0x4f0219){if(_0x4f0219){_0x19fc18['contact']=_0x4f0219;var _0x4cf1d0={'ContactId':_0x4f0219['id'],'phone':_0x19fc18[_0xc4db('0x61')]['from'],'SmsAccountId':_0x4a50e9[_0xc4db('0x69')]['id']};var _0x4bcdac={'ContactId':_0x4f0219['id'],'SmsAccountId':_0x4a50e9[_0xc4db('0x69')]['id'],'closed':![]};return db[_0xc4db('0xa3')]['find']({'where':_0x4bcdac})[_0xc4db('0x3a')](function(_0x551993){if(_0x551993){return[_0x551993,![]];}return db[_0xc4db('0xa3')][_0xc4db('0x60')](_0x4cf1d0)['then'](function(_0x55db35){return[_0x55db35,!![]];});});}})[_0xc4db('0xa4')](function(_0x382894,_0x1c9369){_0x19fc18[_0xc4db('0xa5')]=_0x382894[_0xc4db('0x3c')]({'plain':!![]});_0x19fc18[_0xc4db('0xa5')]['created']=![];if(_0x1c9369){if(_0x19fc18[_0xc4db('0x78')][_0xc4db('0xa6')]){_0x19fc18[_0xc4db('0x79')][_0xc4db('0xa7')]({'id':0x0,'priority':_0x19fc18[_0xc4db('0x79')][_0xc4db('0x4c')]+0x1,'app':_0xc4db('0xa8'),'appdata':_0xc4db('0xa9'),'interval':_0xc4db('0xaa')});}_0x19fc18[_0xc4db('0xa5')][_0xc4db('0xab')]=!![];}return db['SmsMessage']['create']({'phone':_0x19fc18[_0xc4db('0x61')][_0xc4db('0x83')],'messageId':_0x19fc18[_0xc4db('0x61')][_0xc4db('0x8c')],'body':_0x19fc18['body'][_0xc4db('0x61')],'SmsAccountId':_0x4a50e9[_0xc4db('0x69')]['id'],'SmsInteractionId':_0x382894['id'],'direction':'in','ContactId':_0x382894[_0xc4db('0xac')],'AttachmentId':_0x19fc18['body'][_0xc4db('0xad')]});})['then'](function(_0x2bbc85){_0x19fc18['message']=_0x2bbc85;if(_0x19fc18[_0xc4db('0xa5')][_0xc4db('0xae')]){return db[_0xc4db('0xaf')][_0xc4db('0x5f')]({'attributes':['id',_0xc4db('0x40')],'where':{'id':_0x19fc18[_0xc4db('0xa5')][_0xc4db('0xae')]}})[_0xc4db('0x3a')](function(_0x45f560){if(_0x45f560){_0x19fc18[_0xc4db('0x79')][_0xc4db('0xb0')]({'id':0x0,'priority':0x0,'app':_0xc4db('0xb1'),'appdata':_0x45f560[_0xc4db('0x40')]+','+(_0x19fc18[_0xc4db('0x78')]['waitForTheAssignedAgent']||0xa),'interval':_0xc4db('0xaa')});}return respondWithRpcPromise(_0xc4db('0xb2'),_0xc4db('0xb3'),_0x19fc18);});}return respondWithRpcPromise(_0xc4db('0xb2'),_0xc4db('0xb3'),_0x19fc18);})[_0xc4db('0x3a')](function(_0x5b13ec){if(_0x5b13ec){var _0xfd1f7=0xc8;var _0x1be09c=_0xc4db('0xb4');logger[_0xc4db('0x24')](_0xc4db('0x26'),_0x1be09c,_0xfd1f7,_0xc4db('0xb5'));logger[_0xc4db('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1be09c,_0xfd1f7,_0xc4db('0xb5'),JSON[_0xc4db('0x28')](_0x5b13ec));if(_0x19fc18['account'][_0xc4db('0x54')]==='twilio'){return _0x302c20[_0xc4db('0x2f')](_0xfd1f7)['set']('Content-Type',_0xc4db('0xb7'))[_0xc4db('0x41')](_0xc4db('0xb8'));}else{return _0x302c20[_0xc4db('0x2f')](_0xfd1f7)[_0xc4db('0x31')](_0x5b13ec);}}})['catch'](handleError(_0x302c20,null));};exports[_0xc4db('0xb9')]=function(_0x142786,_0x513e95){var _0x3ac07b=_0x142786[_0xc4db('0x69')]['id'];var _0x2331c4=_0x142786['body'];var _0x26eaeb=0xc8;var _0x321334=null;return db[_0xc4db('0xba')][_0xc4db('0xbb')]({'isolationLevel':db[_0xc4db('0xba')][_0xc4db('0xbc')][_0xc4db('0xbd')][_0xc4db('0xbe')]},function(_0x472288){return db[_0xc4db('0x58')][_0xc4db('0x6e')]({'where':{'id':_0x3ac07b},'transaction':_0x472288})['then'](function(_0x48710c){if(_0x48710c){return db[_0xc4db('0x76')][_0xc4db('0x3b')]({'where':{'SmsAccountId':_0x3ac07b},'transaction':_0x472288})['then'](function(){var _0x394a05=_[_0xc4db('0x46')](_0x2331c4,function(_0x36759f){_0x36759f[_0xc4db('0x6b')]=_0x3ac07b;return _0x36759f;});return db[_0xc4db('0x76')][_0xc4db('0xbf')](_0x394a05,{'transaction':_0x472288});});}else{_0x26eaeb=0x194;_0x321334=[];}});})[_0xc4db('0x3a')](function(){if(_0x26eaeb!==0x194){return db[_0xc4db('0x76')][_0xc4db('0xc0')]({'where':{'SmsAccountId':_0x3ac07b},'order':_0xc4db('0x7b')})[_0xc4db('0x3a')](function(_0x77216b){_0x321334=_0x77216b;});}})[_0xc4db('0x2d')](function(_0x507e57){_0x26eaeb=0x1f4;logger[_0xc4db('0x29')](_0x507e57[_0xc4db('0x3f')]);if(_0x507e57[_0xc4db('0x40')]){delete _0x507e57[_0xc4db('0x40')];}_0x321334=_0x507e57;})['finally'](function(){if(_0x321334===null){_0x513e95[_0xc4db('0x2e')](_0x26eaeb);}else{if(_0x26eaeb===0x1f4){_0x513e95[_0xc4db('0x2f')](_0x26eaeb)[_0xc4db('0x41')](_0x321334);}else{_0x513e95[_0xc4db('0x2f')](_0x26eaeb)[_0xc4db('0x31')](_0x321334);}}});};exports[_0xc4db('0xc1')]=function(_0x11b993,_0x1b0774,_0x54f5d5){var _0x27a382={};var _0x1532a5={};var _0x5eb999;var _0x291ecc;return db['SmsAccount'][_0xc4db('0x6e')]({'where':{'id':_0x11b993[_0xc4db('0x69')]['id']}})['then'](handleEntityNotFound(_0x1b0774,null))['then'](function(_0x472557){if(_0x472557){_0x5eb999=_0x472557;_0x1532a5[_0xc4db('0x45')]=_[_0xc4db('0x48')](db[_0xc4db('0x76')][_0xc4db('0x43')]);_0x1532a5[_0xc4db('0x47')]=_['keys'](_0x11b993[_0xc4db('0x47')]);_0x1532a5[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x1532a5[_0xc4db('0x45')],_0x1532a5[_0xc4db('0x47')]);_0x27a382['attributes']=_[_0xc4db('0x4a')](_0x1532a5[_0xc4db('0x45')],qs['fields'](_0x11b993[_0xc4db('0x47')][_0xc4db('0x4b')]));_0x27a382[_0xc4db('0x5d')]=_0x27a382[_0xc4db('0x5d')][_0xc4db('0x4c')]?_0x27a382[_0xc4db('0x5d')]:_0x1532a5['model'];_0x27a382[_0xc4db('0x4f')]=qs[_0xc4db('0x50')](_0x11b993['query'][_0xc4db('0x50')]);_0x27a382['where']=qs['filters'](_[_0xc4db('0x52')](_0x11b993[_0xc4db('0x47')],_0x1532a5[_0xc4db('0x49')]));if(_0x11b993[_0xc4db('0x47')][_0xc4db('0x56')]){_0x27a382[_0xc4db('0x51')]=_[_0xc4db('0x53')](_0x27a382[_0xc4db('0x51')],{'$or':_[_0xc4db('0x46')](_0x27a382[_0xc4db('0x5d')],function(_0x3bf772){var _0x2e24ed={};_0x2e24ed[_0x3bf772]={'$like':'%'+_0x11b993['query'][_0xc4db('0x56')]+'%'};return _0x2e24ed;})});}_0x27a382=_[_0xc4db('0x53')]({},_0x27a382,_0x11b993[_0xc4db('0x57')]);return _0x5eb999[_0xc4db('0xc1')](_0x27a382);}})['then'](function(_0x3a3643){if(_0x3a3643){_0x291ecc=_0x3a3643['length'];if(!_0x11b993[_0xc4db('0x47')][_0xc4db('0x4d')](_0xc4db('0x4e'))){_0x27a382[_0xc4db('0x33')]=qs[_0xc4db('0x33')](_0x11b993[_0xc4db('0x47')][_0xc4db('0x33')]);_0x27a382[_0xc4db('0x35')]=qs['offset'](_0x11b993[_0xc4db('0x47')][_0xc4db('0x35')]);}return _0x5eb999['getApplications'](_0x27a382);}})[_0xc4db('0x3a')](function(_0x3e9d55){if(_0x3e9d55){return _0x3e9d55?{'count':_0x291ecc,'rows':_0x3e9d55}:null;}})[_0xc4db('0x3a')](respondWithResult(_0x1b0774,null))['catch'](handleError(_0x1b0774,null));};exports[_0xc4db('0xc2')]=function(_0x500e5d,_0x333049,_0x3258f1){var _0x4ad966={'raw':![],'where':{}};var _0x395d92={};var _0x16c2fd={'count':0x0,'rows':[]};return db[_0xc4db('0x58')][_0xc4db('0x6e')]({'where':{'id':_0x500e5d[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x333049,null))[_0xc4db('0x3a')](function(_0x267e4c){if(_0x267e4c){_0x395d92['model']=_[_0xc4db('0x48')](db[_0xc4db('0xa3')][_0xc4db('0x43')]);_0x395d92['query']=_[_0xc4db('0x48')](_0x500e5d[_0xc4db('0x47')]);_0x395d92['filters']=_[_0xc4db('0x4a')](_0x395d92['model'],_0x395d92[_0xc4db('0x47')]);_0x4ad966[_0xc4db('0x5d')]=_[_0xc4db('0x4a')](_0x395d92['model'],qs[_0xc4db('0x4b')](_0x500e5d[_0xc4db('0x47')]['fields']));_0x4ad966[_0xc4db('0x5d')]=_0x4ad966['attributes']['length']?_0x4ad966[_0xc4db('0x5d')]:_0x395d92[_0xc4db('0x45')];if(!_0x500e5d[_0xc4db('0x47')][_0xc4db('0x4d')](_0xc4db('0x4e'))){_0x4ad966[_0xc4db('0x33')]=qs['limit'](_0x500e5d['query'][_0xc4db('0x33')]);_0x4ad966[_0xc4db('0x35')]=qs['offset'](_0x500e5d[_0xc4db('0x47')][_0xc4db('0x35')]);}_0x4ad966[_0xc4db('0x4f')]=qs['sort'](_0x500e5d['query'][_0xc4db('0x50')]);_0x4ad966[_0xc4db('0x51')]=qs[_0xc4db('0x49')](_[_0xc4db('0x52')](_0x500e5d['query'],_0x395d92['filters']));_0x4ad966[_0xc4db('0x51')][_0xc4db('0x6b')]=_0x267e4c['id'];if(_0x500e5d['query'][_0xc4db('0x56')]){_0x4ad966[_0xc4db('0x51')]=_['merge'](_0x4ad966[_0xc4db('0x51')],{'$or':_[_0xc4db('0x46')](_0x4ad966['attributes'],function(_0xa05ca7){var _0x4105e6={};_0x4105e6[_0xa05ca7]={'$like':'%'+_0x500e5d[_0xc4db('0x47')][_0xc4db('0x56')]+'%'};return _0x4105e6;})});}_0x4ad966=_['merge']({},_0x4ad966,_0x500e5d['options']);return db[_0xc4db('0xa3')][_0xc4db('0x34')]({'where':_0x4ad966[_0xc4db('0x51')]})[_0xc4db('0x3a')](function(_0x119144){_0x16c2fd[_0xc4db('0x34')]=_0x119144;if(_0x500e5d[_0xc4db('0x47')][_0xc4db('0x59')]){_0x4ad966[_0xc4db('0x5e')]=[{'model':db[_0xc4db('0x7c')],'as':_0xc4db('0xc3'),'required':![]},{'model':db[_0xc4db('0xaf')],'as':_0xc4db('0xc4'),'attributes':[_0xc4db('0x40'),_0xc4db('0xc5'),_0xc4db('0xc6')],'required':![]},{'model':db[_0xc4db('0xc7')],'as':_0xc4db('0xc8'),'attributes':['id',_0xc4db('0x40'),_0xc4db('0xc9')],'where':_0x500e5d['query'][_0xc4db('0xca')]?{'id':_0x500e5d[_0xc4db('0x47')][_0xc4db('0xca')]}:undefined,'required':_0x500e5d['query'][_0xc4db('0xca')]?!![]:![]}];}return db[_0xc4db('0xa3')][_0xc4db('0x5a')](_0x4ad966);})['then'](function(_0x59b6a4){_0x16c2fd[_0xc4db('0x5b')]=_0x59b6a4;return _0x16c2fd;});}})['then'](respondWithFilteredResult(_0x333049,_0x4ad966))[_0xc4db('0x2d')](handleError(_0x333049,null));};exports[_0xc4db('0x41')]=function(_0x337b34,_0x2763ef,_0x564583){var _0x3f0757,_0x55363b,_0x1b2644;if(_['isNil'](_0x337b34[_0xc4db('0x61')][_0xc4db('0x61')])||_0x337b34['body'][_0xc4db('0x61')]===''){throw new db['Sequelize'][(_0xc4db('0x98'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc4db('0x97')](_0x337b34['body']['to'])){throw new db[(_0xc4db('0x7d'))][(_0xc4db('0x98'))](_0xc4db('0xcb'));}_0x3f0757=_0x337b34['body']['to'];return db['SmsAccount'][_0xc4db('0x5f')]({'where':{'id':_0x337b34[_0xc4db('0x69')]['id']},'include':[{'model':db[_0xc4db('0x9f')],'as':_0xc4db('0xcc'),'include':[{'model':db[_0xc4db('0x7c')],'as':'Contacts','where':{'mobile':_0x3f0757},'limit':0x1,'order':[[_0xc4db('0x81'),'DESC']]}]}]})[_0xc4db('0x3a')](handleEntityNotFound(_0x2763ef,null))[_0xc4db('0x3a')](function(_0x1cb70f){if(_0x1cb70f&&_0x1cb70f['List']){_0x55363b=_0x1cb70f[_0xc4db('0x3c')]({'plain':!![]});if(_0x55363b['List']&&_0x55363b[_0xc4db('0xcc')][_0xc4db('0xa0')][_0xc4db('0x4c')]){return _0x55363b['List'][_0xc4db('0xa0')][0x0];}return db[_0xc4db('0x7c')][_0xc4db('0x60')](_[_0xc4db('0x1a')](_0x337b34[_0xc4db('0x61')],{'firstName':_0x3f0757,'mobile':_0x3f0757,'phone':_0x3f0757,'ListId':_0x55363b['ListId']}));}})[_0xc4db('0x3a')](handleEntityNotFound(_0x2763ef,null))['then'](function(_0x3ce1e8){if(_0x3ce1e8){_0x1b2644=_0x3ce1e8;return db[_0xc4db('0xa3')][_0xc4db('0x5f')]({'where':{'ContactId':_0x1b2644['id'],'closed':![],'SmsAccountId':_0x55363b['id']}})[_0xc4db('0x3a')](function(_0x4e52c3){if(_0x4e52c3){return[_0x4e52c3,![]];}return db[_0xc4db('0xa3')][_0xc4db('0x60')]({'UserId':_0x337b34[_0xc4db('0x64')]['id'],'ContactId':_0x1b2644['id'],'SmsAccountId':_0x55363b['id'],'phone':_0x3f0757,'firstMsgDirection':_0xc4db('0xcd'),'Messages':[_[_0xc4db('0x53')](_0x337b34[_0xc4db('0x61')],{'read':![],'body':_0x337b34[_0xc4db('0x61')]['body'],'phone':_0x3f0757,'SmsAccountId':_0x55363b['id'],'UserId':_0x337b34[_0xc4db('0x64')]['id'],'ContactId':_0x1b2644['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc4db('0xce')}]})[_0xc4db('0x3a')](function(_0x29a0b7){return[_0x29a0b7,!![]];});});}})[_0xc4db('0xa4')](function(_0x559be6,_0x46e188){if(_0x46e188){return _0x559be6;}return db[_0xc4db('0xcf')][_0xc4db('0x60')](_[_0xc4db('0x53')](_0x337b34[_0xc4db('0x61')],{'read':![],'body':_0x337b34[_0xc4db('0x61')][_0xc4db('0x61')],'phone':_0x3f0757,'SmsAccountId':_0x55363b['id'],'SmsInteractionId':_0x559be6['id'],'UserId':_0x337b34[_0xc4db('0x64')]['id'],'ContactId':_0x1b2644['id']}))[_0xc4db('0x3a')](function(_0x397dc2){_0x559be6['dataValues']['Messages']=[];_0x559be6['dataValues']['Messages']['push'](_0x397dc2['dataValues']);return _0x559be6;});})[_0xc4db('0x3a')](respondWithResult(_0x2763ef,null))['catch'](handleError(_0x2763ef,null));};exports[_0xc4db('0x2f')]=function(_0x39c827,_0x2449fe,_0x15203c){if(_0x39c827['body']['id']){delete _0x39c827['body']['id'];}var _0x7f33b,_0x43cae6,_0x51f51a;return db[_0xc4db('0x58')]['find']({'where':{'id':_0x39c827[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x2449fe,null))[_0xc4db('0x3a')](function(_0x518ee0){if(_0x518ee0){_0x51f51a=_0x518ee0;logger[_0xc4db('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc4db('0xd0'),_0x518ee0[_0xc4db('0x54')],util['inspect'](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));switch(_0x518ee0[_0xc4db('0x54')]){case'skebby':if(_0x39c827['body'][_0xc4db('0xd1')]&&_0x39c827[_0xc4db('0x61')][_0xc4db('0x2f')]){_0x43cae6=_0x39c827[_0xc4db('0x61')][_0xc4db('0x2f')];return db[_0xc4db('0xcf')]['find']({'where':{'messageId':_0x39c827[_0xc4db('0x61')][_0xc4db('0xd1')]}});}break;case _0xc4db('0xd2'):if(_0x39c827[_0xc4db('0x61')][_0xc4db('0xd3')]&&_0x39c827[_0xc4db('0x61')]['statusInt']){_0x43cae6=_0x39c827['body'][_0xc4db('0xd4')];return db[_0xc4db('0xcf')]['find']({'where':{'messageId':_0x39c827[_0xc4db('0x61')][_0xc4db('0xd3')]}});}break;case _0xc4db('0x8a'):if(_0x39c827[_0xc4db('0x61')][_0xc4db('0xd5')]&&_0x39c827['body'][_0xc4db('0xd6')]){_0x43cae6=_0x39c827[_0xc4db('0x61')][_0xc4db('0xd6')];return db[_0xc4db('0xcf')]['find']({'where':{'messageId':_0x39c827[_0xc4db('0x61')][_0xc4db('0xd5')]}});}break;case _0xc4db('0x8e'):var _0x57d45f=_0x39c827['body']['results'][0x0];if(_0x57d45f['messageId']&&_0x57d45f[_0xc4db('0x2f')]['groupName']==='DELIVERED'){_0x43cae6=_0x57d45f[_0xc4db('0x2f')][_0xc4db('0xd7')];return db[_0xc4db('0xcf')][_0xc4db('0x5f')]({'where':{'messageId':_0x57d45f[_0xc4db('0x8c')]}});}break;case _0xc4db('0x93'):if(_0x39c827[_0xc4db('0x61')][_0xc4db('0x8c')]&&_0x39c827[_0xc4db('0x61')][_0xc4db('0x2f')]){_0x43cae6=_0x39c827[_0xc4db('0x61')][_0xc4db('0x2f')];return db[_0xc4db('0xcf')][_0xc4db('0x5f')]({'where':{'messageId':_0x39c827[_0xc4db('0x61')][_0xc4db('0x8c')]}});}break;case _0xc4db('0xd8'):if(_0x39c827[_0xc4db('0x61')][0x0][_0xc4db('0x2b')]['id']){_0x43cae6=_0x39c827[_0xc4db('0x61')][0x0][_0xc4db('0x54')];return db[_0xc4db('0xcf')][_0xc4db('0x5f')]({'where':{'messageId':_0x39c827['body'][0x0][_0xc4db('0x2b')]['id']}});}break;case _0xc4db('0x95'):if(_0x39c827[_0xc4db('0x61')][_0xc4db('0xd9')]&&_0x39c827['body'][_0xc4db('0x2f')]){_0x43cae6=_0x39c827[_0xc4db('0x61')]['status'];return db['SmsMessage'][_0xc4db('0x5f')]({'where':{'messageId':_0x39c827[_0xc4db('0x61')][_0xc4db('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x2449fe,null))[_0xc4db('0x3a')](function(_0x33ae8c){if(_0x33ae8c){_0x7f33b=_0x33ae8c;switch(_0x51f51a[_0xc4db('0x54')]){case _0xc4db('0x87'):if(_0x43cae6===_0xc4db('0xda')){return _0x7f33b['update']({'read':!![]});}else{logger['error'](_0xc4db('0x26'),_0xc4db('0x2f'),_0xc4db('0x87'),util['inspect'](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));}break;case _0xc4db('0xd2'):if(_0x43cae6==='1'){return _0x7f33b[_0xc4db('0x68')]({'read':!![]});}else{logger[_0xc4db('0x29')](_0xc4db('0x26'),_0xc4db('0x2f'),_0xc4db('0x87'),util[_0xc4db('0xdb')](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x39c827['body'][_0xc4db('0xdc')]&&_0x43cae6>=0xc8&&_0x43cae6<=0xce){return _0x7f33b[_0xc4db('0x68')]({'read':!![]});}else{logger[_0xc4db('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc4db('0x2f'),_0xc4db('0x8a'),util[_0xc4db('0xdb')](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x12703c=_0x39c827[_0xc4db('0x61')][_0xc4db('0x8f')][0x0];if(_0x12703c[_0xc4db('0x2f')][_0xc4db('0xd7')]===_0xc4db('0xda')){return _0x7f33b['update']({'read':!![]});}else{logger[_0xc4db('0x29')](_0xc4db('0x26'),_0xc4db('0x2f'),_0xc4db('0x8e'),util[_0xc4db('0xdb')](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));}break;case _0xc4db('0x93'):if(_0x43cae6==_0xc4db('0xdd')||_0x43cae6==_0xc4db('0xde')){return _0x7f33b[_0xc4db('0x68')]({'read':!![]});}else{logger['error'](_0xc4db('0x26'),_0xc4db('0x2f'),_0xc4db('0x93'),util[_0xc4db('0xdb')](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));}break;case _0xc4db('0xd8'):if(_0x43cae6==_0xc4db('0xdf')){return _0x7f33b['update']({'read':!![]});}else{logger[_0xc4db('0x29')](_0xc4db('0x26'),_0xc4db('0x2f'),_0xc4db('0xd8'),util['inspect'](_0x39c827['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x43cae6==='DELIVRD'||_0x43cae6===_0xc4db('0xe0')){return _0x7f33b[_0xc4db('0x68')]({'read':!![]});}else{logger[_0xc4db('0x29')](_0xc4db('0x26'),_0xc4db('0x2f'),'intelepeer',util[_0xc4db('0xdb')](_0x39c827[_0xc4db('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x7f33b;}})[_0xc4db('0x3a')](respondWithResult(_0x2449fe,null))['catch'](handleError(_0x2449fe,null));};exports['statusGet']=function(_0x5ca659,_0x374621,_0x923c15){var _0x34d37f,_0xa24cc5,_0x1af88d;return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x5ca659[_0xc4db('0x69')]['id']}})['then'](handleEntityNotFound(_0x374621,null))[_0xc4db('0x3a')](function(_0x1eb84e){if(_0x1eb84e){_0x1af88d=_0x1eb84e;logger['debug'](_0xc4db('0x26'),'status',_0xc4db('0xd0'),_0x1eb84e[_0xc4db('0x54')],util['inspect'](_0x5ca659[_0xc4db('0x47')],{'showHidden':![],'depth':null}));switch(_0x1eb84e[_0xc4db('0x54')]){case _0xc4db('0x90'):if(_0x5ca659[_0xc4db('0x47')][_0xc4db('0xe1')]&&_0x5ca659[_0xc4db('0x47')][_0xc4db('0xe2')]){_0xa24cc5=_0x5ca659[_0xc4db('0x47')][_0xc4db('0xe2')];return db['SmsMessage'][_0xc4db('0x5f')]({'where':{'messageId':_0x5ca659[_0xc4db('0x47')][_0xc4db('0xe1')]}});}break;}}})['then'](handleEntityNotFound(_0x374621,null))['then'](function(_0xc1bc67){if(_0xc1bc67){_0x34d37f=_0xc1bc67;switch(_0x1af88d[_0xc4db('0x54')]){case _0xc4db('0x90'):if(_0xa24cc5==='2'||_0xa24cc5==='6'){return _0x34d37f[_0xc4db('0x68')]({'read':!![]});}else{logger[_0xc4db('0x29')](_0xc4db('0x26'),'status','csc',util[_0xc4db('0xdb')](_0x5ca659[_0xc4db('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x34d37f;}})['then'](respondWithResult(_0x374621,null))[_0xc4db('0x2d')](handleError(_0x374621,null));};exports[_0xc4db('0xe3')]=function(_0x1bc124,_0x469b21,_0x5368d9){return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x1bc124[_0xc4db('0x69')]['id']}})[_0xc4db('0x3a')](handleEntityNotFound(_0x469b21,null))[_0xc4db('0x3a')](function(_0x213892){if(_0x213892){return _0x213892[_0xc4db('0xe3')](_0x1bc124[_0xc4db('0x61')][_0xc4db('0x70')],_[_0xc4db('0xe4')](_0x1bc124[_0xc4db('0x61')],[_0xc4db('0x70'),'id'])||{})[_0xc4db('0xa4')](function(_0x1f6269){for(var _0x17ba39=0x0;_0x17ba39<_0x1bc124[_0xc4db('0x61')][_0xc4db('0x70')]['length'];_0x17ba39+=0x1){socket[_0xc4db('0xe5')](_0xc4db('0xe6'),{'UserId':Number(_0x1bc124[_0xc4db('0x61')]['ids'][_0x17ba39]),'SmsAccountId':Number(_0x1bc124[_0xc4db('0x69')]['id'])});}return _0x1f6269;});}})[_0xc4db('0x3a')](respondWithResult(_0x469b21,null))[_0xc4db('0x2d')](handleError(_0x469b21,null));};exports[_0xc4db('0xe7')]=function(_0x37aa06,_0x368d6a,_0x8a72d8){return db[_0xc4db('0x58')][_0xc4db('0x5f')]({'where':{'id':_0x37aa06['params']['id']}})['then'](handleEntityNotFound(_0x368d6a,null))['then'](function(_0x44846a){if(_0x44846a){return _0x44846a[_0xc4db('0xe7')](_0x37aa06[_0xc4db('0x47')]['ids'])[_0xc4db('0x3a')](function(){if(_['isArray'](_0x37aa06[_0xc4db('0x47')]['ids'])){for(var _0x2eb3f8=0x0;_0x2eb3f8<_0x37aa06[_0xc4db('0x47')][_0xc4db('0x70')][_0xc4db('0x4c')];_0x2eb3f8+=0x1){socket[_0xc4db('0xe5')]('userSmsAccount:remove',{'UserId':Number(_0x37aa06['query'][_0xc4db('0x70')][_0x2eb3f8]),'SmsAccountId':Number(_0x37aa06[_0xc4db('0x69')]['id'])});}}else{socket[_0xc4db('0xe5')](_0xc4db('0xe8'),{'UserId':Number(_0x37aa06[_0xc4db('0x47')][_0xc4db('0x70')]),'SmsAccountId':Number(_0x37aa06[_0xc4db('0x69')]['id'])});}});}})[_0xc4db('0x3a')](respondWithStatusCode(_0x368d6a,null))['catch'](handleError(_0x368d6a,null));};exports[_0xc4db('0xe9')]=function(_0x37f6a6,_0x53758d,_0x2d7f4c){var _0x9399c9={};var _0x155944={};var _0x55b31a;var _0x49537a;return db[_0xc4db('0x58')][_0xc4db('0x6e')]({'where':{'id':_0x37f6a6[_0xc4db('0x69')]['id']}})['then'](handleEntityNotFound(_0x53758d,null))['then'](function(_0x10d95d){if(_0x10d95d){_0x55b31a=_0x10d95d;_0x155944[_0xc4db('0x45')]=_[_0xc4db('0x48')](db[_0xc4db('0xaf')][_0xc4db('0x43')]);_0x155944[_0xc4db('0x47')]=_[_0xc4db('0x48')](_0x37f6a6[_0xc4db('0x47')]);_0x155944[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x155944['model'],_0x155944[_0xc4db('0x47')]);_0x9399c9[_0xc4db('0x5d')]=_['intersection'](_0x155944[_0xc4db('0x45')],qs[_0xc4db('0x4b')](_0x37f6a6[_0xc4db('0x47')][_0xc4db('0x4b')]));_0x9399c9['attributes']=_0x9399c9[_0xc4db('0x5d')][_0xc4db('0x4c')]?_0x9399c9[_0xc4db('0x5d')]:_0x155944['model'];_0x9399c9[_0xc4db('0x4f')]=qs[_0xc4db('0x50')](_0x37f6a6['query'][_0xc4db('0x50')]);_0x9399c9['where']=qs[_0xc4db('0x49')](_[_0xc4db('0x52')](_0x37f6a6['query'],_0x155944[_0xc4db('0x49')]));if(_0x37f6a6['query']['filter']){_0x9399c9['where']=_[_0xc4db('0x53')](_0x9399c9[_0xc4db('0x51')],{'$or':_[_0xc4db('0x46')](_0x9399c9[_0xc4db('0x5d')],function(_0x32bfe2){var _0xd0ceb1={};_0xd0ceb1[_0x32bfe2]={'$like':'%'+_0x37f6a6[_0xc4db('0x47')]['filter']+'%'};return _0xd0ceb1;})});}_0x9399c9=_[_0xc4db('0x53')]({},_0x9399c9,_0x37f6a6[_0xc4db('0x57')]);return _0x55b31a['getAgents'](_0x9399c9);}})[_0xc4db('0x3a')](function(_0x1c03f3){if(_0x1c03f3){_0x49537a=_0x1c03f3[_0xc4db('0x4c')];if(!_0x37f6a6['query'][_0xc4db('0x4d')](_0xc4db('0x4e'))){_0x9399c9[_0xc4db('0x33')]=qs[_0xc4db('0x33')](_0x37f6a6[_0xc4db('0x47')]['limit']);_0x9399c9[_0xc4db('0x35')]=qs['offset'](_0x37f6a6[_0xc4db('0x47')][_0xc4db('0x35')]);}return _0x55b31a['getAgents'](_0x9399c9);}})[_0xc4db('0x3a')](function(_0x483547){if(_0x483547){return _0x483547?{'count':_0x49537a,'rows':_0x483547}:null;}})[_0xc4db('0x3a')](respondWithResult(_0x53758d,null))['catch'](handleError(_0x53758d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 9a8ada2..360160b 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 _0xe301=['remove','emit','hook','exports','events','../../mysqldb','SmsAccount','save','update'];(function(_0xbde851,_0x2628f6){var _0x3fadbe=function(_0x365118){while(--_0x365118){_0xbde851['push'](_0xbde851['shift']());}};_0x3fadbe(++_0x2628f6);}(_0xe301,0x163));var _0x1e30=function(_0x4d063a,_0x253bff){_0x4d063a=_0x4d063a-0x0;var _0x333040=_0xe301[_0x4d063a];return _0x333040;};'use strict';var EventEmitter=require(_0x1e30('0x0'));var SmsAccount=require(_0x1e30('0x1'))['db'][_0x1e30('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e30('0x3'),'afterUpdate':_0x1e30('0x4'),'afterDestroy':_0x1e30('0x5')};function emitEvent(_0x5dea26){return function(_0x4cd325,_0x401e97,_0x12acbb){SmsAccountEvents[_0x1e30('0x6')](_0x5dea26+':'+_0x4cd325['id'],_0x4cd325);SmsAccountEvents[_0x1e30('0x6')](_0x5dea26,_0x4cd325);_0x12acbb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x1e30('0x7')](e,emitEvent(event));}}module[_0x1e30('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xeb2d=['emit','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x313e3d,_0x2d149f){var _0x3989d0=function(_0x91af6a){while(--_0x91af6a){_0x313e3d['push'](_0x313e3d['shift']());}};_0x3989d0(++_0x2d149f);}(_0xeb2d,0xb7));var _0xdeb2=function(_0x34a71e,_0x2194a3){_0x34a71e=_0x34a71e-0x0;var _0x398769=_0xeb2d[_0x34a71e];return _0x398769;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xdeb2('0x0'))['db'][_0xdeb2('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xdeb2('0x2')](0x0);var events={'afterCreate':_0xdeb2('0x3'),'afterUpdate':_0xdeb2('0x4'),'afterDestroy':_0xdeb2('0x5')};function emitEvent(_0x23cbdc){return function(_0x5f632,_0x313bbb,_0x3c066e){SmsAccountEvents[_0xdeb2('0x6')](_0x23cbdc+':'+_0x5f632['id'],_0x5f632);SmsAccountEvents[_0xdeb2('0x6')](_0x23cbdc,_0x5f632);_0x3c066e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xdeb2('0x7')](e,emitEvent(event));}}module[_0xdeb2('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 961cfb7..b8990ff 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 _0x626d=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','../../config/logger','moment'];(function(_0x3179d0,_0x33fa89){var _0x1bc5e3=function(_0x3a1a78){while(--_0x3a1a78){_0x3179d0['push'](_0x3179d0['shift']());}};_0x1bc5e3(++_0x33fa89);}(_0x626d,0x80));var _0xd626=function(_0x5a984c,_0x442206){_0x5a984c=_0x5a984c-0x0;var _0x1d8785=_0x626d[_0x5a984c];return _0x1d8785;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd626('0x0'))('api');var moment=require(_0xd626('0x1'));var BPromise=require('bluebird');var rp=require(_0xd626('0x2'));var fs=require('fs');var path=require(_0xd626('0x3'));var rimraf=require(_0xd626('0x4'));var config=require(_0xd626('0x5'));var attributes=require(_0xd626('0x6'));module['exports']=function(_0x8298d3,_0x4b042a){return _0x8298d3[_0xd626('0x7')](_0xd626('0x8'),attributes,{'tableName':_0xd626('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28f7=['SmsAccount','lodash','util','api','bluebird','request-promise','rimraf','./smsAccount.attributes','exports','define'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x28f7,0x141));var _0x728f=function(_0x41e718,_0x39b86f){_0x41e718=_0x41e718-0x0;var _0x330585=_0x28f7[_0x41e718];return _0x330585;};'use strict';var _=require(_0x728f('0x0'));var util=require(_0x728f('0x1'));var logger=require('../../config/logger')(_0x728f('0x2'));var moment=require('moment');var BPromise=require(_0x728f('0x3'));var rp=require(_0x728f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x728f('0x5'));var config=require('../../config/environment');var attributes=require(_0x728f('0x6'));module[_0x728f('0x7')]=function(_0x101b76,_0x4a463f){return _0x101b76[_0x728f('0x8')](_0x728f('0x9'),attributes,{'tableName':'sms_accounts','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 bfa9bb8..5066bd2 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 _0x83b1=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','attributes','include','map','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s'];(function(_0x506d1a,_0x564d78){var _0xbfdf21=function(_0x2272c5){while(--_0x2272c5){_0x506d1a['push'](_0x506d1a['shift']());}};_0xbfdf21(++_0x564d78);}(_0x83b1,0xa4));var _0x183b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x83b1[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x183b('0x0'));var util=require(_0x183b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x183b('0x2'));var fs=require('fs');var Redis=require(_0x183b('0x3'));var db=require(_0x183b('0x4'))['db'];var utils=require(_0x183b('0x5'));var logger=require(_0x183b('0x6'))(_0x183b('0x7'));var config=require(_0x183b('0x8'));var jayson=require(_0x183b('0x9'));var client=jayson[_0x183b('0xa')][_0x183b('0xb')]({'port':0x232a});config[_0x183b('0xc')]=_[_0x183b('0xd')](config[_0x183b('0xc')],{'host':_0x183b('0xe'),'port':0x18eb});var socket=require(_0x183b('0xf'))(new Redis(config[_0x183b('0xc')]));require(_0x183b('0x10'))[_0x183b('0x11')](socket);function respondWithRpcPromise(_0x439a59,_0x6190a3,_0x209b82){return new BPromise(function(_0x260f75,_0x184203){return client[_0x183b('0x12')](_0x439a59,_0x209b82)['then'](function(_0x12d8a6){logger[_0x183b('0x13')](_0x183b('0x14'),_0x6190a3,_0x183b('0x15'));logger[_0x183b('0x16')](_0x183b('0x17'),_0x6190a3,_0x183b('0x15'),JSON[_0x183b('0x18')](_0x12d8a6));if(_0x12d8a6[_0x183b('0x19')]){if(_0x12d8a6['error'][_0x183b('0x1a')]===0x1f4){logger[_0x183b('0x19')](_0x183b('0x14'),_0x6190a3,_0x12d8a6['error'][_0x183b('0x1b')]);return _0x184203(_0x12d8a6[_0x183b('0x19')][_0x183b('0x1b')]);}logger['error'](_0x183b('0x14'),_0x6190a3,_0x12d8a6[_0x183b('0x19')][_0x183b('0x1b')]);return _0x260f75(_0x12d8a6[_0x183b('0x19')]['message']);}else{logger[_0x183b('0x13')](_0x183b('0x14'),_0x6190a3,_0x183b('0x15'));_0x260f75(_0x12d8a6['result'][_0x183b('0x1b')]);}})[_0x183b('0x1c')](function(_0x5f3809){logger[_0x183b('0x19')]('SmsAccount,\x20%s,\x20%s',_0x6190a3,_0x5f3809);_0x184203(_0x5f3809);});});}exports[_0x183b('0x1d')]=function(_0x14a307){var _0x5efa1c=this;return new Promise(function(_0x30f1e7,_0x50be65){return db[_0x183b('0x1e')][_0x183b('0x1f')]({'raw':_0x14a307[_0x183b('0x20')]?_0x14a307[_0x183b('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x14a307['options']?_0x14a307['options']['where']||null:null,'attributes':_0x14a307[_0x183b('0x20')]?_0x14a307[_0x183b('0x20')][_0x183b('0x21')]||null:null,'include':_0x14a307['options']?_0x14a307[_0x183b('0x20')][_0x183b('0x22')]?_[_0x183b('0x23')](_0x14a307['options'][_0x183b('0x22')],function(_0x5872c9){return{'model':db[_0x5872c9['model']],'as':_0x5872c9['as'],'attributes':_0x5872c9['attributes'],'include':_0x5872c9[_0x183b('0x22')]?_[_0x183b('0x23')](_0x5872c9[_0x183b('0x22')],function(_0x5a7450){return{'model':db[_0x5a7450['model']],'as':_0x5a7450['as'],'attributes':_0x5a7450[_0x183b('0x21')],'include':_0x5a7450['include']?_[_0x183b('0x23')](_0x5a7450[_0x183b('0x22')],function(_0x395f18){return{'model':db[_0x395f18['model']],'as':_0x395f18['as'],'attributes':_0x395f18[_0x183b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x183b('0x24')](function(_0xe935f){logger[_0x183b('0x13')](_0x183b('0x1d'),_0x14a307);logger[_0x183b('0x16')]('ShowSmsAccount',_0x14a307,JSON[_0x183b('0x18')](_0xe935f));_0x30f1e7(_0xe935f);})[_0x183b('0x1c')](function(_0x5ae0a2){logger[_0x183b('0x19')](_0x183b('0x1d'),_0x5ae0a2[_0x183b('0x1b')],_0x14a307);_0x50be65(_0x5efa1c[_0x183b('0x19')](0x1f4,_0x5ae0a2[_0x183b('0x1b')]));});});}; \ No newline at end of file +var _0xda6e=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsAccount','find','raw','options','where','include','map','model','attributes','ShowSmsAccount','catch','util','bluebird','randomstring','ioredis'];(function(_0xb31f66,_0x2a0fa4){var _0x9634b0=function(_0x11d6ae){while(--_0x11d6ae){_0xb31f66['push'](_0xb31f66['shift']());}};_0x9634b0(++_0x2a0fa4);}(_0xda6e,0x124));var _0xeda6=function(_0x732635,_0x1f1c24){_0x732635=_0x732635-0x0;var _0x4b6fff=_0xda6e[_0x732635];return _0x4b6fff;};'use strict';var _=require('lodash');var util=require(_0xeda6('0x0'));var moment=require('moment');var BPromise=require(_0xeda6('0x1'));var rs=require(_0xeda6('0x2'));var fs=require('fs');var Redis=require(_0xeda6('0x3'));var db=require(_0xeda6('0x4'))['db'];var utils=require(_0xeda6('0x5'));var logger=require(_0xeda6('0x6'))('rpc');var config=require(_0xeda6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeda6('0x8')][_0xeda6('0x9')]({'port':0x232a});config['redis']=_[_0xeda6('0xa')](config[_0xeda6('0xb')],{'host':_0xeda6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeda6('0xb')]));require(_0xeda6('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f4dc9,_0xab8fc6,_0x1adeda){return new BPromise(function(_0x1dd414,_0x5de411){return client[_0xeda6('0xe')](_0x2f4dc9,_0x1adeda)[_0xeda6('0xf')](function(_0x717a76){logger[_0xeda6('0x10')](_0xeda6('0x11'),_0xab8fc6,_0xeda6('0x12'));logger[_0xeda6('0x13')](_0xeda6('0x14'),_0xab8fc6,_0xeda6('0x12'),JSON[_0xeda6('0x15')](_0x717a76));if(_0x717a76['error']){if(_0x717a76[_0xeda6('0x16')][_0xeda6('0x17')]===0x1f4){logger['error'](_0xeda6('0x11'),_0xab8fc6,_0x717a76[_0xeda6('0x16')][_0xeda6('0x18')]);return _0x5de411(_0x717a76[_0xeda6('0x16')][_0xeda6('0x18')]);}logger['error'](_0xeda6('0x11'),_0xab8fc6,_0x717a76[_0xeda6('0x16')][_0xeda6('0x18')]);return _0x1dd414(_0x717a76[_0xeda6('0x16')]['message']);}else{logger[_0xeda6('0x10')](_0xeda6('0x11'),_0xab8fc6,_0xeda6('0x12'));_0x1dd414(_0x717a76[_0xeda6('0x19')][_0xeda6('0x18')]);}})['catch'](function(_0x42638c){logger[_0xeda6('0x16')](_0xeda6('0x11'),_0xab8fc6,_0x42638c);_0x5de411(_0x42638c);});});}exports['ShowSmsAccount']=function(_0x205ca2){var _0x1928c3=this;return new Promise(function(_0x1e7df6,_0x3bb3b6){return db[_0xeda6('0x1a')][_0xeda6('0x1b')]({'raw':_0x205ca2['options']?_0x205ca2['options'][_0xeda6('0x1c')]===undefined?!![]:![]:!![],'where':_0x205ca2[_0xeda6('0x1d')]?_0x205ca2[_0xeda6('0x1d')][_0xeda6('0x1e')]||null:null,'attributes':_0x205ca2[_0xeda6('0x1d')]?_0x205ca2[_0xeda6('0x1d')]['attributes']||null:null,'include':_0x205ca2[_0xeda6('0x1d')]?_0x205ca2[_0xeda6('0x1d')][_0xeda6('0x1f')]?_[_0xeda6('0x20')](_0x205ca2[_0xeda6('0x1d')][_0xeda6('0x1f')],function(_0x13625b){return{'model':db[_0x13625b[_0xeda6('0x21')]],'as':_0x13625b['as'],'attributes':_0x13625b[_0xeda6('0x22')],'include':_0x13625b[_0xeda6('0x1f')]?_[_0xeda6('0x20')](_0x13625b[_0xeda6('0x1f')],function(_0x3f2575){return{'model':db[_0x3f2575[_0xeda6('0x21')]],'as':_0x3f2575['as'],'attributes':_0x3f2575['attributes'],'include':_0x3f2575[_0xeda6('0x1f')]?_[_0xeda6('0x20')](_0x3f2575[_0xeda6('0x1f')],function(_0x19dcd7){return{'model':db[_0x19dcd7[_0xeda6('0x21')]],'as':_0x19dcd7['as'],'attributes':_0x19dcd7[_0xeda6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xeda6('0xf')](function(_0x553967){logger['info'](_0xeda6('0x23'),_0x205ca2);logger[_0xeda6('0x13')](_0xeda6('0x23'),_0x205ca2,JSON[_0xeda6('0x15')](_0x553967));_0x1e7df6(_0x553967);})[_0xeda6('0x24')](function(_0x2a33e7){logger[_0xeda6('0x16')](_0xeda6('0x23'),_0x2a33e7[_0xeda6('0x18')],_0x205ca2);_0x3bb3b6(_0x1928c3['error'](0x1f4,_0x2a33e7[_0xeda6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 57677d8..3dedf43 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 d4e3b29..e1a9467 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x19b052,_0x346d97){var _0x1b64d6=function(_0x1cdffa){while(--_0x1cdffa){_0x19b052['push'](_0x19b052['shift']());}};_0x1b64d6(++_0x346d97);}(_0xe14b,0x93));var _0xbe14=function(_0xc74c4,_0x32fe57){_0xc74c4=_0xc74c4-0x0;var _0x5828b6=_0xe14b[_0xc74c4];return _0x5828b6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b2e0816..0cac7ef 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 _0x8b3d=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3566ea,_0x50e87d){var _0x24c0b9=function(_0x1f22a5){while(--_0x1f22a5){_0x3566ea['push'](_0x3566ea['shift']());}};_0x24c0b9(++_0x50e87d);}(_0x8b3d,0x19b));var _0xd8b3=function(_0x130271,_0xfb24a3){_0x130271=_0x130271-0x0;var _0x10c22f=_0x8b3d[_0x130271];return _0x10c22f;};'use strict';var Sequelize=require('sequelize');module[_0xd8b3('0x0')]={'priority':{'type':Sequelize[_0xd8b3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd8b3('0x2')],'allowNull':![],'defaultValue':_0xd8b3('0x3')},'appdata':{'type':Sequelize[_0xd8b3('0x4')]()},'description':{'type':Sequelize[_0xd8b3('0x2')]},'interval':{'type':Sequelize[_0xd8b3('0x2')],'defaultValue':_0xd8b3('0x5')}}; \ No newline at end of file +var _0xb836=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x206d06,_0x4962bc){var _0x21505f=function(_0x20bc21){while(--_0x20bc21){_0x206d06['push'](_0x206d06['shift']());}};_0x21505f(++_0x4962bc);}(_0xb836,0x153));var _0x6b83=function(_0x362b59,_0x31ce8f){_0x362b59=_0x362b59-0x0;var _0x3016b2=_0xb836[_0x362b59];return _0x3016b2;};'use strict';var Sequelize=require('sequelize');module[_0x6b83('0x0')]={'priority':{'type':Sequelize[_0x6b83('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6b83('0x2')],'allowNull':![],'defaultValue':_0x6b83('0x3')},'appdata':{'type':Sequelize[_0x6b83('0x4')]()},'description':{'type':Sequelize[_0x6b83('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 273dd1c..1bc936d 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 _0xfa0a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit','status','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body'];(function(_0x167fa5,_0x2001cb){var _0x233dc2=function(_0x53ec43){while(--_0x53ec43){_0x167fa5['push'](_0x167fa5['shift']());}};_0x233dc2(++_0x2001cb);}(_0xfa0a,0x138));var _0xafa0=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xfa0a[_0x2cc8bb];return _0x140e40;};'use strict';var emlformat=require(_0xafa0('0x0'));var rimraf=require(_0xafa0('0x1'));var zipdir=require(_0xafa0('0x2'));var jsonpatch=require(_0xafa0('0x3'));var rp=require(_0xafa0('0x4'));var moment=require('moment');var BPromise=require(_0xafa0('0x5'));var Mustache=require(_0xafa0('0x6'));var util=require('util');var path=require(_0xafa0('0x7'));var sox=require(_0xafa0('0x8'));var csv=require(_0xafa0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafa0('0xa'));var _=require('lodash');var squel=require(_0xafa0('0xb'));var crypto=require(_0xafa0('0xc'));var jsforce=require(_0xafa0('0xd'));var deskjs=require(_0xafa0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xafa0('0xf'));var Papa=require(_0xafa0('0x10'));var Redis=require(_0xafa0('0x11'));var authService=require(_0xafa0('0x12'));var qs=require(_0xafa0('0x13'));var as=require(_0xafa0('0x14'));var hardwareService=require(_0xafa0('0x15'));var logger=require('../../config/logger')(_0xafa0('0x16'));var utils=require(_0xafa0('0x17'));var config=require(_0xafa0('0x18'));var licenseUtil=require(_0xafa0('0x19'));var db=require(_0xafa0('0x1a'))['db'];function respondWithStatusCode(_0x280802,_0x6a841d){_0x6a841d=_0x6a841d||0xcc;return function(_0x316738){if(_0x316738){return _0x280802['sendStatus'](_0x6a841d);}return _0x280802['status'](_0x6a841d)[_0xafa0('0x1b')]();};}function respondWithResult(_0x59de25,_0x142d21){_0x142d21=_0x142d21||0xc8;return function(_0x2172bf){if(_0x2172bf){return _0x59de25['status'](_0x142d21)['json'](_0x2172bf);}};}function respondWithFilteredResult(_0x30615e,_0x45c391){return function(_0x50a326){if(_0x50a326){var _0xa1077b=typeof _0x45c391[_0xafa0('0x1c')]===_0xafa0('0x1d')&&typeof _0x45c391['limit']==='undefined';var _0xd75e65=_0x50a326[_0xafa0('0x1e')];var _0x2364d2=_0xa1077b?0x0:_0x45c391[_0xafa0('0x1c')];var _0x166146=_0xa1077b?_0x50a326[_0xafa0('0x1e')]:_0x45c391[_0xafa0('0x1c')]+_0x45c391[_0xafa0('0x1f')];var _0x301280;if(_0x166146>=_0xd75e65){_0x166146=_0xd75e65;_0x301280=0xc8;}else{_0x301280=0xce;}_0x30615e[_0xafa0('0x20')](_0x301280);return _0x30615e['set']('Content-Range',_0x2364d2+'-'+_0x166146+'/'+_0xd75e65)[_0xafa0('0x21')](_0x50a326);}return null;};}function patchUpdates(_0xd826bd){return function(_0x2b5791){try{jsonpatch[_0xafa0('0x22')](_0x2b5791,_0xd826bd,!![]);}catch(_0x4efc68){return BPromise[_0xafa0('0x23')](_0x4efc68);}return _0x2b5791[_0xafa0('0x24')]();};}function saveUpdates(_0x5e5159,_0x2af25f){return function(_0x42c5c0){if(_0x42c5c0){return _0x42c5c0['update'](_0x5e5159)['then'](function(_0x3f65f3){return _0x3f65f3;});}return null;};}function removeEntity(_0x1eb08b,_0x3d1f18){return function(_0x35d2e6){if(_0x35d2e6){return _0x35d2e6[_0xafa0('0x25')]()[_0xafa0('0x26')](function(){_0x1eb08b[_0xafa0('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x404290,_0x4b30c9){return function(_0xa532a0){if(!_0xa532a0){_0x404290[_0xafa0('0x27')](0x194);}return _0xa532a0;};}function handleError(_0x101d21,_0x2ef387){_0x2ef387=_0x2ef387||0x1f4;return function(_0x345b53){logger[_0xafa0('0x28')](_0x345b53[_0xafa0('0x29')]);if(_0x345b53[_0xafa0('0x2a')]){delete _0x345b53[_0xafa0('0x2a')];}_0x101d21['status'](_0x2ef387)[_0xafa0('0x2b')](_0x345b53);};}exports[_0xafa0('0x2c')]=function(_0xaf9147,_0x1906cd){var _0x1149f3={},_0x4c3670={},_0x953723={'count':0x0,'rows':[]};var _0x243b98=_[_0xafa0('0x2d')](db[_0xafa0('0x2e')][_0xafa0('0x2f')],function(_0x1b0fd3){return{'name':_0x1b0fd3[_0xafa0('0x30')],'type':_0x1b0fd3[_0xafa0('0x31')][_0xafa0('0x32')]};});_0x4c3670[_0xafa0('0x33')]=_[_0xafa0('0x2d')](_0x243b98,'name');_0x4c3670[_0xafa0('0x34')]=_['keys'](_0xaf9147[_0xafa0('0x34')]);_0x4c3670[_0xafa0('0x35')]=_[_0xafa0('0x36')](_0x4c3670[_0xafa0('0x33')],_0x4c3670['query']);_0x1149f3[_0xafa0('0x37')]=_[_0xafa0('0x36')](_0x4c3670[_0xafa0('0x33')],qs['fields'](_0xaf9147[_0xafa0('0x34')][_0xafa0('0x38')]));_0x1149f3['attributes']=_0x1149f3[_0xafa0('0x37')]['length']?_0x1149f3[_0xafa0('0x37')]:_0x4c3670[_0xafa0('0x33')];if(!_0xaf9147[_0xafa0('0x34')][_0xafa0('0x39')](_0xafa0('0x3a'))){_0x1149f3[_0xafa0('0x1f')]=qs[_0xafa0('0x1f')](_0xaf9147[_0xafa0('0x34')][_0xafa0('0x1f')]);_0x1149f3['offset']=qs[_0xafa0('0x1c')](_0xaf9147[_0xafa0('0x34')][_0xafa0('0x1c')]);}_0x1149f3['order']=qs[_0xafa0('0x3b')](_0xaf9147['query'][_0xafa0('0x3b')]);_0x1149f3[_0xafa0('0x3c')]=qs[_0xafa0('0x35')](_[_0xafa0('0x3d')](_0xaf9147[_0xafa0('0x34')],_0x4c3670[_0xafa0('0x35')]),_0x243b98);if(_0xaf9147[_0xafa0('0x34')][_0xafa0('0x3e')]){_0x1149f3['where']=_[_0xafa0('0x3f')](_0x1149f3[_0xafa0('0x3c')],{'$or':_[_0xafa0('0x2d')](_0x243b98,function(_0x5ab1f1){if(_0x5ab1f1[_0xafa0('0x31')]!==_0xafa0('0x40')){var _0x8534fe={};_0x8534fe[_0x5ab1f1[_0xafa0('0x2a')]]={'$like':'%'+_0xaf9147[_0xafa0('0x34')][_0xafa0('0x3e')]+'%'};return _0x8534fe;}})});}_0x1149f3=_[_0xafa0('0x3f')]({},_0x1149f3,_0xaf9147[_0xafa0('0x41')]);var _0x24fae3={'where':_0x1149f3[_0xafa0('0x3c')]};return db[_0xafa0('0x2e')][_0xafa0('0x1e')](_0x24fae3)[_0xafa0('0x26')](function(_0x2af0c2){_0x953723[_0xafa0('0x1e')]=_0x2af0c2;if(_0xaf9147[_0xafa0('0x34')][_0xafa0('0x42')]){_0x1149f3[_0xafa0('0x43')]=[{'all':!![]}];}return db[_0xafa0('0x2e')][_0xafa0('0x44')](_0x1149f3);})[_0xafa0('0x26')](function(_0x256d55){_0x953723[_0xafa0('0x45')]=_0x256d55;return _0x953723;})['then'](respondWithFilteredResult(_0x1906cd,_0x1149f3))['catch'](handleError(_0x1906cd,null));};exports[_0xafa0('0x46')]=function(_0x197b2f,_0x6f69fb){var _0x7b435c={'raw':!![],'where':{'id':_0x197b2f[_0xafa0('0x47')]['id']}},_0x5cd532={};_0x5cd532[_0xafa0('0x33')]=_[_0xafa0('0x48')](db[_0xafa0('0x2e')][_0xafa0('0x2f')]);_0x5cd532[_0xafa0('0x34')]=_[_0xafa0('0x48')](_0x197b2f[_0xafa0('0x34')]);_0x5cd532[_0xafa0('0x35')]=_[_0xafa0('0x36')](_0x5cd532[_0xafa0('0x33')],_0x5cd532[_0xafa0('0x34')]);_0x7b435c[_0xafa0('0x37')]=_[_0xafa0('0x36')](_0x5cd532[_0xafa0('0x33')],qs[_0xafa0('0x38')](_0x197b2f[_0xafa0('0x34')][_0xafa0('0x38')]));_0x7b435c[_0xafa0('0x37')]=_0x7b435c[_0xafa0('0x37')][_0xafa0('0x49')]?_0x7b435c['attributes']:_0x5cd532[_0xafa0('0x33')];if(_0x197b2f[_0xafa0('0x34')][_0xafa0('0x42')]){_0x7b435c['include']=[{'all':!![]}];}_0x7b435c=_['merge']({},_0x7b435c,_0x197b2f[_0xafa0('0x41')]);return db[_0xafa0('0x2e')][_0xafa0('0x4a')](_0x7b435c)[_0xafa0('0x26')](handleEntityNotFound(_0x6f69fb,null))['then'](respondWithResult(_0x6f69fb,null))[_0xafa0('0x4b')](handleError(_0x6f69fb,null));};exports[_0xafa0('0x4c')]=function(_0x241eb6,_0x17b35e){return db[_0xafa0('0x2e')][_0xafa0('0x4c')](_0x241eb6[_0xafa0('0x4d')],{})[_0xafa0('0x26')](respondWithResult(_0x17b35e,0xc9))[_0xafa0('0x4b')](handleError(_0x17b35e,null));};exports['update']=function(_0x23fe04,_0xa7cc3e){if(_0x23fe04[_0xafa0('0x4d')]['id']){delete _0x23fe04['body']['id'];}return db[_0xafa0('0x2e')][_0xafa0('0x4a')]({'where':{'id':_0x23fe04['params']['id']}})[_0xafa0('0x26')](handleEntityNotFound(_0xa7cc3e,null))['then'](saveUpdates(_0x23fe04[_0xafa0('0x4d')],null))[_0xafa0('0x26')](respondWithResult(_0xa7cc3e,null))[_0xafa0('0x4b')](handleError(_0xa7cc3e,null));};exports[_0xafa0('0x25')]=function(_0x33f555,_0x4dfeb5){return db[_0xafa0('0x2e')][_0xafa0('0x4a')]({'where':{'id':_0x33f555[_0xafa0('0x47')]['id']}})[_0xafa0('0x26')](handleEntityNotFound(_0x4dfeb5,null))[_0xafa0('0x26')](removeEntity(_0x4dfeb5,null))[_0xafa0('0x4b')](handleError(_0x4dfeb5,null));}; \ No newline at end of file +var _0x90c3=['save','update','then','destroy','sendStatus','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','length','create','body','find','eml-format','rimraf','zip-dir','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','apply','reject'];(function(_0x404f57,_0x2a468c){var _0xdeb5e9=function(_0x402e13){while(--_0x402e13){_0x404f57['push'](_0x404f57['shift']());}};_0xdeb5e9(++_0x2a468c);}(_0x90c3,0xbd));var _0x390c=function(_0x18229f,_0x2f70e1){_0x18229f=_0x18229f-0x0;var _0x290070=_0x90c3[_0x18229f];return _0x290070;};'use strict';var emlformat=require(_0x390c('0x0'));var rimraf=require(_0x390c('0x1'));var zipdir=require(_0x390c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x390c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x390c('0x4'));var path=require('path');var sox=require(_0x390c('0x5'));var csv=require(_0x390c('0x6'));var ejs=require(_0x390c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x390c('0x8'));var squel=require(_0x390c('0x9'));var crypto=require(_0x390c('0xa'));var jsforce=require(_0x390c('0xb'));var deskjs=require(_0x390c('0xc'));var toCsv=require(_0x390c('0x6'));var querystring=require(_0x390c('0xd'));var Papa=require(_0x390c('0xe'));var Redis=require('ioredis');var authService=require(_0x390c('0xf'));var qs=require(_0x390c('0x10'));var as=require(_0x390c('0x11'));var hardwareService=require(_0x390c('0x12'));var logger=require(_0x390c('0x13'))('api');var utils=require(_0x390c('0x14'));var config=require(_0x390c('0x15'));var licenseUtil=require(_0x390c('0x16'));var db=require(_0x390c('0x17'))['db'];function respondWithStatusCode(_0x156df6,_0x4a19df){_0x4a19df=_0x4a19df||0xcc;return function(_0x14f913){if(_0x14f913){return _0x156df6['sendStatus'](_0x4a19df);}return _0x156df6['status'](_0x4a19df)[_0x390c('0x18')]();};}function respondWithResult(_0x3269a5,_0x2403f8){_0x2403f8=_0x2403f8||0xc8;return function(_0x39fca2){if(_0x39fca2){return _0x3269a5[_0x390c('0x19')](_0x2403f8)[_0x390c('0x1a')](_0x39fca2);}};}function respondWithFilteredResult(_0xda1026,_0x21e793){return function(_0x5ad039){if(_0x5ad039){var _0xabd216=typeof _0x21e793[_0x390c('0x1b')]===_0x390c('0x1c')&&typeof _0x21e793[_0x390c('0x1d')]===_0x390c('0x1c');var _0x13c8a3=_0x5ad039['count'];var _0x52f71f=_0xabd216?0x0:_0x21e793[_0x390c('0x1b')];var _0x44e5e1=_0xabd216?_0x5ad039['count']:_0x21e793[_0x390c('0x1b')]+_0x21e793[_0x390c('0x1d')];var _0x36b176;if(_0x44e5e1>=_0x13c8a3){_0x44e5e1=_0x13c8a3;_0x36b176=0xc8;}else{_0x36b176=0xce;}_0xda1026[_0x390c('0x19')](_0x36b176);return _0xda1026[_0x390c('0x1e')]('Content-Range',_0x52f71f+'-'+_0x44e5e1+'/'+_0x13c8a3)[_0x390c('0x1a')](_0x5ad039);}return null;};}function patchUpdates(_0x33718a){return function(_0x59adfc){try{jsonpatch[_0x390c('0x1f')](_0x59adfc,_0x33718a,!![]);}catch(_0x44b36b){return BPromise[_0x390c('0x20')](_0x44b36b);}return _0x59adfc[_0x390c('0x21')]();};}function saveUpdates(_0xfaae28,_0x2fa787){return function(_0x3da9c2){if(_0x3da9c2){return _0x3da9c2[_0x390c('0x22')](_0xfaae28)[_0x390c('0x23')](function(_0x566baf){return _0x566baf;});}return null;};}function removeEntity(_0x57c1a5,_0x4ffb2c){return function(_0x5350b4){if(_0x5350b4){return _0x5350b4[_0x390c('0x24')]()[_0x390c('0x23')](function(){_0x57c1a5[_0x390c('0x19')](0xcc)[_0x390c('0x18')]();});}};}function handleEntityNotFound(_0x46e0de,_0x104719){return function(_0x211184){if(!_0x211184){_0x46e0de[_0x390c('0x25')](0x194);}return _0x211184;};}function handleError(_0x3892f5,_0x4cb2c0){_0x4cb2c0=_0x4cb2c0||0x1f4;return function(_0x1c81c2){logger[_0x390c('0x26')](_0x1c81c2[_0x390c('0x27')]);if(_0x1c81c2[_0x390c('0x28')]){delete _0x1c81c2[_0x390c('0x28')];}_0x3892f5[_0x390c('0x19')](_0x4cb2c0)['send'](_0x1c81c2);};}exports[_0x390c('0x29')]=function(_0x3a92b3,_0x1cc006){var _0x517a51={},_0x18d48b={},_0x3ff784={'count':0x0,'rows':[]};var _0x333bea=_[_0x390c('0x2a')](db[_0x390c('0x2b')][_0x390c('0x2c')],function(_0x111392){return{'name':_0x111392[_0x390c('0x2d')],'type':_0x111392[_0x390c('0x2e')][_0x390c('0x2f')]};});_0x18d48b['model']=_[_0x390c('0x2a')](_0x333bea,_0x390c('0x28'));_0x18d48b[_0x390c('0x30')]=_[_0x390c('0x31')](_0x3a92b3[_0x390c('0x30')]);_0x18d48b[_0x390c('0x32')]=_['intersection'](_0x18d48b[_0x390c('0x33')],_0x18d48b[_0x390c('0x30')]);_0x517a51[_0x390c('0x34')]=_[_0x390c('0x35')](_0x18d48b[_0x390c('0x33')],qs[_0x390c('0x36')](_0x3a92b3['query']['fields']));_0x517a51[_0x390c('0x34')]=_0x517a51[_0x390c('0x34')]['length']?_0x517a51[_0x390c('0x34')]:_0x18d48b['model'];if(!_0x3a92b3['query'][_0x390c('0x37')](_0x390c('0x38'))){_0x517a51[_0x390c('0x1d')]=qs['limit'](_0x3a92b3['query'][_0x390c('0x1d')]);_0x517a51[_0x390c('0x1b')]=qs[_0x390c('0x1b')](_0x3a92b3[_0x390c('0x30')][_0x390c('0x1b')]);}_0x517a51['order']=qs[_0x390c('0x39')](_0x3a92b3[_0x390c('0x30')][_0x390c('0x39')]);_0x517a51[_0x390c('0x3a')]=qs[_0x390c('0x32')](_[_0x390c('0x3b')](_0x3a92b3[_0x390c('0x30')],_0x18d48b[_0x390c('0x32')]),_0x333bea);if(_0x3a92b3[_0x390c('0x30')][_0x390c('0x3c')]){_0x517a51[_0x390c('0x3a')]=_[_0x390c('0x3d')](_0x517a51['where'],{'$or':_[_0x390c('0x2a')](_0x333bea,function(_0x20c1a0){if(_0x20c1a0[_0x390c('0x2e')]!=='VIRTUAL'){var _0x3c5684={};_0x3c5684[_0x20c1a0[_0x390c('0x28')]]={'$like':'%'+_0x3a92b3['query'][_0x390c('0x3c')]+'%'};return _0x3c5684;}})});}_0x517a51=_[_0x390c('0x3d')]({},_0x517a51,_0x3a92b3[_0x390c('0x3e')]);var _0x27d4c4={'where':_0x517a51[_0x390c('0x3a')]};return db[_0x390c('0x2b')]['count'](_0x27d4c4)[_0x390c('0x23')](function(_0xf6237){_0x3ff784[_0x390c('0x3f')]=_0xf6237;if(_0x3a92b3[_0x390c('0x30')][_0x390c('0x40')]){_0x517a51[_0x390c('0x41')]=[{'all':!![]}];}return db['SmsApplication'][_0x390c('0x42')](_0x517a51);})[_0x390c('0x23')](function(_0x3764e6){_0x3ff784['rows']=_0x3764e6;return _0x3ff784;})[_0x390c('0x23')](respondWithFilteredResult(_0x1cc006,_0x517a51))[_0x390c('0x43')](handleError(_0x1cc006,null));};exports[_0x390c('0x44')]=function(_0x4cd377,_0x3f4294){var _0x56b391={'raw':!![],'where':{'id':_0x4cd377[_0x390c('0x45')]['id']}},_0x282b54={};_0x282b54[_0x390c('0x33')]=_['keys'](db[_0x390c('0x2b')][_0x390c('0x2c')]);_0x282b54[_0x390c('0x30')]=_[_0x390c('0x31')](_0x4cd377[_0x390c('0x30')]);_0x282b54[_0x390c('0x32')]=_['intersection'](_0x282b54[_0x390c('0x33')],_0x282b54[_0x390c('0x30')]);_0x56b391['attributes']=_[_0x390c('0x35')](_0x282b54['model'],qs[_0x390c('0x36')](_0x4cd377['query'][_0x390c('0x36')]));_0x56b391['attributes']=_0x56b391[_0x390c('0x34')][_0x390c('0x46')]?_0x56b391[_0x390c('0x34')]:_0x282b54[_0x390c('0x33')];if(_0x4cd377['query'][_0x390c('0x40')]){_0x56b391[_0x390c('0x41')]=[{'all':!![]}];}_0x56b391=_[_0x390c('0x3d')]({},_0x56b391,_0x4cd377['options']);return db[_0x390c('0x2b')]['find'](_0x56b391)[_0x390c('0x23')](handleEntityNotFound(_0x3f4294,null))[_0x390c('0x23')](respondWithResult(_0x3f4294,null))[_0x390c('0x43')](handleError(_0x3f4294,null));};exports[_0x390c('0x47')]=function(_0x425681,_0x3b9cdc){return db[_0x390c('0x2b')]['create'](_0x425681[_0x390c('0x48')],{})[_0x390c('0x23')](respondWithResult(_0x3b9cdc,0xc9))[_0x390c('0x43')](handleError(_0x3b9cdc,null));};exports['update']=function(_0x12050a,_0x211340){if(_0x12050a[_0x390c('0x48')]['id']){delete _0x12050a[_0x390c('0x48')]['id'];}return db[_0x390c('0x2b')][_0x390c('0x49')]({'where':{'id':_0x12050a[_0x390c('0x45')]['id']}})[_0x390c('0x23')](handleEntityNotFound(_0x211340,null))[_0x390c('0x23')](saveUpdates(_0x12050a[_0x390c('0x48')],null))[_0x390c('0x23')](respondWithResult(_0x211340,null))['catch'](handleError(_0x211340,null));};exports['destroy']=function(_0x19ad77,_0x29fa44){return db[_0x390c('0x2b')][_0x390c('0x49')]({'where':{'id':_0x19ad77[_0x390c('0x45')]['id']}})[_0x390c('0x23')](handleEntityNotFound(_0x29fa44,null))[_0x390c('0x23')](removeEntity(_0x29fa44,null))['catch'](handleError(_0x29fa44,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ce6fbd5..b852eb0 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 _0x5bb0=['exports','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x319bfd,_0x390591){var _0x4a85ed=function(_0x16652c){while(--_0x16652c){_0x319bfd['push'](_0x319bfd['shift']());}};_0x4a85ed(++_0x390591);}(_0x5bb0,0x16f));var _0x05bb=function(_0x17af64,_0xccf925){_0x17af64=_0x17af64-0x0;var _0x5de38c=_0x5bb0[_0x17af64];return _0x5de38c;};'use strict';var _=require(_0x05bb('0x0'));var util=require(_0x05bb('0x1'));var logger=require(_0x05bb('0x2'))(_0x05bb('0x3'));var moment=require(_0x05bb('0x4'));var BPromise=require(_0x05bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05bb('0x6'));var rimraf=require(_0x05bb('0x7'));var config=require(_0x05bb('0x8'));var attributes=require(_0x05bb('0x9'));module[_0x05bb('0xa')]=function(_0x3af485,_0x4550ee){return _0x3af485['define']('SmsApplication',attributes,{'tableName':_0x05bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05bb('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0ee7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ee7,0xe3));var _0x70ee=function(_0x19f8b6,_0x2b4e8c){_0x19f8b6=_0x19f8b6-0x0;var _0x213ebc=_0x0ee7[_0x19f8b6];return _0x213ebc;};'use strict';var _=require(_0x70ee('0x0'));var util=require(_0x70ee('0x1'));var logger=require(_0x70ee('0x2'))(_0x70ee('0x3'));var moment=require(_0x70ee('0x4'));var BPromise=require(_0x70ee('0x5'));var rp=require(_0x70ee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70ee('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x70ee('0x8')]=function(_0x58b388,_0x15eed0){return _0x58b388[_0x70ee('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x70ee('0xa'),'collate':_0x70ee('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 696df52..b088e30 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 _0x5eed=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3c7f1b,_0x43b3d0){var _0x525f59=function(_0x4e5585){while(--_0x4e5585){_0x3c7f1b['push'](_0x3c7f1b['shift']());}};_0x525f59(++_0x43b3d0);}(_0x5eed,0x10a));var _0xd5ee=function(_0x1ea17e,_0x5afb9f){_0x1ea17e=_0x1ea17e-0x0;var _0x2756d4=_0x5eed[_0x1ea17e];return _0x2756d4;};'use strict';var _=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var moment=require(_0xd5ee('0x2'));var BPromise=require(_0xd5ee('0x3'));var rs=require(_0xd5ee('0x4'));var fs=require('fs');var Redis=require(_0xd5ee('0x5'));var db=require(_0xd5ee('0x6'))['db'];var utils=require(_0xd5ee('0x7'));var logger=require(_0xd5ee('0x8'))(_0xd5ee('0x9'));var config=require('../../config/environment');var jayson=require(_0xd5ee('0xa'));var client=jayson[_0xd5ee('0xb')][_0xd5ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38b0e3,_0x458212,_0x181790){return new BPromise(function(_0x162bb5,_0x217e70){return client['request'](_0x38b0e3,_0x181790)['then'](function(_0x4e6495){logger[_0xd5ee('0xd')](_0xd5ee('0xe'),_0x458212,_0xd5ee('0xf'));logger[_0xd5ee('0x10')](_0xd5ee('0x11'),_0x458212,_0xd5ee('0xf'),JSON[_0xd5ee('0x12')](_0x4e6495));if(_0x4e6495[_0xd5ee('0x13')]){if(_0x4e6495['error'][_0xd5ee('0x14')]===0x1f4){logger[_0xd5ee('0x13')]('SmsApplication,\x20%s,\x20%s',_0x458212,_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);return _0x217e70(_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);}logger[_0xd5ee('0x13')]('SmsApplication,\x20%s,\x20%s',_0x458212,_0x4e6495['error']['message']);return _0x162bb5(_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x458212,_0xd5ee('0xf'));_0x162bb5(_0x4e6495[_0xd5ee('0x16')]['message']);}})[_0xd5ee('0x17')](function(_0x460f22){logger[_0xd5ee('0x13')](_0xd5ee('0xe'),_0x458212,_0x460f22);_0x217e70(_0x460f22);});});} \ No newline at end of file +var _0x8cda=['../../config/environment','client','http','request','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('SmsApplication,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b78ea0b..1dd2ab6 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 _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0xc35b34,_0x314794){var _0x37c016=function(_0x4ebadf){while(--_0x4ebadf){_0xc35b34['push'](_0xc35b34['shift']());}};_0x37c016(++_0x314794);}(_0xea28,0x13a));var _0x8ea2=function(_0x3ff518,_0x60d0d4){_0x3ff518=_0x3ff518-0x0;var _0x4ff3e2=_0xea28[_0x3ff518];return _0x4ff3e2;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router; \ No newline at end of file +var _0x93e9=['update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x301b92,_0x19b335){var _0x4ae712=function(_0x52d89b){while(--_0x52d89b){_0x301b92['push'](_0x301b92['shift']());}};_0x4ae712(++_0x19b335);}(_0x93e9,0xcc));var _0x993e=function(_0xa0b432,_0x55f6c9){_0xa0b432=_0xa0b432-0x0;var _0x4a35ed=_0x93e9[_0xa0b432];return _0x4a35ed;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getMessages']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x993e('0x11')]('/',auth['isAuthenticated'](),controller[_0x993e('0x12')]);router['post']('/:id/messages',auth[_0x993e('0xa')](),controller[_0x993e('0x13')]);router[_0x993e('0x11')](_0x993e('0x14'),auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x17')),controller[_0x993e('0x18')]);router[_0x993e('0x19')](_0x993e('0xd'),auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x1a')),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')]('/:id',auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x1d')),controller[_0x993e('0x1e')]);router[_0x993e('0x1c')]('/:id/tags',auth[_0x993e('0xa')](),controller[_0x993e('0x1f')]);module[_0x993e('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b4bdbeb..f671b18 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 _0x7edb=['out','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x21bd75,_0x5bc5dc){var _0x7da7ba=function(_0x549f1f){while(--_0x549f1f){_0x21bd75['push'](_0x21bd75['shift']());}};_0x7da7ba(++_0x5bc5dc);}(_0x7edb,0x158));var _0xb7ed=function(_0x1b3311,_0x88ea69){_0x1b3311=_0x1b3311-0x0;var _0x2350fa=_0x7edb[_0x1b3311];return _0x2350fa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb7ed('0x0'));module[_0xb7ed('0x1')]={'closed':{'type':Sequelize[_0xb7ed('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb7ed('0x3')]},'disposition':{'type':Sequelize[_0xb7ed('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb7ed('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb7ed('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb7ed('0x5')]('in',_0xb7ed('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7ed('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb7ed('0x5')]('in',_0xb7ed('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb7ed('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x23f4=['DATE','STRING','ENUM','out','moment'];(function(_0x390cf3,_0x5e5863){var _0x4baa33=function(_0x5370c9){while(--_0x5370c9){_0x390cf3['push'](_0x390cf3['shift']());}};_0x4baa33(++_0x5e5863);}(_0x23f4,0x1ee));var _0x423f=function(_0x45e7bf,_0x4e68c4){_0x45e7bf=_0x45e7bf-0x0;var _0x60d281=_0x23f4[_0x45e7bf];return _0x60d281;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x423f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x423f('0x1')]},'disposition':{'type':Sequelize[_0x423f('0x2')]},'secondDisposition':{'type':Sequelize[_0x423f('0x2')]},'thirdDisposition':{'type':Sequelize[_0x423f('0x2')]},'note':{'type':Sequelize[_0x423f('0x2')]},'phone':{'type':Sequelize[_0x423f('0x2')]},'read1stAt':{'type':Sequelize[_0x423f('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x423f('0x3')]('in',_0x423f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x423f('0x3')]('in',_0x423f('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 273c6ec..8f6b55f 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 _0xd8df=['operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','keys','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','null','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','order','DESC','t.id\x20IN\x20?','resolve','then','SmsAccountId','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','setTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','CmContact','Contact','lastName','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','Sms','closedAt','out','System','firstName','secret','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','status','end','json','undefined','count','offset','limit','apply','reject','save','update','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','total','UserId','closed','answered','index','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd8df,0x163));var _0xfd8d=function(_0x1d370d,_0x2aae43){_0x1d370d=_0x1d370d-0x0;var _0x87aa91=_0xd8df[_0x1d370d];return _0x87aa91;};'use strict';var emlformat=require(_0xfd8d('0x0'));var rimraf=require(_0xfd8d('0x1'));var zipdir=require(_0xfd8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfd8d('0x3'));var Mustache=require(_0xfd8d('0x4'));var util=require(_0xfd8d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfd8d('0x6'));var ejs=require(_0xfd8d('0x7'));var fs=require('fs');var fs_extra=require(_0xfd8d('0x8'));var _=require(_0xfd8d('0x9'));var squel=require(_0xfd8d('0xa'));var crypto=require(_0xfd8d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfd8d('0xc'));var toCsv=require(_0xfd8d('0x6'));var querystring=require(_0xfd8d('0xd'));var Papa=require('papaparse');var Redis=require(_0xfd8d('0xe'));var authService=require(_0xfd8d('0xf'));var qs=require(_0xfd8d('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfd8d('0x11'));var hardwareService=require(_0xfd8d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfd8d('0x13'));var config=require(_0xfd8d('0x14'));var licenseUtil=require(_0xfd8d('0x15'));var db=require('../../mysqldb')['db'];config[_0xfd8d('0x16')]=_[_0xfd8d('0x17')](config[_0xfd8d('0x16')],{'host':_0xfd8d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0xfd8d('0x19')](socket);function respondWithStatusCode(_0x4259ae,_0x467951){_0x467951=_0x467951||0xcc;return function(_0x4d18e1){if(_0x4d18e1){return _0x4259ae['sendStatus'](_0x467951);}return _0x4259ae[_0xfd8d('0x1a')](_0x467951)[_0xfd8d('0x1b')]();};}function respondWithResult(_0x3926e3,_0x369a24){_0x369a24=_0x369a24||0xc8;return function(_0x734e8f){if(_0x734e8f){return _0x3926e3[_0xfd8d('0x1a')](_0x369a24)[_0xfd8d('0x1c')](_0x734e8f);}};}function respondWithFilteredResult(_0x50d11b,_0x22edcf){return function(_0x2ec838){if(_0x2ec838){var _0x202293=typeof _0x22edcf['offset']===_0xfd8d('0x1d')&&typeof _0x22edcf['limit']===_0xfd8d('0x1d');var _0x16f6f=_0x2ec838[_0xfd8d('0x1e')];var _0x507d4f=_0x202293?0x0:_0x22edcf[_0xfd8d('0x1f')];var _0x53a489=_0x202293?_0x2ec838['count']:_0x22edcf[_0xfd8d('0x1f')]+_0x22edcf[_0xfd8d('0x20')];var _0x317f54;if(_0x53a489>=_0x16f6f){_0x53a489=_0x16f6f;_0x317f54=0xc8;}else{_0x317f54=0xce;}_0x50d11b['status'](_0x317f54);return _0x50d11b['set']('Content-Range',_0x507d4f+'-'+_0x53a489+'/'+_0x16f6f)[_0xfd8d('0x1c')](_0x2ec838);}return null;};}function patchUpdates(_0x55abfb){return function(_0x5ae4ab){try{jsonpatch[_0xfd8d('0x21')](_0x5ae4ab,_0x55abfb,!![]);}catch(_0x13f695){return BPromise[_0xfd8d('0x22')](_0x13f695);}return _0x5ae4ab[_0xfd8d('0x23')]();};}function saveUpdates(_0x41765a,_0x3470b5){return function(_0x275faa){if(_0x275faa){return _0x275faa[_0xfd8d('0x24')](_0x41765a)['then'](function(_0x54396f){return _0x54396f;});}return null;};}function removeEntity(_0x546828,_0x272182){return function(_0x17adf4){if(_0x17adf4){return _0x17adf4['destroy']()['then'](function(){_0x546828[_0xfd8d('0x1a')](0xcc)[_0xfd8d('0x1b')]();});}};}function handleEntityNotFound(_0x3249d4,_0x459914){return function(_0x4cd33e){if(!_0x4cd33e){_0x3249d4['sendStatus'](0x194);}return _0x4cd33e;};}function handleError(_0x4c98ea,_0x240864){_0x240864=_0x240864||0x1f4;return function(_0x15b08c){logger['error'](_0x15b08c[_0xfd8d('0x25')]);if(_0x15b08c['name']){delete _0x15b08c[_0xfd8d('0x26')];}_0x4c98ea[_0xfd8d('0x1a')](_0x240864)[_0xfd8d('0x27')](_0x15b08c);};}function getInteractionUsers(_0x2bd8df,_0x14c84c){return new BPromise(function(_0x527842,_0x1e00ce){try{if(_0x14c84c[_0x2bd8df['id']]){_0x2bd8df[_0xfd8d('0x28')]=_['map'](_0x14c84c[_0x2bd8df['id']],function(_0x4c2f6d){return{'id':_0x4c2f6d['id'],'fullname':_0x4c2f6d[_0xfd8d('0x29')]};});}}catch(_0x3592fb){_0x1e00ce(_0x3592fb);}_0x527842(_0x2bd8df);});}function getInteractionTags(_0x41270d,_0x4f29a9){return new BPromise(function(_0x587772,_0xb4f887){try{if(_0x41270d[_0xfd8d('0x2a')]){_0x41270d[_0xfd8d('0x2b')]=[];_0x41270d[_0xfd8d('0x2a')][_0xfd8d('0x2c')](',')[_0xfd8d('0x2d')](function(_0x16dc72){_0x41270d[_0xfd8d('0x2b')][_0xfd8d('0x2e')](_0x4f29a9[_0x16dc72]);});}delete _0x41270d[_0xfd8d('0x2a')];}catch(_0xe91dd3){_0xb4f887(_0xe91dd3);}_0x587772(_0x41270d);});}function updateSmsInteraction(_0x3f5c11,_0x59fbee,_0x25b677){return new BPromise(function(_0x49a037,_0x54adbf){return getInteractionUsers(_0x3f5c11,_0x25b677)['then'](function(_0x52680f){return getInteractionTags(_0x52680f,_0x59fbee);})['then'](function(_0x17deb3){return getStateInteraction(_0x17deb3);})['then'](function(_0x6ebbda){_0x49a037(_0x6ebbda);})[_0xfd8d('0x2f')](function(_0x1bd3a4){_0x54adbf(_0x1bd3a4);});});}function getStateInteraction(_0x573044){return new BPromise(function(_0x437b8c){_0x573044[_0xfd8d('0x30')]=0x0;_0x573044[_0xfd8d('0x31')]=0x0;_0x573044['answered']=0x0;_0x573044['unmanaged']=0x0;_0x573044[_0xfd8d('0x32')]=0x0;if(!_0x573044['closed']&&!_0x573044[_0xfd8d('0x33')]){_0x573044['waiting']+=0x1;}if(!_0x573044[_0xfd8d('0x34')]&&_0x573044[_0xfd8d('0x33')]){_0x573044[_0xfd8d('0x31')]+=0x1;if(_0x573044['waiting']){_0x573044[_0xfd8d('0x30')]-=0x1;}}if(_0x573044[_0xfd8d('0x34')]&&_0x573044[_0xfd8d('0x33')]){_0x573044[_0xfd8d('0x35')]+=0x1;if(_0x573044['talking']){_0x573044[_0xfd8d('0x31')]-=0x1;}}if(_0x573044[_0xfd8d('0x34')]&&!_0x573044[_0xfd8d('0x33')]){_0x573044['unmanaged']+=0x1;if(_0x573044[_0xfd8d('0x30')]){_0x573044[_0xfd8d('0x30')]-=0x1;}}_0x573044['total']+=0x1;_0x437b8c(_0x573044);});}exports[_0xfd8d('0x36')]=function(_0x2f30ac,_0x5dfdc3){var _0x1db7bd={},_0x4c5fea={},_0x5879d6={'count':0x0,'rows':[]};var _0x511cb1=_[_0xfd8d('0x37')](db[_0xfd8d('0x38')][_0xfd8d('0x39')],function(_0x1ba1a4){return{'name':_0x1ba1a4[_0xfd8d('0x3a')],'type':_0x1ba1a4[_0xfd8d('0x3b')][_0xfd8d('0x3c')]};});_0x4c5fea[_0xfd8d('0x3d')]=_[_0xfd8d('0x37')](_0x511cb1,'name');_0x4c5fea['query']=_['keys'](_0x2f30ac[_0xfd8d('0x3e')]);_0x4c5fea['filters']=_['intersection'](_0x4c5fea[_0xfd8d('0x3d')],_0x4c5fea['query']);_0x1db7bd[_0xfd8d('0x3f')]=_[_0xfd8d('0x40')](_0x4c5fea[_0xfd8d('0x3d')],qs['fields'](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x41')]));_0x1db7bd['attributes']=_0x1db7bd[_0xfd8d('0x3f')][_0xfd8d('0x42')]?_0x1db7bd['attributes']:_0x4c5fea['model'];if(!_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x43')]('nolimit')){_0x1db7bd[_0xfd8d('0x20')]=qs[_0xfd8d('0x20')](_0x2f30ac[_0xfd8d('0x3e')]['limit']);_0x1db7bd[_0xfd8d('0x1f')]=qs['offset'](_0x2f30ac[_0xfd8d('0x3e')]['offset']);}_0x1db7bd['order']=qs['sort'](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x44')]);_0x1db7bd[_0xfd8d('0x45')]=qs[_0xfd8d('0x46')](_[_0xfd8d('0x47')](_0x2f30ac[_0xfd8d('0x3e')],_0x4c5fea['filters']),_0x511cb1);var _0x3b112f=[];var _0x23b717=squel[_0xfd8d('0x48')]()[_0xfd8d('0x49')]('id')[_0xfd8d('0x49')](_0xfd8d('0x26'))[_0xfd8d('0x49')]('color')[_0xfd8d('0x4a')](_0xfd8d('0x4b'));var _0x3ace9d=squel['select']()['field'](_0xfd8d('0x4c'))[_0xfd8d('0x49')](_0xfd8d('0x4d'))[_0xfd8d('0x49')](_0xfd8d('0x4e'))[_0xfd8d('0x4a')](_0xfd8d('0x4f'),'ui')[_0xfd8d('0x50')]('users','u','u.id\x20=\x20ui.UserId');var _0x5ef9c7=squel[_0xfd8d('0x48')]()[_0xfd8d('0x4a')]('sms_interactions','i')[_0xfd8d('0x50')](_0xfd8d('0x51'),'c',_0xfd8d('0x52'))['left_join'](_0xfd8d('0x53'),'o',_0xfd8d('0x54'))[_0xfd8d('0x50')](_0xfd8d('0x55'),'a',_0xfd8d('0x56'))[_0xfd8d('0x50')](_0xfd8d('0x57'),'me',_0xfd8d('0x58'))['left_join'](_0xfd8d('0x59'),'it',_0xfd8d('0x5a'))[_0xfd8d('0x50')](_0xfd8d('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x65aa60=squel[_0xfd8d('0x5b')]();var _0x51a061=[];var _0x33857a=squel['expr']();var _0x3b0c7e;if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x5c')]){_0x3b0c7e=as[_0xfd8d('0x5d')](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x5c')]);var _0x560e74=_0x3b0c7e[_0xfd8d('0x5e')];for(var _0x3404e8=0x0;_0x3404e8<_0x3b0c7e['conditions'][_0xfd8d('0x42')];_0x3404e8++){var _0x59b267=_0x3b0c7e[_0xfd8d('0x5f')][_0x3404e8];var _0x39efa0='i';var _0xe0ca30=_[_0xfd8d('0x60')](_0x511cb1,[_0xfd8d('0x26'),_0x59b267['field']]);if(!_0xe0ca30){switch(_0x59b267['field']){case _0xfd8d('0x61'):if(_0x59b267[_0xfd8d('0x62')]==0x1){_0x5ef9c7[_0xfd8d('0x63')]('`'+_0x59b267['field']+_0xfd8d('0x64'));}else{_0x5ef9c7[_0xfd8d('0x63')]('`'+_0x59b267['field']+'`\x20>\x200');}break;case'Contact':if(_0x59b267[_0xfd8d('0x65')]===_0xfd8d('0x66')){if(_0x59b267['value'][_0xfd8d('0x2c')]('\x20')[_0xfd8d('0x42')]>0x1){_0x65aa60[_0x560e74]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfd8d('0x67')](_0x59b267[_0xfd8d('0x62')]),null);}else{var _0x315c96='%'+_0x59b267[_0xfd8d('0x62')]+'%';_0x65aa60[_0x560e74](_0xfd8d('0x68'),_0x315c96,_0x315c96,_0x315c96);}}else{_0xe0ca30=_['find'](_0x511cb1,[_0xfd8d('0x26'),_0xfd8d('0x69')]);_0x59b267['field']='ContactId';_0x42d893=as['buildExpression'](_0x39efa0,_0xe0ca30['type'],_0x59b267);_0x65aa60[_0x560e74](_0x42d893[_0xfd8d('0x6a')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x6b')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x1b')]);}break;case _0xfd8d('0x6c'):var _0x50ad62=_0x59b267[_0xfd8d('0x62')][_0xfd8d('0x2c')](',')[_0xfd8d('0x37')](function(_0x395fa8){return Number(_0x395fa8);});_0x50ad62[_0xfd8d('0x2d')](function(_0x4991df){_0x33857a['or'](_0xfd8d('0x6d'),'%,'+_0x4991df+',%');});_0x51a061=_[_0xfd8d('0x6e')](_0x51a061,_0x50ad62);break;case _0xfd8d('0x6f'):if(_0x59b267[_0xfd8d('0x65')]===_0xfd8d('0x66')){_0x65aa60[_0x560e74](_0xfd8d('0x70'),'%'+_0x59b267['value']+'%',null);}else{_0xe0ca30=_[_0xfd8d('0x60')](_0x511cb1,[_0xfd8d('0x26'),_0xfd8d('0x33')]);_0x59b267[_0xfd8d('0x49')]=_0xfd8d('0x33');_0x42d893=as['buildExpression'](_0x39efa0,_0xe0ca30[_0xfd8d('0x3b')],_0x59b267);_0x65aa60[_0x560e74](_0x42d893['text'],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x6b')],_0x42d893[_0xfd8d('0x62')]['end']);}break;case _0xfd8d('0x71'):_0x42d893=as[_0xfd8d('0x72')]('me',null,_0x59b267);_0x65aa60[_0x560e74](_0x42d893[_0xfd8d('0x6a')],_0x42d893['value'][_0xfd8d('0x6b')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x1b')]);break;}}else{var _0x42d893=as[_0xfd8d('0x72')](_0x39efa0,_0xe0ca30[_0xfd8d('0x3b')],_0x59b267);_0x65aa60[_0x560e74](_0x42d893[_0xfd8d('0x6a')],_0x42d893[_0xfd8d('0x62')][_0xfd8d('0x6b')],_0x42d893['value'][_0xfd8d('0x1b')]);}}}else{var _0x3b10d8=_(_0x2f30ac[_0xfd8d('0x3e')])[_0xfd8d('0x73')]()[_0xfd8d('0x37')](function(_0xa06fd3){return _['some'](_0x511cb1,['name',_0xa06fd3])?_0xa06fd3:undefined;})['compact']()[_0xfd8d('0x62')]();if(!_[_0xfd8d('0x74')](_0x3b10d8)){_0x3b10d8[_0xfd8d('0x2d')](function(_0x23c863){if(_0x23c863==='SmsAccountId'){_0x5ef9c7[_0xfd8d('0x45')](_0xfd8d('0x75'),[]['concat'](_0x2f30ac[_0xfd8d('0x3e')][_0x23c863]));}else if(_0x23c863===_0xfd8d('0x76')){var _0x12a8c8=JSON[_0xfd8d('0x77')](_0x2f30ac[_0xfd8d('0x3e')][_0x23c863])[_0xfd8d('0x78')];var _0x4729c9=JSON[_0xfd8d('0x77')](_0x2f30ac[_0xfd8d('0x3e')][_0x23c863])['$lte'];_0x5ef9c7[_0xfd8d('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12a8c8,_0x4729c9);}else{if(_0x2f30ac[_0xfd8d('0x3e')][_0x23c863]===_0xfd8d('0x79')){_0x5ef9c7[_0xfd8d('0x45')]('i.'+_0x23c863+'\x20IS\x20NULL');}else{_0x5ef9c7[_0xfd8d('0x45')]('i.'+_0x23c863+'\x20=\x20?',_0x2f30ac[_0xfd8d('0x3e')][_0x23c863]);}}});}if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7a')]){if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7a')]==0x1){_0x5ef9c7[_0xfd8d('0x63')]('`unreadMessages`\x20=\x200');}else{_0x5ef9c7[_0xfd8d('0x63')](_0xfd8d('0x7b'));}}if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7c')]){_0x51a061=_[_0xfd8d('0x7d')](_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7c')])?_0x2f30ac['query']['tag']:new Array(_0x2f30ac['query']['tag']);_0x51a061[_0xfd8d('0x2d')](function(_0x81c4ad){_0x33857a['or'](_0xfd8d('0x6d'),'%,'+_0x81c4ad+',%');});}if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7e')]){var _0x100d79=_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x7e')][_0xfd8d('0x7f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xfd8d('0x80')](_0x100d79)){_0x65aa60['or'](_0xfd8d('0x81'),_0x100d79+'%')['or'](_0xfd8d('0x82'),_0x100d79+'%');}else{_0x65aa60['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfd8d('0x67')](_0x100d79))['or'](_0xfd8d('0x83'),_0x100d79+'%');}}}_0x5ef9c7[_0xfd8d('0x45')](_0x65aa60);_0x5ef9c7[_0xfd8d('0x84')](_0xfd8d('0x85'));var _0x36c96f={'type':db[_0xfd8d('0x86')]['QueryTypes'][_0xfd8d('0x87')],'raw':!![]};var _0x3916d0=_0x5ef9c7['clone']();_0x3916d0['field'](_0xfd8d('0x85'));_0x3916d0[_0xfd8d('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfd8d('0x61'));if(_0x1db7bd['order']){_0x1db7bd[_0xfd8d('0x88')][_0xfd8d('0x2d')](function(_0x153307){var _0x4a3c26=_0x153307[0x0]==='contactName'?_0x153307[0x0]:'i.'+_0x153307[0x0];_0x5ef9c7[_0xfd8d('0x88')](_0x4a3c26,_0x153307[0x1]===_0xfd8d('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x51a061)){_0x5ef9c7[_0xfd8d('0x63')](_0x33857a);_0x3916d0['where'](_0xfd8d('0x8a'),_0x51a061);}BPromise[_0xfd8d('0x8b')]()[_0xfd8d('0x8c')](function(){if(!_0x3b0c7e){if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x8d')])return;_0x3916d0['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5ef9c7[_0xfd8d('0x45')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2f30ac[_0xfd8d('0x8e')][_0xfd8d('0x8f')]!==_0xfd8d('0x90'))return;return _0x2f30ac['user'][_0xfd8d('0x91')]({'attributes':['id'],'raw':!![]})[_0xfd8d('0x8c')](function(_0x33650f){if(_[_0xfd8d('0x74')](_0x33650f)){_0x3916d0['where'](_0xfd8d('0x92'));_0x5ef9c7[_0xfd8d('0x45')](_0xfd8d('0x92'));}else{_0x3916d0[_0xfd8d('0x45')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x33650f,'id'));_0x5ef9c7['where'](_0xfd8d('0x75'),_[_0xfd8d('0x37')](_0x33650f,'id'));}});})['then'](function(){if(_0x2f30ac[_0xfd8d('0x8e')][_0xfd8d('0x8f')]==='agent'&&!_0x3b0c7e&&!_0x2f30ac['query'][_0xfd8d('0x8d')])return[];return db[_0xfd8d('0x93')][_0xfd8d('0x3e')](_0x3916d0['toString'](),_0x36c96f);})['then'](function(_0x2cb889){_0x5879d6[_0xfd8d('0x1e')]=_0x2cb889[_0xfd8d('0x42')];if(_0x5879d6['count']===0x0)return[];return db[_0xfd8d('0x93')]['query'](_0x23b717[_0xfd8d('0x94')](),_0x36c96f)['then'](function(_0x1a8da4){_0x3b112f=_[_0xfd8d('0x95')](_0x1a8da4,'id');_0x36c96f=_[_0xfd8d('0x96')](_0x36c96f,{'model':db[_0xfd8d('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f30ac[_0xfd8d('0x3e')][_0xfd8d('0x41')]){_0x1db7bd[_0xfd8d('0x3f')][_0xfd8d('0x2d')](function(_0x1bd289){_0x5ef9c7[_0xfd8d('0x49')]('i.'+_0x1bd289);});}else{_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x97'),'unreadMessages');_0x5ef9c7['field'](_0xfd8d('0x98'),_0xfd8d('0x99'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9a'),_0xfd8d('0x9b'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9c'),'contactName');_0x5ef9c7[_0xfd8d('0x49')]('i.*');_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9d'),'Contact.firstName');_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0x9e'),_0xfd8d('0x9f'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa0'),'Contact.email');_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa1'),_0xfd8d('0xa2'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa3'),_0xfd8d('0xa4'));_0x5ef9c7[_0xfd8d('0x49')]('c.fax',_0xfd8d('0xa5'));_0x5ef9c7[_0xfd8d('0x49')](_0xfd8d('0xa6'),_0xfd8d('0xa7'));_0x5ef9c7[_0xfd8d('0x49')]('o.internal',_0xfd8d('0xa8'));_0x5ef9c7['field'](_0xfd8d('0xa9'),_0xfd8d('0x2a'));}if(_0x1db7bd[_0xfd8d('0x20')])_0x5ef9c7[_0xfd8d('0x20')](_0x1db7bd[_0xfd8d('0x20')]);if(_0x1db7bd['offset'])_0x5ef9c7[_0xfd8d('0x1f')](_0x1db7bd['offset']);return db[_0xfd8d('0x93')][_0xfd8d('0x3e')](_0x5ef9c7['toString'](),_0x36c96f);})['then'](function(_0x183bc8){if(_0x183bc8[_0xfd8d('0x42')]>0x0)_0x3ace9d[_0xfd8d('0x45')](_0xfd8d('0xaa'),_[_0xfd8d('0x37')](_0x183bc8,'id'));return db['sequelize'][_0xfd8d('0x3e')](_0x3ace9d[_0xfd8d('0x94')](),_0x36c96f)['then'](function(_0x5454f1){var _0x25ea86=_[_0xfd8d('0xab')](_0x5454f1,_0xfd8d('0xac'));var _0x46f5cc=[];_0x183bc8[_0xfd8d('0x2d')](function(_0xcff0d1){_0x46f5cc[_0xfd8d('0x2e')](updateSmsInteraction(_0xcff0d1,_0x3b112f,_0x25ea86));});return BPromise[_0xfd8d('0xad')](_0x46f5cc);});});})['then'](function(_0x53d26d){_0x5879d6[_0xfd8d('0xae')]=_0x53d26d;return _0x5879d6;})['then'](respondWithFilteredResult(_0x5dfdc3,_0x1db7bd))[_0xfd8d('0x2f')](handleError(_0x5dfdc3,null));};exports[_0xfd8d('0xaf')]=function(_0x533733,_0x4ae157){var _0x35a2b8={'raw':![],'where':{'id':_0x533733[_0xfd8d('0xb0')]['id']}},_0x5d00a9={};_0x5d00a9[_0xfd8d('0x3d')]=_[_0xfd8d('0x73')](db[_0xfd8d('0x38')][_0xfd8d('0x39')]);_0x5d00a9[_0xfd8d('0x3e')]=_[_0xfd8d('0x73')](_0x533733['query']);_0x5d00a9[_0xfd8d('0x46')]=_[_0xfd8d('0x40')](_0x5d00a9[_0xfd8d('0x3d')],_0x5d00a9['query']);_0x35a2b8['attributes']=_[_0xfd8d('0x40')](_0x5d00a9[_0xfd8d('0x3d')],qs[_0xfd8d('0x41')](_0x533733['query'][_0xfd8d('0x41')]));_0x35a2b8[_0xfd8d('0x3f')]=_0x35a2b8['attributes'][_0xfd8d('0x42')]?_0x35a2b8[_0xfd8d('0x3f')]:_0x5d00a9[_0xfd8d('0x3d')];if(_0x533733[_0xfd8d('0x3e')][_0xfd8d('0xb1')]){_0x35a2b8[_0xfd8d('0xb2')]=[{'all':!![]}];}_0x35a2b8=_[_0xfd8d('0x96')]({},_0x35a2b8,_0x533733[_0xfd8d('0xb3')]);return db[_0xfd8d('0x38')][_0xfd8d('0x60')](_0x35a2b8)[_0xfd8d('0x8c')](handleEntityNotFound(_0x4ae157,null))[_0xfd8d('0x8c')](respondWithResult(_0x4ae157,null))[_0xfd8d('0x2f')](handleError(_0x4ae157,null));};exports[_0xfd8d('0xb4')]=function(_0x1d3c68,_0x16d92d){return db['SmsInteraction'][_0xfd8d('0xb4')](_0x1d3c68[_0xfd8d('0x71')],{})['then'](respondWithResult(_0x16d92d,0xc9))['catch'](handleError(_0x16d92d,null));};exports[_0xfd8d('0x24')]=function(_0x56e7f7,_0x16bbb9){if(_0x56e7f7[_0xfd8d('0x71')]['id']){delete _0x56e7f7[_0xfd8d('0x71')]['id'];}return db[_0xfd8d('0x38')]['find']({'where':{'id':_0x56e7f7[_0xfd8d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x16bbb9,null))[_0xfd8d('0x8c')](saveUpdates(_0x56e7f7[_0xfd8d('0x71')],null))[_0xfd8d('0x8c')](respondWithResult(_0x16bbb9,null))[_0xfd8d('0x2f')](handleError(_0x16bbb9,null));};exports['destroy']=function(_0x3959bd,_0x2b2ce8){return db[_0xfd8d('0x38')]['find']({'where':{'id':_0x3959bd[_0xfd8d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x2b2ce8,null))[_0xfd8d('0x8c')](removeEntity(_0x2b2ce8,null))[_0xfd8d('0x2f')](handleError(_0x2b2ce8,null));};exports[_0xfd8d('0xb5')]=function(_0x84ffa8,_0x2b1548){return db[_0xfd8d('0x38')][_0xfd8d('0xb5')]()[_0xfd8d('0x8c')](respondWithResult(_0x2b1548,null))[_0xfd8d('0x2f')](handleError(_0x2b1548,null));};exports[_0xfd8d('0xb6')]=function(_0x36fed2,_0x4b8100,_0x5e338b){return db['SmsMessage'][_0xfd8d('0x60')]({'where':{'id':_0x36fed2['params']['id']}})[_0xfd8d('0x8c')](handleEntityNotFound(_0x4b8100,null))[_0xfd8d('0x8c')](function(_0x33012e){if(_0x33012e){return _0x33012e[_0xfd8d('0xb6')](_0x36fed2[_0xfd8d('0x71')][_0xfd8d('0xb7')],_[_0xfd8d('0xb8')](_0x36fed2[_0xfd8d('0x71')],['ids','id'])||{});}})[_0xfd8d('0x8c')](respondWithResult(_0x4b8100,null))[_0xfd8d('0x2f')](handleError(_0x4b8100,null));};exports[_0xfd8d('0xb9')]=function(_0x1c295f,_0x3b3dca,_0x228f9b){var _0x304eed={'raw':![],'where':{}};var _0x2b5d1c={};var _0x253f2c={'count':0x0,'rows':[]};return db[_0xfd8d('0x38')][_0xfd8d('0xba')]({'where':{'id':_0x1c295f[_0xfd8d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3b3dca,null))[_0xfd8d('0x8c')](function(_0x100352){if(_0x100352){_0x2b5d1c['model']=_[_0xfd8d('0x73')](db['SmsMessage'][_0xfd8d('0x39')]);_0x2b5d1c[_0xfd8d('0x3e')]=_[_0xfd8d('0x73')](_0x1c295f[_0xfd8d('0x3e')]);_0x2b5d1c[_0xfd8d('0x46')]=_['intersection'](_0x2b5d1c['model'],_0x2b5d1c[_0xfd8d('0x3e')]);_0x304eed[_0xfd8d('0x3f')]=_[_0xfd8d('0x40')](_0x2b5d1c['model'],qs['fields'](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x41')]));_0x304eed['attributes']=_0x304eed[_0xfd8d('0x3f')]['length']?_0x304eed[_0xfd8d('0x3f')]:_0x2b5d1c[_0xfd8d('0x3d')];if(!_0x1c295f[_0xfd8d('0x3e')]['hasOwnProperty'](_0xfd8d('0xbb'))){_0x304eed[_0xfd8d('0x20')]=qs['limit'](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x20')]);_0x304eed['offset']=qs[_0xfd8d('0x1f')](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x1f')]);}_0x304eed[_0xfd8d('0x88')]=qs[_0xfd8d('0x44')](_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0x44')]);_0x304eed['where']=qs[_0xfd8d('0x46')](_[_0xfd8d('0x47')](_0x1c295f[_0xfd8d('0x3e')],_0x2b5d1c[_0xfd8d('0x46')]));_0x304eed[_0xfd8d('0x45')][_0xfd8d('0xac')]=_0x100352['id'];if(_0x1c295f[_0xfd8d('0x3e')]['filter']){_0x304eed['where']=_[_0xfd8d('0x96')](_0x304eed['where'],{'$or':_[_0xfd8d('0x37')](_0x304eed[_0xfd8d('0x3f')],function(_0x38e3c6){var _0x46d288={};_0x46d288[_0x38e3c6]={'$like':'%'+_0x1c295f[_0xfd8d('0x3e')]['filter']+'%'};return _0x46d288;})});}if(_0x1c295f[_0xfd8d('0x3e')]['$gte']){var _0x210ab2=_0x1c295f[_0xfd8d('0x3e')]['$gte']['split'](',');var _0x53710a={};_0x53710a[_0x210ab2[0x0]]={'$gte':moment(_0x210ab2[0x1])[_0xfd8d('0xbc')](_0xfd8d('0xbd'))};_0x304eed[_0xfd8d('0x45')]=_[_0xfd8d('0x96')](_0x304eed[_0xfd8d('0x45')],_0x53710a);}_0x304eed=_[_0xfd8d('0x96')]({},_0x304eed,_0x1c295f['options']);return db['SmsMessage'][_0xfd8d('0x1e')]({'where':_0x304eed[_0xfd8d('0x45')]})[_0xfd8d('0x8c')](function(_0x41dc96){_0x253f2c['count']=_0x41dc96;if(_0x1c295f[_0xfd8d('0x3e')][_0xfd8d('0xb1')]){_0x304eed[_0xfd8d('0xb2')]=[{'all':!![]}];}return db[_0xfd8d('0xbe')]['findAll'](_0x304eed);})[_0xfd8d('0x8c')](function(_0x740b3d){_0x253f2c['rows']=_0x740b3d;return _0x253f2c;});}})['then'](respondWithFilteredResult(_0x3b3dca,_0x304eed))[_0xfd8d('0x2f')](handleError(_0x3b3dca,null));};exports['addTags']=function(_0x33e46f,_0x58f2fe,_0x59d370){return db['SmsInteraction'][_0xfd8d('0x60')]({'where':{'id':_0x33e46f['params']['id']}})[_0xfd8d('0x8c')](handleEntityNotFound(_0x58f2fe,null))['then'](function(_0x7b73a1){if(_0x7b73a1){return _0x7b73a1[_0xfd8d('0xbf')](_0x33e46f[_0xfd8d('0x71')][_0xfd8d('0xb7')],_[_0xfd8d('0xb8')](_0x33e46f['body'],['ids','id'])||{})[_0xfd8d('0xc0')](function(){return db['Tag'][_0xfd8d('0xc1')]({'attributes':['id',_0xfd8d('0x26'),_0xfd8d('0xc2')],'where':{'id':_0x33e46f['body'][_0xfd8d('0xb7')]}});})['then'](function(_0x4267c2){socket[_0xfd8d('0xc3')](_0xfd8d('0xc4'),{'id':Number(_0x33e46f[_0xfd8d('0xb0')]['id']),'tags':_0x4267c2||[]});return{'id':Number(_0x33e46f['params']['id']),'tags':_0x4267c2||[]};});}})[_0xfd8d('0x8c')](respondWithResult(_0x58f2fe,null))[_0xfd8d('0x2f')](handleError(_0x58f2fe,null));};exports[_0xfd8d('0xc5')]=function(_0x2f8282,_0x10dd7e,_0x27a3b6){return db[_0xfd8d('0x38')]['find']({'where':{'id':_0x2f8282[_0xfd8d('0xb0')]['id']}})[_0xfd8d('0x8c')](handleEntityNotFound(_0x10dd7e,null))[_0xfd8d('0x8c')](function(_0x4a991d){if(_0x4a991d){return _0x4a991d[_0xfd8d('0xc5')](_0x2f8282['query']['ids']);}})[_0xfd8d('0x8c')](respondWithStatusCode(_0x10dd7e,null))['catch'](handleError(_0x10dd7e,null));};exports[_0xfd8d('0xc6')]=function(_0x4fdf04,_0x5046f7){var _0x120604=moment()[_0xfd8d('0xc7')]()['toString']();var _0x34b396=path[_0xfd8d('0xc8')](config[_0xfd8d('0xc9')],_0xfd8d('0xca'),_0xfd8d('0xcb'),'tmp');var _0x91545a=path[_0xfd8d('0xc8')](config[_0xfd8d('0xc9')],_0xfd8d('0xca'),_0xfd8d('0xcb'),_0xfd8d('0xcc'));var _0x262166=path[_0xfd8d('0xc8')](_0x34b396,_0x120604);var _0x15f658=util[_0xfd8d('0xbc')]('transcript-%d-%s.zip',_0x4fdf04[_0xfd8d('0xb0')]['id'],_0x120604);var _0x270e4a=path[_0xfd8d('0xc8')](_0x34b396,_0x15f658);var _0x2c5342=[];_0x2c5342[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0x6f')],'as':_0xfd8d('0x6f'),'attributes':['id','fullname'],'raw':!![]});_0x2c5342[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0xcd')],'as':_0xfd8d('0xce'),'attributes':['id','firstName',_0xfd8d('0xcf')],'raw':!![]});var _0x2a4bd0=[{'model':db[_0xfd8d('0xbe')],'as':_0xfd8d('0xd0'),'attributes':['id',_0xfd8d('0x71'),_0xfd8d('0x76'),_0xfd8d('0xd1'),'secret',_0xfd8d('0x7a')],'include':_0x2c5342}];_0x2a4bd0[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0xd2')],'as':_0xfd8d('0xd3'),'attributes':['id',_0xfd8d('0x26')]});_0x2a4bd0[_0xfd8d('0x2e')]({'model':db[_0xfd8d('0x6f')],'as':_0xfd8d('0xd4'),'attributes':['id',_0xfd8d('0x29')]});return db[_0xfd8d('0x38')][_0xfd8d('0x60')]({'where':{'id':_0x4fdf04['params']['id']},'include':_0x2a4bd0})[_0xfd8d('0x8c')](handleEntityNotFound(_0x5046f7,null))['then'](function(_0x5616b0){if(_0x5616b0){var _0x27500a=_0x5616b0[_0xfd8d('0xd5')]({'plain':!![]});fs[_0xfd8d('0xd6')](_0x262166);var _0x4dab1c={'channel':_0xfd8d('0xd7'),'account':_0x27500a['Account'][_0xfd8d('0x26')],'agent':_0x27500a[_0xfd8d('0xd4')]?_0x27500a[_0xfd8d('0xd4')]['fullname']:'N.A.','createdAt':moment(_0x27500a[_0xfd8d('0x76')])[_0xfd8d('0xbc')](_0xfd8d('0xbd'))['toString'](),'closedAt':_0x27500a[_0xfd8d('0x34')]?moment(_0x27500a[_0xfd8d('0xd8')])['format'](_0xfd8d('0xbd'))[_0xfd8d('0x94')]():'','disposition':_0x27500a['disposition'],'messages':_(_0x27500a[_0xfd8d('0xd0')])[_0xfd8d('0x7e')]({'secret':![]})[_0xfd8d('0x37')](function(_0xfbea96){return{'date':moment(_0xfbea96[_0xfd8d('0x76')])['format'](_0xfd8d('0xbd'))[_0xfd8d('0x94')](),'sender':_0xfbea96[_0xfd8d('0xd1')]===_0xfd8d('0xd9')?_0xfbea96[_0xfd8d('0x6f')]?_0xfbea96[_0xfd8d('0x6f')][_0xfd8d('0x29')]:_0xfd8d('0xda'):_0xfbea96[_0xfd8d('0xce')][_0xfd8d('0xdb')]+(_0xfbea96[_0xfd8d('0xce')][_0xfd8d('0xcf')]?'\x20'+_0xfbea96['Contact'][_0xfd8d('0xcf')]:''),'body':_0xfbea96[_0xfd8d('0x71')],'direction':_0xfbea96[_0xfd8d('0xd1')]===_0xfd8d('0xd9')?'A':'C','secret':_0xfbea96[_0xfd8d('0xdc')],'read':_0xfbea96[_0xfd8d('0x7a')]};})['value']()};return ejs['renderFile'](path['join'](config['root'],_0xfd8d('0xca'),_0xfd8d('0xdd'),_0xfd8d('0xde')),{'interaction':_0x4dab1c})['then'](function(_0x13fd82){var _0x9b4138=path[_0xfd8d('0xc8')](_0x262166,_0xfd8d('0xdf')+_0x27500a['id']+'-'+_0x120604+'.pdf');var _0x146fc4={'path':_0x9b4138,'channel':_0xfd8d('0xd7'),'interactionId':_0x27500a['id']};return pdf[_0xfd8d('0xe0')](_0x13fd82,_0x146fc4);})[_0xfd8d('0x8c')](function(){return new BPromise(function(_0x126197,_0x37dc84){zipdir(_0x262166,{'saveTo':_0x270e4a},function(_0x1e799a,_0x2f82a3){if(_0x1e799a)return _0x37dc84(_0x1e799a);return _0x126197(_0x2f82a3);});})[_0xfd8d('0x8c')](function(){return new BPromise(function(_0x296e88,_0x2fc80a){rimraf(_0x262166,function(_0x428f1f){if(_0x428f1f)_0x2fc80a(_0x428f1f);return _0x296e88();});});})[_0xfd8d('0x8c')](function(){return _0x5046f7[_0xfd8d('0xc6')](_0x270e4a,_0x15f658,function(_0x59c9e9){if(_0x59c9e9){console['log'](_0xfd8d('0xe1'),_0x59c9e9);}else{fs[_0xfd8d('0xe2')](_0x270e4a);}});});});}else{return _0x5046f7[_0xfd8d('0xe3')](0xc8);}})[_0xfd8d('0x2f')](handleError(_0x5046f7,null));}; \ No newline at end of file +var _0xfe20=['some','forEach','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','includeAll','include','options','SmsInteraction','create','body','params','describe','addMessage','SmsMessage','ids','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','Messages','direction','secret','SmsAccount','Owner','get','mkdirSync','Account','closedAt','disposition','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','total','closed','UserId','talking','answered','unmanaged','index','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','from','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_messages','me.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys'];(function(_0x1361fd,_0x1e7dae){var _0x12211d=function(_0x59ba07){while(--_0x59ba07){_0x1361fd['push'](_0x1361fd['shift']());}};_0x12211d(++_0x1e7dae);}(_0xfe20,0x7a));var _0x0fe2=function(_0x580369,_0x47eed1){_0x580369=_0x580369-0x0;var _0x138d13=_0xfe20[_0x580369];return _0x138d13;};'use strict';var emlformat=require(_0x0fe2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0fe2('0x1'));var jsonpatch=require(_0x0fe2('0x2'));var rp=require(_0x0fe2('0x3'));var moment=require(_0x0fe2('0x4'));var BPromise=require(_0x0fe2('0x5'));var Mustache=require(_0x0fe2('0x6'));var util=require(_0x0fe2('0x7'));var path=require(_0x0fe2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0fe2('0x9'));var fs=require('fs');var fs_extra=require(_0x0fe2('0xa'));var _=require(_0x0fe2('0xb'));var squel=require(_0x0fe2('0xc'));var crypto=require(_0x0fe2('0xd'));var jsforce=require(_0x0fe2('0xe'));var deskjs=require(_0x0fe2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0fe2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0fe2('0x11'));var as=require(_0x0fe2('0x12'));var pdf=require(_0x0fe2('0x13'));var hardwareService=require(_0x0fe2('0x14'));var logger=require(_0x0fe2('0x15'))(_0x0fe2('0x16'));var utils=require(_0x0fe2('0x17'));var config=require(_0x0fe2('0x18'));var licenseUtil=require(_0x0fe2('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0fe2('0x1a'),'port':0x18eb});var socket=require(_0x0fe2('0x1b'))(new Redis(config[_0x0fe2('0x1c')]));require(_0x0fe2('0x1d'))[_0x0fe2('0x1e')](socket);function respondWithStatusCode(_0x271370,_0x41f551){_0x41f551=_0x41f551||0xcc;return function(_0x24706f){if(_0x24706f){return _0x271370['sendStatus'](_0x41f551);}return _0x271370[_0x0fe2('0x1f')](_0x41f551)[_0x0fe2('0x20')]();};}function respondWithResult(_0x4f1d6b,_0x2d19da){_0x2d19da=_0x2d19da||0xc8;return function(_0xe741d8){if(_0xe741d8){return _0x4f1d6b[_0x0fe2('0x1f')](_0x2d19da)[_0x0fe2('0x21')](_0xe741d8);}};}function respondWithFilteredResult(_0x25bd17,_0x5d3bda){return function(_0x495e46){if(_0x495e46){var _0x4bf751=typeof _0x5d3bda[_0x0fe2('0x22')]===_0x0fe2('0x23')&&typeof _0x5d3bda[_0x0fe2('0x24')]===_0x0fe2('0x23');var _0x20ac2e=_0x495e46[_0x0fe2('0x25')];var _0x3a0f28=_0x4bf751?0x0:_0x5d3bda[_0x0fe2('0x22')];var _0x3ab72a=_0x4bf751?_0x495e46[_0x0fe2('0x25')]:_0x5d3bda[_0x0fe2('0x22')]+_0x5d3bda[_0x0fe2('0x24')];var _0x6d089b;if(_0x3ab72a>=_0x20ac2e){_0x3ab72a=_0x20ac2e;_0x6d089b=0xc8;}else{_0x6d089b=0xce;}_0x25bd17[_0x0fe2('0x1f')](_0x6d089b);return _0x25bd17[_0x0fe2('0x26')](_0x0fe2('0x27'),_0x3a0f28+'-'+_0x3ab72a+'/'+_0x20ac2e)[_0x0fe2('0x21')](_0x495e46);}return null;};}function patchUpdates(_0x150389){return function(_0x440320){try{jsonpatch[_0x0fe2('0x28')](_0x440320,_0x150389,!![]);}catch(_0x2d98ea){return BPromise[_0x0fe2('0x29')](_0x2d98ea);}return _0x440320['save']();};}function saveUpdates(_0x4ad989,_0x489972){return function(_0x475796){if(_0x475796){return _0x475796[_0x0fe2('0x2a')](_0x4ad989)['then'](function(_0x53bd7d){return _0x53bd7d;});}return null;};}function removeEntity(_0x15c111,_0x50e322){return function(_0x24e49e){if(_0x24e49e){return _0x24e49e[_0x0fe2('0x2b')]()[_0x0fe2('0x2c')](function(){_0x15c111[_0x0fe2('0x1f')](0xcc)[_0x0fe2('0x20')]();});}};}function handleEntityNotFound(_0x11d436,_0xf7aeb8){return function(_0x10676c){if(!_0x10676c){_0x11d436['sendStatus'](0x194);}return _0x10676c;};}function handleError(_0x128701,_0x474e22){_0x474e22=_0x474e22||0x1f4;return function(_0x523513){logger['error'](_0x523513['stack']);if(_0x523513['name']){delete _0x523513[_0x0fe2('0x2d')];}_0x128701['status'](_0x474e22)[_0x0fe2('0x2e')](_0x523513);};}function getInteractionUsers(_0x1c198f,_0x2e27cf){return new BPromise(function(_0x4ae63a,_0x5532e6){try{if(_0x2e27cf[_0x1c198f['id']]){_0x1c198f[_0x0fe2('0x2f')]=_[_0x0fe2('0x30')](_0x2e27cf[_0x1c198f['id']],function(_0x5a4c54){return{'id':_0x5a4c54['id'],'fullname':_0x5a4c54[_0x0fe2('0x31')]};});}}catch(_0x22ff7f){_0x5532e6(_0x22ff7f);}_0x4ae63a(_0x1c198f);});}function getInteractionTags(_0x58a620,_0x2e6995){return new BPromise(function(_0x1f8358,_0x274204){try{if(_0x58a620[_0x0fe2('0x32')]){_0x58a620[_0x0fe2('0x33')]=[];_0x58a620[_0x0fe2('0x32')]['split'](',')['forEach'](function(_0x4dd50b){_0x58a620[_0x0fe2('0x33')][_0x0fe2('0x34')](_0x2e6995[_0x4dd50b]);});}delete _0x58a620['TagIds'];}catch(_0x24ac3b){_0x274204(_0x24ac3b);}_0x1f8358(_0x58a620);});}function updateSmsInteraction(_0x31dd90,_0x552553,_0x2fe47d){return new BPromise(function(_0x5f1872,_0x4f01e6){return getInteractionUsers(_0x31dd90,_0x2fe47d)['then'](function(_0xb40d87){return getInteractionTags(_0xb40d87,_0x552553);})['then'](function(_0x302fdf){return getStateInteraction(_0x302fdf);})[_0x0fe2('0x2c')](function(_0x87ca80){_0x5f1872(_0x87ca80);})[_0x0fe2('0x35')](function(_0x54bb4f){_0x4f01e6(_0x54bb4f);});});}function getStateInteraction(_0x5b147f){return new BPromise(function(_0x35216f){_0x5b147f[_0x0fe2('0x36')]=0x0;_0x5b147f['talking']=0x0;_0x5b147f['answered']=0x0;_0x5b147f['unmanaged']=0x0;_0x5b147f[_0x0fe2('0x37')]=0x0;if(!_0x5b147f[_0x0fe2('0x38')]&&!_0x5b147f['UserId']){_0x5b147f[_0x0fe2('0x36')]+=0x1;}if(!_0x5b147f['closed']&&_0x5b147f[_0x0fe2('0x39')]){_0x5b147f[_0x0fe2('0x3a')]+=0x1;if(_0x5b147f['waiting']){_0x5b147f['waiting']-=0x1;}}if(_0x5b147f[_0x0fe2('0x38')]&&_0x5b147f['UserId']){_0x5b147f[_0x0fe2('0x3b')]+=0x1;if(_0x5b147f['talking']){_0x5b147f['talking']-=0x1;}}if(_0x5b147f['closed']&&!_0x5b147f[_0x0fe2('0x39')]){_0x5b147f[_0x0fe2('0x3c')]+=0x1;if(_0x5b147f[_0x0fe2('0x36')]){_0x5b147f[_0x0fe2('0x36')]-=0x1;}}_0x5b147f['total']+=0x1;_0x35216f(_0x5b147f);});}exports[_0x0fe2('0x3d')]=function(_0x959002,_0x2d8e6c){var _0x1da01b={},_0x303bad={},_0x500616={'count':0x0,'rows':[]};var _0x4395f1=_['map'](db['SmsInteraction'][_0x0fe2('0x3e')],function(_0x36576a){return{'name':_0x36576a[_0x0fe2('0x3f')],'type':_0x36576a[_0x0fe2('0x40')]['key']};});_0x303bad['model']=_[_0x0fe2('0x30')](_0x4395f1,_0x0fe2('0x2d'));_0x303bad[_0x0fe2('0x41')]=_['keys'](_0x959002[_0x0fe2('0x41')]);_0x303bad[_0x0fe2('0x42')]=_[_0x0fe2('0x43')](_0x303bad[_0x0fe2('0x44')],_0x303bad[_0x0fe2('0x41')]);_0x1da01b['attributes']=_[_0x0fe2('0x43')](_0x303bad[_0x0fe2('0x44')],qs['fields'](_0x959002[_0x0fe2('0x41')][_0x0fe2('0x45')]));_0x1da01b[_0x0fe2('0x46')]=_0x1da01b['attributes'][_0x0fe2('0x47')]?_0x1da01b[_0x0fe2('0x46')]:_0x303bad[_0x0fe2('0x44')];if(!_0x959002[_0x0fe2('0x41')][_0x0fe2('0x48')](_0x0fe2('0x49'))){_0x1da01b[_0x0fe2('0x24')]=qs[_0x0fe2('0x24')](_0x959002['query'][_0x0fe2('0x24')]);_0x1da01b['offset']=qs[_0x0fe2('0x22')](_0x959002[_0x0fe2('0x41')][_0x0fe2('0x22')]);}_0x1da01b[_0x0fe2('0x4a')]=qs[_0x0fe2('0x4b')](_0x959002['query'][_0x0fe2('0x4b')]);_0x1da01b['where']=qs['filters'](_['pick'](_0x959002['query'],_0x303bad['filters']),_0x4395f1);var _0x1da15d=[];var _0x14d33f=squel[_0x0fe2('0x4c')]()[_0x0fe2('0x4d')]('id')[_0x0fe2('0x4d')](_0x0fe2('0x2d'))[_0x0fe2('0x4d')]('color')[_0x0fe2('0x4e')]('tools_tags');var _0xa36148=squel[_0x0fe2('0x4c')]()['field'](_0x0fe2('0x4f'))[_0x0fe2('0x4d')](_0x0fe2('0x50'))[_0x0fe2('0x4d')]('ui.SmsInteractionId')[_0x0fe2('0x4e')](_0x0fe2('0x51'),'ui')[_0x0fe2('0x52')](_0x0fe2('0x53'),'u',_0x0fe2('0x54'));var _0x9540c=squel[_0x0fe2('0x4c')]()[_0x0fe2('0x4e')](_0x0fe2('0x55'),'i')[_0x0fe2('0x52')]('cm_contacts','c',_0x0fe2('0x56'))[_0x0fe2('0x52')](_0x0fe2('0x53'),'o','o.id\x20=\x20i.UserId')[_0x0fe2('0x52')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x0fe2('0x52')](_0x0fe2('0x57'),'me',_0x0fe2('0x58'))[_0x0fe2('0x52')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x0fe2('0x52')](_0x0fe2('0x59'),'t',_0x0fe2('0x5a'));var _0x50b523=squel[_0x0fe2('0x5b')]();var _0x777d5f=[];var _0x132c0d=squel[_0x0fe2('0x5b')]();var _0x1d609e;if(_0x959002[_0x0fe2('0x41')]['search']){_0x1d609e=as[_0x0fe2('0x5c')](_0x959002[_0x0fe2('0x41')][_0x0fe2('0x5d')]);var _0x108fa7=_0x1d609e[_0x0fe2('0x5e')];for(var _0x4f157e=0x0;_0x4f157e<_0x1d609e[_0x0fe2('0x5f')]['length'];_0x4f157e++){var _0x361451=_0x1d609e[_0x0fe2('0x5f')][_0x4f157e];var _0x1aacb6='i';var _0x129559=_[_0x0fe2('0x60')](_0x4395f1,[_0x0fe2('0x2d'),_0x361451[_0x0fe2('0x4d')]]);if(!_0x129559){switch(_0x361451['field']){case'unreadMessages':if(_0x361451[_0x0fe2('0x61')]==0x1){_0x9540c[_0x0fe2('0x62')]('`'+_0x361451[_0x0fe2('0x4d')]+_0x0fe2('0x63'));}else{_0x9540c[_0x0fe2('0x62')]('`'+_0x361451['field']+'`\x20>\x200');}break;case _0x0fe2('0x64'):if(_0x361451[_0x0fe2('0x65')]==='$substring'){if(_0x361451[_0x0fe2('0x61')]['split']('\x20')['length']>0x1){_0x50b523[_0x108fa7](_0x0fe2('0x66'),qs['getFullTextValue'](_0x361451[_0x0fe2('0x61')]),null);}else{var _0x3770ac='%'+_0x361451[_0x0fe2('0x61')]+'%';_0x50b523[_0x108fa7](_0x0fe2('0x67'),_0x3770ac,_0x3770ac,_0x3770ac);}}else{_0x129559=_['find'](_0x4395f1,[_0x0fe2('0x2d'),_0x0fe2('0x68')]);_0x361451['field']='ContactId';_0xfe6f01=as[_0x0fe2('0x69')](_0x1aacb6,_0x129559[_0x0fe2('0x40')],_0x361451);_0x50b523[_0x108fa7](_0xfe6f01[_0x0fe2('0x6a')],_0xfe6f01['value'][_0x0fe2('0x6b')],_0xfe6f01[_0x0fe2('0x61')][_0x0fe2('0x20')]);}break;case _0x0fe2('0x6c'):var _0x464d02=_0x361451[_0x0fe2('0x61')][_0x0fe2('0x6d')](',')[_0x0fe2('0x30')](function(_0x6443bc){return Number(_0x6443bc);});_0x464d02['forEach'](function(_0x24f71a){_0x132c0d['or'](_0x0fe2('0x6e'),'%,'+_0x24f71a+',%');});_0x777d5f=_['union'](_0x777d5f,_0x464d02);break;case _0x0fe2('0x6f'):if(_0x361451[_0x0fe2('0x65')]==='$substring'){_0x50b523[_0x108fa7](_0x0fe2('0x70'),'%'+_0x361451[_0x0fe2('0x61')]+'%',null);}else{_0x129559=_[_0x0fe2('0x60')](_0x4395f1,['name',_0x0fe2('0x39')]);_0x361451['field']=_0x0fe2('0x39');_0xfe6f01=as['buildExpression'](_0x1aacb6,_0x129559[_0x0fe2('0x40')],_0x361451);_0x50b523[_0x108fa7](_0xfe6f01[_0x0fe2('0x6a')],_0xfe6f01[_0x0fe2('0x61')][_0x0fe2('0x6b')],_0xfe6f01['value'][_0x0fe2('0x20')]);}break;case'body':_0xfe6f01=as[_0x0fe2('0x69')]('me',null,_0x361451);_0x50b523[_0x108fa7](_0xfe6f01['text'],_0xfe6f01[_0x0fe2('0x61')][_0x0fe2('0x6b')],_0xfe6f01[_0x0fe2('0x61')]['end']);break;}}else{var _0xfe6f01=as['buildExpression'](_0x1aacb6,_0x129559[_0x0fe2('0x40')],_0x361451);_0x50b523[_0x108fa7](_0xfe6f01[_0x0fe2('0x6a')],_0xfe6f01['value'][_0x0fe2('0x6b')],_0xfe6f01[_0x0fe2('0x61')]['end']);}}}else{var _0x12ded5=_(_0x959002[_0x0fe2('0x41')])[_0x0fe2('0x71')]()[_0x0fe2('0x30')](function(_0x3bae9e){return _[_0x0fe2('0x72')](_0x4395f1,['name',_0x3bae9e])?_0x3bae9e:undefined;})['compact']()[_0x0fe2('0x61')]();if(!_['isEmpty'](_0x12ded5)){_0x12ded5[_0x0fe2('0x73')](function(_0x51b7a1){if(_0x51b7a1===_0x0fe2('0x74')){_0x9540c[_0x0fe2('0x75')](_0x0fe2('0x76'),[][_0x0fe2('0x77')](_0x959002[_0x0fe2('0x41')][_0x51b7a1]));}else if(_0x51b7a1===_0x0fe2('0x78')){var _0x176382=JSON[_0x0fe2('0x79')](_0x959002[_0x0fe2('0x41')][_0x51b7a1])[_0x0fe2('0x7a')];var _0x825226=JSON['parse'](_0x959002['query'][_0x51b7a1])[_0x0fe2('0x7b')];_0x9540c[_0x0fe2('0x75')](_0x0fe2('0x7c'),_0x176382,_0x825226);}else{if(_0x959002[_0x0fe2('0x41')][_0x51b7a1]===_0x0fe2('0x7d')){_0x9540c['where']('i.'+_0x51b7a1+'\x20IS\x20NULL');}else{_0x9540c['where']('i.'+_0x51b7a1+'\x20=\x20?',_0x959002[_0x0fe2('0x41')][_0x51b7a1]);}}});}if(_0x959002['query'][_0x0fe2('0x7e')]){if(_0x959002['query'][_0x0fe2('0x7e')]==0x1){_0x9540c['having'](_0x0fe2('0x7f'));}else{_0x9540c[_0x0fe2('0x62')](_0x0fe2('0x80'));}}if(_0x959002[_0x0fe2('0x41')][_0x0fe2('0x81')]){_0x777d5f=_[_0x0fe2('0x82')](_0x959002[_0x0fe2('0x41')][_0x0fe2('0x81')])?_0x959002['query'][_0x0fe2('0x81')]:new Array(_0x959002['query'][_0x0fe2('0x81')]);_0x777d5f[_0x0fe2('0x73')](function(_0x433fd3){_0x132c0d['or'](_0x0fe2('0x6e'),'%,'+_0x433fd3+',%');});}if(_0x959002['query']['filter']){var _0x25b6a1=_0x959002[_0x0fe2('0x41')][_0x0fe2('0x83')][_0x0fe2('0x84')]('\x5c','\x5c\x5c')[_0x0fe2('0x84')](/'/g,'\x27\x27');if(qs[_0x0fe2('0x85')](_0x25b6a1)){_0x50b523['or']('i.id\x20LIKE\x20?',_0x25b6a1+'%')['or']('i.phone\x20LIKE\x20?',_0x25b6a1+'%');}else{_0x50b523['or'](_0x0fe2('0x86'),qs[_0x0fe2('0x87')](_0x25b6a1))['or'](_0x0fe2('0x88'),_0x25b6a1+'%');}}}_0x9540c[_0x0fe2('0x75')](_0x50b523);_0x9540c[_0x0fe2('0x89')]('i.id');var _0x3cce43={'type':db[_0x0fe2('0x8a')]['QueryTypes'][_0x0fe2('0x8b')],'raw':!![]};var _0x59e89f=_0x9540c[_0x0fe2('0x8c')]();_0x59e89f['field'](_0x0fe2('0x8d'));_0x59e89f[_0x0fe2('0x4d')](_0x0fe2('0x8e'),_0x0fe2('0x8f'));if(_0x1da01b[_0x0fe2('0x4a')]){_0x1da01b[_0x0fe2('0x4a')][_0x0fe2('0x73')](function(_0x47ec1a){var _0x207ebd=_0x47ec1a[0x0]===_0x0fe2('0x90')?_0x47ec1a[0x0]:'i.'+_0x47ec1a[0x0];_0x9540c[_0x0fe2('0x4a')](_0x207ebd,_0x47ec1a[0x1]===_0x0fe2('0x91')?![]:!![]);});}if(!_[_0x0fe2('0x92')](_0x777d5f)){_0x9540c[_0x0fe2('0x62')](_0x132c0d);_0x59e89f['where'](_0x0fe2('0x93'),_0x777d5f);}BPromise[_0x0fe2('0x94')]()[_0x0fe2('0x2c')](function(){if(!_0x1d609e){if(_0x959002[_0x0fe2('0x41')][_0x0fe2('0x74')])return;_0x59e89f[_0x0fe2('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x9540c[_0x0fe2('0x75')](_0x0fe2('0x95'));return;}if(_0x959002[_0x0fe2('0x96')][_0x0fe2('0x97')]!==_0x0fe2('0x98'))return;return _0x959002[_0x0fe2('0x96')][_0x0fe2('0x99')]({'attributes':['id'],'raw':!![]})[_0x0fe2('0x2c')](function(_0x30a973){if(_['isEmpty'](_0x30a973)){_0x59e89f[_0x0fe2('0x75')](_0x0fe2('0x9a'));_0x9540c[_0x0fe2('0x75')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x59e89f[_0x0fe2('0x75')](_0x0fe2('0x76'),_[_0x0fe2('0x30')](_0x30a973,'id'));_0x9540c[_0x0fe2('0x75')](_0x0fe2('0x76'),_[_0x0fe2('0x30')](_0x30a973,'id'));}});})[_0x0fe2('0x2c')](function(){if(_0x959002[_0x0fe2('0x96')][_0x0fe2('0x97')]===_0x0fe2('0x98')&&!_0x1d609e&&!_0x959002['query']['SmsAccountId'])return[];return db[_0x0fe2('0x9b')][_0x0fe2('0x41')](_0x59e89f[_0x0fe2('0x9c')](),_0x3cce43);})[_0x0fe2('0x2c')](function(_0x438ac7){_0x500616[_0x0fe2('0x25')]=_0x438ac7[_0x0fe2('0x47')];if(_0x500616[_0x0fe2('0x25')]===0x0)return[];return db[_0x0fe2('0x9b')][_0x0fe2('0x41')](_0x14d33f['toString'](),_0x3cce43)[_0x0fe2('0x2c')](function(_0x46ae9e){_0x1da15d=_[_0x0fe2('0x9d')](_0x46ae9e,'id');_0x3cce43=_[_0x0fe2('0x9e')](_0x3cce43,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x959002['query']['fields']){_0x1da01b[_0x0fe2('0x46')][_0x0fe2('0x73')](function(_0x5a5f64){_0x9540c['field']('i.'+_0x5a5f64);});}else{_0x9540c[_0x0fe2('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0fe2('0x8f'));_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0x9f'),_0x0fe2('0xa0'));_0x9540c[_0x0fe2('0x4d')]('a.mandatoryDisposition',_0x0fe2('0xa1'));_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xa2'),_0x0fe2('0x90'));_0x9540c[_0x0fe2('0x4d')]('i.*');_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xa3'),'Contact.firstName');_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xa4'),_0x0fe2('0xa5'));_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xa6'),'Contact.email');_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xa7'),_0x0fe2('0xa8'));_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xa9'),'Contact.mobile');_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xaa'),_0x0fe2('0xab'));_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xac'),_0x0fe2('0xad'));_0x9540c['field'](_0x0fe2('0xae'),'Owner.internal');_0x9540c[_0x0fe2('0x4d')](_0x0fe2('0xaf'),_0x0fe2('0x32'));}if(_0x1da01b['limit'])_0x9540c['limit'](_0x1da01b[_0x0fe2('0x24')]);if(_0x1da01b['offset'])_0x9540c[_0x0fe2('0x22')](_0x1da01b[_0x0fe2('0x22')]);return db[_0x0fe2('0x9b')][_0x0fe2('0x41')](_0x9540c[_0x0fe2('0x9c')](),_0x3cce43);})[_0x0fe2('0x2c')](function(_0x543c72){if(_0x543c72[_0x0fe2('0x47')]>0x0)_0xa36148[_0x0fe2('0x75')](_0x0fe2('0xb0'),_[_0x0fe2('0x30')](_0x543c72,'id'));return db[_0x0fe2('0x9b')]['query'](_0xa36148['toString'](),_0x3cce43)[_0x0fe2('0x2c')](function(_0x17009a){var _0x3e1450=_[_0x0fe2('0xb1')](_0x17009a,_0x0fe2('0xb2'));var _0x333ad0=[];_0x543c72['forEach'](function(_0x4142a2){_0x333ad0[_0x0fe2('0x34')](updateSmsInteraction(_0x4142a2,_0x1da15d,_0x3e1450));});return BPromise[_0x0fe2('0xb3')](_0x333ad0);});});})[_0x0fe2('0x2c')](function(_0xac7f2b){_0x500616[_0x0fe2('0xb4')]=_0xac7f2b;return _0x500616;})['then'](respondWithFilteredResult(_0x2d8e6c,_0x1da01b))[_0x0fe2('0x35')](handleError(_0x2d8e6c,null));};exports['show']=function(_0x12a9f3,_0x3b2b48){var _0x20cc08={'raw':![],'where':{'id':_0x12a9f3['params']['id']}},_0xbcfaae={};_0xbcfaae[_0x0fe2('0x44')]=_['keys'](db['SmsInteraction'][_0x0fe2('0x3e')]);_0xbcfaae[_0x0fe2('0x41')]=_[_0x0fe2('0x71')](_0x12a9f3['query']);_0xbcfaae[_0x0fe2('0x42')]=_['intersection'](_0xbcfaae[_0x0fe2('0x44')],_0xbcfaae[_0x0fe2('0x41')]);_0x20cc08[_0x0fe2('0x46')]=_[_0x0fe2('0x43')](_0xbcfaae[_0x0fe2('0x44')],qs[_0x0fe2('0x45')](_0x12a9f3[_0x0fe2('0x41')][_0x0fe2('0x45')]));_0x20cc08[_0x0fe2('0x46')]=_0x20cc08[_0x0fe2('0x46')][_0x0fe2('0x47')]?_0x20cc08[_0x0fe2('0x46')]:_0xbcfaae['model'];if(_0x12a9f3['query'][_0x0fe2('0xb5')]){_0x20cc08[_0x0fe2('0xb6')]=[{'all':!![]}];}_0x20cc08=_[_0x0fe2('0x9e')]({},_0x20cc08,_0x12a9f3[_0x0fe2('0xb7')]);return db[_0x0fe2('0xb8')]['find'](_0x20cc08)[_0x0fe2('0x2c')](handleEntityNotFound(_0x3b2b48,null))[_0x0fe2('0x2c')](respondWithResult(_0x3b2b48,null))[_0x0fe2('0x35')](handleError(_0x3b2b48,null));};exports[_0x0fe2('0xb9')]=function(_0x295472,_0x1e2e78){return db['SmsInteraction'][_0x0fe2('0xb9')](_0x295472[_0x0fe2('0xba')],{})['then'](respondWithResult(_0x1e2e78,0xc9))[_0x0fe2('0x35')](handleError(_0x1e2e78,null));};exports[_0x0fe2('0x2a')]=function(_0x3f20fc,_0xcf0545){if(_0x3f20fc[_0x0fe2('0xba')]['id']){delete _0x3f20fc['body']['id'];}return db[_0x0fe2('0xb8')][_0x0fe2('0x60')]({'where':{'id':_0x3f20fc['params']['id']}})[_0x0fe2('0x2c')](handleEntityNotFound(_0xcf0545,null))['then'](saveUpdates(_0x3f20fc[_0x0fe2('0xba')],null))[_0x0fe2('0x2c')](respondWithResult(_0xcf0545,null))['catch'](handleError(_0xcf0545,null));};exports[_0x0fe2('0x2b')]=function(_0x338221,_0x5b89a1){return db[_0x0fe2('0xb8')]['find']({'where':{'id':_0x338221[_0x0fe2('0xbb')]['id']}})[_0x0fe2('0x2c')](handleEntityNotFound(_0x5b89a1,null))[_0x0fe2('0x2c')](removeEntity(_0x5b89a1,null))['catch'](handleError(_0x5b89a1,null));};exports[_0x0fe2('0xbc')]=function(_0x3a51f1,_0x46eaa8){return db[_0x0fe2('0xb8')][_0x0fe2('0xbc')]()[_0x0fe2('0x2c')](respondWithResult(_0x46eaa8,null))[_0x0fe2('0x35')](handleError(_0x46eaa8,null));};exports[_0x0fe2('0xbd')]=function(_0x64be3b,_0x42d4b9,_0xc0f9a8){return db[_0x0fe2('0xbe')]['find']({'where':{'id':_0x64be3b[_0x0fe2('0xbb')]['id']}})['then'](handleEntityNotFound(_0x42d4b9,null))[_0x0fe2('0x2c')](function(_0x55820){if(_0x55820){return _0x55820[_0x0fe2('0xbd')](_0x64be3b[_0x0fe2('0xba')][_0x0fe2('0xbf')],_['omit'](_0x64be3b[_0x0fe2('0xba')],['ids','id'])||{});}})[_0x0fe2('0x2c')](respondWithResult(_0x42d4b9,null))['catch'](handleError(_0x42d4b9,null));};exports['getMessages']=function(_0xfd5572,_0x2fe5d2,_0x379f30){var _0x54cb77={'raw':![],'where':{}};var _0xcefb3c={};var _0x262e0c={'count':0x0,'rows':[]};return db[_0x0fe2('0xb8')][_0x0fe2('0xc0')]({'where':{'id':_0xfd5572[_0x0fe2('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2fe5d2,null))[_0x0fe2('0x2c')](function(_0x192056){if(_0x192056){_0xcefb3c[_0x0fe2('0x44')]=_['keys'](db[_0x0fe2('0xbe')][_0x0fe2('0x3e')]);_0xcefb3c['query']=_[_0x0fe2('0x71')](_0xfd5572[_0x0fe2('0x41')]);_0xcefb3c['filters']=_[_0x0fe2('0x43')](_0xcefb3c[_0x0fe2('0x44')],_0xcefb3c[_0x0fe2('0x41')]);_0x54cb77['attributes']=_[_0x0fe2('0x43')](_0xcefb3c[_0x0fe2('0x44')],qs[_0x0fe2('0x45')](_0xfd5572[_0x0fe2('0x41')][_0x0fe2('0x45')]));_0x54cb77[_0x0fe2('0x46')]=_0x54cb77[_0x0fe2('0x46')][_0x0fe2('0x47')]?_0x54cb77[_0x0fe2('0x46')]:_0xcefb3c['model'];if(!_0xfd5572['query'][_0x0fe2('0x48')](_0x0fe2('0x49'))){_0x54cb77['limit']=qs['limit'](_0xfd5572[_0x0fe2('0x41')][_0x0fe2('0x24')]);_0x54cb77[_0x0fe2('0x22')]=qs[_0x0fe2('0x22')](_0xfd5572[_0x0fe2('0x41')]['offset']);}_0x54cb77[_0x0fe2('0x4a')]=qs[_0x0fe2('0x4b')](_0xfd5572[_0x0fe2('0x41')][_0x0fe2('0x4b')]);_0x54cb77['where']=qs['filters'](_[_0x0fe2('0xc1')](_0xfd5572[_0x0fe2('0x41')],_0xcefb3c['filters']));_0x54cb77[_0x0fe2('0x75')][_0x0fe2('0xb2')]=_0x192056['id'];if(_0xfd5572[_0x0fe2('0x41')]['filter']){_0x54cb77[_0x0fe2('0x75')]=_[_0x0fe2('0x9e')](_0x54cb77[_0x0fe2('0x75')],{'$or':_['map'](_0x54cb77[_0x0fe2('0x46')],function(_0xe976c2){var _0x362b0c={};_0x362b0c[_0xe976c2]={'$like':'%'+_0xfd5572[_0x0fe2('0x41')][_0x0fe2('0x83')]+'%'};return _0x362b0c;})});}if(_0xfd5572['query']['$gte']){var _0x1dd5df=_0xfd5572['query']['$gte'][_0x0fe2('0x6d')](',');var _0x457bbf={};_0x457bbf[_0x1dd5df[0x0]]={'$gte':moment(_0x1dd5df[0x1])[_0x0fe2('0xc2')](_0x0fe2('0xc3'))};_0x54cb77[_0x0fe2('0x75')]=_['merge'](_0x54cb77[_0x0fe2('0x75')],_0x457bbf);}_0x54cb77=_[_0x0fe2('0x9e')]({},_0x54cb77,_0xfd5572[_0x0fe2('0xb7')]);return db[_0x0fe2('0xbe')][_0x0fe2('0x25')]({'where':_0x54cb77['where']})[_0x0fe2('0x2c')](function(_0x2978ad){_0x262e0c['count']=_0x2978ad;if(_0xfd5572['query'][_0x0fe2('0xb5')]){_0x54cb77['include']=[{'all':!![]}];}return db[_0x0fe2('0xbe')][_0x0fe2('0xc4')](_0x54cb77);})[_0x0fe2('0x2c')](function(_0x3a09c4){_0x262e0c[_0x0fe2('0xb4')]=_0x3a09c4;return _0x262e0c;});}})['then'](respondWithFilteredResult(_0x2fe5d2,_0x54cb77))['catch'](handleError(_0x2fe5d2,null));};exports[_0x0fe2('0xc5')]=function(_0x27df77,_0xc1272c,_0x320ac8){return db[_0x0fe2('0xb8')][_0x0fe2('0x60')]({'where':{'id':_0x27df77[_0x0fe2('0xbb')]['id']}})[_0x0fe2('0x2c')](handleEntityNotFound(_0xc1272c,null))[_0x0fe2('0x2c')](function(_0x4a6d20){if(_0x4a6d20){return _0x4a6d20[_0x0fe2('0xc6')](_0x27df77[_0x0fe2('0xba')][_0x0fe2('0xbf')],_['omit'](_0x27df77['body'],[_0x0fe2('0xbf'),'id'])||{})[_0x0fe2('0xc7')](function(){return db[_0x0fe2('0x6c')][_0x0fe2('0xc4')]({'attributes':['id',_0x0fe2('0x2d'),_0x0fe2('0xc8')],'where':{'id':_0x27df77[_0x0fe2('0xba')][_0x0fe2('0xbf')]}});})[_0x0fe2('0x2c')](function(_0x148b2d){socket[_0x0fe2('0xc9')](_0x0fe2('0xca'),{'id':Number(_0x27df77[_0x0fe2('0xbb')]['id']),'tags':_0x148b2d||[]});return{'id':Number(_0x27df77['params']['id']),'tags':_0x148b2d||[]};});}})['then'](respondWithResult(_0xc1272c,null))[_0x0fe2('0x35')](handleError(_0xc1272c,null));};exports[_0x0fe2('0xcb')]=function(_0x3acae4,_0x1a8e7d,_0x401e7d){return db[_0x0fe2('0xb8')]['find']({'where':{'id':_0x3acae4['params']['id']}})['then'](handleEntityNotFound(_0x1a8e7d,null))['then'](function(_0x53514b){if(_0x53514b){return _0x53514b[_0x0fe2('0xcb')](_0x3acae4[_0x0fe2('0x41')][_0x0fe2('0xbf')]);}})['then'](respondWithStatusCode(_0x1a8e7d,null))[_0x0fe2('0x35')](handleError(_0x1a8e7d,null));};exports[_0x0fe2('0xcc')]=function(_0x29883f,_0x4deec9){var _0x15dc19=moment()[_0x0fe2('0xcd')]()[_0x0fe2('0x9c')]();var _0x5efb47=path[_0x0fe2('0xce')](config[_0x0fe2('0xcf')],_0x0fe2('0xd0'),_0x0fe2('0xd1'),'tmp');var _0x5a9217=path['join'](config['root'],'server',_0x0fe2('0xd1'),_0x0fe2('0xd2'));var _0x1b0d49=path[_0x0fe2('0xce')](_0x5efb47,_0x15dc19);var _0x2a841b=util[_0x0fe2('0xc2')](_0x0fe2('0xd3'),_0x29883f['params']['id'],_0x15dc19);var _0x550bce=path[_0x0fe2('0xce')](_0x5efb47,_0x2a841b);var _0x4f7cdd=[];_0x4f7cdd['push']({'model':db[_0x0fe2('0x6f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4f7cdd['push']({'model':db[_0x0fe2('0xd4')],'as':_0x0fe2('0x64'),'attributes':['id',_0x0fe2('0xd5'),'lastName'],'raw':!![]});var _0x2f43a5=[{'model':db[_0x0fe2('0xbe')],'as':_0x0fe2('0xd6'),'attributes':['id','body',_0x0fe2('0x78'),_0x0fe2('0xd7'),_0x0fe2('0xd8'),_0x0fe2('0x7e')],'include':_0x4f7cdd}];_0x2f43a5[_0x0fe2('0x34')]({'model':db[_0x0fe2('0xd9')],'as':'Account','attributes':['id',_0x0fe2('0x2d')]});_0x2f43a5[_0x0fe2('0x34')]({'model':db['User'],'as':_0x0fe2('0xda'),'attributes':['id',_0x0fe2('0x31')]});return db[_0x0fe2('0xb8')][_0x0fe2('0x60')]({'where':{'id':_0x29883f[_0x0fe2('0xbb')]['id']},'include':_0x2f43a5})[_0x0fe2('0x2c')](handleEntityNotFound(_0x4deec9,null))[_0x0fe2('0x2c')](function(_0xb483e0){if(_0xb483e0){var _0x452214=_0xb483e0[_0x0fe2('0xdb')]({'plain':!![]});fs[_0x0fe2('0xdc')](_0x1b0d49);var _0x3fda07={'channel':'Sms','account':_0x452214[_0x0fe2('0xdd')][_0x0fe2('0x2d')],'agent':_0x452214[_0x0fe2('0xda')]?_0x452214[_0x0fe2('0xda')][_0x0fe2('0x31')]:'N.A.','createdAt':moment(_0x452214[_0x0fe2('0x78')])['format'](_0x0fe2('0xc3'))[_0x0fe2('0x9c')](),'closedAt':_0x452214[_0x0fe2('0x38')]?moment(_0x452214[_0x0fe2('0xde')])['format'](_0x0fe2('0xc3'))[_0x0fe2('0x9c')]():'','disposition':_0x452214[_0x0fe2('0xdf')],'messages':_(_0x452214[_0x0fe2('0xd6')])[_0x0fe2('0x83')]({'secret':![]})[_0x0fe2('0x30')](function(_0x562d86){return{'date':moment(_0x562d86[_0x0fe2('0x78')])[_0x0fe2('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x562d86[_0x0fe2('0xd7')]===_0x0fe2('0xe0')?_0x562d86[_0x0fe2('0x6f')]?_0x562d86[_0x0fe2('0x6f')][_0x0fe2('0x31')]:_0x0fe2('0xe1'):_0x562d86[_0x0fe2('0x64')][_0x0fe2('0xd5')]+(_0x562d86[_0x0fe2('0x64')][_0x0fe2('0xe2')]?'\x20'+_0x562d86['Contact'][_0x0fe2('0xe2')]:''),'body':_0x562d86[_0x0fe2('0xba')],'direction':_0x562d86[_0x0fe2('0xd7')]==='out'?'A':'C','secret':_0x562d86[_0x0fe2('0xd8')],'read':_0x562d86[_0x0fe2('0x7e')]};})[_0x0fe2('0x61')]()};return ejs[_0x0fe2('0xe3')](path['join'](config['root'],_0x0fe2('0xd0'),_0x0fe2('0xe4'),_0x0fe2('0xe5')),{'interaction':_0x3fda07})[_0x0fe2('0x2c')](function(_0x36e653){var _0x4db940=path[_0x0fe2('0xce')](_0x1b0d49,_0x0fe2('0xe6')+_0x452214['id']+'-'+_0x15dc19+_0x0fe2('0xe7'));var _0x36357e={'path':_0x4db940,'channel':'Sms','interactionId':_0x452214['id']};return pdf[_0x0fe2('0xe8')](_0x36e653,_0x36357e);})['then'](function(){return new BPromise(function(_0x57129f,_0x30793f){zipdir(_0x1b0d49,{'saveTo':_0x550bce},function(_0x258a58,_0x50298d){if(_0x258a58)return _0x30793f(_0x258a58);return _0x57129f(_0x50298d);});})['then'](function(){return new BPromise(function(_0x482e22,_0x1dd515){rimraf(_0x1b0d49,function(_0x52644b){if(_0x52644b)_0x1dd515(_0x52644b);return _0x482e22();});});})[_0x0fe2('0x2c')](function(){return _0x4deec9[_0x0fe2('0xcc')](_0x550bce,_0x2a841b,function(_0x559145){if(_0x559145){console[_0x0fe2('0xe9')](_0x0fe2('0xea'),_0x559145);}else{fs[_0x0fe2('0xeb')](_0x550bce);}});});});}else{return _0x4deec9['sendStatus'](0xc8);}})[_0x0fe2('0x35')](handleError(_0x4deec9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d195742..c644651 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 _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x17dd52,_0x532e39){var _0x47fbb4=function(_0x184d24){while(--_0x184d24){_0x17dd52['push'](_0x17dd52['shift']());}};_0x47fbb4(++_0x532e39);}(_0x583c,0x12b));var _0xc583=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x583c[_0x270adf];return _0x29eda9;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x02ce=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x56da1e,_0x4fd91e){var _0x6d71b5=function(_0x477db1){while(--_0x477db1){_0x56da1e['push'](_0x56da1e['shift']());}};_0x6d71b5(++_0x4fd91e);}(_0x02ce,0x1ac));var _0xe02c=function(_0x145524,_0x493257){_0x145524=_0x145524-0x0;var _0x49c702=_0x02ce[_0x145524];return _0x49c702;};'use strict';var EventEmitter=require(_0xe02c('0x0'));var SmsInteraction=require(_0xe02c('0x1'))['db'][_0xe02c('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xe02c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe02c('0x4'),'afterUpdate':_0xe02c('0x5'),'afterDestroy':_0xe02c('0x6')};function emitEvent(_0xf4b764){return function(_0x41b41c,_0x229653,_0x3f7436){_0x41b41c[_0xe02c('0x7')]({'attributes':['id'],'raw':!![]})[_0xe02c('0x8')](function(_0x4fecb3){_0x41b41c['setDataValue'](_0xe02c('0x9'),_0x4fecb3[_0xe02c('0xa')](function(_0x469932){return{'id':_0x469932['id']};}));return SmsMessage[_0xe02c('0xb')]({'where':{'SmsInteractionId':_0x41b41c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe02c('0x8')](function(_0x18a398){_0x41b41c[_0xe02c('0xc')](_0xe02c('0xd'),_0x18a398[_0xe02c('0xe')]);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764+':'+_0x41b41c['id'],_0x41b41c);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764,_0x41b41c);_0x3f7436(null);})[_0xe02c('0x10')](_0x3f7436(null));};}for(var e in events){if(events[_0xe02c('0x11')](e)){var event=events[e];SmsInteraction[_0xe02c('0x12')](e,emitEvent(event));}}module[_0xe02c('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 265b8f7..7a301f3 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 _0x4aba=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed'];(function(_0x403138,_0x37e366){var _0x9ed73a=function(_0x30f89e){while(--_0x30f89e){_0x403138['push'](_0x403138['shift']());}};_0x9ed73a(++_0x37e366);}(_0x4aba,0x173));var _0xa4ab=function(_0x21a387,_0x2cda9e){_0x21a387=_0x21a387-0x0;var _0x19806a=_0x4aba[_0x21a387];return _0x19806a;};'use strict';var _=require(_0xa4ab('0x0'));var util=require('util');var logger=require(_0xa4ab('0x1'))(_0xa4ab('0x2'));var moment=require('moment');var BPromise=require(_0xa4ab('0x3'));var rp=require(_0xa4ab('0x4'));var fs=require('fs');var path=require(_0xa4ab('0x5'));var rimraf=require('rimraf');var config=require(_0xa4ab('0x6'));var attributes=require(_0xa4ab('0x7'));module[_0xa4ab('0x8')]=function(_0x2d0dd0,_0x25a9ee){return _0x2d0dd0[_0xa4ab('0x9')](_0xa4ab('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7aaf3,_0x157756,_0x5dd0de){if(_0x7aaf3[_0xa4ab('0xb')](_0xa4ab('0xc'))){_0x7aaf3[_0xa4ab('0xd')]=moment()[_0xa4ab('0xe')](_0xa4ab('0xf'));}_0x5dd0de(null,_0x7aaf3);}}});}; \ No newline at end of file +var _0x2e67=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger'];(function(_0x3cb8d6,_0x8190da){var _0x200e3f=function(_0x97560){while(--_0x97560){_0x3cb8d6['push'](_0x3cb8d6['shift']());}};_0x200e3f(++_0x8190da);}(_0x2e67,0x1a3));var _0x72e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2e67[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x72e6('0x0'))(_0x72e6('0x1'));var moment=require(_0x72e6('0x2'));var BPromise=require(_0x72e6('0x3'));var rp=require(_0x72e6('0x4'));var fs=require('fs');var path=require(_0x72e6('0x5'));var rimraf=require(_0x72e6('0x6'));var config=require(_0x72e6('0x7'));var attributes=require(_0x72e6('0x8'));module['exports']=function(_0x1e645f,_0x4dd0f2){return _0x1e645f[_0x72e6('0x9')](_0x72e6('0xa'),attributes,{'tableName':_0x72e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d8a61,_0xab394c,_0x3353ee){if(_0x3d8a61['changed'](_0x72e6('0xc'))){_0x3d8a61[_0x72e6('0xd')]=moment()['format'](_0x72e6('0xe'));}_0x3353ee(null,_0x3d8a61);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 564129c..a509bd2 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 _0x3819=['body','options','raw','where','attributes','limit','then','stringify','catch','AddTagsToSmsInteraction','find','addTags','omit','ids','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x3b0918,_0xbcb095){var _0x1a9c27=function(_0x25d71d){while(--_0x25d71d){_0x3b0918['push'](_0x3b0918['shift']());}};_0x1a9c27(++_0xbcb095);}(_0x3819,0xf2));var _0x9381=function(_0x51cc83,_0x3123bc){_0x51cc83=_0x51cc83-0x0;var _0x44691d=_0x3819[_0x51cc83];return _0x44691d;};'use strict';var _=require(_0x9381('0x0'));var util=require(_0x9381('0x1'));var moment=require(_0x9381('0x2'));var BPromise=require(_0x9381('0x3'));var rs=require(_0x9381('0x4'));var fs=require('fs');var Redis=require(_0x9381('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9381('0x6'));var logger=require(_0x9381('0x7'))(_0x9381('0x8'));var config=require('../../config/environment');var jayson=require(_0x9381('0x9'));var client=jayson[_0x9381('0xa')][_0x9381('0xb')]({'port':0x232a});config[_0x9381('0xc')]=_[_0x9381('0xd')](config[_0x9381('0xc')],{'host':_0x9381('0xe'),'port':0x18eb});var socket=require(_0x9381('0xf'))(new Redis(config[_0x9381('0xc')]));require('./smsInteraction.socket')[_0x9381('0x10')](socket);function respondWithRpcPromise(_0x55ee1e,_0xbc053b,_0x3746d5){return new BPromise(function(_0x2f9610,_0x1f4a00){return client[_0x9381('0x11')](_0x55ee1e,_0x3746d5)['then'](function(_0x525f95){logger[_0x9381('0x12')](_0x9381('0x13'),_0xbc053b,_0x9381('0x14'));logger['debug'](_0x9381('0x15'),_0xbc053b,_0x9381('0x14'),JSON['stringify'](_0x525f95));if(_0x525f95['error']){if(_0x525f95[_0x9381('0x16')]['code']===0x1f4){logger[_0x9381('0x16')](_0x9381('0x13'),_0xbc053b,_0x525f95[_0x9381('0x16')][_0x9381('0x17')]);return _0x1f4a00(_0x525f95[_0x9381('0x16')][_0x9381('0x17')]);}logger['error'](_0x9381('0x13'),_0xbc053b,_0x525f95[_0x9381('0x16')][_0x9381('0x17')]);return _0x2f9610(_0x525f95['error'][_0x9381('0x17')]);}else{logger[_0x9381('0x12')](_0x9381('0x13'),_0xbc053b,_0x9381('0x14'));_0x2f9610(_0x525f95[_0x9381('0x18')]['message']);}})['catch'](function(_0x107a7c){logger[_0x9381('0x16')](_0x9381('0x13'),_0xbc053b,_0x107a7c);_0x1f4a00(_0x107a7c);});});}exports[_0x9381('0x19')]=function(_0x14521e){var _0x1c1e69=this;return new Promise(function(_0x11894f,_0x190734){return db[_0x9381('0x1a')][_0x9381('0x1b')](_0x14521e[_0x9381('0x1c')],{'raw':_0x14521e['options']?_0x14521e[_0x9381('0x1d')][_0x9381('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14521e[_0x9381('0x1d')]?_0x14521e[_0x9381('0x1d')][_0x9381('0x1f')]||null:null,'attributes':_0x14521e[_0x9381('0x1d')]?_0x14521e[_0x9381('0x1d')][_0x9381('0x20')]||null:null,'limit':_0x14521e[_0x9381('0x1d')]?_0x14521e[_0x9381('0x1d')][_0x9381('0x21')]||null:null})[_0x9381('0x22')](function(_0x32a091){logger[_0x9381('0x12')](_0x9381('0x19'),_0x14521e);logger['debug'](_0x9381('0x19'),_0x14521e,JSON[_0x9381('0x23')](_0x32a091));_0x11894f(_0x32a091);})[_0x9381('0x24')](function(_0x361988){logger[_0x9381('0x16')](_0x9381('0x19'),_0x361988['message'],_0x14521e);_0x190734(_0x1c1e69['error'](0x1f4,_0x361988[_0x9381('0x17')]));});});};exports[_0x9381('0x25')]=function(_0x576c3d){return new Promise(function(_0x4a0a52,_0x3330a7){return db[_0x9381('0x1a')][_0x9381('0x26')]({'where':_0x576c3d[_0x9381('0x1d')]?_0x576c3d[_0x9381('0x1d')][_0x9381('0x1f')]||null:null})[_0x9381('0x22')](function(_0x4d34d4){if(_0x4d34d4){return _0x4d34d4[_0x9381('0x27')](_0x576c3d[_0x9381('0x1c')]['ids'],_[_0x9381('0x28')](_0x576c3d[_0x9381('0x1c')],[_0x9381('0x29'),'id'])||{});}})[_0x9381('0x2a')](function(_0x267882){logger[_0x9381('0x12')](_0x9381('0x2b'),_0x576c3d);logger[_0x9381('0x2c')](_0x9381('0x2b'),_0x576c3d,JSON[_0x9381('0x23')](_0x267882));_0x4a0a52(_0x267882);})['catch'](function(_0x2261f9){logger[_0x9381('0x16')](_0x9381('0x2b'),_0x2261f9[_0x9381('0x17')],_0x576c3d);_0x3330a7(_this[_0x9381('0x16')](0x1f4,_0x2261f9[_0x9381('0x17')]));});});}; \ No newline at end of file +var _0xd05e=['find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','SmsInteraction'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xd05e,0x11e));var _0xed05=function(_0x592e7e,_0x1aac28){_0x592e7e=_0x592e7e-0x0;var _0x41ede4=_0xd05e[_0x592e7e];return _0x41ede4;};'use strict';var _=require(_0xed05('0x0'));var util=require('util');var moment=require(_0xed05('0x1'));var BPromise=require('bluebird');var rs=require(_0xed05('0x2'));var fs=require('fs');var Redis=require(_0xed05('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xed05('0x4'));var logger=require(_0xed05('0x5'))(_0xed05('0x6'));var config=require('../../config/environment');var jayson=require(_0xed05('0x7'));var client=jayson['client'][_0xed05('0x8')]({'port':0x232a});config[_0xed05('0x9')]=_[_0xed05('0xa')](config[_0xed05('0x9')],{'host':_0xed05('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed05('0x9')]));require('./smsInteraction.socket')[_0xed05('0xc')](socket);function respondWithRpcPromise(_0x1516bc,_0x594cac,_0xf16931){return new BPromise(function(_0xe78a71,_0x1522f9){return client[_0xed05('0xd')](_0x1516bc,_0xf16931)[_0xed05('0xe')](function(_0x355efc){logger[_0xed05('0xf')](_0xed05('0x10'),_0x594cac,_0xed05('0x11'));logger[_0xed05('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x594cac,_0xed05('0x11'),JSON[_0xed05('0x13')](_0x355efc));if(_0x355efc['error']){if(_0x355efc[_0xed05('0x14')]['code']===0x1f4){logger[_0xed05('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x594cac,_0x355efc[_0xed05('0x14')][_0xed05('0x15')]);return _0x1522f9(_0x355efc[_0xed05('0x14')]['message']);}logger[_0xed05('0x14')](_0xed05('0x10'),_0x594cac,_0x355efc[_0xed05('0x14')][_0xed05('0x15')]);return _0xe78a71(_0x355efc['error'][_0xed05('0x15')]);}else{logger[_0xed05('0xf')](_0xed05('0x10'),_0x594cac,_0xed05('0x11'));_0xe78a71(_0x355efc[_0xed05('0x16')]['message']);}})[_0xed05('0x17')](function(_0x26a1a1){logger[_0xed05('0x14')](_0xed05('0x10'),_0x594cac,_0x26a1a1);_0x1522f9(_0x26a1a1);});});}exports[_0xed05('0x18')]=function(_0x1ed957){var _0x166687=this;return new Promise(function(_0x175a66,_0x360910){return db['SmsInteraction'][_0xed05('0x19')](_0x1ed957[_0xed05('0x1a')],{'raw':_0x1ed957[_0xed05('0x1b')]?_0x1ed957[_0xed05('0x1b')][_0xed05('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed957[_0xed05('0x1b')]?_0x1ed957[_0xed05('0x1b')][_0xed05('0x1d')]||null:null,'attributes':_0x1ed957[_0xed05('0x1b')]?_0x1ed957[_0xed05('0x1b')][_0xed05('0x1e')]||null:null,'limit':_0x1ed957[_0xed05('0x1b')]?_0x1ed957[_0xed05('0x1b')][_0xed05('0x1f')]||null:null})[_0xed05('0xe')](function(_0x4044d1){logger[_0xed05('0xf')](_0xed05('0x18'),_0x1ed957);logger[_0xed05('0x12')](_0xed05('0x18'),_0x1ed957,JSON[_0xed05('0x13')](_0x4044d1));_0x175a66(_0x4044d1);})[_0xed05('0x17')](function(_0x3b3250){logger['error'](_0xed05('0x18'),_0x3b3250['message'],_0x1ed957);_0x360910(_0x166687['error'](0x1f4,_0x3b3250[_0xed05('0x15')]));});});};exports[_0xed05('0x20')]=function(_0x22a7eb){return new Promise(function(_0x12195e,_0x239e5a){return db[_0xed05('0x21')][_0xed05('0x22')]({'where':_0x22a7eb[_0xed05('0x1b')]?_0x22a7eb[_0xed05('0x1b')][_0xed05('0x1d')]||null:null})['then'](function(_0x15d61f){if(_0x15d61f){return _0x15d61f[_0xed05('0x23')](_0x22a7eb[_0xed05('0x1a')][_0xed05('0x24')],_[_0xed05('0x25')](_0x22a7eb[_0xed05('0x1a')],[_0xed05('0x24'),'id'])||{});}})[_0xed05('0x26')](function(_0x39341f){logger[_0xed05('0xf')](_0xed05('0x27'),_0x22a7eb);logger[_0xed05('0x12')](_0xed05('0x27'),_0x22a7eb,JSON[_0xed05('0x13')](_0x39341f));_0x12195e(_0x39341f);})['catch'](function(_0x5a1553){logger[_0xed05('0x14')]('AddTags',_0x5a1553[_0xed05('0x15')],_0x22a7eb);_0x239e5a(_this[_0xed05('0x14')](0x1f4,_0x5a1553[_0xed05('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index da13707..2c32419 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 _0x61be=['smsInteraction:','./smsInteraction.events','remove','update','removeListener','register','length'];(function(_0x318155,_0x56e72e){var _0x352470=function(_0x253313){while(--_0x253313){_0x318155['push'](_0x318155['shift']());}};_0x352470(++_0x56e72e);}(_0x61be,0x190));var _0xe61b=function(_0x303986,_0x5c751c){_0x303986=_0x303986-0x0;var _0x4c4431=_0x61be[_0x303986];return _0x4c4431;};'use strict';var SmsInteractionEvents=require(_0xe61b('0x0'));var events=['save',_0xe61b('0x1'),_0xe61b('0x2')];function createListener(_0x1275c7,_0x6f6ff5){return function(_0x492298){_0x6f6ff5['emit'](_0x1275c7,_0x492298);};}function removeListener(_0x4e30fd,_0x3c0756){return function(){SmsInteractionEvents[_0xe61b('0x3')](_0x4e30fd,_0x3c0756);};}exports[_0xe61b('0x4')]=function(_0x32fc9c){for(var _0x3ed1a5=0x0,_0x1074fd=events[_0xe61b('0x5')];_0x3ed1a5<_0x1074fd;_0x3ed1a5++){var _0x57debb=events[_0x3ed1a5];var _0x3c662b=createListener(_0xe61b('0x6')+_0x57debb,_0x32fc9c);SmsInteractionEvents['on'](_0x57debb,_0x3c662b);}}; \ No newline at end of file +var _0xc52d=['remove','update','removeListener','register','length','./smsInteraction.events'];(function(_0xb13527,_0x37c392){var _0x23a645=function(_0x3607ff){while(--_0x3607ff){_0xb13527['push'](_0xb13527['shift']());}};_0x23a645(++_0x37c392);}(_0xc52d,0xb9));var _0xdc52=function(_0x295cc3,_0x29338c){_0x295cc3=_0x295cc3-0x0;var _0x454942=_0xc52d[_0x295cc3];return _0x454942;};'use strict';var SmsInteractionEvents=require(_0xdc52('0x0'));var events=['save',_0xdc52('0x1'),_0xdc52('0x2')];function createListener(_0x2391a6,_0x3f3582){return function(_0x4ec665){_0x3f3582['emit'](_0x2391a6,_0x4ec665);};}function removeListener(_0x2debff,_0x4cddf9){return function(){SmsInteractionEvents[_0xdc52('0x3')](_0x2debff,_0x4cddf9);};}exports[_0xdc52('0x4')]=function(_0x273b78){for(var _0x17f96a=0x0,_0x1fc18e=events[_0xdc52('0x5')];_0x17f96a<_0x1fc18e;_0x17f96a++){var _0x1bd515=events[_0x17f96a];var _0x2e981c=createListener('smsInteraction:'+_0x1bd515,_0x273b78);SmsInteractionEvents['on'](_0x1bd515,_0x2e981c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d155d1f..2d22f67 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 _0xd6ab=['/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','show','post','tracked','sms','smsmessage:create','put','/:id','update','/:id/accept','accept'];(function(_0x9ad37c,_0x27f705){var _0x461b47=function(_0xcfe774){while(--_0xcfe774){_0x9ad37c['push'](_0x9ad37c['shift']());}};_0x461b47(++_0x27f705);}(_0xd6ab,0x124));var _0xbd6a=function(_0x51fe15,_0x138833){_0x51fe15=_0x51fe15-0x0;var _0x103d3f=_0xd6ab[_0x51fe15];return _0x103d3f;};'use strict';var multer=require(_0xbd6a('0x0'));var util=require(_0xbd6a('0x1'));var path=require(_0xbd6a('0x2'));var timeout=require(_0xbd6a('0x3'));var express=require(_0xbd6a('0x4'));var router=express[_0xbd6a('0x5')]();var fs_extra=require(_0xbd6a('0x6'));var auth=require(_0xbd6a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0xbd6a('0x8')]('/',auth[_0xbd6a('0x9')](),controller['index']);router[_0xbd6a('0x8')]('/describe',auth[_0xbd6a('0x9')](),controller['describe']);router[_0xbd6a('0x8')]('/:id',auth[_0xbd6a('0x9')](),controller[_0xbd6a('0xa')]);router[_0xbd6a('0xb')]('/',auth[_0xbd6a('0x9')](),interaction[_0xbd6a('0xc')](_0xbd6a('0xd'),_0xbd6a('0xe')),controller['create']);router[_0xbd6a('0xb')]('/:id/status',controller['status']);router[_0xbd6a('0xf')](_0xbd6a('0x10'),auth[_0xbd6a('0x9')](),controller[_0xbd6a('0x11')]);router[_0xbd6a('0xf')](_0xbd6a('0x12'),auth['isAuthenticated'](),controller[_0xbd6a('0x13')]);router[_0xbd6a('0xf')](_0xbd6a('0x14'),auth[_0xbd6a('0x9')](),controller[_0xbd6a('0x15')]);router['delete']('/:id',auth[_0xbd6a('0x9')](),controller[_0xbd6a('0x16')]);module[_0xbd6a('0x17')]=router; \ No newline at end of file +var _0x22f3=['../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x484f81,_0x3e18d4){var _0x3d262f=function(_0x523e6f){while(--_0x523e6f){_0x484f81['push'](_0x484f81['shift']());}};_0x3d262f(++_0x3e18d4);}(_0x22f3,0x155));var _0x322f=function(_0x57619a,_0xe16536){_0x57619a=_0x57619a-0x0;var _0xb177c8=_0x22f3[_0x57619a];return _0xb177c8;};'use strict';var multer=require(_0x322f('0x0'));var util=require(_0x322f('0x1'));var path=require(_0x322f('0x2'));var timeout=require(_0x322f('0x3'));var express=require(_0x322f('0x4'));var router=express['Router']();var fs_extra=require(_0x322f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x322f('0x6'));var config=require(_0x322f('0x7'));var controller=require('./smsMessage.controller');router[_0x322f('0x8')]('/',auth['isAuthenticated'](),controller[_0x322f('0x9')]);router['get'](_0x322f('0xa'),auth['isAuthenticated'](),controller[_0x322f('0xb')]);router[_0x322f('0x8')](_0x322f('0xc'),auth[_0x322f('0xd')](),controller[_0x322f('0xe')]);router[_0x322f('0xf')]('/',auth[_0x322f('0xd')](),interaction[_0x322f('0x10')](_0x322f('0x11'),_0x322f('0x12')),controller[_0x322f('0x13')]);router['post'](_0x322f('0x14'),controller[_0x322f('0x15')]);router[_0x322f('0x16')](_0x322f('0xc'),auth[_0x322f('0xd')](),controller[_0x322f('0x17')]);router[_0x322f('0x16')]('/:id/accept',auth[_0x322f('0xd')](),controller[_0x322f('0x18')]);router[_0x322f('0x16')](_0x322f('0x19'),auth[_0x322f('0xd')](),controller[_0x322f('0x1a')]);router[_0x322f('0x1b')](_0x322f('0xc'),auth['isAuthenticated'](),controller[_0x322f('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 11cc95c..4ee56a4 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 _0xed41=['out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports','medium','ENUM'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xed41,0x19a));var _0x1ed4=function(_0x102320,_0x3c6ec1){_0x102320=_0x102320-0x0;var _0x16c398=_0xed41[_0x102320];return _0x16c398;};'use strict';var Sequelize=require(_0x1ed4('0x0'));module[_0x1ed4('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1ed4('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ed4('0x3')]('in',_0x1ed4('0x4')),'defaultValue':_0x1ed4('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1ed4('0x5')](0xbe)},'phone':{'type':Sequelize[_0x1ed4('0x5')]},'readAt':{'type':Sequelize[_0x1ed4('0x6')]},'secret':{'type':Sequelize[_0x1ed4('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1ed4('0x5')]},'providerResponse':{'type':Sequelize[_0x1ed4('0x8')]}}; \ No newline at end of file +var _0x8be6=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0x8be6,0x1e9));var _0x68be=function(_0x1a9e9e,_0x3a4d89){_0x1a9e9e=_0x1a9e9e-0x0;var _0x57cee2=_0x8be6[_0x1a9e9e];return _0x57cee2;};'use strict';var Sequelize=require(_0x68be('0x0'));module[_0x68be('0x1')]={'body':{'type':Sequelize[_0x68be('0x2')](_0x68be('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x68be('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x68be('0x5')]('in',_0x68be('0x6')),'defaultValue':_0x68be('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x68be('0x7')](0xbe)},'phone':{'type':Sequelize[_0x68be('0x7')]},'readAt':{'type':Sequelize[_0x68be('0x8')]},'secret':{'type':Sequelize[_0x68be('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x68be('0x7')]},'providerResponse':{'type':Sequelize[_0x68be('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 044476d..afa127c 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 _0xa509=['interface','channel','motionChannel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','SELECT','SIP/%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','indexOf','delivered','Status','plivio','infobip','results','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','register','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','status','end','json','offset','undefined','count','Content-Range','reject','save','update','destroy','stack','name','send','index','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa509,0x12f));var _0x9a50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa509[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9a50('0x0'));var rimraf=require(_0x9a50('0x1'));var zipdir=require(_0x9a50('0x2'));var jsonpatch=require(_0x9a50('0x3'));var rp=require('request-promise');var moment=require(_0x9a50('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9a50('0x5'));var util=require(_0x9a50('0x6'));var path=require(_0x9a50('0x7'));var sox=require(_0x9a50('0x8'));var csv=require('to-csv');var ejs=require(_0x9a50('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a50('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a50('0xb'));var querystring=require(_0x9a50('0xc'));var Papa=require(_0x9a50('0xd'));var Redis=require(_0x9a50('0xe'));var authService=require(_0x9a50('0xf'));var qs=require(_0x9a50('0x10'));var as=require(_0x9a50('0x11'));var hardwareService=require(_0x9a50('0x12'));var logger=require(_0x9a50('0x13'))(_0x9a50('0x14'));var utils=require(_0x9a50('0x15'));var config=require(_0x9a50('0x16'));var licenseUtil=require(_0x9a50('0x17'));var db=require(_0x9a50('0x18'))['db'];config[_0x9a50('0x19')]=_[_0x9a50('0x1a')](config[_0x9a50('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a50('0x19')]));require(_0x9a50('0x1b'))[_0x9a50('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9a50('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x9a50('0x1d')][_0x9a50('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5c854f,_0xe639b3,_0x52eceb,_0x583d69){return new BPromise(function(_0x9c0cc7,_0x5ef73e){var _0x1c58e4=_0x583d69||client;return _0x1c58e4[_0x9a50('0x1f')](_0x5c854f,_0x52eceb)[_0x9a50('0x20')](function(_0x4f39e0){logger['info'](_0x9a50('0x21'),_0xe639b3,_0x9a50('0x22'));logger[_0x9a50('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe639b3,_0x9a50('0x22'),JSON[_0x9a50('0x24')](_0x4f39e0));if(_0x4f39e0[_0x9a50('0x25')]){if(_0x4f39e0['error'][_0x9a50('0x26')]===0x1f4){logger['error'](_0x9a50('0x21'),_0xe639b3,_0x4f39e0[_0x9a50('0x25')][_0x9a50('0x27')]);return _0x5ef73e(_0x4f39e0[_0x9a50('0x25')][_0x9a50('0x27')]);}logger[_0x9a50('0x25')]('SmsMessage,\x20%s,\x20%s',_0xe639b3,_0x4f39e0[_0x9a50('0x25')][_0x9a50('0x27')]);return _0x9c0cc7(_0x4f39e0[_0x9a50('0x25')]['message']);}else{logger[_0x9a50('0x28')](_0x9a50('0x21'),_0xe639b3,_0x9a50('0x22'));_0x9c0cc7(_0x4f39e0['result'][_0x9a50('0x27')]);}})[_0x9a50('0x29')](function(_0x1fc74a){logger[_0x9a50('0x25')](_0x9a50('0x21'),_0xe639b3,_0x1fc74a);_0x5ef73e(_0x1fc74a);});});}function respondWithStatusCode(_0x497cf0,_0x231e4a){_0x231e4a=_0x231e4a||0xcc;return function(_0x5b3a2d){if(_0x5b3a2d){return _0x497cf0['sendStatus'](_0x231e4a);}return _0x497cf0[_0x9a50('0x2a')](_0x231e4a)[_0x9a50('0x2b')]();};}function respondWithResult(_0x4ab3bc,_0x652ed5){_0x652ed5=_0x652ed5||0xc8;return function(_0x324309){if(_0x324309){return _0x4ab3bc[_0x9a50('0x2a')](_0x652ed5)[_0x9a50('0x2c')](_0x324309);}};}function respondWithFilteredResult(_0x4da435,_0x10f7d9){return function(_0xacaf3c){if(_0xacaf3c){var _0x2eb6e3=typeof _0x10f7d9[_0x9a50('0x2d')]===_0x9a50('0x2e')&&typeof _0x10f7d9['limit']===_0x9a50('0x2e');var _0x6710ba=_0xacaf3c['count'];var _0x7b86d8=_0x2eb6e3?0x0:_0x10f7d9['offset'];var _0x364ec8=_0x2eb6e3?_0xacaf3c[_0x9a50('0x2f')]:_0x10f7d9[_0x9a50('0x2d')]+_0x10f7d9['limit'];var _0xfeeb69;if(_0x364ec8>=_0x6710ba){_0x364ec8=_0x6710ba;_0xfeeb69=0xc8;}else{_0xfeeb69=0xce;}_0x4da435[_0x9a50('0x2a')](_0xfeeb69);return _0x4da435['set'](_0x9a50('0x30'),_0x7b86d8+'-'+_0x364ec8+'/'+_0x6710ba)[_0x9a50('0x2c')](_0xacaf3c);}return null;};}function patchUpdates(_0x2a334d){return function(_0x56ffc2){try{jsonpatch['apply'](_0x56ffc2,_0x2a334d,!![]);}catch(_0x225cde){return BPromise[_0x9a50('0x31')](_0x225cde);}return _0x56ffc2[_0x9a50('0x32')]();};}function saveUpdates(_0xc512e2,_0x4e7e14){return function(_0x18a0dd){if(_0x18a0dd){return _0x18a0dd[_0x9a50('0x33')](_0xc512e2)[_0x9a50('0x20')](function(_0x48a2d8){return _0x48a2d8;});}return null;};}function removeEntity(_0x1a41bf,_0x2d00b9){return function(_0x5d8e0b){if(_0x5d8e0b){return _0x5d8e0b[_0x9a50('0x34')]()[_0x9a50('0x20')](function(){_0x1a41bf[_0x9a50('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e71a7,_0x9bca8a){return function(_0x48d3b8){if(!_0x48d3b8){_0x2e71a7['sendStatus'](0x194);}return _0x48d3b8;};}function handleError(_0x2a6ddb,_0xb5998){_0xb5998=_0xb5998||0x1f4;return function(_0x5da069){logger[_0x9a50('0x25')](_0x5da069[_0x9a50('0x35')]);if(_0x5da069[_0x9a50('0x36')]){delete _0x5da069[_0x9a50('0x36')];}_0x2a6ddb[_0x9a50('0x2a')](_0xb5998)[_0x9a50('0x37')](_0x5da069);};}exports[_0x9a50('0x38')]=function(_0x28dced,_0x567711){var _0xfb6fc={},_0xc363c1={},_0x2a02b3={'count':0x0,'rows':[]};var _0x260ccf=_['map'](db['SmsMessage']['rawAttributes'],function(_0x1a785c){return{'name':_0x1a785c[_0x9a50('0x39')],'type':_0x1a785c[_0x9a50('0x3a')][_0x9a50('0x3b')]};});_0xc363c1[_0x9a50('0x3c')]=_['map'](_0x260ccf,_0x9a50('0x36'));_0xc363c1[_0x9a50('0x3d')]=_['keys'](_0x28dced[_0x9a50('0x3d')]);_0xc363c1[_0x9a50('0x3e')]=_[_0x9a50('0x3f')](_0xc363c1['model'],_0xc363c1[_0x9a50('0x3d')]);_0xfb6fc[_0x9a50('0x40')]=_[_0x9a50('0x3f')](_0xc363c1['model'],qs['fields'](_0x28dced[_0x9a50('0x3d')][_0x9a50('0x41')]));_0xfb6fc[_0x9a50('0x40')]=_0xfb6fc['attributes'][_0x9a50('0x42')]?_0xfb6fc[_0x9a50('0x40')]:_0xc363c1['model'];if(!_0x28dced['query'][_0x9a50('0x43')](_0x9a50('0x44'))){_0xfb6fc[_0x9a50('0x45')]=qs[_0x9a50('0x45')](_0x28dced['query'][_0x9a50('0x45')]);_0xfb6fc['offset']=qs[_0x9a50('0x2d')](_0x28dced[_0x9a50('0x3d')][_0x9a50('0x2d')]);}_0xfb6fc[_0x9a50('0x46')]=qs[_0x9a50('0x47')](_0x28dced[_0x9a50('0x3d')]['sort']);_0xfb6fc[_0x9a50('0x48')]=qs[_0x9a50('0x3e')](_[_0x9a50('0x49')](_0x28dced[_0x9a50('0x3d')],_0xc363c1[_0x9a50('0x3e')]),_0x260ccf);if(_0x28dced[_0x9a50('0x3d')]['filter']){_0xfb6fc[_0x9a50('0x48')]=_[_0x9a50('0x4a')](_0xfb6fc[_0x9a50('0x48')],{'$or':_['map'](_0x260ccf,function(_0x36bae4){if(_0x36bae4[_0x9a50('0x3a')]!==_0x9a50('0x4b')){var _0xcd2982={};_0xcd2982[_0x36bae4[_0x9a50('0x36')]]={'$like':'%'+_0x28dced[_0x9a50('0x3d')][_0x9a50('0x4c')]+'%'};return _0xcd2982;}})});}_0xfb6fc=_[_0x9a50('0x4a')]({},_0xfb6fc,_0x28dced[_0x9a50('0x4d')]);var _0x1c8210={'where':_0xfb6fc['where']};return db[_0x9a50('0x4e')][_0x9a50('0x2f')](_0x1c8210)['then'](function(_0x29c5ef){_0x2a02b3[_0x9a50('0x2f')]=_0x29c5ef;if(_0x28dced[_0x9a50('0x3d')][_0x9a50('0x4f')]){_0xfb6fc[_0x9a50('0x50')]=[{'all':!![]}];}return db[_0x9a50('0x4e')][_0x9a50('0x51')](_0xfb6fc);})[_0x9a50('0x20')](function(_0x3b1c11){_0x2a02b3[_0x9a50('0x52')]=_0x3b1c11;return _0x2a02b3;})['then'](respondWithFilteredResult(_0x567711,_0xfb6fc))[_0x9a50('0x29')](handleError(_0x567711,null));};exports[_0x9a50('0x53')]=function(_0xf34d84,_0x13af58){var _0x4d8a30={'raw':!![],'where':{'id':_0xf34d84[_0x9a50('0x54')]['id']}},_0x4f2a0f={};_0x4f2a0f[_0x9a50('0x3c')]=_[_0x9a50('0x55')](db[_0x9a50('0x4e')][_0x9a50('0x56')]);_0x4f2a0f['query']=_[_0x9a50('0x55')](_0xf34d84[_0x9a50('0x3d')]);_0x4f2a0f['filters']=_[_0x9a50('0x3f')](_0x4f2a0f['model'],_0x4f2a0f[_0x9a50('0x3d')]);_0x4d8a30[_0x9a50('0x40')]=_[_0x9a50('0x3f')](_0x4f2a0f[_0x9a50('0x3c')],qs['fields'](_0xf34d84[_0x9a50('0x3d')][_0x9a50('0x41')]));_0x4d8a30[_0x9a50('0x40')]=_0x4d8a30[_0x9a50('0x40')][_0x9a50('0x42')]?_0x4d8a30['attributes']:_0x4f2a0f['model'];if(_0xf34d84[_0x9a50('0x3d')][_0x9a50('0x4f')]){_0x4d8a30[_0x9a50('0x50')]=[{'all':!![]}];}_0x4d8a30=_['merge']({},_0x4d8a30,_0xf34d84[_0x9a50('0x4d')]);return db['SmsMessage'][_0x9a50('0x57')](_0x4d8a30)[_0x9a50('0x20')](handleEntityNotFound(_0x13af58,null))['then'](respondWithResult(_0x13af58,null))['catch'](handleError(_0x13af58,null));};exports[_0x9a50('0x58')]=function(_0x24357c,_0x1e67d2){return db['SmsMessage']['create'](_0x24357c['body'],{})[_0x9a50('0x20')](respondWithResult(_0x1e67d2,0xc9))[_0x9a50('0x29')](handleError(_0x1e67d2,null));};exports[_0x9a50('0x33')]=function(_0x371e6e,_0x129ee6){if(_0x371e6e['body']['id']){delete _0x371e6e['body']['id'];}return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x371e6e[_0x9a50('0x54')]['id']}})[_0x9a50('0x20')](handleEntityNotFound(_0x129ee6,null))[_0x9a50('0x20')](saveUpdates(_0x371e6e[_0x9a50('0x59')],null))[_0x9a50('0x20')](respondWithResult(_0x129ee6,null))[_0x9a50('0x29')](handleError(_0x129ee6,null));};exports['destroy']=function(_0x174765,_0x280b61){return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x174765[_0x9a50('0x54')]['id']}})[_0x9a50('0x20')](handleEntityNotFound(_0x280b61,null))[_0x9a50('0x20')](removeEntity(_0x280b61,null))[_0x9a50('0x29')](handleError(_0x280b61,null));};exports[_0x9a50('0x5a')]=function(_0x3afd8c,_0x10bd3a){return db[_0x9a50('0x4e')][_0x9a50('0x5a')]()[_0x9a50('0x20')](respondWithResult(_0x10bd3a,null))[_0x9a50('0x29')](handleError(_0x10bd3a,null));};var interaction_log=require(_0x9a50('0x13'))(_0x9a50('0x5b'));exports[_0x9a50('0x5c')]=function(_0x5603a6,_0x5efee5,_0x337264){var _0x10d754={'agent':{},'channel':_0x9a50('0x5d')};if(_0x5603a6[_0x9a50('0x59')]['id']){delete _0x5603a6[_0x9a50('0x59')]['id'];}_0x5603a6[_0x9a50('0x59')][_0x9a50('0x5e')]=!![];_0x5603a6[_0x9a50('0x59')][_0x9a50('0x5f')]=moment()[_0x9a50('0x60')](_0x9a50('0x61'));_0x5603a6[_0x9a50('0x59')][_0x9a50('0x62')]=_0x5603a6[_0x9a50('0x59')]['UserId']||_0x5603a6[_0x9a50('0x63')]['id'];_0x10d754[_0x9a50('0x64')]['id']=_0x5603a6[_0x9a50('0x59')][_0x9a50('0x62')];return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x5603a6[_0x9a50('0x54')]['id'],'UserId':null}})[_0x9a50('0x20')](handleEntityNotFound(_0x5efee5,null))[_0x9a50('0x20')](saveUpdates(_0x5603a6[_0x9a50('0x59')],null))[_0x9a50('0x20')](function(_0x83dbbd){if(_0x83dbbd){_0x10d754[_0x9a50('0x27')]=_0x83dbbd[_0x9a50('0x65')]({'plain':!![]});return db[_0x9a50('0x66')][_0x9a50('0x57')]({'where':{'id':_0x83dbbd[_0x9a50('0x67')]}});}return null;})[_0x9a50('0x20')](handleEntityNotFound(_0x5efee5,null))[_0x9a50('0x20')](function(_0x5592b3){if(_0x5592b3){return _0x5592b3['update']({'UserId':_0x5603a6['body'][_0x9a50('0x62')],'read1stAt':_['isNil'](_0x5592b3['read1stAt'])?moment()[_0x9a50('0x60')](_0x9a50('0x61')):undefined});}return null;})['then'](function(_0x1aac3a){if(_0x1aac3a){_0x10d754[_0x9a50('0x68')]=_0x1aac3a[_0x9a50('0x65')]({'plain':!![]});interaction_log[_0x9a50('0x28')](_0x9a50('0x69'),_0x5603a6[_0x9a50('0x63')]['id'],_0x5603a6[_0x9a50('0x63')][_0x9a50('0x36')],_0x5603a6[_0x9a50('0x63')][_0x9a50('0x6a')],_0x10d754[_0x9a50('0x68')]['id'],_0x5603a6[_0x9a50('0x59')]?JSON[_0x9a50('0x24')](_0x5603a6[_0x9a50('0x59')]):_0x9a50('0x6b'));return respondWithRpcPromise(_0x9a50('0x6c'),_0x9a50('0x6d'),_0x10d754);}return null;})['then'](function(_0x18b330){var _0x539d8d=_0x9a50('0x6e')+_0x18b330[_0x9a50('0x27')][_0x9a50('0x6f')];return db[_0x9a50('0x70')]['query'](_0x539d8d,{'type':db[_0x9a50('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9a50('0x20')](function(_0xdd580e){return _0xdd580e;});})[_0x9a50('0x20')](function(_0x474a82){if(_0x474a82){_0x10d754['message'][_0x9a50('0x72')]=_0x474a82[0x0];if(!_0x5603a6['body'][_0x9a50('0x62')])return;return db[_0x9a50('0x73')][_0x9a50('0x57')]({'where':{'id':_0x5603a6[_0x9a50('0x59')][_0x9a50('0x62')],'role':_0x9a50('0x64')},'attributes':['id',_0x9a50('0x36'),_0x9a50('0x74'),_0x9a50('0x75'),_0x9a50('0x76')],'raw':!![]});}return null;})[_0x9a50('0x20')](function(_0x35c81a){if(!_0x35c81a)return null;_0x10d754[_0x9a50('0x27')]['agent']=_0x35c81a;return _0x10d754;})[_0x9a50('0x20')](function(_0x16c563){if(_0x16c563){if(_0x5603a6[_0x9a50('0x59')][_0x9a50('0x77')]){_0x10d754[_0x9a50('0x27')][_0x9a50('0x78')]=util[_0x9a50('0x60')]('SIP/%s',_0x5603a6['user'][_0x9a50('0x36')]);_0x10d754['message']['channel']=_0x10d754[_0x9a50('0x79')];_0x10d754[_0x9a50('0x27')][_0x9a50('0x7a')]=_0x10d754[_0x9a50('0x79')];_0x10d754['message'][_0x9a50('0x7b')]=_0x9a50('0x5c');return respondWithRpcPromise(_0x9a50('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x10d754[_0x9a50('0x27')]},client9002)[_0x9a50('0x20')](function(){return _0x10d754;});}return _0x10d754;}return null;})[_0x9a50('0x20')](respondWithResult(_0x5efee5,null))[_0x9a50('0x29')](handleError(_0x5efee5,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x9a50('0x31')]=function(_0x54974c,_0x3e2c25,_0x5490cd){var _0x316fef={'agent':{},'channel':_0x9a50('0x5d')};if(_0x54974c[_0x9a50('0x59')]['id']){delete _0x54974c[_0x9a50('0x59')]['id'];}_0x54974c['body'][_0x9a50('0x62')]=_0x54974c['body']['UserId']||_0x54974c[_0x9a50('0x63')]['id'];_0x316fef[_0x9a50('0x64')]['id']=_0x54974c[_0x9a50('0x59')][_0x9a50('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x54974c[_0x9a50('0x54')]['id'],'UserId':null}})[_0x9a50('0x20')](handleEntityNotFound(_0x3e2c25,null))['then'](function(_0x39eecb){if(_0x39eecb){_0x316fef[_0x9a50('0x27')]=_0x39eecb[_0x9a50('0x65')]({'plain':!![]});return db[_0x9a50('0x66')][_0x9a50('0x57')]({'where':{'id':_0x39eecb[_0x9a50('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3e2c25,null))[_0x9a50('0x20')](function(_0x45e7bf){if(_0x45e7bf){_0x316fef[_0x9a50('0x68')]=_0x45e7bf[_0x9a50('0x65')]({'plain':!![]});interaction_log[_0x9a50('0x28')](_0x9a50('0x7d'),_0x54974c['user']['id'],_0x54974c[_0x9a50('0x63')]['name'],_0x54974c[_0x9a50('0x63')][_0x9a50('0x6a')],_0x316fef[_0x9a50('0x68')]['id'],_0x54974c[_0x9a50('0x59')]?JSON[_0x9a50('0x24')](_0x54974c[_0x9a50('0x59')]):_0x9a50('0x6b'));return respondWithRpcPromise('RejectMessage',_0x9a50('0x7e'),_0x316fef);}return null;})[_0x9a50('0x20')](function(_0x2f6450){var _0x230ac7=_0x9a50('0x6e')+_0x2f6450[_0x9a50('0x27')][_0x9a50('0x6f')];return db[_0x9a50('0x70')]['query'](_0x230ac7,{'type':db['Sequelize'][_0x9a50('0x7f')][_0x9a50('0x80')],'raw':!![]})[_0x9a50('0x20')](function(_0x4cf9f6){return _0x4cf9f6;});})['then'](function(_0x219e70){if(_0x219e70){_0x316fef[_0x9a50('0x27')]['contact']=_0x219e70[0x0];if(!_0x54974c['body'][_0x9a50('0x62')])return;return db[_0x9a50('0x73')][_0x9a50('0x57')]({'where':{'id':_0x54974c['body']['UserId'],'role':'agent'},'attributes':['id',_0x9a50('0x36'),_0x9a50('0x74'),_0x9a50('0x75'),_0x9a50('0x76')],'raw':!![]});}return null;})[_0x9a50('0x20')](function(_0x558a79){if(!_0x558a79)return null;_0x316fef[_0x9a50('0x27')][_0x9a50('0x64')]=_0x558a79;return _0x316fef;})['then'](function(_0x5ae4d7){if(_0x5ae4d7){_0x5ae4d7[_0x9a50('0x27')][_0x9a50('0x78')]=util[_0x9a50('0x60')](_0x9a50('0x81'),_0x54974c[_0x9a50('0x63')]['name']);_0x5ae4d7[_0x9a50('0x27')][_0x9a50('0x79')]=_0x316fef[_0x9a50('0x79')];_0x5ae4d7[_0x9a50('0x27')]['motionChannel']=_0x316fef[_0x9a50('0x79')];_0x5ae4d7[_0x9a50('0x27')][_0x9a50('0x7b')]=_0x9a50('0x31');respondWithRpcPromise(_0x9a50('0x7c'),_0x9a50('0x7c'),{'event':'rejectmessage','message':_0x5ae4d7['message']},client9002);return _0x316fef;}return null;})[_0x9a50('0x20')](respondWithResult(_0x3e2c25,null))['catch'](handleError(_0x3e2c25,null));};exports[_0x9a50('0x2a')]=function(_0x1ecc43,_0x45b673,_0x283bf2){if(_0x1ecc43[_0x9a50('0x59')]['id']){delete _0x1ecc43[_0x9a50('0x59')]['id'];}var _0x2b012b;return db[_0x9a50('0x4e')][_0x9a50('0x57')]({'where':{'id':_0x1ecc43[_0x9a50('0x54')]['id']}})[_0x9a50('0x20')](handleEntityNotFound(_0x45b673,null))[_0x9a50('0x20')](function(_0x28dc2e){if(_0x28dc2e){_0x2b012b=_0x28dc2e;return db['SmsAccount']['find']({'where':{'id':_0x28dc2e['SmsAccountId']}});}})[_0x9a50('0x20')](handleEntityNotFound(_0x45b673,null))['then'](function(_0x4e154d){if(_0x4e154d){logger[_0x9a50('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9a50('0x2a'),_0x9a50('0x82'),_0x4e154d[_0x9a50('0x3a')],util[_0x9a50('0x83')](_0x1ecc43['body'],{'showHidden':![],'depth':null}));switch(_0x4e154d[_0x9a50('0x3a')]){case _0x9a50('0x84'):if(_0x1ecc43['body']['MessageSid']&&_0x1ecc43['body'][_0x9a50('0x85')]===_0x2b012b['messageId']){return _0x2b012b[_0x9a50('0x33')]({'read':!![]});}else{logger[_0x9a50('0x25')](_0x9a50('0x86'),_0x9a50('0x2a'),_0x9a50('0x84'),util[_0x9a50('0x83')](_0x1ecc43['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1ecc43[_0x9a50('0x59')]['MessageUUID']&&_0x1ecc43['body']['MessageUUID']===_0x2b012b['messageId']&&_[_0x9a50('0x87')](['sent',_0x9a50('0x88')],_0x1ecc43[_0x9a50('0x59')][_0x9a50('0x89')])>=0x0){return _0x2b012b[_0x9a50('0x33')]({'read':!![]});}else{logger[_0x9a50('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9a50('0x2a'),_0x9a50('0x8a'),util['inspect'](_0x1ecc43[_0x9a50('0x59')],{'showHidden':![],'depth':null}));}break;case _0x9a50('0x8b'):var _0x3cb2e2=_0x1ecc43['body'][_0x9a50('0x8c')][0x0];if(_0x3cb2e2[_0x9a50('0x2a')]['groupName']==='DELIVERED'){return _0x2b012b[_0x9a50('0x33')]({'read':!![]});}else{logger['error'](_0x9a50('0x86'),_0x9a50('0x2a'),_0x9a50('0x8b'),util[_0x9a50('0x83')](_0x1ecc43[_0x9a50('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x2b012b;}})[_0x9a50('0x20')](respondWithResult(_0x45b673,null))['catch'](handleError(_0x45b673,null));}; \ No newline at end of file +var _0xa30a=['findAll','rows','show','params','keys','rawAttributes','includeAll','find','create','body','destroy','describe','../../config/logger','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','sms-interactions','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','internal','interface','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','map','fieldName','type','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','SmsMessage','include'];(function(_0x50ce0c,_0x541b68){var _0x3c988c=function(_0x1684ee){while(--_0x1684ee){_0x50ce0c['push'](_0x50ce0c['shift']());}};_0x3c988c(++_0x541b68);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];config[_0xaa30('0x19')]=_[_0xaa30('0x1a')](config[_0xaa30('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0x1b'))(new Redis(config[_0xaa30('0x19')]));require(_0xaa30('0x1c'))[_0xaa30('0x1d')](socket);var jayson=require(_0xaa30('0x1e'));var client=jayson[_0xaa30('0x1f')][_0xaa30('0x20')]({'port':0x232c});var client9002=jayson[_0xaa30('0x1f')][_0xaa30('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xfae724,_0x519518,_0x91839d,_0x591478){return new BPromise(function(_0x5eb356,_0x3247ea){var _0x153939=_0x591478||client;return _0x153939[_0xaa30('0x21')](_0xfae724,_0x91839d)['then'](function(_0x54fa49){logger['info'](_0xaa30('0x22'),_0x519518,'request\x20sent');logger[_0xaa30('0x23')](_0xaa30('0x24'),_0x519518,'request\x20sent',JSON['stringify'](_0x54fa49));if(_0x54fa49['error']){if(_0x54fa49[_0xaa30('0x25')][_0xaa30('0x26')]===0x1f4){logger[_0xaa30('0x25')](_0xaa30('0x22'),_0x519518,_0x54fa49[_0xaa30('0x25')]['message']);return _0x3247ea(_0x54fa49[_0xaa30('0x25')][_0xaa30('0x27')]);}logger[_0xaa30('0x25')](_0xaa30('0x22'),_0x519518,_0x54fa49[_0xaa30('0x25')]['message']);return _0x5eb356(_0x54fa49[_0xaa30('0x25')][_0xaa30('0x27')]);}else{logger[_0xaa30('0x28')](_0xaa30('0x22'),_0x519518,'request\x20sent');_0x5eb356(_0x54fa49[_0xaa30('0x29')][_0xaa30('0x27')]);}})[_0xaa30('0x2a')](function(_0x12da2f){logger[_0xaa30('0x25')](_0xaa30('0x22'),_0x519518,_0x12da2f);_0x3247ea(_0x12da2f);});});}function respondWithStatusCode(_0x55cccb,_0x467850){_0x467850=_0x467850||0xcc;return function(_0x465701){if(_0x465701){return _0x55cccb['sendStatus'](_0x467850);}return _0x55cccb[_0xaa30('0x2b')](_0x467850)['end']();};}function respondWithResult(_0x2da4da,_0x33a0c9){_0x33a0c9=_0x33a0c9||0xc8;return function(_0x2aabf8){if(_0x2aabf8){return _0x2da4da[_0xaa30('0x2b')](_0x33a0c9)[_0xaa30('0x2c')](_0x2aabf8);}};}function respondWithFilteredResult(_0xc10b8f,_0x6ff09a){return function(_0x39f708){if(_0x39f708){var _0x1f288c=typeof _0x6ff09a[_0xaa30('0x2d')]===_0xaa30('0x2e')&&typeof _0x6ff09a[_0xaa30('0x2f')]===_0xaa30('0x2e');var _0x46abb9=_0x39f708[_0xaa30('0x30')];var _0x1a3f64=_0x1f288c?0x0:_0x6ff09a[_0xaa30('0x2d')];var _0x1fa8d4=_0x1f288c?_0x39f708['count']:_0x6ff09a[_0xaa30('0x2d')]+_0x6ff09a[_0xaa30('0x2f')];var _0x3bc22f;if(_0x1fa8d4>=_0x46abb9){_0x1fa8d4=_0x46abb9;_0x3bc22f=0xc8;}else{_0x3bc22f=0xce;}_0xc10b8f[_0xaa30('0x2b')](_0x3bc22f);return _0xc10b8f[_0xaa30('0x31')](_0xaa30('0x32'),_0x1a3f64+'-'+_0x1fa8d4+'/'+_0x46abb9)['json'](_0x39f708);}return null;};}function patchUpdates(_0x5addbf){return function(_0x5b99ca){try{jsonpatch[_0xaa30('0x33')](_0x5b99ca,_0x5addbf,!![]);}catch(_0x407090){return BPromise[_0xaa30('0x34')](_0x407090);}return _0x5b99ca[_0xaa30('0x35')]();};}function saveUpdates(_0x1d6d83,_0x559013){return function(_0x499af0){if(_0x499af0){return _0x499af0[_0xaa30('0x36')](_0x1d6d83)[_0xaa30('0x37')](function(_0x4e004e){return _0x4e004e;});}return null;};}function removeEntity(_0xc81d7e,_0x4c83dd){return function(_0x3ca2b5){if(_0x3ca2b5){return _0x3ca2b5['destroy']()[_0xaa30('0x37')](function(){_0xc81d7e[_0xaa30('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167a66,_0x2bc6f2){return function(_0x3dd1ed){if(!_0x3dd1ed){_0x167a66[_0xaa30('0x38')](0x194);}return _0x3dd1ed;};}function handleError(_0x285b68,_0x61c959){_0x61c959=_0x61c959||0x1f4;return function(_0x5cfc85){logger[_0xaa30('0x25')](_0x5cfc85[_0xaa30('0x39')]);if(_0x5cfc85['name']){delete _0x5cfc85[_0xaa30('0x3a')];}_0x285b68[_0xaa30('0x2b')](_0x61c959)[_0xaa30('0x3b')](_0x5cfc85);};}exports['index']=function(_0x4add3e,_0x28e256){var _0x21ffb0={},_0x1b41b2={},_0x1b22ed={'count':0x0,'rows':[]};var _0x1ec3cf=_[_0xaa30('0x3c')](db['SmsMessage']['rawAttributes'],function(_0x120c43){return{'name':_0x120c43[_0xaa30('0x3d')],'type':_0x120c43[_0xaa30('0x3e')]['key']};});_0x1b41b2[_0xaa30('0x3f')]=_[_0xaa30('0x3c')](_0x1ec3cf,_0xaa30('0x3a'));_0x1b41b2[_0xaa30('0x40')]=_['keys'](_0x4add3e[_0xaa30('0x40')]);_0x1b41b2[_0xaa30('0x41')]=_[_0xaa30('0x42')](_0x1b41b2[_0xaa30('0x3f')],_0x1b41b2[_0xaa30('0x40')]);_0x21ffb0['attributes']=_[_0xaa30('0x42')](_0x1b41b2[_0xaa30('0x3f')],qs[_0xaa30('0x43')](_0x4add3e[_0xaa30('0x40')][_0xaa30('0x43')]));_0x21ffb0[_0xaa30('0x44')]=_0x21ffb0[_0xaa30('0x44')][_0xaa30('0x45')]?_0x21ffb0['attributes']:_0x1b41b2['model'];if(!_0x4add3e[_0xaa30('0x40')]['hasOwnProperty']('nolimit')){_0x21ffb0['limit']=qs[_0xaa30('0x2f')](_0x4add3e['query'][_0xaa30('0x2f')]);_0x21ffb0['offset']=qs[_0xaa30('0x2d')](_0x4add3e[_0xaa30('0x40')][_0xaa30('0x2d')]);}_0x21ffb0[_0xaa30('0x46')]=qs[_0xaa30('0x47')](_0x4add3e[_0xaa30('0x40')][_0xaa30('0x47')]);_0x21ffb0[_0xaa30('0x48')]=qs[_0xaa30('0x41')](_[_0xaa30('0x49')](_0x4add3e[_0xaa30('0x40')],_0x1b41b2['filters']),_0x1ec3cf);if(_0x4add3e[_0xaa30('0x40')][_0xaa30('0x4a')]){_0x21ffb0[_0xaa30('0x48')]=_[_0xaa30('0x4b')](_0x21ffb0[_0xaa30('0x48')],{'$or':_['map'](_0x1ec3cf,function(_0x539a33){if(_0x539a33[_0xaa30('0x3e')]!=='VIRTUAL'){var _0x6ad83e={};_0x6ad83e[_0x539a33[_0xaa30('0x3a')]]={'$like':'%'+_0x4add3e[_0xaa30('0x40')][_0xaa30('0x4a')]+'%'};return _0x6ad83e;}})});}_0x21ffb0=_[_0xaa30('0x4b')]({},_0x21ffb0,_0x4add3e[_0xaa30('0x4c')]);var _0x2787a8={'where':_0x21ffb0['where']};return db[_0xaa30('0x4d')][_0xaa30('0x30')](_0x2787a8)[_0xaa30('0x37')](function(_0x5cacee){_0x1b22ed[_0xaa30('0x30')]=_0x5cacee;if(_0x4add3e[_0xaa30('0x40')]['includeAll']){_0x21ffb0[_0xaa30('0x4e')]=[{'all':!![]}];}return db['SmsMessage'][_0xaa30('0x4f')](_0x21ffb0);})['then'](function(_0x4b68d5){_0x1b22ed[_0xaa30('0x50')]=_0x4b68d5;return _0x1b22ed;})['then'](respondWithFilteredResult(_0x28e256,_0x21ffb0))['catch'](handleError(_0x28e256,null));};exports[_0xaa30('0x51')]=function(_0x1083e2,_0x2574f5){var _0x66c644={'raw':!![],'where':{'id':_0x1083e2[_0xaa30('0x52')]['id']}},_0x3f80fd={};_0x3f80fd['model']=_[_0xaa30('0x53')](db[_0xaa30('0x4d')][_0xaa30('0x54')]);_0x3f80fd['query']=_['keys'](_0x1083e2['query']);_0x3f80fd['filters']=_[_0xaa30('0x42')](_0x3f80fd[_0xaa30('0x3f')],_0x3f80fd[_0xaa30('0x40')]);_0x66c644[_0xaa30('0x44')]=_[_0xaa30('0x42')](_0x3f80fd[_0xaa30('0x3f')],qs['fields'](_0x1083e2[_0xaa30('0x40')][_0xaa30('0x43')]));_0x66c644[_0xaa30('0x44')]=_0x66c644[_0xaa30('0x44')]['length']?_0x66c644[_0xaa30('0x44')]:_0x3f80fd[_0xaa30('0x3f')];if(_0x1083e2[_0xaa30('0x40')][_0xaa30('0x55')]){_0x66c644[_0xaa30('0x4e')]=[{'all':!![]}];}_0x66c644=_['merge']({},_0x66c644,_0x1083e2['options']);return db[_0xaa30('0x4d')][_0xaa30('0x56')](_0x66c644)[_0xaa30('0x37')](handleEntityNotFound(_0x2574f5,null))['then'](respondWithResult(_0x2574f5,null))[_0xaa30('0x2a')](handleError(_0x2574f5,null));};exports['create']=function(_0x2fafda,_0x13171f){return db['SmsMessage'][_0xaa30('0x57')](_0x2fafda[_0xaa30('0x58')],{})['then'](respondWithResult(_0x13171f,0xc9))[_0xaa30('0x2a')](handleError(_0x13171f,null));};exports['update']=function(_0x5b227d,_0x16cb58){if(_0x5b227d[_0xaa30('0x58')]['id']){delete _0x5b227d[_0xaa30('0x58')]['id'];}return db['SmsMessage'][_0xaa30('0x56')]({'where':{'id':_0x5b227d[_0xaa30('0x52')]['id']}})[_0xaa30('0x37')](handleEntityNotFound(_0x16cb58,null))[_0xaa30('0x37')](saveUpdates(_0x5b227d[_0xaa30('0x58')],null))[_0xaa30('0x37')](respondWithResult(_0x16cb58,null))[_0xaa30('0x2a')](handleError(_0x16cb58,null));};exports[_0xaa30('0x59')]=function(_0x242b5a,_0x426b90){return db[_0xaa30('0x4d')][_0xaa30('0x56')]({'where':{'id':_0x242b5a[_0xaa30('0x52')]['id']}})['then'](handleEntityNotFound(_0x426b90,null))[_0xaa30('0x37')](removeEntity(_0x426b90,null))[_0xaa30('0x2a')](handleError(_0x426b90,null));};exports[_0xaa30('0x5a')]=function(_0x5b6e3d,_0x248300){return db[_0xaa30('0x4d')][_0xaa30('0x5a')]()[_0xaa30('0x37')](respondWithResult(_0x248300,null))[_0xaa30('0x2a')](handleError(_0x248300,null));};var interaction_log=require(_0xaa30('0x5b'))('sms-interactions');exports[_0xaa30('0x5c')]=function(_0x4f5222,_0x36242e,_0x4121fb){var _0x315303={'agent':{},'channel':_0xaa30('0x5d')};if(_0x4f5222['body']['id']){delete _0x4f5222[_0xaa30('0x58')]['id'];}_0x4f5222[_0xaa30('0x58')]['read']=!![];_0x4f5222[_0xaa30('0x58')][_0xaa30('0x5e')]=moment()[_0xaa30('0x5f')](_0xaa30('0x60'));_0x4f5222[_0xaa30('0x58')][_0xaa30('0x61')]=_0x4f5222['body'][_0xaa30('0x61')]||_0x4f5222[_0xaa30('0x62')]['id'];_0x315303[_0xaa30('0x63')]['id']=_0x4f5222[_0xaa30('0x58')][_0xaa30('0x61')];return db[_0xaa30('0x4d')][_0xaa30('0x56')]({'where':{'id':_0x4f5222[_0xaa30('0x52')]['id'],'UserId':null}})[_0xaa30('0x37')](handleEntityNotFound(_0x36242e,null))[_0xaa30('0x37')](saveUpdates(_0x4f5222[_0xaa30('0x58')],null))[_0xaa30('0x37')](function(_0x37537e){if(_0x37537e){_0x315303['message']=_0x37537e[_0xaa30('0x64')]({'plain':!![]});return db['SmsInteraction'][_0xaa30('0x56')]({'where':{'id':_0x37537e['SmsInteractionId']}});}return null;})[_0xaa30('0x37')](handleEntityNotFound(_0x36242e,null))[_0xaa30('0x37')](function(_0x211a83){if(_0x211a83){return _0x211a83['update']({'UserId':_0x4f5222[_0xaa30('0x58')][_0xaa30('0x61')],'read1stAt':_['isNil'](_0x211a83[_0xaa30('0x65')])?moment()['format'](_0xaa30('0x60')):undefined});}return null;})['then'](function(_0x4f134e){if(_0x4f134e){_0x315303[_0xaa30('0x66')]=_0x4f134e[_0xaa30('0x64')]({'plain':!![]});interaction_log[_0xaa30('0x28')](_0xaa30('0x67'),_0x4f5222[_0xaa30('0x62')]['id'],_0x4f5222[_0xaa30('0x62')][_0xaa30('0x3a')],_0x4f5222['user'][_0xaa30('0x68')],_0x315303[_0xaa30('0x66')]['id'],_0x4f5222[_0xaa30('0x58')]?JSON['stringify'](_0x4f5222[_0xaa30('0x58')]):_0xaa30('0x69'));return respondWithRpcPromise(_0xaa30('0x6a'),'acceptMessage',_0x315303);}return null;})[_0xaa30('0x37')](function(_0x5a2004){var _0x406c71='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a2004['message'][_0xaa30('0x6b')];return db[_0xaa30('0x6c')]['query'](_0x406c71,{'type':db[_0xaa30('0x6d')][_0xaa30('0x6e')][_0xaa30('0x6f')],'raw':!![]})['then'](function(_0x37768b){return _0x37768b;});})[_0xaa30('0x37')](function(_0x23daeb){if(_0x23daeb){_0x315303[_0xaa30('0x27')][_0xaa30('0x70')]=_0x23daeb[0x0];if(!_0x4f5222[_0xaa30('0x58')][_0xaa30('0x61')])return;return db['User'][_0xaa30('0x56')]({'where':{'id':_0x4f5222[_0xaa30('0x58')][_0xaa30('0x61')],'role':_0xaa30('0x63')},'attributes':['id','name',_0xaa30('0x71'),_0xaa30('0x72'),'internal'],'raw':!![]});}return null;})[_0xaa30('0x37')](function(_0x2d9dd8){if(!_0x2d9dd8)return null;_0x315303[_0xaa30('0x27')][_0xaa30('0x63')]=_0x2d9dd8;return _0x315303;})[_0xaa30('0x37')](function(_0x297d92){if(_0x297d92){if(_0x4f5222['body'][_0xaa30('0x73')]){_0x315303[_0xaa30('0x27')]['interface']=util[_0xaa30('0x5f')](_0xaa30('0x74'),_0x4f5222[_0xaa30('0x62')][_0xaa30('0x3a')]);_0x315303[_0xaa30('0x27')]['channel']=_0x315303[_0xaa30('0x75')];_0x315303[_0xaa30('0x27')][_0xaa30('0x76')]=_0x315303[_0xaa30('0x75')];_0x315303[_0xaa30('0x27')][_0xaa30('0x77')]='accept';return respondWithRpcPromise(_0xaa30('0x78'),_0xaa30('0x78'),{'event':'acceptmessage','message':_0x315303['message']},client9002)[_0xaa30('0x37')](function(){return _0x315303;});}return _0x315303;}return null;})[_0xaa30('0x37')](respondWithResult(_0x36242e,null))[_0xaa30('0x2a')](handleError(_0x36242e,null));};var interaction_log=require(_0xaa30('0x5b'))(_0xaa30('0x79'));exports[_0xaa30('0x34')]=function(_0x2548be,_0x49c3ab,_0x4ba590){var _0x5d3646={'agent':{},'channel':_0xaa30('0x5d')};if(_0x2548be[_0xaa30('0x58')]['id']){delete _0x2548be[_0xaa30('0x58')]['id'];}_0x2548be[_0xaa30('0x58')][_0xaa30('0x61')]=_0x2548be['body'][_0xaa30('0x61')]||_0x2548be[_0xaa30('0x62')]['id'];_0x5d3646[_0xaa30('0x63')]['id']=_0x2548be[_0xaa30('0x58')][_0xaa30('0x61')];return db[_0xaa30('0x4d')][_0xaa30('0x56')]({'where':{'id':_0x2548be[_0xaa30('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49c3ab,null))['then'](function(_0x57a96c){if(_0x57a96c){_0x5d3646[_0xaa30('0x27')]=_0x57a96c[_0xaa30('0x64')]({'plain':!![]});return db['SmsInteraction'][_0xaa30('0x56')]({'where':{'id':_0x57a96c[_0xaa30('0x7a')]}});}return null;})[_0xaa30('0x37')](handleEntityNotFound(_0x49c3ab,null))[_0xaa30('0x37')](function(_0x404f82){if(_0x404f82){_0x5d3646['interaction']=_0x404f82[_0xaa30('0x64')]({'plain':!![]});interaction_log[_0xaa30('0x28')](_0xaa30('0x7b'),_0x2548be['user']['id'],_0x2548be[_0xaa30('0x62')][_0xaa30('0x3a')],_0x2548be[_0xaa30('0x62')][_0xaa30('0x68')],_0x5d3646[_0xaa30('0x66')]['id'],_0x2548be[_0xaa30('0x58')]?JSON[_0xaa30('0x7c')](_0x2548be['body']):_0xaa30('0x69'));return respondWithRpcPromise(_0xaa30('0x7d'),_0xaa30('0x7e'),_0x5d3646);}return null;})[_0xaa30('0x37')](function(_0x24012d){var _0x42ea47=_0xaa30('0x7f')+_0x24012d[_0xaa30('0x27')][_0xaa30('0x6b')];return db[_0xaa30('0x6c')][_0xaa30('0x40')](_0x42ea47,{'type':db[_0xaa30('0x6d')][_0xaa30('0x6e')]['SELECT'],'raw':!![]})[_0xaa30('0x37')](function(_0x4c6bef){return _0x4c6bef;});})[_0xaa30('0x37')](function(_0xed4f27){if(_0xed4f27){_0x5d3646[_0xaa30('0x27')][_0xaa30('0x70')]=_0xed4f27[0x0];if(!_0x2548be[_0xaa30('0x58')][_0xaa30('0x61')])return;return db[_0xaa30('0x80')][_0xaa30('0x56')]({'where':{'id':_0x2548be[_0xaa30('0x58')][_0xaa30('0x61')],'role':_0xaa30('0x63')},'attributes':['id',_0xaa30('0x3a'),_0xaa30('0x71'),_0xaa30('0x72'),_0xaa30('0x81')],'raw':!![]});}return null;})[_0xaa30('0x37')](function(_0x35a47f){if(!_0x35a47f)return null;_0x5d3646[_0xaa30('0x27')][_0xaa30('0x63')]=_0x35a47f;return _0x5d3646;})['then'](function(_0x42987d){if(_0x42987d){_0x42987d[_0xaa30('0x27')][_0xaa30('0x82')]=util[_0xaa30('0x5f')](_0xaa30('0x74'),_0x2548be[_0xaa30('0x62')][_0xaa30('0x3a')]);_0x42987d['message'][_0xaa30('0x75')]=_0x5d3646[_0xaa30('0x75')];_0x42987d['message'][_0xaa30('0x76')]=_0x5d3646[_0xaa30('0x75')];_0x42987d['message'][_0xaa30('0x77')]=_0xaa30('0x34');respondWithRpcPromise(_0xaa30('0x78'),_0xaa30('0x78'),{'event':'rejectmessage','message':_0x42987d[_0xaa30('0x27')]},client9002);return _0x5d3646;}return null;})['then'](respondWithResult(_0x49c3ab,null))[_0xaa30('0x2a')](handleError(_0x49c3ab,null));};exports[_0xaa30('0x2b')]=function(_0x24f60f,_0x3fb561,_0x24a3af){if(_0x24f60f[_0xaa30('0x58')]['id']){delete _0x24f60f[_0xaa30('0x58')]['id'];}var _0x2e73e1;return db[_0xaa30('0x4d')]['find']({'where':{'id':_0x24f60f[_0xaa30('0x52')]['id']}})[_0xaa30('0x37')](handleEntityNotFound(_0x3fb561,null))['then'](function(_0x1f48c1){if(_0x1f48c1){_0x2e73e1=_0x1f48c1;return db[_0xaa30('0x83')]['find']({'where':{'id':_0x1f48c1[_0xaa30('0x84')]}});}})[_0xaa30('0x37')](handleEntityNotFound(_0x3fb561,null))['then'](function(_0x44b202){if(_0x44b202){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaa30('0x2b'),_0xaa30('0x85'),_0x44b202['type'],util['inspect'](_0x24f60f[_0xaa30('0x58')],{'showHidden':![],'depth':null}));switch(_0x44b202[_0xaa30('0x3e')]){case'twilio':if(_0x24f60f[_0xaa30('0x58')]['MessageSid']&&_0x24f60f['body'][_0xaa30('0x86')]===_0x2e73e1['messageId']){return _0x2e73e1[_0xaa30('0x36')]({'read':!![]});}else{logger['error'](_0xaa30('0x87'),_0xaa30('0x2b'),_0xaa30('0x88'),util[_0xaa30('0x89')](_0x24f60f[_0xaa30('0x58')],{'showHidden':![],'depth':null}));}break;case _0xaa30('0x8a'):if(_0x24f60f[_0xaa30('0x58')][_0xaa30('0x8b')]&&_0x24f60f[_0xaa30('0x58')]['MessageUUID']===_0x2e73e1['messageId']&&_[_0xaa30('0x8c')]([_0xaa30('0x8d'),_0xaa30('0x8e')],_0x24f60f['body']['Status'])>=0x0){return _0x2e73e1[_0xaa30('0x36')]({'read':!![]});}else{logger['error'](_0xaa30('0x87'),_0xaa30('0x2b'),_0xaa30('0x8f'),util[_0xaa30('0x89')](_0x24f60f['body'],{'showHidden':![],'depth':null}));}break;case _0xaa30('0x90'):var _0x5d061b=_0x24f60f[_0xaa30('0x58')][_0xaa30('0x91')][0x0];if(_0x5d061b[_0xaa30('0x2b')][_0xaa30('0x92')]==='DELIVERED'){return _0x2e73e1[_0xaa30('0x36')]({'read':!![]});}else{logger[_0xaa30('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaa30('0x2b'),'infobip',util[_0xaa30('0x89')](_0x24f60f['body'],{'showHidden':![],'depth':null}));}break;}return _0x2e73e1;}})[_0xaa30('0x37')](respondWithResult(_0x3fb561,null))[_0xaa30('0x2a')](handleError(_0x3fb561,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index ef13e0a..0baba7f 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 _0xcfb1=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xcfb1,0x1bc));var _0x1cfb=function(_0x1342bb,_0x522400){_0x1342bb=_0x1342bb-0x0;var _0x3a91de=_0xcfb1[_0x1342bb];return _0x3a91de;};'use strict';var EventEmitter=require(_0x1cfb('0x0'));var SmsMessage=require(_0x1cfb('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1cfb('0x2')](0x0);var events={'afterCreate':_0x1cfb('0x3'),'afterUpdate':_0x1cfb('0x4'),'afterDestroy':_0x1cfb('0x5')};function emitEvent(_0x78cf2e){return function(_0x190f3d,_0x1dbc67,_0x5b21f8){SmsMessageEvents[_0x1cfb('0x6')](_0x78cf2e+':'+_0x190f3d['id'],_0x190f3d);SmsMessageEvents[_0x1cfb('0x6')](_0x78cf2e,_0x190f3d);_0x5b21f8(null);};}for(var e in events){if(events[_0x1cfb('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x1cfb('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xb069=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x271b61,_0xbd7fe){var _0xd4dff6=function(_0x461106){while(--_0x461106){_0x271b61['push'](_0x271b61['shift']());}};_0xd4dff6(++_0xbd7fe);}(_0xb069,0x15b));var _0x9b06=function(_0x2c06ad,_0x347cf8){_0x2c06ad=_0x2c06ad-0x0;var _0x5d0b8e=_0xb069[_0x2c06ad];return _0x5d0b8e;};'use strict';var EventEmitter=require(_0x9b06('0x0'));var SmsMessage=require(_0x9b06('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9b06('0x2')](0x0);var events={'afterCreate':_0x9b06('0x3'),'afterUpdate':_0x9b06('0x4'),'afterDestroy':_0x9b06('0x5')};function emitEvent(_0x3e1689){return function(_0x32604e,_0x491685,_0x1202dc){SmsMessageEvents[_0x9b06('0x6')](_0x3e1689+':'+_0x32604e['id'],_0x32604e);SmsMessageEvents[_0x9b06('0x6')](_0x3e1689,_0x32604e);_0x1202dc(null);};}for(var e in events){if(events[_0x9b06('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x9b06('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 9329cf3..df254b6 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 _0xb87b=['fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','create','phone','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','sms','POST','user_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','head','messages','message_id','clickSend','authId','remote','token','format','%s:%s','toString','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId'];(function(_0x44303a,_0x52df10){var _0x50af17=function(_0x2f5cdf){while(--_0x2f5cdf){_0x44303a['push'](_0x44303a['shift']());}};_0x50af17(++_0x52df10);}(_0xb87b,0x6e));var _0xbb87=function(_0x72cdb8,_0x4ba431){_0x72cdb8=_0x72cdb8-0x0;var _0x13248a=_0xb87b[_0x72cdb8];return _0x13248a;};'use strict';var _=require(_0xbb87('0x0'));var util=require(_0xbb87('0x1'));var logger=require(_0xbb87('0x2'))(_0xbb87('0x3'));var moment=require(_0xbb87('0x4'));var BPromise=require(_0xbb87('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb87('0x6'));var rimraf=require(_0xbb87('0x7'));var config=require(_0xbb87('0x8'));var attributes=require(_0xbb87('0x9'));module[_0xbb87('0xa')]=function(_0x308a12,_0x1abd2d){return _0x308a12[_0xbb87('0xb')]('SmsMessage',attributes,{'tableName':_0xbb87('0xc'),'paranoid':![],'indexes':[{'name':_0xbb87('0xd'),'fields':[_0xbb87('0xd')]},{'name':_0xbb87('0xe'),'fields':[_0xbb87('0xf')],'type':_0xbb87('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x259655,_0x5d4ab6,_0x269103){var _0x3998ca=_0x308a12[_0xbb87('0x11')];var _0x425747=_0x259655['get']({'plain':!![]});if(_0x425747[_0xbb87('0x12')][_0xbb87('0x13')]()==='in'||_0x425747['direction'][_0xbb87('0x13')]()==='out'&&!_0x425747[_0xbb87('0x14')]&&!_['isNil'](_0x425747['UserId'])&&!_['isNil'](_0x425747['SmsInteractionId'])){_0x3998ca[_0xbb87('0x15')][_0xbb87('0x16')]({'where':{'id':_0x425747[_0xbb87('0x17')]}})[_0xbb87('0x18')](function(_0x5a081f){if(_0x5a081f){_0x5a081f[_0xbb87('0x19')]({'lastMsgAt':_0x425747['createdAt'],'lastMsgDirection':_0x425747['direction'][_0xbb87('0x13')]()});}})[_0xbb87('0x1a')](function(_0x2ea0ab){console[_0xbb87('0x1b')](_0x2ea0ab);});}if(_0x425747[_0xbb87('0x12')]===_0xbb87('0x1c')&&!_0x425747[_0xbb87('0x14')]){var _0x76db2c;_0x3998ca[_0xbb87('0x1d')][_0xbb87('0x1e')]({'where':{'id':_0x425747[_0xbb87('0x1f')]},'raw':!![]})[_0xbb87('0x18')](function(_0x3c9f65){_0x76db2c=_0x3c9f65;if(_0x76db2c&&_0x76db2c[_0xbb87('0x20')]){switch(_0x76db2c[_0xbb87('0x20')]){case _0xbb87('0x21'):var _0x1dd81a=require(_0xbb87('0x21'));if(_0x76db2c[_0xbb87('0x22')]&&_0x76db2c['authToken']&&_0x76db2c['phone']){var _0x4132b0=new _0x1dd81a(_0x76db2c['accountSid'],_0x76db2c[_0xbb87('0x23')]);_0x4132b0['messages'][_0xbb87('0x24')]({'body':_0x425747[_0xbb87('0xf')],'to':_0x425747[_0xbb87('0x25')],'from':_0x76db2c['phone'],'statusCallback':_0x76db2c['remote']+_0xbb87('0x26')+_0x425747['id']+_0xbb87('0x27')+_0x76db2c['token']})[_0xbb87('0x18')](function(_0x5bbb1b){if(_0x5bbb1b[_0xbb87('0x28')]){return _0x259655[_0xbb87('0x19')]({'messageId':_0x5bbb1b['sid']});}})[_0xbb87('0x1a')](function(_0x58a432){logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'twilio',util[_0xbb87('0x2b')](_0x58a432,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x21'),_0xbb87('0x2c'));}break;case _0xbb87('0x2d'):var _0x5b4091=_0xbb87('0x2e');if(_0x76db2c[_0xbb87('0x2f')]&&_0x76db2c[_0xbb87('0x30')]){var _0x4f2157={'recipient':[_0x425747[_0xbb87('0x25')]],'message':_0x425747[_0xbb87('0xf')],'message_type':_0x76db2c[_0xbb87('0x31')]};if(_0x76db2c[_0xbb87('0x31')]&&_0x76db2c['smsMethod']!=='SI'){_0x4f2157['sender']=_0x76db2c[_0xbb87('0x25')];}var _0x1e8436={'url':_0x5b4091+_0xbb87('0x32')+_0x76db2c[_0xbb87('0x2f')]+'&password='+_0x76db2c[_0xbb87('0x30')],'method':'GET'};rp(_0x1e8436)[_0xbb87('0x18')](function(_0x122370){var _0x33f2b7=_0x122370['split'](';');var _0xc22bff={'user_key':_0x33f2b7[0x0],'session_key':_0x33f2b7[0x1]};_0x1e8436={'url':_0x5b4091+_0xbb87('0x33'),'method':_0xbb87('0x34'),'headers':{'user_key':_0xc22bff[_0xbb87('0x35')],'Session_key':_0xc22bff['session_key']},'json':!![],'body':_0x4f2157};return rp(_0x1e8436);})[_0xbb87('0x18')](function(_0x28cba3){if(_0x28cba3[_0xbb87('0x36')]>=0x1){var _0x2e9274={'messageId':_0x28cba3['internal_order_id']};if(_0x76db2c[_0xbb87('0x31')]!=='GP'||!_0x76db2c[_0xbb87('0x37')]){_0x2e9274[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x2e9274);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),'afterCreate','skebby',util['inspect'](_0x28cba3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5bc331){return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x2d'),util[_0xbb87('0x2b')](_0x5bc331,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'skebby',_0xbb87('0x39'));}break;case _0xbb87('0x3a'):if(_0x76db2c[_0xbb87('0x23')]){var _0x391939={'recipient':_0x425747['phone'],'message':_0x425747[_0xbb87('0xf')],'sender':_0x76db2c[_0xbb87('0x3b')]||_0x76db2c[_0xbb87('0x25')],'authorization':_0x76db2c[_0xbb87('0x23')]};var _0x5d4ab6={'method':_0xbb87('0x34'),'uri':_0xbb87('0x3c'),'body':_0x391939,'json':!![]};rp(_0x5d4ab6)[_0xbb87('0x18')](function(_0x28291f){var _0x4141f2={'messageId':_0x28291f['requestid']};if(!_0x76db2c['deliveryReport']){_0x4141f2[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x4141f2);})[_0xbb87('0x1a')](function(_0x4add8e){logger['error'](_0xbb87('0x29'),'afterCreate','connectel',util[_0xbb87('0x2b')](_0x4add8e,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbb87('0x2a'),_0xbb87('0x3a'),_0xbb87('0x3d'));}break;case _0xbb87('0x3e'):if(_0x76db2c['username']&&_0x76db2c['password']){var _0x391939={'messages':[{'source':'xCALLY\x20Motion','to':_0x425747[_0xbb87('0x25')],'body':_0x425747['body'],'from':_0x76db2c[_0xbb87('0x3b')]||_0x76db2c[_0xbb87('0x25')]}]};var _0x1418b4=util['format']('%s:%s',_0x76db2c[_0xbb87('0x2f')],_0x76db2c[_0xbb87('0x30')]);var _0x5d4ab6={'method':_0xbb87('0x34'),'uri':_0xbb87('0x3f'),'body':_0x391939,'headers':{'Authorization':util['format'](_0xbb87('0x40'),new Buffer(_0x1418b4)['toString']('base64'))},'json':!![]};rp(_0x5d4ab6)[_0xbb87('0x18')](function(_0x5af5ea){if(_0x5af5ea[_0xbb87('0x41')]>=0xc8&&_0x5af5ea['http_code']<=0xce){if(_0x5af5ea[_0xbb87('0x42')]&&_0x5af5ea['data'][_0xbb87('0x43')]>0x0){var _0x3d4845=_[_0xbb87('0x44')](_0x5af5ea[_0xbb87('0x42')][_0xbb87('0x45')]);var _0x9c3bfc={'messageId':_0x3d4845[_0xbb87('0x46')]};if(!_0x76db2c[_0xbb87('0x37')]){_0x9c3bfc[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x9c3bfc);}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x47'),util['inspect'](_0x5af5ea,{'showHidden':![],'depth':null}));}}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'clickSend',util['inspect'](_0x5af5ea,{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x5e1206){logger['error'](_0xbb87('0x29'),_0xbb87('0x2a'),'clickSend',util['inspect'](_0x5e1206,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),'afterCreate','clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x76db2c[_0xbb87('0x48')]&&_0x76db2c[_0xbb87('0x23')]){var _0x391939={'dst':_0x425747['phone'],'text':_0x425747[_0xbb87('0xf')],'src':_0x76db2c[_0xbb87('0x3b')]||_0x76db2c[_0xbb87('0x25')],'url':_0x76db2c[_0xbb87('0x49')]+'/api/sms/messages/'+_0x425747['id']+'/status?token='+_0x76db2c[_0xbb87('0x4a')]};var _0x1418b4=util[_0xbb87('0x4b')](_0xbb87('0x4c'),_0x76db2c[_0xbb87('0x48')],_0x76db2c['authToken']);var _0x5d4ab6={'method':_0xbb87('0x34'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x76db2c[_0xbb87('0x48')]),'body':_0x391939,'headers':{'Authorization':util[_0xbb87('0x4b')](_0xbb87('0x40'),new Buffer(_0x1418b4)[_0xbb87('0x4d')](_0xbb87('0x4e')))},'json':!![]};rp(_0x5d4ab6)[_0xbb87('0x18')](function(_0x2164e3){var _0x53437c={'messageId':_0x2164e3[_0xbb87('0x4f')][0x0]};return _0x259655[_0xbb87('0x19')](_0x53437c);})[_0xbb87('0x1a')](function(_0x514b05){logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x50'),util[_0xbb87('0x2b')](_0x514b05,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbb87('0x29'),'afterCreate',_0xbb87('0x50'),_0xbb87('0x51'));}break;case _0xbb87('0x52'):if(_0x76db2c['username']&&_0x76db2c[_0xbb87('0x30')]){if(_0x76db2c[_0xbb87('0x53')]){var _0x5c63da={'method':_0xbb87('0x34'),'uri':_0x76db2c[_0xbb87('0x53')]+_0xbb87('0x54'),'body':{'username':_0x76db2c[_0xbb87('0x2f')],'password':_0x76db2c[_0xbb87('0x30')]},'json':!![]};return rp(_0x5c63da)[_0xbb87('0x18')](function(_0x5cd359){var _0x2f95f5={'method':_0xbb87('0x34'),'uri':_0x76db2c[_0xbb87('0x53')]+_0xbb87('0x55'),'body':{'messages':[{'from':_0x76db2c[_0xbb87('0x25')],'destinations':[{'to':_0x425747[_0xbb87('0x25')]}],'text':_0x425747[_0xbb87('0xf')],'notifyUrl':_0x76db2c['remote']+_0xbb87('0x26')+_0x425747['id']+_0xbb87('0x27')+_0x76db2c[_0xbb87('0x4a')],'notifyContentType':'application/json','callbackData':_0x76db2c[_0xbb87('0x25')]+';'+_0x425747[_0xbb87('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x5cd359[_0xbb87('0x4a')]},'json':!![]};return rp(_0x2f95f5)[_0xbb87('0x18')](function(_0x49fa5f){if(_0x49fa5f[_0xbb87('0x45')]){var _0xd66ba1={'messageId':_0x49fa5f[_0xbb87('0x45')][0x0][_0xbb87('0xd')]};if(!_0x76db2c[_0xbb87('0x37')]){_0xd66ba1[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0xd66ba1);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x52'),util[_0xbb87('0x2b')](_0x49fa5f,{'showHidden':![],'depth':null}));}});})[_0xbb87('0x1a')](function(_0x7653de){return logger['error'](_0xbb87('0x29'),'afterCreate',_0xbb87('0x52'),util[_0xbb87('0x2b')](_0x7653de,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),'afterCreate',_0xbb87('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x52'),_0xbb87('0x39'));}break;case _0xbb87('0x56'):var _0x29076a=require(_0xbb87('0x57'));if(_0x76db2c[_0xbb87('0x58')]){var _0x3f7fc2={};_0x3f7fc2[_0xbb87('0x59')]=_0x76db2c[_0xbb87('0x2f')];_0x3f7fc2['phone']=_0x425747['phone'];_0x3f7fc2[_0xbb87('0x5a')]=_0x76db2c[_0xbb87('0x25')];_0x3f7fc2[_0xbb87('0x5b')]=_0x425747[_0xbb87('0xf')];_0x3f7fc2[_0xbb87('0x5c')]=+new Date();var _0x4df218='';var _0x356359='';var _0x3e356a=Object[_0xbb87('0x5d')](_0x3f7fc2);_0x3e356a[_0xbb87('0x5e')]();for(var _0x3b2024=0x0;_0x3b2024<_0x3e356a['length'];_0x3b2024++){if(_0x4df218!=''){_0x4df218+='&';}_0x4df218+=_0x3e356a[_0x3b2024]+'='+encodeURIComponent(_0x3f7fc2[_0x3e356a[_0x3b2024]]);_0x356359+=_0x3f7fc2[_0x3e356a[_0x3b2024]];}_0x356359+=_0x76db2c[_0xbb87('0x58')];_0x356359=_0x29076a['createHash'](_0xbb87('0x5f'))[_0xbb87('0x19')](_0x356359)[_0xbb87('0x60')](_0xbb87('0x61'));if(_0x4df218!==''){_0x4df218+='&';}_0x4df218+=_0xbb87('0x62')+_0x356359;var _0x1e8436={'method':'GET','uri':_0x76db2c['baseUrl']+_0xbb87('0x63')+_0x4df218,'json':!![]};return rp(_0x1e8436)['then'](function(_0xa62daa){var _0x12f4a3=Object[_0xbb87('0x5d')](_0xa62daa);if(_0xa62daa[_0x12f4a3[0x0]][_0xbb87('0x1b')]&&parseInt(_0xa62daa[_0x12f4a3[0x0]][_0xbb87('0x1b')])===0x0){var _0x390aaf={'messageId':_0xa62daa[_0x12f4a3[0x0]][_0xbb87('0x64')]};if(!_0x76db2c['deliveryReport']){_0x390aaf[_0xbb87('0x38')]=!![];}return _0x259655[_0xbb87('0x19')](_0x390aaf);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x56'),util[_0xbb87('0x2b')](_0xa62daa['error'],{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x35bcdf){return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x56'),util[_0xbb87('0x2b')](_0x35bcdf,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'csc',_0xbb87('0x65'));}break;case _0xbb87('0x66'):if(_0x76db2c['apiKey']){var _0x125be3={'method':'POST','uri':_0xbb87('0x67'),'headers':{'Authorization':_0x76db2c[_0xbb87('0x58')]},'body':{'content':_0x425747[_0xbb87('0xf')],'to':[_0x425747['phone']],'from':_0x76db2c['phone'],'binary':![],'clientMessageId':_0xbb87('0x68'),'charset':_0xbb87('0x69')},'json':!![]};rp(_0x125be3)['then'](function(_0x309e0c){if(!_0x309e0c[_0xbb87('0x1b')]){var _0x14c421={'messageId':_0x309e0c[_0xbb87('0x45')][0x0][_0xbb87('0x6a')]};if(!_0x76db2c[_0xbb87('0x37')]){_0x14c421[_0xbb87('0x38')]=!![];}return _0x259655['update'](_0x14c421);}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x66'),util[_0xbb87('0x2b')](_0x309e0c[_0xbb87('0x1b')],{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x1d869d){return logger['error'](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x66'),util[_0xbb87('0x2b')](_0x1d869d,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x66'),_0xbb87('0x65'));}break;case _0xbb87('0x6b'):if(_0x76db2c['username']&&_0x76db2c['password']){var _0x1418b4=util[_0xbb87('0x4b')](_0xbb87('0x4c'),_0x76db2c[_0xbb87('0x2f')],_0x76db2c[_0xbb87('0x30')]);var _0x5d4ab6={'method':'POST','uri':_0xbb87('0x6c')+_0x76db2c[_0xbb87('0x6d')]+'/messages','body':{'to':[_0x425747[_0xbb87('0x25')]],'text':_0x425747[_0xbb87('0xf')],'from':_0x76db2c[_0xbb87('0x25')],'applicationId':_0x76db2c[_0xbb87('0x6e')]},'headers':{'Authorization':util[_0xbb87('0x4b')]('Basic\x20%s',new Buffer(_0x1418b4)['toString'](_0xbb87('0x4e')))},'json':!![]};rp(_0x5d4ab6)['then'](function(_0x14fd09){if(_0x14fd09['id']){var _0x4a8d84={'messageId':_0x14fd09['id']};return _0x259655[_0xbb87('0x19')](_0x4a8d84);}else{logger['error'](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x6b'),util[_0xbb87('0x2b')](_0x14fd09,{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0xa7eeec){logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x6b'),util[_0xbb87('0x2b')](_0xa7eeec,{'showHidden':![],'depth':null}));});}else{logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x6b'),_0xbb87('0x39'));}break;case'intelepeer':if(_0x76db2c[_0xbb87('0x58')]){var _0x232407={};var _0x1e8436={'method':'POST','uri':_0xbb87('0x6f'),'headers':{'Authorization':_0xbb87('0x70')+_0x76db2c[_0xbb87('0x58')],'Content-Type':_0xbb87('0x71')},'body':{'from':_0x76db2c[_0xbb87('0x25')],'to':_0x425747[_0xbb87('0x25')],'text':_0x425747[_0xbb87('0xf')]},'json':!![]};return rp(_0x1e8436)[_0xbb87('0x18')](function(_0x1469a9){if(_0x1469a9[_0xbb87('0x72')]==0xca){_0x232407[_0xbb87('0x73')]=_0x1469a9;var _0x5363e8={'method':_0xbb87('0x34'),'uri':_0xbb87('0x74'),'headers':{'Authorization':_0xbb87('0x70')+_0x76db2c[_0xbb87('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x232407[_0xbb87('0x73')][_0xbb87('0x75')]},'json':!![]};return rp(_0x5363e8)[_0xbb87('0x18')](function(_0x3796d7){_0x232407[_0xbb87('0x76')]=_0x3796d7;var _0x1f1fde={'messageId':_0x232407['message'][_0xbb87('0x75')],'read':!![]};return _0x259655['update'](_0x1f1fde);});}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),_0xbb87('0x77'),util['inspect'](_0x1469a9,{'showHidden':![],'depth':null}));}})[_0xbb87('0x1a')](function(_0x8786c4){return logger[_0xbb87('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util[_0xbb87('0x2b')](_0x8786c4,{'showHidden':![],'depth':null}));});}else{return logger[_0xbb87('0x1b')](_0xbb87('0x29'),_0xbb87('0x2a'),'intelepeer',_0xbb87('0x78'));}break;}}})[_0xbb87('0x79')](function(){_0x269103();});}else{_0x269103();}}},'charset':_0xbb87('0x7a'),'collate':_0xbb87('0x7b')});}; \ No newline at end of file +var _0xed5d=['SmsInteraction','findOne','update','createdAt','error','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','&password=','GET','sms','user_key','total_sent','internal_order_id','deliveryReport','skebby','Missing\x20parameters:\x20username,\x20password','connectel','authToken','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','username','xCALLY\x20Motion','senderString','format','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','sort','length','md5','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','Basic\x20%s','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','./smsMessage.attributes','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','isNil','SmsInteractionId'];(function(_0xd532a6,_0x3696cc){var _0x3665fe=function(_0x552525){while(--_0x552525){_0xd532a6['push'](_0xd532a6['shift']());}};_0x3665fe(++_0x3696cc);}(_0xed5d,0x157));var _0xded5=function(_0x24895c,_0x519282){_0x24895c=_0x24895c-0x0;var _0x47f286=_0xed5d[_0x24895c];return _0x47f286;};'use strict';var _=require('lodash');var util=require(_0xded5('0x0'));var logger=require(_0xded5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xded5('0x2'));var rp=require(_0xded5('0x3'));var fs=require('fs');var path=require(_0xded5('0x4'));var rimraf=require(_0xded5('0x5'));var config=require('../../config/environment');var attributes=require(_0xded5('0x6'));module['exports']=function(_0x4efa2c,_0x5c23cd){return _0x4efa2c['define'](_0xded5('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xded5('0x8'),'fields':[_0xded5('0x8')]},{'name':_0xded5('0x9'),'fields':[_0xded5('0xa')],'type':_0xded5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x318ded,_0x4d7a39,_0x46a992){var _0x2d89e5=_0x4efa2c['models'];var _0x23ee1b=_0x318ded[_0xded5('0xc')]({'plain':!![]});if(_0x23ee1b[_0xded5('0xd')][_0xded5('0xe')]()==='in'||_0x23ee1b['direction'][_0xded5('0xe')]()==='out'&&!_0x23ee1b['secret']&&!_[_0xded5('0xf')](_0x23ee1b['UserId'])&&!_['isNil'](_0x23ee1b[_0xded5('0x10')])){_0x2d89e5[_0xded5('0x11')][_0xded5('0x12')]({'where':{'id':_0x23ee1b[_0xded5('0x10')]}})['then'](function(_0x16282d){if(_0x16282d){_0x16282d[_0xded5('0x13')]({'lastMsgAt':_0x23ee1b[_0xded5('0x14')],'lastMsgDirection':_0x23ee1b[_0xded5('0xd')][_0xded5('0xe')]()});}})['catch'](function(_0x55e3a5){console[_0xded5('0x15')](_0x55e3a5);});}if(_0x23ee1b['direction']==='out'&&!_0x23ee1b[_0xded5('0x16')]){var _0x3b1a27;_0x2d89e5[_0xded5('0x17')][_0xded5('0x18')]({'where':{'id':_0x23ee1b[_0xded5('0x19')]},'raw':!![]})[_0xded5('0x1a')](function(_0x1b39d3){_0x3b1a27=_0x1b39d3;if(_0x3b1a27&&_0x3b1a27[_0xded5('0x1b')]){switch(_0x3b1a27[_0xded5('0x1b')]){case _0xded5('0x1c'):var _0x249e8c=require(_0xded5('0x1c'));if(_0x3b1a27[_0xded5('0x1d')]&&_0x3b1a27['authToken']&&_0x3b1a27[_0xded5('0x1e')]){var _0x5ae055=new _0x249e8c(_0x3b1a27[_0xded5('0x1d')],_0x3b1a27['authToken']);_0x5ae055['messages'][_0xded5('0x1f')]({'body':_0x23ee1b['body'],'to':_0x23ee1b['phone'],'from':_0x3b1a27[_0xded5('0x1e')],'statusCallback':_0x3b1a27[_0xded5('0x20')]+_0xded5('0x21')+_0x23ee1b['id']+_0xded5('0x22')+_0x3b1a27[_0xded5('0x23')]})['then'](function(_0x39d34d){if(_0x39d34d['sid']){return _0x318ded['update']({'messageId':_0x39d34d[_0xded5('0x24')]});}})[_0xded5('0x25')](function(_0x4f6c55){logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x1c'),util[_0xded5('0x28')](_0x4f6c55,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x1c'),_0xded5('0x29'));}break;case'skebby':var _0x2258ce=_0xded5('0x2a');if(_0x3b1a27['username']&&_0x3b1a27[_0xded5('0x2b')]){var _0xd19c5d={'recipient':[_0x23ee1b[_0xded5('0x1e')]],'message':_0x23ee1b['body'],'message_type':_0x3b1a27['smsMethod']};if(_0x3b1a27[_0xded5('0x2c')]&&_0x3b1a27[_0xded5('0x2c')]!=='SI'){_0xd19c5d[_0xded5('0x2d')]=_0x3b1a27[_0xded5('0x1e')];}var _0x3c4c44={'url':_0x2258ce+'login?username='+_0x3b1a27['username']+_0xded5('0x2e')+_0x3b1a27[_0xded5('0x2b')],'method':_0xded5('0x2f')};rp(_0x3c4c44)[_0xded5('0x1a')](function(_0x5a1601){var _0x3dfb20=_0x5a1601['split'](';');var _0x45f544={'user_key':_0x3dfb20[0x0],'session_key':_0x3dfb20[0x1]};_0x3c4c44={'url':_0x2258ce+_0xded5('0x30'),'method':'POST','headers':{'user_key':_0x45f544[_0xded5('0x31')],'Session_key':_0x45f544['session_key']},'json':!![],'body':_0xd19c5d};return rp(_0x3c4c44);})[_0xded5('0x1a')](function(_0x18c39c){if(_0x18c39c[_0xded5('0x32')]>=0x1){var _0x15c363={'messageId':_0x18c39c[_0xded5('0x33')]};if(_0x3b1a27[_0xded5('0x2c')]!=='GP'||!_0x3b1a27[_0xded5('0x34')]){_0x15c363['read']=!![];}return _0x318ded['update'](_0x15c363);}else{return logger[_0xded5('0x15')](_0xded5('0x26'),'afterCreate',_0xded5('0x35'),util[_0xded5('0x28')](_0x18c39c,{'showHidden':![],'depth':null}));}})[_0xded5('0x25')](function(_0x5845d7){return logger['error'](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x35'),util[_0xded5('0x28')](_0x5845d7,{'showHidden':![],'depth':null}));});}else{logger[_0xded5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),_0xded5('0x35'),_0xded5('0x36'));}break;case _0xded5('0x37'):if(_0x3b1a27['authToken']){var _0x126239={'recipient':_0x23ee1b[_0xded5('0x1e')],'message':_0x23ee1b[_0xded5('0xa')],'sender':_0x3b1a27['senderString']||_0x3b1a27[_0xded5('0x1e')],'authorization':_0x3b1a27[_0xded5('0x38')]};var _0x4d7a39={'method':'POST','uri':_0xded5('0x39'),'body':_0x126239,'json':!![]};rp(_0x4d7a39)[_0xded5('0x1a')](function(_0x110e91){var _0x1052e7={'messageId':_0x110e91[_0xded5('0x3a')]};if(!_0x3b1a27[_0xded5('0x34')]){_0x1052e7[_0xded5('0x3b')]=!![];}return _0x318ded[_0xded5('0x13')](_0x1052e7);})[_0xded5('0x25')](function(_0x5aa134){logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x37'),util[_0xded5('0x28')](_0x5aa134,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xded5('0x26'),'afterCreate',_0xded5('0x37'),_0xded5('0x3c'));}break;case'clicksend':if(_0x3b1a27[_0xded5('0x3d')]&&_0x3b1a27[_0xded5('0x2b')]){var _0x126239={'messages':[{'source':_0xded5('0x3e'),'to':_0x23ee1b[_0xded5('0x1e')],'body':_0x23ee1b['body'],'from':_0x3b1a27[_0xded5('0x3f')]||_0x3b1a27[_0xded5('0x1e')]}]};var _0x209fc9=util[_0xded5('0x40')](_0xded5('0x41'),_0x3b1a27[_0xded5('0x3d')],_0x3b1a27[_0xded5('0x2b')]);var _0x4d7a39={'method':_0xded5('0x42'),'uri':_0xded5('0x43'),'body':_0x126239,'headers':{'Authorization':util[_0xded5('0x40')]('Basic\x20%s',new Buffer(_0x209fc9)['toString'](_0xded5('0x44')))},'json':!![]};rp(_0x4d7a39)[_0xded5('0x1a')](function(_0x4f4575){if(_0x4f4575['http_code']>=0xc8&&_0x4f4575[_0xded5('0x45')]<=0xce){if(_0x4f4575['data']&&_0x4f4575[_0xded5('0x46')][_0xded5('0x47')]>0x0){var _0x57d1df=_[_0xded5('0x48')](_0x4f4575['data'][_0xded5('0x49')]);var _0x23fd93={'messageId':_0x57d1df[_0xded5('0x4a')]};if(!_0x3b1a27['deliveryReport']){_0x23fd93[_0xded5('0x3b')]=!![];}return _0x318ded[_0xded5('0x13')](_0x23fd93);}else{logger[_0xded5('0x15')](_0xded5('0x26'),'afterCreate','clickSend',util[_0xded5('0x28')](_0x4f4575,{'showHidden':![],'depth':null}));}}else{logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x4b'),util[_0xded5('0x28')](_0x4f4575,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1888ee){logger[_0xded5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),_0xded5('0x4b'),util[_0xded5('0x28')](_0x1888ee,{'showHidden':![],'depth':null}));});}else{logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x4b'),_0xded5('0x36'));}break;case _0xded5('0x4c'):if(_0x3b1a27[_0xded5('0x4d')]&&_0x3b1a27[_0xded5('0x38')]){var _0x126239={'dst':_0x23ee1b[_0xded5('0x1e')],'text':_0x23ee1b[_0xded5('0xa')],'src':_0x3b1a27[_0xded5('0x3f')]||_0x3b1a27['phone'],'url':_0x3b1a27[_0xded5('0x20')]+_0xded5('0x21')+_0x23ee1b['id']+_0xded5('0x22')+_0x3b1a27['token']};var _0x209fc9=util[_0xded5('0x40')](_0xded5('0x41'),_0x3b1a27['authId'],_0x3b1a27[_0xded5('0x38')]);var _0x4d7a39={'method':_0xded5('0x42'),'uri':util[_0xded5('0x40')](_0xded5('0x4e'),_0x3b1a27[_0xded5('0x4d')]),'body':_0x126239,'headers':{'Authorization':util[_0xded5('0x40')]('Basic\x20%s',new Buffer(_0x209fc9)[_0xded5('0x4f')](_0xded5('0x44')))},'json':!![]};rp(_0x4d7a39)['then'](function(_0x103a45){var _0x5a4047={'messageId':_0x103a45[_0xded5('0x50')][0x0]};return _0x318ded[_0xded5('0x13')](_0x5a4047);})['catch'](function(_0x42ac32){logger[_0xded5('0x15')](_0xded5('0x26'),'afterCreate',_0xded5('0x4c'),util['inspect'](_0x42ac32,{'showHidden':![],'depth':null}));});}else{logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x4c'),_0xded5('0x51'));}break;case'infobip':if(_0x3b1a27['username']&&_0x3b1a27[_0xded5('0x2b')]){if(_0x3b1a27[_0xded5('0x52')]){var _0x19f4a5={'method':'POST','uri':_0x3b1a27[_0xded5('0x52')]+'/auth/1/session','body':{'username':_0x3b1a27[_0xded5('0x3d')],'password':_0x3b1a27['password']},'json':!![]};return rp(_0x19f4a5)[_0xded5('0x1a')](function(_0xddc201){var _0x101bae={'method':_0xded5('0x42'),'uri':_0x3b1a27[_0xded5('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3b1a27[_0xded5('0x1e')],'destinations':[{'to':_0x23ee1b['phone']}],'text':_0x23ee1b['body'],'notifyUrl':_0x3b1a27['remote']+_0xded5('0x21')+_0x23ee1b['id']+_0xded5('0x22')+_0x3b1a27['token'],'notifyContentType':_0xded5('0x53'),'callbackData':_0x3b1a27[_0xded5('0x1e')]+';'+_0x23ee1b['body']}]},'headers':{'Authorization':_0xded5('0x54')+_0xddc201[_0xded5('0x23')]},'json':!![]};return rp(_0x101bae)[_0xded5('0x1a')](function(_0x2eabde){if(_0x2eabde[_0xded5('0x49')]){var _0x5a9f7c={'messageId':_0x2eabde[_0xded5('0x49')][0x0][_0xded5('0x8')]};if(!_0x3b1a27[_0xded5('0x34')]){_0x5a9f7c[_0xded5('0x3b')]=!![];}return _0x318ded[_0xded5('0x13')](_0x5a9f7c);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),'infobip',util[_0xded5('0x28')](_0x2eabde,{'showHidden':![],'depth':null}));}});})[_0xded5('0x25')](function(_0x283080){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),_0xded5('0x55'),util[_0xded5('0x28')](_0x283080,{'showHidden':![],'depth':null}));});}else{logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x55'),_0xded5('0x56'));}}else{logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x55'),_0xded5('0x36'));}break;case _0xded5('0x57'):var _0xf9bb8c=require('crypto');if(_0x3b1a27[_0xded5('0x58')]){var _0x5c7604={};_0x5c7604['login']=_0x3b1a27[_0xded5('0x3d')];_0x5c7604[_0xded5('0x1e')]=_0x23ee1b[_0xded5('0x1e')];_0x5c7604['sender']=_0x3b1a27[_0xded5('0x1e')];_0x5c7604[_0xded5('0x59')]=_0x23ee1b[_0xded5('0xa')];_0x5c7604[_0xded5('0x5a')]=+new Date();var _0x588335='';var _0x2eeced='';var _0x544f52=Object[_0xded5('0x5b')](_0x5c7604);_0x544f52[_0xded5('0x5c')]();for(var _0x37fb88=0x0;_0x37fb88<_0x544f52[_0xded5('0x5d')];_0x37fb88++){if(_0x588335!=''){_0x588335+='&';}_0x588335+=_0x544f52[_0x37fb88]+'='+encodeURIComponent(_0x5c7604[_0x544f52[_0x37fb88]]);_0x2eeced+=_0x5c7604[_0x544f52[_0x37fb88]];}_0x2eeced+=_0x3b1a27[_0xded5('0x58')];_0x2eeced=_0xf9bb8c['createHash'](_0xded5('0x5e'))[_0xded5('0x13')](_0x2eeced)[_0xded5('0x5f')]('hex');if(_0x588335!==''){_0x588335+='&';}_0x588335+=_0xded5('0x60')+_0x2eeced;var _0x3c4c44={'method':'GET','uri':_0x3b1a27['baseUrl']+_0xded5('0x61')+_0x588335,'json':!![]};return rp(_0x3c4c44)[_0xded5('0x1a')](function(_0xa6f526){var _0x3e3bab=Object[_0xded5('0x5b')](_0xa6f526);if(_0xa6f526[_0x3e3bab[0x0]][_0xded5('0x15')]&&parseInt(_0xa6f526[_0x3e3bab[0x0]][_0xded5('0x15')])===0x0){var _0x1ccd14={'messageId':_0xa6f526[_0x3e3bab[0x0]][_0xded5('0x62')]};if(!_0x3b1a27['deliveryReport']){_0x1ccd14[_0xded5('0x3b')]=!![];}return _0x318ded['update'](_0x1ccd14);}else{return logger[_0xded5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),_0xded5('0x57'),util[_0xded5('0x28')](_0xa6f526['error'],{'showHidden':![],'depth':null}));}})[_0xded5('0x25')](function(_0x2892f8){return logger[_0xded5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),'csc',util[_0xded5('0x28')](_0x2892f8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),'csc',_0xded5('0x63'));}break;case _0xded5('0x64'):if(_0x3b1a27[_0xded5('0x58')]){var _0x5deac6={'method':_0xded5('0x42'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3b1a27[_0xded5('0x58')]},'body':{'content':_0x23ee1b['body'],'to':[_0x23ee1b[_0xded5('0x1e')]],'from':_0x3b1a27[_0xded5('0x1e')],'binary':![],'clientMessageId':_0xded5('0x65'),'charset':_0xded5('0x66')},'json':!![]};rp(_0x5deac6)[_0xded5('0x1a')](function(_0x2aac63){if(!_0x2aac63['error']){var _0x500206={'messageId':_0x2aac63['messages'][0x0][_0xded5('0x67')]};if(!_0x3b1a27[_0xded5('0x34')]){_0x500206[_0xded5('0x3b')]=!![];}return _0x318ded['update'](_0x500206);}else{return logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x64'),util[_0xded5('0x28')](_0x2aac63[_0xded5('0x15')],{'showHidden':![],'depth':null}));}})[_0xded5('0x25')](function(_0xa75db5){return logger[_0xded5('0x15')](_0xded5('0x26'),'afterCreate','clickatell',util[_0xded5('0x28')](_0xa75db5,{'showHidden':![],'depth':null}));});}else{logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),_0xded5('0x64'),_0xded5('0x63'));}break;case _0xded5('0x68'):if(_0x3b1a27[_0xded5('0x3d')]&&_0x3b1a27[_0xded5('0x2b')]){var _0x209fc9=util[_0xded5('0x40')](_0xded5('0x41'),_0x3b1a27[_0xded5('0x3d')],_0x3b1a27['password']);var _0x4d7a39={'method':_0xded5('0x42'),'uri':_0xded5('0x69')+_0x3b1a27['accountId']+_0xded5('0x6a'),'body':{'to':[_0x23ee1b[_0xded5('0x1e')]],'text':_0x23ee1b[_0xded5('0xa')],'from':_0x3b1a27[_0xded5('0x1e')],'applicationId':_0x3b1a27[_0xded5('0x6b')]},'headers':{'Authorization':util['format'](_0xded5('0x6c'),new Buffer(_0x209fc9)[_0xded5('0x4f')](_0xded5('0x44')))},'json':!![]};rp(_0x4d7a39)[_0xded5('0x1a')](function(_0x49b4d5){if(_0x49b4d5['id']){var _0x456ae0={'messageId':_0x49b4d5['id']};return _0x318ded['update'](_0x456ae0);}else{logger[_0xded5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),_0xded5('0x68'),util[_0xded5('0x28')](_0x49b4d5,{'showHidden':![],'depth':null}));}})[_0xded5('0x25')](function(_0x5f4e81){logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),'bandwidth',util['inspect'](_0x5f4e81,{'showHidden':![],'depth':null}));});}else{logger[_0xded5('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xded5('0x27'),_0xded5('0x68'),_0xded5('0x36'));}break;case'intelepeer':if(_0x3b1a27[_0xded5('0x58')]){var _0x66d0c0={};var _0x3c4c44={'method':_0xded5('0x42'),'uri':_0xded5('0x6d'),'headers':{'Authorization':_0xded5('0x6e')+_0x3b1a27['apiKey'],'Content-Type':_0xded5('0x53')},'body':{'from':_0x3b1a27[_0xded5('0x1e')],'to':_0x23ee1b['phone'],'text':_0x23ee1b[_0xded5('0xa')]},'json':!![]};return rp(_0x3c4c44)['then'](function(_0x4750f4){if(_0x4750f4[_0xded5('0x6f')]==0xca){_0x66d0c0[_0xded5('0x70')]=_0x4750f4;var _0x52d2c5={'method':_0xded5('0x42'),'uri':_0xded5('0x71'),'headers':{'Authorization':_0xded5('0x6e')+_0x3b1a27['apiKey'],'Content-Type':_0xded5('0x53')},'body':{'refid':_0x66d0c0[_0xded5('0x70')][_0xded5('0x72')]},'json':!![]};return rp(_0x52d2c5)[_0xded5('0x1a')](function(_0x3b6424){_0x66d0c0[_0xded5('0x73')]=_0x3b6424;var _0x421d33={'messageId':_0x66d0c0[_0xded5('0x70')][_0xded5('0x72')],'read':!![]};return _0x318ded[_0xded5('0x13')](_0x421d33);});}else{return logger[_0xded5('0x15')](_0xded5('0x26'),_0xded5('0x27'),'intelepeer',util[_0xded5('0x28')](_0x4750f4,{'showHidden':![],'depth':null}));}})[_0xded5('0x25')](function(_0x479799){return logger['error'](_0xded5('0x26'),'afterCreate',_0xded5('0x74'),util[_0xded5('0x28')](_0x479799,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xded5('0x26'),_0xded5('0x27'),'intelepeer',_0xded5('0x75'));}break;}}})['finally'](function(){_0x46a992();});}else{_0x46a992();}}},'charset':_0xded5('0x76'),'collate':_0xded5('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fad3533..5f67f27 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 _0x11e7=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xd6c85b,_0x57091b){var _0xbe0e1e=function(_0x285c9a){while(--_0x285c9a){_0xd6c85b['push'](_0xd6c85b['shift']());}};_0xbe0e1e(++_0x57091b);}(_0x11e7,0x80));var _0x711e=function(_0x53af92,_0xc4f3be){_0x53af92=_0x53af92-0x0;var _0x557326=_0x11e7[_0x53af92];return _0x557326;};'use strict';var _=require(_0x711e('0x0'));var util=require(_0x711e('0x1'));var moment=require('moment');var BPromise=require(_0x711e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x711e('0x3'));var db=require(_0x711e('0x4'))['db'];var utils=require(_0x711e('0x5'));var logger=require(_0x711e('0x6'))(_0x711e('0x7'));var config=require('../../config/environment');var jayson=require(_0x711e('0x8'));var client=jayson['client'][_0x711e('0x9')]({'port':0x232a});config[_0x711e('0xa')]=_['defaults'](config[_0x711e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x711e('0xb'))(new Redis(config[_0x711e('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1e6cc1,_0x389e6b,_0x39e4c5){return new BPromise(function(_0x4f266a,_0x23230e){return client[_0x711e('0xc')](_0x1e6cc1,_0x39e4c5)[_0x711e('0xd')](function(_0x5e5635){logger[_0x711e('0xe')](_0x711e('0xf'),_0x389e6b,_0x711e('0x10'));logger['debug'](_0x711e('0x11'),_0x389e6b,_0x711e('0x10'),JSON[_0x711e('0x12')](_0x5e5635));if(_0x5e5635['error']){if(_0x5e5635[_0x711e('0x13')][_0x711e('0x14')]===0x1f4){logger[_0x711e('0x13')](_0x711e('0xf'),_0x389e6b,_0x5e5635['error']['message']);return _0x23230e(_0x5e5635['error'][_0x711e('0x15')]);}logger[_0x711e('0x13')](_0x711e('0xf'),_0x389e6b,_0x5e5635[_0x711e('0x13')]['message']);return _0x4f266a(_0x5e5635[_0x711e('0x13')]['message']);}else{logger['info'](_0x711e('0xf'),_0x389e6b,_0x711e('0x10'));_0x4f266a(_0x5e5635[_0x711e('0x16')][_0x711e('0x15')]);}})[_0x711e('0x17')](function(_0x347039){logger[_0x711e('0x13')](_0x711e('0xf'),_0x389e6b,_0x347039);_0x23230e(_0x347039);});});}exports[_0x711e('0x18')]=function(_0x1f9c8b){var _0x138e7d=this;return new Promise(function(_0x59e5fa,_0x2ef00f){return db[_0x711e('0x19')]['create'](_0x1f9c8b[_0x711e('0x1a')],{'raw':_0x1f9c8b[_0x711e('0x1b')]?_0x1f9c8b[_0x711e('0x1b')][_0x711e('0x1c')]===undefined?!![]:![]:!![]})[_0x711e('0xd')](function(_0x7e9370){logger['info'](_0x711e('0x18'),_0x1f9c8b);logger['debug']('CreateSmsMessage',_0x1f9c8b,JSON['stringify'](_0x7e9370));_0x59e5fa(_0x7e9370);})[_0x711e('0x17')](function(_0x589657){logger[_0x711e('0x13')](_0x711e('0x18'),_0x589657[_0x711e('0x15')],_0x1f9c8b);_0x2ef00f(_0x138e7d[_0x711e('0x13')](0x1f4,_0x589657[_0x711e('0x15')]));});});}; \ No newline at end of file +var _0xce0a=['client','http','defaults','redis','localhost','socket.io-emitter','register','then','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','SmsMessage','create','body','options','raw','CreateSmsMessage','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x270bef,_0x523245){var _0x45100e=function(_0x45c0e8){while(--_0x45c0e8){_0x270bef['push'](_0x270bef['shift']());}};_0x45100e(++_0x523245);}(_0xce0a,0x1c5));var _0xace0=function(_0x3f8647,_0x39c233){_0x3f8647=_0x3f8647-0x0;var _0x39d095=_0xce0a[_0x3f8647];return _0x39d095;};'use strict';var _=require('lodash');var util=require(_0xace0('0x0'));var moment=require(_0xace0('0x1'));var BPromise=require(_0xace0('0x2'));var rs=require(_0xace0('0x3'));var fs=require('fs');var Redis=require(_0xace0('0x4'));var db=require(_0xace0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xace0('0x6'))(_0xace0('0x7'));var config=require(_0xace0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xace0('0x9')][_0xace0('0xa')]({'port':0x232a});config['redis']=_[_0xace0('0xb')](config[_0xace0('0xc')],{'host':_0xace0('0xd'),'port':0x18eb});var socket=require(_0xace0('0xe'))(new Redis(config[_0xace0('0xc')]));require('./smsMessage.socket')[_0xace0('0xf')](socket);function respondWithRpcPromise(_0x3b3a86,_0x2444dd,_0x4d9e6a){return new BPromise(function(_0x18c785,_0x386a97){return client['request'](_0x3b3a86,_0x4d9e6a)[_0xace0('0x10')](function(_0x5bfc6e){logger['info']('SmsMessage,\x20%s,\x20%s',_0x2444dd,'request\x20sent');logger['debug'](_0xace0('0x11'),_0x2444dd,_0xace0('0x12'),JSON[_0xace0('0x13')](_0x5bfc6e));if(_0x5bfc6e[_0xace0('0x14')]){if(_0x5bfc6e[_0xace0('0x14')]['code']===0x1f4){logger[_0xace0('0x14')](_0xace0('0x15'),_0x2444dd,_0x5bfc6e[_0xace0('0x14')][_0xace0('0x16')]);return _0x386a97(_0x5bfc6e[_0xace0('0x14')]['message']);}logger[_0xace0('0x14')](_0xace0('0x15'),_0x2444dd,_0x5bfc6e[_0xace0('0x14')][_0xace0('0x16')]);return _0x18c785(_0x5bfc6e['error'][_0xace0('0x16')]);}else{logger[_0xace0('0x17')](_0xace0('0x15'),_0x2444dd,'request\x20sent');_0x18c785(_0x5bfc6e[_0xace0('0x18')]['message']);}})['catch'](function(_0x42007e){logger[_0xace0('0x14')](_0xace0('0x15'),_0x2444dd,_0x42007e);_0x386a97(_0x42007e);});});}exports['CreateSmsMessage']=function(_0x185652){var _0x4da23c=this;return new Promise(function(_0xf719a5,_0x57253c){return db[_0xace0('0x19')][_0xace0('0x1a')](_0x185652[_0xace0('0x1b')],{'raw':_0x185652[_0xace0('0x1c')]?_0x185652[_0xace0('0x1c')][_0xace0('0x1d')]===undefined?!![]:![]:!![]})[_0xace0('0x10')](function(_0x3456d1){logger[_0xace0('0x17')](_0xace0('0x1e'),_0x185652);logger[_0xace0('0x1f')](_0xace0('0x1e'),_0x185652,JSON[_0xace0('0x13')](_0x3456d1));_0xf719a5(_0x3456d1);})[_0xace0('0x20')](function(_0x313c1f){logger[_0xace0('0x14')](_0xace0('0x1e'),_0x313c1f[_0xace0('0x16')],_0x185652);_0x57253c(_0x4da23c[_0xace0('0x14')](0x1f4,_0x313c1f[_0xace0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d5c3a51..c0fc982 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 _0xeadc=['register','smsMessage:','./smsMessage.events','update','removeListener'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xeadc,0x10b));var _0xcead=function(_0x59af1e,_0x4cbf72){_0x59af1e=_0x59af1e-0x0;var _0x3e346b=_0xeadc[_0x59af1e];return _0x3e346b;};'use strict';var SmsMessageEvents=require(_0xcead('0x0'));var events=['save','remove',_0xcead('0x1')];function createListener(_0x3a98a1,_0x3b9f6c){return function(_0x48164f){_0x3b9f6c['emit'](_0x3a98a1,_0x48164f);};}function removeListener(_0xa14567,_0x1a33bd){return function(){SmsMessageEvents[_0xcead('0x2')](_0xa14567,_0x1a33bd);};}exports[_0xcead('0x3')]=function(_0x27cd88){for(var _0x2e4541=0x0,_0x85ddfa=events['length'];_0x2e4541<_0x85ddfa;_0x2e4541++){var _0x3736e6=events[_0x2e4541];var _0x12f19c=createListener(_0xcead('0x4')+_0x3736e6,_0x27cd88);SmsMessageEvents['on'](_0x3736e6,_0x12f19c);}}; \ No newline at end of file +var _0xa56f=['emit','removeListener','length','./smsMessage.events','save','remove','update'];(function(_0xd50b7f,_0x53c16c){var _0x380972=function(_0x4865d8){while(--_0x4865d8){_0xd50b7f['push'](_0xd50b7f['shift']());}};_0x380972(++_0x53c16c);}(_0xa56f,0x1bc));var _0xfa56=function(_0x3413ac,_0x483942){_0x3413ac=_0x3413ac-0x0;var _0x323e4e=_0xa56f[_0x3413ac];return _0x323e4e;};'use strict';var SmsMessageEvents=require(_0xfa56('0x0'));var events=[_0xfa56('0x1'),_0xfa56('0x2'),_0xfa56('0x3')];function createListener(_0xfc29f9,_0xda516c){return function(_0x25ecd6){_0xda516c[_0xfa56('0x4')](_0xfc29f9,_0x25ecd6);};}function removeListener(_0x4c238e,_0x2b2979){return function(){SmsMessageEvents[_0xfa56('0x5')](_0x4c238e,_0x2b2979);};}exports['register']=function(_0x4c2e17){for(var _0x253f08=0x0,_0x508108=events[_0xfa56('0x6')];_0x253f08<_0x508108;_0x253f08++){var _0x309518=events[_0x253f08];var _0x3f033a=createListener('smsMessage:'+_0x309518,_0x4c2e17);SmsMessageEvents['on'](_0x309518,_0x3f033a);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 2edde67..c220a1b 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 _0x6947=['getTeams','/:id/users','post','addTeams','put','destroy','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x5c8b05,_0x1c93d0){var _0x1cefdf=function(_0x11a64a){while(--_0x11a64a){_0x5c8b05['push'](_0x5c8b05['shift']());}};_0x1cefdf(++_0x1c93d0);}(_0x6947,0x18d));var _0x7694=function(_0x4da9e1,_0x28c369){_0x4da9e1=_0x4da9e1-0x0;var _0x241da2=_0x6947[_0x4da9e1];return _0x241da2;};'use strict';var multer=require(_0x7694('0x0'));var util=require(_0x7694('0x1'));var path=require(_0x7694('0x2'));var timeout=require(_0x7694('0x3'));var express=require(_0x7694('0x4'));var router=express['Router']();var fs_extra=require(_0x7694('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7694('0x6'));var config=require(_0x7694('0x7'));var controller=require(_0x7694('0x8'));router[_0x7694('0x9')]('/',auth[_0x7694('0xa')](),controller[_0x7694('0xb')]);router['get'](_0x7694('0xc'),auth[_0x7694('0xa')](),controller[_0x7694('0xd')]);router[_0x7694('0x9')](_0x7694('0xe'),auth[_0x7694('0xa')](),controller[_0x7694('0xf')]);router['get'](_0x7694('0x10'),auth[_0x7694('0xa')](),controller[_0x7694('0x11')]);router[_0x7694('0x9')](_0x7694('0x12'),auth[_0x7694('0xa')](),controller[_0x7694('0x13')]);router['get'](_0x7694('0x14'),auth[_0x7694('0xa')](),controller['getAgents']);router[_0x7694('0x15')]('/',auth[_0x7694('0xa')](),controller['create']);router[_0x7694('0x15')](_0x7694('0x12'),auth[_0x7694('0xa')](),controller[_0x7694('0x16')]);router[_0x7694('0x15')](_0x7694('0x14'),auth[_0x7694('0xa')](),controller['addAgents']);router[_0x7694('0x17')](_0x7694('0xe'),auth[_0x7694('0xa')](),controller['update']);router['delete'](_0x7694('0xe'),auth['isAuthenticated'](),controller[_0x7694('0x18')]);router[_0x7694('0x19')](_0x7694('0x12'),auth[_0x7694('0xa')](),controller['removeTeams']);router[_0x7694('0x19')](_0x7694('0x14'),auth[_0x7694('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xe0f6=['../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x4c67e1,_0xbfa4f){var _0x53ef74=function(_0x3fc9b2){while(--_0x3fc9b2){_0x4c67e1['push'](_0x4c67e1['shift']());}};_0x53ef74(++_0xbfa4f);}(_0xe0f6,0xf6));var _0x6e0f=function(_0xc6ae0a,_0x2e9abf){_0xc6ae0a=_0xc6ae0a-0x0;var _0x3a0c2c=_0xe0f6[_0xc6ae0a];return _0x3a0c2c;};'use strict';var multer=require(_0x6e0f('0x0'));var util=require(_0x6e0f('0x1'));var path=require(_0x6e0f('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e0f('0x3'));var router=express[_0x6e0f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6e0f('0x5'));var interaction=require(_0x6e0f('0x6'));var config=require('../../config/environment');var controller=require(_0x6e0f('0x7'));router['get']('/',auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x9')]);router[_0x6e0f('0xa')]('/describe',auth[_0x6e0f('0x8')](),controller[_0x6e0f('0xb')]);router[_0x6e0f('0xa')](_0x6e0f('0xc'),auth[_0x6e0f('0x8')](),controller[_0x6e0f('0xd')]);router[_0x6e0f('0xa')](_0x6e0f('0xe'),auth[_0x6e0f('0x8')](),controller[_0x6e0f('0xf')]);router[_0x6e0f('0xa')](_0x6e0f('0x10'),auth[_0x6e0f('0x8')](),controller['getTeams']);router[_0x6e0f('0xa')]('/:id/users',auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x11')]);router[_0x6e0f('0x12')]('/',auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x13')]);router[_0x6e0f('0x12')](_0x6e0f('0x10'),auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x14')]);router['post'](_0x6e0f('0x15'),auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x16')]);router['put']('/:id',auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x17')]);router['delete'](_0x6e0f('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x6e0f('0x18')](_0x6e0f('0x10'),auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x19')]);router['delete'](_0x6e0f('0x15'),auth[_0x6e0f('0x8')](),controller[_0x6e0f('0x1a')]);module[_0x6e0f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 33569f4..f0d212e 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 _0x46b2=['INTEGER','ENUM','beepall','roundrobin','STRING'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x46b2,0xc7));var _0x246b=function(_0x169b56,_0x5711d5){_0x169b56=_0x169b56-0x0;var _0x598972=_0x46b2[_0x169b56];return _0x598972;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x246b('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x246b('0x0')]},'timeout':{'type':Sequelize[_0x246b('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x246b('0x2')]('rrmemory',_0x246b('0x3'),_0x246b('0x4'))}}; \ No newline at end of file +var _0x16a4=['exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x201c83,_0x57759c){var _0x23299a=function(_0x5128ab){while(--_0x5128ab){_0x201c83['push'](_0x201c83['shift']());}};_0x23299a(++_0x57759c);}(_0x16a4,0x10e));var _0x416a=function(_0x17ee31,_0x4bd5dc){_0x17ee31=_0x17ee31-0x0;var _0x52ae83=_0x16a4[_0x17ee31];return _0x52ae83;};'use strict';var Sequelize=require('sequelize');module[_0x416a('0x0')]={'name':{'type':Sequelize[_0x416a('0x1')],'unique':_0x416a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x416a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x416a('0x4')](_0x416a('0x5'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 02808ba..908db63 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 _0x834b=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','SmsQueue','findAll','catch','params','keys','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserSmsQueue','User','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','smsPause','getTeams','Team','ids','online','interface','flatMap','Agents','transaction','addTeams','each','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x834b,0x113));var _0xb834=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x834b[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xb834('0x0'));var rimraf=require(_0xb834('0x1'));var zipdir=require(_0xb834('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb834('0x3'));var moment=require(_0xb834('0x4'));var BPromise=require(_0xb834('0x5'));var Mustache=require(_0xb834('0x6'));var util=require(_0xb834('0x7'));var path=require(_0xb834('0x8'));var sox=require(_0xb834('0x9'));var csv=require(_0xb834('0xa'));var ejs=require(_0xb834('0xb'));var fs=require('fs');var fs_extra=require(_0xb834('0xc'));var _=require(_0xb834('0xd'));var squel=require(_0xb834('0xe'));var crypto=require(_0xb834('0xf'));var jsforce=require(_0xb834('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb834('0xa'));var querystring=require(_0xb834('0x11'));var Papa=require(_0xb834('0x12'));var Redis=require(_0xb834('0x13'));var authService=require(_0xb834('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb834('0x15'));var hardwareService=require(_0xb834('0x16'));var logger=require(_0xb834('0x17'))('api');var utils=require(_0xb834('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb834('0x19'));var db=require('../../mysqldb')['db'];config[_0xb834('0x1a')]=_[_0xb834('0x1b')](config[_0xb834('0x1a')],{'host':_0xb834('0x1c'),'port':0x18eb});var socket=require(_0xb834('0x1d'))(new Redis(config['redis']));require(_0xb834('0x1e'))[_0xb834('0x1f')](socket);function respondWithStatusCode(_0x36038f,_0x53515c){_0x53515c=_0x53515c||0xcc;return function(_0x1388df){if(_0x1388df){return _0x36038f[_0xb834('0x20')](_0x53515c);}return _0x36038f[_0xb834('0x21')](_0x53515c)[_0xb834('0x22')]();};}function respondWithResult(_0x45eb2c,_0x2fa219){_0x2fa219=_0x2fa219||0xc8;return function(_0x300a8c){if(_0x300a8c){return _0x45eb2c[_0xb834('0x21')](_0x2fa219)[_0xb834('0x23')](_0x300a8c);}};}function respondWithFilteredResult(_0x3b7389,_0x26ada9){return function(_0x3a0db9){if(_0x3a0db9){var _0x516826=typeof _0x26ada9[_0xb834('0x24')]===_0xb834('0x25')&&typeof _0x26ada9[_0xb834('0x26')]==='undefined';var _0x38193f=_0x3a0db9[_0xb834('0x27')];var _0x5bc247=_0x516826?0x0:_0x26ada9[_0xb834('0x24')];var _0x4226cb=_0x516826?_0x3a0db9[_0xb834('0x27')]:_0x26ada9['offset']+_0x26ada9['limit'];var _0x36600c;if(_0x4226cb>=_0x38193f){_0x4226cb=_0x38193f;_0x36600c=0xc8;}else{_0x36600c=0xce;}_0x3b7389[_0xb834('0x21')](_0x36600c);return _0x3b7389[_0xb834('0x28')](_0xb834('0x29'),_0x5bc247+'-'+_0x4226cb+'/'+_0x38193f)[_0xb834('0x23')](_0x3a0db9);}return null;};}function patchUpdates(_0x1c2bf1){return function(_0x1ce1e2){try{jsonpatch[_0xb834('0x2a')](_0x1ce1e2,_0x1c2bf1,!![]);}catch(_0x3a6a66){return BPromise['reject'](_0x3a6a66);}return _0x1ce1e2[_0xb834('0x2b')]();};}function saveUpdates(_0x531dae,_0x3b220d){return function(_0x1df4b7){if(_0x1df4b7){return _0x1df4b7['update'](_0x531dae)[_0xb834('0x2c')](function(_0x15b04c){return _0x15b04c;});}return null;};}function removeEntity(_0x414e67,_0x1d03ea){return function(_0x312e74){if(_0x312e74){return _0x312e74[_0xb834('0x2d')]()[_0xb834('0x2c')](function(){var _0x3750ce=_0x312e74[_0xb834('0x2e')]({'plain':!![]});var _0x6f8c7a=_0xb834('0x2f');return db[_0xb834('0x30')][_0xb834('0x2d')]({'where':{'type':_0x6f8c7a,'resourceId':_0x3750ce['id']}})[_0xb834('0x2c')](function(){return _0x312e74;});})['then'](function(){_0x414e67[_0xb834('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b277c,_0x225733){return function(_0x2f0239){if(!_0x2f0239){_0x3b277c[_0xb834('0x20')](0x194);}return _0x2f0239;};}function handleError(_0x12a175,_0x2cbd54){_0x2cbd54=_0x2cbd54||0x1f4;return function(_0xe0cf38){logger[_0xb834('0x31')](_0xe0cf38[_0xb834('0x32')]);if(_0xe0cf38[_0xb834('0x33')]){delete _0xe0cf38[_0xb834('0x33')];}_0x12a175['status'](_0x2cbd54)[_0xb834('0x34')](_0xe0cf38);};}exports[_0xb834('0x35')]=function(_0x399964,_0x9cf08f){var _0x21c408={},_0x3e00b0={},_0x278ea3={'count':0x0,'rows':[]};var _0x4184e8=_[_0xb834('0x36')](db['SmsQueue'][_0xb834('0x37')],function(_0x191244){return{'name':_0x191244[_0xb834('0x38')],'type':_0x191244['type']['key']};});_0x3e00b0[_0xb834('0x39')]=_[_0xb834('0x36')](_0x4184e8,'name');_0x3e00b0[_0xb834('0x3a')]=_['keys'](_0x399964[_0xb834('0x3a')]);_0x3e00b0[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x3e00b0[_0xb834('0x39')],_0x3e00b0[_0xb834('0x3a')]);_0x21c408[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x3e00b0[_0xb834('0x39')],qs['fields'](_0x399964['query'][_0xb834('0x3e')]));_0x21c408[_0xb834('0x3d')]=_0x21c408[_0xb834('0x3d')][_0xb834('0x3f')]?_0x21c408[_0xb834('0x3d')]:_0x3e00b0['model'];if(!_0x399964[_0xb834('0x3a')][_0xb834('0x40')](_0xb834('0x41'))){_0x21c408[_0xb834('0x26')]=qs['limit'](_0x399964[_0xb834('0x3a')]['limit']);_0x21c408[_0xb834('0x24')]=qs[_0xb834('0x24')](_0x399964[_0xb834('0x3a')]['offset']);}_0x21c408[_0xb834('0x42')]=qs['sort'](_0x399964[_0xb834('0x3a')][_0xb834('0x43')]);_0x21c408['where']=qs['filters'](_[_0xb834('0x44')](_0x399964[_0xb834('0x3a')],_0x3e00b0[_0xb834('0x3b')]),_0x4184e8);if(_0x399964[_0xb834('0x3a')]['filter']){_0x21c408[_0xb834('0x45')]=_[_0xb834('0x46')](_0x21c408[_0xb834('0x45')],{'$or':_[_0xb834('0x36')](_0x4184e8,function(_0x1f57f1){if(_0x1f57f1[_0xb834('0x47')]!=='VIRTUAL'){var _0x339ca1={};_0x339ca1[_0x1f57f1[_0xb834('0x33')]]={'$like':'%'+_0x399964[_0xb834('0x3a')][_0xb834('0x48')]+'%'};return _0x339ca1;}})});}_0x21c408=_['merge']({},_0x21c408,_0x399964[_0xb834('0x49')]);var _0x300260={'where':_0x21c408[_0xb834('0x45')]};return db[_0xb834('0x4a')][_0xb834('0x27')](_0x300260)[_0xb834('0x2c')](function(_0x47d10a){_0x278ea3[_0xb834('0x27')]=_0x47d10a;if(_0x399964['query']['includeAll']){_0x21c408['include']=[{'all':!![]}];}return db[_0xb834('0x4a')][_0xb834('0x4b')](_0x21c408);})[_0xb834('0x2c')](function(_0x30636c){_0x278ea3['rows']=_0x30636c;return _0x278ea3;})[_0xb834('0x2c')](respondWithFilteredResult(_0x9cf08f,_0x21c408))[_0xb834('0x4c')](handleError(_0x9cf08f,null));};exports['show']=function(_0x4c5edc,_0x6dd9bc){var _0x54d015={'raw':!![],'where':{'id':_0x4c5edc[_0xb834('0x4d')]['id']}},_0x2f3780={};_0x2f3780['model']=_[_0xb834('0x4e')](db['SmsQueue'][_0xb834('0x37')]);_0x2f3780[_0xb834('0x3a')]=_[_0xb834('0x4e')](_0x4c5edc[_0xb834('0x3a')]);_0x2f3780[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x2f3780['model'],_0x2f3780[_0xb834('0x3a')]);_0x54d015[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x2f3780['model'],qs[_0xb834('0x3e')](_0x4c5edc[_0xb834('0x3a')][_0xb834('0x3e')]));_0x54d015[_0xb834('0x3d')]=_0x54d015['attributes'][_0xb834('0x3f')]?_0x54d015['attributes']:_0x2f3780[_0xb834('0x39')];if(_0x4c5edc[_0xb834('0x3a')][_0xb834('0x4f')]){_0x54d015['include']=[{'all':!![]}];}_0x54d015=_[_0xb834('0x46')]({},_0x54d015,_0x4c5edc['options']);return db[_0xb834('0x4a')]['find'](_0x54d015)[_0xb834('0x2c')](handleEntityNotFound(_0x6dd9bc,null))[_0xb834('0x2c')](respondWithResult(_0x6dd9bc,null))['catch'](handleError(_0x6dd9bc,null));};exports['create']=function(_0x57aa59,_0x3827ad){return db[_0xb834('0x4a')][_0xb834('0x50')](_0x57aa59['body'],{})[_0xb834('0x2c')](function(_0x251033){var _0x4588c0=_0x57aa59[_0xb834('0x51')]['get']({'plain':!![]});if(!_0x4588c0)throw new Error(_0xb834('0x52'));if(_0x4588c0[_0xb834('0x53')]===_0xb834('0x51')){var _0xcfb312=_0x251033[_0xb834('0x2e')]({'plain':!![]});var _0x1e2e1a=_0xb834('0x2f');return db['UserProfileSection'][_0xb834('0x54')]({'where':{'name':_0x1e2e1a,'userProfileId':_0x4588c0[_0xb834('0x55')]},'raw':!![]})[_0xb834('0x2c')](function(_0x3be9bc){if(_0x3be9bc&&_0x3be9bc[_0xb834('0x56')]===0x0){return db[_0xb834('0x30')]['create']({'name':_0xcfb312[_0xb834('0x33')],'resourceId':_0xcfb312['id'],'type':_0x3be9bc['name'],'sectionId':_0x3be9bc['id']},{})['then'](function(){return _0x251033;});}else{return _0x251033;}})[_0xb834('0x4c')](function(_0x54abf5){logger['error'](_0xb834('0x57'),_0x54abf5);throw _0x54abf5;});}return _0x251033;})['then'](respondWithResult(_0x3827ad,0xc9))[_0xb834('0x4c')](handleError(_0x3827ad,null));};exports[_0xb834('0x58')]=function(_0x5958a9,_0x51852a){if(_0x5958a9[_0xb834('0x59')]['id']){delete _0x5958a9['body']['id'];}return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x5958a9[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x51852a,null))['then'](saveUpdates(_0x5958a9[_0xb834('0x59')],null))[_0xb834('0x2c')](respondWithResult(_0x51852a,null))[_0xb834('0x4c')](handleError(_0x51852a,null));};exports['destroy']=function(_0x801a20,_0x3eda48){return db['SmsQueue'][_0xb834('0x54')]({'where':{'id':_0x801a20['params']['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x3eda48,null))[_0xb834('0x2c')](removeEntity(_0x3eda48,null))[_0xb834('0x4c')](handleError(_0x3eda48,null));};exports[_0xb834('0x5a')]=function(_0x14cfcb,_0x259b51){return db['SmsQueue'][_0xb834('0x5a')]()['then'](respondWithResult(_0x259b51,null))[_0xb834('0x4c')](handleError(_0x259b51,null));};exports[_0xb834('0x5b')]=function(_0x2dc619,_0x499340,_0x5201e7){var _0x58a770={'raw':!![],'where':{}},_0x422a14={},_0x32f5a9;return db['SmsQueue'][_0xb834('0x5c')]({'where':{'id':_0x2dc619[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x499340,null))['then'](function(_0x5caec5){if(_0x5caec5){_0x32f5a9=_0x5caec5[_0xb834('0x2e')]({'plain':!![]});_0x422a14[_0xb834('0x39')]=_[_0xb834('0x4e')](db[_0xb834('0x5d')][_0xb834('0x37')]);_0x422a14['query']=_[_0xb834('0x4e')](_0x2dc619[_0xb834('0x3a')]);_0x422a14[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x422a14[_0xb834('0x39')],_0x422a14[_0xb834('0x3a')]);_0x58a770[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x422a14[_0xb834('0x39')],qs[_0xb834('0x3e')](_0x2dc619[_0xb834('0x3a')][_0xb834('0x3e')]));_0x58a770[_0xb834('0x3d')]=_0x58a770['attributes'][_0xb834('0x3f')]?_0x58a770['attributes']:_0x422a14['model'];if(!_0x2dc619['query']['hasOwnProperty'](_0xb834('0x41'))){_0x58a770[_0xb834('0x26')]=qs['limit'](_0x2dc619[_0xb834('0x3a')][_0xb834('0x26')]);_0x58a770[_0xb834('0x24')]=qs[_0xb834('0x24')](_0x2dc619[_0xb834('0x3a')][_0xb834('0x24')]);}_0x58a770[_0xb834('0x42')]=qs[_0xb834('0x43')](_0x2dc619[_0xb834('0x3a')][_0xb834('0x43')]);_0x58a770['where']=qs[_0xb834('0x3b')](_[_0xb834('0x44')](_0x2dc619['query'],_0x422a14[_0xb834('0x3b')]));_0x58a770[_0xb834('0x45')]['SmsQueueId']=_0x5caec5['id'];if(_0x2dc619[_0xb834('0x3a')][_0xb834('0x48')]){_0x58a770['where']=_['merge'](_0x58a770[_0xb834('0x45')],{'$or':_[_0xb834('0x36')](_0x58a770[_0xb834('0x3d')],function(_0x2fab84){var _0x246b29={};_0x246b29[_0x2fab84]={'$like':'%'+_0x2dc619[_0xb834('0x3a')][_0xb834('0x48')]+'%'};return _0x246b29;})});}_0x58a770=_[_0xb834('0x46')]({},_0x58a770,_0x2dc619[_0xb834('0x49')]);return db[_0xb834('0x5d')][_0xb834('0x4b')](_0x58a770);}})[_0xb834('0x2c')](function(_0x1d9558){if(_0x1d9558){return db[_0xb834('0x5e')]['findAndCountAll']({'where':{'id':_[_0xb834('0x36')](_0x1d9558,_0xb834('0x5f')),'role':_0xb834('0x60')},'attributes':['id',_0xb834('0x33'),'smsPause',_0xb834('0x61'),_0xb834('0x62')]});}})['then'](function(_0x4635e0){if(_0x4635e0){return{'count':_0x4635e0['count'],'rows':_[_0xb834('0x36')](_0x4635e0[_0xb834('0x63')],function(_0x359a50){return{'membername':_0x359a50[_0xb834('0x33')],'UserId':_0x359a50['id'],'queue_name':_0x32f5a9[_0xb834('0x33')],'SmsQueueId':_0x32f5a9['id'],'interface':util[_0xb834('0x64')](_0xb834('0x65'),_0xb834('0x66'),_0x359a50[_0xb834('0x33')]),'penalty':0x0,'paused':_0x359a50[_0xb834('0x67')],'createdAt':_0x359a50['createdAt'],'updatedAt':_0x359a50[_0xb834('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb834('0x2c')](respondWithFilteredResult(_0x499340,_0x58a770))[_0xb834('0x4c')](handleError(_0x499340,null));};exports[_0xb834('0x68')]=function(_0x5b57d5,_0x5ef90e,_0x1c3a9a){var _0xc364f0={};var _0x6aabc3={};var _0x2b73d5;var _0x44e266;return db[_0xb834('0x4a')][_0xb834('0x5c')]({'where':{'id':_0x5b57d5[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0x5ef90e,null))[_0xb834('0x2c')](function(_0x1e7867){if(_0x1e7867){_0x2b73d5=_0x1e7867;_0x6aabc3['model']=_[_0xb834('0x4e')](db[_0xb834('0x69')][_0xb834('0x37')]);_0x6aabc3['query']=_[_0xb834('0x4e')](_0x5b57d5['query']);_0x6aabc3[_0xb834('0x3b')]=_[_0xb834('0x3c')](_0x6aabc3[_0xb834('0x39')],_0x6aabc3[_0xb834('0x3a')]);_0xc364f0[_0xb834('0x3d')]=_[_0xb834('0x3c')](_0x6aabc3[_0xb834('0x39')],qs[_0xb834('0x3e')](_0x5b57d5[_0xb834('0x3a')][_0xb834('0x3e')]));_0xc364f0[_0xb834('0x3d')]=_0xc364f0[_0xb834('0x3d')][_0xb834('0x3f')]?_0xc364f0[_0xb834('0x3d')]:_0x6aabc3['model'];_0xc364f0[_0xb834('0x42')]=qs[_0xb834('0x43')](_0x5b57d5[_0xb834('0x3a')][_0xb834('0x43')]);_0xc364f0[_0xb834('0x45')]=qs[_0xb834('0x3b')](_['pick'](_0x5b57d5[_0xb834('0x3a')],_0x6aabc3[_0xb834('0x3b')]));if(_0x5b57d5['query']['filter']){_0xc364f0[_0xb834('0x45')]=_[_0xb834('0x46')](_0xc364f0[_0xb834('0x45')],{'$or':_['map'](_0xc364f0['attributes'],function(_0x216802){var _0x470cc2={};_0x470cc2[_0x216802]={'$like':'%'+_0x5b57d5['query'][_0xb834('0x48')]+'%'};return _0x470cc2;})});}_0xc364f0=_[_0xb834('0x46')]({},_0xc364f0,_0x5b57d5[_0xb834('0x49')]);return _0x2b73d5[_0xb834('0x68')](_0xc364f0);}})['then'](function(_0x20d5f1){if(_0x20d5f1){_0x44e266=_0x20d5f1[_0xb834('0x3f')];if(!_0x5b57d5['query'][_0xb834('0x40')](_0xb834('0x41'))){_0xc364f0[_0xb834('0x26')]=qs[_0xb834('0x26')](_0x5b57d5[_0xb834('0x3a')]['limit']);_0xc364f0[_0xb834('0x24')]=qs[_0xb834('0x24')](_0x5b57d5['query'][_0xb834('0x24')]);}return _0x2b73d5['getTeams'](_0xc364f0);}})[_0xb834('0x2c')](function(_0x2358ab){if(_0x2358ab){return _0x2358ab?{'count':_0x44e266,'rows':_0x2358ab}:null;}})[_0xb834('0x2c')](respondWithResult(_0x5ef90e,null))[_0xb834('0x4c')](handleError(_0x5ef90e,null));};exports['addTeams']=function(_0x76b2d,_0x410e28,_0x16ebc6){var _0x2cc16d=_0x76b2d['body'][_0xb834('0x6a')];return db[_0xb834('0x69')]['findAll']({'where':{'id':_0x2cc16d},'attributes':['id'],'include':[{'model':db[_0xb834('0x5e')],'as':'Agents','attributes':['id','name',_0xb834('0x6b'),'voicePause',_0xb834('0x6c')],'raw':!![]}]})[_0xb834('0x2c')](function(_0x2bead6){if(_0x2bead6){var _0x482fb9=_[_0xb834('0x6d')](_0x2bead6,function(_0x2319bc){var _0x2a3056=_0x2319bc['get']({'plain':!![]});return _0x2a3056[_0xb834('0x6e')];});return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x76b2d[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](function(_0x19bed7){return db['sequelize'][_0xb834('0x6f')](function(_0x52f765){return _0x19bed7[_0xb834('0x70')](_0x2cc16d,{'transaction':_0x52f765})[_0xb834('0x2c')](function(){return BPromise[_0xb834('0x71')](_0x482fb9,function(_0x43c420){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x43c420['id'],'SmsQueueId':_0x76b2d['params']['id']},'transaction':_0x52f765});});})[_0xb834('0x2c')](function(){_0x482fb9[_0xb834('0x72')](function(_0x2e5d87){socket[_0xb834('0x73')]('userSmsQueue:save',{'UserId':_0x2e5d87['id'],'SmsQueueId':_0x19bed7['id']});});});});});}})[_0xb834('0x2c')](respondWithStatusCode(_0x410e28,null))['catch'](handleError(_0x410e28,null));};exports[_0xb834('0x74')]=function(_0x45db70,_0x4b05b9,_0x5c92e6){return db[_0xb834('0x69')][_0xb834('0x4b')]({'where':{'id':_0x45db70['query'][_0xb834('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xb834('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b05b9,null))[_0xb834('0x2c')](function(_0x198827){var _0x99911=_['map'](_0x198827,'id');var _0x2bfdca=[];var _0x437c0a=[];var _0x19422f=squel[_0xb834('0x75')]();_0x19422f['field'](_0xb834('0x76'))[_0xb834('0x77')](_0xb834('0x78'),'tq')[_0xb834('0x79')](_0xb834('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb834('0x45')](_0xb834('0x7b'),_0x45db70[_0xb834('0x4d')]['id']);for(var _0x581a2b=0x0;_0x581a2b<_0x198827[_0xb834('0x3f')];_0x581a2b+=0x1){let _0x2bffa3=_0x198827[_0x581a2b];for(var _0x5ddfd8=0x0;_0x5ddfd8<_0x2bffa3[_0xb834('0x6e')]['length'];_0x5ddfd8+=0x1){let _0x4decc6=_0x2bffa3['Agents'][_0x5ddfd8];var _0x23934e=_0x19422f[_0xb834('0x7c')]();_0x23934e[_0xb834('0x45')](_0xb834('0x7d'),_0x4decc6['id']);_0x437c0a[_0xb834('0x7e')](db['sequelize'][_0xb834('0x3a')](_0x23934e[_0xb834('0x7f')](),{'type':db[_0xb834('0x80')]['QueryTypes'][_0xb834('0x81')]})[_0xb834('0x2c')](function(_0x30734e){if(_0x30734e[_0xb834('0x3f')]===0x1){return _0x4decc6['id'];}else{var _0x5b2520=_[_0xb834('0x82')](_[_0xb834('0x36')](_0x30734e,_0xb834('0x83')),function(_0x2962ee){return _['includes'](_0x99911,_0x2962ee);});if(_0x5b2520){return _0x4decc6['id'];}}}));}}return BPromise[_0xb834('0x84')](_0x437c0a)[_0xb834('0x2c')](function(_0x27d685){_0x2bfdca=_(_0x2bfdca)[_0xb834('0x85')](_0x27d685)[_0xb834('0x86')]()[_0xb834('0x87')]();return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x45db70['params']['id']}})[_0xb834('0x2c')](function(_0x1c9a8e){return db['sequelize'][_0xb834('0x6f')](function(_0x323a53){return _0x1c9a8e[_0xb834('0x74')](_0x45db70[_0xb834('0x3a')][_0xb834('0x6a')],{'transaction':_0x323a53})[_0xb834('0x2c')](function(){if(!_[_0xb834('0x88')](_0x2bfdca)){return _0x1c9a8e[_0xb834('0x89')](_0x2bfdca,{'transaction':_0x323a53});}})['then'](function(){_0x2bfdca[_0xb834('0x72')](function(_0x46fa4c){socket[_0xb834('0x73')](_0xb834('0x8a'),{'UserId':_0x46fa4c,'SmsQueueId':_0x1c9a8e['id']});});});});});});})['then'](respondWithStatusCode(_0x4b05b9,null))['catch'](handleError(_0x4b05b9,null));};exports[_0xb834('0x8b')]=function(_0x16b41d,_0xa3128,_0x48bb8e){return db['SmsQueue'][_0xb834('0x54')]({'where':{'id':_0x16b41d[_0xb834('0x4d')]['id']}})['then'](handleEntityNotFound(_0xa3128,null))[_0xb834('0x2c')](function(_0x191851){if(_0x191851){return _0x191851[_0xb834('0x8b')](_0x16b41d[_0xb834('0x59')]['ids'],_['omit'](_0x16b41d[_0xb834('0x59')],[_0xb834('0x6a'),'id'])||{})[_0xb834('0x8c')](function(_0x1b07c8){for(var _0x27e5db=0x0;_0x27e5db<_0x16b41d[_0xb834('0x59')]['ids'][_0xb834('0x3f')];_0x27e5db+=0x1){socket['emit'](_0xb834('0x8d'),{'UserId':Number(_0x16b41d['body'][_0xb834('0x6a')][_0x27e5db]),'SmsQueueId':Number(_0x16b41d['params']['id'])});}return _0x1b07c8;});}})[_0xb834('0x2c')](respondWithResult(_0xa3128,null))['catch'](handleError(_0xa3128,null));};exports[_0xb834('0x89')]=function(_0x15ad0c,_0x1530a7,_0x268314){return db[_0xb834('0x4a')][_0xb834('0x54')]({'where':{'id':_0x15ad0c[_0xb834('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1530a7,null))[_0xb834('0x2c')](function(_0x60d3f){if(_0x60d3f){return _0x60d3f[_0xb834('0x89')](_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')])[_0xb834('0x2c')](function(){if(_['isArray'](_0x15ad0c[_0xb834('0x3a')]['ids'])){for(var _0x2fdad4=0x0;_0x2fdad4<_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')][_0xb834('0x3f')];_0x2fdad4+=0x1){socket[_0xb834('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')][_0x2fdad4]),'SmsQueueId':Number(_0x15ad0c[_0xb834('0x4d')]['id'])});}}else{socket[_0xb834('0x73')](_0xb834('0x8a'),{'UserId':Number(_0x15ad0c[_0xb834('0x3a')][_0xb834('0x6a')]),'SmsQueueId':Number(_0x15ad0c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1530a7,null))['catch'](handleError(_0x1530a7,null));};exports[_0xb834('0x8e')]=function(_0x4cd9e5,_0xa3f748,_0x4a0ff3){var _0x2f84e3={};var _0x148e16={};var _0x57c50c;var _0xb7cdc5;return db[_0xb834('0x4a')][_0xb834('0x5c')]({'where':{'id':_0x4cd9e5[_0xb834('0x4d')]['id']}})[_0xb834('0x2c')](handleEntityNotFound(_0xa3f748,null))['then'](function(_0x42a7a0){if(_0x42a7a0){_0x57c50c=_0x42a7a0;_0x148e16['model']=_[_0xb834('0x4e')](db['User'][_0xb834('0x37')]);_0x148e16['query']=_[_0xb834('0x4e')](_0x4cd9e5[_0xb834('0x3a')]);_0x148e16[_0xb834('0x3b')]=_['intersection'](_0x148e16['model'],_0x148e16[_0xb834('0x3a')]);_0x2f84e3[_0xb834('0x3d')]=_['intersection'](_0x148e16[_0xb834('0x39')],qs[_0xb834('0x3e')](_0x4cd9e5['query'][_0xb834('0x3e')]));_0x2f84e3[_0xb834('0x3d')]=_0x2f84e3['attributes'][_0xb834('0x3f')]?_0x2f84e3['attributes']:_0x148e16['model'];_0x2f84e3[_0xb834('0x42')]=qs['sort'](_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x43')]);_0x2f84e3[_0xb834('0x45')]=qs['filters'](_[_0xb834('0x44')](_0x4cd9e5[_0xb834('0x3a')],_0x148e16[_0xb834('0x3b')]));if(_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x48')]){_0x2f84e3[_0xb834('0x45')]=_[_0xb834('0x46')](_0x2f84e3[_0xb834('0x45')],{'$or':_[_0xb834('0x36')](_0x2f84e3[_0xb834('0x3d')],function(_0x36a75b){var _0x218887={};_0x218887[_0x36a75b]={'$like':'%'+_0x4cd9e5['query'][_0xb834('0x48')]+'%'};return _0x218887;})});}_0x2f84e3=_[_0xb834('0x46')]({},_0x2f84e3,_0x4cd9e5[_0xb834('0x49')]);return _0x57c50c[_0xb834('0x8e')](_0x2f84e3);}})[_0xb834('0x2c')](function(_0x356d0f){if(_0x356d0f){_0xb7cdc5=_0x356d0f[_0xb834('0x3f')];if(!_0x4cd9e5['query'][_0xb834('0x40')](_0xb834('0x41'))){_0x2f84e3[_0xb834('0x26')]=qs[_0xb834('0x26')](_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x26')]);_0x2f84e3[_0xb834('0x24')]=qs['offset'](_0x4cd9e5[_0xb834('0x3a')][_0xb834('0x24')]);}return _0x57c50c['getAgents'](_0x2f84e3);}})['then'](function(_0x2db8aa){if(_0x2db8aa){return _0x2db8aa?{'count':_0xb7cdc5,'rows':_0x2db8aa}:null;}})['then'](respondWithResult(_0xa3f748,null))[_0xb834('0x4c')](handleError(_0xa3f748,null));}; \ No newline at end of file +var _0x6fd1=['smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','length','hasOwnProperty','addTeams','ids','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','send','SmsQueue','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','nolimit','sort','filters','pick','where','VIRTUAL','filter','options','include','findAll','rows','intersection','includeAll','find','catch','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','merge','User','agent'];(function(_0xdb5808,_0x58c067){var _0x111072=function(_0x3c3f27){while(--_0x3c3f27){_0xdb5808['push'](_0xdb5808['shift']());}};_0x111072(++_0x58c067);}(_0x6fd1,0x14b));var _0x16fd=function(_0x43c3a3,_0x44dac3){_0x43c3a3=_0x43c3a3-0x0;var _0x3ec1de=_0x6fd1[_0x43c3a3];return _0x3ec1de;};'use strict';var emlformat=require(_0x16fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16fd('0x1'));var jsonpatch=require(_0x16fd('0x2'));var rp=require('request-promise');var moment=require(_0x16fd('0x3'));var BPromise=require(_0x16fd('0x4'));var Mustache=require(_0x16fd('0x5'));var util=require('util');var path=require(_0x16fd('0x6'));var sox=require(_0x16fd('0x7'));var csv=require(_0x16fd('0x8'));var ejs=require(_0x16fd('0x9'));var fs=require('fs');var fs_extra=require(_0x16fd('0xa'));var _=require(_0x16fd('0xb'));var squel=require(_0x16fd('0xc'));var crypto=require(_0x16fd('0xd'));var jsforce=require(_0x16fd('0xe'));var deskjs=require(_0x16fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x16fd('0x10'));var Papa=require(_0x16fd('0x11'));var Redis=require('ioredis');var authService=require(_0x16fd('0x12'));var qs=require(_0x16fd('0x13'));var as=require(_0x16fd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16fd('0x15'))(_0x16fd('0x16'));var utils=require(_0x16fd('0x17'));var config=require(_0x16fd('0x18'));var licenseUtil=require(_0x16fd('0x19'));var db=require(_0x16fd('0x1a'))['db'];config['redis']=_[_0x16fd('0x1b')](config[_0x16fd('0x1c')],{'host':_0x16fd('0x1d'),'port':0x18eb});var socket=require(_0x16fd('0x1e'))(new Redis(config['redis']));require(_0x16fd('0x1f'))['register'](socket);function respondWithStatusCode(_0x2648f3,_0x74853){_0x74853=_0x74853||0xcc;return function(_0x15b2ab){if(_0x15b2ab){return _0x2648f3[_0x16fd('0x20')](_0x74853);}return _0x2648f3[_0x16fd('0x21')](_0x74853)[_0x16fd('0x22')]();};}function respondWithResult(_0x5e303b,_0x2a0feb){_0x2a0feb=_0x2a0feb||0xc8;return function(_0x579900){if(_0x579900){return _0x5e303b['status'](_0x2a0feb)[_0x16fd('0x23')](_0x579900);}};}function respondWithFilteredResult(_0x54cab7,_0x59cd1){return function(_0x12c4a8){if(_0x12c4a8){var _0x3dbf2a=typeof _0x59cd1[_0x16fd('0x24')]===_0x16fd('0x25')&&typeof _0x59cd1[_0x16fd('0x26')]===_0x16fd('0x25');var _0x21300f=_0x12c4a8['count'];var _0x3da761=_0x3dbf2a?0x0:_0x59cd1[_0x16fd('0x24')];var _0x14a541=_0x3dbf2a?_0x12c4a8[_0x16fd('0x27')]:_0x59cd1[_0x16fd('0x24')]+_0x59cd1[_0x16fd('0x26')];var _0x28b16e;if(_0x14a541>=_0x21300f){_0x14a541=_0x21300f;_0x28b16e=0xc8;}else{_0x28b16e=0xce;}_0x54cab7[_0x16fd('0x21')](_0x28b16e);return _0x54cab7[_0x16fd('0x28')](_0x16fd('0x29'),_0x3da761+'-'+_0x14a541+'/'+_0x21300f)[_0x16fd('0x23')](_0x12c4a8);}return null;};}function patchUpdates(_0x52f77e){return function(_0x374ef5){try{jsonpatch[_0x16fd('0x2a')](_0x374ef5,_0x52f77e,!![]);}catch(_0x576c82){return BPromise[_0x16fd('0x2b')](_0x576c82);}return _0x374ef5['save']();};}function saveUpdates(_0x2f602d,_0x5e51c3){return function(_0x1a37f0){if(_0x1a37f0){return _0x1a37f0[_0x16fd('0x2c')](_0x2f602d)['then'](function(_0xd30049){return _0xd30049;});}return null;};}function removeEntity(_0x5d7682,_0x5ac90b){return function(_0x1c96a7){if(_0x1c96a7){return _0x1c96a7[_0x16fd('0x2d')]()[_0x16fd('0x2e')](function(){var _0x197188=_0x1c96a7[_0x16fd('0x2f')]({'plain':!![]});var _0x1724e2=_0x16fd('0x30');return db[_0x16fd('0x31')][_0x16fd('0x2d')]({'where':{'type':_0x1724e2,'resourceId':_0x197188['id']}})[_0x16fd('0x2e')](function(){return _0x1c96a7;});})[_0x16fd('0x2e')](function(){_0x5d7682[_0x16fd('0x21')](0xcc)[_0x16fd('0x22')]();});}};}function handleEntityNotFound(_0x60f426,_0x19fee6){return function(_0x2557eb){if(!_0x2557eb){_0x60f426[_0x16fd('0x20')](0x194);}return _0x2557eb;};}function handleError(_0x1854f4,_0x56c459){_0x56c459=_0x56c459||0x1f4;return function(_0x59e806){logger[_0x16fd('0x32')](_0x59e806[_0x16fd('0x33')]);if(_0x59e806[_0x16fd('0x34')]){delete _0x59e806[_0x16fd('0x34')];}_0x1854f4['status'](_0x56c459)[_0x16fd('0x35')](_0x59e806);};}exports['index']=function(_0xb35c4d,_0x5ebd8e){var _0x3abc49={},_0x464a92={},_0x39bb9b={'count':0x0,'rows':[]};var _0x5bfe46=_['map'](db[_0x16fd('0x36')][_0x16fd('0x37')],function(_0x30eda9){return{'name':_0x30eda9[_0x16fd('0x38')],'type':_0x30eda9[_0x16fd('0x39')]['key']};});_0x464a92[_0x16fd('0x3a')]=_[_0x16fd('0x3b')](_0x5bfe46,'name');_0x464a92[_0x16fd('0x3c')]=_[_0x16fd('0x3d')](_0xb35c4d[_0x16fd('0x3c')]);_0x464a92['filters']=_['intersection'](_0x464a92['model'],_0x464a92[_0x16fd('0x3c')]);_0x3abc49[_0x16fd('0x3e')]=_['intersection'](_0x464a92[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0xb35c4d[_0x16fd('0x3c')]['fields']));_0x3abc49[_0x16fd('0x3e')]=_0x3abc49['attributes']['length']?_0x3abc49[_0x16fd('0x3e')]:_0x464a92[_0x16fd('0x3a')];if(!_0xb35c4d[_0x16fd('0x3c')]['hasOwnProperty'](_0x16fd('0x40'))){_0x3abc49[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0xb35c4d[_0x16fd('0x3c')][_0x16fd('0x26')]);_0x3abc49[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0xb35c4d['query'][_0x16fd('0x24')]);}_0x3abc49['order']=qs[_0x16fd('0x41')](_0xb35c4d[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x3abc49['where']=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0xb35c4d[_0x16fd('0x3c')],_0x464a92['filters']),_0x5bfe46);if(_0xb35c4d[_0x16fd('0x3c')]['filter']){_0x3abc49[_0x16fd('0x44')]=_['merge'](_0x3abc49['where'],{'$or':_['map'](_0x5bfe46,function(_0x41c0c0){if(_0x41c0c0[_0x16fd('0x39')]!==_0x16fd('0x45')){var _0x3457e9={};_0x3457e9[_0x41c0c0[_0x16fd('0x34')]]={'$like':'%'+_0xb35c4d[_0x16fd('0x3c')][_0x16fd('0x46')]+'%'};return _0x3457e9;}})});}_0x3abc49=_['merge']({},_0x3abc49,_0xb35c4d[_0x16fd('0x47')]);var _0x12e655={'where':_0x3abc49[_0x16fd('0x44')]};return db[_0x16fd('0x36')][_0x16fd('0x27')](_0x12e655)[_0x16fd('0x2e')](function(_0x455126){_0x39bb9b[_0x16fd('0x27')]=_0x455126;if(_0xb35c4d[_0x16fd('0x3c')]['includeAll']){_0x3abc49[_0x16fd('0x48')]=[{'all':!![]}];}return db['SmsQueue'][_0x16fd('0x49')](_0x3abc49);})[_0x16fd('0x2e')](function(_0x37ec8c){_0x39bb9b[_0x16fd('0x4a')]=_0x37ec8c;return _0x39bb9b;})['then'](respondWithFilteredResult(_0x5ebd8e,_0x3abc49))['catch'](handleError(_0x5ebd8e,null));};exports['show']=function(_0x8171e9,_0x4b8e89){var _0x527b8c={'raw':!![],'where':{'id':_0x8171e9['params']['id']}},_0x3fe79d={};_0x3fe79d[_0x16fd('0x3a')]=_[_0x16fd('0x3d')](db['SmsQueue'][_0x16fd('0x37')]);_0x3fe79d['query']=_[_0x16fd('0x3d')](_0x8171e9[_0x16fd('0x3c')]);_0x3fe79d[_0x16fd('0x42')]=_[_0x16fd('0x4b')](_0x3fe79d[_0x16fd('0x3a')],_0x3fe79d[_0x16fd('0x3c')]);_0x527b8c[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x3fe79d[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0x8171e9[_0x16fd('0x3c')]['fields']));_0x527b8c[_0x16fd('0x3e')]=_0x527b8c['attributes']['length']?_0x527b8c[_0x16fd('0x3e')]:_0x3fe79d[_0x16fd('0x3a')];if(_0x8171e9[_0x16fd('0x3c')][_0x16fd('0x4c')]){_0x527b8c['include']=[{'all':!![]}];}_0x527b8c=_['merge']({},_0x527b8c,_0x8171e9[_0x16fd('0x47')]);return db[_0x16fd('0x36')][_0x16fd('0x4d')](_0x527b8c)[_0x16fd('0x2e')](handleEntityNotFound(_0x4b8e89,null))[_0x16fd('0x2e')](respondWithResult(_0x4b8e89,null))[_0x16fd('0x4e')](handleError(_0x4b8e89,null));};exports[_0x16fd('0x4f')]=function(_0x35937c,_0x143fa0){return db[_0x16fd('0x36')][_0x16fd('0x4f')](_0x35937c[_0x16fd('0x50')],{})[_0x16fd('0x2e')](function(_0x2020a0){var _0x13ec6a=_0x35937c['user']['get']({'plain':!![]});if(!_0x13ec6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13ec6a['role']===_0x16fd('0x51')){var _0x21dfdc=_0x2020a0[_0x16fd('0x2f')]({'plain':!![]});var _0x13075d=_0x16fd('0x30');return db['UserProfileSection'][_0x16fd('0x4d')]({'where':{'name':_0x13075d,'userProfileId':_0x13ec6a[_0x16fd('0x52')]},'raw':!![]})[_0x16fd('0x2e')](function(_0x22a6c5){if(_0x22a6c5&&_0x22a6c5[_0x16fd('0x53')]===0x0){return db[_0x16fd('0x31')][_0x16fd('0x4f')]({'name':_0x21dfdc[_0x16fd('0x34')],'resourceId':_0x21dfdc['id'],'type':_0x22a6c5[_0x16fd('0x34')],'sectionId':_0x22a6c5['id']},{})['then'](function(){return _0x2020a0;});}else{return _0x2020a0;}})[_0x16fd('0x4e')](function(_0x2069e0){logger[_0x16fd('0x32')](_0x16fd('0x54'),_0x2069e0);throw _0x2069e0;});}return _0x2020a0;})[_0x16fd('0x2e')](respondWithResult(_0x143fa0,0xc9))[_0x16fd('0x4e')](handleError(_0x143fa0,null));};exports[_0x16fd('0x2c')]=function(_0x1fe349,_0x3bfb9d){if(_0x1fe349[_0x16fd('0x50')]['id']){delete _0x1fe349[_0x16fd('0x50')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x1fe349[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x3bfb9d,null))[_0x16fd('0x2e')](saveUpdates(_0x1fe349['body'],null))[_0x16fd('0x2e')](respondWithResult(_0x3bfb9d,null))[_0x16fd('0x4e')](handleError(_0x3bfb9d,null));};exports[_0x16fd('0x2d')]=function(_0x22e589,_0x217542){return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x22e589[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x217542,null))[_0x16fd('0x2e')](removeEntity(_0x217542,null))['catch'](handleError(_0x217542,null));};exports[_0x16fd('0x56')]=function(_0x42b06b,_0x25389d){return db[_0x16fd('0x36')][_0x16fd('0x56')]()[_0x16fd('0x2e')](respondWithResult(_0x25389d,null))['catch'](handleError(_0x25389d,null));};exports[_0x16fd('0x57')]=function(_0x52cdd0,_0x16e936,_0x5ead5c){var _0x1f03c0={'raw':!![],'where':{}},_0x3c40a1={},_0x42c722;return db[_0x16fd('0x36')][_0x16fd('0x58')]({'where':{'id':_0x52cdd0[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x16e936,null))[_0x16fd('0x2e')](function(_0x3d1ef8){if(_0x3d1ef8){_0x42c722=_0x3d1ef8[_0x16fd('0x2f')]({'plain':!![]});_0x3c40a1[_0x16fd('0x3a')]=_[_0x16fd('0x3d')](db[_0x16fd('0x59')][_0x16fd('0x37')]);_0x3c40a1['query']=_[_0x16fd('0x3d')](_0x52cdd0[_0x16fd('0x3c')]);_0x3c40a1[_0x16fd('0x42')]=_['intersection'](_0x3c40a1[_0x16fd('0x3a')],_0x3c40a1[_0x16fd('0x3c')]);_0x1f03c0[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x3c40a1[_0x16fd('0x3a')],qs['fields'](_0x52cdd0[_0x16fd('0x3c')][_0x16fd('0x3f')]));_0x1f03c0[_0x16fd('0x3e')]=_0x1f03c0['attributes']['length']?_0x1f03c0['attributes']:_0x3c40a1[_0x16fd('0x3a')];if(!_0x52cdd0[_0x16fd('0x3c')]['hasOwnProperty']('nolimit')){_0x1f03c0[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0x52cdd0['query'][_0x16fd('0x26')]);_0x1f03c0[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0x52cdd0[_0x16fd('0x3c')][_0x16fd('0x24')]);}_0x1f03c0[_0x16fd('0x5a')]=qs['sort'](_0x52cdd0[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x1f03c0[_0x16fd('0x44')]=qs[_0x16fd('0x42')](_['pick'](_0x52cdd0[_0x16fd('0x3c')],_0x3c40a1['filters']));_0x1f03c0[_0x16fd('0x44')][_0x16fd('0x5b')]=_0x3d1ef8['id'];if(_0x52cdd0[_0x16fd('0x3c')][_0x16fd('0x46')]){_0x1f03c0[_0x16fd('0x44')]=_[_0x16fd('0x5c')](_0x1f03c0[_0x16fd('0x44')],{'$or':_[_0x16fd('0x3b')](_0x1f03c0[_0x16fd('0x3e')],function(_0x1863fb){var _0x28a446={};_0x28a446[_0x1863fb]={'$like':'%'+_0x52cdd0[_0x16fd('0x3c')]['filter']+'%'};return _0x28a446;})});}_0x1f03c0=_[_0x16fd('0x5c')]({},_0x1f03c0,_0x52cdd0[_0x16fd('0x47')]);return db[_0x16fd('0x59')][_0x16fd('0x49')](_0x1f03c0);}})[_0x16fd('0x2e')](function(_0x46667b){if(_0x46667b){return db[_0x16fd('0x5d')]['findAndCountAll']({'where':{'id':_[_0x16fd('0x3b')](_0x46667b,'UserId'),'role':_0x16fd('0x5e')},'attributes':['id',_0x16fd('0x34'),_0x16fd('0x5f'),_0x16fd('0x60'),_0x16fd('0x61')]});}})[_0x16fd('0x2e')](function(_0x193ad2){if(_0x193ad2){return{'count':_0x193ad2[_0x16fd('0x27')],'rows':_[_0x16fd('0x3b')](_0x193ad2[_0x16fd('0x4a')],function(_0x91e87){return{'membername':_0x91e87[_0x16fd('0x34')],'UserId':_0x91e87['id'],'queue_name':_0x42c722[_0x16fd('0x34')],'SmsQueueId':_0x42c722['id'],'interface':util[_0x16fd('0x62')](_0x16fd('0x63'),_0x16fd('0x64'),_0x91e87[_0x16fd('0x34')]),'penalty':0x0,'paused':_0x91e87[_0x16fd('0x5f')],'createdAt':_0x91e87['createdAt'],'updatedAt':_0x91e87[_0x16fd('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x16fd('0x2e')](respondWithFilteredResult(_0x16e936,_0x1f03c0))[_0x16fd('0x4e')](handleError(_0x16e936,null));};exports['getTeams']=function(_0x47a8a5,_0x5d07cd,_0x53a4ce){var _0x13e960={};var _0x24c3a8={};var _0x25887e;var _0x44a08c;return db[_0x16fd('0x36')][_0x16fd('0x58')]({'where':{'id':_0x47a8a5['params']['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x5d07cd,null))[_0x16fd('0x2e')](function(_0x1c7710){if(_0x1c7710){_0x25887e=_0x1c7710;_0x24c3a8['model']=_[_0x16fd('0x3d')](db[_0x16fd('0x65')]['rawAttributes']);_0x24c3a8[_0x16fd('0x3c')]=_[_0x16fd('0x3d')](_0x47a8a5[_0x16fd('0x3c')]);_0x24c3a8[_0x16fd('0x42')]=_['intersection'](_0x24c3a8[_0x16fd('0x3a')],_0x24c3a8['query']);_0x13e960[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x24c3a8[_0x16fd('0x3a')],qs['fields'](_0x47a8a5[_0x16fd('0x3c')]['fields']));_0x13e960['attributes']=_0x13e960[_0x16fd('0x3e')]['length']?_0x13e960[_0x16fd('0x3e')]:_0x24c3a8[_0x16fd('0x3a')];_0x13e960['order']=qs['sort'](_0x47a8a5[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x13e960[_0x16fd('0x44')]=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0x47a8a5['query'],_0x24c3a8['filters']));if(_0x47a8a5[_0x16fd('0x3c')]['filter']){_0x13e960['where']=_[_0x16fd('0x5c')](_0x13e960[_0x16fd('0x44')],{'$or':_[_0x16fd('0x3b')](_0x13e960[_0x16fd('0x3e')],function(_0x32db48){var _0xa24c3f={};_0xa24c3f[_0x32db48]={'$like':'%'+_0x47a8a5[_0x16fd('0x3c')][_0x16fd('0x46')]+'%'};return _0xa24c3f;})});}_0x13e960=_[_0x16fd('0x5c')]({},_0x13e960,_0x47a8a5[_0x16fd('0x47')]);return _0x25887e[_0x16fd('0x66')](_0x13e960);}})[_0x16fd('0x2e')](function(_0x1c4f37){if(_0x1c4f37){_0x44a08c=_0x1c4f37[_0x16fd('0x67')];if(!_0x47a8a5[_0x16fd('0x3c')][_0x16fd('0x68')](_0x16fd('0x40'))){_0x13e960['limit']=qs[_0x16fd('0x26')](_0x47a8a5[_0x16fd('0x3c')][_0x16fd('0x26')]);_0x13e960[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0x47a8a5[_0x16fd('0x3c')][_0x16fd('0x24')]);}return _0x25887e['getTeams'](_0x13e960);}})['then'](function(_0x1b280b){if(_0x1b280b){return _0x1b280b?{'count':_0x44a08c,'rows':_0x1b280b}:null;}})[_0x16fd('0x2e')](respondWithResult(_0x5d07cd,null))['catch'](handleError(_0x5d07cd,null));};exports[_0x16fd('0x69')]=function(_0x250a27,_0x8f8789,_0x1be739){var _0x531c43=_0x250a27[_0x16fd('0x50')][_0x16fd('0x6a')];return db[_0x16fd('0x65')][_0x16fd('0x49')]({'where':{'id':_0x531c43},'attributes':['id'],'include':[{'model':db[_0x16fd('0x5d')],'as':'Agents','attributes':['id','name','online',_0x16fd('0x6b'),_0x16fd('0x6c')],'raw':!![]}]})[_0x16fd('0x2e')](function(_0xa0271e){if(_0xa0271e){var _0x4438a5=_[_0x16fd('0x6d')](_0xa0271e,function(_0x451432){var _0x2ec6b8=_0x451432[_0x16fd('0x2f')]({'plain':!![]});return _0x2ec6b8['Agents'];});return db[_0x16fd('0x36')]['find']({'where':{'id':_0x250a27[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](function(_0x2260fc){return db[_0x16fd('0x6e')]['transaction'](function(_0x3b1a09){return _0x2260fc[_0x16fd('0x69')](_0x531c43,{'transaction':_0x3b1a09})[_0x16fd('0x2e')](function(){return BPromise[_0x16fd('0x6f')](_0x4438a5,function(_0x1e0083){return db[_0x16fd('0x59')][_0x16fd('0x70')]({'where':{'UserId':_0x1e0083['id'],'SmsQueueId':_0x250a27[_0x16fd('0x55')]['id']},'transaction':_0x3b1a09});});})['then'](function(){_0x4438a5['forEach'](function(_0x5e1160){socket[_0x16fd('0x71')](_0x16fd('0x72'),{'UserId':_0x5e1160['id'],'SmsQueueId':_0x2260fc['id']});});});});});}})[_0x16fd('0x2e')](respondWithStatusCode(_0x8f8789,null))['catch'](handleError(_0x8f8789,null));};exports[_0x16fd('0x73')]=function(_0x3a9f90,_0x265d1e,_0x1abafc){return db['Team'][_0x16fd('0x49')]({'where':{'id':_0x3a9f90[_0x16fd('0x3c')][_0x16fd('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x16fd('0x2e')](handleEntityNotFound(_0x265d1e,null))[_0x16fd('0x2e')](function(_0x4c2da2){var _0x33cd4b=_['map'](_0x4c2da2,'id');var _0x4dcb93=[];var _0x4b623e=[];var _0x208f49=squel[_0x16fd('0x74')]();_0x208f49[_0x16fd('0x75')]('tq.TeamId')[_0x16fd('0x76')](_0x16fd('0x77'),'tq')[_0x16fd('0x78')](_0x16fd('0x79'),'ut',_0x16fd('0x7a'))['where'](_0x16fd('0x7b'),_0x3a9f90[_0x16fd('0x55')]['id']);for(var _0xa58dc8=0x0;_0xa58dc8<_0x4c2da2['length'];_0xa58dc8+=0x1){let _0x1705be=_0x4c2da2[_0xa58dc8];for(var _0x40989f=0x0;_0x40989f<_0x1705be['Agents'][_0x16fd('0x67')];_0x40989f+=0x1){let _0x250509=_0x1705be[_0x16fd('0x7c')][_0x40989f];var _0x4cdc07=_0x208f49[_0x16fd('0x7d')]();_0x4cdc07[_0x16fd('0x44')](_0x16fd('0x7e'),_0x250509['id']);_0x4b623e['push'](db['sequelize']['query'](_0x4cdc07['toString'](),{'type':db[_0x16fd('0x6e')][_0x16fd('0x7f')][_0x16fd('0x80')]})[_0x16fd('0x2e')](function(_0x52bc04){if(_0x52bc04[_0x16fd('0x67')]===0x1){return _0x250509['id'];}else{var _0x3602c3=_[_0x16fd('0x81')](_['map'](_0x52bc04,'TeamId'),function(_0x5938ea){return _['includes'](_0x33cd4b,_0x5938ea);});if(_0x3602c3){return _0x250509['id'];}}}));}}return BPromise[_0x16fd('0x82')](_0x4b623e)[_0x16fd('0x2e')](function(_0x3f99c0){_0x4dcb93=_(_0x4dcb93)[_0x16fd('0x83')](_0x3f99c0)[_0x16fd('0x84')]()[_0x16fd('0x85')]();return db['SmsQueue'][_0x16fd('0x4d')]({'where':{'id':_0x3a9f90[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](function(_0x52caef){return db[_0x16fd('0x6e')]['transaction'](function(_0x4067d8){return _0x52caef['removeTeams'](_0x3a9f90[_0x16fd('0x3c')][_0x16fd('0x6a')],{'transaction':_0x4067d8})[_0x16fd('0x2e')](function(){if(!_[_0x16fd('0x86')](_0x4dcb93)){return _0x52caef['removeAgents'](_0x4dcb93,{'transaction':_0x4067d8});}})[_0x16fd('0x2e')](function(){_0x4dcb93[_0x16fd('0x87')](function(_0x333244){socket[_0x16fd('0x71')](_0x16fd('0x88'),{'UserId':_0x333244,'SmsQueueId':_0x52caef['id']});});});});});});})['then'](respondWithStatusCode(_0x265d1e,null))['catch'](handleError(_0x265d1e,null));};exports[_0x16fd('0x89')]=function(_0x48fa3e,_0x5709a0,_0x9f643a){return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x48fa3e[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x5709a0,null))[_0x16fd('0x2e')](function(_0x250d3e){if(_0x250d3e){return _0x250d3e[_0x16fd('0x89')](_0x48fa3e[_0x16fd('0x50')][_0x16fd('0x6a')],_[_0x16fd('0x8a')](_0x48fa3e[_0x16fd('0x50')],['ids','id'])||{})[_0x16fd('0x8b')](function(_0x51bd17){for(var _0x1ab985=0x0;_0x1ab985<_0x48fa3e[_0x16fd('0x50')][_0x16fd('0x6a')]['length'];_0x1ab985+=0x1){socket[_0x16fd('0x71')](_0x16fd('0x72'),{'UserId':Number(_0x48fa3e['body'][_0x16fd('0x6a')][_0x1ab985]),'SmsQueueId':Number(_0x48fa3e['params']['id'])});}return _0x51bd17;});}})['then'](respondWithResult(_0x5709a0,null))[_0x16fd('0x4e')](handleError(_0x5709a0,null));};exports['removeAgents']=function(_0x3eb849,_0x59c2db,_0x2dc4f3){return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x3eb849[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x59c2db,null))[_0x16fd('0x2e')](function(_0x38ec81){if(_0x38ec81){return _0x38ec81['removeAgents'](_0x3eb849['query'][_0x16fd('0x6a')])[_0x16fd('0x2e')](function(){if(_[_0x16fd('0x8c')](_0x3eb849[_0x16fd('0x3c')][_0x16fd('0x6a')])){for(var _0x4728df=0x0;_0x4728df<_0x3eb849[_0x16fd('0x3c')]['ids'][_0x16fd('0x67')];_0x4728df+=0x1){socket['emit'](_0x16fd('0x88'),{'UserId':Number(_0x3eb849[_0x16fd('0x3c')][_0x16fd('0x6a')][_0x4728df]),'SmsQueueId':Number(_0x3eb849[_0x16fd('0x55')]['id'])});}}else{socket[_0x16fd('0x71')](_0x16fd('0x88'),{'UserId':Number(_0x3eb849[_0x16fd('0x3c')][_0x16fd('0x6a')]),'SmsQueueId':Number(_0x3eb849['params']['id'])});}});}})['then'](respondWithStatusCode(_0x59c2db,null))['catch'](handleError(_0x59c2db,null));};exports[_0x16fd('0x8d')]=function(_0x1549ee,_0x11da8a,_0x3e5056){var _0x21cb67={};var _0x5ac39={};var _0x200a76;var _0x5aaec8;return db[_0x16fd('0x36')][_0x16fd('0x58')]({'where':{'id':_0x1549ee[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x11da8a,null))['then'](function(_0x4c037a){if(_0x4c037a){_0x200a76=_0x4c037a;_0x5ac39[_0x16fd('0x3a')]=_[_0x16fd('0x3d')](db[_0x16fd('0x5d')][_0x16fd('0x37')]);_0x5ac39[_0x16fd('0x3c')]=_[_0x16fd('0x3d')](_0x1549ee[_0x16fd('0x3c')]);_0x5ac39[_0x16fd('0x42')]=_[_0x16fd('0x4b')](_0x5ac39[_0x16fd('0x3a')],_0x5ac39['query']);_0x21cb67[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x5ac39[_0x16fd('0x3a')],qs['fields'](_0x1549ee[_0x16fd('0x3c')]['fields']));_0x21cb67[_0x16fd('0x3e')]=_0x21cb67['attributes'][_0x16fd('0x67')]?_0x21cb67['attributes']:_0x5ac39['model'];_0x21cb67[_0x16fd('0x5a')]=qs[_0x16fd('0x41')](_0x1549ee[_0x16fd('0x3c')]['sort']);_0x21cb67[_0x16fd('0x44')]=qs['filters'](_[_0x16fd('0x43')](_0x1549ee[_0x16fd('0x3c')],_0x5ac39[_0x16fd('0x42')]));if(_0x1549ee['query'][_0x16fd('0x46')]){_0x21cb67[_0x16fd('0x44')]=_[_0x16fd('0x5c')](_0x21cb67[_0x16fd('0x44')],{'$or':_[_0x16fd('0x3b')](_0x21cb67[_0x16fd('0x3e')],function(_0x3103c2){var _0x5b3a67={};_0x5b3a67[_0x3103c2]={'$like':'%'+_0x1549ee[_0x16fd('0x3c')][_0x16fd('0x46')]+'%'};return _0x5b3a67;})});}_0x21cb67=_[_0x16fd('0x5c')]({},_0x21cb67,_0x1549ee[_0x16fd('0x47')]);return _0x200a76[_0x16fd('0x8d')](_0x21cb67);}})[_0x16fd('0x2e')](function(_0x845332){if(_0x845332){_0x5aaec8=_0x845332[_0x16fd('0x67')];if(!_0x1549ee[_0x16fd('0x3c')][_0x16fd('0x68')]('nolimit')){_0x21cb67[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0x1549ee['query'][_0x16fd('0x26')]);_0x21cb67[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0x1549ee['query'][_0x16fd('0x24')]);}return _0x200a76[_0x16fd('0x8d')](_0x21cb67);}})['then'](function(_0x45c9db){if(_0x45c9db){return _0x45c9db?{'count':_0x5aaec8,'rows':_0x45c9db}:null;}})['then'](respondWithResult(_0x11da8a,null))['catch'](handleError(_0x11da8a,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c4bfaa6..4c031c3 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 _0xc72e=['SmsQueue','setMaxListeners','save','update','emit','exports','../../mysqldb'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc72e,0x1c6));var _0xec72=function(_0x2d51d6,_0x4f3ff8){_0x2d51d6=_0x2d51d6-0x0;var _0x52e24c=_0xc72e[_0x2d51d6];return _0x52e24c;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xec72('0x0'))['db'][_0xec72('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xec72('0x2')](0x0);var events={'afterCreate':_0xec72('0x3'),'afterUpdate':_0xec72('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ed589){return function(_0x5eae18,_0x5d4044,_0x2dd5dd){SmsQueueEvents[_0xec72('0x5')](_0x3ed589+':'+_0x5eae18['id'],_0x5eae18);SmsQueueEvents[_0xec72('0x5')](_0x3ed589,_0x5eae18);_0x2dd5dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xec72('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0xe462=['save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3f3ad8,_0x4bc014){var _0x3a2667=function(_0x4fe7e0){while(--_0x4fe7e0){_0x3f3ad8['push'](_0x3f3ad8['shift']());}};_0x3a2667(++_0x4bc014);}(_0xe462,0x126));var _0x2e46=function(_0x2e8802,_0x59ad8c){_0x2e8802=_0x2e8802-0x0;var _0x4617aa=_0xe462[_0x2e8802];return _0x4617aa;};'use strict';var EventEmitter=require(_0x2e46('0x0'));var SmsQueue=require(_0x2e46('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e46('0x2'),'afterUpdate':_0x2e46('0x3'),'afterDestroy':_0x2e46('0x4')};function emitEvent(_0x38be7e){return function(_0x36a901,_0x424a14,_0x3b3cb6){SmsQueueEvents[_0x2e46('0x5')](_0x38be7e+':'+_0x36a901['id'],_0x36a901);SmsQueueEvents[_0x2e46('0x5')](_0x38be7e,_0x36a901);_0x3b3cb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2e46('0x6')](e,emitEvent(event));}}module[_0x2e46('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 4a860f0..4139fc6 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 _0x237c=['SmsQueue','api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports'];(function(_0xfd9989,_0x14a1dd){var _0x159b58=function(_0x30f921){while(--_0x30f921){_0xfd9989['push'](_0xfd9989['shift']());}};_0x159b58(++_0x14a1dd);}(_0x237c,0x151));var _0xc237=function(_0x58dbef,_0x544d36){_0x58dbef=_0x58dbef-0x0;var _0x4f704d=_0x237c[_0x58dbef];return _0x4f704d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc237('0x0'));var moment=require('moment');var BPromise=require(_0xc237('0x1'));var rp=require(_0xc237('0x2'));var fs=require('fs');var path=require(_0xc237('0x3'));var rimraf=require(_0xc237('0x4'));var config=require('../../config/environment');var attributes=require(_0xc237('0x5'));module[_0xc237('0x6')]=function(_0x55808d,_0x585dc0){return _0x55808d['define'](_0xc237('0x7'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2217=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','sms_queues'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x2217,0x1d6));var _0x7221=function(_0x5f4557,_0x2a44a7){_0x5f4557=_0x5f4557-0x0;var _0x2a2a05=_0x2217[_0x5f4557];return _0x2a2a05;};'use strict';var _=require(_0x7221('0x0'));var util=require('util');var logger=require(_0x7221('0x1'))(_0x7221('0x2'));var moment=require(_0x7221('0x3'));var BPromise=require(_0x7221('0x4'));var rp=require(_0x7221('0x5'));var fs=require('fs');var path=require(_0x7221('0x6'));var rimraf=require(_0x7221('0x7'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x7221('0x8')]=function(_0x300e0f,_0x150ae2){return _0x300e0f['define']('SmsQueue',attributes,{'tableName':_0x7221('0x9'),'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 3d678fe..165e83a 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 _0x1a81=['where','debug','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','SmsQueue','findAll','options','attributes','map','include','model','GetSmsQueue','ShowSmsQueue','raw'];(function(_0x2bd589,_0x29eab4){var _0x476382=function(_0x1d226b){while(--_0x1d226b){_0x2bd589['push'](_0x2bd589['shift']());}};_0x476382(++_0x29eab4);}(_0x1a81,0x1e3));var _0x11a8=function(_0x31488b,_0x340a56){_0x31488b=_0x31488b-0x0;var _0xb14149=_0x1a81[_0x31488b];return _0xb14149;};'use strict';var _=require('lodash');var util=require(_0x11a8('0x0'));var moment=require('moment');var BPromise=require(_0x11a8('0x1'));var rs=require(_0x11a8('0x2'));var fs=require('fs');var Redis=require(_0x11a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x11a8('0x4'));var logger=require('../../config/logger')(_0x11a8('0x5'));var config=require(_0x11a8('0x6'));var jayson=require(_0x11a8('0x7'));var client=jayson[_0x11a8('0x8')]['http']({'port':0x232a});config[_0x11a8('0x9')]=_[_0x11a8('0xa')](config['redis'],{'host':_0x11a8('0xb'),'port':0x18eb});var socket=require(_0x11a8('0xc'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x11a8('0xd')](socket);function respondWithRpcPromise(_0x4bf7d4,_0x7438f2,_0x10b5a0){return new BPromise(function(_0x140631,_0x111597){return client['request'](_0x4bf7d4,_0x10b5a0)[_0x11a8('0xe')](function(_0x18c879){logger[_0x11a8('0xf')]('SmsQueue,\x20%s,\x20%s',_0x7438f2,_0x11a8('0x10'));logger['debug'](_0x11a8('0x11'),_0x7438f2,_0x11a8('0x10'),JSON[_0x11a8('0x12')](_0x18c879));if(_0x18c879[_0x11a8('0x13')]){if(_0x18c879['error'][_0x11a8('0x14')]===0x1f4){logger[_0x11a8('0x13')](_0x11a8('0x15'),_0x7438f2,_0x18c879[_0x11a8('0x13')][_0x11a8('0x16')]);return _0x111597(_0x18c879['error'][_0x11a8('0x16')]);}logger[_0x11a8('0x13')](_0x11a8('0x15'),_0x7438f2,_0x18c879[_0x11a8('0x13')]['message']);return _0x140631(_0x18c879[_0x11a8('0x13')][_0x11a8('0x16')]);}else{logger[_0x11a8('0xf')](_0x11a8('0x15'),_0x7438f2,_0x11a8('0x10'));_0x140631(_0x18c879[_0x11a8('0x17')][_0x11a8('0x16')]);}})[_0x11a8('0x18')](function(_0x4b1229){logger[_0x11a8('0x13')]('SmsQueue,\x20%s,\x20%s',_0x7438f2,_0x4b1229);_0x111597(_0x4b1229);});});}exports['GetSmsQueue']=function(_0x16f43e){var _0x5de0bd=this;return new Promise(function(_0x177e71,_0x7eead){return db[_0x11a8('0x19')][_0x11a8('0x1a')]({'raw':_0x16f43e[_0x11a8('0x1b')]?_0x16f43e['options']['raw']===undefined?!![]:![]:!![],'where':_0x16f43e['options']?_0x16f43e[_0x11a8('0x1b')]['where']||null:null,'attributes':_0x16f43e['options']?_0x16f43e[_0x11a8('0x1b')][_0x11a8('0x1c')]||null:null,'limit':_0x16f43e['options']?_0x16f43e[_0x11a8('0x1b')]['limit']||null:null,'include':_0x16f43e[_0x11a8('0x1b')]?_0x16f43e['options']['include']?_[_0x11a8('0x1d')](_0x16f43e['options'][_0x11a8('0x1e')],function(_0x397810){return{'model':db[_0x397810[_0x11a8('0x1f')]],'as':_0x397810['as'],'attributes':_0x397810[_0x11a8('0x1c')],'include':_0x397810[_0x11a8('0x1e')]?_[_0x11a8('0x1d')](_0x397810[_0x11a8('0x1e')],function(_0x538772){return{'model':db[_0x538772[_0x11a8('0x1f')]],'as':_0x538772['as'],'attributes':_0x538772[_0x11a8('0x1c')],'include':_0x538772[_0x11a8('0x1e')]?_['map'](_0x538772['include'],function(_0xb67b16){return{'model':db[_0xb67b16[_0x11a8('0x1f')]],'as':_0xb67b16['as'],'attributes':_0xb67b16['attributes']};}):[]};}):[]};}):[]:[]})[_0x11a8('0xe')](function(_0x230ab8){logger[_0x11a8('0xf')]('GetSmsQueue',_0x16f43e);logger['debug'](_0x11a8('0x20'),_0x16f43e,JSON[_0x11a8('0x12')](_0x230ab8));_0x177e71(_0x230ab8);})[_0x11a8('0x18')](function(_0x1b965f){logger[_0x11a8('0x13')](_0x11a8('0x20'),_0x1b965f['message'],_0x16f43e);_0x7eead(_0x5de0bd['error'](0x1f4,_0x1b965f[_0x11a8('0x16')]));});});};exports[_0x11a8('0x21')]=function(_0x4c8a2c){var _0x2af7dc=this;return new Promise(function(_0x226389,_0x210bb4){return db[_0x11a8('0x19')]['find']({'raw':_0x4c8a2c[_0x11a8('0x1b')]?_0x4c8a2c[_0x11a8('0x1b')][_0x11a8('0x22')]===undefined?!![]:![]:!![],'where':_0x4c8a2c['options']?_0x4c8a2c['options'][_0x11a8('0x23')]||null:null,'attributes':_0x4c8a2c[_0x11a8('0x1b')]?_0x4c8a2c['options']['attributes']||null:null,'include':_0x4c8a2c[_0x11a8('0x1b')]?_0x4c8a2c[_0x11a8('0x1b')][_0x11a8('0x1e')]?_['map'](_0x4c8a2c['options'][_0x11a8('0x1e')],function(_0x289735){return{'model':db[_0x289735[_0x11a8('0x1f')]],'as':_0x289735['as'],'attributes':_0x289735[_0x11a8('0x1c')],'include':_0x289735[_0x11a8('0x1e')]?_[_0x11a8('0x1d')](_0x289735['include'],function(_0x1946a6){return{'model':db[_0x1946a6[_0x11a8('0x1f')]],'as':_0x1946a6['as'],'attributes':_0x1946a6[_0x11a8('0x1c')],'include':_0x1946a6['include']?_[_0x11a8('0x1d')](_0x1946a6['include'],function(_0x5d75c1){return{'model':db[_0x5d75c1[_0x11a8('0x1f')]],'as':_0x5d75c1['as'],'attributes':_0x5d75c1[_0x11a8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x258aa5){logger[_0x11a8('0xf')]('ShowSmsQueue',_0x4c8a2c);logger[_0x11a8('0x24')](_0x11a8('0x21'),_0x4c8a2c,JSON[_0x11a8('0x12')](_0x258aa5));_0x226389(_0x258aa5);})[_0x11a8('0x18')](function(_0x5d2556){logger[_0x11a8('0x13')](_0x11a8('0x21'),_0x5d2556[_0x11a8('0x16')],_0x4c8a2c);_0x210bb4(_0x2af7dc[_0x11a8('0x13')](0x1f4,_0x5d2556[_0x11a8('0x16')]));});});}; \ No newline at end of file +var _0x9fcf=['model','catch','ShowSmsQueue','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0x9fcf,0x19b));var _0xf9fc=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x9fcf[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xf9fc('0x0'));var util=require(_0xf9fc('0x1'));var moment=require('moment');var BPromise=require(_0xf9fc('0x2'));var rs=require(_0xf9fc('0x3'));var fs=require('fs');var Redis=require(_0xf9fc('0x4'));var db=require(_0xf9fc('0x5'))['db'];var utils=require(_0xf9fc('0x6'));var logger=require(_0xf9fc('0x7'))(_0xf9fc('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9fc('0x9'));var client=jayson[_0xf9fc('0xa')][_0xf9fc('0xb')]({'port':0x232a});config[_0xf9fc('0xc')]=_['defaults'](config['redis'],{'host':_0xf9fc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9fc('0xc')]));require('./smsQueue.socket')[_0xf9fc('0xe')](socket);function respondWithRpcPromise(_0x458339,_0x430590,_0x3b97df){return new BPromise(function(_0x1c61c9,_0x2644e8){return client['request'](_0x458339,_0x3b97df)['then'](function(_0x17baf5){logger[_0xf9fc('0xf')]('SmsQueue,\x20%s,\x20%s',_0x430590,_0xf9fc('0x10'));logger[_0xf9fc('0x11')](_0xf9fc('0x12'),_0x430590,'request\x20sent',JSON['stringify'](_0x17baf5));if(_0x17baf5[_0xf9fc('0x13')]){if(_0x17baf5['error'][_0xf9fc('0x14')]===0x1f4){logger[_0xf9fc('0x13')](_0xf9fc('0x15'),_0x430590,_0x17baf5['error'][_0xf9fc('0x16')]);return _0x2644e8(_0x17baf5[_0xf9fc('0x13')][_0xf9fc('0x16')]);}logger[_0xf9fc('0x13')](_0xf9fc('0x15'),_0x430590,_0x17baf5[_0xf9fc('0x13')][_0xf9fc('0x16')]);return _0x1c61c9(_0x17baf5[_0xf9fc('0x13')]['message']);}else{logger[_0xf9fc('0xf')]('SmsQueue,\x20%s,\x20%s',_0x430590,_0xf9fc('0x10'));_0x1c61c9(_0x17baf5[_0xf9fc('0x17')][_0xf9fc('0x16')]);}})['catch'](function(_0x4ef70b){logger[_0xf9fc('0x13')]('SmsQueue,\x20%s,\x20%s',_0x430590,_0x4ef70b);_0x2644e8(_0x4ef70b);});});}exports[_0xf9fc('0x18')]=function(_0x5f47cb){var _0x20ab13=this;return new Promise(function(_0x5e1f69,_0x3fb628){return db['SmsQueue'][_0xf9fc('0x19')]({'raw':_0x5f47cb[_0xf9fc('0x1a')]?_0x5f47cb[_0xf9fc('0x1a')][_0xf9fc('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f47cb[_0xf9fc('0x1a')]?_0x5f47cb[_0xf9fc('0x1a')][_0xf9fc('0x1c')]||null:null,'attributes':_0x5f47cb['options']?_0x5f47cb[_0xf9fc('0x1a')][_0xf9fc('0x1d')]||null:null,'limit':_0x5f47cb[_0xf9fc('0x1a')]?_0x5f47cb[_0xf9fc('0x1a')][_0xf9fc('0x1e')]||null:null,'include':_0x5f47cb[_0xf9fc('0x1a')]?_0x5f47cb[_0xf9fc('0x1a')][_0xf9fc('0x1f')]?_[_0xf9fc('0x20')](_0x5f47cb[_0xf9fc('0x1a')][_0xf9fc('0x1f')],function(_0x9e01){return{'model':db[_0x9e01['model']],'as':_0x9e01['as'],'attributes':_0x9e01[_0xf9fc('0x1d')],'include':_0x9e01[_0xf9fc('0x1f')]?_[_0xf9fc('0x20')](_0x9e01[_0xf9fc('0x1f')],function(_0x1be35a){return{'model':db[_0x1be35a[_0xf9fc('0x21')]],'as':_0x1be35a['as'],'attributes':_0x1be35a[_0xf9fc('0x1d')],'include':_0x1be35a[_0xf9fc('0x1f')]?_['map'](_0x1be35a[_0xf9fc('0x1f')],function(_0xfe8839){return{'model':db[_0xfe8839['model']],'as':_0xfe8839['as'],'attributes':_0xfe8839[_0xf9fc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x432a12){logger[_0xf9fc('0xf')](_0xf9fc('0x18'),_0x5f47cb);logger[_0xf9fc('0x11')](_0xf9fc('0x18'),_0x5f47cb,JSON['stringify'](_0x432a12));_0x5e1f69(_0x432a12);})[_0xf9fc('0x22')](function(_0x20b584){logger['error'](_0xf9fc('0x18'),_0x20b584[_0xf9fc('0x16')],_0x5f47cb);_0x3fb628(_0x20ab13[_0xf9fc('0x13')](0x1f4,_0x20b584[_0xf9fc('0x16')]));});});};exports[_0xf9fc('0x23')]=function(_0x3cbfb7){var _0x3dc95e=this;return new Promise(function(_0x43455b,_0x18f3ea){return db['SmsQueue']['find']({'raw':_0x3cbfb7[_0xf9fc('0x1a')]?_0x3cbfb7[_0xf9fc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3cbfb7[_0xf9fc('0x1a')]?_0x3cbfb7[_0xf9fc('0x1a')][_0xf9fc('0x1c')]||null:null,'attributes':_0x3cbfb7[_0xf9fc('0x1a')]?_0x3cbfb7['options'][_0xf9fc('0x1d')]||null:null,'include':_0x3cbfb7[_0xf9fc('0x1a')]?_0x3cbfb7['options'][_0xf9fc('0x1f')]?_[_0xf9fc('0x20')](_0x3cbfb7['options']['include'],function(_0x296cfa){return{'model':db[_0x296cfa['model']],'as':_0x296cfa['as'],'attributes':_0x296cfa['attributes'],'include':_0x296cfa['include']?_['map'](_0x296cfa[_0xf9fc('0x1f')],function(_0x5eef30){return{'model':db[_0x5eef30['model']],'as':_0x5eef30['as'],'attributes':_0x5eef30[_0xf9fc('0x1d')],'include':_0x5eef30['include']?_['map'](_0x5eef30[_0xf9fc('0x1f')],function(_0x567e8c){return{'model':db[_0x567e8c[_0xf9fc('0x21')]],'as':_0x567e8c['as'],'attributes':_0x567e8c[_0xf9fc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dbaaf){logger[_0xf9fc('0xf')](_0xf9fc('0x23'),_0x3cbfb7);logger[_0xf9fc('0x11')]('ShowSmsQueue',_0x3cbfb7,JSON[_0xf9fc('0x24')](_0x4dbaaf));_0x43455b(_0x4dbaaf);})[_0xf9fc('0x22')](function(_0x5631a9){logger[_0xf9fc('0x13')](_0xf9fc('0x23'),_0x5631a9['message'],_0x3cbfb7);_0x18f3ea(_0x3dc95e[_0xf9fc('0x13')](0x1f4,_0x5631a9[_0xf9fc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5a76a35..28a861d 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 _0xf7a8=['smsQueue:','save','remove','emit','register','length'];(function(_0xecd857,_0xe8475c){var _0x48c002=function(_0x4c6f6b){while(--_0x4c6f6b){_0xecd857['push'](_0xecd857['shift']());}};_0x48c002(++_0xe8475c);}(_0xf7a8,0x1e7));var _0x8f7a=function(_0x46698b,_0x17368a){_0x46698b=_0x46698b-0x0;var _0x500334=_0xf7a8[_0x46698b];return _0x500334;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x8f7a('0x0'),_0x8f7a('0x1'),'update'];function createListener(_0x3394c7,_0x5b1f78){return function(_0x253504){_0x5b1f78[_0x8f7a('0x2')](_0x3394c7,_0x253504);};}function removeListener(_0x21f61c,_0x42bf6a){return function(){SmsQueueEvents['removeListener'](_0x21f61c,_0x42bf6a);};}exports[_0x8f7a('0x3')]=function(_0x1fafcd){for(var _0x187cc3=0x0,_0x3ade3c=events[_0x8f7a('0x4')];_0x187cc3<_0x3ade3c;_0x187cc3++){var _0x5b04b5=events[_0x187cc3];var _0x1859ee=createListener(_0x8f7a('0x5')+_0x5b04b5,_0x1fafcd);SmsQueueEvents['on'](_0x5b04b5,_0x1859ee);}}; \ No newline at end of file +var _0x228a=['remove','emit','removeListener','length','smsQueue:','./smsQueue.events','save'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x228a,0x1b0));var _0xa228=function(_0x2d240e,_0xee105){_0x2d240e=_0x2d240e-0x0;var _0x5aba4e=_0x228a[_0x2d240e];return _0x5aba4e;};'use strict';var SmsQueueEvents=require(_0xa228('0x0'));var events=[_0xa228('0x1'),_0xa228('0x2'),'update'];function createListener(_0x38480e,_0xaad44){return function(_0x391732){_0xaad44[_0xa228('0x3')](_0x38480e,_0x391732);};}function removeListener(_0x1fb2dc,_0x3adcc2){return function(){SmsQueueEvents[_0xa228('0x4')](_0x1fb2dc,_0x3adcc2);};}exports['register']=function(_0x67d12a){for(var _0x2a669a=0x0,_0x38b819=events[_0xa228('0x5')];_0x2a669a<_0x38b819;_0x2a669a++){var _0x13c715=events[_0x2a669a];var _0x1c3a3c=createListener(_0xa228('0x6')+_0x13c715,_0x67d12a);SmsQueueEvents['on'](_0x13c715,_0x1c3a3c);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 86c8134..d5e5b53 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 _0xa108=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x32f78b,_0x4d91be){var _0x3e1bd7=function(_0x463c15){while(--_0x463c15){_0x32f78b['push'](_0x32f78b['shift']());}};_0x3e1bd7(++_0x4d91be);}(_0xa108,0x130));var _0x8a10=function(_0x2e6ae0,_0x2237f8){_0x2e6ae0=_0x2e6ae0-0x0;var _0x1af0e6=_0xa108[_0x2e6ae0];return _0x1af0e6;};'use strict';var multer=require(_0x8a10('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a10('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a10('0x2'));var auth=require(_0x8a10('0x3'));var interaction=require(_0x8a10('0x4'));var config=require(_0x8a10('0x5'));var controller=require('./smsQueueReport.controller');router[_0x8a10('0x6')]('/',auth[_0x8a10('0x7')](),controller['index']);router['get']('/describe',auth[_0x8a10('0x7')](),controller[_0x8a10('0x8')]);router[_0x8a10('0x6')](_0x8a10('0x9'),auth['isAuthenticated'](),controller[_0x8a10('0xa')]);router[_0x8a10('0xb')]('/',auth[_0x8a10('0x7')](),controller['create']);router[_0x8a10('0xc')]('/:id',auth[_0x8a10('0x7')](),controller[_0x8a10('0xd')]);router[_0x8a10('0xe')](_0x8a10('0x9'),auth[_0x8a10('0x7')](),controller[_0x8a10('0xf')]);module[_0x8a10('0x10')]=router; \ No newline at end of file +var _0xd837=['fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','util','connect-timeout','express'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd837,0x1a1));var _0x7d83=function(_0x32a767,_0x4e3e76){_0x32a767=_0x32a767-0x0;var _0x2b4e6d=_0xd837[_0x32a767];return _0x2b4e6d;};'use strict';var multer=require('multer');var util=require(_0x7d83('0x0'));var path=require('path');var timeout=require(_0x7d83('0x1'));var express=require(_0x7d83('0x2'));var router=express['Router']();var fs_extra=require(_0x7d83('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7d83('0x4'));var config=require(_0x7d83('0x5'));var controller=require(_0x7d83('0x6'));router[_0x7d83('0x7')]('/',auth[_0x7d83('0x8')](),controller[_0x7d83('0x9')]);router[_0x7d83('0x7')](_0x7d83('0xa'),auth[_0x7d83('0x8')](),controller[_0x7d83('0xb')]);router['get']('/:id',auth[_0x7d83('0x8')](),controller[_0x7d83('0xc')]);router[_0x7d83('0xd')]('/',auth[_0x7d83('0x8')](),controller[_0x7d83('0xe')]);router[_0x7d83('0xf')](_0x7d83('0x10'),auth[_0x7d83('0x8')](),controller['update']);router[_0x7d83('0x11')](_0x7d83('0x10'),auth[_0x7d83('0x8')](),controller[_0x7d83('0x12')]);module[_0x7d83('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 452d37b..65dd577 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 _0xa857=['DATE','moment','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa857,0x73));var _0x7a85=function(_0x286af1,_0x564c1f){_0x286af1=_0x286af1-0x0;var _0x2fb073=_0xa857[_0x286af1];return _0x2fb073;};'use strict';var moment=require(_0x7a85('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7a85('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7a85('0x1')]},'joinAt':{'type':Sequelize[_0x7a85('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7a85('0x2')]},'reason':{'type':Sequelize[_0x7a85('0x1')]}}; \ No newline at end of file +var _0xe715=['exports','STRING','DATE','moment'];(function(_0x332b3c,_0x3d89f2){var _0x406a5c=function(_0x45ccbf){while(--_0x45ccbf){_0x332b3c['push'](_0x332b3c['shift']());}};_0x406a5c(++_0x3d89f2);}(_0xe715,0x153));var _0x5e71=function(_0x544cf8,_0x4b8cd0){_0x544cf8=_0x544cf8-0x0;var _0x9c3066=_0xe715[_0x544cf8];return _0x9c3066;};'use strict';var moment=require(_0x5e71('0x0'));var Sequelize=require('sequelize');module[_0x5e71('0x1')]={'uniqueid':{'type':Sequelize[_0x5e71('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5e71('0x2')]},'joinAt':{'type':Sequelize[_0x5e71('0x3')]},'leaveAt':{'type':Sequelize[_0x5e71('0x3')]},'acceptAt':{'type':Sequelize[_0x5e71('0x3')]},'exitAt':{'type':Sequelize[_0x5e71('0x3')]},'reason':{'type':Sequelize[_0x5e71('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 77dcea0..341e03a 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 _0xad5e=['params','keys','includeAll','include','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','name','SmsQueueReport','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','map','type','VIRTUAL','merge','options','findAll','catch','show'];(function(_0x363c68,_0x57b1f8){var _0x47aaa4=function(_0x57a3ec){while(--_0x57a3ec){_0x363c68['push'](_0x363c68['shift']());}};_0x47aaa4(++_0x57b1f8);}(_0xad5e,0x94));var _0xead5=function(_0xbaf094,_0x2f86ad){_0xbaf094=_0xbaf094-0x0;var _0x3974fd=_0xad5e[_0xbaf094];return _0x3974fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xead5('0x0'));var zipdir=require(_0xead5('0x1'));var jsonpatch=require(_0xead5('0x2'));var rp=require(_0xead5('0x3'));var moment=require('moment');var BPromise=require(_0xead5('0x4'));var Mustache=require('mustache');var util=require(_0xead5('0x5'));var path=require('path');var sox=require(_0xead5('0x6'));var csv=require(_0xead5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xead5('0x8'));var _=require('lodash');var squel=require(_0xead5('0x9'));var crypto=require(_0xead5('0xa'));var jsforce=require(_0xead5('0xb'));var deskjs=require(_0xead5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xead5('0xd'));var Redis=require('ioredis');var authService=require(_0xead5('0xe'));var qs=require(_0xead5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xead5('0x10'));var logger=require(_0xead5('0x11'))(_0xead5('0x12'));var utils=require('../../config/utils');var config=require(_0xead5('0x13'));var licenseUtil=require(_0xead5('0x14'));var db=require(_0xead5('0x15'))['db'];function respondWithStatusCode(_0x1d0b90,_0x274817){_0x274817=_0x274817||0xcc;return function(_0x24870c){if(_0x24870c){return _0x1d0b90[_0xead5('0x16')](_0x274817);}return _0x1d0b90[_0xead5('0x17')](_0x274817)[_0xead5('0x18')]();};}function respondWithResult(_0x1c8c0d,_0x2f7ee0){_0x2f7ee0=_0x2f7ee0||0xc8;return function(_0x547968){if(_0x547968){return _0x1c8c0d[_0xead5('0x17')](_0x2f7ee0)[_0xead5('0x19')](_0x547968);}};}function respondWithFilteredResult(_0x2cdb30,_0x3fa17a){return function(_0x13bbbe){if(_0x13bbbe){var _0x2abbff=typeof _0x3fa17a[_0xead5('0x1a')]===_0xead5('0x1b')&&typeof _0x3fa17a[_0xead5('0x1c')]==='undefined';var _0x4831e4=_0x13bbbe[_0xead5('0x1d')];var _0x16d40e=_0x2abbff?0x0:_0x3fa17a[_0xead5('0x1a')];var _0xb15a6f=_0x2abbff?_0x13bbbe['count']:_0x3fa17a[_0xead5('0x1a')]+_0x3fa17a['limit'];var _0x2deaeb;if(_0xb15a6f>=_0x4831e4){_0xb15a6f=_0x4831e4;_0x2deaeb=0xc8;}else{_0x2deaeb=0xce;}_0x2cdb30['status'](_0x2deaeb);return _0x2cdb30['set'](_0xead5('0x1e'),_0x16d40e+'-'+_0xb15a6f+'/'+_0x4831e4)[_0xead5('0x19')](_0x13bbbe);}return null;};}function patchUpdates(_0x5c726a){return function(_0x3aeb20){try{jsonpatch['apply'](_0x3aeb20,_0x5c726a,!![]);}catch(_0x2076c4){return BPromise[_0xead5('0x1f')](_0x2076c4);}return _0x3aeb20['save']();};}function saveUpdates(_0x1acf6a,_0x35d534){return function(_0xaabb){if(_0xaabb){return _0xaabb[_0xead5('0x20')](_0x1acf6a)[_0xead5('0x21')](function(_0x5c8084){return _0x5c8084;});}return null;};}function removeEntity(_0xc7a2ae,_0x4e1cb4){return function(_0x54287b){if(_0x54287b){return _0x54287b[_0xead5('0x22')]()[_0xead5('0x21')](function(){_0xc7a2ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x528e9b,_0x273884){return function(_0xda5df8){if(!_0xda5df8){_0x528e9b[_0xead5('0x16')](0x194);}return _0xda5df8;};}function handleError(_0x4376bb,_0x1d0764){_0x1d0764=_0x1d0764||0x1f4;return function(_0x279718){logger[_0xead5('0x23')](_0x279718['stack']);if(_0x279718[_0xead5('0x24')]){delete _0x279718[_0xead5('0x24')];}_0x4376bb[_0xead5('0x17')](_0x1d0764)['send'](_0x279718);};}exports['index']=function(_0x7c901b,_0x4aaf9b){var _0x1b7c9e={},_0x151d01={},_0x30c94e={'count':0x0,'rows':[]};var _0x2c4316=_['map'](db[_0xead5('0x25')][_0xead5('0x26')],function(_0x4242ef){return{'name':_0x4242ef[_0xead5('0x27')],'type':_0x4242ef['type'][_0xead5('0x28')]};});_0x151d01[_0xead5('0x29')]=_['map'](_0x2c4316,_0xead5('0x24'));_0x151d01[_0xead5('0x2a')]=_['keys'](_0x7c901b[_0xead5('0x2a')]);_0x151d01['filters']=_['intersection'](_0x151d01[_0xead5('0x29')],_0x151d01['query']);_0x1b7c9e[_0xead5('0x2b')]=_[_0xead5('0x2c')](_0x151d01[_0xead5('0x29')],qs[_0xead5('0x2d')](_0x7c901b['query'][_0xead5('0x2d')]));_0x1b7c9e[_0xead5('0x2b')]=_0x1b7c9e[_0xead5('0x2b')][_0xead5('0x2e')]?_0x1b7c9e[_0xead5('0x2b')]:_0x151d01['model'];if(!_0x7c901b['query'][_0xead5('0x2f')](_0xead5('0x30'))){_0x1b7c9e['limit']=qs[_0xead5('0x1c')](_0x7c901b[_0xead5('0x2a')][_0xead5('0x1c')]);_0x1b7c9e[_0xead5('0x1a')]=qs[_0xead5('0x1a')](_0x7c901b[_0xead5('0x2a')][_0xead5('0x1a')]);}_0x1b7c9e[_0xead5('0x31')]=qs[_0xead5('0x32')](_0x7c901b[_0xead5('0x2a')][_0xead5('0x32')]);_0x1b7c9e['where']=qs['filters'](_['pick'](_0x7c901b[_0xead5('0x2a')],_0x151d01[_0xead5('0x33')]),_0x2c4316);if(_0x7c901b['query'][_0xead5('0x34')]){_0x1b7c9e[_0xead5('0x35')]=_['merge'](_0x1b7c9e[_0xead5('0x35')],{'$or':_[_0xead5('0x36')](_0x2c4316,function(_0x1b8a6a){if(_0x1b8a6a[_0xead5('0x37')]!==_0xead5('0x38')){var _0x17388c={};_0x17388c[_0x1b8a6a['name']]={'$like':'%'+_0x7c901b[_0xead5('0x2a')][_0xead5('0x34')]+'%'};return _0x17388c;}})});}_0x1b7c9e=_[_0xead5('0x39')]({},_0x1b7c9e,_0x7c901b[_0xead5('0x3a')]);var _0xc47ec0={'where':_0x1b7c9e[_0xead5('0x35')]};return db['SmsQueueReport'][_0xead5('0x1d')](_0xc47ec0)['then'](function(_0x8f94ab){_0x30c94e['count']=_0x8f94ab;if(_0x7c901b[_0xead5('0x2a')]['includeAll']){_0x1b7c9e['include']=[{'all':!![]}];}return db[_0xead5('0x25')][_0xead5('0x3b')](_0x1b7c9e);})[_0xead5('0x21')](function(_0x5cb2a9){_0x30c94e['rows']=_0x5cb2a9;return _0x30c94e;})[_0xead5('0x21')](respondWithFilteredResult(_0x4aaf9b,_0x1b7c9e))[_0xead5('0x3c')](handleError(_0x4aaf9b,null));};exports[_0xead5('0x3d')]=function(_0x3acf2f,_0x37eea9){var _0x568b5d={'raw':!![],'where':{'id':_0x3acf2f[_0xead5('0x3e')]['id']}},_0x1ddd3d={};_0x1ddd3d[_0xead5('0x29')]=_[_0xead5('0x3f')](db[_0xead5('0x25')]['rawAttributes']);_0x1ddd3d['query']=_[_0xead5('0x3f')](_0x3acf2f['query']);_0x1ddd3d[_0xead5('0x33')]=_[_0xead5('0x2c')](_0x1ddd3d[_0xead5('0x29')],_0x1ddd3d['query']);_0x568b5d[_0xead5('0x2b')]=_[_0xead5('0x2c')](_0x1ddd3d[_0xead5('0x29')],qs['fields'](_0x3acf2f[_0xead5('0x2a')][_0xead5('0x2d')]));_0x568b5d[_0xead5('0x2b')]=_0x568b5d[_0xead5('0x2b')][_0xead5('0x2e')]?_0x568b5d['attributes']:_0x1ddd3d[_0xead5('0x29')];if(_0x3acf2f[_0xead5('0x2a')][_0xead5('0x40')]){_0x568b5d[_0xead5('0x41')]=[{'all':!![]}];}_0x568b5d=_[_0xead5('0x39')]({},_0x568b5d,_0x3acf2f[_0xead5('0x3a')]);return db[_0xead5('0x25')]['find'](_0x568b5d)[_0xead5('0x21')](handleEntityNotFound(_0x37eea9,null))[_0xead5('0x21')](respondWithResult(_0x37eea9,null))[_0xead5('0x3c')](handleError(_0x37eea9,null));};exports['create']=function(_0x5431dd,_0x596203){return db['SmsQueueReport'][_0xead5('0x42')](_0x5431dd[_0xead5('0x43')],{})[_0xead5('0x21')](respondWithResult(_0x596203,0xc9))[_0xead5('0x3c')](handleError(_0x596203,null));};exports['update']=function(_0x39cc32,_0x15c8b0){if(_0x39cc32[_0xead5('0x43')]['id']){delete _0x39cc32[_0xead5('0x43')]['id'];}return db[_0xead5('0x25')][_0xead5('0x44')]({'where':{'id':_0x39cc32[_0xead5('0x3e')]['id']}})[_0xead5('0x21')](handleEntityNotFound(_0x15c8b0,null))[_0xead5('0x21')](saveUpdates(_0x39cc32['body'],null))['then'](respondWithResult(_0x15c8b0,null))['catch'](handleError(_0x15c8b0,null));};exports[_0xead5('0x22')]=function(_0x3cf246,_0x353794){return db[_0xead5('0x25')][_0xead5('0x44')]({'where':{'id':_0x3cf246['params']['id']}})[_0xead5('0x21')](handleEntityNotFound(_0x353794,null))['then'](removeEntity(_0x353794,null))[_0xead5('0x3c')](handleError(_0x353794,null));};exports[_0xead5('0x45')]=function(_0x217321,_0x37611a){return db['SmsQueueReport'][_0xead5('0x45')]()[_0xead5('0x21')](respondWithResult(_0x37611a,null))[_0xead5('0x3c')](handleError(_0x37611a,null));}; \ No newline at end of file +var _0x627f=['body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','filter','options','include','rows','catch','params','includeAll','find','create'];(function(_0x3204fc,_0x2d74a4){var _0x2c9784=function(_0x1847b6){while(--_0x1847b6){_0x3204fc['push'](_0x3204fc['shift']());}};_0x2c9784(++_0x2d74a4);}(_0x627f,0x1c4));var _0xf627=function(_0x5a3fb6,_0x3e584c){_0x5a3fb6=_0x5a3fb6-0x0;var _0x48735d=_0x627f[_0x5a3fb6];return _0x48735d;};'use strict';var emlformat=require(_0xf627('0x0'));var rimraf=require(_0xf627('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf627('0x2'));var rp=require(_0xf627('0x3'));var moment=require(_0xf627('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf627('0x5'));var util=require('util');var path=require(_0xf627('0x6'));var sox=require(_0xf627('0x7'));var csv=require(_0xf627('0x8'));var ejs=require(_0xf627('0x9'));var fs=require('fs');var fs_extra=require(_0xf627('0xa'));var _=require(_0xf627('0xb'));var squel=require(_0xf627('0xc'));var crypto=require(_0xf627('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf627('0xe'));var toCsv=require(_0xf627('0x8'));var querystring=require('querystring');var Papa=require(_0xf627('0xf'));var Redis=require(_0xf627('0x10'));var authService=require(_0xf627('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf627('0x12'));var hardwareService=require(_0xf627('0x13'));var logger=require(_0xf627('0x14'))(_0xf627('0x15'));var utils=require(_0xf627('0x16'));var config=require(_0xf627('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf627('0x18'))['db'];function respondWithStatusCode(_0x523f00,_0x17800f){_0x17800f=_0x17800f||0xcc;return function(_0x33752d){if(_0x33752d){return _0x523f00[_0xf627('0x19')](_0x17800f);}return _0x523f00[_0xf627('0x1a')](_0x17800f)[_0xf627('0x1b')]();};}function respondWithResult(_0x13f6b1,_0x4f8a59){_0x4f8a59=_0x4f8a59||0xc8;return function(_0x19e2c6){if(_0x19e2c6){return _0x13f6b1[_0xf627('0x1a')](_0x4f8a59)[_0xf627('0x1c')](_0x19e2c6);}};}function respondWithFilteredResult(_0x397ec3,_0x5a037f){return function(_0x5ed01b){if(_0x5ed01b){var _0x372db5=typeof _0x5a037f[_0xf627('0x1d')]===_0xf627('0x1e')&&typeof _0x5a037f[_0xf627('0x1f')]===_0xf627('0x1e');var _0xcfe843=_0x5ed01b[_0xf627('0x20')];var _0x19ebd8=_0x372db5?0x0:_0x5a037f[_0xf627('0x1d')];var _0x5bcc2a=_0x372db5?_0x5ed01b['count']:_0x5a037f[_0xf627('0x1d')]+_0x5a037f['limit'];var _0xf49fa0;if(_0x5bcc2a>=_0xcfe843){_0x5bcc2a=_0xcfe843;_0xf49fa0=0xc8;}else{_0xf49fa0=0xce;}_0x397ec3[_0xf627('0x1a')](_0xf49fa0);return _0x397ec3[_0xf627('0x21')](_0xf627('0x22'),_0x19ebd8+'-'+_0x5bcc2a+'/'+_0xcfe843)[_0xf627('0x1c')](_0x5ed01b);}return null;};}function patchUpdates(_0x509f30){return function(_0x33f301){try{jsonpatch[_0xf627('0x23')](_0x33f301,_0x509f30,!![]);}catch(_0xd8d056){return BPromise[_0xf627('0x24')](_0xd8d056);}return _0x33f301['save']();};}function saveUpdates(_0x2c5494,_0x40a531){return function(_0x1aa2a6){if(_0x1aa2a6){return _0x1aa2a6[_0xf627('0x25')](_0x2c5494)[_0xf627('0x26')](function(_0x572e75){return _0x572e75;});}return null;};}function removeEntity(_0x35af0b,_0x3e6840){return function(_0x429183){if(_0x429183){return _0x429183[_0xf627('0x27')]()['then'](function(){_0x35af0b[_0xf627('0x1a')](0xcc)[_0xf627('0x1b')]();});}};}function handleEntityNotFound(_0x35adbb,_0x3031ea){return function(_0x5511d0){if(!_0x5511d0){_0x35adbb[_0xf627('0x19')](0x194);}return _0x5511d0;};}function handleError(_0x2b9353,_0x55ad61){_0x55ad61=_0x55ad61||0x1f4;return function(_0x2e1d6b){logger[_0xf627('0x28')](_0x2e1d6b['stack']);if(_0x2e1d6b[_0xf627('0x29')]){delete _0x2e1d6b[_0xf627('0x29')];}_0x2b9353['status'](_0x55ad61)[_0xf627('0x2a')](_0x2e1d6b);};}exports[_0xf627('0x2b')]=function(_0x45dcdc,_0x4c9246){var _0x2204c3={},_0x5e2bc6={},_0x51077e={'count':0x0,'rows':[]};var _0x13b08e=_['map'](db[_0xf627('0x2c')][_0xf627('0x2d')],function(_0x45348d){return{'name':_0x45348d[_0xf627('0x2e')],'type':_0x45348d[_0xf627('0x2f')][_0xf627('0x30')]};});_0x5e2bc6[_0xf627('0x31')]=_['map'](_0x13b08e,_0xf627('0x29'));_0x5e2bc6[_0xf627('0x32')]=_[_0xf627('0x33')](_0x45dcdc[_0xf627('0x32')]);_0x5e2bc6['filters']=_['intersection'](_0x5e2bc6[_0xf627('0x31')],_0x5e2bc6[_0xf627('0x32')]);_0x2204c3[_0xf627('0x34')]=_[_0xf627('0x35')](_0x5e2bc6[_0xf627('0x31')],qs[_0xf627('0x36')](_0x45dcdc[_0xf627('0x32')][_0xf627('0x36')]));_0x2204c3['attributes']=_0x2204c3[_0xf627('0x34')][_0xf627('0x37')]?_0x2204c3[_0xf627('0x34')]:_0x5e2bc6[_0xf627('0x31')];if(!_0x45dcdc[_0xf627('0x32')][_0xf627('0x38')]('nolimit')){_0x2204c3[_0xf627('0x1f')]=qs['limit'](_0x45dcdc['query']['limit']);_0x2204c3[_0xf627('0x1d')]=qs[_0xf627('0x1d')](_0x45dcdc[_0xf627('0x32')][_0xf627('0x1d')]);}_0x2204c3[_0xf627('0x39')]=qs['sort'](_0x45dcdc[_0xf627('0x32')][_0xf627('0x3a')]);_0x2204c3[_0xf627('0x3b')]=qs[_0xf627('0x3c')](_[_0xf627('0x3d')](_0x45dcdc[_0xf627('0x32')],_0x5e2bc6[_0xf627('0x3c')]),_0x13b08e);if(_0x45dcdc[_0xf627('0x32')]['filter']){_0x2204c3['where']=_[_0xf627('0x3e')](_0x2204c3[_0xf627('0x3b')],{'$or':_[_0xf627('0x3f')](_0x13b08e,function(_0x31aa6f){if(_0x31aa6f[_0xf627('0x2f')]!=='VIRTUAL'){var _0x5a5953={};_0x5a5953[_0x31aa6f['name']]={'$like':'%'+_0x45dcdc[_0xf627('0x32')][_0xf627('0x40')]+'%'};return _0x5a5953;}})});}_0x2204c3=_['merge']({},_0x2204c3,_0x45dcdc[_0xf627('0x41')]);var _0x9be629={'where':_0x2204c3[_0xf627('0x3b')]};return db[_0xf627('0x2c')][_0xf627('0x20')](_0x9be629)[_0xf627('0x26')](function(_0x37a000){_0x51077e['count']=_0x37a000;if(_0x45dcdc[_0xf627('0x32')]['includeAll']){_0x2204c3[_0xf627('0x42')]=[{'all':!![]}];}return db[_0xf627('0x2c')]['findAll'](_0x2204c3);})[_0xf627('0x26')](function(_0x5021c6){_0x51077e[_0xf627('0x43')]=_0x5021c6;return _0x51077e;})[_0xf627('0x26')](respondWithFilteredResult(_0x4c9246,_0x2204c3))[_0xf627('0x44')](handleError(_0x4c9246,null));};exports['show']=function(_0x5ea340,_0x213462){var _0xc50379={'raw':!![],'where':{'id':_0x5ea340[_0xf627('0x45')]['id']}},_0x47500d={};_0x47500d[_0xf627('0x31')]=_[_0xf627('0x33')](db[_0xf627('0x2c')][_0xf627('0x2d')]);_0x47500d['query']=_[_0xf627('0x33')](_0x5ea340[_0xf627('0x32')]);_0x47500d[_0xf627('0x3c')]=_['intersection'](_0x47500d['model'],_0x47500d[_0xf627('0x32')]);_0xc50379[_0xf627('0x34')]=_['intersection'](_0x47500d[_0xf627('0x31')],qs[_0xf627('0x36')](_0x5ea340[_0xf627('0x32')]['fields']));_0xc50379[_0xf627('0x34')]=_0xc50379[_0xf627('0x34')][_0xf627('0x37')]?_0xc50379[_0xf627('0x34')]:_0x47500d['model'];if(_0x5ea340['query'][_0xf627('0x46')]){_0xc50379[_0xf627('0x42')]=[{'all':!![]}];}_0xc50379=_[_0xf627('0x3e')]({},_0xc50379,_0x5ea340[_0xf627('0x41')]);return db[_0xf627('0x2c')][_0xf627('0x47')](_0xc50379)[_0xf627('0x26')](handleEntityNotFound(_0x213462,null))[_0xf627('0x26')](respondWithResult(_0x213462,null))['catch'](handleError(_0x213462,null));};exports[_0xf627('0x48')]=function(_0x5c8ef6,_0x285406){return db[_0xf627('0x2c')][_0xf627('0x48')](_0x5c8ef6[_0xf627('0x49')],{})[_0xf627('0x26')](respondWithResult(_0x285406,0xc9))[_0xf627('0x44')](handleError(_0x285406,null));};exports['update']=function(_0x537169,_0x3b2e8b){if(_0x537169['body']['id']){delete _0x537169[_0xf627('0x49')]['id'];}return db[_0xf627('0x2c')]['find']({'where':{'id':_0x537169['params']['id']}})[_0xf627('0x26')](handleEntityNotFound(_0x3b2e8b,null))[_0xf627('0x26')](saveUpdates(_0x537169[_0xf627('0x49')],null))[_0xf627('0x26')](respondWithResult(_0x3b2e8b,null))[_0xf627('0x44')](handleError(_0x3b2e8b,null));};exports['destroy']=function(_0x800b02,_0x1604f9){return db['SmsQueueReport'][_0xf627('0x47')]({'where':{'id':_0x800b02[_0xf627('0x45')]['id']}})[_0xf627('0x26')](handleEntityNotFound(_0x1604f9,null))['then'](removeEntity(_0x1604f9,null))[_0xf627('0x44')](handleError(_0x1604f9,null));};exports[_0xf627('0x4a')]=function(_0x44e9b6,_0x2c479e){return db['SmsQueueReport'][_0xf627('0x4a')]()[_0xf627('0x26')](respondWithResult(_0x2c479e,null))[_0xf627('0x44')](handleError(_0x2c479e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 23f77bc..eeae4bd 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3cebba,_0xe200a5){var _0x1be3a1=function(_0x5b4084){while(--_0x5b4084){_0x3cebba['push'](_0x3cebba['shift']());}};_0x1be3a1(++_0xe200a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb7e7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 2e61ac6..3434159 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 _0x04f3=['stringify','UpdateSmsQueueReport','update','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','then'];(function(_0x1fb5cf,_0x5d6858){var _0x2c39bc=function(_0x1d5569){while(--_0x1d5569){_0x1fb5cf['push'](_0x1fb5cf['shift']());}};_0x2c39bc(++_0x5d6858);}(_0x04f3,0x1b5));var _0x304f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04f3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x304f('0x0'));var util=require(_0x304f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x304f('0x2'));var fs=require('fs');var Redis=require(_0x304f('0x3'));var db=require(_0x304f('0x4'))['db'];var utils=require(_0x304f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x304f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x304f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d005b,_0xa8bdbb,_0x2bad3d){return new BPromise(function(_0x11ca17,_0x422495){return client['request'](_0x5d005b,_0x2bad3d)['then'](function(_0xcd83a8){logger[_0x304f('0x8')](_0x304f('0x9'),_0xa8bdbb,_0x304f('0xa'));logger[_0x304f('0xb')](_0x304f('0xc'),_0xa8bdbb,_0x304f('0xa'),JSON['stringify'](_0xcd83a8));if(_0xcd83a8[_0x304f('0xd')]){if(_0xcd83a8[_0x304f('0xd')]['code']===0x1f4){logger[_0x304f('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0xa8bdbb,_0xcd83a8[_0x304f('0xd')][_0x304f('0xe')]);return _0x422495(_0xcd83a8[_0x304f('0xd')][_0x304f('0xe')]);}logger['error'](_0x304f('0x9'),_0xa8bdbb,_0xcd83a8[_0x304f('0xd')][_0x304f('0xe')]);return _0x11ca17(_0xcd83a8[_0x304f('0xd')]['message']);}else{logger['info'](_0x304f('0x9'),_0xa8bdbb,_0x304f('0xa'));_0x11ca17(_0xcd83a8[_0x304f('0xf')][_0x304f('0xe')]);}})[_0x304f('0x10')](function(_0x31a725){logger[_0x304f('0xd')](_0x304f('0x9'),_0xa8bdbb,_0x31a725);_0x422495(_0x31a725);});});}exports[_0x304f('0x11')]=function(_0x3f54da){var _0x140b38=this;return new Promise(function(_0x149b69,_0xefd43b){return db[_0x304f('0x12')][_0x304f('0x13')](_0x3f54da['body'],{'raw':_0x3f54da[_0x304f('0x14')]?_0x3f54da[_0x304f('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x304f('0x15')](function(_0x161c3f){logger[_0x304f('0x8')](_0x304f('0x11'),_0x3f54da);logger['debug'](_0x304f('0x11'),_0x3f54da,JSON[_0x304f('0x16')](_0x161c3f));_0x149b69(_0x161c3f);})[_0x304f('0x10')](function(_0x3dc35c){logger[_0x304f('0xd')](_0x304f('0x11'),_0x3dc35c[_0x304f('0xe')],_0x3f54da);_0xefd43b(_0x140b38['error'](0x1f4,_0x3dc35c[_0x304f('0xe')]));});});};exports[_0x304f('0x17')]=function(_0x3e068e){var _0x2c5fa7=this;return new Promise(function(_0x21dcac,_0x334fdd){return db[_0x304f('0x12')][_0x304f('0x18')](_0x3e068e['body'],{'raw':_0x3e068e[_0x304f('0x14')]?_0x3e068e[_0x304f('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e068e[_0x304f('0x14')]?_0x3e068e[_0x304f('0x14')][_0x304f('0x19')]||null:null,'attributes':_0x3e068e[_0x304f('0x14')]?_0x3e068e[_0x304f('0x14')][_0x304f('0x1a')]||null:null,'limit':_0x3e068e[_0x304f('0x14')]?_0x3e068e['options']['limit']||null:null})['then'](function(_0x4e8cc2){logger[_0x304f('0x8')](_0x304f('0x17'),_0x3e068e);logger[_0x304f('0xb')](_0x304f('0x17'),_0x3e068e,JSON[_0x304f('0x16')](_0x4e8cc2));_0x21dcac(_0x4e8cc2);})[_0x304f('0x10')](function(_0x544d78){logger[_0x304f('0xd')]('UpdateSmsQueueReport',_0x544d78[_0x304f('0xe')],_0x3e068e);_0x334fdd(_0x2c5fa7[_0x304f('0xd')](0x1f4,_0x544d78[_0x304f('0xe')]));});});}; \ No newline at end of file +var _0xe012=['message','result','catch','CreateSmsQueueReport','create','body','options','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x379a88,_0x2aee53){var _0x415f48=function(_0x582fd0){while(--_0x582fd0){_0x379a88['push'](_0x379a88['shift']());}};_0x415f48(++_0x2aee53);}(_0xe012,0x78));var _0x2e01=function(_0x453a05,_0x102018){_0x453a05=_0x453a05-0x0;var _0xc42c7d=_0xe012[_0x453a05];return _0xc42c7d;};'use strict';var _=require(_0x2e01('0x0'));var util=require(_0x2e01('0x1'));var moment=require(_0x2e01('0x2'));var BPromise=require(_0x2e01('0x3'));var rs=require(_0x2e01('0x4'));var fs=require('fs');var Redis=require(_0x2e01('0x5'));var db=require(_0x2e01('0x6'))['db'];var utils=require(_0x2e01('0x7'));var logger=require(_0x2e01('0x8'))(_0x2e01('0x9'));var config=require(_0x2e01('0xa'));var jayson=require(_0x2e01('0xb'));var client=jayson[_0x2e01('0xc')][_0x2e01('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x98dd37,_0x354236,_0x248a47){return new BPromise(function(_0x295baa,_0x5453d4){return client[_0x2e01('0xe')](_0x98dd37,_0x248a47)[_0x2e01('0xf')](function(_0x38fd09){logger[_0x2e01('0x10')](_0x2e01('0x11'),_0x354236,_0x2e01('0x12'));logger[_0x2e01('0x13')](_0x2e01('0x14'),_0x354236,'request\x20sent',JSON[_0x2e01('0x15')](_0x38fd09));if(_0x38fd09[_0x2e01('0x16')]){if(_0x38fd09[_0x2e01('0x16')][_0x2e01('0x17')]===0x1f4){logger['error'](_0x2e01('0x11'),_0x354236,_0x38fd09[_0x2e01('0x16')][_0x2e01('0x18')]);return _0x5453d4(_0x38fd09['error'][_0x2e01('0x18')]);}logger[_0x2e01('0x16')](_0x2e01('0x11'),_0x354236,_0x38fd09[_0x2e01('0x16')][_0x2e01('0x18')]);return _0x295baa(_0x38fd09[_0x2e01('0x16')]['message']);}else{logger[_0x2e01('0x10')](_0x2e01('0x11'),_0x354236,_0x2e01('0x12'));_0x295baa(_0x38fd09[_0x2e01('0x19')]['message']);}})[_0x2e01('0x1a')](function(_0x3f0e71){logger[_0x2e01('0x16')]('SmsQueueReport,\x20%s,\x20%s',_0x354236,_0x3f0e71);_0x5453d4(_0x3f0e71);});});}exports[_0x2e01('0x1b')]=function(_0x1cfa9e){var _0x190564=this;return new Promise(function(_0x54b404,_0x362b12){return db['SmsQueueReport'][_0x2e01('0x1c')](_0x1cfa9e[_0x2e01('0x1d')],{'raw':_0x1cfa9e[_0x2e01('0x1e')]?_0x1cfa9e[_0x2e01('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x57b558){logger[_0x2e01('0x10')]('CreateSmsQueueReport',_0x1cfa9e);logger[_0x2e01('0x13')](_0x2e01('0x1b'),_0x1cfa9e,JSON[_0x2e01('0x15')](_0x57b558));_0x54b404(_0x57b558);})[_0x2e01('0x1a')](function(_0xa237b7){logger[_0x2e01('0x16')]('CreateSmsQueueReport',_0xa237b7['message'],_0x1cfa9e);_0x362b12(_0x190564[_0x2e01('0x16')](0x1f4,_0xa237b7[_0x2e01('0x18')]));});});};exports[_0x2e01('0x1f')]=function(_0x43f062){var _0x15a560=this;return new Promise(function(_0x4cad74,_0x34bb98){return db[_0x2e01('0x20')][_0x2e01('0x21')](_0x43f062[_0x2e01('0x1d')],{'raw':_0x43f062['options']?_0x43f062[_0x2e01('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f062['options']?_0x43f062['options'][_0x2e01('0x22')]||null:null,'attributes':_0x43f062[_0x2e01('0x1e')]?_0x43f062[_0x2e01('0x1e')][_0x2e01('0x23')]||null:null,'limit':_0x43f062[_0x2e01('0x1e')]?_0x43f062[_0x2e01('0x1e')]['limit']||null:null})[_0x2e01('0xf')](function(_0x1dff7b){logger[_0x2e01('0x10')](_0x2e01('0x1f'),_0x43f062);logger['debug'](_0x2e01('0x1f'),_0x43f062,JSON[_0x2e01('0x15')](_0x1dff7b));_0x4cad74(_0x1dff7b);})[_0x2e01('0x1a')](function(_0x19e5d8){logger[_0x2e01('0x16')]('UpdateSmsQueueReport',_0x19e5d8[_0x2e01('0x18')],_0x43f062);_0x34bb98(_0x15a560['error'](0x1f4,_0x19e5d8[_0x2e01('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 43e6666..e536862 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 _0xcb81=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x45d5ef,_0x10c29b){var _0x474d19=function(_0xc182bf){while(--_0xc182bf){_0x45d5ef['push'](_0x45d5ef['shift']());}};_0x474d19(++_0x10c29b);}(_0xcb81,0x154));var _0x1cb8=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xcb81[_0x4b6830];return _0x239e4a;};'use strict';var multer=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var path=require('path');var timeout=require(_0x1cb8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cb8('0x3'));var interaction=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var controller=require(_0x1cb8('0x6'));router[_0x1cb8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0x8')]);router[_0x1cb8('0x7')]('/describe',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xa')]);router[_0x1cb8('0x7')]('/:id',auth[_0x1cb8('0x9')](),controller['show']);router['post']('/',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xb')]);router[_0x1cb8('0xc')](_0x1cb8('0xd'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xe')]);router[_0x1cb8('0xf')](_0x1cb8('0xd'),auth['isAuthenticated'](),controller[_0x1cb8('0x10')]);module[_0x1cb8('0x11')]=router; \ No newline at end of file +var _0xcb66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x12aca6,_0x1cd87b){var _0x2fe931=function(_0x50169a){while(--_0x50169a){_0x12aca6['push'](_0x12aca6['shift']());}};_0x2fe931(++_0x1cd87b);}(_0xcb66,0x19f));var _0x6cb6=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xcb66[_0x589aee];return _0x2f5ed4;};'use strict';var multer=require('multer');var util=require(_0x6cb6('0x0'));var path=require(_0x6cb6('0x1'));var timeout=require(_0x6cb6('0x2'));var express=require(_0x6cb6('0x3'));var router=express[_0x6cb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb6('0x5'));var interaction=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var controller=require(_0x6cb6('0x8'));router[_0x6cb6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cb6('0x9')](_0x6cb6('0xa'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xc')]);router[_0x6cb6('0x9')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xe')]);router[_0x6cb6('0xf')]('/',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x10')]);router[_0x6cb6('0x11')](_0x6cb6('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x12')]);module[_0x6cb6('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 3e0d8ab..f913a92 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x4db66e,_0x596244){var _0x207f6c=function(_0x1f027f){while(--_0x1f027f){_0x4db66e['push'](_0x4db66e['shift']());}};_0x207f6c(++_0x596244);}(_0xe706,0xa3));var _0x6e70=function(_0x153738,_0xe704c1){_0x153738=_0x153738-0x0;var _0x3028d9=_0xe706[_0x153738];return _0x3028d9;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x15a0e8,_0x4cee4c){var _0x569013=function(_0x5625b2){while(--_0x5625b2){_0x15a0e8['push'](_0x15a0e8['shift']());}};_0x569013(++_0x4cee4c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 2e5a39b..bcac80d 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 _0x0c08=['reject','save','update','then','end','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','keys','intersection','find','create','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0c08,0x15a));var _0x80c0=function(_0x37862a,_0x2bc98e){_0x37862a=_0x37862a-0x0;var _0x5b0104=_0x0c08[_0x37862a];return _0x5b0104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80c0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80c0('0x1'));var rp=require(_0x80c0('0x2'));var moment=require(_0x80c0('0x3'));var BPromise=require(_0x80c0('0x4'));var Mustache=require(_0x80c0('0x5'));var util=require(_0x80c0('0x6'));var path=require(_0x80c0('0x7'));var sox=require(_0x80c0('0x8'));var csv=require(_0x80c0('0x9'));var ejs=require(_0x80c0('0xa'));var fs=require('fs');var fs_extra=require(_0x80c0('0xb'));var _=require(_0x80c0('0xc'));var squel=require(_0x80c0('0xd'));var crypto=require(_0x80c0('0xe'));var jsforce=require(_0x80c0('0xf'));var deskjs=require(_0x80c0('0x10'));var toCsv=require(_0x80c0('0x9'));var querystring=require(_0x80c0('0x11'));var Papa=require(_0x80c0('0x12'));var Redis=require(_0x80c0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x80c0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x80c0('0x15'))(_0x80c0('0x16'));var utils=require('../../config/utils');var config=require(_0x80c0('0x17'));var licenseUtil=require(_0x80c0('0x18'));var db=require(_0x80c0('0x19'))['db'];function respondWithStatusCode(_0x49f022,_0x3685ef){_0x3685ef=_0x3685ef||0xcc;return function(_0x5b02c9){if(_0x5b02c9){return _0x49f022[_0x80c0('0x1a')](_0x3685ef);}return _0x49f022['status'](_0x3685ef)['end']();};}function respondWithResult(_0x586920,_0x473f51){_0x473f51=_0x473f51||0xc8;return function(_0xc53896){if(_0xc53896){return _0x586920[_0x80c0('0x1b')](_0x473f51)[_0x80c0('0x1c')](_0xc53896);}};}function respondWithFilteredResult(_0xc576a1,_0x5848a2){return function(_0x1b06dd){if(_0x1b06dd){var _0x5639ad=typeof _0x5848a2[_0x80c0('0x1d')]==='undefined'&&typeof _0x5848a2['limit']===_0x80c0('0x1e');var _0xf728ab=_0x1b06dd[_0x80c0('0x1f')];var _0x59322e=_0x5639ad?0x0:_0x5848a2[_0x80c0('0x1d')];var _0x4adbc8=_0x5639ad?_0x1b06dd['count']:_0x5848a2[_0x80c0('0x1d')]+_0x5848a2[_0x80c0('0x20')];var _0x4602c4;if(_0x4adbc8>=_0xf728ab){_0x4adbc8=_0xf728ab;_0x4602c4=0xc8;}else{_0x4602c4=0xce;}_0xc576a1[_0x80c0('0x1b')](_0x4602c4);return _0xc576a1['set'](_0x80c0('0x21'),_0x59322e+'-'+_0x4adbc8+'/'+_0xf728ab)[_0x80c0('0x1c')](_0x1b06dd);}return null;};}function patchUpdates(_0xe5795d){return function(_0x3a92c1){try{jsonpatch['apply'](_0x3a92c1,_0xe5795d,!![]);}catch(_0x5f1676){return BPromise[_0x80c0('0x22')](_0x5f1676);}return _0x3a92c1[_0x80c0('0x23')]();};}function saveUpdates(_0x28f5cd,_0x30c904){return function(_0x1a6115){if(_0x1a6115){return _0x1a6115[_0x80c0('0x24')](_0x28f5cd)['then'](function(_0xa36a0d){return _0xa36a0d;});}return null;};}function removeEntity(_0x2984e7,_0x20569b){return function(_0x48dce0){if(_0x48dce0){return _0x48dce0['destroy']()[_0x80c0('0x25')](function(){_0x2984e7[_0x80c0('0x1b')](0xcc)[_0x80c0('0x26')]();});}};}function handleEntityNotFound(_0x235a49,_0x244746){return function(_0x31977e){if(!_0x31977e){_0x235a49[_0x80c0('0x1a')](0x194);}return _0x31977e;};}function handleError(_0x295283,_0x12d6dd){_0x12d6dd=_0x12d6dd||0x1f4;return function(_0x3dab8b){logger['error'](_0x3dab8b['stack']);if(_0x3dab8b[_0x80c0('0x27')]){delete _0x3dab8b['name'];}_0x295283[_0x80c0('0x1b')](_0x12d6dd)[_0x80c0('0x28')](_0x3dab8b);};}exports[_0x80c0('0x29')]=function(_0x50efd8,_0x7a26f0){var _0x2865c9={},_0x2c2a86={},_0x4dbb7f={'count':0x0,'rows':[]};var _0x13b050=_[_0x80c0('0x2a')](db[_0x80c0('0x2b')]['rawAttributes'],function(_0x235640){return{'name':_0x235640[_0x80c0('0x2c')],'type':_0x235640[_0x80c0('0x2d')][_0x80c0('0x2e')]};});_0x2c2a86[_0x80c0('0x2f')]=_[_0x80c0('0x2a')](_0x13b050,'name');_0x2c2a86[_0x80c0('0x30')]=_['keys'](_0x50efd8[_0x80c0('0x30')]);_0x2c2a86[_0x80c0('0x31')]=_['intersection'](_0x2c2a86['model'],_0x2c2a86[_0x80c0('0x30')]);_0x2865c9[_0x80c0('0x32')]=_['intersection'](_0x2c2a86[_0x80c0('0x2f')],qs[_0x80c0('0x33')](_0x50efd8[_0x80c0('0x30')][_0x80c0('0x33')]));_0x2865c9[_0x80c0('0x32')]=_0x2865c9[_0x80c0('0x32')][_0x80c0('0x34')]?_0x2865c9[_0x80c0('0x32')]:_0x2c2a86[_0x80c0('0x2f')];if(!_0x50efd8[_0x80c0('0x30')][_0x80c0('0x35')](_0x80c0('0x36'))){_0x2865c9[_0x80c0('0x20')]=qs['limit'](_0x50efd8[_0x80c0('0x30')][_0x80c0('0x20')]);_0x2865c9['offset']=qs['offset'](_0x50efd8['query'][_0x80c0('0x1d')]);}_0x2865c9[_0x80c0('0x37')]=qs[_0x80c0('0x38')](_0x50efd8['query']['sort']);_0x2865c9[_0x80c0('0x39')]=qs[_0x80c0('0x31')](_[_0x80c0('0x3a')](_0x50efd8[_0x80c0('0x30')],_0x2c2a86[_0x80c0('0x31')]),_0x13b050);if(_0x50efd8[_0x80c0('0x30')][_0x80c0('0x3b')]){_0x2865c9[_0x80c0('0x39')]=_[_0x80c0('0x3c')](_0x2865c9[_0x80c0('0x39')],{'$or':_[_0x80c0('0x2a')](_0x13b050,function(_0x22330e){if(_0x22330e[_0x80c0('0x2d')]!==_0x80c0('0x3d')){var _0x120931={};_0x120931[_0x22330e[_0x80c0('0x27')]]={'$like':'%'+_0x50efd8['query']['filter']+'%'};return _0x120931;}})});}_0x2865c9=_['merge']({},_0x2865c9,_0x50efd8[_0x80c0('0x3e')]);var _0x1806ef={'where':_0x2865c9['where']};return db[_0x80c0('0x2b')]['count'](_0x1806ef)['then'](function(_0x30bd2b){_0x4dbb7f[_0x80c0('0x1f')]=_0x30bd2b;if(_0x50efd8[_0x80c0('0x30')][_0x80c0('0x3f')]){_0x2865c9['include']=[{'all':!![]}];}return db[_0x80c0('0x2b')]['findAll'](_0x2865c9);})[_0x80c0('0x25')](function(_0x3b2744){_0x4dbb7f[_0x80c0('0x40')]=_0x3b2744;return _0x4dbb7f;})[_0x80c0('0x25')](respondWithFilteredResult(_0x7a26f0,_0x2865c9))[_0x80c0('0x41')](handleError(_0x7a26f0,null));};exports[_0x80c0('0x42')]=function(_0x32ea12,_0x403929){var _0x1166d7={'raw':!![],'where':{'id':_0x32ea12['params']['id']}},_0x337e67={};_0x337e67['model']=_['keys'](db['SmsTransferReport'][_0x80c0('0x43')]);_0x337e67['query']=_[_0x80c0('0x44')](_0x32ea12[_0x80c0('0x30')]);_0x337e67[_0x80c0('0x31')]=_['intersection'](_0x337e67[_0x80c0('0x2f')],_0x337e67[_0x80c0('0x30')]);_0x1166d7[_0x80c0('0x32')]=_[_0x80c0('0x45')](_0x337e67[_0x80c0('0x2f')],qs[_0x80c0('0x33')](_0x32ea12[_0x80c0('0x30')][_0x80c0('0x33')]));_0x1166d7[_0x80c0('0x32')]=_0x1166d7[_0x80c0('0x32')][_0x80c0('0x34')]?_0x1166d7[_0x80c0('0x32')]:_0x337e67['model'];if(_0x32ea12[_0x80c0('0x30')]['includeAll']){_0x1166d7['include']=[{'all':!![]}];}_0x1166d7=_['merge']({},_0x1166d7,_0x32ea12[_0x80c0('0x3e')]);return db[_0x80c0('0x2b')][_0x80c0('0x46')](_0x1166d7)['then'](handleEntityNotFound(_0x403929,null))[_0x80c0('0x25')](respondWithResult(_0x403929,null))[_0x80c0('0x41')](handleError(_0x403929,null));};exports[_0x80c0('0x47')]=function(_0x51c024,_0x283152){return db[_0x80c0('0x2b')]['create'](_0x51c024['body'],{})[_0x80c0('0x25')](respondWithResult(_0x283152,0xc9))[_0x80c0('0x41')](handleError(_0x283152,null));};exports[_0x80c0('0x24')]=function(_0x1adf2b,_0x15631c){if(_0x1adf2b[_0x80c0('0x48')]['id']){delete _0x1adf2b[_0x80c0('0x48')]['id'];}return db[_0x80c0('0x2b')][_0x80c0('0x46')]({'where':{'id':_0x1adf2b[_0x80c0('0x49')]['id']}})[_0x80c0('0x25')](handleEntityNotFound(_0x15631c,null))['then'](saveUpdates(_0x1adf2b[_0x80c0('0x48')],null))[_0x80c0('0x25')](respondWithResult(_0x15631c,null))[_0x80c0('0x41')](handleError(_0x15631c,null));};exports[_0x80c0('0x4a')]=function(_0x5546fe,_0x4786ab){return db[_0x80c0('0x2b')][_0x80c0('0x46')]({'where':{'id':_0x5546fe[_0x80c0('0x49')]['id']}})[_0x80c0('0x25')](handleEntityNotFound(_0x4786ab,null))['then'](removeEntity(_0x4786ab,null))[_0x80c0('0x41')](handleError(_0x4786ab,null));};exports[_0x80c0('0x4b')]=function(_0x5aaebc,_0x3ae044){return db['SmsTransferReport'][_0x80c0('0x4b')]()[_0x80c0('0x25')](respondWithResult(_0x3ae044,null))[_0x80c0('0x41')](handleError(_0x3ae044,null));}; \ No newline at end of file +var _0xe492=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','then','error','stack','name','send','index','map','SmsTransferReport','type','model','query'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xe492,0x173));var _0x2e49=function(_0x145aef,_0x371dd5){_0x145aef=_0x145aef-0x0;var _0x114246=_0xe492[_0x145aef];return _0x114246;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e49('0x0'));var zipdir=require(_0x2e49('0x1'));var jsonpatch=require(_0x2e49('0x2'));var rp=require('request-promise');var moment=require(_0x2e49('0x3'));var BPromise=require(_0x2e49('0x4'));var Mustache=require(_0x2e49('0x5'));var util=require(_0x2e49('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e49('0x7'));var fs=require('fs');var fs_extra=require(_0x2e49('0x8'));var _=require(_0x2e49('0x9'));var squel=require(_0x2e49('0xa'));var crypto=require(_0x2e49('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2e49('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2e49('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e49('0xe'));var logger=require('../../config/logger')(_0x2e49('0xf'));var utils=require(_0x2e49('0x10'));var config=require(_0x2e49('0x11'));var licenseUtil=require(_0x2e49('0x12'));var db=require(_0x2e49('0x13'))['db'];function respondWithStatusCode(_0x52186c,_0x5a2843){_0x5a2843=_0x5a2843||0xcc;return function(_0x21b82a){if(_0x21b82a){return _0x52186c[_0x2e49('0x14')](_0x5a2843);}return _0x52186c['status'](_0x5a2843)[_0x2e49('0x15')]();};}function respondWithResult(_0x184d73,_0x560681){_0x560681=_0x560681||0xc8;return function(_0x185726){if(_0x185726){return _0x184d73[_0x2e49('0x16')](_0x560681)[_0x2e49('0x17')](_0x185726);}};}function respondWithFilteredResult(_0x259108,_0x55d5ca){return function(_0x163ffc){if(_0x163ffc){var _0x596a09=typeof _0x55d5ca['offset']===_0x2e49('0x18')&&typeof _0x55d5ca['limit']==='undefined';var _0x237a3f=_0x163ffc[_0x2e49('0x19')];var _0x4a19e6=_0x596a09?0x0:_0x55d5ca[_0x2e49('0x1a')];var _0x253297=_0x596a09?_0x163ffc[_0x2e49('0x19')]:_0x55d5ca['offset']+_0x55d5ca[_0x2e49('0x1b')];var _0x5235be;if(_0x253297>=_0x237a3f){_0x253297=_0x237a3f;_0x5235be=0xc8;}else{_0x5235be=0xce;}_0x259108[_0x2e49('0x16')](_0x5235be);return _0x259108[_0x2e49('0x1c')](_0x2e49('0x1d'),_0x4a19e6+'-'+_0x253297+'/'+_0x237a3f)[_0x2e49('0x17')](_0x163ffc);}return null;};}function patchUpdates(_0x2c4197){return function(_0x3a7d71){try{jsonpatch['apply'](_0x3a7d71,_0x2c4197,!![]);}catch(_0x312f8f){return BPromise['reject'](_0x312f8f);}return _0x3a7d71[_0x2e49('0x1e')]();};}function saveUpdates(_0x35ddaa,_0x2cd6e2){return function(_0x1d9980){if(_0x1d9980){return _0x1d9980[_0x2e49('0x1f')](_0x35ddaa)[_0x2e49('0x20')](function(_0x3d046c){return _0x3d046c;});}return null;};}function removeEntity(_0x504613,_0x3c3d0d){return function(_0x4b197f){if(_0x4b197f){return _0x4b197f['destroy']()[_0x2e49('0x20')](function(){_0x504613[_0x2e49('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa86e,_0x4d5279){return function(_0x503b39){if(!_0x503b39){_0x5aa86e[_0x2e49('0x14')](0x194);}return _0x503b39;};}function handleError(_0x3bfb03,_0x58100f){_0x58100f=_0x58100f||0x1f4;return function(_0x24203d){logger[_0x2e49('0x21')](_0x24203d[_0x2e49('0x22')]);if(_0x24203d[_0x2e49('0x23')]){delete _0x24203d[_0x2e49('0x23')];}_0x3bfb03[_0x2e49('0x16')](_0x58100f)[_0x2e49('0x24')](_0x24203d);};}exports[_0x2e49('0x25')]=function(_0x436116,_0x39c10a){var _0x223539={},_0x2013e4={},_0x1dd2ec={'count':0x0,'rows':[]};var _0x512b64=_[_0x2e49('0x26')](db[_0x2e49('0x27')]['rawAttributes'],function(_0x4fc939){return{'name':_0x4fc939['fieldName'],'type':_0x4fc939[_0x2e49('0x28')]['key']};});_0x2013e4[_0x2e49('0x29')]=_['map'](_0x512b64,_0x2e49('0x23'));_0x2013e4[_0x2e49('0x2a')]=_[_0x2e49('0x2b')](_0x436116[_0x2e49('0x2a')]);_0x2013e4[_0x2e49('0x2c')]=_[_0x2e49('0x2d')](_0x2013e4[_0x2e49('0x29')],_0x2013e4[_0x2e49('0x2a')]);_0x223539[_0x2e49('0x2e')]=_[_0x2e49('0x2d')](_0x2013e4[_0x2e49('0x29')],qs[_0x2e49('0x2f')](_0x436116['query'][_0x2e49('0x2f')]));_0x223539[_0x2e49('0x2e')]=_0x223539[_0x2e49('0x2e')][_0x2e49('0x30')]?_0x223539['attributes']:_0x2013e4[_0x2e49('0x29')];if(!_0x436116['query'][_0x2e49('0x31')](_0x2e49('0x32'))){_0x223539[_0x2e49('0x1b')]=qs['limit'](_0x436116['query'][_0x2e49('0x1b')]);_0x223539['offset']=qs[_0x2e49('0x1a')](_0x436116[_0x2e49('0x2a')][_0x2e49('0x1a')]);}_0x223539['order']=qs['sort'](_0x436116[_0x2e49('0x2a')][_0x2e49('0x33')]);_0x223539[_0x2e49('0x34')]=qs[_0x2e49('0x2c')](_['pick'](_0x436116[_0x2e49('0x2a')],_0x2013e4[_0x2e49('0x2c')]),_0x512b64);if(_0x436116[_0x2e49('0x2a')][_0x2e49('0x35')]){_0x223539[_0x2e49('0x34')]=_[_0x2e49('0x36')](_0x223539[_0x2e49('0x34')],{'$or':_['map'](_0x512b64,function(_0x3bacda){if(_0x3bacda[_0x2e49('0x28')]!=='VIRTUAL'){var _0x339564={};_0x339564[_0x3bacda[_0x2e49('0x23')]]={'$like':'%'+_0x436116[_0x2e49('0x2a')][_0x2e49('0x35')]+'%'};return _0x339564;}})});}_0x223539=_[_0x2e49('0x36')]({},_0x223539,_0x436116[_0x2e49('0x37')]);var _0x481895={'where':_0x223539[_0x2e49('0x34')]};return db[_0x2e49('0x27')][_0x2e49('0x19')](_0x481895)['then'](function(_0x1a9d74){_0x1dd2ec['count']=_0x1a9d74;if(_0x436116['query'][_0x2e49('0x38')]){_0x223539[_0x2e49('0x39')]=[{'all':!![]}];}return db[_0x2e49('0x27')][_0x2e49('0x3a')](_0x223539);})[_0x2e49('0x20')](function(_0x13655){_0x1dd2ec[_0x2e49('0x3b')]=_0x13655;return _0x1dd2ec;})[_0x2e49('0x20')](respondWithFilteredResult(_0x39c10a,_0x223539))[_0x2e49('0x3c')](handleError(_0x39c10a,null));};exports[_0x2e49('0x3d')]=function(_0x27ab4c,_0x53d673){var _0x18dd58={'raw':!![],'where':{'id':_0x27ab4c['params']['id']}},_0x3ab2a4={};_0x3ab2a4[_0x2e49('0x29')]=_['keys'](db[_0x2e49('0x27')][_0x2e49('0x3e')]);_0x3ab2a4['query']=_['keys'](_0x27ab4c[_0x2e49('0x2a')]);_0x3ab2a4[_0x2e49('0x2c')]=_[_0x2e49('0x2d')](_0x3ab2a4[_0x2e49('0x29')],_0x3ab2a4[_0x2e49('0x2a')]);_0x18dd58[_0x2e49('0x2e')]=_['intersection'](_0x3ab2a4[_0x2e49('0x29')],qs[_0x2e49('0x2f')](_0x27ab4c[_0x2e49('0x2a')]['fields']));_0x18dd58[_0x2e49('0x2e')]=_0x18dd58[_0x2e49('0x2e')]['length']?_0x18dd58[_0x2e49('0x2e')]:_0x3ab2a4[_0x2e49('0x29')];if(_0x27ab4c[_0x2e49('0x2a')][_0x2e49('0x38')]){_0x18dd58[_0x2e49('0x39')]=[{'all':!![]}];}_0x18dd58=_[_0x2e49('0x36')]({},_0x18dd58,_0x27ab4c[_0x2e49('0x37')]);return db[_0x2e49('0x27')][_0x2e49('0x3f')](_0x18dd58)['then'](handleEntityNotFound(_0x53d673,null))[_0x2e49('0x20')](respondWithResult(_0x53d673,null))[_0x2e49('0x3c')](handleError(_0x53d673,null));};exports[_0x2e49('0x40')]=function(_0x4dbf17,_0x15c032){return db['SmsTransferReport'][_0x2e49('0x40')](_0x4dbf17['body'],{})[_0x2e49('0x20')](respondWithResult(_0x15c032,0xc9))[_0x2e49('0x3c')](handleError(_0x15c032,null));};exports[_0x2e49('0x1f')]=function(_0x2fb2f9,_0x4eca6a){if(_0x2fb2f9[_0x2e49('0x41')]['id']){delete _0x2fb2f9[_0x2e49('0x41')]['id'];}return db[_0x2e49('0x27')][_0x2e49('0x3f')]({'where':{'id':_0x2fb2f9[_0x2e49('0x42')]['id']}})[_0x2e49('0x20')](handleEntityNotFound(_0x4eca6a,null))['then'](saveUpdates(_0x2fb2f9['body'],null))[_0x2e49('0x20')](respondWithResult(_0x4eca6a,null))[_0x2e49('0x3c')](handleError(_0x4eca6a,null));};exports[_0x2e49('0x43')]=function(_0x4e9a04,_0x1ed2c4){return db[_0x2e49('0x27')][_0x2e49('0x3f')]({'where':{'id':_0x4e9a04[_0x2e49('0x42')]['id']}})[_0x2e49('0x20')](handleEntityNotFound(_0x1ed2c4,null))[_0x2e49('0x20')](removeEntity(_0x1ed2c4,null))[_0x2e49('0x3c')](handleError(_0x1ed2c4,null));};exports[_0x2e49('0x44')]=function(_0x23ce4b,_0x780955){return db['SmsTransferReport'][_0x2e49('0x44')]()['then'](respondWithResult(_0x780955,null))[_0x2e49('0x3c')](handleError(_0x780955,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e1dce8e..ccc7c4d 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 _0xc96c=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc96c,0x14a));var _0xcc96=function(_0x542f45,_0x37468a){_0x542f45=_0x542f45-0x0;var _0x38c609=_0xc96c[_0x542f45];return _0x38c609;};'use strict';var _=require('lodash');var util=require(_0xcc96('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcc96('0x1'));var BPromise=require(_0xcc96('0x2'));var rp=require(_0xcc96('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc96('0x4'));var config=require(_0xcc96('0x5'));var attributes=require(_0xcc96('0x6'));module[_0xcc96('0x7')]=function(_0x32cba9,_0x5e3ce3){return _0x32cba9['define'](_0xcc96('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xcc96('0x9'),'fields':[_0xcc96('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e1a=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2d3b71,_0xb95421){var _0x352192=function(_0x5295a3){while(--_0x5295a3){_0x2d3b71['push'](_0x2d3b71['shift']());}};_0x352192(++_0xb95421);}(_0x2e1a,0xd6));var _0xa2e1=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x2e1a[_0x485f35];return _0x2ad118;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2e1('0x0'))(_0xa2e1('0x1'));var moment=require('moment');var BPromise=require(_0xa2e1('0x2'));var rp=require(_0xa2e1('0x3'));var fs=require('fs');var path=require(_0xa2e1('0x4'));var rimraf=require(_0xa2e1('0x5'));var config=require(_0xa2e1('0x6'));var attributes=require(_0xa2e1('0x7'));module[_0xa2e1('0x8')]=function(_0x4d534c,_0x4428a9){return _0x4d534c[_0xa2e1('0x9')](_0xa2e1('0xa'),attributes,{'tableName':_0xa2e1('0xb'),'paranoid':![],'indexes':[{'name':_0xa2e1('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index bcf0c82..606e07e 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 _0x9a6b=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1e4005,_0x6d4dfc){var _0x168ca9=function(_0x902410){while(--_0x902410){_0x1e4005['push'](_0x1e4005['shift']());}};_0x168ca9(++_0x6d4dfc);}(_0x9a6b,0x77));var _0xb9a6=function(_0x471aa6,_0x5ec092){_0x471aa6=_0x471aa6-0x0;var _0x5c87b5=_0x9a6b[_0x471aa6];return _0x5c87b5;};'use strict';var _=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var moment=require(_0xb9a6('0x2'));var BPromise=require(_0xb9a6('0x3'));var rs=require(_0xb9a6('0x4'));var fs=require('fs');var Redis=require(_0xb9a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9a6('0x6'));var logger=require('../../config/logger')(_0xb9a6('0x7'));var config=require(_0xb9a6('0x8'));var jayson=require(_0xb9a6('0x9'));var client=jayson[_0xb9a6('0xa')][_0xb9a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x555d54,_0x1b85cc,_0x2afba5){return new BPromise(function(_0x15cb33,_0x301a01){return client['request'](_0x555d54,_0x2afba5)[_0xb9a6('0xc')](function(_0x451771){logger['info'](_0xb9a6('0xd'),_0x1b85cc,_0xb9a6('0xe'));logger[_0xb9a6('0xf')](_0xb9a6('0x10'),_0x1b85cc,'request\x20sent',JSON['stringify'](_0x451771));if(_0x451771['error']){if(_0x451771[_0xb9a6('0x11')]['code']===0x1f4){logger[_0xb9a6('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1b85cc,_0x451771[_0xb9a6('0x11')][_0xb9a6('0x12')]);return _0x301a01(_0x451771[_0xb9a6('0x11')][_0xb9a6('0x12')]);}logger[_0xb9a6('0x11')](_0xb9a6('0xd'),_0x1b85cc,_0x451771[_0xb9a6('0x11')][_0xb9a6('0x12')]);return _0x15cb33(_0x451771[_0xb9a6('0x11')]['message']);}else{logger[_0xb9a6('0x13')](_0xb9a6('0xd'),_0x1b85cc,_0xb9a6('0xe'));_0x15cb33(_0x451771[_0xb9a6('0x14')]['message']);}})[_0xb9a6('0x15')](function(_0x3d0516){logger[_0xb9a6('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1b85cc,_0x3d0516);_0x301a01(_0x3d0516);});});} \ No newline at end of file +var _0xc15b=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','then','info'];(function(_0x139de7,_0x5dee55){var _0x51d94c=function(_0x3e968d){while(--_0x3e968d){_0x139de7['push'](_0x139de7['shift']());}};_0x51d94c(++_0x5dee55);}(_0xc15b,0xe4));var _0xbc15=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc15b[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rs=require(_0xbc15('0x3'));var fs=require('fs');var Redis=require(_0xbc15('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc15('0x5'))(_0xbc15('0x6'));var config=require(_0xbc15('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1231f0,_0x22576c,_0x3cb4b5){return new BPromise(function(_0x50a276,_0x5c6269){return client['request'](_0x1231f0,_0x3cb4b5)[_0xbc15('0x8')](function(_0x571348){logger[_0xbc15('0x9')](_0xbc15('0xa'),_0x22576c,_0xbc15('0xb'));logger['debug'](_0xbc15('0xc'),_0x22576c,_0xbc15('0xb'),JSON['stringify'](_0x571348));if(_0x571348[_0xbc15('0xd')]){if(_0x571348[_0xbc15('0xd')][_0xbc15('0xe')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x22576c,_0x571348['error'][_0xbc15('0xf')]);return _0x5c6269(_0x571348[_0xbc15('0xd')][_0xbc15('0xf')]);}logger[_0xbc15('0xd')](_0xbc15('0xa'),_0x22576c,_0x571348[_0xbc15('0xd')][_0xbc15('0xf')]);return _0x50a276(_0x571348[_0xbc15('0xd')][_0xbc15('0xf')]);}else{logger[_0xbc15('0x9')](_0xbc15('0xa'),_0x22576c,_0xbc15('0xb'));_0x50a276(_0x571348[_0xbc15('0x10')][_0xbc15('0xf')]);}})['catch'](function(_0x41a3e9){logger['error'](_0xbc15('0xa'),_0x22576c,_0x41a3e9);_0x5c6269(_0x41a3e9);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0312eb0..a42f4bd 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 _0xec18=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','diskStorage','join','replace','%s-%s%s','basename','originalname','extname','single','file','put','delete','exports','multer','util','path'];(function(_0x360c8f,_0x4b7958){var _0x25ec55=function(_0x105a4b){while(--_0x105a4b){_0x360c8f['push'](_0x360c8f['shift']());}};_0x25ec55(++_0x4b7958);}(_0xec18,0xa5));var _0x8ec1=function(_0x26b681,_0x445dc6){_0x26b681=_0x26b681-0x0;var _0x3a8f68=_0xec18[_0x26b681];return _0x3a8f68;};'use strict';var multer=require(_0x8ec1('0x0'));var util=require(_0x8ec1('0x1'));var path=require(_0x8ec1('0x2'));var timeout=require(_0x8ec1('0x3'));var express=require('express');var router=express[_0x8ec1('0x4')]();var fs_extra=require(_0x8ec1('0x5'));var auth=require(_0x8ec1('0x6'));var interaction=require(_0x8ec1('0x7'));var config=require(_0x8ec1('0x8'));var controller=require(_0x8ec1('0x9'));router['get']('/',auth[_0x8ec1('0xa')](),controller[_0x8ec1('0xb')]);router[_0x8ec1('0xc')](_0x8ec1('0xd'),auth[_0x8ec1('0xa')](),controller[_0x8ec1('0xe')]);router['get'](_0x8ec1('0xf'),auth[_0x8ec1('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x8ec1('0x10')]({'destination':function(_0x275346,_0x3b4dc7,_0x1a41f4){_0x1a41f4(null,path[_0x8ec1('0x11')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x11c5d8,_0x3cba4f,_0x1d2e26){_0x3cba4f['originalname']=_0x3cba4f['originalname'][_0x8ec1('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d2e26(null,util['format'](_0x8ec1('0x13'),path[_0x8ec1('0x14')](_0x3cba4f[_0x8ec1('0x15')],path[_0x8ec1('0x16')](_0x3cba4f[_0x8ec1('0x15')])),Date['now'](),path[_0x8ec1('0x16')](_0x3cba4f[_0x8ec1('0x15')])));}})});router['post']('/',upload[_0x8ec1('0x17')](_0x8ec1('0x18')),controller['create']);router[_0x8ec1('0x19')](_0x8ec1('0xd'),auth[_0x8ec1('0xa')](),controller['update']);router['delete'](_0x8ec1('0xd'),auth[_0x8ec1('0xa')](),controller[_0x8ec1('0x1a')]);module[_0x8ec1('0x1b')]=router; \ No newline at end of file +var _0xcb3b=['../../config/environment','./sound.controller','get','isAuthenticated','index','show','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','put','/:id','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x22808b,_0x329b6a){var _0x42cbd2=function(_0x256a8d){while(--_0x256a8d){_0x22808b['push'](_0x22808b['shift']());}};_0x42cbd2(++_0x329b6a);}(_0xcb3b,0x12f));var _0xbcb3=function(_0x4758a7,_0x47bfed){_0x4758a7=_0x4758a7-0x0;var _0x3876d4=_0xcb3b[_0x4758a7];return _0x3876d4;};'use strict';var multer=require(_0xbcb3('0x0'));var util=require(_0xbcb3('0x1'));var path=require('path');var timeout=require(_0xbcb3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbcb3('0x3'));var auth=require(_0xbcb3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbcb3('0x5'));var controller=require(_0xbcb3('0x6'));router[_0xbcb3('0x7')]('/',auth[_0xbcb3('0x8')](),controller[_0xbcb3('0x9')]);router['get']('/:id',auth[_0xbcb3('0x8')](),controller[_0xbcb3('0xa')]);router[_0xbcb3('0x7')]('/:id/download',auth[_0xbcb3('0x8')](),controller[_0xbcb3('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f7c5c,_0x15bddf,_0x19b380){_0x19b380(null,path[_0xbcb3('0xc')](config[_0xbcb3('0xd')],_0xbcb3('0xe')));},'filename':function(_0x11372d,_0x2ca390,_0x406e6f){_0x2ca390[_0xbcb3('0xf')]=_0x2ca390[_0xbcb3('0xf')][_0xbcb3('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x406e6f(null,util[_0xbcb3('0x11')](_0xbcb3('0x12'),path[_0xbcb3('0x13')](_0x2ca390['originalname'],path['extname'](_0x2ca390[_0xbcb3('0xf')])),Date[_0xbcb3('0x14')](),path[_0xbcb3('0x15')](_0x2ca390['originalname'])));}})});router[_0xbcb3('0x16')]('/',upload[_0xbcb3('0x17')]('file'),controller['create']);router[_0xbcb3('0x18')](_0xbcb3('0x19'),auth['isAuthenticated'](),controller[_0xbcb3('0x1a')]);router[_0xbcb3('0x1b')](_0xbcb3('0x19'),auth[_0xbcb3('0x8')](),controller[_0xbcb3('0x1b')]);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 4490db5..018508d 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 _0xc5e7=['INTEGER','FLOAT','sequelize','exports','STRING','name','BIGINT'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xc5e7,0xd4));var _0x7c5e=function(_0x4e97f9,_0x5b0835){_0x4e97f9=_0x4e97f9-0x0;var _0x283896=_0xc5e7[_0x4e97f9];return _0x283896;};'use strict';var Sequelize=require(_0x7c5e('0x0'));module[_0x7c5e('0x1')]={'name':{'type':Sequelize[_0x7c5e('0x2')],'unique':_0x7c5e('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7c5e('0x2')]},'display_name':{'type':Sequelize[_0x7c5e('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x7c5e('0x2')]},'original_format':{'type':Sequelize[_0x7c5e('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x7c5e('0x4')]},'original_channelCount':{'type':Sequelize[_0x7c5e('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x7c5e('0x5')]},'converted_format':{'type':Sequelize[_0x7c5e('0x2')]},'converted_duration':{'type':Sequelize[_0x7c5e('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x7c5e('0x4')]},'converted_channelCount':{'type':Sequelize[_0x7c5e('0x5')]},'converted_bitRate':{'type':Sequelize[_0x7c5e('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x7c5e('0x5')]}}; \ No newline at end of file +var _0x8cf7=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8cf7,0x1a8));var _0x78cf=function(_0x5d9c67,_0x2b58c6){_0x5d9c67=_0x5d9c67-0x0;var _0x542a8f=_0x8cf7[_0x5d9c67];return _0x542a8f;};'use strict';var Sequelize=require(_0x78cf('0x0'));module['exports']={'name':{'type':Sequelize[_0x78cf('0x1')],'unique':_0x78cf('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x78cf('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x78cf('0x1')]},'original_format':{'type':Sequelize[_0x78cf('0x1')]},'original_duration':{'type':Sequelize[_0x78cf('0x3')]},'original_sampleCount':{'type':Sequelize[_0x78cf('0x4')]},'original_channelCount':{'type':Sequelize[_0x78cf('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x78cf('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x78cf('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x78cf('0x4')]},'converted_channelCount':{'type':Sequelize[_0x78cf('0x5')]},'converted_bitRate':{'type':Sequelize[_0x78cf('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x78cf('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 7a48ed2..194ff7c 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 _0xb45f=['unlinkSync','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','original_format','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','apply','save','then','destroy','get','Sounds','UserProfileResource','error','name','send','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Sound','includeAll','include','findAll','catch','params','length','find','existsSync','join','root','save_name','converted_format','server/files/sounds/converted','format','%s.%s','create','basename','file','extname','originalname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode'];(function(_0x44888d,_0x5e9dac){var _0x4e5509=function(_0x11f98c){while(--_0x11f98c){_0x44888d['push'](_0x44888d['shift']());}};_0x4e5509(++_0x5e9dac);}(_0xb45f,0x182));var _0xfb45=function(_0x535439,_0x301fe4){_0x535439=_0x535439-0x0;var _0x20a8cb=_0xb45f[_0x535439];return _0x20a8cb;};'use strict';var emlformat=require(_0xfb45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb45('0x1'));var jsonpatch=require(_0xfb45('0x2'));var rp=require(_0xfb45('0x3'));var moment=require('moment');var BPromise=require(_0xfb45('0x4'));var Mustache=require(_0xfb45('0x5'));var util=require(_0xfb45('0x6'));var path=require(_0xfb45('0x7'));var sox=require(_0xfb45('0x8'));var csv=require(_0xfb45('0x9'));var ejs=require(_0xfb45('0xa'));var fs=require('fs');var fs_extra=require(_0xfb45('0xb'));var _=require(_0xfb45('0xc'));var squel=require(_0xfb45('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb45('0xe'));var toCsv=require(_0xfb45('0x9'));var querystring=require(_0xfb45('0xf'));var Papa=require(_0xfb45('0x10'));var Redis=require(_0xfb45('0x11'));var authService=require(_0xfb45('0x12'));var qs=require(_0xfb45('0x13'));var as=require(_0xfb45('0x14'));var hardwareService=require(_0xfb45('0x15'));var logger=require(_0xfb45('0x16'))('api');var utils=require(_0xfb45('0x17'));var config=require(_0xfb45('0x18'));var licenseUtil=require(_0xfb45('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c1470,_0x442995){_0x442995=_0x442995||0xcc;return function(_0x39f948){if(_0x39f948){return _0x5c1470[_0xfb45('0x1a')](_0x442995);}return _0x5c1470[_0xfb45('0x1b')](_0x442995)[_0xfb45('0x1c')]();};}function respondWithResult(_0xd79f3,_0x285a35){_0x285a35=_0x285a35||0xc8;return function(_0x292ab4){if(_0x292ab4){return _0xd79f3[_0xfb45('0x1b')](_0x285a35)['json'](_0x292ab4);}};}function respondWithFilteredResult(_0x5524ff,_0x30ebdb){return function(_0x53fac2){if(_0x53fac2){var _0x396033=typeof _0x30ebdb[_0xfb45('0x1d')]===_0xfb45('0x1e')&&typeof _0x30ebdb[_0xfb45('0x1f')]===_0xfb45('0x1e');var _0x3a3e8e=_0x53fac2['count'];var _0x46ea74=_0x396033?0x0:_0x30ebdb[_0xfb45('0x1d')];var _0x203a2a=_0x396033?_0x53fac2[_0xfb45('0x20')]:_0x30ebdb[_0xfb45('0x1d')]+_0x30ebdb[_0xfb45('0x1f')];var _0xd627b1;if(_0x203a2a>=_0x3a3e8e){_0x203a2a=_0x3a3e8e;_0xd627b1=0xc8;}else{_0xd627b1=0xce;}_0x5524ff[_0xfb45('0x1b')](_0xd627b1);return _0x5524ff['set']('Content-Range',_0x46ea74+'-'+_0x203a2a+'/'+_0x3a3e8e)['json'](_0x53fac2);}return null;};}function patchUpdates(_0x3b3942){return function(_0x2af9a6){try{jsonpatch[_0xfb45('0x21')](_0x2af9a6,_0x3b3942,!![]);}catch(_0x421ca7){return BPromise['reject'](_0x421ca7);}return _0x2af9a6[_0xfb45('0x22')]();};}function saveUpdates(_0x166e87,_0x3dbacc){return function(_0x3b3dba){if(_0x3b3dba){return _0x3b3dba['update'](_0x166e87)[_0xfb45('0x23')](function(_0x380e78){return _0x380e78;});}return null;};}function removeEntity(_0xd7657a,_0x4de4d7){return function(_0xe387d1){if(_0xe387d1){return _0xe387d1[_0xfb45('0x24')]()[_0xfb45('0x23')](function(){var _0x178e99=_0xe387d1[_0xfb45('0x25')]({'plain':!![]});var _0x3f3c26=_0xfb45('0x26');return db[_0xfb45('0x27')]['destroy']({'where':{'type':_0x3f3c26,'resourceId':_0x178e99['id']}})['then'](function(){return _0xe387d1;});})['then'](function(){_0xd7657a[_0xfb45('0x1b')](0xcc)[_0xfb45('0x1c')]();});}};}function handleEntityNotFound(_0x4b2118,_0x3c2755){return function(_0x33ee5a){if(!_0x33ee5a){_0x4b2118[_0xfb45('0x1a')](0x194);}return _0x33ee5a;};}function handleError(_0x51d5a7,_0x5c2f65){_0x5c2f65=_0x5c2f65||0x1f4;return function(_0x2efd11){logger[_0xfb45('0x28')](_0x2efd11['stack']);if(_0x2efd11['name']){delete _0x2efd11[_0xfb45('0x29')];}_0x51d5a7[_0xfb45('0x1b')](_0x5c2f65)[_0xfb45('0x2a')](_0x2efd11);};}exports['index']=function(_0xf216f7,_0x3b03e4){var _0x4a5470={},_0x26e8fc={},_0x30c900={'count':0x0,'rows':[]};var _0x25256f=_[_0xfb45('0x2b')](db['Sound'][_0xfb45('0x2c')],function(_0x2d6bb0){return{'name':_0x2d6bb0['fieldName'],'type':_0x2d6bb0[_0xfb45('0x2d')][_0xfb45('0x2e')]};});_0x26e8fc['model']=_['map'](_0x25256f,_0xfb45('0x29'));_0x26e8fc['query']=_[_0xfb45('0x2f')](_0xf216f7[_0xfb45('0x30')]);_0x26e8fc[_0xfb45('0x31')]=_[_0xfb45('0x32')](_0x26e8fc[_0xfb45('0x33')],_0x26e8fc[_0xfb45('0x30')]);_0x4a5470[_0xfb45('0x34')]=_['intersection'](_0x26e8fc[_0xfb45('0x33')],qs[_0xfb45('0x35')](_0xf216f7['query'][_0xfb45('0x35')]));_0x4a5470[_0xfb45('0x34')]=_0x4a5470[_0xfb45('0x34')]['length']?_0x4a5470['attributes']:_0x26e8fc[_0xfb45('0x33')];if(!_0xf216f7[_0xfb45('0x30')]['hasOwnProperty'](_0xfb45('0x36'))){_0x4a5470[_0xfb45('0x1f')]=qs['limit'](_0xf216f7[_0xfb45('0x30')][_0xfb45('0x1f')]);_0x4a5470['offset']=qs[_0xfb45('0x1d')](_0xf216f7[_0xfb45('0x30')][_0xfb45('0x1d')]);}_0x4a5470[_0xfb45('0x37')]=qs['sort'](_0xf216f7[_0xfb45('0x30')][_0xfb45('0x38')]);_0x4a5470[_0xfb45('0x39')]=qs[_0xfb45('0x31')](_['pick'](_0xf216f7[_0xfb45('0x30')],_0x26e8fc[_0xfb45('0x31')]),_0x25256f);if(_0xf216f7[_0xfb45('0x30')]['filter']){_0x4a5470['where']=_[_0xfb45('0x3a')](_0x4a5470[_0xfb45('0x39')],{'$or':_[_0xfb45('0x2b')](_0x25256f,function(_0x9ffcdc){if(_0x9ffcdc[_0xfb45('0x2d')]!==_0xfb45('0x3b')){var _0x464744={};_0x464744[_0x9ffcdc['name']]={'$like':'%'+_0xf216f7[_0xfb45('0x30')][_0xfb45('0x3c')]+'%'};return _0x464744;}})});}_0x4a5470=_[_0xfb45('0x3a')]({},_0x4a5470,_0xf216f7[_0xfb45('0x3d')]);var _0x5ded06={'where':_0x4a5470['where']};return db[_0xfb45('0x3e')]['count'](_0x5ded06)['then'](function(_0x25e016){_0x30c900['count']=_0x25e016;if(_0xf216f7[_0xfb45('0x30')][_0xfb45('0x3f')]){_0x4a5470[_0xfb45('0x40')]=[{'all':!![]}];}return db[_0xfb45('0x3e')][_0xfb45('0x41')](_0x4a5470);})['then'](function(_0x45312b){_0x30c900['rows']=_0x45312b;return _0x30c900;})[_0xfb45('0x23')](respondWithFilteredResult(_0x3b03e4,_0x4a5470))[_0xfb45('0x42')](handleError(_0x3b03e4,null));};exports['show']=function(_0x18c27c,_0x4b788e){var _0x587862={'raw':!![],'where':{'id':_0x18c27c[_0xfb45('0x43')]['id']}},_0x2f3776={};_0x2f3776['model']=_[_0xfb45('0x2f')](db['Sound']['rawAttributes']);_0x2f3776[_0xfb45('0x30')]=_['keys'](_0x18c27c[_0xfb45('0x30')]);_0x2f3776[_0xfb45('0x31')]=_[_0xfb45('0x32')](_0x2f3776[_0xfb45('0x33')],_0x2f3776[_0xfb45('0x30')]);_0x587862[_0xfb45('0x34')]=_['intersection'](_0x2f3776[_0xfb45('0x33')],qs[_0xfb45('0x35')](_0x18c27c[_0xfb45('0x30')][_0xfb45('0x35')]));_0x587862[_0xfb45('0x34')]=_0x587862[_0xfb45('0x34')][_0xfb45('0x44')]?_0x587862[_0xfb45('0x34')]:_0x2f3776[_0xfb45('0x33')];if(_0x18c27c['query']['includeAll']){_0x587862[_0xfb45('0x40')]=[{'all':!![]}];}_0x587862=_[_0xfb45('0x3a')]({},_0x587862,_0x18c27c['options']);return db['Sound'][_0xfb45('0x45')](_0x587862)[_0xfb45('0x23')](handleEntityNotFound(_0x4b788e,null))['then'](respondWithResult(_0x4b788e,null))['catch'](handleError(_0x4b788e,null));};exports['download']=function(_0x1a37c4,_0x3c6f53,_0x320fc1){return db['Sound']['find']({'where':{'id':_0x1a37c4[_0xfb45('0x43')]['id']},'attributes':[_0xfb45('0x29'),'save_name','converted_format'],'raw':!![]})[_0xfb45('0x23')](handleEntityNotFound(_0x3c6f53,null))[_0xfb45('0x23')](function(_0x1d345a){if(_0x1d345a){if(!fs[_0xfb45('0x46')](path[_0xfb45('0x47')](config[_0xfb45('0x48')],'server/files/sounds/converted',_0x1d345a[_0xfb45('0x49')]+'.'+_0x1d345a[_0xfb45('0x4a')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x3c6f53['download'](path['join'](config[_0xfb45('0x48')],_0xfb45('0x4b'),util[_0xfb45('0x4c')](_0xfb45('0x4d'),_0x1d345a[_0xfb45('0x49')],_0x1d345a['converted_format'])),util[_0xfb45('0x4c')](_0xfb45('0x4d'),_0x1d345a[_0xfb45('0x29')],_0x1d345a[_0xfb45('0x4a')]));}return null;})[_0xfb45('0x42')](handleError(_0x3c6f53,null));};exports[_0xfb45('0x4e')]=function(_0x3b0b03,_0x396a26,_0x28f765){var _0x17670c={'name':path[_0xfb45('0x4f')](_0x3b0b03[_0xfb45('0x50')]['originalname'],path[_0xfb45('0x51')](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x52')])),'save_name':path[_0xfb45('0x4f')](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x53')],path[_0xfb45('0x51')](_0x3b0b03['file'][_0xfb45('0x53')])),'original_format':path['extname'](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x52')])['substring'](0x1),'converted_format':_0xfb45('0x54')};var _0x7aaaa8=path[_0xfb45('0x47')](config[_0xfb45('0x48')],_0xfb45('0x55'),_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x53')]);var _0x5cded3=path['join'](config[_0xfb45('0x48')],'server/files/sounds/converted',util['format'](_0xfb45('0x4d'),path[_0xfb45('0x4f')](_0x3b0b03[_0xfb45('0x50')][_0xfb45('0x53')],path['extname'](_0x3b0b03['file']['filename'])),_0x17670c[_0xfb45('0x4a')]));logger[_0xfb45('0x56')](_0xfb45('0x57'),_0x7aaaa8);logger[_0xfb45('0x56')]('Sound\x20upload\x20destination:\x20%s',_0x5cded3);try{fs['chmodSync'](_0x7aaaa8,parseInt(_0xfb45('0x58'),0x8));var _0x1fc5a8=sox[_0xfb45('0x59')](_0x7aaaa8,_0x5cded3,{'sampleRate':0x1f40,'format':_0xfb45('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1fc5a8['on'](_0xfb45('0x28'),function(_0x58b606){fs[_0xfb45('0x5a')](_0x7aaaa8);_0x396a26[_0xfb45('0x1b')](0x1f4)[_0xfb45('0x2a')](_0x58b606);});_0x1fc5a8['on']('src',function(_0xc79105){_0x17670c['original_duration']=isNaN(_0xc79105[_0xfb45('0x5b')])?null:_0xc79105[_0xfb45('0x5b')]*0x3e8;_0x17670c[_0xfb45('0x5c')]=isNaN(_0xc79105['sampleCount'])?null:_0xc79105['sampleCount'];_0x17670c[_0xfb45('0x5d')]=isNaN(_0xc79105[_0xfb45('0x5e')])?null:_0xc79105[_0xfb45('0x5e')];_0x17670c[_0xfb45('0x5f')]=isNaN(_0xc79105['bitRate'])?null:_0xc79105[_0xfb45('0x60')];_0x17670c[_0xfb45('0x61')]=isNaN(_0xc79105[_0xfb45('0x62')])?null:_0xc79105[_0xfb45('0x62')];});_0x1fc5a8['on'](_0xfb45('0x63'),function(_0xc44681){_0x17670c[_0xfb45('0x64')]=isNaN(_0xc44681[_0xfb45('0x5b')])?null:_0xc44681[_0xfb45('0x5b')]*0x3e8;_0x17670c[_0xfb45('0x65')]=isNaN(_0xc44681['sampleCount'])?null:_0xc44681[_0xfb45('0x66')];_0x17670c[_0xfb45('0x67')]=isNaN(_0xc44681['channelCount'])?null:_0xc44681[_0xfb45('0x5e')];_0x17670c[_0xfb45('0x68')]=isNaN(_0xc44681[_0xfb45('0x60')])?null:_0xc44681[_0xfb45('0x60')];_0x17670c['converted_sampleRate']=isNaN(_0xc44681[_0xfb45('0x62')])?null:_0xc44681[_0xfb45('0x62')];});_0x1fc5a8['on'](_0xfb45('0x1c'),function(){fs[_0xfb45('0x69')](_0x5cded3,parseInt('0777',0x8));return db[_0xfb45('0x3e')][_0xfb45('0x4e')](_0x17670c)[_0xfb45('0x23')](function(_0x27ae89){var _0x1396c8={'role':_0x3b0b03[_0xfb45('0x6a')][_0xfb45('0x6b')],'userProfileId':_0x3b0b03[_0xfb45('0x6a')][_0xfb45('0x6c')]};if(!_0x1396c8)throw new Error(_0xfb45('0x6d'));if(_0x1396c8['role']===_0xfb45('0x6e')){var _0x527dbf=_0x27ae89[_0xfb45('0x25')]({'plain':!![]});return db[_0xfb45('0x6f')][_0xfb45('0x45')]({'where':{'name':'Sounds','userProfileId':_0x1396c8[_0xfb45('0x6c')]},'raw':!![]})['then'](function(_0x505428){if(_0x505428&&_0x505428[_0xfb45('0x70')]===0x0){return db[_0xfb45('0x27')][_0xfb45('0x4e')]({'name':_0x527dbf[_0xfb45('0x29')],'resourceId':_0x527dbf['id'],'type':_0x505428['name'],'sectionId':_0x505428['id']},{})[_0xfb45('0x23')](function(){return _0x27ae89;});}else{return _0x27ae89;}})['catch'](function(_0x1f0c13){logger['error'](_0xfb45('0x71'),_0x1f0c13);throw _0x1f0c13;});}return _0x27ae89;})[_0xfb45('0x23')](respondWithResult(_0x396a26,null))['catch'](handleError(_0x396a26,null));});_0x1fc5a8[_0xfb45('0x72')]();}catch(_0x3abc61){_0x396a26[_0xfb45('0x1b')](0x1f4)[_0xfb45('0x2a')](_0x3abc61);}};exports[_0xfb45('0x73')]=function(_0x18ce5c,_0x260a5b,_0x59a456){return db[_0xfb45('0x3e')][_0xfb45('0x45')]({'where':{'id':_0x18ce5c[_0xfb45('0x43')]['id']}})[_0xfb45('0x23')](handleEntityNotFound(_0x260a5b,null))[_0xfb45('0x23')](saveUpdates(_[_0xfb45('0x74')](_0x18ce5c[_0xfb45('0x6a')],[_0xfb45('0x29'),_0xfb45('0x75')]),null))[_0xfb45('0x23')](respondWithResult(_0x260a5b,null))[_0xfb45('0x42')](handleError(_0x260a5b,null));};exports['delete']=function(_0xeb8d61,_0x1c6be3,_0x4339cf){return db['Sound'][_0xfb45('0x45')]({'where':{'id':_0xeb8d61[_0xfb45('0x43')]['id']}})['then'](function(_0x342940){if(_0x342940){return _0x342940[_0xfb45('0x24')]();}})[_0xfb45('0x23')](function(_0x3ce998){var _0x424ee8=path['join'](config[_0xfb45('0x48')],_0xfb45('0x55'),util[_0xfb45('0x4c')]('%s.%s',_0x3ce998[_0xfb45('0x49')],_0x3ce998[_0xfb45('0x76')]));var _0x44540b=path[_0xfb45('0x47')](config[_0xfb45('0x48')],'server/files/sounds/converted',util[_0xfb45('0x4c')](_0xfb45('0x4d'),_0x3ce998[_0xfb45('0x49')],_0x3ce998[_0xfb45('0x4a')]));fs[_0xfb45('0x5a')](_0x424ee8);fs[_0xfb45('0x5a')](_0x44540b);return _0x3ce998;})[_0xfb45('0x23')](function(_0x13927a){if(_0x13927a){return _0x1c6be3[_0xfb45('0x1b')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x1c6be3,null))[_0xfb45('0x42')](handleError(_0x1c6be3,null));}; \ No newline at end of file +var _0xcafa=['api','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','Sounds','end','sendStatus','error','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','Sound','includeAll','include','findAll','rows','catch','show','params','rawAttributes','download','find','save_name','converted_format','join','root','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','server/files/sounds/converted','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','destroy','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4555b1,_0x27e831){var _0x3a08b1=function(_0x5cc68a){while(--_0x5cc68a){_0x4555b1['push'](_0x4555b1['shift']());}};_0x3a08b1(++_0x27e831);}(_0xcafa,0x68));var _0xacaf=function(_0x2ce75a,_0x2471fa){_0x2ce75a=_0x2ce75a-0x0;var _0x5b3d3b=_0xcafa[_0x2ce75a];return _0x5b3d3b;};'use strict';var emlformat=require(_0xacaf('0x0'));var rimraf=require(_0xacaf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacaf('0x2'));var rp=require(_0xacaf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xacaf('0x4'));var util=require(_0xacaf('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xacaf('0x6'));var ejs=require(_0xacaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xacaf('0x8'));var crypto=require(_0xacaf('0x9'));var jsforce=require(_0xacaf('0xa'));var deskjs=require(_0xacaf('0xb'));var toCsv=require(_0xacaf('0x6'));var querystring=require(_0xacaf('0xc'));var Papa=require(_0xacaf('0xd'));var Redis=require(_0xacaf('0xe'));var authService=require(_0xacaf('0xf'));var qs=require(_0xacaf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacaf('0x11'));var logger=require(_0xacaf('0x12'))(_0xacaf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xacaf('0x14'))['db'];function respondWithStatusCode(_0x51bf04,_0x14a979){_0x14a979=_0x14a979||0xcc;return function(_0x3b6e62){if(_0x3b6e62){return _0x51bf04['sendStatus'](_0x14a979);}return _0x51bf04[_0xacaf('0x15')](_0x14a979)['end']();};}function respondWithResult(_0x7d72b0,_0x11617f){_0x11617f=_0x11617f||0xc8;return function(_0x2fe0b8){if(_0x2fe0b8){return _0x7d72b0['status'](_0x11617f)[_0xacaf('0x16')](_0x2fe0b8);}};}function respondWithFilteredResult(_0x53327d,_0x202fb4){return function(_0x4c0c71){if(_0x4c0c71){var _0x294cd8=typeof _0x202fb4[_0xacaf('0x17')]==='undefined'&&typeof _0x202fb4[_0xacaf('0x18')]===_0xacaf('0x19');var _0x4585a1=_0x4c0c71[_0xacaf('0x1a')];var _0x28397c=_0x294cd8?0x0:_0x202fb4[_0xacaf('0x17')];var _0x8342f4=_0x294cd8?_0x4c0c71[_0xacaf('0x1a')]:_0x202fb4[_0xacaf('0x17')]+_0x202fb4[_0xacaf('0x18')];var _0x3a1ece;if(_0x8342f4>=_0x4585a1){_0x8342f4=_0x4585a1;_0x3a1ece=0xc8;}else{_0x3a1ece=0xce;}_0x53327d[_0xacaf('0x15')](_0x3a1ece);return _0x53327d[_0xacaf('0x1b')](_0xacaf('0x1c'),_0x28397c+'-'+_0x8342f4+'/'+_0x4585a1)[_0xacaf('0x16')](_0x4c0c71);}return null;};}function patchUpdates(_0x4c5ef4){return function(_0x34e39f){try{jsonpatch[_0xacaf('0x1d')](_0x34e39f,_0x4c5ef4,!![]);}catch(_0x1d7561){return BPromise['reject'](_0x1d7561);}return _0x34e39f[_0xacaf('0x1e')]();};}function saveUpdates(_0x1224ce,_0x2f2666){return function(_0x37cb28){if(_0x37cb28){return _0x37cb28[_0xacaf('0x1f')](_0x1224ce)[_0xacaf('0x20')](function(_0x55abfc){return _0x55abfc;});}return null;};}function removeEntity(_0xe06244,_0x503d2){return function(_0x998e27){if(_0x998e27){return _0x998e27['destroy']()[_0xacaf('0x20')](function(){var _0x1a3fa4=_0x998e27[_0xacaf('0x21')]({'plain':!![]});var _0x599884=_0xacaf('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x599884,'resourceId':_0x1a3fa4['id']}})[_0xacaf('0x20')](function(){return _0x998e27;});})[_0xacaf('0x20')](function(){_0xe06244[_0xacaf('0x15')](0xcc)[_0xacaf('0x23')]();});}};}function handleEntityNotFound(_0x2eb9bd,_0x468a4f){return function(_0x29f1a3){if(!_0x29f1a3){_0x2eb9bd[_0xacaf('0x24')](0x194);}return _0x29f1a3;};}function handleError(_0x2246f8,_0x32fd55){_0x32fd55=_0x32fd55||0x1f4;return function(_0x1e6982){logger[_0xacaf('0x25')](_0x1e6982[_0xacaf('0x26')]);if(_0x1e6982[_0xacaf('0x27')]){delete _0x1e6982[_0xacaf('0x27')];}_0x2246f8[_0xacaf('0x15')](_0x32fd55)[_0xacaf('0x28')](_0x1e6982);};}exports[_0xacaf('0x29')]=function(_0x322a4f,_0x68b964){var _0x4c03cb={},_0x7d61={},_0x59f930={'count':0x0,'rows':[]};var _0x23fd56=_[_0xacaf('0x2a')](db['Sound']['rawAttributes'],function(_0x34091c){return{'name':_0x34091c['fieldName'],'type':_0x34091c[_0xacaf('0x2b')][_0xacaf('0x2c')]};});_0x7d61['model']=_[_0xacaf('0x2a')](_0x23fd56,_0xacaf('0x27'));_0x7d61[_0xacaf('0x2d')]=_[_0xacaf('0x2e')](_0x322a4f[_0xacaf('0x2d')]);_0x7d61[_0xacaf('0x2f')]=_[_0xacaf('0x30')](_0x7d61[_0xacaf('0x31')],_0x7d61['query']);_0x4c03cb[_0xacaf('0x32')]=_[_0xacaf('0x30')](_0x7d61[_0xacaf('0x31')],qs[_0xacaf('0x33')](_0x322a4f[_0xacaf('0x2d')][_0xacaf('0x33')]));_0x4c03cb[_0xacaf('0x32')]=_0x4c03cb[_0xacaf('0x32')][_0xacaf('0x34')]?_0x4c03cb[_0xacaf('0x32')]:_0x7d61['model'];if(!_0x322a4f[_0xacaf('0x2d')][_0xacaf('0x35')](_0xacaf('0x36'))){_0x4c03cb[_0xacaf('0x18')]=qs[_0xacaf('0x18')](_0x322a4f[_0xacaf('0x2d')][_0xacaf('0x18')]);_0x4c03cb[_0xacaf('0x17')]=qs[_0xacaf('0x17')](_0x322a4f[_0xacaf('0x2d')]['offset']);}_0x4c03cb[_0xacaf('0x37')]=qs['sort'](_0x322a4f['query'][_0xacaf('0x38')]);_0x4c03cb['where']=qs[_0xacaf('0x2f')](_['pick'](_0x322a4f[_0xacaf('0x2d')],_0x7d61['filters']),_0x23fd56);if(_0x322a4f['query'][_0xacaf('0x39')]){_0x4c03cb[_0xacaf('0x3a')]=_[_0xacaf('0x3b')](_0x4c03cb[_0xacaf('0x3a')],{'$or':_['map'](_0x23fd56,function(_0x3bf393){if(_0x3bf393[_0xacaf('0x2b')]!=='VIRTUAL'){var _0x389f41={};_0x389f41[_0x3bf393[_0xacaf('0x27')]]={'$like':'%'+_0x322a4f[_0xacaf('0x2d')][_0xacaf('0x39')]+'%'};return _0x389f41;}})});}_0x4c03cb=_[_0xacaf('0x3b')]({},_0x4c03cb,_0x322a4f[_0xacaf('0x3c')]);var _0x11a4a8={'where':_0x4c03cb[_0xacaf('0x3a')]};return db[_0xacaf('0x3d')][_0xacaf('0x1a')](_0x11a4a8)[_0xacaf('0x20')](function(_0x3393df){_0x59f930[_0xacaf('0x1a')]=_0x3393df;if(_0x322a4f[_0xacaf('0x2d')][_0xacaf('0x3e')]){_0x4c03cb[_0xacaf('0x3f')]=[{'all':!![]}];}return db[_0xacaf('0x3d')][_0xacaf('0x40')](_0x4c03cb);})[_0xacaf('0x20')](function(_0x4cfbb3){_0x59f930[_0xacaf('0x41')]=_0x4cfbb3;return _0x59f930;})[_0xacaf('0x20')](respondWithFilteredResult(_0x68b964,_0x4c03cb))[_0xacaf('0x42')](handleError(_0x68b964,null));};exports[_0xacaf('0x43')]=function(_0x4a99af,_0x1904d8){var _0x3079e0={'raw':!![],'where':{'id':_0x4a99af[_0xacaf('0x44')]['id']}},_0x477f0e={};_0x477f0e[_0xacaf('0x31')]=_[_0xacaf('0x2e')](db[_0xacaf('0x3d')][_0xacaf('0x45')]);_0x477f0e[_0xacaf('0x2d')]=_[_0xacaf('0x2e')](_0x4a99af[_0xacaf('0x2d')]);_0x477f0e[_0xacaf('0x2f')]=_[_0xacaf('0x30')](_0x477f0e['model'],_0x477f0e['query']);_0x3079e0[_0xacaf('0x32')]=_[_0xacaf('0x30')](_0x477f0e[_0xacaf('0x31')],qs['fields'](_0x4a99af['query'][_0xacaf('0x33')]));_0x3079e0['attributes']=_0x3079e0[_0xacaf('0x32')][_0xacaf('0x34')]?_0x3079e0['attributes']:_0x477f0e[_0xacaf('0x31')];if(_0x4a99af[_0xacaf('0x2d')][_0xacaf('0x3e')]){_0x3079e0[_0xacaf('0x3f')]=[{'all':!![]}];}_0x3079e0=_[_0xacaf('0x3b')]({},_0x3079e0,_0x4a99af[_0xacaf('0x3c')]);return db['Sound']['find'](_0x3079e0)[_0xacaf('0x20')](handleEntityNotFound(_0x1904d8,null))[_0xacaf('0x20')](respondWithResult(_0x1904d8,null))[_0xacaf('0x42')](handleError(_0x1904d8,null));};exports[_0xacaf('0x46')]=function(_0x35e12a,_0x557482,_0x11f254){return db['Sound'][_0xacaf('0x47')]({'where':{'id':_0x35e12a['params']['id']},'attributes':['name',_0xacaf('0x48'),_0xacaf('0x49')],'raw':!![]})[_0xacaf('0x20')](handleEntityNotFound(_0x557482,null))['then'](function(_0x1c395e){if(_0x1c395e){if(!fs['existsSync'](path[_0xacaf('0x4a')](config[_0xacaf('0x4b')],'server/files/sounds/converted',_0x1c395e['save_name']+'.'+_0x1c395e[_0xacaf('0x49')]))){throw new db[(_0xacaf('0x4c'))][(_0xacaf('0x4d'))](_0xacaf('0x4e'));}return _0x557482['download'](path[_0xacaf('0x4a')](config['root'],'server/files/sounds/converted',util['format'](_0xacaf('0x4f'),_0x1c395e[_0xacaf('0x48')],_0x1c395e[_0xacaf('0x49')])),util[_0xacaf('0x50')](_0xacaf('0x4f'),_0x1c395e['name'],_0x1c395e['converted_format']));}return null;})['catch'](handleError(_0x557482,null));};exports[_0xacaf('0x51')]=function(_0x61c066,_0x5ba1f7,_0xebbafd){var _0x3171b2={'name':path[_0xacaf('0x52')](_0x61c066[_0xacaf('0x53')]['originalname'],path[_0xacaf('0x54')](_0x61c066[_0xacaf('0x53')][_0xacaf('0x55')])),'save_name':path['basename'](_0x61c066['file'][_0xacaf('0x56')],path[_0xacaf('0x54')](_0x61c066['file']['filename'])),'original_format':path[_0xacaf('0x54')](_0x61c066[_0xacaf('0x53')]['originalname'])[_0xacaf('0x57')](0x1),'converted_format':_0xacaf('0x58')};var _0x44fa31=path['join'](config[_0xacaf('0x4b')],_0xacaf('0x59'),_0x61c066[_0xacaf('0x53')][_0xacaf('0x56')]);var _0x82e1f9=path[_0xacaf('0x4a')](config[_0xacaf('0x4b')],_0xacaf('0x5a'),util[_0xacaf('0x50')]('%s.%s',path['basename'](_0x61c066['file'][_0xacaf('0x56')],path[_0xacaf('0x54')](_0x61c066[_0xacaf('0x53')][_0xacaf('0x56')])),_0x3171b2[_0xacaf('0x49')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x44fa31);logger[_0xacaf('0x5b')](_0xacaf('0x5c'),_0x82e1f9);try{fs[_0xacaf('0x5d')](_0x44fa31,parseInt(_0xacaf('0x5e'),0x8));var _0x407380=sox[_0xacaf('0x5f')](_0x44fa31,_0x82e1f9,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x407380['on'](_0xacaf('0x25'),function(_0x440536){fs[_0xacaf('0x60')](_0x44fa31);_0x5ba1f7[_0xacaf('0x15')](0x1f4)[_0xacaf('0x28')](_0x440536);});_0x407380['on'](_0xacaf('0x61'),function(_0x50d32b){_0x3171b2[_0xacaf('0x62')]=isNaN(_0x50d32b[_0xacaf('0x63')])?null:_0x50d32b[_0xacaf('0x63')]*0x3e8;_0x3171b2[_0xacaf('0x64')]=isNaN(_0x50d32b[_0xacaf('0x65')])?null:_0x50d32b[_0xacaf('0x65')];_0x3171b2[_0xacaf('0x66')]=isNaN(_0x50d32b[_0xacaf('0x67')])?null:_0x50d32b['channelCount'];_0x3171b2[_0xacaf('0x68')]=isNaN(_0x50d32b[_0xacaf('0x69')])?null:_0x50d32b[_0xacaf('0x69')];_0x3171b2[_0xacaf('0x6a')]=isNaN(_0x50d32b[_0xacaf('0x6b')])?null:_0x50d32b['sampleRate'];});_0x407380['on'](_0xacaf('0x6c'),function(_0x14c148){_0x3171b2[_0xacaf('0x6d')]=isNaN(_0x14c148[_0xacaf('0x63')])?null:_0x14c148[_0xacaf('0x63')]*0x3e8;_0x3171b2['converted_sampleCount']=isNaN(_0x14c148[_0xacaf('0x65')])?null:_0x14c148[_0xacaf('0x65')];_0x3171b2[_0xacaf('0x6e')]=isNaN(_0x14c148[_0xacaf('0x67')])?null:_0x14c148[_0xacaf('0x67')];_0x3171b2[_0xacaf('0x6f')]=isNaN(_0x14c148[_0xacaf('0x69')])?null:_0x14c148[_0xacaf('0x69')];_0x3171b2['converted_sampleRate']=isNaN(_0x14c148[_0xacaf('0x6b')])?null:_0x14c148[_0xacaf('0x6b')];});_0x407380['on'](_0xacaf('0x23'),function(){fs[_0xacaf('0x5d')](_0x82e1f9,parseInt('0777',0x8));return db[_0xacaf('0x3d')][_0xacaf('0x51')](_0x3171b2)[_0xacaf('0x20')](function(_0x2e3a66){var _0x508cea={'role':_0x61c066[_0xacaf('0x70')][_0xacaf('0x71')],'userProfileId':_0x61c066[_0xacaf('0x70')][_0xacaf('0x72')]};if(!_0x508cea)throw new Error(_0xacaf('0x73'));if(_0x508cea[_0xacaf('0x71')]==='user'){var _0x43c4b9=_0x2e3a66[_0xacaf('0x21')]({'plain':!![]});return db['UserProfileSection'][_0xacaf('0x47')]({'where':{'name':_0xacaf('0x22'),'userProfileId':_0x508cea['userProfileId']},'raw':!![]})[_0xacaf('0x20')](function(_0x49d7fe){if(_0x49d7fe&&_0x49d7fe[_0xacaf('0x74')]===0x0){return db[_0xacaf('0x75')][_0xacaf('0x51')]({'name':_0x43c4b9['name'],'resourceId':_0x43c4b9['id'],'type':_0x49d7fe[_0xacaf('0x27')],'sectionId':_0x49d7fe['id']},{})[_0xacaf('0x20')](function(){return _0x2e3a66;});}else{return _0x2e3a66;}})[_0xacaf('0x42')](function(_0x38db56){logger[_0xacaf('0x25')](_0xacaf('0x76'),_0x38db56);throw _0x38db56;});}return _0x2e3a66;})[_0xacaf('0x20')](respondWithResult(_0x5ba1f7,null))['catch'](handleError(_0x5ba1f7,null));});_0x407380[_0xacaf('0x77')]();}catch(_0x3eb9c4){_0x5ba1f7[_0xacaf('0x15')](0x1f4)[_0xacaf('0x28')](_0x3eb9c4);}};exports[_0xacaf('0x1f')]=function(_0x38f321,_0x6ad40a,_0x37d7b2){return db[_0xacaf('0x3d')][_0xacaf('0x47')]({'where':{'id':_0x38f321['params']['id']}})['then'](handleEntityNotFound(_0x6ad40a,null))['then'](saveUpdates(_[_0xacaf('0x78')](_0x38f321[_0xacaf('0x70')],[_0xacaf('0x27'),_0xacaf('0x79')]),null))[_0xacaf('0x20')](respondWithResult(_0x6ad40a,null))[_0xacaf('0x42')](handleError(_0x6ad40a,null));};exports['delete']=function(_0x3481ba,_0xb6678,_0x5f112c){return db[_0xacaf('0x3d')][_0xacaf('0x47')]({'where':{'id':_0x3481ba[_0xacaf('0x44')]['id']}})['then'](function(_0x1086f6){if(_0x1086f6){return _0x1086f6[_0xacaf('0x7a')]();}})[_0xacaf('0x20')](function(_0x2de37d){var _0x564c55=path[_0xacaf('0x4a')](config['root'],_0xacaf('0x59'),util[_0xacaf('0x50')](_0xacaf('0x4f'),_0x2de37d['save_name'],_0x2de37d['original_format']));var _0x18755b=path[_0xacaf('0x4a')](config[_0xacaf('0x4b')],_0xacaf('0x5a'),util[_0xacaf('0x50')](_0xacaf('0x4f'),_0x2de37d['save_name'],_0x2de37d['converted_format']));fs[_0xacaf('0x60')](_0x564c55);fs[_0xacaf('0x60')](_0x18755b);return _0x2de37d;})[_0xacaf('0x20')](function(_0x4cccbc){if(_0x4cccbc){return _0xb6678[_0xacaf('0x15')](0xcc)[_0xacaf('0x23')]();}})[_0xacaf('0x20')](handleEntityNotFound(_0xb6678,null))[_0xacaf('0x42')](handleError(_0xb6678,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 7551cf2..d87994a 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 _0x12c9=['util','../../config/logger','api','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x12c9,0x113));var _0x912c=function(_0x704082,_0x2649c4){_0x704082=_0x704082-0x0;var _0x6a0d9c=_0x12c9[_0x704082];return _0x6a0d9c;};'use strict';var _=require('lodash');var util=require(_0x912c('0x0'));var logger=require(_0x912c('0x1'))(_0x912c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x912c('0x3'));var rimraf=require(_0x912c('0x4'));var config=require(_0x912c('0x5'));var attributes=require(_0x912c('0x6'));module[_0x912c('0x7')]=function(_0x4c57ac,_0x2493e4){return _0x4c57ac[_0x912c('0x8')](_0x912c('0x9'),attributes,{'tableName':_0x912c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01d2=['rimraf','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x6abd55,_0x2ccc21){var _0x212484=function(_0x16bcbf){while(--_0x16bcbf){_0x6abd55['push'](_0x6abd55['shift']());}};_0x212484(++_0x2ccc21);}(_0x01d2,0x9b));var _0x201d=function(_0x1dd75e,_0x471222){_0x1dd75e=_0x1dd75e-0x0;var _0x10981b=_0x01d2[_0x1dd75e];return _0x10981b;};'use strict';var _=require(_0x201d('0x0'));var util=require('util');var logger=require(_0x201d('0x1'))(_0x201d('0x2'));var moment=require('moment');var BPromise=require(_0x201d('0x3'));var rp=require(_0x201d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x201d('0x5'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x201d('0x6')]=function(_0x10e90d,_0x1c271b){return _0x10e90d[_0x201d('0x7')](_0x201d('0x8'),attributes,{'tableName':_0x201d('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 b7acbe8..f18979b 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 _0xe5e9=['raw','include','map','model','attributes','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound','find','options'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0xe5e9,0x126));var _0x9e5e=function(_0x161341,_0x1c054d){_0x161341=_0x161341-0x0;var _0x5e06c3=_0xe5e9[_0x161341];return _0x5e06c3;};'use strict';var _=require(_0x9e5e('0x0'));var util=require(_0x9e5e('0x1'));var moment=require(_0x9e5e('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e5e('0x3'));var fs=require('fs');var Redis=require(_0x9e5e('0x4'));var db=require(_0x9e5e('0x5'))['db'];var utils=require(_0x9e5e('0x6'));var logger=require(_0x9e5e('0x7'))(_0x9e5e('0x8'));var config=require(_0x9e5e('0x9'));var jayson=require(_0x9e5e('0xa'));var client=jayson[_0x9e5e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c9b2c,_0x44d1bd,_0x1cbd8b){return new BPromise(function(_0x5c83b6,_0x35da5d){return client[_0x9e5e('0xc')](_0x5c9b2c,_0x1cbd8b)['then'](function(_0x5c7583){logger[_0x9e5e('0xd')](_0x9e5e('0xe'),_0x44d1bd,'request\x20sent');logger[_0x9e5e('0xf')](_0x9e5e('0x10'),_0x44d1bd,_0x9e5e('0x11'),JSON[_0x9e5e('0x12')](_0x5c7583));if(_0x5c7583[_0x9e5e('0x13')]){if(_0x5c7583[_0x9e5e('0x13')]['code']===0x1f4){logger['error'](_0x9e5e('0xe'),_0x44d1bd,_0x5c7583[_0x9e5e('0x13')][_0x9e5e('0x14')]);return _0x35da5d(_0x5c7583[_0x9e5e('0x13')][_0x9e5e('0x14')]);}logger[_0x9e5e('0x13')](_0x9e5e('0xe'),_0x44d1bd,_0x5c7583['error']['message']);return _0x5c83b6(_0x5c7583['error']['message']);}else{logger['info'](_0x9e5e('0xe'),_0x44d1bd,'request\x20sent');_0x5c83b6(_0x5c7583[_0x9e5e('0x15')][_0x9e5e('0x14')]);}})[_0x9e5e('0x16')](function(_0x28a4ed){logger['error'](_0x9e5e('0xe'),_0x44d1bd,_0x28a4ed);_0x35da5d(_0x28a4ed);});});}exports[_0x9e5e('0x17')]=function(_0x44808d){var _0x1b16db=this;return new Promise(function(_0x41bd27,_0x280545){return db['Sound'][_0x9e5e('0x18')]({'raw':_0x44808d[_0x9e5e('0x19')]?_0x44808d['options'][_0x9e5e('0x1a')]===undefined?!![]:![]:!![],'where':_0x44808d[_0x9e5e('0x19')]?_0x44808d[_0x9e5e('0x19')]['where']||null:null,'attributes':_0x44808d['options']?_0x44808d['options']['attributes']||null:null,'include':_0x44808d[_0x9e5e('0x19')]?_0x44808d[_0x9e5e('0x19')][_0x9e5e('0x1b')]?_[_0x9e5e('0x1c')](_0x44808d['options'][_0x9e5e('0x1b')],function(_0x7e125c){return{'model':db[_0x7e125c[_0x9e5e('0x1d')]],'as':_0x7e125c['as'],'attributes':_0x7e125c[_0x9e5e('0x1e')],'include':_0x7e125c[_0x9e5e('0x1b')]?_[_0x9e5e('0x1c')](_0x7e125c[_0x9e5e('0x1b')],function(_0x5838ac){return{'model':db[_0x5838ac[_0x9e5e('0x1d')]],'as':_0x5838ac['as'],'attributes':_0x5838ac[_0x9e5e('0x1e')],'include':_0x5838ac['include']?_['map'](_0x5838ac['include'],function(_0x31ed2c){return{'model':db[_0x31ed2c['model']],'as':_0x31ed2c['as'],'attributes':_0x31ed2c[_0x9e5e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9e5e('0x1f')](function(_0x350761){logger['info'](_0x9e5e('0x17'),_0x44808d);logger[_0x9e5e('0xf')](_0x9e5e('0x17'),_0x44808d,JSON[_0x9e5e('0x12')](_0x350761));_0x41bd27(_0x350761);})['catch'](function(_0x577f3d){logger[_0x9e5e('0x13')](_0x9e5e('0x17'),_0x577f3d[_0x9e5e('0x14')],_0x44808d);_0x280545(_0x1b16db['error'](0x1f4,_0x577f3d[_0x9e5e('0x14')]));});});}; \ No newline at end of file +var _0xe510=['debug','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','find','options','raw','where','include','model','map','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','request\x20sent'];(function(_0x3ff450,_0x4fa9d9){var _0x38c58f=function(_0xb87ade){while(--_0xb87ade){_0x3ff450['push'](_0x3ff450['shift']());}};_0x38c58f(++_0x4fa9d9);}(_0xe510,0xcc));var _0x0e51=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe510[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x0e51('0x0'));var util=require(_0x0e51('0x1'));var moment=require(_0x0e51('0x2'));var BPromise=require(_0x0e51('0x3'));var rs=require(_0x0e51('0x4'));var fs=require('fs');var Redis=require(_0x0e51('0x5'));var db=require(_0x0e51('0x6'))['db'];var utils=require(_0x0e51('0x7'));var logger=require(_0x0e51('0x8'))(_0x0e51('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b1bc9,_0x2ee3d6,_0x151356){return new BPromise(function(_0x59489e,_0x4e9dc1){return client[_0x0e51('0xa')](_0x4b1bc9,_0x151356)['then'](function(_0x2b0afa){logger[_0x0e51('0xb')]('Sound,\x20%s,\x20%s',_0x2ee3d6,_0x0e51('0xc'));logger[_0x0e51('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x2ee3d6,'request\x20sent',JSON[_0x0e51('0xe')](_0x2b0afa));if(_0x2b0afa['error']){if(_0x2b0afa[_0x0e51('0xf')][_0x0e51('0x10')]===0x1f4){logger[_0x0e51('0xf')](_0x0e51('0x11'),_0x2ee3d6,_0x2b0afa[_0x0e51('0xf')][_0x0e51('0x12')]);return _0x4e9dc1(_0x2b0afa[_0x0e51('0xf')][_0x0e51('0x12')]);}logger[_0x0e51('0xf')]('Sound,\x20%s,\x20%s',_0x2ee3d6,_0x2b0afa['error'][_0x0e51('0x12')]);return _0x59489e(_0x2b0afa[_0x0e51('0xf')][_0x0e51('0x12')]);}else{logger[_0x0e51('0xb')](_0x0e51('0x11'),_0x2ee3d6,_0x0e51('0xc'));_0x59489e(_0x2b0afa[_0x0e51('0x13')][_0x0e51('0x12')]);}})[_0x0e51('0x14')](function(_0x639507){logger[_0x0e51('0xf')](_0x0e51('0x11'),_0x2ee3d6,_0x639507);_0x4e9dc1(_0x639507);});});}exports[_0x0e51('0x15')]=function(_0x24363b){var _0x53eda3=this;return new Promise(function(_0x16977a,_0x3f97cf){return db['Sound'][_0x0e51('0x16')]({'raw':_0x24363b['options']?_0x24363b[_0x0e51('0x17')][_0x0e51('0x18')]===undefined?!![]:![]:!![],'where':_0x24363b[_0x0e51('0x17')]?_0x24363b['options'][_0x0e51('0x19')]||null:null,'attributes':_0x24363b[_0x0e51('0x17')]?_0x24363b[_0x0e51('0x17')]['attributes']||null:null,'include':_0x24363b['options']?_0x24363b['options'][_0x0e51('0x1a')]?_['map'](_0x24363b[_0x0e51('0x17')]['include'],function(_0x31f5d4){return{'model':db[_0x31f5d4[_0x0e51('0x1b')]],'as':_0x31f5d4['as'],'attributes':_0x31f5d4['attributes'],'include':_0x31f5d4['include']?_[_0x0e51('0x1c')](_0x31f5d4[_0x0e51('0x1a')],function(_0xd89bb0){return{'model':db[_0xd89bb0['model']],'as':_0xd89bb0['as'],'attributes':_0xd89bb0['attributes'],'include':_0xd89bb0[_0x0e51('0x1a')]?_[_0x0e51('0x1c')](_0xd89bb0['include'],function(_0x1b9924){return{'model':db[_0x1b9924[_0x0e51('0x1b')]],'as':_0x1b9924['as'],'attributes':_0x1b9924[_0x0e51('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0e51('0x1e')](function(_0x4dd83f){logger[_0x0e51('0xb')](_0x0e51('0x15'),_0x24363b);logger[_0x0e51('0xd')](_0x0e51('0x15'),_0x24363b,JSON[_0x0e51('0xe')](_0x4dd83f));_0x16977a(_0x4dd83f);})[_0x0e51('0x14')](function(_0x4e1088){logger[_0x0e51('0xf')]('ShowSound',_0x4e1088[_0x0e51('0x12')],_0x24363b);_0x3f97cf(_0x53eda3[_0x0e51('0xf')](0x1f4,_0x4e1088['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 9ade50b..cffbc27 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x306086,_0x494520){var _0x2f805d=function(_0x562512){while(--_0x562512){_0x306086['push'](_0x306086['shift']());}};_0x2f805d(++_0x494520);}(_0xda3f,0xec));var _0xfda3=function(_0x860626,_0x446b0e){_0x860626=_0x860626-0x0;var _0x5f2eb3=_0xda3f[_0x860626];return _0x5f2eb3;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x554292,_0x82948a){var _0x3dd555=function(_0xab7590){while(--_0xab7590){_0x554292['push'](_0x554292['shift']());}};_0x3dd555(++_0x82948a);}(_0x4fc2,0x111));var _0x24fc=function(_0x414fde,_0x153cf2){_0x414fde=_0x414fde-0x0;var _0x143152=_0x4fc2[_0x414fde];return _0x143152;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 01d2530..a9ce1b8 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 _0xa6eb=['medium','out','sequelize','exports','TEXT'];(function(_0x294889,_0x1e84d1){var _0x5a518e=function(_0x243c04){while(--_0x243c04){_0x294889['push'](_0x294889['shift']());}};_0x5a518e(++_0x1e84d1);}(_0xa6eb,0x10b));var _0xba6e=function(_0x3c7b9b,_0x3dedfd){_0x3c7b9b=_0x3c7b9b-0x0;var _0xb3c0c9=_0xa6eb[_0x3c7b9b];return _0xb3c0c9;};'use strict';var Sequelize=require(_0xba6e('0x0'));module[_0xba6e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xba6e('0x2')](_0xba6e('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xba6e('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xfbf9=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x1ca12f,_0x267e27){var _0x395a43=function(_0x9c2f2){while(--_0x9c2f2){_0x1ca12f['push'](_0x1ca12f['shift']());}};_0x395a43(++_0x267e27);}(_0xfbf9,0x17f));var _0x9fbf=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0xfbf9[_0x2272b5];return _0x110156;};'use strict';var Sequelize=require(_0x9fbf('0x0'));module[_0x9fbf('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x9fbf('0x2')](_0x9fbf('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9fbf('0x4')]('in',_0x9fbf('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9fbf('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index e6db5eb..c833d8e 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 _0x782f=['rows','catch','show','params','include','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../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','then','destroy','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','includeAll'];(function(_0x5c70d0,_0xfeac42){var _0x484491=function(_0x533149){while(--_0x533149){_0x5c70d0['push'](_0x5c70d0['shift']());}};_0x484491(++_0xfeac42);}(_0x782f,0x1f2));var _0xf782=function(_0x5ecc37,_0x3954a8){_0x5ecc37=_0x5ecc37-0x0;var _0x446d15=_0x782f[_0x5ecc37];return _0x446d15;};'use strict';var emlformat=require(_0xf782('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf782('0x1'));var rp=require(_0xf782('0x2'));var moment=require(_0xf782('0x3'));var BPromise=require(_0xf782('0x4'));var Mustache=require(_0xf782('0x5'));var util=require(_0xf782('0x6'));var path=require('path');var sox=require(_0xf782('0x7'));var csv=require(_0xf782('0x8'));var ejs=require(_0xf782('0x9'));var fs=require('fs');var fs_extra=require(_0xf782('0xa'));var _=require(_0xf782('0xb'));var squel=require('squel');var crypto=require(_0xf782('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf782('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf782('0xe'));var qs=require(_0xf782('0xf'));var as=require(_0xf782('0x10'));var hardwareService=require(_0xf782('0x11'));var logger=require(_0xf782('0x12'))(_0xf782('0x13'));var utils=require(_0xf782('0x14'));var config=require(_0xf782('0x15'));var licenseUtil=require(_0xf782('0x16'));var db=require(_0xf782('0x17'))['db'];function respondWithStatusCode(_0x22ebfa,_0x358bd4){_0x358bd4=_0x358bd4||0xcc;return function(_0x51c487){if(_0x51c487){return _0x22ebfa[_0xf782('0x18')](_0x358bd4);}return _0x22ebfa[_0xf782('0x19')](_0x358bd4)[_0xf782('0x1a')]();};}function respondWithResult(_0x4a51e1,_0x29fbca){_0x29fbca=_0x29fbca||0xc8;return function(_0x443343){if(_0x443343){return _0x4a51e1[_0xf782('0x19')](_0x29fbca)[_0xf782('0x1b')](_0x443343);}};}function respondWithFilteredResult(_0x379624,_0x25b136){return function(_0x4d292e){if(_0x4d292e){var _0x575907=typeof _0x25b136[_0xf782('0x1c')]===_0xf782('0x1d')&&typeof _0x25b136[_0xf782('0x1e')]===_0xf782('0x1d');var _0x1d71c5=_0x4d292e[_0xf782('0x1f')];var _0x304993=_0x575907?0x0:_0x25b136['offset'];var _0x4a4997=_0x575907?_0x4d292e['count']:_0x25b136[_0xf782('0x1c')]+_0x25b136['limit'];var _0x1cfe27;if(_0x4a4997>=_0x1d71c5){_0x4a4997=_0x1d71c5;_0x1cfe27=0xc8;}else{_0x1cfe27=0xce;}_0x379624[_0xf782('0x19')](_0x1cfe27);return _0x379624[_0xf782('0x20')](_0xf782('0x21'),_0x304993+'-'+_0x4a4997+'/'+_0x1d71c5)[_0xf782('0x1b')](_0x4d292e);}return null;};}function patchUpdates(_0x56f3ce){return function(_0x124067){try{jsonpatch[_0xf782('0x22')](_0x124067,_0x56f3ce,!![]);}catch(_0x574087){return BPromise[_0xf782('0x23')](_0x574087);}return _0x124067['save']();};}function saveUpdates(_0x44a02f,_0x5a2e14){return function(_0x71efa6){if(_0x71efa6){return _0x71efa6['update'](_0x44a02f)[_0xf782('0x24')](function(_0x4dca34){return _0x4dca34;});}return null;};}function removeEntity(_0x59e8c6,_0x512ff5){return function(_0x538675){if(_0x538675){return _0x538675[_0xf782('0x25')]()['then'](function(){_0x59e8c6[_0xf782('0x19')](0xcc)[_0xf782('0x1a')]();});}};}function handleEntityNotFound(_0x399ad9,_0xe07f30){return function(_0x28dc56){if(!_0x28dc56){_0x399ad9[_0xf782('0x18')](0x194);}return _0x28dc56;};}function handleError(_0x10bf94,_0xfb5a71){_0xfb5a71=_0xfb5a71||0x1f4;return function(_0x2e4b9e){logger['error'](_0x2e4b9e[_0xf782('0x26')]);if(_0x2e4b9e['name']){delete _0x2e4b9e[_0xf782('0x27')];}_0x10bf94['status'](_0xfb5a71)[_0xf782('0x28')](_0x2e4b9e);};}exports[_0xf782('0x29')]=function(_0x17da37,_0x2daefb){var _0x4cf367={},_0x132b0c={},_0x559e17={'count':0x0,'rows':[]};var _0x31e66f=_['map'](db[_0xf782('0x2a')][_0xf782('0x2b')],function(_0x46ff3d){return{'name':_0x46ff3d[_0xf782('0x2c')],'type':_0x46ff3d[_0xf782('0x2d')][_0xf782('0x2e')]};});_0x132b0c[_0xf782('0x2f')]=_['map'](_0x31e66f,_0xf782('0x27'));_0x132b0c['query']=_[_0xf782('0x30')](_0x17da37['query']);_0x132b0c[_0xf782('0x31')]=_['intersection'](_0x132b0c[_0xf782('0x2f')],_0x132b0c[_0xf782('0x32')]);_0x4cf367[_0xf782('0x33')]=_[_0xf782('0x34')](_0x132b0c['model'],qs['fields'](_0x17da37[_0xf782('0x32')][_0xf782('0x35')]));_0x4cf367['attributes']=_0x4cf367[_0xf782('0x33')][_0xf782('0x36')]?_0x4cf367[_0xf782('0x33')]:_0x132b0c[_0xf782('0x2f')];if(!_0x17da37[_0xf782('0x32')][_0xf782('0x37')]('nolimit')){_0x4cf367[_0xf782('0x1e')]=qs[_0xf782('0x1e')](_0x17da37['query'][_0xf782('0x1e')]);_0x4cf367[_0xf782('0x1c')]=qs[_0xf782('0x1c')](_0x17da37[_0xf782('0x32')][_0xf782('0x1c')]);}_0x4cf367['order']=qs['sort'](_0x17da37[_0xf782('0x32')][_0xf782('0x38')]);_0x4cf367[_0xf782('0x39')]=qs[_0xf782('0x31')](_['pick'](_0x17da37['query'],_0x132b0c[_0xf782('0x31')]),_0x31e66f);if(_0x17da37[_0xf782('0x32')][_0xf782('0x3a')]){_0x4cf367[_0xf782('0x39')]=_['merge'](_0x4cf367['where'],{'$or':_['map'](_0x31e66f,function(_0xf63a45){if(_0xf63a45[_0xf782('0x2d')]!==_0xf782('0x3b')){var _0x21a8e2={};_0x21a8e2[_0xf63a45[_0xf782('0x27')]]={'$like':'%'+_0x17da37[_0xf782('0x32')]['filter']+'%'};return _0x21a8e2;}})});}_0x4cf367=_[_0xf782('0x3c')]({},_0x4cf367,_0x17da37['options']);var _0x21a9d8={'where':_0x4cf367['where']};return db[_0xf782('0x2a')]['count'](_0x21a9d8)[_0xf782('0x24')](function(_0x591531){_0x559e17[_0xf782('0x1f')]=_0x591531;if(_0x17da37[_0xf782('0x32')][_0xf782('0x3d')]){_0x4cf367['include']=[{'all':!![]}];}return db[_0xf782('0x2a')]['findAll'](_0x4cf367);})[_0xf782('0x24')](function(_0x135aee){_0x559e17[_0xf782('0x3e')]=_0x135aee;return _0x559e17;})[_0xf782('0x24')](respondWithFilteredResult(_0x2daefb,_0x4cf367))[_0xf782('0x3f')](handleError(_0x2daefb,null));};exports[_0xf782('0x40')]=function(_0xfec2c3,_0x36a13f){var _0x410383={'raw':!![],'where':{'id':_0xfec2c3[_0xf782('0x41')]['id']}},_0x63ea7d={};_0x63ea7d[_0xf782('0x2f')]=_['keys'](db[_0xf782('0x2a')][_0xf782('0x2b')]);_0x63ea7d[_0xf782('0x32')]=_[_0xf782('0x30')](_0xfec2c3[_0xf782('0x32')]);_0x63ea7d[_0xf782('0x31')]=_[_0xf782('0x34')](_0x63ea7d[_0xf782('0x2f')],_0x63ea7d['query']);_0x410383[_0xf782('0x33')]=_[_0xf782('0x34')](_0x63ea7d[_0xf782('0x2f')],qs[_0xf782('0x35')](_0xfec2c3[_0xf782('0x32')][_0xf782('0x35')]));_0x410383[_0xf782('0x33')]=_0x410383[_0xf782('0x33')][_0xf782('0x36')]?_0x410383['attributes']:_0x63ea7d[_0xf782('0x2f')];if(_0xfec2c3[_0xf782('0x32')][_0xf782('0x3d')]){_0x410383[_0xf782('0x42')]=[{'all':!![]}];}_0x410383=_[_0xf782('0x3c')]({},_0x410383,_0xfec2c3['options']);return db[_0xf782('0x2a')][_0xf782('0x43')](_0x410383)['then'](handleEntityNotFound(_0x36a13f,null))[_0xf782('0x24')](respondWithResult(_0x36a13f,null))['catch'](handleError(_0x36a13f,null));};exports[_0xf782('0x44')]=function(_0xbb87f2,_0x234ee5){return db[_0xf782('0x2a')][_0xf782('0x44')](_0xbb87f2['body'],{})[_0xf782('0x24')](respondWithResult(_0x234ee5,0xc9))[_0xf782('0x3f')](handleError(_0x234ee5,null));};exports['update']=function(_0x1b370c,_0xf71bd6){if(_0x1b370c[_0xf782('0x45')]['id']){delete _0x1b370c[_0xf782('0x45')]['id'];}return db[_0xf782('0x2a')]['find']({'where':{'id':_0x1b370c['params']['id']}})['then'](handleEntityNotFound(_0xf71bd6,null))['then'](saveUpdates(_0x1b370c[_0xf782('0x45')],null))['then'](respondWithResult(_0xf71bd6,null))[_0xf782('0x3f')](handleError(_0xf71bd6,null));};exports['destroy']=function(_0x34d427,_0x31fefe){return db[_0xf782('0x2a')][_0xf782('0x43')]({'where':{'id':_0x34d427['params']['id']}})[_0xf782('0x24')](handleEntityNotFound(_0x31fefe,null))['then'](removeEntity(_0x31fefe,null))[_0xf782('0x3f')](handleError(_0x31fefe,null));}; \ No newline at end of file +var _0xe1f0=['catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','update','then','destroy','name','send','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SquareMessage','findAll','rows'];(function(_0x212fcc,_0x11ae02){var _0xdbfd64=function(_0xccf2c5){while(--_0xccf2c5){_0x212fcc['push'](_0x212fcc['shift']());}};_0xdbfd64(++_0x11ae02);}(_0xe1f0,0x1ea));var _0x0e1f=function(_0x543569,_0x28be0e){_0x543569=_0x543569-0x0;var _0x2558b0=_0xe1f0[_0x543569];return _0x2558b0;};'use strict';var emlformat=require(_0x0e1f('0x0'));var rimraf=require(_0x0e1f('0x1'));var zipdir=require(_0x0e1f('0x2'));var jsonpatch=require(_0x0e1f('0x3'));var rp=require(_0x0e1f('0x4'));var moment=require(_0x0e1f('0x5'));var BPromise=require(_0x0e1f('0x6'));var Mustache=require(_0x0e1f('0x7'));var util=require(_0x0e1f('0x8'));var path=require(_0x0e1f('0x9'));var sox=require(_0x0e1f('0xa'));var csv=require(_0x0e1f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e1f('0xc'));var squel=require('squel');var crypto=require(_0x0e1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0e1f('0xe'));var toCsv=require(_0x0e1f('0xb'));var querystring=require(_0x0e1f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e1f('0x10'));var as=require(_0x0e1f('0x11'));var hardwareService=require(_0x0e1f('0x12'));var logger=require('../../config/logger')(_0x0e1f('0x13'));var utils=require(_0x0e1f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0e1f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124cec,_0xc2abd8){_0xc2abd8=_0xc2abd8||0xcc;return function(_0x4bd123){if(_0x4bd123){return _0x124cec[_0x0e1f('0x16')](_0xc2abd8);}return _0x124cec[_0x0e1f('0x17')](_0xc2abd8)[_0x0e1f('0x18')]();};}function respondWithResult(_0x4e0d54,_0x5c235d){_0x5c235d=_0x5c235d||0xc8;return function(_0xc59f20){if(_0xc59f20){return _0x4e0d54[_0x0e1f('0x17')](_0x5c235d)[_0x0e1f('0x19')](_0xc59f20);}};}function respondWithFilteredResult(_0x3bd237,_0x59ece2){return function(_0x5a9ee8){if(_0x5a9ee8){var _0x2f6f20=typeof _0x59ece2[_0x0e1f('0x1a')]==='undefined'&&typeof _0x59ece2[_0x0e1f('0x1b')]==='undefined';var _0x2af45d=_0x5a9ee8['count'];var _0x5f04c9=_0x2f6f20?0x0:_0x59ece2['offset'];var _0x37ffd2=_0x2f6f20?_0x5a9ee8[_0x0e1f('0x1c')]:_0x59ece2['offset']+_0x59ece2[_0x0e1f('0x1b')];var _0x81c9c5;if(_0x37ffd2>=_0x2af45d){_0x37ffd2=_0x2af45d;_0x81c9c5=0xc8;}else{_0x81c9c5=0xce;}_0x3bd237[_0x0e1f('0x17')](_0x81c9c5);return _0x3bd237['set'](_0x0e1f('0x1d'),_0x5f04c9+'-'+_0x37ffd2+'/'+_0x2af45d)[_0x0e1f('0x19')](_0x5a9ee8);}return null;};}function patchUpdates(_0x4d52bc){return function(_0x4dd689){try{jsonpatch['apply'](_0x4dd689,_0x4d52bc,!![]);}catch(_0x278504){return BPromise[_0x0e1f('0x1e')](_0x278504);}return _0x4dd689['save']();};}function saveUpdates(_0x1c402a,_0x5bbaa8){return function(_0x2d751b){if(_0x2d751b){return _0x2d751b[_0x0e1f('0x1f')](_0x1c402a)[_0x0e1f('0x20')](function(_0x1a1b11){return _0x1a1b11;});}return null;};}function removeEntity(_0x4aa0f7,_0x2a328c){return function(_0x15d0e3){if(_0x15d0e3){return _0x15d0e3[_0x0e1f('0x21')]()[_0x0e1f('0x20')](function(){_0x4aa0f7[_0x0e1f('0x17')](0xcc)[_0x0e1f('0x18')]();});}};}function handleEntityNotFound(_0x4a61dd,_0x4f49da){return function(_0x2c3d19){if(!_0x2c3d19){_0x4a61dd[_0x0e1f('0x16')](0x194);}return _0x2c3d19;};}function handleError(_0x18eb9b,_0x41c47e){_0x41c47e=_0x41c47e||0x1f4;return function(_0x4d1e2c){logger['error'](_0x4d1e2c['stack']);if(_0x4d1e2c[_0x0e1f('0x22')]){delete _0x4d1e2c['name'];}_0x18eb9b[_0x0e1f('0x17')](_0x41c47e)[_0x0e1f('0x23')](_0x4d1e2c);};}exports[_0x0e1f('0x24')]=function(_0x4b6596,_0x4ae5ae){var _0x4ba73f={},_0x2dd563={},_0xd29787={'count':0x0,'rows':[]};var _0x14b7d9=_['map'](db['SquareMessage'][_0x0e1f('0x25')],function(_0x4b31e4){return{'name':_0x4b31e4['fieldName'],'type':_0x4b31e4[_0x0e1f('0x26')][_0x0e1f('0x27')]};});_0x2dd563['model']=_[_0x0e1f('0x28')](_0x14b7d9,'name');_0x2dd563[_0x0e1f('0x29')]=_['keys'](_0x4b6596[_0x0e1f('0x29')]);_0x2dd563[_0x0e1f('0x2a')]=_[_0x0e1f('0x2b')](_0x2dd563[_0x0e1f('0x2c')],_0x2dd563[_0x0e1f('0x29')]);_0x4ba73f[_0x0e1f('0x2d')]=_[_0x0e1f('0x2b')](_0x2dd563['model'],qs['fields'](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x2e')]));_0x4ba73f[_0x0e1f('0x2d')]=_0x4ba73f[_0x0e1f('0x2d')][_0x0e1f('0x2f')]?_0x4ba73f['attributes']:_0x2dd563['model'];if(!_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x30')](_0x0e1f('0x31'))){_0x4ba73f[_0x0e1f('0x1b')]=qs[_0x0e1f('0x1b')](_0x4b6596[_0x0e1f('0x29')]['limit']);_0x4ba73f[_0x0e1f('0x1a')]=qs[_0x0e1f('0x1a')](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x1a')]);}_0x4ba73f['order']=qs['sort'](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x32')]);_0x4ba73f['where']=qs[_0x0e1f('0x2a')](_[_0x0e1f('0x33')](_0x4b6596[_0x0e1f('0x29')],_0x2dd563[_0x0e1f('0x2a')]),_0x14b7d9);if(_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x34')]){_0x4ba73f[_0x0e1f('0x35')]=_[_0x0e1f('0x36')](_0x4ba73f[_0x0e1f('0x35')],{'$or':_[_0x0e1f('0x28')](_0x14b7d9,function(_0x27c717){if(_0x27c717[_0x0e1f('0x26')]!==_0x0e1f('0x37')){var _0x32859f={};_0x32859f[_0x27c717[_0x0e1f('0x22')]]={'$like':'%'+_0x4b6596[_0x0e1f('0x29')]['filter']+'%'};return _0x32859f;}})});}_0x4ba73f=_[_0x0e1f('0x36')]({},_0x4ba73f,_0x4b6596[_0x0e1f('0x38')]);var _0x3b51ef={'where':_0x4ba73f[_0x0e1f('0x35')]};return db['SquareMessage'][_0x0e1f('0x1c')](_0x3b51ef)['then'](function(_0x2187ae){_0xd29787['count']=_0x2187ae;if(_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x39')]){_0x4ba73f[_0x0e1f('0x3a')]=[{'all':!![]}];}return db[_0x0e1f('0x3b')][_0x0e1f('0x3c')](_0x4ba73f);})[_0x0e1f('0x20')](function(_0x228013){_0xd29787[_0x0e1f('0x3d')]=_0x228013;return _0xd29787;})[_0x0e1f('0x20')](respondWithFilteredResult(_0x4ae5ae,_0x4ba73f))[_0x0e1f('0x3e')](handleError(_0x4ae5ae,null));};exports[_0x0e1f('0x3f')]=function(_0x5e26b5,_0x11f9e8){var _0x4d7374={'raw':!![],'where':{'id':_0x5e26b5[_0x0e1f('0x40')]['id']}},_0xf13325={};_0xf13325[_0x0e1f('0x2c')]=_[_0x0e1f('0x41')](db[_0x0e1f('0x3b')][_0x0e1f('0x25')]);_0xf13325[_0x0e1f('0x29')]=_[_0x0e1f('0x41')](_0x5e26b5['query']);_0xf13325['filters']=_[_0x0e1f('0x2b')](_0xf13325[_0x0e1f('0x2c')],_0xf13325[_0x0e1f('0x29')]);_0x4d7374['attributes']=_[_0x0e1f('0x2b')](_0xf13325['model'],qs['fields'](_0x5e26b5[_0x0e1f('0x29')][_0x0e1f('0x2e')]));_0x4d7374['attributes']=_0x4d7374['attributes'][_0x0e1f('0x2f')]?_0x4d7374[_0x0e1f('0x2d')]:_0xf13325[_0x0e1f('0x2c')];if(_0x5e26b5['query'][_0x0e1f('0x39')]){_0x4d7374[_0x0e1f('0x3a')]=[{'all':!![]}];}_0x4d7374=_[_0x0e1f('0x36')]({},_0x4d7374,_0x5e26b5[_0x0e1f('0x38')]);return db[_0x0e1f('0x3b')]['find'](_0x4d7374)[_0x0e1f('0x20')](handleEntityNotFound(_0x11f9e8,null))[_0x0e1f('0x20')](respondWithResult(_0x11f9e8,null))['catch'](handleError(_0x11f9e8,null));};exports[_0x0e1f('0x42')]=function(_0xa166ed,_0x244d97){return db[_0x0e1f('0x3b')][_0x0e1f('0x42')](_0xa166ed['body'],{})['then'](respondWithResult(_0x244d97,0xc9))[_0x0e1f('0x3e')](handleError(_0x244d97,null));};exports[_0x0e1f('0x1f')]=function(_0x208c15,_0x22ff97){if(_0x208c15[_0x0e1f('0x43')]['id']){delete _0x208c15[_0x0e1f('0x43')]['id'];}return db[_0x0e1f('0x3b')][_0x0e1f('0x44')]({'where':{'id':_0x208c15[_0x0e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0x22ff97,null))[_0x0e1f('0x20')](saveUpdates(_0x208c15[_0x0e1f('0x43')],null))[_0x0e1f('0x20')](respondWithResult(_0x22ff97,null))[_0x0e1f('0x3e')](handleError(_0x22ff97,null));};exports['destroy']=function(_0x28d058,_0xab1e60){return db[_0x0e1f('0x3b')]['find']({'where':{'id':_0x28d058[_0x0e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0xab1e60,null))[_0x0e1f('0x20')](removeEntity(_0xab1e60,null))[_0x0e1f('0x3e')](handleError(_0xab1e60,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 84b3a0b..fd660cf 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 _0x359d=['SquareMessage','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0xc1801d,_0x4aeb72){var _0x462352=function(_0x3b59cd){while(--_0x3b59cd){_0xc1801d['push'](_0xc1801d['shift']());}};_0x462352(++_0x4aeb72);}(_0x359d,0xeb));var _0xd359=function(_0x539fb2,_0x5b6718){_0x539fb2=_0x539fb2-0x0;var _0x4d583d=_0x359d[_0x539fb2];return _0x4d583d;};'use strict';var _=require('lodash');var util=require(_0xd359('0x0'));var logger=require('../../config/logger')(_0xd359('0x1'));var moment=require(_0xd359('0x2'));var BPromise=require(_0xd359('0x3'));var rp=require(_0xd359('0x4'));var fs=require('fs');var path=require(_0xd359('0x5'));var rimraf=require(_0xd359('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xd359('0x7')]=function(_0x49c4d9,_0x1e1fa7){return _0x49c4d9['define'](_0xd359('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0813=['bluebird','path','../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment'];(function(_0x2ec440,_0xa3a6df){var _0x6d1861=function(_0x3b7195){while(--_0x3b7195){_0x2ec440['push'](_0x2ec440['shift']());}};_0x6d1861(++_0xa3a6df);}(_0x0813,0xd8));var _0x3081=function(_0x2f5df3,_0x1be008){_0x2f5df3=_0x2f5df3-0x0;var _0x2db629=_0x0813[_0x2f5df3];return _0x2db629;};'use strict';var _=require(_0x3081('0x0'));var util=require(_0x3081('0x1'));var logger=require(_0x3081('0x2'))('api');var moment=require(_0x3081('0x3'));var BPromise=require(_0x3081('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3081('0x5'));var rimraf=require('rimraf');var config=require(_0x3081('0x6'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x44cfa5,_0x7080a5){return _0x44cfa5[_0x3081('0x7')](_0x3081('0x8'),attributes,{'tableName':_0x3081('0x9'),'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 a8dbf47..abb4ae8 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 _0x2222=['body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateSquareMessage','SquareMessage','create'];(function(_0x355b68,_0x4ae2ba){var _0x1bf0ce=function(_0x553278){while(--_0x553278){_0x355b68['push'](_0x355b68['shift']());}};_0x1bf0ce(++_0x4ae2ba);}(_0x2222,0x1f0));var _0x2222=function(_0x27a7a0,_0x42c153){_0x27a7a0=_0x27a7a0-0x0;var _0x56cc00=_0x2222[_0x27a7a0];return _0x56cc00;};'use strict';var _=require(_0x2222('0x0'));var util=require(_0x2222('0x1'));var moment=require(_0x2222('0x2'));var BPromise=require(_0x2222('0x3'));var rs=require(_0x2222('0x4'));var fs=require('fs');var Redis=require(_0x2222('0x5'));var db=require(_0x2222('0x6'))['db'];var utils=require(_0x2222('0x7'));var logger=require(_0x2222('0x8'))(_0x2222('0x9'));var config=require(_0x2222('0xa'));var jayson=require(_0x2222('0xb'));var client=jayson[_0x2222('0xc')][_0x2222('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x35ebff,_0x3fb97d,_0x76a414){return new BPromise(function(_0x2706b9,_0x524ede){return client[_0x2222('0xe')](_0x35ebff,_0x76a414)['then'](function(_0x2d6a96){logger[_0x2222('0xf')](_0x2222('0x10'),_0x3fb97d,_0x2222('0x11'));logger[_0x2222('0x12')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3fb97d,'request\x20sent',JSON['stringify'](_0x2d6a96));if(_0x2d6a96['error']){if(_0x2d6a96[_0x2222('0x13')][_0x2222('0x14')]===0x1f4){logger[_0x2222('0x13')](_0x2222('0x10'),_0x3fb97d,_0x2d6a96[_0x2222('0x13')][_0x2222('0x15')]);return _0x524ede(_0x2d6a96[_0x2222('0x13')][_0x2222('0x15')]);}logger[_0x2222('0x13')]('SquareMessage,\x20%s,\x20%s',_0x3fb97d,_0x2d6a96[_0x2222('0x13')][_0x2222('0x15')]);return _0x2706b9(_0x2d6a96['error']['message']);}else{logger[_0x2222('0xf')]('SquareMessage,\x20%s,\x20%s',_0x3fb97d,_0x2222('0x11'));_0x2706b9(_0x2d6a96['result'][_0x2222('0x15')]);}})[_0x2222('0x16')](function(_0x305628){logger[_0x2222('0x13')](_0x2222('0x10'),_0x3fb97d,_0x305628);_0x524ede(_0x305628);});});}exports[_0x2222('0x17')]=function(_0x7d2bf2){var _0x3d0f02=this;return new Promise(function(_0x4d2b5c,_0x572d5c){return db[_0x2222('0x18')][_0x2222('0x19')](_0x7d2bf2[_0x2222('0x1a')],{'raw':_0x7d2bf2['options']?_0x7d2bf2[_0x2222('0x1b')][_0x2222('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1863d6){logger[_0x2222('0xf')](_0x2222('0x17'),_0x7d2bf2);logger[_0x2222('0x12')](_0x2222('0x17'),_0x7d2bf2,JSON['stringify'](_0x1863d6));_0x4d2b5c(_0x1863d6);})[_0x2222('0x16')](function(_0x2dfc52){logger['error'](_0x2222('0x17'),_0x2dfc52[_0x2222('0x15')],_0x7d2bf2);_0x572d5c(_0x3d0f02['error'](0x1f4,_0x2dfc52[_0x2222('0x15')]));});});}; \ No newline at end of file +var _0x63d0=['SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareMessage','SquareMessage','create','body','options','raw','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x2d64b8,_0x62f97f){var _0x5e0fa0=function(_0x4f9737){while(--_0x4f9737){_0x2d64b8['push'](_0x2d64b8['shift']());}};_0x5e0fa0(++_0x62f97f);}(_0x63d0,0x6e));var _0x063d=function(_0x1faba8,_0x37cfb8){_0x1faba8=_0x1faba8-0x0;var _0x1ded2d=_0x63d0[_0x1faba8];return _0x1ded2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x063d('0x0'));var rs=require(_0x063d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x063d('0x2'))['db'];var utils=require(_0x063d('0x3'));var logger=require(_0x063d('0x4'))(_0x063d('0x5'));var config=require('../../config/environment');var jayson=require(_0x063d('0x6'));var client=jayson[_0x063d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11c177,_0x9f7fe2,_0x48d2fb){return new BPromise(function(_0x2ecee3,_0x4b13f5){return client['request'](_0x11c177,_0x48d2fb)[_0x063d('0x8')](function(_0x3f9edf){logger[_0x063d('0x9')](_0x063d('0xa'),_0x9f7fe2,_0x063d('0xb'));logger[_0x063d('0xc')](_0x063d('0xd'),_0x9f7fe2,_0x063d('0xb'),JSON[_0x063d('0xe')](_0x3f9edf));if(_0x3f9edf[_0x063d('0xf')]){if(_0x3f9edf[_0x063d('0xf')]['code']===0x1f4){logger[_0x063d('0xf')]('SquareMessage,\x20%s,\x20%s',_0x9f7fe2,_0x3f9edf['error']['message']);return _0x4b13f5(_0x3f9edf['error'][_0x063d('0x10')]);}logger[_0x063d('0xf')]('SquareMessage,\x20%s,\x20%s',_0x9f7fe2,_0x3f9edf['error'][_0x063d('0x10')]);return _0x2ecee3(_0x3f9edf[_0x063d('0xf')]['message']);}else{logger[_0x063d('0x9')]('SquareMessage,\x20%s,\x20%s',_0x9f7fe2,_0x063d('0xb'));_0x2ecee3(_0x3f9edf[_0x063d('0x11')]['message']);}})['catch'](function(_0x6ee01d){logger[_0x063d('0xf')](_0x063d('0xa'),_0x9f7fe2,_0x6ee01d);_0x4b13f5(_0x6ee01d);});});}exports[_0x063d('0x12')]=function(_0x2f3972){var _0x331522=this;return new Promise(function(_0x22c414,_0x36481c){return db[_0x063d('0x13')][_0x063d('0x14')](_0x2f3972[_0x063d('0x15')],{'raw':_0x2f3972[_0x063d('0x16')]?_0x2f3972['options'][_0x063d('0x17')]===undefined?!![]:![]:!![]})[_0x063d('0x8')](function(_0x23a97c){logger['info'](_0x063d('0x12'),_0x2f3972);logger[_0x063d('0xc')](_0x063d('0x12'),_0x2f3972,JSON[_0x063d('0xe')](_0x23a97c));_0x22c414(_0x23a97c);})['catch'](function(_0x3aeda0){logger[_0x063d('0xf')]('CreateSquareMessage',_0x3aeda0[_0x063d('0x10')],_0x2f3972);_0x36481c(_0x331522[_0x063d('0xf')](0x1f4,_0x3aeda0[_0x063d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 4164dd8..23d3b70 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 _0x3086=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','post','create','put','update'];(function(_0x5c587a,_0x4dba89){var _0x28d19e=function(_0x4e8056){while(--_0x4e8056){_0x5c587a['push'](_0x5c587a['shift']());}};_0x28d19e(++_0x4dba89);}(_0x3086,0x18e));var _0x6308=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3086[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6308('0x0'));var util=require(_0x6308('0x1'));var path=require(_0x6308('0x2'));var timeout=require('connect-timeout');var express=require(_0x6308('0x3'));var router=express[_0x6308('0x4')]();var fs_extra=require(_0x6308('0x5'));var auth=require(_0x6308('0x6'));var interaction=require(_0x6308('0x7'));var config=require(_0x6308('0x8'));var controller=require(_0x6308('0x9'));router['get']('/',auth[_0x6308('0xa')](),controller[_0x6308('0xb')]);router[_0x6308('0xc')](_0x6308('0xd'),auth['isAuthenticated'](),controller[_0x6308('0xe')]);router[_0x6308('0xc')](_0x6308('0xf'),auth[_0x6308('0xa')](),timeout('15s'),controller['test']);router[_0x6308('0x10')]('/',auth[_0x6308('0xa')](),controller[_0x6308('0x11')]);router[_0x6308('0x12')](_0x6308('0xd'),auth[_0x6308('0xa')](),controller[_0x6308('0x13')]);router['delete'](_0x6308('0xd'),auth['isAuthenticated'](),controller[_0x6308('0x14')]);module[_0x6308('0x15')]=router; \ No newline at end of file +var _0xca82=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','create','put','update','delete'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xca82,0x116));var _0x2ca8=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0xca82[_0x141486];return _0x1b5fb9;};'use strict';var multer=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var path=require('path');var timeout=require(_0x2ca8('0x2'));var express=require(_0x2ca8('0x3'));var router=express[_0x2ca8('0x4')]();var fs_extra=require(_0x2ca8('0x5'));var auth=require(_0x2ca8('0x6'));var interaction=require(_0x2ca8('0x7'));var config=require(_0x2ca8('0x8'));var controller=require('./squareOdbc.controller');router[_0x2ca8('0x9')]('/',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0xb')]);router[_0x2ca8('0x9')](_0x2ca8('0xc'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0xd')]);router[_0x2ca8('0x9')](_0x2ca8('0xe'),auth['isAuthenticated'](),timeout(_0x2ca8('0xf')),controller[_0x2ca8('0x10')]);router['post']('/',auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x11')]);router[_0x2ca8('0x12')](_0x2ca8('0xc'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x13')]);router[_0x2ca8('0x14')](_0x2ca8('0xc'),auth[_0x2ca8('0xa')](),controller[_0x2ca8('0x15')]);module[_0x2ca8('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e470c91..19aa43b 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 _0x4af5=['exports','STRING','sequelize'];(function(_0xe8e1b0,_0x324e50){var _0x6e714a=function(_0x16c036){while(--_0x16c036){_0xe8e1b0['push'](_0xe8e1b0['shift']());}};_0x6e714a(++_0x324e50);}(_0x4af5,0x1f1));var _0x54af=function(_0x14499b,_0x4aa513){_0x14499b=_0x14499b-0x0;var _0x316bc4=_0x4af5[_0x14499b];return _0x316bc4;};'use strict';var Sequelize=require(_0x54af('0x0'));module[_0x54af('0x1')]={'name':{'type':Sequelize[_0x54af('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x54af('0x2')]},'description':{'type':Sequelize[_0x54af('0x2')]}}; \ No newline at end of file +var _0x1bb1=['STRING','sequelize','exports'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0x1bb1,0xb2));var _0x11bb=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1bb1[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0x11bb('0x0'));module[_0x11bb('0x1')]={'name':{'type':Sequelize[_0x11bb('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x11bb('0x2')]},'description':{'type':Sequelize[_0x11bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e72044c..e427626 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 _0x1ecb=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','ODBC','UserProfileResource','error','stack','name','send','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','odbc','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ecb,0x148));var _0xb1ec=function(_0x8c605e,_0x18660d){_0x8c605e=_0x8c605e-0x0;var _0x243717=_0x1ecb[_0x8c605e];return _0x243717;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1ec('0x0'));var zipdir=require(_0xb1ec('0x1'));var jsonpatch=require(_0xb1ec('0x2'));var rp=require('request-promise');var moment=require(_0xb1ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb1ec('0x4'));var util=require(_0xb1ec('0x5'));var path=require(_0xb1ec('0x6'));var sox=require(_0xb1ec('0x7'));var csv=require('to-csv');var ejs=require(_0xb1ec('0x8'));var fs=require('fs');var fs_extra=require(_0xb1ec('0x9'));var _=require('lodash');var squel=require(_0xb1ec('0xa'));var crypto=require(_0xb1ec('0xb'));var jsforce=require(_0xb1ec('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb1ec('0xd'));var authService=require(_0xb1ec('0xe'));var qs=require(_0xb1ec('0xf'));var as=require(_0xb1ec('0x10'));var hardwareService=require(_0xb1ec('0x11'));var logger=require('../../config/logger')(_0xb1ec('0x12'));var utils=require(_0xb1ec('0x13'));var config=require(_0xb1ec('0x14'));var licenseUtil=require(_0xb1ec('0x15'));var db=require(_0xb1ec('0x16'))['db'];function respondWithStatusCode(_0x302721,_0x516f2e){_0x516f2e=_0x516f2e||0xcc;return function(_0x45a620){if(_0x45a620){return _0x302721[_0xb1ec('0x17')](_0x516f2e);}return _0x302721[_0xb1ec('0x18')](_0x516f2e)[_0xb1ec('0x19')]();};}function respondWithResult(_0x226609,_0x4f215f){_0x4f215f=_0x4f215f||0xc8;return function(_0x113496){if(_0x113496){return _0x226609[_0xb1ec('0x18')](_0x4f215f)[_0xb1ec('0x1a')](_0x113496);}};}function respondWithFilteredResult(_0x468de6,_0x2c24bc){return function(_0x36a1a8){if(_0x36a1a8){var _0x2dad16=typeof _0x2c24bc[_0xb1ec('0x1b')]===_0xb1ec('0x1c')&&typeof _0x2c24bc[_0xb1ec('0x1d')]==='undefined';var _0x4ac7cc=_0x36a1a8[_0xb1ec('0x1e')];var _0x32d4ea=_0x2dad16?0x0:_0x2c24bc['offset'];var _0x54d9e8=_0x2dad16?_0x36a1a8[_0xb1ec('0x1e')]:_0x2c24bc[_0xb1ec('0x1b')]+_0x2c24bc[_0xb1ec('0x1d')];var _0xe10619;if(_0x54d9e8>=_0x4ac7cc){_0x54d9e8=_0x4ac7cc;_0xe10619=0xc8;}else{_0xe10619=0xce;}_0x468de6[_0xb1ec('0x18')](_0xe10619);return _0x468de6[_0xb1ec('0x1f')](_0xb1ec('0x20'),_0x32d4ea+'-'+_0x54d9e8+'/'+_0x4ac7cc)[_0xb1ec('0x1a')](_0x36a1a8);}return null;};}function patchUpdates(_0x37905d){return function(_0x17bba8){try{jsonpatch['apply'](_0x17bba8,_0x37905d,!![]);}catch(_0x1ec3e7){return BPromise[_0xb1ec('0x21')](_0x1ec3e7);}return _0x17bba8[_0xb1ec('0x22')]();};}function saveUpdates(_0x51fb6d,_0x48393e){return function(_0x6a880f){if(_0x6a880f){return _0x6a880f[_0xb1ec('0x23')](_0x51fb6d)[_0xb1ec('0x24')](function(_0xd463fb){return _0xd463fb;});}return null;};}function removeEntity(_0x122587,_0x2b76d8){return function(_0x4becf3){if(_0x4becf3){return _0x4becf3[_0xb1ec('0x25')]()[_0xb1ec('0x24')](function(){var _0x2d80d0=_0x4becf3['get']({'plain':!![]});var _0x4a61af=_0xb1ec('0x26');return db[_0xb1ec('0x27')][_0xb1ec('0x25')]({'where':{'type':_0x4a61af,'resourceId':_0x2d80d0['id']}})['then'](function(){return _0x4becf3;});})[_0xb1ec('0x24')](function(){_0x122587[_0xb1ec('0x18')](0xcc)[_0xb1ec('0x19')]();});}};}function handleEntityNotFound(_0x25403,_0x48d71a){return function(_0x34a3bc){if(!_0x34a3bc){_0x25403['sendStatus'](0x194);}return _0x34a3bc;};}function handleError(_0x5bc56d,_0x58ebe9){_0x58ebe9=_0x58ebe9||0x1f4;return function(_0x6c2024){logger[_0xb1ec('0x28')](_0x6c2024[_0xb1ec('0x29')]);if(_0x6c2024[_0xb1ec('0x2a')]){delete _0x6c2024[_0xb1ec('0x2a')];}_0x5bc56d['status'](_0x58ebe9)[_0xb1ec('0x2b')](_0x6c2024);};}exports[_0xb1ec('0x2c')]=function(_0x2ccc27,_0x291096){var _0x5e33c4={},_0x14a932={},_0x497897={'count':0x0,'rows':[]};var _0x410f9f=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x5cb4d8){return{'name':_0x5cb4d8[_0xb1ec('0x2d')],'type':_0x5cb4d8['type'][_0xb1ec('0x2e')]};});_0x14a932[_0xb1ec('0x2f')]=_[_0xb1ec('0x30')](_0x410f9f,'name');_0x14a932['query']=_[_0xb1ec('0x31')](_0x2ccc27[_0xb1ec('0x32')]);_0x14a932[_0xb1ec('0x33')]=_[_0xb1ec('0x34')](_0x14a932['model'],_0x14a932[_0xb1ec('0x32')]);_0x5e33c4[_0xb1ec('0x35')]=_['intersection'](_0x14a932['model'],qs[_0xb1ec('0x36')](_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x36')]));_0x5e33c4['attributes']=_0x5e33c4[_0xb1ec('0x35')]['length']?_0x5e33c4[_0xb1ec('0x35')]:_0x14a932['model'];if(!_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x37')]('nolimit')){_0x5e33c4[_0xb1ec('0x1d')]=qs['limit'](_0x2ccc27[_0xb1ec('0x32')]['limit']);_0x5e33c4[_0xb1ec('0x1b')]=qs[_0xb1ec('0x1b')](_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x1b')]);}_0x5e33c4[_0xb1ec('0x38')]=qs[_0xb1ec('0x39')](_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x39')]);_0x5e33c4[_0xb1ec('0x3a')]=qs['filters'](_[_0xb1ec('0x3b')](_0x2ccc27[_0xb1ec('0x32')],_0x14a932[_0xb1ec('0x33')]),_0x410f9f);if(_0x2ccc27['query']['filter']){_0x5e33c4[_0xb1ec('0x3a')]=_[_0xb1ec('0x3c')](_0x5e33c4[_0xb1ec('0x3a')],{'$or':_[_0xb1ec('0x30')](_0x410f9f,function(_0x43b00d){if(_0x43b00d[_0xb1ec('0x3d')]!==_0xb1ec('0x3e')){var _0x4c9ebe={};_0x4c9ebe[_0x43b00d[_0xb1ec('0x2a')]]={'$like':'%'+_0x2ccc27['query'][_0xb1ec('0x3f')]+'%'};return _0x4c9ebe;}})});}_0x5e33c4=_[_0xb1ec('0x3c')]({},_0x5e33c4,_0x2ccc27[_0xb1ec('0x40')]);var _0xb60e5e={'where':_0x5e33c4[_0xb1ec('0x3a')]};return db[_0xb1ec('0x41')]['count'](_0xb60e5e)[_0xb1ec('0x24')](function(_0x27df3d){_0x497897[_0xb1ec('0x1e')]=_0x27df3d;if(_0x2ccc27[_0xb1ec('0x32')][_0xb1ec('0x42')]){_0x5e33c4[_0xb1ec('0x43')]=[{'all':!![]}];}return db[_0xb1ec('0x41')]['findAll'](_0x5e33c4);})[_0xb1ec('0x24')](function(_0x1dd565){_0x497897[_0xb1ec('0x44')]=_0x1dd565;return _0x497897;})[_0xb1ec('0x24')](respondWithFilteredResult(_0x291096,_0x5e33c4))[_0xb1ec('0x45')](handleError(_0x291096,null));};exports[_0xb1ec('0x46')]=function(_0x2fbed0,_0x3e9e11){var _0x2a9f91={'raw':!![],'where':{'id':_0x2fbed0[_0xb1ec('0x47')]['id']}},_0xd88ddb={};_0xd88ddb[_0xb1ec('0x2f')]=_[_0xb1ec('0x31')](db[_0xb1ec('0x41')][_0xb1ec('0x48')]);_0xd88ddb[_0xb1ec('0x32')]=_[_0xb1ec('0x31')](_0x2fbed0[_0xb1ec('0x32')]);_0xd88ddb[_0xb1ec('0x33')]=_[_0xb1ec('0x34')](_0xd88ddb['model'],_0xd88ddb['query']);_0x2a9f91[_0xb1ec('0x35')]=_[_0xb1ec('0x34')](_0xd88ddb['model'],qs[_0xb1ec('0x36')](_0x2fbed0['query'][_0xb1ec('0x36')]));_0x2a9f91[_0xb1ec('0x35')]=_0x2a9f91[_0xb1ec('0x35')]['length']?_0x2a9f91[_0xb1ec('0x35')]:_0xd88ddb[_0xb1ec('0x2f')];if(_0x2fbed0[_0xb1ec('0x32')]['includeAll']){_0x2a9f91[_0xb1ec('0x43')]=[{'all':!![]}];}_0x2a9f91=_[_0xb1ec('0x3c')]({},_0x2a9f91,_0x2fbed0[_0xb1ec('0x40')]);return db[_0xb1ec('0x41')][_0xb1ec('0x49')](_0x2a9f91)[_0xb1ec('0x24')](handleEntityNotFound(_0x3e9e11,null))[_0xb1ec('0x24')](respondWithResult(_0x3e9e11,null))['catch'](handleError(_0x3e9e11,null));};exports[_0xb1ec('0x4a')]=function(_0x4c142b,_0x737a44){return db['SquareOdbc']['create'](_0x4c142b[_0xb1ec('0x4b')],{})[_0xb1ec('0x24')](function(_0x4c9add){var _0x273763=_0x4c142b[_0xb1ec('0x4c')][_0xb1ec('0x4d')]({'plain':!![]});if(!_0x273763)throw new Error(_0xb1ec('0x4e'));if(_0x273763['role']==='user'){var _0x2b9737=_0x4c9add[_0xb1ec('0x4d')]({'plain':!![]});var _0x113174='ODBC';return db['UserProfileSection'][_0xb1ec('0x49')]({'where':{'name':_0x113174,'userProfileId':_0x273763[_0xb1ec('0x4f')]},'raw':!![]})['then'](function(_0x98b238){if(_0x98b238&&_0x98b238[_0xb1ec('0x50')]===0x0){return db[_0xb1ec('0x27')][_0xb1ec('0x4a')]({'name':_0x2b9737[_0xb1ec('0x2a')],'resourceId':_0x2b9737['id'],'type':_0x98b238['name'],'sectionId':_0x98b238['id']},{})[_0xb1ec('0x24')](function(){return _0x4c9add;});}else{return _0x4c9add;}})[_0xb1ec('0x45')](function(_0x582d1d){logger[_0xb1ec('0x28')](_0xb1ec('0x51'),_0x582d1d);throw _0x582d1d;});}return _0x4c9add;})[_0xb1ec('0x24')](respondWithResult(_0x737a44,0xc9))[_0xb1ec('0x45')](handleError(_0x737a44,null));};exports[_0xb1ec('0x23')]=function(_0x5935d0,_0x350208){if(_0x5935d0[_0xb1ec('0x4b')]['id']){delete _0x5935d0[_0xb1ec('0x4b')]['id'];}return db[_0xb1ec('0x41')][_0xb1ec('0x49')]({'where':{'id':_0x5935d0[_0xb1ec('0x47')]['id']}})[_0xb1ec('0x24')](handleEntityNotFound(_0x350208,null))[_0xb1ec('0x24')](saveUpdates(_0x5935d0[_0xb1ec('0x4b')],null))[_0xb1ec('0x24')](respondWithResult(_0x350208,null))[_0xb1ec('0x45')](handleError(_0x350208,null));};exports[_0xb1ec('0x25')]=function(_0x1ee3cb,_0x310681){return db[_0xb1ec('0x41')][_0xb1ec('0x49')]({'where':{'id':_0x1ee3cb[_0xb1ec('0x47')]['id']}})[_0xb1ec('0x24')](handleEntityNotFound(_0x310681,null))[_0xb1ec('0x24')](removeEntity(_0x310681,null))['catch'](handleError(_0x310681,null));};exports['test']=function(_0x37fc74,_0x4cc25d,_0xc72876){var _0xb4591c;return db[_0xb1ec('0x41')]['find']({'where':{'id':_0x37fc74['params']['id']},'attributes':['id','dsn']})[_0xb1ec('0x24')](handleEntityNotFound(_0x4cc25d,null))[_0xb1ec('0x24')](function(_0x1fb034){if(_0x1fb034){var _0x1ecd73=require(_0xb1ec('0x52'))();_0x1ecd73[_0xb1ec('0x53')](_0x1fb034[_0xb1ec('0x54')]);_0x1ecd73[_0xb1ec('0x55')]();return _0x1fb034;}})[_0xb1ec('0x24')](respondWithResult(_0x4cc25d,null))[_0xb1ec('0x45')](handleError(_0x4cc25d,null));}; \ No newline at end of file +var _0xc440=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../components/parsers/qs'];(function(_0x25110a,_0x3b3852){var _0xe42822=function(_0x283a82){while(--_0x283a82){_0x25110a['push'](_0x25110a['shift']());}};_0xe42822(++_0x3b3852);}(_0xc440,0xa0));var _0x0c44=function(_0x1fb977,_0x1efdea){_0x1fb977=_0x1fb977-0x0;var _0x37fb64=_0xc440[_0x1fb977];return _0x37fb64;};'use strict';var emlformat=require(_0x0c44('0x0'));var rimraf=require(_0x0c44('0x1'));var zipdir=require(_0x0c44('0x2'));var jsonpatch=require(_0x0c44('0x3'));var rp=require(_0x0c44('0x4'));var moment=require(_0x0c44('0x5'));var BPromise=require(_0x0c44('0x6'));var Mustache=require(_0x0c44('0x7'));var util=require(_0x0c44('0x8'));var path=require('path');var sox=require(_0x0c44('0x9'));var csv=require('to-csv');var ejs=require(_0x0c44('0xa'));var fs=require('fs');var fs_extra=require(_0x0c44('0xb'));var _=require(_0x0c44('0xc'));var squel=require(_0x0c44('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c44('0xe'));var querystring=require(_0x0c44('0xf'));var Papa=require('papaparse');var Redis=require(_0x0c44('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0c44('0x11'));var as=require(_0x0c44('0x12'));var hardwareService=require(_0x0c44('0x13'));var logger=require('../../config/logger')(_0x0c44('0x14'));var utils=require(_0x0c44('0x15'));var config=require(_0x0c44('0x16'));var licenseUtil=require(_0x0c44('0x17'));var db=require(_0x0c44('0x18'))['db'];function respondWithStatusCode(_0x4b403d,_0x5df441){_0x5df441=_0x5df441||0xcc;return function(_0x494c21){if(_0x494c21){return _0x4b403d[_0x0c44('0x19')](_0x5df441);}return _0x4b403d[_0x0c44('0x1a')](_0x5df441)[_0x0c44('0x1b')]();};}function respondWithResult(_0x401df9,_0x386e4a){_0x386e4a=_0x386e4a||0xc8;return function(_0x40c2c1){if(_0x40c2c1){return _0x401df9['status'](_0x386e4a)[_0x0c44('0x1c')](_0x40c2c1);}};}function respondWithFilteredResult(_0x4d501a,_0x278fe3){return function(_0xc8caab){if(_0xc8caab){var _0xe1c9c5=typeof _0x278fe3[_0x0c44('0x1d')]===_0x0c44('0x1e')&&typeof _0x278fe3[_0x0c44('0x1f')]===_0x0c44('0x1e');var _0x467928=_0xc8caab[_0x0c44('0x20')];var _0x10e88d=_0xe1c9c5?0x0:_0x278fe3[_0x0c44('0x1d')];var _0x580cae=_0xe1c9c5?_0xc8caab['count']:_0x278fe3[_0x0c44('0x1d')]+_0x278fe3[_0x0c44('0x1f')];var _0x3fc545;if(_0x580cae>=_0x467928){_0x580cae=_0x467928;_0x3fc545=0xc8;}else{_0x3fc545=0xce;}_0x4d501a[_0x0c44('0x1a')](_0x3fc545);return _0x4d501a[_0x0c44('0x21')](_0x0c44('0x22'),_0x10e88d+'-'+_0x580cae+'/'+_0x467928)[_0x0c44('0x1c')](_0xc8caab);}return null;};}function patchUpdates(_0x2d013a){return function(_0xedab5d){try{jsonpatch[_0x0c44('0x23')](_0xedab5d,_0x2d013a,!![]);}catch(_0x2bee74){return BPromise[_0x0c44('0x24')](_0x2bee74);}return _0xedab5d['save']();};}function saveUpdates(_0x21aa89,_0x239b1e){return function(_0x46ef27){if(_0x46ef27){return _0x46ef27[_0x0c44('0x25')](_0x21aa89)[_0x0c44('0x26')](function(_0x2a86f6){return _0x2a86f6;});}return null;};}function removeEntity(_0x3f8700,_0x4f6528){return function(_0x5bf9a6){if(_0x5bf9a6){return _0x5bf9a6['destroy']()['then'](function(){var _0x336505=_0x5bf9a6[_0x0c44('0x27')]({'plain':!![]});var _0x4d6dfe=_0x0c44('0x28');return db[_0x0c44('0x29')][_0x0c44('0x2a')]({'where':{'type':_0x4d6dfe,'resourceId':_0x336505['id']}})[_0x0c44('0x26')](function(){return _0x5bf9a6;});})['then'](function(){_0x3f8700[_0x0c44('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e798d,_0x17b91c){return function(_0x1e51fc){if(!_0x1e51fc){_0x5e798d[_0x0c44('0x19')](0x194);}return _0x1e51fc;};}function handleError(_0x256577,_0x35be85){_0x35be85=_0x35be85||0x1f4;return function(_0x47e6a6){logger[_0x0c44('0x2b')](_0x47e6a6[_0x0c44('0x2c')]);if(_0x47e6a6[_0x0c44('0x2d')]){delete _0x47e6a6[_0x0c44('0x2d')];}_0x256577['status'](_0x35be85)['send'](_0x47e6a6);};}exports['index']=function(_0x4eb00b,_0x591aad){var _0x2fe5f4={},_0x470f33={},_0x2b6402={'count':0x0,'rows':[]};var _0x585430=_[_0x0c44('0x2e')](db[_0x0c44('0x2f')][_0x0c44('0x30')],function(_0x5542c5){return{'name':_0x5542c5[_0x0c44('0x31')],'type':_0x5542c5['type'][_0x0c44('0x32')]};});_0x470f33[_0x0c44('0x33')]=_[_0x0c44('0x2e')](_0x585430,_0x0c44('0x2d'));_0x470f33['query']=_[_0x0c44('0x34')](_0x4eb00b['query']);_0x470f33[_0x0c44('0x35')]=_['intersection'](_0x470f33[_0x0c44('0x33')],_0x470f33[_0x0c44('0x36')]);_0x2fe5f4[_0x0c44('0x37')]=_[_0x0c44('0x38')](_0x470f33[_0x0c44('0x33')],qs['fields'](_0x4eb00b[_0x0c44('0x36')][_0x0c44('0x39')]));_0x2fe5f4[_0x0c44('0x37')]=_0x2fe5f4[_0x0c44('0x37')][_0x0c44('0x3a')]?_0x2fe5f4[_0x0c44('0x37')]:_0x470f33['model'];if(!_0x4eb00b['query'][_0x0c44('0x3b')](_0x0c44('0x3c'))){_0x2fe5f4[_0x0c44('0x1f')]=qs[_0x0c44('0x1f')](_0x4eb00b[_0x0c44('0x36')][_0x0c44('0x1f')]);_0x2fe5f4[_0x0c44('0x1d')]=qs['offset'](_0x4eb00b[_0x0c44('0x36')][_0x0c44('0x1d')]);}_0x2fe5f4[_0x0c44('0x3d')]=qs[_0x0c44('0x3e')](_0x4eb00b['query'][_0x0c44('0x3e')]);_0x2fe5f4[_0x0c44('0x3f')]=qs[_0x0c44('0x35')](_[_0x0c44('0x40')](_0x4eb00b[_0x0c44('0x36')],_0x470f33[_0x0c44('0x35')]),_0x585430);if(_0x4eb00b[_0x0c44('0x36')][_0x0c44('0x41')]){_0x2fe5f4['where']=_[_0x0c44('0x42')](_0x2fe5f4[_0x0c44('0x3f')],{'$or':_['map'](_0x585430,function(_0x50e825){if(_0x50e825[_0x0c44('0x43')]!==_0x0c44('0x44')){var _0x2a340d={};_0x2a340d[_0x50e825[_0x0c44('0x2d')]]={'$like':'%'+_0x4eb00b[_0x0c44('0x36')][_0x0c44('0x41')]+'%'};return _0x2a340d;}})});}_0x2fe5f4=_[_0x0c44('0x42')]({},_0x2fe5f4,_0x4eb00b['options']);var _0x35021={'where':_0x2fe5f4[_0x0c44('0x3f')]};return db[_0x0c44('0x2f')][_0x0c44('0x20')](_0x35021)[_0x0c44('0x26')](function(_0xbe37ca){_0x2b6402[_0x0c44('0x20')]=_0xbe37ca;if(_0x4eb00b[_0x0c44('0x36')][_0x0c44('0x45')]){_0x2fe5f4[_0x0c44('0x46')]=[{'all':!![]}];}return db[_0x0c44('0x2f')][_0x0c44('0x47')](_0x2fe5f4);})['then'](function(_0x57d54d){_0x2b6402[_0x0c44('0x48')]=_0x57d54d;return _0x2b6402;})['then'](respondWithFilteredResult(_0x591aad,_0x2fe5f4))['catch'](handleError(_0x591aad,null));};exports['show']=function(_0x233ed2,_0x241516){var _0x521b47={'raw':!![],'where':{'id':_0x233ed2[_0x0c44('0x49')]['id']}},_0xb37552={};_0xb37552[_0x0c44('0x33')]=_[_0x0c44('0x34')](db['SquareOdbc'][_0x0c44('0x30')]);_0xb37552[_0x0c44('0x36')]=_[_0x0c44('0x34')](_0x233ed2['query']);_0xb37552[_0x0c44('0x35')]=_[_0x0c44('0x38')](_0xb37552[_0x0c44('0x33')],_0xb37552[_0x0c44('0x36')]);_0x521b47['attributes']=_[_0x0c44('0x38')](_0xb37552[_0x0c44('0x33')],qs[_0x0c44('0x39')](_0x233ed2[_0x0c44('0x36')][_0x0c44('0x39')]));_0x521b47[_0x0c44('0x37')]=_0x521b47[_0x0c44('0x37')][_0x0c44('0x3a')]?_0x521b47['attributes']:_0xb37552[_0x0c44('0x33')];if(_0x233ed2[_0x0c44('0x36')][_0x0c44('0x45')]){_0x521b47[_0x0c44('0x46')]=[{'all':!![]}];}_0x521b47=_[_0x0c44('0x42')]({},_0x521b47,_0x233ed2[_0x0c44('0x4a')]);return db[_0x0c44('0x2f')][_0x0c44('0x4b')](_0x521b47)[_0x0c44('0x26')](handleEntityNotFound(_0x241516,null))[_0x0c44('0x26')](respondWithResult(_0x241516,null))['catch'](handleError(_0x241516,null));};exports['create']=function(_0xd1b9ef,_0x468434){return db[_0x0c44('0x2f')][_0x0c44('0x4c')](_0xd1b9ef[_0x0c44('0x4d')],{})[_0x0c44('0x26')](function(_0x310acc){var _0x591ef8=_0xd1b9ef[_0x0c44('0x4e')][_0x0c44('0x27')]({'plain':!![]});if(!_0x591ef8)throw new Error(_0x0c44('0x4f'));if(_0x591ef8[_0x0c44('0x50')]==='user'){var _0x2cb51e=_0x310acc[_0x0c44('0x27')]({'plain':!![]});var _0x2f5b91=_0x0c44('0x28');return db[_0x0c44('0x51')]['find']({'where':{'name':_0x2f5b91,'userProfileId':_0x591ef8['userProfileId']},'raw':!![]})[_0x0c44('0x26')](function(_0x50bcb7){if(_0x50bcb7&&_0x50bcb7[_0x0c44('0x52')]===0x0){return db[_0x0c44('0x29')][_0x0c44('0x4c')]({'name':_0x2cb51e[_0x0c44('0x2d')],'resourceId':_0x2cb51e['id'],'type':_0x50bcb7[_0x0c44('0x2d')],'sectionId':_0x50bcb7['id']},{})[_0x0c44('0x26')](function(){return _0x310acc;});}else{return _0x310acc;}})[_0x0c44('0x53')](function(_0x2b455f){logger[_0x0c44('0x2b')](_0x0c44('0x54'),_0x2b455f);throw _0x2b455f;});}return _0x310acc;})[_0x0c44('0x26')](respondWithResult(_0x468434,0xc9))[_0x0c44('0x53')](handleError(_0x468434,null));};exports[_0x0c44('0x25')]=function(_0x17c22c,_0x5e2ec3){if(_0x17c22c['body']['id']){delete _0x17c22c[_0x0c44('0x4d')]['id'];}return db[_0x0c44('0x2f')][_0x0c44('0x4b')]({'where':{'id':_0x17c22c[_0x0c44('0x49')]['id']}})[_0x0c44('0x26')](handleEntityNotFound(_0x5e2ec3,null))[_0x0c44('0x26')](saveUpdates(_0x17c22c['body'],null))[_0x0c44('0x26')](respondWithResult(_0x5e2ec3,null))['catch'](handleError(_0x5e2ec3,null));};exports[_0x0c44('0x2a')]=function(_0x2406a3,_0x387d83){return db[_0x0c44('0x2f')][_0x0c44('0x4b')]({'where':{'id':_0x2406a3[_0x0c44('0x49')]['id']}})[_0x0c44('0x26')](handleEntityNotFound(_0x387d83,null))[_0x0c44('0x26')](removeEntity(_0x387d83,null))[_0x0c44('0x53')](handleError(_0x387d83,null));};exports[_0x0c44('0x55')]=function(_0x341efb,_0x2b50a9,_0x1bdd97){var _0x1c3c61;return db[_0x0c44('0x2f')][_0x0c44('0x4b')]({'where':{'id':_0x341efb[_0x0c44('0x49')]['id']},'attributes':['id',_0x0c44('0x56')]})['then'](handleEntityNotFound(_0x2b50a9,null))[_0x0c44('0x26')](function(_0x44ee02){if(_0x44ee02){var _0x39e141=require('odbc')();_0x39e141[_0x0c44('0x57')](_0x44ee02['dsn']);_0x39e141[_0x0c44('0x58')]();return _0x44ee02;}})[_0x0c44('0x26')](respondWithResult(_0x2b50a9,null))[_0x0c44('0x53')](handleError(_0x2b50a9,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e5f3204..1af8a89 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 _0xbbe1=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./squareOdbc.attributes','define','square_odbc'];(function(_0x3adf99,_0x37dc7a){var _0x42db48=function(_0x36a368){while(--_0x36a368){_0x3adf99['push'](_0x3adf99['shift']());}};_0x42db48(++_0x37dc7a);}(_0xbbe1,0x10e));var _0x1bbe=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xbbe1[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x1bbe('0x0'));var util=require(_0x1bbe('0x1'));var logger=require(_0x1bbe('0x2'))(_0x1bbe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1bbe('0x4'));var fs=require('fs');var path=require(_0x1bbe('0x5'));var rimraf=require(_0x1bbe('0x6'));var config=require('../../config/environment');var attributes=require(_0x1bbe('0x7'));module['exports']=function(_0x3d4a74,_0xa1e4c5){return _0x3d4a74[_0x1bbe('0x8')]('SquareOdbc',attributes,{'tableName':_0x1bbe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6e5=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','moment','bluebird'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0xb6e5,0x1c3));var _0x5b6e=function(_0x27b1c5,_0x1effcc){_0x27b1c5=_0x27b1c5-0x0;var _0x2915a2=_0xb6e5[_0x27b1c5];return _0x2915a2;};'use strict';var _=require(_0x5b6e('0x0'));var util=require('util');var logger=require(_0x5b6e('0x1'))('api');var moment=require(_0x5b6e('0x2'));var BPromise=require(_0x5b6e('0x3'));var rp=require(_0x5b6e('0x4'));var fs=require('fs');var path=require(_0x5b6e('0x5'));var rimraf=require(_0x5b6e('0x6'));var config=require(_0x5b6e('0x7'));var attributes=require(_0x5b6e('0x8'));module[_0x5b6e('0x9')]=function(_0x1ffe0f,_0x5a3d06){return _0x1ffe0f[_0x5b6e('0xa')](_0x5b6e('0xb'),attributes,{'tableName':_0x5b6e('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 08ae5a7..0e6a239 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 _0x1a3b=['jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','options','raw','where','attributes','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x41fd84,_0x1f67be){var _0x3f3862=function(_0x6ec685){while(--_0x6ec685){_0x41fd84['push'](_0x41fd84['shift']());}};_0x3f3862(++_0x1f67be);}(_0x1a3b,0x12d));var _0xb1a3=function(_0x1c2c2b,_0x4edc25){_0x1c2c2b=_0x1c2c2b-0x0;var _0x142695=_0x1a3b[_0x1c2c2b];return _0x142695;};'use strict';var _=require(_0xb1a3('0x0'));var util=require('util');var moment=require(_0xb1a3('0x1'));var BPromise=require(_0xb1a3('0x2'));var rs=require(_0xb1a3('0x3'));var fs=require('fs');var Redis=require(_0xb1a3('0x4'));var db=require(_0xb1a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1a3('0x6'))(_0xb1a3('0x7'));var config=require(_0xb1a3('0x8'));var jayson=require(_0xb1a3('0x9'));var client=jayson[_0xb1a3('0xa')][_0xb1a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x331591,_0x1d3a6e,_0x4e4d72){return new BPromise(function(_0x4ff489,_0x2cfa77){return client[_0xb1a3('0xc')](_0x331591,_0x4e4d72)['then'](function(_0x276bde){logger[_0xb1a3('0xd')](_0xb1a3('0xe'),_0x1d3a6e,'request\x20sent');logger[_0xb1a3('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1d3a6e,_0xb1a3('0x10'),JSON[_0xb1a3('0x11')](_0x276bde));if(_0x276bde[_0xb1a3('0x12')]){if(_0x276bde[_0xb1a3('0x12')][_0xb1a3('0x13')]===0x1f4){logger[_0xb1a3('0x12')](_0xb1a3('0xe'),_0x1d3a6e,_0x276bde[_0xb1a3('0x12')]['message']);return _0x2cfa77(_0x276bde[_0xb1a3('0x12')][_0xb1a3('0x14')]);}logger['error'](_0xb1a3('0xe'),_0x1d3a6e,_0x276bde['error'][_0xb1a3('0x14')]);return _0x4ff489(_0x276bde[_0xb1a3('0x12')][_0xb1a3('0x14')]);}else{logger['info'](_0xb1a3('0xe'),_0x1d3a6e,_0xb1a3('0x10'));_0x4ff489(_0x276bde[_0xb1a3('0x15')][_0xb1a3('0x14')]);}})[_0xb1a3('0x16')](function(_0xc8f053){logger[_0xb1a3('0x12')](_0xb1a3('0xe'),_0x1d3a6e,_0xc8f053);_0x2cfa77(_0xc8f053);});});}exports[_0xb1a3('0x17')]=function(_0x44e58a){var _0x180117=this;return new Promise(function(_0x454153,_0x44163d){return db['SquareOdbc']['find']({'raw':_0x44e58a['options']?_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x19')]===undefined?!![]:![]:!![],'where':_0x44e58a[_0xb1a3('0x18')]?_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x1a')]||null:null,'attributes':_0x44e58a[_0xb1a3('0x18')]?_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x1b')]||null:null,'include':_0x44e58a[_0xb1a3('0x18')]?_0x44e58a[_0xb1a3('0x18')]['include']?_[_0xb1a3('0x1c')](_0x44e58a[_0xb1a3('0x18')][_0xb1a3('0x1d')],function(_0x401783){return{'model':db[_0x401783[_0xb1a3('0x1e')]],'as':_0x401783['as'],'attributes':_0x401783[_0xb1a3('0x1b')],'include':_0x401783[_0xb1a3('0x1d')]?_[_0xb1a3('0x1c')](_0x401783[_0xb1a3('0x1d')],function(_0x4220e3){return{'model':db[_0x4220e3[_0xb1a3('0x1e')]],'as':_0x4220e3['as'],'attributes':_0x4220e3[_0xb1a3('0x1b')],'include':_0x4220e3[_0xb1a3('0x1d')]?_[_0xb1a3('0x1c')](_0x4220e3[_0xb1a3('0x1d')],function(_0x5d1f27){return{'model':db[_0x5d1f27[_0xb1a3('0x1e')]],'as':_0x5d1f27['as'],'attributes':_0x5d1f27[_0xb1a3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x117b51){logger['info'](_0xb1a3('0x17'),_0x44e58a);logger[_0xb1a3('0xf')]('ShowSquareOdbc',_0x44e58a,JSON[_0xb1a3('0x11')](_0x117b51));_0x454153(_0x117b51);})[_0xb1a3('0x16')](function(_0x95ff18){logger[_0xb1a3('0x12')](_0xb1a3('0x17'),_0x95ff18[_0xb1a3('0x14')],_0x44e58a);_0x44163d(_0x180117[_0xb1a3('0x12')](0x1f4,_0x95ff18[_0xb1a3('0x14')]));});});}; \ No newline at end of file +var _0x77de=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','SquareOdbc,\x20%s,\x20%s','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','moment'];(function(_0x3e7e17,_0x39822f){var _0x195697=function(_0xbbe020){while(--_0xbbe020){_0x3e7e17['push'](_0x3e7e17['shift']());}};_0x195697(++_0x39822f);}(_0x77de,0x17d));var _0xe77d=function(_0x3d2d6f,_0x368872){_0x3d2d6f=_0x3d2d6f-0x0;var _0x5c0022=_0x77de[_0x3d2d6f];return _0x5c0022;};'use strict';var _=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var moment=require(_0xe77d('0x2'));var BPromise=require(_0xe77d('0x3'));var rs=require(_0xe77d('0x4'));var fs=require('fs');var Redis=require(_0xe77d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe77d('0x6'));var logger=require(_0xe77d('0x7'))(_0xe77d('0x8'));var config=require('../../config/environment');var jayson=require(_0xe77d('0x9'));var client=jayson[_0xe77d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x370430,_0x3100ae,_0x2ca3e4){return new BPromise(function(_0x4eb288,_0x1a3600){return client[_0xe77d('0xb')](_0x370430,_0x2ca3e4)[_0xe77d('0xc')](function(_0x5485fc){logger[_0xe77d('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x3100ae,_0xe77d('0xe'));logger[_0xe77d('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3100ae,'request\x20sent',JSON[_0xe77d('0x10')](_0x5485fc));if(_0x5485fc[_0xe77d('0x11')]){if(_0x5485fc['error'][_0xe77d('0x12')]===0x1f4){logger[_0xe77d('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x3100ae,_0x5485fc['error']['message']);return _0x1a3600(_0x5485fc[_0xe77d('0x11')][_0xe77d('0x13')]);}logger[_0xe77d('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x3100ae,_0x5485fc[_0xe77d('0x11')][_0xe77d('0x13')]);return _0x4eb288(_0x5485fc[_0xe77d('0x11')][_0xe77d('0x13')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x3100ae,_0xe77d('0xe'));_0x4eb288(_0x5485fc[_0xe77d('0x14')]['message']);}})[_0xe77d('0x15')](function(_0x3d03cd){logger[_0xe77d('0x11')](_0xe77d('0x16'),_0x3100ae,_0x3d03cd);_0x1a3600(_0x3d03cd);});});}exports[_0xe77d('0x17')]=function(_0x385436){var _0x5590fd=this;return new Promise(function(_0x2f57c5,_0x154258){return db['SquareOdbc'][_0xe77d('0x18')]({'raw':_0x385436[_0xe77d('0x19')]?_0x385436[_0xe77d('0x19')][_0xe77d('0x1a')]===undefined?!![]:![]:!![],'where':_0x385436[_0xe77d('0x19')]?_0x385436[_0xe77d('0x19')][_0xe77d('0x1b')]||null:null,'attributes':_0x385436[_0xe77d('0x19')]?_0x385436['options'][_0xe77d('0x1c')]||null:null,'include':_0x385436['options']?_0x385436[_0xe77d('0x19')][_0xe77d('0x1d')]?_[_0xe77d('0x1e')](_0x385436[_0xe77d('0x19')][_0xe77d('0x1d')],function(_0xe24e20){return{'model':db[_0xe24e20['model']],'as':_0xe24e20['as'],'attributes':_0xe24e20[_0xe77d('0x1c')],'include':_0xe24e20['include']?_[_0xe77d('0x1e')](_0xe24e20[_0xe77d('0x1d')],function(_0x1cdd42){return{'model':db[_0x1cdd42[_0xe77d('0x1f')]],'as':_0x1cdd42['as'],'attributes':_0x1cdd42['attributes'],'include':_0x1cdd42['include']?_[_0xe77d('0x1e')](_0x1cdd42['include'],function(_0x3b3a15){return{'model':db[_0x3b3a15[_0xe77d('0x1f')]],'as':_0x3b3a15['as'],'attributes':_0x3b3a15['attributes']};}):[]};}):[]};}):[]:[]})[_0xe77d('0xc')](function(_0x50aa1b){logger[_0xe77d('0xd')](_0xe77d('0x17'),_0x385436);logger['debug']('ShowSquareOdbc',_0x385436,JSON[_0xe77d('0x10')](_0x50aa1b));_0x2f57c5(_0x50aa1b);})[_0xe77d('0x15')](function(_0x13d452){logger[_0xe77d('0x11')](_0xe77d('0x17'),_0x13d452[_0xe77d('0x13')],_0x385436);_0x154258(_0x5590fd['error'](0x1f4,_0x13d452[_0xe77d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e177856..29f7f70 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 _0x1df7=['get','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1df7,0x6e));var _0x71df=function(_0x542c73,_0x307b9c){_0x542c73=_0x542c73-0x0;var _0x7d5f0e=_0x1df7[_0x542c73];return _0x7d5f0e;};'use strict';var multer=require('multer');var util=require(_0x71df('0x0'));var path=require(_0x71df('0x1'));var timeout=require(_0x71df('0x2'));var express=require(_0x71df('0x3'));var router=express[_0x71df('0x4')]();var fs_extra=require(_0x71df('0x5'));var auth=require(_0x71df('0x6'));var interaction=require(_0x71df('0x7'));var config=require(_0x71df('0x8'));var controller=require(_0x71df('0x9'));router[_0x71df('0xa')]('/',auth[_0x71df('0xb')](),controller['index']);router[_0x71df('0xa')]('/:id',auth[_0x71df('0xb')](),controller[_0x71df('0xc')]);router['get'](_0x71df('0xd'),auth['isAuthenticated'](),controller[_0x71df('0xe')]);router[_0x71df('0xf')]('/',auth['isAuthenticated'](),controller[_0x71df('0x10')]);router[_0x71df('0xf')](_0x71df('0xd'),auth['isAuthenticated'](),controller[_0x71df('0x11')]);router[_0x71df('0x12')]('/:id',auth[_0x71df('0xb')](),controller[_0x71df('0x13')]);router[_0x71df('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x71df('0x15')]);router[_0x71df('0x14')]('/:id/users',auth[_0x71df('0xb')](),controller[_0x71df('0x16')]);module[_0x71df('0x17')]=router; \ No newline at end of file +var _0x10d6=['update','destroy','removeUsers','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x10d6,0x145));var _0x610d=function(_0x15ba11,_0xbfc55){_0x15ba11=_0x15ba11-0x0;var _0x2f0018=_0x10d6[_0x15ba11];return _0x2f0018;};'use strict';var multer=require('multer');var util=require(_0x610d('0x0'));var path=require(_0x610d('0x1'));var timeout=require(_0x610d('0x2'));var express=require('express');var router=express[_0x610d('0x3')]();var fs_extra=require(_0x610d('0x4'));var auth=require(_0x610d('0x5'));var interaction=require(_0x610d('0x6'));var config=require(_0x610d('0x7'));var controller=require(_0x610d('0x8'));router[_0x610d('0x9')]('/',auth['isAuthenticated'](),controller[_0x610d('0xa')]);router[_0x610d('0x9')](_0x610d('0xb'),auth[_0x610d('0xc')](),controller[_0x610d('0xd')]);router[_0x610d('0x9')](_0x610d('0xe'),auth[_0x610d('0xc')](),controller[_0x610d('0xf')]);router[_0x610d('0x10')]('/',auth[_0x610d('0xc')](),controller[_0x610d('0x11')]);router[_0x610d('0x10')](_0x610d('0xe'),auth['isAuthenticated'](),controller[_0x610d('0x12')]);router[_0x610d('0x13')]('/:id',auth[_0x610d('0xc')](),controller[_0x610d('0x14')]);router['delete'](_0x610d('0xb'),auth[_0x610d('0xc')](),controller[_0x610d('0x15')]);router['delete'](_0x610d('0xe'),auth[_0x610d('0xc')](),controller[_0x610d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 284ddc2..8f8214c 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 _0x8135=['getDataValue','toString','long','utf8','DATE','exports','name','STRING','TEXT','BLOB','preproduction'];(function(_0x42a595,_0x2ba811){var _0x158276=function(_0x24766b){while(--_0x24766b){_0x42a595['push'](_0x42a595['shift']());}};_0x158276(++_0x2ba811);}(_0x8135,0x73));var _0x5813=function(_0x4236db,_0x4a53f4){_0x4236db=_0x4236db-0x0;var _0x16f203=_0x8135[_0x4236db];return _0x16f203;};'use strict';var Sequelize=require('sequelize');module[_0x5813('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5813('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x5813('0x2')]},'notes':{'type':Sequelize[_0x5813('0x3')]},'preproduction':{'type':Sequelize[_0x5813('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x5813('0x5'))){return this[_0x5813('0x6')](_0x5813('0x5'))[_0x5813('0x7')]('utf8');}}},'production':{'type':Sequelize[_0x5813('0x4')](_0x5813('0x8')),'get':function(){if(this[_0x5813('0x6')]('production')){return this[_0x5813('0x6')]('production')['toString'](_0x5813('0x9'));}}},'savedAt':{'type':Sequelize[_0x5813('0xa')]},'publishedAt':{'type':Sequelize[_0x5813('0xa')]}}; \ No newline at end of file +var _0x2c06=['utf8','production','DATE','sequelize','exports','STRING','BLOB','preproduction','getDataValue','toString'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x2c06,0x1cf));var _0x62c0=function(_0x4fdc4c,_0x1cade6){_0x4fdc4c=_0x4fdc4c-0x0;var _0x3e08a1=_0x2c06[_0x4fdc4c];return _0x3e08a1;};'use strict';var Sequelize=require(_0x62c0('0x0'));module[_0x62c0('0x1')]={'name':{'type':Sequelize[_0x62c0('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x62c0('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x62c0('0x3')]('long'),'get':function(){if(this['getDataValue'](_0x62c0('0x4'))){return this[_0x62c0('0x5')](_0x62c0('0x4'))[_0x62c0('0x6')](_0x62c0('0x7'));}}},'production':{'type':Sequelize[_0x62c0('0x3')]('long'),'get':function(){if(this[_0x62c0('0x5')]('production')){return this['getDataValue'](_0x62c0('0x8'))[_0x62c0('0x6')](_0x62c0('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x62c0('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 89b4b4f..d81ecca 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 _0x41ad=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','VIRTUAL','merge','options','SquareProject','count','includeAll','rows','catch','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User','sort','filter','nolimit','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','rawAttributes'];(function(_0x41609a,_0x232cb0){var _0x468097=function(_0x1d02e4){while(--_0x1d02e4){_0x41609a['push'](_0x41609a['shift']());}};_0x468097(++_0x232cb0);}(_0x41ad,0x154));var _0xd41a=function(_0x24445c,_0x184058){_0x24445c=_0x24445c-0x0;var _0x54b013=_0x41ad[_0x24445c];return _0x54b013;};'use strict';var emlformat=require(_0xd41a('0x0'));var rimraf=require(_0xd41a('0x1'));var zipdir=require(_0xd41a('0x2'));var jsonpatch=require(_0xd41a('0x3'));var rp=require(_0xd41a('0x4'));var moment=require(_0xd41a('0x5'));var BPromise=require(_0xd41a('0x6'));var Mustache=require(_0xd41a('0x7'));var util=require(_0xd41a('0x8'));var path=require(_0xd41a('0x9'));var sox=require(_0xd41a('0xa'));var csv=require('to-csv');var ejs=require(_0xd41a('0xb'));var fs=require('fs');var fs_extra=require(_0xd41a('0xc'));var _=require(_0xd41a('0xd'));var squel=require(_0xd41a('0xe'));var crypto=require(_0xd41a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd41a('0x10'));var toCsv=require(_0xd41a('0x11'));var querystring=require(_0xd41a('0x12'));var Papa=require('papaparse');var Redis=require(_0xd41a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd41a('0x14'));var logger=require(_0xd41a('0x15'))(_0xd41a('0x16'));var utils=require(_0xd41a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd41a('0x18'));var db=require(_0xd41a('0x19'))['db'];config[_0xd41a('0x1a')]=_[_0xd41a('0x1b')](config[_0xd41a('0x1a')],{'host':_0xd41a('0x1c'),'port':0x18eb});var socket=require(_0xd41a('0x1d'))(new Redis(config[_0xd41a('0x1a')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x400d0a,_0x14f92e){_0x14f92e=_0x14f92e||0xcc;return function(_0x338379){if(_0x338379){return _0x400d0a['sendStatus'](_0x14f92e);}return _0x400d0a[_0xd41a('0x1e')](_0x14f92e)[_0xd41a('0x1f')]();};}function respondWithResult(_0x2ea3ef,_0x2a2420){_0x2a2420=_0x2a2420||0xc8;return function(_0x1b3db2){if(_0x1b3db2){return _0x2ea3ef['status'](_0x2a2420)[_0xd41a('0x20')](_0x1b3db2);}};}function respondWithFilteredResult(_0x2ebf80,_0x30a146){return function(_0x46c253){if(_0x46c253){var _0x3f7868=typeof _0x30a146[_0xd41a('0x21')]===_0xd41a('0x22')&&typeof _0x30a146[_0xd41a('0x23')]==='undefined';var _0x37a269=_0x46c253['count'];var _0x5ed1f5=_0x3f7868?0x0:_0x30a146[_0xd41a('0x21')];var _0x5cbd9a=_0x3f7868?_0x46c253['count']:_0x30a146[_0xd41a('0x21')]+_0x30a146['limit'];var _0x19fa1d;if(_0x5cbd9a>=_0x37a269){_0x5cbd9a=_0x37a269;_0x19fa1d=0xc8;}else{_0x19fa1d=0xce;}_0x2ebf80[_0xd41a('0x1e')](_0x19fa1d);return _0x2ebf80[_0xd41a('0x24')](_0xd41a('0x25'),_0x5ed1f5+'-'+_0x5cbd9a+'/'+_0x37a269)[_0xd41a('0x20')](_0x46c253);}return null;};}function patchUpdates(_0x203aa8){return function(_0x31f150){try{jsonpatch[_0xd41a('0x26')](_0x31f150,_0x203aa8,!![]);}catch(_0x2e9809){return BPromise['reject'](_0x2e9809);}return _0x31f150[_0xd41a('0x27')]();};}function saveUpdates(_0x1f9f2b,_0x31322a){return function(_0x1400f1){if(_0x1400f1){return _0x1400f1[_0xd41a('0x28')](_0x1f9f2b)[_0xd41a('0x29')](function(_0x3c9ec7){return _0x3c9ec7;});}return null;};}function removeEntity(_0x34b4ae,_0x4be9ef){return function(_0x56da5f){if(_0x56da5f){return _0x56da5f[_0xd41a('0x2a')]()[_0xd41a('0x29')](function(){var _0x4dd779=_0x56da5f[_0xd41a('0x2b')]({'plain':!![]});var _0x5b553a='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x5b553a,'resourceId':_0x4dd779['id']}})[_0xd41a('0x29')](function(){return _0x56da5f;});})['then'](function(){_0x34b4ae[_0xd41a('0x1e')](0xcc)[_0xd41a('0x1f')]();});}};}function handleEntityNotFound(_0x8dec0b,_0x1d41b2){return function(_0x22cead){if(!_0x22cead){_0x8dec0b[_0xd41a('0x2c')](0x194);}return _0x22cead;};}function handleError(_0x31e04c,_0xb7a820){_0xb7a820=_0xb7a820||0x1f4;return function(_0x392f89){logger[_0xd41a('0x2d')](_0x392f89[_0xd41a('0x2e')]);if(_0x392f89[_0xd41a('0x2f')]){delete _0x392f89['name'];}_0x31e04c[_0xd41a('0x1e')](_0xb7a820)[_0xd41a('0x30')](_0x392f89);};}exports[_0xd41a('0x31')]=function(_0x162370,_0x57b451){var _0x4430c5={},_0x50d339={},_0x2558e3={'count':0x0,'rows':[]};var _0x1bd86d=_[_0xd41a('0x32')](db['SquareProject'][_0xd41a('0x33')],function(_0x393e67){return{'name':_0x393e67[_0xd41a('0x34')],'type':_0x393e67['type'][_0xd41a('0x35')]};});_0x50d339[_0xd41a('0x36')]=_[_0xd41a('0x32')](_0x1bd86d,_0xd41a('0x2f'));_0x50d339[_0xd41a('0x37')]=_[_0xd41a('0x38')](_0x162370[_0xd41a('0x37')]);_0x50d339[_0xd41a('0x39')]=_[_0xd41a('0x3a')](_0x50d339[_0xd41a('0x36')],_0x50d339[_0xd41a('0x37')]);_0x4430c5[_0xd41a('0x3b')]=_[_0xd41a('0x3a')](_0x50d339['model'],qs[_0xd41a('0x3c')](_0x162370[_0xd41a('0x37')][_0xd41a('0x3c')]));_0x4430c5[_0xd41a('0x3b')]=_0x4430c5[_0xd41a('0x3b')][_0xd41a('0x3d')]?_0x4430c5['attributes']:_0x50d339[_0xd41a('0x36')];if(!_0x162370[_0xd41a('0x37')][_0xd41a('0x3e')]('nolimit')){_0x4430c5[_0xd41a('0x23')]=qs[_0xd41a('0x23')](_0x162370[_0xd41a('0x37')][_0xd41a('0x23')]);_0x4430c5[_0xd41a('0x21')]=qs[_0xd41a('0x21')](_0x162370[_0xd41a('0x37')]['offset']);}_0x4430c5[_0xd41a('0x3f')]=qs['sort'](_0x162370[_0xd41a('0x37')]['sort']);_0x4430c5[_0xd41a('0x40')]=qs[_0xd41a('0x39')](_[_0xd41a('0x41')](_0x162370[_0xd41a('0x37')],_0x50d339[_0xd41a('0x39')]),_0x1bd86d);if(_0x162370[_0xd41a('0x37')]['filter']){_0x4430c5[_0xd41a('0x40')]=_['merge'](_0x4430c5[_0xd41a('0x40')],{'$or':_[_0xd41a('0x32')](_0x1bd86d,function(_0x2b5032){if(_0x2b5032['type']!==_0xd41a('0x42')){var _0x4e2918={};_0x4e2918[_0x2b5032['name']]={'$like':'%'+_0x162370[_0xd41a('0x37')]['filter']+'%'};return _0x4e2918;}})});}_0x4430c5=_[_0xd41a('0x43')]({},_0x4430c5,_0x162370[_0xd41a('0x44')]);var _0xe51491={'where':_0x4430c5[_0xd41a('0x40')]};return db[_0xd41a('0x45')][_0xd41a('0x46')](_0xe51491)[_0xd41a('0x29')](function(_0x57a3c8){_0x2558e3['count']=_0x57a3c8;if(_0x162370['query'][_0xd41a('0x47')]){_0x4430c5['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x4430c5);})[_0xd41a('0x29')](function(_0x36efed){_0x2558e3[_0xd41a('0x48')]=_0x36efed;return _0x2558e3;})['then'](respondWithFilteredResult(_0x57b451,_0x4430c5))[_0xd41a('0x49')](handleError(_0x57b451,null));};exports['show']=function(_0x7671d1,_0x18dfe3){var _0x51d0ab={'raw':![],'where':{'id':_0x7671d1[_0xd41a('0x4a')]['id']}},_0x5d2ed1={};_0x5d2ed1[_0xd41a('0x36')]=_[_0xd41a('0x38')](db['SquareProject'][_0xd41a('0x33')]);_0x5d2ed1[_0xd41a('0x37')]=_[_0xd41a('0x38')](_0x7671d1[_0xd41a('0x37')]);_0x5d2ed1['filters']=_['intersection'](_0x5d2ed1[_0xd41a('0x36')],_0x5d2ed1[_0xd41a('0x37')]);_0x51d0ab['attributes']=_[_0xd41a('0x3a')](_0x5d2ed1['model'],qs[_0xd41a('0x3c')](_0x7671d1[_0xd41a('0x37')][_0xd41a('0x3c')]));_0x51d0ab[_0xd41a('0x3b')]=_0x51d0ab[_0xd41a('0x3b')][_0xd41a('0x3d')]?_0x51d0ab[_0xd41a('0x3b')]:_0x5d2ed1[_0xd41a('0x36')];if(_0x7671d1[_0xd41a('0x37')]['includeAll']){_0x51d0ab[_0xd41a('0x4b')]=[{'all':!![]}];}_0x51d0ab=_[_0xd41a('0x43')]({},_0x51d0ab,_0x7671d1['options']);return db[_0xd41a('0x45')][_0xd41a('0x4c')](_0x51d0ab)[_0xd41a('0x29')](handleEntityNotFound(_0x18dfe3,null))[_0xd41a('0x29')](respondWithResult(_0x18dfe3,null))[_0xd41a('0x49')](handleError(_0x18dfe3,null));};exports[_0xd41a('0x4d')]=function(_0x4525fc,_0x354a20){return db[_0xd41a('0x45')][_0xd41a('0x4d')](_0x4525fc['body'],{})[_0xd41a('0x29')](function(_0x321e9c){var _0x1688c3=_0x4525fc['user'][_0xd41a('0x2b')]({'plain':!![]});if(!_0x1688c3)throw new Error(_0xd41a('0x4e'));if(_0x1688c3['role']===_0xd41a('0x4f')){var _0x303620=_0x321e9c[_0xd41a('0x2b')]({'plain':!![]});var _0xadc5d7=_0xd41a('0x50');return db[_0xd41a('0x51')]['find']({'where':{'name':_0xadc5d7,'userProfileId':_0x1688c3[_0xd41a('0x52')]},'raw':!![]})[_0xd41a('0x29')](function(_0x5b0ac0){if(_0x5b0ac0&&_0x5b0ac0[_0xd41a('0x53')]===0x0){return db[_0xd41a('0x54')]['create']({'name':_0x303620[_0xd41a('0x2f')],'resourceId':_0x303620['id'],'type':_0x5b0ac0['name'],'sectionId':_0x5b0ac0['id']},{})[_0xd41a('0x29')](function(){return _0x321e9c;});}else{return _0x321e9c;}})['catch'](function(_0x5b08e6){logger['error'](_0xd41a('0x55'),_0x5b08e6);throw _0x5b08e6;});}return _0x321e9c;})['then'](respondWithResult(_0x354a20,0xc9))[_0xd41a('0x49')](handleError(_0x354a20,null));};exports[_0xd41a('0x28')]=function(_0xed095d,_0x4229d3){if(_0xed095d[_0xd41a('0x56')]['id']){delete _0xed095d[_0xd41a('0x56')]['id'];}return db['SquareProject']['find']({'where':{'id':_0xed095d[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x4229d3,null))[_0xd41a('0x29')](saveUpdates(_0xed095d['body'],null))['then'](respondWithResult(_0x4229d3,null))['catch'](handleError(_0x4229d3,null));};exports[_0xd41a('0x2a')]=function(_0x59a75a,_0x2cf8a8){return db['SquareProject']['find']({'where':{'id':_0x59a75a[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x2cf8a8,null))[_0xd41a('0x29')](removeEntity(_0x2cf8a8,null))[_0xd41a('0x49')](handleError(_0x2cf8a8,null));};exports[_0xd41a('0x57')]=function(_0x59c986,_0x7f94a9,_0x3e5182){return db[_0xd41a('0x45')][_0xd41a('0x4c')]({'where':{'id':_0x59c986[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x7f94a9,null))[_0xd41a('0x29')](function(_0x797a8){if(_0x797a8){return _0x797a8[_0xd41a('0x57')](_0x59c986[_0xd41a('0x56')][_0xd41a('0x58')],_[_0xd41a('0x59')](_0x59c986[_0xd41a('0x56')],['ids','id'])||{});}})[_0xd41a('0x29')](respondWithResult(_0x7f94a9,null))[_0xd41a('0x49')](handleError(_0x7f94a9,null));};exports[_0xd41a('0x5a')]=function(_0x309fd0,_0x373187,_0x54cba2){return db[_0xd41a('0x45')]['find']({'where':{'id':_0x309fd0[_0xd41a('0x4a')]['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x373187,null))[_0xd41a('0x29')](function(_0x4e772f){if(_0x4e772f){return _0x4e772f['removeUsers'](_0x309fd0[_0xd41a('0x37')][_0xd41a('0x58')])['then'](function(){if(_['isArray'](_0x309fd0[_0xd41a('0x37')][_0xd41a('0x58')])){for(var _0x2bcbdf=0x0;_0x2bcbdf<_0x309fd0['query'][_0xd41a('0x58')][_0xd41a('0x3d')];_0x2bcbdf+=0x1){socket[_0xd41a('0x5b')](_0xd41a('0x5c'),{'UserId':Number(_0x309fd0[_0xd41a('0x37')][_0xd41a('0x58')][_0x2bcbdf]),'SquareProjectId':Number(_0x309fd0[_0xd41a('0x4a')]['id'])});}}else{socket[_0xd41a('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x309fd0[_0xd41a('0x37')]['ids']),'SquareProjectId':Number(_0x309fd0['params']['id'])});}});}})[_0xd41a('0x29')](respondWithStatusCode(_0x373187,null))[_0xd41a('0x49')](handleError(_0x373187,null));};exports[_0xd41a('0x5d')]=function(_0x3a4c54,_0x14ed8b,_0xcc47d4){var _0x203f01={};var _0x48ace2={};var _0x56a3d9;var _0x5889d7;return db[_0xd41a('0x45')]['findOne']({'where':{'id':_0x3a4c54['params']['id']}})[_0xd41a('0x29')](handleEntityNotFound(_0x14ed8b,null))[_0xd41a('0x29')](function(_0xb0fc89){if(_0xb0fc89){_0x56a3d9=_0xb0fc89;_0x48ace2['model']=_[_0xd41a('0x38')](db[_0xd41a('0x5e')][_0xd41a('0x33')]);_0x48ace2[_0xd41a('0x37')]=_[_0xd41a('0x38')](_0x3a4c54[_0xd41a('0x37')]);_0x48ace2[_0xd41a('0x39')]=_['intersection'](_0x48ace2['model'],_0x48ace2['query']);_0x203f01['attributes']=_[_0xd41a('0x3a')](_0x48ace2[_0xd41a('0x36')],qs[_0xd41a('0x3c')](_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x3c')]));_0x203f01[_0xd41a('0x3b')]=_0x203f01['attributes']['length']?_0x203f01[_0xd41a('0x3b')]:_0x48ace2['model'];_0x203f01[_0xd41a('0x3f')]=qs[_0xd41a('0x5f')](_0x3a4c54['query'][_0xd41a('0x5f')]);_0x203f01[_0xd41a('0x40')]=qs[_0xd41a('0x39')](_['pick'](_0x3a4c54[_0xd41a('0x37')],_0x48ace2[_0xd41a('0x39')]));if(_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x60')]){_0x203f01['where']=_[_0xd41a('0x43')](_0x203f01[_0xd41a('0x40')],{'$or':_[_0xd41a('0x32')](_0x203f01[_0xd41a('0x3b')],function(_0x540c1d){var _0x1de875={};_0x1de875[_0x540c1d]={'$like':'%'+_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x60')]+'%'};return _0x1de875;})});}_0x203f01=_['merge']({},_0x203f01,_0x3a4c54[_0xd41a('0x44')]);return _0x56a3d9[_0xd41a('0x5d')](_0x203f01);}})[_0xd41a('0x29')](function(_0x259710){if(_0x259710){_0x5889d7=_0x259710[_0xd41a('0x3d')];if(!_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x3e')](_0xd41a('0x61'))){_0x203f01[_0xd41a('0x23')]=qs[_0xd41a('0x23')](_0x3a4c54[_0xd41a('0x37')]['limit']);_0x203f01[_0xd41a('0x21')]=qs['offset'](_0x3a4c54[_0xd41a('0x37')][_0xd41a('0x21')]);}return _0x56a3d9[_0xd41a('0x5d')](_0x203f01);}})[_0xd41a('0x29')](function(_0x146422){if(_0x146422){return _0x146422?{'count':_0x5889d7,'rows':_0x146422}:null;}})[_0xd41a('0x29')](respondWithResult(_0x14ed8b,null))[_0xd41a('0x49')](handleError(_0x14ed8b,null));}; \ No newline at end of file +var _0x1506=['addUsers','omit','removeUsers','ids','emit','userSquareProject:remove','findOne','User','order','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','get','SquareProjects','UserProfileResource','error','name','send','index','map','SquareProject','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x44cd4d,_0x40b938){var _0x1575d3=function(_0x25c24a){while(--_0x25c24a){_0x44cd4d['push'](_0x44cd4d['shift']());}};_0x1575d3(++_0x40b938);}(_0x1506,0xc0));var _0x6150=function(_0x2f2020,_0xab1788){_0x2f2020=_0x2f2020-0x0;var _0x11b320=_0x1506[_0x2f2020];return _0x11b320;};'use strict';var emlformat=require(_0x6150('0x0'));var rimraf=require(_0x6150('0x1'));var zipdir=require(_0x6150('0x2'));var jsonpatch=require(_0x6150('0x3'));var rp=require(_0x6150('0x4'));var moment=require(_0x6150('0x5'));var BPromise=require(_0x6150('0x6'));var Mustache=require('mustache');var util=require(_0x6150('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6150('0x8'));var ejs=require(_0x6150('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6150('0xa'));var squel=require('squel');var crypto=require(_0x6150('0xb'));var jsforce=require(_0x6150('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6150('0x8'));var querystring=require(_0x6150('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6150('0xe'));var qs=require(_0x6150('0xf'));var as=require(_0x6150('0x10'));var hardwareService=require(_0x6150('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6150('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6150('0x13'));var db=require('../../mysqldb')['db'];config[_0x6150('0x14')]=_[_0x6150('0x15')](config[_0x6150('0x14')],{'host':_0x6150('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6150('0x14')]));require(_0x6150('0x17'))[_0x6150('0x18')](socket);function respondWithStatusCode(_0x80a60e,_0x1f67d1){_0x1f67d1=_0x1f67d1||0xcc;return function(_0x38c315){if(_0x38c315){return _0x80a60e[_0x6150('0x19')](_0x1f67d1);}return _0x80a60e[_0x6150('0x1a')](_0x1f67d1)[_0x6150('0x1b')]();};}function respondWithResult(_0x370372,_0x397d8c){_0x397d8c=_0x397d8c||0xc8;return function(_0x288f9b){if(_0x288f9b){return _0x370372[_0x6150('0x1a')](_0x397d8c)[_0x6150('0x1c')](_0x288f9b);}};}function respondWithFilteredResult(_0x1fce9b,_0x30c9d8){return function(_0x2a39c1){if(_0x2a39c1){var _0x3ff48d=typeof _0x30c9d8[_0x6150('0x1d')]===_0x6150('0x1e')&&typeof _0x30c9d8[_0x6150('0x1f')]===_0x6150('0x1e');var _0x3afff0=_0x2a39c1['count'];var _0xabf261=_0x3ff48d?0x0:_0x30c9d8[_0x6150('0x1d')];var _0xf97332=_0x3ff48d?_0x2a39c1['count']:_0x30c9d8['offset']+_0x30c9d8['limit'];var _0x23d26c;if(_0xf97332>=_0x3afff0){_0xf97332=_0x3afff0;_0x23d26c=0xc8;}else{_0x23d26c=0xce;}_0x1fce9b[_0x6150('0x1a')](_0x23d26c);return _0x1fce9b[_0x6150('0x20')](_0x6150('0x21'),_0xabf261+'-'+_0xf97332+'/'+_0x3afff0)['json'](_0x2a39c1);}return null;};}function patchUpdates(_0x31fb4f){return function(_0x5b1be7){try{jsonpatch['apply'](_0x5b1be7,_0x31fb4f,!![]);}catch(_0x5a9728){return BPromise[_0x6150('0x22')](_0x5a9728);}return _0x5b1be7['save']();};}function saveUpdates(_0x37861b,_0x2d5682){return function(_0x5d4b57){if(_0x5d4b57){return _0x5d4b57[_0x6150('0x23')](_0x37861b)[_0x6150('0x24')](function(_0x4cf16c){return _0x4cf16c;});}return null;};}function removeEntity(_0x374cfa,_0x869034){return function(_0x26e1a9){if(_0x26e1a9){return _0x26e1a9[_0x6150('0x25')]()[_0x6150('0x24')](function(){var _0x4704b1=_0x26e1a9[_0x6150('0x26')]({'plain':!![]});var _0x5c8dc1=_0x6150('0x27');return db[_0x6150('0x28')][_0x6150('0x25')]({'where':{'type':_0x5c8dc1,'resourceId':_0x4704b1['id']}})[_0x6150('0x24')](function(){return _0x26e1a9;});})[_0x6150('0x24')](function(){_0x374cfa[_0x6150('0x1a')](0xcc)[_0x6150('0x1b')]();});}};}function handleEntityNotFound(_0xb101ae,_0x271443){return function(_0x51543d){if(!_0x51543d){_0xb101ae[_0x6150('0x19')](0x194);}return _0x51543d;};}function handleError(_0x5cccb5,_0x3b94d7){_0x3b94d7=_0x3b94d7||0x1f4;return function(_0x39dd7a){logger[_0x6150('0x29')](_0x39dd7a['stack']);if(_0x39dd7a[_0x6150('0x2a')]){delete _0x39dd7a[_0x6150('0x2a')];}_0x5cccb5[_0x6150('0x1a')](_0x3b94d7)[_0x6150('0x2b')](_0x39dd7a);};}exports[_0x6150('0x2c')]=function(_0x39288d,_0x181d0f){var _0x978197={},_0x5e95cb={},_0x15a9a4={'count':0x0,'rows':[]};var _0x191b94=_[_0x6150('0x2d')](db[_0x6150('0x2e')][_0x6150('0x2f')],function(_0x330d4f){return{'name':_0x330d4f['fieldName'],'type':_0x330d4f[_0x6150('0x30')]['key']};});_0x5e95cb[_0x6150('0x31')]=_['map'](_0x191b94,_0x6150('0x2a'));_0x5e95cb[_0x6150('0x32')]=_[_0x6150('0x33')](_0x39288d[_0x6150('0x32')]);_0x5e95cb[_0x6150('0x34')]=_[_0x6150('0x35')](_0x5e95cb[_0x6150('0x31')],_0x5e95cb[_0x6150('0x32')]);_0x978197[_0x6150('0x36')]=_['intersection'](_0x5e95cb[_0x6150('0x31')],qs[_0x6150('0x37')](_0x39288d[_0x6150('0x32')][_0x6150('0x37')]));_0x978197[_0x6150('0x36')]=_0x978197[_0x6150('0x36')]['length']?_0x978197['attributes']:_0x5e95cb[_0x6150('0x31')];if(!_0x39288d[_0x6150('0x32')][_0x6150('0x38')](_0x6150('0x39'))){_0x978197[_0x6150('0x1f')]=qs['limit'](_0x39288d[_0x6150('0x32')][_0x6150('0x1f')]);_0x978197['offset']=qs[_0x6150('0x1d')](_0x39288d['query'][_0x6150('0x1d')]);}_0x978197['order']=qs[_0x6150('0x3a')](_0x39288d[_0x6150('0x32')][_0x6150('0x3a')]);_0x978197[_0x6150('0x3b')]=qs[_0x6150('0x34')](_[_0x6150('0x3c')](_0x39288d[_0x6150('0x32')],_0x5e95cb[_0x6150('0x34')]),_0x191b94);if(_0x39288d[_0x6150('0x32')][_0x6150('0x3d')]){_0x978197[_0x6150('0x3b')]=_[_0x6150('0x3e')](_0x978197[_0x6150('0x3b')],{'$or':_['map'](_0x191b94,function(_0x4c5d2f){if(_0x4c5d2f[_0x6150('0x30')]!==_0x6150('0x3f')){var _0x5ae0d9={};_0x5ae0d9[_0x4c5d2f[_0x6150('0x2a')]]={'$like':'%'+_0x39288d[_0x6150('0x32')][_0x6150('0x3d')]+'%'};return _0x5ae0d9;}})});}_0x978197=_[_0x6150('0x3e')]({},_0x978197,_0x39288d[_0x6150('0x40')]);var _0x22f9c1={'where':_0x978197[_0x6150('0x3b')]};return db[_0x6150('0x2e')]['count'](_0x22f9c1)[_0x6150('0x24')](function(_0x1bb099){_0x15a9a4[_0x6150('0x41')]=_0x1bb099;if(_0x39288d[_0x6150('0x32')][_0x6150('0x42')]){_0x978197[_0x6150('0x43')]=[{'all':!![]}];}return db[_0x6150('0x2e')][_0x6150('0x44')](_0x978197);})[_0x6150('0x24')](function(_0x4e3d73){_0x15a9a4[_0x6150('0x45')]=_0x4e3d73;return _0x15a9a4;})['then'](respondWithFilteredResult(_0x181d0f,_0x978197))['catch'](handleError(_0x181d0f,null));};exports[_0x6150('0x46')]=function(_0x2afa93,_0x146377){var _0x2db80f={'raw':![],'where':{'id':_0x2afa93['params']['id']}},_0xc8ce31={};_0xc8ce31['model']=_['keys'](db[_0x6150('0x2e')][_0x6150('0x2f')]);_0xc8ce31['query']=_[_0x6150('0x33')](_0x2afa93['query']);_0xc8ce31[_0x6150('0x34')]=_['intersection'](_0xc8ce31['model'],_0xc8ce31['query']);_0x2db80f['attributes']=_[_0x6150('0x35')](_0xc8ce31[_0x6150('0x31')],qs[_0x6150('0x37')](_0x2afa93[_0x6150('0x32')]['fields']));_0x2db80f[_0x6150('0x36')]=_0x2db80f[_0x6150('0x36')][_0x6150('0x47')]?_0x2db80f[_0x6150('0x36')]:_0xc8ce31[_0x6150('0x31')];if(_0x2afa93[_0x6150('0x32')][_0x6150('0x42')]){_0x2db80f['include']=[{'all':!![]}];}_0x2db80f=_['merge']({},_0x2db80f,_0x2afa93[_0x6150('0x40')]);return db['SquareProject']['find'](_0x2db80f)[_0x6150('0x24')](handleEntityNotFound(_0x146377,null))[_0x6150('0x24')](respondWithResult(_0x146377,null))['catch'](handleError(_0x146377,null));};exports['create']=function(_0x101e32,_0x5a1435){return db[_0x6150('0x2e')]['create'](_0x101e32[_0x6150('0x48')],{})[_0x6150('0x24')](function(_0x20e3a1){var _0x5b34d3=_0x101e32['user'][_0x6150('0x26')]({'plain':!![]});if(!_0x5b34d3)throw new Error(_0x6150('0x49'));if(_0x5b34d3[_0x6150('0x4a')]==='user'){var _0x4f7315=_0x20e3a1[_0x6150('0x26')]({'plain':!![]});var _0x5c6d8d='SquareProjects';return db['UserProfileSection'][_0x6150('0x4b')]({'where':{'name':_0x5c6d8d,'userProfileId':_0x5b34d3[_0x6150('0x4c')]},'raw':!![]})['then'](function(_0xc52080){if(_0xc52080&&_0xc52080['autoAssociation']===0x0){return db['UserProfileResource'][_0x6150('0x4d')]({'name':_0x4f7315[_0x6150('0x2a')],'resourceId':_0x4f7315['id'],'type':_0xc52080[_0x6150('0x2a')],'sectionId':_0xc52080['id']},{})[_0x6150('0x24')](function(){return _0x20e3a1;});}else{return _0x20e3a1;}})[_0x6150('0x4e')](function(_0x242224){logger[_0x6150('0x29')](_0x6150('0x4f'),_0x242224);throw _0x242224;});}return _0x20e3a1;})[_0x6150('0x24')](respondWithResult(_0x5a1435,0xc9))['catch'](handleError(_0x5a1435,null));};exports[_0x6150('0x23')]=function(_0x160e39,_0x5b5638){if(_0x160e39['body']['id']){delete _0x160e39[_0x6150('0x48')]['id'];}return db[_0x6150('0x2e')][_0x6150('0x4b')]({'where':{'id':_0x160e39[_0x6150('0x50')]['id']}})[_0x6150('0x24')](handleEntityNotFound(_0x5b5638,null))[_0x6150('0x24')](saveUpdates(_0x160e39[_0x6150('0x48')],null))[_0x6150('0x24')](respondWithResult(_0x5b5638,null))[_0x6150('0x4e')](handleError(_0x5b5638,null));};exports[_0x6150('0x25')]=function(_0x5d8671,_0x209ce1){return db[_0x6150('0x2e')][_0x6150('0x4b')]({'where':{'id':_0x5d8671['params']['id']}})[_0x6150('0x24')](handleEntityNotFound(_0x209ce1,null))[_0x6150('0x24')](removeEntity(_0x209ce1,null))[_0x6150('0x4e')](handleError(_0x209ce1,null));};exports['addUsers']=function(_0x3961d2,_0x15b76e,_0x335554){return db[_0x6150('0x2e')][_0x6150('0x4b')]({'where':{'id':_0x3961d2[_0x6150('0x50')]['id']}})[_0x6150('0x24')](handleEntityNotFound(_0x15b76e,null))['then'](function(_0x4c9a6a){if(_0x4c9a6a){return _0x4c9a6a[_0x6150('0x51')](_0x3961d2[_0x6150('0x48')]['ids'],_[_0x6150('0x52')](_0x3961d2['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x15b76e,null))[_0x6150('0x4e')](handleError(_0x15b76e,null));};exports[_0x6150('0x53')]=function(_0x10eed9,_0x31d2f8,_0x34161f){return db[_0x6150('0x2e')][_0x6150('0x4b')]({'where':{'id':_0x10eed9[_0x6150('0x50')]['id']}})[_0x6150('0x24')](handleEntityNotFound(_0x31d2f8,null))[_0x6150('0x24')](function(_0xe05acf){if(_0xe05acf){return _0xe05acf[_0x6150('0x53')](_0x10eed9[_0x6150('0x32')][_0x6150('0x54')])[_0x6150('0x24')](function(){if(_['isArray'](_0x10eed9[_0x6150('0x32')][_0x6150('0x54')])){for(var _0x725e7c=0x0;_0x725e7c<_0x10eed9[_0x6150('0x32')][_0x6150('0x54')]['length'];_0x725e7c+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x10eed9[_0x6150('0x32')][_0x6150('0x54')][_0x725e7c]),'SquareProjectId':Number(_0x10eed9[_0x6150('0x50')]['id'])});}}else{socket[_0x6150('0x55')](_0x6150('0x56'),{'UserId':Number(_0x10eed9[_0x6150('0x32')][_0x6150('0x54')]),'SquareProjectId':Number(_0x10eed9[_0x6150('0x50')]['id'])});}});}})[_0x6150('0x24')](respondWithStatusCode(_0x31d2f8,null))[_0x6150('0x4e')](handleError(_0x31d2f8,null));};exports['getUsers']=function(_0x3391a2,_0x3016ce,_0x5b9789){var _0x162941={};var _0x42decc={};var _0x340055;var _0x11c2ac;return db['SquareProject'][_0x6150('0x57')]({'where':{'id':_0x3391a2[_0x6150('0x50')]['id']}})['then'](handleEntityNotFound(_0x3016ce,null))[_0x6150('0x24')](function(_0x21cc3e){if(_0x21cc3e){_0x340055=_0x21cc3e;_0x42decc[_0x6150('0x31')]=_[_0x6150('0x33')](db[_0x6150('0x58')][_0x6150('0x2f')]);_0x42decc['query']=_['keys'](_0x3391a2[_0x6150('0x32')]);_0x42decc[_0x6150('0x34')]=_[_0x6150('0x35')](_0x42decc[_0x6150('0x31')],_0x42decc['query']);_0x162941[_0x6150('0x36')]=_[_0x6150('0x35')](_0x42decc[_0x6150('0x31')],qs[_0x6150('0x37')](_0x3391a2[_0x6150('0x32')][_0x6150('0x37')]));_0x162941[_0x6150('0x36')]=_0x162941[_0x6150('0x36')][_0x6150('0x47')]?_0x162941[_0x6150('0x36')]:_0x42decc['model'];_0x162941[_0x6150('0x59')]=qs[_0x6150('0x3a')](_0x3391a2[_0x6150('0x32')][_0x6150('0x3a')]);_0x162941[_0x6150('0x3b')]=qs[_0x6150('0x34')](_[_0x6150('0x3c')](_0x3391a2[_0x6150('0x32')],_0x42decc['filters']));if(_0x3391a2[_0x6150('0x32')]['filter']){_0x162941[_0x6150('0x3b')]=_['merge'](_0x162941[_0x6150('0x3b')],{'$or':_[_0x6150('0x2d')](_0x162941[_0x6150('0x36')],function(_0x1ecb29){var _0x368e50={};_0x368e50[_0x1ecb29]={'$like':'%'+_0x3391a2[_0x6150('0x32')]['filter']+'%'};return _0x368e50;})});}_0x162941=_[_0x6150('0x3e')]({},_0x162941,_0x3391a2['options']);return _0x340055['getUsers'](_0x162941);}})[_0x6150('0x24')](function(_0x3b590d){if(_0x3b590d){_0x11c2ac=_0x3b590d[_0x6150('0x47')];if(!_0x3391a2['query']['hasOwnProperty']('nolimit')){_0x162941['limit']=qs[_0x6150('0x1f')](_0x3391a2['query'][_0x6150('0x1f')]);_0x162941[_0x6150('0x1d')]=qs[_0x6150('0x1d')](_0x3391a2['query'][_0x6150('0x1d')]);}return _0x340055[_0x6150('0x5a')](_0x162941);}})['then'](function(_0x2e0f4b){if(_0x2e0f4b){return _0x2e0f4b?{'count':_0x11c2ac,'rows':_0x2e0f4b}:null;}})[_0x6150('0x24')](respondWithResult(_0x3016ce,null))['catch'](handleError(_0x3016ce,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b5092f4..3eab766 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 _0xda77=['emit','hook','exports','events','../../mysqldb','SquareProject','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda77,0x123));var _0x7da7=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xda77[_0x1c8c28];return _0x1f59b4;};'use strict';var EventEmitter=require(_0x7da7('0x0'));var SquareProject=require(_0x7da7('0x1'))['db'][_0x7da7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7da7('0x3'),'afterUpdate':_0x7da7('0x4'),'afterDestroy':_0x7da7('0x5')};function emitEvent(_0x8699c4){return function(_0x12fdca,_0x3f6e76,_0x5356c0){SquareProjectEvents['emit'](_0x8699c4+':'+_0x12fdca['id'],_0x12fdca);SquareProjectEvents[_0x7da7('0x6')](_0x8699c4,_0x12fdca);_0x5356c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7da7('0x7')](e,emitEvent(event));}}module[_0x7da7('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x59e3=['emit','hook','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x1c0d4d,_0x2353e2){var _0x31b392=function(_0x4dbfc9){while(--_0x4dbfc9){_0x1c0d4d['push'](_0x1c0d4d['shift']());}};_0x31b392(++_0x2353e2);}(_0x59e3,0xca));var _0x359e=function(_0x238702,_0x7ff8f6){_0x238702=_0x238702-0x0;var _0x478153=_0x59e3[_0x238702];return _0x478153;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x359e('0x0'))['db'][_0x359e('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x359e('0x2')](0x0);var events={'afterCreate':_0x359e('0x3'),'afterUpdate':_0x359e('0x4'),'afterDestroy':_0x359e('0x5')};function emitEvent(_0x545127){return function(_0x1a5f33,_0x4cdf23,_0x3eb59b){SquareProjectEvents[_0x359e('0x6')](_0x545127+':'+_0x1a5f33['id'],_0x1a5f33);SquareProjectEvents[_0x359e('0x6')](_0x545127,_0x1a5f33);_0x3eb59b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x359e('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 8f4b23e..48813d2 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 _0x8689=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt'];(function(_0x2714ad,_0x4c160c){var _0x3f6158=function(_0x1c1bfc){while(--_0x1c1bfc){_0x2714ad['push'](_0x2714ad['shift']());}};_0x3f6158(++_0x4c160c);}(_0x8689,0x99));var _0x9868=function(_0x331f3d,_0x1930c9){_0x331f3d=_0x331f3d-0x0;var _0x2e03d7=_0x8689[_0x331f3d];return _0x2e03d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9868('0x0'))(_0x9868('0x1'));var moment=require(_0x9868('0x2'));var BPromise=require('bluebird');var rp=require(_0x9868('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9868('0x4'));var config=require(_0x9868('0x5'));var attributes=require(_0x9868('0x6'));module[_0x9868('0x7')]=function(_0x32c8f9,_0x1d8f1d){return _0x32c8f9[_0x9868('0x8')](_0x9868('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x397363,_0x197493,_0x2ea846){if(_0x397363['changed'](_0x9868('0xa'))){_0x397363[_0x9868('0xb')]=moment()[_0x9868('0xc')](_0x9868('0xd'));}if(_0x397363[_0x9868('0xe')](_0x9868('0xf'))){_0x397363[_0x9868('0x10')]=moment()[_0x9868('0xc')](_0x9868('0xd'));}_0x2ea846(null,_0x397363);}}});}; \ No newline at end of file +var _0x1ed1=['moment','bluebird','request-promise','rimraf','../../config/environment','define','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','format','lodash','util','api'];(function(_0x5a04b5,_0x5b220c){var _0x5958df=function(_0xcf66b6){while(--_0xcf66b6){_0x5a04b5['push'](_0x5a04b5['shift']());}};_0x5958df(++_0x5b220c);}(_0x1ed1,0xad));var _0x11ed=function(_0x158683,_0x135173){_0x158683=_0x158683-0x0;var _0x38d930=_0x1ed1[_0x158683];return _0x38d930;};'use strict';var _=require(_0x11ed('0x0'));var util=require(_0x11ed('0x1'));var logger=require('../../config/logger')(_0x11ed('0x2'));var moment=require(_0x11ed('0x3'));var BPromise=require(_0x11ed('0x4'));var rp=require(_0x11ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11ed('0x6'));var config=require(_0x11ed('0x7'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x1d4f7c,_0x1aa42e){return _0x1d4f7c[_0x11ed('0x8')](_0x11ed('0x9'),attributes,{'tableName':_0x11ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ff938,_0xdee2f6,_0x2f6628){if(_0x3ff938[_0x11ed('0xb')](_0x11ed('0xc'))){_0x3ff938[_0x11ed('0xd')]=moment()['format'](_0x11ed('0xe'));}if(_0x3ff938[_0x11ed('0xb')]('production')){_0x3ff938['publishedAt']=moment()[_0x11ed('0xf')](_0x11ed('0xe'));}_0x2f6628(null,_0x3ff938);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1957537..7212834 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 _0xd3e0=['error','code','message','request\x20sent','catch','ShowSquareProject','options','raw','attributes','map','include','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e8dfb,_0x57d353){var _0x20ec45=function(_0x8cb5d8){while(--_0x8cb5d8){_0x2e8dfb['push'](_0x2e8dfb['shift']());}};_0x20ec45(++_0x57d353);}(_0xd3e0,0xd8));var _0x0d3e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd3e0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x0d3e('0x0'));var util=require(_0x0d3e('0x1'));var moment=require(_0x0d3e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d3e('0x3'));var db=require(_0x0d3e('0x4'))['db'];var utils=require(_0x0d3e('0x5'));var logger=require(_0x0d3e('0x6'))(_0x0d3e('0x7'));var config=require(_0x0d3e('0x8'));var jayson=require(_0x0d3e('0x9'));var client=jayson[_0x0d3e('0xa')][_0x0d3e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0d3e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d3e('0xd'))[_0x0d3e('0xe')](socket);function respondWithRpcPromise(_0x44e372,_0x20ea75,_0x20f1e6){return new BPromise(function(_0x19b77b,_0x248e3f){return client[_0x0d3e('0xf')](_0x44e372,_0x20f1e6)[_0x0d3e('0x10')](function(_0x4adbb3){logger[_0x0d3e('0x11')](_0x0d3e('0x12'),_0x20ea75,'request\x20sent');logger[_0x0d3e('0x13')](_0x0d3e('0x14'),_0x20ea75,'request\x20sent',JSON[_0x0d3e('0x15')](_0x4adbb3));if(_0x4adbb3['error']){if(_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x17')]===0x1f4){logger[_0x0d3e('0x16')](_0x0d3e('0x12'),_0x20ea75,_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);return _0x248e3f(_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);}logger['error'](_0x0d3e('0x12'),_0x20ea75,_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);return _0x19b77b(_0x4adbb3[_0x0d3e('0x16')][_0x0d3e('0x18')]);}else{logger[_0x0d3e('0x11')](_0x0d3e('0x12'),_0x20ea75,_0x0d3e('0x19'));_0x19b77b(_0x4adbb3['result'][_0x0d3e('0x18')]);}})[_0x0d3e('0x1a')](function(_0x4727d9){logger[_0x0d3e('0x16')]('SquareProject,\x20%s,\x20%s',_0x20ea75,_0x4727d9);_0x248e3f(_0x4727d9);});});}exports[_0x0d3e('0x1b')]=function(_0x5b663e){var _0x3030bc=this;return new Promise(function(_0x397927,_0xf7c81e){return db['SquareProject']['find']({'raw':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')][_0x0d3e('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')]['where']||null:null,'attributes':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')][_0x0d3e('0x1e')]||null:null,'include':_0x5b663e[_0x0d3e('0x1c')]?_0x5b663e[_0x0d3e('0x1c')]['include']?_[_0x0d3e('0x1f')](_0x5b663e[_0x0d3e('0x1c')][_0x0d3e('0x20')],function(_0x1e82a1){return{'model':db[_0x1e82a1[_0x0d3e('0x21')]],'as':_0x1e82a1['as'],'attributes':_0x1e82a1['attributes'],'include':_0x1e82a1[_0x0d3e('0x20')]?_[_0x0d3e('0x1f')](_0x1e82a1[_0x0d3e('0x20')],function(_0x4f5798){return{'model':db[_0x4f5798[_0x0d3e('0x21')]],'as':_0x4f5798['as'],'attributes':_0x4f5798['attributes'],'include':_0x4f5798['include']?_[_0x0d3e('0x1f')](_0x4f5798['include'],function(_0x51b5f1){return{'model':db[_0x51b5f1[_0x0d3e('0x21')]],'as':_0x51b5f1['as'],'attributes':_0x51b5f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d3e('0x10')](function(_0x328a00){logger[_0x0d3e('0x11')](_0x0d3e('0x1b'),_0x5b663e);logger[_0x0d3e('0x13')](_0x0d3e('0x1b'),_0x5b663e,JSON[_0x0d3e('0x15')](_0x328a00));_0x397927(_0x328a00);})[_0x0d3e('0x1a')](function(_0x1680a9){logger[_0x0d3e('0x16')]('ShowSquareProject',_0x1680a9[_0x0d3e('0x18')],_0x5b663e);_0xf7c81e(_0x3030bc[_0x0d3e('0x16')](0x1f4,_0x1680a9[_0x0d3e('0x18')]));});});}; \ No newline at end of file +var _0x6689=['stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','localhost','socket.io-emitter','redis','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model'];(function(_0x499015,_0x4140cb){var _0x345c68=function(_0x45a69d){while(--_0x45a69d){_0x499015['push'](_0x499015['shift']());}};_0x345c68(++_0x4140cb);}(_0x6689,0x146));var _0x9668=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6689[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9668('0x0'));var util=require(_0x9668('0x1'));var moment=require(_0x9668('0x2'));var BPromise=require(_0x9668('0x3'));var rs=require(_0x9668('0x4'));var fs=require('fs');var Redis=require(_0x9668('0x5'));var db=require(_0x9668('0x6'))['db'];var utils=require(_0x9668('0x7'));var logger=require(_0x9668('0x8'))(_0x9668('0x9'));var config=require(_0x9668('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9668('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x9668('0xc'),'port':0x18eb});var socket=require(_0x9668('0xd'))(new Redis(config[_0x9668('0xe')]));require('./squareProject.socket')[_0x9668('0xf')](socket);function respondWithRpcPromise(_0xc651b5,_0x52848f,_0x3b55fb){return new BPromise(function(_0x2bb55a,_0x25d6af){return client[_0x9668('0x10')](_0xc651b5,_0x3b55fb)[_0x9668('0x11')](function(_0x22c380){logger['info'](_0x9668('0x12'),_0x52848f,_0x9668('0x13'));logger[_0x9668('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x52848f,_0x9668('0x13'),JSON['stringify'](_0x22c380));if(_0x22c380['error']){if(_0x22c380[_0x9668('0x15')]['code']===0x1f4){logger[_0x9668('0x15')](_0x9668('0x12'),_0x52848f,_0x22c380[_0x9668('0x15')][_0x9668('0x16')]);return _0x25d6af(_0x22c380[_0x9668('0x15')][_0x9668('0x16')]);}logger[_0x9668('0x15')]('SquareProject,\x20%s,\x20%s',_0x52848f,_0x22c380[_0x9668('0x15')][_0x9668('0x16')]);return _0x2bb55a(_0x22c380[_0x9668('0x15')][_0x9668('0x16')]);}else{logger[_0x9668('0x17')](_0x9668('0x12'),_0x52848f,_0x9668('0x13'));_0x2bb55a(_0x22c380[_0x9668('0x18')][_0x9668('0x16')]);}})['catch'](function(_0x262f40){logger[_0x9668('0x15')](_0x9668('0x12'),_0x52848f,_0x262f40);_0x25d6af(_0x262f40);});});}exports[_0x9668('0x19')]=function(_0x1c60d3){var _0x1c092e=this;return new Promise(function(_0x5cc6a2,_0x24c580){return db[_0x9668('0x1a')][_0x9668('0x1b')]({'raw':_0x1c60d3[_0x9668('0x1c')]?_0x1c60d3[_0x9668('0x1c')][_0x9668('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c60d3[_0x9668('0x1c')]?_0x1c60d3[_0x9668('0x1c')]['where']||null:null,'attributes':_0x1c60d3[_0x9668('0x1c')]?_0x1c60d3[_0x9668('0x1c')][_0x9668('0x1e')]||null:null,'include':_0x1c60d3[_0x9668('0x1c')]?_0x1c60d3[_0x9668('0x1c')][_0x9668('0x1f')]?_[_0x9668('0x20')](_0x1c60d3['options']['include'],function(_0x1cd8cf){return{'model':db[_0x1cd8cf[_0x9668('0x21')]],'as':_0x1cd8cf['as'],'attributes':_0x1cd8cf[_0x9668('0x1e')],'include':_0x1cd8cf['include']?_[_0x9668('0x20')](_0x1cd8cf[_0x9668('0x1f')],function(_0x36cf5f){return{'model':db[_0x36cf5f[_0x9668('0x21')]],'as':_0x36cf5f['as'],'attributes':_0x36cf5f[_0x9668('0x1e')],'include':_0x36cf5f['include']?_[_0x9668('0x20')](_0x36cf5f[_0x9668('0x1f')],function(_0x3dcbe8){return{'model':db[_0x3dcbe8[_0x9668('0x21')]],'as':_0x3dcbe8['as'],'attributes':_0x3dcbe8[_0x9668('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9668('0x11')](function(_0xb97a33){logger[_0x9668('0x17')](_0x9668('0x19'),_0x1c60d3);logger['debug'](_0x9668('0x19'),_0x1c60d3,JSON[_0x9668('0x22')](_0xb97a33));_0x5cc6a2(_0xb97a33);})[_0x9668('0x23')](function(_0x42933b){logger[_0x9668('0x15')](_0x9668('0x19'),_0x42933b['message'],_0x1c60d3);_0x24c580(_0x1c092e[_0x9668('0x15')](0x1f4,_0x42933b[_0x9668('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index c2b837a..92a45cb 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 _0xc222=['emit','removeListener','register','length','squareProject:','remove','update'];(function(_0x54cb5d,_0x3927ed){var _0x15c55a=function(_0x12f082){while(--_0x12f082){_0x54cb5d['push'](_0x54cb5d['shift']());}};_0x15c55a(++_0x3927ed);}(_0xc222,0x1e8));var _0x2c22=function(_0x441544,_0x3cc7d2){_0x441544=_0x441544-0x0;var _0x5aaaf9=_0xc222[_0x441544];return _0x5aaaf9;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x2c22('0x0'),_0x2c22('0x1')];function createListener(_0x1964c7,_0x4e4a1f){return function(_0x4459a4){_0x4e4a1f[_0x2c22('0x2')](_0x1964c7,_0x4459a4);};}function removeListener(_0x2011e2,_0x2e7e41){return function(){SquareProjectEvents[_0x2c22('0x3')](_0x2011e2,_0x2e7e41);};}exports[_0x2c22('0x4')]=function(_0x4a19f7){for(var _0x118719=0x0,_0x3cfb53=events[_0x2c22('0x5')];_0x118719<_0x3cfb53;_0x118719++){var _0x45352a=events[_0x118719];var _0x31016b=createListener(_0x2c22('0x6')+_0x45352a,_0x4a19f7);SquareProjectEvents['on'](_0x45352a,_0x31016b);}}; \ No newline at end of file +var _0x9aa9=['register','length','squareProject:','save','remove','emit'];(function(_0x523012,_0x55ed89){var _0x14dab3=function(_0x7fc04f){while(--_0x7fc04f){_0x523012['push'](_0x523012['shift']());}};_0x14dab3(++_0x55ed89);}(_0x9aa9,0x16b));var _0x99aa=function(_0x2909e0,_0x9a3311){_0x2909e0=_0x2909e0-0x0;var _0x348b70=_0x9aa9[_0x2909e0];return _0x348b70;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x99aa('0x0'),_0x99aa('0x1'),'update'];function createListener(_0x53d1d8,_0x1eff23){return function(_0x36b0be){_0x1eff23[_0x99aa('0x2')](_0x53d1d8,_0x36b0be);};}function removeListener(_0x1a1ac2,_0x1d3c7c){return function(){SquareProjectEvents['removeListener'](_0x1a1ac2,_0x1d3c7c);};}exports[_0x99aa('0x3')]=function(_0x1d9913){for(var _0x221f9d=0x0,_0x304b4c=events[_0x99aa('0x4')];_0x221f9d<_0x304b4c;_0x221f9d++){var _0x23011a=events[_0x221f9d];var _0x3d7410=createListener(_0x99aa('0x5')+_0x23011a,_0x1d9913);SquareProjectEvents['on'](_0x23011a,_0x3d7410);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 94cdd94..480a7fa 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0xae63c1,_0x325802){var _0x4f3ca9=function(_0x48ab0c){while(--_0x48ab0c){_0xae63c1['push'](_0xae63c1['shift']());}};_0x4f3ca9(++_0x325802);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x4ae864,_0x46fc0c){var _0x2ead9a=function(_0x55f9a0){while(--_0x55f9a0){_0x4ae864['push'](_0x4ae864['shift']());}};_0x2ead9a(++_0x46fc0c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0x5fc3[_0x2e5f9c];return _0x538b44;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 03dab71..feeae38 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 _0x3eea=['getDataValue','substring','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x714842,_0x5bdad2){_0x714842=_0x714842-0x0;var _0x53f80c=_0x3eea[_0x714842];return _0x53f80c;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'callerid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'context':{'type':Sequelize[_0xa3ee('0x1')]},'extension':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize[_0xa3ee('0x1')]},'dnid':{'type':Sequelize[_0xa3ee('0x1')]},'projectName':{'type':Sequelize[_0xa3ee('0x1')]},'saveName':{'type':Sequelize[_0xa3ee('0x1')]},'filename':{'type':Sequelize[_0xa3ee('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4183ee='';var _0x4e4588=this[_0xa3ee('0x2')]('savePath');if(_0x4e4588){_0x4183ee=_0x4e4588[_0xa3ee('0x3')](_0x4e4588['lastIndexOf']('.'));}return _0x4183ee;}}}; \ No newline at end of file +var _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x2b50ba,_0x59ba7a){var _0x367510=function(_0x39213b){while(--_0x39213b){_0x2b50ba['push'](_0x2b50ba['shift']());}};_0x367510(++_0x59ba7a);}(_0x207c,0x1e8));var _0xc207=function(_0x59b533,_0x59fdcc){_0x59b533=_0x59b533-0x0;var _0x2beced=_0x207c[_0x59b533];return _0x2beced;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index eaa67ad..f4f3788 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 _0x9b08=['type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','SquareRecording','rawAttributes','fieldName'];(function(_0x1e92f5,_0x25d782){var _0x1afa8a=function(_0x12b53b){while(--_0x12b53b){_0x1e92f5['push'](_0x1e92f5['shift']());}};_0x1afa8a(++_0x25d782);}(_0x9b08,0x1c5));var _0x89b0=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x9b08[_0x31bab3];return _0x4fd382;};'use strict';var emlformat=require(_0x89b0('0x0'));var rimraf=require(_0x89b0('0x1'));var zipdir=require(_0x89b0('0x2'));var jsonpatch=require(_0x89b0('0x3'));var rp=require(_0x89b0('0x4'));var moment=require('moment');var BPromise=require(_0x89b0('0x5'));var Mustache=require(_0x89b0('0x6'));var util=require(_0x89b0('0x7'));var path=require(_0x89b0('0x8'));var sox=require(_0x89b0('0x9'));var csv=require(_0x89b0('0xa'));var ejs=require(_0x89b0('0xb'));var fs=require('fs');var fs_extra=require(_0x89b0('0xc'));var _=require(_0x89b0('0xd'));var squel=require(_0x89b0('0xe'));var crypto=require(_0x89b0('0xf'));var jsforce=require(_0x89b0('0x10'));var deskjs=require(_0x89b0('0x11'));var toCsv=require(_0x89b0('0xa'));var querystring=require(_0x89b0('0x12'));var Papa=require(_0x89b0('0x13'));var Redis=require(_0x89b0('0x14'));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')(_0x89b0('0x15'));var utils=require(_0x89b0('0x16'));var config=require(_0x89b0('0x17'));var licenseUtil=require(_0x89b0('0x18'));var db=require(_0x89b0('0x19'))['db'];function respondWithStatusCode(_0x5da10e,_0x360bba){_0x360bba=_0x360bba||0xcc;return function(_0x12940a){if(_0x12940a){return _0x5da10e[_0x89b0('0x1a')](_0x360bba);}return _0x5da10e[_0x89b0('0x1b')](_0x360bba)['end']();};}function respondWithResult(_0x3d35b7,_0xdc07db){_0xdc07db=_0xdc07db||0xc8;return function(_0x134436){if(_0x134436){return _0x3d35b7['status'](_0xdc07db)[_0x89b0('0x1c')](_0x134436);}};}function respondWithFilteredResult(_0x396c5f,_0x4d86fe){return function(_0x556e43){if(_0x556e43){var _0x9fb10f=typeof _0x4d86fe[_0x89b0('0x1d')]===_0x89b0('0x1e')&&typeof _0x4d86fe[_0x89b0('0x1f')]==='undefined';var _0x446d37=_0x556e43[_0x89b0('0x20')];var _0x3c159a=_0x9fb10f?0x0:_0x4d86fe[_0x89b0('0x1d')];var _0x58e404=_0x9fb10f?_0x556e43[_0x89b0('0x20')]:_0x4d86fe[_0x89b0('0x1d')]+_0x4d86fe['limit'];var _0x47c79e;if(_0x58e404>=_0x446d37){_0x58e404=_0x446d37;_0x47c79e=0xc8;}else{_0x47c79e=0xce;}_0x396c5f['status'](_0x47c79e);return _0x396c5f[_0x89b0('0x21')](_0x89b0('0x22'),_0x3c159a+'-'+_0x58e404+'/'+_0x446d37)['json'](_0x556e43);}return null;};}function patchUpdates(_0x59e29d){return function(_0x41d57d){try{jsonpatch[_0x89b0('0x23')](_0x41d57d,_0x59e29d,!![]);}catch(_0x4113d5){return BPromise['reject'](_0x4113d5);}return _0x41d57d[_0x89b0('0x24')]();};}function saveUpdates(_0x138af3,_0x5458df){return function(_0x49167d){if(_0x49167d){return _0x49167d[_0x89b0('0x25')](_0x138af3)[_0x89b0('0x26')](function(_0x1b6d0e){return _0x1b6d0e;});}return null;};}function removeEntity(_0x311b60,_0x1acf10){return function(_0x548efe){if(_0x548efe){return _0x548efe[_0x89b0('0x27')]()[_0x89b0('0x26')](function(){_0x311b60[_0x89b0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47de8d,_0x713466){return function(_0x42e4a0){if(!_0x42e4a0){_0x47de8d[_0x89b0('0x1a')](0x194);}return _0x42e4a0;};}function handleError(_0x261b06,_0x1658c8){_0x1658c8=_0x1658c8||0x1f4;return function(_0x452f09){logger[_0x89b0('0x28')](_0x452f09[_0x89b0('0x29')]);if(_0x452f09[_0x89b0('0x2a')]){delete _0x452f09['name'];}_0x261b06[_0x89b0('0x1b')](_0x1658c8)[_0x89b0('0x2b')](_0x452f09);};}exports['index']=function(_0x48b662,_0x3149ec){var _0x2e9204={},_0x3e8d0c={},_0x2463f0={'count':0x0,'rows':[]};var _0x2faeac=_['map'](db[_0x89b0('0x2c')][_0x89b0('0x2d')],function(_0x4e11b6){return{'name':_0x4e11b6[_0x89b0('0x2e')],'type':_0x4e11b6[_0x89b0('0x2f')][_0x89b0('0x30')]};});_0x3e8d0c[_0x89b0('0x31')]=_[_0x89b0('0x32')](_0x2faeac,'name');_0x3e8d0c[_0x89b0('0x33')]=_['keys'](_0x48b662[_0x89b0('0x33')]);_0x3e8d0c[_0x89b0('0x34')]=_['intersection'](_0x3e8d0c[_0x89b0('0x31')],_0x3e8d0c[_0x89b0('0x33')]);_0x2e9204[_0x89b0('0x35')]=_[_0x89b0('0x36')](_0x3e8d0c[_0x89b0('0x31')],qs[_0x89b0('0x37')](_0x48b662[_0x89b0('0x33')][_0x89b0('0x37')]));_0x2e9204['attributes']=_0x2e9204[_0x89b0('0x35')]['length']?_0x2e9204[_0x89b0('0x35')]:_0x3e8d0c['model'];if(!_0x48b662[_0x89b0('0x33')][_0x89b0('0x38')](_0x89b0('0x39'))){_0x2e9204[_0x89b0('0x1f')]=qs[_0x89b0('0x1f')](_0x48b662[_0x89b0('0x33')][_0x89b0('0x1f')]);_0x2e9204[_0x89b0('0x1d')]=qs[_0x89b0('0x1d')](_0x48b662[_0x89b0('0x33')][_0x89b0('0x1d')]);}_0x2e9204[_0x89b0('0x3a')]=qs[_0x89b0('0x3b')](_0x48b662[_0x89b0('0x33')]['sort']);_0x2e9204[_0x89b0('0x3c')]=qs[_0x89b0('0x34')](_[_0x89b0('0x3d')](_0x48b662['query'],_0x3e8d0c[_0x89b0('0x34')]),_0x2faeac);if(_0x48b662[_0x89b0('0x33')][_0x89b0('0x3e')]){_0x2e9204[_0x89b0('0x3c')]=_['merge'](_0x2e9204['where'],{'$or':_[_0x89b0('0x32')](_0x2faeac,function(_0x3d23a4){if(_0x3d23a4[_0x89b0('0x2f')]!=='VIRTUAL'){var _0x42a5f0={};_0x42a5f0[_0x3d23a4['name']]={'$like':'%'+_0x48b662[_0x89b0('0x33')][_0x89b0('0x3e')]+'%'};return _0x42a5f0;}})});}_0x2e9204=_[_0x89b0('0x3f')]({},_0x2e9204,_0x48b662['options']);var _0x4c58c5={'where':_0x2e9204['where']};return db['SquareRecording'][_0x89b0('0x20')](_0x4c58c5)['then'](function(_0x2f2031){_0x2463f0[_0x89b0('0x20')]=_0x2f2031;if(_0x48b662[_0x89b0('0x33')][_0x89b0('0x40')]){_0x2e9204[_0x89b0('0x41')]=[{'all':!![]}];}return db[_0x89b0('0x2c')][_0x89b0('0x42')](_0x2e9204);})['then'](function(_0x4df5a8){_0x2463f0['rows']=_0x4df5a8;return _0x2463f0;})['then'](respondWithFilteredResult(_0x3149ec,_0x2e9204))[_0x89b0('0x43')](handleError(_0x3149ec,null));};exports[_0x89b0('0x44')]=function(_0x258653,_0x4d81dc){var _0x3c2b69={'raw':!![],'where':{'id':_0x258653['params']['id']}},_0x1d4f65={};_0x1d4f65[_0x89b0('0x31')]=_[_0x89b0('0x45')](db[_0x89b0('0x2c')]['rawAttributes']);_0x1d4f65['query']=_[_0x89b0('0x45')](_0x258653[_0x89b0('0x33')]);_0x1d4f65[_0x89b0('0x34')]=_[_0x89b0('0x36')](_0x1d4f65[_0x89b0('0x31')],_0x1d4f65[_0x89b0('0x33')]);_0x3c2b69['attributes']=_['intersection'](_0x1d4f65[_0x89b0('0x31')],qs[_0x89b0('0x37')](_0x258653['query']['fields']));_0x3c2b69['attributes']=_0x3c2b69[_0x89b0('0x35')]['length']?_0x3c2b69[_0x89b0('0x35')]:_0x1d4f65[_0x89b0('0x31')];if(_0x258653['query'][_0x89b0('0x40')]){_0x3c2b69['include']=[{'all':!![]}];}_0x3c2b69=_[_0x89b0('0x3f')]({},_0x3c2b69,_0x258653[_0x89b0('0x46')]);return db['SquareRecording'][_0x89b0('0x47')](_0x3c2b69)[_0x89b0('0x26')](handleEntityNotFound(_0x4d81dc,null))[_0x89b0('0x26')](respondWithResult(_0x4d81dc,null))[_0x89b0('0x43')](handleError(_0x4d81dc,null));};exports[_0x89b0('0x48')]=function(_0x42a61,_0x43b638){return db[_0x89b0('0x2c')][_0x89b0('0x48')](_0x42a61[_0x89b0('0x49')],{})[_0x89b0('0x26')](respondWithResult(_0x43b638,0xc9))[_0x89b0('0x43')](handleError(_0x43b638,null));};exports[_0x89b0('0x25')]=function(_0x43b645,_0x448bc2){if(_0x43b645[_0x89b0('0x49')]['id']){delete _0x43b645[_0x89b0('0x49')]['id'];}return db[_0x89b0('0x2c')][_0x89b0('0x47')]({'where':{'id':_0x43b645[_0x89b0('0x4a')]['id']}})[_0x89b0('0x26')](handleEntityNotFound(_0x448bc2,null))['then'](saveUpdates(_0x43b645[_0x89b0('0x49')],null))['then'](respondWithResult(_0x448bc2,null))['catch'](handleError(_0x448bc2,null));};exports[_0x89b0('0x4b')]=function(_0x1beb40,_0x2faebf,_0x44083d){var _0x2df545=require(_0x89b0('0x4c'));var _0x2c769e=![];var _0x2e8130={};if(_0x1beb40[_0x89b0('0x33')][_0x89b0('0x2f')]&&_0x1beb40['query'][_0x89b0('0x2f')]==='uniqueid'){_0x2e8130[_0x89b0('0x4d')]=_0x1beb40[_0x89b0('0x4a')]['id'];}else{_0x2e8130['id']=_0x1beb40[_0x89b0('0x4a')]['id'];}return db[_0x89b0('0x2c')]['find']({'where':_0x2e8130,'attributes':['id','savePath',_0x89b0('0x4e')],'raw':!![]})[_0x89b0('0x26')](handleEntityNotFound(_0x2faebf,null))[_0x89b0('0x26')](function(_0x34f94c){if(_0x34f94c){var _0x389116=_0x34f94c[_0x89b0('0x4f')];var _0xbe89c4=util[_0x89b0('0x50')](_0x89b0('0x51'),_0x389116);if(fs[_0x89b0('0x52')](_0xbe89c4)){_0x2c769e=!![];return _0x2df545[_0x89b0('0x53')](_0xbe89c4,_0x389116,config[_0x89b0('0x54')][_0x89b0('0x55')])[_0x89b0('0x26')](function(){return _0x34f94c;});}return _0x34f94c;}})[_0x89b0('0x26')](function(_0xc8aa3){if(_0xc8aa3){var _0x17cc1e=_0xc8aa3['savePath'];if(!fs[_0x89b0('0x52')](_0x17cc1e)){throw new db['Sequelize'][(_0x89b0('0x56'))](_0x89b0('0x57'));}if(_0xc8aa3[_0x89b0('0x4e')]){return _0x2faebf['download'](_0x17cc1e,_0xc8aa3[_0x89b0('0x4e')]+path[_0x89b0('0x58')](_0x17cc1e),function(){if(_0x2c769e){fs['unlink'](_0x17cc1e);}});}else{return _0x2faebf['download'](_0x17cc1e,function(_0x3379ac){if(_0x2c769e){fs['unlink'](_0x17cc1e);}});}}})['catch'](function(_0x2af73e){if(_0x2af73e[_0x89b0('0x59')]===_0x89b0('0x57')){_0x2faebf[_0x89b0('0x1b')](0x194)[_0x89b0('0x2b')](_0x89b0('0x5a'));}else{return handleError(_0x2faebf,null);}});};exports[_0x89b0('0x27')]=function(_0x45ae00,_0x30b67b){return db[_0x89b0('0x2c')]['find']({'where':{'id':_0x45ae00[_0x89b0('0x4a')]['id']}})[_0x89b0('0x26')](function(_0x169df1){if(_[_0x89b0('0x5b')](_0x169df1)){throw new ReferenceError(_0x89b0('0x5c'));}return _0x169df1;})[_0x89b0('0x26')](function(_0x3eccfa){var _0x459ce0=_0x3eccfa[_0x89b0('0x4f')];logger[_0x89b0('0x5d')](_0x89b0('0x5e'),_0x459ce0);if(!_[_0x89b0('0x5b')](_0x3eccfa['savePath'])&&fs['existsSync'](_0x459ce0)){logger['info'](_0x89b0('0x5f')+_0x459ce0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x89b0('0x60')](_0x459ce0);}_0x459ce0=_0x459ce0+_0x89b0('0x61');if(!_['isNil'](_0x3eccfa[_0x89b0('0x4f')])&&fs[_0x89b0('0x52')](_0x459ce0)){logger[_0x89b0('0x5d')]('File:\x20\x22'+_0x459ce0+_0x89b0('0x62'));fs[_0x89b0('0x60')](_0x459ce0);}return _0x3eccfa;})[_0x89b0('0x26')](function(_0x1789c2){if(!_0x1789c2)throw new InternalError();return _0x1789c2[_0x89b0('0x27')]();})[_0x89b0('0x26')](function(){_0x30b67b[_0x89b0('0x1b')](0xcc)[_0x89b0('0x63')]();})['catch'](handleError(_0x30b67b,null));}; \ No newline at end of file +var _0x9ccd=['order','sort','filters','pick','filter','merge','where','type','VIRTUAL','SquareRecording','includeAll','findAll','rows','catch','params','include','options','find','create','body','../../components/encryptor','savePath','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','download','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x544c8d,_0xb33a92){var _0x266c38=function(_0x32ecc2){while(--_0x32ecc2){_0x544c8d['push'](_0x544c8d['shift']());}};_0x266c38(++_0xb33a92);}(_0x9ccd,0x8e));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd9cc('0x0'));var rimraf=require(_0xd9cc('0x1'));var zipdir=require(_0xd9cc('0x2'));var jsonpatch=require(_0xd9cc('0x3'));var rp=require(_0xd9cc('0x4'));var moment=require(_0xd9cc('0x5'));var BPromise=require(_0xd9cc('0x6'));var Mustache=require('mustache');var util=require(_0xd9cc('0x7'));var path=require(_0xd9cc('0x8'));var sox=require(_0xd9cc('0x9'));var csv=require(_0xd9cc('0xa'));var ejs=require(_0xd9cc('0xb'));var fs=require('fs');var fs_extra=require(_0xd9cc('0xc'));var _=require(_0xd9cc('0xd'));var squel=require(_0xd9cc('0xe'));var crypto=require(_0xd9cc('0xf'));var jsforce=require(_0xd9cc('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd9cc('0xa'));var querystring=require(_0xd9cc('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9cc('0x12'));var qs=require(_0xd9cc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9cc('0x14'));var logger=require(_0xd9cc('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd9cc('0x16'))['db'];function respondWithStatusCode(_0x4e6343,_0x3d8d14){_0x3d8d14=_0x3d8d14||0xcc;return function(_0xf51544){if(_0xf51544){return _0x4e6343['sendStatus'](_0x3d8d14);}return _0x4e6343[_0xd9cc('0x17')](_0x3d8d14)[_0xd9cc('0x18')]();};}function respondWithResult(_0x54b60d,_0x380d01){_0x380d01=_0x380d01||0xc8;return function(_0x2f2e3e){if(_0x2f2e3e){return _0x54b60d[_0xd9cc('0x17')](_0x380d01)['json'](_0x2f2e3e);}};}function respondWithFilteredResult(_0xd57c23,_0x343e7b){return function(_0x215c0e){if(_0x215c0e){var _0x4a87ab=typeof _0x343e7b[_0xd9cc('0x19')]===_0xd9cc('0x1a')&&typeof _0x343e7b[_0xd9cc('0x1b')]===_0xd9cc('0x1a');var _0x7a7da=_0x215c0e[_0xd9cc('0x1c')];var _0x5632c9=_0x4a87ab?0x0:_0x343e7b[_0xd9cc('0x19')];var _0x540648=_0x4a87ab?_0x215c0e[_0xd9cc('0x1c')]:_0x343e7b[_0xd9cc('0x19')]+_0x343e7b[_0xd9cc('0x1b')];var _0x305a4a;if(_0x540648>=_0x7a7da){_0x540648=_0x7a7da;_0x305a4a=0xc8;}else{_0x305a4a=0xce;}_0xd57c23[_0xd9cc('0x17')](_0x305a4a);return _0xd57c23[_0xd9cc('0x1d')](_0xd9cc('0x1e'),_0x5632c9+'-'+_0x540648+'/'+_0x7a7da)[_0xd9cc('0x1f')](_0x215c0e);}return null;};}function patchUpdates(_0x247c2a){return function(_0x26d115){try{jsonpatch['apply'](_0x26d115,_0x247c2a,!![]);}catch(_0x34f519){return BPromise['reject'](_0x34f519);}return _0x26d115[_0xd9cc('0x20')]();};}function saveUpdates(_0x4d0e4c,_0x364c98){return function(_0xba09c3){if(_0xba09c3){return _0xba09c3[_0xd9cc('0x21')](_0x4d0e4c)[_0xd9cc('0x22')](function(_0x416dc5){return _0x416dc5;});}return null;};}function removeEntity(_0x4d0b8a,_0x5021aa){return function(_0x1fbda9){if(_0x1fbda9){return _0x1fbda9[_0xd9cc('0x23')]()[_0xd9cc('0x22')](function(){_0x4d0b8a[_0xd9cc('0x17')](0xcc)[_0xd9cc('0x18')]();});}};}function handleEntityNotFound(_0x30a4de,_0x319aa8){return function(_0x4bbfb2){if(!_0x4bbfb2){_0x30a4de[_0xd9cc('0x24')](0x194);}return _0x4bbfb2;};}function handleError(_0x41826f,_0x306be3){_0x306be3=_0x306be3||0x1f4;return function(_0x53b273){logger[_0xd9cc('0x25')](_0x53b273[_0xd9cc('0x26')]);if(_0x53b273[_0xd9cc('0x27')]){delete _0x53b273['name'];}_0x41826f[_0xd9cc('0x17')](_0x306be3)[_0xd9cc('0x28')](_0x53b273);};}exports[_0xd9cc('0x29')]=function(_0x229ed8,_0x17d8bd){var _0x39859b={},_0x244709={},_0x2874b6={'count':0x0,'rows':[]};var _0x5b7f11=_[_0xd9cc('0x2a')](db['SquareRecording'][_0xd9cc('0x2b')],function(_0xfe6c72){return{'name':_0xfe6c72[_0xd9cc('0x2c')],'type':_0xfe6c72['type'][_0xd9cc('0x2d')]};});_0x244709[_0xd9cc('0x2e')]=_['map'](_0x5b7f11,'name');_0x244709[_0xd9cc('0x2f')]=_[_0xd9cc('0x30')](_0x229ed8[_0xd9cc('0x2f')]);_0x244709['filters']=_[_0xd9cc('0x31')](_0x244709[_0xd9cc('0x2e')],_0x244709[_0xd9cc('0x2f')]);_0x39859b['attributes']=_[_0xd9cc('0x31')](_0x244709['model'],qs[_0xd9cc('0x32')](_0x229ed8[_0xd9cc('0x2f')]['fields']));_0x39859b[_0xd9cc('0x33')]=_0x39859b[_0xd9cc('0x33')][_0xd9cc('0x34')]?_0x39859b[_0xd9cc('0x33')]:_0x244709['model'];if(!_0x229ed8[_0xd9cc('0x2f')][_0xd9cc('0x35')]('nolimit')){_0x39859b[_0xd9cc('0x1b')]=qs[_0xd9cc('0x1b')](_0x229ed8[_0xd9cc('0x2f')][_0xd9cc('0x1b')]);_0x39859b[_0xd9cc('0x19')]=qs[_0xd9cc('0x19')](_0x229ed8[_0xd9cc('0x2f')][_0xd9cc('0x19')]);}_0x39859b[_0xd9cc('0x36')]=qs[_0xd9cc('0x37')](_0x229ed8['query'][_0xd9cc('0x37')]);_0x39859b['where']=qs[_0xd9cc('0x38')](_[_0xd9cc('0x39')](_0x229ed8[_0xd9cc('0x2f')],_0x244709[_0xd9cc('0x38')]),_0x5b7f11);if(_0x229ed8[_0xd9cc('0x2f')][_0xd9cc('0x3a')]){_0x39859b['where']=_[_0xd9cc('0x3b')](_0x39859b[_0xd9cc('0x3c')],{'$or':_[_0xd9cc('0x2a')](_0x5b7f11,function(_0x2a3438){if(_0x2a3438[_0xd9cc('0x3d')]!==_0xd9cc('0x3e')){var _0x2bd24b={};_0x2bd24b[_0x2a3438[_0xd9cc('0x27')]]={'$like':'%'+_0x229ed8[_0xd9cc('0x2f')][_0xd9cc('0x3a')]+'%'};return _0x2bd24b;}})});}_0x39859b=_[_0xd9cc('0x3b')]({},_0x39859b,_0x229ed8['options']);var _0x145e55={'where':_0x39859b['where']};return db[_0xd9cc('0x3f')][_0xd9cc('0x1c')](_0x145e55)['then'](function(_0x1f136a){_0x2874b6[_0xd9cc('0x1c')]=_0x1f136a;if(_0x229ed8[_0xd9cc('0x2f')][_0xd9cc('0x40')]){_0x39859b['include']=[{'all':!![]}];}return db[_0xd9cc('0x3f')][_0xd9cc('0x41')](_0x39859b);})['then'](function(_0x159510){_0x2874b6[_0xd9cc('0x42')]=_0x159510;return _0x2874b6;})[_0xd9cc('0x22')](respondWithFilteredResult(_0x17d8bd,_0x39859b))[_0xd9cc('0x43')](handleError(_0x17d8bd,null));};exports['show']=function(_0x3b0401,_0x2f7710){var _0x462262={'raw':!![],'where':{'id':_0x3b0401[_0xd9cc('0x44')]['id']}},_0x1ff377={};_0x1ff377[_0xd9cc('0x2e')]=_[_0xd9cc('0x30')](db['SquareRecording']['rawAttributes']);_0x1ff377[_0xd9cc('0x2f')]=_[_0xd9cc('0x30')](_0x3b0401[_0xd9cc('0x2f')]);_0x1ff377[_0xd9cc('0x38')]=_['intersection'](_0x1ff377[_0xd9cc('0x2e')],_0x1ff377[_0xd9cc('0x2f')]);_0x462262['attributes']=_['intersection'](_0x1ff377[_0xd9cc('0x2e')],qs[_0xd9cc('0x32')](_0x3b0401['query'][_0xd9cc('0x32')]));_0x462262[_0xd9cc('0x33')]=_0x462262[_0xd9cc('0x33')]['length']?_0x462262[_0xd9cc('0x33')]:_0x1ff377[_0xd9cc('0x2e')];if(_0x3b0401[_0xd9cc('0x2f')][_0xd9cc('0x40')]){_0x462262[_0xd9cc('0x45')]=[{'all':!![]}];}_0x462262=_['merge']({},_0x462262,_0x3b0401[_0xd9cc('0x46')]);return db[_0xd9cc('0x3f')][_0xd9cc('0x47')](_0x462262)[_0xd9cc('0x22')](handleEntityNotFound(_0x2f7710,null))[_0xd9cc('0x22')](respondWithResult(_0x2f7710,null))[_0xd9cc('0x43')](handleError(_0x2f7710,null));};exports[_0xd9cc('0x48')]=function(_0x456b87,_0x1acb7b){return db[_0xd9cc('0x3f')][_0xd9cc('0x48')](_0x456b87['body'],{})[_0xd9cc('0x22')](respondWithResult(_0x1acb7b,0xc9))[_0xd9cc('0x43')](handleError(_0x1acb7b,null));};exports['update']=function(_0x9bf4c3,_0x727518){if(_0x9bf4c3[_0xd9cc('0x49')]['id']){delete _0x9bf4c3[_0xd9cc('0x49')]['id'];}return db[_0xd9cc('0x3f')][_0xd9cc('0x47')]({'where':{'id':_0x9bf4c3[_0xd9cc('0x44')]['id']}})[_0xd9cc('0x22')](handleEntityNotFound(_0x727518,null))[_0xd9cc('0x22')](saveUpdates(_0x9bf4c3[_0xd9cc('0x49')],null))[_0xd9cc('0x22')](respondWithResult(_0x727518,null))['catch'](handleError(_0x727518,null));};exports['download']=function(_0x109ef4,_0x924061,_0xc8f64b){var _0x543e1d=require(_0xd9cc('0x4a'));var _0x1bcfd4=![];var _0x27095f={};if(_0x109ef4[_0xd9cc('0x2f')]['type']&&_0x109ef4['query'][_0xd9cc('0x3d')]==='uniqueid'){_0x27095f['uniqueid']=_0x109ef4[_0xd9cc('0x44')]['id'];}else{_0x27095f['id']=_0x109ef4[_0xd9cc('0x44')]['id'];}return db['SquareRecording'][_0xd9cc('0x47')]({'where':_0x27095f,'attributes':['id',_0xd9cc('0x4b'),'filename'],'raw':!![]})[_0xd9cc('0x22')](handleEntityNotFound(_0x924061,null))[_0xd9cc('0x22')](function(_0x262089){if(_0x262089){var _0xe97ef1=_0x262089[_0xd9cc('0x4b')];var _0x37a35b=util[_0xd9cc('0x4c')](_0xd9cc('0x4d'),_0xe97ef1);if(fs['existsSync'](_0x37a35b)){_0x1bcfd4=!![];return _0x543e1d[_0xd9cc('0x4e')](_0x37a35b,_0xe97ef1,config[_0xd9cc('0x4f')][_0xd9cc('0x50')])['then'](function(){return _0x262089;});}return _0x262089;}})[_0xd9cc('0x22')](function(_0x179885){if(_0x179885){var _0x420f80=_0x179885[_0xd9cc('0x4b')];if(!fs[_0xd9cc('0x51')](_0x420f80)){throw new db[(_0xd9cc('0x52'))][(_0xd9cc('0x53'))](_0xd9cc('0x54'));}if(_0x179885[_0xd9cc('0x55')]){return _0x924061['download'](_0x420f80,_0x179885[_0xd9cc('0x55')]+path[_0xd9cc('0x56')](_0x420f80),function(){if(_0x1bcfd4){fs['unlink'](_0x420f80);}});}else{return _0x924061[_0xd9cc('0x57')](_0x420f80,function(_0x272481){if(_0x1bcfd4){fs[_0xd9cc('0x58')](_0x420f80);}});}}})[_0xd9cc('0x43')](function(_0x510889){if(_0x510889[_0xd9cc('0x59')]===_0xd9cc('0x54')){_0x924061['status'](0x194)['send'](_0xd9cc('0x5a'));}else{return handleError(_0x924061,null);}});};exports[_0xd9cc('0x23')]=function(_0x48775c,_0x4e9631){return db[_0xd9cc('0x3f')][_0xd9cc('0x47')]({'where':{'id':_0x48775c[_0xd9cc('0x44')]['id']}})[_0xd9cc('0x22')](function(_0x4b5086){if(_['isNil'](_0x4b5086)){throw new ReferenceError(_0xd9cc('0x5b'));}return _0x4b5086;})[_0xd9cc('0x22')](function(_0x18a034){var _0x3aa95a=_0x18a034['savePath'];logger[_0xd9cc('0x5c')](_0xd9cc('0x5d'),_0x3aa95a);if(!_['isNil'](_0x18a034['savePath'])&&fs['existsSync'](_0x3aa95a)){logger[_0xd9cc('0x5c')]('File:\x20\x22'+_0x3aa95a+_0xd9cc('0x5e'));fs[_0xd9cc('0x5f')](_0x3aa95a);}_0x3aa95a=_0x3aa95a+'.cypher';if(!_[_0xd9cc('0x60')](_0x18a034['savePath'])&&fs[_0xd9cc('0x51')](_0x3aa95a)){logger['info'](_0xd9cc('0x61')+_0x3aa95a+_0xd9cc('0x5e'));fs[_0xd9cc('0x5f')](_0x3aa95a);}return _0x18a034;})[_0xd9cc('0x22')](function(_0xb81464){if(!_0xb81464)throw new InternalError();return _0xb81464[_0xd9cc('0x23')]();})[_0xd9cc('0x22')](function(){_0x4e9631['status'](0xcc)[_0xd9cc('0x18')]();})[_0xd9cc('0x43')](handleError(_0x4e9631,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 6d8ed6c..36fe58c 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 _0x5458=['../../config/environment','exports','define','square_recordings','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1bc64d,_0x41c6c5){var _0x546913=function(_0x201d14){while(--_0x201d14){_0x1bc64d['push'](_0x1bc64d['shift']());}};_0x546913(++_0x41c6c5);}(_0x5458,0x1c7));var _0x8545=function(_0x2405b6,_0x5be88c){_0x2405b6=_0x2405b6-0x0;var _0x5eaa81=_0x5458[_0x2405b6];return _0x5eaa81;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var logger=require(_0x8545('0x2'))('api');var moment=require(_0x8545('0x3'));var BPromise=require(_0x8545('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8545('0x5'));var rimraf=require(_0x8545('0x6'));var config=require(_0x8545('0x7'));var attributes=require('./squareRecording.attributes');module[_0x8545('0x8')]=function(_0x2bd13a,_0x10792f){return _0x2bd13a[_0x8545('0x9')]('SquareRecording',attributes,{'tableName':_0x8545('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bd3=['exports','define','SquareRecording','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x973279,_0xef77d6){var _0x585045=function(_0x362bbe){while(--_0x362bbe){_0x973279['push'](_0x973279['shift']());}};_0x585045(++_0xef77d6);}(_0x4bd3,0x174));var _0x34bd=function(_0x596a88,_0x210a4e){_0x596a88=_0x596a88-0x0;var _0xc5cb5d=_0x4bd3[_0x596a88];return _0xc5cb5d;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./squareRecording.attributes');module[_0x34bd('0x6')]=function(_0x2a15a2,_0x5c2a7a){return _0x2a15a2[_0x34bd('0x7')](_0x34bd('0x8'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 19496a4..f11982a 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 _0xd714=['catch','CreateSquareRecording','SquareRecording','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3a9c7d,_0x162e95){var _0x246333=function(_0x33d2c5){while(--_0x33d2c5){_0x3a9c7d['push'](_0x3a9c7d['shift']());}};_0x246333(++_0x162e95);}(_0xd714,0x66));var _0x4d71=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xd714[_0x27bcf5];return _0x4ce4cf;};'use strict';var _=require(_0x4d71('0x0'));var util=require(_0x4d71('0x1'));var moment=require(_0x4d71('0x2'));var BPromise=require(_0x4d71('0x3'));var rs=require(_0x4d71('0x4'));var fs=require('fs');var Redis=require(_0x4d71('0x5'));var db=require(_0x4d71('0x6'))['db'];var utils=require(_0x4d71('0x7'));var logger=require(_0x4d71('0x8'))(_0x4d71('0x9'));var config=require(_0x4d71('0xa'));var jayson=require(_0x4d71('0xb'));var client=jayson[_0x4d71('0xc')][_0x4d71('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5789d1,_0x218d49,_0x21156e){return new BPromise(function(_0x3203ac,_0x334e21){return client[_0x4d71('0xe')](_0x5789d1,_0x21156e)[_0x4d71('0xf')](function(_0x17ec22){logger[_0x4d71('0x10')](_0x4d71('0x11'),_0x218d49,_0x4d71('0x12'));logger[_0x4d71('0x13')](_0x4d71('0x14'),_0x218d49,'request\x20sent',JSON[_0x4d71('0x15')](_0x17ec22));if(_0x17ec22[_0x4d71('0x16')]){if(_0x17ec22[_0x4d71('0x16')][_0x4d71('0x17')]===0x1f4){logger[_0x4d71('0x16')]('SquareRecording,\x20%s,\x20%s',_0x218d49,_0x17ec22[_0x4d71('0x16')]['message']);return _0x334e21(_0x17ec22[_0x4d71('0x16')]['message']);}logger[_0x4d71('0x16')](_0x4d71('0x11'),_0x218d49,_0x17ec22[_0x4d71('0x16')][_0x4d71('0x18')]);return _0x3203ac(_0x17ec22['error']['message']);}else{logger[_0x4d71('0x10')](_0x4d71('0x11'),_0x218d49,'request\x20sent');_0x3203ac(_0x17ec22[_0x4d71('0x19')]['message']);}})[_0x4d71('0x1a')](function(_0x4d26ff){logger[_0x4d71('0x16')](_0x4d71('0x11'),_0x218d49,_0x4d26ff);_0x334e21(_0x4d26ff);});});}exports[_0x4d71('0x1b')]=function(_0x489180){var _0x832741=this;return new Promise(function(_0x1b7ec7,_0x59d6a5){return db[_0x4d71('0x1c')][_0x4d71('0x1d')](_0x489180[_0x4d71('0x1e')],{'raw':_0x489180[_0x4d71('0x1f')]?_0x489180[_0x4d71('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4d71('0xf')](function(_0xd506e){logger[_0x4d71('0x10')](_0x4d71('0x1b'),_0x489180);logger['debug'](_0x4d71('0x1b'),_0x489180,JSON[_0x4d71('0x15')](_0xd506e));_0x1b7ec7(_0xd506e);})[_0x4d71('0x1a')](function(_0x1b0ea6){logger[_0x4d71('0x16')]('CreateSquareRecording',_0x1b0ea6[_0x4d71('0x18')],_0x489180);_0x59d6a5(_0x832741[_0x4d71('0x16')](0x1f4,_0x1b0ea6[_0x4d71('0x18')]));});});}; \ No newline at end of file +var _0x87b4=['../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','catch','CreateSquareRecording','body','options','raw','then','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b4a94,_0x39e9ae){var _0x97d164=function(_0x490f24){while(--_0x490f24){_0x5b4a94['push'](_0x5b4a94['shift']());}};_0x97d164(++_0x39e9ae);}(_0x87b4,0x167));var _0x487b=function(_0x4b4ff3,_0x16b82f){_0x4b4ff3=_0x4b4ff3-0x0;var _0x335c70=_0x87b4[_0x4b4ff3];return _0x335c70;};'use strict';var _=require(_0x487b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x487b('0x1'));var rs=require(_0x487b('0x2'));var fs=require('fs');var Redis=require(_0x487b('0x3'));var db=require(_0x487b('0x4'))['db'];var utils=require(_0x487b('0x5'));var logger=require(_0x487b('0x6'))(_0x487b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x487b('0x8')][_0x487b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c14e2,_0x399890,_0x3bfca5){return new BPromise(function(_0x4f1da9,_0x22a81a){return client[_0x487b('0xa')](_0x3c14e2,_0x3bfca5)['then'](function(_0x490fdb){logger[_0x487b('0xb')]('SquareRecording,\x20%s,\x20%s',_0x399890,_0x487b('0xc'));logger[_0x487b('0xd')](_0x487b('0xe'),_0x399890,_0x487b('0xc'),JSON['stringify'](_0x490fdb));if(_0x490fdb[_0x487b('0xf')]){if(_0x490fdb[_0x487b('0xf')][_0x487b('0x10')]===0x1f4){logger[_0x487b('0xf')](_0x487b('0x11'),_0x399890,_0x490fdb[_0x487b('0xf')][_0x487b('0x12')]);return _0x22a81a(_0x490fdb[_0x487b('0xf')][_0x487b('0x12')]);}logger[_0x487b('0xf')](_0x487b('0x11'),_0x399890,_0x490fdb['error'][_0x487b('0x12')]);return _0x4f1da9(_0x490fdb['error']['message']);}else{logger[_0x487b('0xb')]('SquareRecording,\x20%s,\x20%s',_0x399890,'request\x20sent');_0x4f1da9(_0x490fdb['result'][_0x487b('0x12')]);}})[_0x487b('0x13')](function(_0x2b39e6){logger[_0x487b('0xf')](_0x487b('0x11'),_0x399890,_0x2b39e6);_0x22a81a(_0x2b39e6);});});}exports[_0x487b('0x14')]=function(_0x335fb2){var _0x2ddedd=this;return new Promise(function(_0x206882,_0x313868){return db['SquareRecording']['create'](_0x335fb2[_0x487b('0x15')],{'raw':_0x335fb2['options']?_0x335fb2[_0x487b('0x16')][_0x487b('0x17')]===undefined?!![]:![]:!![]})[_0x487b('0x18')](function(_0x38c793){logger['info'](_0x487b('0x14'),_0x335fb2);logger[_0x487b('0xd')](_0x487b('0x14'),_0x335fb2,JSON[_0x487b('0x19')](_0x38c793));_0x206882(_0x38c793);})[_0x487b('0x13')](function(_0x29a04c){logger[_0x487b('0xf')](_0x487b('0x14'),_0x29a04c['message'],_0x335fb2);_0x313868(_0x2ddedd[_0x487b('0xf')](0x1f4,_0x29a04c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 753aefc..cb1c05b 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x14be84,_0x4cd101){var _0x4a5fa4=function(_0x4ee004){while(--_0x4ee004){_0x14be84['push'](_0x14be84['shift']());}};_0x4a5fa4(++_0x4cd101);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index d59b00c..26dc25a 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 _0x80cd=['DATE','BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80cd,0x146));var _0xd80c=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0x80cd[_0x2ef8c1];return _0x288305;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'network':{'type':Sequelize[_0xd80c('0x1')]},'network_script':{'type':Sequelize[_0xd80c('0x1')]},'request':{'type':Sequelize[_0xd80c('0x1')]},'channel':{'type':Sequelize[_0xd80c('0x1')]},'language':{'type':Sequelize[_0xd80c('0x1')]},'type':{'type':Sequelize[_0xd80c('0x1')]},'uniqueid':{'type':Sequelize[_0xd80c('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd80c('0x1')]},'calleridname':{'type':Sequelize[_0xd80c('0x1')]},'callingpres':{'type':Sequelize[_0xd80c('0x1')]},'callingani2':{'type':Sequelize[_0xd80c('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd80c('0x1')]},'dnid':{'type':Sequelize[_0xd80c('0x1')]},'rdnis':{'type':Sequelize[_0xd80c('0x1')]},'context':{'type':Sequelize[_0xd80c('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd80c('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xd80c('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd80c('0x2')]},'leaveAt':{'type':Sequelize[_0xd80c('0x2')]},'bot':{'type':Sequelize[_0xd80c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0510=['DATE','sequelize','exports','STRING'];(function(_0xc2e3f3,_0x11160e){var _0x56f403=function(_0x475a3){while(--_0x475a3){_0xc2e3f3['push'](_0xc2e3f3['shift']());}};_0x56f403(++_0x11160e);}(_0x0510,0x121));var _0x0051=function(_0x170779,_0x23671d){_0x170779=_0x170779-0x0;var _0x2d126f=_0x0510[_0x170779];return _0x2d126f;};'use strict';var Sequelize=require(_0x0051('0x0'));module[_0x0051('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x0051('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0051('0x2')]},'language':{'type':Sequelize[_0x0051('0x2')]},'type':{'type':Sequelize[_0x0051('0x2')]},'uniqueid':{'type':Sequelize[_0x0051('0x2')]},'version':{'type':Sequelize[_0x0051('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0051('0x2')]},'callingpres':{'type':Sequelize[_0x0051('0x2')]},'callingani2':{'type':Sequelize[_0x0051('0x2')]},'callington':{'type':Sequelize[_0x0051('0x2')]},'callingtns':{'type':Sequelize[_0x0051('0x2')]},'dnid':{'type':Sequelize[_0x0051('0x2')]},'rdnis':{'type':Sequelize[_0x0051('0x2')]},'context':{'type':Sequelize[_0x0051('0x2')]},'extension':{'type':Sequelize[_0x0051('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0051('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0051('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0051('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 36b2f5c..0e3a727 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 _0x5ab8=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','index','SquareReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','create','update','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1f5ab3,_0x2d2473){var _0x2bd0d7=function(_0x41c41b){while(--_0x41c41b){_0x1f5ab3['push'](_0x1f5ab3['shift']());}};_0x2bd0d7(++_0x2d2473);}(_0x5ab8,0x1ab));var _0x85ab=function(_0x47a328,_0x1dd386){_0x47a328=_0x47a328-0x0;var _0x183fcd=_0x5ab8[_0x47a328];return _0x183fcd;};'use strict';var emlformat=require(_0x85ab('0x0'));var rimraf=require(_0x85ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85ab('0x2'));var rp=require(_0x85ab('0x3'));var moment=require(_0x85ab('0x4'));var BPromise=require(_0x85ab('0x5'));var Mustache=require(_0x85ab('0x6'));var util=require(_0x85ab('0x7'));var path=require(_0x85ab('0x8'));var sox=require(_0x85ab('0x9'));var csv=require(_0x85ab('0xa'));var ejs=require(_0x85ab('0xb'));var fs=require('fs');var fs_extra=require(_0x85ab('0xc'));var _=require(_0x85ab('0xd'));var squel=require('squel');var crypto=require(_0x85ab('0xe'));var jsforce=require(_0x85ab('0xf'));var deskjs=require(_0x85ab('0x10'));var toCsv=require(_0x85ab('0xa'));var querystring=require(_0x85ab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x85ab('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85ab('0x13'))(_0x85ab('0x14'));var utils=require('../../config/utils');var config=require(_0x85ab('0x15'));var licenseUtil=require(_0x85ab('0x16'));var db=require(_0x85ab('0x17'))['db'];function respondWithStatusCode(_0x1b63d2,_0x5c24aa){_0x5c24aa=_0x5c24aa||0xcc;return function(_0x24b63d){if(_0x24b63d){return _0x1b63d2['sendStatus'](_0x5c24aa);}return _0x1b63d2[_0x85ab('0x18')](_0x5c24aa)[_0x85ab('0x19')]();};}function respondWithResult(_0x24eb1a,_0x3a8a3f){_0x3a8a3f=_0x3a8a3f||0xc8;return function(_0x43fb56){if(_0x43fb56){return _0x24eb1a[_0x85ab('0x18')](_0x3a8a3f)[_0x85ab('0x1a')](_0x43fb56);}};}function respondWithFilteredResult(_0x3be38a,_0x1905e2){return function(_0x1ca343){if(_0x1ca343){var _0x1ab343=typeof _0x1905e2['offset']==='undefined'&&typeof _0x1905e2['limit']===_0x85ab('0x1b');var _0xc4bc1a=_0x1ca343[_0x85ab('0x1c')];var _0xf2a2c5=_0x1ab343?0x0:_0x1905e2['offset'];var _0x39436c=_0x1ab343?_0x1ca343[_0x85ab('0x1c')]:_0x1905e2[_0x85ab('0x1d')]+_0x1905e2[_0x85ab('0x1e')];var _0x32c1e9;if(_0x39436c>=_0xc4bc1a){_0x39436c=_0xc4bc1a;_0x32c1e9=0xc8;}else{_0x32c1e9=0xce;}_0x3be38a[_0x85ab('0x18')](_0x32c1e9);return _0x3be38a[_0x85ab('0x1f')](_0x85ab('0x20'),_0xf2a2c5+'-'+_0x39436c+'/'+_0xc4bc1a)[_0x85ab('0x1a')](_0x1ca343);}return null;};}function patchUpdates(_0x52183b){return function(_0xe9ca49){try{jsonpatch[_0x85ab('0x21')](_0xe9ca49,_0x52183b,!![]);}catch(_0x3a8be2){return BPromise[_0x85ab('0x22')](_0x3a8be2);}return _0xe9ca49[_0x85ab('0x23')]();};}function saveUpdates(_0x1704b0,_0x508adc){return function(_0x5c9600){if(_0x5c9600){return _0x5c9600['update'](_0x1704b0)[_0x85ab('0x24')](function(_0x7eb6c3){return _0x7eb6c3;});}return null;};}function removeEntity(_0x44f988,_0x3d9ae4){return function(_0x5955c2){if(_0x5955c2){return _0x5955c2[_0x85ab('0x25')]()[_0x85ab('0x24')](function(){_0x44f988[_0x85ab('0x18')](0xcc)[_0x85ab('0x19')]();});}};}function handleEntityNotFound(_0x5bfd09,_0x200a58){return function(_0x23e044){if(!_0x23e044){_0x5bfd09[_0x85ab('0x26')](0x194);}return _0x23e044;};}function handleError(_0x3a503a,_0x5bcf5b){_0x5bcf5b=_0x5bcf5b||0x1f4;return function(_0x48056d){logger['error'](_0x48056d[_0x85ab('0x27')]);if(_0x48056d[_0x85ab('0x28')]){delete _0x48056d[_0x85ab('0x28')];}_0x3a503a[_0x85ab('0x18')](_0x5bcf5b)['send'](_0x48056d);};}exports[_0x85ab('0x29')]=function(_0x1f8845,_0xff87c){var _0x5d4f4b={},_0x51360d={},_0x34ed29={'count':0x0,'rows':[]};var _0xa8dae1=_['map'](db[_0x85ab('0x2a')]['rawAttributes'],function(_0x90c070){return{'name':_0x90c070[_0x85ab('0x2b')],'type':_0x90c070[_0x85ab('0x2c')]['key']};});_0x51360d[_0x85ab('0x2d')]=_['map'](_0xa8dae1,_0x85ab('0x28'));_0x51360d[_0x85ab('0x2e')]=_[_0x85ab('0x2f')](_0x1f8845[_0x85ab('0x2e')]);_0x51360d[_0x85ab('0x30')]=_['intersection'](_0x51360d['model'],_0x51360d[_0x85ab('0x2e')]);_0x5d4f4b[_0x85ab('0x31')]=_[_0x85ab('0x32')](_0x51360d['model'],qs['fields'](_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x33')]));_0x5d4f4b[_0x85ab('0x31')]=_0x5d4f4b[_0x85ab('0x31')][_0x85ab('0x34')]?_0x5d4f4b[_0x85ab('0x31')]:_0x51360d['model'];if(!_0x1f8845[_0x85ab('0x2e')]['hasOwnProperty']('nolimit')){_0x5d4f4b[_0x85ab('0x1e')]=qs[_0x85ab('0x1e')](_0x1f8845[_0x85ab('0x2e')]['limit']);_0x5d4f4b[_0x85ab('0x1d')]=qs[_0x85ab('0x1d')](_0x1f8845[_0x85ab('0x2e')]['offset']);}_0x5d4f4b[_0x85ab('0x35')]=qs['sort'](_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x36')]);_0x5d4f4b[_0x85ab('0x37')]=qs[_0x85ab('0x30')](_[_0x85ab('0x38')](_0x1f8845[_0x85ab('0x2e')],_0x51360d[_0x85ab('0x30')]),_0xa8dae1);if(_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x39')]){_0x5d4f4b['where']=_['merge'](_0x5d4f4b[_0x85ab('0x37')],{'$or':_['map'](_0xa8dae1,function(_0x512f8e){if(_0x512f8e[_0x85ab('0x2c')]!==_0x85ab('0x3a')){var _0x3ba8c0={};_0x3ba8c0[_0x512f8e[_0x85ab('0x28')]]={'$like':'%'+_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x39')]+'%'};return _0x3ba8c0;}})});}_0x5d4f4b=_[_0x85ab('0x3b')]({},_0x5d4f4b,_0x1f8845[_0x85ab('0x3c')]);var _0x37be34={'where':_0x5d4f4b[_0x85ab('0x37')]};return db[_0x85ab('0x2a')][_0x85ab('0x1c')](_0x37be34)[_0x85ab('0x24')](function(_0xebc470){_0x34ed29[_0x85ab('0x1c')]=_0xebc470;if(_0x1f8845[_0x85ab('0x2e')][_0x85ab('0x3d')]){_0x5d4f4b['include']=[{'all':!![]}];}return db[_0x85ab('0x2a')]['findAll'](_0x5d4f4b);})['then'](function(_0xbcddc7){_0x34ed29[_0x85ab('0x3e')]=_0xbcddc7;return _0x34ed29;})['then'](respondWithFilteredResult(_0xff87c,_0x5d4f4b))[_0x85ab('0x3f')](handleError(_0xff87c,null));};exports[_0x85ab('0x40')]=function(_0x1e18ea,_0x9d0373){var _0x43dca3={'raw':!![],'where':{'id':_0x1e18ea[_0x85ab('0x41')]['id']}},_0x29d6a5={};_0x29d6a5[_0x85ab('0x2d')]=_[_0x85ab('0x2f')](db[_0x85ab('0x2a')][_0x85ab('0x42')]);_0x29d6a5[_0x85ab('0x2e')]=_[_0x85ab('0x2f')](_0x1e18ea[_0x85ab('0x2e')]);_0x29d6a5[_0x85ab('0x30')]=_[_0x85ab('0x32')](_0x29d6a5[_0x85ab('0x2d')],_0x29d6a5['query']);_0x43dca3[_0x85ab('0x31')]=_[_0x85ab('0x32')](_0x29d6a5[_0x85ab('0x2d')],qs[_0x85ab('0x33')](_0x1e18ea[_0x85ab('0x2e')]['fields']));_0x43dca3[_0x85ab('0x31')]=_0x43dca3[_0x85ab('0x31')][_0x85ab('0x34')]?_0x43dca3['attributes']:_0x29d6a5[_0x85ab('0x2d')];if(_0x1e18ea[_0x85ab('0x2e')][_0x85ab('0x3d')]){_0x43dca3[_0x85ab('0x43')]=[{'all':!![]}];}_0x43dca3=_[_0x85ab('0x3b')]({},_0x43dca3,_0x1e18ea['options']);return db[_0x85ab('0x2a')]['find'](_0x43dca3)[_0x85ab('0x24')](handleEntityNotFound(_0x9d0373,null))[_0x85ab('0x24')](respondWithResult(_0x9d0373,null))['catch'](handleError(_0x9d0373,null));};exports[_0x85ab('0x44')]=function(_0x521ad4,_0x3b7424){return db['SquareReport'][_0x85ab('0x44')](_0x521ad4['body'],{})['then'](respondWithResult(_0x3b7424,0xc9))[_0x85ab('0x3f')](handleError(_0x3b7424,null));};exports[_0x85ab('0x45')]=function(_0xa7116e,_0x913fa1){if(_0xa7116e['body']['id']){delete _0xa7116e[_0x85ab('0x46')]['id'];}return db[_0x85ab('0x2a')]['find']({'where':{'id':_0xa7116e[_0x85ab('0x41')]['id']}})[_0x85ab('0x24')](handleEntityNotFound(_0x913fa1,null))[_0x85ab('0x24')](saveUpdates(_0xa7116e['body'],null))[_0x85ab('0x24')](respondWithResult(_0x913fa1,null))[_0x85ab('0x3f')](handleError(_0x913fa1,null));};exports['destroy']=function(_0x3a2663,_0x3a7401){return db['SquareReport'][_0x85ab('0x47')]({'where':{'id':_0x3a2663[_0x85ab('0x41')]['id']}})[_0x85ab('0x24')](handleEntityNotFound(_0x3a7401,null))[_0x85ab('0x24')](removeEntity(_0x3a7401,null))[_0x85ab('0x3f')](handleError(_0x3a7401,null));};exports[_0x85ab('0x48')]=function(_0x15ef52,_0x35b53d){return db[_0x85ab('0x2a')]['describe']()[_0x85ab('0x24')](respondWithResult(_0x35b53d,null))[_0x85ab('0x3f')](handleError(_0x35b53d,null));}; \ No newline at end of file +var _0x27e8=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','rows','catch','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x25e90f,_0x1ec0eb){var _0x294e14=function(_0x2c32af){while(--_0x2c32af){_0x25e90f['push'](_0x25e90f['shift']());}};_0x294e14(++_0x1ec0eb);}(_0x27e8,0x1ba));var _0x827e=function(_0x407afa,_0x500d19){_0x407afa=_0x407afa-0x0;var _0x463816=_0x27e8[_0x407afa];return _0x463816;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x827e('0x0'));var zipdir=require(_0x827e('0x1'));var jsonpatch=require(_0x827e('0x2'));var rp=require(_0x827e('0x3'));var moment=require('moment');var BPromise=require(_0x827e('0x4'));var Mustache=require(_0x827e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x827e('0x6'));var csv=require(_0x827e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x827e('0x8'));var _=require(_0x827e('0x9'));var squel=require('squel');var crypto=require(_0x827e('0xa'));var jsforce=require(_0x827e('0xb'));var deskjs=require(_0x827e('0xc'));var toCsv=require(_0x827e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x827e('0xd'));var authService=require(_0x827e('0xe'));var qs=require(_0x827e('0xf'));var as=require(_0x827e('0x10'));var hardwareService=require(_0x827e('0x11'));var logger=require(_0x827e('0x12'))(_0x827e('0x13'));var utils=require(_0x827e('0x14'));var config=require(_0x827e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x827e('0x16'))['db'];function respondWithStatusCode(_0x4ff4b2,_0x482033){_0x482033=_0x482033||0xcc;return function(_0x1de8f2){if(_0x1de8f2){return _0x4ff4b2[_0x827e('0x17')](_0x482033);}return _0x4ff4b2['status'](_0x482033)[_0x827e('0x18')]();};}function respondWithResult(_0x599ed5,_0x31e827){_0x31e827=_0x31e827||0xc8;return function(_0x32470e){if(_0x32470e){return _0x599ed5[_0x827e('0x19')](_0x31e827)[_0x827e('0x1a')](_0x32470e);}};}function respondWithFilteredResult(_0x37c7bc,_0x372e5d){return function(_0x1fcbfc){if(_0x1fcbfc){var _0x5358dc=typeof _0x372e5d[_0x827e('0x1b')]===_0x827e('0x1c')&&typeof _0x372e5d[_0x827e('0x1d')]===_0x827e('0x1c');var _0x2eac05=_0x1fcbfc[_0x827e('0x1e')];var _0x2735eb=_0x5358dc?0x0:_0x372e5d['offset'];var _0x30f7a8=_0x5358dc?_0x1fcbfc['count']:_0x372e5d[_0x827e('0x1b')]+_0x372e5d['limit'];var _0x476df0;if(_0x30f7a8>=_0x2eac05){_0x30f7a8=_0x2eac05;_0x476df0=0xc8;}else{_0x476df0=0xce;}_0x37c7bc[_0x827e('0x19')](_0x476df0);return _0x37c7bc['set']('Content-Range',_0x2735eb+'-'+_0x30f7a8+'/'+_0x2eac05)['json'](_0x1fcbfc);}return null;};}function patchUpdates(_0x365a97){return function(_0x35ef29){try{jsonpatch[_0x827e('0x1f')](_0x35ef29,_0x365a97,!![]);}catch(_0x481842){return BPromise[_0x827e('0x20')](_0x481842);}return _0x35ef29[_0x827e('0x21')]();};}function saveUpdates(_0x201202,_0x1d3adb){return function(_0x45d9a1){if(_0x45d9a1){return _0x45d9a1[_0x827e('0x22')](_0x201202)[_0x827e('0x23')](function(_0xdb0ab7){return _0xdb0ab7;});}return null;};}function removeEntity(_0x9b5a33,_0xa7d110){return function(_0x31943e){if(_0x31943e){return _0x31943e['destroy']()['then'](function(){_0x9b5a33[_0x827e('0x19')](0xcc)[_0x827e('0x18')]();});}};}function handleEntityNotFound(_0x575598,_0x547bac){return function(_0x427d6c){if(!_0x427d6c){_0x575598[_0x827e('0x17')](0x194);}return _0x427d6c;};}function handleError(_0x30d777,_0x28bb46){_0x28bb46=_0x28bb46||0x1f4;return function(_0x321714){logger['error'](_0x321714['stack']);if(_0x321714[_0x827e('0x24')]){delete _0x321714[_0x827e('0x24')];}_0x30d777[_0x827e('0x19')](_0x28bb46)[_0x827e('0x25')](_0x321714);};}exports['index']=function(_0x3ca20b,_0x555287){var _0x145940={},_0x1829ee={},_0x2339c2={'count':0x0,'rows':[]};var _0x31336d=_[_0x827e('0x26')](db['SquareReport'][_0x827e('0x27')],function(_0x4aea1a){return{'name':_0x4aea1a[_0x827e('0x28')],'type':_0x4aea1a['type'][_0x827e('0x29')]};});_0x1829ee[_0x827e('0x2a')]=_[_0x827e('0x26')](_0x31336d,_0x827e('0x24'));_0x1829ee[_0x827e('0x2b')]=_[_0x827e('0x2c')](_0x3ca20b[_0x827e('0x2b')]);_0x1829ee[_0x827e('0x2d')]=_[_0x827e('0x2e')](_0x1829ee['model'],_0x1829ee[_0x827e('0x2b')]);_0x145940[_0x827e('0x2f')]=_['intersection'](_0x1829ee['model'],qs['fields'](_0x3ca20b[_0x827e('0x2b')][_0x827e('0x30')]));_0x145940[_0x827e('0x2f')]=_0x145940[_0x827e('0x2f')][_0x827e('0x31')]?_0x145940[_0x827e('0x2f')]:_0x1829ee[_0x827e('0x2a')];if(!_0x3ca20b[_0x827e('0x2b')]['hasOwnProperty'](_0x827e('0x32'))){_0x145940[_0x827e('0x1d')]=qs['limit'](_0x3ca20b[_0x827e('0x2b')]['limit']);_0x145940['offset']=qs['offset'](_0x3ca20b[_0x827e('0x2b')][_0x827e('0x1b')]);}_0x145940[_0x827e('0x33')]=qs[_0x827e('0x34')](_0x3ca20b[_0x827e('0x2b')]['sort']);_0x145940[_0x827e('0x35')]=qs[_0x827e('0x2d')](_[_0x827e('0x36')](_0x3ca20b[_0x827e('0x2b')],_0x1829ee[_0x827e('0x2d')]),_0x31336d);if(_0x3ca20b[_0x827e('0x2b')][_0x827e('0x37')]){_0x145940[_0x827e('0x35')]=_[_0x827e('0x38')](_0x145940[_0x827e('0x35')],{'$or':_[_0x827e('0x26')](_0x31336d,function(_0x126112){if(_0x126112['type']!==_0x827e('0x39')){var _0x266de2={};_0x266de2[_0x126112[_0x827e('0x24')]]={'$like':'%'+_0x3ca20b['query'][_0x827e('0x37')]+'%'};return _0x266de2;}})});}_0x145940=_['merge']({},_0x145940,_0x3ca20b[_0x827e('0x3a')]);var _0x56680f={'where':_0x145940[_0x827e('0x35')]};return db[_0x827e('0x3b')][_0x827e('0x1e')](_0x56680f)['then'](function(_0x324655){_0x2339c2[_0x827e('0x1e')]=_0x324655;if(_0x3ca20b[_0x827e('0x2b')][_0x827e('0x3c')]){_0x145940[_0x827e('0x3d')]=[{'all':!![]}];}return db[_0x827e('0x3b')]['findAll'](_0x145940);})[_0x827e('0x23')](function(_0x22fe69){_0x2339c2[_0x827e('0x3e')]=_0x22fe69;return _0x2339c2;})[_0x827e('0x23')](respondWithFilteredResult(_0x555287,_0x145940))[_0x827e('0x3f')](handleError(_0x555287,null));};exports['show']=function(_0x56c4ab,_0x4204d4){var _0x2049ef={'raw':!![],'where':{'id':_0x56c4ab[_0x827e('0x40')]['id']}},_0xadc8cd={};_0xadc8cd[_0x827e('0x2a')]=_[_0x827e('0x2c')](db[_0x827e('0x3b')][_0x827e('0x27')]);_0xadc8cd[_0x827e('0x2b')]=_[_0x827e('0x2c')](_0x56c4ab[_0x827e('0x2b')]);_0xadc8cd[_0x827e('0x2d')]=_[_0x827e('0x2e')](_0xadc8cd[_0x827e('0x2a')],_0xadc8cd[_0x827e('0x2b')]);_0x2049ef[_0x827e('0x2f')]=_['intersection'](_0xadc8cd[_0x827e('0x2a')],qs[_0x827e('0x30')](_0x56c4ab[_0x827e('0x2b')]['fields']));_0x2049ef[_0x827e('0x2f')]=_0x2049ef[_0x827e('0x2f')][_0x827e('0x31')]?_0x2049ef[_0x827e('0x2f')]:_0xadc8cd['model'];if(_0x56c4ab[_0x827e('0x2b')][_0x827e('0x3c')]){_0x2049ef[_0x827e('0x3d')]=[{'all':!![]}];}_0x2049ef=_[_0x827e('0x38')]({},_0x2049ef,_0x56c4ab['options']);return db[_0x827e('0x3b')][_0x827e('0x41')](_0x2049ef)['then'](handleEntityNotFound(_0x4204d4,null))['then'](respondWithResult(_0x4204d4,null))[_0x827e('0x3f')](handleError(_0x4204d4,null));};exports[_0x827e('0x42')]=function(_0x186d27,_0x358239){return db[_0x827e('0x3b')][_0x827e('0x42')](_0x186d27[_0x827e('0x43')],{})['then'](respondWithResult(_0x358239,0xc9))[_0x827e('0x3f')](handleError(_0x358239,null));};exports[_0x827e('0x22')]=function(_0x1e6e7b,_0x4ab199){if(_0x1e6e7b['body']['id']){delete _0x1e6e7b[_0x827e('0x43')]['id'];}return db[_0x827e('0x3b')][_0x827e('0x41')]({'where':{'id':_0x1e6e7b[_0x827e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ab199,null))[_0x827e('0x23')](saveUpdates(_0x1e6e7b['body'],null))['then'](respondWithResult(_0x4ab199,null))[_0x827e('0x3f')](handleError(_0x4ab199,null));};exports[_0x827e('0x44')]=function(_0x512592,_0x2390b7){return db[_0x827e('0x3b')]['find']({'where':{'id':_0x512592[_0x827e('0x40')]['id']}})['then'](handleEntityNotFound(_0x2390b7,null))['then'](removeEntity(_0x2390b7,null))[_0x827e('0x3f')](handleError(_0x2390b7,null));};exports[_0x827e('0x45')]=function(_0x2aa8ac,_0x5c2198){return db['SquareReport'][_0x827e('0x45')]()[_0x827e('0x23')](respondWithResult(_0x5c2198,null))[_0x827e('0x3f')](handleError(_0x5c2198,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5eab496..1742514 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 _0xdecb=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define','uid_pname','uniqueid','project_name'];(function(_0x4aba57,_0x4affe8){var _0x1d8285=function(_0x321496){while(--_0x321496){_0x4aba57['push'](_0x4aba57['shift']());}};_0x1d8285(++_0x4affe8);}(_0xdecb,0x6a));var _0xbdec=function(_0x41b76d,_0x4a4755){_0x41b76d=_0x41b76d-0x0;var _0x2a4657=_0xdecb[_0x41b76d];return _0x2a4657;};'use strict';var _=require(_0xbdec('0x0'));var util=require(_0xbdec('0x1'));var logger=require(_0xbdec('0x2'))(_0xbdec('0x3'));var moment=require(_0xbdec('0x4'));var BPromise=require(_0xbdec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdec('0x6'));var rimraf=require(_0xbdec('0x7'));var config=require(_0xbdec('0x8'));var attributes=require(_0xbdec('0x9'));module['exports']=function(_0x540b97,_0x43c90c){return _0x540b97[_0xbdec('0xa')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xbdec('0xb'),'fields':[_0xbdec('0xc'),_0xbdec('0xd')]},{'name':_0xbdec('0xe'),'fields':[_0xbdec('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f8a=['leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square'];(function(_0x5c3c09,_0x2fab6f){var _0x407546=function(_0x551f70){while(--_0x551f70){_0x5c3c09['push'](_0x5c3c09['shift']());}};_0x407546(++_0x2fab6f);}(_0x2f8a,0x1c1));var _0xa2f8=function(_0x41dc93,_0x463aff){_0x41dc93=_0x41dc93-0x0;var _0x186a6b=_0x2f8a[_0x41dc93];return _0x186a6b;};'use strict';var _=require('lodash');var util=require(_0xa2f8('0x0'));var logger=require(_0xa2f8('0x1'))(_0xa2f8('0x2'));var moment=require(_0xa2f8('0x3'));var BPromise=require(_0xa2f8('0x4'));var rp=require(_0xa2f8('0x5'));var fs=require('fs');var path=require(_0xa2f8('0x6'));var rimraf=require(_0xa2f8('0x7'));var config=require(_0xa2f8('0x8'));var attributes=require(_0xa2f8('0x9'));module[_0xa2f8('0xa')]=function(_0x1bb8c1,_0xbb83b2){return _0x1bb8c1['define'](_0xa2f8('0xb'),attributes,{'tableName':_0xa2f8('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0xa2f8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 474f89d..e5abc0b 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 _0x3077=['error','code','message','result','catch','CreateSquareReport','create','options','raw','debug','UpdateSquareReport','SquareReport','update','body','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3077,0x15a));var _0x7307=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x3077[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x7307('0x0'));var util=require(_0x7307('0x1'));var moment=require('moment');var BPromise=require(_0x7307('0x2'));var rs=require(_0x7307('0x3'));var fs=require('fs');var Redis=require(_0x7307('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7307('0x5'));var logger=require(_0x7307('0x6'))('rpc');var config=require(_0x7307('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7307('0x8')][_0x7307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b4c24,_0x959cb5,_0x18ff4a){return new BPromise(function(_0x2ef0eb,_0x7fa9bc){return client[_0x7307('0xa')](_0x4b4c24,_0x18ff4a)[_0x7307('0xb')](function(_0x28180a){logger[_0x7307('0xc')](_0x7307('0xd'),_0x959cb5,_0x7307('0xe'));logger['debug'](_0x7307('0xf'),_0x959cb5,'request\x20sent',JSON[_0x7307('0x10')](_0x28180a));if(_0x28180a['error']){if(_0x28180a[_0x7307('0x11')][_0x7307('0x12')]===0x1f4){logger[_0x7307('0x11')](_0x7307('0xd'),_0x959cb5,_0x28180a[_0x7307('0x11')][_0x7307('0x13')]);return _0x7fa9bc(_0x28180a[_0x7307('0x11')][_0x7307('0x13')]);}logger[_0x7307('0x11')](_0x7307('0xd'),_0x959cb5,_0x28180a[_0x7307('0x11')]['message']);return _0x2ef0eb(_0x28180a[_0x7307('0x11')][_0x7307('0x13')]);}else{logger['info'](_0x7307('0xd'),_0x959cb5,_0x7307('0xe'));_0x2ef0eb(_0x28180a[_0x7307('0x14')][_0x7307('0x13')]);}})[_0x7307('0x15')](function(_0x161238){logger[_0x7307('0x11')](_0x7307('0xd'),_0x959cb5,_0x161238);_0x7fa9bc(_0x161238);});});}exports[_0x7307('0x16')]=function(_0x228a72){var _0x4f2654=this;return new Promise(function(_0x75ecd8,_0x350b7f){return db['SquareReport'][_0x7307('0x17')](_0x228a72['body'],{'raw':_0x228a72[_0x7307('0x18')]?_0x228a72[_0x7307('0x18')][_0x7307('0x19')]===undefined?!![]:![]:!![]})[_0x7307('0xb')](function(_0x56c8d9){logger['info'](_0x7307('0x16'),_0x228a72);logger[_0x7307('0x1a')]('CreateSquareReport',_0x228a72,JSON[_0x7307('0x10')](_0x56c8d9));_0x75ecd8(_0x56c8d9);})[_0x7307('0x15')](function(_0xd6983e){logger[_0x7307('0x11')](_0x7307('0x16'),_0xd6983e[_0x7307('0x13')],_0x228a72);_0x350b7f(_0x4f2654[_0x7307('0x11')](0x1f4,_0xd6983e[_0x7307('0x13')]));});});};exports[_0x7307('0x1b')]=function(_0x2a2bee){var _0x5190e3=this;return new Promise(function(_0x54a220,_0x174397){return db[_0x7307('0x1c')][_0x7307('0x1d')](_0x2a2bee[_0x7307('0x1e')],{'raw':_0x2a2bee[_0x7307('0x18')]?_0x2a2bee['options'][_0x7307('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a2bee['options']?_0x2a2bee['options'][_0x7307('0x1f')]||null:null,'attributes':_0x2a2bee[_0x7307('0x18')]?_0x2a2bee[_0x7307('0x18')]['attributes']||null:null,'limit':_0x2a2bee['options']?_0x2a2bee['options'][_0x7307('0x20')]||null:null})[_0x7307('0xb')](function(_0x1ff2f2){logger[_0x7307('0xc')](_0x7307('0x1b'),_0x2a2bee);logger[_0x7307('0x1a')]('UpdateSquareReport',_0x2a2bee,JSON[_0x7307('0x10')](_0x1ff2f2));_0x54a220(_0x1ff2f2);})[_0x7307('0x15')](function(_0x4ead99){logger['error'](_0x7307('0x1b'),_0x4ead99[_0x7307('0x13')],_0x2a2bee);_0x174397(_0x5190e3[_0x7307('0x11')](0x1f4,_0x4ead99[_0x7307('0x13')]));});});}; \ No newline at end of file +var _0x66f0=['UpdateSquareReport','SquareReport','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateSquareReport','body','options','raw'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x66f0,0x1a8));var _0x066f=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0x66f0[_0x19f5fc];return _0x315fa3;};'use strict';var _=require(_0x066f('0x0'));var util=require(_0x066f('0x1'));var moment=require(_0x066f('0x2'));var BPromise=require('bluebird');var rs=require(_0x066f('0x3'));var fs=require('fs');var Redis=require(_0x066f('0x4'));var db=require(_0x066f('0x5'))['db'];var utils=require(_0x066f('0x6'));var logger=require(_0x066f('0x7'))(_0x066f('0x8'));var config=require('../../config/environment');var jayson=require(_0x066f('0x9'));var client=jayson[_0x066f('0xa')][_0x066f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41a9a2,_0x1bd123,_0x3c7687){return new BPromise(function(_0x5dc547,_0x389492){return client[_0x066f('0xc')](_0x41a9a2,_0x3c7687)['then'](function(_0x233ff0){logger['info'](_0x066f('0xd'),_0x1bd123,_0x066f('0xe'));logger[_0x066f('0xf')](_0x066f('0x10'),_0x1bd123,_0x066f('0xe'),JSON[_0x066f('0x11')](_0x233ff0));if(_0x233ff0[_0x066f('0x12')]){if(_0x233ff0['error']['code']===0x1f4){logger[_0x066f('0x12')](_0x066f('0xd'),_0x1bd123,_0x233ff0[_0x066f('0x12')][_0x066f('0x13')]);return _0x389492(_0x233ff0[_0x066f('0x12')][_0x066f('0x13')]);}logger[_0x066f('0x12')](_0x066f('0xd'),_0x1bd123,_0x233ff0[_0x066f('0x12')][_0x066f('0x13')]);return _0x5dc547(_0x233ff0[_0x066f('0x12')][_0x066f('0x13')]);}else{logger[_0x066f('0x14')]('SquareReport,\x20%s,\x20%s',_0x1bd123,'request\x20sent');_0x5dc547(_0x233ff0['result']['message']);}})[_0x066f('0x15')](function(_0x1a0fd7){logger['error'](_0x066f('0xd'),_0x1bd123,_0x1a0fd7);_0x389492(_0x1a0fd7);});});}exports[_0x066f('0x16')]=function(_0x36fb2d){var _0x8f2ba1=this;return new Promise(function(_0x14377a,_0x9aa388){return db['SquareReport']['create'](_0x36fb2d[_0x066f('0x17')],{'raw':_0x36fb2d[_0x066f('0x18')]?_0x36fb2d[_0x066f('0x18')][_0x066f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2d7bd3){logger[_0x066f('0x14')](_0x066f('0x16'),_0x36fb2d);logger['debug'](_0x066f('0x16'),_0x36fb2d,JSON[_0x066f('0x11')](_0x2d7bd3));_0x14377a(_0x2d7bd3);})[_0x066f('0x15')](function(_0x2cdc81){logger['error'](_0x066f('0x16'),_0x2cdc81[_0x066f('0x13')],_0x36fb2d);_0x9aa388(_0x8f2ba1[_0x066f('0x12')](0x1f4,_0x2cdc81[_0x066f('0x13')]));});});};exports[_0x066f('0x1a')]=function(_0x5b91f5){var _0x27347b=this;return new Promise(function(_0x241d1c,_0x59c8b3){return db[_0x066f('0x1b')]['update'](_0x5b91f5[_0x066f('0x17')],{'raw':_0x5b91f5[_0x066f('0x18')]?_0x5b91f5[_0x066f('0x18')][_0x066f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b91f5['options']?_0x5b91f5[_0x066f('0x18')]['where']||null:null,'attributes':_0x5b91f5[_0x066f('0x18')]?_0x5b91f5[_0x066f('0x18')][_0x066f('0x1c')]||null:null,'limit':_0x5b91f5[_0x066f('0x18')]?_0x5b91f5[_0x066f('0x18')][_0x066f('0x1d')]||null:null})['then'](function(_0x2a6ac7){logger[_0x066f('0x14')]('UpdateSquareReport',_0x5b91f5);logger[_0x066f('0xf')]('UpdateSquareReport',_0x5b91f5,JSON[_0x066f('0x11')](_0x2a6ac7));_0x241d1c(_0x2a6ac7);})[_0x066f('0x15')](function(_0x335b86){logger[_0x066f('0x12')](_0x066f('0x1a'),_0x335b86[_0x066f('0x13')],_0x5b91f5);_0x59c8b3(_0x27347b[_0x066f('0x12')](0x1f4,_0x335b86[_0x066f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 824d1e2..b789bf2 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 _0x9fde=['post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe'];(function(_0xb645af,_0x3d10cb){var _0xf3ad17=function(_0xd9b483){while(--_0xd9b483){_0xb645af['push'](_0xb645af['shift']());}};_0xf3ad17(++_0x3d10cb);}(_0x9fde,0x1b8));var _0xe9fd=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x9fde[_0x3bb5b4];return _0x586c60;};'use strict';var multer=require('multer');var util=require(_0xe9fd('0x0'));var path=require(_0xe9fd('0x1'));var timeout=require('connect-timeout');var express=require(_0xe9fd('0x2'));var router=express[_0xe9fd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe9fd('0x4'));var interaction=require(_0xe9fd('0x5'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xe9fd('0x6')]('/',auth[_0xe9fd('0x7')](),controller['index']);router[_0xe9fd('0x6')](_0xe9fd('0x8'),auth[_0xe9fd('0x7')](),controller[_0xe9fd('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe9fd('0xa')]('/',auth[_0xe9fd('0x7')](),controller[_0xe9fd('0xb')]);router[_0xe9fd('0xc')](_0xe9fd('0xd'),auth[_0xe9fd('0x7')](),controller[_0xe9fd('0xe')]);router[_0xe9fd('0xf')]('/:id',auth[_0xe9fd('0x7')](),controller[_0xe9fd('0x10')]);module[_0xe9fd('0x11')]=router; \ No newline at end of file +var _0x3d4d=['/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','post','put'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x3d4d,0x121));var _0xd3d4=function(_0x4df69e,_0x5131d5){_0x4df69e=_0x4df69e-0x0;var _0x1f9041=_0x3d4d[_0x4df69e];return _0x1f9041;};'use strict';var multer=require(_0xd3d4('0x0'));var util=require(_0xd3d4('0x1'));var path=require(_0xd3d4('0x2'));var timeout=require(_0xd3d4('0x3'));var express=require(_0xd3d4('0x4'));var router=express[_0xd3d4('0x5')]();var fs_extra=require(_0xd3d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd3d4('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xd3d4('0x8')]('/',auth[_0xd3d4('0x9')](),controller['index']);router[_0xd3d4('0x8')](_0xd3d4('0xa'),auth[_0xd3d4('0x9')](),controller[_0xd3d4('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd3d4('0xc')]);router[_0xd3d4('0xd')]('/',auth[_0xd3d4('0x9')](),controller['create']);router[_0xd3d4('0xe')](_0xd3d4('0xf'),auth[_0xd3d4('0x9')](),controller[_0xd3d4('0x10')]);router[_0xd3d4('0x11')](_0xd3d4('0xf'),auth['isAuthenticated'](),controller[_0xd3d4('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index dfdf913..eb59216 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 _0xceb0=['STRING'];(function(_0x2d6c01,_0x1a66dd){var _0x706454=function(_0x4b6d93){while(--_0x4b6d93){_0x2d6c01['push'](_0x2d6c01['shift']());}};_0x706454(++_0x1a66dd);}(_0xceb0,0x173));var _0x0ceb=function(_0xe559b5,_0x5a6dc9){_0xe559b5=_0xe559b5-0x0;var _0xe92601=_0xceb0[_0xe559b5];return _0xe92601;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0ceb('0x0')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0ceb('0x0')]},'callerid':{'type':Sequelize[_0x0ceb('0x0')]}}; \ No newline at end of file +var _0x1603=['STRING','TEXT','sequelize','exports'];(function(_0x429de1,_0x5f3c6d){var _0xb1bea5=function(_0x21fd02){while(--_0x21fd02){_0x429de1['push'](_0x429de1['shift']());}};_0xb1bea5(++_0x5f3c6d);}(_0x1603,0x96));var _0x3160=function(_0x592c31,_0x528da9){_0x592c31=_0x592c31-0x0;var _0x44690b=_0x1603[_0x592c31];return _0x44690b;};'use strict';var Sequelize=require(_0x3160('0x0'));module[_0x3160('0x1')]={'uniqueid':{'type':Sequelize[_0x3160('0x2')]},'node':{'type':Sequelize[_0x3160('0x2')]},'application':{'type':Sequelize[_0x3160('0x2')]},'data':{'type':Sequelize[_0x3160('0x3')]},'project_name':{'type':Sequelize[_0x3160('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3b47f5e..148e169 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 _0xc258=['describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','body','catch'];(function(_0x326e49,_0x26f4c8){var _0x521a97=function(_0x4045f5){while(--_0x4045f5){_0x326e49['push'](_0x326e49['shift']());}};_0x521a97(++_0x26f4c8);}(_0xc258,0x173));var _0x8c25=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc258[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c25('0x0'));var jsonpatch=require(_0x8c25('0x1'));var rp=require(_0x8c25('0x2'));var moment=require(_0x8c25('0x3'));var BPromise=require(_0x8c25('0x4'));var Mustache=require('mustache');var util=require(_0x8c25('0x5'));var path=require(_0x8c25('0x6'));var sox=require('sox');var csv=require(_0x8c25('0x7'));var ejs=require(_0x8c25('0x8'));var fs=require('fs');var fs_extra=require(_0x8c25('0x9'));var _=require(_0x8c25('0xa'));var squel=require(_0x8c25('0xb'));var crypto=require('crypto');var jsforce=require(_0x8c25('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8c25('0x7'));var querystring=require(_0x8c25('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c25('0xe'));var qs=require(_0x8c25('0xf'));var as=require(_0x8c25('0x10'));var hardwareService=require(_0x8c25('0x11'));var logger=require('../../config/logger')(_0x8c25('0x12'));var utils=require(_0x8c25('0x13'));var config=require(_0x8c25('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c25('0x15'))['db'];function respondWithStatusCode(_0x3829a3,_0x254e6c){_0x254e6c=_0x254e6c||0xcc;return function(_0xddd6fd){if(_0xddd6fd){return _0x3829a3[_0x8c25('0x16')](_0x254e6c);}return _0x3829a3[_0x8c25('0x17')](_0x254e6c)['end']();};}function respondWithResult(_0x261920,_0x4d8b2b){_0x4d8b2b=_0x4d8b2b||0xc8;return function(_0x2ab716){if(_0x2ab716){return _0x261920[_0x8c25('0x17')](_0x4d8b2b)['json'](_0x2ab716);}};}function respondWithFilteredResult(_0x4211e3,_0x46480d){return function(_0xa5ba50){if(_0xa5ba50){var _0x1e5ad8=typeof _0x46480d[_0x8c25('0x18')]===_0x8c25('0x19')&&typeof _0x46480d['limit']==='undefined';var _0x5d78ca=_0xa5ba50[_0x8c25('0x1a')];var _0x573973=_0x1e5ad8?0x0:_0x46480d['offset'];var _0x4d680f=_0x1e5ad8?_0xa5ba50[_0x8c25('0x1a')]:_0x46480d['offset']+_0x46480d[_0x8c25('0x1b')];var _0xc54a8e;if(_0x4d680f>=_0x5d78ca){_0x4d680f=_0x5d78ca;_0xc54a8e=0xc8;}else{_0xc54a8e=0xce;}_0x4211e3['status'](_0xc54a8e);return _0x4211e3[_0x8c25('0x1c')](_0x8c25('0x1d'),_0x573973+'-'+_0x4d680f+'/'+_0x5d78ca)[_0x8c25('0x1e')](_0xa5ba50);}return null;};}function patchUpdates(_0x4f6d96){return function(_0x4ef670){try{jsonpatch[_0x8c25('0x1f')](_0x4ef670,_0x4f6d96,!![]);}catch(_0x335b78){return BPromise[_0x8c25('0x20')](_0x335b78);}return _0x4ef670[_0x8c25('0x21')]();};}function saveUpdates(_0x1409aa,_0x452cd5){return function(_0x3c4f95){if(_0x3c4f95){return _0x3c4f95[_0x8c25('0x22')](_0x1409aa)[_0x8c25('0x23')](function(_0x1abfd4){return _0x1abfd4;});}return null;};}function removeEntity(_0x136eda,_0x4e3055){return function(_0x301a73){if(_0x301a73){return _0x301a73[_0x8c25('0x24')]()['then'](function(){_0x136eda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fb5c1,_0x168c6f){return function(_0x4ff49b){if(!_0x4ff49b){_0x2fb5c1[_0x8c25('0x16')](0x194);}return _0x4ff49b;};}function handleError(_0x5ec20e,_0x5b605e){_0x5b605e=_0x5b605e||0x1f4;return function(_0x11af96){logger[_0x8c25('0x25')](_0x11af96[_0x8c25('0x26')]);if(_0x11af96[_0x8c25('0x27')]){delete _0x11af96[_0x8c25('0x27')];}_0x5ec20e[_0x8c25('0x17')](_0x5b605e)[_0x8c25('0x28')](_0x11af96);};}exports[_0x8c25('0x29')]=function(_0xb92463,_0x23b4da){var _0x50d1f3={},_0x172b36={},_0x351728={'count':0x0,'rows':[]};var _0x311928=_[_0x8c25('0x2a')](db[_0x8c25('0x2b')][_0x8c25('0x2c')],function(_0x129def){return{'name':_0x129def[_0x8c25('0x2d')],'type':_0x129def[_0x8c25('0x2e')][_0x8c25('0x2f')]};});_0x172b36[_0x8c25('0x30')]=_[_0x8c25('0x2a')](_0x311928,'name');_0x172b36[_0x8c25('0x31')]=_[_0x8c25('0x32')](_0xb92463[_0x8c25('0x31')]);_0x172b36[_0x8c25('0x33')]=_[_0x8c25('0x34')](_0x172b36[_0x8c25('0x30')],_0x172b36[_0x8c25('0x31')]);_0x50d1f3[_0x8c25('0x35')]=_[_0x8c25('0x34')](_0x172b36[_0x8c25('0x30')],qs[_0x8c25('0x36')](_0xb92463['query'][_0x8c25('0x36')]));_0x50d1f3[_0x8c25('0x35')]=_0x50d1f3[_0x8c25('0x35')][_0x8c25('0x37')]?_0x50d1f3[_0x8c25('0x35')]:_0x172b36[_0x8c25('0x30')];if(!_0xb92463[_0x8c25('0x31')]['hasOwnProperty'](_0x8c25('0x38'))){_0x50d1f3[_0x8c25('0x1b')]=qs[_0x8c25('0x1b')](_0xb92463[_0x8c25('0x31')][_0x8c25('0x1b')]);_0x50d1f3[_0x8c25('0x18')]=qs[_0x8c25('0x18')](_0xb92463[_0x8c25('0x31')][_0x8c25('0x18')]);}_0x50d1f3[_0x8c25('0x39')]=qs['sort'](_0xb92463[_0x8c25('0x31')][_0x8c25('0x3a')]);_0x50d1f3[_0x8c25('0x3b')]=qs['filters'](_[_0x8c25('0x3c')](_0xb92463[_0x8c25('0x31')],_0x172b36[_0x8c25('0x33')]),_0x311928);if(_0xb92463[_0x8c25('0x31')][_0x8c25('0x3d')]){_0x50d1f3[_0x8c25('0x3b')]=_[_0x8c25('0x3e')](_0x50d1f3['where'],{'$or':_[_0x8c25('0x2a')](_0x311928,function(_0x2b9c64){if(_0x2b9c64[_0x8c25('0x2e')]!==_0x8c25('0x3f')){var _0x43ea03={};_0x43ea03[_0x2b9c64[_0x8c25('0x27')]]={'$like':'%'+_0xb92463[_0x8c25('0x31')][_0x8c25('0x3d')]+'%'};return _0x43ea03;}})});}_0x50d1f3=_[_0x8c25('0x3e')]({},_0x50d1f3,_0xb92463[_0x8c25('0x40')]);var _0x488960={'where':_0x50d1f3[_0x8c25('0x3b')]};return db[_0x8c25('0x2b')][_0x8c25('0x1a')](_0x488960)[_0x8c25('0x23')](function(_0x1cfe4b){_0x351728[_0x8c25('0x1a')]=_0x1cfe4b;if(_0xb92463[_0x8c25('0x31')][_0x8c25('0x41')]){_0x50d1f3['include']=[{'all':!![]}];}return db[_0x8c25('0x2b')][_0x8c25('0x42')](_0x50d1f3);})['then'](function(_0xbbecfc){_0x351728[_0x8c25('0x43')]=_0xbbecfc;return _0x351728;})['then'](respondWithFilteredResult(_0x23b4da,_0x50d1f3))['catch'](handleError(_0x23b4da,null));};exports[_0x8c25('0x44')]=function(_0x40ed76,_0x3e5c67){var _0x9507d5={'raw':!![],'where':{'id':_0x40ed76[_0x8c25('0x45')]['id']}},_0x9406c={};_0x9406c[_0x8c25('0x30')]=_['keys'](db[_0x8c25('0x2b')][_0x8c25('0x2c')]);_0x9406c['query']=_['keys'](_0x40ed76['query']);_0x9406c[_0x8c25('0x33')]=_[_0x8c25('0x34')](_0x9406c[_0x8c25('0x30')],_0x9406c['query']);_0x9507d5[_0x8c25('0x35')]=_[_0x8c25('0x34')](_0x9406c[_0x8c25('0x30')],qs[_0x8c25('0x36')](_0x40ed76[_0x8c25('0x31')][_0x8c25('0x36')]));_0x9507d5[_0x8c25('0x35')]=_0x9507d5[_0x8c25('0x35')][_0x8c25('0x37')]?_0x9507d5[_0x8c25('0x35')]:_0x9406c[_0x8c25('0x30')];if(_0x40ed76[_0x8c25('0x31')][_0x8c25('0x41')]){_0x9507d5['include']=[{'all':!![]}];}_0x9507d5=_[_0x8c25('0x3e')]({},_0x9507d5,_0x40ed76[_0x8c25('0x40')]);return db[_0x8c25('0x2b')][_0x8c25('0x46')](_0x9507d5)[_0x8c25('0x23')](handleEntityNotFound(_0x3e5c67,null))['then'](respondWithResult(_0x3e5c67,null))['catch'](handleError(_0x3e5c67,null));};exports['create']=function(_0x39d5b8,_0xc9892e){return db[_0x8c25('0x2b')]['create'](_0x39d5b8[_0x8c25('0x47')],{})[_0x8c25('0x23')](respondWithResult(_0xc9892e,0xc9))[_0x8c25('0x48')](handleError(_0xc9892e,null));};exports[_0x8c25('0x22')]=function(_0x2b1c81,_0x41683f){if(_0x2b1c81[_0x8c25('0x47')]['id']){delete _0x2b1c81[_0x8c25('0x47')]['id'];}return db['SquareDetailsReport'][_0x8c25('0x46')]({'where':{'id':_0x2b1c81['params']['id']}})[_0x8c25('0x23')](handleEntityNotFound(_0x41683f,null))[_0x8c25('0x23')](saveUpdates(_0x2b1c81[_0x8c25('0x47')],null))[_0x8c25('0x23')](respondWithResult(_0x41683f,null))[_0x8c25('0x48')](handleError(_0x41683f,null));};exports['destroy']=function(_0x2862a6,_0x2f1a0b){return db[_0x8c25('0x2b')][_0x8c25('0x46')]({'where':{'id':_0x2862a6['params']['id']}})[_0x8c25('0x23')](handleEntityNotFound(_0x2f1a0b,null))[_0x8c25('0x23')](removeEntity(_0x2f1a0b,null))[_0x8c25('0x48')](handleError(_0x2f1a0b,null));};exports[_0x8c25('0x49')]=function(_0x2a417f,_0x26f38f){return db[_0x8c25('0x2b')][_0x8c25('0x49')]()['then'](respondWithResult(_0x26f38f,null))[_0x8c25('0x48')](handleError(_0x26f38f,null));}; \ No newline at end of file +var _0x5421=['sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5523ab,_0x331ff7){var _0x2eed31=function(_0x3f0217){while(--_0x3f0217){_0x5523ab['push'](_0x5523ab['shift']());}};_0x2eed31(++_0x331ff7);}(_0x5421,0x1cf));var _0x1542=function(_0x1bc6af,_0x4fbcc4){_0x1bc6af=_0x1bc6af-0x0;var _0x35e765=_0x5421[_0x1bc6af];return _0x35e765;};'use strict';var emlformat=require(_0x1542('0x0'));var rimraf=require(_0x1542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1542('0x2'));var rp=require(_0x1542('0x3'));var moment=require(_0x1542('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1542('0x5'));var util=require(_0x1542('0x6'));var path=require('path');var sox=require(_0x1542('0x7'));var csv=require(_0x1542('0x8'));var ejs=require(_0x1542('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1542('0xa'));var jsforce=require(_0x1542('0xb'));var deskjs=require(_0x1542('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1542('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1542('0xe'))(_0x1542('0xf'));var utils=require(_0x1542('0x10'));var config=require(_0x1542('0x11'));var licenseUtil=require(_0x1542('0x12'));var db=require(_0x1542('0x13'))['db'];function respondWithStatusCode(_0x497931,_0x4d5314){_0x4d5314=_0x4d5314||0xcc;return function(_0x34cf23){if(_0x34cf23){return _0x497931[_0x1542('0x14')](_0x4d5314);}return _0x497931['status'](_0x4d5314)[_0x1542('0x15')]();};}function respondWithResult(_0x1c891b,_0x5b5713){_0x5b5713=_0x5b5713||0xc8;return function(_0x3da223){if(_0x3da223){return _0x1c891b[_0x1542('0x16')](_0x5b5713)[_0x1542('0x17')](_0x3da223);}};}function respondWithFilteredResult(_0x2ca432,_0x54faac){return function(_0x219309){if(_0x219309){var _0x4793d9=typeof _0x54faac['offset']===_0x1542('0x18')&&typeof _0x54faac[_0x1542('0x19')]==='undefined';var _0x4b7c0d=_0x219309[_0x1542('0x1a')];var _0x564885=_0x4793d9?0x0:_0x54faac[_0x1542('0x1b')];var _0x4d8a7a=_0x4793d9?_0x219309[_0x1542('0x1a')]:_0x54faac[_0x1542('0x1b')]+_0x54faac[_0x1542('0x19')];var _0x178852;if(_0x4d8a7a>=_0x4b7c0d){_0x4d8a7a=_0x4b7c0d;_0x178852=0xc8;}else{_0x178852=0xce;}_0x2ca432[_0x1542('0x16')](_0x178852);return _0x2ca432[_0x1542('0x1c')](_0x1542('0x1d'),_0x564885+'-'+_0x4d8a7a+'/'+_0x4b7c0d)[_0x1542('0x17')](_0x219309);}return null;};}function patchUpdates(_0x59eda2){return function(_0x9af9e7){try{jsonpatch[_0x1542('0x1e')](_0x9af9e7,_0x59eda2,!![]);}catch(_0x5a4a23){return BPromise['reject'](_0x5a4a23);}return _0x9af9e7['save']();};}function saveUpdates(_0x5b32ec,_0x4ef277){return function(_0x51cde3){if(_0x51cde3){return _0x51cde3[_0x1542('0x1f')](_0x5b32ec)['then'](function(_0x5e5b24){return _0x5e5b24;});}return null;};}function removeEntity(_0x5e181d,_0x2c429e){return function(_0xf7048a){if(_0xf7048a){return _0xf7048a[_0x1542('0x20')]()[_0x1542('0x21')](function(){_0x5e181d[_0x1542('0x16')](0xcc)[_0x1542('0x15')]();});}};}function handleEntityNotFound(_0x4a2040,_0x374e1f){return function(_0x4679fc){if(!_0x4679fc){_0x4a2040['sendStatus'](0x194);}return _0x4679fc;};}function handleError(_0x1ed642,_0x4fd797){_0x4fd797=_0x4fd797||0x1f4;return function(_0x38559e){logger[_0x1542('0x22')](_0x38559e[_0x1542('0x23')]);if(_0x38559e[_0x1542('0x24')]){delete _0x38559e[_0x1542('0x24')];}_0x1ed642[_0x1542('0x16')](_0x4fd797)[_0x1542('0x25')](_0x38559e);};}exports[_0x1542('0x26')]=function(_0x41a041,_0x5a711a){var _0x2dfa18={},_0x11e632={},_0x54a64d={'count':0x0,'rows':[]};var _0x4eb3d5=_['map'](db[_0x1542('0x27')][_0x1542('0x28')],function(_0x418da){return{'name':_0x418da[_0x1542('0x29')],'type':_0x418da['type'][_0x1542('0x2a')]};});_0x11e632[_0x1542('0x2b')]=_[_0x1542('0x2c')](_0x4eb3d5,_0x1542('0x24'));_0x11e632['query']=_[_0x1542('0x2d')](_0x41a041[_0x1542('0x2e')]);_0x11e632[_0x1542('0x2f')]=_['intersection'](_0x11e632['model'],_0x11e632['query']);_0x2dfa18[_0x1542('0x30')]=_[_0x1542('0x31')](_0x11e632['model'],qs[_0x1542('0x32')](_0x41a041[_0x1542('0x2e')]['fields']));_0x2dfa18[_0x1542('0x30')]=_0x2dfa18[_0x1542('0x30')][_0x1542('0x33')]?_0x2dfa18[_0x1542('0x30')]:_0x11e632['model'];if(!_0x41a041[_0x1542('0x2e')][_0x1542('0x34')](_0x1542('0x35'))){_0x2dfa18['limit']=qs['limit'](_0x41a041[_0x1542('0x2e')][_0x1542('0x19')]);_0x2dfa18[_0x1542('0x1b')]=qs[_0x1542('0x1b')](_0x41a041[_0x1542('0x2e')][_0x1542('0x1b')]);}_0x2dfa18[_0x1542('0x36')]=qs[_0x1542('0x37')](_0x41a041[_0x1542('0x2e')][_0x1542('0x37')]);_0x2dfa18['where']=qs[_0x1542('0x2f')](_[_0x1542('0x38')](_0x41a041['query'],_0x11e632[_0x1542('0x2f')]),_0x4eb3d5);if(_0x41a041[_0x1542('0x2e')][_0x1542('0x39')]){_0x2dfa18[_0x1542('0x3a')]=_[_0x1542('0x3b')](_0x2dfa18[_0x1542('0x3a')],{'$or':_['map'](_0x4eb3d5,function(_0x1f14d0){if(_0x1f14d0[_0x1542('0x3c')]!==_0x1542('0x3d')){var _0x2a627a={};_0x2a627a[_0x1f14d0[_0x1542('0x24')]]={'$like':'%'+_0x41a041[_0x1542('0x2e')][_0x1542('0x39')]+'%'};return _0x2a627a;}})});}_0x2dfa18=_[_0x1542('0x3b')]({},_0x2dfa18,_0x41a041['options']);var _0xa0051b={'where':_0x2dfa18['where']};return db['SquareDetailsReport'][_0x1542('0x1a')](_0xa0051b)[_0x1542('0x21')](function(_0x411119){_0x54a64d[_0x1542('0x1a')]=_0x411119;if(_0x41a041[_0x1542('0x2e')][_0x1542('0x3e')]){_0x2dfa18[_0x1542('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x1542('0x40')](_0x2dfa18);})[_0x1542('0x21')](function(_0x3db0a6){_0x54a64d[_0x1542('0x41')]=_0x3db0a6;return _0x54a64d;})['then'](respondWithFilteredResult(_0x5a711a,_0x2dfa18))['catch'](handleError(_0x5a711a,null));};exports[_0x1542('0x42')]=function(_0x246dfe,_0x2f6fa3){var _0x9dce09={'raw':!![],'where':{'id':_0x246dfe[_0x1542('0x43')]['id']}},_0x5bfe93={};_0x5bfe93[_0x1542('0x2b')]=_[_0x1542('0x2d')](db[_0x1542('0x27')]['rawAttributes']);_0x5bfe93['query']=_['keys'](_0x246dfe['query']);_0x5bfe93[_0x1542('0x2f')]=_['intersection'](_0x5bfe93[_0x1542('0x2b')],_0x5bfe93['query']);_0x9dce09[_0x1542('0x30')]=_[_0x1542('0x31')](_0x5bfe93['model'],qs[_0x1542('0x32')](_0x246dfe[_0x1542('0x2e')][_0x1542('0x32')]));_0x9dce09[_0x1542('0x30')]=_0x9dce09[_0x1542('0x30')][_0x1542('0x33')]?_0x9dce09[_0x1542('0x30')]:_0x5bfe93['model'];if(_0x246dfe[_0x1542('0x2e')]['includeAll']){_0x9dce09[_0x1542('0x3f')]=[{'all':!![]}];}_0x9dce09=_[_0x1542('0x3b')]({},_0x9dce09,_0x246dfe[_0x1542('0x44')]);return db[_0x1542('0x27')][_0x1542('0x45')](_0x9dce09)['then'](handleEntityNotFound(_0x2f6fa3,null))[_0x1542('0x21')](respondWithResult(_0x2f6fa3,null))['catch'](handleError(_0x2f6fa3,null));};exports[_0x1542('0x46')]=function(_0x36971e,_0x3aa7a9){return db[_0x1542('0x27')]['create'](_0x36971e['body'],{})['then'](respondWithResult(_0x3aa7a9,0xc9))[_0x1542('0x47')](handleError(_0x3aa7a9,null));};exports[_0x1542('0x1f')]=function(_0x143c00,_0x30966a){if(_0x143c00['body']['id']){delete _0x143c00[_0x1542('0x48')]['id'];}return db['SquareDetailsReport'][_0x1542('0x45')]({'where':{'id':_0x143c00[_0x1542('0x43')]['id']}})[_0x1542('0x21')](handleEntityNotFound(_0x30966a,null))[_0x1542('0x21')](saveUpdates(_0x143c00[_0x1542('0x48')],null))[_0x1542('0x21')](respondWithResult(_0x30966a,null))[_0x1542('0x47')](handleError(_0x30966a,null));};exports[_0x1542('0x20')]=function(_0x182c6d,_0xc0e18f){return db[_0x1542('0x27')][_0x1542('0x45')]({'where':{'id':_0x182c6d['params']['id']}})['then'](handleEntityNotFound(_0xc0e18f,null))['then'](removeEntity(_0xc0e18f,null))['catch'](handleError(_0xc0e18f,null));};exports['describe']=function(_0x3fab56,_0x1ba736){return db['SquareDetailsReport'][_0x1542('0x49')]()[_0x1542('0x21')](respondWithResult(_0x1ba736,null))['catch'](handleError(_0x1ba736,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 4248f37..b936960 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 _0x7441=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7441,0x19a));var _0x1744=function(_0x213203,_0x11a304){_0x213203=_0x213203-0x0;var _0x117051=_0x7441[_0x213203];return _0x117051;};'use strict';var _=require(_0x1744('0x0'));var util=require(_0x1744('0x1'));var logger=require(_0x1744('0x2'))(_0x1744('0x3'));var moment=require('moment');var BPromise=require(_0x1744('0x4'));var rp=require(_0x1744('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1744('0x6'));var config=require(_0x1744('0x7'));var attributes=require(_0x1744('0x8'));module[_0x1744('0x9')]=function(_0x2314fd,_0x48d936){return _0x2314fd[_0x1744('0xa')](_0x1744('0xb'),attributes,{'tableName':_0x1744('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4ad=['exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes'];(function(_0x29b635,_0xca3da1){var _0x32f59e=function(_0x5d0b0c){while(--_0x5d0b0c){_0x29b635['push'](_0x29b635['shift']());}};_0x32f59e(++_0xca3da1);}(_0xa4ad,0x70));var _0xda4a=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0xa4ad[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0xda4a('0x0'));var util=require(_0xda4a('0x1'));var logger=require(_0xda4a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xda4a('0x3'));var rp=require(_0xda4a('0x4'));var fs=require('fs');var path=require(_0xda4a('0x5'));var rimraf=require('rimraf');var config=require(_0xda4a('0x6'));var attributes=require(_0xda4a('0x7'));module[_0xda4a('0x8')]=function(_0x523447,_0x2c617c){return _0x523447[_0xda4a('0x9')](_0xda4a('0xa'),attributes,{'tableName':_0xda4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index b367143..ca3e64b 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 _0xc901=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch','lodash','ioredis'];(function(_0x404b62,_0xbb4734){var _0x33a774=function(_0x239751){while(--_0x239751){_0x404b62['push'](_0x404b62['shift']());}};_0x33a774(++_0xbb4734);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'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});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}exports[_0x1c90('0x13')]=function(_0x4ec354){var _0x582246=this;return new Promise(function(_0x128bf0,_0x5dd488){return db[_0x1c90('0x14')][_0x1c90('0x15')](_0x4ec354[_0x1c90('0x16')],{'raw':_0x4ec354[_0x1c90('0x17')]?_0x4ec354['options'][_0x1c90('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x525997){logger[_0x1c90('0xb')](_0x1c90('0x13'),_0x4ec354);logger['debug'](_0x1c90('0x13'),_0x4ec354,JSON[_0x1c90('0x19')](_0x525997));_0x128bf0(_0x525997);})[_0x1c90('0x1a')](function(_0x4074fd){logger[_0x1c90('0x10')](_0x1c90('0x13'),_0x4074fd['message'],_0x4ec354);_0x5dd488(_0x582246[_0x1c90('0x10')](0x1f4,_0x4074fd[_0x1c90('0x12')]));});});}; \ No newline at end of file +var _0x1eba=['SquareDetailsReport','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport'];(function(_0x16e465,_0x44d73b){var _0x128d6e=function(_0x5a21aa){while(--_0x5a21aa){_0x16e465['push'](_0x16e465['shift']());}};_0x128d6e(++_0x44d73b);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x1eba[_0x4e4519];return _0x340044;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bfbb0,_0x39a5a3,_0x7d2982){return new BPromise(function(_0x2aebb6,_0x9d7113){return client['request'](_0x2bfbb0,_0x7d2982)[_0xa1eb('0xc')](function(_0x4d4aaf){logger[_0xa1eb('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x39a5a3,_0xa1eb('0xe'));logger['debug'](_0xa1eb('0xf'),_0x39a5a3,'request\x20sent',JSON[_0xa1eb('0x10')](_0x4d4aaf));if(_0x4d4aaf[_0xa1eb('0x11')]){if(_0x4d4aaf[_0xa1eb('0x11')]['code']===0x1f4){logger[_0xa1eb('0x11')](_0xa1eb('0x12'),_0x39a5a3,_0x4d4aaf['error'][_0xa1eb('0x13')]);return _0x9d7113(_0x4d4aaf['error']['message']);}logger[_0xa1eb('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x39a5a3,_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);return _0x2aebb6(_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);}else{logger[_0xa1eb('0xd')](_0xa1eb('0x12'),_0x39a5a3,_0xa1eb('0xe'));_0x2aebb6(_0x4d4aaf[_0xa1eb('0x14')][_0xa1eb('0x13')]);}})['catch'](function(_0xbd6a6b){logger['error'](_0xa1eb('0x12'),_0x39a5a3,_0xbd6a6b);_0x9d7113(_0xbd6a6b);});});}exports[_0xa1eb('0x15')]=function(_0x33c4e3){var _0x1a5d2c=this;return new Promise(function(_0x49bfaa,_0x1dd621){return db[_0xa1eb('0x16')][_0xa1eb('0x17')](_0x33c4e3[_0xa1eb('0x18')],{'raw':_0x33c4e3[_0xa1eb('0x19')]?_0x33c4e3[_0xa1eb('0x19')][_0xa1eb('0x1a')]===undefined?!![]:![]:!![]})[_0xa1eb('0xc')](function(_0x4fc14a){logger[_0xa1eb('0xd')]('CreateSquareDetailsReport',_0x33c4e3);logger[_0xa1eb('0x1b')](_0xa1eb('0x15'),_0x33c4e3,JSON[_0xa1eb('0x10')](_0x4fc14a));_0x49bfaa(_0x4fc14a);})[_0xa1eb('0x1c')](function(_0x5e7a34){logger['error'](_0xa1eb('0x15'),_0x5e7a34[_0xa1eb('0x13')],_0x33c4e3);_0x1dd621(_0x1a5d2c['error'](0x1f4,_0x5e7a34[_0xa1eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index cec68c7..866e2b1 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 _0xf1ba=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0xf1ba,0xf0));var _0xaf1b=function(_0x3f4c28,_0x40fb8f){_0x3f4c28=_0x3f4c28-0x0;var _0x4f46ca=_0xf1ba[_0x3f4c28];return _0x4f46ca;};'use strict';var express=require(_0xaf1b('0x0'));var router=express[_0xaf1b('0x1')]();var auth=require(_0xaf1b('0x2'));var controller=require(_0xaf1b('0x3'));router[_0xaf1b('0x4')]('/',auth[_0xaf1b('0x5')](),controller['index']);router[_0xaf1b('0x4')](_0xaf1b('0x6'),auth['isAuthenticated'](),controller[_0xaf1b('0x7')]);module[_0xaf1b('0x8')]=router; \ No newline at end of file +var _0x873e=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','../../components/auth/service','./system.controller','index','get'];(function(_0x209880,_0x49c6fe){var _0x16b27d=function(_0x7e8df0){while(--_0x7e8df0){_0x209880['push'](_0x209880['shift']());}};_0x16b27d(++_0x49c6fe);}(_0x873e,0x1ea));var _0xe873=function(_0x1c3814,_0x38ea53){_0x1c3814=_0x1c3814-0x0;var _0x3b002e=_0x873e[_0x1c3814];return _0x3b002e;};'use strict';var express=require(_0xe873('0x0'));var router=express['Router']();var auth=require(_0xe873('0x1'));var controller=require(_0xe873('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0xe873('0x3')]);router[_0xe873('0x4')](_0xe873('0x5'),auth[_0xe873('0x6')](),controller[_0xe873('0x7')]);module[_0xe873('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3beabcf..acb1ca3 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 _0x0539=['bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','index','getAllData','then','json','catch','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','util'];(function(_0x17f145,_0x3422bb){var _0x2d5420=function(_0x3eb38b){while(--_0x3eb38b){_0x17f145['push'](_0x17f145['shift']());}};_0x2d5420(++_0x3422bb);}(_0x0539,0x167));var _0x9053=function(_0x1d64ca,_0x33ef2a){_0x1d64ca=_0x1d64ca-0x0;var _0x14e41c=_0x0539[_0x1d64ca];return _0x14e41c;};'use strict';var info=require('systeminformation');var exec=require(_0x9053('0x0'))[_0x9053('0x1')];var logger=require(_0x9053('0x2'))(_0x9053('0x3'));var util=require(_0x9053('0x4'));var BPromise=require(_0x9053('0x5'));var _=require(_0x9053('0x6'));function handleError(_0x343fb3,_0x2d82b8,_0x1fb383){_0x2d82b8=_0x2d82b8||0x1f4;return function(_0x1a44e1){logger['error'](_0x9053('0x7'),_0x1fb383,_0x2d82b8,util[_0x9053('0x8')](_0x1a44e1,{'showHidden':![],'depth':null}));delete _0x1a44e1['name'];_0x343fb3['status'](_0x2d82b8)['send'](_0x1a44e1);};}exports[_0x9053('0x9')]=function(_0x1b78b2,_0x4f5823){return info[_0x9053('0xa')]()[_0x9053('0xb')](function(_0x18005a){return _0x4f5823['status'](0xc8)[_0x9053('0xc')](_0x18005a);})[_0x9053('0xd')](function(_0x46fc2a){return _0x4f5823[_0x9053('0xe')](0x1f4)['json'](_0x46fc2a);});};exports[_0x9053('0xf')]=function(_0x4ad2b3,_0xd32b9a){var _0x1d6e46=[_0x9053('0x10')];return new BPromise(function(_0x5df978,_0x775c72){return exec(util[_0x9053('0x11')](_0x9053('0x12'),_0x4ad2b3[_0x9053('0x13')][_0x9053('0x14')]),function(_0x2be589,_0x1809ed,_0x2ca49f){if(_0x2be589){return _0x775c72(_0x2be589);}return _0x5df978(_0x1809ed);});})[_0x9053('0xb')](function(_0x187cd8){var _0x1f9c40=![];var _0x4d234=_0x187cd8[_0x9053('0x15')](/\n/);for(var _0x21e4d7=0x0,_0x4837b5=_0x1d6e46[_0x9053('0x16')];_0x21e4d7<_0x4837b5,_0x1f9c40===![];_0x21e4d7+=0x1){if(_0x187cd8[_0x9053('0x17')](_0x1d6e46[_0x21e4d7])>=0x0){_0x1f9c40=!![];}}if(!_0x1f9c40){throw new Error(util[_0x9053('0x11')](_0x9053('0x18'),_0x4ad2b3['params']['pid']));}process[_0x9053('0x19')](_0x4ad2b3['params']['pid'],_0x9053('0x1a'));return _0xd32b9a[_0x9053('0xe')](0xc8)[_0x9053('0xc')]({'message':util[_0x9053('0x11')](_0x9053('0x1b'),_0x4ad2b3[_0x9053('0x13')][_0x9053('0x14')])});})['catch'](handleError(_0xd32b9a,null,_0x9053('0xf')));}; \ No newline at end of file +var _0xb3e1=['send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','inspect','status'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0xb3e1,0x1b5));var _0x1b3e=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xb3e1[_0x234ae1];return _0x227ba0;};'use strict';var info=require(_0x1b3e('0x0'));var exec=require(_0x1b3e('0x1'))[_0x1b3e('0x2')];var logger=require(_0x1b3e('0x3'))(_0x1b3e('0x4'));var util=require(_0x1b3e('0x5'));var BPromise=require(_0x1b3e('0x6'));var _=require(_0x1b3e('0x7'));function handleError(_0x170db4,_0x261a62,_0x415faf){_0x261a62=_0x261a62||0x1f4;return function(_0xe61676){logger[_0x1b3e('0x8')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x415faf,_0x261a62,util[_0x1b3e('0x9')](_0xe61676,{'showHidden':![],'depth':null}));delete _0xe61676['name'];_0x170db4[_0x1b3e('0xa')](_0x261a62)[_0x1b3e('0xb')](_0xe61676);};}exports[_0x1b3e('0xc')]=function(_0x4b5565,_0x3f2f28){return info[_0x1b3e('0xd')]()[_0x1b3e('0xe')](function(_0x509209){return _0x3f2f28[_0x1b3e('0xa')](0xc8)[_0x1b3e('0xf')](_0x509209);})[_0x1b3e('0x10')](function(_0x19d617){return _0x3f2f28[_0x1b3e('0xa')](0x1f4)['json'](_0x19d617);});};exports['killProcess']=function(_0x32c8b3,_0x524116){var _0x3880da=[_0x1b3e('0x11')];return new BPromise(function(_0x24b605,_0x49768f){return exec(util[_0x1b3e('0x12')](_0x1b3e('0x13'),_0x32c8b3[_0x1b3e('0x14')][_0x1b3e('0x15')]),function(_0x54097f,_0x42b855,_0xafddfa){if(_0x54097f){return _0x49768f(_0x54097f);}return _0x24b605(_0x42b855);});})[_0x1b3e('0xe')](function(_0x527c28){var _0x2ab1d7=![];var _0x1d3a90=_0x527c28[_0x1b3e('0x16')](/\n/);for(var _0x540aef=0x0,_0x5e1dee=_0x3880da[_0x1b3e('0x17')];_0x540aef<_0x5e1dee,_0x2ab1d7===![];_0x540aef+=0x1){if(_0x527c28['indexOf'](_0x3880da[_0x540aef])>=0x0){_0x2ab1d7=!![];}}if(!_0x2ab1d7){throw new Error(util[_0x1b3e('0x12')](_0x1b3e('0x18'),_0x32c8b3[_0x1b3e('0x14')][_0x1b3e('0x15')]));}process[_0x1b3e('0x19')](_0x32c8b3[_0x1b3e('0x14')][_0x1b3e('0x15')],_0x1b3e('0x1a'));return _0x524116[_0x1b3e('0xa')](0xc8)['json']({'message':util[_0x1b3e('0x12')](_0x1b3e('0x1b'),_0x32c8b3[_0x1b3e('0x14')][_0x1b3e('0x15')])});})[_0x1b3e('0x10')](handleError(_0x524116,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 9d7afec..f06bfb8 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 _0xb876=['util','path','connect-timeout','Router','../../components/auth/service','./tag.controller','index','get','show','post','create','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x4ece3b,_0x26c642){var _0x176a4c=function(_0x2d1f0d){while(--_0x2d1f0d){_0x4ece3b['push'](_0x4ece3b['shift']());}};_0x176a4c(++_0x26c642);}(_0xb876,0xb4));var _0x6b87=function(_0x52c67e,_0x3c237a){_0x52c67e=_0x52c67e-0x0;var _0x3f68dc=_0xb876[_0x52c67e];return _0x3f68dc;};'use strict';var multer=require('multer');var util=require(_0x6b87('0x0'));var path=require(_0x6b87('0x1'));var timeout=require(_0x6b87('0x2'));var express=require('express');var router=express[_0x6b87('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6b87('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b87('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b87('0x6')]);router[_0x6b87('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6b87('0x8')]);router[_0x6b87('0x9')]('/',auth['isAuthenticated'](),controller[_0x6b87('0xa')]);router[_0x6b87('0xb')](_0x6b87('0xc'),auth[_0x6b87('0xd')](),controller[_0x6b87('0xe')]);router[_0x6b87('0xf')](_0x6b87('0xc'),auth[_0x6b87('0xd')](),controller[_0x6b87('0x10')]);module[_0x6b87('0x11')]=router; \ No newline at end of file +var _0x4ef7=['show','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id'];(function(_0x583e0d,_0x4c0f0d){var _0x496345=function(_0xc39d1f){while(--_0xc39d1f){_0x583e0d['push'](_0x583e0d['shift']());}};_0x496345(++_0x4c0f0d);}(_0x4ef7,0x1c7));var _0x74ef=function(_0x3bdfdb,_0x5eb9b6){_0x3bdfdb=_0x3bdfdb-0x0;var _0x534a63=_0x4ef7[_0x3bdfdb];return _0x534a63;};'use strict';var multer=require(_0x74ef('0x0'));var util=require(_0x74ef('0x1'));var path=require('path');var timeout=require(_0x74ef('0x2'));var express=require(_0x74ef('0x3'));var router=express[_0x74ef('0x4')]();var fs_extra=require(_0x74ef('0x5'));var auth=require(_0x74ef('0x6'));var interaction=require(_0x74ef('0x7'));var config=require(_0x74ef('0x8'));var controller=require(_0x74ef('0x9'));router[_0x74ef('0xa')]('/',auth[_0x74ef('0xb')](),controller['index']);router[_0x74ef('0xa')](_0x74ef('0xc'),auth['isAuthenticated'](),controller[_0x74ef('0xd')]);router['post']('/',auth[_0x74ef('0xb')](),controller[_0x74ef('0xe')]);router[_0x74ef('0xf')]('/:id',auth[_0x74ef('0xb')](),controller[_0x74ef('0x10')]);router['delete'](_0x74ef('0xc'),auth['isAuthenticated'](),controller[_0x74ef('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1a866b3..8d51258 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 _0xb7aa=['name','#0091EA','sequelize','exports','STRING'];(function(_0x47de66,_0xfc1685){var _0x295b17=function(_0x4c39f8){while(--_0x4c39f8){_0x47de66['push'](_0x47de66['shift']());}};_0x295b17(++_0xfc1685);}(_0xb7aa,0x11a));var _0xab7a=function(_0xdbfea3,_0x36fcd8){_0xdbfea3=_0xdbfea3-0x0;var _0x3777d3=_0xb7aa[_0xdbfea3];return _0x3777d3;};'use strict';var Sequelize=require(_0xab7a('0x0'));module[_0xab7a('0x1')]={'name':{'type':Sequelize[_0xab7a('0x2')],'unique':_0xab7a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xab7a('0x2')],'defaultValue':_0xab7a('0x4')},'description':{'type':Sequelize[_0xab7a('0x2')]}}; \ No newline at end of file +var _0x180d=['#0091EA','exports','STRING','name'];(function(_0x4ed19b,_0x4c0380){var _0x22fb0e=function(_0x25410d){while(--_0x25410d){_0x4ed19b['push'](_0x4ed19b['shift']());}};_0x22fb0e(++_0x4c0380);}(_0x180d,0xf9));var _0xd180=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x180d[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require('sequelize');module[_0xd180('0x0')]={'name':{'type':Sequelize[_0xd180('0x1')],'unique':_0xd180('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd180('0x1')],'defaultValue':_0xd180('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 9f9c063..69e8aa5 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 _0xadb8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','Tag','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','params','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0xe32bc8,_0x44287e){var _0x1ff259=function(_0x4706d6){while(--_0x4706d6){_0xe32bc8['push'](_0xe32bc8['shift']());}};_0x1ff259(++_0x44287e);}(_0xadb8,0x1d0));var _0x8adb=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0xadb8[_0x2b85d5];return _0xe8c96f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8adb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8adb('0x1'));var moment=require(_0x8adb('0x2'));var BPromise=require(_0x8adb('0x3'));var Mustache=require(_0x8adb('0x4'));var util=require(_0x8adb('0x5'));var path=require(_0x8adb('0x6'));var sox=require(_0x8adb('0x7'));var csv=require('to-csv');var ejs=require(_0x8adb('0x8'));var fs=require('fs');var fs_extra=require(_0x8adb('0x9'));var _=require(_0x8adb('0xa'));var squel=require(_0x8adb('0xb'));var crypto=require(_0x8adb('0xc'));var jsforce=require(_0x8adb('0xd'));var deskjs=require(_0x8adb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8adb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8adb('0x10'));var logger=require(_0x8adb('0x11'))(_0x8adb('0x12'));var utils=require(_0x8adb('0x13'));var config=require(_0x8adb('0x14'));var licenseUtil=require(_0x8adb('0x15'));var db=require(_0x8adb('0x16'))['db'];function respondWithStatusCode(_0x2828f1,_0x2d6b55){_0x2d6b55=_0x2d6b55||0xcc;return function(_0x8c6c39){if(_0x8c6c39){return _0x2828f1['sendStatus'](_0x2d6b55);}return _0x2828f1['status'](_0x2d6b55)['end']();};}function respondWithResult(_0x122b37,_0x4ff3c3){_0x4ff3c3=_0x4ff3c3||0xc8;return function(_0xe9280c){if(_0xe9280c){return _0x122b37[_0x8adb('0x17')](_0x4ff3c3)[_0x8adb('0x18')](_0xe9280c);}};}function respondWithFilteredResult(_0x52e1d9,_0x20add0){return function(_0x117054){if(_0x117054){var _0x1096fb=typeof _0x20add0[_0x8adb('0x19')]===_0x8adb('0x1a')&&typeof _0x20add0[_0x8adb('0x1b')]==='undefined';var _0xc01052=_0x117054[_0x8adb('0x1c')];var _0x4ba298=_0x1096fb?0x0:_0x20add0['offset'];var _0x18897e=_0x1096fb?_0x117054[_0x8adb('0x1c')]:_0x20add0[_0x8adb('0x19')]+_0x20add0[_0x8adb('0x1b')];var _0x46bce0;if(_0x18897e>=_0xc01052){_0x18897e=_0xc01052;_0x46bce0=0xc8;}else{_0x46bce0=0xce;}_0x52e1d9[_0x8adb('0x17')](_0x46bce0);return _0x52e1d9[_0x8adb('0x1d')](_0x8adb('0x1e'),_0x4ba298+'-'+_0x18897e+'/'+_0xc01052)[_0x8adb('0x18')](_0x117054);}return null;};}function patchUpdates(_0x2a322d){return function(_0x36c62a){try{jsonpatch[_0x8adb('0x1f')](_0x36c62a,_0x2a322d,!![]);}catch(_0x4a1a84){return BPromise['reject'](_0x4a1a84);}return _0x36c62a[_0x8adb('0x20')]();};}function saveUpdates(_0x3d37db,_0x4f33e7){return function(_0x37b0a4){if(_0x37b0a4){return _0x37b0a4[_0x8adb('0x21')](_0x3d37db)[_0x8adb('0x22')](function(_0x184c2a){return _0x184c2a;});}return null;};}function removeEntity(_0x11c2e8,_0x28d5cd){return function(_0x542156){if(_0x542156){return _0x542156[_0x8adb('0x23')]()[_0x8adb('0x22')](function(){var _0x234ef2=_0x542156['get']({'plain':!![]});var _0x5c8c18=_0x8adb('0x24');return db[_0x8adb('0x25')][_0x8adb('0x23')]({'where':{'type':_0x5c8c18,'resourceId':_0x234ef2['id']}})[_0x8adb('0x22')](function(){return _0x542156;});})[_0x8adb('0x22')](function(){_0x11c2e8['status'](0xcc)[_0x8adb('0x26')]();});}};}function handleEntityNotFound(_0x16f724,_0x18f94e){return function(_0x44f242){if(!_0x44f242){_0x16f724[_0x8adb('0x27')](0x194);}return _0x44f242;};}function handleError(_0x4aca77,_0x3faee9){_0x3faee9=_0x3faee9||0x1f4;return function(_0x5c5a7b){logger[_0x8adb('0x28')](_0x5c5a7b[_0x8adb('0x29')]);if(_0x5c5a7b[_0x8adb('0x2a')]){delete _0x5c5a7b[_0x8adb('0x2a')];}_0x4aca77['status'](_0x3faee9)[_0x8adb('0x2b')](_0x5c5a7b);};}exports['index']=function(_0x2c582b,_0x1ac23e){var _0x12f552={},_0x13a887={},_0x56f8a4={'count':0x0,'rows':[]};var _0x279cd8=_['map'](db[_0x8adb('0x2c')]['rawAttributes'],function(_0x1d4962){return{'name':_0x1d4962[_0x8adb('0x2d')],'type':_0x1d4962[_0x8adb('0x2e')][_0x8adb('0x2f')]};});_0x13a887[_0x8adb('0x30')]=_[_0x8adb('0x31')](_0x279cd8,'name');_0x13a887['query']=_[_0x8adb('0x32')](_0x2c582b[_0x8adb('0x33')]);_0x13a887[_0x8adb('0x34')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],_0x13a887[_0x8adb('0x33')]);_0x12f552[_0x8adb('0x36')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x37')]));_0x12f552[_0x8adb('0x36')]=_0x12f552['attributes'][_0x8adb('0x38')]?_0x12f552[_0x8adb('0x36')]:_0x13a887['model'];if(!_0x2c582b[_0x8adb('0x33')]['hasOwnProperty'](_0x8adb('0x39'))){_0x12f552[_0x8adb('0x1b')]=qs[_0x8adb('0x1b')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x1b')]);_0x12f552['offset']=qs[_0x8adb('0x19')](_0x2c582b['query'][_0x8adb('0x19')]);}_0x12f552[_0x8adb('0x3a')]=qs['sort'](_0x2c582b[_0x8adb('0x33')]['sort']);_0x12f552[_0x8adb('0x3b')]=qs['filters'](_[_0x8adb('0x3c')](_0x2c582b[_0x8adb('0x33')],_0x13a887[_0x8adb('0x34')]),_0x279cd8);if(_0x2c582b['query']['filter']){_0x12f552[_0x8adb('0x3b')]=_[_0x8adb('0x3d')](_0x12f552['where'],{'$or':_[_0x8adb('0x31')](_0x279cd8,function(_0x13589b){if(_0x13589b[_0x8adb('0x2e')]!==_0x8adb('0x3e')){var _0x922b58={};_0x922b58[_0x13589b[_0x8adb('0x2a')]]={'$like':'%'+_0x2c582b[_0x8adb('0x33')][_0x8adb('0x3f')]+'%'};return _0x922b58;}})});}_0x12f552=_['merge']({},_0x12f552,_0x2c582b['options']);var _0x3f69b3={'where':_0x12f552[_0x8adb('0x3b')]};return db[_0x8adb('0x2c')][_0x8adb('0x1c')](_0x3f69b3)['then'](function(_0x29d16d){_0x56f8a4['count']=_0x29d16d;if(_0x2c582b[_0x8adb('0x33')][_0x8adb('0x40')]){_0x12f552[_0x8adb('0x41')]=[{'all':!![]}];}return db[_0x8adb('0x2c')]['findAll'](_0x12f552);})['then'](function(_0x213c23){_0x56f8a4['rows']=_0x213c23;return _0x56f8a4;})[_0x8adb('0x22')](respondWithFilteredResult(_0x1ac23e,_0x12f552))['catch'](handleError(_0x1ac23e,null));};exports['show']=function(_0x18984a,_0x24feeb){var _0x5061d9={'raw':!![],'where':{'id':_0x18984a[_0x8adb('0x42')]['id']}},_0x3fb9e0={};_0x3fb9e0[_0x8adb('0x30')]=_[_0x8adb('0x32')](db[_0x8adb('0x2c')]['rawAttributes']);_0x3fb9e0[_0x8adb('0x33')]=_['keys'](_0x18984a[_0x8adb('0x33')]);_0x3fb9e0[_0x8adb('0x34')]=_['intersection'](_0x3fb9e0['model'],_0x3fb9e0[_0x8adb('0x33')]);_0x5061d9['attributes']=_[_0x8adb('0x35')](_0x3fb9e0[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x18984a[_0x8adb('0x33')]['fields']));_0x5061d9[_0x8adb('0x36')]=_0x5061d9[_0x8adb('0x36')]['length']?_0x5061d9['attributes']:_0x3fb9e0[_0x8adb('0x30')];if(_0x18984a[_0x8adb('0x33')][_0x8adb('0x40')]){_0x5061d9['include']=[{'all':!![]}];}_0x5061d9=_[_0x8adb('0x3d')]({},_0x5061d9,_0x18984a[_0x8adb('0x43')]);return db[_0x8adb('0x2c')][_0x8adb('0x44')](_0x5061d9)[_0x8adb('0x22')](handleEntityNotFound(_0x24feeb,null))[_0x8adb('0x22')](respondWithResult(_0x24feeb,null))[_0x8adb('0x45')](handleError(_0x24feeb,null));};exports[_0x8adb('0x46')]=function(_0xc2861b,_0xe725e9){return db[_0x8adb('0x2c')][_0x8adb('0x46')](_0xc2861b['body'],{})[_0x8adb('0x22')](function(_0x33c28c){var _0x35ef9d=_0xc2861b[_0x8adb('0x47')][_0x8adb('0x48')]({'plain':!![]});if(!_0x35ef9d)throw new Error(_0x8adb('0x49'));if(_0x35ef9d[_0x8adb('0x4a')]===_0x8adb('0x47')){var _0x276af8=_0x33c28c[_0x8adb('0x48')]({'plain':!![]});var _0x52daa7=_0x8adb('0x24');return db[_0x8adb('0x4b')][_0x8adb('0x44')]({'where':{'name':_0x52daa7,'userProfileId':_0x35ef9d[_0x8adb('0x4c')]},'raw':!![]})[_0x8adb('0x22')](function(_0x12b242){if(_0x12b242&&_0x12b242[_0x8adb('0x4d')]===0x0){return db[_0x8adb('0x25')]['create']({'name':_0x276af8[_0x8adb('0x2a')],'resourceId':_0x276af8['id'],'type':_0x12b242[_0x8adb('0x2a')],'sectionId':_0x12b242['id']},{})[_0x8adb('0x22')](function(){return _0x33c28c;});}else{return _0x33c28c;}})[_0x8adb('0x45')](function(_0x4bba0e){logger[_0x8adb('0x28')](_0x8adb('0x4e'),_0x4bba0e);throw _0x4bba0e;});}return _0x33c28c;})[_0x8adb('0x22')](respondWithResult(_0xe725e9,0xc9))[_0x8adb('0x45')](handleError(_0xe725e9,null));};exports['update']=function(_0x415dc0,_0x34eb4d){if(_0x415dc0[_0x8adb('0x4f')]['id']){delete _0x415dc0[_0x8adb('0x4f')]['id'];}return db[_0x8adb('0x2c')][_0x8adb('0x44')]({'where':{'id':_0x415dc0[_0x8adb('0x42')]['id']}})[_0x8adb('0x22')](handleEntityNotFound(_0x34eb4d,null))[_0x8adb('0x22')](saveUpdates(_0x415dc0[_0x8adb('0x4f')],null))[_0x8adb('0x22')](respondWithResult(_0x34eb4d,null))[_0x8adb('0x45')](handleError(_0x34eb4d,null));};exports['destroy']=function(_0x4329b0,_0x492a60){return db['Tag'][_0x8adb('0x44')]({'where':{'id':_0x4329b0[_0x8adb('0x42')]['id']}})['then'](handleEntityNotFound(_0x492a60,null))[_0x8adb('0x22')](removeEntity(_0x492a60,null))[_0x8adb('0x45')](handleError(_0x492a60,null));}; \ No newline at end of file +var _0x6f7a=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','Tags','destroy','then','sendStatus','error','stack','name','send','index','Tag','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2441aa,_0x23dd5a){var _0x5da4e4=function(_0x3a1faf){while(--_0x3a1faf){_0x2441aa['push'](_0x2441aa['shift']());}};_0x5da4e4(++_0x23dd5a);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x12597c,_0x3127f7){_0x12597c=_0x12597c-0x0;var _0x176ee6=_0x6f7a[_0x12597c];return _0x176ee6;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){var _0x2f4907=_0x28263e['get']({'plain':!![]});var _0x47ef97=_0xa6f7('0x23');return db['UserProfileResource'][_0xa6f7('0x24')]({'where':{'type':_0x47ef97,'resourceId':_0x2f4907['id']}})[_0xa6f7('0x25')](function(){return _0x28263e;});})[_0xa6f7('0x25')](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)[_0xa6f7('0x1a')]();});}};}function handleEntityNotFound(_0x4b8d2b,_0x51db47){return function(_0x1c419b){if(!_0x1c419b){_0x4b8d2b[_0xa6f7('0x26')](0x194);}return _0x1c419b;};}function handleError(_0x55d45a,_0x267917){_0x267917=_0x267917||0x1f4;return function(_0x27babb){logger[_0xa6f7('0x27')](_0x27babb[_0xa6f7('0x28')]);if(_0x27babb[_0xa6f7('0x29')]){delete _0x27babb[_0xa6f7('0x29')];}_0x55d45a[_0xa6f7('0x19')](_0x267917)[_0xa6f7('0x2a')](_0x27babb);};}exports[_0xa6f7('0x2b')]=function(_0x3dee2e,_0x40b0f8){var _0x278bad={},_0x52f9c1={},_0x442ccf={'count':0x0,'rows':[]};var _0x42dc49=_['map'](db[_0xa6f7('0x2c')][_0xa6f7('0x2d')],function(_0x4d79d8){return{'name':_0x4d79d8['fieldName'],'type':_0x4d79d8[_0xa6f7('0x2e')][_0xa6f7('0x2f')]};});_0x52f9c1[_0xa6f7('0x30')]=_[_0xa6f7('0x31')](_0x42dc49,_0xa6f7('0x29'));_0x52f9c1['query']=_['keys'](_0x3dee2e[_0xa6f7('0x32')]);_0x52f9c1['filters']=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],_0x52f9c1[_0xa6f7('0x32')]);_0x278bad[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],qs['fields'](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x35')]));_0x278bad[_0xa6f7('0x34')]=_0x278bad['attributes'][_0xa6f7('0x36')]?_0x278bad['attributes']:_0x52f9c1[_0xa6f7('0x30')];if(!_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x37')]('nolimit')){_0x278bad[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x1d')]);_0x278bad[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x3dee2e['query'][_0xa6f7('0x1e')]);}_0x278bad[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x278bad[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x3dee2e['query'],_0x52f9c1[_0xa6f7('0x3b')]),_0x42dc49);if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x278bad['where']=_[_0xa6f7('0x3e')](_0x278bad[_0xa6f7('0x3a')],{'$or':_['map'](_0x42dc49,function(_0x39349a){if(_0x39349a[_0xa6f7('0x2e')]!==_0xa6f7('0x3f')){var _0x14d532={};_0x14d532[_0x39349a[_0xa6f7('0x29')]]={'$like':'%'+_0x3dee2e['query'][_0xa6f7('0x3d')]+'%'};return _0x14d532;}})});}_0x278bad=_[_0xa6f7('0x3e')]({},_0x278bad,_0x3dee2e[_0xa6f7('0x40')]);var _0x1b8bf3={'where':_0x278bad[_0xa6f7('0x3a')]};return db[_0xa6f7('0x2c')][_0xa6f7('0x1f')](_0x1b8bf3)[_0xa6f7('0x25')](function(_0x5646b9){_0x442ccf['count']=_0x5646b9;if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x41')]){_0x278bad[_0xa6f7('0x42')]=[{'all':!![]}];}return db[_0xa6f7('0x2c')][_0xa6f7('0x43')](_0x278bad);})[_0xa6f7('0x25')](function(_0x21fdd7){_0x442ccf[_0xa6f7('0x44')]=_0x21fdd7;return _0x442ccf;})[_0xa6f7('0x25')](respondWithFilteredResult(_0x40b0f8,_0x278bad))[_0xa6f7('0x45')](handleError(_0x40b0f8,null));};exports['show']=function(_0x41917c,_0x30be3b){var _0x4d5846={'raw':!![],'where':{'id':_0x41917c[_0xa6f7('0x46')]['id']}},_0x22d500={};_0x22d500[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db['Tag'][_0xa6f7('0x2d')]);_0x22d500['query']=_['keys'](_0x41917c[_0xa6f7('0x32')]);_0x22d500[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x22d500[_0xa6f7('0x30')],_0x22d500[_0xa6f7('0x32')]);_0x4d5846[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x22d500['model'],qs[_0xa6f7('0x35')](_0x41917c[_0xa6f7('0x32')]['fields']));_0x4d5846[_0xa6f7('0x34')]=_0x4d5846[_0xa6f7('0x34')][_0xa6f7('0x36')]?_0x4d5846['attributes']:_0x22d500[_0xa6f7('0x30')];if(_0x41917c['query'][_0xa6f7('0x41')]){_0x4d5846[_0xa6f7('0x42')]=[{'all':!![]}];}_0x4d5846=_[_0xa6f7('0x3e')]({},_0x4d5846,_0x41917c['options']);return db['Tag'][_0xa6f7('0x48')](_0x4d5846)['then'](handleEntityNotFound(_0x30be3b,null))[_0xa6f7('0x25')](respondWithResult(_0x30be3b,null))['catch'](handleError(_0x30be3b,null));};exports['create']=function(_0x1e7089,_0x2e3a04){return db[_0xa6f7('0x2c')][_0xa6f7('0x49')](_0x1e7089[_0xa6f7('0x4a')],{})[_0xa6f7('0x25')](function(_0x5d9b6f){var _0x4032fc=_0x1e7089[_0xa6f7('0x4b')]['get']({'plain':!![]});if(!_0x4032fc)throw new Error(_0xa6f7('0x4c'));if(_0x4032fc['role']===_0xa6f7('0x4b')){var _0x59091a=_0x5d9b6f['get']({'plain':!![]});var _0x60eacc=_0xa6f7('0x23');return db[_0xa6f7('0x4d')][_0xa6f7('0x48')]({'where':{'name':_0x60eacc,'userProfileId':_0x4032fc[_0xa6f7('0x4e')]},'raw':!![]})['then'](function(_0x340d3f){if(_0x340d3f&&_0x340d3f[_0xa6f7('0x4f')]===0x0){return db['UserProfileResource'][_0xa6f7('0x49')]({'name':_0x59091a['name'],'resourceId':_0x59091a['id'],'type':_0x340d3f[_0xa6f7('0x29')],'sectionId':_0x340d3f['id']},{})[_0xa6f7('0x25')](function(){return _0x5d9b6f;});}else{return _0x5d9b6f;}})[_0xa6f7('0x45')](function(_0x55369a){logger[_0xa6f7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55369a);throw _0x55369a;});}return _0x5d9b6f;})[_0xa6f7('0x25')](respondWithResult(_0x2e3a04,0xc9))[_0xa6f7('0x45')](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x50')]=function(_0x1dcb45,_0xa6bff9){if(_0x1dcb45['body']['id']){delete _0x1dcb45['body']['id'];}return db[_0xa6f7('0x2c')][_0xa6f7('0x48')]({'where':{'id':_0x1dcb45[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0xa6bff9,null))['then'](saveUpdates(_0x1dcb45[_0xa6f7('0x4a')],null))[_0xa6f7('0x25')](respondWithResult(_0xa6bff9,null))[_0xa6f7('0x45')](handleError(_0xa6bff9,null));};exports[_0xa6f7('0x24')]=function(_0x1b33a5,_0x39538e){return db['Tag'][_0xa6f7('0x48')]({'where':{'id':_0x1b33a5[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x39538e,null))['then'](removeEntity(_0x39538e,null))[_0xa6f7('0x45')](handleError(_0x39538e,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0b646cf..84411b7 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 _0x5efc=['bluebird','request-promise','path','rimraf','./tag.attributes','exports','Tag','tools_tags','api','moment'];(function(_0x1eb3f6,_0x3f8dc7){var _0x511f68=function(_0x33d351){while(--_0x33d351){_0x1eb3f6['push'](_0x1eb3f6['shift']());}};_0x511f68(++_0x3f8dc7);}(_0x5efc,0x184));var _0xc5ef=function(_0x2e16b5,_0x8d9512){_0x2e16b5=_0x2e16b5-0x0;var _0x4bd305=_0x5efc[_0x2e16b5];return _0x4bd305;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc5ef('0x0'));var moment=require(_0xc5ef('0x1'));var BPromise=require(_0xc5ef('0x2'));var rp=require(_0xc5ef('0x3'));var fs=require('fs');var path=require(_0xc5ef('0x4'));var rimraf=require(_0xc5ef('0x5'));var config=require('../../config/environment');var attributes=require(_0xc5ef('0x6'));module[_0xc5ef('0x7')]=function(_0x5757f8,_0x4470c6){return _0x5757f8['define'](_0xc5ef('0x8'),attributes,{'tableName':_0xc5ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfff0=['./tag.attributes','exports','Tag','tools_tags','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1aecdc,_0x522a27){var _0xef638b=function(_0x1d5c91){while(--_0x1d5c91){_0x1aecdc['push'](_0x1aecdc['shift']());}};_0xef638b(++_0x522a27);}(_0xfff0,0xeb));var _0x0fff=function(_0x4628aa,_0x4324e9){_0x4628aa=_0x4628aa-0x0;var _0x4d3fde=_0xfff0[_0x4628aa];return _0x4d3fde;};'use strict';var _=require(_0x0fff('0x0'));var util=require(_0x0fff('0x1'));var logger=require('../../config/logger')(_0x0fff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fff('0x3'));var fs=require('fs');var path=require(_0x0fff('0x4'));var rimraf=require(_0x0fff('0x5'));var config=require(_0x0fff('0x6'));var attributes=require(_0x0fff('0x7'));module[_0x0fff('0x8')]=function(_0x5c04c3,_0x561c68){return _0x5c04c3['define'](_0x0fff('0x9'),attributes,{'tableName':_0x0fff('0xa'),'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 1b666de..a2f218c 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 _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x2922da,_0xc4f951){var _0x4e08db=function(_0x499a79){while(--_0x499a79){_0x2922da['push'](_0x2922da['shift']());}};_0x4e08db(++_0xc4f951);}(_0x207c,0x1e8));var _0xc207=function(_0x2806f6,_0x294105){_0x2806f6=_0x2806f6-0x0;var _0x32ebb1=_0x207c[_0x2806f6];return _0x32ebb1;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('Tag,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('Tag,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});} \ No newline at end of file +var _0xf72b=['../../config/environment','jayson/promise','client','request','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x31637d,_0x5116df){var _0x265eda=function(_0x1cedb7){while(--_0x1cedb7){_0x31637d['push'](_0x31637d['shift']());}};_0x265eda(++_0x5116df);}(_0xf72b,0x1d9));var _0xbf72=function(_0x3ac71c,_0x4c67ac){_0x3ac71c=_0x3ac71c-0x0;var _0xdd9303=_0xf72b[_0x3ac71c];return _0xdd9303;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index aa6a45f..ebc4063 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_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/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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 18e87c5..c0155ed 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0xc4effa,_0x562121){var _0xe1d89b=function(_0x19e4f5){while(--_0x19e4f5){_0xc4effa['push'](_0xc4effa['shift']());}};_0xe1d89b(++_0x562121);}(_0x2032,0xd9));var _0x2203=function(_0x564b05,_0x2371f1){_0x564b05=_0x564b05-0x0;var _0x58b7af=_0x2032[_0x564b05];return _0x58b7af;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0xc8b6dc,_0xb3893d){var _0x26abc6=function(_0x5dbf3f){while(--_0x5dbf3f){_0xc8b6dc['push'](_0xc8b6dc['shift']());}};_0x26abc6(++_0xb3893d);}(_0xb10b,0x12a));var _0xbb10=function(_0x26462e,_0x416ff7){_0x26462e=_0x26462e-0x0;var _0x31c3f0=_0xb10b[_0x26462e];return _0x31c3f0;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4a7a810..43db5a5 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 _0x0a36=['UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','Voice','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','spread','isArray','transaction','removeAgents','Queue:remove','VoicePrefixId','getAgents','rawAttributes','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','limit','count','offset','set','Content-Range','json','save','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','params','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x0a36,0x174));var _0x60a3=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x0a36[_0x497b1e];return _0x3f72e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x60a3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x60a3('0x1'));var BPromise=require(_0x60a3('0x2'));var Mustache=require(_0x60a3('0x3'));var util=require(_0x60a3('0x4'));var path=require(_0x60a3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x60a3('0x6'));var fs=require('fs');var fs_extra=require(_0x60a3('0x7'));var _=require(_0x60a3('0x8'));var squel=require(_0x60a3('0x9'));var crypto=require(_0x60a3('0xa'));var jsforce=require(_0x60a3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x60a3('0xc'));var querystring=require(_0x60a3('0xd'));var Papa=require(_0x60a3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x60a3('0xf'));var as=require(_0x60a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60a3('0x11'))(_0x60a3('0x12'));var utils=require(_0x60a3('0x13'));var config=require(_0x60a3('0x14'));var licenseUtil=require(_0x60a3('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x60a3('0x16')](config[_0x60a3('0x17')],{'host':_0x60a3('0x18'),'port':0x18eb});var socket=require(_0x60a3('0x19'))(new Redis(config[_0x60a3('0x17')]));require(_0x60a3('0x1a'))[_0x60a3('0x1b')](socket);function respondWithStatusCode(_0x3f4e2d,_0x1b2c4a){_0x1b2c4a=_0x1b2c4a||0xcc;return function(_0x3afabb){if(_0x3afabb){return _0x3f4e2d[_0x60a3('0x1c')](_0x1b2c4a);}return _0x3f4e2d[_0x60a3('0x1d')](_0x1b2c4a)[_0x60a3('0x1e')]();};}function respondWithResult(_0x31ca5c,_0x249f84){_0x249f84=_0x249f84||0xc8;return function(_0x2bb9a9){if(_0x2bb9a9){return _0x31ca5c[_0x60a3('0x1d')](_0x249f84)['json'](_0x2bb9a9);}};}function respondWithFilteredResult(_0x5ce7a1,_0x57f577){return function(_0x3c3942){if(_0x3c3942){var _0x146b53=typeof _0x57f577['offset']==='undefined'&&typeof _0x57f577[_0x60a3('0x1f')]==='undefined';var _0x195b76=_0x3c3942[_0x60a3('0x20')];var _0x41ef6b=_0x146b53?0x0:_0x57f577[_0x60a3('0x21')];var _0x4ba936=_0x146b53?_0x3c3942[_0x60a3('0x20')]:_0x57f577['offset']+_0x57f577['limit'];var _0x461295;if(_0x4ba936>=_0x195b76){_0x4ba936=_0x195b76;_0x461295=0xc8;}else{_0x461295=0xce;}_0x5ce7a1[_0x60a3('0x1d')](_0x461295);return _0x5ce7a1[_0x60a3('0x22')](_0x60a3('0x23'),_0x41ef6b+'-'+_0x4ba936+'/'+_0x195b76)[_0x60a3('0x24')](_0x3c3942);}return null;};}function patchUpdates(_0x1db35a){return function(_0x19de54){try{jsonpatch['apply'](_0x19de54,_0x1db35a,!![]);}catch(_0x33c6ce){return BPromise['reject'](_0x33c6ce);}return _0x19de54[_0x60a3('0x25')]();};}function saveUpdates(_0x489144,_0xe62df6){return function(_0x493d0c){if(_0x493d0c){return _0x493d0c['update'](_0x489144)['then'](function(_0x4b5680){return _0x4b5680;});}return null;};}function handleEntityNotFound(_0x5c6bc7,_0x87cf22){return function(_0x5195be){if(!_0x5195be){_0x5c6bc7['sendStatus'](0x194);}return _0x5195be;};}function handleError(_0x113118,_0x5e4236){_0x5e4236=_0x5e4236||0x1f4;return function(_0x23420b){logger['error'](_0x23420b[_0x60a3('0x26')]);if(_0x23420b['name']){delete _0x23420b[_0x60a3('0x27')];}_0x113118[_0x60a3('0x1d')](_0x5e4236)[_0x60a3('0x28')](_0x23420b);};}exports[_0x60a3('0x29')]=function(_0xe0911a,_0x5219e3){var _0x317626={},_0xcd3c05={},_0x2e2a45={'count':0x0,'rows':[]};var _0x24cbd9=_[_0x60a3('0x2a')](db[_0x60a3('0x2b')]['rawAttributes'],function(_0x9d45fa){return{'name':_0x9d45fa[_0x60a3('0x2c')],'type':_0x9d45fa[_0x60a3('0x2d')][_0x60a3('0x2e')]};});_0xcd3c05[_0x60a3('0x2f')]=_[_0x60a3('0x2a')](_0x24cbd9,_0x60a3('0x27'));_0xcd3c05[_0x60a3('0x30')]=_[_0x60a3('0x31')](_0xe0911a[_0x60a3('0x30')]);_0xcd3c05[_0x60a3('0x32')]=_['intersection'](_0xcd3c05[_0x60a3('0x2f')],_0xcd3c05[_0x60a3('0x30')]);_0x317626['attributes']=_['intersection'](_0xcd3c05[_0x60a3('0x2f')],qs['fields'](_0xe0911a[_0x60a3('0x30')][_0x60a3('0x33')]));_0x317626[_0x60a3('0x34')]=_0x317626[_0x60a3('0x34')][_0x60a3('0x35')]?_0x317626['attributes']:_0xcd3c05['model'];if(!_0xe0911a[_0x60a3('0x30')][_0x60a3('0x36')](_0x60a3('0x37'))){_0x317626[_0x60a3('0x1f')]=qs[_0x60a3('0x1f')](_0xe0911a[_0x60a3('0x30')][_0x60a3('0x1f')]);_0x317626[_0x60a3('0x21')]=qs['offset'](_0xe0911a['query'][_0x60a3('0x21')]);}_0x317626[_0x60a3('0x38')]=qs[_0x60a3('0x39')](_0xe0911a['query'][_0x60a3('0x39')]);_0x317626[_0x60a3('0x3a')]=qs[_0x60a3('0x32')](_[_0x60a3('0x3b')](_0xe0911a[_0x60a3('0x30')],_0xcd3c05['filters']),_0x24cbd9);if(_0xe0911a[_0x60a3('0x30')][_0x60a3('0x3c')]){_0x317626['where']=_[_0x60a3('0x3d')](_0x317626[_0x60a3('0x3a')],{'$or':_[_0x60a3('0x2a')](_0x24cbd9,function(_0x22a788){if(_0x22a788['type']!=='VIRTUAL'){var _0x33e76c={};_0x33e76c[_0x22a788[_0x60a3('0x27')]]={'$like':'%'+_0xe0911a[_0x60a3('0x30')]['filter']+'%'};return _0x33e76c;}})});}_0x317626=_[_0x60a3('0x3d')]({},_0x317626,_0xe0911a[_0x60a3('0x3e')]);var _0x15ddc3={'where':_0x317626['where']};return db[_0x60a3('0x2b')][_0x60a3('0x20')](_0x15ddc3)['then'](function(_0x305836){_0x2e2a45[_0x60a3('0x20')]=_0x305836;if(_0xe0911a['query'][_0x60a3('0x3f')]){_0x317626[_0x60a3('0x40')]=[{'all':!![]}];}return db['Team'][_0x60a3('0x41')](_0x317626);})[_0x60a3('0x42')](function(_0x2c6fd8){_0x2e2a45[_0x60a3('0x43')]=_0x2c6fd8;return _0x2e2a45;})[_0x60a3('0x42')](respondWithFilteredResult(_0x5219e3,_0x317626))[_0x60a3('0x44')](handleError(_0x5219e3,null));};exports['show']=function(_0x2d5cf8,_0x49e101){var _0x2e408c={'raw':![],'where':{'id':_0x2d5cf8[_0x60a3('0x45')]['id']}},_0xd745b0={};_0xd745b0['model']=_[_0x60a3('0x31')](db['Team']['rawAttributes']);_0xd745b0[_0x60a3('0x30')]=_[_0x60a3('0x31')](_0x2d5cf8[_0x60a3('0x30')]);_0xd745b0[_0x60a3('0x32')]=_[_0x60a3('0x46')](_0xd745b0[_0x60a3('0x2f')],_0xd745b0['query']);_0x2e408c[_0x60a3('0x34')]=_[_0x60a3('0x46')](_0xd745b0[_0x60a3('0x2f')],qs[_0x60a3('0x33')](_0x2d5cf8['query'][_0x60a3('0x33')]));_0x2e408c[_0x60a3('0x34')]=_0x2e408c[_0x60a3('0x34')]['length']?_0x2e408c[_0x60a3('0x34')]:_0xd745b0[_0x60a3('0x2f')];if(_0x2d5cf8[_0x60a3('0x30')][_0x60a3('0x3f')]){_0x2e408c[_0x60a3('0x40')]=[{'all':!![]}];}_0x2e408c=_['merge']({},_0x2e408c,_0x2d5cf8['options']);return db[_0x60a3('0x2b')][_0x60a3('0x47')](_0x2e408c)[_0x60a3('0x42')](handleEntityNotFound(_0x49e101,null))[_0x60a3('0x42')](respondWithResult(_0x49e101,null))[_0x60a3('0x44')](handleError(_0x49e101,null));};exports[_0x60a3('0x48')]=function(_0x52cac9,_0x20b7c2){return db['Team'][_0x60a3('0x48')](_0x52cac9[_0x60a3('0x49')],{})[_0x60a3('0x42')](function(_0x36eb19){var _0x31c1c8=_0x52cac9[_0x60a3('0x4a')][_0x60a3('0x4b')]({'plain':!![]});if(!_0x31c1c8)throw new Error(_0x60a3('0x4c'));if(_0x31c1c8[_0x60a3('0x4d')]==='user'){var _0xe5cd48=_0x36eb19['get']({'plain':!![]});var _0x19cdce=_0x60a3('0x4e');return db[_0x60a3('0x4f')][_0x60a3('0x47')]({'where':{'name':_0x19cdce,'userProfileId':_0x31c1c8[_0x60a3('0x50')]},'raw':!![]})['then'](function(_0x1a9a0e){if(_0x1a9a0e&&_0x1a9a0e[_0x60a3('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0xe5cd48[_0x60a3('0x27')],'resourceId':_0xe5cd48['id'],'type':_0x1a9a0e[_0x60a3('0x27')],'sectionId':_0x1a9a0e['id']},{})[_0x60a3('0x42')](function(){return _0x36eb19;});}else{return _0x36eb19;}})[_0x60a3('0x44')](function(_0xd0ad){logger['error'](_0x60a3('0x52'),_0xd0ad);throw _0xd0ad;});}return _0x36eb19;})[_0x60a3('0x42')](respondWithResult(_0x20b7c2,0xc9))[_0x60a3('0x44')](handleError(_0x20b7c2,null));};exports['update']=function(_0x3aa7a4,_0x5d850c){if(_0x3aa7a4[_0x60a3('0x49')]['id']){delete _0x3aa7a4[_0x60a3('0x49')]['id'];}return db['Team'][_0x60a3('0x47')]({'where':{'id':_0x3aa7a4[_0x60a3('0x45')]['id']}})[_0x60a3('0x42')](handleEntityNotFound(_0x5d850c,null))[_0x60a3('0x42')](saveUpdates(_0x3aa7a4[_0x60a3('0x49')],null))[_0x60a3('0x42')](respondWithResult(_0x5d850c,null))['catch'](handleError(_0x5d850c,null));};exports[_0x60a3('0x53')]=function(_0x7bcb58,_0x366e06){var _0x7e348b=_0x7bcb58['params']['id'];var _0x166de3=[];return db['sequelize']['transaction'](function(_0x4a2dd4){var _0x45e6df='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x7e348b;return db['sequelize'][_0x60a3('0x30')](_0x45e6df,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4})[_0x60a3('0x42')](function(_0x649201){_0x166de3=_[_0x60a3('0x2a')](_0x649201,function(_0x42e239){return Number(_0x42e239[_0x60a3('0x57')]);});})[_0x60a3('0x42')](function(){var _0x485a3f=_0x60a3('0x58')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x485a3f,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x17403e){var _0x284d89=_['map'](_0x17403e,function(_0x1b3b18){return Number(_0x1b3b18[_0x60a3('0x5a')]);});return db[_0x60a3('0x5b')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'VoiceQueueId':{'$in':_0x284d89}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0xba5048='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0xba5048,{'type':db[_0x60a3('0x54')]['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0xe5e5c){var _0x14b413=_['map'](_0xe5e5c,function(_0x299810){return Number(_0x299810[_0x60a3('0x5c')]);});return db[_0x60a3('0x5d')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'MailQueueId':{'$in':_0x14b413}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0x5036b9=_0x60a3('0x5e')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x5036b9,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x50e70c){var _0x99a8c7=_[_0x60a3('0x2a')](_0x50e70c,function(_0x3a6efe){return Number(_0x3a6efe[_0x60a3('0x5f')]);});return db[_0x60a3('0x60')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'SmsQueueId':{'$in':_0x99a8c7}},'transaction':_0x4a2dd4});})['then'](function(){var _0x2ac340=_0x60a3('0x61')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x2ac340,{'type':db[_0x60a3('0x54')][_0x60a3('0x55')]['SELECT'],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x4e0687){var _0x4cfc5f=_[_0x60a3('0x2a')](_0x4e0687,function(_0x3265a7){return Number(_0x3265a7['ChatQueueId']);});return db[_0x60a3('0x62')][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'ChatQueueId':{'$in':_0x4cfc5f}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0x4efa80=_0x60a3('0x63')+_0x7e348b;return db['sequelize'][_0x60a3('0x30')](_0x4efa80,{'type':db['Sequelize']['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x2e630b){var _0x442cce=_['map'](_0x2e630b,function(_0x4d54e4){return Number(_0x4d54e4[_0x60a3('0x64')]);});return db['UserFaxQueue'][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'FaxQueueId':{'$in':_0x442cce}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){var _0x4da0c5=_0x60a3('0x65')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x4da0c5,{'type':db[_0x60a3('0x54')]['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x406135){var _0xed3bcd=_[_0x60a3('0x2a')](_0x406135,function(_0x110458){return Number(_0x110458['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x60a3('0x53')]({'where':{'UserId':{'$in':_0x166de3},'OpenchannelQueueId':{'$in':_0xed3bcd}},'transaction':_0x4a2dd4});})['then'](function(){var _0x18750f=_0x60a3('0x66')+_0x7e348b;return db[_0x60a3('0x59')][_0x60a3('0x30')](_0x18750f,{'type':db['Sequelize']['QueryTypes'][_0x60a3('0x56')],'raw':!![],'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(_0x4c50ef){var _0x5c8ed4=_[_0x60a3('0x2a')](_0x4c50ef,function(_0x403533){return Number(_0x403533[_0x60a3('0x67')]);});return db[_0x60a3('0x68')]['destroy']({'where':{'UserId':{'$in':_0x166de3},'WhatsappQueueId':{'$in':_0x5c8ed4}},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){return db[_0x60a3('0x69')][_0x60a3('0x47')]({'where':{'TeamId':_0x7e348b}});})[_0x60a3('0x42')](function(_0x77bac0){if(_0x77bac0===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x166de3},'VoicePrefixId':_0x77bac0['VoicePrefixId']},'transaction':_0x4a2dd4});})[_0x60a3('0x42')](function(){return db[_0x60a3('0x2b')][_0x60a3('0x53')]({'where':{'id':_0x7e348b},'cascade':!![],'transaction':_0x4a2dd4});})['then'](function(_0x35cf46){if(_0x35cf46===0x0){_0x366e06[_0x60a3('0x1c')](0x194);}else{return db[_0x60a3('0x6a')][_0x60a3('0x53')]({'where':{'type':'Teams','resourceId':_0x7e348b},'cascade':!![],'transaction':_0x4a2dd4})[_0x60a3('0x42')](function(){_0x366e06[_0x60a3('0x1d')](0xcc)['end']();});}})[_0x60a3('0x44')](function(_0x10c0f3){_0x366e06['status'](0x1f4)[_0x60a3('0x28')](_0x10c0f3);});});};exports[_0x60a3('0x6b')]=function(_0x147bcf,_0x316f96,_0x3d395b){return db['Team'][_0x60a3('0x6c')]({'where':{'id':_0x147bcf[_0x60a3('0x45')]['id']}})[_0x60a3('0x42')](handleEntityNotFound(_0x316f96,null))[_0x60a3('0x42')](function(_0x57daa7){if(!_0x147bcf[_0x60a3('0x30')][_0x60a3('0x6d')]||!utils[_0x60a3('0x6e')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x6d')])){throw new db['Sequelize'][(_0x60a3('0x6f'))](_0x60a3('0x70'));}var _0x40dbe8={};var _0x311f12={};_0x311f12[_0x60a3('0x2f')]=_['keys'](db[_[_0x60a3('0x71')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x6d')][_0x60a3('0x72')]())+_0x60a3('0x73')]['rawAttributes']);_0x311f12[_0x60a3('0x30')]=_['keys'](_0x147bcf[_0x60a3('0x30')]);_0x311f12[_0x60a3('0x32')]=_['intersection'](_0x311f12['model'],_0x311f12[_0x60a3('0x30')]);_0x40dbe8[_0x60a3('0x34')]=_[_0x60a3('0x46')](_0x311f12[_0x60a3('0x2f')],qs['fields'](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x33')]));_0x40dbe8[_0x60a3('0x34')]=_0x40dbe8['attributes']['length']?_0x40dbe8[_0x60a3('0x34')]:_0x311f12[_0x60a3('0x2f')];_0x40dbe8[_0x60a3('0x1f')]=qs[_0x60a3('0x1f')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x1f')]);_0x40dbe8['offset']=qs[_0x60a3('0x21')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x21')]);_0x40dbe8['order']=qs[_0x60a3('0x39')](_0x147bcf[_0x60a3('0x30')][_0x60a3('0x39')]);_0x40dbe8['where']=qs[_0x60a3('0x32')](_[_0x60a3('0x3b')](_0x147bcf[_0x60a3('0x30')],_0x311f12[_0x60a3('0x32')]));_0x40dbe8=_['merge']({},_0x40dbe8,_0x147bcf['options']);return _0x57daa7[_0x60a3('0x4b')+_[_0x60a3('0x71')](_0x147bcf['query'][_0x60a3('0x6d')]['toLowerCase']())+_0x60a3('0x74')](_0x40dbe8);})[_0x60a3('0x42')](respondWithResult(_0x316f96,null))[_0x60a3('0x44')](handleError(_0x316f96,null));};exports[_0x60a3('0x75')]=function(_0x2fe29e,_0x5286a8,_0x48119b){return db['Team']['findOne']({'where':{'id':_0x2fe29e['params']['id']}})['then'](function(_0x5c076b){if(_0x5c076b){if(!_0x2fe29e[_0x60a3('0x49')]['channel']||!utils[_0x60a3('0x6e')](_0x2fe29e[_0x60a3('0x49')]['channel'])){throw new db[(_0x60a3('0x54'))][(_0x60a3('0x6f'))](_0x60a3('0x70'));}return _0x5c076b[_0x60a3('0x76')+_['capitalize'](_0x2fe29e[_0x60a3('0x49')]['channel'][_0x60a3('0x72')]())+'Queues'](_0x2fe29e[_0x60a3('0x49')][_0x60a3('0x77')]);}return null;})[_0x60a3('0x42')](handleEntityNotFound(_0x5286a8,null))[_0x60a3('0x42')](respondWithStatusCode(_0x5286a8,null))[_0x60a3('0x44')](handleError(_0x5286a8,null));};exports[_0x60a3('0x78')]=function(_0x30d591,_0x353aaa,_0x54c02a){return db[_0x60a3('0x2b')][_0x60a3('0x6c')]({'where':{'id':_0x30d591[_0x60a3('0x45')]['id']}})[_0x60a3('0x42')](function(_0x39a106){if(_0x39a106){if(!_0x30d591[_0x60a3('0x30')][_0x60a3('0x6d')]||!utils[_0x60a3('0x6e')](_0x30d591[_0x60a3('0x30')]['channel'])){throw new db[(_0x60a3('0x54'))][(_0x60a3('0x6f'))](_0x60a3('0x70'));}return _0x39a106[_0x60a3('0x79')+_[_0x60a3('0x71')](_0x30d591[_0x60a3('0x30')][_0x60a3('0x6d')]['toLowerCase']())+_0x60a3('0x74')](_0x30d591[_0x60a3('0x30')][_0x60a3('0x77')]);}return null;})[_0x60a3('0x42')](handleEntityNotFound(_0x353aaa,null))['then'](respondWithStatusCode(_0x353aaa,null))[_0x60a3('0x44')](handleError(_0x353aaa,null));};exports[_0x60a3('0x7a')]=function(_0x517295,_0x80555){var _0x19be05=_['isArray'](_0x517295[_0x60a3('0x49')]['ids'])?_0x517295[_0x60a3('0x49')]['ids']:[_0x517295[_0x60a3('0x49')]['ids']];var _0x6f1164=_0x517295[_0x60a3('0x45')]['id'];return db[_0x60a3('0x2b')][_0x60a3('0x47')]({'where':{'id':_0x6f1164}})[_0x60a3('0x42')](handleEntityNotFound(_0x80555,null))[_0x60a3('0x42')](function(_0x57f0af){if(_0x57f0af){var _0x65e2b4=['Voice',_0x60a3('0x7b'),_0x60a3('0x7c'),_0x60a3('0x7d'),_0x60a3('0x7e'),_0x60a3('0x7f'),_0x60a3('0x80')];return db[_0x60a3('0x59')]['transaction'](function(_0xf0a2e9){var _0x4a39b0=_['map'](_0x65e2b4,function(_0x2fba1f){var _0x58cfd5={'attributes':['id',_0x60a3('0x27')]};if(_0x2fba1f===_0x60a3('0x81')){_0x58cfd5[_0x60a3('0x82')]={'attributes':['penalty']};}return _0x57f0af[_0x60a3('0x4b')+_0x2fba1f+_0x60a3('0x74')](_0x58cfd5)[_0x60a3('0x42')](function(_0x12b00b){var _0x374c32=_[_0x60a3('0x2a')](_0x12b00b,function(_0x188936){var _0xb1740e=_[_0x60a3('0x2a')](_0x19be05,function(_0x1a809b){var _0x511492={'where':{'UserId':_0x1a809b,[_0x2fba1f+_0x60a3('0x83')]:_0x188936['id']},'transaction':_0xf0a2e9};if(_0x2fba1f===_0x60a3('0x81')){_0x511492['defaults']={'penalty':_0x188936[_0x60a3('0x84')][_0x60a3('0x85')]};}return db[_0x60a3('0x86')+_0x2fba1f+_0x60a3('0x73')][_0x60a3('0x87')](_0x511492)[_0x60a3('0x42')](function(){socket[_0x60a3('0x88')](_0x60a3('0x4a')+_0x2fba1f+_0x60a3('0x89'),{'UserId':_0x1a809b,[_0x2fba1f+_0x60a3('0x83')]:_0x188936['id']});if(_0x2fba1f!==_0x60a3('0x81')){return;}return db[_0x60a3('0x86')][_0x60a3('0x41')]({'where':{'id':_0x19be05,'online':0x1},'attributes':['id',_0x60a3('0x27'),_0x60a3('0x8a'),_0x60a3('0x8b'),_0x60a3('0x8c')],'raw':!![]})[_0x60a3('0x42')](function(_0x38c14b){var _0x1880f0=_['map'](_0x38c14b,function(_0x588cf7){return db[_0x60a3('0x8d')][_0x60a3('0x8e')]({'membername':_0x588cf7[_0x60a3('0x27')],'UserId':_0x588cf7['id'],'queue_name':_0x188936[_0x60a3('0x27')],'VoiceQueueId':_0x188936['id'],'interface':_[_0x60a3('0x8f')](_0x588cf7[_0x60a3('0x8c')])?util[_0x60a3('0x90')](_0x60a3('0x91'),_0x588cf7[_0x60a3('0x27')]):_0x588cf7[_0x60a3('0x8c')],'paused':_0x588cf7[_0x60a3('0x8b')]||![],'penalty':_0x188936[_0x60a3('0x84')]['penalty']},{'transaction':_0xf0a2e9});});return Promise[_0x60a3('0x92')](_0x1880f0);});});});return Promise[_0x60a3('0x92')](_0xb1740e);});return Promise[_0x60a3('0x92')](_0x374c32);})[_0x60a3('0x42')](function(){return db[_0x60a3('0x69')][_0x60a3('0x6c')]({'where':{'teamId':_0x6f1164}})[_0x60a3('0x42')](function(_0x2b8b44){if(_0x2b8b44){var _0x460ab4=_['map'](_0x19be05,function(_0xc4a1a4){db[_0x60a3('0x93')][_0x60a3('0x8e')]({'UserId':_0xc4a1a4,'VoicePrefixId':_0x2b8b44['VoicePrefixId']});});return Promise[_0x60a3('0x92')](_0x460ab4);}});});});return Promise['all'](_0x4a39b0)[_0x60a3('0x42')](function(){return _0x57f0af[_0x60a3('0x7a')](_0x19be05,{'transaction':_0xf0a2e9})[_0x60a3('0x94')](function(_0x317ce6){return _0x317ce6;});});});}})[_0x60a3('0x42')](respondWithResult(_0x80555,null))[_0x60a3('0x44')](handleError(_0x80555,null));};exports['removeAgents']=function(_0xa01280,_0x56517d){var _0x1e916e=_[_0x60a3('0x95')](_0xa01280['query'][_0x60a3('0x77')])?_0xa01280[_0x60a3('0x30')][_0x60a3('0x77')]:[_0xa01280[_0x60a3('0x30')][_0x60a3('0x77')]];var _0x15796b=_0xa01280['params']['id'];return db['Team'][_0x60a3('0x47')]({'where':{'id':_0x15796b}})['then'](handleEntityNotFound(_0x56517d,null))[_0x60a3('0x42')](function(_0x49c61a){if(_0x49c61a){var _0xd3934c=[_0x60a3('0x81'),_0x60a3('0x7b'),'Mail',_0x60a3('0x7d'),_0x60a3('0x7e'),_0x60a3('0x7f'),_0x60a3('0x80')];return db['sequelize'][_0x60a3('0x96')](function(_0x427c06){var _0x5cfc03=_[_0x60a3('0x2a')](_0xd3934c,function(_0x1949af){var _0x260a29={'attributes':['id','name']};return _0x49c61a[_0x60a3('0x4b')+_0x1949af+_0x60a3('0x74')](_0x260a29)[_0x60a3('0x42')](function(_0x414c67){var _0xb82dda=_[_0x60a3('0x2a')](_0x414c67,function(_0x340171){return _0x340171[_0x60a3('0x97')](_0x1e916e,{'transaction':_0x427c06})[_0x60a3('0x42')](function(){var _0x3c0611=_[_0x60a3('0x2a')](_0x1e916e,function(_0x4a54bd){socket[_0x60a3('0x88')](_0x60a3('0x4a')+_0x1949af+_0x60a3('0x98'),{'UserId':Number(_0x4a54bd),[_0x1949af+_0x60a3('0x83')]:_0x340171['id']});if(_0x1949af!==_0x60a3('0x81')){return;}return db['UserVoiceQueueRt'][_0x60a3('0x53')]({'where':{'VoiceQueueId':_0x340171['id'],'UserId':_0x4a54bd},'transaction':_0x427c06});});return Promise['all'](_0x3c0611);});});return Promise['all'](_0xb82dda);});});return Promise[_0x60a3('0x92')](_0x5cfc03)[_0x60a3('0x42')](function(){return _0x49c61a[_0x60a3('0x97')](_0x1e916e,{'transaction':_0x427c06});})[_0x60a3('0x42')](function(){return db[_0x60a3('0x69')][_0x60a3('0x6c')]({'where':{'teamId':_0x15796b}})['then'](function(_0x5049ec){if(_0x5049ec){var _0x447f43=_[_0x60a3('0x2a')](_0x1e916e,function(_0x29e99c){db[_0x60a3('0x93')]['destroy']({'where':{'UserId':_0x29e99c,'VoicePrefixId':_0x5049ec[_0x60a3('0x99')]}});});return Promise['all'](_0x447f43);}});});});}})[_0x60a3('0x42')](respondWithStatusCode(_0x56517d,null))['catch'](handleError(_0x56517d,null));};exports[_0x60a3('0x9a')]=function(_0x5e86d9,_0x15a052,_0x4e9c7a){var _0x4ff1d4={};var _0x646c3e={};var _0x20ac1a;var _0x1ea0d5;return db[_0x60a3('0x2b')][_0x60a3('0x6c')]({'where':{'id':_0x5e86d9[_0x60a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x15a052,null))[_0x60a3('0x42')](function(_0x185835){if(_0x185835){_0x20ac1a=_0x185835;_0x646c3e[_0x60a3('0x2f')]=_[_0x60a3('0x31')](db[_0x60a3('0x86')][_0x60a3('0x9b')]);_0x646c3e[_0x60a3('0x30')]=_[_0x60a3('0x31')](_0x5e86d9[_0x60a3('0x30')]);_0x646c3e['filters']=_[_0x60a3('0x46')](_0x646c3e[_0x60a3('0x2f')],_0x646c3e[_0x60a3('0x30')]);_0x4ff1d4[_0x60a3('0x34')]=_[_0x60a3('0x46')](_0x646c3e[_0x60a3('0x2f')],qs[_0x60a3('0x33')](_0x5e86d9['query'][_0x60a3('0x33')]));_0x4ff1d4[_0x60a3('0x34')]=_0x4ff1d4['attributes']['length']?_0x4ff1d4[_0x60a3('0x34')]:_0x646c3e[_0x60a3('0x2f')];_0x4ff1d4[_0x60a3('0x38')]=qs[_0x60a3('0x39')](_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x39')]);_0x4ff1d4['where']=qs[_0x60a3('0x32')](_[_0x60a3('0x3b')](_0x5e86d9['query'],_0x646c3e[_0x60a3('0x32')]));if(_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x3c')]){_0x4ff1d4['where']=_['merge'](_0x4ff1d4[_0x60a3('0x3a')],{'$or':_[_0x60a3('0x2a')](_0x4ff1d4[_0x60a3('0x34')],function(_0x2c71a8){var _0x197a3e={};_0x197a3e[_0x2c71a8]={'$like':'%'+_0x5e86d9[_0x60a3('0x30')]['filter']+'%'};return _0x197a3e;})});}_0x4ff1d4=_['merge']({},_0x4ff1d4,_0x5e86d9['options']);return _0x20ac1a[_0x60a3('0x9a')](_0x4ff1d4);}})[_0x60a3('0x42')](function(_0x55bc26){if(_0x55bc26){_0x1ea0d5=_0x55bc26['length'];if(!_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x36')]('nolimit')){_0x4ff1d4[_0x60a3('0x1f')]=qs['limit'](_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x1f')]);_0x4ff1d4[_0x60a3('0x21')]=qs[_0x60a3('0x21')](_0x5e86d9[_0x60a3('0x30')][_0x60a3('0x21')]);}return _0x20ac1a[_0x60a3('0x9a')](_0x4ff1d4);}})['then'](function(_0x56816a){if(_0x56816a){return _0x56816a?{'count':_0x1ea0d5,'rows':_0x56816a}:null;}})[_0x60a3('0x42')](respondWithResult(_0x15a052,null))[_0x60a3('0x44')](handleError(_0x15a052,null));}; \ No newline at end of file +var _0x31b7=['spread','removeAgents','Queue:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','error','stack','name','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Team','destroy','transaction','sequelize','Sequelize','QueryTypes','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','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','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','toLowerCase','Queues','addQueues','findOne','add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','upsert','addAgents'];(function(_0x352fbf,_0x5d417d){var _0x45784a=function(_0x22a0ff){while(--_0x22a0ff){_0x352fbf['push'](_0x352fbf['shift']());}};_0x45784a(++_0x5d417d);}(_0x31b7,0x138));var _0x731b=function(_0x267346,_0x2ae952){_0x267346=_0x267346-0x0;var _0x2e3e18=_0x31b7[_0x267346];return _0x2e3e18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x731b('0x0'));var zipdir=require(_0x731b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x731b('0x2'));var moment=require('moment');var BPromise=require(_0x731b('0x3'));var Mustache=require(_0x731b('0x4'));var util=require('util');var path=require(_0x731b('0x5'));var sox=require(_0x731b('0x6'));var csv=require(_0x731b('0x7'));var ejs=require(_0x731b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x731b('0x9'));var squel=require(_0x731b('0xa'));var crypto=require('crypto');var jsforce=require(_0x731b('0xb'));var deskjs=require(_0x731b('0xc'));var toCsv=require(_0x731b('0x7'));var querystring=require(_0x731b('0xd'));var Papa=require(_0x731b('0xe'));var Redis=require(_0x731b('0xf'));var authService=require(_0x731b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x731b('0x11'));var logger=require(_0x731b('0x12'))(_0x731b('0x13'));var utils=require(_0x731b('0x14'));var config=require(_0x731b('0x15'));var licenseUtil=require(_0x731b('0x16'));var db=require('../../mysqldb')['db'];config[_0x731b('0x17')]=_[_0x731b('0x18')](config[_0x731b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x731b('0x19'))(new Redis(config[_0x731b('0x17')]));require(_0x731b('0x1a'))[_0x731b('0x1b')](socket);function respondWithStatusCode(_0x419680,_0x550490){_0x550490=_0x550490||0xcc;return function(_0x42bb8b){if(_0x42bb8b){return _0x419680[_0x731b('0x1c')](_0x550490);}return _0x419680[_0x731b('0x1d')](_0x550490)['end']();};}function respondWithResult(_0x5f2d64,_0x19e411){_0x19e411=_0x19e411||0xc8;return function(_0x86eb75){if(_0x86eb75){return _0x5f2d64[_0x731b('0x1d')](_0x19e411)[_0x731b('0x1e')](_0x86eb75);}};}function respondWithFilteredResult(_0x19aa81,_0x441f7e){return function(_0x4bfd14){if(_0x4bfd14){var _0x143138=typeof _0x441f7e['offset']==='undefined'&&typeof _0x441f7e[_0x731b('0x1f')]===_0x731b('0x20');var _0x7bc41f=_0x4bfd14[_0x731b('0x21')];var _0x1c1958=_0x143138?0x0:_0x441f7e[_0x731b('0x22')];var _0x18db6c=_0x143138?_0x4bfd14[_0x731b('0x21')]:_0x441f7e[_0x731b('0x22')]+_0x441f7e[_0x731b('0x1f')];var _0x292726;if(_0x18db6c>=_0x7bc41f){_0x18db6c=_0x7bc41f;_0x292726=0xc8;}else{_0x292726=0xce;}_0x19aa81[_0x731b('0x1d')](_0x292726);return _0x19aa81[_0x731b('0x23')](_0x731b('0x24'),_0x1c1958+'-'+_0x18db6c+'/'+_0x7bc41f)['json'](_0x4bfd14);}return null;};}function patchUpdates(_0x20e26c){return function(_0x49d9e8){try{jsonpatch[_0x731b('0x25')](_0x49d9e8,_0x20e26c,!![]);}catch(_0x4627d8){return BPromise[_0x731b('0x26')](_0x4627d8);}return _0x49d9e8['save']();};}function saveUpdates(_0x7e4a9,_0x173b25){return function(_0x2bddc){if(_0x2bddc){return _0x2bddc['update'](_0x7e4a9)[_0x731b('0x27')](function(_0x5da8b8){return _0x5da8b8;});}return null;};}function handleEntityNotFound(_0x283b2a,_0x5a557d){return function(_0x2efccc){if(!_0x2efccc){_0x283b2a[_0x731b('0x1c')](0x194);}return _0x2efccc;};}function handleError(_0x195b0c,_0x5b6424){_0x5b6424=_0x5b6424||0x1f4;return function(_0x1d9773){logger[_0x731b('0x28')](_0x1d9773[_0x731b('0x29')]);if(_0x1d9773[_0x731b('0x2a')]){delete _0x1d9773[_0x731b('0x2a')];}_0x195b0c[_0x731b('0x1d')](_0x5b6424)['send'](_0x1d9773);};}exports[_0x731b('0x2b')]=function(_0x875038,_0x53b928){var _0x1337e2={},_0x3c265e={},_0x1716d6={'count':0x0,'rows':[]};var _0x470f72=_[_0x731b('0x2c')](db['Team'][_0x731b('0x2d')],function(_0x3db8bc){return{'name':_0x3db8bc[_0x731b('0x2e')],'type':_0x3db8bc['type']['key']};});_0x3c265e['model']=_[_0x731b('0x2c')](_0x470f72,_0x731b('0x2a'));_0x3c265e[_0x731b('0x2f')]=_[_0x731b('0x30')](_0x875038[_0x731b('0x2f')]);_0x3c265e[_0x731b('0x31')]=_[_0x731b('0x32')](_0x3c265e[_0x731b('0x33')],_0x3c265e['query']);_0x1337e2[_0x731b('0x34')]=_['intersection'](_0x3c265e[_0x731b('0x33')],qs[_0x731b('0x35')](_0x875038['query'][_0x731b('0x35')]));_0x1337e2[_0x731b('0x34')]=_0x1337e2[_0x731b('0x34')]['length']?_0x1337e2[_0x731b('0x34')]:_0x3c265e[_0x731b('0x33')];if(!_0x875038[_0x731b('0x2f')][_0x731b('0x36')](_0x731b('0x37'))){_0x1337e2[_0x731b('0x1f')]=qs[_0x731b('0x1f')](_0x875038[_0x731b('0x2f')]['limit']);_0x1337e2[_0x731b('0x22')]=qs['offset'](_0x875038[_0x731b('0x2f')][_0x731b('0x22')]);}_0x1337e2[_0x731b('0x38')]=qs[_0x731b('0x39')](_0x875038[_0x731b('0x2f')][_0x731b('0x39')]);_0x1337e2[_0x731b('0x3a')]=qs[_0x731b('0x31')](_[_0x731b('0x3b')](_0x875038[_0x731b('0x2f')],_0x3c265e[_0x731b('0x31')]),_0x470f72);if(_0x875038[_0x731b('0x2f')][_0x731b('0x3c')]){_0x1337e2[_0x731b('0x3a')]=_[_0x731b('0x3d')](_0x1337e2[_0x731b('0x3a')],{'$or':_[_0x731b('0x2c')](_0x470f72,function(_0x247d9f){if(_0x247d9f['type']!==_0x731b('0x3e')){var _0x1eb4fd={};_0x1eb4fd[_0x247d9f['name']]={'$like':'%'+_0x875038['query'][_0x731b('0x3c')]+'%'};return _0x1eb4fd;}})});}_0x1337e2=_[_0x731b('0x3d')]({},_0x1337e2,_0x875038[_0x731b('0x3f')]);var _0x332970={'where':_0x1337e2['where']};return db['Team']['count'](_0x332970)[_0x731b('0x27')](function(_0x13e016){_0x1716d6[_0x731b('0x21')]=_0x13e016;if(_0x875038[_0x731b('0x2f')][_0x731b('0x40')]){_0x1337e2[_0x731b('0x41')]=[{'all':!![]}];}return db['Team'][_0x731b('0x42')](_0x1337e2);})[_0x731b('0x27')](function(_0x1a9469){_0x1716d6[_0x731b('0x43')]=_0x1a9469;return _0x1716d6;})[_0x731b('0x27')](respondWithFilteredResult(_0x53b928,_0x1337e2))[_0x731b('0x44')](handleError(_0x53b928,null));};exports[_0x731b('0x45')]=function(_0x47952c,_0x1e0cf8){var _0x255f55={'raw':![],'where':{'id':_0x47952c[_0x731b('0x46')]['id']}},_0x5cfaab={};_0x5cfaab['model']=_['keys'](db['Team'][_0x731b('0x2d')]);_0x5cfaab['query']=_[_0x731b('0x30')](_0x47952c[_0x731b('0x2f')]);_0x5cfaab['filters']=_[_0x731b('0x32')](_0x5cfaab[_0x731b('0x33')],_0x5cfaab['query']);_0x255f55['attributes']=_[_0x731b('0x32')](_0x5cfaab[_0x731b('0x33')],qs[_0x731b('0x35')](_0x47952c[_0x731b('0x2f')][_0x731b('0x35')]));_0x255f55[_0x731b('0x34')]=_0x255f55['attributes'][_0x731b('0x47')]?_0x255f55[_0x731b('0x34')]:_0x5cfaab[_0x731b('0x33')];if(_0x47952c[_0x731b('0x2f')][_0x731b('0x40')]){_0x255f55[_0x731b('0x41')]=[{'all':!![]}];}_0x255f55=_['merge']({},_0x255f55,_0x47952c[_0x731b('0x3f')]);return db['Team'][_0x731b('0x48')](_0x255f55)[_0x731b('0x27')](handleEntityNotFound(_0x1e0cf8,null))[_0x731b('0x27')](respondWithResult(_0x1e0cf8,null))['catch'](handleError(_0x1e0cf8,null));};exports[_0x731b('0x49')]=function(_0x4892fe,_0x28f31a){return db['Team']['create'](_0x4892fe[_0x731b('0x4a')],{})[_0x731b('0x27')](function(_0x3e63f9){var _0x474b0e=_0x4892fe[_0x731b('0x4b')][_0x731b('0x4c')]({'plain':!![]});if(!_0x474b0e)throw new Error(_0x731b('0x4d'));if(_0x474b0e['role']===_0x731b('0x4b')){var _0x122fe3=_0x3e63f9[_0x731b('0x4c')]({'plain':!![]});var _0x1c5dd6=_0x731b('0x4e');return db[_0x731b('0x4f')][_0x731b('0x48')]({'where':{'name':_0x1c5dd6,'userProfileId':_0x474b0e['userProfileId']},'raw':!![]})[_0x731b('0x27')](function(_0x5c7bc6){if(_0x5c7bc6&&_0x5c7bc6[_0x731b('0x50')]===0x0){return db[_0x731b('0x51')][_0x731b('0x49')]({'name':_0x122fe3[_0x731b('0x2a')],'resourceId':_0x122fe3['id'],'type':_0x5c7bc6[_0x731b('0x2a')],'sectionId':_0x5c7bc6['id']},{})[_0x731b('0x27')](function(){return _0x3e63f9;});}else{return _0x3e63f9;}})['catch'](function(_0x59761b){logger[_0x731b('0x28')](_0x731b('0x52'),_0x59761b);throw _0x59761b;});}return _0x3e63f9;})['then'](respondWithResult(_0x28f31a,0xc9))[_0x731b('0x44')](handleError(_0x28f31a,null));};exports[_0x731b('0x53')]=function(_0x46d79e,_0x42f8a8){if(_0x46d79e[_0x731b('0x4a')]['id']){delete _0x46d79e[_0x731b('0x4a')]['id'];}return db[_0x731b('0x54')][_0x731b('0x48')]({'where':{'id':_0x46d79e[_0x731b('0x46')]['id']}})['then'](handleEntityNotFound(_0x42f8a8,null))[_0x731b('0x27')](saveUpdates(_0x46d79e['body'],null))['then'](respondWithResult(_0x42f8a8,null))['catch'](handleError(_0x42f8a8,null));};exports[_0x731b('0x55')]=function(_0x3e1b28,_0x3bf4de){var _0x42ee65=_0x3e1b28[_0x731b('0x46')]['id'];var _0x2d9b3c=[];return db['sequelize'][_0x731b('0x56')](function(_0x52210d){var _0x233b95='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x42ee65;return db[_0x731b('0x57')][_0x731b('0x2f')](_0x233b95,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d})[_0x731b('0x27')](function(_0x2cc755){_0x2d9b3c=_[_0x731b('0x2c')](_0x2cc755,function(_0x36f31e){return Number(_0x36f31e['UserId']);});})['then'](function(){var _0x3c06e5='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x42ee65;return db['sequelize']['query'](_0x3c06e5,{'type':db[_0x731b('0x58')]['QueryTypes'][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})['then'](function(_0x2a7e6a){var _0x3f8eba=_[_0x731b('0x2c')](_0x2a7e6a,function(_0x2237b5){return Number(_0x2237b5[_0x731b('0x5b')]);});return db['UserVoiceQueue'][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'VoiceQueueId':{'$in':_0x3f8eba}},'transaction':_0x52210d});})['then'](function(){var _0x1b4c29=_0x731b('0x5c')+_0x42ee65;return db[_0x731b('0x57')]['query'](_0x1b4c29,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})[_0x731b('0x27')](function(_0x192133){var _0x3275fa=_['map'](_0x192133,function(_0xead2d5){return Number(_0xead2d5[_0x731b('0x5d')]);});return db[_0x731b('0x5e')][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'MailQueueId':{'$in':_0x3275fa}},'transaction':_0x52210d});})[_0x731b('0x27')](function(){var _0x296fb5=_0x731b('0x5f')+_0x42ee65;return db['sequelize'][_0x731b('0x2f')](_0x296fb5,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})[_0x731b('0x27')](function(_0x11f95f){var _0x2b6439=_[_0x731b('0x2c')](_0x11f95f,function(_0x22f35c){return Number(_0x22f35c[_0x731b('0x60')]);});return db['UserSmsQueue'][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'SmsQueueId':{'$in':_0x2b6439}},'transaction':_0x52210d});})['then'](function(){var _0x208ccb='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x42ee65;return db[_0x731b('0x57')][_0x731b('0x2f')](_0x208ccb,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})[_0x731b('0x27')](function(_0x57f7e4){var _0x21125a=_['map'](_0x57f7e4,function(_0x3ba3f2){return Number(_0x3ba3f2[_0x731b('0x61')]);});return db[_0x731b('0x62')][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'ChatQueueId':{'$in':_0x21125a}},'transaction':_0x52210d});})[_0x731b('0x27')](function(){var _0x94d363=_0x731b('0x63')+_0x42ee65;return db[_0x731b('0x57')]['query'](_0x94d363,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})['then'](function(_0x4cffcc){var _0x371268=_[_0x731b('0x2c')](_0x4cffcc,function(_0x29df57){return Number(_0x29df57[_0x731b('0x64')]);});return db[_0x731b('0x65')][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'FaxQueueId':{'$in':_0x371268}},'transaction':_0x52210d});})[_0x731b('0x27')](function(){var _0x278f97=_0x731b('0x66')+_0x42ee65;return db[_0x731b('0x57')][_0x731b('0x2f')](_0x278f97,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})[_0x731b('0x27')](function(_0x4fe38e){var _0x238c1b=_[_0x731b('0x2c')](_0x4fe38e,function(_0x4a4f57){return Number(_0x4a4f57[_0x731b('0x67')]);});return db['UserOpenchannelQueue'][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'OpenchannelQueueId':{'$in':_0x238c1b}},'transaction':_0x52210d});})['then'](function(){var _0x1b0363=_0x731b('0x68')+_0x42ee65;return db[_0x731b('0x57')][_0x731b('0x2f')](_0x1b0363,{'type':db[_0x731b('0x58')][_0x731b('0x59')][_0x731b('0x5a')],'raw':!![],'transaction':_0x52210d});})[_0x731b('0x27')](function(_0x53fa7b){var _0x56ebf4=_[_0x731b('0x2c')](_0x53fa7b,function(_0x324a4a){return Number(_0x324a4a[_0x731b('0x69')]);});return db['UserWhatsappQueue'][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'WhatsappQueueId':{'$in':_0x56ebf4}},'transaction':_0x52210d});})[_0x731b('0x27')](function(){return db[_0x731b('0x6a')]['find']({'where':{'TeamId':_0x42ee65}});})['then'](function(_0x133bc5){if(_0x133bc5===null){return;}return db[_0x731b('0x6b')][_0x731b('0x55')]({'where':{'UserId':{'$in':_0x2d9b3c},'VoicePrefixId':_0x133bc5[_0x731b('0x6c')]},'transaction':_0x52210d});})[_0x731b('0x27')](function(){return db[_0x731b('0x54')][_0x731b('0x55')]({'where':{'id':_0x42ee65},'cascade':!![],'transaction':_0x52210d});})[_0x731b('0x27')](function(_0x2bddcb){if(_0x2bddcb===0x0){_0x3bf4de[_0x731b('0x1c')](0x194);}else{return db['UserProfileResource'][_0x731b('0x55')]({'where':{'type':_0x731b('0x4e'),'resourceId':_0x42ee65},'cascade':!![],'transaction':_0x52210d})['then'](function(){_0x3bf4de[_0x731b('0x1d')](0xcc)[_0x731b('0x6d')]();});}})[_0x731b('0x44')](function(_0x5029fe){_0x3bf4de[_0x731b('0x1d')](0x1f4)['send'](_0x5029fe);});});};exports[_0x731b('0x6e')]=function(_0x47d496,_0x2fc448,_0x478bff){return db[_0x731b('0x54')]['findOne']({'where':{'id':_0x47d496['params']['id']}})[_0x731b('0x27')](handleEntityNotFound(_0x2fc448,null))['then'](function(_0x3b818f){if(!_0x47d496['query'][_0x731b('0x6f')]||!utils[_0x731b('0x70')](_0x47d496[_0x731b('0x2f')]['channel'])){throw new db[(_0x731b('0x58'))][(_0x731b('0x71'))](_0x731b('0x72'));}var _0x49ec82={};var _0x2c5585={};_0x2c5585['model']=_[_0x731b('0x30')](db[_[_0x731b('0x73')](_0x47d496[_0x731b('0x2f')][_0x731b('0x6f')]['toLowerCase']())+_0x731b('0x74')]['rawAttributes']);_0x2c5585[_0x731b('0x2f')]=_[_0x731b('0x30')](_0x47d496[_0x731b('0x2f')]);_0x2c5585['filters']=_[_0x731b('0x32')](_0x2c5585[_0x731b('0x33')],_0x2c5585[_0x731b('0x2f')]);_0x49ec82[_0x731b('0x34')]=_[_0x731b('0x32')](_0x2c5585[_0x731b('0x33')],qs[_0x731b('0x35')](_0x47d496['query']['fields']));_0x49ec82[_0x731b('0x34')]=_0x49ec82[_0x731b('0x34')][_0x731b('0x47')]?_0x49ec82[_0x731b('0x34')]:_0x2c5585[_0x731b('0x33')];_0x49ec82[_0x731b('0x1f')]=qs[_0x731b('0x1f')](_0x47d496['query'][_0x731b('0x1f')]);_0x49ec82['offset']=qs['offset'](_0x47d496[_0x731b('0x2f')]['offset']);_0x49ec82[_0x731b('0x38')]=qs[_0x731b('0x39')](_0x47d496['query'][_0x731b('0x39')]);_0x49ec82[_0x731b('0x3a')]=qs[_0x731b('0x31')](_['pick'](_0x47d496[_0x731b('0x2f')],_0x2c5585['filters']));_0x49ec82=_[_0x731b('0x3d')]({},_0x49ec82,_0x47d496['options']);return _0x3b818f[_0x731b('0x4c')+_[_0x731b('0x73')](_0x47d496[_0x731b('0x2f')][_0x731b('0x6f')][_0x731b('0x75')]())+_0x731b('0x76')](_0x49ec82);})[_0x731b('0x27')](respondWithResult(_0x2fc448,null))['catch'](handleError(_0x2fc448,null));};exports[_0x731b('0x77')]=function(_0x50c0eb,_0x3f1664,_0x1f1285){return db[_0x731b('0x54')][_0x731b('0x78')]({'where':{'id':_0x50c0eb[_0x731b('0x46')]['id']}})[_0x731b('0x27')](function(_0x3900c0){if(_0x3900c0){if(!_0x50c0eb[_0x731b('0x4a')][_0x731b('0x6f')]||!utils[_0x731b('0x70')](_0x50c0eb[_0x731b('0x4a')][_0x731b('0x6f')])){throw new db[(_0x731b('0x58'))][(_0x731b('0x71'))](_0x731b('0x72'));}return _0x3900c0[_0x731b('0x79')+_[_0x731b('0x73')](_0x50c0eb[_0x731b('0x4a')]['channel']['toLowerCase']())+_0x731b('0x76')](_0x50c0eb['body'][_0x731b('0x7a')]);}return null;})[_0x731b('0x27')](handleEntityNotFound(_0x3f1664,null))['then'](respondWithStatusCode(_0x3f1664,null))[_0x731b('0x44')](handleError(_0x3f1664,null));};exports[_0x731b('0x7b')]=function(_0x5dad04,_0x523b8b,_0x129517){return db['Team'][_0x731b('0x78')]({'where':{'id':_0x5dad04[_0x731b('0x46')]['id']}})[_0x731b('0x27')](function(_0xae40ab){if(_0xae40ab){if(!_0x5dad04['query'][_0x731b('0x6f')]||!utils[_0x731b('0x70')](_0x5dad04[_0x731b('0x2f')][_0x731b('0x6f')])){throw new db['Sequelize'][(_0x731b('0x71'))](_0x731b('0x72'));}return _0xae40ab[_0x731b('0x7c')+_[_0x731b('0x73')](_0x5dad04[_0x731b('0x2f')][_0x731b('0x6f')]['toLowerCase']())+'Queues'](_0x5dad04['query']['ids']);}return null;})[_0x731b('0x27')](handleEntityNotFound(_0x523b8b,null))['then'](respondWithStatusCode(_0x523b8b,null))[_0x731b('0x44')](handleError(_0x523b8b,null));};exports['addAgents']=function(_0x36d4f8,_0x4bb66a){var _0x16ffd2=_[_0x731b('0x7d')](_0x36d4f8[_0x731b('0x4a')][_0x731b('0x7a')])?_0x36d4f8['body']['ids']:[_0x36d4f8[_0x731b('0x4a')][_0x731b('0x7a')]];var _0x5d69ac=_0x36d4f8['params']['id'];return db[_0x731b('0x54')][_0x731b('0x48')]({'where':{'id':_0x5d69ac}})['then'](handleEntityNotFound(_0x4bb66a,null))[_0x731b('0x27')](function(_0x5ce09c){if(_0x5ce09c){var _0x1b7c1a=[_0x731b('0x7e'),_0x731b('0x7f'),_0x731b('0x80'),'Sms',_0x731b('0x81'),_0x731b('0x82'),_0x731b('0x83')];return db[_0x731b('0x57')][_0x731b('0x56')](function(_0x16d9b2){var _0x161f1e=_['map'](_0x1b7c1a,function(_0x130c8c){var _0x48b34c={'attributes':['id','name']};if(_0x130c8c===_0x731b('0x7e')){_0x48b34c[_0x731b('0x84')]={'attributes':['penalty']};}return _0x5ce09c['get'+_0x130c8c+_0x731b('0x76')](_0x48b34c)[_0x731b('0x27')](function(_0xcd11b1){var _0x2fa019=_['map'](_0xcd11b1,function(_0x388729){var _0x2c8de6=_['map'](_0x16ffd2,function(_0x275911){var _0x2365aa={'where':{'UserId':_0x275911,[_0x130c8c+_0x731b('0x85')]:_0x388729['id']},'transaction':_0x16d9b2};if(_0x130c8c===_0x731b('0x7e')){_0x2365aa['defaults']={'penalty':_0x388729[_0x731b('0x86')][_0x731b('0x87')]};}return db[_0x731b('0x88')+_0x130c8c+'Queue'][_0x731b('0x89')](_0x2365aa)[_0x731b('0x27')](function(){socket[_0x731b('0x8a')](_0x731b('0x4b')+_0x130c8c+_0x731b('0x8b'),{'UserId':_0x275911,[_0x130c8c+'QueueId']:_0x388729['id']});if(_0x130c8c!==_0x731b('0x7e')){return;}return db[_0x731b('0x88')][_0x731b('0x42')]({'where':{'id':_0x16ffd2,'online':0x1},'attributes':['id','name',_0x731b('0x8c'),_0x731b('0x8d'),_0x731b('0x8e')],'raw':!![]})['then'](function(_0x3235eb){var _0x52e902=_[_0x731b('0x2c')](_0x3235eb,function(_0x2f7e2c){return db[_0x731b('0x8f')]['upsert']({'membername':_0x2f7e2c[_0x731b('0x2a')],'UserId':_0x2f7e2c['id'],'queue_name':_0x388729[_0x731b('0x2a')],'VoiceQueueId':_0x388729['id'],'interface':_[_0x731b('0x90')](_0x2f7e2c['interface'])?util[_0x731b('0x91')](_0x731b('0x92'),_0x2f7e2c[_0x731b('0x2a')]):_0x2f7e2c['interface'],'paused':_0x2f7e2c[_0x731b('0x8d')]||![],'penalty':_0x388729[_0x731b('0x86')][_0x731b('0x87')]},{'transaction':_0x16d9b2});});return Promise['all'](_0x52e902);});});});return Promise[_0x731b('0x93')](_0x2c8de6);});return Promise[_0x731b('0x93')](_0x2fa019);})[_0x731b('0x27')](function(){return db[_0x731b('0x6a')]['findOne']({'where':{'teamId':_0x5d69ac}})[_0x731b('0x27')](function(_0x4408f2){if(_0x4408f2){var _0x89eb62=_[_0x731b('0x2c')](_0x16ffd2,function(_0x5979b3){db[_0x731b('0x6b')][_0x731b('0x94')]({'UserId':_0x5979b3,'VoicePrefixId':_0x4408f2[_0x731b('0x6c')]});});return Promise[_0x731b('0x93')](_0x89eb62);}});});});return Promise['all'](_0x161f1e)[_0x731b('0x27')](function(){return _0x5ce09c[_0x731b('0x95')](_0x16ffd2,{'transaction':_0x16d9b2})[_0x731b('0x96')](function(_0x5960fc){return _0x5960fc;});});});}})[_0x731b('0x27')](respondWithResult(_0x4bb66a,null))[_0x731b('0x44')](handleError(_0x4bb66a,null));};exports[_0x731b('0x97')]=function(_0x2957e7,_0x23c33f){var _0x1dd579=_[_0x731b('0x7d')](_0x2957e7[_0x731b('0x2f')]['ids'])?_0x2957e7[_0x731b('0x2f')][_0x731b('0x7a')]:[_0x2957e7['query'][_0x731b('0x7a')]];var _0x221046=_0x2957e7['params']['id'];return db[_0x731b('0x54')][_0x731b('0x48')]({'where':{'id':_0x221046}})[_0x731b('0x27')](handleEntityNotFound(_0x23c33f,null))[_0x731b('0x27')](function(_0x182e31){if(_0x182e31){var _0x245fe4=[_0x731b('0x7e'),_0x731b('0x7f'),_0x731b('0x80'),'Sms',_0x731b('0x81'),_0x731b('0x82'),'Whatsapp'];return db[_0x731b('0x57')][_0x731b('0x56')](function(_0x1f0aa5){var _0x32987d=_[_0x731b('0x2c')](_0x245fe4,function(_0x115b70){var _0x28bb80={'attributes':['id','name']};return _0x182e31[_0x731b('0x4c')+_0x115b70+_0x731b('0x76')](_0x28bb80)['then'](function(_0x52d0d5){var _0x24b0be=_[_0x731b('0x2c')](_0x52d0d5,function(_0x55d17b){return _0x55d17b[_0x731b('0x97')](_0x1dd579,{'transaction':_0x1f0aa5})[_0x731b('0x27')](function(){var _0x3cdb67=_[_0x731b('0x2c')](_0x1dd579,function(_0x5bc1de){socket[_0x731b('0x8a')](_0x731b('0x4b')+_0x115b70+_0x731b('0x98'),{'UserId':Number(_0x5bc1de),[_0x115b70+'QueueId']:_0x55d17b['id']});if(_0x115b70!==_0x731b('0x7e')){return;}return db[_0x731b('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x55d17b['id'],'UserId':_0x5bc1de},'transaction':_0x1f0aa5});});return Promise[_0x731b('0x93')](_0x3cdb67);});});return Promise[_0x731b('0x93')](_0x24b0be);});});return Promise['all'](_0x32987d)[_0x731b('0x27')](function(){return _0x182e31[_0x731b('0x97')](_0x1dd579,{'transaction':_0x1f0aa5});})[_0x731b('0x27')](function(){return db[_0x731b('0x6a')][_0x731b('0x78')]({'where':{'teamId':_0x221046}})[_0x731b('0x27')](function(_0x5a3501){if(_0x5a3501){var _0x5631be=_[_0x731b('0x2c')](_0x1dd579,function(_0x369572){db[_0x731b('0x6b')][_0x731b('0x55')]({'where':{'UserId':_0x369572,'VoicePrefixId':_0x5a3501[_0x731b('0x6c')]}});});return Promise[_0x731b('0x93')](_0x5631be);}});});});}})[_0x731b('0x27')](respondWithStatusCode(_0x23c33f,null))[_0x731b('0x44')](handleError(_0x23c33f,null));};exports[_0x731b('0x99')]=function(_0x5d7711,_0x4da67d,_0x23d09c){var _0x151b4a={};var _0x2264f2={};var _0x1bee9a;var _0x4d2d1b;return db[_0x731b('0x54')][_0x731b('0x78')]({'where':{'id':_0x5d7711[_0x731b('0x46')]['id']}})['then'](handleEntityNotFound(_0x4da67d,null))[_0x731b('0x27')](function(_0x5dbf4b){if(_0x5dbf4b){_0x1bee9a=_0x5dbf4b;_0x2264f2[_0x731b('0x33')]=_[_0x731b('0x30')](db['User'][_0x731b('0x2d')]);_0x2264f2['query']=_['keys'](_0x5d7711[_0x731b('0x2f')]);_0x2264f2[_0x731b('0x31')]=_[_0x731b('0x32')](_0x2264f2['model'],_0x2264f2[_0x731b('0x2f')]);_0x151b4a[_0x731b('0x34')]=_[_0x731b('0x32')](_0x2264f2[_0x731b('0x33')],qs[_0x731b('0x35')](_0x5d7711[_0x731b('0x2f')][_0x731b('0x35')]));_0x151b4a[_0x731b('0x34')]=_0x151b4a[_0x731b('0x34')]['length']?_0x151b4a[_0x731b('0x34')]:_0x2264f2[_0x731b('0x33')];_0x151b4a[_0x731b('0x38')]=qs['sort'](_0x5d7711[_0x731b('0x2f')][_0x731b('0x39')]);_0x151b4a['where']=qs['filters'](_['pick'](_0x5d7711[_0x731b('0x2f')],_0x2264f2[_0x731b('0x31')]));if(_0x5d7711[_0x731b('0x2f')][_0x731b('0x3c')]){_0x151b4a['where']=_[_0x731b('0x3d')](_0x151b4a['where'],{'$or':_[_0x731b('0x2c')](_0x151b4a[_0x731b('0x34')],function(_0x89ea1e){var _0x452023={};_0x452023[_0x89ea1e]={'$like':'%'+_0x5d7711[_0x731b('0x2f')]['filter']+'%'};return _0x452023;})});}_0x151b4a=_[_0x731b('0x3d')]({},_0x151b4a,_0x5d7711['options']);return _0x1bee9a[_0x731b('0x99')](_0x151b4a);}})[_0x731b('0x27')](function(_0x32a49b){if(_0x32a49b){_0x4d2d1b=_0x32a49b['length'];if(!_0x5d7711[_0x731b('0x2f')][_0x731b('0x36')](_0x731b('0x37'))){_0x151b4a[_0x731b('0x1f')]=qs[_0x731b('0x1f')](_0x5d7711[_0x731b('0x2f')][_0x731b('0x1f')]);_0x151b4a[_0x731b('0x22')]=qs['offset'](_0x5d7711[_0x731b('0x2f')][_0x731b('0x22')]);}return _0x1bee9a['getAgents'](_0x151b4a);}})[_0x731b('0x27')](function(_0x4389a8){if(_0x4389a8){return _0x4389a8?{'count':_0x4d2d1b,'rows':_0x4389a8}:null;}})[_0x731b('0x27')](respondWithResult(_0x4da67d,null))['catch'](handleError(_0x4da67d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5cedc7a..701cf19 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 _0xa894=['emit','hasOwnProperty','events','../../mysqldb','Team','setMaxListeners','update'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0xa894,0x1de));var _0x4a89=function(_0x521df7,_0x277fd6){_0x521df7=_0x521df7-0x0;var _0x4b57b5=_0xa894[_0x521df7];return _0x4b57b5;};'use strict';var EventEmitter=require(_0x4a89('0x0'));var Team=require(_0x4a89('0x1'))['db'][_0x4a89('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4a89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a89('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d2909){return function(_0x1b4ba1,_0x24fdd2,_0x55a89b){TeamEvents['emit'](_0x4d2909+':'+_0x1b4ba1['id'],_0x1b4ba1);TeamEvents[_0x4a89('0x5')](_0x4d2909,_0x1b4ba1);_0x55a89b(null);};}for(var e in events){if(events[_0x4a89('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xe0ed=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1eb4df,_0x3f2b65){var _0x1042b9=function(_0xc1b867){while(--_0xc1b867){_0x1eb4df['push'](_0x1eb4df['shift']());}};_0x1042b9(++_0x3f2b65);}(_0xe0ed,0x19c));var _0xde0e=function(_0x50cdba,_0x479461){_0x50cdba=_0x50cdba-0x0;var _0x2c7d1d=_0xe0ed[_0x50cdba];return _0x2c7d1d;};'use strict';var EventEmitter=require(_0xde0e('0x0'));var Team=require(_0xde0e('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xde0e('0x2')](0x0);var events={'afterCreate':_0xde0e('0x3'),'afterUpdate':_0xde0e('0x4'),'afterDestroy':_0xde0e('0x5')};function emitEvent(_0xce91a){return function(_0x531d2a,_0x386216,_0x25d24c){TeamEvents[_0xde0e('0x6')](_0xce91a+':'+_0x531d2a['id'],_0x531d2a);TeamEvents[_0xde0e('0x6')](_0xce91a,_0x531d2a);_0x25d24c(null);};}for(var e in events){if(events[_0xde0e('0x7')](e)){var event=events[e];Team[_0xde0e('0x8')](e,emitEvent(event));}}module[_0xde0e('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 748a899..7dca607 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 _0xa994=['rimraf','../../config/environment','./team.attributes','define','teams','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ed7f7,_0x5e3e5c){var _0x227d28=function(_0x2548ad){while(--_0x2548ad){_0x1ed7f7['push'](_0x1ed7f7['shift']());}};_0x227d28(++_0x5e3e5c);}(_0xa994,0x14f));var _0x4a99=function(_0x2c77ae,_0x2f874f){_0x2c77ae=_0x2c77ae-0x0;var _0x1bb2a4=_0xa994[_0x2c77ae];return _0x1bb2a4;};'use strict';var _=require('lodash');var util=require(_0x4a99('0x0'));var logger=require(_0x4a99('0x1'))(_0x4a99('0x2'));var moment=require(_0x4a99('0x3'));var BPromise=require(_0x4a99('0x4'));var rp=require(_0x4a99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a99('0x6'));var config=require(_0x4a99('0x7'));var attributes=require(_0x4a99('0x8'));module['exports']=function(_0x363119,_0x34d173){return _0x363119[_0x4a99('0x9')]('Team',attributes,{'tableName':_0x4a99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fe3=['exports','define','Team','teams','lodash','util','api','moment','bluebird','./team.attributes'];(function(_0x7a04f8,_0xc720e6){var _0x560a41=function(_0x6efb68){while(--_0x6efb68){_0x7a04f8['push'](_0x7a04f8['shift']());}};_0x560a41(++_0xc720e6);}(_0x2fe3,0xcc));var _0x32fe=function(_0x38a77a,_0x59a667){_0x38a77a=_0x38a77a-0x0;var _0x43f1d3=_0x2fe3[_0x38a77a];return _0x43f1d3;};'use strict';var _=require(_0x32fe('0x0'));var util=require(_0x32fe('0x1'));var logger=require('../../config/logger')(_0x32fe('0x2'));var moment=require(_0x32fe('0x3'));var BPromise=require(_0x32fe('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(_0x32fe('0x5'));module[_0x32fe('0x6')]=function(_0x346f85,_0x3c4397){return _0x346f85[_0x32fe('0x7')](_0x32fe('0x8'),attributes,{'tableName':_0x32fe('0x9'),'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 abfb875..68267e2 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 _0xa858=['info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then'];(function(_0x49a762,_0x366bba){var _0x55c3a5=function(_0x39bbbf){while(--_0x39bbbf){_0x49a762['push'](_0x49a762['shift']());}};_0x55c3a5(++_0x366bba);}(_0xa858,0x175));var _0x8a85=function(_0x54799,_0x139c2a){_0x54799=_0x54799-0x0;var _0x26a54b=_0xa858[_0x54799];return _0x26a54b;};'use strict';var _=require(_0x8a85('0x0'));var util=require('util');var moment=require(_0x8a85('0x1'));var BPromise=require(_0x8a85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a85('0x3'));var db=require(_0x8a85('0x4'))['db'];var utils=require(_0x8a85('0x5'));var logger=require(_0x8a85('0x6'))(_0x8a85('0x7'));var config=require('../../config/environment');var jayson=require(_0x8a85('0x8'));var client=jayson[_0x8a85('0x9')][_0x8a85('0xa')]({'port':0x232a});config[_0x8a85('0xb')]=_[_0x8a85('0xc')](config['redis'],{'host':_0x8a85('0xd'),'port':0x18eb});var socket=require(_0x8a85('0xe'))(new Redis(config[_0x8a85('0xb')]));require(_0x8a85('0xf'))[_0x8a85('0x10')](socket);function respondWithRpcPromise(_0x112501,_0x10112d,_0x21e4db){return new BPromise(function(_0x12257f,_0x43d1e4){return client[_0x8a85('0x11')](_0x112501,_0x21e4db)[_0x8a85('0x12')](function(_0x38affa){logger[_0x8a85('0x13')](_0x8a85('0x14'),_0x10112d,_0x8a85('0x15'));logger[_0x8a85('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x10112d,_0x8a85('0x15'),JSON[_0x8a85('0x17')](_0x38affa));if(_0x38affa[_0x8a85('0x18')]){if(_0x38affa[_0x8a85('0x18')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x10112d,_0x38affa[_0x8a85('0x18')]['message']);return _0x43d1e4(_0x38affa[_0x8a85('0x18')][_0x8a85('0x19')]);}logger[_0x8a85('0x18')](_0x8a85('0x14'),_0x10112d,_0x38affa['error'][_0x8a85('0x19')]);return _0x12257f(_0x38affa[_0x8a85('0x18')][_0x8a85('0x19')]);}else{logger['info'](_0x8a85('0x14'),_0x10112d,_0x8a85('0x15'));_0x12257f(_0x38affa[_0x8a85('0x1a')][_0x8a85('0x19')]);}})[_0x8a85('0x1b')](function(_0x5b3f48){logger[_0x8a85('0x18')](_0x8a85('0x14'),_0x10112d,_0x5b3f48);_0x43d1e4(_0x5b3f48);});});} \ No newline at end of file +var _0x5f60=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','socket.io-emitter','redis','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f60,0x182));var _0x05f6=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x5f60[_0x54b283];return _0x2462b3;};'use strict';var _=require(_0x05f6('0x0'));var util=require(_0x05f6('0x1'));var moment=require(_0x05f6('0x2'));var BPromise=require(_0x05f6('0x3'));var rs=require(_0x05f6('0x4'));var fs=require('fs');var Redis=require(_0x05f6('0x5'));var db=require(_0x05f6('0x6'))['db'];var utils=require(_0x05f6('0x7'));var logger=require(_0x05f6('0x8'))(_0x05f6('0x9'));var config=require('../../config/environment');var jayson=require(_0x05f6('0xa'));var client=jayson[_0x05f6('0xb')][_0x05f6('0xc')]({'port':0x232a});config['redis']=_[_0x05f6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x05f6('0xe'))(new Redis(config[_0x05f6('0xf')]));require('./team.socket')[_0x05f6('0x10')](socket);function respondWithRpcPromise(_0xeb9b3d,_0x5ef35e,_0x116561){return new BPromise(function(_0x54a4eb,_0x15a524){return client[_0x05f6('0x11')](_0xeb9b3d,_0x116561)[_0x05f6('0x12')](function(_0x30dc17){logger['info'](_0x05f6('0x13'),_0x5ef35e,_0x05f6('0x14'));logger[_0x05f6('0x15')](_0x05f6('0x16'),_0x5ef35e,'request\x20sent',JSON[_0x05f6('0x17')](_0x30dc17));if(_0x30dc17[_0x05f6('0x18')]){if(_0x30dc17[_0x05f6('0x18')][_0x05f6('0x19')]===0x1f4){logger[_0x05f6('0x18')]('Team,\x20%s,\x20%s',_0x5ef35e,_0x30dc17[_0x05f6('0x18')][_0x05f6('0x1a')]);return _0x15a524(_0x30dc17[_0x05f6('0x18')][_0x05f6('0x1a')]);}logger['error']('Team,\x20%s,\x20%s',_0x5ef35e,_0x30dc17['error'][_0x05f6('0x1a')]);return _0x54a4eb(_0x30dc17['error']['message']);}else{logger[_0x05f6('0x1b')](_0x05f6('0x13'),_0x5ef35e,_0x05f6('0x14'));_0x54a4eb(_0x30dc17[_0x05f6('0x1c')][_0x05f6('0x1a')]);}})[_0x05f6('0x1d')](function(_0x4de47d){logger[_0x05f6('0x18')]('Team,\x20%s,\x20%s',_0x5ef35e,_0x4de47d);_0x15a524(_0x4de47d);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 7213072..4f3cf82 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 _0xf4d4=['remove','emit','removeListener','register','length','./team.events','save'];(function(_0x59b661,_0xf20b42){var _0x2bd02c=function(_0x52f4fa){while(--_0x52f4fa){_0x59b661['push'](_0x59b661['shift']());}};_0x2bd02c(++_0xf20b42);}(_0xf4d4,0xf3));var _0x4f4d=function(_0x5381cb,_0x87467c){_0x5381cb=_0x5381cb-0x0;var _0x5c5715=_0xf4d4[_0x5381cb];return _0x5c5715;};'use strict';var TeamEvents=require(_0x4f4d('0x0'));var events=[_0x4f4d('0x1'),_0x4f4d('0x2'),'update'];function createListener(_0x81e6a1,_0x20a196){return function(_0x105103){_0x20a196[_0x4f4d('0x3')](_0x81e6a1,_0x105103);};}function removeListener(_0x46e994,_0x1654c8){return function(){TeamEvents[_0x4f4d('0x4')](_0x46e994,_0x1654c8);};}exports[_0x4f4d('0x5')]=function(_0x4f43b7){for(var _0x6c46f1=0x0,_0x4e2c31=events[_0x4f4d('0x6')];_0x6c46f1<_0x4e2c31;_0x6c46f1++){var _0x4cab19=events[_0x6c46f1];var _0x4d3b45=createListener('team:'+_0x4cab19,_0x4f43b7);TeamEvents['on'](_0x4cab19,_0x4d3b45);}}; \ No newline at end of file +var _0x3609=['remove','update','removeListener','length','team:','./team.events','save'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3609,0x101));var _0x9360=function(_0x1f5269,_0xb4c12e){_0x1f5269=_0x1f5269-0x0;var _0x109f0e=_0x3609[_0x1f5269];return _0x109f0e;};'use strict';var TeamEvents=require(_0x9360('0x0'));var events=[_0x9360('0x1'),_0x9360('0x2'),_0x9360('0x3')];function createListener(_0xfd6fd7,_0x42aad5){return function(_0x133b7c){_0x42aad5['emit'](_0xfd6fd7,_0x133b7c);};}function removeListener(_0x28376e,_0x24c531){return function(){TeamEvents[_0x9360('0x4')](_0x28376e,_0x24c531);};}exports['register']=function(_0x5548c1){for(var _0x48aeae=0x0,_0x11fe15=events[_0x9360('0x5')];_0x48aeae<_0x11fe15;_0x48aeae++){var _0x50e967=events[_0x48aeae];var _0x2a67be=createListener(_0x9360('0x6')+_0x50e967,_0x5548c1);TeamEvents['on'](_0x50e967,_0x2a67be);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index d33ffc9..3b8b9d2 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 _0x0b30=['sequelize','exports','INTEGER'];(function(_0x803af5,_0x57beec){var _0x3f70d5=function(_0x81cbca){while(--_0x81cbca){_0x803af5['push'](_0x803af5['shift']());}};_0x3f70d5(++_0x57beec);}(_0x0b30,0x1a7));var _0x00b3=function(_0x42ef57,_0x54b80a){_0x42ef57=_0x42ef57-0x0;var _0x353f41=_0x0b30[_0x42ef57];return _0x353f41;};'use strict';var Sequelize=require(_0x00b3('0x0'));module[_0x00b3('0x1')]={'TeamId':{'type':Sequelize[_0x00b3('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x00b3('0x2')]}}; \ No newline at end of file +var _0x6343=['INTEGER','exports'];(function(_0x192346,_0x5a117f){var _0x91e4cc=function(_0x226b50){while(--_0x226b50){_0x192346['push'](_0x192346['shift']());}};_0x91e4cc(++_0x5a117f);}(_0x6343,0x1e9));var _0x3634=function(_0xe3f2fd,_0x28430c){_0xe3f2fd=_0xe3f2fd-0x0;var _0x5577f7=_0x6343[_0xe3f2fd];return _0x5577f7;};'use strict';var Sequelize=require('sequelize');module[_0x3634('0x0')]={'TeamId':{'type':Sequelize[_0x3634('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x3634('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index f7b1f36..88888b7 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 _0xbd5f=['./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x51c6a5,_0x11950b){var _0x5e753a=function(_0x211f22){while(--_0x211f22){_0x51c6a5['push'](_0x51c6a5['shift']());}};_0x5e753a(++_0x11950b);}(_0xbd5f,0x1c7));var _0xfbd5=function(_0x56c6d4,_0x2ad88f){_0x56c6d4=_0x56c6d4-0x0;var _0xbca8e8=_0xbd5f[_0x56c6d4];return _0xbca8e8;};'use strict';var _=require(_0xfbd5('0x0'));var util=require(_0xfbd5('0x1'));var logger=require(_0xfbd5('0x2'))('api');var moment=require(_0xfbd5('0x3'));var BPromise=require('bluebird');var rp=require(_0xfbd5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbd5('0x5'));var config=require(_0xfbd5('0x6'));var attributes=require(_0xfbd5('0x7'));module[_0xfbd5('0x8')]=function(_0x26f5ea,_0x9df06e){return _0x26f5ea[_0xfbd5('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0xfbd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf69c=['define','TeamVoicePrefix','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x2e8d01,_0x12fe7a){var _0x92efe5=function(_0x4fb17a){while(--_0x4fb17a){_0x2e8d01['push'](_0x2e8d01['shift']());}};_0x92efe5(++_0x12fe7a);}(_0xf69c,0x1e2));var _0xcf69=function(_0x1d5895,_0x1acd4a){_0x1d5895=_0x1d5895-0x0;var _0x12977e=_0xf69c[_0x1d5895];return _0x12977e;};'use strict';var _=require(_0xcf69('0x0'));var util=require(_0xcf69('0x1'));var logger=require(_0xcf69('0x2'))(_0xcf69('0x3'));var moment=require('moment');var BPromise=require(_0xcf69('0x4'));var rp=require(_0xcf69('0x5'));var fs=require('fs');var path=require(_0xcf69('0x6'));var rimraf=require('rimraf');var config=require(_0xcf69('0x7'));var attributes=require(_0xcf69('0x8'));module[_0xcf69('0x9')]=function(_0x2e8d3,_0x2ec528){return _0x2e8d3[_0xcf69('0xa')](_0xcf69('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 04a6590..2abf12f 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5b9285,_0x3c6b59){var _0x56c407=function(_0x30532e){while(--_0x30532e){_0x5b9285['push'](_0x5b9285['shift']());}};_0x56c407(++_0x3c6b59);}(_0x70e0,0x17b));var _0x070e=function(_0x209324,_0x311cf2){_0x209324=_0x209324-0x0;var _0x536c37=_0x70e0[_0x209324];return _0x536c37;};'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 a53eac3..e0c2420 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 _0x20d7=['INTEGER'];(function(_0xcddd86,_0x515eec){var _0x17a53f=function(_0x2b241f){while(--_0x2b241f){_0xcddd86['push'](_0xcddd86['shift']());}};_0x17a53f(++_0x515eec);}(_0x20d7,0x146));var _0x720d=function(_0x458e8d,_0x3a36ae){_0x458e8d=_0x458e8d-0x0;var _0x153306=_0x20d7[_0x458e8d];return _0x153306;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x720d('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcbd1=['exports','INTEGER','sequelize'];(function(_0x1c5dc8,_0x4b508e){var _0x59672f=function(_0x498e01){while(--_0x498e01){_0x1c5dc8['push'](_0x1c5dc8['shift']());}};_0x59672f(++_0x4b508e);}(_0xcbd1,0x15b));var _0x1cbd=function(_0x32c09f,_0x5f28be){_0x32c09f=_0x32c09f-0x0;var _0x5985d3=_0xcbd1[_0x32c09f];return _0x5985d3;};'use strict';var Sequelize=require(_0x1cbd('0x0'));module[_0x1cbd('0x1')]={'penalty':{'type':Sequelize[_0x1cbd('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 6960d7a..9980745 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 _0xb2b5=['exports','define','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x55ccd3,_0x329758){var _0x2d26dd=function(_0x1bcda0){while(--_0x1bcda0){_0x55ccd3['push'](_0x55ccd3['shift']());}};_0x2d26dd(++_0x329758);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb2b5[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b2b('0x0'));var BPromise=require(_0x5b2b('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5b2b('0x2'));var config=require(_0x5b2b('0x3'));var attributes=require(_0x5b2b('0x4'));module[_0x5b2b('0x5')]=function(_0x49d9f6,_0x30c3e2){return _0x49d9f6[_0x5b2b('0x6')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dd5=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0x3dd5,0x73));var _0x53dd=function(_0x487c81,_0x137867){_0x487c81=_0x487c81-0x0;var _0xca71dc=_0x3dd5[_0x487c81];return _0xca71dc;};'use strict';var _=require(_0x53dd('0x0'));var util=require('util');var logger=require(_0x53dd('0x1'))(_0x53dd('0x2'));var moment=require(_0x53dd('0x3'));var BPromise=require(_0x53dd('0x4'));var rp=require(_0x53dd('0x5'));var fs=require('fs');var path=require(_0x53dd('0x6'));var rimraf=require(_0x53dd('0x7'));var config=require(_0x53dd('0x8'));var attributes=require(_0x53dd('0x9'));module['exports']=function(_0x3c8f9e,_0x26c218){return _0x3c8f9e[_0x53dd('0xa')](_0x53dd('0xb'),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 5b91222..5d832ca 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 _0x5e0e=['randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x5e0e,0x147));var _0xe5e0=function(_0x15fc07,_0x41cc0c){_0x15fc07=_0x15fc07-0x0;var _0x3d2c0f=_0x5e0e[_0x15fc07];return _0x3d2c0f;};'use strict';var _=require(_0xe5e0('0x0'));var util=require('util');var moment=require(_0xe5e0('0x1'));var BPromise=require(_0xe5e0('0x2'));var rs=require(_0xe5e0('0x3'));var fs=require('fs');var Redis=require(_0xe5e0('0x4'));var db=require(_0xe5e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5e0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe5e0('0x7'));var client=jayson[_0xe5e0('0x8')][_0xe5e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11f8e2,_0x3564ab,_0x1a817e){return new BPromise(function(_0xa07105,_0x56610e){return client[_0xe5e0('0xa')](_0x11f8e2,_0x1a817e)[_0xe5e0('0xb')](function(_0x577d0f){logger[_0xe5e0('0xc')](_0xe5e0('0xd'),_0x3564ab,_0xe5e0('0xe'));logger[_0xe5e0('0xf')](_0xe5e0('0x10'),_0x3564ab,'request\x20sent',JSON[_0xe5e0('0x11')](_0x577d0f));if(_0x577d0f[_0xe5e0('0x12')]){if(_0x577d0f[_0xe5e0('0x12')][_0xe5e0('0x13')]===0x1f4){logger[_0xe5e0('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3564ab,_0x577d0f[_0xe5e0('0x12')]['message']);return _0x56610e(_0x577d0f['error']['message']);}logger[_0xe5e0('0x12')](_0xe5e0('0xd'),_0x3564ab,_0x577d0f['error'][_0xe5e0('0x14')]);return _0xa07105(_0x577d0f['error'][_0xe5e0('0x14')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x3564ab,_0xe5e0('0xe'));_0xa07105(_0x577d0f[_0xe5e0('0x15')][_0xe5e0('0x14')]);}})['catch'](function(_0x37d605){logger[_0xe5e0('0x12')](_0xe5e0('0xd'),_0x3564ab,_0x37d605);_0x56610e(_0x37d605);});});} \ No newline at end of file +var _0xd392=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util'];(function(_0x185647,_0xd1ea93){var _0x12ed4a=function(_0x121a25){while(--_0x121a25){_0x185647['push'](_0x185647['shift']());}};_0x12ed4a(++_0xd1ea93);}(_0xd392,0x7c));var _0x2d39=function(_0x3eca98,_0x2ff3fe){_0x3eca98=_0x3eca98-0x0;var _0x5cf378=_0xd392[_0x3eca98];return _0x5cf378;};'use strict';var _=require(_0x2d39('0x0'));var util=require(_0x2d39('0x1'));var moment=require(_0x2d39('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d39('0x3'));var fs=require('fs');var Redis=require(_0x2d39('0x4'));var db=require(_0x2d39('0x5'))['db'];var utils=require(_0x2d39('0x6'));var logger=require(_0x2d39('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d39('0x8'));var client=jayson[_0x2d39('0x9')][_0x2d39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459203,_0x10344d,_0x44adc1){return new BPromise(function(_0x2376e4,_0x351e24){return client[_0x2d39('0xb')](_0x459203,_0x44adc1)[_0x2d39('0xc')](function(_0x35503f){logger[_0x2d39('0xd')](_0x2d39('0xe'),_0x10344d,_0x2d39('0xf'));logger[_0x2d39('0x10')](_0x2d39('0x11'),_0x10344d,_0x2d39('0xf'),JSON['stringify'](_0x35503f));if(_0x35503f['error']){if(_0x35503f[_0x2d39('0x12')][_0x2d39('0x13')]===0x1f4){logger[_0x2d39('0x12')](_0x2d39('0xe'),_0x10344d,_0x35503f[_0x2d39('0x12')][_0x2d39('0x14')]);return _0x351e24(_0x35503f[_0x2d39('0x12')]['message']);}logger['error'](_0x2d39('0xe'),_0x10344d,_0x35503f['error'][_0x2d39('0x14')]);return _0x2376e4(_0x35503f[_0x2d39('0x12')][_0x2d39('0x14')]);}else{logger[_0x2d39('0xd')](_0x2d39('0xe'),_0x10344d,_0x2d39('0xf'));_0x2376e4(_0x35503f['result'][_0x2d39('0x14')]);}})['catch'](function(_0x45fba3){logger[_0x2d39('0x12')](_0x2d39('0xe'),_0x10344d,_0x45fba3);_0x351e24(_0x45fba3);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 92d3660..065415e 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 _0xaf6e=['put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','post','create'];(function(_0x52ad14,_0x633d3){var _0xf951b7=function(_0x2c8992){while(--_0x2c8992){_0x52ad14['push'](_0x52ad14['shift']());}};_0xf951b7(++_0x633d3);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x4ad0fb,_0x1f5006){_0x4ad0fb=_0x4ad0fb-0x0;var _0x3a8780=_0xaf6e[_0x4ad0fb];return _0x3a8780;};'use strict';var multer=require(_0xeaf6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeaf6('0x1'));var express=require(_0xeaf6('0x2'));var router=express[_0xeaf6('0x3')]();var fs_extra=require(_0xeaf6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeaf6('0x5'));var config=require(_0xeaf6('0x6'));var controller=require(_0xeaf6('0x7'));router[_0xeaf6('0x8')]('/',auth[_0xeaf6('0x9')](),controller['index']);router['get']('/:id',auth[_0xeaf6('0x9')](),controller['show']);router[_0xeaf6('0xa')]('/',auth['isAuthenticated'](),controller[_0xeaf6('0xb')]);router[_0xeaf6('0xc')](_0xeaf6('0xd'),auth[_0xeaf6('0x9')](),controller[_0xeaf6('0xe')]);router[_0xeaf6('0xf')](_0xeaf6('0xd'),auth[_0xeaf6('0x9')](),controller[_0xeaf6('0x10')]);module[_0xeaf6('0x11')]=router; \ No newline at end of file +var _0x6dc0=['get','/:id','show','post','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','isAuthenticated'];(function(_0x409ad2,_0x5129c1){var _0x595b5f=function(_0x592974){while(--_0x592974){_0x409ad2['push'](_0x409ad2['shift']());}};_0x595b5f(++_0x5129c1);}(_0x6dc0,0xb6));var _0x06dc=function(_0x429f47,_0x231e8a){_0x429f47=_0x429f47-0x0;var _0xaa330b=_0x6dc0[_0x429f47];return _0xaa330b;};'use strict';var multer=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var path=require(_0x06dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x06dc('0x3'));var router=express[_0x06dc('0x4')]();var fs_extra=require(_0x06dc('0x5'));var auth=require(_0x06dc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x06dc('0x7'));var controller=require(_0x06dc('0x8'));router['get']('/',auth[_0x06dc('0x9')](),controller['index']);router[_0x06dc('0xa')](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller[_0x06dc('0xc')]);router[_0x06dc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller['update']);router[_0x06dc('0xe')](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller[_0x06dc('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 41b86a6..a1b4c0d 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 _0x27d3=['TEXT','sequelize','exports','STRING'];(function(_0x4d18d4,_0x28df77){var _0x487995=function(_0xb66b7a){while(--_0xb66b7a){_0x4d18d4['push'](_0x4d18d4['shift']());}};_0x487995(++_0x28df77);}(_0x27d3,0xf5));var _0x327d=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x27d3[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x327d('0x0'));module[_0x327d('0x1')]={'name':{'type':Sequelize[_0x327d('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x327d('0x3')]}}; \ No newline at end of file +var _0x0033=['sequelize','exports','STRING','TEXT'];(function(_0x40a043,_0xc7a013){var _0x17b279=function(_0xae5129){while(--_0xae5129){_0x40a043['push'](_0x40a043['shift']());}};_0x17b279(++_0xc7a013);}(_0x0033,0xb8));var _0x3003=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0x0033[_0x2f57b2];return _0x5ace77;};'use strict';var Sequelize=require(_0x3003('0x0'));module[_0x3003('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3003('0x2')]},'html':{'type':Sequelize[_0x3003('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 00cc3f1..f59084b 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 _0xa59a=['findAll','rows','show','params','length','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','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','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','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','Template','includeAll','include'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa59a,0x113));var _0xaa59=function(_0x411da2,_0x2fd462){_0x411da2=_0x411da2-0x0;var _0x2c4954=_0xa59a[_0x411da2];return _0x2c4954;};'use strict';var emlformat=require(_0xaa59('0x0'));var rimraf=require(_0xaa59('0x1'));var zipdir=require(_0xaa59('0x2'));var jsonpatch=require(_0xaa59('0x3'));var rp=require(_0xaa59('0x4'));var moment=require(_0xaa59('0x5'));var BPromise=require(_0xaa59('0x6'));var Mustache=require('mustache');var util=require(_0xaa59('0x7'));var path=require(_0xaa59('0x8'));var sox=require(_0xaa59('0x9'));var csv=require(_0xaa59('0xa'));var ejs=require(_0xaa59('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa59('0xc'));var jsforce=require(_0xaa59('0xd'));var deskjs=require(_0xaa59('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaa59('0xf'));var Papa=require(_0xaa59('0x10'));var Redis=require(_0xaa59('0x11'));var authService=require(_0xaa59('0x12'));var qs=require(_0xaa59('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa59('0x14'))('api');var utils=require(_0xaa59('0x15'));var config=require(_0xaa59('0x16'));var licenseUtil=require(_0xaa59('0x17'));var db=require(_0xaa59('0x18'))['db'];function respondWithStatusCode(_0x35964d,_0x59df7d){_0x59df7d=_0x59df7d||0xcc;return function(_0xdc0d90){if(_0xdc0d90){return _0x35964d[_0xaa59('0x19')](_0x59df7d);}return _0x35964d[_0xaa59('0x1a')](_0x59df7d)[_0xaa59('0x1b')]();};}function respondWithResult(_0xb8f902,_0x595984){_0x595984=_0x595984||0xc8;return function(_0x2b4826){if(_0x2b4826){return _0xb8f902[_0xaa59('0x1a')](_0x595984)[_0xaa59('0x1c')](_0x2b4826);}};}function respondWithFilteredResult(_0x53f40b,_0x595711){return function(_0xeb1f43){if(_0xeb1f43){var _0xe955a2=typeof _0x595711[_0xaa59('0x1d')]==='undefined'&&typeof _0x595711[_0xaa59('0x1e')]===_0xaa59('0x1f');var _0x3ec4f3=_0xeb1f43[_0xaa59('0x20')];var _0x2c4639=_0xe955a2?0x0:_0x595711['offset'];var _0x3cf160=_0xe955a2?_0xeb1f43['count']:_0x595711[_0xaa59('0x1d')]+_0x595711['limit'];var _0x4feb2e;if(_0x3cf160>=_0x3ec4f3){_0x3cf160=_0x3ec4f3;_0x4feb2e=0xc8;}else{_0x4feb2e=0xce;}_0x53f40b[_0xaa59('0x1a')](_0x4feb2e);return _0x53f40b[_0xaa59('0x21')](_0xaa59('0x22'),_0x2c4639+'-'+_0x3cf160+'/'+_0x3ec4f3)[_0xaa59('0x1c')](_0xeb1f43);}return null;};}function patchUpdates(_0x2be633){return function(_0x479455){try{jsonpatch[_0xaa59('0x23')](_0x479455,_0x2be633,!![]);}catch(_0x1a071c){return BPromise[_0xaa59('0x24')](_0x1a071c);}return _0x479455['save']();};}function saveUpdates(_0x17ae91,_0x509b0f){return function(_0x1f327a){if(_0x1f327a){return _0x1f327a['update'](_0x17ae91)[_0xaa59('0x25')](function(_0x5bdd04){return _0x5bdd04;});}return null;};}function removeEntity(_0x2bbf7a,_0x2d229b){return function(_0x2acd02){if(_0x2acd02){return _0x2acd02[_0xaa59('0x26')]()['then'](function(){var _0x37e182=_0x2acd02[_0xaa59('0x27')]({'plain':!![]});var _0x494bc0=_0xaa59('0x28');return db[_0xaa59('0x29')]['destroy']({'where':{'type':_0x494bc0,'resourceId':_0x37e182['id']}})['then'](function(){return _0x2acd02;});})[_0xaa59('0x25')](function(){_0x2bbf7a['status'](0xcc)[_0xaa59('0x1b')]();});}};}function handleEntityNotFound(_0x1de675,_0x357f49){return function(_0x4d29ea){if(!_0x4d29ea){_0x1de675[_0xaa59('0x19')](0x194);}return _0x4d29ea;};}function handleError(_0x4fa31a,_0x388d56){_0x388d56=_0x388d56||0x1f4;return function(_0xf270ce){logger[_0xaa59('0x2a')](_0xf270ce[_0xaa59('0x2b')]);if(_0xf270ce['name']){delete _0xf270ce[_0xaa59('0x2c')];}_0x4fa31a['status'](_0x388d56)['send'](_0xf270ce);};}exports[_0xaa59('0x2d')]=function(_0x599c6d,_0x31d30d){var _0x4e7eba={},_0x38223b={},_0x90a510={'count':0x0,'rows':[]};var _0x1735cd=_['map'](db['Template'][_0xaa59('0x2e')],function(_0x476aa3){return{'name':_0x476aa3[_0xaa59('0x2f')],'type':_0x476aa3[_0xaa59('0x30')]['key']};});_0x38223b[_0xaa59('0x31')]=_[_0xaa59('0x32')](_0x1735cd,_0xaa59('0x2c'));_0x38223b[_0xaa59('0x33')]=_[_0xaa59('0x34')](_0x599c6d['query']);_0x38223b['filters']=_[_0xaa59('0x35')](_0x38223b['model'],_0x38223b['query']);_0x4e7eba[_0xaa59('0x36')]=_['intersection'](_0x38223b[_0xaa59('0x31')],qs['fields'](_0x599c6d[_0xaa59('0x33')][_0xaa59('0x37')]));_0x4e7eba[_0xaa59('0x36')]=_0x4e7eba['attributes']['length']?_0x4e7eba[_0xaa59('0x36')]:_0x38223b[_0xaa59('0x31')];if(!_0x599c6d[_0xaa59('0x33')][_0xaa59('0x38')](_0xaa59('0x39'))){_0x4e7eba[_0xaa59('0x1e')]=qs['limit'](_0x599c6d[_0xaa59('0x33')][_0xaa59('0x1e')]);_0x4e7eba[_0xaa59('0x1d')]=qs['offset'](_0x599c6d['query'][_0xaa59('0x1d')]);}_0x4e7eba[_0xaa59('0x3a')]=qs[_0xaa59('0x3b')](_0x599c6d['query'][_0xaa59('0x3b')]);_0x4e7eba['where']=qs[_0xaa59('0x3c')](_[_0xaa59('0x3d')](_0x599c6d['query'],_0x38223b[_0xaa59('0x3c')]),_0x1735cd);if(_0x599c6d[_0xaa59('0x33')]['filter']){_0x4e7eba['where']=_['merge'](_0x4e7eba[_0xaa59('0x3e')],{'$or':_[_0xaa59('0x32')](_0x1735cd,function(_0x133d3c){if(_0x133d3c['type']!==_0xaa59('0x3f')){var _0x405ef={};_0x405ef[_0x133d3c[_0xaa59('0x2c')]]={'$like':'%'+_0x599c6d[_0xaa59('0x33')][_0xaa59('0x40')]+'%'};return _0x405ef;}})});}_0x4e7eba=_[_0xaa59('0x41')]({},_0x4e7eba,_0x599c6d['options']);var _0x75785c={'where':_0x4e7eba[_0xaa59('0x3e')]};return db[_0xaa59('0x42')][_0xaa59('0x20')](_0x75785c)[_0xaa59('0x25')](function(_0x57cf10){_0x90a510[_0xaa59('0x20')]=_0x57cf10;if(_0x599c6d[_0xaa59('0x33')][_0xaa59('0x43')]){_0x4e7eba[_0xaa59('0x44')]=[{'all':!![]}];}return db[_0xaa59('0x42')][_0xaa59('0x45')](_0x4e7eba);})[_0xaa59('0x25')](function(_0x5c4719){_0x90a510[_0xaa59('0x46')]=_0x5c4719;return _0x90a510;})['then'](respondWithFilteredResult(_0x31d30d,_0x4e7eba))['catch'](handleError(_0x31d30d,null));};exports[_0xaa59('0x47')]=function(_0xc18c55,_0x6e053e){var _0x195752={'raw':!![],'where':{'id':_0xc18c55[_0xaa59('0x48')]['id']}},_0x1575c7={};_0x1575c7['model']=_[_0xaa59('0x34')](db[_0xaa59('0x42')][_0xaa59('0x2e')]);_0x1575c7['query']=_['keys'](_0xc18c55[_0xaa59('0x33')]);_0x1575c7[_0xaa59('0x3c')]=_[_0xaa59('0x35')](_0x1575c7['model'],_0x1575c7['query']);_0x195752[_0xaa59('0x36')]=_[_0xaa59('0x35')](_0x1575c7[_0xaa59('0x31')],qs['fields'](_0xc18c55['query'][_0xaa59('0x37')]));_0x195752[_0xaa59('0x36')]=_0x195752[_0xaa59('0x36')][_0xaa59('0x49')]?_0x195752[_0xaa59('0x36')]:_0x1575c7['model'];if(_0xc18c55['query'][_0xaa59('0x43')]){_0x195752[_0xaa59('0x44')]=[{'all':!![]}];}_0x195752=_[_0xaa59('0x41')]({},_0x195752,_0xc18c55['options']);return db[_0xaa59('0x42')]['find'](_0x195752)[_0xaa59('0x25')](handleEntityNotFound(_0x6e053e,null))['then'](respondWithResult(_0x6e053e,null))[_0xaa59('0x4a')](handleError(_0x6e053e,null));};exports[_0xaa59('0x4b')]=function(_0xf0d4ab,_0x4e73a1){return db[_0xaa59('0x42')][_0xaa59('0x4b')](_0xf0d4ab[_0xaa59('0x4c')],{})[_0xaa59('0x25')](function(_0x53b10d){var _0x136228=_0xf0d4ab[_0xaa59('0x4d')][_0xaa59('0x27')]({'plain':!![]});if(!_0x136228)throw new Error(_0xaa59('0x4e'));if(_0x136228[_0xaa59('0x4f')]===_0xaa59('0x4d')){var _0x499264=_0x53b10d[_0xaa59('0x27')]({'plain':!![]});var _0x1f0da3=_0xaa59('0x28');return db[_0xaa59('0x50')]['find']({'where':{'name':_0x1f0da3,'userProfileId':_0x136228[_0xaa59('0x51')]},'raw':!![]})[_0xaa59('0x25')](function(_0x8a3c7){if(_0x8a3c7&&_0x8a3c7[_0xaa59('0x52')]===0x0){return db[_0xaa59('0x29')][_0xaa59('0x4b')]({'name':_0x499264[_0xaa59('0x2c')],'resourceId':_0x499264['id'],'type':_0x8a3c7[_0xaa59('0x2c')],'sectionId':_0x8a3c7['id']},{})[_0xaa59('0x25')](function(){return _0x53b10d;});}else{return _0x53b10d;}})[_0xaa59('0x4a')](function(_0x3fc9b0){logger[_0xaa59('0x2a')](_0xaa59('0x53'),_0x3fc9b0);throw _0x3fc9b0;});}return _0x53b10d;})['then'](respondWithResult(_0x4e73a1,0xc9))['catch'](handleError(_0x4e73a1,null));};exports[_0xaa59('0x54')]=function(_0x3c6530,_0x2db18e){if(_0x3c6530[_0xaa59('0x4c')]['id']){delete _0x3c6530[_0xaa59('0x4c')]['id'];}return db['Template'][_0xaa59('0x55')]({'where':{'id':_0x3c6530[_0xaa59('0x48')]['id']}})['then'](handleEntityNotFound(_0x2db18e,null))[_0xaa59('0x25')](saveUpdates(_0x3c6530['body'],null))['then'](respondWithResult(_0x2db18e,null))[_0xaa59('0x4a')](handleError(_0x2db18e,null));};exports[_0xaa59('0x26')]=function(_0x2da972,_0x5c2f46){return db[_0xaa59('0x42')][_0xaa59('0x55')]({'where':{'id':_0x2da972[_0xaa59('0x48')]['id']}})[_0xaa59('0x25')](handleEntityNotFound(_0x5c2f46,null))[_0xaa59('0x25')](removeEntity(_0x5c2f46,null))[_0xaa59('0x4a')](handleError(_0x5c2f46,null));}; \ No newline at end of file +var _0x0fcc=['fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','end','error','stack','name','send','index','map','Template','rawAttributes','type','key','model','query','keys','intersection','attributes'];(function(_0x3af055,_0x3149a9){var _0x4a60db=function(_0x1308c1){while(--_0x1308c1){_0x3af055['push'](_0x3af055['shift']());}};_0x4a60db(++_0x3149a9);}(_0x0fcc,0x127));var _0xc0fc=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x0fcc[_0x36bf88];return _0x332914;};'use strict';var emlformat=require(_0xc0fc('0x0'));var rimraf=require(_0xc0fc('0x1'));var zipdir=require(_0xc0fc('0x2'));var jsonpatch=require(_0xc0fc('0x3'));var rp=require(_0xc0fc('0x4'));var moment=require(_0xc0fc('0x5'));var BPromise=require(_0xc0fc('0x6'));var Mustache=require(_0xc0fc('0x7'));var util=require(_0xc0fc('0x8'));var path=require(_0xc0fc('0x9'));var sox=require(_0xc0fc('0xa'));var csv=require(_0xc0fc('0xb'));var ejs=require(_0xc0fc('0xc'));var fs=require('fs');var fs_extra=require(_0xc0fc('0xd'));var _=require('lodash');var squel=require(_0xc0fc('0xe'));var crypto=require(_0xc0fc('0xf'));var jsforce=require(_0xc0fc('0x10'));var deskjs=require(_0xc0fc('0x11'));var toCsv=require(_0xc0fc('0xb'));var querystring=require(_0xc0fc('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc0fc('0x13'));var qs=require(_0xc0fc('0x14'));var as=require(_0xc0fc('0x15'));var hardwareService=require(_0xc0fc('0x16'));var logger=require(_0xc0fc('0x17'))(_0xc0fc('0x18'));var utils=require('../../config/utils');var config=require(_0xc0fc('0x19'));var licenseUtil=require(_0xc0fc('0x1a'));var db=require(_0xc0fc('0x1b'))['db'];function respondWithStatusCode(_0x59847d,_0x5dd56a){_0x5dd56a=_0x5dd56a||0xcc;return function(_0x371289){if(_0x371289){return _0x59847d[_0xc0fc('0x1c')](_0x5dd56a);}return _0x59847d[_0xc0fc('0x1d')](_0x5dd56a)['end']();};}function respondWithResult(_0x350190,_0x3fd2df){_0x3fd2df=_0x3fd2df||0xc8;return function(_0x55558b){if(_0x55558b){return _0x350190[_0xc0fc('0x1d')](_0x3fd2df)[_0xc0fc('0x1e')](_0x55558b);}};}function respondWithFilteredResult(_0x5330ed,_0x5e78ed){return function(_0x3f16a2){if(_0x3f16a2){var _0x380c41=typeof _0x5e78ed[_0xc0fc('0x1f')]===_0xc0fc('0x20')&&typeof _0x5e78ed['limit']===_0xc0fc('0x20');var _0x56083d=_0x3f16a2[_0xc0fc('0x21')];var _0x2cc026=_0x380c41?0x0:_0x5e78ed[_0xc0fc('0x1f')];var _0xed03e6=_0x380c41?_0x3f16a2[_0xc0fc('0x21')]:_0x5e78ed['offset']+_0x5e78ed[_0xc0fc('0x22')];var _0x5d2797;if(_0xed03e6>=_0x56083d){_0xed03e6=_0x56083d;_0x5d2797=0xc8;}else{_0x5d2797=0xce;}_0x5330ed[_0xc0fc('0x1d')](_0x5d2797);return _0x5330ed[_0xc0fc('0x23')](_0xc0fc('0x24'),_0x2cc026+'-'+_0xed03e6+'/'+_0x56083d)[_0xc0fc('0x1e')](_0x3f16a2);}return null;};}function patchUpdates(_0x4d599a){return function(_0x5d9b13){try{jsonpatch[_0xc0fc('0x25')](_0x5d9b13,_0x4d599a,!![]);}catch(_0x4878de){return BPromise[_0xc0fc('0x26')](_0x4878de);}return _0x5d9b13[_0xc0fc('0x27')]();};}function saveUpdates(_0x1fdb75,_0x257add){return function(_0x1fd2c1){if(_0x1fd2c1){return _0x1fd2c1[_0xc0fc('0x28')](_0x1fdb75)[_0xc0fc('0x29')](function(_0x47bc42){return _0x47bc42;});}return null;};}function removeEntity(_0x5ae9ef,_0x3feca1){return function(_0x542ceb){if(_0x542ceb){return _0x542ceb[_0xc0fc('0x2a')]()[_0xc0fc('0x29')](function(){var _0x19fd03=_0x542ceb[_0xc0fc('0x2b')]({'plain':!![]});var _0x4f6724=_0xc0fc('0x2c');return db['UserProfileResource'][_0xc0fc('0x2a')]({'where':{'type':_0x4f6724,'resourceId':_0x19fd03['id']}})[_0xc0fc('0x29')](function(){return _0x542ceb;});})[_0xc0fc('0x29')](function(){_0x5ae9ef[_0xc0fc('0x1d')](0xcc)[_0xc0fc('0x2d')]();});}};}function handleEntityNotFound(_0x2afa1b,_0x5e1ef9){return function(_0xc00763){if(!_0xc00763){_0x2afa1b['sendStatus'](0x194);}return _0xc00763;};}function handleError(_0x35560d,_0x4e3e07){_0x4e3e07=_0x4e3e07||0x1f4;return function(_0xd7387e){logger[_0xc0fc('0x2e')](_0xd7387e[_0xc0fc('0x2f')]);if(_0xd7387e[_0xc0fc('0x30')]){delete _0xd7387e[_0xc0fc('0x30')];}_0x35560d[_0xc0fc('0x1d')](_0x4e3e07)[_0xc0fc('0x31')](_0xd7387e);};}exports[_0xc0fc('0x32')]=function(_0x207aea,_0x256d35){var _0x24f173={},_0x193d58={},_0x21d9ac={'count':0x0,'rows':[]};var _0xdb0b7f=_[_0xc0fc('0x33')](db[_0xc0fc('0x34')][_0xc0fc('0x35')],function(_0x42040c){return{'name':_0x42040c['fieldName'],'type':_0x42040c[_0xc0fc('0x36')][_0xc0fc('0x37')]};});_0x193d58[_0xc0fc('0x38')]=_['map'](_0xdb0b7f,_0xc0fc('0x30'));_0x193d58[_0xc0fc('0x39')]=_[_0xc0fc('0x3a')](_0x207aea['query']);_0x193d58['filters']=_[_0xc0fc('0x3b')](_0x193d58['model'],_0x193d58[_0xc0fc('0x39')]);_0x24f173[_0xc0fc('0x3c')]=_[_0xc0fc('0x3b')](_0x193d58[_0xc0fc('0x38')],qs['fields'](_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x3d')]));_0x24f173[_0xc0fc('0x3c')]=_0x24f173[_0xc0fc('0x3c')][_0xc0fc('0x3e')]?_0x24f173[_0xc0fc('0x3c')]:_0x193d58[_0xc0fc('0x38')];if(!_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x3f')](_0xc0fc('0x40'))){_0x24f173[_0xc0fc('0x22')]=qs[_0xc0fc('0x22')](_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x22')]);_0x24f173[_0xc0fc('0x1f')]=qs['offset'](_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x1f')]);}_0x24f173['order']=qs[_0xc0fc('0x41')](_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x41')]);_0x24f173['where']=qs[_0xc0fc('0x42')](_[_0xc0fc('0x43')](_0x207aea[_0xc0fc('0x39')],_0x193d58['filters']),_0xdb0b7f);if(_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x44')]){_0x24f173[_0xc0fc('0x45')]=_[_0xc0fc('0x46')](_0x24f173[_0xc0fc('0x45')],{'$or':_['map'](_0xdb0b7f,function(_0x1a2f83){if(_0x1a2f83[_0xc0fc('0x36')]!==_0xc0fc('0x47')){var _0x54a3af={};_0x54a3af[_0x1a2f83['name']]={'$like':'%'+_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x44')]+'%'};return _0x54a3af;}})});}_0x24f173=_[_0xc0fc('0x46')]({},_0x24f173,_0x207aea[_0xc0fc('0x48')]);var _0x372295={'where':_0x24f173['where']};return db[_0xc0fc('0x34')]['count'](_0x372295)['then'](function(_0x3036d3){_0x21d9ac['count']=_0x3036d3;if(_0x207aea[_0xc0fc('0x39')][_0xc0fc('0x49')]){_0x24f173['include']=[{'all':!![]}];}return db[_0xc0fc('0x34')][_0xc0fc('0x4a')](_0x24f173);})[_0xc0fc('0x29')](function(_0x1a2dcf){_0x21d9ac[_0xc0fc('0x4b')]=_0x1a2dcf;return _0x21d9ac;})[_0xc0fc('0x29')](respondWithFilteredResult(_0x256d35,_0x24f173))[_0xc0fc('0x4c')](handleError(_0x256d35,null));};exports[_0xc0fc('0x4d')]=function(_0x226fa3,_0x585ebb){var _0x4214af={'raw':!![],'where':{'id':_0x226fa3[_0xc0fc('0x4e')]['id']}},_0xee6e4a={};_0xee6e4a[_0xc0fc('0x38')]=_[_0xc0fc('0x3a')](db[_0xc0fc('0x34')][_0xc0fc('0x35')]);_0xee6e4a[_0xc0fc('0x39')]=_[_0xc0fc('0x3a')](_0x226fa3[_0xc0fc('0x39')]);_0xee6e4a[_0xc0fc('0x42')]=_['intersection'](_0xee6e4a[_0xc0fc('0x38')],_0xee6e4a['query']);_0x4214af[_0xc0fc('0x3c')]=_[_0xc0fc('0x3b')](_0xee6e4a['model'],qs[_0xc0fc('0x3d')](_0x226fa3[_0xc0fc('0x39')][_0xc0fc('0x3d')]));_0x4214af['attributes']=_0x4214af[_0xc0fc('0x3c')]['length']?_0x4214af[_0xc0fc('0x3c')]:_0xee6e4a['model'];if(_0x226fa3['query']['includeAll']){_0x4214af[_0xc0fc('0x4f')]=[{'all':!![]}];}_0x4214af=_[_0xc0fc('0x46')]({},_0x4214af,_0x226fa3[_0xc0fc('0x48')]);return db['Template'][_0xc0fc('0x50')](_0x4214af)[_0xc0fc('0x29')](handleEntityNotFound(_0x585ebb,null))[_0xc0fc('0x29')](respondWithResult(_0x585ebb,null))[_0xc0fc('0x4c')](handleError(_0x585ebb,null));};exports['create']=function(_0x1646d0,_0x1e0692){return db[_0xc0fc('0x34')][_0xc0fc('0x51')](_0x1646d0['body'],{})[_0xc0fc('0x29')](function(_0x28b9bc){var _0x9d9619=_0x1646d0['user'][_0xc0fc('0x2b')]({'plain':!![]});if(!_0x9d9619)throw new Error(_0xc0fc('0x52'));if(_0x9d9619['role']===_0xc0fc('0x53')){var _0x1c0a66=_0x28b9bc[_0xc0fc('0x2b')]({'plain':!![]});var _0x39834e=_0xc0fc('0x2c');return db['UserProfileSection'][_0xc0fc('0x50')]({'where':{'name':_0x39834e,'userProfileId':_0x9d9619[_0xc0fc('0x54')]},'raw':!![]})[_0xc0fc('0x29')](function(_0x1095b5){if(_0x1095b5&&_0x1095b5[_0xc0fc('0x55')]===0x0){return db[_0xc0fc('0x56')][_0xc0fc('0x51')]({'name':_0x1c0a66[_0xc0fc('0x30')],'resourceId':_0x1c0a66['id'],'type':_0x1095b5[_0xc0fc('0x30')],'sectionId':_0x1095b5['id']},{})[_0xc0fc('0x29')](function(){return _0x28b9bc;});}else{return _0x28b9bc;}})['catch'](function(_0xce9088){logger[_0xc0fc('0x2e')](_0xc0fc('0x57'),_0xce9088);throw _0xce9088;});}return _0x28b9bc;})[_0xc0fc('0x29')](respondWithResult(_0x1e0692,0xc9))['catch'](handleError(_0x1e0692,null));};exports[_0xc0fc('0x28')]=function(_0x465262,_0x20ebd0){if(_0x465262[_0xc0fc('0x58')]['id']){delete _0x465262[_0xc0fc('0x58')]['id'];}return db['Template']['find']({'where':{'id':_0x465262[_0xc0fc('0x4e')]['id']}})[_0xc0fc('0x29')](handleEntityNotFound(_0x20ebd0,null))['then'](saveUpdates(_0x465262['body'],null))['then'](respondWithResult(_0x20ebd0,null))['catch'](handleError(_0x20ebd0,null));};exports[_0xc0fc('0x2a')]=function(_0xf0ee87,_0x396313){return db['Template'][_0xc0fc('0x50')]({'where':{'id':_0xf0ee87[_0xc0fc('0x4e')]['id']}})[_0xc0fc('0x29')](handleEntityNotFound(_0x396313,null))[_0xc0fc('0x29')](removeEntity(_0x396313,null))['catch'](handleError(_0x396313,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 9baad49..24c46ac 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 _0xf425=['path','rimraf','../../config/environment','./template.attributes','define','Template','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16eb19,_0x58cea4){var _0x312a25=function(_0x343702){while(--_0x343702){_0x16eb19['push'](_0x16eb19['shift']());}};_0x312a25(++_0x58cea4);}(_0xf425,0x131));var _0x5f42=function(_0x139a25,_0x1707d7){_0x139a25=_0x139a25-0x0;var _0x330a62=_0xf425[_0x139a25];return _0x330a62;};'use strict';var _=require(_0x5f42('0x0'));var util=require(_0x5f42('0x1'));var logger=require(_0x5f42('0x2'))(_0x5f42('0x3'));var moment=require(_0x5f42('0x4'));var BPromise=require(_0x5f42('0x5'));var rp=require(_0x5f42('0x6'));var fs=require('fs');var path=require(_0x5f42('0x7'));var rimraf=require(_0x5f42('0x8'));var config=require(_0x5f42('0x9'));var attributes=require(_0x5f42('0xa'));module['exports']=function(_0x2ccef0,_0x132fd3){return _0x2ccef0[_0x5f42('0xb')](_0x5f42('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa95=['rimraf','../../config/environment','./template.attributes','exports','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x340819,_0x338c79){var _0x14c52f=function(_0x474888){while(--_0x474888){_0x340819['push'](_0x340819['shift']());}};_0x14c52f(++_0x338c79);}(_0xfa95,0x1e8));var _0x5fa9=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xfa95[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x5fa9('0x0'));var util=require(_0x5fa9('0x1'));var logger=require('../../config/logger')(_0x5fa9('0x2'));var moment=require(_0x5fa9('0x3'));var BPromise=require(_0x5fa9('0x4'));var rp=require(_0x5fa9('0x5'));var fs=require('fs');var path=require(_0x5fa9('0x6'));var rimraf=require(_0x5fa9('0x7'));var config=require(_0x5fa9('0x8'));var attributes=require(_0x5fa9('0x9'));module[_0x5fa9('0xa')]=function(_0x515b1f,_0x5f5840){return _0x515b1f['define']('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index f13441a..18804fc 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 _0xe6b6=['util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model'];(function(_0x1a6299,_0xbd3231){var _0x35fdd6=function(_0xbef107){while(--_0xbef107){_0x1a6299['push'](_0x1a6299['shift']());}};_0x35fdd6(++_0xbd3231);}(_0xe6b6,0x150));var _0x6e6b=function(_0x255f95,_0x5be4d8){_0x255f95=_0x255f95-0x0;var _0x52ab79=_0xe6b6[_0x255f95];return _0x52ab79;};'use strict';var _=require('lodash');var util=require(_0x6e6b('0x0'));var moment=require(_0x6e6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6e6b('0x3'));var logger=require('../../config/logger')(_0x6e6b('0x4'));var config=require(_0x6e6b('0x5'));var jayson=require(_0x6e6b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bb636,_0x4bc5a0,_0x3d3b77){return new BPromise(function(_0x506791,_0x54c293){return client[_0x6e6b('0x7')](_0x1bb636,_0x3d3b77)[_0x6e6b('0x8')](function(_0x24c462){logger[_0x6e6b('0x9')]('Template,\x20%s,\x20%s',_0x4bc5a0,_0x6e6b('0xa'));logger[_0x6e6b('0xb')]('Template,\x20%s,\x20%s,\x20%s',_0x4bc5a0,'request\x20sent',JSON[_0x6e6b('0xc')](_0x24c462));if(_0x24c462[_0x6e6b('0xd')]){if(_0x24c462['error'][_0x6e6b('0xe')]===0x1f4){logger[_0x6e6b('0xd')](_0x6e6b('0xf'),_0x4bc5a0,_0x24c462[_0x6e6b('0xd')][_0x6e6b('0x10')]);return _0x54c293(_0x24c462[_0x6e6b('0xd')][_0x6e6b('0x10')]);}logger[_0x6e6b('0xd')]('Template,\x20%s,\x20%s',_0x4bc5a0,_0x24c462[_0x6e6b('0xd')][_0x6e6b('0x10')]);return _0x506791(_0x24c462['error']['message']);}else{logger['info']('Template,\x20%s,\x20%s',_0x4bc5a0,_0x6e6b('0xa'));_0x506791(_0x24c462['result'][_0x6e6b('0x10')]);}})[_0x6e6b('0x11')](function(_0x5eee11){logger['error']('Template,\x20%s,\x20%s',_0x4bc5a0,_0x5eee11);_0x54c293(_0x5eee11);});});}exports[_0x6e6b('0x12')]=function(_0x28c4cd){var _0x13365f=this;return new Promise(function(_0x41c45d,_0x167321){return db[_0x6e6b('0x13')][_0x6e6b('0x14')]({'raw':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x16')]===undefined?!![]:![]:!![],'where':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd['options'][_0x6e6b('0x17')]||null:null,'attributes':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x18')]||null:null,'limit':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')]['limit']||null:null,'include':_0x28c4cd[_0x6e6b('0x15')]?_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x19')]?_[_0x6e6b('0x1a')](_0x28c4cd[_0x6e6b('0x15')][_0x6e6b('0x19')],function(_0x460def){return{'model':db[_0x460def['model']],'as':_0x460def['as'],'attributes':_0x460def['attributes'],'include':_0x460def[_0x6e6b('0x19')]?_[_0x6e6b('0x1a')](_0x460def[_0x6e6b('0x19')],function(_0x40741f){return{'model':db[_0x40741f[_0x6e6b('0x1b')]],'as':_0x40741f['as'],'attributes':_0x40741f[_0x6e6b('0x18')],'include':_0x40741f[_0x6e6b('0x19')]?_['map'](_0x40741f[_0x6e6b('0x19')],function(_0x22005e){return{'model':db[_0x22005e[_0x6e6b('0x1b')]],'as':_0x22005e['as'],'attributes':_0x22005e[_0x6e6b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6e6b('0x8')](function(_0x45e43f){logger[_0x6e6b('0x9')](_0x6e6b('0x12'),_0x28c4cd);logger['debug']('GetTemplate',_0x28c4cd,JSON[_0x6e6b('0xc')](_0x45e43f));_0x41c45d(_0x45e43f);})[_0x6e6b('0x11')](function(_0x5be539){logger['error'](_0x6e6b('0x12'),_0x5be539[_0x6e6b('0x10')],_0x28c4cd);_0x167321(_0x13365f[_0x6e6b('0xd')](0x1f4,_0x5be539[_0x6e6b('0x10')]));});});}; \ No newline at end of file +var _0xa866=['model','attributes','map','GetTemplate','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','Template,\x20%s,\x20%s','message','result','catch','Template','findAll','options','raw','where','limit','include'];(function(_0x27e8a8,_0x5a050d){var _0x257d08=function(_0xd3cbce){while(--_0xd3cbce){_0x27e8a8['push'](_0x27e8a8['shift']());}};_0x257d08(++_0x5a050d);}(_0xa866,0x6a));var _0x6a86=function(_0x4ea0d9,_0x2cb7c4){_0x4ea0d9=_0x4ea0d9-0x0;var _0x463d64=_0xa866[_0x4ea0d9];return _0x463d64;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('Template,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['GetTemplate']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')]({'raw':_0x50024d[_0x6a86('0x19')]?_0x50024d['options'][_0x6a86('0x1a')]===undefined?!![]:![]:!![],'where':_0x50024d[_0x6a86('0x19')]?_0x50024d[_0x6a86('0x19')][_0x6a86('0x1b')]||null:null,'attributes':_0x50024d[_0x6a86('0x19')]?_0x50024d[_0x6a86('0x19')]['attributes']||null:null,'limit':_0x50024d['options']?_0x50024d['options'][_0x6a86('0x1c')]||null:null,'include':_0x50024d[_0x6a86('0x19')]?_0x50024d[_0x6a86('0x19')][_0x6a86('0x1d')]?_['map'](_0x50024d[_0x6a86('0x19')][_0x6a86('0x1d')],function(_0x366f4a){return{'model':db[_0x366f4a[_0x6a86('0x1e')]],'as':_0x366f4a['as'],'attributes':_0x366f4a[_0x6a86('0x1f')],'include':_0x366f4a[_0x6a86('0x1d')]?_[_0x6a86('0x20')](_0x366f4a[_0x6a86('0x1d')],function(_0x40e616){return{'model':db[_0x40e616['model']],'as':_0x40e616['as'],'attributes':_0x40e616['attributes'],'include':_0x40e616[_0x6a86('0x1d')]?_['map'](_0x40e616[_0x6a86('0x1d')],function(_0x1ff9c8){return{'model':db[_0x1ff9c8['model']],'as':_0x1ff9c8['as'],'attributes':_0x1ff9c8[_0x6a86('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6a86('0xc')](function(_0x2da9f8){logger['info'](_0x6a86('0x21'),_0x50024d);logger['debug']('GetTemplate',_0x50024d,JSON['stringify'](_0x2da9f8));_0x535fd9(_0x2da9f8);})[_0x6a86('0x16')](function(_0xab04e4){logger[_0x6a86('0x12')]('GetTemplate',_0xab04e4[_0x6a86('0x14')],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0xab04e4[_0x6a86('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d2621b4..122d1f1 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 _0x4cdc=['destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','post','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x4cdc,0x13a));var _0xc4cd=function(_0x147797,_0x55fb85){_0x147797=_0x147797-0x0;var _0x4ad15a=_0x4cdc[_0x147797];return _0x4ad15a;};'use strict';var multer=require(_0xc4cd('0x0'));var util=require(_0xc4cd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc4cd('0x2'));var router=express[_0xc4cd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4cd('0x4'));var interaction=require(_0xc4cd('0x5'));var config=require(_0xc4cd('0x6'));var controller=require(_0xc4cd('0x7'));router[_0xc4cd('0x8')]('/',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0xa')]);router[_0xc4cd('0x8')](_0xc4cd('0xb'),auth['isAuthenticated'](),controller[_0xc4cd('0xc')]);router[_0xc4cd('0x8')]('/:id/all_conditions',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0xd')]);router['get'](_0xc4cd('0xe'),auth[_0xc4cd('0x9')](),controller[_0xc4cd('0xf')]);router[_0xc4cd('0x8')]('/:id/actions',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x10')]);router['post']('/',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x11')]);router[_0xc4cd('0x12')](_0xc4cd('0x13'),auth['isAuthenticated'](),controller[_0xc4cd('0x14')]);router[_0xc4cd('0x12')](_0xc4cd('0xe'),auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x15')]);router[_0xc4cd('0x12')]('/:id/actions',auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x16')]);router[_0xc4cd('0x17')](_0xc4cd('0xb'),auth[_0xc4cd('0x9')](),controller['update']);router['delete'](_0xc4cd('0xb'),auth[_0xc4cd('0x9')](),controller[_0xc4cd('0x18')]);module[_0xc4cd('0x19')]=router; \ No newline at end of file +var _0x4e80=['getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','/:id/actions'];(function(_0x5535c4,_0x407c29){var _0x2a48cc=function(_0x2dc051){while(--_0x2dc051){_0x5535c4['push'](_0x5535c4['shift']());}};_0x2a48cc(++_0x407c29);}(_0x4e80,0xda));var _0x04e8=function(_0x2d5aca,_0x19beca){_0x2d5aca=_0x2d5aca-0x0;var _0x24ae42=_0x4e80[_0x2d5aca];return _0x24ae42;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x04e8('0x0'));var timeout=require(_0x04e8('0x1'));var express=require('express');var router=express[_0x04e8('0x2')]();var fs_extra=require(_0x04e8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x04e8('0x4'));var config=require('../../config/environment');var controller=require(_0x04e8('0x5'));router[_0x04e8('0x6')]('/',auth['isAuthenticated'](),controller[_0x04e8('0x7')]);router[_0x04e8('0x6')](_0x04e8('0x8'),auth[_0x04e8('0x9')](),controller[_0x04e8('0xa')]);router[_0x04e8('0x6')](_0x04e8('0xb'),auth[_0x04e8('0x9')](),controller['getAllConditions']);router[_0x04e8('0x6')]('/:id/any_conditions',auth[_0x04e8('0x9')](),controller['getAnyConditions']);router[_0x04e8('0x6')](_0x04e8('0xc'),auth[_0x04e8('0x9')](),controller[_0x04e8('0xd')]);router[_0x04e8('0xe')]('/',auth[_0x04e8('0x9')](),controller['create']);router[_0x04e8('0xe')](_0x04e8('0xb'),auth[_0x04e8('0x9')](),controller[_0x04e8('0xf')]);router[_0x04e8('0xe')](_0x04e8('0x10'),auth['isAuthenticated'](),controller[_0x04e8('0x11')]);router[_0x04e8('0xe')]('/:id/actions',auth[_0x04e8('0x9')](),controller['addAction']);router['put'](_0x04e8('0x8'),auth['isAuthenticated'](),controller[_0x04e8('0x12')]);router['delete'](_0x04e8('0x8'),auth['isAuthenticated'](),controller[_0x04e8('0x13')]);module[_0x04e8('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e47e1cb..a688e60 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 _0xb93e=['sequelize','exports','BOOLEAN'];(function(_0x2e39bd,_0x49ea5a){var _0x2ac9c6=function(_0x4f834b){while(--_0x4f834b){_0x2e39bd['push'](_0x2e39bd['shift']());}};_0x2ac9c6(++_0x49ea5a);}(_0xb93e,0x1a4));var _0xeb93=function(_0x18bc16,_0x76e09d){_0x18bc16=_0x18bc16-0x0;var _0x5120ff=_0xb93e[_0x18bc16];return _0x5120ff;};'use strict';var Sequelize=require(_0xeb93('0x0'));module[_0xeb93('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xeb93('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7352=['STRING','sequelize','exports'];(function(_0x3b73dc,_0x44dd01){var _0x154909=function(_0x1c68ea){while(--_0x1c68ea){_0x3b73dc['push'](_0x3b73dc['shift']());}};_0x154909(++_0x44dd01);}(_0x7352,0x18d));var _0x2735=function(_0x3a0783,_0x1506e6){_0x3a0783=_0x3a0783-0x0;var _0x629c72=_0x7352[_0x3a0783];return _0x629c72;};'use strict';var Sequelize=require(_0x2735('0x0'));module[_0x2735('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2735('0x2')]},'description':{'type':Sequelize[_0x2735('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index cb301e8..39ebcab 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 _0x37d5=['VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','getAllConditions','length','order','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','save','update','then','get','Triggers','UserProfileResource','destroy','stack','name','send','index','map','Trigger','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x37d5,0x132));var _0x537d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x537d('0x0'));var rimraf=require(_0x537d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x537d('0x2'));var rp=require(_0x537d('0x3'));var moment=require(_0x537d('0x4'));var BPromise=require(_0x537d('0x5'));var Mustache=require(_0x537d('0x6'));var util=require(_0x537d('0x7'));var path=require(_0x537d('0x8'));var sox=require(_0x537d('0x9'));var csv=require(_0x537d('0xa'));var ejs=require(_0x537d('0xb'));var fs=require('fs');var fs_extra=require(_0x537d('0xc'));var _=require(_0x537d('0xd'));var squel=require(_0x537d('0xe'));var crypto=require(_0x537d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x537d('0xa'));var querystring=require(_0x537d('0x10'));var Papa=require(_0x537d('0x11'));var Redis=require(_0x537d('0x12'));var authService=require(_0x537d('0x13'));var qs=require(_0x537d('0x14'));var as=require(_0x537d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x537d('0x16'))(_0x537d('0x17'));var utils=require('../../config/utils');var config=require(_0x537d('0x18'));var licenseUtil=require(_0x537d('0x19'));var db=require(_0x537d('0x1a'))['db'];function respondWithStatusCode(_0x41bc7a,_0x4f0580){_0x4f0580=_0x4f0580||0xcc;return function(_0x68cdaa){if(_0x68cdaa){return _0x41bc7a[_0x537d('0x1b')](_0x4f0580);}return _0x41bc7a['status'](_0x4f0580)[_0x537d('0x1c')]();};}function respondWithResult(_0x31347f,_0x1594e9){_0x1594e9=_0x1594e9||0xc8;return function(_0x2bd303){if(_0x2bd303){return _0x31347f[_0x537d('0x1d')](_0x1594e9)[_0x537d('0x1e')](_0x2bd303);}};}function respondWithFilteredResult(_0x56f9a1,_0x23c42d){return function(_0x20747f){if(_0x20747f){var _0x577e4c=typeof _0x23c42d['offset']===_0x537d('0x1f')&&typeof _0x23c42d['limit']===_0x537d('0x1f');var _0x578c1e=_0x20747f['count'];var _0x5222c5=_0x577e4c?0x0:_0x23c42d['offset'];var _0x537f3d=_0x577e4c?_0x20747f[_0x537d('0x20')]:_0x23c42d[_0x537d('0x21')]+_0x23c42d[_0x537d('0x22')];var _0xbbe80e;if(_0x537f3d>=_0x578c1e){_0x537f3d=_0x578c1e;_0xbbe80e=0xc8;}else{_0xbbe80e=0xce;}_0x56f9a1[_0x537d('0x1d')](_0xbbe80e);return _0x56f9a1[_0x537d('0x23')]('Content-Range',_0x5222c5+'-'+_0x537f3d+'/'+_0x578c1e)[_0x537d('0x1e')](_0x20747f);}return null;};}function patchUpdates(_0x385d9d){return function(_0x1f8f20){try{jsonpatch[_0x537d('0x24')](_0x1f8f20,_0x385d9d,!![]);}catch(_0x5e6f6f){return BPromise['reject'](_0x5e6f6f);}return _0x1f8f20[_0x537d('0x25')]();};}function saveUpdates(_0x59d4ba,_0x14cfb9){return function(_0x2a4d73){if(_0x2a4d73){return _0x2a4d73[_0x537d('0x26')](_0x59d4ba)[_0x537d('0x27')](function(_0x170118){return _0x170118;});}return null;};}function removeEntity(_0x3699de,_0x1979ef){return function(_0xb81ca9){if(_0xb81ca9){return _0xb81ca9['destroy']()['then'](function(){var _0x49ab53=_0xb81ca9[_0x537d('0x28')]({'plain':!![]});var _0x114a69=_0x537d('0x29');return db[_0x537d('0x2a')][_0x537d('0x2b')]({'where':{'type':_0x114a69,'resourceId':_0x49ab53['id']}})[_0x537d('0x27')](function(){return _0xb81ca9;});})[_0x537d('0x27')](function(){_0x3699de[_0x537d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x451ef2,_0x59d0f6){return function(_0x306393){if(!_0x306393){_0x451ef2[_0x537d('0x1b')](0x194);}return _0x306393;};}function handleError(_0x5e2c68,_0x4dcbe2){_0x4dcbe2=_0x4dcbe2||0x1f4;return function(_0x85f4be){logger['error'](_0x85f4be[_0x537d('0x2c')]);if(_0x85f4be[_0x537d('0x2d')]){delete _0x85f4be[_0x537d('0x2d')];}_0x5e2c68['status'](_0x4dcbe2)[_0x537d('0x2e')](_0x85f4be);};}exports[_0x537d('0x2f')]=function(_0x3e0cda,_0x28723a){var _0x3e10ee={},_0x5a4df8={},_0x278d1f={'count':0x0,'rows':[]};var _0x205330=_[_0x537d('0x30')](db[_0x537d('0x31')]['rawAttributes'],function(_0x13cb36){return{'name':_0x13cb36[_0x537d('0x32')],'type':_0x13cb36[_0x537d('0x33')]['key']};});_0x5a4df8[_0x537d('0x34')]=_[_0x537d('0x30')](_0x205330,_0x537d('0x2d'));_0x5a4df8['query']=_[_0x537d('0x35')](_0x3e0cda[_0x537d('0x36')]);_0x5a4df8[_0x537d('0x37')]=_['intersection'](_0x5a4df8[_0x537d('0x34')],_0x5a4df8[_0x537d('0x36')]);_0x3e10ee[_0x537d('0x38')]=_[_0x537d('0x39')](_0x5a4df8[_0x537d('0x34')],qs[_0x537d('0x3a')](_0x3e0cda[_0x537d('0x36')][_0x537d('0x3a')]));_0x3e10ee[_0x537d('0x38')]=_0x3e10ee[_0x537d('0x38')]['length']?_0x3e10ee[_0x537d('0x38')]:_0x5a4df8[_0x537d('0x34')];if(!_0x3e0cda[_0x537d('0x36')][_0x537d('0x3b')](_0x537d('0x3c'))){_0x3e10ee[_0x537d('0x22')]=qs[_0x537d('0x22')](_0x3e0cda['query'][_0x537d('0x22')]);_0x3e10ee[_0x537d('0x21')]=qs[_0x537d('0x21')](_0x3e0cda[_0x537d('0x36')][_0x537d('0x21')]);}_0x3e10ee['order']=qs['sort'](_0x3e0cda[_0x537d('0x36')][_0x537d('0x3d')]);_0x3e10ee[_0x537d('0x3e')]=qs['filters'](_[_0x537d('0x3f')](_0x3e0cda[_0x537d('0x36')],_0x5a4df8[_0x537d('0x37')]),_0x205330);if(_0x3e0cda['query'][_0x537d('0x40')]){_0x3e10ee[_0x537d('0x3e')]=_[_0x537d('0x41')](_0x3e10ee[_0x537d('0x3e')],{'$or':_[_0x537d('0x30')](_0x205330,function(_0x3c7b0f){if(_0x3c7b0f[_0x537d('0x33')]!==_0x537d('0x42')){var _0x3c05ad={};_0x3c05ad[_0x3c7b0f[_0x537d('0x2d')]]={'$like':'%'+_0x3e0cda[_0x537d('0x36')]['filter']+'%'};return _0x3c05ad;}})});}_0x3e10ee=_['merge']({},_0x3e10ee,_0x3e0cda[_0x537d('0x43')]);var _0x3a60c5={'where':_0x3e10ee[_0x537d('0x3e')]};return db['Trigger'][_0x537d('0x20')](_0x3a60c5)['then'](function(_0x458e96){_0x278d1f[_0x537d('0x20')]=_0x458e96;if(_0x3e0cda[_0x537d('0x36')][_0x537d('0x44')]){_0x3e10ee[_0x537d('0x45')]=[{'all':!![]}];}return db[_0x537d('0x31')]['findAll'](_0x3e10ee);})[_0x537d('0x27')](function(_0x1249f2){_0x278d1f[_0x537d('0x46')]=_0x1249f2;return _0x278d1f;})[_0x537d('0x27')](respondWithFilteredResult(_0x28723a,_0x3e10ee))[_0x537d('0x47')](handleError(_0x28723a,null));};exports['show']=function(_0xd47497,_0x29806b){var _0x374b4f={'raw':![],'where':{'id':_0xd47497[_0x537d('0x48')]['id']}},_0x341c7b={};_0x341c7b['model']=_[_0x537d('0x35')](db['Trigger'][_0x537d('0x49')]);_0x341c7b[_0x537d('0x36')]=_[_0x537d('0x35')](_0xd47497[_0x537d('0x36')]);_0x341c7b['filters']=_['intersection'](_0x341c7b['model'],_0x341c7b[_0x537d('0x36')]);_0x374b4f[_0x537d('0x38')]=_['intersection'](_0x341c7b[_0x537d('0x34')],qs[_0x537d('0x3a')](_0xd47497[_0x537d('0x36')][_0x537d('0x3a')]));_0x374b4f[_0x537d('0x38')]=_0x374b4f[_0x537d('0x38')]['length']?_0x374b4f[_0x537d('0x38')]:_0x341c7b[_0x537d('0x34')];if(_0xd47497[_0x537d('0x36')][_0x537d('0x44')]){_0x374b4f[_0x537d('0x45')]=[{'all':!![]}];}_0x374b4f=_[_0x537d('0x41')]({},_0x374b4f,_0xd47497[_0x537d('0x43')]);return db[_0x537d('0x31')][_0x537d('0x4a')](_0x374b4f)[_0x537d('0x27')](handleEntityNotFound(_0x29806b,null))['then'](respondWithResult(_0x29806b,null))[_0x537d('0x47')](handleError(_0x29806b,null));};exports[_0x537d('0x4b')]=function(_0x143e32,_0x536968){return db[_0x537d('0x31')][_0x537d('0x4b')](_0x143e32[_0x537d('0x4c')],{})[_0x537d('0x27')](function(_0xcc7d32){var _0x5c3977=_0x143e32[_0x537d('0x4d')][_0x537d('0x28')]({'plain':!![]});if(!_0x5c3977)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c3977['role']===_0x537d('0x4d')){var _0x471813=_0xcc7d32['get']({'plain':!![]});var _0x29ad32=_0x537d('0x29');return db['UserProfileSection'][_0x537d('0x4a')]({'where':{'name':_0x29ad32,'userProfileId':_0x5c3977[_0x537d('0x4e')]},'raw':!![]})['then'](function(_0x47e601){if(_0x47e601&&_0x47e601[_0x537d('0x4f')]===0x0){return db[_0x537d('0x2a')]['create']({'name':_0x471813[_0x537d('0x2d')],'resourceId':_0x471813['id'],'type':_0x47e601[_0x537d('0x2d')],'sectionId':_0x47e601['id']},{})['then'](function(){return _0xcc7d32;});}else{return _0xcc7d32;}})[_0x537d('0x47')](function(_0x2da8c1){logger['error'](_0x537d('0x50'),_0x2da8c1);throw _0x2da8c1;});}return _0xcc7d32;})[_0x537d('0x27')](respondWithResult(_0x536968,0xc9))[_0x537d('0x47')](handleError(_0x536968,null));};exports[_0x537d('0x26')]=function(_0x499e93,_0x10eefd){if(_0x499e93[_0x537d('0x4c')]['id']){delete _0x499e93[_0x537d('0x4c')]['id'];}return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x499e93[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x10eefd,null))[_0x537d('0x27')](saveUpdates(_0x499e93[_0x537d('0x4c')],null))[_0x537d('0x27')](respondWithResult(_0x10eefd,null))[_0x537d('0x47')](handleError(_0x10eefd,null));};exports['destroy']=function(_0x4fc478,_0x572ed6){return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x4fc478[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x572ed6,null))['then'](removeEntity(_0x572ed6,null))[_0x537d('0x47')](handleError(_0x572ed6,null));};exports[_0x537d('0x51')]=function(_0x12d906,_0x2c4e9d,_0x4185ba){if(_0x12d906[_0x537d('0x4c')]['id']){delete _0x12d906[_0x537d('0x4c')]['id'];}return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x12d906[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x2c4e9d,null))[_0x537d('0x27')](function(_0x2edae8){if(_0x2edae8){_0x12d906[_0x537d('0x4c')][_0x537d('0x52')]=_0x2edae8['id'];return db[_0x537d('0x53')][_0x537d('0x4b')](_0x12d906['body']);}})[_0x537d('0x27')](respondWithResult(_0x2c4e9d,null))[_0x537d('0x47')](handleError(_0x2c4e9d,null));};exports['addAnyCondition']=function(_0x514bba,_0xd918f2,_0x422025){if(_0x514bba['body']['id']){delete _0x514bba['body']['id'];}return db[_0x537d('0x31')]['find']({'where':{'id':_0x514bba['params']['id']}})[_0x537d('0x27')](handleEntityNotFound(_0xd918f2,null))[_0x537d('0x27')](function(_0x4c2c59){if(_0x4c2c59){_0x514bba[_0x537d('0x4c')]['TriggerAnyId']=_0x4c2c59['id'];return db[_0x537d('0x53')][_0x537d('0x4b')](_0x514bba[_0x537d('0x4c')]);}})[_0x537d('0x27')](respondWithResult(_0xd918f2,null))[_0x537d('0x47')](handleError(_0xd918f2,null));};exports[_0x537d('0x54')]=function(_0x5c5abc,_0x29f788,_0x50effa){var _0x3b7777={};var _0x7ddab3={};var _0x5a2b07;var _0x222b98;return db[_0x537d('0x31')]['findOne']({'where':{'id':_0x5c5abc['params']['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x29f788,null))[_0x537d('0x27')](function(_0x434e36){if(_0x434e36){_0x5a2b07=_0x434e36;_0x7ddab3[_0x537d('0x34')]=_[_0x537d('0x35')](db[_0x537d('0x53')][_0x537d('0x49')]);_0x7ddab3[_0x537d('0x36')]=_[_0x537d('0x35')](_0x5c5abc[_0x537d('0x36')]);_0x7ddab3[_0x537d('0x37')]=_[_0x537d('0x39')](_0x7ddab3['model'],_0x7ddab3[_0x537d('0x36')]);_0x3b7777[_0x537d('0x38')]=_[_0x537d('0x39')](_0x7ddab3[_0x537d('0x34')],qs[_0x537d('0x3a')](_0x5c5abc[_0x537d('0x36')][_0x537d('0x3a')]));_0x3b7777['attributes']=_0x3b7777[_0x537d('0x38')][_0x537d('0x55')]?_0x3b7777['attributes']:_0x7ddab3[_0x537d('0x34')];_0x3b7777[_0x537d('0x56')]=qs[_0x537d('0x3d')](_0x5c5abc['query'][_0x537d('0x3d')]);_0x3b7777[_0x537d('0x3e')]=qs['filters'](_['pick'](_0x5c5abc[_0x537d('0x36')],_0x7ddab3[_0x537d('0x37')]));if(_0x5c5abc['query'][_0x537d('0x40')]){_0x3b7777[_0x537d('0x3e')]=_[_0x537d('0x41')](_0x3b7777[_0x537d('0x3e')],{'$or':_[_0x537d('0x30')](_0x3b7777['attributes'],function(_0x187530){var _0x37f144={};_0x37f144[_0x187530]={'$like':'%'+_0x5c5abc[_0x537d('0x36')]['filter']+'%'};return _0x37f144;})});}_0x3b7777=_['merge']({},_0x3b7777,_0x5c5abc['options']);return _0x5a2b07['getAllConditions'](_0x3b7777);}})[_0x537d('0x27')](function(_0xb6368d){if(_0xb6368d){_0x222b98=_0xb6368d[_0x537d('0x55')];if(!_0x5c5abc[_0x537d('0x36')][_0x537d('0x3b')]('nolimit')){_0x3b7777[_0x537d('0x22')]=qs['limit'](_0x5c5abc[_0x537d('0x36')][_0x537d('0x22')]);_0x3b7777[_0x537d('0x21')]=qs[_0x537d('0x21')](_0x5c5abc['query'][_0x537d('0x21')]);}return _0x5a2b07[_0x537d('0x54')](_0x3b7777);}})[_0x537d('0x27')](function(_0x81c6fa){if(_0x81c6fa){return _0x81c6fa?{'count':_0x222b98,'rows':_0x81c6fa}:null;}})['then'](respondWithResult(_0x29f788,null))['catch'](handleError(_0x29f788,null));};exports['getAnyConditions']=function(_0x4dbc5b,_0x315a90,_0x5f4b51){var _0x3d4c4d={};var _0x4c3735={};var _0x5073f6;var _0x4bf121;return db[_0x537d('0x31')][_0x537d('0x57')]({'where':{'id':_0x4dbc5b[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x315a90,null))[_0x537d('0x27')](function(_0xf2edb4){if(_0xf2edb4){_0x5073f6=_0xf2edb4;_0x4c3735[_0x537d('0x34')]=_[_0x537d('0x35')](db['Condition']['rawAttributes']);_0x4c3735[_0x537d('0x36')]=_[_0x537d('0x35')](_0x4dbc5b['query']);_0x4c3735[_0x537d('0x37')]=_['intersection'](_0x4c3735[_0x537d('0x34')],_0x4c3735[_0x537d('0x36')]);_0x3d4c4d[_0x537d('0x38')]=_['intersection'](_0x4c3735[_0x537d('0x34')],qs['fields'](_0x4dbc5b[_0x537d('0x36')][_0x537d('0x3a')]));_0x3d4c4d[_0x537d('0x38')]=_0x3d4c4d[_0x537d('0x38')][_0x537d('0x55')]?_0x3d4c4d[_0x537d('0x38')]:_0x4c3735[_0x537d('0x34')];_0x3d4c4d[_0x537d('0x56')]=qs['sort'](_0x4dbc5b[_0x537d('0x36')][_0x537d('0x3d')]);_0x3d4c4d['where']=qs['filters'](_[_0x537d('0x3f')](_0x4dbc5b[_0x537d('0x36')],_0x4c3735[_0x537d('0x37')]));if(_0x4dbc5b[_0x537d('0x36')][_0x537d('0x40')]){_0x3d4c4d[_0x537d('0x3e')]=_[_0x537d('0x41')](_0x3d4c4d[_0x537d('0x3e')],{'$or':_[_0x537d('0x30')](_0x3d4c4d[_0x537d('0x38')],function(_0x127495){var _0x5a6fe0={};_0x5a6fe0[_0x127495]={'$like':'%'+_0x4dbc5b[_0x537d('0x36')][_0x537d('0x40')]+'%'};return _0x5a6fe0;})});}_0x3d4c4d=_[_0x537d('0x41')]({},_0x3d4c4d,_0x4dbc5b[_0x537d('0x43')]);return _0x5073f6[_0x537d('0x58')](_0x3d4c4d);}})['then'](function(_0x4af10e){if(_0x4af10e){_0x4bf121=_0x4af10e[_0x537d('0x55')];if(!_0x4dbc5b[_0x537d('0x36')][_0x537d('0x3b')]('nolimit')){_0x3d4c4d[_0x537d('0x22')]=qs[_0x537d('0x22')](_0x4dbc5b[_0x537d('0x36')][_0x537d('0x22')]);_0x3d4c4d[_0x537d('0x21')]=qs['offset'](_0x4dbc5b['query'][_0x537d('0x21')]);}return _0x5073f6[_0x537d('0x58')](_0x3d4c4d);}})[_0x537d('0x27')](function(_0x6d317d){if(_0x6d317d){return _0x6d317d?{'count':_0x4bf121,'rows':_0x6d317d}:null;}})[_0x537d('0x27')](respondWithResult(_0x315a90,null))[_0x537d('0x47')](handleError(_0x315a90,null));};exports[_0x537d('0x59')]=function(_0x18ea5b,_0x182996,_0x1f5c03){if(_0x18ea5b[_0x537d('0x4c')]['id']){delete _0x18ea5b['body']['id'];}return db[_0x537d('0x31')][_0x537d('0x4a')]({'where':{'id':_0x18ea5b[_0x537d('0x48')]['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x182996,null))[_0x537d('0x27')](function(_0x3d7746){if(_0x3d7746){_0x18ea5b[_0x537d('0x4c')][_0x537d('0x5a')]=_0x3d7746['id'];return db[_0x537d('0x5b')][_0x537d('0x4b')](_0x18ea5b[_0x537d('0x4c')]);}})[_0x537d('0x27')](respondWithResult(_0x182996,null))[_0x537d('0x47')](handleError(_0x182996,null));};exports['getActions']=function(_0x275a08,_0x2d1fdc,_0x313d8a){var _0x27e76b={};var _0x2d6958={};var _0x3c87ed;var _0x40f75d;return db['Trigger']['findOne']({'where':{'id':_0x275a08['params']['id']}})[_0x537d('0x27')](handleEntityNotFound(_0x2d1fdc,null))[_0x537d('0x27')](function(_0x212ab4){if(_0x212ab4){_0x3c87ed=_0x212ab4;_0x2d6958['model']=_[_0x537d('0x35')](db[_0x537d('0x5b')]['rawAttributes']);_0x2d6958[_0x537d('0x36')]=_[_0x537d('0x35')](_0x275a08['query']);_0x2d6958['filters']=_[_0x537d('0x39')](_0x2d6958[_0x537d('0x34')],_0x2d6958[_0x537d('0x36')]);_0x27e76b['attributes']=_[_0x537d('0x39')](_0x2d6958[_0x537d('0x34')],qs[_0x537d('0x3a')](_0x275a08[_0x537d('0x36')]['fields']));_0x27e76b[_0x537d('0x38')]=_0x27e76b[_0x537d('0x38')]['length']?_0x27e76b['attributes']:_0x2d6958[_0x537d('0x34')];_0x27e76b['order']=qs[_0x537d('0x3d')](_0x275a08[_0x537d('0x36')][_0x537d('0x3d')]);_0x27e76b['where']=qs[_0x537d('0x37')](_[_0x537d('0x3f')](_0x275a08['query'],_0x2d6958[_0x537d('0x37')]));if(_0x275a08[_0x537d('0x36')][_0x537d('0x40')]){_0x27e76b['where']=_[_0x537d('0x41')](_0x27e76b['where'],{'$or':_[_0x537d('0x30')](_0x27e76b[_0x537d('0x38')],function(_0x2c2e83){var _0x5e7827={};_0x5e7827[_0x2c2e83]={'$like':'%'+_0x275a08[_0x537d('0x36')][_0x537d('0x40')]+'%'};return _0x5e7827;})});}_0x27e76b=_[_0x537d('0x41')]({},_0x27e76b,_0x275a08[_0x537d('0x43')]);return _0x3c87ed[_0x537d('0x5c')](_0x27e76b);}})[_0x537d('0x27')](function(_0x2eb3e6){if(_0x2eb3e6){_0x40f75d=_0x2eb3e6[_0x537d('0x55')];if(!_0x275a08[_0x537d('0x36')]['hasOwnProperty'](_0x537d('0x3c'))){_0x27e76b[_0x537d('0x22')]=qs[_0x537d('0x22')](_0x275a08['query']['limit']);_0x27e76b[_0x537d('0x21')]=qs[_0x537d('0x21')](_0x275a08[_0x537d('0x36')][_0x537d('0x21')]);}return _0x3c87ed['getActions'](_0x27e76b);}})[_0x537d('0x27')](function(_0x50204c){if(_0x50204c){return _0x50204c?{'count':_0x40f75d,'rows':_0x50204c}:null;}})[_0x537d('0x27')](respondWithResult(_0x2d1fdc,null))[_0x537d('0x47')](handleError(_0x2d1fdc,null));}; \ No newline at end of file +var _0xd98c=['nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','addAnyCondition','TriggerAnyId','getAllConditions','findOne','keys','Condition','pick','getAnyConditions','order','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','intersection','attributes','fields','length','query','hasOwnProperty'];(function(_0x24fd35,_0x13b401){var _0x1b2272=function(_0x2985cb){while(--_0x2985cb){_0x24fd35['push'](_0x24fd35['shift']());}};_0x1b2272(++_0x13b401);}(_0xd98c,0x143));var _0xcd98=function(_0x12ca3b,_0x22893d){_0x12ca3b=_0x12ca3b-0x0;var _0x370056=_0xd98c[_0x12ca3b];return _0x370056;};'use strict';var emlformat=require(_0xcd98('0x0'));var rimraf=require(_0xcd98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd98('0x2'));var rp=require(_0xcd98('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd98('0x4'));var util=require(_0xcd98('0x5'));var path=require(_0xcd98('0x6'));var sox=require(_0xcd98('0x7'));var csv=require(_0xcd98('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd98('0x9'));var _=require(_0xcd98('0xa'));var squel=require(_0xcd98('0xb'));var crypto=require(_0xcd98('0xc'));var jsforce=require(_0xcd98('0xd'));var deskjs=require(_0xcd98('0xe'));var toCsv=require(_0xcd98('0x8'));var querystring=require(_0xcd98('0xf'));var Papa=require(_0xcd98('0x10'));var Redis=require(_0xcd98('0x11'));var authService=require(_0xcd98('0x12'));var qs=require(_0xcd98('0x13'));var as=require(_0xcd98('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd98('0x15'))(_0xcd98('0x16'));var utils=require('../../config/utils');var config=require(_0xcd98('0x17'));var licenseUtil=require(_0xcd98('0x18'));var db=require(_0xcd98('0x19'))['db'];function respondWithStatusCode(_0x40ca4f,_0x490b3e){_0x490b3e=_0x490b3e||0xcc;return function(_0x308b7e){if(_0x308b7e){return _0x40ca4f[_0xcd98('0x1a')](_0x490b3e);}return _0x40ca4f[_0xcd98('0x1b')](_0x490b3e)[_0xcd98('0x1c')]();};}function respondWithResult(_0x480624,_0x3faf1c){_0x3faf1c=_0x3faf1c||0xc8;return function(_0x5e974d){if(_0x5e974d){return _0x480624['status'](_0x3faf1c)['json'](_0x5e974d);}};}function respondWithFilteredResult(_0x520a0a,_0x59f23e){return function(_0x262f0c){if(_0x262f0c){var _0x140c7d=typeof _0x59f23e['offset']===_0xcd98('0x1d')&&typeof _0x59f23e[_0xcd98('0x1e')]==='undefined';var _0x3e5809=_0x262f0c['count'];var _0x5822fc=_0x140c7d?0x0:_0x59f23e[_0xcd98('0x1f')];var _0x16d103=_0x140c7d?_0x262f0c[_0xcd98('0x20')]:_0x59f23e[_0xcd98('0x1f')]+_0x59f23e[_0xcd98('0x1e')];var _0x349420;if(_0x16d103>=_0x3e5809){_0x16d103=_0x3e5809;_0x349420=0xc8;}else{_0x349420=0xce;}_0x520a0a[_0xcd98('0x1b')](_0x349420);return _0x520a0a[_0xcd98('0x21')](_0xcd98('0x22'),_0x5822fc+'-'+_0x16d103+'/'+_0x3e5809)[_0xcd98('0x23')](_0x262f0c);}return null;};}function patchUpdates(_0x1df2cf){return function(_0x50dc71){try{jsonpatch[_0xcd98('0x24')](_0x50dc71,_0x1df2cf,!![]);}catch(_0x3299d4){return BPromise[_0xcd98('0x25')](_0x3299d4);}return _0x50dc71[_0xcd98('0x26')]();};}function saveUpdates(_0x158255,_0x20698d){return function(_0xa0063b){if(_0xa0063b){return _0xa0063b[_0xcd98('0x27')](_0x158255)['then'](function(_0x30530f){return _0x30530f;});}return null;};}function removeEntity(_0x75ad69,_0x141ef0){return function(_0x58ae55){if(_0x58ae55){return _0x58ae55['destroy']()[_0xcd98('0x28')](function(){var _0x2906ce=_0x58ae55[_0xcd98('0x29')]({'plain':!![]});var _0xd85434=_0xcd98('0x2a');return db[_0xcd98('0x2b')][_0xcd98('0x2c')]({'where':{'type':_0xd85434,'resourceId':_0x2906ce['id']}})[_0xcd98('0x28')](function(){return _0x58ae55;});})[_0xcd98('0x28')](function(){_0x75ad69[_0xcd98('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f0bd,_0x81d803){return function(_0x4128df){if(!_0x4128df){_0x53f0bd[_0xcd98('0x1a')](0x194);}return _0x4128df;};}function handleError(_0xcbd2f1,_0x594c6c){_0x594c6c=_0x594c6c||0x1f4;return function(_0x4516e9){logger['error'](_0x4516e9[_0xcd98('0x2d')]);if(_0x4516e9[_0xcd98('0x2e')]){delete _0x4516e9[_0xcd98('0x2e')];}_0xcbd2f1[_0xcd98('0x1b')](_0x594c6c)[_0xcd98('0x2f')](_0x4516e9);};}exports[_0xcd98('0x30')]=function(_0x3090c0,_0x171a41){var _0x32e945={},_0x130537={},_0x57e1f8={'count':0x0,'rows':[]};var _0x546360=_[_0xcd98('0x31')](db[_0xcd98('0x32')][_0xcd98('0x33')],function(_0x57d9e3){return{'name':_0x57d9e3['fieldName'],'type':_0x57d9e3[_0xcd98('0x34')][_0xcd98('0x35')]};});_0x130537[_0xcd98('0x36')]=_['map'](_0x546360,_0xcd98('0x2e'));_0x130537['query']=_['keys'](_0x3090c0['query']);_0x130537['filters']=_[_0xcd98('0x37')](_0x130537['model'],_0x130537['query']);_0x32e945[_0xcd98('0x38')]=_['intersection'](_0x130537[_0xcd98('0x36')],qs[_0xcd98('0x39')](_0x3090c0['query'][_0xcd98('0x39')]));_0x32e945['attributes']=_0x32e945[_0xcd98('0x38')][_0xcd98('0x3a')]?_0x32e945[_0xcd98('0x38')]:_0x130537[_0xcd98('0x36')];if(!_0x3090c0[_0xcd98('0x3b')][_0xcd98('0x3c')](_0xcd98('0x3d'))){_0x32e945[_0xcd98('0x1e')]=qs[_0xcd98('0x1e')](_0x3090c0['query'][_0xcd98('0x1e')]);_0x32e945['offset']=qs[_0xcd98('0x1f')](_0x3090c0[_0xcd98('0x3b')]['offset']);}_0x32e945['order']=qs[_0xcd98('0x3e')](_0x3090c0[_0xcd98('0x3b')]['sort']);_0x32e945[_0xcd98('0x3f')]=qs[_0xcd98('0x40')](_['pick'](_0x3090c0[_0xcd98('0x3b')],_0x130537[_0xcd98('0x40')]),_0x546360);if(_0x3090c0[_0xcd98('0x3b')]['filter']){_0x32e945[_0xcd98('0x3f')]=_[_0xcd98('0x41')](_0x32e945['where'],{'$or':_[_0xcd98('0x31')](_0x546360,function(_0x25e792){if(_0x25e792['type']!==_0xcd98('0x42')){var _0x2e2b3c={};_0x2e2b3c[_0x25e792['name']]={'$like':'%'+_0x3090c0['query'][_0xcd98('0x43')]+'%'};return _0x2e2b3c;}})});}_0x32e945=_[_0xcd98('0x41')]({},_0x32e945,_0x3090c0[_0xcd98('0x44')]);var _0x5f5a9b={'where':_0x32e945[_0xcd98('0x3f')]};return db[_0xcd98('0x32')][_0xcd98('0x20')](_0x5f5a9b)[_0xcd98('0x28')](function(_0x108ffd){_0x57e1f8['count']=_0x108ffd;if(_0x3090c0[_0xcd98('0x3b')][_0xcd98('0x45')]){_0x32e945[_0xcd98('0x46')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x32e945);})[_0xcd98('0x28')](function(_0x4afda3){_0x57e1f8[_0xcd98('0x47')]=_0x4afda3;return _0x57e1f8;})[_0xcd98('0x28')](respondWithFilteredResult(_0x171a41,_0x32e945))['catch'](handleError(_0x171a41,null));};exports['show']=function(_0x1a4165,_0x2d00a7){var _0x569560={'raw':![],'where':{'id':_0x1a4165[_0xcd98('0x48')]['id']}},_0x70cbb8={};_0x70cbb8[_0xcd98('0x36')]=_['keys'](db[_0xcd98('0x32')][_0xcd98('0x33')]);_0x70cbb8[_0xcd98('0x3b')]=_['keys'](_0x1a4165['query']);_0x70cbb8[_0xcd98('0x40')]=_[_0xcd98('0x37')](_0x70cbb8[_0xcd98('0x36')],_0x70cbb8[_0xcd98('0x3b')]);_0x569560[_0xcd98('0x38')]=_['intersection'](_0x70cbb8[_0xcd98('0x36')],qs[_0xcd98('0x39')](_0x1a4165[_0xcd98('0x3b')]['fields']));_0x569560[_0xcd98('0x38')]=_0x569560[_0xcd98('0x38')][_0xcd98('0x3a')]?_0x569560['attributes']:_0x70cbb8[_0xcd98('0x36')];if(_0x1a4165[_0xcd98('0x3b')]['includeAll']){_0x569560['include']=[{'all':!![]}];}_0x569560=_[_0xcd98('0x41')]({},_0x569560,_0x1a4165[_0xcd98('0x44')]);return db[_0xcd98('0x32')][_0xcd98('0x49')](_0x569560)[_0xcd98('0x28')](handleEntityNotFound(_0x2d00a7,null))[_0xcd98('0x28')](respondWithResult(_0x2d00a7,null))[_0xcd98('0x4a')](handleError(_0x2d00a7,null));};exports[_0xcd98('0x4b')]=function(_0x5fd9a6,_0x1f318b){return db['Trigger'][_0xcd98('0x4b')](_0x5fd9a6[_0xcd98('0x4c')],{})['then'](function(_0x54a6f4){var _0x3beeb7=_0x5fd9a6['user']['get']({'plain':!![]});if(!_0x3beeb7)throw new Error(_0xcd98('0x4d'));if(_0x3beeb7['role']==='user'){var _0x254056=_0x54a6f4[_0xcd98('0x29')]({'plain':!![]});var _0xb88d6e='Triggers';return db[_0xcd98('0x4e')][_0xcd98('0x49')]({'where':{'name':_0xb88d6e,'userProfileId':_0x3beeb7[_0xcd98('0x4f')]},'raw':!![]})['then'](function(_0x56a8e1){if(_0x56a8e1&&_0x56a8e1[_0xcd98('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x254056['name'],'resourceId':_0x254056['id'],'type':_0x56a8e1[_0xcd98('0x2e')],'sectionId':_0x56a8e1['id']},{})['then'](function(){return _0x54a6f4;});}else{return _0x54a6f4;}})[_0xcd98('0x4a')](function(_0x511ebf){logger[_0xcd98('0x51')](_0xcd98('0x52'),_0x511ebf);throw _0x511ebf;});}return _0x54a6f4;})['then'](respondWithResult(_0x1f318b,0xc9))[_0xcd98('0x4a')](handleError(_0x1f318b,null));};exports[_0xcd98('0x27')]=function(_0x5550b1,_0x15e3ac){if(_0x5550b1['body']['id']){delete _0x5550b1[_0xcd98('0x4c')]['id'];}return db[_0xcd98('0x32')][_0xcd98('0x49')]({'where':{'id':_0x5550b1[_0xcd98('0x48')]['id']}})[_0xcd98('0x28')](handleEntityNotFound(_0x15e3ac,null))[_0xcd98('0x28')](saveUpdates(_0x5550b1[_0xcd98('0x4c')],null))[_0xcd98('0x28')](respondWithResult(_0x15e3ac,null))[_0xcd98('0x4a')](handleError(_0x15e3ac,null));};exports[_0xcd98('0x2c')]=function(_0x6034e5,_0x2abcb3){return db[_0xcd98('0x32')][_0xcd98('0x49')]({'where':{'id':_0x6034e5[_0xcd98('0x48')]['id']}})['then'](handleEntityNotFound(_0x2abcb3,null))[_0xcd98('0x28')](removeEntity(_0x2abcb3,null))['catch'](handleError(_0x2abcb3,null));};exports['addAllCondition']=function(_0x184579,_0x286a0b,_0x5db3ac){if(_0x184579[_0xcd98('0x4c')]['id']){delete _0x184579[_0xcd98('0x4c')]['id'];}return db[_0xcd98('0x32')][_0xcd98('0x49')]({'where':{'id':_0x184579[_0xcd98('0x48')]['id']}})[_0xcd98('0x28')](handleEntityNotFound(_0x286a0b,null))[_0xcd98('0x28')](function(_0x1cc786){if(_0x1cc786){_0x184579[_0xcd98('0x4c')][_0xcd98('0x53')]=_0x1cc786['id'];return db['Condition']['create'](_0x184579[_0xcd98('0x4c')]);}})['then'](respondWithResult(_0x286a0b,null))[_0xcd98('0x4a')](handleError(_0x286a0b,null));};exports[_0xcd98('0x54')]=function(_0x4c735e,_0x2593ef,_0x2ae205){if(_0x4c735e[_0xcd98('0x4c')]['id']){delete _0x4c735e[_0xcd98('0x4c')]['id'];}return db[_0xcd98('0x32')][_0xcd98('0x49')]({'where':{'id':_0x4c735e[_0xcd98('0x48')]['id']}})['then'](handleEntityNotFound(_0x2593ef,null))[_0xcd98('0x28')](function(_0x2fc7c5){if(_0x2fc7c5){_0x4c735e[_0xcd98('0x4c')][_0xcd98('0x55')]=_0x2fc7c5['id'];return db['Condition'][_0xcd98('0x4b')](_0x4c735e[_0xcd98('0x4c')]);}})[_0xcd98('0x28')](respondWithResult(_0x2593ef,null))[_0xcd98('0x4a')](handleError(_0x2593ef,null));};exports[_0xcd98('0x56')]=function(_0x1f6d81,_0x14b9c0,_0xb68189){var _0x3a2f37={};var _0x30ad56={};var _0x170cd4;var _0x1d477b;return db[_0xcd98('0x32')][_0xcd98('0x57')]({'where':{'id':_0x1f6d81['params']['id']}})[_0xcd98('0x28')](handleEntityNotFound(_0x14b9c0,null))[_0xcd98('0x28')](function(_0x423e0d){if(_0x423e0d){_0x170cd4=_0x423e0d;_0x30ad56['model']=_[_0xcd98('0x58')](db[_0xcd98('0x59')][_0xcd98('0x33')]);_0x30ad56[_0xcd98('0x3b')]=_['keys'](_0x1f6d81['query']);_0x30ad56[_0xcd98('0x40')]=_['intersection'](_0x30ad56['model'],_0x30ad56[_0xcd98('0x3b')]);_0x3a2f37[_0xcd98('0x38')]=_['intersection'](_0x30ad56['model'],qs[_0xcd98('0x39')](_0x1f6d81['query'][_0xcd98('0x39')]));_0x3a2f37[_0xcd98('0x38')]=_0x3a2f37[_0xcd98('0x38')]['length']?_0x3a2f37[_0xcd98('0x38')]:_0x30ad56[_0xcd98('0x36')];_0x3a2f37['order']=qs[_0xcd98('0x3e')](_0x1f6d81['query'][_0xcd98('0x3e')]);_0x3a2f37[_0xcd98('0x3f')]=qs['filters'](_[_0xcd98('0x5a')](_0x1f6d81[_0xcd98('0x3b')],_0x30ad56[_0xcd98('0x40')]));if(_0x1f6d81[_0xcd98('0x3b')][_0xcd98('0x43')]){_0x3a2f37[_0xcd98('0x3f')]=_[_0xcd98('0x41')](_0x3a2f37[_0xcd98('0x3f')],{'$or':_[_0xcd98('0x31')](_0x3a2f37[_0xcd98('0x38')],function(_0x434426){var _0x23b8bf={};_0x23b8bf[_0x434426]={'$like':'%'+_0x1f6d81[_0xcd98('0x3b')]['filter']+'%'};return _0x23b8bf;})});}_0x3a2f37=_[_0xcd98('0x41')]({},_0x3a2f37,_0x1f6d81[_0xcd98('0x44')]);return _0x170cd4[_0xcd98('0x56')](_0x3a2f37);}})[_0xcd98('0x28')](function(_0x590dd8){if(_0x590dd8){_0x1d477b=_0x590dd8[_0xcd98('0x3a')];if(!_0x1f6d81[_0xcd98('0x3b')]['hasOwnProperty']('nolimit')){_0x3a2f37[_0xcd98('0x1e')]=qs[_0xcd98('0x1e')](_0x1f6d81[_0xcd98('0x3b')]['limit']);_0x3a2f37[_0xcd98('0x1f')]=qs[_0xcd98('0x1f')](_0x1f6d81[_0xcd98('0x3b')][_0xcd98('0x1f')]);}return _0x170cd4[_0xcd98('0x56')](_0x3a2f37);}})['then'](function(_0x3947c3){if(_0x3947c3){return _0x3947c3?{'count':_0x1d477b,'rows':_0x3947c3}:null;}})[_0xcd98('0x28')](respondWithResult(_0x14b9c0,null))['catch'](handleError(_0x14b9c0,null));};exports[_0xcd98('0x5b')]=function(_0x5bceb9,_0x1206aa,_0xab57e){var _0x1e862a={};var _0x28170c={};var _0xc62095;var _0x5878af;return db[_0xcd98('0x32')][_0xcd98('0x57')]({'where':{'id':_0x5bceb9[_0xcd98('0x48')]['id']}})['then'](handleEntityNotFound(_0x1206aa,null))[_0xcd98('0x28')](function(_0x4e5ddc){if(_0x4e5ddc){_0xc62095=_0x4e5ddc;_0x28170c[_0xcd98('0x36')]=_[_0xcd98('0x58')](db[_0xcd98('0x59')][_0xcd98('0x33')]);_0x28170c['query']=_['keys'](_0x5bceb9[_0xcd98('0x3b')]);_0x28170c[_0xcd98('0x40')]=_[_0xcd98('0x37')](_0x28170c[_0xcd98('0x36')],_0x28170c['query']);_0x1e862a['attributes']=_['intersection'](_0x28170c[_0xcd98('0x36')],qs[_0xcd98('0x39')](_0x5bceb9[_0xcd98('0x3b')][_0xcd98('0x39')]));_0x1e862a[_0xcd98('0x38')]=_0x1e862a['attributes'][_0xcd98('0x3a')]?_0x1e862a[_0xcd98('0x38')]:_0x28170c[_0xcd98('0x36')];_0x1e862a[_0xcd98('0x5c')]=qs[_0xcd98('0x3e')](_0x5bceb9[_0xcd98('0x3b')][_0xcd98('0x3e')]);_0x1e862a[_0xcd98('0x3f')]=qs['filters'](_['pick'](_0x5bceb9[_0xcd98('0x3b')],_0x28170c['filters']));if(_0x5bceb9[_0xcd98('0x3b')][_0xcd98('0x43')]){_0x1e862a[_0xcd98('0x3f')]=_[_0xcd98('0x41')](_0x1e862a[_0xcd98('0x3f')],{'$or':_[_0xcd98('0x31')](_0x1e862a[_0xcd98('0x38')],function(_0x357700){var _0x425bb1={};_0x425bb1[_0x357700]={'$like':'%'+_0x5bceb9[_0xcd98('0x3b')]['filter']+'%'};return _0x425bb1;})});}_0x1e862a=_[_0xcd98('0x41')]({},_0x1e862a,_0x5bceb9[_0xcd98('0x44')]);return _0xc62095[_0xcd98('0x5b')](_0x1e862a);}})[_0xcd98('0x28')](function(_0x2f31d8){if(_0x2f31d8){_0x5878af=_0x2f31d8[_0xcd98('0x3a')];if(!_0x5bceb9[_0xcd98('0x3b')][_0xcd98('0x3c')](_0xcd98('0x3d'))){_0x1e862a[_0xcd98('0x1e')]=qs[_0xcd98('0x1e')](_0x5bceb9['query']['limit']);_0x1e862a['offset']=qs[_0xcd98('0x1f')](_0x5bceb9['query'][_0xcd98('0x1f')]);}return _0xc62095['getAnyConditions'](_0x1e862a);}})[_0xcd98('0x28')](function(_0x4fc104){if(_0x4fc104){return _0x4fc104?{'count':_0x5878af,'rows':_0x4fc104}:null;}})[_0xcd98('0x28')](respondWithResult(_0x1206aa,null))[_0xcd98('0x4a')](handleError(_0x1206aa,null));};exports['addAction']=function(_0x2bb055,_0x1c07b6,_0x333436){if(_0x2bb055[_0xcd98('0x4c')]['id']){delete _0x2bb055[_0xcd98('0x4c')]['id'];}return db[_0xcd98('0x32')]['find']({'where':{'id':_0x2bb055[_0xcd98('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c07b6,null))[_0xcd98('0x28')](function(_0x594340){if(_0x594340){_0x2bb055[_0xcd98('0x4c')][_0xcd98('0x5d')]=_0x594340['id'];return db[_0xcd98('0x5e')]['create'](_0x2bb055[_0xcd98('0x4c')]);}})[_0xcd98('0x28')](respondWithResult(_0x1c07b6,null))[_0xcd98('0x4a')](handleError(_0x1c07b6,null));};exports[_0xcd98('0x5f')]=function(_0x4778da,_0x4575a1,_0x2948a1){var _0x2d1f9f={};var _0x822ac7={};var _0xd771cc;var _0x49d551;return db['Trigger'][_0xcd98('0x57')]({'where':{'id':_0x4778da[_0xcd98('0x48')]['id']}})[_0xcd98('0x28')](handleEntityNotFound(_0x4575a1,null))[_0xcd98('0x28')](function(_0x25e743){if(_0x25e743){_0xd771cc=_0x25e743;_0x822ac7[_0xcd98('0x36')]=_[_0xcd98('0x58')](db[_0xcd98('0x5e')]['rawAttributes']);_0x822ac7['query']=_['keys'](_0x4778da['query']);_0x822ac7[_0xcd98('0x40')]=_['intersection'](_0x822ac7[_0xcd98('0x36')],_0x822ac7[_0xcd98('0x3b')]);_0x2d1f9f[_0xcd98('0x38')]=_[_0xcd98('0x37')](_0x822ac7[_0xcd98('0x36')],qs['fields'](_0x4778da[_0xcd98('0x3b')]['fields']));_0x2d1f9f[_0xcd98('0x38')]=_0x2d1f9f[_0xcd98('0x38')][_0xcd98('0x3a')]?_0x2d1f9f[_0xcd98('0x38')]:_0x822ac7['model'];_0x2d1f9f['order']=qs[_0xcd98('0x3e')](_0x4778da[_0xcd98('0x3b')][_0xcd98('0x3e')]);_0x2d1f9f[_0xcd98('0x3f')]=qs[_0xcd98('0x40')](_['pick'](_0x4778da[_0xcd98('0x3b')],_0x822ac7[_0xcd98('0x40')]));if(_0x4778da[_0xcd98('0x3b')][_0xcd98('0x43')]){_0x2d1f9f[_0xcd98('0x3f')]=_['merge'](_0x2d1f9f['where'],{'$or':_['map'](_0x2d1f9f[_0xcd98('0x38')],function(_0x28ac67){var _0x41e2e8={};_0x41e2e8[_0x28ac67]={'$like':'%'+_0x4778da['query']['filter']+'%'};return _0x41e2e8;})});}_0x2d1f9f=_[_0xcd98('0x41')]({},_0x2d1f9f,_0x4778da[_0xcd98('0x44')]);return _0xd771cc[_0xcd98('0x5f')](_0x2d1f9f);}})[_0xcd98('0x28')](function(_0x2f998c){if(_0x2f998c){_0x49d551=_0x2f998c[_0xcd98('0x3a')];if(!_0x4778da[_0xcd98('0x3b')][_0xcd98('0x3c')]('nolimit')){_0x2d1f9f[_0xcd98('0x1e')]=qs[_0xcd98('0x1e')](_0x4778da[_0xcd98('0x3b')][_0xcd98('0x1e')]);_0x2d1f9f['offset']=qs[_0xcd98('0x1f')](_0x4778da[_0xcd98('0x3b')]['offset']);}return _0xd771cc[_0xcd98('0x5f')](_0x2d1f9f);}})[_0xcd98('0x28')](function(_0x25bf8c){if(_0x25bf8c){return _0x25bf8c?{'count':_0x49d551,'rows':_0x25bf8c}:null;}})[_0xcd98('0x28')](respondWithResult(_0x4575a1,null))[_0xcd98('0x4a')](handleError(_0x4575a1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 715eae3..85516be 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 _0xa276=['Trigger','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x36eb51,_0x3aceff){var _0x4b677f=function(_0x354620){while(--_0x354620){_0x36eb51['push'](_0x36eb51['shift']());}};_0x4b677f(++_0x3aceff);}(_0xa276,0x9a));var _0x6a27=function(_0x105038,_0x4ead89){_0x105038=_0x105038-0x0;var _0x382c50=_0xa276[_0x105038];return _0x382c50;};'use strict';var _=require('lodash');var util=require(_0x6a27('0x0'));var logger=require(_0x6a27('0x1'))('api');var moment=require(_0x6a27('0x2'));var BPromise=require(_0x6a27('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a27('0x4'));var rimraf=require(_0x6a27('0x5'));var config=require(_0x6a27('0x6'));var attributes=require('./trigger.attributes');module[_0x6a27('0x7')]=function(_0x321087,_0x41c595){return _0x321087['define'](_0x6a27('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeea0=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4879b7,_0x10c129){var _0x55aa0b=function(_0x210a11){while(--_0x210a11){_0x4879b7['push'](_0x4879b7['shift']());}};_0x55aa0b(++_0x10c129);}(_0xeea0,0x91));var _0x0eea=function(_0x22a896,_0x36f1e5){_0x22a896=_0x22a896-0x0;var _0x57a2ff=_0xeea0[_0x22a896];return _0x57a2ff;};'use strict';var _=require(_0x0eea('0x0'));var util=require(_0x0eea('0x1'));var logger=require(_0x0eea('0x2'))(_0x0eea('0x3'));var moment=require(_0x0eea('0x4'));var BPromise=require('bluebird');var rp=require(_0x0eea('0x5'));var fs=require('fs');var path=require(_0x0eea('0x6'));var rimraf=require(_0x0eea('0x7'));var config=require(_0x0eea('0x8'));var attributes=require(_0x0eea('0x9'));module[_0x0eea('0xa')]=function(_0x2520ce,_0x47d7c8){return _0x2520ce[_0x0eea('0xb')](_0x0eea('0xc'),attributes,{'tableName':_0x0eea('0xd'),'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 f14e8ba..b12542b 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 _0x9ba8=['client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetTrigger','Trigger','options','attributes','include','map','model','ShowTrigger','find','raw','where','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x402e33,_0x527907){var _0x4f83dc=function(_0x27b86b){while(--_0x27b86b){_0x402e33['push'](_0x402e33['shift']());}};_0x4f83dc(++_0x527907);}(_0x9ba8,0x78));var _0x89ba=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0x9ba8[_0x38c0b2];return _0x283c00;};'use strict';var _=require(_0x89ba('0x0'));var util=require(_0x89ba('0x1'));var moment=require('moment');var BPromise=require(_0x89ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ba('0x3'));var db=require(_0x89ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x89ba('0x5'))(_0x89ba('0x6'));var config=require('../../config/environment');var jayson=require(_0x89ba('0x7'));var client=jayson[_0x89ba('0x8')][_0x89ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2466b8,_0x467222,_0x242a07){return new BPromise(function(_0x5f0b4c,_0x23464d){return client['request'](_0x2466b8,_0x242a07)[_0x89ba('0xa')](function(_0x1872b5){logger[_0x89ba('0xb')](_0x89ba('0xc'),_0x467222,_0x89ba('0xd'));logger[_0x89ba('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x467222,_0x89ba('0xd'),JSON['stringify'](_0x1872b5));if(_0x1872b5[_0x89ba('0xf')]){if(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x10')]===0x1f4){logger[_0x89ba('0xf')]('Trigger,\x20%s,\x20%s',_0x467222,_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);return _0x23464d(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);}logger[_0x89ba('0xf')](_0x89ba('0xc'),_0x467222,_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);return _0x5f0b4c(_0x1872b5[_0x89ba('0xf')][_0x89ba('0x11')]);}else{logger[_0x89ba('0xb')](_0x89ba('0xc'),_0x467222,_0x89ba('0xd'));_0x5f0b4c(_0x1872b5[_0x89ba('0x12')][_0x89ba('0x11')]);}})[_0x89ba('0x13')](function(_0x4af2ec){logger[_0x89ba('0xf')](_0x89ba('0xc'),_0x467222,_0x4af2ec);_0x23464d(_0x4af2ec);});});}exports[_0x89ba('0x14')]=function(_0x12984c){var _0x45a225=this;return new Promise(function(_0x3c510c,_0x1db985){return db[_0x89ba('0x15')]['findAll']({'raw':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')]['where']||null:null,'attributes':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')][_0x89ba('0x17')]||null:null,'limit':_0x12984c['options']?_0x12984c['options']['limit']||null:null,'include':_0x12984c[_0x89ba('0x16')]?_0x12984c[_0x89ba('0x16')][_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x12984c[_0x89ba('0x16')]['include'],function(_0x365944){return{'model':db[_0x365944[_0x89ba('0x1a')]],'as':_0x365944['as'],'attributes':_0x365944[_0x89ba('0x17')],'include':_0x365944['include']?_[_0x89ba('0x19')](_0x365944['include'],function(_0x469ece){return{'model':db[_0x469ece[_0x89ba('0x1a')]],'as':_0x469ece['as'],'attributes':_0x469ece[_0x89ba('0x17')],'include':_0x469ece[_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x469ece[_0x89ba('0x18')],function(_0x188cdf){return{'model':db[_0x188cdf['model']],'as':_0x188cdf['as'],'attributes':_0x188cdf['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ba('0xa')](function(_0x486c33){logger[_0x89ba('0xb')](_0x89ba('0x14'),_0x12984c);logger['debug'](_0x89ba('0x14'),_0x12984c,JSON['stringify'](_0x486c33));_0x3c510c(_0x486c33);})[_0x89ba('0x13')](function(_0x277184){logger[_0x89ba('0xf')](_0x89ba('0x14'),_0x277184['message'],_0x12984c);_0x1db985(_0x45a225[_0x89ba('0xf')](0x1f4,_0x277184[_0x89ba('0x11')]));});});};exports[_0x89ba('0x1b')]=function(_0x18b141){var _0x350740=this;return new Promise(function(_0x3fe50c,_0x333015){return db[_0x89ba('0x15')][_0x89ba('0x1c')]({'raw':_0x18b141[_0x89ba('0x16')]?_0x18b141['options'][_0x89ba('0x1d')]===undefined?!![]:![]:!![],'where':_0x18b141[_0x89ba('0x16')]?_0x18b141[_0x89ba('0x16')][_0x89ba('0x1e')]||null:null,'attributes':_0x18b141[_0x89ba('0x16')]?_0x18b141[_0x89ba('0x16')][_0x89ba('0x17')]||null:null,'include':_0x18b141[_0x89ba('0x16')]?_0x18b141['options'][_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x18b141[_0x89ba('0x16')]['include'],function(_0x367a24){return{'model':db[_0x367a24[_0x89ba('0x1a')]],'as':_0x367a24['as'],'attributes':_0x367a24[_0x89ba('0x17')],'include':_0x367a24[_0x89ba('0x18')]?_[_0x89ba('0x19')](_0x367a24[_0x89ba('0x18')],function(_0x2fb014){return{'model':db[_0x2fb014['model']],'as':_0x2fb014['as'],'attributes':_0x2fb014['attributes'],'include':_0x2fb014[_0x89ba('0x18')]?_['map'](_0x2fb014[_0x89ba('0x18')],function(_0x4339eb){return{'model':db[_0x4339eb[_0x89ba('0x1a')]],'as':_0x4339eb['as'],'attributes':_0x4339eb[_0x89ba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf74609){logger[_0x89ba('0xb')](_0x89ba('0x1b'),_0x18b141);logger[_0x89ba('0xe')](_0x89ba('0x1b'),_0x18b141,JSON[_0x89ba('0x1f')](_0xf74609));_0x3fe50c(_0xf74609);})['catch'](function(_0x28cba7){logger['error'](_0x89ba('0x1b'),_0x28cba7[_0x89ba('0x11')],_0x18b141);_0x333015(_0x350740[_0x89ba('0xf')](0x1f4,_0x28cba7[_0x89ba('0x11')]));});});}; \ No newline at end of file +var _0x7a8d=['include','map','model','debug','ShowTrigger','find','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit'];(function(_0x580d55,_0x2a7cf8){var _0xd691bb=function(_0x545674){while(--_0x545674){_0x580d55['push'](_0x580d55['shift']());}};_0xd691bb(++_0x2a7cf8);}(_0x7a8d,0xab));var _0xd7a8=function(_0x3baae2,_0x20d350){_0x3baae2=_0x3baae2-0x0;var _0x1ec0b6=_0x7a8d[_0x3baae2];return _0x1ec0b6;};'use strict';var _=require(_0xd7a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd7a8('0x1'));var rs=require(_0xd7a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7a8('0x3'))['db'];var utils=require(_0xd7a8('0x4'));var logger=require('../../config/logger')(_0xd7a8('0x5'));var config=require('../../config/environment');var jayson=require(_0xd7a8('0x6'));var client=jayson[_0xd7a8('0x7')][_0xd7a8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e5069,_0x522cfa,_0x33f6e3){return new BPromise(function(_0x53170c,_0x281234){return client['request'](_0x5e5069,_0x33f6e3)[_0xd7a8('0x9')](function(_0x51c311){logger[_0xd7a8('0xa')]('Trigger,\x20%s,\x20%s',_0x522cfa,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x522cfa,_0xd7a8('0xb'),JSON[_0xd7a8('0xc')](_0x51c311));if(_0x51c311['error']){if(_0x51c311[_0xd7a8('0xd')][_0xd7a8('0xe')]===0x1f4){logger[_0xd7a8('0xd')]('Trigger,\x20%s,\x20%s',_0x522cfa,_0x51c311['error'][_0xd7a8('0xf')]);return _0x281234(_0x51c311[_0xd7a8('0xd')][_0xd7a8('0xf')]);}logger['error'](_0xd7a8('0x10'),_0x522cfa,_0x51c311[_0xd7a8('0xd')][_0xd7a8('0xf')]);return _0x53170c(_0x51c311[_0xd7a8('0xd')][_0xd7a8('0xf')]);}else{logger[_0xd7a8('0xa')](_0xd7a8('0x10'),_0x522cfa,_0xd7a8('0xb'));_0x53170c(_0x51c311[_0xd7a8('0x11')][_0xd7a8('0xf')]);}})[_0xd7a8('0x12')](function(_0x1a6b52){logger['error'](_0xd7a8('0x10'),_0x522cfa,_0x1a6b52);_0x281234(_0x1a6b52);});});}exports[_0xd7a8('0x13')]=function(_0x1647e0){var _0x1442df=this;return new Promise(function(_0x2d48a7,_0x4c0ed8){return db[_0xd7a8('0x14')][_0xd7a8('0x15')]({'raw':_0x1647e0['options']?_0x1647e0[_0xd7a8('0x16')][_0xd7a8('0x17')]===undefined?!![]:![]:!![],'where':_0x1647e0[_0xd7a8('0x16')]?_0x1647e0[_0xd7a8('0x16')][_0xd7a8('0x18')]||null:null,'attributes':_0x1647e0[_0xd7a8('0x16')]?_0x1647e0['options'][_0xd7a8('0x19')]||null:null,'limit':_0x1647e0[_0xd7a8('0x16')]?_0x1647e0[_0xd7a8('0x16')][_0xd7a8('0x1a')]||null:null,'include':_0x1647e0['options']?_0x1647e0[_0xd7a8('0x16')][_0xd7a8('0x1b')]?_[_0xd7a8('0x1c')](_0x1647e0[_0xd7a8('0x16')][_0xd7a8('0x1b')],function(_0xb50084){return{'model':db[_0xb50084[_0xd7a8('0x1d')]],'as':_0xb50084['as'],'attributes':_0xb50084['attributes'],'include':_0xb50084['include']?_[_0xd7a8('0x1c')](_0xb50084[_0xd7a8('0x1b')],function(_0x2af1fe){return{'model':db[_0x2af1fe[_0xd7a8('0x1d')]],'as':_0x2af1fe['as'],'attributes':_0x2af1fe['attributes'],'include':_0x2af1fe[_0xd7a8('0x1b')]?_[_0xd7a8('0x1c')](_0x2af1fe[_0xd7a8('0x1b')],function(_0x41de55){return{'model':db[_0x41de55[_0xd7a8('0x1d')]],'as':_0x41de55['as'],'attributes':_0x41de55['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7a8('0x9')](function(_0x41e644){logger[_0xd7a8('0xa')](_0xd7a8('0x13'),_0x1647e0);logger[_0xd7a8('0x1e')](_0xd7a8('0x13'),_0x1647e0,JSON[_0xd7a8('0xc')](_0x41e644));_0x2d48a7(_0x41e644);})[_0xd7a8('0x12')](function(_0x1ac427){logger[_0xd7a8('0xd')]('GetTrigger',_0x1ac427[_0xd7a8('0xf')],_0x1647e0);_0x4c0ed8(_0x1442df[_0xd7a8('0xd')](0x1f4,_0x1ac427[_0xd7a8('0xf')]));});});};exports[_0xd7a8('0x1f')]=function(_0x5ee9fb){var _0xb0f33a=this;return new Promise(function(_0x44e349,_0x5eef89){return db[_0xd7a8('0x14')][_0xd7a8('0x20')]({'raw':_0x5ee9fb[_0xd7a8('0x16')]?_0x5ee9fb['options'][_0xd7a8('0x17')]===undefined?!![]:![]:!![],'where':_0x5ee9fb[_0xd7a8('0x16')]?_0x5ee9fb[_0xd7a8('0x16')][_0xd7a8('0x18')]||null:null,'attributes':_0x5ee9fb[_0xd7a8('0x16')]?_0x5ee9fb[_0xd7a8('0x16')][_0xd7a8('0x19')]||null:null,'include':_0x5ee9fb[_0xd7a8('0x16')]?_0x5ee9fb[_0xd7a8('0x16')][_0xd7a8('0x1b')]?_[_0xd7a8('0x1c')](_0x5ee9fb[_0xd7a8('0x16')]['include'],function(_0xe669c4){return{'model':db[_0xe669c4[_0xd7a8('0x1d')]],'as':_0xe669c4['as'],'attributes':_0xe669c4['attributes'],'include':_0xe669c4[_0xd7a8('0x1b')]?_[_0xd7a8('0x1c')](_0xe669c4[_0xd7a8('0x1b')],function(_0x3a6db4){return{'model':db[_0x3a6db4['model']],'as':_0x3a6db4['as'],'attributes':_0x3a6db4[_0xd7a8('0x19')],'include':_0x3a6db4[_0xd7a8('0x1b')]?_[_0xd7a8('0x1c')](_0x3a6db4[_0xd7a8('0x1b')],function(_0x2c6f9f){return{'model':db[_0x2c6f9f[_0xd7a8('0x1d')]],'as':_0x2c6f9f['as'],'attributes':_0x2c6f9f['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7a8('0x9')](function(_0x412fac){logger[_0xd7a8('0xa')](_0xd7a8('0x1f'),_0x5ee9fb);logger[_0xd7a8('0x1e')]('ShowTrigger',_0x5ee9fb,JSON[_0xd7a8('0xc')](_0x412fac));_0x44e349(_0x412fac);})['catch'](function(_0x10d029){logger[_0xd7a8('0xd')](_0xd7a8('0x1f'),_0x10d029['message'],_0x5ee9fb);_0x5eef89(_0xb0f33a[_0xd7a8('0xd')](0x1f4,_0x10d029['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d1bb276..40cab96 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 _0x9084=['show','post','/:id/clone','clone','update','/:id','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x9084,0x1aa));var _0x4908=function(_0x238d68,_0x125056){_0x238d68=_0x238d68-0x0;var _0x131417=_0x9084[_0x238d68];return _0x131417;};'use strict';var multer=require(_0x4908('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4908('0x1'));var router=express[_0x4908('0x2')]();var fs_extra=require(_0x4908('0x3'));var auth=require(_0x4908('0x4'));var interaction=require(_0x4908('0x5'));var config=require(_0x4908('0x6'));var controller=require(_0x4908('0x7'));router[_0x4908('0x8')]('/',auth['isAuthenticated'](),controller[_0x4908('0x9')]);router[_0x4908('0x8')]('/:id',auth[_0x4908('0xa')](),controller[_0x4908('0xb')]);router[_0x4908('0xc')](_0x4908('0xd'),auth[_0x4908('0xa')](),controller[_0x4908('0xe')]);router[_0x4908('0xc')]('/',auth[_0x4908('0xa')](),controller['create']);router['put']('/:id',auth[_0x4908('0xa')](),controller[_0x4908('0xf')]);router['delete'](_0x4908('0x10'),auth[_0x4908('0xa')](),controller[_0x4908('0x11')]);module[_0x4908('0x12')]=router; \ No newline at end of file +var _0x90a8=['show','post','/:id/clone','clone','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated'];(function(_0x5e5ab3,_0x378f77){var _0x51bddf=function(_0x53011e){while(--_0x53011e){_0x5e5ab3['push'](_0x5e5ab3['shift']());}};_0x51bddf(++_0x378f77);}(_0x90a8,0x126));var _0x890a=function(_0x4c6e1a,_0x537344){_0x4c6e1a=_0x4c6e1a-0x0;var _0x1c317b=_0x90a8[_0x4c6e1a];return _0x1c317b;};'use strict';var multer=require(_0x890a('0x0'));var util=require(_0x890a('0x1'));var path=require(_0x890a('0x2'));var timeout=require(_0x890a('0x3'));var express=require(_0x890a('0x4'));var router=express[_0x890a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x890a('0x6'));var interaction=require(_0x890a('0x7'));var config=require(_0x890a('0x8'));var controller=require(_0x890a('0x9'));router[_0x890a('0xa')]('/',auth['isAuthenticated'](),controller[_0x890a('0xb')]);router[_0x890a('0xa')](_0x890a('0xc'),auth[_0x890a('0xd')](),controller[_0x890a('0xe')]);router[_0x890a('0xf')](_0x890a('0x10'),auth[_0x890a('0xd')](),controller[_0x890a('0x11')]);router[_0x890a('0xf')]('/',auth[_0x890a('0xd')](),controller['create']);router['put'](_0x890a('0xc'),auth[_0x890a('0xd')](),controller[_0x890a('0x12')]);router[_0x890a('0x13')](_0x890a('0xc'),auth[_0x890a('0xd')](),controller[_0x890a('0x14')]);module[_0x890a('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 8c44421..c9e0cb5 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 _0xbca9=['sequelize','exports','name','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','nonat','update','outgoing','yes','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','dynamic','BOOLEAN'];(function(_0x4ab760,_0x426fad){var _0x1df3ff=function(_0x3b6e2f){while(--_0x3b6e2f){_0x4ab760['push'](_0x4ab760['shift']());}};_0x1df3ff(++_0x426fad);}(_0xbca9,0x84));var _0x9bca=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0xbca9[_0x347471];return _0x422b6a;};'use strict';var Sequelize=require(_0x9bca('0x0'));module[_0x9bca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9bca('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x4'),'user',_0x9bca('0x5')),'allowNull':![],'defaultValue':_0x9bca('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x6'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x9bca('0x7'),_0x9bca('0x8'),_0x9bca('0x9'),_0x9bca('0xa'),_0x9bca('0xb'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x9bca('0xc')]},'md5secret':{'type':Sequelize[_0x9bca('0xc')]},'remotesecret':{'type':Sequelize[_0x9bca('0xc')]},'transport':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':_0x9bca('0xd'),'set':function(_0x40f1d1){this[_0x9bca('0xe')](_0x9bca('0xf'),_0x40f1d1?_0x40f1d1['join'](','):null);},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0xf'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0x9bca('0x11')},'dtmfmode':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x12'),'info','shortinfo','inband','auto'),'defaultValue':_0x9bca('0x12')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x9bca('0x13'),_0x9bca('0x14'),_0x9bca('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9bca('0xc')]},'directmediadeny':{'type':Sequelize[_0x9bca('0xc')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x9bca('0x17'),'set':function(_0x209cca){this[_0x9bca('0xe')]('nat',_0x209cca?_0x209cca[_0x9bca('0x18')](','):null);},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0x19'))?this[_0x9bca('0x10')](_0x9bca('0x19'))['split'](','):null;},'comment':_0x9bca('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9bca('0xc')]},'pickupgroup':{'type':Sequelize[_0x9bca('0xc')]},'namedpickupgroup':{'type':Sequelize[_0x9bca('0xc')]},'language':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':_0x9bca('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x428441){this[_0x9bca('0xe')](_0x9bca('0x1c'),_0x428441?_0x428441[_0x9bca('0x18')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0x1c'))?this[_0x9bca('0x10')](_0x9bca('0x1c'))[_0x9bca('0x1d')](';'):null;},'comment':_0x9bca('0x1e')},'autoframing':{'type':Sequelize[_0x9bca('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':_0x9bca('0x1f'),'set':function(_0x1ae2c0){this[_0x9bca('0xe')]('insecure',_0x1ae2c0?_0x1ae2c0['join'](','):null);},'get':function(){return this[_0x9bca('0x10')](_0x9bca('0x20'))?this['getDataValue']('insecure')[_0x9bca('0x1d')](','):null;},'comment':_0x9bca('0x21')},'trustrpid':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9bca('0x3')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'accountcode':{'type':Sequelize[_0x9bca('0x22')](0xb)},'setvar':{'type':Sequelize[_0x9bca('0xc')]},'callerid':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9bca('0xc')]},'callcounter':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no'),'defaultValue':_0x9bca('0x16')},'busylevel':{'type':Sequelize[_0x9bca('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9bca('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9bca('0xc')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no',_0x9bca('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9bca('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'mailbox':{'type':Sequelize[_0x9bca('0xc')]},'session_timers':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x24'),_0x9bca('0x25'),_0x9bca('0x26'))},'session_expires':{'type':Sequelize[_0x9bca('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x9bca('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x9bca('0x27')),'defaultValue':_0x9bca('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x9bca('0xc')]},'regexten':{'type':Sequelize[_0x9bca('0xc')]},'fromdomain':{'type':Sequelize[_0x9bca('0xc')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no'),'defaultValue':_0x9bca('0x16')},'keepalive':{'type':Sequelize[_0x9bca('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x9bca('0xc')]},'defaultuser':{'type':Sequelize[_0x9bca('0xc')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9bca('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9bca('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no',_0x9bca('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9bca('0xc')]},'callbackextension':{'type':Sequelize[_0x9bca('0xc')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x9bca('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9bca('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x9bca('0xc')]},'contactdeny':{'type':Sequelize[_0x9bca('0xc')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x9bca('0xc')]},'use_q850_reason':{'type':Sequelize[_0x9bca('0xc')]},'maxforwards':{'type':Sequelize[_0x9bca('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9bca('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no',_0x9bca('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x9bca('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9bca('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0x9bca('0xc')]},'dtlscipher':{'type':Sequelize[_0x9bca('0xc')]},'dtlscafile':{'type':Sequelize[_0x9bca('0xc')]},'dtlscapath':{'type':Sequelize[_0x9bca('0xc')]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9bca('0xc')]},'usereqphone':{'type':Sequelize[_0x9bca('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9bca('0xc')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9bca('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9bca('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9bca('0xc')]},'mohsuggest':{'type':Sequelize[_0x9bca('0xc')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9bca('0xc')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x9bca('0x2a')},'canreinvite':{'type':Sequelize[_0x9bca('0x3')](_0x9bca('0x16'),'no',_0x9bca('0x13'),_0x9bca('0x14'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9bca('0xc')]},'otherFields':{'type':Sequelize[_0x9bca('0xc')]},'active':{'type':Sequelize[_0x9bca('0x2b')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':'no'}}; \ No newline at end of file +var _0x3549=['ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','rfc2833','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x3549,0x1ad));var _0x9354=function(_0xc4ce4c,_0x19202b){_0xc4ce4c=_0xc4ce4c-0x0;var _0x17d789=_0x3549[_0xc4ce4c];return _0x17d789;};'use strict';var Sequelize=require(_0x9354('0x0'));module[_0x9354('0x1')]={'name':{'type':Sequelize[_0x9354('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x4'),_0x9354('0x5'),_0x9354('0x6')),'allowNull':![],'defaultValue':_0x9354('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x7'),_0x9354('0x8'),_0x9354('0x9'),_0x9354('0xa'),'PROHIB_NOT_SCREENED',_0x9354('0xb'),_0x9354('0xc'),_0x9354('0xd'))},'deny':{'type':Sequelize[_0x9354('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x9354('0x2')]},'md5secret':{'type':Sequelize[_0x9354('0x2')]},'remotesecret':{'type':Sequelize[_0x9354('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x9354('0xe'),'set':function(_0x48e6d4){this[_0x9354('0xf')]('transport',_0x48e6d4?_0x48e6d4['join'](','):null);},'get':function(){return this[_0x9354('0x10')](_0x9354('0x11'))?this[_0x9354('0x10')](_0x9354('0x11'))[_0x9354('0x12')](','):null;},'comment':_0x9354('0x13')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x9354('0x14'),_0x9354('0x15'),_0x9354('0x16')),'defaultValue':_0x9354('0x17')},'directmedia':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no',_0x9354('0x19'),_0x9354('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9354('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x9354('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x9354('0x1b'),'set':function(_0x4539c1){this[_0x9354('0xf')](_0x9354('0x1c'),_0x4539c1?_0x4539c1['join'](','):null);},'get':function(){return this[_0x9354('0x10')](_0x9354('0x1c'))?this['getDataValue'](_0x9354('0x1c'))[_0x9354('0x12')](','):null;},'comment':_0x9354('0x1d')},'callgroup':{'type':Sequelize[_0x9354('0x2')]},'namedcallgroup':{'type':Sequelize[_0x9354('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9354('0x2')]},'language':{'type':Sequelize[_0x9354('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9354('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x9354('0x1e')},'allow':{'type':Sequelize[_0x9354('0x2')],'allowNull':![],'defaultValue':_0x9354('0x1f'),'set':function(_0x29644a){this['setDataValue'](_0x9354('0x20'),_0x29644a?_0x29644a[_0x9354('0x21')](';'):_0x9354('0x1f'));},'get':function(){return this[_0x9354('0x10')](_0x9354('0x20'))?this['getDataValue']('allow')[_0x9354('0x12')](';'):null;},'comment':_0x9354('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x9354('0x18'),'no')},'insecure':{'type':Sequelize[_0x9354('0x2')],'defaultValue':_0x9354('0x23'),'set':function(_0x4edb5a){this['setDataValue'](_0x9354('0x24'),_0x4edb5a?_0x4edb5a['join'](','):null);},'get':function(){return this['getDataValue'](_0x9354('0x24'))?this['getDataValue'](_0x9354('0x24'))[_0x9354('0x12')](','):null;},'comment':_0x9354('0x25')},'trustrpid':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no',_0x9354('0x26'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x9354('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x9354('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x9354('0x28')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9354('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x9354('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x9354('0x2')]},'videosupport':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no',_0x9354('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9354('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x9354('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x9354('0x2a'),'refuse',_0x9354('0x2b'))},'session_expires':{'type':Sequelize[_0x9354('0x27')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x2c'),_0x9354('0x2d')),'defaultValue':_0x9354('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x9354('0x2')]},'regexten':{'type':Sequelize[_0x9354('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no'),'defaultValue':_0x9354('0x18')},'keepalive':{'type':Sequelize[_0x9354('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x9354('0x2')]},'defaultuser':{'type':Sequelize[_0x9354('0x2')]},'rtptimeout':{'type':Sequelize[_0x9354('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9354('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no',_0x9354('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x9354('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x9354('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x9354('0x2')]},'contactdeny':{'type':Sequelize[_0x9354('0x2')]},'contactacl':{'type':Sequelize[_0x9354('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x9354('0x2')]},'use_q850_reason':{'type':Sequelize[_0x9354('0x2')]},'maxforwards':{'type':Sequelize[_0x9354('0x27')](0xb)},'encryption':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no')},'icesupport':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x9354('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no',_0x9354('0x2f'),_0x9354('0x30'))},'dtlsrekey':{'type':Sequelize[_0x9354('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9354('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x9354('0x2')]},'dtlscipher':{'type':Sequelize[_0x9354('0x2')]},'dtlscafile':{'type':Sequelize[_0x9354('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x31'),_0x9354('0x32'),_0x9354('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9354('0x2')]},'usereqphone':{'type':Sequelize[_0x9354('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x9354('0x2')]},'call_limit':{'type':Sequelize[_0x9354('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9354('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x9354('0x3')](_0x9354('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9354('0x2')]},'mohsuggest':{'type':Sequelize[_0x9354('0x2')]},'parkinglot':{'type':Sequelize[_0x9354('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9354('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x9354('0x18'),'no','nonat',_0x9354('0x1a'),_0x9354('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9354('0x2')]},'otherFields':{'type':Sequelize[_0x9354('0x2')]},'active':{'type':Sequelize[_0x9354('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 6d5698c..955ab34 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2065f7,_0x2f3111){var _0xdbb6fe=function(_0x53e4a9){while(--_0x53e4a9){_0x2065f7['push'](_0x2065f7['shift']());}};_0xdbb6fe(++_0x2f3111);}(_0x24ca,0x1bc));var _0xa24c=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x24ca[_0x576266];return _0x18234f;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file +var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','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','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x5e773f,_0x5c0a0c){var _0x4c8fd7=function(_0x3b7bcf){while(--_0x3b7bcf){_0x5e773f['push'](_0x5e773f['shift']());}};_0x4c8fd7(++_0x5c0a0c);}(_0x54ef,0x112));var _0xf54e=function(_0x4d9692,_0x3251c7){_0x4d9692=_0x4d9692-0x0;var _0x1db6b8=_0x54ef[_0x4d9692];return _0x1db6b8;};'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'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index cd4f1fa..4f72db0 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 _0x7e92=['define','Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x275f5d,_0x42d453){var _0x4be5b6=function(_0x4ffbf0){while(--_0x4ffbf0){_0x275f5d['push'](_0x275f5d['shift']());}};_0x4be5b6(++_0x42d453);}(_0x7e92,0x1bf));var _0x27e9=function(_0x53b30d,_0x27ae6f){_0x53b30d=_0x53b30d-0x0;var _0x1a5b33=_0x7e92[_0x53b30d];return _0x1a5b33;};'use strict';var _=require(_0x27e9('0x0'));var util=require(_0x27e9('0x1'));var logger=require('../../config/logger')(_0x27e9('0x2'));var moment=require(_0x27e9('0x3'));var BPromise=require(_0x27e9('0x4'));var rp=require(_0x27e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27e9('0x6'));var config=require(_0x27e9('0x7'));var attributes=require('./trunk.attributes');module[_0x27e9('0x8')]=function(_0x4ece9d,_0x59e816){return _0x4ece9d[_0x27e9('0x9')](_0x27e9('0xa'),attributes,{'tableName':_0x27e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4397=['../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger','moment','request-promise','path'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x4397,0x11d));var _0x7439=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x4397[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x7439('0x0'));var util=require('util');var logger=require(_0x7439('0x1'))('api');var moment=require(_0x7439('0x2'));var BPromise=require('bluebird');var rp=require(_0x7439('0x3'));var fs=require('fs');var path=require(_0x7439('0x4'));var rimraf=require('rimraf');var config=require(_0x7439('0x5'));var attributes=require(_0x7439('0x6'));module[_0x7439('0x7')]=function(_0xd7726f,_0x287389){return _0xd7726f['define'](_0x7439('0x8'),attributes,{'tableName':_0x7439('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 78f251c..db5e931 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 _0x4cd6=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include','map','model','then','ShowTrunk','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request'];(function(_0x509550,_0x532724){var _0x1b598b=function(_0x4caea2){while(--_0x4caea2){_0x509550['push'](_0x509550['shift']());}};_0x1b598b(++_0x532724);}(_0x4cd6,0x1c5));var _0x64cd=function(_0x18425b,_0x4e1dc7){_0x18425b=_0x18425b-0x0;var _0xefa5ae=_0x4cd6[_0x18425b];return _0xefa5ae;};'use strict';var _=require(_0x64cd('0x0'));var util=require(_0x64cd('0x1'));var moment=require('moment');var BPromise=require(_0x64cd('0x2'));var rs=require(_0x64cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64cd('0x4'))['db'];var utils=require(_0x64cd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x64cd('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x64cd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48df49,_0x105c8b,_0x23d110){return new BPromise(function(_0x5ab7fd,_0x5b6ce2){return client[_0x64cd('0x8')](_0x48df49,_0x23d110)['then'](function(_0x579f7a){logger[_0x64cd('0x9')](_0x64cd('0xa'),_0x105c8b,_0x64cd('0xb'));logger[_0x64cd('0xc')](_0x64cd('0xd'),_0x105c8b,_0x64cd('0xb'),JSON[_0x64cd('0xe')](_0x579f7a));if(_0x579f7a[_0x64cd('0xf')]){if(_0x579f7a[_0x64cd('0xf')][_0x64cd('0x10')]===0x1f4){logger[_0x64cd('0xf')](_0x64cd('0xa'),_0x105c8b,_0x579f7a[_0x64cd('0xf')][_0x64cd('0x11')]);return _0x5b6ce2(_0x579f7a[_0x64cd('0xf')][_0x64cd('0x11')]);}logger[_0x64cd('0xf')](_0x64cd('0xa'),_0x105c8b,_0x579f7a['error'][_0x64cd('0x11')]);return _0x5ab7fd(_0x579f7a['error'][_0x64cd('0x11')]);}else{logger[_0x64cd('0x9')](_0x64cd('0xa'),_0x105c8b,_0x64cd('0xb'));_0x5ab7fd(_0x579f7a[_0x64cd('0x12')][_0x64cd('0x11')]);}})[_0x64cd('0x13')](function(_0x3c1e6a){logger[_0x64cd('0xf')](_0x64cd('0xa'),_0x105c8b,_0x3c1e6a);_0x5b6ce2(_0x3c1e6a);});});}exports[_0x64cd('0x14')]=function(_0x40a5ee){var _0x274e75=this;return new Promise(function(_0x4d3246,_0x466f45){return db[_0x64cd('0x15')]['findAll']({'raw':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee['options'][_0x64cd('0x17')]===undefined?!![]:![]:!![],'where':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x18')]||null:null,'attributes':_0x40a5ee['options']?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x19')]||null:null,'limit':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x1a')]||null:null,'include':_0x40a5ee[_0x64cd('0x16')]?_0x40a5ee[_0x64cd('0x16')][_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x40a5ee[_0x64cd('0x16')]['include'],function(_0x2e658a){return{'model':db[_0x2e658a[_0x64cd('0x1d')]],'as':_0x2e658a['as'],'attributes':_0x2e658a[_0x64cd('0x19')],'include':_0x2e658a[_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x2e658a[_0x64cd('0x1b')],function(_0x21c23d){return{'model':db[_0x21c23d[_0x64cd('0x1d')]],'as':_0x21c23d['as'],'attributes':_0x21c23d[_0x64cd('0x19')],'include':_0x21c23d[_0x64cd('0x1b')]?_['map'](_0x21c23d[_0x64cd('0x1b')],function(_0x407ad6){return{'model':db[_0x407ad6[_0x64cd('0x1d')]],'as':_0x407ad6['as'],'attributes':_0x407ad6['attributes']};}):[]};}):[]};}):[]:[]})[_0x64cd('0x1e')](function(_0x6505e0){logger[_0x64cd('0x9')]('GetTrunk',_0x40a5ee);logger[_0x64cd('0xc')](_0x64cd('0x14'),_0x40a5ee,JSON['stringify'](_0x6505e0));_0x4d3246(_0x6505e0);})[_0x64cd('0x13')](function(_0x1a93f2){logger[_0x64cd('0xf')](_0x64cd('0x14'),_0x1a93f2[_0x64cd('0x11')],_0x40a5ee);_0x466f45(_0x274e75[_0x64cd('0xf')](0x1f4,_0x1a93f2[_0x64cd('0x11')]));});});};exports[_0x64cd('0x1f')]=function(_0xe719b3){var _0x34c021=this;return new Promise(function(_0x5dfab0,_0x1bb7ad){return db['Trunk'][_0x64cd('0x20')]({'raw':_0xe719b3['options']?_0xe719b3[_0x64cd('0x16')][_0x64cd('0x17')]===undefined?!![]:![]:!![],'where':_0xe719b3['options']?_0xe719b3[_0x64cd('0x16')]['where']||null:null,'attributes':_0xe719b3[_0x64cd('0x16')]?_0xe719b3['options'][_0x64cd('0x19')]||null:null,'include':_0xe719b3[_0x64cd('0x16')]?_0xe719b3[_0x64cd('0x16')][_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0xe719b3[_0x64cd('0x16')][_0x64cd('0x1b')],function(_0x303a25){return{'model':db[_0x303a25[_0x64cd('0x1d')]],'as':_0x303a25['as'],'attributes':_0x303a25[_0x64cd('0x19')],'include':_0x303a25[_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x303a25[_0x64cd('0x1b')],function(_0x134a91){return{'model':db[_0x134a91['model']],'as':_0x134a91['as'],'attributes':_0x134a91[_0x64cd('0x19')],'include':_0x134a91[_0x64cd('0x1b')]?_[_0x64cd('0x1c')](_0x134a91[_0x64cd('0x1b')],function(_0x4be637){return{'model':db[_0x4be637[_0x64cd('0x1d')]],'as':_0x4be637['as'],'attributes':_0x4be637[_0x64cd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x64cd('0x1e')](function(_0x392811){logger['info']('ShowTrunk',_0xe719b3);logger[_0x64cd('0xc')](_0x64cd('0x1f'),_0xe719b3,JSON[_0x64cd('0xe')](_0x392811));_0x5dfab0(_0x392811);})['catch'](function(_0x2a9311){logger[_0x64cd('0xf')](_0x64cd('0x1f'),_0x2a9311['message'],_0xe719b3);_0x1bb7ad(_0x34c021[_0x64cd('0xf')](0x1f4,_0x2a9311['message']));});});}; \ No newline at end of file +var _0x87d0=['GetTrunk','Trunk','findAll','raw','options','where','attributes','limit','include','map','model','debug','stringify','catch','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87d0,0x113));var _0x087d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x87d0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x087d('0x0'));var util=require(_0x087d('0x1'));var moment=require(_0x087d('0x2'));var BPromise=require(_0x087d('0x3'));var rs=require(_0x087d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x087d('0x5'))['db'];var utils=require(_0x087d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x087d('0x7'));var jayson=require(_0x087d('0x8'));var client=jayson[_0x087d('0x9')][_0x087d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33d051,_0x4355a9,_0x444b30){return new BPromise(function(_0x1023c7,_0x46c5dd){return client[_0x087d('0xb')](_0x33d051,_0x444b30)[_0x087d('0xc')](function(_0x4ca5eb){logger[_0x087d('0xd')]('Trunk,\x20%s,\x20%s',_0x4355a9,_0x087d('0xe'));logger['debug'](_0x087d('0xf'),_0x4355a9,_0x087d('0xe'),JSON['stringify'](_0x4ca5eb));if(_0x4ca5eb[_0x087d('0x10')]){if(_0x4ca5eb[_0x087d('0x10')][_0x087d('0x11')]===0x1f4){logger[_0x087d('0x10')](_0x087d('0x12'),_0x4355a9,_0x4ca5eb[_0x087d('0x10')][_0x087d('0x13')]);return _0x46c5dd(_0x4ca5eb['error']['message']);}logger['error'](_0x087d('0x12'),_0x4355a9,_0x4ca5eb[_0x087d('0x10')]['message']);return _0x1023c7(_0x4ca5eb[_0x087d('0x10')]['message']);}else{logger[_0x087d('0xd')](_0x087d('0x12'),_0x4355a9,_0x087d('0xe'));_0x1023c7(_0x4ca5eb[_0x087d('0x14')][_0x087d('0x13')]);}})['catch'](function(_0x3c213e){logger[_0x087d('0x10')](_0x087d('0x12'),_0x4355a9,_0x3c213e);_0x46c5dd(_0x3c213e);});});}exports[_0x087d('0x15')]=function(_0x4bfb86){var _0x52170d=this;return new Promise(function(_0x33c1ad,_0x32e246){return db[_0x087d('0x16')][_0x087d('0x17')]({'raw':_0x4bfb86['options']?_0x4bfb86['options'][_0x087d('0x18')]===undefined?!![]:![]:!![],'where':_0x4bfb86['options']?_0x4bfb86[_0x087d('0x19')][_0x087d('0x1a')]||null:null,'attributes':_0x4bfb86[_0x087d('0x19')]?_0x4bfb86[_0x087d('0x19')][_0x087d('0x1b')]||null:null,'limit':_0x4bfb86[_0x087d('0x19')]?_0x4bfb86[_0x087d('0x19')][_0x087d('0x1c')]||null:null,'include':_0x4bfb86[_0x087d('0x19')]?_0x4bfb86[_0x087d('0x19')][_0x087d('0x1d')]?_[_0x087d('0x1e')](_0x4bfb86[_0x087d('0x19')][_0x087d('0x1d')],function(_0x3b7347){return{'model':db[_0x3b7347[_0x087d('0x1f')]],'as':_0x3b7347['as'],'attributes':_0x3b7347[_0x087d('0x1b')],'include':_0x3b7347[_0x087d('0x1d')]?_[_0x087d('0x1e')](_0x3b7347[_0x087d('0x1d')],function(_0x1a3fc2){return{'model':db[_0x1a3fc2[_0x087d('0x1f')]],'as':_0x1a3fc2['as'],'attributes':_0x1a3fc2[_0x087d('0x1b')],'include':_0x1a3fc2['include']?_[_0x087d('0x1e')](_0x1a3fc2[_0x087d('0x1d')],function(_0x24451e){return{'model':db[_0x24451e['model']],'as':_0x24451e['as'],'attributes':_0x24451e['attributes']};}):[]};}):[]};}):[]:[]})[_0x087d('0xc')](function(_0x2f6e46){logger['info'](_0x087d('0x15'),_0x4bfb86);logger[_0x087d('0x20')](_0x087d('0x15'),_0x4bfb86,JSON[_0x087d('0x21')](_0x2f6e46));_0x33c1ad(_0x2f6e46);})[_0x087d('0x22')](function(_0x42e1b3){logger['error'](_0x087d('0x15'),_0x42e1b3[_0x087d('0x13')],_0x4bfb86);_0x32e246(_0x52170d[_0x087d('0x10')](0x1f4,_0x42e1b3['message']));});});};exports[_0x087d('0x23')]=function(_0x47e948){var _0x5224c2=this;return new Promise(function(_0x44757d,_0xb8e64b){return db[_0x087d('0x16')][_0x087d('0x24')]({'raw':_0x47e948[_0x087d('0x19')]?_0x47e948[_0x087d('0x19')][_0x087d('0x18')]===undefined?!![]:![]:!![],'where':_0x47e948[_0x087d('0x19')]?_0x47e948['options'][_0x087d('0x1a')]||null:null,'attributes':_0x47e948[_0x087d('0x19')]?_0x47e948[_0x087d('0x19')][_0x087d('0x1b')]||null:null,'include':_0x47e948[_0x087d('0x19')]?_0x47e948[_0x087d('0x19')][_0x087d('0x1d')]?_['map'](_0x47e948[_0x087d('0x19')][_0x087d('0x1d')],function(_0x537025){return{'model':db[_0x537025[_0x087d('0x1f')]],'as':_0x537025['as'],'attributes':_0x537025[_0x087d('0x1b')],'include':_0x537025['include']?_[_0x087d('0x1e')](_0x537025['include'],function(_0x496246){return{'model':db[_0x496246[_0x087d('0x1f')]],'as':_0x496246['as'],'attributes':_0x496246[_0x087d('0x1b')],'include':_0x496246[_0x087d('0x1d')]?_[_0x087d('0x1e')](_0x496246['include'],function(_0x540504){return{'model':db[_0x540504[_0x087d('0x1f')]],'as':_0x540504['as'],'attributes':_0x540504[_0x087d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x087d('0xc')](function(_0x248d4e){logger['info'](_0x087d('0x23'),_0x47e948);logger[_0x087d('0x20')](_0x087d('0x23'),_0x47e948,JSON[_0x087d('0x21')](_0x248d4e));_0x44757d(_0x248d4e);})[_0x087d('0x22')](function(_0x2318cf){logger['error'](_0x087d('0x23'),_0x2318cf[_0x087d('0x13')],_0x47e948);_0xb8e64b(_0x5224c2[_0x087d('0x10')](0x1f4,_0x2318cf[_0x087d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9d82611..1ddc113 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 _0xa005=['originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','/:id','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','/:id/queues','addQueues','join','server/files/images/','format','%s-%s','now'];(function(_0x365d50,_0x11f4ee){var _0x5c2d23=function(_0x624e9d){while(--_0x624e9d){_0x365d50['push'](_0x365d50['shift']());}};_0x5c2d23(++_0x11f4ee);}(_0xa005,0x18e));var _0x5a00=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0xa005[_0x53a7a8];return _0x555f71;};'use strict';var multer=require(_0x5a00('0x0'));var util=require(_0x5a00('0x1'));var path=require(_0x5a00('0x2'));var timeout=require(_0x5a00('0x3'));var express=require(_0x5a00('0x4'));var router=express[_0x5a00('0x5')]();var fs_extra=require(_0x5a00('0x6'));var auth=require(_0x5a00('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5a00('0x8'));var controller=require(_0x5a00('0x9'));router[_0x5a00('0xa')]('/',auth[_0x5a00('0xb')](),controller[_0x5a00('0xc')]);router['get'](_0x5a00('0xd'),auth[_0x5a00('0xb')](),controller[_0x5a00('0xe')]);router[_0x5a00('0xa')]('/whoami',auth[_0x5a00('0xb')](),controller[_0x5a00('0xf')]);router[_0x5a00('0xa')](_0x5a00('0x10'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x11')]);router[_0x5a00('0xa')]('/:id',auth[_0x5a00('0xb')](),controller[_0x5a00('0x12')]);router[_0x5a00('0xa')](_0x5a00('0x13'),controller[_0x5a00('0x14')]);router[_0x5a00('0xa')]('/:id/open_tabs',auth[_0x5a00('0xb')](),controller[_0x5a00('0x15')]);router[_0x5a00('0xa')](_0x5a00('0x16'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x17')]);router[_0x5a00('0xa')]('/:id/queues',auth['isAuthenticated'](),controller[_0x5a00('0x18')]);router[_0x5a00('0xa')](_0x5a00('0x19'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x1a')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router['get']('/:id/recordings',auth[_0x5a00('0xb')](),controller['getRecordings']);router[_0x5a00('0xa')](_0x5a00('0x1b'),auth['isAuthenticated'](),controller[_0x5a00('0x1c')]);router['get'](_0x5a00('0x1d'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x1e')]);router[_0x5a00('0xa')](_0x5a00('0x1f'),auth['isAuthenticated'](),controller[_0x5a00('0x20')]);router[_0x5a00('0xa')](_0x5a00('0x21'),auth[_0x5a00('0xb')](),controller['getMailInteractions']);router[_0x5a00('0xa')](_0x5a00('0x22'),auth['isAuthenticated'](),controller[_0x5a00('0x23')]);router[_0x5a00('0xa')](_0x5a00('0x24'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x25')]);router[_0x5a00('0xa')](_0x5a00('0x26'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x27')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x5a00('0x28')]);router[_0x5a00('0xa')]('/:id/lists',auth[_0x5a00('0xb')](),controller[_0x5a00('0x29')]);router[_0x5a00('0xa')]('/:id/agents',auth[_0x5a00('0xb')](),controller[_0x5a00('0x2a')]);router[_0x5a00('0xa')](_0x5a00('0x2b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x2c')]);router[_0x5a00('0xa')](_0x5a00('0x2d'),auth[_0x5a00('0xb')](),controller['getFaxAccounts']);router[_0x5a00('0xa')]('/:id/mail_accounts',auth[_0x5a00('0xb')](),controller['getMailAccounts']);router['get']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x5a00('0x2e')]);router[_0x5a00('0xa')](_0x5a00('0x2f'),auth[_0x5a00('0xb')](),controller['getSmsAccounts']);router['get'](_0x5a00('0x30'),auth[_0x5a00('0xb')](),controller['getChatWebsites']);router[_0x5a00('0xa')](_0x5a00('0x31'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x32')]);router['get'](_0x5a00('0x33'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x34')]);router[_0x5a00('0xa')]('/:id/scheduled_calls',auth[_0x5a00('0xb')](),controller[_0x5a00('0x35')]);router[_0x5a00('0xa')]('/:id/api_key',auth[_0x5a00('0xb')](),controller[_0x5a00('0x36')]);router[_0x5a00('0x37')](_0x5a00('0x16'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x38')]);router[_0x5a00('0x37')]('/',auth['isAuthenticated'](),controller[_0x5a00('0x39')]);router[_0x5a00('0x37')](_0x5a00('0x3a'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x5a00('0x37')](_0x5a00('0x3b'),auth['isAuthenticated'](),controller[_0x5a00('0x3c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a25ae,_0x310bb4,_0x4bae14){_0x4bae14(null,path[_0x5a00('0x3d')](config['root'],_0x5a00('0x3e')));},'filename':function(_0x4137cc,_0x27f71e,_0x4e2eab){_0x4e2eab(null,util[_0x5a00('0x3f')](_0x5a00('0x40'),Date[_0x5a00('0x41')](),_0x27f71e[_0x5a00('0x42')]));}})});router[_0x5a00('0x37')](_0x5a00('0x13'),upload['single'](_0x5a00('0x43')),controller[_0x5a00('0x44')]);router[_0x5a00('0x37')](_0x5a00('0x45'),auth['isAuthenticated'](),controller[_0x5a00('0x46')]);router[_0x5a00('0x37')](_0x5a00('0x47'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x48')]);router[_0x5a00('0x37')](_0x5a00('0x49'),auth['isAuthenticated'](),controller[_0x5a00('0x4a')]);router['post'](_0x5a00('0x4b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x4c')]);router['post'](_0x5a00('0x4d'),auth['isAuthenticated'](),controller[_0x5a00('0x4e')]);router[_0x5a00('0x37')](_0x5a00('0x4f'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x50')]);router[_0x5a00('0x37')](_0x5a00('0x51'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x52')]);router['post'](_0x5a00('0x53'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x54')]);router['post']('/:id/sms_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x55')]);router[_0x5a00('0x37')](_0x5a00('0x56'),auth['isAuthenticated'](),controller[_0x5a00('0x57')]);router[_0x5a00('0x37')]('/:id/whatsapp_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x58')]);router[_0x5a00('0x37')]('/:id/fax_accounts',auth[_0x5a00('0xb')](),controller[_0x5a00('0x59')]);router['post'](_0x5a00('0x5a'),auth[_0x5a00('0xb')](),controller['addMailAccounts']);router['post'](_0x5a00('0x5b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5c')]);router[_0x5a00('0x37')](_0x5a00('0x2f'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5d')]);router[_0x5a00('0x37')](_0x5a00('0x30'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5e')]);router[_0x5a00('0x37')](_0x5a00('0x31'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x5f')]);router[_0x5a00('0x37')](_0x5a00('0x33'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x60')]);router[_0x5a00('0x37')](_0x5a00('0x61'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x62')]);router[_0x5a00('0x63')](_0x5a00('0x64'),auth[_0x5a00('0xb')](),controller['update']);router['put']('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0x5a00('0x65')](_0x5a00('0x3b'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x66')]);router['delete']('/:id/teams',auth[_0x5a00('0xb')](),controller[_0x5a00('0x67')]);router[_0x5a00('0x65')](_0x5a00('0x64'),auth[_0x5a00('0xb')](),controller['destroy']);router[_0x5a00('0x65')]('/:id/chat_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x68')]);router[_0x5a00('0x65')](_0x5a00('0x51'),auth['isAuthenticated'](),controller[_0x5a00('0x69')]);router[_0x5a00('0x65')]('/:id/fax_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x6a')]);router[_0x5a00('0x65')]('/:id/sms_interactions',auth[_0x5a00('0xb')](),controller[_0x5a00('0x6b')]);router[_0x5a00('0x65')](_0x5a00('0x56'),auth[_0x5a00('0xb')](),controller['removeOpenchannelInteractions']);router[_0x5a00('0x65')](_0x5a00('0x6c'),auth['isAuthenticated'](),controller[_0x5a00('0x6d')]);router[_0x5a00('0x65')](_0x5a00('0x2d'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x6e')]);router[_0x5a00('0x65')](_0x5a00('0x5a'),auth['isAuthenticated'](),controller[_0x5a00('0x6f')]);router['delete'](_0x5a00('0x5b'),auth[_0x5a00('0xb')](),controller['removeOpenchannelAccounts']);router[_0x5a00('0x65')](_0x5a00('0x2f'),auth['isAuthenticated'](),controller[_0x5a00('0x70')]);router[_0x5a00('0x65')](_0x5a00('0x30'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x71')]);router[_0x5a00('0x65')]('/:id/whatsapp_accounts',auth[_0x5a00('0xb')](),controller['removeWhatsappAccounts']);router[_0x5a00('0x65')](_0x5a00('0x33'),auth[_0x5a00('0xb')](),controller[_0x5a00('0x72')]);router['delete'](_0x5a00('0x61'),auth[_0x5a00('0xb')](),controller['removeApiKey']);module[_0x5a00('0x73')]=router; \ No newline at end of file +var _0x758e=['/:id/contacts','/:id/queues','getQueues','/:id/groups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','addContacts','post','/create_many','bulkCreate','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addWhatsappAccounts','/:id/api_key','put','update','/:id/password','delete','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','whoami','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs'];(function(_0x5d15a4,_0x2e50e3){var _0x504b50=function(_0x45cf6c){while(--_0x45cf6c){_0x5d15a4['push'](_0x5d15a4['shift']());}};_0x504b50(++_0x2e50e3);}(_0x758e,0x143));var _0xe758=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x758e[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xe758('0x0'));var util=require(_0xe758('0x1'));var path=require(_0xe758('0x2'));var timeout=require(_0xe758('0x3'));var express=require(_0xe758('0x4'));var router=express[_0xe758('0x5')]();var fs_extra=require(_0xe758('0x6'));var auth=require(_0xe758('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe758('0x8'));var controller=require(_0xe758('0x9'));router['get']('/',auth[_0xe758('0xa')](),controller[_0xe758('0xb')]);router[_0xe758('0xc')](_0xe758('0xd'),auth[_0xe758('0xa')](),controller[_0xe758('0xe')]);router[_0xe758('0xc')]('/whoami',auth[_0xe758('0xa')](),controller[_0xe758('0xf')]);router[_0xe758('0xc')](_0xe758('0x10'),auth['isAuthenticated'](),controller['getPresence']);router[_0xe758('0xc')](_0xe758('0x11'),auth[_0xe758('0xa')](),controller['show']);router['get'](_0xe758('0x12'),controller[_0xe758('0x13')]);router[_0xe758('0xc')](_0xe758('0x14'),auth[_0xe758('0xa')](),controller[_0xe758('0x15')]);router[_0xe758('0xc')](_0xe758('0x16'),auth[_0xe758('0xa')](),controller['getContacts']);router[_0xe758('0xc')](_0xe758('0x17'),auth[_0xe758('0xa')](),controller[_0xe758('0x18')]);router[_0xe758('0xc')]('/:id/queues_rt',auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0xe758('0xc')](_0xe758('0x19'),auth[_0xe758('0xa')](),controller['getGroups']);router['get']('/:id/recordings',auth['isAuthenticated'](),controller[_0xe758('0x1a')]);router['get'](_0xe758('0x1b'),auth[_0xe758('0xa')](),controller[_0xe758('0x1c')]);router['get']('/:id/chat/interactions',auth[_0xe758('0xa')](),controller[_0xe758('0x1d')]);router[_0xe758('0xc')](_0xe758('0x1e'),auth[_0xe758('0xa')](),controller['getOpenchannelInteractions']);router[_0xe758('0xc')]('/:id/mail/interactions',auth[_0xe758('0xa')](),controller[_0xe758('0x1f')]);router['get'](_0xe758('0x20'),auth['isAuthenticated'](),controller[_0xe758('0x21')]);router[_0xe758('0xc')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xe758('0x22')]);router[_0xe758('0xc')](_0xe758('0x23'),auth['isAuthenticated'](),controller[_0xe758('0x24')]);router[_0xe758('0xc')](_0xe758('0x25'),auth[_0xe758('0xa')](),controller[_0xe758('0x26')]);router[_0xe758('0xc')]('/:id/lists',auth[_0xe758('0xa')](),controller['getLists']);router[_0xe758('0xc')](_0xe758('0x27'),auth[_0xe758('0xa')](),controller[_0xe758('0x28')]);router[_0xe758('0xc')](_0xe758('0x29'),auth['isAuthenticated'](),controller[_0xe758('0x2a')]);router['get'](_0xe758('0x2b'),auth[_0xe758('0xa')](),controller[_0xe758('0x2c')]);router[_0xe758('0xc')](_0xe758('0x2d'),auth[_0xe758('0xa')](),controller[_0xe758('0x2e')]);router[_0xe758('0xc')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xe758('0x2f')]);router[_0xe758('0xc')]('/:id/sms_accounts',auth[_0xe758('0xa')](),controller[_0xe758('0x30')]);router[_0xe758('0xc')](_0xe758('0x31'),auth[_0xe758('0xa')](),controller[_0xe758('0x32')]);router[_0xe758('0xc')](_0xe758('0x33'),auth[_0xe758('0xa')](),controller[_0xe758('0x34')]);router[_0xe758('0xc')](_0xe758('0x35'),auth[_0xe758('0xa')](),controller[_0xe758('0x36')]);router[_0xe758('0xc')](_0xe758('0x37'),auth[_0xe758('0xa')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth['isAuthenticated'](),controller[_0xe758('0x38')]);router['post'](_0xe758('0x16'),auth[_0xe758('0xa')](),controller[_0xe758('0x39')]);router[_0xe758('0x3a')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe758('0x3a')](_0xe758('0x3b'),auth[_0xe758('0xa')](),controller[_0xe758('0x3c')]);router['post'](_0xe758('0x17'),auth[_0xe758('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0xe758('0x3d')]({'destination':function(_0x48ba80,_0x20c228,_0xb0e209){_0xb0e209(null,path['join'](config[_0xe758('0x3e')],_0xe758('0x3f')));},'filename':function(_0x351999,_0x8b5c,_0xc5f966){_0xc5f966(null,util[_0xe758('0x40')](_0xe758('0x41'),Date[_0xe758('0x42')](),_0x8b5c[_0xe758('0x43')]));}})});router['post'](_0xe758('0x12'),upload[_0xe758('0x44')](_0xe758('0x45')),controller[_0xe758('0x46')]);router[_0xe758('0x3a')](_0xe758('0x47'),auth[_0xe758('0xa')](),controller[_0xe758('0x48')]);router[_0xe758('0x3a')](_0xe758('0x49'),auth[_0xe758('0xa')](),controller[_0xe758('0x4a')]);router[_0xe758('0x3a')](_0xe758('0x4b'),auth['isAuthenticated'](),controller[_0xe758('0x4c')]);router['post']('/:id/unpause',auth[_0xe758('0xa')](),controller[_0xe758('0x4d')]);router[_0xe758('0x3a')](_0xe758('0x25'),auth[_0xe758('0xa')](),controller[_0xe758('0x4e')]);router['post']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xe758('0x4f')]);router[_0xe758('0x3a')](_0xe758('0x50'),auth[_0xe758('0xa')](),controller[_0xe758('0x51')]);router[_0xe758('0x3a')](_0xe758('0x52'),auth[_0xe758('0xa')](),controller[_0xe758('0x53')]);router[_0xe758('0x3a')]('/:id/sms_interactions',auth[_0xe758('0xa')](),controller[_0xe758('0x54')]);router[_0xe758('0x3a')]('/:id/openchannel_interactions',auth[_0xe758('0xa')](),controller[_0xe758('0x55')]);router['post'](_0xe758('0x56'),auth[_0xe758('0xa')](),controller[_0xe758('0x57')]);router[_0xe758('0x3a')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xe758('0x58')]);router[_0xe758('0x3a')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xe758('0x59')]);router['post'](_0xe758('0x5a'),auth[_0xe758('0xa')](),controller[_0xe758('0x5b')]);router[_0xe758('0x3a')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['addSmsAccounts']);router['post'](_0xe758('0x31'),auth[_0xe758('0xa')](),controller['addChatWebsites']);router[_0xe758('0x3a')](_0xe758('0x33'),auth[_0xe758('0xa')](),controller[_0xe758('0x5c')]);router[_0xe758('0x3a')](_0xe758('0x35'),auth[_0xe758('0xa')](),controller['addSquareProjects']);router[_0xe758('0x3a')](_0xe758('0x5d'),auth[_0xe758('0xa')](),controller['createApiKey']);router[_0xe758('0x5e')]('/:id',auth[_0xe758('0xa')](),controller[_0xe758('0x5f')]);router[_0xe758('0x5e')](_0xe758('0x60'),auth['isAuthenticated'](),controller['changePassword']);router[_0xe758('0x61')](_0xe758('0x17'),auth[_0xe758('0xa')](),controller['removeQueues']);router[_0xe758('0x61')](_0xe758('0x25'),auth[_0xe758('0xa')](),controller[_0xe758('0x62')]);router[_0xe758('0x61')](_0xe758('0x11'),auth['isAuthenticated'](),controller[_0xe758('0x63')]);router[_0xe758('0x61')]('/:id/chat_interactions',auth[_0xe758('0xa')](),controller[_0xe758('0x64')]);router[_0xe758('0x61')](_0xe758('0x50'),auth[_0xe758('0xa')](),controller['removeMailInteractions']);router[_0xe758('0x61')](_0xe758('0x52'),auth[_0xe758('0xa')](),controller[_0xe758('0x65')]);router[_0xe758('0x61')](_0xe758('0x66'),auth['isAuthenticated'](),controller[_0xe758('0x67')]);router[_0xe758('0x61')](_0xe758('0x68'),auth[_0xe758('0xa')](),controller[_0xe758('0x69')]);router['delete'](_0xe758('0x56'),auth[_0xe758('0xa')](),controller[_0xe758('0x6a')]);router[_0xe758('0x61')](_0xe758('0x2b'),auth[_0xe758('0xa')](),controller['removeFaxAccounts']);router[_0xe758('0x61')](_0xe758('0x2d'),auth[_0xe758('0xa')](),controller[_0xe758('0x6b')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xe758('0x6c')]);router[_0xe758('0x61')](_0xe758('0x6d'),auth['isAuthenticated'](),controller[_0xe758('0x6e')]);router[_0xe758('0x61')](_0xe758('0x31'),auth[_0xe758('0xa')](),controller[_0xe758('0x6f')]);router[_0xe758('0x61')](_0xe758('0x33'),auth['isAuthenticated'](),controller[_0xe758('0x70')]);router[_0xe758('0x61')](_0xe758('0x35'),auth['isAuthenticated'](),controller[_0xe758('0x71')]);router[_0xe758('0x61')](_0xe758('0x5d'),auth[_0xe758('0xa')](),controller[_0xe758('0x72')]);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 7a61206..f25ca1c 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 _0x3cff=['STRING','name','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','internal','email','setDataValue','ENUM','admin','user','telephone','INTEGER','format','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','TEXT','get','isArray','wss','encryption','avpf','icesupport','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','force_avp','dtlsenable','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','lodash','exports'];(function(_0x1484d6,_0x287c78){var _0xd03c54=function(_0x53c791){while(--_0x53c791){_0x1484d6['push'](_0x1484d6['shift']());}};_0xd03c54(++_0x287c78);}(_0x3cff,0x160));var _0xf3cf=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0x3cff[_0x1635fe];return _0x3c512a;};'use strict';var Sequelize=require(_0xf3cf('0x0'));var moment=require(_0xf3cf('0x1'));var util=require('util');var _=require(_0xf3cf('0x2'));module[_0xf3cf('0x3')]={'name':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'unique':_0xf3cf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2344c6){this['setDataValue'](_0xf3cf('0x5'),_0x2344c6);this['setDataValue'](_0xf3cf('0x6'),_0x2344c6);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'set':function(_0x16d6b8){this['setDataValue'](_0xf3cf('0x7'),_0x16d6b8);this['setDataValue'](_0xf3cf('0x8'),util['format'](_0xf3cf('0x9'),_0x16d6b8,this['getDataValue'](_0xf3cf('0xa'))));}},'alias':{'type':Sequelize[_0xf3cf('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf3cf('0xb'),'validate':{'isEmail':!![]},'set':function(_0x5a9b6a){if(_0x5a9b6a){this[_0xf3cf('0xc')](_0xf3cf('0xb'),_0x5a9b6a['toLowerCase']());}}},'role':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0xe'),_0xf3cf('0xf'),'agent',_0xf3cf('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':![],'unique':_0xf3cf('0xa'),'set':function(_0x1fc8dc){this[_0xf3cf('0xc')](_0xf3cf('0xa'),_0x1fc8dc);this[_0xf3cf('0xc')]('accountcode',_0x1fc8dc);this[_0xf3cf('0xc')](_0xf3cf('0x8'),util[_0xf3cf('0x12')](_0xf3cf('0x9'),this[_0xf3cf('0x13')](_0xf3cf('0x7')),_0x1fc8dc));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf3cf('0x4')]},'mobile':{'type':Sequelize[_0xf3cf('0x4')]},'address':{'type':Sequelize[_0xf3cf('0x4')]},'zipcode':{'type':Sequelize[_0xf3cf('0x4')]},'userpic':{'type':Sequelize[_0xf3cf('0x4')]},'city':{'type':Sequelize[_0xf3cf('0x4')]},'country':{'type':Sequelize[_0xf3cf('0x4')]},'online':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf3cf('0x15')]},'voicePause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':_0xf3cf('0x16')},'lastPauseAt':{'type':Sequelize[_0xf3cf('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf3cf('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf3cf('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xf3cf('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf3cf('0xd')]('friend',_0xf3cf('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xf3cf('0x17')},'context':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':_0xf3cf('0x18')},'callingpres':{'type':Sequelize['ENUM'](_0xf3cf('0x19'),_0xf3cf('0x1a'),_0xf3cf('0x1b'),'ALLOWED',_0xf3cf('0x1c'),_0xf3cf('0x1d'),_0xf3cf('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':_0xf3cf('0x1f'),'set':function(_0x6810fd){this['setDataValue']('transport',_0x6810fd?_0x6810fd[_0xf3cf('0x20')](','):null);},'get':function(){return this['getDataValue'](_0xf3cf('0x21'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0xf3cf('0x22')},'dtmfmode':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x23'),_0xf3cf('0x24'),_0xf3cf('0x25'),_0xf3cf('0x26'),_0xf3cf('0x27')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no',_0xf3cf('0x29'),_0xf3cf('0x2a'),_0xf3cf('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'defaultValue':_0xf3cf('0x2c'),'set':function(_0x30b3a0){this[_0xf3cf('0xc')](_0xf3cf('0x2d'),_0x30b3a0?_0x30b3a0[_0xf3cf('0x20')](','):null);},'get':function(){return this['getDataValue'](_0xf3cf('0x2d'))?this[_0xf3cf('0x13')](_0xf3cf('0x2d'))[_0xf3cf('0x2e')](','):null;},'comment':_0xf3cf('0x2f')},'callgroup':{'type':Sequelize[_0xf3cf('0x4')]},'namedcallgroup':{'type':Sequelize[_0xf3cf('0x4')]},'pickupgroup':{'type':Sequelize[_0xf3cf('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xf3cf('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf3cf('0x4')]},'disallow':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'defaultValue':_0xf3cf('0x30')},'allow':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1eb49b){this['setDataValue'](_0xf3cf('0x31'),_0x1eb49b?_0x1eb49b['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x31'))?this[_0xf3cf('0x13')](_0xf3cf('0x31'))['split'](';'):null;},'comment':_0xf3cf('0x32')},'autoframing':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![],'set':function(_0x5106bf){this['setDataValue'](_0xf3cf('0x33'),_0x5106bf?_0x5106bf['join'](','):null);},'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x33'))?this[_0xf3cf('0x13')](_0xf3cf('0x33'))[_0xf3cf('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf3cf('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf3cf('0x34')},'amaflags':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':_0xf3cf('0x28')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no',_0xf3cf('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xf3cf('0x36'),_0xf3cf('0x37'),_0xf3cf('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf3cf('0xd')]('uac',_0xf3cf('0x39')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0xf3cf('0x28')},'keepalive':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x28'),'no',_0xf3cf('0x3a'),_0xf3cf('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf3cf('0xd')](_0xf3cf('0x3c'),_0xf3cf('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf3cf('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xf3cf('0x28'),'no',_0xf3cf('0x29'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf3cf('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xf3cf('0x15')]},'passwordResetAt':{'type':Sequelize[_0xf3cf('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf3cf('0x3e')]},'showWebBar':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0,'set':function(_0x5eb0c2){this['setDataValue']('showWebBar',_0x5eb0c2);var _0x5deabb=this[_0xf3cf('0x3f')]({'plain':!![]});switch(_0x5eb0c2){case 0x0:case 0x1:var _0x41bef0=_0x5deabb[_0xf3cf('0x21')]?_[_0xf3cf('0x40')](_0x5deabb['transport'])?_0x5deabb[_0xf3cf('0x21')][_0xf3cf('0x20')]():_0x5deabb[_0xf3cf('0x21')]:_0xf3cf('0x1f');if(_0x41bef0===_0xf3cf('0x41')){_0x41bef0='udp';}this['setDataValue'](_0xf3cf('0x21'),_0x41bef0);this[_0xf3cf('0xc')](_0xf3cf('0x42'),'no');this['setDataValue'](_0xf3cf('0x43'),null);this[_0xf3cf('0xc')]('force_avp',null);this[_0xf3cf('0xc')](_0xf3cf('0x44'),null);this[_0xf3cf('0xc')]('dtlsenable',null);this['setDataValue'](_0xf3cf('0x45'),null);this['setDataValue'](_0xf3cf('0x46'),null);this[_0xf3cf('0xc')]('dtlscertfile',null);this[_0xf3cf('0xc')](_0xf3cf('0x47'),null);this[_0xf3cf('0xc')](_0xf3cf('0x48'),'no');break;case 0x2:this[_0xf3cf('0xc')](_0xf3cf('0x21'),_0xf3cf('0x41'));this[_0xf3cf('0xc')](_0xf3cf('0x42'),_0xf3cf('0x28'));this[_0xf3cf('0xc')](_0xf3cf('0x43'),'yes');this['setDataValue'](_0xf3cf('0x49'),'yes');this[_0xf3cf('0xc')](_0xf3cf('0x44'),'yes');this['setDataValue'](_0xf3cf('0x4a'),_0xf3cf('0x28'));this[_0xf3cf('0xc')](_0xf3cf('0x45'),'no');this[_0xf3cf('0xc')]('dtlssetup',_0xf3cf('0x4b'));this[_0xf3cf('0xc')](_0xf3cf('0x4c'),_0x5deabb['dtlscertfile']||_0xf3cf('0x4d'));this[_0xf3cf('0xc')](_0xf3cf('0x47'),_0x5deabb[_0xf3cf('0x47')]||_0xf3cf('0x4e'));this[_0xf3cf('0xc')](_0xf3cf('0x48'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xf3cf('0x3e')],'set':function(_0x571088){this[_0xf3cf('0xc')](_0xf3cf('0x4f'),_0x571088?_0x571088[_0xf3cf('0x20')](','):[]);},'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x4f'))?_['map'](this['getDataValue'](_0xf3cf('0x4f'))[_0xf3cf('0x2e')](','),function(_0x340294){return parseInt(_0x340294,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf3cf('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf3cf('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf3cf('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf3cf('0x50')],'get':function(){return this[_0xf3cf('0x13')](_0xf3cf('0x51'))?this['getDataValue'](_0xf3cf('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf3cf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf3cf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![],'set':function(_0x42cd48){if(typeof _0x42cd48===_0xf3cf('0x52')){var _0x20f329=_0x42cd48==='1'?!![]:_0x42cd48==='0'?![]:_0x42cd48===_0xf3cf('0x53')?!![]:_0x42cd48===_0xf3cf('0x54')?![]:![];this['setDataValue'](_0xf3cf('0x55'),_0x20f329);}else{this[_0xf3cf('0xc')](_0xf3cf('0x55'),_0x42cd48);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5949ea){this[_0xf3cf('0xc')](_0xf3cf('0x56'),_0x5949ea);if(_0x5949ea===!![]){this[_0xf3cf('0xc')](_0xf3cf('0x57'),moment());this[_0xf3cf('0xc')]('loginAttempts',0x0);}else{this[_0xf3cf('0xc')](_0xf3cf('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xf3cf('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xf3cf('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf3cf('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0x277d=['icesupport','dtlsenable','dtlsverify','encryption','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','name','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','setDataValue','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','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','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','isArray','wss','udp','avpf','force_avp'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x277d,0x6a));var _0xd277=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x277d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xd277('0x0'));var moment=require('moment');var util=require(_0xd277('0x1'));var _=require(_0xd277('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd277('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e7f08){this['setDataValue'](_0xd277('0x3'),_0x3e7f08);this['setDataValue'](_0xd277('0x4'),_0x3e7f08);},'comment':_0xd277('0x5')},'fullname':{'type':Sequelize[_0xd277('0x6')],'allowNull':![],'set':function(_0xcdb660){this['setDataValue'](_0xd277('0x7'),_0xcdb660);this['setDataValue'](_0xd277('0x8'),util[_0xd277('0x9')](_0xd277('0xa'),_0xcdb660,this[_0xd277('0xb')](_0xd277('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd277('0x6')],'allowNull':![],'unique':_0xd277('0xd'),'validate':{'isEmail':!![]},'set':function(_0x1580d2){if(_0x1580d2){this['setDataValue'](_0xd277('0xd'),_0x1580d2[_0xd277('0xe')]());}}},'role':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x10'),_0xd277('0x11'),_0xd277('0x12'),_0xd277('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd277('0x6')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xd277('0xc'),'set':function(_0x450558){this[_0xd277('0x14')](_0xd277('0xc'),_0x450558);this[_0xd277('0x14')](_0xd277('0x15'),_0x450558);this['setDataValue']('callerid',util[_0xd277('0x9')](_0xd277('0xa'),this[_0xd277('0xb')](_0xd277('0x7')),_0x450558));}},'salt':{'type':Sequelize[_0xd277('0x6')]},'phone':{'type':Sequelize[_0xd277('0x6')]},'mobile':{'type':Sequelize[_0xd277('0x6')]},'address':{'type':Sequelize[_0xd277('0x6')]},'zipcode':{'type':Sequelize[_0xd277('0x6')]},'userpic':{'type':Sequelize[_0xd277('0x6')]},'city':{'type':Sequelize[_0xd277('0x6')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd277('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd277('0x6')],'defaultValue':_0xd277('0x18')},'lastPauseAt':{'type':Sequelize[_0xd277('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd277('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd277('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd277('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd277('0x19')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd277('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd277('0x1a')},'ipaddr':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'port':{'type':Sequelize[_0xd277('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0xd277('0x1b')),'allowNull':!![],'defaultValue':_0xd277('0x1c')},'context':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![],'defaultValue':_0xd277('0x1d')},'callingpres':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x1e'),_0xd277('0x1f'),_0xd277('0x20'),_0xd277('0x21'),_0xd277('0x22'),_0xd277('0x23'),_0xd277('0x24'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'permit':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'secret':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'transport':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![],'defaultValue':'udp','set':function(_0x4656c5){this[_0xd277('0x14')]('transport',_0x4656c5?_0x4656c5[_0xd277('0x25')](','):null);},'get':function(){return this['getDataValue'](_0xd277('0x26'))?this[_0xd277('0xb')]('transport')['split'](','):null;},'comment':_0xd277('0x27')},'dtmfmode':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x28'),_0xd277('0x29'),'shortinfo',_0xd277('0x2a'),_0xd277('0x2b')),'allowNull':!![],'defaultValue':_0xd277('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0xd277('0x2c'),'no',_0xd277('0x2d'),_0xd277('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x1f5cd9){this[_0xd277('0x14')](_0xd277('0x2f'),_0x1f5cd9?_0x1f5cd9[_0xd277('0x25')](','):null);},'get':function(){return this['getDataValue'](_0xd277('0x2f'))?this[_0xd277('0xb')](_0xd277('0x2f'))[_0xd277('0x30')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xd277('0x6')]},'namedcallgroup':{'type':Sequelize[_0xd277('0x6')]},'pickupgroup':{'type':Sequelize[_0xd277('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xd277('0x6')]},'language':{'type':Sequelize[_0xd277('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd277('0x6')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd277('0x31')},'allow':{'type':Sequelize[_0xd277('0x6')],'allowNull':![],'defaultValue':_0xd277('0x32'),'set':function(_0x543bc2){this[_0xd277('0x14')]('allow',_0x543bc2?_0x543bc2['join'](';'):_0xd277('0x32'));},'get':function(){return this[_0xd277('0xb')]('allow')?this['getDataValue'](_0xd277('0x33'))[_0xd277('0x30')](';'):null;},'comment':_0xd277('0x34')},'autoframing':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![],'set':function(_0x40945b){this[_0xd277('0x14')](_0xd277('0x35'),_0x40945b?_0x40945b[_0xd277('0x25')](','):null);},'get':function(){return this[_0xd277('0xb')](_0xd277('0x35'))?this[_0xd277('0xb')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no',_0xd277('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xd277('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd277('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd277('0xf')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd277('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xd277('0x37'),_0xd277('0x38'),_0xd277('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x3a'),_0xd277('0x3b')),'allowNull':!![],'defaultValue':_0xd277('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd277('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xd277('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd277('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd277('0xf')]('yes','no',_0xd277('0x3c'),_0xd277('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x3e'),_0xd277('0x3f'),_0xd277('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd277('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xd277('0x2c'),'no',_0xd277('0x2d'),_0xd277('0x2e'),_0xd277('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd277('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0xd277('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd277('0x42')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1ecd14){this['setDataValue']('showWebBar',_0x1ecd14);var _0x3ced30=this['get']({'plain':!![]});switch(_0x1ecd14){case 0x0:case 0x1:var _0x3ccb3b=_0x3ced30['transport']?_[_0xd277('0x43')](_0x3ced30[_0xd277('0x26')])?_0x3ced30[_0xd277('0x26')]['join']():_0x3ced30[_0xd277('0x26')]:'udp';if(_0x3ccb3b===_0xd277('0x44')){_0x3ccb3b=_0xd277('0x45');}this[_0xd277('0x14')](_0xd277('0x26'),_0x3ccb3b);this[_0xd277('0x14')]('encryption','no');this['setDataValue'](_0xd277('0x46'),null);this[_0xd277('0x14')](_0xd277('0x47'),null);this[_0xd277('0x14')](_0xd277('0x48'),null);this[_0xd277('0x14')](_0xd277('0x49'),null);this['setDataValue'](_0xd277('0x4a'),null);this[_0xd277('0x14')]('dtlssetup',null);this[_0xd277('0x14')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0xd277('0x14')]('rtcp_mux','no');break;case 0x2:this[_0xd277('0x14')](_0xd277('0x26'),_0xd277('0x44'));this['setDataValue'](_0xd277('0x4b'),'yes');this[_0xd277('0x14')](_0xd277('0x46'),_0xd277('0x2c'));this['setDataValue']('force_avp',_0xd277('0x2c'));this['setDataValue'](_0xd277('0x48'),_0xd277('0x2c'));this[_0xd277('0x14')](_0xd277('0x49'),'yes');this[_0xd277('0x14')](_0xd277('0x4a'),'no');this[_0xd277('0x14')](_0xd277('0x4c'),'actpass');this[_0xd277('0x14')](_0xd277('0x4d'),_0x3ced30[_0xd277('0x4d')]||_0xd277('0x4e'));this[_0xd277('0x14')]('dtlsprivatekey',_0x3ced30[_0xd277('0x4f')]||'/etc/pki/tls/private/motion.key');this[_0xd277('0x14')]('rtcp_mux',_0xd277('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0xd277('0x42')],'set':function(_0x258f13){this[_0xd277('0x14')](_0xd277('0x50'),_0x258f13?_0x258f13['join'](','):[]);},'get':function(){return this[_0xd277('0xb')]('permissions')?_[_0xd277('0x51')](this[_0xd277('0xb')](_0xd277('0x50'))[_0xd277('0x30')](','),function(_0x193be7){return parseInt(_0x193be7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd277('0x6')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xd277('0x6')]},'phoneBarUnconditional':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd277('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd277('0xf')](_0xd277('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd277('0x52')],'get':function(){return this[_0xd277('0xb')](_0xd277('0x53'))?this[_0xd277('0xb')](_0xd277('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xd277('0x6')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd277('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1b11f5){if(typeof _0x1b11f5==='string'){var _0x5e7128=_0x1b11f5==='1'?!![]:_0x1b11f5==='0'?![]:_0x1b11f5==='true'?!![]:_0x1b11f5===_0xd277('0x54')?![]:![];this[_0xd277('0x14')](_0xd277('0x55'),_0x5e7128);}else{this[_0xd277('0x14')](_0xd277('0x55'),_0x1b11f5);}}},'blocked':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![],'set':function(_0x37396f){this[_0xd277('0x14')]('blocked',_0x37396f);if(_0x37396f===!![]){this[_0xd277('0x14')](_0xd277('0x56'),moment());this[_0xd277('0x14')](_0xd277('0x57'),0x0);}else{this['setDataValue'](_0xd277('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd277('0x19')](0x5)[_0xd277('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd277('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xd277('0x17')],'defaultValue':![]},'adSsoEnabled':{'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 1a59ab8..3db5499 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 _0xd943=['stack','send','index','User','rawAttributes','map','type','key','salt','query','includeAll','include','attributes','push','findAll','rows','openTabs','true','length','chat','sms','dataValues','fax','mail','openchannel','all','show','params','model','differenceBy','keys','password','filters','intersection','fields','merge','whatsapp','body','describe','addContacts','ids','omit','internal','securePassword','validatePasswordPattern','isNil','min_internal','sequelize','QueryTypes','from','mailbox','VoiceMail','email','permissions','101','102','103','113','110','104','105','106','108','109','100','111','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','Telephones','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','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','remove','Queues','isArray','emit','QueueId','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','getContacts','CmContact','order','sort','where','pick','options','hasOwnProperty','CmList','List','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','ChatGroup','getGroups','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGININPAUSE','bulkCreate','concat','isMiddleware','logout','update','pause','QueuePause','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','manual','%s%s','Pause','getTeams','Team','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Mail','Sms','getWhatsappQueues','removeAgent','getDataValue','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','removeSquareProjects','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','lastName','phone','Contact','CmHopper','getApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','resolve','isEmpty','queues','inbound','col','toString','desc','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','socket.io-emitter','redis','defaults','client','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','admin','Users','user','Agents','agent','telephone','filter','ignore','value','includes','role','find','name','UserProfileResource','end'];(function(_0x11ee3a,_0x2896e0){var _0x427973=function(_0x5c9f7f){while(--_0x5c9f7f){_0x11ee3a['push'](_0x11ee3a['shift']());}};_0x427973(++_0x2896e0);}(_0xd943,0x15d));var _0x3d94=function(_0x68db5b,_0x4d3d38){_0x68db5b=_0x68db5b-0x0;var _0x3524ba=_0xd943[_0x68db5b];return _0x3524ba;};'use strict';var moment=require(_0x3d94('0x0'));var BPromise=require(_0x3d94('0x1'));var util=require(_0x3d94('0x2'));var path=require(_0x3d94('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d94('0x4'));var jayson=require(_0x3d94('0x5'));var Redis=require(_0x3d94('0x6'));var authService=require(_0x3d94('0x7'));var qs=require(_0x3d94('0x8'));var logger=require('../../config/logger')('api');var utils=require(_0x3d94('0x9'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0x3d94('0xa'))(new Redis(config[_0x3d94('0xb')]));require('./user.socket')['register'](socket);config[_0x3d94('0xb')]=_[_0x3d94('0xc')](config[_0x3d94('0xb')],{'host':'localhost','port':0x18eb});var client=jayson[_0x3d94('0xd')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x39e2fa,_0x301536,_0x5f5041,_0x1897de){return new BPromise(function(_0xe5c5fb,_0x203aa0){var _0x368825=_0x1897de||client;return _0x368825[_0x3d94('0xe')](_0x39e2fa,_0x5f5041)['then'](function(_0x96c54b){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x301536,'request\x20sent');logger[_0x3d94('0x11')](_0x3d94('0x12'),_0x301536,_0x3d94('0x13'),JSON['stringify'](_0x96c54b));if(_0x96c54b[_0x3d94('0x14')]){if(_0x96c54b[_0x3d94('0x14')][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x301536,_0x96c54b[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x203aa0(_0x96c54b[_0x3d94('0x14')]['message']);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x301536,_0x96c54b[_0x3d94('0x14')][_0x3d94('0x16')]);return _0xe5c5fb(_0x96c54b[_0x3d94('0x14')][_0x3d94('0x16')]);}else{logger[_0x3d94('0xf')]('User,\x20%s,\x20%s',_0x301536,_0x3d94('0x13'));_0xe5c5fb(_0x96c54b['result'][_0x3d94('0x16')]);}})[_0x3d94('0x17')](function(_0x16a6d0){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x301536,_0x16a6d0);_0x203aa0(_0x16a6d0);});});}function respondWithStatusCode(_0x4f0beb,_0x578002){_0x578002=_0x578002||0xcc;return function(_0x1406e9){if(_0x1406e9){return _0x4f0beb[_0x3d94('0x18')](_0x578002);}return _0x4f0beb[_0x3d94('0x19')](_0x578002)['end']();};}function respondWithResult(_0x30af25,_0x2e8c91){_0x2e8c91=_0x2e8c91||0xc8;return function(_0x123adc){if(_0x123adc){return _0x30af25[_0x3d94('0x19')](_0x2e8c91)[_0x3d94('0x1a')](_0x123adc);}};}function respondWithFilteredResult(_0x4093a4,_0x295493){return function(_0x27f978){if(_0x27f978){var _0xee7b8d=typeof _0x295493[_0x3d94('0x1b')]===_0x3d94('0x1c')&&typeof _0x295493[_0x3d94('0x1d')]===_0x3d94('0x1c');var _0x3496c3=_0x27f978[_0x3d94('0x1e')];var _0x5b3b31=_0xee7b8d?0x0:_0x295493[_0x3d94('0x1b')];var _0x558fd2=_0xee7b8d?_0x27f978[_0x3d94('0x1e')]:_0x295493[_0x3d94('0x1b')]+_0x295493[_0x3d94('0x1d')];var _0x439173;if(_0x558fd2>=_0x3496c3){_0x558fd2=_0x3496c3;_0x439173=0xc8;}else{_0x439173=0xce;}_0x4093a4[_0x3d94('0x19')](_0x439173);return _0x4093a4[_0x3d94('0x1f')](_0x3d94('0x20'),_0x5b3b31+'-'+_0x558fd2+'/'+_0x3496c3)['json'](_0x27f978);}return null;};}function saveUpdates(_0x584c4a){return function(_0x362642){if(_0x362642){return _0x362642['update'](_0x584c4a)['then'](function(_0x23d20d){return _0x23d20d;});}return null;};}function removeEntity(_0x58c0d0){return function(_0x19bfd4){if(_0x19bfd4){return _0x19bfd4[_0x3d94('0x21')]()[_0x3d94('0x22')](function(){var _0x4cef9c=_0x19bfd4[_0x3d94('0x23')]({'plain':!![]});if(_0x4cef9c['role']===_0x3d94('0x24'))return;var _0x53db78=[{'name':_0x3d94('0x25'),'value':_0x3d94('0x26'),'ignore':!![]},{'name':_0x3d94('0x27'),'value':_0x3d94('0x28'),'ignore':![]},{'name':'Telephones','value':_0x3d94('0x29'),'ignore':![]}];var _0x51f634=_(_0x53db78)[_0x3d94('0x2a')](_0x3d94('0x2b'))['map']('value')[_0x3d94('0x2c')]();if(_[_0x3d94('0x2d')](_0x51f634,_0x4cef9c[_0x3d94('0x2e')])){return;}var _0x5cdb2e=_[_0x3d94('0x2f')](_0x53db78,[_0x3d94('0x2c'),_0x4cef9c['role']])[_0x3d94('0x30')];return db[_0x3d94('0x31')][_0x3d94('0x21')]({'where':{'type':_0x5cdb2e,'resourceId':_0x4cef9c['id']}})[_0x3d94('0x22')](function(){return _0x19bfd4;});})[_0x3d94('0x22')](function(){_0x58c0d0['status'](0xcc)[_0x3d94('0x32')]();});}};}function handleEntityNotFound(_0x42b742){return function(_0x41579e){if(!_0x41579e){_0x42b742[_0x3d94('0x18')](0x194);}return _0x41579e;};}function handleError(_0xb493f1,_0x441523){_0x441523=_0x441523||0x1f4;return function(_0x546658){logger['error'](_0x546658[_0x3d94('0x33')]);if(_0x546658[_0x3d94('0x30')]){delete _0x546658[_0x3d94('0x30')];}_0xb493f1[_0x3d94('0x19')](_0x441523)[_0x3d94('0x34')](_0x546658);};}exports[_0x3d94('0x35')]=function(_0x2ef743,_0x12c01a){var _0x2e7b97={},_0x2235f9={'count':0x0,'rows':[]};var _0x4e2244=_(db[_0x3d94('0x36')][_0x3d94('0x37')])[_0x3d94('0x38')](function(_0xcc289a){return{'name':_0xcc289a['fieldName'],'type':_0xcc289a[_0x3d94('0x39')][_0x3d94('0x3a')]};})[_0x3d94('0x2a')](function(_0x29eaa4){return!_[_0x3d94('0x2d')](['password',_0x3d94('0x3b')],_0x29eaa4[_0x3d94('0x30')]);})[_0x3d94('0x2c')]();_0x2e7b97=qs['getOptions'](_0x4e2244,_0x2ef743);var _0x4eee4d={'where':_0x2e7b97['where']};return db['User'][_0x3d94('0x1e')](_0x4eee4d)[_0x3d94('0x22')](function(_0x2ebcb1){_0x2235f9[_0x3d94('0x1e')]=_0x2ebcb1;if(_0x2ef743[_0x3d94('0x3c')][_0x3d94('0x3d')]){_0x2e7b97[_0x3d94('0x3e')]=[{'all':!![]}];}if(!_['includes'](_0x2e7b97['attributes'],'id')){_0x2e7b97[_0x3d94('0x3f')][_0x3d94('0x40')]('id');}return db['User'][_0x3d94('0x41')](_0x2e7b97);})['then'](function(_0x1361fb){_0x2235f9[_0x3d94('0x42')]=_0x1361fb;if(_0x2ef743[_0x3d94('0x3c')][_0x3d94('0x43')]===_0x3d94('0x44')){var _0x5a9263=[];for(var _0x3e0da8=0x0;_0x3e0da8<_0x2235f9[_0x3d94('0x42')][_0x3d94('0x45')];_0x3e0da8++){_0x5a9263['push'](get_open_tabs(_0x3d94('0x46'),_0x2235f9['rows'][_0x3e0da8]['dataValues']));_0x5a9263[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x47'),_0x2235f9[_0x3d94('0x42')][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263['push'](get_open_tabs(_0x3d94('0x49'),_0x2235f9['rows'][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4a'),_0x2235f9[_0x3d94('0x42')][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4b'),_0x2235f9['rows'][_0x3e0da8][_0x3d94('0x48')]));_0x5a9263[_0x3d94('0x40')](get_open_tabs('whatsapp',_0x2235f9['rows'][_0x3e0da8][_0x3d94('0x48')]));}return BPromise[_0x3d94('0x4c')](_0x5a9263)['then'](function(_0x3c8571){return _0x2235f9;});}else{return _0x2235f9;}})[_0x3d94('0x22')](respondWithFilteredResult(_0x12c01a,_0x2e7b97))[_0x3d94('0x17')](handleError(_0x12c01a,null));};exports[_0x3d94('0x4d')]=function(_0x30ce31,_0x237056){var _0x197243={'raw':![],'where':{'id':_0x30ce31[_0x3d94('0x4e')]['id']}},_0x12babd={};_0x12babd[_0x3d94('0x4f')]=_[_0x3d94('0x50')](_[_0x3d94('0x51')](db[_0x3d94('0x36')][_0x3d94('0x37')]),[_0x3d94('0x52'),'salt']);_0x12babd[_0x3d94('0x3c')]=_[_0x3d94('0x51')](_0x30ce31[_0x3d94('0x3c')]);_0x12babd[_0x3d94('0x53')]=_[_0x3d94('0x54')](_0x12babd[_0x3d94('0x4f')],_0x12babd[_0x3d94('0x3c')]);_0x197243[_0x3d94('0x3f')]=_[_0x3d94('0x54')](_0x12babd['model'],qs[_0x3d94('0x55')](_0x30ce31['query'][_0x3d94('0x55')]));_0x197243[_0x3d94('0x3f')]=_0x197243['attributes'][_0x3d94('0x45')]?_0x197243['attributes']:_0x12babd['model'];if(_0x30ce31[_0x3d94('0x3c')]['includeAll']){_0x197243[_0x3d94('0x3e')]=[{'all':!![]}];}_0x197243=_[_0x3d94('0x56')]({},_0x197243,_0x30ce31['options']);if(!_[_0x3d94('0x2d')](_0x197243['attributes'],'id')){_0x197243['attributes'][_0x3d94('0x40')]('id');}return db[_0x3d94('0x36')][_0x3d94('0x2f')](_0x197243)[_0x3d94('0x22')](handleEntityNotFound(_0x237056,null))[_0x3d94('0x22')](function(_0x3e49f5){var _0x137052=[];values=_0x3e49f5;if(_0x30ce31[_0x3d94('0x3c')][_0x3d94('0x43')]==='true'){_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x46'),_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x47'),_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4b'),_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x57'),_0x3e49f5['dataValues']));_0x137052[_0x3d94('0x40')](get_open_tabs('fax',_0x3e49f5[_0x3d94('0x48')]));_0x137052[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x4a'),_0x3e49f5[_0x3d94('0x48')]));return BPromise[_0x3d94('0x4c')](_0x137052);}else{return values;}})[_0x3d94('0x22')](function(_0x1c503d){return values;})[_0x3d94('0x22')](respondWithResult(_0x237056,null))[_0x3d94('0x17')](handleError(_0x237056,null));};exports['update']=function(_0x519ada,_0x46bff3){if(_0x519ada['body']['id']){delete _0x519ada[_0x3d94('0x58')]['id'];}delete _0x519ada[_0x3d94('0x58')]['role'];return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x519ada[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x46bff3,null))[_0x3d94('0x22')](saveUpdates(_0x519ada[_0x3d94('0x58')],null))[_0x3d94('0x22')](respondWithResult(_0x46bff3,null))['catch'](handleError(_0x46bff3,null));};exports[_0x3d94('0x59')]=function(_0x351ea6,_0x368581){return db['User'][_0x3d94('0x59')]()[_0x3d94('0x22')](respondWithResult(_0x368581,null))[_0x3d94('0x17')](handleError(_0x368581,null));};exports[_0x3d94('0x5a')]=function(_0x5cdfb0,_0x5292cc){return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x5cdfb0[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x5292cc,null))['then'](function(_0x1c12da){if(_0x1c12da){return _0x1c12da[_0x3d94('0x5a')](_0x5cdfb0['body'][_0x3d94('0x5b')],_[_0x3d94('0x5c')](_0x5cdfb0[_0x3d94('0x58')],['ids','id'])||{});}})[_0x3d94('0x22')](respondWithResult(_0x5292cc,null))[_0x3d94('0x17')](handleError(_0x5292cc,null));};function validateUser(_0x585531){return new BPromise(function(_0x5747a8,_0x11eeaa){if(_0x585531[_0x3d94('0x5d')])return _0x5747a8(_0x585531);return db['Setting']['findById'](0x1)['then'](function(_0x3ac9ea){if(_0x3ac9ea[_0x3d94('0x5e')])authService[_0x3d94('0x5f')](_0x585531[_0x3d94('0x52')]);db[_0x3d94('0x36')]['max'](_0x3d94('0x5d'))[_0x3d94('0x22')](function(_0x170d06){if(_[_0x3d94('0x60')](_0x170d06)){_0x585531[_0x3d94('0x5d')]=_0x3ac9ea[_0x3d94('0x61')]||0x1;return;}if(_['isNil'](_0x3ac9ea[_0x3d94('0x61')])||_0x3ac9ea['min_internal']===_0x170d06){_0x585531[_0x3d94('0x5d')]=_0x170d06+0x1;return;}if(_0x3ac9ea[_0x3d94('0x61')]>_0x170d06){_0x585531[_0x3d94('0x5d')]=_0x3ac9ea[_0x3d94('0x61')];return;}return db[_0x3d94('0x62')][_0x3d94('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['sequelize'][_0x3d94('0x63')]['SELECT']})['then'](function(_0x5c5fb2){if(_0x5c5fb2&&_0x5c5fb2[_0x3d94('0x45')]){for(var _0x262a6a=0x0,_0x222963=_0x5c5fb2[_0x3d94('0x45')];_0x262a6a<_0x222963&&_[_0x3d94('0x60')](_0x585531[_0x3d94('0x5d')]);_0x262a6a++){if(_0x3ac9ea[_0x3d94('0x61')]<=_0x5c5fb2[_0x262a6a][_0x3d94('0x64')]){_0x585531['internal']=_0x5c5fb2[_0x262a6a][_0x3d94('0x64')];}else if(_0x3ac9ea['min_internal']>_0x5c5fb2[_0x262a6a][_0x3d94('0x64')]&&_0x3ac9ea[_0x3d94('0x61')]<=_0x5c5fb2[_0x262a6a]['to']){_0x585531[_0x3d94('0x5d')]=_0x3ac9ea['min_internal'];}}}if(_['isNil'](_0x585531['internal'])){_0x585531[_0x3d94('0x5d')]=_0x170d06+0x1;}return _0x5747a8(_0x585531);});});})[_0x3d94('0x17')](function(_0x2c9c83){_0x11eeaa(_0x2c9c83);});});}function updateUser(_0x1c7ea5){return new BPromise(function(_0x2382df,_0x51b90e){try{if(_0x1c7ea5['voicemail']){_0x1c7ea5[_0x3d94('0x65')]=_0x1c7ea5[_0x3d94('0x5d')];_0x1c7ea5[_0x3d94('0x66')]={'mailbox':_0x1c7ea5['internal'],'password':_0x1c7ea5[_0x3d94('0x52')],'fullname':_0x1c7ea5['fullname'],'email':_0x1c7ea5[_0x3d94('0x67')]};}if(_0x1c7ea5[_0x3d94('0x2e')]===_0x3d94('0x28')){if(!_0x1c7ea5[_0x3d94('0x68')])_0x1c7ea5[_0x3d94('0x68')]=[_0x3d94('0x69'),_0x3d94('0x6a'),_0x3d94('0x6b'),_0x3d94('0x6c'),_0x3d94('0x6d'),_0x3d94('0x6e'),_0x3d94('0x6f'),_0x3d94('0x70'),'107',_0x3d94('0x71'),_0x3d94('0x72'),_0x3d94('0x73'),_0x3d94('0x74'),'114',_0x3d94('0x75')];}_0x2382df(_0x1c7ea5);}catch(_0x5e03b0){_0x51b90e(_0x5e03b0);}});}exports['create']=function(_0x307dda,_0x55fed9){if(_0x307dda[_0x3d94('0x26')][_0x3d94('0x2e')]==='agent')throw new Error(_0x3d94('0x76'));if(_0x307dda['body'][_0x3d94('0x2e')]===_0x3d94('0x26')&&_0x307dda['user']['role']!=='admin'){throw new Error(_0x3d94('0x77'));}if(_0x307dda['body']['role']===_0x3d94('0x24')&&_0x307dda[_0x3d94('0x26')][_0x3d94('0x2e')]!==_0x3d94('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x3d94('0x78')]([_0x307dda[_0x3d94('0x58')]])[_0x3d94('0x22')](function(){return validateUser(_0x307dda[_0x3d94('0x58')]);})[_0x3d94('0x22')](function(_0x200cc2){return updateUser(_0x200cc2)['then'](function(_0x467ccb){if(_0x467ccb[_0x3d94('0x2e')]===_0x3d94('0x24')){_0x467ccb[_0x3d94('0x79')]=_0x307dda[_0x3d94('0x26')][_0x3d94('0x79')];delete _0x467ccb[_0x3d94('0x7a')];}return _0x467ccb;});})[_0x3d94('0x22')](function(_0x4b3ed5){return db['User'][_0x3d94('0x7b')](_0x4b3ed5,{'include':[{'model':db[_0x3d94('0x66')],'as':_0x3d94('0x66')}]});})['then'](function(_0x43a00e){if(_0x307dda[_0x3d94('0x58')][_0x3d94('0x2e')]===_0x3d94('0x26'))return _0x43a00e;if(_0x307dda[_0x3d94('0x26')]['role']!=='user')return _0x43a00e;return db[_0x3d94('0x7c')][_0x3d94('0x2f')]({'where':{'name':_0x43a00e[_0x3d94('0x2e')]===_0x3d94('0x28')?_0x3d94('0x27'):_0x3d94('0x7d'),'userProfileId':_0x307dda[_0x3d94('0x26')][_0x3d94('0x7a')]},'raw':!![]})[_0x3d94('0x22')](function(_0x35caf5){if(!_0x35caf5||_0x35caf5[_0x3d94('0x7e')]!=0x0)return _0x43a00e;return db[_0x3d94('0x31')][_0x3d94('0x7b')]({'name':_0x43a00e['name'],'resourceId':_0x43a00e['id'],'type':_0x35caf5[_0x3d94('0x30')],'sectionId':_0x35caf5['id']},{})[_0x3d94('0x22')](function(){return _0x43a00e;});})['catch'](function(_0x5d3d6e){logger[_0x3d94('0x14')](_0x3d94('0x7f'),_0x5d3d6e);throw _0x5d3d6e;});})[_0x3d94('0x22')](respondWithResult(_0x55fed9,0xc9))[_0x3d94('0x17')](handleError(_0x55fed9,null));};exports['bulkCreate']=function(_0x482e99,_0x1f3171){var _0x2ec7d9=_0x482e99[_0x3d94('0x58')];var _0x22283d=[];if(_0x482e99[_0x3d94('0x26')]['role']===_0x3d94('0x28'))throw new Error('Unauthorized');if(_[_0x3d94('0x80')](_0x2ec7d9,[_0x3d94('0x2e'),_0x3d94('0x26')])&&_0x482e99['user'][_0x3d94('0x2e')]!==_0x3d94('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x3d94('0x80')](_0x2ec7d9,['role',_0x3d94('0x24')])&&_0x482e99[_0x3d94('0x26')][_0x3d94('0x2e')]!=='admin'){throw new Error(_0x3d94('0x81'));}return licenseUtil[_0x3d94('0x78')](_0x2ec7d9)[_0x3d94('0x22')](function(){return validateUser(_0x2ec7d9[0x0]);})['then'](function(){for(var _0x3e091a=0x1;_0x3e091a<_0x2ec7d9[_0x3d94('0x45')];_0x3e091a++){var _0x259484=_0x2ec7d9[_0x3e091a-0x1][_0x3d94('0x5d')];if(!_0x2ec7d9[_0x3e091a][_0x3d94('0x5d')])_0x2ec7d9[_0x3e091a][_0x3d94('0x5d')]=_0x259484+0x1;_0x22283d[_0x3d94('0x40')](validateUser(_0x2ec7d9[_0x3e091a]));}return BPromise[_0x3d94('0x4c')](_0x22283d);})['then'](function(){_0x22283d=[];for(var _0x217564=0x0;_0x217564<_0x2ec7d9[_0x3d94('0x45')];_0x217564++){_0x22283d[_0x3d94('0x40')](updateUser(_0x2ec7d9[_0x217564]));}return BPromise[_0x3d94('0x4c')](_0x22283d);})[_0x3d94('0x22')](function(){return BPromise[_0x3d94('0x82')](_0x2ec7d9,function(_0x5716fd){return db[_0x3d94('0x36')][_0x3d94('0x7b')](_0x5716fd,{'include':[{'model':db[_0x3d94('0x66')],'as':'VoiceMail'}]})[_0x3d94('0x22')](function(_0x4c6c49){_0x5716fd['id']=_0x4c6c49['id'];return _0x5716fd;});});})[_0x3d94('0x22')](function(_0x3ed74f){if(_0x482e99['body'][_0x3d94('0x2e')]===_0x3d94('0x26'))return _0x3ed74f;if(_0x482e99['user']['role']!==_0x3d94('0x26'))return _0x3ed74f;var _0x36e87c=_['some'](_0x3ed74f,function(_0x5007ef){return _0x5007ef['role']===_0x3d94('0x28')||_0x5007ef[_0x3d94('0x2e')]===_0x3d94('0x29');});if(!_0x36e87c)return _0x3ed74f;return db[_0x3d94('0x7c')][_0x3d94('0x41')]({'where':{'name':{'$or':['Agents',_0x3d94('0x7d')]},'userProfileId':_0x482e99[_0x3d94('0x26')][_0x3d94('0x7a')]},'raw':!![]})['then'](function(_0x2f90c4){if(_['isEmpty'](_0x2f90c4)||!_[_0x3d94('0x80')](_0x2f90c4,[_0x3d94('0x7e'),0x0]))return _0x3ed74f;_0x22283d=[];var _0x25015e=_(_0x2f90c4)[_0x3d94('0x38')](function(_0x4527e1){if(_0x4527e1['autoAssociation']===0x1)return;return _0x4527e1['name']===_0x3d94('0x27')?_0x3d94('0x28'):'telephone';})[_0x3d94('0x83')]()['value']();for(var _0x34f1ce=0x0;_0x34f1ce<_0x3ed74f[_0x3d94('0x45')];_0x34f1ce++){if(!_[_0x3d94('0x2d')](_0x25015e,_0x3ed74f[_0x34f1ce]['role']))return;var _0x406528=_0x3ed74f[_0x34f1ce]['role']===_0x3d94('0x28')?_0x3d94('0x27'):_0x3d94('0x7d');_0x22283d[_0x3d94('0x40')](db['UserProfileResource']['create']({'name':_0x3ed74f[_0x34f1ce][_0x3d94('0x30')],'resourceId':_0x3ed74f[_0x34f1ce]['id'],'type':_0x406528,'sectionId':_[_0x3d94('0x2f')](_0x2f90c4,[_0x3d94('0x30'),_0x406528])['id']},{}));}return BPromise[_0x3d94('0x4c')](_0x22283d);});})['then'](respondWithResult(_0x1f3171,0xc9))[_0x3d94('0x17')](handleError(_0x1f3171,null));};exports['changePassword']=function(_0x49c674,_0x543b1a){if(_0x49c674[_0x3d94('0x58')]['id']){delete _0x49c674[_0x3d94('0x58')]['id'];}return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x49c674[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](function(_0x33af12){if(!_0x33af12)return null;if(_0x33af12['id']===_0x49c674[_0x3d94('0x26')]['id']){if(!_0x49c674[_0x3d94('0x58')][_0x3d94('0x84')]||!_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')]){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x88'));}if(!_0x33af12['authenticate'](_0x49c674['body'][_0x3d94('0x84')])){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x89'));}if(_0x49c674[_0x3d94('0x58')][_0x3d94('0x84')]===_0x49c674[_0x3d94('0x58')]['newPassword']){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x8a'));}}else if(_0x49c674[_0x3d94('0x26')][_0x3d94('0x2e')]===_0x3d94('0x24')){if(!_0x49c674['body']['newPassword']){throw new db[(_0x3d94('0x86'))]['ValidationError'](_0x3d94('0x8b'));}}else if(_0x49c674[_0x3d94('0x26')][_0x3d94('0x2e')]===_0x3d94('0x26')){if(!_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')]){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x33af12[_0x3d94('0x2e')]!==_0x3d94('0x28')){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x76'));}}else{throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x76'));}return _0x33af12;})[_0x3d94('0x22')](handleEntityNotFound(_0x543b1a,null))[_0x3d94('0x22')](function(_0x285a35){return db[_0x3d94('0x8c')][_0x3d94('0x8d')]({'attributes':['id',_0x3d94('0x5e'),_0x3d94('0x8e'),_0x3d94('0x8f')]})[_0x3d94('0x22')](function(_0x252c96){if(_0x252c96[_0x3d94('0x5e')])authService[_0x3d94('0x5f')](_0x49c674[_0x3d94('0x58')]['newPassword']);if(!_0x252c96[_0x3d94('0x8e')]||!_0x285a35[_0x3d94('0x90')])return _0x285a35;authService[_0x3d94('0x91')](_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')],_0x285a35[_0x3d94('0x90')],_0x252c96['passwordHistoryLimit']);return _0x285a35;})[_0x3d94('0x22')](saveUpdates({'password':_0x49c674[_0x3d94('0x58')][_0x3d94('0x85')],'passwordResetAt':_0x49c674[_0x3d94('0x26')]['id']==_0x49c674[_0x3d94('0x4e')]['id']?moment():null,'previousPasswords':authService[_0x3d94('0x92')](_0x49c674['body'][_0x3d94('0x85')],_0x285a35[_0x3d94('0x90')])},null));})['then'](respondWithResult(_0x543b1a,null))['catch'](handleError(_0x543b1a,null));};exports['addQueues']=function(_0x3e1139,_0x77b79d){var _0x20b52d=_0x3e1139[_0x3d94('0x58')][_0x3d94('0x93')];return db['User'][_0x3d94('0x2f')]({'where':{'id':_0x3e1139[_0x3d94('0x4e')]['id']},'attributes':['id',_0x3d94('0x30'),_0x3d94('0x2e'),_0x3d94('0x94'),_0x3d94('0x95'),'voicePause',_0x3d94('0x96')]})['then'](handleEntityNotFound(_0x77b79d,null))[_0x3d94('0x22')](function(_0xb970e1){if(_0xb970e1){if(!utils[_0x3d94('0x97')](_0x20b52d)){throw new db[(_0x3d94('0x86'))]['ValidationError'](_0x3d94('0x98'));}return _0xb970e1[_0x3d94('0x99')+_[_0x3d94('0x9a')](_0x20b52d[_0x3d94('0x9b')]())+'Queues'](_0x3e1139['body'][_0x3d94('0x5b')],{'penalty':_0x3e1139[_0x3d94('0x58')][_0x3d94('0x9c')]||0x0})['spread'](function(_0x2fac35){for(var _0x5ac055=0x0;_0x5ac055<_0x3e1139['body'][_0x3d94('0x5b')][_0x3d94('0x45')];_0x5ac055+=0x1){var _0x4ae177={'UserId':Number(_0x3e1139[_0x3d94('0x4e')]['id'])};_0x4ae177[_[_0x3d94('0x9a')](_0x20b52d[_0x3d94('0x9b')]())+'QueueId']=Number(_0x3e1139[_0x3d94('0x58')][_0x3d94('0x5b')][_0x5ac055]);socket['emit']('user'+_[_0x3d94('0x9a')](_0x20b52d[_0x3d94('0x9b')]())+_0x3d94('0x9d'),_0x4ae177);}return _0x2fac35;})[_0x3d94('0x22')](function(){if(_0x20b52d===_0x3d94('0x9e')){return db[_0x3d94('0x9f')]['findAll']({'where':{'id':_0x3e1139['body']['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x3d94('0x22')](function(_0x3950d1){var _0xe2f687=_0xb970e1[_0x3d94('0x23')]({'plain':!![]});var _0x283705=[];if(_0x20b52d===_0x3d94('0x9e')&&_0xe2f687[_0x3d94('0x2e')]===_0x3d94('0x28')&&_0xe2f687[_0x3d94('0x94')]){for(var _0x414b82=0x0;_0x414b82<_0x3950d1[_0x3d94('0x45')];_0x414b82+=0x1){_0x283705['push']({'membername':_0xe2f687[_0x3d94('0x30')],'UserId':_0xe2f687['id'],'queue_name':_0x3950d1[_0x414b82]['name'],'VoiceQueueId':_0x3950d1[_0x414b82]['id'],'interface':_[_0x3d94('0x60')](_0xe2f687[_0x3d94('0x96')])?util[_0x3d94('0xa0')](_0x3d94('0xa1'),_0xe2f687[_0x3d94('0x30')]):_0xe2f687[_0x3d94('0x96')],'paused':_0xe2f687[_0x3d94('0xa2')]||![],'penalty':_0x3e1139[_0x3d94('0x58')]['penalty']||0x0});}return BPromise[_0x3d94('0x82')](_0x283705,function(_0x11ae22){return db[_0x3d94('0xa3')][_0x3d94('0xa4')](_0x11ae22);});}return _0xb970e1;});}})[_0x3d94('0x22')](respondWithStatusCode(_0x77b79d,null))[_0x3d94('0x17')](handleError(_0x77b79d,null));};exports[_0x3d94('0xa5')]=function(_0x1b7ad4,_0x483e7a){var _0x2f82cb;return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x1b7ad4[_0x3d94('0x4e')]['id']},'attributes':['id',_0x3d94('0x30'),_0x3d94('0x2e')]})[_0x3d94('0x22')](handleEntityNotFound(_0x483e7a,null))[_0x3d94('0x22')](function(_0x5ace4e){if(_0x5ace4e){_0x2f82cb=_0x5ace4e;if(!_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')]||!utils['isValidChannel'](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')])){throw new db[(_0x3d94('0x86'))][(_0x3d94('0x87'))](_0x3d94('0x98'));}return _0x5ace4e[_0x3d94('0xa6')+_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')][_0x3d94('0x9b')]())+_0x3d94('0xa7')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')]);}})[_0x3d94('0x22')](function(_0x186c79){if(_[_0x3d94('0xa8')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')])){for(var _0x2f6440=0x0;_0x2f6440<_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')][_0x3d94('0x45')];_0x2f6440+=0x1){var _0x41fd2c={'UserId':Number(_0x1b7ad4[_0x3d94('0x4e')]['id'])};_0x41fd2c[_[_0x3d94('0x9a')](_0x1b7ad4['query']['channel'][_0x3d94('0x9b')]())+'QueueId']=Number(_0x1b7ad4['query'][_0x3d94('0x5b')][_0x2f6440]);socket[_0x3d94('0xa9')](_0x3d94('0x26')+_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')]['channel'][_0x3d94('0x9b')]())+'Queue:remove',_0x41fd2c);}}else{var _0x41fd2c={'UserId':Number(_0x1b7ad4[_0x3d94('0x4e')]['id'])};_0x41fd2c[_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')][_0x3d94('0x9b')]())+_0x3d94('0xaa')]=Number(_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x5b')]);socket[_0x3d94('0xa9')](_0x3d94('0x26')+_[_0x3d94('0x9a')](_0x1b7ad4[_0x3d94('0x3c')][_0x3d94('0x93')][_0x3d94('0x9b')]())+'Queue:remove',_0x41fd2c);}return _0x186c79;})['then'](function(){if(_0x1b7ad4['query'][_0x3d94('0x93')]===_0x3d94('0x9e')){return db['UserVoiceQueueRt'][_0x3d94('0x21')]({'where':{'UserId':_0x1b7ad4[_0x3d94('0x4e')]['id'],'VoiceQueueId':_0x1b7ad4['query'][_0x3d94('0x5b')]},'individualHooks':!![]})[_0x3d94('0x22')](function(){return _0x2f82cb;});}return _0x2f82cb;})[_0x3d94('0x22')](respondWithStatusCode(_0x483e7a,null))[_0x3d94('0x17')](handleError(_0x483e7a,null));};exports[_0x3d94('0xab')]=function(_0x478f09,_0x36df43){_0x478f09[_0x3d94('0x58')][_0x3d94('0xac')]=_0x478f09[_0x3d94('0xad')][_0x3d94('0xae')];return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x478f09[_0x3d94('0x4e')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x36df43,null))['then'](saveUpdates(_0x478f09[_0x3d94('0x58')],null))[_0x3d94('0x22')](respondWithResult(_0x36df43,null))[_0x3d94('0x17')](handleError(_0x36df43,null));};exports[_0x3d94('0xaf')]=function(_0x258a63,_0x359d07){var _0x4bb2f8=path['join'](config[_0x3d94('0xb0')],_0x3d94('0xb1'));return db['User'][_0x3d94('0x2f')]({'where':{'id':_0x258a63[_0x3d94('0x4e')]['id']},'attributes':['id',_0x3d94('0xac')],'raw':!![]})[_0x3d94('0x22')](handleEntityNotFound(_0x359d07,null))[_0x3d94('0x22')](function(_0x5c192c){if(_0x5c192c){if(_[_0x3d94('0x60')](_0x5c192c['userpic'])){return _0x359d07[_0x3d94('0xb2')](_0x4bb2f8);}else{if(!fs['existsSync'](path['join'](config[_0x3d94('0xb0')],_0x3d94('0xb3'),_0x5c192c[_0x3d94('0xac')]))){return _0x359d07[_0x3d94('0xb2')](_0x4bb2f8);}return _0x359d07[_0x3d94('0xb2')](path['join'](config[_0x3d94('0xb0')],'server/files/images/',_0x5c192c['userpic']));}}})['catch'](handleError(_0x359d07,null));};exports[_0x3d94('0xb4')]=function(_0x5dcf61,_0x67afd6){return db[_0x3d94('0x36')][_0x3d94('0x2f')]({'where':{'id':_0x5dcf61[_0x3d94('0x4e')]['id']},'attributes':['id']})[_0x3d94('0x22')](handleEntityNotFound(_0x67afd6,null))['then'](function(_0x1067f1){var _0x3956f9=[];values=_0x1067f1[_0x3d94('0x48')];_0x3956f9[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x46'),_0x1067f1[_0x3d94('0x48')]));_0x3956f9['push'](get_open_tabs(_0x3d94('0x47'),_0x1067f1['dataValues']));_0x3956f9['push'](get_open_tabs(_0x3d94('0x4b'),_0x1067f1['dataValues']));_0x3956f9[_0x3d94('0x40')](get_open_tabs(_0x3d94('0x57'),_0x1067f1[_0x3d94('0x48')]));_0x3956f9['push'](get_open_tabs('fax',_0x1067f1[_0x3d94('0x48')]));_0x3956f9['push'](get_open_tabs(_0x3d94('0x4a'),_0x1067f1[_0x3d94('0x48')]));return BPromise['all'](_0x3956f9);})[_0x3d94('0x22')](function(_0x927882){var _0x302510=[];if(_0x927882){for(var _0x2f0128=0x0;_0x2f0128=_0x53078a){_0x5b6c4e=_0x53078a;_0x1dac65=0xc8;}else{_0x1dac65=0xce;}_0x385687[_0x47a5('0x25')](_0x1dac65);return _0x385687[_0x47a5('0x26')](_0x47a5('0x27'),_0x5686db+'-'+_0x5b6c4e+'/'+_0x53078a)[_0x47a5('0x20')](_0x28747d);}return null;};}function saveUpdates(_0x16631f){return function(_0x361bfa){if(_0x361bfa){return _0x361bfa[_0x47a5('0x28')](_0x16631f)[_0x47a5('0x12')](function(_0x3ad507){return _0x3ad507;});}return null;};}function removeEntity(_0x528582){return function(_0x243210){if(_0x243210){return _0x243210['destroy']()[_0x47a5('0x12')](function(){var _0x9ac908=_0x243210[_0x47a5('0x29')]({'plain':!![]});if(_0x9ac908['role']===_0x47a5('0x2a'))return;var _0x625952=[{'name':_0x47a5('0x2b'),'value':_0x47a5('0x2c'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x47a5('0x2d'),'value':_0x47a5('0x2e'),'ignore':![]}];var _0x5bd7eb=_(_0x625952)['filter'](_0x47a5('0x2f'))[_0x47a5('0x30')]('value')[_0x47a5('0x31')]();if(_['includes'](_0x5bd7eb,_0x9ac908[_0x47a5('0x32')])){return;}var _0xd972c=_['find'](_0x625952,['value',_0x9ac908[_0x47a5('0x32')]])['name'];return db[_0x47a5('0x33')][_0x47a5('0x34')]({'where':{'type':_0xd972c,'resourceId':_0x9ac908['id']}})[_0x47a5('0x12')](function(){return _0x243210;});})['then'](function(){_0x528582[_0x47a5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c754){return function(_0x65542e){if(!_0x65542e){_0x53c754['sendStatus'](0x194);}return _0x65542e;};}function handleError(_0x25cce0,_0x5ef577){_0x5ef577=_0x5ef577||0x1f4;return function(_0x21ad34){logger[_0x47a5('0x19')](_0x21ad34[_0x47a5('0x35')]);if(_0x21ad34[_0x47a5('0x36')]){delete _0x21ad34[_0x47a5('0x36')];}_0x25cce0[_0x47a5('0x25')](_0x5ef577)[_0x47a5('0x37')](_0x21ad34);};}exports[_0x47a5('0x38')]=function(_0x1a0d23,_0x4caed5){var _0x396a9a={},_0x10f136={'count':0x0,'rows':[]};var _0x511c06=_(db[_0x47a5('0x39')][_0x47a5('0x3a')])[_0x47a5('0x30')](function(_0x49c4b5){return{'name':_0x49c4b5[_0x47a5('0x3b')],'type':_0x49c4b5[_0x47a5('0x3c')]['key']};})[_0x47a5('0x3d')](function(_0x19218a){return!_['includes'](['password','salt'],_0x19218a[_0x47a5('0x36')]);})['value']();_0x396a9a=qs[_0x47a5('0x3e')](_0x511c06,_0x1a0d23);var _0x1f9631={'where':_0x396a9a[_0x47a5('0x3f')]};return db[_0x47a5('0x39')][_0x47a5('0x24')](_0x1f9631)[_0x47a5('0x12')](function(_0x2003b0){_0x10f136[_0x47a5('0x24')]=_0x2003b0;if(_0x1a0d23[_0x47a5('0x40')][_0x47a5('0x41')]){_0x396a9a[_0x47a5('0x42')]=[{'all':!![]}];}if(!_[_0x47a5('0x43')](_0x396a9a[_0x47a5('0x44')],'id')){_0x396a9a['attributes'][_0x47a5('0x45')]('id');}return db[_0x47a5('0x39')][_0x47a5('0x46')](_0x396a9a);})[_0x47a5('0x12')](function(_0x586f4f){_0x10f136[_0x47a5('0x47')]=_0x586f4f;if(_0x1a0d23['query']['openTabs']==='true'){var _0x50d116=[];for(var _0x27dd5d=0x0;_0x27dd5d<_0x10f136['rows'][_0x47a5('0x48')];_0x27dd5d++){_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x49'),_0x10f136['rows'][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs('sms',_0x10f136['rows'][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116['push'](get_open_tabs(_0x47a5('0x4b'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4c'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4d'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));_0x50d116[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4e'),_0x10f136[_0x47a5('0x47')][_0x27dd5d][_0x47a5('0x4a')]));}return BPromise[_0x47a5('0x4f')](_0x50d116)['then'](function(_0x2d38de){return _0x10f136;});}else{return _0x10f136;}})[_0x47a5('0x12')](respondWithFilteredResult(_0x4caed5,_0x396a9a))['catch'](handleError(_0x4caed5,null));};exports['show']=function(_0x3d0a88,_0x560e4e){var _0x13750d={'raw':![],'where':{'id':_0x3d0a88['params']['id']}},_0xd93e37={};_0xd93e37['model']=_[_0x47a5('0x50')](_['keys'](db[_0x47a5('0x39')][_0x47a5('0x3a')]),[_0x47a5('0x51'),_0x47a5('0x52')]);_0xd93e37[_0x47a5('0x40')]=_[_0x47a5('0x53')](_0x3d0a88[_0x47a5('0x40')]);_0xd93e37['filters']=_['intersection'](_0xd93e37[_0x47a5('0x54')],_0xd93e37[_0x47a5('0x40')]);_0x13750d[_0x47a5('0x44')]=_[_0x47a5('0x55')](_0xd93e37[_0x47a5('0x54')],qs[_0x47a5('0x56')](_0x3d0a88[_0x47a5('0x40')]['fields']));_0x13750d[_0x47a5('0x44')]=_0x13750d[_0x47a5('0x44')][_0x47a5('0x48')]?_0x13750d['attributes']:_0xd93e37[_0x47a5('0x54')];if(_0x3d0a88['query'][_0x47a5('0x41')]){_0x13750d[_0x47a5('0x42')]=[{'all':!![]}];}_0x13750d=_[_0x47a5('0x57')]({},_0x13750d,_0x3d0a88[_0x47a5('0x58')]);if(!_['includes'](_0x13750d[_0x47a5('0x44')],'id')){_0x13750d[_0x47a5('0x44')][_0x47a5('0x45')]('id');}return db[_0x47a5('0x39')][_0x47a5('0x59')](_0x13750d)[_0x47a5('0x12')](handleEntityNotFound(_0x560e4e,null))[_0x47a5('0x12')](function(_0x481089){var _0x2a0aa2=[];values=_0x481089;if(_0x3d0a88[_0x47a5('0x40')][_0x47a5('0x5a')]===_0x47a5('0x5b')){_0x2a0aa2[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x49'),_0x481089['dataValues']));_0x2a0aa2[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x5c'),_0x481089[_0x47a5('0x4a')]));_0x2a0aa2['push'](get_open_tabs(_0x47a5('0x4d'),_0x481089[_0x47a5('0x4a')]));_0x2a0aa2[_0x47a5('0x45')](get_open_tabs('whatsapp',_0x481089['dataValues']));_0x2a0aa2[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4b'),_0x481089['dataValues']));_0x2a0aa2['push'](get_open_tabs(_0x47a5('0x4c'),_0x481089['dataValues']));return BPromise[_0x47a5('0x4f')](_0x2a0aa2);}else{return values;}})['then'](function(_0x482de6){return values;})[_0x47a5('0x12')](respondWithResult(_0x560e4e,null))[_0x47a5('0x1d')](handleError(_0x560e4e,null));};exports['update']=function(_0x1b958b,_0x72fe){if(_0x1b958b['body']['id']){delete _0x1b958b['body']['id'];}delete _0x1b958b[_0x47a5('0x5d')][_0x47a5('0x32')];return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x1b958b['params']['id']}})[_0x47a5('0x12')](handleEntityNotFound(_0x72fe,null))[_0x47a5('0x12')](saveUpdates(_0x1b958b[_0x47a5('0x5d')],null))['then'](respondWithResult(_0x72fe,null))[_0x47a5('0x1d')](handleError(_0x72fe,null));};exports['describe']=function(_0x485e3c,_0x470da6){return db[_0x47a5('0x39')][_0x47a5('0x5e')]()[_0x47a5('0x12')](respondWithResult(_0x470da6,null))['catch'](handleError(_0x470da6,null));};exports[_0x47a5('0x5f')]=function(_0x5d1550,_0x5cbe97){return db['User']['find']({'where':{'id':_0x5d1550[_0x47a5('0x60')]['id']}})[_0x47a5('0x12')](handleEntityNotFound(_0x5cbe97,null))[_0x47a5('0x12')](function(_0x52e3ee){if(_0x52e3ee){return _0x52e3ee['addContacts'](_0x5d1550[_0x47a5('0x5d')][_0x47a5('0x61')],_[_0x47a5('0x62')](_0x5d1550[_0x47a5('0x5d')],[_0x47a5('0x61'),'id'])||{});}})['then'](respondWithResult(_0x5cbe97,null))[_0x47a5('0x1d')](handleError(_0x5cbe97,null));};function validateUser(_0x519e9e){return new BPromise(function(_0x22c886,_0x274d31){if(_0x519e9e['internal'])return _0x22c886(_0x519e9e);return db[_0x47a5('0x63')][_0x47a5('0x64')](0x1)[_0x47a5('0x12')](function(_0x3e8274){if(_0x3e8274[_0x47a5('0x65')])authService[_0x47a5('0x66')](_0x519e9e[_0x47a5('0x51')]);db[_0x47a5('0x39')]['max'](_0x47a5('0x67'))[_0x47a5('0x12')](function(_0x3c75c6){if(_[_0x47a5('0x68')](_0x3c75c6)){_0x519e9e[_0x47a5('0x67')]=_0x3e8274['min_internal']||0x1;return;}if(_[_0x47a5('0x68')](_0x3e8274[_0x47a5('0x69')])||_0x3e8274[_0x47a5('0x69')]===_0x3c75c6){_0x519e9e[_0x47a5('0x67')]=_0x3c75c6+0x1;return;}if(_0x3e8274[_0x47a5('0x69')]>_0x3c75c6){_0x519e9e[_0x47a5('0x67')]=_0x3e8274[_0x47a5('0x69')];return;}return db[_0x47a5('0x6a')][_0x47a5('0x40')](_0x47a5('0x6b'),{'type':db[_0x47a5('0x6a')][_0x47a5('0x6c')][_0x47a5('0x6d')]})[_0x47a5('0x12')](function(_0x3edd17){if(_0x3edd17&&_0x3edd17['length']){for(var _0x42dd7d=0x0,_0x284fb8=_0x3edd17[_0x47a5('0x48')];_0x42dd7d<_0x284fb8&&_['isNil'](_0x519e9e[_0x47a5('0x67')]);_0x42dd7d++){if(_0x3e8274[_0x47a5('0x69')]<=_0x3edd17[_0x42dd7d][_0x47a5('0x6e')]){_0x519e9e[_0x47a5('0x67')]=_0x3edd17[_0x42dd7d]['from'];}else if(_0x3e8274[_0x47a5('0x69')]>_0x3edd17[_0x42dd7d]['from']&&_0x3e8274[_0x47a5('0x69')]<=_0x3edd17[_0x42dd7d]['to']){_0x519e9e['internal']=_0x3e8274[_0x47a5('0x69')];}}}if(_['isNil'](_0x519e9e[_0x47a5('0x67')])){_0x519e9e[_0x47a5('0x67')]=_0x3c75c6+0x1;}return _0x22c886(_0x519e9e);});});})[_0x47a5('0x1d')](function(_0x58473b){_0x274d31(_0x58473b);});});}function updateUser(_0x4af557){return new BPromise(function(_0x4b8084,_0x4164a3){try{if(_0x4af557[_0x47a5('0x6f')]){_0x4af557[_0x47a5('0x70')]=_0x4af557[_0x47a5('0x67')];_0x4af557['VoiceMail']={'mailbox':_0x4af557[_0x47a5('0x67')],'password':_0x4af557[_0x47a5('0x51')],'fullname':_0x4af557[_0x47a5('0x71')],'email':_0x4af557[_0x47a5('0x72')]};}if(_0x4af557[_0x47a5('0x32')]===_0x47a5('0x73')){if(!_0x4af557[_0x47a5('0x74')])_0x4af557[_0x47a5('0x74')]=[_0x47a5('0x75'),_0x47a5('0x76'),_0x47a5('0x77'),_0x47a5('0x78'),'110',_0x47a5('0x79'),'105',_0x47a5('0x7a'),_0x47a5('0x7b'),_0x47a5('0x7c'),_0x47a5('0x7d'),_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x80'),_0x47a5('0x81')];}_0x4b8084(_0x4af557);}catch(_0x11c1db){_0x4164a3(_0x11c1db);}});}exports[_0x47a5('0x82')]=function(_0x1cfb37,_0x1f07ac){if(_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]===_0x47a5('0x73'))throw new Error('Unauthorized');if(_0x1cfb37['body']['role']==='user'&&_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]!=='admin'){throw new Error(_0x47a5('0x83'));}if(_0x1cfb37[_0x47a5('0x5d')][_0x47a5('0x32')]===_0x47a5('0x2a')&&_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]!==_0x47a5('0x2a')){throw new Error(_0x47a5('0x84'));}return licenseUtil[_0x47a5('0x85')]([_0x1cfb37[_0x47a5('0x5d')]])[_0x47a5('0x12')](function(){return validateUser(_0x1cfb37['body']);})[_0x47a5('0x12')](function(_0x1fbd42){return updateUser(_0x1fbd42)[_0x47a5('0x12')](function(_0x4f35ff){if(_0x4f35ff[_0x47a5('0x32')]===_0x47a5('0x2a')){_0x4f35ff[_0x47a5('0x86')]=_0x1cfb37['user'][_0x47a5('0x86')];delete _0x4f35ff['userProfileId'];}return _0x4f35ff;});})['then'](function(_0x356e16){return db[_0x47a5('0x39')][_0x47a5('0x82')](_0x356e16,{'include':[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x87')}]});})[_0x47a5('0x12')](function(_0x479a82){if(_0x1cfb37['body'][_0x47a5('0x32')]==='user')return _0x479a82;if(_0x1cfb37[_0x47a5('0x2c')][_0x47a5('0x32')]!==_0x47a5('0x2c'))return _0x479a82;return db[_0x47a5('0x88')]['find']({'where':{'name':_0x479a82[_0x47a5('0x32')]==='agent'?'Agents':_0x47a5('0x2d'),'userProfileId':_0x1cfb37[_0x47a5('0x2c')]['userProfileId']},'raw':!![]})[_0x47a5('0x12')](function(_0x21828e){if(!_0x21828e||_0x21828e[_0x47a5('0x89')]!=0x0)return _0x479a82;return db['UserProfileResource'][_0x47a5('0x82')]({'name':_0x479a82['name'],'resourceId':_0x479a82['id'],'type':_0x21828e[_0x47a5('0x36')],'sectionId':_0x21828e['id']},{})[_0x47a5('0x12')](function(){return _0x479a82;});})[_0x47a5('0x1d')](function(_0x4a5ca1){logger[_0x47a5('0x19')](_0x47a5('0x8a'),_0x4a5ca1);throw _0x4a5ca1;});})[_0x47a5('0x12')](respondWithResult(_0x1f07ac,0xc9))['catch'](handleError(_0x1f07ac,null));};exports[_0x47a5('0x8b')]=function(_0x4f2fbb,_0x3c012b){var _0x491bb4=_0x4f2fbb[_0x47a5('0x5d')];var _0x20d8bd=[];if(_0x4f2fbb[_0x47a5('0x2c')][_0x47a5('0x32')]==='agent')throw new Error(_0x47a5('0x8c'));if(_[_0x47a5('0x8d')](_0x491bb4,[_0x47a5('0x32'),_0x47a5('0x2c')])&&_0x4f2fbb[_0x47a5('0x2c')]['role']!=='admin'){throw new Error(_0x47a5('0x83'));}if(_['some'](_0x491bb4,[_0x47a5('0x32'),_0x47a5('0x2a')])&&_0x4f2fbb[_0x47a5('0x2c')]['role']!==_0x47a5('0x2a')){throw new Error(_0x47a5('0x8e'));}return licenseUtil['checkUserLimits'](_0x491bb4)[_0x47a5('0x12')](function(){return validateUser(_0x491bb4[0x0]);})[_0x47a5('0x12')](function(){for(var _0x19acfa=0x1;_0x19acfa<_0x491bb4[_0x47a5('0x48')];_0x19acfa++){var _0x58dacd=_0x491bb4[_0x19acfa-0x1]['internal'];if(!_0x491bb4[_0x19acfa][_0x47a5('0x67')])_0x491bb4[_0x19acfa][_0x47a5('0x67')]=_0x58dacd+0x1;_0x20d8bd['push'](validateUser(_0x491bb4[_0x19acfa]));}return BPromise[_0x47a5('0x4f')](_0x20d8bd);})[_0x47a5('0x12')](function(){_0x20d8bd=[];for(var _0x5a0901=0x0;_0x5a0901<_0x491bb4[_0x47a5('0x48')];_0x5a0901++){_0x20d8bd[_0x47a5('0x45')](updateUser(_0x491bb4[_0x5a0901]));}return BPromise[_0x47a5('0x4f')](_0x20d8bd);})['then'](function(){return BPromise[_0x47a5('0x8f')](_0x491bb4,function(_0x59b4a5){return db[_0x47a5('0x39')]['create'](_0x59b4a5,{'include':[{'model':db[_0x47a5('0x87')],'as':_0x47a5('0x87')}]})['then'](function(_0x35d9f0){_0x59b4a5['id']=_0x35d9f0['id'];return _0x59b4a5;});});})['then'](function(_0x1eabef){if(_0x4f2fbb[_0x47a5('0x5d')][_0x47a5('0x32')]===_0x47a5('0x2c'))return _0x1eabef;if(_0x4f2fbb['user'][_0x47a5('0x32')]!=='user')return _0x1eabef;var _0x52be82=_[_0x47a5('0x8d')](_0x1eabef,function(_0x46bdb1){return _0x46bdb1[_0x47a5('0x32')]===_0x47a5('0x73')||_0x46bdb1[_0x47a5('0x32')]==='telephone';});if(!_0x52be82)return _0x1eabef;return db[_0x47a5('0x88')][_0x47a5('0x46')]({'where':{'name':{'$or':[_0x47a5('0x90'),_0x47a5('0x2d')]},'userProfileId':_0x4f2fbb['user'][_0x47a5('0x91')]},'raw':!![]})['then'](function(_0x12891d){if(_[_0x47a5('0x92')](_0x12891d)||!_[_0x47a5('0x8d')](_0x12891d,[_0x47a5('0x89'),0x0]))return _0x1eabef;_0x20d8bd=[];var _0x29a1cf=_(_0x12891d)[_0x47a5('0x30')](function(_0x92bfd7){if(_0x92bfd7[_0x47a5('0x89')]===0x1)return;return _0x92bfd7[_0x47a5('0x36')]==='Agents'?_0x47a5('0x73'):_0x47a5('0x2e');})['compact']()[_0x47a5('0x31')]();for(var _0x32035e=0x0;_0x32035e<_0x1eabef[_0x47a5('0x48')];_0x32035e++){if(!_['includes'](_0x29a1cf,_0x1eabef[_0x32035e]['role']))return;var _0x126bb1=_0x1eabef[_0x32035e][_0x47a5('0x32')]==='agent'?'Agents':_0x47a5('0x2d');_0x20d8bd[_0x47a5('0x45')](db['UserProfileResource'][_0x47a5('0x82')]({'name':_0x1eabef[_0x32035e][_0x47a5('0x36')],'resourceId':_0x1eabef[_0x32035e]['id'],'type':_0x126bb1,'sectionId':_['find'](_0x12891d,[_0x47a5('0x36'),_0x126bb1])['id']},{}));}return BPromise[_0x47a5('0x4f')](_0x20d8bd);});})[_0x47a5('0x12')](respondWithResult(_0x3c012b,0xc9))[_0x47a5('0x1d')](handleError(_0x3c012b,null));};exports[_0x47a5('0x93')]=function(_0x1371e4,_0x5d89a1){if(_0x1371e4['body']['id']){delete _0x1371e4['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x1371e4['params']['id']}})[_0x47a5('0x12')](function(_0x241f2a){if(!_0x241f2a)return null;if(_0x241f2a['id']===_0x1371e4[_0x47a5('0x2c')]['id']){if(!_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x94')]||!_0x1371e4['body'][_0x47a5('0x95')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x241f2a[_0x47a5('0x96')](_0x1371e4['body'][_0x47a5('0x94')])){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))]('Wrong\x20credentials');}if(_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x94')]===_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')]){throw new db[(_0x47a5('0x97'))]['ValidationError'](_0x47a5('0x99'));}}else if(_0x1371e4[_0x47a5('0x2c')]['role']===_0x47a5('0x2a')){if(!_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')]){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))](_0x47a5('0x9a'));}}else if(_0x1371e4['user'][_0x47a5('0x32')]===_0x47a5('0x2c')){if(!_0x1371e4['body'][_0x47a5('0x95')]){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))](_0x47a5('0x9a'));}if(_0x241f2a['role']!=='agent'){throw new db['Sequelize']['ValidationError'](_0x47a5('0x8c'));}}else{throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))](_0x47a5('0x8c'));}return _0x241f2a;})[_0x47a5('0x12')](handleEntityNotFound(_0x5d89a1,null))[_0x47a5('0x12')](function(_0xac1f9e){return db[_0x47a5('0x63')]['findOne']({'attributes':['id',_0x47a5('0x65'),_0x47a5('0x9b'),_0x47a5('0x9c')]})[_0x47a5('0x12')](function(_0x47be87){if(_0x47be87['securePassword'])authService[_0x47a5('0x66')](_0x1371e4['body']['newPassword']);if(!_0x47be87[_0x47a5('0x9b')]||!_0xac1f9e[_0x47a5('0x9d')])return _0xac1f9e;authService['validatePasswordHistory'](_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')],_0xac1f9e[_0x47a5('0x9d')],_0x47be87['passwordHistoryLimit']);return _0xac1f9e;})[_0x47a5('0x12')](saveUpdates({'password':_0x1371e4[_0x47a5('0x5d')]['newPassword'],'passwordResetAt':_0x1371e4[_0x47a5('0x2c')]['id']==_0x1371e4[_0x47a5('0x60')]['id']?moment():null,'previousPasswords':authService[_0x47a5('0x9e')](_0x1371e4[_0x47a5('0x5d')][_0x47a5('0x95')],_0xac1f9e[_0x47a5('0x9d')])},null));})['then'](respondWithResult(_0x5d89a1,null))[_0x47a5('0x1d')](handleError(_0x5d89a1,null));};exports['addQueues']=function(_0x2a3f32,_0x3ab7ac){var _0xe3f69f=_0x2a3f32[_0x47a5('0x5d')]['channel'];return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x2a3f32[_0x47a5('0x60')]['id']},'attributes':['id',_0x47a5('0x36'),_0x47a5('0x32'),_0x47a5('0x9f'),_0x47a5('0xa0'),_0x47a5('0xa1'),_0x47a5('0xa2')]})[_0x47a5('0x12')](handleEntityNotFound(_0x3ab7ac,null))[_0x47a5('0x12')](function(_0x301031){if(_0x301031){if(!utils['isValidChannel'](_0xe3f69f)){throw new db[(_0x47a5('0x97'))][(_0x47a5('0x98'))]('Unknown\x20channel');}return _0x301031[_0x47a5('0xa3')+_[_0x47a5('0xa4')](_0xe3f69f[_0x47a5('0xa5')]())+_0x47a5('0xa6')](_0x2a3f32[_0x47a5('0x5d')]['ids'],{'penalty':_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0xa7')]||0x0})[_0x47a5('0xa8')](function(_0x266a2f){for(var _0x343214=0x0;_0x343214<_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0x61')]['length'];_0x343214+=0x1){var _0x596562={'UserId':Number(_0x2a3f32[_0x47a5('0x60')]['id'])};_0x596562[_['capitalize'](_0xe3f69f[_0x47a5('0xa5')]())+'QueueId']=Number(_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0x61')][_0x343214]);socket[_0x47a5('0xa9')](_0x47a5('0x2c')+_['capitalize'](_0xe3f69f[_0x47a5('0xa5')]())+_0x47a5('0xaa'),_0x596562);}return _0x266a2f;})[_0x47a5('0x12')](function(){if(_0xe3f69f==='voice'){return db['VoiceQueue'][_0x47a5('0x46')]({'where':{'id':_0x2a3f32[_0x47a5('0x5d')][_0x47a5('0x61')]||[]},'raw':!![],'attributes':['id',_0x47a5('0x36')]});}})[_0x47a5('0x12')](function(_0x402bba){var _0x1c0323=_0x301031[_0x47a5('0x29')]({'plain':!![]});var _0x566630=[];if(_0xe3f69f===_0x47a5('0xab')&&_0x1c0323['role']===_0x47a5('0x73')&&_0x1c0323[_0x47a5('0x9f')]){for(var _0x5b0b0b=0x0;_0x5b0b0b<_0x402bba['length'];_0x5b0b0b+=0x1){_0x566630[_0x47a5('0x45')]({'membername':_0x1c0323[_0x47a5('0x36')],'UserId':_0x1c0323['id'],'queue_name':_0x402bba[_0x5b0b0b]['name'],'VoiceQueueId':_0x402bba[_0x5b0b0b]['id'],'interface':_[_0x47a5('0x68')](_0x1c0323[_0x47a5('0xa2')])?util[_0x47a5('0xac')](_0x47a5('0xad'),_0x1c0323['name']):_0x1c0323[_0x47a5('0xa2')],'paused':_0x1c0323['voicePause']||![],'penalty':_0x2a3f32['body']['penalty']||0x0});}return BPromise[_0x47a5('0x8f')](_0x566630,function(_0x5a975d){return db[_0x47a5('0xae')][_0x47a5('0xaf')](_0x5a975d);});}return _0x301031;});}})[_0x47a5('0x12')](respondWithStatusCode(_0x3ab7ac,null))[_0x47a5('0x1d')](handleError(_0x3ab7ac,null));};exports[_0x47a5('0xb0')]=function(_0x1dae08,_0x6cd737){var _0x62d3a4;return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x1dae08[_0x47a5('0x60')]['id']},'attributes':['id',_0x47a5('0x36'),_0x47a5('0x32')]})[_0x47a5('0x12')](handleEntityNotFound(_0x6cd737,null))[_0x47a5('0x12')](function(_0x5e17cb){if(_0x5e17cb){_0x62d3a4=_0x5e17cb;if(!_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')]||!utils[_0x47a5('0xb2')](_0x1dae08[_0x47a5('0x40')]['channel'])){throw new db[(_0x47a5('0x97'))]['ValidationError'](_0x47a5('0xb3'));}return _0x5e17cb['remove'+_[_0x47a5('0xa4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')]['toLowerCase']())+_0x47a5('0xa6')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')]);}})['then'](function(_0x52798d){if(_[_0x47a5('0xb4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')])){for(var _0x4594df=0x0;_0x4594df<_0x1dae08[_0x47a5('0x40')]['ids'][_0x47a5('0x48')];_0x4594df+=0x1){var _0x481bc3={'UserId':Number(_0x1dae08[_0x47a5('0x60')]['id'])};_0x481bc3[_[_0x47a5('0xa4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')]['toLowerCase']())+'QueueId']=Number(_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')][_0x4594df]);socket[_0x47a5('0xa9')](_0x47a5('0x2c')+_[_0x47a5('0xa4')](_0x1dae08[_0x47a5('0x40')][_0x47a5('0xb1')][_0x47a5('0xa5')]())+_0x47a5('0xb5'),_0x481bc3);}}else{var _0x481bc3={'UserId':Number(_0x1dae08['params']['id'])};_0x481bc3[_[_0x47a5('0xa4')](_0x1dae08['query'][_0x47a5('0xb1')][_0x47a5('0xa5')]())+_0x47a5('0xb6')]=Number(_0x1dae08['query'][_0x47a5('0x61')]);socket[_0x47a5('0xa9')]('user'+_[_0x47a5('0xa4')](_0x1dae08['query'][_0x47a5('0xb1')][_0x47a5('0xa5')]())+_0x47a5('0xb5'),_0x481bc3);}return _0x52798d;})['then'](function(){if(_0x1dae08['query']['channel']==='voice'){return db['UserVoiceQueueRt'][_0x47a5('0x34')]({'where':{'UserId':_0x1dae08['params']['id'],'VoiceQueueId':_0x1dae08[_0x47a5('0x40')][_0x47a5('0x61')]},'individualHooks':!![]})['then'](function(){return _0x62d3a4;});}return _0x62d3a4;})['then'](respondWithStatusCode(_0x6cd737,null))['catch'](handleError(_0x6cd737,null));};exports[_0x47a5('0xb7')]=function(_0x4e0dfa,_0x4ec4a8){_0x4e0dfa['body'][_0x47a5('0xb8')]=_0x4e0dfa[_0x47a5('0xb9')][_0x47a5('0xba')];return db[_0x47a5('0x39')]['find']({'where':{'id':_0x4e0dfa[_0x47a5('0x60')]['id']}})['then'](handleEntityNotFound(_0x4ec4a8,null))[_0x47a5('0x12')](saveUpdates(_0x4e0dfa['body'],null))[_0x47a5('0x12')](respondWithResult(_0x4ec4a8,null))[_0x47a5('0x1d')](handleError(_0x4ec4a8,null));};exports[_0x47a5('0xbb')]=function(_0x4f8171,_0x106bbe){var _0x427c02=path[_0x47a5('0xbc')](config[_0x47a5('0xbd')],'server/files/images/logos/default_profile.png');return db[_0x47a5('0x39')][_0x47a5('0x59')]({'where':{'id':_0x4f8171[_0x47a5('0x60')]['id']},'attributes':['id',_0x47a5('0xb8')],'raw':!![]})[_0x47a5('0x12')](handleEntityNotFound(_0x106bbe,null))[_0x47a5('0x12')](function(_0x598825){if(_0x598825){if(_[_0x47a5('0x68')](_0x598825[_0x47a5('0xb8')])){return _0x106bbe[_0x47a5('0xbe')](_0x427c02);}else{if(!fs[_0x47a5('0xbf')](path[_0x47a5('0xbc')](config[_0x47a5('0xbd')],_0x47a5('0xc0'),_0x598825[_0x47a5('0xb8')]))){return _0x106bbe[_0x47a5('0xbe')](_0x427c02);}return _0x106bbe[_0x47a5('0xbe')](path[_0x47a5('0xbc')](config[_0x47a5('0xbd')],_0x47a5('0xc0'),_0x598825[_0x47a5('0xb8')]));}}})[_0x47a5('0x1d')](handleError(_0x106bbe,null));};exports[_0x47a5('0xc1')]=function(_0x40505e,_0x4c181e){return db[_0x47a5('0x39')]['find']({'where':{'id':_0x40505e['params']['id']},'attributes':['id']})[_0x47a5('0x12')](handleEntityNotFound(_0x4c181e,null))[_0x47a5('0x12')](function(_0x36f910){var _0x4d4039=[];values=_0x36f910[_0x47a5('0x4a')];_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x49'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x5c'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4d'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039[_0x47a5('0x45')](get_open_tabs(_0x47a5('0x4e'),_0x36f910[_0x47a5('0x4a')]));_0x4d4039['push'](get_open_tabs('fax',_0x36f910[_0x47a5('0x4a')]));_0x4d4039['push'](get_open_tabs(_0x47a5('0x4c'),_0x36f910[_0x47a5('0x4a')]));return BPromise[_0x47a5('0x4f')](_0x4d4039);})[_0x47a5('0x12')](function(_0x2bdd28){var _0x3708ea=[];if(_0x2bdd28){for(var _0x258b96=0x0;_0x258b96=_0x2ed32b['agents']){throw new Error(_0x60bd('0x55'));}})[_0x60bd('0x22')](function(){if(_0x2d08b4){return db[_0x60bd('0x2a')][_0x60bd('0x4b')]({'where':{'membername':_0x2d08b4[_0x60bd('0x27')]},'individualHooks':!![]});}})[_0x60bd('0x22')](function(){if(_0x2d08b4){return _0x2d08b4[_0x60bd('0x56')]({'raw':!![]});}})[_0x60bd('0x22')](function(_0x43010a){if(_0x2d08b4){if(_0x43010a){var _0x540b9c=[];_0xec3990=_0x43010a;if(_0xec3990['length']){for(var _0x1dd618=0x0;_0x1dd618<_0xec3990[_0x60bd('0x2f')];_0x1dd618++){_0x540b9c[_0x60bd('0x33')](db[_0x60bd('0x2a')][_0x60bd('0x57')]({'membername':_0x2d08b4[_0x60bd('0x27')],'UserId':_0x2d08b4['id'],'queue_name':_0xec3990[_0x1dd618][_0x60bd('0x27')],'VoiceQueueId':_0xec3990[_0x1dd618]['id'],'interface':_0x203f18,'paused':_0x2d08b4[_0x60bd('0x4f')]||![],'penalty':_0xec3990[_0x1dd618][_0x60bd('0x58')]||0x0}));}return BPromise[_0x60bd('0x49')](_0x540b9c);}}}})[_0x60bd('0x22')](function(){if(_0x2d08b4){return db['MemberReport']['findAll']({'where':{'membername':_0x2d08b4['name'],'exitAt':null}});}})[_0x60bd('0x22')](function(_0x5ab7a8){if(_0x2d08b4){if(_0x5ab7a8&&_0x5ab7a8[_0x60bd('0x2f')]){var _0x23e5a0=[];_0x5ab7a8['forEach'](function(_0x246ee7){_0x23e5a0[_0x60bd('0x33')](_0x246ee7[_0x60bd('0x2b')]({'exitAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e'))}));});return BPromise['all'](_0x23e5a0);}}})[_0x60bd('0x22')](function(_0x58c22e){if(_0x2d08b4){var _0x2afe40=[];var _0x10004f=[];var _0x32bf37=utils['getChannels']();var _0xf6ce6a={'membername':_0x2d08b4[_0x60bd('0x27')],'interface':_0x203f18,'enterAt':moment()[_0x60bd('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2d08b4[_0x60bd('0x4c')],'internal':_0x2d08b4['internal']};_0x32bf37[_0x60bd('0x32')](function(_0x10915f){_0x2afe40[_0x60bd('0x33')](_[_0x60bd('0x59')]({'channel':_0x10915f,'type':_0x60bd('0x5a'),'data1':_0x60bd('0x5b'),'data2':_0x203f18},_0xf6ce6a));if(_0x2d08b4[_0x60bd('0x4f')]){_0x10004f['push'](_[_0x60bd('0x59')]({'channel':_0x10915f,'type':_0x60bd('0x2d'),'data1':_0x60bd('0x5c')},_0xf6ce6a));}});return db[_0x60bd('0x2c')]['bulkCreate'](_0x2afe40['concat'](_0x10004f),{'individualHooks':!![]});}})['then'](function(){if(_0x2d08b4){return _0x2d08b4[_0x60bd('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e')),'voicePause':_0x2d08b4[_0x60bd('0x4f')]||![],'mailPause':_0x2d08b4[_0x60bd('0x4f')]||![],'chatPause':_0x2d08b4[_0x60bd('0x4f')]||![],'faxPause':_0x2d08b4[_0x60bd('0x4f')]||![],'smsPause':_0x2d08b4['loginInPause']||![],'openchannelPause':_0x2d08b4[_0x60bd('0x4f')]||![],'pauseType':_0x2d08b4[_0x60bd('0x4f')]?_0x60bd('0x5c'):null,'lastPauseAt':moment()[_0x60bd('0x35')](_0x60bd('0x2e')),'interface':_0x203f18});}})[_0x60bd('0x22')](function(_0x79b864){_0x281f05(_0x79b864);})[_0x60bd('0x18')](function(_0x2c1119){_0x1c6e43(_0x50b104['error'](0x1f4,_0x2c1119[_0x60bd('0x16')]));});});}; \ No newline at end of file +var _0xd512=['User','findAll','options','raw','where','attributes','limit','include','map','model','then','GetUser','stringify','catch','ShowUser','find','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','YYYY-MM-DD\x20HH:mm:ss','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','channel','isValidChannel','Unknown\x20channel','system','mail','chat','fax','openchannel','whatsapp','%s%s','Pause','LogoutUser','findOne','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','concat','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./user.socket','register','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x1782d5,_0x5206a4){var _0x54f559=function(_0x51af07){while(--_0x51af07){_0x1782d5['push'](_0x1782d5['shift']());}};_0x54f559(++_0x5206a4);}(_0xd512,0x9f));var _0x2d51=function(_0x16d1b6,_0x5912db){_0x16d1b6=_0x16d1b6-0x0;var _0x2ca1f5=_0xd512[_0x16d1b6];return _0x2ca1f5;};'use strict';var _=require(_0x2d51('0x0'));var util=require(_0x2d51('0x1'));var moment=require(_0x2d51('0x2'));var BPromise=require(_0x2d51('0x3'));var rs=require(_0x2d51('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d51('0x5'))['db'];var utils=require(_0x2d51('0x6'));var logger=require(_0x2d51('0x7'))(_0x2d51('0x8'));var config=require('../../config/environment');var jayson=require(_0x2d51('0x9'));var client=jayson['client'][_0x2d51('0xa')]({'port':0x232a});config['redis']=_[_0x2d51('0xb')](config[_0x2d51('0xc')],{'host':_0x2d51('0xd'),'port':0x18eb});var socket=require(_0x2d51('0xe'))(new Redis(config[_0x2d51('0xc')]));require(_0x2d51('0xf'))[_0x2d51('0x10')](socket);function respondWithRpcPromise(_0x4c782c,_0x17ab84,_0x39af31){return new BPromise(function(_0x2345ba,_0x300a7e){return client['request'](_0x4c782c,_0x39af31)['then'](function(_0x8c4208){logger['info'](_0x2d51('0x11'),_0x17ab84,_0x2d51('0x12'));logger[_0x2d51('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x17ab84,_0x2d51('0x12'),JSON['stringify'](_0x8c4208));if(_0x8c4208[_0x2d51('0x14')]){if(_0x8c4208['error'][_0x2d51('0x15')]===0x1f4){logger['error'](_0x2d51('0x11'),_0x17ab84,_0x8c4208[_0x2d51('0x14')][_0x2d51('0x16')]);return _0x300a7e(_0x8c4208[_0x2d51('0x14')][_0x2d51('0x16')]);}logger[_0x2d51('0x14')]('User,\x20%s,\x20%s',_0x17ab84,_0x8c4208[_0x2d51('0x14')][_0x2d51('0x16')]);return _0x2345ba(_0x8c4208[_0x2d51('0x14')][_0x2d51('0x16')]);}else{logger[_0x2d51('0x17')]('User,\x20%s,\x20%s',_0x17ab84,_0x2d51('0x12'));_0x2345ba(_0x8c4208[_0x2d51('0x18')]['message']);}})['catch'](function(_0x39f18b){logger[_0x2d51('0x14')](_0x2d51('0x11'),_0x17ab84,_0x39f18b);_0x300a7e(_0x39f18b);});});}exports['GetUser']=function(_0x28a205){var _0xe627c=this;return new Promise(function(_0x35da7a,_0xc5a70b){return db[_0x2d51('0x19')][_0x2d51('0x1a')]({'raw':_0x28a205[_0x2d51('0x1b')]?_0x28a205[_0x2d51('0x1b')][_0x2d51('0x1c')]===undefined?!![]:![]:!![],'where':_0x28a205[_0x2d51('0x1b')]?_0x28a205[_0x2d51('0x1b')][_0x2d51('0x1d')]||null:null,'attributes':_0x28a205[_0x2d51('0x1b')]?_0x28a205[_0x2d51('0x1b')][_0x2d51('0x1e')]||null:null,'limit':_0x28a205[_0x2d51('0x1b')]?_0x28a205['options'][_0x2d51('0x1f')]||null:null,'include':_0x28a205['options']?_0x28a205[_0x2d51('0x1b')][_0x2d51('0x20')]?_[_0x2d51('0x21')](_0x28a205[_0x2d51('0x1b')]['include'],function(_0x1544d7){return{'model':db[_0x1544d7[_0x2d51('0x22')]],'as':_0x1544d7['as'],'attributes':_0x1544d7[_0x2d51('0x1e')],'include':_0x1544d7[_0x2d51('0x20')]?_['map'](_0x1544d7[_0x2d51('0x20')],function(_0x23274d){return{'model':db[_0x23274d[_0x2d51('0x22')]],'as':_0x23274d['as'],'attributes':_0x23274d[_0x2d51('0x1e')],'include':_0x23274d[_0x2d51('0x20')]?_['map'](_0x23274d[_0x2d51('0x20')],function(_0xcd53d0){return{'model':db[_0xcd53d0[_0x2d51('0x22')]],'as':_0xcd53d0['as'],'attributes':_0xcd53d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d51('0x23')](function(_0x126f36){logger[_0x2d51('0x17')](_0x2d51('0x24'),_0x28a205);logger['debug'](_0x2d51('0x24'),_0x28a205,JSON[_0x2d51('0x25')](_0x126f36));_0x35da7a(_0x126f36);})[_0x2d51('0x26')](function(_0x2d9ee0){logger[_0x2d51('0x14')](_0x2d51('0x24'),_0x2d9ee0['message'],_0x28a205);_0xc5a70b(_0xe627c[_0x2d51('0x14')](0x1f4,_0x2d9ee0['message']));});});};exports[_0x2d51('0x27')]=function(_0x133503){var _0x1fa9c8=this;return new Promise(function(_0x5dc26f,_0x10f3bf){return db[_0x2d51('0x19')][_0x2d51('0x28')]({'raw':_0x133503[_0x2d51('0x1b')]?_0x133503[_0x2d51('0x1b')][_0x2d51('0x1c')]===undefined?!![]:![]:!![],'where':_0x133503['options']?_0x133503[_0x2d51('0x1b')][_0x2d51('0x1d')]||null:null,'attributes':_0x133503[_0x2d51('0x1b')]?_0x133503[_0x2d51('0x1b')][_0x2d51('0x1e')]||null:null,'include':_0x133503[_0x2d51('0x1b')]?_0x133503[_0x2d51('0x1b')][_0x2d51('0x20')]?_['map'](_0x133503[_0x2d51('0x1b')][_0x2d51('0x20')],function(_0x1a4e55){return{'model':db[_0x1a4e55['model']],'as':_0x1a4e55['as'],'attributes':_0x1a4e55[_0x2d51('0x1e')],'include':_0x1a4e55[_0x2d51('0x20')]?_[_0x2d51('0x21')](_0x1a4e55[_0x2d51('0x20')],function(_0x1a9181){return{'model':db[_0x1a9181['model']],'as':_0x1a9181['as'],'attributes':_0x1a9181[_0x2d51('0x1e')],'include':_0x1a9181[_0x2d51('0x20')]?_[_0x2d51('0x21')](_0x1a9181[_0x2d51('0x20')],function(_0x11fd17){return{'model':db[_0x11fd17[_0x2d51('0x22')]],'as':_0x11fd17['as'],'attributes':_0x11fd17[_0x2d51('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d51('0x23')](function(_0x375ab7){logger[_0x2d51('0x17')](_0x2d51('0x27'),_0x133503);logger['debug']('ShowUser',_0x133503,JSON[_0x2d51('0x25')](_0x375ab7));_0x5dc26f(_0x375ab7);})[_0x2d51('0x26')](function(_0x2ace1f){logger['error'](_0x2d51('0x27'),_0x2ace1f['message'],_0x133503);_0x10f3bf(_0x1fa9c8[_0x2d51('0x14')](0x1f4,_0x2ace1f[_0x2d51('0x16')]));});});};exports[_0x2d51('0x29')]=function(_0x5230f6){var _0xde29ea=this;return new Promise(function(_0x478078,_0x4948ab){var _0xf6477;return db[_0x2d51('0x19')]['find']({'where':_0x5230f6['options'][_0x2d51('0x1d')]||{},'attributes':['id',_0x2d51('0x2a'),_0x2d51('0x2b'),_0x2d51('0x2c'),_0x2d51('0x2d')]})[_0x2d51('0x23')](function(_0x24b0a4){if(_0x24b0a4){_0xf6477=_0x24b0a4;return db[_0x2d51('0x2e')][_0x2d51('0x2f')]({'paused':0x1},{'where':{'UserId':_0xf6477['id']},'individualHooks':!![]});}})[_0x2d51('0x23')](function(){if(_0xf6477){return db[_0x2d51('0x30')][_0x2d51('0x1a')]({'where':{'membername':_0xf6477['name'],'type':_0x2d51('0x31'),'exitAt':null}});}})[_0x2d51('0x23')](function(_0xc4a584){if(_0xf6477){if(_0xc4a584&&_0xc4a584[_0x2d51('0x32')]){var _0x2acb2e=moment()[_0x2d51('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x431227=0x0,_0x46311d=_0xc4a584['length'];_0x431227<_0x46311d;_0x431227++){_0xc4a584[_0x431227][_0x2d51('0x34')]({'exitAt':_0x2acb2e});}}}})[_0x2d51('0x23')](function(){if(_0xf6477){var _0x2cb473=[];var _0x2e39de=utils[_0x2d51('0x35')]();_0x2e39de[_0x2d51('0x36')](function(_0x54f2b7){_0x2cb473[_0x2d51('0x37')]({'channel':_0x54f2b7,'membername':_0xf6477['name'],'interface':_[_0x2d51('0x38')](_0xf6477[_0x2d51('0x2d')])?util[_0x2d51('0x33')]('SIP/%s',_0xf6477[_0x2d51('0x2a')]):_0xf6477['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x2d51('0x39')),'data1':_0x5230f6['body'][_0x2d51('0x3a')]||_0x2d51('0x3b'),'role':_0xf6477[_0x2d51('0x2b')],'internal':_0xf6477[_0x2d51('0x2c')],'uniqueid':_0x5230f6[_0x2d51('0x3c')][_0x2d51('0x3d')]||null});});return db[_0x2d51('0x30')][_0x2d51('0x3e')](_0x2cb473,{'individualHooks':!![]});}})[_0x2d51('0x23')](function(){if(_0xf6477){return _0xf6477[_0x2d51('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5230f6[_0x2d51('0x3c')][_0x2d51('0x3a')]||_0x2d51('0x3b'),'lastPauseAt':moment()[_0x2d51('0x33')](_0x2d51('0x39'))});}})['then'](function(_0x3532a3){_0x478078(_0x3532a3);})['catch'](function(_0x41385b){_0x4948ab(_0xde29ea[_0x2d51('0x14')](0x1f4,_0x41385b['message']));});});};exports['UnpauseUser']=function(_0x43b4d8){var _0x18c35b=this;return new Promise(function(_0x46beca,_0x7391b7){var _0x97f591;return db[_0x2d51('0x19')]['findOne']({'where':_0x43b4d8[_0x2d51('0x1b')][_0x2d51('0x1d')]||{},'attributes':['id','name']})['then'](function(_0x33988c){if(_0x33988c){_0x97f591=_0x33988c;if(_0x43b4d8[_0x2d51('0x3c')][_0x2d51('0x3f')]&&!utils[_0x2d51('0x40')](_0x43b4d8[_0x2d51('0x3c')][_0x2d51('0x3f')])){throw new Error(_0x2d51('0x41'));}switch(_0x43b4d8[_0x2d51('0x3c')]['channel']){case'voice':return db[_0x2d51('0x2e')]['update']({'paused':0x0},{'where':{'UserId':_0x97f591['id']}})[_0x2d51('0x23')](function(){return db[_0x2d51('0x30')][_0x2d51('0x28')]({'where':{'channel':_0x43b4d8[_0x2d51('0x3c')]['channel'],'membername':_0x97f591['name'],'type':_0x2d51('0x31'),'exitAt':null}});})['then'](function(_0x434ade){if(_0x434ade){return _0x434ade[_0x2d51('0x2f')]({'exitAt':moment()[_0x2d51('0x33')](_0x2d51('0x39')),'data2':_0x2d51('0x42')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x97f591[_0x2d51('0x2f')]({'voicePause':![]});});case _0x2d51('0x43'):case _0x2d51('0x44'):case _0x2d51('0x45'):case'sms':case _0x2d51('0x46'):case _0x2d51('0x47'):return db[_0x2d51('0x30')][_0x2d51('0x28')]({'where':{'channel':_0x43b4d8['body'][_0x2d51('0x3f')],'membername':_0x97f591[_0x2d51('0x2a')],'type':_0x2d51('0x31'),'exitAt':null}})[_0x2d51('0x23')](function(_0x5b2242){return _0x5b2242[_0x2d51('0x2f')]({'exitAt':moment()[_0x2d51('0x33')](_0x2d51('0x39')),'data2':_0x2d51('0x42')},{'individualHooks':!![]});})[_0x2d51('0x23')](function(){var _0x21fa42={};_['set'](_0x21fa42,util[_0x2d51('0x33')](_0x2d51('0x48'),_0x43b4d8[_0x2d51('0x3c')][_0x2d51('0x3f')],_0x2d51('0x49')),![]);return _0x97f591['update'](_0x21fa42);});default:return db[_0x2d51('0x2e')]['update']({'paused':0x0},{'where':{'UserId':_0x97f591['id']}})[_0x2d51('0x23')](function(){return db[_0x2d51('0x30')][_0x2d51('0x1a')]({'where':{'membername':_0x97f591[_0x2d51('0x2a')],'type':'PAUSE','exitAt':null}});})[_0x2d51('0x23')](function(_0x41501c){var _0x45c184=[];_0x41501c[_0x2d51('0x36')](function(_0x1e3501){_0x45c184['push'](_0x1e3501[_0x2d51('0x2f')]({'exitAt':moment()[_0x2d51('0x33')](_0x2d51('0x39')),'data2':_0x2d51('0x42')}));});return BPromise['all'](_0x45c184);})['then'](function(){return _0x97f591[_0x2d51('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x290421){_0x46beca(_0x290421);})[_0x2d51('0x26')](function(_0x488f96){_0x7391b7(_0x18c35b[_0x2d51('0x14')](0x1f4,_0x488f96[_0x2d51('0x16')]));});});};exports[_0x2d51('0x4a')]=function(_0x58464f){var _0xa17984=this;return new Promise(function(_0x2d485f,_0x3a9ab8){var _0x1f27fc;return db[_0x2d51('0x19')][_0x2d51('0x4b')]({'where':_0x58464f['options'][_0x2d51('0x1d')]||{},'attributes':['id',_0x2d51('0x2a')]})['then'](function(_0x107700){if(_0x107700){_0x1f27fc=_0x107700;return db[_0x2d51('0x2e')]['destroy']({'where':{'membername':_0x1f27fc[_0x2d51('0x2a')]},'individualHooks':!![]});}})[_0x2d51('0x23')](function(){if(_0x1f27fc){return db[_0x2d51('0x30')][_0x2d51('0x1a')]({'where':{'membername':_0x1f27fc[_0x2d51('0x2a')],'exitAt':null}});}})['then'](function(_0x5e53a0){if(_0x1f27fc){if(_0x5e53a0&&_0x5e53a0[_0x2d51('0x32')]){var _0x45b618=[];_0x5e53a0[_0x2d51('0x36')](function(_0x2ee29d){_0x45b618['push'](_0x2ee29d[_0x2d51('0x2f')]({'exitAt':moment()[_0x2d51('0x33')](_0x2d51('0x39'))}));});return BPromise['all'](_0x45b618);}}})['then'](function(){if(_0x1f27fc){return _0x1f27fc['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x2d51('0x23')](function(_0x507bba){_0x2d485f(_0x507bba);})[_0x2d51('0x26')](function(_0x201f80){_0x3a9ab8(_0xa17984['error'](0x1f4,_0x201f80[_0x2d51('0x16')]));});});};exports[_0x2d51('0x4c')]=function(_0x19dccb){var _0x719978=this;return new Promise(function(_0x2f20da,_0xa3130){var _0x356a51;var _0xe3974;var _0x3fdedc;var _0x4c2d31;return db['User'][_0x2d51('0x4b')]({'where':_0x19dccb[_0x2d51('0x1b')][_0x2d51('0x1d')]||{},'attributes':['id','name',_0x2d51('0x2b'),_0x2d51('0x4d'),_0x2d51('0x4e'),_0x2d51('0x2c'),_0x2d51('0x4f'),_0x2d51('0x2d')]})[_0x2d51('0x23')](function(_0x698fc1){if(_0x698fc1){_0x356a51=_0x698fc1;_0x4c2d31=_0x19dccb[_0x2d51('0x3c')][_0x2d51('0x2d')]?_0x19dccb[_0x2d51('0x3c')][_0x2d51('0x2d')]:util[_0x2d51('0x33')](_0x2d51('0x50'),_0x356a51[_0x2d51('0x2a')]);return db[_0x2d51('0x19')][_0x2d51('0x51')]({'where':{'role':_0x2d51('0x52'),'online':!![],'id':{'$ne':_0x356a51['id']}}});}})[_0x2d51('0x23')](function(_0x17d34c){if(_0x17d34c){_0x3fdedc=_0x17d34c;return require(_0x2d51('0x53'))[_0x2d51('0x54')]();}})[_0x2d51('0x23')](function(_0xf0585e){if(_0xf0585e&&_0xf0585e[_0x2d51('0x55')]&&_0x3fdedc>=_0xf0585e['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x356a51){return db[_0x2d51('0x2e')]['destroy']({'where':{'membername':_0x356a51[_0x2d51('0x2a')]},'individualHooks':!![]});}})[_0x2d51('0x23')](function(){if(_0x356a51){return _0x356a51[_0x2d51('0x56')]({'raw':!![]});}})[_0x2d51('0x23')](function(_0x25e6d9){if(_0x356a51){if(_0x25e6d9){var _0x2479de=[];_0xe3974=_0x25e6d9;if(_0xe3974[_0x2d51('0x32')]){for(var _0x510449=0x0;_0x510449<_0xe3974['length'];_0x510449++){_0x2479de[_0x2d51('0x37')](db['UserVoiceQueueRt'][_0x2d51('0x57')]({'membername':_0x356a51['name'],'UserId':_0x356a51['id'],'queue_name':_0xe3974[_0x510449][_0x2d51('0x2a')],'VoiceQueueId':_0xe3974[_0x510449]['id'],'interface':_0x4c2d31,'paused':_0x356a51[_0x2d51('0x4f')]||![],'penalty':_0xe3974[_0x510449][_0x2d51('0x58')]||0x0}));}return BPromise[_0x2d51('0x59')](_0x2479de);}}}})[_0x2d51('0x23')](function(){if(_0x356a51){return db[_0x2d51('0x30')][_0x2d51('0x1a')]({'where':{'membername':_0x356a51[_0x2d51('0x2a')],'exitAt':null}});}})[_0x2d51('0x23')](function(_0xfe6316){if(_0x356a51){if(_0xfe6316&&_0xfe6316[_0x2d51('0x32')]){var _0x495e90=[];_0xfe6316['forEach'](function(_0x299be1){_0x495e90[_0x2d51('0x37')](_0x299be1[_0x2d51('0x2f')]({'exitAt':moment()[_0x2d51('0x33')](_0x2d51('0x39'))}));});return BPromise[_0x2d51('0x59')](_0x495e90);}}})[_0x2d51('0x23')](function(_0x38a0eb){if(_0x356a51){var _0x39b46b=[];var _0x3b1572=[];var _0x501d34=utils[_0x2d51('0x35')]();var _0x1bf514={'membername':_0x356a51[_0x2d51('0x2a')],'interface':_0x4c2d31,'enterAt':moment()[_0x2d51('0x33')](_0x2d51('0x39')),'role':_0x356a51[_0x2d51('0x2b')],'internal':_0x356a51['internal']};_0x501d34[_0x2d51('0x36')](function(_0xcc3eac){_0x39b46b[_0x2d51('0x37')](_[_0x2d51('0x5a')]({'channel':_0xcc3eac,'type':'LOGIN','data1':'callysquare','data2':_0x4c2d31},_0x1bf514));if(_0x356a51[_0x2d51('0x4f')]){_0x3b1572['push'](_[_0x2d51('0x5a')]({'channel':_0xcc3eac,'type':_0x2d51('0x31'),'data1':'LOGININPAUSE'},_0x1bf514));}});return db[_0x2d51('0x30')][_0x2d51('0x3e')](_0x39b46b[_0x2d51('0x5b')](_0x3b1572),{'individualHooks':!![]});}})[_0x2d51('0x23')](function(){if(_0x356a51){return _0x356a51[_0x2d51('0x2f')]({'online':!![],'lastLoginAt':moment()[_0x2d51('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x356a51['loginInPause']||![],'mailPause':_0x356a51[_0x2d51('0x4f')]||![],'chatPause':_0x356a51[_0x2d51('0x4f')]||![],'faxPause':_0x356a51[_0x2d51('0x4f')]||![],'smsPause':_0x356a51[_0x2d51('0x4f')]||![],'openchannelPause':_0x356a51[_0x2d51('0x4f')]||![],'pauseType':_0x356a51[_0x2d51('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x2d51('0x33')](_0x2d51('0x39')),'interface':_0x4c2d31});}})[_0x2d51('0x23')](function(_0x586807){_0x2f20da(_0x586807);})[_0x2d51('0x26')](function(_0x3141b6){_0xa3130(_0x719978[_0x2d51('0x14')](0x1f4,_0x3141b6['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 185dc1f..d25926e 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 _0x7e19=['user:','./user.events','remove','update','emit','removeListener','length'];(function(_0x5c0ce8,_0x250f42){var _0x4c6573=function(_0x19f738){while(--_0x19f738){_0x5c0ce8['push'](_0x5c0ce8['shift']());}};_0x4c6573(++_0x250f42);}(_0x7e19,0x119));var _0x97e1=function(_0x41deb8,_0x458105){_0x41deb8=_0x41deb8-0x0;var _0x1e2084=_0x7e19[_0x41deb8];return _0x1e2084;};'use strict';var UserEvents=require(_0x97e1('0x0'));var events=['save',_0x97e1('0x1'),_0x97e1('0x2')];function createListener(_0x2553a3,_0x2f5f3b){return function(_0x3d3061){_0x2f5f3b[_0x97e1('0x3')](_0x2553a3,_0x3d3061);};}function removeListener(_0x1478a4,_0x224fb0){return function(){UserEvents[_0x97e1('0x4')](_0x1478a4,_0x224fb0);};}exports['register']=function(_0x5d420f){for(var _0x6c28b2=0x0,_0x384901=events[_0x97e1('0x5')];_0x6c28b2<_0x384901;_0x6c28b2++){var _0x49d543=events[_0x6c28b2];var _0x7d000f=createListener(_0x97e1('0x6')+_0x49d543,_0x5d420f);UserEvents['on'](_0x49d543,_0x7d000f);}}; \ No newline at end of file +var _0x5638=['save','remove','removeListener','register','length','user:','./user.events'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x5638,0xca));var _0x8563=function(_0x2df106,_0x5e43f8){_0x2df106=_0x2df106-0x0;var _0x20e1d1=_0x5638[_0x2df106];return _0x20e1d1;};'use strict';var UserEvents=require(_0x8563('0x0'));var events=[_0x8563('0x1'),_0x8563('0x2'),'update'];function createListener(_0xd13ca3,_0x9da2f6){return function(_0x4d342b){_0x9da2f6['emit'](_0xd13ca3,_0x4d342b);};}function removeListener(_0x5a9101,_0x1ecae4){return function(){UserEvents[_0x8563('0x3')](_0x5a9101,_0x1ecae4);};}exports[_0x8563('0x4')]=function(_0xd0a463){for(var _0x420a0a=0x0,_0x47db69=events[_0x8563('0x5')];_0x420a0a<_0x47db69;_0x420a0a++){var _0x28b0b3=events[_0x420a0a];var _0x166559=createListener(_0x8563('0x6')+_0x28b0b3,_0xd0a463);UserEvents['on'](_0x28b0b3,_0x166559);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d0ff70a..faa2be5 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2a85b4,_0x55f76c){var _0xa8b434=function(_0x107ebd){while(--_0x107ebd){_0x2a85b4['push'](_0x2a85b4['shift']());}};_0xa8b434(++_0x55f76c);}(_0xedd9,0xfc));var _0x9edd=function(_0x5426e0,_0x429fc5){_0x5426e0=_0x5426e0-0x0;var _0x4ac62b=_0xedd9[_0x5426e0];return _0x4ac62b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5c2f5c,_0x2632d7){var _0x230e26=function(_0x4d07af){while(--_0x4d07af){_0x5c2f5c['push'](_0x5c2f5c['shift']());}};_0x230e26(++_0x2632d7);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 6997454..6e24a20 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 _0xa1aa=['INTEGER'];(function(_0x25594a,_0x186137){var _0x185b3a=function(_0x45a9da){while(--_0x45a9da){_0x25594a['push'](_0x25594a['shift']());}};_0x185b3a(++_0x186137);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3d070c,_0x3d6517){_0x3d070c=_0x3d070c-0x0;var _0x309eff=_0xa1aa[_0x3d070c];return _0x309eff;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xaa1a('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7c55=['sequelize','exports','INTEGER'];(function(_0x6a0951,_0x1ce595){var _0x28c2ab=function(_0x599a28){while(--_0x599a28){_0x6a0951['push'](_0x6a0951['shift']());}};_0x28c2ab(++_0x1ce595);}(_0x7c55,0x180));var _0x57c5=function(_0x281ad7,_0x2adabc){_0x281ad7=_0x281ad7-0x0;var _0x4e7f82=_0x7c55[_0x281ad7];return _0x4e7f82;};'use strict';var Sequelize=require(_0x57c5('0x0'));module[_0x57c5('0x1')]={'penalty':{'type':Sequelize[_0x57c5('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 def4778..cf1b185 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 _0x92ad=['UserChatQueue','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./userChatQueue.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x92ad,0xe9));var _0xd92a=function(_0x12955f,_0x55e03c){_0x12955f=_0x12955f-0x0;var _0x363db6=_0x92ad[_0x12955f];return _0x363db6;};'use strict';var _=require(_0xd92a('0x0'));var util=require(_0xd92a('0x1'));var logger=require(_0xd92a('0x2'))('api');var moment=require(_0xd92a('0x3'));var BPromise=require(_0xd92a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd92a('0x5'));var attributes=require(_0xd92a('0x6'));module['exports']=function(_0x407966,_0x540d67){return _0x407966['define'](_0xd92a('0x7'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c58=['define','UserChatQueue','user_has_chat_queues','lodash','util','moment','request-promise','rimraf','./userChatQueue.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9c58,0xd5));var _0x89c5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9c58[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x89c5('0x0'));var util=require(_0x89c5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x89c5('0x2'));var BPromise=require('bluebird');var rp=require(_0x89c5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89c5('0x4'));var config=require('../../config/environment');var attributes=require(_0x89c5('0x5'));module[_0x89c5('0x6')]=function(_0x3a4eac,_0x24b937){return _0x3a4eac[_0x89c5('0x7')](_0x89c5('0x8'),attributes,{'tableName':_0x89c5('0x9'),'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 c5e843b..8ecc036 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 _0xda4f=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda4f,0xed));var _0xfda4=function(_0x557331,_0x2a317e){_0x557331=_0x557331-0x0;var _0x1911b8=_0xda4f[_0x557331];return _0x1911b8;};'use strict';var _=require(_0xfda4('0x0'));var util=require(_0xfda4('0x1'));var moment=require('moment');var BPromise=require(_0xfda4('0x2'));var rs=require(_0xfda4('0x3'));var fs=require('fs');var Redis=require(_0xfda4('0x4'));var db=require(_0xfda4('0x5'))['db'];var utils=require(_0xfda4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfda4('0x7'));var jayson=require(_0xfda4('0x8'));var client=jayson[_0xfda4('0x9')][_0xfda4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50d6da,_0x1f548b,_0x171482){return new BPromise(function(_0x3bd4fb,_0x54a42e){return client['request'](_0x50d6da,_0x171482)[_0xfda4('0xb')](function(_0x56a278){logger[_0xfda4('0xc')](_0xfda4('0xd'),_0x1f548b,_0xfda4('0xe'));logger[_0xfda4('0xf')](_0xfda4('0x10'),_0x1f548b,_0xfda4('0xe'),JSON['stringify'](_0x56a278));if(_0x56a278[_0xfda4('0x11')]){if(_0x56a278['error'][_0xfda4('0x12')]===0x1f4){logger['error'](_0xfda4('0xd'),_0x1f548b,_0x56a278[_0xfda4('0x11')]['message']);return _0x54a42e(_0x56a278[_0xfda4('0x11')][_0xfda4('0x13')]);}logger[_0xfda4('0x11')](_0xfda4('0xd'),_0x1f548b,_0x56a278[_0xfda4('0x11')][_0xfda4('0x13')]);return _0x3bd4fb(_0x56a278[_0xfda4('0x11')][_0xfda4('0x13')]);}else{logger[_0xfda4('0xc')](_0xfda4('0xd'),_0x1f548b,_0xfda4('0xe'));_0x3bd4fb(_0x56a278[_0xfda4('0x14')][_0xfda4('0x13')]);}})[_0xfda4('0x15')](function(_0x163715){logger[_0xfda4('0x11')](_0xfda4('0xd'),_0x1f548b,_0x163715);_0x54a42e(_0x163715);});});} \ No newline at end of file +var _0x6804=['../../config/logger','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x7c8431,_0x3837d3){var _0x2e27eb=function(_0x58d616){while(--_0x58d616){_0x7c8431['push'](_0x7c8431['shift']());}};_0x2e27eb(++_0x3837d3);}(_0x6804,0x176));var _0x4680=function(_0x107ebc,_0x271dd3){_0x107ebc=_0x107ebc-0x0;var _0x21c846=_0x6804[_0x107ebc];return _0x21c846;};'use strict';var _=require(_0x4680('0x0'));var util=require(_0x4680('0x1'));var moment=require(_0x4680('0x2'));var BPromise=require('bluebird');var rs=require(_0x4680('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4680('0x4'))['db'];var utils=require(_0x4680('0x5'));var logger=require(_0x4680('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4680('0x7'));var client=jayson[_0x4680('0x8')][_0x4680('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a901,_0x401b70,_0x651259){return new BPromise(function(_0x37186d,_0xc9b611){return client['request'](_0x35a901,_0x651259)[_0x4680('0xa')](function(_0xcddace){logger[_0x4680('0xb')](_0x4680('0xc'),_0x401b70,'request\x20sent');logger[_0x4680('0xd')](_0x4680('0xe'),_0x401b70,'request\x20sent',JSON[_0x4680('0xf')](_0xcddace));if(_0xcddace[_0x4680('0x10')]){if(_0xcddace[_0x4680('0x10')][_0x4680('0x11')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x401b70,_0xcddace[_0x4680('0x10')]['message']);return _0xc9b611(_0xcddace[_0x4680('0x10')][_0x4680('0x12')]);}logger[_0x4680('0x10')](_0x4680('0xc'),_0x401b70,_0xcddace['error'][_0x4680('0x12')]);return _0x37186d(_0xcddace[_0x4680('0x10')][_0x4680('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x401b70,'request\x20sent');_0x37186d(_0xcddace[_0x4680('0x13')][_0x4680('0x12')]);}})['catch'](function(_0x276ed7){logger['error'](_0x4680('0xc'),_0x401b70,_0x276ed7);_0xc9b611(_0x276ed7);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f17308b..6a57440 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x42e8f1,_0x2206e0){var _0x87ff38=function(_0x51a319){while(--_0x51a319){_0x42e8f1['push'](_0x42e8f1['shift']());}};_0x87ff38(++_0x2206e0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xcb91[_0x3861f7];return _0x50879f;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x29e3f6,_0x3d9c38){var _0x42d404=function(_0x4571dd){while(--_0x4571dd){_0x29e3f6['push'](_0x29e3f6['shift']());}};_0x42d404(++_0x3d9c38);}(_0xe706,0xa3));var _0x6e70=function(_0x437808,_0x5d54e4){_0x437808=_0x437808-0x0;var _0x3752ac=_0xe706[_0x437808];return _0x3752ac;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 971615d..d3d316d 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 _0x2371=['INTEGER','sequelize','exports'];(function(_0x4bb94b,_0x50628a){var _0x36dcc6=function(_0x3ea436){while(--_0x3ea436){_0x4bb94b['push'](_0x4bb94b['shift']());}};_0x36dcc6(++_0x50628a);}(_0x2371,0xfd));var _0x1237=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x2371[_0x523adf];return _0x283870;};'use strict';var Sequelize=require(_0x1237('0x0'));module[_0x1237('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1237('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc00d=['sequelize','exports','INTEGER','STRING'];(function(_0x34effa,_0x27e3fc){var _0x2a9af1=function(_0x1253c6){while(--_0x1253c6){_0x34effa['push'](_0x34effa['shift']());}};_0x2a9af1(++_0x27e3fc);}(_0xc00d,0x10c));var _0xdc00=function(_0x54c7d2,_0xad88a){_0x54c7d2=_0x54c7d2-0x0;var _0x5af671=_0xc00d[_0x54c7d2];return _0x5af671;};'use strict';var Sequelize=require(_0xdc00('0x0'));module[_0xdc00('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdc00('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdc00('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 153ef02..0464400 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 _0x68f2=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1194ad,_0x435140){var _0x5f374d=function(_0x522ce7){while(--_0x522ce7){_0x1194ad['push'](_0x1194ad['shift']());}};_0x5f374d(++_0x435140);}(_0x68f2,0x198));var _0x268f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x68f2[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x268f('0x0'));var util=require('util');var logger=require(_0x268f('0x1'))(_0x268f('0x2'));var moment=require(_0x268f('0x3'));var BPromise=require(_0x268f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x268f('0x5'));var rimraf=require(_0x268f('0x6'));var config=require(_0x268f('0x7'));var attributes=require(_0x268f('0x8'));module[_0x268f('0x9')]=function(_0x4b1fd1,_0x30e197){return _0x4b1fd1[_0x268f('0xa')](_0x268f('0xb'),attributes,{'tableName':_0x268f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd50=['util','bluebird','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash'];(function(_0x1c5eee,_0x4de08c){var _0x26c869=function(_0xc52abc){while(--_0xc52abc){_0x1c5eee['push'](_0x1c5eee['shift']());}};_0x26c869(++_0x4de08c);}(_0xfd50,0x182));var _0x0fd5=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfd50[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x0fd5('0x0'));var util=require(_0x0fd5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0fd5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fd5('0x3'));var rimraf=require('rimraf');var config=require(_0x0fd5('0x4'));var attributes=require(_0x0fd5('0x5'));module[_0x0fd5('0x6')]=function(_0x4d2b12,_0x2f55c3){return _0x4d2b12[_0x0fd5('0x7')](_0x0fd5('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 9530439..ebd8654 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 _0xd6aa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1b0893,_0x12827a){var _0x2042cc=function(_0x52719f){while(--_0x52719f){_0x1b0893['push'](_0x1b0893['shift']());}};_0x2042cc(++_0x12827a);}(_0xd6aa,0x1b1));var _0xad6a=function(_0x454bbb,_0x45aead){_0x454bbb=_0x454bbb-0x0;var _0x545e77=_0xd6aa[_0x454bbb];return _0x545e77;};'use strict';var _=require(_0xad6a('0x0'));var util=require(_0xad6a('0x1'));var moment=require(_0xad6a('0x2'));var BPromise=require(_0xad6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad6a('0x4'))['db'];var utils=require(_0xad6a('0x5'));var logger=require(_0xad6a('0x6'))(_0xad6a('0x7'));var config=require(_0xad6a('0x8'));var jayson=require(_0xad6a('0x9'));var client=jayson[_0xad6a('0xa')][_0xad6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b5945,_0x991f10,_0x5497b6){return new BPromise(function(_0x1f4a2e,_0xfd35b7){return client[_0xad6a('0xc')](_0x3b5945,_0x5497b6)[_0xad6a('0xd')](function(_0x55ad81){logger[_0xad6a('0xe')](_0xad6a('0xf'),_0x991f10,'request\x20sent');logger[_0xad6a('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x991f10,_0xad6a('0x11'),JSON[_0xad6a('0x12')](_0x55ad81));if(_0x55ad81['error']){if(_0x55ad81[_0xad6a('0x13')]['code']===0x1f4){logger[_0xad6a('0x13')](_0xad6a('0xf'),_0x991f10,_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);return _0xfd35b7(_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);}logger[_0xad6a('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x991f10,_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);return _0x1f4a2e(_0x55ad81[_0xad6a('0x13')][_0xad6a('0x14')]);}else{logger[_0xad6a('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x991f10,_0xad6a('0x11'));_0x1f4a2e(_0x55ad81[_0xad6a('0x15')][_0xad6a('0x14')]);}})[_0xad6a('0x16')](function(_0x3a612f){logger[_0xad6a('0x13')](_0xad6a('0xf'),_0x991f10,_0x3a612f);_0xfd35b7(_0x3a612f);});});} \ No newline at end of file +var _0xe01a=['jayson/promise','http','request','then','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xff823c,_0x146864){var _0x1f662a=function(_0x2c4cc0){while(--_0x2c4cc0){_0xff823c['push'](_0xff823c['shift']());}};_0x1f662a(++_0x146864);}(_0xe01a,0xc8));var _0xae01=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe01a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae01('0x0'));var util=require(_0xae01('0x1'));var moment=require('moment');var BPromise=require(_0xae01('0x2'));var rs=require(_0xae01('0x3'));var fs=require('fs');var Redis=require(_0xae01('0x4'));var db=require(_0xae01('0x5'))['db'];var utils=require(_0xae01('0x6'));var logger=require(_0xae01('0x7'))(_0xae01('0x8'));var config=require(_0xae01('0x9'));var jayson=require(_0xae01('0xa'));var client=jayson['client'][_0xae01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x98cd2c,_0x2bede0,_0x51fd16){return new BPromise(function(_0x278841,_0x9e660e){return client[_0xae01('0xc')](_0x98cd2c,_0x51fd16)[_0xae01('0xd')](function(_0x545794){logger[_0xae01('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x2bede0,_0xae01('0xf'));logger['debug'](_0xae01('0x10'),_0x2bede0,'request\x20sent',JSON['stringify'](_0x545794));if(_0x545794[_0xae01('0x11')]){if(_0x545794[_0xae01('0x11')]['code']===0x1f4){logger[_0xae01('0x11')](_0xae01('0x12'),_0x2bede0,_0x545794[_0xae01('0x11')][_0xae01('0x13')]);return _0x9e660e(_0x545794[_0xae01('0x11')][_0xae01('0x13')]);}logger['error'](_0xae01('0x12'),_0x2bede0,_0x545794['error'][_0xae01('0x13')]);return _0x278841(_0x545794['error'][_0xae01('0x13')]);}else{logger[_0xae01('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x2bede0,_0xae01('0xf'));_0x278841(_0x545794['result']['message']);}})[_0xae01('0x14')](function(_0x1cbe63){logger[_0xae01('0x11')](_0xae01('0x12'),_0x2bede0,_0x1cbe63);_0x9e660e(_0x1cbe63);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 167e868..4652f2f 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(_0x5e122b,_0x266363){var _0x359e9e=function(_0x2653e5){while(--_0x2653e5){_0x5e122b['push'](_0x5e122b['shift']());}};_0x359e9e(++_0x266363);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x47d060,_0x4a2b1d){var _0xb2d051=function(_0x3434e7){while(--_0x3434e7){_0x47d060['push'](_0x47d060['shift']());}};_0xb2d051(++_0x4a2b1d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8f4587d..edc0122 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 _0x16ab=['INTEGER','exports'];(function(_0x1b87a5,_0x5875ef){var _0x212666=function(_0x49f640){while(--_0x49f640){_0x1b87a5['push'](_0x1b87a5['shift']());}};_0x212666(++_0x5875ef);}(_0x16ab,0xed));var _0xb16a=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x16ab[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require('sequelize');module[_0xb16a('0x0')]={'penalty':{'type':Sequelize[_0xb16a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa6f6=['exports','sequelize'];(function(_0x218e76,_0x5f0903){var _0x4269bb=function(_0x3881db){while(--_0x3881db){_0x218e76['push'](_0x218e76['shift']());}};_0x4269bb(++_0x5f0903);}(_0xa6f6,0x16b));var _0x6a6f=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xa6f6[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require(_0x6a6f('0x0'));module[_0x6a6f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f284f15..0d31941 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 _0x5bce=['rimraf','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x194b25,_0x4bedc4){var _0x107ac5=function(_0x13bcce){while(--_0x13bcce){_0x194b25['push'](_0x194b25['shift']());}};_0x107ac5(++_0x4bedc4);}(_0x5bce,0x1db));var _0xe5bc=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x5bce[_0x427d3a];return _0xe5c521;};'use strict';var _=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe5bc('0x2'));var BPromise=require(_0xe5bc('0x3'));var rp=require(_0xe5bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5bc('0x5'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xe5bc('0x6')]=function(_0x1aaa29,_0xfd392f){return _0x1aaa29[_0xe5bc('0x7')](_0xe5bc('0x8'),attributes,{'tableName':_0xe5bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e91=['path','../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4efcad,_0x4ed9a7){var _0x5a6d2a=function(_0x908dca){while(--_0x908dca){_0x4efcad['push'](_0x4efcad['shift']());}};_0x5a6d2a(++_0x4ed9a7);}(_0x1e91,0x145));var _0x11e9=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0x1e91[_0xea1570];return _0x579e74;};'use strict';var _=require(_0x11e9('0x0'));var util=require('util');var logger=require(_0x11e9('0x1'))(_0x11e9('0x2'));var moment=require(_0x11e9('0x3'));var BPromise=require('bluebird');var rp=require(_0x11e9('0x4'));var fs=require('fs');var path=require(_0x11e9('0x5'));var rimraf=require('rimraf');var config=require(_0x11e9('0x6'));var attributes=require(_0x11e9('0x7'));module['exports']=function(_0x590d92,_0x25f4e1){return _0x590d92['define'](_0x11e9('0x8'),attributes,{'tableName':_0x11e9('0x9'),'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 0079a1e..7a1fea2 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x47497c,_0x4c3c4c){var _0x59ab04=function(_0x58bf80){while(--_0x58bf80){_0x47497c['push'](_0x47497c['shift']());}};_0x59ab04(++_0x4c3c4c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x4b84[_0x2a453b];return _0x132f79;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 1b173a5..78258af 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 _0x3eac=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout'];(function(_0x3c3ae5,_0x111cfe){var _0x3734be=function(_0x5200cc){while(--_0x5200cc){_0x3c3ae5['push'](_0x3c3ae5['shift']());}};_0x3734be(++_0x111cfe);}(_0x3eac,0x98));var _0xc3ea=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x3eac[_0x22ffbf];return _0x360c17;};'use strict';var multer=require(_0xc3ea('0x0'));var util=require(_0xc3ea('0x1'));var path=require(_0xc3ea('0x2'));var timeout=require(_0xc3ea('0x3'));var express=require(_0xc3ea('0x4'));var router=express['Router']();var fs_extra=require(_0xc3ea('0x5'));var auth=require(_0xc3ea('0x6'));var interaction=require(_0xc3ea('0x7'));var config=require('../../config/environment');var controller=require(_0xc3ea('0x8'));router[_0xc3ea('0x9')]('/',auth[_0xc3ea('0xa')](),controller[_0xc3ea('0xb')]);module['exports']=router; \ No newline at end of file +var _0xa974=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa974,0x192));var _0x4a97=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa974[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x4a97('0x0'));var util=require(_0x4a97('0x1'));var path=require(_0x4a97('0x2'));var timeout=require(_0x4a97('0x3'));var express=require('express');var router=express[_0x4a97('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a97('0x5'));var interaction=require(_0x4a97('0x6'));var config=require(_0x4a97('0x7'));var controller=require(_0x4a97('0x8'));router[_0x4a97('0x9')]('/',auth[_0x4a97('0xa')](),controller[_0x4a97('0xb')]);module[_0x4a97('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 95009a7..9c98051 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 _0xe95b=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x293e39,_0x34315f){var _0x118450=function(_0x1efd24){while(--_0x1efd24){_0x293e39['push'](_0x293e39['shift']());}};_0x118450(++_0x34315f);}(_0xe95b,0x17c));var _0xbe95=function(_0x101be1,_0x3aff82){_0x101be1=_0x101be1-0x0;var _0x10b96c=_0xe95b[_0x101be1];return _0x10b96c;};'use strict';var Sequelize=require(_0xbe95('0x0'));module['exports']={'body':{'type':Sequelize[_0xbe95('0x1')]},'senderName':{'type':Sequelize[_0xbe95('0x2')]},'recipientsId':{'type':Sequelize[_0xbe95('0x1')]},'recipientsDescription':{'type':Sequelize[_0xbe95('0x2')]},'beep':{'type':Sequelize[_0xbe95('0x3')]}}; \ No newline at end of file +var _0xd67d=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x14233e,_0x2b9563){var _0x397b92=function(_0x2698aa){while(--_0x2698aa){_0x14233e['push'](_0x14233e['shift']());}};_0x397b92(++_0x2b9563);}(_0xd67d,0xe2));var _0xdd67=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0xd67d[_0x47c5bf];return _0x11b779;};'use strict';var Sequelize=require(_0xdd67('0x0'));module['exports']={'body':{'type':Sequelize[_0xdd67('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xdd67('0x1')]},'recipientsDescription':{'type':Sequelize[_0xdd67('0x2')]},'beep':{'type':Sequelize[_0xdd67('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e9841b0..ff594d8 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 _0x1509=['../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','render','html','startCase','User','union','queue','replace','push','all','flatten','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs'];(function(_0x360581,_0x208bdc){var _0x3c0f5c=function(_0x5007d5){while(--_0x5007d5){_0x360581['push'](_0x360581['shift']());}};_0x3c0f5c(++_0x208bdc);}(_0x1509,0x167));var _0x9150=function(_0x2f896f,_0x41f4e9){_0x2f896f=_0x2f896f-0x0;var _0x3b344a=_0x1509[_0x2f896f];return _0x3b344a;};'use strict';var emlformat=require(_0x9150('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9150('0x1'));var rp=require(_0x9150('0x2'));var moment=require(_0x9150('0x3'));var BPromise=require(_0x9150('0x4'));var Mustache=require(_0x9150('0x5'));var util=require(_0x9150('0x6'));var path=require(_0x9150('0x7'));var sox=require(_0x9150('0x8'));var csv=require(_0x9150('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9150('0xa'));var _=require(_0x9150('0xb'));var squel=require(_0x9150('0xc'));var crypto=require(_0x9150('0xd'));var jsforce=require(_0x9150('0xe'));var deskjs=require(_0x9150('0xf'));var toCsv=require(_0x9150('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9150('0x10'));var as=require(_0x9150('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9150('0x12'));var licenseUtil=require(_0x9150('0x13'));var db=require('../../mysqldb')['db'];config[_0x9150('0x14')]=_[_0x9150('0x15')](config[_0x9150('0x14')],{'host':_0x9150('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9150('0x17'))[_0x9150('0x18')](socket);function respondWithStatusCode(_0x440475,_0x32d3d9){_0x32d3d9=_0x32d3d9||0xcc;return function(_0x24e0b8){if(_0x24e0b8){return _0x440475[_0x9150('0x19')](_0x32d3d9);}return _0x440475['status'](_0x32d3d9)[_0x9150('0x1a')]();};}function respondWithResult(_0x55a93b,_0x25c9ae){_0x25c9ae=_0x25c9ae||0xc8;return function(_0x360e84){if(_0x360e84){return _0x55a93b[_0x9150('0x1b')](_0x25c9ae)[_0x9150('0x1c')](_0x360e84);}};}function respondWithFilteredResult(_0x46146f,_0x1856f3){return function(_0x521fc3){if(_0x521fc3){var _0x33cb11=typeof _0x1856f3[_0x9150('0x1d')]===_0x9150('0x1e')&&typeof _0x1856f3['limit']===_0x9150('0x1e');var _0x44740f=_0x521fc3[_0x9150('0x1f')];var _0x219010=_0x33cb11?0x0:_0x1856f3[_0x9150('0x1d')];var _0x17e6c5=_0x33cb11?_0x521fc3['count']:_0x1856f3[_0x9150('0x1d')]+_0x1856f3[_0x9150('0x20')];var _0x43f603;if(_0x17e6c5>=_0x44740f){_0x17e6c5=_0x44740f;_0x43f603=0xc8;}else{_0x43f603=0xce;}_0x46146f[_0x9150('0x1b')](_0x43f603);return _0x46146f[_0x9150('0x21')]('Content-Range',_0x219010+'-'+_0x17e6c5+'/'+_0x44740f)[_0x9150('0x1c')](_0x521fc3);}return null;};}function patchUpdates(_0x5cf1b3){return function(_0x2bdf42){try{jsonpatch['apply'](_0x2bdf42,_0x5cf1b3,!![]);}catch(_0x14011e){return BPromise[_0x9150('0x22')](_0x14011e);}return _0x2bdf42[_0x9150('0x23')]();};}function saveUpdates(_0x317b69,_0x570ced){return function(_0x4f741e){if(_0x4f741e){return _0x4f741e[_0x9150('0x24')](_0x317b69)[_0x9150('0x25')](function(_0x3937b9){return _0x3937b9;});}return null;};}function removeEntity(_0x1cd651,_0x3532e0){return function(_0x26d075){if(_0x26d075){return _0x26d075['destroy']()['then'](function(){_0x1cd651[_0x9150('0x1b')](0xcc)[_0x9150('0x1a')]();});}};}function handleEntityNotFound(_0x5b9995,_0x29505d){return function(_0x46f588){if(!_0x46f588){_0x5b9995['sendStatus'](0x194);}return _0x46f588;};}function handleError(_0x56c378,_0x3e91d8){_0x3e91d8=_0x3e91d8||0x1f4;return function(_0x55f6b1){logger['error'](_0x55f6b1[_0x9150('0x26')]);if(_0x55f6b1[_0x9150('0x27')]){delete _0x55f6b1[_0x9150('0x27')];}_0x56c378['status'](_0x3e91d8)[_0x9150('0x28')](_0x55f6b1);};}exports['sendUserNotification']=function(_0x145878,_0x4df466,_0x50a654){if(!_0x145878[_0x9150('0x29')][_0x9150('0x2a')](_0x9150('0x2b'))&&!_0x145878['body']['hasOwnProperty'](_0x9150('0x2c'))){throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))](_0x9150('0x2f'));}else{if(_0x145878['body'][_0x9150('0x2a')](_0x9150('0x2c'))&&!_0x145878[_0x9150('0x29')][_0x9150('0x2a')](_0x9150('0x30'))){throw new db['Sequelize'][(_0x9150('0x2e'))](_0x9150('0x31'));}if(!_0x145878[_0x9150('0x29')]['hasOwnProperty'](_0x9150('0x32'))){throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))](_0x9150('0x33'));}else{try{var _0x194b52=JSON['parse'](_0x145878['body'][_0x9150('0x32')]);}catch(_0xe5c2c){logger[_0x9150('0x34')](_0xe5c2c);throw new db[(_0x9150('0x2d'))]['ValidationError'](_0x9150('0x35'));}var _0x3c347b=[_0x9150('0x36'),_0x9150('0x37'),_0x9150('0x38'),'openchannelqueue',_0x9150('0x39'),_0x9150('0x3a'),_0x9150('0x3b'),_0x9150('0x3c'),_0x9150('0x3d')];if(_[_0x9150('0x3e')](_0x194b52,function(_0x4e3c5e){return!_[_0x9150('0x3f')](_0x3c347b,_0x4e3c5e[_0x9150('0x40')][_0x9150('0x41')]());})){throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x15748a={};_0x15748a[_0x9150('0x42')]=_0x145878[_0x9150('0x29')][_0x9150('0x2a')](_0x9150('0x42'))?_0x145878[_0x9150('0x29')]['senderName']:_0x145878[_0x9150('0x3d')][_0x9150('0x43')];_0x15748a['recipientsDescription']=_[_0x9150('0x44')](_0x145878[_0x9150('0x29')][_0x9150('0x45')])?null:_0x145878[_0x9150('0x29')][_0x9150('0x45')];_0x15748a[_0x9150('0x46')]=_0x145878[_0x9150('0x29')][_0x9150('0x46')]||![];_0x15748a[_0x9150('0x47')]=_0x145878['user']['id'];return getContent(_0x145878[_0x9150('0x29')])[_0x9150('0x25')](function(_0x4baa7e){_0x15748a[_0x9150('0x29')]=_0x4baa7e;return getRecipients(_0x194b52);})['then'](function(_0xce1dcc){_0x15748a['recipientsId']=_[_0x9150('0x48')](_0xce1dcc)[_0x9150('0x49')](',');return db[_0x9150('0x4a')][_0x9150('0x4b')](function(_0x2040e2){return db[_0x9150('0x4c')]['create'](_0x15748a,{'raw':!![],'transaction':_0x2040e2})[_0x9150('0x25')](function(_0x441135){var _0x220ff1={'sender':_0x15748a[_0x9150('0x42')],'description':_0x15748a[_0x9150('0x45')],'content':_0x15748a[_0x9150('0x29')],'beep':_0x15748a[_0x9150('0x46')]};_0xce1dcc[_0x9150('0x4d')](function(_0x3a8821){_0x220ff1[_0x9150('0x4e')]=_0x3a8821;socket[_0x9150('0x4f')](_0x9150('0x50'),_0x220ff1);});return _0x441135;});});})[_0x9150('0x25')](respondWithResult(_0x4df466,0xc9))[_0x9150('0x51')](handleError(_0x4df466,null));};function getContent(_0x4f5adf){return new BPromise(function(_0x3f4c23,_0x398069){if(_0x4f5adf['text']){_0x3f4c23(_0x4f5adf['text']);return;}return db[_0x9150('0x52')]['findOne']({'attributes':['html'],'where':{'id':_0x4f5adf['TemplateId']},'raw':!![]})[_0x9150('0x25')](function(_0x4d27d7){if(!_0x4d27d7)throw new db[(_0x9150('0x2d'))][(_0x9150('0x2e'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2468b1=Mustache[_0x9150('0x53')](_0x4d27d7[_0x9150('0x54')],_0x4f5adf[_0x9150('0x30')]);_0x3f4c23(_0x2468b1);})[_0x9150('0x51')](function(_0x1a1beb){_0x398069(_0x1a1beb);});});}function getRecipients(_0x26b195){return new BPromise(function(_0x17864a,_0x1dd439){var _0x2bf67e=[];var _0x55800c=[];_0x26b195['forEach'](function(_0x2843d7){var _0x3f2699=_[_0x9150('0x55')](_0x2843d7[_0x9150('0x40')][_0x9150('0x41')]());if(_0x3f2699===_0x9150('0x56')){_0x2bf67e=_[_0x9150('0x57')](_0x2bf67e,_0x2843d7['ids']);}else{if(_[_0x9150('0x3f')](_0x3f2699,_0x9150('0x58')))_0x3f2699=_0x3f2699[_0x9150('0x59')](_0x9150('0x58'),'Queue');_0x2843d7['ids'][_0x9150('0x4d')](function(_0x19c49c){_0x55800c[_0x9150('0x5a')](getAgents(_0x3f2699,_0x19c49c));});}});return BPromise[_0x9150('0x5b')](_0x55800c)[_0x9150('0x25')](function(_0x6db169){_0x2bf67e=_[_0x9150('0x57')](_0x2bf67e,_[_0x9150('0x5c')](_0x6db169));_0x17864a(_0x2bf67e);})[_0x9150('0x51')](function(_0x308200){_0x1dd439(_0x308200);});});}function getAgents(_0x38ec0e,_0xc7a69f){return new BPromise(function(_0x358b97,_0x323150){return db[_0x38ec0e][_0x9150('0x5d')]({'where':{'id':_0xc7a69f}})['then'](function(_0x367cb8){return _0x367cb8['getAgents']({'attributes':['id'],'raw':!![]})[_0x9150('0x25')](function(_0x5cd306){var _0x222547=_['map'](_0x5cd306,'id');_0x358b97(_0x222547);});})[_0x9150('0x51')](function(_0x4dd1c0){_0x323150(_0x4dd1c0);});});} \ No newline at end of file +var _0xc89e=['catch','text','findOne','html','render','toLowerCase','User','union','ids','includes','replace','queue','Queue','push','all','flatten','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','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','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','recipients','parse','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','some','model','senderName','fullname','recipientsDescription','isEmpty','beep','user','recipientsId','join','UserNotification','create','forEach','recipient','userNotification:send'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc89e,0x191));var _0xec89=function(_0x1f8fcd,_0x3b22c5){_0x1f8fcd=_0x1f8fcd-0x0;var _0x433fb1=_0xc89e[_0x1f8fcd];return _0x433fb1;};'use strict';var emlformat=require(_0xec89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec89('0x1'));var jsonpatch=require(_0xec89('0x2'));var rp=require(_0xec89('0x3'));var moment=require(_0xec89('0x4'));var BPromise=require(_0xec89('0x5'));var Mustache=require(_0xec89('0x6'));var util=require('util');var path=require(_0xec89('0x7'));var sox=require(_0xec89('0x8'));var csv=require('to-csv');var ejs=require(_0xec89('0x9'));var fs=require('fs');var fs_extra=require(_0xec89('0xa'));var _=require('lodash');var squel=require(_0xec89('0xb'));var crypto=require('crypto');var jsforce=require(_0xec89('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xec89('0xd'));var querystring=require(_0xec89('0xe'));var Papa=require(_0xec89('0xf'));var Redis=require(_0xec89('0x10'));var authService=require(_0xec89('0x11'));var qs=require(_0xec89('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec89('0x13'));var logger=require(_0xec89('0x14'))(_0xec89('0x15'));var utils=require(_0xec89('0x16'));var config=require(_0xec89('0x17'));var licenseUtil=require(_0xec89('0x18'));var db=require(_0xec89('0x19'))['db'];config[_0xec89('0x1a')]=_[_0xec89('0x1b')](config[_0xec89('0x1a')],{'host':_0xec89('0x1c'),'port':0x18eb});var socket=require(_0xec89('0x1d'))(new Redis(config[_0xec89('0x1a')]));require(_0xec89('0x1e'))[_0xec89('0x1f')](socket);function respondWithStatusCode(_0x1d6217,_0x34e2cf){_0x34e2cf=_0x34e2cf||0xcc;return function(_0x5c6f38){if(_0x5c6f38){return _0x1d6217[_0xec89('0x20')](_0x34e2cf);}return _0x1d6217[_0xec89('0x21')](_0x34e2cf)[_0xec89('0x22')]();};}function respondWithResult(_0x3dc639,_0x24facc){_0x24facc=_0x24facc||0xc8;return function(_0x5020a8){if(_0x5020a8){return _0x3dc639[_0xec89('0x21')](_0x24facc)[_0xec89('0x23')](_0x5020a8);}};}function respondWithFilteredResult(_0x321752,_0x5bff31){return function(_0x1f4982){if(_0x1f4982){var _0x1b1190=typeof _0x5bff31[_0xec89('0x24')]==='undefined'&&typeof _0x5bff31['limit']===_0xec89('0x25');var _0x1f14a9=_0x1f4982[_0xec89('0x26')];var _0x4637ce=_0x1b1190?0x0:_0x5bff31['offset'];var _0x47e2b5=_0x1b1190?_0x1f4982[_0xec89('0x26')]:_0x5bff31[_0xec89('0x24')]+_0x5bff31[_0xec89('0x27')];var _0x40fde7;if(_0x47e2b5>=_0x1f14a9){_0x47e2b5=_0x1f14a9;_0x40fde7=0xc8;}else{_0x40fde7=0xce;}_0x321752[_0xec89('0x21')](_0x40fde7);return _0x321752['set']('Content-Range',_0x4637ce+'-'+_0x47e2b5+'/'+_0x1f14a9)[_0xec89('0x23')](_0x1f4982);}return null;};}function patchUpdates(_0x17e08f){return function(_0x53ef50){try{jsonpatch[_0xec89('0x28')](_0x53ef50,_0x17e08f,!![]);}catch(_0x2850b4){return BPromise[_0xec89('0x29')](_0x2850b4);}return _0x53ef50[_0xec89('0x2a')]();};}function saveUpdates(_0x376bd0,_0x559b2a){return function(_0x117537){if(_0x117537){return _0x117537['update'](_0x376bd0)[_0xec89('0x2b')](function(_0x23fa4b){return _0x23fa4b;});}return null;};}function removeEntity(_0x504f6b,_0x47266c){return function(_0x5dd1d3){if(_0x5dd1d3){return _0x5dd1d3[_0xec89('0x2c')]()[_0xec89('0x2b')](function(){_0x504f6b[_0xec89('0x21')](0xcc)[_0xec89('0x22')]();});}};}function handleEntityNotFound(_0x3e486a,_0x371bf6){return function(_0x5ac28e){if(!_0x5ac28e){_0x3e486a[_0xec89('0x20')](0x194);}return _0x5ac28e;};}function handleError(_0xa5218,_0x10e3df){_0x10e3df=_0x10e3df||0x1f4;return function(_0x1e394a){logger[_0xec89('0x2d')](_0x1e394a['stack']);if(_0x1e394a[_0xec89('0x2e')]){delete _0x1e394a[_0xec89('0x2e')];}_0xa5218[_0xec89('0x21')](_0x10e3df)[_0xec89('0x2f')](_0x1e394a);};}exports[_0xec89('0x30')]=function(_0x421756,_0xd7eb1b,_0x4103da){if(!_0x421756[_0xec89('0x31')][_0xec89('0x32')]('text')&&!_0x421756[_0xec89('0x31')][_0xec89('0x32')](_0xec89('0x33'))){throw new db[(_0xec89('0x34'))][(_0xec89('0x35'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x421756[_0xec89('0x31')][_0xec89('0x32')]('TemplateId')&&!_0x421756[_0xec89('0x31')][_0xec89('0x32')](_0xec89('0x36'))){throw new db[(_0xec89('0x34'))][(_0xec89('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x421756[_0xec89('0x31')][_0xec89('0x32')](_0xec89('0x37'))){throw new db[(_0xec89('0x34'))][(_0xec89('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x459166=JSON[_0xec89('0x38')](_0x421756[_0xec89('0x31')][_0xec89('0x37')]);}catch(_0x309070){logger[_0xec89('0x2d')](_0x309070);throw new db[(_0xec89('0x34'))][(_0xec89('0x35'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x51e37d=[_0xec89('0x39'),_0xec89('0x3a'),_0xec89('0x3b'),'openchannelqueue',_0xec89('0x3c'),_0xec89('0x3d'),_0xec89('0x3e'),_0xec89('0x3f'),'user'];if(_[_0xec89('0x40')](_0x459166,function(_0x465c08){return!_['includes'](_0x51e37d,_0x465c08[_0xec89('0x41')]['toLowerCase']());})){throw new db[(_0xec89('0x34'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4955b2={};_0x4955b2[_0xec89('0x42')]=_0x421756['body'][_0xec89('0x32')](_0xec89('0x42'))?_0x421756[_0xec89('0x31')][_0xec89('0x42')]:_0x421756['user'][_0xec89('0x43')];_0x4955b2[_0xec89('0x44')]=_[_0xec89('0x45')](_0x421756[_0xec89('0x31')]['recipientsDescription'])?null:_0x421756[_0xec89('0x31')]['recipientsDescription'];_0x4955b2[_0xec89('0x46')]=_0x421756[_0xec89('0x31')][_0xec89('0x46')]||![];_0x4955b2['SenderId']=_0x421756[_0xec89('0x47')]['id'];return getContent(_0x421756[_0xec89('0x31')])[_0xec89('0x2b')](function(_0x2b2206){_0x4955b2[_0xec89('0x31')]=_0x2b2206;return getRecipients(_0x459166);})[_0xec89('0x2b')](function(_0x2418cf){_0x4955b2[_0xec89('0x48')]=_['sortBy'](_0x2418cf)[_0xec89('0x49')](',');return db['sequelize']['transaction'](function(_0x426533){return db[_0xec89('0x4a')][_0xec89('0x4b')](_0x4955b2,{'raw':!![],'transaction':_0x426533})[_0xec89('0x2b')](function(_0x1d28c6){var _0x3ca4e6={'sender':_0x4955b2['senderName'],'description':_0x4955b2[_0xec89('0x44')],'content':_0x4955b2['body'],'beep':_0x4955b2[_0xec89('0x46')]};_0x2418cf[_0xec89('0x4c')](function(_0x5b3cc3){_0x3ca4e6[_0xec89('0x4d')]=_0x5b3cc3;socket['emit'](_0xec89('0x4e'),_0x3ca4e6);});return _0x1d28c6;});});})['then'](respondWithResult(_0xd7eb1b,0xc9))[_0xec89('0x4f')](handleError(_0xd7eb1b,null));};function getContent(_0x1be129){return new BPromise(function(_0x237eb6,_0x3f8c85){if(_0x1be129['text']){_0x237eb6(_0x1be129[_0xec89('0x50')]);return;}return db['Template'][_0xec89('0x51')]({'attributes':[_0xec89('0x52')],'where':{'id':_0x1be129[_0xec89('0x33')]},'raw':!![]})['then'](function(_0x14491f){if(!_0x14491f)throw new db['Sequelize'][(_0xec89('0x35'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x4ffcef=Mustache[_0xec89('0x53')](_0x14491f[_0xec89('0x52')],_0x1be129[_0xec89('0x36')]);_0x237eb6(_0x4ffcef);})[_0xec89('0x4f')](function(_0x50f2a3){_0x3f8c85(_0x50f2a3);});});}function getRecipients(_0x1378ec){return new BPromise(function(_0xcfcd76,_0x37f38b){var _0x1da975=[];var _0x1f04bb=[];_0x1378ec[_0xec89('0x4c')](function(_0x138e22){var _0x1b64d2=_['startCase'](_0x138e22[_0xec89('0x41')][_0xec89('0x54')]());if(_0x1b64d2===_0xec89('0x55')){_0x1da975=_[_0xec89('0x56')](_0x1da975,_0x138e22[_0xec89('0x57')]);}else{if(_[_0xec89('0x58')](_0x1b64d2,'queue'))_0x1b64d2=_0x1b64d2[_0xec89('0x59')](_0xec89('0x5a'),_0xec89('0x5b'));_0x138e22['ids']['forEach'](function(_0x56c5f7){_0x1f04bb[_0xec89('0x5c')](getAgents(_0x1b64d2,_0x56c5f7));});}});return BPromise[_0xec89('0x5d')](_0x1f04bb)['then'](function(_0x3a8d95){_0x1da975=_[_0xec89('0x56')](_0x1da975,_[_0xec89('0x5e')](_0x3a8d95));_0xcfcd76(_0x1da975);})[_0xec89('0x4f')](function(_0x16d943){_0x37f38b(_0x16d943);});});}function getAgents(_0x1835c4,_0x48c8b5){return new BPromise(function(_0x46d0c5,_0xd2a045){return db[_0x1835c4][_0xec89('0x51')]({'where':{'id':_0x48c8b5}})['then'](function(_0x23fc05){return _0x23fc05['getAgents']({'attributes':['id'],'raw':!![]})[_0xec89('0x2b')](function(_0x3aafab){var _0x26ac36=_[_0xec89('0x5f')](_0x3aafab,'id');_0x46d0c5(_0x26ac36);});})[_0xec89('0x4f')](function(_0x211f56){_0xd2a045(_0x211f56);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 8f49346..765cdb6 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 _0xca23=['../../mysqldb','UserNotification','setMaxListeners','remove','emit','exports','events'];(function(_0x5a0f5c,_0x241ba6){var _0x29d96b=function(_0x4eb553){while(--_0x4eb553){_0x5a0f5c['push'](_0x5a0f5c['shift']());}};_0x29d96b(++_0x241ba6);}(_0xca23,0x125));var _0x3ca2=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xca23[_0x36ed3c];return _0x52a2e0;};'use strict';var EventEmitter=require(_0x3ca2('0x0'));var UserNotification=require(_0x3ca2('0x1'))['db'][_0x3ca2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3ca2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3ca2('0x4')};function emitEvent(_0x16cf76){return function(_0x3ab19c,_0x24a9d7,_0x3f16e8){UserNotificationEvents[_0x3ca2('0x5')](_0x16cf76+':'+_0x3ab19c['id'],_0x3ab19c);UserNotificationEvents[_0x3ca2('0x5')](_0x16cf76,_0x3ab19c);_0x3f16e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x3ca2('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0x32f5=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3e8e9b,_0x2b3993){var _0x115abb=function(_0x4c4975){while(--_0x4c4975){_0x3e8e9b['push'](_0x3e8e9b['shift']());}};_0x115abb(++_0x2b3993);}(_0x32f5,0x98));var _0x532f=function(_0x51f241,_0x3be8e7){_0x51f241=_0x51f241-0x0;var _0x44abe7=_0x32f5[_0x51f241];return _0x44abe7;};'use strict';var EventEmitter=require(_0x532f('0x0'));var UserNotification=require(_0x532f('0x1'))['db'][_0x532f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x532f('0x3')](0x0);var events={'afterCreate':_0x532f('0x4'),'afterUpdate':_0x532f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5d3c2a){return function(_0x5de5e9,_0x5eee5b,_0x11aafa){UserNotificationEvents[_0x532f('0x6')](_0x5d3c2a+':'+_0x5de5e9['id'],_0x5de5e9);UserNotificationEvents['emit'](_0x5d3c2a,_0x5de5e9);_0x11aafa(null);};}for(var e in events){if(events[_0x532f('0x7')](e)){var event=events[e];UserNotification[_0x532f('0x8')](e,emitEvent(event));}}module[_0x532f('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index a9f2c6b..f73aa92 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 _0x00fc=['lodash','util','api','moment','request-promise','path','../../config/environment','./userNotification.attributes','define','userNotifications','utf8mb4'];(function(_0x3d9939,_0x3bb2b){var _0x269bd8=function(_0x11dbc5){while(--_0x11dbc5){_0x3d9939['push'](_0x3d9939['shift']());}};_0x269bd8(++_0x3bb2b);}(_0x00fc,0xd1));var _0xc00f=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x00fc[_0x3299d1];return _0x44356e;};'use strict';var _=require(_0xc00f('0x0'));var util=require(_0xc00f('0x1'));var logger=require('../../config/logger')(_0xc00f('0x2'));var moment=require(_0xc00f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc00f('0x4'));var fs=require('fs');var path=require(_0xc00f('0x5'));var rimraf=require('rimraf');var config=require(_0xc00f('0x6'));var attributes=require(_0xc00f('0x7'));module['exports']=function(_0xa980cb,_0x13ec82){return _0xa980cb[_0xc00f('0x8')]('UserNotification',attributes,{'tableName':_0xc00f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc00f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x276e=['bluebird','path','rimraf','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x120564,_0x3c18cf){var _0x579980=function(_0x108c13){while(--_0x108c13){_0x120564['push'](_0x120564['shift']());}};_0x579980(++_0x3c18cf);}(_0x276e,0xec));var _0xe276=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x276e[_0x5311e8];return _0x582ad8;};'use strict';var _=require(_0xe276('0x0'));var util=require(_0xe276('0x1'));var logger=require(_0xe276('0x2'))('api');var moment=require(_0xe276('0x3'));var BPromise=require(_0xe276('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe276('0x5'));var rimraf=require(_0xe276('0x6'));var config=require('../../config/environment');var attributes=require(_0xe276('0x7'));module['exports']=function(_0x572bea,_0x216565){return _0x572bea[_0xe276('0x8')](_0xe276('0x9'),attributes,{'tableName':_0xe276('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe276('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 2072074..3c77e8b 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 _0xe630=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userNotification.socket','then','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0xe630,0x1f3));var _0x0e63=function(_0x2a0503,_0x5a4b2f){_0x2a0503=_0x2a0503-0x0;var _0x2c1e6c=_0xe630[_0x2a0503];return _0x2c1e6c;};'use strict';var _=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var moment=require('moment');var BPromise=require(_0x0e63('0x2'));var rs=require(_0x0e63('0x3'));var fs=require('fs');var Redis=require(_0x0e63('0x4'));var db=require(_0x0e63('0x5'))['db'];var utils=require(_0x0e63('0x6'));var logger=require('../../config/logger')(_0x0e63('0x7'));var config=require(_0x0e63('0x8'));var jayson=require(_0x0e63('0x9'));var client=jayson[_0x0e63('0xa')][_0x0e63('0xb')]({'port':0x232a});config[_0x0e63('0xc')]=_[_0x0e63('0xd')](config[_0x0e63('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0e63('0xe'))['register'](socket);function respondWithRpcPromise(_0x551d62,_0x2f6e56,_0x39b2f0){return new BPromise(function(_0x4021dc,_0x254920){return client['request'](_0x551d62,_0x39b2f0)[_0x0e63('0xf')](function(_0x1cd486){logger[_0x0e63('0x10')](_0x0e63('0x11'),_0x2f6e56,'request\x20sent');logger[_0x0e63('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x2f6e56,_0x0e63('0x13'),JSON['stringify'](_0x1cd486));if(_0x1cd486[_0x0e63('0x14')]){if(_0x1cd486['error'][_0x0e63('0x15')]===0x1f4){logger[_0x0e63('0x14')]('UserNotification,\x20%s,\x20%s',_0x2f6e56,_0x1cd486[_0x0e63('0x14')][_0x0e63('0x16')]);return _0x254920(_0x1cd486[_0x0e63('0x14')]['message']);}logger[_0x0e63('0x14')]('UserNotification,\x20%s,\x20%s',_0x2f6e56,_0x1cd486[_0x0e63('0x14')][_0x0e63('0x16')]);return _0x4021dc(_0x1cd486[_0x0e63('0x14')]['message']);}else{logger[_0x0e63('0x10')](_0x0e63('0x11'),_0x2f6e56,_0x0e63('0x13'));_0x4021dc(_0x1cd486[_0x0e63('0x17')][_0x0e63('0x16')]);}})['catch'](function(_0xe0fab4){logger[_0x0e63('0x14')]('UserNotification,\x20%s,\x20%s',_0x2f6e56,_0xe0fab4);_0x254920(_0xe0fab4);});});} \ No newline at end of file +var _0xbf37=['socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x312a7f,_0x509e83){var _0x2fb5ba=function(_0x3dcdea){while(--_0x3dcdea){_0x312a7f['push'](_0x312a7f['shift']());}};_0x2fb5ba(++_0x509e83);}(_0xbf37,0x102));var _0x7bf3=function(_0x5ce760,_0x45f007){_0x5ce760=_0x5ce760-0x0;var _0x830855=_0xbf37[_0x5ce760];return _0x830855;};'use strict';var _=require(_0x7bf3('0x0'));var util=require('util');var moment=require(_0x7bf3('0x1'));var BPromise=require(_0x7bf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bf3('0x4'));var logger=require('../../config/logger')(_0x7bf3('0x5'));var config=require(_0x7bf3('0x6'));var jayson=require(_0x7bf3('0x7'));var client=jayson[_0x7bf3('0x8')][_0x7bf3('0x9')]({'port':0x232a});config[_0x7bf3('0xa')]=_[_0x7bf3('0xb')](config[_0x7bf3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bf3('0xc'))(new Redis(config[_0x7bf3('0xa')]));require(_0x7bf3('0xd'))[_0x7bf3('0xe')](socket);function respondWithRpcPromise(_0x108372,_0x51b9e7,_0x20c9d2){return new BPromise(function(_0x210f36,_0x5c1231){return client[_0x7bf3('0xf')](_0x108372,_0x20c9d2)[_0x7bf3('0x10')](function(_0x5e8189){logger[_0x7bf3('0x11')]('UserNotification,\x20%s,\x20%s',_0x51b9e7,_0x7bf3('0x12'));logger[_0x7bf3('0x13')](_0x7bf3('0x14'),_0x51b9e7,_0x7bf3('0x12'),JSON[_0x7bf3('0x15')](_0x5e8189));if(_0x5e8189[_0x7bf3('0x16')]){if(_0x5e8189[_0x7bf3('0x16')][_0x7bf3('0x17')]===0x1f4){logger[_0x7bf3('0x16')](_0x7bf3('0x18'),_0x51b9e7,_0x5e8189['error'][_0x7bf3('0x19')]);return _0x5c1231(_0x5e8189[_0x7bf3('0x16')][_0x7bf3('0x19')]);}logger[_0x7bf3('0x16')](_0x7bf3('0x18'),_0x51b9e7,_0x5e8189[_0x7bf3('0x16')][_0x7bf3('0x19')]);return _0x210f36(_0x5e8189['error']['message']);}else{logger[_0x7bf3('0x11')](_0x7bf3('0x18'),_0x51b9e7,_0x7bf3('0x12'));_0x210f36(_0x5e8189[_0x7bf3('0x1a')]['message']);}})['catch'](function(_0x19e284){logger['error'](_0x7bf3('0x18'),_0x51b9e7,_0x19e284);_0x5c1231(_0x19e284);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a82a9cb..f70996a 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 _0xccdd=['emit','register','userNotification:','save','remove'];(function(_0x290258,_0x1476b3){var _0x43de3b=function(_0x51290c){while(--_0x51290c){_0x290258['push'](_0x290258['shift']());}};_0x43de3b(++_0x1476b3);}(_0xccdd,0xe4));var _0xdccd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xccdd[_0x4b369d];return _0x571a98;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xdccd('0x0'),_0xdccd('0x1'),'update'];function createListener(_0x2bb62c,_0x1f13dc){return function(_0x2b00b1){_0x1f13dc[_0xdccd('0x2')](_0x2bb62c,_0x2b00b1);};}function removeListener(_0x2aa278,_0x1e2f5e){return function(){UserNotificationEvents['removeListener'](_0x2aa278,_0x1e2f5e);};}exports[_0xdccd('0x3')]=function(_0x19a528){for(var _0x4aed77=0x0,_0xe71712=events['length'];_0x4aed77<_0xe71712;_0x4aed77++){var _0x37f293=events[_0x4aed77];var _0x5819bb=createListener(_0xdccd('0x4')+_0x37f293,_0x19a528);UserNotificationEvents['on'](_0x37f293,_0x5819bb);}}; \ No newline at end of file +var _0xc184=['register','length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xc184,0x1f2));var _0x4c18=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xc184[_0x18ab2a];return _0x16dcee;};'use strict';var UserNotificationEvents=require(_0x4c18('0x0'));var events=[_0x4c18('0x1'),_0x4c18('0x2'),_0x4c18('0x3')];function createListener(_0x4fac83,_0x24a76e){return function(_0xf6be1f){_0x24a76e[_0x4c18('0x4')](_0x4fac83,_0xf6be1f);};}function removeListener(_0x18a387,_0x58ade6){return function(){UserNotificationEvents[_0x4c18('0x5')](_0x18a387,_0x58ade6);};}exports[_0x4c18('0x6')]=function(_0x4bb0ef){for(var _0x38f66d=0x0,_0x54c0ea=events[_0x4c18('0x7')];_0x38f66d<_0x54c0ea;_0x38f66d++){var _0x5696f4=events[_0x38f66d];var _0xc8c3f8=createListener(_0x4c18('0x8')+_0x5696f4,_0x4bb0ef);UserNotificationEvents['on'](_0x5696f4,_0xc8c3f8);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 727103f..191d01d 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(_0x40478a,_0x17ed24){var _0x417d31=function(_0xc723ee){while(--_0xc723ee){_0x40478a['push'](_0x40478a['shift']());}};_0x417d31(++_0x17ed24);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xaaadfa,_0x2bba7e){var _0x46a141=function(_0x4cae80){while(--_0x4cae80){_0xaaadfa['push'](_0xaaadfa['shift']());}};_0x46a141(++_0x2bba7e);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 103a8b1..d5c37ce 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 _0xc2fc=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2fc,0xda));var _0xcc2f=function(_0x2f1723,_0x2a45ec){_0x2f1723=_0x2f1723-0x0;var _0x41b56a=_0xc2fc[_0x2f1723];return _0x41b56a;};'use strict';var Sequelize=require(_0xcc2f('0x0'));module[_0xcc2f('0x1')]={'penalty':{'type':Sequelize[_0xcc2f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0772=['INTEGER','sequelize','exports'];(function(_0x3f3313,_0x2134e6){var _0x52025=function(_0x1e3637){while(--_0x1e3637){_0x3f3313['push'](_0x3f3313['shift']());}};_0x52025(++_0x2134e6);}(_0x0772,0x7f));var _0x2077=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0772[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x2077('0x0'));module[_0x2077('0x1')]={'penalty':{'type':Sequelize[_0x2077('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 2819743..3bed2c9 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 _0xf263=['../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xf263,0x107));var _0x3f26=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0xf263[_0x837dad];return _0x1d62d3;};'use strict';var _=require('lodash');var util=require(_0x3f26('0x0'));var logger=require(_0x3f26('0x1'))(_0x3f26('0x2'));var moment=require('moment');var BPromise=require(_0x3f26('0x3'));var rp=require(_0x3f26('0x4'));var fs=require('fs');var path=require(_0x3f26('0x5'));var rimraf=require(_0x3f26('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f26('0x7'));module[_0x3f26('0x8')]=function(_0x4fec16,_0x4fd387){return _0x4fec16[_0x3f26('0x9')](_0x3f26('0xa'),attributes,{'tableName':_0x3f26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757d=['user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x231b2f,_0x51c50f){var _0x3d94f8=function(_0xc04a36){while(--_0xc04a36){_0x231b2f['push'](_0x231b2f['shift']());}};_0x3d94f8(++_0x51c50f);}(_0x757d,0x199));var _0xd757=function(_0x405ac9,_0x2c795c){_0x405ac9=_0x405ac9-0x0;var _0x2d200f=_0x757d[_0x405ac9];return _0x2d200f;};'use strict';var _=require(_0xd757('0x0'));var util=require(_0xd757('0x1'));var logger=require(_0xd757('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd757('0x3'));var rp=require(_0xd757('0x4'));var fs=require('fs');var path=require(_0xd757('0x5'));var rimraf=require('rimraf');var config=require(_0xd757('0x6'));var attributes=require(_0xd757('0x7'));module[_0xd757('0x8')]=function(_0x480fc1,_0x205124){return _0x480fc1[_0xd757('0x9')](_0xd757('0xa'),attributes,{'tableName':_0xd757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 73e7d88..794012c 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 _0xe624=['message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5a04f3,_0x356611){var _0x4079e6=function(_0x1e2a07){while(--_0x1e2a07){_0x5a04f3['push'](_0x5a04f3['shift']());}};_0x4079e6(++_0x356611);}(_0xe624,0x7c));var _0x4e62=function(_0x44c8cb,_0x2e28c7){_0x44c8cb=_0x44c8cb-0x0;var _0x3bf406=_0xe624[_0x44c8cb];return _0x3bf406;};'use strict';var _=require('lodash');var util=require(_0x4e62('0x0'));var moment=require(_0x4e62('0x1'));var BPromise=require(_0x4e62('0x2'));var rs=require(_0x4e62('0x3'));var fs=require('fs');var Redis=require(_0x4e62('0x4'));var db=require(_0x4e62('0x5'))['db'];var utils=require(_0x4e62('0x6'));var logger=require(_0x4e62('0x7'))(_0x4e62('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e62('0x9'));var client=jayson['client'][_0x4e62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5212b1,_0xf83f0d,_0x14b51a){return new BPromise(function(_0x4865a2,_0x3bc2ce){return client[_0x4e62('0xb')](_0x5212b1,_0x14b51a)[_0x4e62('0xc')](function(_0x15b8e6){logger['info'](_0x4e62('0xd'),_0xf83f0d,_0x4e62('0xe'));logger[_0x4e62('0xf')](_0x4e62('0x10'),_0xf83f0d,_0x4e62('0xe'),JSON[_0x4e62('0x11')](_0x15b8e6));if(_0x15b8e6[_0x4e62('0x12')]){if(_0x15b8e6['error'][_0x4e62('0x13')]===0x1f4){logger[_0x4e62('0x12')](_0x4e62('0xd'),_0xf83f0d,_0x15b8e6['error']['message']);return _0x3bc2ce(_0x15b8e6['error']['message']);}logger[_0x4e62('0x12')](_0x4e62('0xd'),_0xf83f0d,_0x15b8e6[_0x4e62('0x12')][_0x4e62('0x14')]);return _0x4865a2(_0x15b8e6['error'][_0x4e62('0x14')]);}else{logger[_0x4e62('0x15')](_0x4e62('0xd'),_0xf83f0d,'request\x20sent');_0x4865a2(_0x15b8e6[_0x4e62('0x16')][_0x4e62('0x14')]);}})[_0x4e62('0x17')](function(_0x49b0ac){logger[_0x4e62('0x12')](_0x4e62('0xd'),_0xf83f0d,_0x49b0ac);_0x3bc2ce(_0x49b0ac);});});} \ No newline at end of file +var _0x8451=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x599ff0,_0xd0a789){var _0xba45b2=function(_0x3139b0){while(--_0x3139b0){_0x599ff0['push'](_0x599ff0['shift']());}};_0xba45b2(++_0xd0a789);}(_0x8451,0x16f));var _0x1845=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x8451[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x1845('0x0'));var util=require(_0x1845('0x1'));var moment=require(_0x1845('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1845('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1845('0x4'))(_0x1845('0x5'));var config=require(_0x1845('0x6'));var jayson=require(_0x1845('0x7'));var client=jayson[_0x1845('0x8')][_0x1845('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33db77,_0x31037c,_0x149c51){return new BPromise(function(_0x5ebac9,_0x3b558f){return client[_0x1845('0xa')](_0x33db77,_0x149c51)[_0x1845('0xb')](function(_0x1d00a8){logger[_0x1845('0xc')](_0x1845('0xd'),_0x31037c,_0x1845('0xe'));logger[_0x1845('0xf')](_0x1845('0x10'),_0x31037c,_0x1845('0xe'),JSON['stringify'](_0x1d00a8));if(_0x1d00a8[_0x1845('0x11')]){if(_0x1d00a8['error']['code']===0x1f4){logger['error'](_0x1845('0xd'),_0x31037c,_0x1d00a8[_0x1845('0x11')][_0x1845('0x12')]);return _0x3b558f(_0x1d00a8[_0x1845('0x11')][_0x1845('0x12')]);}logger[_0x1845('0x11')](_0x1845('0xd'),_0x31037c,_0x1d00a8[_0x1845('0x11')]['message']);return _0x5ebac9(_0x1d00a8['error']['message']);}else{logger[_0x1845('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x31037c,_0x1845('0xe'));_0x5ebac9(_0x1d00a8[_0x1845('0x13')][_0x1845('0x12')]);}})[_0x1845('0x14')](function(_0x2eaaa4){logger['error'](_0x1845('0xd'),_0x31037c,_0x2eaaa4);_0x3b558f(_0x2eaaa4);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b9fe0ad..6a6fa9e 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 _0x0588=['update','delete','destroy','/:id/resources','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','post','create','/:id/clone','clone','addSections','addResources','put'];(function(_0x511093,_0x2266d8){var _0x577e1d=function(_0x25da86){while(--_0x25da86){_0x511093['push'](_0x511093['shift']());}};_0x577e1d(++_0x2266d8);}(_0x0588,0xd8));var _0x8058=function(_0x402fa3,_0x3f887b){_0x402fa3=_0x402fa3-0x0;var _0x344170=_0x0588[_0x402fa3];return _0x344170;};'use strict';var multer=require(_0x8058('0x0'));var util=require(_0x8058('0x1'));var path=require(_0x8058('0x2'));var timeout=require(_0x8058('0x3'));var express=require(_0x8058('0x4'));var router=express[_0x8058('0x5')]();var fs_extra=require(_0x8058('0x6'));var auth=require(_0x8058('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8058('0x8'));router[_0x8058('0x9')]('/',auth[_0x8058('0xa')](),controller[_0x8058('0xb')]);router[_0x8058('0x9')]('/describe',auth[_0x8058('0xa')](),controller[_0x8058('0xc')]);router[_0x8058('0x9')](_0x8058('0xd'),auth['isAuthenticated'](),controller[_0x8058('0xe')]);router[_0x8058('0x9')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller[_0x8058('0x10')]);router[_0x8058('0x9')]('/:id/resources',auth[_0x8058('0xa')](),controller['getResources']);router[_0x8058('0x11')]('/',auth[_0x8058('0xa')](),controller[_0x8058('0x12')]);router[_0x8058('0x11')](_0x8058('0x13'),auth[_0x8058('0xa')](),controller[_0x8058('0x14')]);router[_0x8058('0x11')]('/:id/sections',auth[_0x8058('0xa')](),controller[_0x8058('0x15')]);router['post']('/:id/resources',auth[_0x8058('0xa')](),controller[_0x8058('0x16')]);router[_0x8058('0x17')](_0x8058('0xd'),auth[_0x8058('0xa')](),controller[_0x8058('0x18')]);router[_0x8058('0x19')](_0x8058('0xd'),auth[_0x8058('0xa')](),controller[_0x8058('0x1a')]);router[_0x8058('0x19')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller['removeSections']);router[_0x8058('0x19')](_0x8058('0x1b'),auth['isAuthenticated'](),controller[_0x8058('0x1c')]);module[_0x8058('0x1d')]=router; \ No newline at end of file +var _0xad2c=['getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','/:id/sections','removeSections','removeResources','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3a7ee2,_0xdde384){var _0x3d05ae=function(_0x5204ca){while(--_0x5204ca){_0x3a7ee2['push'](_0x3a7ee2['shift']());}};_0x3d05ae(++_0xdde384);}(_0xad2c,0x13a));var _0xcad2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xad2c[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xcad2('0x0'));var util=require(_0xcad2('0x1'));var path=require(_0xcad2('0x2'));var timeout=require('connect-timeout');var express=require(_0xcad2('0x3'));var router=express[_0xcad2('0x4')]();var fs_extra=require(_0xcad2('0x5'));var auth=require(_0xcad2('0x6'));var interaction=require(_0xcad2('0x7'));var config=require('../../config/environment');var controller=require(_0xcad2('0x8'));router[_0xcad2('0x9')]('/',auth[_0xcad2('0xa')](),controller[_0xcad2('0xb')]);router[_0xcad2('0x9')](_0xcad2('0xc'),auth[_0xcad2('0xa')](),controller[_0xcad2('0xd')]);router['get'](_0xcad2('0xe'),auth[_0xcad2('0xa')](),controller[_0xcad2('0xf')]);router[_0xcad2('0x9')]('/:id/sections',auth[_0xcad2('0xa')](),controller[_0xcad2('0x10')]);router[_0xcad2('0x9')](_0xcad2('0x11'),auth[_0xcad2('0xa')](),controller[_0xcad2('0x12')]);router[_0xcad2('0x13')]('/',auth[_0xcad2('0xa')](),controller[_0xcad2('0x14')]);router[_0xcad2('0x13')](_0xcad2('0x15'),auth[_0xcad2('0xa')](),controller[_0xcad2('0x16')]);router[_0xcad2('0x13')]('/:id/sections',auth[_0xcad2('0xa')](),controller[_0xcad2('0x17')]);router[_0xcad2('0x13')](_0xcad2('0x11'),auth[_0xcad2('0xa')](),controller[_0xcad2('0x18')]);router[_0xcad2('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xcad2('0x1a')]);router[_0xcad2('0x1b')](_0xcad2('0xe'),auth[_0xcad2('0xa')](),controller[_0xcad2('0x1c')]);router[_0xcad2('0x1b')](_0xcad2('0x1d'),auth['isAuthenticated'](),controller[_0xcad2('0x1e')]);router[_0xcad2('0x1b')]('/:id/resources',auth[_0xcad2('0xa')](),controller[_0xcad2('0x1f')]);module[_0xcad2('0x20')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index c5c98c0..7bb322a 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 _0xe560=['sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x294cf1,_0x5d6a40){var _0x334402=function(_0x5b07f0){while(--_0x5b07f0){_0x294cf1['push'](_0x294cf1['shift']());}};_0x334402(++_0x5d6a40);}(_0xe560,0xe1));var _0x0e56=function(_0x3b601a,_0x1fcc08){_0x3b601a=_0x3b601a-0x0;var _0x3b4d2b=_0xe560[_0x3b601a];return _0x3b4d2b;};'use strict';var Sequelize=require(_0x0e56('0x0'));module[_0x0e56('0x1')]={'name':{'type':Sequelize[_0x0e56('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x0e56('0x2')],'set':function(_0xfd822a){this[_0x0e56('0x3')](_0x0e56('0x4'),_0xfd822a?_0xfd822a[_0x0e56('0x5')](''):[]);},'get':function(){return this[_0x0e56('0x6')](_0x0e56('0x4'))?this[_0x0e56('0x6')](_0x0e56('0x4'))[_0x0e56('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0e56('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0e56('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x93f8=['sequelize','STRING','name','setDataValue','crudPermissions','join','split','BOOLEAN'];(function(_0x508bf9,_0x3cf21e){var _0x43994d=function(_0x3c9fc2){while(--_0x3c9fc2){_0x508bf9['push'](_0x508bf9['shift']());}};_0x43994d(++_0x3cf21e);}(_0x93f8,0xa8));var _0x893f=function(_0x5260a4,_0x566518){_0x5260a4=_0x5260a4-0x0;var _0x44f721=_0x93f8[_0x5260a4];return _0x44f721;};'use strict';var Sequelize=require(_0x893f('0x0'));module['exports']={'name':{'type':Sequelize[_0x893f('0x1')],'allowNull':![],'unique':_0x893f('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x6fa122){this[_0x893f('0x3')](_0x893f('0x4'),_0x6fa122?_0x6fa122[_0x893f('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x893f('0x4'))?this['getDataValue'](_0x893f('0x4'))[_0x893f('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x893f('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x893f('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x893f('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x893f('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x893f('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x893f('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 efbb096..cc5bc50 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 _0x8a9a=['where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','fields','includeAll','create','body','clone','include','find','get','omit','crudPermissions','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','end','status','json','limit','count','offset','Content-Range','apply','then','destroy','error','name','index','UserProfile','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort'];(function(_0x4d0bbb,_0x20ba67){var _0x45526a=function(_0x88d947){while(--_0x88d947){_0x4d0bbb['push'](_0x4d0bbb['shift']());}};_0x45526a(++_0x20ba67);}(_0x8a9a,0x17f));var _0xa8a9=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8a9a[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8a9('0x0'));var zipdir=require(_0xa8a9('0x1'));var jsonpatch=require(_0xa8a9('0x2'));var rp=require(_0xa8a9('0x3'));var moment=require(_0xa8a9('0x4'));var BPromise=require(_0xa8a9('0x5'));var Mustache=require(_0xa8a9('0x6'));var util=require(_0xa8a9('0x7'));var path=require(_0xa8a9('0x8'));var sox=require(_0xa8a9('0x9'));var csv=require(_0xa8a9('0xa'));var ejs=require(_0xa8a9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8a9('0xc'));var squel=require('squel');var crypto=require(_0xa8a9('0xd'));var jsforce=require(_0xa8a9('0xe'));var deskjs=require(_0xa8a9('0xf'));var toCsv=require(_0xa8a9('0xa'));var querystring=require(_0xa8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8a9('0x11'));var authService=require(_0xa8a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa8a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a9('0x14'))(_0xa8a9('0x15'));var utils=require('../../config/utils');var config=require(_0xa8a9('0x16'));var licenseUtil=require(_0xa8a9('0x17'));var db=require(_0xa8a9('0x18'))['db'];config[_0xa8a9('0x19')]=_[_0xa8a9('0x1a')](config[_0xa8a9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8a9('0x1b'))(new Redis(config[_0xa8a9('0x19')]));require(_0xa8a9('0x1c'))['register'](socket);function respondWithStatusCode(_0x4f35e6,_0x37ea5c){_0x37ea5c=_0x37ea5c||0xcc;return function(_0x1d145e){if(_0x1d145e){return _0x4f35e6[_0xa8a9('0x1d')](_0x37ea5c);}return _0x4f35e6['status'](_0x37ea5c)[_0xa8a9('0x1e')]();};}function respondWithResult(_0x35be8c,_0x557f45){_0x557f45=_0x557f45||0xc8;return function(_0x4b7219){if(_0x4b7219){return _0x35be8c[_0xa8a9('0x1f')](_0x557f45)[_0xa8a9('0x20')](_0x4b7219);}};}function respondWithFilteredResult(_0x91e6d8,_0x35fb9){return function(_0x46a89d){if(_0x46a89d){var _0x4456aa=typeof _0x35fb9['offset']==='undefined'&&typeof _0x35fb9[_0xa8a9('0x21')]==='undefined';var _0x5248fa=_0x46a89d[_0xa8a9('0x22')];var _0x12f932=_0x4456aa?0x0:_0x35fb9[_0xa8a9('0x23')];var _0x3a2207=_0x4456aa?_0x46a89d[_0xa8a9('0x22')]:_0x35fb9[_0xa8a9('0x23')]+_0x35fb9[_0xa8a9('0x21')];var _0x3c37f9;if(_0x3a2207>=_0x5248fa){_0x3a2207=_0x5248fa;_0x3c37f9=0xc8;}else{_0x3c37f9=0xce;}_0x91e6d8[_0xa8a9('0x1f')](_0x3c37f9);return _0x91e6d8['set'](_0xa8a9('0x24'),_0x12f932+'-'+_0x3a2207+'/'+_0x5248fa)['json'](_0x46a89d);}return null;};}function patchUpdates(_0x32721b){return function(_0x58b2f0){try{jsonpatch[_0xa8a9('0x25')](_0x58b2f0,_0x32721b,!![]);}catch(_0x1229d0){return BPromise['reject'](_0x1229d0);}return _0x58b2f0['save']();};}function saveUpdates(_0x5d3ec8,_0x4b2ad1){return function(_0xcca967){if(_0xcca967){return _0xcca967['update'](_0x5d3ec8)[_0xa8a9('0x26')](function(_0x5276bd){return _0x5276bd;});}return null;};}function removeEntity(_0x284b55,_0x16abed){return function(_0x32f687){if(_0x32f687){return _0x32f687[_0xa8a9('0x27')]()[_0xa8a9('0x26')](function(){_0x284b55[_0xa8a9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c210b,_0x4d6c65){return function(_0x45578f){if(!_0x45578f){_0x3c210b[_0xa8a9('0x1d')](0x194);}return _0x45578f;};}function handleError(_0x476365,_0x1d8db6){_0x1d8db6=_0x1d8db6||0x1f4;return function(_0x21b380){logger[_0xa8a9('0x28')](_0x21b380['stack']);if(_0x21b380[_0xa8a9('0x29')]){delete _0x21b380[_0xa8a9('0x29')];}_0x476365[_0xa8a9('0x1f')](_0x1d8db6)['send'](_0x21b380);};}exports[_0xa8a9('0x2a')]=function(_0x3f2f30,_0x4af312){var _0x4d42fc={},_0x5c9246={},_0x5b4022={'count':0x0,'rows':[]};var _0x294137=_['map'](db[_0xa8a9('0x2b')][_0xa8a9('0x2c')],function(_0x26e330){return{'name':_0x26e330[_0xa8a9('0x2d')],'type':_0x26e330['type']['key']};});_0x5c9246[_0xa8a9('0x2e')]=_[_0xa8a9('0x2f')](_0x294137,_0xa8a9('0x29'));_0x5c9246['query']=_[_0xa8a9('0x30')](_0x3f2f30[_0xa8a9('0x31')]);_0x5c9246[_0xa8a9('0x32')]=_[_0xa8a9('0x33')](_0x5c9246[_0xa8a9('0x2e')],_0x5c9246['query']);_0x4d42fc[_0xa8a9('0x34')]=_[_0xa8a9('0x33')](_0x5c9246[_0xa8a9('0x2e')],qs['fields'](_0x3f2f30[_0xa8a9('0x31')]['fields']));_0x4d42fc['attributes']=_0x4d42fc['attributes'][_0xa8a9('0x35')]?_0x4d42fc['attributes']:_0x5c9246[_0xa8a9('0x2e')];if(!_0x3f2f30[_0xa8a9('0x31')][_0xa8a9('0x36')]('nolimit')){_0x4d42fc[_0xa8a9('0x21')]=qs[_0xa8a9('0x21')](_0x3f2f30['query']['limit']);_0x4d42fc[_0xa8a9('0x23')]=qs[_0xa8a9('0x23')](_0x3f2f30['query'][_0xa8a9('0x23')]);}_0x4d42fc[_0xa8a9('0x37')]=qs['sort'](_0x3f2f30[_0xa8a9('0x31')][_0xa8a9('0x38')]);_0x4d42fc[_0xa8a9('0x39')]=qs['filters'](_[_0xa8a9('0x3a')](_0x3f2f30[_0xa8a9('0x31')],_0x5c9246[_0xa8a9('0x32')]),_0x294137);if(_0x3f2f30['query'][_0xa8a9('0x3b')]){_0x4d42fc['where']=_[_0xa8a9('0x3c')](_0x4d42fc['where'],{'$or':_[_0xa8a9('0x2f')](_0x294137,function(_0x579081){if(_0x579081[_0xa8a9('0x3d')]!==_0xa8a9('0x3e')){var _0x57fc5b={};_0x57fc5b[_0x579081[_0xa8a9('0x29')]]={'$like':'%'+_0x3f2f30['query'][_0xa8a9('0x3b')]+'%'};return _0x57fc5b;}})});}_0x4d42fc=_[_0xa8a9('0x3c')]({},_0x4d42fc,_0x3f2f30[_0xa8a9('0x3f')]);var _0x1aaeda={'where':_0x4d42fc[_0xa8a9('0x39')]};return db[_0xa8a9('0x2b')][_0xa8a9('0x22')](_0x1aaeda)['then'](function(_0x1e05f6){_0x5b4022[_0xa8a9('0x22')]=_0x1e05f6;if(_0x3f2f30[_0xa8a9('0x31')]['includeAll']){_0x4d42fc['include']=[{'all':!![]}];}return db['UserProfile'][_0xa8a9('0x40')](_0x4d42fc);})[_0xa8a9('0x26')](function(_0x210056){_0x5b4022[_0xa8a9('0x41')]=_0x210056;return _0x5b4022;})[_0xa8a9('0x26')](respondWithFilteredResult(_0x4af312,_0x4d42fc))[_0xa8a9('0x42')](handleError(_0x4af312,null));};exports[_0xa8a9('0x43')]=function(_0x2f5650,_0x4cbc17){var _0xdaa921={'raw':![],'where':{'id':_0x2f5650[_0xa8a9('0x44')]['id']}},_0x2368c7={};_0x2368c7[_0xa8a9('0x2e')]=_[_0xa8a9('0x30')](db[_0xa8a9('0x2b')]['rawAttributes']);_0x2368c7[_0xa8a9('0x31')]=_[_0xa8a9('0x30')](_0x2f5650[_0xa8a9('0x31')]);_0x2368c7['filters']=_[_0xa8a9('0x33')](_0x2368c7[_0xa8a9('0x2e')],_0x2368c7[_0xa8a9('0x31')]);_0xdaa921[_0xa8a9('0x34')]=_['intersection'](_0x2368c7[_0xa8a9('0x2e')],qs['fields'](_0x2f5650[_0xa8a9('0x31')][_0xa8a9('0x45')]));_0xdaa921[_0xa8a9('0x34')]=_0xdaa921[_0xa8a9('0x34')][_0xa8a9('0x35')]?_0xdaa921[_0xa8a9('0x34')]:_0x2368c7['model'];if(_0x2f5650[_0xa8a9('0x31')][_0xa8a9('0x46')]){_0xdaa921['include']=[{'all':!![]}];}_0xdaa921=_[_0xa8a9('0x3c')]({},_0xdaa921,_0x2f5650['options']);return db[_0xa8a9('0x2b')]['find'](_0xdaa921)[_0xa8a9('0x26')](handleEntityNotFound(_0x4cbc17,null))[_0xa8a9('0x26')](respondWithResult(_0x4cbc17,null))[_0xa8a9('0x42')](handleError(_0x4cbc17,null));};exports[_0xa8a9('0x47')]=function(_0x13455b,_0x3d5d7e){return db[_0xa8a9('0x2b')]['create'](_0x13455b[_0xa8a9('0x48')],{})[_0xa8a9('0x26')](respondWithResult(_0x3d5d7e,0xc9))['catch'](handleError(_0x3d5d7e,null));};exports[_0xa8a9('0x49')]=function(_0x333628,_0x4b8792){var _0x2716ef={'where':{'id':_0x333628[_0xa8a9('0x44')]['id']}},_0x50dca6={};_0x50dca6[_0xa8a9('0x2e')]=_[_0xa8a9('0x30')](db['UserProfile'][_0xa8a9('0x2c')]);_0x2716ef[_0xa8a9('0x34')]=_['intersection'](_0x50dca6[_0xa8a9('0x2e')],qs[_0xa8a9('0x45')](_0x333628[_0xa8a9('0x31')][_0xa8a9('0x45')]));_0x2716ef[_0xa8a9('0x34')]=_0x2716ef[_0xa8a9('0x34')][_0xa8a9('0x35')]?_0x2716ef[_0xa8a9('0x34')]:_0x50dca6[_0xa8a9('0x2e')];if(_0x333628['query'][_0xa8a9('0x46')]){_0x2716ef[_0xa8a9('0x4a')]=[{'all':!![]}];}_0x2716ef=_[_0xa8a9('0x3c')]({},_0x2716ef,_0x333628[_0xa8a9('0x3f')]);return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')](_0x2716ef)[_0xa8a9('0x26')](handleEntityNotFound(_0x4b8792,null))[_0xa8a9('0x26')](function(_0x503556){if(_0x503556){var _0x4969c8=_0x503556[_0xa8a9('0x4c')]({'plain':!![]});_0x4969c8=qs[_0xa8a9('0x4d')](_0x4969c8,['id','createdAt','updatedAt',_0xa8a9('0x4e')]);_0x333628['body']=_[_0xa8a9('0x4d')](_0x333628['body'],['id',_0xa8a9('0x4f'),_0xa8a9('0x50')]);return db[_0xa8a9('0x51')][_0xa8a9('0x52')](function(_0x29a729){return db['UserProfile'][_0xa8a9('0x47')](_[_0xa8a9('0x3c')](_0x4969c8,_0x333628[_0xa8a9('0x48')]),{'include':_0x333628['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x29a729})[_0xa8a9('0x26')](function(_0xd85ab9){var _0x9c2873=_0xd85ab9['get']({'plain':!![]});return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x333628[_0xa8a9('0x44')]['id']},'raw':!![]})['then'](function(_0x1243d2){if(_0x1243d2){return BPromise[_0xa8a9('0x54')](_0x1243d2,function(_0x4d2ffb){return new BPromise(function(_0x580aa3,_0x2e800e){if(_0x4d2ffb[_0xa8a9('0x55')]===null||_0x4d2ffb[_0xa8a9('0x55')]===0x1)_0x580aa3(null);return db[_0xa8a9('0x56')][_0xa8a9('0x40')]({'where':{'sectionId':_0x4d2ffb['id']},'raw':!![]})[_0xa8a9('0x26')](function(_0x358585){var _0x37c53f=_[_0xa8a9('0x2f')](_0x358585,function(_0x34acb1){return qs[_0xa8a9('0x4d')](_0x34acb1,['id',_0xa8a9('0x4f'),_0xa8a9('0x50'),_0xa8a9('0x57')]);});_0x580aa3(_0x37c53f);})[_0xa8a9('0x42')](function(_0x2294c9){_0x2e800e(_0x2294c9);});})[_0xa8a9('0x26')](function(_0x6376c){var _0x4827d0=qs[_0xa8a9('0x4d')](_0x4d2ffb,['id',_0xa8a9('0x4f'),'updatedAt']);_0x4827d0[_0xa8a9('0x58')]=_0x9c2873['id'];if(_0x6376c)_0x4827d0['Resources']=_0x6376c;return _0x4827d0;})[_0xa8a9('0x26')](function(_0x254134){return db[_0xa8a9('0x53')][_0xa8a9('0x47')](_0x254134,{'include':[{'model':db[_0xa8a9('0x56')],'as':_0xa8a9('0x59')}],'raw':!![],'transaction':_0x29a729});});})[_0xa8a9('0x26')](function(){return _0x9c2873;});}});});});}})[_0xa8a9('0x26')](respondWithResult(_0x4b8792,0xc9))[_0xa8a9('0x42')](handleError(_0x4b8792,null));};exports['update']=function(_0x2ab7e3,_0x577ccf){if(_0x2ab7e3[_0xa8a9('0x48')]['id']){delete _0x2ab7e3['body']['id'];}return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x2ab7e3[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x577ccf,null))['then'](saveUpdates(_0x2ab7e3[_0xa8a9('0x48')],null))['then'](respondWithResult(_0x577ccf,null))[_0xa8a9('0x42')](handleError(_0x577ccf,null));};exports[_0xa8a9('0x27')]=function(_0x1e2d1a,_0x34a659){return db['UserProfile'][_0xa8a9('0x4b')]({'where':{'id':_0x1e2d1a[_0xa8a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x34a659,null))[_0xa8a9('0x26')](removeEntity(_0x34a659,null))['catch'](handleError(_0x34a659,null));};exports[_0xa8a9('0x5a')]=function(_0x21d056,_0x41869d){return db[_0xa8a9('0x2b')]['describe']()[_0xa8a9('0x26')](respondWithResult(_0x41869d,null))[_0xa8a9('0x42')](handleError(_0x41869d,null));};exports[_0xa8a9('0x5b')]=function(_0x37384f,_0x37acd4){var _0x3877a2=_0x37384f[_0xa8a9('0x48')];return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x37384f[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x37acd4,null))[_0xa8a9('0x26')](function(_0x291927){if(_0x291927){return db['sequelize'][_0xa8a9('0x52')](function(_0x232b0d){return db['UserProfileSection'][_0xa8a9('0x27')]({'where':{'userProfileId':_0x37384f[_0xa8a9('0x44')]['id'],'sectionId':_[_0xa8a9('0x2f')](_0x3877a2,function(_0x5eb04e){return _0x5eb04e['sectionId'];})},'transaction':_0x232b0d})['then'](function(){var _0x1c4ee1=_['map'](_0x3877a2,function(_0x2b25e7){_0x2b25e7[_0xa8a9('0x58')]=_0x37384f[_0xa8a9('0x44')]['id'];return _0x2b25e7;});var _0x2b9dd0=[];return BPromise['each'](_0x1c4ee1,function(_0x1ac9e7){return db[_0xa8a9('0x53')][_0xa8a9('0x47')](_0x1ac9e7,{'include':[{'model':db['UserProfileResource'],'as':_0xa8a9('0x59')}],'raw':!![],'transaction':_0x232b0d})[_0xa8a9('0x26')](function(_0x16b7a9){_0x2b9dd0[_0xa8a9('0x5c')](_0x16b7a9[_0xa8a9('0x4c')]({'plain':!![]}));});})[_0xa8a9('0x26')](function(){return _0x2b9dd0;});});});}})[_0xa8a9('0x26')](function(_0x117c72){return _0x117c72;})['then'](respondWithResult(_0x37acd4,null))[_0xa8a9('0x42')](handleError(_0x37acd4,null));};exports[_0xa8a9('0x5d')]=function(_0x3e129d,_0x154724){var _0x836e83;return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x3e129d[_0xa8a9('0x44')]['id']},'attributes':['id',_0xa8a9('0x29')]})[_0xa8a9('0x26')](handleEntityNotFound(_0x154724,null))['then'](function(_0x234c1e){if(_0x234c1e){_0x836e83=_0x234c1e;return db[_0xa8a9('0x53')][_0xa8a9('0x27')]({'where':{'userProfileId':_0x3e129d[_0xa8a9('0x44')]['id'],'sectionId':_0x3e129d[_0xa8a9('0x31')][_0xa8a9('0x5e')]}});}})[_0xa8a9('0x26')](function(){return _0x836e83;})[_0xa8a9('0x26')](respondWithStatusCode(_0x154724,null))[_0xa8a9('0x42')](handleError(_0x154724,null));};exports[_0xa8a9('0x5f')]=function(_0x5a593,_0x1b5925){var _0x105bbf=[];var _0x45836e=[];return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x5a593[_0xa8a9('0x44')]['id']},'raw':!![]})['then'](function(_0x4db23e){_0x105bbf=_['filter'](_0x4db23e,function(_0x2e05ae){return _0x2e05ae[_0xa8a9('0x60')]===0x1||_[_0xa8a9('0x61')]([0x3eb,0x709],_0x2e05ae['sectionId']);});if(!_['isEmpty'](_0x105bbf)){return _['map'](_0x105bbf,function(_0xc6542e){return _0xc6542e[_0xa8a9('0x57')];});}else{return;}})['then'](function(_0x595636){if(_0x595636)_0x45836e=_0x595636;if(_[_0xa8a9('0x61')](_0x45836e,0x64)){var _0x1a718f=_[_0xa8a9('0x4b')](_0x105bbf,{'sectionId':0x64});return hasDefaultDashboard(_0x1a718f)[_0xa8a9('0x26')](function(_0x418107){return _[_0xa8a9('0x2f')](_0x105bbf,function(_0x537c4a){if(_0x537c4a[_0xa8a9('0x57')]===0x64){_0x537c4a['subsections']=_0x418107;}return _0x537c4a;});});}else{return;}})['then'](function(_0x5dc5e4){if(_0x5dc5e4)_0x105bbf=_0x5dc5e4;if(_[_0xa8a9('0x61')](_0x45836e,0x3eb)){var _0x46938b=_[_0xa8a9('0x4b')](_0x105bbf,{'sectionId':0x3eb});return getCustomDashboards(_0x46938b)[_0xa8a9('0x26')](function(_0x2b0b15){return _[_0xa8a9('0x2f')](_0x105bbf,function(_0x4796ab){if(_0x46938b[_0xa8a9('0x60')]){if(_0x4796ab['sectionId']===0x3eb){_0x4796ab[_0xa8a9('0x62')]=_0x2b0b15;}}else{if(_0x4796ab[_0xa8a9('0x57')]===0x64){_0x4796ab[_0xa8a9('0x62')]=_0x2b0b15;}}return _0x4796ab;});});}else{return;}})['then'](function(_0x4cec72){if(_0x4cec72)_0x105bbf=_0x4cec72;if(_['includes'](_0x45836e,0x709)){var _0xcc9c62=_[_0xa8a9('0x4b')](_0x105bbf,{'sectionId':0x709});return getPlugins(_0xcc9c62)[_0xa8a9('0x26')](function(_0x2e12c6){if(_0xcc9c62['enabled']){return _[_0xa8a9('0x2f')](_0x105bbf,function(_0x57ca67){if(_0x57ca67['sectionId']===0x709){_0x57ca67['subsections']=_0x2e12c6;}return _0x57ca67;});}else{var _0x5b41b5={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e12c6};var _0x313f6e=_[_0xa8a9('0x2f')](_0x105bbf);_0x313f6e[_0xa8a9('0x5c')](_0x5b41b5);return _0x313f6e;}});}else{return;}})[_0xa8a9('0x26')](function(_0x341e64){if(_0x341e64)_0x105bbf=_0x341e64;return _['filter'](_0x105bbf,[_0xa8a9('0x60'),0x1]);})[_0xa8a9('0x26')](respondWithResult(_0x1b5925,null))['catch'](handleError(_0x1b5925,null));};function hasDefaultDashboard(_0x57aa43){var _0x165a1c=[0x65];return new BPromise(function(_0x69452,_0x5f9c83){try{if(_0x57aa43[_0xa8a9('0x55')]){_0x69452(_0x165a1c);}else{return db[_0xa8a9('0x56')][_0xa8a9('0x63')]({'where':{'sectionId':_0x57aa43['id']},'raw':!![]})[_0xa8a9('0x26')](function(_0x48712d){_0x48712d?_0x69452(_0x165a1c):_0x69452();});}}catch(_0x13739b){_0x5f9c83(_0x13739b);}});}function getCustomDashboards(_0x3930a0){var _0x476716=[];return new BPromise(function(_0x258735,_0x2ff2a2){try{if(_0x3930a0[_0xa8a9('0x55')]){return db[_0xa8a9('0x64')][_0xa8a9('0x40')]({'raw':!![]})[_0xa8a9('0x26')](function(_0x412c68){_0x412c68[_0xa8a9('0x65')](function(_0x3a9e9f){_0x476716['push'](_0x3a9e9f['id']+0x1869f);});_0x258735(_0x476716);});}else{return db[_0xa8a9('0x56')][_0xa8a9('0x40')]({'where':{'sectionId':_0x3930a0['id']},'raw':!![]})[_0xa8a9('0x26')](function(_0x2ee59c){_0x2ee59c[_0xa8a9('0x65')](function(_0x55549){_0x476716[_0xa8a9('0x5c')](_0x55549[_0xa8a9('0x66')]+0x1869f);});_0x258735(_0x476716);});}}catch(_0x13d629){_0x2ff2a2(_0x13d629);}});}function getPlugins(_0x4fbdcb){var _0x47d134=[];return new BPromise(function(_0x349057,_0x3a6cac){try{if(_0x4fbdcb[_0xa8a9('0x55')]){return db[_0xa8a9('0x67')]['findAll']({'raw':!![]})[_0xa8a9('0x26')](function(_0x42618a){_0x42618a['forEach'](function(_0x3e7ca8){_0x47d134[_0xa8a9('0x5c')](_0x3e7ca8['id']+0x15b38);});_0x349057(_0x47d134);});}else{return db[_0xa8a9('0x56')]['findAll']({'where':{'sectionId':_0x4fbdcb['id']},'raw':!![]})['then'](function(_0x138043){_0x138043[_0xa8a9('0x65')](function(_0x2a0ff1){_0x47d134[_0xa8a9('0x5c')](_0x2a0ff1['resourceId']+0x15b38);});_0x349057(_0x47d134);});}}catch(_0x4e63db){_0x3a6cac(_0x4e63db);}});}exports[_0xa8a9('0x68')]=function(_0x5ca60c,_0x5dcc1d){return db[_0xa8a9('0x2b')]['find']({'where':{'id':_0x5ca60c[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x5dcc1d,null))[_0xa8a9('0x26')](function(_0x163437){if(_0x163437){return db[_0xa8a9('0x51')][_0xa8a9('0x52')](function(_0x15c6c7){return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x5ca60c[_0xa8a9('0x44')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x18785d){if(_0x18785d){return db[_0xa8a9('0x53')][_0xa8a9('0x27')]({'where':{'userProfileId':_0x5ca60c[_0xa8a9('0x44')]['id'],'id':_[_0xa8a9('0x2f')](_0x18785d,function(_0x34efd5){return _0x34efd5['id'];})},'transaction':_0x15c6c7});}})[_0xa8a9('0x26')](function(_0x172774){var _0x17fa46=_[_0xa8a9('0x2f')](_0x5ca60c[_0xa8a9('0x48')],function(_0x2e1384){_0x2e1384[_0xa8a9('0x58')]=_0x5ca60c[_0xa8a9('0x44')]['id'];return _0x2e1384;});return db[_0xa8a9('0x53')]['bulkCreate'](_0x17fa46,{'raw':!![],'transaction':_0x15c6c7});})[_0xa8a9('0x26')](function(_0x12e58c){var _0x2a821d=_['filter'](_[_0xa8a9('0x2f')](_0x12e58c,function(_0x5ad422){return _0x5ad422[_0xa8a9('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x2a821d){return db[_0xa8a9('0x53')][_0xa8a9('0x40')]({'where':{'userProfileId':_0x5ca60c[_0xa8a9('0x44')]['id'],'sectionId':_[_0xa8a9('0x2f')](_0x2a821d,function(_0x431197){return _0x431197[_0xa8a9('0x57')];})},'attributes':['id',_0xa8a9('0x57')],'raw':!![]})[_0xa8a9('0x26')](function(_0x32efa5){var _0x5b4568=_[_0xa8a9('0x2f')](_0x5ca60c[_0xa8a9('0x48')],function(_0x4e45df){_0x4e45df[_0xa8a9('0x58')]=_0x5ca60c[_0xa8a9('0x44')]['id'];return _0x4e45df;});return db[_0xa8a9('0x56')]['bulkCreate'](_0x5b4568,{'raw':!![],'transaction':_0x15c6c7});});}})['catch'](handleError(_0x5dcc1d,null));});}})[_0xa8a9('0x26')](function(_0x5c8146){var _0x414fe0=_['map'](_0x5c8146,function(_0x5bc38a){return _0x5bc38a[_0xa8a9('0x4c')]({'plain':!![]});});})[_0xa8a9('0x26')](respondWithResult(_0x5dcc1d,null))[_0xa8a9('0x42')](handleError(_0x5dcc1d,null));};exports['removeResources']=function(_0x3b3d82,_0x296d33,_0x9b64d3){return db['UserProfile'][_0xa8a9('0x4b')]({'where':{'id':_0x3b3d82[_0xa8a9('0x44')]['id']}})[_0xa8a9('0x26')](handleEntityNotFound(_0x296d33,null))[_0xa8a9('0x26')](function(_0x3244e7){if(_0x3244e7){return _0x3244e7[_0xa8a9('0x69')](_0x3b3d82[_0xa8a9('0x31')]['ids']);}})[_0xa8a9('0x26')](respondWithStatusCode(_0x296d33,null))[_0xa8a9('0x42')](handleError(_0x296d33,null));};exports['getResources']=function(_0x3ba241,_0x2f7ba6){var _0x5e098d={};if(!_0x3ba241['query'][_0xa8a9('0x6a')])throw new Error(_0xa8a9('0x6b'));if(!_0x3ba241['query'][_0xa8a9('0x36')]('nolimit')){_0x5e098d['limit']=qs[_0xa8a9('0x21')](_0x3ba241[_0xa8a9('0x31')]['limit']);_0x5e098d[_0xa8a9('0x23')]=qs[_0xa8a9('0x23')](_0x3ba241['query'][_0xa8a9('0x23')]);}return db[_0xa8a9('0x2b')][_0xa8a9('0x4b')]({'where':{'id':_0x3ba241['params']['id']}})[_0xa8a9('0x26')](function(_0x241585){if(!_0x241585)throw new Error(_0xa8a9('0x6c')+_0x3ba241[_0xa8a9('0x44')]['id']);return db[_0xa8a9('0x2b')][_0xa8a9('0x6d')](_0x3ba241);})[_0xa8a9('0x26')](respondWithFilteredResult(_0x2f7ba6,_0x5e098d))[_0xa8a9('0x42')](handleError(_0x2f7ba6,null));}; \ No newline at end of file +var _0x7292=['Resources','describe','addSections','push','ids','getSections','includes','isEmpty','enabled','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','transaction','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','clone','get','omit','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','createdAt','userProfileId'];(function(_0xaf67d,_0xbe6483){var _0x234d94=function(_0x5cfa40){while(--_0x5cfa40){_0xaf67d['push'](_0xaf67d['shift']());}};_0x234d94(++_0xbe6483);}(_0x7292,0x107));var _0x2729=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7292[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x2729('0x0'));var rimraf=require(_0x2729('0x1'));var zipdir=require(_0x2729('0x2'));var jsonpatch=require(_0x2729('0x3'));var rp=require(_0x2729('0x4'));var moment=require(_0x2729('0x5'));var BPromise=require(_0x2729('0x6'));var Mustache=require('mustache');var util=require(_0x2729('0x7'));var path=require(_0x2729('0x8'));var sox=require(_0x2729('0x9'));var csv=require(_0x2729('0xa'));var ejs=require(_0x2729('0xb'));var fs=require('fs');var fs_extra=require(_0x2729('0xc'));var _=require(_0x2729('0xd'));var squel=require(_0x2729('0xe'));var crypto=require(_0x2729('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2729('0xa'));var querystring=require(_0x2729('0x10'));var Papa=require('papaparse');var Redis=require(_0x2729('0x11'));var authService=require(_0x2729('0x12'));var qs=require(_0x2729('0x13'));var as=require(_0x2729('0x14'));var hardwareService=require(_0x2729('0x15'));var logger=require(_0x2729('0x16'))(_0x2729('0x17'));var utils=require(_0x2729('0x18'));var config=require(_0x2729('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2729('0x1a'))['db'];config[_0x2729('0x1b')]=_[_0x2729('0x1c')](config['redis'],{'host':_0x2729('0x1d'),'port':0x18eb});var socket=require(_0x2729('0x1e'))(new Redis(config[_0x2729('0x1b')]));require(_0x2729('0x1f'))[_0x2729('0x20')](socket);function respondWithStatusCode(_0x3b1e17,_0x3d3d37){_0x3d3d37=_0x3d3d37||0xcc;return function(_0x21a858){if(_0x21a858){return _0x3b1e17['sendStatus'](_0x3d3d37);}return _0x3b1e17[_0x2729('0x21')](_0x3d3d37)[_0x2729('0x22')]();};}function respondWithResult(_0x235e71,_0x5d7e36){_0x5d7e36=_0x5d7e36||0xc8;return function(_0x17090d){if(_0x17090d){return _0x235e71['status'](_0x5d7e36)['json'](_0x17090d);}};}function respondWithFilteredResult(_0x24ee53,_0x500e28){return function(_0x41623f){if(_0x41623f){var _0x5dafac=typeof _0x500e28[_0x2729('0x23')]==='undefined'&&typeof _0x500e28['limit']===_0x2729('0x24');var _0x37425e=_0x41623f[_0x2729('0x25')];var _0xbdcfd3=_0x5dafac?0x0:_0x500e28[_0x2729('0x23')];var _0x2f73b2=_0x5dafac?_0x41623f[_0x2729('0x25')]:_0x500e28[_0x2729('0x23')]+_0x500e28['limit'];var _0x32c63a;if(_0x2f73b2>=_0x37425e){_0x2f73b2=_0x37425e;_0x32c63a=0xc8;}else{_0x32c63a=0xce;}_0x24ee53[_0x2729('0x21')](_0x32c63a);return _0x24ee53[_0x2729('0x26')](_0x2729('0x27'),_0xbdcfd3+'-'+_0x2f73b2+'/'+_0x37425e)['json'](_0x41623f);}return null;};}function patchUpdates(_0x193ca3){return function(_0x2f3e9c){try{jsonpatch[_0x2729('0x28')](_0x2f3e9c,_0x193ca3,!![]);}catch(_0x5629f6){return BPromise['reject'](_0x5629f6);}return _0x2f3e9c[_0x2729('0x29')]();};}function saveUpdates(_0x18bd4f,_0x598770){return function(_0x20e906){if(_0x20e906){return _0x20e906[_0x2729('0x2a')](_0x18bd4f)[_0x2729('0x2b')](function(_0x379014){return _0x379014;});}return null;};}function removeEntity(_0x37ab53,_0x3c7df0){return function(_0x3cb1c8){if(_0x3cb1c8){return _0x3cb1c8[_0x2729('0x2c')]()['then'](function(){_0x37ab53[_0x2729('0x21')](0xcc)[_0x2729('0x22')]();});}};}function handleEntityNotFound(_0x51cfe5,_0x1d2bf7){return function(_0x5b8e43){if(!_0x5b8e43){_0x51cfe5['sendStatus'](0x194);}return _0x5b8e43;};}function handleError(_0x5de957,_0x4843d0){_0x4843d0=_0x4843d0||0x1f4;return function(_0x521d90){logger[_0x2729('0x2d')](_0x521d90[_0x2729('0x2e')]);if(_0x521d90['name']){delete _0x521d90[_0x2729('0x2f')];}_0x5de957[_0x2729('0x21')](_0x4843d0)[_0x2729('0x30')](_0x521d90);};}exports[_0x2729('0x31')]=function(_0x578a94,_0x1a8407){var _0x68cd8d={},_0x17a349={},_0x5073bb={'count':0x0,'rows':[]};var _0x5b5e38=_[_0x2729('0x32')](db[_0x2729('0x33')][_0x2729('0x34')],function(_0xe3feda){return{'name':_0xe3feda['fieldName'],'type':_0xe3feda[_0x2729('0x35')][_0x2729('0x36')]};});_0x17a349['model']=_[_0x2729('0x32')](_0x5b5e38,_0x2729('0x2f'));_0x17a349[_0x2729('0x37')]=_[_0x2729('0x38')](_0x578a94[_0x2729('0x37')]);_0x17a349['filters']=_[_0x2729('0x39')](_0x17a349[_0x2729('0x3a')],_0x17a349[_0x2729('0x37')]);_0x68cd8d[_0x2729('0x3b')]=_[_0x2729('0x39')](_0x17a349[_0x2729('0x3a')],qs[_0x2729('0x3c')](_0x578a94['query'][_0x2729('0x3c')]));_0x68cd8d[_0x2729('0x3b')]=_0x68cd8d['attributes'][_0x2729('0x3d')]?_0x68cd8d['attributes']:_0x17a349['model'];if(!_0x578a94[_0x2729('0x37')][_0x2729('0x3e')](_0x2729('0x3f'))){_0x68cd8d['limit']=qs[_0x2729('0x40')](_0x578a94[_0x2729('0x37')]['limit']);_0x68cd8d[_0x2729('0x23')]=qs[_0x2729('0x23')](_0x578a94[_0x2729('0x37')][_0x2729('0x23')]);}_0x68cd8d[_0x2729('0x41')]=qs[_0x2729('0x42')](_0x578a94['query']['sort']);_0x68cd8d[_0x2729('0x43')]=qs['filters'](_[_0x2729('0x44')](_0x578a94['query'],_0x17a349[_0x2729('0x45')]),_0x5b5e38);if(_0x578a94['query'][_0x2729('0x46')]){_0x68cd8d['where']=_[_0x2729('0x47')](_0x68cd8d[_0x2729('0x43')],{'$or':_[_0x2729('0x32')](_0x5b5e38,function(_0x4e8a5e){if(_0x4e8a5e['type']!==_0x2729('0x48')){var _0x515177={};_0x515177[_0x4e8a5e[_0x2729('0x2f')]]={'$like':'%'+_0x578a94['query']['filter']+'%'};return _0x515177;}})});}_0x68cd8d=_[_0x2729('0x47')]({},_0x68cd8d,_0x578a94['options']);var _0x6c6857={'where':_0x68cd8d['where']};return db[_0x2729('0x33')][_0x2729('0x25')](_0x6c6857)[_0x2729('0x2b')](function(_0xe69566){_0x5073bb[_0x2729('0x25')]=_0xe69566;if(_0x578a94['query'][_0x2729('0x49')]){_0x68cd8d[_0x2729('0x4a')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x68cd8d);})[_0x2729('0x2b')](function(_0x45acf3){_0x5073bb[_0x2729('0x4b')]=_0x45acf3;return _0x5073bb;})[_0x2729('0x2b')](respondWithFilteredResult(_0x1a8407,_0x68cd8d))[_0x2729('0x4c')](handleError(_0x1a8407,null));};exports[_0x2729('0x4d')]=function(_0xb76cc3,_0x175312){var _0x392733={'raw':![],'where':{'id':_0xb76cc3[_0x2729('0x4e')]['id']}},_0x1c4f42={};_0x1c4f42[_0x2729('0x3a')]=_[_0x2729('0x38')](db[_0x2729('0x33')]['rawAttributes']);_0x1c4f42[_0x2729('0x37')]=_[_0x2729('0x38')](_0xb76cc3[_0x2729('0x37')]);_0x1c4f42[_0x2729('0x45')]=_['intersection'](_0x1c4f42[_0x2729('0x3a')],_0x1c4f42[_0x2729('0x37')]);_0x392733[_0x2729('0x3b')]=_['intersection'](_0x1c4f42['model'],qs[_0x2729('0x3c')](_0xb76cc3[_0x2729('0x37')]['fields']));_0x392733['attributes']=_0x392733[_0x2729('0x3b')][_0x2729('0x3d')]?_0x392733[_0x2729('0x3b')]:_0x1c4f42[_0x2729('0x3a')];if(_0xb76cc3['query'][_0x2729('0x49')]){_0x392733[_0x2729('0x4a')]=[{'all':!![]}];}_0x392733=_['merge']({},_0x392733,_0xb76cc3[_0x2729('0x4f')]);return db['UserProfile'][_0x2729('0x50')](_0x392733)[_0x2729('0x2b')](handleEntityNotFound(_0x175312,null))['then'](respondWithResult(_0x175312,null))[_0x2729('0x4c')](handleError(_0x175312,null));};exports['create']=function(_0x5d5c9d,_0x1da99d){return db['UserProfile'][_0x2729('0x51')](_0x5d5c9d[_0x2729('0x52')],{})[_0x2729('0x2b')](respondWithResult(_0x1da99d,0xc9))[_0x2729('0x4c')](handleError(_0x1da99d,null));};exports[_0x2729('0x53')]=function(_0x3f6fe5,_0x515515){var _0x3ef00c={'where':{'id':_0x3f6fe5[_0x2729('0x4e')]['id']}},_0x56bfba={};_0x56bfba[_0x2729('0x3a')]=_[_0x2729('0x38')](db['UserProfile'][_0x2729('0x34')]);_0x3ef00c[_0x2729('0x3b')]=_[_0x2729('0x39')](_0x56bfba[_0x2729('0x3a')],qs[_0x2729('0x3c')](_0x3f6fe5[_0x2729('0x37')][_0x2729('0x3c')]));_0x3ef00c['attributes']=_0x3ef00c[_0x2729('0x3b')]['length']?_0x3ef00c[_0x2729('0x3b')]:_0x56bfba['model'];if(_0x3f6fe5['query']['includeAll']){_0x3ef00c[_0x2729('0x4a')]=[{'all':!![]}];}_0x3ef00c=_[_0x2729('0x47')]({},_0x3ef00c,_0x3f6fe5[_0x2729('0x4f')]);return db[_0x2729('0x33')][_0x2729('0x50')](_0x3ef00c)[_0x2729('0x2b')](handleEntityNotFound(_0x515515,null))[_0x2729('0x2b')](function(_0x2fb141){if(_0x2fb141){var _0x598d68=_0x2fb141[_0x2729('0x54')]({'plain':!![]});_0x598d68=qs[_0x2729('0x55')](_0x598d68,['id','createdAt',_0x2729('0x56'),_0x2729('0x57')]);_0x3f6fe5[_0x2729('0x52')]=_[_0x2729('0x55')](_0x3f6fe5[_0x2729('0x52')],['id','createdAt',_0x2729('0x56')]);return db[_0x2729('0x58')]['transaction'](function(_0x33d6ac){return db[_0x2729('0x33')]['create'](_['merge'](_0x598d68,_0x3f6fe5[_0x2729('0x52')]),{'include':_0x3f6fe5[_0x2729('0x37')][_0x2729('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x33d6ac})[_0x2729('0x2b')](function(_0x4ed408){var _0x215d5f=_0x4ed408[_0x2729('0x54')]({'plain':!![]});return db[_0x2729('0x59')][_0x2729('0x5a')]({'where':{'userProfileId':_0x3f6fe5[_0x2729('0x4e')]['id']},'raw':!![]})['then'](function(_0xddfb2f){if(_0xddfb2f){return BPromise[_0x2729('0x5b')](_0xddfb2f,function(_0x114b82){return new BPromise(function(_0x4dd3ef,_0x1447c7){if(_0x114b82[_0x2729('0x5c')]===null||_0x114b82['autoAssociation']===0x1)_0x4dd3ef(null);return db[_0x2729('0x5d')][_0x2729('0x5a')]({'where':{'sectionId':_0x114b82['id']},'raw':!![]})[_0x2729('0x2b')](function(_0x2b3740){var _0x5f3ec4=_['map'](_0x2b3740,function(_0x4abe44){return qs['omit'](_0x4abe44,['id','createdAt',_0x2729('0x56'),_0x2729('0x5e')]);});_0x4dd3ef(_0x5f3ec4);})['catch'](function(_0x16e08e){_0x1447c7(_0x16e08e);});})[_0x2729('0x2b')](function(_0x369cfd){var _0x3378ad=qs['omit'](_0x114b82,['id',_0x2729('0x5f'),_0x2729('0x56')]);_0x3378ad[_0x2729('0x60')]=_0x215d5f['id'];if(_0x369cfd)_0x3378ad[_0x2729('0x61')]=_0x369cfd;return _0x3378ad;})['then'](function(_0x11944d){return db[_0x2729('0x59')]['create'](_0x11944d,{'include':[{'model':db[_0x2729('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x33d6ac});});})[_0x2729('0x2b')](function(){return _0x215d5f;});}});});});}})[_0x2729('0x2b')](respondWithResult(_0x515515,0xc9))['catch'](handleError(_0x515515,null));};exports[_0x2729('0x2a')]=function(_0x581616,_0x1a6211){if(_0x581616[_0x2729('0x52')]['id']){delete _0x581616[_0x2729('0x52')]['id'];}return db[_0x2729('0x33')][_0x2729('0x50')]({'where':{'id':_0x581616['params']['id']}})[_0x2729('0x2b')](handleEntityNotFound(_0x1a6211,null))[_0x2729('0x2b')](saveUpdates(_0x581616[_0x2729('0x52')],null))[_0x2729('0x2b')](respondWithResult(_0x1a6211,null))[_0x2729('0x4c')](handleError(_0x1a6211,null));};exports['destroy']=function(_0x5079d9,_0x164622){return db[_0x2729('0x33')]['find']({'where':{'id':_0x5079d9['params']['id']}})[_0x2729('0x2b')](handleEntityNotFound(_0x164622,null))['then'](removeEntity(_0x164622,null))[_0x2729('0x4c')](handleError(_0x164622,null));};exports[_0x2729('0x62')]=function(_0x2309eb,_0xef4dcf){return db[_0x2729('0x33')][_0x2729('0x62')]()[_0x2729('0x2b')](respondWithResult(_0xef4dcf,null))[_0x2729('0x4c')](handleError(_0xef4dcf,null));};exports[_0x2729('0x63')]=function(_0x23264f,_0x1df04a){var _0x38cccc=_0x23264f[_0x2729('0x52')];return db[_0x2729('0x33')][_0x2729('0x50')]({'where':{'id':_0x23264f[_0x2729('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1df04a,null))['then'](function(_0x353adf){if(_0x353adf){return db['sequelize']['transaction'](function(_0x339df6){return db[_0x2729('0x59')][_0x2729('0x2c')]({'where':{'userProfileId':_0x23264f[_0x2729('0x4e')]['id'],'sectionId':_[_0x2729('0x32')](_0x38cccc,function(_0x37fcc4){return _0x37fcc4[_0x2729('0x5e')];})},'transaction':_0x339df6})[_0x2729('0x2b')](function(){var _0x1631a9=_[_0x2729('0x32')](_0x38cccc,function(_0x17ae21){_0x17ae21[_0x2729('0x60')]=_0x23264f[_0x2729('0x4e')]['id'];return _0x17ae21;});var _0x1078cc=[];return BPromise[_0x2729('0x5b')](_0x1631a9,function(_0x525029){return db[_0x2729('0x59')][_0x2729('0x51')](_0x525029,{'include':[{'model':db[_0x2729('0x5d')],'as':_0x2729('0x61')}],'raw':!![],'transaction':_0x339df6})[_0x2729('0x2b')](function(_0x494b4e){_0x1078cc[_0x2729('0x64')](_0x494b4e[_0x2729('0x54')]({'plain':!![]}));});})['then'](function(){return _0x1078cc;});});});}})[_0x2729('0x2b')](function(_0x4afd0d){return _0x4afd0d;})[_0x2729('0x2b')](respondWithResult(_0x1df04a,null))[_0x2729('0x4c')](handleError(_0x1df04a,null));};exports['removeSections']=function(_0xbe6e99,_0x568747){var _0x49b8e0;return db[_0x2729('0x33')][_0x2729('0x50')]({'where':{'id':_0xbe6e99[_0x2729('0x4e')]['id']},'attributes':['id',_0x2729('0x2f')]})['then'](handleEntityNotFound(_0x568747,null))[_0x2729('0x2b')](function(_0x433d9c){if(_0x433d9c){_0x49b8e0=_0x433d9c;return db['UserProfileSection'][_0x2729('0x2c')]({'where':{'userProfileId':_0xbe6e99[_0x2729('0x4e')]['id'],'sectionId':_0xbe6e99[_0x2729('0x37')][_0x2729('0x65')]}});}})[_0x2729('0x2b')](function(){return _0x49b8e0;})[_0x2729('0x2b')](respondWithStatusCode(_0x568747,null))[_0x2729('0x4c')](handleError(_0x568747,null));};exports[_0x2729('0x66')]=function(_0x1e605c,_0x338470){var _0x411a1c=[];var _0x5ce91a=[];return db['UserProfileSection'][_0x2729('0x5a')]({'where':{'userProfileId':_0x1e605c['params']['id']},'raw':!![]})[_0x2729('0x2b')](function(_0x13786a){_0x411a1c=_[_0x2729('0x46')](_0x13786a,function(_0x39d15b){return _0x39d15b['enabled']===0x1||_[_0x2729('0x67')]([0x3eb,0x709],_0x39d15b[_0x2729('0x5e')]);});if(!_[_0x2729('0x68')](_0x411a1c)){return _['map'](_0x411a1c,function(_0x16fc79){return _0x16fc79[_0x2729('0x5e')];});}else{return;}})[_0x2729('0x2b')](function(_0x2c012c){if(_0x2c012c)_0x5ce91a=_0x2c012c;if(_[_0x2729('0x67')](_0x5ce91a,0x64)){var _0x55928f=_[_0x2729('0x50')](_0x411a1c,{'sectionId':0x64});return hasDefaultDashboard(_0x55928f)[_0x2729('0x2b')](function(_0x1cbb58){return _[_0x2729('0x32')](_0x411a1c,function(_0x36743d){if(_0x36743d[_0x2729('0x5e')]===0x64){_0x36743d['subsections']=_0x1cbb58;}return _0x36743d;});});}else{return;}})[_0x2729('0x2b')](function(_0x9aa0c9){if(_0x9aa0c9)_0x411a1c=_0x9aa0c9;if(_[_0x2729('0x67')](_0x5ce91a,0x3eb)){var _0x582f81=_[_0x2729('0x50')](_0x411a1c,{'sectionId':0x3eb});return getCustomDashboards(_0x582f81)[_0x2729('0x2b')](function(_0x1ab825){return _['map'](_0x411a1c,function(_0x6e24cc){if(_0x582f81[_0x2729('0x69')]){if(_0x6e24cc[_0x2729('0x5e')]===0x3eb){_0x6e24cc['subsections']=_0x1ab825;}}else{if(_0x6e24cc['sectionId']===0x64){_0x6e24cc[_0x2729('0x6a')]=_0x1ab825;}}return _0x6e24cc;});});}else{return;}})[_0x2729('0x2b')](function(_0x25b963){if(_0x25b963)_0x411a1c=_0x25b963;if(_[_0x2729('0x67')](_0x5ce91a,0x709)){var _0x26090d=_[_0x2729('0x50')](_0x411a1c,{'sectionId':0x709});return getPlugins(_0x26090d)[_0x2729('0x2b')](function(_0x3b7076){if(_0x26090d[_0x2729('0x69')]){return _[_0x2729('0x32')](_0x411a1c,function(_0x2bcb35){if(_0x2bcb35['sectionId']===0x709){_0x2bcb35[_0x2729('0x6a')]=_0x3b7076;}return _0x2bcb35;});}else{var _0x2204c6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3b7076};var _0xae8522=_['map'](_0x411a1c);_0xae8522['push'](_0x2204c6);return _0xae8522;}});}else{return;}})[_0x2729('0x2b')](function(_0x55fed0){if(_0x55fed0)_0x411a1c=_0x55fed0;return _['filter'](_0x411a1c,[_0x2729('0x69'),0x1]);})['then'](respondWithResult(_0x338470,null))[_0x2729('0x4c')](handleError(_0x338470,null));};function hasDefaultDashboard(_0x100a74){var _0x14a077=[0x65];return new BPromise(function(_0x2dc354,_0x1fb205){try{if(_0x100a74[_0x2729('0x5c')]){_0x2dc354(_0x14a077);}else{return db[_0x2729('0x5d')][_0x2729('0x6b')]({'where':{'sectionId':_0x100a74['id']},'raw':!![]})[_0x2729('0x2b')](function(_0x39f4fc){_0x39f4fc?_0x2dc354(_0x14a077):_0x2dc354();});}}catch(_0x184388){_0x1fb205(_0x184388);}});}function getCustomDashboards(_0x595839){var _0x4e52a2=[];return new BPromise(function(_0x108048,_0x55b582){try{if(_0x595839[_0x2729('0x5c')]){return db[_0x2729('0x6c')][_0x2729('0x5a')]({'raw':!![]})[_0x2729('0x2b')](function(_0x59b84b){_0x59b84b[_0x2729('0x6d')](function(_0xe0c10f){_0x4e52a2[_0x2729('0x64')](_0xe0c10f['id']+0x1869f);});_0x108048(_0x4e52a2);});}else{return db[_0x2729('0x5d')][_0x2729('0x5a')]({'where':{'sectionId':_0x595839['id']},'raw':!![]})['then'](function(_0x33f590){_0x33f590['forEach'](function(_0x14a987){_0x4e52a2[_0x2729('0x64')](_0x14a987[_0x2729('0x6e')]+0x1869f);});_0x108048(_0x4e52a2);});}}catch(_0x3dea3d){_0x55b582(_0x3dea3d);}});}function getPlugins(_0xff589a){var _0x174822=[];return new BPromise(function(_0x361574,_0x39c211){try{if(_0xff589a[_0x2729('0x5c')]){return db[_0x2729('0x6f')][_0x2729('0x5a')]({'raw':!![]})[_0x2729('0x2b')](function(_0x59b820){_0x59b820['forEach'](function(_0x401564){_0x174822[_0x2729('0x64')](_0x401564['id']+0x15b38);});_0x361574(_0x174822);});}else{return db['UserProfileResource'][_0x2729('0x5a')]({'where':{'sectionId':_0xff589a['id']},'raw':!![]})['then'](function(_0x2d9206){_0x2d9206[_0x2729('0x6d')](function(_0x70b924){_0x174822[_0x2729('0x64')](_0x70b924['resourceId']+0x15b38);});_0x361574(_0x174822);});}}catch(_0x5c7807){_0x39c211(_0x5c7807);}});}exports[_0x2729('0x70')]=function(_0x26c254,_0x3f4680){return db['UserProfile']['find']({'where':{'id':_0x26c254[_0x2729('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3f4680,null))[_0x2729('0x2b')](function(_0x220f3f){if(_0x220f3f){return db['sequelize'][_0x2729('0x71')](function(_0x570756){return db[_0x2729('0x59')][_0x2729('0x5a')]({'where':{'userProfileId':_0x26c254[_0x2729('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0x2729('0x2b')](function(_0x1b215c){if(_0x1b215c){return db[_0x2729('0x59')][_0x2729('0x2c')]({'where':{'userProfileId':_0x26c254[_0x2729('0x4e')]['id'],'id':_[_0x2729('0x32')](_0x1b215c,function(_0x54911a){return _0x54911a['id'];})},'transaction':_0x570756});}})[_0x2729('0x2b')](function(_0x2fd0af){var _0x2a9844=_[_0x2729('0x32')](_0x26c254['body'],function(_0x1f5a64){_0x1f5a64[_0x2729('0x60')]=_0x26c254['params']['id'];return _0x1f5a64;});return db[_0x2729('0x59')][_0x2729('0x72')](_0x2a9844,{'raw':!![],'transaction':_0x570756});})[_0x2729('0x2b')](function(_0x207c7c){var _0x49eabc=_['filter'](_['map'](_0x207c7c,function(_0x42083a){return _0x42083a[_0x2729('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x49eabc){return db[_0x2729('0x59')][_0x2729('0x5a')]({'where':{'userProfileId':_0x26c254[_0x2729('0x4e')]['id'],'sectionId':_[_0x2729('0x32')](_0x49eabc,function(_0x3499bd){return _0x3499bd[_0x2729('0x5e')];})},'attributes':['id',_0x2729('0x5e')],'raw':!![]})[_0x2729('0x2b')](function(_0xf14913){var _0x2fea61=_[_0x2729('0x32')](_0x26c254[_0x2729('0x52')],function(_0x323342){_0x323342[_0x2729('0x60')]=_0x26c254[_0x2729('0x4e')]['id'];return _0x323342;});return db['UserProfileResource'][_0x2729('0x72')](_0x2fea61,{'raw':!![],'transaction':_0x570756});});}})[_0x2729('0x4c')](handleError(_0x3f4680,null));});}})[_0x2729('0x2b')](function(_0x9ce09d){var _0x209126=_[_0x2729('0x32')](_0x9ce09d,function(_0x39c085){return _0x39c085['get']({'plain':!![]});});})[_0x2729('0x2b')](respondWithResult(_0x3f4680,null))[_0x2729('0x4c')](handleError(_0x3f4680,null));};exports[_0x2729('0x73')]=function(_0x58ad07,_0x319ede,_0x528209){return db[_0x2729('0x33')][_0x2729('0x50')]({'where':{'id':_0x58ad07[_0x2729('0x4e')]['id']}})[_0x2729('0x2b')](handleEntityNotFound(_0x319ede,null))[_0x2729('0x2b')](function(_0x5d3bf0){if(_0x5d3bf0){return _0x5d3bf0[_0x2729('0x73')](_0x58ad07[_0x2729('0x37')][_0x2729('0x65')]);}})[_0x2729('0x2b')](respondWithStatusCode(_0x319ede,null))['catch'](handleError(_0x319ede,null));};exports['getResources']=function(_0x5aecf2,_0x583c00){var _0x3c596b={};if(!_0x5aecf2[_0x2729('0x37')][_0x2729('0x74')])throw new Error(_0x2729('0x75'));if(!_0x5aecf2[_0x2729('0x37')][_0x2729('0x3e')](_0x2729('0x3f'))){_0x3c596b[_0x2729('0x40')]=qs[_0x2729('0x40')](_0x5aecf2[_0x2729('0x37')][_0x2729('0x40')]);_0x3c596b[_0x2729('0x23')]=qs['offset'](_0x5aecf2[_0x2729('0x37')][_0x2729('0x23')]);}return db[_0x2729('0x33')][_0x2729('0x50')]({'where':{'id':_0x5aecf2[_0x2729('0x4e')]['id']}})['then'](function(_0x19dda8){if(!_0x19dda8)throw new Error(_0x2729('0x76')+_0x5aecf2[_0x2729('0x4e')]['id']);return db[_0x2729('0x33')][_0x2729('0x77')](_0x5aecf2);})[_0x2729('0x2b')](respondWithFilteredResult(_0x583c00,_0x3c596b))[_0x2729('0x4c')](handleError(_0x583c00,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index eed031f..2f8d5da 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 _0xdeb3=['remove','emit','hook','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x329fb5,_0x28ade7){var _0x51f575=function(_0xb55309){while(--_0xb55309){_0x329fb5['push'](_0x329fb5['shift']());}};_0x51f575(++_0x28ade7);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x3deb('0x0'))['db'][_0x3deb('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3deb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3deb('0x3')};function emitEvent(_0x2e9b78){return function(_0x365134,_0x3114e7,_0x23bc12){UserProfileEvents['emit'](_0x2e9b78+':'+_0x365134['id'],_0x365134);UserProfileEvents[_0x3deb('0x4')](_0x2e9b78,_0x365134);_0x23bc12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x3deb('0x5')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x8579=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8579,0x16c));var _0x9857=function(_0x4afe7c,_0x1d2d4b){_0x4afe7c=_0x4afe7c-0x0;var _0x4c0edc=_0x8579[_0x4afe7c];return _0x4c0edc;};'use strict';var EventEmitter=require(_0x9857('0x0'));var UserProfile=require(_0x9857('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9857('0x2')](0x0);var events={'afterCreate':_0x9857('0x3'),'afterUpdate':_0x9857('0x4'),'afterDestroy':_0x9857('0x5')};function emitEvent(_0x48bc70){return function(_0x48dd34,_0x5ae8ce,_0x4910ae){UserProfileEvents[_0x9857('0x6')](_0x48bc70+':'+_0x48dd34['id'],_0x48dd34);UserProfileEvents[_0x9857('0x6')](_0x48bc70,_0x48dd34);_0x4910ae(null);};}for(var e in events){if(events[_0x9857('0x7')](e)){var event=events[e];UserProfile[_0x9857('0x8')](e,emitEvent(event));}}module[_0x9857('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 5591b35..8cab1c2 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 _0xb016=['SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','Interval','pauses','Sound','Tag','Template','triggers','Trigger','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','field','filter','then','associatedResources','map','catch','value','model','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc'];(function(_0x112c59,_0x2782c9){var _0xc0fb8c=function(_0x52174a){while(--_0x52174a){_0x112c59['push'](_0x112c59['shift']());}};_0xc0fb8c(++_0x2782c9);}(_0xb016,0x159));var _0x6b01=function(_0x26d746,_0x226d1d){_0x26d746=_0x26d746-0x0;var _0x1bcc6a=_0xb016[_0x26d746];return _0x1bcc6a;};'use strict';var _=require(_0x6b01('0x0'));var attributes=require(_0x6b01('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x6b01('0x2')]=function(_0x531b6a){var _0x160a7d=_0x531b6a[_0x6b01('0x3')];function _0x161b59(_0x3b9de1,_0x5964ca){return new Promise(function(_0x1b7dd6,_0x65407a){if(!_0x5964ca)return _0x1b7dd6(null);var _0x192b2d=_0x5964ca['filter']?{[_0x5964ca['filter'][_0x6b01('0x4')]]:_0x5964ca[_0x6b01('0x5')]['value']}:undefined;return _0x160a7d[_0x3b9de1]['findAll']({'where':_0x192b2d,'raw':!![]})[_0x6b01('0x6')](function(_0x1cb3a6){_0x5964ca[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x1cb3a6,'id');_0x1b7dd6(_0x5964ca);})[_0x6b01('0x9')](function(_0x5bed15){_0x65407a(_0x5bed15);});});}function _0x4b4a4d(_0x4627ef,_0x24049f){return new Promise(function(_0x2660c7,_0x5a8817){var _0x200614=_0x4627ef['filter']?{[_0x4627ef['filter'][_0x6b01('0x4')]]:_0x4627ef['filter'][_0x6b01('0xa')]}:undefined;return _0x160a7d[_0x4627ef[_0x6b01('0xb')]]['findAll']({'where':_0x200614,'raw':!![]})[_0x6b01('0x6')](function(_0x4ea5fa){_0x24049f['associatedResources']=_['map'](_0x4ea5fa,function(_0x3d4666){return _0x3d4666['name'];});_0x2660c7(_0x24049f);})['catch'](function(_0x3a259f){_0x5a8817(_0x3a259f);});});}function _0x327e86(_0x20dd83,_0x41efa3,_0x3d7045){if(!_0x41efa3)return Promise[_0x6b01('0xc')](null);return new Promise(function(_0x122769,_0x33ffe8){return _0x160a7d[_0x6b01('0xd')][_0x6b01('0xe')]({'where':{'sectionId':_0x41efa3['id']},'raw':!![]})[_0x6b01('0x6')](function(_0x4f2d08){if(_0x20dd83[_0x6b01('0x4')]&&_0x20dd83[_0x6b01('0x4')]!=='id'){_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x5a7d75){return _0x5a7d75[_0x20dd83[_0x6b01('0x4')]];});}else{if(_0x3d7045===_0x6b01('0xf')){_0x41efa3[_0x6b01('0x7')]=_['map'](_0x4f2d08,function(_0x3029e2){return{'id':_0x3029e2[_0x6b01('0x10')],'type':_0x3029e2[_0x6b01('0x11')]};});}else{_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x181b09){return _0x181b09[_0x6b01('0x10')];});}}_0x122769(_0x41efa3);})['catch'](function(_0x7caa07){_0x33ffe8(_0x7caa07);});});}function _0xcf9200(_0x42c990,_0x51243c){var _0x399808={'parentSections':[]};switch(_0x42c990[_0x6b01('0x12')]()){case _0x6b01('0x13'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x15');break;case _0x6b01('0x16'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x17');break;case _0x6b01('0x18'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x19');_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x1b'),'field':'name','foreignKey':_0x6b01('0x1c')}];break;case _0x6b01('0x1d'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x1e');break;case _0x6b01('0x1f'):_0x399808['childModel']='CmContact';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x20'),'field':'id','foreignKey':_0x6b01('0x21')}];break;case _0x6b01('0x22'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x23');break;case'companies':_0x399808[_0x6b01('0x14')]='CmCompany';break;case _0x6b01('0x24'):_0x399808['childModel']=_0x6b01('0x25');break;case _0x6b01('0x26'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x27');break;case _0x6b01('0x28'):_0x399808['childModel']=_0x6b01('0x29');break;case _0x6b01('0x2a'):_0x399808[_0x6b01('0x14')]='FaxQueue';break;case'faxaccounts':_0x399808[_0x6b01('0x14')]='FaxAccount';break;case _0x6b01('0x2b'):case _0x6b01('0x2c'):case _0x6b01('0x2d'):_0x399808['childModel']=_0x6b01('0x2e');break;case _0x6b01('0x2f'):_0x399808[_0x6b01('0x14')]='VoiceContext';break;case _0x6b01('0x30'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x31');break;case _0x6b01('0x32'):_0x399808[_0x6b01('0x14')]='VoiceRecording';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x33'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x35'),'model':_0x6b01('0x36'),'filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x38')]}},{'name':_0x6b01('0x39'),'field':'name','foreignKey':_0x6b01('0x35'),'model':'User','filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x3a')]}},{'name':_0x6b01('0x3b'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':['inbound']}},{'name':_0x6b01('0x3e'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':[_0x6b01('0x3f')]}}];break;case _0x6b01('0x40'):_0x399808[_0x6b01('0x14')]='VoiceMusicOnHold';break;case _0x6b01('0x41'):_0x399808['childModel']=_0x6b01('0x42');break;case _0x6b01('0x43'):_0x399808['childModel']=_0x6b01('0x44');break;case _0x6b01('0x45'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x46');break;case _0x6b01('0x47'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x48');break;case _0x6b01('0x49'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x4a');break;case'mailsubstatuses':_0x399808[_0x6b01('0x14')]=_0x6b01('0x4b');break;case'openchannelqueues':_0x399808['childModel']=_0x6b01('0x4c');break;case _0x6b01('0x4d'):_0x399808['childModel']=_0x6b01('0x4e');break;case _0x6b01('0x4f'):_0x399808['childModel']=_0x6b01('0x50');break;case'smsaccounts':_0x399808[_0x6b01('0x14')]=_0x6b01('0x51');break;case _0x6b01('0x52'):_0x399808['childModel']=_0x6b01('0x53');break;case _0x6b01('0x54'):_0x399808['childModel']='WhatsappAccount';break;case'teams':_0x399808[_0x6b01('0x14')]=_0x6b01('0x55');break;case _0x6b01('0x56'):case _0x6b01('0x57'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x3d');if(_0x51243c){_0x399808['parentSections']=[{'name':_0x6b01('0x3b')},{'name':_0x6b01('0x3e')}];}break;case _0x6b01('0x58'):case _0x6b01('0x59'):case _0x6b01('0x5a'):_0x399808[_0x6b01('0x14')]='User';if(_0x51243c){_0x399808[_0x6b01('0x1a')]=[{'name':'Users','filter':{'field':'role','value':[_0x6b01('0x5b'),_0x6b01('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6b01('0x39')}];}break;case _0x6b01('0x5d'):_0x399808[_0x6b01('0x14')]='ZendeskAccount';break;case'salesforceaccounts':_0x399808['childModel']=_0x6b01('0x5e');break;case _0x6b01('0x5f'):_0x399808['childModel']=_0x6b01('0x60');break;case'sugarcrmaccounts':_0x399808['childModel']='SugarcrmAccount';break;case _0x6b01('0x61'):_0x399808[_0x6b01('0x14')]='DeskAccount';break;case'zohoaccounts':_0x399808[_0x6b01('0x14')]='ZohoAccount';break;case _0x6b01('0x62'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x36');break;case _0x6b01('0x63'):_0x399808[_0x6b01('0x14')]='CannedAnswer';break;case _0x6b01('0x64'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x65');break;case'customdashboards':_0x399808[_0x6b01('0x14')]=_0x6b01('0x66');break;case'intervals':_0x399808[_0x6b01('0x14')]=_0x6b01('0x67');break;case _0x6b01('0x68'):_0x399808[_0x6b01('0x14')]='Pause';break;case'scheduler':_0x399808[_0x6b01('0x14')]='Schedule';break;case'sounds':_0x399808[_0x6b01('0x14')]=_0x6b01('0x69');break;case'tags':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6a');break;case'templates':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6b');break;case _0x6b01('0x6c'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6d');break;case'trunks':_0x399808[_0x6b01('0x14')]='Trunk';break;case _0x6b01('0x6e'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6f');break;case'plugins':_0x399808[_0x6b01('0x14')]=_0x6b01('0x70');break;case _0x6b01('0x71'):_0x399808[_0x6b01('0x14')]='AnalyticExtractedReport';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x72'),'field':'id','foreignKey':_0x6b01('0x73')}];break;case'metrics':_0x399808['childModel']=_0x6b01('0x74');break;}return _0x399808;}function _0x1aefc2(_0x11cbcc,_0x4e1702){var _0x21b99f=_0x11cbcc[_0x6b01('0x75')](0x0)[_0x6b01('0x76')]()+_0x11cbcc['slice'](0x1);var _0x54b3ae={'type':_0x160a7d[_0x6b01('0x77')][_0x6b01('0x78')]['SELECT'],'raw':!![]};return new Promise(function(_0x3e16e8,_0x3faa54){var _0xe6d027=squel[_0x6b01('0x79')]()[_0x6b01('0x4')](_0x6b01('0x7a')+_0x21b99f+_0x6b01('0x7b'),'id')[_0x6b01('0x4')](_0x6b01('0x7c'))['from'](_0x6b01('0x7d')+_0x11cbcc+_0x6b01('0x7e'),'ui')[_0x6b01('0x7f')](_0x6b01('0x80'),_0x4e1702['id']);return _0x160a7d[_0x6b01('0x81')][_0x6b01('0x82')](_0xe6d027[_0x6b01('0x83')](),_0x54b3ae)[_0x6b01('0x6')](function(_0x281e55){_0x4e1702[_0x21b99f+'OpenTabs']=_0x281e55;_0x3e16e8(_0x281e55);})[_0x6b01('0x9')](function(_0x25b39b){_0x3faa54(_0x25b39b);});});}return _0x531b6a[_0x6b01('0x84')](_0x6b01('0x85'),attributes,{'tableName':_0x6b01('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1dda2f){var _0x4c84cc={'raw':![],'where':{}};var _0x523102={};var _0x38ae38={'count':0x0,'rows':[]};var _0x270128=_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x87')];var _0x728ae2=_0x1dda2f[_0x6b01('0x82')]['mergeResources']||![];var _0x2bd87d=_0xcf9200(_0x270128,_0x728ae2);if(!_0x2bd87d[_0x6b01('0x14')])throw new Error(_0x6b01('0x88')+_0x270128+'\x27');var _0x44c3d1=[{'name':_0x270128}];if(!_[_0x6b01('0x89')](_0x2bd87d[_0x6b01('0x1a')]))_0x44c3d1=_0x2bd87d[_0x6b01('0x1a')];var _0x582bff=[];for(var _0x3ea965=0x0;_0x3ea965<_0x44c3d1['length'];_0x3ea965++){_0x582bff[_0x6b01('0x8a')](_0x160a7d[_0x6b01('0x8b')][_0x6b01('0x8c')]({'where':{'userProfileId':_0x1dda2f['params']['id'],'name':_0x44c3d1[_0x3ea965][_0x6b01('0x34')]},'raw':!![]}));}return Promise[_0x6b01('0x8d')](_0x582bff)[_0x6b01('0x6')](function(_0x14742e){var _0xa29570=_[_0x6b01('0x5')](_0x14742e,function(_0xdb2660){return _0xdb2660?_0xdb2660:undefined;});var _0x17481f=_[_0x6b01('0x5')](_0x44c3d1,[_0x6b01('0x8e'),!![]]);var _0x350e68=_[_0x6b01('0x89')](_0xa29570)&&_[_0x6b01('0x89')](_0x17481f)?null:_[_0x6b01('0x8f')](_0x17481f,_0xa29570);if(!_0x350e68)return null;var _0x207e0a=[];for(var _0x13ceac=0x0;_0x13ceac<_0x350e68[_0x6b01('0x90')];_0x13ceac++){var _0x3f077f=_[_0x6b01('0x8c')](_0x44c3d1,function(_0x4a8fcb){return _0x350e68[_0x13ceac]?_0x4a8fcb[_0x6b01('0x34')]===_0x350e68[_0x13ceac][_0x6b01('0x34')]:null;});if(_0x3f077f){if(_0x350e68[_0x13ceac][_0x6b01('0x8e')]){_0x207e0a[_0x6b01('0x8a')](_0x161b59(_0x2bd87d[_0x6b01('0x14')],_0x350e68[_0x13ceac]));}else{if(!_0x350e68[_0x13ceac][_0x6b01('0x91')]){_0x207e0a[_0x6b01('0x8a')](_0x327e86(_0x3f077f,_0x350e68[_0x13ceac],_0x2bd87d[_0x6b01('0x14')]));}else{if(_0x3f077f[_0x6b01('0xb')]){_0x207e0a[_0x6b01('0x8a')](_0x4b4a4d(_0x3f077f,_0x350e68[_0x13ceac]));}}}}}return Promise[_0x6b01('0x8d')](_0x207e0a);})[_0x6b01('0x6')](function(_0x468a0b){var _0x30171f=_0x468a0b;var _0x1a0bb7=null;if(_0x30171f){_0x1a0bb7=_0x30171f['length']===0x1?_0x30171f[0x0]:null;}if(!_0x1a0bb7&&!_0x30171f)return _0x38ae38;var _0xbcba19=_0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0x92')];_0x523102[_0x6b01('0xb')]=_[_0x6b01('0x93')](_0xbcba19);_0x523102[_0x6b01('0x82')]=_[_0x6b01('0x93')](_0x1dda2f[_0x6b01('0x82')]);_0x523102[_0x6b01('0x94')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],_0x523102[_0x6b01('0x82')]);_0x4c84cc[_0x6b01('0x96')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],qs[_0x6b01('0x97')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x97')]));_0x4c84cc[_0x6b01('0x96')]=_0x4c84cc[_0x6b01('0x96')]['length']?_0x4c84cc['attributes']:_0x523102['model'];if(!_0x1dda2f['query'][_0x6b01('0x98')]('nolimit')){_0x4c84cc['limit']=qs['limit'](_0x1dda2f[_0x6b01('0x82')]['limit']);_0x4c84cc[_0x6b01('0x99')]=qs[_0x6b01('0x99')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x99')]);}_0x4c84cc[_0x6b01('0x9a')]=qs['sort'](_0x1dda2f['query'][_0x6b01('0x9b')]);_0x4c84cc[_0x6b01('0x7f')]=qs[_0x6b01('0x94')](_['pick'](_0x1dda2f[_0x6b01('0x82')],_0x523102[_0x6b01('0x94')]));if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$or':_['map'](_0xbcba19,function(_0x1a03e4){if(_0x1a03e4[_0x6b01('0x11')][_0x6b01('0x9c')]!==_0x6b01('0x9d')){var _0x16a427={};_0x16a427[_0x1a03e4['field']]={'$like':'%'+_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]+'%'};return _0x16a427;}})});}var _0xb133fc=[];var _0x8b2514=null;var _0x4dbd69={};if(_0x1a0bb7){_0x8b2514=_[_0x6b01('0x8c')](_0x44c3d1,[_0x6b01('0x34'),_0x1a0bb7[_0x6b01('0x34')]]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){_0x4dbd69[_0x8b2514['foreignKey']]=_['map'](_0x1a0bb7['associatedResources'],'id');}else{_0x4dbd69[_0x8b2514[_0x6b01('0x9e')]]=_0x1a0bb7[_0x6b01('0x7')];}_0xb133fc['push'](_0x4dbd69);}else{_0x4c84cc[_0x6b01('0x7f')]['id']=_0x1a0bb7[_0x6b01('0x7')];}}else{for(var _0x34c971=0x0;_0x34c971<_0x30171f[_0x6b01('0x90')];_0x34c971++){_0x8b2514=_['find'](_0x44c3d1,[_0x6b01('0x34'),_0x30171f[_0x34c971]['name']]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};_0x4dbd69[_0x8b2514['foreignKey']]=_0x30171f[_0x34c971][_0x6b01('0x7')];_0xb133fc['push'](_0x4dbd69);}else{if(!_0x4c84cc[_0x6b01('0x7f')]['id'])_0x4c84cc[_0x6b01('0x7f')]['id']=[];_0x30171f[_0x34c971][_0x6b01('0x7')][_0x6b01('0x9f')](function(_0x12b0d8){_0x4c84cc[_0x6b01('0x7f')]['id'][_0x6b01('0x8a')](_0x12b0d8);});}}}if(!_['isEmpty'](_0xb133fc)){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$and':{'$or':_0xb133fc}});}_0x4c84cc=_[_0x6b01('0xa0')]({},_0x4c84cc,_0x1dda2f[_0x6b01('0xa1')]);if(_0x1a0bb7&&!_0x1a0bb7[_0x6b01('0x91')]&&_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xa2')]){_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xe')](_0x4c84cc)['then'](function(_0x1e9300){var _0x4091a8=[];_0x1e9300[_0x6b01('0x9f')](function(_0x41c2a9){var _0x5ac0b6;switch(_0x41c2a9[_0x6b01('0xa4')]){case _0x6b01('0xa5'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x3c4424){return _0x3c4424['id']===_0x41c2a9['reportId']&&_0x3c4424[_0x6b01('0x11')]==='DefaultReports';});break;case _0x6b01('0xa6'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x7b8545){return _0x7b8545['id']===_0x41c2a9[_0x6b01('0x73')]&&_0x7b8545[_0x6b01('0x11')]===_0x6b01('0xa7');});break;}if(_0x5ac0b6)_0x4091a8[_0x6b01('0x8a')](_0x41c2a9);});_0x38ae38[_0x6b01('0xa8')]=_0x4091a8[_0x6b01('0x90')];_0x38ae38[_0x6b01('0xa9')]=_0x4091a8;return _0x38ae38;});}else{return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xa8')]({'where':_0x4c84cc[_0x6b01('0x7f')]})['then'](function(_0x2f180){_0x38ae38['count']=_0x2f180;if(_0x1dda2f['query'][_0x6b01('0xa2')]){if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xaa')){_0x4c84cc[_0x6b01('0xa3')]=[{'model':_0x160a7d['Tag'],'as':_0x6b01('0xab'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'required':_0x1dda2f['query'][_0x6b01('0xad')]?!![]:![]},{'model':_0x160a7d[_0x6b01('0x6a')],'as':_0x6b01('0xae'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'through':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?{'attributes':[],'where':{'TagId':_0x1dda2f[_0x6b01('0x82')]['tag']||undefined}}:{},'required':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?!![]:![]}];}else{_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]]['findAll'](_0x4c84cc);})['then'](function(_0x33fa1d){_0x38ae38[_0x6b01('0xa9')]=_0x33fa1d;if(_0x270128===_0x6b01('0x33')&&_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xaf')]===_0x6b01('0xb0')){var _0x1343af=[];for(var _0x29c507=0x0;_0x29c507<_0x38ae38['rows'][_0x6b01('0x90')];_0x29c507++){_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb1'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb3'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb4'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb5'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb6'),_0x38ae38[_0x6b01('0xa9')][_0x29c507]['dataValues']));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb7'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));}return Promise[_0x6b01('0x8d')](_0x1343af)['then'](function(){return _0x38ae38;});}return _0x38ae38;});}});}}});}; \ No newline at end of file +var _0xb016=['SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','Interval','pauses','Sound','Tag','Template','triggers','Trigger','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','field','filter','then','associatedResources','map','catch','value','model','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc'];(function(_0x3a2c11,_0x527ecf){var _0x1d56a6=function(_0x4cb5f9){while(--_0x4cb5f9){_0x3a2c11['push'](_0x3a2c11['shift']());}};_0x1d56a6(++_0x527ecf);}(_0xb016,0x159));var _0x6b01=function(_0x3b9ef2,_0x405499){_0x3b9ef2=_0x3b9ef2-0x0;var _0x5443be=_0xb016[_0x3b9ef2];return _0x5443be;};'use strict';var _=require(_0x6b01('0x0'));var attributes=require(_0x6b01('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x6b01('0x2')]=function(_0x531b6a){var _0x160a7d=_0x531b6a[_0x6b01('0x3')];function _0x161b59(_0x3b9de1,_0x5964ca){return new Promise(function(_0x1b7dd6,_0x65407a){if(!_0x5964ca)return _0x1b7dd6(null);var _0x192b2d=_0x5964ca['filter']?{[_0x5964ca['filter'][_0x6b01('0x4')]]:_0x5964ca[_0x6b01('0x5')]['value']}:undefined;return _0x160a7d[_0x3b9de1]['findAll']({'where':_0x192b2d,'raw':!![]})[_0x6b01('0x6')](function(_0x1cb3a6){_0x5964ca[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x1cb3a6,'id');_0x1b7dd6(_0x5964ca);})[_0x6b01('0x9')](function(_0x5bed15){_0x65407a(_0x5bed15);});});}function _0x4b4a4d(_0x4627ef,_0x24049f){return new Promise(function(_0x2660c7,_0x5a8817){var _0x200614=_0x4627ef['filter']?{[_0x4627ef['filter'][_0x6b01('0x4')]]:_0x4627ef['filter'][_0x6b01('0xa')]}:undefined;return _0x160a7d[_0x4627ef[_0x6b01('0xb')]]['findAll']({'where':_0x200614,'raw':!![]})[_0x6b01('0x6')](function(_0x4ea5fa){_0x24049f['associatedResources']=_['map'](_0x4ea5fa,function(_0x3d4666){return _0x3d4666['name'];});_0x2660c7(_0x24049f);})['catch'](function(_0x3a259f){_0x5a8817(_0x3a259f);});});}function _0x327e86(_0x20dd83,_0x41efa3,_0x3d7045){if(!_0x41efa3)return Promise[_0x6b01('0xc')](null);return new Promise(function(_0x122769,_0x33ffe8){return _0x160a7d[_0x6b01('0xd')][_0x6b01('0xe')]({'where':{'sectionId':_0x41efa3['id']},'raw':!![]})[_0x6b01('0x6')](function(_0x4f2d08){if(_0x20dd83[_0x6b01('0x4')]&&_0x20dd83[_0x6b01('0x4')]!=='id'){_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x5a7d75){return _0x5a7d75[_0x20dd83[_0x6b01('0x4')]];});}else{if(_0x3d7045===_0x6b01('0xf')){_0x41efa3[_0x6b01('0x7')]=_['map'](_0x4f2d08,function(_0x3029e2){return{'id':_0x3029e2[_0x6b01('0x10')],'type':_0x3029e2[_0x6b01('0x11')]};});}else{_0x41efa3[_0x6b01('0x7')]=_[_0x6b01('0x8')](_0x4f2d08,function(_0x181b09){return _0x181b09[_0x6b01('0x10')];});}}_0x122769(_0x41efa3);})['catch'](function(_0x7caa07){_0x33ffe8(_0x7caa07);});});}function _0xcf9200(_0x42c990,_0x51243c){var _0x399808={'parentSections':[]};switch(_0x42c990[_0x6b01('0x12')]()){case _0x6b01('0x13'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x15');break;case _0x6b01('0x16'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x17');break;case _0x6b01('0x18'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x19');_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x1b'),'field':'name','foreignKey':_0x6b01('0x1c')}];break;case _0x6b01('0x1d'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x1e');break;case _0x6b01('0x1f'):_0x399808['childModel']='CmContact';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x20'),'field':'id','foreignKey':_0x6b01('0x21')}];break;case _0x6b01('0x22'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x23');break;case'companies':_0x399808[_0x6b01('0x14')]='CmCompany';break;case _0x6b01('0x24'):_0x399808['childModel']=_0x6b01('0x25');break;case _0x6b01('0x26'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x27');break;case _0x6b01('0x28'):_0x399808['childModel']=_0x6b01('0x29');break;case _0x6b01('0x2a'):_0x399808[_0x6b01('0x14')]='FaxQueue';break;case'faxaccounts':_0x399808[_0x6b01('0x14')]='FaxAccount';break;case _0x6b01('0x2b'):case _0x6b01('0x2c'):case _0x6b01('0x2d'):_0x399808['childModel']=_0x6b01('0x2e');break;case _0x6b01('0x2f'):_0x399808[_0x6b01('0x14')]='VoiceContext';break;case _0x6b01('0x30'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x31');break;case _0x6b01('0x32'):_0x399808[_0x6b01('0x14')]='VoiceRecording';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x33'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x35'),'model':_0x6b01('0x36'),'filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x38')]}},{'name':_0x6b01('0x39'),'field':'name','foreignKey':_0x6b01('0x35'),'model':'User','filter':{'field':_0x6b01('0x37'),'value':[_0x6b01('0x3a')]}},{'name':_0x6b01('0x3b'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':['inbound']}},{'name':_0x6b01('0x3e'),'field':_0x6b01('0x34'),'foreignKey':_0x6b01('0x3c'),'model':_0x6b01('0x3d'),'filter':{'field':_0x6b01('0x11'),'value':[_0x6b01('0x3f')]}}];break;case _0x6b01('0x40'):_0x399808[_0x6b01('0x14')]='VoiceMusicOnHold';break;case _0x6b01('0x41'):_0x399808['childModel']=_0x6b01('0x42');break;case _0x6b01('0x43'):_0x399808['childModel']=_0x6b01('0x44');break;case _0x6b01('0x45'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x46');break;case _0x6b01('0x47'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x48');break;case _0x6b01('0x49'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x4a');break;case'mailsubstatuses':_0x399808[_0x6b01('0x14')]=_0x6b01('0x4b');break;case'openchannelqueues':_0x399808['childModel']=_0x6b01('0x4c');break;case _0x6b01('0x4d'):_0x399808['childModel']=_0x6b01('0x4e');break;case _0x6b01('0x4f'):_0x399808['childModel']=_0x6b01('0x50');break;case'smsaccounts':_0x399808[_0x6b01('0x14')]=_0x6b01('0x51');break;case _0x6b01('0x52'):_0x399808['childModel']=_0x6b01('0x53');break;case _0x6b01('0x54'):_0x399808['childModel']='WhatsappAccount';break;case'teams':_0x399808[_0x6b01('0x14')]=_0x6b01('0x55');break;case _0x6b01('0x56'):case _0x6b01('0x57'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x3d');if(_0x51243c){_0x399808['parentSections']=[{'name':_0x6b01('0x3b')},{'name':_0x6b01('0x3e')}];}break;case _0x6b01('0x58'):case _0x6b01('0x59'):case _0x6b01('0x5a'):_0x399808[_0x6b01('0x14')]='User';if(_0x51243c){_0x399808[_0x6b01('0x1a')]=[{'name':'Users','filter':{'field':'role','value':[_0x6b01('0x5b'),_0x6b01('0x5c')]},'ignore':!![]},{'name':'Agents'},{'name':_0x6b01('0x39')}];}break;case _0x6b01('0x5d'):_0x399808[_0x6b01('0x14')]='ZendeskAccount';break;case'salesforceaccounts':_0x399808['childModel']=_0x6b01('0x5e');break;case _0x6b01('0x5f'):_0x399808['childModel']=_0x6b01('0x60');break;case'sugarcrmaccounts':_0x399808['childModel']='SugarcrmAccount';break;case _0x6b01('0x61'):_0x399808[_0x6b01('0x14')]='DeskAccount';break;case'zohoaccounts':_0x399808[_0x6b01('0x14')]='ZohoAccount';break;case _0x6b01('0x62'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x36');break;case _0x6b01('0x63'):_0x399808[_0x6b01('0x14')]='CannedAnswer';break;case _0x6b01('0x64'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x65');break;case'customdashboards':_0x399808[_0x6b01('0x14')]=_0x6b01('0x66');break;case'intervals':_0x399808[_0x6b01('0x14')]=_0x6b01('0x67');break;case _0x6b01('0x68'):_0x399808[_0x6b01('0x14')]='Pause';break;case'scheduler':_0x399808[_0x6b01('0x14')]='Schedule';break;case'sounds':_0x399808[_0x6b01('0x14')]=_0x6b01('0x69');break;case'tags':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6a');break;case'templates':_0x399808[_0x6b01('0x14')]=_0x6b01('0x6b');break;case _0x6b01('0x6c'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6d');break;case'trunks':_0x399808[_0x6b01('0x14')]='Trunk';break;case _0x6b01('0x6e'):_0x399808[_0x6b01('0x14')]=_0x6b01('0x6f');break;case'plugins':_0x399808[_0x6b01('0x14')]=_0x6b01('0x70');break;case _0x6b01('0x71'):_0x399808[_0x6b01('0x14')]='AnalyticExtractedReport';_0x399808[_0x6b01('0x1a')]=[{'name':_0x6b01('0x72'),'field':'id','foreignKey':_0x6b01('0x73')}];break;case'metrics':_0x399808['childModel']=_0x6b01('0x74');break;}return _0x399808;}function _0x1aefc2(_0x11cbcc,_0x4e1702){var _0x21b99f=_0x11cbcc[_0x6b01('0x75')](0x0)[_0x6b01('0x76')]()+_0x11cbcc['slice'](0x1);var _0x54b3ae={'type':_0x160a7d[_0x6b01('0x77')][_0x6b01('0x78')]['SELECT'],'raw':!![]};return new Promise(function(_0x3e16e8,_0x3faa54){var _0xe6d027=squel[_0x6b01('0x79')]()[_0x6b01('0x4')](_0x6b01('0x7a')+_0x21b99f+_0x6b01('0x7b'),'id')[_0x6b01('0x4')](_0x6b01('0x7c'))['from'](_0x6b01('0x7d')+_0x11cbcc+_0x6b01('0x7e'),'ui')[_0x6b01('0x7f')](_0x6b01('0x80'),_0x4e1702['id']);return _0x160a7d[_0x6b01('0x81')][_0x6b01('0x82')](_0xe6d027[_0x6b01('0x83')](),_0x54b3ae)[_0x6b01('0x6')](function(_0x281e55){_0x4e1702[_0x21b99f+'OpenTabs']=_0x281e55;_0x3e16e8(_0x281e55);})[_0x6b01('0x9')](function(_0x25b39b){_0x3faa54(_0x25b39b);});});}return _0x531b6a[_0x6b01('0x84')](_0x6b01('0x85'),attributes,{'tableName':_0x6b01('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1dda2f){var _0x4c84cc={'raw':![],'where':{}};var _0x523102={};var _0x38ae38={'count':0x0,'rows':[]};var _0x270128=_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x87')];var _0x728ae2=_0x1dda2f[_0x6b01('0x82')]['mergeResources']||![];var _0x2bd87d=_0xcf9200(_0x270128,_0x728ae2);if(!_0x2bd87d[_0x6b01('0x14')])throw new Error(_0x6b01('0x88')+_0x270128+'\x27');var _0x44c3d1=[{'name':_0x270128}];if(!_[_0x6b01('0x89')](_0x2bd87d[_0x6b01('0x1a')]))_0x44c3d1=_0x2bd87d[_0x6b01('0x1a')];var _0x582bff=[];for(var _0x3ea965=0x0;_0x3ea965<_0x44c3d1['length'];_0x3ea965++){_0x582bff[_0x6b01('0x8a')](_0x160a7d[_0x6b01('0x8b')][_0x6b01('0x8c')]({'where':{'userProfileId':_0x1dda2f['params']['id'],'name':_0x44c3d1[_0x3ea965][_0x6b01('0x34')]},'raw':!![]}));}return Promise[_0x6b01('0x8d')](_0x582bff)[_0x6b01('0x6')](function(_0x14742e){var _0xa29570=_[_0x6b01('0x5')](_0x14742e,function(_0xdb2660){return _0xdb2660?_0xdb2660:undefined;});var _0x17481f=_[_0x6b01('0x5')](_0x44c3d1,[_0x6b01('0x8e'),!![]]);var _0x350e68=_[_0x6b01('0x89')](_0xa29570)&&_[_0x6b01('0x89')](_0x17481f)?null:_[_0x6b01('0x8f')](_0x17481f,_0xa29570);if(!_0x350e68)return null;var _0x207e0a=[];for(var _0x13ceac=0x0;_0x13ceac<_0x350e68[_0x6b01('0x90')];_0x13ceac++){var _0x3f077f=_[_0x6b01('0x8c')](_0x44c3d1,function(_0x4a8fcb){return _0x350e68[_0x13ceac]?_0x4a8fcb[_0x6b01('0x34')]===_0x350e68[_0x13ceac][_0x6b01('0x34')]:null;});if(_0x3f077f){if(_0x350e68[_0x13ceac][_0x6b01('0x8e')]){_0x207e0a[_0x6b01('0x8a')](_0x161b59(_0x2bd87d[_0x6b01('0x14')],_0x350e68[_0x13ceac]));}else{if(!_0x350e68[_0x13ceac][_0x6b01('0x91')]){_0x207e0a[_0x6b01('0x8a')](_0x327e86(_0x3f077f,_0x350e68[_0x13ceac],_0x2bd87d[_0x6b01('0x14')]));}else{if(_0x3f077f[_0x6b01('0xb')]){_0x207e0a[_0x6b01('0x8a')](_0x4b4a4d(_0x3f077f,_0x350e68[_0x13ceac]));}}}}}return Promise[_0x6b01('0x8d')](_0x207e0a);})[_0x6b01('0x6')](function(_0x468a0b){var _0x30171f=_0x468a0b;var _0x1a0bb7=null;if(_0x30171f){_0x1a0bb7=_0x30171f['length']===0x1?_0x30171f[0x0]:null;}if(!_0x1a0bb7&&!_0x30171f)return _0x38ae38;var _0xbcba19=_0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0x92')];_0x523102[_0x6b01('0xb')]=_[_0x6b01('0x93')](_0xbcba19);_0x523102[_0x6b01('0x82')]=_[_0x6b01('0x93')](_0x1dda2f[_0x6b01('0x82')]);_0x523102[_0x6b01('0x94')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],_0x523102[_0x6b01('0x82')]);_0x4c84cc[_0x6b01('0x96')]=_[_0x6b01('0x95')](_0x523102[_0x6b01('0xb')],qs[_0x6b01('0x97')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x97')]));_0x4c84cc[_0x6b01('0x96')]=_0x4c84cc[_0x6b01('0x96')]['length']?_0x4c84cc['attributes']:_0x523102['model'];if(!_0x1dda2f['query'][_0x6b01('0x98')]('nolimit')){_0x4c84cc['limit']=qs['limit'](_0x1dda2f[_0x6b01('0x82')]['limit']);_0x4c84cc[_0x6b01('0x99')]=qs[_0x6b01('0x99')](_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x99')]);}_0x4c84cc[_0x6b01('0x9a')]=qs['sort'](_0x1dda2f['query'][_0x6b01('0x9b')]);_0x4c84cc[_0x6b01('0x7f')]=qs[_0x6b01('0x94')](_['pick'](_0x1dda2f[_0x6b01('0x82')],_0x523102[_0x6b01('0x94')]));if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$or':_['map'](_0xbcba19,function(_0x1a03e4){if(_0x1a03e4[_0x6b01('0x11')][_0x6b01('0x9c')]!==_0x6b01('0x9d')){var _0x16a427={};_0x16a427[_0x1a03e4['field']]={'$like':'%'+_0x1dda2f[_0x6b01('0x82')][_0x6b01('0x5')]+'%'};return _0x16a427;}})});}var _0xb133fc=[];var _0x8b2514=null;var _0x4dbd69={};if(_0x1a0bb7){_0x8b2514=_[_0x6b01('0x8c')](_0x44c3d1,[_0x6b01('0x34'),_0x1a0bb7[_0x6b01('0x34')]]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){_0x4dbd69[_0x8b2514['foreignKey']]=_['map'](_0x1a0bb7['associatedResources'],'id');}else{_0x4dbd69[_0x8b2514[_0x6b01('0x9e')]]=_0x1a0bb7[_0x6b01('0x7')];}_0xb133fc['push'](_0x4dbd69);}else{_0x4c84cc[_0x6b01('0x7f')]['id']=_0x1a0bb7[_0x6b01('0x7')];}}else{for(var _0x34c971=0x0;_0x34c971<_0x30171f[_0x6b01('0x90')];_0x34c971++){_0x8b2514=_['find'](_0x44c3d1,[_0x6b01('0x34'),_0x30171f[_0x34c971]['name']]);if(_0x8b2514[_0x6b01('0x4')]){_0x4dbd69={};_0x4dbd69[_0x8b2514['foreignKey']]=_0x30171f[_0x34c971][_0x6b01('0x7')];_0xb133fc['push'](_0x4dbd69);}else{if(!_0x4c84cc[_0x6b01('0x7f')]['id'])_0x4c84cc[_0x6b01('0x7f')]['id']=[];_0x30171f[_0x34c971][_0x6b01('0x7')][_0x6b01('0x9f')](function(_0x12b0d8){_0x4c84cc[_0x6b01('0x7f')]['id'][_0x6b01('0x8a')](_0x12b0d8);});}}}if(!_['isEmpty'](_0xb133fc)){_0x4c84cc[_0x6b01('0x7f')]=_['merge'](_0x4c84cc[_0x6b01('0x7f')],{'$and':{'$or':_0xb133fc}});}_0x4c84cc=_[_0x6b01('0xa0')]({},_0x4c84cc,_0x1dda2f[_0x6b01('0xa1')]);if(_0x1a0bb7&&!_0x1a0bb7[_0x6b01('0x91')]&&_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xf')){if(_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xa2')]){_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xe')](_0x4c84cc)['then'](function(_0x1e9300){var _0x4091a8=[];_0x1e9300[_0x6b01('0x9f')](function(_0x41c2a9){var _0x5ac0b6;switch(_0x41c2a9[_0x6b01('0xa4')]){case _0x6b01('0xa5'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x3c4424){return _0x3c4424['id']===_0x41c2a9['reportId']&&_0x3c4424[_0x6b01('0x11')]==='DefaultReports';});break;case _0x6b01('0xa6'):_0x5ac0b6=_[_0x6b01('0x8c')](_0x1a0bb7[_0x6b01('0x7')],function(_0x7b8545){return _0x7b8545['id']===_0x41c2a9[_0x6b01('0x73')]&&_0x7b8545[_0x6b01('0x11')]===_0x6b01('0xa7');});break;}if(_0x5ac0b6)_0x4091a8[_0x6b01('0x8a')](_0x41c2a9);});_0x38ae38[_0x6b01('0xa8')]=_0x4091a8[_0x6b01('0x90')];_0x38ae38[_0x6b01('0xa9')]=_0x4091a8;return _0x38ae38;});}else{return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]][_0x6b01('0xa8')]({'where':_0x4c84cc[_0x6b01('0x7f')]})['then'](function(_0x2f180){_0x38ae38['count']=_0x2f180;if(_0x1dda2f['query'][_0x6b01('0xa2')]){if(_0x2bd87d[_0x6b01('0x14')]===_0x6b01('0xaa')){_0x4c84cc[_0x6b01('0xa3')]=[{'model':_0x160a7d['Tag'],'as':_0x6b01('0xab'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'required':_0x1dda2f['query'][_0x6b01('0xad')]?!![]:![]},{'model':_0x160a7d[_0x6b01('0x6a')],'as':_0x6b01('0xae'),'attributes':['id',_0x6b01('0x34'),_0x6b01('0xac')],'through':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?{'attributes':[],'where':{'TagId':_0x1dda2f[_0x6b01('0x82')]['tag']||undefined}}:{},'required':_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xad')]?!![]:![]}];}else{_0x4c84cc[_0x6b01('0xa3')]=[{'all':!![]}];}}return _0x160a7d[_0x2bd87d[_0x6b01('0x14')]]['findAll'](_0x4c84cc);})['then'](function(_0x33fa1d){_0x38ae38[_0x6b01('0xa9')]=_0x33fa1d;if(_0x270128===_0x6b01('0x33')&&_0x1dda2f[_0x6b01('0x82')][_0x6b01('0xaf')]===_0x6b01('0xb0')){var _0x1343af=[];for(var _0x29c507=0x0;_0x29c507<_0x38ae38['rows'][_0x6b01('0x90')];_0x29c507++){_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb1'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb3'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb4'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb5'),_0x38ae38['rows'][_0x29c507][_0x6b01('0xb2')]));_0x1343af['push'](_0x1aefc2(_0x6b01('0xb6'),_0x38ae38[_0x6b01('0xa9')][_0x29c507]['dataValues']));_0x1343af[_0x6b01('0x8a')](_0x1aefc2(_0x6b01('0xb7'),_0x38ae38[_0x6b01('0xa9')][_0x29c507][_0x6b01('0xb2')]));}return Promise[_0x6b01('0x8d')](_0x1343af)['then'](function(){return _0x38ae38;});}return _0x38ae38;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index feea4d6..d88bf33 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 _0xdfa0=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x10ac9d,_0x129feb){var _0x482435=function(_0x31177c){while(--_0x31177c){_0x10ac9d['push'](_0x10ac9d['shift']());}};_0x482435(++_0x129feb);}(_0xdfa0,0x69));var _0x0dfa=function(_0x28d7ee,_0x3ce274){_0x28d7ee=_0x28d7ee-0x0;var _0x3e618d=_0xdfa0[_0x28d7ee];return _0x3e618d;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var moment=require(_0x0dfa('0x1'));var BPromise=require(_0x0dfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];var utils=require(_0x0dfa('0x5'));var logger=require('../../config/logger')(_0x0dfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dfa('0x7'));var client=jayson[_0x0dfa('0x8')]['http']({'port':0x232a});config[_0x0dfa('0x9')]=_[_0x0dfa('0xa')](config[_0x0dfa('0x9')],{'host':_0x0dfa('0xb'),'port':0x18eb});var socket=require(_0x0dfa('0xc'))(new Redis(config['redis']));require(_0x0dfa('0xd'))[_0x0dfa('0xe')](socket);function respondWithRpcPromise(_0x6c9373,_0x5cddf5,_0x438b20){return new BPromise(function(_0x520ec9,_0x260ffb){return client[_0x0dfa('0xf')](_0x6c9373,_0x438b20)[_0x0dfa('0x10')](function(_0x4c7ce4){logger[_0x0dfa('0x11')](_0x0dfa('0x12'),_0x5cddf5,'request\x20sent');logger[_0x0dfa('0x13')](_0x0dfa('0x14'),_0x5cddf5,'request\x20sent',JSON[_0x0dfa('0x15')](_0x4c7ce4));if(_0x4c7ce4[_0x0dfa('0x16')]){if(_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x17')]===0x1f4){logger[_0x0dfa('0x16')](_0x0dfa('0x12'),_0x5cddf5,_0x4c7ce4['error'][_0x0dfa('0x18')]);return _0x260ffb(_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x18')]);}logger[_0x0dfa('0x16')](_0x0dfa('0x12'),_0x5cddf5,_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x18')]);return _0x520ec9(_0x4c7ce4[_0x0dfa('0x16')][_0x0dfa('0x18')]);}else{logger[_0x0dfa('0x11')](_0x0dfa('0x12'),_0x5cddf5,_0x0dfa('0x19'));_0x520ec9(_0x4c7ce4[_0x0dfa('0x1a')][_0x0dfa('0x18')]);}})[_0x0dfa('0x1b')](function(_0x5b9529){logger[_0x0dfa('0x16')](_0x0dfa('0x12'),_0x5cddf5,_0x5b9529);_0x260ffb(_0x5b9529);});});} \ No newline at end of file +var _0x80c3=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','redis','defaults','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3fda66,_0x4a3515){var _0x4228e7=function(_0x104baf){while(--_0x104baf){_0x3fda66['push'](_0x3fda66['shift']());}};_0x4228e7(++_0x4a3515);}(_0x80c3,0x18f));var _0x380c=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x80c3[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x380c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x380c('0x2'));var db=require(_0x380c('0x3'))['db'];var utils=require(_0x380c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x380c('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x380c('0x6')]=_[_0x380c('0x7')](config[_0x380c('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x380c('0x8'))(new Redis(config[_0x380c('0x6')]));require('./userProfile.socket')[_0x380c('0x9')](socket);function respondWithRpcPromise(_0x1d5493,_0x50be52,_0x58886c){return new BPromise(function(_0x3a1ebb,_0x35f424){return client['request'](_0x1d5493,_0x58886c)[_0x380c('0xa')](function(_0x41fbf2){logger[_0x380c('0xb')](_0x380c('0xc'),_0x50be52,_0x380c('0xd'));logger[_0x380c('0xe')](_0x380c('0xf'),_0x50be52,_0x380c('0xd'),JSON[_0x380c('0x10')](_0x41fbf2));if(_0x41fbf2[_0x380c('0x11')]){if(_0x41fbf2['error'][_0x380c('0x12')]===0x1f4){logger[_0x380c('0x11')]('UserProfile,\x20%s,\x20%s',_0x50be52,_0x41fbf2[_0x380c('0x11')][_0x380c('0x13')]);return _0x35f424(_0x41fbf2[_0x380c('0x11')][_0x380c('0x13')]);}logger[_0x380c('0x11')](_0x380c('0xc'),_0x50be52,_0x41fbf2[_0x380c('0x11')][_0x380c('0x13')]);return _0x3a1ebb(_0x41fbf2[_0x380c('0x11')]['message']);}else{logger[_0x380c('0xb')]('UserProfile,\x20%s,\x20%s',_0x50be52,'request\x20sent');_0x3a1ebb(_0x41fbf2[_0x380c('0x14')]['message']);}})['catch'](function(_0x4901fe){logger['error'](_0x380c('0xc'),_0x50be52,_0x4901fe);_0x35f424(_0x4901fe);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 2959504..53009c0 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 _0xcd2d=['removeListener','register','userProfile:','./userProfile.events','save','remove','emit'];(function(_0x8ca8ae,_0x30fac3){var _0x2817bb=function(_0x20eb93){while(--_0x20eb93){_0x8ca8ae['push'](_0x8ca8ae['shift']());}};_0x2817bb(++_0x30fac3);}(_0xcd2d,0x130));var _0xdcd2=function(_0x3d52c9,_0x21c2db){_0x3d52c9=_0x3d52c9-0x0;var _0x5a944c=_0xcd2d[_0x3d52c9];return _0x5a944c;};'use strict';var UserProfileEvents=require(_0xdcd2('0x0'));var events=[_0xdcd2('0x1'),_0xdcd2('0x2'),'update'];function createListener(_0x199b13,_0x3814a7){return function(_0x40143d){_0x3814a7[_0xdcd2('0x3')](_0x199b13,_0x40143d);};}function removeListener(_0x1f49f0,_0x209f22){return function(){UserProfileEvents[_0xdcd2('0x4')](_0x1f49f0,_0x209f22);};}exports[_0xdcd2('0x5')]=function(_0x3aea2b){for(var _0x1a40b3=0x0,_0x58f557=events['length'];_0x1a40b3<_0x58f557;_0x1a40b3++){var _0x520e12=events[_0x1a40b3];var _0x4a9846=createListener(_0xdcd2('0x6')+_0x520e12,_0x3aea2b);UserProfileEvents['on'](_0x520e12,_0x4a9846);}}; \ No newline at end of file +var _0x0add=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0add,0x148));var _0xd0ad=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x0add[_0x420d8d];return _0x4865d7;};'use strict';var UserProfileEvents=require(_0xd0ad('0x0'));var events=[_0xd0ad('0x1'),_0xd0ad('0x2'),_0xd0ad('0x3')];function createListener(_0x43dcb4,_0x33fe81){return function(_0x1217f5){_0x33fe81[_0xd0ad('0x4')](_0x43dcb4,_0x1217f5);};}function removeListener(_0x66129a,_0x32364c){return function(){UserProfileEvents[_0xd0ad('0x5')](_0x66129a,_0x32364c);};}exports[_0xd0ad('0x6')]=function(_0x2cb743){for(var _0x4243bc=0x0,_0xbffc88=events[_0xd0ad('0x7')];_0x4243bc<_0xbffc88;_0x4243bc++){var _0x5eeae8=events[_0x4243bc];var _0x559d14=createListener(_0xd0ad('0x8')+_0x5eeae8,_0x2cb743);UserProfileEvents['on'](_0x5eeae8,_0x559d14);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 7351dd6..957f1e6 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 _0x6809=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x432374,_0x5d2bf4){var _0x529d1b=function(_0x44313c){while(--_0x44313c){_0x432374['push'](_0x432374['shift']());}};_0x529d1b(++_0x5d2bf4);}(_0x6809,0x143));var _0x9680=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x6809[_0x49c68e];return _0x33032b;};'use strict';var multer=require(_0x9680('0x0'));var util=require('util');var path=require(_0x9680('0x1'));var timeout=require(_0x9680('0x2'));var express=require(_0x9680('0x3'));var router=express[_0x9680('0x4')]();var fs_extra=require(_0x9680('0x5'));var auth=require(_0x9680('0x6'));var interaction=require(_0x9680('0x7'));var config=require(_0x9680('0x8'));var controller=require(_0x9680('0x9'));router[_0x9680('0xa')]('/',auth[_0x9680('0xb')](),controller['index']);router['get'](_0x9680('0xc'),auth[_0x9680('0xb')](),controller[_0x9680('0xd')]);router[_0x9680('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9680('0xe')]);router[_0x9680('0xf')]('/',auth[_0x9680('0xb')](),controller['create']);router[_0x9680('0x10')](_0x9680('0x11'),auth[_0x9680('0xb')](),controller[_0x9680('0x12')]);router[_0x9680('0x13')]('/:id',auth[_0x9680('0xb')](),controller[_0x9680('0x14')]);module[_0x9680('0x15')]=router; \ No newline at end of file +var _0x0105=['./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x310eb3,_0x546e4a){var _0x3a0766=function(_0xa3c1ac){while(--_0xa3c1ac){_0x310eb3['push'](_0x310eb3['shift']());}};_0x3a0766(++_0x546e4a);}(_0x0105,0x1dc));var _0x5010=function(_0x3a0bee,_0x5e1286){_0x3a0bee=_0x3a0bee-0x0;var _0x2f5898=_0x0105[_0x3a0bee];return _0x2f5898;};'use strict';var multer=require(_0x5010('0x0'));var util=require(_0x5010('0x1'));var path=require('path');var timeout=require(_0x5010('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5010('0x3'));var auth=require(_0x5010('0x4'));var interaction=require(_0x5010('0x5'));var config=require(_0x5010('0x6'));var controller=require(_0x5010('0x7'));router[_0x5010('0x8')]('/',auth['isAuthenticated'](),controller[_0x5010('0x9')]);router[_0x5010('0x8')](_0x5010('0xa'),auth[_0x5010('0xb')](),controller[_0x5010('0xc')]);router['get'](_0x5010('0xd'),auth[_0x5010('0xb')](),controller[_0x5010('0xe')]);router[_0x5010('0xf')]('/',auth[_0x5010('0xb')](),controller[_0x5010('0x10')]);router[_0x5010('0x11')](_0x5010('0xd'),auth[_0x5010('0xb')](),controller[_0x5010('0x12')]);router['delete'](_0x5010('0xd'),auth[_0x5010('0xb')](),controller[_0x5010('0x13')]);module[_0x5010('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 2df9ec3..8ec761a 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 _0x7e61=['STRING','INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e61,0xaa));var _0x17e6=function(_0x43560c,_0x20e398){_0x43560c=_0x43560c-0x0;var _0x310501=_0x7e61[_0x43560c];return _0x310501;};'use strict';var Sequelize=require(_0x17e6('0x0'));module[_0x17e6('0x1')]={'name':{'type':Sequelize[_0x17e6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x17e6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x17e6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x74da=['STRING','sequelize','exports'];(function(_0x39258d,_0x46cd06){var _0x2f54ce=function(_0x481f3b){while(--_0x481f3b){_0x39258d['push'](_0x39258d['shift']());}};_0x2f54ce(++_0x46cd06);}(_0x74da,0x196));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa74d('0x0'));module[_0xa74d('0x1')]={'name':{'type':Sequelize[_0xa74d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xa74d('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 7e7defb..eade05d 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 _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x36ed95,_0x5ebabc){var _0x4147d4=function(_0x2a1c29){while(--_0x2a1c29){_0x36ed95['push'](_0x36ed95['shift']());}};_0x4147d4(++_0x5ebabc);}(_0x4975,0x86));var _0x5497=function(_0x13aa8d,_0x2ecbb3){_0x13aa8d=_0x13aa8d-0x0;var _0x1e36e6=_0x4975[_0x13aa8d];return _0x1e36e6;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file +var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index cccdecf..576f6d2 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 _0x8f09=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','user_profile_has_resources','compositeIndex','sectionId','util'];(function(_0x57de8c,_0x1e0f17){var _0x43a392=function(_0x37066e){while(--_0x37066e){_0x57de8c['push'](_0x57de8c['shift']());}};_0x43a392(++_0x1e0f17);}(_0x8f09,0xe9));var _0x98f0=function(_0x16ff08,_0x5851c6){_0x16ff08=_0x16ff08-0x0;var _0x59c1ed=_0x8f09[_0x16ff08];return _0x59c1ed;};'use strict';var _=require('lodash');var util=require(_0x98f0('0x0'));var logger=require(_0x98f0('0x1'))(_0x98f0('0x2'));var moment=require(_0x98f0('0x3'));var BPromise=require(_0x98f0('0x4'));var rp=require(_0x98f0('0x5'));var fs=require('fs');var path=require(_0x98f0('0x6'));var rimraf=require(_0x98f0('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x98f0('0x8')]=function(_0xff1dd3,_0x588c39){return _0xff1dd3[_0x98f0('0x9')]('UserProfileResource',attributes,{'tableName':_0x98f0('0xa'),'paranoid':![],'indexes':[{'name':_0x98f0('0xb'),'fields':['resourceId',_0x98f0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe26e=['sectionId','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId'];(function(_0x272129,_0x1f2a0a){var _0x59ace5=function(_0x22528c){while(--_0x22528c){_0x272129['push'](_0x272129['shift']());}};_0x59ace5(++_0x1f2a0a);}(_0xe26e,0x151));var _0xee26=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe26e[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xee26('0x0'));var logger=require(_0xee26('0x1'))(_0xee26('0x2'));var moment=require(_0xee26('0x3'));var BPromise=require('bluebird');var rp=require(_0xee26('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee26('0x5'));var config=require(_0xee26('0x6'));var attributes=require(_0xee26('0x7'));module[_0xee26('0x8')]=function(_0x12030a,_0x4b325e){return _0x12030a['define'](_0xee26('0x9'),attributes,{'tableName':_0xee26('0xa'),'paranoid':![],'indexes':[{'name':_0xee26('0xb'),'fields':[_0xee26('0xc'),_0xee26('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 8b18b08..3079d40 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 _0x0c10=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error'];(function(_0x3c48e2,_0x11b592){var _0x1c9aeb=function(_0x3374a7){while(--_0x3374a7){_0x3c48e2['push'](_0x3c48e2['shift']());}};_0x1c9aeb(++_0x11b592);}(_0x0c10,0xc8));var _0x00c1=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x0c10[_0x2ddd52];return _0x4bb4ec;};'use strict';var _=require('lodash');var util=require(_0x00c1('0x0'));var moment=require(_0x00c1('0x1'));var BPromise=require(_0x00c1('0x2'));var rs=require(_0x00c1('0x3'));var fs=require('fs');var Redis=require(_0x00c1('0x4'));var db=require(_0x00c1('0x5'))['db'];var utils=require(_0x00c1('0x6'));var logger=require(_0x00c1('0x7'))('rpc');var config=require(_0x00c1('0x8'));var jayson=require(_0x00c1('0x9'));var client=jayson[_0x00c1('0xa')][_0x00c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f18ba,_0x4dc2f2,_0x240c31){return new BPromise(function(_0x446310,_0xe55699){return client[_0x00c1('0xc')](_0x5f18ba,_0x240c31)[_0x00c1('0xd')](function(_0x282d2e){logger[_0x00c1('0xe')](_0x00c1('0xf'),_0x4dc2f2,_0x00c1('0x10'));logger[_0x00c1('0x11')](_0x00c1('0x12'),_0x4dc2f2,'request\x20sent',JSON['stringify'](_0x282d2e));if(_0x282d2e[_0x00c1('0x13')]){if(_0x282d2e[_0x00c1('0x13')]['code']===0x1f4){logger['error'](_0x00c1('0xf'),_0x4dc2f2,_0x282d2e['error']['message']);return _0xe55699(_0x282d2e[_0x00c1('0x13')][_0x00c1('0x14')]);}logger[_0x00c1('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x4dc2f2,_0x282d2e['error'][_0x00c1('0x14')]);return _0x446310(_0x282d2e['error']['message']);}else{logger[_0x00c1('0xe')](_0x00c1('0xf'),_0x4dc2f2,'request\x20sent');_0x446310(_0x282d2e['result'][_0x00c1('0x14')]);}})[_0x00c1('0x15')](function(_0x56fae9){logger[_0x00c1('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x4dc2f2,_0x56fae9);_0xe55699(_0x56fae9);});});} \ No newline at end of file +var _0x31b0=['request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','jayson/promise','http'];(function(_0x3b9587,_0x44eb6c){var _0x44c5c1=function(_0x1d1177){while(--_0x1d1177){_0x3b9587['push'](_0x3b9587['shift']());}};_0x44c5c1(++_0x44eb6c);}(_0x31b0,0x1ae));var _0x031b=function(_0x145042,_0x458dd4){_0x145042=_0x145042-0x0;var _0x214a0c=_0x31b0[_0x145042];return _0x214a0c;};'use strict';var _=require(_0x031b('0x0'));var util=require(_0x031b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x031b('0x2'));var db=require(_0x031b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x031b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x031b('0x5'));var client=jayson['client'][_0x031b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4fa238,_0x17f7a3,_0x31d488){return new BPromise(function(_0x575879,_0x2fcf82){return client[_0x031b('0x7')](_0x4fa238,_0x31d488)[_0x031b('0x8')](function(_0x56c866){logger['info'](_0x031b('0x9'),_0x17f7a3,_0x031b('0xa'));logger['debug'](_0x031b('0xb'),_0x17f7a3,_0x031b('0xa'),JSON[_0x031b('0xc')](_0x56c866));if(_0x56c866[_0x031b('0xd')]){if(_0x56c866[_0x031b('0xd')][_0x031b('0xe')]===0x1f4){logger[_0x031b('0xd')](_0x031b('0x9'),_0x17f7a3,_0x56c866[_0x031b('0xd')][_0x031b('0xf')]);return _0x2fcf82(_0x56c866[_0x031b('0xd')][_0x031b('0xf')]);}logger[_0x031b('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x17f7a3,_0x56c866[_0x031b('0xd')]['message']);return _0x575879(_0x56c866[_0x031b('0xd')][_0x031b('0xf')]);}else{logger[_0x031b('0x10')](_0x031b('0x9'),_0x17f7a3,_0x031b('0xa'));_0x575879(_0x56c866[_0x031b('0x11')][_0x031b('0xf')]);}})[_0x031b('0x12')](function(_0x458673){logger[_0x031b('0xd')](_0x031b('0x9'),_0x17f7a3,_0x458673);_0x2fcf82(_0x458673);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c0d6f9e..6ffa5bd 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 _0xbdce=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x4a3bd9,_0x4c6ea8){var _0x45b132=function(_0x8cf988){while(--_0x8cf988){_0x4a3bd9['push'](_0x4a3bd9['shift']());}};_0x45b132(++_0x4c6ea8);}(_0xbdce,0x1cf));var _0xebdc=function(_0x2af819,_0x2a4711){_0x2af819=_0x2af819-0x0;var _0x1797d2=_0xbdce[_0x2af819];return _0x1797d2;};'use strict';var multer=require(_0xebdc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xebdc('0x1'));var express=require(_0xebdc('0x2'));var router=express[_0xebdc('0x3')]();var fs_extra=require(_0xebdc('0x4'));var auth=require(_0xebdc('0x5'));var interaction=require(_0xebdc('0x6'));var config=require(_0xebdc('0x7'));var controller=require(_0xebdc('0x8'));router[_0xebdc('0x9')]('/',auth[_0xebdc('0xa')](),controller[_0xebdc('0xb')]);router[_0xebdc('0x9')](_0xebdc('0xc'),auth[_0xebdc('0xa')](),controller[_0xebdc('0xd')]);router[_0xebdc('0x9')](_0xebdc('0xe'),auth['isAuthenticated'](),controller[_0xebdc('0xf')]);router[_0xebdc('0x10')]('/',auth[_0xebdc('0xa')](),controller[_0xebdc('0x11')]);router[_0xebdc('0x12')](_0xebdc('0xe'),auth[_0xebdc('0xa')](),controller['update']);router[_0xebdc('0x13')](_0xebdc('0xe'),auth[_0xebdc('0xa')](),controller[_0xebdc('0x14')]);module[_0xebdc('0x15')]=router; \ No newline at end of file +var _0x54c1=['put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','describe','/:id','show','post','create'];(function(_0x4f34cb,_0x5dfb8b){var _0x9a9a20=function(_0x3f5287){while(--_0x3f5287){_0x4f34cb['push'](_0x4f34cb['shift']());}};_0x9a9a20(++_0x5dfb8b);}(_0x54c1,0xe0));var _0x154c=function(_0x3c8a38,_0x51b727){_0x3c8a38=_0x3c8a38-0x0;var _0x3839ef=_0x54c1[_0x3c8a38];return _0x3839ef;};'use strict';var multer=require('multer');var util=require(_0x154c('0x0'));var path=require(_0x154c('0x1'));var timeout=require(_0x154c('0x2'));var express=require(_0x154c('0x3'));var router=express['Router']();var fs_extra=require(_0x154c('0x4'));var auth=require(_0x154c('0x5'));var interaction=require(_0x154c('0x6'));var config=require(_0x154c('0x7'));var controller=require(_0x154c('0x8'));router[_0x154c('0x9')]('/',auth[_0x154c('0xa')](),controller['index']);router[_0x154c('0x9')]('/describe',auth[_0x154c('0xa')](),controller[_0x154c('0xb')]);router[_0x154c('0x9')](_0x154c('0xc'),auth[_0x154c('0xa')](),controller[_0x154c('0xd')]);router[_0x154c('0xe')]('/',auth[_0x154c('0xa')](),controller[_0x154c('0xf')]);router[_0x154c('0x10')](_0x154c('0xc'),auth[_0x154c('0xa')](),controller[_0x154c('0x11')]);router[_0x154c('0x12')](_0x154c('0xc'),auth[_0x154c('0xa')](),controller[_0x154c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 656c51e..9d4db90 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 _0x4fc2=['split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0x4fc2,0x111));var _0x24fc=function(_0x2b11c8,_0x20be4f){_0x2b11c8=_0x2b11c8-0x0;var _0x4c0768=_0x4fc2[_0x2b11c8];return _0x4c0768;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'name':{'type':Sequelize[_0x24fc('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x24fc('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x24fc('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x24fc('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x24fc('0x2')],'set':function(_0x541ad2){this[_0x24fc('0x4')](_0x24fc('0x5'),_0x541ad2?_0x541ad2['join'](''):[]);},'get':function(){return this[_0x24fc('0x6')](_0x24fc('0x5'))?this['getDataValue'](_0x24fc('0x5'))[_0x24fc('0x7')](''):[];}}}; \ No newline at end of file +var _0x1c7c=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','BOOLEAN'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0x1c7c,0x164));var _0xc1c7=function(_0x32f324,_0x21beef){_0x32f324=_0x32f324-0x0;var _0x2fdf6e=_0x1c7c[_0x32f324];return _0x2fdf6e;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'name':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc1c7('0x2')],'set':function(_0x20dad3){this[_0xc1c7('0x4')](_0xc1c7('0x5'),_0x20dad3?_0x20dad3[_0xc1c7('0x6')](''):[]);},'get':function(){return this[_0xc1c7('0x7')](_0xc1c7('0x5'))?this[_0xc1c7('0x7')](_0xc1c7('0x5'))[_0xc1c7('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 05c5a91..010fb80 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 _0x062e=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3525f8,_0x675b35){var _0x4c4511=function(_0x55c3fd){while(--_0x55c3fd){_0x3525f8['push'](_0x3525f8['shift']());}};_0x4c4511(++_0x675b35);}(_0x062e,0x195));var _0xe062=function(_0x4c689a,_0x1620de){_0x4c689a=_0x4c689a-0x0;var _0x5ba1dd=_0x062e[_0x4c689a];return _0x5ba1dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe062('0x0'));var rp=require('request-promise');var moment=require(_0xe062('0x1'));var BPromise=require(_0xe062('0x2'));var Mustache=require(_0xe062('0x3'));var util=require(_0xe062('0x4'));var path=require(_0xe062('0x5'));var sox=require(_0xe062('0x6'));var csv=require(_0xe062('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe062('0x8'));var crypto=require(_0xe062('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe062('0x7'));var querystring=require(_0xe062('0xa'));var Papa=require(_0xe062('0xb'));var Redis=require(_0xe062('0xc'));var authService=require(_0xe062('0xd'));var qs=require(_0xe062('0xe'));var as=require(_0xe062('0xf'));var hardwareService=require(_0xe062('0x10'));var logger=require(_0xe062('0x11'))(_0xe062('0x12'));var utils=require(_0xe062('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe062('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22ed7a,_0x31813c){_0x31813c=_0x31813c||0xcc;return function(_0x24a7d7){if(_0x24a7d7){return _0x22ed7a[_0xe062('0x15')](_0x31813c);}return _0x22ed7a[_0xe062('0x16')](_0x31813c)[_0xe062('0x17')]();};}function respondWithResult(_0x9565f8,_0x2d02cd){_0x2d02cd=_0x2d02cd||0xc8;return function(_0x26deeb){if(_0x26deeb){return _0x9565f8['status'](_0x2d02cd)[_0xe062('0x18')](_0x26deeb);}};}function respondWithFilteredResult(_0x3012f8,_0x5cc596){return function(_0x32c2fa){if(_0x32c2fa){var _0x4b70e7=typeof _0x5cc596[_0xe062('0x19')]===_0xe062('0x1a')&&typeof _0x5cc596[_0xe062('0x1b')]===_0xe062('0x1a');var _0x201f8a=_0x32c2fa[_0xe062('0x1c')];var _0x43aff4=_0x4b70e7?0x0:_0x5cc596['offset'];var _0x390b94=_0x4b70e7?_0x32c2fa['count']:_0x5cc596[_0xe062('0x19')]+_0x5cc596[_0xe062('0x1b')];var _0x51b677;if(_0x390b94>=_0x201f8a){_0x390b94=_0x201f8a;_0x51b677=0xc8;}else{_0x51b677=0xce;}_0x3012f8['status'](_0x51b677);return _0x3012f8['set'](_0xe062('0x1d'),_0x43aff4+'-'+_0x390b94+'/'+_0x201f8a)[_0xe062('0x18')](_0x32c2fa);}return null;};}function patchUpdates(_0x30b7ee){return function(_0x2fa8c1){try{jsonpatch[_0xe062('0x1e')](_0x2fa8c1,_0x30b7ee,!![]);}catch(_0x7d9dcc){return BPromise[_0xe062('0x1f')](_0x7d9dcc);}return _0x2fa8c1['save']();};}function saveUpdates(_0x4d3226,_0x5a8aef){return function(_0x10cb24){if(_0x10cb24){return _0x10cb24[_0xe062('0x20')](_0x4d3226)[_0xe062('0x21')](function(_0x4823c9){return _0x4823c9;});}return null;};}function removeEntity(_0x5ad507,_0x3a40c1){return function(_0x5e81de){if(_0x5e81de){return _0x5e81de['destroy']()[_0xe062('0x21')](function(){_0x5ad507[_0xe062('0x16')](0xcc)[_0xe062('0x17')]();});}};}function handleEntityNotFound(_0x383ecf,_0x2d3851){return function(_0x578de6){if(!_0x578de6){_0x383ecf[_0xe062('0x15')](0x194);}return _0x578de6;};}function handleError(_0x6bd041,_0x1c159d){_0x1c159d=_0x1c159d||0x1f4;return function(_0x543a66){logger[_0xe062('0x22')](_0x543a66[_0xe062('0x23')]);if(_0x543a66[_0xe062('0x24')]){delete _0x543a66['name'];}_0x6bd041[_0xe062('0x16')](_0x1c159d)['send'](_0x543a66);};}exports['index']=function(_0x4563e1,_0x5d1d5b){var _0x1474ff={},_0x2d4eb2={},_0x46b86a={'count':0x0,'rows':[]};var _0x2edf7b=_[_0xe062('0x25')](db[_0xe062('0x26')][_0xe062('0x27')],function(_0x551303){return{'name':_0x551303[_0xe062('0x28')],'type':_0x551303['type'][_0xe062('0x29')]};});_0x2d4eb2[_0xe062('0x2a')]=_[_0xe062('0x25')](_0x2edf7b,_0xe062('0x24'));_0x2d4eb2[_0xe062('0x2b')]=_[_0xe062('0x2c')](_0x4563e1[_0xe062('0x2b')]);_0x2d4eb2[_0xe062('0x2d')]=_[_0xe062('0x2e')](_0x2d4eb2[_0xe062('0x2a')],_0x2d4eb2[_0xe062('0x2b')]);_0x1474ff['attributes']=_[_0xe062('0x2e')](_0x2d4eb2[_0xe062('0x2a')],qs['fields'](_0x4563e1[_0xe062('0x2b')][_0xe062('0x2f')]));_0x1474ff[_0xe062('0x30')]=_0x1474ff[_0xe062('0x30')][_0xe062('0x31')]?_0x1474ff[_0xe062('0x30')]:_0x2d4eb2[_0xe062('0x2a')];if(!_0x4563e1[_0xe062('0x2b')]['hasOwnProperty'](_0xe062('0x32'))){_0x1474ff[_0xe062('0x1b')]=qs[_0xe062('0x1b')](_0x4563e1['query'][_0xe062('0x1b')]);_0x1474ff['offset']=qs[_0xe062('0x19')](_0x4563e1[_0xe062('0x2b')][_0xe062('0x19')]);}_0x1474ff[_0xe062('0x33')]=qs[_0xe062('0x34')](_0x4563e1[_0xe062('0x2b')]['sort']);_0x1474ff[_0xe062('0x35')]=qs[_0xe062('0x2d')](_[_0xe062('0x36')](_0x4563e1[_0xe062('0x2b')],_0x2d4eb2[_0xe062('0x2d')]),_0x2edf7b);if(_0x4563e1[_0xe062('0x2b')][_0xe062('0x37')]){_0x1474ff['where']=_['merge'](_0x1474ff['where'],{'$or':_[_0xe062('0x25')](_0x2edf7b,function(_0x23718e){if(_0x23718e[_0xe062('0x38')]!=='VIRTUAL'){var _0x199d25={};_0x199d25[_0x23718e[_0xe062('0x24')]]={'$like':'%'+_0x4563e1['query']['filter']+'%'};return _0x199d25;}})});}_0x1474ff=_[_0xe062('0x39')]({},_0x1474ff,_0x4563e1[_0xe062('0x3a')]);var _0x4676f1={'where':_0x1474ff[_0xe062('0x35')]};return db['UserProfileSection'][_0xe062('0x1c')](_0x4676f1)['then'](function(_0x4cf1fb){_0x46b86a[_0xe062('0x1c')]=_0x4cf1fb;if(_0x4563e1[_0xe062('0x2b')][_0xe062('0x3b')]){_0x1474ff[_0xe062('0x3c')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x1474ff);})[_0xe062('0x21')](function(_0x1becce){_0x46b86a[_0xe062('0x3d')]=_0x1becce;return _0x46b86a;})['then'](respondWithFilteredResult(_0x5d1d5b,_0x1474ff))['catch'](handleError(_0x5d1d5b,null));};exports[_0xe062('0x3e')]=function(_0x4f3f20,_0x5c3301){var _0x5f026d={'raw':![],'where':{'id':_0x4f3f20[_0xe062('0x3f')]['id']}},_0x343e52={};_0x343e52[_0xe062('0x2a')]=_[_0xe062('0x2c')](db['UserProfileSection'][_0xe062('0x27')]);_0x343e52[_0xe062('0x2b')]=_[_0xe062('0x2c')](_0x4f3f20[_0xe062('0x2b')]);_0x343e52[_0xe062('0x2d')]=_[_0xe062('0x2e')](_0x343e52[_0xe062('0x2a')],_0x343e52['query']);_0x5f026d[_0xe062('0x30')]=_['intersection'](_0x343e52[_0xe062('0x2a')],qs[_0xe062('0x2f')](_0x4f3f20['query']['fields']));_0x5f026d[_0xe062('0x30')]=_0x5f026d[_0xe062('0x30')][_0xe062('0x31')]?_0x5f026d[_0xe062('0x30')]:_0x343e52['model'];if(_0x4f3f20['query']['includeAll']){_0x5f026d[_0xe062('0x3c')]=[{'all':!![]}];}_0x5f026d=_[_0xe062('0x39')]({},_0x5f026d,_0x4f3f20[_0xe062('0x3a')]);return db[_0xe062('0x26')][_0xe062('0x40')](_0x5f026d)[_0xe062('0x21')](handleEntityNotFound(_0x5c3301,null))[_0xe062('0x21')](respondWithResult(_0x5c3301,null))[_0xe062('0x41')](handleError(_0x5c3301,null));};exports[_0xe062('0x42')]=function(_0x1faa7e,_0x5c6271){return db[_0xe062('0x26')]['create'](_0x1faa7e['body'],{})[_0xe062('0x21')](respondWithResult(_0x5c6271,0xc9))['catch'](handleError(_0x5c6271,null));};exports[_0xe062('0x20')]=function(_0x447460,_0x582d07){if(_0x447460[_0xe062('0x43')]['id']){delete _0x447460[_0xe062('0x43')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x447460[_0xe062('0x3f')]['id']}})[_0xe062('0x21')](handleEntityNotFound(_0x582d07,null))[_0xe062('0x21')](saveUpdates(_0x447460['body'],null))[_0xe062('0x21')](respondWithResult(_0x582d07,null))[_0xe062('0x41')](handleError(_0x582d07,null));};exports[_0xe062('0x44')]=function(_0x1825f5,_0x5f2252){return db['UserProfileSection'][_0xe062('0x40')]({'where':{'id':_0x1825f5['params']['id']}})['then'](handleEntityNotFound(_0x5f2252,null))[_0xe062('0x21')](removeEntity(_0x5f2252,null))[_0xe062('0x41')](handleError(_0x5f2252,null));};exports[_0xe062('0x45')]=function(_0x372088,_0x2712c2){return db[_0xe062('0x26')][_0xe062('0x45')]()['then'](respondWithResult(_0x2712c2,null))['catch'](handleError(_0x2712c2,null));}; \ No newline at end of file +var _0x1a1c=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','include','rows','catch','show','params','includeAll','options','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','error','name','index','map','UserProfileSection','rawAttributes','model','query','keys'];(function(_0x1e10dd,_0x408021){var _0x364435=function(_0x140dab){while(--_0x140dab){_0x1e10dd['push'](_0x1e10dd['shift']());}};_0x364435(++_0x408021);}(_0x1a1c,0xa8));var _0xc1a1=function(_0x33de8b,_0x47856f){_0x33de8b=_0x33de8b-0x0;var _0x182144=_0x1a1c[_0x33de8b];return _0x182144;};'use strict';var emlformat=require(_0xc1a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1a1('0x1'));var jsonpatch=require(_0xc1a1('0x2'));var rp=require('request-promise');var moment=require(_0xc1a1('0x3'));var BPromise=require(_0xc1a1('0x4'));var Mustache=require(_0xc1a1('0x5'));var util=require(_0xc1a1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc1a1('0x7'));var ejs=require(_0xc1a1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1a1('0x9'));var squel=require(_0xc1a1('0xa'));var crypto=require(_0xc1a1('0xb'));var jsforce=require(_0xc1a1('0xc'));var deskjs=require(_0xc1a1('0xd'));var toCsv=require(_0xc1a1('0x7'));var querystring=require(_0xc1a1('0xe'));var Papa=require('papaparse');var Redis=require(_0xc1a1('0xf'));var authService=require(_0xc1a1('0x10'));var qs=require(_0xc1a1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1a1('0x12'));var logger=require(_0xc1a1('0x13'))(_0xc1a1('0x14'));var utils=require(_0xc1a1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc1a1('0x16'))['db'];function respondWithStatusCode(_0x3360d1,_0x5937b8){_0x5937b8=_0x5937b8||0xcc;return function(_0x3b88fc){if(_0x3b88fc){return _0x3360d1[_0xc1a1('0x17')](_0x5937b8);}return _0x3360d1[_0xc1a1('0x18')](_0x5937b8)[_0xc1a1('0x19')]();};}function respondWithResult(_0x2cdadc,_0x4e1a6b){_0x4e1a6b=_0x4e1a6b||0xc8;return function(_0x388f7c){if(_0x388f7c){return _0x2cdadc[_0xc1a1('0x18')](_0x4e1a6b)['json'](_0x388f7c);}};}function respondWithFilteredResult(_0x4d8748,_0x18e753){return function(_0x1b8b6e){if(_0x1b8b6e){var _0x11a0a0=typeof _0x18e753[_0xc1a1('0x1a')]===_0xc1a1('0x1b')&&typeof _0x18e753[_0xc1a1('0x1c')]===_0xc1a1('0x1b');var _0x2c0e81=_0x1b8b6e['count'];var _0x447934=_0x11a0a0?0x0:_0x18e753[_0xc1a1('0x1a')];var _0x118031=_0x11a0a0?_0x1b8b6e[_0xc1a1('0x1d')]:_0x18e753[_0xc1a1('0x1a')]+_0x18e753[_0xc1a1('0x1c')];var _0x2c03c8;if(_0x118031>=_0x2c0e81){_0x118031=_0x2c0e81;_0x2c03c8=0xc8;}else{_0x2c03c8=0xce;}_0x4d8748[_0xc1a1('0x18')](_0x2c03c8);return _0x4d8748['set'](_0xc1a1('0x1e'),_0x447934+'-'+_0x118031+'/'+_0x2c0e81)[_0xc1a1('0x1f')](_0x1b8b6e);}return null;};}function patchUpdates(_0xfcf7b3){return function(_0x3b178c){try{jsonpatch['apply'](_0x3b178c,_0xfcf7b3,!![]);}catch(_0x488202){return BPromise[_0xc1a1('0x20')](_0x488202);}return _0x3b178c[_0xc1a1('0x21')]();};}function saveUpdates(_0x2a7173,_0x24565a){return function(_0x5d0472){if(_0x5d0472){return _0x5d0472['update'](_0x2a7173)[_0xc1a1('0x22')](function(_0x30fe85){return _0x30fe85;});}return null;};}function removeEntity(_0x1d2b5e,_0x524958){return function(_0x5580e3){if(_0x5580e3){return _0x5580e3[_0xc1a1('0x23')]()['then'](function(){_0x1d2b5e[_0xc1a1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6c940,_0x3e9814){return function(_0x5c04b7){if(!_0x5c04b7){_0xd6c940[_0xc1a1('0x17')](0x194);}return _0x5c04b7;};}function handleError(_0x4ca908,_0x15ddd3){_0x15ddd3=_0x15ddd3||0x1f4;return function(_0x52bb2a){logger[_0xc1a1('0x24')](_0x52bb2a['stack']);if(_0x52bb2a[_0xc1a1('0x25')]){delete _0x52bb2a[_0xc1a1('0x25')];}_0x4ca908['status'](_0x15ddd3)['send'](_0x52bb2a);};}exports[_0xc1a1('0x26')]=function(_0x21c0b6,_0x445f4a){var _0x14677a={},_0x4590c1={},_0x3f4f6f={'count':0x0,'rows':[]};var _0x22d3a6=_[_0xc1a1('0x27')](db[_0xc1a1('0x28')][_0xc1a1('0x29')],function(_0x2908b3){return{'name':_0x2908b3['fieldName'],'type':_0x2908b3['type']['key']};});_0x4590c1[_0xc1a1('0x2a')]=_[_0xc1a1('0x27')](_0x22d3a6,'name');_0x4590c1[_0xc1a1('0x2b')]=_[_0xc1a1('0x2c')](_0x21c0b6['query']);_0x4590c1[_0xc1a1('0x2d')]=_[_0xc1a1('0x2e')](_0x4590c1[_0xc1a1('0x2a')],_0x4590c1[_0xc1a1('0x2b')]);_0x14677a['attributes']=_[_0xc1a1('0x2e')](_0x4590c1[_0xc1a1('0x2a')],qs[_0xc1a1('0x2f')](_0x21c0b6['query']['fields']));_0x14677a['attributes']=_0x14677a[_0xc1a1('0x30')][_0xc1a1('0x31')]?_0x14677a['attributes']:_0x4590c1['model'];if(!_0x21c0b6[_0xc1a1('0x2b')][_0xc1a1('0x32')](_0xc1a1('0x33'))){_0x14677a[_0xc1a1('0x1c')]=qs[_0xc1a1('0x1c')](_0x21c0b6['query'][_0xc1a1('0x1c')]);_0x14677a['offset']=qs['offset'](_0x21c0b6[_0xc1a1('0x2b')][_0xc1a1('0x1a')]);}_0x14677a['order']=qs[_0xc1a1('0x34')](_0x21c0b6['query'][_0xc1a1('0x34')]);_0x14677a['where']=qs[_0xc1a1('0x2d')](_[_0xc1a1('0x35')](_0x21c0b6[_0xc1a1('0x2b')],_0x4590c1[_0xc1a1('0x2d')]),_0x22d3a6);if(_0x21c0b6[_0xc1a1('0x2b')][_0xc1a1('0x36')]){_0x14677a[_0xc1a1('0x37')]=_[_0xc1a1('0x38')](_0x14677a['where'],{'$or':_[_0xc1a1('0x27')](_0x22d3a6,function(_0x4088c2){if(_0x4088c2[_0xc1a1('0x39')]!==_0xc1a1('0x3a')){var _0xcf17a0={};_0xcf17a0[_0x4088c2[_0xc1a1('0x25')]]={'$like':'%'+_0x21c0b6['query'][_0xc1a1('0x36')]+'%'};return _0xcf17a0;}})});}_0x14677a=_[_0xc1a1('0x38')]({},_0x14677a,_0x21c0b6['options']);var _0xf0a220={'where':_0x14677a[_0xc1a1('0x37')]};return db['UserProfileSection'][_0xc1a1('0x1d')](_0xf0a220)['then'](function(_0xfa15af){_0x3f4f6f[_0xc1a1('0x1d')]=_0xfa15af;if(_0x21c0b6[_0xc1a1('0x2b')]['includeAll']){_0x14677a[_0xc1a1('0x3b')]=[{'all':!![]}];}return db[_0xc1a1('0x28')]['findAll'](_0x14677a);})[_0xc1a1('0x22')](function(_0x39b086){_0x3f4f6f[_0xc1a1('0x3c')]=_0x39b086;return _0x3f4f6f;})[_0xc1a1('0x22')](respondWithFilteredResult(_0x445f4a,_0x14677a))[_0xc1a1('0x3d')](handleError(_0x445f4a,null));};exports[_0xc1a1('0x3e')]=function(_0x32abc4,_0x578336){var _0x4b4b81={'raw':![],'where':{'id':_0x32abc4[_0xc1a1('0x3f')]['id']}},_0x11b96f={};_0x11b96f['model']=_[_0xc1a1('0x2c')](db[_0xc1a1('0x28')][_0xc1a1('0x29')]);_0x11b96f[_0xc1a1('0x2b')]=_[_0xc1a1('0x2c')](_0x32abc4[_0xc1a1('0x2b')]);_0x11b96f['filters']=_[_0xc1a1('0x2e')](_0x11b96f['model'],_0x11b96f[_0xc1a1('0x2b')]);_0x4b4b81[_0xc1a1('0x30')]=_[_0xc1a1('0x2e')](_0x11b96f[_0xc1a1('0x2a')],qs[_0xc1a1('0x2f')](_0x32abc4[_0xc1a1('0x2b')][_0xc1a1('0x2f')]));_0x4b4b81[_0xc1a1('0x30')]=_0x4b4b81[_0xc1a1('0x30')][_0xc1a1('0x31')]?_0x4b4b81[_0xc1a1('0x30')]:_0x11b96f[_0xc1a1('0x2a')];if(_0x32abc4[_0xc1a1('0x2b')][_0xc1a1('0x40')]){_0x4b4b81[_0xc1a1('0x3b')]=[{'all':!![]}];}_0x4b4b81=_[_0xc1a1('0x38')]({},_0x4b4b81,_0x32abc4[_0xc1a1('0x41')]);return db[_0xc1a1('0x28')]['find'](_0x4b4b81)[_0xc1a1('0x22')](handleEntityNotFound(_0x578336,null))['then'](respondWithResult(_0x578336,null))['catch'](handleError(_0x578336,null));};exports[_0xc1a1('0x42')]=function(_0x27f2e4,_0x221869){return db[_0xc1a1('0x28')][_0xc1a1('0x42')](_0x27f2e4[_0xc1a1('0x43')],{})[_0xc1a1('0x22')](respondWithResult(_0x221869,0xc9))[_0xc1a1('0x3d')](handleError(_0x221869,null));};exports[_0xc1a1('0x44')]=function(_0xd9bdb0,_0x256065){if(_0xd9bdb0[_0xc1a1('0x43')]['id']){delete _0xd9bdb0[_0xc1a1('0x43')]['id'];}return db[_0xc1a1('0x28')][_0xc1a1('0x45')]({'where':{'id':_0xd9bdb0['params']['id']}})[_0xc1a1('0x22')](handleEntityNotFound(_0x256065,null))[_0xc1a1('0x22')](saveUpdates(_0xd9bdb0[_0xc1a1('0x43')],null))['then'](respondWithResult(_0x256065,null))['catch'](handleError(_0x256065,null));};exports['destroy']=function(_0x2a9e11,_0x5acd9f){return db['UserProfileSection'][_0xc1a1('0x45')]({'where':{'id':_0x2a9e11[_0xc1a1('0x3f')]['id']}})[_0xc1a1('0x22')](handleEntityNotFound(_0x5acd9f,null))[_0xc1a1('0x22')](removeEntity(_0x5acd9f,null))[_0xc1a1('0x3d')](handleError(_0x5acd9f,null));};exports[_0xc1a1('0x46')]=function(_0x5f0b7e,_0x35300f){return db[_0xc1a1('0x28')]['describe']()[_0xc1a1('0x22')](respondWithResult(_0x35300f,null))[_0xc1a1('0x3d')](handleError(_0x35300f,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e1f7e80..043ea3f 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 _0x4b8c=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x4b8c,0xa8));var _0xc4b8=function(_0x522104,_0x260bde){_0x522104=_0x522104-0x0;var _0x552027=_0x4b8c[_0x522104];return _0x552027;};'use strict';var _=require(_0xc4b8('0x0'));var util=require(_0xc4b8('0x1'));var logger=require(_0xc4b8('0x2'))(_0xc4b8('0x3'));var moment=require(_0xc4b8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4b8('0x5'));var rimraf=require(_0xc4b8('0x6'));var config=require(_0xc4b8('0x7'));var attributes=require('./userProfileSection.attributes');module[_0xc4b8('0x8')]=function(_0x2e9528,_0x17fc81){return _0x2e9528['define'](_0xc4b8('0x9'),attributes,{'tableName':_0xc4b8('0xa'),'paranoid':![],'indexes':[{'name':_0xc4b8('0xb'),'fields':[_0xc4b8('0xc'),_0xc4b8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5abc=['request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1846b8,_0x5e9fd2){var _0x5d29ea=function(_0x26ffc3){while(--_0x26ffc3){_0x1846b8['push'](_0x1846b8['shift']());}};_0x5d29ea(++_0x5e9fd2);}(_0x5abc,0x105));var _0xc5ab=function(_0x24da6d,_0x2ce103){_0x24da6d=_0x24da6d-0x0;var _0xd7ee93=_0x5abc[_0x24da6d];return _0xd7ee93;};'use strict';var _=require(_0xc5ab('0x0'));var util=require(_0xc5ab('0x1'));var logger=require(_0xc5ab('0x2'))('api');var moment=require(_0xc5ab('0x3'));var BPromise=require(_0xc5ab('0x4'));var rp=require(_0xc5ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5ab('0x6'));var config=require('../../config/environment');var attributes=require(_0xc5ab('0x7'));module[_0xc5ab('0x8')]=function(_0x1e3ffa,_0x540ff7){return _0x1e3ffa[_0xc5ab('0x9')](_0xc5ab('0xa'),attributes,{'tableName':_0xc5ab('0xb'),'paranoid':![],'indexes':[{'name':_0xc5ab('0xc'),'fields':['sectionId',_0xc5ab('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index c527250..6101e23 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 _0xc362=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x29982b,_0x594e0){var _0xb1f0a9=function(_0x3d824c){while(--_0x3d824c){_0x29982b['push'](_0x29982b['shift']());}};_0xb1f0a9(++_0x594e0);}(_0xc362,0x82));var _0x2c36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc362[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2c36('0x0'));var moment=require('moment');var BPromise=require(_0x2c36('0x1'));var rs=require(_0x2c36('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c36('0x3'))['db'];var utils=require(_0x2c36('0x4'));var logger=require(_0x2c36('0x5'))(_0x2c36('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c36('0x7'));var client=jayson[_0x2c36('0x8')][_0x2c36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e3bd5,_0x9487e9,_0x339327){return new BPromise(function(_0x6ffceb,_0x45bdec){return client[_0x2c36('0xa')](_0x5e3bd5,_0x339327)[_0x2c36('0xb')](function(_0x501e97){logger[_0x2c36('0xc')](_0x2c36('0xd'),_0x9487e9,_0x2c36('0xe'));logger['debug'](_0x2c36('0xf'),_0x9487e9,_0x2c36('0xe'),JSON[_0x2c36('0x10')](_0x501e97));if(_0x501e97[_0x2c36('0x11')]){if(_0x501e97[_0x2c36('0x11')][_0x2c36('0x12')]===0x1f4){logger[_0x2c36('0x11')](_0x2c36('0xd'),_0x9487e9,_0x501e97['error']['message']);return _0x45bdec(_0x501e97[_0x2c36('0x11')][_0x2c36('0x13')]);}logger[_0x2c36('0x11')](_0x2c36('0xd'),_0x9487e9,_0x501e97[_0x2c36('0x11')][_0x2c36('0x13')]);return _0x6ffceb(_0x501e97[_0x2c36('0x11')][_0x2c36('0x13')]);}else{logger['info'](_0x2c36('0xd'),_0x9487e9,_0x2c36('0xe'));_0x6ffceb(_0x501e97[_0x2c36('0x14')][_0x2c36('0x13')]);}})[_0x2c36('0x15')](function(_0x22cb9a){logger[_0x2c36('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x9487e9,_0x22cb9a);_0x45bdec(_0x22cb9a);});});} \ No newline at end of file +var _0x18c4=['http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x254939,_0x4ccf4b){var _0x3a40ce=function(_0x272967){while(--_0x272967){_0x254939['push'](_0x254939['shift']());}};_0x3a40ce(++_0x4ccf4b);}(_0x18c4,0xf3));var _0x418c=function(_0x1473d6,_0x3c0c6d){_0x1473d6=_0x1473d6-0x0;var _0x3d00b7=_0x18c4[_0x1473d6];return _0x3d00b7;};'use strict';var _=require(_0x418c('0x0'));var util=require(_0x418c('0x1'));var moment=require(_0x418c('0x2'));var BPromise=require('bluebird');var rs=require(_0x418c('0x3'));var fs=require('fs');var Redis=require(_0x418c('0x4'));var db=require(_0x418c('0x5'))['db'];var utils=require(_0x418c('0x6'));var logger=require(_0x418c('0x7'))(_0x418c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x418c('0x9')][_0x418c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49ad4f,_0x3a13a0,_0x4c7e27){return new BPromise(function(_0x5e15ec,_0x57e1f8){return client[_0x418c('0xb')](_0x49ad4f,_0x4c7e27)['then'](function(_0x55faf2){logger[_0x418c('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x3a13a0,_0x418c('0xd'));logger[_0x418c('0xe')](_0x418c('0xf'),_0x3a13a0,_0x418c('0xd'),JSON[_0x418c('0x10')](_0x55faf2));if(_0x55faf2[_0x418c('0x11')]){if(_0x55faf2[_0x418c('0x11')][_0x418c('0x12')]===0x1f4){logger[_0x418c('0x11')](_0x418c('0x13'),_0x3a13a0,_0x55faf2[_0x418c('0x11')]['message']);return _0x57e1f8(_0x55faf2[_0x418c('0x11')][_0x418c('0x14')]);}logger[_0x418c('0x11')](_0x418c('0x13'),_0x3a13a0,_0x55faf2[_0x418c('0x11')][_0x418c('0x14')]);return _0x5e15ec(_0x55faf2['error']['message']);}else{logger[_0x418c('0xc')](_0x418c('0x13'),_0x3a13a0,'request\x20sent');_0x5e15ec(_0x55faf2[_0x418c('0x15')][_0x418c('0x14')]);}})[_0x418c('0x16')](function(_0x5b4bc5){logger[_0x418c('0x11')](_0x418c('0x13'),_0x3a13a0,_0x5b4bc5);_0x57e1f8(_0x5b4bc5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e7baf5c..db047bb 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x32096b,_0x425f04){var _0xfdc092=function(_0x4c970a){while(--_0x4c970a){_0x32096b['push'](_0x32096b['shift']());}};_0xfdc092(++_0x425f04);}(_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(_0x1e327c,_0xa6c750){var _0x2c401f=function(_0x2b1ec3){while(--_0x2b1ec3){_0x1e327c['push'](_0x1e327c['shift']());}};_0x2c401f(++_0xa6c750);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 09f7a88..d614ed4 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 _0xc556=['INTEGER','sequelize'];(function(_0x14feed,_0x49d56d){var _0x3e939c=function(_0x3685e7){while(--_0x3685e7){_0x14feed['push'](_0x14feed['shift']());}};_0x3e939c(++_0x49d56d);}(_0xc556,0xc3));var _0x6c55=function(_0x35ef47,_0x4590ae){_0x35ef47=_0x35ef47-0x0;var _0x3a8b18=_0xc556[_0x35ef47];return _0x3a8b18;};'use strict';var Sequelize=require(_0x6c55('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6c55('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9ea2=['sequelize'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x9ea2,0x147));var _0x29ea=function(_0x5c0db5,_0x333544){_0x5c0db5=_0x5c0db5-0x0;var _0x41a243=_0x9ea2[_0x5c0db5];return _0x41a243;};'use strict';var Sequelize=require(_0x29ea('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 3de264f..6de2df3 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 _0xd117=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0xd117,0x182));var _0x7d11=function(_0xf2726b,_0x87deb7){_0xf2726b=_0xf2726b-0x0;var _0xa61a5=_0xd117[_0xf2726b];return _0xa61a5;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa498=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue'];(function(_0x55bdf3,_0x3a81b2){var _0x522f9a=function(_0x2a6e65){while(--_0x2a6e65){_0x55bdf3['push'](_0x55bdf3['shift']());}};_0x522f9a(++_0x3a81b2);}(_0xa498,0x1d6));var _0x8a49=function(_0x32b3c2,_0xe56fd){_0x32b3c2=_0x32b3c2-0x0;var _0x40a313=_0xa498[_0x32b3c2];return _0x40a313;};'use strict';var _=require('lodash');var util=require(_0x8a49('0x0'));var logger=require(_0x8a49('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8a49('0x2'));var rp=require(_0x8a49('0x3'));var fs=require('fs');var path=require(_0x8a49('0x4'));var rimraf=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x8a49('0x7')]=function(_0x5c5df6,_0x366d5b){return _0x5c5df6[_0x8a49('0x8')](_0x8a49('0x9'),attributes,{'tableName':'user_has_sms_queues','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 20bd1b2..c27262d 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 _0x5aea=['jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x470f97,_0x5b2035){var _0x32873e=function(_0x1fc7d7){while(--_0x1fc7d7){_0x470f97['push'](_0x470f97['shift']());}};_0x32873e(++_0x5b2035);}(_0x5aea,0x194));var _0xa5ae=function(_0x4adaf7,_0x2df54d){_0x4adaf7=_0x4adaf7-0x0;var _0x2e958b=_0x5aea[_0x4adaf7];return _0x2e958b;};'use strict';var _=require(_0xa5ae('0x0'));var util=require(_0xa5ae('0x1'));var moment=require(_0xa5ae('0x2'));var BPromise=require(_0xa5ae('0x3'));var rs=require(_0xa5ae('0x4'));var fs=require('fs');var Redis=require(_0xa5ae('0x5'));var db=require(_0xa5ae('0x6'))['db'];var utils=require(_0xa5ae('0x7'));var logger=require(_0xa5ae('0x8'))('rpc');var config=require(_0xa5ae('0x9'));var jayson=require(_0xa5ae('0xa'));var client=jayson['client'][_0xa5ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x456433,_0x2deae8,_0x4d1799){return new BPromise(function(_0x14223f,_0x41d3e2){return client[_0xa5ae('0xc')](_0x456433,_0x4d1799)[_0xa5ae('0xd')](function(_0x259942){logger[_0xa5ae('0xe')](_0xa5ae('0xf'),_0x2deae8,'request\x20sent');logger[_0xa5ae('0x10')](_0xa5ae('0x11'),_0x2deae8,_0xa5ae('0x12'),JSON['stringify'](_0x259942));if(_0x259942['error']){if(_0x259942[_0xa5ae('0x13')][_0xa5ae('0x14')]===0x1f4){logger[_0xa5ae('0x13')](_0xa5ae('0xf'),_0x2deae8,_0x259942['error']['message']);return _0x41d3e2(_0x259942[_0xa5ae('0x13')][_0xa5ae('0x15')]);}logger[_0xa5ae('0x13')](_0xa5ae('0xf'),_0x2deae8,_0x259942[_0xa5ae('0x13')]['message']);return _0x14223f(_0x259942[_0xa5ae('0x13')][_0xa5ae('0x15')]);}else{logger[_0xa5ae('0xe')](_0xa5ae('0xf'),_0x2deae8,'request\x20sent');_0x14223f(_0x259942['result'][_0xa5ae('0x15')]);}})[_0xa5ae('0x16')](function(_0x54b8a3){logger[_0xa5ae('0x13')](_0xa5ae('0xf'),_0x2deae8,_0x54b8a3);_0x41d3e2(_0x54b8a3);});});} \ No newline at end of file +var _0x313d=['info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x5c4609,_0x57fb78){var _0x507834=function(_0x59326b){while(--_0x59326b){_0x5c4609['push'](_0x5c4609['shift']());}};_0x507834(++_0x57fb78);}(_0x313d,0xe3));var _0xd313=function(_0x72cf5c,_0xed7b26){_0x72cf5c=_0x72cf5c-0x0;var _0x47752f=_0x313d[_0x72cf5c];return _0x47752f;};'use strict';var _=require(_0xd313('0x0'));var util=require('util');var moment=require(_0xd313('0x1'));var BPromise=require(_0xd313('0x2'));var rs=require(_0xd313('0x3'));var fs=require('fs');var Redis=require(_0xd313('0x4'));var db=require(_0xd313('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd313('0x6'))(_0xd313('0x7'));var config=require(_0xd313('0x8'));var jayson=require(_0xd313('0x9'));var client=jayson[_0xd313('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8a05,_0x44b2ae,_0x2fbeb1){return new BPromise(function(_0x45debb,_0x1d9824){return client[_0xd313('0xb')](_0x4c8a05,_0x2fbeb1)[_0xd313('0xc')](function(_0x222b29){logger[_0xd313('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x44b2ae,_0xd313('0xe'));logger[_0xd313('0xf')](_0xd313('0x10'),_0x44b2ae,_0xd313('0xe'),JSON[_0xd313('0x11')](_0x222b29));if(_0x222b29[_0xd313('0x12')]){if(_0x222b29[_0xd313('0x12')][_0xd313('0x13')]===0x1f4){logger[_0xd313('0x12')](_0xd313('0x14'),_0x44b2ae,_0x222b29[_0xd313('0x12')]['message']);return _0x1d9824(_0x222b29[_0xd313('0x12')][_0xd313('0x15')]);}logger[_0xd313('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x44b2ae,_0x222b29[_0xd313('0x12')]['message']);return _0x45debb(_0x222b29[_0xd313('0x12')][_0xd313('0x15')]);}else{logger['info'](_0xd313('0x14'),_0x44b2ae,'request\x20sent');_0x45debb(_0x222b29[_0xd313('0x16')][_0xd313('0x15')]);}})[_0xd313('0x17')](function(_0x1b8eda){logger[_0xd313('0x12')](_0xd313('0x14'),_0x44b2ae,_0x1b8eda);_0x1d9824(_0x1b8eda);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 627d8ee..3bbf581 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 _0xa6fc=['exports','INTEGER'];(function(_0x4e8c3b,_0x3d2c83){var _0x5c5980=function(_0x16d111){while(--_0x16d111){_0x4e8c3b['push'](_0x4e8c3b['shift']());}};_0x5c5980(++_0x3d2c83);}(_0xa6fc,0x13c));var _0xca6f=function(_0x438bee,_0x31a3b5){_0x438bee=_0x438bee-0x0;var _0x4c0da2=_0xa6fc[_0x438bee];return _0x4c0da2;};'use strict';var Sequelize=require('sequelize');module[_0xca6f('0x0')]={'UserId':{'type':Sequelize[_0xca6f('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xca6f('0x1')]}}; \ No newline at end of file +var _0xebdd=['INTEGER','sequelize','exports'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0xebdd,0x19f));var _0xdebd=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xebdd[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0xdebd('0x0'));module[_0xdebd('0x1')]={'UserId':{'type':Sequelize[_0xdebd('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e2797c7..88bd037 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(_0x1c9270,_0xd5cd19){var _0x285e51=function(_0x174e75){while(--_0x174e75){_0x1c9270['push'](_0x1c9270['shift']());}};_0x285e51(++_0xd5cd19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x4acc37,_0x21da63){var _0x22e2d0=function(_0x3d1a39){while(--_0x3d1a39){_0x4acc37['push'](_0x4acc37['shift']());}};_0x22e2d0(++_0x21da63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 9115520..eb6cec5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4568f5,_0x5a9d87){var _0x598af5=function(_0x3fd2f6){while(--_0x3fd2f6){_0x4568f5['push'](_0x4568f5['shift']());}};_0x598af5(++_0x5a9d87);}(_0xe706,0xa3));var _0x6e70=function(_0x2c4a45,_0x8836e3){_0x2c4a45=_0x2c4a45-0x0;var _0x51c36e=_0xe706[_0x2c4a45];return _0x51c36e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x34421e,_0xf309a2){var _0x5725d7=function(_0x367fbf){while(--_0x367fbf){_0x34421e['push'](_0x34421e['shift']());}};_0x5725d7(++_0xf309a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index cbec150..d39354a 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 _0xe58d=['INTEGER','sequelize','exports'];(function(_0x20c9d6,_0x160bea){var _0x3b8794=function(_0x56f346){while(--_0x56f346){_0x20c9d6['push'](_0x20c9d6['shift']());}};_0x3b8794(++_0x160bea);}(_0xe58d,0xac));var _0xde58=function(_0x5ef711,_0x3b45f8){_0x5ef711=_0x5ef711-0x0;var _0xb96bd7=_0xe58d[_0x5ef711];return _0xb96bd7;};'use strict';var Sequelize=require(_0xde58('0x0'));module[_0xde58('0x1')]={'penalty':{'type':Sequelize[_0xde58('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x46d2=['sequelize','exports','INTEGER'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x46d2,0x19e));var _0x246d=function(_0x44d3ae,_0x25d67b){_0x44d3ae=_0x44d3ae-0x0;var _0x55c8ec=_0x46d2[_0x44d3ae];return _0x55c8ec;};'use strict';var Sequelize=require(_0x246d('0x0'));module[_0x246d('0x1')]={'penalty':{'type':Sequelize[_0x246d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 3732297..f2d23ba 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 _0x3176=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x27be68,_0x23f689){var _0x276c14=function(_0x643f90){while(--_0x643f90){_0x27be68['push'](_0x27be68['shift']());}};_0x276c14(++_0x23f689);}(_0x3176,0x1d8));var _0x6317=function(_0x300da3,_0x4cb1c8){_0x300da3=_0x300da3-0x0;var _0x2bf5f0=_0x3176[_0x300da3];return _0x2bf5f0;};'use strict';var _=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var logger=require(_0x6317('0x2'))(_0x6317('0x3'));var moment=require(_0x6317('0x4'));var BPromise=require(_0x6317('0x5'));var rp=require(_0x6317('0x6'));var fs=require('fs');var path=require(_0x6317('0x7'));var rimraf=require(_0x6317('0x8'));var config=require(_0x6317('0x9'));var attributes=require(_0x6317('0xa'));module[_0x6317('0xb')]=function(_0x46f4c9,_0x354521){return _0x46f4c9[_0x6317('0xc')](_0x6317('0xd'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9200=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9200,0x11d));var _0x0920=function(_0xaca245,_0x1b5a54){_0xaca245=_0xaca245-0x0;var _0x292dce=_0x9200[_0xaca245];return _0x292dce;};'use strict';var _=require(_0x0920('0x0'));var util=require(_0x0920('0x1'));var logger=require(_0x0920('0x2'))('api');var moment=require(_0x0920('0x3'));var BPromise=require(_0x0920('0x4'));var rp=require(_0x0920('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0920('0x6'));var attributes=require(_0x0920('0x7'));module['exports']=function(_0x252c26,_0x51d965){return _0x252c26[_0x0920('0x8')](_0x0920('0x9'),attributes,{'tableName':_0x0920('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 d1df050..89dd0a2 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 _0xf7f1=['request','then','info','request\x20sent','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x3cb21e,_0x11849a){var _0xeacd6a=function(_0xef5a2e){while(--_0xef5a2e){_0x3cb21e['push'](_0x3cb21e['shift']());}};_0xeacd6a(++_0x11849a);}(_0xf7f1,0x1cb));var _0x1f7f=function(_0x500c8e,_0x3221d3){_0x500c8e=_0x500c8e-0x0;var _0x15ff69=_0xf7f1[_0x500c8e];return _0x15ff69;};'use strict';var _=require(_0x1f7f('0x0'));var util=require(_0x1f7f('0x1'));var moment=require(_0x1f7f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f7f('0x4'));var logger=require('../../config/logger')(_0x1f7f('0x5'));var config=require(_0x1f7f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1f7f('0x7')][_0x1f7f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34826b,_0x1c1a73,_0x96a60f){return new BPromise(function(_0x29dfe0,_0x4faaa0){return client[_0x1f7f('0x9')](_0x34826b,_0x96a60f)[_0x1f7f('0xa')](function(_0x50ee76){logger[_0x1f7f('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x1c1a73,_0x1f7f('0xc'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1c1a73,_0x1f7f('0xc'),JSON['stringify'](_0x50ee76));if(_0x50ee76['error']){if(_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0xe')]===0x1f4){logger[_0x1f7f('0xd')](_0x1f7f('0xf'),_0x1c1a73,_0x50ee76['error'][_0x1f7f('0x10')]);return _0x4faaa0(_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0x10')]);}logger[_0x1f7f('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1c1a73,_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0x10')]);return _0x29dfe0(_0x50ee76[_0x1f7f('0xd')][_0x1f7f('0x10')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x1c1a73,_0x1f7f('0xc'));_0x29dfe0(_0x50ee76['result'][_0x1f7f('0x10')]);}})[_0x1f7f('0x11')](function(_0x584981){logger['error'](_0x1f7f('0xf'),_0x1c1a73,_0x584981);_0x4faaa0(_0x584981);});});} \ No newline at end of file +var _0xbd57=['error','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19cbac,_0x4a7597){var _0x180da3=function(_0x219c1a){while(--_0x219c1a){_0x19cbac['push'](_0x19cbac['shift']());}};_0x180da3(++_0x4a7597);}(_0xbd57,0x164));var _0x7bd5=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbd57[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x7bd5('0x0'));var util=require(_0x7bd5('0x1'));var moment=require(_0x7bd5('0x2'));var BPromise=require(_0x7bd5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bd5('0x4'));var db=require(_0x7bd5('0x5'))['db'];var utils=require(_0x7bd5('0x6'));var logger=require(_0x7bd5('0x7'))(_0x7bd5('0x8'));var config=require(_0x7bd5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7bd5('0xa')][_0x7bd5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0eb0d,_0x53940f,_0x2e9077){return new BPromise(function(_0x29ec74,_0x8f143d){return client[_0x7bd5('0xc')](_0xd0eb0d,_0x2e9077)[_0x7bd5('0xd')](function(_0x1bd53e){logger[_0x7bd5('0xe')](_0x7bd5('0xf'),_0x53940f,'request\x20sent');logger['debug'](_0x7bd5('0x10'),_0x53940f,'request\x20sent',JSON[_0x7bd5('0x11')](_0x1bd53e));if(_0x1bd53e[_0x7bd5('0x12')]){if(_0x1bd53e['error']['code']===0x1f4){logger[_0x7bd5('0x12')](_0x7bd5('0xf'),_0x53940f,_0x1bd53e[_0x7bd5('0x12')]['message']);return _0x8f143d(_0x1bd53e[_0x7bd5('0x12')][_0x7bd5('0x13')]);}logger[_0x7bd5('0x12')](_0x7bd5('0xf'),_0x53940f,_0x1bd53e['error'][_0x7bd5('0x13')]);return _0x29ec74(_0x1bd53e[_0x7bd5('0x12')][_0x7bd5('0x13')]);}else{logger[_0x7bd5('0xe')](_0x7bd5('0xf'),_0x53940f,_0x7bd5('0x14'));_0x29ec74(_0x1bd53e['result'][_0x7bd5('0x13')]);}})[_0x7bd5('0x15')](function(_0xcd1612){logger['error'](_0x7bd5('0xf'),_0x53940f,_0xcd1612);_0x8f143d(_0xcd1612);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9037b4f..eb2ab56 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x17a607,_0x483d05){var _0x42d0a6=function(_0x47c931){while(--_0x47c931){_0x17a607['push'](_0x17a607['shift']());}};_0x42d0a6(++_0x483d05);}(_0x70e0,0x17b));var _0x070e=function(_0x2ee743,_0xaa50be){_0x2ee743=_0x2ee743-0x0;var _0x4416b5=_0x70e0[_0x2ee743];return _0x4416b5;};'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(_0x1fde64,_0x39769a){var _0x53b5bb=function(_0x565852){while(--_0x565852){_0x1fde64['push'](_0x1fde64['shift']());}};_0x53b5bb(++_0x39769a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8a436bf..160bb6a 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 _0x030a=['STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk','INTEGER'];(function(_0x4e91c0,_0x1e4d49){var _0x89adbe=function(_0x3ce1c9){while(--_0x3ce1c9){_0x4e91c0['push'](_0x4e91c0['shift']());}};_0x89adbe(++_0x1e4d49);}(_0x030a,0xc2));var _0xa030=function(_0x546f9f,_0xcce640){_0x546f9f=_0x546f9f-0x0;var _0x3513dd=_0x030a[_0x546f9f];return _0x3513dd;};'use strict';var Sequelize=require(_0xa030('0x0'));module[_0xa030('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa030('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xa030('0x2')},'UserId':{'type':Sequelize[_0xa030('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa030('0x4')],'allowNull':![],'unique':_0xa030('0x5'),'comment':_0xa030('0x2')},'VoiceQueueId':{'type':Sequelize[_0xa030('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xa030('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xa030('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa030('0x2')},'paused':{'type':Sequelize[_0xa030('0x3')](0xb),'defaultValue':0x0,'comment':_0xa030('0x2')}}; \ No newline at end of file +var _0xdd12=['sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xdd12,0xf6));var _0x2dd1=function(_0x32d275,_0x207593){_0x32d275=_0x32d275-0x0;var _0x51665d=_0xdd12[_0x32d275];return _0x51665d;};'use strict';var Sequelize=require(_0x2dd1('0x0'));module[_0x2dd1('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2dd1('0x2')},'membername':{'type':Sequelize[_0x2dd1('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x2dd1('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2dd1('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x2dd1('0x2')},'VoiceQueueId':{'type':Sequelize[_0x2dd1('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x2dd1('0x3')],'allowNull':![],'unique':_0x2dd1('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x2dd1('0x4')](0xb),'defaultValue':0x0,'comment':_0x2dd1('0x2')},'paused':{'type':Sequelize[_0x2dd1('0x4')](0xb),'defaultValue':0x0,'comment':_0x2dd1('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 0b0c559..cfde38e 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 _0xe13c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x474fc6,_0x15055e){var _0x2ba4cd=function(_0x505aa9){while(--_0x505aa9){_0x474fc6['push'](_0x474fc6['shift']());}};_0x2ba4cd(++_0x15055e);}(_0xe13c,0xac));var _0xce13=function(_0x49a541,_0x507ed8){_0x49a541=_0x49a541-0x0;var _0x45ad77=_0xe13c[_0x49a541];return _0x45ad77;};'use strict';var EventEmitter=require(_0xce13('0x0'));var UserVoiceQueueRt=require(_0xce13('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xce13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce13('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2fdb36){return function(_0x144bdf,_0x3af493,_0x1c5228){UserVoiceQueueRtEvents[_0xce13('0x4')](_0x2fdb36+':'+_0x144bdf['id'],_0x144bdf);UserVoiceQueueRtEvents[_0xce13('0x4')](_0x2fdb36,_0x144bdf);_0x1c5228(null);};}for(var e in events){if(events[_0xce13('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xce13('0x6')](e,emitEvent(event));}}module[_0xce13('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x198e=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x4c1313,_0x153b90){var _0x29195a=function(_0x106841){while(--_0x106841){_0x4c1313['push'](_0x4c1313['shift']());}};_0x29195a(++_0x153b90);}(_0x198e,0x1a0));var _0xe198=function(_0x33eb1a,_0x5a7d04){_0x33eb1a=_0x33eb1a-0x0;var _0x1e6365=_0x198e[_0x33eb1a];return _0x1e6365;};'use strict';var EventEmitter=require(_0xe198('0x0'));var UserVoiceQueueRt=require(_0xe198('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe198('0x2')](0x0);var events={'afterCreate':_0xe198('0x3'),'afterUpdate':'update','afterDestroy':_0xe198('0x4')};function emitEvent(_0x4a562b){return function(_0x296ce6,_0x209553,_0x4b8aed){UserVoiceQueueRtEvents[_0xe198('0x5')](_0x4a562b+':'+_0x296ce6['id'],_0x296ce6);UserVoiceQueueRtEvents[_0xe198('0x5')](_0x4a562b,_0x296ce6);_0x4b8aed(null);};}for(var e in events){if(events[_0xe198('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xe198('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index a04f929..7bf8aa7 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 _0x3e25=['bluebird','path','rimraf','../../config/environment','exports','UserVoiceQueueRt','../../config/logger','api','moment'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x3e25,0xde));var _0x53e2=function(_0x22861f,_0x5395be){_0x22861f=_0x22861f-0x0;var _0x1a7580=_0x3e25[_0x22861f];return _0x1a7580;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x53e2('0x0'))(_0x53e2('0x1'));var moment=require(_0x53e2('0x2'));var BPromise=require(_0x53e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53e2('0x4'));var rimraf=require(_0x53e2('0x5'));var config=require(_0x53e2('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x53e2('0x7')]=function(_0x417f2c,_0x127289){return _0x417f2c['define'](_0x53e2('0x8'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc047=['rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc047,0xc9));var _0x7c04=function(_0x5039ed,_0x1a0806){_0x5039ed=_0x5039ed-0x0;var _0x241f03=_0xc047[_0x5039ed];return _0x241f03;};'use strict';var _=require(_0x7c04('0x0'));var util=require(_0x7c04('0x1'));var logger=require(_0x7c04('0x2'))(_0x7c04('0x3'));var moment=require(_0x7c04('0x4'));var BPromise=require(_0x7c04('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c04('0x6'));var rimraf=require(_0x7c04('0x7'));var config=require(_0x7c04('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x7c04('0x9')]=function(_0x2389d2,_0xf0523a){return _0x2389d2[_0x7c04('0xa')](_0x7c04('0xb'),attributes,{'tableName':_0x7c04('0xc'),'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 368d6d4..75064de 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 _0x7f71=['code','message','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error'];(function(_0x34a403,_0x2069ae){var _0x4fee1a=function(_0x52dd0f){while(--_0x52dd0f){_0x34a403['push'](_0x34a403['shift']());}};_0x4fee1a(++_0x2069ae);}(_0x7f71,0x84));var _0x17f7=function(_0x639430,_0x3c1d15){_0x639430=_0x639430-0x0;var _0x282adb=_0x7f71[_0x639430];return _0x282adb;};'use strict';var _=require(_0x17f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17f7('0x1'));var fs=require('fs');var Redis=require(_0x17f7('0x2'));var db=require(_0x17f7('0x3'))['db'];var utils=require(_0x17f7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17f7('0x5')][_0x17f7('0x6')]({'port':0x232a});config[_0x17f7('0x7')]=_[_0x17f7('0x8')](config[_0x17f7('0x7')],{'host':_0x17f7('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x17f7('0xa'))[_0x17f7('0xb')](socket);function respondWithRpcPromise(_0xfafd55,_0x6664d3,_0x32b4ab){return new BPromise(function(_0x4f38cf,_0x428152){return client[_0x17f7('0xc')](_0xfafd55,_0x32b4ab)[_0x17f7('0xd')](function(_0x19cabb){logger['info'](_0x17f7('0xe'),_0x6664d3,_0x17f7('0xf'));logger['debug'](_0x17f7('0x10'),_0x6664d3,_0x17f7('0xf'),JSON['stringify'](_0x19cabb));if(_0x19cabb[_0x17f7('0x11')]){if(_0x19cabb[_0x17f7('0x11')][_0x17f7('0x12')]===0x1f4){logger['error'](_0x17f7('0xe'),_0x6664d3,_0x19cabb['error'][_0x17f7('0x13')]);return _0x428152(_0x19cabb[_0x17f7('0x11')][_0x17f7('0x13')]);}logger['error'](_0x17f7('0xe'),_0x6664d3,_0x19cabb['error'][_0x17f7('0x13')]);return _0x4f38cf(_0x19cabb[_0x17f7('0x11')]['message']);}else{logger[_0x17f7('0x14')](_0x17f7('0xe'),_0x6664d3,_0x17f7('0xf'));_0x4f38cf(_0x19cabb['result'][_0x17f7('0x13')]);}})[_0x17f7('0x15')](function(_0x44a7d8){logger[_0x17f7('0x11')](_0x17f7('0xe'),_0x6664d3,_0x44a7d8);_0x428152(_0x44a7d8);});});}exports[_0x17f7('0x16')]=function(_0x19098e){var _0x45ce9e=this;return new Promise(function(_0x528bef,_0x21532b){return db[_0x17f7('0x17')]['findAll']({'raw':_0x19098e[_0x17f7('0x18')]?_0x19098e[_0x17f7('0x18')][_0x17f7('0x19')]===undefined?!![]:![]:!![],'where':_0x19098e[_0x17f7('0x18')]?_0x19098e[_0x17f7('0x18')]['where']||null:null,'attributes':[[db[_0x17f7('0x1a')]['fn']('COUNT',db[_0x17f7('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x17f7('0x1b')))),_0x17f7('0x1c')]]})[_0x17f7('0xd')](function(_0x3a9884){logger[_0x17f7('0x14')](_0x17f7('0x16'),_0x19098e);logger['debug']('GetVoiceQueueRtPauses',_0x19098e,JSON[_0x17f7('0x1d')](_0x3a9884));_0x528bef(_0x3a9884);})[_0x17f7('0x15')](function(_0x12578d){logger[_0x17f7('0x11')]('GetVoiceQueueRtPauses',_0x12578d[_0x17f7('0x13')],_0x19098e);_0x21532b(_0x45ce9e[_0x17f7('0x11')](0x1f4,_0x12578d[_0x17f7('0x13')]));});});}; \ No newline at end of file +var _0x271f=['outboundQueuePauses','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x19b66c,_0x580235){var _0x51eb96=function(_0x56e3a3){while(--_0x56e3a3){_0x19b66c['push'](_0x19b66c['shift']());}};_0x51eb96(++_0x580235);}(_0x271f,0xe8));var _0xf271=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x271f[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xf271('0x0'));var util=require(_0xf271('0x1'));var moment=require(_0xf271('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf271('0x3'));var db=require(_0xf271('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf271('0x5'));var config=require(_0xf271('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf271('0x7')]({'port':0x232a});config['redis']=_[_0xf271('0x8')](config['redis'],{'host':_0xf271('0x9'),'port':0x18eb});var socket=require(_0xf271('0xa'))(new Redis(config['redis']));require(_0xf271('0xb'))[_0xf271('0xc')](socket);function respondWithRpcPromise(_0xd25e37,_0x32429d,_0x51b1b1){return new BPromise(function(_0x4f010a,_0x1f07b9){return client['request'](_0xd25e37,_0x51b1b1)[_0xf271('0xd')](function(_0x4ad2c9){logger[_0xf271('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x32429d,_0xf271('0xf'));logger[_0xf271('0x10')](_0xf271('0x11'),_0x32429d,_0xf271('0xf'),JSON[_0xf271('0x12')](_0x4ad2c9));if(_0x4ad2c9[_0xf271('0x13')]){if(_0x4ad2c9[_0xf271('0x13')][_0xf271('0x14')]===0x1f4){logger[_0xf271('0x13')](_0xf271('0x15'),_0x32429d,_0x4ad2c9['error']['message']);return _0x1f07b9(_0x4ad2c9[_0xf271('0x13')][_0xf271('0x16')]);}logger['error'](_0xf271('0x15'),_0x32429d,_0x4ad2c9[_0xf271('0x13')][_0xf271('0x16')]);return _0x4f010a(_0x4ad2c9[_0xf271('0x13')][_0xf271('0x16')]);}else{logger[_0xf271('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x32429d,_0xf271('0xf'));_0x4f010a(_0x4ad2c9['result']['message']);}})[_0xf271('0x17')](function(_0x51ddc8){logger[_0xf271('0x13')](_0xf271('0x15'),_0x32429d,_0x51ddc8);_0x1f07b9(_0x51ddc8);});});}exports[_0xf271('0x18')]=function(_0x521419){var _0x5c0223=this;return new Promise(function(_0x2283ae,_0x493a6a){return db[_0xf271('0x19')][_0xf271('0x1a')]({'raw':_0x521419[_0xf271('0x1b')]?_0x521419[_0xf271('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x521419['options']?_0x521419[_0xf271('0x1b')][_0xf271('0x1c')]||null:null,'attributes':[[db[_0xf271('0x1d')]['fn']('COUNT',db[_0xf271('0x1d')]['fn']('IF',db['sequelize'][_0xf271('0x1e')](_0xf271('0x1f')))),_0xf271('0x20')]]})[_0xf271('0xd')](function(_0x515907){logger[_0xf271('0xe')](_0xf271('0x18'),_0x521419);logger[_0xf271('0x10')](_0xf271('0x18'),_0x521419,JSON['stringify'](_0x515907));_0x2283ae(_0x515907);})[_0xf271('0x17')](function(_0x4b3b45){logger[_0xf271('0x13')](_0xf271('0x18'),_0x4b3b45[_0xf271('0x16')],_0x521419);_0x493a6a(_0x5c0223[_0xf271('0x13')](0x1f4,_0x4b3b45[_0xf271('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 125816b..97bb07f 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 _0xbf4e=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0xbf4e,0x172));var _0xebf4=function(_0x2be171,_0x3e825d){_0x2be171=_0x2be171-0x0;var _0x2ebcdd=_0xbf4e[_0x2be171];return _0x2ebcdd;};'use strict';var UserVoiceQueueRtEvents=require(_0xebf4('0x0'));var events=[_0xebf4('0x1'),_0xebf4('0x2'),_0xebf4('0x3')];function createListener(_0x3a521c,_0xf442ec){return function(_0x48dfb5){_0xf442ec[_0xebf4('0x4')](_0x3a521c,_0x48dfb5);};}function removeListener(_0x5d2ad5,_0x59cc54){return function(){UserVoiceQueueRtEvents[_0xebf4('0x5')](_0x5d2ad5,_0x59cc54);};}exports[_0xebf4('0x6')]=function(_0x5adea8){for(var _0x412bbe=0x0,_0x995254=events[_0xebf4('0x7')];_0x412bbe<_0x995254;_0x412bbe++){var _0x48764f=events[_0x412bbe];var _0x2f17c0=createListener(_0xebf4('0x8')+_0x48764f,_0x5adea8);UserVoiceQueueRtEvents['on'](_0x48764f,_0x2f17c0);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x814b,0x1a2));var _0xb814=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x814b[_0x13d07a];return _0x5ee0ee;};'use strict';var UserVoiceQueueRtEvents=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(){UserVoiceQueueRtEvents[_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);UserVoiceQueueRtEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index ea108b5..815a0df 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e5a85,_0x28b6b2){var _0x5f361c=function(_0x5a60bb){while(--_0x5a60bb){_0x1e5a85['push'](_0x1e5a85['shift']());}};_0x5f361c(++_0x28b6b2);}(_0x70e0,0x17b));var _0x070e=function(_0x1e1efe,_0xac288b){_0x1e1efe=_0x1e1efe-0x0;var _0x10e4bb=_0x70e0[_0x1e1efe];return _0x10e4bb;};'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(_0xcd9ece,_0x33ff67){var _0x36f54f=function(_0x54ec76){while(--_0x54ec76){_0xcd9ece['push'](_0xcd9ece['shift']());}};_0x36f54f(++_0x33ff67);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 6a87d45..aef168d 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 _0x3fe9=['sequelize','exports'];(function(_0x30fb8d,_0xd2a5b3){var _0x1c0cf2=function(_0x780297){while(--_0x780297){_0x30fb8d['push'](_0x30fb8d['shift']());}};_0x1c0cf2(++_0xd2a5b3);}(_0x3fe9,0x106));var _0x93fe=function(_0x3b6a75,_0x32c18c){_0x3b6a75=_0x3b6a75-0x0;var _0x5b713e=_0x3fe9[_0x3b6a75];return _0x5b713e;};'use strict';var Sequelize=require(_0x93fe('0x0'));module[_0x93fe('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0737=['INTEGER','sequelize'];(function(_0x51edf1,_0x3d3a71){var _0x93394a=function(_0x204824){while(--_0x204824){_0x51edf1['push'](_0x51edf1['shift']());}};_0x93394a(++_0x3d3a71);}(_0x0737,0x18d));var _0x7073=function(_0x3cec80,_0x275f2a){_0x3cec80=_0x3cec80-0x0;var _0x32ad56=_0x0737[_0x3cec80];return _0x32ad56;};'use strict';var Sequelize=require(_0x7073('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7073('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 14ebfcd..6bb4c11 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 _0xac4d=['user_has_whatsapp_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','UserWhatsappQueue'];(function(_0x288b1a,_0x427f8f){var _0x2b873f=function(_0x5b7fb8){while(--_0x5b7fb8){_0x288b1a['push'](_0x288b1a['shift']());}};_0x2b873f(++_0x427f8f);}(_0xac4d,0x182));var _0xdac4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xac4d[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xdac4('0x0'));var util=require(_0xdac4('0x1'));var logger=require(_0xdac4('0x2'))('api');var moment=require(_0xdac4('0x3'));var BPromise=require('bluebird');var rp=require(_0xdac4('0x4'));var fs=require('fs');var path=require(_0xdac4('0x5'));var rimraf=require(_0xdac4('0x6'));var config=require('../../config/environment');var attributes=require(_0xdac4('0x7'));module[_0xdac4('0x8')]=function(_0x5a67b5,_0x59238c){return _0x5a67b5['define'](_0xdac4('0x9'),attributes,{'tableName':_0xdac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a12=['../../config/logger','moment','bluebird','path','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util'];(function(_0x46f216,_0x5e4824){var _0x1f1920=function(_0x2f44a3){while(--_0x2f44a3){_0x46f216['push'](_0x46f216['shift']());}};_0x1f1920(++_0x5e4824);}(_0x9a12,0xbc));var _0x29a1=function(_0x4f72ad,_0x4274d4){_0x4f72ad=_0x4f72ad-0x0;var _0x2347b3=_0x9a12[_0x4f72ad];return _0x2347b3;};'use strict';var _=require(_0x29a1('0x0'));var util=require(_0x29a1('0x1'));var logger=require(_0x29a1('0x2'))('api');var moment=require(_0x29a1('0x3'));var BPromise=require(_0x29a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29a1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x29a1('0x6'));module['exports']=function(_0x1d3701,_0x5b1a75){return _0x1d3701[_0x29a1('0x7')](_0x29a1('0x8'),attributes,{'tableName':_0x29a1('0x9'),'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 50658ed..b2b8bb7 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 _0xfa4c=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','info','result'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xfa4c,0x1b9));var _0xcfa4=function(_0x56e19b,_0x53f5c5){_0x56e19b=_0x56e19b-0x0;var _0x4d47c8=_0xfa4c[_0x56e19b];return _0x4d47c8;};'use strict';var _=require('lodash');var util=require(_0xcfa4('0x0'));var moment=require(_0xcfa4('0x1'));var BPromise=require(_0xcfa4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfa4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfa4('0x4'));var logger=require(_0xcfa4('0x5'))('rpc');var config=require(_0xcfa4('0x6'));var jayson=require(_0xcfa4('0x7'));var client=jayson[_0xcfa4('0x8')][_0xcfa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x377adb,_0x19d1dc,_0x10f103){return new BPromise(function(_0x68b813,_0xf4913){return client[_0xcfa4('0xa')](_0x377adb,_0x10f103)['then'](function(_0x103d57){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x19d1dc,_0xcfa4('0xb'));logger[_0xcfa4('0xc')](_0xcfa4('0xd'),_0x19d1dc,'request\x20sent',JSON[_0xcfa4('0xe')](_0x103d57));if(_0x103d57[_0xcfa4('0xf')]){if(_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x10')]===0x1f4){logger['error'](_0xcfa4('0x11'),_0x19d1dc,_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x12')]);return _0xf4913(_0x103d57['error']['message']);}logger[_0xcfa4('0xf')](_0xcfa4('0x11'),_0x19d1dc,_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x12')]);return _0x68b813(_0x103d57[_0xcfa4('0xf')][_0xcfa4('0x12')]);}else{logger[_0xcfa4('0x13')](_0xcfa4('0x11'),_0x19d1dc,_0xcfa4('0xb'));_0x68b813(_0x103d57[_0xcfa4('0x14')][_0xcfa4('0x12')]);}})[_0xcfa4('0x15')](function(_0x218d89){logger[_0xcfa4('0xf')](_0xcfa4('0x11'),_0x19d1dc,_0x218d89);_0xf4913(_0x218d89);});});} \ No newline at end of file +var _0x9035=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x200703,_0x4cccfd){var _0x5a32dc=function(_0x4a4835){while(--_0x4a4835){_0x200703['push'](_0x200703['shift']());}};_0x5a32dc(++_0x4cccfd);}(_0x9035,0x193));var _0x5903=function(_0x880b41,_0x38904c){_0x880b41=_0x880b41-0x0;var _0x31560a=_0x9035[_0x880b41];return _0x31560a;};'use strict';var _=require('lodash');var util=require(_0x5903('0x0'));var moment=require(_0x5903('0x1'));var BPromise=require(_0x5903('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5903('0x3'));var db=require(_0x5903('0x4'))['db'];var utils=require(_0x5903('0x5'));var logger=require(_0x5903('0x6'))(_0x5903('0x7'));var config=require(_0x5903('0x8'));var jayson=require(_0x5903('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x488287,_0x145b82,_0x4e4619){return new BPromise(function(_0x307cf5,_0x1c2cfd){return client[_0x5903('0xa')](_0x488287,_0x4e4619)['then'](function(_0x35ce52){logger[_0x5903('0xb')](_0x5903('0xc'),_0x145b82,_0x5903('0xd'));logger[_0x5903('0xe')](_0x5903('0xf'),_0x145b82,_0x5903('0xd'),JSON[_0x5903('0x10')](_0x35ce52));if(_0x35ce52[_0x5903('0x11')]){if(_0x35ce52[_0x5903('0x11')][_0x5903('0x12')]===0x1f4){logger[_0x5903('0x11')](_0x5903('0xc'),_0x145b82,_0x35ce52[_0x5903('0x11')][_0x5903('0x13')]);return _0x1c2cfd(_0x35ce52[_0x5903('0x11')][_0x5903('0x13')]);}logger[_0x5903('0x11')](_0x5903('0xc'),_0x145b82,_0x35ce52[_0x5903('0x11')][_0x5903('0x13')]);return _0x307cf5(_0x35ce52[_0x5903('0x11')][_0x5903('0x13')]);}else{logger[_0x5903('0xb')](_0x5903('0xc'),_0x145b82,_0x5903('0xd'));_0x307cf5(_0x35ce52[_0x5903('0x14')]['message']);}})[_0x5903('0x15')](function(_0x2be993){logger[_0x5903('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x145b82,_0x2be993);_0x1c2cfd(_0x2be993);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3ada762..7b3728a 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 _0x47d6=['update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x58133a,_0x22538b){var _0x47ca83=function(_0x29fbef){while(--_0x29fbef){_0x58133a['push'](_0x58133a['shift']());}};_0x47ca83(++_0x22538b);}(_0x47d6,0x1de));var _0x647d=function(_0x395d33,_0x28dafa){_0x395d33=_0x395d33-0x0;var _0x4aa0cf=_0x47d6[_0x395d33];return _0x4aa0cf;};'use strict';var multer=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x647d('0x3')]();var fs_extra=require(_0x647d('0x4'));var auth=require(_0x647d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x647d('0x6'));var controller=require(_0x647d('0x7'));router[_0x647d('0x8')]('/',auth['isAuthenticated'](),controller[_0x647d('0x9')]);router[_0x647d('0x8')](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0xc')]);router[_0x647d('0xd')]('/',auth[_0x647d('0xb')](),controller[_0x647d('0xe')]);router[_0x647d('0xf')](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0x10')]);router['delete'](_0x647d('0xa'),auth[_0x647d('0xb')](),controller[_0x647d('0x11')]);module[_0x647d('0x12')]=router; \ No newline at end of file +var _0x54f3=['post','create','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','index','/:id','isAuthenticated','show'];(function(_0x2f9d59,_0x1eb328){var _0x52381c=function(_0x328f26){while(--_0x328f26){_0x2f9d59['push'](_0x2f9d59['shift']());}};_0x52381c(++_0x1eb328);}(_0x54f3,0x120));var _0x354f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x54f3[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require(_0x354f('0x0'));var path=require(_0x354f('0x1'));var timeout=require(_0x354f('0x2'));var express=require(_0x354f('0x3'));var router=express[_0x354f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x354f('0x5'));var config=require(_0x354f('0x6'));var controller=require(_0x354f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x354f('0x8')]);router['get'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller[_0x354f('0xb')]);router[_0x354f('0xc')]('/',auth['isAuthenticated'](),controller[_0x354f('0xd')]);router['put'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller['update']);router['delete'](_0x354f('0x9'),auth[_0x354f('0xa')](),controller['destroy']);module[_0x354f('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index dd667bf..7fe84db 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 _0xa994=['sequelize','exports','STRING','name'];(function(_0x1026e7,_0x5f5307){var _0x5af29c=function(_0x308cf2){while(--_0x308cf2){_0x1026e7['push'](_0x1026e7['shift']());}};_0x5af29c(++_0x5f5307);}(_0xa994,0x108));var _0x4a99=function(_0x30dc13,_0x4b6ed5){_0x30dc13=_0x30dc13-0x0;var _0x2c56f5=_0xa994[_0x30dc13];return _0x2c56f5;};'use strict';var Sequelize=require(_0x4a99('0x0'));module[_0x4a99('0x1')]={'name':{'type':Sequelize[_0x4a99('0x2')],'unique':_0x4a99('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4a99('0x2')]}}; \ No newline at end of file +var _0x4689=['sequelize','exports','STRING'];(function(_0x2d871e,_0xd14b61){var _0x41dd7b=function(_0x3e69f0){while(--_0x3e69f0){_0x2d871e['push'](_0x2d871e['shift']());}};_0x41dd7b(++_0xd14b61);}(_0x4689,0x108));var _0x9468=function(_0x4381d3,_0x1b187c){_0x4381d3=_0x4381d3-0x0;var _0x311b79=_0x4689[_0x4381d3];return _0x311b79;};'use strict';var Sequelize=require(_0x9468('0x0'));module[_0x9468('0x1')]={'name':{'type':Sequelize[_0x9468('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9468('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index daa3403..2a12458 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 _0x653c=['update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','findAll','rows','params','keys','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save'];(function(_0x40abc,_0x24e02a){var _0x4ec5a7=function(_0x526254){while(--_0x526254){_0x40abc['push'](_0x40abc['shift']());}};_0x4ec5a7(++_0x24e02a);}(_0x653c,0x84));var _0xc653=function(_0x5ce379,_0x4feabd){_0x5ce379=_0x5ce379-0x0;var _0x260107=_0x653c[_0x5ce379];return _0x260107;};'use strict';var emlformat=require(_0xc653('0x0'));var rimraf=require(_0xc653('0x1'));var zipdir=require(_0xc653('0x2'));var jsonpatch=require(_0xc653('0x3'));var rp=require(_0xc653('0x4'));var moment=require(_0xc653('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc653('0x6'));var sox=require(_0xc653('0x7'));var csv=require('to-csv');var ejs=require(_0xc653('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc653('0x9'));var squel=require(_0xc653('0xa'));var crypto=require('crypto');var jsforce=require(_0xc653('0xb'));var deskjs=require(_0xc653('0xc'));var toCsv=require(_0xc653('0xd'));var querystring=require(_0xc653('0xe'));var Papa=require(_0xc653('0xf'));var Redis=require(_0xc653('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc653('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc653('0x12'))('api');var utils=require(_0xc653('0x13'));var config=require(_0xc653('0x14'));var licenseUtil=require(_0xc653('0x15'));var db=require(_0xc653('0x16'))['db'];function respondWithStatusCode(_0x8c2f8d,_0x262000){_0x262000=_0x262000||0xcc;return function(_0x594fbc){if(_0x594fbc){return _0x8c2f8d[_0xc653('0x17')](_0x262000);}return _0x8c2f8d[_0xc653('0x18')](_0x262000)[_0xc653('0x19')]();};}function respondWithResult(_0x174297,_0x281686){_0x281686=_0x281686||0xc8;return function(_0x38086d){if(_0x38086d){return _0x174297['status'](_0x281686)[_0xc653('0x1a')](_0x38086d);}};}function respondWithFilteredResult(_0x5eacdd,_0xb67ce9){return function(_0x40b08e){if(_0x40b08e){var _0x2a639e=typeof _0xb67ce9['offset']===_0xc653('0x1b')&&typeof _0xb67ce9['limit']===_0xc653('0x1b');var _0x3a648d=_0x40b08e[_0xc653('0x1c')];var _0x768896=_0x2a639e?0x0:_0xb67ce9[_0xc653('0x1d')];var _0x2aea11=_0x2a639e?_0x40b08e[_0xc653('0x1c')]:_0xb67ce9[_0xc653('0x1d')]+_0xb67ce9['limit'];var _0x272aae;if(_0x2aea11>=_0x3a648d){_0x2aea11=_0x3a648d;_0x272aae=0xc8;}else{_0x272aae=0xce;}_0x5eacdd[_0xc653('0x18')](_0x272aae);return _0x5eacdd[_0xc653('0x1e')](_0xc653('0x1f'),_0x768896+'-'+_0x2aea11+'/'+_0x3a648d)[_0xc653('0x1a')](_0x40b08e);}return null;};}function patchUpdates(_0x3115da){return function(_0x24f1ba){try{jsonpatch[_0xc653('0x20')](_0x24f1ba,_0x3115da,!![]);}catch(_0x4cd22e){return BPromise['reject'](_0x4cd22e);}return _0x24f1ba[_0xc653('0x21')]();};}function saveUpdates(_0x5053a7,_0x546ec5){return function(_0xb006b5){if(_0xb006b5){return _0xb006b5[_0xc653('0x22')](_0x5053a7)[_0xc653('0x23')](function(_0x58c691){return _0x58c691;});}return null;};}function removeEntity(_0x4b99d0,_0x4c691e){return function(_0x46fc08){if(_0x46fc08){return _0x46fc08[_0xc653('0x24')]()[_0xc653('0x23')](function(){var _0x111ef1=_0x46fc08[_0xc653('0x25')]({'plain':!![]});var _0x4cd438=_0xc653('0x26');return db[_0xc653('0x27')][_0xc653('0x24')]({'where':{'type':_0x4cd438,'resourceId':_0x111ef1['id']}})[_0xc653('0x23')](function(){return _0x46fc08;});})[_0xc653('0x23')](function(){_0x4b99d0[_0xc653('0x18')](0xcc)[_0xc653('0x19')]();});}};}function handleEntityNotFound(_0x34c1af,_0x2ac653){return function(_0x308b4a){if(!_0x308b4a){_0x34c1af[_0xc653('0x17')](0x194);}return _0x308b4a;};}function handleError(_0xb35a14,_0x18bddb){_0x18bddb=_0x18bddb||0x1f4;return function(_0x414689){logger['error'](_0x414689[_0xc653('0x28')]);if(_0x414689[_0xc653('0x29')]){delete _0x414689[_0xc653('0x29')];}_0xb35a14['status'](_0x18bddb)[_0xc653('0x2a')](_0x414689);};}exports[_0xc653('0x2b')]=function(_0x6c7abb,_0xf2fa6b){var _0x57c7eb={},_0x356fb6={},_0x544160={'count':0x0,'rows':[]};var _0x314bff=_[_0xc653('0x2c')](db['Variable'][_0xc653('0x2d')],function(_0x59af4b){return{'name':_0x59af4b['fieldName'],'type':_0x59af4b[_0xc653('0x2e')][_0xc653('0x2f')]};});_0x356fb6[_0xc653('0x30')]=_[_0xc653('0x2c')](_0x314bff,'name');_0x356fb6[_0xc653('0x31')]=_['keys'](_0x6c7abb[_0xc653('0x31')]);_0x356fb6[_0xc653('0x32')]=_[_0xc653('0x33')](_0x356fb6[_0xc653('0x30')],_0x356fb6[_0xc653('0x31')]);_0x57c7eb[_0xc653('0x34')]=_['intersection'](_0x356fb6[_0xc653('0x30')],qs[_0xc653('0x35')](_0x6c7abb[_0xc653('0x31')][_0xc653('0x35')]));_0x57c7eb[_0xc653('0x34')]=_0x57c7eb[_0xc653('0x34')]['length']?_0x57c7eb['attributes']:_0x356fb6[_0xc653('0x30')];if(!_0x6c7abb[_0xc653('0x31')][_0xc653('0x36')](_0xc653('0x37'))){_0x57c7eb['limit']=qs['limit'](_0x6c7abb[_0xc653('0x31')][_0xc653('0x38')]);_0x57c7eb['offset']=qs[_0xc653('0x1d')](_0x6c7abb['query']['offset']);}_0x57c7eb[_0xc653('0x39')]=qs[_0xc653('0x3a')](_0x6c7abb[_0xc653('0x31')][_0xc653('0x3a')]);_0x57c7eb[_0xc653('0x3b')]=qs['filters'](_[_0xc653('0x3c')](_0x6c7abb[_0xc653('0x31')],_0x356fb6[_0xc653('0x32')]),_0x314bff);if(_0x6c7abb['query'][_0xc653('0x3d')]){_0x57c7eb[_0xc653('0x3b')]=_[_0xc653('0x3e')](_0x57c7eb[_0xc653('0x3b')],{'$or':_[_0xc653('0x2c')](_0x314bff,function(_0xff7a6c){if(_0xff7a6c[_0xc653('0x2e')]!==_0xc653('0x3f')){var _0x41379b={};_0x41379b[_0xff7a6c[_0xc653('0x29')]]={'$like':'%'+_0x6c7abb[_0xc653('0x31')]['filter']+'%'};return _0x41379b;}})});}_0x57c7eb=_['merge']({},_0x57c7eb,_0x6c7abb[_0xc653('0x40')]);var _0x59ad77={'where':_0x57c7eb[_0xc653('0x3b')]};return db[_0xc653('0x41')][_0xc653('0x1c')](_0x59ad77)[_0xc653('0x23')](function(_0x18e251){_0x544160[_0xc653('0x1c')]=_0x18e251;if(_0x6c7abb[_0xc653('0x31')]['includeAll']){_0x57c7eb['include']=[{'all':!![]}];}return db[_0xc653('0x41')][_0xc653('0x42')](_0x57c7eb);})[_0xc653('0x23')](function(_0x449511){_0x544160[_0xc653('0x43')]=_0x449511;return _0x544160;})['then'](respondWithFilteredResult(_0xf2fa6b,_0x57c7eb))['catch'](handleError(_0xf2fa6b,null));};exports['show']=function(_0x17ee01,_0x49b4e8){var _0x4ee0bf={'raw':!![],'where':{'id':_0x17ee01[_0xc653('0x44')]['id']}},_0x3c5ef8={};_0x3c5ef8[_0xc653('0x30')]=_[_0xc653('0x45')](db[_0xc653('0x41')][_0xc653('0x2d')]);_0x3c5ef8[_0xc653('0x31')]=_['keys'](_0x17ee01[_0xc653('0x31')]);_0x3c5ef8[_0xc653('0x32')]=_[_0xc653('0x33')](_0x3c5ef8[_0xc653('0x30')],_0x3c5ef8['query']);_0x4ee0bf[_0xc653('0x34')]=_['intersection'](_0x3c5ef8[_0xc653('0x30')],qs[_0xc653('0x35')](_0x17ee01[_0xc653('0x31')][_0xc653('0x35')]));_0x4ee0bf['attributes']=_0x4ee0bf[_0xc653('0x34')][_0xc653('0x46')]?_0x4ee0bf[_0xc653('0x34')]:_0x3c5ef8['model'];if(_0x17ee01[_0xc653('0x31')][_0xc653('0x47')]){_0x4ee0bf[_0xc653('0x48')]=[{'all':!![]}];}_0x4ee0bf=_[_0xc653('0x3e')]({},_0x4ee0bf,_0x17ee01[_0xc653('0x40')]);return db['Variable'][_0xc653('0x49')](_0x4ee0bf)[_0xc653('0x23')](handleEntityNotFound(_0x49b4e8,null))[_0xc653('0x23')](respondWithResult(_0x49b4e8,null))['catch'](handleError(_0x49b4e8,null));};exports[_0xc653('0x4a')]=function(_0x469df5,_0x2373f8){return db[_0xc653('0x41')][_0xc653('0x4a')](_0x469df5[_0xc653('0x4b')],{})['then'](function(_0xabf5a9){var _0x195984=_0x469df5[_0xc653('0x4c')][_0xc653('0x25')]({'plain':!![]});if(!_0x195984)throw new Error(_0xc653('0x4d'));if(_0x195984[_0xc653('0x4e')]===_0xc653('0x4c')){var _0x4bb3f7=_0xabf5a9[_0xc653('0x25')]({'plain':!![]});var _0x85c50d='Variables';return db[_0xc653('0x4f')]['find']({'where':{'name':_0x85c50d,'userProfileId':_0x195984['userProfileId']},'raw':!![]})[_0xc653('0x23')](function(_0x57813e){if(_0x57813e&&_0x57813e[_0xc653('0x50')]===0x0){return db['UserProfileResource'][_0xc653('0x4a')]({'name':_0x4bb3f7[_0xc653('0x29')],'resourceId':_0x4bb3f7['id'],'type':_0x57813e[_0xc653('0x29')],'sectionId':_0x57813e['id']},{})[_0xc653('0x23')](function(){return _0xabf5a9;});}else{return _0xabf5a9;}})['catch'](function(_0x346097){logger[_0xc653('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x346097);throw _0x346097;});}return _0xabf5a9;})[_0xc653('0x23')](respondWithResult(_0x2373f8,0xc9))['catch'](handleError(_0x2373f8,null));};exports['update']=function(_0xb5e8c1,_0x5ca2cf){if(_0xb5e8c1['body']['id']){delete _0xb5e8c1[_0xc653('0x4b')]['id'];}return db[_0xc653('0x41')][_0xc653('0x49')]({'where':{'id':_0xb5e8c1[_0xc653('0x44')]['id']}})[_0xc653('0x23')](handleEntityNotFound(_0x5ca2cf,null))[_0xc653('0x23')](saveUpdates(_0xb5e8c1[_0xc653('0x4b')],null))[_0xc653('0x23')](respondWithResult(_0x5ca2cf,null))[_0xc653('0x52')](handleError(_0x5ca2cf,null));};exports[_0xc653('0x24')]=function(_0x5cad3f,_0x497fc2){return db[_0xc653('0x41')][_0xc653('0x49')]({'where':{'id':_0x5cad3f[_0xc653('0x44')]['id']}})['then'](handleEntityNotFound(_0x497fc2,null))[_0xc653('0x23')](removeEntity(_0x497fc2,null))['catch'](handleError(_0x497fc2,null));}; \ No newline at end of file +var _0x14d9=['sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','get','Variables','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','Variable','includeAll','include','findAll','show','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4b4918,_0x37aa6d){var _0xcdf16f=function(_0x23de13){while(--_0x23de13){_0x4b4918['push'](_0x4b4918['shift']());}};_0xcdf16f(++_0x37aa6d);}(_0x14d9,0x1d3));var _0x914d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x914d('0x0'));var rimraf=require(_0x914d('0x1'));var zipdir=require(_0x914d('0x2'));var jsonpatch=require(_0x914d('0x3'));var rp=require(_0x914d('0x4'));var moment=require(_0x914d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x914d('0x6'));var util=require(_0x914d('0x7'));var path=require(_0x914d('0x8'));var sox=require(_0x914d('0x9'));var csv=require(_0x914d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x914d('0xb'));var squel=require(_0x914d('0xc'));var crypto=require(_0x914d('0xd'));var jsforce=require(_0x914d('0xe'));var deskjs=require(_0x914d('0xf'));var toCsv=require(_0x914d('0xa'));var querystring=require(_0x914d('0x10'));var Papa=require(_0x914d('0x11'));var Redis=require('ioredis');var authService=require(_0x914d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x914d('0x13'));var hardwareService=require(_0x914d('0x14'));var logger=require('../../config/logger')(_0x914d('0x15'));var utils=require(_0x914d('0x16'));var config=require(_0x914d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x914d('0x18'))['db'];function respondWithStatusCode(_0x5700d3,_0x382ee0){_0x382ee0=_0x382ee0||0xcc;return function(_0x56550c){if(_0x56550c){return _0x5700d3[_0x914d('0x19')](_0x382ee0);}return _0x5700d3[_0x914d('0x1a')](_0x382ee0)['end']();};}function respondWithResult(_0x235f94,_0x530eda){_0x530eda=_0x530eda||0xc8;return function(_0x5bf5c1){if(_0x5bf5c1){return _0x235f94[_0x914d('0x1a')](_0x530eda)[_0x914d('0x1b')](_0x5bf5c1);}};}function respondWithFilteredResult(_0x298d96,_0x414ab9){return function(_0x18a789){if(_0x18a789){var _0x95973d=typeof _0x414ab9['offset']==='undefined'&&typeof _0x414ab9[_0x914d('0x1c')]===_0x914d('0x1d');var _0x1e25bb=_0x18a789[_0x914d('0x1e')];var _0xcdd751=_0x95973d?0x0:_0x414ab9['offset'];var _0x5562a7=_0x95973d?_0x18a789[_0x914d('0x1e')]:_0x414ab9[_0x914d('0x1f')]+_0x414ab9[_0x914d('0x1c')];var _0x5f5d15;if(_0x5562a7>=_0x1e25bb){_0x5562a7=_0x1e25bb;_0x5f5d15=0xc8;}else{_0x5f5d15=0xce;}_0x298d96['status'](_0x5f5d15);return _0x298d96[_0x914d('0x20')](_0x914d('0x21'),_0xcdd751+'-'+_0x5562a7+'/'+_0x1e25bb)[_0x914d('0x1b')](_0x18a789);}return null;};}function patchUpdates(_0x38d3ed){return function(_0x9cbe88){try{jsonpatch['apply'](_0x9cbe88,_0x38d3ed,!![]);}catch(_0x38daeb){return BPromise[_0x914d('0x22')](_0x38daeb);}return _0x9cbe88[_0x914d('0x23')]();};}function saveUpdates(_0x157d93,_0x31c038){return function(_0x2b33c3){if(_0x2b33c3){return _0x2b33c3['update'](_0x157d93)[_0x914d('0x24')](function(_0x1b8408){return _0x1b8408;});}return null;};}function removeEntity(_0x52f094,_0x13e79b){return function(_0x8e48a4){if(_0x8e48a4){return _0x8e48a4[_0x914d('0x25')]()[_0x914d('0x24')](function(){var _0x5e1b56=_0x8e48a4[_0x914d('0x26')]({'plain':!![]});var _0xed8295=_0x914d('0x27');return db[_0x914d('0x28')]['destroy']({'where':{'type':_0xed8295,'resourceId':_0x5e1b56['id']}})[_0x914d('0x24')](function(){return _0x8e48a4;});})[_0x914d('0x24')](function(){_0x52f094[_0x914d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed93a,_0x460ed9){return function(_0x15642){if(!_0x15642){_0x2ed93a[_0x914d('0x19')](0x194);}return _0x15642;};}function handleError(_0x772a4f,_0x41061a){_0x41061a=_0x41061a||0x1f4;return function(_0x5590f5){logger[_0x914d('0x29')](_0x5590f5[_0x914d('0x2a')]);if(_0x5590f5[_0x914d('0x2b')]){delete _0x5590f5[_0x914d('0x2b')];}_0x772a4f[_0x914d('0x1a')](_0x41061a)['send'](_0x5590f5);};}exports['index']=function(_0x125f83,_0x27cac2){var _0x7411d5={},_0x5e9eb5={},_0x6b30cb={'count':0x0,'rows':[]};var _0x1af053=_[_0x914d('0x2c')](db['Variable'][_0x914d('0x2d')],function(_0x4ed3c3){return{'name':_0x4ed3c3[_0x914d('0x2e')],'type':_0x4ed3c3[_0x914d('0x2f')][_0x914d('0x30')]};});_0x5e9eb5[_0x914d('0x31')]=_[_0x914d('0x2c')](_0x1af053,_0x914d('0x2b'));_0x5e9eb5[_0x914d('0x32')]=_[_0x914d('0x33')](_0x125f83[_0x914d('0x32')]);_0x5e9eb5['filters']=_[_0x914d('0x34')](_0x5e9eb5[_0x914d('0x31')],_0x5e9eb5['query']);_0x7411d5[_0x914d('0x35')]=_[_0x914d('0x34')](_0x5e9eb5[_0x914d('0x31')],qs[_0x914d('0x36')](_0x125f83['query']['fields']));_0x7411d5[_0x914d('0x35')]=_0x7411d5['attributes']['length']?_0x7411d5[_0x914d('0x35')]:_0x5e9eb5[_0x914d('0x31')];if(!_0x125f83[_0x914d('0x32')][_0x914d('0x37')](_0x914d('0x38'))){_0x7411d5[_0x914d('0x1c')]=qs['limit'](_0x125f83[_0x914d('0x32')][_0x914d('0x1c')]);_0x7411d5[_0x914d('0x1f')]=qs[_0x914d('0x1f')](_0x125f83[_0x914d('0x32')][_0x914d('0x1f')]);}_0x7411d5[_0x914d('0x39')]=qs[_0x914d('0x3a')](_0x125f83['query']['sort']);_0x7411d5[_0x914d('0x3b')]=qs['filters'](_[_0x914d('0x3c')](_0x125f83['query'],_0x5e9eb5[_0x914d('0x3d')]),_0x1af053);if(_0x125f83[_0x914d('0x32')][_0x914d('0x3e')]){_0x7411d5[_0x914d('0x3b')]=_[_0x914d('0x3f')](_0x7411d5[_0x914d('0x3b')],{'$or':_[_0x914d('0x2c')](_0x1af053,function(_0xf0b1cb){if(_0xf0b1cb[_0x914d('0x2f')]!==_0x914d('0x40')){var _0x1fbb99={};_0x1fbb99[_0xf0b1cb[_0x914d('0x2b')]]={'$like':'%'+_0x125f83[_0x914d('0x32')][_0x914d('0x3e')]+'%'};return _0x1fbb99;}})});}_0x7411d5=_[_0x914d('0x3f')]({},_0x7411d5,_0x125f83['options']);var _0x59d284={'where':_0x7411d5['where']};return db[_0x914d('0x41')][_0x914d('0x1e')](_0x59d284)[_0x914d('0x24')](function(_0x1891d6){_0x6b30cb[_0x914d('0x1e')]=_0x1891d6;if(_0x125f83['query'][_0x914d('0x42')]){_0x7411d5[_0x914d('0x43')]=[{'all':!![]}];}return db[_0x914d('0x41')][_0x914d('0x44')](_0x7411d5);})['then'](function(_0x3f2395){_0x6b30cb['rows']=_0x3f2395;return _0x6b30cb;})[_0x914d('0x24')](respondWithFilteredResult(_0x27cac2,_0x7411d5))['catch'](handleError(_0x27cac2,null));};exports[_0x914d('0x45')]=function(_0x24ac36,_0x52a503){var _0x561660={'raw':!![],'where':{'id':_0x24ac36['params']['id']}},_0x52028c={};_0x52028c[_0x914d('0x31')]=_['keys'](db[_0x914d('0x41')]['rawAttributes']);_0x52028c[_0x914d('0x32')]=_['keys'](_0x24ac36[_0x914d('0x32')]);_0x52028c['filters']=_[_0x914d('0x34')](_0x52028c[_0x914d('0x31')],_0x52028c[_0x914d('0x32')]);_0x561660[_0x914d('0x35')]=_[_0x914d('0x34')](_0x52028c['model'],qs[_0x914d('0x36')](_0x24ac36[_0x914d('0x32')][_0x914d('0x36')]));_0x561660[_0x914d('0x35')]=_0x561660[_0x914d('0x35')]['length']?_0x561660[_0x914d('0x35')]:_0x52028c[_0x914d('0x31')];if(_0x24ac36[_0x914d('0x32')]['includeAll']){_0x561660[_0x914d('0x43')]=[{'all':!![]}];}_0x561660=_[_0x914d('0x3f')]({},_0x561660,_0x24ac36[_0x914d('0x46')]);return db['Variable'][_0x914d('0x47')](_0x561660)[_0x914d('0x24')](handleEntityNotFound(_0x52a503,null))['then'](respondWithResult(_0x52a503,null))['catch'](handleError(_0x52a503,null));};exports['create']=function(_0x5495b5,_0x297794){return db['Variable'][_0x914d('0x48')](_0x5495b5[_0x914d('0x49')],{})[_0x914d('0x24')](function(_0x3ae842){var _0x25838b=_0x5495b5[_0x914d('0x4a')][_0x914d('0x26')]({'plain':!![]});if(!_0x25838b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25838b[_0x914d('0x4b')]===_0x914d('0x4a')){var _0x707660=_0x3ae842['get']({'plain':!![]});var _0x4f77ac=_0x914d('0x27');return db[_0x914d('0x4c')][_0x914d('0x47')]({'where':{'name':_0x4f77ac,'userProfileId':_0x25838b[_0x914d('0x4d')]},'raw':!![]})['then'](function(_0xcd40da){if(_0xcd40da&&_0xcd40da[_0x914d('0x4e')]===0x0){return db[_0x914d('0x28')][_0x914d('0x48')]({'name':_0x707660['name'],'resourceId':_0x707660['id'],'type':_0xcd40da['name'],'sectionId':_0xcd40da['id']},{})[_0x914d('0x24')](function(){return _0x3ae842;});}else{return _0x3ae842;}})['catch'](function(_0xfa2c42){logger['error'](_0x914d('0x4f'),_0xfa2c42);throw _0xfa2c42;});}return _0x3ae842;})[_0x914d('0x24')](respondWithResult(_0x297794,0xc9))[_0x914d('0x50')](handleError(_0x297794,null));};exports['update']=function(_0x225bb2,_0x1e1900){if(_0x225bb2[_0x914d('0x49')]['id']){delete _0x225bb2[_0x914d('0x49')]['id'];}return db[_0x914d('0x41')]['find']({'where':{'id':_0x225bb2[_0x914d('0x51')]['id']}})['then'](handleEntityNotFound(_0x1e1900,null))['then'](saveUpdates(_0x225bb2[_0x914d('0x49')],null))[_0x914d('0x24')](respondWithResult(_0x1e1900,null))[_0x914d('0x50')](handleError(_0x1e1900,null));};exports[_0x914d('0x25')]=function(_0x3906cd,_0x7d7f4b){return db['Variable'][_0x914d('0x47')]({'where':{'id':_0x3906cd[_0x914d('0x51')]['id']}})[_0x914d('0x24')](handleEntityNotFound(_0x7d7f4b,null))['then'](removeEntity(_0x7d7f4b,null))[_0x914d('0x50')](handleError(_0x7d7f4b,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6759c75..2b8b72f 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 _0x6f7c=['path','rimraf','exports','define','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x161cca,_0x2fc882){var _0x3629c1=function(_0x51f20a){while(--_0x51f20a){_0x161cca['push'](_0x161cca['shift']());}};_0x3629c1(++_0x2fc882);}(_0x6f7c,0x199));var _0xc6f7=function(_0x521e54,_0x5bbbc5){_0x521e54=_0x521e54-0x0;var _0x4badcc=_0x6f7c[_0x521e54];return _0x4badcc;};'use strict';var _=require(_0xc6f7('0x0'));var util=require(_0xc6f7('0x1'));var logger=require(_0xc6f7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc6f7('0x3'));var rp=require(_0xc6f7('0x4'));var fs=require('fs');var path=require(_0xc6f7('0x5'));var rimraf=require(_0xc6f7('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xc6f7('0x7')]=function(_0x4c097a,_0x56e489){return _0x4c097a[_0xc6f7('0x8')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f11=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x20fb4a,_0x59be4b){var _0x460e4b=function(_0x112673){while(--_0x112673){_0x20fb4a['push'](_0x20fb4a['shift']());}};_0x460e4b(++_0x59be4b);}(_0x7f11,0x1e9));var _0x17f1=function(_0x56fb7f,_0x33b941){_0x56fb7f=_0x56fb7f-0x0;var _0x2f4fa2=_0x7f11[_0x56fb7f];return _0x2f4fa2;};'use strict';var _=require(_0x17f1('0x0'));var util=require('util');var logger=require(_0x17f1('0x1'))(_0x17f1('0x2'));var moment=require('moment');var BPromise=require(_0x17f1('0x3'));var rp=require(_0x17f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17f1('0x5'));var attributes=require(_0x17f1('0x6'));module[_0x17f1('0x7')]=function(_0x19537c,_0x4b4ddc){return _0x19537c[_0x17f1('0x8')](_0x17f1('0x9'),attributes,{'tableName':_0x17f1('0xa'),'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 7182dcd..4ce4181 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x31e0a2,_0x1b51ab){var _0x19d493=function(_0x55d390){while(--_0x55d390){_0x31e0a2['push'](_0x31e0a2['shift']());}};_0x19d493(++_0x1b51ab);}(_0x55ca,0x126));var _0xa55c=function(_0x2972cf,_0x343fde){_0x2972cf=_0x2972cf-0x0;var _0x4c173f=_0x55ca[_0x2972cf];return _0x4c173f;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x4b87ef,_0x1aa1ab){var _0x287e5e=function(_0x66f401){while(--_0x66f401){_0x4b87ef['push'](_0x4b87ef['shift']());}};_0x287e5e(++_0x1aa1ab);}(_0x55ca,0x126));var _0xa55c=function(_0x339ded,_0xb38a57){_0x339ded=_0x339ded-0x0;var _0x37f8dc=_0x55ca[_0x339ded];return _0x37f8dc;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 334dc3d..14b4b03 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 _0xf57d=['isAuthenticated','canUpdate','fetch','/reset','/pull','/migrations','migrations','Router','../../components/auth/service','./version.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf57d,0xc2));var _0xdf57=function(_0x16ca4a,_0x1ed3e7){_0x16ca4a=_0x16ca4a-0x0;var _0x48f844=_0xf57d[_0x16ca4a];return _0x48f844;};'use strict';var express=require('express');var router=express[_0xdf57('0x0')]();var auth=require(_0xdf57('0x1'));var controller=require(_0xdf57('0x2'));router[_0xdf57('0x3')]('/',controller['index']);router[_0xdf57('0x3')]('/fetch',auth[_0xdf57('0x4')](),auth[_0xdf57('0x5')](),controller[_0xdf57('0x6')]);router[_0xdf57('0x3')](_0xdf57('0x7'),auth[_0xdf57('0x4')](),auth[_0xdf57('0x5')](),controller['reset']);router[_0xdf57('0x3')](_0xdf57('0x8'),auth[_0xdf57('0x4')](),auth[_0xdf57('0x5')](),controller['pull']);router[_0xdf57('0x3')]('/restart',auth[_0xdf57('0x4')](),controller['restart']);router[_0xdf57('0x3')](_0xdf57('0x9'),controller[_0xdf57('0xa')]);module['exports']=router; \ No newline at end of file +var _0x0956=['pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x5c2f45,_0x1c78e7){var _0x3fb682=function(_0x27a24f){while(--_0x27a24f){_0x5c2f45['push'](_0x5c2f45['shift']());}};_0x3fb682(++_0x1c78e7);}(_0x0956,0x72));var _0x6095=function(_0x5f25a7,_0x33fa69){_0x5f25a7=_0x5f25a7-0x0;var _0x441701=_0x0956[_0x5f25a7];return _0x441701;};'use strict';var express=require(_0x6095('0x0'));var router=express['Router']();var auth=require(_0x6095('0x1'));var controller=require(_0x6095('0x2'));router[_0x6095('0x3')]('/',controller[_0x6095('0x4')]);router[_0x6095('0x3')](_0x6095('0x5'),auth[_0x6095('0x6')](),auth[_0x6095('0x7')](),controller[_0x6095('0x8')]);router[_0x6095('0x3')](_0x6095('0x9'),auth[_0x6095('0x6')](),auth[_0x6095('0x7')](),controller[_0x6095('0xa')]);router[_0x6095('0x3')](_0x6095('0xb'),auth[_0x6095('0x6')](),auth[_0x6095('0x7')](),controller[_0x6095('0xc')]);router[_0x6095('0x3')](_0x6095('0xd'),auth[_0x6095('0x6')](),controller[_0x6095('0xe')]);router['get'](_0x6095('0xf'),controller[_0x6095('0x10')]);module[_0x6095('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 86f67ba..4bb16ce 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 _0x1854=['git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','length','replace','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','map','.js','then','last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','child_process','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','version','query','tags','json','status','fetch','master','error','info'];(function(_0x174870,_0x398b8a){var _0x352f5b=function(_0x412121){while(--_0x412121){_0x174870['push'](_0x174870['shift']());}};_0x352f5b(++_0x398b8a);}(_0x1854,0x114));var _0x4185=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0x1854[_0x398294];return _0x2a872d;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x4185('0x0'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x4185('0x1'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x4185('0x2'));var pm2=require(_0x4185('0x3'));var logger=require(_0x4185('0x4'))('update');var git=require(_0x4185('0x5'))(config[_0x4185('0x6')]);exports[_0x4185('0x7')]=function(_0x35f091,_0x51551a){var _0x760ba7={'current':module[_0x4185('0x8')][_0x4185('0x9')],'phonebar':0x2};if(_0x35f091[_0x4185('0xa')]&&_0x35f091[_0x4185('0xa')]['latest']){return git['fetch']()[_0x4185('0xb')](function(_0x210002,_0x1567f7){_0x760ba7['latest']=(_0x210002?module[_0x4185('0x8')]['version']:_0x1567f7['latest'])||'2.0.0';return _0x51551a['status'](0xc8)[_0x4185('0xc')](_0x760ba7);});}else{return _0x51551a[_0x4185('0xd')](0xc8)['json'](_0x760ba7);}};exports[_0x4185('0xe')]=function(_0x1322fd,_0x16e0c0){return git[_0x4185('0xe')](['origin',_0x4185('0xf')],function(_0x447488){if(_0x447488){logger[_0x4185('0x10')](_0x447488);return _0x16e0c0[_0x4185('0xd')](0x1f4)['json'](_0x447488);}logger[_0x4185('0x11')](_0x4185('0x12'));return _0x16e0c0[_0x4185('0xd')](0xc8)['json']({'output':_0x4185('0x13')});});};exports[_0x4185('0x14')]=function(_0x34a098,_0x1b5e2c){return git[_0x4185('0x14')]([_0x4185('0x15'),_0x4185('0x16')],function(_0x45dcb5){if(_0x45dcb5){logger['error'](_0x45dcb5);return _0x1b5e2c[_0x4185('0xd')](0x1f4)[_0x4185('0xc')](_0x45dcb5);}logger['info'](_0x4185('0x17'));return _0x1b5e2c[_0x4185('0xd')](0xc8)[_0x4185('0xc')]({'output':_0x4185('0x18')});});};exports[_0x4185('0x19')]=function(_0x2b4c6f,_0x4a0d8b){exec(_0x4185('0x1a'),function(_0x451f3b,_0x24fb58,_0x50b32e){logger[_0x4185('0x11')](_0x24fb58);logger[_0x4185('0x11')](_0x50b32e);if(_0x451f3b){logger['error'](_0x451f3b);return _0x4a0d8b['status'](0x1f4)[_0x4185('0xc')](_0x451f3b);}return _0x4a0d8b[_0x4185('0xd')](0xc8)['json']({'output':_0x24fb58});});};exports['restart']=function(_0xce87dd,_0x3c40e4){return pm2[_0x4185('0x1b')](_0x4185('0x1c'))['then'](function(_0x778059){logger[_0x4185('0x11')](_0x4185('0x1d'),_0x778059);return _0x3c40e4[_0x4185('0xd')](0xc8)[_0x4185('0xc')]({'output':_0x4185('0x1e')});})['catch'](function(_0x1bfff7){logger[_0x4185('0x10')](_0x1bfff7);return _0x3c40e4['status'](0x1f4)['json'](_0x1bfff7);});};exports[_0x4185('0x1f')]=function(_0x4b48cd,_0x388e20){var _0x184c8c=fs[_0x4185('0x20')](path['join'](config['root'],'server',_0x4185('0x1f')));var _0x5b057a=[];for(var _0x17db18=0x0;_0x17db18<_0x184c8c[_0x4185('0x21')];_0x17db18++){var _0x225a03=_0x184c8c[_0x17db18][_0x4185('0x22')]('.js','');if(compareVersions(module[_0x4185('0x8')][_0x4185('0x9')],_0x225a03)===-0x1){_0x5b057a['push'](_0x225a03);}}if(_0x5b057a['length']){var _0x3c9e63=_0x5b057a[_0x4185('0x23')](compareVersions);var _0x50bc90=new Umzug({'storage':_0x4185('0x24'),'storageOptions':{'model':db['Migration'],'modelName':_0x4185('0x25'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x4185('0x26')](),db[_0x4185('0x24')][_0x4185('0x27')],function(){throw new Error(_0x4185('0x28'));}],'path':path[_0x4185('0x29')](config[_0x4185('0x6')],_0x4185('0x2a'),_0x4185('0x1f')),'pattern':/\.js$/}});_0x50bc90['up']({'migrations':_[_0x4185('0x2b')](_0x3c9e63,function(_0x23411b){return _0x23411b+_0x4185('0x2c');})})[_0x4185('0x2d')](function(){return _0x388e20[_0x4185('0xd')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x4185('0x8')][_0x4185('0x9')]+'\x20to\x20'+_[_0x4185('0x2e')](_0x3c9e63),'migrations':_['join'](_0x3c9e63)});})['catch'](function(_0x4ba38c){if(_0x4ba38c instanceof db[_0x4185('0x24')][_0x4185('0x2f')]){return _0x388e20['status'](0xc8)[_0x4185('0xc')]({'output':_0x4185('0x30')});}else{return _0x388e20['status'](0x1f4)['json'](_0x4ba38c);}});}else{return _0x388e20['status'](0xc8)['json']({'output':_0x4185('0x30')});}}; \ No newline at end of file +var _0xd9bf=['master','error','info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','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.','last','UniqueConstraintError','path','lodash','pkginfo','version','child_process','../../mysqldb','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json'];(function(_0xcdac34,_0x43f665){var _0x269d23=function(_0x3f2d6f){while(--_0x3f2d6f){_0xcdac34['push'](_0xcdac34['shift']());}};_0x269d23(++_0x43f665);}(_0xd9bf,0x136));var _0xfd9b=function(_0x365b29,_0xba343a){_0x365b29=_0x365b29-0x0;var _0xef77e7=_0xd9bf[_0x365b29];return _0xef77e7;};'use strict';var Umzug=require('umzug');var path=require(_0xfd9b('0x0'));var fs=require('fs');var _=require(_0xfd9b('0x1'));var pkginfo=require(_0xfd9b('0x2'))(module,_0xfd9b('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xfd9b('0x4'))['exec'];var db=require(_0xfd9b('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0xfd9b('0x6'));var logger=require(_0xfd9b('0x7'))('update');var git=require(_0xfd9b('0x8'))(config[_0xfd9b('0x9')]);exports[_0xfd9b('0xa')]=function(_0x2411e5,_0x4242bd){var _0x4a8f7d={'current':module[_0xfd9b('0xb')][_0xfd9b('0x3')],'phonebar':0x2};if(_0x2411e5[_0xfd9b('0xc')]&&_0x2411e5[_0xfd9b('0xc')][_0xfd9b('0xd')]){return git[_0xfd9b('0xe')]()[_0xfd9b('0xf')](function(_0x572dbc,_0x1608ee){_0x4a8f7d['latest']=(_0x572dbc?module['exports'][_0xfd9b('0x3')]:_0x1608ee['latest'])||_0xfd9b('0x10');return _0x4242bd[_0xfd9b('0x11')](0xc8)['json'](_0x4a8f7d);});}else{return _0x4242bd[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')](_0x4a8f7d);}};exports['fetch']=function(_0x315195,_0x143ced){return git[_0xfd9b('0xe')](['origin',_0xfd9b('0x13')],function(_0x284236){if(_0x284236){logger[_0xfd9b('0x14')](_0x284236);return _0x143ced[_0xfd9b('0x11')](0x1f4)[_0xfd9b('0x12')](_0x284236);}logger[_0xfd9b('0x15')]('git\x20fetch');return _0x143ced[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xfd9b('0x16')]=function(_0xf360a1,_0x3667a5){return git[_0xfd9b('0x16')]([_0xfd9b('0x17'),_0xfd9b('0x18')],function(_0x34eda6){if(_0x34eda6){logger[_0xfd9b('0x14')](_0x34eda6);return _0x3667a5[_0xfd9b('0x11')](0x1f4)[_0xfd9b('0x12')](_0x34eda6);}logger[_0xfd9b('0x15')](_0xfd9b('0x19'));return _0x3667a5[_0xfd9b('0x11')](0xc8)['json']({'output':_0xfd9b('0x1a')});});};exports[_0xfd9b('0x1b')]=function(_0x482b66,_0x22f52){exec('npm\x20install\x20--production',function(_0x47eef1,_0x980718,_0x2959dc){logger[_0xfd9b('0x15')](_0x980718);logger[_0xfd9b('0x15')](_0x2959dc);if(_0x47eef1){logger[_0xfd9b('0x14')](_0x47eef1);return _0x22f52[_0xfd9b('0x11')](0x1f4)[_0xfd9b('0x12')](_0x47eef1);}return _0x22f52[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')]({'output':_0x980718});});};exports[_0xfd9b('0x1c')]=function(_0x49de74,_0x5cb5f7){return pm2[_0xfd9b('0x1c')](_0xfd9b('0x1d'))[_0xfd9b('0x1e')](function(_0x5e7f4d){logger[_0xfd9b('0x15')]('pm2\x20restart\x20motion\x20%s',_0x5e7f4d);return _0x5cb5f7[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')]({'output':_0xfd9b('0x1f')});})[_0xfd9b('0x20')](function(_0x4bea90){logger[_0xfd9b('0x14')](_0x4bea90);return _0x5cb5f7[_0xfd9b('0x11')](0x1f4)[_0xfd9b('0x12')](_0x4bea90);});};exports[_0xfd9b('0x21')]=function(_0x939f2e,_0x5c1c1b){var _0x54b6ec=fs[_0xfd9b('0x22')](path[_0xfd9b('0x23')](config['root'],_0xfd9b('0x24'),_0xfd9b('0x21')));var _0x31cffc=[];for(var _0x5a89dc=0x0;_0x5a89dc<_0x54b6ec[_0xfd9b('0x25')];_0x5a89dc++){var _0x43f479=_0x54b6ec[_0x5a89dc]['replace'](_0xfd9b('0x26'),'');if(compareVersions(module['exports']['version'],_0x43f479)===-0x1){_0x31cffc['push'](_0x43f479);}}if(_0x31cffc['length']){var _0x1a1fdd=_0x31cffc[_0xfd9b('0x27')](compareVersions);var _0x1e9e5e=new Umzug({'storage':_0xfd9b('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0xfd9b('0x29'),'columnName':_0xfd9b('0x3')},'migrations':{'params':[db['sequelize'][_0xfd9b('0x2a')](),db[_0xfd9b('0x28')][_0xfd9b('0x2b')],function(){throw new Error(_0xfd9b('0x2c'));}],'path':path['join'](config[_0xfd9b('0x9')],_0xfd9b('0x24'),'migrations'),'pattern':/\.js$/}});_0x1e9e5e['up']({'migrations':_['map'](_0x1a1fdd,function(_0x7214ee){return _0x7214ee+_0xfd9b('0x26');})})[_0xfd9b('0x1e')](function(){return _0x5c1c1b[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xfd9b('0xb')][_0xfd9b('0x3')]+'\x20to\x20'+_[_0xfd9b('0x2d')](_0x1a1fdd),'migrations':_[_0xfd9b('0x23')](_0x1a1fdd)});})[_0xfd9b('0x20')](function(_0x1b5b82){if(_0x1b5b82 instanceof db['sequelize'][_0xfd9b('0x2e')]){return _0x5c1c1b[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x5c1c1b[_0xfd9b('0x11')](0x1f4)[_0xfd9b('0x12')](_0x1b5b82);}});}else{return _0x5c1c1b[_0xfd9b('0x11')](0xc8)[_0xfd9b('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 47d247f..90c1cd8 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 _0x5225=['update','delete','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','post','create','/:id'];(function(_0x5c0e6a,_0x2f4d54){var _0x442b5f=function(_0x2f2b94){while(--_0x2f2b94){_0x5c0e6a['push'](_0x5c0e6a['shift']());}};_0x442b5f(++_0x2f4d54);}(_0x5225,0xd2));var _0x5522=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5225[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0x5522('0x0'));var util=require('util');var path=require(_0x5522('0x1'));var timeout=require('connect-timeout');var express=require(_0x5522('0x2'));var router=express['Router']();var fs_extra=require(_0x5522('0x3'));var auth=require(_0x5522('0x4'));var interaction=require(_0x5522('0x5'));var config=require(_0x5522('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x5522('0x7')]('/',auth[_0x5522('0x8')](),controller[_0x5522('0x9')]);router[_0x5522('0x7')](_0x5522('0xa'),auth[_0x5522('0x8')](),controller['describe']);router[_0x5522('0x7')]('/:id',auth[_0x5522('0x8')](),controller['show']);router[_0x5522('0xb')]('/',auth['isAuthenticated'](),controller[_0x5522('0xc')]);router['put'](_0x5522('0xd'),auth['isAuthenticated'](),controller[_0x5522('0xe')]);router[_0x5522('0xf')](_0x5522('0xd'),auth[_0x5522('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe3e9=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xf8174b,_0x2666b5){var _0x48fcb5=function(_0x473fc0){while(--_0x473fc0){_0xf8174b['push'](_0xf8174b['shift']());}};_0x48fcb5(++_0x2666b5);}(_0xe3e9,0xa1));var _0x9e3e=function(_0x4d2366,_0x412bfe){_0x4d2366=_0x4d2366-0x0;var _0xefd8bb=_0xe3e9[_0x4d2366];return _0xefd8bb;};'use strict';var multer=require('multer');var util=require(_0x9e3e('0x0'));var path=require(_0x9e3e('0x1'));var timeout=require(_0x9e3e('0x2'));var express=require(_0x9e3e('0x3'));var router=express[_0x9e3e('0x4')]();var fs_extra=require(_0x9e3e('0x5'));var auth=require(_0x9e3e('0x6'));var interaction=require(_0x9e3e('0x7'));var config=require(_0x9e3e('0x8'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9e3e('0x9')](_0x9e3e('0xa'),auth[_0x9e3e('0xb')](),controller[_0x9e3e('0xc')]);router['get'](_0x9e3e('0xd'),auth[_0x9e3e('0xb')](),controller[_0x9e3e('0xe')]);router[_0x9e3e('0xf')]('/',auth[_0x9e3e('0xb')](),controller[_0x9e3e('0x10')]);router[_0x9e3e('0x11')](_0x9e3e('0xd'),auth[_0x9e3e('0xb')](),controller[_0x9e3e('0x12')]);router[_0x9e3e('0x13')](_0x9e3e('0xd'),auth[_0x9e3e('0xb')](),controller['destroy']);module[_0x9e3e('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 ab115c7..897ae0a 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 _0xdeb3=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x534c33,_0x120ebc){var _0x22b732=function(_0x2ecd80){while(--_0x2ecd80){_0x534c33['push'](_0x534c33['shift']());}};_0x22b732(++_0x120ebc);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x3deb('0x0')]={'type':{'type':Sequelize[_0x3deb('0x1')]},'uniqueid':{'type':Sequelize[_0x3deb('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3deb('0x1')]},'interface':{'type':Sequelize[_0x3deb('0x1')]},'membername':{'type':Sequelize[_0x3deb('0x1')]},'agentcalledAt':{'type':Sequelize[_0x3deb('0x2')]},'agentconnectAt':{'type':Sequelize[_0x3deb('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x3deb('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x3deb('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3deb('0x3')]},'agentacw':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3deb('0x3')]},'reason':{'type':Sequelize[_0x3deb('0x1')]},'lastevent':{'type':Sequelize[_0x3deb('0x1')]},'channel':{'type':Sequelize[_0x3deb('0x1')]},'channelstate':{'type':Sequelize[_0x3deb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3deb('0x1')]},'language':{'type':Sequelize[_0x3deb('0x1')]},'accountcode':{'type':Sequelize[_0x3deb('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3deb('0x1')]},'priority':{'type':Sequelize[_0x3deb('0x1')]},'destchannel':{'type':Sequelize[_0x3deb('0x1')]},'destchannelstate':{'type':Sequelize[_0x3deb('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3deb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3deb('0x1')]},'destlanguage':{'type':Sequelize[_0x3deb('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x3deb('0x1')]},'destexten':{'type':Sequelize[_0x3deb('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x3deb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3deb('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3deb('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3deb('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x3deb('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x753c=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1d75f7,_0x139d5e){var _0x307f9a=function(_0x400ae1){while(--_0x400ae1){_0x1d75f7['push'](_0x1d75f7['shift']());}};_0x307f9a(++_0x139d5e);}(_0x753c,0x96));var _0xc753=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x753c[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0xc753('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc753('0x1')]},'calleridnum':{'type':Sequelize[_0xc753('0x1')]},'calleridname':{'type':Sequelize[_0xc753('0x1')]},'queue':{'type':Sequelize[_0xc753('0x1')]},'interface':{'type':Sequelize[_0xc753('0x1')]},'membername':{'type':Sequelize[_0xc753('0x1')]},'agentcalledAt':{'type':Sequelize[_0xc753('0x2')]},'agentconnectAt':{'type':Sequelize[_0xc753('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xc753('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xc753('0x2')]},'agentdumpAt':{'type':Sequelize[_0xc753('0x2')]},'holdtime':{'type':Sequelize[_0xc753('0x3')]},'agentcomplete':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc753('0x3')]},'agentacw':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc753('0x3')]},'reason':{'type':Sequelize[_0xc753('0x1')]},'lastevent':{'type':Sequelize[_0xc753('0x1')]},'channel':{'type':Sequelize[_0xc753('0x1')]},'channelstate':{'type':Sequelize[_0xc753('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc753('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc753('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc753('0x1')]},'accountcode':{'type':Sequelize[_0xc753('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xc753('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc753('0x1')]},'destchannelstate':{'type':Sequelize[_0xc753('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xc753('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc753('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xc753('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc753('0x1')]},'destcontext':{'type':Sequelize[_0xc753('0x1')]},'destexten':{'type':Sequelize[_0xc753('0x1')]},'destpriority':{'type':Sequelize[_0xc753('0x1')]},'destuniqueid':{'type':Sequelize[_0xc753('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xc753('0x1')]},'transfer':{'type':Sequelize[_0xc753('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc753('0x1')],'comment':_0xc753('0x5')},'transferexten':{'type':Sequelize[_0xc753('0x1')]},'transferuniqueid':{'type':Sequelize[_0xc753('0x1')]},'agententerreason':{'type':Sequelize[_0xc753('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 24fc20d..f16d976 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(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 3c39001..aa7444f 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 _0xb717=['uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb717,0x1b4));var _0x7b71=function(_0x2badde,_0x7760ed){_0x2badde=_0x2badde-0x0;var _0x5348e1=_0xb717[_0x2badde];return _0x5348e1;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7b71('0xc'),_0x7b71('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6726=['moment','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x6726,0xdb));var _0x6672=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0x6726[_0x8c8176];return _0x4dc47b;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var logger=require(_0x6672('0x1'))('api');var moment=require(_0x6672('0x2'));var BPromise=require(_0x6672('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6672('0x4'));var rimraf=require('rimraf');var config=require(_0x6672('0x5'));var attributes=require(_0x6672('0x6'));module[_0x6672('0x7')]=function(_0x40ba7e,_0x5701b9){return _0x40ba7e[_0x6672('0x8')](_0x6672('0x9'),attributes,{'tableName':_0x6672('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6672('0xb'),_0x6672('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 ebba362..925beab 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 _0x99ac=['message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x271aa2,_0x48801c){var _0x563a4d=function(_0x35b884){while(--_0x35b884){_0x271aa2['push'](_0x271aa2['shift']());}};_0x563a4d(++_0x48801c);}(_0x99ac,0x177));var _0xc99a=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x99ac[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xc99a('0x0'));var util=require('util');var moment=require(_0xc99a('0x1'));var BPromise=require(_0xc99a('0x2'));var rs=require(_0xc99a('0x3'));var fs=require('fs');var Redis=require(_0xc99a('0x4'));var db=require(_0xc99a('0x5'))['db'];var utils=require(_0xc99a('0x6'));var logger=require('../../config/logger')(_0xc99a('0x7'));var config=require(_0xc99a('0x8'));var jayson=require(_0xc99a('0x9'));var client=jayson[_0xc99a('0xa')][_0xc99a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4df994,_0xcec79,_0x34912f){return new BPromise(function(_0x41371b,_0x1c8e49){return client[_0xc99a('0xc')](_0x4df994,_0x34912f)[_0xc99a('0xd')](function(_0x15ad9e){logger[_0xc99a('0xe')](_0xc99a('0xf'),_0xcec79,'request\x20sent');logger['debug'](_0xc99a('0x10'),_0xcec79,_0xc99a('0x11'),JSON[_0xc99a('0x12')](_0x15ad9e));if(_0x15ad9e['error']){if(_0x15ad9e['error'][_0xc99a('0x13')]===0x1f4){logger['error'](_0xc99a('0xf'),_0xcec79,_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);return _0x1c8e49(_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);}logger[_0xc99a('0x14')](_0xc99a('0xf'),_0xcec79,_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);return _0x41371b(_0x15ad9e[_0xc99a('0x14')][_0xc99a('0x15')]);}else{logger[_0xc99a('0xe')](_0xc99a('0xf'),_0xcec79,_0xc99a('0x11'));_0x41371b(_0x15ad9e[_0xc99a('0x16')][_0xc99a('0x15')]);}})[_0xc99a('0x17')](function(_0x32a441){logger[_0xc99a('0x14')](_0xc99a('0xf'),_0xcec79,_0x32a441);_0x1c8e49(_0x32a441);});});}exports[_0xc99a('0x18')]=function(_0x5dfb60){var _0x2aff49=this;return new Promise(function(_0x12a7f3,_0x57f31a){return db[_0xc99a('0x19')][_0xc99a('0x1a')](_0x5dfb60[_0xc99a('0x1b')],{'raw':_0x5dfb60[_0xc99a('0x1c')]?_0x5dfb60['options'][_0xc99a('0x1d')]===undefined?!![]:![]:!![]})[_0xc99a('0xd')](function(_0x5cbedb){logger[_0xc99a('0xe')]('CreateVoiceAgentReport',_0x5dfb60);logger[_0xc99a('0x1e')](_0xc99a('0x18'),_0x5dfb60,JSON[_0xc99a('0x12')](_0x5cbedb));_0x12a7f3(_0x5cbedb);})[_0xc99a('0x17')](function(_0x27a916){logger[_0xc99a('0x14')](_0xc99a('0x18'),_0x27a916[_0xc99a('0x15')],_0x5dfb60);_0x57f31a(_0x2aff49[_0xc99a('0x14')](0x1f4,_0x27a916[_0xc99a('0x15')]));});});};exports[_0xc99a('0x1f')]=function(_0x2c9254){var _0x12f892=this;return new Promise(function(_0x48716c,_0x1d378c){return db[_0xc99a('0x19')][_0xc99a('0x20')](_0x2c9254['body'],{'raw':_0x2c9254[_0xc99a('0x1c')]?_0x2c9254[_0xc99a('0x1c')][_0xc99a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c9254[_0xc99a('0x1c')]?_0x2c9254[_0xc99a('0x1c')][_0xc99a('0x21')]||null:null,'attributes':_0x2c9254['options']?_0x2c9254['options'][_0xc99a('0x22')]||null:null,'limit':_0x2c9254['options']?_0x2c9254[_0xc99a('0x1c')][_0xc99a('0x23')]||null:null})[_0xc99a('0xd')](function(_0x445d64){logger[_0xc99a('0xe')](_0xc99a('0x1f'),_0x2c9254);logger['debug'](_0xc99a('0x1f'),_0x2c9254,JSON['stringify'](_0x445d64));_0x48716c(_0x445d64);})[_0xc99a('0x17')](function(_0x3d5608){logger[_0xc99a('0x14')](_0xc99a('0x1f'),_0x3d5608['message'],_0x2c9254);_0x1d378c(_0x12f892[_0xc99a('0x14')](0x1f4,_0x3d5608[_0xc99a('0x15')]));});});}; \ No newline at end of file +var _0x4ed0=['where','limit','UpdateVoiceAgentReport','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','debug','update','options'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x4ed0,0x10c));var _0x04ed=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4ed0[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x04ed('0x0'));var util=require(_0x04ed('0x1'));var moment=require(_0x04ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x04ed('0x3'));var fs=require('fs');var Redis=require(_0x04ed('0x4'));var db=require(_0x04ed('0x5'))['db'];var utils=require(_0x04ed('0x6'));var logger=require(_0x04ed('0x7'))('rpc');var config=require(_0x04ed('0x8'));var jayson=require(_0x04ed('0x9'));var client=jayson['client'][_0x04ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530830,_0x15894d,_0x590c7c){return new BPromise(function(_0x2b6ef9,_0x356934){return client[_0x04ed('0xb')](_0x530830,_0x590c7c)[_0x04ed('0xc')](function(_0x67296e){logger[_0x04ed('0xd')](_0x04ed('0xe'),_0x15894d,_0x04ed('0xf'));logger['debug'](_0x04ed('0x10'),_0x15894d,'request\x20sent',JSON['stringify'](_0x67296e));if(_0x67296e['error']){if(_0x67296e[_0x04ed('0x11')]['code']===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x15894d,_0x67296e[_0x04ed('0x11')][_0x04ed('0x12')]);return _0x356934(_0x67296e[_0x04ed('0x11')][_0x04ed('0x12')]);}logger[_0x04ed('0x11')](_0x04ed('0xe'),_0x15894d,_0x67296e[_0x04ed('0x11')][_0x04ed('0x12')]);return _0x2b6ef9(_0x67296e[_0x04ed('0x11')][_0x04ed('0x12')]);}else{logger[_0x04ed('0xd')](_0x04ed('0xe'),_0x15894d,_0x04ed('0xf'));_0x2b6ef9(_0x67296e[_0x04ed('0x13')]['message']);}})[_0x04ed('0x14')](function(_0x54b0b5){logger[_0x04ed('0x11')](_0x04ed('0xe'),_0x15894d,_0x54b0b5);_0x356934(_0x54b0b5);});});}exports[_0x04ed('0x15')]=function(_0x55318b){var _0x16e335=this;return new Promise(function(_0x5532a4,_0x14c5bc){return db[_0x04ed('0x16')][_0x04ed('0x17')](_0x55318b[_0x04ed('0x18')],{'raw':_0x55318b['options']?_0x55318b['options'][_0x04ed('0x19')]===undefined?!![]:![]:!![]})[_0x04ed('0xc')](function(_0x42c8a5){logger[_0x04ed('0xd')](_0x04ed('0x15'),_0x55318b);logger[_0x04ed('0x1a')]('CreateVoiceAgentReport',_0x55318b,JSON['stringify'](_0x42c8a5));_0x5532a4(_0x42c8a5);})[_0x04ed('0x14')](function(_0x207b77){logger[_0x04ed('0x11')](_0x04ed('0x15'),_0x207b77[_0x04ed('0x12')],_0x55318b);_0x14c5bc(_0x16e335[_0x04ed('0x11')](0x1f4,_0x207b77[_0x04ed('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x7ae6d0){var _0x25357c=this;return new Promise(function(_0x579f57,_0x43f3ae){return db[_0x04ed('0x16')][_0x04ed('0x1b')](_0x7ae6d0[_0x04ed('0x18')],{'raw':_0x7ae6d0[_0x04ed('0x1c')]?_0x7ae6d0[_0x04ed('0x1c')][_0x04ed('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ae6d0[_0x04ed('0x1c')]?_0x7ae6d0['options'][_0x04ed('0x1d')]||null:null,'attributes':_0x7ae6d0['options']?_0x7ae6d0[_0x04ed('0x1c')]['attributes']||null:null,'limit':_0x7ae6d0['options']?_0x7ae6d0[_0x04ed('0x1c')][_0x04ed('0x1e')]||null:null})[_0x04ed('0xc')](function(_0x562614){logger[_0x04ed('0xd')]('UpdateVoiceAgentReport',_0x7ae6d0);logger[_0x04ed('0x1a')](_0x04ed('0x1f'),_0x7ae6d0,JSON[_0x04ed('0x20')](_0x562614));_0x579f57(_0x562614);})[_0x04ed('0x14')](function(_0x44a1c6){logger['error'](_0x04ed('0x1f'),_0x44a1c6[_0x04ed('0x12')],_0x7ae6d0);_0x43f3ae(_0x25357c[_0x04ed('0x11')](0x1f4,_0x44a1c6[_0x04ed('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 82bf641..09d1f40 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 _0x425d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0xbacfad,_0x52a356){var _0x32c2f9=function(_0x4fabec){while(--_0x4fabec){_0xbacfad['push'](_0xbacfad['shift']());}};_0x32c2f9(++_0x52a356);}(_0x425d,0x1e0));var _0xd425=function(_0x1af577,_0x1bd440){_0x1af577=_0x1af577-0x0;var _0x18ec4f=_0x425d[_0x1af577];return _0x18ec4f;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x14')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x15')]);module[_0xd425('0x16')]=router; \ No newline at end of file +var _0x0e85=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x3a8ce2,_0x552ad5){var _0x2e5a45=function(_0x5de5ed){while(--_0x5de5ed){_0x3a8ce2['push'](_0x3a8ce2['shift']());}};_0x2e5a45(++_0x552ad5);}(_0x0e85,0x7c));var _0x50e8=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x0e85[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['show']);router[_0x50e8('0xc')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);router[_0x50e8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x50e8('0x11')]);module[_0x50e8('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 927a667..bc0b94f 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 _0x93e9=['internal','outbound','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound'];(function(_0x4f5ae4,_0x4d1def){var _0x51d865=function(_0x1180ea){while(--_0x1180ea){_0x4f5ae4['push'](_0x4f5ae4['shift']());}};_0x51d865(++_0x4d1def);}(_0x93e9,0xcc));var _0x993e=function(_0x418c70,_0x87f331){_0x418c70=_0x418c70-0x0;var _0x4243ff=_0x93e9[_0x418c70];return _0x4243ff;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'uniqueid':{'type':Sequelize[_0x993e('0x2')]},'type':{'type':Sequelize[_0x993e('0x3')](_0x993e('0x4'),_0x993e('0x5'),_0x993e('0x6'),'inbound-fax','outbound-fax',_0x993e('0x7'))},'tag':{'type':Sequelize[_0x993e('0x2')]},'accountcode':{'type':Sequelize[_0x993e('0x2')]},'source':{'type':Sequelize[_0x993e('0x2')]},'destination':{'type':Sequelize[_0x993e('0x2')]},'destinationcontext':{'type':Sequelize[_0x993e('0x2')]},'callerid':{'type':Sequelize[_0x993e('0x2')]},'channel':{'type':Sequelize[_0x993e('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x993e('0x2')]},'lastdata':{'type':Sequelize[_0x993e('0x8')]},'starttime':{'type':Sequelize[_0x993e('0x9')]},'systemanswertime':{'type':Sequelize[_0x993e('0x9')]},'answertime':{'type':Sequelize[_0x993e('0x9')]},'endtime':{'type':Sequelize[_0x993e('0x9')]},'duration':{'type':Sequelize[_0x993e('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x993e('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x993e('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x993e('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x993e('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x993e('0xa')]},'sipcallid':{'type':Sequelize[_0x993e('0x2')]}}; \ No newline at end of file +var _0xa896=['internal','outbound','inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound'];(function(_0x20a27d,_0x5dcaf1){var _0x88c40=function(_0x369554){while(--_0x369554){_0x20a27d['push'](_0x20a27d['shift']());}};_0x88c40(++_0x5dcaf1);}(_0xa896,0xe0));var _0x6a89=function(_0x3abe55,_0x54e6d2){_0x3abe55=_0x3abe55-0x0;var _0x1e17e0=_0xa896[_0x3abe55];return _0x1e17e0;};'use strict';var Sequelize=require(_0x6a89('0x0'));module[_0x6a89('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a89('0x2')](_0x6a89('0x3'),_0x6a89('0x4'),_0x6a89('0x5'),_0x6a89('0x6'),_0x6a89('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6a89('0x8')]},'source':{'type':Sequelize[_0x6a89('0x8')]},'destination':{'type':Sequelize[_0x6a89('0x8')]},'destinationcontext':{'type':Sequelize[_0x6a89('0x8')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6a89('0x8')]},'destinationchannel':{'type':Sequelize[_0x6a89('0x8')]},'lastapplication':{'type':Sequelize[_0x6a89('0x8')]},'lastdata':{'type':Sequelize[_0x6a89('0x9')]},'starttime':{'type':Sequelize[_0x6a89('0xa')]},'systemanswertime':{'type':Sequelize[_0x6a89('0xa')]},'answertime':{'type':Sequelize[_0x6a89('0xa')]},'endtime':{'type':Sequelize[_0x6a89('0xa')]},'duration':{'type':Sequelize[_0x6a89('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6a89('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6a89('0x8')]},'amaflags':{'type':Sequelize[_0x6a89('0x8')]},'userfield':{'type':Sequelize[_0x6a89('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x6a89('0x8')]},'userThirdDisposition':{'type':Sequelize[_0x6a89('0x8')]},'note':{'type':Sequelize[_0x6a89('0x8')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x6a89('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 4bcebf3..2e6ed21 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5da478,_0x51b401){_0x5da478=_0x5da478-0x0;var _0x50d04b=_0x2032[_0x5da478];return _0x50d04b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x259856,_0x973ecb){var _0x461d7a=function(_0x8fa8ea){while(--_0x8fa8ea){_0x259856['push'](_0x259856['shift']());}};_0x461d7a(++_0x973ecb);}(_0xdb28,0x106));var _0x8db2=function(_0x32c207,_0x789152){_0x32c207=_0x32c207-0x0;var _0xfa087c=_0xdb28[_0x32c207];return _0xfa087c;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 9e979ae..569d928 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 _0xcc17=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d4070,_0x2f0d87){var _0xfadfa8=function(_0x295d71){while(--_0x295d71){_0x5d4070['push'](_0x5d4070['shift']());}};_0xfadfa8(++_0x2f0d87);}(_0xcc17,0x174));var _0x7cc1=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0xcc17[_0x568496];return _0x26c5c1;};'use strict';var _=require(_0x7cc1('0x0'));var util=require(_0x7cc1('0x1'));var logger=require(_0x7cc1('0x2'))(_0x7cc1('0x3'));var moment=require(_0x7cc1('0x4'));var BPromise=require(_0x7cc1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7cc1('0x6'));var config=require(_0x7cc1('0x7'));var attributes=require(_0x7cc1('0x8'));module[_0x7cc1('0x9')]=function(_0x28d630,_0x54a6cc){return _0x28d630[_0x7cc1('0xa')](_0x7cc1('0xb'),attributes,{'tableName':_0x7cc1('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7cc1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x74ba=['request-promise','path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','api'];(function(_0x1930bd,_0x4963fc){var _0x2b2d26=function(_0x1aec41){while(--_0x1aec41){_0x1930bd['push'](_0x1930bd['shift']());}};_0x2b2d26(++_0x4963fc);}(_0x74ba,0x174));var _0xa74b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x74ba[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa74b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa74b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa74b('0x2'));var fs=require('fs');var path=require(_0xa74b('0x3'));var rimraf=require(_0xa74b('0x4'));var config=require('../../config/environment');var attributes=require(_0xa74b('0x5'));module[_0xa74b('0x6')]=function(_0x594e0e,_0x39ef56){return _0x594e0e[_0xa74b('0x7')](_0xa74b('0x8'),attributes,{'tableName':_0xa74b('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa74b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index da35e3a..a4523a0 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 _0x9258=['findAll','options','raw','where','attributes','map','include','model','GetVoiceCallReport','create','body','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','code','error','message','VoiceCallReport,\x20%s,\x20%s','catch'];(function(_0x1c408d,_0x53610d){var _0x201428=function(_0x4adfa9){while(--_0x4adfa9){_0x1c408d['push'](_0x1c408d['shift']());}};_0x201428(++_0x53610d);}(_0x9258,0xce));var _0x8925=function(_0x5771da,_0x113531){_0x5771da=_0x5771da-0x0;var _0x373c70=_0x9258[_0x5771da];return _0x373c70;};'use strict';var _=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var moment=require(_0x8925('0x2'));var BPromise=require('bluebird');var rs=require(_0x8925('0x3'));var fs=require('fs');var Redis=require(_0x8925('0x4'));var db=require(_0x8925('0x5'))['db'];var utils=require(_0x8925('0x6'));var logger=require(_0x8925('0x7'))('rpc');var config=require(_0x8925('0x8'));var jayson=require(_0x8925('0x9'));var client=jayson[_0x8925('0xa')][_0x8925('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d27d2,_0x10fc12,_0x31270b){return new BPromise(function(_0x5a53e7,_0x500096){return client[_0x8925('0xc')](_0x1d27d2,_0x31270b)[_0x8925('0xd')](function(_0x21e491){logger[_0x8925('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x10fc12,_0x8925('0xf'));logger[_0x8925('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x10fc12,'request\x20sent',JSON['stringify'](_0x21e491));if(_0x21e491['error']){if(_0x21e491['error'][_0x8925('0x11')]===0x1f4){logger[_0x8925('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x10fc12,_0x21e491[_0x8925('0x12')]['message']);return _0x500096(_0x21e491[_0x8925('0x12')][_0x8925('0x13')]);}logger['error'](_0x8925('0x14'),_0x10fc12,_0x21e491[_0x8925('0x12')][_0x8925('0x13')]);return _0x5a53e7(_0x21e491[_0x8925('0x12')]['message']);}else{logger[_0x8925('0xe')](_0x8925('0x14'),_0x10fc12,'request\x20sent');_0x5a53e7(_0x21e491['result'][_0x8925('0x13')]);}})[_0x8925('0x15')](function(_0x1445df){logger['error'](_0x8925('0x14'),_0x10fc12,_0x1445df);_0x500096(_0x1445df);});});}exports['GetVoiceCallReport']=function(_0x3fcfc2){var _0x47a3ee=this;return new Promise(function(_0x729052,_0x6e3dfa){return db['VoiceCallReport'][_0x8925('0x16')]({'raw':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2[_0x8925('0x17')][_0x8925('0x18')]===undefined?!![]:![]:!![],'where':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2[_0x8925('0x17')][_0x8925('0x19')]||null:null,'attributes':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2['options'][_0x8925('0x1a')]||null:null,'limit':_0x3fcfc2['options']?_0x3fcfc2[_0x8925('0x17')]['limit']||null:null,'include':_0x3fcfc2[_0x8925('0x17')]?_0x3fcfc2[_0x8925('0x17')]['include']?_[_0x8925('0x1b')](_0x3fcfc2['options'][_0x8925('0x1c')],function(_0x5867de){return{'model':db[_0x5867de[_0x8925('0x1d')]],'as':_0x5867de['as'],'attributes':_0x5867de['attributes'],'include':_0x5867de[_0x8925('0x1c')]?_[_0x8925('0x1b')](_0x5867de[_0x8925('0x1c')],function(_0x28cbc5){return{'model':db[_0x28cbc5['model']],'as':_0x28cbc5['as'],'attributes':_0x28cbc5['attributes'],'include':_0x28cbc5[_0x8925('0x1c')]?_[_0x8925('0x1b')](_0x28cbc5[_0x8925('0x1c')],function(_0x4620fe){return{'model':db[_0x4620fe[_0x8925('0x1d')]],'as':_0x4620fe['as'],'attributes':_0x4620fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x936750){logger[_0x8925('0xe')](_0x8925('0x1e'),_0x3fcfc2);logger['debug'](_0x8925('0x1e'),_0x3fcfc2,JSON['stringify'](_0x936750));_0x729052(_0x936750);})[_0x8925('0x15')](function(_0x13197e){logger[_0x8925('0x12')]('GetVoiceCallReport',_0x13197e[_0x8925('0x13')],_0x3fcfc2);_0x6e3dfa(_0x47a3ee[_0x8925('0x12')](0x1f4,_0x13197e[_0x8925('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x34cb69){var _0x49cd60=this;return new Promise(function(_0x76bf03,_0x4ec0d6){return db['VoiceCallReport'][_0x8925('0x1f')](_0x34cb69[_0x8925('0x20')],{'raw':_0x34cb69[_0x8925('0x17')]?_0x34cb69[_0x8925('0x17')][_0x8925('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5aa149){logger['info'](_0x8925('0x21'),_0x34cb69);logger[_0x8925('0x10')](_0x8925('0x21'),_0x34cb69,JSON[_0x8925('0x22')](_0x5aa149));_0x76bf03(_0x5aa149);})[_0x8925('0x15')](function(_0x4193da){logger[_0x8925('0x12')](_0x8925('0x21'),_0x4193da[_0x8925('0x13')],_0x34cb69);_0x4ec0d6(_0x49cd60['error'](0x1f4,_0x4193da[_0x8925('0x13')]));});});};exports[_0x8925('0x23')]=function(_0x8ecd5b){var _0x1b4d45=this;return new Promise(function(_0x50c89e,_0x4bacf2){return db['VoiceCallReport'][_0x8925('0x24')](_0x8ecd5b[_0x8925('0x20')],{'raw':_0x8ecd5b[_0x8925('0x17')]?_0x8ecd5b[_0x8925('0x17')][_0x8925('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ecd5b[_0x8925('0x17')]?_0x8ecd5b['options'][_0x8925('0x19')]||null:null,'attributes':_0x8ecd5b['options']?_0x8ecd5b[_0x8925('0x17')][_0x8925('0x1a')]||null:null,'limit':_0x8ecd5b['options']?_0x8ecd5b[_0x8925('0x17')][_0x8925('0x25')]||null:null})[_0x8925('0xd')](function(_0x37ea7e){logger[_0x8925('0xe')](_0x8925('0x23'),_0x8ecd5b);logger[_0x8925('0x10')]('UpdateVoiceCallReport',_0x8ecd5b,JSON[_0x8925('0x22')](_0x37ea7e));_0x50c89e(_0x37ea7e);})[_0x8925('0x15')](function(_0x2815de){logger['error'](_0x8925('0x23'),_0x2815de[_0x8925('0x13')],_0x8ecd5b);_0x4bacf2(_0x1b4d45[_0x8925('0x12')](0x1f4,_0x2815de[_0x8925('0x13')]));});});}; \ No newline at end of file +var _0xa24d=['request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','VoiceCallReport','findAll','options','raw','map','include','model','attributes','GetVoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5c83f3,_0x5f0b6b){var _0x1700b2=function(_0x47f7cd){while(--_0x47f7cd){_0x5c83f3['push'](_0x5c83f3['shift']());}};_0x1700b2(++_0x5f0b6b);}(_0xa24d,0x1a1));var _0xda24=function(_0x34bcbf,_0x529caf){_0x34bcbf=_0x34bcbf-0x0;var _0x4951ee=_0xa24d[_0x34bcbf];return _0x4951ee;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda24('0x4'));var db=require(_0xda24('0x5'))['db'];var utils=require(_0xda24('0x6'));var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e2f5,_0x21ecc4,_0x46cae2){return new BPromise(function(_0x2661ef,_0x28d38e){return client[_0xda24('0xc')](_0x13e2f5,_0x46cae2)[_0xda24('0xd')](function(_0x4d0b17){logger[_0xda24('0xe')](_0xda24('0xf'),_0x21ecc4,'request\x20sent');logger[_0xda24('0x10')](_0xda24('0x11'),_0x21ecc4,'request\x20sent',JSON[_0xda24('0x12')](_0x4d0b17));if(_0x4d0b17[_0xda24('0x13')]){if(_0x4d0b17[_0xda24('0x13')]['code']===0x1f4){logger[_0xda24('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x21ecc4,_0x4d0b17['error'][_0xda24('0x14')]);return _0x28d38e(_0x4d0b17['error'][_0xda24('0x14')]);}logger[_0xda24('0x13')](_0xda24('0xf'),_0x21ecc4,_0x4d0b17[_0xda24('0x13')][_0xda24('0x14')]);return _0x2661ef(_0x4d0b17[_0xda24('0x13')][_0xda24('0x14')]);}else{logger[_0xda24('0xe')](_0xda24('0xf'),_0x21ecc4,_0xda24('0x15'));_0x2661ef(_0x4d0b17[_0xda24('0x16')][_0xda24('0x14')]);}})[_0xda24('0x17')](function(_0x4ec2e6){logger[_0xda24('0x13')](_0xda24('0xf'),_0x21ecc4,_0x4ec2e6);_0x28d38e(_0x4ec2e6);});});}exports['GetVoiceCallReport']=function(_0x3f8efe){var _0x35e005=this;return new Promise(function(_0xc03209,_0x202ed9){return db[_0xda24('0x18')][_0xda24('0x19')]({'raw':_0x3f8efe['options']?_0x3f8efe[_0xda24('0x1a')][_0xda24('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f8efe['options']?_0x3f8efe[_0xda24('0x1a')]['where']||null:null,'attributes':_0x3f8efe[_0xda24('0x1a')]?_0x3f8efe[_0xda24('0x1a')]['attributes']||null:null,'limit':_0x3f8efe[_0xda24('0x1a')]?_0x3f8efe[_0xda24('0x1a')]['limit']||null:null,'include':_0x3f8efe[_0xda24('0x1a')]?_0x3f8efe[_0xda24('0x1a')]['include']?_[_0xda24('0x1c')](_0x3f8efe[_0xda24('0x1a')][_0xda24('0x1d')],function(_0x404d5e){return{'model':db[_0x404d5e[_0xda24('0x1e')]],'as':_0x404d5e['as'],'attributes':_0x404d5e[_0xda24('0x1f')],'include':_0x404d5e[_0xda24('0x1d')]?_['map'](_0x404d5e['include'],function(_0x195e77){return{'model':db[_0x195e77[_0xda24('0x1e')]],'as':_0x195e77['as'],'attributes':_0x195e77['attributes'],'include':_0x195e77[_0xda24('0x1d')]?_[_0xda24('0x1c')](_0x195e77[_0xda24('0x1d')],function(_0x1a1c05){return{'model':db[_0x1a1c05[_0xda24('0x1e')]],'as':_0x1a1c05['as'],'attributes':_0x1a1c05[_0xda24('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xda24('0xd')](function(_0x59fae6){logger[_0xda24('0xe')](_0xda24('0x20'),_0x3f8efe);logger[_0xda24('0x10')]('GetVoiceCallReport',_0x3f8efe,JSON[_0xda24('0x12')](_0x59fae6));_0xc03209(_0x59fae6);})['catch'](function(_0x362da8){logger[_0xda24('0x13')](_0xda24('0x20'),_0x362da8[_0xda24('0x14')],_0x3f8efe);_0x202ed9(_0x35e005[_0xda24('0x13')](0x1f4,_0x362da8[_0xda24('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0xd75e37){var _0xc4f1d8=this;return new Promise(function(_0x238555,_0x2ef0e2){return db['VoiceCallReport'][_0xda24('0x21')](_0xd75e37[_0xda24('0x22')],{'raw':_0xd75e37[_0xda24('0x1a')]?_0xd75e37[_0xda24('0x1a')][_0xda24('0x1b')]===undefined?!![]:![]:!![]})[_0xda24('0xd')](function(_0x806438){logger[_0xda24('0xe')](_0xda24('0x23'),_0xd75e37);logger[_0xda24('0x10')](_0xda24('0x23'),_0xd75e37,JSON['stringify'](_0x806438));_0x238555(_0x806438);})[_0xda24('0x17')](function(_0x4a2434){logger[_0xda24('0x13')](_0xda24('0x23'),_0x4a2434[_0xda24('0x14')],_0xd75e37);_0x2ef0e2(_0xc4f1d8['error'](0x1f4,_0x4a2434[_0xda24('0x14')]));});});};exports[_0xda24('0x24')]=function(_0x377504){var _0x17b0e8=this;return new Promise(function(_0x816053,_0x1ce77b){return db['VoiceCallReport'][_0xda24('0x25')](_0x377504['body'],{'raw':_0x377504[_0xda24('0x1a')]?_0x377504['options'][_0xda24('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377504['options']?_0x377504[_0xda24('0x1a')][_0xda24('0x26')]||null:null,'attributes':_0x377504['options']?_0x377504[_0xda24('0x1a')][_0xda24('0x1f')]||null:null,'limit':_0x377504[_0xda24('0x1a')]?_0x377504[_0xda24('0x1a')]['limit']||null:null})[_0xda24('0xd')](function(_0x51c972){logger[_0xda24('0xe')](_0xda24('0x24'),_0x377504);logger[_0xda24('0x10')](_0xda24('0x24'),_0x377504,JSON[_0xda24('0x12')](_0x51c972));_0x816053(_0x51c972);})[_0xda24('0x17')](function(_0x200f8b){logger[_0xda24('0x13')](_0xda24('0x24'),_0x200f8b[_0xda24('0x14')],_0x377504);_0x1ce77b(_0x17b0e8[_0xda24('0x13')](0x1f4,_0x200f8b[_0xda24('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 625d4ce..c9aaf3b 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 _0x7120=['post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id'];(function(_0x6b5f38,_0x4437d5){var _0x1ab696=function(_0x37d94d){while(--_0x37d94d){_0x6b5f38['push'](_0x6b5f38['shift']());}};_0x1ab696(++_0x4437d5);}(_0x7120,0x181));var _0x0712=function(_0x25ec96,_0x2ac486){_0x25ec96=_0x25ec96-0x0;var _0x1bab62=_0x7120[_0x25ec96];return _0x1bab62;};'use strict';var multer=require('multer');var util=require(_0x0712('0x0'));var path=require('path');var timeout=require(_0x0712('0x1'));var express=require(_0x0712('0x2'));var router=express[_0x0712('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0712('0x4'));var interaction=require(_0x0712('0x5'));var config=require(_0x0712('0x6'));var controller=require(_0x0712('0x7'));router[_0x0712('0x8')]('/',auth[_0x0712('0x9')](),controller['index']);router['get'](_0x0712('0xa'),auth[_0x0712('0x9')](),controller['show']);router[_0x0712('0xb')]('/',auth['isAuthenticated'](),controller[_0x0712('0xc')]);router[_0x0712('0xd')](_0x0712('0xa'),auth['isAuthenticated'](),controller[_0x0712('0xe')]);router[_0x0712('0xf')](_0x0712('0xa'),auth[_0x0712('0x9')](),controller[_0x0712('0x10')]);module[_0x0712('0x11')]=router; \ No newline at end of file +var _0x3078=['isAuthenticated','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id'];(function(_0x1c4903,_0x2c8ecd){var _0x1f0af5=function(_0x90ceaa){while(--_0x90ceaa){_0x1c4903['push'](_0x1c4903['shift']());}};_0x1f0af5(++_0x2c8ecd);}(_0x3078,0x66));var _0x8307=function(_0x43c8de,_0x4ac946){_0x43c8de=_0x43c8de-0x0;var _0x17430a=_0x3078[_0x43c8de];return _0x17430a;};'use strict';var multer=require(_0x8307('0x0'));var util=require(_0x8307('0x1'));var path=require(_0x8307('0x2'));var timeout=require(_0x8307('0x3'));var express=require(_0x8307('0x4'));var router=express[_0x8307('0x5')]();var fs_extra=require(_0x8307('0x6'));var auth=require(_0x8307('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8307('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x8307('0x9')]('/',auth['isAuthenticated'](),controller[_0x8307('0xa')]);router[_0x8307('0x9')](_0x8307('0xb'),auth[_0x8307('0xc')](),controller[_0x8307('0xd')]);router[_0x8307('0xe')]('/',auth[_0x8307('0xc')](),controller[_0x8307('0xf')]);router['put'](_0x8307('0xb'),auth[_0x8307('0xc')](),controller[_0x8307('0x10')]);router[_0x8307('0x11')](_0x8307('0xb'),auth[_0x8307('0xc')](),controller['destroy']);module[_0x8307('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fbe6e91..00292b4 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 _0x7555=['exports','STRING','join','getDataValue','options','split','BOOLEAN','sequelize'];(function(_0x397bfb,_0x589665){var _0x16c9b9=function(_0x13ce8a){while(--_0x13ce8a){_0x397bfb['push'](_0x397bfb['shift']());}};_0x16c9b9(++_0x589665);}(_0x7555,0x15f));var _0x5755=function(_0x27f81a,_0x42c7db){_0x27f81a=_0x27f81a-0x0;var _0x25b63f=_0x7555[_0x27f81a];return _0x25b63f;};'use strict';var Sequelize=require(_0x5755('0x0'));module[_0x5755('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5755('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x5755('0x2')],'set':function(_0x14a180){this['setDataValue']('options',_0x14a180?_0x14a180[_0x5755('0x3')](''):[]);},'get':function(){return this[_0x5755('0x4')](_0x5755('0x5'))?this[_0x5755('0x4')](_0x5755('0x5'))[_0x5755('0x6')](''):[];}},'auth':{'type':Sequelize[_0x5755('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x5755('0x2')]},'record':{'type':Sequelize[_0x5755('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5755('0x2')]},'description':{'type':Sequelize[_0x5755('0x2')]}}; \ No newline at end of file +var _0xf75e=['BOOLEAN','sequelize','exports','STRING','setDataValue','join','options','split'];(function(_0x2bf010,_0x3c817d){var _0xaec2e0=function(_0x4879d7){while(--_0x4879d7){_0x2bf010['push'](_0x2bf010['shift']());}};_0xaec2e0(++_0x3c817d);}(_0xf75e,0x91));var _0xef75=function(_0x27e593,_0x3c9f9f){_0x27e593=_0x27e593-0x0;var _0x1cfe0f=_0xf75e[_0x27e593];return _0x1cfe0f;};'use strict';var Sequelize=require(_0xef75('0x0'));module[_0xef75('0x1')]={'name':{'type':Sequelize[_0xef75('0x2')]},'prefix':{'type':Sequelize[_0xef75('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x113bba){this[_0xef75('0x3')]('options',_0x113bba?_0x113bba[_0xef75('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xef75('0x5'))?this['getDataValue'](_0xef75('0x5'))[_0xef75('0x6')](''):[];}},'auth':{'type':Sequelize[_0xef75('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xef75('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xef75('0x2')]},'description':{'type':Sequelize[_0xef75('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4e75052..3a20ac1 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 _0x24a6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','rows','catch','show','params','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x24a6,0x14f));var _0x624a=function(_0x8c9f1f,_0x47aae7){_0x8c9f1f=_0x8c9f1f-0x0;var _0x1e9ed4=_0x24a6[_0x8c9f1f];return _0x1e9ed4;};'use strict';var emlformat=require(_0x624a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x624a('0x1'));var jsonpatch=require(_0x624a('0x2'));var rp=require(_0x624a('0x3'));var moment=require(_0x624a('0x4'));var BPromise=require(_0x624a('0x5'));var Mustache=require(_0x624a('0x6'));var util=require(_0x624a('0x7'));var path=require(_0x624a('0x8'));var sox=require(_0x624a('0x9'));var csv=require(_0x624a('0xa'));var ejs=require(_0x624a('0xb'));var fs=require('fs');var fs_extra=require(_0x624a('0xc'));var _=require(_0x624a('0xd'));var squel=require(_0x624a('0xe'));var crypto=require(_0x624a('0xf'));var jsforce=require(_0x624a('0x10'));var deskjs=require(_0x624a('0x11'));var toCsv=require(_0x624a('0xa'));var querystring=require(_0x624a('0x12'));var Papa=require(_0x624a('0x13'));var Redis=require(_0x624a('0x14'));var authService=require(_0x624a('0x15'));var qs=require(_0x624a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x624a('0x17'))(_0x624a('0x18'));var utils=require(_0x624a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x624a('0x1a'));var db=require(_0x624a('0x1b'))['db'];function respondWithStatusCode(_0x5f0954,_0x50d1aa){_0x50d1aa=_0x50d1aa||0xcc;return function(_0x5406ce){if(_0x5406ce){return _0x5f0954[_0x624a('0x1c')](_0x50d1aa);}return _0x5f0954['status'](_0x50d1aa)[_0x624a('0x1d')]();};}function respondWithResult(_0x89e2fd,_0xe310b4){_0xe310b4=_0xe310b4||0xc8;return function(_0x1e6ffd){if(_0x1e6ffd){return _0x89e2fd['status'](_0xe310b4)[_0x624a('0x1e')](_0x1e6ffd);}};}function respondWithFilteredResult(_0x4935f4,_0x424200){return function(_0x195bfc){if(_0x195bfc){var _0x53005e=typeof _0x424200[_0x624a('0x1f')]===_0x624a('0x20')&&typeof _0x424200[_0x624a('0x21')]===_0x624a('0x20');var _0xce9cd5=_0x195bfc[_0x624a('0x22')];var _0x364867=_0x53005e?0x0:_0x424200[_0x624a('0x1f')];var _0x35342c=_0x53005e?_0x195bfc[_0x624a('0x22')]:_0x424200['offset']+_0x424200[_0x624a('0x21')];var _0x5c6901;if(_0x35342c>=_0xce9cd5){_0x35342c=_0xce9cd5;_0x5c6901=0xc8;}else{_0x5c6901=0xce;}_0x4935f4[_0x624a('0x23')](_0x5c6901);return _0x4935f4['set'](_0x624a('0x24'),_0x364867+'-'+_0x35342c+'/'+_0xce9cd5)[_0x624a('0x1e')](_0x195bfc);}return null;};}function patchUpdates(_0x415af0){return function(_0x200fdc){try{jsonpatch[_0x624a('0x25')](_0x200fdc,_0x415af0,!![]);}catch(_0x54e669){return BPromise[_0x624a('0x26')](_0x54e669);}return _0x200fdc[_0x624a('0x27')]();};}function saveUpdates(_0x156d32,_0x22beca){return function(_0x5dfeec){if(_0x5dfeec){return _0x5dfeec[_0x624a('0x28')](_0x156d32)[_0x624a('0x29')](function(_0x264349){return _0x264349;});}return null;};}function removeEntity(_0x4ba881,_0x4aee03){return function(_0x56834b){if(_0x56834b){return _0x56834b[_0x624a('0x2a')]()[_0x624a('0x29')](function(){var _0x31279d=_0x56834b[_0x624a('0x2b')]({'plain':!![]});var _0x51a817='ChanSpies';return db[_0x624a('0x2c')][_0x624a('0x2a')]({'where':{'type':_0x51a817,'resourceId':_0x31279d['id']}})['then'](function(){return _0x56834b;});})[_0x624a('0x29')](function(){_0x4ba881[_0x624a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5366c4,_0x585126){return function(_0x41993c){if(!_0x41993c){_0x5366c4[_0x624a('0x1c')](0x194);}return _0x41993c;};}function handleError(_0x49ae13,_0x57d2d5){_0x57d2d5=_0x57d2d5||0x1f4;return function(_0x59917f){logger[_0x624a('0x2d')](_0x59917f[_0x624a('0x2e')]);if(_0x59917f[_0x624a('0x2f')]){delete _0x59917f['name'];}_0x49ae13[_0x624a('0x23')](_0x57d2d5)[_0x624a('0x30')](_0x59917f);};}exports['index']=function(_0x466af4,_0x59df8f){var _0x209ca5={},_0x1e775b={},_0x22140a={'count':0x0,'rows':[]};var _0x4619a8=_['map'](db[_0x624a('0x31')][_0x624a('0x32')],function(_0x5e8983){return{'name':_0x5e8983[_0x624a('0x33')],'type':_0x5e8983[_0x624a('0x34')][_0x624a('0x35')]};});_0x1e775b[_0x624a('0x36')]=_[_0x624a('0x37')](_0x4619a8,_0x624a('0x2f'));_0x1e775b['query']=_['keys'](_0x466af4[_0x624a('0x38')]);_0x1e775b[_0x624a('0x39')]=_[_0x624a('0x3a')](_0x1e775b['model'],_0x1e775b[_0x624a('0x38')]);_0x209ca5['attributes']=_['intersection'](_0x1e775b['model'],qs[_0x624a('0x3b')](_0x466af4['query'][_0x624a('0x3b')]));_0x209ca5['attributes']=_0x209ca5[_0x624a('0x3c')]['length']?_0x209ca5['attributes']:_0x1e775b[_0x624a('0x36')];if(!_0x466af4[_0x624a('0x38')][_0x624a('0x3d')](_0x624a('0x3e'))){_0x209ca5[_0x624a('0x21')]=qs[_0x624a('0x21')](_0x466af4[_0x624a('0x38')][_0x624a('0x21')]);_0x209ca5[_0x624a('0x1f')]=qs[_0x624a('0x1f')](_0x466af4['query'][_0x624a('0x1f')]);}_0x209ca5[_0x624a('0x3f')]=qs[_0x624a('0x40')](_0x466af4[_0x624a('0x38')][_0x624a('0x40')]);_0x209ca5['where']=qs[_0x624a('0x39')](_[_0x624a('0x41')](_0x466af4[_0x624a('0x38')],_0x1e775b[_0x624a('0x39')]),_0x4619a8);if(_0x466af4[_0x624a('0x38')][_0x624a('0x42')]){_0x209ca5['where']=_[_0x624a('0x43')](_0x209ca5[_0x624a('0x44')],{'$or':_[_0x624a('0x37')](_0x4619a8,function(_0x51d189){if(_0x51d189[_0x624a('0x34')]!=='VIRTUAL'){var _0x49db9c={};_0x49db9c[_0x51d189[_0x624a('0x2f')]]={'$like':'%'+_0x466af4[_0x624a('0x38')][_0x624a('0x42')]+'%'};return _0x49db9c;}})});}_0x209ca5=_['merge']({},_0x209ca5,_0x466af4['options']);var _0x142eb3={'where':_0x209ca5[_0x624a('0x44')]};return db['VoiceChanSpy'][_0x624a('0x22')](_0x142eb3)[_0x624a('0x29')](function(_0x574651){_0x22140a[_0x624a('0x22')]=_0x574651;if(_0x466af4[_0x624a('0x38')][_0x624a('0x45')]){_0x209ca5[_0x624a('0x46')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x209ca5);})['then'](function(_0x23168b){_0x22140a[_0x624a('0x47')]=_0x23168b;return _0x22140a;})[_0x624a('0x29')](respondWithFilteredResult(_0x59df8f,_0x209ca5))[_0x624a('0x48')](handleError(_0x59df8f,null));};exports[_0x624a('0x49')]=function(_0x241883,_0x28a512){var _0x5f28aa={'raw':![],'where':{'id':_0x241883[_0x624a('0x4a')]['id']}},_0x2193fb={};_0x2193fb['model']=_['keys'](db[_0x624a('0x31')]['rawAttributes']);_0x2193fb[_0x624a('0x38')]=_[_0x624a('0x4b')](_0x241883[_0x624a('0x38')]);_0x2193fb['filters']=_[_0x624a('0x3a')](_0x2193fb[_0x624a('0x36')],_0x2193fb[_0x624a('0x38')]);_0x5f28aa[_0x624a('0x3c')]=_[_0x624a('0x3a')](_0x2193fb['model'],qs[_0x624a('0x3b')](_0x241883[_0x624a('0x38')][_0x624a('0x3b')]));_0x5f28aa['attributes']=_0x5f28aa[_0x624a('0x3c')][_0x624a('0x4c')]?_0x5f28aa[_0x624a('0x3c')]:_0x2193fb[_0x624a('0x36')];if(_0x241883[_0x624a('0x38')][_0x624a('0x45')]){_0x5f28aa['include']=[{'all':!![]}];}_0x5f28aa=_[_0x624a('0x43')]({},_0x5f28aa,_0x241883['options']);return db['VoiceChanSpy']['find'](_0x5f28aa)[_0x624a('0x29')](handleEntityNotFound(_0x28a512,null))[_0x624a('0x29')](respondWithResult(_0x28a512,null))[_0x624a('0x48')](handleError(_0x28a512,null));};exports[_0x624a('0x4d')]=function(_0x5312ec,_0x18c318){return db[_0x624a('0x31')][_0x624a('0x4d')](_0x5312ec['body'],{})['then'](function(_0x12d767){var _0x22a46d=_0x5312ec[_0x624a('0x4e')][_0x624a('0x2b')]({'plain':!![]});if(!_0x22a46d)throw new Error(_0x624a('0x4f'));if(_0x22a46d[_0x624a('0x50')]==='user'){var _0x351dc9=_0x12d767[_0x624a('0x2b')]({'plain':!![]});var _0x4ca80b=_0x624a('0x51');return db[_0x624a('0x52')][_0x624a('0x53')]({'where':{'name':_0x4ca80b,'userProfileId':_0x22a46d[_0x624a('0x54')]},'raw':!![]})[_0x624a('0x29')](function(_0x12bc21){if(_0x12bc21&&_0x12bc21['autoAssociation']===0x0){return db[_0x624a('0x2c')][_0x624a('0x4d')]({'name':_0x351dc9['name'],'resourceId':_0x351dc9['id'],'type':_0x12bc21[_0x624a('0x2f')],'sectionId':_0x12bc21['id']},{})[_0x624a('0x29')](function(){return _0x12d767;});}else{return _0x12d767;}})[_0x624a('0x48')](function(_0x52fc4e){logger[_0x624a('0x2d')](_0x624a('0x55'),_0x52fc4e);throw _0x52fc4e;});}return _0x12d767;})[_0x624a('0x29')](respondWithResult(_0x18c318,0xc9))['catch'](handleError(_0x18c318,null));};exports['update']=function(_0x590c83,_0x38429f){if(_0x590c83[_0x624a('0x56')]['id']){delete _0x590c83[_0x624a('0x56')]['id'];}return db[_0x624a('0x31')][_0x624a('0x53')]({'where':{'id':_0x590c83['params']['id']}})[_0x624a('0x29')](handleEntityNotFound(_0x38429f,null))[_0x624a('0x29')](saveUpdates(_0x590c83[_0x624a('0x56')],null))[_0x624a('0x29')](respondWithResult(_0x38429f,null))['catch'](handleError(_0x38429f,null));};exports['destroy']=function(_0x4e610,_0x33ccf1){return db['VoiceChanSpy']['find']({'where':{'id':_0x4e610[_0x624a('0x4a')]['id']}})[_0x624a('0x29')](handleEntityNotFound(_0x33ccf1,null))[_0x624a('0x29')](removeEntity(_0x33ccf1,null))['catch'](handleError(_0x33ccf1,null));}; \ No newline at end of file +var _0xf194=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','stack','name','index','map','VoiceChanSpy','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','merge','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x327c71,_0x2d75f0){var _0x1a99e3=function(_0x40944a){while(--_0x40944a){_0x327c71['push'](_0x327c71['shift']());}};_0x1a99e3(++_0x2d75f0);}(_0xf194,0x91));var _0x4f19=function(_0x3b4151,_0x22fbf2){_0x3b4151=_0x3b4151-0x0;var _0x598d4c=_0xf194[_0x3b4151];return _0x598d4c;};'use strict';var emlformat=require(_0x4f19('0x0'));var rimraf=require(_0x4f19('0x1'));var zipdir=require(_0x4f19('0x2'));var jsonpatch=require(_0x4f19('0x3'));var rp=require('request-promise');var moment=require(_0x4f19('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f19('0x5'));var sox=require(_0x4f19('0x6'));var csv=require(_0x4f19('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f19('0x8'));var _=require(_0x4f19('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f19('0xa'));var deskjs=require(_0x4f19('0xb'));var toCsv=require(_0x4f19('0x7'));var querystring=require(_0x4f19('0xc'));var Papa=require('papaparse');var Redis=require(_0x4f19('0xd'));var authService=require(_0x4f19('0xe'));var qs=require(_0x4f19('0xf'));var as=require(_0x4f19('0x10'));var hardwareService=require(_0x4f19('0x11'));var logger=require(_0x4f19('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f19('0x13'));var db=require(_0x4f19('0x14'))['db'];function respondWithStatusCode(_0x5f4f1d,_0x6280a0){_0x6280a0=_0x6280a0||0xcc;return function(_0x26348c){if(_0x26348c){return _0x5f4f1d[_0x4f19('0x15')](_0x6280a0);}return _0x5f4f1d[_0x4f19('0x16')](_0x6280a0)['end']();};}function respondWithResult(_0x144e21,_0x25e5ce){_0x25e5ce=_0x25e5ce||0xc8;return function(_0x4b7198){if(_0x4b7198){return _0x144e21[_0x4f19('0x16')](_0x25e5ce)[_0x4f19('0x17')](_0x4b7198);}};}function respondWithFilteredResult(_0x5b77b1,_0x298562){return function(_0x55e1f8){if(_0x55e1f8){var _0x33bded=typeof _0x298562[_0x4f19('0x18')]==='undefined'&&typeof _0x298562['limit']===_0x4f19('0x19');var _0x34f0dc=_0x55e1f8[_0x4f19('0x1a')];var _0x576eef=_0x33bded?0x0:_0x298562[_0x4f19('0x18')];var _0x205fee=_0x33bded?_0x55e1f8[_0x4f19('0x1a')]:_0x298562[_0x4f19('0x18')]+_0x298562[_0x4f19('0x1b')];var _0x5915a2;if(_0x205fee>=_0x34f0dc){_0x205fee=_0x34f0dc;_0x5915a2=0xc8;}else{_0x5915a2=0xce;}_0x5b77b1[_0x4f19('0x16')](_0x5915a2);return _0x5b77b1[_0x4f19('0x1c')]('Content-Range',_0x576eef+'-'+_0x205fee+'/'+_0x34f0dc)[_0x4f19('0x17')](_0x55e1f8);}return null;};}function patchUpdates(_0x14ff93){return function(_0x3312f8){try{jsonpatch[_0x4f19('0x1d')](_0x3312f8,_0x14ff93,!![]);}catch(_0x5ee94d){return BPromise[_0x4f19('0x1e')](_0x5ee94d);}return _0x3312f8[_0x4f19('0x1f')]();};}function saveUpdates(_0x13cdcb,_0xcbe002){return function(_0x11a272){if(_0x11a272){return _0x11a272[_0x4f19('0x20')](_0x13cdcb)[_0x4f19('0x21')](function(_0x40c007){return _0x40c007;});}return null;};}function removeEntity(_0x9e3298,_0x10e164){return function(_0x4531f4){if(_0x4531f4){return _0x4531f4[_0x4f19('0x22')]()[_0x4f19('0x21')](function(){var _0x3457a4=_0x4531f4[_0x4f19('0x23')]({'plain':!![]});var _0x39cb12=_0x4f19('0x24');return db[_0x4f19('0x25')][_0x4f19('0x22')]({'where':{'type':_0x39cb12,'resourceId':_0x3457a4['id']}})['then'](function(){return _0x4531f4;});})[_0x4f19('0x21')](function(){_0x9e3298['status'](0xcc)[_0x4f19('0x26')]();});}};}function handleEntityNotFound(_0x515956,_0x759454){return function(_0x5321a8){if(!_0x5321a8){_0x515956[_0x4f19('0x15')](0x194);}return _0x5321a8;};}function handleError(_0x22f4ad,_0xc37e6f){_0xc37e6f=_0xc37e6f||0x1f4;return function(_0x567bd2){logger[_0x4f19('0x27')](_0x567bd2[_0x4f19('0x28')]);if(_0x567bd2[_0x4f19('0x29')]){delete _0x567bd2[_0x4f19('0x29')];}_0x22f4ad[_0x4f19('0x16')](_0xc37e6f)['send'](_0x567bd2);};}exports[_0x4f19('0x2a')]=function(_0xa6789b,_0x4eceaa){var _0x3531d9={},_0x3c7e22={},_0x4505df={'count':0x0,'rows':[]};var _0x1f38a7=_[_0x4f19('0x2b')](db[_0x4f19('0x2c')]['rawAttributes'],function(_0x27e96d){return{'name':_0x27e96d[_0x4f19('0x2d')],'type':_0x27e96d[_0x4f19('0x2e')]['key']};});_0x3c7e22[_0x4f19('0x2f')]=_[_0x4f19('0x2b')](_0x1f38a7,_0x4f19('0x29'));_0x3c7e22[_0x4f19('0x30')]=_[_0x4f19('0x31')](_0xa6789b[_0x4f19('0x30')]);_0x3c7e22['filters']=_[_0x4f19('0x32')](_0x3c7e22[_0x4f19('0x2f')],_0x3c7e22['query']);_0x3531d9[_0x4f19('0x33')]=_[_0x4f19('0x32')](_0x3c7e22[_0x4f19('0x2f')],qs[_0x4f19('0x34')](_0xa6789b[_0x4f19('0x30')][_0x4f19('0x34')]));_0x3531d9[_0x4f19('0x33')]=_0x3531d9['attributes'][_0x4f19('0x35')]?_0x3531d9[_0x4f19('0x33')]:_0x3c7e22[_0x4f19('0x2f')];if(!_0xa6789b[_0x4f19('0x30')][_0x4f19('0x36')](_0x4f19('0x37'))){_0x3531d9[_0x4f19('0x1b')]=qs[_0x4f19('0x1b')](_0xa6789b[_0x4f19('0x30')]['limit']);_0x3531d9[_0x4f19('0x18')]=qs[_0x4f19('0x18')](_0xa6789b[_0x4f19('0x30')][_0x4f19('0x18')]);}_0x3531d9[_0x4f19('0x38')]=qs['sort'](_0xa6789b['query'][_0x4f19('0x39')]);_0x3531d9[_0x4f19('0x3a')]=qs['filters'](_['pick'](_0xa6789b[_0x4f19('0x30')],_0x3c7e22[_0x4f19('0x3b')]),_0x1f38a7);if(_0xa6789b['query']['filter']){_0x3531d9[_0x4f19('0x3a')]=_['merge'](_0x3531d9[_0x4f19('0x3a')],{'$or':_[_0x4f19('0x2b')](_0x1f38a7,function(_0x23a565){if(_0x23a565[_0x4f19('0x2e')]!==_0x4f19('0x3c')){var _0x3a0648={};_0x3a0648[_0x23a565[_0x4f19('0x29')]]={'$like':'%'+_0xa6789b[_0x4f19('0x30')][_0x4f19('0x3d')]+'%'};return _0x3a0648;}})});}_0x3531d9=_['merge']({},_0x3531d9,_0xa6789b[_0x4f19('0x3e')]);var _0x485c2a={'where':_0x3531d9[_0x4f19('0x3a')]};return db[_0x4f19('0x2c')][_0x4f19('0x1a')](_0x485c2a)[_0x4f19('0x21')](function(_0x26b18e){_0x4505df[_0x4f19('0x1a')]=_0x26b18e;if(_0xa6789b['query']['includeAll']){_0x3531d9[_0x4f19('0x3f')]=[{'all':!![]}];}return db[_0x4f19('0x2c')][_0x4f19('0x40')](_0x3531d9);})['then'](function(_0x41257f){_0x4505df[_0x4f19('0x41')]=_0x41257f;return _0x4505df;})[_0x4f19('0x21')](respondWithFilteredResult(_0x4eceaa,_0x3531d9))['catch'](handleError(_0x4eceaa,null));};exports[_0x4f19('0x42')]=function(_0x2a58a2,_0x350463){var _0x565c54={'raw':![],'where':{'id':_0x2a58a2[_0x4f19('0x43')]['id']}},_0x4c070c={};_0x4c070c[_0x4f19('0x2f')]=_[_0x4f19('0x31')](db['VoiceChanSpy']['rawAttributes']);_0x4c070c[_0x4f19('0x30')]=_[_0x4f19('0x31')](_0x2a58a2[_0x4f19('0x30')]);_0x4c070c[_0x4f19('0x3b')]=_[_0x4f19('0x32')](_0x4c070c[_0x4f19('0x2f')],_0x4c070c[_0x4f19('0x30')]);_0x565c54[_0x4f19('0x33')]=_[_0x4f19('0x32')](_0x4c070c[_0x4f19('0x2f')],qs['fields'](_0x2a58a2[_0x4f19('0x30')][_0x4f19('0x34')]));_0x565c54[_0x4f19('0x33')]=_0x565c54[_0x4f19('0x33')][_0x4f19('0x35')]?_0x565c54[_0x4f19('0x33')]:_0x4c070c[_0x4f19('0x2f')];if(_0x2a58a2[_0x4f19('0x30')][_0x4f19('0x44')]){_0x565c54[_0x4f19('0x3f')]=[{'all':!![]}];}_0x565c54=_[_0x4f19('0x45')]({},_0x565c54,_0x2a58a2['options']);return db[_0x4f19('0x2c')]['find'](_0x565c54)['then'](handleEntityNotFound(_0x350463,null))[_0x4f19('0x21')](respondWithResult(_0x350463,null))[_0x4f19('0x46')](handleError(_0x350463,null));};exports[_0x4f19('0x47')]=function(_0x3f08f3,_0x4b7c50){return db['VoiceChanSpy']['create'](_0x3f08f3['body'],{})['then'](function(_0x59b761){var _0x5b72ad=_0x3f08f3[_0x4f19('0x48')][_0x4f19('0x23')]({'plain':!![]});if(!_0x5b72ad)throw new Error(_0x4f19('0x49'));if(_0x5b72ad[_0x4f19('0x4a')]===_0x4f19('0x48')){var _0x327a96=_0x59b761['get']({'plain':!![]});var _0x454f0f=_0x4f19('0x24');return db[_0x4f19('0x4b')][_0x4f19('0x4c')]({'where':{'name':_0x454f0f,'userProfileId':_0x5b72ad['userProfileId']},'raw':!![]})['then'](function(_0xd88444){if(_0xd88444&&_0xd88444[_0x4f19('0x4d')]===0x0){return db[_0x4f19('0x25')]['create']({'name':_0x327a96[_0x4f19('0x29')],'resourceId':_0x327a96['id'],'type':_0xd88444[_0x4f19('0x29')],'sectionId':_0xd88444['id']},{})[_0x4f19('0x21')](function(){return _0x59b761;});}else{return _0x59b761;}})[_0x4f19('0x46')](function(_0xbf80ab){logger[_0x4f19('0x27')](_0x4f19('0x4e'),_0xbf80ab);throw _0xbf80ab;});}return _0x59b761;})[_0x4f19('0x21')](respondWithResult(_0x4b7c50,0xc9))['catch'](handleError(_0x4b7c50,null));};exports[_0x4f19('0x20')]=function(_0x6330c3,_0x10966e){if(_0x6330c3[_0x4f19('0x4f')]['id']){delete _0x6330c3[_0x4f19('0x4f')]['id'];}return db[_0x4f19('0x2c')][_0x4f19('0x4c')]({'where':{'id':_0x6330c3[_0x4f19('0x43')]['id']}})['then'](handleEntityNotFound(_0x10966e,null))[_0x4f19('0x21')](saveUpdates(_0x6330c3['body'],null))['then'](respondWithResult(_0x10966e,null))[_0x4f19('0x46')](handleError(_0x10966e,null));};exports[_0x4f19('0x22')]=function(_0x45694e,_0x7b4bf){return db[_0x4f19('0x2c')][_0x4f19('0x4c')]({'where':{'id':_0x45694e[_0x4f19('0x43')]['id']}})[_0x4f19('0x21')](handleEntityNotFound(_0x7b4bf,null))['then'](removeEntity(_0x7b4bf,null))[_0x4f19('0x46')](handleError(_0x7b4bf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 44493df..d15f11b 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 _0x95fb=['${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','name','options','join','record','concat','internal','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','MixMonitor'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x95fb,0x1c7));var _0xb95f=function(_0x3ffe90,_0x10b4df){_0x3ffe90=_0x3ffe90-0x0;var _0x3a7367=_0x95fb[_0x3ffe90];return _0x3a7367;};'use strict';var _=require(_0xb95f('0x0'));var util=require('util');var BPromise=require(_0xb95f('0x1'));var attributes=require(_0xb95f('0x2'));var getUserApplications=function(_0x41eb38,_0x583f7b,_0x463af2){var _0x42e465=0x1;var _0x1a311e=[];var _0xc2f14c={'context':_0x583f7b[_0xb95f('0x3')]||_0xb95f('0x4'),'exten':util[_0xb95f('0x5')](_0xb95f('0x6'),_0x41eb38[_0xb95f('0x7')],_0x463af2),'type':_0xb95f('0x8'),'isApp':![],'ChanSpyId':_0x41eb38['id'],'UserId':_0x583f7b['id']};_0x1a311e[_0xb95f('0x9')](_[_0xb95f('0xa')]({'app':_0xb95f('0xb'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x42e465++},_0xc2f14c));if(_0x41eb38['record']){_0x1a311e[_0xb95f('0x9')](_['merge']({'app':_0xb95f('0xc'),'appdata':util[_0xb95f('0x5')](_0xb95f('0xd'),_0x41eb38[_0xb95f('0xe')]),'priority':_0x42e465++},_0xc2f14c));}if(_0x41eb38[_0xb95f('0xf')]){_0x1a311e[_0xb95f('0x9')](_[_0xb95f('0xa')]({'app':'Authenticate','appdata':_0x41eb38[_0xb95f('0x10')],'priority':_0x42e465++},_0xc2f14c));}_0x1a311e[_0xb95f('0x9')](_[_0xb95f('0xa')]({'app':_0xb95f('0x11'),'appdata':util[_0xb95f('0x5')]('SIP/%s,%s',_0x583f7b[_0xb95f('0x12')],_0x41eb38['options']?_0x41eb38[_0xb95f('0x13')][_0xb95f('0x14')](''):''),'priority':_0x42e465++},_0xc2f14c));if(_0x41eb38[_0xb95f('0x15')]){_0x1a311e['push'](_[_0xb95f('0xa')]({'app':'StopMixMonitor','priority':_0x42e465++},_0xc2f14c));}return _0x1a311e;};var getChanSpyApplications=function(_0x3c43e2,_0x1dcf99){var _0xce4aaf=[];for(var _0x261a75=0x0,_0x5ac763=0x1;_0x261a75<_0x1dcf99['length'];_0x261a75++,_0x5ac763=0x1){_0xce4aaf=_0xce4aaf[_0xb95f('0x16')](getUserApplications(_0x3c43e2,_0x1dcf99[_0x261a75],_0x1dcf99[_0x261a75][_0xb95f('0x17')]));if(_0x1dcf99[_0x261a75]['internal']!=_0x1dcf99[_0x261a75][_0xb95f('0x12')]){_0xce4aaf=_0xce4aaf[_0xb95f('0x16')](getUserApplications(_0x3c43e2,_0x1dcf99[_0x261a75],_0x1dcf99[_0x261a75][_0xb95f('0x12')]));}}return _0xce4aaf;};var getChanSpyPromise=function(_0x47346a,_0x5608d5){return new BPromise(function(_0x14e77b,_0x4ee210){return _0x47346a['User'][_0xb95f('0x18')]({'attributes':['id',_0xb95f('0x12'),_0xb95f('0x17')],'where':{'role':_0xb95f('0x19'),'chanspy':!![]},'raw':!![]})[_0xb95f('0x1a')](function(_0xe22b73){if(_0xe22b73){return _0x14e77b(getChanSpyApplications(_0x5608d5,_0xe22b73));}return _0x14e77b([]);})[_0xb95f('0x1b')](function(_0x12bc33){_0x4ee210(_0x12bc33);});});};module[_0xb95f('0x1c')]=function(_0x453b00,_0x36d71e){var _0x2aa5df=_0x453b00[_0xb95f('0x1d')];return _0x453b00['define'](_0xb95f('0x1e'),attributes,{'tableName':_0xb95f('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36095a,_0x1bf617,_0x1a0f0f){return getChanSpyPromise(_0x2aa5df,_0x36095a)[_0xb95f('0x1a')](function(_0x4e6d46){if(_0x4e6d46&&_0x4e6d46[_0xb95f('0x20')]){return _0x2aa5df[_0xb95f('0x21')]['bulkCreate'](_0x4e6d46);}})[_0xb95f('0x1a')](function(){_0x1a0f0f();})[_0xb95f('0x1b')](function(_0x1208d5){_0x1a0f0f(_0x1208d5);});},'afterUpdate':function(_0x308d79,_0x4d3f7e,_0x3e840d){return _0x2aa5df[_0xb95f('0x21')]['destroy']({'where':{'ChanSpyId':_0x308d79['id']}})[_0xb95f('0x1a')](function(){return getChanSpyPromise(_0x2aa5df,_0x308d79);})['then'](function(_0x1f9cb1){if(_0x1f9cb1&&_0x1f9cb1['length']){return _0x2aa5df[_0xb95f('0x21')][_0xb95f('0x22')](_0x1f9cb1);}})['then'](function(){_0x3e840d();})['catch'](function(_0xc3dd6){_0x3e840d(_0xc3dd6);});},'afterDestroy':function(_0x1de2bd,_0x2c3eee,_0x4a63a1){return _0x2aa5df[_0xb95f('0x21')][_0xb95f('0x23')]({'where':{'ChanSpyId':_0x1de2bd['id']}})[_0xb95f('0x1a')](function(){_0x4a63a1();})[_0xb95f('0x1b')](function(_0x1ada0f){_0x4a63a1(_0x1ada0f);});}}});}; \ No newline at end of file +var _0x4a05=['models','define','VoiceChanSpy','voice_chanspy','then','bulkCreate','VoiceExtension','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','auth','Authenticate','ChanSpy','format','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a05,0x138));var _0x54a0=function(_0x2fe9d3,_0x2fcde6){_0x2fe9d3=_0x2fe9d3-0x0;var _0x16f31b=_0x4a05[_0x2fe9d3];return _0x16f31b;};'use strict';var _=require(_0x54a0('0x0'));var util=require('util');var BPromise=require(_0x54a0('0x1'));var attributes=require(_0x54a0('0x2'));var getUserApplications=function(_0x39759a,_0x9d6815,_0x142e6d){var _0x3b8502=0x1;var _0x391080=[];var _0x325fec={'context':_0x9d6815[_0x54a0('0x3')]||'from-sip','exten':util['format'](_0x54a0('0x4'),_0x39759a[_0x54a0('0x5')],_0x142e6d),'type':_0x54a0('0x6'),'isApp':![],'ChanSpyId':_0x39759a['id'],'UserId':_0x9d6815['id']};_0x391080[_0x54a0('0x7')](_[_0x54a0('0x8')]({'app':_0x54a0('0x9'),'appdata':util['format'](_0x54a0('0xa'),_0x54a0('0xb')),'priority':_0x3b8502++},_0x325fec));if(_0x39759a[_0x54a0('0xc')]){_0x391080[_0x54a0('0x7')](_[_0x54a0('0x8')]({'app':_0x54a0('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x39759a['recordingFormat']),'priority':_0x3b8502++},_0x325fec));}if(_0x39759a[_0x54a0('0xe')]){_0x391080[_0x54a0('0x7')](_[_0x54a0('0x8')]({'app':_0x54a0('0xf'),'appdata':_0x39759a['password'],'priority':_0x3b8502++},_0x325fec));}_0x391080[_0x54a0('0x7')](_['merge']({'app':_0x54a0('0x10'),'appdata':util[_0x54a0('0x11')](_0x54a0('0x12'),_0x9d6815[_0x54a0('0x13')],_0x39759a[_0x54a0('0x14')]?_0x39759a[_0x54a0('0x14')][_0x54a0('0x15')](''):''),'priority':_0x3b8502++},_0x325fec));if(_0x39759a[_0x54a0('0xc')]){_0x391080[_0x54a0('0x7')](_[_0x54a0('0x8')]({'app':'StopMixMonitor','priority':_0x3b8502++},_0x325fec));}return _0x391080;};var getChanSpyApplications=function(_0x22bb4e,_0x11b708){var _0x5bed72=[];for(var _0x1bd180=0x0,_0x26f811=0x1;_0x1bd180<_0x11b708[_0x54a0('0x16')];_0x1bd180++,_0x26f811=0x1){_0x5bed72=_0x5bed72[_0x54a0('0x17')](getUserApplications(_0x22bb4e,_0x11b708[_0x1bd180],_0x11b708[_0x1bd180][_0x54a0('0x18')]));if(_0x11b708[_0x1bd180][_0x54a0('0x18')]!=_0x11b708[_0x1bd180]['name']){_0x5bed72=_0x5bed72[_0x54a0('0x17')](getUserApplications(_0x22bb4e,_0x11b708[_0x1bd180],_0x11b708[_0x1bd180][_0x54a0('0x13')]));}}return _0x5bed72;};var getChanSpyPromise=function(_0x24561a,_0xfd8e97){return new BPromise(function(_0x5118dc,_0x345b36){return _0x24561a[_0x54a0('0x19')][_0x54a0('0x1a')]({'attributes':['id',_0x54a0('0x13'),_0x54a0('0x18')],'where':{'role':_0x54a0('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x2c6eef){if(_0x2c6eef){return _0x5118dc(getChanSpyApplications(_0xfd8e97,_0x2c6eef));}return _0x5118dc([]);})[_0x54a0('0x1c')](function(_0x51f11f){_0x345b36(_0x51f11f);});});};module[_0x54a0('0x1d')]=function(_0x2687e0,_0xd6c0cf){var _0x4ad256=_0x2687e0[_0x54a0('0x1e')];return _0x2687e0[_0x54a0('0x1f')](_0x54a0('0x20'),attributes,{'tableName':_0x54a0('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eb355,_0x5e08f3,_0x46de34){return getChanSpyPromise(_0x4ad256,_0x3eb355)[_0x54a0('0x22')](function(_0x35a0f4){if(_0x35a0f4&&_0x35a0f4[_0x54a0('0x16')]){return _0x4ad256['VoiceExtension'][_0x54a0('0x23')](_0x35a0f4);}})[_0x54a0('0x22')](function(){_0x46de34();})[_0x54a0('0x1c')](function(_0x5ccd3d){_0x46de34(_0x5ccd3d);});},'afterUpdate':function(_0x19f37a,_0x5a3943,_0x4009a1){return _0x4ad256[_0x54a0('0x24')][_0x54a0('0x25')]({'where':{'ChanSpyId':_0x19f37a['id']}})[_0x54a0('0x22')](function(){return getChanSpyPromise(_0x4ad256,_0x19f37a);})[_0x54a0('0x22')](function(_0xf2bc87){if(_0xf2bc87&&_0xf2bc87[_0x54a0('0x16')]){return _0x4ad256[_0x54a0('0x24')][_0x54a0('0x23')](_0xf2bc87);}})['then'](function(){_0x4009a1();})['catch'](function(_0x593886){_0x4009a1(_0x593886);});},'afterDestroy':function(_0x2e32f1,_0x35900a,_0x11839d){return _0x4ad256[_0x54a0('0x24')][_0x54a0('0x25')]({'where':{'ChanSpyId':_0x2e32f1['id']}})[_0x54a0('0x22')](function(){_0x11839d();})[_0x54a0('0x1c')](function(_0x2b9807){_0x11839d(_0x2b9807);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 7d7c6cb..dd2f99a 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 _0x6b24=['client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x6b24,0x1ce));var _0x46b2=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0x6b24[_0x1d3577];return _0x277d9a;};'use strict';var _=require('lodash');var util=require(_0x46b2('0x0'));var moment=require(_0x46b2('0x1'));var BPromise=require(_0x46b2('0x2'));var rs=require(_0x46b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46b2('0x4'))('rpc');var config=require(_0x46b2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x46b2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x512905,_0x326eb7,_0x233ccf){return new BPromise(function(_0x1f81b8,_0x1531c){return client[_0x46b2('0x7')](_0x512905,_0x233ccf)[_0x46b2('0x8')](function(_0x3144df){logger[_0x46b2('0x9')](_0x46b2('0xa'),_0x326eb7,'request\x20sent');logger['debug'](_0x46b2('0xb'),_0x326eb7,_0x46b2('0xc'),JSON[_0x46b2('0xd')](_0x3144df));if(_0x3144df['error']){if(_0x3144df[_0x46b2('0xe')][_0x46b2('0xf')]===0x1f4){logger[_0x46b2('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x326eb7,_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);return _0x1531c(_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);}logger[_0x46b2('0xe')](_0x46b2('0xa'),_0x326eb7,_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);return _0x1f81b8(_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);}else{logger['info'](_0x46b2('0xa'),_0x326eb7,_0x46b2('0xc'));_0x1f81b8(_0x3144df['result'][_0x46b2('0x10')]);}})[_0x46b2('0x11')](function(_0xe3d3d9){logger[_0x46b2('0xe')](_0x46b2('0xa'),_0x326eb7,_0xe3d3d9);_0x1531c(_0xe3d3d9);});});} \ No newline at end of file +var _0x2f68=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x31669f,_0x3f306f){var _0xe67913=function(_0x5cb931){while(--_0x5cb931){_0x31669f['push'](_0x31669f['shift']());}};_0xe67913(++_0x3f306f);}(_0x2f68,0x9a));var _0x82f6=function(_0x31db55,_0x387aaa){_0x31db55=_0x31db55-0x0;var _0x2a8b0b=_0x2f68[_0x31db55];return _0x2a8b0b;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 85b53b1..8466d81 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 _0xac28=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','post','create','put','/:id','delete','exports','connect-timeout','express'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0xac28,0x193));var _0x8ac2=function(_0x4b0cfe,_0x129539){_0x4b0cfe=_0x4b0cfe-0x0;var _0x1d37c8=_0xac28[_0x4b0cfe];return _0x1d37c8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8ac2('0x0'));var express=require(_0x8ac2('0x1'));var router=express[_0x8ac2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8ac2('0x3'));var interaction=require(_0x8ac2('0x4'));var config=require(_0x8ac2('0x5'));var controller=require(_0x8ac2('0x6'));router[_0x8ac2('0x7')]('/',auth[_0x8ac2('0x8')](),controller['index']);router['get']('/:id',auth[_0x8ac2('0x8')](),controller['show']);router[_0x8ac2('0x9')]('/',auth[_0x8ac2('0x8')](),controller[_0x8ac2('0xa')]);router[_0x8ac2('0xb')](_0x8ac2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8ac2('0xd')]('/:id',auth[_0x8ac2('0x8')](),controller['destroy']);module[_0x8ac2('0xe')]=router; \ No newline at end of file +var _0x27bb=['Router','fs-extra','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','path','express'];(function(_0x2a75f4,_0x53baa3){var _0x135fd5=function(_0x4d18fa){while(--_0x4d18fa){_0x2a75f4['push'](_0x2a75f4['shift']());}};_0x135fd5(++_0x53baa3);}(_0x27bb,0xf8));var _0xb27b=function(_0x39e21a,_0x165673){_0x39e21a=_0x39e21a-0x0;var _0x2a020e=_0x27bb[_0x39e21a];return _0x2a020e;};'use strict';var multer=require(_0xb27b('0x0'));var util=require(_0xb27b('0x1'));var path=require(_0xb27b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb27b('0x3'));var router=express[_0xb27b('0x4')]();var fs_extra=require(_0xb27b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb27b('0x6'));var config=require('../../config/environment');var controller=require(_0xb27b('0x7'));router[_0xb27b('0x8')]('/',auth[_0xb27b('0x9')](),controller[_0xb27b('0xa')]);router[_0xb27b('0x8')](_0xb27b('0xb'),auth[_0xb27b('0x9')](),controller[_0xb27b('0xc')]);router[_0xb27b('0xd')]('/',auth[_0xb27b('0x9')](),controller['create']);router[_0xb27b('0xe')](_0xb27b('0xb'),auth[_0xb27b('0x9')](),controller[_0xb27b('0xf')]);router['delete']('/:id',auth[_0xb27b('0x9')](),controller[_0xb27b('0x10')]);module[_0xb27b('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 52958c8..24aea63 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 _0x70e7=['BOOLEAN','exports','STRING'];(function(_0x491789,_0x433ba7){var _0x46bba2=function(_0x494da7){while(--_0x494da7){_0x491789['push'](_0x491789['shift']());}};_0x46bba2(++_0x433ba7);}(_0x70e7,0xdc));var _0x770e=function(_0x53ebbc,_0x4845e2){_0x53ebbc=_0x53ebbc-0x0;var _0x47e7a5=_0x70e7[_0x53ebbc];return _0x47e7a5;};'use strict';var Sequelize=require('sequelize');module[_0x770e('0x0')]={'name':{'type':Sequelize[_0x770e('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x770e('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x770e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2952=['exports','STRING','name','BOOLEAN'];(function(_0x19f8d7,_0x4efa7a){var _0x383314=function(_0x57f49e){while(--_0x57f49e){_0x19f8d7['push'](_0x19f8d7['shift']());}};_0x383314(++_0x4efa7a);}(_0x2952,0xc4));var _0x2295=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2952[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0x2295('0x0')]={'name':{'type':Sequelize[_0x2295('0x1')],'unique':_0x2295('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x2295('0x3')],'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 3685b58..d9781d4 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 _0xb21f=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','then','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','readFileSync','join','root','utf8','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','/etc/asterisk/extensions_xcally_contexts.conf','server/files/templates/context.ejs','render','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','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','jayson/promise','client','http'];(function(_0x37c5ac,_0x578dcd){var _0x5895ae=function(_0x38ab6b){while(--_0x38ab6b){_0x37c5ac['push'](_0x37c5ac['shift']());}};_0x5895ae(++_0x578dcd);}(_0xb21f,0x182));var _0xfb21=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xb21f[_0x4d35f3];return _0x382fea;};'use strict';var emlformat=require(_0xfb21('0x0'));var rimraf=require(_0xfb21('0x1'));var zipdir=require(_0xfb21('0x2'));var jsonpatch=require(_0xfb21('0x3'));var rp=require('request-promise');var moment=require(_0xfb21('0x4'));var BPromise=require(_0xfb21('0x5'));var Mustache=require('mustache');var util=require(_0xfb21('0x6'));var path=require(_0xfb21('0x7'));var sox=require(_0xfb21('0x8'));var csv=require(_0xfb21('0x9'));var ejs=require(_0xfb21('0xa'));var fs=require('fs');var fs_extra=require(_0xfb21('0xb'));var _=require('lodash');var squel=require(_0xfb21('0xc'));var crypto=require(_0xfb21('0xd'));var jsforce=require(_0xfb21('0xe'));var deskjs=require(_0xfb21('0xf'));var toCsv=require(_0xfb21('0x9'));var querystring=require('querystring');var Papa=require(_0xfb21('0x10'));var Redis=require(_0xfb21('0x11'));var authService=require(_0xfb21('0x12'));var qs=require(_0xfb21('0x13'));var as=require(_0xfb21('0x14'));var hardwareService=require(_0xfb21('0x15'));var logger=require(_0xfb21('0x16'))(_0xfb21('0x17'));var utils=require(_0xfb21('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfb21('0x19'));var db=require(_0xfb21('0x1a'))['db'];var jayson=require(_0xfb21('0x1b'));var client=jayson[_0xfb21('0x1c')][_0xfb21('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x20ae9f,_0x44e0e8,_0x240976,_0x375639){return new BPromise(function(_0x57c7f0,_0xa8ab81){var _0x437251=_0x375639||client;return _0x437251['request'](_0x20ae9f,_0x240976)['then'](function(_0x43a02b){logger[_0xfb21('0x1e')](_0xfb21('0x1f'),_0x44e0e8,_0xfb21('0x20'));logger[_0xfb21('0x21')](_0xfb21('0x22'),_0x44e0e8,'request\x20sent',JSON[_0xfb21('0x23')](_0x43a02b));if(_0x43a02b[_0xfb21('0x24')]){if(_0x43a02b[_0xfb21('0x24')][_0xfb21('0x25')]===0x1f4){logger[_0xfb21('0x24')](_0xfb21('0x1f'),_0x44e0e8,_0x43a02b['error'][_0xfb21('0x26')]);return _0xa8ab81(_0x43a02b['error'][_0xfb21('0x26')]);}logger[_0xfb21('0x24')](_0xfb21('0x1f'),_0x44e0e8,_0x43a02b[_0xfb21('0x24')][_0xfb21('0x26')]);return _0x57c7f0(_0x43a02b[_0xfb21('0x24')][_0xfb21('0x26')]);}else{logger[_0xfb21('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x44e0e8,_0xfb21('0x20'));_0x57c7f0(_0x43a02b[_0xfb21('0x27')]['message']);}})[_0xfb21('0x28')](function(_0x500c67){logger[_0xfb21('0x24')](_0xfb21('0x1f'),_0x44e0e8,_0x500c67);_0xa8ab81(_0x500c67);});});}function respondWithStatusCode(_0x46f5c3,_0xf1524e){_0xf1524e=_0xf1524e||0xcc;return function(_0x45d83f){if(_0x45d83f){return _0x46f5c3[_0xfb21('0x29')](_0xf1524e);}return _0x46f5c3[_0xfb21('0x2a')](_0xf1524e)[_0xfb21('0x2b')]();};}function respondWithResult(_0x3489da,_0x65f73a){_0x65f73a=_0x65f73a||0xc8;return function(_0x4c3c12){if(_0x4c3c12){return _0x3489da[_0xfb21('0x2a')](_0x65f73a)['json'](_0x4c3c12);}};}function respondWithFilteredResult(_0x1c2666,_0x18ea7a){return function(_0x4880c2){if(_0x4880c2){var _0x5b8dfc=typeof _0x18ea7a[_0xfb21('0x2c')]===_0xfb21('0x2d')&&typeof _0x18ea7a[_0xfb21('0x2e')]===_0xfb21('0x2d');var _0x5d6cf6=_0x4880c2[_0xfb21('0x2f')];var _0x18d541=_0x5b8dfc?0x0:_0x18ea7a[_0xfb21('0x2c')];var _0x3acdac=_0x5b8dfc?_0x4880c2['count']:_0x18ea7a[_0xfb21('0x2c')]+_0x18ea7a[_0xfb21('0x2e')];var _0x4168be;if(_0x3acdac>=_0x5d6cf6){_0x3acdac=_0x5d6cf6;_0x4168be=0xc8;}else{_0x4168be=0xce;}_0x1c2666[_0xfb21('0x2a')](_0x4168be);return _0x1c2666['set'](_0xfb21('0x30'),_0x18d541+'-'+_0x3acdac+'/'+_0x5d6cf6)[_0xfb21('0x31')](_0x4880c2);}return null;};}function patchUpdates(_0x53b1cb){return function(_0x55b140){try{jsonpatch['apply'](_0x55b140,_0x53b1cb,!![]);}catch(_0x3d2355){return BPromise[_0xfb21('0x32')](_0x3d2355);}return _0x55b140['save']();};}function saveUpdates(_0x58b781,_0x4c606b){return function(_0xc655dd){if(_0xc655dd){return _0xc655dd[_0xfb21('0x33')](_0x58b781)[_0xfb21('0x34')](function(_0x34f515){return _0x34f515;});}return null;};}function removeEntity(_0x3899c3,_0x584039){return function(_0x4d2d70){if(_0x4d2d70){return _0x4d2d70['destroy']()[_0xfb21('0x34')](function(){var _0x237f38=_0x4d2d70[_0xfb21('0x35')]({'plain':!![]});var _0x5bf83c=_0xfb21('0x36');return db[_0xfb21('0x37')][_0xfb21('0x38')]({'where':{'type':_0x5bf83c,'resourceId':_0x237f38['id']}})[_0xfb21('0x34')](function(){return _0x4d2d70;});})[_0xfb21('0x34')](function(){_0x3899c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c89b4,_0x479426){return function(_0x58ce70){if(!_0x58ce70){_0x8c89b4[_0xfb21('0x29')](0x194);}return _0x58ce70;};}function handleError(_0x1011c4,_0x3688ce){_0x3688ce=_0x3688ce||0x1f4;return function(_0x35f1ba){logger[_0xfb21('0x24')](_0x35f1ba[_0xfb21('0x39')]);if(_0x35f1ba[_0xfb21('0x3a')]){delete _0x35f1ba[_0xfb21('0x3a')];}_0x1011c4['status'](_0x3688ce)[_0xfb21('0x3b')](_0x35f1ba);};}exports[_0xfb21('0x3c')]=function(_0x45a522,_0xb12f56){var _0x110292={},_0x544b3f={},_0x11d5f4={'count':0x0,'rows':[]};var _0x3d8f6c=_[_0xfb21('0x3d')](db[_0xfb21('0x3e')]['rawAttributes'],function(_0x497bce){return{'name':_0x497bce[_0xfb21('0x3f')],'type':_0x497bce[_0xfb21('0x40')]['key']};});_0x544b3f['model']=_['map'](_0x3d8f6c,'name');_0x544b3f[_0xfb21('0x41')]=_[_0xfb21('0x42')](_0x45a522[_0xfb21('0x41')]);_0x544b3f[_0xfb21('0x43')]=_[_0xfb21('0x44')](_0x544b3f[_0xfb21('0x45')],_0x544b3f[_0xfb21('0x41')]);_0x110292[_0xfb21('0x46')]=_[_0xfb21('0x44')](_0x544b3f['model'],qs['fields'](_0x45a522[_0xfb21('0x41')][_0xfb21('0x47')]));_0x110292[_0xfb21('0x46')]=_0x110292[_0xfb21('0x46')][_0xfb21('0x48')]?_0x110292[_0xfb21('0x46')]:_0x544b3f['model'];if(!_0x45a522[_0xfb21('0x41')]['hasOwnProperty']('nolimit')){_0x110292[_0xfb21('0x2e')]=qs[_0xfb21('0x2e')](_0x45a522['query'][_0xfb21('0x2e')]);_0x110292[_0xfb21('0x2c')]=qs[_0xfb21('0x2c')](_0x45a522['query'][_0xfb21('0x2c')]);}_0x110292[_0xfb21('0x49')]=qs[_0xfb21('0x4a')](_0x45a522['query'][_0xfb21('0x4a')]);_0x110292['where']=qs['filters'](_[_0xfb21('0x4b')](_0x45a522[_0xfb21('0x41')],_0x544b3f[_0xfb21('0x43')]),_0x3d8f6c);if(_0x45a522[_0xfb21('0x41')][_0xfb21('0x4c')]){_0x110292['where']=_[_0xfb21('0x4d')](_0x110292[_0xfb21('0x4e')],{'$or':_[_0xfb21('0x3d')](_0x3d8f6c,function(_0x438d66){if(_0x438d66[_0xfb21('0x40')]!==_0xfb21('0x4f')){var _0x38d10d={};_0x38d10d[_0x438d66['name']]={'$like':'%'+_0x45a522[_0xfb21('0x41')][_0xfb21('0x4c')]+'%'};return _0x38d10d;}})});}_0x110292=_['merge']({},_0x110292,_0x45a522[_0xfb21('0x50')]);var _0x227ffa={'where':_0x110292[_0xfb21('0x4e')]};return db[_0xfb21('0x3e')][_0xfb21('0x2f')](_0x227ffa)['then'](function(_0x16377b){_0x11d5f4[_0xfb21('0x2f')]=_0x16377b;if(_0x45a522[_0xfb21('0x41')][_0xfb21('0x51')]){_0x110292[_0xfb21('0x52')]=[{'all':!![]}];}return db['VoiceContext'][_0xfb21('0x53')](_0x110292);})[_0xfb21('0x34')](function(_0x38fed7){_0x11d5f4[_0xfb21('0x54')]=_0x38fed7;return _0x11d5f4;})[_0xfb21('0x34')](respondWithFilteredResult(_0xb12f56,_0x110292))[_0xfb21('0x28')](handleError(_0xb12f56,null));};exports[_0xfb21('0x55')]=function(_0x18b1ce,_0x17680f){var _0xbc86dd={'raw':![],'where':{'id':_0x18b1ce[_0xfb21('0x56')]['id']}},_0x1ff5f4={};_0x1ff5f4['model']=_[_0xfb21('0x42')](db[_0xfb21('0x3e')][_0xfb21('0x57')]);_0x1ff5f4[_0xfb21('0x41')]=_[_0xfb21('0x42')](_0x18b1ce['query']);_0x1ff5f4[_0xfb21('0x43')]=_[_0xfb21('0x44')](_0x1ff5f4[_0xfb21('0x45')],_0x1ff5f4[_0xfb21('0x41')]);_0xbc86dd[_0xfb21('0x46')]=_[_0xfb21('0x44')](_0x1ff5f4[_0xfb21('0x45')],qs['fields'](_0x18b1ce[_0xfb21('0x41')]['fields']));_0xbc86dd[_0xfb21('0x46')]=_0xbc86dd[_0xfb21('0x46')][_0xfb21('0x48')]?_0xbc86dd[_0xfb21('0x46')]:_0x1ff5f4[_0xfb21('0x45')];if(_0x18b1ce[_0xfb21('0x41')]['includeAll']){_0xbc86dd['include']=[{'all':!![]}];}_0xbc86dd=_[_0xfb21('0x4d')]({},_0xbc86dd,_0x18b1ce[_0xfb21('0x50')]);return db[_0xfb21('0x3e')][_0xfb21('0x58')](_0xbc86dd)[_0xfb21('0x34')](handleEntityNotFound(_0x17680f,null))['then'](respondWithResult(_0x17680f,null))['catch'](handleError(_0x17680f,null));};exports[_0xfb21('0x59')]=function(_0xf73ae3,_0x4913b6,_0x10d6b3){var _0x106c33;return db[_0xfb21('0x3e')][_0xfb21('0x59')](_0xf73ae3[_0xfb21('0x5a')],{'raw':!![]})['then'](function(_0x81ac7){_0x106c33=_0x81ac7;return db[_0xfb21('0x3e')][_0xfb21('0x53')]({'raw':!![]});})[_0xfb21('0x34')](function(_0x4664cb){var _0x5ec2c8=fs[_0xfb21('0x5b')](path[_0xfb21('0x5c')](config[_0xfb21('0x5d')],'server/files/templates/context.ejs'),_0xfb21('0x5e'));var _0x383312=ejs['render'](_0x5ec2c8,{'contexts':_0x4664cb||[]});fs[_0xfb21('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x383312);})[_0xfb21('0x34')](function(){return respondWithRpcPromise(_0xfb21('0x60'),_0xfb21('0x59'),{'module':_0xfb21('0x61')});})[_0xfb21('0x34')](function(){var _0x58fa06=_0xf73ae3[_0xfb21('0x62')][_0xfb21('0x35')]({'plain':!![]});if(!_0x58fa06)throw new Error(_0xfb21('0x63'));if(_0x58fa06['role']==='user'){var _0x517252=_0x106c33['get']({'plain':!![]});return db[_0xfb21('0x64')]['find']({'where':{'name':_0xfb21('0x36'),'userProfileId':_0x58fa06['userProfileId']},'raw':!![]})['then'](function(_0x557cbc){if(_0x557cbc&&_0x557cbc['autoAssociation']===0x0){return db[_0xfb21('0x37')][_0xfb21('0x59')]({'name':_0x517252[_0xfb21('0x3a')],'resourceId':_0x517252['id'],'type':_0x557cbc[_0xfb21('0x3a')],'sectionId':_0x557cbc['id']},{})[_0xfb21('0x34')](function(){return _0x106c33;});}else{return _0x106c33;}})[_0xfb21('0x28')](function(_0x3d7d36){logger[_0xfb21('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d7d36);throw _0x3d7d36;});}return _0x106c33;})['then'](respondWithResult(_0x4913b6,0xc9))[_0xfb21('0x28')](handleError(_0x4913b6,null));};exports['update']=function(_0x500103,_0x43fb57,_0x162084){var _0x410f4a;return db[_0xfb21('0x3e')][_0xfb21('0x58')]({'where':{'id':_0x500103['params']['id']}})[_0xfb21('0x34')](handleEntityNotFound(_0x43fb57,null))[_0xfb21('0x34')](saveUpdates(_0x500103['body'],null))[_0xfb21('0x34')](function(_0x42bc7f){if(_0x42bc7f){_0x410f4a=_0x42bc7f;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x3858be){var _0x24f29c=fs[_0xfb21('0x5b')](path['join'](config[_0xfb21('0x5d')],'server/files/templates/context.ejs'),_0xfb21('0x5e'));var _0xd15036=ejs['render'](_0x24f29c,{'contexts':_0x3858be||[]});fs[_0xfb21('0x5f')](_0xfb21('0x65'),_0xd15036);})[_0xfb21('0x34')](function(){return respondWithRpcPromise(_0xfb21('0x60'),_0xfb21('0x33'),{'module':_0xfb21('0x61')});})['then'](function(){return _0x410f4a;})[_0xfb21('0x34')](respondWithResult(_0x43fb57,null))['catch'](handleError(_0x43fb57,null));};exports[_0xfb21('0x38')]=function(_0x3f501b,_0xab394a,_0xc4fb7e){var _0x3939a9;return db[_0xfb21('0x3e')][_0xfb21('0x58')]({'where':{'id':_0x3f501b[_0xfb21('0x56')]['id']}})[_0xfb21('0x34')](handleEntityNotFound(_0xab394a,null))['then'](removeEntity(_0xab394a,null))[_0xfb21('0x34')](function(){return db['VoiceContext'][_0xfb21('0x53')]({'raw':!![]});})['then'](function(_0x40065a){var _0x16708f=fs[_0xfb21('0x5b')](path[_0xfb21('0x5c')](config[_0xfb21('0x5d')],_0xfb21('0x66')),_0xfb21('0x5e'));var _0x5b1902=ejs[_0xfb21('0x67')](_0x16708f,{'contexts':_0x40065a});fs['writeFileSync'](_0xfb21('0x65'),_0x5b1902);return respondWithRpcPromise(_0xfb21('0x60'),'destroy',{'module':_0xfb21('0x61')});})['catch'](handleError(_0xab394a,null));}; \ No newline at end of file +var _0x8170=['root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','server/files/templates/context.ejs','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','index','VoiceContext','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','fields','find','create','body','readFileSync','join'];(function(_0x316fe7,_0x480db9){var _0x576e3e=function(_0x26a6bf){while(--_0x26a6bf){_0x316fe7['push'](_0x316fe7['shift']());}};_0x576e3e(++_0x480db9);}(_0x8170,0x1b1));var _0x0817=function(_0x344c14,_0x5eab3e){_0x344c14=_0x344c14-0x0;var _0x5e70b8=_0x8170[_0x344c14];return _0x5e70b8;};'use strict';var emlformat=require(_0x0817('0x0'));var rimraf=require(_0x0817('0x1'));var zipdir=require(_0x0817('0x2'));var jsonpatch=require(_0x0817('0x3'));var rp=require('request-promise');var moment=require(_0x0817('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0817('0x5'));var util=require(_0x0817('0x6'));var path=require(_0x0817('0x7'));var sox=require(_0x0817('0x8'));var csv=require('to-csv');var ejs=require(_0x0817('0x9'));var fs=require('fs');var fs_extra=require(_0x0817('0xa'));var _=require(_0x0817('0xb'));var squel=require('squel');var crypto=require(_0x0817('0xc'));var jsforce=require(_0x0817('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0817('0xe'));var querystring=require(_0x0817('0xf'));var Papa=require(_0x0817('0x10'));var Redis=require('ioredis');var authService=require(_0x0817('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0817('0x12'));var hardwareService=require(_0x0817('0x13'));var logger=require('../../config/logger')(_0x0817('0x14'));var utils=require(_0x0817('0x15'));var config=require(_0x0817('0x16'));var licenseUtil=require(_0x0817('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0817('0x18'));var client=jayson[_0x0817('0x19')][_0x0817('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x493105,_0x2adc9d,_0x4a8885,_0x2cb589){return new BPromise(function(_0x2b48e0,_0x58cf17){var _0x5cae9e=_0x2cb589||client;return _0x5cae9e[_0x0817('0x1b')](_0x493105,_0x4a8885)[_0x0817('0x1c')](function(_0x12b146){logger[_0x0817('0x1d')](_0x0817('0x1e'),_0x2adc9d,_0x0817('0x1f'));logger[_0x0817('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2adc9d,_0x0817('0x1f'),JSON[_0x0817('0x21')](_0x12b146));if(_0x12b146[_0x0817('0x22')]){if(_0x12b146['error'][_0x0817('0x23')]===0x1f4){logger[_0x0817('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2adc9d,_0x12b146['error'][_0x0817('0x24')]);return _0x58cf17(_0x12b146[_0x0817('0x22')][_0x0817('0x24')]);}logger['error'](_0x0817('0x1e'),_0x2adc9d,_0x12b146[_0x0817('0x22')][_0x0817('0x24')]);return _0x2b48e0(_0x12b146[_0x0817('0x22')][_0x0817('0x24')]);}else{logger['info'](_0x0817('0x1e'),_0x2adc9d,_0x0817('0x1f'));_0x2b48e0(_0x12b146['result']['message']);}})[_0x0817('0x25')](function(_0x3210f6){logger[_0x0817('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2adc9d,_0x3210f6);_0x58cf17(_0x3210f6);});});}function respondWithStatusCode(_0xd23fff,_0x8a4c5b){_0x8a4c5b=_0x8a4c5b||0xcc;return function(_0x184d82){if(_0x184d82){return _0xd23fff['sendStatus'](_0x8a4c5b);}return _0xd23fff[_0x0817('0x26')](_0x8a4c5b)[_0x0817('0x27')]();};}function respondWithResult(_0x4b85f5,_0x4a58ea){_0x4a58ea=_0x4a58ea||0xc8;return function(_0x356651){if(_0x356651){return _0x4b85f5['status'](_0x4a58ea)[_0x0817('0x28')](_0x356651);}};}function respondWithFilteredResult(_0x5317fb,_0x57d62b){return function(_0x4cb487){if(_0x4cb487){var _0x32d48b=typeof _0x57d62b[_0x0817('0x29')]==='undefined'&&typeof _0x57d62b[_0x0817('0x2a')]===_0x0817('0x2b');var _0x231afb=_0x4cb487['count'];var _0x5719cf=_0x32d48b?0x0:_0x57d62b[_0x0817('0x29')];var _0x4097df=_0x32d48b?_0x4cb487[_0x0817('0x2c')]:_0x57d62b['offset']+_0x57d62b['limit'];var _0x1f0724;if(_0x4097df>=_0x231afb){_0x4097df=_0x231afb;_0x1f0724=0xc8;}else{_0x1f0724=0xce;}_0x5317fb['status'](_0x1f0724);return _0x5317fb[_0x0817('0x2d')](_0x0817('0x2e'),_0x5719cf+'-'+_0x4097df+'/'+_0x231afb)[_0x0817('0x28')](_0x4cb487);}return null;};}function patchUpdates(_0x4c3dfc){return function(_0x5452f0){try{jsonpatch[_0x0817('0x2f')](_0x5452f0,_0x4c3dfc,!![]);}catch(_0x30dd50){return BPromise[_0x0817('0x30')](_0x30dd50);}return _0x5452f0[_0x0817('0x31')]();};}function saveUpdates(_0x15ec4d,_0x122b60){return function(_0x78fca4){if(_0x78fca4){return _0x78fca4[_0x0817('0x32')](_0x15ec4d)[_0x0817('0x1c')](function(_0x1e8296){return _0x1e8296;});}return null;};}function removeEntity(_0x207cc1,_0x3b77cf){return function(_0xbcf67a){if(_0xbcf67a){return _0xbcf67a[_0x0817('0x33')]()[_0x0817('0x1c')](function(){var _0x3fc978=_0xbcf67a[_0x0817('0x34')]({'plain':!![]});var _0x46ee97=_0x0817('0x35');return db[_0x0817('0x36')][_0x0817('0x33')]({'where':{'type':_0x46ee97,'resourceId':_0x3fc978['id']}})[_0x0817('0x1c')](function(){return _0xbcf67a;});})[_0x0817('0x1c')](function(){_0x207cc1[_0x0817('0x26')](0xcc)[_0x0817('0x27')]();});}};}function handleEntityNotFound(_0xc8826,_0x46f297){return function(_0x30f9e2){if(!_0x30f9e2){_0xc8826[_0x0817('0x37')](0x194);}return _0x30f9e2;};}function handleError(_0xfef428,_0x316402){_0x316402=_0x316402||0x1f4;return function(_0x33e8c5){logger[_0x0817('0x22')](_0x33e8c5[_0x0817('0x38')]);if(_0x33e8c5[_0x0817('0x39')]){delete _0x33e8c5[_0x0817('0x39')];}_0xfef428[_0x0817('0x26')](_0x316402)['send'](_0x33e8c5);};}exports[_0x0817('0x3a')]=function(_0x1d1f96,_0x192870){var _0x4ac142={},_0x37097b={},_0x57fcde={'count':0x0,'rows':[]};var _0x2f1a38=_['map'](db[_0x0817('0x3b')][_0x0817('0x3c')],function(_0x51c395){return{'name':_0x51c395[_0x0817('0x3d')],'type':_0x51c395[_0x0817('0x3e')]['key']};});_0x37097b[_0x0817('0x3f')]=_[_0x0817('0x40')](_0x2f1a38,_0x0817('0x39'));_0x37097b['query']=_[_0x0817('0x41')](_0x1d1f96[_0x0817('0x42')]);_0x37097b[_0x0817('0x43')]=_['intersection'](_0x37097b['model'],_0x37097b['query']);_0x4ac142['attributes']=_[_0x0817('0x44')](_0x37097b['model'],qs['fields'](_0x1d1f96[_0x0817('0x42')]['fields']));_0x4ac142[_0x0817('0x45')]=_0x4ac142[_0x0817('0x45')][_0x0817('0x46')]?_0x4ac142['attributes']:_0x37097b[_0x0817('0x3f')];if(!_0x1d1f96['query'][_0x0817('0x47')](_0x0817('0x48'))){_0x4ac142[_0x0817('0x2a')]=qs[_0x0817('0x2a')](_0x1d1f96[_0x0817('0x42')][_0x0817('0x2a')]);_0x4ac142[_0x0817('0x29')]=qs[_0x0817('0x29')](_0x1d1f96['query'][_0x0817('0x29')]);}_0x4ac142[_0x0817('0x49')]=qs[_0x0817('0x4a')](_0x1d1f96[_0x0817('0x42')]['sort']);_0x4ac142[_0x0817('0x4b')]=qs[_0x0817('0x43')](_[_0x0817('0x4c')](_0x1d1f96[_0x0817('0x42')],_0x37097b['filters']),_0x2f1a38);if(_0x1d1f96['query']['filter']){_0x4ac142['where']=_[_0x0817('0x4d')](_0x4ac142[_0x0817('0x4b')],{'$or':_['map'](_0x2f1a38,function(_0x469095){if(_0x469095[_0x0817('0x3e')]!==_0x0817('0x4e')){var _0x23cdf3={};_0x23cdf3[_0x469095[_0x0817('0x39')]]={'$like':'%'+_0x1d1f96[_0x0817('0x42')][_0x0817('0x4f')]+'%'};return _0x23cdf3;}})});}_0x4ac142=_['merge']({},_0x4ac142,_0x1d1f96[_0x0817('0x50')]);var _0x1e8721={'where':_0x4ac142[_0x0817('0x4b')]};return db['VoiceContext'][_0x0817('0x2c')](_0x1e8721)['then'](function(_0x465d58){_0x57fcde[_0x0817('0x2c')]=_0x465d58;if(_0x1d1f96[_0x0817('0x42')][_0x0817('0x51')]){_0x4ac142['include']=[{'all':!![]}];}return db['VoiceContext'][_0x0817('0x52')](_0x4ac142);})['then'](function(_0x579d72){_0x57fcde[_0x0817('0x53')]=_0x579d72;return _0x57fcde;})[_0x0817('0x1c')](respondWithFilteredResult(_0x192870,_0x4ac142))['catch'](handleError(_0x192870,null));};exports[_0x0817('0x54')]=function(_0x42e4f5,_0x56219d){var _0x16261a={'raw':![],'where':{'id':_0x42e4f5[_0x0817('0x55')]['id']}},_0x7ff9af={};_0x7ff9af['model']=_['keys'](db[_0x0817('0x3b')]['rawAttributes']);_0x7ff9af[_0x0817('0x42')]=_[_0x0817('0x41')](_0x42e4f5[_0x0817('0x42')]);_0x7ff9af[_0x0817('0x43')]=_[_0x0817('0x44')](_0x7ff9af[_0x0817('0x3f')],_0x7ff9af[_0x0817('0x42')]);_0x16261a[_0x0817('0x45')]=_[_0x0817('0x44')](_0x7ff9af['model'],qs[_0x0817('0x56')](_0x42e4f5[_0x0817('0x42')][_0x0817('0x56')]));_0x16261a[_0x0817('0x45')]=_0x16261a[_0x0817('0x45')][_0x0817('0x46')]?_0x16261a[_0x0817('0x45')]:_0x7ff9af[_0x0817('0x3f')];if(_0x42e4f5['query'][_0x0817('0x51')]){_0x16261a['include']=[{'all':!![]}];}_0x16261a=_['merge']({},_0x16261a,_0x42e4f5[_0x0817('0x50')]);return db[_0x0817('0x3b')][_0x0817('0x57')](_0x16261a)[_0x0817('0x1c')](handleEntityNotFound(_0x56219d,null))[_0x0817('0x1c')](respondWithResult(_0x56219d,null))[_0x0817('0x25')](handleError(_0x56219d,null));};exports['create']=function(_0x174315,_0x2e7777,_0x289134){var _0x500120;return db[_0x0817('0x3b')][_0x0817('0x58')](_0x174315[_0x0817('0x59')],{'raw':!![]})[_0x0817('0x1c')](function(_0x4dd849){_0x500120=_0x4dd849;return db['VoiceContext'][_0x0817('0x52')]({'raw':!![]});})[_0x0817('0x1c')](function(_0x14b303){var _0x1bf7b8=fs[_0x0817('0x5a')](path[_0x0817('0x5b')](config[_0x0817('0x5c')],'server/files/templates/context.ejs'),_0x0817('0x5d'));var _0x225386=ejs[_0x0817('0x5e')](_0x1bf7b8,{'contexts':_0x14b303||[]});fs[_0x0817('0x5f')](_0x0817('0x60'),_0x225386);})[_0x0817('0x1c')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x0817('0x1c')](function(){var _0x37bb71=_0x174315[_0x0817('0x61')][_0x0817('0x34')]({'plain':!![]});if(!_0x37bb71)throw new Error(_0x0817('0x62'));if(_0x37bb71[_0x0817('0x63')]===_0x0817('0x61')){var _0x18ddde=_0x500120['get']({'plain':!![]});return db['UserProfileSection'][_0x0817('0x57')]({'where':{'name':_0x0817('0x35'),'userProfileId':_0x37bb71[_0x0817('0x64')]},'raw':!![]})[_0x0817('0x1c')](function(_0x375822){if(_0x375822&&_0x375822[_0x0817('0x65')]===0x0){return db[_0x0817('0x36')]['create']({'name':_0x18ddde['name'],'resourceId':_0x18ddde['id'],'type':_0x375822[_0x0817('0x39')],'sectionId':_0x375822['id']},{})[_0x0817('0x1c')](function(){return _0x500120;});}else{return _0x500120;}})[_0x0817('0x25')](function(_0x3439d9){logger[_0x0817('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3439d9);throw _0x3439d9;});}return _0x500120;})[_0x0817('0x1c')](respondWithResult(_0x2e7777,0xc9))['catch'](handleError(_0x2e7777,null));};exports[_0x0817('0x32')]=function(_0x4bf56b,_0x2c228c,_0x59ef63){var _0x4096fe;return db[_0x0817('0x3b')][_0x0817('0x57')]({'where':{'id':_0x4bf56b[_0x0817('0x55')]['id']}})['then'](handleEntityNotFound(_0x2c228c,null))[_0x0817('0x1c')](saveUpdates(_0x4bf56b[_0x0817('0x59')],null))[_0x0817('0x1c')](function(_0x1fa984){if(_0x1fa984){_0x4096fe=_0x1fa984;return db[_0x0817('0x3b')][_0x0817('0x52')]({'raw':!![]});}})['then'](function(_0x233214){var _0x57a661=fs[_0x0817('0x5a')](path[_0x0817('0x5b')](config[_0x0817('0x5c')],_0x0817('0x66')),_0x0817('0x5d'));var _0x1c7c8d=ejs['render'](_0x57a661,{'contexts':_0x233214||[]});fs[_0x0817('0x5f')](_0x0817('0x60'),_0x1c7c8d);})['then'](function(){return respondWithRpcPromise(_0x0817('0x67'),'update',{'module':_0x0817('0x68')});})[_0x0817('0x1c')](function(){return _0x4096fe;})[_0x0817('0x1c')](respondWithResult(_0x2c228c,null))[_0x0817('0x25')](handleError(_0x2c228c,null));};exports[_0x0817('0x33')]=function(_0x4797e1,_0x24fdf2,_0x5bdc8a){var _0x2e3989;return db['VoiceContext']['find']({'where':{'id':_0x4797e1['params']['id']}})[_0x0817('0x1c')](handleEntityNotFound(_0x24fdf2,null))[_0x0817('0x1c')](removeEntity(_0x24fdf2,null))[_0x0817('0x1c')](function(){return db[_0x0817('0x3b')][_0x0817('0x52')]({'raw':!![]});})['then'](function(_0x398718){var _0x1eaf5b=fs[_0x0817('0x5a')](path[_0x0817('0x5b')](config[_0x0817('0x5c')],_0x0817('0x66')),_0x0817('0x5d'));var _0x664bf8=ejs['render'](_0x1eaf5b,{'contexts':_0x398718});fs[_0x0817('0x5f')](_0x0817('0x60'),_0x664bf8);return respondWithRpcPromise(_0x0817('0x67'),_0x0817('0x33'),{'module':_0x0817('0x68')});})[_0x0817('0x25')](handleError(_0x24fdf2,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2e35043..4e300c9 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 _0xb2f3=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xb2f3[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var logger=require(_0x3b2f('0x2'))(_0x3b2f('0x3'));var moment=require(_0x3b2f('0x4'));var BPromise=require(_0x3b2f('0x5'));var rp=require(_0x3b2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2f('0x7'));var config=require(_0x3b2f('0x8'));var attributes=require(_0x3b2f('0x9'));module[_0x3b2f('0xa')]=function(_0x1879cf,_0xa38042){return _0x1879cf[_0x3b2f('0xb')]('VoiceContext',attributes,{'tableName':_0x3b2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03fd=['voice_contexts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x262ee7,_0x52ee92){var _0x1dc842=function(_0x4bf54a){while(--_0x4bf54a){_0x262ee7['push'](_0x262ee7['shift']());}};_0x1dc842(++_0x52ee92);}(_0x03fd,0x83));var _0xd03f=function(_0x5746a3,_0x425484){_0x5746a3=_0x5746a3-0x0;var _0x554133=_0x03fd[_0x5746a3];return _0x554133;};'use strict';var _=require(_0xd03f('0x0'));var util=require(_0xd03f('0x1'));var logger=require(_0xd03f('0x2'))('api');var moment=require(_0xd03f('0x3'));var BPromise=require(_0xd03f('0x4'));var rp=require(_0xd03f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd03f('0x6'));var config=require(_0xd03f('0x7'));var attributes=require(_0xd03f('0x8'));module[_0xd03f('0x9')]=function(_0x541263,_0xa7ac9f){return _0x541263[_0xd03f('0xa')](_0xd03f('0xb'),attributes,{'tableName':_0xd03f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 1bf4907..dccfd79 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 _0x8185=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch'];(function(_0x1e8aa5,_0x2e2902){var _0x5f0af9=function(_0x4b3b43){while(--_0x4b3b43){_0x1e8aa5['push'](_0x1e8aa5['shift']());}};_0x5f0af9(++_0x2e2902);}(_0x8185,0xb8));var _0x5818=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x8185[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x5818('0x0'));var util=require(_0x5818('0x1'));var moment=require(_0x5818('0x2'));var BPromise=require('bluebird');var rs=require(_0x5818('0x3'));var fs=require('fs');var Redis=require(_0x5818('0x4'));var db=require(_0x5818('0x5'))['db'];var utils=require(_0x5818('0x6'));var logger=require(_0x5818('0x7'))('rpc');var config=require(_0x5818('0x8'));var jayson=require(_0x5818('0x9'));var client=jayson[_0x5818('0xa')][_0x5818('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412c57,_0x3fe728,_0x1e011e){return new BPromise(function(_0x9201ee,_0x115c1a){return client[_0x5818('0xc')](_0x412c57,_0x1e011e)['then'](function(_0xa55dee){logger[_0x5818('0xd')]('VoiceContext,\x20%s,\x20%s',_0x3fe728,_0x5818('0xe'));logger[_0x5818('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3fe728,'request\x20sent',JSON[_0x5818('0x10')](_0xa55dee));if(_0xa55dee[_0x5818('0x11')]){if(_0xa55dee['error'][_0x5818('0x12')]===0x1f4){logger[_0x5818('0x11')](_0x5818('0x13'),_0x3fe728,_0xa55dee['error'][_0x5818('0x14')]);return _0x115c1a(_0xa55dee[_0x5818('0x11')][_0x5818('0x14')]);}logger[_0x5818('0x11')](_0x5818('0x13'),_0x3fe728,_0xa55dee['error'][_0x5818('0x14')]);return _0x9201ee(_0xa55dee[_0x5818('0x11')][_0x5818('0x14')]);}else{logger[_0x5818('0xd')](_0x5818('0x13'),_0x3fe728,_0x5818('0xe'));_0x9201ee(_0xa55dee[_0x5818('0x15')]['message']);}})[_0x5818('0x16')](function(_0x556345){logger['error'](_0x5818('0x13'),_0x3fe728,_0x556345);_0x115c1a(_0x556345);});});} \ No newline at end of file +var _0x99d1=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0x99d1,0x104));var _0x199d=function(_0xb9d1bc,_0x7a8ced){_0xb9d1bc=_0xb9d1bc-0x0;var _0x4bce70=_0x99d1[_0xb9d1bc];return _0x4bce70;};'use strict';var _=require(_0x199d('0x0'));var util=require('util');var moment=require(_0x199d('0x1'));var BPromise=require(_0x199d('0x2'));var rs=require(_0x199d('0x3'));var fs=require('fs');var Redis=require(_0x199d('0x4'));var db=require(_0x199d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x199d('0x6'))(_0x199d('0x7'));var config=require(_0x199d('0x8'));var jayson=require(_0x199d('0x9'));var client=jayson[_0x199d('0xa')][_0x199d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15cca0,_0x1c1fe5,_0x1dd7e4){return new BPromise(function(_0x407e36,_0x277bf9){return client[_0x199d('0xc')](_0x15cca0,_0x1dd7e4)[_0x199d('0xd')](function(_0x2bf231){logger['info'](_0x199d('0xe'),_0x1c1fe5,_0x199d('0xf'));logger['debug'](_0x199d('0x10'),_0x1c1fe5,_0x199d('0xf'),JSON[_0x199d('0x11')](_0x2bf231));if(_0x2bf231['error']){if(_0x2bf231[_0x199d('0x12')][_0x199d('0x13')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x1c1fe5,_0x2bf231[_0x199d('0x12')][_0x199d('0x14')]);return _0x277bf9(_0x2bf231[_0x199d('0x12')][_0x199d('0x14')]);}logger[_0x199d('0x12')](_0x199d('0xe'),_0x1c1fe5,_0x2bf231['error'][_0x199d('0x14')]);return _0x407e36(_0x2bf231[_0x199d('0x12')]['message']);}else{logger[_0x199d('0x15')](_0x199d('0xe'),_0x1c1fe5,_0x199d('0xf'));_0x407e36(_0x2bf231[_0x199d('0x16')][_0x199d('0x14')]);}})[_0x199d('0x17')](function(_0x1fa235){logger[_0x199d('0x12')](_0x199d('0xe'),_0x1c1fe5,_0x1fa235);_0x277bf9(_0x1fa235);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 2c9bd3c..05a85e4 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 _0x16bf=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0x16bf,0x1be));var _0xf16b=function(_0x5ab045,_0x189773){_0x5ab045=_0x5ab045-0x0;var _0x3b67b4=_0x16bf[_0x5ab045];return _0x3b67b4;};'use strict';var multer=require(_0xf16b('0x0'));var util=require(_0xf16b('0x1'));var path=require(_0xf16b('0x2'));var timeout=require(_0xf16b('0x3'));var express=require(_0xf16b('0x4'));var router=express[_0xf16b('0x5')]();var fs_extra=require(_0xf16b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf16b('0x7'));var config=require(_0xf16b('0x8'));var controller=require(_0xf16b('0x9'));router[_0xf16b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf16b('0xb')]);router['get'](_0xf16b('0xc'),auth[_0xf16b('0xd')](),controller[_0xf16b('0xe')]);router[_0xf16b('0xa')](_0xf16b('0xf'),auth[_0xf16b('0xd')](),controller['show']);router[_0xf16b('0x10')]('/',auth[_0xf16b('0xd')](),controller[_0xf16b('0x11')]);router[_0xf16b('0x12')](_0xf16b('0xf'),auth[_0xf16b('0xd')](),controller[_0xf16b('0x13')]);router[_0xf16b('0x14')](_0xf16b('0xf'),auth[_0xf16b('0xd')](),controller[_0xf16b('0x15')]);module[_0xf16b('0x16')]=router; \ No newline at end of file +var _0xb60e=['show','create','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x1e7e12,_0x586d42){var _0x32781c=function(_0x39ee5b){while(--_0x39ee5b){_0x1e7e12['push'](_0x1e7e12['shift']());}};_0x32781c(++_0x586d42);}(_0xb60e,0x10f));var _0xeb60=function(_0x48f038,_0x2bde84){_0x48f038=_0x48f038-0x0;var _0x2edc62=_0xb60e[_0x48f038];return _0x2edc62;};'use strict';var multer=require(_0xeb60('0x0'));var util=require(_0xeb60('0x1'));var path=require(_0xeb60('0x2'));var timeout=require(_0xeb60('0x3'));var express=require(_0xeb60('0x4'));var router=express[_0xeb60('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeb60('0x6'));var interaction=require(_0xeb60('0x7'));var config=require(_0xeb60('0x8'));var controller=require(_0xeb60('0x9'));router[_0xeb60('0xa')]('/',auth[_0xeb60('0xb')](),controller['index']);router[_0xeb60('0xa')](_0xeb60('0xc'),auth['isAuthenticated'](),controller[_0xeb60('0xd')]);router[_0xeb60('0xa')]('/:id',auth[_0xeb60('0xb')](),controller[_0xeb60('0xe')]);router['post']('/',auth[_0xeb60('0xb')](),controller[_0xeb60('0xf')]);router['put'](_0xeb60('0x10'),auth['isAuthenticated'](),controller[_0xeb60('0x11')]);router[_0xeb60('0x12')](_0xeb60('0x10'),auth[_0xeb60('0xb')](),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 cca4ead..62dad3b 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 _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x25e56c,_0x3430d3){var _0x37a949=function(_0x1f691c){while(--_0x1f691c){_0x25e56c['push'](_0x25e56c['shift']());}};_0x37a949(++_0x3430d3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0xf3cd[_0x58cbde];return _0x5799f3;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x37b48a,_0x12e51c){var _0x3e0a7c=function(_0x5d697f){while(--_0x5d697f){_0x37b48a['push'](_0x37b48a['shift']());}};_0x3e0a7c(++_0x12e51c);}(_0xa41a,0x6b));var _0xaa41=function(_0x3affd9,_0x3a0e92){_0x3affd9=_0x3affd9-0x0;var _0x4e0bd1=_0xa41a[_0x3affd9];return _0x4e0bd1;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 2837d69..99042ee 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 _0xae89=['include','findAll','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae89,0x1c7));var _0x9ae8=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xae89[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ae8('0x0'));var zipdir=require(_0x9ae8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ae8('0x2'));var moment=require(_0x9ae8('0x3'));var BPromise=require(_0x9ae8('0x4'));var Mustache=require(_0x9ae8('0x5'));var util=require(_0x9ae8('0x6'));var path=require(_0x9ae8('0x7'));var sox=require(_0x9ae8('0x8'));var csv=require(_0x9ae8('0x9'));var ejs=require(_0x9ae8('0xa'));var fs=require('fs');var fs_extra=require(_0x9ae8('0xb'));var _=require(_0x9ae8('0xc'));var squel=require('squel');var crypto=require(_0x9ae8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9ae8('0xe'));var toCsv=require(_0x9ae8('0x9'));var querystring=require('querystring');var Papa=require(_0x9ae8('0xf'));var Redis=require('ioredis');var authService=require(_0x9ae8('0x10'));var qs=require(_0x9ae8('0x11'));var as=require(_0x9ae8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ae8('0x13'))(_0x9ae8('0x14'));var utils=require(_0x9ae8('0x15'));var config=require(_0x9ae8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ae8('0x17'))['db'];function respondWithStatusCode(_0x4c9f3f,_0x53c9f0){_0x53c9f0=_0x53c9f0||0xcc;return function(_0xfa29df){if(_0xfa29df){return _0x4c9f3f[_0x9ae8('0x18')](_0x53c9f0);}return _0x4c9f3f[_0x9ae8('0x19')](_0x53c9f0)['end']();};}function respondWithResult(_0x19b091,_0x4be8cc){_0x4be8cc=_0x4be8cc||0xc8;return function(_0x172d2e){if(_0x172d2e){return _0x19b091[_0x9ae8('0x19')](_0x4be8cc)[_0x9ae8('0x1a')](_0x172d2e);}};}function respondWithFilteredResult(_0x4a2197,_0x3caab9){return function(_0x429cf2){if(_0x429cf2){var _0x47d385=typeof _0x3caab9[_0x9ae8('0x1b')]===_0x9ae8('0x1c')&&typeof _0x3caab9[_0x9ae8('0x1d')]===_0x9ae8('0x1c');var _0x4415fe=_0x429cf2[_0x9ae8('0x1e')];var _0x38f65e=_0x47d385?0x0:_0x3caab9[_0x9ae8('0x1b')];var _0x4c398b=_0x47d385?_0x429cf2[_0x9ae8('0x1e')]:_0x3caab9[_0x9ae8('0x1b')]+_0x3caab9[_0x9ae8('0x1d')];var _0x5bf058;if(_0x4c398b>=_0x4415fe){_0x4c398b=_0x4415fe;_0x5bf058=0xc8;}else{_0x5bf058=0xce;}_0x4a2197[_0x9ae8('0x19')](_0x5bf058);return _0x4a2197[_0x9ae8('0x1f')](_0x9ae8('0x20'),_0x38f65e+'-'+_0x4c398b+'/'+_0x4415fe)[_0x9ae8('0x1a')](_0x429cf2);}return null;};}function patchUpdates(_0xbfb266){return function(_0x3dbe69){try{jsonpatch['apply'](_0x3dbe69,_0xbfb266,!![]);}catch(_0x59b02b){return BPromise[_0x9ae8('0x21')](_0x59b02b);}return _0x3dbe69[_0x9ae8('0x22')]();};}function saveUpdates(_0xf94a16,_0x4e8b61){return function(_0x19e8cc){if(_0x19e8cc){return _0x19e8cc['update'](_0xf94a16)[_0x9ae8('0x23')](function(_0x3593d8){return _0x3593d8;});}return null;};}function removeEntity(_0x6ffb20,_0x451b53){return function(_0x416640){if(_0x416640){return _0x416640[_0x9ae8('0x24')]()[_0x9ae8('0x23')](function(){_0x6ffb20['status'](0xcc)[_0x9ae8('0x25')]();});}};}function handleEntityNotFound(_0x7d4b7b,_0x140645){return function(_0x4a2068){if(!_0x4a2068){_0x7d4b7b[_0x9ae8('0x18')](0x194);}return _0x4a2068;};}function handleError(_0x3854c1,_0x5186af){_0x5186af=_0x5186af||0x1f4;return function(_0x275ab5){logger['error'](_0x275ab5[_0x9ae8('0x26')]);if(_0x275ab5['name']){delete _0x275ab5['name'];}_0x3854c1[_0x9ae8('0x19')](_0x5186af)[_0x9ae8('0x27')](_0x275ab5);};}exports[_0x9ae8('0x28')]=function(_0x22a74b,_0x3e184e){var _0x3b9d93={},_0x14a3dd={},_0x2cd11e={'count':0x0,'rows':[]};var _0x2e4b17=_['map'](db[_0x9ae8('0x29')][_0x9ae8('0x2a')],function(_0x4db376){return{'name':_0x4db376[_0x9ae8('0x2b')],'type':_0x4db376[_0x9ae8('0x2c')][_0x9ae8('0x2d')]};});_0x14a3dd[_0x9ae8('0x2e')]=_['map'](_0x2e4b17,'name');_0x14a3dd[_0x9ae8('0x2f')]=_['keys'](_0x22a74b[_0x9ae8('0x2f')]);_0x14a3dd[_0x9ae8('0x30')]=_[_0x9ae8('0x31')](_0x14a3dd[_0x9ae8('0x2e')],_0x14a3dd[_0x9ae8('0x2f')]);_0x3b9d93['attributes']=_['intersection'](_0x14a3dd[_0x9ae8('0x2e')],qs['fields'](_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x32')]));_0x3b9d93['attributes']=_0x3b9d93[_0x9ae8('0x33')][_0x9ae8('0x34')]?_0x3b9d93[_0x9ae8('0x33')]:_0x14a3dd[_0x9ae8('0x2e')];if(!_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x35')]('nolimit')){_0x3b9d93[_0x9ae8('0x1d')]=qs[_0x9ae8('0x1d')](_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x1d')]);_0x3b9d93[_0x9ae8('0x1b')]=qs[_0x9ae8('0x1b')](_0x22a74b[_0x9ae8('0x2f')]['offset']);}_0x3b9d93[_0x9ae8('0x36')]=qs[_0x9ae8('0x37')](_0x22a74b['query'][_0x9ae8('0x37')]);_0x3b9d93[_0x9ae8('0x38')]=qs['filters'](_['pick'](_0x22a74b[_0x9ae8('0x2f')],_0x14a3dd[_0x9ae8('0x30')]),_0x2e4b17);if(_0x22a74b['query'][_0x9ae8('0x39')]){_0x3b9d93['where']=_[_0x9ae8('0x3a')](_0x3b9d93[_0x9ae8('0x38')],{'$or':_['map'](_0x2e4b17,function(_0x8180d6){if(_0x8180d6['type']!==_0x9ae8('0x3b')){var _0x5f2522={};_0x5f2522[_0x8180d6[_0x9ae8('0x3c')]]={'$like':'%'+_0x22a74b[_0x9ae8('0x2f')][_0x9ae8('0x39')]+'%'};return _0x5f2522;}})});}_0x3b9d93=_[_0x9ae8('0x3a')]({},_0x3b9d93,_0x22a74b[_0x9ae8('0x3d')]);var _0x15c3ba={'where':_0x3b9d93[_0x9ae8('0x38')]};return db['VoiceDialReport'][_0x9ae8('0x1e')](_0x15c3ba)[_0x9ae8('0x23')](function(_0x4499e6){_0x2cd11e[_0x9ae8('0x1e')]=_0x4499e6;if(_0x22a74b['query'][_0x9ae8('0x3e')]){_0x3b9d93[_0x9ae8('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x9ae8('0x40')](_0x3b9d93);})[_0x9ae8('0x23')](function(_0xd5a1b){_0x2cd11e['rows']=_0xd5a1b;return _0x2cd11e;})[_0x9ae8('0x23')](respondWithFilteredResult(_0x3e184e,_0x3b9d93))[_0x9ae8('0x41')](handleError(_0x3e184e,null));};exports[_0x9ae8('0x42')]=function(_0x51e5f6,_0x42f9c3){var _0x207424={'raw':!![],'where':{'id':_0x51e5f6[_0x9ae8('0x43')]['id']}},_0x7d79ab={};_0x7d79ab[_0x9ae8('0x2e')]=_[_0x9ae8('0x44')](db['VoiceDialReport']['rawAttributes']);_0x7d79ab['query']=_[_0x9ae8('0x44')](_0x51e5f6['query']);_0x7d79ab[_0x9ae8('0x30')]=_['intersection'](_0x7d79ab[_0x9ae8('0x2e')],_0x7d79ab[_0x9ae8('0x2f')]);_0x207424[_0x9ae8('0x33')]=_[_0x9ae8('0x31')](_0x7d79ab[_0x9ae8('0x2e')],qs[_0x9ae8('0x32')](_0x51e5f6[_0x9ae8('0x2f')][_0x9ae8('0x32')]));_0x207424[_0x9ae8('0x33')]=_0x207424[_0x9ae8('0x33')]['length']?_0x207424['attributes']:_0x7d79ab['model'];if(_0x51e5f6[_0x9ae8('0x2f')][_0x9ae8('0x3e')]){_0x207424['include']=[{'all':!![]}];}_0x207424=_[_0x9ae8('0x3a')]({},_0x207424,_0x51e5f6[_0x9ae8('0x3d')]);return db[_0x9ae8('0x29')][_0x9ae8('0x45')](_0x207424)['then'](handleEntityNotFound(_0x42f9c3,null))[_0x9ae8('0x23')](respondWithResult(_0x42f9c3,null))[_0x9ae8('0x41')](handleError(_0x42f9c3,null));};exports[_0x9ae8('0x46')]=function(_0x54ba6d,_0x45de82){return db[_0x9ae8('0x29')][_0x9ae8('0x46')](_0x54ba6d[_0x9ae8('0x47')],{})['then'](respondWithResult(_0x45de82,0xc9))[_0x9ae8('0x41')](handleError(_0x45de82,null));};exports[_0x9ae8('0x48')]=function(_0x4dca6d,_0x3e6657){if(_0x4dca6d['body']['id']){delete _0x4dca6d[_0x9ae8('0x47')]['id'];}return db[_0x9ae8('0x29')][_0x9ae8('0x45')]({'where':{'id':_0x4dca6d[_0x9ae8('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e6657,null))[_0x9ae8('0x23')](saveUpdates(_0x4dca6d['body'],null))[_0x9ae8('0x23')](respondWithResult(_0x3e6657,null))['catch'](handleError(_0x3e6657,null));};exports[_0x9ae8('0x24')]=function(_0x480612,_0x17b735){return db['VoiceDialReport'][_0x9ae8('0x45')]({'where':{'id':_0x480612[_0x9ae8('0x43')]['id']}})[_0x9ae8('0x23')](handleEntityNotFound(_0x17b735,null))[_0x9ae8('0x23')](removeEntity(_0x17b735,null))[_0x9ae8('0x41')](handleError(_0x17b735,null));};exports[_0x9ae8('0x49')]=function(_0x1ca18d,_0x552574){return db[_0x9ae8('0x29')]['describe']()[_0x9ae8('0x23')](respondWithResult(_0x552574,null))[_0x9ae8('0x41')](handleError(_0x552574,null));}; \ No newline at end of file +var _0xa0d4=['where','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','catch','show','filters','length','find','create','body','destroy','params','describe','rimraf','zip-dir','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge'];(function(_0x322f4d,_0x2211c6){var _0x548443=function(_0x5f42a4){while(--_0x5f42a4){_0x322f4d['push'](_0x322f4d['shift']());}};_0x548443(++_0x2211c6);}(_0xa0d4,0xaf));var _0x4a0d=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0xa0d4[_0x5b9d3a];return _0x383375;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a0d('0x0'));var zipdir=require(_0x4a0d('0x1'));var jsonpatch=require(_0x4a0d('0x2'));var rp=require(_0x4a0d('0x3'));var moment=require(_0x4a0d('0x4'));var BPromise=require(_0x4a0d('0x5'));var Mustache=require(_0x4a0d('0x6'));var util=require(_0x4a0d('0x7'));var path=require(_0x4a0d('0x8'));var sox=require(_0x4a0d('0x9'));var csv=require(_0x4a0d('0xa'));var ejs=require(_0x4a0d('0xb'));var fs=require('fs');var fs_extra=require(_0x4a0d('0xc'));var _=require(_0x4a0d('0xd'));var squel=require(_0x4a0d('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a0d('0xa'));var querystring=require(_0x4a0d('0xf'));var Papa=require('papaparse');var Redis=require(_0x4a0d('0x10'));var authService=require(_0x4a0d('0x11'));var qs=require(_0x4a0d('0x12'));var as=require(_0x4a0d('0x13'));var hardwareService=require(_0x4a0d('0x14'));var logger=require('../../config/logger')(_0x4a0d('0x15'));var utils=require(_0x4a0d('0x16'));var config=require(_0x4a0d('0x17'));var licenseUtil=require(_0x4a0d('0x18'));var db=require(_0x4a0d('0x19'))['db'];function respondWithStatusCode(_0x53debb,_0x177aca){_0x177aca=_0x177aca||0xcc;return function(_0x33811a){if(_0x33811a){return _0x53debb['sendStatus'](_0x177aca);}return _0x53debb[_0x4a0d('0x1a')](_0x177aca)[_0x4a0d('0x1b')]();};}function respondWithResult(_0x3d8c2e,_0x4580e1){_0x4580e1=_0x4580e1||0xc8;return function(_0x319488){if(_0x319488){return _0x3d8c2e[_0x4a0d('0x1a')](_0x4580e1)[_0x4a0d('0x1c')](_0x319488);}};}function respondWithFilteredResult(_0x4cb6be,_0x1ed971){return function(_0x55f986){if(_0x55f986){var _0x499f61=typeof _0x1ed971[_0x4a0d('0x1d')]===_0x4a0d('0x1e')&&typeof _0x1ed971[_0x4a0d('0x1f')]===_0x4a0d('0x1e');var _0x1120a6=_0x55f986[_0x4a0d('0x20')];var _0x386e35=_0x499f61?0x0:_0x1ed971[_0x4a0d('0x1d')];var _0x427aca=_0x499f61?_0x55f986[_0x4a0d('0x20')]:_0x1ed971['offset']+_0x1ed971[_0x4a0d('0x1f')];var _0x267704;if(_0x427aca>=_0x1120a6){_0x427aca=_0x1120a6;_0x267704=0xc8;}else{_0x267704=0xce;}_0x4cb6be[_0x4a0d('0x1a')](_0x267704);return _0x4cb6be[_0x4a0d('0x21')](_0x4a0d('0x22'),_0x386e35+'-'+_0x427aca+'/'+_0x1120a6)[_0x4a0d('0x1c')](_0x55f986);}return null;};}function patchUpdates(_0x13a98f){return function(_0xbbe9dd){try{jsonpatch[_0x4a0d('0x23')](_0xbbe9dd,_0x13a98f,!![]);}catch(_0x2ff296){return BPromise[_0x4a0d('0x24')](_0x2ff296);}return _0xbbe9dd[_0x4a0d('0x25')]();};}function saveUpdates(_0x21b238,_0x4cc614){return function(_0x4d5438){if(_0x4d5438){return _0x4d5438[_0x4a0d('0x26')](_0x21b238)[_0x4a0d('0x27')](function(_0x13103b){return _0x13103b;});}return null;};}function removeEntity(_0x2daa72,_0x3707e1){return function(_0x12eaa0){if(_0x12eaa0){return _0x12eaa0['destroy']()[_0x4a0d('0x27')](function(){_0x2daa72[_0x4a0d('0x1a')](0xcc)[_0x4a0d('0x1b')]();});}};}function handleEntityNotFound(_0x49341b,_0x3166dc){return function(_0x33d4de){if(!_0x33d4de){_0x49341b[_0x4a0d('0x28')](0x194);}return _0x33d4de;};}function handleError(_0x1877a9,_0x1cda36){_0x1cda36=_0x1cda36||0x1f4;return function(_0x412036){logger['error'](_0x412036[_0x4a0d('0x29')]);if(_0x412036[_0x4a0d('0x2a')]){delete _0x412036[_0x4a0d('0x2a')];}_0x1877a9['status'](_0x1cda36)[_0x4a0d('0x2b')](_0x412036);};}exports[_0x4a0d('0x2c')]=function(_0x3d08b4,_0x3351a8){var _0x1b3b03={},_0x178ddf={},_0x876b3b={'count':0x0,'rows':[]};var _0x43b47b=_[_0x4a0d('0x2d')](db['VoiceDialReport'][_0x4a0d('0x2e')],function(_0x28ae0f){return{'name':_0x28ae0f[_0x4a0d('0x2f')],'type':_0x28ae0f[_0x4a0d('0x30')]['key']};});_0x178ddf[_0x4a0d('0x31')]=_[_0x4a0d('0x2d')](_0x43b47b,_0x4a0d('0x2a'));_0x178ddf['query']=_[_0x4a0d('0x32')](_0x3d08b4[_0x4a0d('0x33')]);_0x178ddf['filters']=_[_0x4a0d('0x34')](_0x178ddf[_0x4a0d('0x31')],_0x178ddf[_0x4a0d('0x33')]);_0x1b3b03[_0x4a0d('0x35')]=_[_0x4a0d('0x34')](_0x178ddf[_0x4a0d('0x31')],qs[_0x4a0d('0x36')](_0x3d08b4['query'][_0x4a0d('0x36')]));_0x1b3b03[_0x4a0d('0x35')]=_0x1b3b03[_0x4a0d('0x35')]['length']?_0x1b3b03[_0x4a0d('0x35')]:_0x178ddf[_0x4a0d('0x31')];if(!_0x3d08b4[_0x4a0d('0x33')][_0x4a0d('0x37')](_0x4a0d('0x38'))){_0x1b3b03['limit']=qs[_0x4a0d('0x1f')](_0x3d08b4[_0x4a0d('0x33')][_0x4a0d('0x1f')]);_0x1b3b03[_0x4a0d('0x1d')]=qs[_0x4a0d('0x1d')](_0x3d08b4[_0x4a0d('0x33')][_0x4a0d('0x1d')]);}_0x1b3b03[_0x4a0d('0x39')]=qs[_0x4a0d('0x3a')](_0x3d08b4[_0x4a0d('0x33')]['sort']);_0x1b3b03['where']=qs['filters'](_[_0x4a0d('0x3b')](_0x3d08b4['query'],_0x178ddf['filters']),_0x43b47b);if(_0x3d08b4['query'][_0x4a0d('0x3c')]){_0x1b3b03['where']=_[_0x4a0d('0x3d')](_0x1b3b03[_0x4a0d('0x3e')],{'$or':_[_0x4a0d('0x2d')](_0x43b47b,function(_0x11cc4b){if(_0x11cc4b['type']!==_0x4a0d('0x3f')){var _0x294da5={};_0x294da5[_0x11cc4b[_0x4a0d('0x2a')]]={'$like':'%'+_0x3d08b4['query'][_0x4a0d('0x3c')]+'%'};return _0x294da5;}})});}_0x1b3b03=_['merge']({},_0x1b3b03,_0x3d08b4[_0x4a0d('0x40')]);var _0x5564b5={'where':_0x1b3b03[_0x4a0d('0x3e')]};return db[_0x4a0d('0x41')][_0x4a0d('0x20')](_0x5564b5)[_0x4a0d('0x27')](function(_0x4d8c5d){_0x876b3b[_0x4a0d('0x20')]=_0x4d8c5d;if(_0x3d08b4[_0x4a0d('0x33')][_0x4a0d('0x42')]){_0x1b3b03[_0x4a0d('0x43')]=[{'all':!![]}];}return db[_0x4a0d('0x41')][_0x4a0d('0x44')](_0x1b3b03);})[_0x4a0d('0x27')](function(_0x386127){_0x876b3b['rows']=_0x386127;return _0x876b3b;})['then'](respondWithFilteredResult(_0x3351a8,_0x1b3b03))[_0x4a0d('0x45')](handleError(_0x3351a8,null));};exports[_0x4a0d('0x46')]=function(_0x3ec1cd,_0xca4ff7){var _0x2d1766={'raw':!![],'where':{'id':_0x3ec1cd['params']['id']}},_0x5f0643={};_0x5f0643[_0x4a0d('0x31')]=_['keys'](db[_0x4a0d('0x41')]['rawAttributes']);_0x5f0643['query']=_[_0x4a0d('0x32')](_0x3ec1cd[_0x4a0d('0x33')]);_0x5f0643[_0x4a0d('0x47')]=_[_0x4a0d('0x34')](_0x5f0643['model'],_0x5f0643['query']);_0x2d1766[_0x4a0d('0x35')]=_[_0x4a0d('0x34')](_0x5f0643[_0x4a0d('0x31')],qs[_0x4a0d('0x36')](_0x3ec1cd[_0x4a0d('0x33')][_0x4a0d('0x36')]));_0x2d1766[_0x4a0d('0x35')]=_0x2d1766['attributes'][_0x4a0d('0x48')]?_0x2d1766[_0x4a0d('0x35')]:_0x5f0643[_0x4a0d('0x31')];if(_0x3ec1cd[_0x4a0d('0x33')]['includeAll']){_0x2d1766[_0x4a0d('0x43')]=[{'all':!![]}];}_0x2d1766=_['merge']({},_0x2d1766,_0x3ec1cd[_0x4a0d('0x40')]);return db[_0x4a0d('0x41')][_0x4a0d('0x49')](_0x2d1766)[_0x4a0d('0x27')](handleEntityNotFound(_0xca4ff7,null))['then'](respondWithResult(_0xca4ff7,null))[_0x4a0d('0x45')](handleError(_0xca4ff7,null));};exports['create']=function(_0xd546f0,_0x31dbb4){return db[_0x4a0d('0x41')][_0x4a0d('0x4a')](_0xd546f0[_0x4a0d('0x4b')],{})[_0x4a0d('0x27')](respondWithResult(_0x31dbb4,0xc9))[_0x4a0d('0x45')](handleError(_0x31dbb4,null));};exports['update']=function(_0x70e7d4,_0x4aeec6){if(_0x70e7d4['body']['id']){delete _0x70e7d4['body']['id'];}return db[_0x4a0d('0x41')][_0x4a0d('0x49')]({'where':{'id':_0x70e7d4['params']['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x4aeec6,null))[_0x4a0d('0x27')](saveUpdates(_0x70e7d4['body'],null))[_0x4a0d('0x27')](respondWithResult(_0x4aeec6,null))[_0x4a0d('0x45')](handleError(_0x4aeec6,null));};exports[_0x4a0d('0x4c')]=function(_0x5b58c3,_0x47eda6){return db[_0x4a0d('0x41')][_0x4a0d('0x49')]({'where':{'id':_0x5b58c3[_0x4a0d('0x4d')]['id']}})[_0x4a0d('0x27')](handleEntityNotFound(_0x47eda6,null))[_0x4a0d('0x27')](removeEntity(_0x47eda6,null))['catch'](handleError(_0x47eda6,null));};exports[_0x4a0d('0x4e')]=function(_0x3573e4,_0x31c53c){return db[_0x4a0d('0x41')][_0x4a0d('0x4e')]()['then'](respondWithResult(_0x31c53c,null))[_0x4a0d('0x45')](handleError(_0x31c53c,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9eac714..2590cc8 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 _0x1b69=['define','VoiceDialReport','report_dial','uniqueid','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b69,0x190));var _0x91b6=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x1b69[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x91b6('0x0'));var moment=require(_0x91b6('0x1'));var BPromise=require(_0x91b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91b6('0x3'));var rimraf=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var attributes=require(_0x91b6('0x6'));module[_0x91b6('0x7')]=function(_0x1411c6,_0x264272){return _0x1411c6[_0x91b6('0x8')](_0x91b6('0x9'),attributes,{'tableName':_0x91b6('0xa'),'paranoid':![],'indexes':[{'fields':[_0x91b6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f5a=['request-promise','rimraf','../../config/environment','define','VoiceDialReport','uniqueid','lodash','../../config/logger'];(function(_0x2e9471,_0x2204d5){var _0x2f6954=function(_0x597bbd){while(--_0x597bbd){_0x2e9471['push'](_0x2e9471['shift']());}};_0x2f6954(++_0x2204d5);}(_0x4f5a,0x10e));var _0xa4f5=function(_0x1a6269,_0x5deea5){_0x1a6269=_0x1a6269-0x0;var _0x536f68=_0x4f5a[_0x1a6269];return _0x536f68;};'use strict';var _=require(_0xa4f5('0x0'));var util=require('util');var logger=require(_0xa4f5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa4f5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4f5('0x3'));var config=require(_0xa4f5('0x4'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x3122bd,_0x16f87c){return _0x3122bd[_0xa4f5('0x5')](_0xa4f5('0x6'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xa4f5('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index ec1d2fa..6bb6144 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 _0x87a1=['create','body','options','raw','stringify','catch','UpdateVoiceDialReport','VoiceDialReport','update','where','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','CreateVoiceDialReport'];(function(_0x1a077a,_0xe2bb6b){var _0x2d6e4c=function(_0x1a95db){while(--_0x1a95db){_0x1a077a['push'](_0x1a077a['shift']());}};_0x2d6e4c(++_0xe2bb6b);}(_0x87a1,0xf2));var _0x187a=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x87a1[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require('lodash');var util=require(_0x187a('0x0'));var moment=require(_0x187a('0x1'));var BPromise=require('bluebird');var rs=require(_0x187a('0x2'));var fs=require('fs');var Redis=require(_0x187a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x187a('0x4'));var logger=require(_0x187a('0x5'))(_0x187a('0x6'));var config=require(_0x187a('0x7'));var jayson=require(_0x187a('0x8'));var client=jayson[_0x187a('0x9')][_0x187a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4eea29,_0x62c836,_0x272c68){return new BPromise(function(_0x52c5ea,_0x30a35a){return client[_0x187a('0xb')](_0x4eea29,_0x272c68)[_0x187a('0xc')](function(_0x201f8c){logger[_0x187a('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x62c836,_0x187a('0xe'));logger[_0x187a('0xf')](_0x187a('0x10'),_0x62c836,_0x187a('0xe'),JSON['stringify'](_0x201f8c));if(_0x201f8c[_0x187a('0x11')]){if(_0x201f8c[_0x187a('0x11')][_0x187a('0x12')]===0x1f4){logger[_0x187a('0x11')](_0x187a('0x13'),_0x62c836,_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);return _0x30a35a(_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);}logger[_0x187a('0x11')](_0x187a('0x13'),_0x62c836,_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);return _0x52c5ea(_0x201f8c[_0x187a('0x11')][_0x187a('0x14')]);}else{logger['info'](_0x187a('0x13'),_0x62c836,_0x187a('0xe'));_0x52c5ea(_0x201f8c['result'][_0x187a('0x14')]);}})['catch'](function(_0x2e0241){logger[_0x187a('0x11')](_0x187a('0x13'),_0x62c836,_0x2e0241);_0x30a35a(_0x2e0241);});});}exports[_0x187a('0x15')]=function(_0x2d3086){var _0x3d7dab=this;return new Promise(function(_0x401242,_0x16e144){return db['VoiceDialReport'][_0x187a('0x16')](_0x2d3086[_0x187a('0x17')],{'raw':_0x2d3086[_0x187a('0x18')]?_0x2d3086[_0x187a('0x18')][_0x187a('0x19')]===undefined?!![]:![]:!![]})[_0x187a('0xc')](function(_0x3d2572){logger[_0x187a('0xd')](_0x187a('0x15'),_0x2d3086);logger[_0x187a('0xf')]('CreateVoiceDialReport',_0x2d3086,JSON[_0x187a('0x1a')](_0x3d2572));_0x401242(_0x3d2572);})[_0x187a('0x1b')](function(_0x1dd6b9){logger['error'](_0x187a('0x15'),_0x1dd6b9[_0x187a('0x14')],_0x2d3086);_0x16e144(_0x3d7dab[_0x187a('0x11')](0x1f4,_0x1dd6b9['message']));});});};exports[_0x187a('0x1c')]=function(_0x45fd97){var _0x33d040=this;return new Promise(function(_0x30d4b6,_0x3f70eb){return db[_0x187a('0x1d')][_0x187a('0x1e')](_0x45fd97[_0x187a('0x17')],{'raw':_0x45fd97[_0x187a('0x18')]?_0x45fd97[_0x187a('0x18')][_0x187a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45fd97[_0x187a('0x18')]?_0x45fd97[_0x187a('0x18')][_0x187a('0x1f')]||null:null,'attributes':_0x45fd97['options']?_0x45fd97[_0x187a('0x18')]['attributes']||null:null,'limit':_0x45fd97['options']?_0x45fd97[_0x187a('0x18')][_0x187a('0x20')]||null:null})['then'](function(_0x55524b){logger[_0x187a('0xd')](_0x187a('0x1c'),_0x45fd97);logger[_0x187a('0xf')](_0x187a('0x1c'),_0x45fd97,JSON['stringify'](_0x55524b));_0x30d4b6(_0x55524b);})[_0x187a('0x1b')](function(_0x30f68e){logger[_0x187a('0x11')](_0x187a('0x1c'),_0x30f68e[_0x187a('0x14')],_0x45fd97);_0x3f70eb(_0x33d040[_0x187a('0x11')](0x1f4,_0x30f68e[_0x187a('0x14')]));});});}; \ No newline at end of file +var _0xb768=['options','raw','then','CreateVoiceDialReport','debug','UpdateVoiceDialReport','limit','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','VoiceDialReport,\x20%s,\x20%s','message','catch','VoiceDialReport','create','body'];(function(_0x501e67,_0x2e6643){var _0x16b255=function(_0x474eb4){while(--_0x474eb4){_0x501e67['push'](_0x501e67['shift']());}};_0x16b255(++_0x2e6643);}(_0xb768,0x1e4));var _0x8b76=function(_0x2709ee,_0x4db185){_0x2709ee=_0x2709ee-0x0;var _0x35ba9a=_0xb768[_0x2709ee];return _0x35ba9a;};'use strict';var _=require(_0x8b76('0x0'));var util=require(_0x8b76('0x1'));var moment=require(_0x8b76('0x2'));var BPromise=require(_0x8b76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b76('0x4'))['db'];var utils=require(_0x8b76('0x5'));var logger=require('../../config/logger')(_0x8b76('0x6'));var config=require(_0x8b76('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b76('0x8')][_0x8b76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e4f81,_0xb2ac2d,_0x5494ab){return new BPromise(function(_0x106ad9,_0xb448d5){return client[_0x8b76('0xa')](_0x5e4f81,_0x5494ab)['then'](function(_0x4d5383){logger[_0x8b76('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0xb2ac2d,'request\x20sent');logger['debug'](_0x8b76('0xc'),_0xb2ac2d,'request\x20sent',JSON['stringify'](_0x4d5383));if(_0x4d5383['error']){if(_0x4d5383[_0x8b76('0xd')]['code']===0x1f4){logger[_0x8b76('0xd')](_0x8b76('0xe'),_0xb2ac2d,_0x4d5383[_0x8b76('0xd')][_0x8b76('0xf')]);return _0xb448d5(_0x4d5383['error']['message']);}logger[_0x8b76('0xd')](_0x8b76('0xe'),_0xb2ac2d,_0x4d5383[_0x8b76('0xd')][_0x8b76('0xf')]);return _0x106ad9(_0x4d5383['error'][_0x8b76('0xf')]);}else{logger[_0x8b76('0xb')](_0x8b76('0xe'),_0xb2ac2d,'request\x20sent');_0x106ad9(_0x4d5383['result'][_0x8b76('0xf')]);}})[_0x8b76('0x10')](function(_0x5b2797){logger[_0x8b76('0xd')](_0x8b76('0xe'),_0xb2ac2d,_0x5b2797);_0xb448d5(_0x5b2797);});});}exports['CreateVoiceDialReport']=function(_0x104c45){var _0x233c2f=this;return new Promise(function(_0x213578,_0x11917e){return db[_0x8b76('0x11')][_0x8b76('0x12')](_0x104c45[_0x8b76('0x13')],{'raw':_0x104c45[_0x8b76('0x14')]?_0x104c45['options'][_0x8b76('0x15')]===undefined?!![]:![]:!![]})[_0x8b76('0x16')](function(_0x5be107){logger[_0x8b76('0xb')](_0x8b76('0x17'),_0x104c45);logger[_0x8b76('0x18')](_0x8b76('0x17'),_0x104c45,JSON['stringify'](_0x5be107));_0x213578(_0x5be107);})[_0x8b76('0x10')](function(_0x2debe3){logger[_0x8b76('0xd')](_0x8b76('0x17'),_0x2debe3[_0x8b76('0xf')],_0x104c45);_0x11917e(_0x233c2f[_0x8b76('0xd')](0x1f4,_0x2debe3['message']));});});};exports[_0x8b76('0x19')]=function(_0x5d9969){var _0x337011=this;return new Promise(function(_0x1f6f53,_0x41317f){return db[_0x8b76('0x11')]['update'](_0x5d9969[_0x8b76('0x13')],{'raw':_0x5d9969[_0x8b76('0x14')]?_0x5d9969[_0x8b76('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d9969[_0x8b76('0x14')]?_0x5d9969[_0x8b76('0x14')]['where']||null:null,'attributes':_0x5d9969['options']?_0x5d9969[_0x8b76('0x14')]['attributes']||null:null,'limit':_0x5d9969['options']?_0x5d9969[_0x8b76('0x14')][_0x8b76('0x1a')]||null:null})[_0x8b76('0x16')](function(_0x24bf8c){logger[_0x8b76('0xb')]('UpdateVoiceDialReport',_0x5d9969);logger[_0x8b76('0x18')](_0x8b76('0x19'),_0x5d9969,JSON[_0x8b76('0x1b')](_0x24bf8c));_0x1f6f53(_0x24bf8c);})['catch'](function(_0x42d194){logger[_0x8b76('0xd')](_0x8b76('0x19'),_0x42d194[_0x8b76('0xf')],_0x5d9969);_0x41317f(_0x337011[_0x8b76('0xd')](0x1f4,_0x42d194[_0x8b76('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 217184b..33d0585 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 _0xdf4c=['express','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','post','/:id/applications','addApplications','put','delete','destroy','exports','util','connect-timeout'];(function(_0x34b5ca,_0x594010){var _0x2d72c0=function(_0x4ae1d3){while(--_0x4ae1d3){_0x34b5ca['push'](_0x34b5ca['shift']());}};_0x2d72c0(++_0x594010);}(_0xdf4c,0x1c0));var _0xcdf4=function(_0x26f4f5,_0x53419e){_0x26f4f5=_0x26f4f5-0x0;var _0x91bf0a=_0xdf4c[_0x26f4f5];return _0x91bf0a;};'use strict';var multer=require('multer');var util=require(_0xcdf4('0x0'));var path=require('path');var timeout=require(_0xcdf4('0x1'));var express=require(_0xcdf4('0x2'));var router=express['Router']();var fs_extra=require(_0xcdf4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcdf4('0x4'));var config=require(_0xcdf4('0x5'));var controller=require(_0xcdf4('0x6'));router['get']('/',auth[_0xcdf4('0x7')](),controller[_0xcdf4('0x8')]);router[_0xcdf4('0x9')](_0xcdf4('0xa'),auth[_0xcdf4('0x7')](),controller['show']);router[_0xcdf4('0xb')]('/',auth[_0xcdf4('0x7')](),controller['create']);router['post'](_0xcdf4('0xc'),auth['isAuthenticated'](),controller[_0xcdf4('0xd')]);router[_0xcdf4('0xe')](_0xcdf4('0xa'),auth[_0xcdf4('0x7')](),controller['update']);router[_0xcdf4('0xf')](_0xcdf4('0xa'),auth['isAuthenticated'](),controller[_0xcdf4('0x10')]);module[_0xcdf4('0x11')]=router; \ No newline at end of file +var _0x8457=['destroy','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','post','/:id/applications','addApplications','put','update','delete'];(function(_0x114b15,_0x3309fe){var _0x484acf=function(_0x2dfe93){while(--_0x2dfe93){_0x114b15['push'](_0x114b15['shift']());}};_0x484acf(++_0x3309fe);}(_0x8457,0x1ef));var _0x7845=function(_0x392afa,_0x589239){_0x392afa=_0x392afa-0x0;var _0x2942a8=_0x8457[_0x392afa];return _0x2942a8;};'use strict';var multer=require(_0x7845('0x0'));var util=require(_0x7845('0x1'));var path=require(_0x7845('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7845('0x3'));var auth=require(_0x7845('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7845('0x5'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x7845('0x6')](),controller[_0x7845('0x7')]);router[_0x7845('0x8')](_0x7845('0x9'),auth['isAuthenticated'](),controller[_0x7845('0xa')]);router['post']('/',auth[_0x7845('0x6')](),controller[_0x7845('0xb')]);router[_0x7845('0xc')](_0x7845('0xd'),auth[_0x7845('0x6')](),controller[_0x7845('0xe')]);router[_0x7845('0xf')](_0x7845('0x9'),auth[_0x7845('0x6')](),controller[_0x7845('0x10')]);router[_0x7845('0x11')](_0x7845('0x9'),auth[_0x7845('0x6')](),controller[_0x7845('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ddb5eab..7074160 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 _0xf98a=['BOOLEAN','wav','VIRTUAL','exten','sequelize','compositeIndex','STRING','inbound','outbound','internal','inbound-fax','*,*,*,*','INTEGER'];(function(_0x1b0b13,_0x47562e){var _0x3896ff=function(_0x81cda6){while(--_0x81cda6){_0x1b0b13['push'](_0x1b0b13['shift']());}};_0x3896ff(++_0x47562e);}(_0xf98a,0x93));var _0xaf98=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0xf98a[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require(_0xaf98('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaf98('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xaf98('0x1')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xaf98('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xaf98('0x3'),_0xaf98('0x4'),_0xaf98('0x5'),_0xaf98('0x6'),'outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xaf98('0x2')],'allowNull':![],'defaultValue':_0xaf98('0x7')},'IntervalId':{'type':Sequelize[_0xaf98('0x8')]},'isApp':{'type':Sequelize[_0xaf98('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xaf98('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xaf98('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xaf98('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xaf98('0x8')]},'recordingFormat':{'type':Sequelize[_0xaf98('0x2')],'defaultValue':_0xaf98('0xa')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xaf98('0xb')],'get':function(_0x3e16e5){return this['getDataValue'](_0xaf98('0xc'));}},'alias':{'type':Sequelize[_0xaf98('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x0720=['outbound','outbound-fax','any','INTEGER','BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound'];(function(_0x3b0422,_0x820084){var _0x545e14=function(_0x1972c4){while(--_0x1972c4){_0x3b0422['push'](_0x3b0422['shift']());}};_0x545e14(++_0x820084);}(_0x0720,0x102));var _0x0072=function(_0x2119fe,_0x5b58ae){_0x2119fe=_0x2119fe-0x0;var _0x3a9e4a=_0x0720[_0x2119fe];return _0x3a9e4a;};'use strict';var Sequelize=require(_0x0072('0x0'));module[_0x0072('0x1')]={'context':{'type':Sequelize[_0x0072('0x2')],'allowNull':![],'unique':_0x0072('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0072('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x0072('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x0072('0x3')},'tag':{'type':Sequelize[_0x0072('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0072('0x4')},'appdata':{'type':Sequelize[_0x0072('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0072('0x5'),_0x0072('0x6'),'internal','inbound-fax',_0x0072('0x7'),'system',_0x0072('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0072('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x0072('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x0072('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0072('0x9')]},'recordingFormat':{'type':Sequelize[_0x0072('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1fe664){return this['getDataValue'](_0x0072('0xb'));}},'alias':{'type':Sequelize[_0x0072('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 31e3ad6..2159ed4 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 _0x8cc4=['include','VoiceExtension','findAll','rows','catch','show','params','length','options','create','startsWith','body','exten','concat','user','inbound','OutboundRoutes','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','priority','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','then','get','InboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x6ff889,_0x1ea004){var _0x5e04fa=function(_0x5fd7){while(--_0x5fd7){_0x6ff889['push'](_0x6ff889['shift']());}};_0x5e04fa(++_0x1ea004);}(_0x8cc4,0x137));var _0x48cc=function(_0x4295bc,_0x55b581){_0x4295bc=_0x4295bc-0x0;var _0x2f0298=_0x8cc4[_0x4295bc];return _0x2f0298;};'use strict';var _=require(_0x48cc('0x0'));var Redis=require(_0x48cc('0x1'));var qs=require(_0x48cc('0x2'));var logger=require(_0x48cc('0x3'))('api');var config=require(_0x48cc('0x4'));var db=require(_0x48cc('0x5'))['db'];config[_0x48cc('0x6')]=_[_0x48cc('0x7')](config[_0x48cc('0x6')],{'host':_0x48cc('0x8'),'port':0x18eb});var socket=require(_0x48cc('0x9'))(new Redis(config[_0x48cc('0x6')]));require(_0x48cc('0xa'))['register'](socket);function respondWithStatusCode(_0x9e87ad,_0x14b11f){_0x14b11f=_0x14b11f||0xcc;return function(_0x471826){if(_0x471826){return _0x9e87ad['sendStatus'](_0x14b11f);}return _0x9e87ad[_0x48cc('0xb')](_0x14b11f)[_0x48cc('0xc')]();};}function respondWithResult(_0x1833c2,_0x7bda9a){_0x7bda9a=_0x7bda9a||0xc8;return function(_0x15bdc0){if(_0x15bdc0){return _0x1833c2[_0x48cc('0xb')](_0x7bda9a)[_0x48cc('0xd')](_0x15bdc0);}};}function respondWithFilteredResult(_0x2c6589,_0x4f3485){return function(_0xabb4c5){if(_0xabb4c5){var _0x4507f8=typeof _0x4f3485[_0x48cc('0xe')]===_0x48cc('0xf')&&typeof _0x4f3485['limit']===_0x48cc('0xf');var _0x450647=_0xabb4c5['count'];var _0x32775d=_0x4507f8?0x0:_0x4f3485[_0x48cc('0xe')];var _0x202d09=_0x4507f8?_0xabb4c5[_0x48cc('0x10')]:_0x4f3485[_0x48cc('0xe')]+_0x4f3485[_0x48cc('0x11')];var _0x35ca34;if(_0x202d09>=_0x450647){_0x202d09=_0x450647;_0x35ca34=0xc8;}else{_0x35ca34=0xce;}_0x2c6589['status'](_0x35ca34);return _0x2c6589[_0x48cc('0x12')](_0x48cc('0x13'),_0x32775d+'-'+_0x202d09+'/'+_0x450647)[_0x48cc('0xd')](_0xabb4c5);}return null;};}function removeEntity(_0x47cc65){return function(_0x4c863c){if(_0x4c863c){return _0x4c863c['destroy']()[_0x48cc('0x14')](function(){var _0x545b9a=_0x4c863c[_0x48cc('0x15')]({'plain':!![]});var _0x114254=[{'name':_0x48cc('0x16'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x48cc('0x17'),'ignore':![]},{'name':_0x48cc('0x18'),'value':_0x48cc('0x19'),'ignore':![]}];var _0x351613=_(_0x114254)[_0x48cc('0x1a')](_0x48cc('0x1b'))[_0x48cc('0x1c')]('value')[_0x48cc('0x1d')]();if(_['includes'](_0x351613,_0x545b9a[_0x48cc('0x1e')])){return;}var _0x5cf851=_[_0x48cc('0x1f')](_0x114254,[_0x48cc('0x1d'),_0x545b9a['type']])[_0x48cc('0x20')];return db[_0x48cc('0x21')][_0x48cc('0x22')]({'where':{'type':_0x5cf851,'resourceId':_0x545b9a['id']}})[_0x48cc('0x14')](function(){return _0x4c863c;});})[_0x48cc('0x14')](function(){_0x47cc65['status'](0xcc)[_0x48cc('0xc')]();});}};}function handleEntityNotFound(_0xeaa6c9){return function(_0x1db8ee){if(!_0x1db8ee){_0xeaa6c9[_0x48cc('0x23')](0x194);}return _0x1db8ee;};}function handleError(_0x4c3397,_0x416e43){_0x416e43=_0x416e43||0x1f4;return function(_0x45fd2a){logger[_0x48cc('0x24')](_0x45fd2a[_0x48cc('0x25')]);if(_0x45fd2a[_0x48cc('0x20')]){delete _0x45fd2a[_0x48cc('0x20')];}_0x4c3397[_0x48cc('0xb')](_0x416e43)[_0x48cc('0x26')](_0x45fd2a);};}exports['index']=function(_0x12515d,_0x57b991){var _0x2ba264={},_0x3054df={},_0x586b89={'count':0x0,'rows':[]};var _0x569716=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x4a501b){return{'name':_0x4a501b['fieldName'],'type':_0x4a501b[_0x48cc('0x1e')]['key']};});_0x3054df[_0x48cc('0x27')]=_[_0x48cc('0x1c')](_0x569716,_0x48cc('0x20'));_0x3054df[_0x48cc('0x28')]=_[_0x48cc('0x29')](_0x12515d[_0x48cc('0x28')]);_0x3054df[_0x48cc('0x2a')]=_['intersection'](_0x3054df[_0x48cc('0x27')],_0x3054df['query']);_0x2ba264[_0x48cc('0x2b')]=_[_0x48cc('0x2c')](_0x3054df[_0x48cc('0x27')],qs[_0x48cc('0x2d')](_0x12515d['query'][_0x48cc('0x2d')]));_0x2ba264[_0x48cc('0x2b')]=_0x2ba264[_0x48cc('0x2b')]['length']?_0x2ba264[_0x48cc('0x2b')]:_0x3054df['model'];if(!_0x12515d[_0x48cc('0x28')][_0x48cc('0x2e')](_0x48cc('0x2f'))){_0x2ba264[_0x48cc('0x11')]=qs[_0x48cc('0x11')](_0x12515d['query'][_0x48cc('0x11')]);_0x2ba264[_0x48cc('0xe')]=qs[_0x48cc('0xe')](_0x12515d['query'][_0x48cc('0xe')]);}_0x2ba264[_0x48cc('0x30')]=qs[_0x48cc('0x31')](_0x12515d['query'][_0x48cc('0x31')]);_0x2ba264['where']=qs[_0x48cc('0x2a')](_[_0x48cc('0x32')](_0x12515d[_0x48cc('0x28')],_0x3054df[_0x48cc('0x2a')]),_0x569716);if(_0x12515d['query']['filter']){_0x2ba264[_0x48cc('0x33')]=_[_0x48cc('0x34')](_0x2ba264[_0x48cc('0x33')],{'$or':_[_0x48cc('0x1c')](_0x569716,function(_0x69fe24){if(_0x69fe24[_0x48cc('0x1e')]!=='VIRTUAL'){var _0x2f8b67={};_0x2f8b67[_0x69fe24[_0x48cc('0x20')]]={'$like':'%'+_0x12515d[_0x48cc('0x28')][_0x48cc('0x1a')]+'%'};return _0x2f8b67;}})});}_0x2ba264=_['merge']({},_0x2ba264,_0x12515d['options']);var _0xad0aa7={'where':_0x2ba264[_0x48cc('0x33')]};return db['VoiceExtension'][_0x48cc('0x10')](_0xad0aa7)[_0x48cc('0x14')](function(_0x445f17){_0x586b89[_0x48cc('0x10')]=_0x445f17;if(_0x12515d['query']['includeAll']){_0x2ba264[_0x48cc('0x35')]=[{'all':!![]}];}return db[_0x48cc('0x36')][_0x48cc('0x37')](_0x2ba264);})[_0x48cc('0x14')](function(_0x45ea36){_0x586b89[_0x48cc('0x38')]=_0x45ea36;return _0x586b89;})[_0x48cc('0x14')](respondWithFilteredResult(_0x57b991,_0x2ba264))[_0x48cc('0x39')](handleError(_0x57b991,null));};exports[_0x48cc('0x3a')]=function(_0x3c030e,_0x10f3da){var _0x24ea98={'raw':![],'where':{'id':_0x3c030e[_0x48cc('0x3b')]['id']}},_0x2741bd={};_0x2741bd[_0x48cc('0x27')]=_[_0x48cc('0x29')](db[_0x48cc('0x36')]['rawAttributes']);_0x2741bd[_0x48cc('0x28')]=_[_0x48cc('0x29')](_0x3c030e[_0x48cc('0x28')]);_0x2741bd[_0x48cc('0x2a')]=_[_0x48cc('0x2c')](_0x2741bd[_0x48cc('0x27')],_0x2741bd[_0x48cc('0x28')]);_0x24ea98[_0x48cc('0x2b')]=_['intersection'](_0x2741bd[_0x48cc('0x27')],qs['fields'](_0x3c030e[_0x48cc('0x28')][_0x48cc('0x2d')]));_0x24ea98['attributes']=_0x24ea98['attributes'][_0x48cc('0x3c')]?_0x24ea98[_0x48cc('0x2b')]:_0x2741bd[_0x48cc('0x27')];if(_0x3c030e[_0x48cc('0x28')]['includeAll']){_0x24ea98['include']=[{'all':!![]}];}_0x24ea98=_[_0x48cc('0x34')]({},_0x24ea98,_0x3c030e[_0x48cc('0x3d')]);return db[_0x48cc('0x36')]['find'](_0x24ea98)[_0x48cc('0x14')](handleEntityNotFound(_0x10f3da,null))[_0x48cc('0x14')](respondWithResult(_0x10f3da,null))[_0x48cc('0x39')](handleError(_0x10f3da,null));};exports['destroy']=function(_0x25de11,_0x4eb025){return db['VoiceExtension'][_0x48cc('0x1f')]({'where':{'id':_0x25de11[_0x48cc('0x3b')]['id']}})[_0x48cc('0x14')](handleEntityNotFound(_0x4eb025,null))[_0x48cc('0x14')](removeEntity(_0x4eb025,null))['catch'](handleError(_0x4eb025,null));};exports[_0x48cc('0x3e')]=function(_0x3db1e9,_0x4e5005){if(_0x3db1e9['body'][_0x48cc('0x1e')]===_0x48cc('0x17')&&!_[_0x48cc('0x3f')](_0x3db1e9[_0x48cc('0x40')]['exten'],'_')){_0x3db1e9[_0x48cc('0x40')][_0x48cc('0x41')]='_'[_0x48cc('0x42')](_0x3db1e9[_0x48cc('0x40')]['exten']);}return db[_0x48cc('0x36')][_0x48cc('0x3e')](_0x3db1e9['body'],{'raw':![]})['then'](function(_0x42ebdc){var _0x1bba14=_0x3db1e9[_0x48cc('0x43')][_0x48cc('0x15')]({'plain':!![]});if(!_0x1bba14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bba14['role']===_0x48cc('0x43')){var _0x46d698=_0x42ebdc[_0x48cc('0x15')]({'plain':!![]});var _0x9a8ff8=[{'name':_0x48cc('0x16'),'value':_0x48cc('0x44')},{'name':_0x48cc('0x45'),'value':_0x48cc('0x17')},{'name':_0x48cc('0x18'),'value':_0x48cc('0x19')}];var _0x240b75=_[_0x48cc('0x1f')](_0x9a8ff8,['value',_0x46d698['type']])[_0x48cc('0x20')];return db[_0x48cc('0x46')][_0x48cc('0x1f')]({'where':{'name':_0x240b75,'userProfileId':_0x1bba14['userProfileId']},'raw':!![]})[_0x48cc('0x14')](function(_0x5cd0c9){if(_0x5cd0c9&&_0x5cd0c9['autoAssociation']===0x0){return db[_0x48cc('0x21')][_0x48cc('0x3e')]({'name':_0x46d698[_0x48cc('0x20')],'resourceId':_0x46d698['id'],'type':_0x5cd0c9[_0x48cc('0x20')],'sectionId':_0x5cd0c9['id']},{})['then'](function(){return _0x42ebdc;});}else{return _0x42ebdc;}})[_0x48cc('0x39')](function(_0x35f937){logger[_0x48cc('0x24')](_0x48cc('0x47'),_0x35f937);throw _0x35f937;});}return _0x42ebdc;})['then'](respondWithResult(_0x4e5005,0xc9))[_0x48cc('0x39')](handleError(_0x4e5005,null));};exports[_0x48cc('0x48')]=function(_0xf7b7e2,_0x245a3a){if(_0xf7b7e2['body']['id']){delete _0xf7b7e2[_0x48cc('0x40')]['id'];}return db[_0x48cc('0x36')][_0x48cc('0x1f')]({'where':{'id':_0xf7b7e2[_0x48cc('0x3b')]['id']}})[_0x48cc('0x14')](handleEntityNotFound(_0x245a3a,null))[_0x48cc('0x14')](function(_0x12be1e){if(_0x12be1e){return db[_0x48cc('0x36')][_0x48cc('0x48')](_[_0x48cc('0x32')](_0xf7b7e2[_0x48cc('0x40')],[_0x48cc('0x41'),_0x48cc('0x49'),_0x48cc('0x4a'),_0x48cc('0x4b'),_0x48cc('0x4c'),_0x48cc('0x4d'),_0x48cc('0x4e')]),{'where':{'context':_0x12be1e[_0x48cc('0x49')],'exten':_0x12be1e[_0x48cc('0x41')]},'individualHooks':!![]})['then'](function(_0x402965){return _0x402965;});}return null;})[_0x48cc('0x14')](respondWithStatusCode(_0x245a3a,null))[_0x48cc('0x39')](handleError(_0x245a3a,null));};exports[_0x48cc('0x4f')]=function(_0x3c4ac6,_0x3d8ae2){var _0xa58d81=_0x3c4ac6[_0x48cc('0x3b')]['id'];var _0x5645e2=_0x3c4ac6[_0x48cc('0x40')];var _0x2a369d=0xc8;var _0x10aa9f=null;return db[_0x48cc('0x50')][_0x48cc('0x51')]({'isolationLevel':db[_0x48cc('0x50')][_0x48cc('0x52')]['ISOLATION_LEVELS'][_0x48cc('0x53')]},function(_0x4020a9){return db['VoiceExtension'][_0x48cc('0x54')]({'where':{'id':_0xa58d81},'transaction':_0x4020a9})[_0x48cc('0x14')](function(_0x38c0d5){if(_0x38c0d5){return db[_0x48cc('0x36')]['destroy']({'where':{'VoiceExtensionId':_0xa58d81},'transaction':_0x4020a9})[_0x48cc('0x14')](function(){var _0x3f67ff=_['map'](_0x5645e2,function(_0x54eed3){_0x54eed3['VoiceExtensionId']=_0xa58d81;_0x54eed3[_0x48cc('0x55')]=!![];return _0x54eed3;});return _0x38c0d5[_0x48cc('0x56')](_0x3f67ff);})[_0x48cc('0x14')](function(_0x570853){return db['VoiceExtension'][_0x48cc('0x57')](_0x570853,{'transaction':_0x4020a9});});}else{_0x2a369d=0x194;_0x10aa9f=[];}});})[_0x48cc('0x14')](function(){if(_0x2a369d!==0x194){return db[_0x48cc('0x36')][_0x48cc('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0xa58d81},'order':_0x48cc('0x59')})['then'](function(_0x5124f7){_0x10aa9f=_0x5124f7;});}})[_0x48cc('0x39')](function(_0x286758){_0x2a369d=0x1f4;logger['error'](_0x286758[_0x48cc('0x25')]);if(_0x286758['name']){delete _0x286758['name'];}_0x10aa9f=_0x286758;})[_0x48cc('0x5a')](function(){if(_0x10aa9f===null){_0x3d8ae2[_0x48cc('0x23')](_0x2a369d);}else{if(_0x2a369d===0x1f4){_0x3d8ae2[_0x48cc('0xb')](_0x2a369d)[_0x48cc('0x26')](_0x10aa9f);}else{_0x3d8ae2[_0x48cc('0xb')](_0x2a369d)[_0x48cc('0xd')](_0x10aa9f);}}});}; \ No newline at end of file +var _0xe92c=['update','context','description','recordingFormat','alias','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','priority','error','stack','lodash','ioredis','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','offset','limit','undefined','set','json','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','name','send','index','VoiceExtension','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','startsWith','exten','concat','user','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0xbee015,_0x4af57f){var _0x40044a=function(_0x40cdc6){while(--_0x40cdc6){_0xbee015['push'](_0xbee015['shift']());}};_0x40044a(++_0x4af57f);}(_0xe92c,0x66));var _0xce92=function(_0x2b6726,_0x247b20){_0x2b6726=_0x2b6726-0x0;var _0x34f01c=_0xe92c[_0x2b6726];return _0x34f01c;};'use strict';var _=require(_0xce92('0x0'));var Redis=require(_0xce92('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xce92('0x2'))(_0xce92('0x3'));var config=require(_0xce92('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xce92('0x5')],{'host':_0xce92('0x6'),'port':0x18eb});var socket=require(_0xce92('0x7'))(new Redis(config[_0xce92('0x5')]));require(_0xce92('0x8'))['register'](socket);function respondWithStatusCode(_0x578d96,_0x24568a){_0x24568a=_0x24568a||0xcc;return function(_0x19d974){if(_0x19d974){return _0x578d96[_0xce92('0x9')](_0x24568a);}return _0x578d96['status'](_0x24568a)[_0xce92('0xa')]();};}function respondWithResult(_0x20f116,_0x2e16d2){_0x2e16d2=_0x2e16d2||0xc8;return function(_0x1a4494){if(_0x1a4494){return _0x20f116[_0xce92('0xb')](_0x2e16d2)['json'](_0x1a4494);}};}function respondWithFilteredResult(_0x234490,_0x9e634d){return function(_0x409d20){if(_0x409d20){var _0x283b82=typeof _0x9e634d[_0xce92('0xc')]==='undefined'&&typeof _0x9e634d[_0xce92('0xd')]===_0xce92('0xe');var _0x54ab11=_0x409d20['count'];var _0x28abe9=_0x283b82?0x0:_0x9e634d[_0xce92('0xc')];var _0x29cb1e=_0x283b82?_0x409d20['count']:_0x9e634d['offset']+_0x9e634d[_0xce92('0xd')];var _0x51d5d3;if(_0x29cb1e>=_0x54ab11){_0x29cb1e=_0x54ab11;_0x51d5d3=0xc8;}else{_0x51d5d3=0xce;}_0x234490[_0xce92('0xb')](_0x51d5d3);return _0x234490[_0xce92('0xf')]('Content-Range',_0x28abe9+'-'+_0x29cb1e+'/'+_0x54ab11)[_0xce92('0x10')](_0x409d20);}return null;};}function removeEntity(_0x2a1251){return function(_0x57f66d){if(_0x57f66d){return _0x57f66d[_0xce92('0x11')]()[_0xce92('0x12')](function(){var _0x48191e=_0x57f66d[_0xce92('0x13')]({'plain':!![]});var _0x3a4cba=[{'name':_0xce92('0x14'),'value':'inbound','ignore':![]},{'name':_0xce92('0x15'),'value':_0xce92('0x16'),'ignore':![]},{'name':_0xce92('0x17'),'value':_0xce92('0x18'),'ignore':![]}];var _0x4868f6=_(_0x3a4cba)['filter'](_0xce92('0x19'))[_0xce92('0x1a')](_0xce92('0x1b'))[_0xce92('0x1b')]();if(_[_0xce92('0x1c')](_0x4868f6,_0x48191e['type'])){return;}var _0x342ca8=_['find'](_0x3a4cba,[_0xce92('0x1b'),_0x48191e['type']])[_0xce92('0x1d')];return db['UserProfileResource'][_0xce92('0x11')]({'where':{'type':_0x342ca8,'resourceId':_0x48191e['id']}})[_0xce92('0x12')](function(){return _0x57f66d;});})[_0xce92('0x12')](function(){_0x2a1251['status'](0xcc)[_0xce92('0xa')]();});}};}function handleEntityNotFound(_0x2a5fc1){return function(_0x33ef19){if(!_0x33ef19){_0x2a5fc1[_0xce92('0x9')](0x194);}return _0x33ef19;};}function handleError(_0x553267,_0x51e701){_0x51e701=_0x51e701||0x1f4;return function(_0x55893f){logger['error'](_0x55893f['stack']);if(_0x55893f[_0xce92('0x1d')]){delete _0x55893f[_0xce92('0x1d')];}_0x553267[_0xce92('0xb')](_0x51e701)[_0xce92('0x1e')](_0x55893f);};}exports[_0xce92('0x1f')]=function(_0x3f6e33,_0x5dd7dd){var _0x4d0400={},_0x29348d={},_0x4e06c2={'count':0x0,'rows':[]};var _0x52d88a=_['map'](db[_0xce92('0x20')][_0xce92('0x21')],function(_0x23e9de){return{'name':_0x23e9de[_0xce92('0x22')],'type':_0x23e9de[_0xce92('0x23')]['key']};});_0x29348d[_0xce92('0x24')]=_[_0xce92('0x1a')](_0x52d88a,_0xce92('0x1d'));_0x29348d[_0xce92('0x25')]=_[_0xce92('0x26')](_0x3f6e33[_0xce92('0x25')]);_0x29348d[_0xce92('0x27')]=_['intersection'](_0x29348d[_0xce92('0x24')],_0x29348d['query']);_0x4d0400[_0xce92('0x28')]=_[_0xce92('0x29')](_0x29348d[_0xce92('0x24')],qs['fields'](_0x3f6e33[_0xce92('0x25')][_0xce92('0x2a')]));_0x4d0400[_0xce92('0x28')]=_0x4d0400[_0xce92('0x28')][_0xce92('0x2b')]?_0x4d0400[_0xce92('0x28')]:_0x29348d['model'];if(!_0x3f6e33[_0xce92('0x25')]['hasOwnProperty']('nolimit')){_0x4d0400[_0xce92('0xd')]=qs[_0xce92('0xd')](_0x3f6e33[_0xce92('0x25')][_0xce92('0xd')]);_0x4d0400['offset']=qs[_0xce92('0xc')](_0x3f6e33[_0xce92('0x25')][_0xce92('0xc')]);}_0x4d0400['order']=qs[_0xce92('0x2c')](_0x3f6e33[_0xce92('0x25')][_0xce92('0x2c')]);_0x4d0400[_0xce92('0x2d')]=qs['filters'](_[_0xce92('0x2e')](_0x3f6e33[_0xce92('0x25')],_0x29348d[_0xce92('0x27')]),_0x52d88a);if(_0x3f6e33[_0xce92('0x25')][_0xce92('0x2f')]){_0x4d0400[_0xce92('0x2d')]=_[_0xce92('0x30')](_0x4d0400[_0xce92('0x2d')],{'$or':_[_0xce92('0x1a')](_0x52d88a,function(_0x49704f){if(_0x49704f[_0xce92('0x23')]!==_0xce92('0x31')){var _0x4e4d8c={};_0x4e4d8c[_0x49704f[_0xce92('0x1d')]]={'$like':'%'+_0x3f6e33[_0xce92('0x25')]['filter']+'%'};return _0x4e4d8c;}})});}_0x4d0400=_[_0xce92('0x30')]({},_0x4d0400,_0x3f6e33['options']);var _0x1e8f99={'where':_0x4d0400[_0xce92('0x2d')]};return db[_0xce92('0x20')][_0xce92('0x32')](_0x1e8f99)[_0xce92('0x12')](function(_0x40f9c7){_0x4e06c2[_0xce92('0x32')]=_0x40f9c7;if(_0x3f6e33[_0xce92('0x25')][_0xce92('0x33')]){_0x4d0400[_0xce92('0x34')]=[{'all':!![]}];}return db[_0xce92('0x20')][_0xce92('0x35')](_0x4d0400);})[_0xce92('0x12')](function(_0x3864e2){_0x4e06c2[_0xce92('0x36')]=_0x3864e2;return _0x4e06c2;})[_0xce92('0x12')](respondWithFilteredResult(_0x5dd7dd,_0x4d0400))[_0xce92('0x37')](handleError(_0x5dd7dd,null));};exports[_0xce92('0x38')]=function(_0x1b4043,_0xd5e9db){var _0x46c584={'raw':![],'where':{'id':_0x1b4043[_0xce92('0x39')]['id']}},_0x2ff1f3={};_0x2ff1f3[_0xce92('0x24')]=_[_0xce92('0x26')](db['VoiceExtension']['rawAttributes']);_0x2ff1f3['query']=_['keys'](_0x1b4043['query']);_0x2ff1f3[_0xce92('0x27')]=_[_0xce92('0x29')](_0x2ff1f3[_0xce92('0x24')],_0x2ff1f3[_0xce92('0x25')]);_0x46c584[_0xce92('0x28')]=_['intersection'](_0x2ff1f3[_0xce92('0x24')],qs[_0xce92('0x2a')](_0x1b4043[_0xce92('0x25')][_0xce92('0x2a')]));_0x46c584[_0xce92('0x28')]=_0x46c584[_0xce92('0x28')][_0xce92('0x2b')]?_0x46c584[_0xce92('0x28')]:_0x2ff1f3[_0xce92('0x24')];if(_0x1b4043[_0xce92('0x25')]['includeAll']){_0x46c584['include']=[{'all':!![]}];}_0x46c584=_[_0xce92('0x30')]({},_0x46c584,_0x1b4043['options']);return db[_0xce92('0x20')]['find'](_0x46c584)[_0xce92('0x12')](handleEntityNotFound(_0xd5e9db,null))[_0xce92('0x12')](respondWithResult(_0xd5e9db,null))[_0xce92('0x37')](handleError(_0xd5e9db,null));};exports[_0xce92('0x11')]=function(_0x520c6a,_0x1e3c0d){return db['VoiceExtension'][_0xce92('0x3a')]({'where':{'id':_0x520c6a[_0xce92('0x39')]['id']}})[_0xce92('0x12')](handleEntityNotFound(_0x1e3c0d,null))['then'](removeEntity(_0x1e3c0d,null))[_0xce92('0x37')](handleError(_0x1e3c0d,null));};exports[_0xce92('0x3b')]=function(_0x153222,_0x3eb0a5){if(_0x153222[_0xce92('0x3c')]['type']==='outbound'&&!_[_0xce92('0x3d')](_0x153222[_0xce92('0x3c')][_0xce92('0x3e')],'_')){_0x153222[_0xce92('0x3c')]['exten']='_'[_0xce92('0x3f')](_0x153222['body']['exten']);}return db[_0xce92('0x20')]['create'](_0x153222[_0xce92('0x3c')],{'raw':![]})[_0xce92('0x12')](function(_0xb929ca){var _0x5a1134=_0x153222[_0xce92('0x40')][_0xce92('0x13')]({'plain':!![]});if(!_0x5a1134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a1134['role']==='user'){var _0x1b0214=_0xb929ca['get']({'plain':!![]});var _0x589311=[{'name':_0xce92('0x14'),'value':_0xce92('0x41')},{'name':_0xce92('0x15'),'value':_0xce92('0x16')},{'name':_0xce92('0x17'),'value':'internal'}];var _0x55869a=_[_0xce92('0x3a')](_0x589311,[_0xce92('0x1b'),_0x1b0214[_0xce92('0x23')]])[_0xce92('0x1d')];return db[_0xce92('0x42')][_0xce92('0x3a')]({'where':{'name':_0x55869a,'userProfileId':_0x5a1134[_0xce92('0x43')]},'raw':!![]})['then'](function(_0x5af36d){if(_0x5af36d&&_0x5af36d[_0xce92('0x44')]===0x0){return db[_0xce92('0x45')][_0xce92('0x3b')]({'name':_0x1b0214[_0xce92('0x1d')],'resourceId':_0x1b0214['id'],'type':_0x5af36d[_0xce92('0x1d')],'sectionId':_0x5af36d['id']},{})[_0xce92('0x12')](function(){return _0xb929ca;});}else{return _0xb929ca;}})['catch'](function(_0x4303cc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4303cc);throw _0x4303cc;});}return _0xb929ca;})[_0xce92('0x12')](respondWithResult(_0x3eb0a5,0xc9))[_0xce92('0x37')](handleError(_0x3eb0a5,null));};exports[_0xce92('0x46')]=function(_0x9e773e,_0x1aeeb2){if(_0x9e773e[_0xce92('0x3c')]['id']){delete _0x9e773e[_0xce92('0x3c')]['id'];}return db[_0xce92('0x20')]['find']({'where':{'id':_0x9e773e[_0xce92('0x39')]['id']}})[_0xce92('0x12')](handleEntityNotFound(_0x1aeeb2,null))[_0xce92('0x12')](function(_0x56635a){if(_0x56635a){return db['VoiceExtension'][_0xce92('0x46')](_['pick'](_0x9e773e[_0xce92('0x3c')],[_0xce92('0x3e'),_0xce92('0x47'),_0xce92('0x48'),_0xce92('0x49'),'cutdigits','mandatoryDisposition',_0xce92('0x4a')]),{'where':{'context':_0x56635a[_0xce92('0x47')],'exten':_0x56635a[_0xce92('0x3e')]},'individualHooks':!![]})[_0xce92('0x12')](function(_0x24cfa8){return _0x24cfa8;});}return null;})[_0xce92('0x12')](respondWithStatusCode(_0x1aeeb2,null))[_0xce92('0x37')](handleError(_0x1aeeb2,null));};exports[_0xce92('0x4b')]=function(_0x418249,_0x477a0e){var _0x271cdc=_0x418249[_0xce92('0x39')]['id'];var _0x3c618f=_0x418249[_0xce92('0x3c')];var _0xce1aa0=0xc8;var _0x51b856=null;return db[_0xce92('0x4c')]['transaction']({'isolationLevel':db[_0xce92('0x4c')]['Transaction'][_0xce92('0x4d')][_0xce92('0x4e')]},function(_0xb569b8){return db[_0xce92('0x20')][_0xce92('0x4f')]({'where':{'id':_0x271cdc},'transaction':_0xb569b8})[_0xce92('0x12')](function(_0x4fa647){if(_0x4fa647){return db[_0xce92('0x20')]['destroy']({'where':{'VoiceExtensionId':_0x271cdc},'transaction':_0xb569b8})['then'](function(){var _0x4c86dd=_['map'](_0x3c618f,function(_0x4f0536){_0x4f0536[_0xce92('0x50')]=_0x271cdc;_0x4f0536['isApp']=!![];return _0x4f0536;});return _0x4fa647['createRouting'](_0x4c86dd);})[_0xce92('0x12')](function(_0x27e205){return db[_0xce92('0x20')][_0xce92('0x51')](_0x27e205,{'transaction':_0xb569b8});});}else{_0xce1aa0=0x194;_0x51b856=[];}});})['then'](function(){if(_0xce1aa0!==0x194){return db['VoiceExtension'][_0xce92('0x52')]({'where':{'isApp':!![],'VoiceExtensionId':_0x271cdc},'order':_0xce92('0x53')})[_0xce92('0x12')](function(_0x44657c){_0x51b856=_0x44657c;});}})[_0xce92('0x37')](function(_0x42907c){_0xce1aa0=0x1f4;logger[_0xce92('0x54')](_0x42907c[_0xce92('0x55')]);if(_0x42907c[_0xce92('0x1d')]){delete _0x42907c[_0xce92('0x1d')];}_0x51b856=_0x42907c;})['finally'](function(){if(_0x51b856===null){_0x477a0e[_0xce92('0x9')](_0xce1aa0);}else{if(_0xce1aa0===0x1f4){_0x477a0e[_0xce92('0xb')](_0xce1aa0)['send'](_0x51b856);}else{_0x477a0e[_0xce92('0xb')](_0xce1aa0)['json'](_0x51b856);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2dfb4c4..bd32898 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 _0xc9f7=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xc9f7,0x1de));var _0x7c9f=function(_0x36a672,_0x19252e){_0x36a672=_0x36a672-0x0;var _0x2050e4=_0xc9f7[_0x36a672];return _0x2050e4;};'use strict';var EventEmitter=require(_0x7c9f('0x0'));var VoiceExtension=require(_0x7c9f('0x1'))['db'][_0x7c9f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7c9f('0x3')](0x0);var events={'afterCreate':_0x7c9f('0x4'),'afterUpdate':_0x7c9f('0x5'),'afterDestroy':_0x7c9f('0x6')};function emitEvent(_0x3c6c13){return function(_0x1e129b,_0x4f026f,_0x495266){VoiceExtensionEvents[_0x7c9f('0x7')](_0x3c6c13+':'+_0x1e129b['id'],_0x1e129b);VoiceExtensionEvents[_0x7c9f('0x7')](_0x3c6c13,_0x1e129b);_0x495266(null);};}for(var e in events){if(events[_0x7c9f('0x8')](e)){var event=events[e];VoiceExtension[_0x7c9f('0x9')](e,emitEvent(event));}}module[_0x7c9f('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd4f3=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x43d73f,_0xbf262d){var _0x3dbba4=function(_0x3a5a45){while(--_0x3a5a45){_0x43d73f['push'](_0x43d73f['shift']());}};_0x3dbba4(++_0xbf262d);}(_0xd4f3,0xd8));var _0x3d4f=function(_0x563654,_0x55ed34){_0x563654=_0x563654-0x0;var _0x471c6e=_0xd4f3[_0x563654];return _0x471c6e;};'use strict';var EventEmitter=require(_0x3d4f('0x0'));var VoiceExtension=require(_0x3d4f('0x1'))['db'][_0x3d4f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3d4f('0x3')](0x0);var events={'afterCreate':_0x3d4f('0x4'),'afterUpdate':'update','afterDestroy':_0x3d4f('0x5')};function emitEvent(_0x3c93b5){return function(_0x2f4c3c,_0x5cb28b,_0x38d788){VoiceExtensionEvents[_0x3d4f('0x6')](_0x3c93b5+':'+_0x2f4c3c['id'],_0x2f4c3c);VoiceExtensionEvents[_0x3d4f('0x6')](_0x3c93b5,_0x2f4c3c);_0x38d788(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x3d4f('0x7')](e,emitEvent(event));}}module[_0x3d4f('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 6ecfd5c..e5a4305 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 _0xeec6=['then','length','interval','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','exten','alias','Set','CDR(routeAlias)=','inbound','context','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','name','param','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll'];(function(_0xdb6458,_0x46ca9b){var _0x6014ec=function(_0x1fe58b){while(--_0x1fe58b){_0xdb6458['push'](_0xdb6458['shift']());}};_0x6014ec(++_0x46ca9b);}(_0xeec6,0x1c2));var _0x6eec=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0xeec6[_0x26d386];return _0x4ef9a8;};'use strict';var _=require(_0x6eec('0x0'));var attributes=require(_0x6eec('0x1'));module[_0x6eec('0x2')]=function(_0x33cc53){var _0x535568=_0x33cc53[_0x6eec('0x3')];function _0x3e4f10(_0x1699ce){var _0x2d7a15=0x2;var _0x3e7b6b=[{'type':_0x1699ce[_0x6eec('0x4')],'app':'Set','appdata':_0x6eec('0x5')+_0x1699ce[_0x6eec('0x4')],'context':_0x1699ce['context'],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']},{'type':_0x1699ce[_0x6eec('0x4')],'app':_0x1699ce[_0x6eec('0x7')]?_0x6eec('0x8'):'NoOp','appdata':_0x1699ce[_0x6eec('0x7')]?_0x6eec('0x9')+_0x1699ce[_0x6eec('0x7')]:'No\x20alias\x20set','context':_0x1699ce['context'],'exten':_0x1699ce['exten'],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']}];if(_0x1699ce[_0x6eec('0x4')]===_0x6eec('0xa')){_0x3e7b6b['push']({'type':'inbound','app':_0x6eec('0x8'),'appdata':'CDR(routeid)='+_0x1699ce['id'],'context':_0x1699ce[_0x6eec('0xb')],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']});}_0x3e7b6b[_0x6eec('0xc')]({'type':_0x1699ce[_0x6eec('0x4')],'app':_0x6eec('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1699ce[_0x6eec('0xb')],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']},{'type':_0x1699ce[_0x6eec('0x4')],'app':_0x6eec('0x8'),'appdata':_0x6eec('0xd'),'context':_0x1699ce[_0x6eec('0xb')],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']},{'type':_0x1699ce[_0x6eec('0x4')],'app':_0x6eec('0x8'),'appdata':_0x6eec('0xe'),'context':_0x1699ce['context'],'exten':_0x1699ce[_0x6eec('0x6')],'priority':_0x2d7a15++,'VoiceExtensionId':_0x1699ce['id']});return _0x3e7b6b;}function _0x5f1f33(_0x38c9a4){var _0x45aa3f=0x2;var _0x512619=[{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x10'),'context':_0x38c9a4['context'],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x38c9a4[_0x6eec('0x7')]?_0x6eec('0x8'):_0x6eec('0x11'),'appdata':_0x38c9a4[_0x6eec('0x7')]?'CDR(routeAlias)='+_0x38c9a4[_0x6eec('0x7')]:_0x6eec('0x12'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':'CDR(destination)='+(_0x38c9a4[_0x6eec('0x13')]?_0x6eec('0x14')+_0x38c9a4[_0x6eec('0x13')]+'}':_0x6eec('0x15')),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':'outbound','app':_0x6eec('0x8'),'appdata':_0x6eec('0x16')+_0x38c9a4['id'],'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x17'),'appdata':_0x6eec('0x18')+(_0x45aa3f+0x2)+_0x6eec('0x19')+(_0x45aa3f+0x1)+')','context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4['exten'],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x38c9a4[_0x6eec('0x13')]?_0x6eec('0x1a')+_0x38c9a4['cutdigits']+'}':_0x6eec('0x1b'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4['exten'],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':'outbound','app':_0x6eec('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0xd'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0xe'),'context':_0x38c9a4['context'],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':'outbound','app':_0x6eec('0x8'),'appdata':_0x6eec('0x1c')+_0x38c9a4['id'],'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4['exten'],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']}];if(_0x38c9a4['hasOwnProperty']('recordingFormat')&&_0x38c9a4[_0x6eec('0x1d')]!==_0x6eec('0x1e')){_0x512619[_0x6eec('0xc')]({'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x1f'),'context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']},{'type':_0x6eec('0xf'),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x20')+_0x38c9a4[_0x6eec('0x1d')]||'wav','context':_0x38c9a4[_0x6eec('0xb')],'exten':_0x38c9a4[_0x6eec('0x6')],'priority':_0x45aa3f++,'VoiceExtensionId':_0x38c9a4['id']});}return _0x512619;}function _0x2c83d1(_0x47e169,_0x2ce8c3){var _0x193732=[{'name':_0x6eec('0x21'),'param':0x0},{'name':_0x6eec('0x22'),'param':0x1},{'name':_0x6eec('0x23'),'param':0x2},{'name':_0x6eec('0x24'),'param':0x3}];var _0x4a7699={};var _0x45cfb6=_0x2ce8c3[_0x6eec('0x25')](',');var _0x2f18e9=[];for(var _0x5128ac=0x0;_0x5128ac<_0x193732['length'];_0x5128ac++){switch(_0x193732[_0x5128ac][_0x6eec('0x26')]){case _0x6eec('0x21'):_0x4a7699[_0x6eec('0x21')]=_0x45cfb6[_0x193732[_0x5128ac][_0x6eec('0x27')]][_0x6eec('0x25')]('/')[0x1];_0x4a7699['phone']=_0x45cfb6[_0x193732[_0x5128ac][_0x6eec('0x27')]][_0x6eec('0x25')]('/')[0x2];_0x4a7699[_0x6eec('0x28')]=_0x4a7699[_0x6eec('0x29')]?_0x4a7699[_0x6eec('0x29')][_0x6eec('0x25')]('$')[0x0]:undefined;_0x4a7699[_0x6eec('0x29')]=_0x47e169[_0x6eec('0x13')]?(_0x4a7699['prefix']||'')+_0x6eec('0x14')+_0x47e169[_0x6eec('0x13')]+'}':(_0x4a7699['prefix']||'')+'${EXTEN}';_0x2f18e9[_0x193732[_0x5128ac][_0x6eec('0x27')]]=[_0x6eec('0x2a'),_0x4a7699[_0x6eec('0x21')],_0x4a7699[_0x6eec('0x29')]]['join']('/');break;case'options':_0x4a7699[_0x6eec('0x23')]=_0x45cfb6[_0x193732[_0x5128ac]['param']];if(_0x47e169['recordingFormat']!==_0x6eec('0x1e')){if(_0x4a7699[_0x6eec('0x23')][_0x6eec('0x2b')](_0x6eec('0x2c'))<0x0){_0x4a7699[_0x6eec('0x23')]+='U(xcally-mixmonitor-context)';}}else{_0x4a7699[_0x6eec('0x23')]=_0x4a7699[_0x6eec('0x23')]['replace'](_0x6eec('0x2c'),'');}_0x2f18e9[_0x193732[_0x5128ac][_0x6eec('0x27')]]=_0x4a7699['options'];break;default:_0x2f18e9[_0x193732[_0x5128ac][_0x6eec('0x27')]]=_0x45cfb6[_0x193732[_0x5128ac][_0x6eec('0x27')]];}}return _0x2f18e9['join'](',');}function _0x21115b(_0xb18b55,_0x258ee7,_0x2681f7){return new Promise(function(_0x52af19,_0x7e6b26){var _0x2f797d=[];if(_[_0x6eec('0x2d')](_0x258ee7))return _0x52af19(_0x2f797d);_0x535568[_0x6eec('0x2e')][_0x6eec('0x2f')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x6eec('0x30')](function(_0x3d5c80){for(var _0x3703b5=0x0,_0x18bcc5=0x0;_0x3703b5<_0x258ee7[_0x6eec('0x31')];_0x3703b5++,_0x18bcc5=0x0){var _0x59d7a7=_0x258ee7[_0x3703b5];var _0x194f2e=[];var _0x545f9d=[];delete _0x59d7a7['id'];if(_0x59d7a7[_0x6eec('0x32')]!==_0x6eec('0x33')){_0x59d7a7[_0x6eec('0x34')]=[_0x59d7a7['interval']];}else{_0x59d7a7[_0x6eec('0x34')]=_0x59d7a7[_0x6eec('0x35')]?_[_0x6eec('0x36')](_[_0x6eec('0x37')](_0x3d5c80,{'IntervalId':_0x59d7a7[_0x6eec('0x35')]}),'interval'):[];}_0x59d7a7[_0x6eec('0xb')]=_0xb18b55['context'];_0x59d7a7['exten']=_0xb18b55[_0x6eec('0x6')];if(_0x59d7a7['type'])_0x59d7a7[_0x6eec('0x4')]=_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')]();if(_0xb18b55['type']==='outbound'){if(_0x59d7a7[_0x6eec('0x39')](_0x6eec('0x3a'))&&_0x59d7a7[_0x6eec('0x3a')]&&_0x59d7a7[_0x6eec('0x3a')]!=='--'){_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x3b')+_0x59d7a7[_0x6eec('0x3a')],'context':_0xb18b55['context'],'exten':_0xb18b55['exten'],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7['type'][_0x6eec('0x38')](),'app':_0x6eec('0x17'),'appdata':_0x6eec('0x3c')+(_0x59d7a7[_0x6eec('0x3d')]?_0x6eec('0x3e')+_0x59d7a7[_0x6eec('0x3d')]+')':_0x6eec('0x3f')),'context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55['exten'],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}else{if(_0x59d7a7[_0x6eec('0x39')](_0x6eec('0x40'))){if(['queue','playback']['includes'](_0x59d7a7[_0x6eec('0x41')][_0x6eec('0x38')]())&&_0x59d7a7[_0x6eec('0x42')]!==_0x6eec('0x43')){if(_0x59d7a7['answer']){_0x194f2e['push']({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x17'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55[_0x6eec('0x6')],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x44'),'context':_0xb18b55['context'],'exten':_0xb18b55[_0x6eec('0x6')],'priority':_0x59d7a7['intervals'][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}else{_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7[_0x6eec('0x4')][_0x6eec('0x38')](),'app':_0x6eec('0x17'),'appdata':_0x6eec('0x45'),'context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55['exten'],'priority':_0x59d7a7[_0x6eec('0x34')]['length']+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});_0x194f2e[_0x6eec('0xc')]({'type':_0x59d7a7['type'][_0x6eec('0x38')](),'app':_0x6eec('0x8'),'appdata':_0x6eec('0x46'),'context':_0xb18b55[_0x6eec('0xb')],'exten':_0xb18b55[_0x6eec('0x6')],'priority':_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]+_0x2681f7+_0x18bcc5++,'VoiceExtensionId':_0xb18b55['id']});}}}}for(var _0x2982a8=0x0;_0x2982a8<_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')];_0x2982a8++){var _0x49885e=_0x2681f7+_0x59d7a7['intervals'][_0x6eec('0x31')];var _0x42242d=_0x2982a8===_0x59d7a7[_0x6eec('0x34')][_0x6eec('0x31')]-0x1?_0x2681f7+_0x194f2e[_0x6eec('0x31')]+_0x545f9d['length']+0x2:_0x2681f7+_0x2982a8+0x1;_0x194f2e[_0x6eec('0x47')](_0x2982a8,0x0,{'type':_0xb18b55[_0x6eec('0x4')],'app':'GotoIfTime','appdata':_0x59d7a7['intervals'][_0x2982a8]+'?'+_0xb18b55['context']+_0x6eec('0x48')+_0x49885e+':'+_0xb18b55[_0x6eec('0xb')]+',${EXTEN},'+_0x42242d,'exten':_0xb18b55[_0x6eec('0x6')],'context':_0xb18b55[_0x6eec('0xb')],'priority':_0x2681f7+_0x2982a8,'VoiceExtensionId':_0xb18b55['id']});}if(_0x59d7a7['appType']===_0x6eec('0x49'))_0x59d7a7[_0x6eec('0x4a')]=_0x2c83d1(_0xb18b55,_0x59d7a7[_0x6eec('0x4a')]);_0x59d7a7[_0x6eec('0x4b')]=_0x194f2e['length']?_['last'](_0x194f2e)[_0x6eec('0x4b')]+0x1:_0x2681f7;_0x2f797d=_[_0x6eec('0x4c')](_0x2f797d,_0x194f2e,[_0x59d7a7],_0x545f9d);_0x2681f7=_[_0x6eec('0x4d')](_0x2f797d)[_0x6eec('0x4b')]+0x1;}return _0x52af19(_0x2f797d);})[_0x6eec('0x4e')](function(_0x3d0525){_0x7e6b26(_0x3d0525);});});}return _0x33cc53[_0x6eec('0x4f')](_0x6eec('0x50'),attributes,{'tableName':_0x6eec('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x416d9a){var _0x42f435=this[_0x6eec('0x52')]({'plain':!![]});var _0x2799ca=_0x42f435[_0x6eec('0x4')]===_0x6eec('0xf')?_0x5f1f33(_0x42f435):_0x3e4f10(_0x42f435);return _0x21115b(_0x42f435,_0x416d9a,_[_0x6eec('0x4d')](_0x2799ca)[_0x6eec('0x4b')]+0x1)['then'](function(_0x2ef374){var _0x2236f7=_['concat'](_0x2799ca,_0x2ef374);_0x2236f7[_0x6eec('0xc')]({'type':_0x42f435[_0x6eec('0x4')],'app':'Hangup','exten':_0x42f435[_0x6eec('0x6')],'context':_0x42f435[_0x6eec('0xb')],'priority':_[_0x6eec('0x4d')](_0x2236f7)[_0x6eec('0x4b')]+0x1,'VoiceExtensionId':_0x42f435['id']});return _0x2236f7;});}}});}; \ No newline at end of file +var _0x1d54=['appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','lodash','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','then','length','interval','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','playback','includes','app'];(function(_0x1bc908,_0xd1cc83){var _0x4692b7=function(_0x32e98f){while(--_0x32e98f){_0x1bc908['push'](_0x1bc908['shift']());}};_0x4692b7(++_0xd1cc83);}(_0x1d54,0x100));var _0x41d5=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x1d54[_0x30a31e];return _0x170879;};'use strict';var _=require(_0x41d5('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x41d5('0x1')]=function(_0x80134b){var _0x24cd0b=_0x80134b[_0x41d5('0x2')];function _0x5d1f0e(_0x34b74a){var _0x3666f2=0x2;var _0x4ab969=[{'type':_0x34b74a[_0x41d5('0x3')],'app':_0x41d5('0x4'),'appdata':_0x41d5('0x5')+_0x34b74a[_0x41d5('0x3')],'context':_0x34b74a['context'],'exten':_0x34b74a[_0x41d5('0x6')],'priority':_0x3666f2++,'VoiceExtensionId':_0x34b74a['id']},{'type':_0x34b74a[_0x41d5('0x3')],'app':_0x34b74a[_0x41d5('0x7')]?_0x41d5('0x4'):_0x41d5('0x8'),'appdata':_0x34b74a[_0x41d5('0x7')]?_0x41d5('0x9')+_0x34b74a[_0x41d5('0x7')]:'No\x20alias\x20set','context':_0x34b74a[_0x41d5('0xa')],'exten':_0x34b74a[_0x41d5('0x6')],'priority':_0x3666f2++,'VoiceExtensionId':_0x34b74a['id']}];if(_0x34b74a[_0x41d5('0x3')]===_0x41d5('0xb')){_0x4ab969[_0x41d5('0xc')]({'type':_0x41d5('0xb'),'app':_0x41d5('0x4'),'appdata':_0x41d5('0xd')+_0x34b74a['id'],'context':_0x34b74a['context'],'exten':_0x34b74a[_0x41d5('0x6')],'priority':_0x3666f2++,'VoiceExtensionId':_0x34b74a['id']});}_0x4ab969[_0x41d5('0xc')]({'type':_0x34b74a[_0x41d5('0x3')],'app':_0x41d5('0x4'),'appdata':_0x41d5('0xe'),'context':_0x34b74a[_0x41d5('0xa')],'exten':_0x34b74a['exten'],'priority':_0x3666f2++,'VoiceExtensionId':_0x34b74a['id']},{'type':_0x34b74a[_0x41d5('0x3')],'app':'Set','appdata':_0x41d5('0xf'),'context':_0x34b74a[_0x41d5('0xa')],'exten':_0x34b74a[_0x41d5('0x6')],'priority':_0x3666f2++,'VoiceExtensionId':_0x34b74a['id']},{'type':_0x34b74a[_0x41d5('0x3')],'app':_0x41d5('0x4'),'appdata':_0x41d5('0x10'),'context':_0x34b74a['context'],'exten':_0x34b74a[_0x41d5('0x6')],'priority':_0x3666f2++,'VoiceExtensionId':_0x34b74a['id']});return _0x4ab969;}function _0x1a309e(_0x24a778){var _0x4578ea=0x2;var _0x1a3f97=[{'type':_0x41d5('0x11'),'app':_0x41d5('0x4'),'appdata':_0x41d5('0x12'),'context':_0x24a778['context'],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':_0x24a778[_0x41d5('0x7')]?_0x41d5('0x4'):_0x41d5('0x8'),'appdata':_0x24a778['alias']?_0x41d5('0x9')+_0x24a778[_0x41d5('0x7')]:_0x41d5('0x13'),'context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778['exten'],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':'Set','appdata':_0x41d5('0x14')+(_0x24a778['cutdigits']?_0x41d5('0x15')+_0x24a778[_0x41d5('0x16')]+'}':_0x41d5('0x17')),'context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':'Set','appdata':'CDR(routeid)='+_0x24a778['id'],'context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':'ExecIf','appdata':_0x41d5('0x18')+(_0x4578ea+0x2)+'):Goto('+(_0x4578ea+0x1)+')','context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':'Set','appdata':_0x24a778[_0x41d5('0x16')]?_0x41d5('0x19')+_0x24a778[_0x41d5('0x16')]+'}':'CDR(prefix)=noprefix','context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':'outbound','app':_0x41d5('0x4'),'appdata':_0x41d5('0xe'),'context':_0x24a778['context'],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':_0x41d5('0x4'),'appdata':_0x41d5('0xf'),'context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':'outbound','app':'Set','appdata':_0x41d5('0x10'),'context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':'outbound','app':_0x41d5('0x4'),'appdata':'outboundrouteid='+_0x24a778['id'],'context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']}];if(_0x24a778[_0x41d5('0x1a')](_0x41d5('0x1b'))&&_0x24a778[_0x41d5('0x1b')]!==_0x41d5('0x1c')){_0x1a3f97[_0x41d5('0xc')]({'type':_0x41d5('0x11'),'app':_0x41d5('0x4'),'appdata':_0x41d5('0x1d'),'context':_0x24a778['context'],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']},{'type':_0x41d5('0x11'),'app':'Set','appdata':_0x41d5('0x1e')+_0x24a778['recordingFormat']||'wav','context':_0x24a778[_0x41d5('0xa')],'exten':_0x24a778[_0x41d5('0x6')],'priority':_0x4578ea++,'VoiceExtensionId':_0x24a778['id']});}return _0x1a3f97;}function _0x21600d(_0x2f08e7,_0x489194){var _0x26bbb9=[{'name':_0x41d5('0x1f'),'param':0x0},{'name':_0x41d5('0x20'),'param':0x1},{'name':_0x41d5('0x21'),'param':0x2},{'name':_0x41d5('0x22'),'param':0x3}];var _0x569cb7={};var _0x123c19=_0x489194[_0x41d5('0x23')](',');var _0x90ebc4=[];for(var _0x5bbb83=0x0;_0x5bbb83<_0x26bbb9['length'];_0x5bbb83++){switch(_0x26bbb9[_0x5bbb83][_0x41d5('0x24')]){case'trunk':_0x569cb7[_0x41d5('0x1f')]=_0x123c19[_0x26bbb9[_0x5bbb83]['param']][_0x41d5('0x23')]('/')[0x1];_0x569cb7['phone']=_0x123c19[_0x26bbb9[_0x5bbb83][_0x41d5('0x25')]][_0x41d5('0x23')]('/')[0x2];_0x569cb7[_0x41d5('0x26')]=_0x569cb7[_0x41d5('0x27')]?_0x569cb7[_0x41d5('0x27')]['split']('$')[0x0]:undefined;_0x569cb7[_0x41d5('0x27')]=_0x2f08e7[_0x41d5('0x16')]?(_0x569cb7[_0x41d5('0x26')]||'')+'${EXTEN:'+_0x2f08e7['cutdigits']+'}':(_0x569cb7[_0x41d5('0x26')]||'')+_0x41d5('0x17');_0x90ebc4[_0x26bbb9[_0x5bbb83][_0x41d5('0x25')]]=[_0x41d5('0x28'),_0x569cb7['trunk'],_0x569cb7[_0x41d5('0x27')]][_0x41d5('0x29')]('/');break;case _0x41d5('0x21'):_0x569cb7['options']=_0x123c19[_0x26bbb9[_0x5bbb83][_0x41d5('0x25')]];if(_0x2f08e7[_0x41d5('0x1b')]!==_0x41d5('0x1c')){if(_0x569cb7[_0x41d5('0x21')][_0x41d5('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0x569cb7[_0x41d5('0x21')]+=_0x41d5('0x2b');}}else{_0x569cb7[_0x41d5('0x21')]=_0x569cb7[_0x41d5('0x21')]['replace'](_0x41d5('0x2b'),'');}_0x90ebc4[_0x26bbb9[_0x5bbb83][_0x41d5('0x25')]]=_0x569cb7[_0x41d5('0x21')];break;default:_0x90ebc4[_0x26bbb9[_0x5bbb83][_0x41d5('0x25')]]=_0x123c19[_0x26bbb9[_0x5bbb83]['param']];}}return _0x90ebc4['join'](',');}function _0x1170b8(_0x66fa37,_0x16aebf,_0x5be1e0){return new Promise(function(_0x4c5a69,_0x3d5c7b){var _0x52a489=[];if(_[_0x41d5('0x2c')](_0x16aebf))return _0x4c5a69(_0x52a489);_0x24cd0b['Interval'][_0x41d5('0x2d')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x41d5('0x2e')](function(_0x2cbf42){for(var _0x2ab7c2=0x0,_0x1526e8=0x0;_0x2ab7c2<_0x16aebf[_0x41d5('0x2f')];_0x2ab7c2++,_0x1526e8=0x0){var _0x91bc94=_0x16aebf[_0x2ab7c2];var _0x48fc53=[];var _0x459872=[];delete _0x91bc94['id'];if(_0x91bc94[_0x41d5('0x30')]!==_0x41d5('0x31')){_0x91bc94[_0x41d5('0x32')]=[_0x91bc94[_0x41d5('0x30')]];}else{_0x91bc94[_0x41d5('0x32')]=_0x91bc94[_0x41d5('0x33')]?_[_0x41d5('0x34')](_[_0x41d5('0x35')](_0x2cbf42,{'IntervalId':_0x91bc94[_0x41d5('0x33')]}),_0x41d5('0x30')):[];}_0x91bc94[_0x41d5('0xa')]=_0x66fa37[_0x41d5('0xa')];_0x91bc94[_0x41d5('0x6')]=_0x66fa37[_0x41d5('0x6')];if(_0x91bc94[_0x41d5('0x3')])_0x91bc94[_0x41d5('0x3')]=_0x91bc94[_0x41d5('0x3')][_0x41d5('0x36')]();if(_0x66fa37[_0x41d5('0x3')]===_0x41d5('0x11')){if(_0x91bc94['hasOwnProperty'](_0x41d5('0x37'))&&_0x91bc94[_0x41d5('0x37')]&&_0x91bc94[_0x41d5('0x37')]!=='--'){_0x48fc53['push']({'type':_0x91bc94[_0x41d5('0x3')][_0x41d5('0x36')](),'app':_0x41d5('0x4'),'appdata':'CDR(tag)='+_0x91bc94[_0x41d5('0x37')],'context':_0x66fa37[_0x41d5('0xa')],'exten':_0x66fa37[_0x41d5('0x6')],'priority':_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')]+_0x5be1e0+_0x1526e8++,'VoiceExtensionId':_0x66fa37['id']});}_0x48fc53['push']({'type':_0x91bc94[_0x41d5('0x3')]['toLowerCase'](),'app':_0x41d5('0x38'),'appdata':_0x41d5('0x39')+(_0x91bc94['callerID']?_0x41d5('0x3a')+_0x91bc94[_0x41d5('0x3b')]+')':_0x41d5('0x3c')),'context':_0x66fa37[_0x41d5('0xa')],'exten':_0x66fa37[_0x41d5('0x6')],'priority':_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')]+_0x5be1e0+_0x1526e8++,'VoiceExtensionId':_0x66fa37['id']});}else{if(_0x91bc94[_0x41d5('0x1a')]('answer')){if(['queue',_0x41d5('0x3d')][_0x41d5('0x3e')](_0x91bc94[_0x41d5('0x3f')]['toLowerCase']())&&_0x91bc94[_0x41d5('0x40')]!==_0x41d5('0x41')){if(_0x91bc94['answer']){_0x48fc53[_0x41d5('0xc')]({'type':_0x91bc94[_0x41d5('0x3')][_0x41d5('0x36')](),'app':_0x41d5('0x38'),'appdata':_0x41d5('0x42'),'context':_0x66fa37['context'],'exten':_0x66fa37[_0x41d5('0x6')],'priority':_0x91bc94['intervals'][_0x41d5('0x2f')]+_0x5be1e0+_0x1526e8++,'VoiceExtensionId':_0x66fa37['id']});_0x48fc53[_0x41d5('0xc')]({'type':_0x91bc94[_0x41d5('0x3')][_0x41d5('0x36')](),'app':_0x41d5('0x4'),'appdata':_0x41d5('0x43'),'context':_0x66fa37['context'],'exten':_0x66fa37[_0x41d5('0x6')],'priority':_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')]+_0x5be1e0+_0x1526e8++,'VoiceExtensionId':_0x66fa37['id']});}else{_0x48fc53['push']({'type':_0x91bc94['type'][_0x41d5('0x36')](),'app':_0x41d5('0x38'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x66fa37['context'],'exten':_0x66fa37[_0x41d5('0x6')],'priority':_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')]+_0x5be1e0+_0x1526e8++,'VoiceExtensionId':_0x66fa37['id']});_0x48fc53[_0x41d5('0xc')]({'type':_0x91bc94[_0x41d5('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x41d5('0x44'),'context':_0x66fa37[_0x41d5('0xa')],'exten':_0x66fa37[_0x41d5('0x6')],'priority':_0x91bc94['intervals'][_0x41d5('0x2f')]+_0x5be1e0+_0x1526e8++,'VoiceExtensionId':_0x66fa37['id']});}}}}for(var _0x4a6f51=0x0;_0x4a6f51<_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')];_0x4a6f51++){var _0x4f65da=_0x5be1e0+_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')];var _0x27996b=_0x4a6f51===_0x91bc94[_0x41d5('0x32')][_0x41d5('0x2f')]-0x1?_0x5be1e0+_0x48fc53[_0x41d5('0x2f')]+_0x459872[_0x41d5('0x2f')]+0x2:_0x5be1e0+_0x4a6f51+0x1;_0x48fc53[_0x41d5('0x45')](_0x4a6f51,0x0,{'type':_0x66fa37['type'],'app':'GotoIfTime','appdata':_0x91bc94[_0x41d5('0x32')][_0x4a6f51]+'?'+_0x66fa37[_0x41d5('0xa')]+_0x41d5('0x46')+_0x4f65da+':'+_0x66fa37['context']+_0x41d5('0x46')+_0x27996b,'exten':_0x66fa37[_0x41d5('0x6')],'context':_0x66fa37['context'],'priority':_0x5be1e0+_0x4a6f51,'VoiceExtensionId':_0x66fa37['id']});}if(_0x91bc94[_0x41d5('0x40')]==='outboundDial')_0x91bc94['appdata']=_0x21600d(_0x66fa37,_0x91bc94['appdata']);_0x91bc94[_0x41d5('0x47')]=_0x48fc53[_0x41d5('0x2f')]?_[_0x41d5('0x48')](_0x48fc53)[_0x41d5('0x47')]+0x1:_0x5be1e0;_0x52a489=_['concat'](_0x52a489,_0x48fc53,[_0x91bc94],_0x459872);_0x5be1e0=_[_0x41d5('0x48')](_0x52a489)[_0x41d5('0x47')]+0x1;}return _0x4c5a69(_0x52a489);})[_0x41d5('0x49')](function(_0x11f2ab){_0x3d5c7b(_0x11f2ab);});});}return _0x80134b[_0x41d5('0x4a')](_0x41d5('0x4b'),attributes,{'tableName':_0x41d5('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4526d8){var _0x233041=this[_0x41d5('0x4d')]({'plain':!![]});var _0x9a983a=_0x233041[_0x41d5('0x3')]===_0x41d5('0x11')?_0x1a309e(_0x233041):_0x5d1f0e(_0x233041);return _0x1170b8(_0x233041,_0x4526d8,_[_0x41d5('0x48')](_0x9a983a)[_0x41d5('0x47')]+0x1)[_0x41d5('0x2e')](function(_0x35e748){var _0x36fc3f=_[_0x41d5('0x4e')](_0x9a983a,_0x35e748);_0x36fc3f[_0x41d5('0xc')]({'type':_0x233041['type'],'app':_0x41d5('0x4f'),'exten':_0x233041[_0x41d5('0x6')],'context':_0x233041[_0x41d5('0xa')],'priority':_[_0x41d5('0x48')](_0x36fc3f)[_0x41d5('0x47')]+0x1,'VoiceExtensionId':_0x233041['id']});return _0x36fc3f;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index e631003..de81307 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 _0xf9d5=['model','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','include','map'];(function(_0x32cd64,_0x58a56a){var _0x127d82=function(_0x1f2c0a){while(--_0x1f2c0a){_0x32cd64['push'](_0x32cd64['shift']());}};_0x127d82(++_0x58a56a);}(_0xf9d5,0x122));var _0x5f9d=function(_0xc129bd,_0x576bd2){_0xc129bd=_0xc129bd-0x0;var _0x26034d=_0xf9d5[_0xc129bd];return _0x26034d;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var moment=require(_0x5f9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f9d('0x2'));var fs=require('fs');var Redis=require(_0x5f9d('0x3'));var db=require(_0x5f9d('0x4'))['db'];var utils=require(_0x5f9d('0x5'));var logger=require(_0x5f9d('0x6'))(_0x5f9d('0x7'));var config=require(_0x5f9d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f9d('0x9')]['http']({'port':0x232a});config[_0x5f9d('0xa')]=_[_0x5f9d('0xb')](config['redis'],{'host':_0x5f9d('0xc'),'port':0x18eb});var socket=require(_0x5f9d('0xd'))(new Redis(config[_0x5f9d('0xa')]));require(_0x5f9d('0xe'))[_0x5f9d('0xf')](socket);function respondWithRpcPromise(_0x9757ba,_0x54e472,_0x156129){return new BPromise(function(_0x211098,_0x597974){return client['request'](_0x9757ba,_0x156129)[_0x5f9d('0x10')](function(_0x261a17){logger[_0x5f9d('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x54e472,_0x5f9d('0x12'));logger[_0x5f9d('0x13')](_0x5f9d('0x14'),_0x54e472,_0x5f9d('0x12'),JSON['stringify'](_0x261a17));if(_0x261a17[_0x5f9d('0x15')]){if(_0x261a17[_0x5f9d('0x15')][_0x5f9d('0x16')]===0x1f4){logger['error'](_0x5f9d('0x17'),_0x54e472,_0x261a17[_0x5f9d('0x15')]['message']);return _0x597974(_0x261a17['error'][_0x5f9d('0x18')]);}logger[_0x5f9d('0x15')](_0x5f9d('0x17'),_0x54e472,_0x261a17[_0x5f9d('0x15')][_0x5f9d('0x18')]);return _0x211098(_0x261a17['error']['message']);}else{logger['info'](_0x5f9d('0x17'),_0x54e472,'request\x20sent');_0x211098(_0x261a17[_0x5f9d('0x19')]['message']);}})[_0x5f9d('0x1a')](function(_0x453285){logger[_0x5f9d('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x54e472,_0x453285);_0x597974(_0x453285);});});}exports[_0x5f9d('0x1b')]=function(_0x16de94){var _0x3a2999=this;return new Promise(function(_0x1e51d7,_0x320182){return db[_0x5f9d('0x1c')][_0x5f9d('0x1d')]({'raw':_0x16de94[_0x5f9d('0x1e')]?_0x16de94[_0x5f9d('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x16de94['options']?_0x16de94['options'][_0x5f9d('0x1f')]||null:null,'attributes':_0x16de94['options']?_0x16de94[_0x5f9d('0x1e')]['attributes']||null:null,'limit':_0x16de94[_0x5f9d('0x1e')]?_0x16de94['options']['limit']||null:null,'include':_0x16de94['options']?_0x16de94[_0x5f9d('0x1e')][_0x5f9d('0x20')]?_[_0x5f9d('0x21')](_0x16de94[_0x5f9d('0x1e')]['include'],function(_0x379d2d){return{'model':db[_0x379d2d[_0x5f9d('0x22')]],'as':_0x379d2d['as'],'attributes':_0x379d2d[_0x5f9d('0x23')],'include':_0x379d2d[_0x5f9d('0x20')]?_[_0x5f9d('0x21')](_0x379d2d[_0x5f9d('0x20')],function(_0x2d66cc){return{'model':db[_0x2d66cc[_0x5f9d('0x22')]],'as':_0x2d66cc['as'],'attributes':_0x2d66cc[_0x5f9d('0x23')],'include':_0x2d66cc[_0x5f9d('0x20')]?_['map'](_0x2d66cc[_0x5f9d('0x20')],function(_0x1b9054){return{'model':db[_0x1b9054[_0x5f9d('0x22')]],'as':_0x1b9054['as'],'attributes':_0x1b9054[_0x5f9d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5f9d('0x10')](function(_0x24233e){logger[_0x5f9d('0x11')](_0x5f9d('0x1b'),_0x16de94);logger[_0x5f9d('0x13')]('GetVoiceExtension',_0x16de94,JSON['stringify'](_0x24233e));_0x1e51d7(_0x24233e);})['catch'](function(_0x118f77){logger['error'](_0x5f9d('0x1b'),_0x118f77['message'],_0x16de94);_0x320182(_0x3a2999[_0x5f9d('0x15')](0x1f4,_0x118f77['message']));});});}; \ No newline at end of file +var _0xe7de=['attributes','limit','map','include','model','GetVoiceExtension','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceExtension','options','raw','where'];(function(_0xd206ce,_0x3031d2){var _0x5b3ec6=function(_0x526993){while(--_0x526993){_0xd206ce['push'](_0xd206ce['shift']());}};_0x5b3ec6(++_0x3031d2);}(_0xe7de,0x165));var _0xee7d=function(_0x496d16,_0x4202ae){_0x496d16=_0x496d16-0x0;var _0x491da4=_0xe7de[_0x496d16];return _0x491da4;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var moment=require(_0xee7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7d('0x3'));var db=require(_0xee7d('0x4'))['db'];var utils=require(_0xee7d('0x5'));var logger=require(_0xee7d('0x6'))(_0xee7d('0x7'));var config=require(_0xee7d('0x8'));var jayson=require(_0xee7d('0x9'));var client=jayson[_0xee7d('0xa')][_0xee7d('0xb')]({'port':0x232a});config[_0xee7d('0xc')]=_[_0xee7d('0xd')](config[_0xee7d('0xc')],{'host':_0xee7d('0xe'),'port':0x18eb});var socket=require(_0xee7d('0xf'))(new Redis(config['redis']));require(_0xee7d('0x10'))[_0xee7d('0x11')](socket);function respondWithRpcPromise(_0x44e6ef,_0x474c53,_0x146172){return new BPromise(function(_0x36e00f,_0x598421){return client[_0xee7d('0x12')](_0x44e6ef,_0x146172)['then'](function(_0x1bf8af){logger[_0xee7d('0x13')](_0xee7d('0x14'),_0x474c53,_0xee7d('0x15'));logger[_0xee7d('0x16')](_0xee7d('0x17'),_0x474c53,_0xee7d('0x15'),JSON[_0xee7d('0x18')](_0x1bf8af));if(_0x1bf8af[_0xee7d('0x19')]){if(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1a')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x474c53,_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);return _0x598421(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);}logger[_0xee7d('0x19')](_0xee7d('0x14'),_0x474c53,_0x1bf8af['error'][_0xee7d('0x1b')]);return _0x36e00f(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);}else{logger[_0xee7d('0x13')](_0xee7d('0x14'),_0x474c53,_0xee7d('0x15'));_0x36e00f(_0x1bf8af['result'][_0xee7d('0x1b')]);}})[_0xee7d('0x1c')](function(_0x3facfb){logger['error'](_0xee7d('0x14'),_0x474c53,_0x3facfb);_0x598421(_0x3facfb);});});}exports['GetVoiceExtension']=function(_0x1ef8ea){var _0x34209e=this;return new Promise(function(_0x2eb283,_0x4f6445){return db[_0xee7d('0x1d')]['findAll']({'raw':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea['options'][_0xee7d('0x20')]||null:null,'attributes':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x21')]||null:null,'limit':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x22')]||null:null,'include':_0x1ef8ea[_0xee7d('0x1e')]?_0x1ef8ea[_0xee7d('0x1e')]['include']?_[_0xee7d('0x23')](_0x1ef8ea[_0xee7d('0x1e')][_0xee7d('0x24')],function(_0x576d56){return{'model':db[_0x576d56[_0xee7d('0x25')]],'as':_0x576d56['as'],'attributes':_0x576d56[_0xee7d('0x21')],'include':_0x576d56[_0xee7d('0x24')]?_[_0xee7d('0x23')](_0x576d56[_0xee7d('0x24')],function(_0x1b4492){return{'model':db[_0x1b4492[_0xee7d('0x25')]],'as':_0x1b4492['as'],'attributes':_0x1b4492[_0xee7d('0x21')],'include':_0x1b4492[_0xee7d('0x24')]?_['map'](_0x1b4492[_0xee7d('0x24')],function(_0x4e1bf5){return{'model':db[_0x4e1bf5['model']],'as':_0x4e1bf5['as'],'attributes':_0x4e1bf5[_0xee7d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x151094){logger[_0xee7d('0x13')]('GetVoiceExtension',_0x1ef8ea);logger[_0xee7d('0x16')](_0xee7d('0x26'),_0x1ef8ea,JSON[_0xee7d('0x18')](_0x151094));_0x2eb283(_0x151094);})[_0xee7d('0x1c')](function(_0xcbfec4){logger['error'](_0xee7d('0x26'),_0xcbfec4[_0xee7d('0x1b')],_0x1ef8ea);_0x4f6445(_0x34209e[_0xee7d('0x19')](0x1f4,_0xcbfec4[_0xee7d('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 7a53c5c..02371d6 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 _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x29336a,_0x9df524){var _0x3433ea=function(_0x4240ce){while(--_0x4240ce){_0x29336a['push'](_0x29336a['shift']());}};_0x3433ea(++_0x9df524);}(_0xf494,0x1c6));var _0x4f49=function(_0x4a9909,_0x49ea07){_0x4a9909=_0x4a9909-0x0;var _0x2c82f3=_0xf494[_0x4a9909];return _0x2c82f3;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x577ae0,_0x47922c){var _0x15fdbe=function(_0x1dce09){while(--_0x1dce09){_0x577ae0['push'](_0x577ae0['shift']());}};_0x15fdbe(++_0x47922c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index aafecde..ae68a82 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 _0x0a6b=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','/:id','show','getMessages','post','create','delete','destroy','exports','multer','express'];(function(_0x14f050,_0x46bc3e){var _0x17e2b7=function(_0x42b3e9){while(--_0x42b3e9){_0x14f050['push'](_0x14f050['shift']());}};_0x17e2b7(++_0x46bc3e);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x5a0a64,_0x5c418d){_0x5a0a64=_0x5a0a64-0x0;var _0x35d769=_0x0a6b[_0x5a0a64];return _0x35d769;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')]('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0xc')]);router['put'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller['update']);router[_0xb0a6('0xd')](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0xe')]);module[_0xb0a6('0xf')]=router; \ No newline at end of file +var _0xa6b0=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x2fe21c,_0x372ec7){var _0x8f82a5=function(_0xca7e02){while(--_0xca7e02){_0x2fe21c['push'](_0x2fe21c['shift']());}};_0x8f82a5(++_0x372ec7);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x4c13f1,_0x3f4b0b){_0x4c13f1=_0x4c13f1-0x0;var _0x10a88a=_0xa6b0[_0x4c13f1];return _0x10a88a;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0a6b('0xe')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);module[_0x0a6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 1b59e01..97066f3 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 _0x9b66=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x9b66,0x18c));var _0x69b6=function(_0x50c144,_0x19cab2){_0x50c144=_0x50c144-0x0;var _0x231f97=_0x9b66[_0x50c144];return _0x231f97;};'use strict';var Sequelize=require(_0x69b6('0x0'));module[_0x69b6('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x69b6('0x2')],'defaultValue':_0x69b6('0x3'),'unique':_0x69b6('0x4')},'mailbox':{'type':Sequelize[_0x69b6('0x2')],'defaultValue':'','allowNull':![],'unique':_0x69b6('0x4')},'password':{'type':Sequelize[_0x69b6('0x2')]},'fullname':{'type':Sequelize[_0x69b6('0x2')]},'email':{'type':Sequelize[_0x69b6('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5f1523){this[_0x69b6('0x5')](_0x69b6('0x6'),typeof _0x5f1523===_0x69b6('0x7')&&_0x5f1523['trim']()?_0x5f1523['trim']():null);}},'pager':{'type':Sequelize[_0x69b6('0x2')]},'tz':{'type':Sequelize[_0x69b6('0x2')],'defaultValue':_0x69b6('0x8')},'attach':{'type':Sequelize[_0x69b6('0x9')]('yes','no'),'defaultValue':_0x69b6('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':_0x69b6('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x69b6('0x2')]},'callback':{'type':Sequelize[_0x69b6('0x2')]},'review':{'type':Sequelize['ENUM'](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x69b6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x69b6('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x69b6('0xa'),'no'),'defaultValue':_0x69b6('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x69b6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x69b6('0x9')](_0x69b6('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x69b6('0xc')},'emailsubject':{'type':Sequelize[_0x69b6('0x2')]},'emailbody':{'type':Sequelize[_0x69b6('0x2')]},'maxsecs':{'type':Sequelize[_0x69b6('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x69b6('0xe')](_0x69b6('0xf'))+_0x69b6('0x10')+this[_0x69b6('0xe')](_0x69b6('0x11'));}}}; \ No newline at end of file +var _0x3188=['getDataValue','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3188,0x112));var _0x8318=function(_0x39ec63,_0x346199){_0x39ec63=_0x39ec63-0x0;var _0x5802e1=_0x3188[_0x39ec63];return _0x5802e1;};'use strict';var Sequelize=require('sequelize');module[_0x8318('0x0')]={'customer_id':{'type':Sequelize[_0x8318('0x1')]},'context':{'type':Sequelize[_0x8318('0x1')],'defaultValue':'from-voicemail','unique':_0x8318('0x2')},'mailbox':{'type':Sequelize[_0x8318('0x1')],'defaultValue':'','allowNull':![],'unique':_0x8318('0x2')},'password':{'type':Sequelize[_0x8318('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8318('0x1')],'validate':{'isEmail':!![]},'set':function(_0x32d73a){this[_0x8318('0x3')](_0x8318('0x4'),typeof _0x32d73a===_0x8318('0x5')&&_0x32d73a[_0x8318('0x6')]()?_0x32d73a[_0x8318('0x6')]():null);}},'pager':{'type':Sequelize[_0x8318('0x1')]},'tz':{'type':Sequelize[_0x8318('0x1')],'defaultValue':_0x8318('0x7')},'attach':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':_0x8318('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':_0x8318('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8318('0x1')]},'callback':{'type':Sequelize[_0x8318('0x1')]},'review':{'type':Sequelize[_0x8318('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8318('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8318('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x8318('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8318('0x8')](_0x8318('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x8318('0x9'),'no'),'defaultValue':_0x8318('0x9'),'allowNull':![]},'stamp':{'type':_0x8318('0xa')},'emailsubject':{'type':Sequelize[_0x8318('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x8318('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8318('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8318('0xc')],'get':function(){return this['getDataValue'](_0x8318('0xd'))+_0x8318('0xe')+this[_0x8318('0xf')](_0x8318('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index af1ebf2..82577f1 100644 --- a/server/api/voiceMail/voiceMail.controller.js +++ b/server/api/voiceMail/voiceMail.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8c=['create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','Voicemails','UserProfileResource','destroy','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch'];(function(_0x20c2ab,_0x1ab893){var _0x58fefd=function(_0x46eec4){while(--_0x46eec4){_0x20c2ab['push'](_0x20c2ab['shift']());}};_0x58fefd(++_0x1ab893);}(_0x3f8c,0x104));var _0xc3f8=function(_0x4e36f2,_0x57d095){_0x4e36f2=_0x4e36f2-0x0;var _0x2d99e9=_0x3f8c[_0x4e36f2];return _0x2d99e9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){var _0x3f196d=_0x2559a4['get']({'plain':!![]});var _0x4569c2=_0xc3f8('0x22');return db[_0xc3f8('0x23')][_0xc3f8('0x24')]({'where':{'type':_0x4569c2,'resourceId':_0x3f196d['id']}})[_0xc3f8('0x21')](function(){return _0x2559a4;});})[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)[_0xc3f8('0x18')]();});}};}function handleEntityNotFound(_0x21b002,_0xbea3b8){return function(_0x22c8e6){if(!_0x22c8e6){_0x21b002[_0xc3f8('0x16')](0x194);}return _0x22c8e6;};}function handleError(_0x238ff5,_0x429fd8){_0x429fd8=_0x429fd8||0x1f4;return function(_0x59e4dd){logger[_0xc3f8('0x25')](_0x59e4dd[_0xc3f8('0x26')]);if(_0x59e4dd[_0xc3f8('0x27')]){delete _0x59e4dd['name'];}_0x238ff5[_0xc3f8('0x17')](_0x429fd8)['send'](_0x59e4dd);};}exports[_0xc3f8('0x28')]=function(_0x32343e,_0x47ab53){var _0x48b32e={},_0x21a225={},_0x25df65={'count':0x0,'rows':[]};var _0xd32b09=_[_0xc3f8('0x29')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')],function(_0x680047){return{'name':_0x680047[_0xc3f8('0x2c')],'type':_0x680047[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x21a225['model']=_[_0xc3f8('0x29')](_0xd32b09,_0xc3f8('0x27'));_0x21a225[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x32343e[_0xc3f8('0x2f')]);_0x21a225['filters']=_['intersection'](_0x21a225[_0xc3f8('0x31')],_0x21a225[_0xc3f8('0x2f')]);_0x48b32e[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x21a225[_0xc3f8('0x31')],qs['fields'](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x48b32e[_0xc3f8('0x32')]=_0x48b32e['attributes'][_0xc3f8('0x35')]?_0x48b32e[_0xc3f8('0x32')]:_0x21a225[_0xc3f8('0x31')];if(!_0x32343e['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x48b32e['limit']=qs[_0xc3f8('0x1b')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x48b32e[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x32343e[_0xc3f8('0x2f')]['offset']);}_0x48b32e[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x48b32e[_0xc3f8('0x3a')]=qs['filters'](_[_0xc3f8('0x3b')](_0x32343e[_0xc3f8('0x2f')],_0x21a225[_0xc3f8('0x3c')]),_0xd32b09);if(_0x32343e['query'][_0xc3f8('0x3d')]){_0x48b32e[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x48b32e[_0xc3f8('0x3a')],{'$or':_['map'](_0xd32b09,function(_0x306182){if(_0x306182[_0xc3f8('0x2d')]!==_0xc3f8('0x3f')){var _0x37b104={};_0x37b104[_0x306182['name']]={'$like':'%'+_0x32343e[_0xc3f8('0x2f')]['filter']+'%'};return _0x37b104;}})});}_0x48b32e=_['merge']({},_0x48b32e,_0x32343e[_0xc3f8('0x40')]);var _0x1f3aef={'where':_0x48b32e[_0xc3f8('0x3a')]};return db[_0xc3f8('0x2a')]['count'](_0x1f3aef)['then'](function(_0x361a85){_0x25df65[_0xc3f8('0x1c')]=_0x361a85;if(_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x48b32e[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x2a')][_0xc3f8('0x43')](_0x48b32e);})[_0xc3f8('0x21')](function(_0x13d8dc){_0x25df65[_0xc3f8('0x44')]=_0x13d8dc;return _0x25df65;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x47ab53,_0x48b32e))['catch'](handleError(_0x47ab53,null));};exports[_0xc3f8('0x45')]=function(_0x22e9b3,_0x4b327f){var _0x1aff20={'raw':!![],'where':{'id':_0x22e9b3['params']['id']}},_0x172f1a={};_0x172f1a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')]);_0x172f1a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x22e9b3[_0xc3f8('0x2f')]);_0x172f1a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],_0x172f1a[_0xc3f8('0x2f')]);_0x1aff20['attributes']=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],qs['fields'](_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1aff20[_0xc3f8('0x32')]=_0x1aff20[_0xc3f8('0x32')]['length']?_0x1aff20['attributes']:_0x172f1a[_0xc3f8('0x31')];if(_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1aff20['include']=[{'all':!![]}];}_0x1aff20=_[_0xc3f8('0x3e')]({},_0x1aff20,_0x22e9b3[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x46')](_0x1aff20)[_0xc3f8('0x21')](handleEntityNotFound(_0x4b327f,null))['then'](respondWithResult(_0x4b327f,null))[_0xc3f8('0x47')](handleError(_0x4b327f,null));};exports[_0xc3f8('0x48')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_0x5961ab[_0xc3f8('0x49')],{})[_0xc3f8('0x21')](function(_0x3045bc){var _0x1ca7c9=_0x5961ab['user'][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x1ca7c9)throw new Error(_0xc3f8('0x4b'));if(_0x1ca7c9['role']===_0xc3f8('0x4c')){var _0x2e9f93=_0x3045bc[_0xc3f8('0x4a')]({'plain':!![]});var _0x33e5c5=_0xc3f8('0x22');return db[_0xc3f8('0x4d')][_0xc3f8('0x46')]({'where':{'name':_0x33e5c5,'userProfileId':_0x1ca7c9['userProfileId']},'raw':!![]})[_0xc3f8('0x21')](function(_0x2c6999){if(_0x2c6999&&_0x2c6999[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x2e9f93[_0xc3f8('0x27')],'resourceId':_0x2e9f93['id'],'type':_0x2c6999[_0xc3f8('0x27')],'sectionId':_0x2c6999['id']},{})[_0xc3f8('0x21')](function(){return _0x3045bc;});}else{return _0x3045bc;}})['catch'](function(_0x51249a){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x51249a);throw _0x51249a;});}return _0x3045bc;})['then'](respondWithResult(_0x1becae,0xc9))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x20')]=function(_0x4b4adb,_0x1b1e13){if(_0x4b4adb[_0xc3f8('0x49')]['id']){delete _0x4b4adb[_0xc3f8('0x49')]['id'];}return db['VoiceMail'][_0xc3f8('0x46')]({'where':{'id':_0x4b4adb['params']['id']}})['then'](handleEntityNotFound(_0x1b1e13,null))[_0xc3f8('0x21')](saveUpdates(_0x4b4adb['body'],null))[_0xc3f8('0x21')](respondWithResult(_0x1b1e13,null))[_0xc3f8('0x47')](handleError(_0x1b1e13,null));};exports[_0xc3f8('0x24')]=function(_0x490f37,_0xcb45c1){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x490f37[_0xc3f8('0x50')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0xcb45c1,null))['then'](removeEntity(_0xcb45c1,null))['catch'](handleError(_0xcb45c1,null));};exports[_0xc3f8('0x51')]=function(_0x326dcc,_0x2f1b68,_0x3a268d){return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x326dcc[_0xc3f8('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f1b68,null))[_0xc3f8('0x21')](function(_0x337029){var _0x163264;var _0xd5d6a7={},_0x5c6f6e={};_0x5c6f6e[_0xc3f8('0x31')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x5c6f6e['query']=_[_0xc3f8('0x30')](_0x326dcc[_0xc3f8('0x2f')]);_0x5c6f6e[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x5c6f6e[_0xc3f8('0x31')],_0x5c6f6e[_0xc3f8('0x2f')]);_0xd5d6a7[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x5c6f6e['model'],qs[_0xc3f8('0x34')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0xd5d6a7[_0xc3f8('0x32')]=_0xd5d6a7[_0xc3f8('0x32')]['length']?_0xd5d6a7[_0xc3f8('0x32')]:_0x5c6f6e[_0xc3f8('0x31')];if(!_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0xd5d6a7['limit']=qs[_0xc3f8('0x1b')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0xd5d6a7[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x326dcc[_0xc3f8('0x2f')]['offset']);}_0xd5d6a7[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x326dcc[_0xc3f8('0x2f')]['sort']);_0xd5d6a7[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_['pick'](_0x326dcc['query'],_0x5c6f6e[_0xc3f8('0x3c')]));if(_0x326dcc[_0xc3f8('0x2f')]['filter']){_0xd5d6a7[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0xd5d6a7[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0xd5d6a7[_0xc3f8('0x32')],function(_0x30a23a){var _0x1e62ec={};_0x1e62ec[_0x30a23a]={'$like':'%'+_0x326dcc[_0xc3f8('0x2f')]['filter']+'%'};return _0x1e62ec;})});}_0xd5d6a7['where']=_[_0xc3f8('0x3e')](_0xd5d6a7['where'],{'mailboxuser':_0x337029['mailbox']});_0xd5d6a7=_['merge']({},_0xd5d6a7,_0x326dcc['options']);return db['VoiceMailMessage'][_0xc3f8('0x52')](_0xd5d6a7)[_0xc3f8('0x21')](respondWithFilteredResult(_0x2f1b68,_0xd5d6a7));})[_0xc3f8('0x47')](handleError(_0x2f1b68,null));}; \ No newline at end of file +var _0x7072=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields'];(function(_0x47c156,_0xe8df6d){var _0x57eadd=function(_0x518275){while(--_0x518275){_0x47c156['push'](_0x47c156['shift']());}};_0x57eadd(++_0xe8df6d);}(_0x7072,0x138));var _0x2707=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x7072[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){var _0x4831ed=_0x369e3a[_0x2707('0x2a')]({'plain':!![]});var _0x3f6976=_0x2707('0x2b');return db[_0x2707('0x2c')][_0x2707('0x28')]({'where':{'type':_0x3f6976,'resourceId':_0x4831ed['id']}})['then'](function(){return _0x369e3a;});})[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x34dc4e,_0x2aa3fe){return function(_0x57da26){if(!_0x57da26){_0x34dc4e[_0x2707('0x1a')](0x194);}return _0x57da26;};}function handleError(_0x14daf8,_0x2c7047){_0x2c7047=_0x2c7047||0x1f4;return function(_0x529be8){logger[_0x2707('0x2d')](_0x529be8[_0x2707('0x2e')]);if(_0x529be8['name']){delete _0x529be8[_0x2707('0x2f')];}_0x14daf8['status'](_0x2c7047)['send'](_0x529be8);};}exports[_0x2707('0x30')]=function(_0x4e0c93,_0x2a0d24){var _0x3f153d={},_0x417a97={},_0x36b2e9={'count':0x0,'rows':[]};var _0x48832b=_[_0x2707('0x31')](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x154799){return{'name':_0x154799[_0x2707('0x34')],'type':_0x154799[_0x2707('0x35')][_0x2707('0x36')]};});_0x417a97[_0x2707('0x37')]=_[_0x2707('0x31')](_0x48832b,'name');_0x417a97[_0x2707('0x38')]=_[_0x2707('0x39')](_0x4e0c93['query']);_0x417a97['filters']=_['intersection'](_0x417a97['model'],_0x417a97['query']);_0x3f153d[_0x2707('0x3a')]=_['intersection'](_0x417a97['model'],qs[_0x2707('0x3b')](_0x4e0c93[_0x2707('0x38')]['fields']));_0x3f153d[_0x2707('0x3a')]=_0x3f153d[_0x2707('0x3a')]['length']?_0x3f153d['attributes']:_0x417a97[_0x2707('0x37')];if(!_0x4e0c93[_0x2707('0x38')]['hasOwnProperty']('nolimit')){_0x3f153d[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x4e0c93['query'][_0x2707('0x1f')]);_0x3f153d[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x4e0c93[_0x2707('0x38')][_0x2707('0x1d')]);}_0x3f153d[_0x2707('0x3c')]=qs['sort'](_0x4e0c93[_0x2707('0x38')][_0x2707('0x3d')]);_0x3f153d[_0x2707('0x3e')]=qs[_0x2707('0x3f')](_[_0x2707('0x40')](_0x4e0c93[_0x2707('0x38')],_0x417a97[_0x2707('0x3f')]),_0x48832b);if(_0x4e0c93['query'][_0x2707('0x41')]){_0x3f153d[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x3f153d[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x48832b,function(_0xc7119d){if(_0xc7119d[_0x2707('0x35')]!==_0x2707('0x43')){var _0x2f06f8={};_0x2f06f8[_0xc7119d[_0x2707('0x2f')]]={'$like':'%'+_0x4e0c93[_0x2707('0x38')][_0x2707('0x41')]+'%'};return _0x2f06f8;}})});}_0x3f153d=_[_0x2707('0x42')]({},_0x3f153d,_0x4e0c93[_0x2707('0x44')]);var _0x36c8ab={'where':_0x3f153d[_0x2707('0x3e')]};return db['VoiceMail'][_0x2707('0x20')](_0x36c8ab)[_0x2707('0x29')](function(_0x5053ba){_0x36b2e9[_0x2707('0x20')]=_0x5053ba;if(_0x4e0c93['query'][_0x2707('0x45')]){_0x3f153d[_0x2707('0x46')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x47')](_0x3f153d);})[_0x2707('0x29')](function(_0xdeec24){_0x36b2e9[_0x2707('0x48')]=_0xdeec24;return _0x36b2e9;})['then'](respondWithFilteredResult(_0x2a0d24,_0x3f153d))[_0x2707('0x49')](handleError(_0x2a0d24,null));};exports[_0x2707('0x4a')]=function(_0x4c8dbf,_0x3d25ea){var _0x6defc2={'raw':!![],'where':{'id':_0x4c8dbf['params']['id']}},_0x3b38d7={};_0x3b38d7['model']=_[_0x2707('0x39')](db[_0x2707('0x32')]['rawAttributes']);_0x3b38d7[_0x2707('0x38')]=_['keys'](_0x4c8dbf[_0x2707('0x38')]);_0x3b38d7[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],_0x3b38d7['query']);_0x6defc2[_0x2707('0x3a')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x4c8dbf[_0x2707('0x38')][_0x2707('0x3b')]));_0x6defc2[_0x2707('0x3a')]=_0x6defc2['attributes'][_0x2707('0x4c')]?_0x6defc2[_0x2707('0x3a')]:_0x3b38d7[_0x2707('0x37')];if(_0x4c8dbf[_0x2707('0x38')][_0x2707('0x45')]){_0x6defc2['include']=[{'all':!![]}];}_0x6defc2=_[_0x2707('0x42')]({},_0x6defc2,_0x4c8dbf['options']);return db[_0x2707('0x32')][_0x2707('0x4d')](_0x6defc2)['then'](handleEntityNotFound(_0x3d25ea,null))[_0x2707('0x29')](respondWithResult(_0x3d25ea,null))[_0x2707('0x49')](handleError(_0x3d25ea,null));};exports[_0x2707('0x4e')]=function(_0x4ae196,_0x1a8034){return db['VoiceMail'][_0x2707('0x4e')](_0x4ae196[_0x2707('0x4f')],{})['then'](function(_0x2b1746){var _0xffe740=_0x4ae196[_0x2707('0x50')]['get']({'plain':!![]});if(!_0xffe740)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffe740[_0x2707('0x51')]===_0x2707('0x50')){var _0x292b44=_0x2b1746[_0x2707('0x2a')]({'plain':!![]});var _0x463bf='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x463bf,'userProfileId':_0xffe740[_0x2707('0x52')]},'raw':!![]})[_0x2707('0x29')](function(_0x2e11fc){if(_0x2e11fc&&_0x2e11fc[_0x2707('0x53')]===0x0){return db[_0x2707('0x2c')]['create']({'name':_0x292b44[_0x2707('0x2f')],'resourceId':_0x292b44['id'],'type':_0x2e11fc[_0x2707('0x2f')],'sectionId':_0x2e11fc['id']},{})['then'](function(){return _0x2b1746;});}else{return _0x2b1746;}})['catch'](function(_0x3b41b2){logger[_0x2707('0x2d')](_0x2707('0x54'),_0x3b41b2);throw _0x3b41b2;});}return _0x2b1746;})['then'](respondWithResult(_0x1a8034,0xc9))[_0x2707('0x49')](handleError(_0x1a8034,null));};exports[_0x2707('0x27')]=function(_0x2a2a71,_0x29a453){if(_0x2a2a71['body']['id']){delete _0x2a2a71[_0x2707('0x4f')]['id'];}return db[_0x2707('0x32')][_0x2707('0x4d')]({'where':{'id':_0x2a2a71[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x29a453,null))[_0x2707('0x29')](saveUpdates(_0x2a2a71[_0x2707('0x4f')],null))[_0x2707('0x29')](respondWithResult(_0x29a453,null))[_0x2707('0x49')](handleError(_0x29a453,null));};exports[_0x2707('0x28')]=function(_0x4f2b54,_0x38acdd){return db['VoiceMail']['find']({'where':{'id':_0x4f2b54[_0x2707('0x55')]['id']}})['then'](handleEntityNotFound(_0x38acdd,null))['then'](removeEntity(_0x38acdd,null))[_0x2707('0x49')](handleError(_0x38acdd,null));};exports[_0x2707('0x56')]=function(_0x185bd3,_0x154e26,_0x3f82de){return db[_0x2707('0x32')][_0x2707('0x57')]({'where':{'id':_0x185bd3[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x154e26,null))[_0x2707('0x29')](function(_0x40c333){var _0x5852bd;var _0x4c4568={},_0x4a3a35={};_0x4a3a35[_0x2707('0x37')]=_[_0x2707('0x39')](db[_0x2707('0x58')]['rawAttributes']);_0x4a3a35['query']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x38')]);_0x4a3a35[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],_0x4a3a35['query']);_0x4c4568['attributes']=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x185bd3[_0x2707('0x38')][_0x2707('0x3b')]));_0x4c4568[_0x2707('0x3a')]=_0x4c4568[_0x2707('0x3a')][_0x2707('0x4c')]?_0x4c4568[_0x2707('0x3a')]:_0x4a3a35['model'];if(!_0x185bd3[_0x2707('0x38')][_0x2707('0x59')](_0x2707('0x5a'))){_0x4c4568[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x185bd3[_0x2707('0x38')]['limit']);_0x4c4568['offset']=qs[_0x2707('0x1d')](_0x185bd3[_0x2707('0x38')]['offset']);}_0x4c4568['order']=qs['sort'](_0x185bd3['query'][_0x2707('0x3d')]);_0x4c4568[_0x2707('0x3e')]=qs['filters'](_[_0x2707('0x40')](_0x185bd3[_0x2707('0x38')],_0x4a3a35[_0x2707('0x3f')]));if(_0x185bd3['query']['filter']){_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x4c4568[_0x2707('0x3a')],function(_0xdb1de0){var _0x3973a0={};_0x3973a0[_0xdb1de0]={'$like':'%'+_0x185bd3['query'][_0x2707('0x41')]+'%'};return _0x3973a0;})});}_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'mailboxuser':_0x40c333[_0x2707('0x5b')]});_0x4c4568=_[_0x2707('0x42')]({},_0x4c4568,_0x185bd3['options']);return db[_0x2707('0x58')][_0x2707('0x5c')](_0x4c4568)[_0x2707('0x29')](respondWithFilteredResult(_0x154e26,_0x4c4568));})[_0x2707('0x49')](handleError(_0x154e26,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 6ddb3c7..6b4018e 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 _0x25fa=['mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail'];(function(_0x4da1fb,_0x5141ac){var _0x44b642=function(_0x5c0745){while(--_0x5c0745){_0x4da1fb['push'](_0x4da1fb['shift']());}};_0x44b642(++_0x5141ac);}(_0x25fa,0x7b));var _0xa25f=function(_0x3b49a0,_0x479050){_0x3b49a0=_0x3b49a0-0x0;var _0xf946bd=_0x25fa[_0x3b49a0];return _0xf946bd;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require(_0xa25f('0x3'));var BPromise=require('bluebird');var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require(_0xa25f('0x6'));var config=require(_0xa25f('0x7'));var attributes=require(_0xa25f('0x8'));module[_0xa25f('0x9')]=function(_0x52f886,_0x19132c){return _0x52f886[_0xa25f('0xa')](_0xa25f('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xa25f('0xc'),'fields':[_0xa25f('0xd'),_0xa25f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1f8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail','context'];(function(_0x5206cc,_0xaae8a3){var _0x350b42=function(_0x4748bc){while(--_0x4748bc){_0x5206cc['push'](_0x5206cc['shift']());}};_0x350b42(++_0xaae8a3);}(_0xe1f8,0x9a));var _0x8e1f=function(_0x139c03,_0x40e439){_0x139c03=_0x139c03-0x0;var _0x365d17=_0xe1f8[_0x139c03];return _0x365d17;};'use strict';var _=require(_0x8e1f('0x0'));var util=require(_0x8e1f('0x1'));var logger=require(_0x8e1f('0x2'))(_0x8e1f('0x3'));var moment=require(_0x8e1f('0x4'));var BPromise=require(_0x8e1f('0x5'));var rp=require(_0x8e1f('0x6'));var fs=require('fs');var path=require(_0x8e1f('0x7'));var rimraf=require(_0x8e1f('0x8'));var config=require(_0x8e1f('0x9'));var attributes=require('./voiceMail.attributes');module[_0x8e1f('0xa')]=function(_0x1bde19,_0x421a61){return _0x1bde19[_0x8e1f('0xb')](_0x8e1f('0xc'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x8e1f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 9f16bbe..29c3a9c 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 _0xc4a4=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x1346b9,_0x698f66){var _0x172e06=function(_0x291214){while(--_0x291214){_0x1346b9['push'](_0x1346b9['shift']());}};_0x172e06(++_0x698f66);}(_0xc4a4,0xd6));var _0x4c4a=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xc4a4[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x4c4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c4a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c4a('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x4c4a('0x3'));var jayson=require(_0x4c4a('0x4'));var client=jayson[_0x4c4a('0x5')][_0x4c4a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa6cd95,_0x44998a,_0x532db2){return new BPromise(function(_0x586c06,_0x50b702){return client['request'](_0xa6cd95,_0x532db2)['then'](function(_0x52ec6e){logger[_0x4c4a('0x7')](_0x4c4a('0x8'),_0x44998a,_0x4c4a('0x9'));logger[_0x4c4a('0xa')](_0x4c4a('0xb'),_0x44998a,_0x4c4a('0x9'),JSON[_0x4c4a('0xc')](_0x52ec6e));if(_0x52ec6e[_0x4c4a('0xd')]){if(_0x52ec6e['error']['code']===0x1f4){logger[_0x4c4a('0xd')]('VoiceMail,\x20%s,\x20%s',_0x44998a,_0x52ec6e[_0x4c4a('0xd')]['message']);return _0x50b702(_0x52ec6e[_0x4c4a('0xd')][_0x4c4a('0xe')]);}logger[_0x4c4a('0xd')]('VoiceMail,\x20%s,\x20%s',_0x44998a,_0x52ec6e[_0x4c4a('0xd')][_0x4c4a('0xe')]);return _0x586c06(_0x52ec6e['error'][_0x4c4a('0xe')]);}else{logger[_0x4c4a('0x7')](_0x4c4a('0x8'),_0x44998a,_0x4c4a('0x9'));_0x586c06(_0x52ec6e['result'][_0x4c4a('0xe')]);}})[_0x4c4a('0xf')](function(_0x59d370){logger['error'](_0x4c4a('0x8'),_0x44998a,_0x59d370);_0x50b702(_0x59d370);});});} \ No newline at end of file +var _0x34f0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x34f0,0x166));var _0x034f=function(_0x313534,_0x29a409){_0x313534=_0x313534-0x0;var _0x4962b6=_0x34f0[_0x313534];return _0x4962b6;};'use strict';var _=require(_0x034f('0x0'));var util=require(_0x034f('0x1'));var moment=require('moment');var BPromise=require(_0x034f('0x2'));var rs=require(_0x034f('0x3'));var fs=require('fs');var Redis=require(_0x034f('0x4'));var db=require(_0x034f('0x5'))['db'];var utils=require(_0x034f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x034f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x034f('0x8')][_0x034f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44fcf9,_0x52aa39,_0x41e401){return new BPromise(function(_0x4ef0bc,_0x117cea){return client[_0x034f('0xa')](_0x44fcf9,_0x41e401)['then'](function(_0x3c05f2){logger[_0x034f('0xb')](_0x034f('0xc'),_0x52aa39,_0x034f('0xd'));logger[_0x034f('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x52aa39,_0x034f('0xd'),JSON[_0x034f('0xf')](_0x3c05f2));if(_0x3c05f2['error']){if(_0x3c05f2['error'][_0x034f('0x10')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x52aa39,_0x3c05f2[_0x034f('0x11')][_0x034f('0x12')]);return _0x117cea(_0x3c05f2[_0x034f('0x11')][_0x034f('0x12')]);}logger[_0x034f('0x11')]('VoiceMail,\x20%s,\x20%s',_0x52aa39,_0x3c05f2[_0x034f('0x11')]['message']);return _0x4ef0bc(_0x3c05f2[_0x034f('0x11')][_0x034f('0x12')]);}else{logger[_0x034f('0xb')](_0x034f('0xc'),_0x52aa39,_0x034f('0xd'));_0x4ef0bc(_0x3c05f2['result']['message']);}})[_0x034f('0x13')](function(_0x1e9c72){logger[_0x034f('0x11')](_0x034f('0xc'),_0x52aa39,_0x1e9c72);_0x117cea(_0x1e9c72);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index aab9e16..ef775ab 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 _0x5e40=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x25f0da,_0x416b28){var _0x1d7a3d=function(_0x103569){while(--_0x103569){_0x25f0da['push'](_0x25f0da['shift']());}};_0x1d7a3d(++_0x416b28);}(_0x5e40,0x1f2));var _0x05e4=function(_0x33cb97,_0x2be8e8){_0x33cb97=_0x33cb97-0x0;var _0xe85595=_0x5e40[_0x33cb97];return _0xe85595;};'use strict';var multer=require(_0x05e4('0x0'));var util=require(_0x05e4('0x1'));var path=require(_0x05e4('0x2'));var timeout=require(_0x05e4('0x3'));var express=require('express');var router=express[_0x05e4('0x4')]();var fs_extra=require(_0x05e4('0x5'));var auth=require(_0x05e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x05e4('0x7'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x05e4('0x8')](),controller[_0x05e4('0x9')]);router[_0x05e4('0xa')](_0x05e4('0xb'),auth[_0x05e4('0x8')](),controller[_0x05e4('0xc')]);router['get'](_0x05e4('0xd'),auth['isAuthenticated'](),controller[_0x05e4('0xe')]);router[_0x05e4('0xf')]('/',auth[_0x05e4('0x8')](),controller[_0x05e4('0x10')]);router[_0x05e4('0x11')](_0x05e4('0xb'),auth[_0x05e4('0x8')](),controller['update']);router[_0x05e4('0x12')](_0x05e4('0xb'),auth[_0x05e4('0x8')](),controller[_0x05e4('0x13')]);module[_0x05e4('0x14')]=router; \ No newline at end of file +var _0x1119=['index','/:id','show','create','put','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1119,0x148));var _0x9111=function(_0x3d6bab,_0x3242db){_0x3d6bab=_0x3d6bab-0x0;var _0x348415=_0x1119[_0x3d6bab];return _0x348415;};'use strict';var multer=require('multer');var util=require(_0x9111('0x0'));var path=require('path');var timeout=require(_0x9111('0x1'));var express=require('express');var router=express[_0x9111('0x2')]();var fs_extra=require(_0x9111('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9111('0x4'));var config=require(_0x9111('0x5'));var controller=require('./voiceMailMessage.controller');router[_0x9111('0x6')]('/',auth[_0x9111('0x7')](),controller[_0x9111('0x8')]);router[_0x9111('0x6')](_0x9111('0x9'),auth[_0x9111('0x7')](),controller[_0x9111('0xa')]);router[_0x9111('0x6')]('/:id/download',auth[_0x9111('0x7')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x9111('0xb')]);router[_0x9111('0xc')](_0x9111('0x9'),auth[_0x9111('0x7')](),controller['update']);router[_0x9111('0xd')](_0x9111('0x9'),auth[_0x9111('0x7')](),controller[_0x9111('0xe')]);module[_0x9111('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index c1a0820..0eb069f 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 _0xf417=['INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','getDataValue'];(function(_0x26dbab,_0x1d24c8){var _0x53de6d=function(_0x23e76e){while(--_0x23e76e){_0x26dbab['push'](_0x26dbab['shift']());}};_0x53de6d(++_0x1d24c8);}(_0xf417,0x1b6));var _0x7f41=function(_0x26b2a2,_0x50428a){_0x26b2a2=_0x26b2a2-0x0;var _0x139d27=_0xf417[_0x26b2a2];return _0x139d27;};'use strict';var Sequelize=require('sequelize');module[_0x7f41('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2bfe5b){return this[_0x7f41('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x7f41('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x7f41('0x4')](_0x7f41('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7f41('0x3')],'defaultValue':''},'stamp':{'type':_0x7f41('0x6'),'defaultValue':Sequelize['literal'](_0x7f41('0x7'))}}; \ No newline at end of file +var _0xaf2b=['exports','getDataValue','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0xaf2b,0x197));var _0xbaf2=function(_0x4fcd97,_0x4e553c){_0x4fcd97=_0x4fcd97-0x0;var _0x439b10=_0xaf2b[_0x4fcd97];return _0x439b10;};'use strict';var Sequelize=require(_0xbaf2('0x0'));module[_0xbaf2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x14d8f6){return this[_0xbaf2('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xbaf2('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xbaf2('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xbaf2('0x5'),'defaultValue':Sequelize[_0xbaf2('0x6')](_0xbaf2('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index aa0792f..2604d96 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 _0x5480=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','eml-format','rimraf','request-promise','moment','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5480,0xcf));var _0x0548=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x5480[_0x4953da];return _0x2d3780;};'use strict';var emlformat=require(_0x0548('0x0'));var rimraf=require(_0x0548('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0548('0x2'));var moment=require(_0x0548('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0548('0x4'));var util=require(_0x0548('0x5'));var path=require(_0x0548('0x6'));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(_0x0548('0x7'));var squel=require('squel');var crypto=require(_0x0548('0x8'));var jsforce=require(_0x0548('0x9'));var deskjs=require(_0x0548('0xa'));var toCsv=require(_0x0548('0xb'));var querystring=require(_0x0548('0xc'));var Papa=require(_0x0548('0xd'));var Redis=require(_0x0548('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0548('0xf'));var as=require(_0x0548('0x10'));var hardwareService=require(_0x0548('0x11'));var logger=require('../../config/logger')(_0x0548('0x12'));var utils=require(_0x0548('0x13'));var config=require(_0x0548('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0548('0x15'))['db'];function respondWithStatusCode(_0x3c1953,_0x2ae5a1){_0x2ae5a1=_0x2ae5a1||0xcc;return function(_0x379206){if(_0x379206){return _0x3c1953[_0x0548('0x16')](_0x2ae5a1);}return _0x3c1953[_0x0548('0x17')](_0x2ae5a1)[_0x0548('0x18')]();};}function respondWithResult(_0x4b80b3,_0x55724f){_0x55724f=_0x55724f||0xc8;return function(_0x3798c2){if(_0x3798c2){return _0x4b80b3[_0x0548('0x17')](_0x55724f)[_0x0548('0x19')](_0x3798c2);}};}function respondWithFilteredResult(_0x176b31,_0x19608a){return function(_0x2965e){if(_0x2965e){var _0x3cc19b=typeof _0x19608a[_0x0548('0x1a')]===_0x0548('0x1b')&&typeof _0x19608a[_0x0548('0x1c')]===_0x0548('0x1b');var _0x907c14=_0x2965e[_0x0548('0x1d')];var _0x269aef=_0x3cc19b?0x0:_0x19608a[_0x0548('0x1a')];var _0x17200e=_0x3cc19b?_0x2965e[_0x0548('0x1d')]:_0x19608a[_0x0548('0x1a')]+_0x19608a[_0x0548('0x1c')];var _0x4224b7;if(_0x17200e>=_0x907c14){_0x17200e=_0x907c14;_0x4224b7=0xc8;}else{_0x4224b7=0xce;}_0x176b31[_0x0548('0x17')](_0x4224b7);return _0x176b31[_0x0548('0x1e')](_0x0548('0x1f'),_0x269aef+'-'+_0x17200e+'/'+_0x907c14)[_0x0548('0x19')](_0x2965e);}return null;};}function patchUpdates(_0x575d34){return function(_0x4e4d51){try{jsonpatch[_0x0548('0x20')](_0x4e4d51,_0x575d34,!![]);}catch(_0x4f3f8b){return BPromise[_0x0548('0x21')](_0x4f3f8b);}return _0x4e4d51[_0x0548('0x22')]();};}function saveUpdates(_0x16de47,_0x4a0bac){return function(_0x2ddafb){if(_0x2ddafb){return _0x2ddafb[_0x0548('0x23')](_0x16de47)[_0x0548('0x24')](function(_0x4e559f){return _0x4e559f;});}return null;};}function removeEntity(_0x1a5de5,_0xd8245b){return function(_0x464a5a){if(_0x464a5a){return _0x464a5a[_0x0548('0x25')]()['then'](function(){_0x1a5de5[_0x0548('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2acf24,_0x353f76){return function(_0x344b66){if(!_0x344b66){_0x2acf24[_0x0548('0x16')](0x194);}return _0x344b66;};}function handleError(_0x1b2ac8,_0x5576a1){_0x5576a1=_0x5576a1||0x1f4;return function(_0x337c36){logger[_0x0548('0x26')](_0x337c36[_0x0548('0x27')]);if(_0x337c36[_0x0548('0x28')]){delete _0x337c36[_0x0548('0x28')];}_0x1b2ac8['status'](_0x5576a1)[_0x0548('0x29')](_0x337c36);};}exports[_0x0548('0x2a')]=function(_0x35938a,_0x4d2b81){var _0x220e0c={},_0x345220={},_0x1678ff={'count':0x0,'rows':[]};var _0x3651be=_[_0x0548('0x2b')](db[_0x0548('0x2c')][_0x0548('0x2d')],function(_0x5ba723){return{'name':_0x5ba723['fieldName'],'type':_0x5ba723['type'][_0x0548('0x2e')]};});_0x345220['model']=_['differenceBy'](_[_0x0548('0x2b')](_0x3651be,_0x0548('0x28')),[_0x0548('0x28')]);_0x345220[_0x0548('0x2f')]=_[_0x0548('0x30')](_0x35938a[_0x0548('0x2f')]);_0x345220['filters']=_[_0x0548('0x31')](_0x345220[_0x0548('0x32')],_0x345220['query']);_0x220e0c[_0x0548('0x33')]=_[_0x0548('0x31')](_0x345220[_0x0548('0x32')],qs[_0x0548('0x34')](_0x35938a[_0x0548('0x2f')]['fields']));_0x220e0c[_0x0548('0x33')]=_0x220e0c[_0x0548('0x33')][_0x0548('0x35')]?_0x220e0c[_0x0548('0x33')]:_0x345220['model'];if(!_0x35938a[_0x0548('0x2f')]['hasOwnProperty'](_0x0548('0x36'))){_0x220e0c[_0x0548('0x1c')]=qs[_0x0548('0x1c')](_0x35938a['query'][_0x0548('0x1c')]);_0x220e0c['offset']=qs[_0x0548('0x1a')](_0x35938a['query'][_0x0548('0x1a')]);}_0x220e0c[_0x0548('0x37')]=qs['sort'](_0x35938a[_0x0548('0x2f')][_0x0548('0x38')]);_0x220e0c[_0x0548('0x39')]=qs[_0x0548('0x3a')](_['pick'](_0x35938a[_0x0548('0x2f')],_0x345220[_0x0548('0x3a')]),_0x3651be);if(_0x35938a[_0x0548('0x2f')][_0x0548('0x3b')]){_0x220e0c[_0x0548('0x39')]=_[_0x0548('0x3c')](_0x220e0c[_0x0548('0x39')],{'$or':_[_0x0548('0x2b')](_0x3651be,function(_0x3292a3){if(_0x3292a3[_0x0548('0x3d')]!==_0x0548('0x3e')){var _0x5086c8={};_0x5086c8[_0x3292a3['name']]={'$like':'%'+_0x35938a[_0x0548('0x2f')]['filter']+'%'};return _0x5086c8;}})});}_0x220e0c=_[_0x0548('0x3c')]({},_0x220e0c,_0x35938a[_0x0548('0x3f')]);var _0x474c52={'where':_0x220e0c[_0x0548('0x39')]};return db[_0x0548('0x2c')][_0x0548('0x1d')](_0x474c52)['then'](function(_0x51151d){_0x1678ff[_0x0548('0x1d')]=_0x51151d;if(_0x35938a[_0x0548('0x2f')][_0x0548('0x40')]){_0x220e0c[_0x0548('0x41')]=[{'all':!![]}];}return db[_0x0548('0x2c')][_0x0548('0x42')](_0x220e0c);})[_0x0548('0x24')](function(_0x26b239){_0x1678ff['rows']=_0x26b239;return _0x1678ff;})[_0x0548('0x24')](respondWithFilteredResult(_0x4d2b81,_0x220e0c))['catch'](handleError(_0x4d2b81,null));};exports[_0x0548('0x43')]=function(_0xb64a98,_0x387de9){var _0x136219={'raw':!![],'where':{'id':_0xb64a98[_0x0548('0x44')]['id']}},_0x1eddf0={};_0x1eddf0[_0x0548('0x32')]=_[_0x0548('0x30')](db[_0x0548('0x2c')][_0x0548('0x2d')]);_0x1eddf0['query']=_['keys'](_0xb64a98[_0x0548('0x2f')]);_0x1eddf0['filters']=_[_0x0548('0x31')](_0x1eddf0[_0x0548('0x32')],_0x1eddf0['query']);_0x136219[_0x0548('0x33')]=_[_0x0548('0x31')](_0x1eddf0[_0x0548('0x32')],qs[_0x0548('0x34')](_0xb64a98['query'][_0x0548('0x34')]));_0x136219[_0x0548('0x33')]=_0x136219[_0x0548('0x33')][_0x0548('0x35')]?_0x136219['attributes']:_0x1eddf0[_0x0548('0x32')];if(_0xb64a98[_0x0548('0x2f')][_0x0548('0x40')]){_0x136219[_0x0548('0x41')]=[{'all':!![]}];}_0x136219=_['merge']({},_0x136219,_0xb64a98['options']);return db[_0x0548('0x2c')][_0x0548('0x45')](_0x136219)['then'](handleEntityNotFound(_0x387de9,null))['then'](respondWithResult(_0x387de9,null))['catch'](handleError(_0x387de9,null));};exports[_0x0548('0x46')]=function(_0x5e7931,_0x2ee15d){return db[_0x0548('0x2c')][_0x0548('0x46')](_0x5e7931[_0x0548('0x47')],{})[_0x0548('0x24')](respondWithResult(_0x2ee15d,0xc9))[_0x0548('0x48')](handleError(_0x2ee15d,null));};exports[_0x0548('0x23')]=function(_0x536291,_0x5a07e2){if(_0x536291[_0x0548('0x47')]['id']){delete _0x536291[_0x0548('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x536291[_0x0548('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a07e2,null))['then'](saveUpdates(_0x536291[_0x0548('0x47')],null))[_0x0548('0x24')](respondWithResult(_0x5a07e2,null))[_0x0548('0x48')](handleError(_0x5a07e2,null));};exports[_0x0548('0x25')]=function(_0x183a21,_0xf502b3){return db[_0x0548('0x2c')][_0x0548('0x45')]({'where':{'id':_0x183a21[_0x0548('0x44')]['id']}})[_0x0548('0x24')](handleEntityNotFound(_0xf502b3,null))[_0x0548('0x24')](removeEntity(_0xf502b3,null))['catch'](handleError(_0xf502b3,null));};exports['download']=function(_0x15b881,_0x1c5277,_0x430deb){return db[_0x0548('0x2c')]['find']({'where':{'id':_0x15b881[_0x0548('0x44')]['id']},'attributes':['id',_0x0548('0x49'),'msg_id']})[_0x0548('0x24')](handleEntityNotFound(_0x1c5277,null))['then'](function(_0x1664de){if(_0x1664de){if(!_0x1664de['recording']){throw new db[(_0x0548('0x4a'))][(_0x0548('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0xb470cf={'Content-Type':_0x0548('0x4c'),'Content-Disposition':_0x0548('0x4d')};if(_0x1664de[_0x0548('0x4e')]){_0xb470cf['Content-Disposition']='attachment;\x20filename=\x22'+_0x1664de[_0x0548('0x4e')]+'.wav\x22';}_0x1c5277['set'](_0xb470cf);return _0x1c5277[_0x0548('0x29')](new Buffer(_0x1664de[_0x0548('0x49')]));}})[_0x0548('0x48')](handleError(_0x1c5277,null));}; \ No newline at end of file +var _0xdd81=['Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','VoiceMailMessage','include','findAll','show','includeAll','find','catch','create','body','params','download','recording','msg_id'];(function(_0x50b498,_0x218035){var _0xba90d7=function(_0x50a43d){while(--_0x50a43d){_0x50b498['push'](_0x50b498['shift']());}};_0xba90d7(++_0x218035);}(_0xdd81,0x16f));var _0x1dd8=function(_0x474e22,_0x2c6e4c){_0x474e22=_0x474e22-0x0;var _0x38de4e=_0xdd81[_0x474e22];return _0x38de4e;};'use strict';var emlformat=require(_0x1dd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1dd8('0x1'));var jsonpatch=require(_0x1dd8('0x2'));var rp=require(_0x1dd8('0x3'));var moment=require(_0x1dd8('0x4'));var BPromise=require(_0x1dd8('0x5'));var Mustache=require(_0x1dd8('0x6'));var util=require(_0x1dd8('0x7'));var path=require(_0x1dd8('0x8'));var sox=require('sox');var csv=require(_0x1dd8('0x9'));var ejs=require(_0x1dd8('0xa'));var fs=require('fs');var fs_extra=require(_0x1dd8('0xb'));var _=require(_0x1dd8('0xc'));var squel=require(_0x1dd8('0xd'));var crypto=require(_0x1dd8('0xe'));var jsforce=require(_0x1dd8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1dd8('0x9'));var querystring=require(_0x1dd8('0x10'));var Papa=require(_0x1dd8('0x11'));var Redis=require('ioredis');var authService=require(_0x1dd8('0x12'));var qs=require(_0x1dd8('0x13'));var as=require(_0x1dd8('0x14'));var hardwareService=require(_0x1dd8('0x15'));var logger=require('../../config/logger')(_0x1dd8('0x16'));var utils=require(_0x1dd8('0x17'));var config=require(_0x1dd8('0x18'));var licenseUtil=require(_0x1dd8('0x19'));var db=require(_0x1dd8('0x1a'))['db'];function respondWithStatusCode(_0x3d8096,_0x2565c5){_0x2565c5=_0x2565c5||0xcc;return function(_0x36cc61){if(_0x36cc61){return _0x3d8096[_0x1dd8('0x1b')](_0x2565c5);}return _0x3d8096['status'](_0x2565c5)[_0x1dd8('0x1c')]();};}function respondWithResult(_0xad28d7,_0x2cc7d6){_0x2cc7d6=_0x2cc7d6||0xc8;return function(_0x57a91d){if(_0x57a91d){return _0xad28d7['status'](_0x2cc7d6)[_0x1dd8('0x1d')](_0x57a91d);}};}function respondWithFilteredResult(_0x32f96b,_0xb15b9f){return function(_0x5e9811){if(_0x5e9811){var _0x318c47=typeof _0xb15b9f[_0x1dd8('0x1e')]===_0x1dd8('0x1f')&&typeof _0xb15b9f[_0x1dd8('0x20')]==='undefined';var _0x4269d4=_0x5e9811[_0x1dd8('0x21')];var _0x416967=_0x318c47?0x0:_0xb15b9f[_0x1dd8('0x1e')];var _0x296b8c=_0x318c47?_0x5e9811[_0x1dd8('0x21')]:_0xb15b9f[_0x1dd8('0x1e')]+_0xb15b9f[_0x1dd8('0x20')];var _0x55c55d;if(_0x296b8c>=_0x4269d4){_0x296b8c=_0x4269d4;_0x55c55d=0xc8;}else{_0x55c55d=0xce;}_0x32f96b[_0x1dd8('0x22')](_0x55c55d);return _0x32f96b[_0x1dd8('0x23')](_0x1dd8('0x24'),_0x416967+'-'+_0x296b8c+'/'+_0x4269d4)['json'](_0x5e9811);}return null;};}function patchUpdates(_0x3b7014){return function(_0x444c78){try{jsonpatch[_0x1dd8('0x25')](_0x444c78,_0x3b7014,!![]);}catch(_0x4de55c){return BPromise[_0x1dd8('0x26')](_0x4de55c);}return _0x444c78[_0x1dd8('0x27')]();};}function saveUpdates(_0x262f4c,_0x5c7fb2){return function(_0x694fa8){if(_0x694fa8){return _0x694fa8[_0x1dd8('0x28')](_0x262f4c)['then'](function(_0x47e1a2){return _0x47e1a2;});}return null;};}function removeEntity(_0x41af9b,_0x402f06){return function(_0x328555){if(_0x328555){return _0x328555[_0x1dd8('0x29')]()[_0x1dd8('0x2a')](function(){_0x41af9b[_0x1dd8('0x22')](0xcc)[_0x1dd8('0x1c')]();});}};}function handleEntityNotFound(_0x52ecc0,_0x2ce056){return function(_0x5fe470){if(!_0x5fe470){_0x52ecc0[_0x1dd8('0x1b')](0x194);}return _0x5fe470;};}function handleError(_0x5e7203,_0xb776c8){_0xb776c8=_0xb776c8||0x1f4;return function(_0x3b2ea8){logger[_0x1dd8('0x2b')](_0x3b2ea8[_0x1dd8('0x2c')]);if(_0x3b2ea8[_0x1dd8('0x2d')]){delete _0x3b2ea8[_0x1dd8('0x2d')];}_0x5e7203[_0x1dd8('0x22')](_0xb776c8)['send'](_0x3b2ea8);};}exports[_0x1dd8('0x2e')]=function(_0x50eb15,_0x7db011){var _0x3967f0={},_0x517d0b={},_0x2c4b1a={'count':0x0,'rows':[]};var _0x50b214=_[_0x1dd8('0x2f')](db['VoiceMailMessage'][_0x1dd8('0x30')],function(_0x450a50){return{'name':_0x450a50[_0x1dd8('0x31')],'type':_0x450a50[_0x1dd8('0x32')][_0x1dd8('0x33')]};});_0x517d0b[_0x1dd8('0x34')]=_['differenceBy'](_[_0x1dd8('0x2f')](_0x50b214,'name'),[_0x1dd8('0x2d')]);_0x517d0b['query']=_[_0x1dd8('0x35')](_0x50eb15[_0x1dd8('0x36')]);_0x517d0b['filters']=_[_0x1dd8('0x37')](_0x517d0b['model'],_0x517d0b['query']);_0x3967f0[_0x1dd8('0x38')]=_[_0x1dd8('0x37')](_0x517d0b['model'],qs['fields'](_0x50eb15[_0x1dd8('0x36')][_0x1dd8('0x39')]));_0x3967f0['attributes']=_0x3967f0[_0x1dd8('0x38')][_0x1dd8('0x3a')]?_0x3967f0['attributes']:_0x517d0b[_0x1dd8('0x34')];if(!_0x50eb15[_0x1dd8('0x36')][_0x1dd8('0x3b')](_0x1dd8('0x3c'))){_0x3967f0[_0x1dd8('0x20')]=qs[_0x1dd8('0x20')](_0x50eb15[_0x1dd8('0x36')]['limit']);_0x3967f0['offset']=qs[_0x1dd8('0x1e')](_0x50eb15[_0x1dd8('0x36')]['offset']);}_0x3967f0[_0x1dd8('0x3d')]=qs[_0x1dd8('0x3e')](_0x50eb15[_0x1dd8('0x36')]['sort']);_0x3967f0['where']=qs['filters'](_[_0x1dd8('0x3f')](_0x50eb15[_0x1dd8('0x36')],_0x517d0b[_0x1dd8('0x40')]),_0x50b214);if(_0x50eb15[_0x1dd8('0x36')][_0x1dd8('0x41')]){_0x3967f0[_0x1dd8('0x42')]=_['merge'](_0x3967f0[_0x1dd8('0x42')],{'$or':_[_0x1dd8('0x2f')](_0x50b214,function(_0x2d5204){if(_0x2d5204[_0x1dd8('0x32')]!==_0x1dd8('0x43')){var _0x2f9827={};_0x2f9827[_0x2d5204[_0x1dd8('0x2d')]]={'$like':'%'+_0x50eb15[_0x1dd8('0x36')][_0x1dd8('0x41')]+'%'};return _0x2f9827;}})});}_0x3967f0=_[_0x1dd8('0x44')]({},_0x3967f0,_0x50eb15[_0x1dd8('0x45')]);var _0x16b011={'where':_0x3967f0[_0x1dd8('0x42')]};return db[_0x1dd8('0x46')][_0x1dd8('0x21')](_0x16b011)[_0x1dd8('0x2a')](function(_0x3771b5){_0x2c4b1a['count']=_0x3771b5;if(_0x50eb15[_0x1dd8('0x36')]['includeAll']){_0x3967f0[_0x1dd8('0x47')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x1dd8('0x48')](_0x3967f0);})[_0x1dd8('0x2a')](function(_0x5dfa2e){_0x2c4b1a['rows']=_0x5dfa2e;return _0x2c4b1a;})[_0x1dd8('0x2a')](respondWithFilteredResult(_0x7db011,_0x3967f0))['catch'](handleError(_0x7db011,null));};exports[_0x1dd8('0x49')]=function(_0x29ebc7,_0x25fd95){var _0x604cc4={'raw':!![],'where':{'id':_0x29ebc7['params']['id']}},_0x8108b={};_0x8108b[_0x1dd8('0x34')]=_['keys'](db[_0x1dd8('0x46')]['rawAttributes']);_0x8108b['query']=_[_0x1dd8('0x35')](_0x29ebc7[_0x1dd8('0x36')]);_0x8108b[_0x1dd8('0x40')]=_[_0x1dd8('0x37')](_0x8108b[_0x1dd8('0x34')],_0x8108b['query']);_0x604cc4[_0x1dd8('0x38')]=_['intersection'](_0x8108b['model'],qs[_0x1dd8('0x39')](_0x29ebc7[_0x1dd8('0x36')]['fields']));_0x604cc4['attributes']=_0x604cc4['attributes'][_0x1dd8('0x3a')]?_0x604cc4[_0x1dd8('0x38')]:_0x8108b[_0x1dd8('0x34')];if(_0x29ebc7[_0x1dd8('0x36')][_0x1dd8('0x4a')]){_0x604cc4[_0x1dd8('0x47')]=[{'all':!![]}];}_0x604cc4=_[_0x1dd8('0x44')]({},_0x604cc4,_0x29ebc7['options']);return db[_0x1dd8('0x46')][_0x1dd8('0x4b')](_0x604cc4)['then'](handleEntityNotFound(_0x25fd95,null))['then'](respondWithResult(_0x25fd95,null))[_0x1dd8('0x4c')](handleError(_0x25fd95,null));};exports[_0x1dd8('0x4d')]=function(_0x46941b,_0x256113){return db[_0x1dd8('0x46')][_0x1dd8('0x4d')](_0x46941b[_0x1dd8('0x4e')],{})['then'](respondWithResult(_0x256113,0xc9))[_0x1dd8('0x4c')](handleError(_0x256113,null));};exports['update']=function(_0x980a96,_0x51478b){if(_0x980a96['body']['id']){delete _0x980a96[_0x1dd8('0x4e')]['id'];}return db[_0x1dd8('0x46')][_0x1dd8('0x4b')]({'where':{'id':_0x980a96[_0x1dd8('0x4f')]['id']}})[_0x1dd8('0x2a')](handleEntityNotFound(_0x51478b,null))[_0x1dd8('0x2a')](saveUpdates(_0x980a96[_0x1dd8('0x4e')],null))[_0x1dd8('0x2a')](respondWithResult(_0x51478b,null))[_0x1dd8('0x4c')](handleError(_0x51478b,null));};exports[_0x1dd8('0x29')]=function(_0x481227,_0x561c58){return db['VoiceMailMessage'][_0x1dd8('0x4b')]({'where':{'id':_0x481227[_0x1dd8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x561c58,null))[_0x1dd8('0x2a')](removeEntity(_0x561c58,null))[_0x1dd8('0x4c')](handleError(_0x561c58,null));};exports[_0x1dd8('0x50')]=function(_0x4d41c1,_0x3d0fd7,_0x330c23){return db[_0x1dd8('0x46')][_0x1dd8('0x4b')]({'where':{'id':_0x4d41c1[_0x1dd8('0x4f')]['id']},'attributes':['id',_0x1dd8('0x51'),_0x1dd8('0x52')]})['then'](handleEntityNotFound(_0x3d0fd7,null))[_0x1dd8('0x2a')](function(_0x2e0405){if(_0x2e0405){if(!_0x2e0405[_0x1dd8('0x51')]){throw new db[(_0x1dd8('0x53'))]['ValidationError'](_0x1dd8('0x54'));}var _0x1632ce={'Content-Type':_0x1dd8('0x55'),'Content-Disposition':_0x1dd8('0x56')};if(_0x2e0405['msg_id']){_0x1632ce[_0x1dd8('0x57')]='attachment;\x20filename=\x22'+_0x2e0405['msg_id']+_0x1dd8('0x58');}_0x3d0fd7[_0x1dd8('0x23')](_0x1632ce);return _0x3d0fd7[_0x1dd8('0x59')](new Buffer(_0x2e0405['recording']));}})['catch'](handleError(_0x3d0fd7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 6abca58..f2b7114 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 _0x2123=['bluebird','request-promise','path','../../config/environment','define','dir','util','moment'];(function(_0x4f7736,_0x559966){var _0x444cbd=function(_0x2b3603){while(--_0x2b3603){_0x4f7736['push'](_0x4f7736['shift']());}};_0x444cbd(++_0x559966);}(_0x2123,0x116));var _0x3212=function(_0x1ff454,_0x12372d){_0x1ff454=_0x1ff454-0x0;var _0x5dcf92=_0x2123[_0x1ff454];return _0x5dcf92;};'use strict';var _=require('lodash');var util=require(_0x3212('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3212('0x1'));var BPromise=require(_0x3212('0x2'));var rp=require(_0x3212('0x3'));var fs=require('fs');var path=require(_0x3212('0x4'));var rimraf=require('rimraf');var config=require(_0x3212('0x5'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x14b7c0,_0x36bfb8){return _0x14b7c0[_0x3212('0x6')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3212('0x7'),'fields':[_0x3212('0x7')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1211=['../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage','dir','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0xac75be,_0xde7b3f){var _0x4e7233=function(_0x45d4f2){while(--_0x45d4f2){_0xac75be['push'](_0xac75be['shift']());}};_0x4e7233(++_0xde7b3f);}(_0x1211,0xb8));var _0x1121=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1211[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1121('0x0'));var util=require('util');var logger=require(_0x1121('0x1'))('api');var moment=require(_0x1121('0x2'));var BPromise=require(_0x1121('0x3'));var rp=require(_0x1121('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1121('0x5'));var config=require(_0x1121('0x6'));var attributes=require(_0x1121('0x7'));module['exports']=function(_0x767961,_0x2c1056){return _0x767961['define'](_0x1121('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x1121('0x9'),'fields':[_0x1121('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index b7026bf..1f1bb73 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 _0x9948=['result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x9948,0x65));var _0x8994=function(_0x316716,_0x412e5d){_0x316716=_0x316716-0x0;var _0x1b23a2=_0x9948[_0x316716];return _0x1b23a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8994('0x0'));var BPromise=require(_0x8994('0x1'));var rs=require(_0x8994('0x2'));var fs=require('fs');var Redis=require(_0x8994('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8994('0x4'));var logger=require(_0x8994('0x5'))(_0x8994('0x6'));var config=require(_0x8994('0x7'));var jayson=require(_0x8994('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13ac91,_0xef485a,_0xd7db04){return new BPromise(function(_0x2c9cb9,_0x5b5109){return client[_0x8994('0x9')](_0x13ac91,_0xd7db04)[_0x8994('0xa')](function(_0x25e5e8){logger[_0x8994('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0xef485a,_0x8994('0xc'));logger[_0x8994('0xd')](_0x8994('0xe'),_0xef485a,_0x8994('0xc'),JSON['stringify'](_0x25e5e8));if(_0x25e5e8[_0x8994('0xf')]){if(_0x25e5e8[_0x8994('0xf')][_0x8994('0x10')]===0x1f4){logger[_0x8994('0xf')](_0x8994('0x11'),_0xef485a,_0x25e5e8[_0x8994('0xf')][_0x8994('0x12')]);return _0x5b5109(_0x25e5e8['error'][_0x8994('0x12')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0xef485a,_0x25e5e8[_0x8994('0xf')]['message']);return _0x2c9cb9(_0x25e5e8[_0x8994('0xf')][_0x8994('0x12')]);}else{logger[_0x8994('0xb')](_0x8994('0x11'),_0xef485a,_0x8994('0xc'));_0x2c9cb9(_0x25e5e8[_0x8994('0x13')]['message']);}})['catch'](function(_0x200bc7){logger[_0x8994('0xf')](_0x8994('0x11'),_0xef485a,_0x200bc7);_0x5b5109(_0x200bc7);});});} \ No newline at end of file +var _0xa332=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash'];(function(_0x5b9ca1,_0x40ecc9){var _0x5129bd=function(_0x57957d){while(--_0x57957d){_0x5b9ca1['push'](_0x5b9ca1['shift']());}};_0x5129bd(++_0x40ecc9);}(_0xa332,0x18b));var _0x2a33=function(_0x39ec3a,_0x50f377){_0x39ec3a=_0x39ec3a-0x0;var _0x5d8f6a=_0xa332[_0x39ec3a];return _0x5d8f6a;};'use strict';var _=require(_0x2a33('0x0'));var util=require(_0x2a33('0x1'));var moment=require(_0x2a33('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a33('0x3'));var fs=require('fs');var Redis=require(_0x2a33('0x4'));var db=require(_0x2a33('0x5'))['db'];var utils=require(_0x2a33('0x6'));var logger=require(_0x2a33('0x7'))(_0x2a33('0x8'));var config=require(_0x2a33('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2a33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ad391,_0x34a0b7,_0x5ec9ee){return new BPromise(function(_0x338b06,_0x107b82){return client['request'](_0x1ad391,_0x5ec9ee)[_0x2a33('0xb')](function(_0x4cf66d){logger['info'](_0x2a33('0xc'),_0x34a0b7,'request\x20sent');logger[_0x2a33('0xd')](_0x2a33('0xe'),_0x34a0b7,_0x2a33('0xf'),JSON[_0x2a33('0x10')](_0x4cf66d));if(_0x4cf66d[_0x2a33('0x11')]){if(_0x4cf66d[_0x2a33('0x11')][_0x2a33('0x12')]===0x1f4){logger['error'](_0x2a33('0xc'),_0x34a0b7,_0x4cf66d[_0x2a33('0x11')][_0x2a33('0x13')]);return _0x107b82(_0x4cf66d[_0x2a33('0x11')][_0x2a33('0x13')]);}logger[_0x2a33('0x11')](_0x2a33('0xc'),_0x34a0b7,_0x4cf66d[_0x2a33('0x11')][_0x2a33('0x13')]);return _0x338b06(_0x4cf66d[_0x2a33('0x11')][_0x2a33('0x13')]);}else{logger[_0x2a33('0x14')](_0x2a33('0xc'),_0x34a0b7,'request\x20sent');_0x338b06(_0x4cf66d['result']['message']);}})[_0x2a33('0x15')](function(_0x5df50a){logger[_0x2a33('0x11')](_0x2a33('0xc'),_0x34a0b7,_0x5df50a);_0x107b82(_0x5df50a);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 64af600..d4386f8 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 _0x262f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','create','addSound','put','/:id','update','destroy','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','express','fs-extra'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x262f,0x19a));var _0xf262=function(_0xa92013,_0x3b2577){_0xa92013=_0xa92013-0x0;var _0x49fdfa=_0x262f[_0xa92013];return _0x49fdfa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf262('0x0'));var timeout=require(_0xf262('0x1'));var express=require(_0xf262('0x2'));var router=express['Router']();var fs_extra=require(_0xf262('0x3'));var auth=require(_0xf262('0x4'));var interaction=require(_0xf262('0x5'));var config=require(_0xf262('0x6'));var controller=require(_0xf262('0x7'));router[_0xf262('0x8')]('/',auth[_0xf262('0x9')](),controller[_0xf262('0xa')]);router[_0xf262('0x8')]('/:id',auth[_0xf262('0x9')](),controller[_0xf262('0xb')]);router[_0xf262('0x8')](_0xf262('0xc'),auth[_0xf262('0x9')](),controller[_0xf262('0xd')]);router['post']('/',auth[_0xf262('0x9')](),controller[_0xf262('0xe')]);router['post']('/:id/sounds',auth[_0xf262('0x9')](),controller[_0xf262('0xf')]);router[_0xf262('0x10')](_0xf262('0x11'),auth['isAuthenticated'](),controller[_0xf262('0x12')]);router['delete'](_0xf262('0x11'),auth[_0xf262('0x9')](),controller[_0xf262('0x13')]);router['delete'](_0xf262('0x14'),auth[_0xf262('0x9')](),controller[_0xf262('0x15')]);module[_0xf262('0x16')]=router; \ No newline at end of file +var _0x089d=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','update','delete','removeSound','exports','multer','util'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x089d,0x178));var _0xd089=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x089d[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xd089('0x0'));var util=require(_0xd089('0x1'));var path=require(_0xd089('0x2'));var timeout=require('connect-timeout');var express=require(_0xd089('0x3'));var router=express[_0xd089('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd089('0x5'));var interaction=require(_0xd089('0x6'));var config=require(_0xd089('0x7'));var controller=require(_0xd089('0x8'));router[_0xd089('0x9')]('/',auth[_0xd089('0xa')](),controller[_0xd089('0xb')]);router[_0xd089('0x9')](_0xd089('0xc'),auth['isAuthenticated'](),controller[_0xd089('0xd')]);router[_0xd089('0x9')](_0xd089('0xe'),auth[_0xd089('0xa')](),controller[_0xd089('0xf')]);router[_0xd089('0x10')]('/',auth[_0xd089('0xa')](),controller['create']);router['post']('/:id/sounds',auth[_0xd089('0xa')](),controller['addSound']);router['put']('/:id',auth[_0xd089('0xa')](),controller[_0xd089('0x11')]);router['delete']('/:id',auth[_0xd089('0xa')](),controller['destroy']);router[_0xd089('0x12')]('/:id/sounds/:id2',auth[_0xd089('0xa')](),controller[_0xd089('0x13')]);module[_0xd089('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index ed95a0d..5208aec 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 _0x338b=['exports','name','ENUM','files','mp3nb','quietmp3nb','mp3','STRING','alpha','TIMESTAMP'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x338b,0x140));var _0xb338=function(_0x107296,_0x2a96dc){_0x107296=_0x107296-0x0;var _0x5d8061=_0x338b[_0x107296];return _0x5d8061;};'use strict';var Sequelize=require('sequelize');module[_0xb338('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb338('0x1')},'mode':{'type':Sequelize[_0xb338('0x2')]('custom',_0xb338('0x3'),_0xb338('0x4'),_0xb338('0x5'),'quietmp3',_0xb338('0x6')),'allowNull':!![],'defaultValue':_0xb338('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![],'defaultValue':_0xb338('0x8')},'format':{'type':Sequelize[_0xb338('0x7')],'allowNull':!![]},'stamp':{'type':_0xb338('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd9c5=['quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','files','mp3nb'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0xd9c5,0xea));var _0x5d9c=function(_0xbab1c3,_0x3f67d8){_0xbab1c3=_0xbab1c3-0x0;var _0x31ec6e=_0xd9c5[_0xbab1c3];return _0x31ec6e;};'use strict';var Sequelize=require(_0x5d9c('0x0'));module[_0x5d9c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5d9c('0x2')},'mode':{'type':Sequelize[_0x5d9c('0x3')]('custom',_0x5d9c('0x4'),_0x5d9c('0x5'),'quietmp3nb',_0x5d9c('0x6'),_0x5d9c('0x7')),'allowNull':!![],'defaultValue':_0x5d9c('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x5d9c('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5d9c('0x8')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5d9c('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x5d9c('0xa')},'defaultEntry':{'type':Sequelize[_0x5d9c('0xb')],'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 61145c7..b0d0574 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 _0xf7ae=['map','VoiceMusicOnHold','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','filters','include','find','body','transaction','mode','directory','join','server/files/moh','create','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','unlinkSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','root','format','%s.%s','basename','extname','symlinkSync','message','removeSound','Sound','id2','createdAt','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','get','UserProfileResource','error','stack','send','index'];(function(_0x259552,_0x3d56ed){var _0x23821c=function(_0x52d3c9){while(--_0x52d3c9){_0x259552['push'](_0x259552['shift']());}};_0x23821c(++_0x3d56ed);}(_0xf7ae,0x127));var _0xef7a=function(_0x2b4757,_0x2ae3bd){_0x2b4757=_0x2b4757-0x0;var _0x46f419=_0xf7ae[_0x2b4757];return _0x46f419;};'use strict';var emlformat=require(_0xef7a('0x0'));var rimraf=require(_0xef7a('0x1'));var zipdir=require(_0xef7a('0x2'));var jsonpatch=require(_0xef7a('0x3'));var rp=require(_0xef7a('0x4'));var moment=require(_0xef7a('0x5'));var BPromise=require(_0xef7a('0x6'));var Mustache=require(_0xef7a('0x7'));var util=require(_0xef7a('0x8'));var path=require(_0xef7a('0x9'));var sox=require('sox');var csv=require(_0xef7a('0xa'));var ejs=require(_0xef7a('0xb'));var fs=require('fs');var fs_extra=require(_0xef7a('0xc'));var _=require(_0xef7a('0xd'));var squel=require(_0xef7a('0xe'));var crypto=require(_0xef7a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xef7a('0x10'));var toCsv=require(_0xef7a('0xa'));var querystring=require('querystring');var Papa=require(_0xef7a('0x11'));var Redis=require(_0xef7a('0x12'));var authService=require(_0xef7a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xef7a('0x14'));var hardwareService=require(_0xef7a('0x15'));var logger=require(_0xef7a('0x16'))(_0xef7a('0x17'));var utils=require(_0xef7a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xef7a('0x19'));var db=require(_0xef7a('0x1a'))['db'];function respondWithStatusCode(_0x352630,_0x4fe883){_0x4fe883=_0x4fe883||0xcc;return function(_0x8a20f5){if(_0x8a20f5){return _0x352630[_0xef7a('0x1b')](_0x4fe883);}return _0x352630['status'](_0x4fe883)[_0xef7a('0x1c')]();};}function respondWithResult(_0x316b10,_0x23e962){_0x23e962=_0x23e962||0xc8;return function(_0x447144){if(_0x447144){return _0x316b10[_0xef7a('0x1d')](_0x23e962)[_0xef7a('0x1e')](_0x447144);}};}function respondWithFilteredResult(_0x104841,_0x4c6f3e){return function(_0x34b729){if(_0x34b729){var _0x35636d=typeof _0x4c6f3e['offset']===_0xef7a('0x1f')&&typeof _0x4c6f3e[_0xef7a('0x20')]===_0xef7a('0x1f');var _0xc411f1=_0x34b729['count'];var _0x20d6a0=_0x35636d?0x0:_0x4c6f3e[_0xef7a('0x21')];var _0x4afc91=_0x35636d?_0x34b729[_0xef7a('0x22')]:_0x4c6f3e[_0xef7a('0x21')]+_0x4c6f3e[_0xef7a('0x20')];var _0x14d5ee;if(_0x4afc91>=_0xc411f1){_0x4afc91=_0xc411f1;_0x14d5ee=0xc8;}else{_0x14d5ee=0xce;}_0x104841['status'](_0x14d5ee);return _0x104841[_0xef7a('0x23')]('Content-Range',_0x20d6a0+'-'+_0x4afc91+'/'+_0xc411f1)['json'](_0x34b729);}return null;};}function patchUpdates(_0x100dbc){return function(_0x15743d){try{jsonpatch[_0xef7a('0x24')](_0x15743d,_0x100dbc,!![]);}catch(_0x49c9b5){return BPromise[_0xef7a('0x25')](_0x49c9b5);}return _0x15743d[_0xef7a('0x26')]();};}function saveUpdates(_0xeba5c0,_0x5431ce){return function(_0x27c7ec){if(_0x27c7ec){return _0x27c7ec[_0xef7a('0x27')](_0xeba5c0)[_0xef7a('0x28')](function(_0x5e10e1){return _0x5e10e1;});}return null;};}function removeEntity(_0x239f8b,_0xb25465){return function(_0x3cd67a){if(_0x3cd67a){return _0x3cd67a['destroy']()[_0xef7a('0x28')](function(){var _0x5d31c1=_0x3cd67a[_0xef7a('0x29')]({'plain':!![]});var _0x36a6bd='MusicOnHolds';return db[_0xef7a('0x2a')]['destroy']({'where':{'type':_0x36a6bd,'resourceId':_0x5d31c1['id']}})[_0xef7a('0x28')](function(){return _0x3cd67a;});})[_0xef7a('0x28')](function(){_0x239f8b['status'](0xcc)[_0xef7a('0x1c')]();});}};}function handleEntityNotFound(_0x498f8c,_0x3ae874){return function(_0x5c9ffc){if(!_0x5c9ffc){_0x498f8c['sendStatus'](0x194);}return _0x5c9ffc;};}function handleError(_0x198de2,_0x1f32df){_0x1f32df=_0x1f32df||0x1f4;return function(_0x44b32a){logger[_0xef7a('0x2b')](_0x44b32a[_0xef7a('0x2c')]);if(_0x44b32a['name']){delete _0x44b32a['name'];}_0x198de2['status'](_0x1f32df)[_0xef7a('0x2d')](_0x44b32a);};}exports[_0xef7a('0x2e')]=function(_0x544613,_0x45cca1){var _0x351853={},_0x12c777={},_0x44ec8b={'count':0x0,'rows':[]};var _0x333efc=_[_0xef7a('0x2f')](db[_0xef7a('0x30')]['rawAttributes'],function(_0x380ccd){return{'name':_0x380ccd[_0xef7a('0x31')],'type':_0x380ccd['type']['key']};});_0x12c777[_0xef7a('0x32')]=_[_0xef7a('0x2f')](_0x333efc,_0xef7a('0x33'));_0x12c777[_0xef7a('0x34')]=_[_0xef7a('0x35')](_0x544613[_0xef7a('0x34')]);_0x12c777['filters']=_[_0xef7a('0x36')](_0x12c777[_0xef7a('0x32')],_0x12c777['query']);_0x351853[_0xef7a('0x37')]=_[_0xef7a('0x36')](_0x12c777[_0xef7a('0x32')],qs['fields'](_0x544613[_0xef7a('0x34')][_0xef7a('0x38')]));_0x351853[_0xef7a('0x37')]=_0x351853[_0xef7a('0x37')][_0xef7a('0x39')]?_0x351853[_0xef7a('0x37')]:_0x12c777[_0xef7a('0x32')];if(!_0x544613[_0xef7a('0x34')][_0xef7a('0x3a')](_0xef7a('0x3b'))){_0x351853[_0xef7a('0x20')]=qs[_0xef7a('0x20')](_0x544613[_0xef7a('0x34')][_0xef7a('0x20')]);_0x351853[_0xef7a('0x21')]=qs[_0xef7a('0x21')](_0x544613['query'][_0xef7a('0x21')]);}_0x351853['order']=qs[_0xef7a('0x3c')](_0x544613['query'][_0xef7a('0x3c')]);delete _0x544613[_0xef7a('0x34')]['sort'];_0x351853[_0xef7a('0x3d')]=qs['filters'](_[_0xef7a('0x3e')](_0x544613[_0xef7a('0x34')],_0x12c777['filters']),_0x333efc);if(_0x544613['query'][_0xef7a('0x3f')]){_0x351853['where']=_[_0xef7a('0x40')](_0x351853[_0xef7a('0x3d')],{'$or':_[_0xef7a('0x2f')](_0x333efc,function(_0x57d37e){if(_0x57d37e['type']!==_0xef7a('0x41')){var _0x4e3be1={};_0x4e3be1[_0x57d37e[_0xef7a('0x33')]]={'$like':'%'+_0x544613['query']['filter']+'%'};return _0x4e3be1;}})});}_0x351853=_[_0xef7a('0x40')]({},_0x351853,_0x544613[_0xef7a('0x42')]);var _0x1c85df={'where':_0x351853[_0xef7a('0x3d')]};return db[_0xef7a('0x30')][_0xef7a('0x22')](_0x1c85df)[_0xef7a('0x28')](function(_0x347824){_0x44ec8b[_0xef7a('0x22')]=_0x347824;if(_0x544613['query'][_0xef7a('0x43')]){_0x351853['include']=[{'all':!![]}];}return db[_0xef7a('0x30')][_0xef7a('0x44')](_0x351853);})[_0xef7a('0x28')](function(_0xd2c15){_0x44ec8b[_0xef7a('0x45')]=_0xd2c15;return _0x44ec8b;})[_0xef7a('0x28')](respondWithFilteredResult(_0x45cca1,_0x351853))['catch'](handleError(_0x45cca1,null));};exports[_0xef7a('0x46')]=function(_0xad2bf3,_0x48174a){var _0x56da99={'raw':![],'where':{'id':_0xad2bf3[_0xef7a('0x47')]['id']}},_0x1d8ea1={};_0x1d8ea1[_0xef7a('0x32')]=_[_0xef7a('0x35')](db[_0xef7a('0x30')][_0xef7a('0x48')]);_0x1d8ea1[_0xef7a('0x34')]=_['keys'](_0xad2bf3[_0xef7a('0x34')]);_0x1d8ea1[_0xef7a('0x49')]=_['intersection'](_0x1d8ea1[_0xef7a('0x32')],_0x1d8ea1['query']);_0x56da99[_0xef7a('0x37')]=_['intersection'](_0x1d8ea1[_0xef7a('0x32')],qs['fields'](_0xad2bf3[_0xef7a('0x34')][_0xef7a('0x38')]));_0x56da99['attributes']=_0x56da99['attributes']['length']?_0x56da99['attributes']:_0x1d8ea1[_0xef7a('0x32')];if(_0xad2bf3[_0xef7a('0x34')][_0xef7a('0x43')]){_0x56da99[_0xef7a('0x4a')]=[{'all':!![]}];}_0x56da99=_['merge']({},_0x56da99,_0xad2bf3['options']);return db[_0xef7a('0x30')][_0xef7a('0x4b')](_0x56da99)['then'](handleEntityNotFound(_0x48174a,null))['then'](respondWithResult(_0x48174a,null))['catch'](handleError(_0x48174a,null));};exports[_0xef7a('0x27')]=function(_0x548121,_0x547336){if(_0x548121[_0xef7a('0x4c')]['id']){delete _0x548121['body']['id'];}return db[_0xef7a('0x30')]['find']({'where':{'id':_0x548121[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](handleEntityNotFound(_0x547336,null))[_0xef7a('0x28')](saveUpdates(_0x548121['body'],null))[_0xef7a('0x28')](respondWithResult(_0x547336,null))['catch'](handleError(_0x547336,null));};exports['create']=function(_0xfb0b37,_0x649f1f,_0x1d873d){return db['sequelize'][_0xef7a('0x4d')](function(_0x20d88a){if(_0xfb0b37[_0xef7a('0x4c')][_0xef7a('0x4e')]==='files'){_0xfb0b37[_0xef7a('0x4c')][_0xef7a('0x4f')]=path[_0xef7a('0x50')](config['root'],_0xef7a('0x51'),_0xfb0b37[_0xef7a('0x4c')][_0xef7a('0x33')]);}return db[_0xef7a('0x30')][_0xef7a('0x52')](_0xfb0b37[_0xef7a('0x4c')],{'transaction':_0x20d88a})[_0xef7a('0x28')](function(_0x4afed5){if(_0xfb0b37['body'][_0xef7a('0x4e')]==='files'){fs[_0xef7a('0x53')](_0x4afed5[_0xef7a('0x4f')],parseInt(_0xef7a('0x54'),0x8));}var _0x3aa766=_0xfb0b37['user'][_0xef7a('0x29')]({'plain':!![]});if(!_0x3aa766)throw new Error(_0xef7a('0x55'));if(_0x3aa766[_0xef7a('0x56')]==='user'){var _0x5c0b52=_0x4afed5[_0xef7a('0x29')]({'plain':!![]});return db[_0xef7a('0x57')][_0xef7a('0x4b')]({'where':{'name':_0xef7a('0x58'),'userProfileId':_0x3aa766[_0xef7a('0x59')]},'raw':!![]})[_0xef7a('0x28')](function(_0x2001f4){if(_0x2001f4&&_0x2001f4['autoAssociation']===0x0){return db['UserProfileResource'][_0xef7a('0x52')]({'name':_0x5c0b52['name'],'resourceId':_0x5c0b52['id'],'type':_0x2001f4[_0xef7a('0x33')],'sectionId':_0x2001f4['id']},{})[_0xef7a('0x28')](function(){return _0x4afed5;});}else{return _0x4afed5;}})[_0xef7a('0x5a')](function(_0x2edaca){logger[_0xef7a('0x2b')](_0xef7a('0x5b'),_0x2edaca);});}return _0x4afed5;});})[_0xef7a('0x28')](respondWithResult(_0x649f1f,0xc9))[_0xef7a('0x5a')](handleError(_0x649f1f,null));};exports[_0xef7a('0x5c')]=function(_0x2bab76,_0x4fdcbf,_0xce0a83){var _0xb2b210;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x2bab76[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](function(_0x1d5134){if(_0x1d5134){return db[_0xef7a('0x5d')][_0xef7a('0x4d')](function(_0x205fbd){return _0x1d5134[_0xef7a('0x5c')]({'transaction':_0x205fbd,'raw':!![]})[_0xef7a('0x28')](function(_0x4b1c3){if(_0x4b1c3['directory']){fs['readdirSync'](_0x4b1c3[_0xef7a('0x4f')])['forEach'](function(_0x86924a){fs[_0xef7a('0x5e')](path[_0xef7a('0x50')](_0x4b1c3[_0xef7a('0x4f')],_0x86924a));});fs['rmdirSync'](_0x4b1c3[_0xef7a('0x4f')]);}return _0x4b1c3;});})[_0xef7a('0x5a')](function(_0x3ce1a6){throw new db[(_0xef7a('0x5f'))][(_0xef7a('0x60'))](_0x3ce1a6['message']);});}})['then'](handleEntityNotFound(_0x4fdcbf,null))[_0xef7a('0x28')](removeEntity(_0x4fdcbf,null))[_0xef7a('0x5a')](handleError(_0x4fdcbf,null));};exports[_0xef7a('0x61')]=function(_0x33326c,_0x143796,_0x3221b8){return db[_0xef7a('0x5d')]['transaction'](function(_0x3cae85){var _0x587938;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x33326c[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](function(_0x3b47f2){if(_0x3b47f2){_0x587938=_0x3b47f2;return _0x3b47f2['addSound'](_0x33326c['body']['id'],{'transaction':_0x3cae85});}})[_0xef7a('0x28')](function(_0x56e224){if(_0x56e224){return db['Sound'][_0xef7a('0x62')]({'where':{'id':_0x33326c['body']['id']},'attributes':['id',_0xef7a('0x33'),_0xef7a('0x63'),_0xef7a('0x64'),'createdAt'],'raw':!![]});}})[_0xef7a('0x28')](function(_0x137e4c){if(_0x137e4c){var _0xb1862=path[_0xef7a('0x50')](config[_0xef7a('0x65')],'server/files/sounds/converted',util[_0xef7a('0x66')](_0xef7a('0x67'),path[_0xef7a('0x68')](_0x137e4c[_0xef7a('0x63')],path[_0xef7a('0x69')](_0x137e4c[_0xef7a('0x63')])),_0x137e4c[_0xef7a('0x64')]));var _0x4949e7=path[_0xef7a('0x50')](config[_0xef7a('0x65')],'server/files/moh',_0x587938[_0xef7a('0x33')],util[_0xef7a('0x66')]('%s.%s',_0x137e4c[_0xef7a('0x33')],_0x137e4c[_0xef7a('0x64')]));fs[_0xef7a('0x6a')](_0xb1862,_0x4949e7);return _0x137e4c;}})['catch'](function(_0x1ee950){throw new db[(_0xef7a('0x5f'))]['ValidationError'](_0x1ee950[_0xef7a('0x6b')]);});})[_0xef7a('0x28')](handleEntityNotFound(_0x143796,null))[_0xef7a('0x28')](respondWithResult(_0x143796,0xc9))['catch'](handleError(_0x143796,null));};exports['removeSound']=function(_0x2f6758,_0x4047c6,_0x2b1d13){return db[_0xef7a('0x5d')]['transaction'](function(_0xebb941){var _0x4aba29;return db[_0xef7a('0x30')][_0xef7a('0x62')]({'where':{'id':_0x2f6758[_0xef7a('0x47')]['id']}})[_0xef7a('0x28')](handleEntityNotFound(_0x4047c6,null))[_0xef7a('0x28')](function(_0x53f17f){if(_0x53f17f){_0x4aba29=_0x53f17f;return _0x53f17f[_0xef7a('0x6c')](_0x2f6758['params']['id2']);}})[_0xef7a('0x28')](function(_0x56239a){if(_0x56239a){return db[_0xef7a('0x6d')][_0xef7a('0x62')]({'where':{'id':_0x2f6758[_0xef7a('0x47')][_0xef7a('0x6e')]},'attributes':['id','name',_0xef7a('0x63'),_0xef7a('0x64'),_0xef7a('0x6f')],'raw':!![]});}})[_0xef7a('0x28')](function(_0x331340){if(_0x331340){fs[_0xef7a('0x5e')](path[_0xef7a('0x50')](_0x4aba29[_0xef7a('0x4f')],util[_0xef7a('0x66')](_0xef7a('0x67'),_0x331340[_0xef7a('0x33')],_0x331340[_0xef7a('0x64')])));return _0x331340;}})[_0xef7a('0x5a')](function(_0x53bff1){throw new db[(_0xef7a('0x5f'))][(_0xef7a('0x60'))](_0x53bff1[_0xef7a('0x6b')]);});})[_0xef7a('0x28')](handleEntityNotFound(_0x4047c6,null))[_0xef7a('0x28')](respondWithStatusCode(_0x4047c6,0xcc))[_0xef7a('0x5a')](handleError(_0x4047c6,null));};exports[_0xef7a('0x70')]=function(_0x6f9cba,_0xdefc47,_0x1de2a7){var _0x171196={};var _0xb6726a={};var _0x5c9429;var _0x12affd;return db['VoiceMusicOnHold'][_0xef7a('0x62')]({'where':{'id':_0x6f9cba['params']['id']}})['then'](handleEntityNotFound(_0xdefc47,null))['then'](function(_0x488968){if(_0x488968){_0x5c9429=_0x488968;_0xb6726a[_0xef7a('0x32')]=_[_0xef7a('0x35')](db[_0xef7a('0x6d')][_0xef7a('0x48')]);_0xb6726a['query']=_['keys'](_0x6f9cba[_0xef7a('0x34')]);_0xb6726a[_0xef7a('0x49')]=_[_0xef7a('0x36')](_0xb6726a[_0xef7a('0x32')],_0xb6726a['query']);_0x171196['attributes']=_[_0xef7a('0x36')](_0xb6726a[_0xef7a('0x32')],qs[_0xef7a('0x38')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x38')]));_0x171196[_0xef7a('0x37')]=_0x171196[_0xef7a('0x37')][_0xef7a('0x39')]?_0x171196['attributes']:_0xb6726a[_0xef7a('0x32')];_0x171196[_0xef7a('0x71')]=qs[_0xef7a('0x3c')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x3c')]);_0x171196[_0xef7a('0x3d')]=qs[_0xef7a('0x49')](_[_0xef7a('0x3e')](_0x6f9cba[_0xef7a('0x34')],_0xb6726a[_0xef7a('0x49')]));if(_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x3f')]){_0x171196[_0xef7a('0x3d')]=_[_0xef7a('0x40')](_0x171196[_0xef7a('0x3d')],{'$or':_[_0xef7a('0x2f')](_0x171196[_0xef7a('0x37')],function(_0x452cf7){var _0x29b79d={};_0x29b79d[_0x452cf7]={'$like':'%'+_0x6f9cba['query'][_0xef7a('0x3f')]+'%'};return _0x29b79d;})});}_0x171196=_[_0xef7a('0x40')]({},_0x171196,_0x6f9cba[_0xef7a('0x42')]);return _0x5c9429[_0xef7a('0x70')](_0x171196);}})['then'](function(_0x9eb8b3){if(_0x9eb8b3){_0x12affd=_0x9eb8b3[_0xef7a('0x39')];if(!_0x6f9cba['query'][_0xef7a('0x3a')](_0xef7a('0x3b'))){_0x171196[_0xef7a('0x20')]=qs[_0xef7a('0x20')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x20')]);_0x171196[_0xef7a('0x21')]=qs[_0xef7a('0x21')](_0x6f9cba[_0xef7a('0x34')][_0xef7a('0x21')]);}return _0x5c9429[_0xef7a('0x70')](_0x171196);}})[_0xef7a('0x28')](function(_0x1a2ad9){if(_0x1a2ad9){return _0x1a2ad9?{'count':_0x12affd,'rows':_0x1a2ad9}:null;}})[_0xef7a('0x28')](respondWithResult(_0xdefc47,null))[_0xef7a('0x5a')](handleError(_0xdefc47,null));}; \ No newline at end of file +var _0x3ab3=['Sound','getSounds','pick','hasOwnProperty','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','nolimit','sort','filter','where','merge','type','options','include','findAll','rows','catch','params','keys','length','find','update','body','transaction','files','join','root','server/files/moh','create','directory','0777','role','user','UserProfileSection','MusicOnHolds','sequelize','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2'];(function(_0x4d4c85,_0x496cb2){var _0x39a66b=function(_0x994163){while(--_0x994163){_0x4d4c85['push'](_0x4d4c85['shift']());}};_0x39a66b(++_0x496cb2);}(_0x3ab3,0x1a8));var _0x33ab=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x3ab3[_0x4e0a03];return _0x2478fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33ab('0x0'));var zipdir=require(_0x33ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x33ab('0x2'));var BPromise=require(_0x33ab('0x3'));var Mustache=require(_0x33ab('0x4'));var util=require(_0x33ab('0x5'));var path=require(_0x33ab('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x33ab('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33ab('0x8'));var squel=require(_0x33ab('0x9'));var crypto=require(_0x33ab('0xa'));var jsforce=require(_0x33ab('0xb'));var deskjs=require(_0x33ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x33ab('0xd'));var Papa=require('papaparse');var Redis=require(_0x33ab('0xe'));var authService=require(_0x33ab('0xf'));var qs=require(_0x33ab('0x10'));var as=require(_0x33ab('0x11'));var hardwareService=require(_0x33ab('0x12'));var logger=require(_0x33ab('0x13'))('api');var utils=require(_0x33ab('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x33ab('0x15'));var db=require(_0x33ab('0x16'))['db'];function respondWithStatusCode(_0xa74093,_0x2ecea3){_0x2ecea3=_0x2ecea3||0xcc;return function(_0x45ae3d){if(_0x45ae3d){return _0xa74093[_0x33ab('0x17')](_0x2ecea3);}return _0xa74093['status'](_0x2ecea3)[_0x33ab('0x18')]();};}function respondWithResult(_0x10fbe4,_0x2f0f4c){_0x2f0f4c=_0x2f0f4c||0xc8;return function(_0x2cc910){if(_0x2cc910){return _0x10fbe4[_0x33ab('0x19')](_0x2f0f4c)['json'](_0x2cc910);}};}function respondWithFilteredResult(_0x1ac5c6,_0x373034){return function(_0x159e4c){if(_0x159e4c){var _0x5513c9=typeof _0x373034['offset']==='undefined'&&typeof _0x373034[_0x33ab('0x1a')]==='undefined';var _0x557b77=_0x159e4c[_0x33ab('0x1b')];var _0x281ef9=_0x5513c9?0x0:_0x373034[_0x33ab('0x1c')];var _0x4dbbe7=_0x5513c9?_0x159e4c['count']:_0x373034[_0x33ab('0x1c')]+_0x373034[_0x33ab('0x1a')];var _0x41443a;if(_0x4dbbe7>=_0x557b77){_0x4dbbe7=_0x557b77;_0x41443a=0xc8;}else{_0x41443a=0xce;}_0x1ac5c6[_0x33ab('0x19')](_0x41443a);return _0x1ac5c6[_0x33ab('0x1d')]('Content-Range',_0x281ef9+'-'+_0x4dbbe7+'/'+_0x557b77)['json'](_0x159e4c);}return null;};}function patchUpdates(_0x3ad437){return function(_0xbbc6dc){try{jsonpatch[_0x33ab('0x1e')](_0xbbc6dc,_0x3ad437,!![]);}catch(_0xd15512){return BPromise[_0x33ab('0x1f')](_0xd15512);}return _0xbbc6dc[_0x33ab('0x20')]();};}function saveUpdates(_0x40daec,_0x18e9dd){return function(_0x4c5942){if(_0x4c5942){return _0x4c5942['update'](_0x40daec)[_0x33ab('0x21')](function(_0x39b99f){return _0x39b99f;});}return null;};}function removeEntity(_0x47f7df,_0x3c03b7){return function(_0x76811b){if(_0x76811b){return _0x76811b[_0x33ab('0x22')]()[_0x33ab('0x21')](function(){var _0x4158e0=_0x76811b[_0x33ab('0x23')]({'plain':!![]});var _0x24fdbb='MusicOnHolds';return db[_0x33ab('0x24')][_0x33ab('0x22')]({'where':{'type':_0x24fdbb,'resourceId':_0x4158e0['id']}})[_0x33ab('0x21')](function(){return _0x76811b;});})['then'](function(){_0x47f7df[_0x33ab('0x19')](0xcc)[_0x33ab('0x18')]();});}};}function handleEntityNotFound(_0x1bedc0,_0x439e29){return function(_0x447f17){if(!_0x447f17){_0x1bedc0['sendStatus'](0x194);}return _0x447f17;};}function handleError(_0x513acd,_0x5d510c){_0x5d510c=_0x5d510c||0x1f4;return function(_0x3b7e4c){logger[_0x33ab('0x25')](_0x3b7e4c[_0x33ab('0x26')]);if(_0x3b7e4c['name']){delete _0x3b7e4c[_0x33ab('0x27')];}_0x513acd[_0x33ab('0x19')](_0x5d510c)[_0x33ab('0x28')](_0x3b7e4c);};}exports[_0x33ab('0x29')]=function(_0x53053d,_0x402fd0){var _0x527666={},_0x53c633={},_0x12872b={'count':0x0,'rows':[]};var _0x5a2051=_[_0x33ab('0x2a')](db[_0x33ab('0x2b')][_0x33ab('0x2c')],function(_0x204c75){return{'name':_0x204c75[_0x33ab('0x2d')],'type':_0x204c75['type'][_0x33ab('0x2e')]};});_0x53c633[_0x33ab('0x2f')]=_[_0x33ab('0x2a')](_0x5a2051,_0x33ab('0x27'));_0x53c633[_0x33ab('0x30')]=_['keys'](_0x53053d[_0x33ab('0x30')]);_0x53c633[_0x33ab('0x31')]=_['intersection'](_0x53c633[_0x33ab('0x2f')],_0x53c633[_0x33ab('0x30')]);_0x527666[_0x33ab('0x32')]=_[_0x33ab('0x33')](_0x53c633['model'],qs[_0x33ab('0x34')](_0x53053d['query'][_0x33ab('0x34')]));_0x527666['attributes']=_0x527666[_0x33ab('0x32')]['length']?_0x527666[_0x33ab('0x32')]:_0x53c633[_0x33ab('0x2f')];if(!_0x53053d[_0x33ab('0x30')]['hasOwnProperty'](_0x33ab('0x35'))){_0x527666[_0x33ab('0x1a')]=qs[_0x33ab('0x1a')](_0x53053d[_0x33ab('0x30')][_0x33ab('0x1a')]);_0x527666['offset']=qs[_0x33ab('0x1c')](_0x53053d['query'][_0x33ab('0x1c')]);}_0x527666['order']=qs[_0x33ab('0x36')](_0x53053d['query'][_0x33ab('0x36')]);delete _0x53053d['query'][_0x33ab('0x36')];_0x527666['where']=qs[_0x33ab('0x31')](_['pick'](_0x53053d[_0x33ab('0x30')],_0x53c633[_0x33ab('0x31')]),_0x5a2051);if(_0x53053d[_0x33ab('0x30')][_0x33ab('0x37')]){_0x527666[_0x33ab('0x38')]=_[_0x33ab('0x39')](_0x527666[_0x33ab('0x38')],{'$or':_[_0x33ab('0x2a')](_0x5a2051,function(_0x253a39){if(_0x253a39[_0x33ab('0x3a')]!=='VIRTUAL'){var _0x352534={};_0x352534[_0x253a39[_0x33ab('0x27')]]={'$like':'%'+_0x53053d[_0x33ab('0x30')]['filter']+'%'};return _0x352534;}})});}_0x527666=_['merge']({},_0x527666,_0x53053d[_0x33ab('0x3b')]);var _0x165093={'where':_0x527666[_0x33ab('0x38')]};return db[_0x33ab('0x2b')][_0x33ab('0x1b')](_0x165093)['then'](function(_0x323f92){_0x12872b['count']=_0x323f92;if(_0x53053d['query']['includeAll']){_0x527666[_0x33ab('0x3c')]=[{'all':!![]}];}return db[_0x33ab('0x2b')][_0x33ab('0x3d')](_0x527666);})['then'](function(_0x49f623){_0x12872b[_0x33ab('0x3e')]=_0x49f623;return _0x12872b;})[_0x33ab('0x21')](respondWithFilteredResult(_0x402fd0,_0x527666))[_0x33ab('0x3f')](handleError(_0x402fd0,null));};exports['show']=function(_0xcaf162,_0x4c449a){var _0x2b9fc8={'raw':![],'where':{'id':_0xcaf162[_0x33ab('0x40')]['id']}},_0x298b17={};_0x298b17[_0x33ab('0x2f')]=_[_0x33ab('0x41')](db[_0x33ab('0x2b')][_0x33ab('0x2c')]);_0x298b17[_0x33ab('0x30')]=_[_0x33ab('0x41')](_0xcaf162['query']);_0x298b17['filters']=_[_0x33ab('0x33')](_0x298b17['model'],_0x298b17[_0x33ab('0x30')]);_0x2b9fc8[_0x33ab('0x32')]=_['intersection'](_0x298b17['model'],qs[_0x33ab('0x34')](_0xcaf162['query'][_0x33ab('0x34')]));_0x2b9fc8[_0x33ab('0x32')]=_0x2b9fc8[_0x33ab('0x32')][_0x33ab('0x42')]?_0x2b9fc8['attributes']:_0x298b17['model'];if(_0xcaf162[_0x33ab('0x30')]['includeAll']){_0x2b9fc8['include']=[{'all':!![]}];}_0x2b9fc8=_[_0x33ab('0x39')]({},_0x2b9fc8,_0xcaf162[_0x33ab('0x3b')]);return db['VoiceMusicOnHold'][_0x33ab('0x43')](_0x2b9fc8)[_0x33ab('0x21')](handleEntityNotFound(_0x4c449a,null))[_0x33ab('0x21')](respondWithResult(_0x4c449a,null))[_0x33ab('0x3f')](handleError(_0x4c449a,null));};exports[_0x33ab('0x44')]=function(_0x5f2d93,_0xe0e6f6){if(_0x5f2d93[_0x33ab('0x45')]['id']){delete _0x5f2d93[_0x33ab('0x45')]['id'];}return db['VoiceMusicOnHold'][_0x33ab('0x43')]({'where':{'id':_0x5f2d93['params']['id']}})['then'](handleEntityNotFound(_0xe0e6f6,null))[_0x33ab('0x21')](saveUpdates(_0x5f2d93[_0x33ab('0x45')],null))[_0x33ab('0x21')](respondWithResult(_0xe0e6f6,null))['catch'](handleError(_0xe0e6f6,null));};exports['create']=function(_0x451118,_0xd4dcd9,_0x1bd37c){return db['sequelize'][_0x33ab('0x46')](function(_0x364be4){if(_0x451118[_0x33ab('0x45')]['mode']===_0x33ab('0x47')){_0x451118['body']['directory']=path[_0x33ab('0x48')](config[_0x33ab('0x49')],_0x33ab('0x4a'),_0x451118[_0x33ab('0x45')][_0x33ab('0x27')]);}return db[_0x33ab('0x2b')][_0x33ab('0x4b')](_0x451118['body'],{'transaction':_0x364be4})[_0x33ab('0x21')](function(_0x223739){if(_0x451118[_0x33ab('0x45')]['mode']===_0x33ab('0x47')){fs['mkdirSync'](_0x223739[_0x33ab('0x4c')],parseInt(_0x33ab('0x4d'),0x8));}var _0x2842c8=_0x451118['user'][_0x33ab('0x23')]({'plain':!![]});if(!_0x2842c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2842c8[_0x33ab('0x4e')]===_0x33ab('0x4f')){var _0x367ddc=_0x223739[_0x33ab('0x23')]({'plain':!![]});return db[_0x33ab('0x50')][_0x33ab('0x43')]({'where':{'name':_0x33ab('0x51'),'userProfileId':_0x2842c8['userProfileId']},'raw':!![]})['then'](function(_0x171101){if(_0x171101&&_0x171101['autoAssociation']===0x0){return db[_0x33ab('0x24')]['create']({'name':_0x367ddc[_0x33ab('0x27')],'resourceId':_0x367ddc['id'],'type':_0x171101[_0x33ab('0x27')],'sectionId':_0x171101['id']},{})['then'](function(){return _0x223739;});}else{return _0x223739;}})[_0x33ab('0x3f')](function(_0x476a7e){logger[_0x33ab('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x476a7e);});}return _0x223739;});})[_0x33ab('0x21')](respondWithResult(_0xd4dcd9,0xc9))[_0x33ab('0x3f')](handleError(_0xd4dcd9,null));};exports[_0x33ab('0x22')]=function(_0x3509b9,_0x4297a6,_0x4f63b2){var _0x1e9561;return db[_0x33ab('0x2b')][_0x33ab('0x43')]({'where':{'id':_0x3509b9[_0x33ab('0x40')]['id']}})[_0x33ab('0x21')](function(_0x1b7690){if(_0x1b7690){return db[_0x33ab('0x52')][_0x33ab('0x46')](function(_0x520a97){return _0x1b7690[_0x33ab('0x22')]({'transaction':_0x520a97,'raw':!![]})['then'](function(_0x26e312){if(_0x26e312['directory']){fs[_0x33ab('0x53')](_0x26e312[_0x33ab('0x4c')])[_0x33ab('0x54')](function(_0x5bb908){fs[_0x33ab('0x55')](path[_0x33ab('0x48')](_0x26e312[_0x33ab('0x4c')],_0x5bb908));});fs['rmdirSync'](_0x26e312[_0x33ab('0x4c')]);}return _0x26e312;});})[_0x33ab('0x3f')](function(_0x44664a){throw new db[(_0x33ab('0x56'))][(_0x33ab('0x57'))](_0x44664a[_0x33ab('0x58')]);});}})[_0x33ab('0x21')](handleEntityNotFound(_0x4297a6,null))[_0x33ab('0x21')](removeEntity(_0x4297a6,null))[_0x33ab('0x3f')](handleError(_0x4297a6,null));};exports[_0x33ab('0x59')]=function(_0x20dcd8,_0x5c2c11,_0xa8140a){return db[_0x33ab('0x52')][_0x33ab('0x46')](function(_0x3704cb){var _0x2198e0;return db['VoiceMusicOnHold'][_0x33ab('0x43')]({'where':{'id':_0x20dcd8['params']['id']}})['then'](function(_0x354881){if(_0x354881){_0x2198e0=_0x354881;return _0x354881[_0x33ab('0x59')](_0x20dcd8[_0x33ab('0x45')]['id'],{'transaction':_0x3704cb});}})[_0x33ab('0x21')](function(_0x2e7d6b){if(_0x2e7d6b){return db['Sound'][_0x33ab('0x5a')]({'where':{'id':_0x20dcd8['body']['id']},'attributes':['id',_0x33ab('0x27'),_0x33ab('0x5b'),'converted_format',_0x33ab('0x5c')],'raw':!![]});}})[_0x33ab('0x21')](function(_0x1c18aa){if(_0x1c18aa){var _0x588fc3=path[_0x33ab('0x48')](config[_0x33ab('0x49')],_0x33ab('0x5d'),util['format'](_0x33ab('0x5e'),path[_0x33ab('0x5f')](_0x1c18aa['save_name'],path[_0x33ab('0x60')](_0x1c18aa[_0x33ab('0x5b')])),_0x1c18aa[_0x33ab('0x61')]));var _0x4a7af2=path['join'](config[_0x33ab('0x49')],'server/files/moh',_0x2198e0[_0x33ab('0x27')],util['format'](_0x33ab('0x5e'),_0x1c18aa[_0x33ab('0x27')],_0x1c18aa[_0x33ab('0x61')]));fs[_0x33ab('0x62')](_0x588fc3,_0x4a7af2);return _0x1c18aa;}})['catch'](function(_0x139d1d){throw new db[(_0x33ab('0x56'))][(_0x33ab('0x57'))](_0x139d1d[_0x33ab('0x58')]);});})[_0x33ab('0x21')](handleEntityNotFound(_0x5c2c11,null))[_0x33ab('0x21')](respondWithResult(_0x5c2c11,0xc9))[_0x33ab('0x3f')](handleError(_0x5c2c11,null));};exports['removeSound']=function(_0x62ab4b,_0x201580,_0x273f8a){return db[_0x33ab('0x52')]['transaction'](function(_0x53239e){var _0x4185c2;return db[_0x33ab('0x2b')][_0x33ab('0x5a')]({'where':{'id':_0x62ab4b[_0x33ab('0x40')]['id']}})[_0x33ab('0x21')](handleEntityNotFound(_0x201580,null))[_0x33ab('0x21')](function(_0x1f1e4c){if(_0x1f1e4c){_0x4185c2=_0x1f1e4c;return _0x1f1e4c[_0x33ab('0x63')](_0x62ab4b['params'][_0x33ab('0x64')]);}})['then'](function(_0x38c955){if(_0x38c955){return db[_0x33ab('0x65')][_0x33ab('0x5a')]({'where':{'id':_0x62ab4b[_0x33ab('0x40')][_0x33ab('0x64')]},'attributes':['id',_0x33ab('0x27'),'save_name',_0x33ab('0x61'),_0x33ab('0x5c')],'raw':!![]});}})[_0x33ab('0x21')](function(_0x4042bf){if(_0x4042bf){fs[_0x33ab('0x55')](path[_0x33ab('0x48')](_0x4185c2['directory'],util['format'](_0x33ab('0x5e'),_0x4042bf[_0x33ab('0x27')],_0x4042bf['converted_format'])));return _0x4042bf;}})[_0x33ab('0x3f')](function(_0x3884e9){throw new db[(_0x33ab('0x56'))][(_0x33ab('0x57'))](_0x3884e9[_0x33ab('0x58')]);});})[_0x33ab('0x21')](handleEntityNotFound(_0x201580,null))[_0x33ab('0x21')](respondWithStatusCode(_0x201580,0xcc))[_0x33ab('0x3f')](handleError(_0x201580,null));};exports[_0x33ab('0x66')]=function(_0x84f15f,_0x214675,_0x4a9351){var _0x2b9664={};var _0x1a6902={};var _0x1a138e;var _0x5f17cd;return db[_0x33ab('0x2b')][_0x33ab('0x5a')]({'where':{'id':_0x84f15f['params']['id']}})['then'](handleEntityNotFound(_0x214675,null))[_0x33ab('0x21')](function(_0x1a5f47){if(_0x1a5f47){_0x1a138e=_0x1a5f47;_0x1a6902[_0x33ab('0x2f')]=_[_0x33ab('0x41')](db[_0x33ab('0x65')][_0x33ab('0x2c')]);_0x1a6902[_0x33ab('0x30')]=_['keys'](_0x84f15f['query']);_0x1a6902[_0x33ab('0x31')]=_['intersection'](_0x1a6902[_0x33ab('0x2f')],_0x1a6902['query']);_0x2b9664[_0x33ab('0x32')]=_[_0x33ab('0x33')](_0x1a6902[_0x33ab('0x2f')],qs[_0x33ab('0x34')](_0x84f15f[_0x33ab('0x30')][_0x33ab('0x34')]));_0x2b9664['attributes']=_0x2b9664['attributes'][_0x33ab('0x42')]?_0x2b9664['attributes']:_0x1a6902[_0x33ab('0x2f')];_0x2b9664['order']=qs[_0x33ab('0x36')](_0x84f15f['query'][_0x33ab('0x36')]);_0x2b9664['where']=qs[_0x33ab('0x31')](_[_0x33ab('0x67')](_0x84f15f[_0x33ab('0x30')],_0x1a6902['filters']));if(_0x84f15f['query'][_0x33ab('0x37')]){_0x2b9664['where']=_[_0x33ab('0x39')](_0x2b9664[_0x33ab('0x38')],{'$or':_[_0x33ab('0x2a')](_0x2b9664['attributes'],function(_0x2c0543){var _0x309de1={};_0x309de1[_0x2c0543]={'$like':'%'+_0x84f15f[_0x33ab('0x30')]['filter']+'%'};return _0x309de1;})});}_0x2b9664=_[_0x33ab('0x39')]({},_0x2b9664,_0x84f15f['options']);return _0x1a138e['getSounds'](_0x2b9664);}})[_0x33ab('0x21')](function(_0x4a29f6){if(_0x4a29f6){_0x5f17cd=_0x4a29f6[_0x33ab('0x42')];if(!_0x84f15f[_0x33ab('0x30')][_0x33ab('0x68')]('nolimit')){_0x2b9664[_0x33ab('0x1a')]=qs[_0x33ab('0x1a')](_0x84f15f[_0x33ab('0x30')]['limit']);_0x2b9664['offset']=qs[_0x33ab('0x1c')](_0x84f15f['query'][_0x33ab('0x1c')]);}return _0x1a138e[_0x33ab('0x66')](_0x2b9664);}})['then'](function(_0x447c20){if(_0x447c20){return _0x447c20?{'count':_0x5f17cd,'rows':_0x447c20}:null;}})[_0x33ab('0x21')](respondWithResult(_0x214675,null))[_0x33ab('0x3f')](handleError(_0x214675,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 90bc364..41b4f6c 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 _0xc5df=['../../config/environment','exports','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc5df,0x1cc));var _0xfc5d=function(_0x2723be,_0x74d706){_0x2723be=_0x2723be-0x0;var _0xeacc25=_0xc5df[_0x2723be];return _0xeacc25;};'use strict';var _=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var logger=require('../../config/logger')(_0xfc5d('0x2'));var moment=require(_0xfc5d('0x3'));var BPromise=require(_0xfc5d('0x4'));var rp=require(_0xfc5d('0x5'));var fs=require('fs');var path=require(_0xfc5d('0x6'));var rimraf=require(_0xfc5d('0x7'));var config=require(_0xfc5d('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xfc5d('0x9')]=function(_0x1afa6a,_0x3e5562){return _0x1afa6a[_0xfc5d('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0xfc5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03d4=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x03d4,0x123));var _0x403d=function(_0x12d642,_0x32a04b){_0x12d642=_0x12d642-0x0;var _0x437308=_0x03d4[_0x12d642];return _0x437308;};'use strict';var _=require(_0x403d('0x0'));var util=require(_0x403d('0x1'));var logger=require(_0x403d('0x2'))(_0x403d('0x3'));var moment=require(_0x403d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x403d('0x5'));var rimraf=require(_0x403d('0x6'));var config=require(_0x403d('0x7'));var attributes=require(_0x403d('0x8'));module[_0x403d('0x9')]=function(_0x5c0fb3,_0x3efb7b){return _0x5c0fb3[_0x403d('0xa')](_0x403d('0xb'),attributes,{'tableName':_0x403d('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 d25949f..0aaa0bd 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x16a87e,_0x558078){var _0x12ea77=function(_0x319882){while(--_0x319882){_0x16a87e['push'](_0x16a87e['shift']());}};_0x12ea77(++_0x558078);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3a922c,_0x4ac58e){var _0x4f2cf3=function(_0x288112){while(--_0x288112){_0x3a922c['push'](_0x3a922c['shift']());}};_0x4f2cf3(++_0x4ac58e);}(_0x70e0,0x17b));var _0x070e=function(_0x1e8d24,_0x761937){_0x1e8d24=_0x1e8d24-0x0;var _0x5fc649=_0x70e0[_0x1e8d24];return _0x5fc649;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 2076203..4d835a4 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 _0x0bde=['Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','create','addAgents','post','/:id/teams','addTeams','put','destroy','delete','removeTeams','exports','util','connect-timeout','express'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0x8')](_0xe0bd('0xf'),auth[_0xe0bd('0x9')](),controller['getAgents']);router['get']('/:id/teams',auth[_0xe0bd('0x9')](),controller['getTeams']);router['post']('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['post'](_0xe0bd('0xf'),auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router[_0xe0bd('0x12')](_0xe0bd('0x13'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x14')]);router[_0xe0bd('0x15')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x16')]);router[_0xe0bd('0x17')](_0xe0bd('0xf'),auth[_0xe0bd('0x9')](),controller['removeAgents']);router['delete'](_0xe0bd('0x13'),auth['isAuthenticated'](),controller[_0xe0bd('0x18')]);module[_0xe0bd('0x19')]=router; \ No newline at end of file +var _0x5643=['/describe','show','getTeams','post','create','/:id/users','addAgents','addTeams','put','/:id','update','destroy','delete','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5643,0x1a3));var _0x3564=function(_0x3e1922,_0x4a11e3){_0x3e1922=_0x3e1922-0x0;var _0x2790fa=_0x5643[_0x3e1922];return _0x2790fa;};'use strict';var multer=require(_0x3564('0x0'));var util=require(_0x3564('0x1'));var path=require(_0x3564('0x2'));var timeout=require('connect-timeout');var express=require(_0x3564('0x3'));var router=express[_0x3564('0x4')]();var fs_extra=require(_0x3564('0x5'));var auth=require(_0x3564('0x6'));var interaction=require(_0x3564('0x7'));var config=require(_0x3564('0x8'));var controller=require(_0x3564('0x9'));router['get']('/',auth[_0x3564('0xa')](),controller[_0x3564('0xb')]);router[_0x3564('0xc')](_0x3564('0xd'),auth[_0x3564('0xa')](),controller['describe']);router[_0x3564('0xc')]('/:id',auth[_0x3564('0xa')](),controller[_0x3564('0xe')]);router[_0x3564('0xc')]('/:id/users',auth[_0x3564('0xa')](),controller['getAgents']);router[_0x3564('0xc')]('/:id/teams',auth[_0x3564('0xa')](),controller[_0x3564('0xf')]);router[_0x3564('0x10')]('/',auth['isAuthenticated'](),controller[_0x3564('0x11')]);router[_0x3564('0x10')](_0x3564('0x12'),auth[_0x3564('0xa')](),controller[_0x3564('0x13')]);router['post']('/:id/teams',auth[_0x3564('0xa')](),controller[_0x3564('0x14')]);router[_0x3564('0x15')](_0x3564('0x16'),auth['isAuthenticated'](),controller[_0x3564('0x17')]);router['delete']('/:id',auth[_0x3564('0xa')](),controller[_0x3564('0x18')]);router[_0x3564('0x19')](_0x3564('0x12'),auth['isAuthenticated'](),controller[_0x3564('0x1a')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);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 8fefc5a..f8a33f9 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 _0xf042=['VIRTUAL','system-','STRING','sequelize','exports','name'];(function(_0xa2dcd4,_0x4850de){var _0xa3f789=function(_0xc2b0fe){while(--_0xc2b0fe){_0xa2dcd4['push'](_0xa2dcd4['shift']());}};_0xa3f789(++_0x4850de);}(_0xf042,0xcf));var _0x2f04=function(_0x370c14,_0x507a12){_0x370c14=_0x370c14-0x0;var _0x1e6a3c=_0xf042[_0x370c14];return _0x1e6a3c;};'use strict';var Sequelize=require(_0x2f04('0x0'));module[_0x2f04('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2f04('0x2')},'prefix':{'type':Sequelize[_0x2f04('0x3')],'get':function(_0x532a69){return _0x2f04('0x4')+this['getDataValue'](_0x2f04('0x2'))+'-';}},'description':{'type':Sequelize[_0x2f04('0x5')]},'callerIdAll':{'type':Sequelize[_0x2f04('0x5')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe46f=['name','sequelize','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0x16f1e7,_0x387f09){var _0x49651c=function(_0x5baac4){while(--_0x5baac4){_0x16f1e7['push'](_0x16f1e7['shift']());}};_0x49651c(++_0x387f09);}(_0xe46f,0x1a5));var _0xfe46=function(_0x1b9c2a,_0x50582e){_0x1b9c2a=_0x1b9c2a-0x0;var _0x21ab47=_0xe46f[_0x1b9c2a];return _0x21ab47;};'use strict';var Sequelize=require(_0xfe46('0x0'));module[_0xfe46('0x1')]={'name':{'type':Sequelize[_0xfe46('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xfe46('0x3')],'get':function(_0x13820b){return _0xfe46('0x4')+this[_0xfe46('0x5')](_0xfe46('0x6'))+'-';}},'description':{'type':Sequelize[_0xfe46('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5b77d6f..55a3e36 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 _0x1a37=['User','getTeams','Team','hasOwnProperty','addTeams','findAll','online','interface','Agents','each','upsert','findOrCreate','forEach','removeTeams','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','end','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','NoOp','${EXTEN:','charAt','sequelize','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x1a37,0xb4));var _0x71a3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1a37[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];config[_0x71a3('0x18')]=_[_0x71a3('0x19')](config[_0x71a3('0x18')],{'host':_0x71a3('0x1a'),'port':0x18eb});var socket=require(_0x71a3('0x1b'))(new Redis(config[_0x71a3('0x18')]));require(_0x71a3('0x1c'))[_0x71a3('0x1d')](socket);function respondWithStatusCode(_0x203ee1,_0x21a34d){_0x21a34d=_0x21a34d||0xcc;return function(_0x5a40c3){if(_0x5a40c3){return _0x203ee1[_0x71a3('0x1e')](_0x21a34d);}return _0x203ee1[_0x71a3('0x1f')](_0x21a34d)['end']();};}function respondWithResult(_0x4aa918,_0x41fe1c){_0x41fe1c=_0x41fe1c||0xc8;return function(_0x3a1c81){if(_0x3a1c81){return _0x4aa918[_0x71a3('0x1f')](_0x41fe1c)[_0x71a3('0x20')](_0x3a1c81);}};}function respondWithFilteredResult(_0x1af1bc,_0x318ff6){return function(_0x5d4dee){if(_0x5d4dee){var _0x656cd2=typeof _0x318ff6[_0x71a3('0x21')]==='undefined'&&typeof _0x318ff6['limit']===_0x71a3('0x22');var _0x250db3=_0x5d4dee[_0x71a3('0x23')];var _0x1c4ec2=_0x656cd2?0x0:_0x318ff6[_0x71a3('0x21')];var _0x596328=_0x656cd2?_0x5d4dee[_0x71a3('0x23')]:_0x318ff6[_0x71a3('0x21')]+_0x318ff6[_0x71a3('0x24')];var _0x3ea036;if(_0x596328>=_0x250db3){_0x596328=_0x250db3;_0x3ea036=0xc8;}else{_0x3ea036=0xce;}_0x1af1bc[_0x71a3('0x1f')](_0x3ea036);return _0x1af1bc['set'](_0x71a3('0x25'),_0x1c4ec2+'-'+_0x596328+'/'+_0x250db3)['json'](_0x5d4dee);}return null;};}function patchUpdates(_0x3bf78e){return function(_0x35d1d4){try{jsonpatch[_0x71a3('0x26')](_0x35d1d4,_0x3bf78e,!![]);}catch(_0x21899d){return BPromise[_0x71a3('0x27')](_0x21899d);}return _0x35d1d4[_0x71a3('0x28')]();};}function saveUpdates(_0x5f33c5,_0x26e6e7){return function(_0x299d1d){if(_0x299d1d){return _0x299d1d[_0x71a3('0x29')](_0x5f33c5)[_0x71a3('0x2a')](function(_0xb0f3aa){return _0xb0f3aa;});}return null;};}function removeEntity(_0x4fd214,_0x107fbd){return function(_0x2b414d){if(_0x2b414d){return _0x2b414d['destroy']()[_0x71a3('0x2a')](function(){var _0x515519=_0x2b414d[_0x71a3('0x2b')]({'plain':!![]});var _0x2fd3b6=_0x71a3('0x2c');return db[_0x71a3('0x2d')][_0x71a3('0x2e')]({'where':{'type':_0x2fd3b6,'resourceId':_0x515519['id']}})[_0x71a3('0x2a')](function(){return _0x2b414d;});})[_0x71a3('0x2a')](function(){_0x4fd214[_0x71a3('0x1f')](0xcc)[_0x71a3('0x2f')]();});}};}function handleEntityNotFound(_0x3fc578,_0x3ea7aa){return function(_0x228afa){if(!_0x228afa){_0x3fc578['sendStatus'](0x194);}return _0x228afa;};}function handleError(_0x26fd9f,_0x1719e6){_0x1719e6=_0x1719e6||0x1f4;return function(_0x334db0){logger[_0x71a3('0x30')](_0x334db0['stack']);if(_0x334db0[_0x71a3('0x31')]){delete _0x334db0[_0x71a3('0x31')];}_0x26fd9f[_0x71a3('0x1f')](_0x1719e6)[_0x71a3('0x32')](_0x334db0);};}exports[_0x71a3('0x33')]=function(_0xa82e46,_0x1d09bd){var _0x5af615={},_0x2ccd54={},_0x3c16ef={'count':0x0,'rows':[]};var _0x3aaf63=_[_0x71a3('0x34')](db[_0x71a3('0x35')][_0x71a3('0x36')],function(_0x425d83){return{'name':_0x425d83[_0x71a3('0x37')],'type':_0x425d83[_0x71a3('0x38')][_0x71a3('0x39')]};});_0x2ccd54[_0x71a3('0x3a')]=_[_0x71a3('0x34')](_0x3aaf63,_0x71a3('0x31'));_0x2ccd54['query']=_['keys'](_0xa82e46[_0x71a3('0x3b')]);_0x2ccd54[_0x71a3('0x3c')]=_['intersection'](_0x2ccd54[_0x71a3('0x3a')],_0x2ccd54[_0x71a3('0x3b')]);_0x5af615['attributes']=_[_0x71a3('0x3d')](_0x2ccd54[_0x71a3('0x3a')],qs[_0x71a3('0x3e')](_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x3e')]));_0x5af615[_0x71a3('0x3f')]=_0x5af615[_0x71a3('0x3f')]['length']?_0x5af615[_0x71a3('0x3f')]:_0x2ccd54[_0x71a3('0x3a')];if(!_0xa82e46[_0x71a3('0x3b')]['hasOwnProperty'](_0x71a3('0x40'))){_0x5af615[_0x71a3('0x24')]=qs[_0x71a3('0x24')](_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x24')]);_0x5af615['offset']=qs['offset'](_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x21')]);}_0x5af615[_0x71a3('0x41')]=qs[_0x71a3('0x42')](_0xa82e46[_0x71a3('0x3b')]['sort']);_0x5af615[_0x71a3('0x43')]=qs[_0x71a3('0x3c')](_[_0x71a3('0x44')](_0xa82e46['query'],_0x2ccd54[_0x71a3('0x3c')]),_0x3aaf63);if(_0xa82e46['query'][_0x71a3('0x45')]){_0x5af615[_0x71a3('0x43')]=_[_0x71a3('0x46')](_0x5af615[_0x71a3('0x43')],{'$or':_[_0x71a3('0x34')](_0x3aaf63,function(_0x38912c){if(_0x38912c[_0x71a3('0x38')]!==_0x71a3('0x47')){var _0x31ba66={};_0x31ba66[_0x38912c[_0x71a3('0x31')]]={'$like':'%'+_0xa82e46['query'][_0x71a3('0x45')]+'%'};return _0x31ba66;}})});}_0x5af615=_['merge']({},_0x5af615,_0xa82e46[_0x71a3('0x48')]);var _0x1ed84d={'where':_0x5af615[_0x71a3('0x43')]};return db[_0x71a3('0x35')]['count'](_0x1ed84d)[_0x71a3('0x2a')](function(_0x4b4fde){_0x3c16ef['count']=_0x4b4fde;if(_0xa82e46[_0x71a3('0x3b')][_0x71a3('0x49')]){_0x5af615[_0x71a3('0x4a')]=[{'all':!![]}];}return db[_0x71a3('0x35')]['findAll'](_0x5af615);})[_0x71a3('0x2a')](function(_0x615c6f){_0x3c16ef[_0x71a3('0x4b')]=_0x615c6f;return _0x3c16ef;})[_0x71a3('0x2a')](respondWithFilteredResult(_0x1d09bd,_0x5af615))[_0x71a3('0x4c')](handleError(_0x1d09bd,null));};exports[_0x71a3('0x4d')]=function(_0x371aa5,_0x262afe){var _0x3ba2c1={'raw':![],'where':{'id':_0x371aa5[_0x71a3('0x4e')]['id']}},_0x3a18c4={};_0x3a18c4[_0x71a3('0x3a')]=_[_0x71a3('0x4f')](db[_0x71a3('0x35')][_0x71a3('0x36')]);_0x3a18c4[_0x71a3('0x3b')]=_['keys'](_0x371aa5[_0x71a3('0x3b')]);_0x3a18c4[_0x71a3('0x3c')]=_['intersection'](_0x3a18c4[_0x71a3('0x3a')],_0x3a18c4[_0x71a3('0x3b')]);_0x3ba2c1[_0x71a3('0x3f')]=_[_0x71a3('0x3d')](_0x3a18c4[_0x71a3('0x3a')],qs['fields'](_0x371aa5['query'][_0x71a3('0x3e')]));_0x3ba2c1[_0x71a3('0x3f')]=_0x3ba2c1['attributes'][_0x71a3('0x50')]?_0x3ba2c1[_0x71a3('0x3f')]:_0x3a18c4[_0x71a3('0x3a')];if(_0x371aa5[_0x71a3('0x3b')][_0x71a3('0x49')]){_0x3ba2c1[_0x71a3('0x4a')]=[{'all':!![]}];}_0x3ba2c1=_['merge']({},_0x3ba2c1,_0x371aa5[_0x71a3('0x48')]);return db['VoicePrefix'][_0x71a3('0x51')](_0x3ba2c1)[_0x71a3('0x2a')](handleEntityNotFound(_0x262afe,null))[_0x71a3('0x2a')](respondWithResult(_0x262afe,null))[_0x71a3('0x4c')](handleError(_0x262afe,null));};exports[_0x71a3('0x2e')]=function(_0x48fcd7,_0x263706){return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x48fcd7['params']['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x263706,null))['then'](removeEntity(_0x263706,null))[_0x71a3('0x4c')](handleError(_0x263706,null));};exports[_0x71a3('0x52')]=function(_0x5c6450,_0x30cea2){return db[_0x71a3('0x35')][_0x71a3('0x52')]()[_0x71a3('0x2a')](respondWithResult(_0x30cea2,null))[_0x71a3('0x4c')](handleError(_0x30cea2,null));};exports[_0x71a3('0x53')]=function(_0x13a9ed,_0x479a8a){var _0x2d4a2e;return db['sequelize'][_0x71a3('0x54')](function(_0x480e90){return db[_0x71a3('0x35')][_0x71a3('0x53')](_0x13a9ed[_0x71a3('0x55')],{'transaction':_0x480e90})[_0x71a3('0x2a')](function(_0x599059){_0x2d4a2e=_0x599059['get']({'plain':!![]});return db[_0x71a3('0x56')][_0x71a3('0x51')]({'where':{'id':_0x2d4a2e[_0x71a3('0x57')]},'raw':!![]})[_0x71a3('0x2a')](function(_0x4d9181){return createVoicePrefixExtensions(_0x2d4a2e,_0x4d9181,_0x480e90);});});})['then'](function(){var _0x464a25=_0x13a9ed[_0x71a3('0x58')][_0x71a3('0x2b')]({'plain':!![]});if(!_0x464a25)throw new Error(_0x71a3('0x59'));if(_0x464a25[_0x71a3('0x5a')]==='user'){var _0x421b6a=_0x2d4a2e;return db[_0x71a3('0x5b')][_0x71a3('0x51')]({'where':{'name':_0x71a3('0x2c'),'userProfileId':_0x464a25[_0x71a3('0x5c')]},'raw':!![]})[_0x71a3('0x2a')](function(_0x2eb690){if(_0x2eb690&&_0x2eb690[_0x71a3('0x5d')]===0x0){return db['UserProfileResource'][_0x71a3('0x53')]({'name':_0x421b6a[_0x71a3('0x31')],'resourceId':_0x421b6a['id'],'type':_0x2eb690[_0x71a3('0x31')],'sectionId':_0x2eb690['id']},{})['then'](function(){return _0x2d4a2e;});}else{return _0x2d4a2e;}})[_0x71a3('0x4c')](function(_0x3dd655){logger[_0x71a3('0x30')](_0x71a3('0x5e'),_0x3dd655);throw _0x3dd655;});}return _0x2d4a2e;})[_0x71a3('0x2a')](respondWithResult(_0x479a8a,null))[_0x71a3('0x4c')](handleError(_0x479a8a,null));};function Extension(_0x453b78,_0x302dab,_0x3ebf59,_0x11b951){this['context']=_0x71a3('0x5f');this[_0x71a3('0x60')]=_0x453b78;this['app']=_0x3ebf59;this[_0x71a3('0x38')]='system';this['description']=_0x71a3('0x61');this[_0x71a3('0x62')]=_0x302dab;this[_0x71a3('0x63')]=_0x11b951;}function createVoicePrefixExtensions(_0x3ac98c,_0x3910e3,_0x5cffd2){return new BPromise(function(_0x121b2d,_0x2b88f8){var _0x52b5c3=new Extension(formatPrefixName(_0x3ac98c[_0x71a3('0x64')]),0x1,'NoOp',_0x71a3('0x65'));_0x52b5c3[_0x71a3('0x66')]=_0x3ac98c['id'];return db['VoiceExtension']['create'](_0x52b5c3,{'transaction':_0x5cffd2})[_0x71a3('0x2a')](function(_0x39f38b){var _0x4d703a=_0x39f38b[_0x71a3('0x2b')]({'plain':!![]});var _0x97ed1b=_[_0x71a3('0x34')](addVoicePrefixExtensions(_0x3ac98c,_0x3910e3),function(_0x516526){_0x516526[_0x71a3('0x57')]=_0x4d703a['id'];_0x516526[_0x71a3('0x66')]=_0x3ac98c['id'];return _0x516526;});return db[_0x71a3('0x56')][_0x71a3('0x67')](_0x97ed1b,{'transaction':_0x5cffd2})[_0x71a3('0x2a')](function(_0x85c7ed){if(!_0x85c7ed){return _0x2b88f8(_0x71a3('0x68'));}else{return _0x121b2d(_0x85c7ed);}})[_0x71a3('0x4c')](function(_0xe03bb5){return _0x2b88f8(_0xe03bb5);});});;});};function addVoicePrefixExtensions(_0x4b6b75,_0x4e5ab1){var _0x11a2d7=[];var _0x84b636=formatPrefixName(_0x4b6b75['prefix']);_0x11a2d7[_0x71a3('0x69')](new Extension(_0x84b636,0x2,_0x71a3('0x6a'),_0x71a3('0x6b')+_0x4b6b75[_0x71a3('0x31')]));if(_0x4b6b75[_0x71a3('0x6c')]){_0x11a2d7[_0x71a3('0x69')](new Extension(_0x84b636,0x3,_0x71a3('0x6a'),_0x71a3('0x6d')+_0x4b6b75[_0x71a3('0x6c')]));}else{_0x11a2d7['push'](new Extension(_0x84b636,0x3,_0x71a3('0x6e'),'No\x20callerid\x20available'));}_0x11a2d7[_0x71a3('0x69')](new Extension(_0x84b636,0x4,'goto',_0x4e5ab1['context']+','+_0x71a3('0x6f')+(0x8+_0x4b6b75['name'][_0x71a3('0x50')])+'}'+','+0x1));return _0x11a2d7;}function formatPrefixName(_0x271e37){var _0x239d18='_';for(var _0x4aa296=0x0;_0x4aa296<_0x271e37[_0x71a3('0x50')];_0x4aa296++){if(_0x271e37[_0x71a3('0x70')](_0x4aa296)=='-'){_0x239d18+=_0x271e37['charAt'](_0x4aa296);}else{_0x239d18+='['+_0x271e37[_0x71a3('0x70')](_0x4aa296)+']';}}_0x239d18+='.';return _0x239d18;}exports[_0x71a3('0x29')]=function(_0x44a6e3,_0x1450cc,_0x4430f2){var _0xd8a124=_0x44a6e3[_0x71a3('0x55')];_0xd8a124[_0x71a3('0x64')]='system-'+_0xd8a124['name']+'-';return db[_0x71a3('0x71')][_0x71a3('0x54')](function(_0x1b3c9b){return db['VoicePrefix'][_0x71a3('0x29')](_0xd8a124,{'where':{'id':_0xd8a124['id']},'transaction':_0x1b3c9b})[_0x71a3('0x2a')](function(){return db['VoiceExtension'][_0x71a3('0x2e')]({'where':{'VoicePrefixId':_0xd8a124['id']},'transaction':_0x1b3c9b})['then'](function(){return db[_0x71a3('0x56')][_0x71a3('0x51')]({'where':{'id':_0xd8a124[_0x71a3('0x57')]},'raw':!![]})[_0x71a3('0x2a')](function(_0x528c4b){return createVoicePrefixExtensions(_0xd8a124,_0x528c4b,_0x1b3c9b);});});});})[_0x71a3('0x2a')](function(){return db[_0x71a3('0x35')]['findById'](_0xd8a124['id']);})[_0x71a3('0x2a')](respondWithResult(_0x1450cc,null))[_0x71a3('0x4c')](handleError(_0x1450cc,null));};exports[_0x71a3('0x72')]=function(_0x693a55,_0x21e7a2,_0x22c62d){return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x693a55[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x21e7a2,null))[_0x71a3('0x2a')](function(_0x19e7d1){if(_0x19e7d1){return _0x19e7d1['addAgents'](_0x693a55[_0x71a3('0x55')]['ids'],_[_0x71a3('0x73')](_0x693a55[_0x71a3('0x55')],[_0x71a3('0x74'),'id'])||{})[_0x71a3('0x75')](function(_0x3031da){for(var _0x206636=0x0;_0x206636<_0x693a55[_0x71a3('0x55')][_0x71a3('0x74')][_0x71a3('0x50')];_0x206636+=0x1){socket[_0x71a3('0x76')](_0x71a3('0x77'),{'UserId':Number(_0x693a55[_0x71a3('0x55')][_0x71a3('0x74')][_0x206636]),'VoicePrefixId':Number(_0x693a55[_0x71a3('0x4e')]['id'])});}return _0x3031da;});}})[_0x71a3('0x2a')](respondWithResult(_0x21e7a2,null))[_0x71a3('0x4c')](handleError(_0x21e7a2,null));};exports[_0x71a3('0x78')]=function(_0x295ff4,_0x6c9bb6,_0x49c6d5){return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x295ff4[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x6c9bb6,null))[_0x71a3('0x2a')](function(_0x1483ea){if(_0x1483ea){return _0x1483ea[_0x71a3('0x78')](_0x295ff4['query'][_0x71a3('0x74')])['then'](function(){if(_['isArray'](_0x295ff4['query']['ids'])){for(var _0x579faf=0x0;_0x579faf<_0x295ff4['query'][_0x71a3('0x74')][_0x71a3('0x50')];_0x579faf+=0x1){socket[_0x71a3('0x76')](_0x71a3('0x79'),{'UserId':Number(_0x295ff4[_0x71a3('0x3b')][_0x71a3('0x74')][_0x579faf]),'VoicePrefixId':Number(_0x295ff4[_0x71a3('0x4e')]['id'])});}}else{socket[_0x71a3('0x76')](_0x71a3('0x79'),{'UserId':Number(_0x295ff4[_0x71a3('0x3b')][_0x71a3('0x74')]),'VoicePrefixId':Number(_0x295ff4[_0x71a3('0x4e')]['id'])});}});}})[_0x71a3('0x2a')](respondWithStatusCode(_0x6c9bb6,null))['catch'](handleError(_0x6c9bb6,null));};exports[_0x71a3('0x7a')]=function(_0x18e375,_0x27cad5,_0x3898fa){var _0x38f928={};var _0x4af495={};var _0x50bf5e;var _0x4f2bec;return db['VoicePrefix'][_0x71a3('0x7b')]({'where':{'id':_0x18e375[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x27cad5,null))['then'](function(_0x157527){if(_0x157527){_0x50bf5e=_0x157527;_0x4af495[_0x71a3('0x3a')]=_[_0x71a3('0x4f')](db[_0x71a3('0x7c')][_0x71a3('0x36')]);_0x4af495[_0x71a3('0x3b')]=_[_0x71a3('0x4f')](_0x18e375[_0x71a3('0x3b')]);_0x4af495[_0x71a3('0x3c')]=_['intersection'](_0x4af495[_0x71a3('0x3a')],_0x4af495[_0x71a3('0x3b')]);_0x38f928['attributes']=_[_0x71a3('0x3d')](_0x4af495['model'],qs[_0x71a3('0x3e')](_0x18e375[_0x71a3('0x3b')][_0x71a3('0x3e')]));_0x38f928[_0x71a3('0x3f')]=_0x38f928[_0x71a3('0x3f')]['length']?_0x38f928[_0x71a3('0x3f')]:_0x4af495[_0x71a3('0x3a')];_0x38f928['order']=qs[_0x71a3('0x42')](_0x18e375[_0x71a3('0x3b')][_0x71a3('0x42')]);_0x38f928['where']=qs[_0x71a3('0x3c')](_[_0x71a3('0x44')](_0x18e375[_0x71a3('0x3b')],_0x4af495['filters']));if(_0x18e375['query'][_0x71a3('0x45')]){_0x38f928[_0x71a3('0x43')]=_[_0x71a3('0x46')](_0x38f928['where'],{'$or':_[_0x71a3('0x34')](_0x38f928['attributes'],function(_0x158136){var _0x405040={};_0x405040[_0x158136]={'$like':'%'+_0x18e375[_0x71a3('0x3b')]['filter']+'%'};return _0x405040;})});}_0x38f928=_[_0x71a3('0x46')]({},_0x38f928,_0x18e375['options']);return _0x50bf5e[_0x71a3('0x7a')](_0x38f928);}})[_0x71a3('0x2a')](function(_0x333ab6){if(_0x333ab6){_0x4f2bec=_0x333ab6[_0x71a3('0x50')];if(!_0x18e375[_0x71a3('0x3b')]['hasOwnProperty'](_0x71a3('0x40'))){_0x38f928[_0x71a3('0x24')]=qs['limit'](_0x18e375['query'][_0x71a3('0x24')]);_0x38f928[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x18e375['query'][_0x71a3('0x21')]);}return _0x50bf5e[_0x71a3('0x7a')](_0x38f928);}})[_0x71a3('0x2a')](function(_0x2fab3e){if(_0x2fab3e){return _0x2fab3e?{'count':_0x4f2bec,'rows':_0x2fab3e}:null;}})[_0x71a3('0x2a')](respondWithResult(_0x27cad5,null))[_0x71a3('0x4c')](handleError(_0x27cad5,null));};exports[_0x71a3('0x7d')]=function(_0x4ca034,_0x1b3b05,_0xd87f34){var _0x3e8cce={};var _0x2fc088={};var _0x5776c8;var _0xdb80f1;return db[_0x71a3('0x35')][_0x71a3('0x7b')]({'where':{'id':_0x4ca034[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](handleEntityNotFound(_0x1b3b05,null))[_0x71a3('0x2a')](function(_0x12a46c){if(_0x12a46c){_0x5776c8=_0x12a46c;_0x2fc088[_0x71a3('0x3a')]=_['keys'](db[_0x71a3('0x7e')]['rawAttributes']);_0x2fc088[_0x71a3('0x3b')]=_[_0x71a3('0x4f')](_0x4ca034[_0x71a3('0x3b')]);_0x2fc088[_0x71a3('0x3c')]=_['intersection'](_0x2fc088['model'],_0x2fc088['query']);_0x3e8cce[_0x71a3('0x3f')]=_[_0x71a3('0x3d')](_0x2fc088[_0x71a3('0x3a')],qs[_0x71a3('0x3e')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x3e')]));_0x3e8cce[_0x71a3('0x3f')]=_0x3e8cce[_0x71a3('0x3f')][_0x71a3('0x50')]?_0x3e8cce[_0x71a3('0x3f')]:_0x2fc088['model'];_0x3e8cce[_0x71a3('0x41')]=qs[_0x71a3('0x42')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x42')]);_0x3e8cce[_0x71a3('0x43')]=qs[_0x71a3('0x3c')](_['pick'](_0x4ca034[_0x71a3('0x3b')],_0x2fc088['filters']));if(_0x4ca034[_0x71a3('0x3b')]['filter']){_0x3e8cce[_0x71a3('0x43')]=_[_0x71a3('0x46')](_0x3e8cce['where'],{'$or':_[_0x71a3('0x34')](_0x3e8cce['attributes'],function(_0x3d59f8){var _0x4aca5f={};_0x4aca5f[_0x3d59f8]={'$like':'%'+_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x45')]+'%'};return _0x4aca5f;})});}_0x3e8cce=_['merge']({},_0x3e8cce,_0x4ca034[_0x71a3('0x48')]);return _0x5776c8[_0x71a3('0x7d')](_0x3e8cce);}})[_0x71a3('0x2a')](function(_0xf0bded){if(_0xf0bded){_0xdb80f1=_0xf0bded[_0x71a3('0x50')];if(!_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x7f')](_0x71a3('0x40'))){_0x3e8cce['limit']=qs[_0x71a3('0x24')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x24')]);_0x3e8cce['offset']=qs[_0x71a3('0x21')](_0x4ca034[_0x71a3('0x3b')][_0x71a3('0x21')]);}return _0x5776c8['getTeams'](_0x3e8cce);}})['then'](function(_0x2149ee){if(_0x2149ee){return _0x2149ee?{'count':_0xdb80f1,'rows':_0x2149ee}:null;}})[_0x71a3('0x2a')](respondWithResult(_0x1b3b05,null))['catch'](handleError(_0x1b3b05,null));};exports[_0x71a3('0x80')]=function(_0x844dba,_0x15d28b,_0x3137b9){var _0x902b73=_0x844dba[_0x71a3('0x55')][_0x71a3('0x74')];var _0x5709ba;return db[_0x71a3('0x7e')][_0x71a3('0x81')]({'where':{'id':_0x902b73},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x71a3('0x31'),_0x71a3('0x82'),'voicePause',_0x71a3('0x83')],'raw':!![]}]})[_0x71a3('0x2a')](function(_0x32f347){if(_0x32f347){_0x5709ba=_0x32f347;var _0x57b620=_['flatMap'](_0x32f347,function(_0x41d926){var _0x1f7ecd=_0x41d926[_0x71a3('0x2b')]({'plain':!![]});return _0x1f7ecd[_0x71a3('0x84')];});return db[_0x71a3('0x35')][_0x71a3('0x51')]({'where':{'id':_0x844dba[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](function(_0x17636b){return db['sequelize'][_0x71a3('0x54')](function(_0x5c63d0){return _0x17636b[_0x71a3('0x80')](_0x902b73,{'transaction':_0x5c63d0})[_0x71a3('0x2a')](function(){return BPromise[_0x71a3('0x85')](_0x5709ba,function(_0x474438){return db['TeamVoicePrefix'][_0x71a3('0x86')]({'TeamId':_0x474438['id'],'VoicePrefixId':_0x844dba[_0x71a3('0x4e')]['id']},{'transaction':_0x5c63d0});});})[_0x71a3('0x2a')](function(){return BPromise[_0x71a3('0x85')](_0x57b620,function(_0x26635c){return db['UserVoicePrefix'][_0x71a3('0x87')]({'where':{'UserId':_0x26635c['id'],'VoicePrefixId':_0x844dba[_0x71a3('0x4e')]['id']},'transaction':_0x5c63d0});});})['then'](function(){_0x57b620[_0x71a3('0x88')](function(_0x4cde32){socket[_0x71a3('0x76')](_0x71a3('0x77'),{'UserId':_0x4cde32['id'],'VoicePrefixId':_0x17636b['id']});});});});});}})[_0x71a3('0x2a')](respondWithStatusCode(_0x15d28b,null))[_0x71a3('0x4c')](handleError(_0x15d28b,null));};exports[_0x71a3('0x89')]=function(_0x5d880f,_0x3b8781,_0x5b6dac){return db[_0x71a3('0x7e')][_0x71a3('0x81')]({'where':{'id':_0x5d880f[_0x71a3('0x3b')][_0x71a3('0x74')]},'attributes':['id'],'include':[{'model':db[_0x71a3('0x7c')],'as':_0x71a3('0x84'),'attributes':['id'],'raw':!![]}]})[_0x71a3('0x2a')](handleEntityNotFound(_0x3b8781,null))[_0x71a3('0x2a')](function(_0x408b2a){var _0x2f7b7c=_[_0x71a3('0x34')](_0x408b2a,'id');var _0x2bd265=[];var _0x3d1710=[];var _0x17951c=squel['select']();_0x17951c['field']('tq.TeamId')[_0x71a3('0x8a')]('team_has_voice_prefixes','tq')[_0x71a3('0x8b')](_0x71a3('0x8c'),'ut',_0x71a3('0x8d'))[_0x71a3('0x43')]('VoicePrefixId\x20=\x20?',_0x5d880f[_0x71a3('0x4e')]['id']);for(var _0x44ac81=0x0;_0x44ac81<_0x408b2a[_0x71a3('0x50')];_0x44ac81+=0x1){let _0x3de32c=_0x408b2a[_0x44ac81];for(var _0x29e932=0x0;_0x29e932<_0x3de32c[_0x71a3('0x84')][_0x71a3('0x50')];_0x29e932+=0x1){let _0x15e9f7=_0x3de32c[_0x71a3('0x84')][_0x29e932];var _0x554aa2=_0x17951c[_0x71a3('0x8e')]();_0x554aa2['where']('ut.UserId\x20=\x20?',_0x15e9f7['id']);_0x3d1710[_0x71a3('0x69')](db[_0x71a3('0x71')][_0x71a3('0x3b')](_0x554aa2[_0x71a3('0x8f')](),{'type':db[_0x71a3('0x71')][_0x71a3('0x90')]['SELECT']})[_0x71a3('0x2a')](function(_0x1fca5c){if(_0x1fca5c[_0x71a3('0x50')]===0x1){return _0x15e9f7['id'];}else{var _0x47167a=_[_0x71a3('0x91')](_[_0x71a3('0x34')](_0x1fca5c,'TeamId'),function(_0x4b62e8){return _[_0x71a3('0x92')](_0x2f7b7c,_0x4b62e8);});if(_0x47167a){return _0x15e9f7['id'];}}}));}}return BPromise[_0x71a3('0x93')](_0x3d1710)[_0x71a3('0x2a')](function(_0x52f2f1){_0x2bd265=_(_0x2bd265)[_0x71a3('0x94')](_0x52f2f1)[_0x71a3('0x95')]()[_0x71a3('0x96')]();return db['VoicePrefix']['find']({'where':{'id':_0x5d880f[_0x71a3('0x4e')]['id']}})[_0x71a3('0x2a')](function(_0x4aef3e){return db[_0x71a3('0x71')][_0x71a3('0x54')](function(_0x292568){return _0x4aef3e[_0x71a3('0x89')](_0x5d880f['query'][_0x71a3('0x74')],{'transaction':_0x292568})[_0x71a3('0x2a')](function(){if(!_[_0x71a3('0x97')](_0x2bd265)){return _0x4aef3e[_0x71a3('0x78')](_0x2bd265,{'transaction':_0x292568});}})[_0x71a3('0x2a')](function(){_0x2bd265[_0x71a3('0x88')](function(_0x3a66f8){socket[_0x71a3('0x76')](_0x71a3('0x79'),{'UserId':_0x3a66f8,'VoicePrefixId':_0x4aef3e['id']});});});});});});})[_0x71a3('0x2a')](respondWithStatusCode(_0x3b8781,null))[_0x71a3('0x4c')](handleError(_0x3b8781,null));}; \ No newline at end of file +var _0xa30a=['priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','push','PREFIX-CALLERIDALL=','charAt','body','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','order','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','TeamVoicePrefix','upsert','findOrCreate','userVoicePrefix:save','removeTeams','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','map','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','params','describe','create','transaction','VoiceExtension','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension'];(function(_0x40a327,_0x520a46){var _0x1e8e3e=function(_0x545175){while(--_0x545175){_0x40a327['push'](_0x40a327['shift']());}};_0x1e8e3e(++_0x520a46);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];config[_0xaa30('0x19')]=_[_0xaa30('0x1a')](config[_0xaa30('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0x1b'))(new Redis(config[_0xaa30('0x19')]));require(_0xaa30('0x1c'))[_0xaa30('0x1d')](socket);function respondWithStatusCode(_0x41f1d9,_0x31aa0b){_0x31aa0b=_0x31aa0b||0xcc;return function(_0x3240e9){if(_0x3240e9){return _0x41f1d9[_0xaa30('0x1e')](_0x31aa0b);}return _0x41f1d9[_0xaa30('0x1f')](_0x31aa0b)[_0xaa30('0x20')]();};}function respondWithResult(_0x519518,_0x91839d){_0x91839d=_0x91839d||0xc8;return function(_0x591478){if(_0x591478){return _0x519518['status'](_0x91839d)[_0xaa30('0x21')](_0x591478);}};}function respondWithFilteredResult(_0x153939,_0x130606){return function(_0x540e36){if(_0x540e36){var _0x54fa49=typeof _0x130606['offset']===_0xaa30('0x22')&&typeof _0x130606['limit']===_0xaa30('0x22');var _0x332a0a=_0x540e36['count'];var _0x4e29f9=_0x54fa49?0x0:_0x130606['offset'];var _0x3cbf92=_0x54fa49?_0x540e36[_0xaa30('0x23')]:_0x130606[_0xaa30('0x24')]+_0x130606[_0xaa30('0x25')];var _0x43a526;if(_0x3cbf92>=_0x332a0a){_0x3cbf92=_0x332a0a;_0x43a526=0xc8;}else{_0x43a526=0xce;}_0x153939['status'](_0x43a526);return _0x153939[_0xaa30('0x26')](_0xaa30('0x27'),_0x4e29f9+'-'+_0x3cbf92+'/'+_0x332a0a)[_0xaa30('0x21')](_0x540e36);}return null;};}function patchUpdates(_0x2d9e35){return function(_0x1ff442){try{jsonpatch['apply'](_0x1ff442,_0x2d9e35,!![]);}catch(_0x325b42){return BPromise[_0xaa30('0x28')](_0x325b42);}return _0x1ff442[_0xaa30('0x29')]();};}function saveUpdates(_0x326f84,_0x57d1ca){return function(_0x14d7fa){if(_0x14d7fa){return _0x14d7fa[_0xaa30('0x2a')](_0x326f84)[_0xaa30('0x2b')](function(_0x12da2f){return _0x12da2f;});}return null;};}function removeEntity(_0x97b038,_0x2a59ce){return function(_0x55cccb){if(_0x55cccb){return _0x55cccb[_0xaa30('0x2c')]()[_0xaa30('0x2b')](function(){var _0x5d4da8=_0x55cccb[_0xaa30('0x2d')]({'plain':!![]});var _0x5b3efb=_0xaa30('0x2e');return db[_0xaa30('0x2f')][_0xaa30('0x2c')]({'where':{'type':_0x5b3efb,'resourceId':_0x5d4da8['id']}})[_0xaa30('0x2b')](function(){return _0x55cccb;});})[_0xaa30('0x2b')](function(){_0x97b038[_0xaa30('0x1f')](0xcc)[_0xaa30('0x20')]();});}};}function handleEntityNotFound(_0x39f708,_0x1f288c){return function(_0x43fb30){if(!_0x43fb30){_0x39f708[_0xaa30('0x1e')](0x194);}return _0x43fb30;};}function handleError(_0x43003f,_0x2038a6){_0x2038a6=_0x2038a6||0x1f4;return function(_0x46abb9){logger[_0xaa30('0x30')](_0x46abb9[_0xaa30('0x31')]);if(_0x46abb9[_0xaa30('0x32')]){delete _0x46abb9[_0xaa30('0x32')];}_0x43003f['status'](_0x2038a6)[_0xaa30('0x33')](_0x46abb9);};}exports[_0xaa30('0x34')]=function(_0x3bc22f,_0x20916f){var _0x2276e0={},_0x1dce4a={},_0x4dae71={'count':0x0,'rows':[]};var _0x5addbf=_['map'](db[_0xaa30('0x35')][_0xaa30('0x36')],function(_0xb48ef3){return{'name':_0xb48ef3[_0xaa30('0x37')],'type':_0xb48ef3[_0xaa30('0x38')]['key']};});_0x1dce4a['model']=_[_0xaa30('0x39')](_0x5addbf,_0xaa30('0x32'));_0x1dce4a['query']=_[_0xaa30('0x3a')](_0x3bc22f['query']);_0x1dce4a[_0xaa30('0x3b')]=_['intersection'](_0x1dce4a[_0xaa30('0x3c')],_0x1dce4a[_0xaa30('0x3d')]);_0x2276e0['attributes']=_[_0xaa30('0x3e')](_0x1dce4a[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x3f')]));_0x2276e0[_0xaa30('0x40')]=_0x2276e0['attributes'][_0xaa30('0x41')]?_0x2276e0[_0xaa30('0x40')]:_0x1dce4a['model'];if(!_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x42')](_0xaa30('0x43'))){_0x2276e0['limit']=qs['limit'](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x25')]);_0x2276e0[_0xaa30('0x24')]=qs[_0xaa30('0x24')](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x24')]);}_0x2276e0['order']=qs['sort'](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x44')]);_0x2276e0[_0xaa30('0x45')]=qs['filters'](_[_0xaa30('0x46')](_0x3bc22f[_0xaa30('0x3d')],_0x1dce4a[_0xaa30('0x3b')]),_0x5addbf);if(_0x3bc22f[_0xaa30('0x3d')]['filter']){_0x2276e0[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0x2276e0[_0xaa30('0x45')],{'$or':_[_0xaa30('0x39')](_0x5addbf,function(_0x1f6f53){if(_0x1f6f53['type']!==_0xaa30('0x48')){var _0x29cf85={};_0x29cf85[_0x1f6f53[_0xaa30('0x32')]]={'$like':'%'+_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x29cf85;}})});}_0x2276e0=_[_0xaa30('0x47')]({},_0x2276e0,_0x3bc22f[_0xaa30('0x4a')]);var _0x17510b={'where':_0x2276e0['where']};return db['VoicePrefix'][_0xaa30('0x23')](_0x17510b)['then'](function(_0x5208f8){_0x4dae71['count']=_0x5208f8;if(_0x3bc22f[_0xaa30('0x3d')]['includeAll']){_0x2276e0[_0xaa30('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0xaa30('0x4c')](_0x2276e0);})[_0xaa30('0x2b')](function(_0x3f530e){_0x4dae71[_0xaa30('0x4d')]=_0x3f530e;return _0x4dae71;})[_0xaa30('0x2b')](respondWithFilteredResult(_0x20916f,_0x2276e0))[_0xaa30('0x4e')](handleError(_0x20916f,null));};exports[_0xaa30('0x4f')]=function(_0xc1ae21,_0x3302ff){var _0x521462={'raw':![],'where':{'id':_0xc1ae21['params']['id']}},_0x334639={};_0x334639[_0xaa30('0x3c')]=_[_0xaa30('0x3a')](db[_0xaa30('0x35')][_0xaa30('0x36')]);_0x334639[_0xaa30('0x3d')]=_['keys'](_0xc1ae21['query']);_0x334639[_0xaa30('0x3b')]=_['intersection'](_0x334639[_0xaa30('0x3c')],_0x334639[_0xaa30('0x3d')]);_0x521462[_0xaa30('0x40')]=_[_0xaa30('0x3e')](_0x334639[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0xc1ae21[_0xaa30('0x3d')]['fields']));_0x521462[_0xaa30('0x40')]=_0x521462[_0xaa30('0x40')][_0xaa30('0x41')]?_0x521462['attributes']:_0x334639[_0xaa30('0x3c')];if(_0xc1ae21[_0xaa30('0x3d')]['includeAll']){_0x521462[_0xaa30('0x4b')]=[{'all':!![]}];}_0x521462=_['merge']({},_0x521462,_0xc1ae21[_0xaa30('0x4a')]);return db['VoicePrefix']['find'](_0x521462)[_0xaa30('0x2b')](handleEntityNotFound(_0x3302ff,null))['then'](respondWithResult(_0x3302ff,null))['catch'](handleError(_0x3302ff,null));};exports[_0xaa30('0x2c')]=function(_0x1083e2,_0x2574f5){return db[_0xaa30('0x35')][_0xaa30('0x50')]({'where':{'id':_0x1083e2[_0xaa30('0x51')]['id']}})['then'](handleEntityNotFound(_0x2574f5,null))[_0xaa30('0x2b')](removeEntity(_0x2574f5,null))[_0xaa30('0x4e')](handleError(_0x2574f5,null));};exports[_0xaa30('0x52')]=function(_0x57a5fa,_0x53bcaa){return db['VoicePrefix']['describe']()[_0xaa30('0x2b')](respondWithResult(_0x53bcaa,null))[_0xaa30('0x4e')](handleError(_0x53bcaa,null));};exports[_0xaa30('0x53')]=function(_0x1d5c15,_0x1cb3f9){var _0x1ed257;return db['sequelize'][_0xaa30('0x54')](function(_0x2db9d5){return db[_0xaa30('0x35')][_0xaa30('0x53')](_0x1d5c15['body'],{'transaction':_0x2db9d5})[_0xaa30('0x2b')](function(_0x2d23f8){_0x1ed257=_0x2d23f8[_0xaa30('0x2d')]({'plain':!![]});return db[_0xaa30('0x55')][_0xaa30('0x50')]({'where':{'id':_0x1ed257['VoiceExtensionId']},'raw':!![]})['then'](function(_0x34ca1c){return createVoicePrefixExtensions(_0x1ed257,_0x34ca1c,_0x2db9d5);});});})[_0xaa30('0x2b')](function(){var _0x3c4f07=_0x1d5c15['user'][_0xaa30('0x2d')]({'plain':!![]});if(!_0x3c4f07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c4f07[_0xaa30('0x56')]===_0xaa30('0x57')){var _0x483a01=_0x1ed257;return db[_0xaa30('0x58')][_0xaa30('0x50')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3c4f07[_0xaa30('0x59')]},'raw':!![]})['then'](function(_0x5b227d){if(_0x5b227d&&_0x5b227d[_0xaa30('0x5a')]===0x0){return db[_0xaa30('0x2f')][_0xaa30('0x53')]({'name':_0x483a01['name'],'resourceId':_0x483a01['id'],'type':_0x5b227d[_0xaa30('0x32')],'sectionId':_0x5b227d['id']},{})[_0xaa30('0x2b')](function(){return _0x1ed257;});}else{return _0x1ed257;}})[_0xaa30('0x4e')](function(_0x949d84){logger[_0xaa30('0x30')](_0xaa30('0x5b'),_0x949d84);throw _0x949d84;});}return _0x1ed257;})[_0xaa30('0x2b')](respondWithResult(_0x1cb3f9,null))[_0xaa30('0x4e')](handleError(_0x1cb3f9,null));};function Extension(_0x242b5a,_0x426b90,_0xb1afa8,_0x2f84fa){this[_0xaa30('0x5c')]='from-sip';this[_0xaa30('0x5d')]=_0x242b5a;this[_0xaa30('0x5e')]=_0xb1afa8;this[_0xaa30('0x38')]='system';this[_0xaa30('0x5f')]=_0xaa30('0x60');this[_0xaa30('0x61')]=_0x426b90;this[_0xaa30('0x62')]=_0x2f84fa;}function createVoicePrefixExtensions(_0x9ee658,_0x2c5959,_0x4f1d54){return new BPromise(function(_0x366205,_0x4f5222){var _0x36242e=new Extension(formatPrefixName(_0x9ee658[_0xaa30('0x63')]),0x1,_0xaa30('0x64'),_0xaa30('0x65'));_0x36242e['VoicePrefixId']=_0x9ee658['id'];return db[_0xaa30('0x55')][_0xaa30('0x53')](_0x36242e,{'transaction':_0x4f1d54})['then'](function(_0x26f6f9){var _0x62b307=_0x26f6f9[_0xaa30('0x2d')]({'plain':!![]});var _0x16097e=_[_0xaa30('0x39')](addVoicePrefixExtensions(_0x9ee658,_0x2c5959),function(_0x13ee8f){_0x13ee8f['VoiceExtensionId']=_0x62b307['id'];_0x13ee8f[_0xaa30('0x66')]=_0x9ee658['id'];return _0x13ee8f;});return db[_0xaa30('0x55')][_0xaa30('0x67')](_0x16097e,{'transaction':_0x4f1d54})[_0xaa30('0x2b')](function(_0x334ef1){if(!_0x334ef1){return _0x4f5222(_0xaa30('0x68'));}else{return _0x366205(_0x334ef1);}})[_0xaa30('0x4e')](function(_0x42da00){return _0x4f5222(_0x42da00);});});;});};function addVoicePrefixExtensions(_0x4318a2,_0x6c968e){var _0x46bdc4=[];var _0x2f4d77=formatPrefixName(_0x4318a2[_0xaa30('0x63')]);_0x46bdc4['push'](new Extension(_0x2f4d77,0x2,_0xaa30('0x69'),'CDR(prefix)='+_0x4318a2[_0xaa30('0x32')]));if(_0x4318a2['callerIdAll']){_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x3,_0xaa30('0x69'),_0xaa30('0x6b')+_0x4318a2['callerIdAll']));}else{_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x3,_0xaa30('0x64'),'No\x20callerid\x20available'));}_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x4,'goto',_0x6c968e[_0xaa30('0x5c')]+','+'${EXTEN:'+(0x8+_0x4318a2['name'][_0xaa30('0x41')])+'}'+','+0x1));return _0x46bdc4;}function formatPrefixName(_0x99d382){var _0xd3e52e='_';for(var _0x313bfa=0x0;_0x313bfa<_0x99d382[_0xaa30('0x41')];_0x313bfa++){if(_0x99d382[_0xaa30('0x6c')](_0x313bfa)=='-'){_0xd3e52e+=_0x99d382[_0xaa30('0x6c')](_0x313bfa);}else{_0xd3e52e+='['+_0x99d382['charAt'](_0x313bfa)+']';}}_0xd3e52e+='.';return _0xd3e52e;}exports[_0xaa30('0x2a')]=function(_0x3f2683,_0x1386a9,_0x4aeb5d){var _0x1f8a61=_0x3f2683[_0xaa30('0x6d')];_0x1f8a61[_0xaa30('0x63')]='system-'+_0x1f8a61[_0xaa30('0x32')]+'-';return db['sequelize'][_0xaa30('0x54')](function(_0x4d2787){return db['VoicePrefix'][_0xaa30('0x2a')](_0x1f8a61,{'where':{'id':_0x1f8a61['id']},'transaction':_0x4d2787})[_0xaa30('0x2b')](function(){return db['VoiceExtension'][_0xaa30('0x2c')]({'where':{'VoicePrefixId':_0x1f8a61['id']},'transaction':_0x4d2787})[_0xaa30('0x2b')](function(){return db[_0xaa30('0x55')]['find']({'where':{'id':_0x1f8a61[_0xaa30('0x6e')]},'raw':!![]})[_0xaa30('0x2b')](function(_0x23daeb){return createVoicePrefixExtensions(_0x1f8a61,_0x23daeb,_0x4d2787);});});});})[_0xaa30('0x2b')](function(){return db[_0xaa30('0x35')][_0xaa30('0x6f')](_0x1f8a61['id']);})[_0xaa30('0x2b')](respondWithResult(_0x1386a9,null))['catch'](handleError(_0x1386a9,null));};exports[_0xaa30('0x70')]=function(_0x37c3ee,_0x112dc3,_0x25977d){return db['VoicePrefix'][_0xaa30('0x50')]({'where':{'id':_0x37c3ee[_0xaa30('0x51')]['id']}})['then'](handleEntityNotFound(_0x112dc3,null))[_0xaa30('0x2b')](function(_0x2d9dd8){if(_0x2d9dd8){return _0x2d9dd8[_0xaa30('0x70')](_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')],_[_0xaa30('0x72')](_0x37c3ee['body'],[_0xaa30('0x71'),'id'])||{})[_0xaa30('0x73')](function(_0x5948b4){for(var _0x2aa0ce=0x0;_0x2aa0ce<_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')][_0xaa30('0x41')];_0x2aa0ce+=0x1){socket[_0xaa30('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')][_0x2aa0ce]),'VoicePrefixId':Number(_0x37c3ee[_0xaa30('0x51')]['id'])});}return _0x5948b4;});}})[_0xaa30('0x2b')](respondWithResult(_0x112dc3,null))[_0xaa30('0x4e')](handleError(_0x112dc3,null));};exports[_0xaa30('0x75')]=function(_0x5d3d83,_0x1e3a19,_0x467134){return db['VoicePrefix']['find']({'where':{'id':_0x5d3d83[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x1e3a19,null))[_0xaa30('0x2b')](function(_0x100f18){if(_0x100f18){return _0x100f18[_0xaa30('0x75')](_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')])['then'](function(){if(_['isArray'](_0x5d3d83['query'][_0xaa30('0x71')])){for(var _0x25ebba=0x0;_0x25ebba<_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')][_0xaa30('0x41')];_0x25ebba+=0x1){socket['emit'](_0xaa30('0x76'),{'UserId':Number(_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')][_0x25ebba]),'VoicePrefixId':Number(_0x5d3d83[_0xaa30('0x51')]['id'])});}}else{socket[_0xaa30('0x74')](_0xaa30('0x76'),{'UserId':Number(_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')]),'VoicePrefixId':Number(_0x5d3d83['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1e3a19,null))['catch'](handleError(_0x1e3a19,null));};exports[_0xaa30('0x77')]=function(_0x408362,_0x541d3b,_0x775047){var _0xe9e4={};var _0x15e3ae={};var _0x33551c;var _0x404f82;return db['VoicePrefix'][_0xaa30('0x78')]({'where':{'id':_0x408362[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x541d3b,null))['then'](function(_0x21b87b){if(_0x21b87b){_0x33551c=_0x21b87b;_0x15e3ae[_0xaa30('0x3c')]=_[_0xaa30('0x3a')](db[_0xaa30('0x79')][_0xaa30('0x36')]);_0x15e3ae[_0xaa30('0x3d')]=_[_0xaa30('0x3a')](_0x408362['query']);_0x15e3ae[_0xaa30('0x3b')]=_[_0xaa30('0x3e')](_0x15e3ae[_0xaa30('0x3c')],_0x15e3ae[_0xaa30('0x3d')]);_0xe9e4[_0xaa30('0x40')]=_[_0xaa30('0x3e')](_0x15e3ae[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0x408362[_0xaa30('0x3d')][_0xaa30('0x3f')]));_0xe9e4[_0xaa30('0x40')]=_0xe9e4[_0xaa30('0x40')][_0xaa30('0x41')]?_0xe9e4['attributes']:_0x15e3ae[_0xaa30('0x3c')];_0xe9e4['order']=qs[_0xaa30('0x44')](_0x408362[_0xaa30('0x3d')][_0xaa30('0x44')]);_0xe9e4[_0xaa30('0x45')]=qs[_0xaa30('0x3b')](_[_0xaa30('0x46')](_0x408362[_0xaa30('0x3d')],_0x15e3ae[_0xaa30('0x3b')]));if(_0x408362[_0xaa30('0x3d')][_0xaa30('0x49')]){_0xe9e4[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0xe9e4[_0xaa30('0x45')],{'$or':_[_0xaa30('0x39')](_0xe9e4[_0xaa30('0x40')],function(_0x3744b3){var _0x35a47f={};_0x35a47f[_0x3744b3]={'$like':'%'+_0x408362[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x35a47f;})});}_0xe9e4=_['merge']({},_0xe9e4,_0x408362[_0xaa30('0x4a')]);return _0x33551c[_0xaa30('0x77')](_0xe9e4);}})[_0xaa30('0x2b')](function(_0x3a67b3){if(_0x3a67b3){_0x404f82=_0x3a67b3[_0xaa30('0x41')];if(!_0x408362[_0xaa30('0x3d')][_0xaa30('0x42')]('nolimit')){_0xe9e4[_0xaa30('0x25')]=qs[_0xaa30('0x25')](_0x408362['query'][_0xaa30('0x25')]);_0xe9e4[_0xaa30('0x24')]=qs['offset'](_0x408362[_0xaa30('0x3d')][_0xaa30('0x24')]);}return _0x33551c[_0xaa30('0x77')](_0xe9e4);}})[_0xaa30('0x2b')](function(_0x5eb209){if(_0x5eb209){return _0x5eb209?{'count':_0x404f82,'rows':_0x5eb209}:null;}})[_0xaa30('0x2b')](respondWithResult(_0x541d3b,null))['catch'](handleError(_0x541d3b,null));};exports[_0xaa30('0x7a')]=function(_0x41480f,_0x24f60f,_0x3fb561){var _0x24a3af={};var _0x4412d4={};var _0x45ffba;var _0x2e73e1;return db[_0xaa30('0x35')]['findOne']({'where':{'id':_0x41480f[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x24f60f,null))['then'](function(_0x1f48c1){if(_0x1f48c1){_0x45ffba=_0x1f48c1;_0x4412d4[_0xaa30('0x3c')]=_['keys'](db[_0xaa30('0x7b')][_0xaa30('0x36')]);_0x4412d4['query']=_[_0xaa30('0x3a')](_0x41480f['query']);_0x4412d4['filters']=_[_0xaa30('0x3e')](_0x4412d4[_0xaa30('0x3c')],_0x4412d4['query']);_0x24a3af['attributes']=_[_0xaa30('0x3e')](_0x4412d4[_0xaa30('0x3c')],qs['fields'](_0x41480f[_0xaa30('0x3d')]['fields']));_0x24a3af['attributes']=_0x24a3af[_0xaa30('0x40')]['length']?_0x24a3af[_0xaa30('0x40')]:_0x4412d4['model'];_0x24a3af[_0xaa30('0x7c')]=qs[_0xaa30('0x44')](_0x41480f[_0xaa30('0x3d')][_0xaa30('0x44')]);_0x24a3af[_0xaa30('0x45')]=qs[_0xaa30('0x3b')](_[_0xaa30('0x46')](_0x41480f[_0xaa30('0x3d')],_0x4412d4[_0xaa30('0x3b')]));if(_0x41480f['query']['filter']){_0x24a3af[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0x24a3af[_0xaa30('0x45')],{'$or':_['map'](_0x24a3af['attributes'],function(_0x46df1d){var _0x554b6b={};_0x554b6b[_0x46df1d]={'$like':'%'+_0x41480f[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x554b6b;})});}_0x24a3af=_[_0xaa30('0x47')]({},_0x24a3af,_0x41480f[_0xaa30('0x4a')]);return _0x45ffba['getTeams'](_0x24a3af);}})[_0xaa30('0x2b')](function(_0x5d061b){if(_0x5d061b){_0x2e73e1=_0x5d061b[_0xaa30('0x41')];if(!_0x41480f[_0xaa30('0x3d')][_0xaa30('0x42')](_0xaa30('0x43'))){_0x24a3af['limit']=qs[_0xaa30('0x25')](_0x41480f[_0xaa30('0x3d')]['limit']);_0x24a3af[_0xaa30('0x24')]=qs['offset'](_0x41480f[_0xaa30('0x3d')]['offset']);}return _0x45ffba[_0xaa30('0x7a')](_0x24a3af);}})[_0xaa30('0x2b')](function(_0x11dd5e){if(_0x11dd5e){return _0x11dd5e?{'count':_0x2e73e1,'rows':_0x11dd5e}:null;}})[_0xaa30('0x2b')](respondWithResult(_0x24f60f,null))[_0xaa30('0x4e')](handleError(_0x24f60f,null));};exports[_0xaa30('0x7d')]=function(_0x2f90db,_0x3f382a,_0x36f739){var _0x5687ef=_0x2f90db[_0xaa30('0x6d')][_0xaa30('0x71')];var _0x21e8c7;return db['Team'][_0xaa30('0x4c')]({'where':{'id':_0x5687ef},'attributes':['id'],'include':[{'model':db[_0xaa30('0x79')],'as':_0xaa30('0x7e'),'attributes':['id',_0xaa30('0x32'),_0xaa30('0x7f'),_0xaa30('0x80'),_0xaa30('0x81')],'raw':!![]}]})[_0xaa30('0x2b')](function(_0x16e95c){if(_0x16e95c){_0x21e8c7=_0x16e95c;var _0x4dc93c=_[_0xaa30('0x82')](_0x16e95c,function(_0x25dca3){var _0x13521a=_0x25dca3['get']({'plain':!![]});return _0x13521a[_0xaa30('0x7e')];});return db[_0xaa30('0x35')]['find']({'where':{'id':_0x2f90db[_0xaa30('0x51')]['id']}})['then'](function(_0x51a37a){return db[_0xaa30('0x83')][_0xaa30('0x54')](function(_0xcf7c59){return _0x51a37a[_0xaa30('0x7d')](_0x5687ef,{'transaction':_0xcf7c59})['then'](function(){return BPromise['each'](_0x21e8c7,function(_0x4240d0){return db[_0xaa30('0x84')][_0xaa30('0x85')]({'TeamId':_0x4240d0['id'],'VoicePrefixId':_0x2f90db[_0xaa30('0x51')]['id']},{'transaction':_0xcf7c59});});})[_0xaa30('0x2b')](function(){return BPromise['each'](_0x4dc93c,function(_0x7db5d7){return db['UserVoicePrefix'][_0xaa30('0x86')]({'where':{'UserId':_0x7db5d7['id'],'VoicePrefixId':_0x2f90db[_0xaa30('0x51')]['id']},'transaction':_0xcf7c59});});})[_0xaa30('0x2b')](function(){_0x4dc93c['forEach'](function(_0x1c25b1){socket[_0xaa30('0x74')](_0xaa30('0x87'),{'UserId':_0x1c25b1['id'],'VoicePrefixId':_0x51a37a['id']});});});});});}})[_0xaa30('0x2b')](respondWithStatusCode(_0x3f382a,null))[_0xaa30('0x4e')](handleError(_0x3f382a,null));};exports[_0xaa30('0x88')]=function(_0x51fb85,_0x133a0f,_0x1bd3c2){return db['Team']['findAll']({'where':{'id':_0x51fb85[_0xaa30('0x3d')][_0xaa30('0x71')]},'attributes':['id'],'include':[{'model':db[_0xaa30('0x79')],'as':_0xaa30('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xaa30('0x2b')](handleEntityNotFound(_0x133a0f,null))[_0xaa30('0x2b')](function(_0x3dd250){var _0x2ec205=_[_0xaa30('0x39')](_0x3dd250,'id');var _0x211916=[];var _0x4bba25=[];var _0x73c665=squel['select']();_0x73c665['field'](_0xaa30('0x89'))[_0xaa30('0x8a')](_0xaa30('0x8b'),'tq')['join'](_0xaa30('0x8c'),'ut',_0xaa30('0x8d'))['where'](_0xaa30('0x8e'),_0x51fb85[_0xaa30('0x51')]['id']);for(var _0x2ebaa0=0x0;_0x2ebaa0<_0x3dd250[_0xaa30('0x41')];_0x2ebaa0+=0x1){let _0x420276=_0x3dd250[_0x2ebaa0];for(var _0x2c48a2=0x0;_0x2c48a2<_0x420276['Agents'][_0xaa30('0x41')];_0x2c48a2+=0x1){let _0x206fc4=_0x420276[_0xaa30('0x7e')][_0x2c48a2];var _0x24fccc=_0x73c665[_0xaa30('0x8f')]();_0x24fccc[_0xaa30('0x45')](_0xaa30('0x90'),_0x206fc4['id']);_0x4bba25['push'](db['sequelize'][_0xaa30('0x3d')](_0x24fccc[_0xaa30('0x91')](),{'type':db[_0xaa30('0x83')][_0xaa30('0x92')][_0xaa30('0x93')]})[_0xaa30('0x2b')](function(_0x162810){if(_0x162810[_0xaa30('0x41')]===0x1){return _0x206fc4['id'];}else{var _0x2ed461=_[_0xaa30('0x94')](_[_0xaa30('0x39')](_0x162810,'TeamId'),function(_0x5c21e){return _[_0xaa30('0x95')](_0x2ec205,_0x5c21e);});if(_0x2ed461){return _0x206fc4['id'];}}}));}}return BPromise[_0xaa30('0x96')](_0x4bba25)[_0xaa30('0x2b')](function(_0x46c9a5){_0x211916=_(_0x211916)[_0xaa30('0x97')](_0x46c9a5)[_0xaa30('0x98')]()[_0xaa30('0x99')]();return db[_0xaa30('0x35')][_0xaa30('0x50')]({'where':{'id':_0x51fb85[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](function(_0x4cc3f0){return db[_0xaa30('0x83')][_0xaa30('0x54')](function(_0x31bdf6){return _0x4cc3f0['removeTeams'](_0x51fb85['query'][_0xaa30('0x71')],{'transaction':_0x31bdf6})['then'](function(){if(!_[_0xaa30('0x9a')](_0x211916)){return _0x4cc3f0['removeAgents'](_0x211916,{'transaction':_0x31bdf6});}})[_0xaa30('0x2b')](function(){_0x211916[_0xaa30('0x9b')](function(_0xb148d9){socket[_0xaa30('0x74')]('userVoicePrefix:remove',{'UserId':_0xb148d9,'VoicePrefixId':_0x4cc3f0['id']});});});});});});})[_0xaa30('0x2b')](respondWithStatusCode(_0x133a0f,null))[_0xaa30('0x4e')](handleError(_0x133a0f,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c72b803..aa2d749 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 _0xc97a=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x242b1d,_0xe6b10c){var _0x5193f6=function(_0x45f24c){while(--_0x45f24c){_0x242b1d['push'](_0x242b1d['shift']());}};_0x5193f6(++_0xe6b10c);}(_0xc97a,0x125));var _0xac97=function(_0x23a039,_0x5de798){_0x23a039=_0x23a039-0x0;var _0x5c0531=_0xc97a[_0x23a039];return _0x5c0531;};'use strict';var EventEmitter=require(_0xac97('0x0'));var VoicePrefix=require(_0xac97('0x1'))['db'][_0xac97('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xac97('0x3')](0x0);var events={'afterCreate':_0xac97('0x4'),'afterUpdate':_0xac97('0x5'),'afterDestroy':_0xac97('0x6')};function emitEvent(_0x522bb4){return function(_0x5493cb,_0x1cf0fa,_0x2c5961){VoicePrefixEvents['emit'](_0x522bb4+':'+_0x5493cb['id'],_0x5493cb);VoicePrefixEvents[_0xac97('0x7')](_0x522bb4,_0x5493cb);_0x2c5961(null);};}for(var e in events){if(events[_0xac97('0x8')](e)){var event=events[e];VoicePrefix[_0xac97('0x9')](e,emitEvent(event));}}module[_0xac97('0xa')]=VoicePrefixEvents; \ No newline at end of file +var _0xd9bb=['update','emit','hasOwnProperty','exports','../../mysqldb','VoicePrefix','save'];(function(_0x1189eb,_0x3d2fb1){var _0x417af=function(_0x13787b){while(--_0x13787b){_0x1189eb['push'](_0x1189eb['shift']());}};_0x417af(++_0x3d2fb1);}(_0xd9bb,0x193));var _0xbd9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9bb[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xbd9b('0x0'))['db'][_0xbd9b('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd9b('0x2'),'afterUpdate':_0xbd9b('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd6a8a2){return function(_0x49a590,_0x22ee86,_0x152293){VoicePrefixEvents[_0xbd9b('0x4')](_0xd6a8a2+':'+_0x49a590['id'],_0x49a590);VoicePrefixEvents[_0xbd9b('0x4')](_0xd6a8a2,_0x49a590);_0x152293(null);};}for(var e in events){if(events[_0xbd9b('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xbd9b('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 85bde67..9c3ddd4 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 _0xde52=['voice_prefixes','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0xde52,0x1a5));var _0x2de5=function(_0x3bc61f,_0x137218){_0x3bc61f=_0x3bc61f-0x0;var _0x4e52b4=_0xde52[_0x3bc61f];return _0x4e52b4;};'use strict';var _=require(_0x2de5('0x0'));var util=require('util');var logger=require(_0x2de5('0x1'))(_0x2de5('0x2'));var moment=require('moment');var BPromise=require(_0x2de5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2de5('0x4'));var config=require(_0x2de5('0x5'));var attributes=require(_0x2de5('0x6'));module[_0x2de5('0x7')]=function(_0xb4363f,_0x1c201b){return _0xb4363f[_0x2de5('0x8')]('VoicePrefix',attributes,{'tableName':_0x2de5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a0=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x2587f1,_0x208412){var _0x4b7fed=function(_0x4d7510){while(--_0x4d7510){_0x2587f1['push'](_0x2587f1['shift']());}};_0x4b7fed(++_0x208412);}(_0x96a0,0xe4));var _0x096a=function(_0x2f8e33,_0x593a85){_0x2f8e33=_0x2f8e33-0x0;var _0x256677=_0x96a0[_0x2f8e33];return _0x256677;};'use strict';var _=require(_0x096a('0x0'));var util=require(_0x096a('0x1'));var logger=require(_0x096a('0x2'))(_0x096a('0x3'));var moment=require(_0x096a('0x4'));var BPromise=require('bluebird');var rp=require(_0x096a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x096a('0x6'));var attributes=require(_0x096a('0x7'));module[_0x096a('0x8')]=function(_0x380876,_0x5cde93){return _0x380876[_0x096a('0x9')](_0x096a('0xa'),attributes,{'tableName':_0x096a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 23e794e..aa7e404 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 _0x964b=['result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f93d0,_0x431b88){var _0x21348a=function(_0x137621){while(--_0x137621){_0x1f93d0['push'](_0x1f93d0['shift']());}};_0x21348a(++_0x431b88);}(_0x964b,0x112));var _0xb964=function(_0x419592,_0x1178b7){_0x419592=_0x419592-0x0;var _0x53801e=_0x964b[_0x419592];return _0x53801e;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});config[_0xb964('0xa')]=_[_0xb964('0xb')](config[_0xb964('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb964('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x295392,_0x4df011,_0x4433a5){return new BPromise(function(_0x38247c,_0x38bae5){return client[_0xb964('0xc')](_0x295392,_0x4433a5)['then'](function(_0x442595){logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));logger['debug'](_0xb964('0x10'),_0x4df011,'request\x20sent',JSON['stringify'](_0x442595));if(_0x442595[_0xb964('0x11')]){if(_0x442595[_0xb964('0x11')][_0xb964('0x12')]===0x1f4){logger[_0xb964('0x11')](_0xb964('0xe'),_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38bae5(_0x442595['error'][_0xb964('0x13')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38247c(_0x442595[_0xb964('0x11')][_0xb964('0x13')]);}else{logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));_0x38247c(_0x442595[_0xb964('0x14')][_0xb964('0x13')]);}})['catch'](function(_0x54da04){logger['error'](_0xb964('0xe'),_0x4df011,_0x54da04);_0x38bae5(_0x54da04);});});} \ No newline at end of file +var _0x5d95=['rpc','client','http','redis','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b013d,_0x4892b3){var _0x1c4925=function(_0x35f205){while(--_0x35f205){_0x5b013d['push'](_0x5b013d['shift']());}};_0x1c4925(++_0x4892b3);}(_0x5d95,0x77));var _0x55d9=function(_0x15e249,_0x547ccb){_0x15e249=_0x15e249-0x0;var _0x118478=_0x5d95[_0x15e249];return _0x118478;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var moment=require('moment');var BPromise=require(_0x55d9('0x2'));var rs=require(_0x55d9('0x3'));var fs=require('fs');var Redis=require(_0x55d9('0x4'));var db=require(_0x55d9('0x5'))['db'];var utils=require(_0x55d9('0x6'));var logger=require('../../config/logger')(_0x55d9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55d9('0x8')][_0x55d9('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55d9('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x77a04f,_0x373788,_0x2b406c){return new BPromise(function(_0xfd0f08,_0x38cde2){return client[_0x55d9('0xb')](_0x77a04f,_0x2b406c)['then'](function(_0x552cb8){logger[_0x55d9('0xc')](_0x55d9('0xd'),_0x373788,_0x55d9('0xe'));logger[_0x55d9('0xf')](_0x55d9('0x10'),_0x373788,_0x55d9('0xe'),JSON[_0x55d9('0x11')](_0x552cb8));if(_0x552cb8[_0x55d9('0x12')]){if(_0x552cb8[_0x55d9('0x12')]['code']===0x1f4){logger[_0x55d9('0x12')](_0x55d9('0xd'),_0x373788,_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);return _0x38cde2(_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);}logger[_0x55d9('0x12')](_0x55d9('0xd'),_0x373788,_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);return _0xfd0f08(_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);}else{logger[_0x55d9('0xc')](_0x55d9('0xd'),_0x373788,'request\x20sent');_0xfd0f08(_0x552cb8[_0x55d9('0x14')][_0x55d9('0x13')]);}})['catch'](function(_0x4c8561){logger['error'](_0x55d9('0xd'),_0x373788,_0x4c8561);_0x38cde2(_0x4c8561);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f6407d0..3a04d7d 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 _0xe5b5=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xe5b5[_0x4d7f3f];return _0x5d67cc;};'use strict';var VoicePrefixEvents=require(_0x5e5b('0x0'));var events=[_0x5e5b('0x1'),_0x5e5b('0x2'),_0x5e5b('0x3')];function createListener(_0x208070,_0x4263e){return function(_0x33e813){_0x4263e[_0x5e5b('0x4')](_0x208070,_0x33e813);};}function removeListener(_0xf20c6a,_0x20a50c){return function(){VoicePrefixEvents[_0x5e5b('0x5')](_0xf20c6a,_0x20a50c);};}exports[_0x5e5b('0x6')]=function(_0xf1fbe2){for(var _0x11e0e0=0x0,_0x545eb3=events[_0x5e5b('0x7')];_0x11e0e0<_0x545eb3;_0x11e0e0++){var _0xe089b1=events[_0x11e0e0];var _0xcbd478=createListener(_0x5e5b('0x8')+_0xe089b1,_0xf1fbe2);VoicePrefixEvents['on'](_0xe089b1,_0xcbd478);}}; \ No newline at end of file +var _0x13f6=['./voicePrefix.events','save','removeListener','voicePrefix:'];(function(_0xc5bf78,_0x13f6e2){var _0xb36be5=function(_0x4cdeb0){while(--_0x4cdeb0){_0xc5bf78['push'](_0xc5bf78['shift']());}};_0xb36be5(++_0x13f6e2);}(_0x13f6,0x124));var _0x613f=function(_0x526acf,_0x37779a){_0x526acf=_0x526acf-0x0;var _0x1cce08=_0x13f6[_0x526acf];return _0x1cce08;};'use strict';var VoicePrefixEvents=require(_0x613f('0x0'));var events=[_0x613f('0x1'),'remove','update'];function createListener(_0xd04cfd,_0x13b50a){return function(_0x12dc5a){_0x13b50a['emit'](_0xd04cfd,_0x12dc5a);};}function removeListener(_0x179f6e,_0x1e01e3){return function(){VoicePrefixEvents[_0x613f('0x2')](_0x179f6e,_0x1e01e3);};}exports['register']=function(_0x3f3525){for(var _0x2367b3=0x0,_0x5618fa=events['length'];_0x2367b3<_0x5618fa;_0x2367b3++){var _0x5a84f2=events[_0x2367b3];var _0x5c93c0=createListener(_0x613f('0x3')+_0x5a84f2,_0x3f3525);VoicePrefixEvents['on'](_0x5a84f2,_0x5c93c0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 9e651a3..1c9c61b 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x47804a,_0x40a083){var _0x32ba13=function(_0xcf35df){while(--_0xcf35df){_0x47804a['push'](_0x47804a['shift']());}};_0x32ba13(++_0x40a083);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xb10b,0x12a));var _0xbb10=function(_0x34046c,_0x283124){_0x34046c=_0x34046c-0x0;var _0x5d4d17=_0xb10b[_0x34046c];return _0x5d4d17;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 82a165d..d48fa33 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 _0x7094=['yes','all','once','TEXT','setDataValue','periodic_announce','split','join','joinempty','leavewhenempty','BOOLEAN','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','ENUM','inbound','outbound','leastrecent','fewestcalls','random','wrandom','rrordered','ringall','strategy','rrmemory','getDataValue','type','dialMethod','booked','progressive','power','INTEGER'];(function(_0x519244,_0x5ac0ae){var _0x33d052=function(_0xd6f4a){while(--_0xd6f4a){_0x519244['push'](_0x519244['shift']());}};_0x33d052(++_0x5ac0ae);}(_0x7094,0xda));var _0x4709=function(_0x243487,_0x2fd428){_0x243487=_0x243487-0x0;var _0x2643b1=_0x7094[_0x243487];return _0x2643b1;};'use strict';var Sequelize=require(_0x4709('0x0'));module[_0x4709('0x1')]={'name':{'type':Sequelize[_0x4709('0x2')],'allowNull':![],'unique':_0x4709('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x5'),_0x4709('0x6')),'allowNull':![],'defaultValue':_0x4709('0x5')},'musiconhold':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4709('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4709('0x4')]('rr','ringall',_0x4709('0x7'),_0x4709('0x8'),_0x4709('0x9'),'rrmemory','linear',_0x4709('0xa'),_0x4709('0xb')),'allowNull':![],'defaultValue':_0x4709('0xc'),'set':function(_0x3ebda1){this['setDataValue'](_0x4709('0xd'),_0x3ebda1?_0x3ebda1:_0x4709('0xe'));},'get':function(){var _0x26260f=this[_0x4709('0xf')](_0x4709('0x10'));var _0x29d2b7=this['getDataValue'](_0x4709('0x11'));var _0x55b731=this[_0x4709('0xf')]('strategy');if(_0x26260f===_0x4709('0x5')){return _0x55b731;}if(_0x29d2b7==='booked'&&_0x55b731===_0x4709('0xe')||_0x29d2b7===_0x4709('0x12')&&_0x55b731==='roundrobin'){return _0x55b731;}if(_0x29d2b7===_0x4709('0x13')||_0x29d2b7==='predictive'||_0x29d2b7===_0x4709('0x14')){return _0x55b731;}return null;}},'servicelevel':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4709('0x2')]},'weight':{'type':Sequelize[_0x4709('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defaultValue':_0x4709('0x16')},'autopause':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no',_0x4709('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4709('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4709('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4709('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4709('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4709('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x4709('0x4')]('yes','no',_0x4709('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4709('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4709('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4709('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4709('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4709('0x2')]},'queue_quantity1':{'type':Sequelize[_0x4709('0x2')]},'queue_quantity2':{'type':Sequelize[_0x4709('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x4709('0x2')]},'queue_less_than':{'type':Sequelize[_0x4709('0x2')]},'periodic_announce':{'type':Sequelize[_0x4709('0x19')],'set':function(_0x1ee1ec){this[_0x4709('0x1a')]('periodic_announce',_0x1ee1ec?_0x1ee1ec['join'](','):[]);},'get':function(){return this[_0x4709('0xf')](_0x4709('0x1b'))?this['getDataValue']('periodic_announce')[_0x4709('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'yes','set':function(_0x57656c){this[_0x4709('0x1a')]('joinempty',_0x57656c?_0x57656c[_0x4709('0x1d')](','):undefined);},'get':function(){return this[_0x4709('0xf')]('joinempty')?this[_0x4709('0xf')](_0x4709('0x1e'))[_0x4709('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'no','set':function(_0x2c59b0){this['setDataValue'](_0x4709('0x1f'),_0x2c59b0?_0x2c59b0[_0x4709('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x4709('0x1f'))?this['getDataValue'](_0x4709('0x1f'))[_0x4709('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x4709('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4709('0x2')]},'description':{'type':Sequelize[_0x4709('0x2')]},'acw':{'type':Sequelize[_0x4709('0x20')],'defaultValue':0x0,'set':function(_0x5d040a){this[_0x4709('0x1a')]('acw',_0x5d040a);if(_0x5d040a){if(this[_0x4709('0xf')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4709('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4709('0x21')},'dialMethod':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x22'),_0x4709('0x13'),_0x4709('0x14'),_0x4709('0x23'),_0x4709('0x12')),'defaultValue':_0x4709('0x13'),'comment':_0x4709('0x24')},'dialLimitChannel':{'type':Sequelize[_0x4709('0x15')](0x4)[_0x4709('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4709('0x26')},'dialLimitQueue':{'type':Sequelize[_0x4709('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4709('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4709('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x29'),_0x4709('0x2a')),'defaultValue':_0x4709('0x2a'),'comment':_0x4709('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4709('0x2c')](0x2)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4709('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4709('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4709('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x4709('0x2')],'defaultValue':_0x4709('0x2f'),'comment':_0x4709('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x31')},'dialQueueProject':{'type':Sequelize[_0x4709('0x2')],'comment':_0x4709('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'comment':_0x4709('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4709('0x37')},'dialPrefix':{'type':Sequelize[_0x4709('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4709('0x4')](_0x4709('0x38'),_0x4709('0x39'),_0x4709('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4709('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4709('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4709('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4709('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4709('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4709('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4709('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x4709('0x15')](0x9)[_0x4709('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4709('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4709('0x15')](0x9)[_0x4709('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4709('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4709('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4709('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4709('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4709('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4709('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4709('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x4709('0x20')],'defaultValue':0x0,'comment':_0x4709('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4709('0x44'),'ASC'),'defaultValue':_0x4709('0x44')},'dialQueueProject2':{'type':Sequelize[_0x4709('0x2')],'comment':_0x4709('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4709('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4709('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4709('0x45')},'dialCutDigit':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4709('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4709('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4709('0x15')](0x5)[_0x4709('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4709('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4709('0x15')],'allowNull':!![],'comment':_0x4709('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x4709('0x20')],'defaultValue':![],'comment':_0x4709('0x4f'),'set':function(_0x55db75){if(!_0x55db75)this[_0x4709('0x1a')]('mandatoryDispositionPauseId',null);this[_0x4709('0x1a')]('mandatoryDisposition',_0x55db75);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4709('0x15')](0x3)[_0x4709('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4709('0x20')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa940=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','inbound','STRING','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','ENUM','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','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)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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)'];(function(_0x52f9ab,_0x463c9f){var _0x4edff2=function(_0x2466a4){while(--_0x2466a4){_0x52f9ab['push'](_0x52f9ab['shift']());}};_0x4edff2(++_0x463c9f);}(_0xa940,0x191));var _0x0a94=function(_0x1bc9bc,_0x3d9b44){_0x1bc9bc=_0x1bc9bc-0x0;var _0x483073=_0xa940[_0x1bc9bc];return _0x483073;};'use strict';var Sequelize=require('sequelize');module[_0x0a94('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a94('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a94('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x0a94('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x0a94('0x4'),_0x0a94('0x5'),_0x0a94('0x6'),'random',_0x0a94('0x7'),_0x0a94('0x8'),_0x0a94('0x9'),_0x0a94('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x56398b){this[_0x0a94('0xb')](_0x0a94('0xc'),_0x56398b?_0x56398b:'rrmemory');},'get':function(){var _0xe80608=this['getDataValue'](_0x0a94('0xd'));var _0x5b1539=this[_0x0a94('0xe')](_0x0a94('0xf'));var _0x518bd4=this[_0x0a94('0xe')](_0x0a94('0xc'));if(_0xe80608===_0x0a94('0x2')){return _0x518bd4;}if(_0x5b1539===_0x0a94('0x10')&&_0x518bd4===_0x0a94('0x7')||_0x5b1539===_0x0a94('0x10')&&_0x518bd4===_0x0a94('0x11')){return _0x518bd4;}if(_0x5b1539==='progressive'||_0x5b1539===_0x0a94('0x12')||_0x5b1539===_0x0a94('0x13')){return _0x518bd4;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0a94('0x14')](0xb)},'timeout':{'type':Sequelize[_0x0a94('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0a94('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a94('0x3')]},'weight':{'type':Sequelize[_0x0a94('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0a94('0x15')},'autopause':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no',_0x0a94('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a94('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x0a94('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a94('0x3')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0a94('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a94('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0a94('0x16')]('yes','no'),'defaultValue':_0x0a94('0x15')},'announce_holdtime':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no',_0x0a94('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x0a94('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a94('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a94('0x3')]},'queue_youarenext':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a94('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a94('0x3')]},'queue_quantity1':{'type':Sequelize[_0x0a94('0x3')]},'queue_quantity2':{'type':Sequelize[_0x0a94('0x3')]},'queue_periodic_announce':{'type':Sequelize[_0x0a94('0x3')]},'queue_less_than':{'type':Sequelize[_0x0a94('0x3')]},'periodic_announce':{'type':Sequelize[_0x0a94('0x19')],'set':function(_0x15d78c){this[_0x0a94('0xb')]('periodic_announce',_0x15d78c?_0x15d78c[_0x0a94('0x1a')](','):[]);},'get':function(){return this[_0x0a94('0xe')](_0x0a94('0x1b'))?this['getDataValue'](_0x0a94('0x1b'))[_0x0a94('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':'yes','set':function(_0x3d7e4e){this[_0x0a94('0xb')](_0x0a94('0x1d'),_0x3d7e4e?_0x3d7e4e[_0x0a94('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a94('0x1d'))?this[_0x0a94('0xe')](_0x0a94('0x1d'))[_0x0a94('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4c3a70){this['setDataValue'](_0x0a94('0x1e'),_0x4c3a70?_0x4c3a70[_0x0a94('0x1a')](','):undefined);},'get':function(){return this[_0x0a94('0xe')]('leavewhenempty')?this['getDataValue']('leavewhenempty')[_0x0a94('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0a94('0x16')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a94('0x16')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a94('0x3')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x0a94('0x1f')],'defaultValue':0x0,'set':function(_0x325a3c){this[_0x0a94('0xb')]('acw',_0x325a3c);if(_0x325a3c){if(this['getDataValue'](_0x0a94('0x20'))<0x2){this[_0x0a94('0xb')](_0x0a94('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0a94('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a94('0x21')},'dialMethod':{'type':Sequelize[_0x0a94('0x16')]('preview',_0x0a94('0x22'),_0x0a94('0x13'),_0x0a94('0x12'),_0x0a94('0x10')),'defaultValue':_0x0a94('0x22'),'comment':_0x0a94('0x23')},'dialLimitChannel':{'type':Sequelize[_0x0a94('0x14')](0x4)[_0x0a94('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a94('0x25')},'dialLimitQueue':{'type':Sequelize[_0x0a94('0x14')](0x4)[_0x0a94('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a94('0x26')},'dialPowerLevel':{'type':Sequelize[_0x0a94('0x27')](0x2)[_0x0a94('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a94('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x0a94('0x29'),_0x0a94('0x2a')),'defaultValue':_0x0a94('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a94('0x27')](0x2)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a94('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x0a94('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0a94('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a94('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a94('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a94('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':_0x0a94('0x2e'),'comment':_0x0a94('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x0a94('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a94('0x30')},'dialQueueProject':{'type':Sequelize[_0x0a94('0x3')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a94('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'comment':_0x0a94('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)[_0x0a94('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a94('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a94('0x34')},'dialTimezone':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x0a94('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x35'),'never',_0x0a94('0x36')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0a94('0x1f')],'defaultValue':0x0,'comment':_0x0a94('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x0a94('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a94('0x38')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0a94('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a94('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a94('0x14')](0x9)[_0x0a94('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a94('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a94('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a94('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a94('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a94('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0a94('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a94('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a94('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a94('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0a94('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a94('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a94('0x14')](0x5)[_0x0a94('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a94('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x0a94('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a94('0x16')](_0x0a94('0x41'),'ASC'),'defaultValue':_0x0a94('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x0a94('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a94('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a94('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a94('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a94('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a94('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)[_0x0a94('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a94('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a94('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)[_0x0a94('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a94('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a94('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a94('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a94('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a94('0x14')](0x5)[_0x0a94('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a94('0x14')],'allowNull':!![],'comment':_0x0a94('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x0a94('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x394c84){if(!_0x394c84)this['setDataValue'](_0x0a94('0x4d'),null);this[_0x0a94('0xb')](_0x0a94('0x4e'),_0x394c84);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0a94('0x14')](0x3)[_0x0a94('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0a94('0x1f')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index d5ba48c..43b169b 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 _0x1524=['findOrCreate','UserVoiceQueueRt','interface','format','SIP/%s','ids','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','union','isEmpty','emit','userVoiceQueue:remove','addAgents','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','ListId','NOW()','field','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','scheduledAt','phone\x20IS\x20NOT\x20NULL','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','util','path','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','filter','ignore','map','value','includes','find','type','UserProfileResource','error','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','options','includeAll','rows','catch','show','params','include','create','user','role','inbound','outbound','userProfileId','clone','omit','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','addTeams','each','upsert','UserVoiceQueue'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x1524,0xea));var _0x4152=function(_0x57fd0d,_0x2630ea){_0x57fd0d=_0x57fd0d-0x0;var _0x4b57f6=_0x1524[_0x57fd0d];return _0x4b57f6;};'use strict';var emlformat=require(_0x4152('0x0'));var rimraf=require(_0x4152('0x1'));var zipdir=require(_0x4152('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4152('0x3'));var path=require(_0x4152('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4152('0x5'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4152('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x4152('0x7'));var toCsv=require(_0x4152('0x8'));var querystring=require(_0x4152('0x9'));var Papa=require('papaparse');var Redis=require(_0x4152('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4152('0xb'));var logger=require(_0x4152('0xc'))(_0x4152('0xd'));var utils=require(_0x4152('0xe'));var config=require(_0x4152('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4152('0x10')]=_['defaults'](config[_0x4152('0x10')],{'host':_0x4152('0x11'),'port':0x18eb});var socket=require(_0x4152('0x12'))(new Redis(config[_0x4152('0x10')]));require(_0x4152('0x13'))[_0x4152('0x14')](socket);function respondWithStatusCode(_0x1e6128,_0xd11ed5){_0xd11ed5=_0xd11ed5||0xcc;return function(_0x47f557){if(_0x47f557){return _0x1e6128[_0x4152('0x15')](_0xd11ed5);}return _0x1e6128[_0x4152('0x16')](_0xd11ed5)[_0x4152('0x17')]();};}function respondWithResult(_0x551309,_0x25d49e){_0x25d49e=_0x25d49e||0xc8;return function(_0x12af35){if(_0x12af35){return _0x551309['status'](_0x25d49e)['json'](_0x12af35);}};}function respondWithFilteredResult(_0x218ef0,_0x2aedba){return function(_0x1f0b8f){if(_0x1f0b8f){var _0x25746e=typeof _0x2aedba['offset']===_0x4152('0x18')&&typeof _0x2aedba['limit']===_0x4152('0x18');var _0x502180=_0x1f0b8f[_0x4152('0x19')];var _0x1f7de2=_0x25746e?0x0:_0x2aedba['offset'];var _0x3813b0=_0x25746e?_0x1f0b8f['count']:_0x2aedba['offset']+_0x2aedba[_0x4152('0x1a')];var _0x4fcb27;if(_0x3813b0>=_0x502180){_0x3813b0=_0x502180;_0x4fcb27=0xc8;}else{_0x4fcb27=0xce;}_0x218ef0[_0x4152('0x16')](_0x4fcb27);return _0x218ef0[_0x4152('0x1b')]('Content-Range',_0x1f7de2+'-'+_0x3813b0+'/'+_0x502180)[_0x4152('0x1c')](_0x1f0b8f);}return null;};}function patchUpdates(_0xe50046){return function(_0x2c54fa){try{jsonpatch[_0x4152('0x1d')](_0x2c54fa,_0xe50046,!![]);}catch(_0x137bb0){return BPromise[_0x4152('0x1e')](_0x137bb0);}return _0x2c54fa[_0x4152('0x1f')]();};}function saveUpdates(_0x5073e3,_0x2ddabc){return function(_0x5e17cb){if(_0x5e17cb){return _0x5e17cb[_0x4152('0x20')](_0x5073e3)[_0x4152('0x21')](function(_0x519972){return _0x519972;});}return null;};}function removeEntity(_0x2eb75a,_0x3e4859){return function(_0x537cee){if(_0x537cee){return _0x537cee[_0x4152('0x22')]()[_0x4152('0x21')](function(){var _0x37998a=_0x537cee[_0x4152('0x23')]({'plain':!![]});var _0x18d979=[{'name':_0x4152('0x24'),'value':'inbound','ignore':![]},{'name':_0x4152('0x25'),'value':'outbound','ignore':![]}];var _0x17cd88=_(_0x18d979)[_0x4152('0x26')](_0x4152('0x27'))[_0x4152('0x28')](_0x4152('0x29'))[_0x4152('0x29')]();if(_[_0x4152('0x2a')](_0x17cd88,_0x37998a['type'])){return;}var _0x19f7a5=_[_0x4152('0x2b')](_0x18d979,['value',_0x37998a[_0x4152('0x2c')]])['name'];return db[_0x4152('0x2d')][_0x4152('0x22')]({'where':{'type':_0x19f7a5,'resourceId':_0x37998a['id']}})[_0x4152('0x21')](function(){return _0x537cee;});})[_0x4152('0x21')](function(){_0x2eb75a[_0x4152('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f3ee,_0x3d8078){return function(_0x33893b){if(!_0x33893b){_0x31f3ee[_0x4152('0x15')](0x194);}return _0x33893b;};}function handleError(_0x201b2f,_0x42de0e){_0x42de0e=_0x42de0e||0x1f4;return function(_0x19e828){logger[_0x4152('0x2e')](_0x19e828[_0x4152('0x2f')]);if(_0x19e828[_0x4152('0x30')]){delete _0x19e828['name'];}_0x201b2f[_0x4152('0x16')](_0x42de0e)[_0x4152('0x31')](_0x19e828);};}exports[_0x4152('0x32')]=function(_0x410a19,_0x55d04e){var _0x496a49={},_0x22911d={},_0x3a95b1={'count':0x0,'rows':[]};var _0x5d371c=_['map'](db[_0x4152('0x33')][_0x4152('0x34')],function(_0x3dd596){return{'name':_0x3dd596[_0x4152('0x35')],'type':_0x3dd596[_0x4152('0x2c')][_0x4152('0x36')]};});_0x22911d[_0x4152('0x37')]=_[_0x4152('0x28')](_0x5d371c,_0x4152('0x30'));_0x22911d[_0x4152('0x38')]=_[_0x4152('0x39')](_0x410a19[_0x4152('0x38')]);_0x22911d['filters']=_['intersection'](_0x22911d['model'],_0x22911d[_0x4152('0x38')]);_0x496a49[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x22911d[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x410a19[_0x4152('0x38')][_0x4152('0x3c')]));_0x496a49[_0x4152('0x3a')]=_0x496a49['attributes'][_0x4152('0x3d')]?_0x496a49[_0x4152('0x3a')]:_0x22911d['model'];if(!_0x410a19[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x496a49[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x410a19[_0x4152('0x38')][_0x4152('0x1a')]);_0x496a49[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x410a19[_0x4152('0x38')][_0x4152('0x40')]);}_0x496a49[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x410a19[_0x4152('0x38')][_0x4152('0x42')]);_0x496a49[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x410a19[_0x4152('0x38')],_0x22911d[_0x4152('0x44')]),_0x5d371c);if(_0x410a19[_0x4152('0x38')][_0x4152('0x26')]){_0x496a49[_0x4152('0x43')]=_[_0x4152('0x46')](_0x496a49[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x5d371c,function(_0x2b801a){if(_0x2b801a[_0x4152('0x2c')]!=='VIRTUAL'){var _0x4cecc0={};_0x4cecc0[_0x2b801a[_0x4152('0x30')]]={'$like':'%'+_0x410a19[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4cecc0;}})});}_0x496a49=_[_0x4152('0x46')]({},_0x496a49,_0x410a19[_0x4152('0x47')]);var _0x18c5b9={'where':_0x496a49[_0x4152('0x43')]};return db[_0x4152('0x33')][_0x4152('0x19')](_0x18c5b9)['then'](function(_0x1f2769){_0x3a95b1[_0x4152('0x19')]=_0x1f2769;if(_0x410a19[_0x4152('0x38')][_0x4152('0x48')]){_0x496a49['include']=[{'all':!![]}];}return db[_0x4152('0x33')]['findAll'](_0x496a49);})[_0x4152('0x21')](function(_0x56d625){_0x3a95b1[_0x4152('0x49')]=_0x56d625;return _0x3a95b1;})['then'](respondWithFilteredResult(_0x55d04e,_0x496a49))[_0x4152('0x4a')](handleError(_0x55d04e,null));};exports[_0x4152('0x4b')]=function(_0xed8ab0,_0x1de6c3){var _0x87cd07={'raw':![],'where':{'id':_0xed8ab0[_0x4152('0x4c')]['id']}},_0x749c0c={};_0x749c0c['model']=_['keys'](db['VoiceQueue'][_0x4152('0x34')]);_0x749c0c[_0x4152('0x38')]=_[_0x4152('0x39')](_0xed8ab0['query']);_0x749c0c[_0x4152('0x44')]=_['intersection'](_0x749c0c[_0x4152('0x37')],_0x749c0c['query']);_0x87cd07['attributes']=_[_0x4152('0x3b')](_0x749c0c[_0x4152('0x37')],qs['fields'](_0xed8ab0['query'][_0x4152('0x3c')]));_0x87cd07[_0x4152('0x3a')]=_0x87cd07[_0x4152('0x3a')][_0x4152('0x3d')]?_0x87cd07[_0x4152('0x3a')]:_0x749c0c['model'];if(_0xed8ab0[_0x4152('0x38')][_0x4152('0x48')]){_0x87cd07[_0x4152('0x4d')]=[{'all':!![]}];}_0x87cd07=_[_0x4152('0x46')]({},_0x87cd07,_0xed8ab0[_0x4152('0x47')]);return db[_0x4152('0x33')]['find'](_0x87cd07)['then'](handleEntityNotFound(_0x1de6c3,null))[_0x4152('0x21')](respondWithResult(_0x1de6c3,null))['catch'](handleError(_0x1de6c3,null));};exports['create']=function(_0xca3087,_0x14015e){return db[_0x4152('0x33')][_0x4152('0x4e')](_0xca3087['body'],{})[_0x4152('0x21')](function(_0x288874){var _0x2a2d68=_0xca3087[_0x4152('0x4f')][_0x4152('0x23')]({'plain':!![]});if(!_0x2a2d68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a2d68[_0x4152('0x50')]===_0x4152('0x4f')){var _0x16d620=_0x288874['get']({'plain':!![]});var _0x38f782=[{'name':_0x4152('0x24'),'value':_0x4152('0x51')},{'name':_0x4152('0x25'),'value':_0x4152('0x52')}];var _0x2ecd3b=_[_0x4152('0x2b')](_0x38f782,[_0x4152('0x29'),_0x16d620['type']])[_0x4152('0x30')];return db['UserProfileSection']['find']({'where':{'name':_0x2ecd3b,'userProfileId':_0x2a2d68[_0x4152('0x53')]},'raw':!![]})[_0x4152('0x21')](function(_0x936b57){if(_0x936b57&&_0x936b57['autoAssociation']===0x0){return db['UserProfileResource'][_0x4152('0x4e')]({'name':_0x16d620[_0x4152('0x30')],'resourceId':_0x16d620['id'],'type':_0x936b57['name'],'sectionId':_0x936b57['id']},{})[_0x4152('0x21')](function(){return _0x288874;});}else{return _0x288874;}})['catch'](function(_0x1c5c03){logger[_0x4152('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c5c03);throw _0x1c5c03;});}return _0x288874;})['then'](respondWithResult(_0x14015e,0xc9))[_0x4152('0x4a')](handleError(_0x14015e,null));};exports[_0x4152('0x54')]=function(_0x103d8e,_0x2051c2){var _0x376a96={'where':{'id':_0x103d8e[_0x4152('0x4c')]['id']}},_0x3a6248={};_0x3a6248[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x33')][_0x4152('0x34')]);_0x376a96[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x3a6248['model'],qs[_0x4152('0x3c')](_0x103d8e['query'][_0x4152('0x3c')]));_0x376a96['attributes']=_0x376a96[_0x4152('0x3a')][_0x4152('0x3d')]?_0x376a96[_0x4152('0x3a')]:_0x3a6248[_0x4152('0x37')];if(_0x103d8e['query']['includeAll']){_0x376a96[_0x4152('0x4d')]=[{'all':!![]}];}_0x376a96=_[_0x4152('0x46')]({},_0x376a96,_0x103d8e[_0x4152('0x47')]);return db[_0x4152('0x33')][_0x4152('0x2b')](_0x376a96)[_0x4152('0x21')](handleEntityNotFound(_0x2051c2,null))[_0x4152('0x21')](function(_0x54d552){if(_0x54d552){var _0x28c584=_0x54d552[_0x4152('0x23')]({'plain':!![]});_0x28c584=qs[_0x4152('0x55')](_0x28c584,['id',_0x4152('0x56'),_0x4152('0x57')]);_0x103d8e['body']=_['omit'](_0x103d8e['body'],['id',_0x4152('0x56'),_0x4152('0x57')]);return db[_0x4152('0x33')][_0x4152('0x4e')](_[_0x4152('0x46')](_0x28c584,_0x103d8e[_0x4152('0x58')]),{'include':_0x103d8e[_0x4152('0x38')][_0x4152('0x48')]?[{'all':!![]}]:undefined})[_0x4152('0x21')](function(_0x53cc0e){var _0x271acd=_0x103d8e[_0x4152('0x4f')][_0x4152('0x23')]({'plain':!![]});if(!_0x271acd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x271acd[_0x4152('0x50')]===_0x4152('0x4f')){var _0x10a031=_0x53cc0e[_0x4152('0x23')]({'plain':!![]});var _0x4ae16f=[{'name':'VoiceQueues','value':_0x4152('0x51')},{'name':'QueueCampaigns','value':_0x4152('0x52')}];var _0x13976e=_[_0x4152('0x2b')](_0x4ae16f,[_0x4152('0x29'),_0x10a031[_0x4152('0x2c')]])[_0x4152('0x30')];return db['UserProfileSection'][_0x4152('0x2b')]({'where':{'name':_0x13976e,'userProfileId':_0x271acd[_0x4152('0x53')]},'raw':!![]})[_0x4152('0x21')](function(_0x12779d){if(_0x12779d&&_0x12779d[_0x4152('0x59')]===0x0){return db[_0x4152('0x2d')]['create']({'name':_0x10a031[_0x4152('0x30')],'resourceId':_0x10a031['id'],'type':_0x12779d[_0x4152('0x30')],'sectionId':_0x12779d['id']},{})[_0x4152('0x21')](function(){return _0x53cc0e;});}else{return _0x53cc0e;}})[_0x4152('0x4a')](function(_0x19ad67){logger['error'](_0x4152('0x5a'),_0x19ad67);throw _0x19ad67;});}return _0x53cc0e;});}})[_0x4152('0x21')](respondWithResult(_0x2051c2,0xc9))[_0x4152('0x4a')](handleError(_0x2051c2,null));};exports[_0x4152('0x20')]=function(_0x5c50c0,_0xb684dc){if(_0x5c50c0['body']['id']){delete _0x5c50c0[_0x4152('0x58')]['id'];}return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x5c50c0[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0xb684dc,null))[_0x4152('0x21')](saveUpdates(_0x5c50c0[_0x4152('0x58')],null))['then'](respondWithResult(_0xb684dc,null))[_0x4152('0x4a')](handleError(_0xb684dc,null));};exports[_0x4152('0x22')]=function(_0x1c2551,_0x171de4){return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x1c2551[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x171de4,null))[_0x4152('0x21')](removeEntity(_0x171de4,null))[_0x4152('0x4a')](handleError(_0x171de4,null));};exports['getHoppers']=function(_0x5eec07,_0x2f3dc5,_0x16fb5b){var _0x3c5916={'raw':![],'where':{}};var _0x4ddcea={};var _0x1bc525={'count':0x0,'rows':[]};return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x5eec07[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f3dc5,null))[_0x4152('0x21')](function(_0x208a1c){if(_0x208a1c){_0x4ddcea[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x5c')][_0x4152('0x34')]);_0x4ddcea[_0x4152('0x38')]=_[_0x4152('0x39')](_0x5eec07['query']);_0x4ddcea[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x4ddcea[_0x4152('0x37')],_0x4ddcea[_0x4152('0x38')]);_0x3c5916[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x4ddcea[_0x4152('0x37')],qs['fields'](_0x5eec07[_0x4152('0x38')]['fields']));_0x3c5916[_0x4152('0x3a')]=_0x3c5916['attributes']['length']?_0x3c5916[_0x4152('0x3a')]:_0x4ddcea[_0x4152('0x37')];if(!_0x5eec07['query'][_0x4152('0x3e')](_0x4152('0x3f'))){_0x3c5916['limit']=qs['limit'](_0x5eec07['query'][_0x4152('0x1a')]);_0x3c5916['offset']=qs['offset'](_0x5eec07[_0x4152('0x38')][_0x4152('0x40')]);}_0x3c5916[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x5eec07[_0x4152('0x38')][_0x4152('0x42')]);_0x3c5916[_0x4152('0x43')]=qs[_0x4152('0x44')](_['pick'](_0x5eec07[_0x4152('0x38')],_0x4ddcea[_0x4152('0x44')]));_0x3c5916['where'][_0x4152('0x5d')]=_0x208a1c['id'];if(_0x5eec07[_0x4152('0x38')][_0x4152('0x26')]){_0x3c5916[_0x4152('0x43')]=_[_0x4152('0x46')](_0x3c5916['where'],{'$or':_[_0x4152('0x28')](_0x3c5916[_0x4152('0x3a')],function(_0x450665){var _0x10846c={};_0x10846c[_0x450665]={'$like':'%'+_0x5eec07[_0x4152('0x38')]['filter']+'%'};return _0x10846c;})});}_0x3c5916=_[_0x4152('0x46')]({},_0x3c5916,_0x5eec07['options']);return db[_0x4152('0x5c')][_0x4152('0x19')]({'where':_0x3c5916['where']})['then'](function(_0x423c62){_0x1bc525['count']=_0x423c62;if(_0x5eec07[_0x4152('0x38')]['includeAll']){_0x3c5916[_0x4152('0x4d')]=[{'all':!![]}];}return db[_0x4152('0x5c')][_0x4152('0x5e')](_0x3c5916);})[_0x4152('0x21')](function(_0x22a114){_0x1bc525[_0x4152('0x49')]=_0x22a114;return _0x1bc525;});}})['then'](respondWithFilteredResult(_0x2f3dc5,_0x3c5916))[_0x4152('0x4a')](handleError(_0x2f3dc5,null));};exports[_0x4152('0x5f')]=function(_0x2891dc,_0x67cacc,_0x293816){var _0x3b36e2={'raw':!![],'where':{}};var _0x5c4ba8={};var _0x23f82f={'count':0x0,'rows':[]};return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x2891dc[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x67cacc,null))[_0x4152('0x21')](function(_0x50bc12){if(_0x50bc12){_0x5c4ba8[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x60')][_0x4152('0x34')]);_0x5c4ba8[_0x4152('0x38')]=_['keys'](_0x2891dc[_0x4152('0x38')]);_0x5c4ba8[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x5c4ba8[_0x4152('0x37')],_0x5c4ba8[_0x4152('0x38')]);_0x3b36e2['attributes']=_['intersection'](_0x5c4ba8[_0x4152('0x37')],qs['fields'](_0x2891dc[_0x4152('0x38')][_0x4152('0x3c')]));_0x3b36e2[_0x4152('0x3a')]=_0x3b36e2['attributes'][_0x4152('0x3d')]?_0x3b36e2[_0x4152('0x3a')]:_0x5c4ba8[_0x4152('0x37')];if(!_0x2891dc['query'][_0x4152('0x3e')](_0x4152('0x3f'))){_0x3b36e2[_0x4152('0x1a')]=qs['limit'](_0x2891dc[_0x4152('0x38')]['limit']);_0x3b36e2[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x2891dc['query']['offset']);}_0x3b36e2[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x2891dc[_0x4152('0x38')][_0x4152('0x42')]);_0x3b36e2[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x2891dc['query'],_0x5c4ba8[_0x4152('0x44')]));_0x3b36e2[_0x4152('0x43')][_0x4152('0x5d')]=_0x50bc12['id'];if(_0x2891dc[_0x4152('0x38')][_0x4152('0x26')]){_0x3b36e2[_0x4152('0x43')]=_['merge'](_0x3b36e2['where'],{'$or':_['map'](_0x3b36e2[_0x4152('0x3a')],function(_0x2bc5b7){var _0x223688={};_0x223688[_0x2bc5b7]={'$like':'%'+_0x2891dc[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x223688;})});}_0x3b36e2=_[_0x4152('0x46')]({},_0x3b36e2,_0x2891dc['options']);return db['CmHopperHistory'][_0x4152('0x19')]({'where':_0x3b36e2[_0x4152('0x43')]})['then'](function(_0x3e1447){_0x23f82f[_0x4152('0x19')]=_0x3e1447;if(_0x2891dc[_0x4152('0x38')][_0x4152('0x48')]){_0x3b36e2[_0x4152('0x4d')]=[{'all':!![]}];}return db[_0x4152('0x60')]['findAll'](_0x3b36e2);})[_0x4152('0x21')](function(_0x5559e7){_0x23f82f[_0x4152('0x49')]=_0x5559e7;return _0x23f82f;});}})[_0x4152('0x21')](respondWithFilteredResult(_0x67cacc,_0x3b36e2))[_0x4152('0x4a')](handleError(_0x67cacc,null));};exports[_0x4152('0x61')]=function(_0xfa2bfd,_0x217607,_0x1753f0){var _0x2289ee={'raw':!![],'where':{}};var _0x3fa9a6={};var _0x138b61={'count':0x0,'rows':[]};return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0xfa2bfd[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x217607,null))['then'](function(_0x36c8dd){if(_0x36c8dd){_0x3fa9a6[_0x4152('0x37')]=_[_0x4152('0x39')](db['CmHopperFinal'][_0x4152('0x34')]);_0x3fa9a6[_0x4152('0x38')]=_['keys'](_0xfa2bfd[_0x4152('0x38')]);_0x3fa9a6[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x3fa9a6[_0x4152('0x37')],_0x3fa9a6['query']);_0x2289ee['attributes']=_['intersection'](_0x3fa9a6[_0x4152('0x37')],qs[_0x4152('0x3c')](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x3c')]));_0x2289ee[_0x4152('0x3a')]=_0x2289ee[_0x4152('0x3a')][_0x4152('0x3d')]?_0x2289ee[_0x4152('0x3a')]:_0x3fa9a6[_0x4152('0x37')];if(!_0xfa2bfd[_0x4152('0x38')]['hasOwnProperty'](_0x4152('0x3f'))){_0x2289ee[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x1a')]);_0x2289ee[_0x4152('0x40')]=qs['offset'](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x40')]);}_0x2289ee['order']=qs['sort'](_0xfa2bfd[_0x4152('0x38')][_0x4152('0x42')]);_0x2289ee[_0x4152('0x43')]=qs['filters'](_[_0x4152('0x45')](_0xfa2bfd['query'],_0x3fa9a6[_0x4152('0x44')]));_0x2289ee[_0x4152('0x43')][_0x4152('0x5d')]=_0x36c8dd['id'];if(_0xfa2bfd['query'][_0x4152('0x26')]){_0x2289ee[_0x4152('0x43')]=_[_0x4152('0x46')](_0x2289ee['where'],{'$or':_[_0x4152('0x28')](_0x2289ee['attributes'],function(_0x28546e){var _0x130433={};_0x130433[_0x28546e]={'$like':'%'+_0xfa2bfd[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x130433;})});}_0x2289ee=_[_0x4152('0x46')]({},_0x2289ee,_0xfa2bfd['options']);return db[_0x4152('0x62')][_0x4152('0x19')]({'where':_0x2289ee[_0x4152('0x43')]})[_0x4152('0x21')](function(_0x1b0bd4){_0x138b61['count']=_0x1b0bd4;if(_0xfa2bfd[_0x4152('0x38')][_0x4152('0x48')]){_0x2289ee[_0x4152('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4152('0x5e')](_0x2289ee);})[_0x4152('0x21')](function(_0x216317){_0x138b61[_0x4152('0x49')]=_0x216317;return _0x138b61;});}})[_0x4152('0x21')](respondWithFilteredResult(_0x217607,_0x2289ee))[_0x4152('0x4a')](handleError(_0x217607,null));};exports[_0x4152('0x63')]=function(_0x5e655a,_0x6bf34c,_0xd7f442){var _0x4b1e40={'raw':!![],'where':{}};var _0x49081a={};var _0x4a232b={'count':0x0,'rows':[]};return db[_0x4152('0x33')]['findOne']({'where':{'id':_0x5e655a[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x6bf34c,null))['then'](function(_0x221d8c){if(_0x221d8c){_0x49081a[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x64')][_0x4152('0x34')]);_0x49081a[_0x4152('0x38')]=_['keys'](_0x5e655a[_0x4152('0x38')]);_0x49081a[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x49081a[_0x4152('0x37')],_0x49081a[_0x4152('0x38')]);_0x4b1e40[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x49081a[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x5e655a[_0x4152('0x38')][_0x4152('0x3c')]));_0x4b1e40[_0x4152('0x3a')]=_0x4b1e40[_0x4152('0x3a')]['length']?_0x4b1e40[_0x4152('0x3a')]:_0x49081a[_0x4152('0x37')];if(!_0x5e655a['query'][_0x4152('0x3e')](_0x4152('0x3f'))){_0x4b1e40[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x5e655a['query']['limit']);_0x4b1e40['offset']=qs[_0x4152('0x40')](_0x5e655a[_0x4152('0x38')][_0x4152('0x40')]);}_0x4b1e40['order']=qs['sort'](_0x5e655a[_0x4152('0x38')][_0x4152('0x42')]);_0x4b1e40[_0x4152('0x43')]=qs[_0x4152('0x44')](_['pick'](_0x5e655a[_0x4152('0x38')],_0x49081a[_0x4152('0x44')]));_0x4b1e40['where']['VoiceQueueId']=_0x221d8c['id'];if(_0x5e655a[_0x4152('0x38')][_0x4152('0x26')]){_0x4b1e40[_0x4152('0x43')]=_['merge'](_0x4b1e40['where'],{'$or':_[_0x4152('0x28')](_0x4b1e40[_0x4152('0x3a')],function(_0x3b6633){var _0x475664={};_0x475664[_0x3b6633]={'$like':'%'+_0x5e655a[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x475664;})});}_0x4b1e40=_[_0x4152('0x46')]({},_0x4b1e40,_0x5e655a['options']);return db[_0x4152('0x64')][_0x4152('0x19')]({'where':_0x4b1e40[_0x4152('0x43')]})[_0x4152('0x21')](function(_0x1a34e2){_0x4a232b[_0x4152('0x19')]=_0x1a34e2;if(_0x5e655a[_0x4152('0x38')][_0x4152('0x48')]){_0x4b1e40[_0x4152('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4152('0x5e')](_0x4b1e40);})['then'](function(_0x1ddef2){_0x4a232b['rows']=_0x1ddef2;return _0x4a232b;});}})['then'](respondWithFilteredResult(_0x6bf34c,_0x4b1e40))[_0x4152('0x4a')](handleError(_0x6bf34c,null));};exports[_0x4152('0x65')]=function(_0x5467f6,_0x5273d6,_0xddb82c){var _0x5ee0b6={};var _0x33c5c1={};var _0x50240d;var _0x10043f;return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x5467f6[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5273d6,null))[_0x4152('0x21')](function(_0xdd9caf){if(_0xdd9caf){_0x50240d=_0xdd9caf;_0x33c5c1[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x66')][_0x4152('0x34')]);_0x33c5c1[_0x4152('0x38')]=_['keys'](_0x5467f6[_0x4152('0x38')]);_0x33c5c1[_0x4152('0x44')]=_['intersection'](_0x33c5c1['model'],_0x33c5c1[_0x4152('0x38')]);_0x5ee0b6[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x33c5c1['model'],qs[_0x4152('0x3c')](_0x5467f6[_0x4152('0x38')][_0x4152('0x3c')]));_0x5ee0b6[_0x4152('0x3a')]=_0x5ee0b6[_0x4152('0x3a')][_0x4152('0x3d')]?_0x5ee0b6[_0x4152('0x3a')]:_0x33c5c1[_0x4152('0x37')];_0x5ee0b6['order']=qs[_0x4152('0x42')](_0x5467f6['query'][_0x4152('0x42')]);_0x5ee0b6[_0x4152('0x43')]=qs['filters'](_[_0x4152('0x45')](_0x5467f6[_0x4152('0x38')],_0x33c5c1['filters']));if(_0x5467f6[_0x4152('0x38')]['filter']){_0x5ee0b6[_0x4152('0x43')]=_[_0x4152('0x46')](_0x5ee0b6['where'],{'$or':_[_0x4152('0x28')](_0x5ee0b6[_0x4152('0x3a')],function(_0x184332){var _0x1bf995={};_0x1bf995[_0x184332]={'$like':'%'+_0x5467f6[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x1bf995;})});}_0x5ee0b6=_['merge']({},_0x5ee0b6,_0x5467f6[_0x4152('0x47')]);return _0x50240d[_0x4152('0x65')](_0x5ee0b6);}})[_0x4152('0x21')](function(_0x31d3cd){if(_0x31d3cd){_0x10043f=_0x31d3cd[_0x4152('0x3d')];if(!_0x5467f6[_0x4152('0x38')][_0x4152('0x3e')]('nolimit')){_0x5ee0b6[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x5467f6[_0x4152('0x38')][_0x4152('0x1a')]);_0x5ee0b6[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x5467f6[_0x4152('0x38')][_0x4152('0x40')]);}return _0x50240d[_0x4152('0x65')](_0x5ee0b6);}})['then'](function(_0x40b2cb){if(_0x40b2cb){return _0x40b2cb?{'count':_0x10043f,'rows':_0x40b2cb}:null;}})['then'](respondWithResult(_0x5273d6,null))['catch'](handleError(_0x5273d6,null));};exports['addTeams']=function(_0xc05df1,_0x24c540,_0x278113){var _0x45a0bb=_0xc05df1[_0x4152('0x58')][_0x4152('0x67')];var _0x293440=_[_0x4152('0x28')](_0x45a0bb,'id');return db[_0x4152('0x66')][_0x4152('0x5e')]({'where':{'id':_0x293440},'attributes':['id'],'include':[{'model':db[_0x4152('0x68')],'as':_0x4152('0x69'),'attributes':['id',_0x4152('0x30'),_0x4152('0x6a'),_0x4152('0x6b'),'interface'],'raw':!![]}]})[_0x4152('0x21')](function(_0x1d2510){if(_0x1d2510){var _0x2b252e=_[_0x4152('0x6c')](_0x1d2510,function(_0x25c9d0){var _0x147737=_0x25c9d0[_0x4152('0x23')]({'plain':!![]});_0x147737[_0x4152('0x69')][_0x4152('0x6d')](function(_0x57437b){_0x57437b[_0x4152('0x6e')]=_[_0x4152('0x2b')](_0x45a0bb,{'id':_0x147737['id']})[_0x4152('0x6e')];});return _0x147737['Agents'];});return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0xc05df1[_0x4152('0x4c')]['id']}})['then'](function(_0x242e04){return db['sequelize'][_0x4152('0x6f')](function(_0xd8b26c){return _0x242e04[_0x4152('0x70')](_0x293440,{'transaction':_0xd8b26c})[_0x4152('0x21')](function(){return BPromise[_0x4152('0x71')](_0x45a0bb,function(_0x3e46cf){return db['TeamVoiceQueue'][_0x4152('0x72')]({'TeamId':_0x3e46cf['id'],'VoiceQueueId':_0xc05df1['params']['id'],'penalty':_0x3e46cf[_0x4152('0x6e')]},{'transaction':_0xd8b26c});});})['then'](function(){return BPromise['each'](_0x2b252e,function(_0x30a3e0){return db[_0x4152('0x73')][_0x4152('0x74')]({'where':{'UserId':_0x30a3e0['id'],'VoiceQueueId':_0xc05df1[_0x4152('0x4c')]['id']},'defaults':{'penalty':_0x30a3e0[_0x4152('0x6e')]},'transaction':_0xd8b26c});});})[_0x4152('0x21')](function(){return BPromise[_0x4152('0x71')](_[_0x4152('0x26')](_0x2b252e,{'online':!![]}),function(_0x5386a5){return db[_0x4152('0x75')][_0x4152('0x72')]({'membername':_0x5386a5[_0x4152('0x30')],'UserId':_0x5386a5['id'],'queue_name':_0x242e04[_0x4152('0x30')],'VoiceQueueId':_0x242e04['id'],'interface':_['isNil'](_0x5386a5[_0x4152('0x76')])?util[_0x4152('0x77')](_0x4152('0x78'),_0x5386a5[_0x4152('0x30')]):_0x5386a5[_0x4152('0x76')],'paused':_0x5386a5[_0x4152('0x6b')]||![],'penalty':_0x5386a5['penalty']},{'transaction':_0xd8b26c});});})[_0x4152('0x21')](function(){_0x2b252e[_0x4152('0x6d')](function(_0x270fc0){socket['emit']('userVoiceQueue:save',{'UserId':_0x270fc0['id'],'VoiceQueueId':_0x242e04['id']});});});});});}})[_0x4152('0x21')](respondWithStatusCode(_0x24c540,null))[_0x4152('0x4a')](handleError(_0x24c540,null));};exports['removeTeams']=function(_0x17f574,_0x31e7c5,_0x4534b2){return db[_0x4152('0x66')][_0x4152('0x5e')]({'where':{'id':_0x17f574[_0x4152('0x38')][_0x4152('0x79')]},'attributes':['id'],'include':[{'model':db[_0x4152('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4152('0x21')](handleEntityNotFound(_0x31e7c5,null))['then'](function(_0x304be9){var _0x2fed81=_[_0x4152('0x28')](_0x304be9,'id');var _0x316fa8=[];var _0xb75b5f=[];var _0x1f208f=squel[_0x4152('0x7a')]();_0x1f208f['field'](_0x4152('0x7b'))[_0x4152('0x7c')](_0x4152('0x7d'),'tq')['join'](_0x4152('0x7e'),'ut',_0x4152('0x7f'))[_0x4152('0x43')](_0x4152('0x80'),_0x17f574['params']['id']);for(var _0x4d37c3=0x0;_0x4d37c3<_0x304be9[_0x4152('0x3d')];_0x4d37c3+=0x1){let _0x57b8b3=_0x304be9[_0x4d37c3];for(var _0x10be43=0x0;_0x10be43<_0x57b8b3[_0x4152('0x69')]['length'];_0x10be43+=0x1){let _0x1beb92=_0x57b8b3[_0x4152('0x69')][_0x10be43];var _0x47f4d0=_0x1f208f['clone']();_0x47f4d0[_0x4152('0x43')](_0x4152('0x81'),_0x1beb92['id']);_0xb75b5f[_0x4152('0x82')](db[_0x4152('0x83')]['query'](_0x47f4d0['toString'](),{'type':db[_0x4152('0x83')]['QueryTypes'][_0x4152('0x84')]})[_0x4152('0x21')](function(_0xf79ade){if(_0xf79ade['length']===0x1){return _0x1beb92['id'];}else{var _0x51bc2a=_[_0x4152('0x85')](_[_0x4152('0x28')](_0xf79ade,_0x4152('0x86')),function(_0x52e72a){return _['includes'](_0x2fed81,_0x52e72a);});if(_0x51bc2a){return _0x1beb92['id'];}}}));}}return BPromise['all'](_0xb75b5f)[_0x4152('0x21')](function(_0x192542){_0x316fa8=_(_0x316fa8)[_0x4152('0x87')](_0x192542)['compact']()['value']();return db[_0x4152('0x33')]['find']({'where':{'id':_0x17f574['params']['id']}})['then'](function(_0x53f7ca){return db['sequelize']['transaction'](function(_0x5b6cb2){return _0x53f7ca['removeTeams'](_0x17f574['query']['ids'],{'transaction':_0x5b6cb2})[_0x4152('0x21')](function(){if(!_[_0x4152('0x88')](_0x316fa8)){return _0x53f7ca['removeAgents'](_0x316fa8,{'transaction':_0x5b6cb2})[_0x4152('0x21')](function(){return db[_0x4152('0x75')][_0x4152('0x22')]({'where':{'VoiceQueueId':_0x17f574[_0x4152('0x4c')]['id'],'UserId':_0x316fa8},'transaction':_0x5b6cb2});});}})[_0x4152('0x21')](function(){_0x316fa8[_0x4152('0x6d')](function(_0x226243){socket[_0x4152('0x89')](_0x4152('0x8a'),{'UserId':_0x226243,'VoiceQueueId':_0x53f7ca['id']});});});});});});})['then'](respondWithStatusCode(_0x31e7c5,null))['catch'](handleError(_0x31e7c5,null));};exports['addAgents']=function(_0x39c9eb,_0x32b4bc,_0x24d715){var _0x4c5731,_0x50706c;return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x39c9eb[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x32b4bc,null))[_0x4152('0x21')](function(_0x14aeec){if(_0x14aeec){_0x50706c=_0x14aeec;return _0x14aeec[_0x4152('0x8b')](_0x39c9eb[_0x4152('0x58')][_0x4152('0x79')],_['omit'](_0x39c9eb[_0x4152('0x58')],['ids','id'])||{})['spread'](function(_0x457470){for(var _0x5f3a26=0x0;_0x5f3a26<_0x39c9eb[_0x4152('0x58')][_0x4152('0x79')][_0x4152('0x3d')];_0x5f3a26+=0x1){socket[_0x4152('0x89')]('userVoiceQueue:save',{'UserId':Number(_0x39c9eb[_0x4152('0x58')][_0x4152('0x79')][_0x5f3a26]),'VoiceQueueId':Number(_0x39c9eb[_0x4152('0x4c')]['id'])});}return _0x457470;});}})[_0x4152('0x21')](function(_0x149362){_0x4c5731=_0x149362||[];if(_0x50706c){return db[_0x4152('0x68')][_0x4152('0x5e')]({'where':{'id':_0x39c9eb['body'][_0x4152('0x79')]},'attributes':['id',_0x4152('0x30'),'online',_0x4152('0x6b'),_0x4152('0x76')],'raw':!![]});}})['then'](function(_0x150896){if(!_[_0x4152('0x88')](_0x150896)){var _0x2e4c1b=[];for(var _0x488eeb=0x0;_0x488eeb<_0x150896[_0x4152('0x3d')];_0x488eeb++){if(_0x150896[_0x488eeb][_0x4152('0x6a')]){_0x2e4c1b[_0x4152('0x82')](db[_0x4152('0x75')]['upsert']({'membername':_0x150896[_0x488eeb]['name'],'UserId':_0x150896[_0x488eeb]['id'],'queue_name':_0x50706c[_0x4152('0x30')],'VoiceQueueId':_0x50706c['id'],'interface':_['isNil'](_0x150896[_0x488eeb][_0x4152('0x76')])?util[_0x4152('0x77')](_0x4152('0x78'),_0x150896[_0x488eeb][_0x4152('0x30')]):_0x150896[_0x488eeb][_0x4152('0x76')],'paused':_0x150896[_0x488eeb][_0x4152('0x6b')]||![],'penalty':_0x39c9eb[_0x4152('0x58')][_0x4152('0x6e')]||0x0}));}}return BPromise['all'](_0x2e4c1b);}})[_0x4152('0x21')](function(){return _0x4c5731;})['then'](respondWithResult(_0x32b4bc,null))[_0x4152('0x4a')](handleError(_0x32b4bc,null));};exports['removeAgents']=function(_0x2a11ed,_0x20db19,_0x234914){return db['VoiceQueue'][_0x4152('0x2b')]({'where':{'id':_0x2a11ed[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x20db19,null))['then'](function(_0x57aadf){if(_0x57aadf){return _0x57aadf[_0x4152('0x8c')](_0x2a11ed['query'][_0x4152('0x79')])[_0x4152('0x21')](function(){if(_[_0x4152('0x8d')](_0x2a11ed[_0x4152('0x38')][_0x4152('0x79')])){for(var _0x318f6f=0x0;_0x318f6f<_0x2a11ed[_0x4152('0x38')][_0x4152('0x79')]['length'];_0x318f6f+=0x1){socket[_0x4152('0x89')]('userVoiceQueue:remove',{'UserId':Number(_0x2a11ed[_0x4152('0x38')][_0x4152('0x79')][_0x318f6f]),'VoiceQueueId':Number(_0x2a11ed[_0x4152('0x4c')]['id'])});}}else{socket[_0x4152('0x89')](_0x4152('0x8a'),{'UserId':Number(_0x2a11ed['query'][_0x4152('0x79')]),'VoiceQueueId':Number(_0x2a11ed[_0x4152('0x4c')]['id'])});}});}})['then'](function(_0x2460d4){return db['UserVoiceQueueRt'][_0x4152('0x22')]({'where':{'VoiceQueueId':_0x2a11ed[_0x4152('0x4c')]['id'],'UserId':_0x2a11ed['query'][_0x4152('0x79')]}})[_0x4152('0x21')](function(){return _0x2460d4;});})[_0x4152('0x21')](respondWithStatusCode(_0x20db19,null))['catch'](handleError(_0x20db19,null));};exports[_0x4152('0x8e')]=function(_0x23d551,_0x19afdc,_0x103c95){var _0x22a150={};var _0x25655a={};var _0x2430ca;var _0x4566ac;return db[_0x4152('0x33')]['findOne']({'where':{'id':_0x23d551[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x19afdc,null))[_0x4152('0x21')](function(_0x4c86fc){if(_0x4c86fc){_0x2430ca=_0x4c86fc;_0x25655a[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0x68')][_0x4152('0x34')]);_0x25655a['query']=_['keys'](_0x23d551[_0x4152('0x38')]);_0x25655a[_0x4152('0x44')]=_['intersection'](_0x25655a[_0x4152('0x37')],_0x25655a[_0x4152('0x38')]);_0x22a150[_0x4152('0x3a')]=_['intersection'](_0x25655a[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x23d551[_0x4152('0x38')][_0x4152('0x3c')]));_0x22a150[_0x4152('0x3a')]=_0x22a150[_0x4152('0x3a')][_0x4152('0x3d')]?_0x22a150['attributes']:_0x25655a['model'];_0x22a150[_0x4152('0x41')]=qs[_0x4152('0x42')](_0x23d551[_0x4152('0x38')]['sort']);_0x22a150[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x23d551[_0x4152('0x38')],_0x25655a['filters']));if(_0x23d551[_0x4152('0x38')]['filter']){_0x22a150['where']=_[_0x4152('0x46')](_0x22a150[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x22a150[_0x4152('0x3a')],function(_0x259efd){var _0x4e5b65={};_0x4e5b65[_0x259efd]={'$like':'%'+_0x23d551[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4e5b65;})});}_0x22a150=_['merge']({},_0x22a150,_0x23d551[_0x4152('0x47')]);return _0x2430ca['getAgents'](_0x22a150);}})[_0x4152('0x21')](function(_0x580750){if(_0x580750){_0x4566ac=_0x580750[_0x4152('0x3d')];if(!_0x23d551[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x22a150[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x23d551[_0x4152('0x38')][_0x4152('0x1a')]);_0x22a150[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x23d551[_0x4152('0x38')][_0x4152('0x40')]);}return _0x2430ca[_0x4152('0x8e')](_0x22a150);}})['then'](function(_0x496aad){if(_0x496aad){return _0x496aad?{'count':_0x4566ac,'rows':_0x496aad}:null;}})[_0x4152('0x21')](respondWithResult(_0x19afdc,null))['catch'](handleError(_0x19afdc,null));};exports['getMembers']=function(_0x53e2a9,_0x16d51a,_0x3e0c20){var _0x5ac119={};var _0xafaf81={};var _0x1796af;var _0x322cd5;return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x53e2a9[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16d51a,null))['then'](function(_0x3586b3){if(_0x3586b3){_0x1796af=_0x3586b3;_0xafaf81['model']=_[_0x4152('0x39')](db[_0x4152('0x75')][_0x4152('0x34')]);_0xafaf81[_0x4152('0x38')]=_[_0x4152('0x39')](_0x53e2a9[_0x4152('0x38')]);_0xafaf81[_0x4152('0x44')]=_[_0x4152('0x3b')](_0xafaf81[_0x4152('0x37')],_0xafaf81[_0x4152('0x38')]);_0x5ac119[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0xafaf81[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x53e2a9[_0x4152('0x38')][_0x4152('0x3c')]));_0x5ac119['attributes']=_0x5ac119[_0x4152('0x3a')][_0x4152('0x3d')]?_0x5ac119[_0x4152('0x3a')]:_0xafaf81[_0x4152('0x37')];_0x5ac119[_0x4152('0x41')]=qs['sort'](_0x53e2a9['query'][_0x4152('0x42')]);_0x5ac119[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x53e2a9['query'],_0xafaf81[_0x4152('0x44')]));if(_0x53e2a9[_0x4152('0x38')]['filter']){_0x5ac119['where']=_[_0x4152('0x46')](_0x5ac119[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x5ac119[_0x4152('0x3a')],function(_0xdffbe){var _0x22403e={};_0x22403e[_0xdffbe]={'$like':'%'+_0x53e2a9[_0x4152('0x38')]['filter']+'%'};return _0x22403e;})});}_0x5ac119=_['merge']({},_0x5ac119,_0x53e2a9[_0x4152('0x47')]);return _0x1796af[_0x4152('0x8f')](_0x5ac119);}})[_0x4152('0x21')](function(_0xb500bb){if(_0xb500bb){_0x322cd5=_0xb500bb['length'];if(!_0x53e2a9[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x5ac119[_0x4152('0x1a')]=qs['limit'](_0x53e2a9[_0x4152('0x38')][_0x4152('0x1a')]);_0x5ac119[_0x4152('0x40')]=qs[_0x4152('0x40')](_0x53e2a9[_0x4152('0x38')][_0x4152('0x40')]);}return _0x1796af[_0x4152('0x8f')](_0x5ac119);}})['then'](function(_0x2a1489){return _0x2a1489?{'count':_0x322cd5,'rows':_0x2a1489}:null;})['then'](respondWithResult(_0x16d51a,null))[_0x4152('0x4a')](handleError(_0x16d51a,null));};exports[_0x4152('0x90')]=function(_0xd824b1,_0x4a3bda,_0x336b4b){var _0x3fe0fd={};var _0x508896={};var _0x2328e2;var _0x26705c;return db['VoiceQueue'][_0x4152('0x5b')]({'where':{'id':_0xd824b1['params']['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x4a3bda,null))[_0x4152('0x21')](function(_0xd76174){if(_0xd76174){_0x2328e2=_0xd76174;_0x508896[_0x4152('0x37')]=_[_0x4152('0x39')](db['CmList'][_0x4152('0x34')]);_0x508896[_0x4152('0x38')]=_[_0x4152('0x39')](_0xd824b1['query']);_0x508896[_0x4152('0x44')]=_[_0x4152('0x3b')](_0x508896[_0x4152('0x37')],_0x508896[_0x4152('0x38')]);_0x3fe0fd['attributes']=_[_0x4152('0x3b')](_0x508896[_0x4152('0x37')],qs['fields'](_0xd824b1[_0x4152('0x38')][_0x4152('0x3c')]));_0x3fe0fd['attributes']=_0x3fe0fd[_0x4152('0x3a')]['length']?_0x3fe0fd[_0x4152('0x3a')]:_0x508896[_0x4152('0x37')];_0x3fe0fd[_0x4152('0x41')]=qs[_0x4152('0x42')](_0xd824b1['query']['sort']);_0x3fe0fd[_0x4152('0x43')]=qs['filters'](_[_0x4152('0x45')](_0xd824b1[_0x4152('0x38')],_0x508896['filters']));if(_0xd824b1[_0x4152('0x38')][_0x4152('0x26')]){_0x3fe0fd['where']=_['merge'](_0x3fe0fd[_0x4152('0x43')],{'$or':_['map'](_0x3fe0fd[_0x4152('0x3a')],function(_0x21dfa9){var _0x4a1614={};_0x4a1614[_0x21dfa9]={'$like':'%'+_0xd824b1[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4a1614;})});}_0x3fe0fd=_[_0x4152('0x46')]({},_0x3fe0fd,_0xd824b1[_0x4152('0x47')]);return _0x2328e2['getLists'](_0x3fe0fd);}})['then'](function(_0x2d25e0){if(_0x2d25e0){_0x26705c=_0x2d25e0[_0x4152('0x3d')];if(!_0xd824b1[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x3fe0fd[_0x4152('0x1a')]=qs['limit'](_0xd824b1[_0x4152('0x38')][_0x4152('0x1a')]);_0x3fe0fd[_0x4152('0x40')]=qs['offset'](_0xd824b1['query']['offset']);}return _0x2328e2[_0x4152('0x90')](_0x3fe0fd);}})[_0x4152('0x21')](function(_0x7fe292){if(_0x7fe292){return _0x7fe292?{'count':_0x26705c,'rows':_0x7fe292}:null;}})[_0x4152('0x21')](respondWithResult(_0x4a3bda,null))[_0x4152('0x4a')](handleError(_0x4a3bda,null));};exports[_0x4152('0x91')]=function(_0xc8dce2,_0x435e0f,_0x4a0a85){var _0x4a3d16,_0x472aeb;return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0xc8dce2['params']['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x435e0f,null))['then'](function(_0x2a8b4a){if(_0x2a8b4a){_0x472aeb=_0x2a8b4a;return _0x2a8b4a['addLists'](_0xc8dce2[_0x4152('0x58')][_0x4152('0x79')],_[_0x4152('0x55')](_0xc8dce2['body'],['ids','id'])||{});}return null;})[_0x4152('0x92')](function(_0x532ec9){var _0x12e413;_0x4a3d16=_0x532ec9||[];var _0x4a1739=[];if(_0x532ec9){for(var _0x1f7140=0x0;_0x1f7140<_0x532ec9[_0x4152('0x3d')];_0x1f7140+=0x1){var _0x221209=_0x532ec9[_0x1f7140]['get']({'plain':!![]});_0x472aeb[_0x4152('0x93')]=_0xc8dce2['body'][_0x4152('0x93')]?_0xc8dce2[_0x4152('0x58')][_0x4152('0x93')]:_0x472aeb['dialCheckDuplicateType'];switch(_0x472aeb[_0x4152('0x93')]){case'always':_0x12e413=squel[_0x4152('0x94')]()[_0x4152('0x95')](_0x4152('0x96'))['fromQuery']([_0x4152('0x97'),'scheduledAt','ContactId',_0x4152('0x98'),_0x4152('0x5d'),_0x4152('0x56'),_0x4152('0x57')],squel[_0x4152('0x7a')]()['field']('phone','phone')['field'](_0x4152('0x99'),'scheduledAt')[_0x4152('0x9a')]('id',_0x4152('0x9b'))['field'](_0x221209[_0x4152('0x9c')]['toString'](),_0x4152('0x98'))['field'](_0xc8dce2[_0x4152('0x4c')]['id'][_0x4152('0x9d')](),_0x4152('0x5d'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x56'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x57'))['from'](_0x4152('0x9e'))[_0x4152('0x43')](_0x4152('0x9f'))[_0x4152('0x43')](_0x4152('0xa0'),_0x221209['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x4152('0xa1'),squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0xa2'))[_0x4152('0x7c')](_0x4152('0xa3'))['where'](_0x4152('0x80'),_0xc8dce2['params']['id'][_0x4152('0x9d')]()))[_0x4152('0x43')](_0x4152('0xa1'),squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0xa4'))['from'](_0x4152('0x96'))[_0x4152('0x43')](_0x4152('0x80'),_0xc8dce2[_0x4152('0x4c')]['id']['toString']())))[_0x4152('0x9d')]();break;case'onlyIfOpen':_0x12e413=squel[_0x4152('0x94')]()[_0x4152('0x95')](_0x4152('0x96'))[_0x4152('0xa5')]([_0x4152('0x97'),'scheduledAt','ContactId','ListId','VoiceQueueId','createdAt',_0x4152('0x57')],squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0x97'),_0x4152('0x97'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0xa6'))['field']('id',_0x4152('0x9b'))['field'](_0x221209[_0x4152('0x9c')]['toString'](),_0x4152('0x98'))['field'](_0xc8dce2[_0x4152('0x4c')]['id'][_0x4152('0x9d')](),_0x4152('0x5d'))[_0x4152('0x9a')]('NOW()','createdAt')[_0x4152('0x9a')]('NOW()',_0x4152('0x57'))[_0x4152('0x7c')](_0x4152('0x9e'))[_0x4152('0x43')](_0x4152('0x9f'))[_0x4152('0x43')]('ListId\x20=\x20?',_0x221209[_0x4152('0x9c')][_0x4152('0x9d')]())[_0x4152('0x43')](_0x4152('0xa7'))[_0x4152('0x43')](_0x4152('0xa1'),squel[_0x4152('0x7a')]()[_0x4152('0x9a')]('COALESCE(phone,\x27\x27)')['from'](_0x4152('0x96'))['where'](_0x4152('0x80'),_0xc8dce2['params']['id'][_0x4152('0x9d')]())))[_0x4152('0x9d')]();break;default:_0x12e413=squel[_0x4152('0x94')]()[_0x4152('0x95')]('cm_hopper')[_0x4152('0xa5')]([_0x4152('0x97'),'scheduledAt',_0x4152('0x9b'),_0x4152('0x98'),_0x4152('0x5d'),'createdAt',_0x4152('0x57')],squel[_0x4152('0x7a')]()['field']('phone',_0x4152('0x97'))['field'](_0x4152('0x99'),_0x4152('0xa6'))[_0x4152('0x9a')]('id',_0x4152('0x9b'))[_0x4152('0x9a')](_0x221209['CmListId']['toString'](),_0x4152('0x98'))['field'](_0xc8dce2[_0x4152('0x4c')]['id'][_0x4152('0x9d')](),_0x4152('0x5d'))['field'](_0x4152('0x99'),_0x4152('0x56'))[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x57'))[_0x4152('0x7c')](_0x4152('0x9e'))[_0x4152('0x43')](_0x4152('0x9f'))['where'](_0x4152('0xa0'),_0x221209[_0x4152('0x9c')][_0x4152('0x9d')]())['where'](_0x4152('0xa7')))[_0x4152('0x9d')]();}_0x4a1739['push'](db[_0x4152('0x83')][_0x4152('0x38')](_0x12e413));}return BPromise[_0x4152('0xa8')](_0x4a1739);}})[_0x4152('0x21')](function(){return _0x4a3d16;})[_0x4152('0x21')](respondWithResult(_0x435e0f,null))['catch'](handleError(_0x435e0f,null));};exports[_0x4152('0xa9')]=function(_0x599b0d,_0x4ba262,_0x58b2a4){return db[_0x4152('0x33')]['find']({'where':{'id':_0x599b0d[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x4ba262,null))[_0x4152('0x21')](function(_0x4df35a){if(_0x4df35a){return _0x4df35a['removeLists'](_0x599b0d['query']['ids']);}})[_0x4152('0x21')](function(_0x3e7d34){if(_0x3e7d34){return db[_0x4152('0x5c')]['destroy']({'where':{'ListId':_0x599b0d[_0x4152('0x38')][_0x4152('0x79')],'VoiceQueueId':_0x599b0d[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](function(){return _0x3e7d34;});}})['then'](respondWithStatusCode(_0x4ba262,null))[_0x4152('0x4a')](handleError(_0x4ba262,null));};exports[_0x4152('0xaa')]=function(_0x41ad04,_0x5e5a00,_0x5e035b){var _0x197afe={};var _0x3b98b9={};var _0x4fab40;var _0x3898af;return db[_0x4152('0x33')][_0x4152('0x5b')]({'where':{'id':_0x41ad04['params']['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x5e5a00,null))[_0x4152('0x21')](function(_0x116d43){if(_0x116d43){_0x4fab40=_0x116d43;_0x3b98b9[_0x4152('0x37')]=_[_0x4152('0x39')](db[_0x4152('0xab')][_0x4152('0x34')]);_0x3b98b9[_0x4152('0x38')]=_[_0x4152('0x39')](_0x41ad04[_0x4152('0x38')]);_0x3b98b9['filters']=_[_0x4152('0x3b')](_0x3b98b9[_0x4152('0x37')],_0x3b98b9['query']);_0x197afe[_0x4152('0x3a')]=_[_0x4152('0x3b')](_0x3b98b9[_0x4152('0x37')],qs[_0x4152('0x3c')](_0x41ad04[_0x4152('0x38')][_0x4152('0x3c')]));_0x197afe[_0x4152('0x3a')]=_0x197afe[_0x4152('0x3a')][_0x4152('0x3d')]?_0x197afe[_0x4152('0x3a')]:_0x3b98b9[_0x4152('0x37')];_0x197afe['order']=qs[_0x4152('0x42')](_0x41ad04['query'][_0x4152('0x42')]);_0x197afe[_0x4152('0x43')]=qs[_0x4152('0x44')](_[_0x4152('0x45')](_0x41ad04[_0x4152('0x38')],_0x3b98b9['filters']));if(_0x41ad04[_0x4152('0x38')]['filter']){_0x197afe['where']=_[_0x4152('0x46')](_0x197afe[_0x4152('0x43')],{'$or':_[_0x4152('0x28')](_0x197afe['attributes'],function(_0x5e6cc9){var _0x4dc5e3={};_0x4dc5e3[_0x5e6cc9]={'$like':'%'+_0x41ad04[_0x4152('0x38')][_0x4152('0x26')]+'%'};return _0x4dc5e3;})});}_0x197afe=_[_0x4152('0x46')]({},_0x197afe,_0x41ad04[_0x4152('0x47')]);return _0x4fab40[_0x4152('0xaa')](_0x197afe);}})[_0x4152('0x21')](function(_0x3510d9){if(_0x3510d9){_0x3898af=_0x3510d9[_0x4152('0x3d')];if(!_0x41ad04[_0x4152('0x38')][_0x4152('0x3e')](_0x4152('0x3f'))){_0x197afe[_0x4152('0x1a')]=qs[_0x4152('0x1a')](_0x41ad04[_0x4152('0x38')][_0x4152('0x1a')]);_0x197afe[_0x4152('0x40')]=qs['offset'](_0x41ad04['query'][_0x4152('0x40')]);}return _0x4fab40[_0x4152('0xaa')](_0x197afe);}})[_0x4152('0x21')](function(_0x3d3c29){if(_0x3d3c29){return _0x3d3c29?{'count':_0x3898af,'rows':_0x3d3c29}:null;}})[_0x4152('0x21')](respondWithResult(_0x5e5a00,null))[_0x4152('0x4a')](handleError(_0x5e5a00,null));};exports[_0x4152('0xac')]=function(_0x75eb61,_0x2a98f4,_0x4bd62b){var _0x57bc18,_0x11b2fa;return db[_0x4152('0x33')]['find']({'where':{'id':_0x75eb61[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](handleEntityNotFound(_0x2a98f4,null))[_0x4152('0x21')](function(_0xc17248){if(_0xc17248){_0x11b2fa=_0xc17248;return _0xc17248['addBlackLists'](_0x75eb61[_0x4152('0x58')]['ids'],_[_0x4152('0x55')](_0x75eb61[_0x4152('0x58')],[_0x4152('0x79'),'id'])||{});}return null;})['spread'](function(_0x429b2d){var _0x185cac;_0x57bc18=_0x429b2d||[];var _0x49aa42=[];if(_0x429b2d){for(var _0x37738e=0x0;_0x37738e<_0x429b2d['length'];_0x37738e+=0x1){var _0x250c96=_0x429b2d[_0x37738e][_0x4152('0x23')]({'plain':!![]});_0x185cac=squel[_0x4152('0x94')]()['into'](_0x4152('0xad'))[_0x4152('0xa5')]([_0x4152('0x97'),_0x4152('0x9b'),_0x4152('0x98'),'VoiceQueueId',_0x4152('0x56'),_0x4152('0x57')],squel[_0x4152('0x7a')]()[_0x4152('0x9a')](_0x4152('0x97'),_0x4152('0x97'))[_0x4152('0x9a')]('id',_0x4152('0x9b'))[_0x4152('0x9a')](_0x250c96['CmListId'][_0x4152('0x9d')](),_0x4152('0x98'))[_0x4152('0x9a')](_0x75eb61['params']['id'][_0x4152('0x9d')](),'VoiceQueueId')[_0x4152('0x9a')](_0x4152('0x99'),_0x4152('0x56'))[_0x4152('0x9a')]('NOW()','updatedAt')[_0x4152('0x7c')]('cm_contacts')[_0x4152('0x43')](_0x4152('0x9f'))['where'](_0x4152('0xa0'),_0x250c96[_0x4152('0x9c')][_0x4152('0x9d')]())[_0x4152('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x4152('0x9d')]();_0x49aa42['push'](db[_0x4152('0x83')][_0x4152('0x38')](_0x185cac));}return BPromise[_0x4152('0xa8')](_0x49aa42);}})[_0x4152('0x21')](function(){return _0x57bc18;})[_0x4152('0x21')](respondWithResult(_0x2a98f4,null))['catch'](handleError(_0x2a98f4,null));};exports[_0x4152('0xae')]=function(_0x192832,_0x329f11,_0x934ffe){return db[_0x4152('0x33')][_0x4152('0x2b')]({'where':{'id':_0x192832[_0x4152('0x4c')]['id']}})['then'](handleEntityNotFound(_0x329f11,null))['then'](function(_0x14d5d0){if(_0x14d5d0){return _0x14d5d0['removeBlackLists'](_0x192832[_0x4152('0x38')][_0x4152('0x79')]);}})[_0x4152('0x21')](function(_0x237e74){if(_0x237e74){return db[_0x4152('0x64')][_0x4152('0x22')]({'where':{'ListId':_0x192832[_0x4152('0x38')][_0x4152('0x79')],'VoiceQueueId':_0x192832[_0x4152('0x4c')]['id']}})[_0x4152('0x21')](function(){return _0x237e74;});}})[_0x4152('0x21')](respondWithStatusCode(_0x329f11,null))['catch'](handleError(_0x329f11,null));}; \ No newline at end of file +var _0xcd7a=['find','name','UserProfileResource','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','rows','catch','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','updatedAt','UserProfileSection','findOne','VoiceQueueId','CmHopper','CmHopperHistory','order','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','voicePause','interface','flatMap','Agents','penalty','TeamVoiceQueue','each','findOrCreate','UserVoiceQueueRt','upsert','SIP/%s','forEach','emit','userVoiceQueue:save','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','transaction','ids','isEmpty','removeAgents','destroy','userVoiceQueue:remove','addAgents','online','format','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','NOW()','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','into','cm_contacts','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type'];(function(_0xdb1b95,_0x3bb07f){var _0x540f72=function(_0x537413){while(--_0x537413){_0xdb1b95['push'](_0xdb1b95['shift']());}};_0x540f72(++_0x3bb07f);}(_0xcd7a,0x141));var _0xacd7=function(_0x340625,_0x32f682){_0x340625=_0x340625-0x0;var _0x263345=_0xcd7a[_0x340625];return _0x263345;};'use strict';var emlformat=require(_0xacd7('0x0'));var rimraf=require(_0xacd7('0x1'));var zipdir=require(_0xacd7('0x2'));var jsonpatch=require(_0xacd7('0x3'));var rp=require('request-promise');var moment=require(_0xacd7('0x4'));var BPromise=require(_0xacd7('0x5'));var Mustache=require(_0xacd7('0x6'));var util=require(_0xacd7('0x7'));var path=require(_0xacd7('0x8'));var sox=require(_0xacd7('0x9'));var csv=require(_0xacd7('0xa'));var ejs=require(_0xacd7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacd7('0xc'));var squel=require(_0xacd7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xacd7('0xe'));var toCsv=require(_0xacd7('0xa'));var querystring=require(_0xacd7('0xf'));var Papa=require('papaparse');var Redis=require(_0xacd7('0x10'));var authService=require(_0xacd7('0x11'));var qs=require(_0xacd7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacd7('0x13'));var logger=require(_0xacd7('0x14'))('api');var utils=require(_0xacd7('0x15'));var config=require(_0xacd7('0x16'));var licenseUtil=require(_0xacd7('0x17'));var db=require(_0xacd7('0x18'))['db'];config[_0xacd7('0x19')]=_[_0xacd7('0x1a')](config['redis'],{'host':_0xacd7('0x1b'),'port':0x18eb});var socket=require(_0xacd7('0x1c'))(new Redis(config[_0xacd7('0x19')]));require('./voiceQueue.socket')[_0xacd7('0x1d')](socket);function respondWithStatusCode(_0xdad752,_0x59a9eb){_0x59a9eb=_0x59a9eb||0xcc;return function(_0x21a29e){if(_0x21a29e){return _0xdad752[_0xacd7('0x1e')](_0x59a9eb);}return _0xdad752['status'](_0x59a9eb)[_0xacd7('0x1f')]();};}function respondWithResult(_0x32842b,_0x2a93ef){_0x2a93ef=_0x2a93ef||0xc8;return function(_0x1f9f0e){if(_0x1f9f0e){return _0x32842b[_0xacd7('0x20')](_0x2a93ef)[_0xacd7('0x21')](_0x1f9f0e);}};}function respondWithFilteredResult(_0x44c1a6,_0x2fd768){return function(_0xeee43c){if(_0xeee43c){var _0x557e5e=typeof _0x2fd768['offset']==='undefined'&&typeof _0x2fd768[_0xacd7('0x22')]===_0xacd7('0x23');var _0x445b9d=_0xeee43c[_0xacd7('0x24')];var _0x118a92=_0x557e5e?0x0:_0x2fd768[_0xacd7('0x25')];var _0x251caa=_0x557e5e?_0xeee43c['count']:_0x2fd768[_0xacd7('0x25')]+_0x2fd768[_0xacd7('0x22')];var _0x4ce04f;if(_0x251caa>=_0x445b9d){_0x251caa=_0x445b9d;_0x4ce04f=0xc8;}else{_0x4ce04f=0xce;}_0x44c1a6[_0xacd7('0x20')](_0x4ce04f);return _0x44c1a6[_0xacd7('0x26')](_0xacd7('0x27'),_0x118a92+'-'+_0x251caa+'/'+_0x445b9d)['json'](_0xeee43c);}return null;};}function patchUpdates(_0x56eb9e){return function(_0x4b8986){try{jsonpatch[_0xacd7('0x28')](_0x4b8986,_0x56eb9e,!![]);}catch(_0x434726){return BPromise['reject'](_0x434726);}return _0x4b8986['save']();};}function saveUpdates(_0xdf0543,_0x2e3a92){return function(_0x10978c){if(_0x10978c){return _0x10978c[_0xacd7('0x29')](_0xdf0543)[_0xacd7('0x2a')](function(_0x18a04e){return _0x18a04e;});}return null;};}function removeEntity(_0x547cb9,_0x17fb04){return function(_0x28c4f5){if(_0x28c4f5){return _0x28c4f5['destroy']()[_0xacd7('0x2a')](function(){var _0x3c596b=_0x28c4f5['get']({'plain':!![]});var _0x4fe2ff=[{'name':'VoiceQueues','value':_0xacd7('0x2b'),'ignore':![]},{'name':_0xacd7('0x2c'),'value':_0xacd7('0x2d'),'ignore':![]}];var _0xe7c4f2=_(_0x4fe2ff)[_0xacd7('0x2e')](_0xacd7('0x2f'))['map'](_0xacd7('0x30'))['value']();if(_[_0xacd7('0x31')](_0xe7c4f2,_0x3c596b[_0xacd7('0x32')])){return;}var _0x12a71d=_[_0xacd7('0x33')](_0x4fe2ff,[_0xacd7('0x30'),_0x3c596b[_0xacd7('0x32')]])[_0xacd7('0x34')];return db[_0xacd7('0x35')]['destroy']({'where':{'type':_0x12a71d,'resourceId':_0x3c596b['id']}})[_0xacd7('0x2a')](function(){return _0x28c4f5;});})[_0xacd7('0x2a')](function(){_0x547cb9[_0xacd7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a452,_0x25663c){return function(_0x187ae4){if(!_0x187ae4){_0x15a452['sendStatus'](0x194);}return _0x187ae4;};}function handleError(_0x58742,_0x4707d9){_0x4707d9=_0x4707d9||0x1f4;return function(_0x2f0f78){logger['error'](_0x2f0f78[_0xacd7('0x36')]);if(_0x2f0f78[_0xacd7('0x34')]){delete _0x2f0f78[_0xacd7('0x34')];}_0x58742[_0xacd7('0x20')](_0x4707d9)[_0xacd7('0x37')](_0x2f0f78);};}exports[_0xacd7('0x38')]=function(_0x4091c4,_0xf91b65){var _0x5a4744={},_0x3e041b={},_0x4e0e26={'count':0x0,'rows':[]};var _0x2ac586=_[_0xacd7('0x39')](db[_0xacd7('0x3a')][_0xacd7('0x3b')],function(_0x43cbf2){return{'name':_0x43cbf2[_0xacd7('0x3c')],'type':_0x43cbf2['type'][_0xacd7('0x3d')]};});_0x3e041b[_0xacd7('0x3e')]=_[_0xacd7('0x39')](_0x2ac586,_0xacd7('0x34'));_0x3e041b[_0xacd7('0x3f')]=_[_0xacd7('0x40')](_0x4091c4['query']);_0x3e041b[_0xacd7('0x41')]=_['intersection'](_0x3e041b[_0xacd7('0x3e')],_0x3e041b[_0xacd7('0x3f')]);_0x5a4744['attributes']=_[_0xacd7('0x42')](_0x3e041b[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x4091c4[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x5a4744[_0xacd7('0x44')]=_0x5a4744[_0xacd7('0x44')][_0xacd7('0x45')]?_0x5a4744[_0xacd7('0x44')]:_0x3e041b[_0xacd7('0x3e')];if(!_0x4091c4[_0xacd7('0x3f')][_0xacd7('0x46')](_0xacd7('0x47'))){_0x5a4744[_0xacd7('0x22')]=qs[_0xacd7('0x22')](_0x4091c4['query'][_0xacd7('0x22')]);_0x5a4744[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x4091c4[_0xacd7('0x3f')][_0xacd7('0x25')]);}_0x5a4744['order']=qs['sort'](_0x4091c4[_0xacd7('0x3f')][_0xacd7('0x48')]);_0x5a4744[_0xacd7('0x49')]=qs['filters'](_[_0xacd7('0x4a')](_0x4091c4['query'],_0x3e041b['filters']),_0x2ac586);if(_0x4091c4['query']['filter']){_0x5a4744['where']=_['merge'](_0x5a4744['where'],{'$or':_[_0xacd7('0x39')](_0x2ac586,function(_0x4b1992){if(_0x4b1992['type']!=='VIRTUAL'){var _0x54e51e={};_0x54e51e[_0x4b1992['name']]={'$like':'%'+_0x4091c4[_0xacd7('0x3f')][_0xacd7('0x2e')]+'%'};return _0x54e51e;}})});}_0x5a4744=_[_0xacd7('0x4b')]({},_0x5a4744,_0x4091c4[_0xacd7('0x4c')]);var _0x3e4280={'where':_0x5a4744[_0xacd7('0x49')]};return db[_0xacd7('0x3a')][_0xacd7('0x24')](_0x3e4280)[_0xacd7('0x2a')](function(_0x531f00){_0x4e0e26['count']=_0x531f00;if(_0x4091c4[_0xacd7('0x3f')][_0xacd7('0x4d')]){_0x5a4744[_0xacd7('0x4e')]=[{'all':!![]}];}return db[_0xacd7('0x3a')]['findAll'](_0x5a4744);})[_0xacd7('0x2a')](function(_0x1001bb){_0x4e0e26[_0xacd7('0x4f')]=_0x1001bb;return _0x4e0e26;})[_0xacd7('0x2a')](respondWithFilteredResult(_0xf91b65,_0x5a4744))[_0xacd7('0x50')](handleError(_0xf91b65,null));};exports[_0xacd7('0x51')]=function(_0x131984,_0x452df6){var _0x5a3488={'raw':![],'where':{'id':_0x131984['params']['id']}},_0x41f162={};_0x41f162['model']=_[_0xacd7('0x40')](db[_0xacd7('0x3a')]['rawAttributes']);_0x41f162[_0xacd7('0x3f')]=_['keys'](_0x131984[_0xacd7('0x3f')]);_0x41f162[_0xacd7('0x41')]=_[_0xacd7('0x42')](_0x41f162[_0xacd7('0x3e')],_0x41f162[_0xacd7('0x3f')]);_0x5a3488[_0xacd7('0x44')]=_['intersection'](_0x41f162[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x131984[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x5a3488['attributes']=_0x5a3488['attributes'][_0xacd7('0x45')]?_0x5a3488[_0xacd7('0x44')]:_0x41f162['model'];if(_0x131984[_0xacd7('0x3f')]['includeAll']){_0x5a3488[_0xacd7('0x4e')]=[{'all':!![]}];}_0x5a3488=_[_0xacd7('0x4b')]({},_0x5a3488,_0x131984['options']);return db[_0xacd7('0x3a')][_0xacd7('0x33')](_0x5a3488)[_0xacd7('0x2a')](handleEntityNotFound(_0x452df6,null))[_0xacd7('0x2a')](respondWithResult(_0x452df6,null))['catch'](handleError(_0x452df6,null));};exports[_0xacd7('0x52')]=function(_0x55fc43,_0x557e5a){return db[_0xacd7('0x3a')][_0xacd7('0x52')](_0x55fc43[_0xacd7('0x53')],{})[_0xacd7('0x2a')](function(_0x175c25){var _0x118ca1=_0x55fc43[_0xacd7('0x54')][_0xacd7('0x55')]({'plain':!![]});if(!_0x118ca1)throw new Error(_0xacd7('0x56'));if(_0x118ca1[_0xacd7('0x57')]==='user'){var _0x5348ea=_0x175c25[_0xacd7('0x55')]({'plain':!![]});var _0x2c79f7=[{'name':_0xacd7('0x58'),'value':'inbound'},{'name':_0xacd7('0x2c'),'value':_0xacd7('0x2d')}];var _0x4730e1=_[_0xacd7('0x33')](_0x2c79f7,[_0xacd7('0x30'),_0x5348ea[_0xacd7('0x32')]])[_0xacd7('0x34')];return db['UserProfileSection'][_0xacd7('0x33')]({'where':{'name':_0x4730e1,'userProfileId':_0x118ca1[_0xacd7('0x59')]},'raw':!![]})[_0xacd7('0x2a')](function(_0x18f2b9){if(_0x18f2b9&&_0x18f2b9[_0xacd7('0x5a')]===0x0){return db[_0xacd7('0x35')][_0xacd7('0x52')]({'name':_0x5348ea[_0xacd7('0x34')],'resourceId':_0x5348ea['id'],'type':_0x18f2b9[_0xacd7('0x34')],'sectionId':_0x18f2b9['id']},{})[_0xacd7('0x2a')](function(){return _0x175c25;});}else{return _0x175c25;}})[_0xacd7('0x50')](function(_0x2471cb){logger[_0xacd7('0x5b')](_0xacd7('0x5c'),_0x2471cb);throw _0x2471cb;});}return _0x175c25;})[_0xacd7('0x2a')](respondWithResult(_0x557e5a,0xc9))[_0xacd7('0x50')](handleError(_0x557e5a,null));};exports['clone']=function(_0x21ecb1,_0x57a6f4){var _0x4e6252={'where':{'id':_0x21ecb1[_0xacd7('0x5d')]['id']}},_0x41f620={};_0x41f620['model']=_[_0xacd7('0x40')](db[_0xacd7('0x3a')][_0xacd7('0x3b')]);_0x4e6252[_0xacd7('0x44')]=_[_0xacd7('0x42')](_0x41f620[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x21ecb1['query'][_0xacd7('0x43')]));_0x4e6252['attributes']=_0x4e6252[_0xacd7('0x44')][_0xacd7('0x45')]?_0x4e6252[_0xacd7('0x44')]:_0x41f620[_0xacd7('0x3e')];if(_0x21ecb1[_0xacd7('0x3f')][_0xacd7('0x4d')]){_0x4e6252[_0xacd7('0x4e')]=[{'all':!![]}];}_0x4e6252=_[_0xacd7('0x4b')]({},_0x4e6252,_0x21ecb1[_0xacd7('0x4c')]);return db[_0xacd7('0x3a')][_0xacd7('0x33')](_0x4e6252)[_0xacd7('0x2a')](handleEntityNotFound(_0x57a6f4,null))[_0xacd7('0x2a')](function(_0x585aa4){if(_0x585aa4){var _0x673db3=_0x585aa4[_0xacd7('0x55')]({'plain':!![]});_0x673db3=qs[_0xacd7('0x5e')](_0x673db3,['id','createdAt',_0xacd7('0x5f')]);_0x21ecb1[_0xacd7('0x53')]=_[_0xacd7('0x5e')](_0x21ecb1['body'],['id','createdAt',_0xacd7('0x5f')]);return db[_0xacd7('0x3a')][_0xacd7('0x52')](_[_0xacd7('0x4b')](_0x673db3,_0x21ecb1[_0xacd7('0x53')]),{'include':_0x21ecb1[_0xacd7('0x3f')]['includeAll']?[{'all':!![]}]:undefined})[_0xacd7('0x2a')](function(_0x486206){var _0x1f484d=_0x21ecb1[_0xacd7('0x54')]['get']({'plain':!![]});if(!_0x1f484d)throw new Error(_0xacd7('0x56'));if(_0x1f484d[_0xacd7('0x57')]==='user'){var _0x3cde3b=_0x486206[_0xacd7('0x55')]({'plain':!![]});var _0x5adcaa=[{'name':_0xacd7('0x58'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xacd7('0x2d')}];var _0x269325=_[_0xacd7('0x33')](_0x5adcaa,['value',_0x3cde3b[_0xacd7('0x32')]])[_0xacd7('0x34')];return db[_0xacd7('0x60')][_0xacd7('0x33')]({'where':{'name':_0x269325,'userProfileId':_0x1f484d['userProfileId']},'raw':!![]})[_0xacd7('0x2a')](function(_0x880eac){if(_0x880eac&&_0x880eac[_0xacd7('0x5a')]===0x0){return db[_0xacd7('0x35')][_0xacd7('0x52')]({'name':_0x3cde3b['name'],'resourceId':_0x3cde3b['id'],'type':_0x880eac['name'],'sectionId':_0x880eac['id']},{})[_0xacd7('0x2a')](function(){return _0x486206;});}else{return _0x486206;}})[_0xacd7('0x50')](function(_0x2b5ea5){logger[_0xacd7('0x5b')](_0xacd7('0x5c'),_0x2b5ea5);throw _0x2b5ea5;});}return _0x486206;});}})[_0xacd7('0x2a')](respondWithResult(_0x57a6f4,0xc9))[_0xacd7('0x50')](handleError(_0x57a6f4,null));};exports['update']=function(_0xe660e6,_0x270aac){if(_0xe660e6[_0xacd7('0x53')]['id']){delete _0xe660e6[_0xacd7('0x53')]['id'];}return db[_0xacd7('0x3a')]['find']({'where':{'id':_0xe660e6[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x270aac,null))[_0xacd7('0x2a')](saveUpdates(_0xe660e6[_0xacd7('0x53')],null))[_0xacd7('0x2a')](respondWithResult(_0x270aac,null))[_0xacd7('0x50')](handleError(_0x270aac,null));};exports['destroy']=function(_0x29390a,_0x5b0bbb){return db[_0xacd7('0x3a')][_0xacd7('0x33')]({'where':{'id':_0x29390a[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x5b0bbb,null))['then'](removeEntity(_0x5b0bbb,null))['catch'](handleError(_0x5b0bbb,null));};exports['getHoppers']=function(_0x4b406e,_0x145c19,_0x3107d4){var _0x5d0664={'raw':![],'where':{}};var _0x3b114b={};var _0xe93de5={'count':0x0,'rows':[]};return db[_0xacd7('0x3a')][_0xacd7('0x61')]({'where':{'id':_0x4b406e[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x145c19,null))[_0xacd7('0x2a')](function(_0x1e0947){if(_0x1e0947){_0x3b114b[_0xacd7('0x3e')]=_[_0xacd7('0x40')](db['CmHopper'][_0xacd7('0x3b')]);_0x3b114b[_0xacd7('0x3f')]=_['keys'](_0x4b406e[_0xacd7('0x3f')]);_0x3b114b['filters']=_[_0xacd7('0x42')](_0x3b114b['model'],_0x3b114b[_0xacd7('0x3f')]);_0x5d0664[_0xacd7('0x44')]=_[_0xacd7('0x42')](_0x3b114b[_0xacd7('0x3e')],qs['fields'](_0x4b406e['query'][_0xacd7('0x43')]));_0x5d0664[_0xacd7('0x44')]=_0x5d0664['attributes'][_0xacd7('0x45')]?_0x5d0664['attributes']:_0x3b114b[_0xacd7('0x3e')];if(!_0x4b406e[_0xacd7('0x3f')][_0xacd7('0x46')]('nolimit')){_0x5d0664['limit']=qs[_0xacd7('0x22')](_0x4b406e['query']['limit']);_0x5d0664['offset']=qs[_0xacd7('0x25')](_0x4b406e['query'][_0xacd7('0x25')]);}_0x5d0664['order']=qs[_0xacd7('0x48')](_0x4b406e[_0xacd7('0x3f')][_0xacd7('0x48')]);_0x5d0664[_0xacd7('0x49')]=qs['filters'](_[_0xacd7('0x4a')](_0x4b406e[_0xacd7('0x3f')],_0x3b114b[_0xacd7('0x41')]));_0x5d0664['where'][_0xacd7('0x62')]=_0x1e0947['id'];if(_0x4b406e['query']['filter']){_0x5d0664[_0xacd7('0x49')]=_['merge'](_0x5d0664['where'],{'$or':_['map'](_0x5d0664[_0xacd7('0x44')],function(_0x3ae7f7){var _0x115e4f={};_0x115e4f[_0x3ae7f7]={'$like':'%'+_0x4b406e[_0xacd7('0x3f')]['filter']+'%'};return _0x115e4f;})});}_0x5d0664=_[_0xacd7('0x4b')]({},_0x5d0664,_0x4b406e['options']);return db[_0xacd7('0x63')]['count']({'where':_0x5d0664['where']})[_0xacd7('0x2a')](function(_0x5d2065){_0xe93de5[_0xacd7('0x24')]=_0x5d2065;if(_0x4b406e['query'][_0xacd7('0x4d')]){_0x5d0664['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x5d0664);})[_0xacd7('0x2a')](function(_0x25e861){_0xe93de5[_0xacd7('0x4f')]=_0x25e861;return _0xe93de5;});}})[_0xacd7('0x2a')](respondWithFilteredResult(_0x145c19,_0x5d0664))['catch'](handleError(_0x145c19,null));};exports['getHopperHistories']=function(_0x5408e1,_0x527af7,_0x5e4409){var _0x147a53={'raw':!![],'where':{}};var _0x43cb93={};var _0xea44ee={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xacd7('0x61')]({'where':{'id':_0x5408e1[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x527af7,null))[_0xacd7('0x2a')](function(_0x208377){if(_0x208377){_0x43cb93[_0xacd7('0x3e')]=_[_0xacd7('0x40')](db[_0xacd7('0x64')][_0xacd7('0x3b')]);_0x43cb93[_0xacd7('0x3f')]=_['keys'](_0x5408e1[_0xacd7('0x3f')]);_0x43cb93[_0xacd7('0x41')]=_[_0xacd7('0x42')](_0x43cb93[_0xacd7('0x3e')],_0x43cb93[_0xacd7('0x3f')]);_0x147a53['attributes']=_[_0xacd7('0x42')](_0x43cb93[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x5408e1[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x147a53[_0xacd7('0x44')]=_0x147a53[_0xacd7('0x44')]['length']?_0x147a53[_0xacd7('0x44')]:_0x43cb93[_0xacd7('0x3e')];if(!_0x5408e1[_0xacd7('0x3f')][_0xacd7('0x46')](_0xacd7('0x47'))){_0x147a53['limit']=qs[_0xacd7('0x22')](_0x5408e1[_0xacd7('0x3f')]['limit']);_0x147a53[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x5408e1[_0xacd7('0x3f')]['offset']);}_0x147a53[_0xacd7('0x65')]=qs[_0xacd7('0x48')](_0x5408e1[_0xacd7('0x3f')][_0xacd7('0x48')]);_0x147a53['where']=qs[_0xacd7('0x41')](_[_0xacd7('0x4a')](_0x5408e1[_0xacd7('0x3f')],_0x43cb93[_0xacd7('0x41')]));_0x147a53[_0xacd7('0x49')][_0xacd7('0x62')]=_0x208377['id'];if(_0x5408e1[_0xacd7('0x3f')]['filter']){_0x147a53[_0xacd7('0x49')]=_[_0xacd7('0x4b')](_0x147a53[_0xacd7('0x49')],{'$or':_['map'](_0x147a53[_0xacd7('0x44')],function(_0xb6f27a){var _0x267903={};_0x267903[_0xb6f27a]={'$like':'%'+_0x5408e1[_0xacd7('0x3f')][_0xacd7('0x2e')]+'%'};return _0x267903;})});}_0x147a53=_[_0xacd7('0x4b')]({},_0x147a53,_0x5408e1[_0xacd7('0x4c')]);return db['CmHopperHistory'][_0xacd7('0x24')]({'where':_0x147a53[_0xacd7('0x49')]})[_0xacd7('0x2a')](function(_0x25b94c){_0xea44ee[_0xacd7('0x24')]=_0x25b94c;if(_0x5408e1[_0xacd7('0x3f')][_0xacd7('0x4d')]){_0x147a53[_0xacd7('0x4e')]=[{'all':!![]}];}return db[_0xacd7('0x64')]['findAll'](_0x147a53);})[_0xacd7('0x2a')](function(_0x16e229){_0xea44ee['rows']=_0x16e229;return _0xea44ee;});}})[_0xacd7('0x2a')](respondWithFilteredResult(_0x527af7,_0x147a53))[_0xacd7('0x50')](handleError(_0x527af7,null));};exports[_0xacd7('0x66')]=function(_0x538eac,_0x2b0a56,_0x1c9984){var _0x4df578={'raw':!![],'where':{}};var _0x8f2d9={};var _0x1c7abb={'count':0x0,'rows':[]};return db[_0xacd7('0x3a')][_0xacd7('0x61')]({'where':{'id':_0x538eac[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x2b0a56,null))[_0xacd7('0x2a')](function(_0x7729b3){if(_0x7729b3){_0x8f2d9[_0xacd7('0x3e')]=_['keys'](db[_0xacd7('0x67')][_0xacd7('0x3b')]);_0x8f2d9['query']=_[_0xacd7('0x40')](_0x538eac[_0xacd7('0x3f')]);_0x8f2d9['filters']=_[_0xacd7('0x42')](_0x8f2d9[_0xacd7('0x3e')],_0x8f2d9['query']);_0x4df578['attributes']=_[_0xacd7('0x42')](_0x8f2d9[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x538eac[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x4df578[_0xacd7('0x44')]=_0x4df578['attributes']['length']?_0x4df578['attributes']:_0x8f2d9['model'];if(!_0x538eac[_0xacd7('0x3f')][_0xacd7('0x46')](_0xacd7('0x47'))){_0x4df578[_0xacd7('0x22')]=qs[_0xacd7('0x22')](_0x538eac[_0xacd7('0x3f')][_0xacd7('0x22')]);_0x4df578[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x538eac[_0xacd7('0x3f')][_0xacd7('0x25')]);}_0x4df578[_0xacd7('0x65')]=qs['sort'](_0x538eac[_0xacd7('0x3f')][_0xacd7('0x48')]);_0x4df578[_0xacd7('0x49')]=qs[_0xacd7('0x41')](_['pick'](_0x538eac[_0xacd7('0x3f')],_0x8f2d9[_0xacd7('0x41')]));_0x4df578[_0xacd7('0x49')][_0xacd7('0x62')]=_0x7729b3['id'];if(_0x538eac[_0xacd7('0x3f')][_0xacd7('0x2e')]){_0x4df578['where']=_[_0xacd7('0x4b')](_0x4df578['where'],{'$or':_[_0xacd7('0x39')](_0x4df578['attributes'],function(_0x4f7685){var _0x42ff75={};_0x42ff75[_0x4f7685]={'$like':'%'+_0x538eac[_0xacd7('0x3f')][_0xacd7('0x2e')]+'%'};return _0x42ff75;})});}_0x4df578=_[_0xacd7('0x4b')]({},_0x4df578,_0x538eac[_0xacd7('0x4c')]);return db[_0xacd7('0x67')][_0xacd7('0x24')]({'where':_0x4df578['where']})[_0xacd7('0x2a')](function(_0x264164){_0x1c7abb[_0xacd7('0x24')]=_0x264164;if(_0x538eac[_0xacd7('0x3f')][_0xacd7('0x4d')]){_0x4df578[_0xacd7('0x4e')]=[{'all':!![]}];}return db[_0xacd7('0x67')][_0xacd7('0x68')](_0x4df578);})[_0xacd7('0x2a')](function(_0x2f0816){_0x1c7abb['rows']=_0x2f0816;return _0x1c7abb;});}})[_0xacd7('0x2a')](respondWithFilteredResult(_0x2b0a56,_0x4df578))['catch'](handleError(_0x2b0a56,null));};exports[_0xacd7('0x69')]=function(_0x30685d,_0x3f80a0,_0x5fd4b8){var _0x6e1204={'raw':!![],'where':{}};var _0xa25657={};var _0xf57de0={'count':0x0,'rows':[]};return db[_0xacd7('0x3a')][_0xacd7('0x61')]({'where':{'id':_0x30685d[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x3f80a0,null))[_0xacd7('0x2a')](function(_0x524308){if(_0x524308){_0xa25657['model']=_[_0xacd7('0x40')](db[_0xacd7('0x6a')][_0xacd7('0x3b')]);_0xa25657['query']=_[_0xacd7('0x40')](_0x30685d[_0xacd7('0x3f')]);_0xa25657['filters']=_[_0xacd7('0x42')](_0xa25657[_0xacd7('0x3e')],_0xa25657[_0xacd7('0x3f')]);_0x6e1204[_0xacd7('0x44')]=_[_0xacd7('0x42')](_0xa25657[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x30685d[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x6e1204[_0xacd7('0x44')]=_0x6e1204[_0xacd7('0x44')]['length']?_0x6e1204[_0xacd7('0x44')]:_0xa25657[_0xacd7('0x3e')];if(!_0x30685d[_0xacd7('0x3f')][_0xacd7('0x46')](_0xacd7('0x47'))){_0x6e1204[_0xacd7('0x22')]=qs[_0xacd7('0x22')](_0x30685d[_0xacd7('0x3f')][_0xacd7('0x22')]);_0x6e1204[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x30685d[_0xacd7('0x3f')][_0xacd7('0x25')]);}_0x6e1204['order']=qs[_0xacd7('0x48')](_0x30685d[_0xacd7('0x3f')]['sort']);_0x6e1204[_0xacd7('0x49')]=qs[_0xacd7('0x41')](_['pick'](_0x30685d['query'],_0xa25657[_0xacd7('0x41')]));_0x6e1204[_0xacd7('0x49')][_0xacd7('0x62')]=_0x524308['id'];if(_0x30685d['query'][_0xacd7('0x2e')]){_0x6e1204[_0xacd7('0x49')]=_[_0xacd7('0x4b')](_0x6e1204[_0xacd7('0x49')],{'$or':_['map'](_0x6e1204[_0xacd7('0x44')],function(_0x4d11e6){var _0x4c1b69={};_0x4c1b69[_0x4d11e6]={'$like':'%'+_0x30685d[_0xacd7('0x3f')][_0xacd7('0x2e')]+'%'};return _0x4c1b69;})});}_0x6e1204=_[_0xacd7('0x4b')]({},_0x6e1204,_0x30685d[_0xacd7('0x4c')]);return db[_0xacd7('0x6a')][_0xacd7('0x24')]({'where':_0x6e1204['where']})[_0xacd7('0x2a')](function(_0x5a2948){_0xf57de0['count']=_0x5a2948;if(_0x30685d[_0xacd7('0x3f')]['includeAll']){_0x6e1204[_0xacd7('0x4e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xacd7('0x68')](_0x6e1204);})[_0xacd7('0x2a')](function(_0x3092cc){_0xf57de0['rows']=_0x3092cc;return _0xf57de0;});}})['then'](respondWithFilteredResult(_0x3f80a0,_0x6e1204))[_0xacd7('0x50')](handleError(_0x3f80a0,null));};exports[_0xacd7('0x6b')]=function(_0x25408f,_0x45cee0,_0x1c4c55){var _0x335ff0={};var _0x57071d={};var _0x5bb255;var _0x47754f;return db['VoiceQueue'][_0xacd7('0x61')]({'where':{'id':_0x25408f[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x45cee0,null))[_0xacd7('0x2a')](function(_0x4ac0ec){if(_0x4ac0ec){_0x5bb255=_0x4ac0ec;_0x57071d[_0xacd7('0x3e')]=_['keys'](db[_0xacd7('0x6c')][_0xacd7('0x3b')]);_0x57071d[_0xacd7('0x3f')]=_['keys'](_0x25408f['query']);_0x57071d[_0xacd7('0x41')]=_[_0xacd7('0x42')](_0x57071d[_0xacd7('0x3e')],_0x57071d[_0xacd7('0x3f')]);_0x335ff0[_0xacd7('0x44')]=_['intersection'](_0x57071d[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x25408f[_0xacd7('0x3f')]['fields']));_0x335ff0[_0xacd7('0x44')]=_0x335ff0[_0xacd7('0x44')][_0xacd7('0x45')]?_0x335ff0[_0xacd7('0x44')]:_0x57071d[_0xacd7('0x3e')];_0x335ff0[_0xacd7('0x65')]=qs[_0xacd7('0x48')](_0x25408f['query'][_0xacd7('0x48')]);_0x335ff0['where']=qs[_0xacd7('0x41')](_[_0xacd7('0x4a')](_0x25408f[_0xacd7('0x3f')],_0x57071d['filters']));if(_0x25408f['query'][_0xacd7('0x2e')]){_0x335ff0['where']=_[_0xacd7('0x4b')](_0x335ff0[_0xacd7('0x49')],{'$or':_[_0xacd7('0x39')](_0x335ff0[_0xacd7('0x44')],function(_0x5f2b13){var _0x597d1b={};_0x597d1b[_0x5f2b13]={'$like':'%'+_0x25408f[_0xacd7('0x3f')][_0xacd7('0x2e')]+'%'};return _0x597d1b;})});}_0x335ff0=_['merge']({},_0x335ff0,_0x25408f[_0xacd7('0x4c')]);return _0x5bb255['getTeams'](_0x335ff0);}})[_0xacd7('0x2a')](function(_0xd2cdbe){if(_0xd2cdbe){_0x47754f=_0xd2cdbe[_0xacd7('0x45')];if(!_0x25408f[_0xacd7('0x3f')][_0xacd7('0x46')](_0xacd7('0x47'))){_0x335ff0[_0xacd7('0x22')]=qs['limit'](_0x25408f[_0xacd7('0x3f')][_0xacd7('0x22')]);_0x335ff0[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x25408f[_0xacd7('0x3f')][_0xacd7('0x25')]);}return _0x5bb255['getTeams'](_0x335ff0);}})[_0xacd7('0x2a')](function(_0x371894){if(_0x371894){return _0x371894?{'count':_0x47754f,'rows':_0x371894}:null;}})[_0xacd7('0x2a')](respondWithResult(_0x45cee0,null))['catch'](handleError(_0x45cee0,null));};exports[_0xacd7('0x6d')]=function(_0x4d4543,_0x26bcf2,_0x2368c2){var _0x1415e7=_0x4d4543['body']['teams'];var _0x4ca5dd=_['map'](_0x1415e7,'id');return db[_0xacd7('0x6c')][_0xacd7('0x68')]({'where':{'id':_0x4ca5dd},'attributes':['id'],'include':[{'model':db[_0xacd7('0x6e')],'as':'Agents','attributes':['id',_0xacd7('0x34'),'online',_0xacd7('0x6f'),_0xacd7('0x70')],'raw':!![]}]})[_0xacd7('0x2a')](function(_0x71d70a){if(_0x71d70a){var _0x1b0fe0=_[_0xacd7('0x71')](_0x71d70a,function(_0x1b73c4){var _0x1be9a=_0x1b73c4[_0xacd7('0x55')]({'plain':!![]});_0x1be9a[_0xacd7('0x72')]['forEach'](function(_0x291121){_0x291121['penalty']=_[_0xacd7('0x33')](_0x1415e7,{'id':_0x1be9a['id']})[_0xacd7('0x73')];});return _0x1be9a[_0xacd7('0x72')];});return db['VoiceQueue'][_0xacd7('0x33')]({'where':{'id':_0x4d4543[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](function(_0x378768){return db['sequelize']['transaction'](function(_0x4e5879){return _0x378768[_0xacd7('0x6d')](_0x4ca5dd,{'transaction':_0x4e5879})[_0xacd7('0x2a')](function(){return BPromise['each'](_0x1415e7,function(_0x1f925a){return db[_0xacd7('0x74')]['upsert']({'TeamId':_0x1f925a['id'],'VoiceQueueId':_0x4d4543[_0xacd7('0x5d')]['id'],'penalty':_0x1f925a['penalty']},{'transaction':_0x4e5879});});})[_0xacd7('0x2a')](function(){return BPromise[_0xacd7('0x75')](_0x1b0fe0,function(_0x5bcbbe){return db['UserVoiceQueue'][_0xacd7('0x76')]({'where':{'UserId':_0x5bcbbe['id'],'VoiceQueueId':_0x4d4543[_0xacd7('0x5d')]['id']},'defaults':{'penalty':_0x5bcbbe[_0xacd7('0x73')]},'transaction':_0x4e5879});});})[_0xacd7('0x2a')](function(){return BPromise['each'](_['filter'](_0x1b0fe0,{'online':!![]}),function(_0x9def14){return db[_0xacd7('0x77')][_0xacd7('0x78')]({'membername':_0x9def14['name'],'UserId':_0x9def14['id'],'queue_name':_0x378768[_0xacd7('0x34')],'VoiceQueueId':_0x378768['id'],'interface':_['isNil'](_0x9def14[_0xacd7('0x70')])?util['format'](_0xacd7('0x79'),_0x9def14['name']):_0x9def14[_0xacd7('0x70')],'paused':_0x9def14[_0xacd7('0x6f')]||![],'penalty':_0x9def14[_0xacd7('0x73')]},{'transaction':_0x4e5879});});})['then'](function(){_0x1b0fe0[_0xacd7('0x7a')](function(_0x43bf47){socket[_0xacd7('0x7b')](_0xacd7('0x7c'),{'UserId':_0x43bf47['id'],'VoiceQueueId':_0x378768['id']});});});});});}})[_0xacd7('0x2a')](respondWithStatusCode(_0x26bcf2,null))[_0xacd7('0x50')](handleError(_0x26bcf2,null));};exports['removeTeams']=function(_0x449eed,_0x1571fb,_0x5063f6){return db[_0xacd7('0x6c')][_0xacd7('0x68')]({'where':{'id':_0x449eed[_0xacd7('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xacd7('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xacd7('0x2a')](handleEntityNotFound(_0x1571fb,null))[_0xacd7('0x2a')](function(_0x164248){var _0x174621=_[_0xacd7('0x39')](_0x164248,'id');var _0x556c1d=[];var _0x1fb321=[];var _0x6d3439=squel['select']();_0x6d3439[_0xacd7('0x7d')](_0xacd7('0x7e'))[_0xacd7('0x7f')](_0xacd7('0x80'),'tq')[_0xacd7('0x81')](_0xacd7('0x82'),'ut',_0xacd7('0x83'))[_0xacd7('0x49')](_0xacd7('0x84'),_0x449eed[_0xacd7('0x5d')]['id']);for(var _0x70e2a9=0x0;_0x70e2a9<_0x164248['length'];_0x70e2a9+=0x1){let _0x444652=_0x164248[_0x70e2a9];for(var _0x3ae3cf=0x0;_0x3ae3cf<_0x444652[_0xacd7('0x72')][_0xacd7('0x45')];_0x3ae3cf+=0x1){let _0x4baba2=_0x444652[_0xacd7('0x72')][_0x3ae3cf];var _0xd66664=_0x6d3439[_0xacd7('0x85')]();_0xd66664[_0xacd7('0x49')](_0xacd7('0x86'),_0x4baba2['id']);_0x1fb321[_0xacd7('0x87')](db['sequelize'][_0xacd7('0x3f')](_0xd66664[_0xacd7('0x88')](),{'type':db['sequelize'][_0xacd7('0x89')][_0xacd7('0x8a')]})[_0xacd7('0x2a')](function(_0x28d333){if(_0x28d333['length']===0x1){return _0x4baba2['id'];}else{var _0x547e30=_[_0xacd7('0x8b')](_['map'](_0x28d333,_0xacd7('0x8c')),function(_0x1e942d){return _[_0xacd7('0x31')](_0x174621,_0x1e942d);});if(_0x547e30){return _0x4baba2['id'];}}}));}}return BPromise['all'](_0x1fb321)['then'](function(_0x19777f){_0x556c1d=_(_0x556c1d)[_0xacd7('0x8d')](_0x19777f)['compact']()[_0xacd7('0x30')]();return db['VoiceQueue'][_0xacd7('0x33')]({'where':{'id':_0x449eed[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](function(_0x5b4b84){return db['sequelize'][_0xacd7('0x8e')](function(_0x336051){return _0x5b4b84['removeTeams'](_0x449eed[_0xacd7('0x3f')][_0xacd7('0x8f')],{'transaction':_0x336051})[_0xacd7('0x2a')](function(){if(!_[_0xacd7('0x90')](_0x556c1d)){return _0x5b4b84[_0xacd7('0x91')](_0x556c1d,{'transaction':_0x336051})['then'](function(){return db[_0xacd7('0x77')][_0xacd7('0x92')]({'where':{'VoiceQueueId':_0x449eed[_0xacd7('0x5d')]['id'],'UserId':_0x556c1d},'transaction':_0x336051});});}})[_0xacd7('0x2a')](function(){_0x556c1d[_0xacd7('0x7a')](function(_0x40b4c5){socket[_0xacd7('0x7b')](_0xacd7('0x93'),{'UserId':_0x40b4c5,'VoiceQueueId':_0x5b4b84['id']});});});});});});})[_0xacd7('0x2a')](respondWithStatusCode(_0x1571fb,null))[_0xacd7('0x50')](handleError(_0x1571fb,null));};exports['addAgents']=function(_0x662d06,_0x1b706e,_0x2d002f){var _0x46f5fa,_0x21f977;return db['VoiceQueue']['find']({'where':{'id':_0x662d06[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x1b706e,null))[_0xacd7('0x2a')](function(_0x25eb39){if(_0x25eb39){_0x21f977=_0x25eb39;return _0x25eb39[_0xacd7('0x94')](_0x662d06[_0xacd7('0x53')]['ids'],_[_0xacd7('0x5e')](_0x662d06[_0xacd7('0x53')],[_0xacd7('0x8f'),'id'])||{})['spread'](function(_0x405769){for(var _0xb9a4b7=0x0;_0xb9a4b7<_0x662d06[_0xacd7('0x53')][_0xacd7('0x8f')][_0xacd7('0x45')];_0xb9a4b7+=0x1){socket[_0xacd7('0x7b')](_0xacd7('0x7c'),{'UserId':Number(_0x662d06[_0xacd7('0x53')][_0xacd7('0x8f')][_0xb9a4b7]),'VoiceQueueId':Number(_0x662d06[_0xacd7('0x5d')]['id'])});}return _0x405769;});}})[_0xacd7('0x2a')](function(_0x4f3c55){_0x46f5fa=_0x4f3c55||[];if(_0x21f977){return db['User'][_0xacd7('0x68')]({'where':{'id':_0x662d06[_0xacd7('0x53')][_0xacd7('0x8f')]},'attributes':['id',_0xacd7('0x34'),_0xacd7('0x95'),'voicePause',_0xacd7('0x70')],'raw':!![]});}})[_0xacd7('0x2a')](function(_0x5e2eb2){if(!_[_0xacd7('0x90')](_0x5e2eb2)){var _0x14b1f9=[];for(var _0x102bd5=0x0;_0x102bd5<_0x5e2eb2['length'];_0x102bd5++){if(_0x5e2eb2[_0x102bd5][_0xacd7('0x95')]){_0x14b1f9['push'](db['UserVoiceQueueRt'][_0xacd7('0x78')]({'membername':_0x5e2eb2[_0x102bd5][_0xacd7('0x34')],'UserId':_0x5e2eb2[_0x102bd5]['id'],'queue_name':_0x21f977['name'],'VoiceQueueId':_0x21f977['id'],'interface':_['isNil'](_0x5e2eb2[_0x102bd5][_0xacd7('0x70')])?util[_0xacd7('0x96')]('SIP/%s',_0x5e2eb2[_0x102bd5][_0xacd7('0x34')]):_0x5e2eb2[_0x102bd5][_0xacd7('0x70')],'paused':_0x5e2eb2[_0x102bd5][_0xacd7('0x6f')]||![],'penalty':_0x662d06[_0xacd7('0x53')][_0xacd7('0x73')]||0x0}));}}return BPromise['all'](_0x14b1f9);}})[_0xacd7('0x2a')](function(){return _0x46f5fa;})[_0xacd7('0x2a')](respondWithResult(_0x1b706e,null))[_0xacd7('0x50')](handleError(_0x1b706e,null));};exports['removeAgents']=function(_0x5ee87e,_0x2d84ee,_0x336251){return db[_0xacd7('0x3a')]['find']({'where':{'id':_0x5ee87e[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x2d84ee,null))[_0xacd7('0x2a')](function(_0x3780ea){if(_0x3780ea){return _0x3780ea[_0xacd7('0x91')](_0x5ee87e[_0xacd7('0x3f')][_0xacd7('0x8f')])[_0xacd7('0x2a')](function(){if(_[_0xacd7('0x97')](_0x5ee87e[_0xacd7('0x3f')]['ids'])){for(var _0x401329=0x0;_0x401329<_0x5ee87e[_0xacd7('0x3f')][_0xacd7('0x8f')]['length'];_0x401329+=0x1){socket['emit'](_0xacd7('0x93'),{'UserId':Number(_0x5ee87e[_0xacd7('0x3f')][_0xacd7('0x8f')][_0x401329]),'VoiceQueueId':Number(_0x5ee87e[_0xacd7('0x5d')]['id'])});}}else{socket[_0xacd7('0x7b')](_0xacd7('0x93'),{'UserId':Number(_0x5ee87e[_0xacd7('0x3f')][_0xacd7('0x8f')]),'VoiceQueueId':Number(_0x5ee87e[_0xacd7('0x5d')]['id'])});}});}})[_0xacd7('0x2a')](function(_0x5339e8){return db[_0xacd7('0x77')]['destroy']({'where':{'VoiceQueueId':_0x5ee87e[_0xacd7('0x5d')]['id'],'UserId':_0x5ee87e[_0xacd7('0x3f')][_0xacd7('0x8f')]}})[_0xacd7('0x2a')](function(){return _0x5339e8;});})[_0xacd7('0x2a')](respondWithStatusCode(_0x2d84ee,null))[_0xacd7('0x50')](handleError(_0x2d84ee,null));};exports[_0xacd7('0x98')]=function(_0x5ae24c,_0x1ac6a1,_0x32826f){var _0x14c07e={};var _0x41e7d2={};var _0x549f29;var _0x5097de;return db['VoiceQueue'][_0xacd7('0x61')]({'where':{'id':_0x5ae24c[_0xacd7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1ac6a1,null))['then'](function(_0x2f9b2b){if(_0x2f9b2b){_0x549f29=_0x2f9b2b;_0x41e7d2[_0xacd7('0x3e')]=_[_0xacd7('0x40')](db[_0xacd7('0x6e')][_0xacd7('0x3b')]);_0x41e7d2[_0xacd7('0x3f')]=_[_0xacd7('0x40')](_0x5ae24c['query']);_0x41e7d2[_0xacd7('0x41')]=_['intersection'](_0x41e7d2[_0xacd7('0x3e')],_0x41e7d2['query']);_0x14c07e['attributes']=_[_0xacd7('0x42')](_0x41e7d2[_0xacd7('0x3e')],qs['fields'](_0x5ae24c[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x14c07e[_0xacd7('0x44')]=_0x14c07e[_0xacd7('0x44')]['length']?_0x14c07e[_0xacd7('0x44')]:_0x41e7d2[_0xacd7('0x3e')];_0x14c07e[_0xacd7('0x65')]=qs['sort'](_0x5ae24c['query'][_0xacd7('0x48')]);_0x14c07e['where']=qs['filters'](_[_0xacd7('0x4a')](_0x5ae24c['query'],_0x41e7d2['filters']));if(_0x5ae24c['query']['filter']){_0x14c07e[_0xacd7('0x49')]=_[_0xacd7('0x4b')](_0x14c07e['where'],{'$or':_[_0xacd7('0x39')](_0x14c07e[_0xacd7('0x44')],function(_0x378c1f){var _0x44a3f8={};_0x44a3f8[_0x378c1f]={'$like':'%'+_0x5ae24c[_0xacd7('0x3f')]['filter']+'%'};return _0x44a3f8;})});}_0x14c07e=_[_0xacd7('0x4b')]({},_0x14c07e,_0x5ae24c[_0xacd7('0x4c')]);return _0x549f29[_0xacd7('0x98')](_0x14c07e);}})['then'](function(_0x4f371e){if(_0x4f371e){_0x5097de=_0x4f371e[_0xacd7('0x45')];if(!_0x5ae24c[_0xacd7('0x3f')][_0xacd7('0x46')](_0xacd7('0x47'))){_0x14c07e[_0xacd7('0x22')]=qs['limit'](_0x5ae24c[_0xacd7('0x3f')][_0xacd7('0x22')]);_0x14c07e[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x5ae24c['query'][_0xacd7('0x25')]);}return _0x549f29[_0xacd7('0x98')](_0x14c07e);}})[_0xacd7('0x2a')](function(_0x552fd9){if(_0x552fd9){return _0x552fd9?{'count':_0x5097de,'rows':_0x552fd9}:null;}})['then'](respondWithResult(_0x1ac6a1,null))[_0xacd7('0x50')](handleError(_0x1ac6a1,null));};exports['getMembers']=function(_0x25341a,_0x333516,_0x293fa4){var _0x278729={};var _0x284ef1={};var _0x137105;var _0x255ac4;return db['VoiceQueue'][_0xacd7('0x61')]({'where':{'id':_0x25341a[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x333516,null))[_0xacd7('0x2a')](function(_0x476d22){if(_0x476d22){_0x137105=_0x476d22;_0x284ef1['model']=_[_0xacd7('0x40')](db[_0xacd7('0x77')][_0xacd7('0x3b')]);_0x284ef1[_0xacd7('0x3f')]=_['keys'](_0x25341a['query']);_0x284ef1['filters']=_[_0xacd7('0x42')](_0x284ef1[_0xacd7('0x3e')],_0x284ef1[_0xacd7('0x3f')]);_0x278729[_0xacd7('0x44')]=_[_0xacd7('0x42')](_0x284ef1['model'],qs[_0xacd7('0x43')](_0x25341a[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x278729[_0xacd7('0x44')]=_0x278729[_0xacd7('0x44')]['length']?_0x278729[_0xacd7('0x44')]:_0x284ef1['model'];_0x278729[_0xacd7('0x65')]=qs[_0xacd7('0x48')](_0x25341a['query'][_0xacd7('0x48')]);_0x278729[_0xacd7('0x49')]=qs[_0xacd7('0x41')](_[_0xacd7('0x4a')](_0x25341a['query'],_0x284ef1['filters']));if(_0x25341a[_0xacd7('0x3f')][_0xacd7('0x2e')]){_0x278729[_0xacd7('0x49')]=_[_0xacd7('0x4b')](_0x278729[_0xacd7('0x49')],{'$or':_['map'](_0x278729[_0xacd7('0x44')],function(_0x3653b6){var _0x383ac4={};_0x383ac4[_0x3653b6]={'$like':'%'+_0x25341a['query']['filter']+'%'};return _0x383ac4;})});}_0x278729=_[_0xacd7('0x4b')]({},_0x278729,_0x25341a['options']);return _0x137105[_0xacd7('0x99')](_0x278729);}})[_0xacd7('0x2a')](function(_0x321d67){if(_0x321d67){_0x255ac4=_0x321d67[_0xacd7('0x45')];if(!_0x25341a['query'][_0xacd7('0x46')](_0xacd7('0x47'))){_0x278729['limit']=qs[_0xacd7('0x22')](_0x25341a[_0xacd7('0x3f')]['limit']);_0x278729[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x25341a[_0xacd7('0x3f')][_0xacd7('0x25')]);}return _0x137105[_0xacd7('0x99')](_0x278729);}})[_0xacd7('0x2a')](function(_0x5a0ac1){return _0x5a0ac1?{'count':_0x255ac4,'rows':_0x5a0ac1}:null;})[_0xacd7('0x2a')](respondWithResult(_0x333516,null))[_0xacd7('0x50')](handleError(_0x333516,null));};exports[_0xacd7('0x9a')]=function(_0x2b4cce,_0x17b4db,_0x2a7017){var _0x2f895b={};var _0x3a3ee4={};var _0x7c40cd;var _0x3a31d6;return db[_0xacd7('0x3a')][_0xacd7('0x61')]({'where':{'id':_0x2b4cce['params']['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x17b4db,null))[_0xacd7('0x2a')](function(_0x430a36){if(_0x430a36){_0x7c40cd=_0x430a36;_0x3a3ee4[_0xacd7('0x3e')]=_['keys'](db[_0xacd7('0x9b')][_0xacd7('0x3b')]);_0x3a3ee4['query']=_['keys'](_0x2b4cce[_0xacd7('0x3f')]);_0x3a3ee4[_0xacd7('0x41')]=_[_0xacd7('0x42')](_0x3a3ee4[_0xacd7('0x3e')],_0x3a3ee4[_0xacd7('0x3f')]);_0x2f895b[_0xacd7('0x44')]=_[_0xacd7('0x42')](_0x3a3ee4['model'],qs[_0xacd7('0x43')](_0x2b4cce['query'][_0xacd7('0x43')]));_0x2f895b[_0xacd7('0x44')]=_0x2f895b[_0xacd7('0x44')][_0xacd7('0x45')]?_0x2f895b[_0xacd7('0x44')]:_0x3a3ee4[_0xacd7('0x3e')];_0x2f895b[_0xacd7('0x65')]=qs['sort'](_0x2b4cce[_0xacd7('0x3f')][_0xacd7('0x48')]);_0x2f895b['where']=qs[_0xacd7('0x41')](_[_0xacd7('0x4a')](_0x2b4cce[_0xacd7('0x3f')],_0x3a3ee4[_0xacd7('0x41')]));if(_0x2b4cce[_0xacd7('0x3f')][_0xacd7('0x2e')]){_0x2f895b[_0xacd7('0x49')]=_['merge'](_0x2f895b[_0xacd7('0x49')],{'$or':_[_0xacd7('0x39')](_0x2f895b[_0xacd7('0x44')],function(_0x2d1f59){var _0x178805={};_0x178805[_0x2d1f59]={'$like':'%'+_0x2b4cce[_0xacd7('0x3f')]['filter']+'%'};return _0x178805;})});}_0x2f895b=_[_0xacd7('0x4b')]({},_0x2f895b,_0x2b4cce['options']);return _0x7c40cd[_0xacd7('0x9a')](_0x2f895b);}})[_0xacd7('0x2a')](function(_0x3c7a1b){if(_0x3c7a1b){_0x3a31d6=_0x3c7a1b[_0xacd7('0x45')];if(!_0x2b4cce[_0xacd7('0x3f')][_0xacd7('0x46')]('nolimit')){_0x2f895b[_0xacd7('0x22')]=qs[_0xacd7('0x22')](_0x2b4cce[_0xacd7('0x3f')][_0xacd7('0x22')]);_0x2f895b[_0xacd7('0x25')]=qs[_0xacd7('0x25')](_0x2b4cce[_0xacd7('0x3f')][_0xacd7('0x25')]);}return _0x7c40cd[_0xacd7('0x9a')](_0x2f895b);}})[_0xacd7('0x2a')](function(_0x4fd0c1){if(_0x4fd0c1){return _0x4fd0c1?{'count':_0x3a31d6,'rows':_0x4fd0c1}:null;}})['then'](respondWithResult(_0x17b4db,null))[_0xacd7('0x50')](handleError(_0x17b4db,null));};exports[_0xacd7('0x9c')]=function(_0xc993e3,_0xd2ba09,_0x12ea05){var _0x1652ac,_0x2d4407;return db[_0xacd7('0x3a')][_0xacd7('0x33')]({'where':{'id':_0xc993e3[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0xd2ba09,null))['then'](function(_0x1c3aed){if(_0x1c3aed){_0x2d4407=_0x1c3aed;return _0x1c3aed[_0xacd7('0x9c')](_0xc993e3['body']['ids'],_[_0xacd7('0x5e')](_0xc993e3[_0xacd7('0x53')],['ids','id'])||{});}return null;})[_0xacd7('0x9d')](function(_0xb6fddf){var _0x241ead;_0x1652ac=_0xb6fddf||[];var _0x18be9c=[];if(_0xb6fddf){for(var _0x18497c=0x0;_0x18497c<_0xb6fddf['length'];_0x18497c+=0x1){var _0x1e295e=_0xb6fddf[_0x18497c][_0xacd7('0x55')]({'plain':!![]});_0x2d4407[_0xacd7('0x9e')]=_0xc993e3[_0xacd7('0x53')][_0xacd7('0x9e')]?_0xc993e3[_0xacd7('0x53')][_0xacd7('0x9e')]:_0x2d4407['dialCheckDuplicateType'];switch(_0x2d4407[_0xacd7('0x9e')]){case _0xacd7('0x9f'):_0x241ead=squel[_0xacd7('0xa0')]()['into'](_0xacd7('0xa1'))[_0xacd7('0xa2')]([_0xacd7('0xa3'),_0xacd7('0xa4'),_0xacd7('0xa5'),_0xacd7('0xa6'),_0xacd7('0x62'),_0xacd7('0xa7'),_0xacd7('0x5f')],squel[_0xacd7('0xa8')]()[_0xacd7('0x7d')](_0xacd7('0xa3'),_0xacd7('0xa3'))[_0xacd7('0x7d')]('NOW()','scheduledAt')[_0xacd7('0x7d')]('id',_0xacd7('0xa5'))['field'](_0x1e295e['CmListId']['toString'](),'ListId')[_0xacd7('0x7d')](_0xc993e3[_0xacd7('0x5d')]['id'][_0xacd7('0x88')](),'VoiceQueueId')[_0xacd7('0x7d')](_0xacd7('0xa9'),_0xacd7('0xa7'))[_0xacd7('0x7d')](_0xacd7('0xa9'),_0xacd7('0x5f'))[_0xacd7('0x7f')]('cm_contacts')[_0xacd7('0x49')]('deletedAt\x20IS\x20NULL')[_0xacd7('0x49')](_0xacd7('0xaa'),_0x1e295e[_0xacd7('0xab')][_0xacd7('0x88')]())[_0xacd7('0x49')](_0xacd7('0xac'))[_0xacd7('0x49')](_0xacd7('0xad'),squel['select']()[_0xacd7('0x7d')](_0xacd7('0xae'))['from'](_0xacd7('0xaf'))['where'](_0xacd7('0x84'),_0xc993e3[_0xacd7('0x5d')]['id'][_0xacd7('0x88')]()))[_0xacd7('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xacd7('0xa8')]()['field'](_0xacd7('0xb0'))[_0xacd7('0x7f')](_0xacd7('0xa1'))[_0xacd7('0x49')](_0xacd7('0x84'),_0xc993e3['params']['id'][_0xacd7('0x88')]())))[_0xacd7('0x88')]();break;case'onlyIfOpen':_0x241ead=squel[_0xacd7('0xa0')]()[_0xacd7('0xb1')](_0xacd7('0xa1'))[_0xacd7('0xa2')]([_0xacd7('0xa3'),_0xacd7('0xa4'),'ContactId',_0xacd7('0xa6'),'VoiceQueueId',_0xacd7('0xa7'),_0xacd7('0x5f')],squel[_0xacd7('0xa8')]()[_0xacd7('0x7d')](_0xacd7('0xa3'),'phone')[_0xacd7('0x7d')]('NOW()',_0xacd7('0xa4'))[_0xacd7('0x7d')]('id',_0xacd7('0xa5'))[_0xacd7('0x7d')](_0x1e295e[_0xacd7('0xab')][_0xacd7('0x88')](),_0xacd7('0xa6'))[_0xacd7('0x7d')](_0xc993e3[_0xacd7('0x5d')]['id'][_0xacd7('0x88')](),'VoiceQueueId')['field'](_0xacd7('0xa9'),_0xacd7('0xa7'))[_0xacd7('0x7d')]('NOW()',_0xacd7('0x5f'))[_0xacd7('0x7f')](_0xacd7('0xb2'))['where'](_0xacd7('0xb3'))[_0xacd7('0x49')](_0xacd7('0xaa'),_0x1e295e[_0xacd7('0xab')][_0xacd7('0x88')]())[_0xacd7('0x49')]('phone\x20IS\x20NOT\x20NULL')[_0xacd7('0x49')](_0xacd7('0xad'),squel[_0xacd7('0xa8')]()[_0xacd7('0x7d')](_0xacd7('0xb0'))['from'](_0xacd7('0xa1'))[_0xacd7('0x49')](_0xacd7('0x84'),_0xc993e3[_0xacd7('0x5d')]['id']['toString']())))['toString']();break;default:_0x241ead=squel[_0xacd7('0xa0')]()[_0xacd7('0xb1')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0xacd7('0xa5'),_0xacd7('0xa6'),'VoiceQueueId',_0xacd7('0xa7'),_0xacd7('0x5f')],squel[_0xacd7('0xa8')]()['field']('phone',_0xacd7('0xa3'))[_0xacd7('0x7d')]('NOW()',_0xacd7('0xa4'))['field']('id',_0xacd7('0xa5'))['field'](_0x1e295e[_0xacd7('0xab')][_0xacd7('0x88')](),'ListId')[_0xacd7('0x7d')](_0xc993e3[_0xacd7('0x5d')]['id'][_0xacd7('0x88')](),_0xacd7('0x62'))[_0xacd7('0x7d')](_0xacd7('0xa9'),_0xacd7('0xa7'))[_0xacd7('0x7d')](_0xacd7('0xa9'),_0xacd7('0x5f'))['from'](_0xacd7('0xb2'))[_0xacd7('0x49')](_0xacd7('0xb3'))[_0xacd7('0x49')](_0xacd7('0xaa'),_0x1e295e[_0xacd7('0xab')]['toString']())[_0xacd7('0x49')](_0xacd7('0xac')))[_0xacd7('0x88')]();}_0x18be9c[_0xacd7('0x87')](db[_0xacd7('0xb4')][_0xacd7('0x3f')](_0x241ead));}return BPromise[_0xacd7('0xb5')](_0x18be9c);}})[_0xacd7('0x2a')](function(){return _0x1652ac;})[_0xacd7('0x2a')](respondWithResult(_0xd2ba09,null))[_0xacd7('0x50')](handleError(_0xd2ba09,null));};exports[_0xacd7('0xb6')]=function(_0x21a7fd,_0x59ac9f,_0x65abd6){return db[_0xacd7('0x3a')]['find']({'where':{'id':_0x21a7fd[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x59ac9f,null))[_0xacd7('0x2a')](function(_0x2cb94a){if(_0x2cb94a){return _0x2cb94a['removeLists'](_0x21a7fd[_0xacd7('0x3f')]['ids']);}})[_0xacd7('0x2a')](function(_0x1711ac){if(_0x1711ac){return db[_0xacd7('0x63')][_0xacd7('0x92')]({'where':{'ListId':_0x21a7fd[_0xacd7('0x3f')]['ids'],'VoiceQueueId':_0x21a7fd[_0xacd7('0x5d')]['id']}})['then'](function(){return _0x1711ac;});}})['then'](respondWithStatusCode(_0x59ac9f,null))[_0xacd7('0x50')](handleError(_0x59ac9f,null));};exports[_0xacd7('0xb7')]=function(_0x14502b,_0x22cdd8,_0x1931b1){var _0x27a9ab={};var _0x23ffe7={};var _0x293e49;var _0x59e694;return db[_0xacd7('0x3a')][_0xacd7('0x61')]({'where':{'id':_0x14502b[_0xacd7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x22cdd8,null))[_0xacd7('0x2a')](function(_0x289fa2){if(_0x289fa2){_0x293e49=_0x289fa2;_0x23ffe7[_0xacd7('0x3e')]=_['keys'](db[_0xacd7('0x9b')]['rawAttributes']);_0x23ffe7['query']=_[_0xacd7('0x40')](_0x14502b[_0xacd7('0x3f')]);_0x23ffe7[_0xacd7('0x41')]=_[_0xacd7('0x42')](_0x23ffe7[_0xacd7('0x3e')],_0x23ffe7[_0xacd7('0x3f')]);_0x27a9ab[_0xacd7('0x44')]=_['intersection'](_0x23ffe7[_0xacd7('0x3e')],qs[_0xacd7('0x43')](_0x14502b[_0xacd7('0x3f')][_0xacd7('0x43')]));_0x27a9ab[_0xacd7('0x44')]=_0x27a9ab[_0xacd7('0x44')]['length']?_0x27a9ab['attributes']:_0x23ffe7[_0xacd7('0x3e')];_0x27a9ab[_0xacd7('0x65')]=qs[_0xacd7('0x48')](_0x14502b[_0xacd7('0x3f')]['sort']);_0x27a9ab['where']=qs[_0xacd7('0x41')](_['pick'](_0x14502b['query'],_0x23ffe7[_0xacd7('0x41')]));if(_0x14502b[_0xacd7('0x3f')][_0xacd7('0x2e')]){_0x27a9ab['where']=_[_0xacd7('0x4b')](_0x27a9ab['where'],{'$or':_[_0xacd7('0x39')](_0x27a9ab['attributes'],function(_0x3854ac){var _0x8b3d38={};_0x8b3d38[_0x3854ac]={'$like':'%'+_0x14502b[_0xacd7('0x3f')][_0xacd7('0x2e')]+'%'};return _0x8b3d38;})});}_0x27a9ab=_['merge']({},_0x27a9ab,_0x14502b['options']);return _0x293e49[_0xacd7('0xb7')](_0x27a9ab);}})[_0xacd7('0x2a')](function(_0x29b146){if(_0x29b146){_0x59e694=_0x29b146[_0xacd7('0x45')];if(!_0x14502b[_0xacd7('0x3f')]['hasOwnProperty'](_0xacd7('0x47'))){_0x27a9ab[_0xacd7('0x22')]=qs[_0xacd7('0x22')](_0x14502b[_0xacd7('0x3f')][_0xacd7('0x22')]);_0x27a9ab['offset']=qs[_0xacd7('0x25')](_0x14502b[_0xacd7('0x3f')][_0xacd7('0x25')]);}return _0x293e49[_0xacd7('0xb7')](_0x27a9ab);}})['then'](function(_0x16d615){if(_0x16d615){return _0x16d615?{'count':_0x59e694,'rows':_0x16d615}:null;}})[_0xacd7('0x2a')](respondWithResult(_0x22cdd8,null))[_0xacd7('0x50')](handleError(_0x22cdd8,null));};exports['addBlackLists']=function(_0x5a4792,_0x4ff969,_0x2949c1){var _0x9d1ce4,_0x1f4b95;return db[_0xacd7('0x3a')]['find']({'where':{'id':_0x5a4792[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x4ff969,null))['then'](function(_0xbad07d){if(_0xbad07d){_0x1f4b95=_0xbad07d;return _0xbad07d['addBlackLists'](_0x5a4792[_0xacd7('0x53')][_0xacd7('0x8f')],_[_0xacd7('0x5e')](_0x5a4792[_0xacd7('0x53')],['ids','id'])||{});}return null;})[_0xacd7('0x9d')](function(_0x332720){var _0x472f25;_0x9d1ce4=_0x332720||[];var _0x14e783=[];if(_0x332720){for(var _0x5e5632=0x0;_0x5e5632<_0x332720[_0xacd7('0x45')];_0x5e5632+=0x1){var _0x4e5420=_0x332720[_0x5e5632][_0xacd7('0x55')]({'plain':!![]});_0x472f25=squel[_0xacd7('0xa0')]()[_0xacd7('0xb1')](_0xacd7('0xb8'))[_0xacd7('0xa2')]([_0xacd7('0xa3'),_0xacd7('0xa5'),_0xacd7('0xa6'),'VoiceQueueId',_0xacd7('0xa7'),_0xacd7('0x5f')],squel[_0xacd7('0xa8')]()[_0xacd7('0x7d')](_0xacd7('0xa3'),_0xacd7('0xa3'))[_0xacd7('0x7d')]('id',_0xacd7('0xa5'))[_0xacd7('0x7d')](_0x4e5420[_0xacd7('0xab')]['toString'](),_0xacd7('0xa6'))['field'](_0x5a4792['params']['id'][_0xacd7('0x88')](),_0xacd7('0x62'))[_0xacd7('0x7d')](_0xacd7('0xa9'),'createdAt')[_0xacd7('0x7d')](_0xacd7('0xa9'),_0xacd7('0x5f'))[_0xacd7('0x7f')](_0xacd7('0xb2'))['where']('deletedAt\x20IS\x20NULL')[_0xacd7('0x49')](_0xacd7('0xaa'),_0x4e5420['CmListId'][_0xacd7('0x88')]())[_0xacd7('0x49')](_0xacd7('0xac')))[_0xacd7('0x88')]();_0x14e783['push'](db[_0xacd7('0xb4')]['query'](_0x472f25));}return BPromise[_0xacd7('0xb5')](_0x14e783);}})[_0xacd7('0x2a')](function(){return _0x9d1ce4;})[_0xacd7('0x2a')](respondWithResult(_0x4ff969,null))['catch'](handleError(_0x4ff969,null));};exports['removeBlackLists']=function(_0x34787e,_0x143c98,_0x54edb9){return db[_0xacd7('0x3a')][_0xacd7('0x33')]({'where':{'id':_0x34787e[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](handleEntityNotFound(_0x143c98,null))[_0xacd7('0x2a')](function(_0x266ff2){if(_0x266ff2){return _0x266ff2[_0xacd7('0xb9')](_0x34787e[_0xacd7('0x3f')][_0xacd7('0x8f')]);}})[_0xacd7('0x2a')](function(_0x225730){if(_0x225730){return db[_0xacd7('0x6a')][_0xacd7('0x92')]({'where':{'ListId':_0x34787e[_0xacd7('0x3f')][_0xacd7('0x8f')],'VoiceQueueId':_0x34787e[_0xacd7('0x5d')]['id']}})[_0xacd7('0x2a')](function(){return _0x225730;});}})['then'](respondWithStatusCode(_0x143c98,null))[_0xacd7('0x50')](handleError(_0x143c98,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 8bfac90..ab8de1d 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 _0x3426=['emit','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3426,0x15b));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6342('0x0'));var VoiceQueue=require(_0x6342('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6342('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6342('0x3'),'afterDestroy':_0x6342('0x4')};function emitEvent(_0x243212){return function(_0x51f669,_0x2586ce,_0xd4cd16){VoiceQueueEvents[_0x6342('0x5')](_0x243212+':'+_0x51f669['id'],_0x51f669);VoiceQueueEvents[_0x6342('0x5')](_0x243212,_0x51f669);_0xd4cd16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x6342('0x6')](e,emitEvent(event));}}module[_0x6342('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x34ad=['../../mysqldb','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34ad,0x12f));var _0xd34a=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0x34ad[_0x38c0b2];return _0x283c00;};'use strict';var EventEmitter=require(_0xd34a('0x0'));var VoiceQueue=require(_0xd34a('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd34a('0x2'),'afterUpdate':_0xd34a('0x3'),'afterDestroy':_0xd34a('0x4')};function emitEvent(_0x270947){return function(_0x11d834,_0x5bdc18,_0x13fdf4){VoiceQueueEvents['emit'](_0x270947+':'+_0x11d834['id'],_0x11d834);VoiceQueueEvents['emit'](_0x270947,_0x11d834);_0x13fdf4(null);};}for(var e in events){if(events[_0xd34a('0x5')](e)){var event=events[e];VoiceQueue[_0xd34a('0x6')](e,emitEvent(event));}}module[_0xd34a('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index fbd2328..fe9ea50 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x141908,_0x4e61dc){var _0x37e9c9=function(_0x3a557e){while(--_0x3a557e){_0x141908['push'](_0x141908['shift']());}};_0x37e9c9(++_0x4e61dc);}(_0x008c,0x188));var _0xc008=function(_0x477270,_0x4adea6){_0x477270=_0x477270-0x0;var _0x21ae0d=_0x008c[_0x477270];return _0x21ae0d;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x4c4981,_0x178530){var _0x2dc9c1=function(_0x15e2fb){while(--_0x15e2fb){_0x4c4981['push'](_0x4c4981['shift']());}};_0x2dc9c1(++_0x178530);}(_0x008c,0x188));var _0xc008=function(_0x8e579f,_0x5d7ddd){_0x8e579f=_0x8e579f-0x0;var _0x438bcb=_0x008c[_0x8e579f];return _0x438bcb;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index f95a570..3cefaf2 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 _0xa905=['info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','attributes','map','model','catch','ShowVoiceQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x2a0b93,_0x323573){var _0x4fe0e0=function(_0x4654d2){while(--_0x4654d2){_0x2a0b93['push'](_0x2a0b93['shift']());}};_0x4fe0e0(++_0x323573);}(_0xa905,0x13d));var _0x5a90=function(_0x2efe86,_0x4b6c3f){_0x2efe86=_0x2efe86-0x0;var _0x48e01c=_0xa905[_0x2efe86];return _0x48e01c;};'use strict';var _=require('lodash');var util=require(_0x5a90('0x0'));var moment=require(_0x5a90('0x1'));var BPromise=require(_0x5a90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a90('0x3'));var db=require(_0x5a90('0x4'))['db'];var utils=require(_0x5a90('0x5'));var logger=require('../../config/logger')(_0x5a90('0x6'));var config=require(_0x5a90('0x7'));var jayson=require(_0x5a90('0x8'));var client=jayson[_0x5a90('0x9')]['http']({'port':0x232a});config[_0x5a90('0xa')]=_[_0x5a90('0xb')](config[_0x5a90('0xa')],{'host':_0x5a90('0xc'),'port':0x18eb});var socket=require(_0x5a90('0xd'))(new Redis(config[_0x5a90('0xa')]));require('./voiceQueue.socket')[_0x5a90('0xe')](socket);function respondWithRpcPromise(_0x4f1f57,_0x449aa7,_0x1f978e){return new BPromise(function(_0x30352e,_0x263205){return client['request'](_0x4f1f57,_0x1f978e)[_0x5a90('0xf')](function(_0x37f33f){logger[_0x5a90('0x10')](_0x5a90('0x11'),_0x449aa7,_0x5a90('0x12'));logger[_0x5a90('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x449aa7,_0x5a90('0x12'),JSON[_0x5a90('0x14')](_0x37f33f));if(_0x37f33f['error']){if(_0x37f33f[_0x5a90('0x15')][_0x5a90('0x16')]===0x1f4){logger[_0x5a90('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x449aa7,_0x37f33f[_0x5a90('0x15')]['message']);return _0x263205(_0x37f33f['error'][_0x5a90('0x17')]);}logger[_0x5a90('0x15')](_0x5a90('0x11'),_0x449aa7,_0x37f33f[_0x5a90('0x15')][_0x5a90('0x17')]);return _0x30352e(_0x37f33f['error'][_0x5a90('0x17')]);}else{logger[_0x5a90('0x10')](_0x5a90('0x11'),_0x449aa7,_0x5a90('0x12'));_0x30352e(_0x37f33f[_0x5a90('0x18')][_0x5a90('0x17')]);}})['catch'](function(_0xef2b14){logger[_0x5a90('0x15')](_0x5a90('0x11'),_0x449aa7,_0xef2b14);_0x263205(_0xef2b14);});});}exports[_0x5a90('0x19')]=function(_0x5d4fb2){var _0x564d00=this;return new Promise(function(_0x369cab,_0x1acd0c){return db[_0x5a90('0x1a')][_0x5a90('0x1b')]({'raw':_0x5d4fb2[_0x5a90('0x1c')]?_0x5d4fb2['options'][_0x5a90('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d4fb2['options']?_0x5d4fb2[_0x5a90('0x1c')][_0x5a90('0x1e')]||null:null,'attributes':_0x5d4fb2['options']?_0x5d4fb2[_0x5a90('0x1c')]['attributes']||null:null,'limit':_0x5d4fb2[_0x5a90('0x1c')]?_0x5d4fb2[_0x5a90('0x1c')]['limit']||null:null,'include':_0x5d4fb2[_0x5a90('0x1c')]?_0x5d4fb2['options']['include']?_['map'](_0x5d4fb2[_0x5a90('0x1c')][_0x5a90('0x1f')],function(_0x36ef5d){return{'model':db[_0x36ef5d['model']],'as':_0x36ef5d['as'],'attributes':_0x36ef5d[_0x5a90('0x20')],'include':_0x36ef5d[_0x5a90('0x1f')]?_[_0x5a90('0x21')](_0x36ef5d[_0x5a90('0x1f')],function(_0xf7694b){return{'model':db[_0xf7694b['model']],'as':_0xf7694b['as'],'attributes':_0xf7694b['attributes'],'include':_0xf7694b['include']?_[_0x5a90('0x21')](_0xf7694b['include'],function(_0x31a660){return{'model':db[_0x31a660[_0x5a90('0x22')]],'as':_0x31a660['as'],'attributes':_0x31a660[_0x5a90('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23acb3){logger['info'](_0x5a90('0x19'),_0x5d4fb2);logger['debug'](_0x5a90('0x19'),_0x5d4fb2,JSON[_0x5a90('0x14')](_0x23acb3));_0x369cab(_0x23acb3);})[_0x5a90('0x23')](function(_0x564f9a){logger[_0x5a90('0x15')]('GetVoiceQueue',_0x564f9a[_0x5a90('0x17')],_0x5d4fb2);_0x1acd0c(_0x564d00[_0x5a90('0x15')](0x1f4,_0x564f9a[_0x5a90('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x4d3506){var _0x37e5fc=this;return new Promise(function(_0x590ed8,_0x1ca467){return db[_0x5a90('0x1a')]['find']({'raw':_0x4d3506[_0x5a90('0x1c')]?_0x4d3506[_0x5a90('0x1c')][_0x5a90('0x1d')]===undefined?!![]:![]:!![],'where':_0x4d3506[_0x5a90('0x1c')]?_0x4d3506[_0x5a90('0x1c')]['where']||null:null,'attributes':_0x4d3506[_0x5a90('0x1c')]?_0x4d3506['options'][_0x5a90('0x20')]||null:null,'include':_0x4d3506['options']?_0x4d3506[_0x5a90('0x1c')][_0x5a90('0x1f')]?_[_0x5a90('0x21')](_0x4d3506['options'][_0x5a90('0x1f')],function(_0x13ddd5){return{'model':db[_0x13ddd5['model']],'as':_0x13ddd5['as'],'attributes':_0x13ddd5['attributes'],'include':_0x13ddd5[_0x5a90('0x1f')]?_[_0x5a90('0x21')](_0x13ddd5[_0x5a90('0x1f')],function(_0x15c776){return{'model':db[_0x15c776[_0x5a90('0x22')]],'as':_0x15c776['as'],'attributes':_0x15c776[_0x5a90('0x20')],'include':_0x15c776['include']?_[_0x5a90('0x21')](_0x15c776[_0x5a90('0x1f')],function(_0x8ac9ef){return{'model':db[_0x8ac9ef['model']],'as':_0x8ac9ef['as'],'attributes':_0x8ac9ef[_0x5a90('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5a90('0xf')](function(_0x1ef0c6){logger[_0x5a90('0x10')](_0x5a90('0x24'),_0x4d3506);logger['debug']('ShowVoiceQueue',_0x4d3506,JSON[_0x5a90('0x14')](_0x1ef0c6));_0x590ed8(_0x1ef0c6);})[_0x5a90('0x23')](function(_0x3f368e){logger[_0x5a90('0x15')](_0x5a90('0x24'),_0x3f368e[_0x5a90('0x17')],_0x4d3506);_0x1ca467(_0x37e5fc[_0x5a90('0x15')](0x1f4,_0x3f368e['message']));});});}; \ No newline at end of file +var _0x1256=['../../config/environment','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','include','model','map','then','info','GetVoiceQueue','catch','VoiceQueue','ShowVoiceQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x145880,_0x1365aa){var _0xd2f1c2=function(_0x5f44d8){while(--_0x5f44d8){_0x145880['push'](_0x145880['shift']());}};_0xd2f1c2(++_0x1365aa);}(_0x1256,0x14f));var _0x6125=function(_0x302a84,_0xfaf37c){_0x302a84=_0x302a84-0x0;var _0x28ef60=_0x1256[_0x302a84];return _0x28ef60;};'use strict';var _=require(_0x6125('0x0'));var util=require('util');var moment=require(_0x6125('0x1'));var BPromise=require(_0x6125('0x2'));var rs=require(_0x6125('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6125('0x4'))['db'];var utils=require(_0x6125('0x5'));var logger=require('../../config/logger')(_0x6125('0x6'));var config=require(_0x6125('0x7'));var jayson=require(_0x6125('0x8'));var client=jayson[_0x6125('0x9')][_0x6125('0xa')]({'port':0x232a});config[_0x6125('0xb')]=_['defaults'](config[_0x6125('0xb')],{'host':_0x6125('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6125('0xb')]));require(_0x6125('0xd'))['register'](socket);function respondWithRpcPromise(_0x173e80,_0x3b3f1a,_0x13aec3){return new BPromise(function(_0x1f7c9b,_0x4c0012){return client['request'](_0x173e80,_0x13aec3)['then'](function(_0x28d497){logger['info'](_0x6125('0xe'),_0x3b3f1a,_0x6125('0xf'));logger[_0x6125('0x10')](_0x6125('0x11'),_0x3b3f1a,_0x6125('0xf'),JSON[_0x6125('0x12')](_0x28d497));if(_0x28d497[_0x6125('0x13')]){if(_0x28d497[_0x6125('0x13')][_0x6125('0x14')]===0x1f4){logger[_0x6125('0x13')](_0x6125('0xe'),_0x3b3f1a,_0x28d497[_0x6125('0x13')]['message']);return _0x4c0012(_0x28d497[_0x6125('0x13')][_0x6125('0x15')]);}logger[_0x6125('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x3b3f1a,_0x28d497[_0x6125('0x13')][_0x6125('0x15')]);return _0x1f7c9b(_0x28d497['error'][_0x6125('0x15')]);}else{logger['info'](_0x6125('0xe'),_0x3b3f1a,_0x6125('0xf'));_0x1f7c9b(_0x28d497[_0x6125('0x16')][_0x6125('0x15')]);}})['catch'](function(_0x5a0ff5){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3b3f1a,_0x5a0ff5);_0x4c0012(_0x5a0ff5);});});}exports['GetVoiceQueue']=function(_0x50f468){var _0x1f738e=this;return new Promise(function(_0x3a1df9,_0x574f5b){return db['VoiceQueue'][_0x6125('0x17')]({'raw':_0x50f468[_0x6125('0x18')]?_0x50f468['options'][_0x6125('0x19')]===undefined?!![]:![]:!![],'where':_0x50f468[_0x6125('0x18')]?_0x50f468[_0x6125('0x18')][_0x6125('0x1a')]||null:null,'attributes':_0x50f468[_0x6125('0x18')]?_0x50f468['options'][_0x6125('0x1b')]||null:null,'limit':_0x50f468['options']?_0x50f468[_0x6125('0x18')][_0x6125('0x1c')]||null:null,'include':_0x50f468[_0x6125('0x18')]?_0x50f468[_0x6125('0x18')][_0x6125('0x1d')]?_['map'](_0x50f468[_0x6125('0x18')][_0x6125('0x1d')],function(_0x37f435){return{'model':db[_0x37f435[_0x6125('0x1e')]],'as':_0x37f435['as'],'attributes':_0x37f435['attributes'],'include':_0x37f435[_0x6125('0x1d')]?_[_0x6125('0x1f')](_0x37f435[_0x6125('0x1d')],function(_0x1c1769){return{'model':db[_0x1c1769['model']],'as':_0x1c1769['as'],'attributes':_0x1c1769[_0x6125('0x1b')],'include':_0x1c1769[_0x6125('0x1d')]?_[_0x6125('0x1f')](_0x1c1769[_0x6125('0x1d')],function(_0x548f8f){return{'model':db[_0x548f8f[_0x6125('0x1e')]],'as':_0x548f8f['as'],'attributes':_0x548f8f[_0x6125('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6125('0x20')](function(_0x20f3ee){logger[_0x6125('0x21')](_0x6125('0x22'),_0x50f468);logger[_0x6125('0x10')](_0x6125('0x22'),_0x50f468,JSON[_0x6125('0x12')](_0x20f3ee));_0x3a1df9(_0x20f3ee);})[_0x6125('0x23')](function(_0x55912e){logger[_0x6125('0x13')](_0x6125('0x22'),_0x55912e[_0x6125('0x15')],_0x50f468);_0x574f5b(_0x1f738e['error'](0x1f4,_0x55912e[_0x6125('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x14e172){var _0x2245bc=this;return new Promise(function(_0x50f28d,_0x32f11c){return db[_0x6125('0x24')]['find']({'raw':_0x14e172['options']?_0x14e172[_0x6125('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x14e172[_0x6125('0x18')]?_0x14e172['options'][_0x6125('0x1a')]||null:null,'attributes':_0x14e172[_0x6125('0x18')]?_0x14e172[_0x6125('0x18')][_0x6125('0x1b')]||null:null,'include':_0x14e172[_0x6125('0x18')]?_0x14e172[_0x6125('0x18')][_0x6125('0x1d')]?_[_0x6125('0x1f')](_0x14e172[_0x6125('0x18')][_0x6125('0x1d')],function(_0x1f23a3){return{'model':db[_0x1f23a3['model']],'as':_0x1f23a3['as'],'attributes':_0x1f23a3[_0x6125('0x1b')],'include':_0x1f23a3[_0x6125('0x1d')]?_[_0x6125('0x1f')](_0x1f23a3['include'],function(_0x4536c1){return{'model':db[_0x4536c1['model']],'as':_0x4536c1['as'],'attributes':_0x4536c1[_0x6125('0x1b')],'include':_0x4536c1['include']?_[_0x6125('0x1f')](_0x4536c1[_0x6125('0x1d')],function(_0x3b9b8f){return{'model':db[_0x3b9b8f[_0x6125('0x1e')]],'as':_0x3b9b8f['as'],'attributes':_0x3b9b8f[_0x6125('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x935b4){logger[_0x6125('0x21')](_0x6125('0x25'),_0x14e172);logger[_0x6125('0x10')]('ShowVoiceQueue',_0x14e172,JSON[_0x6125('0x12')](_0x935b4));_0x50f28d(_0x935b4);})[_0x6125('0x23')](function(_0x1539eb){logger[_0x6125('0x13')](_0x6125('0x25'),_0x1539eb[_0x6125('0x15')],_0x14e172);_0x32f11c(_0x2245bc[_0x6125('0x13')](0x1f4,_0x1539eb[_0x6125('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index a11a09c..576efe0 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 _0x03d3=['update','emit','register','length','remove'];(function(_0x562c2e,_0x5d51b2){var _0x1cadad=function(_0x5544f5){while(--_0x5544f5){_0x562c2e['push'](_0x562c2e['shift']());}};_0x1cadad(++_0x5d51b2);}(_0x03d3,0x144));var _0x303d=function(_0x60787e,_0x5e5ed1){_0x60787e=_0x60787e-0x0;var _0x26e3e9=_0x03d3[_0x60787e];return _0x26e3e9;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x303d('0x0'),_0x303d('0x1')];function createListener(_0x4097da,_0x3c33be){return function(_0x1aabec){_0x3c33be[_0x303d('0x2')](_0x4097da,_0x1aabec);};}function removeListener(_0x34e4ef,_0x22921b){return function(){VoiceQueueEvents['removeListener'](_0x34e4ef,_0x22921b);};}exports[_0x303d('0x3')]=function(_0x138109){for(var _0x3cb248=0x0,_0x51c699=events[_0x303d('0x4')];_0x3cb248<_0x51c699;_0x3cb248++){var _0x19f34e=events[_0x3cb248];var _0x40357d=createListener('voiceQueue:'+_0x19f34e,_0x138109);VoiceQueueEvents['on'](_0x19f34e,_0x40357d);}}; \ No newline at end of file +var _0x3ab1=['save','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0xb5736e,_0x487bb8){var _0x1d7b0e=function(_0x4f2976){while(--_0x4f2976){_0xb5736e['push'](_0xb5736e['shift']());}};_0x1d7b0e(++_0x487bb8);}(_0x3ab1,0x191));var _0x13ab=function(_0x4a0d28,_0x5367ba){_0x4a0d28=_0x4a0d28-0x0;var _0x582915=_0x3ab1[_0x4a0d28];return _0x582915;};'use strict';var VoiceQueueEvents=require(_0x13ab('0x0'));var events=[_0x13ab('0x1'),'remove','update'];function createListener(_0x18e81d,_0x18eee4){return function(_0x2b1f1a){_0x18eee4[_0x13ab('0x2')](_0x18e81d,_0x2b1f1a);};}function removeListener(_0x457557,_0xba82a5){return function(){VoiceQueueEvents[_0x13ab('0x3')](_0x457557,_0xba82a5);};}exports[_0x13ab('0x4')]=function(_0x17fb94){for(var _0x55cee9=0x0,_0x5990e5=events['length'];_0x55cee9<_0x5990e5;_0x55cee9++){var _0x39ef37=events[_0x55cee9];var _0x166b6b=createListener(_0x13ab('0x5')+_0x39ef37,_0x17fb94);VoiceQueueEvents['on'](_0x39ef37,_0x166b6b);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 80667de..82ee8f6 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 _0xc559=['destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','/describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete'];(function(_0x429224,_0x23b47f){var _0x4f5f60=function(_0x2f3d44){while(--_0x2f3d44){_0x429224['push'](_0x429224['shift']());}};_0x4f5f60(++_0x23b47f);}(_0xc559,0x11a));var _0x9c55=function(_0x31b9b5,_0x3ba5e7){_0x31b9b5=_0x31b9b5-0x0;var _0x586f52=_0xc559[_0x31b9b5];return _0x586f52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c55('0x0'));var timeout=require('connect-timeout');var express=require(_0x9c55('0x1'));var router=express[_0x9c55('0x2')]();var fs_extra=require(_0x9c55('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9c55('0x4'));var config=require('../../config/environment');var controller=require(_0x9c55('0x5'));router[_0x9c55('0x6')]('/',auth[_0x9c55('0x7')](),controller['index']);router[_0x9c55('0x6')](_0x9c55('0x8'),auth[_0x9c55('0x7')](),controller['describe']);router[_0x9c55('0x6')](_0x9c55('0x9'),auth['isAuthenticated'](),controller[_0x9c55('0xa')]);router['get'](_0x9c55('0xb'),auth['isAuthenticated'](),controller[_0x9c55('0xc')]);router[_0x9c55('0xd')]('/',auth[_0x9c55('0x7')](),controller[_0x9c55('0xe')]);router[_0x9c55('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9c55('0x10')]);router[_0x9c55('0x11')](_0x9c55('0xb'),auth[_0x9c55('0x7')](),controller[_0x9c55('0x12')]);module[_0x9c55('0x13')]=router; \ No newline at end of file +var _0x339d=['create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/index','getVoiceQueuesReport','show','post'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x339d,0xb2));var _0xd339=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x339d[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0xd339('0x0'));var path=require(_0xd339('0x1'));var timeout=require(_0xd339('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd339('0x3'));var interaction=require(_0xd339('0x4'));var config=require(_0xd339('0x5'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xd339('0x6')](),controller['index']);router[_0xd339('0x7')]('/describe',auth[_0xd339('0x6')](),controller['describe']);router[_0xd339('0x7')](_0xd339('0x8'),auth['isAuthenticated'](),controller[_0xd339('0x9')]);router['get']('/:id',auth[_0xd339('0x6')](),controller[_0xd339('0xa')]);router[_0xd339('0xb')]('/',auth[_0xd339('0x6')](),controller[_0xd339('0xc')]);router[_0xd339('0xd')](_0xd339('0xe'),auth['isAuthenticated'](),controller[_0xd339('0xf')]);router[_0xd339('0x10')](_0xd339('0xe'),auth['isAuthenticated'](),controller[_0xd339('0x11')]);module[_0xd339('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 2ce371c..e7b9ff7 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 _0xfc03=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfc03,0x99));var _0x3fc0=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xfc03[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3fc0('0x0'));module[_0x3fc0('0x1')]={'type':{'type':Sequelize[_0x3fc0('0x2')]},'uniqueid':{'type':Sequelize[_0x3fc0('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3fc0('0x2')]},'queue':{'type':Sequelize[_0x3fc0('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3fc0('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3fc0('0x3')],'set':function(_0x3d9bf7){var _0x5b448c=moment(_0x3d9bf7);var _0x42772c=moment(this['getDataValue'](_0x3fc0('0x4')))['format'](_0x3fc0('0x5'));var _0x5b3669=_0x5b448c[_0x3fc0('0x6')](_0x42772c,_0x3fc0('0x7'));this[_0x3fc0('0x8')](_0x3fc0('0x9'),_0x3d9bf7);this[_0x3fc0('0x8')](_0x3fc0('0xa'),_0x5b3669||null);}},'position':{'type':Sequelize[_0x3fc0('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3fc0('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x3fc0('0x2')],'comment':_0x3fc0('0xd')},'originalposition':{'type':Sequelize[_0x3fc0('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3fc0('0x2')]},'accountcode':{'type':Sequelize[_0x3fc0('0x2')]},'context':{'type':Sequelize[_0x3fc0('0x2')]},'exten':{'type':Sequelize[_0x3fc0('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x3fc0('0xb')]},'mohtime':{'type':Sequelize[_0x3fc0('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3fc0('0x2')]},'transfer':{'type':Sequelize[_0x3fc0('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3fc0('0xe')},'transferexten':{'type':Sequelize[_0x3fc0('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3fc0('0x2')]},'disposition':{'type':Sequelize[_0x3fc0('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3fc0('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0149=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment'];(function(_0x55e43d,_0x47ce24){var _0x191ac2=function(_0xb7dc6e){while(--_0xb7dc6e){_0x55e43d['push'](_0x55e43d['shift']());}};_0x191ac2(++_0x47ce24);}(_0x0149,0x77));var _0x9014=function(_0x1489e1,_0x5c1b01){_0x1489e1=_0x1489e1-0x0;var _0x1f344d=_0x0149[_0x1489e1];return _0x1f344d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9014('0x0'));module[_0x9014('0x1')]={'type':{'type':Sequelize[_0x9014('0x2')]},'uniqueid':{'type':Sequelize[_0x9014('0x2')]},'calleridnum':{'type':Sequelize[_0x9014('0x2')]},'calleridname':{'type':Sequelize[_0x9014('0x2')]},'queue':{'type':Sequelize[_0x9014('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x9014('0x3')],'set':function(_0x5cf33e){var _0x4fabb9=moment(_0x5cf33e);var _0x5f30f4=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x9014('0x4'));var _0x405150=_0x4fabb9[_0x9014('0x5')](_0x5f30f4,'seconds');this[_0x9014('0x6')]('queuecallerleaveAt',_0x5cf33e);this[_0x9014('0x6')](_0x9014('0x7'),_0x405150||null);}},'position':{'type':Sequelize[_0x9014('0x8')]},'count':{'type':Sequelize[_0x9014('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x9014('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9014('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x9014('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9014('0x3')]},'queuecallerexit':{'type':Sequelize[_0x9014('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9014('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x9014('0x2')],'comment':_0x9014('0xa')},'originalposition':{'type':Sequelize[_0x9014('0x8')]},'channel':{'type':Sequelize[_0x9014('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9014('0x2')]},'accountcode':{'type':Sequelize[_0x9014('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x9014('0x2')]},'priority':{'type':Sequelize[_0x9014('0x2')]},'holdtime':{'type':Sequelize[_0x9014('0x8')]},'mohtime':{'type':Sequelize[_0x9014('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9014('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9014('0x2')]},'transfer':{'type':Sequelize[_0x9014('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9014('0x2')],'comment':_0x9014('0xb')},'transferexten':{'type':Sequelize[_0x9014('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9014('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9014('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x9014('0x8')],'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 2c2c30d..306395d 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 _0xfdc0=['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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','error','name','send','index','map','VoiceQueueReport','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','length','create','body','update','find','describe','getVoiceQueuesReport','order','rows','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfdc0,0x1ee));var _0x0fdc=function(_0x17f145,_0x3422bb){_0x17f145=_0x17f145-0x0;var _0x2d5420=_0xfdc0[_0x17f145];return _0x2d5420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fdc('0x0'));var zipdir=require(_0x0fdc('0x1'));var jsonpatch=require(_0x0fdc('0x2'));var rp=require('request-promise');var moment=require(_0x0fdc('0x3'));var BPromise=require(_0x0fdc('0x4'));var Mustache=require(_0x0fdc('0x5'));var util=require(_0x0fdc('0x6'));var path=require('path');var sox=require(_0x0fdc('0x7'));var csv=require(_0x0fdc('0x8'));var ejs=require(_0x0fdc('0x9'));var fs=require('fs');var fs_extra=require(_0x0fdc('0xa'));var _=require(_0x0fdc('0xb'));var squel=require(_0x0fdc('0xc'));var crypto=require(_0x0fdc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0fdc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0fdc('0xf'));var Papa=require('papaparse');var Redis=require(_0x0fdc('0x10'));var authService=require(_0x0fdc('0x11'));var qs=require(_0x0fdc('0x12'));var as=require(_0x0fdc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fdc('0x14'))('api');var utils=require(_0x0fdc('0x15'));var config=require(_0x0fdc('0x16'));var licenseUtil=require(_0x0fdc('0x17'));var db=require(_0x0fdc('0x18'))['db'];config[_0x0fdc('0x19')]=_[_0x0fdc('0x1a')](config['redis'],{'host':_0x0fdc('0x1b'),'port':0x18eb});var socket=require(_0x0fdc('0x1c'))(new Redis(config[_0x0fdc('0x19')]));require(_0x0fdc('0x1d'))[_0x0fdc('0x1e')](socket);function respondWithStatusCode(_0xf7b8be,_0x582f8c){_0x582f8c=_0x582f8c||0xcc;return function(_0x5a4122){if(_0x5a4122){return _0xf7b8be[_0x0fdc('0x1f')](_0x582f8c);}return _0xf7b8be[_0x0fdc('0x20')](_0x582f8c)[_0x0fdc('0x21')]();};}function respondWithResult(_0x56e0d1,_0x371723){_0x371723=_0x371723||0xc8;return function(_0x41092f){if(_0x41092f){return _0x56e0d1[_0x0fdc('0x20')](_0x371723)[_0x0fdc('0x22')](_0x41092f);}};}function respondWithFilteredResult(_0x2fdbcf,_0x30799e){return function(_0x3e302a){if(_0x3e302a){var _0x1c5b60=typeof _0x30799e[_0x0fdc('0x23')]==='undefined'&&typeof _0x30799e[_0x0fdc('0x24')]===_0x0fdc('0x25');var _0x15ed6e=_0x3e302a[_0x0fdc('0x26')];var _0x107524=_0x1c5b60?0x0:_0x30799e[_0x0fdc('0x23')];var _0x385fac=_0x1c5b60?_0x3e302a[_0x0fdc('0x26')]:_0x30799e[_0x0fdc('0x23')]+_0x30799e['limit'];var _0x115057;if(_0x385fac>=_0x15ed6e){_0x385fac=_0x15ed6e;_0x115057=0xc8;}else{_0x115057=0xce;}_0x2fdbcf[_0x0fdc('0x20')](_0x115057);return _0x2fdbcf[_0x0fdc('0x27')](_0x0fdc('0x28'),_0x107524+'-'+_0x385fac+'/'+_0x15ed6e)[_0x0fdc('0x22')](_0x3e302a);}return null;};}function patchUpdates(_0x60c5a1){return function(_0x4f3219){try{jsonpatch['apply'](_0x4f3219,_0x60c5a1,!![]);}catch(_0x3fd149){return BPromise['reject'](_0x3fd149);}return _0x4f3219[_0x0fdc('0x29')]();};}function saveUpdates(_0x293905,_0x275437){return function(_0x4f4fb9){if(_0x4f4fb9){return _0x4f4fb9['update'](_0x293905)[_0x0fdc('0x2a')](function(_0x4e42af){return _0x4e42af;});}return null;};}function removeEntity(_0x5c4fef,_0x5922cf){return function(_0x2e8012){if(_0x2e8012){return _0x2e8012[_0x0fdc('0x2b')]()[_0x0fdc('0x2a')](function(){_0x5c4fef[_0x0fdc('0x20')](0xcc)[_0x0fdc('0x21')]();});}};}function handleEntityNotFound(_0x429865,_0xf0130e){return function(_0x467b5c){if(!_0x467b5c){_0x429865['sendStatus'](0x194);}return _0x467b5c;};}function handleError(_0x2b70fe,_0x3faa69){_0x3faa69=_0x3faa69||0x1f4;return function(_0x47fbe5){logger[_0x0fdc('0x2c')](_0x47fbe5['stack']);if(_0x47fbe5[_0x0fdc('0x2d')]){delete _0x47fbe5[_0x0fdc('0x2d')];}_0x2b70fe[_0x0fdc('0x20')](_0x3faa69)[_0x0fdc('0x2e')](_0x47fbe5);};}exports[_0x0fdc('0x2f')]=function(_0x2cf553,_0x138727){var _0xa502cd={},_0x744890={},_0x350e15={'count':0x0,'rows':[]};var _0x280474=_[_0x0fdc('0x30')](db[_0x0fdc('0x31')]['rawAttributes'],function(_0xf94683){return{'name':_0xf94683['fieldName'],'type':_0xf94683[_0x0fdc('0x32')]['key']};});_0x744890[_0x0fdc('0x33')]=_['map'](_0x280474,_0x0fdc('0x2d'));_0x744890[_0x0fdc('0x34')]=_[_0x0fdc('0x35')](_0x2cf553[_0x0fdc('0x34')]);_0x744890[_0x0fdc('0x36')]=_[_0x0fdc('0x37')](_0x744890['model'],_0x744890[_0x0fdc('0x34')]);_0xa502cd[_0x0fdc('0x38')]=_[_0x0fdc('0x37')](_0x744890[_0x0fdc('0x33')],qs['fields'](_0x2cf553[_0x0fdc('0x34')]['fields']));_0xa502cd['attributes']=_0xa502cd['attributes']['length']?_0xa502cd[_0x0fdc('0x38')]:_0x744890[_0x0fdc('0x33')];if(!_0x2cf553['query'][_0x0fdc('0x39')](_0x0fdc('0x3a'))){_0xa502cd['limit']=qs[_0x0fdc('0x24')](_0x2cf553['query'][_0x0fdc('0x24')]);_0xa502cd[_0x0fdc('0x23')]=qs[_0x0fdc('0x23')](_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x23')]);}_0xa502cd['order']=qs[_0x0fdc('0x3b')](_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x3b')]);_0xa502cd['where']=qs['filters'](_[_0x0fdc('0x3c')](_0x2cf553[_0x0fdc('0x34')],_0x744890['filters']),_0x280474);if(_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x3d')]){_0xa502cd[_0x0fdc('0x3e')]=_[_0x0fdc('0x3f')](_0xa502cd[_0x0fdc('0x3e')],{'$or':_['map'](_0x280474,function(_0x5207c7){if(_0x5207c7[_0x0fdc('0x32')]!==_0x0fdc('0x40')){var _0x54ae2e={};_0x54ae2e[_0x5207c7[_0x0fdc('0x2d')]]={'$like':'%'+_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x3d')]+'%'};return _0x54ae2e;}})});}_0xa502cd=_[_0x0fdc('0x3f')]({},_0xa502cd,_0x2cf553[_0x0fdc('0x41')]);var _0x2d0914={'where':_0xa502cd[_0x0fdc('0x3e')]};return db[_0x0fdc('0x31')][_0x0fdc('0x26')](_0x2d0914)[_0x0fdc('0x2a')](function(_0x3de54e){_0x350e15[_0x0fdc('0x26')]=_0x3de54e;if(_0x2cf553[_0x0fdc('0x34')][_0x0fdc('0x42')]){_0xa502cd[_0x0fdc('0x43')]=[{'all':!![]}];}return db[_0x0fdc('0x31')][_0x0fdc('0x44')](_0xa502cd);})[_0x0fdc('0x2a')](function(_0x2d4d9f){_0x350e15['rows']=_0x2d4d9f;return _0x350e15;})['then'](respondWithFilteredResult(_0x138727,_0xa502cd))[_0x0fdc('0x45')](handleError(_0x138727,null));};exports[_0x0fdc('0x46')]=function(_0x3e8276,_0x48b007){var _0x1cf498={'raw':![],'where':{'id':_0x3e8276[_0x0fdc('0x47')]['id']}},_0x178b2a={};_0x178b2a[_0x0fdc('0x33')]=_[_0x0fdc('0x35')](db[_0x0fdc('0x31')][_0x0fdc('0x48')]);_0x178b2a[_0x0fdc('0x34')]=_[_0x0fdc('0x35')](_0x3e8276[_0x0fdc('0x34')]);_0x178b2a[_0x0fdc('0x36')]=_[_0x0fdc('0x37')](_0x178b2a[_0x0fdc('0x33')],_0x178b2a[_0x0fdc('0x34')]);_0x1cf498[_0x0fdc('0x38')]=_[_0x0fdc('0x37')](_0x178b2a[_0x0fdc('0x33')],qs['fields'](_0x3e8276[_0x0fdc('0x34')][_0x0fdc('0x49')]));_0x1cf498[_0x0fdc('0x38')]=_0x1cf498[_0x0fdc('0x38')][_0x0fdc('0x4a')]?_0x1cf498[_0x0fdc('0x38')]:_0x178b2a[_0x0fdc('0x33')];if(_0x3e8276[_0x0fdc('0x34')][_0x0fdc('0x42')]){_0x1cf498[_0x0fdc('0x43')]=[{'all':!![]}];}_0x1cf498=_[_0x0fdc('0x3f')]({},_0x1cf498,_0x3e8276[_0x0fdc('0x41')]);return db[_0x0fdc('0x31')]['find'](_0x1cf498)[_0x0fdc('0x2a')](handleEntityNotFound(_0x48b007,null))['then'](respondWithResult(_0x48b007,null))[_0x0fdc('0x45')](handleError(_0x48b007,null));};exports[_0x0fdc('0x4b')]=function(_0x24bfef,_0x37bfd4){return db[_0x0fdc('0x31')][_0x0fdc('0x4b')](_0x24bfef[_0x0fdc('0x4c')],{})['then'](respondWithResult(_0x37bfd4,0xc9))[_0x0fdc('0x45')](handleError(_0x37bfd4,null));};exports[_0x0fdc('0x4d')]=function(_0x18bd3e,_0x1dd527){if(_0x18bd3e['body']['id']){delete _0x18bd3e[_0x0fdc('0x4c')]['id'];}return db[_0x0fdc('0x31')][_0x0fdc('0x4e')]({'where':{'id':_0x18bd3e['params']['id']}})[_0x0fdc('0x2a')](handleEntityNotFound(_0x1dd527,null))[_0x0fdc('0x2a')](saveUpdates(_0x18bd3e[_0x0fdc('0x4c')],null))[_0x0fdc('0x2a')](respondWithResult(_0x1dd527,null))['catch'](handleError(_0x1dd527,null));};exports['destroy']=function(_0x7ca560,_0x50ae68){return db[_0x0fdc('0x31')]['find']({'where':{'id':_0x7ca560[_0x0fdc('0x47')]['id']}})['then'](handleEntityNotFound(_0x50ae68,null))[_0x0fdc('0x2a')](removeEntity(_0x50ae68,null))[_0x0fdc('0x45')](handleError(_0x50ae68,null));};exports[_0x0fdc('0x4f')]=function(_0x1942b5,_0x33842f){return db[_0x0fdc('0x31')][_0x0fdc('0x4f')]()[_0x0fdc('0x2a')](respondWithResult(_0x33842f,null))[_0x0fdc('0x45')](handleError(_0x33842f,null));};exports[_0x0fdc('0x50')]=function(_0x9f9f41,_0x1115ad){var _0x44baed={},_0x406f46={},_0x452b71={'count':0x0,'rows':[]};_0x406f46[_0x0fdc('0x33')]=_['keys'](db[_0x0fdc('0x31')][_0x0fdc('0x48')]);_0x406f46['query']=_[_0x0fdc('0x35')](_0x9f9f41['query']);_0x406f46[_0x0fdc('0x36')]=_[_0x0fdc('0x37')](_0x406f46[_0x0fdc('0x33')],_0x406f46[_0x0fdc('0x34')]);_0x44baed[_0x0fdc('0x38')]=_[_0x0fdc('0x37')](_0x406f46[_0x0fdc('0x33')],qs['fields'](_0x9f9f41[_0x0fdc('0x34')]['fields']));_0x44baed[_0x0fdc('0x38')]=_0x44baed['attributes'][_0x0fdc('0x4a')]?_0x44baed[_0x0fdc('0x38')]:_0x406f46[_0x0fdc('0x33')];if(!_0x9f9f41['query'][_0x0fdc('0x39')](_0x0fdc('0x3a'))){_0x44baed['limit']=qs[_0x0fdc('0x24')](_0x9f9f41['query'][_0x0fdc('0x24')]);_0x44baed[_0x0fdc('0x23')]=qs[_0x0fdc('0x23')](_0x9f9f41[_0x0fdc('0x34')][_0x0fdc('0x23')]);}_0x44baed[_0x0fdc('0x51')]=qs[_0x0fdc('0x3b')](_0x9f9f41['query'][_0x0fdc('0x3b')]);_0x44baed[_0x0fdc('0x3e')]=qs[_0x0fdc('0x36')](_['pick'](_0x9f9f41[_0x0fdc('0x34')],_0x406f46[_0x0fdc('0x36')]));if(_0x9f9f41['query'][_0x0fdc('0x3d')]){_0x44baed['where']=_['merge'](_0x44baed[_0x0fdc('0x3e')],{'$or':_[_0x0fdc('0x30')](_0x44baed[_0x0fdc('0x38')],function(_0xb644de){var _0x5561ab={};_0x5561ab[_0xb644de]={'$like':'%'+_0x9f9f41['query'][_0x0fdc('0x3d')]+'%'};return _0x5561ab;})});}_0x44baed=_[_0x0fdc('0x3f')]({},_0x44baed,_0x9f9f41[_0x0fdc('0x41')]);var _0x56fa99={'where':_0x44baed['where']};return db['VoiceQueueReport'][_0x0fdc('0x26')](_0x56fa99)['then'](function(_0x118d5f){_0x452b71[_0x0fdc('0x26')]=_0x118d5f;if(_0x9f9f41[_0x0fdc('0x34')][_0x0fdc('0x42')]){_0x44baed[_0x0fdc('0x43')]=[{'all':!![]}];}return db[_0x0fdc('0x31')][_0x0fdc('0x44')](_0x44baed);})[_0x0fdc('0x2a')](function(_0x5f0b9d){_0x452b71[_0x0fdc('0x52')]=_0x5f0b9d;return _0x452b71;})[_0x0fdc('0x2a')](respondWithFilteredResult(_0x1115ad,_0x44baed,_0x0fdc('0x50')))['catch'](handleError(_0x1115ad,null,_0x0fdc('0x50')));}; \ No newline at end of file +var _0xdd68=['fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','create','body','find','params','destroy','describe','filter','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','status','index','map','VoiceQueueReport','rawAttributes'];(function(_0x16a967,_0x2d6c86){var _0x523bc5=function(_0x57e51e){while(--_0x57e51e){_0x16a967['push'](_0x16a967['shift']());}};_0x523bc5(++_0x2d6c86);}(_0xdd68,0x76));var _0x8dd6=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0xdd68[_0x4cee4b];return _0x4d891d;};'use strict';var emlformat=require(_0x8dd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dd6('0x1'));var jsonpatch=require(_0x8dd6('0x2'));var rp=require(_0x8dd6('0x3'));var moment=require('moment');var BPromise=require(_0x8dd6('0x4'));var Mustache=require(_0x8dd6('0x5'));var util=require('util');var path=require(_0x8dd6('0x6'));var sox=require(_0x8dd6('0x7'));var csv=require(_0x8dd6('0x8'));var ejs=require(_0x8dd6('0x9'));var fs=require('fs');var fs_extra=require(_0x8dd6('0xa'));var _=require(_0x8dd6('0xb'));var squel=require(_0x8dd6('0xc'));var crypto=require(_0x8dd6('0xd'));var jsforce=require(_0x8dd6('0xe'));var deskjs=require(_0x8dd6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8dd6('0x10'));var Papa=require(_0x8dd6('0x11'));var Redis=require(_0x8dd6('0x12'));var authService=require(_0x8dd6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8dd6('0x14'));var hardwareService=require(_0x8dd6('0x15'));var logger=require(_0x8dd6('0x16'))(_0x8dd6('0x17'));var utils=require(_0x8dd6('0x18'));var config=require(_0x8dd6('0x19'));var licenseUtil=require(_0x8dd6('0x1a'));var db=require(_0x8dd6('0x1b'))['db'];config[_0x8dd6('0x1c')]=_['defaults'](config[_0x8dd6('0x1c')],{'host':_0x8dd6('0x1d'),'port':0x18eb});var socket=require(_0x8dd6('0x1e'))(new Redis(config[_0x8dd6('0x1c')]));require(_0x8dd6('0x1f'))['register'](socket);function respondWithStatusCode(_0x202cba,_0x256ed2){_0x256ed2=_0x256ed2||0xcc;return function(_0x5703e1){if(_0x5703e1){return _0x202cba['sendStatus'](_0x256ed2);}return _0x202cba['status'](_0x256ed2)[_0x8dd6('0x20')]();};}function respondWithResult(_0x2898ee,_0x13d2e9){_0x13d2e9=_0x13d2e9||0xc8;return function(_0x40e300){if(_0x40e300){return _0x2898ee['status'](_0x13d2e9)[_0x8dd6('0x21')](_0x40e300);}};}function respondWithFilteredResult(_0x3ce987,_0x27ac37){return function(_0x36fcf0){if(_0x36fcf0){var _0x3270a2=typeof _0x27ac37[_0x8dd6('0x22')]===_0x8dd6('0x23')&&typeof _0x27ac37['limit']===_0x8dd6('0x23');var _0x471f45=_0x36fcf0[_0x8dd6('0x24')];var _0x1f7dc2=_0x3270a2?0x0:_0x27ac37[_0x8dd6('0x22')];var _0x2a68f7=_0x3270a2?_0x36fcf0[_0x8dd6('0x24')]:_0x27ac37[_0x8dd6('0x22')]+_0x27ac37[_0x8dd6('0x25')];var _0x1b26d3;if(_0x2a68f7>=_0x471f45){_0x2a68f7=_0x471f45;_0x1b26d3=0xc8;}else{_0x1b26d3=0xce;}_0x3ce987['status'](_0x1b26d3);return _0x3ce987[_0x8dd6('0x26')](_0x8dd6('0x27'),_0x1f7dc2+'-'+_0x2a68f7+'/'+_0x471f45)[_0x8dd6('0x21')](_0x36fcf0);}return null;};}function patchUpdates(_0x1fb40f){return function(_0x4e5d71){try{jsonpatch[_0x8dd6('0x28')](_0x4e5d71,_0x1fb40f,!![]);}catch(_0x4cedfc){return BPromise[_0x8dd6('0x29')](_0x4cedfc);}return _0x4e5d71[_0x8dd6('0x2a')]();};}function saveUpdates(_0x504164,_0x5dc4d1){return function(_0x79327d){if(_0x79327d){return _0x79327d[_0x8dd6('0x2b')](_0x504164)[_0x8dd6('0x2c')](function(_0xc20006){return _0xc20006;});}return null;};}function removeEntity(_0x28bd42,_0x4f2b82){return function(_0x1388e5){if(_0x1388e5){return _0x1388e5['destroy']()[_0x8dd6('0x2c')](function(){_0x28bd42['status'](0xcc)[_0x8dd6('0x20')]();});}};}function handleEntityNotFound(_0x4176dd,_0x216e1b){return function(_0x3df9b1){if(!_0x3df9b1){_0x4176dd['sendStatus'](0x194);}return _0x3df9b1;};}function handleError(_0x13c828,_0x36f0b8){_0x36f0b8=_0x36f0b8||0x1f4;return function(_0x3b7b28){logger['error'](_0x3b7b28[_0x8dd6('0x2d')]);if(_0x3b7b28[_0x8dd6('0x2e')]){delete _0x3b7b28[_0x8dd6('0x2e')];}_0x13c828[_0x8dd6('0x2f')](_0x36f0b8)['send'](_0x3b7b28);};}exports[_0x8dd6('0x30')]=function(_0x149837,_0x1dc5ff){var _0x522ccd={},_0x4fdfc8={},_0x4cad25={'count':0x0,'rows':[]};var _0x5b4734=_[_0x8dd6('0x31')](db[_0x8dd6('0x32')][_0x8dd6('0x33')],function(_0x7747ec){return{'name':_0x7747ec[_0x8dd6('0x34')],'type':_0x7747ec['type'][_0x8dd6('0x35')]};});_0x4fdfc8[_0x8dd6('0x36')]=_['map'](_0x5b4734,'name');_0x4fdfc8[_0x8dd6('0x37')]=_['keys'](_0x149837['query']);_0x4fdfc8[_0x8dd6('0x38')]=_[_0x8dd6('0x39')](_0x4fdfc8[_0x8dd6('0x36')],_0x4fdfc8['query']);_0x522ccd['attributes']=_[_0x8dd6('0x39')](_0x4fdfc8['model'],qs[_0x8dd6('0x3a')](_0x149837[_0x8dd6('0x37')][_0x8dd6('0x3a')]));_0x522ccd[_0x8dd6('0x3b')]=_0x522ccd['attributes'][_0x8dd6('0x3c')]?_0x522ccd[_0x8dd6('0x3b')]:_0x4fdfc8[_0x8dd6('0x36')];if(!_0x149837[_0x8dd6('0x37')][_0x8dd6('0x3d')](_0x8dd6('0x3e'))){_0x522ccd[_0x8dd6('0x25')]=qs[_0x8dd6('0x25')](_0x149837['query'][_0x8dd6('0x25')]);_0x522ccd[_0x8dd6('0x22')]=qs['offset'](_0x149837[_0x8dd6('0x37')][_0x8dd6('0x22')]);}_0x522ccd['order']=qs[_0x8dd6('0x3f')](_0x149837[_0x8dd6('0x37')][_0x8dd6('0x3f')]);_0x522ccd[_0x8dd6('0x40')]=qs[_0x8dd6('0x38')](_[_0x8dd6('0x41')](_0x149837[_0x8dd6('0x37')],_0x4fdfc8['filters']),_0x5b4734);if(_0x149837[_0x8dd6('0x37')]['filter']){_0x522ccd[_0x8dd6('0x40')]=_[_0x8dd6('0x42')](_0x522ccd[_0x8dd6('0x40')],{'$or':_['map'](_0x5b4734,function(_0x1cc555){if(_0x1cc555[_0x8dd6('0x43')]!==_0x8dd6('0x44')){var _0x13fdd5={};_0x13fdd5[_0x1cc555[_0x8dd6('0x2e')]]={'$like':'%'+_0x149837[_0x8dd6('0x37')]['filter']+'%'};return _0x13fdd5;}})});}_0x522ccd=_['merge']({},_0x522ccd,_0x149837[_0x8dd6('0x45')]);var _0x44e203={'where':_0x522ccd['where']};return db['VoiceQueueReport']['count'](_0x44e203)[_0x8dd6('0x2c')](function(_0x15ce9c){_0x4cad25[_0x8dd6('0x24')]=_0x15ce9c;if(_0x149837[_0x8dd6('0x37')]['includeAll']){_0x522ccd[_0x8dd6('0x46')]=[{'all':!![]}];}return db[_0x8dd6('0x32')][_0x8dd6('0x47')](_0x522ccd);})[_0x8dd6('0x2c')](function(_0x1a965){_0x4cad25[_0x8dd6('0x48')]=_0x1a965;return _0x4cad25;})[_0x8dd6('0x2c')](respondWithFilteredResult(_0x1dc5ff,_0x522ccd))[_0x8dd6('0x49')](handleError(_0x1dc5ff,null));};exports[_0x8dd6('0x4a')]=function(_0x2f67d9,_0x303b5c){var _0x38e765={'raw':![],'where':{'id':_0x2f67d9['params']['id']}},_0x7d290b={};_0x7d290b[_0x8dd6('0x36')]=_[_0x8dd6('0x4b')](db[_0x8dd6('0x32')][_0x8dd6('0x33')]);_0x7d290b[_0x8dd6('0x37')]=_[_0x8dd6('0x4b')](_0x2f67d9[_0x8dd6('0x37')]);_0x7d290b[_0x8dd6('0x38')]=_['intersection'](_0x7d290b[_0x8dd6('0x36')],_0x7d290b['query']);_0x38e765[_0x8dd6('0x3b')]=_[_0x8dd6('0x39')](_0x7d290b[_0x8dd6('0x36')],qs['fields'](_0x2f67d9['query'][_0x8dd6('0x3a')]));_0x38e765[_0x8dd6('0x3b')]=_0x38e765[_0x8dd6('0x3b')][_0x8dd6('0x3c')]?_0x38e765[_0x8dd6('0x3b')]:_0x7d290b[_0x8dd6('0x36')];if(_0x2f67d9[_0x8dd6('0x37')][_0x8dd6('0x4c')]){_0x38e765[_0x8dd6('0x46')]=[{'all':!![]}];}_0x38e765=_[_0x8dd6('0x42')]({},_0x38e765,_0x2f67d9['options']);return db[_0x8dd6('0x32')]['find'](_0x38e765)[_0x8dd6('0x2c')](handleEntityNotFound(_0x303b5c,null))[_0x8dd6('0x2c')](respondWithResult(_0x303b5c,null))[_0x8dd6('0x49')](handleError(_0x303b5c,null));};exports[_0x8dd6('0x4d')]=function(_0x258667,_0xcd6ecb){return db[_0x8dd6('0x32')][_0x8dd6('0x4d')](_0x258667['body'],{})[_0x8dd6('0x2c')](respondWithResult(_0xcd6ecb,0xc9))[_0x8dd6('0x49')](handleError(_0xcd6ecb,null));};exports['update']=function(_0x15b363,_0x4106a9){if(_0x15b363[_0x8dd6('0x4e')]['id']){delete _0x15b363[_0x8dd6('0x4e')]['id'];}return db['VoiceQueueReport'][_0x8dd6('0x4f')]({'where':{'id':_0x15b363[_0x8dd6('0x50')]['id']}})[_0x8dd6('0x2c')](handleEntityNotFound(_0x4106a9,null))[_0x8dd6('0x2c')](saveUpdates(_0x15b363[_0x8dd6('0x4e')],null))[_0x8dd6('0x2c')](respondWithResult(_0x4106a9,null))[_0x8dd6('0x49')](handleError(_0x4106a9,null));};exports[_0x8dd6('0x51')]=function(_0x18a2a7,_0x3d4d96){return db['VoiceQueueReport']['find']({'where':{'id':_0x18a2a7[_0x8dd6('0x50')]['id']}})[_0x8dd6('0x2c')](handleEntityNotFound(_0x3d4d96,null))[_0x8dd6('0x2c')](removeEntity(_0x3d4d96,null))[_0x8dd6('0x49')](handleError(_0x3d4d96,null));};exports[_0x8dd6('0x52')]=function(_0x13df47,_0x458b54){return db[_0x8dd6('0x32')][_0x8dd6('0x52')]()[_0x8dd6('0x2c')](respondWithResult(_0x458b54,null))['catch'](handleError(_0x458b54,null));};exports['getVoiceQueuesReport']=function(_0x39cbdd,_0x5de240){var _0x2c8cd9={},_0x2eb7d8={},_0x37bdd3={'count':0x0,'rows':[]};_0x2eb7d8[_0x8dd6('0x36')]=_[_0x8dd6('0x4b')](db[_0x8dd6('0x32')][_0x8dd6('0x33')]);_0x2eb7d8[_0x8dd6('0x37')]=_[_0x8dd6('0x4b')](_0x39cbdd[_0x8dd6('0x37')]);_0x2eb7d8[_0x8dd6('0x38')]=_[_0x8dd6('0x39')](_0x2eb7d8[_0x8dd6('0x36')],_0x2eb7d8[_0x8dd6('0x37')]);_0x2c8cd9['attributes']=_[_0x8dd6('0x39')](_0x2eb7d8['model'],qs[_0x8dd6('0x3a')](_0x39cbdd[_0x8dd6('0x37')][_0x8dd6('0x3a')]));_0x2c8cd9[_0x8dd6('0x3b')]=_0x2c8cd9[_0x8dd6('0x3b')][_0x8dd6('0x3c')]?_0x2c8cd9[_0x8dd6('0x3b')]:_0x2eb7d8[_0x8dd6('0x36')];if(!_0x39cbdd['query'][_0x8dd6('0x3d')](_0x8dd6('0x3e'))){_0x2c8cd9['limit']=qs[_0x8dd6('0x25')](_0x39cbdd['query']['limit']);_0x2c8cd9[_0x8dd6('0x22')]=qs[_0x8dd6('0x22')](_0x39cbdd[_0x8dd6('0x37')][_0x8dd6('0x22')]);}_0x2c8cd9['order']=qs[_0x8dd6('0x3f')](_0x39cbdd['query'][_0x8dd6('0x3f')]);_0x2c8cd9[_0x8dd6('0x40')]=qs['filters'](_['pick'](_0x39cbdd[_0x8dd6('0x37')],_0x2eb7d8[_0x8dd6('0x38')]));if(_0x39cbdd[_0x8dd6('0x37')][_0x8dd6('0x53')]){_0x2c8cd9[_0x8dd6('0x40')]=_['merge'](_0x2c8cd9[_0x8dd6('0x40')],{'$or':_[_0x8dd6('0x31')](_0x2c8cd9['attributes'],function(_0x4be499){var _0xb36bc={};_0xb36bc[_0x4be499]={'$like':'%'+_0x39cbdd['query']['filter']+'%'};return _0xb36bc;})});}_0x2c8cd9=_[_0x8dd6('0x42')]({},_0x2c8cd9,_0x39cbdd[_0x8dd6('0x45')]);var _0x5973fc={'where':_0x2c8cd9[_0x8dd6('0x40')]};return db['VoiceQueueReport']['count'](_0x5973fc)[_0x8dd6('0x2c')](function(_0x2a3f15){_0x37bdd3['count']=_0x2a3f15;if(_0x39cbdd[_0x8dd6('0x37')]['includeAll']){_0x2c8cd9['include']=[{'all':!![]}];}return db[_0x8dd6('0x32')][_0x8dd6('0x47')](_0x2c8cd9);})['then'](function(_0x4109b3){_0x37bdd3[_0x8dd6('0x48')]=_0x4109b3;return _0x37bdd3;})[_0x8dd6('0x2c')](respondWithFilteredResult(_0x5de240,_0x2c8cd9,_0x8dd6('0x54')))[_0x8dd6('0x49')](handleError(_0x5de240,null,_0x8dd6('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index fa3541e..b672b71 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 _0xf5e3=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3868b6,_0x2f1a0b){var _0xd0105b=function(_0x283c33){while(--_0x283c33){_0x3868b6['push'](_0x3868b6['shift']());}};_0xd0105b(++_0x2f1a0b);}(_0xf5e3,0x121));var _0x3f5e=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xf5e3[_0x532112];return _0x23e5fb;};'use strict';var EventEmitter=require(_0x3f5e('0x0'));var VoiceQueueReport=require(_0x3f5e('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3f5e('0x2')](0x0);var events={'afterCreate':_0x3f5e('0x3'),'afterUpdate':_0x3f5e('0x4'),'afterDestroy':_0x3f5e('0x5')};function emitEvent(_0x40aa65){return function(_0x3286ee,_0x4ef30b,_0x33f63d){VoiceQueueReportEvents[_0x3f5e('0x6')](_0x40aa65+':'+_0x3286ee['id'],_0x3286ee);VoiceQueueReportEvents[_0x3f5e('0x6')](_0x40aa65,_0x3286ee);_0x33f63d(null);};}for(var e in events){if(events[_0x3f5e('0x7')](e)){var event=events[e];VoiceQueueReport[_0x3f5e('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xdc1e=['remove','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0xdc1e,0x1a8));var _0xedc1=function(_0x5d3532,_0x349565){_0x5d3532=_0x5d3532-0x0;var _0x2231f6=_0xdc1e[_0x5d3532];return _0x2231f6;};'use strict';var EventEmitter=require(_0xedc1('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xedc1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xedc1('0x2')};function emitEvent(_0x14beb3){return function(_0x501e6c,_0x66a56e,_0xbb4fc){VoiceQueueReportEvents[_0xedc1('0x3')](_0x14beb3+':'+_0x501e6c['id'],_0x501e6c);VoiceQueueReportEvents[_0xedc1('0x3')](_0x14beb3,_0x501e6c);_0xbb4fc(null);};}for(var e in events){if(events[_0xedc1('0x4')](e)){var event=events[e];VoiceQueueReport[_0xedc1('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0509875..5c4dacc 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 _0x383d=['calleridnum','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue'];(function(_0x3414b3,_0x59a357){var _0x6be9a9=function(_0xba241b){while(--_0xba241b){_0x3414b3['push'](_0x3414b3['shift']());}};_0x6be9a9(++_0x59a357);}(_0x383d,0x139));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xd383('0x0'));var logger=require(_0xd383('0x1'))('api');var moment=require(_0xd383('0x2'));var BPromise=require(_0xd383('0x3'));var rp=require(_0xd383('0x4'));var fs=require('fs');var path=require(_0xd383('0x5'));var rimraf=require(_0xd383('0x6'));var config=require(_0xd383('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xd383('0x8')]=function(_0x1c0def,_0x3e819e){return _0x1c0def[_0xd383('0x9')](_0xd383('0xa'),attributes,{'tableName':_0xd383('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd383('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8591=['define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x124a03,_0x25633e){var _0x4f3cbb=function(_0x24db35){while(--_0x24db35){_0x124a03['push'](_0x124a03['shift']());}};_0x4f3cbb(++_0x25633e);}(_0x8591,0x1c6));var _0x1859=function(_0x271b75,_0x124c76){_0x271b75=_0x271b75-0x0;var _0xcbf5a1=_0x8591[_0x271b75];return _0xcbf5a1;};'use strict';var _=require(_0x1859('0x0'));var util=require(_0x1859('0x1'));var logger=require(_0x1859('0x2'))(_0x1859('0x3'));var moment=require(_0x1859('0x4'));var BPromise=require('bluebird');var rp=require(_0x1859('0x5'));var fs=require('fs');var path=require(_0x1859('0x6'));var rimraf=require(_0x1859('0x7'));var config=require(_0x1859('0x8'));var attributes=require(_0x1859('0x9'));module[_0x1859('0xa')]=function(_0x15b5aa,_0x14ffe1){return _0x15b5aa[_0x1859('0xb')](_0x1859('0xc'),attributes,{'tableName':_0x1859('0xd'),'paranoid':![],'indexes':[{'fields':[_0x1859('0xe')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 4ae734d..32dfa5b 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 _0x0cb3=['./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x1829c6,_0x4d98fd){var _0x19a7a0=function(_0x1292d5){while(--_0x1292d5){_0x1829c6['push'](_0x1829c6['shift']());}};_0x19a7a0(++_0x4d98fd);}(_0x0cb3,0x73));var _0x30cb=function(_0x54ac0d,_0x425f1e){_0x54ac0d=_0x54ac0d-0x0;var _0x57df34=_0x0cb3[_0x54ac0d];return _0x57df34;};'use strict';var _=require(_0x30cb('0x0'));var util=require(_0x30cb('0x1'));var moment=require(_0x30cb('0x2'));var BPromise=require(_0x30cb('0x3'));var rs=require(_0x30cb('0x4'));var fs=require('fs');var Redis=require(_0x30cb('0x5'));var db=require(_0x30cb('0x6'))['db'];var utils=require(_0x30cb('0x7'));var logger=require(_0x30cb('0x8'))(_0x30cb('0x9'));var config=require(_0x30cb('0xa'));var jayson=require(_0x30cb('0xb'));var client=jayson[_0x30cb('0xc')]['http']({'port':0x232a});config[_0x30cb('0xd')]=_['defaults'](config[_0x30cb('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x30cb('0xd')]));require(_0x30cb('0xe'))[_0x30cb('0xf')](socket);function respondWithRpcPromise(_0x5c1ae3,_0x5ab9d0,_0x16d526){return new BPromise(function(_0x24a43a,_0x58fc2e){return client[_0x30cb('0x10')](_0x5c1ae3,_0x16d526)[_0x30cb('0x11')](function(_0x2543ea){logger[_0x30cb('0x12')](_0x30cb('0x13'),_0x5ab9d0,_0x30cb('0x14'));logger[_0x30cb('0x15')](_0x30cb('0x16'),_0x5ab9d0,_0x30cb('0x14'),JSON[_0x30cb('0x17')](_0x2543ea));if(_0x2543ea[_0x30cb('0x18')]){if(_0x2543ea[_0x30cb('0x18')]['code']===0x1f4){logger[_0x30cb('0x18')](_0x30cb('0x13'),_0x5ab9d0,_0x2543ea[_0x30cb('0x18')]['message']);return _0x58fc2e(_0x2543ea['error']['message']);}logger[_0x30cb('0x18')](_0x30cb('0x13'),_0x5ab9d0,_0x2543ea[_0x30cb('0x18')][_0x30cb('0x19')]);return _0x24a43a(_0x2543ea['error'][_0x30cb('0x19')]);}else{logger[_0x30cb('0x12')](_0x30cb('0x13'),_0x5ab9d0,_0x30cb('0x14'));_0x24a43a(_0x2543ea[_0x30cb('0x1a')][_0x30cb('0x19')]);}})[_0x30cb('0x1b')](function(_0x56a4fa){logger[_0x30cb('0x18')](_0x30cb('0x13'),_0x5ab9d0,_0x56a4fa);_0x58fc2e(_0x56a4fa);});});}exports[_0x30cb('0x1c')]=function(_0x21b723){var _0x14a8a6=this;return new Promise(function(_0x327851,_0x3db4f2){return db[_0x30cb('0x1d')][_0x30cb('0x1e')]({'raw':_0x21b723['options']?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x20')]===undefined?!![]:![]:!![],'where':_0x21b723['options']?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x21')]||null:null,'attributes':_0x21b723[_0x30cb('0x1f')]?_0x21b723['options'][_0x30cb('0x22')]||null:null,'limit':_0x21b723[_0x30cb('0x1f')]?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x23')]||null:null,'include':_0x21b723['options']?_0x21b723[_0x30cb('0x1f')][_0x30cb('0x24')]?_[_0x30cb('0x25')](_0x21b723[_0x30cb('0x1f')]['include'],function(_0x45ec72){return{'model':db[_0x45ec72['model']],'as':_0x45ec72['as'],'attributes':_0x45ec72[_0x30cb('0x22')],'include':_0x45ec72[_0x30cb('0x24')]?_[_0x30cb('0x25')](_0x45ec72[_0x30cb('0x24')],function(_0xb31faa){return{'model':db[_0xb31faa[_0x30cb('0x26')]],'as':_0xb31faa['as'],'attributes':_0xb31faa['attributes'],'include':_0xb31faa[_0x30cb('0x24')]?_[_0x30cb('0x25')](_0xb31faa[_0x30cb('0x24')],function(_0x4dc7a3){return{'model':db[_0x4dc7a3[_0x30cb('0x26')]],'as':_0x4dc7a3['as'],'attributes':_0x4dc7a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x30cb('0x11')](function(_0x5997da){logger[_0x30cb('0x12')]('GetVoiceQueueReport',_0x21b723);logger['debug']('GetVoiceQueueReport',_0x21b723,JSON['stringify'](_0x5997da));_0x327851(_0x5997da);})[_0x30cb('0x1b')](function(_0x329163){logger[_0x30cb('0x18')](_0x30cb('0x1c'),_0x329163[_0x30cb('0x19')],_0x21b723);_0x3db4f2(_0x14a8a6['error'](0x1f4,_0x329163[_0x30cb('0x19')]));});});};exports[_0x30cb('0x27')]=function(_0x3dfc4d){var _0x506717=this;return new Promise(function(_0x555e51,_0x4fc7dc){return db[_0x30cb('0x1d')][_0x30cb('0x28')](_0x3dfc4d[_0x30cb('0x29')],{'raw':_0x3dfc4d['options']?_0x3dfc4d[_0x30cb('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x40ebe6){logger[_0x30cb('0x12')](_0x30cb('0x27'),_0x3dfc4d);logger['debug'](_0x30cb('0x27'),_0x3dfc4d,JSON[_0x30cb('0x17')](_0x40ebe6));_0x555e51(_0x40ebe6);})[_0x30cb('0x1b')](function(_0x24b376){logger['error'](_0x30cb('0x27'),_0x24b376[_0x30cb('0x19')],_0x3dfc4d);_0x4fc7dc(_0x506717[_0x30cb('0x18')](0x1f4,_0x24b376[_0x30cb('0x19')]));});});};exports[_0x30cb('0x2a')]=function(_0x5ed915){var _0x4ef339=this;return new Promise(function(_0x291afd,_0x42f859){return db[_0x30cb('0x1d')]['update'](_0x5ed915['body'],{'raw':_0x5ed915['options']?_0x5ed915[_0x30cb('0x1f')][_0x30cb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ed915[_0x30cb('0x1f')]?_0x5ed915['options']['where']||null:null,'attributes':_0x5ed915['options']?_0x5ed915[_0x30cb('0x1f')][_0x30cb('0x22')]||null:null,'limit':_0x5ed915[_0x30cb('0x1f')]?_0x5ed915[_0x30cb('0x1f')]['limit']||null:null})[_0x30cb('0x11')](function(_0x2f4ab3){logger['info'](_0x30cb('0x2a'),_0x5ed915);logger[_0x30cb('0x15')](_0x30cb('0x2a'),_0x5ed915,JSON[_0x30cb('0x17')](_0x2f4ab3));_0x291afd(_0x2f4ab3);})[_0x30cb('0x1b')](function(_0x2818ee){logger['error'](_0x30cb('0x2a'),_0x2818ee[_0x30cb('0x19')],_0x5ed915);_0x42f859(_0x4ef339[_0x30cb('0x18')](0x1f4,_0x2818ee[_0x30cb('0x19')]));});});}; \ No newline at end of file +var _0x36bc=['info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','map','include','model','attributes','CreateVoiceQueueReport','body','stringify','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','request','then'];(function(_0x41a9f4,_0x2a8d7e){var _0x4f36ee=function(_0x2c5e71){while(--_0x2c5e71){_0x41a9f4['push'](_0x41a9f4['shift']());}};_0x4f36ee(++_0x2a8d7e);}(_0x36bc,0x1d0));var _0xc36b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x36bc[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xc36b('0x0'));var util=require('util');var moment=require(_0xc36b('0x1'));var BPromise=require(_0xc36b('0x2'));var rs=require(_0xc36b('0x3'));var fs=require('fs');var Redis=require(_0xc36b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc36b('0x5'));var logger=require('../../config/logger')(_0xc36b('0x6'));var config=require(_0xc36b('0x7'));var jayson=require(_0xc36b('0x8'));var client=jayson['client'][_0xc36b('0x9')]({'port':0x232a});config['redis']=_[_0xc36b('0xa')](config[_0xc36b('0xb')],{'host':_0xc36b('0xc'),'port':0x18eb});var socket=require(_0xc36b('0xd'))(new Redis(config[_0xc36b('0xb')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x23ed56,_0x40a603,_0x50a2f7){return new BPromise(function(_0x117444,_0x309102){return client[_0xc36b('0xe')](_0x23ed56,_0x50a2f7)[_0xc36b('0xf')](function(_0x45bac1){logger[_0xc36b('0x10')](_0xc36b('0x11'),_0x40a603,_0xc36b('0x12'));logger[_0xc36b('0x13')](_0xc36b('0x14'),_0x40a603,'request\x20sent',JSON['stringify'](_0x45bac1));if(_0x45bac1[_0xc36b('0x15')]){if(_0x45bac1[_0xc36b('0x15')][_0xc36b('0x16')]===0x1f4){logger['error'](_0xc36b('0x11'),_0x40a603,_0x45bac1[_0xc36b('0x15')][_0xc36b('0x17')]);return _0x309102(_0x45bac1[_0xc36b('0x15')][_0xc36b('0x17')]);}logger[_0xc36b('0x15')](_0xc36b('0x11'),_0x40a603,_0x45bac1[_0xc36b('0x15')][_0xc36b('0x17')]);return _0x117444(_0x45bac1['error'][_0xc36b('0x17')]);}else{logger[_0xc36b('0x10')](_0xc36b('0x11'),_0x40a603,_0xc36b('0x12'));_0x117444(_0x45bac1['result'][_0xc36b('0x17')]);}})[_0xc36b('0x18')](function(_0x5c482d){logger['error'](_0xc36b('0x11'),_0x40a603,_0x5c482d);_0x309102(_0x5c482d);});});}exports[_0xc36b('0x19')]=function(_0x483689){var _0x33a0f6=this;return new Promise(function(_0x58e0d2,_0x3b1a63){return db[_0xc36b('0x1a')][_0xc36b('0x1b')]({'raw':_0x483689[_0xc36b('0x1c')]?_0x483689[_0xc36b('0x1c')][_0xc36b('0x1d')]===undefined?!![]:![]:!![],'where':_0x483689[_0xc36b('0x1c')]?_0x483689[_0xc36b('0x1c')][_0xc36b('0x1e')]||null:null,'attributes':_0x483689['options']?_0x483689[_0xc36b('0x1c')]['attributes']||null:null,'limit':_0x483689[_0xc36b('0x1c')]?_0x483689[_0xc36b('0x1c')][_0xc36b('0x1f')]||null:null,'include':_0x483689['options']?_0x483689[_0xc36b('0x1c')]['include']?_[_0xc36b('0x20')](_0x483689['options'][_0xc36b('0x21')],function(_0x8c3bd5){return{'model':db[_0x8c3bd5[_0xc36b('0x22')]],'as':_0x8c3bd5['as'],'attributes':_0x8c3bd5[_0xc36b('0x23')],'include':_0x8c3bd5[_0xc36b('0x21')]?_[_0xc36b('0x20')](_0x8c3bd5[_0xc36b('0x21')],function(_0x25c877){return{'model':db[_0x25c877['model']],'as':_0x25c877['as'],'attributes':_0x25c877[_0xc36b('0x23')],'include':_0x25c877[_0xc36b('0x21')]?_['map'](_0x25c877[_0xc36b('0x21')],function(_0x14dfc2){return{'model':db[_0x14dfc2[_0xc36b('0x22')]],'as':_0x14dfc2['as'],'attributes':_0x14dfc2['attributes']};}):[]};}):[]};}):[]:[]})[_0xc36b('0xf')](function(_0x4fc001){logger['info'](_0xc36b('0x19'),_0x483689);logger[_0xc36b('0x13')](_0xc36b('0x19'),_0x483689,JSON['stringify'](_0x4fc001));_0x58e0d2(_0x4fc001);})['catch'](function(_0x1fa1d8){logger['error']('GetVoiceQueueReport',_0x1fa1d8[_0xc36b('0x17')],_0x483689);_0x3b1a63(_0x33a0f6[_0xc36b('0x15')](0x1f4,_0x1fa1d8[_0xc36b('0x17')]));});});};exports[_0xc36b('0x24')]=function(_0x19c9a2){var _0x70933f=this;return new Promise(function(_0x219137,_0x16e4ed){return db[_0xc36b('0x1a')]['create'](_0x19c9a2[_0xc36b('0x25')],{'raw':_0x19c9a2[_0xc36b('0x1c')]?_0x19c9a2[_0xc36b('0x1c')][_0xc36b('0x1d')]===undefined?!![]:![]:!![]})[_0xc36b('0xf')](function(_0x377d4c){logger[_0xc36b('0x10')](_0xc36b('0x24'),_0x19c9a2);logger[_0xc36b('0x13')](_0xc36b('0x24'),_0x19c9a2,JSON[_0xc36b('0x26')](_0x377d4c));_0x219137(_0x377d4c);})[_0xc36b('0x18')](function(_0x22da83){logger['error'](_0xc36b('0x24'),_0x22da83['message'],_0x19c9a2);_0x16e4ed(_0x70933f[_0xc36b('0x15')](0x1f4,_0x22da83[_0xc36b('0x17')]));});});};exports[_0xc36b('0x27')]=function(_0x15c893){var _0x24eddf=this;return new Promise(function(_0x26792c,_0x92ff0b){return db[_0xc36b('0x1a')]['update'](_0x15c893[_0xc36b('0x25')],{'raw':_0x15c893[_0xc36b('0x1c')]?_0x15c893[_0xc36b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c893[_0xc36b('0x1c')]?_0x15c893[_0xc36b('0x1c')][_0xc36b('0x1e')]||null:null,'attributes':_0x15c893['options']?_0x15c893[_0xc36b('0x1c')][_0xc36b('0x23')]||null:null,'limit':_0x15c893['options']?_0x15c893['options'][_0xc36b('0x1f')]||null:null})[_0xc36b('0xf')](function(_0x11cb1f){logger['info'](_0xc36b('0x27'),_0x15c893);logger[_0xc36b('0x13')](_0xc36b('0x27'),_0x15c893,JSON[_0xc36b('0x26')](_0x11cb1f));_0x26792c(_0x11cb1f);})[_0xc36b('0x18')](function(_0x37a1b8){logger[_0xc36b('0x15')]('UpdateVoiceQueueReport',_0x37a1b8[_0xc36b('0x17')],_0x15c893);_0x92ff0b(_0x24eddf['error'](0x1f4,_0x37a1b8[_0xc36b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8ea6ba4..019a8cd 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 _0x639d=['voiceQueueReport:','./voiceQueueReport.events','save','remove','emit','length'];(function(_0x2bf9ae,_0x270fda){var _0x23c251=function(_0x3be086){while(--_0x3be086){_0x2bf9ae['push'](_0x2bf9ae['shift']());}};_0x23c251(++_0x270fda);}(_0x639d,0xbb));var _0xd639=function(_0xe505,_0x4d4440){_0xe505=_0xe505-0x0;var _0x1ed6e7=_0x639d[_0xe505];return _0x1ed6e7;};'use strict';var VoiceQueueReportEvents=require(_0xd639('0x0'));var events=[_0xd639('0x1'),_0xd639('0x2'),'update'];function createListener(_0x2a6645,_0x30d2db){return function(_0x5b7e8b){_0x30d2db[_0xd639('0x3')](_0x2a6645,_0x5b7e8b);};}function removeListener(_0x588a30,_0x19b990){return function(){VoiceQueueReportEvents['removeListener'](_0x588a30,_0x19b990);};}exports['register']=function(_0x2a71b9){for(var _0x1cebd4=0x0,_0x283157=events[_0xd639('0x4')];_0x1cebd4<_0x283157;_0x1cebd4++){var _0x200b82=events[_0x1cebd4];var _0x3be7c6=createListener(_0xd639('0x5')+_0x200b82,_0x2a71b9);VoiceQueueReportEvents['on'](_0x200b82,_0x3be7c6);}}; \ No newline at end of file +var _0x119a=['./voiceQueueReport.events','save','remove','emit','removeListener','register','length'];(function(_0x31c55d,_0x21b846){var _0x25788b=function(_0x3decdf){while(--_0x3decdf){_0x31c55d['push'](_0x31c55d['shift']());}};_0x25788b(++_0x21b846);}(_0x119a,0x69));var _0xa119=function(_0x2eb50f,_0x4bd249){_0x2eb50f=_0x2eb50f-0x0;var _0x31de5d=_0x119a[_0x2eb50f];return _0x31de5d;};'use strict';var VoiceQueueReportEvents=require(_0xa119('0x0'));var events=[_0xa119('0x1'),_0xa119('0x2'),'update'];function createListener(_0x4dfc84,_0x21e074){return function(_0x1efd4a){_0x21e074[_0xa119('0x3')](_0x4dfc84,_0x1efd4a);};}function removeListener(_0x53fbdf,_0x36321f){return function(){VoiceQueueReportEvents[_0xa119('0x4')](_0x53fbdf,_0x36321f);};}exports[_0xa119('0x5')]=function(_0x4528c6){for(var _0x12fa91=0x0,_0x3590f4=events[_0xa119('0x6')];_0x12fa91<_0x3590f4;_0x12fa91++){var _0x41490d=events[_0x12fa91];var _0x163f6e=createListener('voiceQueueReport:'+_0x41490d,_0x4528c6);VoiceQueueReportEvents['on'](_0x41490d,_0x163f6e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 23d8dee..1cf777d 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 _0x9009=['get','/:id','show','post','isAuthenticated','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x9009,0x1d4));var _0x9900=function(_0x1a2666,_0x32410b){_0x1a2666=_0x1a2666-0x0;var _0x40229c=_0x9009[_0x1a2666];return _0x40229c;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0xb')]('/',auth[_0x9900('0xc')](),controller[_0x9900('0xd')]);router['put'](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')](_0x9900('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9900('0x10')]=router; \ No newline at end of file +var _0x23e1=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x22f72b,_0x3082dd){var _0x3cbf1c=function(_0x3f8e87){while(--_0x3f8e87){_0x22f72b['push'](_0x22f72b['shift']());}};_0x3cbf1c(++_0x3082dd);}(_0x23e1,0x1dc));var _0x123e=function(_0x5d2e6c,_0x291318){_0x5d2e6c=_0x5d2e6c-0x0;var _0x45a66e=_0x23e1[_0x5d2e6c];return _0x45a66e;};'use strict';var multer=require(_0x123e('0x0'));var util=require(_0x123e('0x1'));var path=require(_0x123e('0x2'));var timeout=require(_0x123e('0x3'));var express=require(_0x123e('0x4'));var router=express['Router']();var fs_extra=require(_0x123e('0x5'));var auth=require(_0x123e('0x6'));var interaction=require(_0x123e('0x7'));var config=require(_0x123e('0x8'));var controller=require(_0x123e('0x9'));router[_0x123e('0xa')]('/',auth[_0x123e('0xb')](),controller[_0x123e('0xc')]);router[_0x123e('0xa')](_0x123e('0xd'),auth['isAuthenticated'](),controller[_0x123e('0xe')]);router[_0x123e('0xf')]('/',auth['isAuthenticated'](),controller[_0x123e('0x10')]);router[_0x123e('0x11')](_0x123e('0xd'),auth['isAuthenticated'](),controller[_0x123e('0x12')]);router[_0x123e('0x13')](_0x123e('0xd'),auth[_0x123e('0xb')](),controller[_0x123e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 04902b4..c85f65f 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 _0xe984=['YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE','format'];(function(_0x3b0675,_0x17502a){var _0x11b775=function(_0x30e206){while(--_0x30e206){_0x3b0675['push'](_0x3b0675['shift']());}};_0x11b775(++_0x17502a);}(_0xe984,0x1aa));var _0x4e98=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xe984[_0x3438cf];return _0x278698;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4e98('0x0'));module['exports']={'time':{'type':Sequelize[_0x4e98('0x1')]},'callid':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4e98('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4e98('0x2')],'allowNull':![],'defaultValue':moment()[_0x4e98('0x3')](_0x4e98('0x4'))}}; \ No newline at end of file +var _0xb983=['sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x19bc30,_0x1e3eab){var _0x3a1e47=function(_0x599a61){while(--_0x599a61){_0x19bc30['push'](_0x19bc30['shift']());}};_0x3a1e47(++_0x1e3eab);}(_0xb983,0x1db));var _0x3b98=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0xb983[_0x582d0b];return _0x2e93e1;};'use strict';var Sequelize=require(_0x3b98('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x3b98('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3b98('0x2')],'allowNull':![],'defaultValue':moment()[_0x3b98('0x3')](_0x3b98('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 135e77b..4499813 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 _0xc297=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','VoiceQueuesLog','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','include','findAll','catch','params','includeAll','merge','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xc297,0x7e));var _0x7c29=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xc297[_0xdc37a1];return _0x99b4fe;};'use strict';var emlformat=require(_0x7c29('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c29('0x1'));var rp=require(_0x7c29('0x2'));var moment=require(_0x7c29('0x3'));var BPromise=require(_0x7c29('0x4'));var Mustache=require(_0x7c29('0x5'));var util=require(_0x7c29('0x6'));var path=require(_0x7c29('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c29('0x8'));var fs=require('fs');var fs_extra=require(_0x7c29('0x9'));var _=require('lodash');var squel=require(_0x7c29('0xa'));var crypto=require(_0x7c29('0xb'));var jsforce=require(_0x7c29('0xc'));var deskjs=require(_0x7c29('0xd'));var toCsv=require(_0x7c29('0xe'));var querystring=require(_0x7c29('0xf'));var Papa=require(_0x7c29('0x10'));var Redis=require(_0x7c29('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7c29('0x12'));var hardwareService=require(_0x7c29('0x13'));var logger=require(_0x7c29('0x14'))(_0x7c29('0x15'));var utils=require(_0x7c29('0x16'));var config=require(_0x7c29('0x17'));var licenseUtil=require(_0x7c29('0x18'));var db=require(_0x7c29('0x19'))['db'];function respondWithStatusCode(_0x226657,_0x81a64b){_0x81a64b=_0x81a64b||0xcc;return function(_0x46453d){if(_0x46453d){return _0x226657[_0x7c29('0x1a')](_0x81a64b);}return _0x226657[_0x7c29('0x1b')](_0x81a64b)[_0x7c29('0x1c')]();};}function respondWithResult(_0x19e278,_0x7bf253){_0x7bf253=_0x7bf253||0xc8;return function(_0x22156d){if(_0x22156d){return _0x19e278[_0x7c29('0x1b')](_0x7bf253)[_0x7c29('0x1d')](_0x22156d);}};}function respondWithFilteredResult(_0x16028f,_0xccb351){return function(_0x2416e5){if(_0x2416e5){var _0x341b6f=typeof _0xccb351[_0x7c29('0x1e')]===_0x7c29('0x1f')&&typeof _0xccb351[_0x7c29('0x20')]===_0x7c29('0x1f');var _0x245965=_0x2416e5[_0x7c29('0x21')];var _0x488285=_0x341b6f?0x0:_0xccb351[_0x7c29('0x1e')];var _0x3eff54=_0x341b6f?_0x2416e5[_0x7c29('0x21')]:_0xccb351[_0x7c29('0x1e')]+_0xccb351[_0x7c29('0x20')];var _0x4d59e9;if(_0x3eff54>=_0x245965){_0x3eff54=_0x245965;_0x4d59e9=0xc8;}else{_0x4d59e9=0xce;}_0x16028f[_0x7c29('0x1b')](_0x4d59e9);return _0x16028f['set'](_0x7c29('0x22'),_0x488285+'-'+_0x3eff54+'/'+_0x245965)[_0x7c29('0x1d')](_0x2416e5);}return null;};}function patchUpdates(_0x367daa){return function(_0x501d8c){try{jsonpatch['apply'](_0x501d8c,_0x367daa,!![]);}catch(_0x4a1026){return BPromise[_0x7c29('0x23')](_0x4a1026);}return _0x501d8c[_0x7c29('0x24')]();};}function saveUpdates(_0xa25444,_0xcf319b){return function(_0x5cdd0d){if(_0x5cdd0d){return _0x5cdd0d[_0x7c29('0x25')](_0xa25444)[_0x7c29('0x26')](function(_0x3fd7d5){return _0x3fd7d5;});}return null;};}function removeEntity(_0x5ced1d,_0x42249a){return function(_0x25b059){if(_0x25b059){return _0x25b059[_0x7c29('0x27')]()[_0x7c29('0x26')](function(){_0x5ced1d[_0x7c29('0x1b')](0xcc)[_0x7c29('0x1c')]();});}};}function handleEntityNotFound(_0x1f619b,_0x155105){return function(_0x151013){if(!_0x151013){_0x1f619b[_0x7c29('0x1a')](0x194);}return _0x151013;};}function handleError(_0x710152,_0x190334){_0x190334=_0x190334||0x1f4;return function(_0x5bd4d0){logger['error'](_0x5bd4d0[_0x7c29('0x28')]);if(_0x5bd4d0[_0x7c29('0x29')]){delete _0x5bd4d0[_0x7c29('0x29')];}_0x710152[_0x7c29('0x1b')](_0x190334)['send'](_0x5bd4d0);};}exports[_0x7c29('0x2a')]=function(_0x546087,_0x43ce63){var _0x498088={},_0x3f784a={},_0x34495f={'count':0x0,'rows':[]};var _0x3d78e1=_['map'](db[_0x7c29('0x2b')]['rawAttributes'],function(_0x1c9f0e){return{'name':_0x1c9f0e[_0x7c29('0x2c')],'type':_0x1c9f0e[_0x7c29('0x2d')][_0x7c29('0x2e')]};});_0x3f784a[_0x7c29('0x2f')]=_[_0x7c29('0x30')](_0x3d78e1,'name');_0x3f784a[_0x7c29('0x31')]=_[_0x7c29('0x32')](_0x546087['query']);_0x3f784a[_0x7c29('0x33')]=_[_0x7c29('0x34')](_0x3f784a[_0x7c29('0x2f')],_0x3f784a['query']);_0x498088[_0x7c29('0x35')]=_[_0x7c29('0x34')](_0x3f784a[_0x7c29('0x2f')],qs[_0x7c29('0x36')](_0x546087[_0x7c29('0x31')][_0x7c29('0x36')]));_0x498088['attributes']=_0x498088[_0x7c29('0x35')][_0x7c29('0x37')]?_0x498088[_0x7c29('0x35')]:_0x3f784a[_0x7c29('0x2f')];if(!_0x546087[_0x7c29('0x31')][_0x7c29('0x38')](_0x7c29('0x39'))){_0x498088['limit']=qs[_0x7c29('0x20')](_0x546087[_0x7c29('0x31')]['limit']);_0x498088[_0x7c29('0x1e')]=qs[_0x7c29('0x1e')](_0x546087[_0x7c29('0x31')][_0x7c29('0x1e')]);}_0x498088[_0x7c29('0x3a')]=qs[_0x7c29('0x3b')](_0x546087[_0x7c29('0x31')][_0x7c29('0x3b')]);_0x498088[_0x7c29('0x3c')]=qs[_0x7c29('0x33')](_['pick'](_0x546087[_0x7c29('0x31')],_0x3f784a[_0x7c29('0x33')]),_0x3d78e1);if(_0x546087[_0x7c29('0x31')]['filter']){_0x498088[_0x7c29('0x3c')]=_['merge'](_0x498088['where'],{'$or':_['map'](_0x3d78e1,function(_0x54e964){if(_0x54e964[_0x7c29('0x2d')]!==_0x7c29('0x3d')){var _0x2d510e={};_0x2d510e[_0x54e964[_0x7c29('0x29')]]={'$like':'%'+_0x546087[_0x7c29('0x31')][_0x7c29('0x3e')]+'%'};return _0x2d510e;}})});}_0x498088=_['merge']({},_0x498088,_0x546087[_0x7c29('0x3f')]);var _0xe5cbed={'where':_0x498088['where']};return db[_0x7c29('0x2b')][_0x7c29('0x21')](_0xe5cbed)[_0x7c29('0x26')](function(_0x593eee){_0x34495f['count']=_0x593eee;if(_0x546087[_0x7c29('0x31')]['includeAll']){_0x498088[_0x7c29('0x40')]=[{'all':!![]}];}return db[_0x7c29('0x2b')][_0x7c29('0x41')](_0x498088);})[_0x7c29('0x26')](function(_0x2918a6){_0x34495f['rows']=_0x2918a6;return _0x34495f;})[_0x7c29('0x26')](respondWithFilteredResult(_0x43ce63,_0x498088))[_0x7c29('0x42')](handleError(_0x43ce63,null));};exports['show']=function(_0x5a4e7e,_0x396e06){var _0x133557={'raw':!![],'where':{'id':_0x5a4e7e[_0x7c29('0x43')]['id']}},_0x5c8146={};_0x5c8146[_0x7c29('0x2f')]=_[_0x7c29('0x32')](db[_0x7c29('0x2b')]['rawAttributes']);_0x5c8146[_0x7c29('0x31')]=_[_0x7c29('0x32')](_0x5a4e7e['query']);_0x5c8146[_0x7c29('0x33')]=_[_0x7c29('0x34')](_0x5c8146['model'],_0x5c8146['query']);_0x133557[_0x7c29('0x35')]=_['intersection'](_0x5c8146['model'],qs[_0x7c29('0x36')](_0x5a4e7e[_0x7c29('0x31')]['fields']));_0x133557['attributes']=_0x133557[_0x7c29('0x35')]['length']?_0x133557[_0x7c29('0x35')]:_0x5c8146[_0x7c29('0x2f')];if(_0x5a4e7e['query'][_0x7c29('0x44')]){_0x133557[_0x7c29('0x40')]=[{'all':!![]}];}_0x133557=_[_0x7c29('0x45')]({},_0x133557,_0x5a4e7e[_0x7c29('0x3f')]);return db[_0x7c29('0x2b')][_0x7c29('0x46')](_0x133557)['then'](handleEntityNotFound(_0x396e06,null))[_0x7c29('0x26')](respondWithResult(_0x396e06,null))[_0x7c29('0x42')](handleError(_0x396e06,null));};exports[_0x7c29('0x47')]=function(_0x5a2f90,_0x52152e){return db[_0x7c29('0x2b')][_0x7c29('0x47')](_0x5a2f90['body'],{})[_0x7c29('0x26')](respondWithResult(_0x52152e,0xc9))[_0x7c29('0x42')](handleError(_0x52152e,null));};exports[_0x7c29('0x25')]=function(_0x1e1666,_0x289874){if(_0x1e1666[_0x7c29('0x48')]['id']){delete _0x1e1666[_0x7c29('0x48')]['id'];}return db['VoiceQueuesLog'][_0x7c29('0x46')]({'where':{'id':_0x1e1666[_0x7c29('0x43')]['id']}})[_0x7c29('0x26')](handleEntityNotFound(_0x289874,null))[_0x7c29('0x26')](saveUpdates(_0x1e1666['body'],null))[_0x7c29('0x26')](respondWithResult(_0x289874,null))[_0x7c29('0x42')](handleError(_0x289874,null));};exports['destroy']=function(_0x5c58ec,_0x5aee84){return db[_0x7c29('0x2b')][_0x7c29('0x46')]({'where':{'id':_0x5c58ec['params']['id']}})['then'](handleEntityNotFound(_0x5aee84,null))[_0x7c29('0x26')](removeEntity(_0x5aee84,null))[_0x7c29('0x42')](handleError(_0x5aee84,null));}; \ No newline at end of file +var _0x1e23=['sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','VoiceQueuesLog','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','rows','catch','show','params','keys','rawAttributes','includeAll','find','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0xcd9ece,_0x33ff67){var _0x36f54f=function(_0x54ec76){while(--_0x54ec76){_0xcd9ece['push'](_0xcd9ece['shift']());}};_0x36f54f(++_0x33ff67);}(_0x1e23,0x87));var _0x31e2=function(_0x1189ab,_0x288e39){_0x1189ab=_0x1189ab-0x0;var _0x13c2af=_0x1e23[_0x1189ab];return _0x13c2af;};'use strict';var emlformat=require(_0x31e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31e2('0x1'));var jsonpatch=require(_0x31e2('0x2'));var rp=require(_0x31e2('0x3'));var moment=require(_0x31e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31e2('0x5'));var util=require(_0x31e2('0x6'));var path=require('path');var sox=require(_0x31e2('0x7'));var csv=require('to-csv');var ejs=require(_0x31e2('0x8'));var fs=require('fs');var fs_extra=require(_0x31e2('0x9'));var _=require('lodash');var squel=require(_0x31e2('0xa'));var crypto=require('crypto');var jsforce=require(_0x31e2('0xb'));var deskjs=require(_0x31e2('0xc'));var toCsv=require(_0x31e2('0xd'));var querystring=require('querystring');var Papa=require(_0x31e2('0xe'));var Redis=require(_0x31e2('0xf'));var authService=require(_0x31e2('0x10'));var qs=require(_0x31e2('0x11'));var as=require(_0x31e2('0x12'));var hardwareService=require(_0x31e2('0x13'));var logger=require('../../config/logger')(_0x31e2('0x14'));var utils=require('../../config/utils');var config=require(_0x31e2('0x15'));var licenseUtil=require(_0x31e2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d44a,_0x4c979f){_0x4c979f=_0x4c979f||0xcc;return function(_0x2d0212){if(_0x2d0212){return _0x59d44a['sendStatus'](_0x4c979f);}return _0x59d44a[_0x31e2('0x17')](_0x4c979f)['end']();};}function respondWithResult(_0x4097f7,_0x203b2c){_0x203b2c=_0x203b2c||0xc8;return function(_0x459121){if(_0x459121){return _0x4097f7[_0x31e2('0x17')](_0x203b2c)[_0x31e2('0x18')](_0x459121);}};}function respondWithFilteredResult(_0x286297,_0x5c5a7b){return function(_0x1784f4){if(_0x1784f4){var _0x3101b0=typeof _0x5c5a7b[_0x31e2('0x19')]==='undefined'&&typeof _0x5c5a7b[_0x31e2('0x1a')]===_0x31e2('0x1b');var _0x3a105c=_0x1784f4['count'];var _0x4ead45=_0x3101b0?0x0:_0x5c5a7b[_0x31e2('0x19')];var _0x3ec5ed=_0x3101b0?_0x1784f4['count']:_0x5c5a7b['offset']+_0x5c5a7b[_0x31e2('0x1a')];var _0x38e481;if(_0x3ec5ed>=_0x3a105c){_0x3ec5ed=_0x3a105c;_0x38e481=0xc8;}else{_0x38e481=0xce;}_0x286297[_0x31e2('0x17')](_0x38e481);return _0x286297['set'](_0x31e2('0x1c'),_0x4ead45+'-'+_0x3ec5ed+'/'+_0x3a105c)['json'](_0x1784f4);}return null;};}function patchUpdates(_0x28d1a0){return function(_0x18aa88){try{jsonpatch[_0x31e2('0x1d')](_0x18aa88,_0x28d1a0,!![]);}catch(_0x32e3ce){return BPromise[_0x31e2('0x1e')](_0x32e3ce);}return _0x18aa88[_0x31e2('0x1f')]();};}function saveUpdates(_0x20c4e2,_0x10c9ce){return function(_0x50b3d5){if(_0x50b3d5){return _0x50b3d5['update'](_0x20c4e2)[_0x31e2('0x20')](function(_0x3cc480){return _0x3cc480;});}return null;};}function removeEntity(_0x280f44,_0x360b26){return function(_0x5b7359){if(_0x5b7359){return _0x5b7359[_0x31e2('0x21')]()['then'](function(){_0x280f44[_0x31e2('0x17')](0xcc)[_0x31e2('0x22')]();});}};}function handleEntityNotFound(_0x5361b2,_0xb095e7){return function(_0x97b150){if(!_0x97b150){_0x5361b2['sendStatus'](0x194);}return _0x97b150;};}function handleError(_0xad7d04,_0x12e6b3){_0x12e6b3=_0x12e6b3||0x1f4;return function(_0x2588f1){logger[_0x31e2('0x23')](_0x2588f1[_0x31e2('0x24')]);if(_0x2588f1[_0x31e2('0x25')]){delete _0x2588f1['name'];}_0xad7d04[_0x31e2('0x17')](_0x12e6b3)['send'](_0x2588f1);};}exports[_0x31e2('0x26')]=function(_0x3823a7,_0x290386){var _0x5d79e6={},_0x16ed57={},_0x27b85c={'count':0x0,'rows':[]};var _0x39d990=_[_0x31e2('0x27')](db[_0x31e2('0x28')]['rawAttributes'],function(_0x2a659a){return{'name':_0x2a659a[_0x31e2('0x29')],'type':_0x2a659a[_0x31e2('0x2a')][_0x31e2('0x2b')]};});_0x16ed57[_0x31e2('0x2c')]=_[_0x31e2('0x27')](_0x39d990,_0x31e2('0x25'));_0x16ed57[_0x31e2('0x2d')]=_['keys'](_0x3823a7[_0x31e2('0x2d')]);_0x16ed57[_0x31e2('0x2e')]=_[_0x31e2('0x2f')](_0x16ed57[_0x31e2('0x2c')],_0x16ed57['query']);_0x5d79e6[_0x31e2('0x30')]=_[_0x31e2('0x2f')](_0x16ed57[_0x31e2('0x2c')],qs[_0x31e2('0x31')](_0x3823a7['query'][_0x31e2('0x31')]));_0x5d79e6[_0x31e2('0x30')]=_0x5d79e6[_0x31e2('0x30')][_0x31e2('0x32')]?_0x5d79e6['attributes']:_0x16ed57[_0x31e2('0x2c')];if(!_0x3823a7[_0x31e2('0x2d')]['hasOwnProperty'](_0x31e2('0x33'))){_0x5d79e6[_0x31e2('0x1a')]=qs[_0x31e2('0x1a')](_0x3823a7[_0x31e2('0x2d')][_0x31e2('0x1a')]);_0x5d79e6[_0x31e2('0x19')]=qs[_0x31e2('0x19')](_0x3823a7[_0x31e2('0x2d')][_0x31e2('0x19')]);}_0x5d79e6[_0x31e2('0x34')]=qs[_0x31e2('0x35')](_0x3823a7[_0x31e2('0x2d')]['sort']);_0x5d79e6[_0x31e2('0x36')]=qs['filters'](_[_0x31e2('0x37')](_0x3823a7['query'],_0x16ed57[_0x31e2('0x2e')]),_0x39d990);if(_0x3823a7['query'][_0x31e2('0x38')]){_0x5d79e6[_0x31e2('0x36')]=_['merge'](_0x5d79e6[_0x31e2('0x36')],{'$or':_['map'](_0x39d990,function(_0x127298){if(_0x127298[_0x31e2('0x2a')]!==_0x31e2('0x39')){var _0x4153da={};_0x4153da[_0x127298[_0x31e2('0x25')]]={'$like':'%'+_0x3823a7[_0x31e2('0x2d')]['filter']+'%'};return _0x4153da;}})});}_0x5d79e6=_[_0x31e2('0x3a')]({},_0x5d79e6,_0x3823a7[_0x31e2('0x3b')]);var _0x587ead={'where':_0x5d79e6[_0x31e2('0x36')]};return db[_0x31e2('0x28')][_0x31e2('0x3c')](_0x587ead)[_0x31e2('0x20')](function(_0x5e5093){_0x27b85c[_0x31e2('0x3c')]=_0x5e5093;if(_0x3823a7['query']['includeAll']){_0x5d79e6['include']=[{'all':!![]}];}return db[_0x31e2('0x28')]['findAll'](_0x5d79e6);})[_0x31e2('0x20')](function(_0x1a8ae3){_0x27b85c[_0x31e2('0x3d')]=_0x1a8ae3;return _0x27b85c;})['then'](respondWithFilteredResult(_0x290386,_0x5d79e6))[_0x31e2('0x3e')](handleError(_0x290386,null));};exports[_0x31e2('0x3f')]=function(_0x3ee1cb,_0x5b33da){var _0x29be32={'raw':!![],'where':{'id':_0x3ee1cb[_0x31e2('0x40')]['id']}},_0x67c6fa={};_0x67c6fa[_0x31e2('0x2c')]=_[_0x31e2('0x41')](db[_0x31e2('0x28')][_0x31e2('0x42')]);_0x67c6fa['query']=_[_0x31e2('0x41')](_0x3ee1cb[_0x31e2('0x2d')]);_0x67c6fa[_0x31e2('0x2e')]=_['intersection'](_0x67c6fa[_0x31e2('0x2c')],_0x67c6fa['query']);_0x29be32['attributes']=_[_0x31e2('0x2f')](_0x67c6fa[_0x31e2('0x2c')],qs[_0x31e2('0x31')](_0x3ee1cb['query']['fields']));_0x29be32['attributes']=_0x29be32[_0x31e2('0x30')][_0x31e2('0x32')]?_0x29be32[_0x31e2('0x30')]:_0x67c6fa[_0x31e2('0x2c')];if(_0x3ee1cb['query'][_0x31e2('0x43')]){_0x29be32['include']=[{'all':!![]}];}_0x29be32=_[_0x31e2('0x3a')]({},_0x29be32,_0x3ee1cb[_0x31e2('0x3b')]);return db[_0x31e2('0x28')][_0x31e2('0x44')](_0x29be32)['then'](handleEntityNotFound(_0x5b33da,null))['then'](respondWithResult(_0x5b33da,null))[_0x31e2('0x3e')](handleError(_0x5b33da,null));};exports['create']=function(_0x2b3a1a,_0x3d0384){return db['VoiceQueuesLog']['create'](_0x2b3a1a[_0x31e2('0x45')],{})['then'](respondWithResult(_0x3d0384,0xc9))[_0x31e2('0x3e')](handleError(_0x3d0384,null));};exports[_0x31e2('0x46')]=function(_0x65b777,_0x1f38e4){if(_0x65b777[_0x31e2('0x45')]['id']){delete _0x65b777[_0x31e2('0x45')]['id'];}return db['VoiceQueuesLog'][_0x31e2('0x44')]({'where':{'id':_0x65b777[_0x31e2('0x40')]['id']}})[_0x31e2('0x20')](handleEntityNotFound(_0x1f38e4,null))[_0x31e2('0x20')](saveUpdates(_0x65b777[_0x31e2('0x45')],null))['then'](respondWithResult(_0x1f38e4,null))[_0x31e2('0x3e')](handleError(_0x1f38e4,null));};exports[_0x31e2('0x21')]=function(_0x3cecc0,_0x1616ac){return db['VoiceQueuesLog']['find']({'where':{'id':_0x3cecc0[_0x31e2('0x40')]['id']}})[_0x31e2('0x20')](handleEntityNotFound(_0x1616ac,null))[_0x31e2('0x20')](removeEntity(_0x1616ac,null))[_0x31e2('0x3e')](handleError(_0x1616ac,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7328179..cf778f5 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 _0x6f5a=['define','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3d2536,_0x28d331){var _0x4f3bfe=function(_0x7a4546){while(--_0x7a4546){_0x3d2536['push'](_0x3d2536['shift']());}};_0x4f3bfe(++_0x28d331);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0x17a475,_0x1f3373){_0x17a475=_0x17a475-0x0;var _0x4e81f7=_0x6f5a[_0x17a475];return _0x4e81f7;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var logger=require(_0xa6f5('0x2'))('api');var moment=require(_0xa6f5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f5('0x4'));var rimraf=require(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var attributes=require(_0xa6f5('0x7'));module[_0xa6f5('0x8')]=function(_0x4cf735,_0x21be4d){return _0x4cf735[_0xa6f5('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xa6f5('0xa'),'paranoid':![],'indexes':[{'name':_0xa6f5('0xb'),'fields':[_0xa6f5('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xfd6b=['voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfd6b,0x1d1));var _0xbfd6=function(_0x565546,_0x6501e9){_0x565546=_0x565546-0x0;var _0x43b655=_0xfd6b[_0x565546];return _0x43b655;};'use strict';var _=require(_0xbfd6('0x0'));var util=require(_0xbfd6('0x1'));var logger=require(_0xbfd6('0x2'))(_0xbfd6('0x3'));var moment=require(_0xbfd6('0x4'));var BPromise=require(_0xbfd6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfd6('0x6'));var rimraf=require(_0xbfd6('0x7'));var config=require(_0xbfd6('0x8'));var attributes=require(_0xbfd6('0x9'));module['exports']=function(_0x249e43,_0x6f57ec){return _0x249e43[_0xbfd6('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0xbfd6('0xb'),'paranoid':![],'indexes':[{'name':_0xbfd6('0xc'),'fields':[_0xbfd6('0xd'),'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 747a695..23a9a0e 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 _0x1fee=['jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xe6ba3b,_0x58e953){var _0x19adbe=function(_0x3ec442){while(--_0x3ec442){_0xe6ba3b['push'](_0xe6ba3b['shift']());}};_0x19adbe(++_0x58e953);}(_0x1fee,0x12e));var _0xe1fe=function(_0x4f9224,_0x50d148){_0x4f9224=_0x4f9224-0x0;var _0x31bd93=_0x1fee[_0x4f9224];return _0x31bd93;};'use strict';var _=require(_0xe1fe('0x0'));var util=require(_0xe1fe('0x1'));var moment=require(_0xe1fe('0x2'));var BPromise=require(_0xe1fe('0x3'));var rs=require(_0xe1fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1fe('0x5'))['db'];var utils=require(_0xe1fe('0x6'));var logger=require(_0xe1fe('0x7'))(_0xe1fe('0x8'));var config=require(_0xe1fe('0x9'));var jayson=require(_0xe1fe('0xa'));var client=jayson[_0xe1fe('0xb')][_0xe1fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48462a,_0x5a25b5,_0xcd0968){return new BPromise(function(_0x40bd2e,_0x56ee79){return client[_0xe1fe('0xd')](_0x48462a,_0xcd0968)['then'](function(_0x245ebc){logger[_0xe1fe('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a25b5,_0xe1fe('0xf'));logger[_0xe1fe('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5a25b5,_0xe1fe('0xf'),JSON[_0xe1fe('0x11')](_0x245ebc));if(_0x245ebc[_0xe1fe('0x12')]){if(_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x13')]===0x1f4){logger[_0xe1fe('0x12')](_0xe1fe('0x14'),_0x5a25b5,_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x15')]);return _0x56ee79(_0x245ebc['error']['message']);}logger[_0xe1fe('0x12')](_0xe1fe('0x14'),_0x5a25b5,_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x15')]);return _0x40bd2e(_0x245ebc[_0xe1fe('0x12')][_0xe1fe('0x15')]);}else{logger[_0xe1fe('0xe')](_0xe1fe('0x14'),_0x5a25b5,_0xe1fe('0xf'));_0x40bd2e(_0x245ebc[_0xe1fe('0x16')][_0xe1fe('0x15')]);}})[_0xe1fe('0x17')](function(_0x5daa4f){logger[_0xe1fe('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a25b5,_0x5daa4f);_0x56ee79(_0x5daa4f);});});} \ No newline at end of file +var _0x1e72=['request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x589470,_0x3e44d3){var _0x19874e=function(_0x4253dc){while(--_0x4253dc){_0x589470['push'](_0x589470['shift']());}};_0x19874e(++_0x3e44d3);}(_0x1e72,0xe9));var _0x21e7=function(_0x2aebf0,_0x2c5006){_0x2aebf0=_0x2aebf0-0x0;var _0x828d7=_0x1e72[_0x2aebf0];return _0x828d7;};'use strict';var _=require(_0x21e7('0x0'));var util=require(_0x21e7('0x1'));var moment=require(_0x21e7('0x2'));var BPromise=require(_0x21e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x21e7('0x4'));var db=require(_0x21e7('0x5'))['db'];var utils=require(_0x21e7('0x6'));var logger=require('../../config/logger')(_0x21e7('0x7'));var config=require(_0x21e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21e7('0x9')][_0x21e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55ad48,_0x56558c,_0x17c883){return new BPromise(function(_0x3f9970,_0x40330a){return client[_0x21e7('0xb')](_0x55ad48,_0x17c883)['then'](function(_0x5a7ab9){logger[_0x21e7('0xc')](_0x21e7('0xd'),_0x56558c,_0x21e7('0xe'));logger[_0x21e7('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x56558c,_0x21e7('0xe'),JSON['stringify'](_0x5a7ab9));if(_0x5a7ab9[_0x21e7('0x10')]){if(_0x5a7ab9[_0x21e7('0x10')][_0x21e7('0x11')]===0x1f4){logger[_0x21e7('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x56558c,_0x5a7ab9['error'][_0x21e7('0x12')]);return _0x40330a(_0x5a7ab9[_0x21e7('0x10')][_0x21e7('0x12')]);}logger[_0x21e7('0x10')](_0x21e7('0xd'),_0x56558c,_0x5a7ab9['error'][_0x21e7('0x12')]);return _0x3f9970(_0x5a7ab9['error'][_0x21e7('0x12')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x56558c,_0x21e7('0xe'));_0x3f9970(_0x5a7ab9['result']['message']);}})['catch'](function(_0x263872){logger['error'](_0x21e7('0xd'),_0x56558c,_0x263872);_0x40330a(_0x263872);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index e966bde..cc8a99a 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 _0xc8e0=['runTranscribe','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','create','post'];(function(_0x26f4a4,_0xeb0dc6){var _0x437404=function(_0x173ca5){while(--_0x173ca5){_0x26f4a4['push'](_0x26f4a4['shift']());}};_0x437404(++_0xeb0dc6);}(_0xc8e0,0x89));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x0c8e('0x0'));var path=require(_0x0c8e('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c8e('0x2'));var router=express[_0x0c8e('0x3')]();var fs_extra=require(_0x0c8e('0x4'));var auth=require(_0x0c8e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c8e('0x6'));var controller=require(_0x0c8e('0x7'));router[_0x0c8e('0x8')]('/',auth[_0x0c8e('0x9')](),controller[_0x0c8e('0xa')]);router[_0x0c8e('0x8')]('/describe',auth[_0x0c8e('0x9')](),controller[_0x0c8e('0xb')]);router[_0x0c8e('0x8')]('/:id',auth[_0x0c8e('0x9')](),controller['show']);router[_0x0c8e('0x8')](_0x0c8e('0xc'),auth[_0x0c8e('0x9')](),controller[_0x0c8e('0xd')]);router[_0x0c8e('0x8')](_0x0c8e('0xe'),controller[_0x0c8e('0xf')]);router[_0x0c8e('0x8')](_0x0c8e('0x10'),auth['isAuthenticated'](),controller['downloadTranscribe']);router['post']('/',auth[_0x0c8e('0x9')](),controller[_0x0c8e('0x11')]);router[_0x0c8e('0x12')](_0x0c8e('0x10'),auth[_0x0c8e('0x9')](),controller[_0x0c8e('0x13')]);router[_0x0c8e('0x14')](_0x0c8e('0x15'),auth['isAuthenticated'](),controller[_0x0c8e('0x16')]);router[_0x0c8e('0x17')](_0x0c8e('0x15'),auth['isAuthenticated'](),controller[_0x0c8e('0x18')]);module[_0x0c8e('0x19')]=router; \ No newline at end of file +var _0xb81e=['isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb81e,0x8d));var _0xeb81=function(_0x44232c,_0x5a7cc8){_0x44232c=_0x44232c-0x0;var _0x30683a=_0xb81e[_0x44232c];return _0x30683a;};'use strict';var multer=require('multer');var util=require(_0xeb81('0x0'));var path=require(_0xeb81('0x1'));var timeout=require(_0xeb81('0x2'));var express=require('express');var router=express[_0xeb81('0x3')]();var fs_extra=require(_0xeb81('0x4'));var auth=require(_0xeb81('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeb81('0x6'));var controller=require(_0xeb81('0x7'));router[_0xeb81('0x8')]('/',auth[_0xeb81('0x9')](),controller[_0xeb81('0xa')]);router[_0xeb81('0x8')](_0xeb81('0xb'),auth[_0xeb81('0x9')](),controller['describe']);router[_0xeb81('0x8')](_0xeb81('0xc'),auth[_0xeb81('0x9')](),controller[_0xeb81('0xd')]);router['get'](_0xeb81('0xe'),auth[_0xeb81('0x9')](),controller[_0xeb81('0xf')]);router[_0xeb81('0x8')](_0xeb81('0x10'),controller[_0xeb81('0x11')]);router[_0xeb81('0x8')](_0xeb81('0x12'),auth[_0xeb81('0x9')](),controller[_0xeb81('0x13')]);router['post']('/',auth[_0xeb81('0x9')](),controller['create']);router[_0xeb81('0x14')](_0xeb81('0x12'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0xeb81('0x15')]('/:id',auth[_0xeb81('0x9')](),controller[_0xeb81('0x16')]);router[_0xeb81('0x17')]('/:id',auth[_0xeb81('0x9')](),controller['destroy']);module[_0xeb81('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 2cb414e..1fc72f8 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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 6f3bfc3..fd1904d 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 _0x2379=['Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','show','length','find','catch','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','secrets','destroy','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','language'];(function(_0x1378a7,_0x1519f8){var _0x5a02e4=function(_0x34e162){while(--_0x34e162){_0x1378a7['push'](_0x1378a7['shift']());}};_0x5a02e4(++_0x1519f8);}(_0x2379,0x1eb));var _0x9237=function(_0x425194,_0x2065aa){_0x425194=_0x425194-0x0;var _0x41f2e2=_0x2379[_0x425194];return _0x41f2e2;};'use strict';var emlformat=require(_0x9237('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9237('0x1'));var jsonpatch=require(_0x9237('0x2'));var rp=require(_0x9237('0x3'));var moment=require(_0x9237('0x4'));var BPromise=require(_0x9237('0x5'));var Mustache=require(_0x9237('0x6'));var util=require('util');var path=require(_0x9237('0x7'));var sox=require(_0x9237('0x8'));var csv=require(_0x9237('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9237('0xa'));var _=require(_0x9237('0xb'));var squel=require(_0x9237('0xc'));var crypto=require(_0x9237('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9237('0x9'));var querystring=require(_0x9237('0xe'));var Papa=require(_0x9237('0xf'));var AWS=require(_0x9237('0x10'));var uuidv4=require(_0x9237('0x11'));var Redis=require(_0x9237('0x12'));var authService=require(_0x9237('0x13'));var qs=require(_0x9237('0x14'));var as=require(_0x9237('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9237('0x16'));var utils=require(_0x9237('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9237('0x18'));var db=require(_0x9237('0x19'))['db'];function respondWithStatusCode(_0x4d6234,_0x52cdfa){_0x52cdfa=_0x52cdfa||0xcc;return function(_0x10f213){if(_0x10f213){return _0x4d6234[_0x9237('0x1a')](_0x52cdfa);}return _0x4d6234[_0x9237('0x1b')](_0x52cdfa)[_0x9237('0x1c')]();};}function respondWithResult(_0x293159,_0x292475){_0x292475=_0x292475||0xc8;return function(_0x11500e){if(_0x11500e){return _0x293159['status'](_0x292475)[_0x9237('0x1d')](_0x11500e);}};}function respondWithFilteredResult(_0x5f1572,_0x3028de){return function(_0x1c105){if(_0x1c105){var _0x1286d9=typeof _0x3028de[_0x9237('0x1e')]==='undefined'&&typeof _0x3028de['limit']===_0x9237('0x1f');var _0x491212=_0x1c105[_0x9237('0x20')];var _0x11591b=_0x1286d9?0x0:_0x3028de['offset'];var _0x4b09d5=_0x1286d9?_0x1c105[_0x9237('0x20')]:_0x3028de[_0x9237('0x1e')]+_0x3028de[_0x9237('0x21')];var _0x561062;if(_0x4b09d5>=_0x491212){_0x4b09d5=_0x491212;_0x561062=0xc8;}else{_0x561062=0xce;}_0x5f1572[_0x9237('0x1b')](_0x561062);return _0x5f1572['set'](_0x9237('0x22'),_0x11591b+'-'+_0x4b09d5+'/'+_0x491212)[_0x9237('0x1d')](_0x1c105);}return null;};}function patchUpdates(_0x3e2d39){return function(_0x65f9ce){try{jsonpatch[_0x9237('0x23')](_0x65f9ce,_0x3e2d39,!![]);}catch(_0xda87bb){return BPromise[_0x9237('0x24')](_0xda87bb);}return _0x65f9ce[_0x9237('0x25')]();};}function saveUpdates(_0x969fd0,_0x25d575){return function(_0x4576d0){if(_0x4576d0){return _0x4576d0[_0x9237('0x26')](_0x969fd0)[_0x9237('0x27')](function(_0x454269){return _0x454269;});}return null;};}function removeEntity(_0x159918,_0x5eaa11){return function(_0x497dd4){if(_0x497dd4){return _0x497dd4['destroy']()[_0x9237('0x27')](function(){_0x159918[_0x9237('0x1b')](0xcc)[_0x9237('0x1c')]();});}};}function handleEntityNotFound(_0x550f2b,_0x4dd0da){return function(_0x35e8de){if(!_0x35e8de){_0x550f2b['sendStatus'](0x194);}return _0x35e8de;};}function handleError(_0xefad92,_0x225181){_0x225181=_0x225181||0x1f4;return function(_0x1df5c2){logger[_0x9237('0x28')](_0x1df5c2[_0x9237('0x29')]);if(_0x1df5c2[_0x9237('0x2a')]){delete _0x1df5c2[_0x9237('0x2a')];}_0xefad92[_0x9237('0x1b')](_0x225181)[_0x9237('0x2b')](_0x1df5c2);};}exports[_0x9237('0x2c')]=function(_0x86d71a,_0x3786a7){var _0x181123={},_0xfd23ea={},_0x508a2f={'count':0x0,'rows':[]};var _0x300118=_[_0x9237('0x2d')](db['VoiceRecording'][_0x9237('0x2e')],function(_0x4b1e88){return{'name':_0x4b1e88[_0x9237('0x2f')],'type':_0x4b1e88[_0x9237('0x30')][_0x9237('0x31')]};});_0xfd23ea[_0x9237('0x32')]=_[_0x9237('0x33')](_['map'](_0x300118,_0x9237('0x2a')),[_0x9237('0x34')]);_0xfd23ea[_0x9237('0x35')]=_[_0x9237('0x36')](_0x86d71a['query']);_0xfd23ea[_0x9237('0x37')]=_[_0x9237('0x38')](_0xfd23ea[_0x9237('0x32')],_0xfd23ea[_0x9237('0x35')]);_0x181123[_0x9237('0x39')]=_[_0x9237('0x38')](_0xfd23ea[_0x9237('0x32')],qs[_0x9237('0x3a')](_0x86d71a[_0x9237('0x35')]['fields']));_0x181123[_0x9237('0x39')]=_0x181123['attributes']['length']?_0x181123[_0x9237('0x39')]:_0xfd23ea['model'];if(!_0x86d71a['query'][_0x9237('0x3b')]('nolimit')){_0x181123[_0x9237('0x21')]=qs['limit'](_0x86d71a['query'][_0x9237('0x21')]);_0x181123[_0x9237('0x1e')]=qs[_0x9237('0x1e')](_0x86d71a['query'][_0x9237('0x1e')]);}_0x181123['order']=qs[_0x9237('0x3c')](_0x86d71a[_0x9237('0x35')][_0x9237('0x3c')]);_0x181123[_0x9237('0x3d')]=qs[_0x9237('0x37')](_[_0x9237('0x3e')](_0x86d71a['query'],_0xfd23ea[_0x9237('0x37')]),_0x300118);if(_0x86d71a[_0x9237('0x35')][_0x9237('0x3f')]){_0x181123[_0x9237('0x3d')]=_[_0x9237('0x40')](_0x181123[_0x9237('0x3d')],{'$or':_[_0x9237('0x2d')](_0x300118,function(_0x27323e){if(_0x27323e['type']!==_0x9237('0x41')){var _0x2ba4c8={};_0x2ba4c8[_0x27323e[_0x9237('0x2a')]]={'$like':'%'+_0x86d71a['query'][_0x9237('0x3f')]+'%'};return _0x2ba4c8;}})});}_0x181123=_[_0x9237('0x40')]({},_0x181123,_0x86d71a[_0x9237('0x42')]);var _0x1d2338={'where':_0x181123[_0x9237('0x3d')]};return db[_0x9237('0x43')]['count'](_0x1d2338)[_0x9237('0x27')](function(_0x12ea7e){_0x508a2f[_0x9237('0x20')]=_0x12ea7e;if(_0x86d71a['query'][_0x9237('0x44')]){_0x181123[_0x9237('0x45')]=[{'all':!![]}];}return db[_0x9237('0x43')]['findAll'](_0x181123);})[_0x9237('0x27')](function(_0x43c270){_0x508a2f['rows']=_0x43c270;return _0x508a2f;})[_0x9237('0x27')](respondWithFilteredResult(_0x3786a7,_0x181123))['catch'](handleError(_0x3786a7,null));};exports[_0x9237('0x46')]=function(_0x11a1de,_0x4d98d4){var _0x525852={'raw':![],'where':{'id':_0x11a1de['params']['id']}},_0x11a5b2={};_0x11a5b2['model']=_[_0x9237('0x36')](db[_0x9237('0x43')][_0x9237('0x2e')]);_0x11a5b2[_0x9237('0x35')]=_[_0x9237('0x36')](_0x11a1de[_0x9237('0x35')]);_0x11a5b2[_0x9237('0x37')]=_[_0x9237('0x38')](_0x11a5b2[_0x9237('0x32')],_0x11a5b2['query']);_0x525852[_0x9237('0x39')]=_[_0x9237('0x38')](_0x11a5b2[_0x9237('0x32')],qs[_0x9237('0x3a')](_0x11a1de[_0x9237('0x35')]['fields']));_0x525852[_0x9237('0x39')]=_0x525852[_0x9237('0x39')][_0x9237('0x47')]?_0x525852['attributes']:_0x11a5b2[_0x9237('0x32')];if(_0x11a1de[_0x9237('0x35')][_0x9237('0x44')]){_0x525852['include']=[{'all':!![]}];}_0x525852=_[_0x9237('0x40')]({},_0x525852,_0x11a1de[_0x9237('0x42')]);return db[_0x9237('0x43')][_0x9237('0x48')](_0x525852)[_0x9237('0x27')](handleEntityNotFound(_0x4d98d4,null))[_0x9237('0x27')](respondWithResult(_0x4d98d4,null))[_0x9237('0x49')](handleError(_0x4d98d4,null));};exports[_0x9237('0x4a')]=function(_0x2b591c,_0x380d69){return db[_0x9237('0x43')][_0x9237('0x4a')](_0x2b591c['body'],{})['then'](respondWithResult(_0x380d69,0xc9))[_0x9237('0x49')](handleError(_0x380d69,null));};exports[_0x9237('0x26')]=function(_0x30c8da,_0x48f616){if(_0x30c8da[_0x9237('0x4b')]['id']){delete _0x30c8da[_0x9237('0x4b')]['id'];}return db[_0x9237('0x43')][_0x9237('0x48')]({'where':{'id':_0x30c8da[_0x9237('0x4c')]['id']}})[_0x9237('0x27')](handleEntityNotFound(_0x48f616,null))[_0x9237('0x27')](saveUpdates(_0x30c8da['body'],null))[_0x9237('0x27')](respondWithResult(_0x48f616,null))['catch'](handleError(_0x48f616,null));};exports[_0x9237('0x4d')]=function(_0x1e0247,_0x502c66){return db['VoiceRecording'][_0x9237('0x4d')]()['then'](respondWithResult(_0x502c66,null))[_0x9237('0x49')](handleError(_0x502c66,null));};exports[_0x9237('0x4e')]=function(_0x3f1b63,_0x349247,_0x20c833){var _0x468845=require(_0x9237('0x4f'));var _0x561dd8=![];var _0x42a450={};if(_0x3f1b63[_0x9237('0x35')][_0x9237('0x30')]&&_0x3f1b63['query']['type']===_0x9237('0x50')){_0x42a450[_0x9237('0x50')]=_0x3f1b63[_0x9237('0x4c')]['id'];}else{_0x42a450['id']=_0x3f1b63['params']['id'];}return db[_0x9237('0x43')][_0x9237('0x48')]({'where':_0x42a450,'attributes':['id',_0x9237('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x349247,null))[_0x9237('0x27')](function(_0xae8208){if(_0xae8208){var _0x4d5b9e=_0xae8208[_0x9237('0x51')];var _0x377f86=util[_0x9237('0x34')](_0x9237('0x52'),_0x4d5b9e);if(fs[_0x9237('0x53')](_0x377f86)){_0x561dd8=!![];return _0x468845[_0x9237('0x54')](_0x377f86,_0x4d5b9e,config['secrets'][_0x9237('0x55')])[_0x9237('0x27')](function(){return _0xae8208;});}return _0xae8208;}})[_0x9237('0x27')](function(_0x2ea9ab){if(_0x2ea9ab){var _0x1613f0=_0x2ea9ab[_0x9237('0x51')];if(!fs['existsSync'](_0x1613f0)){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))](_0x9237('0x58'));}if(_0x2ea9ab['filename']){return _0x349247[_0x9237('0x4e')](_0x1613f0,_0x2ea9ab[_0x9237('0x59')]+path[_0x9237('0x5a')](_0x1613f0),function(){if(_0x561dd8){fs[_0x9237('0x5b')](_0x1613f0);}});}else{return _0x349247[_0x9237('0x4e')](_0x1613f0,function(_0x358cae){if(_0x561dd8){fs[_0x9237('0x5b')](_0x1613f0);}});}}})['catch'](function(_0x4b633e){if(_0x4b633e[_0x9237('0x5c')]===_0x9237('0x58')){_0x349247[_0x9237('0x1b')](0x194)[_0x9237('0x2b')](_0x9237('0x5d'));}else{return handleError(_0x349247,null);}});};exports[_0x9237('0x5e')]=function(_0x5e617f,_0x1b0603,_0x445aa7){var _0x1ce7a6=require(_0x9237('0x4f'));var _0x466800=![];var _0x598159={'$and':[db[_0x9237('0x5f')][_0x9237('0x3d')](db[_0x9237('0x5f')]['fn'](_0x9237('0x60'),db[_0x9237('0x5f')]['col'](_0x9237('0x50'))),_0x5e617f['query'][_0x9237('0x61')])]};if(_0x5e617f[_0x9237('0x35')][_0x9237('0x30')]&&_0x5e617f[_0x9237('0x35')][_0x9237('0x30')]===_0x9237('0x50')){_0x598159[_0x9237('0x62')]['push']({'uniqueid':_0x5e617f[_0x9237('0x4c')]['id']});}else{_0x598159['$and'][_0x9237('0x63')]({'id':_0x5e617f[_0x9237('0x4c')]['id']});}return db[_0x9237('0x43')][_0x9237('0x48')]({'where':_0x598159,'attributes':['id',_0x9237('0x51')],'raw':!![]})[_0x9237('0x27')](handleEntityNotFound(_0x1b0603,null))[_0x9237('0x27')](function(_0x338859){if(_0x338859){var _0x31fae4=util['format'](_0x9237('0x52'),_0x338859['value']);if(fs[_0x9237('0x53')](_0x31fae4)){_0x466800=!![];return _0x1ce7a6[_0x9237('0x54')](_0x31fae4,_0x338859[_0x9237('0x51')],config[_0x9237('0x64')][_0x9237('0x55')])['then'](function(){return _0x338859;});}return _0x338859;}})[_0x9237('0x27')](function(_0x4a2b6c){if(_0x4a2b6c){if(!fs[_0x9237('0x53')](_0x4a2b6c[_0x9237('0x51')])){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x4a2b6c[_0x9237('0x59')]){return _0x1b0603[_0x9237('0x4e')](_0x4a2b6c['value'],_0x4a2b6c[_0x9237('0x59')]+path[_0x9237('0x5a')](_0x4a2b6c[_0x9237('0x51')]),function(){if(_0x466800){fs[_0x9237('0x5b')](_0x4a2b6c[_0x9237('0x51')]);}});}else{return _0x1b0603[_0x9237('0x4e')](_0x4a2b6c[_0x9237('0x51')],function(_0x232233){if(_0x466800){fs['unlink'](_0x4a2b6c[_0x9237('0x51')]);}});}}})[_0x9237('0x49')](handleError(_0x1b0603,null));};exports[_0x9237('0x65')]=function(_0x540c89,_0x5aa133){return db[_0x9237('0x43')]['find']({'where':{'id':_0x540c89['params']['id']}})[_0x9237('0x27')](function(_0x460397){if(_[_0x9237('0x66')](_0x460397)){throw new ReferenceError('Entity\x20not\x20found');}return _0x460397;})['then'](function(_0x2d6657){var _0x54b5ce=_0x2d6657[_0x9237('0x51')];logger[_0x9237('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x54b5ce);if(!_[_0x9237('0x66')](_0x2d6657[_0x9237('0x51')])&&fs[_0x9237('0x53')](_0x54b5ce)){logger[_0x9237('0x67')](_0x9237('0x68')+_0x54b5ce+_0x9237('0x69'));fs[_0x9237('0x6a')](_0x54b5ce);}_0x54b5ce=_0x54b5ce+_0x9237('0x6b');if(!_[_0x9237('0x66')](_0x2d6657[_0x9237('0x51')])&&fs['existsSync'](_0x54b5ce)){logger[_0x9237('0x67')]('File:\x20\x22'+_0x54b5ce+_0x9237('0x69'));fs['unlinkSync'](_0x54b5ce);}return _0x2d6657;})[_0x9237('0x27')](function(_0x18aa0e){if(!_0x18aa0e)throw new InternalError();return _0x18aa0e[_0x9237('0x65')]();})[_0x9237('0x27')](function(){_0x5aa133[_0x9237('0x1b')](0xcc)[_0x9237('0x1c')]();})['catch'](handleError(_0x5aa133,null));};function getBucketslist(_0x212301,_0x265f86,_0xc46751){return new Promise(function(_0x56e7d8,_0x2367e5){var _0x3e43df=new AWS['S3']({'accessKeyId':_0x265f86,'secretAccessKey':_0x212301,'region':_0xc46751});_0x3e43df[_0x9237('0x6c')]({},function(_0x1e3667,_0x36b312){if(_0x1e3667){return _0x2367e5(_0x1e3667);}else{return _0x56e7d8(_0x36b312);}});});}function createBucket(_0x3de5e1,_0x4b09c7,_0x3cc8a8,_0x1b7d34){return new Promise(function(_0x2e6102,_0x2b9b20){var _0x4e947b=new AWS['S3']({'accessKeyId':_0x4b09c7,'secretAccessKey':_0x3de5e1,'region':_0x3cc8a8});_0x4e947b[_0x9237('0x6d')]({'Bucket':_0x1b7d34},function(_0x32cf88,_0x3570ab){if(_0x32cf88){return _0x2b9b20(_0x32cf88);}else{return _0x2e6102(_0x3570ab);}});});}function uploadFile(_0x38137a,_0x344a4c,_0x24c27e,_0x4e8d19,_0x8b7ddc,_0x12dc6b){return new Promise(function(_0x5d96ce,_0x6ca411){var _0x55fb0c=new AWS['S3']({'accessKeyId':_0x344a4c,'secretAccessKey':_0x38137a,'region':_0x24c27e});_0x55fb0c['upload']({'Bucket':_0x4e8d19,'Key':_0x8b7ddc,'Body':_0x12dc6b},function(_0x2f2ad8,_0x25188b){if(_0x2f2ad8){return _0x6ca411(_0x2f2ad8);}else{return _0x5d96ce(_0x25188b);}});});}function startTranscribe(_0x18297a,_0x2ce5a5,_0x3fa1e8,_0xefae09,_0x4deec,_0x1f4055){return new Promise(function(_0x2a7cc0,_0x1a07ff){var _0x194729=new AWS[(_0x9237('0x6e'))]({'accessKeyId':_0x2ce5a5,'secretAccessKey':_0x18297a,'region':_0x3fa1e8});_0x194729[_0x9237('0x6f')]({'TranscriptionJobName':_0xefae09,'LanguageCode':_0x4deec,'Media':{'MediaFileUri':_0x1f4055}},function(_0x2f970b,_0x5f1225){if(_0x2f970b){return _0x1a07ff(_0x2f970b);}else{return _0x2a7cc0(_0x5f1225);}});});}function transcribe(_0x18443b,_0x26d584,_0xad9d7a,_0x533dea,_0x4ad46d,_0x128c16,_0x2874bb){return new Promise(function(_0x177daf,_0x32f04a){var _0x40097a={};logger[_0x9237('0x67')](util['format'](_0x9237('0x70'),_0x18443b,_0x4ad46d));return uploadFile(_0x26d584,_0xad9d7a,_0x533dea,_0x4ad46d,path['basename'](_0x128c16),fs[_0x9237('0x71')](_0x128c16))[_0x9237('0x27')](function(_0x3cf01a){logger['info'](util[_0x9237('0x34')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x18443b,_0x4ad46d,_0x3cf01a[_0x9237('0x72')]));_0x40097a[_0x9237('0x73')]=_0x3cf01a[_0x9237('0x74')];_0x40097a['location']=_0x3cf01a[_0x9237('0x72')];logger['info'](util['format'](_0x9237('0x75'),_0x18443b));return startTranscribe(_0x26d584,_0xad9d7a,_0x533dea,uuidv4(),_0x2874bb,_0x3cf01a[_0x9237('0x72')]);})[_0x9237('0x27')](function(_0x33fa71){logger[_0x9237('0x67')](util[_0x9237('0x34')](_0x9237('0x76'),_0x18443b,_0x33fa71[_0x9237('0x77')][_0x9237('0x78')]));_0x40097a[_0x9237('0x79')]=_0x33fa71[_0x9237('0x77')][_0x9237('0x78')];_0x40097a[_0x9237('0x7a')]=_0x33fa71[_0x9237('0x77')]['TranscriptionJobStatus'];return _0x177daf(_0x40097a);})[_0x9237('0x49')](function(_0x2653c1){return _0x32f04a(_0x2653c1);});});}exports[_0x9237('0x7b')]=function(_0x4e1786,_0xd2fb75,_0xc45259){var _0x5cb022;var _0x4b6c05;var _0x45fab5;var _0x189b7a=require(_0x9237('0x4f'));return db[_0x9237('0x43')][_0x9237('0x7c')]({'where':{'id':_0x4e1786['params']['id']}})['then'](function(_0x1d9b1a){if(_0x1d9b1a){var _0x207934=util[_0x9237('0x34')](_0x9237('0x52'),_0x1d9b1a[_0x9237('0x51')]);if(fs[_0x9237('0x53')](_0x207934)){cypher=!![];return _0x189b7a[_0x9237('0x54')](_0x207934,_0x1d9b1a['value'],config[_0x9237('0x64')][_0x9237('0x55')])[_0x9237('0x27')](function(){return _0x1d9b1a;});}return _0x1d9b1a;}})[_0x9237('0x27')](function(_0x1031ef){if(!_0x1031ef){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x4b6c05=_0x1031ef;return db[_0x9237('0x7d')][_0x9237('0x7c')]({'where':{'id':0x1}});})[_0x9237('0x27')](handleEntityNotFound(_0xd2fb75,null))[_0x9237('0x27')](function(_0x486f29){if(_0x486f29){_0x5cb022=_0x486f29;if(!_0x5cb022[_0x9237('0x7e')]||!_0x5cb022[_0x9237('0x7f')]||!_0x5cb022['transcribeRegion']||!_0x5cb022[_0x9237('0x80')]||!_0x5cb022[_0x9237('0x73')]){throw new db[(_0x9237('0x56'))]['ValidationError'](_0x9237('0x81'));}if(_0x4e1786[_0x9237('0x4b')]['runSentiment']&&(!_0x5cb022['sentiment']||!_0x5cb022[_0x9237('0x82')]||!_0x5cb022[_0x9237('0x83')]||!_0x5cb022[_0x9237('0x80')]||!_0x5cb022['bucket'])){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))](_0x9237('0x84'));}return db[_0x9237('0x85')]['findOne']({'where':{'id':_0x5cb022['transcribeAccountId']}});}})[_0x9237('0x27')](function(_0x553625){if(!_0x553625){throw new db[(_0x9237('0x56'))][(_0x9237('0x57'))](_0x9237('0x86'));}if(!_0x553625[_0x9237('0x87')]||!_0x553625[_0x9237('0x88')]){throw new db['Sequelize'][(_0x9237('0x57'))](_0x9237('0x89'));}_0x45fab5=_0x553625;return getBucketslist(_0x45fab5[_0x9237('0x87')],_0x45fab5[_0x9237('0x88')],_0x5cb022['transcribeRegion']);})[_0x9237('0x27')](function(_0x3f1b5c){if(_0x3f1b5c&&_0x3f1b5c[_0x9237('0x8a')]){var _0x50afeb=_[_0x9237('0x48')](_0x3f1b5c['Buckets'],function(_0x1746b9){return _0x1746b9[_0x9237('0x8b')]===_0x5cb022[_0x9237('0x73')];});if(!_0x50afeb){logger[_0x9237('0x67')](util[_0x9237('0x34')](_0x9237('0x8c'),_0x4e1786['params']['id'],_0x5cb022['bucket']));return createBucket(_0x45fab5[_0x9237('0x87')],_0x45fab5[_0x9237('0x88')],_0x5cb022[_0x9237('0x8d')],_0x5cb022[_0x9237('0x73')]);}logger['info'](util[_0x9237('0x34')](_0x9237('0x8e'),_0x4e1786['params']['id'],_0x5cb022['bucket']));return;}})[_0x9237('0x27')](function(_0x77be6c){if(_0x4b6c05[_0x9237('0x7a')]===_0x9237('0x8f')){return transcribe(_0x4e1786[_0x9237('0x4c')]['id'],_0x45fab5[_0x9237('0x87')],_0x45fab5[_0x9237('0x88')],_0x5cb022['transcribeRegion'],_0x5cb022[_0x9237('0x73')],_0x4b6c05[_0x9237('0x51')],_0x5cb022[_0x9237('0x80')]);}else{logger[_0x9237('0x67')](util[_0x9237('0x34')](_0x9237('0x90'),_0x4e1786[_0x9237('0x4c')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x9237('0x27')](function(_0x3d4f30){if(_0x3d4f30){_0x3d4f30[_0x9237('0x91')]=_0x4e1786[_0x9237('0x4b')][_0x9237('0x92')];return _0x4b6c05[_0x9237('0x93')](_0x3d4f30);}})[_0x9237('0x27')](respondWithResult(_0xd2fb75,null))[_0x9237('0x49')](handleError(_0xd2fb75,null));};function writeFile(_0x3afa5a,_0x37921d){return new Promise(function(_0x114959,_0x55acf1){fs[_0x9237('0x94')](_0x37921d,_0x3afa5a,function(_0x223ccc,_0x52c5cf){if(_0x223ccc){return _0x55acf1(_0x223ccc);}else{return _0x114959(_0x52c5cf);}});});}exports[_0x9237('0x95')]=function(_0x16db49,_0x3aafa5,_0x49861f){return db['VoiceRecording'][_0x9237('0x7c')]({'where':{'id':_0x16db49[_0x9237('0x4c')]['id']}})[_0x9237('0x27')](handleEntityNotFound(_0x3aafa5))[_0x9237('0x27')](function(_0x3b10f0){if(_0x3b10f0&&_0x3b10f0[_0x9237('0x96')]){var _0x4adb00=_0x3b10f0['fileText'];var _0x4ec7dc=config[_0x9237('0x97')]+_0x9237('0x98')+_0x3b10f0['id']+_0x9237('0x99');if(fs[_0x9237('0x53')](_0x4ec7dc)){return _0x4ec7dc;}return writeFile(_0x4adb00,_0x4ec7dc)[_0x9237('0x27')](function(){return _0x4ec7dc;});}else{throw new db['Sequelize']['ValidationError'](_0x9237('0x9a'));}})['then'](function(_0x596725){return _0x3aafa5[_0x9237('0x4e')](_0x596725);})[_0x9237('0x49')](handleError(_0x3aafa5));}; \ No newline at end of file +var _0x7d3d=['path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','destroy','then','sendStatus','stack','name','map','VoiceRecording','fieldName','type','model','differenceBy','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','update','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','download','filename','extname','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','push','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','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','Bucket','location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','util'];(function(_0x3cb52a,_0x5a586d){var _0x4e6bab=function(_0xd38f5){while(--_0xd38f5){_0x3cb52a['push'](_0x3cb52a['shift']());}};_0x4e6bab(++_0x5a586d);}(_0x7d3d,0x88));var _0xd7d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7d3d[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xd7d3('0x0'));var rimraf=require(_0xd7d3('0x1'));var zipdir=require(_0xd7d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7d3('0x4'));var path=require(_0xd7d3('0x5'));var sox=require(_0xd7d3('0x6'));var csv=require('to-csv');var ejs=require(_0xd7d3('0x7'));var fs=require('fs');var fs_extra=require(_0xd7d3('0x8'));var _=require('lodash');var squel=require(_0xd7d3('0x9'));var crypto=require(_0xd7d3('0xa'));var jsforce=require(_0xd7d3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd7d3('0xc'));var querystring=require(_0xd7d3('0xd'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xd7d3('0xe'));var qs=require(_0xd7d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7d3('0x10'));var logger=require(_0xd7d3('0x11'))(_0xd7d3('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd7d3('0x13'))['db'];function respondWithStatusCode(_0xf55c42,_0x499443){_0x499443=_0x499443||0xcc;return function(_0x156b22){if(_0x156b22){return _0xf55c42['sendStatus'](_0x499443);}return _0xf55c42['status'](_0x499443)[_0xd7d3('0x14')]();};}function respondWithResult(_0x41c17a,_0x4d2232){_0x4d2232=_0x4d2232||0xc8;return function(_0x329dc2){if(_0x329dc2){return _0x41c17a['status'](_0x4d2232)['json'](_0x329dc2);}};}function respondWithFilteredResult(_0xcd9fdb,_0x2df385){return function(_0x3c1542){if(_0x3c1542){var _0x433ec1=typeof _0x2df385[_0xd7d3('0x15')]===_0xd7d3('0x16')&&typeof _0x2df385[_0xd7d3('0x17')]===_0xd7d3('0x16');var _0x3b7a3e=_0x3c1542[_0xd7d3('0x18')];var _0x45949f=_0x433ec1?0x0:_0x2df385[_0xd7d3('0x15')];var _0x3e7f3c=_0x433ec1?_0x3c1542[_0xd7d3('0x18')]:_0x2df385['offset']+_0x2df385[_0xd7d3('0x17')];var _0x15d1c4;if(_0x3e7f3c>=_0x3b7a3e){_0x3e7f3c=_0x3b7a3e;_0x15d1c4=0xc8;}else{_0x15d1c4=0xce;}_0xcd9fdb[_0xd7d3('0x19')](_0x15d1c4);return _0xcd9fdb[_0xd7d3('0x1a')](_0xd7d3('0x1b'),_0x45949f+'-'+_0x3e7f3c+'/'+_0x3b7a3e)[_0xd7d3('0x1c')](_0x3c1542);}return null;};}function patchUpdates(_0x473af2){return function(_0x1bcd80){try{jsonpatch[_0xd7d3('0x1d')](_0x1bcd80,_0x473af2,!![]);}catch(_0x3e0b57){return BPromise['reject'](_0x3e0b57);}return _0x1bcd80[_0xd7d3('0x1e')]();};}function saveUpdates(_0x54b072,_0x51220b){return function(_0xcf852c){if(_0xcf852c){return _0xcf852c['update'](_0x54b072)['then'](function(_0x433e7c){return _0x433e7c;});}return null;};}function removeEntity(_0x4b6a27,_0x4844a4){return function(_0x24518a){if(_0x24518a){return _0x24518a[_0xd7d3('0x1f')]()[_0xd7d3('0x20')](function(){_0x4b6a27['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x119078,_0x305c3a){return function(_0x5f396b){if(!_0x5f396b){_0x119078[_0xd7d3('0x21')](0x194);}return _0x5f396b;};}function handleError(_0x45eb5b,_0x32cfb9){_0x32cfb9=_0x32cfb9||0x1f4;return function(_0x4d9ce5){logger['error'](_0x4d9ce5[_0xd7d3('0x22')]);if(_0x4d9ce5[_0xd7d3('0x23')]){delete _0x4d9ce5['name'];}_0x45eb5b['status'](_0x32cfb9)['send'](_0x4d9ce5);};}exports['index']=function(_0x1186da,_0x1a8f0b){var _0xedd102={},_0x1f436e={},_0x5236d4={'count':0x0,'rows':[]};var _0x220814=_[_0xd7d3('0x24')](db[_0xd7d3('0x25')]['rawAttributes'],function(_0x1f83eb){return{'name':_0x1f83eb[_0xd7d3('0x26')],'type':_0x1f83eb[_0xd7d3('0x27')]['key']};});_0x1f436e[_0xd7d3('0x28')]=_[_0xd7d3('0x29')](_[_0xd7d3('0x24')](_0x220814,_0xd7d3('0x23')),[_0xd7d3('0x2a')]);_0x1f436e['query']=_[_0xd7d3('0x2b')](_0x1186da[_0xd7d3('0x2c')]);_0x1f436e[_0xd7d3('0x2d')]=_[_0xd7d3('0x2e')](_0x1f436e[_0xd7d3('0x28')],_0x1f436e['query']);_0xedd102['attributes']=_[_0xd7d3('0x2e')](_0x1f436e[_0xd7d3('0x28')],qs[_0xd7d3('0x2f')](_0x1186da['query'][_0xd7d3('0x2f')]));_0xedd102[_0xd7d3('0x30')]=_0xedd102[_0xd7d3('0x30')][_0xd7d3('0x31')]?_0xedd102[_0xd7d3('0x30')]:_0x1f436e[_0xd7d3('0x28')];if(!_0x1186da[_0xd7d3('0x2c')][_0xd7d3('0x32')](_0xd7d3('0x33'))){_0xedd102[_0xd7d3('0x17')]=qs['limit'](_0x1186da['query']['limit']);_0xedd102[_0xd7d3('0x15')]=qs[_0xd7d3('0x15')](_0x1186da['query']['offset']);}_0xedd102[_0xd7d3('0x34')]=qs[_0xd7d3('0x35')](_0x1186da[_0xd7d3('0x2c')][_0xd7d3('0x35')]);_0xedd102['where']=qs[_0xd7d3('0x2d')](_[_0xd7d3('0x36')](_0x1186da['query'],_0x1f436e[_0xd7d3('0x2d')]),_0x220814);if(_0x1186da[_0xd7d3('0x2c')][_0xd7d3('0x37')]){_0xedd102[_0xd7d3('0x38')]=_[_0xd7d3('0x39')](_0xedd102['where'],{'$or':_[_0xd7d3('0x24')](_0x220814,function(_0x5e5745){if(_0x5e5745[_0xd7d3('0x27')]!==_0xd7d3('0x3a')){var _0x913964={};_0x913964[_0x5e5745[_0xd7d3('0x23')]]={'$like':'%'+_0x1186da[_0xd7d3('0x2c')][_0xd7d3('0x37')]+'%'};return _0x913964;}})});}_0xedd102=_[_0xd7d3('0x39')]({},_0xedd102,_0x1186da[_0xd7d3('0x3b')]);var _0x4eabea={'where':_0xedd102[_0xd7d3('0x38')]};return db[_0xd7d3('0x25')][_0xd7d3('0x18')](_0x4eabea)['then'](function(_0xaeff0c){_0x5236d4[_0xd7d3('0x18')]=_0xaeff0c;if(_0x1186da['query'][_0xd7d3('0x3c')]){_0xedd102['include']=[{'all':!![]}];}return db[_0xd7d3('0x25')][_0xd7d3('0x3d')](_0xedd102);})[_0xd7d3('0x20')](function(_0x3518b1){_0x5236d4['rows']=_0x3518b1;return _0x5236d4;})[_0xd7d3('0x20')](respondWithFilteredResult(_0x1a8f0b,_0xedd102))[_0xd7d3('0x3e')](handleError(_0x1a8f0b,null));};exports[_0xd7d3('0x3f')]=function(_0x2ba494,_0x2bbb15){var _0x6b3050={'raw':![],'where':{'id':_0x2ba494[_0xd7d3('0x40')]['id']}},_0x3017fb={};_0x3017fb[_0xd7d3('0x28')]=_[_0xd7d3('0x2b')](db['VoiceRecording']['rawAttributes']);_0x3017fb[_0xd7d3('0x2c')]=_['keys'](_0x2ba494[_0xd7d3('0x2c')]);_0x3017fb[_0xd7d3('0x2d')]=_[_0xd7d3('0x2e')](_0x3017fb['model'],_0x3017fb['query']);_0x6b3050['attributes']=_[_0xd7d3('0x2e')](_0x3017fb[_0xd7d3('0x28')],qs[_0xd7d3('0x2f')](_0x2ba494[_0xd7d3('0x2c')][_0xd7d3('0x2f')]));_0x6b3050[_0xd7d3('0x30')]=_0x6b3050[_0xd7d3('0x30')][_0xd7d3('0x31')]?_0x6b3050[_0xd7d3('0x30')]:_0x3017fb[_0xd7d3('0x28')];if(_0x2ba494[_0xd7d3('0x2c')][_0xd7d3('0x3c')]){_0x6b3050['include']=[{'all':!![]}];}_0x6b3050=_[_0xd7d3('0x39')]({},_0x6b3050,_0x2ba494[_0xd7d3('0x3b')]);return db[_0xd7d3('0x25')][_0xd7d3('0x41')](_0x6b3050)[_0xd7d3('0x20')](handleEntityNotFound(_0x2bbb15,null))[_0xd7d3('0x20')](respondWithResult(_0x2bbb15,null))[_0xd7d3('0x3e')](handleError(_0x2bbb15,null));};exports[_0xd7d3('0x42')]=function(_0x2b14a0,_0x4bb50b){return db[_0xd7d3('0x25')][_0xd7d3('0x42')](_0x2b14a0[_0xd7d3('0x43')],{})['then'](respondWithResult(_0x4bb50b,0xc9))['catch'](handleError(_0x4bb50b,null));};exports[_0xd7d3('0x44')]=function(_0x1a84d4,_0x232886){if(_0x1a84d4[_0xd7d3('0x43')]['id']){delete _0x1a84d4[_0xd7d3('0x43')]['id'];}return db['VoiceRecording'][_0xd7d3('0x41')]({'where':{'id':_0x1a84d4[_0xd7d3('0x40')]['id']}})[_0xd7d3('0x20')](handleEntityNotFound(_0x232886,null))[_0xd7d3('0x20')](saveUpdates(_0x1a84d4['body'],null))[_0xd7d3('0x20')](respondWithResult(_0x232886,null))['catch'](handleError(_0x232886,null));};exports['describe']=function(_0x448220,_0x158a0b){return db[_0xd7d3('0x25')]['describe']()[_0xd7d3('0x20')](respondWithResult(_0x158a0b,null))[_0xd7d3('0x3e')](handleError(_0x158a0b,null));};exports['download']=function(_0x1bcde3,_0xebc612,_0x96c211){var _0x28df5d=require('../../components/encryptor');var _0x413ba3=![];var _0x1034a2={};if(_0x1bcde3[_0xd7d3('0x2c')][_0xd7d3('0x27')]&&_0x1bcde3[_0xd7d3('0x2c')][_0xd7d3('0x27')]===_0xd7d3('0x45')){_0x1034a2[_0xd7d3('0x45')]=_0x1bcde3[_0xd7d3('0x40')]['id'];}else{_0x1034a2['id']=_0x1bcde3['params']['id'];}return db[_0xd7d3('0x25')][_0xd7d3('0x41')]({'where':_0x1034a2,'attributes':['id',_0xd7d3('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0xebc612,null))['then'](function(_0x16cede){if(_0x16cede){var _0x3a2d94=_0x16cede[_0xd7d3('0x46')];var _0x18eb22=util[_0xd7d3('0x2a')](_0xd7d3('0x47'),_0x3a2d94);if(fs[_0xd7d3('0x48')](_0x18eb22)){_0x413ba3=!![];return _0x28df5d[_0xd7d3('0x49')](_0x18eb22,_0x3a2d94,config[_0xd7d3('0x4a')][_0xd7d3('0x4b')])[_0xd7d3('0x20')](function(){return _0x16cede;});}return _0x16cede;}})[_0xd7d3('0x20')](function(_0x5c8bc4){if(_0x5c8bc4){var _0x466331=_0x5c8bc4[_0xd7d3('0x46')];if(!fs[_0xd7d3('0x48')](_0x466331)){throw new db['Sequelize'][(_0xd7d3('0x4c'))]('VoiceRecording\x20not\x20found');}if(_0x5c8bc4['filename']){return _0xebc612[_0xd7d3('0x4d')](_0x466331,_0x5c8bc4[_0xd7d3('0x4e')]+path[_0xd7d3('0x4f')](_0x466331),function(){if(_0x413ba3){fs[_0xd7d3('0x50')](_0x466331);}});}else{return _0xebc612[_0xd7d3('0x4d')](_0x466331,function(_0x3952f8){if(_0x413ba3){fs[_0xd7d3('0x50')](_0x466331);}});}}})[_0xd7d3('0x3e')](function(_0x41a650){if(_0x41a650[_0xd7d3('0x51')]===_0xd7d3('0x52')){_0xebc612[_0xd7d3('0x19')](0x194)['send']('Not\x20found');}else{return handleError(_0xebc612,null);}});};exports[_0xd7d3('0x53')]=function(_0x5e83d6,_0xd0c1a6,_0x277fe0){var _0x2291f2=require('../../components/encryptor');var _0x5a33a6=![];var _0x34ba90={'$and':[db['sequelize'][_0xd7d3('0x38')](db[_0xd7d3('0x54')]['fn'](_0xd7d3('0x55'),db[_0xd7d3('0x54')]['col']('uniqueid')),_0x5e83d6[_0xd7d3('0x2c')]['token'])]};if(_0x5e83d6['query'][_0xd7d3('0x27')]&&_0x5e83d6[_0xd7d3('0x2c')][_0xd7d3('0x27')]==='uniqueid'){_0x34ba90['$and'][_0xd7d3('0x56')]({'uniqueid':_0x5e83d6[_0xd7d3('0x40')]['id']});}else{_0x34ba90['$and'][_0xd7d3('0x56')]({'id':_0x5e83d6['params']['id']});}return db[_0xd7d3('0x25')]['find']({'where':_0x34ba90,'attributes':['id','value'],'raw':!![]})[_0xd7d3('0x20')](handleEntityNotFound(_0xd0c1a6,null))[_0xd7d3('0x20')](function(_0x478099){if(_0x478099){var _0x2e9e28=util[_0xd7d3('0x2a')](_0xd7d3('0x47'),_0x478099[_0xd7d3('0x46')]);if(fs['existsSync'](_0x2e9e28)){_0x5a33a6=!![];return _0x2291f2['decryptFile'](_0x2e9e28,_0x478099[_0xd7d3('0x46')],config[_0xd7d3('0x4a')][_0xd7d3('0x4b')])[_0xd7d3('0x20')](function(){return _0x478099;});}return _0x478099;}})['then'](function(_0x471993){if(_0x471993){if(!fs['existsSync'](_0x471993[_0xd7d3('0x46')])){throw new db[(_0xd7d3('0x57'))][(_0xd7d3('0x4c'))](_0xd7d3('0x52'));}if(_0x471993[_0xd7d3('0x4e')]){return _0xd0c1a6[_0xd7d3('0x4d')](_0x471993[_0xd7d3('0x46')],_0x471993[_0xd7d3('0x4e')]+path['extname'](_0x471993[_0xd7d3('0x46')]),function(){if(_0x5a33a6){fs['unlink'](_0x471993[_0xd7d3('0x46')]);}});}else{return _0xd0c1a6['download'](_0x471993[_0xd7d3('0x46')],function(_0x2f15dc){if(_0x5a33a6){fs['unlink'](_0x471993[_0xd7d3('0x46')]);}});}}})['catch'](handleError(_0xd0c1a6,null));};exports['destroy']=function(_0x1b726a,_0xc4c2c4){return db['VoiceRecording'][_0xd7d3('0x41')]({'where':{'id':_0x1b726a[_0xd7d3('0x40')]['id']}})[_0xd7d3('0x20')](function(_0x33b3b5){if(_[_0xd7d3('0x58')](_0x33b3b5)){throw new ReferenceError(_0xd7d3('0x59'));}return _0x33b3b5;})['then'](function(_0x27546e){var _0x1493d6=_0x27546e['value'];logger[_0xd7d3('0x5a')](_0xd7d3('0x5b'),_0x1493d6);if(!_['isNil'](_0x27546e[_0xd7d3('0x46')])&&fs[_0xd7d3('0x48')](_0x1493d6)){logger[_0xd7d3('0x5a')](_0xd7d3('0x5c')+_0x1493d6+_0xd7d3('0x5d'));fs[_0xd7d3('0x5e')](_0x1493d6);}_0x1493d6=_0x1493d6+_0xd7d3('0x5f');if(!_[_0xd7d3('0x58')](_0x27546e[_0xd7d3('0x46')])&&fs['existsSync'](_0x1493d6)){logger[_0xd7d3('0x5a')](_0xd7d3('0x5c')+_0x1493d6+_0xd7d3('0x5d'));fs[_0xd7d3('0x5e')](_0x1493d6);}return _0x27546e;})[_0xd7d3('0x20')](function(_0x166009){if(!_0x166009)throw new InternalError();return _0x166009['destroy']();})[_0xd7d3('0x20')](function(){_0xc4c2c4[_0xd7d3('0x19')](0xcc)[_0xd7d3('0x14')]();})['catch'](handleError(_0xc4c2c4,null));};function getBucketslist(_0x53453e,_0x5d1710,_0x406fbd){return new Promise(function(_0x3a5aa5,_0xc8b517){var _0x454ed5=new AWS['S3']({'accessKeyId':_0x5d1710,'secretAccessKey':_0x53453e,'region':_0x406fbd});_0x454ed5[_0xd7d3('0x60')]({},function(_0x5947dc,_0x536af4){if(_0x5947dc){return _0xc8b517(_0x5947dc);}else{return _0x3a5aa5(_0x536af4);}});});}function createBucket(_0x3d51ed,_0x20a80d,_0x4dbe53,_0x5aad43){return new Promise(function(_0x25ddf1,_0x790fba){var _0x50245e=new AWS['S3']({'accessKeyId':_0x20a80d,'secretAccessKey':_0x3d51ed,'region':_0x4dbe53});_0x50245e['createBucket']({'Bucket':_0x5aad43},function(_0x55e354,_0x204d56){if(_0x55e354){return _0x790fba(_0x55e354);}else{return _0x25ddf1(_0x204d56);}});});}function uploadFile(_0x2e673e,_0x4796c7,_0x2ae42f,_0x9188c9,_0x486a55,_0x39c0f3){return new Promise(function(_0xfda2d6,_0x2f88de){var _0x57350b=new AWS['S3']({'accessKeyId':_0x4796c7,'secretAccessKey':_0x2e673e,'region':_0x2ae42f});_0x57350b['upload']({'Bucket':_0x9188c9,'Key':_0x486a55,'Body':_0x39c0f3},function(_0x1cc0c2,_0xa81b85){if(_0x1cc0c2){return _0x2f88de(_0x1cc0c2);}else{return _0xfda2d6(_0xa81b85);}});});}function startTranscribe(_0x285c07,_0x4d06a0,_0x274224,_0xcaee25,_0x3b9b3b,_0x4cd4db){return new Promise(function(_0x5b8d32,_0x3a7917){var _0x4be24d=new AWS[(_0xd7d3('0x61'))]({'accessKeyId':_0x4d06a0,'secretAccessKey':_0x285c07,'region':_0x274224});_0x4be24d[_0xd7d3('0x62')]({'TranscriptionJobName':_0xcaee25,'LanguageCode':_0x3b9b3b,'Media':{'MediaFileUri':_0x4cd4db}},function(_0x137acf,_0x3974bb){if(_0x137acf){return _0x3a7917(_0x137acf);}else{return _0x5b8d32(_0x3974bb);}});});}function transcribe(_0xbc7bce,_0x51281e,_0x4666a5,_0xc72199,_0x3609b1,_0x2c2842,_0x2b9b7c){return new Promise(function(_0x26badd,_0x2678b5){var _0x3f9a8f={};logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')](_0xd7d3('0x63'),_0xbc7bce,_0x3609b1));return uploadFile(_0x51281e,_0x4666a5,_0xc72199,_0x3609b1,path[_0xd7d3('0x64')](_0x2c2842),fs[_0xd7d3('0x65')](_0x2c2842))[_0xd7d3('0x20')](function(_0x374475){logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')](_0xd7d3('0x66'),_0xbc7bce,_0x3609b1,_0x374475[_0xd7d3('0x67')]));_0x3f9a8f[_0xd7d3('0x68')]=_0x374475[_0xd7d3('0x69')];_0x3f9a8f[_0xd7d3('0x6a')]=_0x374475[_0xd7d3('0x67')];logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xbc7bce));return startTranscribe(_0x51281e,_0x4666a5,_0xc72199,uuidv4(),_0x2b9b7c,_0x374475[_0xd7d3('0x67')]);})[_0xd7d3('0x20')](function(_0x484271){logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xbc7bce,_0x484271[_0xd7d3('0x6b')][_0xd7d3('0x6c')]));_0x3f9a8f[_0xd7d3('0x6d')]=_0x484271[_0xd7d3('0x6b')]['TranscriptionJobName'];_0x3f9a8f[_0xd7d3('0x6e')]=_0x484271['TranscriptionJob']['TranscriptionJobStatus'];return _0x26badd(_0x3f9a8f);})['catch'](function(_0x12af50){return _0x2678b5(_0x12af50);});});}exports[_0xd7d3('0x6f')]=function(_0xb94a7e,_0x3cd9fa,_0x18ab94){var _0x5bfcbd;var _0x3333ee;var _0x5ec750;var _0x53f224=require(_0xd7d3('0x70'));return db['VoiceRecording'][_0xd7d3('0x71')]({'where':{'id':_0xb94a7e[_0xd7d3('0x40')]['id']}})[_0xd7d3('0x20')](function(_0x420ea0){if(_0x420ea0){var _0x4fd4e7=util[_0xd7d3('0x2a')]('%s.cypher',_0x420ea0[_0xd7d3('0x46')]);if(fs[_0xd7d3('0x48')](_0x4fd4e7)){cypher=!![];return _0x53f224[_0xd7d3('0x49')](_0x4fd4e7,_0x420ea0['value'],config[_0xd7d3('0x4a')][_0xd7d3('0x4b')])[_0xd7d3('0x20')](function(){return _0x420ea0;});}return _0x420ea0;}})[_0xd7d3('0x20')](function(_0x5ec4dd){if(!_0x5ec4dd){throw new db[(_0xd7d3('0x57'))][(_0xd7d3('0x4c'))](_0xd7d3('0x72'));}_0x3333ee=_0x5ec4dd;return db[_0xd7d3('0x73')][_0xd7d3('0x71')]({'where':{'id':0x1}});})[_0xd7d3('0x20')](handleEntityNotFound(_0x3cd9fa,null))[_0xd7d3('0x20')](function(_0xf57add){if(_0xf57add){_0x5bfcbd=_0xf57add;if(!_0x5bfcbd[_0xd7d3('0x74')]||!_0x5bfcbd[_0xd7d3('0x75')]||!_0x5bfcbd[_0xd7d3('0x76')]||!_0x5bfcbd[_0xd7d3('0x77')]||!_0x5bfcbd['bucket']){throw new db[(_0xd7d3('0x57'))][(_0xd7d3('0x4c'))](_0xd7d3('0x78'));}if(_0xb94a7e[_0xd7d3('0x43')][_0xd7d3('0x79')]&&(!_0x5bfcbd['sentiment']||!_0x5bfcbd['sentimentAccountId']||!_0x5bfcbd[_0xd7d3('0x7a')]||!_0x5bfcbd[_0xd7d3('0x77')]||!_0x5bfcbd['bucket'])){throw new db[(_0xd7d3('0x57'))][(_0xd7d3('0x4c'))](_0xd7d3('0x7b'));}return db['CloudProvider']['findOne']({'where':{'id':_0x5bfcbd['transcribeAccountId']}});}})['then'](function(_0x535400){if(!_0x535400){throw new db[(_0xd7d3('0x57'))][(_0xd7d3('0x4c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x535400[_0xd7d3('0x7c')]||!_0x535400[_0xd7d3('0x7d')]){throw new db['Sequelize']['ValidationError'](_0xd7d3('0x7e'));}_0x5ec750=_0x535400;return getBucketslist(_0x5ec750[_0xd7d3('0x7c')],_0x5ec750['data2'],_0x5bfcbd[_0xd7d3('0x76')]);})[_0xd7d3('0x20')](function(_0x547236){if(_0x547236&&_0x547236[_0xd7d3('0x7f')]){var _0x48390d=_[_0xd7d3('0x41')](_0x547236[_0xd7d3('0x7f')],function(_0x389fd6){return _0x389fd6[_0xd7d3('0x80')]===_0x5bfcbd[_0xd7d3('0x68')];});if(!_0x48390d){logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')](_0xd7d3('0x81'),_0xb94a7e[_0xd7d3('0x40')]['id'],_0x5bfcbd[_0xd7d3('0x68')]));return createBucket(_0x5ec750[_0xd7d3('0x7c')],_0x5ec750['data2'],_0x5bfcbd['transcribeRegion'],_0x5bfcbd['bucket']);}logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xb94a7e[_0xd7d3('0x40')]['id'],_0x5bfcbd[_0xd7d3('0x68')]));return;}})[_0xd7d3('0x20')](function(_0x3da23a){if(_0x3333ee['transcribeStatus']===_0xd7d3('0x82')){return transcribe(_0xb94a7e[_0xd7d3('0x40')]['id'],_0x5ec750['data1'],_0x5ec750[_0xd7d3('0x7d')],_0x5bfcbd[_0xd7d3('0x76')],_0x5bfcbd[_0xd7d3('0x68')],_0x3333ee[_0xd7d3('0x46')],_0x5bfcbd[_0xd7d3('0x77')]);}else{logger[_0xd7d3('0x5a')](util[_0xd7d3('0x2a')](_0xd7d3('0x83'),_0xb94a7e['params']['id']));return{'transcribeStatus':_0xd7d3('0x84')};}})[_0xd7d3('0x20')](function(_0x16a338){if(_0x16a338){_0x16a338[_0xd7d3('0x85')]=_0xb94a7e[_0xd7d3('0x43')][_0xd7d3('0x79')];return _0x3333ee[_0xd7d3('0x86')](_0x16a338);}})[_0xd7d3('0x20')](respondWithResult(_0x3cd9fa,null))[_0xd7d3('0x3e')](handleError(_0x3cd9fa,null));};function writeFile(_0x25052d,_0x4d9698){return new Promise(function(_0x2001bd,_0x4dc01c){fs[_0xd7d3('0x87')](_0x4d9698,_0x25052d,function(_0x159dda,_0x3fa612){if(_0x159dda){return _0x4dc01c(_0x159dda);}else{return _0x2001bd(_0x3fa612);}});});}exports[_0xd7d3('0x88')]=function(_0x39f4c1,_0x23decb,_0x36480b){return db[_0xd7d3('0x25')][_0xd7d3('0x71')]({'where':{'id':_0x39f4c1['params']['id']}})[_0xd7d3('0x20')](handleEntityNotFound(_0x23decb))[_0xd7d3('0x20')](function(_0x3f1c87){if(_0x3f1c87&&_0x3f1c87[_0xd7d3('0x89')]){var _0x388baf=_0x3f1c87['fileText'];var _0x5d3ead=config[_0xd7d3('0x8a')]+'/server/files/transcribes/transcribe_'+_0x3f1c87['id']+_0xd7d3('0x8b');if(fs[_0xd7d3('0x48')](_0x5d3ead)){return _0x5d3ead;}return writeFile(_0x388baf,_0x5d3ead)[_0xd7d3('0x20')](function(){return _0x5d3ead;});}else{throw new db[(_0xd7d3('0x57'))][(_0xd7d3('0x4c'))](_0xd7d3('0x8c'));}})['then'](function(_0x5d5e2d){return _0x23decb[_0xd7d3('0x4d')](_0x5d5e2d);})[_0xd7d3('0x3e')](handleError(_0x23decb));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 205baf2..711c4a0 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 _0xfda2=['util','../../config/logger','api','request-promise','path','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xfda2,0x8f));var _0x2fda=function(_0xdd7932,_0x1c7ea1){_0xdd7932=_0xdd7932-0x0;var _0x12c419=_0xfda2[_0xdd7932];return _0x12c419;};'use strict';var _=require(_0x2fda('0x0'));var util=require(_0x2fda('0x1'));var logger=require(_0x2fda('0x2'))(_0x2fda('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fda('0x4'));var fs=require('fs');var path=require(_0x2fda('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2fda('0x6'));module[_0x2fda('0x7')]=function(_0x46572a,_0x2c187c){return _0x46572a[_0x2fda('0x8')](_0x2fda('0x9'),attributes,{'tableName':_0x2fda('0xa'),'paranoid':![],'indexes':[{'name':_0x2fda('0xb'),'fields':[_0x2fda('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe56e=['rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4e7d91,_0x4d71df){var _0x2a2972=function(_0x1d450a){while(--_0x1d450a){_0x4e7d91['push'](_0x4e7d91['shift']());}};_0x2a2972(++_0x4d71df);}(_0xe56e,0xd8));var _0xee56=function(_0x34ebf7,_0x5578d0){_0x34ebf7=_0x34ebf7-0x0;var _0x2b2633=_0xe56e[_0x34ebf7];return _0x2b2633;};'use strict';var _=require(_0xee56('0x0'));var util=require('util');var logger=require(_0xee56('0x1'))('api');var moment=require(_0xee56('0x2'));var BPromise=require(_0xee56('0x3'));var rp=require(_0xee56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee56('0x5'));var config=require(_0xee56('0x6'));var attributes=require(_0xee56('0x7'));module[_0xee56('0x8')]=function(_0x42d373,_0x59712f){return _0x42d373[_0xee56('0x9')](_0xee56('0xa'),attributes,{'tableName':_0xee56('0xb'),'paranoid':![],'indexes':[{'name':_0xee56('0xc'),'fields':[_0xee56('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7f010b1..fdf803e 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 _0x33af=['error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x33af,0xec));var _0xf33a=function(_0x5f3562,_0x212f41){_0x5f3562=_0x5f3562-0x0;var _0x1b39b4=_0x33af[_0x5f3562];return _0x1b39b4;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['update'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1a')]||null:null,'attributes':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1b')]||null:null,'limit':_0x524109['options']?_0x524109[_0xf33a('0x18')][_0xf33a('0x1c')]||null:null})[_0xf33a('0xa')](function(_0x27faa1){logger[_0xf33a('0xb')]('UpdateVoiceRecording',_0x524109);logger[_0xf33a('0xe')]('UpdateVoiceRecording',_0x524109,JSON[_0xf33a('0xf')](_0x27faa1));_0x23d9e2(_0x27faa1);})[_0xf33a('0x14')](function(_0x394468){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x394468['message'],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x394468[_0xf33a('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4af24a){var _0x16ef31=this;return new Promise(function(_0x5f0a53,_0x5cf981){var _0x38eba2=require('../../components/encryptor');var _0x79d653;return db['Setting'][_0xf33a('0x1d')]({'attributes':['id',_0xf33a('0x1e')],'where':{'id':0x1},'raw':!![]})[_0xf33a('0xa')](function(_0x729fca){_0x79d653=_0x729fca;return db[_0xf33a('0x16')][_0xf33a('0x1f')](_0x4af24a[_0xf33a('0x17')]);})[_0xf33a('0xa')](function(_0x26e81){if(_0x79d653[_0xf33a('0x1e')]&&fs[_0xf33a('0x20')](_0x26e81[_0xf33a('0x21')])){var _0x22c9f2=util[_0xf33a('0x22')](_0xf33a('0x23'),_0x26e81['value']);return _0x38eba2[_0xf33a('0x24')](_0x26e81[_0xf33a('0x21')],_0x22c9f2,config[_0xf33a('0x25')][_0xf33a('0x26')])['then'](function(){fs[_0xf33a('0x27')](_0x26e81[_0xf33a('0x21')]);logger[_0xf33a('0xb')](_0xf33a('0x28'));return _0x26e81;});}return _0x26e81;})[_0xf33a('0xa')](function(_0x109d84){logger['info'](_0xf33a('0x29'),_0x4af24a);logger[_0xf33a('0xe')](_0xf33a('0x29'),_0x4af24a,JSON[_0xf33a('0xf')](_0x109d84));_0x5f0a53(_0x109d84);})[_0xf33a('0x14')](function(_0x57e7be){logger['error'](_0xf33a('0x29'),_0x57e7be['message'],_0x4af24a);_0x5cf981(_0x16ef31['error'](0x1f4,_0x57e7be['message']));});});}; \ No newline at end of file +var _0x1a85=['existsSync','value','format','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create'];(function(_0x265657,_0x311646){var _0x11bd12=function(_0x31920f){while(--_0x31920f){_0x265657['push'](_0x265657['shift']());}};_0x11bd12(++_0x311646);}(_0x1a85,0x178));var _0x51a8=function(_0x571a36,_0x5936f2){_0x571a36=_0x571a36-0x0;var _0x4dd68e=_0x1a85[_0x571a36];return _0x4dd68e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['update'](_0x45a433[_0x51a8('0x15')],{'raw':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x18')]||null:null,'attributes':_0x45a433[_0x51a8('0x16')]?_0x45a433['options'][_0x51a8('0x19')]||null:null,'limit':_0x45a433['options']?_0x45a433[_0x51a8('0x16')][_0x51a8('0x1a')]||null:null})[_0x51a8('0x1b')](function(_0x3759d6){logger['info'](_0x51a8('0x13'),_0x45a433);logger['debug']('UpdateVoiceRecording',_0x45a433,JSON[_0x51a8('0xd')](_0x3759d6));_0x23539e(_0x3759d6);})['catch'](function(_0x384d25){logger[_0x51a8('0xe')](_0x51a8('0x13'),_0x384d25[_0x51a8('0x10')],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x384d25[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1c')]=function(_0x1326a2){var _0x5b3f49=this;return new Promise(function(_0x273ce2,_0x1b7577){var _0xca5746=require(_0x51a8('0x1d'));var _0x1c150d;return db[_0x51a8('0x1e')][_0x51a8('0x1f')]({'attributes':['id',_0x51a8('0x20')],'where':{'id':0x1},'raw':!![]})[_0x51a8('0x1b')](function(_0x4b5cda){_0x1c150d=_0x4b5cda;return db[_0x51a8('0x14')][_0x51a8('0x21')](_0x1326a2['body']);})[_0x51a8('0x1b')](function(_0x58cba0){if(_0x1c150d[_0x51a8('0x20')]&&fs[_0x51a8('0x22')](_0x58cba0[_0x51a8('0x23')])){var _0x41df56=util[_0x51a8('0x24')]('%s.cypher',_0x58cba0[_0x51a8('0x23')]);return _0xca5746['encryptFile'](_0x58cba0[_0x51a8('0x23')],_0x41df56,config[_0x51a8('0x25')][_0x51a8('0x26')])['then'](function(){fs[_0x51a8('0x27')](_0x58cba0['value']);logger[_0x51a8('0x8')](_0x51a8('0x28'));return _0x58cba0;});}return _0x58cba0;})[_0x51a8('0x1b')](function(_0x224099){logger[_0x51a8('0x8')]('CreateVoiceRecording',_0x1326a2);logger[_0x51a8('0xb')]('CreateVoiceRecording',_0x1326a2,JSON[_0x51a8('0xd')](_0x224099));_0x273ce2(_0x224099);})[_0x51a8('0x12')](function(_0x41561a){logger['error'](_0x51a8('0x1c'),_0x41561a[_0x51a8('0x10')],_0x1326a2);_0x1b7577(_0x5b3f49[_0x51a8('0xe')](0x1f4,_0x41561a[_0x51a8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 80ebad6..1f25476 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 _0xb3d2=['/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get'];(function(_0x47a155,_0x51db1c){var _0x4747ff=function(_0x4e6b01){while(--_0x4e6b01){_0x47a155['push'](_0x47a155['shift']());}};_0x4747ff(++_0x51db1c);}(_0xb3d2,0x1dc));var _0x2b3d=function(_0x1ab17e,_0x296bc5){_0x1ab17e=_0x1ab17e-0x0;var _0x47b5ba=_0xb3d2[_0x1ab17e];return _0x47b5ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b3d('0x0'));var timeout=require(_0x2b3d('0x1'));var express=require(_0x2b3d('0x2'));var router=express[_0x2b3d('0x3')]();var fs_extra=require(_0x2b3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2b3d('0x5'));var config=require(_0x2b3d('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x2b3d('0x7')](),controller[_0x2b3d('0x8')]);router[_0x2b3d('0x9')](_0x2b3d('0xa'),auth[_0x2b3d('0x7')](),controller[_0x2b3d('0xb')]);router['post']('/',auth[_0x2b3d('0x7')](),controller[_0x2b3d('0xc')]);router[_0x2b3d('0xd')](_0x2b3d('0xa'),auth[_0x2b3d('0x7')](),controller[_0x2b3d('0xe')]);router[_0x2b3d('0xf')](_0x2b3d('0xa'),auth[_0x2b3d('0x7')](),controller[_0x2b3d('0x10')]);module[_0x2b3d('0x11')]=router; \ No newline at end of file +var _0x91c8=['get','index','isAuthenticated','/:id','show','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x91c8,0xf4));var _0x891c=function(_0x5d45dd,_0x176b77){_0x5d45dd=_0x5d45dd-0x0;var _0x4fb711=_0x91c8[_0x5d45dd];return _0x4fb711;};'use strict';var multer=require(_0x891c('0x0'));var util=require(_0x891c('0x1'));var path=require('path');var timeout=require(_0x891c('0x2'));var express=require(_0x891c('0x3'));var router=express[_0x891c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x891c('0x5'));var interaction=require(_0x891c('0x6'));var config=require('../../config/environment');var controller=require(_0x891c('0x7'));router[_0x891c('0x8')]('/',auth['isAuthenticated'](),controller[_0x891c('0x9')]);router[_0x891c('0x8')]('/describe',auth[_0x891c('0xa')](),controller['describe']);router[_0x891c('0x8')](_0x891c('0xb'),auth[_0x891c('0xa')](),controller[_0x891c('0xc')]);router[_0x891c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x891c('0xb'),auth[_0x891c('0xa')](),controller[_0x891c('0xe')]);router[_0x891c('0xf')]('/:id',auth[_0x891c('0xa')](),controller[_0x891c('0x10')]);module[_0x891c('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 4c2bd9e..59043ab 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 _0x6bf2=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0xf2725b,_0x41557e){var _0x560c1b=function(_0x1cab1a){while(--_0x1cab1a){_0xf2725b['push'](_0xf2725b['shift']());}};_0x560c1b(++_0x41557e);}(_0x6bf2,0x19c));var _0x26bf=function(_0x41ced9,_0x23afc1){_0x41ced9=_0x41ced9-0x0;var _0x596b12=_0x6bf2[_0x41ced9];return _0x596b12;};'use strict';var Sequelize=require(_0x26bf('0x0'));var moment=require(_0x26bf('0x1'));module[_0x26bf('0x2')]={'type':{'type':Sequelize[_0x26bf('0x3')](_0x26bf('0x4'),_0x26bf('0x5'))},'result':{'type':Sequelize[_0x26bf('0x6')]},'transfererchannel':{'type':Sequelize[_0x26bf('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x26bf('0x6')]},'transferercalleridname':{'type':Sequelize[_0x26bf('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x26bf('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x26bf('0x6')]},'transferercontext':{'type':Sequelize[_0x26bf('0x6')]},'transfererexten':{'type':Sequelize[_0x26bf('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x26bf('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x26bf('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x26bf('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x26bf('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x26bf('0x6')]},'transfereecontext':{'type':Sequelize[_0x26bf('0x6')]},'transfereeexten':{'type':Sequelize[_0x26bf('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x26bf('0x6')]},'isexternal':{'type':Sequelize[_0x26bf('0x3')](_0x26bf('0x7'),'No')},'context':{'type':Sequelize[_0x26bf('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc33f=['STRING','ENUM','sequelize','exports','blind'];(function(_0x5bb3d6,_0x373494){var _0x23286b=function(_0x5beee4){while(--_0x5beee4){_0x5bb3d6['push'](_0x5bb3d6['shift']());}};_0x23286b(++_0x373494);}(_0xc33f,0x10b));var _0xfc33=function(_0x51e45b,_0x2f683d){_0x51e45b=_0x51e45b-0x0;var _0x1e0abe=_0xc33f[_0x51e45b];return _0x1e0abe;};'use strict';var Sequelize=require(_0xfc33('0x0'));var moment=require('moment');module[_0xfc33('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfc33('0x2'),'attended')},'result':{'type':Sequelize[_0xfc33('0x3')]},'transfererchannel':{'type':Sequelize[_0xfc33('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xfc33('0x3')]},'transferercalleridname':{'type':Sequelize[_0xfc33('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xfc33('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xfc33('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xfc33('0x3')]},'transferercontext':{'type':Sequelize[_0xfc33('0x3')]},'transfererexten':{'type':Sequelize[_0xfc33('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xfc33('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xfc33('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xfc33('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xfc33('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xfc33('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xfc33('0x4')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xfc33('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 597bc0a..1e9818d 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 _0x900f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xe84953,_0xa2cc7){var _0x2f486f=function(_0x4a0a09){while(--_0x4a0a09){_0xe84953['push'](_0xe84953['shift']());}};_0x2f486f(++_0xa2cc7);}(_0x900f,0x86));var _0xf900=function(_0x178ca4,_0x5aaa16){_0x178ca4=_0x178ca4-0x0;var _0x57f6a8=_0x900f[_0x178ca4];return _0x57f6a8;};'use strict';var emlformat=require(_0xf900('0x0'));var rimraf=require(_0xf900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf900('0x2'));var rp=require(_0xf900('0x3'));var moment=require('moment');var BPromise=require(_0xf900('0x4'));var Mustache=require(_0xf900('0x5'));var util=require('util');var path=require(_0xf900('0x6'));var sox=require(_0xf900('0x7'));var csv=require('to-csv');var ejs=require(_0xf900('0x8'));var fs=require('fs');var fs_extra=require(_0xf900('0x9'));var _=require(_0xf900('0xa'));var squel=require(_0xf900('0xb'));var crypto=require(_0xf900('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf900('0xd'));var toCsv=require(_0xf900('0xe'));var querystring=require('querystring');var Papa=require(_0xf900('0xf'));var Redis=require('ioredis');var authService=require(_0xf900('0x10'));var qs=require(_0xf900('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf900('0x12'));var logger=require(_0xf900('0x13'))(_0xf900('0x14'));var utils=require(_0xf900('0x15'));var config=require(_0xf900('0x16'));var licenseUtil=require(_0xf900('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c49cd,_0x4c4bc9){_0x4c4bc9=_0x4c4bc9||0xcc;return function(_0x2246a8){if(_0x2246a8){return _0x1c49cd[_0xf900('0x18')](_0x4c4bc9);}return _0x1c49cd[_0xf900('0x19')](_0x4c4bc9)[_0xf900('0x1a')]();};}function respondWithResult(_0x54ea1c,_0x4847fb){_0x4847fb=_0x4847fb||0xc8;return function(_0x546639){if(_0x546639){return _0x54ea1c[_0xf900('0x19')](_0x4847fb)[_0xf900('0x1b')](_0x546639);}};}function respondWithFilteredResult(_0x14c05a,_0x1b3861){return function(_0x31ccca){if(_0x31ccca){var _0x3e284f=typeof _0x1b3861[_0xf900('0x1c')]===_0xf900('0x1d')&&typeof _0x1b3861[_0xf900('0x1e')]==='undefined';var _0x17e180=_0x31ccca[_0xf900('0x1f')];var _0x363e18=_0x3e284f?0x0:_0x1b3861['offset'];var _0x5a2c46=_0x3e284f?_0x31ccca[_0xf900('0x1f')]:_0x1b3861['offset']+_0x1b3861['limit'];var _0x37da0f;if(_0x5a2c46>=_0x17e180){_0x5a2c46=_0x17e180;_0x37da0f=0xc8;}else{_0x37da0f=0xce;}_0x14c05a[_0xf900('0x19')](_0x37da0f);return _0x14c05a['set'](_0xf900('0x20'),_0x363e18+'-'+_0x5a2c46+'/'+_0x17e180)['json'](_0x31ccca);}return null;};}function patchUpdates(_0x4ab1f1){return function(_0x62f80f){try{jsonpatch[_0xf900('0x21')](_0x62f80f,_0x4ab1f1,!![]);}catch(_0x4176b7){return BPromise[_0xf900('0x22')](_0x4176b7);}return _0x62f80f[_0xf900('0x23')]();};}function saveUpdates(_0x27b917,_0x447860){return function(_0x41a9f9){if(_0x41a9f9){return _0x41a9f9[_0xf900('0x24')](_0x27b917)['then'](function(_0x4ca02a){return _0x4ca02a;});}return null;};}function removeEntity(_0x2e441b,_0x3b8663){return function(_0x4f5dd4){if(_0x4f5dd4){return _0x4f5dd4[_0xf900('0x25')]()[_0xf900('0x26')](function(){_0x2e441b['status'](0xcc)[_0xf900('0x1a')]();});}};}function handleEntityNotFound(_0x2c911f,_0x557342){return function(_0x1c5e9e){if(!_0x1c5e9e){_0x2c911f[_0xf900('0x18')](0x194);}return _0x1c5e9e;};}function handleError(_0x431bc0,_0x26f85c){_0x26f85c=_0x26f85c||0x1f4;return function(_0x29a987){logger[_0xf900('0x27')](_0x29a987[_0xf900('0x28')]);if(_0x29a987['name']){delete _0x29a987['name'];}_0x431bc0[_0xf900('0x19')](_0x26f85c)[_0xf900('0x29')](_0x29a987);};}exports[_0xf900('0x2a')]=function(_0x389348,_0x1c17f6){var _0x1a10ec={},_0x1c0963={},_0x5496ec={'count':0x0,'rows':[]};var _0x45b586=_[_0xf900('0x2b')](db[_0xf900('0x2c')][_0xf900('0x2d')],function(_0x3f0373){return{'name':_0x3f0373[_0xf900('0x2e')],'type':_0x3f0373[_0xf900('0x2f')][_0xf900('0x30')]};});_0x1c0963[_0xf900('0x31')]=_[_0xf900('0x2b')](_0x45b586,_0xf900('0x32'));_0x1c0963[_0xf900('0x33')]=_[_0xf900('0x34')](_0x389348[_0xf900('0x33')]);_0x1c0963['filters']=_[_0xf900('0x35')](_0x1c0963[_0xf900('0x31')],_0x1c0963['query']);_0x1a10ec[_0xf900('0x36')]=_['intersection'](_0x1c0963['model'],qs[_0xf900('0x37')](_0x389348[_0xf900('0x33')][_0xf900('0x37')]));_0x1a10ec[_0xf900('0x36')]=_0x1a10ec[_0xf900('0x36')]['length']?_0x1a10ec[_0xf900('0x36')]:_0x1c0963['model'];if(!_0x389348[_0xf900('0x33')][_0xf900('0x38')](_0xf900('0x39'))){_0x1a10ec['limit']=qs[_0xf900('0x1e')](_0x389348[_0xf900('0x33')][_0xf900('0x1e')]);_0x1a10ec[_0xf900('0x1c')]=qs[_0xf900('0x1c')](_0x389348['query'][_0xf900('0x1c')]);}_0x1a10ec['order']=qs[_0xf900('0x3a')](_0x389348['query'][_0xf900('0x3a')]);_0x1a10ec[_0xf900('0x3b')]=qs[_0xf900('0x3c')](_[_0xf900('0x3d')](_0x389348[_0xf900('0x33')],_0x1c0963['filters']),_0x45b586);if(_0x389348[_0xf900('0x33')][_0xf900('0x3e')]){_0x1a10ec[_0xf900('0x3b')]=_[_0xf900('0x3f')](_0x1a10ec[_0xf900('0x3b')],{'$or':_['map'](_0x45b586,function(_0x62946a){if(_0x62946a[_0xf900('0x2f')]!==_0xf900('0x40')){var _0x17cf65={};_0x17cf65[_0x62946a[_0xf900('0x32')]]={'$like':'%'+_0x389348[_0xf900('0x33')][_0xf900('0x3e')]+'%'};return _0x17cf65;}})});}_0x1a10ec=_[_0xf900('0x3f')]({},_0x1a10ec,_0x389348[_0xf900('0x41')]);var _0x4327e1={'where':_0x1a10ec['where']};return db['VoiceTransferReport'][_0xf900('0x1f')](_0x4327e1)[_0xf900('0x26')](function(_0xefde28){_0x5496ec['count']=_0xefde28;if(_0x389348[_0xf900('0x33')][_0xf900('0x42')]){_0x1a10ec[_0xf900('0x43')]=[{'all':!![]}];}return db[_0xf900('0x2c')][_0xf900('0x44')](_0x1a10ec);})['then'](function(_0x563686){_0x5496ec[_0xf900('0x45')]=_0x563686;return _0x5496ec;})[_0xf900('0x26')](respondWithFilteredResult(_0x1c17f6,_0x1a10ec))['catch'](handleError(_0x1c17f6,null));};exports[_0xf900('0x46')]=function(_0x210eba,_0x26a63d){var _0x5911a6={'raw':!![],'where':{'id':_0x210eba[_0xf900('0x47')]['id']}},_0x26e06d={};_0x26e06d[_0xf900('0x31')]=_[_0xf900('0x34')](db['VoiceTransferReport'][_0xf900('0x2d')]);_0x26e06d[_0xf900('0x33')]=_['keys'](_0x210eba[_0xf900('0x33')]);_0x26e06d[_0xf900('0x3c')]=_[_0xf900('0x35')](_0x26e06d['model'],_0x26e06d[_0xf900('0x33')]);_0x5911a6[_0xf900('0x36')]=_[_0xf900('0x35')](_0x26e06d['model'],qs['fields'](_0x210eba[_0xf900('0x33')][_0xf900('0x37')]));_0x5911a6[_0xf900('0x36')]=_0x5911a6['attributes']['length']?_0x5911a6[_0xf900('0x36')]:_0x26e06d['model'];if(_0x210eba[_0xf900('0x33')][_0xf900('0x42')]){_0x5911a6[_0xf900('0x43')]=[{'all':!![]}];}_0x5911a6=_[_0xf900('0x3f')]({},_0x5911a6,_0x210eba[_0xf900('0x41')]);return db['VoiceTransferReport'][_0xf900('0x48')](_0x5911a6)[_0xf900('0x26')](handleEntityNotFound(_0x26a63d,null))[_0xf900('0x26')](respondWithResult(_0x26a63d,null))[_0xf900('0x49')](handleError(_0x26a63d,null));};exports[_0xf900('0x4a')]=function(_0x558f05,_0x451e58){return db['VoiceTransferReport']['create'](_0x558f05[_0xf900('0x4b')],{})['then'](respondWithResult(_0x451e58,0xc9))[_0xf900('0x49')](handleError(_0x451e58,null));};exports[_0xf900('0x24')]=function(_0x13dccf,_0x55da6b){if(_0x13dccf[_0xf900('0x4b')]['id']){delete _0x13dccf['body']['id'];}return db[_0xf900('0x2c')][_0xf900('0x48')]({'where':{'id':_0x13dccf['params']['id']}})[_0xf900('0x26')](handleEntityNotFound(_0x55da6b,null))['then'](saveUpdates(_0x13dccf[_0xf900('0x4b')],null))[_0xf900('0x26')](respondWithResult(_0x55da6b,null))[_0xf900('0x49')](handleError(_0x55da6b,null));};exports[_0xf900('0x25')]=function(_0x354b78,_0x26016c){return db[_0xf900('0x2c')][_0xf900('0x48')]({'where':{'id':_0x354b78[_0xf900('0x47')]['id']}})[_0xf900('0x26')](handleEntityNotFound(_0x26016c,null))[_0xf900('0x26')](removeEntity(_0x26016c,null))[_0xf900('0x49')](handleError(_0x26016c,null));};exports['describe']=function(_0x484caf,_0x4de1c0){return db[_0xf900('0x2c')]['describe']()[_0xf900('0x26')](respondWithResult(_0x4de1c0,null))[_0xf900('0x49')](handleError(_0x4de1c0,null));}; \ No newline at end of file +var _0x17b5=['fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','map','options','includeAll','findAll','catch','show','params','length','include','merge','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','error','name','index','VoiceTransferReport','rawAttributes'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x17b5,0x1d9));var _0x517b=function(_0x231068,_0x5bbe87){_0x231068=_0x231068-0x0;var _0x13aa8b=_0x17b5[_0x231068];return _0x13aa8b;};'use strict';var emlformat=require(_0x517b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x517b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x517b('0x2'));var BPromise=require(_0x517b('0x3'));var Mustache=require(_0x517b('0x4'));var util=require(_0x517b('0x5'));var path=require(_0x517b('0x6'));var sox=require(_0x517b('0x7'));var csv=require(_0x517b('0x8'));var ejs=require(_0x517b('0x9'));var fs=require('fs');var fs_extra=require(_0x517b('0xa'));var _=require(_0x517b('0xb'));var squel=require(_0x517b('0xc'));var crypto=require(_0x517b('0xd'));var jsforce=require(_0x517b('0xe'));var deskjs=require(_0x517b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x517b('0x10'));var Papa=require(_0x517b('0x11'));var Redis=require('ioredis');var authService=require(_0x517b('0x12'));var qs=require(_0x517b('0x13'));var as=require(_0x517b('0x14'));var hardwareService=require(_0x517b('0x15'));var logger=require('../../config/logger')(_0x517b('0x16'));var utils=require('../../config/utils');var config=require(_0x517b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x517b('0x18'))['db'];function respondWithStatusCode(_0x16621c,_0x2724b4){_0x2724b4=_0x2724b4||0xcc;return function(_0x5424af){if(_0x5424af){return _0x16621c[_0x517b('0x19')](_0x2724b4);}return _0x16621c[_0x517b('0x1a')](_0x2724b4)[_0x517b('0x1b')]();};}function respondWithResult(_0x565041,_0x1aa8e0){_0x1aa8e0=_0x1aa8e0||0xc8;return function(_0xf95017){if(_0xf95017){return _0x565041[_0x517b('0x1a')](_0x1aa8e0)['json'](_0xf95017);}};}function respondWithFilteredResult(_0x316164,_0x1afbd4){return function(_0x4fe06b){if(_0x4fe06b){var _0x1eb4bd=typeof _0x1afbd4[_0x517b('0x1c')]===_0x517b('0x1d')&&typeof _0x1afbd4[_0x517b('0x1e')]===_0x517b('0x1d');var _0x5f1a85=_0x4fe06b[_0x517b('0x1f')];var _0x2b2105=_0x1eb4bd?0x0:_0x1afbd4['offset'];var _0x4933dc=_0x1eb4bd?_0x4fe06b[_0x517b('0x1f')]:_0x1afbd4[_0x517b('0x1c')]+_0x1afbd4['limit'];var _0x4fc142;if(_0x4933dc>=_0x5f1a85){_0x4933dc=_0x5f1a85;_0x4fc142=0xc8;}else{_0x4fc142=0xce;}_0x316164[_0x517b('0x1a')](_0x4fc142);return _0x316164[_0x517b('0x20')](_0x517b('0x21'),_0x2b2105+'-'+_0x4933dc+'/'+_0x5f1a85)[_0x517b('0x22')](_0x4fe06b);}return null;};}function patchUpdates(_0x10f1b3){return function(_0x119871){try{jsonpatch[_0x517b('0x23')](_0x119871,_0x10f1b3,!![]);}catch(_0x4d3780){return BPromise[_0x517b('0x24')](_0x4d3780);}return _0x119871[_0x517b('0x25')]();};}function saveUpdates(_0x4a5dfc,_0x45b76a){return function(_0x3ea297){if(_0x3ea297){return _0x3ea297['update'](_0x4a5dfc)['then'](function(_0x6c7fb6){return _0x6c7fb6;});}return null;};}function removeEntity(_0x483f01,_0xe329b2){return function(_0x24c991){if(_0x24c991){return _0x24c991[_0x517b('0x26')]()[_0x517b('0x27')](function(){_0x483f01[_0x517b('0x1a')](0xcc)[_0x517b('0x1b')]();});}};}function handleEntityNotFound(_0x59f5cd,_0x4073f6){return function(_0x3200a1){if(!_0x3200a1){_0x59f5cd['sendStatus'](0x194);}return _0x3200a1;};}function handleError(_0x108886,_0x4ad6a6){_0x4ad6a6=_0x4ad6a6||0x1f4;return function(_0x376bfa){logger[_0x517b('0x28')](_0x376bfa['stack']);if(_0x376bfa[_0x517b('0x29')]){delete _0x376bfa[_0x517b('0x29')];}_0x108886[_0x517b('0x1a')](_0x4ad6a6)['send'](_0x376bfa);};}exports[_0x517b('0x2a')]=function(_0x489654,_0xd6b6bb){var _0x234b04={},_0x57f2d1={},_0x7b285c={'count':0x0,'rows':[]};var _0x44def8=_['map'](db[_0x517b('0x2b')][_0x517b('0x2c')],function(_0x407377){return{'name':_0x407377[_0x517b('0x2d')],'type':_0x407377[_0x517b('0x2e')][_0x517b('0x2f')]};});_0x57f2d1[_0x517b('0x30')]=_['map'](_0x44def8,_0x517b('0x29'));_0x57f2d1[_0x517b('0x31')]=_[_0x517b('0x32')](_0x489654[_0x517b('0x31')]);_0x57f2d1['filters']=_[_0x517b('0x33')](_0x57f2d1[_0x517b('0x30')],_0x57f2d1[_0x517b('0x31')]);_0x234b04[_0x517b('0x34')]=_[_0x517b('0x33')](_0x57f2d1[_0x517b('0x30')],qs[_0x517b('0x35')](_0x489654[_0x517b('0x31')][_0x517b('0x35')]));_0x234b04['attributes']=_0x234b04[_0x517b('0x34')]['length']?_0x234b04[_0x517b('0x34')]:_0x57f2d1[_0x517b('0x30')];if(!_0x489654[_0x517b('0x31')]['hasOwnProperty'](_0x517b('0x36'))){_0x234b04[_0x517b('0x1e')]=qs[_0x517b('0x1e')](_0x489654['query'][_0x517b('0x1e')]);_0x234b04[_0x517b('0x1c')]=qs[_0x517b('0x1c')](_0x489654['query'][_0x517b('0x1c')]);}_0x234b04[_0x517b('0x37')]=qs[_0x517b('0x38')](_0x489654[_0x517b('0x31')][_0x517b('0x38')]);_0x234b04[_0x517b('0x39')]=qs['filters'](_['pick'](_0x489654[_0x517b('0x31')],_0x57f2d1[_0x517b('0x3a')]),_0x44def8);if(_0x489654[_0x517b('0x31')][_0x517b('0x3b')]){_0x234b04[_0x517b('0x39')]=_['merge'](_0x234b04[_0x517b('0x39')],{'$or':_[_0x517b('0x3c')](_0x44def8,function(_0x34c21e){if(_0x34c21e['type']!=='VIRTUAL'){var _0x1d6ce2={};_0x1d6ce2[_0x34c21e['name']]={'$like':'%'+_0x489654[_0x517b('0x31')][_0x517b('0x3b')]+'%'};return _0x1d6ce2;}})});}_0x234b04=_['merge']({},_0x234b04,_0x489654[_0x517b('0x3d')]);var _0x172346={'where':_0x234b04['where']};return db['VoiceTransferReport']['count'](_0x172346)['then'](function(_0x2bcf86){_0x7b285c[_0x517b('0x1f')]=_0x2bcf86;if(_0x489654[_0x517b('0x31')][_0x517b('0x3e')]){_0x234b04['include']=[{'all':!![]}];}return db[_0x517b('0x2b')][_0x517b('0x3f')](_0x234b04);})[_0x517b('0x27')](function(_0x71fc38){_0x7b285c['rows']=_0x71fc38;return _0x7b285c;})[_0x517b('0x27')](respondWithFilteredResult(_0xd6b6bb,_0x234b04))[_0x517b('0x40')](handleError(_0xd6b6bb,null));};exports[_0x517b('0x41')]=function(_0x5b8050,_0x5e5249){var _0x32a7b5={'raw':!![],'where':{'id':_0x5b8050[_0x517b('0x42')]['id']}},_0x1fff0c={};_0x1fff0c['model']=_['keys'](db[_0x517b('0x2b')][_0x517b('0x2c')]);_0x1fff0c[_0x517b('0x31')]=_[_0x517b('0x32')](_0x5b8050[_0x517b('0x31')]);_0x1fff0c[_0x517b('0x3a')]=_[_0x517b('0x33')](_0x1fff0c[_0x517b('0x30')],_0x1fff0c[_0x517b('0x31')]);_0x32a7b5[_0x517b('0x34')]=_['intersection'](_0x1fff0c[_0x517b('0x30')],qs[_0x517b('0x35')](_0x5b8050[_0x517b('0x31')][_0x517b('0x35')]));_0x32a7b5[_0x517b('0x34')]=_0x32a7b5[_0x517b('0x34')][_0x517b('0x43')]?_0x32a7b5[_0x517b('0x34')]:_0x1fff0c['model'];if(_0x5b8050[_0x517b('0x31')][_0x517b('0x3e')]){_0x32a7b5[_0x517b('0x44')]=[{'all':!![]}];}_0x32a7b5=_[_0x517b('0x45')]({},_0x32a7b5,_0x5b8050[_0x517b('0x3d')]);return db['VoiceTransferReport'][_0x517b('0x46')](_0x32a7b5)[_0x517b('0x27')](handleEntityNotFound(_0x5e5249,null))[_0x517b('0x27')](respondWithResult(_0x5e5249,null))['catch'](handleError(_0x5e5249,null));};exports[_0x517b('0x47')]=function(_0x452209,_0x1e1b34){return db['VoiceTransferReport'][_0x517b('0x47')](_0x452209[_0x517b('0x48')],{})[_0x517b('0x27')](respondWithResult(_0x1e1b34,0xc9))['catch'](handleError(_0x1e1b34,null));};exports['update']=function(_0x5d1d26,_0x1cd2cd){if(_0x5d1d26[_0x517b('0x48')]['id']){delete _0x5d1d26[_0x517b('0x48')]['id'];}return db[_0x517b('0x2b')][_0x517b('0x46')]({'where':{'id':_0x5d1d26[_0x517b('0x42')]['id']}})[_0x517b('0x27')](handleEntityNotFound(_0x1cd2cd,null))[_0x517b('0x27')](saveUpdates(_0x5d1d26[_0x517b('0x48')],null))['then'](respondWithResult(_0x1cd2cd,null))[_0x517b('0x40')](handleError(_0x1cd2cd,null));};exports[_0x517b('0x26')]=function(_0x46325b,_0x405df7){return db[_0x517b('0x2b')][_0x517b('0x46')]({'where':{'id':_0x46325b['params']['id']}})[_0x517b('0x27')](handleEntityNotFound(_0x405df7,null))[_0x517b('0x27')](removeEntity(_0x405df7,null))[_0x517b('0x40')](handleError(_0x405df7,null));};exports[_0x517b('0x49')]=function(_0x1cecc9,_0x2539b2){return db[_0x517b('0x2b')]['describe']()[_0x517b('0x27')](respondWithResult(_0x2539b2,null))['catch'](handleError(_0x2539b2,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1707338..b66e2ed 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 _0x4ff0=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','report_call_transfer'];(function(_0x1229f1,_0x624221){var _0x39cf59=function(_0x44375e){while(--_0x44375e){_0x1229f1['push'](_0x1229f1['shift']());}};_0x39cf59(++_0x624221);}(_0x4ff0,0xe7));var _0x04ff=function(_0x253fdb,_0x1e5e09){_0x253fdb=_0x253fdb-0x0;var _0x3d7953=_0x4ff0[_0x253fdb];return _0x3d7953;};'use strict';var _=require(_0x04ff('0x0'));var util=require(_0x04ff('0x1'));var logger=require(_0x04ff('0x2'))(_0x04ff('0x3'));var moment=require(_0x04ff('0x4'));var BPromise=require(_0x04ff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04ff('0x6'));var rimraf=require('rimraf');var config=require(_0x04ff('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x04ff('0x8')]=function(_0x3800a3,_0x30eca4){return _0x3800a3[_0x04ff('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x04ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc111=['util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','report_call_transfer','lodash'];(function(_0x14f051,_0x85870b){var _0x3f59ee=function(_0xc8785a){while(--_0xc8785a){_0x14f051['push'](_0x14f051['shift']());}};_0x3f59ee(++_0x85870b);}(_0xc111,0x6d));var _0x1c11=function(_0x5869fc,_0x3a9705){_0x5869fc=_0x5869fc-0x0;var _0x1ae595=_0xc111[_0x5869fc];return _0x1ae595;};'use strict';var _=require(_0x1c11('0x0'));var util=require(_0x1c11('0x1'));var logger=require(_0x1c11('0x2'))(_0x1c11('0x3'));var moment=require(_0x1c11('0x4'));var BPromise=require(_0x1c11('0x5'));var rp=require(_0x1c11('0x6'));var fs=require('fs');var path=require(_0x1c11('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x1c11('0x8')]=function(_0x30fad2,_0x5c655d){return _0x30fad2[_0x1c11('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x1c11('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 931358f..bedfb0c 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 _0x70db=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring'];(function(_0x3d39a3,_0x70fab7){var _0x3fccc9=function(_0x2b23b6){while(--_0x2b23b6){_0x3d39a3['push'](_0x3d39a3['shift']());}};_0x3fccc9(++_0x70fab7);}(_0x70db,0xa4));var _0xb70d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x70db[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xb70d('0x0'));var util=require(_0xb70d('0x1'));var moment=require('moment');var BPromise=require(_0xb70d('0x2'));var rs=require(_0xb70d('0x3'));var fs=require('fs');var Redis=require(_0xb70d('0x4'));var db=require(_0xb70d('0x5'))['db'];var utils=require(_0xb70d('0x6'));var logger=require('../../config/logger')(_0xb70d('0x7'));var config=require(_0xb70d('0x8'));var jayson=require(_0xb70d('0x9'));var client=jayson[_0xb70d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad55e,_0x323315,_0x442fc6){return new BPromise(function(_0x5b53d6,_0x29d302){return client[_0xb70d('0xb')](_0x2ad55e,_0x442fc6)['then'](function(_0x385fcc){logger[_0xb70d('0xc')](_0xb70d('0xd'),_0x323315,_0xb70d('0xe'));logger[_0xb70d('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x323315,_0xb70d('0xe'),JSON[_0xb70d('0x10')](_0x385fcc));if(_0x385fcc['error']){if(_0x385fcc[_0xb70d('0x11')][_0xb70d('0x12')]===0x1f4){logger[_0xb70d('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x323315,_0x385fcc['error'][_0xb70d('0x13')]);return _0x29d302(_0x385fcc['error'][_0xb70d('0x13')]);}logger['error'](_0xb70d('0xd'),_0x323315,_0x385fcc[_0xb70d('0x11')]['message']);return _0x5b53d6(_0x385fcc[_0xb70d('0x11')][_0xb70d('0x13')]);}else{logger['info'](_0xb70d('0xd'),_0x323315,_0xb70d('0xe'));_0x5b53d6(_0x385fcc[_0xb70d('0x14')][_0xb70d('0x13')]);}})[_0xb70d('0x15')](function(_0x44eb40){logger['error'](_0xb70d('0xd'),_0x323315,_0x44eb40);_0x29d302(_0x44eb40);});});}exports[_0xb70d('0x16')]=function(_0x4c323f){var _0x207431=this;return new Promise(function(_0x2efb14,_0x5c5c28){return db[_0xb70d('0x17')][_0xb70d('0x18')](_0x4c323f[_0xb70d('0x19')],{'raw':_0x4c323f[_0xb70d('0x1a')]?_0x4c323f[_0xb70d('0x1a')][_0xb70d('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1baf8d){logger['info'](_0xb70d('0x16'),_0x4c323f);logger[_0xb70d('0xf')]('CreateVoiceTransferReport',_0x4c323f,JSON[_0xb70d('0x10')](_0x1baf8d));_0x2efb14(_0x1baf8d);})[_0xb70d('0x15')](function(_0x23613c){logger[_0xb70d('0x11')]('CreateVoiceTransferReport',_0x23613c['message'],_0x4c323f);_0x5c5c28(_0x207431['error'](0x1f4,_0x23613c[_0xb70d('0x13')]));});});}; \ No newline at end of file +var _0x9317=['jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VoiceTransferReport','create','options','raw','debug','CreateVoiceTransferReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5e276b,_0x5b3d9d){var _0x3182d2=function(_0x30559f){while(--_0x30559f){_0x5e276b['push'](_0x5e276b['shift']());}};_0x3182d2(++_0x5b3d9d);}(_0x9317,0x17f));var _0x7931=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x9317[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require('lodash');var util=require(_0x7931('0x0'));var moment=require('moment');var BPromise=require(_0x7931('0x1'));var rs=require(_0x7931('0x2'));var fs=require('fs');var Redis=require(_0x7931('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7931('0x4'));var logger=require(_0x7931('0x5'))('rpc');var config=require(_0x7931('0x6'));var jayson=require(_0x7931('0x7'));var client=jayson[_0x7931('0x8')][_0x7931('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277486,_0x365a10,_0x5d01e9){return new BPromise(function(_0x3ea3d0,_0x29037e){return client[_0x7931('0xa')](_0x277486,_0x5d01e9)[_0x7931('0xb')](function(_0x4c8813){logger[_0x7931('0xc')](_0x7931('0xd'),_0x365a10,_0x7931('0xe'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x365a10,_0x7931('0xe'),JSON[_0x7931('0xf')](_0x4c8813));if(_0x4c8813[_0x7931('0x10')]){if(_0x4c8813[_0x7931('0x10')][_0x7931('0x11')]===0x1f4){logger[_0x7931('0x10')](_0x7931('0xd'),_0x365a10,_0x4c8813[_0x7931('0x10')][_0x7931('0x12')]);return _0x29037e(_0x4c8813[_0x7931('0x10')][_0x7931('0x12')]);}logger[_0x7931('0x10')](_0x7931('0xd'),_0x365a10,_0x4c8813['error'][_0x7931('0x12')]);return _0x3ea3d0(_0x4c8813[_0x7931('0x10')][_0x7931('0x12')]);}else{logger['info'](_0x7931('0xd'),_0x365a10,_0x7931('0xe'));_0x3ea3d0(_0x4c8813['result'][_0x7931('0x12')]);}})[_0x7931('0x13')](function(_0x54a1fc){logger['error'](_0x7931('0xd'),_0x365a10,_0x54a1fc);_0x29037e(_0x54a1fc);});});}exports['CreateVoiceTransferReport']=function(_0x38d52b){var _0x1c2d5d=this;return new Promise(function(_0x382dbe,_0x2b9385){return db[_0x7931('0x14')][_0x7931('0x15')](_0x38d52b['body'],{'raw':_0x38d52b[_0x7931('0x16')]?_0x38d52b[_0x7931('0x16')][_0x7931('0x17')]===undefined?!![]:![]:!![]})[_0x7931('0xb')](function(_0x4303b3){logger[_0x7931('0xc')]('CreateVoiceTransferReport',_0x38d52b);logger[_0x7931('0x18')](_0x7931('0x19'),_0x38d52b,JSON[_0x7931('0xf')](_0x4303b3));_0x382dbe(_0x4303b3);})['catch'](function(_0x20fb87){logger[_0x7931('0x10')](_0x7931('0x19'),_0x20fb87[_0x7931('0x12')],_0x38d52b);_0x2b9385(_0x1c2d5d['error'](0x1f4,_0x20fb87[_0x7931('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7569ea2..36ccff6 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 _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file +var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x28f456,_0x20170a){var _0x48893b=function(_0x1cc906){while(--_0x1cc906){_0x28f456['push'](_0x28f456['shift']());}};_0x48893b(++_0x20170a);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0xb4e6[_0x50cfc3];return _0x5c11ef;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 304b910..b7dc9e9 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 _0x41bb=['then','error','code','message','result','findOne','agent','VoiceChannels','all','rows','sessionId','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','validate','length','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup\x20fired:','json','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference','conference\x20executed!','transfer','transfer\x20fired:','transfer\x20executed!','path','lodash','../../config/environment','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','name','status','send','NotFound','request'];(function(_0x4ab9d8,_0x211196){var _0x2b7b2e=function(_0x3fb0a8){while(--_0x3fb0a8){_0x4ab9d8['push'](_0x4ab9d8['shift']());}};_0x2b7b2e(++_0x211196);}(_0x41bb,0xc5));var _0xb41b=function(_0x44fbe2,_0x15667){_0x44fbe2=_0x44fbe2-0x0;var _0x3de438=_0x41bb[_0x44fbe2];return _0x3de438;};'use strict';var path=require(_0xb41b('0x0'));var fs=require('fs');var _=require(_0xb41b('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xb41b('0x2'));var util=require('util');var BPromise=require(_0xb41b('0x3'));var jayson=require(_0xb41b('0x4'));var amiClient=jayson[_0xb41b('0x5')][_0xb41b('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0xb41b('0x7'));var Redis=require(_0xb41b('0x8'));config[_0xb41b('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb41b('0xa'))(new Redis(config[_0xb41b('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]},'callNumber':{'type':_0xb41b('0xd'),'required':[!![],_0xb41b('0xe')]},'callerId':{'type':_0xb41b('0xd')},'callbackUrl':{'type':_0xb41b('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb41b('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb41b('0xc')]},'sessionId':{'type':_0xb41b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]},'sessionId':{'type':_0xb41b('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xb41b('0xd'),'required':[!![],_0xb41b('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]},'sessionId':{'type':_0xb41b('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xb41b('0xb'),'required':[!![],_0xb41b('0xc')]}});function emit(_0x29ea51,_0x54591e,_0x2f3673){logger[_0xb41b('0x10')](_0x29ea51,_0x54591e,JSON[_0xb41b('0x11')](_0x2f3673));io['to'](_0x29ea51)[_0xb41b('0x12')](_0x54591e,_0x2f3673);}function handleError(_0x43f4ea){return function(_0x47154d){console[_0xb41b('0x13')]('handleError:',_0x47154d,_0x47154d instanceof RangeError);logger['error'](_0x47154d['stack']);if(_0x47154d instanceof RangeError){if(_0x47154d[_0xb41b('0x14')]){delete _0x47154d['name'];}_0x43f4ea[_0xb41b('0x15')](0x194)[_0xb41b('0x16')](_0x47154d);}else{if(_0x47154d[_0xb41b('0x14')]){delete _0x47154d['name'];}_0x43f4ea['status'](0x1f4)[_0xb41b('0x16')](_0x47154d);}};}function checkError(){return function(_0x3b6ffb){if(!_0x3b6ffb){throw new RangeError(_0xb41b('0x17'));}return _0x3b6ffb;};}function respondWithRpcPromise(_0x2373f4,_0x232ff1){return new BPromise(function(_0x42dccb,_0x4c73da){var _0x58f149=amiClient;return _0x58f149[_0xb41b('0x18')](_0x2373f4,_0x232ff1)[_0xb41b('0x19')](function(_0x871b35){if(_0x871b35['error']){if(_0x871b35[_0xb41b('0x1a')][_0xb41b('0x1b')]===0x1f4){return _0x4c73da(_0x871b35['error'][_0xb41b('0x1c')]);}return _0x42dccb(_0x871b35[_0xb41b('0x1a')]['message']);}else{_0x42dccb(_0x871b35[_0xb41b('0x1d')]);}})['catch'](function(_0x2d0f27){_0x4c73da(_0x2d0f27);});});}function getAgent(_0x4c6a91){return db['User'][_0xb41b('0x1e')]({'where':{'id':_0x4c6a91,'role':_0xb41b('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x4c2e41,_0x2a5286){return new BPromise(function(_0x46aecf,_0x6b98aa){var _0x36dda8=respondWithRpcPromise(_0xb41b('0x20'));var _0x181cbd=getAgent(_0x4c2e41);Promise[_0xb41b('0x21')]([_0x36dda8,_0x181cbd])['then'](function(_0x26ef96){var _0xb68029=_0x26ef96[0x0];var _0x5069aa=_0x26ef96[0x1];var _0xe64568=_['filter'](_0xb68029[_0xb41b('0x22')],function(_0x31d4cd){return _0x31d4cd['UserId']==_0x5069aa['id']&&_0x31d4cd[_0xb41b('0x23')]==_0x2a5286;});if(_0xe64568['length']==0x1){_0x46aecf(_0x5069aa);}else{_0x6b98aa(new RangeError(_0xb41b('0x24')+_0x2a5286+_0xb41b('0x25')));}});});}exports['originate']=function(_0x2c0a8d,_0x41b326){logger[_0xb41b('0x10')](_0xb41b('0x26'),_0x2c0a8d[_0xb41b('0x27')]);var _0x195d63=originateValidation[_0xb41b('0x28')](_0x2c0a8d[_0xb41b('0x27')]);if(_0x195d63[_0xb41b('0x29')]>0x0){return _0x41b326[_0xb41b('0x15')](0x190)['json'](_0x195d63);}var _0x976d56=_0x2c0a8d['body']['userId'];var _0x305803=_0x2c0a8d[_0xb41b('0x27')][_0xb41b('0x2a')];var _0x18e70e=_0x2c0a8d[_0xb41b('0x27')][_0xb41b('0x2b')];var _0x1de31b=_0x2c0a8d[_0xb41b('0x27')][_0xb41b('0x2c')];return getAgent(_0x976d56)[_0xb41b('0x19')](function(_0x3a06a0){logger['info'](_0xb41b('0x2d'),_0x3a06a0[_0xb41b('0x14')]);emit(util[_0xb41b('0x2e')](_0xb41b('0x2f'),_0x3a06a0[_0xb41b('0x14')]),_0xb41b('0x30'),{'callNumber':_0x305803,'callerId':_0x18e70e,'callbackUrl':_0x1de31b});return _0x41b326['status'](0xc8)['json']({'error':![],'message':_0xb41b('0x31')});})[_0xb41b('0x32')](handleError(_0x41b326));};exports['hangup']=function(_0x19c835,_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x33'),_0x19c835[_0xb41b('0x27')]);var _0x47c8bf=hangupValidation[_0xb41b('0x28')](_0x19c835['body']);if(_0x47c8bf[_0xb41b('0x29')]>0x0){return _0x47363e[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x47c8bf);}var _0x40789b=_0x19c835[_0xb41b('0x27')][_0xb41b('0x35')];var _0x428feb=_0x19c835[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x40789b)['then'](function(_0x49e8c4){logger['info'](_0xb41b('0x2d'),_0x49e8c4['name']);emit(util['format'](_0xb41b('0x2f'),_0x49e8c4['name']),_0xb41b('0x36'),{'sessionId':_0x428feb});return _0x47363e[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x37')});})[_0xb41b('0x32')](handleError(_0x47363e));};exports[_0xb41b('0x38')]=function(_0xddb59c,_0x57e043){logger[_0xb41b('0x10')](_0xb41b('0x39'),_0xddb59c[_0xb41b('0x27')]);var _0x174d6c=answerValidation['validate'](_0xddb59c[_0xb41b('0x27')]);if(_0x174d6c['length']>0x0){return _0x57e043[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x174d6c);}var _0x46dbbf=_0xddb59c['body']['userId'];var _0xe71120=_0xddb59c[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x46dbbf)[_0xb41b('0x19')](function(_0x412ec0){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x412ec0['name']);emit(util['format'](_0xb41b('0x2f'),_0x412ec0['name']),_0xb41b('0x3a'),{'sessionId':_0xe71120});return _0x57e043['status'](0xc8)[_0xb41b('0x34')]({'error':![],'message':'answer\x20executed!'});})[_0xb41b('0x32')](handleError(_0x57e043));};exports['hold']=function(_0x606eff,_0x104825){logger[_0xb41b('0x10')](_0xb41b('0x3b'),_0x606eff['body']);var _0x2f8442=holdValidation[_0xb41b('0x28')](_0x606eff['body']);if(_0x2f8442[_0xb41b('0x29')]>0x0){return _0x104825['status'](0x190)['json'](_0x2f8442);}var _0x5733d0=_0x606eff['body'][_0xb41b('0x35')];var _0x23ea63=_0x606eff[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x5733d0)[_0xb41b('0x19')](function(_0x349a6c){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x349a6c[_0xb41b('0x14')]);emit(util[_0xb41b('0x2e')](_0xb41b('0x2f'),_0x349a6c[_0xb41b('0x14')]),_0xb41b('0x3c'),{'sessionId':_0x23ea63});return _0x104825[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x3d')});})['catch'](handleError(_0x104825));};exports[_0xb41b('0x3e')]=function(_0x5e041d,_0x4a7aa3){logger[_0xb41b('0x10')](_0xb41b('0x3f'),_0x5e041d[_0xb41b('0x27')]);var _0x1b576f=unholdValidation[_0xb41b('0x28')](_0x5e041d[_0xb41b('0x27')]);if(_0x1b576f[_0xb41b('0x29')]>0x0){return _0x4a7aa3[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x1b576f);}var _0x1977b1=_0x5e041d[_0xb41b('0x27')][_0xb41b('0x35')];var _0x236c05=_0x5e041d[_0xb41b('0x27')][_0xb41b('0x23')];return getAgent(_0x1977b1)[_0xb41b('0x19')](function(_0x26ce99){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x26ce99[_0xb41b('0x14')]);emit(util[_0xb41b('0x2e')]('user:%s',_0x26ce99[_0xb41b('0x14')]),'webbar:unhold',{'sessionId':_0x236c05});return _0x4a7aa3[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x40')});})[_0xb41b('0x32')](handleError(_0x4a7aa3));};exports[_0xb41b('0x41')]=function(_0x305f0e,_0x2bae07){logger['info'](_0xb41b('0x42'),_0x2bae07[_0xb41b('0x27')]);var _0x140c71=callsValidation['validate'](_0x305f0e[_0xb41b('0x27')]);if(_0x140c71[_0xb41b('0x29')]>0x0){return _0x2bae07[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x140c71);}var _0x454671=_0x305f0e[_0xb41b('0x27')][_0xb41b('0x35')];var _0x540763=respondWithRpcPromise('VoiceChannels');var _0xaeb50e=getAgent(_0x454671);return Promise[_0xb41b('0x21')]([_0x540763,_0xaeb50e])['then'](function(_0x43ad9c){var _0x285099=_0x43ad9c[0x0];var _0x5a322a=_0x43ad9c[0x1];var _0x2dced1=_[_0xb41b('0x43')](_0x285099[_0xb41b('0x22')],function(_0xb1ccab){return _0xb1ccab[_0xb41b('0x44')]==_0x5a322a['id'];});return _0x2bae07[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'count':_0x2dced1[_0xb41b('0x29')],'rows':_0x2dced1});})[_0xb41b('0x32')](handleError(_0x2bae07));};exports[_0xb41b('0x45')]=function(_0x5c5e0d,_0x154fa5){logger[_0xb41b('0x10')]('conference\x20fired:',_0x5c5e0d['body']);var _0x2ad478=conferenceValidation[_0xb41b('0x28')](_0x5c5e0d[_0xb41b('0x27')]);if(_0x2ad478['length']>0x0){return _0x154fa5[_0xb41b('0x15')](0x190)[_0xb41b('0x34')](_0x2ad478);}var _0x1451e7=_0x5c5e0d[_0xb41b('0x27')][_0xb41b('0x35')];return getAgent(_0x1451e7)[_0xb41b('0x19')](function(_0x9bae17){logger[_0xb41b('0x10')](_0xb41b('0x2d'),_0x9bae17[_0xb41b('0x14')]);emit(util['format'](_0xb41b('0x2f'),_0x9bae17[_0xb41b('0x14')]),'webbar:conference');return _0x154fa5[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x46')});})['catch'](handleError(_0x154fa5));};exports[_0xb41b('0x47')]=function(_0x43edc7,_0x10d953){logger[_0xb41b('0x10')](_0xb41b('0x48'),_0x43edc7[_0xb41b('0x27')]);var _0x3c663a=transferValidation[_0xb41b('0x28')](_0x43edc7[_0xb41b('0x27')]);if(_0x3c663a[_0xb41b('0x29')]>0x0){return _0x10d953['status'](0x190)['json'](_0x3c663a);}var _0x4be316=_0x43edc7['body'][_0xb41b('0x35')];var _0x4ad6b5=_0x43edc7[_0xb41b('0x27')][_0xb41b('0x23')];var _0x46eed9=_0x43edc7[_0xb41b('0x27')]['transferNumber'];return getAgent(_0x4be316)[_0xb41b('0x19')](function(_0x5e34a2){logger[_0xb41b('0x10')]('entityFound:',_0x5e34a2[_0xb41b('0x14')]);emit(util['format'](_0xb41b('0x2f'),_0x5e34a2[_0xb41b('0x14')]),'webbar:transfer',{'sessionId':_0x4ad6b5,'transferNumber':_0x46eed9});return _0x10d953[_0xb41b('0x15')](0xc8)[_0xb41b('0x34')]({'error':![],'message':_0xb41b('0x49')});})[_0xb41b('0x32')](handleError(_0x10d953));}; \ No newline at end of file +var _0x07c3=['error','name','send','status','NotFound','request','then','code','message','catch','User','findOne','agent','VoiceChannels','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','user:%s','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','filter','conference\x20fired:','webbar:conference','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:'];(function(_0xf703e,_0x220972){var _0x5936c6=function(_0x51beda){while(--_0x51beda){_0xf703e['push'](_0xf703e['shift']());}};_0x5936c6(++_0x220972);}(_0x07c3,0x1bf));var _0x307c=function(_0x2f1a6e,_0x3082cb){_0x2f1a6e=_0x2f1a6e-0x0;var _0x5865e5=_0x07c3[_0x2f1a6e];return _0x5865e5;};'use strict';var path=require(_0x307c('0x0'));var fs=require('fs');var _=require(_0x307c('0x1'));var db=require(_0x307c('0x2'))['db'];var config=require(_0x307c('0x3'));var util=require(_0x307c('0x4'));var BPromise=require(_0x307c('0x5'));var jayson=require(_0x307c('0x6'));var amiClient=jayson[_0x307c('0x7')]['http']({'port':0x232a});var logger=require(_0x307c('0x8'))(_0x307c('0x9'));var Redis=require(_0x307c('0xa'));config[_0x307c('0xb')]=_[_0x307c('0xc')](config[_0x307c('0xb')],{'host':_0x307c('0xd'),'port':0x18eb});var io=require(_0x307c('0xe'))(new Redis(config[_0x307c('0xb')]));var Schema=require(_0x307c('0xf'));var originateValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],_0x307c('0x11')]},'callNumber':{'type':_0x307c('0x12'),'required':[!![],_0x307c('0x13')]},'callerId':{'type':_0x307c('0x12')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],_0x307c('0x11')]},'sessionId':{'type':_0x307c('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x307c('0x12'),'required':[!![],_0x307c('0x14')]},'transferNumber':{'type':'string','required':[!![],_0x307c('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],_0x307c('0x11')]},'sessionId':{'type':_0x307c('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],_0x307c('0x11')]},'sessionId':{'type':_0x307c('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],_0x307c('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x307c('0x10'),'required':[!![],_0x307c('0x11')]}});function emit(_0x424a74,_0x53e2f4,_0x2a3edc){logger[_0x307c('0x16')](_0x424a74,_0x53e2f4,JSON[_0x307c('0x17')](_0x2a3edc));io['to'](_0x424a74)[_0x307c('0x18')](_0x53e2f4,_0x2a3edc);}function handleError(_0x301e1a){return function(_0x2e21a6){console[_0x307c('0x19')](_0x307c('0x1a'),_0x2e21a6,_0x2e21a6 instanceof RangeError);logger[_0x307c('0x1b')](_0x2e21a6['stack']);if(_0x2e21a6 instanceof RangeError){if(_0x2e21a6['name']){delete _0x2e21a6[_0x307c('0x1c')];}_0x301e1a['status'](0x194)[_0x307c('0x1d')](_0x2e21a6);}else{if(_0x2e21a6['name']){delete _0x2e21a6['name'];}_0x301e1a[_0x307c('0x1e')](0x1f4)[_0x307c('0x1d')](_0x2e21a6);}};}function checkError(){return function(_0x5eb73d){if(!_0x5eb73d){throw new RangeError(_0x307c('0x1f'));}return _0x5eb73d;};}function respondWithRpcPromise(_0xa79b24,_0x5b640f){return new BPromise(function(_0x1cdc48,_0x45fe2){var _0x574622=amiClient;return _0x574622[_0x307c('0x20')](_0xa79b24,_0x5b640f)[_0x307c('0x21')](function(_0x9a66a0){if(_0x9a66a0[_0x307c('0x1b')]){if(_0x9a66a0[_0x307c('0x1b')][_0x307c('0x22')]===0x1f4){return _0x45fe2(_0x9a66a0[_0x307c('0x1b')][_0x307c('0x23')]);}return _0x1cdc48(_0x9a66a0[_0x307c('0x1b')][_0x307c('0x23')]);}else{_0x1cdc48(_0x9a66a0['result']);}})[_0x307c('0x24')](function(_0x58c383){_0x45fe2(_0x58c383);});});}function getAgent(_0x598d43){return db[_0x307c('0x25')][_0x307c('0x26')]({'where':{'id':_0x598d43,'role':_0x307c('0x27')}})[_0x307c('0x21')](checkError());}function getAgentCheckSession(_0x25dede,_0x1591d1){return new BPromise(function(_0x4fd125,_0x1fbdda){var _0x181fa2=respondWithRpcPromise(_0x307c('0x28'));var _0x54da33=getAgent(_0x25dede);Promise[_0x307c('0x29')]([_0x181fa2,_0x54da33])[_0x307c('0x21')](function(_0xcb6ae6){var _0x12d9a9=_0xcb6ae6[0x0];var _0x3a58ec=_0xcb6ae6[0x1];var _0x1e5da0=_['filter'](_0x12d9a9[_0x307c('0x2a')],function(_0x1e448e){return _0x1e448e[_0x307c('0x2b')]==_0x3a58ec['id']&&_0x1e448e[_0x307c('0x2c')]==_0x1591d1;});if(_0x1e5da0[_0x307c('0x2d')]==0x1){_0x4fd125(_0x3a58ec);}else{_0x1fbdda(new RangeError(_0x307c('0x2e')+_0x1591d1+_0x307c('0x2f')));}});});}exports[_0x307c('0x30')]=function(_0x12b5f4,_0x55f4c0){logger[_0x307c('0x16')](_0x307c('0x31'),_0x12b5f4[_0x307c('0x32')]);var _0x1a706a=originateValidation[_0x307c('0xf')](_0x12b5f4[_0x307c('0x32')]);if(_0x1a706a[_0x307c('0x2d')]>0x0){return _0x55f4c0[_0x307c('0x1e')](0x190)[_0x307c('0x33')](_0x1a706a);}var _0x4338e2=_0x12b5f4[_0x307c('0x32')]['userId'];var _0x107518=_0x12b5f4[_0x307c('0x32')]['callNumber'];var _0x383e25=_0x12b5f4[_0x307c('0x32')]['callerId'];var _0x4fa969=_0x12b5f4['body'][_0x307c('0x34')];return getAgent(_0x4338e2)[_0x307c('0x21')](function(_0x878c8c){logger[_0x307c('0x16')](_0x307c('0x35'),_0x878c8c[_0x307c('0x1c')]);emit(util[_0x307c('0x36')]('user:%s',_0x878c8c[_0x307c('0x1c')]),_0x307c('0x37'),{'callNumber':_0x107518,'callerId':_0x383e25,'callbackUrl':_0x4fa969});return _0x55f4c0[_0x307c('0x1e')](0xc8)[_0x307c('0x33')]({'error':![],'message':_0x307c('0x38')});})[_0x307c('0x24')](handleError(_0x55f4c0));};exports[_0x307c('0x39')]=function(_0x5da51b,_0x5f085a){logger['info'](_0x307c('0x3a'),_0x5da51b[_0x307c('0x32')]);var _0x4e2873=hangupValidation['validate'](_0x5da51b[_0x307c('0x32')]);if(_0x4e2873['length']>0x0){return _0x5f085a[_0x307c('0x1e')](0x190)[_0x307c('0x33')](_0x4e2873);}var _0x31e3fa=_0x5da51b[_0x307c('0x32')][_0x307c('0x3b')];var _0x70fc50=_0x5da51b[_0x307c('0x32')][_0x307c('0x2c')];return getAgent(_0x31e3fa)['then'](function(_0x2d7544){logger['info'](_0x307c('0x35'),_0x2d7544['name']);emit(util[_0x307c('0x36')](_0x307c('0x3c'),_0x2d7544[_0x307c('0x1c')]),_0x307c('0x3d'),{'sessionId':_0x70fc50});return _0x5f085a[_0x307c('0x1e')](0xc8)[_0x307c('0x33')]({'error':![],'message':_0x307c('0x3e')});})[_0x307c('0x24')](handleError(_0x5f085a));};exports[_0x307c('0x3f')]=function(_0x1f645e,_0xaa4479){logger[_0x307c('0x16')]('answer\x20fired:',_0x1f645e['body']);var _0x3c8758=answerValidation[_0x307c('0xf')](_0x1f645e[_0x307c('0x32')]);if(_0x3c8758[_0x307c('0x2d')]>0x0){return _0xaa4479[_0x307c('0x1e')](0x190)[_0x307c('0x33')](_0x3c8758);}var _0x4a7f36=_0x1f645e['body'][_0x307c('0x3b')];var _0x5d7d0d=_0x1f645e[_0x307c('0x32')][_0x307c('0x2c')];return getAgent(_0x4a7f36)[_0x307c('0x21')](function(_0x4de79e){logger[_0x307c('0x16')](_0x307c('0x35'),_0x4de79e[_0x307c('0x1c')]);emit(util[_0x307c('0x36')](_0x307c('0x3c'),_0x4de79e['name']),_0x307c('0x40'),{'sessionId':_0x5d7d0d});return _0xaa4479[_0x307c('0x1e')](0xc8)['json']({'error':![],'message':_0x307c('0x41')});})[_0x307c('0x24')](handleError(_0xaa4479));};exports[_0x307c('0x42')]=function(_0x195b90,_0x3a9013){logger[_0x307c('0x16')](_0x307c('0x43'),_0x195b90['body']);var _0x3dee68=holdValidation[_0x307c('0xf')](_0x195b90[_0x307c('0x32')]);if(_0x3dee68['length']>0x0){return _0x3a9013[_0x307c('0x1e')](0x190)[_0x307c('0x33')](_0x3dee68);}var _0x2ced73=_0x195b90[_0x307c('0x32')]['userId'];var _0xa1faa0=_0x195b90['body']['sessionId'];return getAgent(_0x2ced73)['then'](function(_0x26081b){logger[_0x307c('0x16')](_0x307c('0x35'),_0x26081b[_0x307c('0x1c')]);emit(util['format'](_0x307c('0x3c'),_0x26081b[_0x307c('0x1c')]),_0x307c('0x44'),{'sessionId':_0xa1faa0});return _0x3a9013[_0x307c('0x1e')](0xc8)[_0x307c('0x33')]({'error':![],'message':_0x307c('0x45')});})[_0x307c('0x24')](handleError(_0x3a9013));};exports['unhold']=function(_0x50876a,_0x1f41c9){logger[_0x307c('0x16')](_0x307c('0x46'),_0x50876a[_0x307c('0x32')]);var _0x4006da=unholdValidation[_0x307c('0xf')](_0x50876a[_0x307c('0x32')]);if(_0x4006da['length']>0x0){return _0x1f41c9['status'](0x190)[_0x307c('0x33')](_0x4006da);}var _0x6d04b8=_0x50876a[_0x307c('0x32')][_0x307c('0x3b')];var _0x46f257=_0x50876a['body']['sessionId'];return getAgent(_0x6d04b8)['then'](function(_0x41cae0){logger[_0x307c('0x16')]('entityFound:',_0x41cae0[_0x307c('0x1c')]);emit(util[_0x307c('0x36')](_0x307c('0x3c'),_0x41cae0['name']),'webbar:unhold',{'sessionId':_0x46f257});return _0x1f41c9['status'](0xc8)[_0x307c('0x33')]({'error':![],'message':_0x307c('0x47')});})['catch'](handleError(_0x1f41c9));};exports['calls']=function(_0x46b41e,_0x38d1ff){logger['info'](_0x307c('0x48'),_0x38d1ff[_0x307c('0x32')]);var _0xd27876=callsValidation[_0x307c('0xf')](_0x46b41e['body']);if(_0xd27876[_0x307c('0x2d')]>0x0){return _0x38d1ff[_0x307c('0x1e')](0x190)[_0x307c('0x33')](_0xd27876);}var _0x3c2b3d=_0x46b41e[_0x307c('0x32')][_0x307c('0x3b')];var _0x34d223=respondWithRpcPromise(_0x307c('0x28'));var _0x560d36=getAgent(_0x3c2b3d);return Promise[_0x307c('0x29')]([_0x34d223,_0x560d36])[_0x307c('0x21')](function(_0x5d9fb4){var _0x55ecb7=_0x5d9fb4[0x0];var _0x10efed=_0x5d9fb4[0x1];var _0xe1ddea=_[_0x307c('0x49')](_0x55ecb7[_0x307c('0x2a')],function(_0x55c268){return _0x55c268['UserId']==_0x10efed['id'];});return _0x38d1ff[_0x307c('0x1e')](0xc8)[_0x307c('0x33')]({'count':_0xe1ddea['length'],'rows':_0xe1ddea});})['catch'](handleError(_0x38d1ff));};exports['conference']=function(_0x2bc93a,_0x3b68d2){logger[_0x307c('0x16')](_0x307c('0x4a'),_0x2bc93a[_0x307c('0x32')]);var _0xfe43a2=conferenceValidation['validate'](_0x2bc93a[_0x307c('0x32')]);if(_0xfe43a2[_0x307c('0x2d')]>0x0){return _0x3b68d2[_0x307c('0x1e')](0x190)[_0x307c('0x33')](_0xfe43a2);}var _0x54bfb3=_0x2bc93a[_0x307c('0x32')]['userId'];return getAgent(_0x54bfb3)[_0x307c('0x21')](function(_0x15d37b){logger['info'](_0x307c('0x35'),_0x15d37b['name']);emit(util[_0x307c('0x36')](_0x307c('0x3c'),_0x15d37b['name']),_0x307c('0x4b'));return _0x3b68d2[_0x307c('0x1e')](0xc8)[_0x307c('0x33')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x3b68d2));};exports['transfer']=function(_0x38cdfb,_0x32cc40){logger['info'](_0x307c('0x4c'),_0x38cdfb[_0x307c('0x32')]);var _0x580983=transferValidation['validate'](_0x38cdfb[_0x307c('0x32')]);if(_0x580983['length']>0x0){return _0x32cc40[_0x307c('0x1e')](0x190)['json'](_0x580983);}var _0x4307a9=_0x38cdfb['body'][_0x307c('0x3b')];var _0xa82555=_0x38cdfb['body'][_0x307c('0x2c')];var _0x12e471=_0x38cdfb['body']['transferNumber'];return getAgent(_0x4307a9)['then'](function(_0x27d0b2){logger[_0x307c('0x16')](_0x307c('0x35'),_0x27d0b2['name']);emit(util[_0x307c('0x36')](_0x307c('0x3c'),_0x27d0b2[_0x307c('0x1c')]),_0x307c('0x4d'),{'sessionId':_0xa82555,'transferNumber':_0x12e471});return _0x32cc40[_0x307c('0x1e')](0xc8)[_0x307c('0x33')]({'error':![],'message':_0x307c('0x4e')});})[_0x307c('0x24')](handleError(_0x32cc40));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 04bd6ad..8c2c7c5 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 _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file +var _0x6343=['/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeAnswers','removeAgents','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0x4820d1,_0x9ca326){var _0x4fd096=function(_0x57e865){while(--_0x57e865){_0x4820d1['push'](_0x4820d1['shift']());}};_0x4fd096(++_0x9ca326);}(_0x6343,0x168));var _0x3634=function(_0x38d28d,_0x352835){_0x38d28d=_0x38d28d-0x0;var _0x2b69a5=_0x6343[_0x38d28d];return _0x2b69a5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var controller=require('./whatsappAccount.controller');router[_0x3634('0x4')]('/',auth[_0x3634('0x5')](),controller['index']);router[_0x3634('0x4')](_0x3634('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x3634('0x4')](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x8')]);router[_0x3634('0x4')](_0x3634('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3634('0x4')](_0x3634('0xa'),auth['isAuthenticated'](),controller[_0x3634('0xb')]);router[_0x3634('0x4')](_0x3634('0xc'),auth[_0x3634('0x5')](),controller[_0x3634('0xd')]);router[_0x3634('0x4')](_0x3634('0xe'),auth[_0x3634('0x5')](),controller[_0x3634('0xf')]);router[_0x3634('0x10')]('/',auth[_0x3634('0x5')](),controller[_0x3634('0x11')]);router[_0x3634('0x10')](_0x3634('0x9'),auth['isAuthenticated'](),controller[_0x3634('0x12')]);router['post'](_0x3634('0xa'),auth[_0x3634('0x5')](),controller[_0x3634('0x13')]);router[_0x3634('0x10')](_0x3634('0xc'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);router['post']('/:id/applications',auth[_0x3634('0x5')](),controller['addApplications']);router[_0x3634('0x10')](_0x3634('0x15'),controller[_0x3634('0x16')]);router['post'](_0x3634('0x17'),auth[_0x3634('0x5')](),controller['send']);router[_0x3634('0x18')]('/:id',auth[_0x3634('0x5')](),controller[_0x3634('0x19')]);router['delete'](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x1a')]);router['delete'](_0x3634('0x9'),auth[_0x3634('0x5')](),controller['removeDispositions']);router[_0x3634('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3634('0x1c')]);router[_0x3634('0x1b')]('/:id/users',auth[_0x3634('0x5')](),controller[_0x3634('0x1d')]);module[_0x3634('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b26110d..261c755 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 _0x420a=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','twilio'];(function(_0x36a3af,_0x13b630){var _0xa65201=function(_0x40e9cf){while(--_0x40e9cf){_0x36a3af['push'](_0x36a3af['shift']());}};_0xa65201(++_0x13b630);}(_0x420a,0x1c1));var _0xa420=function(_0x28c292,_0x19cd5b){_0x28c292=_0x28c292-0x0;var _0x4eca35=_0x420a[_0x28c292];return _0x4eca35;};'use strict';var Sequelize=require(_0xa420('0x0'));var rs=require(_0xa420('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa420('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xa420('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xa420('0x3')],'defaultValue':function(){return rs[_0xa420('0x4')]();}},'phone':{'type':Sequelize[_0xa420('0x3')]},'type':{'type':Sequelize['ENUM'](_0xa420('0x5'),_0xa420('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xa420('0x3')]},'authToken':{'type':Sequelize[_0xa420('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa420('0x7')],'defaultValue':function(){return _0xa420('0x8');}},'notificationSound':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa420('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa420('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa420('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa420('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a70c3){if(!_0x2a70c3){this[_0xa420('0xb')]('mandatoryDispositionPauseId',null);}this[_0xa420('0xb')](_0xa420('0xc'),_0x2a70c3);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc2a3=['randomstring','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x5c298a,_0x579b14){var _0x3419fe=function(_0x340588){while(--_0x340588){_0x5c298a['push'](_0x5c298a['shift']());}};_0x3419fe(++_0x579b14);}(_0xc2a3,0x12f));var _0x3c2a=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xc2a3[_0x58965a];return _0x254efc;};'use strict';var Sequelize=require(_0x3c2a('0x0'));var rs=require(_0x3c2a('0x1'));module['exports']={'name':{'type':Sequelize[_0x3c2a('0x2')],'unique':_0x3c2a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3c2a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x3c2a('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x3c2a('0x2')],'defaultValue':function(){return rs[_0x3c2a('0x4')]();}},'phone':{'type':Sequelize[_0x3c2a('0x2')]},'type':{'type':Sequelize[_0x3c2a('0x5')](_0x3c2a('0x6'),_0x3c2a('0x7'))},'accountSid':{'type':Sequelize[_0x3c2a('0x2')]},'baseUrl':{'type':Sequelize[_0x3c2a('0x2')]},'authToken':{'type':Sequelize[_0x3c2a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3c2a('0x8')],'defaultValue':function(){return _0x3c2a('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3c2a('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3c2a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3c2a('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3c2a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3c2a('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3c2a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3c2a('0xb')],'comment':_0x3c2a('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x3c2a('0xa')],'defaultValue':![],'comment':_0x3c2a('0xd'),'set':function(_0x3e9701){if(!_0x3e9701){this[_0x3c2a('0xe')](_0x3c2a('0xf'),null);}this[_0x3c2a('0xe')]('mandatoryDisposition',_0x3e9701);}},'description':{'type':Sequelize[_0x3c2a('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 50fedbd..cd20b42 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 _0x6250=['updatedAt','CompanyId','ListId','mobile','From','replace','whatsapp:','messageId','MessageSid','notifications','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','defaults','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','include','findAll','rows','show','params','rawAttributes','keys','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','getDispositions','merge','Disposition','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','addAgents','omit','spread','removeAgents','emit','userWhatsappAccount:remove','findOne','User','getAgents','addApplications','sequelize','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','priority','finally','json','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt'];(function(_0x50c186,_0xf7791){var _0x1da419=function(_0x17b339){while(--_0x17b339){_0x50c186['push'](_0x50c186['shift']());}};_0x1da419(++_0xf7791);}(_0x6250,0x1b1));var _0x0625=function(_0x371e2d,_0x28de18){_0x371e2d=_0x371e2d-0x0;var _0x273c0a=_0x6250[_0x371e2d];return _0x273c0a;};'use strict';var emlformat=require(_0x0625('0x0'));var rimraf=require(_0x0625('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0625('0x2'));var rp=require(_0x0625('0x3'));var moment=require(_0x0625('0x4'));var BPromise=require(_0x0625('0x5'));var Mustache=require(_0x0625('0x6'));var util=require(_0x0625('0x7'));var path=require(_0x0625('0x8'));var sox=require(_0x0625('0x9'));var csv=require(_0x0625('0xa'));var ejs=require(_0x0625('0xb'));var fs=require('fs');var fs_extra=require(_0x0625('0xc'));var _=require(_0x0625('0xd'));var squel=require('squel');var crypto=require(_0x0625('0xe'));var jsforce=require(_0x0625('0xf'));var deskjs=require(_0x0625('0x10'));var toCsv=require(_0x0625('0xa'));var querystring=require(_0x0625('0x11'));var Papa=require(_0x0625('0x12'));var Redis=require(_0x0625('0x13'));var authService=require(_0x0625('0x14'));var qs=require(_0x0625('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0625('0x16'))(_0x0625('0x17'));var utils=require('../../config/utils');var config=require(_0x0625('0x18'));var licenseUtil=require(_0x0625('0x19'));var db=require(_0x0625('0x1a'))['db'];config[_0x0625('0x1b')]=_['defaults'](config['redis'],{'host':_0x0625('0x1c'),'port':0x18eb});var socket=require(_0x0625('0x1d'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0625('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1f6387,_0x12561c,_0x258a6d,_0x423c25){return new BPromise(function(_0x401c5d,_0x5a3a73){var _0x553f72=_0x423c25||client;return _0x553f72[_0x0625('0x1f')](_0x1f6387,_0x258a6d)[_0x0625('0x20')](function(_0x368b90){logger[_0x0625('0x21')](_0x0625('0x22'),_0x12561c,_0x0625('0x23'));logger[_0x0625('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x12561c,'request\x20sent',JSON[_0x0625('0x25')](_0x368b90));if(_0x368b90[_0x0625('0x26')]){if(_0x368b90['error']['code']===0x1f4){logger[_0x0625('0x26')](_0x0625('0x22'),_0x12561c,_0x368b90['error'][_0x0625('0x27')]);return _0x5a3a73(_0x368b90[_0x0625('0x26')][_0x0625('0x27')]);}logger['error'](_0x0625('0x22'),_0x12561c,_0x368b90[_0x0625('0x26')][_0x0625('0x27')]);return _0x401c5d(_0x368b90['error'][_0x0625('0x27')]);}else{logger['info'](_0x0625('0x22'),_0x12561c,_0x0625('0x23'));_0x401c5d(_0x368b90[_0x0625('0x28')]['message']);}})[_0x0625('0x29')](function(_0x189f48){logger[_0x0625('0x26')](_0x0625('0x22'),_0x12561c,_0x189f48);_0x5a3a73(_0x189f48);});});}function respondWithStatusCode(_0x5ee744,_0x8cacc){_0x8cacc=_0x8cacc||0xcc;return function(_0x2fc0d5){if(_0x2fc0d5){return _0x5ee744['sendStatus'](_0x8cacc);}return _0x5ee744[_0x0625('0x2a')](_0x8cacc)[_0x0625('0x2b')]();};}function respondWithResult(_0x41641f,_0x1d762d){_0x1d762d=_0x1d762d||0xc8;return function(_0x3c056b){if(_0x3c056b){return _0x41641f[_0x0625('0x2a')](_0x1d762d)['json'](_0x3c056b);}};}function respondWithFilteredResult(_0x247d83,_0x24b6bc){return function(_0xc6327c){if(_0xc6327c){var _0x5bfd0b=typeof _0x24b6bc[_0x0625('0x2c')]===_0x0625('0x2d')&&typeof _0x24b6bc[_0x0625('0x2e')]===_0x0625('0x2d');var _0x1280b9=_0xc6327c[_0x0625('0x2f')];var _0x57abc6=_0x5bfd0b?0x0:_0x24b6bc[_0x0625('0x2c')];var _0x4de261=_0x5bfd0b?_0xc6327c[_0x0625('0x2f')]:_0x24b6bc['offset']+_0x24b6bc['limit'];var _0x29fa0c;if(_0x4de261>=_0x1280b9){_0x4de261=_0x1280b9;_0x29fa0c=0xc8;}else{_0x29fa0c=0xce;}_0x247d83[_0x0625('0x2a')](_0x29fa0c);return _0x247d83['set'](_0x0625('0x30'),_0x57abc6+'-'+_0x4de261+'/'+_0x1280b9)['json'](_0xc6327c);}return null;};}function patchUpdates(_0x52c75d){return function(_0x40aff1){try{jsonpatch[_0x0625('0x31')](_0x40aff1,_0x52c75d,!![]);}catch(_0x57aabb){return BPromise[_0x0625('0x32')](_0x57aabb);}return _0x40aff1[_0x0625('0x33')]();};}function saveUpdates(_0x16cbd1,_0xd578d5){return function(_0x5280d8){if(_0x5280d8){return _0x5280d8[_0x0625('0x34')](_0x16cbd1)[_0x0625('0x20')](function(_0x31e25f){return _0x31e25f;});}return null;};}function removeEntity(_0x4fbbd5,_0x14924b){return function(_0x39d6a0){if(_0x39d6a0){return _0x39d6a0[_0x0625('0x35')]()[_0x0625('0x20')](function(){var _0x5dd6d7=_0x39d6a0[_0x0625('0x36')]({'plain':!![]});var _0x79b2ae=_0x0625('0x37');return db['UserProfileResource'][_0x0625('0x35')]({'where':{'type':_0x79b2ae,'resourceId':_0x5dd6d7['id']}})[_0x0625('0x20')](function(){return _0x39d6a0;});})[_0x0625('0x20')](function(){_0x4fbbd5[_0x0625('0x2a')](0xcc)[_0x0625('0x2b')]();});}};}function handleEntityNotFound(_0x13e409,_0x2233dc){return function(_0x491485){if(!_0x491485){_0x13e409[_0x0625('0x38')](0x194);}return _0x491485;};}function handleError(_0x2bde5f,_0x9b6dd){_0x9b6dd=_0x9b6dd||0x1f4;return function(_0x829806){logger[_0x0625('0x26')](_0x829806[_0x0625('0x39')]);if(_0x829806['name']){delete _0x829806['name'];}_0x2bde5f['status'](_0x9b6dd)[_0x0625('0x3a')](_0x829806);};}exports[_0x0625('0x3b')]=function(_0x4378b4,_0x462d4c){var _0x12fd22={'include':[{'model':db[_0x0625('0x3c')],'as':_0x0625('0x3d')}]},_0x133590={},_0x30eaad={'count':0x0,'rows':[]};var _0x14eff6=_[_0x0625('0x3e')](db[_0x0625('0x3f')]['rawAttributes'],function(_0x256a69){return{'name':_0x256a69[_0x0625('0x40')],'type':_0x256a69['type']['key']};});_0x133590[_0x0625('0x41')]=_['map'](_0x14eff6,_0x0625('0x42'));_0x133590['query']=_['keys'](_0x4378b4[_0x0625('0x43')]);_0x133590[_0x0625('0x44')]=_[_0x0625('0x45')](_0x133590[_0x0625('0x41')],_0x133590[_0x0625('0x43')]);_0x12fd22[_0x0625('0x46')]=_[_0x0625('0x45')](_0x133590[_0x0625('0x41')],qs[_0x0625('0x47')](_0x4378b4[_0x0625('0x43')][_0x0625('0x47')]));_0x12fd22[_0x0625('0x46')]=_0x12fd22['attributes'][_0x0625('0x48')]?_0x12fd22[_0x0625('0x46')]:_0x133590[_0x0625('0x41')];if(!_0x4378b4[_0x0625('0x43')][_0x0625('0x49')](_0x0625('0x4a'))){_0x12fd22[_0x0625('0x2e')]=qs[_0x0625('0x2e')](_0x4378b4['query'][_0x0625('0x2e')]);_0x12fd22['offset']=qs['offset'](_0x4378b4[_0x0625('0x43')][_0x0625('0x2c')]);}_0x12fd22[_0x0625('0x4b')]=qs[_0x0625('0x4c')](_0x4378b4[_0x0625('0x43')][_0x0625('0x4c')]);_0x12fd22[_0x0625('0x4d')]=qs['filters'](_[_0x0625('0x4e')](_0x4378b4['query'],_0x133590[_0x0625('0x44')]),_0x14eff6);if(_0x4378b4[_0x0625('0x43')][_0x0625('0x4f')]){_0x12fd22[_0x0625('0x4d')]=_['merge'](_0x12fd22['where'],{'$or':_[_0x0625('0x3e')](_0x14eff6,function(_0x20c01a){if(_0x20c01a[_0x0625('0x50')]!=='VIRTUAL'){var _0x539322={};_0x539322[_0x20c01a[_0x0625('0x42')]]={'$like':'%'+_0x4378b4[_0x0625('0x43')]['filter']+'%'};return _0x539322;}})});}_0x12fd22=_['merge']({},_0x12fd22,_0x4378b4[_0x0625('0x51')]);var _0x3302ad={'where':_0x12fd22[_0x0625('0x4d')]};return db[_0x0625('0x3f')][_0x0625('0x2f')](_0x3302ad)['then'](function(_0x10d856){_0x30eaad[_0x0625('0x2f')]=_0x10d856;if(_0x4378b4[_0x0625('0x43')]['includeAll']){_0x12fd22[_0x0625('0x52')]=[{'all':!![]}];}return db[_0x0625('0x3f')][_0x0625('0x53')](_0x12fd22);})[_0x0625('0x20')](function(_0x14f959){_0x30eaad[_0x0625('0x54')]=_0x14f959;return _0x30eaad;})[_0x0625('0x20')](respondWithFilteredResult(_0x462d4c,_0x12fd22))[_0x0625('0x29')](handleError(_0x462d4c,null));};exports[_0x0625('0x55')]=function(_0x3db465,_0x2b1a36){var _0x12eecf={'raw':![],'where':{'id':_0x3db465[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0x3c')],'as':_0x0625('0x3d')}]},_0xc0f0d={};_0xc0f0d[_0x0625('0x41')]=_['keys'](db['WhatsappAccount'][_0x0625('0x57')]);_0xc0f0d[_0x0625('0x43')]=_[_0x0625('0x58')](_0x3db465[_0x0625('0x43')]);_0xc0f0d[_0x0625('0x44')]=_['intersection'](_0xc0f0d['model'],_0xc0f0d[_0x0625('0x43')]);_0x12eecf['attributes']=_[_0x0625('0x45')](_0xc0f0d['model'],qs[_0x0625('0x47')](_0x3db465[_0x0625('0x43')][_0x0625('0x47')]));_0x12eecf['attributes']=_0x12eecf[_0x0625('0x46')]['length']?_0x12eecf[_0x0625('0x46')]:_0xc0f0d[_0x0625('0x41')];if(_0x3db465[_0x0625('0x43')][_0x0625('0x59')]){_0x12eecf['include']=[{'all':!![]}];}_0x12eecf=_['merge']({},_0x12eecf,_0x3db465[_0x0625('0x51')]);return db['WhatsappAccount']['find'](_0x12eecf)[_0x0625('0x20')](handleEntityNotFound(_0x2b1a36,null))['then'](respondWithResult(_0x2b1a36,null))[_0x0625('0x29')](handleError(_0x2b1a36,null));};exports['create']=function(_0x54fbee,_0xc1b7e2){return db[_0x0625('0x3f')]['create'](_0x54fbee['body'],{})[_0x0625('0x20')](function(_0x297a1e){var _0x354694=_0x54fbee[_0x0625('0x5a')][_0x0625('0x36')]({'plain':!![]});if(!_0x354694)throw new Error(_0x0625('0x5b'));if(_0x354694['role']===_0x0625('0x5a')){var _0x46065d=_0x297a1e[_0x0625('0x36')]({'plain':!![]});var _0x252fc8=_0x0625('0x37');return db['UserProfileSection'][_0x0625('0x5c')]({'where':{'name':_0x252fc8,'userProfileId':_0x354694[_0x0625('0x5d')]},'raw':!![]})[_0x0625('0x20')](function(_0x19dbc2){if(_0x19dbc2&&_0x19dbc2[_0x0625('0x5e')]===0x0){return db[_0x0625('0x5f')][_0x0625('0x60')]({'name':_0x46065d[_0x0625('0x42')],'resourceId':_0x46065d['id'],'type':_0x19dbc2[_0x0625('0x42')],'sectionId':_0x19dbc2['id']},{})[_0x0625('0x20')](function(){return _0x297a1e;});}else{return _0x297a1e;}})[_0x0625('0x29')](function(_0x3d48b0){logger[_0x0625('0x26')](_0x0625('0x61'),_0x3d48b0);throw _0x3d48b0;});}return _0x297a1e;})[_0x0625('0x20')](respondWithResult(_0xc1b7e2,0xc9))[_0x0625('0x29')](handleError(_0xc1b7e2,null));};exports[_0x0625('0x34')]=function(_0x57e949,_0x2a3d34){if(_0x57e949['body']['id']){delete _0x57e949['body']['id'];}return db[_0x0625('0x3f')]['find']({'where':{'id':_0x57e949[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x0625('0x20')](handleEntityNotFound(_0x2a3d34,null))['then'](saveUpdates(_0x57e949[_0x0625('0x62')],null))[_0x0625('0x20')](respondWithResult(_0x2a3d34,null))[_0x0625('0x29')](handleError(_0x2a3d34,null));};exports[_0x0625('0x35')]=function(_0x5f3515,_0x275e12){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x5f3515[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x275e12,null))[_0x0625('0x20')](removeEntity(_0x275e12,null))['catch'](handleError(_0x275e12,null));};exports[_0x0625('0x63')]=function(_0x180775,_0x28e0ef){return db[_0x0625('0x3f')][_0x0625('0x63')]()[_0x0625('0x20')](respondWithResult(_0x28e0ef,null))[_0x0625('0x29')](handleError(_0x28e0ef,null));};exports[_0x0625('0x64')]=function(_0x3ba79a,_0x4dd834,_0x5dcb1b){if(_0x3ba79a['body']['id']){delete _0x3ba79a[_0x0625('0x62')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3ba79a[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x4dd834,null))[_0x0625('0x20')](function(_0x19a11e){if(_0x19a11e){_0x3ba79a[_0x0625('0x62')][_0x0625('0x65')]=_0x19a11e['id'];return db['Disposition'][_0x0625('0x60')](_0x3ba79a[_0x0625('0x62')]);}})[_0x0625('0x20')](respondWithResult(_0x4dd834,null))[_0x0625('0x29')](handleError(_0x4dd834,null));};exports[_0x0625('0x66')]=function(_0x2378cf,_0x167a40,_0x1239ab){var _0x203f45={'raw':![],'where':{}};var _0x589904={};var _0x17a815={'count':0x0,'rows':[]};return db[_0x0625('0x3f')]['findOne']({'where':{'id':_0x2378cf['params']['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x167a40,null))[_0x0625('0x20')](function(_0x54f331){if(_0x54f331){_0x589904[_0x0625('0x41')]=_[_0x0625('0x58')](db['Disposition'][_0x0625('0x57')]);_0x589904[_0x0625('0x43')]=_[_0x0625('0x58')](_0x2378cf['query']);_0x589904['filters']=_[_0x0625('0x45')](_0x589904[_0x0625('0x41')],_0x589904[_0x0625('0x43')]);_0x203f45[_0x0625('0x46')]=_[_0x0625('0x45')](_0x589904['model'],qs['fields'](_0x2378cf[_0x0625('0x43')][_0x0625('0x47')]));_0x203f45['attributes']=_0x203f45[_0x0625('0x46')][_0x0625('0x48')]?_0x203f45[_0x0625('0x46')]:_0x589904[_0x0625('0x41')];if(!_0x2378cf['query']['hasOwnProperty'](_0x0625('0x4a'))){_0x203f45[_0x0625('0x2e')]=qs['limit'](_0x2378cf['query'][_0x0625('0x2e')]);_0x203f45['offset']=qs[_0x0625('0x2c')](_0x2378cf['query'][_0x0625('0x2c')]);}_0x203f45[_0x0625('0x4b')]=qs[_0x0625('0x4c')](_0x2378cf[_0x0625('0x43')][_0x0625('0x4c')]);_0x203f45[_0x0625('0x4d')]=qs[_0x0625('0x44')](_[_0x0625('0x4e')](_0x2378cf[_0x0625('0x43')],_0x589904[_0x0625('0x44')]));_0x203f45['where'][_0x0625('0x65')]=_0x54f331['id'];if(_0x2378cf[_0x0625('0x43')][_0x0625('0x4f')]){_0x203f45['where']=_[_0x0625('0x67')](_0x203f45[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x203f45['attributes'],function(_0x5b76ed){var _0x41b1ea={};_0x41b1ea[_0x5b76ed]={'$like':'%'+_0x2378cf['query']['filter']+'%'};return _0x41b1ea;})});}_0x203f45=_['merge']({},_0x203f45,_0x2378cf['options']);return db['Disposition'][_0x0625('0x2f')]({'where':_0x203f45[_0x0625('0x4d')]})[_0x0625('0x20')](function(_0x279a72){_0x17a815[_0x0625('0x2f')]=_0x279a72;if(_0x2378cf['query'][_0x0625('0x59')]){_0x203f45[_0x0625('0x52')]=[{'all':!![]}];}return db[_0x0625('0x68')][_0x0625('0x53')](_0x203f45);})['then'](function(_0x1297e5){_0x17a815[_0x0625('0x54')]=_0x1297e5;return _0x17a815;});}})['then'](respondWithFilteredResult(_0x167a40,_0x203f45))[_0x0625('0x29')](handleError(_0x167a40,null));};exports[_0x0625('0x69')]=function(_0x45c54e,_0x349ddf,_0x430b4c){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x45c54e[_0x0625('0x56')]['id']}})['then'](handleEntityNotFound(_0x349ddf,null))['then'](function(_0x30ad36){if(_0x30ad36){return _0x30ad36[_0x0625('0x69')](_0x45c54e[_0x0625('0x43')]['ids']);}})[_0x0625('0x20')](respondWithStatusCode(_0x349ddf,null))[_0x0625('0x29')](handleError(_0x349ddf,null));};exports[_0x0625('0x6a')]=function(_0x3197e5,_0x53ea24,_0x30d330){if(_0x3197e5['body']['id']){delete _0x3197e5[_0x0625('0x62')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3197e5[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x53ea24,null))['then'](function(_0x549d20){if(_0x549d20){_0x3197e5['body'][_0x0625('0x65')]=_0x549d20['id'];return db['CannedAnswer'][_0x0625('0x60')](_0x3197e5[_0x0625('0x62')]);}})[_0x0625('0x20')](respondWithResult(_0x53ea24,null))[_0x0625('0x29')](handleError(_0x53ea24,null));};exports[_0x0625('0x6b')]=function(_0x2bfb5d,_0x244a67,_0x59867b){var _0x5787cd={'raw':![],'where':{}};var _0x48c71b={};var _0x5645a0={'count':0x0,'rows':[]};return db[_0x0625('0x3f')]['findOne']({'where':{'id':_0x2bfb5d['params']['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x244a67,null))[_0x0625('0x20')](function(_0x5d78e7){if(_0x5d78e7){_0x48c71b[_0x0625('0x41')]=_['keys'](db['CannedAnswer'][_0x0625('0x57')]);_0x48c71b[_0x0625('0x43')]=_[_0x0625('0x58')](_0x2bfb5d[_0x0625('0x43')]);_0x48c71b[_0x0625('0x44')]=_[_0x0625('0x45')](_0x48c71b[_0x0625('0x41')],_0x48c71b[_0x0625('0x43')]);_0x5787cd[_0x0625('0x46')]=_['intersection'](_0x48c71b[_0x0625('0x41')],qs[_0x0625('0x47')](_0x2bfb5d[_0x0625('0x43')][_0x0625('0x47')]));_0x5787cd[_0x0625('0x46')]=_0x5787cd[_0x0625('0x46')]['length']?_0x5787cd[_0x0625('0x46')]:_0x48c71b[_0x0625('0x41')];if(!_0x2bfb5d[_0x0625('0x43')][_0x0625('0x49')]('nolimit')){_0x5787cd[_0x0625('0x2e')]=qs[_0x0625('0x2e')](_0x2bfb5d['query'][_0x0625('0x2e')]);_0x5787cd[_0x0625('0x2c')]=qs[_0x0625('0x2c')](_0x2bfb5d[_0x0625('0x43')][_0x0625('0x2c')]);}_0x5787cd[_0x0625('0x4b')]=qs['sort'](_0x2bfb5d[_0x0625('0x43')]['sort']);_0x5787cd[_0x0625('0x4d')]=qs[_0x0625('0x44')](_[_0x0625('0x4e')](_0x2bfb5d[_0x0625('0x43')],_0x48c71b[_0x0625('0x44')]));_0x5787cd[_0x0625('0x4d')][_0x0625('0x65')]=_0x5d78e7['id'];if(_0x2bfb5d[_0x0625('0x43')][_0x0625('0x4f')]){_0x5787cd[_0x0625('0x4d')]=_[_0x0625('0x67')](_0x5787cd[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x5787cd[_0x0625('0x46')],function(_0x4a3bc5){var _0x23f007={};_0x23f007[_0x4a3bc5]={'$like':'%'+_0x2bfb5d['query'][_0x0625('0x4f')]+'%'};return _0x23f007;})});}_0x5787cd=_['merge']({},_0x5787cd,_0x2bfb5d[_0x0625('0x51')]);return db[_0x0625('0x6c')]['count']({'where':_0x5787cd[_0x0625('0x4d')]})[_0x0625('0x20')](function(_0x48891e){_0x5645a0['count']=_0x48891e;if(_0x2bfb5d['query']['includeAll']){_0x5787cd[_0x0625('0x52')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5787cd);})['then'](function(_0x495cf8){_0x5645a0[_0x0625('0x54')]=_0x495cf8;return _0x5645a0;});}})[_0x0625('0x20')](respondWithFilteredResult(_0x244a67,_0x5787cd))[_0x0625('0x29')](handleError(_0x244a67,null));};exports[_0x0625('0x6d')]=function(_0x247524,_0x24c121,_0x33c750){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x247524[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x24c121,null))[_0x0625('0x20')](function(_0x1f7415){if(_0x1f7415){return _0x1f7415[_0x0625('0x6d')](_0x247524[_0x0625('0x43')][_0x0625('0x6e')]);}})[_0x0625('0x20')](respondWithStatusCode(_0x24c121,null))[_0x0625('0x29')](handleError(_0x24c121,null));};exports[_0x0625('0x6f')]=function(_0x5bca08,_0xb6aba3,_0x5a3a34){return db['WhatsappAccount'][_0x0625('0x5c')]({'where':{'id':_0x5bca08[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0xb6aba3,null))[_0x0625('0x20')](function(_0x2fe771){if(_0x2fe771){return _0x2fe771[_0x0625('0x6f')](_0x5bca08[_0x0625('0x62')][_0x0625('0x6e')],_[_0x0625('0x70')](_0x5bca08[_0x0625('0x62')],['ids','id'])||{})[_0x0625('0x71')](function(_0x7054da){for(var _0x36f21b=0x0;_0x36f21b<_0x5bca08[_0x0625('0x62')][_0x0625('0x6e')][_0x0625('0x48')];_0x36f21b+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x5bca08[_0x0625('0x62')]['ids'][_0x36f21b]),'WhatsappAccountId':Number(_0x5bca08[_0x0625('0x56')]['id'])});}return _0x7054da;});}})[_0x0625('0x20')](respondWithResult(_0xb6aba3,null))[_0x0625('0x29')](handleError(_0xb6aba3,null));};exports[_0x0625('0x72')]=function(_0x356fa8,_0x1745eb,_0x13644c){return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x356fa8[_0x0625('0x56')]['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x1745eb,null))[_0x0625('0x20')](function(_0x163362){if(_0x163362){return _0x163362[_0x0625('0x72')](_0x356fa8[_0x0625('0x43')]['ids'])[_0x0625('0x20')](function(){if(_['isArray'](_0x356fa8['query'][_0x0625('0x6e')])){for(var _0x4cac2f=0x0;_0x4cac2f<_0x356fa8[_0x0625('0x43')][_0x0625('0x6e')][_0x0625('0x48')];_0x4cac2f+=0x1){socket[_0x0625('0x73')](_0x0625('0x74'),{'UserId':Number(_0x356fa8['query'][_0x0625('0x6e')][_0x4cac2f]),'WhatsappAccountId':Number(_0x356fa8[_0x0625('0x56')]['id'])});}}else{socket[_0x0625('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x356fa8['query'][_0x0625('0x6e')]),'WhatsappAccountId':Number(_0x356fa8['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1745eb,null))['catch'](handleError(_0x1745eb,null));};exports['getAgents']=function(_0x51658e,_0x56bda9,_0x1627ee){var _0x3fc09e={};var _0x1f8b2c={};var _0x4937b8;var _0x372630;return db[_0x0625('0x3f')][_0x0625('0x75')]({'where':{'id':_0x51658e['params']['id']}})[_0x0625('0x20')](handleEntityNotFound(_0x56bda9,null))['then'](function(_0x2644b0){if(_0x2644b0){_0x4937b8=_0x2644b0;_0x1f8b2c[_0x0625('0x41')]=_[_0x0625('0x58')](db[_0x0625('0x76')][_0x0625('0x57')]);_0x1f8b2c[_0x0625('0x43')]=_[_0x0625('0x58')](_0x51658e[_0x0625('0x43')]);_0x1f8b2c[_0x0625('0x44')]=_['intersection'](_0x1f8b2c[_0x0625('0x41')],_0x1f8b2c['query']);_0x3fc09e[_0x0625('0x46')]=_[_0x0625('0x45')](_0x1f8b2c['model'],qs['fields'](_0x51658e[_0x0625('0x43')]['fields']));_0x3fc09e['attributes']=_0x3fc09e['attributes'][_0x0625('0x48')]?_0x3fc09e[_0x0625('0x46')]:_0x1f8b2c[_0x0625('0x41')];_0x3fc09e['order']=qs[_0x0625('0x4c')](_0x51658e['query']['sort']);_0x3fc09e[_0x0625('0x4d')]=qs[_0x0625('0x44')](_[_0x0625('0x4e')](_0x51658e['query'],_0x1f8b2c[_0x0625('0x44')]));if(_0x51658e['query'][_0x0625('0x4f')]){_0x3fc09e[_0x0625('0x4d')]=_['merge'](_0x3fc09e[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x3fc09e['attributes'],function(_0x4fe6be){var _0x57e66c={};_0x57e66c[_0x4fe6be]={'$like':'%'+_0x51658e[_0x0625('0x43')][_0x0625('0x4f')]+'%'};return _0x57e66c;})});}_0x3fc09e=_[_0x0625('0x67')]({},_0x3fc09e,_0x51658e[_0x0625('0x51')]);return _0x4937b8[_0x0625('0x77')](_0x3fc09e);}})[_0x0625('0x20')](function(_0x5f3e68){if(_0x5f3e68){_0x372630=_0x5f3e68[_0x0625('0x48')];if(!_0x51658e[_0x0625('0x43')][_0x0625('0x49')](_0x0625('0x4a'))){_0x3fc09e[_0x0625('0x2e')]=qs['limit'](_0x51658e['query']['limit']);_0x3fc09e[_0x0625('0x2c')]=qs[_0x0625('0x2c')](_0x51658e['query'][_0x0625('0x2c')]);}return _0x4937b8['getAgents'](_0x3fc09e);}})[_0x0625('0x20')](function(_0x18194d){if(_0x18194d){return _0x18194d?{'count':_0x372630,'rows':_0x18194d}:null;}})[_0x0625('0x20')](respondWithResult(_0x56bda9,null))[_0x0625('0x29')](handleError(_0x56bda9,null));};exports[_0x0625('0x78')]=function(_0x413212,_0x49a49f){var _0x4d6319=_0x413212['params']['id'];var _0x5806dc=_0x413212['body'];var _0x48c552=0xc8;var _0x242ae6=null;return db[_0x0625('0x79')]['transaction']({'isolationLevel':db[_0x0625('0x79')]['Transaction'][_0x0625('0x7a')]['READ_COMMITTED']},function(_0x393011){return db[_0x0625('0x3f')][_0x0625('0x75')]({'where':{'id':_0x4d6319},'transaction':_0x393011})['then'](function(_0x2b2d90){if(_0x2b2d90){return db['WhatsappApplication'][_0x0625('0x35')]({'where':{'WhatsappAccountId':_0x4d6319},'transaction':_0x393011})[_0x0625('0x20')](function(){var _0x57a94f=_['map'](_0x5806dc,function(_0x28fb8c){_0x28fb8c[_0x0625('0x65')]=_0x4d6319;return _0x28fb8c;});return db[_0x0625('0x7b')]['bulkCreate'](_0x57a94f,{'transaction':_0x393011});});}else{_0x48c552=0x194;_0x242ae6=[];}});})[_0x0625('0x20')](function(){if(_0x48c552!==0x194){return db[_0x0625('0x7b')][_0x0625('0x7c')]({'where':{'WhatsappAccountId':_0x4d6319},'order':_0x0625('0x7d')})[_0x0625('0x20')](function(_0x2169d3){_0x242ae6=_0x2169d3;});}})[_0x0625('0x29')](function(_0x10b0a1){_0x48c552=0x1f4;logger['error'](_0x10b0a1[_0x0625('0x39')]);if(_0x10b0a1[_0x0625('0x42')]){delete _0x10b0a1[_0x0625('0x42')];}_0x242ae6=_0x10b0a1;})[_0x0625('0x7e')](function(){if(_0x242ae6===null){_0x49a49f[_0x0625('0x38')](_0x48c552);}else{if(_0x48c552===0x1f4){_0x49a49f['status'](_0x48c552)['send'](_0x242ae6);}else{_0x49a49f['status'](_0x48c552)[_0x0625('0x7f')](_0x242ae6);}}});};exports[_0x0625('0x80')]=function(_0x24d2ad,_0xe88c30,_0x465fc2){var _0x140605={};var _0x3c1826={};var _0x47f023;var _0x46726e;return db[_0x0625('0x3f')]['findOne']({'where':{'id':_0x24d2ad[_0x0625('0x56')]['id']}})['then'](handleEntityNotFound(_0xe88c30,null))['then'](function(_0x2fedc1){if(_0x2fedc1){_0x47f023=_0x2fedc1;_0x3c1826[_0x0625('0x41')]=_['keys'](db['WhatsappApplication'][_0x0625('0x57')]);_0x3c1826['query']=_[_0x0625('0x58')](_0x24d2ad[_0x0625('0x43')]);_0x3c1826['filters']=_[_0x0625('0x45')](_0x3c1826[_0x0625('0x41')],_0x3c1826['query']);_0x140605[_0x0625('0x46')]=_['intersection'](_0x3c1826[_0x0625('0x41')],qs[_0x0625('0x47')](_0x24d2ad[_0x0625('0x43')]['fields']));_0x140605['attributes']=_0x140605[_0x0625('0x46')]['length']?_0x140605[_0x0625('0x46')]:_0x3c1826[_0x0625('0x41')];_0x140605[_0x0625('0x4b')]=qs[_0x0625('0x4c')](_0x24d2ad[_0x0625('0x43')]['sort']);_0x140605[_0x0625('0x4d')]=qs['filters'](_['pick'](_0x24d2ad['query'],_0x3c1826[_0x0625('0x44')]));if(_0x24d2ad[_0x0625('0x43')][_0x0625('0x4f')]){_0x140605[_0x0625('0x4d')]=_[_0x0625('0x67')](_0x140605[_0x0625('0x4d')],{'$or':_[_0x0625('0x3e')](_0x140605[_0x0625('0x46')],function(_0x5a910f){var _0x645b8a={};_0x645b8a[_0x5a910f]={'$like':'%'+_0x24d2ad[_0x0625('0x43')][_0x0625('0x4f')]+'%'};return _0x645b8a;})});}_0x140605=_['merge']({},_0x140605,_0x24d2ad[_0x0625('0x51')]);return _0x47f023[_0x0625('0x80')](_0x140605);}})[_0x0625('0x20')](function(_0x5d786f){if(_0x5d786f){_0x46726e=_0x5d786f[_0x0625('0x48')];if(!_0x24d2ad[_0x0625('0x43')][_0x0625('0x49')](_0x0625('0x4a'))){_0x140605[_0x0625('0x2e')]=qs[_0x0625('0x2e')](_0x24d2ad[_0x0625('0x43')][_0x0625('0x2e')]);_0x140605[_0x0625('0x2c')]=qs[_0x0625('0x2c')](_0x24d2ad[_0x0625('0x43')][_0x0625('0x2c')]);}return _0x47f023[_0x0625('0x80')](_0x140605);}})['then'](function(_0x8834be){if(_0x8834be){return _0x8834be?{'count':_0x46726e,'rows':_0x8834be}:null;}})[_0x0625('0x20')](respondWithResult(_0xe88c30,null))[_0x0625('0x29')](handleError(_0xe88c30,null));};exports[_0x0625('0x81')]=function(_0x526ad1,_0x5de433,_0x1f1588){var _0x364536={'channel':_0x0625('0x82')};var _0x2e24b1=[];var _0xe0e5d9=[];var _0x11f701={};return db['WhatsappAccount'][_0x0625('0x5c')]({'where':{'id':_0x526ad1[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0x7b')],'as':_0x0625('0x83')}]})[_0x0625('0x20')](handleEntityNotFound(_0x5de433,null))[_0x0625('0x20')](function(_0x2711cf){_0x364536[_0x0625('0x84')]=_0x2711cf;if(_0x364536[_0x0625('0x84')]&&_0x364536[_0x0625('0x84')][_0x0625('0x50')]==='sinch'&&_0x526ad1['body'][_0x0625('0x85')]){if(_0x526ad1[_0x0625('0x62')][_0x0625('0x85')][_0x0625('0x48')]===0x0)return;if(_0x526ad1['body'][_0x0625('0x85')][0x0][_0x0625('0x86')]!==_0x0625('0x87'))return;return db[_0x0625('0x88')]['update']({'read':!![],'readAt':_0x526ad1[_0x0625('0x62')]['statuses'][0x0][_0x0625('0x89')]},{'where':{'messageId':_0x526ad1[_0x0625('0x62')]['statuses'][0x0][_0x0625('0x8a')]},'individualHooks':!![]})[_0x0625('0x20')](function(_0x1265ca){return _0x5de433['status'](0xc8)[_0x0625('0x7f')](_0x1265ca);});}_0x364536[_0x0625('0x8b')]=_['orderBy'](_0x2711cf[_0x0625('0x83')],[_0x0625('0x7d')],[_0x0625('0x8c')]);if(_0x364536[_0x0625('0x84')]['Applications']){delete _0x364536[_0x0625('0x84')][_0x0625('0x83')];}return db[_0x0625('0x8d')]['describe']()['then'](function(_0x2b62f2){if(!_0x2b62f2){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))]('no\x20available\x20attributes');}_0x2e24b1=_[_0x0625('0x90')](_[_0x0625('0x58')](_0x2b62f2),[_0x0625('0x91'),_0x0625('0x92')]);_0xe0e5d9=_['difference'](_['keys'](_0x2b62f2),['createdAt',_0x0625('0x92'),_0x0625('0x93'),_0x0625('0x94')]);_0x364536[_0x0625('0x62')]={'mapKey':_0x0625('0x95')};if(_0x364536[_0x0625('0x84')]&&_0x364536['account'][_0x0625('0x50')]==='twilio'){_0x364536['body']['from']=_0x526ad1['body'][_0x0625('0x96')][_0x0625('0x97')](_0x0625('0x98'),'');_0x364536[_0x0625('0x62')][_0x0625('0x62')]=_0x526ad1[_0x0625('0x62')]['Body'];_0x364536[_0x0625('0x62')][_0x0625('0x99')]=_0x526ad1[_0x0625('0x62')][_0x0625('0x9a')];}if(_0x364536[_0x0625('0x84')]&&_0x364536['account'][_0x0625('0x50')]==='sinch'){_0x364536['body']['from']=_0x526ad1[_0x0625('0x62')][_0x0625('0x9b')][0x0]['from'];_0x364536[_0x0625('0x62')][_0x0625('0x62')]=_0x526ad1['body'][_0x0625('0x9b')][0x0]['message'][_0x0625('0x62')];_0x364536['body']['messageId']=_0x526ad1['body'][_0x0625('0x9b')][0x0][_0x0625('0x8a')];}if(_0x364536[_0x0625('0x62')]['id']){delete _0x364536[_0x0625('0x62')]['id'];}if(_[_0x0625('0x9c')](_0x364536[_0x0625('0x62')][_0x0625('0x9d')])){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))](_0x0625('0x9e'));}if(_['isNil'](_0x364536[_0x0625('0x62')][_0x0625('0x62')])||_0x364536[_0x0625('0x62')][_0x0625('0x62')]===''){throw new db['Sequelize'][(_0x0625('0x8f'))](_0x0625('0x9f'));}if(_['isNil'](_0x364536[_0x0625('0x62')][_0x0625('0xa0')])){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe0e5d9);}if(!_[_0x0625('0xa1')](_0xe0e5d9,_0x364536['body'][_0x0625('0xa0')])){throw new db[(_0x0625('0x8e'))][(_0x0625('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe0e5d9);}_0x11f701[_0x364536['body'][_0x0625('0xa0')]]=_0x364536[_0x0625('0x62')]['from'];return db[_0x0625('0xa2')][_0x0625('0x5c')]({'where':{'id':_0x364536['account'][_0x0625('0x94')]},'include':[{'model':db[_0x0625('0x8d')],'as':_0x0625('0xa3'),'where':_0x11f701,'limit':0x1,'order':[[_0x0625('0x92'),_0x0625('0xa4')]]}]});})[_0x0625('0x20')](handleEntityNotFound(_0x5de433,null))[_0x0625('0x20')](function(_0x39e2c4){if(_0x39e2c4){_0x364536[_0x0625('0xa5')]=_['omit'](_0x39e2c4,[_0x0625('0xa3')]);if(_0x39e2c4[_0x0625('0xa3')]['length']){return _0x39e2c4['Contacts'][0x0];}var _0x2c29bb=_[_0x0625('0xa6')](_0x364536[_0x0625('0x62')],{'firstName':_0x364536[_0x0625('0x62')]['from'],'ListId':_0x39e2c4['id']});_0x2c29bb[_0x364536[_0x0625('0x62')][_0x0625('0xa0')]]=_0x364536[_0x0625('0x62')][_0x0625('0x9d')];return db[_0x0625('0x8d')][_0x0625('0x60')](_0x2c29bb,{'fields':_0x2e24b1,'raw':!![]});}})[_0x0625('0x20')](handleEntityNotFound(_0x5de433,null))[_0x0625('0x20')](function(_0x5c59bc){if(_0x5c59bc){_0x364536['contact']=_0x5c59bc;var _0x3bf4e7={'ContactId':_0x5c59bc['id'],'phone':_0x364536[_0x0625('0x62')]['from'],'WhatsappAccountId':_0x526ad1[_0x0625('0x56')]['id']};var _0x5523d3={'ContactId':_0x5c59bc['id'],'WhatsappAccountId':_0x526ad1['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x5523d3})['then'](function(_0x4f8817){if(_0x4f8817){return[_0x4f8817,![]];}return db[_0x0625('0xa7')][_0x0625('0x60')](_0x3bf4e7)['then'](function(_0xf92ff6){return[_0xf92ff6,!![]];});});}})[_0x0625('0x71')](function(_0x32a3db,_0x58f44e){_0x364536[_0x0625('0xa8')]=_0x32a3db['get']({'plain':!![]});_0x364536[_0x0625('0xa8')][_0x0625('0xa9')]=![];if(_0x58f44e){if(_0x364536[_0x0625('0x84')][_0x0625('0xaa')]){_0x364536[_0x0625('0x8b')]['push']({'id':0x0,'priority':_0x364536[_0x0625('0x8b')]['length']+0x1,'app':_0x0625('0xab'),'appdata':_0x0625('0xac'),'interval':_0x0625('0xad')});}_0x364536[_0x0625('0xa8')][_0x0625('0xa9')]=!![];}return db[_0x0625('0x88')]['create']({'phone':_0x364536[_0x0625('0x62')][_0x0625('0x9d')],'messageId':_0x364536[_0x0625('0x62')][_0x0625('0x99')],'body':_0x364536[_0x0625('0x62')][_0x0625('0x62')],'WhatsappAccountId':_0x526ad1['params']['id'],'WhatsappInteractionId':_0x32a3db['id'],'direction':'in','ContactId':_0x32a3db[_0x0625('0xae')],'AttachmentId':_0x364536[_0x0625('0x62')][_0x0625('0xaf')]});})[_0x0625('0x20')](function(_0xafea00){_0x364536[_0x0625('0x27')]=_0xafea00;if(_0x364536[_0x0625('0xa8')][_0x0625('0xb0')]){return db[_0x0625('0x76')]['find']({'attributes':['id',_0x0625('0x42')],'where':{'id':_0x364536['interaction'][_0x0625('0xb0')]}})['then'](function(_0x181131){if(_0x181131){_0x364536[_0x0625('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0625('0xb1'),'appdata':_0x181131[_0x0625('0x42')]+','+(_0x364536['account'][_0x0625('0xb2')]||0xa),'interval':_0x0625('0xad')});}return respondWithRpcPromise('Start',_0x0625('0xb3'),_0x364536);});}return respondWithRpcPromise(_0x0625('0xb4'),_0x0625('0xb3'),_0x364536);})[_0x0625('0x20')](function(_0x1f995a){if(_0x1f995a){var _0x74d50c=0xc8;var _0x275627=_0x0625('0xb5');logger[_0x0625('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x275627,_0x74d50c,'entity\x20found');logger[_0x0625('0x24')](_0x0625('0xb6'),_0x275627,_0x74d50c,'entity\x20found',JSON['stringify'](_0x1f995a));if(_0x364536[_0x0625('0x84')][_0x0625('0x50')]===_0x0625('0xb7')){return _0x5de433['status'](_0x74d50c)[_0x0625('0xb8')](_0x0625('0xb9'),_0x0625('0xba'))['send'](_0x0625('0xbb'));}else{return _0x5de433[_0x0625('0x2a')](_0x74d50c)[_0x0625('0x7f')](_0x1f995a);}}});})[_0x0625('0x29')](handleError(_0x5de433,null));};exports[_0x0625('0x3a')]=function(_0x4a1613,_0x248b9d,_0xf9bafb){var _0x101eb2,_0x5c0331,_0x2eab21;if(_[_0x0625('0x9c')](_0x4a1613[_0x0625('0x62')]['body'])||_0x4a1613[_0x0625('0x62')][_0x0625('0x62')]===''){throw new db['Sequelize'][(_0x0625('0x8f'))](_0x0625('0x9f'));}if(_['isNil'](_0x4a1613['body']['to'])){throw new db['Sequelize'][(_0x0625('0x8f'))](_0x0625('0xbc'));}_0x101eb2=_0x4a1613[_0x0625('0x62')]['to'];return db[_0x0625('0x3f')][_0x0625('0x5c')]({'where':{'id':_0x4a1613[_0x0625('0x56')]['id']},'include':[{'model':db[_0x0625('0xa2')],'as':'List','include':[{'model':db[_0x0625('0x8d')],'as':_0x0625('0xa3'),'where':{'mobile':_0x101eb2},'limit':0x1,'order':[[_0x0625('0x92'),_0x0625('0xa4')]]}]}]})[_0x0625('0x20')](handleEntityNotFound(_0x248b9d,null))[_0x0625('0x20')](function(_0x368f15){if(_0x368f15&&_0x368f15[_0x0625('0xbd')]){_0x5c0331=_0x368f15[_0x0625('0x36')]({'plain':!![]});if(_0x5c0331[_0x0625('0xbd')]&&_0x5c0331[_0x0625('0xbd')][_0x0625('0xa3')][_0x0625('0x48')]){return _0x5c0331[_0x0625('0xbd')][_0x0625('0xa3')][0x0];}return db[_0x0625('0x8d')][_0x0625('0x60')](_['defaults'](_0x4a1613[_0x0625('0x62')],{'firstName':_0x101eb2,'mobile':_0x101eb2,'phone':_0x101eb2,'ListId':_0x5c0331[_0x0625('0x94')]}));}})[_0x0625('0x20')](handleEntityNotFound(_0x248b9d,null))['then'](function(_0xec75eb){if(_0xec75eb){_0x2eab21=_0xec75eb;return db['WhatsappInteraction'][_0x0625('0x5c')]({'where':{'ContactId':_0x2eab21['id'],'closed':![],'WhatsappAccountId':_0x5c0331['id']}})[_0x0625('0x20')](function(_0x301311){if(_0x301311){return[_0x301311,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x4a1613['user']['id'],'ContactId':_0x2eab21['id'],'WhatsappAccountId':_0x5c0331['id'],'phone':_0x101eb2,'firstMsgDirection':_0x0625('0xbe'),'Messages':[_[_0x0625('0x67')](_0x4a1613[_0x0625('0x62')],{'read':![],'body':_0x4a1613[_0x0625('0x62')]['body'],'phone':_0x101eb2,'WhatsappAccountId':_0x5c0331['id'],'UserId':_0x4a1613[_0x0625('0x5a')]['id'],'ContactId':_0x2eab21['id']})]},{'include':[{'model':db[_0x0625('0x88')],'as':_0x0625('0xbf')}]})[_0x0625('0x20')](function(_0x391996){return[_0x391996,!![]];});});}})[_0x0625('0x71')](function(_0x6ecd54,_0x5c603d){if(_0x5c603d){return _0x6ecd54;}return db['WhatsappMessage'][_0x0625('0x60')](_['merge'](_0x4a1613[_0x0625('0x62')],{'read':![],'body':_0x4a1613['body'][_0x0625('0x62')],'phone':_0x101eb2,'WhatsappAccountId':_0x5c0331['id'],'WhatsappInteractionId':_0x6ecd54['id'],'UserId':_0x4a1613[_0x0625('0x5a')]['id'],'ContactId':_0x2eab21['id']}))['then'](function(_0x13450f){_0x6ecd54[_0x0625('0xc0')][_0x0625('0xbf')]=[];_0x6ecd54[_0x0625('0xc0')][_0x0625('0xbf')]['push'](_0x13450f[_0x0625('0xc0')]);return _0x6ecd54;});})[_0x0625('0x20')](respondWithResult(_0x248b9d,null))[_0x0625('0x29')](handleError(_0x248b9d,null));}; \ No newline at end of file +var _0x8300=['ListId','mobile','from','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','WhatsappInteraction','spread','interaction','autoclose','push','close','unmanaged','created','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','update','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId'];(function(_0x22fc1d,_0x5b8ee1){var _0x29e032=function(_0x69e18a){while(--_0x69e18a){_0x22fc1d['push'](_0x22fc1d['shift']());}};_0x29e032(++_0x5b8ee1);}(_0x8300,0x1b9));var _0x0830=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x8300[_0x1ebce2];return _0x4a330c;};'use strict';var emlformat=require(_0x0830('0x0'));var rimraf=require(_0x0830('0x1'));var zipdir=require(_0x0830('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0830('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0830('0x4'));var path=require(_0x0830('0x5'));var sox=require(_0x0830('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0830('0x7'));var _=require(_0x0830('0x8'));var squel=require(_0x0830('0x9'));var crypto=require(_0x0830('0xa'));var jsforce=require(_0x0830('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0830('0xc'));var Papa=require(_0x0830('0xd'));var Redis=require(_0x0830('0xe'));var authService=require(_0x0830('0xf'));var qs=require(_0x0830('0x10'));var as=require(_0x0830('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0830('0x12'))(_0x0830('0x13'));var utils=require('../../config/utils');var config=require(_0x0830('0x14'));var licenseUtil=require(_0x0830('0x15'));var db=require('../../mysqldb')['db'];config[_0x0830('0x16')]=_[_0x0830('0x17')](config[_0x0830('0x16')],{'host':_0x0830('0x18'),'port':0x18eb});var socket=require(_0x0830('0x19'))(new Redis(config['redis']));require(_0x0830('0x1a'))[_0x0830('0x1b')](socket);var jayson=require(_0x0830('0x1c'));var client=jayson[_0x0830('0x1d')][_0x0830('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3a1924,_0x1b7c0b,_0x53c85a,_0x1216a5){return new BPromise(function(_0x44a2af,_0x1c244d){var _0x3dc08f=_0x1216a5||client;return _0x3dc08f['request'](_0x3a1924,_0x53c85a)['then'](function(_0x368ad9){logger[_0x0830('0x1f')](_0x0830('0x20'),_0x1b7c0b,_0x0830('0x21'));logger[_0x0830('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1b7c0b,_0x0830('0x21'),JSON[_0x0830('0x23')](_0x368ad9));if(_0x368ad9['error']){if(_0x368ad9['error'][_0x0830('0x24')]===0x1f4){logger[_0x0830('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x1b7c0b,_0x368ad9[_0x0830('0x25')][_0x0830('0x26')]);return _0x1c244d(_0x368ad9[_0x0830('0x25')][_0x0830('0x26')]);}logger[_0x0830('0x25')](_0x0830('0x20'),_0x1b7c0b,_0x368ad9[_0x0830('0x25')][_0x0830('0x26')]);return _0x44a2af(_0x368ad9['error'][_0x0830('0x26')]);}else{logger[_0x0830('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x1b7c0b,'request\x20sent');_0x44a2af(_0x368ad9[_0x0830('0x27')][_0x0830('0x26')]);}})['catch'](function(_0x306a05){logger[_0x0830('0x25')](_0x0830('0x20'),_0x1b7c0b,_0x306a05);_0x1c244d(_0x306a05);});});}function respondWithStatusCode(_0x1fd53f,_0xccf22d){_0xccf22d=_0xccf22d||0xcc;return function(_0x334303){if(_0x334303){return _0x1fd53f[_0x0830('0x28')](_0xccf22d);}return _0x1fd53f[_0x0830('0x29')](_0xccf22d)[_0x0830('0x2a')]();};}function respondWithResult(_0x1ee9b6,_0x454af1){_0x454af1=_0x454af1||0xc8;return function(_0x2be53){if(_0x2be53){return _0x1ee9b6['status'](_0x454af1)[_0x0830('0x2b')](_0x2be53);}};}function respondWithFilteredResult(_0x31160c,_0x17c94a){return function(_0x4634ee){if(_0x4634ee){var _0xaf751d=typeof _0x17c94a['offset']==='undefined'&&typeof _0x17c94a[_0x0830('0x2c')]===_0x0830('0x2d');var _0x29879b=_0x4634ee['count'];var _0x4f6f6a=_0xaf751d?0x0:_0x17c94a['offset'];var _0x2a3382=_0xaf751d?_0x4634ee['count']:_0x17c94a[_0x0830('0x2e')]+_0x17c94a['limit'];var _0x16c409;if(_0x2a3382>=_0x29879b){_0x2a3382=_0x29879b;_0x16c409=0xc8;}else{_0x16c409=0xce;}_0x31160c[_0x0830('0x29')](_0x16c409);return _0x31160c[_0x0830('0x2f')](_0x0830('0x30'),_0x4f6f6a+'-'+_0x2a3382+'/'+_0x29879b)[_0x0830('0x2b')](_0x4634ee);}return null;};}function patchUpdates(_0x2bbfdf){return function(_0x2f04e6){try{jsonpatch[_0x0830('0x31')](_0x2f04e6,_0x2bbfdf,!![]);}catch(_0x414ce5){return BPromise[_0x0830('0x32')](_0x414ce5);}return _0x2f04e6['save']();};}function saveUpdates(_0x5a62c9,_0x86a7b3){return function(_0x59e49f){if(_0x59e49f){return _0x59e49f['update'](_0x5a62c9)[_0x0830('0x33')](function(_0x1380a5){return _0x1380a5;});}return null;};}function removeEntity(_0x11c285,_0xcd2c79){return function(_0xbe1f6e){if(_0xbe1f6e){return _0xbe1f6e[_0x0830('0x34')]()['then'](function(){var _0x430a66=_0xbe1f6e[_0x0830('0x35')]({'plain':!![]});var _0xdc209d=_0x0830('0x36');return db[_0x0830('0x37')][_0x0830('0x34')]({'where':{'type':_0xdc209d,'resourceId':_0x430a66['id']}})[_0x0830('0x33')](function(){return _0xbe1f6e;});})[_0x0830('0x33')](function(){_0x11c285[_0x0830('0x29')](0xcc)[_0x0830('0x2a')]();});}};}function handleEntityNotFound(_0x17384e,_0xd95335){return function(_0x20a8f0){if(!_0x20a8f0){_0x17384e['sendStatus'](0x194);}return _0x20a8f0;};}function handleError(_0x2dfed9,_0x3906ef){_0x3906ef=_0x3906ef||0x1f4;return function(_0x989f0a){logger['error'](_0x989f0a[_0x0830('0x38')]);if(_0x989f0a[_0x0830('0x39')]){delete _0x989f0a['name'];}_0x2dfed9['status'](_0x3906ef)[_0x0830('0x3a')](_0x989f0a);};}exports[_0x0830('0x3b')]=function(_0x1f4f35,_0x3cd46a){var _0x6e0192={'include':[{'model':db['Pause'],'as':_0x0830('0x3c')}]},_0x43bb40={},_0x139fed={'count':0x0,'rows':[]};var _0x372c35=_[_0x0830('0x3d')](db[_0x0830('0x3e')][_0x0830('0x3f')],function(_0x592713){return{'name':_0x592713[_0x0830('0x40')],'type':_0x592713[_0x0830('0x41')]['key']};});_0x43bb40[_0x0830('0x42')]=_[_0x0830('0x3d')](_0x372c35,_0x0830('0x39'));_0x43bb40['query']=_['keys'](_0x1f4f35['query']);_0x43bb40[_0x0830('0x43')]=_[_0x0830('0x44')](_0x43bb40[_0x0830('0x42')],_0x43bb40[_0x0830('0x45')]);_0x6e0192[_0x0830('0x46')]=_[_0x0830('0x44')](_0x43bb40[_0x0830('0x42')],qs[_0x0830('0x47')](_0x1f4f35['query']['fields']));_0x6e0192[_0x0830('0x46')]=_0x6e0192[_0x0830('0x46')][_0x0830('0x48')]?_0x6e0192[_0x0830('0x46')]:_0x43bb40[_0x0830('0x42')];if(!_0x1f4f35[_0x0830('0x45')][_0x0830('0x49')](_0x0830('0x4a'))){_0x6e0192['limit']=qs[_0x0830('0x2c')](_0x1f4f35[_0x0830('0x45')][_0x0830('0x2c')]);_0x6e0192[_0x0830('0x2e')]=qs[_0x0830('0x2e')](_0x1f4f35[_0x0830('0x45')][_0x0830('0x2e')]);}_0x6e0192['order']=qs[_0x0830('0x4b')](_0x1f4f35['query']['sort']);_0x6e0192[_0x0830('0x4c')]=qs['filters'](_[_0x0830('0x4d')](_0x1f4f35[_0x0830('0x45')],_0x43bb40[_0x0830('0x43')]),_0x372c35);if(_0x1f4f35['query'][_0x0830('0x4e')]){_0x6e0192[_0x0830('0x4c')]=_[_0x0830('0x4f')](_0x6e0192[_0x0830('0x4c')],{'$or':_[_0x0830('0x3d')](_0x372c35,function(_0x5d9951){if(_0x5d9951[_0x0830('0x41')]!==_0x0830('0x50')){var _0x3bdfff={};_0x3bdfff[_0x5d9951['name']]={'$like':'%'+_0x1f4f35[_0x0830('0x45')][_0x0830('0x4e')]+'%'};return _0x3bdfff;}})});}_0x6e0192=_[_0x0830('0x4f')]({},_0x6e0192,_0x1f4f35[_0x0830('0x51')]);var _0x4f4df4={'where':_0x6e0192['where']};return db[_0x0830('0x3e')][_0x0830('0x52')](_0x4f4df4)[_0x0830('0x33')](function(_0x40fb1a){_0x139fed[_0x0830('0x52')]=_0x40fb1a;if(_0x1f4f35[_0x0830('0x45')][_0x0830('0x53')]){_0x6e0192[_0x0830('0x54')]=[{'all':!![]}];}return db[_0x0830('0x3e')][_0x0830('0x55')](_0x6e0192);})[_0x0830('0x33')](function(_0x141a49){_0x139fed['rows']=_0x141a49;return _0x139fed;})[_0x0830('0x33')](respondWithFilteredResult(_0x3cd46a,_0x6e0192))[_0x0830('0x56')](handleError(_0x3cd46a,null));};exports['show']=function(_0x2258db,_0x39b733){var _0x4b40d4={'raw':![],'where':{'id':_0x2258db[_0x0830('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0830('0x3c')}]},_0x4864d5={};_0x4864d5[_0x0830('0x42')]=_[_0x0830('0x58')](db[_0x0830('0x3e')][_0x0830('0x3f')]);_0x4864d5[_0x0830('0x45')]=_[_0x0830('0x58')](_0x2258db[_0x0830('0x45')]);_0x4864d5['filters']=_[_0x0830('0x44')](_0x4864d5[_0x0830('0x42')],_0x4864d5[_0x0830('0x45')]);_0x4b40d4['attributes']=_[_0x0830('0x44')](_0x4864d5['model'],qs[_0x0830('0x47')](_0x2258db[_0x0830('0x45')][_0x0830('0x47')]));_0x4b40d4[_0x0830('0x46')]=_0x4b40d4['attributes'][_0x0830('0x48')]?_0x4b40d4[_0x0830('0x46')]:_0x4864d5[_0x0830('0x42')];if(_0x2258db[_0x0830('0x45')]['includeAll']){_0x4b40d4[_0x0830('0x54')]=[{'all':!![]}];}_0x4b40d4=_[_0x0830('0x4f')]({},_0x4b40d4,_0x2258db[_0x0830('0x51')]);return db['WhatsappAccount'][_0x0830('0x59')](_0x4b40d4)[_0x0830('0x33')](handleEntityNotFound(_0x39b733,null))[_0x0830('0x33')](respondWithResult(_0x39b733,null))['catch'](handleError(_0x39b733,null));};exports[_0x0830('0x5a')]=function(_0x3984d1,_0x48fad0){return db[_0x0830('0x3e')][_0x0830('0x5a')](_0x3984d1['body'],{})[_0x0830('0x33')](function(_0x51e3bc){var _0x8b0091=_0x3984d1['user'][_0x0830('0x35')]({'plain':!![]});if(!_0x8b0091)throw new Error(_0x0830('0x5b'));if(_0x8b0091[_0x0830('0x5c')]===_0x0830('0x5d')){var _0x120b94=_0x51e3bc['get']({'plain':!![]});var _0x1cea11='WhatsappAccounts';return db[_0x0830('0x5e')][_0x0830('0x59')]({'where':{'name':_0x1cea11,'userProfileId':_0x8b0091[_0x0830('0x5f')]},'raw':!![]})[_0x0830('0x33')](function(_0x2d7bad){if(_0x2d7bad&&_0x2d7bad['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x120b94[_0x0830('0x39')],'resourceId':_0x120b94['id'],'type':_0x2d7bad[_0x0830('0x39')],'sectionId':_0x2d7bad['id']},{})[_0x0830('0x33')](function(){return _0x51e3bc;});}else{return _0x51e3bc;}})[_0x0830('0x56')](function(_0x2bd1d9){logger[_0x0830('0x25')](_0x0830('0x60'),_0x2bd1d9);throw _0x2bd1d9;});}return _0x51e3bc;})['then'](respondWithResult(_0x48fad0,0xc9))[_0x0830('0x56')](handleError(_0x48fad0,null));};exports['update']=function(_0x26aa57,_0xfda54c){if(_0x26aa57['body']['id']){delete _0x26aa57[_0x0830('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x26aa57[_0x0830('0x57')]['id']},'include':[{'model':db[_0x0830('0x62')],'as':'mandatoryDispositionPause'}]})[_0x0830('0x33')](handleEntityNotFound(_0xfda54c,null))[_0x0830('0x33')](saveUpdates(_0x26aa57['body'],null))[_0x0830('0x33')](respondWithResult(_0xfda54c,null))[_0x0830('0x56')](handleError(_0xfda54c,null));};exports['destroy']=function(_0xda99b8,_0x51ea96){return db[_0x0830('0x3e')][_0x0830('0x59')]({'where':{'id':_0xda99b8[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x51ea96,null))[_0x0830('0x33')](removeEntity(_0x51ea96,null))['catch'](handleError(_0x51ea96,null));};exports[_0x0830('0x63')]=function(_0xf0ffe5,_0x4e0f30){return db[_0x0830('0x3e')][_0x0830('0x63')]()[_0x0830('0x33')](respondWithResult(_0x4e0f30,null))[_0x0830('0x56')](handleError(_0x4e0f30,null));};exports[_0x0830('0x64')]=function(_0x484d7e,_0x17d4ac,_0x437f20){if(_0x484d7e['body']['id']){delete _0x484d7e[_0x0830('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x484d7e[_0x0830('0x57')]['id']}})['then'](handleEntityNotFound(_0x17d4ac,null))[_0x0830('0x33')](function(_0x4209e2){if(_0x4209e2){_0x484d7e['body'][_0x0830('0x65')]=_0x4209e2['id'];return db[_0x0830('0x66')][_0x0830('0x5a')](_0x484d7e['body']);}})[_0x0830('0x33')](respondWithResult(_0x17d4ac,null))[_0x0830('0x56')](handleError(_0x17d4ac,null));};exports[_0x0830('0x67')]=function(_0x18cee3,_0x3412db,_0x26a75e){var _0x7d0f42={'raw':![],'where':{}};var _0x5d8081={};var _0x2977c7={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x0830('0x68')]({'where':{'id':_0x18cee3[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x3412db,null))[_0x0830('0x33')](function(_0x43afe8){if(_0x43afe8){_0x5d8081[_0x0830('0x42')]=_['keys'](db[_0x0830('0x66')][_0x0830('0x3f')]);_0x5d8081['query']=_[_0x0830('0x58')](_0x18cee3['query']);_0x5d8081[_0x0830('0x43')]=_[_0x0830('0x44')](_0x5d8081[_0x0830('0x42')],_0x5d8081[_0x0830('0x45')]);_0x7d0f42[_0x0830('0x46')]=_[_0x0830('0x44')](_0x5d8081['model'],qs[_0x0830('0x47')](_0x18cee3[_0x0830('0x45')][_0x0830('0x47')]));_0x7d0f42[_0x0830('0x46')]=_0x7d0f42[_0x0830('0x46')][_0x0830('0x48')]?_0x7d0f42[_0x0830('0x46')]:_0x5d8081[_0x0830('0x42')];if(!_0x18cee3[_0x0830('0x45')][_0x0830('0x49')](_0x0830('0x4a'))){_0x7d0f42[_0x0830('0x2c')]=qs['limit'](_0x18cee3[_0x0830('0x45')][_0x0830('0x2c')]);_0x7d0f42[_0x0830('0x2e')]=qs[_0x0830('0x2e')](_0x18cee3[_0x0830('0x45')][_0x0830('0x2e')]);}_0x7d0f42[_0x0830('0x69')]=qs['sort'](_0x18cee3[_0x0830('0x45')]['sort']);_0x7d0f42[_0x0830('0x4c')]=qs[_0x0830('0x43')](_['pick'](_0x18cee3[_0x0830('0x45')],_0x5d8081['filters']));_0x7d0f42[_0x0830('0x4c')][_0x0830('0x65')]=_0x43afe8['id'];if(_0x18cee3[_0x0830('0x45')][_0x0830('0x4e')]){_0x7d0f42[_0x0830('0x4c')]=_['merge'](_0x7d0f42[_0x0830('0x4c')],{'$or':_[_0x0830('0x3d')](_0x7d0f42[_0x0830('0x46')],function(_0x531b1d){var _0x1173c7={};_0x1173c7[_0x531b1d]={'$like':'%'+_0x18cee3['query']['filter']+'%'};return _0x1173c7;})});}_0x7d0f42=_[_0x0830('0x4f')]({},_0x7d0f42,_0x18cee3[_0x0830('0x51')]);return db[_0x0830('0x66')][_0x0830('0x52')]({'where':_0x7d0f42['where']})[_0x0830('0x33')](function(_0x1fdf83){_0x2977c7[_0x0830('0x52')]=_0x1fdf83;if(_0x18cee3['query'][_0x0830('0x53')]){_0x7d0f42[_0x0830('0x54')]=[{'all':!![]}];}return db[_0x0830('0x66')][_0x0830('0x55')](_0x7d0f42);})[_0x0830('0x33')](function(_0x516688){_0x2977c7[_0x0830('0x6a')]=_0x516688;return _0x2977c7;});}})[_0x0830('0x33')](respondWithFilteredResult(_0x3412db,_0x7d0f42))[_0x0830('0x56')](handleError(_0x3412db,null));};exports[_0x0830('0x6b')]=function(_0x32d8b0,_0x32b1a0,_0x347111){return db[_0x0830('0x3e')]['find']({'where':{'id':_0x32d8b0[_0x0830('0x57')]['id']}})['then'](handleEntityNotFound(_0x32b1a0,null))['then'](function(_0x2871bb){if(_0x2871bb){return _0x2871bb[_0x0830('0x6b')](_0x32d8b0[_0x0830('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x32b1a0,null))['catch'](handleError(_0x32b1a0,null));};exports[_0x0830('0x6c')]=function(_0x4ae0ab,_0x262226,_0x2dd71f){if(_0x4ae0ab['body']['id']){delete _0x4ae0ab[_0x0830('0x61')]['id'];}return db['WhatsappAccount'][_0x0830('0x59')]({'where':{'id':_0x4ae0ab[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x262226,null))[_0x0830('0x33')](function(_0x23d593){if(_0x23d593){_0x4ae0ab[_0x0830('0x61')][_0x0830('0x65')]=_0x23d593['id'];return db[_0x0830('0x6d')][_0x0830('0x5a')](_0x4ae0ab['body']);}})[_0x0830('0x33')](respondWithResult(_0x262226,null))[_0x0830('0x56')](handleError(_0x262226,null));};exports[_0x0830('0x6e')]=function(_0xfc56bb,_0x508f68,_0x562a5c){var _0xdc0564={'raw':![],'where':{}};var _0x32e66e={};var _0x436d60={'count':0x0,'rows':[]};return db[_0x0830('0x3e')][_0x0830('0x68')]({'where':{'id':_0xfc56bb[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x508f68,null))[_0x0830('0x33')](function(_0x56bcfb){if(_0x56bcfb){_0x32e66e[_0x0830('0x42')]=_['keys'](db['CannedAnswer'][_0x0830('0x3f')]);_0x32e66e[_0x0830('0x45')]=_[_0x0830('0x58')](_0xfc56bb[_0x0830('0x45')]);_0x32e66e[_0x0830('0x43')]=_[_0x0830('0x44')](_0x32e66e[_0x0830('0x42')],_0x32e66e[_0x0830('0x45')]);_0xdc0564['attributes']=_[_0x0830('0x44')](_0x32e66e[_0x0830('0x42')],qs[_0x0830('0x47')](_0xfc56bb['query'][_0x0830('0x47')]));_0xdc0564[_0x0830('0x46')]=_0xdc0564[_0x0830('0x46')][_0x0830('0x48')]?_0xdc0564['attributes']:_0x32e66e['model'];if(!_0xfc56bb[_0x0830('0x45')][_0x0830('0x49')](_0x0830('0x4a'))){_0xdc0564[_0x0830('0x2c')]=qs[_0x0830('0x2c')](_0xfc56bb[_0x0830('0x45')][_0x0830('0x2c')]);_0xdc0564[_0x0830('0x2e')]=qs[_0x0830('0x2e')](_0xfc56bb[_0x0830('0x45')][_0x0830('0x2e')]);}_0xdc0564[_0x0830('0x69')]=qs[_0x0830('0x4b')](_0xfc56bb[_0x0830('0x45')][_0x0830('0x4b')]);_0xdc0564['where']=qs[_0x0830('0x43')](_[_0x0830('0x4d')](_0xfc56bb[_0x0830('0x45')],_0x32e66e['filters']));_0xdc0564[_0x0830('0x4c')][_0x0830('0x65')]=_0x56bcfb['id'];if(_0xfc56bb[_0x0830('0x45')][_0x0830('0x4e')]){_0xdc0564[_0x0830('0x4c')]=_[_0x0830('0x4f')](_0xdc0564['where'],{'$or':_[_0x0830('0x3d')](_0xdc0564['attributes'],function(_0x385b5b){var _0x150012={};_0x150012[_0x385b5b]={'$like':'%'+_0xfc56bb[_0x0830('0x45')][_0x0830('0x4e')]+'%'};return _0x150012;})});}_0xdc0564=_[_0x0830('0x4f')]({},_0xdc0564,_0xfc56bb[_0x0830('0x51')]);return db['CannedAnswer']['count']({'where':_0xdc0564[_0x0830('0x4c')]})['then'](function(_0x15b0e2){_0x436d60[_0x0830('0x52')]=_0x15b0e2;if(_0xfc56bb[_0x0830('0x45')][_0x0830('0x53')]){_0xdc0564[_0x0830('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0830('0x55')](_0xdc0564);})[_0x0830('0x33')](function(_0x246ba9){_0x436d60[_0x0830('0x6a')]=_0x246ba9;return _0x436d60;});}})[_0x0830('0x33')](respondWithFilteredResult(_0x508f68,_0xdc0564))[_0x0830('0x56')](handleError(_0x508f68,null));};exports[_0x0830('0x6f')]=function(_0x2ebf6e,_0x3c9380,_0x3d0851){return db['WhatsappAccount'][_0x0830('0x59')]({'where':{'id':_0x2ebf6e[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x3c9380,null))[_0x0830('0x33')](function(_0x6ca111){if(_0x6ca111){return _0x6ca111[_0x0830('0x6f')](_0x2ebf6e[_0x0830('0x45')][_0x0830('0x70')]);}})[_0x0830('0x33')](respondWithStatusCode(_0x3c9380,null))[_0x0830('0x56')](handleError(_0x3c9380,null));};exports[_0x0830('0x71')]=function(_0x38c8ff,_0x3345bf,_0x3b4d9e){return db[_0x0830('0x3e')][_0x0830('0x59')]({'where':{'id':_0x38c8ff[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x3345bf,null))['then'](function(_0xb1775f){if(_0xb1775f){return _0xb1775f[_0x0830('0x71')](_0x38c8ff['body'][_0x0830('0x70')],_[_0x0830('0x72')](_0x38c8ff[_0x0830('0x61')],[_0x0830('0x70'),'id'])||{})['spread'](function(_0x195adc){for(var _0x23e9ea=0x0;_0x23e9ea<_0x38c8ff[_0x0830('0x61')][_0x0830('0x70')][_0x0830('0x48')];_0x23e9ea+=0x1){socket[_0x0830('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0x38c8ff[_0x0830('0x61')][_0x0830('0x70')][_0x23e9ea]),'WhatsappAccountId':Number(_0x38c8ff[_0x0830('0x57')]['id'])});}return _0x195adc;});}})[_0x0830('0x33')](respondWithResult(_0x3345bf,null))[_0x0830('0x56')](handleError(_0x3345bf,null));};exports[_0x0830('0x74')]=function(_0x4cfd26,_0x13fd2b,_0x4371ee){return db[_0x0830('0x3e')]['find']({'where':{'id':_0x4cfd26[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x13fd2b,null))[_0x0830('0x33')](function(_0x4a8d66){if(_0x4a8d66){return _0x4a8d66[_0x0830('0x74')](_0x4cfd26[_0x0830('0x45')][_0x0830('0x70')])[_0x0830('0x33')](function(){if(_[_0x0830('0x75')](_0x4cfd26[_0x0830('0x45')][_0x0830('0x70')])){for(var _0x276cea=0x0;_0x276cea<_0x4cfd26[_0x0830('0x45')][_0x0830('0x70')][_0x0830('0x48')];_0x276cea+=0x1){socket['emit'](_0x0830('0x76'),{'UserId':Number(_0x4cfd26['query'][_0x0830('0x70')][_0x276cea]),'WhatsappAccountId':Number(_0x4cfd26[_0x0830('0x57')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x4cfd26[_0x0830('0x45')][_0x0830('0x70')]),'WhatsappAccountId':Number(_0x4cfd26[_0x0830('0x57')]['id'])});}});}})[_0x0830('0x33')](respondWithStatusCode(_0x13fd2b,null))[_0x0830('0x56')](handleError(_0x13fd2b,null));};exports[_0x0830('0x77')]=function(_0x195906,_0x53a817,_0x136635){var _0x37ed91={};var _0x269250={};var _0x2d779d;var _0x137beb;return db[_0x0830('0x3e')][_0x0830('0x68')]({'where':{'id':_0x195906[_0x0830('0x57')]['id']}})[_0x0830('0x33')](handleEntityNotFound(_0x53a817,null))['then'](function(_0x4aa0ca){if(_0x4aa0ca){_0x2d779d=_0x4aa0ca;_0x269250[_0x0830('0x42')]=_[_0x0830('0x58')](db[_0x0830('0x78')][_0x0830('0x3f')]);_0x269250[_0x0830('0x45')]=_[_0x0830('0x58')](_0x195906['query']);_0x269250[_0x0830('0x43')]=_[_0x0830('0x44')](_0x269250[_0x0830('0x42')],_0x269250[_0x0830('0x45')]);_0x37ed91[_0x0830('0x46')]=_[_0x0830('0x44')](_0x269250[_0x0830('0x42')],qs[_0x0830('0x47')](_0x195906[_0x0830('0x45')][_0x0830('0x47')]));_0x37ed91[_0x0830('0x46')]=_0x37ed91[_0x0830('0x46')]['length']?_0x37ed91['attributes']:_0x269250['model'];_0x37ed91[_0x0830('0x69')]=qs[_0x0830('0x4b')](_0x195906[_0x0830('0x45')][_0x0830('0x4b')]);_0x37ed91['where']=qs[_0x0830('0x43')](_[_0x0830('0x4d')](_0x195906[_0x0830('0x45')],_0x269250[_0x0830('0x43')]));if(_0x195906['query'][_0x0830('0x4e')]){_0x37ed91[_0x0830('0x4c')]=_['merge'](_0x37ed91[_0x0830('0x4c')],{'$or':_[_0x0830('0x3d')](_0x37ed91[_0x0830('0x46')],function(_0x40e70c){var _0x3e243e={};_0x3e243e[_0x40e70c]={'$like':'%'+_0x195906[_0x0830('0x45')][_0x0830('0x4e')]+'%'};return _0x3e243e;})});}_0x37ed91=_[_0x0830('0x4f')]({},_0x37ed91,_0x195906[_0x0830('0x51')]);return _0x2d779d[_0x0830('0x77')](_0x37ed91);}})[_0x0830('0x33')](function(_0x2cd58a){if(_0x2cd58a){_0x137beb=_0x2cd58a['length'];if(!_0x195906['query']['hasOwnProperty']('nolimit')){_0x37ed91[_0x0830('0x2c')]=qs['limit'](_0x195906[_0x0830('0x45')]['limit']);_0x37ed91[_0x0830('0x2e')]=qs[_0x0830('0x2e')](_0x195906[_0x0830('0x45')][_0x0830('0x2e')]);}return _0x2d779d[_0x0830('0x77')](_0x37ed91);}})[_0x0830('0x33')](function(_0x2c90dd){if(_0x2c90dd){return _0x2c90dd?{'count':_0x137beb,'rows':_0x2c90dd}:null;}})[_0x0830('0x33')](respondWithResult(_0x53a817,null))[_0x0830('0x56')](handleError(_0x53a817,null));};exports[_0x0830('0x79')]=function(_0x5c72ab,_0x35f11a){var _0x36dc54=_0x5c72ab[_0x0830('0x57')]['id'];var _0x2d5793=_0x5c72ab[_0x0830('0x61')];var _0x113a1a=0xc8;var _0x1082ac=null;return db[_0x0830('0x7a')][_0x0830('0x7b')]({'isolationLevel':db[_0x0830('0x7a')][_0x0830('0x7c')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x510c00){return db[_0x0830('0x3e')][_0x0830('0x68')]({'where':{'id':_0x36dc54},'transaction':_0x510c00})['then'](function(_0x4dc8a1){if(_0x4dc8a1){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x36dc54},'transaction':_0x510c00})[_0x0830('0x33')](function(){var _0x4a4925=_[_0x0830('0x3d')](_0x2d5793,function(_0x460585){_0x460585[_0x0830('0x65')]=_0x36dc54;return _0x460585;});return db[_0x0830('0x7d')]['bulkCreate'](_0x4a4925,{'transaction':_0x510c00});});}else{_0x113a1a=0x194;_0x1082ac=[];}});})[_0x0830('0x33')](function(){if(_0x113a1a!==0x194){return db['WhatsappApplication'][_0x0830('0x7e')]({'where':{'WhatsappAccountId':_0x36dc54},'order':_0x0830('0x7f')})[_0x0830('0x33')](function(_0xeb54b7){_0x1082ac=_0xeb54b7;});}})['catch'](function(_0x2f3887){_0x113a1a=0x1f4;logger['error'](_0x2f3887['stack']);if(_0x2f3887[_0x0830('0x39')]){delete _0x2f3887[_0x0830('0x39')];}_0x1082ac=_0x2f3887;})['finally'](function(){if(_0x1082ac===null){_0x35f11a['sendStatus'](_0x113a1a);}else{if(_0x113a1a===0x1f4){_0x35f11a['status'](_0x113a1a)['send'](_0x1082ac);}else{_0x35f11a['status'](_0x113a1a)[_0x0830('0x2b')](_0x1082ac);}}});};exports['getApplications']=function(_0x3e34de,_0x2cb164,_0x3962ca){var _0x403ec9={};var _0xba4b0c={};var _0x6649e9;var _0x117867;return db['WhatsappAccount'][_0x0830('0x68')]({'where':{'id':_0x3e34de['params']['id']}})['then'](handleEntityNotFound(_0x2cb164,null))[_0x0830('0x33')](function(_0x5b7b7d){if(_0x5b7b7d){_0x6649e9=_0x5b7b7d;_0xba4b0c[_0x0830('0x42')]=_[_0x0830('0x58')](db[_0x0830('0x7d')][_0x0830('0x3f')]);_0xba4b0c[_0x0830('0x45')]=_['keys'](_0x3e34de[_0x0830('0x45')]);_0xba4b0c['filters']=_[_0x0830('0x44')](_0xba4b0c[_0x0830('0x42')],_0xba4b0c[_0x0830('0x45')]);_0x403ec9[_0x0830('0x46')]=_[_0x0830('0x44')](_0xba4b0c['model'],qs[_0x0830('0x47')](_0x3e34de[_0x0830('0x45')][_0x0830('0x47')]));_0x403ec9[_0x0830('0x46')]=_0x403ec9[_0x0830('0x46')][_0x0830('0x48')]?_0x403ec9['attributes']:_0xba4b0c[_0x0830('0x42')];_0x403ec9[_0x0830('0x69')]=qs['sort'](_0x3e34de[_0x0830('0x45')]['sort']);_0x403ec9[_0x0830('0x4c')]=qs[_0x0830('0x43')](_['pick'](_0x3e34de['query'],_0xba4b0c['filters']));if(_0x3e34de[_0x0830('0x45')][_0x0830('0x4e')]){_0x403ec9[_0x0830('0x4c')]=_['merge'](_0x403ec9[_0x0830('0x4c')],{'$or':_[_0x0830('0x3d')](_0x403ec9[_0x0830('0x46')],function(_0x4cfc04){var _0x9daab1={};_0x9daab1[_0x4cfc04]={'$like':'%'+_0x3e34de[_0x0830('0x45')][_0x0830('0x4e')]+'%'};return _0x9daab1;})});}_0x403ec9=_[_0x0830('0x4f')]({},_0x403ec9,_0x3e34de[_0x0830('0x51')]);return _0x6649e9[_0x0830('0x80')](_0x403ec9);}})[_0x0830('0x33')](function(_0x12f815){if(_0x12f815){_0x117867=_0x12f815[_0x0830('0x48')];if(!_0x3e34de['query'][_0x0830('0x49')](_0x0830('0x4a'))){_0x403ec9[_0x0830('0x2c')]=qs['limit'](_0x3e34de['query']['limit']);_0x403ec9['offset']=qs[_0x0830('0x2e')](_0x3e34de['query'][_0x0830('0x2e')]);}return _0x6649e9[_0x0830('0x80')](_0x403ec9);}})[_0x0830('0x33')](function(_0x482c69){if(_0x482c69){return _0x482c69?{'count':_0x117867,'rows':_0x482c69}:null;}})[_0x0830('0x33')](respondWithResult(_0x2cb164,null))[_0x0830('0x56')](handleError(_0x2cb164,null));};exports[_0x0830('0x81')]=function(_0x150e42,_0x20043c,_0x557460){var _0x57b16a={'channel':_0x0830('0x82')};var _0x9133c6=[];var _0x50ebc4=[];var _0x2fd9ff={};return db[_0x0830('0x3e')][_0x0830('0x59')]({'where':{'id':_0x150e42[_0x0830('0x57')]['id']},'include':[{'model':db[_0x0830('0x7d')],'as':_0x0830('0x83')}]})[_0x0830('0x33')](handleEntityNotFound(_0x20043c,null))['then'](function(_0x5a4f8c){_0x57b16a[_0x0830('0x84')]=_0x5a4f8c;if(_0x57b16a[_0x0830('0x84')]&&_0x57b16a['account'][_0x0830('0x41')]===_0x0830('0x85')&&_0x150e42[_0x0830('0x61')]['statuses']){if(_0x150e42[_0x0830('0x61')][_0x0830('0x86')]['length']===0x0)return;if(_0x150e42[_0x0830('0x61')]['statuses'][0x0][_0x0830('0x87')]!=='read')return;return db[_0x0830('0x88')][_0x0830('0x89')]({'read':!![],'readAt':_0x150e42[_0x0830('0x61')]['statuses'][0x0][_0x0830('0x8a')]},{'where':{'messageId':_0x150e42[_0x0830('0x61')][_0x0830('0x86')][0x0][_0x0830('0x8b')]},'individualHooks':!![]})[_0x0830('0x33')](function(_0x482cb3){return _0x20043c[_0x0830('0x29')](0xc8)[_0x0830('0x2b')](_0x482cb3);});}_0x57b16a[_0x0830('0x8c')]=_[_0x0830('0x8d')](_0x5a4f8c[_0x0830('0x83')],[_0x0830('0x7f')],[_0x0830('0x8e')]);if(_0x57b16a[_0x0830('0x84')][_0x0830('0x83')]){delete _0x57b16a['account']['Applications'];}return db['CmContact'][_0x0830('0x63')]()['then'](function(_0x475daf){if(!_0x475daf){throw new db[(_0x0830('0x8f'))][(_0x0830('0x90'))](_0x0830('0x91'));}_0x9133c6=_[_0x0830('0x92')](_[_0x0830('0x58')](_0x475daf),['createdAt',_0x0830('0x93')]);_0x50ebc4=_['difference'](_['keys'](_0x475daf),[_0x0830('0x94'),'updatedAt',_0x0830('0x95'),_0x0830('0x96')]);_0x57b16a[_0x0830('0x61')]={'mapKey':_0x0830('0x97')};if(_0x57b16a[_0x0830('0x84')]&&_0x57b16a[_0x0830('0x84')][_0x0830('0x41')]==='twilio'){_0x57b16a[_0x0830('0x61')][_0x0830('0x98')]=_0x150e42[_0x0830('0x61')]['From'][_0x0830('0x99')](_0x0830('0x9a'),'');_0x57b16a[_0x0830('0x61')][_0x0830('0x61')]=_0x150e42[_0x0830('0x61')][_0x0830('0x9b')];_0x57b16a[_0x0830('0x61')][_0x0830('0x9c')]=_0x150e42[_0x0830('0x61')][_0x0830('0x9d')];}if(_0x57b16a[_0x0830('0x84')]&&_0x57b16a[_0x0830('0x84')][_0x0830('0x41')]==='sinch'){_0x57b16a[_0x0830('0x61')][_0x0830('0x98')]=_0x150e42[_0x0830('0x61')][_0x0830('0x9e')][0x0][_0x0830('0x98')];_0x57b16a[_0x0830('0x61')][_0x0830('0x61')]=_0x150e42[_0x0830('0x61')][_0x0830('0x9e')][0x0]['message'][_0x0830('0x61')];_0x57b16a['body'][_0x0830('0x9c')]=_0x150e42[_0x0830('0x61')][_0x0830('0x9e')][0x0][_0x0830('0x8b')];}if(_0x57b16a[_0x0830('0x61')]['id']){delete _0x57b16a['body']['id'];}if(_[_0x0830('0x9f')](_0x57b16a[_0x0830('0x61')][_0x0830('0x98')])){throw new db[(_0x0830('0x8f'))][(_0x0830('0x90'))](_0x0830('0xa0'));}if(_[_0x0830('0x9f')](_0x57b16a[_0x0830('0x61')][_0x0830('0x61')])||_0x57b16a['body'][_0x0830('0x61')]===''){throw new db['Sequelize']['ValidationError'](_0x0830('0xa1'));}if(_[_0x0830('0x9f')](_0x57b16a[_0x0830('0x61')][_0x0830('0xa2')])){throw new db['Sequelize']['ValidationError'](_0x0830('0xa3')+_0x50ebc4);}if(!_[_0x0830('0xa4')](_0x50ebc4,_0x57b16a[_0x0830('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x0830('0x90'))](_0x0830('0xa5')+_0x50ebc4);}_0x2fd9ff[_0x57b16a[_0x0830('0x61')][_0x0830('0xa2')]]=_0x57b16a[_0x0830('0x61')]['from'];return db[_0x0830('0xa6')]['find']({'where':{'id':_0x57b16a[_0x0830('0x84')][_0x0830('0x96')]},'include':[{'model':db[_0x0830('0xa7')],'as':_0x0830('0xa8'),'where':_0x2fd9ff,'limit':0x1,'order':[[_0x0830('0x93'),_0x0830('0xa9')]]}]});})[_0x0830('0x33')](handleEntityNotFound(_0x20043c,null))[_0x0830('0x33')](function(_0x5d102f){if(_0x5d102f){_0x57b16a[_0x0830('0xaa')]=_[_0x0830('0x72')](_0x5d102f,['Contacts']);if(_0x5d102f[_0x0830('0xa8')]['length']){return _0x5d102f[_0x0830('0xa8')][0x0];}var _0x494751=_[_0x0830('0x17')](_0x57b16a[_0x0830('0x61')],{'firstName':_0x57b16a['body'][_0x0830('0x98')],'ListId':_0x5d102f['id']});_0x494751[_0x57b16a[_0x0830('0x61')][_0x0830('0xa2')]]=_0x57b16a[_0x0830('0x61')][_0x0830('0x98')];return db['CmContact']['create'](_0x494751,{'fields':_0x9133c6,'raw':!![]});}})['then'](handleEntityNotFound(_0x20043c,null))[_0x0830('0x33')](function(_0x4ba0e0){if(_0x4ba0e0){_0x57b16a['contact']=_0x4ba0e0;var _0x2f9012={'ContactId':_0x4ba0e0['id'],'phone':_0x57b16a['body'][_0x0830('0x98')],'WhatsappAccountId':_0x150e42[_0x0830('0x57')]['id']};var _0x120066={'ContactId':_0x4ba0e0['id'],'WhatsappAccountId':_0x150e42[_0x0830('0x57')]['id'],'closed':![]};return db[_0x0830('0xab')][_0x0830('0x59')]({'where':_0x120066})[_0x0830('0x33')](function(_0xc2da5c){if(_0xc2da5c){return[_0xc2da5c,![]];}return db[_0x0830('0xab')][_0x0830('0x5a')](_0x2f9012)[_0x0830('0x33')](function(_0x3b8946){return[_0x3b8946,!![]];});});}})[_0x0830('0xac')](function(_0x2bea70,_0x2130a3){_0x57b16a['interaction']=_0x2bea70[_0x0830('0x35')]({'plain':!![]});_0x57b16a[_0x0830('0xad')]['created']=![];if(_0x2130a3){if(_0x57b16a[_0x0830('0x84')][_0x0830('0xae')]){_0x57b16a['applications'][_0x0830('0xaf')]({'id':0x0,'priority':_0x57b16a[_0x0830('0x8c')]['length']+0x1,'app':_0x0830('0xb0'),'appdata':_0x0830('0xb1'),'interval':'*,*,*,*'});}_0x57b16a['interaction'][_0x0830('0xb2')]=!![];}return db['WhatsappMessage'][_0x0830('0x5a')]({'phone':_0x57b16a[_0x0830('0x61')][_0x0830('0x98')],'messageId':_0x57b16a[_0x0830('0x61')]['messageId'],'body':_0x57b16a[_0x0830('0x61')][_0x0830('0x61')],'WhatsappAccountId':_0x150e42[_0x0830('0x57')]['id'],'WhatsappInteractionId':_0x2bea70['id'],'direction':'in','ContactId':_0x2bea70['ContactId'],'AttachmentId':_0x57b16a[_0x0830('0x61')][_0x0830('0xb3')]});})[_0x0830('0x33')](function(_0x461282){_0x57b16a[_0x0830('0x26')]=_0x461282;if(_0x57b16a[_0x0830('0xad')][_0x0830('0xb4')]){return db[_0x0830('0x78')][_0x0830('0x59')]({'attributes':['id',_0x0830('0x39')],'where':{'id':_0x57b16a[_0x0830('0xad')][_0x0830('0xb4')]}})[_0x0830('0x33')](function(_0x472485){if(_0x472485){_0x57b16a[_0x0830('0x8c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0830('0xb5'),'appdata':_0x472485[_0x0830('0x39')]+','+(_0x57b16a[_0x0830('0x84')][_0x0830('0xb6')]||0xa),'interval':_0x0830('0xb7')});}return respondWithRpcPromise(_0x0830('0xb8'),_0x0830('0xb9'),_0x57b16a);});}return respondWithRpcPromise('Start','startRouting',_0x57b16a);})['then'](function(_0x4b5a51){if(_0x4b5a51){var _0x1ae5a6=0xc8;var _0x34f63d='receiveMessage';logger[_0x0830('0x1f')](_0x0830('0xba'),_0x34f63d,_0x1ae5a6,_0x0830('0xbb'));logger['debug'](_0x0830('0xbc'),_0x34f63d,_0x1ae5a6,_0x0830('0xbb'),JSON[_0x0830('0x23')](_0x4b5a51));if(_0x57b16a['account'][_0x0830('0x41')]===_0x0830('0xbd')){return _0x20043c[_0x0830('0x29')](_0x1ae5a6)[_0x0830('0x2f')](_0x0830('0xbe'),_0x0830('0xbf'))['send']('\x0a');}else{return _0x20043c[_0x0830('0x29')](_0x1ae5a6)['json'](_0x4b5a51);}}});})[_0x0830('0x56')](handleError(_0x20043c,null));};exports['send']=function(_0x4718f5,_0x44828d,_0x5853c6){var _0x5ce438,_0x961a53,_0x1c5374;if(_[_0x0830('0x9f')](_0x4718f5['body'][_0x0830('0x61')])||_0x4718f5[_0x0830('0x61')][_0x0830('0x61')]===''){throw new db['Sequelize'][(_0x0830('0x90'))](_0x0830('0xa1'));}if(_[_0x0830('0x9f')](_0x4718f5['body']['to'])){throw new db[(_0x0830('0x8f'))]['ValidationError'](_0x0830('0xc0'));}_0x5ce438=_0x4718f5[_0x0830('0x61')]['to'];return db[_0x0830('0x3e')][_0x0830('0x59')]({'where':{'id':_0x4718f5['params']['id']},'include':[{'model':db[_0x0830('0xa6')],'as':_0x0830('0xc1'),'include':[{'model':db[_0x0830('0xa7')],'as':'Contacts','where':{'mobile':_0x5ce438},'limit':0x1,'order':[['updatedAt',_0x0830('0xa9')]]}]}]})['then'](handleEntityNotFound(_0x44828d,null))[_0x0830('0x33')](function(_0x3ee673){if(_0x3ee673&&_0x3ee673[_0x0830('0xc1')]){_0x961a53=_0x3ee673[_0x0830('0x35')]({'plain':!![]});if(_0x961a53[_0x0830('0xc1')]&&_0x961a53[_0x0830('0xc1')][_0x0830('0xa8')]['length']){return _0x961a53['List'][_0x0830('0xa8')][0x0];}return db[_0x0830('0xa7')][_0x0830('0x5a')](_[_0x0830('0x17')](_0x4718f5[_0x0830('0x61')],{'firstName':_0x5ce438,'mobile':_0x5ce438,'phone':_0x5ce438,'ListId':_0x961a53['ListId']}));}})[_0x0830('0x33')](handleEntityNotFound(_0x44828d,null))[_0x0830('0x33')](function(_0x52c689){if(_0x52c689){_0x1c5374=_0x52c689;return db[_0x0830('0xab')]['find']({'where':{'ContactId':_0x1c5374['id'],'closed':![],'WhatsappAccountId':_0x961a53['id']}})[_0x0830('0x33')](function(_0x43ec19){if(_0x43ec19){return[_0x43ec19,![]];}return db[_0x0830('0xab')][_0x0830('0x5a')]({'UserId':_0x4718f5[_0x0830('0x5d')]['id'],'ContactId':_0x1c5374['id'],'WhatsappAccountId':_0x961a53['id'],'phone':_0x5ce438,'firstMsgDirection':_0x0830('0xc2'),'Messages':[_[_0x0830('0x4f')](_0x4718f5[_0x0830('0x61')],{'read':![],'body':_0x4718f5[_0x0830('0x61')][_0x0830('0x61')],'phone':_0x5ce438,'WhatsappAccountId':_0x961a53['id'],'UserId':_0x4718f5[_0x0830('0x5d')]['id'],'ContactId':_0x1c5374['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x0830('0xc3')}]})['then'](function(_0x191d83){return[_0x191d83,!![]];});});}})['spread'](function(_0x2a89e4,_0x51054b){if(_0x51054b){return _0x2a89e4;}return db[_0x0830('0x88')]['create'](_['merge'](_0x4718f5[_0x0830('0x61')],{'read':![],'body':_0x4718f5[_0x0830('0x61')][_0x0830('0x61')],'phone':_0x5ce438,'WhatsappAccountId':_0x961a53['id'],'WhatsappInteractionId':_0x2a89e4['id'],'UserId':_0x4718f5[_0x0830('0x5d')]['id'],'ContactId':_0x1c5374['id']}))[_0x0830('0x33')](function(_0x380f2a){_0x2a89e4[_0x0830('0xc4')][_0x0830('0xc3')]=[];_0x2a89e4[_0x0830('0xc4')][_0x0830('0xc3')][_0x0830('0xaf')](_0x380f2a[_0x0830('0xc4')]);return _0x2a89e4;});})[_0x0830('0x33')](respondWithResult(_0x44828d,null))[_0x0830('0x56')](handleError(_0x44828d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 52aee43..592ce05 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 _0x35e2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x4b55e8,_0x41ba7e){var _0x46e844=function(_0x2b1e4f){while(--_0x2b1e4f){_0x4b55e8['push'](_0x4b55e8['shift']());}};_0x46e844(++_0x41ba7e);}(_0x35e2,0x143));var _0x235e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x35e2[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0x235e('0x0'));var WhatsappAccount=require(_0x235e('0x1'))['db'][_0x235e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x235e('0x3')](0x0);var events={'afterCreate':_0x235e('0x4'),'afterUpdate':_0x235e('0x5'),'afterDestroy':_0x235e('0x6')};function emitEvent(_0x522458){return function(_0x18dc30,_0x4aa96b,_0x26f757){WhatsappAccountEvents[_0x235e('0x7')](_0x522458+':'+_0x18dc30['id'],_0x18dc30);WhatsappAccountEvents[_0x235e('0x7')](_0x522458,_0x18dc30);_0x26f757(null);};}for(var e in events){if(events[_0x235e('0x8')](e)){var event=events[e];WhatsappAccount[_0x235e('0x9')](e,emitEvent(event));}}module[_0x235e('0xa')]=WhatsappAccountEvents; \ No newline at end of file +var _0xa4ab=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update'];(function(_0x4fa361,_0x5bfce3){var _0x342f18=function(_0x99eaa9){while(--_0x99eaa9){_0x4fa361['push'](_0x4fa361['shift']());}};_0x342f18(++_0x5bfce3);}(_0xa4ab,0x9b));var _0xba4a=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0xa4ab[_0x52ea08];return _0x28d546;};'use strict';var EventEmitter=require(_0xba4a('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xba4a('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xba4a('0x2')](0x0);var events={'afterCreate':_0xba4a('0x3'),'afterUpdate':_0xba4a('0x4'),'afterDestroy':_0xba4a('0x5')};function emitEvent(_0x40f96e){return function(_0x400467,_0x18246c,_0x1215da){WhatsappAccountEvents[_0xba4a('0x6')](_0x40f96e+':'+_0x400467['id'],_0x400467);WhatsappAccountEvents[_0xba4a('0x6')](_0x40f96e,_0x400467);_0x1215da(null);};}for(var e in events){if(events[_0xba4a('0x7')](e)){var event=events[e];WhatsappAccount[_0xba4a('0x8')](e,emitEvent(event));}}module[_0xba4a('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 4b83e7d..4edfdd2 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 _0xe3f3=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x19d829,_0x4247a9){var _0x12b96d=function(_0x461ddb){while(--_0x461ddb){_0x19d829['push'](_0x19d829['shift']());}};_0x12b96d(++_0x4247a9);}(_0xe3f3,0x1a9));var _0x3e3f=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xe3f3[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var logger=require(_0x3e3f('0x2'))(_0x3e3f('0x3'));var moment=require(_0x3e3f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e3f('0x5'));var rimraf=require(_0x3e3f('0x6'));var config=require('../../config/environment');var attributes=require(_0x3e3f('0x7'));module[_0x3e3f('0x8')]=function(_0x4974e3,_0x53ef4c){return _0x4974e3[_0x3e3f('0x9')](_0x3e3f('0xa'),attributes,{'tableName':_0x3e3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4671=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e53ba,_0x2e737d){var _0x248757=function(_0x45cf89){while(--_0x45cf89){_0x5e53ba['push'](_0x5e53ba['shift']());}};_0x248757(++_0x2e737d);}(_0x4671,0xd8));var _0x1467=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4671[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1467('0x0'));var util=require(_0x1467('0x1'));var logger=require(_0x1467('0x2'))('api');var moment=require(_0x1467('0x3'));var BPromise=require(_0x1467('0x4'));var rp=require(_0x1467('0x5'));var fs=require('fs');var path=require(_0x1467('0x6'));var rimraf=require(_0x1467('0x7'));var config=require(_0x1467('0x8'));var attributes=require(_0x1467('0x9'));module[_0x1467('0xa')]=function(_0x1d6536,_0x31d589){return _0x1d6536[_0x1467('0xb')](_0x1467('0xc'),attributes,{'tableName':_0x1467('0xd'),'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 d49c527..beec9d8 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 _0xebd5=['socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','ShowWhatsappAccount','WhatsappAccount','options','where','include','model','attributes','map','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x543034,_0x525727){var _0x1b92be=function(_0x547bc6){while(--_0x547bc6){_0x543034['push'](_0x543034['shift']());}};_0x1b92be(++_0x525727);}(_0xebd5,0xf4));var _0x5ebd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xebd5[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5ebd('0x0'));var util=require(_0x5ebd('0x1'));var moment=require('moment');var BPromise=require(_0x5ebd('0x2'));var rs=require(_0x5ebd('0x3'));var fs=require('fs');var Redis=require(_0x5ebd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ebd('0x5'));var logger=require(_0x5ebd('0x6'))(_0x5ebd('0x7'));var config=require(_0x5ebd('0x8'));var jayson=require(_0x5ebd('0x9'));var client=jayson[_0x5ebd('0xa')][_0x5ebd('0xb')]({'port':0x232a});config[_0x5ebd('0xc')]=_[_0x5ebd('0xd')](config[_0x5ebd('0xc')],{'host':_0x5ebd('0xe'),'port':0x18eb});var socket=require(_0x5ebd('0xf'))(new Redis(config['redis']));require(_0x5ebd('0x10'))[_0x5ebd('0x11')](socket);function respondWithRpcPromise(_0xcc4be3,_0x256f00,_0x2779a8){return new BPromise(function(_0x36dc53,_0x46f5ec){return client[_0x5ebd('0x12')](_0xcc4be3,_0x2779a8)[_0x5ebd('0x13')](function(_0x450196){logger[_0x5ebd('0x14')](_0x5ebd('0x15'),_0x256f00,_0x5ebd('0x16'));logger[_0x5ebd('0x17')](_0x5ebd('0x18'),_0x256f00,_0x5ebd('0x16'),JSON['stringify'](_0x450196));if(_0x450196[_0x5ebd('0x19')]){if(_0x450196['error']['code']===0x1f4){logger[_0x5ebd('0x19')](_0x5ebd('0x15'),_0x256f00,_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);return _0x46f5ec(_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);}logger[_0x5ebd('0x19')](_0x5ebd('0x15'),_0x256f00,_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);return _0x36dc53(_0x450196[_0x5ebd('0x19')][_0x5ebd('0x1a')]);}else{logger[_0x5ebd('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x256f00,_0x5ebd('0x16'));_0x36dc53(_0x450196[_0x5ebd('0x1b')][_0x5ebd('0x1a')]);}})['catch'](function(_0x3e4fc0){logger['error'](_0x5ebd('0x15'),_0x256f00,_0x3e4fc0);_0x46f5ec(_0x3e4fc0);});});}exports[_0x5ebd('0x1c')]=function(_0x43e1a6){var _0x21260c=this;return new Promise(function(_0xbefe43,_0x459a48){return db[_0x5ebd('0x1d')]['find']({'raw':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6[_0x5ebd('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6[_0x5ebd('0x1e')][_0x5ebd('0x1f')]||null:null,'attributes':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6['options']['attributes']||null:null,'include':_0x43e1a6[_0x5ebd('0x1e')]?_0x43e1a6[_0x5ebd('0x1e')][_0x5ebd('0x20')]?_['map'](_0x43e1a6[_0x5ebd('0x1e')][_0x5ebd('0x20')],function(_0x10fe07){return{'model':db[_0x10fe07[_0x5ebd('0x21')]],'as':_0x10fe07['as'],'attributes':_0x10fe07[_0x5ebd('0x22')],'include':_0x10fe07['include']?_[_0x5ebd('0x23')](_0x10fe07['include'],function(_0x4d3ddd){return{'model':db[_0x4d3ddd[_0x5ebd('0x21')]],'as':_0x4d3ddd['as'],'attributes':_0x4d3ddd[_0x5ebd('0x22')],'include':_0x4d3ddd[_0x5ebd('0x20')]?_[_0x5ebd('0x23')](_0x4d3ddd[_0x5ebd('0x20')],function(_0x1d3ca5){return{'model':db[_0x1d3ca5[_0x5ebd('0x21')]],'as':_0x1d3ca5['as'],'attributes':_0x1d3ca5[_0x5ebd('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f617c){logger[_0x5ebd('0x14')](_0x5ebd('0x1c'),_0x43e1a6);logger['debug'](_0x5ebd('0x1c'),_0x43e1a6,JSON['stringify'](_0x1f617c));_0xbefe43(_0x1f617c);})[_0x5ebd('0x24')](function(_0x403e0b){logger[_0x5ebd('0x19')]('ShowWhatsappAccount',_0x403e0b[_0x5ebd('0x1a')],_0x43e1a6);_0x459a48(_0x21260c[_0x5ebd('0x19')](0x1f4,_0x403e0b[_0x5ebd('0x1a')]));});});}; \ No newline at end of file +var _0xe5fc=['attributes','include','map','model','ShowWhatsappAccount','stringify','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','WhatsappAccount','find','options','raw','where'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xe5fc,0x109));var _0xce5f=function(_0x1431aa,_0x4d9845){_0x1431aa=_0x1431aa-0x0;var _0x5de3b1=_0xe5fc[_0x1431aa];return _0x5de3b1;};'use strict';var _=require(_0xce5f('0x0'));var util=require('util');var moment=require(_0xce5f('0x1'));var BPromise=require(_0xce5f('0x2'));var rs=require(_0xce5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce5f('0x4'))('rpc');var config=require(_0xce5f('0x5'));var jayson=require(_0xce5f('0x6'));var client=jayson[_0xce5f('0x7')][_0xce5f('0x8')]({'port':0x232a});config[_0xce5f('0x9')]=_[_0xce5f('0xa')](config[_0xce5f('0x9')],{'host':_0xce5f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce5f('0x9')]));require(_0xce5f('0xc'))[_0xce5f('0xd')](socket);function respondWithRpcPromise(_0x44f5aa,_0x36da1e,_0x131f10){return new BPromise(function(_0x2cec65,_0x509dfa){return client[_0xce5f('0xe')](_0x44f5aa,_0x131f10)[_0xce5f('0xf')](function(_0x15b0be){logger[_0xce5f('0x10')](_0xce5f('0x11'),_0x36da1e,_0xce5f('0x12'));logger[_0xce5f('0x13')](_0xce5f('0x14'),_0x36da1e,_0xce5f('0x12'),JSON['stringify'](_0x15b0be));if(_0x15b0be['error']){if(_0x15b0be['error'][_0xce5f('0x15')]===0x1f4){logger[_0xce5f('0x16')](_0xce5f('0x11'),_0x36da1e,_0x15b0be[_0xce5f('0x16')]['message']);return _0x509dfa(_0x15b0be[_0xce5f('0x16')][_0xce5f('0x17')]);}logger[_0xce5f('0x16')](_0xce5f('0x11'),_0x36da1e,_0x15b0be[_0xce5f('0x16')][_0xce5f('0x17')]);return _0x2cec65(_0x15b0be[_0xce5f('0x16')][_0xce5f('0x17')]);}else{logger[_0xce5f('0x10')](_0xce5f('0x11'),_0x36da1e,_0xce5f('0x12'));_0x2cec65(_0x15b0be[_0xce5f('0x18')][_0xce5f('0x17')]);}})[_0xce5f('0x19')](function(_0x1c4132){logger[_0xce5f('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x36da1e,_0x1c4132);_0x509dfa(_0x1c4132);});});}exports['ShowWhatsappAccount']=function(_0x530170){var _0x225854=this;return new Promise(function(_0x1087ea,_0x32a377){return db[_0xce5f('0x1a')][_0xce5f('0x1b')]({'raw':_0x530170[_0xce5f('0x1c')]?_0x530170[_0xce5f('0x1c')][_0xce5f('0x1d')]===undefined?!![]:![]:!![],'where':_0x530170[_0xce5f('0x1c')]?_0x530170['options'][_0xce5f('0x1e')]||null:null,'attributes':_0x530170[_0xce5f('0x1c')]?_0x530170['options'][_0xce5f('0x1f')]||null:null,'include':_0x530170[_0xce5f('0x1c')]?_0x530170[_0xce5f('0x1c')][_0xce5f('0x20')]?_[_0xce5f('0x21')](_0x530170['options']['include'],function(_0x3d44fc){return{'model':db[_0x3d44fc[_0xce5f('0x22')]],'as':_0x3d44fc['as'],'attributes':_0x3d44fc[_0xce5f('0x1f')],'include':_0x3d44fc[_0xce5f('0x20')]?_['map'](_0x3d44fc[_0xce5f('0x20')],function(_0x32cb28){return{'model':db[_0x32cb28[_0xce5f('0x22')]],'as':_0x32cb28['as'],'attributes':_0x32cb28[_0xce5f('0x1f')],'include':_0x32cb28[_0xce5f('0x20')]?_[_0xce5f('0x21')](_0x32cb28[_0xce5f('0x20')],function(_0x118ccf){return{'model':db[_0x118ccf[_0xce5f('0x22')]],'as':_0x118ccf['as'],'attributes':_0x118ccf[_0xce5f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x219ede){logger[_0xce5f('0x10')](_0xce5f('0x23'),_0x530170);logger[_0xce5f('0x13')](_0xce5f('0x23'),_0x530170,JSON[_0xce5f('0x24')](_0x219ede));_0x1087ea(_0x219ede);})[_0xce5f('0x19')](function(_0x2c39fa){logger[_0xce5f('0x16')]('ShowWhatsappAccount',_0x2c39fa['message'],_0x530170);_0x32a377(_0x225854[_0xce5f('0x16')](0x1f4,_0x2c39fa['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 9ca8909..23cabcb 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 _0xd66e=['length','save','update','emit','removeListener'];(function(_0x5c02a2,_0x19acb9){var _0x599f58=function(_0x3df9af){while(--_0x3df9af){_0x5c02a2['push'](_0x5c02a2['shift']());}};_0x599f58(++_0x19acb9);}(_0xd66e,0x173));var _0xed66=function(_0x40f4d3,_0x2c163c){_0x40f4d3=_0x40f4d3-0x0;var _0x342be1=_0xd66e[_0x40f4d3];return _0x342be1;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xed66('0x0'),'remove',_0xed66('0x1')];function createListener(_0x1c88d9,_0x2bb72b){return function(_0x42ef99){_0x2bb72b[_0xed66('0x2')](_0x1c88d9,_0x42ef99);};}function removeListener(_0x14ade3,_0x25e72e){return function(){WhatsappAccountEvents[_0xed66('0x3')](_0x14ade3,_0x25e72e);};}exports['register']=function(_0x425729){for(var _0x4ca99f=0x0,_0x51e19c=events[_0xed66('0x4')];_0x4ca99f<_0x51e19c;_0x4ca99f++){var _0x2ec35c=events[_0x4ca99f];var _0x217b06=createListener('whatsappAccount:'+_0x2ec35c,_0x425729);WhatsappAccountEvents['on'](_0x2ec35c,_0x217b06);}}; \ No newline at end of file +var _0xc4b5=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x35be76,_0x2aff90){var _0x51531d=function(_0x51e6f7){while(--_0x51e6f7){_0x35be76['push'](_0x35be76['shift']());}};_0x51531d(++_0x2aff90);}(_0xc4b5,0x69));var _0x5c4b=function(_0x2ba0d2,_0x1c7d0e){_0x2ba0d2=_0x2ba0d2-0x0;var _0x4cc14f=_0xc4b5[_0x2ba0d2];return _0x4cc14f;};'use strict';var WhatsappAccountEvents=require(_0x5c4b('0x0'));var events=[_0x5c4b('0x1'),_0x5c4b('0x2'),_0x5c4b('0x3')];function createListener(_0x547b46,_0x576917){return function(_0x2229b3){_0x576917[_0x5c4b('0x4')](_0x547b46,_0x2229b3);};}function removeListener(_0x2cef4a,_0x2b8583){return function(){WhatsappAccountEvents[_0x5c4b('0x5')](_0x2cef4a,_0x2b8583);};}exports[_0x5c4b('0x6')]=function(_0x3d55c6){for(var _0x3b6471=0x0,_0x30f265=events['length'];_0x3b6471<_0x30f265;_0x3b6471++){var _0x5ec5cf=events[_0x3b6471];var _0x876d75=createListener(_0x5c4b('0x7')+_0x5ec5cf,_0x3d55c6);WhatsappAccountEvents['on'](_0x5ec5cf,_0x876d75);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index bb70136..1b5c756 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 _0x85c8=['get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44cec6,_0x5d8fbe){var _0x42562e=function(_0x59907b){while(--_0x59907b){_0x44cec6['push'](_0x44cec6['shift']());}};_0x42562e(++_0x5d8fbe);}(_0x85c8,0x197));var _0x885c=function(_0x1cf9b7,_0x2c101d){_0x1cf9b7=_0x1cf9b7-0x0;var _0x1ddc85=_0x85c8[_0x1cf9b7];return _0x1ddc85;};'use strict';var multer=require(_0x885c('0x0'));var util=require('util');var path=require(_0x885c('0x1'));var timeout=require(_0x885c('0x2'));var express=require(_0x885c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x885c('0x4'));var interaction=require(_0x885c('0x5'));var config=require(_0x885c('0x6'));var controller=require('./whatsappApplication.controller');router[_0x885c('0x7')]('/',auth[_0x885c('0x8')](),controller['index']);router[_0x885c('0x7')]('/:id',auth[_0x885c('0x8')](),controller[_0x885c('0x9')]);router[_0x885c('0xa')]('/',auth[_0x885c('0x8')](),controller[_0x885c('0xb')]);router[_0x885c('0xc')](_0x885c('0xd'),auth[_0x885c('0x8')](),controller[_0x885c('0xe')]);router[_0x885c('0xf')](_0x885c('0xd'),auth[_0x885c('0x8')](),controller[_0x885c('0x10')]);module[_0x885c('0x11')]=router; \ No newline at end of file +var _0xd6f3=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xd6f3,0x1cd));var _0x3d6f=function(_0x10c1bf,_0x36d7c9){_0x10c1bf=_0x10c1bf-0x0;var _0x4c7a26=_0xd6f3[_0x10c1bf];return _0x4c7a26;};'use strict';var multer=require(_0x3d6f('0x0'));var util=require(_0x3d6f('0x1'));var path=require(_0x3d6f('0x2'));var timeout=require(_0x3d6f('0x3'));var express=require('express');var router=express[_0x3d6f('0x4')]();var fs_extra=require(_0x3d6f('0x5'));var auth=require(_0x3d6f('0x6'));var interaction=require(_0x3d6f('0x7'));var config=require(_0x3d6f('0x8'));var controller=require(_0x3d6f('0x9'));router['get']('/',auth[_0x3d6f('0xa')](),controller['index']);router[_0x3d6f('0xb')](_0x3d6f('0xc'),auth['isAuthenticated'](),controller[_0x3d6f('0xd')]);router[_0x3d6f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d6f('0xf')](_0x3d6f('0xc'),auth[_0x3d6f('0xa')](),controller[_0x3d6f('0x10')]);router[_0x3d6f('0x11')](_0x3d6f('0xc'),auth[_0x3d6f('0xa')](),controller[_0x3d6f('0x12')]);module[_0x3d6f('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index b74c7f0..8e4f07a 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 _0x64e6=['*,*,*,*','exports','STRING','noop'];(function(_0x5bf23f,_0x1492c3){var _0x4fc117=function(_0x5d1c62){while(--_0x5d1c62){_0x5bf23f['push'](_0x5bf23f['shift']());}};_0x4fc117(++_0x1492c3);}(_0x64e6,0x1e5));var _0x664e=function(_0x13325e,_0x47fe32){_0x13325e=_0x13325e-0x0;var _0x4e37d6=_0x64e6[_0x13325e];return _0x4e37d6;};'use strict';var Sequelize=require('sequelize');module[_0x664e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x664e('0x1')],'allowNull':![],'defaultValue':_0x664e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x664e('0x1')]},'interval':{'type':Sequelize[_0x664e('0x1')],'defaultValue':_0x664e('0x3')}}; \ No newline at end of file +var _0xe147=['exports','INTEGER','noop','STRING','*,*,*,*'];(function(_0x55fb60,_0x4a926c){var _0x294b88=function(_0x5cf3b8){while(--_0x5cf3b8){_0x55fb60['push'](_0x55fb60['shift']());}};_0x294b88(++_0x4a926c);}(_0xe147,0x19a));var _0x7e14=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe147[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x7e14('0x0')]={'priority':{'type':Sequelize[_0x7e14('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7e14('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7e14('0x3')],'defaultValue':_0x7e14('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 9609e67..201b3df 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 _0xa2cb=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x37f6d8,_0x444925){var _0x49f67b=function(_0x54cfe7){while(--_0x54cfe7){_0x37f6d8['push'](_0x37f6d8['shift']());}};_0x49f67b(++_0x444925);}(_0xa2cb,0x7d));var _0xba2c=function(_0xa296a5,_0x44a37d){_0xa296a5=_0xa296a5-0x0;var _0x4a0905=_0xa2cb[_0xa296a5];return _0x4a0905;};'use strict';var emlformat=require(_0xba2c('0x0'));var rimraf=require(_0xba2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba2c('0x2'));var rp=require(_0xba2c('0x3'));var moment=require(_0xba2c('0x4'));var BPromise=require(_0xba2c('0x5'));var Mustache=require(_0xba2c('0x6'));var util=require('util');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(_0xba2c('0x7'));var _=require('lodash');var squel=require(_0xba2c('0x8'));var crypto=require('crypto');var jsforce=require(_0xba2c('0x9'));var deskjs=require(_0xba2c('0xa'));var toCsv=require('to-csv');var querystring=require(_0xba2c('0xb'));var Papa=require(_0xba2c('0xc'));var Redis=require('ioredis');var authService=require(_0xba2c('0xd'));var qs=require(_0xba2c('0xe'));var as=require(_0xba2c('0xf'));var hardwareService=require(_0xba2c('0x10'));var logger=require('../../config/logger')(_0xba2c('0x11'));var utils=require(_0xba2c('0x12'));var config=require(_0xba2c('0x13'));var licenseUtil=require(_0xba2c('0x14'));var db=require(_0xba2c('0x15'))['db'];function respondWithStatusCode(_0x400762,_0x206bb2){_0x206bb2=_0x206bb2||0xcc;return function(_0x2c7fb4){if(_0x2c7fb4){return _0x400762[_0xba2c('0x16')](_0x206bb2);}return _0x400762[_0xba2c('0x17')](_0x206bb2)['end']();};}function respondWithResult(_0x56fe7c,_0x421d3d){_0x421d3d=_0x421d3d||0xc8;return function(_0x3fc26e){if(_0x3fc26e){return _0x56fe7c[_0xba2c('0x17')](_0x421d3d)[_0xba2c('0x18')](_0x3fc26e);}};}function respondWithFilteredResult(_0x12794c,_0x3fdb17){return function(_0x37de25){if(_0x37de25){var _0x121bbc=typeof _0x3fdb17['offset']===_0xba2c('0x19')&&typeof _0x3fdb17[_0xba2c('0x1a')]===_0xba2c('0x19');var _0x3282ea=_0x37de25[_0xba2c('0x1b')];var _0x48227c=_0x121bbc?0x0:_0x3fdb17[_0xba2c('0x1c')];var _0xe2e0d5=_0x121bbc?_0x37de25['count']:_0x3fdb17['offset']+_0x3fdb17['limit'];var _0x56087a;if(_0xe2e0d5>=_0x3282ea){_0xe2e0d5=_0x3282ea;_0x56087a=0xc8;}else{_0x56087a=0xce;}_0x12794c[_0xba2c('0x17')](_0x56087a);return _0x12794c[_0xba2c('0x1d')](_0xba2c('0x1e'),_0x48227c+'-'+_0xe2e0d5+'/'+_0x3282ea)[_0xba2c('0x18')](_0x37de25);}return null;};}function patchUpdates(_0x42dff6){return function(_0x3e6ab4){try{jsonpatch[_0xba2c('0x1f')](_0x3e6ab4,_0x42dff6,!![]);}catch(_0x14902f){return BPromise[_0xba2c('0x20')](_0x14902f);}return _0x3e6ab4[_0xba2c('0x21')]();};}function saveUpdates(_0x24172f,_0x19b41e){return function(_0x31cd64){if(_0x31cd64){return _0x31cd64[_0xba2c('0x22')](_0x24172f)[_0xba2c('0x23')](function(_0x45a296){return _0x45a296;});}return null;};}function removeEntity(_0x29eee0,_0xf79e4c){return function(_0x5ea429){if(_0x5ea429){return _0x5ea429[_0xba2c('0x24')]()[_0xba2c('0x23')](function(){_0x29eee0[_0xba2c('0x17')](0xcc)[_0xba2c('0x25')]();});}};}function handleEntityNotFound(_0x590f6a,_0x5f134f){return function(_0x199b1d){if(!_0x199b1d){_0x590f6a['sendStatus'](0x194);}return _0x199b1d;};}function handleError(_0x25e164,_0x3622dd){_0x3622dd=_0x3622dd||0x1f4;return function(_0xadee40){logger[_0xba2c('0x26')](_0xadee40[_0xba2c('0x27')]);if(_0xadee40[_0xba2c('0x28')]){delete _0xadee40['name'];}_0x25e164['status'](_0x3622dd)[_0xba2c('0x29')](_0xadee40);};}exports[_0xba2c('0x2a')]=function(_0x19ee5a,_0x46d3f9){var _0x4875f8={},_0x51e6b0={},_0x1ff162={'count':0x0,'rows':[]};var _0x3d7a13=_[_0xba2c('0x2b')](db[_0xba2c('0x2c')][_0xba2c('0x2d')],function(_0x26b5c7){return{'name':_0x26b5c7[_0xba2c('0x2e')],'type':_0x26b5c7[_0xba2c('0x2f')][_0xba2c('0x30')]};});_0x51e6b0[_0xba2c('0x31')]=_[_0xba2c('0x2b')](_0x3d7a13,_0xba2c('0x28'));_0x51e6b0[_0xba2c('0x32')]=_[_0xba2c('0x33')](_0x19ee5a[_0xba2c('0x32')]);_0x51e6b0[_0xba2c('0x34')]=_['intersection'](_0x51e6b0[_0xba2c('0x31')],_0x51e6b0['query']);_0x4875f8[_0xba2c('0x35')]=_[_0xba2c('0x36')](_0x51e6b0[_0xba2c('0x31')],qs[_0xba2c('0x37')](_0x19ee5a[_0xba2c('0x32')][_0xba2c('0x37')]));_0x4875f8['attributes']=_0x4875f8[_0xba2c('0x35')][_0xba2c('0x38')]?_0x4875f8[_0xba2c('0x35')]:_0x51e6b0[_0xba2c('0x31')];if(!_0x19ee5a[_0xba2c('0x32')][_0xba2c('0x39')](_0xba2c('0x3a'))){_0x4875f8[_0xba2c('0x1a')]=qs[_0xba2c('0x1a')](_0x19ee5a['query'][_0xba2c('0x1a')]);_0x4875f8[_0xba2c('0x1c')]=qs[_0xba2c('0x1c')](_0x19ee5a['query'][_0xba2c('0x1c')]);}_0x4875f8[_0xba2c('0x3b')]=qs[_0xba2c('0x3c')](_0x19ee5a[_0xba2c('0x32')]['sort']);_0x4875f8['where']=qs[_0xba2c('0x34')](_['pick'](_0x19ee5a[_0xba2c('0x32')],_0x51e6b0['filters']),_0x3d7a13);if(_0x19ee5a['query'][_0xba2c('0x3d')]){_0x4875f8[_0xba2c('0x3e')]=_[_0xba2c('0x3f')](_0x4875f8[_0xba2c('0x3e')],{'$or':_['map'](_0x3d7a13,function(_0x14b57f){if(_0x14b57f[_0xba2c('0x2f')]!==_0xba2c('0x40')){var _0x5e35b6={};_0x5e35b6[_0x14b57f[_0xba2c('0x28')]]={'$like':'%'+_0x19ee5a[_0xba2c('0x32')][_0xba2c('0x3d')]+'%'};return _0x5e35b6;}})});}_0x4875f8=_[_0xba2c('0x3f')]({},_0x4875f8,_0x19ee5a[_0xba2c('0x41')]);var _0x5419a5={'where':_0x4875f8[_0xba2c('0x3e')]};return db[_0xba2c('0x2c')][_0xba2c('0x1b')](_0x5419a5)[_0xba2c('0x23')](function(_0x146bed){_0x1ff162['count']=_0x146bed;if(_0x19ee5a['query'][_0xba2c('0x42')]){_0x4875f8[_0xba2c('0x43')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xba2c('0x44')](_0x4875f8);})[_0xba2c('0x23')](function(_0x1e2ad8){_0x1ff162[_0xba2c('0x45')]=_0x1e2ad8;return _0x1ff162;})[_0xba2c('0x23')](respondWithFilteredResult(_0x46d3f9,_0x4875f8))[_0xba2c('0x46')](handleError(_0x46d3f9,null));};exports[_0xba2c('0x47')]=function(_0x381857,_0x40eb6c){var _0x501df5={'raw':!![],'where':{'id':_0x381857[_0xba2c('0x48')]['id']}},_0x3fddfd={};_0x3fddfd[_0xba2c('0x31')]=_['keys'](db[_0xba2c('0x2c')][_0xba2c('0x2d')]);_0x3fddfd[_0xba2c('0x32')]=_['keys'](_0x381857[_0xba2c('0x32')]);_0x3fddfd[_0xba2c('0x34')]=_[_0xba2c('0x36')](_0x3fddfd[_0xba2c('0x31')],_0x3fddfd['query']);_0x501df5[_0xba2c('0x35')]=_[_0xba2c('0x36')](_0x3fddfd[_0xba2c('0x31')],qs[_0xba2c('0x37')](_0x381857[_0xba2c('0x32')][_0xba2c('0x37')]));_0x501df5['attributes']=_0x501df5[_0xba2c('0x35')][_0xba2c('0x38')]?_0x501df5[_0xba2c('0x35')]:_0x3fddfd[_0xba2c('0x31')];if(_0x381857['query']['includeAll']){_0x501df5[_0xba2c('0x43')]=[{'all':!![]}];}_0x501df5=_[_0xba2c('0x3f')]({},_0x501df5,_0x381857['options']);return db[_0xba2c('0x2c')]['find'](_0x501df5)[_0xba2c('0x23')](handleEntityNotFound(_0x40eb6c,null))[_0xba2c('0x23')](respondWithResult(_0x40eb6c,null))['catch'](handleError(_0x40eb6c,null));};exports['create']=function(_0x4250b1,_0x4f6431){return db['WhatsappApplication']['create'](_0x4250b1[_0xba2c('0x49')],{})[_0xba2c('0x23')](respondWithResult(_0x4f6431,0xc9))['catch'](handleError(_0x4f6431,null));};exports[_0xba2c('0x22')]=function(_0x2ec59a,_0x41d277){if(_0x2ec59a[_0xba2c('0x49')]['id']){delete _0x2ec59a['body']['id'];}return db[_0xba2c('0x2c')][_0xba2c('0x4a')]({'where':{'id':_0x2ec59a[_0xba2c('0x48')]['id']}})[_0xba2c('0x23')](handleEntityNotFound(_0x41d277,null))['then'](saveUpdates(_0x2ec59a[_0xba2c('0x49')],null))[_0xba2c('0x23')](respondWithResult(_0x41d277,null))[_0xba2c('0x46')](handleError(_0x41d277,null));};exports['destroy']=function(_0x14b098,_0x585d43){return db[_0xba2c('0x2c')][_0xba2c('0x4a')]({'where':{'id':_0x14b098[_0xba2c('0x48')]['id']}})[_0xba2c('0x23')](handleEntityNotFound(_0x585d43,null))[_0xba2c('0x23')](removeEntity(_0x585d43,null))[_0xba2c('0x46')](handleError(_0x585d43,null));}; \ No newline at end of file +var _0x7041=['WhatsappApplication','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','keys','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','destroy','then','stack','name','index','map'];(function(_0xe7e2f0,_0x544e64){var _0x2e6f61=function(_0x29e529){while(--_0x29e529){_0xe7e2f0['push'](_0xe7e2f0['shift']());}};_0x2e6f61(++_0x544e64);}(_0x7041,0xdd));var _0x1704=function(_0x20729c,_0x326855){_0x20729c=_0x20729c-0x0;var _0x5bc305=_0x7041[_0x20729c];return _0x5bc305;};'use strict';var emlformat=require(_0x1704('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1704('0x1'));var jsonpatch=require(_0x1704('0x2'));var rp=require('request-promise');var moment=require(_0x1704('0x3'));var BPromise=require(_0x1704('0x4'));var Mustache=require(_0x1704('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1704('0x6'));var fs=require('fs');var fs_extra=require(_0x1704('0x7'));var _=require(_0x1704('0x8'));var squel=require(_0x1704('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1704('0xa'));var querystring=require(_0x1704('0xb'));var Papa=require(_0x1704('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1704('0xd'));var hardwareService=require(_0x1704('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1704('0xf'));var licenseUtil=require(_0x1704('0x10'));var db=require(_0x1704('0x11'))['db'];function respondWithStatusCode(_0x4be3e4,_0x4f4416){_0x4f4416=_0x4f4416||0xcc;return function(_0x47fdeb){if(_0x47fdeb){return _0x4be3e4[_0x1704('0x12')](_0x4f4416);}return _0x4be3e4[_0x1704('0x13')](_0x4f4416)[_0x1704('0x14')]();};}function respondWithResult(_0x2b0e20,_0x130722){_0x130722=_0x130722||0xc8;return function(_0x375274){if(_0x375274){return _0x2b0e20[_0x1704('0x13')](_0x130722)[_0x1704('0x15')](_0x375274);}};}function respondWithFilteredResult(_0x355253,_0x5df802){return function(_0x24d144){if(_0x24d144){var _0x1d0aa6=typeof _0x5df802[_0x1704('0x16')]==='undefined'&&typeof _0x5df802[_0x1704('0x17')]==='undefined';var _0x43940b=_0x24d144[_0x1704('0x18')];var _0x24fd08=_0x1d0aa6?0x0:_0x5df802[_0x1704('0x16')];var _0x84818b=_0x1d0aa6?_0x24d144[_0x1704('0x18')]:_0x5df802[_0x1704('0x16')]+_0x5df802['limit'];var _0x243c10;if(_0x84818b>=_0x43940b){_0x84818b=_0x43940b;_0x243c10=0xc8;}else{_0x243c10=0xce;}_0x355253[_0x1704('0x13')](_0x243c10);return _0x355253['set'](_0x1704('0x19'),_0x24fd08+'-'+_0x84818b+'/'+_0x43940b)['json'](_0x24d144);}return null;};}function patchUpdates(_0xfe2eb0){return function(_0x17177b){try{jsonpatch[_0x1704('0x1a')](_0x17177b,_0xfe2eb0,!![]);}catch(_0x36461e){return BPromise[_0x1704('0x1b')](_0x36461e);}return _0x17177b['save']();};}function saveUpdates(_0x18f8cc,_0x318137){return function(_0x588cc6){if(_0x588cc6){return _0x588cc6[_0x1704('0x1c')](_0x18f8cc)['then'](function(_0x52aba9){return _0x52aba9;});}return null;};}function removeEntity(_0x1af7a1,_0x17cb8d){return function(_0x8eb551){if(_0x8eb551){return _0x8eb551[_0x1704('0x1d')]()[_0x1704('0x1e')](function(){_0x1af7a1[_0x1704('0x13')](0xcc)[_0x1704('0x14')]();});}};}function handleEntityNotFound(_0x1786e5,_0x4527f8){return function(_0x2468cf){if(!_0x2468cf){_0x1786e5[_0x1704('0x12')](0x194);}return _0x2468cf;};}function handleError(_0x20a907,_0x375d3d){_0x375d3d=_0x375d3d||0x1f4;return function(_0x320404){logger['error'](_0x320404[_0x1704('0x1f')]);if(_0x320404[_0x1704('0x20')]){delete _0x320404['name'];}_0x20a907[_0x1704('0x13')](_0x375d3d)['send'](_0x320404);};}exports[_0x1704('0x21')]=function(_0x1917ef,_0x324be0){var _0x295faa={},_0xf7edb1={},_0x232509={'count':0x0,'rows':[]};var _0x446280=_[_0x1704('0x22')](db[_0x1704('0x23')][_0x1704('0x24')],function(_0x2a8ec3){return{'name':_0x2a8ec3['fieldName'],'type':_0x2a8ec3[_0x1704('0x25')][_0x1704('0x26')]};});_0xf7edb1[_0x1704('0x27')]=_[_0x1704('0x22')](_0x446280,_0x1704('0x20'));_0xf7edb1[_0x1704('0x28')]=_['keys'](_0x1917ef['query']);_0xf7edb1[_0x1704('0x29')]=_[_0x1704('0x2a')](_0xf7edb1[_0x1704('0x27')],_0xf7edb1[_0x1704('0x28')]);_0x295faa[_0x1704('0x2b')]=_[_0x1704('0x2a')](_0xf7edb1[_0x1704('0x27')],qs[_0x1704('0x2c')](_0x1917ef[_0x1704('0x28')][_0x1704('0x2c')]));_0x295faa[_0x1704('0x2b')]=_0x295faa[_0x1704('0x2b')][_0x1704('0x2d')]?_0x295faa[_0x1704('0x2b')]:_0xf7edb1['model'];if(!_0x1917ef[_0x1704('0x28')][_0x1704('0x2e')](_0x1704('0x2f'))){_0x295faa[_0x1704('0x17')]=qs[_0x1704('0x17')](_0x1917ef[_0x1704('0x28')]['limit']);_0x295faa['offset']=qs[_0x1704('0x16')](_0x1917ef['query']['offset']);}_0x295faa[_0x1704('0x30')]=qs[_0x1704('0x31')](_0x1917ef['query'][_0x1704('0x31')]);_0x295faa[_0x1704('0x32')]=qs['filters'](_['pick'](_0x1917ef[_0x1704('0x28')],_0xf7edb1[_0x1704('0x29')]),_0x446280);if(_0x1917ef[_0x1704('0x28')]['filter']){_0x295faa[_0x1704('0x32')]=_[_0x1704('0x33')](_0x295faa[_0x1704('0x32')],{'$or':_[_0x1704('0x22')](_0x446280,function(_0x4db440){if(_0x4db440[_0x1704('0x25')]!==_0x1704('0x34')){var _0x1a99fc={};_0x1a99fc[_0x4db440[_0x1704('0x20')]]={'$like':'%'+_0x1917ef[_0x1704('0x28')][_0x1704('0x35')]+'%'};return _0x1a99fc;}})});}_0x295faa=_['merge']({},_0x295faa,_0x1917ef[_0x1704('0x36')]);var _0x3765d1={'where':_0x295faa['where']};return db['WhatsappApplication'][_0x1704('0x18')](_0x3765d1)['then'](function(_0x44b5d8){_0x232509[_0x1704('0x18')]=_0x44b5d8;if(_0x1917ef[_0x1704('0x28')][_0x1704('0x37')]){_0x295faa['include']=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x295faa);})[_0x1704('0x1e')](function(_0x4c69dd){_0x232509[_0x1704('0x38')]=_0x4c69dd;return _0x232509;})['then'](respondWithFilteredResult(_0x324be0,_0x295faa))[_0x1704('0x39')](handleError(_0x324be0,null));};exports[_0x1704('0x3a')]=function(_0x1baaef,_0x4c5dcb){var _0x2f25b4={'raw':!![],'where':{'id':_0x1baaef['params']['id']}},_0x364bc9={};_0x364bc9[_0x1704('0x27')]=_['keys'](db[_0x1704('0x23')][_0x1704('0x24')]);_0x364bc9[_0x1704('0x28')]=_[_0x1704('0x3b')](_0x1baaef['query']);_0x364bc9[_0x1704('0x29')]=_['intersection'](_0x364bc9[_0x1704('0x27')],_0x364bc9[_0x1704('0x28')]);_0x2f25b4[_0x1704('0x2b')]=_['intersection'](_0x364bc9['model'],qs[_0x1704('0x2c')](_0x1baaef[_0x1704('0x28')]['fields']));_0x2f25b4[_0x1704('0x2b')]=_0x2f25b4[_0x1704('0x2b')][_0x1704('0x2d')]?_0x2f25b4[_0x1704('0x2b')]:_0x364bc9['model'];if(_0x1baaef[_0x1704('0x28')][_0x1704('0x37')]){_0x2f25b4['include']=[{'all':!![]}];}_0x2f25b4=_[_0x1704('0x33')]({},_0x2f25b4,_0x1baaef['options']);return db['WhatsappApplication'][_0x1704('0x3c')](_0x2f25b4)[_0x1704('0x1e')](handleEntityNotFound(_0x4c5dcb,null))[_0x1704('0x1e')](respondWithResult(_0x4c5dcb,null))['catch'](handleError(_0x4c5dcb,null));};exports['create']=function(_0x825d73,_0x20b7c9){return db[_0x1704('0x23')][_0x1704('0x3d')](_0x825d73['body'],{})[_0x1704('0x1e')](respondWithResult(_0x20b7c9,0xc9))[_0x1704('0x39')](handleError(_0x20b7c9,null));};exports['update']=function(_0x51985f,_0x44baff){if(_0x51985f['body']['id']){delete _0x51985f[_0x1704('0x3e')]['id'];}return db[_0x1704('0x23')]['find']({'where':{'id':_0x51985f['params']['id']}})['then'](handleEntityNotFound(_0x44baff,null))[_0x1704('0x1e')](saveUpdates(_0x51985f[_0x1704('0x3e')],null))['then'](respondWithResult(_0x44baff,null))[_0x1704('0x39')](handleError(_0x44baff,null));};exports[_0x1704('0x1d')]=function(_0x395b1f,_0x57b1df){return db[_0x1704('0x23')]['find']({'where':{'id':_0x395b1f[_0x1704('0x3f')]['id']}})[_0x1704('0x1e')](handleEntityNotFound(_0x57b1df,null))[_0x1704('0x1e')](removeEntity(_0x57b1df,null))['catch'](handleError(_0x57b1df,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8216d22..9954ccf 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 _0x9d92=['whatsapp_applications','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0x4a83e8,_0x5b3234){var _0xa0adca=function(_0x3379a6){while(--_0x3379a6){_0x4a83e8['push'](_0x4a83e8['shift']());}};_0xa0adca(++_0x5b3234);}(_0x9d92,0xdf));var _0x29d9=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x9d92[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29d9('0x1'));var moment=require(_0x29d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d9('0x3'));var fs=require('fs');var path=require(_0x29d9('0x4'));var rimraf=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var attributes=require(_0x29d9('0x7'));module[_0x29d9('0x8')]=function(_0x27d032,_0x52932b){return _0x27d032[_0x29d9('0x9')](_0x29d9('0xa'),attributes,{'tableName':_0x29d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x29d9('0xc')});}; \ No newline at end of file +var _0xd2bb=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x7d36a8,_0x2aefc6){var _0x4505ea=function(_0x2b4c19){while(--_0x2b4c19){_0x7d36a8['push'](_0x7d36a8['shift']());}};_0x4505ea(++_0x2aefc6);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x4a4010,_0x19c888){_0x4a4010=_0x4a4010-0x0;var _0x127082=_0xd2bb[_0x4a4010];return _0x127082;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var logger=require('../../config/logger')(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var rp=require(_0xbd2b('0x4'));var fs=require('fs');var path=require(_0xbd2b('0x5'));var rimraf=require(_0xbd2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd2b('0x7'));module[_0xbd2b('0x8')]=function(_0xdcd8bd,_0x2f64a8){return _0xdcd8bd[_0xbd2b('0x9')](_0xbd2b('0xa'),attributes,{'tableName':_0xbd2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbd2b('0xc'),'collate':_0xbd2b('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 332f124..19e877f 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 _0xd6d6=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2bff83,_0xc785d9){var _0x4528b6=function(_0x5b4aab){while(--_0x5b4aab){_0x2bff83['push'](_0x2bff83['shift']());}};_0x4528b6(++_0xc785d9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xe5d84a,_0x43bc0a){_0xe5d84a=_0xe5d84a-0x0;var _0x50c8eb=_0xd6d6[_0xe5d84a];return _0x50c8eb;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfad1ed,_0x4299b7){var _0x4f3325=function(_0x2449b5){while(--_0x2449b5){_0xfad1ed['push'](_0xfad1ed['shift']());}};_0x4f3325(++_0x4299b7);}(_0xa41a,0x6b));var _0xaa41=function(_0x49a2b5,_0x3cc18a){_0x49a2b5=_0x49a2b5-0x0;var _0x495a34=_0xa41a[_0x49a2b5];return _0x495a34;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index bd3920b..3d0e4ed 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 _0xd101=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x106d83,_0x21bc8d){var _0x515d6a=function(_0x32505b){while(--_0x32505b){_0x106d83['push'](_0x106d83['shift']());}};_0x515d6a(++_0x21bc8d);}(_0xd101,0xc1));var _0x1d10=function(_0x24f87b,_0x278771){_0x24f87b=_0x24f87b-0x0;var _0x1ae69f=_0xd101[_0x24f87b];return _0x1ae69f;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0x9')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x9')](_0x1d10('0x10'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x9')](_0x1d10('0x12'),auth['isAuthenticated'](),controller[_0x1d10('0x13')]);router[_0x1d10('0x14')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0x15')]);router[_0x1d10('0x14')]('/:id/messages',auth[_0x1d10('0xa')](),controller[_0x1d10('0x16')]);router[_0x1d10('0x14')](_0x1d10('0x17'),auth[_0x1d10('0xa')](),interaction[_0x1d10('0x18')]('whatsapp',_0x1d10('0x19')),controller[_0x1d10('0x1a')]);router[_0x1d10('0x1b')](_0x1d10('0xe'),auth['isAuthenticated'](),interaction[_0x1d10('0x18')](_0x1d10('0x1c'),_0x1d10('0x1d')),controller[_0x1d10('0x1e')]);router[_0x1d10('0x1f')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),interaction['tracked'](_0x1d10('0x1c'),_0x1d10('0x20')),controller[_0x1d10('0x21')]);router[_0x1d10('0x1f')](_0x1d10('0x17'),auth['isAuthenticated'](),controller['removeTags']);module[_0x1d10('0x22')]=router; \ No newline at end of file +var _0x2d72=['/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages'];(function(_0x897324,_0x55d105){var _0x2be419=function(_0x29362e){while(--_0x29362e){_0x897324['push'](_0x897324['shift']());}};_0x2be419(++_0x55d105);}(_0x2d72,0xa8));var _0x22d7=function(_0x354206,_0x246bfa){_0x354206=_0x354206-0x0;var _0x1f5514=_0x2d72[_0x354206];return _0x1f5514;};'use strict';var multer=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var path=require(_0x22d7('0x2'));var timeout=require(_0x22d7('0x3'));var express=require(_0x22d7('0x4'));var router=express[_0x22d7('0x5')]();var fs_extra=require(_0x22d7('0x6'));var auth=require(_0x22d7('0x7'));var interaction=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var controller=require(_0x22d7('0xa'));router[_0x22d7('0xb')]('/',auth[_0x22d7('0xc')](),controller[_0x22d7('0xd')]);router['get'](_0x22d7('0xe'),auth[_0x22d7('0xc')](),controller['describe']);router[_0x22d7('0xb')](_0x22d7('0xf'),auth[_0x22d7('0xc')](),controller[_0x22d7('0x10')]);router['get']('/:id/messages',auth[_0x22d7('0xc')](),controller[_0x22d7('0x11')]);router[_0x22d7('0xb')](_0x22d7('0x12'),auth[_0x22d7('0xc')](),controller['download']);router['post']('/',auth[_0x22d7('0xc')](),controller['create']);router[_0x22d7('0x13')](_0x22d7('0x14'),auth['isAuthenticated'](),controller[_0x22d7('0x15')]);router[_0x22d7('0x13')](_0x22d7('0x16'),auth[_0x22d7('0xc')](),interaction[_0x22d7('0x17')](_0x22d7('0x18'),_0x22d7('0x19')),controller[_0x22d7('0x1a')]);router['put'](_0x22d7('0xf'),auth[_0x22d7('0xc')](),interaction[_0x22d7('0x17')]('whatsapp','whatsappinteraction:update'),controller['update']);router[_0x22d7('0x1b')](_0x22d7('0xf'),auth[_0x22d7('0xc')](),interaction[_0x22d7('0x17')](_0x22d7('0x18'),'whatsappinteraction:destroy'),controller[_0x22d7('0x1c')]);router[_0x22d7('0x1b')](_0x22d7('0x16'),auth['isAuthenticated'](),controller[_0x22d7('0x1d')]);module[_0x22d7('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 8a75b15..c5dbd7f 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 _0x17c4=['out','ENUM','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x17c4,0x102));var _0x417c=function(_0x1c1fda,_0x1b076d){_0x1c1fda=_0x1c1fda-0x0;var _0xd76da7=_0x17c4[_0x1c1fda];return _0xd76da7;};'use strict';var Sequelize=require(_0x417c('0x0'));var moment=require(_0x417c('0x1'));module[_0x417c('0x2')]={'closed':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x417c('0x4')]},'disposition':{'type':Sequelize[_0x417c('0x5')]},'secondDisposition':{'type':Sequelize[_0x417c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x417c('0x5')]},'note':{'type':Sequelize[_0x417c('0x5')]},'phone':{'type':Sequelize[_0x417c('0x5')]},'read1stAt':{'type':Sequelize[_0x417c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x417c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x417c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x417c('0x7')]('in',_0x417c('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x11e5=['exports','BOOLEAN','STRING','out','DATE','ENUM','sequelize'];(function(_0x38aa12,_0x463127){var _0x249863=function(_0x3063d5){while(--_0x3063d5){_0x38aa12['push'](_0x38aa12['shift']());}};_0x249863(++_0x463127);}(_0x11e5,0x8b));var _0x511e=function(_0x56ce7d,_0x57d050){_0x56ce7d=_0x56ce7d-0x0;var _0x72a880=_0x11e5[_0x56ce7d];return _0x72a880;};'use strict';var Sequelize=require(_0x511e('0x0'));var moment=require('moment');module[_0x511e('0x1')]={'closed':{'type':Sequelize[_0x511e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x511e('0x3')]},'secondDisposition':{'type':Sequelize[_0x511e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x511e('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x511e('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x511e('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x511e('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x511e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 658d3a0..ba0ff53 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 _0x0c8d=['$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','role','toString','sequelize','keyBy','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','include','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','name','Users','map','fullname','TagIds','Tags','split','push','waiting','talking','answered','total','closed','UserId','unmanaged','index','WhatsappInteraction','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','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','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','find','unreadMessages','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)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','parse'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x0c8d,0x79));var _0xd0c8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0c8d[_0x1b6186];return _0x186121;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0c8('0x0'));var zipdir=require(_0xd0c8('0x1'));var jsonpatch=require(_0xd0c8('0x2'));var rp=require(_0xd0c8('0x3'));var moment=require(_0xd0c8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd0c8('0x5'));var csv=require(_0xd0c8('0x6'));var ejs=require(_0xd0c8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c8('0x8'));var squel=require('squel');var crypto=require(_0xd0c8('0x9'));var jsforce=require(_0xd0c8('0xa'));var deskjs=require(_0xd0c8('0xb'));var toCsv=require(_0xd0c8('0x6'));var querystring=require(_0xd0c8('0xc'));var Papa=require('papaparse');var Redis=require(_0xd0c8('0xd'));var authService=require(_0xd0c8('0xe'));var qs=require(_0xd0c8('0xf'));var as=require(_0xd0c8('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0c8('0x11'))(_0xd0c8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd0c8('0x13')](config[_0xd0c8('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0c8('0x15'))(new Redis(config[_0xd0c8('0x14')]));require(_0xd0c8('0x16'))[_0xd0c8('0x17')](socket);function respondWithStatusCode(_0x1a637f,_0x39f5ae){_0x39f5ae=_0x39f5ae||0xcc;return function(_0x112b53){if(_0x112b53){return _0x1a637f[_0xd0c8('0x18')](_0x39f5ae);}return _0x1a637f[_0xd0c8('0x19')](_0x39f5ae)[_0xd0c8('0x1a')]();};}function respondWithResult(_0x1d100c,_0x1903f1){_0x1903f1=_0x1903f1||0xc8;return function(_0x58c3e0){if(_0x58c3e0){return _0x1d100c[_0xd0c8('0x19')](_0x1903f1)[_0xd0c8('0x1b')](_0x58c3e0);}};}function respondWithFilteredResult(_0x34a80d,_0x5d02a5){return function(_0x59b06f){if(_0x59b06f){var _0x32e360=typeof _0x5d02a5['offset']==='undefined'&&typeof _0x5d02a5[_0xd0c8('0x1c')]===_0xd0c8('0x1d');var _0x5b6b6f=_0x59b06f[_0xd0c8('0x1e')];var _0x42ba67=_0x32e360?0x0:_0x5d02a5['offset'];var _0x1a5a3d=_0x32e360?_0x59b06f[_0xd0c8('0x1e')]:_0x5d02a5[_0xd0c8('0x1f')]+_0x5d02a5[_0xd0c8('0x1c')];var _0x15bf62;if(_0x1a5a3d>=_0x5b6b6f){_0x1a5a3d=_0x5b6b6f;_0x15bf62=0xc8;}else{_0x15bf62=0xce;}_0x34a80d[_0xd0c8('0x19')](_0x15bf62);return _0x34a80d[_0xd0c8('0x20')](_0xd0c8('0x21'),_0x42ba67+'-'+_0x1a5a3d+'/'+_0x5b6b6f)[_0xd0c8('0x1b')](_0x59b06f);}return null;};}function patchUpdates(_0x352531){return function(_0x1e3536){try{jsonpatch[_0xd0c8('0x22')](_0x1e3536,_0x352531,!![]);}catch(_0x30d143){return BPromise[_0xd0c8('0x23')](_0x30d143);}return _0x1e3536[_0xd0c8('0x24')]();};}function saveUpdates(_0x1fbe73,_0x387584){return function(_0x2325f4){if(_0x2325f4){return _0x2325f4[_0xd0c8('0x25')](_0x1fbe73)['then'](function(_0x49fa75){return _0x49fa75;});}return null;};}function removeEntity(_0xc109ee,_0x41cfd9){return function(_0x3fcfa7){if(_0x3fcfa7){return _0x3fcfa7[_0xd0c8('0x26')]()[_0xd0c8('0x27')](function(){_0xc109ee[_0xd0c8('0x19')](0xcc)[_0xd0c8('0x1a')]();});}};}function handleEntityNotFound(_0x3548b2,_0xdc380c){return function(_0x513206){if(!_0x513206){_0x3548b2[_0xd0c8('0x18')](0x194);}return _0x513206;};}function handleError(_0x3faa1b,_0x160032){_0x160032=_0x160032||0x1f4;return function(_0x5b3f45){logger['error'](_0x5b3f45['stack']);if(_0x5b3f45[_0xd0c8('0x28')]){delete _0x5b3f45['name'];}_0x3faa1b[_0xd0c8('0x19')](_0x160032)['send'](_0x5b3f45);};}function getInteractionUsers(_0x2e8c33,_0x10fe0a){return new BPromise(function(_0x4abb89,_0x30336a){try{if(_0x10fe0a[_0x2e8c33['id']]){_0x2e8c33[_0xd0c8('0x29')]=_[_0xd0c8('0x2a')](_0x10fe0a[_0x2e8c33['id']],function(_0x50fb7c){return{'id':_0x50fb7c['id'],'fullname':_0x50fb7c[_0xd0c8('0x2b')]};});}}catch(_0x155eaa){_0x30336a(_0x155eaa);}_0x4abb89(_0x2e8c33);});}function getInteractionTags(_0x39ca0f,_0x21d7fb){return new BPromise(function(_0x87f472,_0x1f4b11){try{if(_0x39ca0f[_0xd0c8('0x2c')]){_0x39ca0f[_0xd0c8('0x2d')]=[];_0x39ca0f[_0xd0c8('0x2c')][_0xd0c8('0x2e')](',')['forEach'](function(_0x4ec541){_0x39ca0f['Tags'][_0xd0c8('0x2f')](_0x21d7fb[_0x4ec541]);});}delete _0x39ca0f['TagIds'];}catch(_0xf60971){_0x1f4b11(_0xf60971);}_0x87f472(_0x39ca0f);});}function updateWhatsappInteraction(_0x54d8cf,_0x357799,_0x6de030){return new BPromise(function(_0x1a6450,_0x4075ec){return getInteractionUsers(_0x54d8cf,_0x6de030)[_0xd0c8('0x27')](function(_0x2e94a6){return getInteractionTags(_0x2e94a6,_0x357799);})[_0xd0c8('0x27')](function(_0x481cef){return getStateInteraction(_0x481cef);})[_0xd0c8('0x27')](function(_0x31e000){_0x1a6450(_0x31e000);})['catch'](function(_0x2ac901){_0x4075ec(_0x2ac901);});});}function getStateInteraction(_0x47643c){return new BPromise(function(_0x321fe7){_0x47643c[_0xd0c8('0x30')]=0x0;_0x47643c[_0xd0c8('0x31')]=0x0;_0x47643c[_0xd0c8('0x32')]=0x0;_0x47643c['unmanaged']=0x0;_0x47643c[_0xd0c8('0x33')]=0x0;if(!_0x47643c[_0xd0c8('0x34')]&&!_0x47643c[_0xd0c8('0x35')]){_0x47643c[_0xd0c8('0x30')]+=0x1;}if(!_0x47643c[_0xd0c8('0x34')]&&_0x47643c[_0xd0c8('0x35')]){_0x47643c[_0xd0c8('0x31')]+=0x1;if(_0x47643c['waiting']){_0x47643c[_0xd0c8('0x30')]-=0x1;}}if(_0x47643c[_0xd0c8('0x34')]&&_0x47643c[_0xd0c8('0x35')]){_0x47643c['answered']+=0x1;if(_0x47643c[_0xd0c8('0x31')]){_0x47643c[_0xd0c8('0x31')]-=0x1;}}if(_0x47643c[_0xd0c8('0x34')]&&!_0x47643c[_0xd0c8('0x35')]){_0x47643c[_0xd0c8('0x36')]+=0x1;if(_0x47643c[_0xd0c8('0x30')]){_0x47643c[_0xd0c8('0x30')]-=0x1;}}_0x47643c['total']+=0x1;_0x321fe7(_0x47643c);});}exports[_0xd0c8('0x37')]=function(_0x49c947,_0x341525){var _0x1a84c7={},_0x226422={},_0x1470c4={'count':0x0,'rows':[]};var _0x4744b7=_['map'](db[_0xd0c8('0x38')]['rawAttributes'],function(_0x39481a){return{'name':_0x39481a[_0xd0c8('0x39')],'type':_0x39481a['type']['key']};});_0x226422[_0xd0c8('0x3a')]=_[_0xd0c8('0x2a')](_0x4744b7,_0xd0c8('0x28'));_0x226422[_0xd0c8('0x3b')]=_[_0xd0c8('0x3c')](_0x49c947[_0xd0c8('0x3b')]);_0x226422[_0xd0c8('0x3d')]=_[_0xd0c8('0x3e')](_0x226422['model'],_0x226422[_0xd0c8('0x3b')]);_0x1a84c7[_0xd0c8('0x3f')]=_[_0xd0c8('0x3e')](_0x226422[_0xd0c8('0x3a')],qs[_0xd0c8('0x40')](_0x49c947['query'][_0xd0c8('0x40')]));_0x1a84c7[_0xd0c8('0x3f')]=_0x1a84c7[_0xd0c8('0x3f')][_0xd0c8('0x41')]?_0x1a84c7[_0xd0c8('0x3f')]:_0x226422[_0xd0c8('0x3a')];if(!_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x42')](_0xd0c8('0x43'))){_0x1a84c7['limit']=qs[_0xd0c8('0x1c')](_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x1c')]);_0x1a84c7['offset']=qs[_0xd0c8('0x1f')](_0x49c947['query']['offset']);}_0x1a84c7['order']=qs[_0xd0c8('0x44')](_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x44')]);_0x1a84c7[_0xd0c8('0x45')]=qs['filters'](_[_0xd0c8('0x46')](_0x49c947[_0xd0c8('0x3b')],_0x226422['filters']),_0x4744b7);var _0x21d89c=[];var _0x2e598d=squel['select']()[_0xd0c8('0x47')]('id')[_0xd0c8('0x47')](_0xd0c8('0x28'))['field'](_0xd0c8('0x48'))[_0xd0c8('0x49')](_0xd0c8('0x4a'));var _0x180bad=squel['select']()[_0xd0c8('0x47')](_0xd0c8('0x4b'))['field'](_0xd0c8('0x4c'))['field'](_0xd0c8('0x4d'))[_0xd0c8('0x49')](_0xd0c8('0x4e'),'ui')[_0xd0c8('0x4f')](_0xd0c8('0x50'),'u',_0xd0c8('0x51'));var _0x382ee2=squel['select']()[_0xd0c8('0x49')](_0xd0c8('0x52'),'i')['left_join'](_0xd0c8('0x53'),'c',_0xd0c8('0x54'))[_0xd0c8('0x4f')](_0xd0c8('0x50'),'o','o.id\x20=\x20i.UserId')[_0xd0c8('0x4f')]('whatsapp_accounts','a',_0xd0c8('0x55'))[_0xd0c8('0x4f')](_0xd0c8('0x56'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join']('whatsapp_interaction_has_tags','it',_0xd0c8('0x57'))[_0xd0c8('0x4f')](_0xd0c8('0x4a'),'t',_0xd0c8('0x58'));var _0x1ba22c=squel[_0xd0c8('0x59')]();var _0x2f6a66=[];var _0x190332=squel['expr']();var _0x106182;if(_0x49c947[_0xd0c8('0x3b')]['search']){_0x106182=as['parseSearch'](_0x49c947['query']['search']);var _0x1c1a63=_0x106182[_0xd0c8('0x5a')];for(var _0xc28721=0x0;_0xc28721<_0x106182[_0xd0c8('0x5b')][_0xd0c8('0x41')];_0xc28721++){var _0xef7a23=_0x106182['conditions'][_0xc28721];var _0x1bf350='i';var _0x1f5ad1=_[_0xd0c8('0x5c')](_0x4744b7,['name',_0xef7a23[_0xd0c8('0x47')]]);if(!_0x1f5ad1){switch(_0xef7a23[_0xd0c8('0x47')]){case _0xd0c8('0x5d'):if(_0xef7a23['value']==0x1){_0x382ee2[_0xd0c8('0x5e')]('`'+_0xef7a23['field']+'`\x20=\x200');}else{_0x382ee2[_0xd0c8('0x5e')]('`'+_0xef7a23['field']+_0xd0c8('0x5f'));}break;case _0xd0c8('0x60'):if(_0xef7a23[_0xd0c8('0x61')]===_0xd0c8('0x62')){if(_0xef7a23['value'][_0xd0c8('0x2e')]('\x20')['length']>0x1){_0x1ba22c[_0x1c1a63](_0xd0c8('0x63'),qs['getFullTextValue'](_0xef7a23[_0xd0c8('0x64')]),null);}else{var _0xe4d8ea='%'+_0xef7a23[_0xd0c8('0x64')]+'%';_0x1ba22c[_0x1c1a63](_0xd0c8('0x65'),_0xe4d8ea,_0xe4d8ea,_0xe4d8ea);}}else{_0x1f5ad1=_[_0xd0c8('0x5c')](_0x4744b7,[_0xd0c8('0x28'),_0xd0c8('0x66')]);_0xef7a23[_0xd0c8('0x47')]=_0xd0c8('0x66');_0x296696=as[_0xd0c8('0x67')](_0x1bf350,_0x1f5ad1[_0xd0c8('0x68')],_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696[_0xd0c8('0x69')],_0x296696[_0xd0c8('0x64')]['start'],_0x296696[_0xd0c8('0x64')][_0xd0c8('0x1a')]);}break;case _0xd0c8('0x6a'):var _0x2a7bbc=_0xef7a23[_0xd0c8('0x64')][_0xd0c8('0x2e')](',')[_0xd0c8('0x2a')](function(_0x5da021){return Number(_0x5da021);});_0x2a7bbc[_0xd0c8('0x6b')](function(_0x5ebd75){_0x190332['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ebd75+',%');});_0x2f6a66=_[_0xd0c8('0x6c')](_0x2f6a66,_0x2a7bbc);break;case _0xd0c8('0x6d'):if(_0xef7a23[_0xd0c8('0x61')]===_0xd0c8('0x62')){_0x1ba22c[_0x1c1a63](_0xd0c8('0x6e'),'%'+_0xef7a23[_0xd0c8('0x64')]+'%',null);}else{_0x1f5ad1=_['find'](_0x4744b7,['name','UserId']);_0xef7a23[_0xd0c8('0x47')]=_0xd0c8('0x35');_0x296696=as[_0xd0c8('0x67')](_0x1bf350,_0x1f5ad1[_0xd0c8('0x68')],_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696[_0xd0c8('0x69')],_0x296696['value']['start'],_0x296696[_0xd0c8('0x64')]['end']);}break;case _0xd0c8('0x6f'):_0x296696=as[_0xd0c8('0x67')]('me',null,_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696[_0xd0c8('0x69')],_0x296696[_0xd0c8('0x64')]['start'],_0x296696[_0xd0c8('0x64')]['end']);break;}}else{var _0x296696=as['buildExpression'](_0x1bf350,_0x1f5ad1['type'],_0xef7a23);_0x1ba22c[_0x1c1a63](_0x296696['text'],_0x296696[_0xd0c8('0x64')][_0xd0c8('0x70')],_0x296696[_0xd0c8('0x64')]['end']);}}}else{var _0x5486af=_(_0x49c947['query'])['keys']()[_0xd0c8('0x2a')](function(_0x6466ca){return _[_0xd0c8('0x71')](_0x4744b7,['name',_0x6466ca])?_0x6466ca:undefined;})[_0xd0c8('0x72')]()['value']();if(!_[_0xd0c8('0x73')](_0x5486af)){_0x5486af[_0xd0c8('0x6b')](function(_0x5c2571){if(_0x5c2571===_0xd0c8('0x74')){_0x382ee2['where'](_0xd0c8('0x75'),[]['concat'](_0x49c947[_0xd0c8('0x3b')][_0x5c2571]));}else if(_0x5c2571==='createdAt'){var _0x368590=JSON[_0xd0c8('0x76')](_0x49c947[_0xd0c8('0x3b')][_0x5c2571])[_0xd0c8('0x77')];var _0x594172=JSON['parse'](_0x49c947[_0xd0c8('0x3b')][_0x5c2571])[_0xd0c8('0x78')];_0x382ee2[_0xd0c8('0x45')](_0xd0c8('0x79'),_0x368590,_0x594172);}else{if(_0x49c947['query'][_0x5c2571]===_0xd0c8('0x7a')){_0x382ee2[_0xd0c8('0x45')]('i.'+_0x5c2571+_0xd0c8('0x7b'));}else{_0x382ee2[_0xd0c8('0x45')]('i.'+_0x5c2571+_0xd0c8('0x7c'),_0x49c947[_0xd0c8('0x3b')][_0x5c2571]);}}});}if(_0x49c947['query'][_0xd0c8('0x7d')]){if(_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x7d')]==0x1){_0x382ee2[_0xd0c8('0x5e')](_0xd0c8('0x7e'));}else{_0x382ee2['having'](_0xd0c8('0x7f'));}}if(_0x49c947['query'][_0xd0c8('0x80')]){_0x2f6a66=_[_0xd0c8('0x81')](_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x80')])?_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x80')]:new Array(_0x49c947[_0xd0c8('0x3b')]['tag']);_0x2f6a66[_0xd0c8('0x6b')](function(_0x2c02cc){_0x190332['or'](_0xd0c8('0x82'),'%,'+_0x2c02cc+',%');});}if(_0x49c947['query'][_0xd0c8('0x83')]){var _0x59d2d3=_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x83')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd0c8('0x84')](_0x59d2d3)){_0x1ba22c['or']('i.id\x20LIKE\x20?',_0x59d2d3+'%')['or'](_0xd0c8('0x85'),_0x59d2d3+'%');}else{_0x1ba22c['or'](_0xd0c8('0x86'),qs[_0xd0c8('0x87')](_0x59d2d3))['or'](_0xd0c8('0x88'),_0x59d2d3+'%');}}}_0x382ee2[_0xd0c8('0x45')](_0x1ba22c);_0x382ee2[_0xd0c8('0x89')](_0xd0c8('0x8a'));var _0x58446b={'type':db[_0xd0c8('0x8b')]['QueryTypes'][_0xd0c8('0x8c')],'raw':!![]};var _0x5de7c9=_0x382ee2[_0xd0c8('0x8d')]();_0x5de7c9[_0xd0c8('0x47')](_0xd0c8('0x8a'));_0x5de7c9['field'](_0xd0c8('0x8e'),_0xd0c8('0x5d'));if(_0x1a84c7[_0xd0c8('0x8f')]){_0x1a84c7['order'][_0xd0c8('0x6b')](function(_0x10d1dd){var _0xbf24ec=_0x10d1dd[0x0]===_0xd0c8('0x90')?_0x10d1dd[0x0]:'i.'+_0x10d1dd[0x0];_0x382ee2[_0xd0c8('0x8f')](_0xbf24ec,_0x10d1dd[0x1]===_0xd0c8('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x2f6a66)){_0x382ee2[_0xd0c8('0x5e')](_0x190332);_0x5de7c9[_0xd0c8('0x45')](_0xd0c8('0x92'),_0x2f6a66);}BPromise[_0xd0c8('0x93')]()['then'](function(){if(!_0x106182){if(_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x74')])return;_0x5de7c9[_0xd0c8('0x45')](_0xd0c8('0x94'));_0x382ee2['where'](_0xd0c8('0x94'));return;}if(_0x49c947['user']['role']!==_0xd0c8('0x95'))return;return _0x49c947['user'][_0xd0c8('0x96')]({'attributes':['id'],'raw':!![]})[_0xd0c8('0x27')](function(_0x1cc44b){if(_['isEmpty'](_0x1cc44b)){_0x5de7c9[_0xd0c8('0x45')](_0xd0c8('0x97'));_0x382ee2[_0xd0c8('0x45')](_0xd0c8('0x97'));}else{_0x5de7c9[_0xd0c8('0x45')]('i.WhatsappAccountId\x20IN\x20?',_[_0xd0c8('0x2a')](_0x1cc44b,'id'));_0x382ee2[_0xd0c8('0x45')](_0xd0c8('0x75'),_[_0xd0c8('0x2a')](_0x1cc44b,'id'));}});})['then'](function(){if(_0x49c947[_0xd0c8('0x98')][_0xd0c8('0x99')]===_0xd0c8('0x95')&&!_0x106182&&!_0x49c947[_0xd0c8('0x3b')][_0xd0c8('0x74')])return[];return db['sequelize'][_0xd0c8('0x3b')](_0x5de7c9[_0xd0c8('0x9a')](),_0x58446b);})[_0xd0c8('0x27')](function(_0x2cd90d){_0x1470c4[_0xd0c8('0x1e')]=_0x2cd90d[_0xd0c8('0x41')];if(_0x1470c4[_0xd0c8('0x1e')]===0x0)return[];return db[_0xd0c8('0x9b')][_0xd0c8('0x3b')](_0x2e598d[_0xd0c8('0x9a')](),_0x58446b)[_0xd0c8('0x27')](function(_0xdcccd9){_0x21d89c=_[_0xd0c8('0x9c')](_0xdcccd9,'id');_0x58446b=_[_0xd0c8('0x9d')](_0x58446b,{'model':db[_0xd0c8('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49c947['query']['fields']){_0x1a84c7[_0xd0c8('0x3f')][_0xd0c8('0x6b')](function(_0x220bbd){_0x382ee2[_0xd0c8('0x47')]('i.'+_0x220bbd);});}else{_0x382ee2[_0xd0c8('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd0c8('0x5d'));_0x382ee2['field'](_0xd0c8('0x9e'),'Account.key');_0x382ee2[_0xd0c8('0x47')]('a.mandatoryDisposition',_0xd0c8('0x9f'));_0x382ee2['field'](_0xd0c8('0xa0'),'contactName');_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa1'));_0x382ee2[_0xd0c8('0x47')]('c.firstName','Contact.firstName');_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa2'),'Contact.lastName');_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa3'),_0xd0c8('0xa4'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa5'),_0xd0c8('0xa6'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa7'),_0xd0c8('0xa8'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xa9'),_0xd0c8('0xaa'));_0x382ee2[_0xd0c8('0x47')]('o.fullname',_0xd0c8('0xab'));_0x382ee2['field'](_0xd0c8('0xac'),_0xd0c8('0xad'));_0x382ee2[_0xd0c8('0x47')](_0xd0c8('0xae'),_0xd0c8('0x2c'));}if(_0x1a84c7[_0xd0c8('0x1c')])_0x382ee2[_0xd0c8('0x1c')](_0x1a84c7[_0xd0c8('0x1c')]);if(_0x1a84c7[_0xd0c8('0x1f')])_0x382ee2[_0xd0c8('0x1f')](_0x1a84c7[_0xd0c8('0x1f')]);return db[_0xd0c8('0x9b')][_0xd0c8('0x3b')](_0x382ee2[_0xd0c8('0x9a')](),_0x58446b);})[_0xd0c8('0x27')](function(_0x496dbd){if(_0x496dbd['length']>0x0)_0x180bad[_0xd0c8('0x45')](_0xd0c8('0xaf'),_[_0xd0c8('0x2a')](_0x496dbd,'id'));return db['sequelize'][_0xd0c8('0x3b')](_0x180bad[_0xd0c8('0x9a')](),_0x58446b)[_0xd0c8('0x27')](function(_0x391aa6){var _0x38f86e=_[_0xd0c8('0xb0')](_0x391aa6,_0xd0c8('0xb1'));var _0x258472=[];_0x496dbd['forEach'](function(_0x210cec){_0x258472[_0xd0c8('0x2f')](updateWhatsappInteraction(_0x210cec,_0x21d89c,_0x38f86e));});return BPromise[_0xd0c8('0xb2')](_0x258472);});});})['then'](function(_0x80b812){_0x1470c4[_0xd0c8('0xb3')]=_0x80b812;return _0x1470c4;})[_0xd0c8('0x27')](respondWithFilteredResult(_0x341525,_0x1a84c7))[_0xd0c8('0xb4')](handleError(_0x341525,null));};exports[_0xd0c8('0xb5')]=function(_0x4b9cd3,_0x3dc995){var _0xdc350={'raw':![],'where':{'id':_0x4b9cd3[_0xd0c8('0xb6')]['id']}},_0x5b8bb8={};_0x5b8bb8[_0xd0c8('0x3a')]=_[_0xd0c8('0x3c')](db[_0xd0c8('0x38')]['rawAttributes']);_0x5b8bb8['query']=_[_0xd0c8('0x3c')](_0x4b9cd3['query']);_0x5b8bb8[_0xd0c8('0x3d')]=_[_0xd0c8('0x3e')](_0x5b8bb8[_0xd0c8('0x3a')],_0x5b8bb8['query']);_0xdc350[_0xd0c8('0x3f')]=_[_0xd0c8('0x3e')](_0x5b8bb8['model'],qs[_0xd0c8('0x40')](_0x4b9cd3['query'][_0xd0c8('0x40')]));_0xdc350[_0xd0c8('0x3f')]=_0xdc350[_0xd0c8('0x3f')][_0xd0c8('0x41')]?_0xdc350[_0xd0c8('0x3f')]:_0x5b8bb8['model'];if(_0x4b9cd3['query']['includeAll']){_0xdc350[_0xd0c8('0xb7')]=[{'all':!![]}];}_0xdc350=_[_0xd0c8('0x9d')]({},_0xdc350,_0x4b9cd3['options']);return db[_0xd0c8('0x38')][_0xd0c8('0x5c')](_0xdc350)[_0xd0c8('0x27')](handleEntityNotFound(_0x3dc995,null))[_0xd0c8('0x27')](respondWithResult(_0x3dc995,null))['catch'](handleError(_0x3dc995,null));};exports[_0xd0c8('0xb8')]=function(_0x26907a,_0x520580){return db[_0xd0c8('0x38')][_0xd0c8('0xb8')](_0x26907a['body'],{})[_0xd0c8('0x27')](respondWithResult(_0x520580,0xc9))[_0xd0c8('0xb4')](handleError(_0x520580,null));};exports[_0xd0c8('0x25')]=function(_0x556adc,_0x3349c3){if(_0x556adc[_0xd0c8('0x6f')]['id']){delete _0x556adc[_0xd0c8('0x6f')]['id'];}return db['WhatsappInteraction'][_0xd0c8('0x5c')]({'where':{'id':_0x556adc[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x3349c3,null))[_0xd0c8('0x27')](saveUpdates(_0x556adc[_0xd0c8('0x6f')],null))['then'](respondWithResult(_0x3349c3,null))['catch'](handleError(_0x3349c3,null));};exports[_0xd0c8('0x26')]=function(_0x30a436,_0x34cf4f){return db[_0xd0c8('0x38')]['find']({'where':{'id':_0x30a436[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x34cf4f,null))[_0xd0c8('0x27')](removeEntity(_0x34cf4f,null))['catch'](handleError(_0x34cf4f,null));};exports['describe']=function(_0x515550,_0x33cf99){return db['WhatsappInteraction'][_0xd0c8('0xb9')]()[_0xd0c8('0x27')](respondWithResult(_0x33cf99,null))[_0xd0c8('0xb4')](handleError(_0x33cf99,null));};exports[_0xd0c8('0xba')]=function(_0x1af5b4,_0x5979ba,_0x21f567){return db[_0xd0c8('0xbb')][_0xd0c8('0x5c')]({'where':{'id':_0x1af5b4[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x5979ba,null))[_0xd0c8('0x27')](function(_0xc11fc4){if(_0xc11fc4){return _0xc11fc4['addMessage'](_0x1af5b4['body'][_0xd0c8('0xbc')],_[_0xd0c8('0xbd')](_0x1af5b4[_0xd0c8('0x6f')],[_0xd0c8('0xbc'),'id'])||{});}})[_0xd0c8('0x27')](respondWithResult(_0x5979ba,null))[_0xd0c8('0xb4')](handleError(_0x5979ba,null));};exports[_0xd0c8('0xbe')]=function(_0x54cc3f,_0x458c60,_0x1f5f17){var _0x347213={'raw':![],'where':{}};var _0x48afe4={};var _0x2ad453={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xd0c8('0xbf')]({'where':{'id':_0x54cc3f[_0xd0c8('0xb6')]['id']}})[_0xd0c8('0x27')](handleEntityNotFound(_0x458c60,null))[_0xd0c8('0x27')](function(_0xb90a94){if(_0xb90a94){_0x48afe4['model']=_[_0xd0c8('0x3c')](db[_0xd0c8('0xbb')]['rawAttributes']);_0x48afe4['query']=_[_0xd0c8('0x3c')](_0x54cc3f['query']);_0x48afe4[_0xd0c8('0x3d')]=_['intersection'](_0x48afe4[_0xd0c8('0x3a')],_0x48afe4[_0xd0c8('0x3b')]);_0x347213[_0xd0c8('0x3f')]=_[_0xd0c8('0x3e')](_0x48afe4[_0xd0c8('0x3a')],qs[_0xd0c8('0x40')](_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x40')]));_0x347213[_0xd0c8('0x3f')]=_0x347213[_0xd0c8('0x3f')][_0xd0c8('0x41')]?_0x347213['attributes']:_0x48afe4[_0xd0c8('0x3a')];if(!_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x42')]('nolimit')){_0x347213[_0xd0c8('0x1c')]=qs['limit'](_0x54cc3f['query'][_0xd0c8('0x1c')]);_0x347213[_0xd0c8('0x1f')]=qs[_0xd0c8('0x1f')](_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x1f')]);}_0x347213['order']=qs[_0xd0c8('0x44')](_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x44')]);_0x347213[_0xd0c8('0x45')]=qs['filters'](_[_0xd0c8('0x46')](_0x54cc3f['query'],_0x48afe4[_0xd0c8('0x3d')]));_0x347213[_0xd0c8('0x45')][_0xd0c8('0xb1')]=_0xb90a94['id'];if(_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x83')]){_0x347213[_0xd0c8('0x45')]=_[_0xd0c8('0x9d')](_0x347213[_0xd0c8('0x45')],{'$or':_[_0xd0c8('0x2a')](_0x347213[_0xd0c8('0x3f')],function(_0x426622){var _0x780619={};_0x780619[_0x426622]={'$like':'%'+_0x54cc3f['query'][_0xd0c8('0x83')]+'%'};return _0x780619;})});}if(_0x54cc3f[_0xd0c8('0x3b')]['$gte']){var _0x275a0f=_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0x77')][_0xd0c8('0x2e')](',');var _0x464375={};_0x464375[_0x275a0f[0x0]]={'$gte':moment(_0x275a0f[0x1])[_0xd0c8('0xc0')](_0xd0c8('0xc1'))};_0x347213[_0xd0c8('0x45')]=_['merge'](_0x347213[_0xd0c8('0x45')],_0x464375);}_0x347213=_[_0xd0c8('0x9d')]({},_0x347213,_0x54cc3f[_0xd0c8('0xc2')]);return db['WhatsappMessage'][_0xd0c8('0x1e')]({'where':_0x347213[_0xd0c8('0x45')]})[_0xd0c8('0x27')](function(_0x663bd4){_0x2ad453['count']=_0x663bd4;if(_0x54cc3f[_0xd0c8('0x3b')][_0xd0c8('0xc3')]){_0x347213[_0xd0c8('0xb7')]=[{'all':!![]}];}return db[_0xd0c8('0xbb')]['findAll'](_0x347213);})[_0xd0c8('0x27')](function(_0x361efc){_0x2ad453[_0xd0c8('0xb3')]=_0x361efc;return _0x2ad453;});}})['then'](respondWithFilteredResult(_0x458c60,_0x347213))['catch'](handleError(_0x458c60,null));};exports[_0xd0c8('0xc4')]=function(_0x4d6dd4,_0x269cff,_0xc26209){return db['WhatsappInteraction']['find']({'where':{'id':_0x4d6dd4[_0xd0c8('0xb6')]['id']}})['then'](handleEntityNotFound(_0x269cff,null))['then'](function(_0x3a56c3){if(_0x3a56c3){return _0x3a56c3[_0xd0c8('0xc5')](_0x4d6dd4[_0xd0c8('0x6f')][_0xd0c8('0xbc')],_[_0xd0c8('0xbd')](_0x4d6dd4['body'],[_0xd0c8('0xbc'),'id'])||{})[_0xd0c8('0xc6')](function(){return db[_0xd0c8('0x6a')]['findAll']({'attributes':['id',_0xd0c8('0x28'),_0xd0c8('0x48')],'where':{'id':_0x4d6dd4[_0xd0c8('0x6f')][_0xd0c8('0xbc')]}});})[_0xd0c8('0x27')](function(_0x34db39){socket[_0xd0c8('0xc7')](_0xd0c8('0xc8'),{'id':Number(_0x4d6dd4[_0xd0c8('0xb6')]['id']),'tags':_0x34db39||[]});return{'id':Number(_0x4d6dd4['params']['id']),'tags':_0x34db39||[]};});}})[_0xd0c8('0x27')](respondWithResult(_0x269cff,null))[_0xd0c8('0xb4')](handleError(_0x269cff,null));};exports[_0xd0c8('0xc9')]=function(_0x3de5f2,_0x5a9ee5,_0x16fe9c){return db[_0xd0c8('0x38')][_0xd0c8('0x5c')]({'where':{'id':_0x3de5f2['params']['id']}})['then'](handleEntityNotFound(_0x5a9ee5,null))[_0xd0c8('0x27')](function(_0x8b88be){if(_0x8b88be){return _0x8b88be[_0xd0c8('0xc9')](_0x3de5f2[_0xd0c8('0x3b')][_0xd0c8('0xbc')]);}})[_0xd0c8('0x27')](respondWithStatusCode(_0x5a9ee5,null))[_0xd0c8('0xb4')](handleError(_0x5a9ee5,null));};exports[_0xd0c8('0xca')]=function(_0x4c797d,_0x77e4cf){var _0x195197=moment()[_0xd0c8('0xcb')]()[_0xd0c8('0x9a')]();var _0x2073cc=path[_0xd0c8('0xcc')](config[_0xd0c8('0xcd')],'server','files',_0xd0c8('0xce'));var _0x11b73b=path[_0xd0c8('0xcc')](config[_0xd0c8('0xcd')],_0xd0c8('0xcf'),'files',_0xd0c8('0xd0'));var _0xe75e62=path[_0xd0c8('0xcc')](_0x2073cc,_0x195197);var _0x5bbf8b=util['format'](_0xd0c8('0xd1'),_0x4c797d[_0xd0c8('0xb6')]['id'],_0x195197);var _0x225dad=path['join'](_0x2073cc,_0x5bbf8b);var _0x3bff30=[];_0x3bff30[_0xd0c8('0x2f')]({'model':db['User'],'as':'User','attributes':['id',_0xd0c8('0x2b')],'raw':!![]});_0x3bff30[_0xd0c8('0x2f')]({'model':db[_0xd0c8('0xd2')],'as':_0xd0c8('0x60'),'attributes':['id',_0xd0c8('0xd3'),_0xd0c8('0xd4')],'raw':!![]});if(_0x4c797d[_0xd0c8('0x3b')][_0xd0c8('0xd0')]){_0x3bff30[_0xd0c8('0x2f')]({'model':db[_0xd0c8('0xd5')],'as':_0xd0c8('0xd5'),'raw':!![]});}var _0x50af3e=[{'model':db[_0xd0c8('0xbb')],'as':_0xd0c8('0xd6'),'attributes':['id',_0xd0c8('0x6f'),_0xd0c8('0xd7'),_0xd0c8('0xd8'),_0xd0c8('0xd9'),'read'],'include':_0x3bff30}];_0x50af3e[_0xd0c8('0x2f')]({'model':db[_0xd0c8('0xda')],'as':_0xd0c8('0xdb'),'attributes':['id',_0xd0c8('0x28')]});_0x50af3e['push']({'model':db['User'],'as':_0xd0c8('0xdc'),'attributes':['id',_0xd0c8('0x2b')]});return db[_0xd0c8('0x38')][_0xd0c8('0x5c')]({'where':{'id':_0x4c797d[_0xd0c8('0xb6')]['id']},'include':_0x50af3e})['then'](handleEntityNotFound(_0x77e4cf,null))[_0xd0c8('0x27')](function(_0xc25571){if(_0xc25571){var _0x24350d=_0xc25571[_0xd0c8('0xdd')]({'plain':!![]});fs[_0xd0c8('0xde')](_0xe75e62);var _0x1fb836={'channel':_0xd0c8('0xdf'),'account':_0x24350d[_0xd0c8('0xdb')][_0xd0c8('0x28')],'agent':_0x24350d[_0xd0c8('0xdc')]?_0x24350d[_0xd0c8('0xdc')][_0xd0c8('0x2b')]:_0xd0c8('0xe0'),'createdAt':moment(_0x24350d[_0xd0c8('0xd7')])[_0xd0c8('0xc0')](_0xd0c8('0xc1'))[_0xd0c8('0x9a')](),'closedAt':_0x24350d['closed']?moment(_0x24350d[_0xd0c8('0xe1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd0c8('0x9a')]():'','disposition':_0x24350d[_0xd0c8('0xe2')],'messages':_(_0x24350d[_0xd0c8('0xd6')])[_0xd0c8('0x83')]({'secret':![]})[_0xd0c8('0x2a')](function(_0x2caf99){if(_0x2caf99[_0xd0c8('0xd5')]){var _0xa29ffd=path[_0xd0c8('0xcc')](_0x11b73b,_0x2caf99[_0xd0c8('0xd5')][_0xd0c8('0xe3')]);if(fs[_0xd0c8('0xe4')](_0xa29ffd)){fs['createReadStream'](_0xa29ffd)[_0xd0c8('0xe5')](fs[_0xd0c8('0xe6')](path[_0xd0c8('0xcc')](_0xe75e62,_0x2caf99[_0xd0c8('0xd5')][_0xd0c8('0xe3')])));}}return{'date':moment(_0x2caf99[_0xd0c8('0xd7')])[_0xd0c8('0xc0')](_0xd0c8('0xc1'))[_0xd0c8('0x9a')](),'sender':_0x2caf99[_0xd0c8('0xd8')]===_0xd0c8('0xe7')?_0x2caf99[_0xd0c8('0x6d')]?_0x2caf99['User'][_0xd0c8('0x2b')]:_0xd0c8('0xe8'):_0x2caf99[_0xd0c8('0x60')][_0xd0c8('0xd3')]+(_0x2caf99[_0xd0c8('0x60')]['lastName']?'\x20'+_0x2caf99[_0xd0c8('0x60')][_0xd0c8('0xd4')]:''),'body':_0x2caf99['Attachment']?_0x2caf99[_0xd0c8('0xd5')][_0xd0c8('0xe3')]:_0x2caf99['body'],'direction':_0x2caf99['direction']==='out'?'A':'C','secret':_0x2caf99[_0xd0c8('0xd9')],'read':_0x2caf99[_0xd0c8('0x7d')],'attachment':_0x2caf99[_0xd0c8('0xd5')]};})[_0xd0c8('0x64')]()};return ejs[_0xd0c8('0xe9')](path[_0xd0c8('0xcc')](config[_0xd0c8('0xcd')],'server',_0xd0c8('0xea'),_0xd0c8('0xeb')),{'interaction':_0x1fb836})[_0xd0c8('0x27')](function(_0x1311a5){var _0x174223=path[_0xd0c8('0xcc')](_0xe75e62,'transcript-'+_0x24350d['id']+'-'+_0x195197+_0xd0c8('0xec'));var _0x272daa={'path':_0x174223,'channel':_0xd0c8('0xdf'),'interactionId':_0x24350d['id']};return pdf[_0xd0c8('0xed')](_0x1311a5,_0x272daa);})['then'](function(){return new BPromise(function(_0x3edf51,_0x1068d2){zipdir(_0xe75e62,{'saveTo':_0x225dad},function(_0x17ec13,_0x34aa7a){if(_0x17ec13)return _0x1068d2(_0x17ec13);return _0x3edf51(_0x34aa7a);});})[_0xd0c8('0x27')](function(){return new BPromise(function(_0x38e739,_0x5978b0){rimraf(_0xe75e62,function(_0x496179){if(_0x496179)_0x5978b0(_0x496179);return _0x38e739();});});})['then'](function(){return _0x77e4cf[_0xd0c8('0xca')](_0x225dad,_0x5bbf8b,function(_0x4f46af){if(_0x4f46af){console[_0xd0c8('0xee')](_0xd0c8('0xef'),_0x4f46af);}else{fs['unlinkSync'](_0x225dad);}});});});}else{return _0x77e4cf[_0xd0c8('0x18')](0xc8);}})[_0xd0c8('0xb4')](handleError(_0x77e4cf,null));}; \ No newline at end of file +var _0x1e24=['buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','WhatsappAccountId','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','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','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','show','params','include','options','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','nolimit','includeAll','findAll','addTags','setTags','removeTags','download','join','server','files','tmp','root','attachments','format','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','secret','Account','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','out','System','direction','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','answered','unmanaged','total','closed','UserId','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','getFullTextValue','find','ContactId'];(function(_0x330919,_0x2e7cb7){var _0x5bef14=function(_0x4ba4c8){while(--_0x4ba4c8){_0x330919['push'](_0x330919['shift']());}};_0x5bef14(++_0x2e7cb7);}(_0x1e24,0x82));var _0x41e2=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0x1e24[_0x11f226];return _0x30be77;};'use strict';var emlformat=require(_0x41e2('0x0'));var rimraf=require(_0x41e2('0x1'));var zipdir=require(_0x41e2('0x2'));var jsonpatch=require(_0x41e2('0x3'));var rp=require('request-promise');var moment=require(_0x41e2('0x4'));var BPromise=require(_0x41e2('0x5'));var Mustache=require(_0x41e2('0x6'));var util=require(_0x41e2('0x7'));var path=require('path');var sox=require(_0x41e2('0x8'));var csv=require(_0x41e2('0x9'));var ejs=require(_0x41e2('0xa'));var fs=require('fs');var fs_extra=require(_0x41e2('0xb'));var _=require(_0x41e2('0xc'));var squel=require(_0x41e2('0xd'));var crypto=require(_0x41e2('0xe'));var jsforce=require(_0x41e2('0xf'));var deskjs=require(_0x41e2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x41e2('0x11'));var Papa=require(_0x41e2('0x12'));var Redis=require(_0x41e2('0x13'));var authService=require(_0x41e2('0x14'));var qs=require(_0x41e2('0x15'));var as=require(_0x41e2('0x16'));var pdf=require(_0x41e2('0x17'));var hardwareService=require(_0x41e2('0x18'));var logger=require(_0x41e2('0x19'))('api');var utils=require(_0x41e2('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x41e2('0x1b'));var db=require(_0x41e2('0x1c'))['db'];config[_0x41e2('0x1d')]=_['defaults'](config[_0x41e2('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x41e2('0x1e'))(new Redis(config['redis']));require(_0x41e2('0x1f'))[_0x41e2('0x20')](socket);function respondWithStatusCode(_0x44f807,_0x4b401e){_0x4b401e=_0x4b401e||0xcc;return function(_0x9aab16){if(_0x9aab16){return _0x44f807[_0x41e2('0x21')](_0x4b401e);}return _0x44f807[_0x41e2('0x22')](_0x4b401e)[_0x41e2('0x23')]();};}function respondWithResult(_0x491f50,_0x4041cd){_0x4041cd=_0x4041cd||0xc8;return function(_0x391c2a){if(_0x391c2a){return _0x491f50[_0x41e2('0x22')](_0x4041cd)[_0x41e2('0x24')](_0x391c2a);}};}function respondWithFilteredResult(_0x56b22d,_0x3dd4b7){return function(_0x463013){if(_0x463013){var _0x4505a6=typeof _0x3dd4b7[_0x41e2('0x25')]==='undefined'&&typeof _0x3dd4b7[_0x41e2('0x26')]===_0x41e2('0x27');var _0x3abe99=_0x463013[_0x41e2('0x28')];var _0x439d9c=_0x4505a6?0x0:_0x3dd4b7[_0x41e2('0x25')];var _0x3dc6be=_0x4505a6?_0x463013[_0x41e2('0x28')]:_0x3dd4b7[_0x41e2('0x25')]+_0x3dd4b7[_0x41e2('0x26')];var _0x2cb747;if(_0x3dc6be>=_0x3abe99){_0x3dc6be=_0x3abe99;_0x2cb747=0xc8;}else{_0x2cb747=0xce;}_0x56b22d[_0x41e2('0x22')](_0x2cb747);return _0x56b22d[_0x41e2('0x29')](_0x41e2('0x2a'),_0x439d9c+'-'+_0x3dc6be+'/'+_0x3abe99)[_0x41e2('0x24')](_0x463013);}return null;};}function patchUpdates(_0x46e9ae){return function(_0x2416fe){try{jsonpatch['apply'](_0x2416fe,_0x46e9ae,!![]);}catch(_0x892655){return BPromise['reject'](_0x892655);}return _0x2416fe[_0x41e2('0x2b')]();};}function saveUpdates(_0x24be7a,_0x198c9f){return function(_0x3dced4){if(_0x3dced4){return _0x3dced4[_0x41e2('0x2c')](_0x24be7a)[_0x41e2('0x2d')](function(_0x20a838){return _0x20a838;});}return null;};}function removeEntity(_0xb4aaad,_0x5ec732){return function(_0x4a10ad){if(_0x4a10ad){return _0x4a10ad[_0x41e2('0x2e')]()['then'](function(){_0xb4aaad['status'](0xcc)[_0x41e2('0x23')]();});}};}function handleEntityNotFound(_0x50c73d,_0x55aeba){return function(_0x18a14f){if(!_0x18a14f){_0x50c73d[_0x41e2('0x21')](0x194);}return _0x18a14f;};}function handleError(_0x43761d,_0x20df8a){_0x20df8a=_0x20df8a||0x1f4;return function(_0x314d8e){logger[_0x41e2('0x2f')](_0x314d8e['stack']);if(_0x314d8e[_0x41e2('0x30')]){delete _0x314d8e['name'];}_0x43761d[_0x41e2('0x22')](_0x20df8a)[_0x41e2('0x31')](_0x314d8e);};}function getInteractionUsers(_0x114ba1,_0x442062){return new BPromise(function(_0x3c4fe5,_0x575f92){try{if(_0x442062[_0x114ba1['id']]){_0x114ba1[_0x41e2('0x32')]=_[_0x41e2('0x33')](_0x442062[_0x114ba1['id']],function(_0x45ce6e){return{'id':_0x45ce6e['id'],'fullname':_0x45ce6e[_0x41e2('0x34')]};});}}catch(_0x271a24){_0x575f92(_0x271a24);}_0x3c4fe5(_0x114ba1);});}function getInteractionTags(_0x260589,_0x51a495){return new BPromise(function(_0x4c5dbb,_0x4330a1){try{if(_0x260589[_0x41e2('0x35')]){_0x260589[_0x41e2('0x36')]=[];_0x260589[_0x41e2('0x35')][_0x41e2('0x37')](',')[_0x41e2('0x38')](function(_0x9462f9){_0x260589[_0x41e2('0x36')]['push'](_0x51a495[_0x9462f9]);});}delete _0x260589[_0x41e2('0x35')];}catch(_0x2ed804){_0x4330a1(_0x2ed804);}_0x4c5dbb(_0x260589);});}function updateWhatsappInteraction(_0x4b130a,_0x39ec8c,_0x8deab1){return new BPromise(function(_0x4f8d36,_0x2ccc6b){return getInteractionUsers(_0x4b130a,_0x8deab1)[_0x41e2('0x2d')](function(_0xbb0b1d){return getInteractionTags(_0xbb0b1d,_0x39ec8c);})[_0x41e2('0x2d')](function(_0xb10977){return getStateInteraction(_0xb10977);})[_0x41e2('0x2d')](function(_0x2bbfcc){_0x4f8d36(_0x2bbfcc);})[_0x41e2('0x39')](function(_0x395cd7){_0x2ccc6b(_0x395cd7);});});}function getStateInteraction(_0x57963f){return new BPromise(function(_0x2a0fce){_0x57963f[_0x41e2('0x3a')]=0x0;_0x57963f[_0x41e2('0x3b')]=0x0;_0x57963f[_0x41e2('0x3c')]=0x0;_0x57963f[_0x41e2('0x3d')]=0x0;_0x57963f[_0x41e2('0x3e')]=0x0;if(!_0x57963f['closed']&&!_0x57963f['UserId']){_0x57963f[_0x41e2('0x3a')]+=0x1;}if(!_0x57963f[_0x41e2('0x3f')]&&_0x57963f[_0x41e2('0x40')]){_0x57963f[_0x41e2('0x3b')]+=0x1;if(_0x57963f[_0x41e2('0x3a')]){_0x57963f[_0x41e2('0x3a')]-=0x1;}}if(_0x57963f['closed']&&_0x57963f[_0x41e2('0x40')]){_0x57963f['answered']+=0x1;if(_0x57963f[_0x41e2('0x3b')]){_0x57963f[_0x41e2('0x3b')]-=0x1;}}if(_0x57963f[_0x41e2('0x3f')]&&!_0x57963f[_0x41e2('0x40')]){_0x57963f[_0x41e2('0x3d')]+=0x1;if(_0x57963f['waiting']){_0x57963f[_0x41e2('0x3a')]-=0x1;}}_0x57963f[_0x41e2('0x3e')]+=0x1;_0x2a0fce(_0x57963f);});}exports['index']=function(_0x1ee025,_0x190ac3){var _0x6c782e={},_0x19030b={},_0x2e848a={'count':0x0,'rows':[]};var _0x4a9058=_[_0x41e2('0x33')](db[_0x41e2('0x41')][_0x41e2('0x42')],function(_0x44fae1){return{'name':_0x44fae1[_0x41e2('0x43')],'type':_0x44fae1[_0x41e2('0x44')][_0x41e2('0x45')]};});_0x19030b[_0x41e2('0x46')]=_[_0x41e2('0x33')](_0x4a9058,_0x41e2('0x30'));_0x19030b['query']=_[_0x41e2('0x47')](_0x1ee025[_0x41e2('0x48')]);_0x19030b[_0x41e2('0x49')]=_[_0x41e2('0x4a')](_0x19030b[_0x41e2('0x46')],_0x19030b[_0x41e2('0x48')]);_0x6c782e[_0x41e2('0x4b')]=_[_0x41e2('0x4a')](_0x19030b['model'],qs['fields'](_0x1ee025[_0x41e2('0x48')][_0x41e2('0x4c')]));_0x6c782e[_0x41e2('0x4b')]=_0x6c782e[_0x41e2('0x4b')][_0x41e2('0x4d')]?_0x6c782e[_0x41e2('0x4b')]:_0x19030b[_0x41e2('0x46')];if(!_0x1ee025['query'][_0x41e2('0x4e')]('nolimit')){_0x6c782e['limit']=qs[_0x41e2('0x26')](_0x1ee025[_0x41e2('0x48')][_0x41e2('0x26')]);_0x6c782e['offset']=qs[_0x41e2('0x25')](_0x1ee025[_0x41e2('0x48')][_0x41e2('0x25')]);}_0x6c782e['order']=qs[_0x41e2('0x4f')](_0x1ee025[_0x41e2('0x48')][_0x41e2('0x4f')]);_0x6c782e[_0x41e2('0x50')]=qs[_0x41e2('0x49')](_[_0x41e2('0x51')](_0x1ee025[_0x41e2('0x48')],_0x19030b[_0x41e2('0x49')]),_0x4a9058);var _0x2b8bd0=[];var _0x40284f=squel[_0x41e2('0x52')]()[_0x41e2('0x53')]('id')[_0x41e2('0x53')](_0x41e2('0x30'))[_0x41e2('0x53')](_0x41e2('0x54'))[_0x41e2('0x55')]('tools_tags');var _0x11eb07=squel['select']()['field'](_0x41e2('0x56'))[_0x41e2('0x53')](_0x41e2('0x57'))['field'](_0x41e2('0x58'))['from'](_0x41e2('0x59'),'ui')[_0x41e2('0x5a')](_0x41e2('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x2a7943=squel[_0x41e2('0x52')]()[_0x41e2('0x55')](_0x41e2('0x5c'),'i')[_0x41e2('0x5a')](_0x41e2('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x41e2('0x5a')](_0x41e2('0x5b'),'o',_0x41e2('0x5e'))[_0x41e2('0x5a')]('whatsapp_accounts','a',_0x41e2('0x5f'))[_0x41e2('0x5a')](_0x41e2('0x60'),'me',_0x41e2('0x61'))[_0x41e2('0x5a')](_0x41e2('0x62'),'it',_0x41e2('0x63'))['left_join']('tools_tags','t',_0x41e2('0x64'));var _0x45b8b3=squel[_0x41e2('0x65')]();var _0x1124b3=[];var _0x2e432d=squel[_0x41e2('0x65')]();var _0x25cf3b;if(_0x1ee025[_0x41e2('0x48')]['search']){_0x25cf3b=as[_0x41e2('0x66')](_0x1ee025['query']['search']);var _0x499b2f=_0x25cf3b[_0x41e2('0x67')];for(var _0x9d25bd=0x0;_0x9d25bd<_0x25cf3b[_0x41e2('0x68')]['length'];_0x9d25bd++){var _0x517e0a=_0x25cf3b[_0x41e2('0x68')][_0x9d25bd];var _0x9814cc='i';var _0xd560c0=_['find'](_0x4a9058,['name',_0x517e0a['field']]);if(!_0xd560c0){switch(_0x517e0a['field']){case _0x41e2('0x69'):if(_0x517e0a[_0x41e2('0x6a')]==0x1){_0x2a7943[_0x41e2('0x6b')]('`'+_0x517e0a['field']+_0x41e2('0x6c'));}else{_0x2a7943[_0x41e2('0x6b')]('`'+_0x517e0a[_0x41e2('0x53')]+_0x41e2('0x6d'));}break;case'Contact':if(_0x517e0a[_0x41e2('0x6e')]==='$substring'){if(_0x517e0a['value'][_0x41e2('0x37')]('\x20')[_0x41e2('0x4d')]>0x1){_0x45b8b3[_0x499b2f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x41e2('0x6f')](_0x517e0a[_0x41e2('0x6a')]),null);}else{var _0x2ec3ba='%'+_0x517e0a['value']+'%';_0x45b8b3[_0x499b2f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2ec3ba,_0x2ec3ba,_0x2ec3ba);}}else{_0xd560c0=_[_0x41e2('0x70')](_0x4a9058,[_0x41e2('0x30'),_0x41e2('0x71')]);_0x517e0a[_0x41e2('0x53')]=_0x41e2('0x71');_0x3e622b=as[_0x41e2('0x72')](_0x9814cc,_0xd560c0[_0x41e2('0x44')],_0x517e0a);_0x45b8b3[_0x499b2f](_0x3e622b[_0x41e2('0x73')],_0x3e622b[_0x41e2('0x6a')][_0x41e2('0x74')],_0x3e622b['value'][_0x41e2('0x23')]);}break;case _0x41e2('0x75'):var _0xe3d74b=_0x517e0a['value'][_0x41e2('0x37')](',')[_0x41e2('0x33')](function(_0x449407){return Number(_0x449407);});_0xe3d74b[_0x41e2('0x38')](function(_0x5a42d3){_0x2e432d['or'](_0x41e2('0x76'),'%,'+_0x5a42d3+',%');});_0x1124b3=_[_0x41e2('0x77')](_0x1124b3,_0xe3d74b);break;case _0x41e2('0x78'):if(_0x517e0a[_0x41e2('0x6e')]===_0x41e2('0x79')){_0x45b8b3[_0x499b2f](_0x41e2('0x7a'),'%'+_0x517e0a[_0x41e2('0x6a')]+'%',null);}else{_0xd560c0=_[_0x41e2('0x70')](_0x4a9058,[_0x41e2('0x30'),_0x41e2('0x40')]);_0x517e0a[_0x41e2('0x53')]=_0x41e2('0x40');_0x3e622b=as[_0x41e2('0x72')](_0x9814cc,_0xd560c0['type'],_0x517e0a);_0x45b8b3[_0x499b2f](_0x3e622b[_0x41e2('0x73')],_0x3e622b[_0x41e2('0x6a')]['start'],_0x3e622b[_0x41e2('0x6a')][_0x41e2('0x23')]);}break;case'body':_0x3e622b=as[_0x41e2('0x72')]('me',null,_0x517e0a);_0x45b8b3[_0x499b2f](_0x3e622b[_0x41e2('0x73')],_0x3e622b[_0x41e2('0x6a')][_0x41e2('0x74')],_0x3e622b['value'][_0x41e2('0x23')]);break;}}else{var _0x3e622b=as[_0x41e2('0x72')](_0x9814cc,_0xd560c0[_0x41e2('0x44')],_0x517e0a);_0x45b8b3[_0x499b2f](_0x3e622b[_0x41e2('0x73')],_0x3e622b[_0x41e2('0x6a')][_0x41e2('0x74')],_0x3e622b[_0x41e2('0x6a')][_0x41e2('0x23')]);}}}else{var _0x225089=_(_0x1ee025[_0x41e2('0x48')])[_0x41e2('0x47')]()[_0x41e2('0x33')](function(_0x169aee){return _['some'](_0x4a9058,[_0x41e2('0x30'),_0x169aee])?_0x169aee:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x225089)){_0x225089[_0x41e2('0x38')](function(_0x4185b8){if(_0x4185b8===_0x41e2('0x7b')){_0x2a7943['where']('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x1ee025[_0x41e2('0x48')][_0x4185b8]));}else if(_0x4185b8===_0x41e2('0x7c')){var _0x2f4775=JSON[_0x41e2('0x7d')](_0x1ee025['query'][_0x4185b8])[_0x41e2('0x7e')];var _0xac7a44=JSON['parse'](_0x1ee025[_0x41e2('0x48')][_0x4185b8])['$lte'];_0x2a7943[_0x41e2('0x50')](_0x41e2('0x7f'),_0x2f4775,_0xac7a44);}else{if(_0x1ee025[_0x41e2('0x48')][_0x4185b8]===_0x41e2('0x80')){_0x2a7943['where']('i.'+_0x4185b8+_0x41e2('0x81'));}else{_0x2a7943[_0x41e2('0x50')]('i.'+_0x4185b8+'\x20=\x20?',_0x1ee025[_0x41e2('0x48')][_0x4185b8]);}}});}if(_0x1ee025[_0x41e2('0x48')][_0x41e2('0x82')]){if(_0x1ee025['query'][_0x41e2('0x82')]==0x1){_0x2a7943[_0x41e2('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x2a7943[_0x41e2('0x6b')](_0x41e2('0x83'));}}if(_0x1ee025[_0x41e2('0x48')][_0x41e2('0x84')]){_0x1124b3=_[_0x41e2('0x85')](_0x1ee025[_0x41e2('0x48')]['tag'])?_0x1ee025[_0x41e2('0x48')][_0x41e2('0x84')]:new Array(_0x1ee025[_0x41e2('0x48')]['tag']);_0x1124b3[_0x41e2('0x38')](function(_0x253f8d){_0x2e432d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x253f8d+',%');});}if(_0x1ee025[_0x41e2('0x48')][_0x41e2('0x86')]){var _0x39d3b9=_0x1ee025[_0x41e2('0x48')][_0x41e2('0x86')][_0x41e2('0x87')]('\x5c','\x5c\x5c')[_0x41e2('0x87')](/'/g,'\x27\x27');if(qs[_0x41e2('0x88')](_0x39d3b9)){_0x45b8b3['or'](_0x41e2('0x89'),_0x39d3b9+'%')['or'](_0x41e2('0x8a'),_0x39d3b9+'%');}else{_0x45b8b3['or'](_0x41e2('0x8b'),qs[_0x41e2('0x6f')](_0x39d3b9))['or'](_0x41e2('0x8c'),_0x39d3b9+'%');}}}_0x2a7943['where'](_0x45b8b3);_0x2a7943[_0x41e2('0x8d')](_0x41e2('0x8e'));var _0x46438c={'type':db[_0x41e2('0x8f')][_0x41e2('0x90')][_0x41e2('0x91')],'raw':!![]};var _0x702c06=_0x2a7943[_0x41e2('0x92')]();_0x702c06['field'](_0x41e2('0x8e'));_0x702c06['field'](_0x41e2('0x93'),_0x41e2('0x69'));if(_0x6c782e[_0x41e2('0x94')]){_0x6c782e['order'][_0x41e2('0x38')](function(_0xb344a2){var _0x262f32=_0xb344a2[0x0]==='contactName'?_0xb344a2[0x0]:'i.'+_0xb344a2[0x0];_0x2a7943['order'](_0x262f32,_0xb344a2[0x1]==='DESC'?![]:!![]);});}if(!_[_0x41e2('0x95')](_0x1124b3)){_0x2a7943[_0x41e2('0x6b')](_0x2e432d);_0x702c06[_0x41e2('0x50')](_0x41e2('0x96'),_0x1124b3);}BPromise[_0x41e2('0x97')]()[_0x41e2('0x2d')](function(){if(!_0x25cf3b){if(_0x1ee025[_0x41e2('0x48')][_0x41e2('0x7b')])return;_0x702c06[_0x41e2('0x50')](_0x41e2('0x98'));_0x2a7943[_0x41e2('0x50')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1ee025[_0x41e2('0x99')][_0x41e2('0x9a')]!=='agent')return;return _0x1ee025[_0x41e2('0x99')][_0x41e2('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5ed2a0){if(_[_0x41e2('0x95')](_0x5ed2a0)){_0x702c06['where'](_0x41e2('0x9c'));_0x2a7943[_0x41e2('0x50')](_0x41e2('0x9c'));}else{_0x702c06['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x41e2('0x33')](_0x5ed2a0,'id'));_0x2a7943[_0x41e2('0x50')]('i.WhatsappAccountId\x20IN\x20?',_[_0x41e2('0x33')](_0x5ed2a0,'id'));}});})[_0x41e2('0x2d')](function(){if(_0x1ee025[_0x41e2('0x99')][_0x41e2('0x9a')]===_0x41e2('0x9d')&&!_0x25cf3b&&!_0x1ee025[_0x41e2('0x48')]['WhatsappAccountId'])return[];return db['sequelize']['query'](_0x702c06['toString'](),_0x46438c);})[_0x41e2('0x2d')](function(_0x56f141){_0x2e848a[_0x41e2('0x28')]=_0x56f141['length'];if(_0x2e848a[_0x41e2('0x28')]===0x0)return[];return db[_0x41e2('0x9e')][_0x41e2('0x48')](_0x40284f[_0x41e2('0x9f')](),_0x46438c)['then'](function(_0x258908){_0x2b8bd0=_[_0x41e2('0xa0')](_0x258908,'id');_0x46438c=_[_0x41e2('0xa1')](_0x46438c,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ee025[_0x41e2('0x48')]['fields']){_0x6c782e[_0x41e2('0x4b')][_0x41e2('0x38')](function(_0x4c5f3d){_0x2a7943[_0x41e2('0x53')]('i.'+_0x4c5f3d);});}else{_0x2a7943[_0x41e2('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x41e2('0x69'));_0x2a7943[_0x41e2('0x53')]('a.key',_0x41e2('0xa2'));_0x2a7943['field'](_0x41e2('0xa3'),_0x41e2('0xa4'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xa5'),_0x41e2('0xa6'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xa7'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xa8'),_0x41e2('0xa9'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xaa'),'Contact.lastName');_0x2a7943[_0x41e2('0x53')](_0x41e2('0xab'),_0x41e2('0xac'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xad'),_0x41e2('0xae'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xaf'),_0x41e2('0xb0'));_0x2a7943[_0x41e2('0x53')]('c.fax',_0x41e2('0xb1'));_0x2a7943['field'](_0x41e2('0xb2'),_0x41e2('0xb3'));_0x2a7943[_0x41e2('0x53')]('o.internal',_0x41e2('0xb4'));_0x2a7943[_0x41e2('0x53')](_0x41e2('0xb5'),_0x41e2('0x35'));}if(_0x6c782e[_0x41e2('0x26')])_0x2a7943[_0x41e2('0x26')](_0x6c782e[_0x41e2('0x26')]);if(_0x6c782e[_0x41e2('0x25')])_0x2a7943[_0x41e2('0x25')](_0x6c782e[_0x41e2('0x25')]);return db[_0x41e2('0x9e')][_0x41e2('0x48')](_0x2a7943[_0x41e2('0x9f')](),_0x46438c);})[_0x41e2('0x2d')](function(_0x47d120){if(_0x47d120[_0x41e2('0x4d')]>0x0)_0x11eb07[_0x41e2('0x50')](_0x41e2('0xb6'),_['map'](_0x47d120,'id'));return db[_0x41e2('0x9e')][_0x41e2('0x48')](_0x11eb07[_0x41e2('0x9f')](),_0x46438c)['then'](function(_0x115b06){var _0x2e1bc4=_[_0x41e2('0xb7')](_0x115b06,_0x41e2('0xb8'));var _0x587cdd=[];_0x47d120['forEach'](function(_0x3b65e4){_0x587cdd[_0x41e2('0xb9')](updateWhatsappInteraction(_0x3b65e4,_0x2b8bd0,_0x2e1bc4));});return BPromise[_0x41e2('0xba')](_0x587cdd);});});})['then'](function(_0x11a461){_0x2e848a[_0x41e2('0xbb')]=_0x11a461;return _0x2e848a;})['then'](respondWithFilteredResult(_0x190ac3,_0x6c782e))['catch'](handleError(_0x190ac3,null));};exports[_0x41e2('0xbc')]=function(_0x246bf8,_0x4ece18){var _0x468be5={'raw':![],'where':{'id':_0x246bf8[_0x41e2('0xbd')]['id']}},_0x53ec22={};_0x53ec22[_0x41e2('0x46')]=_[_0x41e2('0x47')](db[_0x41e2('0x41')]['rawAttributes']);_0x53ec22[_0x41e2('0x48')]=_[_0x41e2('0x47')](_0x246bf8[_0x41e2('0x48')]);_0x53ec22[_0x41e2('0x49')]=_[_0x41e2('0x4a')](_0x53ec22[_0x41e2('0x46')],_0x53ec22['query']);_0x468be5['attributes']=_[_0x41e2('0x4a')](_0x53ec22[_0x41e2('0x46')],qs[_0x41e2('0x4c')](_0x246bf8['query'][_0x41e2('0x4c')]));_0x468be5[_0x41e2('0x4b')]=_0x468be5['attributes']['length']?_0x468be5['attributes']:_0x53ec22[_0x41e2('0x46')];if(_0x246bf8[_0x41e2('0x48')]['includeAll']){_0x468be5[_0x41e2('0xbe')]=[{'all':!![]}];}_0x468be5=_['merge']({},_0x468be5,_0x246bf8[_0x41e2('0xbf')]);return db[_0x41e2('0x41')][_0x41e2('0x70')](_0x468be5)[_0x41e2('0x2d')](handleEntityNotFound(_0x4ece18,null))[_0x41e2('0x2d')](respondWithResult(_0x4ece18,null))[_0x41e2('0x39')](handleError(_0x4ece18,null));};exports['create']=function(_0x5bddcf,_0x4a4b29){return db[_0x41e2('0x41')]['create'](_0x5bddcf[_0x41e2('0xc0')],{})['then'](respondWithResult(_0x4a4b29,0xc9))[_0x41e2('0x39')](handleError(_0x4a4b29,null));};exports[_0x41e2('0x2c')]=function(_0x27114e,_0x982746){if(_0x27114e[_0x41e2('0xc0')]['id']){delete _0x27114e[_0x41e2('0xc0')]['id'];}return db['WhatsappInteraction'][_0x41e2('0x70')]({'where':{'id':_0x27114e[_0x41e2('0xbd')]['id']}})[_0x41e2('0x2d')](handleEntityNotFound(_0x982746,null))[_0x41e2('0x2d')](saveUpdates(_0x27114e['body'],null))['then'](respondWithResult(_0x982746,null))[_0x41e2('0x39')](handleError(_0x982746,null));};exports['destroy']=function(_0x448a91,_0x465417){return db[_0x41e2('0x41')][_0x41e2('0x70')]({'where':{'id':_0x448a91[_0x41e2('0xbd')]['id']}})[_0x41e2('0x2d')](handleEntityNotFound(_0x465417,null))[_0x41e2('0x2d')](removeEntity(_0x465417,null))['catch'](handleError(_0x465417,null));};exports['describe']=function(_0x381264,_0x31f3c4){return db['WhatsappInteraction'][_0x41e2('0xc1')]()[_0x41e2('0x2d')](respondWithResult(_0x31f3c4,null))['catch'](handleError(_0x31f3c4,null));};exports[_0x41e2('0xc2')]=function(_0x44d4db,_0x4e48b8,_0x51f15b){return db[_0x41e2('0xc3')][_0x41e2('0x70')]({'where':{'id':_0x44d4db[_0x41e2('0xbd')]['id']}})[_0x41e2('0x2d')](handleEntityNotFound(_0x4e48b8,null))[_0x41e2('0x2d')](function(_0x16d136){if(_0x16d136){return _0x16d136[_0x41e2('0xc2')](_0x44d4db[_0x41e2('0xc0')][_0x41e2('0xc4')],_[_0x41e2('0xc5')](_0x44d4db[_0x41e2('0xc0')],['ids','id'])||{});}})[_0x41e2('0x2d')](respondWithResult(_0x4e48b8,null))[_0x41e2('0x39')](handleError(_0x4e48b8,null));};exports[_0x41e2('0xc6')]=function(_0x404f0c,_0x5c8033,_0x2b7478){var _0x4efbb3={'raw':![],'where':{}};var _0x10254a={};var _0x105c85={'count':0x0,'rows':[]};return db[_0x41e2('0x41')][_0x41e2('0xc7')]({'where':{'id':_0x404f0c['params']['id']}})[_0x41e2('0x2d')](handleEntityNotFound(_0x5c8033,null))['then'](function(_0x5bb8eb){if(_0x5bb8eb){_0x10254a['model']=_[_0x41e2('0x47')](db[_0x41e2('0xc3')][_0x41e2('0x42')]);_0x10254a['query']=_[_0x41e2('0x47')](_0x404f0c[_0x41e2('0x48')]);_0x10254a[_0x41e2('0x49')]=_[_0x41e2('0x4a')](_0x10254a[_0x41e2('0x46')],_0x10254a[_0x41e2('0x48')]);_0x4efbb3[_0x41e2('0x4b')]=_[_0x41e2('0x4a')](_0x10254a['model'],qs[_0x41e2('0x4c')](_0x404f0c['query'][_0x41e2('0x4c')]));_0x4efbb3[_0x41e2('0x4b')]=_0x4efbb3[_0x41e2('0x4b')][_0x41e2('0x4d')]?_0x4efbb3['attributes']:_0x10254a['model'];if(!_0x404f0c[_0x41e2('0x48')]['hasOwnProperty'](_0x41e2('0xc8'))){_0x4efbb3[_0x41e2('0x26')]=qs[_0x41e2('0x26')](_0x404f0c[_0x41e2('0x48')]['limit']);_0x4efbb3[_0x41e2('0x25')]=qs['offset'](_0x404f0c[_0x41e2('0x48')][_0x41e2('0x25')]);}_0x4efbb3[_0x41e2('0x94')]=qs[_0x41e2('0x4f')](_0x404f0c[_0x41e2('0x48')][_0x41e2('0x4f')]);_0x4efbb3[_0x41e2('0x50')]=qs[_0x41e2('0x49')](_[_0x41e2('0x51')](_0x404f0c[_0x41e2('0x48')],_0x10254a[_0x41e2('0x49')]));_0x4efbb3[_0x41e2('0x50')][_0x41e2('0xb8')]=_0x5bb8eb['id'];if(_0x404f0c[_0x41e2('0x48')][_0x41e2('0x86')]){_0x4efbb3[_0x41e2('0x50')]=_[_0x41e2('0xa1')](_0x4efbb3[_0x41e2('0x50')],{'$or':_[_0x41e2('0x33')](_0x4efbb3[_0x41e2('0x4b')],function(_0x498537){var _0x2cf997={};_0x2cf997[_0x498537]={'$like':'%'+_0x404f0c[_0x41e2('0x48')]['filter']+'%'};return _0x2cf997;})});}if(_0x404f0c[_0x41e2('0x48')][_0x41e2('0x7e')]){var _0x36f1ab=_0x404f0c[_0x41e2('0x48')][_0x41e2('0x7e')][_0x41e2('0x37')](',');var _0x2c44ac={};_0x2c44ac[_0x36f1ab[0x0]]={'$gte':moment(_0x36f1ab[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4efbb3[_0x41e2('0x50')]=_[_0x41e2('0xa1')](_0x4efbb3[_0x41e2('0x50')],_0x2c44ac);}_0x4efbb3=_[_0x41e2('0xa1')]({},_0x4efbb3,_0x404f0c[_0x41e2('0xbf')]);return db[_0x41e2('0xc3')][_0x41e2('0x28')]({'where':_0x4efbb3['where']})['then'](function(_0x49e038){_0x105c85['count']=_0x49e038;if(_0x404f0c[_0x41e2('0x48')][_0x41e2('0xc9')]){_0x4efbb3[_0x41e2('0xbe')]=[{'all':!![]}];}return db[_0x41e2('0xc3')][_0x41e2('0xca')](_0x4efbb3);})['then'](function(_0x1046d6){_0x105c85[_0x41e2('0xbb')]=_0x1046d6;return _0x105c85;});}})[_0x41e2('0x2d')](respondWithFilteredResult(_0x5c8033,_0x4efbb3))[_0x41e2('0x39')](handleError(_0x5c8033,null));};exports[_0x41e2('0xcb')]=function(_0x3dcde8,_0x3249a0,_0x516f14){return db['WhatsappInteraction'][_0x41e2('0x70')]({'where':{'id':_0x3dcde8[_0x41e2('0xbd')]['id']}})[_0x41e2('0x2d')](handleEntityNotFound(_0x3249a0,null))[_0x41e2('0x2d')](function(_0x153270){if(_0x153270){return _0x153270[_0x41e2('0xcc')](_0x3dcde8[_0x41e2('0xc0')][_0x41e2('0xc4')],_[_0x41e2('0xc5')](_0x3dcde8[_0x41e2('0xc0')],[_0x41e2('0xc4'),'id'])||{})['spread'](function(){return db[_0x41e2('0x75')][_0x41e2('0xca')]({'attributes':['id',_0x41e2('0x30'),_0x41e2('0x54')],'where':{'id':_0x3dcde8[_0x41e2('0xc0')][_0x41e2('0xc4')]}});})[_0x41e2('0x2d')](function(_0x19bdd3){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x3dcde8['params']['id']),'tags':_0x19bdd3||[]});return{'id':Number(_0x3dcde8['params']['id']),'tags':_0x19bdd3||[]};});}})[_0x41e2('0x2d')](respondWithResult(_0x3249a0,null))[_0x41e2('0x39')](handleError(_0x3249a0,null));};exports[_0x41e2('0xcd')]=function(_0xc8f748,_0x58e4e9,_0x2c363c){return db[_0x41e2('0x41')][_0x41e2('0x70')]({'where':{'id':_0xc8f748[_0x41e2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x58e4e9,null))['then'](function(_0x2d05c9){if(_0x2d05c9){return _0x2d05c9[_0x41e2('0xcd')](_0xc8f748['query'][_0x41e2('0xc4')]);}})['then'](respondWithStatusCode(_0x58e4e9,null))[_0x41e2('0x39')](handleError(_0x58e4e9,null));};exports[_0x41e2('0xce')]=function(_0x15a60d,_0x3e5fe6){var _0x33c90d=moment()['unix']()['toString']();var _0x403468=path[_0x41e2('0xcf')](config['root'],_0x41e2('0xd0'),_0x41e2('0xd1'),_0x41e2('0xd2'));var _0x173e39=path['join'](config[_0x41e2('0xd3')],_0x41e2('0xd0'),_0x41e2('0xd1'),_0x41e2('0xd4'));var _0x4c10f3=path[_0x41e2('0xcf')](_0x403468,_0x33c90d);var _0x2d14ef=util[_0x41e2('0xd5')](_0x41e2('0xd6'),_0x15a60d[_0x41e2('0xbd')]['id'],_0x33c90d);var _0xf86394=path[_0x41e2('0xcf')](_0x403468,_0x2d14ef);var _0x25bc2b=[];_0x25bc2b['push']({'model':db[_0x41e2('0x78')],'as':_0x41e2('0x78'),'attributes':['id',_0x41e2('0x34')],'raw':!![]});_0x25bc2b[_0x41e2('0xb9')]({'model':db[_0x41e2('0xd7')],'as':_0x41e2('0xd8'),'attributes':['id',_0x41e2('0xd9'),_0x41e2('0xda')],'raw':!![]});if(_0x15a60d[_0x41e2('0x48')][_0x41e2('0xd4')]){_0x25bc2b['push']({'model':db[_0x41e2('0xdb')],'as':_0x41e2('0xdb'),'raw':!![]});}var _0x45dea9=[{'model':db['WhatsappMessage'],'as':_0x41e2('0xdc'),'attributes':['id','body',_0x41e2('0x7c'),'direction',_0x41e2('0xdd'),_0x41e2('0x82')],'include':_0x25bc2b}];_0x45dea9[_0x41e2('0xb9')]({'model':db['WhatsappAccount'],'as':_0x41e2('0xde'),'attributes':['id',_0x41e2('0x30')]});_0x45dea9['push']({'model':db[_0x41e2('0x78')],'as':'Owner','attributes':['id',_0x41e2('0x34')]});return db['WhatsappInteraction'][_0x41e2('0x70')]({'where':{'id':_0x15a60d['params']['id']},'include':_0x45dea9})[_0x41e2('0x2d')](handleEntityNotFound(_0x3e5fe6,null))['then'](function(_0xd08b22){if(_0xd08b22){var _0x2a97aa=_0xd08b22['get']({'plain':!![]});fs[_0x41e2('0xdf')](_0x4c10f3);var _0x287ad7={'channel':_0x41e2('0xe0'),'account':_0x2a97aa['Account']['name'],'agent':_0x2a97aa[_0x41e2('0xe1')]?_0x2a97aa['Owner'][_0x41e2('0x34')]:_0x41e2('0xe2'),'createdAt':moment(_0x2a97aa[_0x41e2('0x7c')])[_0x41e2('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x41e2('0x9f')](),'closedAt':_0x2a97aa['closed']?moment(_0x2a97aa[_0x41e2('0xe3')])[_0x41e2('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x41e2('0x9f')]():'','disposition':_0x2a97aa[_0x41e2('0xe4')],'messages':_(_0x2a97aa['Messages'])[_0x41e2('0x86')]({'secret':![]})[_0x41e2('0x33')](function(_0x4c7e16){if(_0x4c7e16[_0x41e2('0xdb')]){var _0x4443c9=path[_0x41e2('0xcf')](_0x173e39,_0x4c7e16[_0x41e2('0xdb')][_0x41e2('0xe5')]);if(fs[_0x41e2('0xe6')](_0x4443c9)){fs[_0x41e2('0xe7')](_0x4443c9)[_0x41e2('0xe8')](fs['createWriteStream'](path[_0x41e2('0xcf')](_0x4c10f3,_0x4c7e16[_0x41e2('0xdb')]['basename'])));}}return{'date':moment(_0x4c7e16[_0x41e2('0x7c')])[_0x41e2('0xd5')](_0x41e2('0xe9'))[_0x41e2('0x9f')](),'sender':_0x4c7e16['direction']===_0x41e2('0xea')?_0x4c7e16[_0x41e2('0x78')]?_0x4c7e16[_0x41e2('0x78')][_0x41e2('0x34')]:_0x41e2('0xeb'):_0x4c7e16[_0x41e2('0xd8')][_0x41e2('0xd9')]+(_0x4c7e16[_0x41e2('0xd8')][_0x41e2('0xda')]?'\x20'+_0x4c7e16[_0x41e2('0xd8')]['lastName']:''),'body':_0x4c7e16[_0x41e2('0xdb')]?_0x4c7e16[_0x41e2('0xdb')][_0x41e2('0xe5')]:_0x4c7e16[_0x41e2('0xc0')],'direction':_0x4c7e16[_0x41e2('0xec')]===_0x41e2('0xea')?'A':'C','secret':_0x4c7e16['secret'],'read':_0x4c7e16[_0x41e2('0x82')],'attachment':_0x4c7e16['Attachment']};})[_0x41e2('0x6a')]()};return ejs[_0x41e2('0xed')](path['join'](config[_0x41e2('0xd3')],_0x41e2('0xd0'),_0x41e2('0xee'),_0x41e2('0xef')),{'interaction':_0x287ad7})[_0x41e2('0x2d')](function(_0x59d479){var _0x7fedfb=path[_0x41e2('0xcf')](_0x4c10f3,_0x41e2('0xf0')+_0x2a97aa['id']+'-'+_0x33c90d+_0x41e2('0xf1'));var _0x177c69={'path':_0x7fedfb,'channel':_0x41e2('0xe0'),'interactionId':_0x2a97aa['id']};return pdf[_0x41e2('0xf2')](_0x59d479,_0x177c69);})[_0x41e2('0x2d')](function(){return new BPromise(function(_0x21b441,_0x3d5767){zipdir(_0x4c10f3,{'saveTo':_0xf86394},function(_0x375ba4,_0x328763){if(_0x375ba4)return _0x3d5767(_0x375ba4);return _0x21b441(_0x328763);});})[_0x41e2('0x2d')](function(){return new BPromise(function(_0x292f9c,_0x55c4e9){rimraf(_0x4c10f3,function(_0x12ab6c){if(_0x12ab6c)_0x55c4e9(_0x12ab6c);return _0x292f9c();});});})[_0x41e2('0x2d')](function(){return _0x3e5fe6[_0x41e2('0xce')](_0xf86394,_0x2d14ef,function(_0xb4a575){if(_0xb4a575){console['log'](_0x41e2('0xf3'),_0xb4a575);}else{fs['unlinkSync'](_0xf86394);}});});});}else{return _0x3e5fe6[_0x41e2('0x21')](0xc8);}})[_0x41e2('0x39')](handleError(_0x3e5fe6,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index ffbdf64..4117a1d 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 _0xb04a=['../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','getUsers','then','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xab04('0x0'));var WhatsappInteraction=require(_0xab04('0x1'))['db'][_0xab04('0x2')];var WhatsappMessage=require(_0xab04('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xab04('0x3')](0x0);var events={'afterCreate':_0xab04('0x4'),'afterUpdate':_0xab04('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2b5b06){return function(_0x160dd6,_0x1ad1a7,_0x488ced){_0x160dd6[_0xab04('0x6')]({'attributes':['id'],'raw':!![]})[_0xab04('0x7')](function(_0x598d0f){_0x160dd6['setDataValue']('Users',_0x598d0f[_0xab04('0x8')](function(_0x4faba9){return{'id':_0x4faba9['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x160dd6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1d4a39){_0x160dd6[_0xab04('0x9')](_0xab04('0xa'),_0x1d4a39[_0xab04('0xb')]);WhatsappInteractionEvents[_0xab04('0xc')](_0x2b5b06+':'+_0x160dd6['id'],_0x160dd6);WhatsappInteractionEvents[_0xab04('0xc')](_0x2b5b06,_0x160dd6);_0x488ced(null);})[_0xab04('0xd')](_0x488ced(null));};}for(var e in events){if(events[_0xab04('0xe')](e)){var event=events[e];WhatsappInteraction[_0xab04('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x2e54=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','Users','findAll','then','setDataValue','unreadMessages','length','emit','hasOwnProperty'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2e54,0x1dd));var _0x42e5=function(_0x408edc,_0x8a18d2){_0x408edc=_0x408edc-0x0;var _0x4c8f07=_0x2e54[_0x408edc];return _0x4c8f07;};'use strict';var EventEmitter=require(_0x42e5('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x42e5('0x1'))['db'][_0x42e5('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x42e5('0x3')](0x0);var events={'afterCreate':_0x42e5('0x4'),'afterUpdate':_0x42e5('0x5'),'afterDestroy':_0x42e5('0x6')};function emitEvent(_0x42736b){return function(_0x528772,_0x171302,_0x455f48){_0x528772[_0x42e5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2af5bb){_0x528772['setDataValue'](_0x42e5('0x8'),_0x2af5bb['map'](function(_0x3a8494){return{'id':_0x3a8494['id']};}));return WhatsappMessage[_0x42e5('0x9')]({'where':{'WhatsappInteractionId':_0x528772['id'],'direction':'in','read':![]},'raw':!![]});})[_0x42e5('0xa')](function(_0x15f9f1){_0x528772[_0x42e5('0xb')](_0x42e5('0xc'),_0x15f9f1[_0x42e5('0xd')]);WhatsappInteractionEvents[_0x42e5('0xe')](_0x42736b+':'+_0x528772['id'],_0x528772);WhatsappInteractionEvents[_0x42e5('0xe')](_0x42736b,_0x528772);_0x455f48(null);})['catch'](_0x455f48(null));};}for(var e in events){if(events[_0x42e5('0xf')](e)){var event=events[e];WhatsappInteraction[_0x42e5('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 4c056bc..29b4473 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 _0xd159=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x4934e3,_0x124098){var _0x86a0c3=function(_0x59da73){while(--_0x59da73){_0x4934e3['push'](_0x4934e3['shift']());}};_0x86a0c3(++_0x124098);}(_0xd159,0x19d));var _0x9d15=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd159[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9d15('0x0'));var util=require(_0x9d15('0x1'));var logger=require(_0x9d15('0x2'))(_0x9d15('0x3'));var moment=require('moment');var BPromise=require(_0x9d15('0x4'));var rp=require(_0x9d15('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d15('0x6'));var config=require(_0x9d15('0x7'));var attributes=require(_0x9d15('0x8'));module['exports']=function(_0x42b0bd,_0x5875b8){return _0x42b0bd[_0x9d15('0x9')](_0x9d15('0xa'),attributes,{'tableName':_0x9d15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b1a6e,_0xcaa861,_0x2bffa9){if(_0x5b1a6e[_0x9d15('0xc')](_0x9d15('0xd'))){_0x5b1a6e[_0x9d15('0xe')]=moment()[_0x9d15('0xf')](_0x9d15('0x10'));}_0x2bffa9(null,_0x5b1a6e);}}});}; \ No newline at end of file +var _0x5458=['define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x5458,0x1c7));var _0x8545=function(_0x42e694,_0x2bda04){_0x42e694=_0x42e694-0x0;var _0x16a539=_0x5458[_0x42e694];return _0x16a539;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var logger=require(_0x8545('0x2'))('api');var moment=require(_0x8545('0x3'));var BPromise=require(_0x8545('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8545('0x5'));var rimraf=require(_0x8545('0x6'));var config=require(_0x8545('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x8545('0x8')]=function(_0x2bd13a,_0x10792f){return _0x2bd13a[_0x8545('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x8545('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x507ed8,_0x2cc4f4,_0xf25985){if(_0x507ed8[_0x8545('0xb')](_0x8545('0xc'))){_0x507ed8[_0x8545('0xd')]=moment()[_0x8545('0xe')](_0x8545('0xf'));}_0xf25985(null,_0x507ed8);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 8154375..59bc5c1 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 _0x3298=['redis','defaults','socket.io-emitter','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','WhatsappInteraction','options','raw','where','UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x1bb07c,_0x43cd16){var _0x30bb8a=function(_0x12ba2f){while(--_0x12ba2f){_0x1bb07c['push'](_0x1bb07c['shift']());}};_0x30bb8a(++_0x43cd16);}(_0x3298,0x173));var _0x8329=function(_0x25093c,_0x5cb04a){_0x25093c=_0x25093c-0x0;var _0x18c113=_0x3298[_0x25093c];return _0x18c113;};'use strict';var _=require(_0x8329('0x0'));var util=require(_0x8329('0x1'));var moment=require(_0x8329('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8329('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8329('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x8329('0x5'));var jayson=require(_0x8329('0x6'));var client=jayson[_0x8329('0x7')][_0x8329('0x8')]({'port':0x232a});config[_0x8329('0x9')]=_[_0x8329('0xa')](config[_0x8329('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8329('0xb'))(new Redis(config[_0x8329('0x9')]));require('./whatsappInteraction.socket')[_0x8329('0xc')](socket);function respondWithRpcPromise(_0x7b7a45,_0x3672c7,_0x125a3a){return new BPromise(function(_0x2843df,_0x19d992){return client[_0x8329('0xd')](_0x7b7a45,_0x125a3a)[_0x8329('0xe')](function(_0x13081a){logger['info'](_0x8329('0xf'),_0x3672c7,_0x8329('0x10'));logger[_0x8329('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3672c7,_0x8329('0x10'),JSON['stringify'](_0x13081a));if(_0x13081a['error']){if(_0x13081a[_0x8329('0x12')][_0x8329('0x13')]===0x1f4){logger[_0x8329('0x12')](_0x8329('0xf'),_0x3672c7,_0x13081a[_0x8329('0x12')]['message']);return _0x19d992(_0x13081a['error'][_0x8329('0x14')]);}logger[_0x8329('0x12')](_0x8329('0xf'),_0x3672c7,_0x13081a['error']['message']);return _0x2843df(_0x13081a['error']['message']);}else{logger[_0x8329('0x15')](_0x8329('0xf'),_0x3672c7,_0x8329('0x10'));_0x2843df(_0x13081a[_0x8329('0x16')][_0x8329('0x14')]);}})[_0x8329('0x17')](function(_0x20d792){logger[_0x8329('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3672c7,_0x20d792);_0x19d992(_0x20d792);});});}exports['UpdateWhatsappInteraction']=function(_0x4256e5){var _0x3b74ae=this;return new Promise(function(_0x3c72a3,_0x414a2b){return db[_0x8329('0x18')]['update'](_0x4256e5['body'],{'raw':_0x4256e5[_0x8329('0x19')]?_0x4256e5[_0x8329('0x19')][_0x8329('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4256e5[_0x8329('0x19')]?_0x4256e5['options'][_0x8329('0x1b')]||null:null,'attributes':_0x4256e5['options']?_0x4256e5[_0x8329('0x19')]['attributes']||null:null,'limit':_0x4256e5[_0x8329('0x19')]?_0x4256e5['options']['limit']||null:null})[_0x8329('0xe')](function(_0x1b1f64){logger[_0x8329('0x15')](_0x8329('0x1c'),_0x4256e5);logger['debug'](_0x8329('0x1c'),_0x4256e5,JSON[_0x8329('0x1d')](_0x1b1f64));_0x3c72a3(_0x1b1f64);})[_0x8329('0x17')](function(_0x77dfcf){logger[_0x8329('0x12')]('UpdateWhatsappInteraction',_0x77dfcf[_0x8329('0x14')],_0x4256e5);_0x414a2b(_0x3b74ae[_0x8329('0x12')](0x1f4,_0x77dfcf[_0x8329('0x14')]));});});};exports[_0x8329('0x1e')]=function(_0x549203){return new Promise(function(_0x556c3c,_0x596133){return db[_0x8329('0x18')][_0x8329('0x1f')]({'where':_0x549203[_0x8329('0x19')]?_0x549203['options'][_0x8329('0x1b')]||null:null})['then'](function(_0x40a8d7){if(_0x40a8d7){return _0x40a8d7[_0x8329('0x20')](_0x549203[_0x8329('0x21')][_0x8329('0x22')],_[_0x8329('0x23')](_0x549203['body'],[_0x8329('0x22'),'id'])||{});}})[_0x8329('0x24')](function(_0x56ebcd){logger[_0x8329('0x15')](_0x8329('0x25'),_0x549203);logger[_0x8329('0x11')](_0x8329('0x25'),_0x549203,JSON[_0x8329('0x1d')](_0x56ebcd));_0x556c3c(_0x56ebcd);})[_0x8329('0x17')](function(_0x53456d){logger[_0x8329('0x12')](_0x8329('0x25'),_0x53456d[_0x8329('0x14')],_0x549203);_0x596133(_this['error'](0x1f4,_0x53456d[_0x8329('0x14')]));});});}; \ No newline at end of file +var _0x3436=['spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','raw','options','limit','catch','AddTagsToWhatsappInteraction','find','omit','ids'];(function(_0x5970b9,_0x8715e9){var _0x102199=function(_0x48d154){while(--_0x48d154){_0x5970b9['push'](_0x5970b9['shift']());}};_0x102199(++_0x8715e9);}(_0x3436,0x9e));var _0x6343=function(_0x47b531,_0x2dea6b){_0x47b531=_0x47b531-0x0;var _0x7b83f0=_0x3436[_0x47b531];return _0x7b83f0;};'use strict';var _=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var moment=require(_0x6343('0x2'));var BPromise=require('bluebird');var rs=require(_0x6343('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6343('0x4'))['db'];var utils=require(_0x6343('0x5'));var logger=require(_0x6343('0x6'))('rpc');var config=require(_0x6343('0x7'));var jayson=require(_0x6343('0x8'));var client=jayson['client'][_0x6343('0x9')]({'port':0x232a});config[_0x6343('0xa')]=_[_0x6343('0xb')](config[_0x6343('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6343('0xa')]));require(_0x6343('0xc'))[_0x6343('0xd')](socket);function respondWithRpcPromise(_0x3b8291,_0x585c17,_0x235e4c){return new BPromise(function(_0x2f397d,_0x1e47e4){return client[_0x6343('0xe')](_0x3b8291,_0x235e4c)[_0x6343('0xf')](function(_0x57cee1){logger[_0x6343('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x585c17,_0x6343('0x11'));logger[_0x6343('0x12')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x585c17,_0x6343('0x11'),JSON[_0x6343('0x13')](_0x57cee1));if(_0x57cee1['error']){if(_0x57cee1[_0x6343('0x14')][_0x6343('0x15')]===0x1f4){logger[_0x6343('0x14')](_0x6343('0x16'),_0x585c17,_0x57cee1['error'][_0x6343('0x17')]);return _0x1e47e4(_0x57cee1['error'][_0x6343('0x17')]);}logger[_0x6343('0x14')](_0x6343('0x16'),_0x585c17,_0x57cee1[_0x6343('0x14')][_0x6343('0x17')]);return _0x2f397d(_0x57cee1[_0x6343('0x14')][_0x6343('0x17')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x585c17,_0x6343('0x11'));_0x2f397d(_0x57cee1[_0x6343('0x18')][_0x6343('0x17')]);}})['catch'](function(_0x2c2db8){logger[_0x6343('0x14')](_0x6343('0x16'),_0x585c17,_0x2c2db8);_0x1e47e4(_0x2c2db8);});});}exports[_0x6343('0x19')]=function(_0x35c2f4){var _0x365600=this;return new Promise(function(_0x563e68,_0x58e91d){return db[_0x6343('0x1a')][_0x6343('0x1b')](_0x35c2f4[_0x6343('0x1c')],{'raw':_0x35c2f4['options']?_0x35c2f4['options'][_0x6343('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35c2f4[_0x6343('0x1e')]?_0x35c2f4[_0x6343('0x1e')]['where']||null:null,'attributes':_0x35c2f4['options']?_0x35c2f4[_0x6343('0x1e')]['attributes']||null:null,'limit':_0x35c2f4[_0x6343('0x1e')]?_0x35c2f4['options'][_0x6343('0x1f')]||null:null})[_0x6343('0xf')](function(_0x249310){logger[_0x6343('0x10')](_0x6343('0x19'),_0x35c2f4);logger[_0x6343('0x12')](_0x6343('0x19'),_0x35c2f4,JSON[_0x6343('0x13')](_0x249310));_0x563e68(_0x249310);})[_0x6343('0x20')](function(_0x365501){logger[_0x6343('0x14')]('UpdateWhatsappInteraction',_0x365501[_0x6343('0x17')],_0x35c2f4);_0x58e91d(_0x365600[_0x6343('0x14')](0x1f4,_0x365501[_0x6343('0x17')]));});});};exports[_0x6343('0x21')]=function(_0x1c3d66){return new Promise(function(_0x42878c,_0x45e6dd){return db[_0x6343('0x1a')][_0x6343('0x22')]({'where':_0x1c3d66[_0x6343('0x1e')]?_0x1c3d66['options']['where']||null:null})['then'](function(_0x88b8d0){if(_0x88b8d0){return _0x88b8d0['addTags'](_0x1c3d66['body']['ids'],_[_0x6343('0x23')](_0x1c3d66['body'],[_0x6343('0x24'),'id'])||{});}})[_0x6343('0x25')](function(_0x963d61){logger[_0x6343('0x10')](_0x6343('0x26'),_0x1c3d66);logger[_0x6343('0x12')](_0x6343('0x26'),_0x1c3d66,JSON['stringify'](_0x963d61));_0x42878c(_0x963d61);})[_0x6343('0x20')](function(_0x537d44){logger[_0x6343('0x14')](_0x6343('0x26'),_0x537d44[_0x6343('0x17')],_0x1c3d66);_0x45e6dd(_this[_0x6343('0x14')](0x1f4,_0x537d44['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 54111a7..3ff2974 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 _0x75d8=['whatsappInteraction:','save','update','emit','removeListener','register'];(function(_0x2a294c,_0x1b241){var _0x442fdb=function(_0x2fe0eb){while(--_0x2fe0eb){_0x2a294c['push'](_0x2a294c['shift']());}};_0x442fdb(++_0x1b241);}(_0x75d8,0xeb));var _0x875d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75d8[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x875d('0x0'),'remove',_0x875d('0x1')];function createListener(_0x5e12e4,_0x395785){return function(_0x1927b5){_0x395785[_0x875d('0x2')](_0x5e12e4,_0x1927b5);};}function removeListener(_0x27a617,_0x57cc57){return function(){WhatsappInteractionEvents[_0x875d('0x3')](_0x27a617,_0x57cc57);};}exports[_0x875d('0x4')]=function(_0x256e2a){for(var _0x5f25a1=0x0,_0x5ed587=events['length'];_0x5f25a1<_0x5ed587;_0x5f25a1++){var _0x2cccc7=events[_0x5f25a1];var _0x471737=createListener(_0x875d('0x5')+_0x2cccc7,_0x256e2a);WhatsappInteractionEvents['on'](_0x2cccc7,_0x471737);}}; \ No newline at end of file +var _0xe67b=['remove','update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4e5557,_0x4c98ba){var _0x336a10=function(_0x1d3b72){while(--_0x1d3b72){_0x4e5557['push'](_0x4e5557['shift']());}};_0x336a10(++_0x4c98ba);}(_0xe67b,0x19e));var _0xbe67=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xe67b[_0x16dbfd];return _0x382254;};'use strict';var WhatsappInteractionEvents=require(_0xbe67('0x0'));var events=[_0xbe67('0x1'),_0xbe67('0x2'),_0xbe67('0x3')];function createListener(_0x24c558,_0x58ee55){return function(_0x22628e){_0x58ee55[_0xbe67('0x4')](_0x24c558,_0x22628e);};}function removeListener(_0x10d023,_0x2b391b){return function(){WhatsappInteractionEvents['removeListener'](_0x10d023,_0x2b391b);};}exports[_0xbe67('0x5')]=function(_0x7fd4f){for(var _0x2818c5=0x0,_0x37d811=events[_0xbe67('0x6')];_0x2818c5<_0x37d811;_0x2818c5++){var _0x3d4959=events[_0x2818c5];var _0x508545=createListener(_0xbe67('0x7')+_0x3d4959,_0x7fd4f);WhatsappInteractionEvents['on'](_0x3d4959,_0x508545);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 610a5b4..efdd266 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 _0xc6c7=['/:id/status','status','update','put','/:id/accept','/:id/reject','reject','/:id','exports','connect-timeout','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','describe','post','tracked','whatsapp','whatsappmessage:create','create'];(function(_0x4e4555,_0x277e77){var _0x5714dc=function(_0x17d603){while(--_0x17d603){_0x4e4555['push'](_0x4e4555['shift']());}};_0x5714dc(++_0x277e77);}(_0xc6c7,0xaa));var _0x7c6c=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xc6c7[_0x3e6b2f];return _0x323215;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c6c('0x0'));var express=require('express');var router=express[_0x7c6c('0x1')]();var fs_extra=require(_0x7c6c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7c6c('0x3'));var config=require('../../config/environment');var controller=require(_0x7c6c('0x4'));router['get']('/',auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x6')]);router[_0x7c6c('0x7')]('/describe',auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x8')]);router[_0x7c6c('0x7')]('/:id',auth[_0x7c6c('0x5')](),controller['show']);router[_0x7c6c('0x9')]('/',auth[_0x7c6c('0x5')](),interaction[_0x7c6c('0xa')](_0x7c6c('0xb'),_0x7c6c('0xc')),controller[_0x7c6c('0xd')]);router[_0x7c6c('0x9')](_0x7c6c('0xe'),controller[_0x7c6c('0xf')]);router['put']('/:id',auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x10')]);router[_0x7c6c('0x11')](_0x7c6c('0x12'),auth[_0x7c6c('0x5')](),controller['accept']);router[_0x7c6c('0x11')](_0x7c6c('0x13'),auth[_0x7c6c('0x5')](),controller[_0x7c6c('0x14')]);router['delete'](_0x7c6c('0x15'),auth[_0x7c6c('0x5')](),controller['destroy']);module[_0x7c6c('0x16')]=router; \ No newline at end of file +var _0x3651=['describe','/:id','show','tracked','whatsapp','whatsappmessage:create','post','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x3651,0x179));var _0x1365=function(_0x4a31e2,_0x2ae36c){_0x4a31e2=_0x4a31e2-0x0;var _0x41070d=_0x3651[_0x4a31e2];return _0x41070d;};'use strict';var multer=require('multer');var util=require(_0x1365('0x0'));var path=require(_0x1365('0x1'));var timeout=require(_0x1365('0x2'));var express=require(_0x1365('0x3'));var router=express[_0x1365('0x4')]();var fs_extra=require(_0x1365('0x5'));var auth=require(_0x1365('0x6'));var interaction=require(_0x1365('0x7'));var config=require(_0x1365('0x8'));var controller=require(_0x1365('0x9'));router['get']('/',auth[_0x1365('0xa')](),controller[_0x1365('0xb')]);router['get'](_0x1365('0xc'),auth[_0x1365('0xa')](),controller[_0x1365('0xd')]);router['get'](_0x1365('0xe'),auth['isAuthenticated'](),controller[_0x1365('0xf')]);router['post']('/',auth[_0x1365('0xa')](),interaction[_0x1365('0x10')](_0x1365('0x11'),_0x1365('0x12')),controller['create']);router[_0x1365('0x13')](_0x1365('0x14'),controller[_0x1365('0x15')]);router['put'](_0x1365('0xe'),auth[_0x1365('0xa')](),controller[_0x1365('0x16')]);router[_0x1365('0x17')](_0x1365('0x18'),auth[_0x1365('0xa')](),controller[_0x1365('0x19')]);router[_0x1365('0x17')](_0x1365('0x1a'),auth[_0x1365('0xa')](),controller[_0x1365('0x1b')]);router[_0x1365('0x1c')](_0x1365('0xe'),auth[_0x1365('0xa')](),controller[_0x1365('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 6a19cb6..6a8fc3d 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 _0xc58a=['ENUM','out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0xc58a,0x64));var _0xac58=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xc58a[_0x1fdb40];return _0x281f93;};'use strict';var Sequelize=require('sequelize');module[_0xac58('0x0')]={'body':{'type':Sequelize[_0xac58('0x1')](_0xac58('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xac58('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xac58('0x4')]('in',_0xac58('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xac58('0x6')]},'readAt':{'type':Sequelize[_0xac58('0x7')]},'secret':{'type':Sequelize[_0xac58('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xac58('0x1')]}}; \ No newline at end of file +var _0xd47c=['TEXT','BOOLEAN','ENUM','out','STRING','DATE','exports'];(function(_0x42abe4,_0xa1fd5){var _0x40280f=function(_0x5d5a33){while(--_0x5d5a33){_0x42abe4['push'](_0x42abe4['shift']());}};_0x40280f(++_0xa1fd5);}(_0xd47c,0x195));var _0xcd47=function(_0x5410fd,_0x42e056){_0x5410fd=_0x5410fd-0x0;var _0x1e98e4=_0xd47c[_0x5410fd];return _0x1e98e4;};'use strict';var Sequelize=require('sequelize');module[_0xcd47('0x0')]={'body':{'type':Sequelize[_0xcd47('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcd47('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd47('0x3')]('in',_0xcd47('0x4')),'defaultValue':_0xcd47('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcd47('0x5')](0xbe)},'phone':{'type':Sequelize[_0xcd47('0x5')]},'readAt':{'type':Sequelize[_0xcd47('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcd47('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7940fdd..5e9dfc1 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 _0x06f5=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','find','create','body','update','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','user','agent','get','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','email','manual','channel','motionChannel','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','fullname','internal','interface','event','rejectmessage','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','WhatsappMessage','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x5993de,_0x1e902f){var _0x481faf=function(_0x11dea1){while(--_0x11dea1){_0x5993de['push'](_0x5993de['shift']());}};_0x481faf(++_0x1e902f);}(_0x06f5,0x1e4));var _0x506f=function(_0x1147ff,_0x3e62f3){_0x1147ff=_0x1147ff-0x0;var _0x79b1e9=_0x06f5[_0x1147ff];return _0x79b1e9;};'use strict';var emlformat=require(_0x506f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x506f('0x1'));var jsonpatch=require(_0x506f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x506f('0x3'));var Mustache=require(_0x506f('0x4'));var util=require(_0x506f('0x5'));var path=require(_0x506f('0x6'));var sox=require(_0x506f('0x7'));var csv=require(_0x506f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x506f('0x9'));var _=require(_0x506f('0xa'));var squel=require(_0x506f('0xb'));var crypto=require(_0x506f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x506f('0xd'));var toCsv=require(_0x506f('0x8'));var querystring=require('querystring');var Papa=require(_0x506f('0xe'));var Redis=require(_0x506f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x506f('0x10'));var as=require(_0x506f('0x11'));var hardwareService=require(_0x506f('0x12'));var logger=require('../../config/logger')(_0x506f('0x13'));var utils=require(_0x506f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x506f('0x15'));var db=require(_0x506f('0x16'))['db'];config[_0x506f('0x17')]=_[_0x506f('0x18')](config[_0x506f('0x17')],{'host':_0x506f('0x19'),'port':0x18eb});var socket=require(_0x506f('0x1a'))(new Redis(config[_0x506f('0x17')]));require(_0x506f('0x1b'))[_0x506f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x506f('0x1d')][_0x506f('0x1e')]({'port':0x232c});var client9002=jayson[_0x506f('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x73c8e3,_0x2906c7,_0x737118,_0xd9cc8f){return new BPromise(function(_0x197d5f,_0x5dba7b){var _0xdc6282=_0xd9cc8f||client;return _0xdc6282[_0x506f('0x1f')](_0x73c8e3,_0x737118)[_0x506f('0x20')](function(_0xc9eded){logger[_0x506f('0x21')](_0x506f('0x22'),_0x2906c7,'request\x20sent');logger[_0x506f('0x23')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2906c7,_0x506f('0x24'),JSON['stringify'](_0xc9eded));if(_0xc9eded[_0x506f('0x25')]){if(_0xc9eded[_0x506f('0x25')][_0x506f('0x26')]===0x1f4){logger['error'](_0x506f('0x22'),_0x2906c7,_0xc9eded[_0x506f('0x25')][_0x506f('0x27')]);return _0x5dba7b(_0xc9eded[_0x506f('0x25')][_0x506f('0x27')]);}logger[_0x506f('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2906c7,_0xc9eded[_0x506f('0x25')]['message']);return _0x197d5f(_0xc9eded[_0x506f('0x25')][_0x506f('0x27')]);}else{logger['info'](_0x506f('0x22'),_0x2906c7,_0x506f('0x24'));_0x197d5f(_0xc9eded[_0x506f('0x28')]['message']);}})[_0x506f('0x29')](function(_0x1855d6){logger[_0x506f('0x25')](_0x506f('0x22'),_0x2906c7,_0x1855d6);_0x5dba7b(_0x1855d6);});});}function respondWithStatusCode(_0x22af61,_0x222795){_0x222795=_0x222795||0xcc;return function(_0x5c7313){if(_0x5c7313){return _0x22af61['sendStatus'](_0x222795);}return _0x22af61['status'](_0x222795)[_0x506f('0x2a')]();};}function respondWithResult(_0x176212,_0x3e50a6){_0x3e50a6=_0x3e50a6||0xc8;return function(_0x296d85){if(_0x296d85){return _0x176212[_0x506f('0x2b')](_0x3e50a6)[_0x506f('0x2c')](_0x296d85);}};}function respondWithFilteredResult(_0x2b0ade,_0xa6861){return function(_0x486322){if(_0x486322){var _0x20bd65=typeof _0xa6861[_0x506f('0x2d')]===_0x506f('0x2e')&&typeof _0xa6861[_0x506f('0x2f')]===_0x506f('0x2e');var _0x191f55=_0x486322[_0x506f('0x30')];var _0x185ef3=_0x20bd65?0x0:_0xa6861[_0x506f('0x2d')];var _0x1970b3=_0x20bd65?_0x486322['count']:_0xa6861[_0x506f('0x2d')]+_0xa6861[_0x506f('0x2f')];var _0x50c74e;if(_0x1970b3>=_0x191f55){_0x1970b3=_0x191f55;_0x50c74e=0xc8;}else{_0x50c74e=0xce;}_0x2b0ade[_0x506f('0x2b')](_0x50c74e);return _0x2b0ade[_0x506f('0x31')](_0x506f('0x32'),_0x185ef3+'-'+_0x1970b3+'/'+_0x191f55)['json'](_0x486322);}return null;};}function patchUpdates(_0x334210){return function(_0x3698c5){try{jsonpatch[_0x506f('0x33')](_0x3698c5,_0x334210,!![]);}catch(_0x36557f){return BPromise[_0x506f('0x34')](_0x36557f);}return _0x3698c5[_0x506f('0x35')]();};}function saveUpdates(_0x5e0a16,_0x33cacf){return function(_0x3f9595){if(_0x3f9595){return _0x3f9595['update'](_0x5e0a16)[_0x506f('0x20')](function(_0x2f2f0c){return _0x2f2f0c;});}return null;};}function removeEntity(_0x18fa78,_0x4e9cbb){return function(_0x546567){if(_0x546567){return _0x546567[_0x506f('0x36')]()[_0x506f('0x20')](function(){_0x18fa78[_0x506f('0x2b')](0xcc)[_0x506f('0x2a')]();});}};}function handleEntityNotFound(_0x3807b6,_0x34ee04){return function(_0x594da5){if(!_0x594da5){_0x3807b6[_0x506f('0x37')](0x194);}return _0x594da5;};}function handleError(_0x407387,_0x58c4d9){_0x58c4d9=_0x58c4d9||0x1f4;return function(_0xc3f473){logger['error'](_0xc3f473[_0x506f('0x38')]);if(_0xc3f473[_0x506f('0x39')]){delete _0xc3f473[_0x506f('0x39')];}_0x407387[_0x506f('0x2b')](_0x58c4d9)[_0x506f('0x3a')](_0xc3f473);};}exports['index']=function(_0x304c15,_0x463057){var _0x11c7ff={},_0x5dac03={},_0x5f111a={'count':0x0,'rows':[]};var _0x1a7fac=_['map'](db[_0x506f('0x3b')][_0x506f('0x3c')],function(_0x3a4e0d){return{'name':_0x3a4e0d[_0x506f('0x3d')],'type':_0x3a4e0d[_0x506f('0x3e')]['key']};});_0x5dac03['model']=_[_0x506f('0x3f')](_0x1a7fac,_0x506f('0x39'));_0x5dac03[_0x506f('0x40')]=_['keys'](_0x304c15['query']);_0x5dac03[_0x506f('0x41')]=_[_0x506f('0x42')](_0x5dac03[_0x506f('0x43')],_0x5dac03[_0x506f('0x40')]);_0x11c7ff[_0x506f('0x44')]=_[_0x506f('0x42')](_0x5dac03[_0x506f('0x43')],qs[_0x506f('0x45')](_0x304c15['query']['fields']));_0x11c7ff[_0x506f('0x44')]=_0x11c7ff['attributes'][_0x506f('0x46')]?_0x11c7ff[_0x506f('0x44')]:_0x5dac03[_0x506f('0x43')];if(!_0x304c15['query'][_0x506f('0x47')](_0x506f('0x48'))){_0x11c7ff[_0x506f('0x2f')]=qs['limit'](_0x304c15[_0x506f('0x40')]['limit']);_0x11c7ff[_0x506f('0x2d')]=qs[_0x506f('0x2d')](_0x304c15[_0x506f('0x40')][_0x506f('0x2d')]);}_0x11c7ff[_0x506f('0x49')]=qs[_0x506f('0x4a')](_0x304c15[_0x506f('0x40')][_0x506f('0x4a')]);_0x11c7ff[_0x506f('0x4b')]=qs[_0x506f('0x41')](_[_0x506f('0x4c')](_0x304c15[_0x506f('0x40')],_0x5dac03[_0x506f('0x41')]),_0x1a7fac);if(_0x304c15['query'][_0x506f('0x4d')]){_0x11c7ff[_0x506f('0x4b')]=_['merge'](_0x11c7ff[_0x506f('0x4b')],{'$or':_[_0x506f('0x3f')](_0x1a7fac,function(_0x3b5a72){if(_0x3b5a72[_0x506f('0x3e')]!==_0x506f('0x4e')){var _0x4226cb={};_0x4226cb[_0x3b5a72['name']]={'$like':'%'+_0x304c15['query'][_0x506f('0x4d')]+'%'};return _0x4226cb;}})});}_0x11c7ff=_[_0x506f('0x4f')]({},_0x11c7ff,_0x304c15[_0x506f('0x50')]);var _0x2e98bd={'where':_0x11c7ff[_0x506f('0x4b')]};return db['WhatsappMessage'][_0x506f('0x30')](_0x2e98bd)[_0x506f('0x20')](function(_0x53ea01){_0x5f111a['count']=_0x53ea01;if(_0x304c15[_0x506f('0x40')]['includeAll']){_0x11c7ff['include']=[{'all':!![]}];}return db[_0x506f('0x3b')][_0x506f('0x51')](_0x11c7ff);})['then'](function(_0x38cc63){_0x5f111a[_0x506f('0x52')]=_0x38cc63;return _0x5f111a;})[_0x506f('0x20')](respondWithFilteredResult(_0x463057,_0x11c7ff))[_0x506f('0x29')](handleError(_0x463057,null));};exports[_0x506f('0x53')]=function(_0x1a06b5,_0x5ec4b2){var _0x39e99f={'raw':!![],'where':{'id':_0x1a06b5[_0x506f('0x54')]['id']}},_0x5308f9={};_0x5308f9[_0x506f('0x43')]=_[_0x506f('0x55')](db[_0x506f('0x3b')]['rawAttributes']);_0x5308f9['query']=_[_0x506f('0x55')](_0x1a06b5[_0x506f('0x40')]);_0x5308f9['filters']=_['intersection'](_0x5308f9[_0x506f('0x43')],_0x5308f9[_0x506f('0x40')]);_0x39e99f[_0x506f('0x44')]=_[_0x506f('0x42')](_0x5308f9[_0x506f('0x43')],qs['fields'](_0x1a06b5['query'][_0x506f('0x45')]));_0x39e99f[_0x506f('0x44')]=_0x39e99f[_0x506f('0x44')][_0x506f('0x46')]?_0x39e99f[_0x506f('0x44')]:_0x5308f9['model'];if(_0x1a06b5[_0x506f('0x40')][_0x506f('0x56')]){_0x39e99f[_0x506f('0x57')]=[{'all':!![]}];}_0x39e99f=_[_0x506f('0x4f')]({},_0x39e99f,_0x1a06b5[_0x506f('0x50')]);return db[_0x506f('0x3b')][_0x506f('0x58')](_0x39e99f)['then'](handleEntityNotFound(_0x5ec4b2,null))['then'](respondWithResult(_0x5ec4b2,null))[_0x506f('0x29')](handleError(_0x5ec4b2,null));};exports['create']=function(_0x46285a,_0x5213b6){return db['WhatsappMessage'][_0x506f('0x59')](_0x46285a[_0x506f('0x5a')],{})[_0x506f('0x20')](respondWithResult(_0x5213b6,0xc9))[_0x506f('0x29')](handleError(_0x5213b6,null));};exports[_0x506f('0x5b')]=function(_0x35f234,_0x559658){if(_0x35f234[_0x506f('0x5a')]['id']){delete _0x35f234[_0x506f('0x5a')]['id'];}return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x35f234['params']['id']}})['then'](handleEntityNotFound(_0x559658,null))['then'](saveUpdates(_0x35f234[_0x506f('0x5a')],null))['then'](respondWithResult(_0x559658,null))[_0x506f('0x29')](handleError(_0x559658,null));};exports[_0x506f('0x36')]=function(_0x5ee824,_0x5f07a2){return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x5ee824[_0x506f('0x54')]['id']}})[_0x506f('0x20')](handleEntityNotFound(_0x5f07a2,null))[_0x506f('0x20')](removeEntity(_0x5f07a2,null))['catch'](handleError(_0x5f07a2,null));};exports[_0x506f('0x5c')]=function(_0x277ddf,_0x406c4e){return db[_0x506f('0x3b')][_0x506f('0x5c')]()[_0x506f('0x20')](respondWithResult(_0x406c4e,null))[_0x506f('0x29')](handleError(_0x406c4e,null));};var interaction_log=require(_0x506f('0x5d'))(_0x506f('0x5e'));exports[_0x506f('0x5f')]=function(_0x2443c0,_0x5094bd,_0x2aeb72){var _0x11aaed={'agent':{},'channel':_0x506f('0x60')};if(_0x2443c0[_0x506f('0x5a')]['id']){delete _0x2443c0[_0x506f('0x5a')]['id'];}_0x2443c0['body']['read']=!![];_0x2443c0[_0x506f('0x5a')][_0x506f('0x61')]=moment()[_0x506f('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2443c0['body']['UserId']=_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')]||_0x2443c0[_0x506f('0x64')]['id'];_0x11aaed[_0x506f('0x65')]['id']=_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')];return db[_0x506f('0x3b')]['find']({'where':{'id':_0x2443c0[_0x506f('0x54')]['id'],'UserId':null}})[_0x506f('0x20')](handleEntityNotFound(_0x5094bd,null))[_0x506f('0x20')](saveUpdates(_0x2443c0[_0x506f('0x5a')],null))[_0x506f('0x20')](function(_0x4082a5){if(_0x4082a5){_0x11aaed[_0x506f('0x27')]=_0x4082a5[_0x506f('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0x506f('0x58')]({'where':{'id':_0x4082a5[_0x506f('0x67')]}});}return null;})[_0x506f('0x20')](handleEntityNotFound(_0x5094bd,null))['then'](function(_0x467eed){if(_0x467eed){return _0x467eed['update']({'UserId':_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')],'read1stAt':_['isNil'](_0x467eed['read1stAt'])?moment()[_0x506f('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x506f('0x20')](function(_0x6ecc66){if(_0x6ecc66){_0x11aaed[_0x506f('0x68')]=_0x6ecc66[_0x506f('0x66')]({'plain':!![]});interaction_log[_0x506f('0x21')](_0x506f('0x69'),_0x2443c0['user']['id'],_0x2443c0[_0x506f('0x64')]['name'],_0x2443c0[_0x506f('0x64')][_0x506f('0x6a')],_0x11aaed[_0x506f('0x68')]['id'],_0x2443c0[_0x506f('0x5a')]?JSON[_0x506f('0x6b')](_0x2443c0[_0x506f('0x5a')]):_0x506f('0x6c'));return respondWithRpcPromise(_0x506f('0x6d'),_0x506f('0x6e'),_0x11aaed);}return null;})[_0x506f('0x20')](function(_0x4d8525){var _0xbf332a=_0x506f('0x6f')+_0x4d8525[_0x506f('0x27')][_0x506f('0x70')];return db[_0x506f('0x71')][_0x506f('0x40')](_0xbf332a,{'type':db['Sequelize'][_0x506f('0x72')][_0x506f('0x73')],'raw':!![]})[_0x506f('0x20')](function(_0x23e6a2){return _0x23e6a2;});})[_0x506f('0x20')](function(_0x37d14b){if(_0x37d14b){_0x11aaed[_0x506f('0x27')][_0x506f('0x74')]=_0x37d14b[0x0];if(!_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')])return;return db['User'][_0x506f('0x58')]({'where':{'id':_0x2443c0[_0x506f('0x5a')][_0x506f('0x63')],'role':'agent'},'attributes':['id',_0x506f('0x39'),'fullname',_0x506f('0x75'),'internal'],'raw':!![]});}return null;})[_0x506f('0x20')](function(_0x12563f){if(!_0x12563f)return null;_0x11aaed[_0x506f('0x27')]['agent']=_0x12563f;return _0x11aaed;})[_0x506f('0x20')](function(_0x58ea52){if(_0x58ea52){if(_0x2443c0[_0x506f('0x5a')][_0x506f('0x76')]){_0x11aaed[_0x506f('0x27')]['interface']=util['format']('SIP/%s',_0x2443c0['user'][_0x506f('0x39')]);_0x11aaed['message']['channel']=_0x11aaed[_0x506f('0x77')];_0x11aaed[_0x506f('0x27')][_0x506f('0x78')]=_0x11aaed['channel'];_0x11aaed['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x506f('0x79'),{'event':_0x506f('0x7a'),'message':_0x11aaed['message']},client9002)[_0x506f('0x20')](function(){return _0x11aaed;});}return _0x11aaed;}return null;})[_0x506f('0x20')](respondWithResult(_0x5094bd,null))[_0x506f('0x29')](handleError(_0x5094bd,null));};var interaction_log=require(_0x506f('0x5d'))(_0x506f('0x5e'));exports[_0x506f('0x34')]=function(_0x47ba66,_0x2fb7a6,_0x43bfd9){var _0x3680ae={'agent':{},'channel':_0x506f('0x60')};if(_0x47ba66[_0x506f('0x5a')]['id']){delete _0x47ba66['body']['id'];}_0x47ba66['body'][_0x506f('0x63')]=_0x47ba66['body']['UserId']||_0x47ba66[_0x506f('0x64')]['id'];_0x3680ae[_0x506f('0x65')]['id']=_0x47ba66[_0x506f('0x5a')][_0x506f('0x63')];return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x47ba66[_0x506f('0x54')]['id'],'UserId':null}})[_0x506f('0x20')](handleEntityNotFound(_0x2fb7a6,null))['then'](function(_0x3e2fd7){if(_0x3e2fd7){_0x3680ae['message']=_0x3e2fd7[_0x506f('0x66')]({'plain':!![]});return db[_0x506f('0x7b')][_0x506f('0x58')]({'where':{'id':_0x3e2fd7[_0x506f('0x67')]}});}return null;})[_0x506f('0x20')](handleEntityNotFound(_0x2fb7a6,null))[_0x506f('0x20')](function(_0x15d252){if(_0x15d252){_0x3680ae[_0x506f('0x68')]=_0x15d252[_0x506f('0x66')]({'plain':!![]});interaction_log[_0x506f('0x21')](_0x506f('0x7c'),_0x47ba66['user']['id'],_0x47ba66[_0x506f('0x64')][_0x506f('0x39')],_0x47ba66[_0x506f('0x64')][_0x506f('0x6a')],_0x3680ae[_0x506f('0x68')]['id'],_0x47ba66[_0x506f('0x5a')]?JSON[_0x506f('0x6b')](_0x47ba66[_0x506f('0x5a')]):_0x506f('0x6c'));return respondWithRpcPromise(_0x506f('0x7d'),'rejectMessage',_0x3680ae);}return null;})[_0x506f('0x20')](function(_0x7ec4d6){var _0x4a486a=_0x506f('0x6f')+_0x7ec4d6['message'][_0x506f('0x70')];return db[_0x506f('0x71')][_0x506f('0x40')](_0x4a486a,{'type':db[_0x506f('0x7e')][_0x506f('0x72')][_0x506f('0x73')],'raw':!![]})['then'](function(_0x25b264){return _0x25b264;});})['then'](function(_0x395bad){if(_0x395bad){_0x3680ae[_0x506f('0x27')][_0x506f('0x74')]=_0x395bad[0x0];if(!_0x47ba66[_0x506f('0x5a')][_0x506f('0x63')])return;return db['User']['find']({'where':{'id':_0x47ba66[_0x506f('0x5a')][_0x506f('0x63')],'role':_0x506f('0x65')},'attributes':['id',_0x506f('0x39'),_0x506f('0x7f'),_0x506f('0x75'),_0x506f('0x80')],'raw':!![]});}return null;})['then'](function(_0x666f99){if(!_0x666f99)return null;_0x3680ae[_0x506f('0x27')][_0x506f('0x65')]=_0x666f99;return _0x3680ae;})[_0x506f('0x20')](function(_0x297ed9){if(_0x297ed9){_0x297ed9[_0x506f('0x27')][_0x506f('0x81')]=util[_0x506f('0x62')]('SIP/%s',_0x47ba66['user'][_0x506f('0x39')]);_0x297ed9[_0x506f('0x27')][_0x506f('0x77')]=_0x3680ae[_0x506f('0x77')];_0x297ed9['message'][_0x506f('0x78')]=_0x3680ae[_0x506f('0x77')];_0x297ed9[_0x506f('0x27')][_0x506f('0x82')]=_0x506f('0x34');respondWithRpcPromise('EventManager',_0x506f('0x79'),{'event':_0x506f('0x83'),'message':_0x297ed9[_0x506f('0x27')]},client9002);return _0x3680ae;}return null;})[_0x506f('0x20')](respondWithResult(_0x2fb7a6,null))[_0x506f('0x29')](handleError(_0x2fb7a6,null));};exports['status']=function(_0x294a77,_0x3bfd42,_0x526ea1){if(_0x294a77[_0x506f('0x5a')]['id']){delete _0x294a77[_0x506f('0x5a')]['id'];}var _0xf21856;return db[_0x506f('0x3b')][_0x506f('0x58')]({'where':{'id':_0x294a77[_0x506f('0x54')]['id']}})[_0x506f('0x20')](handleEntityNotFound(_0x3bfd42,null))['then'](function(_0x5a3768){if(_0x5a3768){_0xf21856=_0x5a3768;return db['WhatsappAccount']['find']({'where':{'id':_0x5a3768['WhatsappAccountId']}});}})[_0x506f('0x20')](handleEntityNotFound(_0x3bfd42,null))[_0x506f('0x20')](function(_0x3fd0c2){if(_0x3fd0c2){logger[_0x506f('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x506f('0x2b'),_0x506f('0x84'),_0x3fd0c2[_0x506f('0x3e')],util['inspect'](_0x294a77[_0x506f('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3fd0c2[_0x506f('0x3e')]){case _0x506f('0x85'):if(_0x294a77['body'][_0x506f('0x86')]&&_0x294a77[_0x506f('0x5a')][_0x506f('0x86')]===_0xf21856['messageId']&&_0x294a77['body'][_0x506f('0x87')]&&_0x294a77[_0x506f('0x5a')][_0x506f('0x87')]===_0x506f('0x88')){return _0xf21856[_0x506f('0x5b')]({'read':!![]});}else{logger['error'](_0x506f('0x89'),_0x506f('0x2b'),_0x506f('0x85'),util[_0x506f('0x8a')](_0x294a77[_0x506f('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xf21856;}})[_0x506f('0x20')](respondWithResult(_0x3bfd42,null))['catch'](handleError(_0x3bfd42,null));}; \ No newline at end of file +var _0x7ecc=['email','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','role','RejectMessage','rejectMessage','internal','EventManager','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','format','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname'];(function(_0x2db9b7,_0x1b362c){var _0x5d9d8f=function(_0x2e8b7a){while(--_0x2e8b7a){_0x2db9b7['push'](_0x2db9b7['shift']());}};_0x5d9d8f(++_0x1b362c);}(_0x7ecc,0x126));var _0xc7ec=function(_0x43ce71,_0x2a63bd){_0x43ce71=_0x43ce71-0x0;var _0x53b032=_0x7ecc[_0x43ce71];return _0x53b032;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7ec('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7ec('0x1'));var rp=require('request-promise');var moment=require(_0xc7ec('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc7ec('0x3'));var util=require('util');var path=require(_0xc7ec('0x4'));var sox=require(_0xc7ec('0x5'));var csv=require(_0xc7ec('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc7ec('0x7'));var _=require(_0xc7ec('0x8'));var squel=require(_0xc7ec('0x9'));var crypto=require(_0xc7ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc7ec('0xb'));var toCsv=require(_0xc7ec('0x6'));var querystring=require(_0xc7ec('0xc'));var Papa=require(_0xc7ec('0xd'));var Redis=require(_0xc7ec('0xe'));var authService=require(_0xc7ec('0xf'));var qs=require(_0xc7ec('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7ec('0x11'))(_0xc7ec('0x12'));var utils=require(_0xc7ec('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc7ec('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc7ec('0x15')](config[_0xc7ec('0x16')],{'host':_0xc7ec('0x17'),'port':0x18eb});var socket=require(_0xc7ec('0x18'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0xc7ec('0x19'));var client=jayson['client'][_0xc7ec('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xc7ec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x383787,_0x53889f,_0x4e5b45,_0x55a4f0){return new BPromise(function(_0x19dbcf,_0x33ac63){var _0x468715=_0x55a4f0||client;return _0x468715[_0xc7ec('0x1b')](_0x383787,_0x4e5b45)['then'](function(_0x16a9cf){logger[_0xc7ec('0x1c')](_0xc7ec('0x1d'),_0x53889f,_0xc7ec('0x1e'));logger[_0xc7ec('0x1f')](_0xc7ec('0x20'),_0x53889f,_0xc7ec('0x1e'),JSON['stringify'](_0x16a9cf));if(_0x16a9cf[_0xc7ec('0x21')]){if(_0x16a9cf['error'][_0xc7ec('0x22')]===0x1f4){logger[_0xc7ec('0x21')](_0xc7ec('0x1d'),_0x53889f,_0x16a9cf[_0xc7ec('0x21')]['message']);return _0x33ac63(_0x16a9cf[_0xc7ec('0x21')][_0xc7ec('0x23')]);}logger[_0xc7ec('0x21')](_0xc7ec('0x1d'),_0x53889f,_0x16a9cf[_0xc7ec('0x21')]['message']);return _0x19dbcf(_0x16a9cf[_0xc7ec('0x21')]['message']);}else{logger[_0xc7ec('0x1c')](_0xc7ec('0x1d'),_0x53889f,_0xc7ec('0x1e'));_0x19dbcf(_0x16a9cf[_0xc7ec('0x24')][_0xc7ec('0x23')]);}})[_0xc7ec('0x25')](function(_0x2ec99e){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x53889f,_0x2ec99e);_0x33ac63(_0x2ec99e);});});}function respondWithStatusCode(_0x42033e,_0x4d15e4){_0x4d15e4=_0x4d15e4||0xcc;return function(_0x12da80){if(_0x12da80){return _0x42033e['sendStatus'](_0x4d15e4);}return _0x42033e[_0xc7ec('0x26')](_0x4d15e4)['end']();};}function respondWithResult(_0x548844,_0x31ab61){_0x31ab61=_0x31ab61||0xc8;return function(_0x4636fe){if(_0x4636fe){return _0x548844[_0xc7ec('0x26')](_0x31ab61)['json'](_0x4636fe);}};}function respondWithFilteredResult(_0x19f73a,_0x9deb1b){return function(_0x970b0f){if(_0x970b0f){var _0x43bdf7=typeof _0x9deb1b[_0xc7ec('0x27')]===_0xc7ec('0x28')&&typeof _0x9deb1b[_0xc7ec('0x29')]===_0xc7ec('0x28');var _0x631f05=_0x970b0f['count'];var _0x51ff32=_0x43bdf7?0x0:_0x9deb1b[_0xc7ec('0x27')];var _0x3b8ee0=_0x43bdf7?_0x970b0f[_0xc7ec('0x2a')]:_0x9deb1b[_0xc7ec('0x27')]+_0x9deb1b['limit'];var _0x17d4e4;if(_0x3b8ee0>=_0x631f05){_0x3b8ee0=_0x631f05;_0x17d4e4=0xc8;}else{_0x17d4e4=0xce;}_0x19f73a[_0xc7ec('0x26')](_0x17d4e4);return _0x19f73a[_0xc7ec('0x2b')](_0xc7ec('0x2c'),_0x51ff32+'-'+_0x3b8ee0+'/'+_0x631f05)[_0xc7ec('0x2d')](_0x970b0f);}return null;};}function patchUpdates(_0x2a04e8){return function(_0x35c506){try{jsonpatch[_0xc7ec('0x2e')](_0x35c506,_0x2a04e8,!![]);}catch(_0x36ec2d){return BPromise[_0xc7ec('0x2f')](_0x36ec2d);}return _0x35c506[_0xc7ec('0x30')]();};}function saveUpdates(_0x3362fb,_0x580668){return function(_0x4ff3c7){if(_0x4ff3c7){return _0x4ff3c7[_0xc7ec('0x31')](_0x3362fb)[_0xc7ec('0x32')](function(_0xf6ddc6){return _0xf6ddc6;});}return null;};}function removeEntity(_0x3dd7ba,_0x31bf89){return function(_0xf9af91){if(_0xf9af91){return _0xf9af91[_0xc7ec('0x33')]()[_0xc7ec('0x32')](function(){_0x3dd7ba[_0xc7ec('0x26')](0xcc)[_0xc7ec('0x34')]();});}};}function handleEntityNotFound(_0x3b9a25,_0xda48e8){return function(_0x190c42){if(!_0x190c42){_0x3b9a25['sendStatus'](0x194);}return _0x190c42;};}function handleError(_0x2a1d2e,_0x186ac2){_0x186ac2=_0x186ac2||0x1f4;return function(_0x329cdf){logger['error'](_0x329cdf['stack']);if(_0x329cdf[_0xc7ec('0x35')]){delete _0x329cdf[_0xc7ec('0x35')];}_0x2a1d2e[_0xc7ec('0x26')](_0x186ac2)[_0xc7ec('0x36')](_0x329cdf);};}exports[_0xc7ec('0x37')]=function(_0x553d68,_0x5bfc1){var _0x4b8f9b={},_0x55ef27={},_0xa14585={'count':0x0,'rows':[]};var _0x4ab5ad=_[_0xc7ec('0x38')](db[_0xc7ec('0x39')][_0xc7ec('0x3a')],function(_0x13aade){return{'name':_0x13aade[_0xc7ec('0x3b')],'type':_0x13aade[_0xc7ec('0x3c')][_0xc7ec('0x3d')]};});_0x55ef27[_0xc7ec('0x3e')]=_['map'](_0x4ab5ad,'name');_0x55ef27[_0xc7ec('0x3f')]=_[_0xc7ec('0x40')](_0x553d68['query']);_0x55ef27[_0xc7ec('0x41')]=_[_0xc7ec('0x42')](_0x55ef27['model'],_0x55ef27[_0xc7ec('0x3f')]);_0x4b8f9b[_0xc7ec('0x43')]=_[_0xc7ec('0x42')](_0x55ef27[_0xc7ec('0x3e')],qs[_0xc7ec('0x44')](_0x553d68[_0xc7ec('0x3f')][_0xc7ec('0x44')]));_0x4b8f9b['attributes']=_0x4b8f9b[_0xc7ec('0x43')][_0xc7ec('0x45')]?_0x4b8f9b[_0xc7ec('0x43')]:_0x55ef27['model'];if(!_0x553d68[_0xc7ec('0x3f')][_0xc7ec('0x46')](_0xc7ec('0x47'))){_0x4b8f9b[_0xc7ec('0x29')]=qs['limit'](_0x553d68[_0xc7ec('0x3f')]['limit']);_0x4b8f9b[_0xc7ec('0x27')]=qs[_0xc7ec('0x27')](_0x553d68[_0xc7ec('0x3f')]['offset']);}_0x4b8f9b[_0xc7ec('0x48')]=qs['sort'](_0x553d68[_0xc7ec('0x3f')][_0xc7ec('0x49')]);_0x4b8f9b[_0xc7ec('0x4a')]=qs[_0xc7ec('0x41')](_[_0xc7ec('0x4b')](_0x553d68[_0xc7ec('0x3f')],_0x55ef27[_0xc7ec('0x41')]),_0x4ab5ad);if(_0x553d68['query']['filter']){_0x4b8f9b[_0xc7ec('0x4a')]=_[_0xc7ec('0x4c')](_0x4b8f9b[_0xc7ec('0x4a')],{'$or':_[_0xc7ec('0x38')](_0x4ab5ad,function(_0x1b6f5c){if(_0x1b6f5c[_0xc7ec('0x3c')]!==_0xc7ec('0x4d')){var _0x1a77e4={};_0x1a77e4[_0x1b6f5c['name']]={'$like':'%'+_0x553d68[_0xc7ec('0x3f')]['filter']+'%'};return _0x1a77e4;}})});}_0x4b8f9b=_[_0xc7ec('0x4c')]({},_0x4b8f9b,_0x553d68['options']);var _0x3b6a00={'where':_0x4b8f9b[_0xc7ec('0x4a')]};return db[_0xc7ec('0x39')]['count'](_0x3b6a00)[_0xc7ec('0x32')](function(_0x316e89){_0xa14585[_0xc7ec('0x2a')]=_0x316e89;if(_0x553d68[_0xc7ec('0x3f')][_0xc7ec('0x4e')]){_0x4b8f9b[_0xc7ec('0x4f')]=[{'all':!![]}];}return db[_0xc7ec('0x39')]['findAll'](_0x4b8f9b);})[_0xc7ec('0x32')](function(_0x3a13de){_0xa14585[_0xc7ec('0x50')]=_0x3a13de;return _0xa14585;})[_0xc7ec('0x32')](respondWithFilteredResult(_0x5bfc1,_0x4b8f9b))[_0xc7ec('0x25')](handleError(_0x5bfc1,null));};exports[_0xc7ec('0x51')]=function(_0x28fa22,_0x570cb3){var _0x2eb227={'raw':!![],'where':{'id':_0x28fa22[_0xc7ec('0x52')]['id']}},_0x8593a2={};_0x8593a2[_0xc7ec('0x3e')]=_[_0xc7ec('0x40')](db[_0xc7ec('0x39')][_0xc7ec('0x3a')]);_0x8593a2[_0xc7ec('0x3f')]=_['keys'](_0x28fa22[_0xc7ec('0x3f')]);_0x8593a2[_0xc7ec('0x41')]=_[_0xc7ec('0x42')](_0x8593a2['model'],_0x8593a2[_0xc7ec('0x3f')]);_0x2eb227[_0xc7ec('0x43')]=_[_0xc7ec('0x42')](_0x8593a2[_0xc7ec('0x3e')],qs[_0xc7ec('0x44')](_0x28fa22[_0xc7ec('0x3f')][_0xc7ec('0x44')]));_0x2eb227[_0xc7ec('0x43')]=_0x2eb227['attributes'][_0xc7ec('0x45')]?_0x2eb227['attributes']:_0x8593a2['model'];if(_0x28fa22[_0xc7ec('0x3f')][_0xc7ec('0x4e')]){_0x2eb227[_0xc7ec('0x4f')]=[{'all':!![]}];}_0x2eb227=_['merge']({},_0x2eb227,_0x28fa22[_0xc7ec('0x53')]);return db[_0xc7ec('0x39')][_0xc7ec('0x54')](_0x2eb227)['then'](handleEntityNotFound(_0x570cb3,null))[_0xc7ec('0x32')](respondWithResult(_0x570cb3,null))['catch'](handleError(_0x570cb3,null));};exports[_0xc7ec('0x55')]=function(_0x118324,_0x29a9ec){return db[_0xc7ec('0x39')][_0xc7ec('0x55')](_0x118324['body'],{})['then'](respondWithResult(_0x29a9ec,0xc9))[_0xc7ec('0x25')](handleError(_0x29a9ec,null));};exports['update']=function(_0x367f53,_0x245f8f){if(_0x367f53['body']['id']){delete _0x367f53[_0xc7ec('0x56')]['id'];}return db[_0xc7ec('0x39')]['find']({'where':{'id':_0x367f53['params']['id']}})['then'](handleEntityNotFound(_0x245f8f,null))[_0xc7ec('0x32')](saveUpdates(_0x367f53[_0xc7ec('0x56')],null))[_0xc7ec('0x32')](respondWithResult(_0x245f8f,null))[_0xc7ec('0x25')](handleError(_0x245f8f,null));};exports[_0xc7ec('0x33')]=function(_0x4b0b49,_0x15f4f2){return db[_0xc7ec('0x39')][_0xc7ec('0x54')]({'where':{'id':_0x4b0b49['params']['id']}})[_0xc7ec('0x32')](handleEntityNotFound(_0x15f4f2,null))[_0xc7ec('0x32')](removeEntity(_0x15f4f2,null))['catch'](handleError(_0x15f4f2,null));};exports[_0xc7ec('0x57')]=function(_0x5e3ab9,_0xa1bd62){return db[_0xc7ec('0x39')]['describe']()[_0xc7ec('0x32')](respondWithResult(_0xa1bd62,null))[_0xc7ec('0x25')](handleError(_0xa1bd62,null));};var interaction_log=require(_0xc7ec('0x11'))(_0xc7ec('0x58'));exports[_0xc7ec('0x59')]=function(_0x46a666,_0xca61ce,_0x56949e){var _0x25e6cd={'agent':{},'channel':_0xc7ec('0x5a')};if(_0x46a666['body']['id']){delete _0x46a666[_0xc7ec('0x56')]['id'];}_0x46a666['body'][_0xc7ec('0x5b')]=!![];_0x46a666['body']['readAt']=moment()[_0xc7ec('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x46a666['body'][_0xc7ec('0x5d')]=_0x46a666[_0xc7ec('0x56')][_0xc7ec('0x5d')]||_0x46a666[_0xc7ec('0x5e')]['id'];_0x25e6cd['agent']['id']=_0x46a666[_0xc7ec('0x56')][_0xc7ec('0x5d')];return db[_0xc7ec('0x39')][_0xc7ec('0x54')]({'where':{'id':_0x46a666['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xca61ce,null))[_0xc7ec('0x32')](saveUpdates(_0x46a666[_0xc7ec('0x56')],null))[_0xc7ec('0x32')](function(_0x1b8191){if(_0x1b8191){_0x25e6cd[_0xc7ec('0x23')]=_0x1b8191[_0xc7ec('0x5f')]({'plain':!![]});return db[_0xc7ec('0x60')][_0xc7ec('0x54')]({'where':{'id':_0x1b8191[_0xc7ec('0x61')]}});}return null;})['then'](handleEntityNotFound(_0xca61ce,null))[_0xc7ec('0x32')](function(_0x5bb4c2){if(_0x5bb4c2){return _0x5bb4c2['update']({'UserId':_0x46a666[_0xc7ec('0x56')][_0xc7ec('0x5d')],'read1stAt':_['isNil'](_0x5bb4c2[_0xc7ec('0x62')])?moment()[_0xc7ec('0x5c')](_0xc7ec('0x63')):undefined});}return null;})[_0xc7ec('0x32')](function(_0x226577){if(_0x226577){_0x25e6cd[_0xc7ec('0x64')]=_0x226577[_0xc7ec('0x5f')]({'plain':!![]});interaction_log[_0xc7ec('0x1c')](_0xc7ec('0x65'),_0x46a666['user']['id'],_0x46a666[_0xc7ec('0x5e')][_0xc7ec('0x35')],_0x46a666['user']['role'],_0x25e6cd['interaction']['id'],_0x46a666[_0xc7ec('0x56')]?JSON[_0xc7ec('0x66')](_0x46a666[_0xc7ec('0x56')]):_0xc7ec('0x67'));return respondWithRpcPromise(_0xc7ec('0x68'),'acceptMessage',_0x25e6cd);}return null;})[_0xc7ec('0x32')](function(_0x436acb){var _0x27ecd6=_0xc7ec('0x69')+_0x436acb[_0xc7ec('0x23')][_0xc7ec('0x6a')];return db[_0xc7ec('0x6b')]['query'](_0x27ecd6,{'type':db[_0xc7ec('0x6c')]['QueryTypes'][_0xc7ec('0x6d')],'raw':!![]})[_0xc7ec('0x32')](function(_0x2dc0ce){return _0x2dc0ce;});})[_0xc7ec('0x32')](function(_0x51f49e){if(_0x51f49e){_0x25e6cd[_0xc7ec('0x23')][_0xc7ec('0x6e')]=_0x51f49e[0x0];if(!_0x46a666[_0xc7ec('0x56')][_0xc7ec('0x5d')])return;return db[_0xc7ec('0x6f')]['find']({'where':{'id':_0x46a666[_0xc7ec('0x56')][_0xc7ec('0x5d')],'role':_0xc7ec('0x70')},'attributes':['id',_0xc7ec('0x35'),_0xc7ec('0x71'),_0xc7ec('0x72'),'internal'],'raw':!![]});}return null;})[_0xc7ec('0x32')](function(_0x504107){if(!_0x504107)return null;_0x25e6cd[_0xc7ec('0x23')]['agent']=_0x504107;return _0x25e6cd;})[_0xc7ec('0x32')](function(_0x287bf3){if(_0x287bf3){if(_0x46a666[_0xc7ec('0x56')][_0xc7ec('0x73')]){_0x25e6cd[_0xc7ec('0x23')][_0xc7ec('0x74')]=util[_0xc7ec('0x5c')](_0xc7ec('0x75'),_0x46a666['user'][_0xc7ec('0x35')]);_0x25e6cd[_0xc7ec('0x23')][_0xc7ec('0x76')]=_0x25e6cd['channel'];_0x25e6cd[_0xc7ec('0x23')][_0xc7ec('0x77')]=_0x25e6cd['channel'];_0x25e6cd[_0xc7ec('0x23')][_0xc7ec('0x78')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc7ec('0x79'),'message':_0x25e6cd[_0xc7ec('0x23')]},client9002)[_0xc7ec('0x32')](function(){return _0x25e6cd;});}return _0x25e6cd;}return null;})[_0xc7ec('0x32')](respondWithResult(_0xca61ce,null))[_0xc7ec('0x25')](handleError(_0xca61ce,null));};var interaction_log=require('../../config/logger')(_0xc7ec('0x58'));exports[_0xc7ec('0x2f')]=function(_0x45ff37,_0x1526a4,_0x2bb4ed){var _0xcf3191={'agent':{},'channel':_0xc7ec('0x5a')};if(_0x45ff37[_0xc7ec('0x56')]['id']){delete _0x45ff37['body']['id'];}_0x45ff37[_0xc7ec('0x56')]['UserId']=_0x45ff37[_0xc7ec('0x56')][_0xc7ec('0x5d')]||_0x45ff37[_0xc7ec('0x5e')]['id'];_0xcf3191['agent']['id']=_0x45ff37[_0xc7ec('0x56')][_0xc7ec('0x5d')];return db[_0xc7ec('0x39')][_0xc7ec('0x54')]({'where':{'id':_0x45ff37['params']['id'],'UserId':null}})[_0xc7ec('0x32')](handleEntityNotFound(_0x1526a4,null))[_0xc7ec('0x32')](function(_0xd7dd90){if(_0xd7dd90){_0xcf3191['message']=_0xd7dd90[_0xc7ec('0x5f')]({'plain':!![]});return db[_0xc7ec('0x60')][_0xc7ec('0x54')]({'where':{'id':_0xd7dd90[_0xc7ec('0x61')]}});}return null;})[_0xc7ec('0x32')](handleEntityNotFound(_0x1526a4,null))[_0xc7ec('0x32')](function(_0x3c5819){if(_0x3c5819){_0xcf3191['interaction']=_0x3c5819[_0xc7ec('0x5f')]({'plain':!![]});interaction_log[_0xc7ec('0x1c')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x45ff37[_0xc7ec('0x5e')]['id'],_0x45ff37[_0xc7ec('0x5e')][_0xc7ec('0x35')],_0x45ff37[_0xc7ec('0x5e')][_0xc7ec('0x7a')],_0xcf3191[_0xc7ec('0x64')]['id'],_0x45ff37['body']?JSON[_0xc7ec('0x66')](_0x45ff37['body']):'null');return respondWithRpcPromise(_0xc7ec('0x7b'),_0xc7ec('0x7c'),_0xcf3191);}return null;})['then'](function(_0xc1e276){var _0x3834b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xc1e276[_0xc7ec('0x23')][_0xc7ec('0x6a')];return db['sequelize'][_0xc7ec('0x3f')](_0x3834b3,{'type':db['Sequelize']['QueryTypes'][_0xc7ec('0x6d')],'raw':!![]})['then'](function(_0x13653b){return _0x13653b;});})[_0xc7ec('0x32')](function(_0x290477){if(_0x290477){_0xcf3191[_0xc7ec('0x23')]['contact']=_0x290477[0x0];if(!_0x45ff37['body']['UserId'])return;return db[_0xc7ec('0x6f')][_0xc7ec('0x54')]({'where':{'id':_0x45ff37[_0xc7ec('0x56')][_0xc7ec('0x5d')],'role':'agent'},'attributes':['id',_0xc7ec('0x35'),'fullname','email',_0xc7ec('0x7d')],'raw':!![]});}return null;})[_0xc7ec('0x32')](function(_0x222692){if(!_0x222692)return null;_0xcf3191[_0xc7ec('0x23')][_0xc7ec('0x70')]=_0x222692;return _0xcf3191;})[_0xc7ec('0x32')](function(_0x22ef6f){if(_0x22ef6f){_0x22ef6f[_0xc7ec('0x23')][_0xc7ec('0x74')]=util[_0xc7ec('0x5c')](_0xc7ec('0x75'),_0x45ff37[_0xc7ec('0x5e')][_0xc7ec('0x35')]);_0x22ef6f[_0xc7ec('0x23')]['channel']=_0xcf3191[_0xc7ec('0x76')];_0x22ef6f[_0xc7ec('0x23')][_0xc7ec('0x77')]=_0xcf3191[_0xc7ec('0x76')];_0x22ef6f['message'][_0xc7ec('0x78')]=_0xc7ec('0x2f');respondWithRpcPromise(_0xc7ec('0x7e'),_0xc7ec('0x7e'),{'event':'rejectmessage','message':_0x22ef6f[_0xc7ec('0x23')]},client9002);return _0xcf3191;}return null;})[_0xc7ec('0x32')](respondWithResult(_0x1526a4,null))[_0xc7ec('0x25')](handleError(_0x1526a4,null));};exports[_0xc7ec('0x26')]=function(_0x293286,_0x56a53a,_0x213e17){if(_0x293286[_0xc7ec('0x56')]['id']){delete _0x293286[_0xc7ec('0x56')]['id'];}var _0xc3a719;return db[_0xc7ec('0x39')]['find']({'where':{'id':_0x293286['params']['id']}})[_0xc7ec('0x32')](handleEntityNotFound(_0x56a53a,null))['then'](function(_0x30914c){if(_0x30914c){_0xc3a719=_0x30914c;return db[_0xc7ec('0x7f')][_0xc7ec('0x54')]({'where':{'id':_0x30914c[_0xc7ec('0x80')]}});}})['then'](handleEntityNotFound(_0x56a53a,null))[_0xc7ec('0x32')](function(_0x4be68f){if(_0x4be68f){logger['debug'](_0xc7ec('0x81'),'status',_0xc7ec('0x82'),_0x4be68f[_0xc7ec('0x3c')],util['inspect'](_0x293286[_0xc7ec('0x56')],{'showHidden':![],'depth':null}));switch(_0x4be68f[_0xc7ec('0x3c')]){case _0xc7ec('0x83'):if(_0x293286[_0xc7ec('0x56')][_0xc7ec('0x84')]&&_0x293286[_0xc7ec('0x56')][_0xc7ec('0x84')]===_0xc3a719['messageId']&&_0x293286[_0xc7ec('0x56')][_0xc7ec('0x85')]&&_0x293286['body'][_0xc7ec('0x85')]===_0xc7ec('0x5b')){return _0xc3a719[_0xc7ec('0x31')]({'read':!![]});}else{logger['error'](_0xc7ec('0x86'),_0xc7ec('0x26'),'twilio',util[_0xc7ec('0x87')](_0x293286[_0xc7ec('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xc3a719;}})['then'](respondWithResult(_0x56a53a,null))[_0xc7ec('0x25')](handleError(_0x56a53a,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 06274ef..23bca91 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 _0xcf66=['exports','events','../../mysqldb','WhatsappMessage','save','update','emit','hasOwnProperty'];(function(_0x52e614,_0x1f7097){var _0x4b0c83=function(_0x1f2694){while(--_0x1f2694){_0x52e614['push'](_0x52e614['shift']());}};_0x4b0c83(++_0x1f7097);}(_0xcf66,0x71));var _0x6cf6=function(_0x59a4d1,_0x53a0ad){_0x59a4d1=_0x59a4d1-0x0;var _0x113e78=_0xcf66[_0x59a4d1];return _0x113e78;};'use strict';var EventEmitter=require(_0x6cf6('0x0'));var WhatsappMessage=require(_0x6cf6('0x1'))['db'][_0x6cf6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6cf6('0x3'),'afterUpdate':_0x6cf6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e16eb){return function(_0x1c599d,_0x45d0d8,_0x57f22f){WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb+':'+_0x1c599d['id'],_0x1c599d);WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb,_0x1c599d);_0x57f22f(null);};}for(var e in events){if(events[_0x6cf6('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x6cf6('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x693f=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','update'];(function(_0x32e3eb,_0x30312f){var _0x489e3f=function(_0x5035fb){while(--_0x5035fb){_0x32e3eb['push'](_0x32e3eb['shift']());}};_0x489e3f(++_0x30312f);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xf693('0x0'));var WhatsappMessage=require(_0xf693('0x1'))['db'][_0xf693('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf693('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf693('0x4'),'afterDestroy':_0xf693('0x5')};function emitEvent(_0xe37cf3){return function(_0x1d272f,_0x3d2e05,_0x6e749b){WhatsappMessageEvents[_0xf693('0x6')](_0xe37cf3+':'+_0x1d272f['id'],_0x1d272f);WhatsappMessageEvents['emit'](_0xe37cf3,_0x1d272f);_0x6e749b(null);};}for(var e in events){if(events[_0xf693('0x7')](e)){var event=events[e];WhatsappMessage[_0xf693('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 5d5c6f7..fcf6a5e 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 _0xa368=['direction','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','toLowerCase','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','phone','text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','request-promise','node-fetch','path','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','body','FULLTEXT','models','get'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xa368,0xd3));var _0x8a36=function(_0x1cf050,_0xd76301){_0x1cf050=_0x1cf050-0x0;var _0x5239f3=_0xa368[_0x1cf050];return _0x5239f3;};'use strict';var _=require(_0x8a36('0x0'));var util=require('util');var logger=require(_0x8a36('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8a36('0x2'));var fetch=require(_0x8a36('0x3'));var fs=require('fs');var path=require(_0x8a36('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a36('0x5'));module[_0x8a36('0x6')]=function(_0x381b5f,_0x26d1a9){return _0x381b5f['define'](_0x8a36('0x7'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8a36('0x8'),'fields':[_0x8a36('0x8')]},{'name':'fti_whatsapp_messages','fields':[_0x8a36('0x9')],'type':_0x8a36('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31b952,_0x2144b0,_0x428f25){var _0x2d1470=_0x381b5f[_0x8a36('0xb')];var _0x28f001=_0x31b952[_0x8a36('0xc')]({'plain':!![]});if(_0x28f001[_0x8a36('0xd')]['toLowerCase']()==='in'||_0x28f001[_0x8a36('0xd')]['toLowerCase']()===_0x8a36('0xe')&&!_0x28f001[_0x8a36('0xf')]&&!_['isNil'](_0x28f001[_0x8a36('0x10')])){_0x2d1470[_0x8a36('0x11')][_0x8a36('0x12')]({'where':{'id':_0x28f001[_0x8a36('0x13')]}})['then'](function(_0x3ee164){if(_0x3ee164){_0x3ee164[_0x8a36('0x14')]({'lastMsgAt':_0x28f001['createdAt'],'lastMsgDirection':_0x28f001['direction'][_0x8a36('0x15')]()});}})['catch'](function(_0x2934cf){console[_0x8a36('0x16')](_0x2934cf);});}if(_0x28f001[_0x8a36('0xd')]===_0x8a36('0xe')&&!_0x28f001['secret']){var _0x5105da;_0x2d1470[_0x8a36('0x17')][_0x8a36('0x18')]({'where':{'id':_0x28f001[_0x8a36('0x19')]},'raw':!![]})[_0x8a36('0x1a')](function(_0xa902a9){_0x5105da=_0xa902a9;if(_0x5105da&&_0x5105da[_0x8a36('0x1b')]){switch(_0x5105da[_0x8a36('0x1b')]){case'twilio':var _0x14cffb=require(_0x8a36('0x1c'));if(_0x5105da[_0x8a36('0x1d')]&&_0x5105da[_0x8a36('0x1e')]&&_0x5105da['phone']){var _0x56629a=new _0x14cffb(_0x5105da[_0x8a36('0x1d')],_0x5105da[_0x8a36('0x1e')]);_0x56629a[_0x8a36('0x1f')][_0x8a36('0x20')]({'body':_0x28f001[_0x8a36('0x9')],'to':'whatsapp:'+_0x28f001['phone'],'from':'whatsapp:'+_0x5105da['phone'],'statusCallback':_0x5105da[_0x8a36('0x21')]+_0x8a36('0x22')+_0x28f001['id']+_0x8a36('0x23')+_0x5105da[_0x8a36('0x24')]})['then'](function(_0x1a1d2f){if(_0x1a1d2f['sid']){return _0x31b952[_0x8a36('0x14')]({'messageId':_0x1a1d2f[_0x8a36('0x25')]});}})[_0x8a36('0x26')](function(_0x2d3973){logger['error'](_0x8a36('0x27'),_0x8a36('0x28'),'twilio',util['inspect'](_0x2d3973,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8a36('0x27'),_0x8a36('0x28'),_0x8a36('0x1c'),_0x8a36('0x29'));}break;case _0x8a36('0x2a'):var _0x3a22d6=_0x5105da[_0x8a36('0x1d')];var _0x11ce93=_0x5105da[_0x8a36('0x1e')];var _0x1a0f82=_0x5105da[_0x8a36('0x2b')]+'/whatsapp/v1/'+_0x3a22d6+_0x8a36('0x2c');var _0x204d3f={'to':[_0x28f001[_0x8a36('0x2d')]],'message':{'type':_0x8a36('0x2e'),'text':_0x28f001[_0x8a36('0x9')]}};var _0x5d92fd={'method':_0x8a36('0x2f'),'uri':_0x1a0f82,'headers':{'Authorization':_0x8a36('0x30')+_0x11ce93,'Content-Type':_0x8a36('0x31')},'body':_0x204d3f,'json':!![]};rp(_0x5d92fd)[_0x8a36('0x1a')](function(_0x386859){if(_0x386859[_0x8a36('0x32')][0x0]['message_id']){return _0x31b952[_0x8a36('0x14')]({'messageId':_0x386859[_0x8a36('0x32')][0x0][_0x8a36('0x33')]});}})['catch'](function(_0x312e1f){logger['err'](_0x8a36('0x34'),_0x312e1f);});break;}}})[_0x8a36('0x35')](function(){_0x428f25();});}else{_0x428f25();}}},'charset':_0x8a36('0x36'),'collate':_0x8a36('0x37')});}; \ No newline at end of file +var _0xabae=['error','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','api','moment','node-fetch','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','then','createdAt','catch'];(function(_0x30623e,_0x39b154){var _0x8b5786=function(_0x34484a){while(--_0x34484a){_0x30623e['push'](_0x30623e['shift']());}};_0x8b5786(++_0x39b154);}(_0xabae,0x1ea));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xeaba('0x0'));var util=require(_0xeaba('0x1'));var logger=require('../../config/logger')(_0xeaba('0x2'));var moment=require(_0xeaba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0xeaba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeaba('0x5'));module['exports']=function(_0x1512de,_0x59c776){return _0x1512de[_0xeaba('0x6')]('WhatsappMessage',attributes,{'tableName':_0xeaba('0x7'),'paranoid':![],'indexes':[{'name':_0xeaba('0x8'),'fields':[_0xeaba('0x8')]},{'name':_0xeaba('0x9'),'fields':[_0xeaba('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x322e2f,_0x282027,_0x448df6){var _0x3a7cdf=_0x1512de[_0xeaba('0xb')];var _0x486296=_0x322e2f[_0xeaba('0xc')]({'plain':!![]});if(_0x486296[_0xeaba('0xd')][_0xeaba('0xe')]()==='in'||_0x486296[_0xeaba('0xd')][_0xeaba('0xe')]()===_0xeaba('0xf')&&!_0x486296['secret']&&!_[_0xeaba('0x10')](_0x486296[_0xeaba('0x11')])){_0x3a7cdf[_0xeaba('0x12')][_0xeaba('0x13')]({'where':{'id':_0x486296['WhatsappInteractionId']}})[_0xeaba('0x14')](function(_0x23fa06){if(_0x23fa06){_0x23fa06['update']({'lastMsgAt':_0x486296[_0xeaba('0x15')],'lastMsgDirection':_0x486296[_0xeaba('0xd')]['toLowerCase']()});}})[_0xeaba('0x16')](function(_0x58cbb9){console[_0xeaba('0x17')](_0x58cbb9);});}if(_0x486296[_0xeaba('0xd')]===_0xeaba('0xf')&&!_0x486296[_0xeaba('0x18')]){var _0x1964c8;_0x3a7cdf[_0xeaba('0x19')]['find']({'where':{'id':_0x486296[_0xeaba('0x1a')]},'raw':!![]})['then'](function(_0x3c1a41){_0x1964c8=_0x3c1a41;if(_0x1964c8&&_0x1964c8[_0xeaba('0x1b')]){switch(_0x1964c8[_0xeaba('0x1b')]){case _0xeaba('0x1c'):var _0x538bd5=require(_0xeaba('0x1c'));if(_0x1964c8[_0xeaba('0x1d')]&&_0x1964c8[_0xeaba('0x1e')]&&_0x1964c8[_0xeaba('0x1f')]){var _0x2badd9=new _0x538bd5(_0x1964c8[_0xeaba('0x1d')],_0x1964c8[_0xeaba('0x1e')]);_0x2badd9[_0xeaba('0x20')][_0xeaba('0x21')]({'body':_0x486296['body'],'to':_0xeaba('0x22')+_0x486296[_0xeaba('0x1f')],'from':_0xeaba('0x22')+_0x1964c8[_0xeaba('0x1f')],'statusCallback':_0x1964c8[_0xeaba('0x23')]+_0xeaba('0x24')+_0x486296['id']+_0xeaba('0x25')+_0x1964c8[_0xeaba('0x26')]})[_0xeaba('0x14')](function(_0x131bd5){if(_0x131bd5[_0xeaba('0x27')]){return _0x322e2f[_0xeaba('0x28')]({'messageId':_0x131bd5['sid']});}})[_0xeaba('0x16')](function(_0x50ba29){logger[_0xeaba('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xeaba('0x1c'),util[_0xeaba('0x29')](_0x50ba29,{'showHidden':![],'depth':null}));});}else{logger[_0xeaba('0x17')](_0xeaba('0x2a'),_0xeaba('0x2b'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xeaba('0x2c'):var _0x4fbc71=_0x1964c8[_0xeaba('0x1d')];var _0xd71f2=_0x1964c8[_0xeaba('0x1e')];var _0x2ce3be=_0x1964c8[_0xeaba('0x2d')]+_0xeaba('0x2e')+_0x4fbc71+_0xeaba('0x2f');var _0x40c1b8={'to':[_0x486296[_0xeaba('0x1f')]],'message':{'type':'text','text':_0x486296[_0xeaba('0xa')]}};var _0x424575={'method':_0xeaba('0x30'),'uri':_0x2ce3be,'headers':{'Authorization':_0xeaba('0x31')+_0xd71f2,'Content-Type':_0xeaba('0x32')},'body':_0x40c1b8,'json':!![]};rp(_0x424575)[_0xeaba('0x14')](function(_0x36d15e){if(_0x36d15e[_0xeaba('0x33')][0x0][_0xeaba('0x34')]){return _0x322e2f['update']({'messageId':_0x36d15e['statuses'][0x0][_0xeaba('0x34')]});}})[_0xeaba('0x16')](function(_0x1dbfdd){logger[_0xeaba('0x35')](_0xeaba('0x36'),_0x1dbfdd);});break;}}})[_0xeaba('0x37')](function(){_0x448df6();});}else{_0x448df6();}}},'charset':_0xeaba('0x38'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ee10d1c..c204edd 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 _0xe82a=['CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','WhatsappMessage','body','raw'];(function(_0x34d559,_0xc30b58){var _0x2112a5=function(_0x25b6fc){while(--_0x25b6fc){_0x34d559['push'](_0x34d559['shift']());}};_0x2112a5(++_0xc30b58);}(_0xe82a,0x161));var _0xae82=function(_0x2d1f90,_0x3855bb){_0x2d1f90=_0x2d1f90-0x0;var _0x38a52a=_0xe82a[_0x2d1f90];return _0x38a52a;};'use strict';var _=require(_0xae82('0x0'));var util=require(_0xae82('0x1'));var moment=require(_0xae82('0x2'));var BPromise=require(_0xae82('0x3'));var rs=require(_0xae82('0x4'));var fs=require('fs');var Redis=require(_0xae82('0x5'));var db=require(_0xae82('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae82('0x7'))(_0xae82('0x8'));var config=require(_0xae82('0x9'));var jayson=require(_0xae82('0xa'));var client=jayson[_0xae82('0xb')][_0xae82('0xc')]({'port':0x232a});config['redis']=_[_0xae82('0xd')](config[_0xae82('0xe')],{'host':_0xae82('0xf'),'port':0x18eb});var socket=require(_0xae82('0x10'))(new Redis(config[_0xae82('0xe')]));require('./whatsappMessage.socket')[_0xae82('0x11')](socket);function respondWithRpcPromise(_0x3e4990,_0x5e84b7,_0x15afad){return new BPromise(function(_0x17b394,_0x39aa82){return client['request'](_0x3e4990,_0x15afad)[_0xae82('0x12')](function(_0x33a773){logger[_0xae82('0x13')](_0xae82('0x14'),_0x5e84b7,_0xae82('0x15'));logger[_0xae82('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5e84b7,'request\x20sent',JSON[_0xae82('0x17')](_0x33a773));if(_0x33a773[_0xae82('0x18')]){if(_0x33a773['error'][_0xae82('0x19')]===0x1f4){logger[_0xae82('0x18')](_0xae82('0x14'),_0x5e84b7,_0x33a773[_0xae82('0x18')][_0xae82('0x1a')]);return _0x39aa82(_0x33a773[_0xae82('0x18')][_0xae82('0x1a')]);}logger[_0xae82('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x5e84b7,_0x33a773[_0xae82('0x18')]['message']);return _0x17b394(_0x33a773['error']['message']);}else{logger[_0xae82('0x13')](_0xae82('0x14'),_0x5e84b7,_0xae82('0x15'));_0x17b394(_0x33a773['result']['message']);}})[_0xae82('0x1b')](function(_0x798bba){logger[_0xae82('0x18')](_0xae82('0x14'),_0x5e84b7,_0x798bba);_0x39aa82(_0x798bba);});});}exports['CreateWhatsappMessage']=function(_0xa2837b){var _0x1a7c09=this;return new Promise(function(_0x3d4da3,_0x1e78eb){return db[_0xae82('0x1c')]['create'](_0xa2837b[_0xae82('0x1d')],{'raw':_0xa2837b['options']?_0xa2837b['options'][_0xae82('0x1e')]===undefined?!![]:![]:!![]})[_0xae82('0x12')](function(_0x52f13d){logger['info']('CreateWhatsappMessage',_0xa2837b);logger[_0xae82('0x16')](_0xae82('0x1f'),_0xa2837b,JSON[_0xae82('0x17')](_0x52f13d));_0x3d4da3(_0x52f13d);})[_0xae82('0x1b')](function(_0x541c96){logger[_0xae82('0x18')](_0xae82('0x1f'),_0x541c96[_0xae82('0x1a')],_0xa2837b);_0x1e78eb(_0x1a7c09[_0xae82('0x18')](0x1f4,_0x541c96[_0xae82('0x1a')]));});});}; \ No newline at end of file +var _0x7629=['WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','body','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb960db,_0x41c3a1){var _0x27f471=function(_0x52ca87){while(--_0x52ca87){_0xb960db['push'](_0xb960db['shift']());}};_0x27f471(++_0x41c3a1);}(_0x7629,0x147));var _0x9762=function(_0x42f982,_0x51e48f){_0x42f982=_0x42f982-0x0;var _0x2a32c3=_0x7629[_0x42f982];return _0x2a32c3;};'use strict';var _=require(_0x9762('0x0'));var util=require(_0x9762('0x1'));var moment=require(_0x9762('0x2'));var BPromise=require('bluebird');var rs=require(_0x9762('0x3'));var fs=require('fs');var Redis=require(_0x9762('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9762('0x5'));var logger=require('../../config/logger')(_0x9762('0x6'));var config=require(_0x9762('0x7'));var jayson=require(_0x9762('0x8'));var client=jayson[_0x9762('0x9')][_0x9762('0xa')]({'port':0x232a});config[_0x9762('0xb')]=_[_0x9762('0xc')](config[_0x9762('0xb')],{'host':_0x9762('0xd'),'port':0x18eb});var socket=require(_0x9762('0xe'))(new Redis(config[_0x9762('0xb')]));require('./whatsappMessage.socket')[_0x9762('0xf')](socket);function respondWithRpcPromise(_0x456637,_0x2a0e9b,_0x2edb07){return new BPromise(function(_0x46bb7a,_0x12727e){return client[_0x9762('0x10')](_0x456637,_0x2edb07)[_0x9762('0x11')](function(_0x37681c){logger[_0x9762('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x2a0e9b,_0x9762('0x13'));logger[_0x9762('0x14')](_0x9762('0x15'),_0x2a0e9b,'request\x20sent',JSON[_0x9762('0x16')](_0x37681c));if(_0x37681c[_0x9762('0x17')]){if(_0x37681c[_0x9762('0x17')][_0x9762('0x18')]===0x1f4){logger[_0x9762('0x17')](_0x9762('0x19'),_0x2a0e9b,_0x37681c[_0x9762('0x17')][_0x9762('0x1a')]);return _0x12727e(_0x37681c[_0x9762('0x17')][_0x9762('0x1a')]);}logger[_0x9762('0x17')](_0x9762('0x19'),_0x2a0e9b,_0x37681c[_0x9762('0x17')]['message']);return _0x46bb7a(_0x37681c['error'][_0x9762('0x1a')]);}else{logger[_0x9762('0x12')](_0x9762('0x19'),_0x2a0e9b,_0x9762('0x13'));_0x46bb7a(_0x37681c[_0x9762('0x1b')]['message']);}})[_0x9762('0x1c')](function(_0x90cc46){logger[_0x9762('0x17')](_0x9762('0x19'),_0x2a0e9b,_0x90cc46);_0x12727e(_0x90cc46);});});}exports[_0x9762('0x1d')]=function(_0xe9df39){var _0x248cc3=this;return new Promise(function(_0x5596c1,_0x1f350c){return db['WhatsappMessage']['create'](_0xe9df39[_0x9762('0x1e')],{'raw':_0xe9df39['options']?_0xe9df39['options'][_0x9762('0x1f')]===undefined?!![]:![]:!![]})[_0x9762('0x11')](function(_0xd9f92f){logger[_0x9762('0x12')](_0x9762('0x1d'),_0xe9df39);logger[_0x9762('0x14')]('CreateWhatsappMessage',_0xe9df39,JSON[_0x9762('0x16')](_0xd9f92f));_0x5596c1(_0xd9f92f);})[_0x9762('0x1c')](function(_0x4c159d){logger['error']('CreateWhatsappMessage',_0x4c159d[_0x9762('0x1a')],_0xe9df39);_0x1f350c(_0x248cc3[_0x9762('0x17')](0x1f4,_0x4c159d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 9092044..420ea5a 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 _0x11f0=['save','remove','update','emit','removeListener','length','./whatsappMessage.events'];(function(_0x2ca0e1,_0x21848){var _0x133555=function(_0x1bea04){while(--_0x1bea04){_0x2ca0e1['push'](_0x2ca0e1['shift']());}};_0x133555(++_0x21848);}(_0x11f0,0x187));var _0x011f=function(_0x4d3ff9,_0x563356){_0x4d3ff9=_0x4d3ff9-0x0;var _0x260279=_0x11f0[_0x4d3ff9];return _0x260279;};'use strict';var WhatsappMessageEvents=require(_0x011f('0x0'));var events=[_0x011f('0x1'),_0x011f('0x2'),_0x011f('0x3')];function createListener(_0x475596,_0x599556){return function(_0x132c6c){_0x599556[_0x011f('0x4')](_0x475596,_0x132c6c);};}function removeListener(_0x1e8da2,_0x54662d){return function(){WhatsappMessageEvents[_0x011f('0x5')](_0x1e8da2,_0x54662d);};}exports['register']=function(_0x36eafb){for(var _0x4c1c1a=0x0,_0x57137e=events[_0x011f('0x6')];_0x4c1c1a<_0x57137e;_0x4c1c1a++){var _0x5913cb=events[_0x4c1c1a];var _0x1eb6ef=createListener('whatsappMessage:'+_0x5913cb,_0x36eafb);WhatsappMessageEvents['on'](_0x5913cb,_0x1eb6ef);}}; \ No newline at end of file +var _0x87b6=['save','removeListener','register','length'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x87b6,0x1f0));var _0x687b=function(_0x33ca61,_0x26bebe){_0x33ca61=_0x33ca61-0x0;var _0x2aa545=_0x87b6[_0x33ca61];return _0x2aa545;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x687b('0x0'),'remove','update'];function createListener(_0x91cd4b,_0x25a9c4){return function(_0x2eab9a){_0x25a9c4['emit'](_0x91cd4b,_0x2eab9a);};}function removeListener(_0x495190,_0x291439){return function(){WhatsappMessageEvents[_0x687b('0x1')](_0x495190,_0x291439);};}exports[_0x687b('0x2')]=function(_0x2fb814){for(var _0x2990cd=0x0,_0x32a03e=events[_0x687b('0x3')];_0x2990cd<_0x32a03e;_0x2990cd++){var _0x2d1426=events[_0x2990cd];var _0x45f003=createListener('whatsappMessage:'+_0x2d1426,_0x2fb814);WhatsappMessageEvents['on'](_0x2d1426,_0x45f003);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3891484..787426c 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 _0x058d=['isAuthenticated','/describe','describe','/:id/members','getMembers','/:id/teams','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','/:id/users','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x5c9c78,_0x1d0c22){var _0x536886=function(_0x32cba8){while(--_0x32cba8){_0x5c9c78['push'](_0x5c9c78['shift']());}};_0x536886(++_0x1d0c22);}(_0x058d,0xce));var _0xd058=function(_0x489cd2,_0x2bab32){_0x489cd2=_0x489cd2-0x0;var _0x24aa64=_0x058d[_0x489cd2];return _0x24aa64;};'use strict';var multer=require('multer');var util=require(_0xd058('0x0'));var path=require(_0xd058('0x1'));var timeout=require(_0xd058('0x2'));var express=require(_0xd058('0x3'));var router=express[_0xd058('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd058('0x5'));var interaction=require(_0xd058('0x6'));var config=require(_0xd058('0x7'));var controller=require(_0xd058('0x8'));router[_0xd058('0x9')]('/',auth[_0xd058('0xa')](),controller['index']);router[_0xd058('0x9')](_0xd058('0xb'),auth['isAuthenticated'](),controller[_0xd058('0xc')]);router[_0xd058('0x9')]('/:id',auth[_0xd058('0xa')](),controller['show']);router[_0xd058('0x9')](_0xd058('0xd'),auth[_0xd058('0xa')](),controller[_0xd058('0xe')]);router[_0xd058('0x9')](_0xd058('0xf'),auth[_0xd058('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0xd058('0xa')](),controller['getAgents']);router[_0xd058('0x10')]('/',auth[_0xd058('0xa')](),controller[_0xd058('0x11')]);router[_0xd058('0x10')]('/:id/teams',auth[_0xd058('0xa')](),controller[_0xd058('0x12')]);router[_0xd058('0x10')]('/:id/users',auth[_0xd058('0xa')](),controller[_0xd058('0x13')]);router[_0xd058('0x14')](_0xd058('0x15'),auth[_0xd058('0xa')](),controller['update']);router[_0xd058('0x16')](_0xd058('0x15'),auth[_0xd058('0xa')](),controller[_0xd058('0x17')]);router[_0xd058('0x16')]('/:id/teams',auth[_0xd058('0xa')](),controller[_0xd058('0x18')]);router[_0xd058('0x16')](_0xd058('0x19'),auth[_0xd058('0xa')](),controller[_0xd058('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x311d=['show','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3db7ac,_0x4b9b9c){var _0x390337=function(_0x1df948){while(--_0x1df948){_0x3db7ac['push'](_0x3db7ac['shift']());}};_0x390337(++_0x4b9b9c);}(_0x311d,0x120));var _0xd311=function(_0x2ea691,_0x1fb4c3){_0x2ea691=_0x2ea691-0x0;var _0x51d176=_0x311d[_0x2ea691];return _0x51d176;};'use strict';var multer=require(_0xd311('0x0'));var util=require(_0xd311('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd311('0x2'));var auth=require(_0xd311('0x3'));var interaction=require(_0xd311('0x4'));var config=require('../../config/environment');var controller=require(_0xd311('0x5'));router[_0xd311('0x6')]('/',auth[_0xd311('0x7')](),controller[_0xd311('0x8')]);router[_0xd311('0x6')](_0xd311('0x9'),auth[_0xd311('0x7')](),controller[_0xd311('0xa')]);router['get'](_0xd311('0xb'),auth[_0xd311('0x7')](),controller[_0xd311('0xc')]);router[_0xd311('0x6')]('/:id/members',auth[_0xd311('0x7')](),controller[_0xd311('0xd')]);router[_0xd311('0x6')](_0xd311('0xe'),auth[_0xd311('0x7')](),controller['getTeams']);router['get'](_0xd311('0xf'),auth[_0xd311('0x7')](),controller['getAgents']);router[_0xd311('0x10')]('/',auth[_0xd311('0x7')](),controller[_0xd311('0x11')]);router[_0xd311('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd311('0x12')]);router[_0xd311('0x10')](_0xd311('0xf'),auth[_0xd311('0x7')](),controller[_0xd311('0x13')]);router[_0xd311('0x14')]('/:id',auth[_0xd311('0x7')](),controller[_0xd311('0x15')]);router['delete'](_0xd311('0xb'),auth[_0xd311('0x7')](),controller[_0xd311('0x16')]);router[_0xd311('0x17')]('/:id/teams',auth[_0xd311('0x7')](),controller['removeTeams']);router[_0xd311('0x17')]('/:id/users',auth[_0xd311('0x7')](),controller['removeAgents']);module[_0xd311('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index df2c7bd..3eeb466 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 _0x851e=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x14a036,_0x1a2355){var _0x4911d1=function(_0x5530db){while(--_0x5530db){_0x14a036['push'](_0x14a036['shift']());}};_0x4911d1(++_0x1a2355);}(_0x851e,0x1e8));var _0xe851=function(_0x18c9ab,_0x6ba7e7){_0x18c9ab=_0x18c9ab-0x0;var _0x17fc37=_0x851e[_0x18c9ab];return _0x17fc37;};'use strict';var Sequelize=require(_0xe851('0x0'));module[_0xe851('0x1')]={'name':{'type':Sequelize[_0xe851('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe851('0x3')](_0xe851('0x4'),_0xe851('0x5'),_0xe851('0x6'))},'description':{'type':Sequelize[_0xe851('0x2')]}}; \ No newline at end of file +var _0xd66c=['ENUM','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x244c88,_0x4c864d){var _0x598140=function(_0x1cf528){while(--_0x1cf528){_0x244c88['push'](_0x244c88['shift']());}};_0x598140(++_0x4c864d);}(_0xd66c,0x106));var _0xcd66=function(_0x211285,_0x42c9d4){_0x211285=_0x211285-0x0;var _0x14a40c=_0xd66c[_0x211285];return _0x14a40c;};'use strict';var Sequelize=require(_0xcd66('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd66('0x1')],'unique':_0xcd66('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcd66('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcd66('0x4')]('rrmemory',_0xcd66('0x5'),_0xcd66('0x6'))},'description':{'type':Sequelize[_0xcd66('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 9b7cbb2..3ed0c23 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 _0x140a=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','ids','Team','findAll','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./whatsappQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','WhatsappQueue','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','find','create'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x140a,0x1dd));var _0xa140=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x140a[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xa140('0x0'));var rimraf=require(_0xa140('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa140('0x2'));var rp=require(_0xa140('0x3'));var moment=require(_0xa140('0x4'));var BPromise=require(_0xa140('0x5'));var Mustache=require('mustache');var util=require(_0xa140('0x6'));var path=require(_0xa140('0x7'));var sox=require(_0xa140('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa140('0x9'));var _=require('lodash');var squel=require(_0xa140('0xa'));var crypto=require(_0xa140('0xb'));var jsforce=require(_0xa140('0xc'));var deskjs=require(_0xa140('0xd'));var toCsv=require(_0xa140('0xe'));var querystring=require(_0xa140('0xf'));var Papa=require(_0xa140('0x10'));var Redis=require(_0xa140('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(_0xa140('0x12'))('api');var utils=require(_0xa140('0x13'));var config=require(_0xa140('0x14'));var licenseUtil=require(_0xa140('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa140('0x16')](config[_0xa140('0x17')],{'host':_0xa140('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa140('0x17')]));require(_0xa140('0x19'))['register'](socket);function respondWithStatusCode(_0xd6bdd5,_0x40a4c5){_0x40a4c5=_0x40a4c5||0xcc;return function(_0x535c70){if(_0x535c70){return _0xd6bdd5[_0xa140('0x1a')](_0x40a4c5);}return _0xd6bdd5[_0xa140('0x1b')](_0x40a4c5)['end']();};}function respondWithResult(_0x55cb3f,_0x3517d3){_0x3517d3=_0x3517d3||0xc8;return function(_0x5730d0){if(_0x5730d0){return _0x55cb3f['status'](_0x3517d3)[_0xa140('0x1c')](_0x5730d0);}};}function respondWithFilteredResult(_0x4a7301,_0x383a78){return function(_0x58e3b3){if(_0x58e3b3){var _0x2e6eeb=typeof _0x383a78[_0xa140('0x1d')]===_0xa140('0x1e')&&typeof _0x383a78[_0xa140('0x1f')]==='undefined';var _0x53a9bd=_0x58e3b3[_0xa140('0x20')];var _0x3e9c2c=_0x2e6eeb?0x0:_0x383a78[_0xa140('0x1d')];var _0x21b965=_0x2e6eeb?_0x58e3b3[_0xa140('0x20')]:_0x383a78[_0xa140('0x1d')]+_0x383a78[_0xa140('0x1f')];var _0x360ba5;if(_0x21b965>=_0x53a9bd){_0x21b965=_0x53a9bd;_0x360ba5=0xc8;}else{_0x360ba5=0xce;}_0x4a7301['status'](_0x360ba5);return _0x4a7301[_0xa140('0x21')](_0xa140('0x22'),_0x3e9c2c+'-'+_0x21b965+'/'+_0x53a9bd)[_0xa140('0x1c')](_0x58e3b3);}return null;};}function patchUpdates(_0x5546aa){return function(_0x336ee0){try{jsonpatch['apply'](_0x336ee0,_0x5546aa,!![]);}catch(_0x10931e){return BPromise[_0xa140('0x23')](_0x10931e);}return _0x336ee0[_0xa140('0x24')]();};}function saveUpdates(_0x53a13a,_0x366515){return function(_0x465c4a){if(_0x465c4a){return _0x465c4a[_0xa140('0x25')](_0x53a13a)[_0xa140('0x26')](function(_0x2b7ed6){return _0x2b7ed6;});}return null;};}function removeEntity(_0x1261ed,_0xafff99){return function(_0x1becae){if(_0x1becae){return _0x1becae[_0xa140('0x27')]()[_0xa140('0x26')](function(){var _0x459d78=_0x1becae[_0xa140('0x28')]({'plain':!![]});var _0x4a6dff=_0xa140('0x29');return db[_0xa140('0x2a')][_0xa140('0x27')]({'where':{'type':_0x4a6dff,'resourceId':_0x459d78['id']}})['then'](function(){return _0x1becae;});})[_0xa140('0x26')](function(){_0x1261ed[_0xa140('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6c66,_0x65e84c){return function(_0x5f1cd2){if(!_0x5f1cd2){_0x2b6c66['sendStatus'](0x194);}return _0x5f1cd2;};}function handleError(_0xbd9c73,_0x3d7185){_0x3d7185=_0x3d7185||0x1f4;return function(_0x25fea6){logger[_0xa140('0x2b')](_0x25fea6[_0xa140('0x2c')]);if(_0x25fea6[_0xa140('0x2d')]){delete _0x25fea6[_0xa140('0x2d')];}_0xbd9c73[_0xa140('0x1b')](_0x3d7185)['send'](_0x25fea6);};}exports[_0xa140('0x2e')]=function(_0x5e42ee,_0x349fc4){var _0x25f141={},_0x1f3c1b={},_0x2b23a7={'count':0x0,'rows':[]};var _0x5caa5f=_['map'](db[_0xa140('0x2f')]['rawAttributes'],function(_0x7e6f13){return{'name':_0x7e6f13[_0xa140('0x30')],'type':_0x7e6f13['type']['key']};});_0x1f3c1b['model']=_['map'](_0x5caa5f,_0xa140('0x2d'));_0x1f3c1b[_0xa140('0x31')]=_[_0xa140('0x32')](_0x5e42ee[_0xa140('0x31')]);_0x1f3c1b[_0xa140('0x33')]=_['intersection'](_0x1f3c1b[_0xa140('0x34')],_0x1f3c1b['query']);_0x25f141[_0xa140('0x35')]=_[_0xa140('0x36')](_0x1f3c1b[_0xa140('0x34')],qs[_0xa140('0x37')](_0x5e42ee['query'][_0xa140('0x37')]));_0x25f141[_0xa140('0x35')]=_0x25f141[_0xa140('0x35')][_0xa140('0x38')]?_0x25f141[_0xa140('0x35')]:_0x1f3c1b[_0xa140('0x34')];if(!_0x5e42ee[_0xa140('0x31')][_0xa140('0x39')](_0xa140('0x3a'))){_0x25f141[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x5e42ee['query'][_0xa140('0x1f')]);_0x25f141[_0xa140('0x1d')]=qs[_0xa140('0x1d')](_0x5e42ee['query']['offset']);}_0x25f141[_0xa140('0x3b')]=qs[_0xa140('0x3c')](_0x5e42ee[_0xa140('0x31')][_0xa140('0x3c')]);_0x25f141[_0xa140('0x3d')]=qs[_0xa140('0x33')](_[_0xa140('0x3e')](_0x5e42ee[_0xa140('0x31')],_0x1f3c1b['filters']),_0x5caa5f);if(_0x5e42ee[_0xa140('0x31')][_0xa140('0x3f')]){_0x25f141['where']=_[_0xa140('0x40')](_0x25f141[_0xa140('0x3d')],{'$or':_[_0xa140('0x41')](_0x5caa5f,function(_0x1d506e){if(_0x1d506e['type']!==_0xa140('0x42')){var _0x2661b1={};_0x2661b1[_0x1d506e['name']]={'$like':'%'+_0x5e42ee[_0xa140('0x31')][_0xa140('0x3f')]+'%'};return _0x2661b1;}})});}_0x25f141=_[_0xa140('0x40')]({},_0x25f141,_0x5e42ee[_0xa140('0x43')]);var _0x48ce0e={'where':_0x25f141['where']};return db[_0xa140('0x2f')][_0xa140('0x20')](_0x48ce0e)[_0xa140('0x26')](function(_0x25fd3d){_0x2b23a7[_0xa140('0x20')]=_0x25fd3d;if(_0x5e42ee[_0xa140('0x31')][_0xa140('0x44')]){_0x25f141[_0xa140('0x45')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x25f141);})[_0xa140('0x26')](function(_0xffa03d){_0x2b23a7['rows']=_0xffa03d;return _0x2b23a7;})[_0xa140('0x26')](respondWithFilteredResult(_0x349fc4,_0x25f141))[_0xa140('0x46')](handleError(_0x349fc4,null));};exports['show']=function(_0x353c2a,_0x58b4d9){var _0x5a18ab={'raw':!![],'where':{'id':_0x353c2a[_0xa140('0x47')]['id']}},_0x5ba5a1={};_0x5ba5a1[_0xa140('0x34')]=_[_0xa140('0x32')](db[_0xa140('0x2f')][_0xa140('0x48')]);_0x5ba5a1[_0xa140('0x31')]=_[_0xa140('0x32')](_0x353c2a[_0xa140('0x31')]);_0x5ba5a1[_0xa140('0x33')]=_['intersection'](_0x5ba5a1[_0xa140('0x34')],_0x5ba5a1['query']);_0x5a18ab['attributes']=_[_0xa140('0x36')](_0x5ba5a1[_0xa140('0x34')],qs[_0xa140('0x37')](_0x353c2a[_0xa140('0x31')][_0xa140('0x37')]));_0x5a18ab[_0xa140('0x35')]=_0x5a18ab[_0xa140('0x35')]['length']?_0x5a18ab[_0xa140('0x35')]:_0x5ba5a1[_0xa140('0x34')];if(_0x353c2a['query']['includeAll']){_0x5a18ab[_0xa140('0x45')]=[{'all':!![]}];}_0x5a18ab=_['merge']({},_0x5a18ab,_0x353c2a[_0xa140('0x43')]);return db[_0xa140('0x2f')][_0xa140('0x49')](_0x5a18ab)[_0xa140('0x26')](handleEntityNotFound(_0x58b4d9,null))['then'](respondWithResult(_0x58b4d9,null))['catch'](handleError(_0x58b4d9,null));};exports[_0xa140('0x4a')]=function(_0x2a9cdb,_0x5a4a39){return db[_0xa140('0x2f')][_0xa140('0x4a')](_0x2a9cdb['body'],{})[_0xa140('0x26')](function(_0xe12e07){var _0x450713=_0x2a9cdb['user']['get']({'plain':!![]});if(!_0x450713)throw new Error(_0xa140('0x4b'));if(_0x450713[_0xa140('0x4c')]==='user'){var _0x495850=_0xe12e07[_0xa140('0x28')]({'plain':!![]});var _0x523193=_0xa140('0x29');return db[_0xa140('0x4d')]['find']({'where':{'name':_0x523193,'userProfileId':_0x450713[_0xa140('0x4e')]},'raw':!![]})[_0xa140('0x26')](function(_0x466d80){if(_0x466d80&&_0x466d80[_0xa140('0x4f')]===0x0){return db[_0xa140('0x2a')][_0xa140('0x4a')]({'name':_0x495850[_0xa140('0x2d')],'resourceId':_0x495850['id'],'type':_0x466d80[_0xa140('0x2d')],'sectionId':_0x466d80['id']},{})['then'](function(){return _0xe12e07;});}else{return _0xe12e07;}})[_0xa140('0x46')](function(_0x5ab12b){logger[_0xa140('0x2b')](_0xa140('0x50'),_0x5ab12b);throw _0x5ab12b;});}return _0xe12e07;})['then'](respondWithResult(_0x5a4a39,0xc9))[_0xa140('0x46')](handleError(_0x5a4a39,null));};exports['update']=function(_0x26e6da,_0x3b5dcb){if(_0x26e6da['body']['id']){delete _0x26e6da[_0xa140('0x51')]['id'];}return db['WhatsappQueue'][_0xa140('0x49')]({'where':{'id':_0x26e6da[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x3b5dcb,null))[_0xa140('0x26')](saveUpdates(_0x26e6da[_0xa140('0x51')],null))[_0xa140('0x26')](respondWithResult(_0x3b5dcb,null))[_0xa140('0x46')](handleError(_0x3b5dcb,null));};exports['destroy']=function(_0x5640d1,_0x36b9b6){return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x5640d1[_0xa140('0x47')]['id']}})['then'](handleEntityNotFound(_0x36b9b6,null))[_0xa140('0x26')](removeEntity(_0x36b9b6,null))['catch'](handleError(_0x36b9b6,null));};exports[_0xa140('0x52')]=function(_0x3a8cf6,_0x237e36){return db[_0xa140('0x2f')][_0xa140('0x52')]()[_0xa140('0x26')](respondWithResult(_0x237e36,null))[_0xa140('0x46')](handleError(_0x237e36,null));};exports[_0xa140('0x53')]=function(_0x28272d,_0x1ae758,_0x18731d){var _0x1044b1={'raw':!![],'where':{}},_0x4f035c={},_0x3a4bbd;return db[_0xa140('0x2f')][_0xa140('0x54')]({'where':{'id':_0x28272d[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x1ae758,null))[_0xa140('0x26')](function(_0x1fb902){if(_0x1fb902){_0x3a4bbd=_0x1fb902[_0xa140('0x28')]({'plain':!![]});_0x4f035c[_0xa140('0x34')]=_[_0xa140('0x32')](db['UserWhatsappQueue'][_0xa140('0x48')]);_0x4f035c[_0xa140('0x31')]=_[_0xa140('0x32')](_0x28272d[_0xa140('0x31')]);_0x4f035c[_0xa140('0x33')]=_['intersection'](_0x4f035c[_0xa140('0x34')],_0x4f035c[_0xa140('0x31')]);_0x1044b1[_0xa140('0x35')]=_[_0xa140('0x36')](_0x4f035c[_0xa140('0x34')],qs[_0xa140('0x37')](_0x28272d['query'][_0xa140('0x37')]));_0x1044b1[_0xa140('0x35')]=_0x1044b1['attributes'][_0xa140('0x38')]?_0x1044b1['attributes']:_0x4f035c['model'];if(!_0x28272d[_0xa140('0x31')][_0xa140('0x39')](_0xa140('0x3a'))){_0x1044b1[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x28272d[_0xa140('0x31')]['limit']);_0x1044b1[_0xa140('0x1d')]=qs[_0xa140('0x1d')](_0x28272d[_0xa140('0x31')][_0xa140('0x1d')]);}_0x1044b1['order']=qs[_0xa140('0x3c')](_0x28272d['query'][_0xa140('0x3c')]);_0x1044b1[_0xa140('0x3d')]=qs[_0xa140('0x33')](_[_0xa140('0x3e')](_0x28272d[_0xa140('0x31')],_0x4f035c['filters']));_0x1044b1[_0xa140('0x3d')][_0xa140('0x55')]=_0x1fb902['id'];if(_0x28272d[_0xa140('0x31')][_0xa140('0x3f')]){_0x1044b1['where']=_[_0xa140('0x40')](_0x1044b1[_0xa140('0x3d')],{'$or':_['map'](_0x1044b1[_0xa140('0x35')],function(_0x20fd64){var _0x3ace93={};_0x3ace93[_0x20fd64]={'$like':'%'+_0x28272d['query'][_0xa140('0x3f')]+'%'};return _0x3ace93;})});}_0x1044b1=_[_0xa140('0x40')]({},_0x1044b1,_0x28272d[_0xa140('0x43')]);return db[_0xa140('0x56')]['findAll'](_0x1044b1);}})['then'](function(_0x598853){if(_0x598853){return db['User'][_0xa140('0x57')]({'where':{'id':_['map'](_0x598853,_0xa140('0x58')),'role':_0xa140('0x59')},'attributes':['id',_0xa140('0x2d'),_0xa140('0x5a'),'updatedAt','createdAt']});}})['then'](function(_0xc89b4a){if(_0xc89b4a){return{'count':_0xc89b4a[_0xa140('0x20')],'rows':_[_0xa140('0x41')](_0xc89b4a['rows'],function(_0x2b836b){return{'membername':_0x2b836b[_0xa140('0x2d')],'UserId':_0x2b836b['id'],'queue_name':_0x3a4bbd['name'],'WhatsappQueueId':_0x3a4bbd['id'],'interface':util[_0xa140('0x5b')](_0xa140('0x5c'),_0xa140('0x5d'),_0x2b836b[_0xa140('0x2d')]),'penalty':0x0,'paused':_0x2b836b[_0xa140('0x5a')],'createdAt':_0x2b836b[_0xa140('0x5e')],'updatedAt':_0x2b836b[_0xa140('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa140('0x26')](respondWithFilteredResult(_0x1ae758,_0x1044b1))[_0xa140('0x46')](handleError(_0x1ae758,null));};exports['getTeams']=function(_0x490864,_0x416e41,_0x53462f){var _0x277855={};var _0x29114f={};var _0xa249ed;var _0x207a75;return db[_0xa140('0x2f')]['findOne']({'where':{'id':_0x490864[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x416e41,null))[_0xa140('0x26')](function(_0x37ea3b){if(_0x37ea3b){_0xa249ed=_0x37ea3b;_0x29114f[_0xa140('0x34')]=_[_0xa140('0x32')](db['Team']['rawAttributes']);_0x29114f['query']=_['keys'](_0x490864[_0xa140('0x31')]);_0x29114f[_0xa140('0x33')]=_[_0xa140('0x36')](_0x29114f[_0xa140('0x34')],_0x29114f[_0xa140('0x31')]);_0x277855[_0xa140('0x35')]=_[_0xa140('0x36')](_0x29114f[_0xa140('0x34')],qs[_0xa140('0x37')](_0x490864[_0xa140('0x31')][_0xa140('0x37')]));_0x277855[_0xa140('0x35')]=_0x277855[_0xa140('0x35')][_0xa140('0x38')]?_0x277855[_0xa140('0x35')]:_0x29114f[_0xa140('0x34')];_0x277855[_0xa140('0x3b')]=qs[_0xa140('0x3c')](_0x490864['query'][_0xa140('0x3c')]);_0x277855[_0xa140('0x3d')]=qs['filters'](_[_0xa140('0x3e')](_0x490864['query'],_0x29114f[_0xa140('0x33')]));if(_0x490864[_0xa140('0x31')]['filter']){_0x277855[_0xa140('0x3d')]=_[_0xa140('0x40')](_0x277855['where'],{'$or':_[_0xa140('0x41')](_0x277855[_0xa140('0x35')],function(_0x288e46){var _0x2c4021={};_0x2c4021[_0x288e46]={'$like':'%'+_0x490864[_0xa140('0x31')][_0xa140('0x3f')]+'%'};return _0x2c4021;})});}_0x277855=_['merge']({},_0x277855,_0x490864[_0xa140('0x43')]);return _0xa249ed['getTeams'](_0x277855);}})[_0xa140('0x26')](function(_0x95e29d){if(_0x95e29d){_0x207a75=_0x95e29d[_0xa140('0x38')];if(!_0x490864[_0xa140('0x31')][_0xa140('0x39')](_0xa140('0x3a'))){_0x277855[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x490864[_0xa140('0x31')][_0xa140('0x1f')]);_0x277855[_0xa140('0x1d')]=qs[_0xa140('0x1d')](_0x490864[_0xa140('0x31')][_0xa140('0x1d')]);}return _0xa249ed[_0xa140('0x60')](_0x277855);}})[_0xa140('0x26')](function(_0x1899d2){if(_0x1899d2){return _0x1899d2?{'count':_0x207a75,'rows':_0x1899d2}:null;}})[_0xa140('0x26')](respondWithResult(_0x416e41,null))[_0xa140('0x46')](handleError(_0x416e41,null));};exports[_0xa140('0x61')]=function(_0x4c3a65,_0x137925,_0x2d0b40){var _0x9e4b95=_0x4c3a65[_0xa140('0x51')][_0xa140('0x62')];return db[_0xa140('0x63')][_0xa140('0x64')]({'where':{'id':_0x9e4b95},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa140('0x65'),'attributes':['id',_0xa140('0x2d'),_0xa140('0x66'),_0xa140('0x67'),'interface'],'raw':!![]}]})[_0xa140('0x26')](function(_0x732edb){if(_0x732edb){var _0x218c6b=_[_0xa140('0x68')](_0x732edb,function(_0x37694a){var _0x355acf=_0x37694a[_0xa140('0x28')]({'plain':!![]});return _0x355acf[_0xa140('0x65')];});return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x4c3a65[_0xa140('0x47')]['id']}})[_0xa140('0x26')](function(_0x5ca3c2){return db['sequelize'][_0xa140('0x69')](function(_0x2a252d){return _0x5ca3c2['addTeams'](_0x9e4b95,{'transaction':_0x2a252d})['then'](function(){return BPromise[_0xa140('0x6a')](_0x218c6b,function(_0x1e9baa){return db[_0xa140('0x56')][_0xa140('0x6b')]({'where':{'UserId':_0x1e9baa['id'],'WhatsappQueueId':_0x4c3a65[_0xa140('0x47')]['id']},'transaction':_0x2a252d});});})[_0xa140('0x26')](function(){_0x218c6b[_0xa140('0x6c')](function(_0x8932f8){socket['emit'](_0xa140('0x6d'),{'UserId':_0x8932f8['id'],'WhatsappQueueId':_0x5ca3c2['id']});});});});});}})['then'](respondWithStatusCode(_0x137925,null))[_0xa140('0x46')](handleError(_0x137925,null));};exports[_0xa140('0x6e')]=function(_0x4c98e4,_0x15add4,_0x3e9f6a){return db[_0xa140('0x63')][_0xa140('0x64')]({'where':{'id':_0x4c98e4[_0xa140('0x31')][_0xa140('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa140('0x65'),'attributes':['id'],'raw':!![]}]})[_0xa140('0x26')](handleEntityNotFound(_0x15add4,null))[_0xa140('0x26')](function(_0x285986){var _0x30b32c=_[_0xa140('0x41')](_0x285986,'id');var _0x560ea1=[];var _0x456a3b=[];var _0x3e8058=squel[_0xa140('0x6f')]();_0x3e8058[_0xa140('0x70')](_0xa140('0x71'))[_0xa140('0x72')](_0xa140('0x73'),'tq')[_0xa140('0x74')]('user_has_teams','ut',_0xa140('0x75'))[_0xa140('0x3d')]('WhatsappQueueId\x20=\x20?',_0x4c98e4['params']['id']);for(var _0x44e280=0x0;_0x44e280<_0x285986[_0xa140('0x38')];_0x44e280+=0x1){let _0x57bdfd=_0x285986[_0x44e280];for(var _0x462168=0x0;_0x462168<_0x57bdfd[_0xa140('0x65')]['length'];_0x462168+=0x1){let _0xbf876c=_0x57bdfd[_0xa140('0x65')][_0x462168];var _0x45d774=_0x3e8058['clone']();_0x45d774[_0xa140('0x3d')](_0xa140('0x76'),_0xbf876c['id']);_0x456a3b[_0xa140('0x77')](db['sequelize'][_0xa140('0x31')](_0x45d774[_0xa140('0x78')](),{'type':db[_0xa140('0x79')][_0xa140('0x7a')]['SELECT']})[_0xa140('0x26')](function(_0x268b30){if(_0x268b30[_0xa140('0x38')]===0x1){return _0xbf876c['id'];}else{var _0x183dd6=_[_0xa140('0x7b')](_[_0xa140('0x41')](_0x268b30,_0xa140('0x7c')),function(_0x7b3b15){return _[_0xa140('0x7d')](_0x30b32c,_0x7b3b15);});if(_0x183dd6){return _0xbf876c['id'];}}}));}}return BPromise['all'](_0x456a3b)['then'](function(_0x21d4aa){_0x560ea1=_(_0x560ea1)[_0xa140('0x7e')](_0x21d4aa)[_0xa140('0x7f')]()[_0xa140('0x80')]();return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x4c98e4[_0xa140('0x47')]['id']}})[_0xa140('0x26')](function(_0x3f5c0d){return db['sequelize'][_0xa140('0x69')](function(_0x18ed9c){return _0x3f5c0d[_0xa140('0x6e')](_0x4c98e4[_0xa140('0x31')][_0xa140('0x62')],{'transaction':_0x18ed9c})[_0xa140('0x26')](function(){if(!_[_0xa140('0x81')](_0x560ea1)){return _0x3f5c0d[_0xa140('0x82')](_0x560ea1,{'transaction':_0x18ed9c});}})[_0xa140('0x26')](function(){_0x560ea1['forEach'](function(_0x56dce1){socket[_0xa140('0x83')](_0xa140('0x84'),{'UserId':_0x56dce1,'WhatsappQueueId':_0x3f5c0d['id']});});});});});});})[_0xa140('0x26')](respondWithStatusCode(_0x15add4,null))[_0xa140('0x46')](handleError(_0x15add4,null));};exports[_0xa140('0x85')]=function(_0x568bb4,_0x48a08c,_0xd99495){return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x568bb4[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x48a08c,null))[_0xa140('0x26')](function(_0x279609){if(_0x279609){return _0x279609[_0xa140('0x85')](_0x568bb4[_0xa140('0x51')][_0xa140('0x62')],_[_0xa140('0x86')](_0x568bb4[_0xa140('0x51')],[_0xa140('0x62'),'id'])||{})[_0xa140('0x87')](function(_0x520054){for(var _0x213f44=0x0;_0x213f44<_0x568bb4[_0xa140('0x51')]['ids']['length'];_0x213f44+=0x1){socket[_0xa140('0x83')]('userWhatsappQueue:save',{'UserId':Number(_0x568bb4[_0xa140('0x51')][_0xa140('0x62')][_0x213f44]),'WhatsappQueueId':Number(_0x568bb4[_0xa140('0x47')]['id'])});}return _0x520054;});}})['then'](respondWithResult(_0x48a08c,null))[_0xa140('0x46')](handleError(_0x48a08c,null));};exports[_0xa140('0x82')]=function(_0x203cec,_0x5c19bd,_0xda8fce){return db[_0xa140('0x2f')][_0xa140('0x49')]({'where':{'id':_0x203cec[_0xa140('0x47')]['id']}})[_0xa140('0x26')](handleEntityNotFound(_0x5c19bd,null))[_0xa140('0x26')](function(_0xc61d2b){if(_0xc61d2b){return _0xc61d2b[_0xa140('0x82')](_0x203cec[_0xa140('0x31')][_0xa140('0x62')])[_0xa140('0x26')](function(){if(_[_0xa140('0x88')](_0x203cec[_0xa140('0x31')][_0xa140('0x62')])){for(var _0x5d316c=0x0;_0x5d316c<_0x203cec[_0xa140('0x31')][_0xa140('0x62')]['length'];_0x5d316c+=0x1){socket[_0xa140('0x83')](_0xa140('0x84'),{'UserId':Number(_0x203cec[_0xa140('0x31')][_0xa140('0x62')][_0x5d316c]),'WhatsappQueueId':Number(_0x203cec[_0xa140('0x47')]['id'])});}}else{socket[_0xa140('0x83')]('userWhatsappQueue:remove',{'UserId':Number(_0x203cec['query'][_0xa140('0x62')]),'WhatsappQueueId':Number(_0x203cec['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5c19bd,null))[_0xa140('0x46')](handleError(_0x5c19bd,null));};exports[_0xa140('0x89')]=function(_0x5c9bbc,_0x3ed076,_0x52270c){var _0x594c1c={};var _0x3c49af={};var _0x3cf69b;var _0x309116;return db[_0xa140('0x2f')][_0xa140('0x54')]({'where':{'id':_0x5c9bbc[_0xa140('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ed076,null))[_0xa140('0x26')](function(_0x2b7c53){if(_0x2b7c53){_0x3cf69b=_0x2b7c53;_0x3c49af[_0xa140('0x34')]=_['keys'](db['User'][_0xa140('0x48')]);_0x3c49af['query']=_[_0xa140('0x32')](_0x5c9bbc['query']);_0x3c49af[_0xa140('0x33')]=_[_0xa140('0x36')](_0x3c49af[_0xa140('0x34')],_0x3c49af[_0xa140('0x31')]);_0x594c1c[_0xa140('0x35')]=_['intersection'](_0x3c49af[_0xa140('0x34')],qs[_0xa140('0x37')](_0x5c9bbc[_0xa140('0x31')][_0xa140('0x37')]));_0x594c1c[_0xa140('0x35')]=_0x594c1c[_0xa140('0x35')][_0xa140('0x38')]?_0x594c1c[_0xa140('0x35')]:_0x3c49af[_0xa140('0x34')];_0x594c1c[_0xa140('0x3b')]=qs[_0xa140('0x3c')](_0x5c9bbc['query'][_0xa140('0x3c')]);_0x594c1c[_0xa140('0x3d')]=qs[_0xa140('0x33')](_[_0xa140('0x3e')](_0x5c9bbc[_0xa140('0x31')],_0x3c49af[_0xa140('0x33')]));if(_0x5c9bbc[_0xa140('0x31')][_0xa140('0x3f')]){_0x594c1c[_0xa140('0x3d')]=_[_0xa140('0x40')](_0x594c1c[_0xa140('0x3d')],{'$or':_[_0xa140('0x41')](_0x594c1c['attributes'],function(_0x175efe){var _0x28ad2f={};_0x28ad2f[_0x175efe]={'$like':'%'+_0x5c9bbc['query'][_0xa140('0x3f')]+'%'};return _0x28ad2f;})});}_0x594c1c=_[_0xa140('0x40')]({},_0x594c1c,_0x5c9bbc[_0xa140('0x43')]);return _0x3cf69b[_0xa140('0x89')](_0x594c1c);}})[_0xa140('0x26')](function(_0x286dd5){if(_0x286dd5){_0x309116=_0x286dd5[_0xa140('0x38')];if(!_0x5c9bbc['query'][_0xa140('0x39')]('nolimit')){_0x594c1c[_0xa140('0x1f')]=qs[_0xa140('0x1f')](_0x5c9bbc[_0xa140('0x31')][_0xa140('0x1f')]);_0x594c1c['offset']=qs[_0xa140('0x1d')](_0x5c9bbc[_0xa140('0x31')]['offset']);}return _0x3cf69b[_0xa140('0x89')](_0x594c1c);}})[_0xa140('0x26')](function(_0x19ca05){if(_0x19ca05){return _0x19ca05?{'count':_0x309116,'rows':_0x19ca05}:null;}})['then'](respondWithResult(_0x3ed076,null))[_0xa140('0x46')](handleError(_0x3ed076,null));}; \ No newline at end of file +var _0x8981=['length','order','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit','ids','Agents','online','interface','sequelize','transaction','addTeams','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','omit','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','error','name','send','index','map','WhatsappQueue','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','merge','filter','includeAll','findAll','catch','show','keys','rawAttributes','include','options','find','create','body','user','WhatsappQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x8981,0x135));var _0x1898=function(_0x17912c,_0x4cd917){_0x17912c=_0x17912c-0x0;var _0x5bd368=_0x8981[_0x17912c];return _0x5bd368;};'use strict';var emlformat=require(_0x1898('0x0'));var rimraf=require(_0x1898('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1898('0x2'));var rp=require(_0x1898('0x3'));var moment=require(_0x1898('0x4'));var BPromise=require(_0x1898('0x5'));var Mustache=require(_0x1898('0x6'));var util=require(_0x1898('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1898('0x8'));var fs=require('fs');var fs_extra=require(_0x1898('0x9'));var _=require(_0x1898('0xa'));var squel=require(_0x1898('0xb'));var crypto=require('crypto');var jsforce=require(_0x1898('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1898('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1898('0xe'));var qs=require(_0x1898('0xf'));var as=require(_0x1898('0x10'));var hardwareService=require(_0x1898('0x11'));var logger=require(_0x1898('0x12'))(_0x1898('0x13'));var utils=require(_0x1898('0x14'));var config=require(_0x1898('0x15'));var licenseUtil=require(_0x1898('0x16'));var db=require('../../mysqldb')['db'];config[_0x1898('0x17')]=_['defaults'](config[_0x1898('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x1898('0x18'))(new Redis(config[_0x1898('0x17')]));require('./whatsappQueue.socket')[_0x1898('0x19')](socket);function respondWithStatusCode(_0x510a05,_0x3e6ad6){_0x3e6ad6=_0x3e6ad6||0xcc;return function(_0x155199){if(_0x155199){return _0x510a05[_0x1898('0x1a')](_0x3e6ad6);}return _0x510a05[_0x1898('0x1b')](_0x3e6ad6)[_0x1898('0x1c')]();};}function respondWithResult(_0x2bdcfb,_0x31a29d){_0x31a29d=_0x31a29d||0xc8;return function(_0x4cc9f4){if(_0x4cc9f4){return _0x2bdcfb['status'](_0x31a29d)[_0x1898('0x1d')](_0x4cc9f4);}};}function respondWithFilteredResult(_0x2358c1,_0x23b231){return function(_0x300e27){if(_0x300e27){var _0x1cd1ae=typeof _0x23b231[_0x1898('0x1e')]===_0x1898('0x1f')&&typeof _0x23b231[_0x1898('0x20')]===_0x1898('0x1f');var _0x2ff8a8=_0x300e27[_0x1898('0x21')];var _0x2ff918=_0x1cd1ae?0x0:_0x23b231[_0x1898('0x1e')];var _0x2dedb5=_0x1cd1ae?_0x300e27[_0x1898('0x21')]:_0x23b231[_0x1898('0x1e')]+_0x23b231['limit'];var _0x20d2b4;if(_0x2dedb5>=_0x2ff8a8){_0x2dedb5=_0x2ff8a8;_0x20d2b4=0xc8;}else{_0x20d2b4=0xce;}_0x2358c1[_0x1898('0x1b')](_0x20d2b4);return _0x2358c1[_0x1898('0x22')]('Content-Range',_0x2ff918+'-'+_0x2dedb5+'/'+_0x2ff8a8)[_0x1898('0x1d')](_0x300e27);}return null;};}function patchUpdates(_0x4721ce){return function(_0x35e8ea){try{jsonpatch[_0x1898('0x23')](_0x35e8ea,_0x4721ce,!![]);}catch(_0x5ab5c8){return BPromise[_0x1898('0x24')](_0x5ab5c8);}return _0x35e8ea[_0x1898('0x25')]();};}function saveUpdates(_0x449a86,_0xc691aa){return function(_0x3b5f88){if(_0x3b5f88){return _0x3b5f88[_0x1898('0x26')](_0x449a86)['then'](function(_0x560eb5){return _0x560eb5;});}return null;};}function removeEntity(_0x45c589,_0x4cfdaf){return function(_0x1a3453){if(_0x1a3453){return _0x1a3453[_0x1898('0x27')]()[_0x1898('0x28')](function(){var _0x53e3de=_0x1a3453[_0x1898('0x29')]({'plain':!![]});var _0x52c3f9='WhatsappQueues';return db['UserProfileResource'][_0x1898('0x27')]({'where':{'type':_0x52c3f9,'resourceId':_0x53e3de['id']}})[_0x1898('0x28')](function(){return _0x1a3453;});})[_0x1898('0x28')](function(){_0x45c589[_0x1898('0x1b')](0xcc)[_0x1898('0x1c')]();});}};}function handleEntityNotFound(_0x407fa0,_0x3e63b4){return function(_0x1c1388){if(!_0x1c1388){_0x407fa0['sendStatus'](0x194);}return _0x1c1388;};}function handleError(_0x4915a0,_0x3da57f){_0x3da57f=_0x3da57f||0x1f4;return function(_0x41a812){logger[_0x1898('0x2a')](_0x41a812['stack']);if(_0x41a812[_0x1898('0x2b')]){delete _0x41a812[_0x1898('0x2b')];}_0x4915a0[_0x1898('0x1b')](_0x3da57f)[_0x1898('0x2c')](_0x41a812);};}exports[_0x1898('0x2d')]=function(_0x21e644,_0x4c9f79){var _0x166929={},_0x225645={},_0x4c10ac={'count':0x0,'rows':[]};var _0x183aa3=_[_0x1898('0x2e')](db[_0x1898('0x2f')]['rawAttributes'],function(_0x17401b){return{'name':_0x17401b[_0x1898('0x30')],'type':_0x17401b[_0x1898('0x31')][_0x1898('0x32')]};});_0x225645['model']=_[_0x1898('0x2e')](_0x183aa3,_0x1898('0x2b'));_0x225645[_0x1898('0x33')]=_['keys'](_0x21e644['query']);_0x225645[_0x1898('0x34')]=_[_0x1898('0x35')](_0x225645['model'],_0x225645['query']);_0x166929['attributes']=_[_0x1898('0x35')](_0x225645[_0x1898('0x36')],qs[_0x1898('0x37')](_0x21e644[_0x1898('0x33')]['fields']));_0x166929['attributes']=_0x166929[_0x1898('0x38')]['length']?_0x166929[_0x1898('0x38')]:_0x225645[_0x1898('0x36')];if(!_0x21e644[_0x1898('0x33')][_0x1898('0x39')]('nolimit')){_0x166929[_0x1898('0x20')]=qs['limit'](_0x21e644[_0x1898('0x33')][_0x1898('0x20')]);_0x166929[_0x1898('0x1e')]=qs[_0x1898('0x1e')](_0x21e644[_0x1898('0x33')]['offset']);}_0x166929['order']=qs[_0x1898('0x3a')](_0x21e644['query'][_0x1898('0x3a')]);_0x166929[_0x1898('0x3b')]=qs['filters'](_[_0x1898('0x3c')](_0x21e644[_0x1898('0x33')],_0x225645[_0x1898('0x34')]),_0x183aa3);if(_0x21e644['query']['filter']){_0x166929[_0x1898('0x3b')]=_[_0x1898('0x3d')](_0x166929[_0x1898('0x3b')],{'$or':_[_0x1898('0x2e')](_0x183aa3,function(_0x298ca6){if(_0x298ca6[_0x1898('0x31')]!=='VIRTUAL'){var _0x234e39={};_0x234e39[_0x298ca6[_0x1898('0x2b')]]={'$like':'%'+_0x21e644['query'][_0x1898('0x3e')]+'%'};return _0x234e39;}})});}_0x166929=_[_0x1898('0x3d')]({},_0x166929,_0x21e644['options']);var _0x42ad76={'where':_0x166929[_0x1898('0x3b')]};return db['WhatsappQueue'][_0x1898('0x21')](_0x42ad76)['then'](function(_0x20a82f){_0x4c10ac['count']=_0x20a82f;if(_0x21e644[_0x1898('0x33')][_0x1898('0x3f')]){_0x166929['include']=[{'all':!![]}];}return db[_0x1898('0x2f')][_0x1898('0x40')](_0x166929);})['then'](function(_0x31fc8a){_0x4c10ac['rows']=_0x31fc8a;return _0x4c10ac;})['then'](respondWithFilteredResult(_0x4c9f79,_0x166929))[_0x1898('0x41')](handleError(_0x4c9f79,null));};exports[_0x1898('0x42')]=function(_0x3169eb,_0x198703){var _0x1a3329={'raw':!![],'where':{'id':_0x3169eb['params']['id']}},_0x489ceb={};_0x489ceb['model']=_[_0x1898('0x43')](db[_0x1898('0x2f')][_0x1898('0x44')]);_0x489ceb[_0x1898('0x33')]=_[_0x1898('0x43')](_0x3169eb[_0x1898('0x33')]);_0x489ceb['filters']=_[_0x1898('0x35')](_0x489ceb[_0x1898('0x36')],_0x489ceb[_0x1898('0x33')]);_0x1a3329[_0x1898('0x38')]=_[_0x1898('0x35')](_0x489ceb[_0x1898('0x36')],qs[_0x1898('0x37')](_0x3169eb['query'][_0x1898('0x37')]));_0x1a3329[_0x1898('0x38')]=_0x1a3329['attributes']['length']?_0x1a3329[_0x1898('0x38')]:_0x489ceb['model'];if(_0x3169eb['query'][_0x1898('0x3f')]){_0x1a3329[_0x1898('0x45')]=[{'all':!![]}];}_0x1a3329=_['merge']({},_0x1a3329,_0x3169eb[_0x1898('0x46')]);return db[_0x1898('0x2f')][_0x1898('0x47')](_0x1a3329)[_0x1898('0x28')](handleEntityNotFound(_0x198703,null))[_0x1898('0x28')](respondWithResult(_0x198703,null))[_0x1898('0x41')](handleError(_0x198703,null));};exports['create']=function(_0x2e32c3,_0x26f541){return db['WhatsappQueue'][_0x1898('0x48')](_0x2e32c3[_0x1898('0x49')],{})['then'](function(_0xa5bc0b){var _0x5a9141=_0x2e32c3['user'][_0x1898('0x29')]({'plain':!![]});if(!_0x5a9141)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a9141['role']===_0x1898('0x4a')){var _0x22dccf=_0xa5bc0b[_0x1898('0x29')]({'plain':!![]});var _0x424cc2=_0x1898('0x4b');return db[_0x1898('0x4c')][_0x1898('0x47')]({'where':{'name':_0x424cc2,'userProfileId':_0x5a9141[_0x1898('0x4d')]},'raw':!![]})['then'](function(_0x4156e2){if(_0x4156e2&&_0x4156e2['autoAssociation']===0x0){return db[_0x1898('0x4e')][_0x1898('0x48')]({'name':_0x22dccf[_0x1898('0x2b')],'resourceId':_0x22dccf['id'],'type':_0x4156e2[_0x1898('0x2b')],'sectionId':_0x4156e2['id']},{})[_0x1898('0x28')](function(){return _0xa5bc0b;});}else{return _0xa5bc0b;}})[_0x1898('0x41')](function(_0x5dd5d9){logger[_0x1898('0x2a')](_0x1898('0x4f'),_0x5dd5d9);throw _0x5dd5d9;});}return _0xa5bc0b;})[_0x1898('0x28')](respondWithResult(_0x26f541,0xc9))[_0x1898('0x41')](handleError(_0x26f541,null));};exports[_0x1898('0x26')]=function(_0xc54aaa,_0x176852){if(_0xc54aaa[_0x1898('0x49')]['id']){delete _0xc54aaa[_0x1898('0x49')]['id'];}return db[_0x1898('0x2f')]['find']({'where':{'id':_0xc54aaa['params']['id']}})[_0x1898('0x28')](handleEntityNotFound(_0x176852,null))[_0x1898('0x28')](saveUpdates(_0xc54aaa[_0x1898('0x49')],null))[_0x1898('0x28')](respondWithResult(_0x176852,null))[_0x1898('0x41')](handleError(_0x176852,null));};exports['destroy']=function(_0x50b955,_0x9851a9){return db[_0x1898('0x2f')][_0x1898('0x47')]({'where':{'id':_0x50b955[_0x1898('0x50')]['id']}})[_0x1898('0x28')](handleEntityNotFound(_0x9851a9,null))['then'](removeEntity(_0x9851a9,null))['catch'](handleError(_0x9851a9,null));};exports[_0x1898('0x51')]=function(_0x4177a2,_0x5ea4ca){return db[_0x1898('0x2f')]['describe']()['then'](respondWithResult(_0x5ea4ca,null))[_0x1898('0x41')](handleError(_0x5ea4ca,null));};exports[_0x1898('0x52')]=function(_0x57401c,_0x93bc7b,_0x58feb5){var _0x45be15={'raw':!![],'where':{}},_0x2b65b3={},_0x19c64f;return db[_0x1898('0x2f')][_0x1898('0x53')]({'where':{'id':_0x57401c[_0x1898('0x50')]['id']}})[_0x1898('0x28')](handleEntityNotFound(_0x93bc7b,null))[_0x1898('0x28')](function(_0x50063c){if(_0x50063c){_0x19c64f=_0x50063c['get']({'plain':!![]});_0x2b65b3['model']=_[_0x1898('0x43')](db['UserWhatsappQueue'][_0x1898('0x44')]);_0x2b65b3['query']=_[_0x1898('0x43')](_0x57401c[_0x1898('0x33')]);_0x2b65b3[_0x1898('0x34')]=_[_0x1898('0x35')](_0x2b65b3['model'],_0x2b65b3[_0x1898('0x33')]);_0x45be15[_0x1898('0x38')]=_['intersection'](_0x2b65b3[_0x1898('0x36')],qs[_0x1898('0x37')](_0x57401c[_0x1898('0x33')][_0x1898('0x37')]));_0x45be15['attributes']=_0x45be15[_0x1898('0x38')][_0x1898('0x54')]?_0x45be15['attributes']:_0x2b65b3[_0x1898('0x36')];if(!_0x57401c[_0x1898('0x33')][_0x1898('0x39')]('nolimit')){_0x45be15[_0x1898('0x20')]=qs[_0x1898('0x20')](_0x57401c[_0x1898('0x33')][_0x1898('0x20')]);_0x45be15[_0x1898('0x1e')]=qs[_0x1898('0x1e')](_0x57401c[_0x1898('0x33')][_0x1898('0x1e')]);}_0x45be15[_0x1898('0x55')]=qs[_0x1898('0x3a')](_0x57401c[_0x1898('0x33')][_0x1898('0x3a')]);_0x45be15['where']=qs[_0x1898('0x34')](_['pick'](_0x57401c[_0x1898('0x33')],_0x2b65b3['filters']));_0x45be15[_0x1898('0x3b')][_0x1898('0x56')]=_0x50063c['id'];if(_0x57401c[_0x1898('0x33')][_0x1898('0x3e')]){_0x45be15[_0x1898('0x3b')]=_[_0x1898('0x3d')](_0x45be15['where'],{'$or':_[_0x1898('0x2e')](_0x45be15['attributes'],function(_0x184376){var _0x3f171b={};_0x3f171b[_0x184376]={'$like':'%'+_0x57401c[_0x1898('0x33')][_0x1898('0x3e')]+'%'};return _0x3f171b;})});}_0x45be15=_[_0x1898('0x3d')]({},_0x45be15,_0x57401c[_0x1898('0x46')]);return db[_0x1898('0x57')][_0x1898('0x40')](_0x45be15);}})[_0x1898('0x28')](function(_0xbf0163){if(_0xbf0163){return db[_0x1898('0x58')][_0x1898('0x59')]({'where':{'id':_['map'](_0xbf0163,'UserId'),'role':'agent'},'attributes':['id',_0x1898('0x2b'),'whatsappPause',_0x1898('0x5a'),_0x1898('0x5b')]});}})[_0x1898('0x28')](function(_0x5701af){if(_0x5701af){return{'count':_0x5701af['count'],'rows':_[_0x1898('0x2e')](_0x5701af['rows'],function(_0x22ce45){return{'membername':_0x22ce45['name'],'UserId':_0x22ce45['id'],'queue_name':_0x19c64f[_0x1898('0x2b')],'WhatsappQueueId':_0x19c64f['id'],'interface':util[_0x1898('0x5c')](_0x1898('0x5d'),_0x1898('0x5e'),_0x22ce45[_0x1898('0x2b')]),'penalty':0x0,'paused':_0x22ce45['whatsappPause'],'createdAt':_0x22ce45['createdAt'],'updatedAt':_0x22ce45[_0x1898('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1898('0x28')](respondWithFilteredResult(_0x93bc7b,_0x45be15))['catch'](handleError(_0x93bc7b,null));};exports[_0x1898('0x5f')]=function(_0x56f57b,_0x55716e,_0x231dfa){var _0x509fd5={};var _0x5a36e9={};var _0xbad338;var _0x46a5ad;return db['WhatsappQueue']['findOne']({'where':{'id':_0x56f57b[_0x1898('0x50')]['id']}})[_0x1898('0x28')](handleEntityNotFound(_0x55716e,null))['then'](function(_0x120c48){if(_0x120c48){_0xbad338=_0x120c48;_0x5a36e9[_0x1898('0x36')]=_[_0x1898('0x43')](db[_0x1898('0x60')][_0x1898('0x44')]);_0x5a36e9['query']=_[_0x1898('0x43')](_0x56f57b[_0x1898('0x33')]);_0x5a36e9[_0x1898('0x34')]=_[_0x1898('0x35')](_0x5a36e9[_0x1898('0x36')],_0x5a36e9[_0x1898('0x33')]);_0x509fd5[_0x1898('0x38')]=_[_0x1898('0x35')](_0x5a36e9[_0x1898('0x36')],qs[_0x1898('0x37')](_0x56f57b['query'][_0x1898('0x37')]));_0x509fd5[_0x1898('0x38')]=_0x509fd5[_0x1898('0x38')][_0x1898('0x54')]?_0x509fd5[_0x1898('0x38')]:_0x5a36e9[_0x1898('0x36')];_0x509fd5[_0x1898('0x55')]=qs[_0x1898('0x3a')](_0x56f57b[_0x1898('0x33')]['sort']);_0x509fd5[_0x1898('0x3b')]=qs['filters'](_[_0x1898('0x3c')](_0x56f57b[_0x1898('0x33')],_0x5a36e9[_0x1898('0x34')]));if(_0x56f57b[_0x1898('0x33')]['filter']){_0x509fd5[_0x1898('0x3b')]=_[_0x1898('0x3d')](_0x509fd5['where'],{'$or':_[_0x1898('0x2e')](_0x509fd5[_0x1898('0x38')],function(_0x578836){var _0x1e98f2={};_0x1e98f2[_0x578836]={'$like':'%'+_0x56f57b[_0x1898('0x33')][_0x1898('0x3e')]+'%'};return _0x1e98f2;})});}_0x509fd5=_[_0x1898('0x3d')]({},_0x509fd5,_0x56f57b['options']);return _0xbad338[_0x1898('0x5f')](_0x509fd5);}})[_0x1898('0x28')](function(_0x444e1d){if(_0x444e1d){_0x46a5ad=_0x444e1d['length'];if(!_0x56f57b[_0x1898('0x33')]['hasOwnProperty'](_0x1898('0x61'))){_0x509fd5[_0x1898('0x20')]=qs['limit'](_0x56f57b['query'][_0x1898('0x20')]);_0x509fd5['offset']=qs[_0x1898('0x1e')](_0x56f57b['query'][_0x1898('0x1e')]);}return _0xbad338[_0x1898('0x5f')](_0x509fd5);}})[_0x1898('0x28')](function(_0x520e6b){if(_0x520e6b){return _0x520e6b?{'count':_0x46a5ad,'rows':_0x520e6b}:null;}})[_0x1898('0x28')](respondWithResult(_0x55716e,null))[_0x1898('0x41')](handleError(_0x55716e,null));};exports['addTeams']=function(_0x15c8f0,_0x346c4c,_0x2bdf2e){var _0x489193=_0x15c8f0[_0x1898('0x49')][_0x1898('0x62')];return db[_0x1898('0x60')][_0x1898('0x40')]({'where':{'id':_0x489193},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1898('0x63'),'attributes':['id','name',_0x1898('0x64'),'voicePause',_0x1898('0x65')],'raw':!![]}]})['then'](function(_0x994033){if(_0x994033){var _0x3aa7bf=_['flatMap'](_0x994033,function(_0x5e4a82){var _0xcf7b6f=_0x5e4a82['get']({'plain':!![]});return _0xcf7b6f[_0x1898('0x63')];});return db[_0x1898('0x2f')][_0x1898('0x47')]({'where':{'id':_0x15c8f0[_0x1898('0x50')]['id']}})[_0x1898('0x28')](function(_0x1b4e49){return db[_0x1898('0x66')][_0x1898('0x67')](function(_0xcf518a){return _0x1b4e49[_0x1898('0x68')](_0x489193,{'transaction':_0xcf518a})['then'](function(){return BPromise['each'](_0x3aa7bf,function(_0x351ad2){return db[_0x1898('0x57')][_0x1898('0x69')]({'where':{'UserId':_0x351ad2['id'],'WhatsappQueueId':_0x15c8f0[_0x1898('0x50')]['id']},'transaction':_0xcf518a});});})['then'](function(){_0x3aa7bf[_0x1898('0x6a')](function(_0x3dd699){socket['emit'](_0x1898('0x6b'),{'UserId':_0x3dd699['id'],'WhatsappQueueId':_0x1b4e49['id']});});});});});}})[_0x1898('0x28')](respondWithStatusCode(_0x346c4c,null))[_0x1898('0x41')](handleError(_0x346c4c,null));};exports[_0x1898('0x6c')]=function(_0x42a8e7,_0x477902,_0x426953){return db['Team'][_0x1898('0x40')]({'where':{'id':_0x42a8e7[_0x1898('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1898('0x63'),'attributes':['id'],'raw':!![]}]})[_0x1898('0x28')](handleEntityNotFound(_0x477902,null))[_0x1898('0x28')](function(_0x114e5c){var _0x33db15=_['map'](_0x114e5c,'id');var _0x5dbeb4=[];var _0x45b7ce=[];var _0x13052a=squel[_0x1898('0x6d')]();_0x13052a[_0x1898('0x6e')](_0x1898('0x6f'))['from']('team_has_whatsapp_queues','tq')[_0x1898('0x70')](_0x1898('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1898('0x3b')](_0x1898('0x72'),_0x42a8e7[_0x1898('0x50')]['id']);for(var _0x252cb6=0x0;_0x252cb6<_0x114e5c[_0x1898('0x54')];_0x252cb6+=0x1){let _0x52dac7=_0x114e5c[_0x252cb6];for(var _0xcdcba8=0x0;_0xcdcba8<_0x52dac7[_0x1898('0x63')]['length'];_0xcdcba8+=0x1){let _0x386626=_0x52dac7[_0x1898('0x63')][_0xcdcba8];var _0x19c417=_0x13052a[_0x1898('0x73')]();_0x19c417[_0x1898('0x3b')]('ut.UserId\x20=\x20?',_0x386626['id']);_0x45b7ce['push'](db[_0x1898('0x66')]['query'](_0x19c417[_0x1898('0x74')](),{'type':db[_0x1898('0x66')]['QueryTypes'][_0x1898('0x75')]})['then'](function(_0x39e2e5){if(_0x39e2e5[_0x1898('0x54')]===0x1){return _0x386626['id'];}else{var _0x322f13=_[_0x1898('0x76')](_[_0x1898('0x2e')](_0x39e2e5,_0x1898('0x77')),function(_0x492456){return _['includes'](_0x33db15,_0x492456);});if(_0x322f13){return _0x386626['id'];}}}));}}return BPromise[_0x1898('0x78')](_0x45b7ce)[_0x1898('0x28')](function(_0x39faea){_0x5dbeb4=_(_0x5dbeb4)[_0x1898('0x79')](_0x39faea)[_0x1898('0x7a')]()[_0x1898('0x7b')]();return db['WhatsappQueue'][_0x1898('0x47')]({'where':{'id':_0x42a8e7['params']['id']}})[_0x1898('0x28')](function(_0x3dd063){return db[_0x1898('0x66')][_0x1898('0x67')](function(_0x3d6cc5){return _0x3dd063[_0x1898('0x6c')](_0x42a8e7[_0x1898('0x33')][_0x1898('0x62')],{'transaction':_0x3d6cc5})[_0x1898('0x28')](function(){if(!_[_0x1898('0x7c')](_0x5dbeb4)){return _0x3dd063[_0x1898('0x7d')](_0x5dbeb4,{'transaction':_0x3d6cc5});}})['then'](function(){_0x5dbeb4[_0x1898('0x6a')](function(_0x4eb2b3){socket[_0x1898('0x7e')]('userWhatsappQueue:remove',{'UserId':_0x4eb2b3,'WhatsappQueueId':_0x3dd063['id']});});});});});});})[_0x1898('0x28')](respondWithStatusCode(_0x477902,null))[_0x1898('0x41')](handleError(_0x477902,null));};exports['addAgents']=function(_0x5582dc,_0x42198d,_0x1e81ef){return db[_0x1898('0x2f')]['find']({'where':{'id':_0x5582dc[_0x1898('0x50')]['id']}})[_0x1898('0x28')](handleEntityNotFound(_0x42198d,null))[_0x1898('0x28')](function(_0x4c155b){if(_0x4c155b){return _0x4c155b['addAgents'](_0x5582dc[_0x1898('0x49')][_0x1898('0x62')],_[_0x1898('0x7f')](_0x5582dc[_0x1898('0x49')],['ids','id'])||{})['spread'](function(_0x52f66d){for(var _0x51cae5=0x0;_0x51cae5<_0x5582dc[_0x1898('0x49')][_0x1898('0x62')][_0x1898('0x54')];_0x51cae5+=0x1){socket[_0x1898('0x7e')](_0x1898('0x6b'),{'UserId':Number(_0x5582dc['body'][_0x1898('0x62')][_0x51cae5]),'WhatsappQueueId':Number(_0x5582dc[_0x1898('0x50')]['id'])});}return _0x52f66d;});}})[_0x1898('0x28')](respondWithResult(_0x42198d,null))['catch'](handleError(_0x42198d,null));};exports[_0x1898('0x7d')]=function(_0xaf1765,_0x31cc12,_0x5b8599){return db[_0x1898('0x2f')][_0x1898('0x47')]({'where':{'id':_0xaf1765['params']['id']}})[_0x1898('0x28')](handleEntityNotFound(_0x31cc12,null))[_0x1898('0x28')](function(_0x279751){if(_0x279751){return _0x279751['removeAgents'](_0xaf1765[_0x1898('0x33')][_0x1898('0x62')])[_0x1898('0x28')](function(){if(_[_0x1898('0x80')](_0xaf1765[_0x1898('0x33')][_0x1898('0x62')])){for(var _0x466183=0x0;_0x466183<_0xaf1765['query'][_0x1898('0x62')]['length'];_0x466183+=0x1){socket[_0x1898('0x7e')]('userWhatsappQueue:remove',{'UserId':Number(_0xaf1765['query'][_0x1898('0x62')][_0x466183]),'WhatsappQueueId':Number(_0xaf1765[_0x1898('0x50')]['id'])});}}else{socket[_0x1898('0x7e')](_0x1898('0x81'),{'UserId':Number(_0xaf1765[_0x1898('0x33')][_0x1898('0x62')]),'WhatsappQueueId':Number(_0xaf1765[_0x1898('0x50')]['id'])});}});}})[_0x1898('0x28')](respondWithStatusCode(_0x31cc12,null))['catch'](handleError(_0x31cc12,null));};exports[_0x1898('0x82')]=function(_0x1b6ed9,_0x45fb3e,_0x34cf66){var _0x28de95={};var _0xd1ab32={};var _0x148d17;var _0x3acadb;return db[_0x1898('0x2f')][_0x1898('0x53')]({'where':{'id':_0x1b6ed9[_0x1898('0x50')]['id']}})['then'](handleEntityNotFound(_0x45fb3e,null))[_0x1898('0x28')](function(_0x71b0be){if(_0x71b0be){_0x148d17=_0x71b0be;_0xd1ab32[_0x1898('0x36')]=_[_0x1898('0x43')](db[_0x1898('0x58')][_0x1898('0x44')]);_0xd1ab32[_0x1898('0x33')]=_['keys'](_0x1b6ed9[_0x1898('0x33')]);_0xd1ab32[_0x1898('0x34')]=_[_0x1898('0x35')](_0xd1ab32[_0x1898('0x36')],_0xd1ab32['query']);_0x28de95[_0x1898('0x38')]=_[_0x1898('0x35')](_0xd1ab32[_0x1898('0x36')],qs[_0x1898('0x37')](_0x1b6ed9[_0x1898('0x33')][_0x1898('0x37')]));_0x28de95[_0x1898('0x38')]=_0x28de95[_0x1898('0x38')][_0x1898('0x54')]?_0x28de95[_0x1898('0x38')]:_0xd1ab32[_0x1898('0x36')];_0x28de95[_0x1898('0x55')]=qs[_0x1898('0x3a')](_0x1b6ed9[_0x1898('0x33')][_0x1898('0x3a')]);_0x28de95[_0x1898('0x3b')]=qs[_0x1898('0x34')](_[_0x1898('0x3c')](_0x1b6ed9[_0x1898('0x33')],_0xd1ab32[_0x1898('0x34')]));if(_0x1b6ed9[_0x1898('0x33')][_0x1898('0x3e')]){_0x28de95[_0x1898('0x3b')]=_['merge'](_0x28de95[_0x1898('0x3b')],{'$or':_[_0x1898('0x2e')](_0x28de95[_0x1898('0x38')],function(_0x3afbeb){var _0x8e1de5={};_0x8e1de5[_0x3afbeb]={'$like':'%'+_0x1b6ed9['query'][_0x1898('0x3e')]+'%'};return _0x8e1de5;})});}_0x28de95=_[_0x1898('0x3d')]({},_0x28de95,_0x1b6ed9[_0x1898('0x46')]);return _0x148d17[_0x1898('0x82')](_0x28de95);}})[_0x1898('0x28')](function(_0x45da6d){if(_0x45da6d){_0x3acadb=_0x45da6d[_0x1898('0x54')];if(!_0x1b6ed9[_0x1898('0x33')][_0x1898('0x39')](_0x1898('0x61'))){_0x28de95[_0x1898('0x20')]=qs[_0x1898('0x20')](_0x1b6ed9['query']['limit']);_0x28de95[_0x1898('0x1e')]=qs[_0x1898('0x1e')](_0x1b6ed9[_0x1898('0x33')][_0x1898('0x1e')]);}return _0x148d17[_0x1898('0x82')](_0x28de95);}})[_0x1898('0x28')](function(_0x561084){if(_0x561084){return _0x561084?{'count':_0x3acadb,'rows':_0x561084}:null;}})[_0x1898('0x28')](respondWithResult(_0x45fb3e,null))['catch'](handleError(_0x45fb3e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 74e795c..8083ca7 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 _0x0c37=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','save','update'];(function(_0xae7aec,_0x517740){var _0x4c4915=function(_0x573924){while(--_0x573924){_0xae7aec['push'](_0xae7aec['shift']());}};_0x4c4915(++_0x517740);}(_0x0c37,0xeb));var _0x70c3=function(_0x373b3e,_0x347ac7){_0x373b3e=_0x373b3e-0x0;var _0xa4ce3=_0x0c37[_0x373b3e];return _0xa4ce3;};'use strict';var EventEmitter=require(_0x70c3('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x70c3('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x70c3('0x2')](0x0);var events={'afterCreate':_0x70c3('0x3'),'afterUpdate':_0x70c3('0x4'),'afterDestroy':_0x70c3('0x5')};function emitEvent(_0x2d9979){return function(_0x3813b4,_0x11c9ac,_0x496313){WhatsappQueueEvents[_0x70c3('0x6')](_0x2d9979+':'+_0x3813b4['id'],_0x3813b4);WhatsappQueueEvents[_0x70c3('0x6')](_0x2d9979,_0x3813b4);_0x496313(null);};}for(var e in events){if(events[_0x70c3('0x7')](e)){var event=events[e];WhatsappQueue[_0x70c3('0x8')](e,emitEvent(event));}}module[_0x70c3('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0x648d=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue'];(function(_0x32e60f,_0xf00e7d){var _0x337c97=function(_0x497544){while(--_0x497544){_0x32e60f['push'](_0x32e60f['shift']());}};_0x337c97(++_0xf00e7d);}(_0x648d,0xf6));var _0xd648=function(_0x57f499,_0x3a9638){_0x57f499=_0x57f499-0x0;var _0xd62285=_0x648d[_0x57f499];return _0xd62285;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xd648('0x0'))['db'][_0xd648('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd648('0x2'),'afterUpdate':_0xd648('0x3'),'afterDestroy':_0xd648('0x4')};function emitEvent(_0x3b34aa){return function(_0x18a8bf,_0x3458c2,_0x563166){WhatsappQueueEvents['emit'](_0x3b34aa+':'+_0x18a8bf['id'],_0x18a8bf);WhatsappQueueEvents[_0xd648('0x5')](_0x3b34aa,_0x18a8bf);_0x563166(null);};}for(var e in events){if(events[_0xd648('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xd648('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 732c184..8fe13a0 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 _0xfdb3=['path','rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','bluebird'];(function(_0x311fc8,_0x38c9eb){var _0x371a71=function(_0x24314e){while(--_0x24314e){_0x311fc8['push'](_0x311fc8['shift']());}};_0x371a71(++_0x38c9eb);}(_0xfdb3,0x6a));var _0x3fdb=function(_0x10247d,_0x603ff5){_0x10247d=_0x10247d-0x0;var _0x249dd2=_0xfdb3[_0x10247d];return _0x249dd2;};'use strict';var _=require(_0x3fdb('0x0'));var util=require('util');var logger=require(_0x3fdb('0x1'))(_0x3fdb('0x2'));var moment=require('moment');var BPromise=require(_0x3fdb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fdb('0x4'));var rimraf=require(_0x3fdb('0x5'));var config=require(_0x3fdb('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x3fdb('0x7')]=function(_0x2d61e3,_0x339f53){return _0x2d61e3[_0x3fdb('0x8')](_0x3fdb('0x9'),attributes,{'tableName':_0x3fdb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc144=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappQueue','lodash'];(function(_0x5d965d,_0x22e2d9){var _0x1eaa43=function(_0x602def){while(--_0x602def){_0x5d965d['push'](_0x5d965d['shift']());}};_0x1eaa43(++_0x22e2d9);}(_0xc144,0x15b));var _0x4c14=function(_0x4c92c8,_0x3fc3f9){_0x4c92c8=_0x4c92c8-0x0;var _0x411ae0=_0xc144[_0x4c92c8];return _0x411ae0;};'use strict';var _=require(_0x4c14('0x0'));var util=require(_0x4c14('0x1'));var logger=require(_0x4c14('0x2'))(_0x4c14('0x3'));var moment=require(_0x4c14('0x4'));var BPromise=require(_0x4c14('0x5'));var rp=require(_0x4c14('0x6'));var fs=require('fs');var path=require(_0x4c14('0x7'));var rimraf=require(_0x4c14('0x8'));var config=require(_0x4c14('0x9'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x551e2b,_0x4c61c6){return _0x551e2b[_0x4c14('0xa')](_0x4c14('0xb'),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 feabc14..25f2464 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 _0x08a9=['request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','then','GetWhatsappQueue','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x28c743,_0x1f6300){var _0x2aa122=function(_0x225279){while(--_0x225279){_0x28c743['push'](_0x28c743['shift']());}};_0x2aa122(++_0x1f6300);}(_0x08a9,0x1a8));var _0x908a=function(_0x22d423,_0x4ee083){_0x22d423=_0x22d423-0x0;var _0x1017ed=_0x08a9[_0x22d423];return _0x1017ed;};'use strict';var _=require(_0x908a('0x0'));var util=require(_0x908a('0x1'));var moment=require(_0x908a('0x2'));var BPromise=require(_0x908a('0x3'));var rs=require(_0x908a('0x4'));var fs=require('fs');var Redis=require(_0x908a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x908a('0x6'));var config=require(_0x908a('0x7'));var jayson=require(_0x908a('0x8'));var client=jayson[_0x908a('0x9')][_0x908a('0xa')]({'port':0x232a});config[_0x908a('0xb')]=_[_0x908a('0xc')](config[_0x908a('0xb')],{'host':_0x908a('0xd'),'port':0x18eb});var socket=require(_0x908a('0xe'))(new Redis(config[_0x908a('0xb')]));require('./whatsappQueue.socket')[_0x908a('0xf')](socket);function respondWithRpcPromise(_0x545000,_0x2a162f,_0x39b7a1){return new BPromise(function(_0x1b1b28,_0x2db39b){return client[_0x908a('0x10')](_0x545000,_0x39b7a1)['then'](function(_0x2e7cee){logger[_0x908a('0x11')](_0x908a('0x12'),_0x2a162f,_0x908a('0x13'));logger[_0x908a('0x14')](_0x908a('0x15'),_0x2a162f,_0x908a('0x13'),JSON[_0x908a('0x16')](_0x2e7cee));if(_0x2e7cee[_0x908a('0x17')]){if(_0x2e7cee[_0x908a('0x17')][_0x908a('0x18')]===0x1f4){logger[_0x908a('0x17')](_0x908a('0x12'),_0x2a162f,_0x2e7cee[_0x908a('0x17')][_0x908a('0x19')]);return _0x2db39b(_0x2e7cee['error'][_0x908a('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2a162f,_0x2e7cee[_0x908a('0x17')][_0x908a('0x19')]);return _0x1b1b28(_0x2e7cee[_0x908a('0x17')]['message']);}else{logger[_0x908a('0x11')](_0x908a('0x12'),_0x2a162f,_0x908a('0x13'));_0x1b1b28(_0x2e7cee[_0x908a('0x1a')][_0x908a('0x19')]);}})[_0x908a('0x1b')](function(_0x4bd8d9){logger['error'](_0x908a('0x12'),_0x2a162f,_0x4bd8d9);_0x2db39b(_0x4bd8d9);});});}exports['GetWhatsappQueue']=function(_0x299c83){var _0x7fdff1=this;return new Promise(function(_0x340500,_0x4e1b20){return db[_0x908a('0x1c')][_0x908a('0x1d')]({'raw':_0x299c83[_0x908a('0x1e')]?_0x299c83[_0x908a('0x1e')][_0x908a('0x1f')]===undefined?!![]:![]:!![],'where':_0x299c83[_0x908a('0x1e')]?_0x299c83[_0x908a('0x1e')][_0x908a('0x20')]||null:null,'attributes':_0x299c83['options']?_0x299c83[_0x908a('0x1e')][_0x908a('0x21')]||null:null,'limit':_0x299c83[_0x908a('0x1e')]?_0x299c83['options']['limit']||null:null,'include':_0x299c83['options']?_0x299c83[_0x908a('0x1e')]['include']?_[_0x908a('0x22')](_0x299c83[_0x908a('0x1e')][_0x908a('0x23')],function(_0x5d7fd5){return{'model':db[_0x5d7fd5[_0x908a('0x24')]],'as':_0x5d7fd5['as'],'attributes':_0x5d7fd5[_0x908a('0x21')],'include':_0x5d7fd5[_0x908a('0x23')]?_[_0x908a('0x22')](_0x5d7fd5['include'],function(_0x5ebecc){return{'model':db[_0x5ebecc[_0x908a('0x24')]],'as':_0x5ebecc['as'],'attributes':_0x5ebecc[_0x908a('0x21')],'include':_0x5ebecc['include']?_['map'](_0x5ebecc[_0x908a('0x23')],function(_0x502c04){return{'model':db[_0x502c04['model']],'as':_0x502c04['as'],'attributes':_0x502c04[_0x908a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x908a('0x25')](function(_0x44586c){logger[_0x908a('0x11')]('GetWhatsappQueue',_0x299c83);logger[_0x908a('0x14')](_0x908a('0x26'),_0x299c83,JSON[_0x908a('0x16')](_0x44586c));_0x340500(_0x44586c);})[_0x908a('0x1b')](function(_0x11369d){logger[_0x908a('0x17')](_0x908a('0x26'),_0x11369d[_0x908a('0x19')],_0x299c83);_0x4e1b20(_0x7fdff1['error'](0x1f4,_0x11369d[_0x908a('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x3783cd){var _0x280f46=this;return new Promise(function(_0x4a17e5,_0x19501e){return db['WhatsappQueue']['find']({'raw':_0x3783cd[_0x908a('0x1e')]?_0x3783cd[_0x908a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3783cd['options']?_0x3783cd[_0x908a('0x1e')][_0x908a('0x20')]||null:null,'attributes':_0x3783cd[_0x908a('0x1e')]?_0x3783cd[_0x908a('0x1e')][_0x908a('0x21')]||null:null,'include':_0x3783cd[_0x908a('0x1e')]?_0x3783cd[_0x908a('0x1e')][_0x908a('0x23')]?_[_0x908a('0x22')](_0x3783cd['options'][_0x908a('0x23')],function(_0x3d9766){return{'model':db[_0x3d9766['model']],'as':_0x3d9766['as'],'attributes':_0x3d9766[_0x908a('0x21')],'include':_0x3d9766[_0x908a('0x23')]?_[_0x908a('0x22')](_0x3d9766['include'],function(_0x41620c){return{'model':db[_0x41620c['model']],'as':_0x41620c['as'],'attributes':_0x41620c[_0x908a('0x21')],'include':_0x41620c['include']?_['map'](_0x41620c[_0x908a('0x23')],function(_0x3e2be9){return{'model':db[_0x3e2be9[_0x908a('0x24')]],'as':_0x3e2be9['as'],'attributes':_0x3e2be9[_0x908a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x908a('0x25')](function(_0x5921c0){logger['info']('ShowWhatsappQueue',_0x3783cd);logger[_0x908a('0x14')](_0x908a('0x27'),_0x3783cd,JSON[_0x908a('0x16')](_0x5921c0));_0x4a17e5(_0x5921c0);})[_0x908a('0x1b')](function(_0x18b905){logger[_0x908a('0x17')]('ShowWhatsappQueue',_0x18b905[_0x908a('0x19')],_0x3783cd);_0x19501e(_0x280f46[_0x908a('0x17')](0x1f4,_0x18b905[_0x908a('0x19')]));});});}; \ No newline at end of file +var _0x8bdb=['http','redis','defaults','localhost','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowWhatsappQueue','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x8bdb,0x65));var _0xb8bd=function(_0x49d000,_0x4dcd9a){_0x49d000=_0x49d000-0x0;var _0x4809e2=_0x8bdb[_0x49d000];return _0x4809e2;};'use strict';var _=require(_0xb8bd('0x0'));var util=require(_0xb8bd('0x1'));var moment=require('moment');var BPromise=require(_0xb8bd('0x2'));var rs=require(_0xb8bd('0x3'));var fs=require('fs');var Redis=require(_0xb8bd('0x4'));var db=require(_0xb8bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb8bd('0x6'));var client=jayson['client'][_0xb8bd('0x7')]({'port':0x232a});config[_0xb8bd('0x8')]=_[_0xb8bd('0x9')](config[_0xb8bd('0x8')],{'host':_0xb8bd('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb8bd('0xb'))[_0xb8bd('0xc')](socket);function respondWithRpcPromise(_0x317af1,_0x5d189c,_0x26b529){return new BPromise(function(_0x4f5240,_0x3ff5bb){return client['request'](_0x317af1,_0x26b529)[_0xb8bd('0xd')](function(_0x4159f4){logger[_0xb8bd('0xe')](_0xb8bd('0xf'),_0x5d189c,_0xb8bd('0x10'));logger[_0xb8bd('0x11')](_0xb8bd('0x12'),_0x5d189c,_0xb8bd('0x10'),JSON['stringify'](_0x4159f4));if(_0x4159f4['error']){if(_0x4159f4[_0xb8bd('0x13')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x5d189c,_0x4159f4['error']['message']);return _0x3ff5bb(_0x4159f4[_0xb8bd('0x13')][_0xb8bd('0x14')]);}logger[_0xb8bd('0x13')](_0xb8bd('0xf'),_0x5d189c,_0x4159f4[_0xb8bd('0x13')][_0xb8bd('0x14')]);return _0x4f5240(_0x4159f4[_0xb8bd('0x13')][_0xb8bd('0x14')]);}else{logger['info'](_0xb8bd('0xf'),_0x5d189c,_0xb8bd('0x10'));_0x4f5240(_0x4159f4['result'][_0xb8bd('0x14')]);}})[_0xb8bd('0x15')](function(_0x5ef6c3){logger[_0xb8bd('0x13')](_0xb8bd('0xf'),_0x5d189c,_0x5ef6c3);_0x3ff5bb(_0x5ef6c3);});});}exports[_0xb8bd('0x16')]=function(_0x157a36){var _0x33e53a=this;return new Promise(function(_0x8a0c72,_0x202c23){return db[_0xb8bd('0x17')][_0xb8bd('0x18')]({'raw':_0x157a36['options']?_0x157a36[_0xb8bd('0x19')][_0xb8bd('0x1a')]===undefined?!![]:![]:!![],'where':_0x157a36['options']?_0x157a36[_0xb8bd('0x19')]['where']||null:null,'attributes':_0x157a36[_0xb8bd('0x19')]?_0x157a36[_0xb8bd('0x19')][_0xb8bd('0x1b')]||null:null,'limit':_0x157a36[_0xb8bd('0x19')]?_0x157a36[_0xb8bd('0x19')][_0xb8bd('0x1c')]||null:null,'include':_0x157a36['options']?_0x157a36['options'][_0xb8bd('0x1d')]?_[_0xb8bd('0x1e')](_0x157a36[_0xb8bd('0x19')][_0xb8bd('0x1d')],function(_0x4bced8){return{'model':db[_0x4bced8['model']],'as':_0x4bced8['as'],'attributes':_0x4bced8[_0xb8bd('0x1b')],'include':_0x4bced8['include']?_[_0xb8bd('0x1e')](_0x4bced8['include'],function(_0x51ca6c){return{'model':db[_0x51ca6c['model']],'as':_0x51ca6c['as'],'attributes':_0x51ca6c[_0xb8bd('0x1b')],'include':_0x51ca6c[_0xb8bd('0x1d')]?_[_0xb8bd('0x1e')](_0x51ca6c[_0xb8bd('0x1d')],function(_0xc7089b){return{'model':db[_0xc7089b[_0xb8bd('0x1f')]],'as':_0xc7089b['as'],'attributes':_0xc7089b[_0xb8bd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb8bd('0xd')](function(_0x37870d){logger[_0xb8bd('0xe')](_0xb8bd('0x16'),_0x157a36);logger[_0xb8bd('0x11')](_0xb8bd('0x16'),_0x157a36,JSON['stringify'](_0x37870d));_0x8a0c72(_0x37870d);})[_0xb8bd('0x15')](function(_0xaf2963){logger[_0xb8bd('0x13')](_0xb8bd('0x16'),_0xaf2963[_0xb8bd('0x14')],_0x157a36);_0x202c23(_0x33e53a[_0xb8bd('0x13')](0x1f4,_0xaf2963[_0xb8bd('0x14')]));});});};exports['ShowWhatsappQueue']=function(_0x36941b){var _0xc47d5f=this;return new Promise(function(_0x559b73,_0x1ab714){return db[_0xb8bd('0x17')][_0xb8bd('0x20')]({'raw':_0x36941b[_0xb8bd('0x19')]?_0x36941b[_0xb8bd('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x36941b['options']?_0x36941b[_0xb8bd('0x19')][_0xb8bd('0x21')]||null:null,'attributes':_0x36941b[_0xb8bd('0x19')]?_0x36941b['options'][_0xb8bd('0x1b')]||null:null,'include':_0x36941b[_0xb8bd('0x19')]?_0x36941b[_0xb8bd('0x19')]['include']?_[_0xb8bd('0x1e')](_0x36941b[_0xb8bd('0x19')][_0xb8bd('0x1d')],function(_0x2c2069){return{'model':db[_0x2c2069[_0xb8bd('0x1f')]],'as':_0x2c2069['as'],'attributes':_0x2c2069[_0xb8bd('0x1b')],'include':_0x2c2069[_0xb8bd('0x1d')]?_['map'](_0x2c2069[_0xb8bd('0x1d')],function(_0x177d30){return{'model':db[_0x177d30[_0xb8bd('0x1f')]],'as':_0x177d30['as'],'attributes':_0x177d30[_0xb8bd('0x1b')],'include':_0x177d30[_0xb8bd('0x1d')]?_[_0xb8bd('0x1e')](_0x177d30[_0xb8bd('0x1d')],function(_0x3f13b9){return{'model':db[_0x3f13b9[_0xb8bd('0x1f')]],'as':_0x3f13b9['as'],'attributes':_0x3f13b9[_0xb8bd('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x144c9f){logger[_0xb8bd('0xe')](_0xb8bd('0x22'),_0x36941b);logger[_0xb8bd('0x11')](_0xb8bd('0x22'),_0x36941b,JSON[_0xb8bd('0x23')](_0x144c9f));_0x559b73(_0x144c9f);})[_0xb8bd('0x15')](function(_0x2c733a){logger[_0xb8bd('0x13')](_0xb8bd('0x22'),_0x2c733a['message'],_0x36941b);_0x1ab714(_0xc47d5f[_0xb8bd('0x13')](0x1f4,_0x2c733a[_0xb8bd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 29e1d96..5f576af 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 _0xa56e=['update','emit','remove'];(function(_0x5b8429,_0x184a91){var _0x588111=function(_0x4ef81a){while(--_0x4ef81a){_0x5b8429['push'](_0x5b8429['shift']());}};_0x588111(++_0x184a91);}(_0xa56e,0xda));var _0xea56=function(_0x5b96f6,_0x26fe54){_0x5b96f6=_0x5b96f6-0x0;var _0xe67cd8=_0xa56e[_0x5b96f6];return _0xe67cd8;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xea56('0x0'),_0xea56('0x1')];function createListener(_0x36afce,_0x2b5519){return function(_0x930236){_0x2b5519[_0xea56('0x2')](_0x36afce,_0x930236);};}function removeListener(_0x2a8b3f,_0x2f3fd1){return function(){WhatsappQueueEvents['removeListener'](_0x2a8b3f,_0x2f3fd1);};}exports['register']=function(_0x4d7e71){for(var _0x5474b5=0x0,_0x1b9a00=events['length'];_0x5474b5<_0x1b9a00;_0x5474b5++){var _0x46a494=events[_0x5474b5];var _0x52ab3e=createListener('whatsappQueue:'+_0x46a494,_0x4d7e71);WhatsappQueueEvents['on'](_0x46a494,_0x52ab3e);}}; \ No newline at end of file +var _0x3ffb=['./whatsappQueue.events','remove','update','removeListener','register','length','whatsappQueue:'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3ffb,0x93));var _0xb3ff=function(_0x4a2613,_0xfe365d){_0x4a2613=_0x4a2613-0x0;var _0x4345e0=_0x3ffb[_0x4a2613];return _0x4345e0;};'use strict';var WhatsappQueueEvents=require(_0xb3ff('0x0'));var events=['save',_0xb3ff('0x1'),_0xb3ff('0x2')];function createListener(_0x4d2cc6,_0x5350fd){return function(_0x2d7024){_0x5350fd['emit'](_0x4d2cc6,_0x2d7024);};}function removeListener(_0x35f276,_0x4a6259){return function(){WhatsappQueueEvents[_0xb3ff('0x3')](_0x35f276,_0x4a6259);};}exports[_0xb3ff('0x4')]=function(_0x5e6d42){for(var _0x1d3915=0x0,_0x803907=events[_0xb3ff('0x5')];_0x1d3915<_0x803907;_0x1d3915++){var _0x39b578=events[_0x1d3915];var _0x508a0a=createListener(_0xb3ff('0x6')+_0x39b578,_0x5e6d42);WhatsappQueueEvents['on'](_0x39b578,_0x508a0a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d187330..94d8242 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 _0x945c=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x945c,0x16a));var _0xc945=function(_0x23e5fd,_0x2c6da6){_0x23e5fd=_0x23e5fd-0x0;var _0xab592b=_0x945c[_0x23e5fd];return _0xab592b;};'use strict';var multer=require(_0xc945('0x0'));var util=require(_0xc945('0x1'));var path=require(_0xc945('0x2'));var timeout=require(_0xc945('0x3'));var express=require(_0xc945('0x4'));var router=express[_0xc945('0x5')]();var fs_extra=require(_0xc945('0x6'));var auth=require(_0xc945('0x7'));var interaction=require(_0xc945('0x8'));var config=require('../../config/environment');var controller=require(_0xc945('0x9'));router[_0xc945('0xa')]('/',auth[_0xc945('0xb')](),controller[_0xc945('0xc')]);router[_0xc945('0xa')]('/describe',auth[_0xc945('0xb')](),controller['describe']);router['get'](_0xc945('0xd'),auth[_0xc945('0xb')](),controller[_0xc945('0xe')]);router[_0xc945('0xf')]('/',auth[_0xc945('0xb')](),controller[_0xc945('0x10')]);router['put']('/:id',auth[_0xc945('0xb')](),controller[_0xc945('0x11')]);router['delete'](_0xc945('0xd'),auth[_0xc945('0xb')](),controller[_0xc945('0x12')]);module['exports']=router; \ No newline at end of file +var _0xad9f=['post','create','update','destroy','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1643a8,_0x57ca93){var _0x56adde=function(_0xfcacf3){while(--_0xfcacf3){_0x1643a8['push'](_0x1643a8['shift']());}};_0x56adde(++_0x57ca93);}(_0xad9f,0x75));var _0xfad9=function(_0xc4b2d7,_0x279c97){_0xc4b2d7=_0xc4b2d7-0x0;var _0x138c47=_0xad9f[_0xc4b2d7];return _0x138c47;};'use strict';var multer=require('multer');var util=require(_0xfad9('0x0'));var path=require(_0xfad9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfad9('0x2'));var auth=require(_0xfad9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfad9('0x4'));var controller=require('./whatsappQueueReport.controller');router[_0xfad9('0x5')]('/',auth[_0xfad9('0x6')](),controller['index']);router[_0xfad9('0x5')](_0xfad9('0x7'),auth[_0xfad9('0x6')](),controller[_0xfad9('0x8')]);router[_0xfad9('0x5')](_0xfad9('0x9'),auth[_0xfad9('0x6')](),controller[_0xfad9('0xa')]);router[_0xfad9('0xb')]('/',auth[_0xfad9('0x6')](),controller[_0xfad9('0xc')]);router['put'](_0xfad9('0x9'),auth['isAuthenticated'](),controller[_0xfad9('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfad9('0xe')]);module[_0xfad9('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 645f262..05484df 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(_0x442feb,_0x16779c){var _0x3d1c70=function(_0x8659a1){while(--_0x8659a1){_0x442feb['push'](_0x442feb['shift']());}};_0x3d1c70(++_0x16779c);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2fb343,_0x23078f){var _0x9d9832=function(_0x2bf2db){while(--_0x2bf2db){_0x2fb343['push'](_0x2fb343['shift']());}};_0x9d9832(++_0x23078f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 8f1d20e..2aabaa0 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 _0x14a0=['mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x14a0,0x8e));var _0x014a=function(_0x204e38,_0x2b5ab8){_0x204e38=_0x204e38-0x0;var _0x1b15a1=_0x14a0[_0x204e38];return _0x1b15a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];function respondWithStatusCode(_0x43bfeb,_0x1bcd1){_0x1bcd1=_0x1bcd1||0xcc;return function(_0x20cb56){if(_0x20cb56){return _0x43bfeb[_0x014a('0x14')](_0x1bcd1);}return _0x43bfeb[_0x014a('0x15')](_0x1bcd1)[_0x014a('0x16')]();};}function respondWithResult(_0x71535d,_0x45cd80){_0x45cd80=_0x45cd80||0xc8;return function(_0x3c54c8){if(_0x3c54c8){return _0x71535d['status'](_0x45cd80)[_0x014a('0x17')](_0x3c54c8);}};}function respondWithFilteredResult(_0x3cf92f,_0x59f207){return function(_0x3a836f){if(_0x3a836f){var _0x128c46=typeof _0x59f207['offset']===_0x014a('0x18')&&typeof _0x59f207[_0x014a('0x19')]===_0x014a('0x18');var _0x12da95=_0x3a836f[_0x014a('0x1a')];var _0x12d339=_0x128c46?0x0:_0x59f207[_0x014a('0x1b')];var _0x263b07=_0x128c46?_0x3a836f[_0x014a('0x1a')]:_0x59f207[_0x014a('0x1b')]+_0x59f207[_0x014a('0x19')];var _0x89e132;if(_0x263b07>=_0x12da95){_0x263b07=_0x12da95;_0x89e132=0xc8;}else{_0x89e132=0xce;}_0x3cf92f[_0x014a('0x15')](_0x89e132);return _0x3cf92f[_0x014a('0x1c')]('Content-Range',_0x12d339+'-'+_0x263b07+'/'+_0x12da95)[_0x014a('0x17')](_0x3a836f);}return null;};}function patchUpdates(_0x109a9c){return function(_0x11065f){try{jsonpatch[_0x014a('0x1d')](_0x11065f,_0x109a9c,!![]);}catch(_0xc9a563){return BPromise[_0x014a('0x1e')](_0xc9a563);}return _0x11065f[_0x014a('0x1f')]();};}function saveUpdates(_0x3dd2d0,_0x290b86){return function(_0x486e66){if(_0x486e66){return _0x486e66[_0x014a('0x20')](_0x3dd2d0)['then'](function(_0x1a1318){return _0x1a1318;});}return null;};}function removeEntity(_0x26718b,_0x44d921){return function(_0x36d52b){if(_0x36d52b){return _0x36d52b[_0x014a('0x21')]()[_0x014a('0x22')](function(){_0x26718b[_0x014a('0x15')](0xcc)[_0x014a('0x16')]();});}};}function handleEntityNotFound(_0x165a42,_0x4c2627){return function(_0x3b4b92){if(!_0x3b4b92){_0x165a42['sendStatus'](0x194);}return _0x3b4b92;};}function handleError(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0x1f4;return function(_0x4f1c44){logger['error'](_0x4f1c44[_0x014a('0x23')]);if(_0x4f1c44[_0x014a('0x24')]){delete _0x4f1c44[_0x014a('0x24')];}_0x39a432['status'](_0x28701e)[_0x014a('0x25')](_0x4f1c44);};}exports[_0x014a('0x26')]=function(_0x598179,_0x31dc95){var _0x2560a6={},_0x496040={},_0x4f9c1c={'count':0x0,'rows':[]};var _0x397850=_[_0x014a('0x27')](db[_0x014a('0x28')][_0x014a('0x29')],function(_0x4ea00c){return{'name':_0x4ea00c[_0x014a('0x2a')],'type':_0x4ea00c[_0x014a('0x2b')][_0x014a('0x2c')]};});_0x496040[_0x014a('0x2d')]=_[_0x014a('0x27')](_0x397850,_0x014a('0x24'));_0x496040[_0x014a('0x2e')]=_[_0x014a('0x2f')](_0x598179[_0x014a('0x2e')]);_0x496040[_0x014a('0x30')]=_[_0x014a('0x31')](_0x496040['model'],_0x496040[_0x014a('0x2e')]);_0x2560a6[_0x014a('0x32')]=_[_0x014a('0x31')](_0x496040[_0x014a('0x2d')],qs[_0x014a('0x33')](_0x598179[_0x014a('0x2e')][_0x014a('0x33')]));_0x2560a6['attributes']=_0x2560a6[_0x014a('0x32')][_0x014a('0x34')]?_0x2560a6['attributes']:_0x496040[_0x014a('0x2d')];if(!_0x598179[_0x014a('0x2e')][_0x014a('0x35')](_0x014a('0x36'))){_0x2560a6[_0x014a('0x19')]=qs[_0x014a('0x19')](_0x598179[_0x014a('0x2e')][_0x014a('0x19')]);_0x2560a6['offset']=qs[_0x014a('0x1b')](_0x598179[_0x014a('0x2e')][_0x014a('0x1b')]);}_0x2560a6[_0x014a('0x37')]=qs['sort'](_0x598179[_0x014a('0x2e')][_0x014a('0x38')]);_0x2560a6[_0x014a('0x39')]=qs[_0x014a('0x30')](_[_0x014a('0x3a')](_0x598179[_0x014a('0x2e')],_0x496040[_0x014a('0x30')]),_0x397850);if(_0x598179[_0x014a('0x2e')][_0x014a('0x3b')]){_0x2560a6['where']=_[_0x014a('0x3c')](_0x2560a6['where'],{'$or':_[_0x014a('0x27')](_0x397850,function(_0xc11492){if(_0xc11492[_0x014a('0x2b')]!==_0x014a('0x3d')){var _0x43376c={};_0x43376c[_0xc11492['name']]={'$like':'%'+_0x598179[_0x014a('0x2e')][_0x014a('0x3b')]+'%'};return _0x43376c;}})});}_0x2560a6=_['merge']({},_0x2560a6,_0x598179[_0x014a('0x3e')]);var _0x2990df={'where':_0x2560a6[_0x014a('0x39')]};return db[_0x014a('0x28')][_0x014a('0x1a')](_0x2990df)[_0x014a('0x22')](function(_0x17b1b6){_0x4f9c1c[_0x014a('0x1a')]=_0x17b1b6;if(_0x598179[_0x014a('0x2e')]['includeAll']){_0x2560a6[_0x014a('0x3f')]=[{'all':!![]}];}return db[_0x014a('0x28')][_0x014a('0x40')](_0x2560a6);})[_0x014a('0x22')](function(_0x5f1a91){_0x4f9c1c[_0x014a('0x41')]=_0x5f1a91;return _0x4f9c1c;})[_0x014a('0x22')](respondWithFilteredResult(_0x31dc95,_0x2560a6))[_0x014a('0x42')](handleError(_0x31dc95,null));};exports[_0x014a('0x43')]=function(_0x1dc647,_0x430a56){var _0x5f2969={'raw':!![],'where':{'id':_0x1dc647[_0x014a('0x44')]['id']}},_0x361866={};_0x361866['model']=_[_0x014a('0x2f')](db[_0x014a('0x28')][_0x014a('0x29')]);_0x361866['query']=_[_0x014a('0x2f')](_0x1dc647['query']);_0x361866['filters']=_[_0x014a('0x31')](_0x361866[_0x014a('0x2d')],_0x361866['query']);_0x5f2969[_0x014a('0x32')]=_[_0x014a('0x31')](_0x361866[_0x014a('0x2d')],qs[_0x014a('0x33')](_0x1dc647[_0x014a('0x2e')][_0x014a('0x33')]));_0x5f2969['attributes']=_0x5f2969[_0x014a('0x32')][_0x014a('0x34')]?_0x5f2969[_0x014a('0x32')]:_0x361866['model'];if(_0x1dc647['query'][_0x014a('0x45')]){_0x5f2969['include']=[{'all':!![]}];}_0x5f2969=_['merge']({},_0x5f2969,_0x1dc647[_0x014a('0x3e')]);return db['WhatsappQueueReport'][_0x014a('0x46')](_0x5f2969)[_0x014a('0x22')](handleEntityNotFound(_0x430a56,null))[_0x014a('0x22')](respondWithResult(_0x430a56,null))['catch'](handleError(_0x430a56,null));};exports[_0x014a('0x47')]=function(_0x23be18,_0x12cd9b){return db[_0x014a('0x28')][_0x014a('0x47')](_0x23be18[_0x014a('0x48')],{})['then'](respondWithResult(_0x12cd9b,0xc9))[_0x014a('0x42')](handleError(_0x12cd9b,null));};exports[_0x014a('0x20')]=function(_0x5a861c,_0x1a4df9){if(_0x5a861c[_0x014a('0x48')]['id']){delete _0x5a861c[_0x014a('0x48')]['id'];}return db[_0x014a('0x28')][_0x014a('0x46')]({'where':{'id':_0x5a861c[_0x014a('0x44')]['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x1a4df9,null))[_0x014a('0x22')](saveUpdates(_0x5a861c['body'],null))[_0x014a('0x22')](respondWithResult(_0x1a4df9,null))[_0x014a('0x42')](handleError(_0x1a4df9,null));};exports[_0x014a('0x21')]=function(_0x135e7e,_0x312c7a){return db['WhatsappQueueReport'][_0x014a('0x46')]({'where':{'id':_0x135e7e['params']['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x312c7a,null))[_0x014a('0x22')](removeEntity(_0x312c7a,null))[_0x014a('0x42')](handleError(_0x312c7a,null));};exports[_0x014a('0x49')]=function(_0x3caa6e,_0x4f8547){return db['WhatsappQueueReport']['describe']()['then'](respondWithResult(_0x4f8547,null))[_0x014a('0x42')](handleError(_0x4f8547,null));}; \ No newline at end of file +var _0x3266=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','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','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model'];(function(_0x55184c,_0x1b9317){var _0x1acbcf=function(_0x15df5a){while(--_0x15df5a){_0x55184c['push'](_0x55184c['shift']());}};_0x1acbcf(++_0x1b9317);}(_0x3266,0x6a));var _0x6326=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x3266[_0x2642cb];return _0xe6e41;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){_0x429bb0[_0x6326('0x1d')](0xcc)[_0x6326('0x27')]();});}};}function handleEntityNotFound(_0x575701,_0x4e272b){return function(_0x4d28fd){if(!_0x4d28fd){_0x575701[_0x6326('0x1c')](0x194);}return _0x4d28fd;};}function handleError(_0x4dae28,_0x33c466){_0x33c466=_0x33c466||0x1f4;return function(_0x1a48da){logger['error'](_0x1a48da[_0x6326('0x28')]);if(_0x1a48da[_0x6326('0x29')]){delete _0x1a48da[_0x6326('0x29')];}_0x4dae28[_0x6326('0x1d')](_0x33c466)[_0x6326('0x2a')](_0x1a48da);};}exports[_0x6326('0x2b')]=function(_0x40e036,_0x27802c){var _0x461e0f={},_0x127744={},_0x4980f6={'count':0x0,'rows':[]};var _0x2a8873=_[_0x6326('0x2c')](db[_0x6326('0x2d')][_0x6326('0x2e')],function(_0x20c5ab){return{'name':_0x20c5ab['fieldName'],'type':_0x20c5ab[_0x6326('0x2f')][_0x6326('0x30')]};});_0x127744[_0x6326('0x31')]=_['map'](_0x2a8873,_0x6326('0x29'));_0x127744['query']=_['keys'](_0x40e036[_0x6326('0x32')]);_0x127744[_0x6326('0x33')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],_0x127744[_0x6326('0x32')]);_0x461e0f[_0x6326('0x35')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],qs[_0x6326('0x36')](_0x40e036[_0x6326('0x32')][_0x6326('0x36')]));_0x461e0f[_0x6326('0x35')]=_0x461e0f['attributes'][_0x6326('0x37')]?_0x461e0f[_0x6326('0x35')]:_0x127744['model'];if(!_0x40e036[_0x6326('0x32')][_0x6326('0x38')](_0x6326('0x39'))){_0x461e0f['limit']=qs[_0x6326('0x3a')](_0x40e036['query']['limit']);_0x461e0f[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x40e036[_0x6326('0x32')]['offset']);}_0x461e0f[_0x6326('0x3b')]=qs['sort'](_0x40e036[_0x6326('0x32')]['sort']);_0x461e0f[_0x6326('0x3c')]=qs[_0x6326('0x33')](_[_0x6326('0x3d')](_0x40e036[_0x6326('0x32')],_0x127744[_0x6326('0x33')]),_0x2a8873);if(_0x40e036[_0x6326('0x32')]['filter']){_0x461e0f[_0x6326('0x3c')]=_[_0x6326('0x3e')](_0x461e0f['where'],{'$or':_[_0x6326('0x2c')](_0x2a8873,function(_0x5ae140){if(_0x5ae140['type']!==_0x6326('0x3f')){var _0x1f8dcf={};_0x1f8dcf[_0x5ae140[_0x6326('0x29')]]={'$like':'%'+_0x40e036[_0x6326('0x32')][_0x6326('0x40')]+'%'};return _0x1f8dcf;}})});}_0x461e0f=_[_0x6326('0x3e')]({},_0x461e0f,_0x40e036['options']);var _0x485bed={'where':_0x461e0f[_0x6326('0x3c')]};return db['WhatsappQueueReport'][_0x6326('0x20')](_0x485bed)['then'](function(_0x282f33){_0x4980f6[_0x6326('0x20')]=_0x282f33;if(_0x40e036[_0x6326('0x32')][_0x6326('0x41')]){_0x461e0f[_0x6326('0x42')]=[{'all':!![]}];}return db[_0x6326('0x2d')][_0x6326('0x43')](_0x461e0f);})[_0x6326('0x25')](function(_0x3b089b){_0x4980f6[_0x6326('0x44')]=_0x3b089b;return _0x4980f6;})[_0x6326('0x25')](respondWithFilteredResult(_0x27802c,_0x461e0f))['catch'](handleError(_0x27802c,null));};exports[_0x6326('0x45')]=function(_0x5ce03a,_0x29f2fd){var _0x1d9d4c={'raw':!![],'where':{'id':_0x5ce03a[_0x6326('0x46')]['id']}},_0x16fc33={};_0x16fc33['model']=_[_0x6326('0x47')](db[_0x6326('0x2d')]['rawAttributes']);_0x16fc33[_0x6326('0x32')]=_[_0x6326('0x47')](_0x5ce03a[_0x6326('0x32')]);_0x16fc33[_0x6326('0x33')]=_['intersection'](_0x16fc33[_0x6326('0x31')],_0x16fc33[_0x6326('0x32')]);_0x1d9d4c[_0x6326('0x35')]=_[_0x6326('0x34')](_0x16fc33[_0x6326('0x31')],qs[_0x6326('0x36')](_0x5ce03a[_0x6326('0x32')]['fields']));_0x1d9d4c[_0x6326('0x35')]=_0x1d9d4c[_0x6326('0x35')][_0x6326('0x37')]?_0x1d9d4c[_0x6326('0x35')]:_0x16fc33['model'];if(_0x5ce03a[_0x6326('0x32')]['includeAll']){_0x1d9d4c[_0x6326('0x42')]=[{'all':!![]}];}_0x1d9d4c=_[_0x6326('0x3e')]({},_0x1d9d4c,_0x5ce03a[_0x6326('0x48')]);return db[_0x6326('0x2d')][_0x6326('0x49')](_0x1d9d4c)['then'](handleEntityNotFound(_0x29f2fd,null))[_0x6326('0x25')](respondWithResult(_0x29f2fd,null))['catch'](handleError(_0x29f2fd,null));};exports['create']=function(_0x2bca12,_0x44cf9d){return db['WhatsappQueueReport'][_0x6326('0x4a')](_0x2bca12[_0x6326('0x4b')],{})[_0x6326('0x25')](respondWithResult(_0x44cf9d,0xc9))[_0x6326('0x4c')](handleError(_0x44cf9d,null));};exports[_0x6326('0x24')]=function(_0x4f8dc0,_0x4af0ee){if(_0x4f8dc0[_0x6326('0x4b')]['id']){delete _0x4f8dc0[_0x6326('0x4b')]['id'];}return db[_0x6326('0x2d')][_0x6326('0x49')]({'where':{'id':_0x4f8dc0[_0x6326('0x46')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x25')](saveUpdates(_0x4f8dc0['body'],null))[_0x6326('0x25')](respondWithResult(_0x4af0ee,null))[_0x6326('0x4c')](handleError(_0x4af0ee,null));};exports[_0x6326('0x26')]=function(_0x3e7674,_0x1b5e9a){return db['WhatsappQueueReport'][_0x6326('0x49')]({'where':{'id':_0x3e7674['params']['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x1b5e9a,null))[_0x6326('0x25')](removeEntity(_0x1b5e9a,null))['catch'](handleError(_0x1b5e9a,null));};exports[_0x6326('0x4d')]=function(_0x5040b1,_0xaa4c9d){return db[_0x6326('0x2d')][_0x6326('0x4d')]()[_0x6326('0x25')](respondWithResult(_0xaa4c9d,null))['catch'](handleError(_0xaa4c9d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f423a9c..738065e 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 _0xece3=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x30b3fa,_0x244b65){var _0x11d163=function(_0x41d15c){while(--_0x41d15c){_0x30b3fa['push'](_0x30b3fa['shift']());}};_0x11d163(++_0x244b65);}(_0xece3,0x139));var _0x3ece=function(_0x53c2b9,_0x1dbc82){_0x53c2b9=_0x53c2b9-0x0;var _0x2c677b=_0xece3[_0x53c2b9];return _0x2c677b;};'use strict';var _=require(_0x3ece('0x0'));var util=require(_0x3ece('0x1'));var logger=require(_0x3ece('0x2'))(_0x3ece('0x3'));var moment=require(_0x3ece('0x4'));var BPromise=require(_0x3ece('0x5'));var rp=require(_0x3ece('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ece('0x7'));var config=require(_0x3ece('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x3ece('0x9')]=function(_0x276a85,_0xdfff2b){return _0x276a85['define'](_0x3ece('0xa'),attributes,{'tableName':_0x3ece('0xb'),'paranoid':![],'indexes':[{'name':_0x3ece('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b4e=['./whatsappQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x2a2c3f,_0xbc7ac0){var _0x154fd3=function(_0xc6d215){while(--_0xc6d215){_0x2a2c3f['push'](_0x2a2c3f['shift']());}};_0x154fd3(++_0xbc7ac0);}(_0x4b4e,0x1d8));var _0xe4b4=function(_0x58bdb0,_0x3fd58a){_0x58bdb0=_0x58bdb0-0x0;var _0x2d77bc=_0x4b4e[_0x58bdb0];return _0x2d77bc;};'use strict';var _=require(_0xe4b4('0x0'));var util=require(_0xe4b4('0x1'));var logger=require(_0xe4b4('0x2'))(_0xe4b4('0x3'));var moment=require('moment');var BPromise=require(_0xe4b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4b4('0x5'));var rimraf=require(_0xe4b4('0x6'));var config=require(_0xe4b4('0x7'));var attributes=require(_0xe4b4('0x8'));module[_0xe4b4('0x9')]=function(_0x82c8a9,_0x22319d){return _0x82c8a9[_0xe4b4('0xa')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xe4b4('0xb'),'fields':[_0xe4b4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index c9265db..aebed4f 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 _0xd574=['WhatsappQueueReport','create','body','options','then','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1d01be,_0x107191){var _0x467fd8=function(_0x2325bf){while(--_0x2325bf){_0x1d01be['push'](_0x1d01be['shift']());}};_0x467fd8(++_0x107191);}(_0xd574,0xa8));var _0x4d57=function(_0x47c68e,_0x5ee8bc){_0x47c68e=_0x47c68e-0x0;var _0x514038=_0xd574[_0x47c68e];return _0x514038;};'use strict';var _=require(_0x4d57('0x0'));var util=require('util');var moment=require(_0x4d57('0x1'));var BPromise=require(_0x4d57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d57('0x3'));var db=require(_0x4d57('0x4'))['db'];var utils=require(_0x4d57('0x5'));var logger=require('../../config/logger')(_0x4d57('0x6'));var config=require(_0x4d57('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4df1e2,_0x2f0e92,_0x62e8d6){return new BPromise(function(_0x344c8e,_0x3e3b5d){return client['request'](_0x4df1e2,_0x62e8d6)['then'](function(_0x1d211d){logger[_0x4d57('0x9')](_0x4d57('0xa'),_0x2f0e92,_0x4d57('0xb'));logger[_0x4d57('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x2f0e92,_0x4d57('0xb'),JSON[_0x4d57('0xd')](_0x1d211d));if(_0x1d211d['error']){if(_0x1d211d[_0x4d57('0xe')][_0x4d57('0xf')]===0x1f4){logger[_0x4d57('0xe')](_0x4d57('0xa'),_0x2f0e92,_0x1d211d['error'][_0x4d57('0x10')]);return _0x3e3b5d(_0x1d211d[_0x4d57('0xe')][_0x4d57('0x10')]);}logger[_0x4d57('0xe')](_0x4d57('0xa'),_0x2f0e92,_0x1d211d['error'][_0x4d57('0x10')]);return _0x344c8e(_0x1d211d[_0x4d57('0xe')][_0x4d57('0x10')]);}else{logger[_0x4d57('0x9')](_0x4d57('0xa'),_0x2f0e92,_0x4d57('0xb'));_0x344c8e(_0x1d211d[_0x4d57('0x11')][_0x4d57('0x10')]);}})['catch'](function(_0x1af593){logger[_0x4d57('0xe')](_0x4d57('0xa'),_0x2f0e92,_0x1af593);_0x3e3b5d(_0x1af593);});});}exports['CreateWhatsappQueueReport']=function(_0x37bc9b){var _0x543fa9=this;return new Promise(function(_0x2775f5,_0x1b9e7d){return db[_0x4d57('0x12')][_0x4d57('0x13')](_0x37bc9b[_0x4d57('0x14')],{'raw':_0x37bc9b[_0x4d57('0x15')]?_0x37bc9b[_0x4d57('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x4d57('0x16')](function(_0x4b9f81){logger[_0x4d57('0x9')](_0x4d57('0x17'),_0x37bc9b);logger[_0x4d57('0xc')](_0x4d57('0x17'),_0x37bc9b,JSON[_0x4d57('0xd')](_0x4b9f81));_0x2775f5(_0x4b9f81);})[_0x4d57('0x18')](function(_0x38d335){logger[_0x4d57('0xe')](_0x4d57('0x17'),_0x38d335['message'],_0x37bc9b);_0x1b9e7d(_0x543fa9[_0x4d57('0xe')](0x1f4,_0x38d335['message']));});});};exports[_0x4d57('0x19')]=function(_0x1c97d1){var _0x424ece=this;return new Promise(function(_0x1e4d3c,_0x297f57){return db[_0x4d57('0x12')][_0x4d57('0x1a')](_0x1c97d1[_0x4d57('0x14')],{'raw':_0x1c97d1[_0x4d57('0x15')]?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c97d1[_0x4d57('0x15')]?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1c')]||null:null,'attributes':_0x1c97d1[_0x4d57('0x15')]?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1d')]||null:null,'limit':_0x1c97d1['options']?_0x1c97d1[_0x4d57('0x15')][_0x4d57('0x1e')]||null:null})['then'](function(_0x73f002){logger[_0x4d57('0x9')](_0x4d57('0x19'),_0x1c97d1);logger[_0x4d57('0xc')](_0x4d57('0x19'),_0x1c97d1,JSON[_0x4d57('0xd')](_0x73f002));_0x1e4d3c(_0x73f002);})[_0x4d57('0x18')](function(_0x2526ff){logger[_0x4d57('0xe')](_0x4d57('0x19'),_0x2526ff[_0x4d57('0x10')],_0x1c97d1);_0x297f57(_0x424ece[_0x4d57('0xe')](0x1f4,_0x2526ff[_0x4d57('0x10')]));});});}; \ No newline at end of file +var _0x4714=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateWhatsappQueueReport','body','options','stringify','UpdateWhatsappQueueReport','raw','where','limit','util','moment','bluebird'];(function(_0x115f70,_0x18a247){var _0x251562=function(_0x29adcf){while(--_0x29adcf){_0x115f70['push'](_0x115f70['shift']());}};_0x251562(++_0x18a247);}(_0x4714,0x183));var _0x4471=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4714[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x4471('0x0'));var moment=require(_0x4471('0x1'));var BPromise=require(_0x4471('0x2'));var rs=require(_0x4471('0x3'));var fs=require('fs');var Redis=require(_0x4471('0x4'));var db=require(_0x4471('0x5'))['db'];var utils=require(_0x4471('0x6'));var logger=require(_0x4471('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4471('0x8'));var client=jayson[_0x4471('0x9')][_0x4471('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3187bf,_0x5d081a,_0x864b73){return new BPromise(function(_0x4809d1,_0x9ba3e5){return client[_0x4471('0xb')](_0x3187bf,_0x864b73)[_0x4471('0xc')](function(_0x23fdc5){logger['info'](_0x4471('0xd'),_0x5d081a,_0x4471('0xe'));logger[_0x4471('0xf')](_0x4471('0x10'),_0x5d081a,_0x4471('0xe'),JSON['stringify'](_0x23fdc5));if(_0x23fdc5['error']){if(_0x23fdc5[_0x4471('0x11')]['code']===0x1f4){logger[_0x4471('0x11')](_0x4471('0xd'),_0x5d081a,_0x23fdc5['error'][_0x4471('0x12')]);return _0x9ba3e5(_0x23fdc5[_0x4471('0x11')]['message']);}logger[_0x4471('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5d081a,_0x23fdc5['error'][_0x4471('0x12')]);return _0x4809d1(_0x23fdc5['error'][_0x4471('0x12')]);}else{logger[_0x4471('0x13')](_0x4471('0xd'),_0x5d081a,'request\x20sent');_0x4809d1(_0x23fdc5[_0x4471('0x14')]['message']);}})[_0x4471('0x15')](function(_0x32c9e6){logger[_0x4471('0x11')](_0x4471('0xd'),_0x5d081a,_0x32c9e6);_0x9ba3e5(_0x32c9e6);});});}exports[_0x4471('0x16')]=function(_0x5236e8){var _0x1bfc07=this;return new Promise(function(_0xf156be,_0xcfaf37){return db['WhatsappQueueReport']['create'](_0x5236e8[_0x4471('0x17')],{'raw':_0x5236e8[_0x4471('0x18')]?_0x5236e8[_0x4471('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4471('0xc')](function(_0x32e5e5){logger[_0x4471('0x13')](_0x4471('0x16'),_0x5236e8);logger['debug']('CreateWhatsappQueueReport',_0x5236e8,JSON[_0x4471('0x19')](_0x32e5e5));_0xf156be(_0x32e5e5);})[_0x4471('0x15')](function(_0x143552){logger[_0x4471('0x11')](_0x4471('0x16'),_0x143552[_0x4471('0x12')],_0x5236e8);_0xcfaf37(_0x1bfc07[_0x4471('0x11')](0x1f4,_0x143552[_0x4471('0x12')]));});});};exports[_0x4471('0x1a')]=function(_0x295d51){var _0x586b02=this;return new Promise(function(_0x4fc82f,_0x44ec4a){return db['WhatsappQueueReport']['update'](_0x295d51[_0x4471('0x17')],{'raw':_0x295d51[_0x4471('0x18')]?_0x295d51[_0x4471('0x18')][_0x4471('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295d51['options']?_0x295d51[_0x4471('0x18')][_0x4471('0x1c')]||null:null,'attributes':_0x295d51['options']?_0x295d51['options']['attributes']||null:null,'limit':_0x295d51['options']?_0x295d51[_0x4471('0x18')][_0x4471('0x1d')]||null:null})[_0x4471('0xc')](function(_0x23611f){logger[_0x4471('0x13')]('UpdateWhatsappQueueReport',_0x295d51);logger['debug'](_0x4471('0x1a'),_0x295d51,JSON[_0x4471('0x19')](_0x23611f));_0x4fc82f(_0x23611f);})['catch'](function(_0x488da9){logger[_0x4471('0x11')](_0x4471('0x1a'),_0x488da9['message'],_0x295d51);_0x44ec4a(_0x586b02[_0x4471('0x11')](0x1f4,_0x488da9[_0x4471('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 3554482..2b19efc 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 _0x4a4a=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x415ed0,_0x11d08a){var _0xef7d0c=function(_0x502437){while(--_0x502437){_0x415ed0['push'](_0x415ed0['shift']());}};_0xef7d0c(++_0x11d08a);}(_0x4a4a,0x192));var _0xa4a4=function(_0xcc05fd,_0x391e26){_0xcc05fd=_0xcc05fd-0x0;var _0x4f4f71=_0x4a4a[_0xcc05fd];return _0x4f4f71;};'use strict';var multer=require('multer');var util=require(_0xa4a4('0x0'));var path=require('path');var timeout=require(_0xa4a4('0x1'));var express=require(_0xa4a4('0x2'));var router=express[_0xa4a4('0x3')]();var fs_extra=require(_0xa4a4('0x4'));var auth=require(_0xa4a4('0x5'));var interaction=require(_0xa4a4('0x6'));var config=require(_0xa4a4('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xa4a4('0x8')]('/',auth[_0xa4a4('0x9')](),controller[_0xa4a4('0xa')]);router[_0xa4a4('0x8')](_0xa4a4('0xb'),auth[_0xa4a4('0x9')](),controller[_0xa4a4('0xc')]);router[_0xa4a4('0x8')](_0xa4a4('0xd'),auth[_0xa4a4('0x9')](),controller[_0xa4a4('0xe')]);router[_0xa4a4('0xf')]('/',auth[_0xa4a4('0x9')](),controller[_0xa4a4('0x10')]);router[_0xa4a4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa4a4('0x12')]);router['delete'](_0xa4a4('0xd'),auth['isAuthenticated'](),controller[_0xa4a4('0x13')]);module[_0xa4a4('0x14')]=router; \ No newline at end of file +var _0x45f6=['get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','exports','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x3661da,_0x24153a){var _0xbccb74=function(_0x225583){while(--_0x225583){_0x3661da['push'](_0x3661da['shift']());}};_0xbccb74(++_0x24153a);}(_0x45f6,0x1c6));var _0x645f=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x45f6[_0x514c15];return _0x16283e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x645f('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x645f('0x1'));var interaction=require(_0x645f('0x2'));var config=require(_0x645f('0x3'));var controller=require(_0x645f('0x4'));router[_0x645f('0x5')]('/',auth[_0x645f('0x6')](),controller[_0x645f('0x7')]);router[_0x645f('0x5')](_0x645f('0x8'),auth[_0x645f('0x6')](),controller[_0x645f('0x9')]);router[_0x645f('0x5')](_0x645f('0xa'),auth[_0x645f('0x6')](),controller['show']);router[_0x645f('0xb')]('/',auth[_0x645f('0x6')](),controller[_0x645f('0xc')]);router['put']('/:id',auth[_0x645f('0x6')](),controller[_0x645f('0xd')]);router[_0x645f('0xe')](_0x645f('0xa'),auth[_0x645f('0x6')](),controller[_0x645f('0xf')]);module[_0x645f('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 1b3ca67..f7a25e4 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 _0x23db=['ENUM','account','agent','sequelize','exports','STRING'];(function(_0x5f35c5,_0x48949c){var _0x5e5d64=function(_0x3e968f){while(--_0x3e968f){_0x5f35c5['push'](_0x5f35c5['shift']());}};_0x5e5d64(++_0x48949c);}(_0x23db,0x141));var _0xb23d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x23db[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xb23d('0x0'));module[_0xb23d('0x1')]={'uniqueid':{'type':Sequelize[_0xb23d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb23d('0x3')](_0xb23d('0x4'),_0xb23d('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xa5c9=['exports','STRING','ENUM','queue','DATE','sequelize'];(function(_0x59b3b2,_0x1a4853){var _0x5d2e1c=function(_0x5e4366){while(--_0x5e4366){_0x59b3b2['push'](_0x59b3b2['shift']());}};_0x5d2e1c(++_0x1a4853);}(_0xa5c9,0x143));var _0x9a5c=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xa5c9[_0x2ca2d0];return _0x521c23;};'use strict';var Sequelize=require(_0x9a5c('0x0'));module[_0x9a5c('0x1')]={'uniqueid':{'type':Sequelize[_0x9a5c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9a5c('0x3')]('account','agent',_0x9a5c('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x9a5c('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a3a17e2..19dd630 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 _0x48b1=['rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport'];(function(_0xd87549,_0x5e443b){var _0x492872=function(_0x4f9cb3){while(--_0x4f9cb3){_0xd87549['push'](_0xd87549['shift']());}};_0x492872(++_0x5e443b);}(_0x48b1,0x197));var _0x148b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x148b('0x0'));var rp=require(_0x148b('0x1'));var moment=require(_0x148b('0x2'));var BPromise=require(_0x148b('0x3'));var Mustache=require(_0x148b('0x4'));var util=require(_0x148b('0x5'));var path=require(_0x148b('0x6'));var sox=require(_0x148b('0x7'));var csv=require(_0x148b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x148b('0x9'));var squel=require(_0x148b('0xa'));var crypto=require(_0x148b('0xb'));var jsforce=require(_0x148b('0xc'));var deskjs=require(_0x148b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x148b('0xe'));var Papa=require('papaparse');var Redis=require(_0x148b('0xf'));var authService=require(_0x148b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x148b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x148b('0x12'));var utils=require(_0x148b('0x13'));var config=require(_0x148b('0x14'));var licenseUtil=require(_0x148b('0x15'));var db=require(_0x148b('0x16'))['db'];function respondWithStatusCode(_0x4b6ecb,_0x43c99d){_0x43c99d=_0x43c99d||0xcc;return function(_0x1919ed){if(_0x1919ed){return _0x4b6ecb[_0x148b('0x17')](_0x43c99d);}return _0x4b6ecb[_0x148b('0x18')](_0x43c99d)[_0x148b('0x19')]();};}function respondWithResult(_0x48f12b,_0x3f9a4b){_0x3f9a4b=_0x3f9a4b||0xc8;return function(_0x1e59e9){if(_0x1e59e9){return _0x48f12b[_0x148b('0x18')](_0x3f9a4b)[_0x148b('0x1a')](_0x1e59e9);}};}function respondWithFilteredResult(_0x2ecaf2,_0x16c4b6){return function(_0x2b91d7){if(_0x2b91d7){var _0x3852c9=typeof _0x16c4b6[_0x148b('0x1b')]==='undefined'&&typeof _0x16c4b6[_0x148b('0x1c')]===_0x148b('0x1d');var _0x4c4d2d=_0x2b91d7[_0x148b('0x1e')];var _0x5b055d=_0x3852c9?0x0:_0x16c4b6['offset'];var _0x4f90ec=_0x3852c9?_0x2b91d7[_0x148b('0x1e')]:_0x16c4b6[_0x148b('0x1b')]+_0x16c4b6['limit'];var _0x1af1ce;if(_0x4f90ec>=_0x4c4d2d){_0x4f90ec=_0x4c4d2d;_0x1af1ce=0xc8;}else{_0x1af1ce=0xce;}_0x2ecaf2[_0x148b('0x18')](_0x1af1ce);return _0x2ecaf2['set']('Content-Range',_0x5b055d+'-'+_0x4f90ec+'/'+_0x4c4d2d)[_0x148b('0x1a')](_0x2b91d7);}return null;};}function patchUpdates(_0x1781f0){return function(_0x442cdc){try{jsonpatch[_0x148b('0x1f')](_0x442cdc,_0x1781f0,!![]);}catch(_0x312a95){return BPromise[_0x148b('0x20')](_0x312a95);}return _0x442cdc[_0x148b('0x21')]();};}function saveUpdates(_0x264d57,_0x49cd84){return function(_0x466dc0){if(_0x466dc0){return _0x466dc0['update'](_0x264d57)[_0x148b('0x22')](function(_0x34a602){return _0x34a602;});}return null;};}function removeEntity(_0x4b7f15,_0x3431a9){return function(_0x6594cf){if(_0x6594cf){return _0x6594cf[_0x148b('0x23')]()[_0x148b('0x22')](function(){_0x4b7f15[_0x148b('0x18')](0xcc)[_0x148b('0x19')]();});}};}function handleEntityNotFound(_0x4f559a,_0x31cf16){return function(_0x41aca4){if(!_0x41aca4){_0x4f559a[_0x148b('0x17')](0x194);}return _0x41aca4;};}function handleError(_0x7c2de7,_0x65b099){_0x65b099=_0x65b099||0x1f4;return function(_0x164604){logger[_0x148b('0x24')](_0x164604[_0x148b('0x25')]);if(_0x164604[_0x148b('0x26')]){delete _0x164604[_0x148b('0x26')];}_0x7c2de7['status'](_0x65b099)[_0x148b('0x27')](_0x164604);};}exports[_0x148b('0x28')]=function(_0x41b31b,_0x1c8dec){var _0x3fef40={},_0x1e9dc9={},_0x499280={'count':0x0,'rows':[]};var _0x1cb1ca=_[_0x148b('0x29')](db[_0x148b('0x2a')][_0x148b('0x2b')],function(_0xccac07){return{'name':_0xccac07[_0x148b('0x2c')],'type':_0xccac07[_0x148b('0x2d')]['key']};});_0x1e9dc9[_0x148b('0x2e')]=_[_0x148b('0x29')](_0x1cb1ca,'name');_0x1e9dc9[_0x148b('0x2f')]=_[_0x148b('0x30')](_0x41b31b['query']);_0x1e9dc9['filters']=_[_0x148b('0x31')](_0x1e9dc9['model'],_0x1e9dc9[_0x148b('0x2f')]);_0x3fef40['attributes']=_[_0x148b('0x31')](_0x1e9dc9[_0x148b('0x2e')],qs[_0x148b('0x32')](_0x41b31b[_0x148b('0x2f')][_0x148b('0x32')]));_0x3fef40[_0x148b('0x33')]=_0x3fef40[_0x148b('0x33')][_0x148b('0x34')]?_0x3fef40[_0x148b('0x33')]:_0x1e9dc9[_0x148b('0x2e')];if(!_0x41b31b['query'][_0x148b('0x35')](_0x148b('0x36'))){_0x3fef40[_0x148b('0x1c')]=qs[_0x148b('0x1c')](_0x41b31b[_0x148b('0x2f')][_0x148b('0x1c')]);_0x3fef40['offset']=qs[_0x148b('0x1b')](_0x41b31b['query'][_0x148b('0x1b')]);}_0x3fef40[_0x148b('0x37')]=qs['sort'](_0x41b31b[_0x148b('0x2f')][_0x148b('0x38')]);_0x3fef40[_0x148b('0x39')]=qs[_0x148b('0x3a')](_[_0x148b('0x3b')](_0x41b31b[_0x148b('0x2f')],_0x1e9dc9[_0x148b('0x3a')]),_0x1cb1ca);if(_0x41b31b[_0x148b('0x2f')][_0x148b('0x3c')]){_0x3fef40[_0x148b('0x39')]=_[_0x148b('0x3d')](_0x3fef40[_0x148b('0x39')],{'$or':_[_0x148b('0x29')](_0x1cb1ca,function(_0x30eed6){if(_0x30eed6[_0x148b('0x2d')]!==_0x148b('0x3e')){var _0x4094e4={};_0x4094e4[_0x30eed6[_0x148b('0x26')]]={'$like':'%'+_0x41b31b[_0x148b('0x2f')]['filter']+'%'};return _0x4094e4;}})});}_0x3fef40=_[_0x148b('0x3d')]({},_0x3fef40,_0x41b31b[_0x148b('0x3f')]);var _0x5a9c1f={'where':_0x3fef40['where']};return db[_0x148b('0x2a')][_0x148b('0x1e')](_0x5a9c1f)['then'](function(_0x3bb29e){_0x499280[_0x148b('0x1e')]=_0x3bb29e;if(_0x41b31b[_0x148b('0x2f')][_0x148b('0x40')]){_0x3fef40[_0x148b('0x41')]=[{'all':!![]}];}return db[_0x148b('0x2a')][_0x148b('0x42')](_0x3fef40);})['then'](function(_0x2be69e){_0x499280['rows']=_0x2be69e;return _0x499280;})[_0x148b('0x22')](respondWithFilteredResult(_0x1c8dec,_0x3fef40))[_0x148b('0x43')](handleError(_0x1c8dec,null));};exports[_0x148b('0x44')]=function(_0x373757,_0x187cc3){var _0x52e7c0={'raw':!![],'where':{'id':_0x373757[_0x148b('0x45')]['id']}},_0x1828f9={};_0x1828f9[_0x148b('0x2e')]=_[_0x148b('0x30')](db[_0x148b('0x2a')][_0x148b('0x2b')]);_0x1828f9[_0x148b('0x2f')]=_[_0x148b('0x30')](_0x373757[_0x148b('0x2f')]);_0x1828f9[_0x148b('0x3a')]=_['intersection'](_0x1828f9['model'],_0x1828f9['query']);_0x52e7c0[_0x148b('0x33')]=_[_0x148b('0x31')](_0x1828f9[_0x148b('0x2e')],qs[_0x148b('0x32')](_0x373757['query'][_0x148b('0x32')]));_0x52e7c0['attributes']=_0x52e7c0[_0x148b('0x33')][_0x148b('0x34')]?_0x52e7c0[_0x148b('0x33')]:_0x1828f9['model'];if(_0x373757[_0x148b('0x2f')][_0x148b('0x40')]){_0x52e7c0[_0x148b('0x41')]=[{'all':!![]}];}_0x52e7c0=_['merge']({},_0x52e7c0,_0x373757[_0x148b('0x3f')]);return db[_0x148b('0x2a')][_0x148b('0x46')](_0x52e7c0)[_0x148b('0x22')](handleEntityNotFound(_0x187cc3,null))[_0x148b('0x22')](respondWithResult(_0x187cc3,null))[_0x148b('0x43')](handleError(_0x187cc3,null));};exports['create']=function(_0x57dbb2,_0x38a06a){return db[_0x148b('0x2a')][_0x148b('0x47')](_0x57dbb2[_0x148b('0x48')],{})[_0x148b('0x22')](respondWithResult(_0x38a06a,0xc9))['catch'](handleError(_0x38a06a,null));};exports[_0x148b('0x49')]=function(_0x4373c4,_0x14ea52){if(_0x4373c4[_0x148b('0x48')]['id']){delete _0x4373c4[_0x148b('0x48')]['id'];}return db[_0x148b('0x2a')][_0x148b('0x46')]({'where':{'id':_0x4373c4[_0x148b('0x45')]['id']}})[_0x148b('0x22')](handleEntityNotFound(_0x14ea52,null))[_0x148b('0x22')](saveUpdates(_0x4373c4[_0x148b('0x48')],null))['then'](respondWithResult(_0x14ea52,null))[_0x148b('0x43')](handleError(_0x14ea52,null));};exports['destroy']=function(_0x2d38d3,_0x5910c0){return db[_0x148b('0x2a')][_0x148b('0x46')]({'where':{'id':_0x2d38d3['params']['id']}})['then'](handleEntityNotFound(_0x5910c0,null))['then'](removeEntity(_0x5910c0,null))['catch'](handleError(_0x5910c0,null));};exports[_0x148b('0x4a')]=function(_0x18c47a,_0x47cebe){return db[_0x148b('0x2a')][_0x148b('0x4a')]()[_0x148b('0x22')](respondWithResult(_0x47cebe,null))[_0x148b('0x43')](handleError(_0x47cebe,null));}; \ No newline at end of file +var _0x2de3=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring'];(function(_0x3838a4,_0x2ae1e6){var _0x3c56b4=function(_0x4cbf64){while(--_0x4cbf64){_0x3838a4['push'](_0x3838a4['shift']());}};_0x3c56b4(++_0x2ae1e6);}(_0x2de3,0x150));var _0x32de=function(_0x2235d9,_0x12d695){_0x2235d9=_0x2235d9-0x0;var _0x1b6a97=_0x2de3[_0x2235d9];return _0x1b6a97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32de('0x0'));var zipdir=require(_0x32de('0x1'));var jsonpatch=require(_0x32de('0x2'));var rp=require(_0x32de('0x3'));var moment=require(_0x32de('0x4'));var BPromise=require(_0x32de('0x5'));var Mustache=require(_0x32de('0x6'));var util=require('util');var path=require(_0x32de('0x7'));var sox=require(_0x32de('0x8'));var csv=require(_0x32de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32de('0xa'));var squel=require(_0x32de('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x32de('0xc'));var toCsv=require('to-csv');var querystring=require(_0x32de('0xd'));var Papa=require('papaparse');var Redis=require(_0x32de('0xe'));var authService=require(_0x32de('0xf'));var qs=require(_0x32de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32de('0x11'))(_0x32de('0x12'));var utils=require(_0x32de('0x13'));var config=require(_0x32de('0x14'));var licenseUtil=require(_0x32de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f2b4,_0x1c14f9){_0x1c14f9=_0x1c14f9||0xcc;return function(_0x408afa){if(_0x408afa){return _0x34f2b4[_0x32de('0x16')](_0x1c14f9);}return _0x34f2b4['status'](_0x1c14f9)['end']();};}function respondWithResult(_0x53fa3a,_0x86457a){_0x86457a=_0x86457a||0xc8;return function(_0x39df6b){if(_0x39df6b){return _0x53fa3a[_0x32de('0x17')](_0x86457a)[_0x32de('0x18')](_0x39df6b);}};}function respondWithFilteredResult(_0x31e0de,_0x5c868f){return function(_0x2e9233){if(_0x2e9233){var _0x9e2050=typeof _0x5c868f['offset']===_0x32de('0x19')&&typeof _0x5c868f[_0x32de('0x1a')]===_0x32de('0x19');var _0x539113=_0x2e9233[_0x32de('0x1b')];var _0x589b74=_0x9e2050?0x0:_0x5c868f[_0x32de('0x1c')];var _0x4be62e=_0x9e2050?_0x2e9233['count']:_0x5c868f['offset']+_0x5c868f[_0x32de('0x1a')];var _0x5665aa;if(_0x4be62e>=_0x539113){_0x4be62e=_0x539113;_0x5665aa=0xc8;}else{_0x5665aa=0xce;}_0x31e0de[_0x32de('0x17')](_0x5665aa);return _0x31e0de[_0x32de('0x1d')](_0x32de('0x1e'),_0x589b74+'-'+_0x4be62e+'/'+_0x539113)[_0x32de('0x18')](_0x2e9233);}return null;};}function patchUpdates(_0x2a8a9e){return function(_0x43724a){try{jsonpatch[_0x32de('0x1f')](_0x43724a,_0x2a8a9e,!![]);}catch(_0x58865a){return BPromise['reject'](_0x58865a);}return _0x43724a[_0x32de('0x20')]();};}function saveUpdates(_0x27104f,_0x27d589){return function(_0xf806c8){if(_0xf806c8){return _0xf806c8[_0x32de('0x21')](_0x27104f)[_0x32de('0x22')](function(_0x3b532d){return _0x3b532d;});}return null;};}function removeEntity(_0x557b56,_0x5b8c44){return function(_0x5a6339){if(_0x5a6339){return _0x5a6339[_0x32de('0x23')]()[_0x32de('0x22')](function(){_0x557b56[_0x32de('0x17')](0xcc)[_0x32de('0x24')]();});}};}function handleEntityNotFound(_0x22ed22,_0x437f1d){return function(_0x1df91d){if(!_0x1df91d){_0x22ed22['sendStatus'](0x194);}return _0x1df91d;};}function handleError(_0x1885aa,_0x3116a8){_0x3116a8=_0x3116a8||0x1f4;return function(_0x29d0ef){logger[_0x32de('0x25')](_0x29d0ef['stack']);if(_0x29d0ef[_0x32de('0x26')]){delete _0x29d0ef[_0x32de('0x26')];}_0x1885aa[_0x32de('0x17')](_0x3116a8)['send'](_0x29d0ef);};}exports[_0x32de('0x27')]=function(_0x125533,_0x8e1f84){var _0x55948b={},_0x3eac53={},_0x349d65={'count':0x0,'rows':[]};var _0x48cc58=_[_0x32de('0x28')](db[_0x32de('0x29')][_0x32de('0x2a')],function(_0x5a5a8d){return{'name':_0x5a5a8d[_0x32de('0x2b')],'type':_0x5a5a8d[_0x32de('0x2c')][_0x32de('0x2d')]};});_0x3eac53[_0x32de('0x2e')]=_[_0x32de('0x28')](_0x48cc58,_0x32de('0x26'));_0x3eac53[_0x32de('0x2f')]=_[_0x32de('0x30')](_0x125533['query']);_0x3eac53['filters']=_[_0x32de('0x31')](_0x3eac53[_0x32de('0x2e')],_0x3eac53[_0x32de('0x2f')]);_0x55948b[_0x32de('0x32')]=_['intersection'](_0x3eac53[_0x32de('0x2e')],qs[_0x32de('0x33')](_0x125533[_0x32de('0x2f')]['fields']));_0x55948b['attributes']=_0x55948b[_0x32de('0x32')][_0x32de('0x34')]?_0x55948b[_0x32de('0x32')]:_0x3eac53[_0x32de('0x2e')];if(!_0x125533[_0x32de('0x2f')]['hasOwnProperty'](_0x32de('0x35'))){_0x55948b[_0x32de('0x1a')]=qs[_0x32de('0x1a')](_0x125533[_0x32de('0x2f')][_0x32de('0x1a')]);_0x55948b[_0x32de('0x1c')]=qs[_0x32de('0x1c')](_0x125533[_0x32de('0x2f')][_0x32de('0x1c')]);}_0x55948b[_0x32de('0x36')]=qs[_0x32de('0x37')](_0x125533[_0x32de('0x2f')][_0x32de('0x37')]);_0x55948b[_0x32de('0x38')]=qs[_0x32de('0x39')](_['pick'](_0x125533[_0x32de('0x2f')],_0x3eac53[_0x32de('0x39')]),_0x48cc58);if(_0x125533['query'][_0x32de('0x3a')]){_0x55948b[_0x32de('0x38')]=_['merge'](_0x55948b[_0x32de('0x38')],{'$or':_['map'](_0x48cc58,function(_0x3f3093){if(_0x3f3093[_0x32de('0x2c')]!==_0x32de('0x3b')){var _0x46385d={};_0x46385d[_0x3f3093[_0x32de('0x26')]]={'$like':'%'+_0x125533[_0x32de('0x2f')]['filter']+'%'};return _0x46385d;}})});}_0x55948b=_[_0x32de('0x3c')]({},_0x55948b,_0x125533[_0x32de('0x3d')]);var _0x2a5699={'where':_0x55948b[_0x32de('0x38')]};return db[_0x32de('0x29')][_0x32de('0x1b')](_0x2a5699)[_0x32de('0x22')](function(_0x4173d8){_0x349d65[_0x32de('0x1b')]=_0x4173d8;if(_0x125533[_0x32de('0x2f')][_0x32de('0x3e')]){_0x55948b[_0x32de('0x3f')]=[{'all':!![]}];}return db[_0x32de('0x29')][_0x32de('0x40')](_0x55948b);})[_0x32de('0x22')](function(_0x36d0e2){_0x349d65[_0x32de('0x41')]=_0x36d0e2;return _0x349d65;})[_0x32de('0x22')](respondWithFilteredResult(_0x8e1f84,_0x55948b))[_0x32de('0x42')](handleError(_0x8e1f84,null));};exports['show']=function(_0x1e9ea1,_0x194825){var _0x11b5a4={'raw':!![],'where':{'id':_0x1e9ea1[_0x32de('0x43')]['id']}},_0x3ace34={};_0x3ace34[_0x32de('0x2e')]=_[_0x32de('0x30')](db['WhatsappTransferReport'][_0x32de('0x2a')]);_0x3ace34[_0x32de('0x2f')]=_['keys'](_0x1e9ea1['query']);_0x3ace34[_0x32de('0x39')]=_[_0x32de('0x31')](_0x3ace34['model'],_0x3ace34[_0x32de('0x2f')]);_0x11b5a4[_0x32de('0x32')]=_[_0x32de('0x31')](_0x3ace34[_0x32de('0x2e')],qs[_0x32de('0x33')](_0x1e9ea1[_0x32de('0x2f')]['fields']));_0x11b5a4[_0x32de('0x32')]=_0x11b5a4[_0x32de('0x32')][_0x32de('0x34')]?_0x11b5a4['attributes']:_0x3ace34[_0x32de('0x2e')];if(_0x1e9ea1[_0x32de('0x2f')][_0x32de('0x3e')]){_0x11b5a4[_0x32de('0x3f')]=[{'all':!![]}];}_0x11b5a4=_[_0x32de('0x3c')]({},_0x11b5a4,_0x1e9ea1[_0x32de('0x3d')]);return db['WhatsappTransferReport'][_0x32de('0x44')](_0x11b5a4)[_0x32de('0x22')](handleEntityNotFound(_0x194825,null))[_0x32de('0x22')](respondWithResult(_0x194825,null))['catch'](handleError(_0x194825,null));};exports['create']=function(_0x59deb4,_0x27b901){return db['WhatsappTransferReport']['create'](_0x59deb4['body'],{})[_0x32de('0x22')](respondWithResult(_0x27b901,0xc9))[_0x32de('0x42')](handleError(_0x27b901,null));};exports[_0x32de('0x21')]=function(_0x18d552,_0x432bc4){if(_0x18d552['body']['id']){delete _0x18d552['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x18d552[_0x32de('0x43')]['id']}})[_0x32de('0x22')](handleEntityNotFound(_0x432bc4,null))[_0x32de('0x22')](saveUpdates(_0x18d552['body'],null))['then'](respondWithResult(_0x432bc4,null))[_0x32de('0x42')](handleError(_0x432bc4,null));};exports[_0x32de('0x23')]=function(_0x2e8e14,_0x5ac094){return db[_0x32de('0x29')][_0x32de('0x44')]({'where':{'id':_0x2e8e14['params']['id']}})[_0x32de('0x22')](handleEntityNotFound(_0x5ac094,null))[_0x32de('0x22')](removeEntity(_0x5ac094,null))[_0x32de('0x42')](handleError(_0x5ac094,null));};exports[_0x32de('0x45')]=function(_0x15e420,_0x2d97c6){return db['WhatsappTransferReport']['describe']()[_0x32de('0x22')](respondWithResult(_0x2d97c6,null))[_0x32de('0x42')](handleError(_0x2d97c6,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d658932..156ed3a 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 _0x237a=['rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger','api','moment','bluebird','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x237a,0xb6));var _0xa237=function(_0xd6d8a,_0x9bc2b5){_0xd6d8a=_0xd6d8a-0x0;var _0x25c275=_0x237a[_0xd6d8a];return _0x25c275;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa237('0x0'))(_0xa237('0x1'));var moment=require(_0xa237('0x2'));var BPromise=require(_0xa237('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa237('0x4'));var rimraf=require(_0xa237('0x5'));var config=require('../../config/environment');var attributes=require(_0xa237('0x6'));module['exports']=function(_0x1220cd,_0x136c66){return _0x1220cd[_0xa237('0x7')](_0xa237('0x8'),attributes,{'tableName':_0xa237('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa237('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ddc=['WhatsappTransferReport','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3d65d0,_0x742683){var _0x391c00=function(_0x536c7d){while(--_0x536c7d){_0x3d65d0['push'](_0x3d65d0['shift']());}};_0x391c00(++_0x742683);}(_0x8ddc,0x152));var _0xc8dd=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x8ddc[_0x45346d];return _0x5ce7ca;};'use strict';var _=require(_0xc8dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc8dd('0x1'));var moment=require(_0xc8dd('0x2'));var BPromise=require(_0xc8dd('0x3'));var rp=require(_0xc8dd('0x4'));var fs=require('fs');var path=require(_0xc8dd('0x5'));var rimraf=require(_0xc8dd('0x6'));var config=require(_0xc8dd('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xc8dd('0x8')]=function(_0x5bf4ce,_0x556f6d){return _0x5bf4ce[_0xc8dd('0x9')](_0xc8dd('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xc8dd('0xb'),'fields':[_0xc8dd('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 9eaea94..9884d1f 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 _0x72a8=['code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x72a8,0x12b));var _0x872a=function(_0x26c5f9,_0x2df481){_0x26c5f9=_0x26c5f9-0x0;var _0x36d45e=_0x72a8[_0x26c5f9];return _0x36d45e;};'use strict';var _=require(_0x872a('0x0'));var util=require('util');var moment=require(_0x872a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x872a('0x2'));var db=require(_0x872a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x872a('0x4'))(_0x872a('0x5'));var config=require(_0x872a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x872a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d204,_0x2f5ad6,_0x363ce3){return new BPromise(function(_0x3a17b1,_0x487eed){return client[_0x872a('0x8')](_0x12d204,_0x363ce3)[_0x872a('0x9')](function(_0x432cde){logger[_0x872a('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2f5ad6,_0x872a('0xb'));logger[_0x872a('0xc')](_0x872a('0xd'),_0x2f5ad6,_0x872a('0xb'),JSON[_0x872a('0xe')](_0x432cde));if(_0x432cde[_0x872a('0xf')]){if(_0x432cde[_0x872a('0xf')][_0x872a('0x10')]===0x1f4){logger[_0x872a('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2f5ad6,_0x432cde['error'][_0x872a('0x11')]);return _0x487eed(_0x432cde[_0x872a('0xf')][_0x872a('0x11')]);}logger[_0x872a('0xf')](_0x872a('0x12'),_0x2f5ad6,_0x432cde[_0x872a('0xf')][_0x872a('0x11')]);return _0x3a17b1(_0x432cde['error'][_0x872a('0x11')]);}else{logger[_0x872a('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2f5ad6,'request\x20sent');_0x3a17b1(_0x432cde[_0x872a('0x13')][_0x872a('0x11')]);}})[_0x872a('0x14')](function(_0x5856f9){logger['error'](_0x872a('0x12'),_0x2f5ad6,_0x5856f9);_0x487eed(_0x5856f9);});});} \ No newline at end of file +var _0x5d08=['http','request','info','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x50dd0c,_0x23e831){var _0x111a82=function(_0x4b8911){while(--_0x4b8911){_0x50dd0c['push'](_0x50dd0c['shift']());}};_0x111a82(++_0x23e831);}(_0x5d08,0xd3));var _0x85d0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5d08[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x85d0('0x0'));var util=require('util');var moment=require(_0x85d0('0x1'));var BPromise=require(_0x85d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x85d0('0x4'));var logger=require(_0x85d0('0x5'))('rpc');var config=require(_0x85d0('0x6'));var jayson=require(_0x85d0('0x7'));var client=jayson[_0x85d0('0x8')][_0x85d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105bd4,_0x463a7a,_0x15cfd8){return new BPromise(function(_0x287a39,_0x4a8bc3){return client[_0x85d0('0xa')](_0x105bd4,_0x15cfd8)['then'](function(_0x3757f7){logger[_0x85d0('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x463a7a,_0x85d0('0xc'));logger['debug'](_0x85d0('0xd'),_0x463a7a,_0x85d0('0xc'),JSON[_0x85d0('0xe')](_0x3757f7));if(_0x3757f7['error']){if(_0x3757f7[_0x85d0('0xf')][_0x85d0('0x10')]===0x1f4){logger[_0x85d0('0xf')](_0x85d0('0x11'),_0x463a7a,_0x3757f7['error'][_0x85d0('0x12')]);return _0x4a8bc3(_0x3757f7['error'][_0x85d0('0x12')]);}logger[_0x85d0('0xf')](_0x85d0('0x11'),_0x463a7a,_0x3757f7[_0x85d0('0xf')][_0x85d0('0x12')]);return _0x287a39(_0x3757f7[_0x85d0('0xf')]['message']);}else{logger[_0x85d0('0xb')](_0x85d0('0x11'),_0x463a7a,_0x85d0('0xc'));_0x287a39(_0x3757f7[_0x85d0('0x13')]['message']);}})['catch'](function(_0x4e7b8b){logger[_0x85d0('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x463a7a,_0x4e7b8b);_0x4a8bc3(_0x4e7b8b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index acfc25d..d58c775 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8af4=['listen','then','start','info','Online\x20apps:','map','filter','online','name','Offline\x20apps:','status','join','None','seedDB','./config/seedDB','default','./config/license','error','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync'];(function(_0x1e4c41,_0x5dbebe){var _0x5240ac=function(_0x2d7642){while(--_0x2d7642){_0x1e4c41['push'](_0x1e4c41['shift']());}};_0x5240ac(++_0x5dbebe);}(_0x8af4,0xa8));var _0x48af=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x8af4[_0x283127];return _0x43da5d;};'use strict';var _=require(_0x48af('0x0'));var mysqldb=require(_0x48af('0x1'));var rpc=require(_0x48af('0x2'));var config=require(_0x48af('0x3'));var logger=require(_0x48af('0x4'))(_0x48af('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x48af('0x6'));var schedule=require(_0x48af('0x7'));var chat=require(_0x48af('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x48af('0x9'));function main(){return mysqldb['db'][_0x48af('0xa')][_0x48af('0xb')]()['then'](function(){return rpc[_0x48af('0xc')]();})[_0x48af('0xd')](function(_0x481075){logger['info'](_0x481075);return chat['start']();})[_0x48af('0xd')](function(){return whatsapp[_0x48af('0xe')]();})[_0x48af('0xd')](function(){return schedule[_0x48af('0xe')]();})[_0x48af('0xd')](function(){return transcribe['start']();})[_0x48af('0xd')](function(_0x1d0eb1){logger[_0x48af('0xf')](_0x1d0eb1);return pm2[_0x48af('0xe')](pm2Config);})[_0x48af('0xd')](function(_0x43ddfb){logger[_0x48af('0xf')](_0x48af('0x10'),_[_0x48af('0x11')](_[_0x48af('0x12')](_0x43ddfb,{'status':_0x48af('0x13')}),_0x48af('0x14'))['join']());logger[_0x48af('0xf')](_0x48af('0x15'),_[_0x48af('0x11')](_[_0x48af('0x12')](_0x43ddfb,function(_0x5a9288){return _0x5a9288[_0x48af('0x16')]!==_0x48af('0x13');}),_0x48af('0x14'))[_0x48af('0x17')]()||_0x48af('0x18'));config[_0x48af('0x19')]&&require(_0x48af('0x1a'))[_0x48af('0x1b')]();require(_0x48af('0x1c'))[_0x48af('0x1b')]();})['catch'](function(_0x41d6ba){logger[_0x48af('0x1d')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x41d6ba);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xa1a3=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','listen','then','info','start','Online\x20apps:','map','online','name','join','Offline\x20apps:','None','seedDB','./config/seedDB','default','./config/license','catch','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xa1a3,0x6a));var _0x3a1a=function(_0x5a2604,_0x5b11e1){_0x5a2604=_0x5a2604-0x0;var _0x19257e=_0xa1a3[_0x5a2604];return _0x19257e;};'use strict';var _=require(_0x3a1a('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x3a1a('0x1'));var config=require(_0x3a1a('0x2'));var logger=require(_0x3a1a('0x3'))(_0x3a1a('0x4'));var pm2=require(_0x3a1a('0x5'));var pm2Config=require(_0x3a1a('0x6'));var schedule=require(_0x3a1a('0x7'));var chat=require(_0x3a1a('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x3a1a('0x9'));function main(){return mysqldb['db'][_0x3a1a('0xa')][_0x3a1a('0xb')]()['then'](function(){return rpc[_0x3a1a('0xc')]();})[_0x3a1a('0xd')](function(_0x273d87){logger[_0x3a1a('0xe')](_0x273d87);return chat[_0x3a1a('0xf')]();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x3a1a('0xf')]();})[_0x3a1a('0xd')](function(){return transcribe[_0x3a1a('0xf')]();})[_0x3a1a('0xd')](function(_0x7b0c97){logger[_0x3a1a('0xe')](_0x7b0c97);return pm2[_0x3a1a('0xf')](pm2Config);})[_0x3a1a('0xd')](function(_0x5a00dc){logger[_0x3a1a('0xe')](_0x3a1a('0x10'),_[_0x3a1a('0x11')](_['filter'](_0x5a00dc,{'status':_0x3a1a('0x12')}),_0x3a1a('0x13'))[_0x3a1a('0x14')]());logger[_0x3a1a('0xe')](_0x3a1a('0x15'),_[_0x3a1a('0x11')](_['filter'](_0x5a00dc,function(_0x38adf0){return _0x38adf0['status']!=='online';}),_0x3a1a('0x13'))['join']()||_0x3a1a('0x16'));config[_0x3a1a('0x17')]&&require(_0x3a1a('0x18'))[_0x3a1a('0x19')]();require(_0x3a1a('0x1a'))[_0x3a1a('0x19')]();})[_0x3a1a('0x1b')](function(_0x3aa1e6){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3aa1e6);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 366191e..134de87 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 _0x5cf3=['disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','startsWith','Basic','User','find','name','pass','status','Wrong\x20credentials.','Bearer','query','apikey','getUuid','Setting','allowedLoginAttempts','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','Unknown\x20authorization\x20format','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','webrtc','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','apiKeyNonce','regenerateApiKey','test','Sequelize','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','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','params','closed'];(function(_0x2a3bde,_0x3f15b3){var _0x46f677=function(_0x5f0726){while(--_0x5f0726){_0x2a3bde['push'](_0x2a3bde['shift']());}};_0x46f677(++_0x3f15b3);}(_0x5cf3,0x1cc));var _0x35cf=function(_0x40c62b,_0x2c2efe){_0x40c62b=_0x40c62b-0x0;var _0x568cf0=_0x5cf3[_0x40c62b];return _0x568cf0;};'use strict';var db=require(_0x35cf('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x35cf('0x1'));var licenseUtil=require(_0x35cf('0x2'));var encryptor=require(_0x35cf('0x3'));var _=require('lodash');var jwt=require(_0x35cf('0x4'));var expressJwt=require(_0x35cf('0x5'));var compose=require(_0x35cf('0x6'));var basicAuth=require(_0x35cf('0x7'));var crypto=require(_0x35cf('0x8'));var BPromise=require(_0x35cf('0x9'));var util=require(_0x35cf('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x35cf('0xb')][_0x35cf('0xc')]});var userAttributes=['id',_0x35cf('0xd'),_0x35cf('0xe'),'name',_0x35cf('0xf'),_0x35cf('0x10'),_0x35cf('0x11'),'permissions',_0x35cf('0x12'),_0x35cf('0x13'),_0x35cf('0x14'),_0x35cf('0x15'),_0x35cf('0x16'),_0x35cf('0x17'),_0x35cf('0x18'),'pauseType',_0x35cf('0x19'),'lastLoginAt',_0x35cf('0x1a'),_0x35cf('0x1b'),_0x35cf('0x1c'),'passwordResetAt',_0x35cf('0x1d'),_0x35cf('0x1e'),'phoneBarAutoAnswerDelay',_0x35cf('0x1f'),_0x35cf('0x20'),_0x35cf('0x21'),_0x35cf('0x22'),_0x35cf('0x23'),_0x35cf('0x24'),_0x35cf('0x25'),_0x35cf('0x26'),_0x35cf('0x27'),_0x35cf('0x28'),_0x35cf('0x29'),_0x35cf('0x2a'),_0x35cf('0x2b'),_0x35cf('0x2c'),_0x35cf('0x2d'),'downloadOmnichannelInteractions','downloadAttachments',_0x35cf('0x2e'),_0x35cf('0x2f')];exports[_0x35cf('0x30')]=function(){return this['isAuthenticated'](!![])[_0x35cf('0x31')](function(_0x47f332,_0x59bcb7,_0x4d59c4){if(_0x47f332['user']){_0x4d59c4();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x47f332[_0x35cf('0x32')]['id']},'attributes':['id',_0x35cf('0x33'),_0x35cf('0x34')],'raw':!![]})[_0x35cf('0x35')](function(_0x2a0b15){if(_0x2a0b15&&_0x2a0b15[_0x35cf('0x33')]){return _0x59bcb7['status'](_0x2a0b15[_0x35cf('0x34')]===_0x35cf('0x36')?0x195:0x193)[_0x35cf('0x37')]({'message':_0x2a0b15[_0x35cf('0x34')]==='unmanaged'?_0x35cf('0x38'):_0x35cf('0x39')});}else{_0x4d59c4();}})[_0x35cf('0x3a')](function(_0x403abf){_0x4d59c4(_0x403abf);});}});};exports[_0x35cf('0x3b')]=function isAuthenticated(_0x4c8717){return compose()[_0x35cf('0x31')](function(_0x934e7,_0x4cf1c9,_0x38887b){var _0x5e34a1;if(_0x934e7[_0x35cf('0x3c')]['authorization']){if(_[_0x35cf('0x3d')](_0x934e7[_0x35cf('0x3c')]['authorization'],_0x35cf('0x3e'))){var _0x29cda8=basicAuth(_0x934e7);db[_0x35cf('0x3f')][_0x35cf('0x40')]({'where':{'name':_0x29cda8[_0x35cf('0x41')]}})[_0x35cf('0x35')](function(_0x376ad4){if(!_0x376ad4||!_0x376ad4['authenticate'](_0x29cda8[_0x35cf('0x42')])){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x44')});}_0x934e7['user']={'id':_0x376ad4['id']};_0x38887b();})[_0x35cf('0x3a')](function(_0x5a51a3){_0x38887b(_0x5a51a3);});}else if(_[_0x35cf('0x3d')](_0x934e7['headers']['authorization'],_0x35cf('0x45'))){validateJwt(_0x934e7,_0x4cf1c9,_0x38887b);}else{if(_0x4c8717){_0x38887b();}else{return _0x4cf1c9['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x934e7[_0x35cf('0x46')][_0x35cf('0x47')]){try{var _0x5269a9={'audience':hardwareConf[_0x35cf('0x48')](),'issuer':hardwareConf[_0x35cf('0x48')]()};verifyJwt(_0x934e7[_0x35cf('0x46')][_0x35cf('0x47')],_0x5269a9)[_0x35cf('0x35')](function(_0xd03cc8){return db[_0x35cf('0x3f')][_0x35cf('0x40')]({'where':{'id':_0xd03cc8['sub']}})[_0x35cf('0x35')](function(_0x53f896){_0x5e34a1=_0x53f896;return db[_0x35cf('0x49')]['findOne']({'where':{'id':0x1},'attributes':[_0x35cf('0x4a'),'blockDuration'],'raw':!![]});})[_0x35cf('0x35')](function(_0x5c96bb){if(!_0x5e34a1||!_['isEqual'](_0x5e34a1['apiKeyNonce'],_0xd03cc8['nonce'])){return _0x4cf1c9['status'](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x4b')});}if(_0x5e34a1[_0x35cf('0x4c')]){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x4d')});}if(_0x5e34a1[_0x35cf('0x4e')]){if(_0x5c96bb[_0x35cf('0x4f')]>0x0){if(moment(_0x5e34a1[_0x35cf('0x50')])[_0x35cf('0x51')](_0x5c96bb[_0x35cf('0x4f')],_0x35cf('0x52'))>moment()){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':_0x35cf('0x4d')});}}else{return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x934e7['user']={'id':_0x5e34a1['id']};_0x38887b();});})[_0x35cf('0x3a')](function(){return _0x4cf1c9[_0x35cf('0x43')](0x191)[_0x35cf('0x37')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1010ee){_0x38887b(_0x1010ee);}}else if(_0x4c8717){_0x38887b();}else{return _0x4cf1c9[_0x35cf('0x43')](0x193)[_0x35cf('0x37')]({'message':_0x35cf('0x53')});}})['use'](function(_0x188d83,_0x2b476e,_0x47b8f){if(_0x188d83[_0x35cf('0x54')]){db[_0x35cf('0x3f')][_0x35cf('0x40')]({'where':{'id':_0x188d83[_0x35cf('0x54')]['id']},'attributes':userAttributes})['then'](function(_0x91bd54){if(!_0x91bd54){return _0x2b476e['status'](0x194)['json']({'message':_0x35cf('0x55')});}_0x188d83[_0x35cf('0x54')]=_0x91bd54;_0x47b8f();})[_0x35cf('0x3a')](function(_0x3b729e){_0x47b8f(_0x3b729e);});}else if(_0x4c8717){_0x47b8f();}else{return _0x2b476e[_0x35cf('0x43')](0x194)[_0x35cf('0x37')]({'message':_0x35cf('0x56')});}});};exports[_0x35cf('0x57')]=function canUpdate(){return compose()[_0x35cf('0x31')](function(_0x440ec2,_0x40c9b4,_0x433274){return licenseUtil[_0x35cf('0x58')]()[_0x35cf('0x35')](function(_0x4d88a8){if(_0x4d88a8['update']){_0x433274();}else{return _0x40c9b4[_0x35cf('0x43')](0x193)[_0x35cf('0x37')]({'message':_0x35cf('0x59')});}})[_0x35cf('0x3a')](function(_0x2ff72d){_0x433274(_0x2ff72d);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x35cf('0x31')](function(_0x3bf4b2,_0x57f33d,_0x31425c){return licenseUtil[_0x35cf('0x58')]()[_0x35cf('0x35')](function(_0x593c87){if(_0x593c87[_0x35cf('0x5a')]){_0x31425c();}else{return _0x57f33d[_0x35cf('0x43')](0x193)[_0x35cf('0x37')]({'message':_0x35cf('0x59')});}})[_0x35cf('0x3a')](function(_0x16b969){_0x31425c(_0x16b969);});});};exports[_0x35cf('0x5b')]=function(_0x2f213a,_0x1e888b,_0x559066){_0x2f213a[_0x35cf('0x5b')]=!![];return _0x559066();};exports[_0x35cf('0x5c')]=function signToken(_0x1f91d4){return signJwt(_0x1f91d4);};exports['setTokenCookie']=function(_0x347d11,_0x5bdf4f){if(!_0x347d11[_0x35cf('0x54')]){return _0x5bdf4f['status'](0x194)[_0x35cf('0x37')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x58d41f={'payload':{'id':_0x347d11[_0x35cf('0x54')]['id'],'role':_0x347d11[_0x35cf('0x54')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x58d41f)[_0x35cf('0x35')](function(_0x3a4de2){_0x5bdf4f[_0x35cf('0x5d')](_0x35cf('0x5e'),_0x3a4de2);_0x5bdf4f[_0x35cf('0x5f')](_0x35cf('0x60'));})[_0x35cf('0x3a')](function(_0x1669e6){return _0x5bdf4f[_0x35cf('0x43')](0x1f4)[_0x35cf('0x61')](_0x1669e6);});};exports[_0x35cf('0x62')]=function(_0x324422){if(_[_0x35cf('0x63')](_0x324422['apiKeyNonce'])||_[_0x35cf('0x63')](_0x324422[_0x35cf('0x64')])){return null;}else{return createJwt(_0x324422);}};exports['generateApiKey']=function(_0x33fdf4){_0x33fdf4[_0x35cf('0x65')]=generateNonce();_0x33fdf4[_0x35cf('0x64')]=generateIssuedAt();return createJwt(_0x33fdf4);};exports[_0x35cf('0x66')]=function(_0x28748b,_0x17f930){var _0x40bdaa=_0x28748b[_0x35cf('0x46')]['apikey'];if(_0x40bdaa){var _0x4d0e4c={'nonce':_0x17f930[_0x35cf('0x65')],'iat':_0x17f930[_0x35cf('0x64')],'audience':hardwareConf[_0x35cf('0x48')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x40bdaa,_0x4d0e4c)['then'](function(){return generateApiKey(_0x17f930);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x55b38d){var _0x163239=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x163239[_0x35cf('0x67')](_0x55b38d))throw new db[(_0x35cf('0x68'))]['ValidationError'](_0x35cf('0x69'));return;};exports[_0x35cf('0x6a')]=function(_0x2a3e99,_0x569e70,_0x500d9d){var _0x1efb96=encryptor['decryptString'](_0x569e70)[_0x35cf('0x6b')](',');for(var _0x54efa6=0x0;_0x54efa6<_0x500d9d;_0x54efa6++){if(!_0x1efb96[_0x54efa6])break;if(_0x2a3e99[_0x35cf('0x6c')]()===_0x1efb96[_0x54efa6][_0x35cf('0x6c')]()){var _0x53fbcb=util[_0x35cf('0x6d')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x500d9d);if(_0x500d9d===0x1){_0x53fbcb=_0x35cf('0x6e');}throw new db[(_0x35cf('0x68'))]['ValidationError'](_0x53fbcb);}}return;};exports[_0x35cf('0x6f')]=function(_0x3310bb,_0x4653ec){var _0x39f1be=_0x4653ec?encryptor[_0x35cf('0x70')](_0x4653ec)[_0x35cf('0x6b')](','):[];if(_0x39f1be[_0x35cf('0x71')]===0x5){_0x39f1be['splice'](-0x1,0x1);}_0x39f1be[_0x35cf('0x72')](_0x3310bb);return encryptor[_0x35cf('0x73')](_0x39f1be[_0x35cf('0x74')](','));};function signJwt(_0x588bc7){var _0x1bd194=BPromise[_0x35cf('0x75')](jwt[_0x35cf('0x76')],{'context':jwt});var _0x47b0fc=_0x588bc7[_0x35cf('0x77')]||config[_0x35cf('0xb')][_0x35cf('0xc')];return new BPromise(function(_0x30a620,_0x440361){_0x1bd194(_0x588bc7[_0x35cf('0x78')],_0x47b0fc,_0x588bc7[_0x35cf('0x79')])[_0x35cf('0x35')](function(_0x1472c1){_0x30a620(_0x1472c1);})[_0x35cf('0x3a')](function(_0x5c0979){_0x440361(_0x5c0979);});});}function verifyJwt(_0x2a0aa7,_0xf1bd58,_0xf6afc8){var _0x23732d=BPromise[_0x35cf('0x75')](jwt[_0x35cf('0x7a')],{'context':jwt});var _0x58ee36=_0xf6afc8||config[_0x35cf('0xb')][_0x35cf('0xc')];return new BPromise(function(_0xee7cf7,_0x295c58){_0x23732d(_0x2a0aa7,_0x58ee36,_0xf1bd58)[_0x35cf('0x35')](function(_0x3e5e11){_0xee7cf7(_0x3e5e11);})[_0x35cf('0x3a')](function(_0x31045f){_0x295c58(_0x31045f);});});}function generateNonce(){return crypto[_0x35cf('0x7b')](0x10)['toString'](_0x35cf('0x7c'));}function generateIssuedAt(){return Math[_0x35cf('0x7d')](Date[_0x35cf('0x7e')]()/0x3e8)[_0x35cf('0x7f')]();}function createJwt(_0xd5bac){var _0x519d00={'payload':{'iat':_0xd5bac[_0x35cf('0x64')],'nonce':_0xd5bac['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0xd5bac['id'][_0x35cf('0x7f')](),'issuer':hardwareConf[_0x35cf('0x48')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x519d00)[_0x35cf('0x35')](function(_0xc84a7a){return{'iat':_0xd5bac['apiKeyIat'],'nonce':_0xd5bac['apiKeyNonce'],'token':_0xc84a7a};});} \ No newline at end of file +var _0x4fb9=['phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','ChatInteraction','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','find','then','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','sub','Setting','findOne','allowedLoginAttempts','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','blockDuration','Invalid\x20API\x20access\x20key','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','promisify','sign','secret','secrets','payload','options','verify','randomBytes','toString','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','composable-middleware','basic-auth','bluebird','util','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarEnableRecording','phoneBarEnableSettings'];(function(_0x518374,_0x2d5ed6){var _0x28b0c7=function(_0x3b63f1){while(--_0x3b63f1){_0x518374['push'](_0x518374['shift']());}};_0x28b0c7(++_0x2d5ed6);}(_0x4fb9,0xd2));var _0x94fb=function(_0x214143,_0x478a75){_0x214143=_0x214143-0x0;var _0x3cc1e9=_0x4fb9[_0x214143];return _0x3cc1e9;};'use strict';var db=require(_0x94fb('0x0'))['db'];var config=require(_0x94fb('0x1'));var hardwareConf=require(_0x94fb('0x2'));var licenseUtil=require(_0x94fb('0x3'));var encryptor=require(_0x94fb('0x4'));var _=require(_0x94fb('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0x94fb('0x6'));var basicAuth=require(_0x94fb('0x7'));var crypto=require('crypto');var BPromise=require(_0x94fb('0x8'));var util=require(_0x94fb('0x9'));var moment=require(_0x94fb('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0x94fb('0xb')]});var userAttributes=['id',_0x94fb('0xc'),_0x94fb('0xd'),_0x94fb('0xe'),_0x94fb('0xf'),_0x94fb('0x10'),_0x94fb('0x11'),_0x94fb('0x12'),_0x94fb('0x13'),'voicePause','chatPause','mailPause',_0x94fb('0x14'),'smsPause',_0x94fb('0x15'),_0x94fb('0x16'),_0x94fb('0x17'),_0x94fb('0x18'),_0x94fb('0x19'),_0x94fb('0x1a'),_0x94fb('0x1b'),_0x94fb('0x1c'),_0x94fb('0x1d'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd',_0x94fb('0x1e'),'phoneBarEnableDtmfTone',_0x94fb('0x1f'),'phoneBarExpires',_0x94fb('0x20'),_0x94fb('0x21'),_0x94fb('0x22'),'hotdesk',_0x94fb('0x23'),'userProfileId','privacyEnabled','settingsEnabled',_0x94fb('0x24'),_0x94fb('0x25'),_0x94fb('0x26'),_0x94fb('0x27'),_0x94fb('0x28'),_0x94fb('0x29')];exports[_0x94fb('0x2a')]=function(){return this['isAuthenticated'](!![])[_0x94fb('0x2b')](function(_0x12d589,_0x29a5d9,_0x4f54c5){if(_0x12d589['user']){_0x4f54c5();}else{return db[_0x94fb('0x2c')]['findOne']({'where':{'id':_0x12d589['params']['id']},'attributes':['id',_0x94fb('0x2d'),_0x94fb('0x2e')],'raw':!![]})['then'](function(_0x2cc943){if(_0x2cc943&&_0x2cc943[_0x94fb('0x2d')]){return _0x29a5d9[_0x94fb('0x2f')](_0x2cc943[_0x94fb('0x2e')]===_0x94fb('0x30')?0x195:0x193)[_0x94fb('0x31')]({'message':_0x2cc943['disposition']==='unmanaged'?_0x94fb('0x32'):_0x94fb('0x33')});}else{_0x4f54c5();}})[_0x94fb('0x34')](function(_0xc01a98){_0x4f54c5(_0xc01a98);});}});};exports[_0x94fb('0x35')]=function isAuthenticated(_0x13c27a){return compose()[_0x94fb('0x2b')](function(_0x5b4b81,_0x5b292d,_0x40c394){var _0x18ddee;if(_0x5b4b81[_0x94fb('0x36')][_0x94fb('0x37')]){if(_[_0x94fb('0x38')](_0x5b4b81[_0x94fb('0x36')][_0x94fb('0x37')],_0x94fb('0x39'))){var _0x407717=basicAuth(_0x5b4b81);db[_0x94fb('0x3a')][_0x94fb('0x3b')]({'where':{'name':_0x407717[_0x94fb('0xe')]}})[_0x94fb('0x3c')](function(_0x36f89b){if(!_0x36f89b||!_0x36f89b[_0x94fb('0x3d')](_0x407717['pass'])){return _0x5b292d[_0x94fb('0x2f')](0x191)[_0x94fb('0x31')]({'message':_0x94fb('0x3e')});}_0x5b4b81['user']={'id':_0x36f89b['id']};_0x40c394();})[_0x94fb('0x34')](function(_0x3c3c2e){_0x40c394(_0x3c3c2e);});}else if(_[_0x94fb('0x38')](_0x5b4b81[_0x94fb('0x36')]['authorization'],_0x94fb('0x3f'))){validateJwt(_0x5b4b81,_0x5b292d,_0x40c394);}else{if(_0x13c27a){_0x40c394();}else{return _0x5b292d[_0x94fb('0x2f')](0x193)['json']({'message':_0x94fb('0x40')});}}}else if(_0x5b4b81['query']['apikey']){try{var _0x41f539={'audience':hardwareConf[_0x94fb('0x41')](),'issuer':hardwareConf[_0x94fb('0x41')]()};verifyJwt(_0x5b4b81[_0x94fb('0x42')][_0x94fb('0x43')],_0x41f539)[_0x94fb('0x3c')](function(_0x1639d7){return db[_0x94fb('0x3a')][_0x94fb('0x3b')]({'where':{'id':_0x1639d7[_0x94fb('0x44')]}})[_0x94fb('0x3c')](function(_0x136081){_0x18ddee=_0x136081;return db[_0x94fb('0x45')][_0x94fb('0x46')]({'where':{'id':0x1},'attributes':[_0x94fb('0x47'),'blockDuration'],'raw':!![]});})[_0x94fb('0x3c')](function(_0x2a608b){if(!_0x18ddee||!_['isEqual'](_0x18ddee[_0x94fb('0x48')],_0x1639d7['nonce'])){return _0x5b292d[_0x94fb('0x2f')](0x191)[_0x94fb('0x31')]({'message':_0x94fb('0x49')});}if(_0x18ddee[_0x94fb('0x4a')]){return _0x5b292d['status'](0x191)[_0x94fb('0x31')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x18ddee[_0x94fb('0x4b')]){if(_0x2a608b['blockDuration']>0x0){if(moment(_0x18ddee[_0x94fb('0x4c')])[_0x94fb('0x4d')](_0x2a608b[_0x94fb('0x4e')],'minutes')>moment()){return _0x5b292d[_0x94fb('0x2f')](0x191)[_0x94fb('0x31')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5b292d[_0x94fb('0x2f')](0x191)[_0x94fb('0x31')]({'message':_0x94fb('0x4f')});}}_0x5b4b81[_0x94fb('0x50')]={'id':_0x18ddee['id']};_0x40c394();});})[_0x94fb('0x34')](function(){return _0x5b292d['status'](0x191)[_0x94fb('0x31')]({'message':_0x94fb('0x4f')});});}catch(_0x2ff027){_0x40c394(_0x2ff027);}}else if(_0x13c27a){_0x40c394();}else{return _0x5b292d['status'](0x193)[_0x94fb('0x31')]({'message':_0x94fb('0x40')});}})[_0x94fb('0x2b')](function(_0x205c09,_0x15af35,_0x38f4de){if(_0x205c09[_0x94fb('0x50')]){db[_0x94fb('0x3a')][_0x94fb('0x3b')]({'where':{'id':_0x205c09[_0x94fb('0x50')]['id']},'attributes':userAttributes})[_0x94fb('0x3c')](function(_0x5588ea){if(!_0x5588ea){return _0x15af35[_0x94fb('0x2f')](0x194)[_0x94fb('0x31')]({'message':_0x94fb('0x51')});}_0x205c09[_0x94fb('0x50')]=_0x5588ea;_0x38f4de();})['catch'](function(_0x9f8851){_0x38f4de(_0x9f8851);});}else if(_0x13c27a){_0x38f4de();}else{return _0x15af35[_0x94fb('0x2f')](0x194)[_0x94fb('0x31')]({'message':_0x94fb('0x52')});}});};exports[_0x94fb('0x53')]=function canUpdate(){return compose()[_0x94fb('0x2b')](function(_0x3938fb,_0x39f081,_0x240a86){return licenseUtil[_0x94fb('0x54')]()[_0x94fb('0x3c')](function(_0x22dcaa){if(_0x22dcaa['update']){_0x240a86();}else{return _0x39f081[_0x94fb('0x2f')](0x193)[_0x94fb('0x31')]({'message':_0x94fb('0x55')});}})['catch'](function(_0xddc447){_0x240a86(_0xddc447);});});};exports[_0x94fb('0x56')]=function isWebrtcLicence(){return compose()['use'](function(_0x1e47f2,_0x47a4e5,_0x509331){return licenseUtil[_0x94fb('0x54')]()[_0x94fb('0x3c')](function(_0x32964b){if(_0x32964b['webrtc']){_0x509331();}else{return _0x47a4e5['status'](0x193)[_0x94fb('0x31')]({'message':_0x94fb('0x55')});}})[_0x94fb('0x34')](function(_0x54e0b3){_0x509331(_0x54e0b3);});});};exports[_0x94fb('0x57')]=function(_0x4100c2,_0x397b85,_0x4b30b0){_0x4100c2[_0x94fb('0x57')]=!![];return _0x4b30b0();};exports['signToken']=function signToken(_0x1b92db){return signJwt(_0x1b92db);};exports['setTokenCookie']=function(_0x23d057,_0x477725){if(!_0x23d057[_0x94fb('0x50')]){return _0x477725['status'](0x194)[_0x94fb('0x31')]({'message':_0x94fb('0x58')});}var _0x1389f0={'payload':{'id':_0x23d057['user']['id'],'role':_0x23d057[_0x94fb('0x50')][_0x94fb('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1389f0)[_0x94fb('0x3c')](function(_0x29529e){_0x477725[_0x94fb('0x59')]('motion.token',_0x29529e);_0x477725[_0x94fb('0x5a')](_0x94fb('0x5b'));})[_0x94fb('0x34')](function(_0x3d88ee){return _0x477725[_0x94fb('0x2f')](0x1f4)['send'](_0x3d88ee);});};exports[_0x94fb('0x5c')]=function(_0x58376e){if(_[_0x94fb('0x5d')](_0x58376e[_0x94fb('0x48')])||_[_0x94fb('0x5d')](_0x58376e[_0x94fb('0x5e')])){return null;}else{return createJwt(_0x58376e);}};exports[_0x94fb('0x5f')]=function(_0x561b49){_0x561b49['apiKeyNonce']=generateNonce();_0x561b49[_0x94fb('0x5e')]=generateIssuedAt();return createJwt(_0x561b49);};exports[_0x94fb('0x60')]=function(_0x4af9e1,_0x331a57){var _0x4a1a24=_0x4af9e1[_0x94fb('0x42')]['apikey'];if(_0x4a1a24){var _0xcba94a={'nonce':_0x331a57[_0x94fb('0x48')],'iat':_0x331a57[_0x94fb('0x5e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x94fb('0x41')]()};return verifyJwt(_0x4a1a24,_0xcba94a)['then'](function(){return generateApiKey(_0x331a57);});}else{throw{'message':_0x94fb('0x61')};}};exports[_0x94fb('0x62')]=function(_0x2f1037){var _0x16e7ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x16e7ab[_0x94fb('0x63')](_0x2f1037))throw new db[(_0x94fb('0x64'))]['ValidationError'](_0x94fb('0x65'));return;};exports['validatePasswordHistory']=function(_0x104b8c,_0x4ef85e,_0x5844db){var _0x43e322=encryptor[_0x94fb('0x66')](_0x4ef85e)[_0x94fb('0x67')](',');for(var _0x1ab458=0x0;_0x1ab458<_0x5844db;_0x1ab458++){if(!_0x43e322[_0x1ab458])break;if(_0x104b8c['toLowerCase']()===_0x43e322[_0x1ab458]['toLowerCase']()){var _0x2b51f1=util[_0x94fb('0x68')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x5844db);if(_0x5844db===0x1){_0x2b51f1=_0x94fb('0x69');}throw new db['Sequelize']['ValidationError'](_0x2b51f1);}}return;};exports[_0x94fb('0x6a')]=function(_0xd3fd56,_0x525c76){var _0x161df4=_0x525c76?encryptor['decryptString'](_0x525c76)[_0x94fb('0x67')](','):[];if(_0x161df4[_0x94fb('0x6b')]===0x5){_0x161df4[_0x94fb('0x6c')](-0x1,0x1);}_0x161df4[_0x94fb('0x6d')](_0xd3fd56);return encryptor['encryptString'](_0x161df4['join'](','));};function signJwt(_0x3fea63){var _0x328b7a=BPromise[_0x94fb('0x6e')](jwt[_0x94fb('0x6f')],{'context':jwt});var _0x28b13d=_0x3fea63[_0x94fb('0x70')]||config[_0x94fb('0x71')][_0x94fb('0xb')];return new BPromise(function(_0x2b1a11,_0x400214){_0x328b7a(_0x3fea63[_0x94fb('0x72')],_0x28b13d,_0x3fea63[_0x94fb('0x73')])[_0x94fb('0x3c')](function(_0x393680){_0x2b1a11(_0x393680);})['catch'](function(_0x4aef58){_0x400214(_0x4aef58);});});}function verifyJwt(_0x5f14dc,_0x5b439d,_0x3fbe0b){var _0x47f541=BPromise[_0x94fb('0x6e')](jwt[_0x94fb('0x74')],{'context':jwt});var _0x6ac576=_0x3fbe0b||config['secrets'][_0x94fb('0xb')];return new BPromise(function(_0x2fefe4,_0x1db8e8){_0x47f541(_0x5f14dc,_0x6ac576,_0x5b439d)[_0x94fb('0x3c')](function(_0x4f0cb4){_0x2fefe4(_0x4f0cb4);})[_0x94fb('0x34')](function(_0x2b6a3c){_0x1db8e8(_0x2b6a3c);});});}function generateNonce(){return crypto[_0x94fb('0x75')](0x10)[_0x94fb('0x76')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0x94fb('0x77')]()/0x3e8)[_0x94fb('0x76')]();}function createJwt(_0x414c0c){var _0xc02d85={'payload':{'iat':_0x414c0c[_0x94fb('0x5e')],'nonce':_0x414c0c[_0x94fb('0x48')]},'options':{'algorithm':_0x94fb('0x78'),'subject':_0x414c0c['id'][_0x94fb('0x76')](),'issuer':hardwareConf[_0x94fb('0x41')](),'audience':hardwareConf[_0x94fb('0x41')]()}};return signJwt(_0xc02d85)[_0x94fb('0x3c')](function(_0x246eef){return{'iat':_0x414c0c['apiKeyIat'],'nonce':_0x414c0c[_0x94fb('0x48')],'token':_0x246eef};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 427063a..17a7423 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 _0x696e=['binary','end','final','write','unlink','createDecipher','data','close','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x696e,0xc1));var _0xe696=function(_0x377b0f,_0x3d3080){_0x377b0f=_0x377b0f-0x0;var _0x5a6989=_0x696e[_0x377b0f];return _0x5a6989;};'use strict';var crypto=require(_0xe696('0x0'));var fs=require('fs');var BPromise=require(_0xe696('0x1'));var _=require(_0xe696('0x2'));var config=require(_0xe696('0x3'));var logger=require(_0xe696('0x4'))(_0xe696('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xe696('0x6')],'algorithm':_0xe696('0x7')};const fileOptions={'algorithm':_0xe696('0x8')};if(config[_0xe696('0x9')]&&config[_0xe696('0x9')][_0xe696('0xa')]){var isSupported=isAlgorithmSupported(config[_0xe696('0x9')][_0xe696('0xa')]);if(isSupported){fileOptions[_0xe696('0xa')]=config[_0xe696('0x9')][_0xe696('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe696('0xb')](',\x20');logger[_0xe696('0xc')](config[_0xe696('0x9')][_0xe696('0xa')],_0xe696('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x5123a4){return AES_SUPPORTED_RX[_0xe696('0xe')](_0x5123a4);}function getSupportedCiphers(){return crypto[_0xe696('0xf')]()[_0xe696('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x264b15){return getSupportedCiphers()['indexOf'](_0x264b15)>-0x1;}function combineOptions(_0x907ae8){var _0x2ab305={};for(var _0x2091d8 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2091d8)){_0x2ab305[_0x2091d8]=fileOptions[_0x2091d8];}}if(_0x907ae8){for(var _0x235a0f in _0x907ae8){if(_0x907ae8[_0xe696('0x11')](_0x235a0f)){_0x2ab305[_0x235a0f]=_0x907ae8[_0x235a0f];}}}return _0x2ab305;}exports[_0xe696('0x12')]=function(_0x217aa8,_0x2af710,_0x5edbe7,_0xb32a02){return new BPromise(function(_0x4eca15,_0x4b163d){_0xb32a02=combineOptions(_0xb32a02);var _0x3baf90=new Buffer(_0x5edbe7);var _0x490f6a=fs[_0xe696('0x13')](_0x217aa8);var _0x4692ac=fs[_0xe696('0x14')](_0x2af710);var _0x2c8015=crypto[_0xe696('0x15')](_0xb32a02[_0xe696('0xa')],_0x3baf90);_0x490f6a['on']('data',function(_0x4b4c5e){var _0x2d050a=new Buffer(_0x2c8015[_0xe696('0x16')](_0x4b4c5e),_0xe696('0x17'));_0x4692ac['write'](_0x2d050a);});_0x490f6a['on'](_0xe696('0x18'),function(){try{var _0x296e8f=new Buffer(_0x2c8015[_0xe696('0x19')](_0xe696('0x17')),_0xe696('0x17'));_0x4692ac[_0xe696('0x1a')](_0x296e8f);_0x4692ac[_0xe696('0x18')]();_0x4692ac['on']('close',function(){return _0x4eca15(_0x2af710);});}catch(_0x532f14){fs[_0xe696('0x1b')](_0x2af710);return _0x4b163d(_0x532f14);}});});};exports['decryptFile']=function(_0x38e34f,_0xeb2c3,_0x4750e5,_0x12b12f){return new BPromise(function(_0xb8adfc,_0x2afdf4){_0x12b12f=combineOptions(_0x12b12f);var _0x3fb12d=new Buffer(_0x4750e5);var _0x4c88e0=fs[_0xe696('0x13')](_0x38e34f);var _0x1db25e=fs[_0xe696('0x14')](_0xeb2c3);var _0x2356df=crypto[_0xe696('0x1c')](_0x12b12f[_0xe696('0xa')],_0x3fb12d);_0x4c88e0['on'](_0xe696('0x1d'),function(_0xe312e){var _0x51f33f=new Buffer(_0x2356df[_0xe696('0x16')](_0xe312e),_0xe696('0x17'));_0x1db25e[_0xe696('0x1a')](_0x51f33f);});_0x4c88e0['on'](_0xe696('0x18'),function(){try{var _0x3b3c2a=new Buffer(_0x2356df[_0xe696('0x19')](_0xe696('0x17')),'binary');_0x1db25e[_0xe696('0x1a')](_0x3b3c2a);_0x1db25e[_0xe696('0x18')]();_0x1db25e['on'](_0xe696('0x1e'),function(){return _0xb8adfc(_0xeb2c3);});}catch(_0x32ce84){fs[_0xe696('0x1b')](_0xeb2c3);return _0x2afdf4(_0x32ce84);}});});};exports[_0xe696('0x1f')]=function(_0x1b7f9e,_0x2f3f09,_0x3f4718){var _0x237ae0=_0x3f4718||stringOptions['algorithm'];var _0x5e4b81=_0x2f3f09||stringOptions[_0xe696('0x20')];var _0x24f5ec=crypto[_0xe696('0x15')](_0x237ae0,_0x5e4b81);var _0x3806f0=_0x24f5ec[_0xe696('0x16')](_0x1b7f9e,_0xe696('0x21'),_0xe696('0x22'));_0x3806f0+=_0x24f5ec[_0xe696('0x19')]('base64');return _0x3806f0;};exports[_0xe696('0x23')]=function(_0xbc224,_0xe4c9fb,_0x51634c){var _0x104cb5=_0x51634c||stringOptions[_0xe696('0xa')];var _0x5dd3f4=_0xe4c9fb||stringOptions[_0xe696('0x20')];var _0xaa67c=crypto['createDecipher'](_0x104cb5,_0x5dd3f4);var _0x38f8ff=_0xaa67c['update'](_0xbc224,'base64','utf8');_0x38f8ff+=_0xaa67c[_0xe696('0x19')](_0xe696('0x21'));return _0x38f8ff;}; \ No newline at end of file +var _0x1253=['aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','hasOwnProperty','encryptFile','createReadStream','createCipher','update','binary','write','end','final','unlink','createWriteStream','createDecipher','data','encryptString','secret','base64','utf8','bluebird','lodash','../../config/environment','aes-256-ctr'];(function(_0x271567,_0x3381fc){var _0x48164f=function(_0x3d561f){while(--_0x3d561f){_0x271567['push'](_0x271567['shift']());}};_0x48164f(++_0x3381fc);}(_0x1253,0x14e));var _0x3125=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1253[_0x14add3];return _0x4a174f;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x3125('0x0'));var _=require(_0x3125('0x1'));var config=require(_0x3125('0x2'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x3125('0x3')};const fileOptions={'algorithm':_0x3125('0x4')};if(config[_0x3125('0x5')]&&config[_0x3125('0x5')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x3125('0x5')]['algorithm']);if(isSupported){fileOptions[_0x3125('0x6')]=config['encrypt'][_0x3125('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x3125('0x5')][_0x3125('0x6')],_0x3125('0x7'),supportedAlgorithms);}}function isASupportedCipher(_0x29dbdf){return AES_SUPPORTED_RX['test'](_0x29dbdf);}function getSupportedCiphers(){return crypto[_0x3125('0x8')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x33dbf8){return getSupportedCiphers()['indexOf'](_0x33dbf8)>-0x1;}function combineOptions(_0x20d637){var _0x32f5ed={};for(var _0x7c0949 in fileOptions){if(fileOptions[_0x3125('0x9')](_0x7c0949)){_0x32f5ed[_0x7c0949]=fileOptions[_0x7c0949];}}if(_0x20d637){for(var _0x18b562 in _0x20d637){if(_0x20d637[_0x3125('0x9')](_0x18b562)){_0x32f5ed[_0x18b562]=_0x20d637[_0x18b562];}}}return _0x32f5ed;}exports[_0x3125('0xa')]=function(_0x2c9f81,_0x39cee3,_0x2d4043,_0x44020e){return new BPromise(function(_0x34c0d7,_0x4d5560){_0x44020e=combineOptions(_0x44020e);var _0x17bf84=new Buffer(_0x2d4043);var _0x274969=fs[_0x3125('0xb')](_0x2c9f81);var _0x429a3a=fs['createWriteStream'](_0x39cee3);var _0x7ed5cc=crypto[_0x3125('0xc')](_0x44020e[_0x3125('0x6')],_0x17bf84);_0x274969['on']('data',function(_0x36051e){var _0x329fe8=new Buffer(_0x7ed5cc[_0x3125('0xd')](_0x36051e),_0x3125('0xe'));_0x429a3a[_0x3125('0xf')](_0x329fe8);});_0x274969['on'](_0x3125('0x10'),function(){try{var _0x4b9c85=new Buffer(_0x7ed5cc[_0x3125('0x11')](_0x3125('0xe')),_0x3125('0xe'));_0x429a3a['write'](_0x4b9c85);_0x429a3a[_0x3125('0x10')]();_0x429a3a['on']('close',function(){return _0x34c0d7(_0x39cee3);});}catch(_0x1aeb93){fs[_0x3125('0x12')](_0x39cee3);return _0x4d5560(_0x1aeb93);}});});};exports['decryptFile']=function(_0x1d45fd,_0x4931f4,_0x559027,_0x38df23){return new BPromise(function(_0x230611,_0x18b366){_0x38df23=combineOptions(_0x38df23);var _0x2d8959=new Buffer(_0x559027);var _0x3772fb=fs[_0x3125('0xb')](_0x1d45fd);var _0x4f3e1d=fs[_0x3125('0x13')](_0x4931f4);var _0x173836=crypto[_0x3125('0x14')](_0x38df23[_0x3125('0x6')],_0x2d8959);_0x3772fb['on'](_0x3125('0x15'),function(_0x1290f2){var _0x2efbbc=new Buffer(_0x173836[_0x3125('0xd')](_0x1290f2),_0x3125('0xe'));_0x4f3e1d[_0x3125('0xf')](_0x2efbbc);});_0x3772fb['on'](_0x3125('0x10'),function(){try{var _0x2e705a=new Buffer(_0x173836[_0x3125('0x11')]('binary'),_0x3125('0xe'));_0x4f3e1d[_0x3125('0xf')](_0x2e705a);_0x4f3e1d[_0x3125('0x10')]();_0x4f3e1d['on']('close',function(){return _0x230611(_0x4931f4);});}catch(_0x542aa0){fs['unlink'](_0x4931f4);return _0x18b366(_0x542aa0);}});});};exports[_0x3125('0x16')]=function(_0x373fbf,_0x41db71,_0x33cac5){var _0x37452b=_0x33cac5||stringOptions['algorithm'];var _0x3e09fa=_0x41db71||stringOptions[_0x3125('0x17')];var _0x55501f=crypto[_0x3125('0xc')](_0x37452b,_0x3e09fa);var _0x4467aa=_0x55501f[_0x3125('0xd')](_0x373fbf,'utf8',_0x3125('0x18'));_0x4467aa+=_0x55501f[_0x3125('0x11')](_0x3125('0x18'));return _0x4467aa;};exports['decryptString']=function(_0x2777bc,_0x365e0e,_0x1d0289){var _0x50f94c=_0x1d0289||stringOptions[_0x3125('0x6')];var _0x5d0a52=_0x365e0e||stringOptions[_0x3125('0x17')];var _0x206530=crypto[_0x3125('0x14')](_0x50f94c,_0x5d0a52);var _0x2b81c0=_0x206530[_0x3125('0xd')](_0x2777bc,_0x3125('0x18'),_0x3125('0x19'));_0x2b81c0+=_0x206530[_0x3125('0x11')]('utf8');return _0x2b81c0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 79a7f91..59213ad 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 _0x4413=['.csv','existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x3c62d6,_0x5d3a6c){var _0xd96a84=function(_0x3d7ca8){while(--_0x3d7ca8){_0x3c62d6['push'](_0x3c62d6['shift']());}};_0xd96a84(++_0x5d3a6c);}(_0x4413,0x17f));var _0x3441=function(_0x41a14f,_0x46e4c7){_0x41a14f=_0x41a14f-0x0;var _0x2495ae=_0x4413[_0x41a14f];return _0x2495ae;};'use strict';var util=require(_0x3441('0x0'));var path=require(_0x3441('0x1'));var _=require(_0x3441('0x2'));var csv=require(_0x3441('0x3'));var fs=require('fs');var BPromise=require(_0x3441('0x4'));var zipdir=require(_0x3441('0x5'));var rimraf=require(_0x3441('0x6'));var db=require(_0x3441('0x7'))['db'];var dbH=require(_0x3441('0x7'))['dbH'];var logger=require(_0x3441('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x3441('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26e1ae,_0x413b28){var _0x37245e={'status':_0x26e1ae};var _0x5d2ae1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x413b28){_0x37245e[_0x3441('0xa')]=_0x413b28;}return db[_0x3441('0xb')]['update'](_0x37245e,_0x5d2ae1);}function main(){var _0x46a306=0x1388;var _0x4fa9db;logger[_0x3441('0xc')](util[_0x3441('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x3441('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3441('0xf'),_0x3441('0x10')]})[_0x3441('0x11')](function(_0x2be1bb){if(_0x2be1bb){_0x4fa9db=_0x2be1bb;_0x46a306=_0x4fa9db[_0x3441('0x10')]||0x1388;}})[_0x3441('0x11')](function(){return dbH[_0x3441('0x12')][_0x3441('0x13')](util[_0x3441('0xd')](_0x3441('0x14'),QUERY),{'type':dbH[_0x3441('0x12')][_0x3441('0x15')][_0x3441('0x16')]});})[_0x3441('0x11')](function(_0x2a63ac){if(!_0x2a63ac[0x0]['num']){return analyticExtractedReport(_0x3441('0x17'));}var _0x1fc596=[];var _0x36c1b9=0x0;if(_0x4fa9db[_0x3441('0xf')]){if(_0x2a63ac&&_0x2a63ac[_0x3441('0x18')]){var _0x27120d=_[_0x3441('0x19')](_0x2a63ac[0x0][_0x3441('0x1a')]/_0x46a306);var _0x293bdf=Number[_0x3441('0x1b')](_0x2a63ac[0x0]['num']/_0x46a306)?_0x2a63ac[0x0][_0x3441('0x1a')]%_0x46a306:0x0;_0x27120d[_0x3441('0x1c')](function(_0x4d9da5){if(_0x4d9da5>0x0){_0x36c1b9+=_0x46a306;}_0x1fc596[_0x3441('0x1d')](dbH[_0x3441('0x12')][_0x3441('0x13')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x46a306,_0x36c1b9),{'type':dbH[_0x3441('0x12')]['QueryTypes']['SELECT']}));});if(_0x293bdf>0x0){_0x36c1b9+=_0x46a306;_0x1fc596[_0x3441('0x1d')](dbH['sequelize'][_0x3441('0x13')](util[_0x3441('0xd')](_0x3441('0x1e'),QUERY,_0x293bdf,_0x36c1b9),{'type':dbH[_0x3441('0x12')][_0x3441('0x15')][_0x3441('0x16')]}));}}}else{_0x1fc596['push'](dbH['sequelize'][_0x3441('0x13')](QUERY,{'type':dbH[_0x3441('0x12')][_0x3441('0x15')][_0x3441('0x16')]}));}var _0x3c012b=path[_0x3441('0x1f')](PATH);var _0x294bfc=path[_0x3441('0x20')](PATH,_0x3441('0x21'));var _0x3a7617=_0x4fa9db['split']&&_0x1fc596[_0x3441('0x18')]>0x1;var _0x5697d5=[];if(!fs[_0x3441('0x22')](path['join'](_0x3c012b,_0x294bfc))&&_0x3a7617){fs[_0x3441('0x23')](path[_0x3441('0x24')](_0x3c012b,_0x294bfc));}return BPromise[_0x3441('0x25')](_0x1fc596,function(_0x2e9d81){_0x5697d5[_0x3441('0x1d')](_0x2e9d81);})[_0x3441('0x11')](function(){for(var _0x188366=0x0;_0x188366<_0x5697d5[_0x3441('0x18')];_0x188366+=0x1){var _0x5f5dd2;var _0x1994e1=_0x5697d5[_0x188366];if(_0x3a7617){_0x5f5dd2=path[_0x3441('0x24')](_0x3c012b,_0x294bfc,util[_0x3441('0xd')](_0x3441('0x26'),_0x294bfc,_0x188366,'csv'));}else{_0x5f5dd2=path['join'](_0x3c012b,util[_0x3441('0xd')](_0x3441('0x27'),_0x294bfc,_0x3441('0x28')));}fs[_0x3441('0x29')](_0x5f5dd2,csv(_0x1994e1));}})['then'](function(){if(_0x3a7617){return new Promise(function(_0x5c9970){zipdir(path[_0x3441('0x24')](_0x3c012b,_0x294bfc),{'saveTo':path[_0x3441('0x24')](_0x3c012b,util[_0x3441('0xd')]('%s.%s',_0x294bfc,_0x3441('0x2a')))},function(_0x29817f,_0x45d0ea){rimraf(path[_0x3441('0x24')](_0x3c012b,_0x294bfc),function(){});_0x5c9970(_0x3441('0x2b'));});});}})['then'](function(){logger['info'](util[_0x3441('0xd')](_0x3441('0x2c'),EXTRACTED_REPORT_ID,_0x3441('0x2d')));return analyticExtractedReport(_0x3441('0x2e'),_0x3a7617?util['format'](_0x3441('0x27'),_0x294bfc,_0x3a7617?'zip':_0x3441('0x28')):null);});})[_0x3441('0x2f')](function(_0x1fe553){logger[_0x3441('0xc')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3441('0x2d')),util[_0x3441('0x30')](_0x1fe553,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3441('0x31'));})[_0x3441('0x32')](function(){process[_0x3441('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x77f6=['bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','info','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','QueryTypes','Empty','length','range','num','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','to-csv'];(function(_0xddb185,_0x2689a9){var _0x558d7f=function(_0x32aa90){while(--_0x32aa90){_0xddb185['push'](_0xddb185['shift']());}};_0x558d7f(++_0x2689a9);}(_0x77f6,0x129));var _0x677f=function(_0x46f464,_0x4d4d5b){_0x46f464=_0x46f464-0x0;var _0x16ed63=_0x77f6[_0x46f464];return _0x16ed63;};'use strict';var util=require(_0x677f('0x0'));var path=require(_0x677f('0x1'));var _=require('lodash');var csv=require(_0x677f('0x2'));var fs=require('fs');var BPromise=require(_0x677f('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x677f('0x4'));var db=require(_0x677f('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x677f('0x6'))(_0x677f('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x677f('0x8')][0x2]);var QUERY=process[_0x677f('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x118d3b,_0x2bccef){var _0x22c8f3={'status':_0x118d3b};var _0x282b61={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2bccef){_0x22c8f3[_0x677f('0x9')]=_0x2bccef;}return db['AnalyticExtractedReport'][_0x677f('0xa')](_0x22c8f3,_0x282b61);}function main(){var _0x341320=0x1388;var _0x51ba2a;logger[_0x677f('0xb')](util['format'](_0x677f('0xc'),EXTRACTED_REPORT_ID,_0x677f('0xd')));return db[_0x677f('0xe')][_0x677f('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x677f('0x10'),_0x677f('0x11')]})[_0x677f('0x12')](function(_0x40572e){if(_0x40572e){_0x51ba2a=_0x40572e;_0x341320=_0x51ba2a[_0x677f('0x11')]||0x1388;}})[_0x677f('0x12')](function(){return dbH[_0x677f('0x13')][_0x677f('0x14')](util['format'](_0x677f('0x15'),QUERY),{'type':dbH[_0x677f('0x13')][_0x677f('0x16')]['SELECT']});})[_0x677f('0x12')](function(_0x108bbe){if(!_0x108bbe[0x0]['num']){return analyticExtractedReport(_0x677f('0x17'));}var _0x189e8c=[];var _0x28fcb8=0x0;if(_0x51ba2a['split']){if(_0x108bbe&&_0x108bbe[_0x677f('0x18')]){var _0x2b24c4=_[_0x677f('0x19')](_0x108bbe[0x0][_0x677f('0x1a')]/_0x341320);var _0xd5b31b=Number[_0x677f('0x1b')](_0x108bbe[0x0][_0x677f('0x1a')]/_0x341320)?_0x108bbe[0x0][_0x677f('0x1a')]%_0x341320:0x0;_0x2b24c4[_0x677f('0x1c')](function(_0x4640a0){if(_0x4640a0>0x0){_0x28fcb8+=_0x341320;}_0x189e8c[_0x677f('0x1d')](dbH[_0x677f('0x13')][_0x677f('0x14')](util[_0x677f('0x1e')](_0x677f('0x1f'),QUERY,_0x341320,_0x28fcb8),{'type':dbH[_0x677f('0x13')][_0x677f('0x16')][_0x677f('0x20')]}));});if(_0xd5b31b>0x0){_0x28fcb8+=_0x341320;_0x189e8c[_0x677f('0x1d')](dbH[_0x677f('0x13')][_0x677f('0x14')](util['format'](_0x677f('0x1f'),QUERY,_0xd5b31b,_0x28fcb8),{'type':dbH[_0x677f('0x13')][_0x677f('0x16')][_0x677f('0x20')]}));}}}else{_0x189e8c[_0x677f('0x1d')](dbH[_0x677f('0x13')][_0x677f('0x14')](QUERY,{'type':dbH[_0x677f('0x13')]['QueryTypes'][_0x677f('0x20')]}));}var _0x5e29e7=path[_0x677f('0x21')](PATH);var _0x20a0ee=path[_0x677f('0x22')](PATH,_0x677f('0x23'));var _0x48de63=_0x51ba2a[_0x677f('0x10')]&&_0x189e8c[_0x677f('0x18')]>0x1;var _0x251d9b=[];if(!fs[_0x677f('0x24')](path[_0x677f('0x25')](_0x5e29e7,_0x20a0ee))&&_0x48de63){fs[_0x677f('0x26')](path[_0x677f('0x25')](_0x5e29e7,_0x20a0ee));}return BPromise[_0x677f('0x27')](_0x189e8c,function(_0x4f93b9){_0x251d9b[_0x677f('0x1d')](_0x4f93b9);})[_0x677f('0x12')](function(){for(var _0x1f8049=0x0;_0x1f8049<_0x251d9b[_0x677f('0x18')];_0x1f8049+=0x1){var _0x135795;var _0x5e3402=_0x251d9b[_0x1f8049];if(_0x48de63){_0x135795=path[_0x677f('0x25')](_0x5e29e7,_0x20a0ee,util[_0x677f('0x1e')](_0x677f('0x28'),_0x20a0ee,_0x1f8049,'csv'));}else{_0x135795=path[_0x677f('0x25')](_0x5e29e7,util['format']('%s.%s',_0x20a0ee,_0x677f('0x29')));}fs['writeFileSync'](_0x135795,csv(_0x5e3402));}})[_0x677f('0x12')](function(){if(_0x48de63){return new Promise(function(_0x20f5a4){zipdir(path[_0x677f('0x25')](_0x5e29e7,_0x20a0ee),{'saveTo':path[_0x677f('0x25')](_0x5e29e7,util[_0x677f('0x1e')](_0x677f('0x2a'),_0x20a0ee,_0x677f('0x2b')))},function(_0xf0133e,_0xe42478){rimraf(path[_0x677f('0x25')](_0x5e29e7,_0x20a0ee),function(){});_0x20f5a4('zip\x20finished');});});}})[_0x677f('0x12')](function(){logger[_0x677f('0xb')](util[_0x677f('0x1e')](_0x677f('0x2c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x677f('0x2d'),_0x48de63?util[_0x677f('0x1e')](_0x677f('0x2a'),_0x20a0ee,_0x48de63?_0x677f('0x2b'):_0x677f('0x29')):null);});})[_0x677f('0x2e')](function(_0x16ad42){logger[_0x677f('0xb')](util['format'](_0x677f('0x2f'),EXTRACTED_REPORT_ID,_0x677f('0xd')),util['inspect'](_0x16ad42,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x677f('0x30'));})['finally'](function(){process[_0x677f('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 258fe97..df5d748 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 _0xce3c=['YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','createWriteStream','finish','error','end','path','lodash','util','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','length','auto','body','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','push','landscape','toString','Arial','black','right','num','Setting','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId'];(function(_0x6dd231,_0x23c785){var _0x20154e=function(_0x245b6f){while(--_0x245b6f){_0x6dd231['push'](_0x6dd231['shift']());}};_0x20154e(++_0x23c785);}(_0xce3c,0x1bd));var _0xcce3=function(_0x1cc325,_0x537298){_0x1cc325=_0x1cc325-0x0;var _0x33d644=_0xce3c[_0x1cc325];return _0x33d644;};'use strict';var _=require(_0xcce3('0x0'));var fs=require('fs');var util=require(_0xcce3('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0xcce3('0x2'));var PdfPrinter=require(_0xcce3('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xcce3('0x4'));var JSDOM=require(_0xcce3('0x5'))[_0xcce3('0x6')];var window=new JSDOM('')[_0xcce3('0x7')];var BPromise=require(_0xcce3('0x8'));var db=require(_0xcce3('0x9'))['db'];var dbH=require(_0xcce3('0x9'))[_0xcce3('0xa')];var logger=require(_0xcce3('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcce3('0xc')][0x2]);var QUERY=process[_0xcce3('0xc')][0x3];var PATH=process[_0xcce3('0xc')][0x4];var NAME=process[_0xcce3('0xc')][0x5];var FORMAT=_0xcce3('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3f6413,_0xcd3439){var _0x34b882={'status':_0x3f6413};var _0x2dd06a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xcd3439){_0x34b882[_0xcce3('0xe')]=_0xcd3439;}return db[_0xcce3('0xf')][_0xcce3('0x10')](_0x34b882,_0x2dd06a);}function getHeaders(_0x381a1b){return _[_0xcce3('0x11')](_0x381a1b,function(_0x2eb1ff){return{'text':_0x2eb1ff,'style':_0xcce3('0x12')};});}function getRows(_0x159f31,_0x14f7bb){return _['map'](_0x14f7bb,function(_0x16a451){return _(_0x16a451)['pick'](_0x159f31)['map'](function(_0x4b95ba){return _0x4b95ba?_['toString'](_0x4b95ba):'';})['value']();});}function createTable(_0x2eb598,_0x26fac2){var _0x24e3c2={'widths':_['fill'](Array(_0x2eb598[_0xcce3('0x13')]),0x91),'heights':function(_0x123dc2){return _0x123dc2===0x0?_0xcce3('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3bed88=getHeaders(_0x2eb598);_0x24e3c2[_0xcce3('0x15')]['push'](_0x3bed88);var _0x5b2b5b=getRows(_0x2eb598,_0x26fac2);_0x24e3c2[_0xcce3('0x15')]=_0x24e3c2[_0xcce3('0x15')]['concat'](_0x5b2b5b);return _0x24e3c2;}function createTables(_0x5233e4){var _0x5709d4=[];var _0x5ad52f=_[_0xcce3('0x16')](Object[_0xcce3('0x17')](_0x5233e4[0x0]),0x5);_0x5ad52f[_0xcce3('0x18')](function(_0xc73cf0){_0x5709d4['push'](createTable(_0xc73cf0,_0x5233e4));});return _0x5709d4;}function getPDFDocDefinition(_0x4b18b6){var _0x32ed72=util[_0xcce3('0x19')](_0xcce3('0x1a'),NAME,EXTRACTED_REPORT[_0xcce3('0x1b')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xcce3('0x1c')])[_0xcce3('0x19')](FORMAT));var _0x5c9794=[];for(var _0x1b75d9=0x0;_0x1b75d9<_0x4b18b6[_0xcce3('0x13')];_0x1b75d9++){var _0xe985bc=[];if(_0x1b75d9===0x0){_0xe985bc['push']({'text':_0x32ed72,'style':_0xcce3('0x1d')});}var _0x326b54={'table':_0x4b18b6[_0x1b75d9]};if(_0x1b75d9>0x0){_0x326b54[_0xcce3('0x1e')]=_0xcce3('0x1f');_0x326b54['margin']=[0x0,0x46,0x0,0x0];}_0xe985bc[_0xcce3('0x20')](_0x326b54);_0x5c9794['push'](_0xe985bc);}return{'pageSize':'A4','pageOrientation':_0xcce3('0x21'),'content':_0x5c9794,'footer':function(_0xb41c9,_0x44cc24){return{'text':_0xb41c9[_0xcce3('0x22')]()+'\x20/\x20'+_0x44cc24,'style':'footer'};},'defaultStyle':{'font':_0xcce3('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcce3('0x24')},'footer':{'alignment':_0xcce3('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x335def){var _0x5d278e=0x1388;var _0xfda2f4;if(!_0x335def[0x0][_0xcce3('0x26')]){return analyticExtractedReport('Empty');}return db[_0xcce3('0x27')][_0xcce3('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcce3('0x29'),_0xcce3('0x2a')]})[_0xcce3('0x2b')](function(_0x3f5b44){if(_0x3f5b44){_0xfda2f4=_0x3f5b44;_0x5d278e=_0xfda2f4[_0xcce3('0x2a')]||0x3e8;}})[_0xcce3('0x2b')](function(){var _0x438f7e=[];var _0x772291=0x0;if(_0xfda2f4[_0xcce3('0x29')]){if(_0x335def&&_0x335def[_0xcce3('0x13')]){var _0x295bb6=_['range'](_0x335def[0x0][_0xcce3('0x26')]/_0x5d278e);var _0x526215=Number['isInteger'](_0x335def[0x0]['num']/_0x5d278e)?_0x335def[0x0]['num']%_0x5d278e:0x0;_0x295bb6[_0xcce3('0x18')](function(_0x19df90){if(_0x19df90>0x0){_0x772291+=_0x5d278e;}_0x438f7e['push'](dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](util[_0xcce3('0x19')](_0xcce3('0x2e'),QUERY,_0x5d278e,_0x772291),{'type':dbH[_0xcce3('0x2c')][_0xcce3('0x2f')]['SELECT']}));});if(_0x526215>0x0){_0x772291+=_0x5d278e;_0x438f7e[_0xcce3('0x20')](dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](util[_0xcce3('0x19')](_0xcce3('0x2e'),QUERY,_0x526215,_0x772291),{'type':dbH[_0xcce3('0x2c')][_0xcce3('0x2f')][_0xcce3('0x30')]}));}}}else{_0x438f7e[_0xcce3('0x20')](dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](QUERY,{'type':dbH[_0xcce3('0x2c')][_0xcce3('0x2f')][_0xcce3('0x30')]}));}var _0x45eb5f=path[_0xcce3('0x31')](PATH);var _0x1b874c=path[_0xcce3('0x32')](PATH,'.pdf');var _0x2303b4=_0xfda2f4[_0xcce3('0x29')]&&_0x438f7e[_0xcce3('0x13')]>0x1;var _0x211134=[];if(!fs[_0xcce3('0x33')](path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c))&&_0x2303b4){fs[_0xcce3('0x35')](path['join'](_0x45eb5f,_0x1b874c));}return BPromise[_0xcce3('0x36')](_0x438f7e,function(_0xd85c56){_0x211134['push'](_0xd85c56);})[_0xcce3('0x2b')](function(){var _0x46be90=[];for(var _0x2396b3=0x0;_0x2396b3<_0x211134[_0xcce3('0x13')];_0x2396b3+=0x1){var _0x4c9949=_0x211134[_0x2396b3];var _0x20ad34=createTables(_[_0xcce3('0x37')](_0x4c9949));var _0x321a40;var _0x2783ef=getPDFDocDefinition(_0x20ad34);var _0x354c2b=getPDFPrinter();var _0x2ee3d3=_0x354c2b['createPdfKitDocument'](_0x2783ef);if(_0x2303b4){_0x321a40=path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c,util[_0xcce3('0x19')](_0xcce3('0x38'),_0x1b874c,_0x2396b3,_0xcce3('0x39')));}else{_0x321a40=path['join'](_0x45eb5f,util['format'](_0xcce3('0x3a'),_0x1b874c,_0xcce3('0x39')));}_0x46be90[_0xcce3('0x20')](writePDFDocument(_0x2ee3d3,_0x321a40));}return Promise[_0xcce3('0x3b')](_0x46be90);})['then'](function(){if(_0x2303b4){return new Promise(function(_0x12f37f){zipdir(path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c),{'saveTo':path[_0xcce3('0x34')](_0x45eb5f,util[_0xcce3('0x19')](_0xcce3('0x3a'),_0x1b874c,'zip'))},function(){rimraf(path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c),function(){});_0x12f37f(_0xcce3('0x3c'));});});}})[_0xcce3('0x2b')](function(){if(!_0x2303b4)return;rimraf(path[_0xcce3('0x34')](_0x45eb5f,_0x1b874c),function(){});})[_0xcce3('0x2b')](function(){logger['info'](util[_0xcce3('0x19')](_0xcce3('0x3d'),EXTRACTED_REPORT_ID,_0xcce3('0x3e')));return analyticExtractedReport('Completed',_0x2303b4?util[_0xcce3('0x19')](_0xcce3('0x3a'),_0x1b874c,_0x2303b4?_0xcce3('0x3f'):_0xcce3('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcce3('0x40')](util[_0xcce3('0x19')](_0xcce3('0x41'),EXTRACTED_REPORT_ID,_0xcce3('0x3e')));return db[_0xcce3('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x3cb2f1){EXTRACTED_REPORT=_0x3cb2f1;return dbH[_0xcce3('0x2c')][_0xcce3('0x2d')](util[_0xcce3('0x19')](_0xcce3('0x42'),QUERY),{'type':dbH[_0xcce3('0x2c')]['QueryTypes']['SELECT']});})[_0xcce3('0x2b')](extractReport)[_0xcce3('0x43')](function(_0x3ced30){logger['info'](util[_0xcce3('0x19')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcce3('0x3e')),util['inspect'](_0x3ced30,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcce3('0x44'));})[_0xcce3('0x45')](function(){process[_0xcce3('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4107a3=new PdfPrinter({'Arial':{'normal':__dirname+_0xcce3('0x47'),'bold':__dirname+_0xcce3('0x48'),'italics':__dirname+_0xcce3('0x49'),'bolditalics':__dirname+_0xcce3('0x4a')}});return _0x4107a3;}function getPDFDocDefinitionFromHTML(_0x4d1b45,_0x1a7e0f){var _0x2e6022=util[_0xcce3('0x19')](_0xcce3('0x4b'),_0x1a7e0f['channel'],_0x1a7e0f[_0xcce3('0x4c')]);var _0x1d93fb=moment()[_0xcce3('0x19')](_0xcce3('0x4d'))[_0xcce3('0x22')]();var _0x433779=htmlToPdfmake(_0x4d1b45,{'window':window,'tableAutoSize':!![]});return{'content':[_0x433779],'defaultStyle':{'font':_0xcce3('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcce3('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcce3('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcce3('0x4e')}},'header':function(){return[{'text':_0xcce3('0x4f'),'style':'header'}];},'footer':function(_0x380792,_0x12b266){return[{'text':util[_0xcce3('0x19')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2e6022,_0x380792,_0x12b266,_0x1d93fb),'style':_0xcce3('0x50')}];}};}function writePDFDocument(_0x492cb7,_0x1a1e12){return new Promise(function(_0x4aa3d4,_0x38c2ca){var _0x11b574=_0x492cb7[_0xcce3('0x51')](fs[_0xcce3('0x52')](_0x1a1e12));_0x11b574['on'](_0xcce3('0x53'),function(){_0x4aa3d4(_0xcce3('0x53'));});_0x11b574['on'](_0xcce3('0x54'),function(_0x2aea24){_0x38c2ca(_0x2aea24);});_0x492cb7[_0xcce3('0x55')]();});}exports['createPdfFromHTML']=function(_0x456cda,_0x591640){var _0x514c74=getPDFPrinter();var _0x5e4b12=getPDFDocDefinitionFromHTML(_0x456cda,_0x591640);var _0x48f747=_0x514c74['createPdfKitDocument'](_0x5e4b12);return writePDFDocument(_0x48f747,_0x591640[_0xcce3('0x56')])['catch'](function(_0x1ec62b){throw _0x1ec62b;});}; \ No newline at end of file +var _0xefe9=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','.pdf','existsSync','join','each','flatten','%s%d.%s','pdf','all','%s.%s','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','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','update','tableHeader','map','value','fill','length','auto','body','concat','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','black','num','find','split','splitSizePdf','then','range','isInteger','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xefe9,0xe7));var _0x9efe=function(_0x13a1d0,_0x59dc20){_0x13a1d0=_0x13a1d0-0x0;var _0x3cabcc=_0xefe9[_0x13a1d0];return _0x3cabcc;};'use strict';var _=require(_0x9efe('0x0'));var fs=require('fs');var util=require(_0x9efe('0x1'));var path=require(_0x9efe('0x2'));var moment=require(_0x9efe('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x9efe('0x4'));var zipdir=require(_0x9efe('0x5'));var rimraf=require(_0x9efe('0x6'));var JSDOM=require(_0x9efe('0x7'))[_0x9efe('0x8')];var window=new JSDOM('')[_0x9efe('0x9')];var BPromise=require(_0x9efe('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9efe('0xb'))[_0x9efe('0xc')];var logger=require(_0x9efe('0xd'))(_0x9efe('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x9efe('0xf')][0x2]);var QUERY=process[_0x9efe('0xf')][0x3];var PATH=process[_0x9efe('0xf')][0x4];var NAME=process[_0x9efe('0xf')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1cb1f6,_0x277a3f){var _0x333c1d={'status':_0x1cb1f6};var _0x6f5e14={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x277a3f){_0x333c1d['savename']=_0x277a3f;}return db['AnalyticExtractedReport'][_0x9efe('0x10')](_0x333c1d,_0x6f5e14);}function getHeaders(_0x16526a){return _['map'](_0x16526a,function(_0x1c4b22){return{'text':_0x1c4b22,'style':_0x9efe('0x11')};});}function getRows(_0x1283b9,_0x1158d7){return _['map'](_0x1158d7,function(_0x2fd585){return _(_0x2fd585)['pick'](_0x1283b9)[_0x9efe('0x12')](function(_0x4b91e3){return _0x4b91e3?_['toString'](_0x4b91e3):'';})[_0x9efe('0x13')]();});}function createTable(_0x3038bb,_0x31c545){var _0x3e3abf={'widths':_[_0x9efe('0x14')](Array(_0x3038bb[_0x9efe('0x15')]),0x91),'heights':function(_0x297891){return _0x297891===0x0?_0x9efe('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x158d51=getHeaders(_0x3038bb);_0x3e3abf[_0x9efe('0x17')]['push'](_0x158d51);var _0x2de859=getRows(_0x3038bb,_0x31c545);_0x3e3abf[_0x9efe('0x17')]=_0x3e3abf[_0x9efe('0x17')][_0x9efe('0x18')](_0x2de859);return _0x3e3abf;}function createTables(_0x482d02){var _0x380fa8=[];var _0x2b213d=_['chunk'](Object['keys'](_0x482d02[0x0]),0x5);_0x2b213d[_0x9efe('0x19')](function(_0x3cda27){_0x380fa8[_0x9efe('0x1a')](createTable(_0x3cda27,_0x482d02));});return _0x380fa8;}function getPDFDocDefinition(_0x3112c4){var _0x13a901=util[_0x9efe('0x1b')](_0x9efe('0x1c'),NAME,EXTRACTED_REPORT[_0x9efe('0x1d')],moment(EXTRACTED_REPORT[_0x9efe('0x1e')])[_0x9efe('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x9efe('0x1f')])[_0x9efe('0x1b')](FORMAT));var _0x1d96ae=[];for(var _0x9455de=0x0;_0x9455de<_0x3112c4[_0x9efe('0x15')];_0x9455de++){var _0xe61bf2=[];if(_0x9455de===0x0){_0xe61bf2[_0x9efe('0x1a')]({'text':_0x13a901,'style':_0x9efe('0x20')});}var _0x11eee4={'table':_0x3112c4[_0x9455de]};if(_0x9455de>0x0){_0x11eee4[_0x9efe('0x21')]=_0x9efe('0x22');_0x11eee4[_0x9efe('0x23')]=[0x0,0x46,0x0,0x0];}_0xe61bf2['push'](_0x11eee4);_0x1d96ae[_0x9efe('0x1a')](_0xe61bf2);}return{'pageSize':'A4','pageOrientation':_0x9efe('0x24'),'content':_0x1d96ae,'footer':function(_0x4103f2,_0x2820ba){return{'text':_0x4103f2[_0x9efe('0x25')]()+_0x9efe('0x26')+_0x2820ba,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9efe('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1c60f5){var _0x5507fc=0x1388;var _0x4b3629;if(!_0x1c60f5[0x0][_0x9efe('0x28')]){return analyticExtractedReport('Empty');}return db['Setting'][_0x9efe('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9efe('0x2a'),_0x9efe('0x2b')]})[_0x9efe('0x2c')](function(_0x2f225a){if(_0x2f225a){_0x4b3629=_0x2f225a;_0x5507fc=_0x4b3629[_0x9efe('0x2b')]||0x3e8;}})[_0x9efe('0x2c')](function(){var _0x233c19=[];var _0x4e3c9d=0x0;if(_0x4b3629[_0x9efe('0x2a')]){if(_0x1c60f5&&_0x1c60f5[_0x9efe('0x15')]){var _0x471369=_[_0x9efe('0x2d')](_0x1c60f5[0x0][_0x9efe('0x28')]/_0x5507fc);var _0x49d6e4=Number[_0x9efe('0x2e')](_0x1c60f5[0x0][_0x9efe('0x28')]/_0x5507fc)?_0x1c60f5[0x0][_0x9efe('0x28')]%_0x5507fc:0x0;_0x471369[_0x9efe('0x19')](function(_0x1907d0){if(_0x1907d0>0x0){_0x4e3c9d+=_0x5507fc;}_0x233c19[_0x9efe('0x1a')](dbH[_0x9efe('0x2f')]['query'](util['format'](_0x9efe('0x30'),QUERY,_0x5507fc,_0x4e3c9d),{'type':dbH['sequelize'][_0x9efe('0x31')][_0x9efe('0x32')]}));});if(_0x49d6e4>0x0){_0x4e3c9d+=_0x5507fc;_0x233c19[_0x9efe('0x1a')](dbH[_0x9efe('0x2f')][_0x9efe('0x33')](util[_0x9efe('0x1b')](_0x9efe('0x30'),QUERY,_0x49d6e4,_0x4e3c9d),{'type':dbH[_0x9efe('0x2f')]['QueryTypes'][_0x9efe('0x32')]}));}}}else{_0x233c19[_0x9efe('0x1a')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x9efe('0x2f')][_0x9efe('0x31')][_0x9efe('0x32')]}));}var _0x413bbb=path[_0x9efe('0x34')](PATH);var _0x2ed0bb=path['basename'](PATH,_0x9efe('0x35'));var _0x4e3148=_0x4b3629['split']&&_0x233c19[_0x9efe('0x15')]>0x1;var _0xd31abb=[];if(!fs[_0x9efe('0x36')](path[_0x9efe('0x37')](_0x413bbb,_0x2ed0bb))&&_0x4e3148){fs['mkdirSync'](path[_0x9efe('0x37')](_0x413bbb,_0x2ed0bb));}return BPromise[_0x9efe('0x38')](_0x233c19,function(_0x1fcd0d){_0xd31abb[_0x9efe('0x1a')](_0x1fcd0d);})[_0x9efe('0x2c')](function(){var _0x5d206c=[];for(var _0x352d9d=0x0;_0x352d9d<_0xd31abb[_0x9efe('0x15')];_0x352d9d+=0x1){var _0x517261=_0xd31abb[_0x352d9d];var _0x7d89bd=createTables(_[_0x9efe('0x39')](_0x517261));var _0x32eeff;var _0x303914=getPDFDocDefinition(_0x7d89bd);var _0x173e21=getPDFPrinter();var _0x13b5da=_0x173e21['createPdfKitDocument'](_0x303914);if(_0x4e3148){_0x32eeff=path[_0x9efe('0x37')](_0x413bbb,_0x2ed0bb,util['format'](_0x9efe('0x3a'),_0x2ed0bb,_0x352d9d,_0x9efe('0x3b')));}else{_0x32eeff=path[_0x9efe('0x37')](_0x413bbb,util[_0x9efe('0x1b')]('%s.%s',_0x2ed0bb,_0x9efe('0x3b')));}_0x5d206c['push'](writePDFDocument(_0x13b5da,_0x32eeff));}return Promise[_0x9efe('0x3c')](_0x5d206c);})['then'](function(){if(_0x4e3148){return new Promise(function(_0x324695){zipdir(path[_0x9efe('0x37')](_0x413bbb,_0x2ed0bb),{'saveTo':path['join'](_0x413bbb,util[_0x9efe('0x1b')](_0x9efe('0x3d'),_0x2ed0bb,_0x9efe('0x3e')))},function(){rimraf(path['join'](_0x413bbb,_0x2ed0bb),function(){});_0x324695(_0x9efe('0x3f'));});});}})[_0x9efe('0x2c')](function(){if(!_0x4e3148)return;rimraf(path['join'](_0x413bbb,_0x2ed0bb),function(){});})[_0x9efe('0x2c')](function(){logger[_0x9efe('0x40')](util['format'](_0x9efe('0x41'),EXTRACTED_REPORT_ID,_0x9efe('0x42')));return analyticExtractedReport(_0x9efe('0x43'),_0x4e3148?util[_0x9efe('0x1b')]('%s.%s',_0x2ed0bb,_0x4e3148?_0x9efe('0x3e'):_0x9efe('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x9efe('0x1b')](_0x9efe('0x44'),EXTRACTED_REPORT_ID,_0x9efe('0x42')));return db[_0x9efe('0x45')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9efe('0x2c')](function(_0x42d183){EXTRACTED_REPORT=_0x42d183;return dbH[_0x9efe('0x2f')][_0x9efe('0x33')](util[_0x9efe('0x1b')](_0x9efe('0x46'),QUERY),{'type':dbH[_0x9efe('0x2f')][_0x9efe('0x31')]['SELECT']});})[_0x9efe('0x2c')](extractReport)[_0x9efe('0x47')](function(_0xef538d){logger[_0x9efe('0x40')](util[_0x9efe('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9efe('0x42')),util[_0x9efe('0x48')](_0xef538d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9efe('0x49'));})[_0x9efe('0x4a')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5a6c40=new PdfPrinter({'Arial':{'normal':__dirname+_0x9efe('0x4b'),'bold':__dirname+_0x9efe('0x4c'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9efe('0x4d')}});return _0x5a6c40;}function getPDFDocDefinitionFromHTML(_0x28f467,_0x474262){var _0x138eaa=util['format'](_0x9efe('0x4e'),_0x474262[_0x9efe('0x4f')],_0x474262[_0x9efe('0x50')]);var _0x551aad=moment()[_0x9efe('0x1b')](_0x9efe('0x51'))[_0x9efe('0x25')]();var _0x583377=htmlToPdfmake(_0x28f467,{'window':window,'tableAutoSize':!![]});return{'content':[_0x583377],'defaultStyle':{'font':_0x9efe('0x52')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9efe('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9efe('0x53')}},'header':function(){return[{'text':_0x9efe('0x54'),'style':_0x9efe('0x20')}];},'footer':function(_0x2c43ca,_0x393f81){return[{'text':util['format'](_0x9efe('0x55'),_0x138eaa,_0x2c43ca,_0x393f81,_0x551aad),'style':'footer'}];}};}function writePDFDocument(_0x3732c5,_0x4faefd){return new Promise(function(_0x29822c,_0x26fa3f){var _0x3f14e3=_0x3732c5[_0x9efe('0x56')](fs[_0x9efe('0x57')](_0x4faefd));_0x3f14e3['on']('finish',function(){_0x29822c(_0x9efe('0x58'));});_0x3f14e3['on'](_0x9efe('0x59'),function(_0x3fe4f5){_0x26fa3f(_0x3fe4f5);});_0x3732c5[_0x9efe('0x5a')]();});}exports[_0x9efe('0x5b')]=function(_0x54634d,_0x4c0a25){var _0x1efb4c=getPDFPrinter();var _0x2523b3=getPDFDocDefinitionFromHTML(_0x54634d,_0x4c0a25);var _0x44b753=_0x1efb4c[_0x9efe('0x5c')](_0x2523b3);return writePDFDocument(_0x44b753,_0x4c0a25[_0x9efe('0x2')])[_0x9efe('0x47')](function(_0x2e2b33){throw _0x2e2b33;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d52d56c..0ff0df9 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 _0x8ed5=['sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','range','isInteger','num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.xlsx','length','existsSync','mkdirSync','join','each','xlsx','%s.%s','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','inspect','finally','path','lodash','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x8ed5,0x15f));var _0x58ed=function(_0x514e2c,_0x5b9509){_0x514e2c=_0x514e2c-0x0;var _0x4776d6=_0x8ed5[_0x514e2c];return _0x4776d6;};'use strict';var util=require('util');var path=require(_0x58ed('0x0'));var _=require(_0x58ed('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x58ed('0x2'));var rimraf=require('rimraf');var db=require(_0x58ed('0x3'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x58ed('0x4'))(_0x58ed('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x58ed('0x6')][0x3];var PATH=process[_0x58ed('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x18573d,_0x3ade1c){var _0x3817a7={'status':_0x18573d};var _0x391796={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ade1c){_0x3817a7[_0x58ed('0x7')]=_0x3ade1c;}return db[_0x58ed('0x8')]['update'](_0x3817a7,_0x391796);}function main(){var _0x2e4971=0x1388;var _0x40c33f;logger[_0x58ed('0x9')](util[_0x58ed('0xa')](_0x58ed('0xb'),EXTRACTED_REPORT_ID,_0x58ed('0xc')));return db[_0x58ed('0xd')][_0x58ed('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x58ed('0xf')]})['then'](function(_0x1ba269){if(_0x1ba269){_0x40c33f=_0x1ba269;_0x2e4971=_0x40c33f[_0x58ed('0xf')]||0x1388;}})[_0x58ed('0x10')](function(){return dbH[_0x58ed('0x11')][_0x58ed('0x12')](util['format'](_0x58ed('0x13'),QUERY),{'type':dbH[_0x58ed('0x11')][_0x58ed('0x14')][_0x58ed('0x15')]});})['then'](function(_0x58dc4e){if(!_0x58dc4e[0x0]['num']){return analyticExtractedReport(_0x58ed('0x16'));}var _0x5d4501=[];var _0xb74f02=0x0;if(_0x40c33f[_0x58ed('0x17')]){if(_0x58dc4e&&_0x58dc4e['length']){var _0x5c0b2e=_[_0x58ed('0x18')](_0x58dc4e[0x0]['num']/_0x2e4971);var _0x5be03e=Number[_0x58ed('0x19')](_0x58dc4e[0x0][_0x58ed('0x1a')]/_0x2e4971)?_0x58dc4e[0x0]['num']%_0x2e4971:0x0;_0x5c0b2e['forEach'](function(_0x4bbcb8){if(_0x4bbcb8>0x0){_0xb74f02+=_0x2e4971;}_0x5d4501['push'](dbH[_0x58ed('0x11')]['query'](util[_0x58ed('0xa')](_0x58ed('0x1b'),QUERY,_0x2e4971,_0xb74f02),{'type':dbH[_0x58ed('0x11')][_0x58ed('0x14')]['SELECT']}));});if(_0x5be03e>0x0){_0xb74f02+=_0x2e4971;_0x5d4501[_0x58ed('0x1c')](dbH[_0x58ed('0x11')][_0x58ed('0x12')](util[_0x58ed('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5be03e,_0xb74f02),{'type':dbH['sequelize'][_0x58ed('0x14')][_0x58ed('0x15')]}));}}}else{_0x5d4501[_0x58ed('0x1c')](dbH[_0x58ed('0x11')]['query'](QUERY,{'type':dbH[_0x58ed('0x11')]['QueryTypes'][_0x58ed('0x15')]}));}var _0x346821=path['dirname'](PATH);var _0x2c4352=path[_0x58ed('0x1d')](PATH,_0x58ed('0x1e'));var _0x38d109=_0x40c33f[_0x58ed('0x17')]&&_0x5d4501[_0x58ed('0x1f')]>0x1;var _0x5421a7=[];if(!fs[_0x58ed('0x20')](path['join'](_0x346821,_0x2c4352))&&_0x38d109){fs[_0x58ed('0x21')](path[_0x58ed('0x22')](_0x346821,_0x2c4352));}return BPromise[_0x58ed('0x23')](_0x5d4501,function(_0x340796){_0x5421a7[_0x58ed('0x1c')](_0x340796);})['then'](function(){for(var _0x369084=0x0;_0x369084<_0x5421a7['length'];_0x369084+=0x1){var _0x17dd7a;var _0x29cfde=_0x5421a7[_0x369084];if(_0x38d109){_0x17dd7a=path['join'](_0x346821,_0x2c4352,util['format']('%s%d.%s',_0x2c4352,_0x369084,_0x58ed('0x24')));}else{_0x17dd7a=path[_0x58ed('0x22')](_0x346821,util[_0x58ed('0xa')](_0x58ed('0x25'),_0x2c4352,_0x58ed('0x24')));}fs[_0x58ed('0x26')](_0x17dd7a,json2xls(_0x29cfde),'binary');}})['then'](function(){if(_0x38d109){return new Promise(function(_0x188d98){zipdir(path['join'](_0x346821,_0x2c4352),{'saveTo':path[_0x58ed('0x22')](_0x346821,util[_0x58ed('0xa')]('%s.%s',_0x2c4352,_0x58ed('0x27')))},function(_0x56c904,_0x505e76){rimraf(path[_0x58ed('0x22')](_0x346821,_0x2c4352),function(){});_0x188d98(_0x58ed('0x28'));});});}})['then'](function(){logger['info'](util[_0x58ed('0xa')](_0x58ed('0x29'),EXTRACTED_REPORT_ID,_0x58ed('0xc')));return analyticExtractedReport('Completed',_0x38d109?util[_0x58ed('0xa')](_0x58ed('0x25'),_0x2c4352,_0x38d109?_0x58ed('0x27'):'xlsx'):null);});})[_0x58ed('0x2a')](function(_0x9af9a5){logger[_0x58ed('0x9')](util[_0x58ed('0xa')](_0x58ed('0x2b'),EXTRACTED_REPORT_ID,_0x58ed('0xc')),util[_0x58ed('0x2c')](_0x9af9a5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x58ed('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdebb=['then','sequelize','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','push','%s%d.%s','xlsx','writeFileSync','%s.%s','zip','zip\x20finished','Completed','inspect','Failed','finally','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx'];(function(_0x16e3f4,_0x4799a1){var _0x2460e1=function(_0x14c475){while(--_0x14c475){_0x16e3f4['push'](_0x16e3f4['shift']());}};_0x2460e1(++_0x4799a1);}(_0xdebb,0x19c));var _0xbdeb=function(_0xdc2de4,_0x751109){_0xdc2de4=_0xdc2de4-0x0;var _0x11e0da=_0xdebb[_0xdc2de4];return _0x11e0da;};'use strict';var util=require(_0xbdeb('0x0'));var path=require(_0xbdeb('0x1'));var _=require(_0xbdeb('0x2'));var fs=require('fs');var json2xls=require(_0xbdeb('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xbdeb('0x4'));var rimraf=require(_0xbdeb('0x5'));var db=require(_0xbdeb('0x6'))['db'];var dbH=require(_0xbdeb('0x6'))[_0xbdeb('0x7')];var logger=require(_0xbdeb('0x8'))(_0xbdeb('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xbdeb('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbdeb('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4624f5,_0x4c9224){var _0x31b202={'status':_0x4624f5};var _0xfc86bb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4c9224){_0x31b202['savename']=_0x4c9224;}return db[_0xbdeb('0xb')][_0xbdeb('0xc')](_0x31b202,_0xfc86bb);}function main(){var _0x27dec9=0x1388;var _0x2d043c;logger[_0xbdeb('0xd')](util[_0xbdeb('0xe')](_0xbdeb('0xf'),EXTRACTED_REPORT_ID,_0xbdeb('0x10')));return db[_0xbdeb('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbdeb('0x12'),_0xbdeb('0x13')]})['then'](function(_0x20d670){if(_0x20d670){_0x2d043c=_0x20d670;_0x27dec9=_0x2d043c['splitSizeXlsx']||0x1388;}})[_0xbdeb('0x14')](function(){return dbH[_0xbdeb('0x15')]['query'](util[_0xbdeb('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xbdeb('0x15')][_0xbdeb('0x16')][_0xbdeb('0x17')]});})['then'](function(_0x46dc21){if(!_0x46dc21[0x0][_0xbdeb('0x18')]){return analyticExtractedReport(_0xbdeb('0x19'));}var _0xc21e9f=[];var _0x30213b=0x0;if(_0x2d043c[_0xbdeb('0x12')]){if(_0x46dc21&&_0x46dc21[_0xbdeb('0x1a')]){var _0x175bb6=_['range'](_0x46dc21[0x0][_0xbdeb('0x18')]/_0x27dec9);var _0x4e5cbb=Number[_0xbdeb('0x1b')](_0x46dc21[0x0][_0xbdeb('0x18')]/_0x27dec9)?_0x46dc21[0x0][_0xbdeb('0x18')]%_0x27dec9:0x0;_0x175bb6[_0xbdeb('0x1c')](function(_0x54d26e){if(_0x54d26e>0x0){_0x30213b+=_0x27dec9;}_0xc21e9f['push'](dbH['sequelize'][_0xbdeb('0x1d')](util[_0xbdeb('0xe')](_0xbdeb('0x1e'),QUERY,_0x27dec9,_0x30213b),{'type':dbH['sequelize']['QueryTypes'][_0xbdeb('0x17')]}));});if(_0x4e5cbb>0x0){_0x30213b+=_0x27dec9;_0xc21e9f['push'](dbH[_0xbdeb('0x15')][_0xbdeb('0x1d')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4e5cbb,_0x30213b),{'type':dbH[_0xbdeb('0x15')][_0xbdeb('0x16')]['SELECT']}));}}}else{_0xc21e9f['push'](dbH[_0xbdeb('0x15')][_0xbdeb('0x1d')](QUERY,{'type':dbH[_0xbdeb('0x15')][_0xbdeb('0x16')][_0xbdeb('0x17')]}));}var _0x220f13=path[_0xbdeb('0x1f')](PATH);var _0x4edeb8=path[_0xbdeb('0x20')](PATH,_0xbdeb('0x21'));var _0x3dcac8=_0x2d043c[_0xbdeb('0x12')]&&_0xc21e9f[_0xbdeb('0x1a')]>0x1;var _0x446238=[];if(!fs['existsSync'](path[_0xbdeb('0x22')](_0x220f13,_0x4edeb8))&&_0x3dcac8){fs[_0xbdeb('0x23')](path[_0xbdeb('0x22')](_0x220f13,_0x4edeb8));}return BPromise[_0xbdeb('0x24')](_0xc21e9f,function(_0x129282){_0x446238[_0xbdeb('0x25')](_0x129282);})[_0xbdeb('0x14')](function(){for(var _0x58a411=0x0;_0x58a411<_0x446238['length'];_0x58a411+=0x1){var _0xc018be;var _0x68cd66=_0x446238[_0x58a411];if(_0x3dcac8){_0xc018be=path[_0xbdeb('0x22')](_0x220f13,_0x4edeb8,util[_0xbdeb('0xe')](_0xbdeb('0x26'),_0x4edeb8,_0x58a411,_0xbdeb('0x27')));}else{_0xc018be=path['join'](_0x220f13,util[_0xbdeb('0xe')]('%s.%s',_0x4edeb8,_0xbdeb('0x27')));}fs[_0xbdeb('0x28')](_0xc018be,json2xls(_0x68cd66),'binary');}})[_0xbdeb('0x14')](function(){if(_0x3dcac8){return new Promise(function(_0x2de52f){zipdir(path[_0xbdeb('0x22')](_0x220f13,_0x4edeb8),{'saveTo':path[_0xbdeb('0x22')](_0x220f13,util[_0xbdeb('0xe')](_0xbdeb('0x29'),_0x4edeb8,_0xbdeb('0x2a')))},function(_0xce8349,_0xa28c29){rimraf(path[_0xbdeb('0x22')](_0x220f13,_0x4edeb8),function(){});_0x2de52f(_0xbdeb('0x2b'));});});}})['then'](function(){logger[_0xbdeb('0xd')](util[_0xbdeb('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xbdeb('0x10')));return analyticExtractedReport(_0xbdeb('0x2c'),_0x3dcac8?util['format'](_0xbdeb('0x29'),_0x4edeb8,_0x3dcac8?_0xbdeb('0x2a'):_0xbdeb('0x27')):null);});})['catch'](function(_0xe9f590){logger[_0xbdeb('0xd')](util[_0xbdeb('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbdeb('0x10')),util[_0xbdeb('0x2d')](_0xe9f590,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbdeb('0x2e'));})[_0xbdeb('0x2f')](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 9af09e3..3046817 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 _0x32ce=['recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','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','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','find','extensions','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','CDR(routeid)=','outbound','push','extension','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid='];(function(_0x33d5f3,_0x1c926c){var _0x4456a0=function(_0x37c965){while(--_0x37c965){_0x33d5f3['push'](_0x33d5f3['shift']());}};_0x4456a0(++_0x1c926c);}(_0x32ce,0xee));var _0xe32c=function(_0x17e629,_0x2332f2){_0x17e629=_0x17e629-0x0;var _0x4fdf39=_0x32ce[_0x17e629];return _0x4fdf39;};'use strict';var _=require(_0xe32c('0x0'));var util=require('util');function rewrite(_0x2234fb,_0x5788b7){var _0x1e8789=this;return _0x2234fb[_0xe32c('0x1')][_0xe32c('0x2')][_0xe32c('0x3')]({'raw':!![]})[_0xe32c('0x4')](function(_0x27ddd0){_0x1e8789[_0xe32c('0x5')]=_0x27ddd0;return _0x2234fb[_0xe32c('0x1')]['VoiceExtension'][_0xe32c('0x3')]({'where':{'IntervalId':_0x5788b7[_0xe32c('0x6')]},'raw':!![]});})['then'](function(_0x5734a4){return _0x2234fb[_0xe32c('0x1')][_0xe32c('0x7')][_0xe32c('0x3')]({'where':{'exten':{'$in':_[_0xe32c('0x8')](_[_0xe32c('0x9')](_0x5734a4,_0xe32c('0xa')))}},'order':[{'raw':_0xe32c('0xb')}],'raw':!![]});})[_0xe32c('0x4')](function(_0x378b9b){var _0x48ee83=_[_0xe32c('0xc')](_0x378b9b,{'priority':'1'});var _0x102102=_[_0xe32c('0xc')](_0x378b9b,{'isApp':0x1});var _0x388c1b=_['groupBy'](_0x102102,'exten');var _0x36dcd5=[_0xe32c('0xd'),_0xe32c('0xe')];var _0x123dfa=[];var _0x39c95c=[];for(var _0x12fc8a in _0x388c1b){if(_0x388c1b[_0xe32c('0xf')](_0x12fc8a)){_0x1e8789[_0xe32c('0x10')]=0x2;_0x1e8789['extensions']=[];_0x1e8789['extension']=_[_0xe32c('0x11')](_0x48ee83,{'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')]});_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0]['type'],'app':_0xe32c('0x13'),'appdata':util[_0xe32c('0x14')](_0xe32c('0x15'),_0x388c1b[_0x12fc8a][0x0]['type']),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0]['exten'],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});if(_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')]==='inbound'){_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x19')+_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});}else if(_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')]===_0xe32c('0x1a')){if(_0x1e8789['extension']){_0x1e8789['extensions'][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':'CDR(destination)='+(_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x1d')]?_0xe32c('0x1e')+_0x1e8789['extension'][_0xe32c('0x1d')]+'}':_0xe32c('0x1f')),'context':_0x388c1b[_0x12fc8a][0x0]['context'],'exten':_0x388c1b[_0x12fc8a][0x0]['exten'],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});}_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':'Set','appdata':'CDR(routeid)='+_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});var _0x3f8d23=_0x1e8789['priority']++;_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':_0xe32c('0x21')+(_0x3f8d23+0x2)+_0xe32c('0x22')+(_0x3f8d23+0x1)+')','context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0]['exten'],'priority':_0x3f8d23,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});if(_0x1e8789[_0xe32c('0x1c')]){_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0]['type'],'app':_0xe32c('0x13'),'appdata':_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x1d')]?_0xe32c('0x23')+_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x1d')]+'}':_0xe32c('0x24'),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});}_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x25')+_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});if(_0x1e8789[_0xe32c('0x1c')]&&_0x1e8789[_0xe32c('0x1c')][_0xe32c('0xf')](_0xe32c('0x26'))&&_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x26')]!==_0xe32c('0x27')){_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x28')+_0x1e8789[_0xe32c('0x1c')][_0xe32c('0x26')]||_0xe32c('0x29'),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});}}_0x1e8789['extensions'][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x2a'),'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789[_0xe32c('0x10')]++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});_0x1e8789[_0xe32c('0x12')]['push']({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':'Set','appdata':_0xe32c('0x2b'),'context':_0x388c1b[_0x12fc8a][0x0]['context'],'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'priority':_0x1e8789['priority']++,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});for(var _0x356f02=0x0,_0x2a2691=0x0;_0x356f02<_0x388c1b[_0x12fc8a][_0xe32c('0x2c')];_0x356f02+=0x1,_0x2a2691=0x0){var _0x530573=_0x388c1b[_0x12fc8a][_0x356f02];if(_0x530573['type']){_0x530573[_0xe32c('0x18')]=_0x530573[_0xe32c('0x18')]['toLowerCase']();}var _0xbdcc76=[];var _0x345f22=[];delete _0x530573['id'];delete _0x530573['createdAt'];delete _0x530573[_0xe32c('0x2d')];var _0x929d38=_0x530573[_0xe32c('0x2e')]!==_0xe32c('0x2f')?[_0x530573[_0xe32c('0x2e')]]:_0x530573[_0xe32c('0x6')]?_['map'](_[_0xe32c('0xc')](_0x1e8789[_0xe32c('0x5')],{'IntervalId':_0x530573[_0xe32c('0x6')]}),_0xe32c('0x2e')):[];if(_0x530573['hasOwnProperty']('tag')){if(_0x530573[_0xe32c('0x30')]&&_0x530573[_0xe32c('0x30')]!=='--'){_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573['type'],'app':'Set','appdata':_0xe32c('0x31')+_0x530573['tag'],'context':_0x530573[_0xe32c('0x16')],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789['priority']+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}}if(_0x530573['type']==='outbound'&&_0x530573['hasOwnProperty'](_0xe32c('0x32'))){if(_0x530573[_0xe32c('0x32')]){_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':_0xe32c('0x33')+_0x530573[_0xe32c('0x32')]+')','context':_0x530573['context'],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}else{_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':_0xe32c('0x34'),'context':_0x530573[_0xe32c('0x16')],'exten':_0x530573['exten'],'priority':_0x929d38['length']+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}}if(_0x530573[_0xe32c('0xf')](_0xe32c('0x35'))){if(_0x36dcd5[_0xe32c('0x36')](_0x530573[_0xe32c('0x37')]['toLowerCase']())>=0x0&&_0x530573['appType']!==_0xe32c('0x38')){if(_0x530573['answer']){_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':'ExecIf','appdata':_0xe32c('0x39'),'context':_0x530573['context'],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38['length']+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x13'),'appdata':_0xe32c('0x3a'),'context':_0x530573['context'],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789['priority']+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}else{_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573[_0xe32c('0x18')],'app':_0xe32c('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x530573[_0xe32c('0x16')],'exten':_0x530573[_0xe32c('0xa')],'priority':_0x929d38[_0xe32c('0x2c')]+_0x1e8789[_0xe32c('0x10')]+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});_0xbdcc76[_0xe32c('0x1b')]({'type':_0x530573['type'],'app':_0xe32c('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x530573[_0xe32c('0x16')],'exten':_0x530573['exten'],'priority':_0x929d38['length']+_0x1e8789['priority']+_0x2a2691++,'VoiceExtensionId':_0x530573[_0xe32c('0x17')]});}}}for(var _0xfd7229=0x0;_0xfd7229<_0x929d38[_0xe32c('0x2c')];_0xfd7229+=0x1){var _0x2275e3=_0x1e8789[_0xe32c('0x10')]+_0x929d38[_0xe32c('0x2c')];var _0x506a35=_0xfd7229===_0x929d38['length']-0x1?_0x1e8789[_0xe32c('0x10')]+_0xbdcc76['length']+_0x345f22[_0xe32c('0x2c')]+0x2:_0x1e8789['priority']+_0xfd7229+0x1;_0xbdcc76['splice'](_0xfd7229,0x0,{'type':_0x530573['type'],'app':'GotoIfTime','appdata':_0x929d38[_0xfd7229]+'?'+_0x530573[_0xe32c('0x16')]+_0xe32c('0x3b')+_0x2275e3+':'+_0x530573[_0xe32c('0x16')]+',${EXTEN},'+_0x506a35,'exten':_0x530573[_0xe32c('0xa')],'context':_0x530573[_0xe32c('0x16')],'priority':_0x1e8789['priority']+_0xfd7229,'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0]['VoiceExtensionId']});}_0x530573[_0xe32c('0x10')]=_0xbdcc76[_0xe32c('0x2c')]?_[_0xe32c('0x3c')](_0xbdcc76)['priority']+0x1:_0x1e8789[_0xe32c('0x10')];_0x1e8789[_0xe32c('0x10')]=(_0x345f22['length']?_[_0xe32c('0x3c')](_0x345f22)[_0xe32c('0x10')]:_0x530573[_0xe32c('0x10')])+0x1;_0x1e8789['extensions']=_[_0xe32c('0x3d')](_0x1e8789[_0xe32c('0x12')],_0xbdcc76,[_0x530573],_0x345f22);}_0x1e8789[_0xe32c('0x12')][_0xe32c('0x1b')]({'type':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x18')],'app':_0xe32c('0x3e'),'exten':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0xa')],'context':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x16')],'priority':_0x1e8789['priority'],'VoiceExtensionId':_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]});_0x123dfa[_0xe32c('0x1b')](_0x388c1b[_0x12fc8a][0x0][_0xe32c('0x17')]);_0x39c95c=_[_0xe32c('0x3d')](_0x39c95c,_0x1e8789['extensions']);}}return _0x2234fb[_0xe32c('0x3f')](function(_0x369f68){return _0x2234fb[_0xe32c('0x1')][_0xe32c('0x7')][_0xe32c('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x123dfa}},'transaction':_0x369f68})[_0xe32c('0x4')](function(_0xa6eb4a){return _0x2234fb[_0xe32c('0x1')]['VoiceExtension'][_0xe32c('0x41')](_['sortBy'](_0x39c95c,_0xe32c('0x10')),{'transaction':_0x369f68});});});})[_0xe32c('0x42')](function(_0x8cd9b){console[_0xe32c('0x43')](_0x8cd9b);});}exports[_0xe32c('0x44')]=rewrite; \ No newline at end of file +var _0x7149=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','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','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','extension','find','push','type','format','CDR(type)=%s','context','inbound','Set','CDR(routeid)=','priority','VoiceExtensionId','outbound','extensions','CDR(destination)=','cutdigits','${EXTEN}','ExecIf'];(function(_0x1e98a8,_0xdc9fa){var _0x5551c9=function(_0x22a675){while(--_0x22a675){_0x1e98a8['push'](_0x1e98a8['shift']());}};_0x5551c9(++_0xdc9fa);}(_0x7149,0x193));var _0x9714=function(_0x2daf29,_0x4ae526){_0x2daf29=_0x2daf29-0x0;var _0x6ea37d=_0x7149[_0x2daf29];return _0x6ea37d;};'use strict';var _=require(_0x9714('0x0'));var util=require(_0x9714('0x1'));function rewrite(_0x574b20,_0x424693){var _0x1de700=this;return _0x574b20[_0x9714('0x2')][_0x9714('0x3')][_0x9714('0x4')]({'raw':!![]})[_0x9714('0x5')](function(_0x19ce2b){_0x1de700[_0x9714('0x6')]=_0x19ce2b;return _0x574b20['models'][_0x9714('0x7')]['findAll']({'where':{'IntervalId':_0x424693[_0x9714('0x8')]},'raw':!![]});})[_0x9714('0x5')](function(_0x557419){return _0x574b20[_0x9714('0x2')][_0x9714('0x7')][_0x9714('0x4')]({'where':{'exten':{'$in':_[_0x9714('0x9')](_[_0x9714('0xa')](_0x557419,_0x9714('0xb')))}},'order':[{'raw':_0x9714('0xc')}],'raw':!![]});})[_0x9714('0x5')](function(_0x50960e){var _0x52aad5=_[_0x9714('0xd')](_0x50960e,{'priority':'1'});var _0x35392a=_[_0x9714('0xd')](_0x50960e,{'isApp':0x1});var _0x109350=_['groupBy'](_0x35392a,_0x9714('0xb'));var _0x20dc7a=[_0x9714('0xe'),_0x9714('0xf')];var _0x414da1=[];var _0x574804=[];for(var _0x3867b9 in _0x109350){if(_0x109350[_0x9714('0x10')](_0x3867b9)){_0x1de700['priority']=0x2;_0x1de700['extensions']=[];_0x1de700[_0x9714('0x11')]=_[_0x9714('0x12')](_0x52aad5,{'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')]});_0x1de700['extensions'][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':'Set','appdata':util[_0x9714('0x15')](_0x9714('0x16'),_0x109350[_0x3867b9][0x0][_0x9714('0x14')]),'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700['priority']++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0]['VoiceExtensionId']});if(_0x109350[_0x3867b9][0x0]['type']===_0x9714('0x18')){_0x1de700['extensions'][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':_0x9714('0x1a')+_0x109350[_0x3867b9][0x0]['VoiceExtensionId'],'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});}else if(_0x109350[_0x3867b9][0x0][_0x9714('0x14')]===_0x9714('0x1d')){if(_0x1de700[_0x9714('0x11')]){_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':_0x9714('0x1f')+(_0x1de700[_0x9714('0x11')][_0x9714('0x20')]?'${EXTEN:'+_0x1de700[_0x9714('0x11')][_0x9714('0x20')]+'}':_0x9714('0x21')),'context':_0x109350[_0x3867b9][0x0]['context'],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});}_0x1de700[_0x9714('0x1e')]['push']({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':'Set','appdata':_0x9714('0x1a')+_0x109350[_0x3867b9][0x0]['VoiceExtensionId'],'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});var _0x266649=_0x1de700['priority']++;_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x22'),'appdata':_0x9714('0x23')+(_0x266649+0x2)+_0x9714('0x24')+(_0x266649+0x1)+')','context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x266649,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});if(_0x1de700[_0x9714('0x11')]){_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':_0x1de700['extension'][_0x9714('0x20')]?'CDR(prefix)=${EXTEN:0:'+_0x1de700[_0x9714('0x11')][_0x9714('0x20')]+'}':_0x9714('0x25'),'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0]['exten'],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});}_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':_0x9714('0x26')+_0x109350[_0x3867b9][0x0][_0x9714('0x1c')],'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700['priority']++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});if(_0x1de700['extension']&&_0x1de700[_0x9714('0x11')]['hasOwnProperty'](_0x9714('0x27'))&&_0x1de700[_0x9714('0x11')][_0x9714('0x27')]!==_0x9714('0x28')){_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':_0x9714('0x29'),'context':_0x109350[_0x3867b9][0x0]['context'],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0]['VoiceExtensionId']});_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1de700[_0x9714('0x11')][_0x9714('0x27')]||_0x9714('0x2a'),'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0]['VoiceExtensionId']});}}_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':'Set','appdata':_0x9714('0x2b'),'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700['priority']++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':'Set','appdata':_0x9714('0x2c'),'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});_0x1de700['extensions'][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0][_0x9714('0x14')],'app':'Set','appdata':_0x9714('0x2d'),'context':_0x109350[_0x3867b9][0x0][_0x9714('0x17')],'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'priority':_0x1de700[_0x9714('0x1b')]++,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});for(var _0x196a4d=0x0,_0x2ee928=0x0;_0x196a4d<_0x109350[_0x3867b9][_0x9714('0x2e')];_0x196a4d+=0x1,_0x2ee928=0x0){var _0x1ece6f=_0x109350[_0x3867b9][_0x196a4d];if(_0x1ece6f['type']){_0x1ece6f['type']=_0x1ece6f[_0x9714('0x14')][_0x9714('0x2f')]();}var _0x275672=[];var _0x48ff54=[];delete _0x1ece6f['id'];delete _0x1ece6f[_0x9714('0x30')];delete _0x1ece6f[_0x9714('0x31')];var _0xb09b2c=_0x1ece6f[_0x9714('0x32')]!==_0x9714('0x33')?[_0x1ece6f['interval']]:_0x1ece6f[_0x9714('0x8')]?_[_0x9714('0xa')](_[_0x9714('0xd')](_0x1de700[_0x9714('0x6')],{'IntervalId':_0x1ece6f[_0x9714('0x8')]}),_0x9714('0x32')):[];if(_0x1ece6f[_0x9714('0x10')](_0x9714('0x34'))){if(_0x1ece6f[_0x9714('0x34')]&&_0x1ece6f[_0x9714('0x34')]!=='--'){_0x275672[_0x9714('0x13')]({'type':_0x1ece6f[_0x9714('0x14')],'app':_0x9714('0x19'),'appdata':_0x9714('0x35')+_0x1ece6f[_0x9714('0x34')],'context':_0x1ece6f[_0x9714('0x17')],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700[_0x9714('0x1b')]+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});}}if(_0x1ece6f['type']===_0x9714('0x1d')&&_0x1ece6f[_0x9714('0x10')](_0x9714('0x36'))){if(_0x1ece6f[_0x9714('0x36')]){_0x275672['push']({'type':_0x1ece6f[_0x9714('0x14')],'app':_0x9714('0x22'),'appdata':_0x9714('0x37')+_0x1ece6f[_0x9714('0x36')]+')','context':_0x1ece6f[_0x9714('0x17')],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700['priority']+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});}else{_0x275672[_0x9714('0x13')]({'type':_0x1ece6f['type'],'app':'ExecIf','appdata':_0x9714('0x38'),'context':_0x1ece6f[_0x9714('0x17')],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700[_0x9714('0x1b')]+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});}}if(_0x1ece6f[_0x9714('0x10')](_0x9714('0x39'))){if(_0x20dc7a['indexOf'](_0x1ece6f[_0x9714('0x3a')][_0x9714('0x2f')]())>=0x0&&_0x1ece6f[_0x9714('0x3b')]!==_0x9714('0x3c')){if(_0x1ece6f[_0x9714('0x39')]){_0x275672[_0x9714('0x13')]({'type':_0x1ece6f[_0x9714('0x14')],'app':_0x9714('0x22'),'appdata':_0x9714('0x3d'),'context':_0x1ece6f[_0x9714('0x17')],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700[_0x9714('0x1b')]+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});_0x275672[_0x9714('0x13')]({'type':_0x1ece6f['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1ece6f[_0x9714('0x17')],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700[_0x9714('0x1b')]+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});}else{_0x275672[_0x9714('0x13')]({'type':_0x1ece6f['type'],'app':_0x9714('0x22'),'appdata':_0x9714('0x3e'),'context':_0x1ece6f[_0x9714('0x17')],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700[_0x9714('0x1b')]+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});_0x275672['push']({'type':_0x1ece6f[_0x9714('0x14')],'app':'Set','appdata':_0x9714('0x3f'),'context':_0x1ece6f['context'],'exten':_0x1ece6f[_0x9714('0xb')],'priority':_0xb09b2c[_0x9714('0x2e')]+_0x1de700[_0x9714('0x1b')]+_0x2ee928++,'VoiceExtensionId':_0x1ece6f[_0x9714('0x1c')]});}}}for(var _0x4916b9=0x0;_0x4916b9<_0xb09b2c['length'];_0x4916b9+=0x1){var _0x1b818e=_0x1de700[_0x9714('0x1b')]+_0xb09b2c[_0x9714('0x2e')];var _0x3378e0=_0x4916b9===_0xb09b2c[_0x9714('0x2e')]-0x1?_0x1de700['priority']+_0x275672[_0x9714('0x2e')]+_0x48ff54[_0x9714('0x2e')]+0x2:_0x1de700[_0x9714('0x1b')]+_0x4916b9+0x1;_0x275672['splice'](_0x4916b9,0x0,{'type':_0x1ece6f[_0x9714('0x14')],'app':'GotoIfTime','appdata':_0xb09b2c[_0x4916b9]+'?'+_0x1ece6f['context']+_0x9714('0x40')+_0x1b818e+':'+_0x1ece6f[_0x9714('0x17')]+_0x9714('0x40')+_0x3378e0,'exten':_0x1ece6f['exten'],'context':_0x1ece6f[_0x9714('0x17')],'priority':_0x1de700['priority']+_0x4916b9,'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});}_0x1ece6f['priority']=_0x275672[_0x9714('0x2e')]?_[_0x9714('0x41')](_0x275672)[_0x9714('0x1b')]+0x1:_0x1de700[_0x9714('0x1b')];_0x1de700[_0x9714('0x1b')]=(_0x48ff54[_0x9714('0x2e')]?_[_0x9714('0x41')](_0x48ff54)['priority']:_0x1ece6f[_0x9714('0x1b')])+0x1;_0x1de700[_0x9714('0x1e')]=_[_0x9714('0x42')](_0x1de700[_0x9714('0x1e')],_0x275672,[_0x1ece6f],_0x48ff54);}_0x1de700[_0x9714('0x1e')][_0x9714('0x13')]({'type':_0x109350[_0x3867b9][0x0]['type'],'app':_0x9714('0x43'),'exten':_0x109350[_0x3867b9][0x0][_0x9714('0xb')],'context':_0x109350[_0x3867b9][0x0]['context'],'priority':_0x1de700[_0x9714('0x1b')],'VoiceExtensionId':_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]});_0x414da1[_0x9714('0x13')](_0x109350[_0x3867b9][0x0][_0x9714('0x1c')]);_0x574804=_[_0x9714('0x42')](_0x574804,_0x1de700[_0x9714('0x1e')]);}}return _0x574b20['transaction'](function(_0x1fbf6c){return _0x574b20[_0x9714('0x2')][_0x9714('0x7')][_0x9714('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x414da1}},'transaction':_0x1fbf6c})[_0x9714('0x5')](function(_0x3de5d1){return _0x574b20[_0x9714('0x2')]['VoiceExtension'][_0x9714('0x45')](_[_0x9714('0x46')](_0x574804,_0x9714('0x1b')),{'transaction':_0x1fbf6c});});});})[_0x9714('0x47')](function(_0x5e5731){console['error'](_0x5e5731);});}exports[_0x9714('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 6581ee9..ed15e3b 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 _0x26d9=['register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','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','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','insert','into','str','calleridnum','cm_hopper_final','\x20=\x20?','phone\x20NOT\x20IN\x20(?)','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','VoiceQueueId','query','all','BlackLists','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket'];(function(_0xe540b8,_0x21cb53){var _0x10bae7=function(_0x9aecc0){while(--_0x9aecc0){_0xe540b8['push'](_0xe540b8['shift']());}};_0x10bae7(++_0x21cb53);}(_0x26d9,0x13d));var _0x926d=function(_0x283fe0,_0x341361){_0x283fe0=_0x283fe0-0x0;var _0x31d280=_0x26d9[_0x283fe0];return _0x31d280;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x926d('0x0'));var fs=require('fs');var squel=require(_0x926d('0x1'));var Papa=require(_0x926d('0x2'));var Redis=require(_0x926d('0x3'));var db=require(_0x926d('0x4'))['db'];var config=require(_0x926d('0x5'));var logger=require('../../../config/logger')('api');config[_0x926d('0x6')]=_['defaults'](config[_0x926d('0x6')],{'host':_0x926d('0x7'),'port':0x18eb});var socket=require(_0x926d('0x8'))(new Redis(config['redis']));require(_0x926d('0x9'))[_0x926d('0xa')](socket);try{if(!process[_0x926d('0xb')][0x2]||process[_0x926d('0xb')][0x2]===_0x926d('0xc')||process[_0x926d('0xb')][0x2]==='null'){throw new Error(_0x926d('0xd'));}var FILEPATH=process[_0x926d('0xb')][0x2];if(!process['argv'][0x3]||process[_0x926d('0xb')][0x3]==='undefined'||process[_0x926d('0xb')][0x3]===_0x926d('0xe')||!process[_0x926d('0xb')][0x4]||process[_0x926d('0xb')][0x4]===_0x926d('0xc')||process[_0x926d('0xb')][0x4]===_0x926d('0xe')){throw new Error(_0x926d('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x926d('0x10')](','),process['argv'][0x4][_0x926d('0x10')](','));if(!process['argv'][0x5]||process[_0x926d('0xb')][0x5]===_0x926d('0xc')||process['argv'][0x5]===_0x926d('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x926d('0xb')][0x5];var COMPANYID=process[_0x926d('0xb')][0x6]&&process[_0x926d('0xb')][0x6]!==_0x926d('0xc')&&process[_0x926d('0xb')][0x6]!==_0x926d('0xe')?process[_0x926d('0xb')][0x6]:null;var DUPLICATES=process[_0x926d('0xb')][0x7]&&process[_0x926d('0xb')][0x7]!==_0x926d('0xc')&&process[_0x926d('0xb')][0x7]!==_0x926d('0xe')?process[_0x926d('0xb')][0x7]:null;if(!process[_0x926d('0xb')][0x8]||process[_0x926d('0xb')][0x8]===_0x926d('0xc')||process[_0x926d('0xb')][0x8]===_0x926d('0xe')){throw new Error(_0x926d('0x11'));}var SOCKET_TIMESTAMP=process[_0x926d('0xb')][0x8];}catch(_0x439467){logger[_0x926d('0x12')](_0x439467);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(_0x5275be,_0x207a7d,_0x5660ec,_0x19543b){var _0x57c7ba={'message':_0x207a7d};_0x57c7ba[_0x5275be]=!![];if(_0x5660ec){_0x57c7ba[_0x926d('0x13')]=_0x5660ec;}if(_0x19543b){_0x57c7ba[_0x926d('0x14')]=_0x19543b;}return _0x57c7ba;}function isEmail(_0x27c983){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))*$/[_0x926d('0x15')](_0x27c983);}function checkRow(_0x157415,_0x46205e,_0x74be01){return new BPromise(function(_0x280617,_0x224e3d){if(_[_0x926d('0x16')](_0x157415)){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x17'),null,_0x74be01));}if(_0x157415[_0x926d('0x18')]&&_0x157415[_0x926d('0x18')][_0x926d('0x19')]){var _0xf6c5b7=_[_0x926d('0x1a')](_0x157415[_0x926d('0x18')],_0x926d('0x1b'))['join'](';');return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0xf6c5b7,null,_0x74be01));}var _0xfe2ede={};for(var _0xb7018b in FIELDS){if(FIELDS[_0x926d('0x1c')](_0xb7018b)&&FIELDS[_0xb7018b]){_0xfe2ede[_0xb7018b]=_0x157415[_0x926d('0x1d')][0x0][FIELDS[_0xb7018b]]||_0x157415[_0x926d('0x1d')][0x0]['\ufeff'+FIELDS[_0xb7018b]];}}if(!_0xfe2ede[_0x926d('0x1e')]){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x1f'),null,_0x74be01));}if(!_0xfe2ede['phone']){return _0x224e3d(handleCheckRowError('error',_0x926d('0x20'),null,_0x74be01));}if(_0xfe2ede['birthDate']){var _0x1cf4ff=moment(_0xfe2ede[_0x926d('0x21')],_0x926d('0x22'));if(!_0x1cf4ff[_0x926d('0x23')]()){return _0x224e3d(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x74be01));}}if(_0xfe2ede['email']){if(!isEmail(_0xfe2ede[_0x926d('0x24')])){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x25'),null,_0x74be01));}}_0xfe2ede[_0x926d('0x26')]=LISTID;_0xfe2ede[_0x926d('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x926d('0x19')]&&_0x46205e){var _0x26c288={};for(var _0x55034f=0x0,_0x3037c3=DUPLICATES[_0x926d('0x19')];_0x55034f<_0x3037c3;_0x55034f+=0x1){_0x26c288[DUPLICATES[_0x55034f]]=_0xfe2ede[DUPLICATES[_0x55034f]];}var _0x3316d5=_['find'](_0x46205e,_0x26c288);if(_0x3316d5){return _0x224e3d(handleCheckRowError(_0x926d('0x28'),'Duplicate\x20Contact',_0x3316d5,_0x74be01));}}return db[_0x926d('0x29')][_0x926d('0x2a')](_0xfe2ede,{'raw':!![],'hooks':![],'fields':_[_0x926d('0x2b')](_0xfe2ede)})[_0x926d('0x2c')](function(_0x30bda4){if(DUPLICATES&&DUPLICATES['length']&&_0x46205e){_0x46205e[_0x926d('0x2d')](_[_0x926d('0x2e')](_0xfe2ede,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x30bda4['id'];return _0x280617();})[_0x926d('0x2f')](function(_0x483fac){return _0x224e3d(handleCheckRowError(_0x926d('0x12'),_0x926d('0x30')+(_0x483fac[_0x926d('0x1b')]||JSON[_0x926d('0x31')](_0x483fac)),null,_0x74be01));});});}function checkHopper(){function _0x4b4482(){return function(_0x33c12d){logger[_0x926d('0x12')](_0x926d('0x32'),_0x926d('0x33'),util[_0x926d('0x34')](_0x33c12d,{'showHidden':![],'depth':null}));};}var _0x4baf49=function(_0x247dbc,_0x4ec383){var _0x251220=squel['insert']()['into'](_0x926d('0x35'))[_0x926d('0x36')]([_0x926d('0x37'),'scheduledAt',_0x926d('0x38'),'ListId',_0x4ec383,_0x926d('0x39'),_0x926d('0x3a')],squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'),_0x926d('0x37'))[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3e'))[_0x926d('0x3c')]('id',_0x926d('0x38'))['field'](LISTID[_0x926d('0x3f')](),'ListId')[_0x926d('0x3c')](_0x247dbc['id'][_0x926d('0x3f')](),_0x4ec383)[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x39'))[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3a'))[_0x926d('0x40')](_0x926d('0x41'))[_0x926d('0x42')](_0x926d('0x43'))[_0x926d('0x42')](_0x926d('0x44'),LISTID[_0x926d('0x3f')]())[_0x926d('0x42')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'))[_0x926d('0x40')](_0x926d('0x35'))['where'](_0x4ec383+'\x20=\x20?',_0x247dbc['id'][_0x926d('0x3f')]())))[_0x926d('0x3f')]();return _0x251220;};var _0x392fa1=function(_0x2eed56,_0x458b38){var _0x5951c7=squel[_0x926d('0x45')]()[_0x926d('0x46')](_0x926d('0x35'))[_0x926d('0x36')](['phone','scheduledAt','ContactId',_0x926d('0x26'),_0x458b38,_0x926d('0x39'),_0x926d('0x3a')],squel['select']()['field'](_0x926d('0x37'),'phone')[_0x926d('0x3c')]('NOW()',_0x926d('0x3e'))['field']('id','ContactId')[_0x926d('0x3c')](LISTID[_0x926d('0x3f')](),_0x926d('0x26'))[_0x926d('0x3c')](_0x2eed56['id'][_0x926d('0x3f')](),_0x458b38)[_0x926d('0x3c')](_0x926d('0x3d'),'createdAt')[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3a'))[_0x926d('0x40')](_0x926d('0x41'))[_0x926d('0x42')](_0x926d('0x43'))[_0x926d('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0x926d('0x42')]('id\x20IN\x20?',squel[_0x926d('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0x926d('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x48'))[_0x926d('0x40')](_0x926d('0x49'))[_0x926d('0x42')](_0x458b38+_0x926d('0x4a'),_0x2eed56['id'][_0x926d('0x3f')]()))[_0x926d('0x42')](_0x926d('0x4b'),squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'))[_0x926d('0x40')](_0x926d('0x35'))[_0x926d('0x42')](_0x458b38+_0x926d('0x4a'),_0x2eed56['id'][_0x926d('0x3f')]())))[_0x926d('0x3f')]();return _0x5951c7;};function _0x4d6a04(_0x287a27,_0x36d847){var _0x5b878e=squel[_0x926d('0x45')]()[_0x926d('0x46')](_0x926d('0x35'))[_0x926d('0x36')]([_0x926d('0x37'),'scheduledAt','ContactId',_0x926d('0x26'),_0x36d847,_0x926d('0x39'),'updatedAt'],squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'),_0x926d('0x37'))['field'](_0x926d('0x3d'),_0x926d('0x3e'))['field']('id',_0x926d('0x38'))[_0x926d('0x3c')](LISTID[_0x926d('0x3f')](),_0x926d('0x26'))[_0x926d('0x3c')](_0x287a27['id']['toString'](),_0x36d847)[_0x926d('0x3c')]('NOW()',_0x926d('0x39'))[_0x926d('0x3c')]('NOW()','updatedAt')[_0x926d('0x40')](_0x926d('0x41'))[_0x926d('0x42')]('deletedAt\x20IS\x20NULL')[_0x926d('0x42')](_0x926d('0x44'),LISTID[_0x926d('0x3f')]())[_0x926d('0x42')](_0x926d('0x4c'),squel[_0x926d('0x47')](hopperContacts))['where'](_0x926d('0x4d')))[_0x926d('0x3f')]();return _0x5b878e;}function _0x447205(_0x3ed7fc,_0xb77a4f){var _0xf0a67b=squel[_0x926d('0x45')]()[_0x926d('0x46')](_0x926d('0x4e'))[_0x926d('0x36')]([_0x926d('0x37'),_0x926d('0x38'),_0x926d('0x26'),_0xb77a4f,'createdAt','updatedAt'],squel[_0x926d('0x3b')]()[_0x926d('0x3c')](_0x926d('0x37'),_0x926d('0x37'))[_0x926d('0x3c')]('id','ContactId')['field'](LISTID[_0x926d('0x3f')](),_0x926d('0x26'))['field'](_0x3ed7fc['id'][_0x926d('0x3f')](),_0xb77a4f)[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x39'))[_0x926d('0x3c')](_0x926d('0x3d'),_0x926d('0x3a'))['from'](_0x926d('0x41'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x926d('0x3f')]())[_0x926d('0x42')]('id\x20IN\x20?',squel[_0x926d('0x47')](hopperContacts))[_0x926d('0x42')](_0x926d('0x4d')))[_0x926d('0x3f')]();return _0xf0a67b;}return db[_0x926d('0x4f')][_0x926d('0x50')]({'where':{'type':_0x926d('0x51')},'attributes':['id',_0x926d('0x52')],'include':[{'model':db[_0x926d('0x53')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x5e8eb3){var _0x293135=[];if(_0x5e8eb3){var _0x57ede0;for(var _0x3aaca3=0x0,_0x49305d;_0x3aaca3<_0x5e8eb3['length'];_0x3aaca3+=0x1){_0x49305d=_0x5e8eb3[_0x3aaca3][_0x926d('0x54')]({'plain':!![]});switch(_0x49305d[_0x926d('0x52')]){case _0x926d('0x55'):_0x293135[_0x926d('0x2d')](db[_0x926d('0x56')]['query'](_0x392fa1(_0x49305d,_0x926d('0x57')))['then'](function(){})[_0x926d('0x2f')](_0x4b4482()));break;case'onlyIfOpen':_0x293135['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x4baf49(_0x49305d,_0x926d('0x57')))[_0x926d('0x2c')](function(){})['catch'](_0x4b4482()));break;default:_0x293135['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x4d6a04(_0x49305d,_0x926d('0x57')))[_0x926d('0x2c')](function(){})['catch'](_0x4b4482()));}}}return _0x293135;})[_0x926d('0x59')]()[_0x926d('0x2c')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x926d('0x51')},'attributes':['id'],'include':[{'model':db[_0x926d('0x53')],'as':_0x926d('0x5a'),'where':{'id':LISTID}}]})[_0x926d('0x2c')](function(_0x50b13f){var _0x468f57=[];if(_0x50b13f){var _0xb5250b;for(var _0x1d817a=0x0,_0xa4fdca;_0x1d817a<_0x50b13f[_0x926d('0x19')];_0x1d817a+=0x1){_0xa4fdca=_0x50b13f[_0x1d817a][_0x926d('0x54')]({'plain':!![]});_0x468f57['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x447205(_0xa4fdca,_0x926d('0x57')))[_0x926d('0x2c')](function(){})[_0x926d('0x2f')](_0x4b4482()));}}return _0x468f57;})['all']();})['then'](function(){return db[_0x926d('0x5b')][_0x926d('0x50')]({'attributes':['id',_0x926d('0x52')],'include':[{'model':db[_0x926d('0x53')],'as':_0x926d('0x5c'),'where':{'id':LISTID}}]})[_0x926d('0x2c')](function(_0x1a6e4d){var _0x504fbf=[];if(_0x1a6e4d){for(var _0x406ee2=0x0,_0x2d4dce;_0x406ee2<_0x1a6e4d['length'];_0x406ee2+=0x1){_0x2d4dce=_0x1a6e4d[_0x406ee2][_0x926d('0x54')]({'plain':!![]});switch(_0x2d4dce[_0x926d('0x52')]){case _0x926d('0x55'):_0x504fbf['push'](db[_0x926d('0x56')][_0x926d('0x58')](_0x392fa1(_0x2d4dce,_0x926d('0x5d')))[_0x926d('0x2c')](function(){})['catch'](_0x4b4482()));break;case _0x926d('0x5e'):_0x504fbf[_0x926d('0x2d')](db[_0x926d('0x56')][_0x926d('0x58')](_0x4baf49(_0x2d4dce,'CampaignId'))[_0x926d('0x2c')](function(){})[_0x926d('0x2f')](_0x4b4482()));break;default:_0x504fbf[_0x926d('0x2d')](db[_0x926d('0x56')][_0x926d('0x58')](_0x4d6a04(_0x2d4dce,'CampaignId'))[_0x926d('0x2c')](function(){})[_0x926d('0x2f')](_0x4b4482()));}}}return _0x504fbf;})[_0x926d('0x59')]();})[_0x926d('0x2c')](function(){return db[_0x926d('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x926d('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x18e59f){var _0x414a37=[];if(_0x18e59f){for(var _0x2266d6=0x0,_0x4017f8;_0x2266d6<_0x18e59f[_0x926d('0x19')];_0x2266d6+=0x1){_0x4017f8=_0x18e59f[_0x2266d6]['get']({'plain':!![]});_0x414a37[_0x926d('0x2d')](db['sequelize'][_0x926d('0x58')](_0x447205(_0x4017f8,'CampaignId'))['then'](function(){})[_0x926d('0x2f')](_0x4b4482()));}}return _0x414a37;})[_0x926d('0x59')]();})[_0x926d('0x2f')](function(_0x874a8e){logger[_0x926d('0x12')](_0x926d('0x5f'),'generalCheckHopper',_0x874a8e['message']);});}var processPromises=function(_0x305398){return BPromise[_0x926d('0x59')](promises)[_0x926d('0x2c')](function(_0x1f2c71){})['catch'](function(_0x480fcd){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x926d('0x31')](_0x480fcd));})[_0x926d('0x60')](function(){socket[_0x926d('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x305398){return _0x305398[_0x926d('0x62')]();}});};var endCsv=function(){return BPromise[_0x926d('0x63')]()[_0x926d('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x926d('0x61')](_0x926d('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x926d('0x65')](FILEPATH);}catch(_0x58b703){logger[_0x926d('0x12')](_0x926d('0x66'),JSON[_0x926d('0x31')](_0x58b703));}finally{process['exit'](0x0);}});};process['on'](_0x926d('0x67'),function(){logger[_0x926d('0x68')](_0x926d('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0x926d('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x926d('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x926d('0x2c')](function(_0x2718a1){var _0x4f13cf=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x926d('0x6a')](_0x4f13cf,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f8055,_0x4cd739){total+=0x1;var _0x1c78a3=total;promises[_0x926d('0x2d')](checkRow(_0x2f8055,_0x2718a1,_0x1c78a3)[_0x926d('0x2c')](function(){success+=0x1;})[_0x926d('0x2f')](function(_0x2d8b9c){if(_0x2d8b9c[_0x926d('0x12')]){errors+=0x1;delete _0x2d8b9c[_0x926d('0x12')];}else if(_0x2d8b9c['duplicate']){duplicates+=0x1;delete _0x2d8b9c[_0x926d('0x28')];}rows[_0x926d('0x2d')](_0x2d8b9c);}));if(total%0xc8===0x0){_0x4cd739['pause']();return processPromises(_0x4cd739);}},'complete':function(){return processPromises()[_0x926d('0x2c')](function(){logger[_0x926d('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1c61af,_0x31a0f5){logger[_0x926d('0x68')](_0x926d('0x6b'),JSON[_0x926d('0x31')](_0x1c61af));endCsv();}});})[_0x926d('0x2f')](function(_0x480aa9){logger['error'](_0x926d('0x6c'),JSON[_0x926d('0x31')](_0x480aa9));});}main(); \ No newline at end of file +var _0xc48f=['VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','VoiceQueueId','catch','query','all','BlackLists','Campaign','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','message','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','defaults','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','length','join','hasOwnProperty','data','firstName','phone','birthDate','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','keys','then','push','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_contacts','id\x20IN\x20?','str','cm_hopper_black'];(function(_0x2d93dc,_0x1e9771){var _0x45cf53=function(_0x15e7fb){while(--_0x15e7fb){_0x2d93dc['push'](_0x2d93dc['shift']());}};_0x45cf53(++_0x1e9771);}(_0xc48f,0x159));var _0xfc48=function(_0x45d388,_0x2e53c8){_0x45d388=_0x45d388-0x0;var _0xec117c=_0xc48f[_0x45d388];return _0xec117c;};'use strict';var BPromise=require(_0xfc48('0x0'));var util=require('util');var _=require(_0xfc48('0x1'));var fs=require('fs');var squel=require(_0xfc48('0x2'));var Papa=require(_0xfc48('0x3'));var Redis=require(_0xfc48('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xfc48('0x5'));var logger=require(_0xfc48('0x6'))('api');config['redis']=_[_0xfc48('0x7')](config['redis'],{'host':_0xfc48('0x8'),'port':0x18eb});var socket=require(_0xfc48('0x9'))(new Redis(config[_0xfc48('0xa')]));require(_0xfc48('0xb'))['register'](socket);try{if(!process[_0xfc48('0xc')][0x2]||process[_0xfc48('0xc')][0x2]===_0xfc48('0xd')||process[_0xfc48('0xc')][0x2]==='null'){throw new Error(_0xfc48('0xe'));}var FILEPATH=process[_0xfc48('0xc')][0x2];if(!process[_0xfc48('0xc')][0x3]||process[_0xfc48('0xc')][0x3]===_0xfc48('0xd')||process[_0xfc48('0xc')][0x3]===_0xfc48('0xf')||!process['argv'][0x4]||process[_0xfc48('0xc')][0x4]===_0xfc48('0xd')||process[_0xfc48('0xc')][0x4]===_0xfc48('0xf')){throw new Error(_0xfc48('0x10'));}var FIELDS=_[_0xfc48('0x11')](process[_0xfc48('0xc')][0x3]['split'](','),process[_0xfc48('0xc')][0x4][_0xfc48('0x12')](','));if(!process['argv'][0x5]||process[_0xfc48('0xc')][0x5]===_0xfc48('0xd')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xfc48('0xc')][0x6]&&process[_0xfc48('0xc')][0x6]!=='undefined'&&process[_0xfc48('0xc')][0x6]!==_0xfc48('0xf')?process[_0xfc48('0xc')][0x6]:null;var DUPLICATES=process[_0xfc48('0xc')][0x7]&&process[_0xfc48('0xc')][0x7]!==_0xfc48('0xd')&&process[_0xfc48('0xc')][0x7]!==_0xfc48('0xf')?process['argv'][0x7]:null;if(!process[_0xfc48('0xc')][0x8]||process[_0xfc48('0xc')][0x8]===_0xfc48('0xd')||process['argv'][0x8]==='null'){throw new Error(_0xfc48('0x13'));}var SOCKET_TIMESTAMP=process[_0xfc48('0xc')][0x8];}catch(_0x4b446d){logger[_0xfc48('0x14')](_0x4b446d);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(_0x57c816,_0x46851c,_0x173896,_0x527876){var _0x170ec1={'message':_0x46851c};_0x170ec1[_0x57c816]=!![];if(_0x173896){_0x170ec1[_0xfc48('0x15')]=_0x173896;}if(_0x527876){_0x170ec1['index']=_0x527876;}return _0x170ec1;}function isEmail(_0xe0a280){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))*$/[_0xfc48('0x16')](_0xe0a280);}function checkRow(_0x201754,_0x2953ba,_0x45f123){return new BPromise(function(_0x36376e,_0x298e40){if(_[_0xfc48('0x17')](_0x201754)){return _0x298e40(handleCheckRowError(_0xfc48('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x45f123));}if(_0x201754[_0xfc48('0x18')]&&_0x201754[_0xfc48('0x18')][_0xfc48('0x19')]){var _0x5c578b=_['map'](_0x201754[_0xfc48('0x18')],'message')[_0xfc48('0x1a')](';');return _0x298e40(handleCheckRowError(_0xfc48('0x14'),_0x5c578b,null,_0x45f123));}var _0x26c4f7={};for(var _0x353756 in FIELDS){if(FIELDS[_0xfc48('0x1b')](_0x353756)&&FIELDS[_0x353756]){_0x26c4f7[_0x353756]=_0x201754[_0xfc48('0x1c')][0x0][FIELDS[_0x353756]]||_0x201754[_0xfc48('0x1c')][0x0]['\ufeff'+FIELDS[_0x353756]];}}if(!_0x26c4f7[_0xfc48('0x1d')]){return _0x298e40(handleCheckRowError(_0xfc48('0x14'),'firstName\x20not\x20specified!',null,_0x45f123));}if(!_0x26c4f7[_0xfc48('0x1e')]){return _0x298e40(handleCheckRowError(_0xfc48('0x14'),'phone\x20not\x20specified!',null,_0x45f123));}if(_0x26c4f7['birthDate']){var _0x5a03cd=moment(_0x26c4f7[_0xfc48('0x1f')],'YYYY-MM-DD');if(!_0x5a03cd[_0xfc48('0x20')]()){return _0x298e40(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x45f123));}}if(_0x26c4f7[_0xfc48('0x21')]){if(!isEmail(_0x26c4f7[_0xfc48('0x21')])){return _0x298e40(handleCheckRowError('error',_0xfc48('0x22'),null,_0x45f123));}}_0x26c4f7[_0xfc48('0x23')]=LISTID;_0x26c4f7['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2953ba){var _0x4cf878={};for(var _0x406622=0x0,_0x5ce025=DUPLICATES[_0xfc48('0x19')];_0x406622<_0x5ce025;_0x406622+=0x1){_0x4cf878[DUPLICATES[_0x406622]]=_0x26c4f7[DUPLICATES[_0x406622]];}var _0x3f65c7=_[_0xfc48('0x24')](_0x2953ba,_0x4cf878);if(_0x3f65c7){return _0x298e40(handleCheckRowError('duplicate',_0xfc48('0x25'),_0x3f65c7,_0x45f123));}}return db['CmContact']['create'](_0x26c4f7,{'raw':!![],'hooks':![],'fields':_[_0xfc48('0x26')](_0x26c4f7)})[_0xfc48('0x27')](function(_0x397b5b){if(DUPLICATES&&DUPLICATES[_0xfc48('0x19')]&&_0x2953ba){_0x2953ba[_0xfc48('0x28')](_['pick'](_0x26c4f7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x397b5b['id'];return _0x36376e();})['catch'](function(_0x4abfc6){return _0x298e40(handleCheckRowError(_0xfc48('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x4abfc6['message']||JSON['stringify'](_0x4abfc6)),null,_0x45f123));});});}function checkHopper(){function _0x575852(){return function(_0x22aef1){logger['error'](_0xfc48('0x29'),_0xfc48('0x2a'),util[_0xfc48('0x2b')](_0x22aef1,{'showHidden':![],'depth':null}));};}var _0xd7d3d1=function(_0x58ed3c,_0x4a9582){var _0xf880cb=squel[_0xfc48('0x2c')]()[_0xfc48('0x2d')](_0xfc48('0x2e'))[_0xfc48('0x2f')]([_0xfc48('0x1e'),_0xfc48('0x30'),_0xfc48('0x31'),_0xfc48('0x23'),_0x4a9582,_0xfc48('0x32'),_0xfc48('0x33')],squel[_0xfc48('0x34')]()['field'](_0xfc48('0x1e'),_0xfc48('0x1e'))[_0xfc48('0x35')]('NOW()','scheduledAt')['field']('id',_0xfc48('0x31'))[_0xfc48('0x35')](LISTID[_0xfc48('0x36')](),'ListId')[_0xfc48('0x35')](_0x58ed3c['id'][_0xfc48('0x36')](),_0x4a9582)[_0xfc48('0x35')]('NOW()',_0xfc48('0x32'))[_0xfc48('0x35')](_0xfc48('0x37'),_0xfc48('0x33'))['from']('cm_contacts')[_0xfc48('0x38')](_0xfc48('0x39'))[_0xfc48('0x38')](_0xfc48('0x3a'),LISTID[_0xfc48('0x36')]())[_0xfc48('0x38')](_0xfc48('0x3b'))[_0xfc48('0x38')](_0xfc48('0x3c'),squel[_0xfc48('0x34')]()[_0xfc48('0x35')](_0xfc48('0x1e'))[_0xfc48('0x3d')](_0xfc48('0x2e'))[_0xfc48('0x38')](_0x4a9582+_0xfc48('0x3e'),_0x58ed3c['id'][_0xfc48('0x36')]())))[_0xfc48('0x36')]();return _0xf880cb;};var _0x30f804=function(_0x4703a0,_0x26253d){var _0xfef406=squel['insert']()['into'](_0xfc48('0x2e'))['fromQuery'](['phone',_0xfc48('0x30'),_0xfc48('0x31'),_0xfc48('0x23'),_0x26253d,'createdAt','updatedAt'],squel[_0xfc48('0x34')]()['field']('phone',_0xfc48('0x1e'))[_0xfc48('0x35')](_0xfc48('0x37'),_0xfc48('0x30'))[_0xfc48('0x35')]('id',_0xfc48('0x31'))[_0xfc48('0x35')](LISTID['toString'](),_0xfc48('0x23'))[_0xfc48('0x35')](_0x4703a0['id'][_0xfc48('0x36')](),_0x26253d)[_0xfc48('0x35')](_0xfc48('0x37'),_0xfc48('0x32'))[_0xfc48('0x35')]('NOW()',_0xfc48('0x33'))['from'](_0xfc48('0x3f'))['where'](_0xfc48('0x39'))[_0xfc48('0x38')](_0xfc48('0x3a'),LISTID[_0xfc48('0x36')]())[_0xfc48('0x38')](_0xfc48('0x40'),squel[_0xfc48('0x41')](hopperContacts))[_0xfc48('0x38')](_0xfc48('0x3b'))[_0xfc48('0x38')](_0xfc48('0x3c'),squel[_0xfc48('0x34')]()['field']('calleridnum')['from']('cm_hopper_final')['where'](_0x26253d+_0xfc48('0x3e'),_0x4703a0['id'][_0xfc48('0x36')]()))[_0xfc48('0x38')](_0xfc48('0x3c'),squel[_0xfc48('0x34')]()[_0xfc48('0x35')](_0xfc48('0x1e'))[_0xfc48('0x3d')](_0xfc48('0x2e'))[_0xfc48('0x38')](_0x26253d+_0xfc48('0x3e'),_0x4703a0['id'][_0xfc48('0x36')]())))[_0xfc48('0x36')]();return _0xfef406;};function _0x53c20f(_0x9ae381,_0x2f42a6){var _0x275a59=squel['insert']()['into'](_0xfc48('0x2e'))[_0xfc48('0x2f')]([_0xfc48('0x1e'),_0xfc48('0x30'),'ContactId','ListId',_0x2f42a6,_0xfc48('0x32'),'updatedAt'],squel[_0xfc48('0x34')]()[_0xfc48('0x35')]('phone',_0xfc48('0x1e'))[_0xfc48('0x35')]('NOW()',_0xfc48('0x30'))['field']('id',_0xfc48('0x31'))[_0xfc48('0x35')](LISTID[_0xfc48('0x36')](),'ListId')[_0xfc48('0x35')](_0x9ae381['id'][_0xfc48('0x36')](),_0x2f42a6)[_0xfc48('0x35')](_0xfc48('0x37'),'createdAt')['field']('NOW()',_0xfc48('0x33'))[_0xfc48('0x3d')](_0xfc48('0x3f'))[_0xfc48('0x38')](_0xfc48('0x39'))['where'](_0xfc48('0x3a'),LISTID['toString']())['where'](_0xfc48('0x40'),squel[_0xfc48('0x41')](hopperContacts))['where'](_0xfc48('0x3b')))[_0xfc48('0x36')]();return _0x275a59;}function _0x3d4d5d(_0x114067,_0x4a9b7b){var _0x44c016=squel[_0xfc48('0x2c')]()[_0xfc48('0x2d')](_0xfc48('0x42'))[_0xfc48('0x2f')](['phone','ContactId',_0xfc48('0x23'),_0x4a9b7b,_0xfc48('0x32'),_0xfc48('0x33')],squel[_0xfc48('0x34')]()[_0xfc48('0x35')](_0xfc48('0x1e'),_0xfc48('0x1e'))['field']('id',_0xfc48('0x31'))[_0xfc48('0x35')](LISTID['toString'](),_0xfc48('0x23'))[_0xfc48('0x35')](_0x114067['id'][_0xfc48('0x36')](),_0x4a9b7b)[_0xfc48('0x35')](_0xfc48('0x37'),'createdAt')[_0xfc48('0x35')]('NOW()','updatedAt')['from']('cm_contacts')['where'](_0xfc48('0x39'))[_0xfc48('0x38')](_0xfc48('0x3a'),LISTID['toString']())[_0xfc48('0x38')]('id\x20IN\x20?',squel[_0xfc48('0x41')](hopperContacts))[_0xfc48('0x38')](_0xfc48('0x3b')))[_0xfc48('0x36')]();return _0x44c016;}return db[_0xfc48('0x43')][_0xfc48('0x44')]({'where':{'type':_0xfc48('0x45')},'attributes':['id',_0xfc48('0x46')],'include':[{'model':db[_0xfc48('0x47')],'as':_0xfc48('0x48'),'where':{'id':LISTID}}]})[_0xfc48('0x27')](function(_0x1bc837){var _0x43ee7a=[];if(_0x1bc837){var _0x259957;for(var _0x4efb34=0x0,_0x31b78f;_0x4efb34<_0x1bc837[_0xfc48('0x19')];_0x4efb34+=0x1){_0x31b78f=_0x1bc837[_0x4efb34][_0xfc48('0x49')]({'plain':!![]});switch(_0x31b78f['dialCheckDuplicateType']){case'always':_0x43ee7a['push'](db[_0xfc48('0x4a')]['query'](_0x30f804(_0x31b78f,_0xfc48('0x4b')))[_0xfc48('0x27')](function(){})[_0xfc48('0x4c')](_0x575852()));break;case'onlyIfOpen':_0x43ee7a[_0xfc48('0x28')](db[_0xfc48('0x4a')][_0xfc48('0x4d')](_0xd7d3d1(_0x31b78f,_0xfc48('0x4b')))[_0xfc48('0x27')](function(){})['catch'](_0x575852()));break;default:_0x43ee7a[_0xfc48('0x28')](db[_0xfc48('0x4a')][_0xfc48('0x4d')](_0x53c20f(_0x31b78f,'VoiceQueueId'))['then'](function(){})[_0xfc48('0x4c')](_0x575852()));}}}return _0x43ee7a;})[_0xfc48('0x4e')]()[_0xfc48('0x27')](function(){return db[_0xfc48('0x43')][_0xfc48('0x44')]({'where':{'type':_0xfc48('0x45')},'attributes':['id'],'include':[{'model':db[_0xfc48('0x47')],'as':_0xfc48('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x3ecf34){var _0xb7c2b6=[];if(_0x3ecf34){var _0x83b4e3;for(var _0x115442=0x0,_0x3f49bb;_0x115442<_0x3ecf34[_0xfc48('0x19')];_0x115442+=0x1){_0x3f49bb=_0x3ecf34[_0x115442][_0xfc48('0x49')]({'plain':!![]});_0xb7c2b6[_0xfc48('0x28')](db['sequelize']['query'](_0x3d4d5d(_0x3f49bb,_0xfc48('0x4b')))[_0xfc48('0x27')](function(){})['catch'](_0x575852()));}}return _0xb7c2b6;})[_0xfc48('0x4e')]();})[_0xfc48('0x27')](function(){return db[_0xfc48('0x50')]['findAll']({'attributes':['id',_0xfc48('0x46')],'include':[{'model':db[_0xfc48('0x47')],'as':_0xfc48('0x48'),'where':{'id':LISTID}}]})[_0xfc48('0x27')](function(_0x12e876){var _0x2a59ee=[];if(_0x12e876){for(var _0x5b444c=0x0,_0x4f5206;_0x5b444c<_0x12e876[_0xfc48('0x19')];_0x5b444c+=0x1){_0x4f5206=_0x12e876[_0x5b444c]['get']({'plain':!![]});switch(_0x4f5206[_0xfc48('0x46')]){case _0xfc48('0x51'):_0x2a59ee[_0xfc48('0x28')](db['sequelize'][_0xfc48('0x4d')](_0x30f804(_0x4f5206,_0xfc48('0x52')))[_0xfc48('0x27')](function(){})['catch'](_0x575852()));break;case _0xfc48('0x53'):_0x2a59ee[_0xfc48('0x28')](db[_0xfc48('0x4a')][_0xfc48('0x4d')](_0xd7d3d1(_0x4f5206,_0xfc48('0x52')))[_0xfc48('0x27')](function(){})[_0xfc48('0x4c')](_0x575852()));break;default:_0x2a59ee['push'](db[_0xfc48('0x4a')][_0xfc48('0x4d')](_0x53c20f(_0x4f5206,_0xfc48('0x52')))['then'](function(){})[_0xfc48('0x4c')](_0x575852()));}}}return _0x2a59ee;})[_0xfc48('0x4e')]();})[_0xfc48('0x27')](function(){return db['Campaign'][_0xfc48('0x44')]({'attributes':['id'],'include':[{'model':db[_0xfc48('0x47')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xfc48('0x27')](function(_0x12953d){var _0x859b27=[];if(_0x12953d){for(var _0x300697=0x0,_0x32861d;_0x300697<_0x12953d['length'];_0x300697+=0x1){_0x32861d=_0x12953d[_0x300697]['get']({'plain':!![]});_0x859b27[_0xfc48('0x28')](db[_0xfc48('0x4a')][_0xfc48('0x4d')](_0x3d4d5d(_0x32861d,'CampaignId'))[_0xfc48('0x27')](function(){})['catch'](_0x575852()));}}return _0x859b27;})[_0xfc48('0x4e')]();})[_0xfc48('0x4c')](function(_0x32d6c3){logger[_0xfc48('0x14')](_0xfc48('0x54'),'generalCheckHopper',_0x32d6c3[_0xfc48('0x55')]);});}var processPromises=function(_0x4589a8){return BPromise[_0xfc48('0x4e')](promises)['then'](function(_0x5a1851){})[_0xfc48('0x4c')](function(_0x840b75){logger[_0xfc48('0x14')](_0xfc48('0x56'),JSON[_0xfc48('0x57')](_0x840b75));})[_0xfc48('0x58')](function(){socket[_0xfc48('0x59')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4589a8){return _0x4589a8['resume']();}});};var endCsv=function(){return BPromise[_0xfc48('0x5a')]()[_0xfc48('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0xfc48('0x27')](function(){socket[_0xfc48('0x59')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x105be0){logger[_0xfc48('0x14')](_0xfc48('0x5b'),JSON[_0xfc48('0x57')](_0x105be0));}finally{process[_0xfc48('0x5c')](0x0);}});};process['on'](_0xfc48('0x5d'),function(){logger[_0xfc48('0x5e')](_0xfc48('0x5f'));endCsv();});function main(){return BPromise[_0xfc48('0x5a')]()[_0xfc48('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xfc48('0x60')][_0xfc48('0x44')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x584deb){var _0x138423=fs[_0xfc48('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfc48('0x62')](_0x138423,{'header':!![],'skipEmptyLines':!![],'step':function(_0x33b5be,_0x594ae9){total+=0x1;var _0x47a476=total;promises['push'](checkRow(_0x33b5be,_0x584deb,_0x47a476)[_0xfc48('0x27')](function(){success+=0x1;})[_0xfc48('0x4c')](function(_0x1b294d){if(_0x1b294d['error']){errors+=0x1;delete _0x1b294d['error'];}else if(_0x1b294d[_0xfc48('0x63')]){duplicates+=0x1;delete _0x1b294d[_0xfc48('0x63')];}rows[_0xfc48('0x28')](_0x1b294d);}));if(total%0xc8===0x0){_0x594ae9[_0xfc48('0x64')]();return processPromises(_0x594ae9);}},'complete':function(){return processPromises()['then'](function(){logger[_0xfc48('0x5e')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2f6fea,_0x212867){logger[_0xfc48('0x5e')](_0xfc48('0x65'),JSON[_0xfc48('0x57')](_0x2f6fea));endCsv();}});})[_0xfc48('0x4c')](function(_0x3c2bd3){logger[_0xfc48('0x14')](_0xfc48('0x66'),JSON[_0xfc48('0x57')](_0x3c2bd3));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b29ba7a..39f542d 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 _0x5b99=['campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','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','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','ListId','updatedAt','.CmListId\x20=\x20?','\x20=\x20?','CompanyId','into',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','errors','push','code','message','info','sequelize','query','spread','catch','error','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','keys','header','length','rows','data','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','isValid','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId'];(function(_0x2ea70b,_0x902c22){var _0x4772c8=function(_0x2562e8){while(--_0x2562e8){_0x2ea70b['push'](_0x2ea70b['shift']());}};_0x4772c8(++_0x902c22);}(_0x5b99,0x1a6));var _0x95b9=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x5b99[_0x11a220];return _0x20d8fe;};'use strict';var fs=require('fs');var path=require(_0x95b9('0x0'));var _=require(_0x95b9('0x1'));var Papa=require(_0x95b9('0x2'));var util=require('util');var BPromise=require(_0x95b9('0x3'));var moment=require(_0x95b9('0x4'));var squel=require('squel');var Redis=require(_0x95b9('0x5'));var db=require(_0x95b9('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x95b9('0x7'))('import');config[_0x95b9('0x8')]=_[_0x95b9('0x9')](config[_0x95b9('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x95b9('0xa'))(new Redis(config[_0x95b9('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x95b9('0xb'));function isEmail(_0x40737f){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))*$/[_0x95b9('0xc')](_0x40737f);}function selectNotIn(_0x354a19,_0x296f26,_0x151a89,_0x133b5f,_0x9a0489){return squel[_0x95b9('0xd')]()[_0x95b9('0xe')](_0x95b9('0xf'))[_0x95b9('0x10')](_0x133b5f)[_0x95b9('0x11')](_0x296f26,null,_0x296f26+'.id\x20=\x20'+_0x133b5f+'.'+_0x151a89)[_0x95b9('0x12')](_0x133b5f+'.'+_0x151a89+_0x95b9('0x13')+_0x354a19+'.'+_0x151a89)[_0x95b9('0x12')](_0x296f26+_0x95b9('0x14')+_0x9a0489['join']()+')');}function insertCmHopper(_0x30cf6f,_0x445e25,_0x47fa8c,_0x493491,_0x3d1d39){var _0x5d1102=[_0x95b9('0x15'),_0x95b9('0x16'),_0x95b9('0x17'),_0x95b9('0x18'),_0x445e25+'.'+_0x493491,_0x95b9('0x19'),_0x95b9('0x1a'),_0x95b9('0x1b'),_0x95b9('0x1c'),'\x22'+_0x3d1d39+'\x22'];return squel[_0x95b9('0x1d')]()['into'](_0x95b9('0x1e'))[_0x95b9('0x1f')]([_0x95b9('0xf'),_0x95b9('0x20'),_0x95b9('0x21'),'ListId',_0x493491,_0x95b9('0x22'),'updatedAt',_0x95b9('0x23'),_0x95b9('0x24'),'recallme'],squel[_0x95b9('0xd')]()[_0x95b9('0x25')](_0x5d1102)[_0x95b9('0x10')](_0x445e25)[_0x95b9('0x11')](_0x95b9('0x26'),null,_0x95b9('0x27')+_0x445e25+'.CmListId')[_0x95b9('0x11')](_0x47fa8c,null,_0x47fa8c+_0x95b9('0x28')+_0x445e25+'.'+_0x493491)['where'](_0x445e25+'.CmListId\x20=\x20?',_0x30cf6f)[_0x95b9('0x12')](_0x95b9('0x29'),NOW)['where'](_0x95b9('0x2a'),selectNotIn(_0x445e25,_0x47fa8c,_0x493491,_0x95b9('0x1e'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x95b9('0x12')](_0x95b9('0x2a'),selectNotIn(_0x445e25,_0x47fa8c,_0x493491,'cm_hopper',[_0x95b9('0x2b')])))[_0x95b9('0x2c')]();}function insertCmHopperBlack(_0x1e96d4,_0x3c07b5,_0xf317a4,_0x265eda){var _0x5aa1ce=[_0x95b9('0x15'),_0x95b9('0x17'),'cm_contacts.ListId',_0x3c07b5+'.'+_0x265eda,_0x95b9('0x19'),_0x95b9('0x1a')];return squel['insert']()['into'](_0x95b9('0x2d'))[_0x95b9('0x1f')]([_0x95b9('0xf'),_0x95b9('0x21'),_0x95b9('0x2e'),_0x265eda,'createdAt',_0x95b9('0x2f')],squel['select']()[_0x95b9('0x25')](_0x5aa1ce)[_0x95b9('0x10')](_0x3c07b5)['join']('cm_contacts',null,_0x95b9('0x27')+_0x3c07b5+'.CmListId')[_0x95b9('0x11')](_0xf317a4,null,_0xf317a4+_0x95b9('0x28')+_0x3c07b5+'.'+_0x265eda)[_0x95b9('0x12')](_0x3c07b5+_0x95b9('0x30'),_0x1e96d4)[_0x95b9('0x12')](_0x95b9('0x29'),NOW)[_0x95b9('0x12')](_0x95b9('0x2a'),squel[_0x95b9('0xd')]()['field']('phone')[_0x95b9('0x10')]('cm_hopper_black')[_0x95b9('0x12')]('ListId\x20=\x20?',_0x1e96d4)['where'](_0x265eda+_0x95b9('0x31'),_0x3c07b5+'.'+_0x265eda)))[_0x95b9('0x2c')]();}function insertCmContact(_0x4b2c9d,_0x4ae434,_0x25ecae,_0x20a351){var _0x1145b6=_['concat'](_['keys'](_0x20a351),[_0x95b9('0x2e'),_0x95b9('0x32'),'createdAt',_0x95b9('0x2f')]);return squel['insert']()[_0x95b9('0x33')]('cm_contacts')[_0x95b9('0x1f')](_0x1145b6,squel[_0x95b9('0xd')]()[_0x95b9('0x25')](_0x1145b6)[_0x95b9('0x10')](_0x4ae434)['where']('('+_0x25ecae[_0x95b9('0x11')](',')+_0x95b9('0x34'),squel['select']()['fields'](_0x25ecae)['from']('cm_contacts')['where'](_0x95b9('0x35'),_0x4b2c9d)['where'](_0x95b9('0x36')))[_0x95b9('0x12')](_0x95b9('0x37'),squel[_0x95b9('0xd')]()[_0x95b9('0xe')](_0x95b9('0x38'),_0x95b9('0x39'))[_0x95b9('0x10')](_0x4ae434)[_0x95b9('0x3a')](_0x25ecae[_0x95b9('0x11')](','))))[_0x95b9('0x2c')]();}function handleStop(){logger['info'](_0x95b9('0x3b'));stopped=!![];}function handleUncaughtException(_0x3c3d6d){logger['error'](_0x3c3d6d['message']);process['exit'](0x1);}function handleError(_0x3e8250,_0x31ed86){stats[_0x95b9('0x3c')][_0x95b9('0x3d')]({'name':_0x31ed86[_0x95b9('0x3e')],'message':_0x31ed86[_0x95b9('0x3f')],'row':_0x3e8250});}function handleQuery(_0x36066f){logger[_0x95b9('0x40')](_0x36066f);return db[_0x95b9('0x41')][_0x95b9('0x42')](_0x36066f)[_0x95b9('0x43')](function(_0xadc0cb){results[_0x95b9('0x3d')](_0xadc0cb);})[_0x95b9('0x44')](function(_0x2e93ee){logger[_0x95b9('0x45')](_0x2e93ee['message']);});}function main(_0x64afe6,_0x5aa2fc,_0x4e83d2,_0x13930e){logger[_0x95b9('0x40')](_0x95b9('0x46'),_0x64afe6,JSON[_0x95b9('0x47')](_0x5aa2fc));process[_0x95b9('0x48')](_0x95b9('0x49'));var _0x4cb3ab=_0x5aa2fc[_0x95b9('0x4a')];var _0x21c158=_0x5aa2fc[_0x95b9('0x4b')];var _0xc46dcc=path[_0x95b9('0x11')](config['root'],_0x95b9('0x4c'),_0x21c158+_0x95b9('0x4d'));var _0x47061d=_[_0x95b9('0x4e')](_0x4cb3ab)[_0x95b9('0x11')]();logger[_0x95b9('0x40')](_0x95b9('0x4f'),_0x47061d);fs['writeFileSync'](_0xc46dcc,_0x47061d+'\x0a');Papa['parse'](fs['createReadStream'](_0x64afe6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x8937d2,_0xe08ed6){try{for(var _0xe73004=0x0,_0x3c5b24=[];_0xe73004<_0x8937d2['data'][_0x95b9('0x50')];_0xe73004++){stats[_0x95b9('0x51')]+=0x1;if(_0x8937d2[_0x95b9('0x3c')][_0xe73004]){handleError(_0x8937d2[_0x95b9('0x52')][_0xe73004],_0x8937d2[_0x95b9('0x3c')][_0xe73004]);}else{var _0x3f84f7=[];for(var _0x4e2762 in _0x4cb3ab){if(_0x4cb3ab['hasOwnProperty'](_0x4e2762)){if(_0x8937d2[_0x95b9('0x52')][_0xe73004][_0x4cb3ab[_0x4e2762]]){var _0x7d8f0f=_[_0x95b9('0x53')](_0x8937d2[_0x95b9('0x52')][_0xe73004][_0x4cb3ab[_0x4e2762]][_0x95b9('0x54')](/"/g,'\x27'));switch(_0x4e2762){case'scheduledat':var _0xaa8029=moment(_0x7d8f0f,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xaa8029['isValid']()){_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');}else{_0x3f84f7['push'](_0x95b9('0x55'));}break;case _0x95b9('0x23'):var _0x2af70e=parseInt(_0x7d8f0f);_0x7d8f0f=_[_0x95b9('0x56')](_0x2af70e)||_0x2af70e<0x0||_0x2af70e>0x4?_0x13930e?0x3:0x2:_0x2af70e;_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');break;case _0x95b9('0x24'):var _0xe44722=parseInt(_0x7d8f0f);if(_[_0x95b9('0x57')](_0xe44722)&&_['includes'](_0x4e83d2,_0xe44722)){_0x3c5b24[_0x95b9('0x3d')]('\x22'+_0xe44722+'\x22');}else{_0x3f84f7['push'](_0x95b9('0x58'));}break;case _0x95b9('0x59'):if(isEmail(_0x7d8f0f)){_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');}else{_0x3f84f7['push']('email\x20wrong\x20format');}break;case _0x95b9('0x5a'):var _0x2623e8=moment(_0x7d8f0f,'YYYY-MM-DD',!![]);if(_0x2623e8[_0x95b9('0x5b')]()){_0x3c5b24['push']('\x22'+_0x7d8f0f+'\x22');}else{_0x3f84f7[_0x95b9('0x3d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3c5b24[_0x95b9('0x3d')]('\x22'+_0x7d8f0f+'\x22');}}else{switch(_0x4e2762){case'firstName':case _0x95b9('0xf'):_0x3f84f7[_0x95b9('0x3d')](_0x4e2762+_0x95b9('0x5c'));break;default:_0x3c5b24[_0x95b9('0x3d')]('\x22\x22');}}}}if(_0x3f84f7[_0x95b9('0x50')]){handleError(_0x8937d2[_0x95b9('0x52')][_0xe73004],{'code':_0x95b9('0x5d'),'message':_0x3f84f7[_0x95b9('0x11')]()});}else{fs['appendFileSync'](_0xc46dcc,_0x3c5b24[_0x95b9('0x11')]()+'\x0a');}_0x3c5b24=[];}if(!(stats[_0x95b9('0x51')]%0xc8)){socket[_0x95b9('0x5e')](_0x95b9('0x5f')+_0x21c158,stats);stats[_0x95b9('0x3c')]=[];}}if(stopped){logger[_0x95b9('0x40')](_0x95b9('0x60'));_0xe08ed6[_0x95b9('0x61')]();}}catch(_0xb909d3){handleError(_0x8937d2[_0x95b9('0x52')][_0xe73004],{'code':_0x95b9('0x62'),'message':_0xb909d3[_0x95b9('0x3f')]});logger[_0x95b9('0x45')](_0x95b9('0x63'),_0xb909d3['message']);}},'complete':function(){try{var _0x2add3d=[];var _0x39de27=_0x95b9('0x26');if(_0x5aa2fc[_0x95b9('0x64')]&&_0x5aa2fc['duplicates'][_0x95b9('0x50')]){_0x39de27=_0x95b9('0x65')+_0x21c158;_0x2add3d[_0x95b9('0x3d')]('CREATE\x20TABLE\x20'+_0x39de27+_0x95b9('0x66'));}var _0x3ffefe=util[_0x95b9('0x67')](_0x95b9('0x68'),_0xc46dcc,_0x39de27,_0x47061d,_0x5aa2fc['ListId'],_0x5aa2fc[_0x95b9('0x32')]||null,NOW,NOW);if(_[_0x95b9('0x69')](_0x4cb3ab[_0x95b9('0x20')])){_0x3ffefe+=_0x95b9('0x6a');}_0x2add3d[_0x95b9('0x3d')](_0x3ffefe);if(_0x5aa2fc[_0x95b9('0x64')]&&_0x5aa2fc[_0x95b9('0x64')]['length']){_0x2add3d[_0x95b9('0x3d')](insertCmContact(_0x5aa2fc[_0x95b9('0x2e')],_0x39de27,_0x5aa2fc[_0x95b9('0x64')],_0x4cb3ab));_0x2add3d['push'](_0x95b9('0x6b')+_0x39de27+';');}_0x2add3d[_0x95b9('0x3d')](insertCmHopper(_0x5aa2fc[_0x95b9('0x2e')],_0x95b9('0x6c'),_0x95b9('0x6d'),_0x95b9('0x6e'),_0x13930e));_0x2add3d[_0x95b9('0x3d')](insertCmHopperBlack(_0x5aa2fc['ListId'],'voice_queues_has_cm_blacklists','voice_queues',_0x95b9('0x6e')));_0x2add3d[_0x95b9('0x3d')](insertCmHopper(_0x5aa2fc[_0x95b9('0x2e')],_0x95b9('0x6f'),_0x95b9('0x70'),_0x95b9('0x71'),_0x13930e));_0x2add3d['push'](insertCmHopperBlack(_0x5aa2fc[_0x95b9('0x2e')],_0x95b9('0x72'),_0x95b9('0x70'),_0x95b9('0x71')));BPromise[_0x95b9('0x73')](_0x2add3d,handleQuery)[_0x95b9('0x74')](function(_0x1c35f7){stats[_0x95b9('0x75')]=!![];stats[_0x95b9('0x76')]=_0x5aa2fc[_0x95b9('0x64')]&&_0x5aa2fc['duplicates'][_0x95b9('0x50')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x95b9('0x5f')+_0x21c158,stats);fs[_0x95b9('0x77')](_0x64afe6);fs['unlink'](_0xc46dcc);process[_0x95b9('0x78')](0x0);})['catch'](function(_0x5cca9d){logger[_0x95b9('0x45')](_0x5cca9d[_0x95b9('0x3f')]);process[_0x95b9('0x78')](0x1);});}catch(_0x3557fd){logger[_0x95b9('0x45')](_0x95b9('0x79'),_0x3557fd[_0x95b9('0x3f')]);process[_0x95b9('0x78')](0x1);}},'error':function(_0x20fc3f,_0x4cfa1e,_0x455159,_0x561bdb){throw new Error(_0x561bdb);}});}function validate(){if(process[_0x95b9('0x7a')]&&process[_0x95b9('0x7a')][_0x95b9('0x50')]<0x4){throw new Error(_0x95b9('0x7b'));}var _0x92c8a4=path[_0x95b9('0x11')](config[_0x95b9('0x7c')],_0x95b9('0x4c'),process['argv'][0x2]);if(!fs[_0x95b9('0x7d')](_0x92c8a4)){throw new Error(_0x95b9('0x7e'));}var _0x27e257={};try{_0x27e257=JSON[_0x95b9('0x7f')](process[_0x95b9('0x7a')][0x3]);if(!_0x27e257[_0x95b9('0x4a')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x27e257['binding'][_0x95b9('0xf')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x27e257[_0x95b9('0x4a')][_0x95b9('0x80')]){throw new Error(_0x95b9('0x81'));}var _0x31793f=0x0;if(_0x27e257[_0x95b9('0x4a')][_0x95b9('0x24')]){_0x31793f=0x1;}if(!_0x27e257[_0x95b9('0x2e')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x1a65f3){throw new Error(_0x95b9('0x82'));}var _0x1482ec=[];try{_0x1482ec=_[_0x95b9('0x83')](JSON[_0x95b9('0x7f')](process[_0x95b9('0x7a')][0x4]),'id');}catch(_0x239c07){logger[_0x95b9('0x40')](_0x95b9('0x84'));}main(_0x92c8a4,_0x27e257,_0x1482ec,_0x31793f);}validate();process['on'](_0x95b9('0x85'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xffe3=['campaigns_has_cm_blacklists','then','affectedRows','emit','unlink','catch','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','parse','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','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','ContactId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','toString','concat','CompanyId','deletedAt\x20IS\x20NULL','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','send','binding','socket_timestamp','root','.csv','keys','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','trim','replace','scheduledat','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','format','isNil','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0xffe3,0x1a8));var _0x3ffe=function(_0x449efd,_0x2daea5){_0x449efd=_0x449efd-0x0;var _0x16d17c=_0xffe3[_0x449efd];return _0x16d17c;};'use strict';var fs=require('fs');var path=require(_0x3ffe('0x0'));var _=require(_0x3ffe('0x1'));var Papa=require(_0x3ffe('0x2'));var util=require(_0x3ffe('0x3'));var BPromise=require(_0x3ffe('0x4'));var moment=require(_0x3ffe('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x3ffe('0x6'))['db'];var config=require(_0x3ffe('0x7'));var logger=require(_0x3ffe('0x8'))(_0x3ffe('0x9'));config[_0x3ffe('0xa')]=_[_0x3ffe('0xb')](config[_0x3ffe('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ffe('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x3ffe('0xd'));function isEmail(_0x3600fa){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))*$/[_0x3ffe('0xe')](_0x3600fa);}function selectNotIn(_0x206b2e,_0x2c7c0b,_0x561b31,_0x2025cb,_0x1d66cc){return squel[_0x3ffe('0xf')]()[_0x3ffe('0x10')](_0x3ffe('0x11'))[_0x3ffe('0x12')](_0x2025cb)['join'](_0x2c7c0b,null,_0x2c7c0b+_0x3ffe('0x13')+_0x2025cb+'.'+_0x561b31)[_0x3ffe('0x14')](_0x2025cb+'.'+_0x561b31+_0x3ffe('0x15')+_0x206b2e+'.'+_0x561b31)[_0x3ffe('0x14')](_0x2c7c0b+_0x3ffe('0x16')+_0x1d66cc[_0x3ffe('0x17')]()+')');}function insertCmHopper(_0x2d829a,_0x3175ce,_0x5b1996,_0x17825b,_0x2e0a47){var _0x5047e9=['cm_contacts.phone',_0x3ffe('0x18'),_0x3ffe('0x19'),_0x3ffe('0x1a'),_0x3175ce+'.'+_0x17825b,_0x3ffe('0x1b'),_0x3ffe('0x1c'),_0x3ffe('0x1d'),_0x3ffe('0x1e'),'\x22'+_0x2e0a47+'\x22'];return squel[_0x3ffe('0x1f')]()[_0x3ffe('0x20')](_0x3ffe('0x21'))[_0x3ffe('0x22')]([_0x3ffe('0x11'),'scheduledat',_0x3ffe('0x23'),'ListId',_0x17825b,_0x3ffe('0x24'),_0x3ffe('0x25'),_0x3ffe('0x26'),'UserId',_0x3ffe('0x27')],squel[_0x3ffe('0xf')]()[_0x3ffe('0x28')](_0x5047e9)[_0x3ffe('0x12')](_0x3175ce)[_0x3ffe('0x17')](_0x3ffe('0x29'),null,_0x3ffe('0x2a')+_0x3175ce+_0x3ffe('0x2b'))[_0x3ffe('0x17')](_0x5b1996,null,_0x5b1996+_0x3ffe('0x13')+_0x3175ce+'.'+_0x17825b)['where'](_0x3175ce+_0x3ffe('0x2c'),_0x2d829a)[_0x3ffe('0x14')](_0x3ffe('0x2d'),NOW)['where'](_0x3ffe('0x2e'),selectNotIn(_0x3175ce,_0x5b1996,_0x17825b,_0x3ffe('0x21'),[_0x3ffe('0x2f'),_0x3ffe('0x30')]))[_0x3ffe('0x14')](_0x3ffe('0x2e'),selectNotIn(_0x3175ce,_0x5b1996,_0x17825b,'cm_hopper',[_0x3ffe('0x2f')])))['toString']();}function insertCmHopperBlack(_0x5158cf,_0x4feb3c,_0x2ad9ef,_0x2e9639){var _0xf0d6cc=[_0x3ffe('0x31'),_0x3ffe('0x19'),_0x3ffe('0x1a'),_0x4feb3c+'.'+_0x2e9639,'cm_contacts.createdAt',_0x3ffe('0x1c')];return squel[_0x3ffe('0x1f')]()[_0x3ffe('0x20')](_0x3ffe('0x32'))['fromQuery'](['phone','ContactId',_0x3ffe('0x33'),_0x2e9639,_0x3ffe('0x24'),_0x3ffe('0x25')],squel['select']()[_0x3ffe('0x28')](_0xf0d6cc)[_0x3ffe('0x12')](_0x4feb3c)[_0x3ffe('0x17')](_0x3ffe('0x29'),null,_0x3ffe('0x2a')+_0x4feb3c+_0x3ffe('0x2b'))['join'](_0x2ad9ef,null,_0x2ad9ef+'.id\x20=\x20'+_0x4feb3c+'.'+_0x2e9639)[_0x3ffe('0x14')](_0x4feb3c+_0x3ffe('0x2c'),_0x5158cf)[_0x3ffe('0x14')](_0x3ffe('0x2d'),NOW)[_0x3ffe('0x14')](_0x3ffe('0x2e'),squel[_0x3ffe('0xf')]()['field'](_0x3ffe('0x11'))[_0x3ffe('0x12')]('cm_hopper_black')[_0x3ffe('0x14')](_0x3ffe('0x34'),_0x5158cf)['where'](_0x2e9639+_0x3ffe('0x35'),_0x4feb3c+'.'+_0x2e9639)))[_0x3ffe('0x36')]();}function insertCmContact(_0x15e5b3,_0x1c5688,_0x54f181,_0x28bff5){var _0x43bd4d=_[_0x3ffe('0x37')](_['keys'](_0x28bff5),[_0x3ffe('0x33'),_0x3ffe('0x38'),'createdAt','updatedAt']);return squel['insert']()[_0x3ffe('0x20')](_0x3ffe('0x29'))[_0x3ffe('0x22')](_0x43bd4d,squel[_0x3ffe('0xf')]()[_0x3ffe('0x28')](_0x43bd4d)[_0x3ffe('0x12')](_0x1c5688)['where']('('+_0x54f181[_0x3ffe('0x17')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x54f181)[_0x3ffe('0x12')]('cm_contacts')['where'](_0x3ffe('0x34'),_0x15e5b3)[_0x3ffe('0x14')](_0x3ffe('0x39')))[_0x3ffe('0x14')]('id\x20IN\x20?',squel['select']()[_0x3ffe('0x10')](_0x3ffe('0x3a'),_0x3ffe('0x3b'))[_0x3ffe('0x12')](_0x1c5688)['group'](_0x54f181['join'](','))))[_0x3ffe('0x36')]();}function handleStop(){logger[_0x3ffe('0x3c')](_0x3ffe('0x3d'));stopped=!![];}function handleUncaughtException(_0x3cd4ef){logger[_0x3ffe('0x3e')](_0x3cd4ef[_0x3ffe('0x3f')]);process[_0x3ffe('0x40')](0x1);}function handleError(_0x16b5ac,_0x44f5fc){stats[_0x3ffe('0x41')][_0x3ffe('0x42')]({'name':_0x44f5fc[_0x3ffe('0x43')],'message':_0x44f5fc[_0x3ffe('0x3f')],'row':_0x16b5ac});}function handleQuery(_0x1e8f61){logger[_0x3ffe('0x3c')](_0x1e8f61);return db[_0x3ffe('0x44')][_0x3ffe('0x45')](_0x1e8f61)[_0x3ffe('0x46')](function(_0x265632){results[_0x3ffe('0x42')](_0x265632);})['catch'](function(_0x50a6d4){logger[_0x3ffe('0x3e')](_0x50a6d4[_0x3ffe('0x3f')]);});}function main(_0x4cbaf8,_0x1fd3f3,_0x5316a4,_0x42cf3a){logger[_0x3ffe('0x3c')]('main',_0x4cbaf8,JSON['stringify'](_0x1fd3f3));process[_0x3ffe('0x47')]('start');var _0x5c489d=_0x1fd3f3[_0x3ffe('0x48')];var _0x552c9e=_0x1fd3f3[_0x3ffe('0x49')];var _0x772af1=path[_0x3ffe('0x17')](config[_0x3ffe('0x4a')],'server/files/tmp',_0x552c9e+_0x3ffe('0x4b'));var _0x333d1a=_[_0x3ffe('0x4c')](_0x5c489d)[_0x3ffe('0x17')]();logger[_0x3ffe('0x3c')](_0x3ffe('0x4d'),_0x333d1a);fs[_0x3ffe('0x4e')](_0x772af1,_0x333d1a+'\x0a');Papa['parse'](fs[_0x3ffe('0x4f')](_0x4cbaf8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x907e80,_0x2b3f4f){try{for(var _0x1b11ac=0x0,_0x56a1bb=[];_0x1b11ac<_0x907e80[_0x3ffe('0x50')][_0x3ffe('0x51')];_0x1b11ac++){stats[_0x3ffe('0x52')]+=0x1;if(_0x907e80['errors'][_0x1b11ac]){handleError(_0x907e80['data'][_0x1b11ac],_0x907e80['errors'][_0x1b11ac]);}else{var _0x43ff92=[];for(var _0x11896f in _0x5c489d){if(_0x5c489d[_0x3ffe('0x53')](_0x11896f)){if(_0x907e80[_0x3ffe('0x50')][_0x1b11ac][_0x5c489d[_0x11896f]]){var _0x2a0bcf=_[_0x3ffe('0x54')](_0x907e80[_0x3ffe('0x50')][_0x1b11ac][_0x5c489d[_0x11896f]][_0x3ffe('0x55')](/"/g,'\x27'));switch(_0x11896f){case _0x3ffe('0x56'):var _0x2a151e=moment(_0x2a0bcf,_0x3ffe('0xd'),!![]);if(_0x2a151e['isValid']()){_0x56a1bb[_0x3ffe('0x42')]('\x22'+_0x2a0bcf+'\x22');}else{_0x43ff92[_0x3ffe('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3ffe('0x26'):var _0xc1d05c=parseInt(_0x2a0bcf);_0x2a0bcf=_[_0x3ffe('0x57')](_0xc1d05c)||_0xc1d05c<0x0||_0xc1d05c>0x4?_0x42cf3a?0x3:0x2:_0xc1d05c;_0x56a1bb[_0x3ffe('0x42')]('\x22'+_0x2a0bcf+'\x22');break;case _0x3ffe('0x58'):var _0x59601d=parseInt(_0x2a0bcf);if(_[_0x3ffe('0x59')](_0x59601d)&&_['includes'](_0x5316a4,_0x59601d)){_0x56a1bb[_0x3ffe('0x42')]('\x22'+_0x59601d+'\x22');}else{_0x43ff92[_0x3ffe('0x42')](_0x3ffe('0x5a'));}break;case _0x3ffe('0x5b'):if(isEmail(_0x2a0bcf)){_0x56a1bb[_0x3ffe('0x42')]('\x22'+_0x2a0bcf+'\x22');}else{_0x43ff92[_0x3ffe('0x42')](_0x3ffe('0x5c'));}break;case'dateOfBirth':var _0x312318=moment(_0x2a0bcf,'YYYY-MM-DD',!![]);if(_0x312318[_0x3ffe('0x5d')]()){_0x56a1bb[_0x3ffe('0x42')]('\x22'+_0x2a0bcf+'\x22');}else{_0x43ff92[_0x3ffe('0x42')](_0x3ffe('0x5e'));}break;default:_0x56a1bb[_0x3ffe('0x42')]('\x22'+_0x2a0bcf+'\x22');}}else{switch(_0x11896f){case _0x3ffe('0x5f'):case'phone':_0x43ff92[_0x3ffe('0x42')](_0x11896f+_0x3ffe('0x60'));break;default:_0x56a1bb[_0x3ffe('0x42')]('\x22\x22');}}}}if(_0x43ff92[_0x3ffe('0x51')]){handleError(_0x907e80[_0x3ffe('0x50')][_0x1b11ac],{'code':_0x3ffe('0x61'),'message':_0x43ff92[_0x3ffe('0x17')]()});}else{fs[_0x3ffe('0x62')](_0x772af1,_0x56a1bb['join']()+'\x0a');}_0x56a1bb=[];}if(!(stats[_0x3ffe('0x52')]%0xc8)){socket['emit'](_0x3ffe('0x63')+_0x552c9e,stats);stats[_0x3ffe('0x41')]=[];}}if(stopped){logger[_0x3ffe('0x3c')](_0x3ffe('0x64'));_0x2b3f4f[_0x3ffe('0x65')]();}}catch(_0x59a0fd){handleError(_0x907e80[_0x3ffe('0x50')][_0x1b11ac],{'code':_0x3ffe('0x66'),'message':_0x59a0fd['message']});logger[_0x3ffe('0x3e')](_0x3ffe('0x67'),_0x59a0fd[_0x3ffe('0x3f')]);}},'complete':function(){try{var _0x403bed=[];var _0x480c5d=_0x3ffe('0x29');if(_0x1fd3f3['duplicates']&&_0x1fd3f3['duplicates'][_0x3ffe('0x51')]){_0x480c5d=_0x3ffe('0x68')+_0x552c9e;_0x403bed['push'](_0x3ffe('0x69')+_0x480c5d+'\x20LIKE\x20cm_contacts;');}var _0x3920e4=util[_0x3ffe('0x6a')]('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',_0x772af1,_0x480c5d,_0x333d1a,_0x1fd3f3['ListId'],_0x1fd3f3[_0x3ffe('0x38')]||null,NOW,NOW);if(_[_0x3ffe('0x6b')](_0x5c489d[_0x3ffe('0x56')])){_0x3920e4+=',\x20scheduledAt\x20=\x20NOW()';}_0x403bed['push'](_0x3920e4);if(_0x1fd3f3[_0x3ffe('0x6c')]&&_0x1fd3f3[_0x3ffe('0x6c')][_0x3ffe('0x51')]){_0x403bed[_0x3ffe('0x42')](insertCmContact(_0x1fd3f3[_0x3ffe('0x33')],_0x480c5d,_0x1fd3f3[_0x3ffe('0x6c')],_0x5c489d));_0x403bed[_0x3ffe('0x42')](_0x3ffe('0x6d')+_0x480c5d+';');}_0x403bed[_0x3ffe('0x42')](insertCmHopper(_0x1fd3f3['ListId'],_0x3ffe('0x6e'),'voice_queues',_0x3ffe('0x6f'),_0x42cf3a));_0x403bed[_0x3ffe('0x42')](insertCmHopperBlack(_0x1fd3f3[_0x3ffe('0x33')],'voice_queues_has_cm_blacklists',_0x3ffe('0x70'),_0x3ffe('0x6f')));_0x403bed[_0x3ffe('0x42')](insertCmHopper(_0x1fd3f3[_0x3ffe('0x33')],_0x3ffe('0x71'),_0x3ffe('0x72'),_0x3ffe('0x73'),_0x42cf3a));_0x403bed[_0x3ffe('0x42')](insertCmHopperBlack(_0x1fd3f3[_0x3ffe('0x33')],_0x3ffe('0x74'),'campaigns',_0x3ffe('0x73')));BPromise['each'](_0x403bed,handleQuery)[_0x3ffe('0x75')](function(_0x123928){stats['finish']=!![];stats[_0x3ffe('0x76')]=_0x1fd3f3[_0x3ffe('0x6c')]&&_0x1fd3f3['duplicates'][_0x3ffe('0x51')]?results[0x2][_0x3ffe('0x76')]:results[0x0][_0x3ffe('0x76')];socket[_0x3ffe('0x77')]('contact:import:'+_0x552c9e,stats);fs[_0x3ffe('0x78')](_0x4cbaf8);fs[_0x3ffe('0x78')](_0x772af1);process[_0x3ffe('0x40')](0x0);})[_0x3ffe('0x79')](function(_0x3330f5){logger[_0x3ffe('0x3e')](_0x3330f5[_0x3ffe('0x3f')]);process['exit'](0x1);});}catch(_0x7e1357){logger[_0x3ffe('0x3e')](_0x3ffe('0x7a'),_0x7e1357[_0x3ffe('0x3f')]);process[_0x3ffe('0x40')](0x1);}},'error':function(_0x4dabac,_0x267fbd,_0x5b61d5,_0xa70ca){throw new Error(_0xa70ca);}});}function validate(){if(process['argv']&&process[_0x3ffe('0x7b')][_0x3ffe('0x51')]<0x4){throw new Error(_0x3ffe('0x7c'));}var _0x2024c6=path[_0x3ffe('0x17')](config[_0x3ffe('0x4a')],_0x3ffe('0x7d'),process[_0x3ffe('0x7b')][0x2]);if(!fs[_0x3ffe('0x7e')](_0x2024c6)){throw new Error(_0x3ffe('0x7f'));}var _0x3ec88b={};try{_0x3ec88b=JSON['parse'](process[_0x3ffe('0x7b')][0x3]);if(!_0x3ec88b[_0x3ffe('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3ec88b[_0x3ffe('0x48')][_0x3ffe('0x11')]){throw new Error(_0x3ffe('0x80'));}if(!_0x3ec88b['binding'][_0x3ffe('0x5f')]){throw new Error(_0x3ffe('0x81'));}var _0x515602=0x0;if(_0x3ec88b['binding'][_0x3ffe('0x58')]){_0x515602=0x1;}if(!_0x3ec88b[_0x3ffe('0x33')]){throw new Error(_0x3ffe('0x82'));}}catch(_0x432a02){throw new Error('body\x20id\x20mandatory');}var _0x477453=[];try{_0x477453=_['map'](JSON[_0x3ffe('0x83')](process[_0x3ffe('0x7b')][0x4]),'id');}catch(_0x459ce4){logger[_0x3ffe('0x3c')](_0x3ffe('0x84'));}main(_0x2024c6,_0x3ec88b,_0x477453,_0x515602);}validate();process['on'](_0x3ffe('0x85'),handleStop);process['on'](_0x3ffe('0x86'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 015502e..b464bb0 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 _0xa6e3=['Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','billableseconds','getSubjects','string','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x44d2c4,_0x57e541){var _0x148c18=function(_0x54ee84){while(--_0x54ee84){_0x44d2c4['push'](_0x44d2c4['shift']());}};_0x148c18(++_0x57e541);}(_0xa6e3,0x115));var _0x3a6e=function(_0x19be15,_0x5271d3){_0x19be15=_0x19be15-0x0;var _0x28b46d=_0xa6e3[_0x19be15];return _0x28b46d;};'use strict';exports[_0x3a6e('0x0')]=function(_0x5eca6c,_0x145485){var _0x402d29=[{'type':_0x3a6e('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5eca6c[_0x3a6e('0x2')]()){case'voice':switch(_0x145485['toLowerCase']()){case _0x3a6e('0x3'):_0x402d29[_0x3a6e('0x4')]({'type':_0x3a6e('0x5'),'content':'','variableName':_0x3a6e('0x6')});_0x402d29[_0x3a6e('0x4')]({'type':'variable','content':'','variableName':_0x3a6e('0x7')});break;case _0x3a6e('0x8'):_0x402d29['push']({'type':'string','content':_0x3a6e('0x9'),'variableName':null});_0x402d29['push']({'type':_0x3a6e('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x402d29;};exports[_0x3a6e('0xa')]=function(_0x16a066,_0x5c6f4d){var _0x1606eb=[];switch(_0x16a066['toLowerCase']()){case _0x3a6e('0xb'):switch(_0x5c6f4d[_0x3a6e('0x2')]()){case _0x3a6e('0x3'):_0x1606eb=[{'type':_0x3a6e('0x1'),'content':_0x3a6e('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0xe'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x7')},{'type':_0x3a6e('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0xf')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x10'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x11')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x12'),'keyType':'variable','variableName':_0x3a6e('0x6')},{'type':_0x3a6e('0xd'),'content':'','key':'UniqueId','keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x13')},{'type':'keyValue','content':'','key':_0x3a6e('0x14'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x3a6e('0x1'),'content':_0x3a6e('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x16'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x17')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x18'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x19')},{'type':_0x3a6e('0x1'),'content':_0x3a6e('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':'agentcalledAt'},{'type':_0x3a6e('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x1b')},{'type':'keyValue','content':'','key':_0x3a6e('0x1c'),'keyType':'variable','variableName':_0x3a6e('0x1d')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x1e'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x1f')},{'type':'keyValue','content':'','key':_0x3a6e('0x20'),'keyType':_0x3a6e('0x5'),'variableName':_0x3a6e('0x21')}];break;case _0x3a6e('0x8'):_0x1606eb=[{'type':'string','content':_0x3a6e('0xc'),'variableName':null},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x22'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x19')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x23'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x3a6e('0x24'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x13')},{'type':_0x3a6e('0xd'),'content':'','key':'Date','keyType':_0x3a6e('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0x3a6e('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x25'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x26')},{'type':_0x3a6e('0xd'),'content':'','key':_0x3a6e('0x27'),'keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x28')},{'type':_0x3a6e('0xd'),'content':'','key':'Duration','keyType':_0x3a6e('0x5'),'keyContent':'','variableName':_0x3a6e('0x29')},{'type':_0x3a6e('0xd'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0x3a6e('0x2a')}];break;}}return _0x1606eb;}; \ No newline at end of file +var _0xb861=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','queue','variable','calleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0xb861,0x170));var _0x1b86=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xb861[_0x1a0ef3];return _0x2b86da;};'use strict';exports[_0x1b86('0x0')]=function(_0x292f64,_0x1ff632){var _0x140386=[{'type':_0x1b86('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x292f64[_0x1b86('0x2')]()){case _0x1b86('0x3'):switch(_0x1ff632['toLowerCase']()){case _0x1b86('0x4'):_0x140386[_0x1b86('0x5')]({'type':'variable','content':'','variableName':_0x1b86('0x6')});_0x140386[_0x1b86('0x5')]({'type':_0x1b86('0x7'),'content':'','variableName':_0x1b86('0x8')});break;case'outbound':_0x140386[_0x1b86('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x140386[_0x1b86('0x5')]({'type':_0x1b86('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x140386;};exports[_0x1b86('0x9')]=function(_0x3c660f,_0x338aa8){var _0xf5419a=[];switch(_0x3c660f['toLowerCase']()){case _0x1b86('0x3'):switch(_0x338aa8[_0x1b86('0x2')]()){case _0x1b86('0x4'):_0xf5419a=[{'type':_0x1b86('0x1'),'content':_0x1b86('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0xc'),'keyType':_0x1b86('0x7'),'variableName':_0x1b86('0x8')},{'type':_0x1b86('0xb'),'content':'','key':'Caller\x20Name','keyType':_0x1b86('0x7'),'variableName':_0x1b86('0xd')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0xe'),'keyType':'variable','variableName':_0x1b86('0xf')},{'type':'keyValue','content':'','key':_0x1b86('0x10'),'keyType':'variable','variableName':_0x1b86('0x6')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x11'),'keyType':_0x1b86('0x7'),'variableName':_0x1b86('0x12')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x13'),'keyType':_0x1b86('0x7'),'variableName':_0x1b86('0x14')},{'type':_0x1b86('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x15'),'keyType':'variable','variableName':_0x1b86('0x16')},{'type':'keyValue','content':'','key':_0x1b86('0x17'),'keyType':_0x1b86('0x7'),'variableName':_0x1b86('0x18')},{'type':_0x1b86('0x1'),'content':_0x1b86('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x1a'),'keyType':_0x1b86('0x7'),'variableName':'agentcalledAt'},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x1b'),'keyType':_0x1b86('0x7'),'variableName':'agentconnectAt'},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x1c'),'keyType':_0x1b86('0x7'),'variableName':_0x1b86('0x1d')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x1e'),'keyType':_0x1b86('0x7'),'variableName':_0x1b86('0x1f')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x20'),'keyType':'variable','variableName':_0x1b86('0x21')}];break;case _0x1b86('0x22'):_0xf5419a=[{'type':'string','content':_0x1b86('0xa'),'variableName':null},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x23'),'keyType':'variable','keyContent':'','variableName':_0x1b86('0x18')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x24'),'keyType':_0x1b86('0x7'),'keyContent':'','variableName':_0x1b86('0x25')},{'type':'keyValue','content':'','key':_0x1b86('0x11'),'keyType':_0x1b86('0x7'),'keyContent':'','variableName':_0x1b86('0x12')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x13'),'keyType':_0x1b86('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0x1b86('0x1'),'content':_0x1b86('0x19')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x26'),'keyType':_0x1b86('0x7'),'keyContent':'','variableName':_0x1b86('0x27')},{'type':_0x1b86('0xb'),'content':'','key':'Complete\x20Time','keyType':_0x1b86('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x28'),'keyType':'variable','keyContent':'','variableName':_0x1b86('0x29')},{'type':_0x1b86('0xb'),'content':'','key':_0x1b86('0x2a'),'keyType':_0x1b86('0x7'),'keyContent':'','variableName':_0x1b86('0x2b')}];break;}}return _0xf5419a;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 21171b3..b7c3f39 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 _0x4631=['InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','findOne','update','then','error','tracked','query','clone','body','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst'];(function(_0x2315cd,_0x3114cf){var _0x27bab5=function(_0x10b9c3){while(--_0x10b9c3){_0x2315cd['push'](_0x2315cd['shift']());}};_0x27bab5(++_0x3114cf);}(_0x4631,0xc3));var _0x1463=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x4631[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x1463('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x1463('0x1'))(_0x1463('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0x1463('0x3')),'sms':require(_0x1463('0x1'))(_0x1463('0x4')),'chat':require(_0x1463('0x1'))(_0x1463('0x5')),'whatsapp':require(_0x1463('0x1'))(_0x1463('0x6'))};function getInteractionId(_0x26f656,_0x1a55d4,_0xbab5b7){if(_0x26f656&&_0x26f656[_[_0x1463('0x7')](_0xbab5b7)+_0x1463('0x8')]){return _0x26f656[_[_0x1463('0x7')](_0xbab5b7)+_0x1463('0x8')];}else if(_0x26f656&&_0x26f656['id']){return _0x26f656['id'];}else if(_0x1a55d4&&_0x1a55d4['id']){return _0x1a55d4['id'];}else{return _0x1463('0x9');}}function log(_0x35802c,_0x361df9,_0x25f097,_0x431ebe,_0x2c4cc7,_0x4c40c4){loggers[_0x2c4cc7[_0x1463('0xa')]()][_0x35802c](_0x1463('0xb'),_0x4c40c4[_0x1463('0xc')](),_0x361df9?_0x361df9['id']:null,_0x361df9?_0x361df9[_0x1463('0xd')]:null,_0x361df9?_0x361df9[_0x1463('0xe')]:null,getInteractionId(_0x25f097,_0x431ebe,_0x2c4cc7),_0x25f097?JSON['stringify'](_0x25f097):_0x1463('0xf'));}function updateUser(_0x29e931,_0x2d2327,_0x3f2b6b,_0x345152,_0x279b42){db[_['upperFirst'](_0x345152)+'Interaction'][_0x1463('0x10')]({'where':{'id':getInteractionId(_0x2d2327,_0x3f2b6b,_0x345152)}})['then'](function(_0x4f3eec){if(_0x4f3eec){return _0x4f3eec[_0x1463('0x11')]({'UserId':_0x29e931?_0x29e931['id']:null});}})[_0x1463('0x12')](function(_0x2ae6cd){if(_0x2ae6cd){log('info',_0x29e931,_0x2d2327,_0x3f2b6b,_0x345152,_0x279b42);}})['catch'](function(){log(_0x1463('0x13'),_0x29e931,_0x2d2327,_0x3f2b6b,_0x345152,_0x279b42);});}exports[_0x1463('0x14')]=function(_0x5e02af,_0x374657){return function(_0x39a81,_0x15f98d,_0x302d3e){var _0xbbdcef=_0x39a81['user'];var _0x33c836={};var _0x49a183=_0x39a81[_0x1463('0x15')];if(_0x33c836){_0x33c836=_[_0x1463('0x16')](_0x39a81[_0x1463('0x17')]);_0x33c836=_[_0x1463('0x18')](_0x33c836,[_0x1463('0x17'),_0x1463('0x19'),_0x1463('0x1a'),_0x1463('0x1b'),_0x1463('0x1c')]);}updateUser(_0xbbdcef,_0x33c836,_0x49a183,_0x5e02af,_0x374657);_0x302d3e(null);};}; \ No newline at end of file +var _0xce5c=['omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','findOne','then','update','info','catch','error','tracked','query','clone','body'];(function(_0x17a3cd,_0x3f4e25){var _0x2e12f2=function(_0x208927){while(--_0x208927){_0x17a3cd['push'](_0x17a3cd['shift']());}};_0x2e12f2(++_0x3f4e25);}(_0xce5c,0xaa));var _0xcce5=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xce5c[_0x424357];return _0x29c68e;};'use strict';var _=require(_0xcce5('0x0'));var db=require(_0xcce5('0x1'))['db'];var loggers={'openchannel':require(_0xcce5('0x2'))(_0xcce5('0x3')),'mail':require(_0xcce5('0x2'))(_0xcce5('0x4')),'fax':require('../../config/logger')(_0xcce5('0x5')),'sms':require(_0xcce5('0x2'))(_0xcce5('0x6')),'chat':require(_0xcce5('0x2'))(_0xcce5('0x7')),'whatsapp':require('../../config/logger')(_0xcce5('0x8'))};function getInteractionId(_0x1d5bc4,_0x1baf52,_0x4ee3b2){if(_0x1d5bc4&&_0x1d5bc4[_[_0xcce5('0x9')](_0x4ee3b2)+_0xcce5('0xa')]){return _0x1d5bc4[_[_0xcce5('0x9')](_0x4ee3b2)+_0xcce5('0xa')];}else if(_0x1d5bc4&&_0x1d5bc4['id']){return _0x1d5bc4['id'];}else if(_0x1baf52&&_0x1baf52['id']){return _0x1baf52['id'];}else{return _0xcce5('0xb');}}function log(_0x1faf15,_0x6bfd1f,_0x5eca4b,_0x116b8c,_0xba21e9,_0x5814c1){loggers[_0xba21e9[_0xcce5('0xc')]()][_0x1faf15](_0xcce5('0xd'),_0x5814c1[_0xcce5('0xe')](),_0x6bfd1f?_0x6bfd1f['id']:null,_0x6bfd1f?_0x6bfd1f[_0xcce5('0xf')]:null,_0x6bfd1f?_0x6bfd1f[_0xcce5('0x10')]:null,getInteractionId(_0x5eca4b,_0x116b8c,_0xba21e9),_0x5eca4b?JSON['stringify'](_0x5eca4b):_0xcce5('0x11'));}function updateUser(_0x91a337,_0x29eb4c,_0x119604,_0x8557cf,_0x595b13){db[_['upperFirst'](_0x8557cf)+'Interaction'][_0xcce5('0x12')]({'where':{'id':getInteractionId(_0x29eb4c,_0x119604,_0x8557cf)}})[_0xcce5('0x13')](function(_0xe0f255){if(_0xe0f255){return _0xe0f255[_0xcce5('0x14')]({'UserId':_0x91a337?_0x91a337['id']:null});}})['then'](function(_0x4414d5){if(_0x4414d5){log(_0xcce5('0x15'),_0x91a337,_0x29eb4c,_0x119604,_0x8557cf,_0x595b13);}})[_0xcce5('0x16')](function(){log(_0xcce5('0x17'),_0x91a337,_0x29eb4c,_0x119604,_0x8557cf,_0x595b13);});}exports[_0xcce5('0x18')]=function(_0x7552c9,_0x4325b1){return function(_0x4dd595,_0x24d243,_0x167b49){var _0x47d1c2=_0x4dd595['user'];var _0x20b8cd={};var _0xa6c25a=_0x4dd595[_0xcce5('0x19')];if(_0x20b8cd){_0x20b8cd=_[_0xcce5('0x1a')](_0x4dd595[_0xcce5('0x1b')]);_0x20b8cd=_[_0xcce5('0x1c')](_0x20b8cd,[_0xcce5('0x1b'),_0xcce5('0x1d'),_0xcce5('0x1e'),_0xcce5('0x1f'),_0xcce5('0x20')]);}updateUser(_0x47d1c2,_0x20b8cd,_0xa6c25a,_0x7552c9,_0x4325b1);_0x167b49(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 328d348..fa67ce7 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 _0x2016=['parse','hasOwnProperty','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','../../mysqldb','data1','license','split','createDecipher','format','update','base64','utf8','final'];(function(_0x33b399,_0x5f03d2){var _0x1959c7=function(_0x316f72){while(--_0x316f72){_0x33b399['push'](_0x33b399['shift']());}};_0x1959c7(++_0x5f03d2);}(_0x2016,0xa3));var _0x6201=function(_0x339816,_0x1a3e1b){_0x339816=_0x339816-0x0;var _0x2f1710=_0x2016[_0x339816];return _0x2f1710;};'use strict';var crypto=require(_0x6201('0x0'));var util=require(_0x6201('0x1'));var compose=require('composable-middleware');var db=require(_0x6201('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3806ea,_0x152eb9){if(_0x3806ea&&_0x152eb9){if(_0x152eb9[_0x6201('0x3')]&&_0x152eb9[_0x6201('0x4')]){var _0x215c7a=_0x152eb9[_0x6201('0x3')];var _0x16ed29=_0x152eb9[_0x6201('0x4')];var _0x101983=_0x215c7a[_0x6201('0x5')]('-')[0x4];var _0x345223=_0x215c7a[_0x6201('0x5')]('-')[0x0];var _0x13c540=crypto[_0x6201('0x6')]('aes-256-ctr',util[_0x6201('0x7')]('%s:%s:%s',_0x101983,_0x215c7a,_0x345223));var _0x1dd3d7=_0x13c540[_0x6201('0x8')](_0x16ed29,_0x6201('0x9'),_0x6201('0xa'));_0x1dd3d7+=_0x13c540[_0x6201('0xb')](_0x6201('0xa'));var _0x3d79a5=JSON[_0x6201('0xc')](_0x1dd3d7);return _0x3d79a5[_0x6201('0xd')](_0x3806ea)?_0x3d79a5[_0x3806ea]:null;}}return null;}function isLimit(_0x5414bb,_0x59988f,_0x3fcf11,_0x16f1b5){var _0x5b5b0d=_0x59988f;return compose()['use'](function(_0x4a5195,_0x306030,_0x5cda3b){return db[_0x6201('0xe')][_0x6201('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x6201('0x10')](function(_0x583852){var _0x39da96=getValueFromLicense(_0x5414bb,_0x583852);return _0x39da96?_0x39da96:_0x5b5b0d;})[_0x6201('0x10')](function(_0x42a050){_0x5b5b0d=_0x42a050;return _0x3fcf11['count'](_0x16f1b5);})[_0x6201('0x10')](function(_0x167391){if(_0x167391>=_0x5b5b0d){return _0x306030[_0x6201('0x11')](0x193)[_0x6201('0x12')]({'message':util[_0x6201('0x7')](_0x6201('0x13'),_0x5414bb)});}_0x5cda3b();})[_0x6201('0x14')](function(_0x328341){_0x5cda3b(_0x328341);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x6201('0x15')],{'where':{'$or':[{'role':_0x6201('0x16')},{'role':_0x6201('0x17')}]}});}exports[_0x6201('0x18')]=isUserLimit; \ No newline at end of file +var _0x1654=['hasOwnProperty','use','then','count','status','json','catch','users','User','user','isUserLimit','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse'];(function(_0x5a1686,_0x56b6c0){var _0x21a488=function(_0x499eed){while(--_0x499eed){_0x5a1686['push'](_0x5a1686['shift']());}};_0x21a488(++_0x56b6c0);}(_0x1654,0x143));var _0x4165=function(_0x172eed,_0x5b3e16){_0x172eed=_0x172eed-0x0;var _0x291654=_0x1654[_0x172eed];return _0x291654;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0x4165('0x0'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x21d561,_0xd8e63){if(_0x21d561&&_0xd8e63){if(_0xd8e63[_0x4165('0x1')]&&_0xd8e63[_0x4165('0x2')]){var _0x14b3ed=_0xd8e63[_0x4165('0x1')];var _0x1efd62=_0xd8e63[_0x4165('0x2')];var _0x117f57=_0x14b3ed[_0x4165('0x3')]('-')[0x4];var _0x90b39e=_0x14b3ed[_0x4165('0x3')]('-')[0x0];var _0x5ccf92=crypto[_0x4165('0x4')](_0x4165('0x5'),util[_0x4165('0x6')](_0x4165('0x7'),_0x117f57,_0x14b3ed,_0x90b39e));var _0x53a1a7=_0x5ccf92[_0x4165('0x8')](_0x1efd62,_0x4165('0x9'),'utf8');_0x53a1a7+=_0x5ccf92[_0x4165('0xa')](_0x4165('0xb'));var _0x42fe59=JSON[_0x4165('0xc')](_0x53a1a7);return _0x42fe59[_0x4165('0xd')](_0x21d561)?_0x42fe59[_0x21d561]:null;}}return null;}function isLimit(_0x415ed7,_0xf9ee52,_0x4be8c6,_0x4d90fe){var _0xa49004=_0xf9ee52;return compose()[_0x4165('0xe')](function(_0x22ac6a,_0x27381a,_0x42faee){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x4165('0xf')](function(_0x727497){var _0x5099c8=getValueFromLicense(_0x415ed7,_0x727497);return _0x5099c8?_0x5099c8:_0xa49004;})['then'](function(_0x168b4d){_0xa49004=_0x168b4d;return _0x4be8c6[_0x4165('0x10')](_0x4d90fe);})[_0x4165('0xf')](function(_0x46fbae){if(_0x46fbae>=_0xa49004){return _0x27381a[_0x4165('0x11')](0x193)[_0x4165('0x12')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x415ed7)});}_0x42faee();})[_0x4165('0x13')](function(_0x5416da){_0x42faee(_0x5416da);});});}function isUserLimit(){return isLimit(_0x4165('0x14'),0x1,db[_0x4165('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x4165('0x16')}]}});}exports[_0x4165('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fe0b96a..574e76c 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 _0x8755=['=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','start','$startsWith','pop','DATE','utcOffset','hours','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq'];(function(_0x4debf8,_0x1aebd7){var _0x42823f=function(_0x551488){while(--_0x551488){_0x4debf8['push'](_0x4debf8['shift']());}};_0x42823f(++_0x1aebd7);}(_0x8755,0x83));var _0x5875=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8755[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5875('0x0'));var moment=require('moment');exports[_0x5875('0x1')]=function(_0x47b472){var _0x98785c={'conditions':[]};_0x98785c[_0x5875('0x2')]=_[_0x5875('0x3')](_0x47b472,_0x5875('0x4'))?'or':_0x5875('0x5');var _0x1bb6b5=_0x47b472[_0x5875('0x6')](_0x5875('0x7'),'')[_0x5875('0x6')](_0x5875('0x4'),'')[_0x5875('0x8')]('||');for(var _0x7a417=0x0;_0x7a417<_0x1bb6b5[_0x5875('0x9')];_0x7a417++){var _0x50365d=_0x1bb6b5[_0x7a417][_0x5875('0x8')](':=');var _0x26456b=_0x50365d[0x0];var _0x3af4b7=_0x50365d[_0x5875('0xa')](0x1);_0x3af4b7[_0x5875('0xb')](function(_0x181279){var _0x5ee5f9=_0x181279[_0x5875('0x8')]('[')['shift']();var _0x21d0a5=_0x181279[_0x5875('0xc')](/\[(.*?)\]/g);_0x21d0a5[_0x5875('0xb')](function(_0x266025){var _0x2c76f5=_0x266025[_0x5875('0x8')]('[')[_0x5875('0xd')](function(_0x4c4330){return _0x4c4330[_0x5875('0xe')](']')>-0x1;})[_0x5875('0xf')](function(_0x2a365e){return _0x2a365e[_0x5875('0x8')](']')[0x0];})[0x0];_0x98785c[_0x5875('0x10')][_0x5875('0x11')]({'field':_0x26456b,'operator':_0x5ee5f9,'value':_0x2c76f5});});});}return _0x98785c;};exports[_0x5875('0x12')]=function(_0x1ba9f3,_0x46e378,_0x5d0d5c){var _0x9bbbea={};if(_0x46e378==='DATE'){if(_0x5d0d5c[_0x5875('0x13')]==='$eq'){_0x5d0d5c[_0x5875('0x13')]=_0x5875('0x14');_0x5d0d5c[_0x5875('0x15')]+=','+_0x5d0d5c[_0x5875('0x15')];}else if(_[_0x5875('0x16')]([_0x5875('0x17'),_0x5875('0x18')],_0x5d0d5c[_0x5875('0x13')])){_0x5d0d5c[_0x5875('0x15')]=moment(_0x5d0d5c[_0x5875('0x15')])[_0x5875('0x19')](0x1,_0x5875('0x1a'))[_0x5875('0x1b')](_0x5875('0x1c'));}}if(_0x5d0d5c['castTo']){_0x46e378=_0x5d0d5c['castTo'];_0x9bbbea[_0x5875('0x1d')]=_0x5875('0x1e')+_0x1ba9f3+'.'+_0x5d0d5c[_0x5875('0x1f')]+_0x5875('0x20')+_0x5d0d5c[_0x5875('0x21')]+')\x20'+parseOperator(_0x5d0d5c[_0x5875('0x13')]);}else{_0x9bbbea['text']=_0x1ba9f3+'.'+_0x5d0d5c[_0x5875('0x1f')]+'\x20'+parseOperator(_0x5d0d5c[_0x5875('0x13')]);}if(_[_0x5875('0x16')]([_0x5875('0x22'),_0x5875('0x23')],_0x5d0d5c[_0x5875('0x13')]))_0x9bbbea[_0x5875('0x1d')]='('+_0x9bbbea['text']+'\x20OR\x20'+_0x1ba9f3+'.'+_0x5d0d5c[_0x5875('0x1f')]+_0x5875('0x24');_0x9bbbea['value']=parseValue(_0x46e378,_0x5d0d5c['operator'],_0x5d0d5c[_0x5875('0x15')]);return _0x9bbbea;};function parseOperator(_0x263166){var _0x5f0769;switch(_0x263166){case'$in':_0x5f0769=_0x5875('0x25');break;case _0x5875('0x23'):_0x5f0769=_0x5875('0x26');break;case _0x5875('0x27'):_0x5f0769=_0x5875('0x28');break;case _0x5875('0x22'):_0x5f0769=_0x5875('0x29');break;case _0x5875('0x2a'):case'$startsWith':case _0x5875('0x2b'):_0x5f0769=_0x5875('0x2c');break;case _0x5875('0x2d'):_0x5f0769=_0x5875('0x2e');break;case'$gt':_0x5f0769=_0x5875('0x2f');break;case _0x5875('0x18'):_0x5f0769=_0x5875('0x30');break;case'$gte':_0x5f0769=_0x5875('0x31');break;case _0x5875('0x14'):_0x5f0769='BETWEEN\x20?\x20AND\x20?';break;}return _0x5f0769;}function parseValue(_0x57dba5,_0x4f2d7d,_0x1f985b){var _0x15f711={'start':undefined,'end':undefined};switch(_0x4f2d7d){case'$in':case'$notIn':_0x15f711['start']=_0x1f985b[_0x5875('0x8')](',');break;case'$substring':_0x15f711[_0x5875('0x32')]='%'+_0x1f985b+'%';break;case _0x5875('0x33'):_0x15f711[_0x5875('0x32')]=_0x1f985b+'%';break;case _0x5875('0x2b'):_0x15f711[_0x5875('0x32')]='%'+_0x1f985b;break;case _0x5875('0x14'):var _0x774073=_0x1f985b[_0x5875('0x8')](',');var _0x1f985b=_0x774073['shift']();var _0x239e21=_0x774073[_0x5875('0x34')]();if(_0x57dba5===_0x5875('0x35')){_0x1f985b=moment(_0x1f985b)[_0x5875('0x36')](0x0,!![])[_0x5875('0x1b')]();_0x239e21=moment(_0x239e21)['utcOffset'](0x0,!![])[_0x5875('0x19')](0x17,_0x5875('0x37'))[_0x5875('0x19')](0x3b,'minutes')[_0x5875('0x19')](0x3b,_0x5875('0x38'))[_0x5875('0x1b')]();}_0x15f711={'start':_0x1f985b,'end':_0x239e21};break;default:_0x15f711[_0x5875('0x32')]=_0x1f985b;break;}return _0x15f711;} \ No newline at end of file +var _0xffe0=['$lt','>\x20?','<=\x20?','>=\x20?','start','pop','utcOffset','add','seconds','lodash','moment','sqlOperator','[$or]','replace','[$and]','split','slice','shift','forEach','filter','indexOf','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0xffe0,0x103));var _0x0ffe=function(_0x4b41a2,_0x35314a){_0x4b41a2=_0x4b41a2-0x0;var _0x55d34f=_0xffe0[_0x4b41a2];return _0x55d34f;};'use strict';var _=require(_0x0ffe('0x0'));var moment=require(_0x0ffe('0x1'));exports['parseSearch']=function(_0x3d9659){var _0x431fe3={'conditions':[]};_0x431fe3[_0x0ffe('0x2')]=_['startsWith'](_0x3d9659,_0x0ffe('0x3'))?'or':'and';var _0x49f23d=_0x3d9659[_0x0ffe('0x4')](_0x0ffe('0x5'),'')[_0x0ffe('0x4')](_0x0ffe('0x3'),'')[_0x0ffe('0x6')]('||');for(var _0x433566=0x0;_0x433566<_0x49f23d['length'];_0x433566++){var _0x2c2470=_0x49f23d[_0x433566]['split'](':=');var _0x5f3d90=_0x2c2470[0x0];var _0x4ac690=_0x2c2470[_0x0ffe('0x7')](0x1);_0x4ac690['forEach'](function(_0x2086be){var _0x40157e=_0x2086be[_0x0ffe('0x6')]('[')[_0x0ffe('0x8')]();var _0x2cc5f9=_0x2086be['match'](/\[(.*?)\]/g);_0x2cc5f9[_0x0ffe('0x9')](function(_0x42964d){var _0x6e3d02=_0x42964d[_0x0ffe('0x6')]('[')[_0x0ffe('0xa')](function(_0x104cd1){return _0x104cd1[_0x0ffe('0xb')](']')>-0x1;})['map'](function(_0x274d7c){return _0x274d7c[_0x0ffe('0x6')](']')[0x0];})[0x0];_0x431fe3[_0x0ffe('0xc')][_0x0ffe('0xd')]({'field':_0x5f3d90,'operator':_0x40157e,'value':_0x6e3d02});});});}return _0x431fe3;};exports[_0x0ffe('0xe')]=function(_0x385978,_0x37c459,_0x4ba6c8){var _0x157bc1={};if(_0x37c459===_0x0ffe('0xf')){if(_0x4ba6c8['operator']==='$eq'){_0x4ba6c8[_0x0ffe('0x10')]=_0x0ffe('0x11');_0x4ba6c8[_0x0ffe('0x12')]+=','+_0x4ba6c8[_0x0ffe('0x12')];}else if(_[_0x0ffe('0x13')]([_0x0ffe('0x14'),_0x0ffe('0x15')],_0x4ba6c8['operator'])){_0x4ba6c8[_0x0ffe('0x12')]=moment(_0x4ba6c8[_0x0ffe('0x12')])['add'](0x1,_0x0ffe('0x16'))[_0x0ffe('0x17')](_0x0ffe('0x18'));}}if(_0x4ba6c8[_0x0ffe('0x19')]){_0x37c459=_0x4ba6c8[_0x0ffe('0x19')];_0x157bc1[_0x0ffe('0x1a')]=_0x0ffe('0x1b')+_0x385978+'.'+_0x4ba6c8[_0x0ffe('0x1c')]+_0x0ffe('0x1d')+_0x4ba6c8[_0x0ffe('0x19')]+')\x20'+parseOperator(_0x4ba6c8[_0x0ffe('0x10')]);}else{_0x157bc1[_0x0ffe('0x1a')]=_0x385978+'.'+_0x4ba6c8[_0x0ffe('0x1c')]+'\x20'+parseOperator(_0x4ba6c8[_0x0ffe('0x10')]);}if(_[_0x0ffe('0x13')]([_0x0ffe('0x1e'),_0x0ffe('0x1f')],_0x4ba6c8['operator']))_0x157bc1['text']='('+_0x157bc1[_0x0ffe('0x1a')]+_0x0ffe('0x20')+_0x385978+'.'+_0x4ba6c8['field']+_0x0ffe('0x21');_0x157bc1[_0x0ffe('0x12')]=parseValue(_0x37c459,_0x4ba6c8['operator'],_0x4ba6c8[_0x0ffe('0x12')]);return _0x157bc1;};function parseOperator(_0x371dbf){var _0x447c5c;switch(_0x371dbf){case _0x0ffe('0x22'):_0x447c5c='IN\x20?';break;case _0x0ffe('0x1f'):_0x447c5c='NOT\x20IN\x20?';break;case'$eq':_0x447c5c=_0x0ffe('0x23');break;case _0x0ffe('0x1e'):_0x447c5c=_0x0ffe('0x24');break;case _0x0ffe('0x25'):case _0x0ffe('0x26'):case _0x0ffe('0x27'):_0x447c5c=_0x0ffe('0x28');break;case _0x0ffe('0x29'):_0x447c5c='<\x20?';break;case _0x0ffe('0x14'):_0x447c5c=_0x0ffe('0x2a');break;case _0x0ffe('0x15'):_0x447c5c=_0x0ffe('0x2b');break;case'$gte':_0x447c5c=_0x0ffe('0x2c');break;case _0x0ffe('0x11'):_0x447c5c='BETWEEN\x20?\x20AND\x20?';break;}return _0x447c5c;}function parseValue(_0x4c3235,_0x4b5e25,_0x47fb67){var _0x343643={'start':undefined,'end':undefined};switch(_0x4b5e25){case _0x0ffe('0x22'):case'$notIn':_0x343643['start']=_0x47fb67[_0x0ffe('0x6')](',');break;case _0x0ffe('0x25'):_0x343643[_0x0ffe('0x2d')]='%'+_0x47fb67+'%';break;case _0x0ffe('0x26'):_0x343643['start']=_0x47fb67+'%';break;case _0x0ffe('0x27'):_0x343643[_0x0ffe('0x2d')]='%'+_0x47fb67;break;case _0x0ffe('0x11'):var _0x2efe2f=_0x47fb67['split'](',');var _0x47fb67=_0x2efe2f[_0x0ffe('0x8')]();var _0x4df6e8=_0x2efe2f[_0x0ffe('0x2e')]();if(_0x4c3235===_0x0ffe('0xf')){_0x47fb67=moment(_0x47fb67)['utcOffset'](0x0,!![])[_0x0ffe('0x17')]();_0x4df6e8=moment(_0x4df6e8)[_0x0ffe('0x2f')](0x0,!![])[_0x0ffe('0x30')](0x17,'hours')[_0x0ffe('0x30')](0x3b,'minutes')['add'](0x3b,_0x0ffe('0x31'))[_0x0ffe('0x17')]();}_0x343643={'start':_0x47fb67,'end':_0x4df6e8};break;default:_0x343643['start']=_0x47fb67;break;}return _0x343643;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 1e5f782..45d4d91 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 _0x031c=['nolimit','order','where','pick','filter','columns','merge','VIRTUAL','lower','options','sequelize','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','$lte','format','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','length','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','join','getOptions','query','$id','model','name','intersection','attributes'];(function(_0x1566e7,_0x1f73a8){var _0x259053=function(_0x179366){while(--_0x179366){_0x1566e7['push'](_0x1566e7['shift']());}};_0x259053(++_0x1f73a8);}(_0x031c,0x140));var _0xc031=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x031c[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var sequelize=require(_0xc031('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3f985d){var _0x3abf1e=['ne'];try{var _0xcc2d6a=JSON['parse'](_0x3f985d);var _0x3e355d=Object[_0xc031('0x1')](_0xcc2d6a)[0x0];return _0x3abf1e[_0xc031('0x2')](_0x3e355d);}catch(_0x18eb4a){return![];}}function getOperatorValue(_0x43222d){var _0x5d5cb8=JSON[_0xc031('0x3')](_0x43222d);var _0x1fdfaa=Object[_0xc031('0x1')](_0x5d5cb8)[0x0];var _0x9f14cf=_0x5d5cb8[_0x1fdfaa];return{['$'+_0x1fdfaa]:_0x9f14cf};}exports[_0xc031('0x4')]=function(_0x4fe8dd){var _0xc2db46=null;if(_0x4fe8dd){_0xc2db46=_0x4fe8dd[_0xc031('0x5')](',');}return _0xc2db46;};exports[_0xc031('0x6')]=function(_0x2b8edd,_0x114be8){var _0x4b7b9c={};if(!_[_0xc031('0x7')](_0x2b8edd)){_[_0xc031('0x8')](_0x2b8edd,function(_0xe1d4d6,_0x4cecb1){try{if(_0x114be8){var _0x5e51f2=_[_0xc031('0x9')](_0x114be8,{'name':_0x4cecb1})||{};if(hasSequelizeOperator(_0xe1d4d6)){_0x4b7b9c[_0x4cecb1]=getOperatorValue(_0xe1d4d6);}else if(_0x5e51f2[_0xc031('0xa')]===_0xc031('0xb')&&_[_0xc031('0xc')](_0xe1d4d6)){var _0x201520=JSON[_0xc031('0x3')](_0xe1d4d6);var _0x1f25cb={'$gte':moment(moment(_0x201520[_0xc031('0xd')])['format'](_0xc031('0xe')))[_0xc031('0xf')]()['format'](),'$lte':moment(moment(_0x201520[_0xc031('0x10')])[_0xc031('0x11')]('YYYY-MM-DD'))[_0xc031('0xf')]()[_0xc031('0x12')](0x1,'s')[_0xc031('0x11')]()};_0x4b7b9c[_0x4cecb1]=_0x1f25cb;}else if(_0x5e51f2['name']===_0xc031('0x13')){_0x4b7b9c[_0x4cecb1]=_0xe1d4d6;}else{_0x4b7b9c[_0x4cecb1]=_['isArray'](_0xe1d4d6)?_0xe1d4d6:JSON[_0xc031('0x3')](_0xe1d4d6);}}else{_0x4b7b9c[_0x4cecb1]=_[_0xc031('0x14')](_0xe1d4d6)?_0xe1d4d6:JSON[_0xc031('0x3')](_0xe1d4d6);}}catch(_0xd89011){_0x4b7b9c[_0x4cecb1]=_0xe1d4d6[_0xc031('0x5')](',');}});}return _0x4b7b9c;};exports[_0xc031('0x15')]=function(_0x51b530){_0x51b530=parseInt(_0x51b530,0xa);if(!_0x51b530||_0x51b530<0x0){_0x51b530=LIMIT_VALUE;}return _0x51b530;};exports[_0xc031('0x16')]=function(_0x54b29d){_0x54b29d=parseInt(_0x54b29d,0xa);if(!_0x54b29d||_0x54b29d<0x0){_0x54b29d=0x0;}return _0x54b29d;};exports[_0xc031('0x17')]=function(_0x411934){var _0x22a0b1,_0x5ec79f=null;if(_0x411934){_0x22a0b1=_0x411934[_0xc031('0x5')](',');_0x5ec79f=_[_0xc031('0x18')](_0x22a0b1,function(_0x3355de){if(_0x3355de[_0xc031('0x19')]('-')===0x0){return[_0x3355de===_0xc031('0x1a')?sequelize[_0xc031('0x1b')](sequelize['col'](_0xc031('0x1a')),_0xc031('0x1c')):_0x3355de[_0xc031('0x1d')](0x1),_0xc031('0x1e')];}else{return[_0x3355de===_0xc031('0x1a')?sequelize[_0xc031('0x1b')](sequelize[_0xc031('0x1f')](_0xc031('0x1a')),_0xc031('0x1c')):_0x3355de,_0xc031('0x20')];}});}return _0x5ec79f;};exports['omit']=function(_0x518457,_0x3ea3ce){if(_['isEmpty'](_0x518457)){return _0x518457;}if(_[_0xc031('0x14')](_0x518457)){for(var _0x49d1dd=0x0;_0x49d1dd<_0x518457[_0xc031('0x21')];_0x49d1dd+=0x1){_0x518457[_0x49d1dd]=this['omit'](_0x518457[_0x49d1dd],_0x3ea3ce);}return _0x518457;}if(!_['isObject'](_0x518457)){return _0x518457;}if(_['isString'](_0x3ea3ce)){_0x3ea3ce=[_0x3ea3ce];}if(!_[_0xc031('0x14')](_0x3ea3ce)){return _0x518457;}for(var _0x479e6d=0x0;_0x479e6d<_0x3ea3ce[_0xc031('0x21')];_0x479e6d+=0x1){_[_0xc031('0x22')](_0x518457,_0x3ea3ce[_0x479e6d]);}for(var _0x61179e in _0x518457){if(_0x518457[_0xc031('0x23')](_0x61179e)){_0x518457[_0x61179e]=this[_0xc031('0x24')](_0x518457[_0x61179e],_0x3ea3ce);}}return _0x518457;};exports[_0xc031('0x25')]=function(_0xf1c3c6){return _0xf1c3c6[_0xc031('0x26')](RegExp(_0xc031('0x27')))?!![]:![];};exports[_0xc031('0x28')]=function(_0x5e479a){return _0x5e479a[_0xc031('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xc031('0x29')]=function(_0x4c6487){var _0x2c2dd1=[];_0x4c6487['split'](/[ ,]+/)[_0xc031('0x2a')](function(_0x118755){_0x118755=_0x118755[_0xc031('0x2b')](/([^:]")"+/g,'$1');_0x118755='+'+_0x118755+'*';var _0x37f805=/[ `!@#$%^&*()_\-?~]/;if(_0x118755[_0xc031('0x26')](_0x37f805))_0x118755='\x22'+_0x118755+'\x22';_0x2c2dd1['push'](_0x118755);});return _0x2c2dd1[_0xc031('0x2c')]('\x20');};exports[_0xc031('0x2d')]=function(_0x6f0d57,_0x2b28e6,_0x5eed3a){var _0x529ecb={},_0x34c393={};if(_0x2b28e6[_0xc031('0x2e')][_0xc031('0x2f')]){_0x2b28e6[_0xc031('0x2e')]['id']=_0x2b28e6[_0xc031('0x2e')][_0xc031('0x2f')];delete _0x2b28e6[_0xc031('0x2e')][_0xc031('0x2f')];}_0x529ecb[_0xc031('0x30')]=_[_0xc031('0x18')](_0x6f0d57,_0xc031('0x31'));_0x529ecb[_0xc031('0x2e')]=_[_0xc031('0x1')](_0x2b28e6[_0xc031('0x2e')]);_0x529ecb[_0xc031('0x6')]=_[_0xc031('0x32')](_0x529ecb[_0xc031('0x30')],_0x529ecb[_0xc031('0x2e')]);_0x34c393[_0xc031('0x33')]=_[_0xc031('0x32')](_0x529ecb[_0xc031('0x30')],this[_0xc031('0x4')](_0x2b28e6[_0xc031('0x2e')][_0xc031('0x4')]));_0x34c393[_0xc031('0x33')]=_0x34c393['attributes'][_0xc031('0x21')]?_0x34c393[_0xc031('0x33')]:_0x529ecb[_0xc031('0x30')];if(!_0x2b28e6[_0xc031('0x2e')]['hasOwnProperty'](_0xc031('0x34'))){_0x34c393[_0xc031('0x15')]=this[_0xc031('0x15')](_0x2b28e6['query'][_0xc031('0x15')]);_0x34c393[_0xc031('0x16')]=this['offset'](_0x2b28e6[_0xc031('0x2e')][_0xc031('0x16')]);}_0x34c393[_0xc031('0x35')]=this[_0xc031('0x17')](_0x2b28e6['query'][_0xc031('0x17')]);_0x34c393[_0xc031('0x36')]=this[_0xc031('0x6')](_[_0xc031('0x37')](_0x2b28e6['query'],_0x529ecb[_0xc031('0x6')]),_0x6f0d57);if(_0x2b28e6[_0xc031('0x2e')]['filter']){var _0x87dd8b=_0x6f0d57;var _0x217c1c=_0x2b28e6[_0xc031('0x2e')][_0xc031('0x38')];if(typeof _0x217c1c==='object'){_0x87dd8b=_[_0xc031('0x38')](_0x6f0d57,function(_0x9b39ae){return _[_0xc031('0x2')](_0x217c1c[_0xc031('0x39')],_0x9b39ae['name']);});_0x217c1c=_0x217c1c['value'];}_0x34c393[_0xc031('0x36')]=_[_0xc031('0x3a')](_0x34c393['where'],{'$or':_[_0xc031('0x18')](_0x87dd8b,function(_0x176455){if(_0x176455[_0xc031('0xa')]!==_0xc031('0x3b')){if(_0x5eed3a){return sequelize[_0xc031('0x36')](sequelize['fn'](_0xc031('0x3c'),sequelize['col'](_0x176455[_0xc031('0x31')])),{'$like':sequelize['fn'](_0xc031('0x3c'),'%'+_0x2b28e6[_0xc031('0x2e')][_0xc031('0x38')]+'%')});}else{var _0x26138c={};_0x26138c[_0x176455[_0xc031('0x31')]]={'$like':'%'+_0x2b28e6[_0xc031('0x2e')][_0xc031('0x38')]+'%'};return _0x26138c;}}})});}_0x34c393=_[_0xc031('0x3a')]({},_0x34c393,_0x2b28e6[_0xc031('0x3d')]);return _0x34c393;}; \ No newline at end of file +var _0x78e0=['where','pick','filter','columns','merge','VIRTUAL','lower','options','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','utc','YYYY-MM-DD','subtract','name','sort','map','priority','cast','col','unsigned','DESC','ASC','omit','isArray','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','getFullTextValue','forEach','push','join','getOptions','query','$id','intersection','model','attributes','nolimit','limit','offset'];(function(_0x4d4216,_0x351e90){var _0x8b1e35=function(_0x551f37){while(--_0x551f37){_0x4d4216['push'](_0x4d4216['shift']());}};_0x8b1e35(++_0x351e90);}(_0x78e0,0x12a));var _0x078e=function(_0x3ee771,_0x2b8251){_0x3ee771=_0x3ee771-0x0;var _0x1e99fa=_0x78e0[_0x3ee771];return _0x1e99fa;};'use strict';var _=require('lodash');var sequelize=require(_0x078e('0x0'));var moment=require(_0x078e('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2642bb){var _0xba07f9=['ne'];try{var _0x4a324b=JSON['parse'](_0x2642bb);var _0x478d21=Object[_0x078e('0x2')](_0x4a324b)[0x0];return _0xba07f9[_0x078e('0x3')](_0x478d21);}catch(_0x31b808){return![];}}function getOperatorValue(_0x4b7de6){var _0x5420e9=JSON[_0x078e('0x4')](_0x4b7de6);var _0x56eff5=Object[_0x078e('0x2')](_0x5420e9)[0x0];var _0x2b8496=_0x5420e9[_0x56eff5];return{['$'+_0x56eff5]:_0x2b8496};}exports[_0x078e('0x5')]=function(_0x44a46e){var _0x5c6364=null;if(_0x44a46e){_0x5c6364=_0x44a46e[_0x078e('0x6')](',');}return _0x5c6364;};exports[_0x078e('0x7')]=function(_0x2271b3,_0x1ef381){var _0x451752={};if(!_[_0x078e('0x8')](_0x2271b3)){_[_0x078e('0x9')](_0x2271b3,function(_0x59203c,_0x284464){try{if(_0x1ef381){var _0x392829=_[_0x078e('0xa')](_0x1ef381,{'name':_0x284464})||{};if(hasSequelizeOperator(_0x59203c)){_0x451752[_0x284464]=getOperatorValue(_0x59203c);}else if(_0x392829[_0x078e('0xb')]===_0x078e('0xc')&&_[_0x078e('0xd')](_0x59203c)){var _0x4822eb=JSON['parse'](_0x59203c);var _0xb4fc70={'$gte':moment(moment(_0x4822eb[_0x078e('0xe')])[_0x078e('0xf')]('YYYY-MM-DD'))[_0x078e('0x10')]()['format'](),'$lte':moment(moment(_0x4822eb['$lte'])[_0x078e('0xf')](_0x078e('0x11')))['utc']()[_0x078e('0x12')](0x1,'s')[_0x078e('0xf')]()};_0x451752[_0x284464]=_0xb4fc70;}else if(_0x392829[_0x078e('0x13')]==='uniqueid'){_0x451752[_0x284464]=_0x59203c;}else{_0x451752[_0x284464]=_['isArray'](_0x59203c)?_0x59203c:JSON[_0x078e('0x4')](_0x59203c);}}else{_0x451752[_0x284464]=_['isArray'](_0x59203c)?_0x59203c:JSON[_0x078e('0x4')](_0x59203c);}}catch(_0x238ade){_0x451752[_0x284464]=_0x59203c[_0x078e('0x6')](',');}});}return _0x451752;};exports['limit']=function(_0x5c873e){_0x5c873e=parseInt(_0x5c873e,0xa);if(!_0x5c873e||_0x5c873e<0x0){_0x5c873e=LIMIT_VALUE;}return _0x5c873e;};exports['offset']=function(_0x79764b){_0x79764b=parseInt(_0x79764b,0xa);if(!_0x79764b||_0x79764b<0x0){_0x79764b=0x0;}return _0x79764b;};exports[_0x078e('0x14')]=function(_0x217bdc){var _0x5e9567,_0x3b7921=null;if(_0x217bdc){_0x5e9567=_0x217bdc['split'](',');_0x3b7921=_[_0x078e('0x15')](_0x5e9567,function(_0x1894d7){if(_0x1894d7['indexOf']('-')===0x0){return[_0x1894d7===_0x078e('0x16')?sequelize[_0x078e('0x17')](sequelize[_0x078e('0x18')](_0x078e('0x16')),_0x078e('0x19')):_0x1894d7['substr'](0x1),_0x078e('0x1a')];}else{return[_0x1894d7===_0x078e('0x16')?sequelize[_0x078e('0x17')](sequelize[_0x078e('0x18')]('priority'),_0x078e('0x19')):_0x1894d7,_0x078e('0x1b')];}});}return _0x3b7921;};exports[_0x078e('0x1c')]=function(_0x24bfc4,_0x389c67){if(_[_0x078e('0x8')](_0x24bfc4)){return _0x24bfc4;}if(_[_0x078e('0x1d')](_0x24bfc4)){for(var _0x522f8b=0x0;_0x522f8b<_0x24bfc4[_0x078e('0x1e')];_0x522f8b+=0x1){_0x24bfc4[_0x522f8b]=this[_0x078e('0x1c')](_0x24bfc4[_0x522f8b],_0x389c67);}return _0x24bfc4;}if(!_[_0x078e('0x1f')](_0x24bfc4)){return _0x24bfc4;}if(_[_0x078e('0x20')](_0x389c67)){_0x389c67=[_0x389c67];}if(!_[_0x078e('0x1d')](_0x389c67)){return _0x24bfc4;}for(var _0x4d9f2a=0x0;_0x4d9f2a<_0x389c67[_0x078e('0x1e')];_0x4d9f2a+=0x1){_[_0x078e('0x21')](_0x24bfc4,_0x389c67[_0x4d9f2a]);}for(var _0x15f290 in _0x24bfc4){if(_0x24bfc4[_0x078e('0x22')](_0x15f290)){_0x24bfc4[_0x15f290]=this[_0x078e('0x1c')](_0x24bfc4[_0x15f290],_0x389c67);}}return _0x24bfc4;};exports[_0x078e('0x23')]=function(_0x1b625d){return _0x1b625d['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x48f787){return _0x48f787[_0x078e('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x078e('0x25')]=function(_0x5c2a86){var _0x23fab8=[];_0x5c2a86[_0x078e('0x6')](/[ ,]+/)[_0x078e('0x26')](function(_0x5cf9ad){_0x5cf9ad=_0x5cf9ad['replace'](/([^:]")"+/g,'$1');_0x5cf9ad='+'+_0x5cf9ad+'*';var _0x4d387c=/[ `!@#$%^&*()_\-?~]/;if(_0x5cf9ad['match'](_0x4d387c))_0x5cf9ad='\x22'+_0x5cf9ad+'\x22';_0x23fab8[_0x078e('0x27')](_0x5cf9ad);});return _0x23fab8[_0x078e('0x28')]('\x20');};exports[_0x078e('0x29')]=function(_0x5e9140,_0x4f6051,_0x4b3c70){var _0x2e775b={},_0x470100={};if(_0x4f6051[_0x078e('0x2a')]['$id']){_0x4f6051[_0x078e('0x2a')]['id']=_0x4f6051['query'][_0x078e('0x2b')];delete _0x4f6051['query'][_0x078e('0x2b')];}_0x2e775b['model']=_[_0x078e('0x15')](_0x5e9140,_0x078e('0x13'));_0x2e775b['query']=_[_0x078e('0x2')](_0x4f6051[_0x078e('0x2a')]);_0x2e775b[_0x078e('0x7')]=_[_0x078e('0x2c')](_0x2e775b[_0x078e('0x2d')],_0x2e775b[_0x078e('0x2a')]);_0x470100[_0x078e('0x2e')]=_['intersection'](_0x2e775b[_0x078e('0x2d')],this[_0x078e('0x5')](_0x4f6051[_0x078e('0x2a')][_0x078e('0x5')]));_0x470100[_0x078e('0x2e')]=_0x470100['attributes'][_0x078e('0x1e')]?_0x470100[_0x078e('0x2e')]:_0x2e775b[_0x078e('0x2d')];if(!_0x4f6051[_0x078e('0x2a')]['hasOwnProperty'](_0x078e('0x2f'))){_0x470100[_0x078e('0x30')]=this['limit'](_0x4f6051['query']['limit']);_0x470100['offset']=this[_0x078e('0x31')](_0x4f6051['query']['offset']);}_0x470100['order']=this['sort'](_0x4f6051['query']['sort']);_0x470100[_0x078e('0x32')]=this['filters'](_[_0x078e('0x33')](_0x4f6051[_0x078e('0x2a')],_0x2e775b[_0x078e('0x7')]),_0x5e9140);if(_0x4f6051[_0x078e('0x2a')]['filter']){var _0x76fa85=_0x5e9140;var _0x5f58d9=_0x4f6051[_0x078e('0x2a')][_0x078e('0x34')];if(typeof _0x5f58d9==='object'){_0x76fa85=_[_0x078e('0x34')](_0x5e9140,function(_0x4b50b9){return _['includes'](_0x5f58d9[_0x078e('0x35')],_0x4b50b9[_0x078e('0x13')]);});_0x5f58d9=_0x5f58d9['value'];}_0x470100['where']=_[_0x078e('0x36')](_0x470100['where'],{'$or':_['map'](_0x76fa85,function(_0x2ddd86){if(_0x2ddd86[_0x078e('0xb')]!==_0x078e('0x37')){if(_0x4b3c70){return sequelize[_0x078e('0x32')](sequelize['fn']('lower',sequelize['col'](_0x2ddd86[_0x078e('0x13')])),{'$like':sequelize['fn'](_0x078e('0x38'),'%'+_0x4f6051[_0x078e('0x2a')][_0x078e('0x34')]+'%')});}else{var _0x540652={};_0x540652[_0x2ddd86[_0x078e('0x13')]]={'$like':'%'+_0x4f6051[_0x078e('0x2a')][_0x078e('0x34')]+'%'};return _0x540652;}}})});}_0x470100=_[_0x078e('0x36')]({},_0x470100,_0x4f6051[_0x078e('0x39')]);return _0x470100;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index eceadf5..373ee5f 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80a2=['root','client','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','json','express','serve-favicon','body-parser','cookie-parser','errorhandler','cors','moment','./environment','default','get','env','production','set','public','development','test','appPath','join'];(function(_0x22e6f8,_0x44fd6f){var _0x4709dd=function(_0x5ba8f9){while(--_0x5ba8f9){_0x22e6f8['push'](_0x22e6f8['shift']());}};_0x4709dd(++_0x44fd6f);}(_0x80a2,0x186));var _0x280a=function(_0x4037e7,_0x30a945){_0x4037e7=_0x4037e7-0x0;var _0x1bd6b1=_0x80a2[_0x4037e7];return _0x1bd6b1;};'use strict';var express=require(_0x280a('0x0'));var favicon=require(_0x280a('0x1'));var bodyParser=require(_0x280a('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x280a('0x3'));var errorHandler=require(_0x280a('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0x280a('0x5'));var moment=require(_0x280a('0x6'));var config=require(_0x280a('0x7'));var db=require('../mysqldb')['db'];exports[_0x280a('0x8')]=function(_0x3a75bb){var _0x271011=_0x3a75bb[_0x280a('0x9')](_0x280a('0xa'));if(_0x271011===_0x280a('0xb')){_0x3a75bb[_0x280a('0xc')]('appPath',path['join'](config['root'],_0x280a('0xd')));}if(_0x271011===_0x280a('0xe')||_0x271011===_0x280a('0xf')){_0x3a75bb[_0x280a('0xc')](_0x280a('0x10'),path[_0x280a('0x11')](config[_0x280a('0x12')],_0x280a('0x13')));_0x3a75bb[_0x280a('0x14')](errorHandler());}_0x3a75bb[_0x280a('0xc')](_0x280a('0x15'),function(_0x44d053,_0x4475d0){if(this[_0x44d053]instanceof Date){_0x4475d0=this[_0x44d053][_0x280a('0x16')]()[_0x280a('0x17')]('.')[0x0]+'Z';}return _0x4475d0;});_0x3a75bb[_0x280a('0x14')](express[_0x280a('0x18')](_0x3a75bb[_0x280a('0x9')]('appPath')));_0x3a75bb[_0x280a('0xc')](_0x280a('0x19'),config['root']+_0x280a('0x1a'));_0x3a75bb[_0x280a('0x1b')](_0x280a('0x1c'),require(_0x280a('0x1d'))[_0x280a('0x1e')]);_0x3a75bb['set'](_0x280a('0x1f'),_0x280a('0x1c'));_0x3a75bb[_0x280a('0x14')](bodyParser['urlencoded']({'limit':_0x280a('0x20'),'extended':!![]}));_0x3a75bb[_0x280a('0x14')](bodyParser[_0x280a('0x21')]({'limit':'50mb'}));_0x3a75bb['use'](cors());_0x3a75bb['use'](methodOverride());_0x3a75bb[_0x280a('0x14')](cookieParser());_0x3a75bb[_0x280a('0x14')](passport['initialize']());}; \ No newline at end of file +var _0x6d34=['set','use','json\x20replacer','toISOString','split','static','appPath','views','/server/views','engine','html','renderFile','50mb','json','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','moment','./environment','../mysqldb','get','join','root','public','development','test'];(function(_0x1f9f40,_0x3e83fe){var _0x2e5022=function(_0x2658cf){while(--_0x2658cf){_0x1f9f40['push'](_0x1f9f40['shift']());}};_0x2e5022(++_0x3e83fe);}(_0x6d34,0x6c));var _0x46d3=function(_0xd2d734,_0x515b4e){_0xd2d734=_0xd2d734-0x0;var _0x5d4dbc=_0x6d34[_0xd2d734];return _0x5d4dbc;};'use strict';var express=require(_0x46d3('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x46d3('0x1'));var methodOverride=require(_0x46d3('0x2'));var cookieParser=require(_0x46d3('0x3'));var errorHandler=require(_0x46d3('0x4'));var path=require(_0x46d3('0x5'));var passport=require(_0x46d3('0x6'));var cors=require('cors');var moment=require(_0x46d3('0x7'));var config=require(_0x46d3('0x8'));var db=require(_0x46d3('0x9'))['db'];exports['default']=function(_0x1cab1d){var _0x2680e6=_0x1cab1d[_0x46d3('0xa')]('env');if(_0x2680e6==='production'){_0x1cab1d['set']('appPath',path[_0x46d3('0xb')](config[_0x46d3('0xc')],_0x46d3('0xd')));}if(_0x2680e6===_0x46d3('0xe')||_0x2680e6===_0x46d3('0xf')){_0x1cab1d[_0x46d3('0x10')]('appPath',path['join'](config[_0x46d3('0xc')],'client'));_0x1cab1d[_0x46d3('0x11')](errorHandler());}_0x1cab1d[_0x46d3('0x10')](_0x46d3('0x12'),function(_0x39afa1,_0x3566a7){if(this[_0x39afa1]instanceof Date){_0x3566a7=this[_0x39afa1][_0x46d3('0x13')]()[_0x46d3('0x14')]('.')[0x0]+'Z';}return _0x3566a7;});_0x1cab1d['use'](express[_0x46d3('0x15')](_0x1cab1d[_0x46d3('0xa')](_0x46d3('0x16'))));_0x1cab1d['set'](_0x46d3('0x17'),config['root']+_0x46d3('0x18'));_0x1cab1d[_0x46d3('0x19')](_0x46d3('0x1a'),require('ejs')[_0x46d3('0x1b')]);_0x1cab1d['set']('view\x20engine',_0x46d3('0x1a'));_0x1cab1d[_0x46d3('0x11')](bodyParser['urlencoded']({'limit':_0x46d3('0x1c'),'extended':!![]}));_0x1cab1d[_0x46d3('0x11')](bodyParser[_0x46d3('0x1d')]({'limit':'50mb'}));_0x1cab1d[_0x46d3('0x11')](cors());_0x1cab1d[_0x46d3('0x11')](methodOverride());_0x1cab1d[_0x46d3('0x11')](cookieParser());_0x1cab1d[_0x46d3('0x11')](passport[_0x46d3('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 3656a9b..abc2819 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 _0x4dd3=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0x4dd3,0x189));var _0x34dd=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x4dd3[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x34dd('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x34dd('0x1'));var exec=require(_0x34dd('0x2'))[_0x34dd('0x3')];var config=require(_0x34dd('0x4'));function getInterfaces(){var _0x3675bc=[];var _0x6a6a4f=os[_0x34dd('0x5')]();var _0x16b266=_[_0x34dd('0x6')](_[_0x34dd('0x7')](_0x6a6a4f));for(var _0x3ee187=0x0;_0x3ee187<_0x16b266[_0x34dd('0x8')];_0x3ee187++){var _0x289f0d=_0x6a6a4f[_0x16b266[_0x3ee187]][_0x34dd('0x9')](function(_0x43b302){return _0x43b302['family']===_0x34dd('0xa')&&_0x43b302[_0x34dd('0xb')]===![];});_0x3675bc=_0x3675bc[_0x34dd('0xc')](_0x289f0d);}return _0x3675bc;}function getFirstInterface(){var _0xb2b7dc=_[_0x34dd('0xd')](getInterfaces());return{'macAddress':_0xb2b7dc&&_0xb2b7dc[_0x34dd('0xe')]?_0xb2b7dc['mac']:_0x34dd('0xf'),'ipAddress':_0xb2b7dc&&_0xb2b7dc['address']?_0xb2b7dc[_0x34dd('0x10')]:_0x34dd('0x11')};}exports[_0x34dd('0x12')]=getFirstInterface;function getCPUhash(){var _0xd5b5d=_[_0x34dd('0x6')](os[_0x34dd('0x13')]()[_0x34dd('0x14')](function(_0x294a79){return _0x294a79[_0x34dd('0x15')];}))['join'](':');return crypto[_0x34dd('0x16')](_0x34dd('0x17'))[_0x34dd('0x18')](_0xd5b5d)[_0x34dd('0x19')](_0x34dd('0x1a'));}exports[_0x34dd('0x1b')]=function(){var _0xf2471f=os[_0x34dd('0x1c')]();var _0x5e8cdb=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x5e8cdb[_0x34dd('0x1d')](config[_0x34dd('0x1e')])){return config[_0x34dd('0x1e')];}else if(_0xf2471f==='win32'){return exec(_0x34dd('0x1f'),{'encoding':'utf8'})[_0x34dd('0x20')]('\x0d\x0a','');}else{var _0x300dcc=getFirstInterface();var _0x3c57cc=getCPUhash();var _0x40bbf3=_0x3c57cc+'|'+os[_0x34dd('0x21')]()+'|'+_0x300dcc[_0x34dd('0x22')]+'|'+_0x300dcc[_0x34dd('0x23')];var _0x97868d=crypto[_0x34dd('0x16')](_0x34dd('0x17'))[_0x34dd('0x18')](_0x40bbf3)[_0x34dd('0x19')](_0x34dd('0x1a'));return _0x97868d['substring'](0x0,0x8)+'-'+_0x97868d[_0x34dd('0x24')](0x8,0xc)+'-'+_0x97868d[_0x34dd('0x24')](0xc,0x10)+'-'+_0x97868d[_0x34dd('0x24')](0x10,0x14)+'-'+_0x97868d[_0x34dd('0x24')](0x14);}}; \ No newline at end of file +var _0x3744=['mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','createHash','md5','digest','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','keys','filter','family','head'];(function(_0x3df93e,_0x5af13a){var _0x2d4f2a=function(_0x14c85c){while(--_0x14c85c){_0x3df93e['push'](_0x3df93e['shift']());}};_0x2d4f2a(++_0x5af13a);}(_0x3744,0x1d5));var _0x4374=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3744[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4374('0x0'));var os=require('os');var crypto=require(_0x4374('0x1'));var machine=require(_0x4374('0x2'));var exec=require(_0x4374('0x3'))[_0x4374('0x4')];var config=require(_0x4374('0x5'));function getInterfaces(){var _0x1fc475=[];var _0x488350=os['networkInterfaces']();var _0x181f0a=_[_0x4374('0x6')](_[_0x4374('0x7')](_0x488350));for(var _0x16cd7e=0x0;_0x16cd7e<_0x181f0a['length'];_0x16cd7e++){var _0x57c583=_0x488350[_0x181f0a[_0x16cd7e]][_0x4374('0x8')](function(_0x26e4aa){return _0x26e4aa[_0x4374('0x9')]==='IPv4'&&_0x26e4aa['internal']===![];});_0x1fc475=_0x1fc475['concat'](_0x57c583);}return _0x1fc475;}function getFirstInterface(){var _0x30cbaa=_[_0x4374('0xa')](getInterfaces());return{'macAddress':_0x30cbaa&&_0x30cbaa[_0x4374('0xb')]?_0x30cbaa['mac']:_0x4374('0xc'),'ipAddress':_0x30cbaa&&_0x30cbaa[_0x4374('0xd')]?_0x30cbaa[_0x4374('0xd')]:_0x4374('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x75a194=_[_0x4374('0x6')](os[_0x4374('0xf')]()[_0x4374('0x10')](function(_0x36f345){return _0x36f345[_0x4374('0x11')];}))['join'](':');return crypto[_0x4374('0x12')](_0x4374('0x13'))['update'](_0x75a194)[_0x4374('0x14')](_0x4374('0x15'));}exports[_0x4374('0x16')]=function(){var _0x4ae190=os['platform']();var _0xc9306a=/[0-9a-f-]{36}/;if(config[_0x4374('0x17')]&&_0xc9306a[_0x4374('0x18')](config[_0x4374('0x17')])){return config[_0x4374('0x17')];}else if(_0x4ae190==='win32'){return exec(_0x4374('0x19'),{'encoding':_0x4374('0x1a')})['replace']('\x0d\x0a','');}else{var _0x5a051e=getFirstInterface();var _0x125054=getCPUhash();var _0x2dd432=_0x125054+'|'+os[_0x4374('0x1b')]()+'|'+_0x5a051e[_0x4374('0x1c')]+'|'+_0x5a051e[_0x4374('0x1d')];var _0x4bd29b=crypto[_0x4374('0x12')]('md5')[_0x4374('0x1e')](_0x2dd432)[_0x4374('0x14')](_0x4374('0x15'));return _0x4bd29b['substring'](0x0,0x8)+'-'+_0x4bd29b['substring'](0x8,0xc)+'-'+_0x4bd29b[_0x4374('0x1f')](0xc,0x10)+'-'+_0x4bd29b[_0x4374('0x1f')](0x10,0x14)+'-'+_0x4bd29b[_0x4374('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 88289a8..04ecf3d 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 _0xead2=['getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','pkginfo','version','../../components/encryptor','./hardware','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','error','message'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0xead2,0x1a0));var _0x2ead=function(_0x551c0b,_0x2d9a29){_0x551c0b=_0x551c0b-0x0;var _0x176c38=_0xead2[_0x551c0b];return _0x176c38;};'use strict';var util=require(_0x2ead('0x0'));var moment=require(_0x2ead('0x1'));var rp=require('request-promise');var BPromise=require(_0x2ead('0x2'));var pkginfo=require(_0x2ead('0x3'))(module,_0x2ead('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x2ead('0x5'));var hardware=require(_0x2ead('0x6'));var logger=require('../logger')('license');var HOST=_0x2ead('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xd1e38a){return new BPromise(function(_0x42cf29,_0x46ee54){var _0x35edf4=util['format'](_0x2ead('0x8'),HOST,_0xd1e38a,module[_0x2ead('0x9')][_0x2ead('0x4')]);if(oldToken){_0x35edf4=util[_0x2ead('0xa')](_0x2ead('0xb'),HOST,_0xd1e38a,module[_0x2ead('0x9')][_0x2ead('0x4')],oldToken);}var _0x3a0433={'uri':_0x35edf4,'method':_0x2ead('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3a0433)['then'](function(_0x7ac576){_0x42cf29(_0x7ac576);})[_0x2ead('0xd')](function(_0xfd07c){_0x46ee54(_0xfd07c);});});}function manageLicense(_0x233c55,_0x2ebf0f){var _0x10bdb5=_0x2ebf0f[_0x2ead('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x10bdb5[_0x2ead('0xf')]!==_0x233c55&&!_0x10bdb5[_0x2ead('0x10')]){oldToken=_0x10bdb5[_0x2ead('0xf')];}httpRequest(_0x233c55)[_0x2ead('0x11')](function(_0x13d14d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x13d14d[_0x2ead('0x12')]){isOldTokenSent=![];if(!_0x10bdb5[_0x2ead('0x13')]&&_0x10bdb5[_0x2ead('0x13')]!=_0x13d14d[_0x2ead('0x13')]||_0x10bdb5[_0x2ead('0x13')]&&_0x10bdb5[_0x2ead('0x10')]){logger[_0x2ead('0x14')](_0x2ead('0x15'));}if(_0x10bdb5['license']&&!_0x10bdb5[_0x2ead('0x10')]&&_0x10bdb5[_0x2ead('0x13')]!=_0x13d14d[_0x2ead('0x13')]){logger[_0x2ead('0x14')](_0x2ead('0x16'));}if(_0x10bdb5[_0x2ead('0x13')]&&!_0x10bdb5['data2']&&_0x10bdb5[_0x2ead('0x13')]==_0x13d14d[_0x2ead('0x13')]){return _0x2ebf0f;}return _0x2ebf0f[_0x2ead('0x17')]({'data1':_0x233c55,'data2':null,'license':_0x13d14d['license']});}else{if(_0x13d14d['license']||_0x10bdb5[_0x2ead('0x13')]){if(!_0x10bdb5[_0x2ead('0x10')]){if(_0x10bdb5['data1']==_0x233c55){GRAY_PERIOD_REASON=_0x2ead('0x18');logger[_0x2ead('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x2ead('0x19');logger[_0x2ead('0x14')](_0x2ead('0x1a'),_0x10bdb5[_0x2ead('0xf')],_0x233c55);}logger['info'](_0x2ead('0x1b'),GRAY_PERIOD_REASON[_0x2ead('0x1c')](),moment()[_0x2ead('0xa')](_0x2ead('0x1d')));return _0x2ebf0f[_0x2ead('0x17')]({'data2':encryptor[_0x2ead('0x1e')](moment()['format'](_0x2ead('0x1d')))});}else{if(moment()[_0x2ead('0x1f')](encryptor['decryptString'](_0x10bdb5[_0x2ead('0x10')]),_0x2ead('0x20'))>DAYS){logger[_0x2ead('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2ead('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2ebf0f[_0x2ead('0x17')]({'data1':_0x233c55,'data2':null,'license':null});}}}else{if(_0x10bdb5[_0x2ead('0xf')]!=_0x233c55){logger['info'](_0x2ead('0x1a'),_0x10bdb5['data1'],_0x233c55);return _0x2ebf0f[_0x2ead('0x17')]({'data1':_0x233c55,'data2':null,'license':null});}}}return _0x2ebf0f;})[_0x2ead('0x11')](function(_0x1c26d2){_0x2ebf0f=_0x1c26d2;})[_0x2ead('0xd')](function(_0x2666a1){logger[_0x2ead('0x21')](_0x2666a1[_0x2ead('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2ead('0x23')](),_0x2ebf0f);},TIME);});}function defaultLicense(){var _0x2a5572=hardware['getUuid']();if(_0x2a5572){return db[_0x2ead('0x24')][_0x2ead('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x2a5572}})[_0x2ead('0x26')](function(_0x2400b5,_0x218876){logger[_0x2ead('0x14')](_0x2ead('0x27'),_0x2a5572);manageLicense(_0x2a5572,_0x2400b5);})['catch'](function(_0x5606c6){logger[_0x2ead('0x21')](_0x5606c6['message']);});}}exports[_0x2ead('0x28')]=defaultLicense; \ No newline at end of file +var _0x0fb5=['../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo'];(function(_0x51e75b,_0x1682d5){var _0x1c9bf6=function(_0x3d7630){while(--_0x3d7630){_0x51e75b['push'](_0x51e75b['shift']());}};_0x1c9bf6(++_0x1682d5);}(_0x0fb5,0x196));var _0x50fb=function(_0x2c446d,_0x44601d){_0x2c446d=_0x2c446d-0x0;var _0x4fce44=_0x0fb5[_0x2c446d];return _0x4fce44;};'use strict';var util=require(_0x50fb('0x0'));var moment=require(_0x50fb('0x1'));var rp=require(_0x50fb('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x50fb('0x3'))(module,'version');var db=require(_0x50fb('0x4'))['db'];var encryptor=require(_0x50fb('0x5'));var hardware=require(_0x50fb('0x6'));var logger=require(_0x50fb('0x7'))(_0x50fb('0x8'));var HOST=_0x50fb('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x411b6b){return new BPromise(function(_0xdf6ecd,_0x586bf2){var _0x650f09=util[_0x50fb('0xa')](_0x50fb('0xb'),HOST,_0x411b6b,module['exports'][_0x50fb('0xc')]);if(oldToken){_0x650f09=util[_0x50fb('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x411b6b,module['exports'][_0x50fb('0xc')],oldToken);}var _0x324e46={'uri':_0x650f09,'method':_0x50fb('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x324e46)[_0x50fb('0xe')](function(_0x35403a){_0xdf6ecd(_0x35403a);})[_0x50fb('0xf')](function(_0x18a7ea){_0x586bf2(_0x18a7ea);});});}function manageLicense(_0x4c9a34,_0x4ecfb6){var _0x502618=_0x4ecfb6[_0x50fb('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x502618[_0x50fb('0x11')]!==_0x4c9a34&&!_0x502618[_0x50fb('0x12')]){oldToken=_0x502618[_0x50fb('0x11')];}httpRequest(_0x4c9a34)['then'](function(_0x2d6c06){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2d6c06[_0x50fb('0x13')]){isOldTokenSent=![];if(!_0x502618['license']&&_0x502618[_0x50fb('0x8')]!=_0x2d6c06[_0x50fb('0x8')]||_0x502618[_0x50fb('0x8')]&&_0x502618[_0x50fb('0x12')]){logger[_0x50fb('0x14')](_0x50fb('0x15'));}if(_0x502618[_0x50fb('0x8')]&&!_0x502618[_0x50fb('0x12')]&&_0x502618[_0x50fb('0x8')]!=_0x2d6c06[_0x50fb('0x8')]){logger[_0x50fb('0x14')](_0x50fb('0x16'));}if(_0x502618[_0x50fb('0x8')]&&!_0x502618['data2']&&_0x502618['license']==_0x2d6c06[_0x50fb('0x8')]){return _0x4ecfb6;}return _0x4ecfb6['update']({'data1':_0x4c9a34,'data2':null,'license':_0x2d6c06[_0x50fb('0x8')]});}else{if(_0x2d6c06[_0x50fb('0x8')]||_0x502618[_0x50fb('0x8')]){if(!_0x502618[_0x50fb('0x12')]){if(_0x502618['data1']==_0x4c9a34){GRAY_PERIOD_REASON='Disabled';logger[_0x50fb('0x14')](_0x50fb('0x17'));}else{GRAY_PERIOD_REASON=_0x50fb('0x18');logger[_0x50fb('0x14')](_0x50fb('0x19'),_0x502618[_0x50fb('0x11')],_0x4c9a34);}logger[_0x50fb('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x50fb('0x1a')](),moment()[_0x50fb('0xa')](_0x50fb('0x1b')));return _0x4ecfb6[_0x50fb('0x1c')]({'data2':encryptor[_0x50fb('0x1d')](moment()[_0x50fb('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x50fb('0x1e')](encryptor[_0x50fb('0x1f')](_0x502618[_0x50fb('0x12')]),_0x50fb('0x20'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x50fb('0x1b')));isOldTokenSent=![];return _0x4ecfb6[_0x50fb('0x1c')]({'data1':_0x4c9a34,'data2':null,'license':null});}}}else{if(_0x502618[_0x50fb('0x11')]!=_0x4c9a34){logger[_0x50fb('0x14')](_0x50fb('0x19'),_0x502618[_0x50fb('0x11')],_0x4c9a34);return _0x4ecfb6[_0x50fb('0x1c')]({'data1':_0x4c9a34,'data2':null,'license':null});}}}return _0x4ecfb6;})[_0x50fb('0xe')](function(_0x3b7ac7){_0x4ecfb6=_0x3b7ac7;})[_0x50fb('0xf')](function(_0x209a22){logger[_0x50fb('0x21')](_0x209a22[_0x50fb('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x50fb('0x23')](),_0x4ecfb6);},TIME);});}function defaultLicense(){var _0x56651c=hardware['getUuid']();if(_0x56651c){return db[_0x50fb('0x24')][_0x50fb('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x56651c}})[_0x50fb('0x26')](function(_0x5a2da6,_0x33c29e){logger[_0x50fb('0x14')](_0x50fb('0x27'),_0x56651c);manageLicense(_0x56651c,_0x5a2da6);})[_0x50fb('0xf')](function(_0x2847e8){logger[_0x50fb('0x21')](_0x2847e8[_0x50fb('0x22')]);});}}exports[_0x50fb('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index ee581ff..6442036 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 _0x4245=['admin','user','telephone','users','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','grayReason','disabled','message','findAll','role','sequelize','COUNT','col','count'];(function(_0x57d74e,_0x51773f){var _0x39052b=function(_0x4a7a64){while(--_0x4a7a64){_0x57d74e['push'](_0x57d74e['shift']());}};_0x39052b(++_0x51773f);}(_0x4245,0x103));var _0x5424=function(_0x54d8e1,_0x254f7c){_0x54d8e1=_0x54d8e1-0x0;var _0x50473b=_0x4245[_0x54d8e1];return _0x50473b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5424('0x0'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x5424('0x1'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5424('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5424('0x3'),'machineUuid':hardware[_0x5424('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5424('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x5424('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3ceb97){return new BPromise(function(_0x1fbd11,_0x2554b5){return db[_0x5424('0x5')][_0x5424('0x6')](_[_0x5424('0x7')](_0x3ceb97,{'raw':!![],'where':{'id':0x1}}))[_0x5424('0x8')](function(_0xff5331){return checkLicense(_0xff5331,null);})[_0x5424('0x8')](function(_0x194f4c){_0x1fbd11(_0x194f4c);return;})[_0x5424('0x9')](function(_0x2e204f){_0x2554b5(_0x2e204f);});});}function checkLicense(_0x3a85f8,_0x1e4a75){if(!_0x3a85f8){demoLicense[_0x5424('0xa')]=_0x3a85f8['data1'];return demoLicense;}try{var _0x46e1b5=_0x1e4a75||_0x3a85f8[_0x5424('0xb')];if(_[_0x5424('0xc')](_0x46e1b5)){throw new Error(_0x5424('0xd'));}var _0x1d9951=_0x3a85f8[_0x5424('0xe')];var _0x399458=_0x3a85f8[_0x5424('0xf')];var _0xd8d7d4=_0x1d9951[_0x5424('0x10')]('-')[0x4];var _0xde33ca=_0x1d9951[_0x5424('0x10')]('-')[0x0];var _0x2b0380=encryptor[_0x5424('0x11')](_0x46e1b5,util[_0x5424('0x12')](_0x5424('0x13'),_0xd8d7d4,_0x1d9951,_0xde33ca));var _0x4bd5de=JSON[_0x5424('0x14')](_0x2b0380);_0x4bd5de['demo']=![];_0x4bd5de[_0x5424('0xa')]=_0x1d9951;_0x4bd5de[_0x5424('0x15')]=hardware['getUuid']();if(_0x399458){var _0x1ccb59=encryptor[_0x5424('0x11')](_0x399458);_0x4bd5de[_0x5424('0x16')]=_0x1ccb59;_0x4bd5de[_0x5424('0x17')]=moment(_0x1ccb59)[_0x5424('0x18')](0x7,_0x5424('0x19'))['format']();_0x4bd5de[_0x5424('0x1a')]=_0x4bd5de[_0x5424('0xa')]!=_0x4bd5de[_0x5424('0x15')]?'changed':_0x5424('0x1b');}return _0x4bd5de;}catch(_0x297e51){breakingLicense[_0x5424('0xa')]=_0x3a85f8['data1'];breakingLicense[_0x5424('0x1c')]=_0x297e51[_0x5424('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3f104,_0x559ad8){getLicense()['then'](function(_0x4ef37f){return db['User'][_0x5424('0x1d')]({'attributes':[_0x5424('0x1e'),[db[_0x5424('0x1f')]['fn'](_0x5424('0x20'),db['sequelize'][_0x5424('0x21')](_0x5424('0x1e'))),_0x5424('0x22')]],'group':_0x5424('0x1e'),'where':{'role':{'$or':[_0x5424('0x23'),_0x5424('0x24'),_0x5424('0x25')]}},'raw':!![]})[_0x5424('0x8')](function(_0xa49aa8){var _0x17dcef={'user':_0x4ef37f[_0x5424('0x26')]||0x0,'telephone':_0x4ef37f['telephones']||0x0};_0xa49aa8['forEach'](function(_0x4d2b6e){var _0x1b559a=_0x4d2b6e[_0x5424('0x1e')]==='admin'?_0x5424('0x24'):_0x4d2b6e[_0x5424('0x1e')];_0x17dcef[_0x1b559a]-=_0x4d2b6e[_0x5424('0x22')];if(_0x17dcef[_0x1b559a]<0x0)_0x17dcef[_0x1b559a]=0x0;});_0x3f104(_0x17dcef);return;});})[_0x5424('0x9')](function(_0x1573f9){_0x559ad8(_0x1573f9);});});}function checkUserLimits(_0x387e63){return new BPromise(function(_0x4fd9e6,_0x33f854){getLimits()['then'](function(_0x19cac3){var _0x280e82=_['pick'](_['countBy'](_0x387e63,_0x5424('0x1e')),[_0x5424('0x23'),'user',_0x5424('0x25')]);var _0x2bccf7=(_0x280e82[_0x5424('0x23')]||0x0)+(_0x280e82[_0x5424('0x24')]||0x0);var _0x35913f=_0x280e82[_0x5424('0x25')]||0x0;if(_0x2bccf7>_0x19cac3[_0x5424('0x24')])return _0x33f854(_0x5424('0x27'));if(_0x35913f>_0x19cac3[_0x5424('0x25')])return _0x33f854(_0x5424('0x28'));return _0x4fd9e6();})['catch'](function(_0x5ee525){_0x33f854(_0x5ee525);});});}module[_0x5424('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xa443=['days','grayReason','changed','disabled','User','sequelize','COUNT','role','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','machineUuid','deadline'];(function(_0x4761e1,_0x237f6f){var _0x5385d5=function(_0x3460fc){while(--_0x3460fc){_0x4761e1['push'](_0x4761e1['shift']());}};_0x5385d5(++_0x237f6f);}(_0xa443,0xea));var _0x3a44=function(_0x2c2781,_0x5f1153){_0x2c2781=_0x2c2781-0x0;var _0x3fe469=_0xa443[_0x2c2781];return _0x3fe469;};'use strict';var util=require(_0x3a44('0x0'));var _=require('lodash');var moment=require(_0x3a44('0x1'));var BPromise=require(_0x3a44('0x2'));var hardware=require(_0x3a44('0x3'));var encryptor=require(_0x3a44('0x4'));var db=require(_0x3a44('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3a44('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x3a44('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3a44('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x3a44('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x115799){return new BPromise(function(_0x327fa7,_0x1d7294){return db[_0x3a44('0x8')][_0x3a44('0x9')](_[_0x3a44('0xa')](_0x115799,{'raw':!![],'where':{'id':0x1}}))[_0x3a44('0xb')](function(_0x5bb18b){return checkLicense(_0x5bb18b,null);})['then'](function(_0x1ae74f){_0x327fa7(_0x1ae74f);return;})[_0x3a44('0xc')](function(_0x54fd96){_0x1d7294(_0x54fd96);});});}function checkLicense(_0x57b184,_0x5c5f33){if(!_0x57b184){demoLicense[_0x3a44('0xd')]=_0x57b184[_0x3a44('0xe')];return demoLicense;}try{var _0xf796c7=_0x5c5f33||_0x57b184['license'];if(_[_0x3a44('0xf')](_0xf796c7)){throw new Error(_0x3a44('0x10'));}var _0x33caa5=_0x57b184['data1'];var _0x49d75d=_0x57b184[_0x3a44('0x11')];var _0x31b71c=_0x33caa5['split']('-')[0x4];var _0x2a6025=_0x33caa5[_0x3a44('0x12')]('-')[0x0];var _0x129c8c=encryptor[_0x3a44('0x13')](_0xf796c7,util[_0x3a44('0x14')]('%s:%s:%s',_0x31b71c,_0x33caa5,_0x2a6025));var _0x4fb0de=JSON[_0x3a44('0x15')](_0x129c8c);_0x4fb0de['demo']=![];_0x4fb0de[_0x3a44('0xd')]=_0x33caa5;_0x4fb0de[_0x3a44('0x16')]=hardware[_0x3a44('0x7')]();if(_0x49d75d){var _0x31e46d=encryptor[_0x3a44('0x13')](_0x49d75d);_0x4fb0de['gray']=_0x31e46d;_0x4fb0de[_0x3a44('0x17')]=moment(_0x31e46d)['add'](0x7,_0x3a44('0x18'))[_0x3a44('0x14')]();_0x4fb0de[_0x3a44('0x19')]=_0x4fb0de['uuid']!=_0x4fb0de[_0x3a44('0x16')]?_0x3a44('0x1a'):_0x3a44('0x1b');}return _0x4fb0de;}catch(_0x2a10b4){breakingLicense[_0x3a44('0xd')]=_0x57b184[_0x3a44('0xe')];breakingLicense['message']=_0x2a10b4['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5a85de,_0x294831){getLicense()[_0x3a44('0xb')](function(_0x6f3a6c){return db[_0x3a44('0x1c')]['findAll']({'attributes':['role',[db[_0x3a44('0x1d')]['fn'](_0x3a44('0x1e'),db[_0x3a44('0x1d')]['col']('role')),'count']],'group':_0x3a44('0x1f'),'where':{'role':{'$or':[_0x3a44('0x20'),_0x3a44('0x21'),_0x3a44('0x22')]}},'raw':!![]})[_0x3a44('0xb')](function(_0x313285){var _0x286fb1={'user':_0x6f3a6c[_0x3a44('0x23')]||0x0,'telephone':_0x6f3a6c['telephones']||0x0};_0x313285[_0x3a44('0x24')](function(_0x523438){var _0x3ab991=_0x523438['role']===_0x3a44('0x20')?_0x3a44('0x21'):_0x523438[_0x3a44('0x1f')];_0x286fb1[_0x3ab991]-=_0x523438[_0x3a44('0x25')];if(_0x286fb1[_0x3ab991]<0x0)_0x286fb1[_0x3ab991]=0x0;});_0x5a85de(_0x286fb1);return;});})['catch'](function(_0x43dbed){_0x294831(_0x43dbed);});});}function checkUserLimits(_0x170643){return new BPromise(function(_0x826a18,_0x544c0c){getLimits()['then'](function(_0x16c816){var _0x248c32=_[_0x3a44('0x26')](_[_0x3a44('0x27')](_0x170643,_0x3a44('0x1f')),[_0x3a44('0x20'),_0x3a44('0x21'),_0x3a44('0x22')]);var _0x50f842=(_0x248c32[_0x3a44('0x20')]||0x0)+(_0x248c32[_0x3a44('0x21')]||0x0);var _0x3317f4=_0x248c32['telephone']||0x0;if(_0x50f842>_0x16c816['user'])return _0x544c0c(_0x3a44('0x28'));if(_0x3317f4>_0x16c816[_0x3a44('0x22')])return _0x544c0c(_0x3a44('0x29'));return _0x826a18();})[_0x3a44('0xc')](function(_0x59facf){_0x544c0c(_0x59facf);});});}module[_0x3a44('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 4442afc..9d7b068 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 _0x57ca=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x473b7b,_0x1b017a){var _0x4d18b9=function(_0x569253){while(--_0x569253){_0x473b7b['push'](_0x473b7b['shift']());}};_0x4d18b9(++_0x1b017a);}(_0x57ca,0x108));var _0xa57c=function(_0x3bfbf2,_0xe76f48){_0x3bfbf2=_0x3bfbf2-0x0;var _0xae343c=_0x57ca[_0x3bfbf2];return _0xae343c;};'use strict';module['exports']={'DOMAIN':_0xa57c('0x0'),'SESSION_SECRET':_0xa57c('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa57c('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xe511=['app-id','exports','http://localhost:9000'];(function(_0x1e1970,_0x42a940){var _0x2d232c=function(_0x2006f6){while(--_0x2006f6){_0x1e1970['push'](_0x1e1970['shift']());}};_0x2d232c(++_0x42a940);}(_0xe511,0x16f));var _0x1e51=function(_0x1bab70,_0x399ccf){_0x1bab70=_0x1bab70-0x0;var _0x44a639=_0xe511[_0x1bab70];return _0x44a639;};'use strict';module[_0x1e51('0x0')]={'DOMAIN':_0x1e51('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x1e51('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index fcee726..72b4249 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b84=['debugLevel','moment','util','INFO','join','/var','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','transports','File','error','%s-%s','info','Console','env'];(function(_0xe88bab,_0x1ed383){var _0x591329=function(_0x2b2ce0){while(--_0x2b2ce0){_0xe88bab['push'](_0xe88bab['shift']());}};_0x591329(++_0x1ed383);}(_0x2b84,0x188));var _0x42b8=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x2b84[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x42b8('0x0'));var winston=require('winston');var util=require(_0x42b8('0x1'));var path=require('path');var debugLevel=_0x42b8('0x2');function filename(_0x507f83,_0x9247e7){return path[_0x42b8('0x3')](_0x42b8('0x4'),'log','xcally',util['format'](_0x42b8('0x5'),_0x507f83,_0x9247e7));}function formatter(_0x225d44,_0x67e2e0){_0x67e2e0[_0x42b8('0x6')]=_0x67e2e0[_0x42b8('0x6')]['replace'](/@@{/g,_0x42b8('0x7'))[_0x42b8('0x8')](/}@@/g,_0x42b8('0x9'))[_0x42b8('0x8')](/@{/g,'{{')[_0x42b8('0x8')](/}@/g,'}}');return util['format'](_0x42b8('0xa'),moment()[_0x42b8('0xb')](_0x42b8('0xc')),_0x67e2e0[_0x42b8('0xd')][_0x42b8('0xe')](),_0x225d44,_0x67e2e0[_0x42b8('0x6')]);}module['exports']=function(_0x2eea8b){return new winston['Logger']({'transports':[new winston[(_0x42b8('0xf'))][(_0x42b8('0x10'))]({'name':util[_0x42b8('0xb')]('%s-%s',_0x2eea8b,_0x42b8('0x11')),'filename':filename(_0x2eea8b,_0x42b8('0x11')),'level':_0x42b8('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x84d6ad){return formatter(_0x2eea8b,_0x84d6ad);}}),new winston[(_0x42b8('0xf'))]['File']({'name':util[_0x42b8('0xb')](_0x42b8('0x12'),_0x2eea8b,'info'),'filename':filename(_0x2eea8b,_0x42b8('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1fca47){return formatter(_0x2eea8b,_0x1fca47);}}),new winston[(_0x42b8('0xf'))][(_0x42b8('0x14'))]({'level':process[_0x42b8('0x15')][_0x42b8('0x16')]||debugLevel,'json':![],'formatter':function(_0x42516b){return formatter(_0x2eea8b,_0x42516b);}})]});}; \ No newline at end of file +var _0x93c2=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','%s-%s','File','info','Console','env','moment','winston','path','INFO','join','log','xcally','format','message','replace','{{{'];(function(_0x38080e,_0x95512d){var _0x4e4c87=function(_0x2be6b3){while(--_0x2be6b3){_0x38080e['push'](_0x38080e['shift']());}};_0x4e4c87(++_0x95512d);}(_0x93c2,0xad));var _0x293c=function(_0x30a69d,_0xa9f8fb){_0x30a69d=_0x30a69d-0x0;var _0x38ded8=_0x93c2[_0x30a69d];return _0x38ded8;};'use strict';var moment=require(_0x293c('0x0'));var winston=require(_0x293c('0x1'));var util=require('util');var path=require(_0x293c('0x2'));var debugLevel=_0x293c('0x3');function filename(_0x3abb24,_0x390668){return path[_0x293c('0x4')]('/var',_0x293c('0x5'),_0x293c('0x6'),util[_0x293c('0x7')]('%s-%s.log',_0x3abb24,_0x390668));}function formatter(_0x147e45,_0x2d7bad){_0x2d7bad['message']=_0x2d7bad[_0x293c('0x8')][_0x293c('0x9')](/@@{/g,_0x293c('0xa'))[_0x293c('0x9')](/}@@/g,'}}}')[_0x293c('0x9')](/@{/g,'{{')[_0x293c('0x9')](/}@/g,'}}');return util['format'](_0x293c('0xb'),moment()[_0x293c('0x7')](_0x293c('0xc')),_0x2d7bad[_0x293c('0xd')][_0x293c('0xe')](),_0x147e45,_0x2d7bad['message']);}module[_0x293c('0xf')]=function(_0xecc051){return new winston[(_0x293c('0x10'))]({'transports':[new winston[(_0x293c('0x11'))]['File']({'name':util[_0x293c('0x7')](_0x293c('0x12'),_0xecc051,'error'),'filename':filename(_0xecc051,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f98b6){return formatter(_0xecc051,_0x3f98b6);}}),new winston[(_0x293c('0x11'))][(_0x293c('0x13'))]({'name':util['format'](_0x293c('0x12'),_0xecc051,_0x293c('0x14')),'filename':filename(_0xecc051,'info'),'level':_0x293c('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb2dde5){return formatter(_0xecc051,_0xb2dde5);}}),new winston[(_0x293c('0x11'))][(_0x293c('0x15'))]({'level':process[_0x293c('0x16')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x492794){return formatter(_0xecc051,_0x492794);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c4cf4df..1c2b1e2 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 _0xcef3=['../../services/email/index.js','routing','../../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'];(function(_0x1ea2e6,_0x17aa9c){var _0x2fd547=function(_0x2f3a60){while(--_0x2f3a60){_0x1ea2e6['push'](_0x1ea2e6['shift']());}};_0x2fd547(++_0x17aa9c);}(_0xcef3,0x19c));var _0x3cef=function(_0x544a27,_0x5914ab){_0x544a27=_0x544a27-0x0;var _0x1eed0b=_0xcef3[_0x544a27];return _0x1eed0b;};'use strict';var path=require(_0x3cef('0x0'));var os=require('os');var config={'apps':[{'name':_0x3cef('0x1'),'script':path[_0x3cef('0x2')](__dirname,_0x3cef('0x3'))},{'name':_0x3cef('0x4'),'script':path['join'](__dirname,_0x3cef('0x5'))},{'name':'agi','script':path[_0x3cef('0x2')](__dirname,_0x3cef('0x6'))},{'name':_0x3cef('0x7'),'script':path['join'](__dirname,_0x3cef('0x8'))},{'name':_0x3cef('0x9'),'script':path['join'](__dirname,_0x3cef('0xa'))},{'name':_0x3cef('0xb'),'script':path[_0x3cef('0x2')](__dirname,_0x3cef('0xc'))}]};module[_0x3cef('0xd')]=config; \ No newline at end of file +var _0x10c1=['express','join','ami','../../services/agi/index.js','email','routing','xdr','exports','path'];(function(_0x6a9229,_0x302284){var _0x41d3eb=function(_0x5cc4e0){while(--_0x5cc4e0){_0x6a9229['push'](_0x6a9229['shift']());}};_0x41d3eb(++_0x302284);}(_0x10c1,0x19d));var _0x110c=function(_0x4756a3,_0xa452c){_0x4756a3=_0x4756a3-0x0;var _0x296254=_0x10c1[_0x4756a3];return _0x296254;};'use strict';var path=require(_0x110c('0x0'));var os=require('os');var config={'apps':[{'name':_0x110c('0x1'),'script':path[_0x110c('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x110c('0x3'),'script':path[_0x110c('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x110c('0x2')](__dirname,_0x110c('0x4'))},{'name':_0x110c('0x5'),'script':path[_0x110c('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x110c('0x6'),'script':path[_0x110c('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x110c('0x7'),'script':path[_0x110c('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0x110c('0x8')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 184ce9f..a77545d 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 _0xe328=['dump','saved','bluebird','./config','connect','start','disconnect','stop','then','restart','list','describe','delete'];(function(_0x12c038,_0x1d922c){var _0x1c43b8=function(_0x5a0552){while(--_0x5a0552){_0x12c038['push'](_0x12c038['shift']());}};_0x1c43b8(++_0x1d922c);}(_0xe328,0x17b));var _0x8e32=function(_0x51d2a5,_0x528b37){_0x51d2a5=_0x51d2a5-0x0;var _0x5dc483=_0xe328[_0x51d2a5];return _0x5dc483;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8e32('0x0'));var config=require(_0x8e32('0x1'));function connect(){return new BPromise(function(_0x3cbd6d,_0x56c092){return pm2[_0x8e32('0x2')](function(_0x36525c){if(_0x36525c){return _0x56c092(_0x36525c);}return _0x3cbd6d('connected');});});};exports[_0x8e32('0x3')]=function(_0x1c43ab){return connect()['then'](function(){return new BPromise(function(_0x5355a5,_0x1d10ad){return pm2[_0x8e32('0x3')](_0x1c43ab,function(_0x3d66db,_0x12bbd6){if(_0x3d66db){return _0x1d10ad(_0x3d66db);}pm2[_0x8e32('0x4')]();return _0x5355a5(_0x12bbd6);});});});};exports[_0x8e32('0x5')]=function(_0x2c4c0c){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0x11d090,_0x51b658){return pm2[_0x8e32('0x5')](_0x2c4c0c,function(_0x222420,_0x282b04){if(_0x222420){return _0x51b658(_0x222420);}pm2[_0x8e32('0x4')]();return _0x11d090(_0x282b04);});});});};exports[_0x8e32('0x7')]=function(_0x568d33){return connect()['then'](function(){return new BPromise(function(_0x4c8e9f,_0x2b1dbe){return pm2[_0x8e32('0x7')](_0x568d33,function(_0x26867f,_0x4408df){if(_0x26867f){return _0x2b1dbe(_0x26867f);}pm2[_0x8e32('0x4')]();return _0x4c8e9f(_0x4408df);});});});};exports['list']=function(){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0xc3a669,_0x28b23a){return pm2[_0x8e32('0x8')](function(_0xb7c2d2,_0x418cb7){if(_0xb7c2d2){return _0x28b23a(_0xb7c2d2);}pm2[_0x8e32('0x4')]();return _0xc3a669(_0x418cb7);});});});};exports[_0x8e32('0x9')]=function(_0x1e5bba){return connect()['then'](function(){return new BPromise(function(_0x34a44f,_0x112413){return pm2['describe'](_0x1e5bba,function(_0x28d794,_0x5289f7){if(_0x28d794){return _0x112413(_0x28d794);}pm2[_0x8e32('0x4')]();return _0x34a44f(_0x5289f7);});});});};exports['delete']=function(_0x56dc25){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0x56dc2d,_0xce8295){return pm2[_0x8e32('0xa')](_0x56dc25,function(_0x197321,_0x7192b5){if(_0x197321){return _0xce8295(_0x197321);}pm2[_0x8e32('0x4')]();return _0x56dc2d(_0x7192b5);});});});};exports['dump']=function(){return connect()[_0x8e32('0x6')](function(){return new BPromise(function(_0x467ccd,_0x420f5d){return pm2[_0x8e32('0xb')](function(_0x4c81c6){if(_0x4c81c6){return _0x420f5d(_0x4c81c6);}return _0x467ccd(_0x8e32('0xc'));});});});}; \ No newline at end of file +var _0x0755=['pm2','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x53db99,_0x37ba31){var _0x4be572=function(_0x14d5b0){while(--_0x14d5b0){_0x53db99['push'](_0x53db99['shift']());}};_0x4be572(++_0x37ba31);}(_0x0755,0x196));var _0x5075=function(_0x1c0928,_0x3a5f09){_0x1c0928=_0x1c0928-0x0;var _0x557de8=_0x0755[_0x1c0928];return _0x557de8;};'use strict';var pm2=require(_0x5075('0x0'));var BPromise=require('bluebird');var config=require(_0x5075('0x1'));function connect(){return new BPromise(function(_0x5c8812,_0x431de8){return pm2[_0x5075('0x2')](function(_0x3a73b1){if(_0x3a73b1){return _0x431de8(_0x3a73b1);}return _0x5c8812(_0x5075('0x3'));});});};exports[_0x5075('0x4')]=function(_0x363f07){return connect()[_0x5075('0x5')](function(){return new BPromise(function(_0x41edfb,_0x30776c){return pm2['start'](_0x363f07,function(_0x10542d,_0x46dfb4){if(_0x10542d){return _0x30776c(_0x10542d);}pm2[_0x5075('0x6')]();return _0x41edfb(_0x46dfb4);});});});};exports['stop']=function(_0x2527fd){return connect()[_0x5075('0x5')](function(){return new BPromise(function(_0x12f3a4,_0xee426){return pm2[_0x5075('0x7')](_0x2527fd,function(_0x116a16,_0x2d6fb5){if(_0x116a16){return _0xee426(_0x116a16);}pm2[_0x5075('0x6')]();return _0x12f3a4(_0x2d6fb5);});});});};exports[_0x5075('0x8')]=function(_0x476fa0){return connect()[_0x5075('0x5')](function(){return new BPromise(function(_0x2bdbfd,_0x55ffb5){return pm2['restart'](_0x476fa0,function(_0x1d1cbd,_0x1a0009){if(_0x1d1cbd){return _0x55ffb5(_0x1d1cbd);}pm2['disconnect']();return _0x2bdbfd(_0x1a0009);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0xbb66f9,_0x2cbada){return pm2[_0x5075('0x9')](function(_0x45f713,_0x4e61d0){if(_0x45f713){return _0x2cbada(_0x45f713);}pm2[_0x5075('0x6')]();return _0xbb66f9(_0x4e61d0);});});});};exports[_0x5075('0xa')]=function(_0x436101){return connect()[_0x5075('0x5')](function(){return new BPromise(function(_0x3b5642,_0x58c77e){return pm2['describe'](_0x436101,function(_0x36ff67,_0x5a847a){if(_0x36ff67){return _0x58c77e(_0x36ff67);}pm2[_0x5075('0x6')]();return _0x3b5642(_0x5a847a);});});});};exports[_0x5075('0xb')]=function(_0x370b05){return connect()['then'](function(){return new BPromise(function(_0x52c683,_0x23bae6){return pm2[_0x5075('0xb')](_0x370b05,function(_0x6d72b,_0x2c90be){if(_0x6d72b){return _0x23bae6(_0x6d72b);}pm2[_0x5075('0x6')]();return _0x52c683(_0x2c90be);});});});};exports['dump']=function(){return connect()[_0x5075('0x5')](function(){return new BPromise(function(_0x27deed,_0x1a41b6){return pm2[_0x5075('0xc')](function(_0x5d0174){if(_0x5d0174){return _0x1a41b6(_0x5d0174);}return _0x27deed(_0x5075('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b913e90..2ae1c1f 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 _0xb74b=['[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','emit','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info'];(function(_0x1cad16,_0x518dc5){var _0x278009=function(_0x511d8b){while(--_0x511d8b){_0x1cad16['push'](_0x1cad16['shift']());}};_0x278009(++_0x518dc5);}(_0xb74b,0x148));var _0xbb74=function(_0x34df56,_0x52a58f){_0x34df56=_0x34df56-0x0;var _0x520f88=_0xb74b[_0x34df56];return _0x520f88;};'use strict';var _=require(_0xbb74('0x0'));var moment=require(_0xbb74('0x1'));var Redis=require('ioredis');var util=require(_0xbb74('0x2'));var config=require('../../config/environment');var db=require(_0xbb74('0x3'))['db'];var logger=require(_0xbb74('0x4'))(_0xbb74('0x5'));config[_0xbb74('0x6')]=_[_0xbb74('0x7')](config[_0xbb74('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xbb74('0x8'))(new Redis(config[_0xbb74('0x6')]));function closeInteractions(){var _0x471cb5=0x0;var _0x425311=[];return db[_0xbb74('0x9')][_0xbb74('0xa')]({'raw':!![],'attributes':['id',_0xbb74('0xb')],'where':{'id':0x1}})[_0xbb74('0xc')](function(_0x256656){_0x471cb5=_0x256656[_0xbb74('0xb')];if(_0x471cb5){return db[_0xbb74('0xd')]['findAll']({'raw':!![],'attributes':['id',_0xbb74('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xbb74('0xf')](_0x256656[_0xbb74('0xb')],_0xbb74('0x10'))}}});}else{return[];}})['then'](function(_0x1f7cf9){if(_0x1f7cf9&&_0x1f7cf9[_0xbb74('0x11')]){_0x425311=_[_0xbb74('0x12')](_0x1f7cf9||[],'id');logger[_0xbb74('0x13')](_0xbb74('0x14'),_0x425311[_0xbb74('0x15')]());return db[_0xbb74('0xd')]['update']({'closeReason':_0xbb74('0x16'),'disposition':_0xbb74('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x425311}});}})[_0xbb74('0xc')](function(){if(_0x425311&&_0x425311['length']){logger[_0xbb74('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x425311['join']());for(var _0x5585f1=0x0;_0x5585f1<_0x425311['length'];_0x5585f1++){io[_0xbb74('0x18')]('chatInteraction:update',{'id':_0x425311[_0x5585f1],'closed':!![]});}}})['catch'](function(_0x406ed5){logger[_0xbb74('0x19')](_0xbb74('0x1a'),_0x406ed5?util[_0xbb74('0x1b')](_0x406ed5,{'showHidden':![],'depth':null}):'');});}exports[_0xbb74('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x92d6=['util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','Setting','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92d6,0x1a2));var _0x692d=function(_0x5a181b,_0x1a3a7b){_0x5a181b=_0x5a181b-0x0;var _0x11e304=_0x92d6[_0x5a181b];return _0x11e304;};'use strict';var _=require('lodash');var moment=require(_0x692d('0x0'));var Redis=require(_0x692d('0x1'));var util=require(_0x692d('0x2'));var config=require(_0x692d('0x3'));var db=require(_0x692d('0x4'))['db'];var logger=require(_0x692d('0x5'))('schedule');config[_0x692d('0x6')]=_[_0x692d('0x7')](config[_0x692d('0x6')],{'host':_0x692d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x692d('0x6')]));function closeInteractions(){var _0x489d13=0x0;var _0x454b17=[];return db[_0x692d('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x692d('0xa')](function(_0x39eeb6){_0x489d13=_0x39eeb6[_0x692d('0xb')];if(_0x489d13){return db[_0x692d('0xc')][_0x692d('0xd')]({'raw':!![],'attributes':['id',_0x692d('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x692d('0xf')](_0x39eeb6['chatTimeout'],_0x692d('0x10'))}}});}else{return[];}})['then'](function(_0x3ca325){if(_0x3ca325&&_0x3ca325[_0x692d('0x11')]){_0x454b17=_[_0x692d('0x12')](_0x3ca325||[],'id');logger[_0x692d('0x13')](_0x692d('0x14'),_0x454b17[_0x692d('0x15')]());return db[_0x692d('0xc')]['update']({'closeReason':_0x692d('0x16'),'disposition':_0x692d('0x17'),'closed':!![],'closedAt':moment()[_0x692d('0x18')](_0x692d('0x19'))},{'where':{'id':_0x454b17}});}})[_0x692d('0xa')](function(){if(_0x454b17&&_0x454b17['length']){logger[_0x692d('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x454b17[_0x692d('0x15')]());for(var _0x1b386f=0x0;_0x1b386f<_0x454b17[_0x692d('0x11')];_0x1b386f++){io['emit'](_0x692d('0x1a'),{'id':_0x454b17[_0x1b386f],'closed':!![]});}}})[_0x692d('0x1b')](function(_0x51bd84){logger['error'](_0x692d('0x1c'),_0x51bd84?util[_0x692d('0x1d')](_0x51bd84,{'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 c79fec0..4408410 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 _0x1edc=['join','../../files/reports','savename','%s.%s','basename','zip','existsSync','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','map','toString','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','index','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','update\x20cron','run','util','path','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','pass','format','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit'];(function(_0x30055a,_0x23d254){var _0x571b14=function(_0x3ac70a){while(--_0x3ac70a){_0x30055a['push'](_0x30055a['shift']());}};_0x571b14(++_0x23d254);}(_0x1edc,0x19d));var _0xc1ed=function(_0x4b0326,_0x396ef8){_0x4b0326=_0x4b0326-0x0;var _0x3e1ea1=_0x1edc[_0x4b0326];return _0x3e1ea1;};'use strict';var fs=require('fs');var util=require(_0xc1ed('0x0'));var path=require(_0xc1ed('0x1'));var _=require('lodash');var moment=require(_0xc1ed('0x2'));var CronJobManager=require(_0xc1ed('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc1ed('0x4'))(_0xc1ed('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xc1ed('0x6'));var analyticDefaultReportController=require(_0xc1ed('0x7'));var client=jayson[_0xc1ed('0x8')][_0xc1ed('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x490982,_0x3ca543){return function(){logger[_0xc1ed('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x490982['email']);var _0x3710c1=!![];var _0x4de34f={'tls':{'rejectUnauthorized':![]}};if(_0x490982[_0xc1ed('0xb')]['Smtp'][_0xc1ed('0xc')]){_0x4de34f['service']=_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0xc')];}else{_0x4de34f['host']=_0x490982[_0xc1ed('0xb')]['Smtp'][_0xc1ed('0xe')];_0x4de34f[_0xc1ed('0xf')]=_0x490982[_0xc1ed('0xb')][_0xc1ed('0xd')][_0xc1ed('0xf')];_0x4de34f['secure']=_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0x10')];}if(_0x490982[_0xc1ed('0xb')][_0xc1ed('0xd')][_0xc1ed('0x11')]){_0x4de34f[_0xc1ed('0x12')]={'user':_0x490982[_0xc1ed('0xb')][_0xc1ed('0xd')][_0xc1ed('0x13')],'pass':_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0x14')]};}var _0x17c254={'account':_0x4de34f,'message':{'from':util[_0xc1ed('0x15')]('\x22%s\x22\x20<%s>',_0x490982['MailAccount'][_0xc1ed('0x16')],_0x490982[_0xc1ed('0xb')][_0xc1ed('0x17')]||_0x490982['MailAccount'][_0xc1ed('0xd')][_0xc1ed('0x13')]),'to':_0x490982[_0xc1ed('0x17')],'cc':_0x490982['cc'],'bcc':_0x490982[_0xc1ed('0x18')],'subject':util[_0xc1ed('0x15')](_0xc1ed('0x19'),_0x3ca543[_0xc1ed('0x16')],_0x490982['subtractNumber'],_0x490982[_0xc1ed('0x1a')])}};var _0xe162ff=path[_0xc1ed('0x1b')](__dirname,_0xc1ed('0x1c'));var _0x2fcab1=_0x3ca543[_0xc1ed('0x1d')];var _0x2c58c3=util[_0xc1ed('0x15')](_0xc1ed('0x1e'),path[_0xc1ed('0x1f')](_0x3ca543[_0xc1ed('0x1d')],path['extname'](_0x3ca543['savename'])),_0xc1ed('0x20'));var _0x2111e5=path[_0xc1ed('0x1b')](_0xe162ff,_0x2fcab1);var _0x2687c1=path[_0xc1ed('0x1b')](_0xe162ff,_0x2c58c3);if(fs[_0xc1ed('0x21')](_0x2111e5)){_0x3ca543['status']='Sent';_0x17c254[_0xc1ed('0x22')]['attachments']=[{'filename':_0x2fcab1,'path':_0x2111e5}];_0x17c254['message']['text']=util[_0xc1ed('0x15')](_0xc1ed('0x23'),JSON[_0xc1ed('0x24')](_0x3ca543,null,0x2));}else if(fs['existsSync'](_0x2687c1)){_0x3ca543[_0xc1ed('0x25')]=_0xc1ed('0x26');_0x17c254[_0xc1ed('0x22')]['attachments']=[{'filename':_0x2c58c3,'path':_0x2687c1}];}else{_0x17c254[_0xc1ed('0x22')][_0xc1ed('0x27')]=_0xc1ed('0x28');if(!_0x490982[_0xc1ed('0x29')]){_0x3710c1=![];logger[_0xc1ed('0xa')](_0xc1ed('0x2a'));}}if(_0x3710c1){return client[_0xc1ed('0x2b')](_0xc1ed('0x2c'),_0x17c254)[_0xc1ed('0x2d')](function(_0x3719f2){if(_0x3719f2[_0xc1ed('0x2e')]){return logger[_0xc1ed('0x2e')]('error\x20mail',JSON[_0xc1ed('0x24')](_0x3719f2));}return logger[_0xc1ed('0xa')](_0xc1ed('0x2f'));})['catch'](function(_0x37ecfd){return logger[_0xc1ed('0x2e')]('error\x20mail',JSON[_0xc1ed('0x24')](_0x37ecfd));});}};}function handleError(){return function(_0x2400a9){return logger['error'](JSON[_0xc1ed('0x24')](_0x2400a9));};}function handleResult(_0x340eab){return function(_0xe581c2){logger[_0xc1ed('0xa')]('data',JSON[_0xc1ed('0x24')](_0xe581c2));if(_0x340eab[_0xc1ed('0xb')]&&_0x340eab[_0xc1ed('0xb')][_0xc1ed('0xd')]&&!_[_0xc1ed('0x30')](_0x340eab[_0xc1ed('0x17')])){setTimeout(handleSendEmail(_0x340eab,_0xe581c2),0x3c*0x3e8);}};}function handleJob(_0x51590e){return function(){try{if(_[_0xc1ed('0x30')](_0x51590e['subtractNumber'])){return logger['info'](_0xc1ed('0x31'));}if(_[_0xc1ed('0x30')](_0x51590e[_0xc1ed('0x1a')])){return logger[_0xc1ed('0xa')](_0xc1ed('0x32'));}var _0x23c8d1={'startDate':moment()[_0xc1ed('0x33')](_0x51590e[_0xc1ed('0x34')],_0x51590e['subtractUnit'])[_0xc1ed('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xc1ed('0x15')](_0xc1ed('0x35')),'type':_0xc1ed('0x36'),'output':_0x51590e['output'],'name':_0x51590e[_0xc1ed('0x16')]};if(!_[_0xc1ed('0x30')](_0x51590e[_0xc1ed('0x37')])){logger[_0xc1ed('0xa')](_0xc1ed('0x38'),_0x51590e[_0xc1ed('0x37')]);return analyticDefaultReportController[_0xc1ed('0x39')]({'id':_0x51590e[_0xc1ed('0x37')]},_0x23c8d1)[_0xc1ed('0x2d')](handleResult(_0x51590e))[_0xc1ed('0x3a')](handleError());}if(!_[_0xc1ed('0x30')](_0x51590e[_0xc1ed('0x3b')])){logger[_0xc1ed('0xa')](_0xc1ed('0x3c'),_0x51590e[_0xc1ed('0x3b')]);return analyticCustomReportController['runReport']({'id':_0x51590e['CustomReportId']},_0x23c8d1)[_0xc1ed('0x2d')](handleResult(_0x51590e))['catch'](handleError());}}catch(_0x1ab432){logger[_0xc1ed('0x2e')](JSON[_0xc1ed('0x24')](_0x1ab432));}return logger[_0xc1ed('0xa')](_0xc1ed('0x3d'));};}function getJobs(_0x318c37){var _0x5e396a={};if(_0x318c37){_0x5e396a['id']=_0x318c37;}return db['Schedule'][_0xc1ed('0x3e')]({'where':_0x5e396a,'include':[{'model':db[_0xc1ed('0xb')],'attributes':['id',_0xc1ed('0x16'),_0xc1ed('0x17')],'include':[{'model':db[_0xc1ed('0x3f')],'as':'Smtp'}]}]})[_0xc1ed('0x2d')](function(_0x5d73f4){var _0x221700=_[_0xc1ed('0x40')](manager['jobs']);var _0x2df234=_[_0xc1ed('0x41')](_0x5d73f4,function(_0x338df0){return _0x338df0['id']['toString']();});var _0x71de0=_['keyBy'](_0x5d73f4,function(_0x4df5d1){return _0x4df5d1['id'][_0xc1ed('0x42')]();});var _0x308513=_0x318c37?_0x2df234:_['difference'](_0x2df234,_0x221700);var _0xe681b6=_[_0xc1ed('0x43')](_0x2df234,_0x221700);var _0x576097=_[_0xc1ed('0x44')](_0x221700,_0x2df234);var _0x430636;var _0x3bee53;for(_0x430636=0x0;_0x430636<_0x576097[_0xc1ed('0x45')]&&!_0x318c37;_0x430636+=0x1){_0x3bee53=_0x576097[_0x430636][_0xc1ed('0x42')]();if(manager[_0xc1ed('0x46')](_0x3bee53)){manager[_0xc1ed('0x47')](_0x3bee53);manager[_0xc1ed('0x48')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x49'),_0x3bee53);}}logger[_0xc1ed('0xa')]('toRun',JSON[_0xc1ed('0x24')](_0x308513));for(_0x430636=0x0;_0x430636<_0x308513[_0xc1ed('0x45')];_0x430636+=0x1){_0x3bee53=_0x308513[_0x430636][_0xc1ed('0x42')]();logger[_0xc1ed('0xa')](_0xc1ed('0x4a'),_0x3bee53);if(_0x318c37){logger[_0xc1ed('0xa')]('my\x20id',_0x318c37);logger[_0xc1ed('0xa')](JSON[_0xc1ed('0x24')](_0x71de0[_0x3bee53]));BPromise['resolve']()[_0xc1ed('0x2d')](handleJob(_0x71de0[_0x3bee53]));logger[_0xc1ed('0xa')](_0xc1ed('0x4b'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53][_0xc1ed('0x4c')]);}else if(_0x71de0[_0x3bee53][_0xc1ed('0x4c')]&&_0x71de0[_0x3bee53]['active']&&moment()[_0xc1ed('0x4d')](_0x71de0[_0x3bee53][_0xc1ed('0x4e')],_0x71de0[_0x3bee53][_0xc1ed('0x4f')])){manager[_0xc1ed('0x50')](_0x3bee53,_0x71de0[_0x3bee53][_0xc1ed('0x4c')],handleJob(_0x71de0[_0x3bee53]));manager[_0xc1ed('0x51')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x52'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53][_0xc1ed('0x4c')]);}else if(manager[_0xc1ed('0x46')](_0x3bee53)){manager[_0xc1ed('0x47')](_0x3bee53);manager[_0xc1ed('0x48')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x53'),_0x71de0[_0x3bee53]['name'],_0x71de0[_0x3bee53]['cron']);}}for(_0x430636=0x0,_0x3bee53;_0x430636<_0xe681b6[_0xc1ed('0x45')]&&!_0x318c37;_0x430636+=0x1){_0x3bee53=_0xe681b6[_0x430636][_0xc1ed('0x42')]();if(manager[_0xc1ed('0x46')](_0x3bee53)){if(_0x71de0[_0x3bee53][_0xc1ed('0x4c')]&&_0x71de0[_0x3bee53][_0xc1ed('0x54')]&&moment()[_0xc1ed('0x4d')](_0x71de0[_0x3bee53]['startAt'],_0x71de0[_0x3bee53]['endAt'])){manager[_0xc1ed('0x55')](_0x3bee53,_0x71de0[_0x3bee53][_0xc1ed('0x4c')],handleJob(_0x71de0[_0x3bee53]));logger[_0xc1ed('0xa')](_0xc1ed('0x56'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53][_0xc1ed('0x4c')]);}else{manager[_0xc1ed('0x47')](_0x3bee53);manager[_0xc1ed('0x48')](_0x3bee53);logger[_0xc1ed('0xa')](_0xc1ed('0x53'),_0x71de0[_0x3bee53][_0xc1ed('0x16')],_0x71de0[_0x3bee53]['cron']);}}}})[_0xc1ed('0x3a')](function(_0x416943){logger[_0xc1ed('0x2e')](JSON[_0xc1ed('0x24')](_0x416943));});}exports[_0xc1ed('0x57')]=function(_0x50105d){return getJobs(_0x50105d);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x1f19=['existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','keyBy','toString','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','run','util','path','lodash','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','../../files/reports','savename','%s.%s','extname'];(function(_0x54d4b9,_0xfd4c7f){var _0x39683e=function(_0x244d16){while(--_0x244d16){_0x54d4b9['push'](_0x54d4b9['shift']());}};_0x39683e(++_0xfd4c7f);}(_0x1f19,0x19d));var _0x91f1=function(_0x13ed0c,_0x8457df){_0x13ed0c=_0x13ed0c-0x0;var _0x5b83c1=_0x1f19[_0x13ed0c];return _0x5b83c1;};'use strict';var fs=require('fs');var util=require(_0x91f1('0x0'));var path=require(_0x91f1('0x1'));var _=require(_0x91f1('0x2'));var moment=require('moment');var CronJobManager=require(_0x91f1('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x91f1('0x4'))(_0x91f1('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x91f1('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x91f1('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3f51b8,_0x2ac6a0){return function(){logger[_0x91f1('0x8')](_0x91f1('0x9'),_0x3f51b8[_0x91f1('0xa')]);var _0x559685=!![];var _0x3eba00={'tls':{'rejectUnauthorized':![]}};if(_0x3f51b8[_0x91f1('0xb')][_0x91f1('0xc')][_0x91f1('0xd')]){_0x3eba00['service']=_0x3f51b8['MailAccount']['Smtp'][_0x91f1('0xd')];}else{_0x3eba00[_0x91f1('0xe')]=_0x3f51b8['MailAccount'][_0x91f1('0xc')][_0x91f1('0xe')];_0x3eba00['port']=_0x3f51b8['MailAccount'][_0x91f1('0xc')][_0x91f1('0xf')];_0x3eba00[_0x91f1('0x10')]=_0x3f51b8[_0x91f1('0xb')][_0x91f1('0xc')][_0x91f1('0x10')];}if(_0x3f51b8[_0x91f1('0xb')][_0x91f1('0xc')][_0x91f1('0x11')]){_0x3eba00[_0x91f1('0x12')]={'user':_0x3f51b8['MailAccount'][_0x91f1('0xc')]['user'],'pass':_0x3f51b8[_0x91f1('0xb')][_0x91f1('0xc')][_0x91f1('0x13')]};}var _0x18ca05={'account':_0x3eba00,'message':{'from':util['format'](_0x91f1('0x14'),_0x3f51b8[_0x91f1('0xb')]['name'],_0x3f51b8['MailAccount'][_0x91f1('0xa')]||_0x3f51b8[_0x91f1('0xb')][_0x91f1('0xc')][_0x91f1('0x15')]),'to':_0x3f51b8[_0x91f1('0xa')],'cc':_0x3f51b8['cc'],'bcc':_0x3f51b8[_0x91f1('0x16')],'subject':util[_0x91f1('0x17')](_0x91f1('0x18'),_0x2ac6a0[_0x91f1('0x19')],_0x3f51b8[_0x91f1('0x1a')],_0x3f51b8['subtractUnit'])}};var _0x4190af=path[_0x91f1('0x1b')](__dirname,_0x91f1('0x1c'));var _0x4011c3=_0x2ac6a0[_0x91f1('0x1d')];var _0x4814e5=util[_0x91f1('0x17')](_0x91f1('0x1e'),path['basename'](_0x2ac6a0[_0x91f1('0x1d')],path[_0x91f1('0x1f')](_0x2ac6a0[_0x91f1('0x1d')])),'zip');var _0x2c4d21=path[_0x91f1('0x1b')](_0x4190af,_0x4011c3);var _0x2caa80=path[_0x91f1('0x1b')](_0x4190af,_0x4814e5);if(fs[_0x91f1('0x20')](_0x2c4d21)){_0x2ac6a0['status']=_0x91f1('0x21');_0x18ca05[_0x91f1('0x22')][_0x91f1('0x23')]=[{'filename':_0x4011c3,'path':_0x2c4d21}];_0x18ca05[_0x91f1('0x22')][_0x91f1('0x24')]=util[_0x91f1('0x17')](_0x91f1('0x25'),JSON[_0x91f1('0x26')](_0x2ac6a0,null,0x2));}else if(fs['existsSync'](_0x2caa80)){_0x2ac6a0[_0x91f1('0x27')]=_0x91f1('0x21');_0x18ca05[_0x91f1('0x22')][_0x91f1('0x23')]=[{'filename':_0x4814e5,'path':_0x2caa80}];}else{_0x18ca05['message'][_0x91f1('0x24')]=_0x91f1('0x28');if(!_0x3f51b8[_0x91f1('0x29')]){_0x559685=![];logger[_0x91f1('0x8')](_0x91f1('0x2a'));}}if(_0x559685){return client[_0x91f1('0x2b')](_0x91f1('0x2c'),_0x18ca05)[_0x91f1('0x2d')](function(_0x3b192c){if(_0x3b192c['error']){return logger[_0x91f1('0x2e')](_0x91f1('0x2f'),JSON[_0x91f1('0x26')](_0x3b192c));}return logger[_0x91f1('0x8')](_0x91f1('0x30'));})[_0x91f1('0x31')](function(_0x3d35cd){return logger[_0x91f1('0x2e')]('error\x20mail',JSON['stringify'](_0x3d35cd));});}};}function handleError(){return function(_0x34d1d7){return logger[_0x91f1('0x2e')](JSON[_0x91f1('0x26')](_0x34d1d7));};}function handleResult(_0x15b714){return function(_0x461e76){logger[_0x91f1('0x8')](_0x91f1('0x32'),JSON['stringify'](_0x461e76));if(_0x15b714[_0x91f1('0xb')]&&_0x15b714[_0x91f1('0xb')][_0x91f1('0xc')]&&!_[_0x91f1('0x33')](_0x15b714[_0x91f1('0xa')])){setTimeout(handleSendEmail(_0x15b714,_0x461e76),0x3c*0x3e8);}};}function handleJob(_0x1dcd4e){return function(){try{if(_[_0x91f1('0x33')](_0x1dcd4e[_0x91f1('0x1a')])){return logger[_0x91f1('0x8')](_0x91f1('0x34'));}if(_[_0x91f1('0x33')](_0x1dcd4e[_0x91f1('0x35')])){return logger[_0x91f1('0x8')](_0x91f1('0x36'));}var _0x2d8aad={'startDate':moment()[_0x91f1('0x37')](_0x1dcd4e[_0x91f1('0x1a')],_0x1dcd4e['subtractUnit'])[_0x91f1('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x91f1('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x1dcd4e['output'],'name':_0x1dcd4e[_0x91f1('0x19')]};if(!_[_0x91f1('0x33')](_0x1dcd4e['DefaultReportId'])){logger[_0x91f1('0x8')](_0x91f1('0x38'),_0x1dcd4e['DefaultReportId']);return analyticDefaultReportController[_0x91f1('0x39')]({'id':_0x1dcd4e['DefaultReportId']},_0x2d8aad)[_0x91f1('0x2d')](handleResult(_0x1dcd4e))['catch'](handleError());}if(!_['isNil'](_0x1dcd4e['CustomReportId'])){logger[_0x91f1('0x8')](_0x91f1('0x3a'),_0x1dcd4e[_0x91f1('0x3b')]);return analyticCustomReportController[_0x91f1('0x39')]({'id':_0x1dcd4e[_0x91f1('0x3b')]},_0x2d8aad)[_0x91f1('0x2d')](handleResult(_0x1dcd4e))[_0x91f1('0x31')](handleError());}}catch(_0x317df3){logger['error'](JSON[_0x91f1('0x26')](_0x317df3));}return logger[_0x91f1('0x8')](_0x91f1('0x3c'));};}function getJobs(_0x3a4609){var _0x132ed5={};if(_0x3a4609){_0x132ed5['id']=_0x3a4609;}return db[_0x91f1('0x3d')][_0x91f1('0x3e')]({'where':_0x132ed5,'include':[{'model':db['MailAccount'],'attributes':['id',_0x91f1('0x19'),_0x91f1('0xa')],'include':[{'model':db[_0x91f1('0x3f')],'as':_0x91f1('0xc')}]}]})[_0x91f1('0x2d')](function(_0x8c4a0a){var _0x2247a0=_[_0x91f1('0x40')](manager['jobs']);var _0x37e2a8=_[_0x91f1('0x41')](_0x8c4a0a,function(_0x312e4a){return _0x312e4a['id']['toString']();});var _0x2230cd=_[_0x91f1('0x42')](_0x8c4a0a,function(_0x21c301){return _0x21c301['id'][_0x91f1('0x43')]();});var _0xeb3c0a=_0x3a4609?_0x37e2a8:_[_0x91f1('0x44')](_0x37e2a8,_0x2247a0);var _0x41dc82=_['intersection'](_0x37e2a8,_0x2247a0);var _0x95ae5c=_['difference'](_0x2247a0,_0x37e2a8);var _0x1ec230;var _0x361cf9;for(_0x1ec230=0x0;_0x1ec230<_0x95ae5c[_0x91f1('0x45')]&&!_0x3a4609;_0x1ec230+=0x1){_0x361cf9=_0x95ae5c[_0x1ec230][_0x91f1('0x43')]();if(manager[_0x91f1('0x46')](_0x361cf9)){manager[_0x91f1('0x47')](_0x361cf9);manager[_0x91f1('0x48')](_0x361cf9);logger[_0x91f1('0x8')](_0x91f1('0x49'),_0x361cf9);}}logger['info'](_0x91f1('0x4a'),JSON['stringify'](_0xeb3c0a));for(_0x1ec230=0x0;_0x1ec230<_0xeb3c0a['length'];_0x1ec230+=0x1){_0x361cf9=_0xeb3c0a[_0x1ec230][_0x91f1('0x43')]();logger['info'](_0x91f1('0x4b'),_0x361cf9);if(_0x3a4609){logger[_0x91f1('0x8')]('my\x20id',_0x3a4609);logger[_0x91f1('0x8')](JSON['stringify'](_0x2230cd[_0x361cf9]));BPromise[_0x91f1('0x4c')]()[_0x91f1('0x2d')](handleJob(_0x2230cd[_0x361cf9]));logger[_0x91f1('0x8')](_0x91f1('0x4d'),_0x2230cd[_0x361cf9][_0x91f1('0x19')],_0x2230cd[_0x361cf9][_0x91f1('0x4e')]);}else if(_0x2230cd[_0x361cf9][_0x91f1('0x4e')]&&_0x2230cd[_0x361cf9]['active']&&moment()[_0x91f1('0x4f')](_0x2230cd[_0x361cf9][_0x91f1('0x50')],_0x2230cd[_0x361cf9][_0x91f1('0x51')])){manager[_0x91f1('0x52')](_0x361cf9,_0x2230cd[_0x361cf9][_0x91f1('0x4e')],handleJob(_0x2230cd[_0x361cf9]));manager[_0x91f1('0x53')](_0x361cf9);logger[_0x91f1('0x8')](_0x91f1('0x54'),_0x2230cd[_0x361cf9][_0x91f1('0x19')],_0x2230cd[_0x361cf9][_0x91f1('0x4e')]);}else if(manager[_0x91f1('0x46')](_0x361cf9)){manager[_0x91f1('0x47')](_0x361cf9);manager['deleteJob'](_0x361cf9);logger[_0x91f1('0x8')](_0x91f1('0x55'),_0x2230cd[_0x361cf9][_0x91f1('0x19')],_0x2230cd[_0x361cf9][_0x91f1('0x4e')]);}}for(_0x1ec230=0x0,_0x361cf9;_0x1ec230<_0x41dc82[_0x91f1('0x45')]&&!_0x3a4609;_0x1ec230+=0x1){_0x361cf9=_0x41dc82[_0x1ec230][_0x91f1('0x43')]();if(manager[_0x91f1('0x46')](_0x361cf9)){if(_0x2230cd[_0x361cf9]['cron']&&_0x2230cd[_0x361cf9][_0x91f1('0x56')]&&moment()[_0x91f1('0x4f')](_0x2230cd[_0x361cf9]['startAt'],_0x2230cd[_0x361cf9][_0x91f1('0x51')])){manager[_0x91f1('0x57')](_0x361cf9,_0x2230cd[_0x361cf9][_0x91f1('0x4e')],handleJob(_0x2230cd[_0x361cf9]));logger[_0x91f1('0x8')]('update\x20cron',_0x2230cd[_0x361cf9][_0x91f1('0x19')],_0x2230cd[_0x361cf9][_0x91f1('0x4e')]);}else{manager['stop'](_0x361cf9);manager[_0x91f1('0x48')](_0x361cf9);logger[_0x91f1('0x8')](_0x91f1('0x55'),_0x2230cd[_0x361cf9][_0x91f1('0x19')],_0x2230cd[_0x361cf9]['cron']);}}}})[_0x91f1('0x31')](function(_0x4f9459){logger[_0x91f1('0x2e')](JSON[_0x91f1('0x26')](_0x4f9459));});}exports[_0x91f1('0x58')]=function(_0x53d1c6){return getJobs(_0x53d1c6);};exports[_0x91f1('0x53')]=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 e86953a..f77881a 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 _0xfc61=['TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','forEach','push','all','catch','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xfc61,0x78));var _0x1fc6=function(_0x5a1891,_0x582d7b){_0x5a1891=_0x5a1891-0x0;var _0x2ed2f2=_0xfc61[_0x5a1891];return _0x2ed2f2;};var _=require(_0x1fc6('0x0'));var AWS=require(_0x1fc6('0x1'));var rp=require(_0x1fc6('0x2'));var util=require(_0x1fc6('0x3'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x1fc6('0x4'));function getTranscriptionJob(_0x3a7772,_0x451c27,_0x3cb94f,_0x48e6f8){return new Promise(function(_0x5b5f8c,_0x2c32ca){var _0x2afe7c=new AWS[(_0x1fc6('0x5'))]({'accessKeyId':_0x451c27,'secretAccessKey':_0x3a7772,'region':_0x3cb94f});_0x2afe7c[_0x1fc6('0x6')]({'TranscriptionJobName':_0x48e6f8},function(_0x377d87,_0x567c47){if(_0x377d87){return _0x2c32ca(_0x377d87);}else{return _0x5b5f8c(_0x567c47);}});});}function sentiment(_0x8891cc,_0x37a219,_0x300375,_0x132f16,_0x5a3e6f){return new Promise(function(_0x26589f,_0xd02ed5){var _0x480324=new AWS[(_0x1fc6('0x7'))]({'accessKeyId':_0x37a219,'secretAccessKey':_0x8891cc,'region':_0x300375});_0x480324[_0x1fc6('0x8')]({'Text':_0x132f16,'LanguageCode':_0x5a3e6f[_0x1fc6('0x9')](0x0,0x2)},function(_0x251479,_0x573e4b){if(_0x251479){return _0xd02ed5(_0x251479);}else{return _0x26589f(_0x573e4b);}});});}function checkTranscribeJob(_0x4d8b12,_0x2a1b5b,_0x475b16){var _0xa08740;return new BPromise(function(_0x5e694d,_0x50e98e){logger[_0x1fc6('0xa')](util['format'](_0x1fc6('0xb'),_0x4d8b12['id'],_0x4d8b12[_0x1fc6('0xc')]));return getTranscriptionJob(_0x475b16[_0x1fc6('0xd')],_0x475b16[_0x1fc6('0xe')],_0x2a1b5b[_0x1fc6('0xf')],_0x4d8b12[_0x1fc6('0xc')])[_0x1fc6('0x10')](function(_0x141d3e){logger['info'](util[_0x1fc6('0x11')](_0x1fc6('0x12'),_0x4d8b12['id'],_0x4d8b12[_0x1fc6('0xc')],_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x14')]));if(!_0x4d8b12[_0x1fc6('0x15')]){switch(_0x141d3e[_0x1fc6('0x13')]['TranscriptionJobStatus']){case _0x1fc6('0x16'):var _0x318bb5={'transcribeStatus':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x14')],'fileUri':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x17')][_0x1fc6('0x18')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x4d8b12['id']));return rp({'uri':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x17')]['TranscriptFileUri'],'json':!![]})[_0x1fc6('0x10')](function(_0x2b7acb){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x19'),_0x4d8b12['id']));if(_0x2b7acb&&_0x2b7acb[_0x1fc6('0x1a')]&&_0x2b7acb[_0x1fc6('0x1a')][_0x1fc6('0x1b')]&&_0x2b7acb[_0x1fc6('0x1a')][_0x1fc6('0x1b')][_0x1fc6('0x1c')]){_0x318bb5[_0x1fc6('0x15')]='';for(var _0x358d3a=0x0;_0x358d3a<_0x2b7acb['results'][_0x1fc6('0x1b')][_0x1fc6('0x1c')];_0x358d3a++){_0x318bb5[_0x1fc6('0x15')]+=_0x2b7acb[_0x1fc6('0x1a')][_0x1fc6('0x1b')][_0x358d3a][_0x1fc6('0x1d')]+'';}}return _0x4d8b12[_0x1fc6('0x1e')](_0x318bb5);})[_0x1fc6('0x10')](function(){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x1f'),_0x4d8b12['id']));if(!_0x4d8b12[_0x1fc6('0x20')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2a1b5b[_0x1fc6('0x23')]||!_0x2a1b5b[_0x1fc6('0x24')]||!_0x2a1b5b[_0x1fc6('0x25')]||!_0x2a1b5b['language']||!_0x2a1b5b[_0x1fc6('0x26')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x27'));}if(!_0x318bb5[_0x1fc6('0x15')]){throw new Error(_0x1fc6('0x28'));}if(_0x2a1b5b[_0x1fc6('0x24')]===_0x475b16['id']){return _0x475b16;}else{return db[_0x1fc6('0x29')]['findOne']({'where':{'id':_settings[_0x1fc6('0x24')]}});}})[_0x1fc6('0x10')](function(_0x3486ff){if(!_0x3486ff){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2a'));}if(!_0x3486ff[_0x1fc6('0xd')]||!_0x3486ff['data2']){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2b'));}_0xa08740=_0x3486ff;logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4d8b12['id']));return sentiment(_0xa08740['data1'],_0xa08740[_0x1fc6('0xe')],_0x2a1b5b[_0x1fc6('0x25')],_0x318bb5[_0x1fc6('0x15')],_0x2a1b5b[_0x1fc6('0x2c')]);})['then'](function(_0xd49a6a){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x2d'),_0x4d8b12['id']));return _0x4d8b12[_0x1fc6('0x1e')]({'sentiment':_0xd49a6a['Sentiment'],'sPositive':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x2f')],'sNegative':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x30')],'sMixed':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x31')],'sNeutral':_0xd49a6a[_0x1fc6('0x2e')][_0x1fc6('0x32')]});})[_0x1fc6('0x10')](function(){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x1f'),_0x4d8b12['id']));_0x5e694d();});case _0x1fc6('0x33'):return _0x4d8b12[_0x1fc6('0x1e')]({'transcribeStatus':_0x1fc6('0x33'),'failureReason':_0x141d3e[_0x1fc6('0x13')][_0x1fc6('0x34')]})[_0x1fc6('0x10')](function(){logger[_0x1fc6('0xa')](util['format'](_0x1fc6('0x1f'),_0x4d8b12['id']));_0x5e694d();});default:logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x35'),_0x4d8b12['id']));break;}}else{return BPromise['resolve']()[_0x1fc6('0x10')](function(){if(!_0x4d8b12[_0x1fc6('0x20')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x36'));}if(!_0x2a1b5b[_0x1fc6('0x23')]||!_0x2a1b5b['sentimentAccountId']||!_0x2a1b5b[_0x1fc6('0x25')]||!_0x2a1b5b['language']||!_0x2a1b5b[_0x1fc6('0x26')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x27'));}if(!_0x4d8b12[_0x1fc6('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x2a1b5b[_0x1fc6('0x24')]===_0x475b16['id']){return _0x475b16;}else{return db[_0x1fc6('0x29')][_0x1fc6('0x37')]({'where':{'id':_settings[_0x1fc6('0x24')]}});}})[_0x1fc6('0x10')](function(_0x4c310a){if(!_0x4c310a){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2a'));}if(!_0x4c310a[_0x1fc6('0xd')]||!_0x4c310a['data2']){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2b'));}_0xa08740=_0x4c310a;logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x38'),_0x4d8b12['id']));return sentiment(_0xa08740[_0x1fc6('0xd')],_0xa08740[_0x1fc6('0xe')],_0x2a1b5b[_0x1fc6('0x25')],_0x4d8b12[_0x1fc6('0x15')],_0x2a1b5b[_0x1fc6('0x2c')]);})['then'](function(_0x31307c){logger[_0x1fc6('0xa')](util[_0x1fc6('0x11')](_0x1fc6('0x2d'),_0x4d8b12['id']));return _0x4d8b12['update']({'sentiment':_0x31307c['Sentiment'],'sPositive':_0x31307c[_0x1fc6('0x2e')][_0x1fc6('0x2f')],'sNegative':_0x31307c[_0x1fc6('0x2e')][_0x1fc6('0x30')],'sMixed':_0x31307c['SentimentScore']['Mixed'],'sNeutral':_0x31307c[_0x1fc6('0x2e')]['Neutral'],'transcribeStatus':_0x1fc6('0x16')});})[_0x1fc6('0x10')](function(){logger['info'](util[_0x1fc6('0x11')](_0x1fc6('0x1f'),_0x4d8b12['id']));_0x5e694d();});}})['catch'](function(_0x50d92c){if(_0x50d92c){if(!_0x50d92c[_0x1fc6('0x39')]||_0x50d92c['name']!=='SequelizeValidationError'){logger[_0x1fc6('0x3a')](util[_0x1fc6('0x11')](_0x1fc6('0x3b'),_0x4d8b12['id']),util[_0x1fc6('0x3c')](_0x50d92c,{'showHidden':![],'depth':null}));}}_0x5e694d();});});}function checkTranscribe(){var _0x561409;var _0x349ffd;var _0xa849a4;return db[_0x1fc6('0x3d')]['findAll']({'where':{'transcribeStatus':_0x1fc6('0x3e')}})['then'](function(_0x2e0282){if(!_0x2e0282||!_0x2e0282[_0x1fc6('0x1c')]){throw new db['Sequelize'][(_0x1fc6('0x22'))](_0x1fc6('0x3f'));}_0x561409=_0x2e0282;return db[_0x1fc6('0x40')][_0x1fc6('0x37')]({'where':{'id':0x1}});})['then'](function(_0x45a8fc){if(!_0x45a8fc){throw new db['Sequelize'][(_0x1fc6('0x22'))]('Settings\x20not\x20available');}_0x349ffd=_0x45a8fc;if(!_0x349ffd[_0x1fc6('0x4')]||!_0x349ffd[_0x1fc6('0x41')]||!_0x349ffd[_0x1fc6('0xf')]||!_0x349ffd['language']||!_0x349ffd[_0x1fc6('0x26')]){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))]('Transcribe\x20not\x20configured');}return db[_0x1fc6('0x29')]['findOne']({'where':{'id':_0x349ffd[_0x1fc6('0x41')]}});})['then'](function(_0x5790a9){if(!_0x5790a9){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5790a9['data1']||!_0x5790a9['data2']){throw new db[(_0x1fc6('0x21'))][(_0x1fc6('0x22'))](_0x1fc6('0x2b'));}_0xa849a4=_0x5790a9;var _0x28f058=[];_0x561409[_0x1fc6('0x42')](function(_0x39fd88){_0x28f058[_0x1fc6('0x43')](checkTranscribeJob(_0x39fd88,_0x349ffd,_0xa849a4));});return BPromise[_0x1fc6('0x44')](_0x28f058);})[_0x1fc6('0x45')](function(_0x1257bf){if(_0x1257bf){if(!_0x1257bf[_0x1fc6('0x39')]||_0x1257bf['name']!==_0x1fc6('0x46')){logger[_0x1fc6('0x3a')](util[_0x1fc6('0x3c')](_0x1257bf,{'showHidden':![],'depth':null}));}}});}exports[_0x1fc6('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x01d3=['error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','bucket','forEach','push','all','inspect','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','COMPLETED','catch','name','SequelizeValidationError'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x01d3,0xa2));var _0x301d=function(_0x14d2ce,_0x55f131){_0x14d2ce=_0x14d2ce-0x0;var _0x54516d=_0x01d3[_0x14d2ce];return _0x54516d;};var _=require(_0x301d('0x0'));var AWS=require(_0x301d('0x1'));var rp=require(_0x301d('0x2'));var util=require(_0x301d('0x3'));var BPromise=require('bluebird');var db=require(_0x301d('0x4'))['db'];var logger=require(_0x301d('0x5'))('transcribe');function getTranscriptionJob(_0x1b5c75,_0x20d62c,_0x45562b,_0x337347){return new Promise(function(_0x5d1462,_0x318074){var _0x2d8fc2=new AWS[(_0x301d('0x6'))]({'accessKeyId':_0x20d62c,'secretAccessKey':_0x1b5c75,'region':_0x45562b});_0x2d8fc2[_0x301d('0x7')]({'TranscriptionJobName':_0x337347},function(_0x35e760,_0x3ba019){if(_0x35e760){return _0x318074(_0x35e760);}else{return _0x5d1462(_0x3ba019);}});});}function sentiment(_0x130666,_0x26ce06,_0x35ae14,_0x18b853,_0x4c2760){return new Promise(function(_0x1f33fa,_0x2d1d2b){var _0x3cff9d=new AWS['Comprehend']({'accessKeyId':_0x26ce06,'secretAccessKey':_0x130666,'region':_0x35ae14});_0x3cff9d[_0x301d('0x8')]({'Text':_0x18b853,'LanguageCode':_0x4c2760[_0x301d('0x9')](0x0,0x2)},function(_0x5c5d69,_0x5050d3){if(_0x5c5d69){return _0x2d1d2b(_0x5c5d69);}else{return _0x1f33fa(_0x5050d3);}});});}function checkTranscribeJob(_0x4a666b,_0x36a891,_0x2d1684){var _0x467b08;return new BPromise(function(_0x47cc84,_0xe192e6){logger[_0x301d('0xa')](util[_0x301d('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x4a666b['id'],_0x4a666b['transcribeName']));return getTranscriptionJob(_0x2d1684[_0x301d('0xc')],_0x2d1684[_0x301d('0xd')],_0x36a891[_0x301d('0xe')],_0x4a666b['transcribeName'])['then'](function(_0x4f0f10){logger['info'](util[_0x301d('0xb')](_0x301d('0xf'),_0x4a666b['id'],_0x4a666b[_0x301d('0x10')],_0x4f0f10[_0x301d('0x11')][_0x301d('0x12')]));if(!_0x4a666b[_0x301d('0x13')]){switch(_0x4f0f10['TranscriptionJob'][_0x301d('0x12')]){case'COMPLETED':var _0x4eb5eb={'transcribeStatus':_0x4f0f10[_0x301d('0x11')][_0x301d('0x12')],'fileUri':_0x4f0f10['TranscriptionJob'][_0x301d('0x14')]['TranscriptFileUri']};logger[_0x301d('0xa')](util[_0x301d('0xb')](_0x301d('0x15'),_0x4a666b['id']));return rp({'uri':_0x4f0f10['TranscriptionJob'][_0x301d('0x14')]['TranscriptFileUri'],'json':!![]})[_0x301d('0x16')](function(_0x420cf7){logger[_0x301d('0xa')](util['format'](_0x301d('0x17'),_0x4a666b['id']));if(_0x420cf7&&_0x420cf7[_0x301d('0x18')]&&_0x420cf7[_0x301d('0x18')][_0x301d('0x19')]&&_0x420cf7[_0x301d('0x18')][_0x301d('0x19')][_0x301d('0x1a')]){_0x4eb5eb['fileText']='';for(var _0x2f3b71=0x0;_0x2f3b71<_0x420cf7[_0x301d('0x18')][_0x301d('0x19')]['length'];_0x2f3b71++){_0x4eb5eb[_0x301d('0x13')]+=_0x420cf7[_0x301d('0x18')]['transcripts'][_0x2f3b71][_0x301d('0x1b')]+'';}}return _0x4a666b['update'](_0x4eb5eb);})[_0x301d('0x16')](function(){logger[_0x301d('0xa')](util['format'](_0x301d('0x1c'),_0x4a666b['id']));if(!_0x4a666b['tempSentiment']){throw new db['Sequelize'][(_0x301d('0x1d'))](_0x301d('0x1e'));}if(!_0x36a891[_0x301d('0x1f')]||!_0x36a891['sentimentAccountId']||!_0x36a891[_0x301d('0x20')]||!_0x36a891['language']||!_0x36a891['bucket']){throw new db['Sequelize'][(_0x301d('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4eb5eb[_0x301d('0x13')]){throw new Error(_0x301d('0x21'));}if(_0x36a891[_0x301d('0x22')]===_0x2d1684['id']){return _0x2d1684;}else{return db[_0x301d('0x23')][_0x301d('0x24')]({'where':{'id':_settings[_0x301d('0x22')]}});}})[_0x301d('0x16')](function(_0x1b1d83){if(!_0x1b1d83){throw new db['Sequelize'][(_0x301d('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1b1d83[_0x301d('0xc')]||!_0x1b1d83[_0x301d('0xd')]){throw new db['Sequelize']['ValidationError'](_0x301d('0x25'));}_0x467b08=_0x1b1d83;logger['info'](util[_0x301d('0xb')](_0x301d('0x26'),_0x4a666b['id']));return sentiment(_0x467b08[_0x301d('0xc')],_0x467b08[_0x301d('0xd')],_0x36a891[_0x301d('0x20')],_0x4eb5eb[_0x301d('0x13')],_0x36a891[_0x301d('0x27')]);})[_0x301d('0x16')](function(_0x6d751){logger[_0x301d('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4a666b['id']));return _0x4a666b['update']({'sentiment':_0x6d751[_0x301d('0x28')],'sPositive':_0x6d751[_0x301d('0x29')][_0x301d('0x2a')],'sNegative':_0x6d751['SentimentScore'][_0x301d('0x2b')],'sMixed':_0x6d751[_0x301d('0x29')][_0x301d('0x2c')],'sNeutral':_0x6d751['SentimentScore'][_0x301d('0x2d')]});})[_0x301d('0x16')](function(){logger[_0x301d('0xa')](util['format'](_0x301d('0x1c'),_0x4a666b['id']));_0x47cc84();});case _0x301d('0x2e'):return _0x4a666b[_0x301d('0x2f')]({'transcribeStatus':_0x301d('0x2e'),'failureReason':_0x4f0f10[_0x301d('0x11')][_0x301d('0x30')]})[_0x301d('0x16')](function(){logger[_0x301d('0xa')](util[_0x301d('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4a666b['id']));_0x47cc84();});default:logger['info'](util[_0x301d('0xb')](_0x301d('0x31'),_0x4a666b['id']));break;}}else{return BPromise[_0x301d('0x32')]()[_0x301d('0x16')](function(){if(!_0x4a666b[_0x301d('0x33')]){throw new db[(_0x301d('0x34'))][(_0x301d('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x36a891[_0x301d('0x1f')]||!_0x36a891['sentimentAccountId']||!_0x36a891['sentimentRegion']||!_0x36a891[_0x301d('0x27')]||!_0x36a891['bucket']){throw new db[(_0x301d('0x34'))][(_0x301d('0x1d'))](_0x301d('0x35'));}if(!_0x4a666b['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x36a891[_0x301d('0x22')]===_0x2d1684['id']){return _0x2d1684;}else{return db[_0x301d('0x23')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x301d('0x16')](function(_0x4c56a6){if(!_0x4c56a6){throw new db['Sequelize'][(_0x301d('0x1d'))](_0x301d('0x36'));}if(!_0x4c56a6[_0x301d('0xc')]||!_0x4c56a6[_0x301d('0xd')]){throw new db[(_0x301d('0x34'))][(_0x301d('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x467b08=_0x4c56a6;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4a666b['id']));return sentiment(_0x467b08[_0x301d('0xc')],_0x467b08[_0x301d('0xd')],_0x36a891[_0x301d('0x20')],_0x4a666b[_0x301d('0x13')],_0x36a891[_0x301d('0x27')]);})[_0x301d('0x16')](function(_0x57c90f){logger[_0x301d('0xa')](util[_0x301d('0xb')](_0x301d('0x37'),_0x4a666b['id']));return _0x4a666b[_0x301d('0x2f')]({'sentiment':_0x57c90f[_0x301d('0x28')],'sPositive':_0x57c90f[_0x301d('0x29')][_0x301d('0x2a')],'sNegative':_0x57c90f['SentimentScore'][_0x301d('0x2b')],'sMixed':_0x57c90f[_0x301d('0x29')][_0x301d('0x2c')],'sNeutral':_0x57c90f['SentimentScore'][_0x301d('0x2d')],'transcribeStatus':_0x301d('0x38')});})[_0x301d('0x16')](function(){logger[_0x301d('0xa')](util[_0x301d('0xb')](_0x301d('0x1c'),_0x4a666b['id']));_0x47cc84();});}})[_0x301d('0x39')](function(_0x415d54){if(_0x415d54){if(!_0x415d54['name']||_0x415d54[_0x301d('0x3a')]!==_0x301d('0x3b')){logger[_0x301d('0x3c')](util['format'](_0x301d('0x3d'),_0x4a666b['id']),util['inspect'](_0x415d54,{'showHidden':![],'depth':null}));}}_0x47cc84();});});}function checkTranscribe(){var _0x2b6fde;var _0x130e2a;var _0x58d3a9;return db['VoiceRecording'][_0x301d('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x301d('0x16')](function(_0x3bd320){if(!_0x3bd320||!_0x3bd320['length']){throw new db[(_0x301d('0x34'))][(_0x301d('0x1d'))](_0x301d('0x3f'));}_0x2b6fde=_0x3bd320;return db[_0x301d('0x40')][_0x301d('0x24')]({'where':{'id':0x1}});})[_0x301d('0x16')](function(_0x267630){if(!_0x267630){throw new db[(_0x301d('0x34'))][(_0x301d('0x1d'))](_0x301d('0x41'));}_0x130e2a=_0x267630;if(!_0x130e2a[_0x301d('0x42')]||!_0x130e2a[_0x301d('0x43')]||!_0x130e2a['transcribeRegion']||!_0x130e2a[_0x301d('0x27')]||!_0x130e2a[_0x301d('0x44')]){throw new db[(_0x301d('0x34'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x301d('0x23')][_0x301d('0x24')]({'where':{'id':_0x130e2a[_0x301d('0x43')]}});})[_0x301d('0x16')](function(_0x12d114){if(!_0x12d114){throw new db['Sequelize'][(_0x301d('0x1d'))](_0x301d('0x36'));}if(!_0x12d114[_0x301d('0xc')]||!_0x12d114[_0x301d('0xd')]){throw new db['Sequelize'][(_0x301d('0x1d'))](_0x301d('0x25'));}_0x58d3a9=_0x12d114;var _0x548c1e=[];_0x2b6fde[_0x301d('0x45')](function(_0x201718){_0x548c1e[_0x301d('0x46')](checkTranscribeJob(_0x201718,_0x130e2a,_0x58d3a9));});return BPromise[_0x301d('0x47')](_0x548c1e);})[_0x301d('0x39')](function(_0x32665c){if(_0x32665c){if(!_0x32665c[_0x301d('0x3a')]||_0x32665c['name']!==_0x301d('0x3b')){logger[_0x301d('0x3c')](util[_0x301d('0x48')](_0x32665c,{'showHidden':![],'depth':null}));}}});}exports[_0x301d('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index ce7fd84..dfa2052 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 _0xd9bf=['whatsappInteraction:update','error','inspect','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','localhost','redis','WhatsappInteraction','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9bf,0x162));var _0xfd9b=function(_0x5251fd,_0x41c018){_0x5251fd=_0x5251fd-0x0;var _0x41ba58=_0xd9bf[_0x5251fd];return _0x41ba58;};'use strict';var _=require(_0xfd9b('0x0'));var moment=require(_0xfd9b('0x1'));var Redis=require(_0xfd9b('0x2'));var util=require(_0xfd9b('0x3'));var config=require('../../config/environment');var db=require(_0xfd9b('0x4'))['db'];var logger=require(_0xfd9b('0x5'))(_0xfd9b('0x6'));config['redis']=_[_0xfd9b('0x7')](config['redis'],{'host':_0xfd9b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfd9b('0x9')]));function closeInteractions(){var _0x2f2519=[];return db[_0xfd9b('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfd9b('0xb')](0x18,_0xfd9b('0xc'))}}})[_0xfd9b('0xd')](function(_0x56b6c8){if(_0x56b6c8&&_0x56b6c8[_0xfd9b('0xe')]){_0x2f2519=_[_0xfd9b('0xf')](_0x56b6c8||[],'id');logger[_0xfd9b('0x10')](_0xfd9b('0x11'),_0x2f2519['join']());return db['WhatsappInteraction'][_0xfd9b('0x12')]({'closeReason':_0xfd9b('0x13'),'disposition':_0xfd9b('0x14'),'closed':!![],'closedAt':moment()[_0xfd9b('0x15')](_0xfd9b('0x16'))},{'where':{'id':_0x2f2519}});}})[_0xfd9b('0xd')](function(){if(_0x2f2519&&_0x2f2519[_0xfd9b('0xe')]){logger[_0xfd9b('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2f2519['join']());for(var _0x20c9a0=0x0;_0x20c9a0<_0x2f2519['length'];_0x20c9a0++){io[_0xfd9b('0x17')](_0xfd9b('0x18'),{'id':_0x2f2519[_0x20c9a0],'closed':!![]});}}})['catch'](function(_0xe48860){logger[_0xfd9b('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xe48860?util[_0xfd9b('0x1a')](_0xe48860,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xada7=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','findAll','hours','then','length','map'];(function(_0x3aeeec,_0x36b936){var _0x290404=function(_0x5334b3){while(--_0x5334b3){_0x3aeeec['push'](_0x3aeeec['shift']());}};_0x290404(++_0x36b936);}(_0xada7,0x186));var _0x7ada=function(_0x4e6d1f,_0x5abde6){_0x4e6d1f=_0x4e6d1f-0x0;var _0x127c9a=_0xada7[_0x4e6d1f];return _0x127c9a;};'use strict';var _=require(_0x7ada('0x0'));var moment=require(_0x7ada('0x1'));var Redis=require('ioredis');var util=require(_0x7ada('0x2'));var config=require(_0x7ada('0x3'));var db=require(_0x7ada('0x4'))['db'];var logger=require(_0x7ada('0x5'))(_0x7ada('0x6'));config['redis']=_[_0x7ada('0x7')](config[_0x7ada('0x8')],{'host':_0x7ada('0x9'),'port':0x18eb});var io=require(_0x7ada('0xa'))(new Redis(config[_0x7ada('0x8')]));function closeInteractions(){var _0x312ccd=[];return db['WhatsappInteraction'][_0x7ada('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x7ada('0xc'))}}})[_0x7ada('0xd')](function(_0x55af80){if(_0x55af80&&_0x55af80[_0x7ada('0xe')]){_0x312ccd=_[_0x7ada('0xf')](_0x55af80||[],'id');logger[_0x7ada('0x10')](_0x7ada('0x11'),_0x312ccd[_0x7ada('0x12')]());return db['WhatsappInteraction'][_0x7ada('0x13')]({'closeReason':_0x7ada('0x14'),'disposition':_0x7ada('0x15'),'closed':!![],'closedAt':moment()[_0x7ada('0x16')](_0x7ada('0x17'))},{'where':{'id':_0x312ccd}});}})[_0x7ada('0xd')](function(){if(_0x312ccd&&_0x312ccd[_0x7ada('0xe')]){logger[_0x7ada('0x10')](_0x7ada('0x18'),_0x312ccd[_0x7ada('0x12')]());for(var _0x33d2f1=0x0;_0x33d2f1<_0x312ccd[_0x7ada('0xe')];_0x33d2f1++){io[_0x7ada('0x19')]('whatsappInteraction:update',{'id':_0x312ccd[_0x33d2f1],'closed':!![]});}}})['catch'](function(_0x46a6fc){logger[_0x7ada('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x46a6fc?util[_0x7ada('0x1b')](_0x46a6fc,{'showHidden':![],'depth':null}):'');});}exports[_0x7ada('0x1c')]=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 c826676..b292bd3 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94ad=['Innocenzo','Biondo','innocenzo.biondo','now','CmContact','destroy','bulkCreate','log','finished\x20populating','contacts1','CmHopper','then','contacts2','hopper2','catch','util','../mysqldb','push'];(function(_0x209497,_0x311317){var _0x4882d4=function(_0x574888){while(--_0x574888){_0x209497['push'](_0x209497['shift']());}};_0x4882d4(++_0x311317);}(_0x94ad,0x165));var _0xd94a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x94ad[_0x1d1779];return _0x2377e9;};'use strict';var util=require(_0xd94a('0x0'));var db=require(_0xd94a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd94a('0x2')]({'id':i,'firstName':_0xd94a('0x3')+i,'lastName':_0xd94a('0x4')+i,'phone':0xf879fb460+i,'email':_0xd94a('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd94a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd94a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xd94a('0x3')+i,'lastName':_0xd94a('0x4')+i,'phone':0xf879fb460+i,'email':_0xd94a('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd94a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd94a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xd94a('0x7')][_0xd94a('0x8')]({'where':{}})['then'](function(){return db[_0xd94a('0x7')][_0xd94a('0x9')](contacts);})['then'](function(){console[_0xd94a('0xa')](_0xd94a('0xb'),_0xd94a('0xc'));return db[_0xd94a('0xd')]['destroy']({'where':{}});})[_0xd94a('0xe')](function(){return db[_0xd94a('0xd')][_0xd94a('0x9')](hopper);})[_0xd94a('0xe')](function(){console['log'](_0xd94a('0xb'),'hopper1');return db[_0xd94a('0x7')][_0xd94a('0x9')](contacts2);})[_0xd94a('0xe')](function(){console[_0xd94a('0xa')]('finished\x20populating',_0xd94a('0xf'));return db['CmHopper'][_0xd94a('0x9')](hopper2);})[_0xd94a('0xe')](function(){console['log'](_0xd94a('0xb'),_0xd94a('0x10'));})[_0xd94a('0x11')](function(_0x3984b3){console['log'](_0x3984b3);}); \ No newline at end of file +var _0x3596=['now','Biondo','innocenzo.biondo','destroy','CmContact','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','@xcally.com'];(function(_0x53c81a,_0xfe65a1){var _0x29ad48=function(_0x578805){while(--_0x578805){_0x53c81a['push'](_0x53c81a['shift']());}};_0x29ad48(++_0xfe65a1);}(_0x3596,0xa6));var _0x6359=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x3596[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0x6359('0x0'));var db=require(_0x6359('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6359('0x2')]({'id':i,'firstName':_0x6359('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6359('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6359('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6359('0x5')](),'updatedAt':Date[_0x6359('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6359('0x3')+i,'lastName':_0x6359('0x6')+i,'phone':0xf879fb460+i,'email':_0x6359('0x7')+i+_0x6359('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6359('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6359('0x5')](),'updatedAt':Date[_0x6359('0x5')]()});}db['CmContact'][_0x6359('0x8')]({'where':{}})['then'](function(){return db[_0x6359('0x9')]['bulkCreate'](contacts);})[_0x6359('0xa')](function(){console[_0x6359('0xb')](_0x6359('0xc'),_0x6359('0xd'));return db[_0x6359('0xe')][_0x6359('0x8')]({'where':{}});})[_0x6359('0xa')](function(){return db[_0x6359('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0x6359('0xb')](_0x6359('0xc'),'hopper1');return db[_0x6359('0x9')][_0x6359('0xf')](contacts2);})[_0x6359('0xa')](function(){console[_0x6359('0xb')](_0x6359('0xc'),_0x6359('0x10'));return db[_0x6359('0xe')][_0x6359('0xf')](hopper2);})['then'](function(){console[_0x6359('0xb')](_0x6359('0xc'),_0x6359('0x11'));})[_0x6359('0x12')](function(_0x5a7766){console[_0x6359('0xb')](_0x5a7766);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 3d63c01..e7b529a 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3257=['actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','ulaw','yes','/etc/pki/tls/private/motion.key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3257,0x8c));var _0x7325=function(_0x2a504f,_0x427fd5){_0x2a504f=_0x2a504f-0x0;var _0x4ebd79=_0x3257[_0x2a504f];return _0x4ebd79;};'use strict';var util=require(_0x7325('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7325('0x1')]({'name':util[_0x7325('0x2')](_0x7325('0x3'),_0x7325('0x4'),i),'fullname':util[_0x7325('0x2')]('%s%s','agent',i),'email':util[_0x7325('0x2')](_0x7325('0x5'),_0x7325('0x4'),i),'role':_0x7325('0x4'),'password':_0x7325('0x6'),'internal':0xfa0+i,'type':_0x7325('0x7'),'transport':[_0x7325('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0x7325('0x9')],'defaultuser':util[_0x7325('0x2')]('%s%s',_0x7325('0x4'),i),'encryption':'yes','avpf':_0x7325('0xa'),'force_avp':_0x7325('0xa'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x7325('0xb'),'dtlssetup':_0x7325('0xc'),'callerid':util[_0x7325('0x2')](_0x7325('0xd'),util[_0x7325('0x2')]('%s%s','agent',i),0xfa0+i)});}db['User'][_0x7325('0xe')](users)[_0x7325('0xf')](function(){console[_0x7325('0x10')](_0x7325('0x11'));})[_0x7325('0x12')](function(_0xe2a29f){console[_0x7325('0x10')](_0xe2a29f);}); \ No newline at end of file +var _0x8d89=['ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent','password','friend','udp','wss','all'];(function(_0x1ec9ad,_0x697a3f){var _0x35f747=function(_0x4b2e2f){while(--_0x4b2e2f){_0x1ec9ad['push'](_0x1ec9ad['shift']());}};_0x35f747(++_0x697a3f);}(_0x8d89,0xfa));var _0x98d8=function(_0x5722b7,_0x475f4e){_0x5722b7=_0x5722b7-0x0;var _0xf2325d=_0x8d89[_0x5722b7];return _0xf2325d;};'use strict';var util=require(_0x98d8('0x0'));var db=require(_0x98d8('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x98d8('0x2')](_0x98d8('0x3'),_0x98d8('0x4'),i),'fullname':util['format'](_0x98d8('0x3'),_0x98d8('0x4'),i),'email':util[_0x98d8('0x2')]('%s%s@xcally.com',_0x98d8('0x4'),i),'role':_0x98d8('0x4'),'password':_0x98d8('0x5'),'internal':0xfa0+i,'type':_0x98d8('0x6'),'transport':[_0x98d8('0x7'),'ws',_0x98d8('0x8')],'disallow':[_0x98d8('0x9')],'allow':[_0x98d8('0xa')],'defaultuser':util[_0x98d8('0x2')](_0x98d8('0x3'),_0x98d8('0x4'),i),'encryption':_0x98d8('0xb'),'avpf':_0x98d8('0xb'),'force_avp':_0x98d8('0xb'),'icesupport':'yes','dtlsenable':_0x98d8('0xb'),'dtlsverify':'no','dtlscertfile':_0x98d8('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x98d8('0xd'),'callerid':util[_0x98d8('0x2')](_0x98d8('0xe'),util['format'](_0x98d8('0x3'),_0x98d8('0x4'),i),0xfa0+i)});}db['User'][_0x98d8('0xf')](users)[_0x98d8('0x10')](function(){console[_0x98d8('0x11')](_0x98d8('0x12'));})[_0x98d8('0x13')](function(_0x4ceb0c){console[_0x98d8('0x11')](_0x4ceb0c);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 264145e..c6b09ba 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ae6=['DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','type','ivr','format','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect'];(function(_0x274213,_0x478bae){var _0x9da749=function(_0x3e8709){while(--_0x3e8709){_0x274213['push'](_0x274213['shift']());}};_0x9da749(++_0x478bae);}(_0x1ae6,0x65));var _0x61ae=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1ae6[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x61ae('0x0'));var util=require(_0x61ae('0x1'));var BPromise=require(_0x61ae('0x2'));var db=require(_0x61ae('0x3'))['db'];var config=require(_0x61ae('0x4'));var queryQueues={'attributes':['id',_0x61ae('0x5')],'include':[{'as':_0x61ae('0x6'),'model':db[_0x61ae('0x7')],'attributes':['id',_0x61ae('0x5'),_0x61ae('0x8')],'raw':!![],'where':{'role':_0x61ae('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x61ae('0x5')],'where':{'role':_0x61ae('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x61ae('0x5'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0xf6a00,_0x1864e8,_0x591eb7){return db['UserProfileSection']['findOne']({'where':{'name':_0xf6a00,'userProfileId':_0x1864e8},'raw':!![]})[_0x61ae('0xb')](function(_0x480e10){if(_0x480e10){if(_0x480e10[_0x61ae('0xc')]){switch(_0xf6a00){case _0x61ae('0xd'):case _0x61ae('0xe'):case _0x61ae('0xf'):case _0x61ae('0x10'):case _0x61ae('0x11'):case'OpenchannelQueues':case _0x61ae('0x12'):return db[_0x591eb7]['findAll'](queryQueues);case _0x61ae('0x13'):return db[_0x591eb7][_0x61ae('0x14')](queryTelephones);case _0x61ae('0x15'):return db[_0x591eb7][_0x61ae('0x14')](queryTrunks);case _0x61ae('0x16'):return db[_0x591eb7][_0x61ae('0x14')](queryCampaigns);}}else{return db[_0x61ae('0x17')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x480e10['id']},'raw':!![]})[_0x61ae('0xb')](function(_0x6dc672){if(_0x6dc672){var _0x5d1001={'where':{'id':_[_0x61ae('0x18')](_0x6dc672,_0x61ae('0x19'))},'raw':!![]};switch(_0x591eb7){case'User':_0x5d1001[_0x61ae('0x1a')][_0x61ae('0x8')]=_0x61ae('0xa');break;case _0x61ae('0x1b'):_0x5d1001[_0x61ae('0x1a')][_0x61ae('0x1c')]=_0x61ae('0x1d');break;}return db[_0x591eb7][_0x61ae('0x14')](_0x5d1001);}else{return[];}});}}else{return[];}})['then'](function(_0x1c6d08){return _0x1c6d08;});}function joinOrLeaveQueues(_0x3a3770,_0x56053b,_0xd6b7fd,_0x533cef){_0x3a3770[_0x56053b](util[_0x61ae('0x1e')]('%s:queue:%s',_0xd6b7fd,_0x533cef[_0x61ae('0x5')]));if(_0x533cef[_0x61ae('0x6')]){for(var _0x2f0eb2=0x0;_0x2f0eb2<_0x533cef[_0x61ae('0x6')]['length'];_0x2f0eb2+=0x1){_0x3a3770[_0x56053b](util[_0x61ae('0x1e')](_0x61ae('0x1f'),_0x533cef['Agents'][_0x2f0eb2][_0x61ae('0x5')]));}}}function joinOrLeave(_0xc69019,_0x5d9828,_0x2d3dd9){var _0x481ced;if(_0xc69019[_0x61ae('0x20')][_0x61ae('0x21')]['id']){db[_0x61ae('0x7')]['find']({'attributes':['id','name',_0x61ae('0x8'),_0x61ae('0x22')],'where':{'id':_0xc69019[_0x61ae('0x20')][_0x61ae('0x21')]['id']},'include':[{'model':db[_0x61ae('0x23')],'as':_0x61ae('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x61ae('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x26')],'as':_0x61ae('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x28')],'as':_0x61ae('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x2a')],'as':_0x61ae('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x61ae('0x2c')],'as':_0x61ae('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4d21ee){if(_0x4d21ee){_0x481ced=_0x4d21ee;_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x1f'),_0x4d21ee[_0x61ae('0x5')]));var _0x4830fb=[];switch(_0x4d21ee['role']){case _0x61ae('0x2e'):_0xc69019[_0x5d9828]('voice:inbound');_0xc69019[_0x5d9828](_0x61ae('0x2f'));if(queryQueues[_0x61ae('0x30')](_0x61ae('0x31'))){delete queryQueues['include'];}_0x4830fb['push'](db[_0x61ae('0x32')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x34')]['findAll'](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x35')]['findAll'](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x36')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x37')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x38')][_0x61ae('0x14')](queryQueues));_0x4830fb[_0x61ae('0x33')](db[_0x61ae('0x39')][_0x61ae('0x14')](queryQueues));_0x4830fb['push'](db['User']['findAll'](queryTelephones));_0x4830fb['push'](db[_0x61ae('0x3a')][_0x61ae('0x14')](queryTrunks));_0x4830fb[_0x61ae('0x33')](db['Campaign'][_0x61ae('0x14')](queryCampaigns));_0x4830fb['push'](db['User'][_0x61ae('0x14')](queryAgents));break;case'user':_0xc69019[_0x5d9828](_0x61ae('0x3b'));_0xc69019[_0x5d9828]('voice:outbound');_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0xd'),_0x4d21ee['userProfileId'],_0x61ae('0x32')));_0x4830fb['push'](getAssociatedResources('ChatQueues',_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x34')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0xf'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x35')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources('SmsQueues',_0x4d21ee['userProfileId'],_0x61ae('0x36')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x11'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x37')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources('OpenchannelQueues',_0x4d21ee[_0x61ae('0x22')],'OpenchannelQueue'));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x12'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x39')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x13'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x7')));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x15'),_0x4d21ee['userProfileId'],'Trunk'));_0x4830fb[_0x61ae('0x33')](getAssociatedResources(_0x61ae('0x16'),_0x4d21ee[_0x61ae('0x22')],_0x61ae('0x1b')));_0x4830fb[_0x61ae('0x33')](db['User'][_0x61ae('0x14')](queryAgents));break;case _0x61ae('0x9'):_0xc69019[_0x5d9828](_0x61ae('0x3b'));_0xc69019[_0x5d9828](_0x61ae('0x2f'));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x3c')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb['push'](_0x4d21ee[_0x61ae('0x3d')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee['getFaxQueues']({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x3e')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x3f')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb[_0x61ae('0x33')](_0x4d21ee[_0x61ae('0x40')]({'attributes':['id',_0x61ae('0x5')]}));_0x4830fb['push'](_0x4d21ee['getWhatsappQueues']({'attributes':['id',_0x61ae('0x5')]}));break;}return BPromise['all'](_0x4830fb);}})[_0x61ae('0xb')](function(_0xd99b44){if(_0xd99b44&&_0xd99b44[_0x61ae('0x41')]){for(var _0x18aef3=0x0;_0x18aef3<_0xd99b44[_0x61ae('0x41')];_0x18aef3+=0x1){for(var _0x400acf=0x0;_0x400acf<_0xd99b44[_0x18aef3]['length'];_0x400acf+=0x1){switch(_0x18aef3){case 0x0:joinOrLeaveQueues(_0xc69019,_0x5d9828,'voice',_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x1:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x42'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x2:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x43'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x3:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x44'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x4:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x45'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x5:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x46'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x6:joinOrLeaveQueues(_0xc69019,_0x5d9828,_0x61ae('0x47'),_0xd99b44[_0x18aef3][_0x400acf]);break;case 0x7:if(_0x481ced['role']!==_0x61ae('0x9'))_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x48'),_0xd99b44[_0x18aef3][_0x400acf][_0x61ae('0x5')]));break;case 0x8:if(_0x481ced[_0x61ae('0x8')]!==_0x61ae('0x9'))_0xc69019[_0x5d9828](util[_0x61ae('0x1e')]('trunk:%s',_0xd99b44[_0x18aef3][_0x400acf][_0x61ae('0x5')]));break;case 0x9:if(_0x481ced[_0x61ae('0x8')]!==_0x61ae('0x9'))_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x49'),_0xd99b44[_0x18aef3][_0x400acf]['type'],_0xd99b44[_0x18aef3][_0x400acf]['name']));break;case 0xa:_0xc69019[_0x5d9828](util[_0x61ae('0x1e')](_0x61ae('0x1f'),_0xd99b44[_0x18aef3][_0x400acf][_0x61ae('0x5')]));break;}}}}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0xbe20c=_[_0x61ae('0x18')](_0x481ced[_0x61ae('0x24')],'id');return _0x481ced[_0x61ae('0x4b')](_0xbe20c)[_0x61ae('0xb')](function(){for(var _0x2d3124=0x0;_0x2d3124<_0xbe20c[_0x61ae('0x41')];_0x2d3124+=0x1){_0x2d3dd9[_0x61ae('0x4c')](_0x61ae('0x4d'),{'ChatInteractionId':Number(_0xbe20c[_0x2d3124]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0x478759=_[_0x61ae('0x18')](_0x481ced[_0x61ae('0x25')],'id');return _0x481ced[_0x61ae('0x4e')](_0x478759)[_0x61ae('0xb')](function(){for(var _0x35400e=0x0;_0x35400e<_0x478759[_0x61ae('0x41')];_0x35400e+=0x1){_0x2d3dd9['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x478759[_0x35400e]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0x32ba4b=_['map'](_0x481ced[_0x61ae('0x27')],'id');return _0x481ced['removeFaxInteractions'](_0x32ba4b)[_0x61ae('0xb')](function(){for(var _0x37055c=0x0;_0x37055c<_0x32ba4b[_0x61ae('0x41')];_0x37055c+=0x1){_0x2d3dd9[_0x61ae('0x4c')](_0x61ae('0x4f'),{'FaxInteractionId':Number(_0x32ba4b[_0x37055c]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828==='leave'){var _0x455c81=_['map'](_0x481ced['SmsInteractions'],'id');return _0x481ced[_0x61ae('0x50')](_0x455c81)['then'](function(){for(var _0x2d3697=0x0;_0x2d3697<_0x455c81[_0x61ae('0x41')];_0x2d3697+=0x1){_0x2d3dd9['emit'](_0x61ae('0x51'),{'SmsInteractionId':Number(_0x455c81[_0x2d3697]),'UserId':Number(_0x481ced['id'])});}});}})['then'](function(){if(_0x5d9828==='leave'){var _0x4f6fd8=_[_0x61ae('0x18')](_0x481ced[_0x61ae('0x2b')],'id');return _0x481ced[_0x61ae('0x52')](_0x4f6fd8)[_0x61ae('0xb')](function(){for(var _0x59b5eb=0x0;_0x59b5eb<_0x4f6fd8[_0x61ae('0x41')];_0x59b5eb+=0x1){_0x2d3dd9['emit'](_0x61ae('0x53'),{'OpenchannelInteractionId':Number(_0x4f6fd8[_0x59b5eb]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0xb')](function(){if(_0x5d9828===_0x61ae('0x4a')){var _0x1f6231=_['map'](_0x481ced[_0x61ae('0x2d')],'id');return _0x481ced[_0x61ae('0x54')](_0x1f6231)['then'](function(){for(var _0xbfb517=0x0;_0xbfb517<_0x1f6231[_0x61ae('0x41')];_0xbfb517+=0x1){_0x2d3dd9[_0x61ae('0x4c')](_0x61ae('0x55'),{'WhatsappInteractionId':Number(_0x1f6231[_0xbfb517]),'UserId':Number(_0x481ced['id'])});}});}})[_0x61ae('0x56')](function(_0x57e756){_0xc69019[_0x61ae('0x57')](_0x57e756);});}}function onDisconnect(_0xe60fbe,_0x4839b2){joinOrLeave(_0xe60fbe,_0x61ae('0x4a'),_0x4839b2);}function onConnect(_0x5ca248){joinOrLeave(_0x5ca248,_0x61ae('0x58'));}exports[_0x61ae('0x59')]=function(_0x47e711){_0x47e711['on'](_0x61ae('0x5a'),function(_0x30a29c){_0x30a29c['setMaxListeners'](0x0);_0x30a29c[_0x61ae('0x5b')]=_0x30a29c[_0x61ae('0x5c')]['connection'][_0x61ae('0x5d')]+':'+_0x30a29c[_0x61ae('0x5c')][_0x61ae('0x5a')][_0x61ae('0x5e')];_0x30a29c[_0x61ae('0x5f')]=new Date();_0x30a29c[_0x61ae('0x57')]=function(_0x446b51){console[_0x61ae('0x57')](_0x61ae('0x60')+_0x30a29c[_0x61ae('0x61')][_0x61ae('0x5')]+'['+_0x30a29c[_0x61ae('0x5b')]+']',_0x446b51);};_0x30a29c['on'](_0x61ae('0x62'),function(){onDisconnect(_0x30a29c,_0x47e711);_0x30a29c[_0x61ae('0x57')](_0x61ae('0x63'));});onConnect(_0x30a29c);_0x30a29c['log']('CONNECTED');});}; \ No newline at end of file +var _0xffd6=['push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','SmsQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','sms','mail','openchannel','whatsapp','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','length','format','handshake','query','userProfileId','ChatInteractions','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xffd6,0x97));var _0x6ffd=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0xffd6[_0x31bab3];return _0x4fd382;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var BPromise=require(_0x6ffd('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x6ffd('0x3')],'include':[{'as':_0x6ffd('0x4'),'model':db[_0x6ffd('0x5')],'attributes':['id','name',_0x6ffd('0x6')],'raw':!![],'where':{'role':_0x6ffd('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6ffd('0x3')],'where':{'role':_0x6ffd('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x6ffd('0x3')],'where':{'role':_0x6ffd('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6ffd('0x3'),_0x6ffd('0x9')],'where':{'type':_0x6ffd('0xa')}};function getAssociatedResources(_0x4a9f85,_0x455dda,_0x417f34){return db['UserProfileSection'][_0x6ffd('0xb')]({'where':{'name':_0x4a9f85,'userProfileId':_0x455dda},'raw':!![]})[_0x6ffd('0xc')](function(_0x23f7f2){if(_0x23f7f2){if(_0x23f7f2[_0x6ffd('0xd')]){switch(_0x4a9f85){case _0x6ffd('0xe'):case _0x6ffd('0xf'):case _0x6ffd('0x10'):case'SmsQueues':case _0x6ffd('0x11'):case _0x6ffd('0x12'):case'WhatsappQueues':return db[_0x417f34][_0x6ffd('0x13')](queryQueues);case _0x6ffd('0x14'):return db[_0x417f34][_0x6ffd('0x13')](queryTelephones);case _0x6ffd('0x15'):return db[_0x417f34]['findAll'](queryTrunks);case _0x6ffd('0x16'):return db[_0x417f34]['findAll'](queryCampaigns);}}else{return db[_0x6ffd('0x17')]['findAll']({'attributes':[_0x6ffd('0x18')],'where':{'sectionId':_0x23f7f2['id']},'raw':!![]})[_0x6ffd('0xc')](function(_0x45db49){if(_0x45db49){var _0x5d8aff={'where':{'id':_[_0x6ffd('0x19')](_0x45db49,_0x6ffd('0x18'))},'raw':!![]};switch(_0x417f34){case _0x6ffd('0x5'):_0x5d8aff[_0x6ffd('0x1a')][_0x6ffd('0x6')]=_0x6ffd('0x8');break;case _0x6ffd('0x1b'):_0x5d8aff[_0x6ffd('0x1a')]['type']=_0x6ffd('0xa');break;}return db[_0x417f34]['findAll'](_0x5d8aff);}else{return[];}});}}else{return[];}})['then'](function(_0x2f5ec4){return _0x2f5ec4;});}function joinOrLeaveQueues(_0x359d09,_0x50aaa2,_0x34c3c1,_0x4612a3){_0x359d09[_0x50aaa2](util['format']('%s:queue:%s',_0x34c3c1,_0x4612a3[_0x6ffd('0x3')]));if(_0x4612a3[_0x6ffd('0x4')]){for(var _0x4dcc50=0x0;_0x4dcc50<_0x4612a3[_0x6ffd('0x4')][_0x6ffd('0x1c')];_0x4dcc50+=0x1){_0x359d09[_0x50aaa2](util[_0x6ffd('0x1d')]('user:%s',_0x4612a3[_0x6ffd('0x4')][_0x4dcc50][_0x6ffd('0x3')]));}}}function joinOrLeave(_0x50896b,_0x356c9c,_0x438d1a){var _0x50c19a;if(_0x50896b[_0x6ffd('0x1e')][_0x6ffd('0x1f')]['id']){db[_0x6ffd('0x5')]['find']({'attributes':['id',_0x6ffd('0x3'),_0x6ffd('0x6'),_0x6ffd('0x20')],'where':{'id':_0x50896b['handshake'][_0x6ffd('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x6ffd('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x6ffd('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x6ffd('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x6ffd('0x24')],'as':_0x6ffd('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6ffd('0x26')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x6ffd('0xc')](function(_0x20c007){if(_0x20c007){_0x50c19a=_0x20c007;_0x50896b[_0x356c9c](util['format'](_0x6ffd('0x27'),_0x20c007[_0x6ffd('0x3')]));var _0x442b2c=[];switch(_0x20c007[_0x6ffd('0x6')]){case _0x6ffd('0x28'):_0x50896b[_0x356c9c](_0x6ffd('0x29'));_0x50896b[_0x356c9c](_0x6ffd('0x2a'));if(queryQueues[_0x6ffd('0x2b')](_0x6ffd('0x2c'))){delete queryQueues[_0x6ffd('0x2c')];}_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x2e')][_0x6ffd('0x13')](queryQueues));_0x442b2c['push'](db['ChatQueue']['findAll'](queryQueues));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x2f')][_0x6ffd('0x13')](queryQueues));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x30')][_0x6ffd('0x13')](queryQueues));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x31')][_0x6ffd('0x13')](queryQueues));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x32')][_0x6ffd('0x13')](queryQueues));_0x442b2c[_0x6ffd('0x2d')](db['WhatsappQueue'][_0x6ffd('0x13')](queryQueues));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x5')][_0x6ffd('0x13')](queryTelephones));_0x442b2c['push'](db[_0x6ffd('0x33')]['findAll'](queryTrunks));_0x442b2c['push'](db[_0x6ffd('0x1b')][_0x6ffd('0x13')](queryCampaigns));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x5')]['findAll'](queryAgents));break;case _0x6ffd('0x34'):_0x50896b[_0x356c9c]('voice:inbound');_0x50896b[_0x356c9c](_0x6ffd('0x2a'));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources(_0x6ffd('0xe'),_0x20c007[_0x6ffd('0x20')],_0x6ffd('0x2e')));_0x442b2c['push'](getAssociatedResources('ChatQueues',_0x20c007[_0x6ffd('0x20')],'ChatQueue'));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources(_0x6ffd('0x10'),_0x20c007[_0x6ffd('0x20')],_0x6ffd('0x2f')));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources(_0x6ffd('0x35'),_0x20c007['userProfileId'],_0x6ffd('0x30')));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources(_0x6ffd('0x11'),_0x20c007[_0x6ffd('0x20')],'MailQueue'));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources('OpenchannelQueues',_0x20c007[_0x6ffd('0x20')],_0x6ffd('0x32')));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources('WhatsappQueues',_0x20c007[_0x6ffd('0x20')],_0x6ffd('0x36')));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources(_0x6ffd('0x14'),_0x20c007[_0x6ffd('0x20')],_0x6ffd('0x5')));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources('Trunks',_0x20c007['userProfileId'],'Trunk'));_0x442b2c[_0x6ffd('0x2d')](getAssociatedResources(_0x6ffd('0x16'),_0x20c007['userProfileId'],_0x6ffd('0x1b')));_0x442b2c[_0x6ffd('0x2d')](db[_0x6ffd('0x5')][_0x6ffd('0x13')](queryAgents));break;case'agent':_0x50896b[_0x356c9c](_0x6ffd('0x29'));_0x50896b[_0x356c9c](_0x6ffd('0x2a'));_0x442b2c[_0x6ffd('0x2d')](_0x20c007[_0x6ffd('0x37')]({'attributes':['id',_0x6ffd('0x3')]}));_0x442b2c[_0x6ffd('0x2d')](_0x20c007[_0x6ffd('0x38')]({'attributes':['id',_0x6ffd('0x3')]}));_0x442b2c[_0x6ffd('0x2d')](_0x20c007[_0x6ffd('0x39')]({'attributes':['id',_0x6ffd('0x3')]}));_0x442b2c['push'](_0x20c007['getSmsQueues']({'attributes':['id','name']}));_0x442b2c[_0x6ffd('0x2d')](_0x20c007[_0x6ffd('0x3a')]({'attributes':['id','name']}));_0x442b2c[_0x6ffd('0x2d')](_0x20c007[_0x6ffd('0x3b')]({'attributes':['id',_0x6ffd('0x3')]}));_0x442b2c[_0x6ffd('0x2d')](_0x20c007[_0x6ffd('0x3c')]({'attributes':['id','name']}));break;}return BPromise[_0x6ffd('0x3d')](_0x442b2c);}})[_0x6ffd('0xc')](function(_0x45f4aa){if(_0x45f4aa&&_0x45f4aa['length']){for(var _0x2bf7c3=0x0;_0x2bf7c3<_0x45f4aa[_0x6ffd('0x1c')];_0x2bf7c3+=0x1){for(var _0x2f8dfb=0x0;_0x2f8dfb<_0x45f4aa[_0x2bf7c3][_0x6ffd('0x1c')];_0x2f8dfb+=0x1){switch(_0x2bf7c3){case 0x0:joinOrLeaveQueues(_0x50896b,_0x356c9c,_0x6ffd('0x3e'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x1:joinOrLeaveQueues(_0x50896b,_0x356c9c,_0x6ffd('0x3f'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x2:joinOrLeaveQueues(_0x50896b,_0x356c9c,'fax',_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x3:joinOrLeaveQueues(_0x50896b,_0x356c9c,_0x6ffd('0x40'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x4:joinOrLeaveQueues(_0x50896b,_0x356c9c,_0x6ffd('0x41'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x5:joinOrLeaveQueues(_0x50896b,_0x356c9c,_0x6ffd('0x42'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x6:joinOrLeaveQueues(_0x50896b,_0x356c9c,_0x6ffd('0x43'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb]);break;case 0x7:if(_0x50c19a[_0x6ffd('0x6')]!==_0x6ffd('0x7'))_0x50896b[_0x356c9c](util[_0x6ffd('0x1d')]('telephone:%s',_0x45f4aa[_0x2bf7c3][_0x2f8dfb][_0x6ffd('0x3')]));break;case 0x8:if(_0x50c19a[_0x6ffd('0x6')]!=='agent')_0x50896b[_0x356c9c](util['format']('trunk:%s',_0x45f4aa[_0x2bf7c3][_0x2f8dfb][_0x6ffd('0x3')]));break;case 0x9:if(_0x50c19a['role']!==_0x6ffd('0x7'))_0x50896b[_0x356c9c](util[_0x6ffd('0x1d')](_0x6ffd('0x44'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb][_0x6ffd('0x9')],_0x45f4aa[_0x2bf7c3][_0x2f8dfb]['name']));break;case 0xa:_0x50896b[_0x356c9c](util[_0x6ffd('0x1d')](_0x6ffd('0x27'),_0x45f4aa[_0x2bf7c3][_0x2f8dfb][_0x6ffd('0x3')]));break;}}}}})['then'](function(){if(_0x356c9c===_0x6ffd('0x45')){var _0x16b6b5=_['map'](_0x50c19a['ChatInteractions'],'id');return _0x50c19a[_0x6ffd('0x46')](_0x16b6b5)[_0x6ffd('0xc')](function(){for(var _0x25d7e3=0x0;_0x25d7e3<_0x16b6b5[_0x6ffd('0x1c')];_0x25d7e3+=0x1){_0x438d1a[_0x6ffd('0x47')](_0x6ffd('0x48'),{'ChatInteractionId':Number(_0x16b6b5[_0x25d7e3]),'UserId':Number(_0x50c19a['id'])});}});}})[_0x6ffd('0xc')](function(){if(_0x356c9c==='leave'){var _0x1e5834=_[_0x6ffd('0x19')](_0x50c19a[_0x6ffd('0x49')],'id');return _0x50c19a['removeMailInteractions'](_0x1e5834)['then'](function(){for(var _0x41043f=0x0;_0x41043f<_0x1e5834[_0x6ffd('0x1c')];_0x41043f+=0x1){_0x438d1a[_0x6ffd('0x47')](_0x6ffd('0x4a'),{'MailInteractionId':Number(_0x1e5834[_0x41043f]),'UserId':Number(_0x50c19a['id'])});}});}})['then'](function(){if(_0x356c9c===_0x6ffd('0x45')){var _0x3fc72f=_[_0x6ffd('0x19')](_0x50c19a[_0x6ffd('0x23')],'id');return _0x50c19a[_0x6ffd('0x4b')](_0x3fc72f)[_0x6ffd('0xc')](function(){for(var _0x4ca29b=0x0;_0x4ca29b<_0x3fc72f[_0x6ffd('0x1c')];_0x4ca29b+=0x1){_0x438d1a[_0x6ffd('0x47')](_0x6ffd('0x4c'),{'FaxInteractionId':Number(_0x3fc72f[_0x4ca29b]),'UserId':Number(_0x50c19a['id'])});}});}})[_0x6ffd('0xc')](function(){if(_0x356c9c===_0x6ffd('0x45')){var _0x4b87fc=_[_0x6ffd('0x19')](_0x50c19a[_0x6ffd('0x25')],'id');return _0x50c19a[_0x6ffd('0x4d')](_0x4b87fc)[_0x6ffd('0xc')](function(){for(var _0x3f8ef3=0x0;_0x3f8ef3<_0x4b87fc['length'];_0x3f8ef3+=0x1){_0x438d1a[_0x6ffd('0x47')](_0x6ffd('0x4e'),{'SmsInteractionId':Number(_0x4b87fc[_0x3f8ef3]),'UserId':Number(_0x50c19a['id'])});}});}})[_0x6ffd('0xc')](function(){if(_0x356c9c==='leave'){var _0x3ba9c5=_[_0x6ffd('0x19')](_0x50c19a['OpenchannelInteractions'],'id');return _0x50c19a[_0x6ffd('0x4f')](_0x3ba9c5)['then'](function(){for(var _0x1c060a=0x0;_0x1c060a<_0x3ba9c5[_0x6ffd('0x1c')];_0x1c060a+=0x1){_0x438d1a['emit'](_0x6ffd('0x50'),{'OpenchannelInteractionId':Number(_0x3ba9c5[_0x1c060a]),'UserId':Number(_0x50c19a['id'])});}});}})['then'](function(){if(_0x356c9c===_0x6ffd('0x45')){var _0x186f1e=_[_0x6ffd('0x19')](_0x50c19a[_0x6ffd('0x51')],'id');return _0x50c19a[_0x6ffd('0x52')](_0x186f1e)['then'](function(){for(var _0x111a7d=0x0;_0x111a7d<_0x186f1e[_0x6ffd('0x1c')];_0x111a7d+=0x1){_0x438d1a[_0x6ffd('0x47')](_0x6ffd('0x53'),{'WhatsappInteractionId':Number(_0x186f1e[_0x111a7d]),'UserId':Number(_0x50c19a['id'])});}});}})['catch'](function(_0x38a627){_0x50896b[_0x6ffd('0x54')](_0x38a627);});}}function onDisconnect(_0x46f9bc,_0x4e1198){joinOrLeave(_0x46f9bc,_0x6ffd('0x45'),_0x4e1198);}function onConnect(_0x51cf91){joinOrLeave(_0x51cf91,_0x6ffd('0x55'));}exports['default']=function(_0x363959){_0x363959['on'](_0x6ffd('0x56'),function(_0xb618ef){_0xb618ef[_0x6ffd('0x57')](0x0);_0xb618ef['address']=_0xb618ef[_0x6ffd('0x58')][_0x6ffd('0x56')][_0x6ffd('0x59')]+':'+_0xb618ef[_0x6ffd('0x58')][_0x6ffd('0x56')][_0x6ffd('0x5a')];_0xb618ef[_0x6ffd('0x5b')]=new Date();_0xb618ef[_0x6ffd('0x54')]=function(_0x3c9f20){console[_0x6ffd('0x54')](_0x6ffd('0x5c')+_0xb618ef[_0x6ffd('0x5d')][_0x6ffd('0x3')]+'['+_0xb618ef[_0x6ffd('0x5e')]+']',_0x3c9f20);};_0xb618ef['on'](_0x6ffd('0x5f'),function(){onDisconnect(_0xb618ef,_0x363959);_0xb618ef[_0x6ffd('0x54')](_0x6ffd('0x60'));});onConnect(_0xb618ef);_0xb618ef[_0x6ffd('0x54')](_0x6ffd('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7f63c7f..428061b 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 _0xe9e2=['../logger','triggers','client','http','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatMessage','Sms','SmsInteraction','SmsMessage','afterCreate','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','Trigger,\x20%s','error','code','EventManager','catch','get','event','then','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','motionChannel','opened','resolve','sequelize','QueryTypes','closed','substatus','User','find','email','internal','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise'];(function(_0x16e838,_0xe03080){var _0x5e8e66=function(_0xbd5232){while(--_0xbd5232){_0x16e838['push'](_0x16e838['shift']());}};_0x5e8e66(++_0xe03080);}(_0xe9e2,0x121));var _0x2e9e=function(_0x201efd,_0x561cd2){_0x201efd=_0x201efd-0x0;var _0x328cdb=_0xe9e2[_0x201efd];return _0x328cdb;};'use strict';var util=require(_0x2e9e('0x0'));var db=require(_0x2e9e('0x1'))['db'];var jayson=require(_0x2e9e('0x2'));var logger=require(_0x2e9e('0x3'))(_0x2e9e('0x4'));var client=jayson[_0x2e9e('0x5')][_0x2e9e('0x6')]({'port':0x232a});var triggers=[{'channel':_0x2e9e('0x7'),'model':_0x2e9e('0x8'),'event':'afterCreate','condition':_0x2e9e('0x9'),'callback':afterCreate},{'channel':_0x2e9e('0x7'),'model':_0x2e9e('0x8'),'event':_0x2e9e('0xa'),'condition':_0x2e9e('0xb'),'callback':afterUpdate},{'channel':_0x2e9e('0x7'),'model':_0x2e9e('0xc'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':'afterCreate','condition':_0x2e9e('0x9'),'callback':afterCreate},{'channel':_0x2e9e('0xd'),'model':_0x2e9e('0xe'),'event':'afterUpdate','condition':_0x2e9e('0xb'),'callback':afterUpdate},{'channel':'Sms','model':_0x2e9e('0xf'),'event':_0x2e9e('0x10'),'condition':_0x2e9e('0x11'),'callback':afterCreateMessage},{'channel':_0x2e9e('0x12'),'model':_0x2e9e('0x13'),'event':_0x2e9e('0x10'),'condition':_0x2e9e('0x9'),'callback':afterCreate},{'channel':_0x2e9e('0x12'),'model':'WhatsappInteraction','event':_0x2e9e('0xa'),'condition':_0x2e9e('0xb'),'callback':afterUpdate},{'channel':_0x2e9e('0x12'),'model':_0x2e9e('0x14'),'event':_0x2e9e('0x10'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x2e9e('0x15'),'model':'FaxInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x2e9e('0x16'),'event':_0x2e9e('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x2e9e('0x15'),'model':_0x2e9e('0x17'),'event':_0x2e9e('0x10'),'condition':_0x2e9e('0x11'),'callback':afterCreateMessage},{'channel':_0x2e9e('0x18'),'model':'MailInteraction','event':'afterCreate','condition':_0x2e9e('0x9'),'callback':afterCreate},{'channel':_0x2e9e('0x18'),'model':_0x2e9e('0x19'),'event':_0x2e9e('0xa'),'condition':_0x2e9e('0xb'),'callback':afterUpdate},{'channel':'Mail','model':_0x2e9e('0x1a'),'event':_0x2e9e('0x10'),'condition':_0x2e9e('0x11'),'callback':afterCreateMessage},{'channel':_0x2e9e('0x1b'),'model':'OpenchannelInteraction','event':_0x2e9e('0x10'),'condition':_0x2e9e('0x9'),'callback':afterCreate},{'channel':_0x2e9e('0x1b'),'model':_0x2e9e('0x1c'),'event':_0x2e9e('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x2e9e('0x1d'),'event':_0x2e9e('0x10'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x165b1e){return client[_0x2e9e('0x1e')]('EventManager',_0x165b1e)['then'](function(_0x394513){logger['info'](_0x2e9e('0x1f'),'EventManager',_0x394513);if(_0x394513[_0x2e9e('0x20')]){if(_0x394513[_0x2e9e('0x20')][_0x2e9e('0x21')]===0x1f4){logger[_0x2e9e('0x20')]('Trigger,\x20%s',_0x2e9e('0x22'),_0x394513['error']);}}})[_0x2e9e('0x23')](function(_0x3b7bf7){logger[_0x2e9e('0x20')](_0x2e9e('0x1f'),_0x2e9e('0x22'),_0x3b7bf7);});}function afterCreateMessage(_0x5d03b5){return function(_0x105a49){_0x105a49=_0x105a49[_0x2e9e('0x24')]({'plain':!![]});_0x105a49['channel']=_0x5d03b5;_0x105a49['motionChannel']=_0x5d03b5;_0x105a49[_0x2e9e('0x25')]=_0x105a49['direction'];Promise['resolve']()[_0x2e9e('0x26')](function(){if(typeof _0x105a49['ContactId']===_0x2e9e('0x27'))return null;var _0x2b2392=_0x2e9e('0x28')+_0x105a49[_0x2e9e('0x29')];return db['sequelize'][_0x2e9e('0x2a')](_0x2b2392,{'type':db[_0x2e9e('0x2b')]['QueryTypes'][_0x2e9e('0x2c')],'raw':!![]});})['then'](function(_0x2b53ed){if(_0x2b53ed){_0x105a49[_0x2e9e('0x2d')]=_0x2b53ed[0x0];}if(typeof _0x105a49[_0x2e9e('0x2e')]==='undefined')return;return getAgent(_0x105a49[_0x2e9e('0x2e')]);})['then'](function(_0x342f81){if(_0x342f81){_0x105a49[_0x2e9e('0x2f')]=util[_0x2e9e('0x30')](_0x2e9e('0x31'),_0x342f81[_0x2e9e('0x32')]);_0x105a49[_0x2e9e('0x33')]=_0x342f81;_0x105a49[_0x2e9e('0x34')]=_0x5d03b5;return request({'event':_0x2e9e('0x35'),'message':_0x105a49});}else{return request({'event':_0x2e9e('0x36'),'message':_0x105a49});}})[_0x2e9e('0x23')](function(_0x401f42){logger[_0x2e9e('0x20')](_0x2e9e('0x1f'),_0x2e9e('0x37'),_0x401f42);});};}function afterCreate(_0x368154,_0x1c75f1){return function(_0x4c060c){_0x4c060c=_0x4c060c[_0x2e9e('0x24')]({'plain':!![]});_0x4c060c[_0x2e9e('0x34')]=_0x368154;_0x4c060c[_0x2e9e('0x38')]=_0x368154;_0x4c060c['event']=_0x2e9e('0x39');Promise[_0x2e9e('0x3a')]()['then'](function(){var _0x43bf59=_0x2e9e('0x28')+_0x4c060c[_0x2e9e('0x29')];return db[_0x2e9e('0x3b')][_0x2e9e('0x2a')](_0x43bf59,{'type':db['Sequelize'][_0x2e9e('0x3c')][_0x2e9e('0x2c')],'raw':!![]});})[_0x2e9e('0x26')](function(_0x50c162){if(_0x50c162){_0x4c060c[_0x2e9e('0x2d')]=_0x50c162[0x0];}if(typeof _0x4c060c[_0x2e9e('0x2e')]===_0x2e9e('0x27'))return;return getAgent(_0x4c060c[_0x2e9e('0x2e')]);})[_0x2e9e('0x26')](function(_0x1f5853){if(_0x1f5853){_0x4c060c[_0x2e9e('0x2f')]=util['format'](_0x2e9e('0x31'),_0x1f5853[_0x2e9e('0x32')]);_0x4c060c[_0x2e9e('0x33')]=_0x1f5853;}return request({'event':_0x1c75f1,'message':_0x4c060c});})[_0x2e9e('0x23')](function(_0x1792e6){logger[_0x2e9e('0x20')](_0x2e9e('0x1f'),'AfterCreate',_0x1792e6);});};}function afterUpdate(_0x511b61){return function(_0x17a457){var _0x14f06b=_0x17a457['changed']('closed')&&_0x17a457[_0x2e9e('0x3d')];var _0x204fa9=_0x17a457['changed'](_0x2e9e('0x3e'));if(_0x14f06b||_0x204fa9){var _0x700a70=_0x14f06b?_0x2e9e('0xb'):_0x2e9e('0x3e');var _0xd19b7d=_0x17a457[_0x2e9e('0x24')]({'plain':!![]});_0xd19b7d[_0x2e9e('0x34')]=_0x511b61;_0xd19b7d[_0x2e9e('0x38')]=_0x511b61;_0xd19b7d['event']=_0x14f06b?_0x2e9e('0x3d'):_0x2e9e('0x3e');var _0x336f47=_0x2e9e('0x28')+_0xd19b7d[_0x2e9e('0x29')];return db[_0x2e9e('0x3b')][_0x2e9e('0x2a')](_0x336f47,{'type':db['Sequelize'][_0x2e9e('0x3c')][_0x2e9e('0x2c')],'raw':!![]})['then'](function(_0x59cd12){if(_0x59cd12){_0xd19b7d[_0x2e9e('0x2d')]=_0x59cd12[0x0];}if(typeof _0xd19b7d[_0x2e9e('0x2e')]==='undefined')return;return getAgent(_0xd19b7d[_0x2e9e('0x2e')]);})[_0x2e9e('0x26')](function(_0x45655b){if(_0x45655b){_0xd19b7d['interface']=util['format']('SIP/%s',_0x45655b[_0x2e9e('0x32')]);_0xd19b7d[_0x2e9e('0x33')]=_0x45655b;}return request({'event':_0x700a70,'message':_0xd19b7d});})['catch'](function(_0x5f4dc3){logger[_0x2e9e('0x20')](_0x2e9e('0x1f'),'AfterUpdate',_0x5f4dc3);});}};}function getAgent(_0x43b002){return db[_0x2e9e('0x3f')][_0x2e9e('0x40')]({'where':{'id':_0x43b002},'attributes':['id','name','fullname',_0x2e9e('0x41'),_0x2e9e('0x42')],'raw':!![]})[_0x2e9e('0x26')](function(_0x848509){return _0x848509;});}exports['default']=function(){for(var _0x162dd7=0x0;_0x162dd7=_0x1b3c59[_0x073e('0xf')]){throw Error(_0x073e('0x10'));}_0x252596(_0xef6bfc);})[_0x073e('0x11')](function(_0x31398c){_0x31df53(_0x31398c);});});}; \ No newline at end of file +var _0x6400=['getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','../mysqldb','./license/util','voice','mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','includes','isUndefined','updateAttributes'];(function(_0x270b8f,_0x5baa15){var _0x58a0bd=function(_0x3e7187){while(--_0x3e7187){_0x270b8f['push'](_0x270b8f['shift']());}};_0x58a0bd(++_0x5baa15);}(_0x6400,0x71));var _0x0640=function(_0x50deff,_0x45d116){_0x50deff=_0x50deff-0x0;var _0x215a03=_0x6400[_0x50deff];return _0x215a03;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x0640('0x0'))['db'];var util=require(_0x0640('0x1'));var channels=[_0x0640('0x2'),_0x0640('0x3'),_0x0640('0x4'),'fax',_0x0640('0x5'),_0x0640('0x6'),_0x0640('0x7')];exports[_0x0640('0x8')]=function(){return channels;};exports[_0x0640('0x9')]=function(_0x3cfcca){_0x3cfcca=_0x3cfcca['toLowerCase']();return _[_0x0640('0xa')](channels,_0x3cfcca);};exports['clearBlockUser']=function(_0x45300e,_0x36d499,_0x4e5fd7,_0x5226cc){var _0x3c3621={'loginAttempts':_0x36d499,'blocked':_0x4e5fd7};if(!_[_0x0640('0xb')](_0x5226cc)){_0x3c3621['blockedAt']=_0x5226cc;}return _0x45300e[_0x0640('0xc')](_0x3c3621);};exports[_0x0640('0xd')]=function(_0xe8bfef){return new BPromise(function(_0x50b67a,_0x4f0503){var _0x5e5039=0x0;if(_0xe8bfef[_0x0640('0xe')]!==_0x0640('0xf')){_0x50b67a(_0xe8bfef);}db['User'][_0x0640('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xe8bfef['id']}}})['then'](function(_0x14b52c){_0x5e5039=_0x14b52c;return util[_0x0640('0xd')]();})[_0x0640('0x11')](function(_0xf52bd4){if(_0xf52bd4&&_0xf52bd4[_0x0640('0x12')]&&_0x5e5039>=_0xf52bd4[_0x0640('0x12')]){throw Error(_0x0640('0x13'));}_0x50b67a(_0xe8bfef);})[_0x0640('0x14')](function(_0x5a295b){_0x4f0503(_0x5a295b);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 827a95a..926df2b 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc674=['exports','404','status','send'];(function(_0x5bf137,_0x1f668c){var _0x21c280=function(_0x571bf5){while(--_0x571bf5){_0x5bf137['push'](_0x5bf137['shift']());}};_0x21c280(++_0x1f668c);}(_0xc674,0xe8));var _0x4c67=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xc674[_0x15876a];return _0xbd900f;};'use strict';module[_0x4c67('0x0')][0x194]=function pageNotFound(_0x1fab8a,_0x453974){var _0x41fbbc=_0x4c67('0x1');var _0x14c74e=0x194;var _0x3b5468={'status':_0x14c74e};_0x453974['status'](_0x3b5468[_0x4c67('0x2')]);_0x453974['render'](_0x41fbbc,{},function(_0xf5a775,_0x179fcd){if(_0xf5a775){return _0x453974[_0x4c67('0x2')](_0x3b5468['status'])['json'](_0x3b5468);}_0x453974[_0x4c67('0x3')](_0x179fcd);});}; \ No newline at end of file +var _0x90a8=['exports','404','status','render','send'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x90a8,0x14a));var _0x890a=function(_0x451aec,_0x56fea4){_0x451aec=_0x451aec-0x0;var _0x5ce4f3=_0x90a8[_0x451aec];return _0x5ce4f3;};'use strict';module[_0x890a('0x0')][0x194]=function pageNotFound(_0x18cdf1,_0x5ef106){var _0x42438f=_0x890a('0x1');var _0x253ad2=0x194;var _0x9c25c8={'status':_0x253ad2};_0x5ef106[_0x890a('0x2')](_0x9c25c8[_0x890a('0x2')]);_0x5ef106[_0x890a('0x3')](_0x42438f,{},function(_0x3c2902,_0x455c74){if(_0x3c2902){return _0x5ef106[_0x890a('0x2')](_0x9c25c8[_0x890a('0x2')])['json'](_0x9c25c8);}_0x5ef106[_0x890a('0x4')](_0x455c74);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a186c8d..8963460 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62da=['SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','VoiceContext','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','restrict','Smtp','Dispositions','Interactions','MailApplication','List','ListId','team_has_mail_queues','Account','ContactId','Owner','Tags','mail_interaction_has_tags','ThroughTags','MailInteractionId','Interaction','ChatOfflineMessageId','Tag','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','fax_interaction_has_tags','Users','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','ChatGroupId','Members','SmsInteractions','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','AnalyticFieldReport','Fields','AnalyticDefaultReport','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','Variable','VariableId','Configurations','SugarcrmConfiguration','DeskAccount','DescriptionId','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','FaxQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromAgent','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','../config/environment','lodash','jstz','determine','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','database','username','password','options','User','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','SmsAccount','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.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','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','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','hasOne','UserId','hasMany','VoiceRecording','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteraction','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','chat_group_has_users','CmContact','Contacts','belongsToMany','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefix','MailQueues','ChatQueues','UserChatQueue'];(function(_0x5d47f0,_0xcded86){var _0x257793=function(_0x3f1069){while(--_0x3f1069){_0x5d47f0['push'](_0x5d47f0['shift']());}};_0x257793(++_0xcded86);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var config=require(_0xa62d('0x0'));var Sequelize=require('sequelize');var _=require(_0xa62d('0x1'));var jstz=require(_0xa62d('0x2'));var timezone=jstz[_0xa62d('0x3')]();config[_0xa62d('0x4')]=_['defaultsDeep'](config[_0xa62d('0x4')],{'database':_0xa62d('0x5'),'username':_0xa62d('0x6'),'password':_0xa62d('0x7'),'options':{'host':_0xa62d('0x8'),'port':0xcea,'dialect':_0xa62d('0x9'),'dialectOptions':{'charset':_0xa62d('0xa')},'logging':![],'timezone':timezone[_0xa62d('0xb')](),'define':{'charset':_0xa62d('0xc'),'collate':_0xa62d('0xd')}}});config[_0xa62d('0xe')]=_[_0xa62d('0xf')](config['sequelizeHistory'],{'database':_0xa62d('0x5'),'username':_0xa62d('0x6'),'password':'xC@LL1234','options':{'host':_0xa62d('0x8'),'port':0xcea,'dialect':_0xa62d('0x9'),'dialectOptions':{'charset':_0xa62d('0xa')},'logging':![],'timezone':timezone[_0xa62d('0xb')](),'define':{'charset':_0xa62d('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa62d('0x4')][_0xa62d('0x10')],config[_0xa62d('0x4')][_0xa62d('0x11')],config[_0xa62d('0x4')][_0xa62d('0x12')],config[_0xa62d('0x4')][_0xa62d('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa62d('0xe')]['database'],config[_0xa62d('0xe')][_0xa62d('0x11')],config[_0xa62d('0xe')]['password'],config[_0xa62d('0xe')][_0xa62d('0x13')])};db[_0xa62d('0x14')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/user/user.model');db[_0xa62d('0x16')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x17'));db[_0xa62d('0x18')]=db[_0xa62d('0x4')]['import']('../api/voiceExtension/voiceExtension.model');db[_0xa62d('0x19')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x1a'));db['VoiceQueue']=db[_0xa62d('0x4')]['import'](_0xa62d('0x1b'));db['VoiceRecording']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x1c'));db['ScreenRecording']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x1d'));db[_0xa62d('0x1e')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xa62d('0x4')]['import'](_0xa62d('0x1f'));db[_0xa62d('0x20')]=db['sequelize']['import'](_0xa62d('0x21'));db['VoiceDialReport']=db[_0xa62d('0x4')]['import'](_0xa62d('0x22'));db['VoiceAgentReport']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa62d('0x23')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x24'));db[_0xa62d('0x25')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x26'));db[_0xa62d('0x27')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0xa62d('0x4')]['import'](_0xa62d('0x28'));db['UserVoiceQueueRt']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xa62d('0x29')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x2a'));db['UserChatQueue']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x2b'));db[_0xa62d('0x2c')]=db[_0xa62d('0x4')]['import']('../api/userMailQueue/userMailQueue.model');db[_0xa62d('0x2d')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x2e'));db[_0xa62d('0x2f')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/userSmsQueue/userSmsQueue.model');db[_0xa62d('0x30')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x31'));db[_0xa62d('0x32')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x33'));db[_0xa62d('0x34')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x35'));db[_0xa62d('0x36')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x37'));db[_0xa62d('0x38')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailAccount/mailAccount.model');db[_0xa62d('0x39')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x3a'));db[_0xa62d('0x3b')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailSubstatus/mailSubstatus.model');db[_0xa62d('0x3c')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xa62d('0x3d')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x3e'));db['MailApplication']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/mailQueueReport/mailQueueReport.model');db[_0xa62d('0x3f')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x40'));db[_0xa62d('0x41')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x42'));db[_0xa62d('0x43')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/faxAccount/faxAccount.model');db[_0xa62d('0x44')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x45'));db[_0xa62d('0x46')]=db['sequelize']['import'](_0xa62d('0x47'));db[_0xa62d('0x48')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/faxMessage/faxMessage.model');db[_0xa62d('0x49')]=db[_0xa62d('0x4')]['import']('../api/faxQueue/faxQueue.model');db[_0xa62d('0x4a')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/faxQueueReport/faxQueueReport.model');db[_0xa62d('0x4b')]=db[_0xa62d('0x4')]['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x4c'));db[_0xa62d('0x4d')]=db['sequelize']['import'](_0xa62d('0x4e'));db[_0xa62d('0x4f')]=db['sequelize']['import'](_0xa62d('0x50'));db[_0xa62d('0x51')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x52'));db[_0xa62d('0x53')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x54'));db['OpenchannelInteraction']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x55'));db[_0xa62d('0x56')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0xa62d('0x57')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xa62d('0x58')]=db['sequelize'][_0xa62d('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0xa62d('0x59')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x5a'));db[_0xa62d('0x5b')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x5c'));db[_0xa62d('0x5d')]=db['sequelize'][_0xa62d('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xa62d('0x5e')]=db['sequelize'][_0xa62d('0x15')]('../api/chatQueue/chatQueue.model');db[_0xa62d('0x5f')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x60'));db[_0xa62d('0x61')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x62'));db[_0xa62d('0x63')]=db['sequelize'][_0xa62d('0x15')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x64'));db[_0xa62d('0x65')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x66'));db[_0xa62d('0x67')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x68'));db[_0xa62d('0x69')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x6a'));db[_0xa62d('0x6b')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x6c'));db[_0xa62d('0x6d')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xa62d('0x6e')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x6f'));db[_0xa62d('0x70')]=db['sequelize'][_0xa62d('0x15')]('../api/action/action.model');db[_0xa62d('0x71')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x72'));db[_0xa62d('0x73')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x74'));db[_0xa62d('0x75')]=db['sequelize']['import'](_0xa62d('0x76'));db[_0xa62d('0x77')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x78'));db[_0xa62d('0x79')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x7a'));db[_0xa62d('0x7b')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/pause/pause.model');db['Cdr']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x7c'));db[_0xa62d('0x7d')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x7e'));db[_0xa62d('0x7f')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x80'));db[_0xa62d('0x81')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x82'));db['Tag']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x83'));db[_0xa62d('0x84')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x85'));db[_0xa62d('0x86')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x87'));db['Variable']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x88'));db[_0xa62d('0x89')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8a'));db[_0xa62d('0x8b')]=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8c'));db[_0xa62d('0x8d')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8e'));db[_0xa62d('0x8f')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x90'));db['AnalyticFieldReport']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x91'));db[_0xa62d('0x92')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x93'));db[_0xa62d('0x94')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x95'));db[_0xa62d('0x96')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x97'));db[_0xa62d('0x98')]=db[_0xa62d('0x4')]['import'](_0xa62d('0x99'));db[_0xa62d('0x9a')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x9b'));db['SugarcrmConfiguration']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xa62d('0x9c')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x9d'));db['DeskAccount']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x9e'));db[_0xa62d('0x9f')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xa0'));db[_0xa62d('0xa1')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xa2'));db[_0xa62d('0xa3')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xa4'));db[_0xa62d('0xa5')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xa6'));db[_0xa62d('0xa7')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intZohoField/intZohoField.model');db[_0xa62d('0xa8')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xa9'));db['ZendeskConfiguration']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa62d('0xaa')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xab'));db[_0xa62d('0xac')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xad'));db[_0xa62d('0xae')]=db['sequelize'][_0xa62d('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xa62d('0xaf')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa62d('0xb0')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb1'));db[_0xa62d('0xb2')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb3'));db['VtigerField']=db['sequelize'][_0xa62d('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xa62d('0xb4')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb5'));db[_0xa62d('0xb6')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xb7'));db[_0xa62d('0xb8')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xb9'));db[_0xa62d('0xba')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xbb'));db['Dynamics365Configuration']=db[_0xa62d('0x4')]['import'](_0xa62d('0xbc'));db[_0xa62d('0xbd')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xbe'));db[_0xa62d('0xbf')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xc0'));db[_0xa62d('0xc1')]=db['sequelize']['import'](_0xa62d('0xc2'));db[_0xa62d('0xc3')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xc4'));db[_0xa62d('0x89')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x8a'));db['Network']=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/network/network.model');db[_0xa62d('0xc5')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xc6'));db[_0xa62d('0xc7')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xc8'));db[_0xa62d('0xc9')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xca'));db[_0xa62d('0xcb')]=db[_0xa62d('0x4')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xa62d('0xcc')]=db['sequelize']['import'](_0xa62d('0xcd'));db[_0xa62d('0xce')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xcf'));db[_0xa62d('0xd0')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/squareReport/squareReport.model');db[_0xa62d('0xd1')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xd2'));db[_0xa62d('0xd3')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xd4'));db[_0xa62d('0xd5')]=db['sequelize'][_0xa62d('0x15')]('../api/setting/setting.model');db[_0xa62d('0xd6')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xd7'));db['SquareProject']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xd8'));db[_0xa62d('0xd9')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xda'));db[_0xa62d('0xdb')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xdc'));db[_0xa62d('0xdd')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xde'));db[_0xa62d('0xdf')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xe0'));db[_0xa62d('0xe1')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/migration/migration.model');db[_0xa62d('0xe2')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xe3'));db[_0xa62d('0xe4')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xe5'));db[_0xa62d('0xe6')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xe7'));db[_0xa62d('0xe8')]=db['sequelize'][_0xa62d('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xa62d('0xe9')]=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xa62d('0xea')]=db['sequelize'][_0xa62d('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xeb'));db[_0xa62d('0xec')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xed'));db['VoicePrefix']=db['sequelize'][_0xa62d('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0xa62d('0xee')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xef'));db[_0xa62d('0xf0')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xf1'));db[_0xa62d('0xf2')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xf3'));db[_0xa62d('0xf4')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xf5'));db[_0xa62d('0xf6')]=db[_0xa62d('0x4')]['import'](_0xa62d('0xf7'));db[_0xa62d('0xf8')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa62d('0xf9')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xfa'));db[_0xa62d('0xfb')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0xfc'));db[_0xa62d('0xfd')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0xfe'));db[_0xa62d('0xff')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x100'));db[_0xa62d('0x101')]=db[_0xa62d('0x4')][_0xa62d('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0xa62d('0x102')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x103'));db[_0xa62d('0x104')]=db['sequelize'][_0xa62d('0x15')](_0xa62d('0x105'));db[_0xa62d('0x106')]=db[_0xa62d('0x4')][_0xa62d('0x15')](_0xa62d('0x107'));db['UserVoicePrefix']=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0xa62d('0x14')][_0xa62d('0x108')](db[_0xa62d('0x1e')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x10b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x10c')],{'as':_0xa62d('0x10d'),'foreignKey':'UserId'});db[_0xa62d('0x14')]['hasMany'](db[_0xa62d('0x18')],{'as':_0xa62d('0x10e'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db[_0xa62d('0x14')]['hasMany'](db[_0xa62d('0x69')],{'as':'HopperFinals','foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x6b')],{'as':_0xa62d('0x110'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')]['hasMany'](db[_0xa62d('0x6d')],{'as':_0xa62d('0x6d'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x111')],{'as':'OpenchannelInteractions','foreignKey':_0xa62d('0x109')});db['User'][_0xa62d('0x10a')](db[_0xa62d('0x112')],{'as':_0xa62d('0x113'),'foreignKey':_0xa62d('0x109')});db['User'][_0xa62d('0x10a')](db[_0xa62d('0x114')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0x46')],{'as':_0xa62d('0x115'),'foreignKey':_0xa62d('0x109')});db['User'][_0xa62d('0x10a')](db[_0xa62d('0x3c')],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0xa62d('0x10a')](db[_0xa62d('0xf9')],{'as':_0xa62d('0x116'),'foreignKey':'UserId'});db[_0xa62d('0x14')][_0xa62d('0x10a')](db[_0xa62d('0xf4')],{'as':_0xa62d('0x117'),'foreignKey':_0xa62d('0x118')});db['User'][_0xa62d('0x119')](db[_0xa62d('0xee')],{'as':_0xa62d('0xee'),'foreignKey':_0xa62d('0x11a')});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x5f')],{'as':'Groups','through':_0xa62d('0x11b')});db['User']['belongsToMany'](db[_0xa62d('0x11c')],{'as':_0xa62d('0x11d'),'through':'cm_user_has_contacts'});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0xec')],{'as':_0xa62d('0x11f'),'through':_0xa62d('0x120')});db['User']['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x122')});db['User'][_0xa62d('0x11e')](db['MailInteraction'],{'as':_0xa62d('0x123'),'through':'user_has_mail_interactions'});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x112')],{'as':'ChatInteractions','through':_0xa62d('0x124')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0x46')],{'as':_0xa62d('0x115'),'through':_0xa62d('0x125')});db[_0xa62d('0x14')]['belongsToMany'](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xa62d('0x126')});db['User'][_0xa62d('0x11e')](db['OpenchannelInteraction'],{'as':_0xa62d('0x127'),'through':'user_has_openchannel_interactions'});db['User'][_0xa62d('0x11e')](db[_0xa62d('0xf9')],{'as':_0xa62d('0x116'),'through':_0xa62d('0x128')});db['User']['belongsToMany'](db[_0xa62d('0x129')],{'as':_0xa62d('0x12a'),'through':'UserVoiceQueue','required':![]});db['User'][_0xa62d('0x11e')](db[_0xa62d('0x12b')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db['User']['belongsToMany'](db[_0xa62d('0x39')],{'as':_0xa62d('0x12c'),'through':_0xa62d('0x2c'),'required':![]});db[_0xa62d('0x14')]['belongsToMany'](db['ChatQueue'],{'as':_0xa62d('0x12d'),'through':_0xa62d('0x12e'),'required':![],'hooks':!![]});db[_0xa62d('0x14')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0xa62d('0x2d'),'required':![]});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x4f')],{'as':_0xa62d('0x12f'),'through':'UserSmsQueue','required':![]});db[_0xa62d('0x14')][_0xa62d('0x11e')](db['OpenchannelQueue'],{'as':_0xa62d('0x130'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xa62d('0x11e')](db['WhatsappQueue'],{'as':_0xa62d('0x131'),'through':'UserWhatsappQueue','required':![]});db['User'][_0xa62d('0x11e')](db[_0xa62d('0xec')],{'through':'cm_user_has_lists'});db[_0xa62d('0x14')]['belongsToMany'](db['ChatWebsite'],{'as':_0xa62d('0x132'),'through':_0xa62d('0x133')});db['User'][_0xa62d('0x11e')](db[_0xa62d('0x43')],{'as':_0xa62d('0x134'),'through':_0xa62d('0x135')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db['MailAccount'],{'as':_0xa62d('0x136'),'through':_0xa62d('0x137')});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0x51')],{'as':_0xa62d('0x138'),'through':_0xa62d('0x139')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0x4b')],{'as':_0xa62d('0x13a'),'through':_0xa62d('0x13b')});db[_0xa62d('0x14')]['belongsToMany'](db[_0xa62d('0xf6')],{'as':_0xa62d('0x13c'),'through':_0xa62d('0x13d')});db[_0xa62d('0x14')][_0xa62d('0x11e')](db[_0xa62d('0x13e')],{'as':_0xa62d('0x13f'),'through':_0xa62d('0x140')});db[_0xa62d('0x16')][_0xa62d('0x10a')](db[_0xa62d('0x18')],{'as':_0xa62d('0x141'),'onDelete':_0xa62d('0x10f'),'foreignKey':'ChanSpyId'});db[_0xa62d('0x142')]['hasMany'](db[_0xa62d('0x18')],{'onDelete':'cascade'});db[_0xa62d('0x18')][_0xa62d('0x10a')](db[_0xa62d('0x18')],{'as':_0xa62d('0x143'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x19')][_0xa62d('0x11e')](db['Sound'],{'as':_0xa62d('0x144'),'through':_0xa62d('0x145')});db[_0xa62d('0x129')][_0xa62d('0x10a')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xa62d('0x146')});db['VoiceQueue'][_0xa62d('0x10a')](db[_0xa62d('0x65')],{'as':_0xa62d('0x147'),'foreignKey':_0xa62d('0x146')});db['VoiceQueue'][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':_0xa62d('0x148'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xa62d('0x10a')](db['CmHopperHistory'],{'as':_0xa62d('0x149'),'foreignKey':_0xa62d('0x146')});db[_0xa62d('0x129')][_0xa62d('0x10a')](db['ReportAgentPreview'],{'as':_0xa62d('0x6d'),'foreignKey':'VoiceQueueId'});db[_0xa62d('0x129')][_0xa62d('0x10a')](db['CmHopperBlack'],{'as':_0xa62d('0x14a'),'foreignKey':_0xa62d('0x146')});db['VoiceQueue'][_0xa62d('0x10a')](db['JscriptySessionReport'],{'as':_0xa62d('0x14b'),'foreignKey':_0xa62d('0x146')});db[_0xa62d('0x129')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x27'),'foreignKey':_0xa62d('0x14c')});db[_0xa62d('0x129')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x14d'),'foreignKey':_0xa62d('0x14e')});db['VoiceQueue'][_0xa62d('0x119')](db[_0xa62d('0x79')],{'as':'Interval','foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x129')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db[_0xa62d('0x129')][_0xa62d('0x11e')](db[_0xa62d('0xec')],{'as':_0xa62d('0x11f'),'through':_0xa62d('0x152')});db['VoiceQueue'][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':'UserVoiceQueue'});db[_0xa62d('0x129')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'as':_0xa62d('0x154'),'through':_0xa62d('0x104')});db[_0xa62d('0x129')]['belongsToMany'](db['CmList'],{'as':_0xa62d('0x155'),'through':_0xa62d('0x156')});db[_0xa62d('0x10b')][_0xa62d('0x119')](db['User'],{'as':_0xa62d('0x14'),'foreignKey':'UserId'});db[_0xa62d('0x157')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x14'),'foreignKey':'UserId'});db['VoiceMail']['hasMany'](db['VoiceMailMessage'],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x159'),'sourceKey':'mailbox'});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xa62d('0x15a')});db[_0xa62d('0x20')][_0xa62d('0x10a')](db['VoiceQueueReport'],{'as':_0xa62d('0x15b'),'foreignKey':_0xa62d('0x15c'),'constraints':![]});db[_0xa62d('0x20')]['hasMany'](db['VoiceAgentReport'],{'as':_0xa62d('0x15d'),'foreignKey':_0xa62d('0x15c'),'constraints':![]});db[_0xa62d('0x20')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':'User','foreignKey':_0xa62d('0x109')});db[_0xa62d('0x20')]['belongsTo'](db['CmContact'],{'as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db[_0xa62d('0x34')][_0xa62d('0x119')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xa62d('0x15f')});db[_0xa62d('0x34')][_0xa62d('0x119')](db[_0xa62d('0x102')],{'as':_0xa62d('0x102'),'foreignKey':'CloudProviderId','onDelete':_0xa62d('0x160')});db[_0xa62d('0x36')][_0xa62d('0x119')](db[_0xa62d('0x38')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xa62d('0x36')][_0xa62d('0x119')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xa62d('0x160')});db[_0xa62d('0x38')][_0xa62d('0x108')](db[_0xa62d('0x34')],{'as':'Imap','onDelete':'cascade'});db[_0xa62d('0x38')][_0xa62d('0x108')](db['MailServerOut'],{'as':_0xa62d('0x161'),'onDelete':_0xa62d('0x10f')});db['MailAccount']['hasMany'](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x15f'),'onDelete':_0xa62d('0x10f')});db['MailAccount'][_0xa62d('0x10a')](db[_0xa62d('0x73')],{'as':'Answers','foreignKey':'MailAccountId'});db['MailAccount'][_0xa62d('0x10a')](db[_0xa62d('0x3d')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0xa62d('0x3c')],{'as':_0xa62d('0x163')});db['MailAccount'][_0xa62d('0x10a')](db[_0xa62d('0x164')],{'as':_0xa62d('0x143')});db['MailAccount'][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x38')][_0xa62d('0x119')](db[_0xa62d('0x84')],{'as':_0xa62d('0x84'),'foreignKey':'TemplateId'});db[_0xa62d('0x38')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db[_0xa62d('0x38')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x137')});db[_0xa62d('0x39')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':'UserMailQueue'});db[_0xa62d('0x39')]['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x167'),'as':_0xa62d('0x154')});db[_0xa62d('0x3c')][_0xa62d('0x10a')](db['MailMessage'],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':'MailInteractionId'});db[_0xa62d('0x3c')][_0xa62d('0x119')](db[_0xa62d('0x38')],{'as':_0xa62d('0x168'),'foreignKey':'MailAccountId'});db[_0xa62d('0x3c')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db[_0xa62d('0x3c')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x16a'),'foreignKey':_0xa62d('0x109')});db['MailInteraction'][_0xa62d('0x11e')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xa62d('0x16b')});db[_0xa62d('0x3c')][_0xa62d('0x11e')](db['Tag'],{'through':_0xa62d('0x16c'),'as':_0xa62d('0x16d')});db[_0xa62d('0x3c')][_0xa62d('0x11e')](db['User'],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xa62d('0x16e')});db[_0xa62d('0x3d')][_0xa62d('0x10a')](db[_0xa62d('0xe2')],{'as':'Attachments','onDelete':_0xa62d('0x10f')});db['MailMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x14')});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0x3d')]['belongsTo'](db[_0xa62d('0x3c')],{'as':_0xa62d('0x16f'),'foreignKey':_0xa62d('0x16e')});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x38')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x15f')});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x58')],{'as':_0xa62d('0x58'),'foreignKey':'ChatWebsiteId'});db[_0xa62d('0x3d')][_0xa62d('0x119')](db[_0xa62d('0x5d')],{'as':_0xa62d('0x5d'),'foreignKey':_0xa62d('0x170')});db[_0xa62d('0x164')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x164')]['belongsTo'](db[_0xa62d('0x39')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x164')][_0xa62d('0x119')](db['MailAccount'],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x164')][_0xa62d('0x119')](db[_0xa62d('0x79')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x164')]['belongsTo'](db[_0xa62d('0x171')],{'onDelete':'restrict','foreignKey':_0xa62d('0x172')});db[_0xa62d('0x173')][_0xa62d('0x119')](db['MailAccount'],{});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':'ListId'});db[_0xa62d('0x173')][_0xa62d('0x119')](db['CmContact'],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0x3c')],{});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0x3d')],{});db[_0xa62d('0x173')][_0xa62d('0x119')](db[_0xa62d('0x14')],{});db['MailQueueReport'][_0xa62d('0x119')](db['MailQueue'],{});db['Dashboard'][_0xa62d('0x10a')](db[_0xa62d('0x41')],{'as':_0xa62d('0x174'),'onDelete':_0xa62d('0x10f')});db['FaxAccount']['hasMany'](db[_0xa62d('0x75')],{'as':'Dispositions','foreignKey':_0xa62d('0x175'),'onDelete':'cascade'});db['FaxAccount'][_0xa62d('0x10a')](db['CannedAnswer'],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xa62d('0x43')][_0xa62d('0x10a')](db[_0xa62d('0x46')],{'as':_0xa62d('0x163')});db[_0xa62d('0x43')][_0xa62d('0x10a')](db[_0xa62d('0x44')],{'as':_0xa62d('0x143')});db[_0xa62d('0x43')]['hasMany'](db[_0xa62d('0x18')],{'as':_0xa62d('0x176'),'onDelete':'cascade'});db[_0xa62d('0x43')][_0xa62d('0x10a')](db[_0xa62d('0x48')],{'as':_0xa62d('0x158')});db[_0xa62d('0x43')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x27')});db[_0xa62d('0x43')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':'List','foreignKey':_0xa62d('0x166')});db[_0xa62d('0x43')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa62d('0x43')]['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x135')});db['FaxApplication'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x44')]['belongsTo'](db['FaxQueue'],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x44')][_0xa62d('0x119')](db[_0xa62d('0x43')],{'onDelete':_0xa62d('0x160')});db['FaxApplication'][_0xa62d('0x119')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa62d('0x172')});db['FaxInteraction'][_0xa62d('0x10a')](db[_0xa62d('0x48')],{'as':_0xa62d('0x158'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xa62d('0x46')]['belongsTo'](db[_0xa62d('0x43')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x175')});db[_0xa62d('0x46')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db[_0xa62d('0x46')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x16a'),'foreignKey':'UserId'});db[_0xa62d('0x46')]['belongsToMany'](db[_0xa62d('0x171')],{'through':_0xa62d('0x177'),'as':_0xa62d('0x16b')});db['FaxInteraction'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x177'),'as':_0xa62d('0x16d')});db[_0xa62d('0x46')]['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':'user_has_fax_interactions','foreignKey':_0xa62d('0x179')});db['FaxMessage'][_0xa62d('0x119')](db['User'],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x14')});db[_0xa62d('0x48')][_0xa62d('0x119')](db[_0xa62d('0x46')],{'as':'Interaction','foreignKey':_0xa62d('0x179')});db[_0xa62d('0x48')][_0xa62d('0x119')](db['CmContact'],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0x48')]['belongsTo'](db[_0xa62d('0xe2')],{'as':_0xa62d('0xe2'),'foreignKey':_0xa62d('0x17a')});db[_0xa62d('0x48')]['belongsTo'](db[_0xa62d('0x43')],{'as':'Account','foreignKey':_0xa62d('0x175')});db[_0xa62d('0x49')]['belongsToMany'](db[_0xa62d('0x14')],{'as':'Agents','through':_0xa62d('0x2d')});db['FaxQueue']['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x17b'),'as':'Teams'});db[_0xa62d('0x4a')][_0xa62d('0x119')](db['FaxAccount'],{});db[_0xa62d('0x4a')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x4a')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db['FaxQueueReport'][_0xa62d('0x119')](db[_0xa62d('0x46')],{});db['FaxQueueReport'][_0xa62d('0x119')](db[_0xa62d('0x48')],{});db[_0xa62d('0x4a')][_0xa62d('0x119')](db['User'],{});db[_0xa62d('0x4a')][_0xa62d('0x119')](db[_0xa62d('0x49')],{});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x17c'),'onDelete':_0xa62d('0x10f')});db['SmsAccount'][_0xa62d('0x10a')](db[_0xa62d('0x73')],{'as':_0xa62d('0x17d'),'foreignKey':_0xa62d('0x17c')});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x4d')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x17c')});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x114')],{'as':'Interactions'});db[_0xa62d('0x4b')][_0xa62d('0x10a')](db[_0xa62d('0x17e')],{'as':_0xa62d('0x143')});db['SmsAccount'][_0xa62d('0x119')](db['CmList'],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x4b')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db[_0xa62d('0x4b')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x13b')});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db['SmsApplication']['belongsTo'](db[_0xa62d('0x4f')],{'onDelete':'restrict'});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x4b')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x79')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xa62d('0x17e')][_0xa62d('0x119')](db[_0xa62d('0x171')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x172')});db[_0xa62d('0x114')][_0xa62d('0x10a')](db[_0xa62d('0x4d')],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x17f')});db[_0xa62d('0x114')][_0xa62d('0x119')](db[_0xa62d('0x4b')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x17c')});db['SmsInteraction'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db['SmsInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xa62d('0x109')});db['SmsInteraction']['belongsToMany'](db[_0xa62d('0x171')],{'through':'sms_interaction_has_tags','as':_0xa62d('0x16b')});db['SmsInteraction'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x180'),'as':'ThroughTags'});db['SmsInteraction'][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':'User'});db[_0xa62d('0x4d')]['belongsTo'](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0x4d')][_0xa62d('0x119')](db[_0xa62d('0x114')],{'onDelete':'cascade','as':_0xa62d('0x16f'),'foreignKey':'SmsInteractionId'});db[_0xa62d('0x4d')][_0xa62d('0x119')](db['SmsAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x17c')});db['SmsQueue'][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x2f'),'foreignKey':_0xa62d('0x181')});db[_0xa62d('0x4f')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'through':_0xa62d('0x182'),'as':_0xa62d('0x154')});db[_0xa62d('0x51')]['hasMany'](db['Disposition'],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x183'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x51')][_0xa62d('0x10a')](db['CannedAnswer'],{'as':_0xa62d('0x17d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xa62d('0x10a')](db[_0xa62d('0x111')],{'as':_0xa62d('0x163'),'foreignKey':_0xa62d('0x183')});db['OpenchannelAccount'][_0xa62d('0x10a')](db[_0xa62d('0x56')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x183')});db[_0xa62d('0x51')][_0xa62d('0x10a')](db[_0xa62d('0x53')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0xa62d('0x51')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':'ListId'});db[_0xa62d('0x51')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db['OpenchannelAccount']['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x139')});db[_0xa62d('0x53')]['belongsTo'](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0x53')][_0xa62d('0x119')](db[_0xa62d('0x57')],{'onDelete':_0xa62d('0x160'),'foreignKey':'OpenchannelQueueId'});db[_0xa62d('0x53')][_0xa62d('0x119')](db[_0xa62d('0x51')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x183')});db[_0xa62d('0x53')]['belongsTo'](db[_0xa62d('0x79')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x53')][_0xa62d('0x119')](db[_0xa62d('0x171')],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x172')});db[_0xa62d('0x111')][_0xa62d('0x10a')](db[_0xa62d('0x56')],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x184')});db[_0xa62d('0x111')][_0xa62d('0x119')](db['OpenchannelAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x183')});db[_0xa62d('0x111')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x111')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x16a'),'foreignKey':'UserId'});db[_0xa62d('0x111')][_0xa62d('0x11e')](db['Tag'],{'through':_0xa62d('0x185'),'as':'Tags'});db[_0xa62d('0x111')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x185'),'as':'ThroughTags'});db[_0xa62d('0x111')][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x178'),'through':_0xa62d('0x186'),'foreignKey':'OpenchannelInteractionId'});db[_0xa62d('0x56')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':'cascade','as':_0xa62d('0x14')});db[_0xa62d('0x56')]['belongsTo'](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db['OpenchannelMessage'][_0xa62d('0x119')](db[_0xa62d('0x111')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa62d('0x184')});db[_0xa62d('0x56')][_0xa62d('0x119')](db[_0xa62d('0xe2')],{'as':_0xa62d('0xe2'),'foreignKey':'AttachmentId'});db[_0xa62d('0x56')][_0xa62d('0x119')](db[_0xa62d('0x51')],{'as':'Account','foreignKey':_0xa62d('0x183')});db[_0xa62d('0x57')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':'UserOpenchannelQueue','foreignKey':_0xa62d('0x187')});db[_0xa62d('0x57')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'through':_0xa62d('0x188'),'as':_0xa62d('0x154')});db[_0xa62d('0x58')][_0xa62d('0x10a')](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x189'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x58')]['hasMany'](db[_0xa62d('0x73')],{'as':'Answers','foreignKey':_0xa62d('0x189')});db['ChatWebsite']['hasMany'](db[_0xa62d('0x61')],{'as':_0xa62d('0x18a')});db['ChatWebsite'][_0xa62d('0x10a')](db['ChatInteraction'],{'as':_0xa62d('0x163')});db[_0xa62d('0x58')][_0xa62d('0x10a')](db[_0xa62d('0x5b')],{'as':_0xa62d('0x143')});db[_0xa62d('0x58')][_0xa62d('0x10a')](db['ChatMessage'],{'as':_0xa62d('0x158')});db[_0xa62d('0x58')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x58')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x58')]['belongsTo'](db[_0xa62d('0x38')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xa62d('0x58')][_0xa62d('0x119')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa62d('0x151')});db[_0xa62d('0x58')]['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x133')});db[_0xa62d('0x59')][_0xa62d('0x119')](db[_0xa62d('0x51')],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0x59')]['belongsTo'](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x59')][_0xa62d('0x119')](db['OpenchannelInteraction'],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db['OpenchannelMessage'],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db['User'],{});db[_0xa62d('0x59')][_0xa62d('0x119')](db[_0xa62d('0x57')],{});db[_0xa62d('0x5b')][_0xa62d('0x119')](db['User'],{'as':_0xa62d('0x18b'),'foreignKey':_0xa62d('0x109'),'onDelete':_0xa62d('0x160')});db['ChatApplication']['belongsTo'](db[_0xa62d('0x5e')],{'as':_0xa62d('0x18c'),'foreignKey':_0xa62d('0x18d'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x5b')]['belongsTo'](db[_0xa62d('0x58')],{'as':_0xa62d('0x18e'),'foreignKey':_0xa62d('0x189'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x5b')][_0xa62d('0x119')](db[_0xa62d('0x171')],{'onDelete':'restrict','foreignKey':_0xa62d('0x172')});db[_0xa62d('0x112')][_0xa62d('0x10a')](db[_0xa62d('0x18f')],{'as':_0xa62d('0x158'),'onDelete':'cascade','foreignKey':_0xa62d('0x190')});db[_0xa62d('0x112')][_0xa62d('0x119')](db[_0xa62d('0x58')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x189')});db[_0xa62d('0x112')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db[_0xa62d('0x112')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xa62d('0x112')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':'chat_interaction_has_tags','as':_0xa62d('0x16b')});db[_0xa62d('0x112')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x191'),'as':_0xa62d('0x16d')});db[_0xa62d('0x112')]['belongsToMany'](db[_0xa62d('0x14')],{'as':'Users','through':_0xa62d('0x124'),'foreignKey':_0xa62d('0x190')});db['ChatMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':'cascade','as':'User'});db['ChatMessage']['belongsTo'](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x18f')][_0xa62d('0x119')](db[_0xa62d('0x112')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x16f'),'foreignKey':_0xa62d('0x190')});db[_0xa62d('0x18f')][_0xa62d('0x119')](db[_0xa62d('0xe2')],{'as':_0xa62d('0xe2'),'foreignKey':_0xa62d('0x17a')});db[_0xa62d('0x18f')]['belongsTo'](db[_0xa62d('0x58')],{'as':_0xa62d('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':_0xa62d('0x192'),'foreignKey':_0xa62d('0x170'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db['ChatOfflineMessage'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'onDelete':'cascade','as':_0xa62d('0x15e'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0xa62d('0x119')](db[_0xa62d('0x58')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x189')});db[_0xa62d('0x5e')][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':_0xa62d('0x12e'),'hooks':!![]});db[_0xa62d('0x5e')][_0xa62d('0x11e')](db[_0xa62d('0x121')],{'through':_0xa62d('0x193'),'as':_0xa62d('0x154')});db[_0xa62d('0x5f')][_0xa62d('0x10a')](db[_0xa62d('0xc7')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x194'),'onDelete':_0xa62d('0x10f')});db['ChatGroup']['belongsToMany'](db[_0xa62d('0x14')],{'as':_0xa62d('0x195'),'through':_0xa62d('0x11b')});db['ChatProactiveAction'][_0xa62d('0x119')](db['ChatWebsite'],{'as':_0xa62d('0x18e'),'foreignKey':_0xa62d('0x189')});db[_0xa62d('0x63')][_0xa62d('0x10a')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x11d'),'foreignKey':'CompanyId'});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x65')],{'as':_0xa62d('0x147'),'foreignKey':'ContactId'});db['CmContact'][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':'HopperFinals','foreignKey':_0xa62d('0x169')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x6b')],{'as':_0xa62d('0x149'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x11c')]['hasMany'](db[_0xa62d('0x6d')],{'as':_0xa62d('0x6d'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0xcc')],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact'][_0xa62d('0x10a')](db[_0xa62d('0x111')],{'as':_0xa62d('0x127'),'foreignKey':'ContactId','onDelete':_0xa62d('0x160')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x112')],{'as':_0xa62d('0x113'),'foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x160')});db['CmContact'][_0xa62d('0x10a')](db['SmsInteraction'],{'as':_0xa62d('0x196'),'foreignKey':_0xa62d('0x169'),'onDelete':'restrict'});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db['FaxInteraction'],{'as':_0xa62d('0x115'),'foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x11c')][_0xa62d('0x10a')](db[_0xa62d('0x3c')],{'as':'MailInteractions','foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x11c')]['belongsTo'](db['CmCompany'],{'as':_0xa62d('0x197'),'foreignKey':_0xa62d('0x198')});db[_0xa62d('0x11c')]['belongsTo'](db[_0xa62d('0xec')],{'as':'List','foreignKey':_0xa62d('0x166'),'onDelete':'cascade'});db[_0xa62d('0x11c')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':'cm_user_has_contacts'});db[_0xa62d('0x11c')][_0xa62d('0x11e')](db['Tag'],{'as':_0xa62d('0x16b'),'through':_0xa62d('0x199')});db['CmContact'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x199'),'as':_0xa62d('0x16d')});db[_0xa62d('0x65')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa62d('0x166'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x65')]['belongsTo'](db[_0xa62d('0x14')],{'as':_0xa62d('0x18b'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0x65')][_0xa62d('0x119')](db['VoiceQueue'],{'as':_0xa62d('0x18c'),'foreignKey':_0xa62d('0x146'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x65')][_0xa62d('0x119')](db[_0xa62d('0xdf')],{'as':_0xa62d('0xdf'),'foreignKey':_0xa62d('0x19a'),'onDelete':'cascade'});db[_0xa62d('0x65')]['belongsTo'](db[_0xa62d('0x14')],{'as':'Owner','foreignKey':_0xa62d('0x19b')});db['CmHopperBlack']['belongsTo'](db[_0xa62d('0x11c')],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x67')]['belongsTo'](db[_0xa62d('0xec')],{'as':'List','foreignKey':_0xa62d('0x166'),'onDelete':'cascade'});db[_0xa62d('0x67')][_0xa62d('0x119')](db[_0xa62d('0x129')],{'as':_0xa62d('0x18c'),'foreignKey':_0xa62d('0x146'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x67')][_0xa62d('0x119')](db[_0xa62d('0xdf')],{'as':_0xa62d('0xdf'),'foreignKey':_0xa62d('0x19a'),'onDelete':'cascade'});db[_0xa62d('0x71')][_0xa62d('0x10a')](db[_0xa62d('0x77')],{'as':{'plural':_0xa62d('0x19c'),'singular':_0xa62d('0x19d')},'foreignKey':_0xa62d('0x19e'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db['Automation']['hasMany'](db[_0xa62d('0x77')],{'as':{'plural':_0xa62d('0x19f'),'singular':_0xa62d('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xa62d('0x71')][_0xa62d('0x10a')](db[_0xa62d('0x70')],{'as':_0xa62d('0x1a1'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0xa62d('0x75')][_0xa62d('0x10a')](db[_0xa62d('0x75')],{'as':_0xa62d('0x162'),'foreignKey':_0xa62d('0x1a2'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x79')]['hasMany'](db[_0xa62d('0x79')],{'as':_0xa62d('0x1a3'),'foreignKey':_0xa62d('0x14f'),'onDelete':_0xa62d('0x10f'),'hooks':!![],'required':![]});db['Interval'][_0xa62d('0x10a')](db[_0xa62d('0x18')],{'as':_0xa62d('0x10e'),'foreignKey':_0xa62d('0x14f'),'onDelete':_0xa62d('0x160')});db['Interval'][_0xa62d('0x10a')](db[_0xa62d('0x164')],{'as':_0xa62d('0x1a4'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x79')][_0xa62d('0x10a')](db[_0xa62d('0x5b')],{'as':_0xa62d('0x1a5'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x79')]['hasMany'](db[_0xa62d('0x44')],{'as':_0xa62d('0x1a6'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x79')]['hasMany'](db[_0xa62d('0x17e')],{'as':'SmsApplications','foreignKey':_0xa62d('0x14f')});db[_0xa62d('0x7f')][_0xa62d('0x119')](db['MailAccount'],{});db[_0xa62d('0x7f')][_0xa62d('0x119')](db['AnalyticDefaultReport'],{'foreignKey':_0xa62d('0x1a7')});db[_0xa62d('0x7f')]['belongsTo'](db[_0xa62d('0x1a8')],{'foreignKey':_0xa62d('0x1a9')});db[_0xa62d('0x81')][_0xa62d('0x11e')](db[_0xa62d('0x19')],{'as':_0xa62d('0x1aa'),'through':_0xa62d('0x145'),'onDelete':_0xa62d('0x160')});db[_0xa62d('0x171')][_0xa62d('0x11e')](db[_0xa62d('0x11c')],{'through':_0xa62d('0x199')});db[_0xa62d('0x171')][_0xa62d('0x11e')](db[_0xa62d('0x112')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xa62d('0x11e')](db[_0xa62d('0x3c')],{'through':'mail_interaction_has_tags'});db[_0xa62d('0x171')]['belongsToMany'](db['SmsInteraction'],{'through':_0xa62d('0x180')});db['Tag']['belongsToMany'](db[_0xa62d('0x46')],{'through':_0xa62d('0x177')});db['Tag']['belongsToMany'](db[_0xa62d('0x111')],{'through':_0xa62d('0x185')});db[_0xa62d('0x171')][_0xa62d('0x11e')](db[_0xa62d('0xf9')],{'through':_0xa62d('0x1ab')});db[_0xa62d('0x86')][_0xa62d('0x10a')](db[_0xa62d('0x77')],{'as':{'plural':_0xa62d('0x1ac'),'singular':'AllCondition'},'foreignKey':_0xa62d('0x1ad'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db[_0xa62d('0x86')]['hasMany'](db['Condition'],{'as':{'plural':_0xa62d('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xa62d('0x1af'),'onDelete':_0xa62d('0x10f'),'hooks':!![]});db['Trigger'][_0xa62d('0x10a')](db[_0xa62d('0x70')],{'as':_0xa62d('0x1a1'),'foreignKey':'TriggerId','onDelete':_0xa62d('0x10f'),'hooks':!![]});db[_0xa62d('0x1a8')][_0xa62d('0x10a')](db[_0xa62d('0x1b0')],{'as':_0xa62d('0x1b1'),'onDelete':'cascade','foreignKey':_0xa62d('0x1a9'),'hooks':!![]});db[_0xa62d('0x1b2')][_0xa62d('0x10a')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1a7')});db[_0xa62d('0x8f')][_0xa62d('0x10a')](db['AnalyticFieldReport'],{'as':_0xa62d('0x1b1'),'onDelete':_0xa62d('0x10f'),'foreignKey':'MetricId'});db[_0xa62d('0x1b0')][_0xa62d('0x119')](db[_0xa62d('0x8f')],{'foreignKey':_0xa62d('0x1b3')});db[_0xa62d('0x94')][_0xa62d('0x10a')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x96')]['hasMany'](db['SalesforceField'],{'as':_0xa62d('0x1b5'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0x96')][_0xa62d('0x10a')](db['SalesforceField'],{'as':_0xa62d('0x1b7'),'onDelete':_0xa62d('0x10f'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xa62d('0x10a')](db[_0xa62d('0x98')],{'as':_0xa62d('0x1b1'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x96')]['belongsTo'](db['SalesforceAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db['SalesforceField']['hasMany'](db[_0xa62d('0x98')],{'as':_0xa62d('0x1b9'),'foreignKey':'SubjectId'});db[_0xa62d('0x98')]['hasMany'](db['SalesforceField'],{'as':_0xa62d('0x1ba'),'foreignKey':'DescriptionId'});db[_0xa62d('0x98')][_0xa62d('0x10a')](db[_0xa62d('0x98')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db['SalesforceField']['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0x9a')][_0xa62d('0x10a')](db['SugarcrmConfiguration'],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':'AccountId'});db['SugarcrmConfiguration']['hasMany'](db[_0xa62d('0x9c')],{'as':_0xa62d('0x1b5'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b6')});db['SugarcrmConfiguration'][_0xa62d('0x10a')](db['SugarcrmField'],{'as':_0xa62d('0x1b7'),'onDelete':_0xa62d('0x10f'),'foreignKey':'DescriptionId'});db[_0xa62d('0x1bf')][_0xa62d('0x10a')](db[_0xa62d('0x9c')],{'as':_0xa62d('0x1b1'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1bf')][_0xa62d('0x119')](db[_0xa62d('0x9a')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x9c')][_0xa62d('0x10a')](db[_0xa62d('0x9c')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa62d('0x9c')]['hasMany'](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa62d('0x9c')]['hasMany'](db[_0xa62d('0x9c')],{'as':'Field','foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x9c')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0x1c0')][_0xa62d('0x10a')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x9f')][_0xa62d('0x10a')](db[_0xa62d('0xa1')],{'as':'Subjects','onDelete':_0xa62d('0x10f'),'foreignKey':'SubjectId'});db[_0xa62d('0x9f')]['hasMany'](db[_0xa62d('0xa1')],{'as':'Descriptions','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0x9f')]['hasMany'](db[_0xa62d('0xa1')],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db['DeskConfiguration'][_0xa62d('0x119')](db[_0xa62d('0x1c0')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x9f')][_0xa62d('0x11e')](db['Tag'],{'through':_0xa62d('0x1c2')});db['DeskField'][_0xa62d('0x10a')](db[_0xa62d('0xa1')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db['DeskField'][_0xa62d('0x10a')](db[_0xa62d('0xa1')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xa1')][_0xa62d('0x10a')](db['DeskField'],{'as':_0xa62d('0x1bb'),'foreignKey':'FieldId'});db[_0xa62d('0xa1')]['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xa3')][_0xa62d('0x10a')](db[_0xa62d('0xa5')],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xa5')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b5'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xa5')]['hasMany'](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b7'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xa5')]['hasMany'](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b1'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xa7')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xa7')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':'Description','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xa7')][_0xa62d('0x10a')](db[_0xa62d('0xa7')],{'as':_0xa62d('0x1bb'),'foreignKey':'FieldId'});db[_0xa62d('0xa7')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa62d('0xa8')][_0xa62d('0x10a')](db['ZendeskConfiguration'],{'as':_0xa62d('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa62d('0x1c3')]['hasMany'](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1b5'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':'Descriptions','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0x1c3')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1b1'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1c3')][_0xa62d('0x119')](db['ZendeskAccount'],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db['ZendeskConfiguration'][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x1c4')});db[_0xa62d('0xaa')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xaa')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1ba'),'foreignKey':'DescriptionId'});db[_0xa62d('0xaa')][_0xa62d('0x10a')](db[_0xa62d('0xaa')],{'as':_0xa62d('0x1bb'),'foreignKey':'FieldId'});db[_0xa62d('0xaa')]['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0xa62d('0x10a')](db[_0xa62d('0xae')],{'as':_0xa62d('0x1be'),'onDelete':'cascade','foreignKey':_0xa62d('0x1b4')});db['FreshdeskConfiguration']['hasMany'](db[_0xa62d('0xaf')],{'as':_0xa62d('0x1b5'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xae')][_0xa62d('0x10a')](db[_0xa62d('0xaf')],{'as':_0xa62d('0x1b7'),'onDelete':'cascade','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xae')]['hasMany'](db[_0xa62d('0xaf')],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db['FreshdeskConfiguration'][_0xa62d('0x119')](db[_0xa62d('0xac')],{'as':'Account','foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xae')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':_0xa62d('0x1c5')});db[_0xa62d('0xaf')][_0xa62d('0x10a')](db[_0xa62d('0xaf')],{'as':'Subject','foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xaf')][_0xa62d('0x10a')](db['FreshdeskField'],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db['FreshdeskField'][_0xa62d('0x10a')](db[_0xa62d('0xaf')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xaf')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':'VariableId'});db[_0xa62d('0xb0')][_0xa62d('0x10a')](db[_0xa62d('0xb2')],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xb2')]['hasMany'](db['VtigerField'],{'as':_0xa62d('0x1b5'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xb2')][_0xa62d('0x10a')](db[_0xa62d('0x1c6')],{'as':'Descriptions','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xb2')][_0xa62d('0x10a')](db['VtigerField'],{'as':_0xa62d('0x1b1'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xb2')][_0xa62d('0x119')](db[_0xa62d('0xb0')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db['VtigerField'][_0xa62d('0x10a')](db[_0xa62d('0x1c6')],{'as':'Subject','foreignKey':_0xa62d('0x1b6')});db['VtigerField'][_0xa62d('0x10a')](db[_0xa62d('0x1c6')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0x1c6')]['hasMany'](db[_0xa62d('0x1c6')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1c6')][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xb4')]['hasMany'](db[_0xa62d('0xb6')],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':'AccountId'});db[_0xa62d('0xb6')][_0xa62d('0x10a')](db['ServicenowField'],{'as':_0xa62d('0x1b5'),'foreignKey':'SubjectId'});db[_0xa62d('0xb6')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':'Descriptions','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xb6')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':'Fields','foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xb6')][_0xa62d('0x119')](db['ServicenowAccount'],{'as':_0xa62d('0x168'),'foreignKey':'AccountId'});db[_0xa62d('0xb8')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xb8')]['hasMany'](db[_0xa62d('0xb8')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xb8')][_0xa62d('0x10a')](db[_0xa62d('0xb8')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db['ServicenowField'][_0xa62d('0x119')](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xba')][_0xa62d('0x10a')](db[_0xa62d('0x1c7')],{'as':'Configurations','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0x1c7')][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':'Subjects','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b6')});db['Dynamics365Configuration'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1b7'),'onDelete':'cascade','foreignKey':_0xa62d('0x1c1')});db['Dynamics365Configuration'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':'Fields','onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0x1c7')][_0xa62d('0x119')](db[_0xa62d('0xba')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xbd')][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1b9'),'foreignKey':_0xa62d('0x1b6')});db['Dynamics365Field'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1ba'),'foreignKey':_0xa62d('0x1c1')});db['Dynamics365Field'][_0xa62d('0x10a')](db[_0xa62d('0xbd')],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xbd')]['belongsTo'](db[_0xa62d('0x1bc')],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db['FreshsalesAccount'][_0xa62d('0x10a')](db[_0xa62d('0xc1')],{'as':_0xa62d('0x1be'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1b4')});db[_0xa62d('0xc1')][_0xa62d('0x10a')](db[_0xa62d('0xc3')],{'as':_0xa62d('0x1b5'),'foreignKey':_0xa62d('0x1b6')});db[_0xa62d('0xc1')]['hasMany'](db[_0xa62d('0xc3')],{'as':_0xa62d('0x1b7'),'foreignKey':'DescriptionId'});db[_0xa62d('0xc1')]['hasMany'](db[_0xa62d('0xc3')],{'as':_0xa62d('0x1b1'),'foreignKey':'FieldId'});db[_0xa62d('0xc1')][_0xa62d('0x119')](db[_0xa62d('0xbf')],{'as':_0xa62d('0x168'),'foreignKey':'AccountId'});db[_0xa62d('0xc3')]['hasMany'](db[_0xa62d('0xc3')],{'as':'Subject','foreignKey':_0xa62d('0x1b6')});db['FreshsalesField'][_0xa62d('0x10a')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xa62d('0x1c1')});db[_0xa62d('0xc3')][_0xa62d('0x10a')](db['FreshsalesField'],{'as':_0xa62d('0x1bb'),'foreignKey':_0xa62d('0x1b8')});db[_0xa62d('0xc3')][_0xa62d('0x119')](db['Variable'],{'as':_0xa62d('0x1bc'),'foreignKey':_0xa62d('0x1bd')});db[_0xa62d('0xc5')]['belongsTo'](db[_0xa62d('0x58')],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db[_0xa62d('0xc5')]['belongsTo'](db[_0xa62d('0x112')],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db['ChatMessage'],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0x14')],{});db[_0xa62d('0xc5')][_0xa62d('0x119')](db[_0xa62d('0x5e')],{});db[_0xa62d('0xc7')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1c8')});db[_0xa62d('0xc7')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'onDelete':'cascade','foreignKey':_0xa62d('0x1c9')});db[_0xa62d('0xcc')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xa62d('0x1ca'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0xcc')][_0xa62d('0x10a')](db[_0xa62d('0xc9')],{'foreignKey':_0xa62d('0x1ca'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0xce')]['belongsTo'](db[_0xa62d('0x4b')],{});db['SmsQueueReport'][_0xa62d('0x119')](db[_0xa62d('0xec')],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0xce')]['belongsTo'](db['CmContact'],{'as':_0xa62d('0x15e'),'foreignKey':_0xa62d('0x169')});db[_0xa62d('0xce')][_0xa62d('0x119')](db[_0xa62d('0x114')],{});db[_0xa62d('0xce')][_0xa62d('0x119')](db['SmsMessage'],{});db[_0xa62d('0xce')][_0xa62d('0x119')](db[_0xa62d('0x14')],{});db[_0xa62d('0xce')]['belongsTo'](db[_0xa62d('0x4f')],{});db[_0xa62d('0xd3')]['hasMany'](db[_0xa62d('0xcc')],{'foreignKey':_0xa62d('0x1cb')});db[_0xa62d('0xd3')][_0xa62d('0x10a')](db['JscriptyQuestionReport'],{'foreignKey':_0xa62d('0x1cb')});db[_0xa62d('0xd3')][_0xa62d('0x10a')](db[_0xa62d('0xc9')],{'foreignKey':_0xa62d('0x1cb')});db[_0xa62d('0x13e')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x178'),'through':_0xa62d('0x140')});db[_0xa62d('0x121')][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':_0xa62d('0x122')});db[_0xa62d('0x121')]['belongsToMany'](db[_0xa62d('0x129')],{'through':_0xa62d('0x104'),'as':'VoiceQueues'});db['Team'][_0xa62d('0x11e')](db[_0xa62d('0x39')],{'through':'team_has_mail_queues','as':_0xa62d('0x12c')});db['Team'][_0xa62d('0x11e')](db[_0xa62d('0x5e')],{'through':_0xa62d('0x193'),'as':_0xa62d('0x12d')});db[_0xa62d('0x121')]['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xa62d('0x1cc')});db[_0xa62d('0x121')]['belongsToMany'](db['SmsQueue'],{'through':_0xa62d('0x182'),'as':_0xa62d('0x12f')});db[_0xa62d('0x121')][_0xa62d('0x11e')](db['OpenchannelQueue'],{'through':_0xa62d('0x188'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0xa62d('0x101')],{'through':'team_has_whatsapp_queues','as':_0xa62d('0x131')});db[_0xa62d('0x121')][_0xa62d('0x11e')](db[_0xa62d('0x12b')],{'through':_0xa62d('0x106'),'as':'VoicePrefixes'});db[_0xa62d('0xdf')][_0xa62d('0x10a')](db[_0xa62d('0x65')],{'as':_0xa62d('0x147'),'foreignKey':_0xa62d('0x19a')});db[_0xa62d('0xdf')][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':_0xa62d('0x148'),'foreignKey':'CampaignId'});db[_0xa62d('0xdf')]['hasMany'](db[_0xa62d('0x6b')],{'as':_0xa62d('0x149'),'foreignKey':_0xa62d('0x19a')});db['Campaign'][_0xa62d('0x10a')](db[_0xa62d('0x67')],{'as':_0xa62d('0x14a'),'foreignKey':_0xa62d('0x19a')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x27'),'foreignKey':_0xa62d('0x14c')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db[_0xa62d('0x27')],{'as':_0xa62d('0x14d'),'foreignKey':_0xa62d('0x14e')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db['Interval'],{'as':_0xa62d('0x79'),'foreignKey':_0xa62d('0x14f')});db[_0xa62d('0xdf')][_0xa62d('0x119')](db[_0xa62d('0x13e')],{'as':_0xa62d('0x13e'),'foreignKey':_0xa62d('0x1cd')});db[_0xa62d('0xdf')]['belongsToMany'](db[_0xa62d('0xec')],{'as':_0xa62d('0x11f'),'through':_0xa62d('0x1ce')});db[_0xa62d('0xdf')][_0xa62d('0x11e')](db['CmList'],{'as':_0xa62d('0x155'),'through':_0xa62d('0x1cf')});db[_0xa62d('0xe2')]['belongsTo'](db[_0xa62d('0x5d')],{'as':_0xa62d('0x5d'),'foreignKey':_0xa62d('0x170')});db[_0xa62d('0xe6')][_0xa62d('0x119')](db[_0xa62d('0x3d')],{});db[_0xa62d('0xe6')][_0xa62d('0x119')](db[_0xa62d('0x3c')],{});db[_0xa62d('0xe6')]['belongsTo'](db[_0xa62d('0x38')],{'foreignKey':_0xa62d('0x1d0'),'as':_0xa62d('0x1d1')});db['MailTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa62d('0xe6')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'ToUserId','as':_0xa62d('0x1d2')});db['MailTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x39')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x38')],{'foreignKey':_0xa62d('0x1d3'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xe8')][_0xa62d('0x119')](db[_0xa62d('0x18f')],{});db[_0xa62d('0xe8')][_0xa62d('0x119')](db['ChatInteraction'],{});db['ChatTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x58')],{'foreignKey':_0xa62d('0x1d5'),'as':'FromAccount'});db[_0xa62d('0xe8')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d6'),'as':'FromAgent'});db[_0xa62d('0xe8')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d7'),'as':_0xa62d('0x1d2')});db['ChatTransferReport']['belongsTo'](db[_0xa62d('0x5e')],{'foreignKey':_0xa62d('0x1d8'),'as':_0xa62d('0x1d9')});db[_0xa62d('0xe8')][_0xa62d('0x119')](db['ChatWebsite'],{'foreignKey':_0xa62d('0x1da'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x48')],{});db[_0xa62d('0xe9')][_0xa62d('0x119')](db['FaxInteraction'],{});db['FaxTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x43')],{'foreignKey':_0xa62d('0x1db'),'as':_0xa62d('0x1d1')});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d6'),'as':'FromAgent'});db[_0xa62d('0xe9')][_0xa62d('0x119')](db['User'],{'foreignKey':_0xa62d('0x1d7'),'as':'ToAgent'});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x49')],{'foreignKey':_0xa62d('0x1dc'),'as':_0xa62d('0x1d9')});db[_0xa62d('0xe9')][_0xa62d('0x119')](db[_0xa62d('0x43')],{'foreignKey':_0xa62d('0x1dd'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x56')],{});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x111')],{});db[_0xa62d('0xea')][_0xa62d('0x119')](db['OpenchannelAccount'],{'foreignKey':_0xa62d('0x1de'),'as':_0xa62d('0x1d1')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'FromUserId','as':_0xa62d('0x1df')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d7'),'as':_0xa62d('0x1d2')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x57')],{'foreignKey':_0xa62d('0x1e0'),'as':_0xa62d('0x1d9')});db[_0xa62d('0xea')][_0xa62d('0x119')](db[_0xa62d('0x51')],{'foreignKey':'ToOpenchannelAccountId','as':_0xa62d('0x1d4')});db[_0xa62d('0x1e1')]['belongsTo'](db['SmsMessage'],{});db[_0xa62d('0x1e1')]['belongsTo'](db[_0xa62d('0x114')],{});db[_0xa62d('0x1e1')][_0xa62d('0x119')](db[_0xa62d('0x4b')],{'foreignKey':_0xa62d('0x1e2'),'as':_0xa62d('0x1d1')});db[_0xa62d('0x1e1')][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':'FromUserId','as':_0xa62d('0x1df')});db['SmsTransferReport'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d7'),'as':'ToAgent'});db[_0xa62d('0x1e1')][_0xa62d('0x119')](db[_0xa62d('0x4f')],{'foreignKey':_0xa62d('0x1e3'),'as':_0xa62d('0x1d9')});db[_0xa62d('0x1e1')]['belongsTo'](db[_0xa62d('0x4b')],{'foreignKey':_0xa62d('0x1e4'),'as':_0xa62d('0x1d4')});db[_0xa62d('0xec')]['hasMany'](db[_0xa62d('0x75')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0xa62d('0x10f')});db[_0xa62d('0xec')]['hasMany'](db[_0xa62d('0x6e')],{'as':'CustomFields','foreignKey':_0xa62d('0x166')});db[_0xa62d('0xec')][_0xa62d('0x10a')](db[_0xa62d('0x11c')],{'as':_0xa62d('0x11d'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x166')});db['CmList'][_0xa62d('0x10a')](db[_0xa62d('0x69')],{'as':_0xa62d('0x148'),'foreignKey':_0xa62d('0x166')});db[_0xa62d('0xec')][_0xa62d('0x10a')](db[_0xa62d('0x6b')],{'as':_0xa62d('0x110'),'foreignKey':'ListId'});db[_0xa62d('0xec')][_0xa62d('0x10a')](db['ReportAgentPreview'],{'as':_0xa62d('0x6d'),'foreignKey':_0xa62d('0x166')});db['CmList'][_0xa62d('0x11e')](db[_0xa62d('0x129')],{'as':_0xa62d('0x1e5'),'through':_0xa62d('0x152')});db['CmList'][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':'cm_user_has_lists'});db[_0xa62d('0x12b')]['hasMany'](db[_0xa62d('0x18')],{'as':_0xa62d('0x10e'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0x12b')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':'UserVoicePrefix'});db[_0xa62d('0x12b')]['belongsToMany'](db[_0xa62d('0x121')],{'through':_0xa62d('0x106'),'as':'Teams'});db[_0xa62d('0xee')][_0xa62d('0x10a')](db['User'],{'as':_0xa62d('0x178'),'foreignKey':_0xa62d('0x11a')});db['UserProfile'][_0xa62d('0x10a')](db['UserProfileSection'],{'as':_0xa62d('0x1e6'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xa62d('0xf0')]['hasMany'](db[_0xa62d('0xf2')],{'as':'Resources','foreignKey':_0xa62d('0x1e7'),'onDelete':_0xa62d('0x10f')});db[_0xa62d('0xf6')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa62d('0x1e8'),'onDelete':'cascade'});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db[_0xa62d('0x73')],{'as':_0xa62d('0x17d'),'foreignKey':_0xa62d('0x1e8')});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db[_0xa62d('0xfb')],{'as':_0xa62d('0x158'),'foreignKey':_0xa62d('0x1e8')});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db['WhatsappInteraction'],{'as':_0xa62d('0x163')});db[_0xa62d('0xf6')][_0xa62d('0x10a')](db[_0xa62d('0xf8')],{'as':_0xa62d('0x143')});db[_0xa62d('0xf6')][_0xa62d('0x119')](db['CmList'],{'as':'List','foreignKey':_0xa62d('0x166')});db[_0xa62d('0xf6')][_0xa62d('0x119')](db[_0xa62d('0x7b')],{'as':_0xa62d('0x150'),'foreignKey':_0xa62d('0x151')});db['WhatsappAccount'][_0xa62d('0x11e')](db['User'],{'as':_0xa62d('0x153'),'through':_0xa62d('0x13d')});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xa62d('0x119')](db[_0xa62d('0x101')],{'onDelete':_0xa62d('0x160')});db[_0xa62d('0xf8')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'onDelete':_0xa62d('0x160')});db['WhatsappApplication'][_0xa62d('0x119')](db['Interval'],{'onDelete':_0xa62d('0x160'),'foreignKey':'IntervalId'});db[_0xa62d('0xf8')][_0xa62d('0x119')](db['Tag'],{'onDelete':_0xa62d('0x160'),'foreignKey':_0xa62d('0x172')});db[_0xa62d('0xf9')][_0xa62d('0x10a')](db[_0xa62d('0xfb')],{'as':_0xa62d('0x158'),'onDelete':_0xa62d('0x10f'),'foreignKey':_0xa62d('0x1e9')});db['WhatsappInteraction'][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'as':_0xa62d('0x168'),'foreignKey':_0xa62d('0x1e8')});db['WhatsappInteraction'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'as':'Contact','foreignKey':_0xa62d('0x169')});db[_0xa62d('0xf9')][_0xa62d('0x119')](db['User'],{'as':_0xa62d('0x16a'),'foreignKey':_0xa62d('0x109')});db[_0xa62d('0xf9')][_0xa62d('0x11e')](db[_0xa62d('0x171')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xa62d('0xf9')]['belongsToMany'](db[_0xa62d('0x171')],{'through':_0xa62d('0x1ab'),'as':_0xa62d('0x16d')});db[_0xa62d('0xf9')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':'Users','through':_0xa62d('0x128'),'foreignKey':_0xa62d('0x1e9')});db['WhatsappMessage'][_0xa62d('0x119')](db[_0xa62d('0x14')],{'as':_0xa62d('0x14')});db['WhatsappMessage'][_0xa62d('0x119')](db[_0xa62d('0x11c')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x15e')});db[_0xa62d('0xfb')][_0xa62d('0x119')](db[_0xa62d('0xf9')],{'onDelete':_0xa62d('0x10f'),'as':_0xa62d('0x16f'),'foreignKey':_0xa62d('0x1e9')});db[_0xa62d('0xfb')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'as':_0xa62d('0x168'),'foreignKey':'WhatsappAccountId'});db[_0xa62d('0xfd')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{});db[_0xa62d('0xfd')]['belongsTo'](db['CmList'],{'as':_0xa62d('0x165'),'foreignKey':_0xa62d('0x166')});db['WhatsappQueueReport'][_0xa62d('0x119')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xa62d('0xfd')]['belongsTo'](db[_0xa62d('0xf9')],{});db[_0xa62d('0xfd')][_0xa62d('0x119')](db[_0xa62d('0x101')],{});db[_0xa62d('0xfd')][_0xa62d('0x119')](db['WhatsappMessage'],{});db[_0xa62d('0xfd')][_0xa62d('0x119')](db['User'],{});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0xfb')],{});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0xf9')],{});db[_0xa62d('0xff')]['belongsTo'](db[_0xa62d('0xf6')],{'foreignKey':_0xa62d('0x1ea'),'as':_0xa62d('0x1d1')});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0xf6')],{'foreignKey':_0xa62d('0x1eb'),'as':'ToAccount'});db[_0xa62d('0xff')][_0xa62d('0x119')](db[_0xa62d('0x101')],{'foreignKey':_0xa62d('0x1ec'),'as':_0xa62d('0x1d9')});db['WhatsappTransferReport']['belongsTo'](db[_0xa62d('0x14')],{'foreignKey':_0xa62d('0x1d6'),'as':'FromAgent'});db[_0xa62d('0xff')][_0xa62d('0x119')](db['User'],{'foreignKey':'ToUserId','as':_0xa62d('0x1d2')});db[_0xa62d('0x101')][_0xa62d('0x11e')](db[_0xa62d('0x14')],{'as':_0xa62d('0x153'),'through':_0xa62d('0x32'),'foreignKey':_0xa62d('0x1ed')});db[_0xa62d('0x101')]['belongsToMany'](db['Team'],{'through':_0xa62d('0x1ee'),'as':_0xa62d('0x154')});db[_0xa62d('0x102')][_0xa62d('0x108')](db['MailServerIn'],{'as':'Imap','onDelete':_0xa62d('0x160')});db['CloudProvider']['hasOne'](db[_0xa62d('0x36')],{'as':_0xa62d('0x161'),'onDelete':_0xa62d('0x160')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xe189=['OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','Template','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../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','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SquareReport','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','cascade','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','UserId','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','VoiceContext','Applications','Sounds','VoiceQueueId','Hoppers','CmHopperFinal','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','List','Team','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','Dashboard','DashboardItem','Items','FaxAccountId','Answers','Exntensions','ListId','user_has_fax_accounts','FaxMessage','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','Interactions','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','Agent','ChatQueueId','Website','TagId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','ChatGroupId','Members','CompanyId','HopperHistories','Company','cm_contact_has_tags','Queue','OwnerId','CampaignId','Automation','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','Subjects','Descriptions','DescriptionId','AccountId','Subject','SubjectId','Description','FieldId','VariableId','SugarcrmConfiguration','DeskAccount','int_desk_configuration_has_tags','Field','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','VtigerConfiguration','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','SmsQueueReport','ProjectId','JscriptyQuestionReport','TeamVoiceQueue','team_has_fax_queues','team_has_whatsapp_queues','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToAccount','FromChatWebsiteId','FromAgent','ToQueue','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','Queues','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','motion2','name','database','options','username','../api/user/user.model','VoiceChanSpy','import','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model'];(function(_0x284706,_0x534975){var _0x288ce4=function(_0x3c7099){while(--_0x3c7099){_0x284706['push'](_0x284706['shift']());}};_0x288ce4(++_0x534975);}(_0xe189,0x194));var _0x9e18=function(_0x3e141f,_0x2c7976){_0x3e141f=_0x3e141f-0x0;var _0x57bc6f=_0xe189[_0x3e141f];return _0x57bc6f;};'use strict';var config=require(_0x9e18('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x9e18('0x1'));var timezone=jstz[_0x9e18('0x2')]();config[_0x9e18('0x3')]=_[_0x9e18('0x4')](config['sequelize'],{'database':'motion2','username':_0x9e18('0x5'),'password':_0x9e18('0x6'),'options':{'host':_0x9e18('0x7'),'port':0xcea,'dialect':_0x9e18('0x8'),'dialectOptions':{'charset':_0x9e18('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x9e18('0xa'),'collate':_0x9e18('0xb')}}});config[_0x9e18('0xc')]=_['defaultsDeep'](config[_0x9e18('0xc')],{'database':_0x9e18('0xd'),'username':_0x9e18('0x5'),'password':'xC@LL1234','options':{'host':_0x9e18('0x7'),'port':0xcea,'dialect':_0x9e18('0x8'),'dialectOptions':{'charset':_0x9e18('0x9')},'logging':![],'timezone':timezone[_0x9e18('0xe')](),'define':{'charset':_0x9e18('0xa'),'collate':_0x9e18('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9e18('0x3')][_0x9e18('0xf')],config[_0x9e18('0x3')]['username'],config[_0x9e18('0x3')]['password'],config[_0x9e18('0x3')][_0x9e18('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x9e18('0xf')],config[_0x9e18('0xc')][_0x9e18('0x11')],config[_0x9e18('0xc')]['password'],config[_0x9e18('0xc')]['options'])};db['User']=db[_0x9e18('0x3')]['import'](_0x9e18('0x12'));db[_0x9e18('0x13')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/voiceContext/voiceContext.model');db[_0x9e18('0x15')]=db['sequelize'][_0x9e18('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x9e18('0x16')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x17'));db[_0x9e18('0x18')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x19'));db[_0x9e18('0x1a')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x1b'));db[_0x9e18('0x1c')]=db['sequelize'][_0x9e18('0x14')]('../api/screenRecording/screenRecording.model');db[_0x9e18('0x1d')]=db['sequelize'][_0x9e18('0x14')]('../api/voiceMail/voiceMail.model');db[_0x9e18('0x1e')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x1f'));db['VoiceCallReport']=db['sequelize'][_0x9e18('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x9e18('0x20')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x21'));db[_0x9e18('0x22')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x23'));db[_0x9e18('0x24')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x9e18('0x25')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x26'));db['Trunk']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x27'));db[_0x9e18('0x28')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x9e18('0x29')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x2a'));db[_0x9e18('0x2b')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x2c'));db[_0x9e18('0x2d')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x2e'));db['UserMailQueue']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x2f'));db[_0x9e18('0x30')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x31'));db[_0x9e18('0x32')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x33'));db['UserOpenchannelQueue']=db[_0x9e18('0x3')]['import'](_0x9e18('0x34'));db[_0x9e18('0x35')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x36'));db[_0x9e18('0x37')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x38'));db[_0x9e18('0x39')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x3a'));db[_0x9e18('0x3b')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x3c'));db[_0x9e18('0x3d')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x3e'));db[_0x9e18('0x3f')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x40'));db[_0x9e18('0x41')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x42'));db[_0x9e18('0x43')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x44'));db[_0x9e18('0x45')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x46'));db[_0x9e18('0x47')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x48'));db['Dashboard']=db['sequelize']['import'](_0x9e18('0x49'));db['DashboardItem']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x4a'));db[_0x9e18('0x4b')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x4c'));db[_0x9e18('0x4d')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/faxApplication/faxApplication.model');db[_0x9e18('0x4e')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x4f'));db['FaxMessage']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x50'));db[_0x9e18('0x51')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x52'));db[_0x9e18('0x53')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x54'));db['SmsAccount']=db['sequelize']['import']('../api/smsAccount/smsAccount.model');db[_0x9e18('0x55')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x56'));db[_0x9e18('0x57')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x58'));db[_0x9e18('0x59')]=db[_0x9e18('0x3')]['import']('../api/smsMessage/smsMessage.model');db[_0x9e18('0x5a')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x5b'));db[_0x9e18('0x5c')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x5d'));db['OpenchannelApplication']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x5e'));db[_0x9e18('0x5f')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x60'));db[_0x9e18('0x61')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x62'));db[_0x9e18('0x63')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x64'));db['ChatWebsite']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x65'));db[_0x9e18('0x66')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x67'));db[_0x9e18('0x68')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x69'));db[_0x9e18('0x6a')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x6b'));db[_0x9e18('0x6c')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x6d'));db[_0x9e18('0x6e')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x6f'));db[_0x9e18('0x70')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x71'));db[_0x9e18('0x72')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x73'));db[_0x9e18('0x74')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x75'));db[_0x9e18('0x76')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x77'));db[_0x9e18('0x78')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x79'));db[_0x9e18('0x7a')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x7b'));db[_0x9e18('0x7c')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x7d'));db['CmHopperFinal']=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x9e18('0x7e')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x7f'));db[_0x9e18('0x80')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x81'));db[_0x9e18('0x82')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x83'));db[_0x9e18('0x84')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x85'));db['Automation']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x86'));db[_0x9e18('0x87')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x88'));db[_0x9e18('0x89')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x8a'));db[_0x9e18('0x8b')]=db[_0x9e18('0x3')]['import']('../api/condition/condition.model');db[_0x9e18('0x8c')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x8d'));db[_0x9e18('0x8e')]=db[_0x9e18('0x3')]['import']('../api/pause/pause.model');db[_0x9e18('0x8f')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x90'));db[_0x9e18('0x91')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x92'));db['Schedule']=db['sequelize']['import']('../api/schedule/schedule.model');db[_0x9e18('0x93')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x94'));db[_0x9e18('0x95')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/tag/tag.model');db[_0x9e18('0x96')]=db[_0x9e18('0x3')]['import']('../api/template/template.model');db['Trigger']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x97'));db[_0x9e18('0x98')]=db[_0x9e18('0x3')]['import']('../api/variable/variable.model');db[_0x9e18('0x99')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x9a'));db['IntegrationReport']=db['sequelize']['import'](_0x9e18('0x9b'));db['AnalyticCustomReport']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x9c'));db[_0x9e18('0x9d')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x9e'));db[_0x9e18('0x9f')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xa0'));db['AnalyticMetric']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xa1'));db[_0x9e18('0xa2')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x9e18('0xa3')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x9e18('0xa4')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xa5'));db['SalesforceConfiguration']=db['sequelize']['import'](_0x9e18('0xa6'));db[_0x9e18('0xa7')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xa8'));db[_0x9e18('0xa9')]=db['sequelize']['import'](_0x9e18('0xaa'));db['SugarcrmConfiguration']=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x9e18('0xab')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xac'));db['DeskAccount']=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x9e18('0xad')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xae'));db[_0x9e18('0xaf')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xb0'));db[_0x9e18('0xb1')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xb2'));db[_0x9e18('0xb3')]=db['sequelize']['import'](_0x9e18('0xb4'));db[_0x9e18('0xb5')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xb6'));db[_0x9e18('0xb7')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x9e18('0xb8')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xb9'));db['FreshdeskAccount']=db[_0x9e18('0x3')]['import'](_0x9e18('0xba'));db[_0x9e18('0xbb')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xbc'));db[_0x9e18('0xbd')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x9e18('0xbe')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xbf'));db['VtigerConfiguration']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xc0'));db[_0x9e18('0xc1')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xc2'));db[_0x9e18('0xc3')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xc4'));db[_0x9e18('0xc5')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x9e18('0xc6')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xc7'));db[_0x9e18('0xc8')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xc9'));db[_0x9e18('0xca')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xcb'));db['Dynamics365Field']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xcc'));db[_0x9e18('0xcd')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xce'));db['FreshsalesField']=db[_0x9e18('0x3')]['import'](_0x9e18('0xcf'));db['Integration']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x9a'));db[_0x9e18('0xd0')]=db[_0x9e18('0x3')]['import']('../api/network/network.model');db[_0x9e18('0xd1')]=db['sequelize']['import'](_0x9e18('0xd2'));db[_0x9e18('0xd3')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xd4'));db[_0x9e18('0xd5')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xd6'));db['JscriptyQuestionReport']=db[_0x9e18('0x3')]['import'](_0x9e18('0xd7'));db[_0x9e18('0xd8')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x9e18('0x3')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x9e18('0xd9')]=db[_0x9e18('0x3')]['import']('../api/squareReport/squareReport.model');db[_0x9e18('0xda')]=db[_0x9e18('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0x9e18('0xdb')]=db['sequelize'][_0x9e18('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0x9e18('0xdc')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xdd'));db['SquareOdbc']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xde'));db[_0x9e18('0xdf')]=db['sequelize']['import']('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x9e18('0x3')]['import'](_0x9e18('0xe0'));db[_0x9e18('0xe1')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xe2'));db['Team']=db['sequelize']['import'](_0x9e18('0xe3'));db[_0x9e18('0xe4')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xe5'));db[_0x9e18('0xe6')]=db['sequelize']['import'](_0x9e18('0xe7'));db[_0x9e18('0xe8')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xe9'));db[_0x9e18('0xea')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xeb'));db[_0x9e18('0xec')]=db[_0x9e18('0x3')]['import'](_0x9e18('0xed'));db['MailTransferReport']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xee'));db[_0x9e18('0xef')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x9e18('0xf0')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xf1'));db[_0x9e18('0xf2')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x9e18('0xf3')]=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/smsTransferReport/smsTransferReport.model');db[_0x9e18('0xf4')]=db['sequelize']['import']('../api/cmList/cmList.model');db[_0x9e18('0xf5')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xf6'));db[_0x9e18('0xf7')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xf8'));db['UserProfileSection']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xf9'));db[_0x9e18('0xfa')]=db['sequelize']['import'](_0x9e18('0xfb'));db[_0x9e18('0xfc')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0xfd'));db[_0x9e18('0xfe')]=db['sequelize'][_0x9e18('0x14')](_0x9e18('0xff'));db['WhatsappApplication']=db['sequelize'][_0x9e18('0x14')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db['sequelize'][_0x9e18('0x14')](_0x9e18('0x100'));db['WhatsappMessage']=db[_0x9e18('0x3')][_0x9e18('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0x9e18('0x101')]=db[_0x9e18('0x3')]['import'](_0x9e18('0x102'));db[_0x9e18('0x103')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x104'));db[_0x9e18('0x105')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x106'));db[_0x9e18('0x107')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x108'));db['TeamVoiceQueue']=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x109'));db[_0x9e18('0x10a')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x10b'));db[_0x9e18('0x10c')]=db[_0x9e18('0x3')][_0x9e18('0x14')](_0x9e18('0x10d'));db[_0x9e18('0x10e')][_0x9e18('0x10f')](db[_0x9e18('0x1d')],{'as':'VoiceMail','onDelete':_0x9e18('0x110'),'foreignKey':'UserId'});db[_0x9e18('0x10e')]['hasMany'](db[_0x9e18('0x1a')],{'as':_0x9e18('0x111'),'foreignKey':'UserId'});db['User'][_0x9e18('0x112')](db[_0x9e18('0x29')],{'as':_0x9e18('0x113'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x9e18('0x15')],{'as':_0x9e18('0x114'),'onDelete':_0x9e18('0x110'),'hooks':!![]});db[_0x9e18('0x10e')][_0x9e18('0x112')](db['CmHopperFinal'],{'as':_0x9e18('0x115'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x10e')][_0x9e18('0x112')](db['CmHopperHistory'],{'as':_0x9e18('0x117'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x10e')][_0x9e18('0x112')](db[_0x9e18('0x80')],{'as':'ReportAgentPreview','foreignKey':_0x9e18('0x116')});db[_0x9e18('0x10e')][_0x9e18('0x112')](db['OpenchannelInteraction'],{'as':_0x9e18('0x118'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x10e')]['hasMany'](db[_0x9e18('0x6a')],{'as':_0x9e18('0x119'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x10e')][_0x9e18('0x112')](db[_0x9e18('0x57')],{'as':_0x9e18('0x11a'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x9e18('0x4e')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x9e18('0x10e')]['hasMany'](db[_0x9e18('0x41')],{'as':'MailInteractions','foreignKey':_0x9e18('0x116')});db['User']['hasMany'](db['WhatsappInteraction'],{'as':_0x9e18('0x11b'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x10e')][_0x9e18('0x112')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0x9e18('0x11c')});db[_0x9e18('0x10e')][_0x9e18('0x11d')](db[_0x9e18('0xf7')],{'as':_0x9e18('0xf7'),'foreignKey':_0x9e18('0x11e')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x72')],{'as':_0x9e18('0x120'),'through':_0x9e18('0x121')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x9e18('0x122'),'through':_0x9e18('0x123')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db['CmList'],{'as':_0x9e18('0x124'),'through':_0x9e18('0x125')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db['Team'],{'through':_0x9e18('0x126')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x41')],{'as':_0x9e18('0x127'),'through':_0x9e18('0x128')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x6a')],{'as':_0x9e18('0x119'),'through':'user_has_chat_interactions'});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x4e')],{'as':_0x9e18('0x129'),'through':_0x9e18('0x12a')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x57')],{'as':_0x9e18('0x11a'),'through':_0x9e18('0x12b')});db['User']['belongsToMany'](db[_0x9e18('0x5f')],{'as':_0x9e18('0x118'),'through':_0x9e18('0x12c')});db[_0x9e18('0x10e')]['belongsToMany'](db[_0x9e18('0x12d')],{'as':_0x9e18('0x11b'),'through':_0x9e18('0x12e')});db['User'][_0x9e18('0x11f')](db['VoiceQueue'],{'as':_0x9e18('0x12f'),'through':_0x9e18('0x2b'),'required':![]});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0xf5')],{'as':_0x9e18('0x130'),'through':_0x9e18('0x10c'),'required':![]});db['User']['belongsToMany'](db[_0x9e18('0x3d')],{'as':_0x9e18('0x131'),'through':_0x9e18('0x132'),'required':![]});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x70')],{'as':_0x9e18('0x133'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x51')],{'as':_0x9e18('0x134'),'through':_0x9e18('0x30'),'required':![]});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x5a')],{'as':_0x9e18('0x135'),'through':_0x9e18('0x32'),'required':![]});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x63')],{'as':_0x9e18('0x136'),'through':_0x9e18('0x137'),'required':![]});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x105')],{'as':_0x9e18('0x138'),'through':_0x9e18('0x35'),'required':![]});db[_0x9e18('0x10e')]['belongsToMany'](db[_0x9e18('0xf4')],{'through':_0x9e18('0x125')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x139')],{'as':_0x9e18('0x13a'),'through':_0x9e18('0x13b')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db['FaxAccount'],{'as':_0x9e18('0x13c'),'through':'user_has_fax_accounts'});db[_0x9e18('0x10e')]['belongsToMany'](db[_0x9e18('0x3b')],{'as':_0x9e18('0x13d'),'through':_0x9e18('0x13e')});db[_0x9e18('0x10e')]['belongsToMany'](db[_0x9e18('0x5c')],{'as':_0x9e18('0x13f'),'through':_0x9e18('0x140')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db[_0x9e18('0x141')],{'as':_0x9e18('0x142'),'through':_0x9e18('0x143')});db[_0x9e18('0x10e')][_0x9e18('0x11f')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0x9e18('0x144')});db[_0x9e18('0x10e')]['belongsToMany'](db['SquareProject'],{'as':_0x9e18('0x145'),'through':_0x9e18('0x146')});db[_0x9e18('0x13')][_0x9e18('0x112')](db[_0x9e18('0x15')],{'as':_0x9e18('0x147'),'onDelete':_0x9e18('0x110'),'foreignKey':'ChanSpyId'});db[_0x9e18('0x148')][_0x9e18('0x112')](db['VoiceExtension'],{'onDelete':_0x9e18('0x110')});db[_0x9e18('0x15')][_0x9e18('0x112')](db[_0x9e18('0x15')],{'as':_0x9e18('0x149'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x16')]['belongsToMany'](db[_0x9e18('0x93')],{'as':_0x9e18('0x14a'),'through':'moh_has_sounds'});db[_0x9e18('0x18')]['hasMany'](db[_0x9e18('0x29')],{'as':'Members','foreignKey':_0x9e18('0x14b')});db[_0x9e18('0x18')][_0x9e18('0x112')](db[_0x9e18('0x7a')],{'as':_0x9e18('0x14c'),'foreignKey':_0x9e18('0x14b')});db[_0x9e18('0x18')][_0x9e18('0x112')](db[_0x9e18('0x14d')],{'as':'HopperFinals','foreignKey':_0x9e18('0x14b')});db[_0x9e18('0x18')][_0x9e18('0x112')](db[_0x9e18('0x7e')],{'as':'HopperHistories','foreignKey':_0x9e18('0x14b')});db['VoiceQueue'][_0x9e18('0x112')](db[_0x9e18('0x80')],{'as':_0x9e18('0x80'),'foreignKey':_0x9e18('0x14b')});db[_0x9e18('0x18')][_0x9e18('0x112')](db[_0x9e18('0x7c')],{'as':_0x9e18('0x14e'),'foreignKey':'VoiceQueueId'});db[_0x9e18('0x18')][_0x9e18('0x112')](db[_0x9e18('0xd8')],{'as':_0x9e18('0x14f'),'foreignKey':_0x9e18('0x14b')});db[_0x9e18('0x18')][_0x9e18('0x11d')](db[_0x9e18('0x150')],{'as':_0x9e18('0x150'),'foreignKey':_0x9e18('0x151')});db['VoiceQueue'][_0x9e18('0x11d')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x9e18('0x152')});db[_0x9e18('0x18')]['belongsTo'](db[_0x9e18('0x8c')],{'as':_0x9e18('0x8c'),'foreignKey':_0x9e18('0x153')});db[_0x9e18('0x18')][_0x9e18('0x11d')](db['Pause'],{'as':_0x9e18('0x154'),'foreignKey':_0x9e18('0x155')});db['VoiceQueue'][_0x9e18('0x11f')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x124'),'through':_0x9e18('0x156')});db[_0x9e18('0x18')]['belongsToMany'](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':'UserVoiceQueue'});db[_0x9e18('0x18')][_0x9e18('0x11f')](db['Team'],{'as':_0x9e18('0x158'),'through':'TeamVoiceQueue'});db[_0x9e18('0x18')]['belongsToMany'](db[_0x9e18('0xf4')],{'as':_0x9e18('0x159'),'through':_0x9e18('0x15a')});db[_0x9e18('0x1a')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x9e18('0x116')});db[_0x9e18('0x1c')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x10e'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x1d')]['hasMany'](db['VoiceMailMessage'],{'as':_0x9e18('0x15b'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x15c'),'sourceKey':_0x9e18('0x15d')});db[_0x9e18('0x1e')][_0x9e18('0x11d')](db[_0x9e18('0x1d')],{'foreignKey':_0x9e18('0x15c'),'targetKey':_0x9e18('0x15d')});db[_0x9e18('0x15e')][_0x9e18('0x112')](db[_0x9e18('0x24')],{'as':'QueueCalls','foreignKey':_0x9e18('0x15f'),'constraints':![]});db[_0x9e18('0x15e')][_0x9e18('0x112')](db[_0x9e18('0x22')],{'as':'AgentReports','foreignKey':_0x9e18('0x15f'),'constraints':![]});db[_0x9e18('0x15e')][_0x9e18('0x11d')](db['User'],{'as':_0x9e18('0x10e'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x15e')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db[_0x9e18('0x37')][_0x9e18('0x11d')](db[_0x9e18('0x3b')],{'as':_0x9e18('0x3b'),'foreignKey':_0x9e18('0x162')});db[_0x9e18('0x37')]['belongsTo'](db[_0x9e18('0x107')],{'as':_0x9e18('0x107'),'foreignKey':_0x9e18('0x163'),'onDelete':_0x9e18('0x164')});db[_0x9e18('0x39')][_0x9e18('0x11d')](db[_0x9e18('0x3b')],{'as':'MailAccount','foreignKey':_0x9e18('0x162')});db[_0x9e18('0x39')][_0x9e18('0x11d')](db[_0x9e18('0x107')],{'as':_0x9e18('0x107'),'foreignKey':'CloudProviderId','onDelete':_0x9e18('0x164')});db[_0x9e18('0x3b')][_0x9e18('0x10f')](db[_0x9e18('0x37')],{'as':_0x9e18('0x165'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x3b')]['hasOne'](db[_0x9e18('0x39')],{'as':_0x9e18('0x166'),'onDelete':'cascade'});db[_0x9e18('0x3b')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':_0x9e18('0x167'),'foreignKey':_0x9e18('0x162'),'onDelete':'cascade'});db[_0x9e18('0x3b')][_0x9e18('0x112')](db[_0x9e18('0x87')],{'as':'Answers','foreignKey':_0x9e18('0x162')});db[_0x9e18('0x3b')]['hasMany'](db[_0x9e18('0x43')],{'as':_0x9e18('0x15b'),'foreignKey':_0x9e18('0x162')});db[_0x9e18('0x3b')]['hasMany'](db[_0x9e18('0x41')],{'as':'Interactions'});db[_0x9e18('0x3b')][_0x9e18('0x112')](db['MailApplication'],{'as':_0x9e18('0x149')});db['MailAccount'][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x168'),'foreignKey':'ListId'});db['MailAccount']['belongsTo'](db[_0x9e18('0x96')],{'as':_0x9e18('0x96'),'foreignKey':'TemplateId'});db[_0x9e18('0x3b')][_0x9e18('0x11d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x9e18('0x155')});db[_0x9e18('0x3b')]['belongsToMany'](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':_0x9e18('0x13e')});db[_0x9e18('0x3d')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':_0x9e18('0x132')});db[_0x9e18('0x3d')][_0x9e18('0x11f')](db[_0x9e18('0x169')],{'through':_0x9e18('0x16a'),'as':'Teams'});db['MailInteraction'][_0x9e18('0x112')](db['MailMessage'],{'as':_0x9e18('0x15b'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x16b')});db[_0x9e18('0x41')]['belongsTo'](db[_0x9e18('0x3b')],{'as':_0x9e18('0x16c'),'foreignKey':'MailAccountId'});db[_0x9e18('0x41')][_0x9e18('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x9e18('0x41')]['belongsTo'](db[_0x9e18('0x10e')],{'as':_0x9e18('0x16d'),'foreignKey':'UserId'});db[_0x9e18('0x41')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':'mail_interaction_has_tags','as':_0x9e18('0x16e')});db['MailInteraction'][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x16f'),'as':_0x9e18('0x170')});db['MailInteraction'][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x171'),'through':_0x9e18('0x128'),'foreignKey':'MailInteractionId'});db[_0x9e18('0x43')][_0x9e18('0x112')](db['Attachment'],{'as':'Attachments','onDelete':_0x9e18('0x110')});db[_0x9e18('0x43')]['belongsTo'](db[_0x9e18('0x10e')],{'as':_0x9e18('0x10e')});db[_0x9e18('0x43')]['belongsTo'](db['CmContact'],{'onDelete':_0x9e18('0x110'),'as':_0x9e18('0x160')});db['MailMessage']['belongsTo'](db[_0x9e18('0x41')],{'as':_0x9e18('0x172'),'foreignKey':'MailInteractionId'});db['MailMessage']['belongsTo'](db['MailAccount'],{'as':_0x9e18('0x16c'),'foreignKey':'MailAccountId'});db[_0x9e18('0x43')][_0x9e18('0x11d')](db[_0x9e18('0x139')],{'as':_0x9e18('0x139'),'foreignKey':_0x9e18('0x173')});db[_0x9e18('0x43')][_0x9e18('0x11d')](db[_0x9e18('0x6e')],{'as':_0x9e18('0x6e'),'foreignKey':_0x9e18('0x174')});db[_0x9e18('0x45')]['belongsTo'](db[_0x9e18('0x10e')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x9e18('0x3d')],{'onDelete':_0x9e18('0x164')});db[_0x9e18('0x45')][_0x9e18('0x11d')](db['MailAccount'],{'onDelete':_0x9e18('0x164')});db[_0x9e18('0x45')][_0x9e18('0x11d')](db[_0x9e18('0x8c')],{'onDelete':_0x9e18('0x164'),'foreignKey':'IntervalId'});db[_0x9e18('0x45')]['belongsTo'](db[_0x9e18('0x95')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x9e18('0x47')][_0x9e18('0x11d')](db[_0x9e18('0x3b')],{});db[_0x9e18('0x47')][_0x9e18('0x11d')](db['CmList'],{'as':_0x9e18('0x168'),'foreignKey':'ListId'});db[_0x9e18('0x47')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':'Contact','foreignKey':_0x9e18('0x161')});db[_0x9e18('0x47')]['belongsTo'](db['MailInteraction'],{});db[_0x9e18('0x47')][_0x9e18('0x11d')](db['MailMessage'],{});db[_0x9e18('0x47')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{});db['MailQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0x3d')],{});db[_0x9e18('0x175')][_0x9e18('0x112')](db[_0x9e18('0x176')],{'as':_0x9e18('0x177'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x4b')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':'Dispositions','foreignKey':_0x9e18('0x178'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x4b')][_0x9e18('0x112')](db[_0x9e18('0x87')],{'as':_0x9e18('0x179'),'foreignKey':_0x9e18('0x178')});db[_0x9e18('0x4b')][_0x9e18('0x112')](db[_0x9e18('0x4e')],{'as':'Interactions'});db['FaxAccount'][_0x9e18('0x112')](db[_0x9e18('0x4d')],{'as':'Applications'});db[_0x9e18('0x4b')][_0x9e18('0x112')](db[_0x9e18('0x15')],{'as':_0x9e18('0x17a'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x4b')][_0x9e18('0x112')](db['FaxMessage'],{'as':_0x9e18('0x15b')});db[_0x9e18('0x4b')][_0x9e18('0x11d')](db[_0x9e18('0x150')],{'as':'Trunk'});db[_0x9e18('0x4b')][_0x9e18('0x11d')](db['CmList'],{'as':_0x9e18('0x168'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0x4b')][_0x9e18('0x11d')](db[_0x9e18('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0x9e18('0x155')});db[_0x9e18('0x4b')][_0x9e18('0x11f')](db['User'],{'as':_0x9e18('0x157'),'through':_0x9e18('0x17c')});db[_0x9e18('0x4d')]['belongsTo'](db['User'],{'onDelete':_0x9e18('0x164')});db[_0x9e18('0x4d')][_0x9e18('0x11d')](db[_0x9e18('0x51')],{'onDelete':_0x9e18('0x164')});db['FaxApplication'][_0x9e18('0x11d')](db[_0x9e18('0x4b')],{'onDelete':_0x9e18('0x164')});db[_0x9e18('0x4d')][_0x9e18('0x11d')](db[_0x9e18('0x95')],{'onDelete':_0x9e18('0x164'),'foreignKey':'TagId'});db[_0x9e18('0x4e')][_0x9e18('0x112')](db[_0x9e18('0x17d')],{'as':_0x9e18('0x15b'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x17e')});db[_0x9e18('0x4e')][_0x9e18('0x11d')](db[_0x9e18('0x4b')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x178')});db[_0x9e18('0x4e')]['belongsTo'](db['CmContact'],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db[_0x9e18('0x4e')]['belongsTo'](db[_0x9e18('0x10e')],{'as':_0x9e18('0x16d'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x4e')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x17f'),'as':'Tags'});db[_0x9e18('0x4e')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x17f'),'as':_0x9e18('0x170')});db['FaxInteraction'][_0x9e18('0x11f')](db['User'],{'as':_0x9e18('0x171'),'through':_0x9e18('0x12a'),'foreignKey':_0x9e18('0x17e')});db[_0x9e18('0x17d')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'onDelete':_0x9e18('0x110'),'as':_0x9e18('0x10e')});db[_0x9e18('0x17d')][_0x9e18('0x11d')](db[_0x9e18('0x4e')],{'as':_0x9e18('0x172'),'foreignKey':'FaxInteractionId'});db[_0x9e18('0x17d')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'onDelete':_0x9e18('0x110'),'as':'Contact'});db[_0x9e18('0x17d')]['belongsTo'](db[_0x9e18('0xea')],{'as':_0x9e18('0xea'),'foreignKey':'AttachmentId'});db[_0x9e18('0x17d')]['belongsTo'](db['FaxAccount'],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x178')});db[_0x9e18('0x51')][_0x9e18('0x11f')](db['User'],{'as':'Agents','through':_0x9e18('0x30')});db[_0x9e18('0x51')][_0x9e18('0x11f')](db[_0x9e18('0x169')],{'through':'team_has_fax_queues','as':_0x9e18('0x158')});db['FaxQueueReport']['belongsTo'](db[_0x9e18('0x4b')],{});db[_0x9e18('0x53')][_0x9e18('0x11d')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x9e18('0x53')]['belongsTo'](db[_0x9e18('0x78')],{'as':'Contact','foreignKey':'ContactId'});db[_0x9e18('0x53')][_0x9e18('0x11d')](db[_0x9e18('0x4e')],{});db[_0x9e18('0x53')]['belongsTo'](db[_0x9e18('0x17d')],{});db[_0x9e18('0x53')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{});db['FaxQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0x51')],{});db[_0x9e18('0x141')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':'Dispositions','foreignKey':_0x9e18('0x180'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x141')][_0x9e18('0x112')](db[_0x9e18('0x87')],{'as':_0x9e18('0x179'),'foreignKey':_0x9e18('0x180')});db[_0x9e18('0x141')][_0x9e18('0x112')](db[_0x9e18('0x59')],{'as':_0x9e18('0x15b'),'foreignKey':_0x9e18('0x180')});db[_0x9e18('0x141')][_0x9e18('0x112')](db[_0x9e18('0x57')],{'as':'Interactions'});db[_0x9e18('0x141')][_0x9e18('0x112')](db[_0x9e18('0x55')],{'as':_0x9e18('0x149')});db[_0x9e18('0x141')][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':'List','foreignKey':_0x9e18('0x17b')});db['SmsAccount']['belongsTo'](db[_0x9e18('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0x9e18('0x155')});db[_0x9e18('0x141')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':_0x9e18('0x143')});db[_0x9e18('0x55')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'onDelete':'restrict'});db[_0x9e18('0x55')][_0x9e18('0x11d')](db[_0x9e18('0x5a')],{'onDelete':'restrict'});db[_0x9e18('0x55')]['belongsTo'](db[_0x9e18('0x141')],{'onDelete':_0x9e18('0x164')});db[_0x9e18('0x55')]['belongsTo'](db[_0x9e18('0x8c')],{'onDelete':'restrict','foreignKey':_0x9e18('0x153')});db['SmsApplication'][_0x9e18('0x11d')](db[_0x9e18('0x95')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x9e18('0x57')][_0x9e18('0x112')](db[_0x9e18('0x59')],{'as':_0x9e18('0x15b'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x181')});db[_0x9e18('0x57')][_0x9e18('0x11d')](db[_0x9e18('0x141')],{'as':'Account','foreignKey':_0x9e18('0x180')});db['SmsInteraction'][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':'ContactId'});db[_0x9e18('0x57')][_0x9e18('0x11d')](db['User'],{'as':_0x9e18('0x16d'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x57')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x182'),'as':_0x9e18('0x16e')});db[_0x9e18('0x57')]['belongsToMany'](db['Tag'],{'through':_0x9e18('0x182'),'as':_0x9e18('0x170')});db[_0x9e18('0x57')][_0x9e18('0x11f')](db['User'],{'as':_0x9e18('0x171'),'through':_0x9e18('0x12b'),'foreignKey':_0x9e18('0x181')});db[_0x9e18('0x59')][_0x9e18('0x11d')](db['User'],{'as':_0x9e18('0x10e')});db[_0x9e18('0x59')][_0x9e18('0x11d')](db['CmContact'],{'onDelete':_0x9e18('0x110'),'as':'Contact'});db[_0x9e18('0x59')][_0x9e18('0x11d')](db[_0x9e18('0x57')],{'onDelete':_0x9e18('0x110'),'as':_0x9e18('0x172'),'foreignKey':_0x9e18('0x181')});db[_0x9e18('0x59')][_0x9e18('0x11d')](db[_0x9e18('0x141')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x180')});db[_0x9e18('0x5a')]['belongsToMany'](db['User'],{'as':_0x9e18('0x157'),'through':_0x9e18('0x32'),'foreignKey':_0x9e18('0x183')});db[_0x9e18('0x5a')][_0x9e18('0x11f')](db[_0x9e18('0x169')],{'through':_0x9e18('0x184'),'as':_0x9e18('0x158')});db['OpenchannelAccount'][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':_0x9e18('0x167'),'foreignKey':'OpenchannelAccountId','onDelete':_0x9e18('0x110')});db[_0x9e18('0x5c')][_0x9e18('0x112')](db[_0x9e18('0x87')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x9e18('0x5c')][_0x9e18('0x112')](db['OpenchannelInteraction'],{'as':_0x9e18('0x185'),'foreignKey':_0x9e18('0x186')});db['OpenchannelAccount'][_0x9e18('0x112')](db[_0x9e18('0x61')],{'as':_0x9e18('0x15b'),'foreignKey':_0x9e18('0x186')});db[_0x9e18('0x5c')][_0x9e18('0x112')](db[_0x9e18('0x187')],{'as':_0x9e18('0x149'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x168'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0x5c')][_0x9e18('0x11d')](db[_0x9e18('0x8e')],{'as':_0x9e18('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9e18('0x5c')][_0x9e18('0x11f')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x9e18('0x187')]['belongsTo'](db[_0x9e18('0x10e')],{'onDelete':_0x9e18('0x164')});db[_0x9e18('0x187')][_0x9e18('0x11d')](db[_0x9e18('0x63')],{'onDelete':_0x9e18('0x164'),'foreignKey':'OpenchannelQueueId'});db[_0x9e18('0x187')][_0x9e18('0x11d')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x9e18('0x186')});db[_0x9e18('0x187')][_0x9e18('0x11d')](db['Interval'],{'onDelete':_0x9e18('0x164'),'foreignKey':_0x9e18('0x153')});db['OpenchannelApplication'][_0x9e18('0x11d')](db[_0x9e18('0x95')],{'onDelete':_0x9e18('0x164'),'foreignKey':'TagId'});db[_0x9e18('0x5f')][_0x9e18('0x112')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x188')});db[_0x9e18('0x5f')][_0x9e18('0x11d')](db[_0x9e18('0x5c')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x186')});db[_0x9e18('0x5f')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':'ContactId'});db[_0x9e18('0x5f')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'as':'Owner','foreignKey':_0x9e18('0x116')});db['OpenchannelInteraction'][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':'openchannel_interaction_has_tags','as':_0x9e18('0x16e')});db['OpenchannelInteraction']['belongsToMany'](db[_0x9e18('0x95')],{'through':'openchannel_interaction_has_tags','as':_0x9e18('0x170')});db[_0x9e18('0x5f')]['belongsToMany'](db['User'],{'as':'Users','through':_0x9e18('0x12c'),'foreignKey':_0x9e18('0x188')});db[_0x9e18('0x61')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'onDelete':_0x9e18('0x110'),'as':_0x9e18('0x10e')});db[_0x9e18('0x61')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'onDelete':_0x9e18('0x110'),'as':_0x9e18('0x160')});db['OpenchannelMessage'][_0x9e18('0x11d')](db[_0x9e18('0x5f')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x9e18('0x188')});db[_0x9e18('0x61')][_0x9e18('0x11d')](db['Attachment'],{'as':_0x9e18('0xea'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x9e18('0x11d')](db[_0x9e18('0x5c')],{'as':'Account','foreignKey':_0x9e18('0x186')});db[_0x9e18('0x63')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':_0x9e18('0x137'),'foreignKey':_0x9e18('0x189')});db[_0x9e18('0x63')][_0x9e18('0x11f')](db[_0x9e18('0x169')],{'through':_0x9e18('0x18a'),'as':'Teams'});db[_0x9e18('0x139')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':_0x9e18('0x167'),'foreignKey':'ChatWebsiteId','onDelete':_0x9e18('0x110')});db[_0x9e18('0x139')][_0x9e18('0x112')](db[_0x9e18('0x87')],{'as':_0x9e18('0x179'),'foreignKey':_0x9e18('0x173')});db[_0x9e18('0x139')][_0x9e18('0x112')](db[_0x9e18('0x74')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x9e18('0x112')](db[_0x9e18('0x6a')],{'as':'Interactions'});db[_0x9e18('0x139')][_0x9e18('0x112')](db['ChatApplication'],{'as':_0x9e18('0x149')});db[_0x9e18('0x139')][_0x9e18('0x112')](db['ChatMessage'],{'as':_0x9e18('0x15b')});db[_0x9e18('0x139')][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x168'),'foreignKey':'ListId'});db[_0x9e18('0x139')][_0x9e18('0x11d')](db['Interval'],{'as':_0x9e18('0x8c'),'foreignKey':'IntervalId'});db[_0x9e18('0x139')][_0x9e18('0x11d')](db[_0x9e18('0x3b')],{'as':_0x9e18('0x3b'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0x9e18('0x11d')](db['Pause'],{'as':_0x9e18('0x154'),'foreignKey':_0x9e18('0x155')});db[_0x9e18('0x139')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':_0x9e18('0x13b')});db['OpenchannelQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0x5c')],{});db['OpenchannelQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':'List','foreignKey':_0x9e18('0x17b')});db[_0x9e18('0x66')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db[_0x9e18('0x66')][_0x9e18('0x11d')](db['OpenchannelInteraction'],{});db[_0x9e18('0x66')][_0x9e18('0x11d')](db[_0x9e18('0x61')],{});db[_0x9e18('0x66')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{});db[_0x9e18('0x66')]['belongsTo'](db[_0x9e18('0x63')],{});db[_0x9e18('0x68')][_0x9e18('0x11d')](db['User'],{'as':_0x9e18('0x18b'),'foreignKey':_0x9e18('0x116'),'onDelete':_0x9e18('0x164')});db[_0x9e18('0x68')][_0x9e18('0x11d')](db[_0x9e18('0x70')],{'as':'Queue','foreignKey':_0x9e18('0x18c'),'onDelete':'restrict'});db[_0x9e18('0x68')][_0x9e18('0x11d')](db[_0x9e18('0x139')],{'as':_0x9e18('0x18d'),'foreignKey':_0x9e18('0x173'),'onDelete':_0x9e18('0x164')});db['ChatApplication'][_0x9e18('0x11d')](db[_0x9e18('0x95')],{'onDelete':_0x9e18('0x164'),'foreignKey':_0x9e18('0x18e')});db['ChatInteraction'][_0x9e18('0x112')](db['ChatMessage'],{'as':_0x9e18('0x15b'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x18f')});db[_0x9e18('0x6a')][_0x9e18('0x11d')](db['ChatWebsite'],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x173')});db[_0x9e18('0x6a')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':'ContactId'});db[_0x9e18('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x9e18('0x116')});db[_0x9e18('0x6a')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x190'),'as':_0x9e18('0x16e')});db[_0x9e18('0x6a')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x190'),'as':_0x9e18('0x170')});db[_0x9e18('0x6a')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x171'),'through':_0x9e18('0x191'),'foreignKey':_0x9e18('0x18f')});db[_0x9e18('0x6c')]['belongsTo'](db[_0x9e18('0x10e')],{'onDelete':_0x9e18('0x110'),'as':'User'});db[_0x9e18('0x6c')]['belongsTo'](db[_0x9e18('0x78')],{'onDelete':'cascade','as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db[_0x9e18('0x6c')][_0x9e18('0x11d')](db[_0x9e18('0x6a')],{'onDelete':_0x9e18('0x110'),'as':'Interaction','foreignKey':_0x9e18('0x18f')});db[_0x9e18('0x6c')][_0x9e18('0x11d')](db[_0x9e18('0xea')],{'as':_0x9e18('0xea'),'foreignKey':'AttachmentId'});db[_0x9e18('0x6c')][_0x9e18('0x11d')](db[_0x9e18('0x139')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x173')});db[_0x9e18('0x6e')]['hasMany'](db[_0x9e18('0xea')],{'as':_0x9e18('0x192'),'foreignKey':_0x9e18('0x174'),'onDelete':_0x9e18('0x110'),'hooks':!![]});db['ChatOfflineMessage'][_0x9e18('0x11d')](db['CmContact'],{'onDelete':'cascade','as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db['ChatOfflineMessage'][_0x9e18('0x11d')](db[_0x9e18('0x139')],{'as':_0x9e18('0x16c'),'foreignKey':'ChatWebsiteId'});db[_0x9e18('0x70')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x9e18('0x11f')](db[_0x9e18('0x169')],{'through':_0x9e18('0x193'),'as':_0x9e18('0x158')});db['ChatGroup'][_0x9e18('0x112')](db[_0x9e18('0xd3')],{'as':_0x9e18('0x15b'),'foreignKey':_0x9e18('0x194'),'onDelete':'cascade'});db[_0x9e18('0x72')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x195'),'through':_0x9e18('0x121')});db[_0x9e18('0x74')]['belongsTo'](db[_0x9e18('0x139')],{'as':'Website','foreignKey':_0x9e18('0x173')});db[_0x9e18('0x76')][_0x9e18('0x112')](db['CmContact'],{'as':_0x9e18('0x122'),'foreignKey':_0x9e18('0x196')});db[_0x9e18('0x78')][_0x9e18('0x112')](db[_0x9e18('0x7a')],{'as':_0x9e18('0x14c'),'foreignKey':'ContactId'});db[_0x9e18('0x78')][_0x9e18('0x112')](db[_0x9e18('0x14d')],{'as':'HopperFinals','foreignKey':_0x9e18('0x161')});db['CmContact']['hasMany'](db[_0x9e18('0x7e')],{'as':_0x9e18('0x197'),'foreignKey':'ContactId'});db['CmContact'][_0x9e18('0x112')](db[_0x9e18('0x80')],{'as':_0x9e18('0x80'),'foreignKey':_0x9e18('0x161')});db['CmContact'][_0x9e18('0x112')](db['JscriptySessionReport'],{'as':_0x9e18('0x14f'),'foreignKey':_0x9e18('0x161')});db['CmContact'][_0x9e18('0x112')](db['OpenchannelInteraction'],{'as':_0x9e18('0x118'),'foreignKey':_0x9e18('0x161'),'onDelete':_0x9e18('0x164')});db['CmContact'][_0x9e18('0x112')](db[_0x9e18('0x6a')],{'as':_0x9e18('0x119'),'foreignKey':_0x9e18('0x161'),'onDelete':_0x9e18('0x164')});db['CmContact'][_0x9e18('0x112')](db[_0x9e18('0x57')],{'as':_0x9e18('0x11a'),'foreignKey':'ContactId','onDelete':_0x9e18('0x164')});db[_0x9e18('0x78')]['hasMany'](db[_0x9e18('0x4e')],{'as':_0x9e18('0x129'),'foreignKey':_0x9e18('0x161'),'onDelete':'restrict'});db[_0x9e18('0x78')][_0x9e18('0x112')](db['MailInteraction'],{'as':_0x9e18('0x127'),'foreignKey':'ContactId','onDelete':_0x9e18('0x164')});db[_0x9e18('0x78')][_0x9e18('0x11d')](db[_0x9e18('0x76')],{'as':_0x9e18('0x198'),'foreignKey':'CompanyId'});db[_0x9e18('0x78')]['belongsTo'](db[_0x9e18('0xf4')],{'as':'List','foreignKey':_0x9e18('0x17b'),'onDelete':_0x9e18('0x110')});db['CmContact']['belongsToMany'](db[_0x9e18('0x10e')],{'as':_0x9e18('0x171'),'through':'cm_user_has_contacts'});db[_0x9e18('0x78')]['belongsToMany'](db[_0x9e18('0x95')],{'as':_0x9e18('0x16e'),'through':_0x9e18('0x199')});db['CmContact'][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x199'),'as':'ThroughTags'});db['CmHopper'][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161'),'onDelete':'cascade'});db[_0x9e18('0x7a')][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x168'),'foreignKey':'ListId','onDelete':_0x9e18('0x110')});db[_0x9e18('0x7a')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x18b'),'foreignKey':_0x9e18('0x116')});db['CmHopper'][_0x9e18('0x11d')](db[_0x9e18('0x18')],{'as':_0x9e18('0x19a'),'foreignKey':_0x9e18('0x14b'),'onDelete':'cascade'});db['CmHopper'][_0x9e18('0x11d')](db[_0x9e18('0xe6')],{'as':_0x9e18('0xe6'),'foreignKey':'CampaignId','onDelete':_0x9e18('0x110')});db['CmHopper'][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x16d'),'foreignKey':_0x9e18('0x19b')});db[_0x9e18('0x7c')][_0x9e18('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':_0x9e18('0x161'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x7c')]['belongsTo'](db[_0x9e18('0xf4')],{'as':_0x9e18('0x168'),'foreignKey':_0x9e18('0x17b'),'onDelete':_0x9e18('0x110')});db['CmHopperBlack'][_0x9e18('0x11d')](db['VoiceQueue'],{'as':_0x9e18('0x19a'),'foreignKey':'VoiceQueueId','onDelete':_0x9e18('0x110')});db[_0x9e18('0x7c')][_0x9e18('0x11d')](db['Campaign'],{'as':'Campaign','foreignKey':_0x9e18('0x19c'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x19d')][_0x9e18('0x112')](db[_0x9e18('0x8b')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0x9e18('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x9e18('0x19d')]['hasMany'](db[_0x9e18('0x8b')],{'as':{'plural':_0x9e18('0x19f'),'singular':'OneAny'},'foreignKey':_0x9e18('0x1a0'),'onDelete':_0x9e18('0x110'),'hooks':!![]});db['Automation'][_0x9e18('0x112')](db['Action'],{'as':_0x9e18('0x1a1'),'foreignKey':_0x9e18('0x1a2'),'onDelete':_0x9e18('0x110'),'hooks':!![]});db[_0x9e18('0x89')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':_0x9e18('0x167'),'foreignKey':_0x9e18('0x1a3'),'onDelete':'cascade'});db[_0x9e18('0x8c')][_0x9e18('0x112')](db['Interval'],{'as':_0x9e18('0x1a4'),'foreignKey':_0x9e18('0x153'),'onDelete':_0x9e18('0x110'),'hooks':!![],'required':![]});db['Interval'][_0x9e18('0x112')](db['VoiceExtension'],{'as':_0x9e18('0x114'),'foreignKey':_0x9e18('0x153'),'onDelete':'restrict'});db[_0x9e18('0x8c')][_0x9e18('0x112')](db[_0x9e18('0x45')],{'as':_0x9e18('0x1a5'),'foreignKey':_0x9e18('0x153')});db['Interval'][_0x9e18('0x112')](db[_0x9e18('0x68')],{'as':'ChatApplications','foreignKey':_0x9e18('0x153')});db[_0x9e18('0x8c')]['hasMany'](db['FaxApplication'],{'as':_0x9e18('0x1a6'),'foreignKey':_0x9e18('0x153')});db[_0x9e18('0x8c')][_0x9e18('0x112')](db[_0x9e18('0x55')],{'as':_0x9e18('0x1a7'),'foreignKey':_0x9e18('0x153')});db[_0x9e18('0x1a8')]['belongsTo'](db['MailAccount'],{});db[_0x9e18('0x1a8')][_0x9e18('0x11d')](db[_0x9e18('0x9d')],{'foreignKey':_0x9e18('0x1a9')});db[_0x9e18('0x1a8')][_0x9e18('0x11d')](db['AnalyticCustomReport'],{'foreignKey':_0x9e18('0x1aa')});db[_0x9e18('0x93')][_0x9e18('0x11f')](db[_0x9e18('0x16')],{'as':_0x9e18('0x1ab'),'through':_0x9e18('0x1ac'),'onDelete':_0x9e18('0x164')});db[_0x9e18('0x95')]['belongsToMany'](db[_0x9e18('0x78')],{'through':'cm_contact_has_tags'});db['Tag'][_0x9e18('0x11f')](db[_0x9e18('0x6a')],{'through':_0x9e18('0x190')});db[_0x9e18('0x95')][_0x9e18('0x11f')](db[_0x9e18('0x41')],{'through':_0x9e18('0x16f')});db['Tag'][_0x9e18('0x11f')](db[_0x9e18('0x57')],{'through':_0x9e18('0x182')});db[_0x9e18('0x95')]['belongsToMany'](db[_0x9e18('0x4e')],{'through':'fax_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x9e18('0x5f')],{'through':_0x9e18('0x1ad')});db['Tag']['belongsToMany'](db[_0x9e18('0x12d')],{'through':_0x9e18('0x1ae')});db[_0x9e18('0x1af')][_0x9e18('0x112')](db[_0x9e18('0x8b')],{'as':{'plural':_0x9e18('0x1b0'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x9e18('0x110'),'hooks':!![]});db[_0x9e18('0x1af')][_0x9e18('0x112')](db[_0x9e18('0x8b')],{'as':{'plural':_0x9e18('0x1b1'),'singular':_0x9e18('0x1b2')},'foreignKey':_0x9e18('0x1b3'),'onDelete':_0x9e18('0x110'),'hooks':!![]});db['Trigger'][_0x9e18('0x112')](db['Action'],{'as':_0x9e18('0x1a1'),'foreignKey':'TriggerId','onDelete':_0x9e18('0x110'),'hooks':!![]});db[_0x9e18('0x1b4')][_0x9e18('0x112')](db[_0x9e18('0xa2')],{'as':_0x9e18('0x1b5'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x9e18('0xa2')],{'as':'Fields','onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1a9')});db[_0x9e18('0x1b6')][_0x9e18('0x112')](db[_0x9e18('0xa2')],{'as':_0x9e18('0x1b5'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1b7')});db['AnalyticFieldReport'][_0x9e18('0x11d')](db[_0x9e18('0x1b6')],{'foreignKey':_0x9e18('0x1b7')});db[_0x9e18('0xa4')][_0x9e18('0x112')](db[_0x9e18('0x1b8')],{'as':_0x9e18('0x1b9'),'onDelete':_0x9e18('0x110'),'foreignKey':'AccountId'});db[_0x9e18('0x1b8')][_0x9e18('0x112')](db[_0x9e18('0xa7')],{'as':_0x9e18('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9e18('0x1b8')]['hasMany'](db[_0x9e18('0xa7')],{'as':_0x9e18('0x1bb'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0x1b8')][_0x9e18('0x112')](db[_0x9e18('0xa7')],{'as':_0x9e18('0x1b5'),'onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration']['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xa7')][_0x9e18('0x112')](db[_0x9e18('0xa7')],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xa7')]['hasMany'](db[_0x9e18('0xa7')],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xa7')][_0x9e18('0x112')](db['SalesforceField'],{'as':'Field','foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0xa7')][_0x9e18('0x11d')](db[_0x9e18('0x98')],{'as':_0x9e18('0x98'),'foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0xa9')][_0x9e18('0x112')](db[_0x9e18('0x1c3')],{'as':_0x9e18('0x1b9'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0x1c3')][_0x9e18('0x112')](db[_0x9e18('0xab')],{'as':'Subjects','onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0x1c3')]['hasMany'](db[_0x9e18('0xab')],{'as':'Descriptions','onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0x1c3')][_0x9e18('0x112')](db[_0x9e18('0xab')],{'as':_0x9e18('0x1b5'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x9e18('0x1c3')][_0x9e18('0x11d')](db[_0x9e18('0xa9')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xab')]['hasMany'](db[_0x9e18('0xab')],{'as':'Subject','foreignKey':_0x9e18('0x1bf')});db['SugarcrmField']['hasMany'](db[_0x9e18('0xab')],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xab')][_0x9e18('0x112')](db[_0x9e18('0xab')],{'as':'Field','foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0xab')]['belongsTo'](db[_0x9e18('0x98')],{'as':_0x9e18('0x98'),'foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0x1c4')]['hasMany'](db[_0x9e18('0xad')],{'as':_0x9e18('0x1b9'),'onDelete':'cascade','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xad')][_0x9e18('0x112')](db['DeskField'],{'as':_0x9e18('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9e18('0xad')][_0x9e18('0x112')](db[_0x9e18('0xaf')],{'as':_0x9e18('0x1bb'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xad')][_0x9e18('0x112')](db[_0x9e18('0xaf')],{'as':_0x9e18('0x1b5'),'onDelete':_0x9e18('0x110'),'foreignKey':'FieldId'});db[_0x9e18('0xad')]['belongsTo'](db[_0x9e18('0x1c4')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x1c5')});db[_0x9e18('0xaf')][_0x9e18('0x112')](db[_0x9e18('0xaf')],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xaf')][_0x9e18('0x112')](db[_0x9e18('0xaf')],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xaf')][_0x9e18('0x112')](db[_0x9e18('0xaf')],{'as':_0x9e18('0x1c6'),'foreignKey':'FieldId'});db[_0x9e18('0xaf')][_0x9e18('0x11d')](db[_0x9e18('0x98')],{'as':_0x9e18('0x98'),'foreignKey':'VariableId'});db[_0x9e18('0xb1')][_0x9e18('0x112')](db[_0x9e18('0xb3')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xb3')][_0x9e18('0x112')](db[_0x9e18('0xb5')],{'as':'Subjects','onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bf')});db['ZohoConfiguration'][_0x9e18('0x112')](db[_0x9e18('0xb5')],{'as':_0x9e18('0x1bb'),'onDelete':_0x9e18('0x110'),'foreignKey':'DescriptionId'});db[_0x9e18('0xb3')][_0x9e18('0x112')](db[_0x9e18('0xb5')],{'as':'Fields','onDelete':_0x9e18('0x110'),'foreignKey':'FieldId'});db[_0x9e18('0xb3')][_0x9e18('0x11d')](db[_0x9e18('0xb1')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1bd')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db['ZohoField'][_0x9e18('0x112')](db[_0x9e18('0xb5')],{'as':_0x9e18('0x1c0'),'foreignKey':'DescriptionId'});db[_0x9e18('0xb5')][_0x9e18('0x112')](db['ZohoField'],{'as':_0x9e18('0x1c6'),'foreignKey':_0x9e18('0x1c1')});db['ZohoField'][_0x9e18('0x11d')](db[_0x9e18('0x98')],{'as':_0x9e18('0x98'),'foreignKey':_0x9e18('0x1c2')});db['ZendeskAccount']['hasMany'](db[_0x9e18('0x1c7')],{'as':_0x9e18('0x1b9'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0x1c7')]['hasMany'](db['ZendeskField'],{'as':_0x9e18('0x1ba'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0x1c7')][_0x9e18('0x112')](db[_0x9e18('0xb8')],{'as':_0x9e18('0x1bb'),'foreignKey':_0x9e18('0x1bc')});db['ZendeskConfiguration'][_0x9e18('0x112')](db[_0x9e18('0xb8')],{'as':'Fields','foreignKey':_0x9e18('0x1c1')});db['ZendeskConfiguration']['belongsTo'](db['ZendeskAccount'],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1bd')});db['ZendeskConfiguration'][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x1c8')});db[_0x9e18('0xb8')]['hasMany'](db[_0x9e18('0xb8')],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db['ZendeskField'][_0x9e18('0x112')](db[_0x9e18('0xb8')],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xb8')][_0x9e18('0x112')](db[_0x9e18('0xb8')],{'as':_0x9e18('0x1c6'),'foreignKey':_0x9e18('0x1c1')});db['ZendeskField']['belongsTo'](db[_0x9e18('0x98')],{'as':_0x9e18('0x98'),'foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0x1c9')][_0x9e18('0x112')](db[_0x9e18('0xbb')],{'as':_0x9e18('0x1b9'),'onDelete':'cascade','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xbb')][_0x9e18('0x112')](db['FreshdeskField'],{'as':_0x9e18('0x1ba'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xbb')]['hasMany'](db[_0x9e18('0xbd')],{'as':_0x9e18('0x1bb'),'onDelete':_0x9e18('0x110'),'foreignKey':'DescriptionId'});db[_0x9e18('0xbb')][_0x9e18('0x112')](db[_0x9e18('0xbd')],{'as':'Fields','onDelete':_0x9e18('0x110'),'foreignKey':'FieldId'});db[_0x9e18('0xbb')][_0x9e18('0x11d')](db[_0x9e18('0x1c9')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xbb')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x9e18('0xbd')][_0x9e18('0x112')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xbd')][_0x9e18('0x112')](db[_0x9e18('0xbd')],{'as':'Description','foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xbd')]['hasMany'](db[_0x9e18('0xbd')],{'as':_0x9e18('0x1c6'),'foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0xbd')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0xbe')][_0x9e18('0x112')](db['VtigerConfiguration'],{'as':_0x9e18('0x1b9'),'onDelete':'cascade','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0x1ca')][_0x9e18('0x112')](db[_0x9e18('0xc1')],{'as':_0x9e18('0x1ba'),'foreignKey':'SubjectId'});db['VtigerConfiguration'][_0x9e18('0x112')](db[_0x9e18('0xc1')],{'as':_0x9e18('0x1bb'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0x1ca')][_0x9e18('0x112')](db[_0x9e18('0xc1')],{'as':_0x9e18('0x1b5'),'foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0x1ca')]['belongsTo'](db[_0x9e18('0xbe')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xc1')][_0x9e18('0x112')](db['VtigerField'],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xc1')][_0x9e18('0x112')](db[_0x9e18('0xc1')],{'as':'Description','foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xc1')][_0x9e18('0x112')](db[_0x9e18('0xc1')],{'as':'Field','foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0xc1')][_0x9e18('0x11d')](db['Variable'],{'as':_0x9e18('0x98'),'foreignKey':_0x9e18('0x1c2')});db['ServicenowAccount'][_0x9e18('0x112')](db['ServicenowConfiguration'],{'as':_0x9e18('0x1b9'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xc5')][_0x9e18('0x112')](db['ServicenowField'],{'as':_0x9e18('0x1ba'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x9e18('0x112')](db[_0x9e18('0xc6')],{'as':_0x9e18('0x1bb'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xc5')]['hasMany'](db[_0x9e18('0xc6')],{'as':_0x9e18('0x1b5'),'foreignKey':'FieldId'});db[_0x9e18('0xc5')][_0x9e18('0x11d')](db[_0x9e18('0xc3')],{'as':'Account','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xc6')][_0x9e18('0x112')](db[_0x9e18('0xc6')],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xc6')][_0x9e18('0x112')](db['ServicenowField'],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0xc6')]['hasMany'](db[_0x9e18('0xc6')],{'as':'Field','foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0xc6')][_0x9e18('0x11d')](db[_0x9e18('0x98')],{'as':_0x9e18('0x98'),'foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0xc8')][_0x9e18('0x112')](db['Dynamics365Configuration'],{'as':_0x9e18('0x1b9'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0xca')]['hasMany'](db[_0x9e18('0x1cb')],{'as':_0x9e18('0x1ba'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0xca')][_0x9e18('0x112')](db[_0x9e18('0x1cb')],{'as':_0x9e18('0x1bb'),'onDelete':_0x9e18('0x110'),'foreignKey':'DescriptionId'});db[_0x9e18('0xca')][_0x9e18('0x112')](db[_0x9e18('0x1cb')],{'as':_0x9e18('0x1b5'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0xca')][_0x9e18('0x11d')](db[_0x9e18('0xc8')],{'as':'Account','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0x1cb')][_0x9e18('0x112')](db[_0x9e18('0x1cb')],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db['Dynamics365Field'][_0x9e18('0x112')](db['Dynamics365Field'],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0x1cb')][_0x9e18('0x112')](db['Dynamics365Field'],{'as':_0x9e18('0x1c6'),'foreignKey':_0x9e18('0x1c1')});db['Dynamics365Field']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0xcd')]['hasMany'](db[_0x9e18('0x1cc')],{'as':_0x9e18('0x1b9'),'onDelete':'cascade','foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0x1cc')]['hasMany'](db[_0x9e18('0x1cd')],{'as':'Subjects','foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0x9e18('0x112')](db[_0x9e18('0x1cd')],{'as':_0x9e18('0x1bb'),'foreignKey':'DescriptionId'});db[_0x9e18('0x1cc')][_0x9e18('0x112')](db[_0x9e18('0x1cd')],{'as':_0x9e18('0x1b5'),'foreignKey':_0x9e18('0x1c1')});db['FreshsalesConfiguration'][_0x9e18('0x11d')](db[_0x9e18('0xcd')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1bd')});db[_0x9e18('0x1cd')][_0x9e18('0x112')](db[_0x9e18('0x1cd')],{'as':_0x9e18('0x1be'),'foreignKey':_0x9e18('0x1bf')});db[_0x9e18('0x1cd')]['hasMany'](db[_0x9e18('0x1cd')],{'as':_0x9e18('0x1c0'),'foreignKey':_0x9e18('0x1bc')});db[_0x9e18('0x1cd')][_0x9e18('0x112')](db[_0x9e18('0x1cd')],{'as':'Field','foreignKey':_0x9e18('0x1c1')});db[_0x9e18('0x1cd')]['belongsTo'](db[_0x9e18('0x98')],{'as':'Variable','foreignKey':_0x9e18('0x1c2')});db[_0x9e18('0xd1')][_0x9e18('0x11d')](db[_0x9e18('0x139')],{});db[_0x9e18('0xd1')]['belongsTo'](db[_0x9e18('0xf4')],{'as':'List','foreignKey':_0x9e18('0x17b')});db[_0x9e18('0xd1')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':'Contact','foreignKey':_0x9e18('0x161')});db['ChatQueueReport']['belongsTo'](db[_0x9e18('0x6a')],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db[_0x9e18('0x10e')],{});db[_0x9e18('0xd1')][_0x9e18('0x11d')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1ce')});db[_0x9e18('0xd3')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x1cf')});db[_0x9e18('0xd8')][_0x9e18('0x112')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x9e18('0x110')});db[_0x9e18('0xd8')][_0x9e18('0x112')](db[_0x9e18('0xd5')],{'foreignKey':_0x9e18('0x1d0'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x1d1')][_0x9e18('0x11d')](db['SmsAccount'],{});db[_0x9e18('0x1d1')]['belongsTo'](db['CmList'],{'as':_0x9e18('0x168'),'foreignKey':'ListId'});db[_0x9e18('0x1d1')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db[_0x9e18('0x1d1')]['belongsTo'](db['SmsInteraction'],{});db['SmsQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0x59')],{});db[_0x9e18('0x1d1')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{});db[_0x9e18('0x1d1')][_0x9e18('0x11d')](db[_0x9e18('0x5a')],{});db[_0x9e18('0xdb')][_0x9e18('0x112')](db[_0x9e18('0xd8')],{'foreignKey':_0x9e18('0x1d2')});db[_0x9e18('0xdb')]['hasMany'](db[_0x9e18('0x1d3')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x9e18('0x112')](db[_0x9e18('0xd5')],{'foreignKey':_0x9e18('0x1d2')});db[_0x9e18('0xdf')][_0x9e18('0x11f')](db['User'],{'as':_0x9e18('0x171'),'through':_0x9e18('0x146')});db[_0x9e18('0x169')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':_0x9e18('0x126')});db[_0x9e18('0x169')][_0x9e18('0x11f')](db['VoiceQueue'],{'through':_0x9e18('0x1d4'),'as':_0x9e18('0x12f')});db['Team'][_0x9e18('0x11f')](db[_0x9e18('0x3d')],{'through':_0x9e18('0x16a'),'as':_0x9e18('0x131')});db[_0x9e18('0x169')][_0x9e18('0x11f')](db[_0x9e18('0x70')],{'through':_0x9e18('0x193'),'as':_0x9e18('0x133')});db[_0x9e18('0x169')]['belongsToMany'](db[_0x9e18('0x51')],{'through':_0x9e18('0x1d5'),'as':_0x9e18('0x134')});db[_0x9e18('0x169')][_0x9e18('0x11f')](db['SmsQueue'],{'through':_0x9e18('0x184'),'as':_0x9e18('0x135')});db[_0x9e18('0x169')][_0x9e18('0x11f')](db[_0x9e18('0x63')],{'through':_0x9e18('0x18a'),'as':'OpenchannelQueues'});db[_0x9e18('0x169')][_0x9e18('0x11f')](db[_0x9e18('0x105')],{'through':_0x9e18('0x1d6'),'as':_0x9e18('0x138')});db[_0x9e18('0x169')]['belongsToMany'](db[_0x9e18('0xf5')],{'through':_0x9e18('0x10a'),'as':_0x9e18('0x130')});db[_0x9e18('0xe6')][_0x9e18('0x112')](db[_0x9e18('0x7a')],{'as':_0x9e18('0x14c'),'foreignKey':_0x9e18('0x19c')});db[_0x9e18('0xe6')][_0x9e18('0x112')](db[_0x9e18('0x14d')],{'as':_0x9e18('0x115'),'foreignKey':_0x9e18('0x19c')});db['Campaign']['hasMany'](db[_0x9e18('0x7e')],{'as':_0x9e18('0x197'),'foreignKey':'CampaignId'});db[_0x9e18('0xe6')][_0x9e18('0x112')](db[_0x9e18('0x7c')],{'as':_0x9e18('0x14e'),'foreignKey':_0x9e18('0x19c')});db['Campaign'][_0x9e18('0x11d')](db['Trunk'],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x9e18('0xe6')][_0x9e18('0x11d')](db[_0x9e18('0x150')],{'as':_0x9e18('0x1d7'),'foreignKey':_0x9e18('0x152')});db['Campaign'][_0x9e18('0x11d')](db[_0x9e18('0x8c')],{'as':'Interval','foreignKey':_0x9e18('0x153')});db[_0x9e18('0xe6')]['belongsTo'](db[_0x9e18('0xdf')],{'as':_0x9e18('0xdf'),'foreignKey':_0x9e18('0x1d8')});db[_0x9e18('0xe6')][_0x9e18('0x11f')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x124'),'through':'campaigns_has_cm_lists'});db[_0x9e18('0xe6')][_0x9e18('0x11f')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x159'),'through':_0x9e18('0x1d9')});db[_0x9e18('0xea')]['belongsTo'](db[_0x9e18('0x6e')],{'as':'ChatOfflineMessage','foreignKey':_0x9e18('0x174')});db[_0x9e18('0x1da')][_0x9e18('0x11d')](db[_0x9e18('0x43')],{});db[_0x9e18('0x1da')][_0x9e18('0x11d')](db[_0x9e18('0x41')],{});db[_0x9e18('0x1da')][_0x9e18('0x11d')](db[_0x9e18('0x3b')],{'foreignKey':_0x9e18('0x1db'),'as':_0x9e18('0x1dc')});db['MailTransferReport'][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1dd'),'as':'FromAgent'});db[_0x9e18('0x1da')]['belongsTo'](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1de'),'as':_0x9e18('0x1df')});db['MailTransferReport'][_0x9e18('0x11d')](db[_0x9e18('0x3d')],{'foreignKey':_0x9e18('0x1e0'),'as':'ToQueue'});db[_0x9e18('0x1da')][_0x9e18('0x11d')](db[_0x9e18('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x9e18('0x1e1')});db[_0x9e18('0xef')]['belongsTo'](db[_0x9e18('0x6c')],{});db['ChatTransferReport']['belongsTo'](db[_0x9e18('0x6a')],{});db[_0x9e18('0xef')][_0x9e18('0x11d')](db[_0x9e18('0x139')],{'foreignKey':_0x9e18('0x1e2'),'as':_0x9e18('0x1dc')});db[_0x9e18('0xef')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1dd'),'as':_0x9e18('0x1e3')});db[_0x9e18('0xef')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1de'),'as':_0x9e18('0x1df')});db[_0x9e18('0xef')][_0x9e18('0x11d')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x9e18('0x1e4')});db[_0x9e18('0xef')][_0x9e18('0x11d')](db[_0x9e18('0x139')],{'foreignKey':'ToChatWebsiteId','as':_0x9e18('0x1e1')});db['FaxTransferReport'][_0x9e18('0x11d')](db[_0x9e18('0x17d')],{});db[_0x9e18('0xf0')]['belongsTo'](db[_0x9e18('0x4e')],{});db[_0x9e18('0xf0')][_0x9e18('0x11d')](db[_0x9e18('0x4b')],{'foreignKey':_0x9e18('0x1e5'),'as':_0x9e18('0x1dc')});db['FaxTransferReport'][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1dd'),'as':'FromAgent'});db[_0x9e18('0xf0')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':'ToUserId','as':_0x9e18('0x1df')});db[_0x9e18('0xf0')][_0x9e18('0x11d')](db[_0x9e18('0x51')],{'foreignKey':_0x9e18('0x1e6'),'as':_0x9e18('0x1e4')});db[_0x9e18('0xf0')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x9e18('0x1e7'),'as':_0x9e18('0x1e1')});db[_0x9e18('0xf2')][_0x9e18('0x11d')](db[_0x9e18('0x61')],{});db[_0x9e18('0xf2')][_0x9e18('0x11d')](db[_0x9e18('0x5f')],{});db[_0x9e18('0xf2')][_0x9e18('0x11d')](db[_0x9e18('0x5c')],{'foreignKey':_0x9e18('0x1e8'),'as':_0x9e18('0x1dc')});db[_0x9e18('0xf2')]['belongsTo'](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1dd'),'as':_0x9e18('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1de'),'as':_0x9e18('0x1df')});db['OpenchannelTransferReport'][_0x9e18('0x11d')](db[_0x9e18('0x63')],{'foreignKey':_0x9e18('0x1e9'),'as':_0x9e18('0x1e4')});db['OpenchannelTransferReport'][_0x9e18('0x11d')](db['OpenchannelAccount'],{'foreignKey':_0x9e18('0x1ea'),'as':_0x9e18('0x1e1')});db['SmsTransferReport']['belongsTo'](db[_0x9e18('0x59')],{});db['SmsTransferReport'][_0x9e18('0x11d')](db['SmsInteraction'],{});db[_0x9e18('0xf3')][_0x9e18('0x11d')](db[_0x9e18('0x141')],{'foreignKey':_0x9e18('0x1eb'),'as':'FromAccount'});db[_0x9e18('0xf3')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9e18('0xf3')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9e18('0xf3')][_0x9e18('0x11d')](db[_0x9e18('0x5a')],{'foreignKey':'ToSmsQueueId','as':_0x9e18('0x1e4')});db[_0x9e18('0xf3')][_0x9e18('0x11d')](db['SmsAccount'],{'foreignKey':_0x9e18('0x1ec'),'as':'ToAccount'});db[_0x9e18('0xf4')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':_0x9e18('0x167'),'foreignKey':_0x9e18('0x17b'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0xf4')]['hasMany'](db['CmCustomField'],{'as':'CustomFields','foreignKey':'ListId'});db['CmList'][_0x9e18('0x112')](db['CmContact'],{'as':_0x9e18('0x122'),'onDelete':_0x9e18('0x110'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0xf4')][_0x9e18('0x112')](db[_0x9e18('0x14d')],{'as':_0x9e18('0x115'),'foreignKey':_0x9e18('0x17b')});db['CmList'][_0x9e18('0x112')](db[_0x9e18('0x7e')],{'as':_0x9e18('0x117'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0xf4')][_0x9e18('0x112')](db['ReportAgentPreview'],{'as':_0x9e18('0x80'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0xf4')][_0x9e18('0x11f')](db[_0x9e18('0x18')],{'as':_0x9e18('0x1ed'),'through':_0x9e18('0x156')});db[_0x9e18('0xf4')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x157'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x9e18('0x15')],{'as':'Extensions','onDelete':_0x9e18('0x110')});db[_0x9e18('0xf5')][_0x9e18('0x11f')](db[_0x9e18('0x10e')],{'as':'Agents','through':_0x9e18('0x10c')});db['VoicePrefix'][_0x9e18('0x11f')](db[_0x9e18('0x169')],{'through':'TeamVoicePrefix','as':_0x9e18('0x158')});db['UserProfile'][_0x9e18('0x112')](db[_0x9e18('0x10e')],{'as':_0x9e18('0x171'),'foreignKey':_0x9e18('0x11e')});db[_0x9e18('0xf7')][_0x9e18('0x112')](db[_0x9e18('0x1ee')],{'as':_0x9e18('0x1ef'),'foreignKey':_0x9e18('0x11e'),'onDelete':_0x9e18('0x110')});db[_0x9e18('0x1ee')][_0x9e18('0x112')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x9e18('0x1f0'),'onDelete':'cascade'});db[_0x9e18('0xfe')][_0x9e18('0x112')](db[_0x9e18('0x89')],{'as':_0x9e18('0x167'),'foreignKey':'WhatsappAccountId','onDelete':_0x9e18('0x110')});db[_0x9e18('0xfe')][_0x9e18('0x112')](db['CannedAnswer'],{'as':_0x9e18('0x179'),'foreignKey':_0x9e18('0x1f1')});db[_0x9e18('0xfe')][_0x9e18('0x112')](db[_0x9e18('0x1f2')],{'as':_0x9e18('0x15b'),'foreignKey':_0x9e18('0x1f1')});db['WhatsappAccount'][_0x9e18('0x112')](db['WhatsappInteraction'],{'as':_0x9e18('0x185')});db[_0x9e18('0xfe')][_0x9e18('0x112')](db[_0x9e18('0x1f3')],{'as':_0x9e18('0x149')});db[_0x9e18('0xfe')]['belongsTo'](db['CmList'],{'as':_0x9e18('0x168'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0xfe')][_0x9e18('0x11d')](db[_0x9e18('0x8e')],{'as':_0x9e18('0x154'),'foreignKey':_0x9e18('0x155')});db[_0x9e18('0xfe')]['belongsToMany'](db[_0x9e18('0x10e')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x9e18('0x11d')](db['User'],{'onDelete':'restrict'});db[_0x9e18('0x1f3')][_0x9e18('0x11d')](db[_0x9e18('0x105')],{'onDelete':_0x9e18('0x164')});db['WhatsappApplication'][_0x9e18('0x11d')](db[_0x9e18('0xfe')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x9e18('0x11d')](db['Interval'],{'onDelete':_0x9e18('0x164'),'foreignKey':_0x9e18('0x153')});db[_0x9e18('0x1f3')][_0x9e18('0x11d')](db[_0x9e18('0x95')],{'onDelete':_0x9e18('0x164'),'foreignKey':_0x9e18('0x18e')});db['WhatsappInteraction'][_0x9e18('0x112')](db[_0x9e18('0x1f2')],{'as':_0x9e18('0x15b'),'onDelete':_0x9e18('0x110'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x9e18('0x11d')](db[_0x9e18('0xfe')],{'as':'Account','foreignKey':_0x9e18('0x1f1')});db[_0x9e18('0x12d')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db['WhatsappInteraction'][_0x9e18('0x11d')](db['User'],{'as':_0x9e18('0x16d'),'foreignKey':_0x9e18('0x116')});db[_0x9e18('0x12d')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':_0x9e18('0x1ae'),'as':_0x9e18('0x16e')});db[_0x9e18('0x12d')][_0x9e18('0x11f')](db[_0x9e18('0x95')],{'through':'whatsapp_interaction_has_tags','as':_0x9e18('0x170')});db[_0x9e18('0x12d')][_0x9e18('0x11f')](db['User'],{'as':_0x9e18('0x171'),'through':_0x9e18('0x12e'),'foreignKey':_0x9e18('0x1f4')});db[_0x9e18('0x1f2')][_0x9e18('0x11d')](db['User'],{'as':'User'});db[_0x9e18('0x1f2')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'onDelete':'cascade','as':_0x9e18('0x160')});db['WhatsappMessage']['belongsTo'](db[_0x9e18('0x12d')],{'onDelete':_0x9e18('0x110'),'as':_0x9e18('0x172'),'foreignKey':_0x9e18('0x1f4')});db[_0x9e18('0x1f2')]['belongsTo'](db[_0x9e18('0xfe')],{'as':_0x9e18('0x16c'),'foreignKey':_0x9e18('0x1f1')});db['WhatsappQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0xfe')],{});db['WhatsappQueueReport'][_0x9e18('0x11d')](db[_0x9e18('0xf4')],{'as':_0x9e18('0x168'),'foreignKey':_0x9e18('0x17b')});db[_0x9e18('0x101')][_0x9e18('0x11d')](db[_0x9e18('0x78')],{'as':_0x9e18('0x160'),'foreignKey':_0x9e18('0x161')});db[_0x9e18('0x101')][_0x9e18('0x11d')](db[_0x9e18('0x12d')],{});db[_0x9e18('0x101')]['belongsTo'](db[_0x9e18('0x105')],{});db[_0x9e18('0x101')]['belongsTo'](db[_0x9e18('0x1f2')],{});db[_0x9e18('0x101')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{});db[_0x9e18('0x103')][_0x9e18('0x11d')](db[_0x9e18('0x1f2')],{});db[_0x9e18('0x103')][_0x9e18('0x11d')](db[_0x9e18('0x12d')],{});db[_0x9e18('0x103')][_0x9e18('0x11d')](db['WhatsappAccount'],{'foreignKey':_0x9e18('0x1f5'),'as':'FromAccount'});db[_0x9e18('0x103')][_0x9e18('0x11d')](db[_0x9e18('0xfe')],{'foreignKey':_0x9e18('0x1f6'),'as':'ToAccount'});db['WhatsappTransferReport'][_0x9e18('0x11d')](db[_0x9e18('0x105')],{'foreignKey':_0x9e18('0x1f7'),'as':_0x9e18('0x1e4')});db[_0x9e18('0x103')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':_0x9e18('0x1dd'),'as':_0x9e18('0x1e3')});db[_0x9e18('0x103')][_0x9e18('0x11d')](db[_0x9e18('0x10e')],{'foreignKey':'ToUserId','as':_0x9e18('0x1df')});db['WhatsappQueue'][_0x9e18('0x11f')](db['User'],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x9e18('0x1f8')});db['WhatsappQueue'][_0x9e18('0x11f')](db['Team'],{'through':'team_has_whatsapp_queues','as':_0x9e18('0x158')});db[_0x9e18('0x107')][_0x9e18('0x10f')](db['MailServerIn'],{'as':_0x9e18('0x165'),'onDelete':'restrict'});db[_0x9e18('0x107')][_0x9e18('0x10f')](db['MailServerOut'],{'as':_0x9e18('0x166'),'onDelete':_0x9e18('0x164')});module[_0x9e18('0x1f9')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index e9cc9af..ebd30cf 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x30cd=['./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/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/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/jira','/api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','get','sendFile','resolve','/index.html','password','apiKey','firstName','lastName','street','phone','clientId','clientSecret','securityToken','code','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','isString','@@{','replace','}@@','lodash','path','express','util','./errors','./config/logger','api','auth','./safe-template','safeTemplate','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','headers','x-forwarded-for','url','statusCode','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','remoteAddress','agent_name','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/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/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts'];(function(_0x5b411a,_0x9445a4){var _0x3d21e3=function(_0x52efc0){while(--_0x52efc0){_0x5b411a['push'](_0x5b411a['shift']());}};_0x3d21e3(++_0x9445a4);}(_0x30cd,0x1e3));var _0xd30c=function(_0x48d388,_0x5e792a){_0x48d388=_0x48d388-0x0;var _0x8f96c6=_0x30cd[_0x48d388];return _0x8f96c6;};'use strict';var _=require(_0xd30c('0x0'));var path=require(_0xd30c('0x1'));var express=require(_0xd30c('0x2'));var ewinston=require('express-winston');var util=require(_0xd30c('0x3'));var errors=require(_0xd30c('0x4'));var config=require('./config/environment');var logger=require(_0xd30c('0x5'))(_0xd30c('0x6'));var authLogger=require(_0xd30c('0x5'))(_0xd30c('0x7'));var safeTemplate=require(_0xd30c('0x8'))[_0xd30c('0x9')];exports[_0xd30c('0xa')]=function(_0x4d00e4){_0x4d00e4[_0xd30c('0xb')](ewinston[_0xd30c('0xc')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x6d239e,_0x374c9e){var _0x44af2e=_0xd30c('0xd');if(!_[_0xd30c('0xe')](_0x6d239e[_0xd30c('0xf')])){_0x44af2e+=_0xd30c('0x10');var _0x21c3bd=_0x6d239e[_0xd30c('0xf')];maskSensitiveData(_0x21c3bd);}return safeTemplate(util['format'](_0x44af2e,_0x6d239e['method'],_0x6d239e[_0xd30c('0x11')][_0xd30c('0x12')]?_0x6d239e['headers'][_0xd30c('0x12')]:_0x6d239e['connection']['remoteAddress']||_0x6d239e['ip'],_0x6d239e[_0xd30c('0x13')],_0x374c9e[_0xd30c('0x14')],_0x374c9e['responseTime'],_0x6d239e[_0xd30c('0x15')]?_0x6d239e['user']['id']:null,_0x6d239e[_0xd30c('0x15')]?_0x6d239e[_0xd30c('0x15')][_0xd30c('0x16')]:null,_0x6d239e[_0xd30c('0x15')]?_0x6d239e[_0xd30c('0x15')][_0xd30c('0x17')]:null,_0x21c3bd?util[_0xd30c('0x18')](_0x21c3bd,![],null):''));}}));_0x4d00e4[_0xd30c('0xb')](ewinston[_0xd30c('0xc')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x306282,_0x227ca1){var _0x1cd97e=_0xd30c('0x19');if(_0x306282[_0xd30c('0xf')]&&_0x306282['body'][_0xd30c('0x1a')]&&_0x306282[_0xd30c('0xf')][_0xd30c('0x1b')]){_0x1cd97e=_0xd30c('0x1c');}return util[_0xd30c('0x1d')](_0x1cd97e,_0x306282[_0xd30c('0x1e')],_0x306282[_0xd30c('0x11')]['x-forwarded-for']?_0x306282[_0xd30c('0x11')][_0xd30c('0x12')]:_0x306282['connection'][_0xd30c('0x1f')]||_0x306282['ip'],_0x306282[_0xd30c('0x13')],_0x227ca1[_0xd30c('0x14')],_0x227ca1['responseTime'],_0x306282[_0xd30c('0x15')]?_0x306282['user']['id']:null,_0x306282[_0xd30c('0x15')]?_0x306282[_0xd30c('0x15')][_0xd30c('0x16')]:null,_0x306282[_0xd30c('0x15')]?_0x306282[_0xd30c('0x15')]['role']:null,_0x306282['body']&&_0x306282[_0xd30c('0xf')][_0xd30c('0x1a')]?_0x306282['body'][_0xd30c('0x1a')]:'other',_0x306282['body']&&_0x306282[_0xd30c('0xf')][_0xd30c('0x1b')]?_0x306282[_0xd30c('0xf')]['agent_id']:'',_0x306282[_0xd30c('0xf')]&&_0x306282['body']['agent_name']?_0x306282[_0xd30c('0xf')][_0xd30c('0x20')]:'');},'ignoreRoute':function(_0x36db1a){var _0x142af2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x142af2['test'](_0x36db1a[_0xd30c('0x13')]);}}));_0x4d00e4['use']('/api/users',require(_0xd30c('0x21')));_0x4d00e4[_0xd30c('0xb')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x4d00e4['use'](_0xd30c('0x22'),require(_0xd30c('0x23')));_0x4d00e4['use'](_0xd30c('0x24'),require(_0xd30c('0x25')));_0x4d00e4[_0xd30c('0xb')]('/api/voice/mohs',require(_0xd30c('0x26')));_0x4d00e4['use'](_0xd30c('0x27'),require(_0xd30c('0x28')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x29'),require('./api/voiceRecording'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2a'),require('./api/screenRecording'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2b'),require(_0xd30c('0x2c')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2d'),require('./api/voiceMailMessage'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x2e'),require('./api/voiceCallReport'));_0x4d00e4['use']('/api/voice/dials/reports',require(_0xd30c('0x2f')));_0x4d00e4['use'](_0xd30c('0x30'),require(_0xd30c('0x31')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x32'),require(_0xd30c('0x33')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x34'),require('./api/memberReport'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x35'),require('./api/trunk'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x36'),require(_0xd30c('0x37')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x38'),require('./api/mailServerOut'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x39'),require(_0xd30c('0x3a')));_0x4d00e4[_0xd30c('0xb')]('/api/mail/queues',require(_0xd30c('0x3b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x3c'),require('./api/mailSubstatus'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x3d'),require(_0xd30c('0x3e')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x3f'),require('./api/mailMessage'));_0x4d00e4[_0xd30c('0xb')]('/api/mail/applications',require(_0xd30c('0x40')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x41'),require(_0xd30c('0x42')));_0x4d00e4[_0xd30c('0xb')]('/api/dashboards',require(_0xd30c('0x43')));_0x4d00e4[_0xd30c('0xb')]('/api/dashboards/items',require('./api/dashboardItem'));_0x4d00e4['use'](_0xd30c('0x44'),require(_0xd30c('0x45')));_0x4d00e4['use']('/api/fax/applications',require('./api/faxApplication'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x46'),require(_0xd30c('0x47')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x48'),require(_0xd30c('0x49')));_0x4d00e4['use'](_0xd30c('0x4a'),require(_0xd30c('0x4b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x4c'),require(_0xd30c('0x4d')));_0x4d00e4['use'](_0xd30c('0x4e'),require('./api/smsAccount'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x4f'),require(_0xd30c('0x50')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x51'),require(_0xd30c('0x52')));_0x4d00e4['use']('/api/sms/messages',require(_0xd30c('0x53')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x54'),require(_0xd30c('0x55')));_0x4d00e4['use'](_0xd30c('0x56'),require(_0xd30c('0x57')));_0x4d00e4[_0xd30c('0xb')]('/api/openchannel/applications',require(_0xd30c('0x58')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x59'),require('./api/openchannelInteraction'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x5a'),require(_0xd30c('0x5b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x5c'),require(_0xd30c('0x5d')));_0x4d00e4[_0xd30c('0xb')]('/api/chat/websites',require(_0xd30c('0x5e')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x5f'),require(_0xd30c('0x60')));_0x4d00e4['use']('/api/chat/applications',require(_0xd30c('0x61')));_0x4d00e4[_0xd30c('0xb')]('/api/chat/interactions',require(_0xd30c('0x62')));_0x4d00e4['use']('/api/chat/messages',require(_0xd30c('0x63')));_0x4d00e4[_0xd30c('0xb')]('/api/chat/offline_messages',require(_0xd30c('0x64')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x65'),require('./api/chatQueue'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x66'),require(_0xd30c('0x67')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x68'),require(_0xd30c('0x69')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x6a'),require(_0xd30c('0x6b')));_0x4d00e4[_0xd30c('0xb')]('/api/cm/contacts',require(_0xd30c('0x6c')));_0x4d00e4['use'](_0xd30c('0x6d'),require('./api/cmHopper'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x6e'),require(_0xd30c('0x6f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x70'),require(_0xd30c('0x71')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x72'),require(_0xd30c('0x73')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x74'),require(_0xd30c('0x75')));_0x4d00e4['use'](_0xd30c('0x76'),require(_0xd30c('0x77')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x78'),require(_0xd30c('0x79')));_0x4d00e4['use'](_0xd30c('0x7a'),require(_0xd30c('0x7b')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x7c'),require(_0xd30c('0x7d')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x7e'),require('./api/condition'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x7f'),require(_0xd30c('0x80')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x81'),require(_0xd30c('0x82')));_0x4d00e4['use'](_0xd30c('0x83'),require(_0xd30c('0x84')));_0x4d00e4[_0xd30c('0xb')]('/api/voiceQueuesLog',require(_0xd30c('0x85')));_0x4d00e4['use'](_0xd30c('0x86'),require(_0xd30c('0x87')));_0x4d00e4[_0xd30c('0xb')]('/api/sounds',require('./api/sound'));_0x4d00e4['use'](_0xd30c('0x88'),require(_0xd30c('0x89')));_0x4d00e4[_0xd30c('0xb')]('/api/templates',require('./api/template'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x8a'),require(_0xd30c('0x8b')));_0x4d00e4['use'](_0xd30c('0x8c'),require(_0xd30c('0x8d')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x8e'),require(_0xd30c('0x8f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x90'),require(_0xd30c('0x91')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x92'),require(_0xd30c('0x93')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x94'),require(_0xd30c('0x95')));_0x4d00e4[_0xd30c('0xb')]('/api/analytics/extracted_reports',require(_0xd30c('0x96')));_0x4d00e4['use'](_0xd30c('0x97'),require(_0xd30c('0x98')));_0x4d00e4['use']('/api/analytics/field_reports',require(_0xd30c('0x99')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x9a'),require('./api/analyticTreeReport'));_0x4d00e4['use'](_0xd30c('0x9b'),require('./api/intSalesforceAccount'));_0x4d00e4['use']('/api/integrations/salesforce/configurations',require(_0xd30c('0x9c')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/salesforce/fields',require(_0xd30c('0x9d')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x9e'),require(_0xd30c('0x9f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa0'),require(_0xd30c('0xa1')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa2'),require(_0xd30c('0xa3')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa4'),require(_0xd30c('0xa5')));_0x4d00e4['use'](_0xd30c('0xa6'),require(_0xd30c('0xa7')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xa8'),require(_0xd30c('0xa9')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xaa'),require(_0xd30c('0xab')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xac'),require(_0xd30c('0xad')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xae'),require('./api/intZohoField'));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/zendesk/configurations',require(_0xd30c('0xaf')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb0'),require('./api/intZendeskField'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb1'),require(_0xd30c('0xb2')));_0x4d00e4['use'](_0xd30c('0xb3'),require(_0xd30c('0xb4')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/freshdesk/fields',require(_0xd30c('0xb5')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb6'),require(_0xd30c('0xb7')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xb8'),require(_0xd30c('0xb9')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/vtiger/fields',require(_0xd30c('0xba')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/servicenow/accounts',require(_0xd30c('0xbb')));_0x4d00e4['use'](_0xd30c('0xbc'),require(_0xd30c('0xbd')));_0x4d00e4['use']('/api/integrations/servicenow/fields',require(_0xd30c('0xbe')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/dynamics365/configurations',require(_0xd30c('0xbf')));_0x4d00e4[_0xd30c('0xb')]('/api/integrations/dynamics365/fields',require(_0xd30c('0xc0')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xc1'),require(_0xd30c('0xc2')));_0x4d00e4['use'](_0xd30c('0xc3'),require('./api/intFreshsalesConfiguration'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xc4'),require(_0xd30c('0xc5')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xc6'),require(_0xd30c('0xc7')));_0x4d00e4['use']('/api/chat/reports/queue',require(_0xd30c('0xc8')));_0x4d00e4['use'](_0xd30c('0xc9'),require(_0xd30c('0xca')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xcb'),require(_0xd30c('0xcc')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xcd'),require(_0xd30c('0xce')));_0x4d00e4['use']('/api/jscripty/sessions/reports',require(_0xd30c('0xcf')));_0x4d00e4['use']('/api/sms/reports/queue',require(_0xd30c('0xd0')));_0x4d00e4['use'](_0xd30c('0xd1'),require(_0xd30c('0xd2')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xd3'),require('./api/squareReportDetail'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xd4'),require(_0xd30c('0xd5')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xd6'),require(_0xd30c('0xd7')));_0x4d00e4['use'](_0xd30c('0xd8'),require(_0xd30c('0xd9')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xda'),require(_0xd30c('0xdb')));_0x4d00e4[_0xd30c('0xb')]('/api/square/recordings',require(_0xd30c('0xdc')));_0x4d00e4['use'](_0xd30c('0xdd'),require('./api/squareMessage'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xde'),require('./api/team'));_0x4d00e4['use'](_0xd30c('0xdf'),require(_0xd30c('0xe0')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe1'),require('./api/campaign'));_0x4d00e4[_0xd30c('0xb')]('/api/migrations',require(_0xd30c('0xe2')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe3'),require(_0xd30c('0xe4')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe5'),require(_0xd30c('0xe6')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xe7'),require(_0xd30c('0xe8')));_0x4d00e4['use'](_0xd30c('0xe9'),require(_0xd30c('0xea')));_0x4d00e4['use']('/api/fax/reports/transfer',require(_0xd30c('0xeb')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xec'),require(_0xd30c('0xed')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xee'),require(_0xd30c('0xef')));_0x4d00e4['use']('/api/cm/lists',require('./api/cmList'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf0'),require('./api/voicePrefix'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf1'),require(_0xd30c('0xf2')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf3'),require(_0xd30c('0xf4')));_0x4d00e4['use'](_0xd30c('0xf5'),require(_0xd30c('0xf6')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf7'),require('./api/userNotification'));_0x4d00e4['use'](_0xd30c('0xf8'),require('./api/whatsappAccount'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xf9'),require(_0xd30c('0xfa')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0xfb'),require(_0xd30c('0xfc')));_0x4d00e4['use'](_0xd30c('0xfd'),require('./api/whatsappMessage'));_0x4d00e4['use'](_0xd30c('0xfe'),require(_0xd30c('0xff')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x100'),require(_0xd30c('0x101')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x102'),require('./api/whatsappQueue'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x103'),require(_0xd30c('0x104')));_0x4d00e4[_0xd30c('0xb')]('/api/realtime',require(_0xd30c('0x105')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x106'),require('./api/authLocal'));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x107'),require(_0xd30c('0x108')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x109'),require('./api/authActiveDirectory'));_0x4d00e4[_0xd30c('0xb')]('/api/jira',require(_0xd30c('0x10a')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x10b'),require('./api/rpc'));_0x4d00e4['use'](_0xd30c('0x10c'),require('./api/version'));_0x4d00e4[_0xd30c('0xb')]('/api/system',require(_0xd30c('0x10d')));_0x4d00e4['use'](_0xd30c('0x10e'),require(_0xd30c('0x10f')));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x110'),require(_0xd30c('0x111')));_0x4d00e4[_0xd30c('0xb')]('/apidoc',express[_0xd30c('0x112')](path[_0xd30c('0x113')](config[_0xd30c('0x114')],_0xd30c('0x115'))));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x116'),express['static'](path[_0xd30c('0x113')](config['root'],_0xd30c('0x116'))));_0x4d00e4['use'](_0xd30c('0x117'),express[_0xd30c('0x112')](path['join'](config[_0xd30c('0x114')],_0xd30c('0x117'))));_0x4d00e4['use'](_0xd30c('0x118'),express['static'](path['join'](config[_0xd30c('0x114')],_0xd30c('0x119'),_0xd30c('0x11a'))));_0x4d00e4[_0xd30c('0xb')](_0xd30c('0x11b'),express['static'](path[_0xd30c('0x113')](config[_0xd30c('0x114')],'/server/files/plugins')));_0x4d00e4[_0xd30c('0x11c')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x4d00e4[_0xd30c('0x11c')]('/*')[_0xd30c('0x11d')](function(_0x587149,_0x65b63f){_0x65b63f[_0xd30c('0x11e')](path[_0xd30c('0x11f')](_0x4d00e4[_0xd30c('0x11d')]('appPath')+_0xd30c('0x120')));});};var sensitiveFields=['username',_0xd30c('0x121'),'newPassword',_0xd30c('0x122'),_0xd30c('0x123'),_0xd30c('0x124'),_0xd30c('0x125'),_0xd30c('0x126'),'mobile','fax','email',_0xd30c('0x127'),_0xd30c('0x128'),_0xd30c('0x129'),_0xd30c('0x12a'),_0xd30c('0x12b'),'tenantId',_0xd30c('0x12c'),_0xd30c('0x12d'),_0xd30c('0x12e'),_0xd30c('0x12f'),_0xd30c('0x130'),_0xd30c('0x131'),_0xd30c('0x132'),'membername',_0xd30c('0x133'),_0xd30c('0x134'),_0xd30c('0x135'),_0xd30c('0x136'),_0xd30c('0x137'),_0xd30c('0x138'),_0xd30c('0x139'),_0xd30c('0x13a'),'key',_0xd30c('0x15'),_0xd30c('0x13b'),_0xd30c('0x13c'),_0xd30c('0x13d'),'dsn',_0xd30c('0x13e'),_0xd30c('0x13f'),_0xd30c('0x140')];function maskSensitiveData(_0x2528ca){var _0x439ddb=/(?!^)[\s\S](?!$)/g;if(!_[_0xd30c('0x141')](_0x2528ca))return;for(var _0x552031 in _0x2528ca){if(_[_0xd30c('0x142')](_0x2528ca[_0x552031])){for(var _0xb94fee=0x0;_0xb94fee<_0x2528ca[_0x552031]['length'];_0xb94fee++){maskSensitiveData(_0x2528ca[_0x552031][_0xb94fee]);}}else if(_[_0xd30c('0x141')](_0x2528ca[_0x552031])){maskSensitiveData(_0x2528ca[_0x552031]);}else if(_[_0xd30c('0x143')](_0x2528ca[_0x552031])){_0x2528ca[_0x552031]=_0x2528ca[_0x552031]['replace'](/{{{/g,_0xd30c('0x144'))[_0xd30c('0x145')](/}}}/g,_0xd30c('0x146'))[_0xd30c('0x145')](/{{/g,'@{')[_0xd30c('0x145')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x552031)){_0x2528ca[_0x552031]=_0x2528ca[_0x552031][_0xd30c('0x145')](_0x439ddb,'*');}}}} \ No newline at end of file +var _0xf8d1=['./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','mobile','fax','email','clientId','clientSecret','securityToken','code','tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','accountSid','localstationid','dsn','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','url','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','/api/voice/agents/reports','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue'];(function(_0x414648,_0x34a290){var _0x3fae7=function(_0x37fe41){while(--_0x37fe41){_0x414648['push'](_0x414648['shift']());}};_0x3fae7(++_0x34a290);}(_0xf8d1,0x7a));var _0x1f8d=function(_0x582f86,_0x610533){_0x582f86=_0x582f86-0x0;var _0x1a9433=_0xf8d1[_0x582f86];return _0x1a9433;};'use strict';var _=require(_0x1f8d('0x0'));var path=require(_0x1f8d('0x1'));var express=require(_0x1f8d('0x2'));var ewinston=require(_0x1f8d('0x3'));var util=require(_0x1f8d('0x4'));var errors=require(_0x1f8d('0x5'));var config=require(_0x1f8d('0x6'));var logger=require('./config/logger')(_0x1f8d('0x7'));var authLogger=require(_0x1f8d('0x8'))(_0x1f8d('0x9'));var safeTemplate=require('./safe-template')['safeTemplate'];exports[_0x1f8d('0xa')]=function(_0x46c86c){_0x46c86c[_0x1f8d('0xb')](ewinston[_0x1f8d('0xc')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x206db7,_0x364cd9){var _0x287aeb=_0x1f8d('0xd');if(!_['isEmpty'](_0x206db7[_0x1f8d('0xe')])){_0x287aeb+='\x20body=%s';var _0x1c8241=_0x206db7[_0x1f8d('0xe')];maskSensitiveData(_0x1c8241);}return safeTemplate(util[_0x1f8d('0xf')](_0x287aeb,_0x206db7[_0x1f8d('0x10')],_0x206db7[_0x1f8d('0x11')][_0x1f8d('0x12')]?_0x206db7[_0x1f8d('0x11')]['x-forwarded-for']:_0x206db7[_0x1f8d('0x13')][_0x1f8d('0x14')]||_0x206db7['ip'],_0x206db7['url'],_0x364cd9[_0x1f8d('0x15')],_0x364cd9[_0x1f8d('0x16')],_0x206db7[_0x1f8d('0x17')]?_0x206db7[_0x1f8d('0x17')]['id']:null,_0x206db7['user']?_0x206db7['user'][_0x1f8d('0x18')]:null,_0x206db7['user']?_0x206db7[_0x1f8d('0x17')][_0x1f8d('0x19')]:null,_0x1c8241?util[_0x1f8d('0x1a')](_0x1c8241,![],null):''));}}));_0x46c86c[_0x1f8d('0xb')](ewinston[_0x1f8d('0xc')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x434507,_0x1e6a9b){var _0x518d23=_0x1f8d('0x1b');if(_0x434507[_0x1f8d('0xe')]&&_0x434507[_0x1f8d('0xe')]['device']&&_0x434507[_0x1f8d('0xe')][_0x1f8d('0x1c')]){_0x518d23='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x1f8d('0xf')](_0x518d23,_0x434507[_0x1f8d('0x10')],_0x434507[_0x1f8d('0x11')]['x-forwarded-for']?_0x434507['headers'][_0x1f8d('0x12')]:_0x434507['connection'][_0x1f8d('0x14')]||_0x434507['ip'],_0x434507[_0x1f8d('0x1d')],_0x1e6a9b[_0x1f8d('0x15')],_0x1e6a9b['responseTime'],_0x434507['user']?_0x434507['user']['id']:null,_0x434507[_0x1f8d('0x17')]?_0x434507[_0x1f8d('0x17')][_0x1f8d('0x18')]:null,_0x434507[_0x1f8d('0x17')]?_0x434507[_0x1f8d('0x17')][_0x1f8d('0x19')]:null,_0x434507[_0x1f8d('0xe')]&&_0x434507[_0x1f8d('0xe')]['device']?_0x434507[_0x1f8d('0xe')][_0x1f8d('0x1e')]:_0x1f8d('0x1f'),_0x434507['body']&&_0x434507[_0x1f8d('0xe')][_0x1f8d('0x1c')]?_0x434507[_0x1f8d('0xe')][_0x1f8d('0x1c')]:'',_0x434507[_0x1f8d('0xe')]&&_0x434507[_0x1f8d('0xe')][_0x1f8d('0x20')]?_0x434507[_0x1f8d('0xe')]['agent_name']:'');},'ignoreRoute':function(_0x3fd0fe){var _0x35c4d0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x35c4d0[_0x1f8d('0x21')](_0x3fd0fe[_0x1f8d('0x1d')]);}}));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x22'),require(_0x1f8d('0x23')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x24'),require(_0x1f8d('0x25')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x26'),require('./api/voiceContext'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x27'),require(_0x1f8d('0x28')));_0x46c86c[_0x1f8d('0xb')]('/api/voice/mohs',require(_0x1f8d('0x29')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x2a'),require('./api/voiceQueue'));_0x46c86c['use'](_0x1f8d('0x2b'),require(_0x1f8d('0x2c')));_0x46c86c[_0x1f8d('0xb')]('/api/screen/recordings',require(_0x1f8d('0x2d')));_0x46c86c['use'](_0x1f8d('0x2e'),require(_0x1f8d('0x2f')));_0x46c86c['use'](_0x1f8d('0x30'),require(_0x1f8d('0x31')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x32'),require('./api/voiceCallReport'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x33'),require('./api/voiceDialReport'));_0x46c86c['use'](_0x1f8d('0x34'),require('./api/voiceAgentReport'));_0x46c86c[_0x1f8d('0xb')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x35'),require('./api/memberReport'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x36'),require(_0x1f8d('0x37')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x38'),require(_0x1f8d('0x39')));_0x46c86c['use']('/api/mail/out_servers',require(_0x1f8d('0x3a')));_0x46c86c['use'](_0x1f8d('0x3b'),require('./api/mailAccount'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x3c'),require(_0x1f8d('0x3d')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x3e'),require(_0x1f8d('0x3f')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x40'),require(_0x1f8d('0x41')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x42'),require('./api/mailMessage'));_0x46c86c[_0x1f8d('0xb')]('/api/mail/applications',require(_0x1f8d('0x43')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x44'),require(_0x1f8d('0x45')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x46'),require(_0x1f8d('0x47')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x48'),require(_0x1f8d('0x49')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x4a'),require(_0x1f8d('0x4b')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x4c'),require(_0x1f8d('0x4d')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x4e'),require('./api/faxInteraction'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x4f'),require(_0x1f8d('0x50')));_0x46c86c[_0x1f8d('0xb')]('/api/fax/queues',require(_0x1f8d('0x51')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x52'),require(_0x1f8d('0x53')));_0x46c86c['use'](_0x1f8d('0x54'),require('./api/smsAccount'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x55'),require('./api/smsApplication'));_0x46c86c['use'](_0x1f8d('0x56'),require('./api/smsInteraction'));_0x46c86c[_0x1f8d('0xb')]('/api/sms/messages',require(_0x1f8d('0x57')));_0x46c86c[_0x1f8d('0xb')]('/api/sms/queues',require(_0x1f8d('0x58')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x59'),require(_0x1f8d('0x5a')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x5b'),require('./api/openchannelApplication'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x5c'),require(_0x1f8d('0x5d')));_0x46c86c['use']('/api/openchannel/messages',require(_0x1f8d('0x5e')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x5f'),require('./api/openchannelQueue'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x60'),require(_0x1f8d('0x61')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x62'),require(_0x1f8d('0x63')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x64'),require('./api/chatApplication'));_0x46c86c[_0x1f8d('0xb')]('/api/chat/interactions',require(_0x1f8d('0x65')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x66'),require(_0x1f8d('0x67')));_0x46c86c['use']('/api/chat/offline_messages',require(_0x1f8d('0x68')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x69'),require(_0x1f8d('0x6a')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x6b'),require('./api/chatGroup'));_0x46c86c[_0x1f8d('0xb')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x46c86c[_0x1f8d('0xb')]('/api/cm/companies',require('./api/cmCompany'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x6c'),require(_0x1f8d('0x6d')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x6e'),require(_0x1f8d('0x6f')));_0x46c86c['use'](_0x1f8d('0x70'),require('./api/cmHopperBlack'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x71'),require(_0x1f8d('0x72')));_0x46c86c['use'](_0x1f8d('0x73'),require(_0x1f8d('0x74')));_0x46c86c['use'](_0x1f8d('0x75'),require('./api/cmCustomField'));_0x46c86c['use'](_0x1f8d('0x76'),require(_0x1f8d('0x77')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x78'),require(_0x1f8d('0x79')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x7a'),require(_0x1f8d('0x7b')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x7c'),require(_0x1f8d('0x7d')));_0x46c86c[_0x1f8d('0xb')]('/api/conditions',require(_0x1f8d('0x7e')));_0x46c86c['use']('/api/intervals',require(_0x1f8d('0x7f')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x80'),require(_0x1f8d('0x81')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x82'),require(_0x1f8d('0x83')));_0x46c86c['use']('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x46c86c['use'](_0x1f8d('0x84'),require('./api/schedule'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x85'),require(_0x1f8d('0x86')));_0x46c86c['use'](_0x1f8d('0x87'),require(_0x1f8d('0x88')));_0x46c86c[_0x1f8d('0xb')]('/api/templates',require('./api/template'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x89'),require(_0x1f8d('0x8a')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x8b'),require(_0x1f8d('0x8c')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x8d'),require(_0x1f8d('0x8e')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x8f'),require(_0x1f8d('0x90')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x91'),require('./api/analyticCustomReport'));_0x46c86c['use'](_0x1f8d('0x92'),require('./api/analyticDefaultReport'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x93'),require(_0x1f8d('0x94')));_0x46c86c['use'](_0x1f8d('0x95'),require(_0x1f8d('0x96')));_0x46c86c[_0x1f8d('0xb')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x46c86c[_0x1f8d('0xb')]('/api/analytics/tree_reports',require(_0x1f8d('0x97')));_0x46c86c['use'](_0x1f8d('0x98'),require(_0x1f8d('0x99')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x9a'),require(_0x1f8d('0x9b')));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x9c'),require(_0x1f8d('0x9d')));_0x46c86c['use'](_0x1f8d('0x9e'),require(_0x1f8d('0x9f')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xa0'),require(_0x1f8d('0xa1')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xa2'),require(_0x1f8d('0xa3')));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/desk/configurations',require(_0x1f8d('0xa4')));_0x46c86c['use'](_0x1f8d('0xa5'),require('./api/intDeskField'));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/zoho/accounts',require(_0x1f8d('0xa6')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xa7'),require(_0x1f8d('0xa8')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xa9'),require('./api/intZohoField'));_0x46c86c['use'](_0x1f8d('0xaa'),require('./api/intZendeskAccount'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xab'),require(_0x1f8d('0xac')));_0x46c86c['use'](_0x1f8d('0xad'),require(_0x1f8d('0xae')));_0x46c86c['use'](_0x1f8d('0xaf'),require(_0x1f8d('0xb0')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xb1'),require('./api/intFreshdeskConfiguration'));_0x46c86c['use'](_0x1f8d('0xb2'),require(_0x1f8d('0xb3')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xb4'),require(_0x1f8d('0xb5')));_0x46c86c['use'](_0x1f8d('0xb6'),require(_0x1f8d('0xb7')));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/vtiger/fields',require(_0x1f8d('0xb8')));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/servicenow/accounts',require(_0x1f8d('0xb9')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xba'),require(_0x1f8d('0xbb')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xbc'),require(_0x1f8d('0xbd')));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x46c86c['use'](_0x1f8d('0xbe'),require(_0x1f8d('0xbf')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xc0'),require(_0x1f8d('0xc1')));_0x46c86c[_0x1f8d('0xb')]('/api/integrations/freshsales/accounts',require(_0x1f8d('0xc2')));_0x46c86c['use'](_0x1f8d('0xc3'),require('./api/intFreshsalesConfiguration'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xc4'),require('./api/intFreshsalesField'));_0x46c86c[_0x1f8d('0xb')]('/api/networks',require(_0x1f8d('0xc5')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xc6'),require(_0x1f8d('0xc7')));_0x46c86c['use'](_0x1f8d('0xc8'),require('./api/chatInternalMessage'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xc9'),require('./api/jscriptyAnswerReport'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xca'),require(_0x1f8d('0xcb')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xcc'),require(_0x1f8d('0xcd')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xce'),require('./api/smsQueueReport'));_0x46c86c[_0x1f8d('0xb')]('/api/square/reports',require(_0x1f8d('0xcf')));_0x46c86c['use']('/api/square/details/reports',require('./api/squareReportDetail'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xd0'),require(_0x1f8d('0xd1')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xd2'),require(_0x1f8d('0xd3')));_0x46c86c[_0x1f8d('0xb')]('/api/square/odbc',require('./api/squareOdbc'));_0x46c86c['use'](_0x1f8d('0xd4'),require(_0x1f8d('0xd5')));_0x46c86c[_0x1f8d('0xb')]('/api/square/recordings',require(_0x1f8d('0xd6')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xd7'),require('./api/squareMessage'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xd8'),require(_0x1f8d('0xd9')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xda'),require(_0x1f8d('0xdb')));_0x46c86c['use'](_0x1f8d('0xdc'),require(_0x1f8d('0xdd')));_0x46c86c['use'](_0x1f8d('0xde'),require(_0x1f8d('0xdf')));_0x46c86c['use'](_0x1f8d('0xe0'),require(_0x1f8d('0xe1')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xe2'),require(_0x1f8d('0xe3')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xe4'),require(_0x1f8d('0xe5')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xe6'),require('./api/chatTransferReport'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xe7'),require('./api/faxTransferReport'));_0x46c86c['use'](_0x1f8d('0xe8'),require(_0x1f8d('0xe9')));_0x46c86c[_0x1f8d('0xb')]('/api/sms/reports/transfer',require(_0x1f8d('0xea')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xeb'),require('./api/cmList'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xec'),require(_0x1f8d('0xed')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xee'),require('./api/userProfile'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xef'),require(_0x1f8d('0xf0')));_0x46c86c['use'](_0x1f8d('0xf1'),require(_0x1f8d('0xf2')));_0x46c86c[_0x1f8d('0xb')]('/api/userNotifications',require(_0x1f8d('0xf3')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xf4'),require(_0x1f8d('0xf5')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xf6'),require('./api/whatsappApplication'));_0x46c86c['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x46c86c['use']('/api/whatsapp/messages',require(_0x1f8d('0xf7')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xf8'),require('./api/whatsappQueueReport'));_0x46c86c[_0x1f8d('0xb')]('/api/whatsapp/reports/transfer',require(_0x1f8d('0xf9')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xfa'),require(_0x1f8d('0xfb')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0xfc'),require(_0x1f8d('0xfd')));_0x46c86c['use'](_0x1f8d('0xfe'),require(_0x1f8d('0xff')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x100'),require(_0x1f8d('0x101')));_0x46c86c['use'](_0x1f8d('0x102'),require(_0x1f8d('0x103')));_0x46c86c['use'](_0x1f8d('0x104'),require(_0x1f8d('0x105')));_0x46c86c['use'](_0x1f8d('0x106'),require(_0x1f8d('0x107')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x108'),require(_0x1f8d('0x109')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x10a'),require('./api/version'));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x10b'),require(_0x1f8d('0x10c')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x10d'),require(_0x1f8d('0x10e')));_0x46c86c[_0x1f8d('0xb')]('/api/webbar',require(_0x1f8d('0x10f')));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x110'),express[_0x1f8d('0x111')](path[_0x1f8d('0x112')](config[_0x1f8d('0x113')],_0x1f8d('0x110'))));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x114'),express['static'](path['join'](config[_0x1f8d('0x113')],_0x1f8d('0x114'))));_0x46c86c['use'](_0x1f8d('0x115'),express[_0x1f8d('0x111')](path[_0x1f8d('0x112')](config[_0x1f8d('0x113')],_0x1f8d('0x115'))));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x116'),express[_0x1f8d('0x111')](path[_0x1f8d('0x112')](config[_0x1f8d('0x113')],'snippet',_0x1f8d('0x117'))));_0x46c86c[_0x1f8d('0xb')](_0x1f8d('0x118'),express[_0x1f8d('0x111')](path['join'](config['root'],_0x1f8d('0x119'))));_0x46c86c[_0x1f8d('0x11a')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x1f8d('0x11b')](errors[0x194]);_0x46c86c[_0x1f8d('0x11a')]('/*')['get'](function(_0x4035c1,_0x13e9e4){_0x13e9e4[_0x1f8d('0x11c')](path[_0x1f8d('0x11d')](_0x46c86c['get'](_0x1f8d('0x11e'))+_0x1f8d('0x11f')));});};var sensitiveFields=[_0x1f8d('0x120'),_0x1f8d('0x121'),_0x1f8d('0x122'),_0x1f8d('0x123'),_0x1f8d('0x124'),_0x1f8d('0x125'),_0x1f8d('0x126'),'phone',_0x1f8d('0x127'),_0x1f8d('0x128'),_0x1f8d('0x129'),_0x1f8d('0x12a'),_0x1f8d('0x12b'),_0x1f8d('0x12c'),_0x1f8d('0x12d'),'accessKey',_0x1f8d('0x12e'),_0x1f8d('0x12f'),_0x1f8d('0x130'),'accessToken',_0x1f8d('0x131'),_0x1f8d('0x132'),_0x1f8d('0x133'),'consumerSecret',_0x1f8d('0x134'),'calleridname',_0x1f8d('0x135'),_0x1f8d('0x136'),_0x1f8d('0x137'),_0x1f8d('0x138'),_0x1f8d('0x139'),'accesskeyid',_0x1f8d('0x13a'),_0x1f8d('0x13b'),_0x1f8d('0x17'),_0x1f8d('0x13c'),_0x1f8d('0x13d'),_0x1f8d('0x13e'),_0x1f8d('0x13f'),'secret',_0x1f8d('0x140'),'oldPassword'];function maskSensitiveData(_0x41ae62){var _0x54d1fe=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x41ae62))return;for(var _0x19ec7b in _0x41ae62){if(_[_0x1f8d('0x141')](_0x41ae62[_0x19ec7b])){for(var _0x5843ab=0x0;_0x5843ab<_0x41ae62[_0x19ec7b][_0x1f8d('0x142')];_0x5843ab++){maskSensitiveData(_0x41ae62[_0x19ec7b][_0x5843ab]);}}else if(_[_0x1f8d('0x143')](_0x41ae62[_0x19ec7b])){maskSensitiveData(_0x41ae62[_0x19ec7b]);}else if(_[_0x1f8d('0x144')](_0x41ae62[_0x19ec7b])){_0x41ae62[_0x19ec7b]=_0x41ae62[_0x19ec7b][_0x1f8d('0x145')](/{{{/g,_0x1f8d('0x146'))[_0x1f8d('0x145')](/}}}/g,_0x1f8d('0x147'))[_0x1f8d('0x145')](/{{/g,'@{')[_0x1f8d('0x145')](/}}/g,'}@');if(_[_0x1f8d('0x148')](sensitiveFields,_0x19ec7b)){_0x41ae62[_0x19ec7b]=_0x41ae62[_0x19ec7b][_0x1f8d('0x145')](_0x54d1fe,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9ec961c..763fae7 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba5c=['../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc'];(function(_0x50b2fe,_0x4a6b3c){var _0x1c48f0=function(_0x5e0763){while(--_0x5e0763){_0x50b2fe['push'](_0x50b2fe['shift']());}};_0x1c48f0(++_0x4a6b3c);}(_0xba5c,0x1bc));var _0xcba5=function(_0x2c97fd,_0x511278){_0x2c97fd=_0x2c97fd-0x0;var _0x2d1e17=_0xba5c[_0x2c97fd];return _0x2d1e17;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xcba5('0x0'));var _=require('lodash');var config=require(_0xcba5('0x1'));exports[_0xcba5('0x2')]=function(){return new BPromise(function(_0x27330f,_0x50d795){var _0x469c98={};_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x3')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x5')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/voiceQueue/voiceQueue.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x6')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x7')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x8')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x9')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xa')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0xb')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xc')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xd')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/mailServerIn/mailServerIn.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0xe')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0xf')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x10')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x11')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x12')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x13')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/faxAccount/faxAccount.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x14')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x15')));_0x469c98=_['merge'](_0x469c98,require('../api/faxMessage/faxMessage.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/faxQueue/faxQueue.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x16')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x17')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x18')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x19')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1a')));_0x469c98=_['merge'](_0x469c98,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1b')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x1c')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1d')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1e')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/chatQueue/chatQueue.rpc'));_0x469c98=_['merge'](_0x469c98,require('../api/cmContact/cmContact.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x1f')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x20')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x21')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x22')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x23')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/pause/pause.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x24')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x25')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/trigger/trigger.rpc'));_0x469c98=_['merge'](_0x469c98,require('../api/variable/variable.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x469c98=_['merge'](_0x469c98,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x26')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x27')));_0x469c98=_['merge'](_0x469c98,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x28')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x29')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x2a')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2b')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2c')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2d')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2e')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x2f')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x30')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x31')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/squareRecording/squareRecording.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x32')));_0x469c98=_['merge'](_0x469c98,require('../api/campaign/campaign.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x33')));_0x469c98=_['merge'](_0x469c98,require('../api/plugin/plugin.rpc'));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x34')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x35')));_0x469c98=_['merge'](_0x469c98,require(_0xcba5('0x36')));_0x469c98=_[_0xcba5('0x4')](_0x469c98,require(_0xcba5('0x37')));var _0x5e4250=jayson[_0xcba5('0x38')](_0x469c98)['http']();var _0x21db33=config[_0xcba5('0x39')][_0xcba5('0x3a')]||config[_0xcba5('0x3a')]+0x1;var _0x456736=config[_0xcba5('0x39')]['ip']||_0xcba5('0x3b');_0x5e4250['on'](_0xcba5('0x3c'),function(_0x2bad1b){return _0x50d795(_0x2bad1b);});_0x5e4250[_0xcba5('0x2')](_0x21db33,_0x456736,function(){console['log'](_0xcba5('0x3d'),_0x456736,_0x21db33);require(_0xcba5('0x3e'))[_0xcba5('0x3f')]();return _0x27330f(_0xcba5('0x40')+_0x456736+':'+_0x21db33);});});}; \ No newline at end of file +var _0xfc10=['../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.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','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xfc10,0x180));var _0x0fc1=function(_0x214cd1,_0x49a18e){_0x214cd1=_0x214cd1-0x0;var _0x364810=_0xfc10[_0x214cd1];return _0x364810;};'use strict';var jayson=require(_0x0fc1('0x0'));var BPromise=require(_0x0fc1('0x1'));var _=require(_0x0fc1('0x2'));var config=require(_0x0fc1('0x3'));exports[_0x0fc1('0x4')]=function(){return new BPromise(function(_0x14bab4,_0x4f7a3f){var _0x1cfdb2={};_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/user/user.rpc'));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x6')));_0x1cfdb2=_['merge'](_0x1cfdb2,require('../api/voiceQueue/voiceQueue.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x7')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x8')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x9')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0xa')));_0x1cfdb2=_['merge'](_0x1cfdb2,require('../api/memberReport/memberReport.rpc'));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0xb')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0xc')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0xd')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0xe')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/mailInteraction/mailInteraction.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0xf')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/mailApplication/mailApplication.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x10')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x11')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x12')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x13')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x14')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/faxQueue/faxQueue.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x15')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x16')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x17')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x18')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/smsQueue/smsQueue.rpc'));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x19')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x1a')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x1b')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x1c')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x1d')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x1e')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x1f')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x20')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x21')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/cmHopper/cmHopper.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x22')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x23')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x24')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x25')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x26')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x27')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x28')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x29')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x2a')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x2b')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x2c')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x2d')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x2e')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x2f')));_0x1cfdb2=_['merge'](_0x1cfdb2,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x30')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x31')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x32')));_0x1cfdb2=_['merge'](_0x1cfdb2,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x33')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x34')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x35')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x36')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x37')));_0x1cfdb2=_['merge'](_0x1cfdb2,require(_0x0fc1('0x38')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/squareRecording/squareRecording.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x39')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x3a')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/attachment/attachment.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/plugin/plugin.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x3b')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x3c')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x3d')));_0x1cfdb2=_[_0x0fc1('0x5')](_0x1cfdb2,require(_0x0fc1('0x3e')));var _0x4498fc=jayson[_0x0fc1('0x3f')](_0x1cfdb2)[_0x0fc1('0x40')]();var _0x53c0eb=config[_0x0fc1('0x41')][_0x0fc1('0x42')]||config[_0x0fc1('0x42')]+0x1;var _0x3efe47=config[_0x0fc1('0x41')]['ip']||_0x0fc1('0x43');_0x4498fc['on'](_0x0fc1('0x44'),function(_0x791370){return _0x4f7a3f(_0x791370);});_0x4498fc[_0x0fc1('0x4')](_0x53c0eb,_0x3efe47,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x3efe47,_0x53c0eb);require(_0x0fc1('0x45'))[_0x0fc1('0x46')]();return _0x14bab4(_0x0fc1('0x47')+_0x3efe47+':'+_0x53c0eb);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 9f218f2..1eb417f 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1eba=['\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x1eba[_0x138f59];return _0x3d114d;};var _=require(_0xa1eb('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b1355){return _0x2b1355==='{{'?_0xa1eb('0x1'):_0xa1eb('0x2');}function safeTemplate(_0x3ef7ee){var _0x5865fc=_0x3ef7ee;if(typeof _0x3ef7ee==='string'){_0x5865fc=_0x3ef7ee[_0xa1eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa1eb('0x4')](_0x3ef7ee)){_0x5865fc=_0x3ef7ee[_0xa1eb('0x5')](function(_0xf9d704){return safeTemplate(_0xf9d704);});}else if(_[_0xa1eb('0x6')](_0x3ef7ee)){_0x5865fc=Object[_0xa1eb('0x7')](_0x3ef7ee)[_0xa1eb('0x8')](function(_0x2bfbb0,_0x39a5a3){_0x2bfbb0[_0x39a5a3]=safeTemplate(_0x3ef7ee[_0x39a5a3]);return _0x2bfbb0;},{});}return _0x5865fc;}module[_0xa1eb('0x9')][_0xa1eb('0xa')]=safeTemplate; \ No newline at end of file +var _0x896e=['map','isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x2d55d5,_0x1742a3){var _0x14dd7d=function(_0x2b3d67){while(--_0x2b3d67){_0x2d55d5['push'](_0x2d55d5['shift']());}};_0x14dd7d(++_0x1742a3);}(_0x896e,0x1e9));var _0xe896=function(_0x43d2b6,_0x29f6d8){_0x43d2b6=_0x43d2b6-0x0;var _0x1f61a0=_0x896e[_0x43d2b6];return _0x1f61a0;};var _=require(_0xe896('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1bab19){return _0x1bab19==='{{'?_0xe896('0x1'):_0xe896('0x2');}function safeTemplate(_0x36085e){var _0x26d296=_0x36085e;if(typeof _0x36085e===_0xe896('0x3')){_0x26d296=_0x36085e[_0xe896('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe896('0x5')](_0x36085e)){_0x26d296=_0x36085e[_0xe896('0x6')](function(_0x244f68){return safeTemplate(_0x244f68);});}else if(_[_0xe896('0x7')](_0x36085e)){_0x26d296=Object['keys'](_0x36085e)[_0xe896('0x8')](function(_0x7a0721,_0x3b902c){_0x7a0721[_0x3b902c]=safeTemplate(_0x36085e[_0x3b902c]);return _0x7a0721;},{});}return _0x26d296;}module[_0xe896('0x9')][_0xe896('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 16c1137..15ea049 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 _0xf380=['streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','EventEmitter','./error','call','setEncoding','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','close','prototype','sendRequest','sync','answer','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP'];(function(_0x4045ff,_0x46cbcd){var _0x5797ac=function(_0x32003f){while(--_0x32003f){_0x4045ff['push'](_0x4045ff['shift']());}};_0x5797ac(++_0x46cbcd);}(_0xf380,0x1bf));var _0x0f38=function(_0x4143f1,_0x53b3){_0x4143f1=_0x4143f1-0x0;var _0x5e3b5b=_0xf380[_0x4143f1];return _0x5e3b5b;};'use strict';var util=require('util');var _=require(_0x0f38('0x0'));var EventEmitter=require('events')[_0x0f38('0x1')];var AGIReply=require('./reply');var AGIError=require(_0x0f38('0x2'));function AGIChannel(_0x39ec37){var _0x3ba9d3=this,_0x1110c6=new AGIReply(),_0x4352a6=![],_0x24e289={};EventEmitter[_0x0f38('0x3')](_0x3ba9d3);_0x39ec37[_0x0f38('0x4')]('utf8');_0x39ec37[_0x0f38('0x5')](0x8*0x3c*0x3c*0x3e8);_0x1110c6[_0x0f38('0x4')]('utf8');_0x1110c6['on'](_0x0f38('0x6'),function(_0x1194c1){for(var _0x43ff17 in _0x1194c1){_0x3ba9d3[_0x43ff17]=_0x1194c1[_0x43ff17];}_0x3ba9d3[_0x0f38('0x7')](_0x0f38('0x8'));});_0x1110c6['on'](_0x0f38('0x9'),function(_0x1da45b){if(_0x1da45b[_0x0f38('0xa')]()=='hangup'){_0x3ba9d3[_0x0f38('0x7')](_0x0f38('0xb'));return;}if(_0x1da45b[_0x0f38('0xc')](0x0,0xb)==_0x0f38('0xd')){_0x4352a6=!![];}if(_0x4352a6){_0x24e289['rx']+=_0x1da45b+'\x0a';if(_0x1da45b['search'](_0x0f38('0xe'))!=-0x1){_0x4352a6=![];}}else{_0x24e289['rx']=_0x1da45b;}if(_0x4352a6){return;}if(typeof _0x24e289['cb']==_0x0f38('0xf')){var _0x48ec3d=_0x24e289['rx'][_0x0f38('0xc')](0x0,0x3),_0x35fcf3=null,_0x40141e=null;_0x48ec3d=parseInt(_0x48ec3d);if(isNaN(_0x48ec3d)){_0x24e289['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0f38('0x10')});return;}if(_0x48ec3d!=0xc8){_0x24e289['cb'](null,{'code':_0x48ec3d,'result':-0x1,'extra':'KO'});return;}_0x35fcf3=_0x24e289['rx'][_0x0f38('0xc')](0x4)[_0x0f38('0x11')](_0x0f38('0x12'),'');if(_0x35fcf3[_0x0f38('0x13')]('\x20')!=-0x1){_0x35fcf3=_0x35fcf3[_0x0f38('0x14')](0x0,_0x35fcf3[_0x0f38('0x13')]('\x20'));}if(_[_0x0f38('0x15')](_0x35fcf3,'-1')){_0x35fcf3=parseInt(_0x35fcf3);}_0x40141e=_0x24e289['rx'][_0x0f38('0x16')]('\x20');if(_0x40141e['length']==0x3){_0x40141e=_0x40141e[0x2][_0x0f38('0xc')](0x1,_0x40141e[0x2][_0x0f38('0x17')]-0x1);}else if(_0x40141e[_0x0f38('0x17')]>0x3){var _0x3124ca=/\((.+)\)/;var _0x4a3110=_0x24e289['rx'][_0x0f38('0x18')](_0x3124ca);if(_0x4a3110){_0x40141e=_0x4a3110[0x1];}else{_0x40141e=null;}}else{_0x40141e=null;}_0x24e289['cb'](null,{'code':_0x48ec3d,'result':_0x35fcf3,'extra':_0x40141e});}});_0x39ec37['on'](_0x0f38('0x19'),function(_0x23159d){_0x3ba9d3[_0x0f38('0x7')]('error',new AGIError(_0x0f38('0x1a'),_0x23159d[_0x0f38('0x1b')]));});_0x39ec37['on']('close',function(){_0x3ba9d3[_0x0f38('0x7')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x39ec37['on']('timeout',function(){_0x3ba9d3[_0x0f38('0x7')](_0x0f38('0x1c'),new AGIError(_0x0f38('0x1d')));_0x39ec37[_0x0f38('0x1e')]();});_0x39ec37[_0x0f38('0x1f')](_0x1110c6);this['command']=function(_0x2a70df,_0x3493d3){var _0x2a70df=_0x2a70df||'',_0x3493d3=typeof _0x3493d3==_0x0f38('0xf')?_0x3493d3:new Function();_0x24e289={'tx':_0x2a70df,'rx':'','cb':_0x3493d3};_0x39ec37['write'](_0x2a70df+'\x0a');},this[_0x0f38('0x20')]=function(){_0x39ec37['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x0f38('0x21')][_0x0f38('0x22')]=function(_0x59e25b){return this['command'][_0x0f38('0x23')](this,_0x59e25b);};AGIChannel[_0x0f38('0x21')][_0x0f38('0x24')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x0f38('0x21')]['getData']=function(_0x38851e,_0x44de3d,_0x88213f){_0x38851e=_0x38851e===undefined?_0x0f38('0x25'):_0x38851e;_0x44de3d=_0x44de3d===undefined?'5':_0x44de3d;_0x88213f=_0x88213f===undefined?'1':_0x88213f;return this['sendRequest'](util['format'](_0x0f38('0x26'),_0x38851e,_0x44de3d*0x3e8,_0x88213f));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x27')]=function(_0x361f1d){_0x361f1d=_0x361f1d||_0x0f38('0x28');return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x2a'),_0x361f1d));};AGIChannel['prototype'][_0x0f38('0x2b')]=function(_0x5092c8,_0x50a42a){if(_[_0x0f38('0x2c')](_0x50a42a)){return this['sendRequest'](util[_0x0f38('0x29')](_0x0f38('0x2d'),_0x5092c8,_0x50a42a[_0x0f38('0x2e')](',')));}return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x2d'),_0x5092c8,_0x50a42a));};AGIChannel['prototype']['setContext']=function(_0x1a152c){return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x2f'),_0x1a152c));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x30')]=function(_0x58576e){return this[_0x0f38('0x22')](util['format']('SET\x20EXTENSION\x20%s',_0x58576e));};AGIChannel['prototype']['setPriority']=function(_0x21fa0d){return this['sendRequest'](util[_0x0f38('0x29')]('SET\x20PRIORITY\x20%s',_0x21fa0d));};AGIChannel[_0x0f38('0x21')][_0x0f38('0xb')]=function(){return this[_0x0f38('0x22')]('HANGUP');};AGIChannel[_0x0f38('0x21')][_0x0f38('0x31')]=function(_0x104e8e,_0x384948){var _0x5626e0=_[_0x0f38('0x32')](_0x384948)||_[_0x0f38('0x33')](_0x384948)?_0x384948[_0x0f38('0x34')]():_0x384948;return this['sendRequest'](util[_0x0f38('0x29')](_0x0f38('0x35'),_0x104e8e,_0x5626e0?_0x5626e0[_0x0f38('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x387bac,_0x41e44b){return this[_0x0f38('0x22')](util[_0x0f38('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0x387bac,_0x41e44b));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x36')]=function(_0x1695a4,_0x22166e){return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x37'),_0x1695a4,_0x22166e));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x38')]=function(_0x226d1f,_0x560c0a){return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x39'),_0x226d1f,_0x560c0a));};AGIChannel[_0x0f38('0x21')]['continueAt']=function(_0x20be68,_0x52a5c2,_0x59a95c){_0x52a5c2=_0x52a5c2||this[_0x0f38('0x3a')];_0x59a95c=_0x59a95c||0x1;this[_0x0f38('0x3b')](_0x20be68);this[_0x0f38('0x30')](_0x52a5c2);this['setPriority'](_0x59a95c);return this[_0x0f38('0x27')](util[_0x0f38('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x20be68,_0x52a5c2,_0x59a95c));};AGIChannel[_0x0f38('0x21')]['getVariable']=function(_0x1784d7){return this[_0x0f38('0x22')](util['format'](_0x0f38('0x3c'),_0x1784d7));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x3d')]=function(_0xb2fa42,_0x263890,_0x4942ae,_0x20a7a3,_0x5ada5f,_0x53440d){_0x263890=_0x263890||_0x0f38('0x3e');_0x4942ae=_0x4942ae||'';_0x20a7a3=_0x20a7a3===undefined?-0x1:_0x20a7a3==='-1'?-0x1:_0x20a7a3*0x3e8;_0x5ada5f=_0x5ada5f===undefined?'':'s='+_0x5ada5f;_0x53440d=_0x53440d?_0x0f38('0x3f'):'';return this[_0x0f38('0x22')](util[_0x0f38('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0xb2fa42,_0x263890,_0x4942ae,_0x20a7a3,_0x53440d,_0x5ada5f));};AGIChannel[_0x0f38('0x21')][_0x0f38('0x40')]=function(_0xfbae85,_0xc3fb57){_0xc3fb57=_0xc3fb57||'';return this[_0x0f38('0x22')](util[_0x0f38('0x29')](_0x0f38('0x41'),_0xfbae85,_0xc3fb57));};AGIChannel['prototype'][_0x0f38('0x42')]=function(_0x140a12){return this[_0x0f38('0x2b')](_0x0f38('0x43'),_0x140a12);};AGIChannel[_0x0f38('0x21')][_0x0f38('0x44')]=function(_0x1f119b){return this[_0x0f38('0x2b')](_0x0f38('0x45'),_0x1f119b);};AGIChannel[_0x0f38('0x21')][_0x0f38('0x19')]=function(_0x38f4bc,_0x54a376){this[_0x0f38('0x27')](util[_0x0f38('0x29')](_0x0f38('0x46'),_0x38f4bc['id'],_0x38f4bc[_0x0f38('0x47')],_0x54a376));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0f38('0x48')]=AGIChannel; \ No newline at end of file +var _0xec66=['join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./error','call','utf8','setTimeout','setEncoding','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','inherits','prototype','sendRequest','sync','answer','beep','format','isArray','EXEC\x20%s\x20%s'];(function(_0xe0d814,_0x4e76f3){var _0x182a3c=function(_0x23af8e){while(--_0x23af8e){_0xe0d814['push'](_0xe0d814['shift']());}};_0x182a3c(++_0x4e76f3);}(_0xec66,0x103));var _0x6ec6=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xec66[_0x3f6b1b];return _0x4a3d2b;};'use strict';var util=require(_0x6ec6('0x0'));var _=require(_0x6ec6('0x1'));var EventEmitter=require(_0x6ec6('0x2'))[_0x6ec6('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x6ec6('0x4'));function AGIChannel(_0x1fe192){var _0x785a46=this,_0x58a0b5=new AGIReply(),_0x1222b9=![],_0x4cc593={};EventEmitter[_0x6ec6('0x5')](_0x785a46);_0x1fe192['setEncoding'](_0x6ec6('0x6'));_0x1fe192[_0x6ec6('0x7')](0x8*0x3c*0x3c*0x3e8);_0x58a0b5[_0x6ec6('0x8')](_0x6ec6('0x6'));_0x58a0b5['on'](_0x6ec6('0x9'),function(_0x524d02){for(var _0x486113 in _0x524d02){_0x785a46[_0x486113]=_0x524d02[_0x486113];}_0x785a46['emit'](_0x6ec6('0xa'));});_0x58a0b5['on'](_0x6ec6('0xb'),function(_0x1b7a70){if(_0x1b7a70[_0x6ec6('0xc')]()==_0x6ec6('0xd')){_0x785a46[_0x6ec6('0xe')](_0x6ec6('0xd'));return;}if(_0x1b7a70[_0x6ec6('0xf')](0x0,0xb)==_0x6ec6('0x10')){_0x1222b9=!![];}if(_0x1222b9){_0x4cc593['rx']+=_0x1b7a70+'\x0a';if(_0x1b7a70['search'](_0x6ec6('0x11'))!=-0x1){_0x1222b9=![];}}else{_0x4cc593['rx']=_0x1b7a70;}if(_0x1222b9){return;}if(typeof _0x4cc593['cb']==_0x6ec6('0x12')){var _0x45726b=_0x4cc593['rx'][_0x6ec6('0xf')](0x0,0x3),_0x3ae057=null,_0x233b6c=null;_0x45726b=parseInt(_0x45726b);if(isNaN(_0x45726b)){_0x4cc593['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6ec6('0x13')});return;}if(_0x45726b!=0xc8){_0x4cc593['cb'](null,{'code':_0x45726b,'result':-0x1,'extra':'KO'});return;}_0x3ae057=_0x4cc593['rx'][_0x6ec6('0xf')](0x4)[_0x6ec6('0x14')](_0x6ec6('0x15'),'');if(_0x3ae057['indexOf']('\x20')!=-0x1){_0x3ae057=_0x3ae057['substr'](0x0,_0x3ae057[_0x6ec6('0x16')]('\x20'));}if(_[_0x6ec6('0x17')](_0x3ae057,'-1')){_0x3ae057=parseInt(_0x3ae057);}_0x233b6c=_0x4cc593['rx'][_0x6ec6('0x18')]('\x20');if(_0x233b6c[_0x6ec6('0x19')]==0x3){_0x233b6c=_0x233b6c[0x2][_0x6ec6('0xf')](0x1,_0x233b6c[0x2][_0x6ec6('0x19')]-0x1);}else if(_0x233b6c['length']>0x3){var _0x12ad2f=/\((.+)\)/;var _0x15962f=_0x4cc593['rx']['match'](_0x12ad2f);if(_0x15962f){_0x233b6c=_0x15962f[0x1];}else{_0x233b6c=null;}}else{_0x233b6c=null;}_0x4cc593['cb'](null,{'code':_0x45726b,'result':_0x3ae057,'extra':_0x233b6c});}});_0x1fe192['on']('error',function(_0xc41b0a){_0x785a46[_0x6ec6('0xe')](_0x6ec6('0x1a'),new AGIError(_0x6ec6('0x1b'),_0xc41b0a[_0x6ec6('0x1c')]));});_0x1fe192['on']('close',function(){_0x785a46[_0x6ec6('0xe')](_0x6ec6('0x1d'),new AGIError(_0x6ec6('0x1e')));});_0x1fe192['on'](_0x6ec6('0x1f'),function(){_0x785a46[_0x6ec6('0xe')](_0x6ec6('0x1f'),new AGIError(_0x6ec6('0x20')));_0x1fe192['destroy']();});_0x1fe192[_0x6ec6('0x21')](_0x58a0b5);this[_0x6ec6('0x22')]=function(_0x544a2d,_0x477fbb){var _0x544a2d=_0x544a2d||'',_0x477fbb=typeof _0x477fbb==_0x6ec6('0x12')?_0x477fbb:new Function();_0x4cc593={'tx':_0x544a2d,'rx':'','cb':_0x477fbb};_0x1fe192[_0x6ec6('0x23')](_0x544a2d+'\x0a');},this[_0x6ec6('0x1d')]=function(){_0x1fe192['destroy']();};}util[_0x6ec6('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x26')]=function(_0x192abd){return this[_0x6ec6('0x22')][_0x6ec6('0x27')](this,_0x192abd);};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x28')]=function(){return this[_0x6ec6('0x26')]('ANSWER');};AGIChannel[_0x6ec6('0x25')]['getData']=function(_0x2306cb,_0x30bd78,_0x1aa7e2){_0x2306cb=_0x2306cb===undefined?_0x6ec6('0x29'):_0x2306cb;_0x30bd78=_0x30bd78===undefined?'5':_0x30bd78;_0x1aa7e2=_0x1aa7e2===undefined?'1':_0x1aa7e2;return this[_0x6ec6('0x26')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2306cb,_0x30bd78*0x3e8,_0x1aa7e2));};AGIChannel[_0x6ec6('0x25')]['noop']=function(_0x2df116){_0x2df116=_0x2df116||'NO\x20MESSAGE';return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')]('VERBOSE\x20\x22%s\x22',_0x2df116));};AGIChannel[_0x6ec6('0x25')]['exec']=function(_0x5a85e1,_0x10c4f9){if(_[_0x6ec6('0x2b')](_0x10c4f9)){return this['sendRequest'](util[_0x6ec6('0x2a')](_0x6ec6('0x2c'),_0x5a85e1,_0x10c4f9[_0x6ec6('0x2d')](',')));}return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')]('EXEC\x20%s\x20%s',_0x5a85e1,_0x10c4f9));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x2e')]=function(_0x10cba4){return this[_0x6ec6('0x26')](util['format']('SET\x20CONTEXT\x20%s',_0x10cba4));};AGIChannel['prototype']['setExtension']=function(_0x4b2452){return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')](_0x6ec6('0x2f'),_0x4b2452));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x30')]=function(_0x59cb7b){return this[_0x6ec6('0x26')](util['format'](_0x6ec6('0x31'),_0x59cb7b));};AGIChannel[_0x6ec6('0x25')]['hangup']=function(){return this['sendRequest'](_0x6ec6('0x32'));};AGIChannel[_0x6ec6('0x25')]['setVariable']=function(_0x475db6,_0x1496ff){var _0x3bdf7e=_['isBoolean'](_0x1496ff)||_[_0x6ec6('0x33')](_0x1496ff)?_0x1496ff[_0x6ec6('0x34')]():_0x1496ff;return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')](_0x6ec6('0x35'),_0x475db6,_0x3bdf7e?_0x3bdf7e['toString']()[_0x6ec6('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6ec6('0x25')]['sayNumber']=function(_0x1c565e,_0x5871af){return this['sendRequest'](util['format'](_0x6ec6('0x36'),_0x1c565e,_0x5871af));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x37')]=function(_0x51000d,_0x1257b9){return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')](_0x6ec6('0x38'),_0x51000d,_0x1257b9));};AGIChannel['prototype'][_0x6ec6('0x39')]=function(_0x5ddd92,_0x31540c){return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')](_0x6ec6('0x3a'),_0x5ddd92,_0x31540c));};AGIChannel[_0x6ec6('0x25')]['continueAt']=function(_0x990d0c,_0x2e708a,_0x2c65b7){_0x2e708a=_0x2e708a||this[_0x6ec6('0x3b')];_0x2c65b7=_0x2c65b7||0x1;this[_0x6ec6('0x2e')](_0x990d0c);this[_0x6ec6('0x3c')](_0x2e708a);this[_0x6ec6('0x30')](_0x2c65b7);return this[_0x6ec6('0x3d')](util[_0x6ec6('0x2a')](_0x6ec6('0x3e'),_0x990d0c,_0x2e708a,_0x2c65b7));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x3f')]=function(_0x2f3f95){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2f3f95));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x40')]=function(_0xcc67d0,_0xfe40aa,_0x2d6182,_0x212f60,_0x2e1ba3,_0x2340a7){_0xfe40aa=_0xfe40aa||'wav';_0x2d6182=_0x2d6182||'';_0x212f60=_0x212f60===undefined?-0x1:_0x212f60==='-1'?-0x1:_0x212f60*0x3e8;_0x2e1ba3=_0x2e1ba3===undefined?'':'s='+_0x2e1ba3;_0x2340a7=_0x2340a7?_0x6ec6('0x41'):'';return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')](_0x6ec6('0x42'),_0xcc67d0,_0xfe40aa,_0x2d6182,_0x212f60,_0x2340a7,_0x2e1ba3));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x43')]=function(_0x313a81,_0x2b31da){_0x2b31da=_0x2b31da||'';return this[_0x6ec6('0x26')](util[_0x6ec6('0x2a')](_0x6ec6('0x44'),_0x313a81,_0x2b31da));};AGIChannel[_0x6ec6('0x25')][_0x6ec6('0x45')]=function(_0x24cfa5){return this[_0x6ec6('0x46')](_0x6ec6('0x47'),_0x24cfa5);};AGIChannel['prototype'][_0x6ec6('0x48')]=function(_0x1571e2){return this[_0x6ec6('0x46')](_0x6ec6('0x49'),_0x1571e2);};AGIChannel[_0x6ec6('0x25')]['error']=function(_0x2c0381,_0x38f37c){this[_0x6ec6('0x3d')](util[_0x6ec6('0x2a')](_0x6ec6('0x4a'),_0x2c0381['id'],_0x2c0381['label'],_0x38f37c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6ec6('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index eca72c1..17b5968 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 _0xfbdf=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','util','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfbdf,0xd9));var _0xffbd=function(_0x4738b7,_0x9096f0){_0x4738b7=_0x4738b7-0x0;var _0x47cb9e=_0xfbdf[_0x4738b7];return _0x47cb9e;};'use strict';var util=require(_0xffbd('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xffbd('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xffbd('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xffbd('0x3'),'E_AGI_SOCKET_ERROR':_0xffbd('0x4'),'E_AGI_SOCKET_CLOSE':_0xffbd('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xffbd('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xffbd('0x7'),'E_AGI_IVR_ENTRY':_0xffbd('0x8')};function AGIError(_0x19934a){var _0x19934a=_0x19934a||null,_0x3df9a7=_0x3df9a7||[],_0x42a703=0x1,_0x1b01ca='';if(!error[_0x19934a]){_0x19934a='E_AGI_UNDEFINED';}_0x3df9a7[_0xffbd('0x9')](error[_0x19934a]);while(arguments[_0x42a703]){_0x3df9a7[_0xffbd('0x9')](arguments[_0x42a703]);_0x42a703++;}_0x1b01ca=util[_0xffbd('0xa')]['apply'](util,_0x3df9a7);this[_0xffbd('0xb')]=_0x1b01ca;this[_0xffbd('0xc')]=_0x19934a;}module['exports']=AGIError; \ No newline at end of file +var _0xff19=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','message','name','exports','util','Undefined\x20error.'];(function(_0x48c363,_0x3aa848){var _0x39c4a7=function(_0xb33a30){while(--_0xb33a30){_0x48c363['push'](_0x48c363['shift']());}};_0x39c4a7(++_0x3aa848);}(_0xff19,0xdf));var _0x9ff1=function(_0x3240e2,_0x350be9){_0x3240e2=_0x3240e2-0x0;var _0x41679a=_0xff19[_0x3240e2];return _0x41679a;};'use strict';var util=require(_0x9ff1('0x0'));var error={'E_AGI_UNDEFINED':_0x9ff1('0x1'),'E_AGI_ARGUMENT_PORT':_0x9ff1('0x2'),'E_AGI_SERVER_ERROR':_0x9ff1('0x3'),'E_AGI_SERVER_CLOSE':_0x9ff1('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x9ff1('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x9ff1('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x9ff1('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x9ff1('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9ff1('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x47a7e7){var _0x47a7e7=_0x47a7e7||null,_0x23a566=_0x23a566||[],_0xd916=0x1,_0x5eb68a='';if(!error[_0x47a7e7]){_0x47a7e7=_0x9ff1('0xa');}_0x23a566['push'](error[_0x47a7e7]);while(arguments[_0xd916]){_0x23a566[_0x9ff1('0xb')](arguments[_0xd916]);_0xd916++;}_0x5eb68a=util['format']['apply'](util,_0x23a566);this[_0x9ff1('0xc')]=_0x5eb68a;this[_0x9ff1('0xd')]=_0x47a7e7;}module[_0x9ff1('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index db4b247..af24252 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 _0xa1f2=['addVertex','addEdge','push','size','getVertex','traverseBFS','info','no\x20vertex\x20found','length','condition','vswitch','default','target','agicommand','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0xa1f2,0x7e));var _0x2a1f=function(_0x3573c3,_0x145395){_0x3573c3=_0x3573c3-0x0;var _0x2b1831=_0xa1f2[_0x3573c3];return _0x2b1831;};'use strict';var _=require(_0x2a1f('0x0'));var logger=require(_0x2a1f('0x1'))(_0x2a1f('0x2'));var verticesWithRetry=[_0x2a1f('0x3'),'getdigits',_0x2a1f('0x4')];var Graph=function(){this[_0x2a1f('0x5')]={};this[_0x2a1f('0x6')]={};this[_0x2a1f('0x7')]=0x0;};Graph[_0x2a1f('0x8')][_0x2a1f('0x9')]=function(_0x3a0f4a){this[_0x2a1f('0x5')][_0x3a0f4a['id']]=_0x3a0f4a;this[_0x2a1f('0x6')][_0x3a0f4a['id']]=[];};Graph[_0x2a1f('0x8')][_0x2a1f('0xa')]=function(_0xdd7016,_0xe0c41c,_0x2fc545){this[_0x2a1f('0x6')][_0xdd7016][_0x2a1f('0xb')]({'target':_0xe0c41c,'condition':_0x2fc545});this[_0x2a1f('0x7')]+=0x1;};Graph[_0x2a1f('0x8')]['size']=function(){return _[_0x2a1f('0xc')](this[_0x2a1f('0x5')]);};Graph[_0x2a1f('0x8')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x2a1f('0x8')][_0x2a1f('0xd')]=function(_0x4f1685){return this[_0x2a1f('0x5')][_0x4f1685];};Graph[_0x2a1f('0x8')][_0x2a1f('0xe')]=function(_0x427976,_0x1d92a2){if(!this[_0x2a1f('0x5')][_0x427976]){return logger[_0x2a1f('0xf')](_0x2a1f('0x10'));}var _0x2036ad=_0x1d92a2(this['vertices'][_0x427976]);if(!_0x2036ad){return logger['info']('stop\x20traverse');}if(this[_0x2a1f('0x6')][_0x427976][_0x2a1f('0x11')]===0x0){return logger[_0x2a1f('0xf')]('no\x20edge/s\x20available');}for(var _0x32f88d=0x0,_0x1b5887=[],_0x19e2ad=![];_0x32f88d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','[%s]\x20%s','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex'];(function(_0x2c602e,_0x1d26f5){var _0x1a2650=function(_0x2370d1){while(--_0x2370d1){_0x2c602e['push'](_0x2c602e['shift']());}};_0x1a2650(++_0x1d26f5);}(_0x61f1,0x74));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var parser=require(_0x161f('0x0'));var _=require(_0x161f('0x1'));var syncho=require('syncho');var util=require(_0x161f('0x2'));var moment=require(_0x161f('0x3'));var config=require(_0x161f('0x4'));var logger=require(_0x161f('0x5'))(_0x161f('0x6'));var utilLicense=require(_0x161f('0x7'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x161f('0x8'));var Vertices=require(_0x161f('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x161f('0x6')]=_[_0x161f('0xa')](config[_0x161f('0x6')],{'ip':_0x161f('0xb'),'port':0x11dd});function connectionHandler(_0x418630){process[_0x161f('0xc')](function(){syncho(function(){try{setChannelVariables(_0x418630);agiHandler(_0x418630);}catch(_0x14b7c4){logger[_0x161f('0xd')](_0x14b7c4[_0x161f('0xe')]);}});});}function listeningHandler(){console[_0x161f('0xf')](_0x161f('0x10'),config[_0x161f('0x6')]['port']);logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x13'),config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x137449){if(_0x137449&&_0x137449['name']&&_0x137449['message']){logger[_0x161f('0xd')](util[_0x161f('0x12')](_0x161f('0x14'),_0x137449[_0x161f('0x15')],_0x137449[_0x161f('0x16')]));}else{logger[_0x161f('0xd')](util[_0x161f('0x12')]('[ERROR]\x20%s',_0x137449['stack']));}}function closeHandler(){logger['info'](util[_0x161f('0x12')](_0x161f('0x17'),this[_0x161f('0x18')],this[_0x161f('0x19')],this[_0x161f('0x1a')],this[_0x161f('0x1b')],this[_0x161f('0x1c')]));try{createSquareReport(this);}catch(_0x432de0){logger['error'](_0x432de0[_0x161f('0xe')]);}}function timeoutHandler(){logger[_0x161f('0x11')](util[_0x161f('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x161f('0x18')],this[_0x161f('0x19')],this['callerid'],this['dnid'],this[_0x161f('0x1c')]));}function hangupHandler(){logger[_0x161f('0x11')](util['format'](_0x161f('0x1d'),this['arg_1'],this[_0x161f('0x19')],this[_0x161f('0x1a')],this[_0x161f('0x1b')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x296fb5){return parser[_0x161f('0x1e')](_0x296fb5,{'object':!![]})[_0x161f('0x1f')][_0x161f('0x20')];}function addVertex(_0x1f64b6,_0x42f964,_0x412f83){_0x42f964[_0x161f('0x21')]=_0x412f83;if(_0x42f964[_0x161f('0x22')](_0x161f('0x23'))){_0x42f964[_0x161f('0x24')]=parseInt(_0x42f964['retry'],0xa);}_0x1f64b6[_0x161f('0x25')](_[_0x161f('0x26')](_0x42f964,'mxCell'));}function initGraph(_0x8ce645,_0x52c277){var _0x529e4e=new Graph();for(var _0x5de994 in _0x8ce645){if(_0x8ce645[_0x161f('0x22')](_0x5de994)){if(_['isArray'](_0x8ce645[_0x5de994])){for(var _0x4f65d4=0x0;_0x4f65d4<_0x8ce645[_0x5de994][_0x161f('0x27')];_0x4f65d4+=0x1){addVertex(_0x529e4e,_0x8ce645[_0x5de994][_0x4f65d4],_0x5de994);}}else{addVertex(_0x529e4e,_0x8ce645[_0x5de994],_0x5de994);}}}for(var _0x3eac4e=0x0;_0x3eac4e<_0x52c277[_0x161f('0x27')];_0x3eac4e+=0x1){if(_0x52c277[_0x3eac4e][_0x161f('0x28')]&&_0x52c277[_0x3eac4e]['target']){_0x529e4e['addEdge'](_0x52c277[_0x3eac4e][_0x161f('0x28')],_0x52c277[_0x3eac4e][_0x161f('0x29')],_0x52c277[_0x3eac4e][_0x161f('0x2a')]);}}return _0x529e4e;}function getSquareProject(_0x2fcdf6,_0x898fc6){rpc[_0x161f('0x2b')](_0x2fcdf6)[_0x161f('0x2c')](function(_0x4f4346){_0x898fc6(null,_0x4f4346);})[_0x161f('0x2d')](function(_0x2ea68c){_0x898fc6(null,_0x2ea68c);});}function createSquareReport(_0x2c0dea,_0xec622f){rpc[_0x161f('0x2e')](_0x2c0dea)[_0x161f('0x2c')](function(_0x468219){if(_0xec622f){_0xec622f(null,_0x468219);}})[_0x161f('0x2d')](function(_0x2092cd){if(_0xec622f){_0xec622f(null,_0x2092cd);}});}function setChannelVariables(_0x12fe12){for(var _0x153d14 in _0x12fe12){if(_0x12fe12[_0x161f('0x22')](_0x153d14)){if(_0x153d14['indexOf'](_0x161f('0x2f'))===0x0){_0x12fe12[_0x153d14['substring'](0x4)]=_0x12fe12[_0x153d14];delete _0x12fe12[_0x153d14];}}}}function getLogFromObject(_0xd75289){return util['inspect'](_0xd75289,{'showHidden':![],'depth':null});}function agiHandler(_0x508fe0){var _0x10740e,_0x11ab5b,_0x5d2b27,_0x128c46,_0x4a8a49;logger[_0x161f('0x30')]('variables',JSON['stringify'](_0x508fe0,null,0x2));logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x31'),_0x508fe0[_0x161f('0x18')],_0x508fe0[_0x161f('0x19')],_0x508fe0[_0x161f('0x1a')],_0x508fe0[_0x161f('0x1b')],_0x508fe0[_0x161f('0x1c')]));_0x508fe0['on']('error',errorHandler);_0x508fe0['on'](_0x161f('0x32'),closeHandler);_0x508fe0['on'](_0x161f('0x33'),timeoutHandler);_0x508fe0[_0x161f('0x34')]=![];_0x508fe0['on']('hangup',hangupHandler);var _0x12f1be=getSquareProject[_0x161f('0x35')](null,_0x508fe0[_0x161f('0x18')]);if(_0x12f1be){if(_0x12f1be[_0x161f('0x36')]){_0x10740e=getRoot(_0x12f1be[_0x161f('0x36')]);if(_0x10740e&&_0x10740e[_0x161f('0x37')]){logger[_0x161f('0x30')](_0x161f('0x20'),JSON[_0x161f('0x38')](_0x10740e,null,0x2));_0x508fe0[_0x161f('0x39')]=moment()['format'](_0x161f('0x3a'));_0x11ab5b=initGraph(_[_0x161f('0x26')](_0x10740e,_0x161f('0x3b')),_0x10740e['mxCell']);_0x5d2b27=new Vertices(_0x508fe0,rpc,mailRpc);logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x3c'),_0x508fe0[_0x161f('0x18')],_0x508fe0['calleridname'],_0x508fe0[_0x161f('0x1a')],_0x508fe0['dnid'],_0x508fe0[_0x161f('0x1c')]));_0x11ab5b[_0x161f('0x3d')](_0x10740e['start']['id'],function(_0x5bbdf0){try{_0x5bbdf0=_0x5d2b27[_0x161f('0x3e')](_0x5bbdf0);logger[_0x161f('0x30')](_0x161f('0x3f'),JSON[_0x161f('0x38')](_0x5bbdf0,null,0x2));if(_0x5bbdf0[_0x161f('0x21')]===_0x161f('0x40')){logger['info'](_0x161f('0x41'));_0x508fe0['context']=_0x5bbdf0[_0x161f('0x42')]||_0x508fe0[_0x161f('0x42')];_0x508fe0['extension']=_0x5bbdf0[_0x161f('0x43')];_0x508fe0['priority']=_0x5bbdf0['priority']?_0x5bbdf0[_0x161f('0x44')]-0x1:0x1;return null;}else if(_0x5bbdf0&&_0x5d2b27[_0x5bbdf0[_0x161f('0x21')]]){_0x4a8a49=_0x5d2b27[_0x5bbdf0[_0x161f('0x21')]](_0x5bbdf0);logger['info'](_0x161f('0x45'),JSON[_0x161f('0x38')](_0x4a8a49,null,0x2));if(_0x4a8a49&&_0x4a8a49[_0x161f('0x46')]===AGI_CODE_SUCCESS&&_0x4a8a49[_0x161f('0x47')]!==AGI_RESULT_ERROR&&!_0x508fe0[_0x161f('0x34')]){logger[_0x161f('0x30')](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return _[_0x161f('0x48')](_0x4a8a49[_0x161f('0x47')])?null:_0x4a8a49[_0x161f('0x47')][_0x161f('0x49')]();}else{logger['error'](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return null;}}else{logger['error'](_0x161f('0x4a'));return null;}}catch(_0x1b6ced){logger[_0x161f('0xd')](_0x1b6ced['stack']);return null;}});if(_0x10740e[_0x161f('0x4b')]){logger[_0x161f('0x11')](util['format'](_0x161f('0x4c'),_0x508fe0[_0x161f('0x18')],_0x508fe0[_0x161f('0x19')],_0x508fe0['callerid'],_0x508fe0[_0x161f('0x1b')],_0x508fe0[_0x161f('0x1c')]));_0x11ab5b['traverseBFS'](_0x10740e[_0x161f('0x4b')]['id'],function(_0x585fc1){try{_0x585fc1=_0x5d2b27['clear'](_0x585fc1);logger[_0x161f('0x30')](_0x161f('0x3f'),JSON[_0x161f('0x38')](_0x585fc1,null,0x2));if(_0x585fc1&&_0x5d2b27[_0x585fc1[_0x161f('0x21')]]){_0x4a8a49=_0x5d2b27[_0x585fc1[_0x161f('0x21')]](_0x585fc1);if(_0x4a8a49){logger['debug'](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return _['isUndefined'](_0x4a8a49['result'])?null:_0x4a8a49[_0x161f('0x47')][_0x161f('0x49')]();}else{logger['error'](_0x161f('0x45'),getLogFromObject(_0x4a8a49));return null;}}else{logger[_0x161f('0xd')](_0x161f('0x4a'));return null;}}catch(_0x58b6bf){logger[_0x161f('0xd')](_0x58b6bf[_0x161f('0xe')]);return null;}});}logger[_0x161f('0x11')](util[_0x161f('0x12')](_0x161f('0x4d'),_0x508fe0[_0x161f('0x18')],_0x508fe0['calleridname'],_0x508fe0[_0x161f('0x1a')],_0x508fe0[_0x161f('0x1b')],_0x508fe0['uniqueid']));logger[_0x161f('0x11')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x508fe0['context'],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1));_0x508fe0['continueAt'](_0x508fe0['context'],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1);_0x508fe0[_0x161f('0x32')]();}}else{logger['error'](util['format'](_0x161f('0x4e'),_0x508fe0[_0x161f('0x18')]));_0x508fe0[_0x161f('0x4f')](_0x508fe0[_0x161f('0x42')],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1);_0x508fe0[_0x161f('0x32')]();}}else{logger['error'](util[_0x161f('0x12')](_0x161f('0x50'),_0x508fe0[_0x161f('0x18')]));_0x508fe0[_0x161f('0x4f')](_0x508fe0[_0x161f('0x42')],_0x508fe0[_0x161f('0x43')],parseInt(_0x508fe0[_0x161f('0x44')],0xa)+0x1);_0x508fe0[_0x161f('0x32')]();}}function main(){var _0x4bb91a;return utilLicense['getLicense']()[_0x161f('0x2c')](function(_0x75805a){if(_0x75805a){if(_0x75805a[_0x161f('0x51')]){if(_0x75805a['callysquare']&&_0x75805a[_0x161f('0x52')]>0x0){logger[_0x161f('0x11')](util['format'](_0x161f('0x53'),_0x75805a[_0x161f('0x52')]));_0x4bb91a=_0x75805a[_0x161f('0x52')];}else{logger[_0x161f('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x161f('0x11')](_0x161f('0x54'));_0x4bb91a=-0x1;}}})[_0x161f('0x2d')](function(_0x315e2c){logger[_0x161f('0xd')](_0x161f('0x55'),_0x315e2c[_0x161f('0xe')]);})[_0x161f('0x4b')](function(){var _0x25848a=require(_0x161f('0x56'))(config[_0x161f('0x6')][_0x161f('0x57')],config[_0x161f('0x6')]['ip'],_0x4bb91a);_0x25848a['on'](_0x161f('0xd'),errorHandler);_0x25848a['on'](_0x161f('0x58'),listeningHandler);_0x25848a['on'](_0x161f('0x59'),connectionHandler);_0x25848a['on'](_0x161f('0x32'),closeHandler);});}main(); \ No newline at end of file +var _0xe6e5=['moment','../../config/environment','./rpc','./mailRpc','./graph','defaults','agi','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message','[%s]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','source','target','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','gotoc\x20block\x20stop\x20traverse\x20BFS','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','finally','clear','[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','close','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho','util'];(function(_0x2ae7b0,_0x30137f){var _0x111498=function(_0x5efbce){while(--_0x5efbce){_0x2ae7b0['push'](_0x2ae7b0['shift']());}};_0x111498(++_0x30137f);}(_0xe6e5,0x10a));var _0x5e6e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe6e5[_0x4ae6ef];return _0x3cbb4e;};'use strict';var parser=require(_0x5e6e('0x0'));var _=require(_0x5e6e('0x1'));var syncho=require(_0x5e6e('0x2'));var util=require(_0x5e6e('0x3'));var moment=require(_0x5e6e('0x4'));var config=require(_0x5e6e('0x5'));var logger=require('../../config/logger')('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x5e6e('0x6'));var mailRpc=require(_0x5e6e('0x7'));var Graph=require(_0x5e6e('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x5e6e('0x9')](config[_0x5e6e('0xa')],{'ip':_0x5e6e('0xb'),'port':0x11dd});function connectionHandler(_0x7e4367){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x7e4367);agiHandler(_0x7e4367);}catch(_0x553920){logger[_0x5e6e('0xc')](_0x553920[_0x5e6e('0xd')]);}});});}function listeningHandler(){console[_0x5e6e('0xe')](_0x5e6e('0xf'),config[_0x5e6e('0xa')][_0x5e6e('0x10')]);logger['info'](util[_0x5e6e('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x5e6e('0xa')]['ip'],config[_0x5e6e('0xa')]['port']));}function errorHandler(_0x1c413c){if(_0x1c413c&&_0x1c413c[_0x5e6e('0x12')]&&_0x1c413c[_0x5e6e('0x13')]){logger[_0x5e6e('0xc')](util[_0x5e6e('0x11')](_0x5e6e('0x14'),_0x1c413c[_0x5e6e('0x12')],_0x1c413c[_0x5e6e('0x13')]));}else{logger[_0x5e6e('0xc')](util[_0x5e6e('0x11')]('[ERROR]\x20%s',_0x1c413c[_0x5e6e('0xd')]));}}function closeHandler(){logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')](_0x5e6e('0x16'),this[_0x5e6e('0x17')],this['calleridname'],this[_0x5e6e('0x18')],this[_0x5e6e('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4ac66c){logger['error'](_0x4ac66c[_0x5e6e('0xd')]);}}function timeoutHandler(){logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')](_0x5e6e('0x1a'),this[_0x5e6e('0x17')],this[_0x5e6e('0x1b')],this[_0x5e6e('0x18')],this[_0x5e6e('0x19')],this[_0x5e6e('0x1c')]));}function hangupHandler(){logger[_0x5e6e('0x15')](util['format'](_0x5e6e('0x1d'),this['arg_1'],this[_0x5e6e('0x1b')],this[_0x5e6e('0x18')],this['dnid'],this[_0x5e6e('0x1c')]));this[_0x5e6e('0x1e')]=!![];}function getRoot(_0xe8d2fb){return parser[_0x5e6e('0x1f')](_0xe8d2fb,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x105e65,_0x36ddda,_0x5e9562){_0x36ddda[_0x5e6e('0x20')]=_0x5e9562;if(_0x36ddda[_0x5e6e('0x21')](_0x5e6e('0x22'))){_0x36ddda[_0x5e6e('0x23')]=parseInt(_0x36ddda[_0x5e6e('0x22')],0xa);}_0x105e65[_0x5e6e('0x24')](_[_0x5e6e('0x25')](_0x36ddda,_0x5e6e('0x26')));}function initGraph(_0x3173fd,_0x1ff37d){var _0x3e8c22=new Graph();for(var _0x373621 in _0x3173fd){if(_0x3173fd[_0x5e6e('0x21')](_0x373621)){if(_[_0x5e6e('0x27')](_0x3173fd[_0x373621])){for(var _0x2c1dce=0x0;_0x2c1dce<_0x3173fd[_0x373621]['length'];_0x2c1dce+=0x1){addVertex(_0x3e8c22,_0x3173fd[_0x373621][_0x2c1dce],_0x373621);}}else{addVertex(_0x3e8c22,_0x3173fd[_0x373621],_0x373621);}}}for(var _0x5330ee=0x0;_0x5330ee<_0x1ff37d['length'];_0x5330ee+=0x1){if(_0x1ff37d[_0x5330ee][_0x5e6e('0x28')]&&_0x1ff37d[_0x5330ee][_0x5e6e('0x29')]){_0x3e8c22['addEdge'](_0x1ff37d[_0x5330ee][_0x5e6e('0x28')],_0x1ff37d[_0x5330ee]['target'],_0x1ff37d[_0x5330ee][_0x5e6e('0x2a')]);}}return _0x3e8c22;}function getSquareProject(_0x3d6e50,_0x7b14f5){rpc[_0x5e6e('0x2b')](_0x3d6e50)[_0x5e6e('0x2c')](function(_0x582204){_0x7b14f5(null,_0x582204);})[_0x5e6e('0x2d')](function(_0x21ba0a){_0x7b14f5(null,_0x21ba0a);});}function createSquareReport(_0x555d36,_0x2bea7e){rpc[_0x5e6e('0x2e')](_0x555d36)[_0x5e6e('0x2c')](function(_0x2580f1){if(_0x2bea7e){_0x2bea7e(null,_0x2580f1);}})[_0x5e6e('0x2d')](function(_0x52c262){if(_0x2bea7e){_0x2bea7e(null,_0x52c262);}});}function setChannelVariables(_0x4db0f1){for(var _0x546202 in _0x4db0f1){if(_0x4db0f1[_0x5e6e('0x21')](_0x546202)){if(_0x546202[_0x5e6e('0x2f')](_0x5e6e('0x30'))===0x0){_0x4db0f1[_0x546202[_0x5e6e('0x31')](0x4)]=_0x4db0f1[_0x546202];delete _0x4db0f1[_0x546202];}}}}function getLogFromObject(_0x35b8ee){return util[_0x5e6e('0x32')](_0x35b8ee,{'showHidden':![],'depth':null});}function agiHandler(_0x4e7b9a){var _0x3f720d,_0x442759,_0x374e88,_0x550e5f,_0x37b545;logger[_0x5e6e('0x33')](_0x5e6e('0x34'),JSON[_0x5e6e('0x35')](_0x4e7b9a,null,0x2));logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')](_0x5e6e('0x36'),_0x4e7b9a[_0x5e6e('0x17')],_0x4e7b9a[_0x5e6e('0x1b')],_0x4e7b9a[_0x5e6e('0x18')],_0x4e7b9a[_0x5e6e('0x19')],_0x4e7b9a['uniqueid']));_0x4e7b9a['on'](_0x5e6e('0xc'),errorHandler);_0x4e7b9a['on']('close',closeHandler);_0x4e7b9a['on'](_0x5e6e('0x37'),timeoutHandler);_0x4e7b9a[_0x5e6e('0x1e')]=![];_0x4e7b9a['on'](_0x5e6e('0x38'),hangupHandler);var _0xf222d9=getSquareProject['sync'](null,_0x4e7b9a['arg_1']);if(_0xf222d9){if(_0xf222d9[_0x5e6e('0x39')]){_0x3f720d=getRoot(_0xf222d9[_0x5e6e('0x39')]);if(_0x3f720d&&_0x3f720d[_0x5e6e('0x3a')]){logger['debug'](_0x5e6e('0x3b'),JSON[_0x5e6e('0x35')](_0x3f720d,null,0x2));_0x4e7b9a[_0x5e6e('0x3c')]=moment()[_0x5e6e('0x11')](_0x5e6e('0x3d'));_0x442759=initGraph(_[_0x5e6e('0x25')](_0x3f720d,_0x5e6e('0x26')),_0x3f720d[_0x5e6e('0x26')]);_0x374e88=new Vertices(_0x4e7b9a,rpc,mailRpc);logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')](_0x5e6e('0x3e'),_0x4e7b9a[_0x5e6e('0x17')],_0x4e7b9a[_0x5e6e('0x1b')],_0x4e7b9a[_0x5e6e('0x18')],_0x4e7b9a[_0x5e6e('0x19')],_0x4e7b9a['uniqueid']));_0x442759[_0x5e6e('0x3f')](_0x3f720d['start']['id'],function(_0x4382b7){try{_0x4382b7=_0x374e88['clear'](_0x4382b7);logger['debug']('vertex',JSON['stringify'](_0x4382b7,null,0x2));if(_0x4382b7[_0x5e6e('0x20')]==='gotoc'){logger[_0x5e6e('0x15')](_0x5e6e('0x40'));_0x4e7b9a[_0x5e6e('0x41')]=_0x4382b7['context']||_0x4e7b9a[_0x5e6e('0x41')];_0x4e7b9a[_0x5e6e('0x42')]=_0x4382b7[_0x5e6e('0x42')];_0x4e7b9a['priority']=_0x4382b7['priority']?_0x4382b7[_0x5e6e('0x43')]-0x1:0x1;return null;}else if(_0x4382b7&&_0x374e88[_0x4382b7['agicommand']]){_0x37b545=_0x374e88[_0x4382b7[_0x5e6e('0x20')]](_0x4382b7);logger[_0x5e6e('0x15')]('response',JSON[_0x5e6e('0x35')](_0x37b545,null,0x2));if(_0x37b545&&_0x37b545[_0x5e6e('0x44')]===AGI_CODE_SUCCESS&&_0x37b545[_0x5e6e('0x45')]!==AGI_RESULT_ERROR&&!_0x4e7b9a[_0x5e6e('0x1e')]){logger['debug'](_0x5e6e('0x46'),getLogFromObject(_0x37b545));return _[_0x5e6e('0x47')](_0x37b545['result'])?null:_0x37b545[_0x5e6e('0x45')][_0x5e6e('0x48')]();}else{logger[_0x5e6e('0xc')](_0x5e6e('0x46'),getLogFromObject(_0x37b545));return null;}}else{logger['error'](_0x5e6e('0x49'));return null;}}catch(_0x4d0c1b){logger[_0x5e6e('0xc')](_0x4d0c1b['stack']);return null;}});if(_0x3f720d['finally']){logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')](_0x5e6e('0x4a'),_0x4e7b9a['arg_1'],_0x4e7b9a[_0x5e6e('0x1b')],_0x4e7b9a[_0x5e6e('0x18')],_0x4e7b9a[_0x5e6e('0x19')],_0x4e7b9a['uniqueid']));_0x442759[_0x5e6e('0x3f')](_0x3f720d[_0x5e6e('0x4b')]['id'],function(_0x380c16){try{_0x380c16=_0x374e88[_0x5e6e('0x4c')](_0x380c16);logger[_0x5e6e('0x33')]('vertex',JSON[_0x5e6e('0x35')](_0x380c16,null,0x2));if(_0x380c16&&_0x374e88[_0x380c16[_0x5e6e('0x20')]]){_0x37b545=_0x374e88[_0x380c16[_0x5e6e('0x20')]](_0x380c16);if(_0x37b545){logger[_0x5e6e('0x33')](_0x5e6e('0x46'),getLogFromObject(_0x37b545));return _[_0x5e6e('0x47')](_0x37b545[_0x5e6e('0x45')])?null:_0x37b545['result'][_0x5e6e('0x48')]();}else{logger['error'](_0x5e6e('0x46'),getLogFromObject(_0x37b545));return null;}}else{logger[_0x5e6e('0xc')](_0x5e6e('0x49'));return null;}}catch(_0x3d7073){logger['error'](_0x3d7073[_0x5e6e('0xd')]);return null;}});}logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')](_0x5e6e('0x4d'),_0x4e7b9a[_0x5e6e('0x17')],_0x4e7b9a['calleridname'],_0x4e7b9a[_0x5e6e('0x18')],_0x4e7b9a['dnid'],_0x4e7b9a['uniqueid']));logger[_0x5e6e('0x15')](util['format'](_0x5e6e('0x4e'),_0x4e7b9a[_0x5e6e('0x41')],_0x4e7b9a['extension'],parseInt(_0x4e7b9a[_0x5e6e('0x43')],0xa)+0x1));_0x4e7b9a[_0x5e6e('0x4f')](_0x4e7b9a['context'],_0x4e7b9a['extension'],parseInt(_0x4e7b9a[_0x5e6e('0x43')],0xa)+0x1);_0x4e7b9a['close']();}}else{logger[_0x5e6e('0xc')](util[_0x5e6e('0x11')](_0x5e6e('0x50'),_0x4e7b9a[_0x5e6e('0x17')]));_0x4e7b9a[_0x5e6e('0x4f')](_0x4e7b9a[_0x5e6e('0x41')],_0x4e7b9a[_0x5e6e('0x42')],parseInt(_0x4e7b9a['priority'],0xa)+0x1);_0x4e7b9a[_0x5e6e('0x51')]();}}else{logger[_0x5e6e('0xc')](util[_0x5e6e('0x11')](_0x5e6e('0x52'),_0x4e7b9a['arg_1']));_0x4e7b9a[_0x5e6e('0x4f')](_0x4e7b9a[_0x5e6e('0x41')],_0x4e7b9a[_0x5e6e('0x42')],parseInt(_0x4e7b9a[_0x5e6e('0x43')],0xa)+0x1);_0x4e7b9a[_0x5e6e('0x51')]();}}function main(){var _0x2a7b4c;return utilLicense['getLicense']()[_0x5e6e('0x2c')](function(_0x4bc828){if(_0x4bc828){if(_0x4bc828[_0x5e6e('0x53')]){if(_0x4bc828[_0x5e6e('0x54')]&&_0x4bc828['callysquare']>0x0){logger[_0x5e6e('0x15')](util[_0x5e6e('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4bc828[_0x5e6e('0x54')]));_0x2a7b4c=_0x4bc828[_0x5e6e('0x54')];}else{logger[_0x5e6e('0x15')](_0x5e6e('0x55'));}}else{logger[_0x5e6e('0x15')](_0x5e6e('0x56'));_0x2a7b4c=-0x1;}}})[_0x5e6e('0x2d')](function(_0x4072f0){logger[_0x5e6e('0xc')](_0x5e6e('0x57'),_0x4072f0[_0x5e6e('0xd')]);})['finally'](function(){var _0x3dab36=require(_0x5e6e('0x58'))(config[_0x5e6e('0xa')][_0x5e6e('0x10')],config['agi']['ip'],_0x2a7b4c);_0x3dab36['on'](_0x5e6e('0xc'),errorHandler);_0x3dab36['on'](_0x5e6e('0x59'),listeningHandler);_0x3dab36['on']('connection',connectionHandler);_0x3dab36['on'](_0x5e6e('0x51'),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 4ea18d6..7399238 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 _0xe833=['jayson/promise','http','request','then','error','message','catch'];(function(_0xd07d78,_0x237c88){var _0x89958e=function(_0x3c62ed){while(--_0x3c62ed){_0xd07d78['push'](_0xd07d78['shift']());}};_0x89958e(++_0x237c88);}(_0xe833,0x134));var _0x3e83=function(_0x6fead4,_0x4bf947){_0x6fead4=_0x6fead4-0x0;var _0x55d050=_0xe833[_0x6fead4];return _0x55d050;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3e83('0x0'));var client=jayson['client'][_0x3e83('0x1')]({'port':0x232b});function request(_0x560e77,_0x30e418){return new BPromise(function(_0x572a18,_0x22ba01){return client[_0x3e83('0x2')](_0x560e77,_0x30e418)[_0x3e83('0x3')](function(_0x5e6f22){if(_0x5e6f22['error']){return _0x22ba01(_0x5e6f22[_0x3e83('0x4')][_0x3e83('0x5')]);}else{return _0x572a18(_0x5e6f22['result']);}})[_0x3e83('0x6')](function(_0x4c5bef){return _0x22ba01(_0x4c5bef);});});}exports['sendMailMessage']=function(_0x1d8323,_0x28c978){return request('SendMail',{'account':_0x1d8323,'message':_0x28c978});}; \ No newline at end of file +var _0x272c=['bluebird','jayson/promise','http','request','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0x272c,0x155));var _0xc272=function(_0x5ded75,_0x29be08){_0x5ded75=_0x5ded75-0x0;var _0x4e3733=_0x272c[_0x5ded75];return _0x4e3733;};'use strict';var BPromise=require(_0xc272('0x0'));var jayson=require(_0xc272('0x1'));var client=jayson['client'][_0xc272('0x2')]({'port':0x232b});function request(_0xc61b7b,_0x2beb54){return new BPromise(function(_0x367b49,_0x513e10){return client[_0xc272('0x3')](_0xc61b7b,_0x2beb54)[_0xc272('0x4')](function(_0x443d3d){if(_0x443d3d[_0xc272('0x5')]){return _0x513e10(_0x443d3d[_0xc272('0x5')][_0xc272('0x6')]);}else{return _0x367b49(_0x443d3d[_0xc272('0x7')]);}})[_0xc272('0x8')](function(_0x1dfe51){return _0x513e10(_0x1dfe51);});});}exports[_0xc272('0x9')]=function(_0x467c5f,_0x2d573b){return request(_0xc272('0xa'),{'account':_0x467c5f,'message':_0x2d573b});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 2dbe2f6..2ba2811 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 _0xc0f3=['indexOf','substring','slice','trim','length','emit','line','stream','Transform','_localBuffer','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody'];(function(_0x148c1d,_0x537052){var _0xed1bda=function(_0x182118){while(--_0x182118){_0x148c1d['push'](_0x148c1d['shift']());}};_0xed1bda(++_0x537052);}(_0xc0f3,0x1d8));var _0x3c0f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0f3[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var Transform=require(_0x3c0f('0x0'))[_0x3c0f('0x1')];function AGIReply(_0x2ed777){Transform['call'](this,_0x2ed777);this[_0x3c0f('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x3c0f('0x3')][_0x3c0f('0x4')]=function(_0x268952,_0x13628b,_0x1512d2){var _0x5871c0='\x0a',_0x2daf63=['\x0a\x0a',_0x3c0f('0x5')],_0x12f125=-0x1,_0x3a3f83=-0x1,_0x43605b='',_0x595b2e=0x0,_0x2dcb80='',_0x3fc2f3='';this[_0x3c0f('0x2')]+=_0x268952[_0x3c0f('0x6')]();_0x2dcb80=this['_localBuffer'];if(!this[_0x3c0f('0x7')]){_0x595b2e=0x0;while(_0x2daf63[_0x595b2e]){while((_0x3a3f83=_0x2dcb80[_0x3c0f('0x8')](_0x2daf63[_0x595b2e]))!=-0x1){_0x43605b=_0x2daf63[_0x595b2e];_0x3fc2f3=_0x2dcb80[_0x3c0f('0x9')](0x0,_0x3a3f83);_0x2dcb80=_0x2dcb80[_0x3c0f('0x9')](_0x3a3f83+_0x43605b['length']);var _0x467327=_0x3fc2f3['split'](_0x5871c0),_0x9fec2a=0x0,_0xf6cd51={},_0x590c5a='',_0x15c4cc='',_0x26686f=-0x1;while(_0x467327[_0x9fec2a]){_0x26686f=_0x467327[_0x9fec2a][_0x3c0f('0x8')](':');if(_0x26686f!=-0x1){_0x590c5a=_0x467327[_0x9fec2a][_0x3c0f('0xa')](0x0,_0x26686f)['trim']();_0x15c4cc=_0x467327[_0x9fec2a][_0x3c0f('0xa')](_0x26686f+0x1)[_0x3c0f('0xb')]();if(_0x590c5a[_0x3c0f('0xc')]>0x0){_0xf6cd51[_0x590c5a]=_0x15c4cc;}}else{}_0x9fec2a++;}this['emit']('headers',_0xf6cd51);this[_0x3c0f('0x7')]=!![];}_0x595b2e++;}this[_0x3c0f('0x2')]=_0x2dcb80;}else{while((_0x12f125=_0x2dcb80['indexOf'](_0x5871c0))!=-0x1){_0x3fc2f3=_0x2dcb80[_0x3c0f('0x9')](0x0,_0x12f125);this[_0x3c0f('0xd')](_0x3c0f('0xe'),_0x3fc2f3);_0x2dcb80=_0x2dcb80[_0x3c0f('0x9')](_0x12f125+_0x5871c0[_0x3c0f('0xc')]);}this['_localBuffer']=_0x2dcb80;}_0x1512d2();};module['exports']=AGIReply; \ No newline at end of file +var _0xd11d=['_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','slice','trim','length','emit','exports','util','call','_inBody','inherits','prototype'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0xd11d,0x94));var _0xdd11=function(_0x106ff7,_0x536d8c){_0x106ff7=_0x106ff7-0x0;var _0x10f25b=_0xd11d[_0x106ff7];return _0x10f25b;};'use strict';var util=require(_0xdd11('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x1821a0){Transform[_0xdd11('0x1')](this,_0x1821a0);this['_localBuffer']='';this[_0xdd11('0x2')]=![];}util[_0xdd11('0x3')](AGIReply,Transform);AGIReply[_0xdd11('0x4')][_0xdd11('0x5')]=function(_0x51ffc4,_0x10d3f9,_0x1b257a){var _0x34a25d='\x0a',_0x486956=['\x0a\x0a',_0xdd11('0x6')],_0x67e862=-0x1,_0x7d41ba=-0x1,_0x10d15b='',_0x39f16b=0x0,_0x103143='',_0x4e435c='';this[_0xdd11('0x7')]+=_0x51ffc4[_0xdd11('0x8')]();_0x103143=this[_0xdd11('0x7')];if(!this[_0xdd11('0x2')]){_0x39f16b=0x0;while(_0x486956[_0x39f16b]){while((_0x7d41ba=_0x103143[_0xdd11('0x9')](_0x486956[_0x39f16b]))!=-0x1){_0x10d15b=_0x486956[_0x39f16b];_0x4e435c=_0x103143[_0xdd11('0xa')](0x0,_0x7d41ba);_0x103143=_0x103143[_0xdd11('0xa')](_0x7d41ba+_0x10d15b['length']);var _0x27c053=_0x4e435c[_0xdd11('0xb')](_0x34a25d),_0x5aaf8b=0x0,_0x4dc7c3={},_0xf1787a='',_0xc1a561='',_0x5b09d4=-0x1;while(_0x27c053[_0x5aaf8b]){_0x5b09d4=_0x27c053[_0x5aaf8b]['indexOf'](':');if(_0x5b09d4!=-0x1){_0xf1787a=_0x27c053[_0x5aaf8b][_0xdd11('0xc')](0x0,_0x5b09d4)[_0xdd11('0xd')]();_0xc1a561=_0x27c053[_0x5aaf8b][_0xdd11('0xc')](_0x5b09d4+0x1)[_0xdd11('0xd')]();if(_0xf1787a[_0xdd11('0xe')]>0x0){_0x4dc7c3[_0xf1787a]=_0xc1a561;}}else{}_0x5aaf8b++;}this[_0xdd11('0xf')]('headers',_0x4dc7c3);this[_0xdd11('0x2')]=!![];}_0x39f16b++;}this['_localBuffer']=_0x103143;}else{while((_0x67e862=_0x103143[_0xdd11('0x9')](_0x34a25d))!=-0x1){_0x4e435c=_0x103143[_0xdd11('0xa')](0x0,_0x67e862);this[_0xdd11('0xf')]('line',_0x4e435c);_0x103143=_0x103143[_0xdd11('0xa')](_0x67e862+_0x34a25d[_0xdd11('0xe')]);}this['_localBuffer']=_0x103143;}_0x1b257a();};module[_0xdd11('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8ac1355..942384b 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 _0xe483=['jayson/promise','http','request','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','ShowPause','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util'];(function(_0x37a6f3,_0x3574c6){var _0x13ed36=function(_0x561c40){while(--_0x561c40){_0x37a6f3['push'](_0x37a6f3['shift']());}};_0x13ed36(++_0x3574c6);}(_0xe483,0xed));var _0x3e48=function(_0x7ed61c,_0x3b6074){_0x7ed61c=_0x7ed61c-0x0;var _0x56457f=_0xe483[_0x7ed61c];return _0x56457f;};'use strict';var BPromise=require(_0x3e48('0x0'));var moment=require(_0x3e48('0x1'));var _=require('lodash');var util=require(_0x3e48('0x2'));var jayson=require(_0x3e48('0x3'));var client=jayson['client'][_0x3e48('0x4')]({'port':0x2329});function request(_0x5363c3,_0x4a9717){return new BPromise(function(_0x259eb5,_0x34fc6b){return client[_0x3e48('0x5')](_0x5363c3,_0x4a9717)['then'](function(_0x3b0cb4){if(_0x3b0cb4[_0x3e48('0x6')]){return _0x34fc6b(_0x3b0cb4[_0x3e48('0x6')][_0x3e48('0x7')]);}else{return _0x259eb5(_0x3b0cb4[_0x3e48('0x8')]);}})[_0x3e48('0x9')](function(_0x370fe0){return _0x34fc6b(_0x370fe0);});});}exports['getSquareProject']=function(_0x41aa16){return request(_0x3e48('0xa'),{'options':{'raw':![],'where':{'name':_0x41aa16},'attributes':[_0x3e48('0xb')]}});};exports[_0x3e48('0xc')]=function(_0x180b62){return request(_0x3e48('0xd'),{'options':{'raw':![],'where':{'id':_0x180b62},'include':[{'model':'MailServerOut','as':_0x3e48('0xe')}],'attributes':['id',_0x3e48('0xf'),_0x3e48('0x10')]}});};exports[_0x3e48('0x11')]=function(_0x556898){return request('ShowSquareProject',{'options':{'where':{'id':_0x556898},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x12')]=function(_0x4f0ff2){return request(_0x3e48('0x13'),{'options':{'where':{'id':_0x4f0ff2},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x14')]=function(_0x3e95e1){return request(_0x3e48('0x15'),{'options':{'where':{'id':_0x3e95e1},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x16')]=function(_0xc88bf8){return request(_0x3e48('0x17'),{'options':{'where':{'id':_0xc88bf8},'attributes':[_0x3e48('0x18')]}});};exports[_0x3e48('0x19')]=function(_0x536d87){return request(_0x3e48('0x1a'),{'options':{'where':{'id':_0x536d87},'attributes':[_0x3e48('0xf')]}});};exports[_0x3e48('0x1b')]=function(_0x58b840){return request(_0x3e48('0x1c'),{'options':{'where':{'id':_0x58b840},'attributes':['name']}});};exports[_0x3e48('0x1d')]=function(_0x20dbd8){return request('ShowSound',{'options':{'where':{'id':_0x20dbd8},'attributes':['save_name']}});};exports[_0x3e48('0x1e')]=function(_0x1e56aa){return request(_0x3e48('0x1f'),{'options':{'raw':![],'where':{'id':_0x1e56aa},'include':[{'model':_0x3e48('0x20'),'as':_0x3e48('0x21')}]}});};exports[_0x3e48('0x22')]=function(_0x370175){return request(_0x3e48('0x23'),{'options':{'where':{'id':_0x370175},'attributes':['id',_0x3e48('0xf')]}});};exports[_0x3e48('0x24')]=function(_0x5f4a04){return request(_0x3e48('0x25'),{'body':_0x5f4a04});};exports[_0x3e48('0x26')]=function(_0x1feae6){return request(_0x3e48('0x27'),{'body':_0x1feae6});};exports[_0x3e48('0x28')]=function(_0x5e55e1){return request(_0x3e48('0x29'),{'body':_[_0x3e48('0x2a')](_0x5e55e1,{'project_name':_0x5e55e1[_0x3e48('0x2b')],'prev_project_name':_0x5e55e1['arg_2']||'','is_subproject':_0x5e55e1[_0x3e48('0x2c')]?!![]:![],'leaveAt':moment()[_0x3e48('0x2d')](_0x3e48('0x2e'))})});};exports['createSquareRecording']=function(_0x1d014c){return request('CreateSquareRecording',{'body':_0x1d014c});};exports[_0x3e48('0x2f')]=function(_0x516b52){return request(_0x3e48('0x30'),{'body':_0x516b52});};exports[_0x3e48('0x31')]=function(_0x5e9f1d){return request(_0x3e48('0x32'),{'options':{'raw':![],'where':{'phone':_0x5e9f1d[_0x3e48('0x33')],'ListId':_0x5e9f1d['ListId']}}})[_0x3e48('0x34')](function(_0x3bb356){if(_0x3bb356){return _0x3bb356;}return request(_0x3e48('0x35'),{'body':_0x5e9f1d});});};exports['getPauseById']=function(_0x1365b4){return request(_0x3e48('0x36'),{'options':{'where':{'id':_0x1365b4},'attributes':[_0x3e48('0xf')]}});};exports['agentLogin']=function(_0x1250ef,_0x40bd1d){return request('LoginUser',{'body':{'interface':_0x40bd1d},'options':{'where':_0x1250ef}});};exports[_0x3e48('0x37')]=function(_0x3ef867,_0x54080c,_0x29186f){return request('PauseUser',{'body':{'type':_0x54080c,'uniqueid':_0x29186f},'options':{'where':_0x3ef867}});};exports[_0x3e48('0x38')]=function(_0x270616){return request(_0x3e48('0x39'),{'body':{},'options':{'where':_0x270616}});};exports[_0x3e48('0x3a')]=function(_0x37d4fd){return request(_0x3e48('0x3b'),{'body':{},'options':{'where':_0x37d4fd}});}; \ No newline at end of file +var _0x7daa=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals'];(function(_0x478cf9,_0x3d99f2){var _0x34e354=function(_0x401a8c){while(--_0x401a8c){_0x478cf9['push'](_0x478cf9['shift']());}};_0x34e354(++_0x3d99f2);}(_0x7daa,0xfa));var _0xa7da=function(_0x50523c,_0xb27ebb){_0x50523c=_0x50523c-0x0;var _0x5531ed=_0x7daa[_0x50523c];return _0x5531ed;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xa7da('0x0'));var util=require(_0xa7da('0x1'));var jayson=require(_0xa7da('0x2'));var client=jayson[_0xa7da('0x3')][_0xa7da('0x4')]({'port':0x2329});function request(_0x2d409e,_0x33131b){return new BPromise(function(_0x3d0f88,_0x59eeb6){return client[_0xa7da('0x5')](_0x2d409e,_0x33131b)[_0xa7da('0x6')](function(_0x2cf64e){if(_0x2cf64e[_0xa7da('0x7')]){return _0x59eeb6(_0x2cf64e[_0xa7da('0x7')][_0xa7da('0x8')]);}else{return _0x3d0f88(_0x2cf64e[_0xa7da('0x9')]);}})[_0xa7da('0xa')](function(_0x48b99f){return _0x59eeb6(_0x48b99f);});});}exports[_0xa7da('0xb')]=function(_0x4b0b09){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4b0b09},'attributes':[_0xa7da('0xc')]}});};exports[_0xa7da('0xd')]=function(_0x26b48d){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x26b48d},'include':[{'model':'MailServerOut','as':_0xa7da('0xe')}],'attributes':['id',_0xa7da('0xf'),_0xa7da('0x10')]}});};exports[_0xa7da('0x11')]=function(_0x19933e){return request('ShowSquareProject',{'options':{'where':{'id':_0x19933e},'attributes':[_0xa7da('0xf')]}});};exports['getVoiceQueueById']=function(_0x2a8a10){return request(_0xa7da('0x12'),{'options':{'where':{'id':_0x2a8a10},'attributes':[_0xa7da('0xf')]}});};exports[_0xa7da('0x13')]=function(_0x4bf415){return request(_0xa7da('0x14'),{'options':{'where':{'id':_0x4bf415},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x40d57f){return request(_0xa7da('0x15'),{'options':{'where':{'id':_0x40d57f},'attributes':['dsn']}});};exports['getUserById']=function(_0x3949e9){return request('ShowUser',{'options':{'where':{'id':_0x3949e9},'attributes':[_0xa7da('0xf')]}});};exports[_0xa7da('0x16')]=function(_0x13a29d){return request(_0xa7da('0x17'),{'options':{'where':{'id':_0x13a29d},'attributes':[_0xa7da('0xf')]}});};exports['getSoundById']=function(_0x5e27fb){return request(_0xa7da('0x18'),{'options':{'where':{'id':_0x5e27fb},'attributes':[_0xa7da('0x19')]}});};exports[_0xa7da('0x1a')]=function(_0x17402f){return request(_0xa7da('0x1b'),{'options':{'raw':![],'where':{'id':_0x17402f},'include':[{'model':_0xa7da('0x1c'),'as':_0xa7da('0x1d')}]}});};exports['getSmsAccountById']=function(_0x38fda4){return request(_0xa7da('0x1e'),{'options':{'where':{'id':_0x38fda4},'attributes':['id',_0xa7da('0xf')]}});};exports[_0xa7da('0x1f')]=function(_0x2692eb){return request(_0xa7da('0x20'),{'body':_0x2692eb});};exports['createSquareDetailsReport']=function(_0x539444){return request('CreateSquareDetailsReport',{'body':_0x539444});};exports[_0xa7da('0x21')]=function(_0x41204c){return request(_0xa7da('0x22'),{'body':_['merge'](_0x41204c,{'project_name':_0x41204c[_0xa7da('0x23')],'prev_project_name':_0x41204c[_0xa7da('0x24')]||'','is_subproject':_0x41204c[_0xa7da('0x24')]?!![]:![],'leaveAt':moment()['format'](_0xa7da('0x25'))})});};exports[_0xa7da('0x26')]=function(_0x58e696){return request(_0xa7da('0x27'),{'body':_0x58e696});};exports[_0xa7da('0x28')]=function(_0x5a9b97){return request(_0xa7da('0x29'),{'body':_0x5a9b97});};exports['createCmContact']=function(_0x10880c){return request(_0xa7da('0x2a'),{'options':{'raw':![],'where':{'phone':_0x10880c[_0xa7da('0x2b')],'ListId':_0x10880c[_0xa7da('0x2c')]}}})['then'](function(_0x3706e6){if(_0x3706e6){return _0x3706e6;}return request(_0xa7da('0x2d'),{'body':_0x10880c});});};exports[_0xa7da('0x2e')]=function(_0x2f177d){return request(_0xa7da('0x2f'),{'options':{'where':{'id':_0x2f177d},'attributes':[_0xa7da('0xf')]}});};exports[_0xa7da('0x30')]=function(_0x3ab2da,_0x99e896){return request(_0xa7da('0x31'),{'body':{'interface':_0x99e896},'options':{'where':_0x3ab2da}});};exports[_0xa7da('0x32')]=function(_0x83f8a3,_0x42fede,_0x4a26dd){return request(_0xa7da('0x33'),{'body':{'type':_0x42fede,'uniqueid':_0x4a26dd},'options':{'where':_0x83f8a3}});};exports[_0xa7da('0x34')]=function(_0x2485ef){return request(_0xa7da('0x35'),{'body':{},'options':{'where':_0x2485ef}});};exports[_0xa7da('0x36')]=function(_0x209716){return request(_0xa7da('0x37'),{'body':{},'options':{'where':_0x209716}});}; \ 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 ddfface..aaac228 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 _0x2070=['exports'];(function(_0x5353a7,_0x35c20f){var _0x2c86ac=function(_0x105d9e){while(--_0x105d9e){_0x5353a7['push'](_0x5353a7['shift']());}};_0x2c86ac(++_0x35c20f);}(_0x2070,0x1a2));var _0x0207=function(_0x2f384a,_0x2b093f){_0x2f384a=_0x2f384a-0x0;var _0x20e890=_0x2070[_0x2f384a];return _0x20e890;};var polly=require('./polly');var lex=require('./lex');module[_0x0207('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9e8a=['exports','./polly','./lex'];(function(_0x42bc89,_0x3d4cea){var _0x45875b=function(_0x5afe14){while(--_0x5afe14){_0x42bc89['push'](_0x42bc89['shift']());}};_0x45875b(++_0x3d4cea);}(_0x9e8a,0x112));var _0xa9e8=function(_0x540231,_0x117b98){_0x540231=_0x540231-0x0;var _0x31334b=_0x9e8a[_0x540231];return _0x31334b;};var polly=require(_0xa9e8('0x0'));var lex=require(_0xa9e8('0x1'));module[_0xa9e8('0x2')]={'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 b75f785..6071a8a 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 _0x9348=['exports','./lib/api'];(function(_0x521dde,_0x7ebabd){var _0x3f8e4a=function(_0x3e29ab){while(--_0x3e29ab){_0x521dde['push'](_0x521dde['shift']());}};_0x3f8e4a(++_0x7ebabd);}(_0x9348,0x10d));var _0x8934=function(_0x2df8d6,_0x337ed0){_0x2df8d6=_0x2df8d6-0x0;var _0x4f95ee=_0x9348[_0x2df8d6];return _0x4f95ee;};'use strict';var lex=require(_0x8934('0x0'));module[_0x8934('0x1')]=function(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b){return lex(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b);}; \ No newline at end of file +var _0xaa88=['exports','./lib/api'];(function(_0x4af779,_0x3b166a){var _0x40a990=function(_0x5e6ff4){while(--_0x5e6ff4){_0x4af779['push'](_0x4af779['shift']());}};_0x40a990(++_0x3b166a);}(_0xaa88,0x137));var _0x8aa8=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xaa88[_0xe66cf2];return _0x2d84e7;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);}; \ 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 90ce962..798a575 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(_0x4998d3,_0x4628fb){var _0x7388ac=function(_0x28df92){while(--_0x28df92){_0x4998d3['push'](_0x4998d3['shift']());}};_0x7388ac(++_0x4628fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x4f507a,_0x37c8bd){var _0x5066ed=function(_0x1745ca){while(--_0x1745ca){_0x4f507a['push'](_0x4f507a['shift']());}};_0x5066ed(++_0x37c8bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 94b30f0..fad3ef2 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 _0x7923=['exports','./lib/api'];(function(_0x1e9fcc,_0x4f475e){var _0x50c77c=function(_0x27fd3d){while(--_0x27fd3d){_0x1e9fcc['push'](_0x1e9fcc['shift']());}};_0x50c77c(++_0x4f475e);}(_0x7923,0x97));var _0x3792=function(_0x44992b,_0x3bcfb9){_0x44992b=_0x44992b-0x0;var _0x372fa5=_0x7923[_0x44992b];return _0x372fa5;};'use strict';var polly=require(_0x3792('0x0'));module[_0x3792('0x1')]=function(_0x298990,_0x578a5c,_0x495786,_0x2daa49,_0x28a528,_0xd7a1ee,_0x3a2694){return polly(_0x298990,_0x578a5c,_0x495786,_0x2daa49,_0x28a528,_0xd7a1ee,_0x3a2694);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x45192d,_0x2cfe59,_0x1ce22e,_0x318d0d,_0x32d59c,_0x1c8354,_0x17edd0){return polly(_0x45192d,_0x2cfe59,_0x1ce22e,_0x318d0d,_0x32d59c,_0x1c8354,_0x17edd0);}; \ 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 991449a..5e1e290 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 _0x6cd6=['aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring'];(function(_0x50b1aa,_0x3c1710){var _0x3657f4=function(_0x15a096){while(--_0x15a096){_0x50b1aa['push'](_0x50b1aa['shift']());}};_0x3657f4(++_0x3c1710);}(_0x6cd6,0x116));var _0x66cd=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6cd6[_0x199572];return _0x13cfa3;};'use strict';var fs=require('fs');var path=require(_0x66cd('0x0'));var BPromise=require('bluebird');var rs=require(_0x66cd('0x1'));var AWS=require(_0x66cd('0x2'));function pollyResult(_0x48ceae,_0x5479f5,_0x5ccfcd){return new BPromise(function(_0x7d803,_0x1eaec8){_0x48ceae['synthesizeSpeech'](_0x5479f5,function(_0x33ee39,_0x218706){if(_0x33ee39){_0x1eaec8(_0x33ee39);}else if(_0x218706){if(_0x218706[_0x66cd('0x3')]instanceof Buffer){fs['writeFile'](_0x5ccfcd,_0x218706[_0x66cd('0x3')],function(_0x1d6545){if(_0x1d6545){_0x1eaec8(_0x1d6545);}else{_0x7d803();}});}else{_0x1eaec8(new Error(_0x66cd('0x4')));}}else{_0x1eaec8(new Error(_0x66cd('0x5')));}});});}module[_0x66cd('0x6')]=function(_0x5e2d7c,_0x12ff5a,_0x4132c2,_0xc3626f,_0x480450,_0x2bdaeb,_0xedd7b9){var _0x5a8fe6=new AWS[(_0x66cd('0x7'))]({'accessKeyId':_0x5e2d7c,'secretAccessKey':_0x12ff5a,'region':_0x4132c2});var _0x43634f={'Text':_0x480450,'TextType':_0x2bdaeb||_0x66cd('0x8'),'OutputFormat':_0x66cd('0x9'),'VoiceId':_0xc3626f};return pollyResult(_0x5a8fe6,_0x43634f,_0xedd7b9);}; \ No newline at end of file +var _0x1670=['writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x1670,0x165));var _0x0167=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0x1670[_0x185d2a];return _0x4dea27;};'use strict';var fs=require('fs');var path=require(_0x0167('0x0'));var BPromise=require(_0x0167('0x1'));var rs=require(_0x0167('0x2'));var AWS=require(_0x0167('0x3'));function pollyResult(_0x598f6b,_0x335e77,_0x44577b){return new BPromise(function(_0x4de25b,_0x2dd45a){_0x598f6b[_0x0167('0x4')](_0x335e77,function(_0x384c0e,_0x4ed1dd){if(_0x384c0e){_0x2dd45a(_0x384c0e);}else if(_0x4ed1dd){if(_0x4ed1dd[_0x0167('0x5')]instanceof Buffer){fs[_0x0167('0x6')](_0x44577b,_0x4ed1dd[_0x0167('0x5')],function(_0x34d33e){if(_0x34d33e){_0x2dd45a(_0x34d33e);}else{_0x4de25b();}});}else{_0x2dd45a(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2dd45a(new Error(_0x0167('0x7')));}});});}module[_0x0167('0x8')]=function(_0x85850d,_0x216f56,_0x1ed130,_0x283199,_0x4dbba9,_0x2a899f,_0x4ae5a5){var _0xa8dae2=new AWS[(_0x0167('0x9'))]({'accessKeyId':_0x85850d,'secretAccessKey':_0x216f56,'region':_0x1ed130});var _0x1eae55={'Text':_0x4dbba9,'TextType':_0x2a899f||'text','OutputFormat':_0x0167('0xa'),'VoiceId':_0x283199};return pollyResult(_0xa8dae2,_0x1eae55,_0x4ae5a5);}; \ 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 f620047..3193c29 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 _0x3ae7=['exports','./lib/api'];(function(_0x2b6340,_0x1f9871){var _0x34595f=function(_0x4344b0){while(--_0x4344b0){_0x2b6340['push'](_0x2b6340['shift']());}};_0x34595f(++_0x1f9871);}(_0x3ae7,0x7b));var _0x73ae=function(_0x323059,_0x527389){_0x323059=_0x323059-0x0;var _0x564449=_0x3ae7[_0x323059];return _0x564449;};'use strict';var asr=require(_0x73ae('0x0'));module[_0x73ae('0x1')]=function(_0x24575e,_0x493168,_0x439821,_0x437530){return asr(_0x24575e,_0x493168,_0x439821);}; \ No newline at end of file +var _0xcacc=['./lib/api','exports'];(function(_0x4223a5,_0x30a74b){var _0x40dfb8=function(_0x39a921){while(--_0x39a921){_0x4223a5['push'](_0x4223a5['shift']());}};_0x40dfb8(++_0x30a74b);}(_0xcacc,0x74));var _0xccac=function(_0x11c86e,_0x577687){_0x11c86e=_0x11c86e-0x0;var _0x2a141a=_0xcacc[_0x11c86e];return _0x2a141a;};'use strict';var asr=require(_0xccac('0x0'));module[_0xccac('0x1')]=function(_0x106ace,_0x391bf3,_0xe2d5cb,_0x518305){return asr(_0x106ace,_0x391bf3,_0xe2d5cb);}; \ 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 eab3baf..f906770 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 _0x83f1=['https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird'];(function(_0x18e124,_0x5ca114){var _0x2f335a=function(_0x2d752e){while(--_0x2d752e){_0x18e124['push'](_0x18e124['shift']());}};_0x2f335a(++_0x5ca114);}(_0x83f1,0x1cc));var _0x183f=function(_0x247ab3,_0x253a3e){_0x247ab3=_0x247ab3-0x0;var _0x26a765=_0x83f1[_0x247ab3];return _0x26a765;};'use strict';var url=require(_0x183f('0x0'));var BPromise=require(_0x183f('0x1'));var fs=require('fs');var host=_0x183f('0x2');module[_0x183f('0x3')]=function(_0x40525d,_0x50f14d,_0x52688c){return new BPromise(function(_0x459395,_0x2668ca){var _0x7f265;if(typeof _0x40525d!==_0x183f('0x4')||_0x40525d[_0x183f('0x5')]===0x0){return _0x2668ca('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x50f14d!==_0x183f('0x4')||_0x50f14d[_0x183f('0x5')]===0x0){return _0x2668ca(_0x183f('0x6'));}if(typeof _0x52688c!=='undefined'&&(typeof _0x52688c!==_0x183f('0x4')||_0x52688c['length']===0x0)){return _0x2668ca(_0x183f('0x7'));}try{_0x7f265=fs[_0x183f('0x8')](_0x40525d)[_0x183f('0x9')](_0x183f('0xa'));}catch(_0x22bcd6){return _0x2668ca(_0x22bcd6);}return _0x459395({'method':_0x183f('0xb'),'uri':host+_0x183f('0xc')+_0x50f14d,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x183f('0xd'),'languageCode':_0x52688c},'audio':{'content':_0x7f265}},'json':!![]});});}; \ No newline at end of file +var _0xad95=['/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','length','key\x20should\x20be\x20a\x20string','undefined','string','readFileSync','POST'];(function(_0x286639,_0x1bf3dc){var _0x21e141=function(_0x2352bd){while(--_0x2352bd){_0x286639['push'](_0x286639['shift']());}};_0x21e141(++_0x1bf3dc);}(_0xad95,0x70));var _0x5ad9=function(_0x36645a,_0x2221ba){_0x36645a=_0x36645a-0x0;var _0x2a8998=_0xad95[_0x36645a];return _0x2a8998;};'use strict';var url=require(_0x5ad9('0x0'));var BPromise=require(_0x5ad9('0x1'));var fs=require('fs');var host=_0x5ad9('0x2');module['exports']=function(_0x52ad89,_0x409d5b,_0x235c61){return new BPromise(function(_0x59809d,_0x5c9fd6){var _0x185bff;if(typeof _0x52ad89!=='string'||_0x52ad89['length']===0x0){return _0x5c9fd6('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x409d5b!=='string'||_0x409d5b[_0x5ad9('0x3')]===0x0){return _0x5c9fd6(_0x5ad9('0x4'));}if(typeof _0x235c61!==_0x5ad9('0x5')&&(typeof _0x235c61!==_0x5ad9('0x6')||_0x235c61[_0x5ad9('0x3')]===0x0)){return _0x5c9fd6('lang\x20should\x20be\x20a\x20string');}try{_0x185bff=fs[_0x5ad9('0x7')](_0x52ad89)['toString']('base64');}catch(_0x301e69){return _0x5c9fd6(_0x301e69);}return _0x59809d({'method':_0x5ad9('0x8'),'uri':host+_0x5ad9('0x9')+_0x409d5b,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x5ad9('0xa'),'languageCode':_0x235c61},'audio':{'content':_0x185bff}},'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 99d64dc..96d1274 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 _0x54c1=['./asr','exports'];(function(_0x107d8e,_0x40a3a9){var _0xabbe90=function(_0x18bb8a){while(--_0x18bb8a){_0x107d8e['push'](_0x107d8e['shift']());}};_0xabbe90(++_0x40a3a9);}(_0x54c1,0x166));var _0x154c=function(_0x8e28ae,_0x3a1bee){_0x8e28ae=_0x8e28ae-0x0;var _0x4805df=_0x54c1[_0x8e28ae];return _0x4805df;};var asr=require(_0x154c('0x0'));module[_0x154c('0x1')]={'asr':asr}; \ No newline at end of file +var _0xa04c=['./asr','exports'];(function(_0x6ce342,_0x1882d6){var _0x2adb0d=function(_0x1ac32a){while(--_0x1ac32a){_0x6ce342['push'](_0x6ce342['shift']());}};_0x2adb0d(++_0x1882d6);}(_0xa04c,0x196));var _0xca04=function(_0x1d10f5,_0x554f47){_0x1d10f5=_0x1d10f5-0x0;var _0x2b5b53=_0xa04c[_0x1d10f5];return _0x2b5b53;};var asr=require(_0xca04('0x0'));module[_0xca04('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 43108f8..b6f8e1c 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 _0xe623=['finish\x20to\x20convert','resolve','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','?key=','ssml','input','voice','MP3','POST','tmp','generate','from','audioContent','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','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','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','bluebird','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./tilde','../../../config/logger','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','unlink','download\x20error','pipe','host','data','end','transcode','wav','info'];(function(_0x1570d7,_0x3e242f){var _0x30a6f5=function(_0x34d6d2){while(--_0x34d6d2){_0x1570d7['push'](_0x1570d7['shift']());}};_0x30a6f5(++_0x3e242f);}(_0xe623,0x165));var _0x3e62=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xe623[_0x1762b4];return _0x29beda;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x3e62('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x3e62('0x1'));var path=require(_0x3e62('0x2'));var querystring=require(_0x3e62('0x3'));var rp=require(_0x3e62('0x4'));var rs=require(_0x3e62('0x5'));var sox=require(_0x3e62('0x6'));var tts=require(_0x3e62('0x7'));var urlParse=require(_0x3e62('0x8'))[_0x3e62('0x9')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x3e62('0xa'));var logger=require(_0x3e62('0xb'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1ec71e,_0x5084cb){return new BPromise(function(_0x1953c1,_0x257685){var _0x3943b6=urlParse(_0x1ec71e);var _0x4e8dbb=_0x3943b6[_0x3e62('0xc')]===_0x3e62('0xd')?https:http;var _0x4ec06c={'host':_0x3943b6['host'],'path':_0x3943b6['path'],'headers':{'user-agent':_0x3e62('0xe')}};_0x4e8dbb[_0x3e62('0xf')](_0x4ec06c,function(_0x19a3d6){if(_0x19a3d6[_0x3e62('0x10')]!==0xc8){logger[_0x3e62('0x11')](_0x3e62('0x12')+_0x1ec71e+_0x3e62('0x13')+_0x19a3d6[_0x3e62('0x10')]+'\x20('+_0x19a3d6[_0x3e62('0x14')]+')');_0x257685(new Error(_0x3e62('0x12')+_0x1ec71e+_0x3e62('0x13')+_0x19a3d6[_0x3e62('0x10')]+'\x20('+_0x19a3d6[_0x3e62('0x14')]+')'));return;}var _0xbf9bc3=fs[_0x3e62('0x15')](_0x5084cb);_0xbf9bc3['on'](_0x3e62('0x16'),function(){logger['info']('finish\x20download\x20file');_0xbf9bc3[_0x3e62('0x17')](_0x1953c1);});_0xbf9bc3['on'](_0x3e62('0x11'),function(_0x115f53){fs[_0x3e62('0x18')](_0x5084cb);logger['error'](_0x3e62('0x19'),_0x115f53);_0x257685(_0x115f53);});_0x19a3d6[_0x3e62('0x1a')](_0xbf9bc3);})['on'](_0x3e62('0x11'),function(_0x4d9e2c){logger[_0x3e62('0x11')](_0x4d9e2c);_0x257685(_0x4d9e2c);})['end']();});}function uploadFile(_0x4fac60){return new BPromise(function(_0x4bd8a9,_0xfd8670){var _0x29f4b1=urlParse(_0x4fac60);var _0x5af928=_0x29f4b1['protocol']===_0x3e62('0xd')?https:http;var _0x13ed0d={'host':_0x29f4b1[_0x3e62('0x1b')],'path':_0x29f4b1[_0x3e62('0x2')],'headers':{'user-agent':_0x3e62('0xe')}};_0x5af928['get'](_0x13ed0d,function(_0x2fdc7d){if(_0x2fdc7d[_0x3e62('0x10')]!==0xc8){_0xfd8670(new Error(_0x3e62('0x12')+_0x4fac60+_0x3e62('0x13')+_0x2fdc7d[_0x3e62('0x10')]+'\x20('+_0x2fdc7d[_0x3e62('0x14')]+')'));return;}var _0x5e4723='';_0x2fdc7d['on'](_0x3e62('0x1c'),function(_0x2ed7b3){_0x5e4723+=_0x2ed7b3;});_0x2fdc7d['on'](_0x3e62('0x1d'),function(){_0x4bd8a9(_0x5e4723);});})['on'](_0x3e62('0x11'),function(_0x3f0230){_0xfd8670(_0x3f0230);})['end']();});}function convertFile(_0x275fe2,_0x462457){return new BPromise(function(_0x13b89f,_0x29f09d){var _0xa91249=sox[_0x3e62('0x1e')](_0x275fe2,_0x462457,{'sampleRate':0x1f40,'format':_0x3e62('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xa91249['on']('error',function(_0x24eec2){logger['error']('error\x20convert',_0x24eec2);_0x29f09d(_0x24eec2);});_0xa91249['on'](_0x3e62('0x1d'),function(){logger[_0x3e62('0x20')](_0x3e62('0x21'));_0x13b89f();});_0xa91249['start']();});}function base64Decode(_0x4eb049,_0xa3aaba){var _0x3fb899=path[_0x3e62('0x22')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x3fb899,_0x4eb049,_0x3e62('0x23'));return convertFile(_0x3fb899,_0xa3aaba)[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x3fb899);fs[_0x3e62('0x25')](_0xa3aaba,_0x3e62('0x26'));}catch(_0x4a8437){logger[_0x3e62('0x11')](_0x4a8437);}return _0xa3aaba[_0x3e62('0x27')]('.')[0x0];});}function base64Encode(_0xd2df45){var _0x374141=fs[_0x3e62('0x28')](_0xd2df45);return new Buffer(_0x374141)['toString'](_0x3e62('0x23'));}exports[_0x3e62('0x29')]=function(_0x20118e,_0x40007d,_0x50d060,_0x16e250,_0xca0b0f,_0x388896){var _0x99c53c,_0x5463fa;var _0x3e42ac='https://texttospeech.googleapis.com/v1/';var _0x406576=_0x3e62('0x2a')+_0x20118e;var _0x337a95={};if(_0x40007d===_0x3e62('0x2b')){_0x337a95[_0x3e62('0x2c')]={'ssml':_0x50d060};}else{_0x337a95[_0x3e62('0x2c')]={'text':_0x50d060};};_0x337a95[_0x3e62('0x2d')]={'languageCode':_0x16e250,'ssmlGender':_0xca0b0f};_0x337a95['audioConfig']={'audioEncoding':_0x3e62('0x2e'),'sampleRateHertz':0x1f40};var _0x55f132={'url':_0x3e42ac+'text:synthesize'+_0x406576,'method':_0x3e62('0x2f'),'json':!![],'body':_0x337a95};return rp(_0x55f132)[_0x3e62('0x24')](function(_0x3a08b7){return new BPromise(function(_0x21dfc0,_0x124e31){_0x99c53c=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+'.mp3');var _0x4ba118=Buffer[_0x3e62('0x32')](_0x3a08b7[_0x3e62('0x33')],_0x3e62('0x23'));return fs['writeFile'](_0x99c53c,_0x4ba118,function(_0x303d31){_0x124e31(_0x303d31);},function(_0x1dc1e1){fs[_0x3e62('0x25')](_0x99c53c,_0x3e62('0x26'));_0x21dfc0(_0x1dc1e1);});});})[_0x3e62('0x24')](function(_0x1972f4){_0x5463fa=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x99c53c,_0x5463fa);})[_0x3e62('0x24')](function(){try{fs['unlink'](_0x99c53c);fs['chmodSync'](_0x5463fa,'777');}catch(_0x3dbda9){logger[_0x3e62('0x11')](_0x3dbda9);}logger[_0x3e62('0x20')](_0x3e62('0x35'),_0x5463fa['split']('.')[0x0]);return _0x5463fa[_0x3e62('0x27')]('.')[0x0];});};exports[_0x3e62('0x36')]=function(_0x2184ca,_0x2b08fa){var _0x58c21a=_0x3e62('0x37');var _0x28a93f,_0x408941;var _0x2f852a;var _0x1a9785={'encoding':_0x3e62('0x38'),'method':_0x3e62('0x2f'),'timeout':0x2710,'url':_0x58c21a,'headers':{'Content-Type':_0x3e62('0x39')},'body':'f.req='+encodeURIComponent(JSON[_0x3e62('0x3a')]([[[_0x3e62('0x3b'),JSON[_0x3e62('0x3a')]([_0x2184ca,_0x2b08fa||'en',![],_0x3e62('0x3c')]),null,'generic']]]))};return rp(_0x1a9785)['then'](function(_0x3bfb98){try{_0x2f852a=eval(_0x3bfb98[_0x3e62('0x3d')](0x5))[0x0][0x2];}catch(_0xbf89ca){throw new Error(_0x3e62('0x3e')+_0x3bfb98[_0x3e62('0x1c')]);}if(!_0x2f852a){if(_0x2184ca[_0x3e62('0x3f')]>0xc8){throw new Error(_0x3e62('0x40'));}else{throw new Error(_0x3e62('0x41')+_0x2b08fa+_0x3e62('0x42'));}}try{_0x2f852a=eval(_0x2f852a)[0x0];}catch(_0x49f032){throw new Error(_0x3e62('0x3e')+res[_0x3e62('0x1c')]);}const _0x27f530=_0x2f852a;_0x28a93f=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x43'));fs['writeFileSync'](_0x28a93f,_0x2f852a,{'encoding':_0x3e62('0x23')});_0x408941=path['resolve'](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x28a93f,_0x408941);})[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x28a93f);fs[_0x3e62('0x25')](_0x408941,'777');}catch(_0x4d2567){logger[_0x3e62('0x11')](_0x4d2567);}logger[_0x3e62('0x20')](_0x3e62('0x44'),_0x408941[_0x3e62('0x27')]('.')[0x0]);return _0x408941['split']('.')[0x0];});};exports['googleASR']=function(_0x22f859,_0x5005ea,_0x29e283){return google[_0x3e62('0x45')](_0x22f859,_0x5005ea,_0x29e283)['then'](function(_0x48f2f3){logger[_0x3e62('0x20')](_0x48f2f3[_0x3e62('0x46')]);return rp(_0x48f2f3);})[_0x3e62('0x24')](function(_0x4361b0){var _0x2d7b38='';var _0x413d24=0x0;try{fs[_0x3e62('0x18')](_0x22f859);}catch(_0x52088c){logger['error'](_0x52088c);}if(_0x4361b0&&_0x4361b0[_0x3e62('0x47')]){_0x2d7b38=_0x4361b0[_0x3e62('0x47')][_0x3e62('0x48')](function(_0x2720b8){return _0x2720b8&&_0x2720b8[_0x3e62('0x49')][0x0]&&_0x2720b8[_0x3e62('0x49')][0x0][_0x3e62('0x4a')]?_0x2720b8[_0x3e62('0x49')][0x0][_0x3e62('0x4a')]:'';})[_0x3e62('0x4b')]('\x0a');_0x413d24=_0x4361b0['results'][_0x3e62('0x48')](function(_0x3ed9f6){return _0x3ed9f6&&_0x3ed9f6[_0x3e62('0x49')][0x0]&&_0x3ed9f6['alternatives'][0x0]['confidence']?_0x3ed9f6[_0x3e62('0x49')][0x0][_0x3e62('0x4c')]:0x0;})[_0x3e62('0x4b')]('\x0a');}logger[_0x3e62('0x20')](_0x3e62('0x4d'),_0x2d7b38);logger[_0x3e62('0x20')](_0x3e62('0x4e'),_0x413d24);return{'transcript':_0x2d7b38,'confidence':_0x413d24};})['catch'](function(_0x452422){logger[_0x3e62('0x11')](_0x3e62('0x4f'),_0x452422[_0x3e62('0x10')],_0x452422[_0x3e62('0x50')],_0x452422[_0x3e62('0x51')]);});};exports[_0x3e62('0x52')]=function(_0xaec69f,_0x30e71e,_0x55ec36,_0x32a786){var _0x9195e9=apiai(_0x30e71e,{'language':_0x32a786||'en'});return _0x9195e9[_0x3e62('0x53')](_0x55ec36,{'sessionId':md5(_0xaec69f)})[_0x3e62('0x24')](function(_0x5e259b){logger['info'](JSON['stringify'](_0x5e259b));return{'source':_0x5e259b[_0x3e62('0x54')]['source'],'resolvedQuery':_0x5e259b['result'][_0x3e62('0x55')],'action':_0x5e259b[_0x3e62('0x54')][_0x3e62('0x56')],'actionIncomplete':_0x5e259b['result']['actionIncomplete'],'speech':_0x5e259b['result'][_0x3e62('0x57')][_0x3e62('0x58')],'score':_0x5e259b[_0x3e62('0x54')]['score'],'statusCode':_0x5e259b[_0x3e62('0x59')]['code'],'endConversation':_0x5e259b[_0x3e62('0x54')][_0x3e62('0x5a')][_0x3e62('0x5b')]||![],'isFallbackIntent':_0x5e259b['result']['metadata']['isFallbackIntent']};});};exports[_0x3e62('0x5c')]=function(_0x2bfb1b,_0x56f201,_0x248e0e,_0x56fc16,_0x3d2740,_0x453492){var _0x3ef144=_0x56fc16[_0x3e62('0x5d')](/\\n/g,'\x0a');var _0x5b6a21={'credentials':{'private_key':_0x3ef144,'client_email':_0x248e0e}};var _0x189ad3=new dialogflow[(_0x3e62('0x5e'))](_0x5b6a21);var _0x59c8f8=_0x189ad3[_0x3e62('0x5f')](_0x56f201,md5(_0x2bfb1b));var _0x31284d={'session':_0x59c8f8,'queryInput':{'text':{'text':_0x3d2740,'languageCode':_0x453492}}};return _0x189ad3[_0x3e62('0x60')](_0x31284d)[_0x3e62('0x24')](function(_0x44c13a){if(_0x44c13a&&_0x44c13a[_0x3e62('0x3f')]){logger[_0x3e62('0x20')](_0x3e62('0x61'),JSON['stringify'](_0x44c13a));var _0x51715e=_0x44c13a[0x0];if(_0x51715e){var _0x3847b8={'action':_0x51715e[_0x3e62('0x62')][_0x3e62('0x56')],'allRequiredParamsPresent':_0x51715e['queryResult'][_0x3e62('0x63')],'endConversation':_0x51715e['queryResult'][_0x3e62('0x64')]&&_0x51715e['queryResult'][_0x3e62('0x64')][_0x3e62('0x65')]?_0x51715e[_0x3e62('0x62')][_0x3e62('0x64')][_0x3e62('0x65')][_0x3e62('0x66')][_0x3e62('0x67')]:![],'fulfillmentText':_0x51715e['queryResult']['fulfillmentText'],'intentName':_0x51715e[_0x3e62('0x62')][_0x3e62('0x68')]['name'],'intentDisplayName':_0x51715e[_0x3e62('0x62')]['intent'][_0x3e62('0x69')],'isFallbackIntent':_0x51715e['queryResult']['intent'][_0x3e62('0x6a')],'languageCode':_0x51715e[_0x3e62('0x62')][_0x3e62('0x6b')],'queryText':_0x51715e['queryResult'][_0x3e62('0x6c')],'responseId':_0x51715e[_0x3e62('0x6d')],'score':_0x51715e[_0x3e62('0x62')][_0x3e62('0x6e')],'speech':_0x51715e['queryResult'][_0x3e62('0x6f')],'providerResponse':JSON[_0x3e62('0x3a')](_0x44c13a)};return _0x3847b8;}}});};exports[_0x3e62('0x70')]=function(_0x1a717a,_0xbfa936,_0x1d635b,_0x298743){return tilde['asr'](_0x1a717a,_0xbfa936,_0x1d635b,_0x298743)[_0x3e62('0x24')](function(_0x583e32){try{fs[_0x3e62('0x18')](_0x1a717a);}catch(_0x4a06a6){logger[_0x3e62('0x11')](_0x4a06a6);}logger[_0x3e62('0x20')](_0x3e62('0x71'),_0x583e32[_0x3e62('0x4a')]);logger['info'](_0x3e62('0x72'),_0x583e32[_0x3e62('0x4c')]);return _0x583e32;});};exports['awsPolly']=function(_0x1e03bf,_0xf694b0,_0x4f5653,_0x3326a8,_0x15a1f9,_0x2c1008){var _0x631e92=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+'.mp3');var _0x45eab3;return aws[_0x3e62('0x73')](_0x1e03bf,_0xf694b0,_0x4f5653,_0x3326a8,_0x15a1f9,_0x2c1008,_0x631e92)['then'](function(){_0x45eab3=path['resolve'](__dirname,_0x3e62('0x30'),rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x631e92,_0x45eab3);})[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x631e92);fs[_0x3e62('0x25')](_0x45eab3,'777');}catch(_0x1b2868){logger[_0x3e62('0x11')](_0x1b2868);}return _0x45eab3[_0x3e62('0x27')]('.')[0x0];});};exports[_0x3e62('0x74')]=function(_0x4649db,_0x2dc21c,_0x4aa034,_0x3c695d,_0x36bea6,_0x54c8f6){return aws['lex'](_0x4649db,_0x2dc21c,_0x4aa034,_0x3c695d,_0x36bea6,_0x54c8f6)[_0x3e62('0x24')](function(_0x23ac6b){logger[_0x3e62('0x20')](JSON[_0x3e62('0x3a')](_0x23ac6b));return _0x23ac6b;});};exports[_0x3e62('0x75')]=function(_0x13099e,_0x5e3960,_0x397da0,_0x2e67bb){var _0x754700=util[_0x3e62('0x76')](_0x3e62('0x77'),ISPEECH_API,_0x13099e,encodeURIComponent(_0x5e3960),_0x397da0,_0x2e67bb);var _0x555b2d=path[_0x3e62('0x22')](__dirname,_0x3e62('0x30'),rs['generate'](0x4)+_0x3e62('0x43'));var _0x2653af;return downloadFile(_0x754700,_0x555b2d)[_0x3e62('0x24')](function(){_0x2653af=path[_0x3e62('0x22')](__dirname,'tmp',rs[_0x3e62('0x31')](0x4)+_0x3e62('0x34'));return convertFile(_0x555b2d,_0x2653af);})[_0x3e62('0x24')](function(){try{fs[_0x3e62('0x18')](_0x555b2d);fs[_0x3e62('0x25')](_0x2653af,_0x3e62('0x26'));}catch(_0xa94578){logger[_0x3e62('0x11')](_0xa94578);}return _0x2653af[_0x3e62('0x27')]('.')[0x0];});};exports[_0x3e62('0x78')]=function(_0x2cc139,_0x3827f7,_0x530851,_0x2025a0){var _0xe8ef2a=util[_0x3e62('0x76')](_0x3e62('0x79'),ISPEECH_API,_0x3827f7,_0x530851,base64Encode(_0x2cc139),_0x2025a0?util[_0x3e62('0x76')](_0x3e62('0x7a'),encodeURIComponent(_0x2025a0)):'freeform=3');return uploadFile(_0xe8ef2a)[_0x3e62('0x24')](function(_0x280e8f){return querystring[_0x3e62('0x9')](_0x280e8f);});};exports['sestekNDA']=function(_0x2b5e83,_0x379cb1){return sestek[_0x3e62('0x7b')](_0x2b5e83,_0x379cb1)[_0x3e62('0x24')](function(_0x1eda46){logger[_0x3e62('0x20')](JSON[_0x3e62('0x3a')](_0x1eda46));var _0x12a897={'speech':_0x1eda46['text'],'action':_0x1eda46[_0x3e62('0x7c')]?_0x1eda46['channelData'][_0x3e62('0x7d')]:undefined,'actiondata':_0x1eda46[_0x3e62('0x7c')]?_0x1eda46[_0x3e62('0x7c')]['CustomActionData']:undefined};if(_0x1eda46['channelData']&&_0x1eda46[_0x3e62('0x7c')]['AudioFromTts']){return base64Decode(_0x1eda46['channelData'][_0x3e62('0x7e')][_0x3e62('0x7f')],path['resolve'](__dirname,_0x3e62('0x30'),rs['generate'](0x4)+'.wav'))[_0x3e62('0x24')](function(_0x3474ce){_0x12a897[_0x3e62('0x80')]=_0x3474ce;return _0x12a897;});}return _0x12a897;});};exports[_0x3e62('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0xb8e8=['googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','detectIntent','action','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','%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','freeform=3','sestekNDA','nda','CustomAction','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','sox','url','parse','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','close','error','unlink','download\x20error','pipe','end','statusCode','error\x20convert','info','finish\x20to\x20convert','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','split','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','POST','tmp','.mp3','audioContent','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','uri','map','transcript','alternatives','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name'];(function(_0x42bd9f,_0x1d5404){var _0x403266=function(_0x88b361){while(--_0x88b361){_0x42bd9f['push'](_0x42bd9f['shift']());}};_0x403266(++_0x1d5404);}(_0xb8e8,0x134));var _0x8b8e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb8e8[_0x5b644e];return _0x49c6bf;};'use strict';var apiai=require(_0x8b8e('0x0'));var BPromise=require(_0x8b8e('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x8b8e('0x2'));var https=require(_0x8b8e('0x3'));var md5=require(_0x8b8e('0x4'));var path=require(_0x8b8e('0x5'));var querystring=require(_0x8b8e('0x6'));var rp=require('request-promise');var rs=require(_0x8b8e('0x7'));var sox=require(_0x8b8e('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x8b8e('0x9'))[_0x8b8e('0xa')];var util=require(_0x8b8e('0xb'));var aws=require('./aws');var google=require(_0x8b8e('0xc'));var sestek=require('./sestek');var tilde=require(_0x8b8e('0xd'));var logger=require(_0x8b8e('0xe'))(_0x8b8e('0xf'));var ISPEECH_API=_0x8b8e('0x10');function downloadFile(_0x3758d5,_0x40c1f5){return new BPromise(function(_0x152d57,_0x3296f9){var _0xa19373=urlParse(_0x3758d5);var _0x115482=_0xa19373[_0x8b8e('0x11')]===_0x8b8e('0x12')?https:http;var _0x25c66d={'host':_0xa19373['host'],'path':_0xa19373['path'],'headers':{'user-agent':_0x8b8e('0x13')}};_0x115482[_0x8b8e('0x14')](_0x25c66d,function(_0x461c3d){if(_0x461c3d['statusCode']!==0xc8){logger['error'](_0x8b8e('0x15')+_0x3758d5+_0x8b8e('0x16')+_0x461c3d['statusCode']+'\x20('+_0x461c3d['statusMessage']+')');_0x3296f9(new Error(_0x8b8e('0x15')+_0x3758d5+_0x8b8e('0x16')+_0x461c3d['statusCode']+'\x20('+_0x461c3d[_0x8b8e('0x17')]+')'));return;}var _0x46969a=fs[_0x8b8e('0x18')](_0x40c1f5);_0x46969a['on']('finish',function(){logger['info']('finish\x20download\x20file');_0x46969a[_0x8b8e('0x19')](_0x152d57);});_0x46969a['on'](_0x8b8e('0x1a'),function(_0x417e43){fs[_0x8b8e('0x1b')](_0x40c1f5);logger[_0x8b8e('0x1a')](_0x8b8e('0x1c'),_0x417e43);_0x3296f9(_0x417e43);});_0x461c3d[_0x8b8e('0x1d')](_0x46969a);})['on'](_0x8b8e('0x1a'),function(_0x261ea4){logger[_0x8b8e('0x1a')](_0x261ea4);_0x3296f9(_0x261ea4);})[_0x8b8e('0x1e')]();});}function uploadFile(_0xea51c0){return new BPromise(function(_0x31b09f,_0x5ceca2){var _0x2e6818=urlParse(_0xea51c0);var _0xc21ea9=_0x2e6818[_0x8b8e('0x11')]===_0x8b8e('0x12')?https:http;var _0x3ebebd={'host':_0x2e6818['host'],'path':_0x2e6818[_0x8b8e('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0xc21ea9[_0x8b8e('0x14')](_0x3ebebd,function(_0x2f0ed4){if(_0x2f0ed4['statusCode']!==0xc8){_0x5ceca2(new Error(_0x8b8e('0x15')+_0xea51c0+_0x8b8e('0x16')+_0x2f0ed4[_0x8b8e('0x1f')]+'\x20('+_0x2f0ed4[_0x8b8e('0x17')]+')'));return;}var _0x374535='';_0x2f0ed4['on']('data',function(_0x2e8e92){_0x374535+=_0x2e8e92;});_0x2f0ed4['on'](_0x8b8e('0x1e'),function(){_0x31b09f(_0x374535);});})['on']('error',function(_0x52c15e){_0x5ceca2(_0x52c15e);})[_0x8b8e('0x1e')]();});}function convertFile(_0x2e4ec3,_0x3aee4b){return new BPromise(function(_0x66e0ac,_0x3545c1){var _0x331d71=sox['transcode'](_0x2e4ec3,_0x3aee4b,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x331d71['on'](_0x8b8e('0x1a'),function(_0x4b5a63){logger[_0x8b8e('0x1a')](_0x8b8e('0x20'),_0x4b5a63);_0x3545c1(_0x4b5a63);});_0x331d71['on']('end',function(){logger[_0x8b8e('0x21')](_0x8b8e('0x22'));_0x66e0ac();});_0x331d71['start']();});}function base64Decode(_0x2dfebb,_0x29bb44){var _0x5b34dc=path[_0x8b8e('0x23')](__dirname,'tmp',rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x25'));fs[_0x8b8e('0x26')](_0x5b34dc,_0x2dfebb,_0x8b8e('0x27'));return convertFile(_0x5b34dc,_0x29bb44)[_0x8b8e('0x28')](function(){try{fs[_0x8b8e('0x1b')](_0x5b34dc);fs[_0x8b8e('0x29')](_0x29bb44,'777');}catch(_0x461cde){logger[_0x8b8e('0x1a')](_0x461cde);}return _0x29bb44[_0x8b8e('0x2a')]('.')[0x0];});}function base64Encode(_0x1ffe11){var _0x3d21ea=fs['readFileSync'](_0x1ffe11);return new Buffer(_0x3d21ea)[_0x8b8e('0x2b')](_0x8b8e('0x27'));}exports[_0x8b8e('0x2c')]=function(_0x331d7f,_0x23a5c6,_0x378b00,_0x3e255a,_0x1b3b01,_0x32c605){var _0x24853b,_0x58476e;var _0x1ebec8='https://texttospeech.googleapis.com/v1/';var _0x29e7f7=_0x8b8e('0x2d')+_0x331d7f;var _0x237a10={};if(_0x23a5c6===_0x8b8e('0x2e')){_0x237a10[_0x8b8e('0x2f')]={'ssml':_0x378b00};}else{_0x237a10['input']={'text':_0x378b00};};_0x237a10[_0x8b8e('0x30')]={'languageCode':_0x3e255a,'ssmlGender':_0x1b3b01};_0x237a10[_0x8b8e('0x31')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x54cd90={'url':_0x1ebec8+'text:synthesize'+_0x29e7f7,'method':_0x8b8e('0x32'),'json':!![],'body':_0x237a10};return rp(_0x54cd90)[_0x8b8e('0x28')](function(_0x298d98){return new BPromise(function(_0x43b577,_0x2f0d1f){_0x24853b=path[_0x8b8e('0x23')](__dirname,_0x8b8e('0x33'),rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x34'));var _0xdeb104=Buffer['from'](_0x298d98[_0x8b8e('0x35')],'base64');return fs['writeFile'](_0x24853b,_0xdeb104,function(_0x165ffc){_0x2f0d1f(_0x165ffc);},function(_0x2a3372){fs['chmodSync'](_0x24853b,'777');_0x43b577(_0x2a3372);});});})[_0x8b8e('0x28')](function(_0x58a5cc){_0x58476e=path[_0x8b8e('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0x8b8e('0x25'));return convertFile(_0x24853b,_0x58476e);})[_0x8b8e('0x28')](function(){try{fs[_0x8b8e('0x1b')](_0x24853b);fs[_0x8b8e('0x29')](_0x58476e,_0x8b8e('0x36'));}catch(_0x1c7848){logger['error'](_0x1c7848);}logger[_0x8b8e('0x21')](_0x8b8e('0x37'),_0x58476e['split']('.')[0x0]);return _0x58476e[_0x8b8e('0x2a')]('.')[0x0];});};exports[_0x8b8e('0x38')]=function(_0x1e7161,_0x596ddd){var _0x20bd53=_0x8b8e('0x39');var _0x5bc68c,_0x254011;var _0x25af04;var _0x1a165={'encoding':_0x8b8e('0x3a'),'method':_0x8b8e('0x32'),'timeout':0x2710,'url':_0x20bd53,'headers':{'Content-Type':_0x8b8e('0x3b')},'body':'f.req='+encodeURIComponent(JSON[_0x8b8e('0x3c')]([[[_0x8b8e('0x3d'),JSON[_0x8b8e('0x3c')]([_0x1e7161,_0x596ddd||'en',![],_0x8b8e('0x3e')]),null,'generic']]]))};return rp(_0x1a165)[_0x8b8e('0x28')](function(_0x1b6c98){try{_0x25af04=eval(_0x1b6c98['slice'](0x5))[0x0][0x2];}catch(_0x33a69c){throw new Error(_0x8b8e('0x3f')+_0x1b6c98[_0x8b8e('0x40')]);}if(!_0x25af04){if(_0x1e7161[_0x8b8e('0x41')]>0xc8){throw new Error(_0x8b8e('0x42'));}else{throw new Error(_0x8b8e('0x43')+_0x596ddd+_0x8b8e('0x44'));}}try{_0x25af04=eval(_0x25af04)[0x0];}catch(_0x47b4ee){throw new Error(_0x8b8e('0x3f')+res[_0x8b8e('0x40')]);}const _0x4c9ff8=_0x25af04;_0x5bc68c=path['resolve'](__dirname,_0x8b8e('0x33'),rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x34'));fs[_0x8b8e('0x26')](_0x5bc68c,_0x25af04,{'encoding':_0x8b8e('0x27')});_0x254011=path[_0x8b8e('0x23')](__dirname,_0x8b8e('0x33'),rs[_0x8b8e('0x24')](0x4)+'.wav');return convertFile(_0x5bc68c,_0x254011);})[_0x8b8e('0x28')](function(){try{fs[_0x8b8e('0x1b')](_0x5bc68c);fs[_0x8b8e('0x29')](_0x254011,'777');}catch(_0x9664a9){logger[_0x8b8e('0x1a')](_0x9664a9);}logger[_0x8b8e('0x21')](_0x8b8e('0x45'),_0x254011['split']('.')[0x0]);return _0x254011[_0x8b8e('0x2a')]('.')[0x0];});};exports[_0x8b8e('0x46')]=function(_0x287794,_0xce8af0,_0x10558a){return google['asr'](_0x287794,_0xce8af0,_0x10558a)[_0x8b8e('0x28')](function(_0xa5a90){logger[_0x8b8e('0x21')](_0xa5a90[_0x8b8e('0x47')]);return rp(_0xa5a90);})[_0x8b8e('0x28')](function(_0x2986b0){var _0x144bfd='';var _0xc2bd85=0x0;try{fs[_0x8b8e('0x1b')](_0x287794);}catch(_0x4d571f){logger[_0x8b8e('0x1a')](_0x4d571f);}if(_0x2986b0&&_0x2986b0['results']){_0x144bfd=_0x2986b0['results'][_0x8b8e('0x48')](function(_0x2424fc){return _0x2424fc&&_0x2424fc['alternatives'][0x0]&&_0x2424fc['alternatives'][0x0][_0x8b8e('0x49')]?_0x2424fc[_0x8b8e('0x4a')][0x0][_0x8b8e('0x49')]:'';})[_0x8b8e('0x4b')]('\x0a');_0xc2bd85=_0x2986b0[_0x8b8e('0x4c')][_0x8b8e('0x48')](function(_0x315d23){return _0x315d23&&_0x315d23[_0x8b8e('0x4a')][0x0]&&_0x315d23['alternatives'][0x0][_0x8b8e('0x4d')]?_0x315d23[_0x8b8e('0x4a')][0x0]['confidence']:0x0;})[_0x8b8e('0x4b')]('\x0a');}logger[_0x8b8e('0x21')](_0x8b8e('0x4e'),_0x144bfd);logger['info'](_0x8b8e('0x4f'),_0xc2bd85);return{'transcript':_0x144bfd,'confidence':_0xc2bd85};})[_0x8b8e('0x50')](function(_0x29bcc2){logger[_0x8b8e('0x1a')]('[%s]\x20%s:%s',_0x29bcc2[_0x8b8e('0x1f')],_0x29bcc2[_0x8b8e('0x51')],_0x29bcc2['message']);});};exports[_0x8b8e('0x52')]=function(_0x11ded0,_0x25fe49,_0x56dd06,_0x301c10){var _0x25424d=apiai(_0x25fe49,{'language':_0x301c10||'en'});return _0x25424d[_0x8b8e('0x53')](_0x56dd06,{'sessionId':md5(_0x11ded0)})[_0x8b8e('0x28')](function(_0x18cd2e){logger[_0x8b8e('0x21')](JSON['stringify'](_0x18cd2e));return{'source':_0x18cd2e[_0x8b8e('0x54')][_0x8b8e('0x55')],'resolvedQuery':_0x18cd2e[_0x8b8e('0x54')][_0x8b8e('0x56')],'action':_0x18cd2e[_0x8b8e('0x54')]['action'],'actionIncomplete':_0x18cd2e[_0x8b8e('0x54')][_0x8b8e('0x57')],'speech':_0x18cd2e['result'][_0x8b8e('0x58')][_0x8b8e('0x59')],'score':_0x18cd2e['result']['score'],'statusCode':_0x18cd2e[_0x8b8e('0x5a')][_0x8b8e('0x5b')],'endConversation':_0x18cd2e[_0x8b8e('0x54')][_0x8b8e('0x5c')][_0x8b8e('0x5d')]||![],'isFallbackIntent':_0x18cd2e[_0x8b8e('0x54')][_0x8b8e('0x5c')][_0x8b8e('0x5e')]};});};exports[_0x8b8e('0x5f')]=function(_0x34942b,_0x299ebb,_0x3d2efc,_0x281335,_0x7dfd09,_0x843517){var _0x3b864c=_0x281335[_0x8b8e('0x60')](/\\n/g,'\x0a');var _0xc21d14={'credentials':{'private_key':_0x3b864c,'client_email':_0x3d2efc}};var _0x26c0a3=new dialogflow['SessionsClient'](_0xc21d14);var _0x138d27=_0x26c0a3['sessionPath'](_0x299ebb,md5(_0x34942b));var _0x6791be={'session':_0x138d27,'queryInput':{'text':{'text':_0x7dfd09,'languageCode':_0x843517}}};return _0x26c0a3[_0x8b8e('0x61')](_0x6791be)[_0x8b8e('0x28')](function(_0x466c2a){if(_0x466c2a&&_0x466c2a[_0x8b8e('0x41')]){logger[_0x8b8e('0x21')]('Dialogflow\x20V2\x20response:',JSON[_0x8b8e('0x3c')](_0x466c2a));var _0x35b521=_0x466c2a[0x0];if(_0x35b521){var _0x36440b={'action':_0x35b521['queryResult'][_0x8b8e('0x62')],'allRequiredParamsPresent':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x64')],'endConversation':_0x35b521['queryResult'][_0x8b8e('0x65')]&&_0x35b521[_0x8b8e('0x63')]['diagnosticInfo'][_0x8b8e('0x66')]?_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x65')][_0x8b8e('0x66')][_0x8b8e('0x67')][_0x8b8e('0x68')]:![],'fulfillmentText':_0x35b521[_0x8b8e('0x63')]['fulfillmentText'],'intentName':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x69')]['name'],'intentDisplayName':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x69')]['displayName'],'isFallbackIntent':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x69')]['isFallback'],'languageCode':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x6a')],'queryText':_0x35b521['queryResult'][_0x8b8e('0x6b')],'responseId':_0x35b521[_0x8b8e('0x6c')],'score':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x6d')],'speech':_0x35b521[_0x8b8e('0x63')][_0x8b8e('0x6e')],'providerResponse':JSON[_0x8b8e('0x3c')](_0x466c2a)};return _0x36440b;}}});};exports[_0x8b8e('0x6f')]=function(_0x316a6a,_0x546dff,_0x13b9fd,_0x478afa){return tilde['asr'](_0x316a6a,_0x546dff,_0x13b9fd,_0x478afa)['then'](function(_0x57c46f){try{fs[_0x8b8e('0x1b')](_0x316a6a);}catch(_0x11aecf){logger['error'](_0x11aecf);}logger['info']('Tilde\x20ASR\x20transcription',_0x57c46f[_0x8b8e('0x49')]);logger[_0x8b8e('0x21')](_0x8b8e('0x70'),_0x57c46f[_0x8b8e('0x4d')]);return _0x57c46f;});};exports[_0x8b8e('0x71')]=function(_0x737ea3,_0x3ba072,_0x466a03,_0x8792f7,_0x214a0a,_0x1e7fcf){var _0x5711bd=path[_0x8b8e('0x23')](__dirname,_0x8b8e('0x33'),rs[_0x8b8e('0x24')](0x4)+'.mp3');var _0x3f7c74;return aws['polly'](_0x737ea3,_0x3ba072,_0x466a03,_0x8792f7,_0x214a0a,_0x1e7fcf,_0x5711bd)[_0x8b8e('0x28')](function(){_0x3f7c74=path[_0x8b8e('0x23')](__dirname,'tmp',rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x25'));return convertFile(_0x5711bd,_0x3f7c74);})[_0x8b8e('0x28')](function(){try{fs[_0x8b8e('0x1b')](_0x5711bd);fs['chmodSync'](_0x3f7c74,'777');}catch(_0x4c65e0){logger['error'](_0x4c65e0);}return _0x3f7c74[_0x8b8e('0x2a')]('.')[0x0];});};exports[_0x8b8e('0x72')]=function(_0x19d068,_0x3a6f74,_0x4a6928,_0x99bb,_0xb3f303,_0x4364d1){return aws[_0x8b8e('0x73')](_0x19d068,_0x3a6f74,_0x4a6928,_0x99bb,_0xb3f303,_0x4364d1)['then'](function(_0x17dc60){logger[_0x8b8e('0x21')](JSON[_0x8b8e('0x3c')](_0x17dc60));return _0x17dc60;});};exports[_0x8b8e('0x74')]=function(_0x4aa75f,_0x442eea,_0x59df7d,_0x3aac6f){var _0x6df8af=util['format'](_0x8b8e('0x75'),ISPEECH_API,_0x4aa75f,encodeURIComponent(_0x442eea),_0x59df7d,_0x3aac6f);var _0x56d179=path[_0x8b8e('0x23')](__dirname,_0x8b8e('0x33'),rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x34'));var _0xe043ed;return downloadFile(_0x6df8af,_0x56d179)[_0x8b8e('0x28')](function(){_0xe043ed=path[_0x8b8e('0x23')](__dirname,'tmp',rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x25'));return convertFile(_0x56d179,_0xe043ed);})[_0x8b8e('0x28')](function(){try{fs[_0x8b8e('0x1b')](_0x56d179);fs['chmodSync'](_0xe043ed,_0x8b8e('0x36'));}catch(_0x36730f){logger['error'](_0x36730f);}return _0xe043ed[_0x8b8e('0x2a')]('.')[0x0];});};exports[_0x8b8e('0x76')]=function(_0x27ba68,_0x725d6f,_0x9fa039,_0x11e331){var _0x133195=util['format'](_0x8b8e('0x77'),ISPEECH_API,_0x725d6f,_0x9fa039,base64Encode(_0x27ba68),_0x11e331?util['format']('model=%s',encodeURIComponent(_0x11e331)):_0x8b8e('0x78'));return uploadFile(_0x133195)[_0x8b8e('0x28')](function(_0x48a5ae){return querystring[_0x8b8e('0xa')](_0x48a5ae);});};exports[_0x8b8e('0x79')]=function(_0x108c22,_0x35cbb1){return sestek[_0x8b8e('0x7a')](_0x108c22,_0x35cbb1)[_0x8b8e('0x28')](function(_0x26fa73){logger[_0x8b8e('0x21')](JSON[_0x8b8e('0x3c')](_0x26fa73));var _0x195bb1={'speech':_0x26fa73['text'],'action':_0x26fa73['channelData']?_0x26fa73['channelData'][_0x8b8e('0x7b')]:undefined,'actiondata':_0x26fa73[_0x8b8e('0x7c')]?_0x26fa73[_0x8b8e('0x7c')][_0x8b8e('0x7d')]:undefined};if(_0x26fa73['channelData']&&_0x26fa73[_0x8b8e('0x7c')][_0x8b8e('0x7e')]){return base64Decode(_0x26fa73[_0x8b8e('0x7c')]['AudioFromTts'][_0x8b8e('0x7f')],path[_0x8b8e('0x23')](__dirname,_0x8b8e('0x33'),rs[_0x8b8e('0x24')](0x4)+_0x8b8e('0x25')))['then'](function(_0x2fcfb7){_0x195bb1[_0x8b8e('0x80')]=_0x2fcfb7;return _0x195bb1;});}return _0x195bb1;});};exports[_0x8b8e('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 8f34e03..6ae22fa 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x02ff=['./nda','exports'];(function(_0x543249,_0x46c918){var _0xf0257c=function(_0x3cfab3){while(--_0x3cfab3){_0x543249['push'](_0x543249['shift']());}};_0xf0257c(++_0x46c918);}(_0x02ff,0x114));var _0xf02f=function(_0x3d386d,_0x211f97){_0x3d386d=_0x3d386d-0x0;var _0x947b15=_0x02ff[_0x3d386d];return _0x947b15;};var nda=require(_0xf02f('0x0'));module[_0xf02f('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 a09b321..99d922b 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 _0x49e9=['text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','agi','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','ndaactivity_type','Nda','uniqueid','callerid','dnid','extension'];(function(_0x17f115,_0x5710cb){var _0x5587f4=function(_0x2289ca){while(--_0x2289ca){_0x17f115['push'](_0x17f115['shift']());}};_0x5587f4(++_0x5710cb);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0x949e('0x0'));var url=require(_0x949e('0x1'));var logger=require('../../../../../config/logger')(_0x949e('0x2'));module[_0x949e('0x3')]=function(_0x259795,_0x5c303a){var _0x4f1295={'method':_0x949e('0x4'),'uri':url['resolve'](_0x5c303a[_0x949e('0x5')],_0x949e('0x6')),'form':{'grant_type':_0x949e('0x7'),'username':_0x5c303a['username'],'password':_0x5c303a[_0x949e('0x7')]},'json':!![]};return rp(_0x4f1295)[_0x949e('0x8')](function(_0xfc4f8a){var _0x34ee57={'method':_0x949e('0x4'),'uri':url[_0x949e('0x9')](_0x5c303a[_0x949e('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5c303a[_0x949e('0xb')]||'message','channelId':_0x949e('0xc'),'conversation':{'id':_0x259795[_0x949e('0xd')]},'from':{'id':_0x259795[_0x949e('0xe')],'name':_0x259795['calleridname']},'recipient':{'id':_0x259795[_0x949e('0xf')],'name':_0x259795[_0x949e('0x10')]},'text':_0x5c303a[_0x949e('0x11')],'channelData':{}},'headers':{'Authorization':_0x949e('0x12')+_0xfc4f8a[_0x949e('0x13')]},'json':!![]};if(_0x5c303a[_0x949e('0x14')]){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')][_0x949e('0x17')]=_0x5c303a[_0x949e('0x14')];}if(_0x5c303a[_0x949e('0x18')]=='1'){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')][_0x949e('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x949e('0x1a')};}if(_0x5c303a['custom_action']){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')][_0x949e('0x1b')]=_0x5c303a[_0x949e('0x1c')];if(_0x5c303a['custom_action_data']){_0x34ee57[_0x949e('0x15')][_0x949e('0x16')]['CustomActionData']=_0x5c303a[_0x949e('0x1d')];}}logger[_0x949e('0x1e')](JSON[_0x949e('0x1f')](_0x34ee57));return rp(_0x34ee57);});}; \ No newline at end of file +var _0xf958=['/token','password','username','resolve','ndassistant_url','ndaactivity_type','message','uniqueid','callerid','calleridname','extension','text','Bearer\x20','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','request-promise','../../../../../config/logger','exports','POST'];(function(_0x5771fc,_0x5eeb99){var _0x59ef6e=function(_0x7051af){while(--_0x7051af){_0x5771fc['push'](_0x5771fc['shift']());}};_0x59ef6e(++_0x5eeb99);}(_0xf958,0xe6));var _0x8f95=function(_0x4e75a4,_0x4e5c87){_0x4e75a4=_0x4e75a4-0x0;var _0x4bfc7a=_0xf958[_0x4e75a4];return _0x4bfc7a;};'use strict';var rp=require(_0x8f95('0x0'));var url=require('url');var logger=require(_0x8f95('0x1'))('agi');module[_0x8f95('0x2')]=function(_0x4de6f3,_0x3155dc){var _0x3fbf4f={'method':_0x8f95('0x3'),'uri':url['resolve'](_0x3155dc['ndauth_url'],_0x8f95('0x4')),'form':{'grant_type':_0x8f95('0x5'),'username':_0x3155dc[_0x8f95('0x6')],'password':_0x3155dc[_0x8f95('0x5')]},'json':!![]};return rp(_0x3fbf4f)['then'](function(_0x1ae9c4){var _0x109bed={'method':_0x8f95('0x3'),'uri':url[_0x8f95('0x7')](_0x3155dc[_0x8f95('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3155dc[_0x8f95('0x9')]||_0x8f95('0xa'),'channelId':'Nda','conversation':{'id':_0x4de6f3[_0x8f95('0xb')]},'from':{'id':_0x4de6f3[_0x8f95('0xc')],'name':_0x4de6f3[_0x8f95('0xd')]},'recipient':{'id':_0x4de6f3['dnid'],'name':_0x4de6f3[_0x8f95('0xe')]},'text':_0x3155dc[_0x8f95('0xf')],'channelData':{}},'headers':{'Authorization':_0x8f95('0x10')+_0x1ae9c4['access_token']},'json':!![]};if(_0x3155dc[_0x8f95('0x11')]){_0x109bed[_0x8f95('0x12')][_0x8f95('0x13')]['ProjectName']=_0x3155dc[_0x8f95('0x11')];}if(_0x3155dc[_0x8f95('0x14')]=='1'){_0x109bed[_0x8f95('0x12')][_0x8f95('0x13')][_0x8f95('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8f95('0x16')};}if(_0x3155dc[_0x8f95('0x17')]){_0x109bed['body']['channelData']['CustomAction']=_0x3155dc['custom_action'];if(_0x3155dc['custom_action_data']){_0x109bed[_0x8f95('0x12')][_0x8f95('0x13')][_0x8f95('0x18')]=_0x3155dc[_0x8f95('0x19')];}}logger['info'](JSON['stringify'](_0x109bed));return rp(_0x109bed);});}; \ 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 c1173a2..358d532 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 _0xc357=['exports','./lib/api'];(function(_0x46f404,_0x1e37d7){var _0x6a62ea=function(_0x388828){while(--_0x388828){_0x46f404['push'](_0x46f404['shift']());}};_0x6a62ea(++_0x1e37d7);}(_0xc357,0x137));var _0x7c35=function(_0x1fd003,_0x1a81cc){_0x1fd003=_0x1fd003-0x0;var _0x243afb=_0xc357[_0x1fd003];return _0x243afb;};'use strict';var asr=require(_0x7c35('0x0'));module[_0x7c35('0x1')]=function(_0x467b6d,_0x38e5f7,_0x2742d4,_0x3e2273){return asr(_0x467b6d,_0x38e5f7,_0x2742d4,_0x3e2273);}; \ No newline at end of file +var _0xd0ce=['exports','./lib/api'];(function(_0x875d46,_0xc9b2f0){var _0x39fbdf=function(_0x6e41cc){while(--_0x6e41cc){_0x875d46['push'](_0x875d46['shift']());}};_0x39fbdf(++_0xc9b2f0);}(_0xd0ce,0x105));var _0xed0c=function(_0x17f145,_0x3422bb){_0x17f145=_0x17f145-0x0;var _0x2d5420=_0xd0ce[_0x17f145];return _0x2d5420;};'use strict';var asr=require(_0xed0c('0x0'));module[_0xed0c('0x1')]=function(_0x337f43,_0xbfe69a,_0x193e7a,_0x26a485){return asr(_0x337f43,_0xbfe69a,_0x193e7a,_0x26a485);}; \ 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 8ec373c..25ba25b 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 _0x616f=['isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x616f,0xed));var _0xf616=function(_0x280bef,_0x5e1bd3){_0x280bef=_0x280bef-0x0;var _0x56dc85=_0x616f[_0x280bef];return _0x56dc85;};'use strict';var BPromise=require(_0xf616('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf616('0x1'));var crypto=require(_0xf616('0x2'));var logger=require(_0xf616('0x3'))(_0xf616('0x4'));module[_0xf616('0x5')]=function(_0x650ba2,_0x350549,_0x70423d,_0x3f25ed){return new BPromise(function(_0xbc384,_0x2dd2ee){logger[_0xf616('0x6')](_0xf616('0x7'),_0x3f25ed||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x55d754=new WebSocket(_0x3f25ed||_0xf616('0x8'),{'perMessageDeflate':![]});var _0x5d3562='';var _0x419910='0';var _0x30c84c='1';var _0xcf0310=_0xf616('0x9');function _0x238bdf(_0x5e21a9){var _0x88797a=crypto['createHash'](_0xf616('0xa'));_0x88797a[_0xf616('0xb')](_0x5e21a9);return _0x88797a['digest']('hex');}function _0x277666(){try{logger[_0xf616('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x17e439=moment()[_0xf616('0xc')]();var _0x3d1686=_0x238bdf(_0x17e439+_0x350549+_0x70423d);_0x55d754[_0xf616('0xd')](JSON['stringify']({'appID':_0x350549,'timestamp':_0x17e439,'appKey':_0x3d1686}));var _0x41fde9=fs[_0xf616('0xe')](_0x650ba2);_0x41fde9['on'](_0xf616('0xf'),function(_0x435764){_0x55d754[_0xf616('0xd')](_0x435764);});_0x41fde9['on'](_0xf616('0x10'),function(){_0x55d754[_0xf616('0xd')](_0xf616('0x11'));});}catch(_0x1968ef){logger[_0xf616('0x12')](_0xf616('0x13'),JSON[_0xf616('0x14')](_0x1968ef));_0x55d754[_0xf616('0x15')]();}}function _0x4ed4b1(_0x123c53){try{if(_0x123c53){var _0x15e90b=JSON['parse'](_0x123c53);switch(_0x15e90b[_0xf616('0x16')]){case 0x0:if(_0x15e90b[_0xf616('0x17')]){if(_0x15e90b['result'][_0xf616('0x18')]){logger['info'](_0xf616('0x19'),JSON['stringify'](_0x15e90b[_0xf616('0x17')][_0xf616('0x1a')]));_0x5d3562=_0x15e90b['result']['hypotheses'][0x0][_0xf616('0x1b')];_0x419910=_0x15e90b[_0xf616('0x17')][_0xf616('0x1a')][0x0]['likelihood'];_0x30c84c='0';_0xcf0310=_0xf616('0x1c');_0x55d754[_0xf616('0x15')]();}}break;case 0x1:logger[_0xf616('0x6')](_0xf616('0x9'));_0x30c84c='1';_0xcf0310=_0xf616('0x9');break;case 0x2:logger[_0xf616('0x6')](_0xf616('0x1d'));_0x30c84c='2';_0xcf0310=_0xf616('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x30c84c='9';_0xcf0310=_0xf616('0x1e');break;case 0xa:logger[_0xf616('0x6')](_0xf616('0x1f'));_0x30c84c='10';_0xcf0310='Authentication\x20failed.';break;case 0xb:logger[_0xf616('0x6')](_0xf616('0x20'));_0x30c84c='11';_0xcf0310=_0xf616('0x20');}}}catch(_0xe7c0cf){logger[_0xf616('0x12')](_0xf616('0x21'),JSON['stringify'](_0xe7c0cf));_0x55d754[_0xf616('0x15')]();}}function _0x113470(){logger[_0xf616('0x6')](_0xf616('0x22'));_0xbc384({'transcript':_0x5d3562,'confidence':_0x419910,'status':_0x30c84c,'status_message':_0xcf0310});}function _0x68039a(_0x5d928d){logger[_0xf616('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xf616('0x23')](_0x5d928d)){logger[_0xf616('0x12')](_[_0xf616('0x24')](_0x5d928d)?JSON[_0xf616('0x14')](_0x5d928d):_0x5d928d);}}_0x55d754['on'](_0xf616('0x25'),_0x277666);_0x55d754['on'](_0xf616('0x26'),_0x4ed4b1);_0x55d754['on']('close',_0x113470);_0x55d754['on']('error',_0x68039a);});}; \ No newline at end of file +var _0xcf34=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isNil','isObject','message','moment','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x203c0a,_0x710fe){var _0xd1f1e8=function(_0x2d83e5){while(--_0x2d83e5){_0x203c0a['push'](_0x203c0a['shift']());}};_0xd1f1e8(++_0x710fe);}(_0xcf34,0x1d9));var _0x4cf3=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0xcf34[_0x492af5];return _0x59f529;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4cf3('0x0'));var crypto=require(_0x4cf3('0x1'));var logger=require('../../../../../../config/logger')(_0x4cf3('0x2'));module[_0x4cf3('0x3')]=function(_0x1ea6f5,_0x557bd3,_0x324e4c,_0x421663){return new BPromise(function(_0x427638,_0x18bb97){logger[_0x4cf3('0x4')]('Tilde\x20URI',_0x421663||_0x4cf3('0x5'));var _0xa8af1e=new WebSocket(_0x421663||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0xcbadbc='';var _0x1c2a2d='0';var _0x55af34='1';var _0x51975d=_0x4cf3('0x6');function _0x2da845(_0x295430){var _0x3ddfaf=crypto[_0x4cf3('0x7')](_0x4cf3('0x8'));_0x3ddfaf[_0x4cf3('0x9')](_0x295430);return _0x3ddfaf['digest'](_0x4cf3('0xa'));}function _0x4d30a8(){try{logger[_0x4cf3('0x4')](_0x4cf3('0xb'));var _0xb7a75d=moment()['unix']();var _0x2995e8=_0x2da845(_0xb7a75d+_0x557bd3+_0x324e4c);_0xa8af1e[_0x4cf3('0xc')](JSON['stringify']({'appID':_0x557bd3,'timestamp':_0xb7a75d,'appKey':_0x2995e8}));var _0x22c45d=fs[_0x4cf3('0xd')](_0x1ea6f5);_0x22c45d['on'](_0x4cf3('0xe'),function(_0x3bb3c0){_0xa8af1e[_0x4cf3('0xc')](_0x3bb3c0);});_0x22c45d['on'](_0x4cf3('0xf'),function(){_0xa8af1e[_0x4cf3('0xc')](_0x4cf3('0x10'));});}catch(_0x5f36cf){logger[_0x4cf3('0x11')](_0x4cf3('0x12'),JSON['stringify'](_0x5f36cf));_0xa8af1e[_0x4cf3('0x13')]();}}function _0x3953bb(_0x7a8c9c){try{if(_0x7a8c9c){var _0x448b9f=JSON[_0x4cf3('0x14')](_0x7a8c9c);switch(_0x448b9f['status']){case 0x0:if(_0x448b9f[_0x4cf3('0x15')]){if(_0x448b9f[_0x4cf3('0x15')]['final']){logger[_0x4cf3('0x4')](_0x4cf3('0x16'),JSON[_0x4cf3('0x17')](_0x448b9f[_0x4cf3('0x15')][_0x4cf3('0x18')]));_0xcbadbc=_0x448b9f[_0x4cf3('0x15')][_0x4cf3('0x18')][0x0][_0x4cf3('0x19')];_0x1c2a2d=_0x448b9f[_0x4cf3('0x15')][_0x4cf3('0x18')][0x0][_0x4cf3('0x1a')];_0x55af34='0';_0x51975d=_0x4cf3('0x1b');_0xa8af1e[_0x4cf3('0x13')]();}}break;case 0x1:logger[_0x4cf3('0x4')](_0x4cf3('0x6'));_0x55af34='1';_0x51975d=_0x4cf3('0x6');break;case 0x2:logger[_0x4cf3('0x4')](_0x4cf3('0x1c'));_0x55af34='2';_0x51975d=_0x4cf3('0x1c');break;case 0x9:logger[_0x4cf3('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x55af34='9';_0x51975d=_0x4cf3('0x1d');break;case 0xa:logger[_0x4cf3('0x4')](_0x4cf3('0x1e'));_0x55af34='10';_0x51975d=_0x4cf3('0x1e');break;case 0xb:logger[_0x4cf3('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x55af34='11';_0x51975d=_0x4cf3('0x1f');}}}catch(_0xfd0673){logger['error'](_0x4cf3('0x20'),JSON['stringify'](_0xfd0673));_0xa8af1e[_0x4cf3('0x13')]();}}function _0x420010(){logger[_0x4cf3('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x427638({'transcript':_0xcbadbc,'confidence':_0x1c2a2d,'status':_0x55af34,'status_message':_0x51975d});}function _0x4c553f(_0x19561b){logger[_0x4cf3('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x4cf3('0x21')](_0x19561b)){logger[_0x4cf3('0x11')](_[_0x4cf3('0x22')](_0x19561b)?JSON[_0x4cf3('0x17')](_0x19561b):_0x19561b);}}_0xa8af1e['on']('open',_0x4d30a8);_0xa8af1e['on'](_0x4cf3('0x23'),_0x3953bb);_0xa8af1e['on']('close',_0x420010);_0xa8af1e['on'](_0x4cf3('0x11'),_0x4c553f);});}; \ 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 10cb4be..df73069 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x7847=['./asr','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7847,0x1c0));var _0x7784=function(_0x5a959e,_0x668fa5){_0x5a959e=_0x5a959e-0x0;var _0x8cd2fb=_0x7847[_0x5a959e];return _0x8cd2fb;};var asr=require(_0x7784('0x0'));module[_0x7784('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4bcef6e..808e1c8 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 _0xedb9=['listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xedb9,0x183));var _0x9edb=function(_0x27b7e9,_0x2a6f59){_0x27b7e9=_0x27b7e9-0x0;var _0x399fea=_0xedb9[_0x27b7e9];return _0x399fea;};'use strict';var util=require(_0x9edb('0x0'));var net=require(_0x9edb('0x1'));var EventEmitter=require(_0x9edb('0x2'))[_0x9edb('0x3')];var AGIError=require(_0x9edb('0x4'));var AGIChannel=require(_0x9edb('0x5'));var AGIServer=function(_0x59f2be,_0x1b9f87,_0x4113bb){var _0x34b52e=this,_0x59f2be=_0x59f2be||0x11dd,_0x1b9f87=_0x1b9f87||_0x9edb('0x6'),_0x36e5c9=null,_0x4f1766=0x0;EventEmitter[_0x9edb('0x7')](_0x34b52e);function _0x35a073(){if(!_0x59f2be){_0x34b52e[_0x9edb('0x8')](_0x9edb('0x9'),new AGIError(_0x9edb('0xa')));return![];}_0x36e5c9=net[_0x9edb('0xb')]();_0x36e5c9[_0x9edb('0xc')](_0x59f2be,_0x1b9f87);_0x36e5c9['on'](_0x9edb('0xd'),function(){_0x34b52e[_0x9edb('0x8')]('listening');});_0x36e5c9['on'](_0x9edb('0xe'),function(_0x400f52){_0x36e5c9[_0x9edb('0xf')](function(_0x1538bc,_0xd8f66d){if(_0x1538bc){_0x34b52e['emit']('error',new AGIError(_0x9edb('0x10'),_0x1538bc));}else if(_0x4113bb&&_0x4113bb<0x0){_0x34b52e[_0x9edb('0x8')](_0x9edb('0x9'),new AGIError(_0x9edb('0x11')));_0x400f52[_0x9edb('0x12')]();}else if(_0x4113bb&&_0x4113bb>0x0&&_0x4113bb<_0xd8f66d){_0x4f1766+=0x1;_0x34b52e[_0x9edb('0x8')]('error',new AGIError(_0x9edb('0x13'),_0x4f1766));_0x400f52[_0x9edb('0x12')]();}else{var _0x2acd4f=new AGIChannel(_0x400f52);_0x2acd4f['on']('ready',function(){_0x34b52e[_0x9edb('0x8')]('connection',_0x2acd4f);});}});});_0x36e5c9['on'](_0x9edb('0x9'),function(_0x3f13de){_0x34b52e['emit']('error',new AGIError(_0x9edb('0x10'),_0x3f13de[_0x9edb('0x14')]));});_0x36e5c9['on'](_0x9edb('0x15'),function(){_0x34b52e['emit'](_0x9edb('0x15'),new AGIError(_0x9edb('0x16')));});}process[_0x9edb('0x17')](function(){_0x35a073();});};util['inherits'](AGIServer,EventEmitter);module[_0x9edb('0x18')]=function(_0x5926ee,_0x339e99,_0x2f4c21){return new AGIServer(_0x5926ee,_0x339e99,_0x2f4c21);}; \ No newline at end of file +var _0x177e=['emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','nextTick','inherits','util','events','EventEmitter','./error','./channel','127.0.0.1','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x906119,_0x50d09c){var _0x1004fb=function(_0x37dc63){while(--_0x37dc63){_0x906119['push'](_0x906119['shift']());}};_0x1004fb(++_0x50d09c);}(_0x177e,0xbb));var _0xe177=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x177e[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xe177('0x0'));var net=require('net');var EventEmitter=require(_0xe177('0x1'))[_0xe177('0x2')];var AGIError=require(_0xe177('0x3'));var AGIChannel=require(_0xe177('0x4'));var AGIServer=function(_0x5441d3,_0x17fa14,_0x4aef19){var _0x11398f=this,_0x5441d3=_0x5441d3||0x11dd,_0x17fa14=_0x17fa14||_0xe177('0x5'),_0x3c9bce=null,_0xf71b1e=0x0;EventEmitter['call'](_0x11398f);function _0x367e05(){if(!_0x5441d3){_0x11398f['emit'](_0xe177('0x6'),new AGIError(_0xe177('0x7')));return![];}_0x3c9bce=net[_0xe177('0x8')]();_0x3c9bce[_0xe177('0x9')](_0x5441d3,_0x17fa14);_0x3c9bce['on'](_0xe177('0xa'),function(){_0x11398f[_0xe177('0xb')](_0xe177('0xa'));});_0x3c9bce['on'](_0xe177('0xc'),function(_0x3cedee){_0x3c9bce[_0xe177('0xd')](function(_0x15811d,_0x2b2af2){if(_0x15811d){_0x11398f['emit']('error',new AGIError(_0xe177('0xe'),_0x15811d));}else if(_0x4aef19&&_0x4aef19<0x0){_0x11398f[_0xe177('0xb')](_0xe177('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x3cedee['destroy']();}else if(_0x4aef19&&_0x4aef19>0x0&&_0x4aef19<_0x2b2af2){_0xf71b1e+=0x1;_0x11398f[_0xe177('0xb')](_0xe177('0x6'),new AGIError(_0xe177('0xf'),_0xf71b1e));_0x3cedee[_0xe177('0x10')]();}else{var _0x4128c8=new AGIChannel(_0x3cedee);_0x4128c8['on'](_0xe177('0x11'),function(){_0x11398f[_0xe177('0xb')](_0xe177('0xc'),_0x4128c8);});}});});_0x3c9bce['on'](_0xe177('0x6'),function(_0x42d31a){_0x11398f[_0xe177('0xb')]('error',new AGIError(_0xe177('0xe'),_0x42d31a[_0xe177('0x12')]));});_0x3c9bce['on'](_0xe177('0x13'),function(){_0x11398f['emit'](_0xe177('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xe177('0x14')](function(){_0x367e05();});};util[_0xe177('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x2ec4d6,_0x1f323b,_0x71e980){return new AGIServer(_0x2ec4d6,_0x1f323b,_0x71e980);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 3eaf379..a82182f 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 _0x0ea9=['mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','label','grammar','no\x20grammar\x20configured','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','forEach','%s[%s][%s]','variable\x20%s\x20set','debug','sip_id','no\x20user\x20found','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','toUpperCase','out','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','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','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','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','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','service','host','port','secure','authentication','auth','user','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','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','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','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','VOICEMAIL','mailbox','vswitch','join','exports','path','util','lodash','randomstring','moment','mustache','request-promise','agi','../../config/environment','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','context','priority','accountcode','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','uniqueid','callback','scheduledAt','toString','callback_priority','getPauseById','agent','agentPause','isNil','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','googleTTS','url','method','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry'];(function(_0x2b700e,_0x2cd396){var _0x1f1bf3=function(_0x183b64){while(--_0x183b64){_0x2b700e['push'](_0x2b700e['shift']());}};_0x1f1bf3(++_0x2cd396);}(_0x0ea9,0x130));var _0x90ea=function(_0x160dcb,_0x3451b5){_0x160dcb=_0x160dcb-0x0;var _0x2ce20a=_0x0ea9[_0x160dcb];return _0x2ce20a;};'use strict';var fs=require('fs');var path=require(_0x90ea('0x0'));var util=require(_0x90ea('0x1'));var _=require(_0x90ea('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x90ea('0x3'));var moment=require(_0x90ea('0x4'));var Mustache=require(_0x90ea('0x5'));var rp=require(_0x90ea('0x6'));var logger=require('../../config/logger')(_0x90ea('0x7'));var config=require(_0x90ea('0x8'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x90ea('0x9'),_0x90ea('0xa')];var verticesWithRetry=[_0x90ea('0xb'),_0x90ea('0xc'),_0x90ea('0xd')];var AGIVertices=function(_0xf01350,_0x3bee24,_0x142bcd){this[_0x90ea('0xe')]=_0xf01350;this[_0x90ea('0xf')]=_0x3bee24;this[_0x90ea('0x10')]=_0x142bcd;};AGIVertices[_0x90ea('0x11')][_0x90ea('0x12')]=function(_0xcc7650,_0x4ee506){this['rpc'][_0x90ea('0x13')](_0xcc7650)['then'](function(_0x4f48e9){_0x4ee506(null,_0x4f48e9?_0x4f48e9[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x200e2a){_0x4ee506(_0x200e2a);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x16')]=function(_0x303d8f,_0x2cea38){this['rpc'][_0x90ea('0x17')](_0x303d8f)[_0x90ea('0x18')](function(_0x3e9525){_0x2cea38(null,_0x3e9525?_0x3e9525[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x2535a0){_0x2cea38(_0x2535a0);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x19')]=function(_0x268315,_0x1b1b4e){this[_0x90ea('0xf')][_0x90ea('0x1a')](_0x268315)[_0x90ea('0x18')](function(_0x4df57d){_0x1b1b4e(null,_0x4df57d?_0x4df57d[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x23502e){_0x1b1b4e(_0x23502e);});};AGIVertices[_0x90ea('0x11')]['getSquareOdbc']=function(_0x1946a1,_0xa233b2){this['rpc'][_0x90ea('0x1b')](_0x1946a1)[_0x90ea('0x18')](function(_0x43fb87){_0xa233b2(null,_0x43fb87?_0x43fb87[_0x90ea('0x1c')]:![]);})['catch'](function(_0x5e1d80){_0xa233b2(_0x5e1d80);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1d')]=function(_0x21fbd7,_0x5422f8){this[_0x90ea('0xf')][_0x90ea('0x1e')](_0x21fbd7)[_0x90ea('0x18')](function(_0x3287f0){_0x5422f8(null,_0x3287f0?_0x3287f0[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x14e86e){_0x5422f8(_0x14e86e);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1f')]=function(_0x597154,_0x38efb1){this['rpc'][_0x90ea('0x20')](_0x597154)[_0x90ea('0x18')](function(_0x18bb87){_0x38efb1(null,_0x18bb87?_0x18bb87[_0x90ea('0x14')]:![]);})['catch'](function(_0x4c21ba){_0x38efb1(_0x4c21ba);});};AGIVertices[_0x90ea('0x11')]['getSound']=function(_0xe5893b,_0x4da4a9){var _0x1e2937=this;this[_0x90ea('0xf')]['getSoundById'](_0xe5893b)[_0x90ea('0x18')](function(_0x2863a1){_0x4da4a9(null,_0x2863a1?_0x1e2937[_0x90ea('0x21')](_0x2863a1[_0x90ea('0x22')]):![]);})[_0x90ea('0x15')](function(_0x13b4ff){_0x4da4a9(_0x13b4ff);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x23')]=function(_0x44cf46,_0x3066ba){this[_0x90ea('0xf')][_0x90ea('0x24')](_0x44cf46)['then'](function(_0x2a4152){_0x3066ba(null,_0x2a4152?_0x2a4152:![]);})[_0x90ea('0x15')](function(_0x2470d2){_0x3066ba(_0x2470d2);});};AGIVertices[_0x90ea('0x11')]['sendMailMessage']=function(_0x28a0ad,_0x42e210,_0x64b002){this[_0x90ea('0x10')][_0x90ea('0x25')](_0x28a0ad,_0x42e210)[_0x90ea('0x18')](function(){_0x64b002(null);})['catch'](function(_0x10ddf7){_0x64b002(_0x10ddf7);});};AGIVertices['prototype'][_0x90ea('0x26')]=function(_0x24b6df,_0x34c118){this[_0x90ea('0xf')][_0x90ea('0x27')](_0x24b6df)['then'](function(_0x161fc2){if(_0x161fc2){if(_0x161fc2['IntervalId']){_0x34c118(null,[_0x161fc2['interval']]);}else{_0x34c118(null,_['map'](_0x161fc2[_0x90ea('0x28')],'interval'));}}else{_0x34c118(null,![]);}})[_0x90ea('0x15')](function(_0x537252){_0x34c118(_0x537252);});};AGIVertices['prototype']['getSoundPath']=function(_0xbac25){return util[_0x90ea('0x29')](_0x90ea('0x2a'),FILES_PATH,_0xbac25);};AGIVertices[_0x90ea('0x11')]['getQueryOdbc']=function(_0xf3b74e,_0x2d2b2d,_0x2da3f6){odbc[_0x90ea('0x2b')](_0xf3b74e,function(_0x137db4){if(_0x137db4){logger[_0x90ea('0x2c')](_0x90ea('0x2d'),_0x137db4);_0x2da3f6(_0x137db4);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x90ea('0x2e')](_0x2d2b2d,function(_0x521dbd,_0x412245){if(_0x521dbd){logger['info'](_0x90ea('0x2f'),_0x2d2b2d);_0x2da3f6(_0x521dbd);}else{logger[_0x90ea('0x30')](_0x90ea('0x31'),_0x2d2b2d);odbc['close'](function(_0x209d7f){if(_0x209d7f){logger[_0x90ea('0x2c')](_0x90ea('0x32'),_0x209d7f);}_0x2da3f6(null,_0x412245);});}});}});};AGIVertices['prototype'][_0x90ea('0x33')]=function(_0x22416e,_0x1ef7f1){this[_0x90ea('0xf')][_0x90ea('0x34')](_0x22416e)['then'](function(_0x107629){_0x1ef7f1(null,_0x107629?_0x107629:![]);})[_0x90ea('0x15')](function(_0x19bc9a){_0x1ef7f1(_0x19bc9a);});};AGIVertices[_0x90ea('0x11')]['createSmsMessage']=function(_0x13b475,_0x448981){this[_0x90ea('0xf')][_0x90ea('0x35')](_0x13b475)['then'](function(_0x611e33){_0x448981(null,_0x611e33);})[_0x90ea('0x15')](function(_0x4d0e22){_0x448981(_0x4d0e22);});};AGIVertices[_0x90ea('0x11')]['createSquareDetailsReport']=function(_0x48b908,_0x4e57db,_0x8ba7b){this[_0x90ea('0xf')][_0x90ea('0x36')]({'uniqueid':this['channel']['uniqueid'],'node':_0x48b908['label'],'application':_0x48b908[_0x90ea('0x37')],'data':_0x4e57db||null,'project_name':this[_0x90ea('0xe')][_0x90ea('0x38')],'callerid':this[_0x90ea('0xe')][_0x90ea('0x39')]})[_0x90ea('0x18')](function(_0x55f2a9){if(_0x8ba7b){_0x8ba7b(null,_0x55f2a9);}})[_0x90ea('0x15')](function(_0x5c680d){if(_0x8ba7b){_0x8ba7b(_0x5c680d);}});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x3a')]=function(_0x16d15f,_0x480baf,_0x5b70a0,_0x36eb5c){this[_0x90ea('0xf')][_0x90ea('0x3a')]({'uniqueid':this[_0x90ea('0xe')]['uniqueid'],'callerid':this[_0x90ea('0xe')][_0x90ea('0x39')],'calleridname':this[_0x90ea('0xe')]['calleridname'],'context':this['channel'][_0x90ea('0x3b')],'extension':this[_0x90ea('0xe')]['extension'],'priority':this[_0x90ea('0xe')][_0x90ea('0x3c')],'accountcode':this[_0x90ea('0xe')][_0x90ea('0x3d')],'dnid':this[_0x90ea('0xe')]['dnid'],'projectName':this[_0x90ea('0xe')]['arg_1'],'saveName':_0x480baf,'filename':_0x16d15f['file']||_0x480baf,'savePath':_0x5b70a0})['then'](function(_0x15b75f){_0x36eb5c(null,_0x15b75f);})[_0x90ea('0x15')](function(_0x32dfaa){_0x36eb5c(_0x32dfaa);});};AGIVertices[_0x90ea('0x11')]['createSquareMessage']=function(_0x47fbb5,_0x418108,_0x258635,_0x57a1a3,_0x303cb1){this[_0x90ea('0xf')][_0x90ea('0x3e')]({'uniqueid':this[_0x90ea('0xe')]['uniqueid'],'body':_0x47fbb5,'direction':_0x418108,'providerName':_0x258635,'providerResponse':_0x57a1a3})[_0x90ea('0x18')](function(_0x219c36){if(_0x303cb1){_0x303cb1(null,_0x219c36);}})[_0x90ea('0x15')](function(_0x2f5464){if(_0x303cb1){_0x303cb1(_0x2f5464);}});};AGIVertices['prototype'][_0x90ea('0x3f')]=function(_0x5c6303,_0x4fc48a){this[_0x90ea('0xf')][_0x90ea('0x3f')]({'firstName':_[_0x90ea('0x40')](_0x5c6303[_0x90ea('0x14')])||_['isNil'](_0x5c6303[_0x90ea('0x14')])?_0x90ea('0x41')+Math[_0x90ea('0x42')]():_0x5c6303[_0x90ea('0x14')],'lastName':_[_0x90ea('0x40')](_0x5c6303[_0x90ea('0x43')])||_['isNil'](_0x5c6303['lastName'])?null:_0x5c6303['lastName'],'phone':_0x5c6303[_0x90ea('0x44')],'ListId':_0x5c6303[_0x90ea('0x45')],'scheduledat':_0x5c6303['scheduledAt'],'callbackUniqueid':this['channel'][_0x90ea('0x46')],'tags':_0x90ea('0x47'),'description':'Callback\x20scheduled\x20at\x20'+_0x5c6303[_0x90ea('0x48')][_0x90ea('0x49')](),'priority':_0x5c6303[_0x90ea('0x4a')]})['then'](function(_0x1cbd98){_0x4fc48a(null,_0x1cbd98);})[_0x90ea('0x15')](function(_0x478532){_0x4fc48a(_0x478532);});};AGIVertices[_0x90ea('0x11')]['getPause']=function(_0x571daf,_0x36b671){this['rpc'][_0x90ea('0x4b')](_0x571daf)[_0x90ea('0x18')](function(_0x6a9fe2){_0x36b671(null,_0x6a9fe2?_0x6a9fe2[_0x90ea('0x14')]:![]);})[_0x90ea('0x15')](function(_0x55c2a4){_0x36b671(_0x55c2a4);});};AGIVertices[_0x90ea('0x11')]['agentPause']=function(_0x2fdbd6,_0x220d43,_0x221f03){var _0x22ae7d={'role':_0x90ea('0x4c')};_0x22ae7d[_0x2fdbd6]=this['channel']['callerid'];this[_0x90ea('0xf')][_0x90ea('0x4d')](_0x22ae7d,_0x220d43,this['channel']['uniqueid'])[_0x90ea('0x18')](function(_0x325abd){_0x221f03(null,_[_0x90ea('0x4e')](_0x325abd)?![]:!![]);})['catch'](function(_0x3597d6){logger[_0x90ea('0x2c')](_0x3597d6);_0x221f03(null,![]);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x4f')]=function(_0x3dd96d,_0x4b86b8){var _0x12b8ec={'role':_0x90ea('0x4c')};_0x12b8ec[_0x3dd96d]=this[_0x90ea('0xe')][_0x90ea('0x39')];this[_0x90ea('0xf')][_0x90ea('0x4f')](_0x12b8ec)['then'](function(_0x54caf8){_0x4b86b8(null,_[_0x90ea('0x4e')](_0x54caf8)?![]:!![]);})[_0x90ea('0x15')](function(_0x6604c6){logger[_0x90ea('0x2c')](_0x6604c6);_0x4b86b8(null,![]);});};AGIVertices[_0x90ea('0x11')]['agentLogout']=function(_0x1d261c,_0x43d663){var _0x130b8f={'role':_0x90ea('0x4c')};_0x130b8f[_0x1d261c]=this[_0x90ea('0xe')]['callerid'];this[_0x90ea('0xf')][_0x90ea('0x50')](_0x130b8f)[_0x90ea('0x18')](function(_0x2d95f0){_0x43d663(null,_[_0x90ea('0x4e')](_0x2d95f0)?![]:!![]);})[_0x90ea('0x15')](function(_0x273d0b){logger[_0x90ea('0x2c')](_0x273d0b);_0x43d663(null,![]);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x51')]=function(_0x3e7d31,_0x4a1e6c){var _0xfa3cbe={'role':_0x90ea('0x4c')};_0xfa3cbe[_0x3e7d31]=this[_0x90ea('0xe')][_0x90ea('0x39')];var _0x2408ec=_0x3e7d31!=_0x90ea('0x52')?util['format'](_0x90ea('0x53'),_0x90ea('0x54'),this[_0x90ea('0xe')]['callerid']):undefined;this[_0x90ea('0xf')]['agentLogin'](_0xfa3cbe,_0x2408ec)[_0x90ea('0x18')](function(_0x2c654a){_0x4a1e6c(null,_[_0x90ea('0x4e')](_0x2c654a)?![]:!![]);})[_0x90ea('0x15')](function(_0x9a3847){logger['error'](_0x9a3847);_0x4a1e6c(null,![]);});};AGIVertices['prototype'][_0x90ea('0x55')]=function(_0x5ca20c,_0x25cee6){sh[_0x90ea('0x56')](_[_0x90ea('0x57')](_0x5ca20c),function(_0x1f01e9,_0x11186c){var _0x5e09c1=_0x11186c[_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'');_0x25cee6(null,_0x5e09c1);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x59')]=function(_0x1ce10b,_0x41c00b){scripts['googleCloudTTS'](_0x1ce10b[_0x90ea('0x5a')],_0x1ce10b[_0x90ea('0x5b')]||_0x90ea('0x5c'),_0x1ce10b[_0x90ea('0x5c')],_0x1ce10b[_0x90ea('0x5d')]||'en-US',_0x1ce10b[_0x90ea('0x5e')]||_0x90ea('0x5f'),_0x1ce10b['audioEncoding']||'MP3')[_0x90ea('0x18')](function(_0x391736){_0x41c00b(null,_0x391736);})['catch'](function(_0x3e470a){_0x41c00b(_0x3e470a);});};AGIVertices[_0x90ea('0x11')]['googleTTS']=function(_0x3856c8,_0x255ef7){scripts[_0x90ea('0x60')](_0x3856c8[_0x90ea('0x5c')],_0x3856c8['google_tts_language']||'en',0x1)[_0x90ea('0x18')](function(_0x28eac7){_0x255ef7(null,_0x28eac7);})[_0x90ea('0x15')](function(_0x48d010){_0x255ef7(_0x48d010);});};AGIVertices['prototype']['restAPI']=function(_0x5d2bd0,_0x37021d){var _0x36c244={'uri':_0x5d2bd0[_0x90ea('0x61')],'method':_0x5d2bd0[_0x90ea('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5d2bd0['timeout'])==='number'&&parseInt(_0x5d2bd0[_0x90ea('0x63')])>=0x1?parseInt(_0x5d2bd0[_0x90ea('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x90ea('0x64')]([_0x90ea('0x65'),_0x90ea('0x66')],_0x36c244[_0x90ea('0x62')]['toUpperCase']())){try{_0x36c244[_0x90ea('0x67')]=_0x5d2bd0[_0x90ea('0xa')]?JSON[_0x90ea('0x68')](_0x5d2bd0[_0x90ea('0xa')]):{};}catch(_0x4d1bd0){logger[_0x90ea('0x2c')](_0x90ea('0x69'),_0x4d1bd0);}}try{_0x36c244[_0x90ea('0x6a')]=_0x5d2bd0[_0x90ea('0x9')]?JSON['parse'](_0x5d2bd0[_0x90ea('0x9')]):{};}catch(_0x5e8cfd){logger[_0x90ea('0x2c')](_0x90ea('0x6b'),_0x5e8cfd);}if(_0x5d2bd0[_0x90ea('0x6c')]){try{var _0x5a8adc=require(_0x5d2bd0[_0x90ea('0x6c')])[_0x90ea('0x6d')](this,_0x36c244);_0x36c244[_0x90ea('0x6e')]=Mustache[_0x90ea('0x6f')](_0x5d2bd0[_0x90ea('0x61')],_0x5a8adc,{},['$$','$$']);if(_0x36c244['headers']){_0x36c244[_0x90ea('0x6a')]=JSON[_0x90ea('0x68')](Mustache[_0x90ea('0x6f')](JSON[_0x90ea('0x70')](_0x36c244['headers']),_0x5a8adc,{},['$$','$$']));}if(_0x36c244[_0x90ea('0x67')]){_0x36c244[_0x90ea('0x67')]=JSON[_0x90ea('0x68')](Mustache[_0x90ea('0x6f')](JSON[_0x90ea('0x70')](_0x36c244[_0x90ea('0x67')]),_0x5a8adc,{},['$$','$$']));}}catch(_0xa96399){logger['error'](_0x90ea('0x71'),_0xa96399);}}rp(_0x36c244)['then'](function(_0x447794){var _0x4f882f={'statusCode':_0x447794[_0x90ea('0x72')]||0xc8,'statusMessage':_0x447794[_0x90ea('0x73')]||'OK','headers':_0x447794[_0x90ea('0x6a')]||{},'body':_0x447794[_0x90ea('0x67')]||{}};_0x37021d(null,_0x4f882f);})[_0x90ea('0x15')](function(_0x37c143){var _0x17cd6f={'statusCode':_0x37c143[_0x90ea('0x72')]||0x1f4,'statusMessage':_0x37c143[_0x90ea('0x74')]||_0x90ea('0x75'),'headers':_0x37c143[_0x90ea('0x76')][_0x90ea('0x6a')]||{},'body':_0x37c143[_0x90ea('0x76')][_0x90ea('0x67')]||{}};_0x37021d(null,_0x17cd6f);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x77')]=function(_0x3afb5c,_0x2568c0){scripts[_0x90ea('0x77')](this[_0x90ea('0xe')]['uniqueid'],_0x3afb5c[_0x90ea('0x78')],_0x3afb5c['text'],_0x3afb5c[_0x90ea('0x79')]||'en')[_0x90ea('0x18')](function(_0x4cff88){_0x2568c0(null,_0x4cff88);})[_0x90ea('0x15')](function(_0x112019){_0x2568c0(_0x112019);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x7a')]=function(_0x11740d,_0x419d2d){scripts['googleDialogflowV2'](this['channel'][_0x90ea('0x46')],_0x11740d[_0x90ea('0x7b')],_0x11740d[_0x90ea('0x7c')],_0x11740d[_0x90ea('0x7d')],_0x11740d['text'],_0x11740d[_0x90ea('0x7e')]||'en')['then'](function(_0xcd8a49){_0x419d2d(null,_0xcd8a49);})[_0x90ea('0x15')](function(_0x37c28c){_0x419d2d(_0x37c28c);});};AGIVertices['prototype'][_0x90ea('0x7f')]=function(_0x5008d2,_0x312926){scripts[_0x90ea('0x7f')](this[_0x90ea('0xe')],_0x5008d2)[_0x90ea('0x18')](function(_0x37cfc1){_0x312926(null,_0x37cfc1);})[_0x90ea('0x15')](function(_0x3fb110){_0x312926(_0x3fb110);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x80')]=function(_0x22148f,_0x2cfd01){scripts[_0x90ea('0x80')](_0x22148f[_0x90ea('0x78')],_0x22148f[_0x90ea('0x5c')],_0x22148f[_0x90ea('0x81')]||_0x90ea('0x82'),_0x22148f['speed'])['then'](function(_0x56c314){_0x2cfd01(null,_0x56c314);})['catch'](function(_0x561319){_0x2cfd01(_0x561319);});};AGIVertices['prototype'][_0x90ea('0x83')]=function(_0x2dc7a7,_0x261dcf,_0x2b781e){scripts[_0x90ea('0x83')](_0x261dcf,_0x2dc7a7[_0x90ea('0x78')],_0x2dc7a7[_0x90ea('0x84')]||_0x90ea('0x82'),this[_0x90ea('0x85')](_0x2dc7a7[_0x90ea('0x86')])?_0x2dc7a7['model']:undefined)[_0x90ea('0x18')](function(_0x3362ed){_0x2b781e(null,_0x3362ed);})[_0x90ea('0x15')](function(_0x1626c2){_0x2b781e(_0x1626c2);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x87')]=function(_0x499585,_0x40ef25){scripts[_0x90ea('0x87')](_0x499585[_0x90ea('0x88')],_0x499585[_0x90ea('0x89')],_0x499585[_0x90ea('0x8a')],_0x499585[_0x90ea('0x8b')]||_0x90ea('0x8c'),_0x499585[_0x90ea('0x5c')],_0x499585[_0x90ea('0x8d')]||_0x90ea('0x5c'))[_0x90ea('0x18')](function(_0x47bd7d){_0x40ef25(null,_0x47bd7d);})[_0x90ea('0x15')](function(_0x180ea0){_0x40ef25(_0x180ea0);});};AGIVertices['prototype'][_0x90ea('0x8e')]=function(_0x5b9c0f,_0x35a333){scripts[_0x90ea('0x8e')](this[_0x90ea('0xe')][_0x90ea('0x46')],_0x5b9c0f[_0x90ea('0x88')],_0x5b9c0f['aws_secret_access_key'],_0x5b9c0f[_0x90ea('0x8f')],_0x5b9c0f['text'],_0x5b9c0f[_0x90ea('0x90')])[_0x90ea('0x18')](function(_0x4bc8e4){_0x35a333(null,_0x4bc8e4);})[_0x90ea('0x15')](function(_0x401c77){_0x35a333(_0x401c77);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x91')]=function(_0x1387a8,_0x49d387,_0x3b049b){scripts[_0x90ea('0x91')](_0x49d387,_0x1387a8[_0x90ea('0x78')],_0x1387a8['google_asr_language']||_0x90ea('0x82'))[_0x90ea('0x18')](function(_0x3d6cff){_0x3b049b(null,_0x3d6cff);})[_0x90ea('0x15')](function(_0x3bd1a1){_0x3b049b(_0x3bd1a1);});};AGIVertices[_0x90ea('0x11')][_0x90ea('0x92')]=function(_0x17e269,_0x322145,_0x4974ee){scripts['tildeASR'](_0x322145,_0x17e269[_0x90ea('0x93')],_0x17e269[_0x90ea('0x94')],_0x17e269['uri'])[_0x90ea('0x18')](function(_0x5c4372){_0x4974ee(null,_0x5c4372);})[_0x90ea('0x15')](function(_0x1f0655){_0x4974ee(_0x1f0655);});};AGIVertices[_0x90ea('0x11')]['clear']=function(_0x38ce53){var _0x4b0ae5=_['includes'](verticesWithRetry,_0x38ce53[_0x90ea('0x37')])?_0x38ce53:_['clone'](_0x38ce53);for(var _0x184a51 in _0x4b0ae5){if(_0x4b0ae5[_0x90ea('0x95')](_0x184a51)){if(_0x4b0ae5[_0x184a51]&&_[_0x90ea('0x96')](_0x4b0ae5[_0x184a51])){if(_['includes'](recursiveMapAttributes,_0x184a51)){_0x4b0ae5[_0x184a51]=this[_0x90ea('0x97')](_0x4b0ae5[_0x184a51]);}else{_0x4b0ae5[_0x184a51]=this['replaceAllVariables'](_0x4b0ae5[_0x184a51]);}}}}return _0x4b0ae5;};AGIVertices[_0x90ea('0x11')]['recursiveNodeIndex']=function(_0x5d8f79){for(var _0x345504 in _0x5d8f79){if(_0x5d8f79[_0x90ea('0x95')](_0x345504)){if(_[_0x90ea('0x98')](_0x5d8f79[_0x345504])){this[_0x90ea('0x99')](_0x5d8f79[_0x345504]);}else if(_[_0x90ea('0x9a')](_0x5d8f79[_0x345504])){for(var _0x5cbcf0=0x0;_0x5cbcf0<_0x5d8f79[_0x345504][_0x90ea('0x9b')];_0x5cbcf0++){this['recursiveNodeIndex'](_0x5d8f79[_0x345504][_0x5cbcf0]);}}else if(_[_0x90ea('0x96')](_0x5d8f79[_0x345504])){_0x5d8f79[_0x345504]=this[_0x90ea('0x9c')](_0x5d8f79[_0x345504]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x2715e7,_0x209ec8){for(var _0x280f4e in _0x2715e7){if(_0x2715e7[_0x90ea('0x95')](_0x280f4e)){if(_[_0x90ea('0x98')](_0x2715e7[_0x280f4e])){if(!_[_0x90ea('0x40')](_0x2715e7[_0x280f4e])){this[_0x90ea('0x9d')](_0x2715e7[_0x280f4e],util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x209ec8,_0x280f4e));}}else if(_[_0x90ea('0x9a')](_0x2715e7[_0x280f4e])){for(var _0xa4381b=0x0;_0xa4381b<_0x2715e7[_0x280f4e][_0x90ea('0x9b')];_0xa4381b++){this[_0x90ea('0x9d')](_0x2715e7[_0x280f4e][_0xa4381b],util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x209ec8,_0x280f4e+'['+_0xa4381b+']'));}}else{if(!_[_0x90ea('0x4e')](_0x2715e7[_0x280f4e])){this['channel'][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x209ec8,_0x280f4e),_0x2715e7[_0x280f4e]);}}}}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x97')]=function(_0x165bb1){try{var _0x299c90=JSON[_0x90ea('0x68')](_0x165bb1);this[_0x90ea('0x99')](_0x299c90);return JSON[_0x90ea('0x70')](_0x299c90);}catch(_0xc78e55){return this[_0x90ea('0x9c')](_0x165bb1);}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x9c')]=function(_0x3124fa){var _0x15e32d=_0x3124fa[_0x90ea('0xa0')]('{');for(var _0x196f3b=0x1;_0x196f3b<_0x15e32d[_0x90ea('0x9b')];_0x196f3b+=0x1){var _0x4bba2c=_0x15e32d[_0x196f3b][_0x90ea('0xa0')]('}');if(_0x4bba2c[_0x90ea('0x9b')]>0x1){_0x3124fa=_0x3124fa['replaceAll']('{'+_0x4bba2c[0x0]+'}',this[_0x90ea('0xe')]['getVariable'](_0x4bba2c[0x0])[_0x90ea('0xa1')]||_0x4bba2c[0x0]);}}if(_0x15e32d[_0x90ea('0x9b')]===0x1){return _0x3124fa[_0x90ea('0x49')]();}return this[_0x90ea('0x9c')](_0x3124fa);};AGIVertices[_0x90ea('0x11')][_0x90ea('0xa2')]=function(_0x11d8aa,_0x314378){var _0x2b6666=this[_0x90ea('0xe')][_0x90ea('0x12')](_0x11d8aa);if(_0x2b6666['result']===-0x1){return _0x2b6666;}logger[_0x90ea('0x30')](util['format'](_0x90ea('0xa3'),_0x314378,_0x2b6666['extra']));return this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x314378,_0x2b6666[_0x90ea('0xa1')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x85')]=function(_0x3dcd39){return _0x3dcd39&&_0x3dcd39!=='0'&&_0x3dcd39!=='-1'&&_0x3dcd39!=='';};AGIVertices[_0x90ea('0x11')]['maxRetry']=function(_0x5237b4){this[_0x90ea('0x36')]['sync'](this,_0x5237b4,'-');_0x5237b4[_0x90ea('0xa4')]=_0x5237b4['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x90ea('0x11')][_0x90ea('0xa5')]=function(_0x255864){logger[_0x90ea('0x30')](util['format'](_0x90ea('0xa6'),_0x255864['label']));if(!this[_0x90ea('0x85')](_0x255864[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}var _0x2d4a52='\x22'+_0x255864[_0x90ea('0x5c')]+'\x22';if(this[_0x90ea('0x85')](_0x255864[_0x90ea('0x76')])){_0x2d4a52+=','+_0x255864[_0x90ea('0x76')];}var _0x377c07=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0xa9'),_0x2d4a52);if(_0x377c07[_0x90ea('0xaa')]===-0x1){return _0x377c07;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0xab'),_0x2d4a52));};AGIVertices['prototype'][_0x90ea('0xac')]=function(_0xeadc5){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xeadc5[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0xeadc5[_0x90ea('0xae')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xaf'));}var _0x12670b=_0xeadc5[_0x90ea('0xae')];if(this['isConfigured'](_0xeadc5[_0x90ea('0x76')])){_0x12670b+=','+_0xeadc5['options'];}var _0x1c0639=this[_0x90ea('0xe')]['exec']('MRCPRecog',_0x12670b);if(_0x1c0639['result']===-0x1){return _0x1c0639;}var _0x582b4c=this[_0x90ea('0xa2')]('RECOG_CONFIDENCE()',_0x90ea('0xb0'));if(_0x582b4c[_0x90ea('0xaa')]===-0x1){return _0x582b4c;}var _0x5c8a31=this[_0x90ea('0xa2')](_0x90ea('0xb1'),_0x90ea('0xb2'));if(_0x5c8a31['result']===-0x1){return _0x5c8a31;}var _0x220d4c=this[_0x90ea('0xa2')](_0x90ea('0xb3'),_0x90ea('0xb4'));if(_0x220d4c[_0x90ea('0xaa')]===-0x1){return _0x220d4c;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x12670b));};AGIVertices[_0x90ea('0x11')]['agi']=function(_0x5107f2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xb5'),_0x5107f2['label']));return this[_0x90ea('0xe')][_0x90ea('0x7')]([_0x5107f2[_0x90ea('0xb6')],_0x5107f2[_0x90ea('0xb7')]]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0xb8')]=function(_0xc58f8b){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xb9'),_0xc58f8b[_0x90ea('0xad')]));if(this[_0x90ea('0x85')](_0xc58f8b['timeout'])){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xc58f8b['timeout']));var _0x354985=this[_0x90ea('0xe')][_0x90ea('0xba')](_0xc58f8b[_0x90ea('0x63')]);if(_0x354985[_0x90ea('0xaa')]===-0x1){return _0x354985;}}return this['channel']['answer']();};AGIVertices['prototype'][_0x90ea('0x47')]=function(_0x49a453){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xbb'),_0x49a453[_0x90ea('0xad')]));if(!this['isConfigured'](_0x49a453[_0x90ea('0x45')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x49a453,'no\x20list\x20selected');}_0x49a453['scheduledAt']=moment();if(this[_0x90ea('0x85')](_0x49a453[_0x90ea('0xbc')])){_0x49a453[_0x90ea('0x48')]=moment()[_0x90ea('0xbd')](_0x49a453[_0x90ea('0xbc')],_0x90ea('0xbe'));}if(!this[_0x90ea('0x85')](_0x49a453[_0x90ea('0x4a')])){_0x49a453['callback_priority']=0x2;}this[_0x90ea('0x3f')]['sync'](this,_0x49a453);return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xbf'),_0x49a453[_0x90ea('0x44')],_0x49a453[_0x90ea('0x45')],_0x49a453[_0x90ea('0x48')]));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xc0')]=function(_0x3cac40){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xc1'),_0x3cac40[_0x90ea('0xad')]));var _0x2f9496=this['channel'][_0x90ea('0x56')](_0x3cac40[_0x90ea('0xc2')],_0x3cac40[_0x90ea('0x76')]);if(_0x2f9496['result']===-0x1){return _0x2f9496;}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')]('Executed\x20command\x20%s\x20%s',_0x3cac40['application'],_0x3cac40['options']));};AGIVertices['prototype'][_0x90ea('0xc3')]=function(_0x10cebf){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xc4'),_0x10cebf[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x10cebf[_0x90ea('0x5c')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xa8'));}var _0x18174b='\x22'+_0x10cebf['text']+'\x22';if(this[_0x90ea('0x85')](_0x10cebf['options'])){_0x18174b+=','+_0x10cebf[_0x90ea('0x76')];}var _0x3d0c85=this['channel']['exec'](_0x90ea('0xa9'),_0x18174b);if(_0x3d0c85['result']===-0x1){return _0x3d0c85;}return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x18174b));};AGIVertices['prototype'][_0x90ea('0xc5')]=function(_0x134384){logger[_0x90ea('0x30')](util['format'](_0x90ea('0xc6'),_0x134384[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x134384[_0x90ea('0x5c')])){return this[_0x90ea('0xe')]['noop']('no\x20text\x20configured');}var _0xf7eb61='\x22'+_0x134384[_0x90ea('0x5c')]+'\x22';if(this[_0x90ea('0x85')](_0x134384[_0x90ea('0x76')])){_0xf7eb61+=','+_0x134384[_0x90ea('0x76')];}var _0x19599c=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0xa9'),_0xf7eb61);if(_0x19599c[_0x90ea('0xaa')]===-0x1){return _0x19599c;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0xf7eb61));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xc7')]=function(_0x50ead2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xc8'),_0x50ead2[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x50ead2[_0x90ea('0xae')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xaf'));}var _0x214991=_0x50ead2[_0x90ea('0xae')];if(this['isConfigured'](_0x50ead2[_0x90ea('0x76')])){_0x214991+=','+_0x50ead2[_0x90ea('0x76')];}var _0x140394=this['channel']['exec']('MRCPRecog',_0x214991);if(_0x140394['result']===-0x1){return _0x140394;}var _0x3bb669=this[_0x90ea('0xa2')](_0x90ea('0xc9'),_0x90ea('0xca'));if(_0x3bb669[_0x90ea('0xaa')]===-0x1){return _0x3bb669;}var _0x36aa80=this[_0x90ea('0xa2')](_0x90ea('0xb1'),_0x90ea('0xcb'));if(_0x36aa80[_0x90ea('0xaa')]===-0x1){return _0x36aa80;}var _0x3fd0d7=this[_0x90ea('0xa2')](_0x90ea('0xb3'),_0x90ea('0xcc'));if(_0x3fd0d7['result']===-0x1){return _0x3fd0d7;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xcd'),_0x214991));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xce')]=function(_0x1bf30c){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xcf'),_0x1bf30c[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x1bf30c[_0x90ea('0xae')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xaf'));}var _0x4af84f=_0x1bf30c['grammar'];if(this[_0x90ea('0x85')](_0x1bf30c[_0x90ea('0x76')])){_0x4af84f+=','+_0x1bf30c['options'];}var _0x2edff9=this[_0x90ea('0xe')]['exec'](_0x90ea('0xd0'),_0x4af84f);if(_0x2edff9[_0x90ea('0xaa')]===-0x1){return _0x2edff9;}var _0x5c05d8=this[_0x90ea('0xa2')](_0x90ea('0xc9'),_0x90ea('0xd1'));if(_0x5c05d8[_0x90ea('0xaa')]===-0x1){return _0x5c05d8;}var _0x484f2e=this[_0x90ea('0xa2')](_0x90ea('0xb1'),_0x90ea('0xd2'));if(_0x484f2e[_0x90ea('0xaa')]===-0x1){return _0x484f2e;}var _0x4ebb3e=this[_0x90ea('0xa2')](_0x90ea('0xb3'),_0x90ea('0xd3'));if(_0x4ebb3e[_0x90ea('0xaa')]===-0x1){return _0x4ebb3e;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xcd'),_0x4af84f));};AGIVertices[_0x90ea('0x11')]['database']=function(_0x436602){logger['info'](util['format'](_0x90ea('0xd4'),_0x436602[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x436602[_0x90ea('0xd5')])){return this['channel'][_0x90ea('0x2c')](_0x436602,'no\x20database\x20selected');}var _0x4ff413=this['getSquareOdbc'][_0x90ea('0x6d')](this,_0x436602['odbc_id']);if(!_0x4ff413){return this[_0x90ea('0xe')]['error'](_0x436602,_0x90ea('0xd6'));}if(!this['isConfigured'](_0x436602[_0x90ea('0x2e')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x436602,_0x90ea('0xd7'));}var _0x3c7f5b=_0x436602['query'][_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xd8'),_0x3c7f5b));var _0x4b5adb=this[_0x90ea('0xd9')][_0x90ea('0x6d')](this,_0x4ff413,_0x3c7f5b);this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x436602,_0x3c7f5b);if(!this[_0x90ea('0x85')](_0x436602[_0x90ea('0xda')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x184a65=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x436602[_0x90ea('0xda')]);if(!_0x184a65){return this['channel'][_0x90ea('0x2c')](_0x436602,'no\x20variable\x20found');}var _0x41fcb7=this;_0x4b5adb[_0x90ea('0xdb')](function(_0x4b7d7f,_0x207992){Object['keys'](_0x4b7d7f)[_0x90ea('0xdb')](function(_0x35b2bb){_0x41fcb7[_0x90ea('0xe')][_0x90ea('0x9f')](util['format'](_0x90ea('0xdc'),_0x184a65,_0x207992,_0x35b2bb),_0x4b7d7f[_0x35b2bb]);});});this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')]('%s_ROWS_COUNT',_0x184a65),_0x4b5adb['length']);return this[_0x90ea('0xe')]['noop'](util['format'](_0x90ea('0xdd'),_0x184a65));};AGIVertices[_0x90ea('0x11')]['dial']=function(_0x529584){logger[_0x90ea('0xde')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x529584['label']));if(!this[_0x90ea('0x85')](_0x529584[_0x90ea('0xdf')])){return this[_0x90ea('0xe')]['error'](_0x529584,'no\x20user\x20selected');}var _0x36c54e=this[_0x90ea('0x1d')][_0x90ea('0x6d')](this,_0x529584[_0x90ea('0xdf')]);if(!_0x36c54e){return this[_0x90ea('0xe')]['error'](_0x529584,_0x90ea('0xe0'));}var _0x263a08=this['channel'][_0x90ea('0x56')]('DIAL',[util['format']('SIP/%s',_0x36c54e),_0x529584[_0x90ea('0x63')],_0x529584[_0x90ea('0xe1')],_0x529584[_0x90ea('0x61')]]);if(_0x263a08['result']===-0x1){return _0x263a08;}return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20%s',_0x90ea('0xe2')));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xe3')]=function(_0x3b5f31){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xe4'),_0x3b5f31[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x3b5f31['key'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20key\x20configured');}if(!this[_0x90ea('0x85')](_0x3b5f31[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this['channel'][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x3b5f31);this[_0x90ea('0x3e')](_0x3b5f31[_0x90ea('0x5c')],'in','','');this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xe6'),_0x3b5f31[_0x90ea('0x5c')]));var _0x16ac00=this[_0x90ea('0x77')]['sync'](this,_0x3b5f31);if(_0x16ac00){for(var _0x371a8a in _0x16ac00){if(_0x16ac00['hasOwnProperty'](_0x371a8a)){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')]('DIALOGFLOW_%s',_0x371a8a['toUpperCase']()),_0x16ac00[_0x371a8a]);}}this[_0x90ea('0x3e')](_0x16ac00[_0x90ea('0xe7')],'out',_0x90ea('0xe3'),'');return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Dialogflow\x20Result\x20%s',_0x16ac00[_0x90ea('0xe7')]));}return this['channel'][_0x90ea('0x2c')](_0x3b5f31,_0x90ea('0xe8'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xe9')]=function(_0x4c74fe){logger['info'](util['format'](_0x90ea('0xea'),_0x4c74fe[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4c74fe[_0x90ea('0x7b')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xeb'));}if(!this['isConfigured'](_0x4c74fe[_0x90ea('0x7c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xec'));}if(!this[_0x90ea('0x85')](_0x4c74fe[_0x90ea('0x7d')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xed'));}if(!this[_0x90ea('0x85')](_0x4c74fe['dialogflowV2_language'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xee'));}if(!this[_0x90ea('0x85')](_0x4c74fe[_0x90ea('0x5c')])){return this['channel']['noop'](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x4c74fe);this[_0x90ea('0x3e')](_0x4c74fe['text'],'in','','');this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x4c74fe[_0x90ea('0x5c')]));var _0x3e5adc=this[_0x90ea('0x7a')][_0x90ea('0x6d')](this,_0x4c74fe);if(_0x3e5adc){for(var _0x4f59b3 in _0x3e5adc){if(_0x3e5adc['hasOwnProperty'](_0x4f59b3)){if(_0x4f59b3!==_0x90ea('0xef')){this['channel'][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0xf0'),_0x4f59b3[_0x90ea('0xf1')]()),_0x3e5adc[_0x4f59b3]);}}}this[_0x90ea('0x3e')](_0x3e5adc[_0x90ea('0xe7')],_0x90ea('0xf2'),_0x90ea('0xe9'),_0x3e5adc[_0x90ea('0xef')]);return this['channel']['noop'](util[_0x90ea('0x29')]('DialogflowV2\x20Result\x20%s',_0x3e5adc[_0x90ea('0xe7')]));}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x4c74fe,_0x90ea('0xf3'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0xf4')]=function(_0x53c32e){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0xf5'),_0x53c32e[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x53c32e[_0x90ea('0xf6')])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0xf7'));}if(!this[_0x90ea('0x85')](_0x53c32e[_0x90ea('0xf8')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xf9'));}if(!this['isConfigured'](_0x53c32e['password'])){return this['channel'][_0x90ea('0xa7')](_0x90ea('0xfa'));}if(!this['isConfigured'](_0x53c32e[_0x90ea('0xfb')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x53c32e);this[_0x90ea('0x3e')](_0x53c32e[_0x90ea('0x5c')],'in','','');this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xfc'),_0x53c32e[_0x90ea('0x5c')]));var _0x641799=this[_0x90ea('0x7f')][_0x90ea('0x6d')](this,_0x53c32e);if(_0x641799){for(var _0x5519a6 in _0x641799){if(_0x641799[_0x90ea('0x95')](_0x5519a6)){this[_0x90ea('0xe')]['setVariable'](util[_0x90ea('0x29')](_0x90ea('0xfd'),_0x5519a6['toUpperCase']()),_0x641799[_0x5519a6]);}}this[_0x90ea('0x3e')](_0x641799['speech'],_0x90ea('0xf2'),'sesteknda','');if(_0x641799[_0x90ea('0xfe')]){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0xff'),_0x641799[_0x90ea('0xfe')]));var _0x5bc194=this[_0x90ea('0xe')][_0x90ea('0x100')](_0x641799[_0x90ea('0xfe')]);try{fs[_0x90ea('0x101')](_0x641799['audiofile']+_0x90ea('0x102'));}catch(_0x5d4602){logger[_0x90ea('0x2c')](_0x5d4602);}return _0x5bc194;}else{return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x103'),_0x641799[_0x90ea('0xe7')]));}}return this['channel'][_0x90ea('0x2c')](_0x53c32e,_0x90ea('0x104'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x105')]=function(_0x3ea772){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x106'),_0x3ea772[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x105'));};AGIVertices['prototype'][_0x90ea('0x107')]=function(_0x3e1304){logger[_0x90ea('0x30')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3e1304['label']));var _0x2cb528='';if(_0x3e1304[_0x90ea('0x108')]){if(!this[_0x90ea('0x85')](_0x3e1304['trunk_id'])){return this['channel']['error'](_0x3e1304,_0x90ea('0x109'));}else{var _0x2a2b3d=parseInt(_0x3e1304[_0x90ea('0x108')],0xa);if(isNaN(_0x2a2b3d)){_0x2cb528=_0x3e1304[_0x90ea('0x108')];}else{_0x2cb528=this[_0x90ea('0x1f')]['sync'](this,_0x3e1304[_0x90ea('0x108')]);if(!_0x2cb528){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3e1304,_0x90ea('0x10a'));}}}}else if(_0x3e1304[_0x90ea('0x10b')]){_0x2cb528=_0x3e1304[_0x90ea('0x10b')];}else{return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3e1304,_0x90ea('0x109'));}var _0x5647f4=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0xe2'),[util['format'](_0x90ea('0x10c'),_0x2cb528,_0x3e1304[_0x90ea('0x44')]),_0x3e1304[_0x90ea('0x63')],_0x3e1304[_0x90ea('0xe1')],_0x3e1304[_0x90ea('0x61')]]);if(_0x5647f4[_0x90ea('0xaa')]===-0x1){return _0x5647f4;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x10d'),_0x90ea('0xe2')));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x10e')]=function(_0x173ddb){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x173ddb[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x10e'));};AGIVertices['prototype']['getdigits']=function(_0x540f5e){logger['info'](util['format'](_0x90ea('0x10f'),_0x540f5e[_0x90ea('0xad')]));if(_0x540f5e[_0x90ea('0xa4')]===0x0){return this[_0x90ea('0x110')](_0x540f5e);}_0x540f5e[_0x90ea('0xa4')]-=0x1;if(!this[_0x90ea('0x85')](_0x540f5e['file_id'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x540f5e,_0x90ea('0x111'));}var _0x211a47=this[_0x90ea('0x112')][_0x90ea('0x6d')](this,_0x540f5e[_0x90ea('0x113')]);if(!_0x211a47){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x540f5e,_0x90ea('0x114'));}if(!this[_0x90ea('0x85')](_0x540f5e[_0x90ea('0xda')])){return this['channel'][_0x90ea('0x2c')](_0x90ea('0x115'));}var _0x2a2240=this[_0x90ea('0xe')][_0x90ea('0x116')](_0x211a47,_0x540f5e[_0x90ea('0x117')],_0x540f5e[_0x90ea('0x118')]);var _0x26f318=_0x2a2240['result']?_0x2a2240[_0x90ea('0xaa')]['toString']():'';logger[_0x90ea('0x30')](_0x90ea('0x119'),JSON['stringify'](_0x2a2240));if(_0x2a2240[_0x90ea('0xaa')]===-0x1){this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x540f5e,_0x26f318);return _0x2a2240;}else if(_0x2a2240['extra']==='timeout'){_0x2a2240[_0x90ea('0xaa')]=_0x26f318['length']>=parseInt(_0x540f5e[_0x90ea('0x11a')])?'x':'i';}else{_0x2a2240[_0x90ea('0xaa')]=_0x26f318['length']>=parseInt(_0x540f5e['mindigit'])&&_0x26f318[_0x90ea('0x9b')]<=parseInt(_0x540f5e['maxdigit'])?'x':'i';}var _0x270f3d=this[_0x90ea('0x12')]['sync'](this,_0x540f5e[_0x90ea('0xda')]);if(!_0x270f3d){return this['channel'][_0x90ea('0x2c')](_0x540f5e,_0x90ea('0x11b'));}this['channel'][_0x90ea('0x9f')](_0x270f3d,_0x26f318);if(this['isConfigured'](_0x540f5e[_0x90ea('0x11c')])){var _0x3f3ee3=parseInt(_0x540f5e['hiddendigitsnum'],0xa);var _0x370a39=rs[_0x90ea('0x11d')]({'charset':'*','length':_0x3f3ee3});var _0x54a3f4=_0x26f318[_0x90ea('0x9b')];if(_0x54a3f4>0x0){if(_0x54a3f4>_0x3f3ee3){this['createSquareDetailsReport']['sync'](this,_0x540f5e,_0x540f5e[_0x90ea('0x11e')]==='first'?_0x370a39+_0x26f318[_0x90ea('0x11f')](_0x3f3ee3):_0x26f318[_0x90ea('0x11f')](0x0,_0x54a3f4-_0x3f3ee3)+_0x370a39);}else{this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x540f5e,rs[_0x90ea('0x11d')]({'charset':'*','length':_0x54a3f4}));}}else{this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x540f5e,'');}}else{this[_0x90ea('0x36')]['sync'](this,_0x540f5e,_0x26f318);}return _0x2a2240;};AGIVertices['prototype'][_0x90ea('0xd')]=function(_0x360f03){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x120'),_0x360f03[_0x90ea('0xad')]));return this[_0x90ea('0xc')](_0x360f03);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x121')]=function(_0x51e13c){logger[_0x90ea('0x30')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x51e13c[_0x90ea('0xad')]));this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x51e13c,_0x51e13c[_0x90ea('0x122')]);return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x123'),_0x51e13c['goalname']));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x124')]=function(_0x32563e){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x125'),_0x32563e[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x32563e[_0x90ea('0x88')])||!this[_0x90ea('0x85')](_0x32563e['aws_secret_access_key'])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0x126'));}if(!this['isConfigured'](_0x32563e[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x127'),_0x32563e['text']));var _0x33e732=this[_0x90ea('0x87')][_0x90ea('0x6d')](this,_0x32563e);if(_0x33e732){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x128'),_0x33e732));var _0xf81dac=this[_0x90ea('0xe')][_0x90ea('0x100')](_0x33e732);try{fs[_0x90ea('0x101')](_0x33e732+'.wav');}catch(_0x9844cb){logger[_0x90ea('0x2c')](_0x9844cb);}return _0xf81dac;}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x32563e,_0x90ea('0x129'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x12a')]=function(_0x404467){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x12b'),_0x404467[_0x90ea('0xad')]));if(!this['isConfigured'](_0x404467[_0x90ea('0x88')])||!this[_0x90ea('0x85')](_0x404467['aws_secret_access_key'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x126'));}if(!this['isConfigured'](_0x404467['aws_bot_name'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20bot\x20name\x20configured');}if(!this[_0x90ea('0x85')](_0x404467[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')]('no\x20text\x20configured');}this['channel'][_0x90ea('0xe5')]=!![];this[_0x90ea('0x36')](_0x404467);this[_0x90ea('0x3e')](_0x404467[_0x90ea('0x5c')],'in','','');this['channel']['noop'](util[_0x90ea('0x29')](_0x90ea('0x12c'),_0x404467[_0x90ea('0x5c')]));var _0x213ba4=this[_0x90ea('0x8e')][_0x90ea('0x6d')](this,_0x404467);if(_0x213ba4){for(var _0x276925 in _0x213ba4){if(_0x213ba4['hasOwnProperty'](_0x276925)&&_['isString'](_0x213ba4[_0x276925])){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0x12d'),_0x276925[_0x90ea('0xf1')]()),_0x213ba4[_0x276925]);}}if(_[_0x90ea('0x4e')](_0x213ba4[_0x90ea('0x74')])){return this['channel'][_0x90ea('0xa7')](_0x90ea('0x12e'));}else{this['createSquareMessage'](_0x213ba4[_0x90ea('0x74')],'out',_0x90ea('0x12f'),'');return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x130'),_0x213ba4[_0x90ea('0x74')]));}}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x404467,_0x90ea('0x131'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x132')]=function(_0x56321e){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x133'),_0x56321e[_0x90ea('0xad')],_0x56321e[_0x90ea('0x63')]));if(!this['isConfigured'](_0x56321e['key'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x134'));}var _0x3a1bba=_0x90ea('0x135');var _0x4c6ecd=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,rs['generate'](0x4));var _0x5a4a49=util['format'](_0x90ea('0x9e'),_0x4c6ecd,_0x3a1bba);var _0x34eae6=!![];if(_0x56321e[_0x90ea('0x137')]===_0x90ea('0x138')){_0x34eae6=![];}var _0x4051c9=this[_0x90ea('0xe')][_0x90ea('0x139')](_0x4c6ecd,_0x3a1bba,_0x56321e[_0x90ea('0x13a')],_0x56321e['timeout'],undefined,_0x34eae6);if(_0x4051c9[_0x90ea('0xaa')]!==-0x1){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x13b'),_0x5a4a49));var _0x4ea617=this[_0x90ea('0x91')][_0x90ea('0x6d')](this,_0x56321e,_0x5a4a49);if(_0x4ea617){for(var _0x167327 in _0x4ea617){if(_0x4ea617[_0x90ea('0x95')](_0x167327)){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')](_0x90ea('0x13c'),_0x167327[_0x90ea('0xf1')]()),_0x4ea617[_0x167327]);}}return this['channel']['noop'](util[_0x90ea('0x29')](_0x90ea('0x13d'),JSON[_0x90ea('0x70')](_0x4ea617)));}}return _0x4051c9;};AGIVertices[_0x90ea('0x11')][_0x90ea('0x13e')]=function(_0x1f1e18){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x13f'),_0x1f1e18[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x1f1e18[_0x90ea('0x93')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x140'));}if(!this['isConfigured'](_0x1f1e18['appsecret'])){return this['channel'][_0x90ea('0xa7')](_0x90ea('0x141'));}var _0xa0832f=_0x90ea('0x135');var _0x48bf69=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,rs[_0x90ea('0x11d')](0x4));var _0x260942=util[_0x90ea('0x29')](_0x90ea('0x9e'),_0x48bf69,_0xa0832f);var _0xa019da=!![];if(_0x1f1e18[_0x90ea('0x137')]==='NOBEEP'){_0xa019da=![];}var _0x28fcd0=this[_0x90ea('0xe')][_0x90ea('0x139')](_0x48bf69,_0xa0832f,_0x1f1e18[_0x90ea('0x13a')],_0x1f1e18[_0x90ea('0x63')],undefined,_0xa019da);if(_0x28fcd0['result']!==-0x1){this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0x142'),_0x260942));var _0xc4d9c2=this[_0x90ea('0x92')]['sync'](this,_0x1f1e18,_0x260942);if(_0xc4d9c2){for(var _0x237b20 in _0xc4d9c2){if(_0xc4d9c2[_0x90ea('0x95')](_0x237b20)){this[_0x90ea('0xe')][_0x90ea('0x9f')](util[_0x90ea('0x29')]('TILDE_ASR_%s',_0x237b20[_0x90ea('0xf1')]()),_0xc4d9c2[_0x237b20]);}}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x143'),JSON[_0x90ea('0x70')](_0xc4d9c2)));}}return _0x28fcd0;};AGIVertices[_0x90ea('0x11')]['gotoc']=function(_0x400a18){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x144'),_0x400a18[_0x90ea('0xad')]));return this[_0x90ea('0xe')]['continueAt'](_0x400a18[_0x90ea('0x3b')],_0x400a18['extension'],_0x400a18[_0x90ea('0x3c')]);};AGIVertices[_0x90ea('0x11')]['gotoif']=function(_0x4deb9a){logger['info'](util['format'](_0x90ea('0x145'),_0x4deb9a[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4deb9a['condition'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x4deb9a,'no\x20condition\x20configured');}try{var _0x41c71a=eval(_0x4deb9a[_0x90ea('0x146')])?'true':_0x90ea('0x147');this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x148'),_0x4deb9a[_0x90ea('0x146')],_0x41c71a));return{'code':0xc8,'result':_0x41c71a};}catch(_0x46f6f1){return{'code':0xc8,'result':_0x90ea('0x147')};}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x149')]=function(_0x3b81ce){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x14a'),_0x3b81ce[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x3b81ce[_0x90ea('0x14b')])){return this['channel'][_0x90ea('0x2c')](_0x3b81ce,_0x90ea('0x14c'));}var _0x1be00a=this[_0x90ea('0x26')][_0x90ea('0x6d')](this,_0x3b81ce['interval_id']);if(!_0x1be00a){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3b81ce,_0x90ea('0x14d'));}for(var _0x3e74e1=0x0;_0x3e74e1<_0x1be00a['length'];_0x3e74e1+=0x1){var _0xeeb762=this[_0x90ea('0xe')][_0x90ea('0x12')](util[_0x90ea('0x29')](_0x90ea('0x14e'),_0x1be00a[_0x3e74e1]));if(_0xeeb762[_0x90ea('0xaa')]===-0x1){return _0xeeb762;}logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x14f'),_0x1be00a[_0x3e74e1],_0xeeb762[_0x90ea('0xa1')]));if(_0xeeb762[_0x90ea('0xa1')]===_0x90ea('0x150')){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x14f'),_0x1be00a[_0x3e74e1],_0x90ea('0x150')));this['channel'][_0x90ea('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x1be00a[_0x3e74e1],_0x90ea('0x150')));return{'code':0xc8,'result':_0x90ea('0x150')};}else{logger[_0x90ea('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x1be00a[_0x3e74e1],_0x90ea('0x147')));this['channel']['noop'](util['format'](_0x90ea('0x14f'),_0x1be00a[_0x3e74e1],_0x90ea('0x147')));}}return{'code':0xc8,'result':_0x90ea('0x147')};};AGIVertices[_0x90ea('0x11')][_0x90ea('0x151')]=function(_0x2819f4){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x152'),_0x2819f4['label']));return this['channel'][_0x90ea('0x151')]();};AGIVertices['prototype'][_0x90ea('0x153')]=function(_0x3706e6){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x154'),_0x3706e6[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x3706e6[_0x90ea('0x78')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x134'));}var _0x2017b4='wav';var _0x33da71=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,rs[_0x90ea('0x11d')](0x4));var _0x3e0366=util['format'](_0x90ea('0x9e'),_0x33da71,_0x2017b4);var _0x2e37c8=!![];if(_0x3706e6[_0x90ea('0x137')]===_0x90ea('0x138')){_0x2e37c8=![];}var _0xb75e53=this['channel'][_0x90ea('0x139')](_0x33da71,_0x2017b4,_0x3706e6[_0x90ea('0x13a')],_0x3706e6[_0x90ea('0x63')],undefined,_0x2e37c8);if(_0xb75e53['result']!==-0x1){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x155'),_0x3e0366));var _0x5aad80=this[_0x90ea('0x83')][_0x90ea('0x6d')](this,_0x3706e6,_0x3e0366);if(_0x5aad80){for(var _0x5721dc in _0x5aad80){if(_0x5aad80[_0x90ea('0x95')](_0x5721dc)){this[_0x90ea('0xe')]['setVariable'](util['format'](_0x90ea('0x156'),_0x5721dc[_0x90ea('0xf1')]()),_0x5aad80[_0x5721dc]);}}return this[_0x90ea('0xe')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x5aad80)));}}return _0xb75e53;};AGIVertices[_0x90ea('0x11')][_0x90ea('0x157')]=function(_0x7363f1){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x158'),_0x7363f1['label']));if(!this[_0x90ea('0x85')](_0x7363f1[_0x90ea('0x78')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x134'));}if(!this['isConfigured'](_0x7363f1[_0x90ea('0x5c')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x159'),_0x7363f1[_0x90ea('0x5c')]));var _0x53491a=this[_0x90ea('0x80')]['sync'](this,_0x7363f1);if(_0x53491a){this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x155'),_0x53491a));var _0x5bef0c=this[_0x90ea('0xe')][_0x90ea('0x100')](_0x53491a,_0x7363f1[_0x90ea('0x13a')]);try{fs[_0x90ea('0x101')](_0x53491a+_0x90ea('0x102'));}catch(_0x3b2f47){logger['error'](_0x3b2f47);}return _0x5bef0c;}return this[_0x90ea('0xe')]['error'](_0x7363f1,_0x90ea('0x15a'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x15b')]=function(_0x29af91){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x15c'),_0x29af91['label']));if(!this[_0x90ea('0x85')](_0x29af91[_0x90ea('0x15d')])){return this['channel'][_0x90ea('0x2c')](_0x29af91,_0x90ea('0x15e'));}logger['info'](util[_0x90ea('0x29')](_0x90ea('0x15f'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x29af91[_0x90ea('0x15d')]));var _0x5c7e7c=this[_0x90ea('0x51')][_0x90ea('0x6d')](this,_0x29af91['findBy']);if(_0x5c7e7c){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x160'),this[_0x90ea('0xe')]['callerid'],_0x29af91['findBy']));this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x160'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x29af91['findBy']));return{'code':0xc8,'result':_0x90ea('0x161')};}else{logger[_0x90ea('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x90ea('0xe')]['callerid'],_0x29af91[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x90ea('0xe')][_0x90ea('0x39')],_0x29af91[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x162')};}};AGIVertices[_0x90ea('0x11')]['logout']=function(_0x245ebe){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x163'),_0x245ebe[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x245ebe[_0x90ea('0x15d')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x245ebe,_0x90ea('0x15e'));}logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x15f'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x245ebe[_0x90ea('0x15d')]));var _0x54a22a=this['agentLogout'][_0x90ea('0x6d')](this,_0x245ebe['findBy']);if(_0x54a22a){logger['info'](util['format'](_0x90ea('0x160'),this['channel'][_0x90ea('0x39')],_0x245ebe[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x90ea('0x39')],_0x245ebe[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x161')};}else{logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x164'),this['channel']['callerid'],_0x245ebe[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0x164'),this[_0x90ea('0xe')]['callerid'],_0x245ebe[_0x90ea('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x55aecc){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x165'),_0x55aecc[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x55aecc[_0x90ea('0x166')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x55aecc,_0x90ea('0x167'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x168'),_0x55aecc['operation']));var _0x597c47=eval(_0x55aecc[_0x90ea('0x166')]);if(!this['isConfigured'](_0x55aecc['variable_id'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x115'));}var _0x4c1aa5=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x55aecc['variable_id']);if(!_0x4c1aa5){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x55aecc,_0x90ea('0x11b'));}if(_[_0x90ea('0x9a')](_0x597c47)){var _0x167eca=this;_0x597c47[_0x90ea('0xdb')](function(_0x372193,_0x3578ca){_0x167eca[_0x90ea('0xe')]['setVariable'](util[_0x90ea('0x29')](_0x90ea('0x169'),_0x4c1aa5,_0x3578ca),_0x372193);});return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('variable\x20%s[key]\x20set',_0x4c1aa5));}else{return this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x4c1aa5,_0x597c47);}};AGIVertices['prototype'][_0x90ea('0xb')]=function(_0x1c3787){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x16a'),_0x1c3787[_0x90ea('0xad')]));if(_0x1c3787[_0x90ea('0xa4')]===0x0){return this[_0x90ea('0x110')](_0x1c3787);}_0x1c3787[_0x90ea('0xa4')]-=0x1;if(!this[_0x90ea('0x85')](_0x1c3787[_0x90ea('0x113')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x1c3787,'no\x20file\x20audio\x20selected');}var _0x22e71e=this[_0x90ea('0x112')]['sync'](this,_0x1c3787[_0x90ea('0x113')]);if(!_0x22e71e){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x1c3787,'no\x20file\x20audio\x20found');}var _0x11ed9b=this[_0x90ea('0xe')][_0x90ea('0x116')](_0x22e71e,_0x1c3787['response'],_0x1c3787[_0x90ea('0x16b')]);var _0x2566fa=_0x11ed9b['result'];if(_0x11ed9b[_0x90ea('0xaa')]===-0x1){this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x1c3787,'-1');return _0x11ed9b;}else if(_0x11ed9b[_0x90ea('0xa1')]===_0x90ea('0x63')){_0x11ed9b['result']=_0x11ed9b[_0x90ea('0xaa')]['length']>0x0?_0x11ed9b['result']:'t';}else if(_[_0x90ea('0x40')](_0x11ed9b[_0x90ea('0xaa')])){_0x11ed9b['result']='#';_0x2566fa='#';}if(!this['isConfigured'](_0x1c3787['variable_id'])){this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x115'));}else{var _0x4b8296=this[_0x90ea('0x12')]['sync'](this,_0x1c3787['variable_id']);if(!_0x4b8296){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x1c3787,_0x90ea('0x11b'));}this['channel']['setVariable'](_0x4b8296,_0x2566fa);}this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x1c3787,_0x2566fa);return _0x11ed9b;};AGIVertices[_0x90ea('0x11')][_0x90ea('0xa7')]=function(_0x1fe05c){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x16c'),_0x1fe05c[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x1fe05c[_0x90ea('0x16d')]||_0x1fe05c[_0x90ea('0xad')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x16e')]=function(_0x46f785){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x16f'),_0x46f785['label']));if(!this[_0x90ea('0x85')](_0x46f785[_0x90ea('0x15d')])){return this['channel'][_0x90ea('0x2c')](_0x46f785,_0x90ea('0x15e'));}logger[_0x90ea('0x30')](util['format'](_0x90ea('0x15f'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));var _0xc5ca80=this[_0x90ea('0x170')][_0x90ea('0x6d')](this,_0x46f785[_0x90ea('0x171')]);var _0x4a114e=this['agentPause'][_0x90ea('0x6d')](this,_0x46f785[_0x90ea('0x15d')],_0xc5ca80);if(_0x4a114e){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x160'),this['channel'][_0x90ea('0x39')],_0x46f785['findBy']));this['channel'][_0x90ea('0xa7')](util['format'](_0x90ea('0x160'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x161')};}else{logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x164'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x90ea('0x39')],_0x46f785[_0x90ea('0x15d')]));return{'code':0xc8,'result':_0x90ea('0x162')};}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x172')]=function(_0x344e0a){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x173'),_0x344e0a[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x344e0a[_0x90ea('0x113')])){return this['channel'][_0x90ea('0x2c')](_0x344e0a,_0x90ea('0x111'));}var _0x242a78=this['getSound'][_0x90ea('0x6d')](this,_0x344e0a[_0x90ea('0x113')]);if(!_0x242a78){return this[_0x90ea('0xe')]['error'](_0x344e0a,_0x90ea('0x114'));}var _0x514ea4=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0x174'),[_0x242a78,_0x344e0a['opts']]);if(_0x514ea4[_0x90ea('0xaa')]===-0x1){return _0x514ea4;}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x242a78));};AGIVertices['prototype'][_0x90ea('0x175')]=function(_0x77e0da){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x176'),_0x77e0da[_0x90ea('0xad')]));if(!this['isConfigured'](_0x77e0da[_0x90ea('0x177')])){return this['channel'][_0x90ea('0x2c')](_0x77e0da,_0x90ea('0x178'));}var _0x4bf572='';var _0xe6b784=parseInt(_0x77e0da[_0x90ea('0x177')],0xa);if(isNaN(_0xe6b784)){_0x4bf572=_0x77e0da[_0x90ea('0x177')];}else{_0x4bf572=this[_0x90ea('0x16')][_0x90ea('0x6d')](this,_0x77e0da['queue_id']);if(!_0x4bf572){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x77e0da,'no\x20queue\x20found');}}var _0x1784bd='';if(this[_0x90ea('0x85')](_0x77e0da[_0x90ea('0x113')])){var _0x34d847=this[_0x90ea('0x112')][_0x90ea('0x6d')](this,_0x77e0da[_0x90ea('0x113')]);if(_0x34d847){_0x1784bd=_0x34d847;}}this[_0x90ea('0x36')]['sync'](this,_0x77e0da,_0x4bf572);if(_0x77e0da[_0x90ea('0xe1')]['indexOf']('x')<0x0){_0x77e0da['opts']+='x';}if(_0x77e0da[_0x90ea('0xe1')][_0x90ea('0x179')]('X')<0x0){_0x77e0da[_0x90ea('0xe1')]+='X';}this[_0x90ea('0xe')][_0x90ea('0x9f')]('XMCS-QUEUE',_0x4bf572?_0x4bf572[_0x90ea('0x17a')]():'');var _0x72a6fb=this[_0x90ea('0xe')]['exec'](_0x90ea('0x17b'),[_0x4bf572,_0x77e0da['opts'],_0x77e0da[_0x90ea('0x61')],_0x1784bd,_0x77e0da['timeout'],_0x77e0da['agi'],_0x77e0da['macro'],_0x77e0da[_0x90ea('0x17c')],'',_0x77e0da[_0x90ea('0x17d')]]);if(_0x72a6fb[_0x90ea('0xaa')]===-0x1){return _0x72a6fb;}return this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x17e'),_0x90ea('0x17b'),_0x4bf572));};AGIVertices['prototype'][_0x90ea('0x17f')]=function(_0xefa567){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x180'),_0xefa567[_0x90ea('0xad')]));var _0x30e73b=_0xefa567[_0x90ea('0x181')]||_0x90ea('0x135');var _0x1ec3a3=util['format'](_0x90ea('0x182'),this[_0x90ea('0xe')][_0x90ea('0x46')],rs[_0x90ea('0x11d')](0x5));var _0x18ae3e=util['format'](_0x90ea('0x183'),FILES_PATH,_0x1ec3a3,_0x30e73b);var _0x5854d6=util[_0x90ea('0x29')](_0x90ea('0x136'),FILES_PATH,_0x1ec3a3);this[_0x90ea('0x3a')][_0x90ea('0x6d')](this,_0xefa567,_0x1ec3a3,_0x18ae3e);this['channel'][_0x90ea('0x9f')](_0x90ea('0x184'),_0x1ec3a3);logger[_0x90ea('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5854d6,_0x30e73b,_0xefa567[_0x90ea('0x185')],_0xefa567[_0x90ea('0x63')]);return this['channel'][_0x90ea('0x139')](_0x5854d6,_0x30e73b,_0xefa567[_0x90ea('0x185')],_0xefa567['timeout'],undefined,!![]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x186')]=function(_0x3cff0d){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x187'),_0x3cff0d[_0x90ea('0xad')]));if(!this['isConfigured'](_0x3cff0d[_0x90ea('0x61')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x188'));}var _0xbc4e05=this[_0x90ea('0x189')][_0x90ea('0x6d')](this,_0x3cff0d);logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x18a'),util['inspect'](_0xbc4e05,{'showHidden':![],'depth':null})));if(!this[_0x90ea('0x85')](_0x3cff0d[_0x90ea('0xda')])){return this['channel'][_0x90ea('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1ad1c6=this[_0x90ea('0x12')]['sync'](this,_0x3cff0d[_0x90ea('0xda')]);if(!_0x1ad1c6){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x3cff0d,'no\x20variable\x20found');}this['channel'][_0x90ea('0x9f')](util[_0x90ea('0x29')]('%s_STATUS_CODE',_0x1ad1c6),_0xbc4e05[_0x90ea('0x72')]?_0xbc4e05[_0x90ea('0x72')]:_0x90ea('0x18b'));this[_0x90ea('0xe')]['setVariable'](util['format']('%s_STATUS_MESSAGE',_0x1ad1c6),_0xbc4e05['statusMessage']?_0xbc4e05[_0x90ea('0x73')]:'OK');if(_0xbc4e05[_0x90ea('0x67')]){try{this[_0x90ea('0x9d')](_0xbc4e05[_0x90ea('0x67')],_0x1ad1c6);}catch(_0x522743){logger[_0x90ea('0x2c')](util[_0x90ea('0x29')](_0x90ea('0x18c'),_0x1ad1c6));}}return this[_0x90ea('0xe')][_0x90ea('0xa7')](util['format'](_0x90ea('0xdd'),_0x1ad1c6));};AGIVertices[_0x90ea('0x11')]['saydigits']=function(_0x4f34c2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x18d'),_0x4f34c2['label']));return this[_0x90ea('0xe')]['sayDigits'](_0x4f34c2[_0x90ea('0x18e')]['replace'](/\s+/g,''),_0x4f34c2[_0x90ea('0x185')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x18f')]=function(_0x36d51f){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x190'),_0x36d51f[_0x90ea('0xad')]));return this[_0x90ea('0xe')][_0x90ea('0x191')](_0x36d51f[_0x90ea('0x192')][_0x90ea('0x58')](/\s+/g,''),_0x36d51f['escape_digits']);};AGIVertices[_0x90ea('0x11')]['sayphonetic']=function(_0x178619){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x193'),_0x178619[_0x90ea('0xad')]));return this['channel']['sayPhonetic'](_0x178619['text'],_0x178619[_0x90ea('0x185')]);};AGIVertices[_0x90ea('0x11')][_0x90ea('0x194')]=function(_0x4fbc9c){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x195'),_0x4fbc9c[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4fbc9c[_0x90ea('0x196')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x197'));}var _0x435fa6=this[_0x90ea('0x23')][_0x90ea('0x6d')](this,_0x4fbc9c['account_id']);if(!_0x435fa6||!_0x435fa6['Smtp']){return this['channel'][_0x90ea('0x2c')](_0x4fbc9c,_0x90ea('0x198'));}var _0x2fd03c={'from':util[_0x90ea('0x29')](_0x90ea('0x199'),_0x435fa6['name'],_0x435fa6[_0x90ea('0x19a')]||_0x435fa6[_0x90ea('0x19b')]['user']),'to':_0x4fbc9c['to']||'','cc':_0x4fbc9c['cc']||'','bcc':_0x4fbc9c['bcc']||'','subject':_0x4fbc9c['subject'],'html':_0x4fbc9c[_0x90ea('0x5c')],'text':_0x4fbc9c[_0x90ea('0x5c')]};var _0x20b7f8={'tls':{'rejectUnauthorized':![]}};if(_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x19c')]){_0x20b7f8[_0x90ea('0x19c')]=_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x19c')];}else{_0x20b7f8[_0x90ea('0x19d')]=_0x435fa6[_0x90ea('0x19b')]['host'];_0x20b7f8[_0x90ea('0x19e')]=_0x435fa6[_0x90ea('0x19b')]['port'];_0x20b7f8['secure']=_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x19f')];}if(_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x1a0')]){_0x20b7f8[_0x90ea('0x1a1')]={'user':_0x435fa6[_0x90ea('0x19b')][_0x90ea('0x1a2')],'pass':_0x435fa6[_0x90ea('0x19b')]['pass']};}if(this[_0x90ea('0x85')](_0x4fbc9c[_0x90ea('0x1a3')])){}logger['debug'](_0x90ea('0x1a4'),JSON[_0x90ea('0x70')](_0x2fd03c));this[_0x90ea('0x36')]['sync'](this,_0x4fbc9c,_0x4fbc9c['account_id']);this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1a5'),_0x435fa6[_0x90ea('0x14')]));this[_0x90ea('0x25')][_0x90ea('0x6d')](this,_0x20b7f8,_0x2fd03c);return this[_0x90ea('0xe')]['noop'](_0x90ea('0x1a6'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1a7')]=function(_0x2cca6d){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2cca6d[_0x90ea('0xad')]));return this['channel'][_0x90ea('0xa7')](_0x90ea('0x1a8'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1a9')]=function(_0x44d7c1){logger['info'](util[_0x90ea('0x29')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x44d7c1[_0x90ea('0xad')]));if(!this['isConfigured'](_0x44d7c1[_0x90ea('0x1aa')])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x1ab'));}var _0x5e8322=this[_0x90ea('0x33')][_0x90ea('0x6d')](this,_0x44d7c1[_0x90ea('0x1aa')]);if(!_0x5e8322){return this['channel'][_0x90ea('0x2c')](_0x44d7c1,_0x90ea('0x1ac'));}var _0x4e6447={'body':_0x44d7c1[_0x90ea('0x1ad')],'phone':_0x44d7c1['to']||'','SmsAccountId':_0x5e8322['id']};logger[_0x90ea('0xde')](_0x90ea('0x1ae'),JSON['stringify'](_0x4e6447));this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x44d7c1,_0x44d7c1['sms_account_id']);this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5e8322[_0x90ea('0x14')]));this[_0x90ea('0x35')]['sync'](this,_0x4e6447);return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0x1af'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1b0')]=function(_0x466e45){logger['info'](util['format'](_0x90ea('0x1b1'),_0x466e45[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x466e45['variable_id'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x466e45,'no\x20variable\x20selected');}var _0x21fe5d=this['getVariable']['sync'](this,_0x466e45[_0x90ea('0xda')]);if(!_0x21fe5d){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x466e45,_0x90ea('0x11b'));}return this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x21fe5d,_0x466e45['variable_value']);};AGIVertices['prototype'][_0x90ea('0x1b2')]=function(_0x2851b7){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x1b3'),_0x2851b7[_0x90ea('0xad')]));this['channel'][_0x90ea('0xa7')](_0x90ea('0x1b4'));if(_0x2851b7[_0x90ea('0xb8')]===_0x90ea('0x1b5')){this[_0x90ea('0xe')]['noop'](_0x90ea('0x1b6'));return this[_0x90ea('0xe')][_0x90ea('0xb8')]();}return this['channel'][_0x90ea('0xa7')](_0x90ea('0x1b7'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1b8')]=function(_0x4d87a8){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x1b9'),_0x4d87a8[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x4d87a8['project_id'])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x4d87a8,_0x90ea('0x1ba'));}var _0x4666d0=this[_0x90ea('0x19')]['sync'](this,_0x4d87a8[_0x90ea('0x1bb')]);if(!this[_0x90ea('0x85')](_0x4666d0)){return this[_0x90ea('0xe')]['error'](_0x4d87a8,util[_0x90ea('0x29')](_0x90ea('0x1bc'),_0x4d87a8['project_id']));}if(_0x4666d0===this[_0x90ea('0xe')][_0x90ea('0x38')]){return this['channel'][_0x90ea('0x2c')](_0x4d87a8,_0x90ea('0x1bd'));}this[_0x90ea('0x36')][_0x90ea('0x6d')](this,_0x4d87a8,_0x4666d0);var _0x2947c4=this[_0x90ea('0xe')][_0x90ea('0x56')](_0x90ea('0x1be'),util['format'](_0x90ea('0x1bf'),config[_0x90ea('0x7')][_0x90ea('0x19d')]||_0x90ea('0x1c0'),_0x4666d0,this[_0x90ea('0xe')][_0x90ea('0x38')]));if(_0x2947c4[_0x90ea('0xaa')]===-0x1){return _0x2947c4;}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')](_0x90ea('0x17e'),_0x90ea('0x1be'),_0x4666d0));};AGIVertices['prototype'][_0x90ea('0x1c1')]=function(_0x13fc63){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x13fc63[_0x90ea('0xad')]));var _0x199c6a=this[_0x90ea('0x55')]['sync'](this,_0x13fc63['command']);this['createSquareDetailsReport'][_0x90ea('0x6d')](this,_0x13fc63,_0x13fc63['command']);if(this[_0x90ea('0x85')](_0x13fc63[_0x90ea('0xda')])){var _0x1ef09f=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x13fc63[_0x90ea('0xda')]);if(_0x1ef09f){this[_0x90ea('0xe')][_0x90ea('0x9f')](_0x1ef09f,_0x199c6a);return this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1c2'),_0x13fc63[_0x90ea('0xb6')],_0x1ef09f));}}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x13fc63[_0x90ea('0xb6')]));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1c3')]=function(_0x32c04a){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x32c04a[_0x90ea('0xad')]));_0x32c04a[_0x90ea('0x5c')]=_0x32c04a['text'][_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x90ea('0x85')](_0x32c04a['apiKey'])){return this[_0x90ea('0xe')]['noop'](_0x90ea('0x1c4'));}if(!this['isConfigured'](_0x32c04a['text'])){return this[_0x90ea('0xe')][_0x90ea('0xa7')](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1c5'),_0x32c04a[_0x90ea('0x5c')]));var _0x3e1fec=this[_0x90ea('0x59')]['sync'](this,_0x32c04a);if(_0x3e1fec){this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')](_0x90ea('0x1c6'),_0x3e1fec));var _0x1064c2=this['channel'][_0x90ea('0x100')](_0x3e1fec);try{fs[_0x90ea('0x101')](_0x3e1fec+_0x90ea('0x102'));}catch(_0x3d71af){logger[_0x90ea('0x2c')](_0x3d71af);}return _0x1064c2;}return this[_0x90ea('0xe')]['error'](_0x32c04a,_0x90ea('0x1c7'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1c8')]=function(_0x33d7b2){logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x1c9'),_0x33d7b2[_0x90ea('0xad')]));_0x33d7b2[_0x90ea('0x5c')]=_0x33d7b2[_0x90ea('0x5c')][_0x90ea('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x33d7b2[_0x90ea('0x5c')])){return this['channel']['noop'](_0x90ea('0xa8'));}this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1ca'),_0x33d7b2[_0x90ea('0x5c')]));var _0x2a45d8=this[_0x90ea('0x60')]['sync'](this,_0x33d7b2);if(_0x2a45d8){this['channel'][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x1cb'),_0x2a45d8));var _0x54b930=this['channel'][_0x90ea('0x100')](_0x2a45d8);try{fs[_0x90ea('0x101')](_0x2a45d8+'.wav');}catch(_0x1d9cbb){logger['error'](_0x1d9cbb);}return _0x54b930;}return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x33d7b2,_0x90ea('0x1cc'));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1cd')]=function(_0x130b83){logger['info'](util[_0x90ea('0x29')](_0x90ea('0x1ce'),_0x130b83[_0x90ea('0xad')]));if(!this[_0x90ea('0x85')](_0x130b83[_0x90ea('0x15d')])){return this['channel'][_0x90ea('0x2c')](_0x130b83,_0x90ea('0x15e'));}logger['info'](util[_0x90ea('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x90ea('0xe')]['callerid'],_0x130b83[_0x90ea('0x15d')]));var _0x279ed6=this[_0x90ea('0x4f')][_0x90ea('0x6d')](this,_0x130b83[_0x90ea('0x15d')]);if(_0x279ed6){logger[_0x90ea('0x30')](util['format'](_0x90ea('0x160'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x130b83['findBy']));this['channel']['noop'](util[_0x90ea('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x90ea('0xe')]['callerid'],_0x130b83['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x90ea('0x30')](util[_0x90ea('0x29')](_0x90ea('0x164'),this[_0x90ea('0xe')][_0x90ea('0x39')],_0x130b83[_0x90ea('0x15d')]));this[_0x90ea('0xe')][_0x90ea('0xa7')](util[_0x90ea('0x29')](_0x90ea('0x164'),this['channel'][_0x90ea('0x39')],_0x130b83['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1cf')]=function(_0x58c57c){logger[_0x90ea('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x58c57c[_0x90ea('0xad')]));var _0x3ea77=this[_0x90ea('0xe')]['exec'](_0x90ea('0x1d0'),[_0x58c57c[_0x90ea('0x1d1')],_0x58c57c['options']]);if(_0x3ea77[_0x90ea('0xaa')]===-0x1){return _0x3ea77;}return this[_0x90ea('0xe')]['noop'](util[_0x90ea('0x29')](_0x90ea('0x17e'),_0x90ea('0x1d0'),_0x58c57c[_0x90ea('0x1d1')]));};AGIVertices[_0x90ea('0x11')][_0x90ea('0x1d2')]=function(_0x266514){logger[_0x90ea('0x30')](util[_0x90ea('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x266514[_0x90ea('0xad')]));if(!this['isConfigured'](_0x266514[_0x90ea('0xda')])){return this[_0x90ea('0xe')][_0x90ea('0x2c')](_0x266514,'no\x20variable\x20selected');}var _0x47711f=this[_0x90ea('0x12')][_0x90ea('0x6d')](this,_0x266514[_0x90ea('0xda')]);if(!_0x47711f){return this[_0x90ea('0xe')]['error'](_0x266514,_0x90ea('0x11b'));}var _0x2f5705=this[_0x90ea('0xe')][_0x90ea('0x12')](_0x47711f);return{'code':0xc8,'result':_0x2f5705[_0x90ea('0xa1')]?_0x2f5705['extra']:'-'};};String[_0x90ea('0x11')]['replaceAll']=function(_0x34b388,_0x28992e){return this['split'](_0x34b388)[_0x90ea('0x1d3')](_0x28992e);};module[_0x90ea('0x1d4')]=AGIVertices; \ No newline at end of file +var _0xdffd=['isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','agicommand','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','length','isString','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','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','.wav','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','no\x20bot\x20name\x20configured','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeechASR','ISPEECH_ASR_%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','intKey','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','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','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','path','util','lodash','shelljs','randomstring','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeech_asr_language'];(function(_0x49a2e6,_0x40ca47){var _0x473061=function(_0x2d4cfc){while(--_0x2d4cfc){_0x49a2e6['push'](_0x49a2e6['shift']());}};_0x473061(++_0x40ca47);}(_0xdffd,0x13f));var _0xddff=function(_0x293814,_0x50a678){_0x293814=_0x293814-0x0;var _0x3aab37=_0xdffd[_0x293814];return _0x3aab37;};'use strict';var fs=require('fs');var path=require(_0xddff('0x0'));var util=require(_0xddff('0x1'));var _=require(_0xddff('0x2'));var sh=require(_0xddff('0x3'));var odbc=require('odbc')();var rs=require(_0xddff('0x4'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0xddff('0x5'));var logger=require(_0xddff('0x6'))(_0xddff('0x7'));var config=require(_0xddff('0x8'));var scripts=require(_0xddff('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xddff('0xa')];var verticesWithRetry=[_0xddff('0xb'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x2db018,_0x1ec1aa,_0xdf210c){this[_0xddff('0xc')]=_0x2db018;this[_0xddff('0xd')]=_0x1ec1aa;this[_0xddff('0xe')]=_0xdf210c;};AGIVertices[_0xddff('0xf')][_0xddff('0x10')]=function(_0x20c2a7,_0xf2a3e){this[_0xddff('0xd')][_0xddff('0x11')](_0x20c2a7)[_0xddff('0x12')](function(_0x1c9943){_0xf2a3e(null,_0x1c9943?_0x1c9943[_0xddff('0x13')]:![]);})[_0xddff('0x14')](function(_0x1ab5d1){_0xf2a3e(_0x1ab5d1);});};AGIVertices[_0xddff('0xf')]['getVoiceQueue']=function(_0x6cb6a0,_0x3d92ed){this[_0xddff('0xd')][_0xddff('0x15')](_0x6cb6a0)['then'](function(_0x5b5eca){_0x3d92ed(null,_0x5b5eca?_0x5b5eca[_0xddff('0x13')]:![]);})[_0xddff('0x14')](function(_0x4e0682){_0x3d92ed(_0x4e0682);});};AGIVertices[_0xddff('0xf')][_0xddff('0x16')]=function(_0x20bd52,_0x2f7b7f){this['rpc'][_0xddff('0x17')](_0x20bd52)[_0xddff('0x12')](function(_0x4dea9e){_0x2f7b7f(null,_0x4dea9e?_0x4dea9e[_0xddff('0x13')]:![]);})[_0xddff('0x14')](function(_0xaf583f){_0x2f7b7f(_0xaf583f);});};AGIVertices[_0xddff('0xf')][_0xddff('0x18')]=function(_0x592289,_0xee47f){this[_0xddff('0xd')][_0xddff('0x19')](_0x592289)['then'](function(_0x1355d8){_0xee47f(null,_0x1355d8?_0x1355d8[_0xddff('0x1a')]:![]);})['catch'](function(_0x40f5b9){_0xee47f(_0x40f5b9);});};AGIVertices['prototype'][_0xddff('0x1b')]=function(_0x21f208,_0x37f800){this[_0xddff('0xd')][_0xddff('0x1c')](_0x21f208)['then'](function(_0x17a1e1){_0x37f800(null,_0x17a1e1?_0x17a1e1[_0xddff('0x13')]:![]);})['catch'](function(_0x242e4b){_0x37f800(_0x242e4b);});};AGIVertices[_0xddff('0xf')][_0xddff('0x1d')]=function(_0x4c3dfe,_0x1325e7){this[_0xddff('0xd')]['getTrunkById'](_0x4c3dfe)[_0xddff('0x12')](function(_0x5e80a0){_0x1325e7(null,_0x5e80a0?_0x5e80a0['name']:![]);})[_0xddff('0x14')](function(_0x51eb09){_0x1325e7(_0x51eb09);});};AGIVertices[_0xddff('0xf')][_0xddff('0x1e')]=function(_0x176dd6,_0x3d5f53){var _0x489c00=this;this[_0xddff('0xd')]['getSoundById'](_0x176dd6)[_0xddff('0x12')](function(_0x36a8f4){_0x3d5f53(null,_0x36a8f4?_0x489c00[_0xddff('0x1f')](_0x36a8f4[_0xddff('0x20')]):![]);})['catch'](function(_0x28a299){_0x3d5f53(_0x28a299);});};AGIVertices[_0xddff('0xf')]['getMailAccount']=function(_0x414459,_0x2e7ca5){this['rpc'][_0xddff('0x21')](_0x414459)[_0xddff('0x12')](function(_0x302913){_0x2e7ca5(null,_0x302913?_0x302913:![]);})[_0xddff('0x14')](function(_0x395af6){_0x2e7ca5(_0x395af6);});};AGIVertices[_0xddff('0xf')][_0xddff('0x22')]=function(_0x4b6955,_0x5a84a4,_0xc08ca4){this[_0xddff('0xe')]['sendMailMessage'](_0x4b6955,_0x5a84a4)[_0xddff('0x12')](function(){_0xc08ca4(null);})[_0xddff('0x14')](function(_0x304713){_0xc08ca4(_0x304713);});};AGIVertices[_0xddff('0xf')]['getIntervals']=function(_0x11d519,_0x2c14a2){this[_0xddff('0xd')][_0xddff('0x23')](_0x11d519)[_0xddff('0x12')](function(_0x64537c){if(_0x64537c){if(_0x64537c[_0xddff('0x24')]){_0x2c14a2(null,[_0x64537c[_0xddff('0x25')]]);}else{_0x2c14a2(null,_[_0xddff('0x26')](_0x64537c[_0xddff('0x27')],_0xddff('0x25')));}}else{_0x2c14a2(null,![]);}})[_0xddff('0x14')](function(_0x5874a9){_0x2c14a2(_0x5874a9);});};AGIVertices[_0xddff('0xf')][_0xddff('0x1f')]=function(_0xd72ca9){return util[_0xddff('0x28')](_0xddff('0x29'),FILES_PATH,_0xd72ca9);};AGIVertices[_0xddff('0xf')][_0xddff('0x2a')]=function(_0x6ea500,_0x77c3a4,_0x3c19af){odbc['open'](_0x6ea500,function(_0x201071){if(_0x201071){logger[_0xddff('0x2b')](_0xddff('0x2c'),_0x201071);_0x3c19af(_0x201071);}else{logger[_0xddff('0x2d')]('ODBC\x20connection\x20successfully');odbc[_0xddff('0x2e')](_0x77c3a4,function(_0x3c58dd,_0x5096ec){if(_0x3c58dd){logger[_0xddff('0x2d')](_0xddff('0x2f'),_0x77c3a4);_0x3c19af(_0x3c58dd);}else{logger[_0xddff('0x2d')](_0xddff('0x30'),_0x77c3a4);odbc[_0xddff('0x31')](function(_0x5c1d69){if(_0x5c1d69){logger[_0xddff('0x2b')](_0xddff('0x32'),_0x5c1d69);}_0x3c19af(null,_0x5096ec);});}});}});};AGIVertices[_0xddff('0xf')][_0xddff('0x33')]=function(_0x2fd659,_0x1a82ff){this[_0xddff('0xd')][_0xddff('0x34')](_0x2fd659)[_0xddff('0x12')](function(_0x3e4477){_0x1a82ff(null,_0x3e4477?_0x3e4477:![]);})[_0xddff('0x14')](function(_0x23b8e0){_0x1a82ff(_0x23b8e0);});};AGIVertices[_0xddff('0xf')]['createSmsMessage']=function(_0x1f07a8,_0x5edc5a){this[_0xddff('0xd')][_0xddff('0x35')](_0x1f07a8)[_0xddff('0x12')](function(_0x11475e){_0x5edc5a(null,_0x11475e);})['catch'](function(_0x13b3d8){_0x5edc5a(_0x13b3d8);});};AGIVertices[_0xddff('0xf')][_0xddff('0x36')]=function(_0x1e0776,_0x4c1e6c,_0x4a05d1){this[_0xddff('0xd')][_0xddff('0x36')]({'uniqueid':this['channel']['uniqueid'],'node':_0x1e0776[_0xddff('0x37')],'application':_0x1e0776['agicommand'],'data':_0x4c1e6c||null,'project_name':this[_0xddff('0xc')][_0xddff('0x38')],'callerid':this[_0xddff('0xc')][_0xddff('0x39')]})[_0xddff('0x12')](function(_0x159a69){if(_0x4a05d1){_0x4a05d1(null,_0x159a69);}})[_0xddff('0x14')](function(_0x16ce57){if(_0x4a05d1){_0x4a05d1(_0x16ce57);}});};AGIVertices[_0xddff('0xf')]['createSquareRecording']=function(_0x12596b,_0x1b5020,_0x40ec2d,_0x5b64db){this['rpc'][_0xddff('0x3a')]({'uniqueid':this[_0xddff('0xc')][_0xddff('0x3b')],'callerid':this['channel'][_0xddff('0x39')],'calleridname':this[_0xddff('0xc')][_0xddff('0x3c')],'context':this[_0xddff('0xc')]['context'],'extension':this[_0xddff('0xc')][_0xddff('0x3d')],'priority':this[_0xddff('0xc')][_0xddff('0x3e')],'accountcode':this[_0xddff('0xc')][_0xddff('0x3f')],'dnid':this[_0xddff('0xc')][_0xddff('0x40')],'projectName':this[_0xddff('0xc')][_0xddff('0x38')],'saveName':_0x1b5020,'filename':_0x12596b[_0xddff('0x41')]||_0x1b5020,'savePath':_0x40ec2d})['then'](function(_0xca3cc5){_0x5b64db(null,_0xca3cc5);})['catch'](function(_0x3945e0){_0x5b64db(_0x3945e0);});};AGIVertices[_0xddff('0xf')][_0xddff('0x42')]=function(_0x37f4c5,_0xe5d78b,_0x11d920,_0x5e3abe,_0x1a37e4){this[_0xddff('0xd')][_0xddff('0x42')]({'uniqueid':this[_0xddff('0xc')][_0xddff('0x3b')],'body':_0x37f4c5,'direction':_0xe5d78b,'providerName':_0x11d920,'providerResponse':_0x5e3abe})[_0xddff('0x12')](function(_0x134801){if(_0x1a37e4){_0x1a37e4(null,_0x134801);}})[_0xddff('0x14')](function(_0x7a7a4c){if(_0x1a37e4){_0x1a37e4(_0x7a7a4c);}});};AGIVertices[_0xddff('0xf')][_0xddff('0x43')]=function(_0x57fc34,_0x37676c){this[_0xddff('0xd')][_0xddff('0x43')]({'firstName':_['isEmpty'](_0x57fc34[_0xddff('0x13')])||_[_0xddff('0x44')](_0x57fc34['name'])?'callback_'+Math[_0xddff('0x45')]():_0x57fc34['name'],'lastName':_[_0xddff('0x46')](_0x57fc34[_0xddff('0x47')])||_[_0xddff('0x44')](_0x57fc34['lastName'])?null:_0x57fc34[_0xddff('0x47')],'phone':_0x57fc34[_0xddff('0x48')],'ListId':_0x57fc34[_0xddff('0x49')],'scheduledat':_0x57fc34[_0xddff('0x4a')],'callbackUniqueid':this[_0xddff('0xc')]['uniqueid'],'tags':_0xddff('0x4b'),'description':_0xddff('0x4c')+_0x57fc34[_0xddff('0x4a')][_0xddff('0x4d')](),'priority':_0x57fc34[_0xddff('0x4e')]})[_0xddff('0x12')](function(_0x279d99){_0x37676c(null,_0x279d99);})['catch'](function(_0x1d5ece){_0x37676c(_0x1d5ece);});};AGIVertices['prototype']['getPause']=function(_0x20daac,_0x20d497){this[_0xddff('0xd')][_0xddff('0x4f')](_0x20daac)['then'](function(_0x567f69){_0x20d497(null,_0x567f69?_0x567f69['name']:![]);})[_0xddff('0x14')](function(_0x2c08f6){_0x20d497(_0x2c08f6);});};AGIVertices[_0xddff('0xf')][_0xddff('0x50')]=function(_0xd356b6,_0x298f71,_0x19cfb3){var _0x2233c8={'role':_0xddff('0x51')};_0x2233c8[_0xd356b6]=this[_0xddff('0xc')][_0xddff('0x39')];this['rpc'][_0xddff('0x50')](_0x2233c8,_0x298f71,this[_0xddff('0xc')][_0xddff('0x3b')])[_0xddff('0x12')](function(_0x35cb7b){_0x19cfb3(null,_['isNil'](_0x35cb7b)?![]:!![]);})[_0xddff('0x14')](function(_0x532521){logger[_0xddff('0x2b')](_0x532521);_0x19cfb3(null,![]);});};AGIVertices['prototype'][_0xddff('0x52')]=function(_0x4fffec,_0x2bc999){var _0xff85ac={'role':'agent'};_0xff85ac[_0x4fffec]=this['channel'][_0xddff('0x39')];this[_0xddff('0xd')][_0xddff('0x52')](_0xff85ac)[_0xddff('0x12')](function(_0x14b3c0){_0x2bc999(null,_[_0xddff('0x44')](_0x14b3c0)?![]:!![]);})[_0xddff('0x14')](function(_0x3d59c9){logger[_0xddff('0x2b')](_0x3d59c9);_0x2bc999(null,![]);});};AGIVertices[_0xddff('0xf')][_0xddff('0x53')]=function(_0x23b4a9,_0x1532ed){var _0x4c4560={'role':'agent'};_0x4c4560[_0x23b4a9]=this[_0xddff('0xc')]['callerid'];this[_0xddff('0xd')][_0xddff('0x53')](_0x4c4560)['then'](function(_0x280de7){_0x1532ed(null,_[_0xddff('0x44')](_0x280de7)?![]:!![]);})[_0xddff('0x14')](function(_0x31c6dc){logger[_0xddff('0x2b')](_0x31c6dc);_0x1532ed(null,![]);});};AGIVertices[_0xddff('0xf')][_0xddff('0x54')]=function(_0x1aa73a,_0x39d5d8){var _0xee3a7c={'role':_0xddff('0x51')};_0xee3a7c[_0x1aa73a]=this[_0xddff('0xc')][_0xddff('0x39')];var _0x417ca0=_0x1aa73a!=_0xddff('0x55')?util[_0xddff('0x28')](_0xddff('0x56'),'LOCAL',this[_0xddff('0xc')][_0xddff('0x39')]):undefined;this[_0xddff('0xd')][_0xddff('0x54')](_0xee3a7c,_0x417ca0)['then'](function(_0xee6650){_0x39d5d8(null,_[_0xddff('0x44')](_0xee6650)?![]:!![]);})[_0xddff('0x14')](function(_0x41d617){logger[_0xddff('0x2b')](_0x41d617);_0x39d5d8(null,![]);});};AGIVertices[_0xddff('0xf')][_0xddff('0x57')]=function(_0x1c30f9,_0x175557){sh[_0xddff('0x58')](_['trim'](_0x1c30f9),function(_0x193b98,_0x5c1cb7){var _0x28ce34=_0x5c1cb7['replace'](/(\r\n|\n|\r)/gm,'');_0x175557(null,_0x28ce34);});};AGIVertices[_0xddff('0xf')][_0xddff('0x59')]=function(_0x444b49,_0x3c6fa4){scripts[_0xddff('0x59')](_0x444b49['apiKey'],_0x444b49[_0xddff('0x5a')]||_0xddff('0x5b'),_0x444b49[_0xddff('0x5b')],_0x444b49['languageCode']||_0xddff('0x5c'),_0x444b49[_0xddff('0x5d')]||'MALE',_0x444b49[_0xddff('0x5e')]||_0xddff('0x5f'))[_0xddff('0x12')](function(_0x5cfbed){_0x3c6fa4(null,_0x5cfbed);})[_0xddff('0x14')](function(_0x34dd18){_0x3c6fa4(_0x34dd18);});};AGIVertices[_0xddff('0xf')][_0xddff('0x60')]=function(_0x57ade1,_0x512089){scripts['googleTTS'](_0x57ade1[_0xddff('0x5b')],_0x57ade1[_0xddff('0x61')]||'en',0x1)[_0xddff('0x12')](function(_0x49775c){_0x512089(null,_0x49775c);})[_0xddff('0x14')](function(_0x2aacda){_0x512089(_0x2aacda);});};AGIVertices[_0xddff('0xf')][_0xddff('0x62')]=function(_0x4ea647,_0x4cf5f1){var _0x3be9e0={'uri':_0x4ea647['url'],'method':_0x4ea647[_0xddff('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4ea647[_0xddff('0x64')])===_0xddff('0x65')&&parseInt(_0x4ea647[_0xddff('0x64')])>=0x1?parseInt(_0x4ea647['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xddff('0x66')]([_0xddff('0x67'),'PUT'],_0x3be9e0[_0xddff('0x63')][_0xddff('0x68')]())){try{_0x3be9e0[_0xddff('0x69')]=_0x4ea647[_0xddff('0xa')]?JSON[_0xddff('0x6a')](_0x4ea647[_0xddff('0xa')]):{};}catch(_0xcf9199){logger[_0xddff('0x2b')](_0xddff('0x6b'),_0xcf9199);}}try{_0x3be9e0[_0xddff('0x6c')]=_0x4ea647[_0xddff('0x6d')]?JSON['parse'](_0x4ea647['rawHeaders']):{};}catch(_0x5960b3){logger[_0xddff('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5960b3);}if(_0x4ea647['computedVariables']){try{var _0x5675ee=require(_0x4ea647[_0xddff('0x6e')])[_0xddff('0x6f')](this,_0x3be9e0);_0x3be9e0[_0xddff('0x70')]=Mustache[_0xddff('0x71')](_0x4ea647[_0xddff('0x72')],_0x5675ee,{},['$$','$$']);if(_0x3be9e0[_0xddff('0x6c')]){_0x3be9e0[_0xddff('0x6c')]=JSON['parse'](Mustache[_0xddff('0x71')](JSON['stringify'](_0x3be9e0[_0xddff('0x6c')]),_0x5675ee,{},['$$','$$']));}if(_0x3be9e0[_0xddff('0x69')]){_0x3be9e0[_0xddff('0x69')]=JSON['parse'](Mustache['render'](JSON[_0xddff('0x73')](_0x3be9e0['body']),_0x5675ee,{},['$$','$$']));}}catch(_0x48e1a7){logger[_0xddff('0x2b')](_0xddff('0x74'),_0x48e1a7);}}rp(_0x3be9e0)[_0xddff('0x12')](function(_0x532b61){var _0x8a95f2={'statusCode':_0x532b61['statusCode']||0xc8,'statusMessage':_0x532b61[_0xddff('0x75')]||'OK','headers':_0x532b61['headers']||{},'body':_0x532b61[_0xddff('0x69')]||{}};_0x4cf5f1(null,_0x8a95f2);})['catch'](function(_0x259dac){var _0x3fe6c2={'statusCode':_0x259dac[_0xddff('0x76')]||0x1f4,'statusMessage':_0x259dac[_0xddff('0x77')]||_0xddff('0x78'),'headers':_0x259dac[_0xddff('0x79')]['headers']||{},'body':_0x259dac[_0xddff('0x79')]['body']||{}};_0x4cf5f1(null,_0x3fe6c2);});};AGIVertices['prototype']['googleDialogflow']=function(_0x47dd99,_0x200948){scripts[_0xddff('0x7a')](this[_0xddff('0xc')][_0xddff('0x3b')],_0x47dd99[_0xddff('0x7b')],_0x47dd99[_0xddff('0x5b')],_0x47dd99[_0xddff('0x7c')]||'en')['then'](function(_0x2b8245){_0x200948(null,_0x2b8245);})['catch'](function(_0x249979){_0x200948(_0x249979);});};AGIVertices[_0xddff('0xf')][_0xddff('0x7d')]=function(_0x251c4a,_0x54b2b3){scripts['googleDialogflowV2'](this[_0xddff('0xc')][_0xddff('0x3b')],_0x251c4a[_0xddff('0x7e')],_0x251c4a[_0xddff('0x7f')],_0x251c4a['private_key'],_0x251c4a[_0xddff('0x5b')],_0x251c4a[_0xddff('0x80')]||'en')[_0xddff('0x12')](function(_0x3a9d7c){_0x54b2b3(null,_0x3a9d7c);})[_0xddff('0x14')](function(_0x31da39){_0x54b2b3(_0x31da39);});};AGIVertices[_0xddff('0xf')][_0xddff('0x81')]=function(_0x42f6a8,_0x50ab32){scripts[_0xddff('0x81')](this[_0xddff('0xc')],_0x42f6a8)['then'](function(_0x4db72e){_0x50ab32(null,_0x4db72e);})[_0xddff('0x14')](function(_0x1077d9){_0x50ab32(_0x1077d9);});};AGIVertices[_0xddff('0xf')][_0xddff('0x82')]=function(_0x104c8c,_0x2bd1e9){scripts[_0xddff('0x82')](_0x104c8c[_0xddff('0x7b')],_0x104c8c[_0xddff('0x5b')],_0x104c8c[_0xddff('0x83')]||_0xddff('0x5c'),_0x104c8c[_0xddff('0x84')])[_0xddff('0x12')](function(_0x37baf8){_0x2bd1e9(null,_0x37baf8);})[_0xddff('0x14')](function(_0x505e00){_0x2bd1e9(_0x505e00);});};AGIVertices[_0xddff('0xf')]['ispeechASR']=function(_0x46bf75,_0x4c85fa,_0x333cc4){scripts['ispeechASR'](_0x4c85fa,_0x46bf75[_0xddff('0x7b')],_0x46bf75[_0xddff('0x85')]||_0xddff('0x5c'),this[_0xddff('0x86')](_0x46bf75[_0xddff('0x87')])?_0x46bf75['model']:undefined)['then'](function(_0x5dca41){_0x333cc4(null,_0x5dca41);})[_0xddff('0x14')](function(_0x5a50c0){_0x333cc4(_0x5a50c0);});};AGIVertices['prototype'][_0xddff('0x88')]=function(_0x5e2cce,_0x564085){scripts['awsPolly'](_0x5e2cce[_0xddff('0x89')],_0x5e2cce[_0xddff('0x8a')],_0x5e2cce[_0xddff('0x8b')],_0x5e2cce[_0xddff('0x8c')]||'Amy',_0x5e2cce['text'],_0x5e2cce[_0xddff('0x8d')]||'text')[_0xddff('0x12')](function(_0x39083b){_0x564085(null,_0x39083b);})[_0xddff('0x14')](function(_0x312dfb){_0x564085(_0x312dfb);});};AGIVertices[_0xddff('0xf')][_0xddff('0x8e')]=function(_0x4fe9eb,_0x1ae634){scripts[_0xddff('0x8e')](this['channel'][_0xddff('0x3b')],_0x4fe9eb[_0xddff('0x89')],_0x4fe9eb[_0xddff('0x8a')],_0x4fe9eb[_0xddff('0x8f')],_0x4fe9eb[_0xddff('0x5b')],_0x4fe9eb['aws_bot_name'])[_0xddff('0x12')](function(_0x20868f){_0x1ae634(null,_0x20868f);})[_0xddff('0x14')](function(_0x391cc9){_0x1ae634(_0x391cc9);});};AGIVertices[_0xddff('0xf')][_0xddff('0x90')]=function(_0x224287,_0x51ef18,_0x107592){scripts[_0xddff('0x90')](_0x51ef18,_0x224287['key'],_0x224287['google_asr_language']||_0xddff('0x5c'))['then'](function(_0x213181){_0x107592(null,_0x213181);})[_0xddff('0x14')](function(_0x1b8b2d){_0x107592(_0x1b8b2d);});};AGIVertices['prototype'][_0xddff('0x91')]=function(_0xe4e433,_0x59b67a,_0x312d58){scripts[_0xddff('0x91')](_0x59b67a,_0xe4e433[_0xddff('0x92')],_0xe4e433[_0xddff('0x93')],_0xe4e433[_0xddff('0x70')])[_0xddff('0x12')](function(_0x178fce){_0x312d58(null,_0x178fce);})[_0xddff('0x14')](function(_0x51ad3d){_0x312d58(_0x51ad3d);});};AGIVertices[_0xddff('0xf')][_0xddff('0x94')]=function(_0x191e0a){var _0x2ed7c4=_[_0xddff('0x66')](verticesWithRetry,_0x191e0a[_0xddff('0x95')])?_0x191e0a:_['clone'](_0x191e0a);for(var _0xf46c0a in _0x2ed7c4){if(_0x2ed7c4['hasOwnProperty'](_0xf46c0a)){if(_0x2ed7c4[_0xf46c0a]&&_['isString'](_0x2ed7c4[_0xf46c0a])){if(_[_0xddff('0x66')](recursiveMapAttributes,_0xf46c0a)){_0x2ed7c4[_0xf46c0a]=this[_0xddff('0x96')](_0x2ed7c4[_0xf46c0a]);}else{_0x2ed7c4[_0xf46c0a]=this[_0xddff('0x97')](_0x2ed7c4[_0xf46c0a]);}}}}return _0x2ed7c4;};AGIVertices[_0xddff('0xf')][_0xddff('0x98')]=function(_0x3d7a55){for(var _0x4d2429 in _0x3d7a55){if(_0x3d7a55[_0xddff('0x99')](_0x4d2429)){if(_['isPlainObject'](_0x3d7a55[_0x4d2429])){this['recursiveNodeIndex'](_0x3d7a55[_0x4d2429]);}else if(_[_0xddff('0x9a')](_0x3d7a55[_0x4d2429])){for(var _0x473994=0x0;_0x473994<_0x3d7a55[_0x4d2429][_0xddff('0x9b')];_0x473994++){this[_0xddff('0x98')](_0x3d7a55[_0x4d2429][_0x473994]);}}else if(_[_0xddff('0x9c')](_0x3d7a55[_0x4d2429])){_0x3d7a55[_0x4d2429]=this[_0xddff('0x97')](_0x3d7a55[_0x4d2429]);}}}};AGIVertices[_0xddff('0xf')][_0xddff('0x9d')]=function(_0x34991e,_0x2ab2ec){for(var _0x5766c8 in _0x34991e){if(_0x34991e[_0xddff('0x99')](_0x5766c8)){if(_[_0xddff('0x9e')](_0x34991e[_0x5766c8])){if(!_[_0xddff('0x46')](_0x34991e[_0x5766c8])){this[_0xddff('0x9d')](_0x34991e[_0x5766c8],util[_0xddff('0x28')]('%s.%s',_0x2ab2ec,_0x5766c8));}}else if(_[_0xddff('0x9a')](_0x34991e[_0x5766c8])){for(var _0xa19c42=0x0;_0xa19c42<_0x34991e[_0x5766c8][_0xddff('0x9b')];_0xa19c42++){this[_0xddff('0x9d')](_0x34991e[_0x5766c8][_0xa19c42],util[_0xddff('0x28')](_0xddff('0x9f'),_0x2ab2ec,_0x5766c8+'['+_0xa19c42+']'));}}else{if(!_[_0xddff('0x44')](_0x34991e[_0x5766c8])){this[_0xddff('0xc')][_0xddff('0xa0')](util[_0xddff('0x28')]('%s.%s',_0x2ab2ec,_0x5766c8),_0x34991e[_0x5766c8]);}}}}};AGIVertices[_0xddff('0xf')][_0xddff('0x96')]=function(_0x5c748a){try{var _0x5bb6ae=JSON[_0xddff('0x6a')](_0x5c748a);this['recursiveNodeIndex'](_0x5bb6ae);return JSON[_0xddff('0x73')](_0x5bb6ae);}catch(_0x22516b){return this[_0xddff('0x97')](_0x5c748a);}};AGIVertices[_0xddff('0xf')]['replaceAllVariables']=function(_0x22df5a){var _0x123f83=_0x22df5a[_0xddff('0xa1')]('{');for(var _0x43d221=0x1;_0x43d221<_0x123f83['length'];_0x43d221+=0x1){var _0x11fecc=_0x123f83[_0x43d221]['split']('}');if(_0x11fecc[_0xddff('0x9b')]>0x1){_0x22df5a=_0x22df5a['replaceAll']('{'+_0x11fecc[0x0]+'}',this[_0xddff('0xc')]['getVariable'](_0x11fecc[0x0])[_0xddff('0xa2')]||_0x11fecc[0x0]);}}if(_0x123f83['length']===0x1){return _0x22df5a[_0xddff('0x4d')]();}return this[_0xddff('0x97')](_0x22df5a);};AGIVertices[_0xddff('0xf')][_0xddff('0xa3')]=function(_0x542977,_0xf3053c){var _0x1c9311=this[_0xddff('0xc')][_0xddff('0x10')](_0x542977);if(_0x1c9311[_0xddff('0xa4')]===-0x1){return _0x1c9311;}logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xa5'),_0xf3053c,_0x1c9311[_0xddff('0xa2')]));return this['channel'][_0xddff('0xa0')](_0xf3053c,_0x1c9311[_0xddff('0xa2')]);};AGIVertices['prototype'][_0xddff('0x86')]=function(_0x50d059){return _0x50d059&&_0x50d059!=='0'&&_0x50d059!=='-1'&&_0x50d059!=='';};AGIVertices['prototype']['maxRetry']=function(_0x25903b){this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x25903b,'-');_0x25903b[_0xddff('0xa6')]=_0x25903b[_0xddff('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xddff('0xf')][_0xddff('0xa8')]=function(_0x54a53e){logger['info'](util[_0xddff('0x28')](_0xddff('0xa9'),_0x54a53e[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x54a53e['text'])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xab'));}var _0x85d035='\x22'+_0x54a53e[_0xddff('0x5b')]+'\x22';if(this[_0xddff('0x86')](_0x54a53e['options'])){_0x85d035+=','+_0x54a53e[_0xddff('0x79')];}var _0x260f1d=this[_0xddff('0xc')][_0xddff('0x58')](_0xddff('0xac'),_0x85d035);if(_0x260f1d['result']===-0x1){return _0x260f1d;}return this['channel'][_0xddff('0xaa')](util['format'](_0xddff('0xad'),_0x85d035));};AGIVertices[_0xddff('0xf')][_0xddff('0xae')]=function(_0x3c4a18){logger['info'](util['format'](_0xddff('0xaf'),_0x3c4a18[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x3c4a18[_0xddff('0xb0')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xb1'));}var _0x576987=_0x3c4a18[_0xddff('0xb0')];if(this[_0xddff('0x86')](_0x3c4a18[_0xddff('0x79')])){_0x576987+=','+_0x3c4a18['options'];}var _0x5c14cd=this[_0xddff('0xc')]['exec'](_0xddff('0xb2'),_0x576987);if(_0x5c14cd['result']===-0x1){return _0x5c14cd;}var _0x26f4ff=this[_0xddff('0xa3')](_0xddff('0xb3'),_0xddff('0xb4'));if(_0x26f4ff[_0xddff('0xa4')]===-0x1){return _0x26f4ff;}var _0x1ddfa6=this[_0xddff('0xa3')](_0xddff('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x1ddfa6[_0xddff('0xa4')]===-0x1){return _0x1ddfa6;}var _0x480220=this[_0xddff('0xa3')](_0xddff('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x480220[_0xddff('0xa4')]===-0x1){return _0x480220;}return this['channel'][_0xddff('0xaa')](util['format'](_0xddff('0xb7'),_0x576987));};AGIVertices[_0xddff('0xf')][_0xddff('0x7')]=function(_0x21e70d){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xb8'),_0x21e70d[_0xddff('0x37')]));return this[_0xddff('0xc')][_0xddff('0x7')]([_0x21e70d[_0xddff('0xb9')],_0x21e70d['args']]);};AGIVertices[_0xddff('0xf')]['answer']=function(_0xf09f4c){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xba'),_0xf09f4c[_0xddff('0x37')]));if(this[_0xddff('0x86')](_0xf09f4c['timeout'])){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xf09f4c['timeout']));var _0x2d9a4d=this[_0xddff('0xc')]['wait'](_0xf09f4c[_0xddff('0x64')]);if(_0x2d9a4d[_0xddff('0xa4')]===-0x1){return _0x2d9a4d;}}return this['channel'][_0xddff('0xbb')]();};AGIVertices['prototype'][_0xddff('0x4b')]=function(_0x3dde9f){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xbc'),_0x3dde9f[_0xddff('0x37')]));if(!this['isConfigured'](_0x3dde9f[_0xddff('0x49')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x3dde9f,_0xddff('0xbd'));}_0x3dde9f[_0xddff('0x4a')]=moment();if(this[_0xddff('0x86')](_0x3dde9f[_0xddff('0xbe')])){_0x3dde9f['scheduledAt']=moment()[_0xddff('0xbf')](_0x3dde9f[_0xddff('0xbe')],_0xddff('0xc0'));}if(!this[_0xddff('0x86')](_0x3dde9f[_0xddff('0x4e')])){_0x3dde9f[_0xddff('0x4e')]=0x2;}this[_0xddff('0x43')][_0xddff('0x6f')](this,_0x3dde9f);return this[_0xddff('0xc')][_0xddff('0xaa')](util['format'](_0xddff('0xc1'),_0x3dde9f[_0xddff('0x48')],_0x3dde9f[_0xddff('0x49')],_0x3dde9f[_0xddff('0x4a')]));};AGIVertices['prototype'][_0xddff('0xc2')]=function(_0x57a4ba){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x57a4ba[_0xddff('0x37')]));var _0x265efd=this[_0xddff('0xc')]['exec'](_0x57a4ba[_0xddff('0xc3')],_0x57a4ba[_0xddff('0x79')]);if(_0x265efd[_0xddff('0xa4')]===-0x1){return _0x265efd;}return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xc4'),_0x57a4ba[_0xddff('0xc3')],_0x57a4ba[_0xddff('0x79')]));};AGIVertices[_0xddff('0xf')]['lumenvoxtts']=function(_0x360600){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xc5'),_0x360600[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x360600[_0xddff('0x5b')])){return this[_0xddff('0xc')]['noop']('no\x20text\x20configured');}var _0x12efa9='\x22'+_0x360600[_0xddff('0x5b')]+'\x22';if(this['isConfigured'](_0x360600[_0xddff('0x79')])){_0x12efa9+=','+_0x360600['options'];}var _0x5950d0=this[_0xddff('0xc')][_0xddff('0x58')](_0xddff('0xac'),_0x12efa9);if(_0x5950d0['result']===-0x1){return _0x5950d0;}return this['channel'][_0xddff('0xaa')](util['format'](_0xddff('0xad'),_0x12efa9));};AGIVertices['prototype'][_0xddff('0xc6')]=function(_0x1dbb38){logger[_0xddff('0x2d')](util['format'](_0xddff('0xc7'),_0x1dbb38[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x1dbb38[_0xddff('0x5b')])){return this['channel'][_0xddff('0xaa')](_0xddff('0xab'));}var _0x5afab9='\x22'+_0x1dbb38[_0xddff('0x5b')]+'\x22';if(this['isConfigured'](_0x1dbb38[_0xddff('0x79')])){_0x5afab9+=','+_0x1dbb38['options'];}var _0x101696=this[_0xddff('0xc')]['exec'](_0xddff('0xac'),_0x5afab9);if(_0x101696[_0xddff('0xa4')]===-0x1){return _0x101696;}return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xad'),_0x5afab9));};AGIVertices[_0xddff('0xf')]['lumenvoxasr']=function(_0x231b74){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xc8'),_0x231b74['label']));if(!this['isConfigured'](_0x231b74[_0xddff('0xb0')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xb1'));}var _0x4454b5=_0x231b74['grammar'];if(this[_0xddff('0x86')](_0x231b74[_0xddff('0x79')])){_0x4454b5+=','+_0x231b74[_0xddff('0x79')];}var _0x4bd56a=this['channel'][_0xddff('0x58')](_0xddff('0xb2'),_0x4454b5);if(_0x4bd56a[_0xddff('0xa4')]===-0x1){return _0x4bd56a;}var _0x34645e=this[_0xddff('0xa3')](_0xddff('0xb3'),_0xddff('0xc9'));if(_0x34645e['result']===-0x1){return _0x34645e;}var _0x464b1d=this[_0xddff('0xa3')]('RECOG_INPUT()',_0xddff('0xca'));if(_0x464b1d[_0xddff('0xa4')]===-0x1){return _0x464b1d;}var _0x247a00=this['getAndSetVariable'](_0xddff('0xb6'),_0xddff('0xcb'));if(_0x247a00['result']===-0x1){return _0x247a00;}return this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0xb7'),_0x4454b5));};AGIVertices[_0xddff('0xf')]['sestekasr']=function(_0x5032e7){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xcc'),_0x5032e7[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x5032e7[_0xddff('0xb0')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xb1'));}var _0x597bcd=_0x5032e7[_0xddff('0xb0')];if(this[_0xddff('0x86')](_0x5032e7[_0xddff('0x79')])){_0x597bcd+=','+_0x5032e7[_0xddff('0x79')];}var _0x33f30d=this['channel']['exec'](_0xddff('0xb2'),_0x597bcd);if(_0x33f30d[_0xddff('0xa4')]===-0x1){return _0x33f30d;}var _0x5ce538=this['getAndSetVariable'](_0xddff('0xb3'),_0xddff('0xcd'));if(_0x5ce538[_0xddff('0xa4')]===-0x1){return _0x5ce538;}var _0x22a473=this['getAndSetVariable'](_0xddff('0xb5'),'SESTEK_ASR_TRANSCRIPT');if(_0x22a473[_0xddff('0xa4')]===-0x1){return _0x22a473;}var _0x15f44b=this[_0xddff('0xa3')](_0xddff('0xb6'),_0xddff('0xce'));if(_0x15f44b[_0xddff('0xa4')]===-0x1){return _0x15f44b;}return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xb7'),_0x597bcd));};AGIVertices[_0xddff('0xf')][_0xddff('0xcf')]=function(_0x439c07){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xd0'),_0x439c07[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x439c07[_0xddff('0xd1')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x439c07,'no\x20database\x20selected');}var _0x43e5c7=this[_0xddff('0x18')][_0xddff('0x6f')](this,_0x439c07['odbc_id']);if(!_0x43e5c7){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x439c07,_0xddff('0xd2'));}if(!this[_0xddff('0x86')](_0x439c07[_0xddff('0x2e')])){return this[_0xddff('0xc')]['error'](_0x439c07,_0xddff('0xd3'));}var _0x436619=_0x439c07[_0xddff('0x2e')][_0xddff('0xd4')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xd5'),_0x436619));var _0x56680b=this[_0xddff('0x2a')][_0xddff('0x6f')](this,_0x43e5c7,_0x436619);this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x439c07,_0x436619);if(!this['isConfigured'](_0x439c07[_0xddff('0xd6')])){return this['channel'][_0xddff('0xaa')](_0xddff('0xd7'));}var _0x4c53e8=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x439c07[_0xddff('0xd6')]);if(!_0x4c53e8){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x439c07,_0xddff('0xd8'));}var _0x5b7e82=this;_0x56680b['forEach'](function(_0x1abeee,_0x4c8942){Object[_0xddff('0xd9')](_0x1abeee)[_0xddff('0xda')](function(_0x296ee9){_0x5b7e82[_0xddff('0xc')][_0xddff('0xa0')](util[_0xddff('0x28')]('%s[%s][%s]',_0x4c53e8,_0x4c8942,_0x296ee9),_0x1abeee[_0x296ee9]);});});this['channel'][_0xddff('0xa0')](util[_0xddff('0x28')]('%s_ROWS_COUNT',_0x4c53e8),_0x56680b['length']);return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xdb'),_0x4c53e8));};AGIVertices['prototype'][_0xddff('0xdc')]=function(_0x5d7427){logger[_0xddff('0xdd')](util['format'](_0xddff('0xde'),_0x5d7427[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x5d7427['sip_id'])){return this['channel']['error'](_0x5d7427,_0xddff('0xdf'));}var _0x3d12c2=this['getUser'][_0xddff('0x6f')](this,_0x5d7427[_0xddff('0xe0')]);if(!_0x3d12c2){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x5d7427,_0xddff('0xe1'));}var _0x54c50a=this['channel']['exec'](_0xddff('0xe2'),[util[_0xddff('0x28')](_0xddff('0xe3'),_0x3d12c2),_0x5d7427['timeout'],_0x5d7427[_0xddff('0xe4')],_0x5d7427[_0xddff('0x72')]]);if(_0x54c50a[_0xddff('0xa4')]===-0x1){return _0x54c50a;}return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xe5'),_0xddff('0xe2')));};AGIVertices[_0xddff('0xf')]['dialogflow']=function(_0x594024){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xe6'),_0x594024['label']));if(!this[_0xddff('0x86')](_0x594024[_0xddff('0x7b')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xe7'));}if(!this['isConfigured'](_0x594024['text'])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xab'));}this[_0xddff('0xc')][_0xddff('0xe8')]=!![];this['createSquareDetailsReport'](_0x594024);this[_0xddff('0x42')](_0x594024[_0xddff('0x5b')],'in','','');this['channel']['noop'](util['format'](_0xddff('0xe9'),_0x594024[_0xddff('0x5b')]));var _0x5df55f=this[_0xddff('0x7a')][_0xddff('0x6f')](this,_0x594024);if(_0x5df55f){for(var _0x1e5f96 in _0x5df55f){if(_0x5df55f['hasOwnProperty'](_0x1e5f96)){this[_0xddff('0xc')][_0xddff('0xa0')](util[_0xddff('0x28')](_0xddff('0xea'),_0x1e5f96[_0xddff('0x68')]()),_0x5df55f[_0x1e5f96]);}}this['createSquareMessage'](_0x5df55f[_0xddff('0xeb')],_0xddff('0xec'),_0xddff('0xed'),'');return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')]('Dialogflow\x20Result\x20%s',_0x5df55f[_0xddff('0xeb')]));}return this[_0xddff('0xc')][_0xddff('0x2b')](_0x594024,_0xddff('0xee'));};AGIVertices[_0xddff('0xf')]['dialogflowV2']=function(_0x55a435){logger[_0xddff('0x2d')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x55a435[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x55a435[_0xddff('0x7e')])){return this['channel'][_0xddff('0xaa')](_0xddff('0xef'));}if(!this[_0xddff('0x86')](_0x55a435[_0xddff('0x7f')])){return this['channel']['noop'](_0xddff('0xf0'));}if(!this[_0xddff('0x86')](_0x55a435[_0xddff('0xf1')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xf2'));}if(!this[_0xddff('0x86')](_0x55a435[_0xddff('0x80')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xf3'));}if(!this[_0xddff('0x86')](_0x55a435[_0xddff('0x5b')])){return this[_0xddff('0xc')]['noop'](_0xddff('0xab'));}this[_0xddff('0xc')][_0xddff('0xe8')]=!![];this['createSquareDetailsReport'](_0x55a435);this['createSquareMessage'](_0x55a435[_0xddff('0x5b')],'in','','');this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')]('Trying\x20DialogflowV2:\x20%s',_0x55a435[_0xddff('0x5b')]));var _0x2cb3d2=this[_0xddff('0x7d')]['sync'](this,_0x55a435);if(_0x2cb3d2){for(var _0x62f64a in _0x2cb3d2){if(_0x2cb3d2['hasOwnProperty'](_0x62f64a)){if(_0x62f64a!==_0xddff('0xf4')){this[_0xddff('0xc')]['setVariable'](util[_0xddff('0x28')](_0xddff('0xea'),_0x62f64a[_0xddff('0x68')]()),_0x2cb3d2[_0x62f64a]);}}}this[_0xddff('0x42')](_0x2cb3d2[_0xddff('0xeb')],_0xddff('0xec'),'dialogflowV2',_0x2cb3d2[_0xddff('0xf4')]);return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')]('DialogflowV2\x20Result\x20%s',_0x2cb3d2[_0xddff('0xeb')]));}return this['channel']['error'](_0x55a435,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xddff('0xf')]['sesteknda']=function(_0x2ecbe5){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0xf5'),_0x2ecbe5[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x2ecbe5['ndauth_url'])){return this[_0xddff('0xc')][_0xddff('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x2ecbe5[_0xddff('0xf6')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xf7'));}if(!this[_0xddff('0x86')](_0x2ecbe5['password'])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xf8'));}if(!this['isConfigured'](_0x2ecbe5[_0xddff('0xf9')])){return this[_0xddff('0xc')][_0xddff('0xaa')]('no\x20text\x20configured');}this[_0xddff('0xc')][_0xddff('0xe8')]=!![];this[_0xddff('0x36')](_0x2ecbe5);this[_0xddff('0x42')](_0x2ecbe5[_0xddff('0x5b')],'in','','');this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0xfa'),_0x2ecbe5[_0xddff('0x5b')]));var _0x5b8e4d=this[_0xddff('0x81')]['sync'](this,_0x2ecbe5);if(_0x5b8e4d){for(var _0x4cb824 in _0x5b8e4d){if(_0x5b8e4d['hasOwnProperty'](_0x4cb824)){this[_0xddff('0xc')][_0xddff('0xa0')](util['format'](_0xddff('0xfb'),_0x4cb824[_0xddff('0x68')]()),_0x5b8e4d[_0x4cb824]);}}this['createSquareMessage'](_0x5b8e4d['speech'],_0xddff('0xec'),_0xddff('0xfc'),'');if(_0x5b8e4d[_0xddff('0xfd')]){this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x5b8e4d[_0xddff('0xfd')]));var _0x16279e=this[_0xddff('0xc')]['streamFile'](_0x5b8e4d[_0xddff('0xfd')]);try{fs[_0xddff('0xfe')](_0x5b8e4d[_0xddff('0xfd')]+'.wav');}catch(_0x12b7fd){logger[_0xddff('0x2b')](_0x12b7fd);}return _0x16279e;}else{return this[_0xddff('0xc')][_0xddff('0xaa')](util['format'](_0xddff('0xff'),_0x5b8e4d['speech']));}}return this['channel']['error'](_0x2ecbe5,_0xddff('0x100'));};AGIVertices[_0xddff('0xf')][_0xddff('0x101')]=function(_0x4a6d0f){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x102'),_0x4a6d0f[_0xddff('0x37')]));return this[_0xddff('0xc')][_0xddff('0xaa')]('end');};AGIVertices[_0xddff('0xf')][_0xddff('0x103')]=function(_0x1e690c){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1e690c[_0xddff('0x37')]));var _0x2c5eee='';if(_0x1e690c['trunk_id']){if(!this['isConfigured'](_0x1e690c['trunk_id'])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x1e690c,_0xddff('0x104'));}else{var _0x41d7d5=parseInt(_0x1e690c[_0xddff('0x105')],0xa);if(isNaN(_0x41d7d5)){_0x2c5eee=_0x1e690c[_0xddff('0x105')];}else{_0x2c5eee=this[_0xddff('0x1d')]['sync'](this,_0x1e690c['trunk_id']);if(!_0x2c5eee){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x1e690c,_0xddff('0x106'));}}}}else if(_0x1e690c[_0xddff('0x107')]){_0x2c5eee=_0x1e690c[_0xddff('0x107')];}else{return this[_0xddff('0xc')][_0xddff('0x2b')](_0x1e690c,_0xddff('0x104'));}var _0xee176d=this[_0xddff('0xc')][_0xddff('0x58')](_0xddff('0xe2'),[util['format'](_0xddff('0x108'),_0x2c5eee,_0x1e690c[_0xddff('0x48')]),_0x1e690c[_0xddff('0x64')],_0x1e690c[_0xddff('0xe4')],_0x1e690c[_0xddff('0x72')]]);if(_0xee176d[_0xddff('0xa4')]===-0x1){return _0xee176d;}return this[_0xddff('0xc')][_0xddff('0xaa')](util['format'](_0xddff('0xe5'),_0xddff('0xe2')));};AGIVertices['prototype'][_0xddff('0x109')]=function(_0x1fccdb){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1fccdb[_0xddff('0x37')]));return this['channel']['noop'](_0xddff('0x109'));};AGIVertices[_0xddff('0xf')][_0xddff('0x10a')]=function(_0x25672a){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x10b'),_0x25672a['label']));if(_0x25672a[_0xddff('0xa6')]===0x0){return this['maxRetry'](_0x25672a);}_0x25672a['retry']-=0x1;if(!this[_0xddff('0x86')](_0x25672a[_0xddff('0x10c')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x25672a,'no\x20file\x20audio\x20selected');}var _0x508276=this[_0xddff('0x1e')]['sync'](this,_0x25672a[_0xddff('0x10c')]);if(!_0x508276){return this[_0xddff('0xc')]['error'](_0x25672a,'no\x20file\x20audio\x20found');}if(!this[_0xddff('0x86')](_0x25672a[_0xddff('0xd6')])){return this['channel']['error'](_0xddff('0xd7'));}var _0x3258a5=this['channel'][_0xddff('0x10d')](_0x508276,_0x25672a[_0xddff('0x10e')],_0x25672a[_0xddff('0x10f')]);var _0x496056=_0x3258a5['result']?_0x3258a5[_0xddff('0xa4')][_0xddff('0x4d')]():'';logger[_0xddff('0x2d')]('test',JSON[_0xddff('0x73')](_0x3258a5));if(_0x3258a5[_0xddff('0xa4')]===-0x1){this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x25672a,_0x496056);return _0x3258a5;}else if(_0x3258a5[_0xddff('0xa2')]===_0xddff('0x64')){_0x3258a5[_0xddff('0xa4')]=_0x496056[_0xddff('0x9b')]>=parseInt(_0x25672a['mindigit'])?'x':'i';}else{_0x3258a5[_0xddff('0xa4')]=_0x496056[_0xddff('0x9b')]>=parseInt(_0x25672a[_0xddff('0x110')])&&_0x496056[_0xddff('0x9b')]<=parseInt(_0x25672a['maxdigit'])?'x':'i';}var _0x3221c9=this[_0xddff('0x10')]['sync'](this,_0x25672a['variable_id']);if(!_0x3221c9){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x25672a,'no\x20variable\x20found');}this[_0xddff('0xc')][_0xddff('0xa0')](_0x3221c9,_0x496056);if(this[_0xddff('0x86')](_0x25672a[_0xddff('0x111')])){var _0x29d54c=parseInt(_0x25672a[_0xddff('0x111')],0xa);var _0x438cde=rs[_0xddff('0x112')]({'charset':'*','length':_0x29d54c});var _0xd1e0c1=_0x496056[_0xddff('0x9b')];if(_0xd1e0c1>0x0){if(_0xd1e0c1>_0x29d54c){this['createSquareDetailsReport'][_0xddff('0x6f')](this,_0x25672a,_0x25672a['hiddendigitspos']===_0xddff('0x113')?_0x438cde+_0x496056['substr'](_0x29d54c):_0x496056[_0xddff('0x114')](0x0,_0xd1e0c1-_0x29d54c)+_0x438cde);}else{this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x25672a,rs[_0xddff('0x112')]({'charset':'*','length':_0xd1e0c1}));}}else{this['createSquareDetailsReport'][_0xddff('0x6f')](this,_0x25672a,'');}}else{this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x25672a,_0x496056);}return _0x3258a5;};AGIVertices[_0xddff('0xf')][_0xddff('0x115')]=function(_0x401cf3){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x116'),_0x401cf3[_0xddff('0x37')]));return this['getdigits'](_0x401cf3);};AGIVertices[_0xddff('0xf')][_0xddff('0x117')]=function(_0x366f10){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x118'),_0x366f10[_0xddff('0x37')]));this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x366f10,_0x366f10[_0xddff('0x119')]);return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x11a'),_0x366f10[_0xddff('0x119')]));};AGIVertices[_0xddff('0xf')][_0xddff('0x11b')]=function(_0x2df2ce){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x11c'),_0x2df2ce[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x2df2ce[_0xddff('0x89')])||!this[_0xddff('0x86')](_0x2df2ce[_0xddff('0x8a')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0x11d'));}if(!this[_0xddff('0x86')](_0x2df2ce[_0xddff('0x5b')])){return this['channel'][_0xddff('0xaa')](_0xddff('0xab'));}this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x11e'),_0x2df2ce[_0xddff('0x5b')]));var _0x5b6aaa=this['awsPolly'][_0xddff('0x6f')](this,_0x2df2ce);if(_0x5b6aaa){this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')]('aws\x20Polly\x20%s\x20file\x20created',_0x5b6aaa));var _0x429bde=this[_0xddff('0xc')]['streamFile'](_0x5b6aaa);try{fs[_0xddff('0xfe')](_0x5b6aaa+_0xddff('0x11f'));}catch(_0x34c54f){logger[_0xddff('0x2b')](_0x34c54f);}return _0x429bde;}return this[_0xddff('0xc')][_0xddff('0x2b')](_0x2df2ce,_0xddff('0x120'));};AGIVertices[_0xddff('0xf')][_0xddff('0x121')]=function(_0x174042){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x174042[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x174042[_0xddff('0x89')])||!this[_0xddff('0x86')](_0x174042[_0xddff('0x8a')])){return this[_0xddff('0xc')]['noop'](_0xddff('0x11d'));}if(!this['isConfigured'](_0x174042[_0xddff('0x122')])){return this[_0xddff('0xc')]['noop'](_0xddff('0x123'));}if(!this[_0xddff('0x86')](_0x174042[_0xddff('0x5b')])){return this[_0xddff('0xc')][_0xddff('0xaa')]('no\x20text\x20configured');}this[_0xddff('0xc')][_0xddff('0xe8')]=!![];this[_0xddff('0x36')](_0x174042);this[_0xddff('0x42')](_0x174042['text'],'in','','');this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x174042[_0xddff('0x5b')]));var _0x43b9ff=this[_0xddff('0x8e')][_0xddff('0x6f')](this,_0x174042);if(_0x43b9ff){for(var _0x48595e in _0x43b9ff){if(_0x43b9ff['hasOwnProperty'](_0x48595e)&&_[_0xddff('0x9c')](_0x43b9ff[_0x48595e])){this[_0xddff('0xc')]['setVariable'](util[_0xddff('0x28')]('AWS_LEX_%s',_0x48595e[_0xddff('0x68')]()),_0x43b9ff[_0x48595e]);}}if(_[_0xddff('0x44')](_0x43b9ff[_0xddff('0x77')])){return this[_0xddff('0xc')][_0xddff('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xddff('0x42')](_0x43b9ff[_0xddff('0x77')],_0xddff('0xec'),_0xddff('0x124'),'');return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x125'),_0x43b9ff['message']));}}return this[_0xddff('0xc')][_0xddff('0x2b')](_0x174042,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xddff('0x126')]=function(_0x9cc13d){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x127'),_0x9cc13d[_0xddff('0x37')],_0x9cc13d[_0xddff('0x64')]));if(!this['isConfigured'](_0x9cc13d['key'])){return this['channel'][_0xddff('0xaa')](_0xddff('0xe7'));}var _0x106c7f=_0xddff('0x128');var _0x4d7a31=util[_0xddff('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3a4fe8=util[_0xddff('0x28')](_0xddff('0x9f'),_0x4d7a31,_0x106c7f);var _0x4d02b=!![];if(_0x9cc13d['beep']===_0xddff('0x129')){_0x4d02b=![];}var _0x1236d5=this[_0xddff('0xc')][_0xddff('0x12a')](_0x4d7a31,_0x106c7f,_0x9cc13d['intKey'],_0x9cc13d['timeout'],undefined,_0x4d02b);if(_0x1236d5[_0xddff('0xa4')]!==-0x1){this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0x12b'),_0x3a4fe8));var _0x4ecfeb=this[_0xddff('0x90')][_0xddff('0x6f')](this,_0x9cc13d,_0x3a4fe8);if(_0x4ecfeb){for(var _0x8f7b70 in _0x4ecfeb){if(_0x4ecfeb['hasOwnProperty'](_0x8f7b70)){this[_0xddff('0xc')]['setVariable'](util[_0xddff('0x28')](_0xddff('0x12c'),_0x8f7b70[_0xddff('0x68')]()),_0x4ecfeb[_0x8f7b70]);}}return this[_0xddff('0xc')]['noop'](util['format'](_0xddff('0x12d'),JSON[_0xddff('0x73')](_0x4ecfeb)));}}return _0x1236d5;};AGIVertices[_0xddff('0xf')]['tildeasr']=function(_0x7cf43){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x7cf43['label']));if(!this[_0xddff('0x86')](_0x7cf43[_0xddff('0x92')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0x12e'));}if(!this[_0xddff('0x86')](_0x7cf43['appsecret'])){return this[_0xddff('0xc')][_0xddff('0xaa')]('no\x20appsecret\x20configured');}var _0x3f3408='wav';var _0x233954=util[_0xddff('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xddff('0x112')](0x4));var _0x5ab35b=util['format']('%s.%s',_0x233954,_0x3f3408);var _0x34b48a=!![];if(_0x7cf43[_0xddff('0x12f')]===_0xddff('0x129')){_0x34b48a=![];}var _0x4e1826=this['channel'][_0xddff('0x12a')](_0x233954,_0x3f3408,_0x7cf43['intKey'],_0x7cf43['timeout'],undefined,_0x34b48a);if(_0x4e1826[_0xddff('0xa4')]!==-0x1){this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x130'),_0x5ab35b));var _0x1719f2=this['tildeASR'][_0xddff('0x6f')](this,_0x7cf43,_0x5ab35b);if(_0x1719f2){for(var _0x196e51 in _0x1719f2){if(_0x1719f2[_0xddff('0x99')](_0x196e51)){this[_0xddff('0xc')]['setVariable'](util['format'](_0xddff('0x131'),_0x196e51['toUpperCase']()),_0x1719f2[_0x196e51]);}}return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x132'),JSON['stringify'](_0x1719f2)));}}return _0x4e1826;};AGIVertices[_0xddff('0xf')][_0xddff('0x133')]=function(_0x32580a){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x134'),_0x32580a[_0xddff('0x37')]));return this[_0xddff('0xc')][_0xddff('0x135')](_0x32580a[_0xddff('0x136')],_0x32580a[_0xddff('0x3d')],_0x32580a[_0xddff('0x3e')]);};AGIVertices[_0xddff('0xf')][_0xddff('0x137')]=function(_0x27fd36){logger['info'](util[_0xddff('0x28')](_0xddff('0x138'),_0x27fd36['label']));if(!this[_0xddff('0x86')](_0x27fd36[_0xddff('0x139')])){return this[_0xddff('0xc')]['error'](_0x27fd36,'no\x20condition\x20configured');}try{var _0x2ddb60=eval(_0x27fd36[_0xddff('0x139')])?_0xddff('0x13a'):_0xddff('0x13b');this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x13c'),_0x27fd36[_0xddff('0x139')],_0x2ddb60));return{'code':0xc8,'result':_0x2ddb60};}catch(_0xc4a60d){return{'code':0xc8,'result':_0xddff('0x13b')};}};AGIVertices[_0xddff('0xf')]['gotoiftime']=function(_0x210e8b){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x210e8b['label']));if(!this[_0xddff('0x86')](_0x210e8b[_0xddff('0x13d')])){return this['channel'][_0xddff('0x2b')](_0x210e8b,'no\x20interval\x20configured');}var _0x435a54=this['getIntervals']['sync'](this,_0x210e8b[_0xddff('0x13d')]);if(!_0x435a54){return this['channel']['error'](_0x210e8b,_0xddff('0x13e'));}for(var _0x2ac7d9=0x0;_0x2ac7d9<_0x435a54[_0xddff('0x9b')];_0x2ac7d9+=0x1){var _0x3a78b6=this[_0xddff('0xc')][_0xddff('0x10')](util[_0xddff('0x28')](_0xddff('0x13f'),_0x435a54[_0x2ac7d9]));if(_0x3a78b6[_0xddff('0xa4')]===-0x1){return _0x3a78b6;}logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x140'),_0x435a54[_0x2ac7d9],_0x3a78b6[_0xddff('0xa2')]));if(_0x3a78b6[_0xddff('0xa2')]==='true'){logger['info'](util[_0xddff('0x28')]('IFTIME\x20%s\x20%s',_0x435a54[_0x2ac7d9],'true'));this['channel'][_0xddff('0xaa')](util['format'](_0xddff('0x140'),_0x435a54[_0x2ac7d9],_0xddff('0x13a')));return{'code':0xc8,'result':'true'};}else{logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x140'),_0x435a54[_0x2ac7d9],_0xddff('0x13b')));this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0x140'),_0x435a54[_0x2ac7d9],_0xddff('0x13b')));}}return{'code':0xc8,'result':_0xddff('0x13b')};};AGIVertices[_0xddff('0xf')][_0xddff('0x141')]=function(_0x1d15fd){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x142'),_0x1d15fd['label']));return this[_0xddff('0xc')][_0xddff('0x141')]();};AGIVertices[_0xddff('0xf')][_0xddff('0x143')]=function(_0x47ca70){logger[_0xddff('0x2d')](util['format'](_0xddff('0x144'),_0x47ca70[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x47ca70[_0xddff('0x7b')])){return this['channel'][_0xddff('0xaa')](_0xddff('0xe7'));}var _0x136025=_0xddff('0x128');var _0x4d4e15=util[_0xddff('0x28')](_0xddff('0x145'),FILES_PATH,rs[_0xddff('0x112')](0x4));var _0x3afbbc=util['format']('%s.%s',_0x4d4e15,_0x136025);var _0x15ec19=!![];if(_0x47ca70[_0xddff('0x12f')]===_0xddff('0x129')){_0x15ec19=![];}var _0x84c8de=this[_0xddff('0xc')][_0xddff('0x12a')](_0x4d4e15,_0x136025,_0x47ca70['intKey'],_0x47ca70[_0xddff('0x64')],undefined,_0x15ec19);if(_0x84c8de[_0xddff('0xa4')]!==-0x1){this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')]('ispeech\x20%s\x20file\x20created',_0x3afbbc));var _0xa6250f=this[_0xddff('0x146')][_0xddff('0x6f')](this,_0x47ca70,_0x3afbbc);if(_0xa6250f){for(var _0x16a028 in _0xa6250f){if(_0xa6250f[_0xddff('0x99')](_0x16a028)){this[_0xddff('0xc')][_0xddff('0xa0')](util['format'](_0xddff('0x147'),_0x16a028[_0xddff('0x68')]()),_0xa6250f[_0x16a028]);}}return this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0xa6250f)));}}return _0x84c8de;};AGIVertices[_0xddff('0xf')]['ispeechtts']=function(_0x3c4c7d){logger['info'](util[_0xddff('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3c4c7d[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x3c4c7d[_0xddff('0x7b')])){return this[_0xddff('0xc')]['noop']('no\x20key\x20configured');}if(!this[_0xddff('0x86')](_0x3c4c7d[_0xddff('0x5b')])){return this['channel']['noop'](_0xddff('0xab'));}this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0x148'),_0x3c4c7d[_0xddff('0x5b')]));var _0x57cc61=this[_0xddff('0x82')][_0xddff('0x6f')](this,_0x3c4c7d);if(_0x57cc61){this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x149'),_0x57cc61));var _0x157e4d=this[_0xddff('0xc')][_0xddff('0x14a')](_0x57cc61,_0x3c4c7d[_0xddff('0x14b')]);try{fs[_0xddff('0xfe')](_0x57cc61+'.wav');}catch(_0x3e6394){logger[_0xddff('0x2b')](_0x3e6394);}return _0x157e4d;}return this['channel'][_0xddff('0x2b')](_0x3c4c7d,_0xddff('0x14c'));};AGIVertices[_0xddff('0xf')][_0xddff('0x14d')]=function(_0x2e31f7){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x14e'),_0x2e31f7[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x2e31f7[_0xddff('0x14f')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x2e31f7,_0xddff('0x150'));}logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x151'),this[_0xddff('0xc')][_0xddff('0x39')],_0x2e31f7[_0xddff('0x14f')]));var _0x47db2a=this[_0xddff('0x54')]['sync'](this,_0x2e31f7[_0xddff('0x14f')]);if(_0x47db2a){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xddff('0xc')][_0xddff('0x39')],_0x2e31f7[_0xddff('0x14f')]));this[_0xddff('0xc')][_0xddff('0xaa')](util['format'](_0xddff('0x152'),this[_0xddff('0xc')][_0xddff('0x39')],_0x2e31f7[_0xddff('0x14f')]));return{'code':0xc8,'result':_0xddff('0x153')};}else{logger['info'](util['format'](_0xddff('0x154'),this['channel']['callerid'],_0x2e31f7[_0xddff('0x14f')]));this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x154'),this[_0xddff('0xc')][_0xddff('0x39')],_0x2e31f7[_0xddff('0x14f')]));return{'code':0xc8,'result':_0xddff('0x155')};}};AGIVertices[_0xddff('0xf')][_0xddff('0x156')]=function(_0x5afca2){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x157'),_0x5afca2['label']));if(!this['isConfigured'](_0x5afca2[_0xddff('0x14f')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x5afca2,_0xddff('0x150'));}logger[_0xddff('0x2d')](util['format'](_0xddff('0x151'),this[_0xddff('0xc')][_0xddff('0x39')],_0x5afca2[_0xddff('0x14f')]));var _0x2db790=this[_0xddff('0x53')]['sync'](this,_0x5afca2[_0xddff('0x14f')]);if(_0x2db790){logger['info'](util[_0xddff('0x28')](_0xddff('0x152'),this['channel'][_0xddff('0x39')],_0x5afca2[_0xddff('0x14f')]));this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xddff('0xc')][_0xddff('0x39')],_0x5afca2[_0xddff('0x14f')]));return{'code':0xc8,'result':_0xddff('0x153')};}else{logger[_0xddff('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xddff('0x39')],_0x5afca2[_0xddff('0x14f')]));this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x154'),this[_0xddff('0xc')][_0xddff('0x39')],_0x5afca2[_0xddff('0x14f')]));return{'code':0xc8,'result':_0xddff('0x155')};}};AGIVertices['prototype'][_0xddff('0x158')]=function(_0x212cfe){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x159'),_0x212cfe['label']));if(!this[_0xddff('0x86')](_0x212cfe[_0xddff('0x15a')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x212cfe,'no\x20operation\x20configured');}this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x15b'),_0x212cfe[_0xddff('0x15a')]));var _0x31cccf=eval(_0x212cfe[_0xddff('0x15a')]);if(!this[_0xddff('0x86')](_0x212cfe[_0xddff('0xd6')])){return this['channel'][_0xddff('0xaa')](_0xddff('0xd7'));}var _0x249e74=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x212cfe[_0xddff('0xd6')]);if(!_0x249e74){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x212cfe,_0xddff('0xd8'));}if(_['isArray'](_0x31cccf)){var _0x4de3e6=this;_0x31cccf[_0xddff('0xda')](function(_0x235484,_0x17aa08){_0x4de3e6['channel'][_0xddff('0xa0')](util[_0xddff('0x28')]('%s[%s]',_0x249e74,_0x17aa08),_0x235484);});return this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0x15c'),_0x249e74));}else{return this[_0xddff('0xc')]['setVariable'](_0x249e74,_0x31cccf);}};AGIVertices[_0xddff('0xf')][_0xddff('0xb')]=function(_0x2b5532){logger['info'](util['format'](_0xddff('0x15d'),_0x2b5532[_0xddff('0x37')]));if(_0x2b5532[_0xddff('0xa6')]===0x0){return this['maxRetry'](_0x2b5532);}_0x2b5532[_0xddff('0xa6')]-=0x1;if(!this[_0xddff('0x86')](_0x2b5532[_0xddff('0x10c')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x2b5532,'no\x20file\x20audio\x20selected');}var _0x330e10=this[_0xddff('0x1e')][_0xddff('0x6f')](this,_0x2b5532[_0xddff('0x10c')]);if(!_0x330e10){return this[_0xddff('0xc')]['error'](_0x2b5532,_0xddff('0x15e'));}var _0x4e207c=this[_0xddff('0xc')]['getData'](_0x330e10,_0x2b5532[_0xddff('0x10e')],_0x2b5532[_0xddff('0x15f')]);var _0x17863c=_0x4e207c[_0xddff('0xa4')];if(_0x4e207c[_0xddff('0xa4')]===-0x1){this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x2b5532,'-1');return _0x4e207c;}else if(_0x4e207c[_0xddff('0xa2')]===_0xddff('0x64')){_0x4e207c[_0xddff('0xa4')]=_0x4e207c[_0xddff('0xa4')]['length']>0x0?_0x4e207c[_0xddff('0xa4')]:'t';}else if(_[_0xddff('0x46')](_0x4e207c['result'])){_0x4e207c[_0xddff('0xa4')]='#';_0x17863c='#';}if(!this['isConfigured'](_0x2b5532[_0xddff('0xd6')])){this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0xd7'));}else{var _0x2abf1f=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x2b5532[_0xddff('0xd6')]);if(!_0x2abf1f){return this['channel'][_0xddff('0x2b')](_0x2b5532,_0xddff('0xd8'));}this['channel']['setVariable'](_0x2abf1f,_0x17863c);}this['createSquareDetailsReport'][_0xddff('0x6f')](this,_0x2b5532,_0x17863c);return _0x4e207c;};AGIVertices[_0xddff('0xf')][_0xddff('0xaa')]=function(_0xb5105f){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xb5105f[_0xddff('0x37')]));return this['channel']['noop'](_0xb5105f[_0xddff('0x160')]||_0xb5105f[_0xddff('0x37')]);};AGIVertices[_0xddff('0xf')]['pause']=function(_0x1f43f4){logger[_0xddff('0x2d')](util['format'](_0xddff('0x161'),_0x1f43f4[_0xddff('0x37')]));if(!this['isConfigured'](_0x1f43f4['findBy'])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x1f43f4,'no\x20find\x20by\x20configured');}logger[_0xddff('0x2d')](util[_0xddff('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xddff('0xc')]['callerid'],_0x1f43f4['findBy']));var _0x3b98bf=this['getPause']['sync'](this,_0x1f43f4[_0xddff('0x162')]);var _0x1b2f1a=this[_0xddff('0x50')]['sync'](this,_0x1f43f4[_0xddff('0x14f')],_0x3b98bf);if(_0x1b2f1a){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x152'),this[_0xddff('0xc')][_0xddff('0x39')],_0x1f43f4[_0xddff('0x14f')]));this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0x152'),this['channel'][_0xddff('0x39')],_0x1f43f4[_0xddff('0x14f')]));return{'code':0xc8,'result':_0xddff('0x153')};}else{logger[_0xddff('0x2d')](util['format'](_0xddff('0x154'),this[_0xddff('0xc')]['callerid'],_0x1f43f4[_0xddff('0x14f')]));this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x152'),this[_0xddff('0xc')][_0xddff('0x39')],_0x1f43f4['findBy']));return{'code':0xc8,'result':_0xddff('0x155')};}};AGIVertices[_0xddff('0xf')][_0xddff('0x163')]=function(_0x5c1cdc){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x164'),_0x5c1cdc[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x5c1cdc[_0xddff('0x10c')])){return this['channel'][_0xddff('0x2b')](_0x5c1cdc,'no\x20file\x20audio\x20selected');}var _0x4f2bc3=this[_0xddff('0x1e')]['sync'](this,_0x5c1cdc[_0xddff('0x10c')]);if(!_0x4f2bc3){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x5c1cdc,_0xddff('0x15e'));}var _0x38a3ce=this[_0xddff('0xc')][_0xddff('0x58')](_0xddff('0x165'),[_0x4f2bc3,_0x5c1cdc['opts']]);if(_0x38a3ce[_0xddff('0xa4')]===-0x1){return _0x38a3ce;}return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xc4'),_0xddff('0x165'),_0x4f2bc3));};AGIVertices[_0xddff('0xf')][_0xddff('0x166')]=function(_0x2eb984){logger['info'](util['format'](_0xddff('0x167'),_0x2eb984[_0xddff('0x37')]));if(!this['isConfigured'](_0x2eb984[_0xddff('0x168')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x2eb984,_0xddff('0x169'));}var _0x4cd77d='';var _0x1dbb83=parseInt(_0x2eb984[_0xddff('0x168')],0xa);if(isNaN(_0x1dbb83)){_0x4cd77d=_0x2eb984[_0xddff('0x168')];}else{_0x4cd77d=this[_0xddff('0x16a')][_0xddff('0x6f')](this,_0x2eb984[_0xddff('0x168')]);if(!_0x4cd77d){return this['channel'][_0xddff('0x2b')](_0x2eb984,_0xddff('0x16b'));}}var _0x3cfd08='';if(this[_0xddff('0x86')](_0x2eb984['file_id'])){var _0x2c7e4d=this[_0xddff('0x1e')][_0xddff('0x6f')](this,_0x2eb984['file_id']);if(_0x2c7e4d){_0x3cfd08=_0x2c7e4d;}}this['createSquareDetailsReport'][_0xddff('0x6f')](this,_0x2eb984,_0x4cd77d);if(_0x2eb984['opts'][_0xddff('0x16c')]('x')<0x0){_0x2eb984[_0xddff('0xe4')]+='x';}if(_0x2eb984['opts'][_0xddff('0x16c')]('X')<0x0){_0x2eb984[_0xddff('0xe4')]+='X';}this[_0xddff('0xc')][_0xddff('0xa0')](_0xddff('0x16d'),_0x4cd77d?_0x4cd77d[_0xddff('0x16e')]():'');var _0x230fba=this[_0xddff('0xc')][_0xddff('0x58')](_0xddff('0x16f'),[_0x4cd77d,_0x2eb984[_0xddff('0xe4')],_0x2eb984[_0xddff('0x72')],_0x3cfd08,_0x2eb984[_0xddff('0x64')],_0x2eb984[_0xddff('0x7')],_0x2eb984[_0xddff('0x170')],_0x2eb984['gosub'],'',_0x2eb984[_0xddff('0x171')]]);if(_0x230fba[_0xddff('0xa4')]===-0x1){return _0x230fba;}return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xc4'),_0xddff('0x16f'),_0x4cd77d));};AGIVertices[_0xddff('0xf')][_0xddff('0x172')]=function(_0x59a01c){logger[_0xddff('0x2d')](util['format'](_0xddff('0x173'),_0x59a01c[_0xddff('0x37')]));var _0x53e973=_0x59a01c[_0xddff('0x174')]||'wav';var _0x4c5245=util['format']('%s_%s',this[_0xddff('0xc')][_0xddff('0x3b')],rs[_0xddff('0x112')](0x5));var _0x4df0da=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x4c5245,_0x53e973);var _0x384fc8=util[_0xddff('0x28')](_0xddff('0x145'),FILES_PATH,_0x4c5245);this[_0xddff('0x3a')][_0xddff('0x6f')](this,_0x59a01c,_0x4c5245,_0x4df0da);this['channel'][_0xddff('0xa0')](_0xddff('0x175'),_0x4c5245);logger[_0xddff('0x2d')](_0xddff('0x176'),_0x384fc8,_0x53e973,_0x59a01c[_0xddff('0x177')],_0x59a01c[_0xddff('0x64')]);return this[_0xddff('0xc')][_0xddff('0x12a')](_0x384fc8,_0x53e973,_0x59a01c[_0xddff('0x177')],_0x59a01c[_0xddff('0x64')],undefined,!![]);};AGIVertices['prototype'][_0xddff('0x178')]=function(_0x570ce2){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x179'),_0x570ce2[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x570ce2[_0xddff('0x72')])){return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0x17a'));}var _0x21eb06=this[_0xddff('0x62')][_0xddff('0x6f')](this,_0x570ce2);logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x17b'),util[_0xddff('0x17c')](_0x21eb06,{'showHidden':![],'depth':null})));if(!this[_0xddff('0x86')](_0x570ce2[_0xddff('0xd6')])){return this['channel'][_0xddff('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x141587=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x570ce2[_0xddff('0xd6')]);if(!_0x141587){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x570ce2,'no\x20variable\x20found');}this[_0xddff('0xc')][_0xddff('0xa0')](util[_0xddff('0x28')](_0xddff('0x17d'),_0x141587),_0x21eb06[_0xddff('0x76')]?_0x21eb06[_0xddff('0x76')]:_0xddff('0x17e'));this[_0xddff('0xc')][_0xddff('0xa0')](util[_0xddff('0x28')](_0xddff('0x17f'),_0x141587),_0x21eb06[_0xddff('0x75')]?_0x21eb06[_0xddff('0x75')]:'OK');if(_0x21eb06[_0xddff('0x69')]){try{this['saveRestApiResult'](_0x21eb06[_0xddff('0x69')],_0x141587);}catch(_0x11c512){logger[_0xddff('0x2b')](util[_0xddff('0x28')](_0xddff('0x180'),_0x141587));}}return this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0xdb'),_0x141587));};AGIVertices['prototype'][_0xddff('0x181')]=function(_0x504161){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x182'),_0x504161[_0xddff('0x37')]));return this[_0xddff('0xc')]['sayDigits'](_0x504161[_0xddff('0x183')][_0xddff('0xd4')](/\s+/g,''),_0x504161[_0xddff('0x177')]);};AGIVertices[_0xddff('0xf')][_0xddff('0x184')]=function(_0x5a043a){logger['info'](util[_0xddff('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5a043a[_0xddff('0x37')]));return this[_0xddff('0xc')]['sayNumber'](_0x5a043a[_0xddff('0x65')][_0xddff('0xd4')](/\s+/g,''),_0x5a043a[_0xddff('0x177')]);};AGIVertices[_0xddff('0xf')][_0xddff('0x185')]=function(_0x4a8980){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4a8980[_0xddff('0x37')]));return this['channel'][_0xddff('0x186')](_0x4a8980[_0xddff('0x5b')],_0x4a8980[_0xddff('0x177')]);};AGIVertices['prototype'][_0xddff('0x187')]=function(_0x3baac0){logger['info'](util[_0xddff('0x28')](_0xddff('0x188'),_0x3baac0[_0xddff('0x37')]));if(!this['isConfigured'](_0x3baac0[_0xddff('0x189')])){return this[_0xddff('0xc')]['noop'](_0xddff('0x18a'));}var _0xeb4a62=this[_0xddff('0x18b')][_0xddff('0x6f')](this,_0x3baac0[_0xddff('0x189')]);if(!_0xeb4a62||!_0xeb4a62[_0xddff('0x18c')]){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x3baac0,_0xddff('0x18d'));}var _0x37e7db={'from':util[_0xddff('0x28')](_0xddff('0x18e'),_0xeb4a62[_0xddff('0x13')],_0xeb4a62[_0xddff('0x18f')]||_0xeb4a62['Smtp']['user']),'to':_0x3baac0['to']||'','cc':_0x3baac0['cc']||'','bcc':_0x3baac0['bcc']||'','subject':_0x3baac0[_0xddff('0x190')],'html':_0x3baac0[_0xddff('0x5b')],'text':_0x3baac0[_0xddff('0x5b')]};var _0x6e5a={'tls':{'rejectUnauthorized':![]}};if(_0xeb4a62[_0xddff('0x18c')][_0xddff('0x191')]){_0x6e5a['service']=_0xeb4a62[_0xddff('0x18c')][_0xddff('0x191')];}else{_0x6e5a[_0xddff('0x192')]=_0xeb4a62[_0xddff('0x18c')]['host'];_0x6e5a['port']=_0xeb4a62[_0xddff('0x18c')][_0xddff('0x193')];_0x6e5a[_0xddff('0x194')]=_0xeb4a62['Smtp'][_0xddff('0x194')];}if(_0xeb4a62[_0xddff('0x18c')]['authentication']){_0x6e5a[_0xddff('0x195')]={'user':_0xeb4a62[_0xddff('0x18c')]['user'],'pass':_0xeb4a62[_0xddff('0x18c')]['pass']};}if(this[_0xddff('0x86')](_0x3baac0[_0xddff('0x196')])){}logger[_0xddff('0xdd')](_0xddff('0x197'),JSON['stringify'](_0x37e7db));this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x3baac0,_0x3baac0[_0xddff('0x189')]);this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x198'),_0xeb4a62[_0xddff('0x13')]));this[_0xddff('0x22')][_0xddff('0x6f')](this,_0x6e5a,_0x37e7db);return this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0x199'));};AGIVertices['prototype'][_0xddff('0x19a')]=function(_0x3e2d62){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x19b'),_0x3e2d62[_0xddff('0x37')]));return this[_0xddff('0xc')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xddff('0xf')]['sendSMS']=function(_0x526246){logger[_0xddff('0x2d')](util[_0xddff('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x526246[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x526246[_0xddff('0x19c')])){return this['channel'][_0xddff('0xaa')](_0xddff('0x19d'));}var _0x1cc2e9=this[_0xddff('0x33')][_0xddff('0x6f')](this,_0x526246[_0xddff('0x19c')]);if(!_0x1cc2e9){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x526246,_0xddff('0x19e'));}var _0x3cede4={'body':_0x526246['sms_text'],'phone':_0x526246['to']||'','SmsAccountId':_0x1cc2e9['id']};logger[_0xddff('0xdd')](_0xddff('0x19f'),JSON[_0xddff('0x73')](_0x3cede4));this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x526246,_0x526246['sms_account_id']);this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1cc2e9[_0xddff('0x13')]));this[_0xddff('0x35')]['sync'](this,_0x3cede4);return this['channel']['noop'](_0xddff('0x1a0'));};AGIVertices[_0xddff('0xf')][_0xddff('0x1a1')]=function(_0x228b6d){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x1a2'),_0x228b6d[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x228b6d[_0xddff('0xd6')])){return this[_0xddff('0xc')]['error'](_0x228b6d,_0xddff('0x1a3'));}var _0x1a70b3=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x228b6d[_0xddff('0xd6')]);if(!_0x1a70b3){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x228b6d,'no\x20variable\x20found');}return this['channel'][_0xddff('0xa0')](_0x1a70b3,_0x228b6d[_0xddff('0x1a4')]);};AGIVertices[_0xddff('0xf')][_0xddff('0x1a5')]=function(_0x44bd38){logger[_0xddff('0x2d')](util['format'](_0xddff('0x1a6'),_0x44bd38[_0xddff('0x37')]));this['channel'][_0xddff('0xaa')](_0xddff('0x1a7'));if(_0x44bd38[_0xddff('0xbb')]==='yes'){this[_0xddff('0xc')][_0xddff('0xaa')](_0xddff('0x1a8'));return this['channel'][_0xddff('0xbb')]();}return this['channel'][_0xddff('0xaa')]('Skipped\x20Answer');};AGIVertices[_0xddff('0xf')][_0xddff('0x1a9')]=function(_0x49a7f4){logger['info'](util['format'](_0xddff('0x1aa'),_0x49a7f4['label']));if(!this[_0xddff('0x86')](_0x49a7f4[_0xddff('0x1ab')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x49a7f4,_0xddff('0x1ac'));}var _0x1c809a=this['getSquareProject']['sync'](this,_0x49a7f4[_0xddff('0x1ab')]);if(!this[_0xddff('0x86')](_0x1c809a)){return this['channel'][_0xddff('0x2b')](_0x49a7f4,util[_0xddff('0x28')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x49a7f4[_0xddff('0x1ab')]));}if(_0x1c809a===this['channel'][_0xddff('0x38')]){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x49a7f4,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0xddff('0x6f')](this,_0x49a7f4,_0x1c809a);var _0x1e82e6=this[_0xddff('0xc')]['exec'](_0xddff('0x1ad'),util[_0xddff('0x28')](_0xddff('0x1ae'),config[_0xddff('0x7')][_0xddff('0x192')]||_0xddff('0x1af'),_0x1c809a,this[_0xddff('0xc')][_0xddff('0x38')]));if(_0x1e82e6[_0xddff('0xa4')]===-0x1){return _0x1e82e6;}return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xc4'),_0xddff('0x1ad'),_0x1c809a));};AGIVertices[_0xddff('0xf')]['system']=function(_0x560c90){logger['info'](util[_0xddff('0x28')](_0xddff('0x1b0'),_0x560c90['label']));var _0x228c64=this['shellCommand'][_0xddff('0x6f')](this,_0x560c90[_0xddff('0xb9')]);this[_0xddff('0x36')][_0xddff('0x6f')](this,_0x560c90,_0x560c90['command']);if(this[_0xddff('0x86')](_0x560c90['variable_id'])){var _0x55e31c=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x560c90[_0xddff('0xd6')]);if(_0x55e31c){this[_0xddff('0xc')][_0xddff('0xa0')](_0x55e31c,_0x228c64);return this[_0xddff('0xc')][_0xddff('0xaa')](util['format'](_0xddff('0x1b1'),_0x560c90[_0xddff('0xb9')],_0x55e31c));}}return this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x560c90['command']));};AGIVertices['prototype'][_0xddff('0x1b2')]=function(_0x14cfa5){logger[_0xddff('0x2d')](util['format'](_0xddff('0x1b3'),_0x14cfa5[_0xddff('0x37')]));_0x14cfa5['text']=_0x14cfa5[_0xddff('0x5b')][_0xddff('0xd4')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xddff('0x86')](_0x14cfa5[_0xddff('0x1b4')])){return this['channel'][_0xddff('0xaa')](_0xddff('0x1b5'));}if(!this['isConfigured'](_0x14cfa5[_0xddff('0x5b')])){return this[_0xddff('0xc')]['noop'](_0xddff('0xab'));}this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0x1b6'),_0x14cfa5['text']));var _0x19604d=this[_0xddff('0x59')]['sync'](this,_0x14cfa5);if(_0x19604d){this['channel']['noop'](util[_0xddff('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x19604d));var _0x3df67b=this[_0xddff('0xc')][_0xddff('0x14a')](_0x19604d);try{fs[_0xddff('0xfe')](_0x19604d+'.wav');}catch(_0x5d449b){logger[_0xddff('0x2b')](_0x5d449b);}return _0x3df67b;}return this[_0xddff('0xc')][_0xddff('0x2b')](_0x14cfa5,_0xddff('0x1b7'));};AGIVertices['prototype'][_0xddff('0x1b8')]=function(_0x4b1696){logger['info'](util[_0xddff('0x28')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4b1696[_0xddff('0x37')]));_0x4b1696[_0xddff('0x5b')]=_0x4b1696['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xddff('0x86')](_0x4b1696[_0xddff('0x5b')])){return this['channel']['noop'](_0xddff('0xab'));}this['channel']['noop'](util[_0xddff('0x28')](_0xddff('0x1b9'),_0x4b1696[_0xddff('0x5b')]));var _0x429e71=this[_0xddff('0x60')][_0xddff('0x6f')](this,_0x4b1696);if(_0x429e71){this[_0xddff('0xc')]['noop'](util[_0xddff('0x28')](_0xddff('0x1ba'),_0x429e71));var _0x5e247b=this[_0xddff('0xc')][_0xddff('0x14a')](_0x429e71);try{fs[_0xddff('0xfe')](_0x429e71+'.wav');}catch(_0x384bce){logger[_0xddff('0x2b')](_0x384bce);}return _0x5e247b;}return this['channel']['error'](_0x4b1696,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xddff('0x1bb')]=function(_0x5badf6){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x1bc'),_0x5badf6[_0xddff('0x37')]));if(!this[_0xddff('0x86')](_0x5badf6[_0xddff('0x14f')])){return this[_0xddff('0xc')][_0xddff('0x2b')](_0x5badf6,_0xddff('0x150'));}logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x151'),this[_0xddff('0xc')][_0xddff('0x39')],_0x5badf6['findBy']));var _0x5dced6=this[_0xddff('0x52')][_0xddff('0x6f')](this,_0x5badf6[_0xddff('0x14f')]);if(_0x5dced6){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x152'),this[_0xddff('0xc')][_0xddff('0x39')],_0x5badf6[_0xddff('0x14f')]));this[_0xddff('0xc')][_0xddff('0xaa')](util['format'](_0xddff('0x152'),this[_0xddff('0xc')][_0xddff('0x39')],_0x5badf6[_0xddff('0x14f')]));return{'code':0xc8,'result':_0xddff('0x153')};}else{logger['info'](util['format'](_0xddff('0x154'),this['channel'][_0xddff('0x39')],_0x5badf6[_0xddff('0x14f')]));this[_0xddff('0xc')][_0xddff('0xaa')](util[_0xddff('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xddff('0x39')],_0x5badf6[_0xddff('0x14f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xddff('0x1bd')]=function(_0x5405ce){logger[_0xddff('0x2d')](util[_0xddff('0x28')](_0xddff('0x1be'),_0x5405ce[_0xddff('0x37')]));var _0x2369c2=this[_0xddff('0xc')][_0xddff('0x58')](_0xddff('0x1bf'),[_0x5405ce[_0xddff('0x1c0')],_0x5405ce[_0xddff('0x79')]]);if(_0x2369c2[_0xddff('0xa4')]===-0x1){return _0x2369c2;}return this['channel'][_0xddff('0xaa')](util[_0xddff('0x28')](_0xddff('0xc4'),_0xddff('0x1bf'),_0x5405ce[_0xddff('0x1c0')]));};AGIVertices[_0xddff('0xf')][_0xddff('0x1c1')]=function(_0x268bc4){logger[_0xddff('0x2d')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x268bc4['label']));if(!this[_0xddff('0x86')](_0x268bc4[_0xddff('0xd6')])){return this[_0xddff('0xc')]['error'](_0x268bc4,_0xddff('0x1a3'));}var _0xaa7e7=this[_0xddff('0x10')][_0xddff('0x6f')](this,_0x268bc4[_0xddff('0xd6')]);if(!_0xaa7e7){return this[_0xddff('0xc')]['error'](_0x268bc4,_0xddff('0xd8'));}var _0x4edc4e=this['channel']['getVariable'](_0xaa7e7);return{'code':0xc8,'result':_0x4edc4e['extra']?_0x4edc4e[_0xddff('0xa2')]:'-'};};String[_0xddff('0xf')][_0xddff('0x1c2')]=function(_0x3a3f9e,_0x5d9897){return this[_0xddff('0xa1')](_0x3a3f9e)[_0xddff('0x1c3')](_0x5d9897);};module[_0xddff('0x1c4')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 11438a9..1ed3242 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 _0x8a01=['exports','lodash','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s'];(function(_0x172d16,_0x447212){var _0x4197c9=function(_0x59edb9){while(--_0x59edb9){_0x172d16['push'](_0x172d16['shift']());}};_0x4197c9(++_0x447212);}(_0x8a01,0x1af));var _0x18a0=function(_0x314ae6,_0x1f1af6){_0x314ae6=_0x314ae6-0x0;var _0xb31d45=_0x8a01[_0x314ae6];return _0xb31d45;};'use strict';var util=require('util');var _=require(_0x18a0('0x0'));var moment=require(_0x18a0('0x1'));var ami=require(_0x18a0('0x2'));var logger=require(_0x18a0('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x18a0('0x4'));function Acw(_0xbc1eec){this[_0x18a0('0x5')]=_0xbc1eec[_0x18a0('0x5')];this[_0x18a0('0x6')]=_0xbc1eec[_0x18a0('0x6')];this['timers']=_0xbc1eec[_0x18a0('0x7')];this[_0x18a0('0x8')]={};ami['on'](_0x18a0('0x9'),this['syncAgentConnect'][_0x18a0('0xa')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on']('hangup',this[_0x18a0('0xb')][_0x18a0('0xa')](this));ami['on'](_0x18a0('0xc'),this[_0x18a0('0xd')][_0x18a0('0xa')](this));ami['on'](_0x18a0('0xe'),this[_0x18a0('0xf')]['bind'](this));ami['on'](_0x18a0('0x10'),this[_0x18a0('0x11')][_0x18a0('0xa')](this));ami['on'](_0x18a0('0x12'),this[_0x18a0('0x13')][_0x18a0('0xa')](this));}function getDiff(_0x82650c){var _0x5d158d=moment()[_0x18a0('0x14')](0x0);var _0x3890a9=moment(_0x82650c)[_0x18a0('0x14')](0x0);return _0x5d158d[_0x18a0('0x15')](_0x3890a9,_0x18a0('0x16'));}Acw['prototype'][_0x18a0('0x17')]=function(_0x4f0eeb){try{var _0x487cd5=this;var _0x243213=this[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x18')];var _0x355ccf=this[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x19')];var _0x8a4266=this[_0x18a0('0x5')][_0x355ccf];var _0x1fd201=![];var _0x450fd1=_0x18a0('0x1a');if(_0x8a4266[_0x18a0('0x1b')]){if(_0x8a4266[_0x18a0('0x1c')][_0x18a0('0x1d')]){_0x1fd201=!![];_0x450fd1=_0x8a4266[_0x18a0('0x1c')][_0x18a0('0x1d')];}}ami['Action']({'action':_0x18a0('0x1e'),'interface':_0x243213,'paused':!![],'reason':_0x450fd1})[_0x18a0('0x1f')](function(_0x24f33c){if(_0x487cd5['agents'][_0x243213]){return RpcUser[_0x18a0('0x20')](_0x487cd5[_0x18a0('0x6')][_0x243213]['id'])['then'](function(_0x12948a){if(_0x12948a&&!_0x12948a[_0x18a0('0x21')]){logger[_0x18a0('0x22')](_0x18a0('0x23'),_0x4f0eeb,_0x243213,_0x355ccf);var _0x16a951=_0x487cd5[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x24')]&&_0x487cd5[_0x18a0('0x8')][_0x4f0eeb]['destlinkedid']?_0x487cd5[_0x18a0('0x8')][_0x4f0eeb][_0x18a0('0x25')]:_0x4f0eeb;return RpcUser[_0x18a0('0x26')](_0x487cd5[_0x18a0('0x6')][_0x243213],_0x450fd1,_0x16a951)['then'](function(_0x2d0845){if(!_0x1fd201){_0x487cd5[_0x18a0('0x7')][_0x243213]={};logger[_0x18a0('0x22')](_0x18a0('0x27'),_0x4f0eeb,_0x487cd5['voiceQueues'][_0x355ccf]['acwTimeout'],_0x243213,_0x355ccf);_0x487cd5[_0x18a0('0x7')][_0x243213]['timer']=setTimeout(_0x487cd5[_0x18a0('0x28')][_0x18a0('0xa')](_0x487cd5,_0x243213),_0x487cd5['voiceQueues'][_0x355ccf][_0x18a0('0x29')]*0x3e8);_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2a')]=moment()[_0x18a0('0x2b')](_0x18a0('0x2c'));_0x487cd5['timers'][_0x243213][_0x18a0('0x2d')]=_0x4f0eeb;_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x19')]=_0x355ccf;_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2e')]=function(){var _0x3e68f1=getDiff(_0x487cd5['timers'][_0x243213][_0x18a0('0x2a')]);clearTimeout(_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2f')]);_0x487cd5[_0x18a0('0x7')][_0x243213]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3e68f1},_0x487cd5[_0x18a0('0x7')][_0x243213][_0x18a0('0x2d')],_0x243213)[_0x18a0('0x1f')](function(_0xd9b8fe){logger[_0x18a0('0x22')](_0x18a0('0x30'),_0x4f0eeb,_0x3e68f1,_0xd9b8fe);})[_0x18a0('0x31')](function(_0x5e0dea){logger[_0x18a0('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x4f0eeb,_0x5e0dea);});delete _0x487cd5[_0x18a0('0x7')][_0x243213];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4f0eeb,_0x243213,_0x355ccf);}});}})[_0x18a0('0x31')](function(_0x6fb68a){logger['error'](_0x18a0('0x27'),_0x4f0eeb,_0x487cd5[_0x18a0('0x5')][_0x355ccf][_0x18a0('0x29')],_0x243213,_0x355ccf);})[_0x18a0('0x33')](function(){delete _0x487cd5[_0x18a0('0x8')][_0x4f0eeb];});}catch(_0x4f2d37){logger[_0x18a0('0x32')]('[ACW][START]\x20%s',_0x4f2d37[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')]['stopAcw']=function(_0xf876ae){try{var _0x29c8f7=this;if(_0x29c8f7['timers'][_0xf876ae]){_0x29c8f7[_0x18a0('0x7')][_0xf876ae][_0x18a0('0x2f')]=![];var _0x1eb502=_0x29c8f7[_0x18a0('0x7')][_0xf876ae][_0x18a0('0x2d')];var _0x5b0bc9=_0x29c8f7[_0x18a0('0x7')][_0xf876ae][_0x18a0('0x19')];var _0x1d863b=_0x29c8f7[_0x18a0('0x5')][_0x5b0bc9][_0x18a0('0x29')];logger[_0x18a0('0x22')](_0x18a0('0x36'),_0x1eb502,_0xf876ae);RpcUser[_0x18a0('0x37')](this[_0x18a0('0x6')][_0xf876ae]);RpcVoiceAgentReport[_0x18a0('0x38')]({'acwtime':_0x1d863b,'agentacw':!![]},_0x1eb502,_0xf876ae)['then'](function(_0x224ee0){logger[_0x18a0('0x22')](_0x18a0('0x30'),_0x1eb502,_0x1d863b,_0x224ee0);})[_0x18a0('0x31')](function(_0x1c0417){logger[_0x18a0('0x32')](_0x18a0('0x39'),_0x1eb502,_0x1c0417);});}else{logger[_0x18a0('0x32')](_0x18a0('0x3a'),_0xf876ae);if(_0x29c8f7['timers']){logger[_0x18a0('0x22')](_0x18a0('0x3b'),JSON[_0x18a0('0x3c')](_0x29c8f7[_0x18a0('0x7')]));}}}catch(_0x84732e){logger[_0x18a0('0x32')](_0x18a0('0x3d'),_0x84732e[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')][_0x18a0('0x3e')]=function(_0x108fff){try{if(this[_0x18a0('0x5')][_0x108fff[_0x18a0('0x19')]]&&(this[_0x18a0('0x5')][_0x108fff[_0x18a0('0x19')]][_0x18a0('0x3f')]||this[_0x18a0('0x5')][_0x108fff[_0x18a0('0x19')]]['mandatoryDisposition'])){if(this[_0x18a0('0x6')][_0x108fff[_0x18a0('0x18')]]){this[_0x18a0('0x8')][_0x108fff[_0x18a0('0x2d')]]={'queue':_0x108fff['queue'],'interface':_0x108fff[_0x18a0('0x18')],'destlinkedid':_0x108fff[_0x18a0('0x25')]};}}}catch(_0x221598){logger[_0x18a0('0x32')]('[ACW][syncAgentConnect]\x20%s',_0x221598[_0x18a0('0x34')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x2b033f){try{if(this[_0x18a0('0x5')][_0x2b033f[_0x18a0('0x19')]]&&(this[_0x18a0('0x5')][_0x2b033f['queue']][_0x18a0('0x3f')]||this[_0x18a0('0x5')][_0x2b033f[_0x18a0('0x19')]][_0x18a0('0x1b')])){if(this[_0x18a0('0x6')][_0x2b033f[_0x18a0('0x18')]]){this[_0x18a0('0x8')][_0x2b033f['uniqueid']]={'queue':_0x2b033f[_0x18a0('0x19')],'interface':_0x2b033f['interface']};}}}catch(_0x35fc26){logger[_0x18a0('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x35fc26[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')][_0x18a0('0x40')]=function(_0x187b60){try{if(this['channels'][_0x187b60[_0x18a0('0x2d')]]&&_[_0x18a0('0x41')](this[_0x18a0('0x8')][_0x187b60[_0x18a0('0x2d')]][_0x18a0('0x24')])){logger[_0x18a0('0x22')](_0x18a0('0x42'),_0x187b60[_0x18a0('0x2d')]);this[_0x18a0('0x17')](_0x187b60['uniqueid']);}else if(this[_0x18a0('0x8')][_0x187b60[_0x18a0('0x43')]]&&_[_0x18a0('0x41')](this['channels'][_0x187b60[_0x18a0('0x43')]][_0x18a0('0x24')])){logger['info'](_0x18a0('0x44'),_0x187b60[_0x18a0('0x43')]);this[_0x18a0('0x17')](_0x187b60[_0x18a0('0x43')]);}}catch(_0x5d8b49){logger[_0x18a0('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x5d8b49[_0x18a0('0x34')]);}};Acw['prototype']['syncHangup']=function(_0x2f4177){try{if(this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x2d')]]&&this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x2d')]][_0x18a0('0x24')]){logger[_0x18a0('0x22')](_0x18a0('0x45'),_0x2f4177['uniqueid']);this['startAcw'](_0x2f4177[_0x18a0('0x2d')]);}else if(this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x43')]]&&this[_0x18a0('0x8')][_0x2f4177[_0x18a0('0x43')]][_0x18a0('0x24')]){logger[_0x18a0('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2f4177[_0x18a0('0x43')]);this[_0x18a0('0x17')](_0x2f4177[_0x18a0('0x43')]);}}catch(_0x11926e){logger[_0x18a0('0x32')](_0x18a0('0x46'),_0x11926e['message']);}};Acw['prototype'][_0x18a0('0xf')]=function(_0x23c0d1){try{if(!_['isNil'](this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x47')]])){this[_0x18a0('0x17')](_0x23c0d1['transfereeuniqueid']);if(this[_0x18a0('0x8')][_0x23c0d1['secondtransfereruniqueid']]){this['channels'][_0x23c0d1[_0x18a0('0x48')]][_0x18a0('0x24')]=!![];this['channels'][_0x23c0d1[_0x18a0('0x49')]]=this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x48')]];delete this['channels'][_0x23c0d1['secondtransfereruniqueid']];}}else if(!_[_0x18a0('0x4a')](this[_0x18a0('0x8')][_0x23c0d1['transfertargetuniqueid']])){this[_0x18a0('0x17')](_0x23c0d1[_0x18a0('0x49')]);if(this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x4b')]]){this['channels'][_0x23c0d1[_0x18a0('0x4b')]][_0x18a0('0x24')]=!![];this[_0x18a0('0x8')][_0x23c0d1[_0x18a0('0x47')]]=this[_0x18a0('0x8')][_0x23c0d1['origtransfereruniqueid']];delete this['channels'][_0x23c0d1[_0x18a0('0x4b')]];}}}catch(_0x3ef262){logger[_0x18a0('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x3ef262[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')][_0x18a0('0x11')]=function(_0x58ceaf){try{if(this['channels'][_0x58ceaf['transfereruniqueid']]){logger[_0x18a0('0x22')](_0x18a0('0x4c'),JSON[_0x18a0('0x3c')](_0x58ceaf[_0x18a0('0x4d')]));this[_0x18a0('0x17')](_0x58ceaf[_0x18a0('0x4d')]);}else if(this[_0x18a0('0x8')][_0x58ceaf[_0x18a0('0x4e')]]){logger[_0x18a0('0x22')](_0x18a0('0x4f'),JSON[_0x18a0('0x3c')](_0x58ceaf[_0x18a0('0x4e')]));this[_0x18a0('0x17')](_0x58ceaf[_0x18a0('0x4e')]);}}catch(_0x327e07){logger['error'](_0x18a0('0x50'),_0x327e07[_0x18a0('0x34')]);}};Acw[_0x18a0('0x35')]['syncAgentRingNoAnswer']=function(_0x1af84f){try{if(this[_0x18a0('0x5')][_0x1af84f[_0x18a0('0x19')]]&&this[_0x18a0('0x5')][_0x1af84f['queue']][_0x18a0('0x51')]===_0x18a0('0x52')){if(this['agents'][_0x1af84f['interface']]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1af84f['uniqueid'],_0x1af84f[_0x18a0('0x18')],_0x1af84f['queue']);return RpcUser[_0x18a0('0x26')](this[_0x18a0('0x6')][_0x1af84f['interface']],_0x18a0('0x53'),_0x1af84f['uniqueid']);}}}catch(_0x4d3432){logger['error'](_0x18a0('0x54'),_0x4d3432[_0x18a0('0x34')]);}};module[_0x18a0('0x55')]=Acw; \ No newline at end of file +var _0xb155=['uniqueid','lastPauseAt','update','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','prototype','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/voiceAgentReport','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','startAcw','queue','ACW','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','voiceQueues','timer','stopAcw','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xb155,0xd9));var _0x5b15=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xb155[_0x39772f];return _0xc9edbf;};'use strict';var util=require(_0x5b15('0x0'));var _=require(_0x5b15('0x1'));var moment=require(_0x5b15('0x2'));var ami=require(_0x5b15('0x3'));var logger=require('../../../config/logger')(_0x5b15('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5b15('0x5'));function Acw(_0x4d1ac2){this['voiceQueues']=_0x4d1ac2['voiceQueues'];this[_0x5b15('0x6')]=_0x4d1ac2['agents'];this['timers']=_0x4d1ac2['timers'];this[_0x5b15('0x7')]={};ami['on'](_0x5b15('0x8'),this[_0x5b15('0x9')][_0x5b15('0xa')](this));ami['on'](_0x5b15('0xb'),this[_0x5b15('0xc')][_0x5b15('0xa')](this));ami['on'](_0x5b15('0xd'),this[_0x5b15('0xe')][_0x5b15('0xa')](this));ami['on'](_0x5b15('0xf'),this[_0x5b15('0x10')]['bind'](this));ami['on'](_0x5b15('0x11'),this[_0x5b15('0x12')]['bind'](this));ami['on'](_0x5b15('0x13'),this[_0x5b15('0x14')][_0x5b15('0xa')](this));ami['on'](_0x5b15('0x15'),this[_0x5b15('0x16')][_0x5b15('0xa')](this));}function getDiff(_0x33f8d9){var _0x11a10a=moment()[_0x5b15('0x17')](0x0);var _0x5de402=moment(_0x33f8d9)[_0x5b15('0x17')](0x0);return _0x11a10a['diff'](_0x5de402,_0x5b15('0x18'));}Acw['prototype'][_0x5b15('0x19')]=function(_0x317876){try{var _0x2db023=this;var _0x1aed74=this[_0x5b15('0x7')][_0x317876]['interface'];var _0x47bd70=this[_0x5b15('0x7')][_0x317876][_0x5b15('0x1a')];var _0xc75749=this['voiceQueues'][_0x47bd70];var _0x44f660=![];var _0x28dbdf=_0x5b15('0x1b');if(_0xc75749['mandatoryDisposition']){if(_0xc75749[_0x5b15('0x1c')]['name']){_0x44f660=!![];_0x28dbdf=_0xc75749[_0x5b15('0x1c')][_0x5b15('0x1d')];}}ami['Action']({'action':_0x5b15('0x1e'),'interface':_0x1aed74,'paused':!![],'reason':_0x28dbdf})[_0x5b15('0x1f')](function(_0x534dfb){if(_0x2db023[_0x5b15('0x6')][_0x1aed74]){return RpcUser[_0x5b15('0x20')](_0x2db023[_0x5b15('0x6')][_0x1aed74]['id'])[_0x5b15('0x1f')](function(_0x56496c){if(_0x56496c&&!_0x56496c[_0x5b15('0x21')]){logger[_0x5b15('0x22')](_0x5b15('0x23'),_0x317876,_0x1aed74,_0x47bd70);var _0x50b746=_0x2db023[_0x5b15('0x7')][_0x317876][_0x5b15('0x24')]&&_0x2db023[_0x5b15('0x7')][_0x317876][_0x5b15('0x25')]?_0x2db023['channels'][_0x317876][_0x5b15('0x25')]:_0x317876;return RpcUser[_0x5b15('0x26')](_0x2db023[_0x5b15('0x6')][_0x1aed74],_0x28dbdf,_0x50b746)['then'](function(_0xf4c3e5){if(!_0x44f660){_0x2db023[_0x5b15('0x27')][_0x1aed74]={};logger[_0x5b15('0x22')](_0x5b15('0x28'),_0x317876,_0x2db023[_0x5b15('0x29')][_0x47bd70]['acwTimeout'],_0x1aed74,_0x47bd70);_0x2db023[_0x5b15('0x27')][_0x1aed74][_0x5b15('0x2a')]=setTimeout(_0x2db023[_0x5b15('0x2b')][_0x5b15('0xa')](_0x2db023,_0x1aed74),_0x2db023[_0x5b15('0x29')][_0x47bd70][_0x5b15('0x2c')]*0x3e8);_0x2db023[_0x5b15('0x27')][_0x1aed74]['lastPauseAt']=moment()[_0x5b15('0x2d')](_0x5b15('0x2e'));_0x2db023[_0x5b15('0x27')][_0x1aed74][_0x5b15('0x2f')]=_0x317876;_0x2db023['timers'][_0x1aed74][_0x5b15('0x1a')]=_0x47bd70;_0x2db023[_0x5b15('0x27')][_0x1aed74]['updateAcw']=function(){var _0x2f794f=getDiff(_0x2db023[_0x5b15('0x27')][_0x1aed74][_0x5b15('0x30')]);clearTimeout(_0x2db023['timers'][_0x1aed74][_0x5b15('0x2a')]);_0x2db023[_0x5b15('0x27')][_0x1aed74][_0x5b15('0x2a')]=![];RpcVoiceAgentReport[_0x5b15('0x31')]({'acwtime':_0x2f794f},_0x2db023['timers'][_0x1aed74]['uniqueid'],_0x1aed74)[_0x5b15('0x1f')](function(_0x51c041){logger[_0x5b15('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x317876,_0x2f794f,_0x51c041);})[_0x5b15('0x32')](function(_0x544700){logger[_0x5b15('0x33')](_0x5b15('0x34'),_0x317876,_0x544700);});delete _0x2db023[_0x5b15('0x27')][_0x1aed74];};}});}else{logger[_0x5b15('0x22')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x317876,_0x1aed74,_0x47bd70);}});}})[_0x5b15('0x32')](function(_0x3ecbe4){logger[_0x5b15('0x33')](_0x5b15('0x28'),_0x317876,_0x2db023[_0x5b15('0x29')][_0x47bd70][_0x5b15('0x2c')],_0x1aed74,_0x47bd70);})['finally'](function(){delete _0x2db023[_0x5b15('0x7')][_0x317876];});}catch(_0x25d6f5){logger[_0x5b15('0x33')](_0x5b15('0x35'),_0x25d6f5[_0x5b15('0x36')]);}};Acw['prototype']['stopAcw']=function(_0x1b1e9c){try{var _0x650c7f=this;if(_0x650c7f[_0x5b15('0x27')][_0x1b1e9c]){_0x650c7f[_0x5b15('0x27')][_0x1b1e9c][_0x5b15('0x2a')]=![];var _0x11c9b3=_0x650c7f[_0x5b15('0x27')][_0x1b1e9c]['uniqueid'];var _0x1fe812=_0x650c7f[_0x5b15('0x27')][_0x1b1e9c][_0x5b15('0x1a')];var _0x1ccaae=_0x650c7f[_0x5b15('0x29')][_0x1fe812][_0x5b15('0x2c')];logger['info'](_0x5b15('0x37'),_0x11c9b3,_0x1b1e9c);RpcUser[_0x5b15('0x38')](this[_0x5b15('0x6')][_0x1b1e9c]);RpcVoiceAgentReport[_0x5b15('0x31')]({'acwtime':_0x1ccaae,'agentacw':!![]},_0x11c9b3,_0x1b1e9c)['then'](function(_0x2bd44a){logger[_0x5b15('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x11c9b3,_0x1ccaae,_0x2bd44a);})['catch'](function(_0x17741b){logger[_0x5b15('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x11c9b3,_0x17741b);});}else{logger[_0x5b15('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1b1e9c);if(_0x650c7f[_0x5b15('0x27')]){logger[_0x5b15('0x22')](_0x5b15('0x39'),JSON[_0x5b15('0x3a')](_0x650c7f[_0x5b15('0x27')]));}}}catch(_0x186bf5){logger[_0x5b15('0x33')](_0x5b15('0x3b'),_0x186bf5[_0x5b15('0x36')]);}};Acw['prototype'][_0x5b15('0x9')]=function(_0xccad94){try{if(this[_0x5b15('0x29')][_0xccad94[_0x5b15('0x1a')]]&&(this[_0x5b15('0x29')][_0xccad94[_0x5b15('0x1a')]]['acw']||this[_0x5b15('0x29')][_0xccad94[_0x5b15('0x1a')]]['mandatoryDisposition'])){if(this['agents'][_0xccad94[_0x5b15('0x3c')]]){this[_0x5b15('0x7')][_0xccad94[_0x5b15('0x2f')]]={'queue':_0xccad94[_0x5b15('0x1a')],'interface':_0xccad94[_0x5b15('0x3c')],'destlinkedid':_0xccad94[_0x5b15('0x25')]};}}}catch(_0x3f006f){logger[_0x5b15('0x33')](_0x5b15('0x3d'),_0x3f006f[_0x5b15('0x36')]);}};Acw[_0x5b15('0x3e')][_0x5b15('0x16')]=function(_0x13fc5d){try{if(this['voiceQueues'][_0x13fc5d[_0x5b15('0x1a')]]&&(this[_0x5b15('0x29')][_0x13fc5d[_0x5b15('0x1a')]]['acw']||this[_0x5b15('0x29')][_0x13fc5d['queue']][_0x5b15('0x3f')])){if(this[_0x5b15('0x6')][_0x13fc5d['interface']]){this[_0x5b15('0x7')][_0x13fc5d['uniqueid']]={'queue':_0x13fc5d[_0x5b15('0x1a')],'interface':_0x13fc5d[_0x5b15('0x3c')]};}}}catch(_0x586369){logger['error'](_0x5b15('0x40'),_0x586369['message']);}};Acw[_0x5b15('0x3e')]['syncHangupRequest']=function(_0x2c1217){try{if(this[_0x5b15('0x7')][_0x2c1217[_0x5b15('0x2f')]]&&_[_0x5b15('0x41')](this[_0x5b15('0x7')][_0x2c1217[_0x5b15('0x2f')]][_0x5b15('0x24')])){logger[_0x5b15('0x22')](_0x5b15('0x42'),_0x2c1217[_0x5b15('0x2f')]);this[_0x5b15('0x19')](_0x2c1217[_0x5b15('0x2f')]);}else if(this[_0x5b15('0x7')][_0x2c1217[_0x5b15('0x43')]]&&_['isUndefined'](this[_0x5b15('0x7')][_0x2c1217['linkedid']]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x2c1217['linkedid']);this[_0x5b15('0x19')](_0x2c1217[_0x5b15('0x43')]);}}catch(_0x17b92f){logger[_0x5b15('0x33')](_0x5b15('0x44'),_0x17b92f[_0x5b15('0x36')]);}};Acw[_0x5b15('0x3e')]['syncHangup']=function(_0x834112){try{if(this['channels'][_0x834112[_0x5b15('0x2f')]]&&this['channels'][_0x834112[_0x5b15('0x2f')]][_0x5b15('0x24')]){logger[_0x5b15('0x22')](_0x5b15('0x45'),_0x834112[_0x5b15('0x2f')]);this[_0x5b15('0x19')](_0x834112[_0x5b15('0x2f')]);}else if(this[_0x5b15('0x7')][_0x834112['linkedid']]&&this[_0x5b15('0x7')][_0x834112[_0x5b15('0x43')]][_0x5b15('0x24')]){logger['info'](_0x5b15('0x46'),_0x834112['linkedid']);this[_0x5b15('0x19')](_0x834112[_0x5b15('0x43')]);}}catch(_0x591dbc){logger[_0x5b15('0x33')](_0x5b15('0x47'),_0x591dbc[_0x5b15('0x36')]);}};Acw[_0x5b15('0x3e')][_0x5b15('0x12')]=function(_0x1a4dec){try{if(!_[_0x5b15('0x48')](this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x49')]])){this['startAcw'](_0x1a4dec['transfereeuniqueid']);if(this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x4a')]]){this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x4a')]][_0x5b15('0x24')]=!![];this['channels'][_0x1a4dec['transfertargetuniqueid']]=this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x4a')]];delete this[_0x5b15('0x7')][_0x1a4dec['secondtransfereruniqueid']];}}else if(!_[_0x5b15('0x48')](this['channels'][_0x1a4dec['transfertargetuniqueid']])){this[_0x5b15('0x19')](_0x1a4dec['transfertargetuniqueid']);if(this[_0x5b15('0x7')][_0x1a4dec['origtransfereruniqueid']]){this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x4b')]][_0x5b15('0x24')]=!![];this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x49')]]=this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x4b')]];delete this[_0x5b15('0x7')][_0x1a4dec[_0x5b15('0x4b')]];}}}catch(_0x10c60c){logger[_0x5b15('0x33')](_0x5b15('0x4c'),_0x10c60c[_0x5b15('0x36')]);}};Acw[_0x5b15('0x3e')][_0x5b15('0x14')]=function(_0x49b162){try{if(this['channels'][_0x49b162[_0x5b15('0x4d')]]){logger[_0x5b15('0x22')](_0x5b15('0x4e'),JSON[_0x5b15('0x3a')](_0x49b162[_0x5b15('0x4d')]));this[_0x5b15('0x19')](_0x49b162[_0x5b15('0x4d')]);}else if(this['channels'][_0x49b162[_0x5b15('0x4f')]]){logger[_0x5b15('0x22')](_0x5b15('0x50'),JSON[_0x5b15('0x3a')](_0x49b162[_0x5b15('0x4f')]));this[_0x5b15('0x19')](_0x49b162[_0x5b15('0x4f')]);}}catch(_0x5190a7){logger['error'](_0x5b15('0x51'),_0x5190a7['message']);}};Acw[_0x5b15('0x3e')][_0x5b15('0x10')]=function(_0x3b3d13){try{if(this[_0x5b15('0x29')][_0x3b3d13[_0x5b15('0x1a')]]&&this[_0x5b15('0x29')][_0x3b3d13[_0x5b15('0x1a')]][_0x5b15('0x52')]===_0x5b15('0x53')){if(this[_0x5b15('0x6')][_0x3b3d13[_0x5b15('0x3c')]]){logger[_0x5b15('0x22')](_0x5b15('0x54'),_0x3b3d13['uniqueid'],_0x3b3d13['interface'],_0x3b3d13['queue']);return RpcUser[_0x5b15('0x26')](this[_0x5b15('0x6')][_0x3b3d13['interface']],_0x5b15('0x55'),_0x3b3d13[_0x5b15('0x2f')]);}}}catch(_0x380396){logger['error'](_0x5b15('0x56'),_0x380396[_0x5b15('0x36')]);}};module[_0x5b15('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 1b60ee0..6fa4018 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x787fa,_0x2fd2b8){var _0x12cc98=function(_0x1d173e){while(--_0x1d173e){_0x787fa['push'](_0x787fa['shift']());}};_0x12cc98(++_0x2fd2b8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x9faff7,_0x59a564){_0x9faff7=_0x9faff7-0x0;var _0x4f8043=_0x0b0e[_0x9faff7];return _0x4f8043;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x107661,_0x40ba27){var _0x6db223=function(_0x932ce7){while(--_0x932ce7){_0x107661['push'](_0x107661['shift']());}};_0x6db223(++_0x40ba27);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 22cd312..4fda060 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x3c9def,_0x3f14db){var _0x211d29=function(_0x1bc22b){while(--_0x1bc22b){_0x3c9def['push'](_0x3c9def['shift']());}};_0x211d29(++_0x3f14db);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x594de8,_0x46d0d2){var _0x5fcbf=function(_0x48c215){while(--_0x48c215){_0x594de8['push'](_0x594de8['shift']());}};_0x5fcbf(++_0x46d0d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index ce5b8ec..637e510 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 _0xae0c=['callback','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','getQueue','queue','exports','lodash','string','isNil','voiceQueue','phone','Contact','firstName','lastName','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae0c,0x1eb));var _0xcae0=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xae0c[_0xfae23b];return _0x200640;};'use strict';var util=require('util');var _=require(_0xcae0('0x0'));var moment=require('moment');function checkNameSurname(_0x45a23f,_0x14768f,_0x1637d4){var _0x3b8d2a='';if(!_['isNil'](_0x14768f)&&_0xcae0('0x1')===typeof _0x14768f){_0x3b8d2a+=_0x14768f;}if(!_[_0xcae0('0x2')](_0x1637d4)&&'string'===typeof _0x1637d4){_0x3b8d2a+='\x20'+_0x1637d4;}if(_0x3b8d2a!==''){return _0x3b8d2a;}return _0x45a23f;}function Action(_0x14b1ee,_0x14668d,_0x485b74){this[_0xcae0('0x3')]=_0x14b1ee;this['uniqueid']=_0x485b74||undefined;this['name']=checkNameSurname(_0x14668d['Contact'][_0xcae0('0x4')],_0x14668d[_0xcae0('0x5')][_0xcae0('0x6')],_0x14668d[_0xcae0('0x5')][_0xcae0('0x7')]);this['number']=_0x14668d[_0xcae0('0x5')][_0xcae0('0x4')];this['queue']=_0x14b1ee[_0xcae0('0x8')];this[_0xcae0('0x9')]=_0x14668d['active']||![];this[_0xcae0('0xa')]=_0x14b1ee[_0xcae0('0xa')];this[_0xcae0('0xb')]=_0x14b1ee[_0xcae0('0xb')]||0x3;this[_0xcae0('0xc')]=_0x14668d[_0xcae0('0xc')];this[_0xcae0('0xd')]=_0x14668d[_0xcae0('0xd')];this['countcongestionretry']=_0x14668d[_0xcae0('0xe')];this[_0xcae0('0xf')]=_0x14668d[_0xcae0('0xf')];this[_0xcae0('0x10')]=_0x14668d['countnosuchnumberretry'];this['countdropretry']=_0x14668d[_0xcae0('0x11')];this['countabandonedretry']=_0x14668d['countabandonedretry'];this[_0xcae0('0x12')]=_0x14668d['countmachineretry'];this[_0xcae0('0x13')]=_0x14668d[_0xcae0('0x13')];this['ContactId']=_0x14668d['ContactId'];this['ListId']=_0x14668d[_0xcae0('0x14')];this[_0xcae0('0x15')]=_0x14668d[_0xcae0('0x15')];this['VoiceQueueId']=_0x14668d[_0xcae0('0x16')];this[_0xcae0('0x17')]=_0x14668d['CampaignId'];this[_0xcae0('0x18')]=_0x14668d['id'];this[_0xcae0('0x19')]=_0x14668d[_0xcae0('0x5')][_0xcae0('0x6')]||'';this[_0xcae0('0x1a')]=moment()[_0xcae0('0x1b')](_0xcae0('0x1c'));this[_0xcae0('0x1d')]=_0x14668d[_0xcae0('0x1d')];this['callbackuniqueid']=_0x14668d['callbackuniqueid'];this['callbackat']=_0x14668d['callbackat'];this['recallme']=_0x14668d[_0xcae0('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xcae0('0x1f')][_0xcae0('0x20')]=function(){return util['format'](_0xcae0('0x21'),this['name'],this[_0xcae0('0x3')]['dialCutDigit']>0x0?this['number'][_0xcae0('0x22')](this[_0xcae0('0x3')][_0xcae0('0x23')]):this[_0xcae0('0x24')]);};Action[_0xcae0('0x1f')][_0xcae0('0x25')]=function(){return this[_0xcae0('0x26')];};module[_0xcae0('0x27')]=Action; \ No newline at end of file +var _0x2460=['scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout'];(function(_0x53480f,_0x16516e){var _0x20032a=function(_0x3eca52){while(--_0x3eca52){_0x53480f['push'](_0x53480f['shift']());}};_0x20032a(++_0x16516e);}(_0x2460,0x12b));var _0x0246=function(_0x270b72,_0x129a7a){_0x270b72=_0x270b72-0x0;var _0x2e09ca=_0x2460[_0x270b72];return _0x2e09ca;};'use strict';var util=require(_0x0246('0x0'));var _=require(_0x0246('0x1'));var moment=require(_0x0246('0x2'));function checkNameSurname(_0xb53050,_0x35a7fe,_0xfadbaa){var _0x1b9f71='';if(!_[_0x0246('0x3')](_0x35a7fe)&&'string'===typeof _0x35a7fe){_0x1b9f71+=_0x35a7fe;}if(!_[_0x0246('0x3')](_0xfadbaa)&&_0x0246('0x4')===typeof _0xfadbaa){_0x1b9f71+='\x20'+_0xfadbaa;}if(_0x1b9f71!==''){return _0x1b9f71;}return _0xb53050;}function Action(_0x27441f,_0x7b6c13,_0x4d34c1){this['voiceQueue']=_0x27441f;this[_0x0246('0x5')]=_0x4d34c1||undefined;this[_0x0246('0x6')]=checkNameSurname(_0x7b6c13[_0x0246('0x7')][_0x0246('0x8')],_0x7b6c13[_0x0246('0x7')][_0x0246('0x9')],_0x7b6c13[_0x0246('0x7')][_0x0246('0xa')]);this[_0x0246('0xb')]=_0x7b6c13['Contact'][_0x0246('0x8')];this[_0x0246('0xc')]=_0x27441f[_0x0246('0x6')];this[_0x0246('0xd')]=_0x7b6c13[_0x0246('0xd')]||![];this[_0x0246('0xe')]=_0x27441f[_0x0246('0xe')];this[_0x0246('0xf')]=_0x27441f['dialQueueTimeout']||0x3;this[_0x0246('0x10')]=_0x7b6c13[_0x0246('0x10')];this['countbusyretry']=_0x7b6c13['countbusyretry'];this[_0x0246('0x11')]=_0x7b6c13[_0x0246('0x11')];this[_0x0246('0x12')]=_0x7b6c13[_0x0246('0x12')];this[_0x0246('0x13')]=_0x7b6c13['countnosuchnumberretry'];this[_0x0246('0x14')]=_0x7b6c13[_0x0246('0x14')];this[_0x0246('0x15')]=_0x7b6c13['countabandonedretry'];this[_0x0246('0x16')]=_0x7b6c13[_0x0246('0x16')];this[_0x0246('0x17')]=_0x7b6c13['countagentrejectretry'];this[_0x0246('0x18')]=_0x7b6c13[_0x0246('0x18')];this['ListId']=_0x7b6c13[_0x0246('0x19')];this['UserId']=_0x7b6c13[_0x0246('0x1a')];this[_0x0246('0x1b')]=_0x7b6c13[_0x0246('0x1b')];this[_0x0246('0x1c')]=_0x7b6c13['CampaignId'];this[_0x0246('0x1d')]=_0x7b6c13['id'];this[_0x0246('0x1e')]=_0x7b6c13['Contact'][_0x0246('0x9')]||'';this[_0x0246('0x1f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x7b6c13[_0x0246('0x20')];this['callbackuniqueid']=_0x7b6c13[_0x0246('0x21')];this[_0x0246('0x22')]=_0x7b6c13[_0x0246('0x22')];this['recallme']=_0x7b6c13[_0x0246('0x23')];this['originatecalleridnum']='';this[_0x0246('0x24')]='';}Action[_0x0246('0x25')][_0x0246('0x26')]=function(){return util[_0x0246('0x27')](_0x0246('0x28'),this[_0x0246('0x6')],this[_0x0246('0x29')][_0x0246('0x2a')]>0x0?this[_0x0246('0xb')][_0x0246('0x2b')](this['voiceQueue'][_0x0246('0x2a')]):this[_0x0246('0xb')]);};Action[_0x0246('0x25')]['getQueue']=function(){return this['queue'];};module[_0x0246('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 56e5f22..4e34f26 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 _0xf975=['moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf975,0xba));var _0x5f97=function(_0x3550e8,_0x424fea){_0x3550e8=_0x3550e8-0x0;var _0x18eb61=_0xf975[_0x3550e8];return _0x18eb61;};'use strict';var util=require(_0x5f97('0x0'));var _=require(_0x5f97('0x1'));var moment=require(_0x5f97('0x2'));function getSeconds(_0x137a71,_0x2c7c5a){var _0x24d1cc=moment(_0x137a71)[_0x5f97('0x3')](0x0);var _0x5f1872=moment(_0x2c7c5a)['milliseconds'](0x0);return _0x24d1cc[_0x5f97('0x4')](_0x5f1872,_0x5f97('0x5'));}function AgentComplete(_0x1a600c,_0x415dae){this[_0x5f97('0x6')]=0x4;this[_0x5f97('0x7')]=_0x5f97('0x8');this['scheduledat']=_0x1a600c[_0x5f97('0x9')];this[_0x5f97('0xa')]=_0x1a600c[_0x5f97('0xa')];this[_0x5f97('0xb')]=_0x1a600c[_0x5f97('0xa')]===_0x5f97('0xc')?_0x5f97('0xd'):_0x1a600c[_0x5f97('0xa')];this['countbusyretry']=_0x1a600c['countbusyretry'];this['countcongestionretry']=_0x1a600c['countcongestionretry'];this['countnoanswerretry']=_0x1a600c['countnoanswerretry'];this[_0x5f97('0xe')]=_0x1a600c[_0x5f97('0xf')]+_0x1a600c['countcongestionretry']+_0x1a600c[_0x5f97('0x10')]+_0x1a600c[_0x5f97('0x11')]+_0x1a600c[_0x5f97('0x12')]+_0x1a600c[_0x5f97('0x13')]+_0x1a600c['countmachineretry']+_0x1a600c[_0x5f97('0x14')];this[_0x5f97('0x11')]=_0x1a600c[_0x5f97('0x11')];this[_0x5f97('0x12')]=_0x1a600c[_0x5f97('0x12')];this[_0x5f97('0x13')]=_0x1a600c[_0x5f97('0x13')];this[_0x5f97('0x15')]=_0x1a600c['countmachineretry'];this[_0x5f97('0x14')]=_0x1a600c[_0x5f97('0x14')];this[_0x5f97('0x16')]=_0x415dae[_0x5f97('0x16')];this[_0x5f97('0x17')]=_0x1a600c[_0x5f97('0x18')];this[_0x5f97('0x19')]=_0x1a600c[_0x5f97('0x1a')];this[_0x5f97('0x1b')]=_0x1a600c[_0x5f97('0x1b')];this[_0x5f97('0x1c')]=_0x1a600c['responsetime'];this[_0x5f97('0x1d')]=_0x1a600c[_0x5f97('0x1d')];this[_0x5f97('0x1e')]=moment()[_0x5f97('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5f97('0x20')]=getSeconds(_0x1a600c[_0x5f97('0x1c')],_0x1a600c['starttime']);this[_0x5f97('0x21')]=getSeconds(_0x1a600c[_0x5f97('0x1d')],_0x1a600c[_0x5f97('0x1c')]);this[_0x5f97('0x22')]=getSeconds(this['endtime'],_0x1a600c['answertime']);this[_0x5f97('0xd')]=_0x415dae[_0x5f97('0xd')];this[_0x5f97('0x23')]=_0x415dae['membername'];this[_0x5f97('0x24')]=_0x415dae['reason'];this[_0x5f97('0x25')]=_0x1a600c[_0x5f97('0x25')];this[_0x5f97('0x26')]=_0x1a600c[_0x5f97('0x26')];this['callbackat']=_0x1a600c['callbackat'];this[_0x5f97('0x27')]=_0x1a600c[_0x5f97('0x27')];this[_0x5f97('0x28')]=_0x1a600c[_0x5f97('0x28')];this['ListId']=_0x1a600c[_0x5f97('0x29')];this[_0x5f97('0x2a')]=_0x1a600c[_0x5f97('0x2a')];this[_0x5f97('0x2b')]=_0x1a600c[_0x5f97('0x2b')];this[_0x5f97('0x2c')]=_0x1a600c[_0x5f97('0x2c')];this['originatecalleridnum']=_0x1a600c[_0x5f97('0x2d')]||'';this[_0x5f97('0x2e')]=_0x1a600c[_0x5f97('0x2e')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x8e8a=['number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x8e8a,0x9d));var _0xa8e8=function(_0x2443a8,_0x4500a4){_0x2443a8=_0x2443a8-0x0;var _0x538bdc=_0x8e8a[_0x2443a8];return _0x538bdc;};'use strict';var util=require('util');var _=require(_0xa8e8('0x0'));var moment=require(_0xa8e8('0x1'));function getSeconds(_0x5632da,_0x4768af){var _0x31d08f=moment(_0x5632da)[_0xa8e8('0x2')](0x0);var _0x1f797e=moment(_0x4768af)[_0xa8e8('0x2')](0x0);return _0x31d08f[_0xa8e8('0x3')](_0x1f797e,_0xa8e8('0x4'));}function AgentComplete(_0x61439d,_0x4e742c){this[_0xa8e8('0x5')]=0x4;this[_0xa8e8('0x6')]='Answer';this[_0xa8e8('0x7')]=_0x61439d[_0xa8e8('0x7')];this[_0xa8e8('0x8')]=_0x61439d[_0xa8e8('0x8')];this['campaigntype']=_0x61439d['type']===_0xa8e8('0x9')?_0xa8e8('0xa'):_0x61439d[_0xa8e8('0x8')];this[_0xa8e8('0xb')]=_0x61439d[_0xa8e8('0xb')];this[_0xa8e8('0xc')]=_0x61439d[_0xa8e8('0xc')];this[_0xa8e8('0xd')]=_0x61439d[_0xa8e8('0xd')];this['countglobal']=_0x61439d[_0xa8e8('0xb')]+_0x61439d[_0xa8e8('0xc')]+_0x61439d[_0xa8e8('0xd')]+_0x61439d[_0xa8e8('0xe')]+_0x61439d['countdropretry']+_0x61439d[_0xa8e8('0xf')]+_0x61439d[_0xa8e8('0x10')]+_0x61439d[_0xa8e8('0x11')];this[_0xa8e8('0xe')]=_0x61439d[_0xa8e8('0xe')];this[_0xa8e8('0x12')]=_0x61439d[_0xa8e8('0x12')];this[_0xa8e8('0xf')]=_0x61439d[_0xa8e8('0xf')];this[_0xa8e8('0x10')]=_0x61439d[_0xa8e8('0x10')];this[_0xa8e8('0x11')]=_0x61439d[_0xa8e8('0x11')];this['uniqueid']=_0x4e742c[_0xa8e8('0x13')];this[_0xa8e8('0x14')]=_0x61439d[_0xa8e8('0x15')];this[_0xa8e8('0x16')]=_0x61439d[_0xa8e8('0x17')];this[_0xa8e8('0x18')]=_0x61439d[_0xa8e8('0x18')];this[_0xa8e8('0x19')]=_0x61439d[_0xa8e8('0x19')];this[_0xa8e8('0x1a')]=_0x61439d[_0xa8e8('0x1a')];this['endtime']=moment()[_0xa8e8('0x1b')](_0xa8e8('0x1c'));this[_0xa8e8('0x1d')]=getSeconds(_0x61439d[_0xa8e8('0x19')],_0x61439d[_0xa8e8('0x18')]);this[_0xa8e8('0x1e')]=getSeconds(_0x61439d[_0xa8e8('0x1a')],_0x61439d[_0xa8e8('0x19')]);this[_0xa8e8('0x1f')]=getSeconds(this['endtime'],_0x61439d['answertime']);this[_0xa8e8('0xa')]=_0x4e742c[_0xa8e8('0xa')];this[_0xa8e8('0x20')]=_0x4e742c['membername'];this[_0xa8e8('0x21')]=_0x4e742c[_0xa8e8('0x21')];this['callback']=_0x61439d['callback'];this['callbackuniqueid']=_0x61439d[_0xa8e8('0x22')];this[_0xa8e8('0x23')]=_0x61439d[_0xa8e8('0x23')];this[_0xa8e8('0x24')]=_0x61439d[_0xa8e8('0x24')];this[_0xa8e8('0x25')]=_0x61439d[_0xa8e8('0x25')];this[_0xa8e8('0x26')]=_0x61439d['ListId'];this[_0xa8e8('0x27')]=_0x61439d[_0xa8e8('0x27')];this[_0xa8e8('0x28')]=_0x61439d[_0xa8e8('0x28')];this[_0xa8e8('0x29')]=_0x61439d[_0xa8e8('0x29')];this[_0xa8e8('0x2a')]=_0x61439d[_0xa8e8('0x2a')]||'';this['originatecalleridname']=_0x61439d[_0xa8e8('0x2b')]||'';}module[_0xa8e8('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 6bb81dc..29b1fc8 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 _0x4f0d=['campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','uniqueid','scheduledat','type'];(function(_0x32191d,_0x1f080f){var _0x1842e1=function(_0x2f2343){while(--_0x2f2343){_0x32191d['push'](_0x32191d['shift']());}};_0x1842e1(++_0x1f080f);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x599d7f,_0xc586e8){_0x599d7f=_0x599d7f-0x0;var _0x3346d3=_0x4f0d[_0x599d7f];return _0x3346d3;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x5290b6,_0x5cd109){var _0xc4d56b=moment(_0x5290b6)[_0xd4f0('0x0')](0x0);var _0x216b0d=moment(_0x5cd109)['milliseconds'](0x0);return _0xc4d56b[_0xd4f0('0x1')](_0x216b0d,'seconds');}function Final(_0x501b8f){this[_0xd4f0('0x2')]=_0x501b8f['uniqueid'];this[_0xd4f0('0x3')]=_0x501b8f[_0xd4f0('0x3')];this['type']=_0x501b8f[_0xd4f0('0x4')];this[_0xd4f0('0x5')]=_0x501b8f[_0xd4f0('0x4')]===_0xd4f0('0x6')?_0xd4f0('0x7'):_0x501b8f['type'];this[_0xd4f0('0x8')]=_0x501b8f[_0xd4f0('0x8')];this['countcongestionretry']=_0x501b8f['countcongestionretry'];this[_0xd4f0('0x9')]=_0x501b8f[_0xd4f0('0x9')];this['countglobal']=_0x501b8f[_0xd4f0('0x8')]+_0x501b8f[_0xd4f0('0xa')]+_0x501b8f[_0xd4f0('0x9')]+_0x501b8f[_0xd4f0('0xb')]+_0x501b8f[_0xd4f0('0xc')]+_0x501b8f['countabandonedretry']+_0x501b8f[_0xd4f0('0xd')]+_0x501b8f[_0xd4f0('0xe')];this[_0xd4f0('0xb')]=_0x501b8f[_0xd4f0('0xb')];this[_0xd4f0('0xc')]=_0x501b8f[_0xd4f0('0xc')];this[_0xd4f0('0xf')]=_0x501b8f[_0xd4f0('0xf')];this[_0xd4f0('0xd')]=_0x501b8f[_0xd4f0('0xd')];this[_0xd4f0('0xe')]=_0x501b8f[_0xd4f0('0xe')];this['queue']=_0x501b8f['queue'];this[_0xd4f0('0x10')]=_0x501b8f[_0xd4f0('0x10')];this[_0xd4f0('0x11')]=_0x501b8f[_0xd4f0('0x11')];this['starttime']=_0x501b8f['starttime'];this[_0xd4f0('0x12')]=_0x501b8f[_0xd4f0('0x12')];this[_0xd4f0('0x13')]=_0x501b8f[_0xd4f0('0x12')];this[_0xd4f0('0x14')]=_0x501b8f[_0xd4f0('0x14')]||0x0;this[_0xd4f0('0x15')]=_0x501b8f[_0xd4f0('0x15')]||0x0;this[_0xd4f0('0x16')]=_0x501b8f[_0xd4f0('0x16')]||0x0;this['callback']=_0x501b8f[_0xd4f0('0x17')];this[_0xd4f0('0x18')]=_0x501b8f[_0xd4f0('0x18')];this['callbackat']=_0x501b8f[_0xd4f0('0x19')];this[_0xd4f0('0x1a')]=_0x501b8f[_0xd4f0('0x1a')];this['ContactId']=_0x501b8f[_0xd4f0('0x1b')];this[_0xd4f0('0x1c')]=_0x501b8f[_0xd4f0('0x1c')];this[_0xd4f0('0x1d')]=_0x501b8f['UserId'];this[_0xd4f0('0x1e')]=_0x501b8f[_0xd4f0('0x1e')];this[_0xd4f0('0x1f')]=_0x501b8f[_0xd4f0('0x1f')];this['originatecalleridnum']=_0x501b8f[_0xd4f0('0x20')]||'';this['originatecalleridname']=_0x501b8f[_0xd4f0('0x21')]||'';}module[_0xd4f0('0x22')]=Final; \ No newline at end of file +var _0x8ece=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8ece,0x195));var _0xe8ec=function(_0x268319,_0x53fc42){_0x268319=_0x268319-0x0;var _0x1f9479=_0x8ece[_0x268319];return _0x1f9479;};'use strict';var util=require(_0xe8ec('0x0'));var _=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));function getSeconds(_0x309040,_0x4dd5dd){var _0x47b1c1=moment(_0x309040)[_0xe8ec('0x3')](0x0);var _0x30c05a=moment(_0x4dd5dd)[_0xe8ec('0x3')](0x0);return _0x47b1c1[_0xe8ec('0x4')](_0x30c05a,_0xe8ec('0x5'));}function Final(_0x4f2e7f){this[_0xe8ec('0x6')]=_0x4f2e7f[_0xe8ec('0x6')];this[_0xe8ec('0x7')]=_0x4f2e7f[_0xe8ec('0x7')];this[_0xe8ec('0x8')]=_0x4f2e7f[_0xe8ec('0x8')];this[_0xe8ec('0x9')]=_0x4f2e7f['type']===_0xe8ec('0xa')?'queue':_0x4f2e7f[_0xe8ec('0x8')];this['countbusyretry']=_0x4f2e7f[_0xe8ec('0xb')];this[_0xe8ec('0xc')]=_0x4f2e7f[_0xe8ec('0xc')];this[_0xe8ec('0xd')]=_0x4f2e7f[_0xe8ec('0xd')];this[_0xe8ec('0xe')]=_0x4f2e7f[_0xe8ec('0xb')]+_0x4f2e7f[_0xe8ec('0xc')]+_0x4f2e7f[_0xe8ec('0xd')]+_0x4f2e7f[_0xe8ec('0xf')]+_0x4f2e7f[_0xe8ec('0x10')]+_0x4f2e7f[_0xe8ec('0x11')]+_0x4f2e7f[_0xe8ec('0x12')]+_0x4f2e7f['countagentrejectretry'];this[_0xe8ec('0xf')]=_0x4f2e7f[_0xe8ec('0xf')];this[_0xe8ec('0x10')]=_0x4f2e7f[_0xe8ec('0x10')];this[_0xe8ec('0x11')]=_0x4f2e7f[_0xe8ec('0x11')];this[_0xe8ec('0x12')]=_0x4f2e7f[_0xe8ec('0x12')];this['countagentrejectretry']=_0x4f2e7f[_0xe8ec('0x13')];this[_0xe8ec('0x14')]=_0x4f2e7f[_0xe8ec('0x14')];this['calleridname']=_0x4f2e7f[_0xe8ec('0x15')];this[_0xe8ec('0x16')]=_0x4f2e7f[_0xe8ec('0x16')];this[_0xe8ec('0x17')]=_0x4f2e7f[_0xe8ec('0x17')];this[_0xe8ec('0x18')]=_0x4f2e7f[_0xe8ec('0x18')];this[_0xe8ec('0x19')]=_0x4f2e7f['responsetime'];this[_0xe8ec('0x1a')]=_0x4f2e7f[_0xe8ec('0x1a')]||0x0;this[_0xe8ec('0x1b')]=_0x4f2e7f[_0xe8ec('0x1b')]||0x0;this[_0xe8ec('0x1c')]=_0x4f2e7f[_0xe8ec('0x1c')]||0x0;this[_0xe8ec('0x1d')]=_0x4f2e7f[_0xe8ec('0x1d')];this[_0xe8ec('0x1e')]=_0x4f2e7f['callbackuniqueid'];this[_0xe8ec('0x1f')]=_0x4f2e7f[_0xe8ec('0x1f')];this[_0xe8ec('0x20')]=_0x4f2e7f[_0xe8ec('0x20')];this[_0xe8ec('0x21')]=_0x4f2e7f['ContactId'];this[_0xe8ec('0x22')]=_0x4f2e7f[_0xe8ec('0x22')];this[_0xe8ec('0x23')]=_0x4f2e7f[_0xe8ec('0x23')];this[_0xe8ec('0x24')]=_0x4f2e7f[_0xe8ec('0x24')];this['CampaignId']=_0x4f2e7f['CampaignId'];this[_0xe8ec('0x25')]=_0x4f2e7f[_0xe8ec('0x25')]||'';this[_0xe8ec('0x26')]=_0x4f2e7f[_0xe8ec('0x26')]||'';}module[_0xe8ec('0x27')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index ac29b38..3539eee 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 _0x1bfd=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x26849e,_0x39c560){var _0x4b090e=function(_0x594941){while(--_0x594941){_0x26849e['push'](_0x26849e['shift']());}};_0x4b090e(++_0x39c560);}(_0x1bfd,0x71));var _0xd1bf=function(_0xf2f46b,_0x89cf58){_0xf2f46b=_0xf2f46b-0x0;var _0x382051=_0x1bfd[_0xf2f46b];return _0x382051;};'use strict';var util=require(_0xd1bf('0x0'));var _=require(_0xd1bf('0x1'));var moment=require(_0xd1bf('0x2'));function getSeconds(_0x1a9c8d,_0x5f38ab){var _0x4b2384=moment(_0x1a9c8d)[_0xd1bf('0x3')](0x0);var _0x5d1a18=moment(_0x5f38ab)[_0xd1bf('0x3')](0x0);return _0x4b2384[_0xd1bf('0x4')](_0x5d1a18,'seconds');}function Hangup(_0xf4f892,_0x59d6c2){this[_0xd1bf('0x5')]=0x4;this[_0xd1bf('0x6')]=_0xd1bf('0x7');this[_0xd1bf('0x8')]=_0xf4f892[_0xd1bf('0x8')];this[_0xd1bf('0x9')]=_0xf4f892['type'];this[_0xd1bf('0xa')]=_0xf4f892[_0xd1bf('0x9')]===_0xd1bf('0xb')?_0xd1bf('0xc'):_0xf4f892[_0xd1bf('0x9')];this[_0xd1bf('0xd')]=_0xf4f892[_0xd1bf('0xd')];this[_0xd1bf('0xe')]=_0xf4f892['countcongestionretry'];this[_0xd1bf('0xf')]=_0xf4f892[_0xd1bf('0xf')];this[_0xd1bf('0x10')]=_0xf4f892[_0xd1bf('0xd')]+_0xf4f892['countcongestionretry']+_0xf4f892[_0xd1bf('0xf')]+_0xf4f892[_0xd1bf('0x11')]+_0xf4f892[_0xd1bf('0x12')]+_0xf4f892[_0xd1bf('0x13')]+_0xf4f892[_0xd1bf('0x14')]+_0xf4f892[_0xd1bf('0x15')];this[_0xd1bf('0x11')]=_0xf4f892['countnosuchnumberretry'];this['countdropretry']=_0xf4f892[_0xd1bf('0x12')];this['countabandonedretry']=_0xf4f892[_0xd1bf('0x13')];this[_0xd1bf('0x14')]=_0xf4f892['countmachineretry'];this[_0xd1bf('0x15')]=_0xf4f892[_0xd1bf('0x15')];this['uniqueid']=_0x59d6c2[_0xd1bf('0x16')];this[_0xd1bf('0x17')]=_0xf4f892[_0xd1bf('0x18')];this[_0xd1bf('0x19')]=_0xf4f892[_0xd1bf('0x1a')];this[_0xd1bf('0x1b')]=_0xf4f892[_0xd1bf('0x1b')];this[_0xd1bf('0x1c')]=_0xf4f892[_0xd1bf('0x1c')];this[_0xd1bf('0x1d')]=moment()['format'](_0xd1bf('0x1e'));this['ringtime']=getSeconds(_0xf4f892['responsetime'],_0xf4f892[_0xd1bf('0x1b')]);this[_0xd1bf('0x1f')]=0x0;this[_0xd1bf('0x20')]=getSeconds(this[_0xd1bf('0x1d')],_0xf4f892[_0xd1bf('0x1c')]);this[_0xd1bf('0xc')]=_0xf4f892[_0xd1bf('0xc')];this[_0xd1bf('0x21')]=_0xd1bf('0x22');this['reason']=_0x59d6c2[_0xd1bf('0x23')];this[_0xd1bf('0x24')]=_0xf4f892[_0xd1bf('0x24')];this[_0xd1bf('0x25')]=_0xf4f892[_0xd1bf('0x25')];this['callbackat']=_0xf4f892['callbackat'];this['recallme']=_0xf4f892[_0xd1bf('0x26')];this[_0xd1bf('0x27')]=_0xf4f892[_0xd1bf('0x27')];this[_0xd1bf('0x28')]=_0xf4f892[_0xd1bf('0x28')];this[_0xd1bf('0x29')]=_0xf4f892[_0xd1bf('0x29')];this[_0xd1bf('0x2a')]=_0xf4f892[_0xd1bf('0x2a')];this['CampaignId']=_0xf4f892[_0xd1bf('0x2b')];}module[_0xd1bf('0x2c')]=Hangup; \ No newline at end of file +var _0x2145=['UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','seconds','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x5a9cdc,_0x2acffd){var _0x27319d=function(_0x10d8c4){while(--_0x10d8c4){_0x5a9cdc['push'](_0x5a9cdc['shift']());}};_0x27319d(++_0x2acffd);}(_0x2145,0x1d2));var _0x5214=function(_0xac2d31,_0x57fe45){_0xac2d31=_0xac2d31-0x0;var _0x469f89=_0x2145[_0xac2d31];return _0x469f89;};'use strict';var util=require('util');var _=require(_0x5214('0x0'));var moment=require(_0x5214('0x1'));function getSeconds(_0x37f7bc,_0x26e17c){var _0x378d37=moment(_0x37f7bc)[_0x5214('0x2')](0x0);var _0x4efd67=moment(_0x26e17c)[_0x5214('0x2')](0x0);return _0x378d37['diff'](_0x4efd67,_0x5214('0x3'));}function Hangup(_0x270662,_0x53bf92){this['state']=0x4;this[_0x5214('0x4')]='Answer';this[_0x5214('0x5')]=_0x270662[_0x5214('0x5')];this[_0x5214('0x6')]=_0x270662[_0x5214('0x6')];this[_0x5214('0x7')]=_0x270662[_0x5214('0x6')]==='outbound'?_0x5214('0x8'):_0x270662['type'];this[_0x5214('0x9')]=_0x270662['countbusyretry'];this['countcongestionretry']=_0x270662['countcongestionretry'];this[_0x5214('0xa')]=_0x270662[_0x5214('0xa')];this[_0x5214('0xb')]=_0x270662[_0x5214('0x9')]+_0x270662[_0x5214('0xc')]+_0x270662[_0x5214('0xa')]+_0x270662[_0x5214('0xd')]+_0x270662['countdropretry']+_0x270662[_0x5214('0xe')]+_0x270662['countmachineretry']+_0x270662[_0x5214('0xf')];this[_0x5214('0xd')]=_0x270662['countnosuchnumberretry'];this[_0x5214('0x10')]=_0x270662[_0x5214('0x10')];this[_0x5214('0xe')]=_0x270662[_0x5214('0xe')];this[_0x5214('0x11')]=_0x270662['countmachineretry'];this[_0x5214('0xf')]=_0x270662[_0x5214('0xf')];this['uniqueid']=_0x53bf92[_0x5214('0x12')];this[_0x5214('0x13')]=_0x270662[_0x5214('0x14')];this[_0x5214('0x15')]=_0x270662[_0x5214('0x16')];this[_0x5214('0x17')]=_0x270662[_0x5214('0x17')];this[_0x5214('0x18')]=_0x270662['responsetime'];this[_0x5214('0x19')]=moment()[_0x5214('0x1a')](_0x5214('0x1b'));this[_0x5214('0x1c')]=getSeconds(_0x270662[_0x5214('0x18')],_0x270662[_0x5214('0x17')]);this[_0x5214('0x1d')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x270662['responsetime']);this[_0x5214('0x8')]=_0x270662[_0x5214('0x8')];this[_0x5214('0x1e')]=_0x5214('0x1f');this[_0x5214('0x20')]=_0x53bf92['cause-txt'];this['callback']=_0x270662['callback'];this[_0x5214('0x21')]=_0x270662[_0x5214('0x21')];this[_0x5214('0x22')]=_0x270662[_0x5214('0x22')];this[_0x5214('0x23')]=_0x270662[_0x5214('0x23')];this[_0x5214('0x24')]=_0x270662[_0x5214('0x24')];this[_0x5214('0x25')]=_0x270662['ListId'];this[_0x5214('0x26')]=_0x270662[_0x5214('0x26')];this[_0x5214('0x27')]=_0x270662['VoiceQueueId'];this[_0x5214('0x28')]=_0x270662['CampaignId'];}module[_0x5214('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 44216bb..dd17dad 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 _0xd654=['countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','name','calleridnum','number','responsetime','ringtime','starttime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry'];(function(_0x30fe75,_0x3e069e){var _0x466006=function(_0x36ae0e){while(--_0x36ae0e){_0x30fe75['push'](_0x30fe75['shift']());}};_0x466006(++_0x3e069e);}(_0xd654,0x16d));var _0x4d65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd654[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x4d65('0x0'));var _=require('lodash');var moment=require(_0x4d65('0x1'));function getSeconds(_0x145340,_0x54c4ad){var _0x334f6a=moment(_0x145340)[_0x4d65('0x2')](0x0);var _0x3c321c=moment(_0x54c4ad)[_0x4d65('0x2')](0x0);return _0x334f6a['diff'](_0x3c321c,'seconds');}function History(_0x82b69){this[_0x4d65('0x3')]=_0x82b69['uniqueid'];this[_0x4d65('0x4')]=_0x82b69[_0x4d65('0x4')]||undefined;this[_0x4d65('0x5')]=_0x82b69['type'];this[_0x4d65('0x6')]=_0x82b69[_0x4d65('0x5')]===_0x4d65('0x7')?_0x4d65('0x8'):_0x82b69['type'];this[_0x4d65('0x9')]=_0x82b69['countbusyretry'];this[_0x4d65('0xa')]=_0x82b69[_0x4d65('0xa')];this[_0x4d65('0xb')]=_0x82b69['countnoanswerretry'];this[_0x4d65('0xc')]=_0x82b69['countbusyretry']+_0x82b69['countcongestionretry']+_0x82b69[_0x4d65('0xb')]+_0x82b69['countnosuchnumberretry']+_0x82b69['countdropretry']+_0x82b69[_0x4d65('0xd')]+_0x82b69[_0x4d65('0xe')]+_0x82b69[_0x4d65('0xf')];this[_0x4d65('0x10')]=_0x82b69[_0x4d65('0x10')];this[_0x4d65('0x11')]=_0x82b69['countdropretry'];this[_0x4d65('0xd')]=_0x82b69[_0x4d65('0xd')];this[_0x4d65('0xe')]=_0x82b69[_0x4d65('0xe')];this['countagentrejectretry']=_0x82b69['countagentrejectretry'];this[_0x4d65('0x8')]=_0x82b69['queue'];this[_0x4d65('0x12')]=_0x82b69[_0x4d65('0x13')];this[_0x4d65('0x14')]=_0x82b69[_0x4d65('0x15')];this['starttime']=_0x82b69['starttime'];this[_0x4d65('0x16')]=_0x82b69[_0x4d65('0x16')];this['endtime']=_0x82b69[_0x4d65('0x16')];this[_0x4d65('0x17')]=getSeconds(_0x82b69['responsetime'],_0x82b69[_0x4d65('0x18')]);this[_0x4d65('0x19')]=0x0;this['talktime']=0x0;this[_0x4d65('0x1a')]=_0x82b69[_0x4d65('0x1a')];this[_0x4d65('0x1b')]=_0x82b69[_0x4d65('0x1b')];this[_0x4d65('0x1c')]=_0x82b69[_0x4d65('0x1c')];this['recallme']=_0x82b69[_0x4d65('0x1d')];this[_0x4d65('0x1e')]=_0x82b69[_0x4d65('0x1e')];this[_0x4d65('0x1f')]=_0x82b69['ListId'];this[_0x4d65('0x20')]=_0x82b69[_0x4d65('0x20')];this['VoiceQueueId']=_0x82b69[_0x4d65('0x21')];this[_0x4d65('0x22')]=_0x82b69[_0x4d65('0x22')];this[_0x4d65('0x23')]=_0x82b69[_0x4d65('0x23')]||'';this[_0x4d65('0x24')]=_0x82b69[_0x4d65('0x24')]||'';}module[_0x4d65('0x25')]=History; \ No newline at end of file +var _0x1d2f=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime'];(function(_0x110ea2,_0x4f13ea){var _0x704849=function(_0x69fa38){while(--_0x69fa38){_0x110ea2['push'](_0x110ea2['shift']());}};_0x704849(++_0x4f13ea);}(_0x1d2f,0x143));var _0xf1d2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1d2f[_0xfae23b];return _0x200640;};'use strict';var util=require(_0xf1d2('0x0'));var _=require('lodash');var moment=require(_0xf1d2('0x1'));function getSeconds(_0x273be6,_0x1c9b03){var _0x3997d5=moment(_0x273be6)[_0xf1d2('0x2')](0x0);var _0x2cbce7=moment(_0x1c9b03)[_0xf1d2('0x2')](0x0);return _0x3997d5['diff'](_0x2cbce7,_0xf1d2('0x3'));}function History(_0x2b2e96){this[_0xf1d2('0x4')]=_0x2b2e96[_0xf1d2('0x4')];this[_0xf1d2('0x5')]=_0x2b2e96[_0xf1d2('0x5')]||undefined;this['type']=_0x2b2e96[_0xf1d2('0x6')];this[_0xf1d2('0x7')]=_0x2b2e96['type']===_0xf1d2('0x8')?_0xf1d2('0x9'):_0x2b2e96['type'];this[_0xf1d2('0xa')]=_0x2b2e96[_0xf1d2('0xa')];this[_0xf1d2('0xb')]=_0x2b2e96[_0xf1d2('0xb')];this[_0xf1d2('0xc')]=_0x2b2e96[_0xf1d2('0xc')];this[_0xf1d2('0xd')]=_0x2b2e96['countbusyretry']+_0x2b2e96[_0xf1d2('0xb')]+_0x2b2e96[_0xf1d2('0xc')]+_0x2b2e96[_0xf1d2('0xe')]+_0x2b2e96[_0xf1d2('0xf')]+_0x2b2e96[_0xf1d2('0x10')]+_0x2b2e96[_0xf1d2('0x11')]+_0x2b2e96[_0xf1d2('0x12')];this['countnosuchnumberretry']=_0x2b2e96[_0xf1d2('0xe')];this[_0xf1d2('0xf')]=_0x2b2e96[_0xf1d2('0xf')];this[_0xf1d2('0x10')]=_0x2b2e96[_0xf1d2('0x10')];this[_0xf1d2('0x11')]=_0x2b2e96[_0xf1d2('0x11')];this['countagentrejectretry']=_0x2b2e96[_0xf1d2('0x12')];this[_0xf1d2('0x9')]=_0x2b2e96[_0xf1d2('0x9')];this[_0xf1d2('0x13')]=_0x2b2e96[_0xf1d2('0x14')];this[_0xf1d2('0x15')]=_0x2b2e96['number'];this[_0xf1d2('0x16')]=_0x2b2e96['starttime'];this[_0xf1d2('0x17')]=_0x2b2e96[_0xf1d2('0x17')];this[_0xf1d2('0x18')]=_0x2b2e96[_0xf1d2('0x17')];this[_0xf1d2('0x19')]=getSeconds(_0x2b2e96[_0xf1d2('0x17')],_0x2b2e96[_0xf1d2('0x16')]);this[_0xf1d2('0x1a')]=0x0;this[_0xf1d2('0x1b')]=0x0;this[_0xf1d2('0x1c')]=_0x2b2e96[_0xf1d2('0x1c')];this['callbackuniqueid']=_0x2b2e96[_0xf1d2('0x1d')];this[_0xf1d2('0x1e')]=_0x2b2e96['callbackat'];this[_0xf1d2('0x1f')]=_0x2b2e96[_0xf1d2('0x1f')];this[_0xf1d2('0x20')]=_0x2b2e96['ContactId'];this[_0xf1d2('0x21')]=_0x2b2e96[_0xf1d2('0x21')];this[_0xf1d2('0x22')]=_0x2b2e96[_0xf1d2('0x22')];this['VoiceQueueId']=_0x2b2e96[_0xf1d2('0x23')];this[_0xf1d2('0x24')]=_0x2b2e96[_0xf1d2('0x24')];this['originatecalleridnum']=_0x2b2e96['originatecalleridnum']||'';this[_0xf1d2('0x25')]=_0x2b2e96[_0xf1d2('0x25')]||'';}module[_0xf1d2('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index a3725da..5cf31b1 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 _0xf408=['dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','error','inspect','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','waiting','pTalking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','sequence','isNil','Action','status','catch','updateOriginated','queue','ivr','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countagentrejectretry','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr]','AGI','[syncHangupIvr][createHistory]','cause-txt','agent','agiafterat','dialQueueProject2','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','channel','actionid','roundrobin','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','power','handlePower','launchHandleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIsTrunkReachable','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','stateGlobal','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','AVAILABLE_CONTACTS_FINISHED','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[actionOriginate]\x20','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','reachable','[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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','sumBillable','sumDuration','talking','loggedInDb','dialActive'];(function(_0x5978ac,_0x441ad5){var _0x3cf9b1=function(_0xc1f780){while(--_0xc1f780){_0x5978ac['push'](_0x5978ac['shift']());}};_0x3cf9b1(++_0x441ad5);}(_0xf408,0x1b9));var _0x8f40=function(_0x3fdd09,_0x2853f7){_0x3fdd09=_0x3fdd09-0x0;var _0x2be280=_0xf408[_0x3fdd09];return _0x2be280;};'use strict';var util=require(_0x8f40('0x0'));var _=require(_0x8f40('0x1'));var BPromise=require(_0x8f40('0x2'));var uuid=require(_0x8f40('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x8f40('0x4'));var Redis=require(_0x8f40('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x8f40('0x6'))(_0x8f40('0x7'));var loggerBooked=require(_0x8f40('0x6'))(_0x8f40('0x8'));var loggerPredictive=require(_0x8f40('0x6'))(_0x8f40('0x9'));var loggerPredictiveCalls=require(_0x8f40('0x6'))(_0x8f40('0xa'));var loggerSyncQueueSummary=require(_0x8f40('0x6'))('syncQueueSummary');var ami=require('../ami');config[_0x8f40('0xb')]=_[_0x8f40('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8f40('0xb')]));var cmHopper=require(_0x8f40('0xd'));var cmHopperHistory=require(_0x8f40('0xe'));var cmHopperBlack=require(_0x8f40('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x8f40('0x10'));var History=require(_0x8f40('0x11'));var Final=require(_0x8f40('0x12'));var AgentComplete=require(_0x8f40('0x13'));var QueueCallerAbandon=require(_0x8f40('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0x8f40('0x15')][_0x8f40('0x16')]||_0x8f40('0x17');var strategy={'rrmemory':_0x8f40('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x8f40('0x19')][_0x8f40('0x1a')]=function(_0xda282f){this[_0x8f40('0x1b')]=this[_0x8f40('0x1b')]?this[_0x8f40('0x1b')][_0x8f40('0x1c')](_0xda282f):_0xda282f();};function Dialer(_0x5f5378,_0x21209d){this['sequence']=new Sequence();this[_0x8f40('0x1d')]=_0x21209d;this[_0x8f40('0x1e')]=_0x5f5378[_0x8f40('0x1e')];this[_0x8f40('0x1f')]=_0x5f5378[_0x8f40('0x1f')];this[_0x8f40('0x20')]=_0x5f5378[_0x8f40('0x20')];this['trunks']=_0x5f5378[_0x8f40('0x21')];this[_0x8f40('0x22')]=config[_0x8f40('0x22')]||0x2;this[_0x8f40('0x23')]={};this[_0x8f40('0x24')]={};this['contactsId']={};this[_0x8f40('0x25')]={};this[_0x8f40('0x26')]={};this[_0x8f40('0x27')]={};this[_0x8f40('0x28')]={};this[_0x8f40('0x29')]={};this[_0x8f40('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x8f40('0x2b'),this[_0x8f40('0x2c')]['bind'](this));ami['on'](_0x8f40('0x2d'),this[_0x8f40('0x2e')][_0x8f40('0x2f')](this));ami['on']('originateresponse',this[_0x8f40('0x30')][_0x8f40('0x2f')](this));ami['on']('agentcomplete',this[_0x8f40('0x31')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x32'),this[_0x8f40('0x33')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x34'),this[_0x8f40('0x35')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x36'),this[_0x8f40('0x37')]['bind'](this));ami['on'](_0x8f40('0x38'),this[_0x8f40('0x39')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x3a'),this[_0x8f40('0x3b')][_0x8f40('0x2f')](this));ami['on'](_0x8f40('0x3c'),this[_0x8f40('0x3d')][_0x8f40('0x2f')](this));this[_0x8f40('0x3e')]();this[_0x8f40('0x3f')]();}function isNotNull(_0x1e27a7){return _0x1e27a7!==null&&!_[_0x8f40('0x40')](_0x1e27a7);}function checkIsLoggedIn(_0x5d03ed,_0x253c93){return function(){if(_0x253c93<=0x0){_0x5d03ed[_0x8f40('0x41')]=_0x8f40('0x42');throw _0x5d03ed[_0x8f40('0x43')]+_0x8f40('0x44');}};}function isActive(_0x101a79){return _0x101a79;}function checkIsActive(_0x35f68d,_0x530974){return function(){if(!isActive(_0x530974)){_0x35f68d['message']=_0x8f40('0x45');throw _0x35f68d[_0x8f40('0x43')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4c342c){return function(){if(!isNotNull(_0x4c342c[_0x8f40('0x46')])){_0x4c342c['message']='INTERVAL_IS_NULL';throw _0x4c342c[_0x8f40('0x43')]+_0x8f40('0x47');}if(!isNotNull(_0x4c342c[_0x8f40('0x46')][_0x8f40('0x48')])){_0x4c342c[_0x8f40('0x41')]=_0x8f40('0x49');throw _0x4c342c[_0x8f40('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x8f40('0x4a')](_0x4c342c[_0x8f40('0x46')]['Intervals']))){_0x4c342c[_0x8f40('0x41')]=_0x8f40('0x49');throw _0x4c342c[_0x8f40('0x43')]+_0x8f40('0x47');}};}function msgResponse(_0xf26421,_0x55928c,_0x550a5a){return{'action':_0xf26421,'response':_0x55928c,'message':_0x550a5a,'stack':_0x550a5a};}function myreject(_0x15fc84){return function(_0x3c7e1a){return _0x15fc84(msgResponse(_0x8f40('0x4b'),_0x8f40('0x4c'),JSON[_0x8f40('0x4d')](_0x3c7e1a)));};}function getSeconds(_0x49a845,_0x43ad32){var _0x31556a=moment(_0x49a845)[_0x8f40('0x4e')](0x0);var _0x3e4e71=moment(_0x43ad32)[_0x8f40('0x4e')](0x0);return _0x31556a[_0x8f40('0x4f')](_0x3e4e71,_0x8f40('0x50'));}function emit(_0x420390,_0x471904,_0x31d282){io['to'](_0x420390)[_0x8f40('0x51')](_0x471904,_0x31d282);}function emitVoiceQueueSummary(_0x5a2bc6){if(_0x5a2bc6[_0x8f40('0x52')]===_0x8f40('0x53')){var _0x1f09ca={'id':_0x5a2bc6['id'],'name':_0x5a2bc6[_0x8f40('0x43')],'strategy':_0x5a2bc6[_0x8f40('0x54')],'answered':_0x5a2bc6['answered'],'available':_0x5a2bc6['available'],'loggedIn':_0x5a2bc6['loggedIn'],'pTalking':_0x5a2bc6['pTalking'],'sumBillable':_0x5a2bc6[_0x8f40('0x55')],'sumDuration':_0x5a2bc6[_0x8f40('0x56')],'sumHoldTime':_0x5a2bc6['sumHoldTime']||0x0,'talking':_0x5a2bc6[_0x8f40('0x57')],'total':_0x5a2bc6['total'],'type':_0x5a2bc6[_0x8f40('0x52')],'unmanaged':_0x5a2bc6['unmanaged'],'abandoned':_0x5a2bc6['abandoned'],'waiting':_0x5a2bc6['waiting'],'loggedInDb':_0x5a2bc6[_0x8f40('0x58')],'dialActive':_0x5a2bc6[_0x8f40('0x59')],'dialMethod':_0x5a2bc6[_0x8f40('0x5a')],'dialOriginateCallerIdName':_0x5a2bc6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5a2bc6[_0x8f40('0x5b')],'dialOriginateTimeout':_0x5a2bc6[_0x8f40('0x5c')],'dialPrefix':_0x5a2bc6[_0x8f40('0x5d')],'outboundAnswerAgiCallsDay':_0x5a2bc6[_0x8f40('0x5e')],'outboundAnswerCallsDay':_0x5a2bc6[_0x8f40('0x5f')],'outboundBlacklistCallsDay':_0x5a2bc6[_0x8f40('0x60')],'outboundBusyCallsDay':_0x5a2bc6[_0x8f40('0x61')],'outboundCongestionCallsDay':_0x5a2bc6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5a2bc6[_0x8f40('0x62')],'outboundDropCallsDayCallersExit':_0x5a2bc6[_0x8f40('0x63')],'outboundDropCallsDayTimeout':_0x5a2bc6[_0x8f40('0x64')],'outboundNoAnswerCallsDay':_0x5a2bc6[_0x8f40('0x65')],'outboundNoSuchCallsDay':_0x5a2bc6[_0x8f40('0x66')],'outboundOriginateFailureCallsDay':_0x5a2bc6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5a2bc6[_0x8f40('0x67')],'outboundRejectCallsDay':_0x5a2bc6['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5a2bc6[_0x8f40('0x68')],'predictiveIntervalAnsweredCalls':_0x5a2bc6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5a2bc6[_0x8f40('0x69')],'predictiveIntervalAvgTalktime':_0x5a2bc6[_0x8f40('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x5a2bc6[_0x8f40('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x5a2bc6['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5a2bc6[_0x8f40('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a2bc6['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5a2bc6[_0x8f40('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x5a2bc6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5a2bc6['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x5a2bc6[_0x8f40('0x6e')],'predictiveIntervalTotalCalls':_0x5a2bc6[_0x8f40('0x6f')],'message':_0x5a2bc6['message'],'originated':_0x5a2bc6[_0x8f40('0x70')],'erlangCalls':_0x5a2bc6[_0x8f40('0x71')],'erlangCallToSecond':_0x5a2bc6['erlangCallToSecond'],'erlangAbandonmentRate':_0x5a2bc6[_0x8f40('0x72')],'erlangBusyFactor':_0x5a2bc6[_0x8f40('0x73')],'startPredictive':_0x5a2bc6[_0x8f40('0x27')],'startProgressive':_0x5a2bc6[_0x8f40('0x28')]};if(_0x5a2bc6['Trunk']){_0x1f09ca[_0x8f40('0x74')]={'id':_0x5a2bc6['Trunk']['id'],'name':_0x5a2bc6[_0x8f40('0x74')][_0x8f40('0x43')],'active':_0x5a2bc6[_0x8f40('0x74')][_0x8f40('0x75')],'callerid':_0x5a2bc6['Trunk']['callerid']};}if(_0x5a2bc6[_0x8f40('0x46')]){_0x1f09ca[_0x8f40('0x46')]={'id':_0x5a2bc6[_0x8f40('0x46')]['id'],'name':_0x5a2bc6[_0x8f40('0x46')][_0x8f40('0x43')]};}var _0x2c03c5=md5(JSON[_0x8f40('0x4d')](_0x1f09ca));if(_0x5a2bc6[_0x8f40('0x4')]!==_0x2c03c5){_0x5a2bc6[_0x8f40('0x4')]=_0x2c03c5;emit(util[_0x8f40('0x76')](_0x8f40('0x77'),_0x1f09ca[_0x8f40('0x43')]),_0x8f40('0x78'),_0x1f09ca);}}}function emitCampaignSummary(_0x4e5f3c){if(_0x4e5f3c[_0x8f40('0x52')]==='ivr'){emit(util[_0x8f40('0x76')](_0x8f40('0x79'),_0x4e5f3c[_0x8f40('0x43')]),_0x8f40('0x7a'),_0x4e5f3c);}}function checkGetDataPredictive(_0x59300d){if(isNotNull(_0x59300d)&&!_[_0x8f40('0x4a')](_0x59300d)){loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x7c'));loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x7d'),_0x59300d[_0x8f40('0x6f')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x7e'),_0x59300d[_0x8f40('0x7f')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x80'),_0x59300d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x81'),_0x59300d[_0x8f40('0x6b')]);loggerPredictive[_0x8f40('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59300d[_0x8f40('0x69')]);loggerPredictive[_0x8f40('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59300d[_0x8f40('0x6a')]);loggerPredictive[_0x8f40('0x7b')]('---------------------------');if(_0x59300d[_0x8f40('0x6f')]>0x0){if(!_['isUndefined'](_0x59300d[_0x8f40('0x6a')])&&_0x59300d[_0x8f40('0x6a')]>0x0){return!![];}loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x82'));if(!_['isUndefined'](_0x59300d['predictiveIntervalAvgHoldtime'])&&_0x59300d[_0x8f40('0x69')]>0x0){return!![];}loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x83'));}else{loggerPredictive['info'](_0x8f40('0x84'));}}else{loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x85'));}return![];}function mergeDataErlangB(_0x1030ea){return function(_0x5cf479){loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x86'));loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x87'),_0x5cf479[_0x8f40('0x71')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x88'),_0x5cf479[_0x8f40('0x89')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x8a'),_0x5cf479[_0x8f40('0x72')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x8b'),_0x5cf479[_0x8f40('0x73')]);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x8a'),_0x5cf479['erlangAbandonmentRate']);loggerPredictive[_0x8f40('0x7b')]('---------------------------');_[_0x8f40('0x8c')](_0x1030ea,_0x5cf479);};}function getDiff(_0x1c9ba3){var _0x268eb6=moment()[_0x8f40('0x4e')](0x0);var _0x3717b1=moment(_0x1c9ba3)[_0x8f40('0x4e')](0x0);return _0x268eb6['diff'](_0x3717b1,_0x8f40('0x50'));}function ifInterval(_0x1778d4,_0x83d099){if(_[_0x8f40('0x40')](_0x83d099)){return![];}return getDiff(_0x83d099)<_0x1778d4*0x3c;}function freeVariablesPredictive(_0x51cc54){if(isNotNull(_0x51cc54)){if(!_['isUndefined'](_0x51cc54[_0x8f40('0x28')])){_0x51cc54[_0x8f40('0x28')]=undefined;loggerPredictive[_0x8f40('0x7b')](_0x51cc54[_0x8f40('0x43')],_0x8f40('0x8d'));}if(!_[_0x8f40('0x40')](_0x51cc54[_0x8f40('0x27')])){_0x51cc54[_0x8f40('0x27')]=undefined;loggerPredictive[_0x8f40('0x7b')](_0x51cc54[_0x8f40('0x43')],_0x8f40('0x8e'));}if(!_[_0x8f40('0x40')](_0x51cc54[_0x8f40('0x8f')])){clearInterval(_0x51cc54['handlePredictive']);_0x51cc54['handlePredictive']=undefined;loggerPredictive[_0x8f40('0x7b')](_0x51cc54[_0x8f40('0x43')],_0x8f40('0x90'));}}}function erlangb(_0x2f7cb2,_0x4ee3a8){if(_0x4ee3a8===0x0){return 0x0;}var _0x3cc0bd=0x1;for(var _0x4cc320=0x1;_0x4cc320<=_0x4ee3a8;_0x4cc320+=0x1){_0x3cc0bd=0x1+_0x3cc0bd*_0x4cc320/_0x2f7cb2;}return 0x1/_0x3cc0bd;}function isVoiceQueueOutbound(_0x2ef238){return _0x2ef238===_0x8f40('0x53');}function isNotPreview(_0x57eea7){return _0x57eea7!=='preview';}function isCampaignIvr(_0x53ec2f){return _0x53ec2f==='ivr';}function getCallerId(_0x24f682,_0x3af8b4,_0x5c1180){if(!_[_0x8f40('0x40')](_0x5c1180)&&typeof _0x5c1180===_0x8f40('0x91')&&!_[_0x8f40('0x4a')](_0x5c1180)){if(!_[_0x8f40('0x40')](_0x3af8b4)&&typeof _0x3af8b4===_0x8f40('0x91')&&!_[_0x8f40('0x4a')](_0x3af8b4)){return util[_0x8f40('0x76')]('\x22%s\x22\x20<%s>',_0x3af8b4,_0x5c1180);}return util[_0x8f40('0x76')]('\x22%s\x22\x20<%s>',_0x5c1180,_0x5c1180);}if(!_[_0x8f40('0x40')](_0x24f682)&&typeof _0x24f682===_0x8f40('0x91')&&!_[_0x8f40('0x4a')](_0x24f682)){return _0x24f682;}return _0x8f40('0x92');}function loggerCatchQueueSummary(_0x47cbaa,_0x5c57c7){return function(_0x536eda){freeVariablesPredictive(_0x5c57c7);emitVoiceQueueSummary(_0x5c57c7);emitCampaignSummary(_0x5c57c7);loggerSyncQueueSummary[_0x8f40('0x93')](_0x47cbaa,util[_0x8f40('0x94')](_0x536eda,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x31d2e8,_0x1e29ff){return function(_0x27f450){loggerPredictive[_0x8f40('0x93')](_0x1e29ff[_0x8f40('0x43')],_0x31d2e8);loggerPredictive[_0x8f40('0x93')](_0x27f450['stack']);freeVariablesPredictive(_0x1e29ff);};}function loggerCatch(_0x1df508){return function(_0x13f8f4){logger[_0x8f40('0x93')](_0x1df508,util['inspect'](_0x13f8f4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5e1ff0){return _0x5e1ff0&&!_['isUndefined'](_0x5e1ff0)&&_0x5e1ff0['length']>0x0;}function decremetOriginate(_0x4d38be){if(!_[_0x8f40('0x40')](_0x4d38be)&&_0x4d38be!==null){if(typeof _0x4d38be[_0x8f40('0x70')]!=='undefined'){if(_0x4d38be[_0x8f40('0x70')]>0x0){_0x4d38be[_0x8f40('0x70')]-=0x1;}else{logger[_0x8f40('0x93')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x8f40('0x93')](_0x8f40('0x95'));}}function checkContactLowerLimitOriginate(_0x3576c9,_0x3a64ce,_0x3578ea){if(_0x3a64ce>_0x3578ea){for(var _0x2a7769=0x0;_0x2a7769<_0x3a64ce-_0x3578ea;_0x2a7769+=0x1){decremetOriginate(_0x3576c9);}}}function loggerGetContactDialer(_0x5341eb,_0x513032,_0x2de2e3){return function(_0x5ed7ee){checkContactLowerLimitOriginate(_0x513032,_0x2de2e3,0x0);logger[_0x8f40('0x93')](_0x5341eb,util[_0x8f40('0x94')](_0x5ed7ee,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a95e1){return function(_0x45df30){if(isNotNull(_0x45df30)&&isNotNull(_0x45df30[0x0])){if(_0x45df30[0x0][_0x8f40('0x96')]>0x0){_0x1a95e1['message']=_0x8f40('0x97');logger[_0x8f40('0x7b')]('[getContactDialer2][ReScheduled]'+_0x1a95e1[_0x8f40('0x43')],_0x45df30[0x0]['contactsRescheduled'],_0x8f40('0x98'));}else{_0x1a95e1[_0x8f40('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x8f40('0x7b')](_0x8f40('0x99')+_0x1a95e1[_0x8f40('0x43')]);}}};}function notSendMessagesQueue(_0x39538b){if(_0x39538b['sendMessageOneNotActive']){freeVariablesPredictive(_0x39538b);if(_0x39538b[_0x8f40('0x70')]===0x0&&_0x39538b['talking']===0x0&&_0x39538b[_0x8f40('0x9a')]===0x0&&(_0x39538b[_0x8f40('0x9b')]||0x0)===0x0){_0x39538b['sendMessageOneNotActive']=![];_0x39538b[_0x8f40('0x9c')]=0x0;_0x39538b[_0x8f40('0x41')]=_0x8f40('0x45');loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0x9d'),_0x39538b[_0x8f40('0x43')],_0x8f40('0x9e'));}else{_0x39538b['message']=_0x8f40('0x9f');loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0x9d'),_0x39538b[_0x8f40('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x39538b);}}function notSendMessagesCampaign(_0x602c17){if(_0x602c17['sendMessageOneNotActive']){if(_0x602c17[_0x8f40('0x70')]===0x0){_0x602c17[_0x8f40('0xa0')]=![];_0x602c17[_0x8f40('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0xa1'),_0x602c17['name'],'is\x20not\x20active');}else{_0x602c17[_0x8f40('0x41')]=_0x8f40('0x9f');loggerSyncQueueSummary[_0x8f40('0x93')](_0x8f40('0xa1'),_0x602c17[_0x8f40('0x43')],_0x8f40('0xa2'));}emitCampaignSummary(_0x602c17);}}function createObjHistory(_0x591390,_0x4c8baf,_0x385082,_0x2e597d,_0x1bb40f){_0x591390[_0x8f40('0x41')]=_0x385082;var _0x31e31e=new Action(_0x591390,_0x4c8baf);var _0x47fe9c=new History(_0x31e31e);_0x47fe9c[_0x8f40('0xa3')]=_0x2e597d;_0x47fe9c[_0x8f40('0xa4')]=_0x1bb40f;_0x47fe9c[_0x8f40('0xa5')]=_0x31e31e[_0x8f40('0xa6')];return _0x47fe9c;}Dialer['prototype'][_0x8f40('0x3f')]=function(){var _0x3be946=this;setInterval(function(){_0x3be946[_0x8f40('0xa7')](_0x3be946['uniqueId'],_0x8f40('0xa8'));_0x3be946[_0x8f40('0xa7')](_0x3be946[_0x8f40('0x24')],_0x8f40('0xa9'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x24f932,_0x2e644e){var _0x2a9655=this;for(var _0x3c3647 in _0x24f932){if(typeof _0x24f932[_0x3c3647]!==_0x8f40('0xaa')){this[_0x8f40('0xab')][_0x8f40('0x1a')](function(){if(!_[_0x8f40('0xac')](_0x24f932[_0x3c3647])){return ami[_0x8f40('0xad')]({'action':_0x8f40('0xae'),'channel':_0x24f932[_0x3c3647]['channel']})[_0x8f40('0xaf')](function(_0x562010){if(_0x562010[_0x8f40('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x24f932[_0x3c3647]&&_0x24f932[_0x3c3647][_0x8f40('0x52')]!=='ivr'){_0x2a9655[_0x8f40('0xb0')](_0x2a9655[_0x8f40('0x1e')][_0x24f932[_0x3c3647][_0x8f40('0xb1')]]);logger[_0x8f40('0x93')]('[Dialer][checkChannel]',_0x2e644e,_0x3c3647,_0x24f932[_0x3c3647][_0x8f40('0xb1')]);delete _0x24f932[_0x3c3647];}if(_0x24f932[_0x3c3647]&&_0x24f932[_0x3c3647][_0x8f40('0x52')]===_0x8f40('0xb2')){_0x2a9655['updateOriginated'](_0x2a9655[_0x8f40('0x1f')][_0x24f932[_0x3c3647]['queue']]);logger[_0x8f40('0x93')](_0x8f40('0xb3'),_0x2e644e,_0x3c3647,_0x24f932[_0x3c3647]['queue']);delete _0x24f932[_0x3c3647];}},0x2328);}});}});}}};Dialer[_0x8f40('0x19')][_0x8f40('0xb4')]=function(_0x328e39){return BPromise['resolve']()['then'](cmHopper[_0x8f40('0xb4')](_0x328e39))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb5')));};Dialer[_0x8f40('0x19')][_0x8f40('0xb6')]=function(_0x397204){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopperBlack[_0x8f40('0xb6')](_0x397204))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb8')));};Dialer[_0x8f40('0x19')][_0x8f40('0xb9')]=function(_0x52ed95){return BPromise[_0x8f40('0xba')]()['then'](cmHopperBlack[_0x8f40('0xb9')](_0x52ed95))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xbb')));};Dialer[_0x8f40('0x19')][_0x8f40('0xbc')]=function(_0x2a00e1){return BPromise[_0x8f40('0xba')]()['then'](cmHopperHistory['avgHandleTime'](_0x2a00e1))['catch'](loggerCatch(_0x8f40('0xbd')));};Dialer[_0x8f40('0x19')][_0x8f40('0xbe')]=function(_0x4e8100){return BPromise[_0x8f40('0xba')]()['then'](cmHopper['rescheduleContact'](_0x4e8100))[_0x8f40('0xaf')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x8f40('0x19')][_0x8f40('0xbf')]=function(_0x2e2762,_0x8c016c,_0x1a854f){return BPromise[_0x8f40('0xba')]()[_0x8f40('0xb7')](cmHopper['unlockContact'](_0x2e2762,_0x8c016c,_0x1a854f))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xc0')));};Dialer['prototype']['getContactDialer']=function(_0x4e678c,_0x471c2d,_0x3fe7b4,_0x3025ca,_0x24e6c4){return BPromise[_0x8f40('0xba')]()[_0x8f40('0xb7')](cmHopper[_0x8f40('0xc1')](_0x4e678c,_0x471c2d,_0x3fe7b4,_0x3025ca))[_0x8f40('0xaf')](function(_0x3dad1e){_0x24e6c4['temp']-=_0x3fe7b4;_0x24e6c4[_0x8f40('0xc2')]=_0x24e6c4[_0x8f40('0xc2')]>0x0?_0x24e6c4[_0x8f40('0xc2')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x3dad1e);});};Dialer['prototype'][_0x8f40('0xc3')]=function(_0x521dd8,_0x36c66a,_0x546295,_0x2dc816){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopper['getContactDialerIvr'](_0x521dd8,_0x36c66a,_0x546295))[_0x8f40('0xaf')](function(_0x5b8f50){_0x2dc816[_0x8f40('0xc2')]-=_0x36c66a;_0x2dc816[_0x8f40('0xc2')]=_0x2dc816[_0x8f40('0xc2')]>0x0?_0x2dc816[_0x8f40('0xc2')]:0x0;loggerCatch(_0x8f40('0xc4'))(_0x5b8f50);});};Dialer[_0x8f40('0x19')]['getVoiceQueueRtPauses']=function(_0x11d04d){return BPromise['resolve']()[_0x8f40('0xb7')](voiceQueueRt[_0x8f40('0xc5')](_0x11d04d))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xc6')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x578d35){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopper[_0x8f40('0xc7')](_0x578d35))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xc8')));};Dialer[_0x8f40('0x19')][_0x8f40('0xc9')]=function(_0x354bc8){return BPromise['resolve']()[_0x8f40('0xb7')](cmHopperHistory[_0x8f40('0xc9')](_0x354bc8))['catch'](loggerCatch(_0x8f40('0xca')));};Dialer[_0x8f40('0x19')][_0x8f40('0xb0')]=function(_0x779808){if(!_['isUndefined'](_0x779808)&&_0x779808!==null){if(typeof _0x779808[_0x8f40('0x70')]!==_0x8f40('0xaa')){if(_0x779808[_0x8f40('0x70')]>0x0){_0x779808[_0x8f40('0x70')]-=0x1;}else{logger[_0x8f40('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x8f40('0x93')](_0x8f40('0xcb'));}};Dialer[_0x8f40('0x19')][_0x8f40('0xcc')]=function(_0x4a5004,_0x27da89){var _0x10fe7e=this;return function(_0x3bf6a2){_0x10fe7e['updateOriginated'](_0x27da89);logger['error'](_0x4a5004,util[_0x8f40('0x94')](_0x3bf6a2,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x8f40('0xcd')]=function(_0x86e081,_0x2ebfe8,_0x183cfd){var _0x32f5f6={'state':0x19,'statedesc':'notFound'};this[_0x8f40('0xb0')](_0x2ebfe8);this[_0x8f40('0xce')](_['merge'](_0x32f5f6,_[_0x8f40('0xcf')](_0x183cfd,['ContactId',_0x8f40('0xd0'),_0x8f40('0xd1'),_0x8f40('0xd2'),'CampaignId'])),_0x8f40('0xd3'),_0x8f40('0xd4'));logger['error'](_0x86e081);};Dialer['prototype'][_0x8f40('0xd5')]=function(_0x2cee7e){return _0x2cee7e==='Success';};Dialer[_0x8f40('0x19')][_0x8f40('0xd6')]=function(_0x106b7d){return!_[_0x8f40('0x40')](_0x106b7d)&&_0x106b7d&&!_[_0x8f40('0x40')](_0x106b7d['name'])&&!_['isUndefined'](_0x106b7d[_0x8f40('0x75')])&&_0x106b7d[_0x8f40('0x75')]&&(this[_0x8f40('0x21')][util[_0x8f40('0x76')](_0x8f40('0xd7'),_0x106b7d[_0x8f40('0x43')])][_0x8f40('0xae')]==='reachable'||this[_0x8f40('0x21')][util[_0x8f40('0x76')](_0x8f40('0xd7'),_0x106b7d[_0x8f40('0x43')])][_0x8f40('0xae')]===_0x8f40('0xd8'));};Dialer[_0x8f40('0x19')][_0x8f40('0xce')]=function(_0x2689f3,_0x283120,_0x5bf035){this[_0x8f40('0xc9')](_0x2689f3)[_0x8f40('0xaf')](loggerCatch(_0x283120));this['moveContactManagedDialer'](_0x2689f3)[_0x8f40('0xaf')](loggerCatch(_0x5bf035));};Dialer[_0x8f40('0x19')][_0x8f40('0x39')]=function(_0x8edc83){var _0x930485=this[_0x8f40('0x25')][_0x8edc83[_0x8f40('0xd9')]];var _0x358b1c;if(!_[_0x8f40('0xac')](_0x8edc83)&&!_[_0x8f40('0xac')](_0x8edc83['variable'])&&!_[_0x8f40('0xac')](_0x8edc83[_0x8f40('0xda')][_0x8f40('0xdb')])&&_0x8edc83[_0x8f40('0xdc')]===_0x8f40('0xdd')&&_0x930485){if(_0x930485[_0x8f40('0x52')]!=='ivr'&&this['voiceQueues'][_0x930485[_0x8f40('0xb1')]][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]===_0x8f40('0xe0')){delete this['uniqueId'][_0x8edc83[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]]);this[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;this[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x358b1c=new Hangup(_0x930485,_0x8edc83);_0x358b1c[_0x8f40('0xa3')]=0x12;_0x358b1c[_0x8f40('0xa4')]=_0x8f40('0xe1');_0x358b1c[_0x8f40('0xe2')]=_0x8f40('0xe3');ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x358b1c,_0x8f40('0xe6')));this[_0x8f40('0xce')](_0x358b1c,_0x8f40('0xe7'),'[syncHangupInAMD]');}if(_0x930485['type']!=='ivr'&&this['voiceQueues'][_0x930485['queue']][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]==='MACHINE'){var _0x1e2ac2=this;return new BPromise(function(_0x427132,_0x314903){delete _0x1e2ac2['uniqueId'][_0x8edc83['uniqueid']];_0x1e2ac2[_0x8f40('0xb0')](_0x1e2ac2[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]]);_0x1e2ac2[_0x8f40('0x1e')][_0x930485['queue']][_0x8f40('0x5f')]+=0x1;_0x1e2ac2[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0x5e')]+=0x1;var _0x2b8218=_0x1e2ac2[_0x8f40('0x1e')][_0x930485[_0x8f40('0xb1')]];var _0x2dee25=new Hangup(_0x930485,_0x8edc83);_0x2dee25['state']=0x13;_0x2dee25[_0x8f40('0xa4')]=_0x8f40('0xe8');_0x2dee25['membername']=_0x8f40('0xe3');_0x2dee25[_0x8f40('0xe9')]+=0x1;_0x2dee25[_0x8f40('0xea')]+=0x1;_0x2dee25[_0x8f40('0xe6')]=!![];ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x2dee25,_0x8f40('0xe6')));_0x1e2ac2[_0x8f40('0xc9')](_0x2dee25)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xeb')));if(_0x2dee25[_0x8f40('0xec')]+_0x2dee25[_0x8f40('0xed')]+_0x2dee25[_0x8f40('0xee')]+_0x2dee25[_0x8f40('0xef')]+_0x2dee25[_0x8f40('0xf0')]+_0x2dee25[_0x8f40('0xf1')]+_0x2dee25['countmachineretry']+_0x2dee25['countagentrejectretry']>=_0x2b8218[_0x8f40('0xf2')]){_0x1e2ac2['stateGlobal'](_0x2dee25,_0x427132,_0x314903,_0x8f40('0xf3'));}else{if(_0x2dee25['countmachineretry']>=_0x2b8218[_0x8f40('0xf4')]){_0x1e2ac2[_0x8f40('0xf5')](_0x2dee25,_0x427132,_0x314903,'reason\x2019\x20machine....');}else{_0x1e2ac2[_0x8f40('0xbe')]({'active':![],'countmachineretry':_0x2dee25[_0x8f40('0xe9')],'scheduledat':moment()[_0x8f40('0xf6')](_0x2b8218[_0x8f40('0xf7')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x2dee25[_0x8f40('0xfa')],'ListId':_0x2dee25[_0x8f40('0xd0')],'VoiceQueueId':_0x2dee25['VoiceQueueId']||undefined,'CampaignId':_0x2dee25[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xfc')));_0x427132({'reschedule':0x1});}}});}if(_0x930485['type']===_0x8f40('0xb2')&&this[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]===_0x8f40('0xe0')){delete this[_0x8f40('0x25')][_0x8edc83['uniqueid']];this[_0x8f40('0xb0')](this['campaigns'][_0x930485[_0x8f40('0xb1')]]);_0x358b1c=new Hangup(_0x930485,_0x8edc83);_0x358b1c[_0x8f40('0xa3')]=0x12;_0x358b1c[_0x8f40('0xa4')]=_0x8f40('0xe1');_0x358b1c['membername']=_0x8f40('0xe3');ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x358b1c,_0x8f40('0xe6')));this[_0x8f40('0xce')](_0x358b1c,_0x8f40('0xfd'),'[syncHangupInAMDIvr]');}if(_0x930485['type']===_0x8f40('0xb2')&&this['campaigns'][_0x930485[_0x8f40('0xb1')]][_0x8f40('0xde')]&&_0x8edc83[_0x8f40('0xdf')]==='MACHINE'){var _0x1e2ac2=this;return new BPromise(function(_0x34b5fa,_0x15aec9){delete _0x1e2ac2[_0x8f40('0x25')][_0x8edc83[_0x8f40('0xd9')]];_0x1e2ac2[_0x8f40('0xb0')](_0x1e2ac2[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]]);_0x1e2ac2[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;_0x1e2ac2[_0x8f40('0x1f')][_0x930485['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0xcfb63d=_0x1e2ac2[_0x8f40('0x1f')][_0x930485[_0x8f40('0xb1')]];var _0x465336=new Hangup(_0x930485,_0x8edc83);_0x465336[_0x8f40('0xa3')]=0x13;_0x465336[_0x8f40('0xa4')]=_0x8f40('0xe8');_0x465336[_0x8f40('0xe2')]=_0x8f40('0xe3');_0x465336[_0x8f40('0xe9')]+=0x1;_0x465336[_0x8f40('0xea')]+=0x1;_0x465336[_0x8f40('0xe6')]=!![];ami[_0x8f40('0x51')](_0x8f40('0xe4'),ut[_0x8f40('0xe5')](_0x465336,_0x8f40('0xe6')));_0x1e2ac2[_0x8f40('0xc9')](_0x465336)[_0x8f40('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x465336[_0x8f40('0xec')]+_0x465336['countcongestionretry']+_0x465336[_0x8f40('0xee')]+_0x465336[_0x8f40('0xef')]+_0x465336['countdropretry']+_0x465336[_0x8f40('0xf1')]+_0x465336[_0x8f40('0xe9')]+_0x465336[_0x8f40('0xfe')]>=_0xcfb63d['dialGlobalMaxRetry']){_0x1e2ac2['stateGlobal'](_0x465336,_0x34b5fa,_0x15aec9,_0x8f40('0xf3'));}else{if(_0x465336[_0x8f40('0xe9')]>=_0xcfb63d['dialMachineMaxRetry']){_0x1e2ac2[_0x8f40('0xf5')](_0x465336,_0x34b5fa,_0x15aec9,_0x8f40('0xff'));}else{_0x1e2ac2['rescheduleContact']({'active':![],'countmachineretry':_0x465336[_0x8f40('0xe9')],'scheduledat':moment()['add'](_0xcfb63d[_0x8f40('0xf7')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x465336[_0x8f40('0xfa')],'ListId':_0x465336['ListId'],'VoiceQueueId':_0x465336[_0x8f40('0xd2')]||undefined,'CampaignId':_0x465336[_0x8f40('0xfb')]||undefined})['catch'](loggerCatch(_0x8f40('0xfc')));_0x34b5fa({'reschedule':0x1});}}});}}};Dialer[_0x8f40('0x19')]['syncHangup']=function(_0x1decc2){var _0x2e0975=this['uniqueId'][_0x1decc2[_0x8f40('0xd9')]];var _0x24534e=this;var _0xd8d38c;if(_0x2e0975&&_0x2e0975['type']===_0x8f40('0xb2')){delete this[_0x8f40('0x25')][_0x1decc2[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this['campaigns'][_0x2e0975[_0x8f40('0xb1')]]);this[_0x8f40('0x1f')][_0x2e0975['queue']][_0x8f40('0x100')]+=0x1;_0xd8d38c=new Hangup(_0x2e0975,_0x1decc2);this[_0x8f40('0xc9')](_0xd8d38c)[_0x8f40('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8f40('0xc7')](_0xd8d38c)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x101')));}if(_0x2e0975&&_0x2e0975[_0x8f40('0x52')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x2e0975[_0x8f40('0xb1')]]['dialQueueProject'])){delete this[_0x8f40('0x25')][_0x1decc2[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]]);this['voiceQueues'][_0x2e0975[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]][_0x8f40('0x5e')]+=0x1;_0xd8d38c=new Hangup(_0x2e0975,_0x1decc2);_0xd8d38c[_0x8f40('0xa3')]=0x10;_0xd8d38c[_0x8f40('0xa4')]='AnswerAGI';_0xd8d38c[_0x8f40('0xe2')]=_0x8f40('0x102');this['createHistory'](_0xd8d38c)['catch'](loggerCatch(_0x8f40('0x103')));this[_0x8f40('0xc7')](_0xd8d38c)['catch'](loggerCatch(_0x8f40('0x101')));}if(_0x2e0975&&_0x2e0975[_0x8f40('0x52')]!=='ivr'&&!isNotNull(this[_0x8f40('0x1e')][_0x2e0975['queue']]['dialQueueProject'])){delete this[_0x8f40('0x25')][_0x1decc2[_0x8f40('0xd9')]];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]]);this[_0x8f40('0x1e')][_0x2e0975[_0x8f40('0xb1')]][_0x8f40('0x68')]+=0x1;_0xd8d38c=new Hangup(_0x2e0975,_0x1decc2);_0xd8d38c[_0x8f40('0xa3')]=0xc;_0xd8d38c[_0x8f40('0xa4')]=_0x1decc2[_0x8f40('0x104')];_0xd8d38c[_0x8f40('0xe2')]='Unknow';this[_0x8f40('0xc9')](_0xd8d38c)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x103')));this[_0x8f40('0xc7')](_0xd8d38c)['catch'](loggerCatch(_0x8f40('0x101')));}};Dialer[_0x8f40('0x19')]['syncAgentComplete']=function(_0xe447a2){var _0x5d3c19=this[_0x8f40('0x25')][_0xe447a2['uniqueid']];var _0x1a7caf=this;if(this[_0x8f40('0x1e')][_0xe447a2[_0x8f40('0xb1')]]){if(_0x5d3c19&&_0x5d3c19[_0x8f40('0x52')]!==_0x8f40('0xb2')){delete this[_0x8f40('0x25')][_0xe447a2['uniqueid']];this[_0x8f40('0x1e')][_0xe447a2[_0x8f40('0xb1')]][_0x8f40('0x5f')]+=0x1;var _0x41ee4a=new AgentComplete(_0x5d3c19,_0xe447a2);if(_0xe447a2['reason']===_0x8f40('0x105')){_0x41ee4a[_0x8f40('0x106')]=this[_0x8f40('0x1e')][_0xe447a2[_0x8f40('0xb1')]][_0x8f40('0x107')]&&this['voiceQueues'][_0xe447a2[_0x8f40('0xb1')]]['dialAgiAfterHangupAgent']?moment()[_0x8f40('0x76')](_0x8f40('0xf9')):undefined;}this[_0x8f40('0xc9')](_0x41ee4a)[_0x8f40('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x41ee4a)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x108')));}}};Dialer[_0x8f40('0x19')]['syncAgentConnect']=function(_0x5e6e64){if(this[_0x8f40('0x1e')][_0x5e6e64[_0x8f40('0xb1')]]){if(this[_0x8f40('0x25')][_0x5e6e64['uniqueid']]&&this[_0x8f40('0x25')][_0x5e6e64[_0x8f40('0xd9')]][_0x8f40('0x52')]!==_0x8f40('0xb2')){this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x5e6e64[_0x8f40('0xb1')]]);this[_0x8f40('0x25')][_0x5e6e64[_0x8f40('0xd9')]][_0x8f40('0x109')]=moment()[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x102c5c){this['createHistory'](_0x102c5c)['catch'](loggerCatch(_0x8f40('0x10a')));this['moveContactManagedDialer'](_0x102c5c)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x10b')));};Dialer[_0x8f40('0x19')][_0x8f40('0x2e')]=function(_0x49535a){var _0x43cb21=this[_0x8f40('0x25')][_0x49535a['uniqueid']];var _0x171503=this;if(this['voiceQueues'][_0x49535a[_0x8f40('0xb1')]]){if(_0x43cb21&&_0x43cb21[_0x8f40('0x52')]!==_0x8f40('0xb2')){delete this['uniqueId'][_0x49535a['uniqueid']];this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][_0x49535a['queue']]);_0x43cb21[_0x8f40('0x10c')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));var _0x51cdbb=new QueueCallerAbandon(_0x43cb21,_0x49535a);if(getSeconds(_0x43cb21[_0x8f40('0x10c')],_0x43cb21['responsetime'])>=_0x43cb21['dialQueueTimeout']){this[_0x8f40('0x1e')][_0x49535a['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x64')]+=0x1;this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x10d')]+=0x1;_0x51cdbb[_0x8f40('0xa3')]=0xa;_0x51cdbb['statedesc']=_0x8f40('0x10e');_0x51cdbb['dropreason']=_0x8f40('0x10f');_0x51cdbb[_0x8f40('0x106')]=this[_0x8f40('0x1e')][_0x49535a['queue']][_0x8f40('0x107')]?moment()[_0x8f40('0x76')](_0x8f40('0xf9')):undefined;_0x51cdbb['countdropretry']+=0x1;_0x51cdbb[_0x8f40('0xea')]+=0x1;if(_0x51cdbb[_0x8f40('0xf0')]>=this['voiceQueues'][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x110')]){this['queueCallerAbandonCreateState'](_0x51cdbb);}else{this[_0x8f40('0xbe')]({'active':![],'countdropretry':_0x51cdbb['countdropretry'],'scheduledat':moment()[_0x8f40('0xf6')](this[_0x8f40('0x1e')][_0x49535a['queue']][_0x8f40('0x111')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x43cb21[_0x8f40('0xfa')],'ListId':_0x43cb21[_0x8f40('0xd0')],'VoiceQueueId':_0x43cb21[_0x8f40('0xd2')]||undefined,'CampaignId':_0x43cb21[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch('[rescheduleContact][Drop]'));var _0x23a457=new History(_0x51cdbb);_0x23a457[_0x8f40('0xa3')]=0xa;_0x23a457['statedesc']=_0x8f40('0x10e');_0x23a457[_0x8f40('0xa6')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));_0x23a457[_0x8f40('0xa5')]=_0x23a457['starttime'];_0x23a457['calleridname']=_0x51cdbb[_0x8f40('0x112')];_0x23a457[_0x8f40('0x113')]=_0x51cdbb[_0x8f40('0x113')];this[_0x8f40('0xc9')](_0x23a457)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x114')));}}else{this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x6b')]+=0x1;this[_0x8f40('0x1e')][_0x49535a[_0x8f40('0xb1')]][_0x8f40('0x63')]+=0x1;_0x51cdbb[_0x8f40('0xa3')]=0xb;_0x51cdbb[_0x8f40('0xa4')]='Abandoned';_0x51cdbb['dropreason']=_0x8f40('0x115');_0x51cdbb[_0x8f40('0xf1')]+=0x1;_0x51cdbb['countglobal']+=0x1;if(_0x51cdbb[_0x8f40('0xf1')]>=this[_0x8f40('0x1e')][_0x49535a['queue']]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x51cdbb);}else{this[_0x8f40('0xbe')]({'active':![],'countabandonedretry':_0x51cdbb[_0x8f40('0xf1')],'scheduledat':moment()[_0x8f40('0xf6')](this['voiceQueues'][_0x49535a['queue']][_0x8f40('0x116')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x43cb21['ContactId'],'ListId':_0x43cb21[_0x8f40('0xd0')],'VoiceQueueId':_0x43cb21['VoiceQueueId']||undefined,'CampaignId':_0x43cb21['CampaignId']||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x117')));var _0x23a457=new History(_0x51cdbb);_0x23a457[_0x8f40('0xa3')]=0xb;_0x23a457[_0x8f40('0xa4')]=_0x8f40('0x118');_0x23a457['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x23a457['endtime']=_0x23a457[_0x8f40('0xa6')];_0x23a457[_0x8f40('0x112')]=_0x51cdbb[_0x8f40('0x112')];_0x23a457[_0x8f40('0x113')]=_0x51cdbb[_0x8f40('0x113')];this['createHistory'](_0x23a457)[_0x8f40('0xaf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x8f40('0x19')][_0x8f40('0x37')]=function(_0x173cbe){if(this['actions'][_0x173cbe[_0x8f40('0xd9')]]){this[_0x8f40('0x24')][_0x173cbe['uniqueid']][_0x8f40('0x119')]=_0x173cbe[_0x8f40('0x119')];}if(this[_0x8f40('0x25')][_0x173cbe[_0x8f40('0xd9')]]){this[_0x8f40('0x25')][_0x173cbe[_0x8f40('0xd9')]]['channel']=_0x173cbe[_0x8f40('0x119')];}};Dialer[_0x8f40('0x19')][_0x8f40('0x3b')]=function(_0x6ab8a4){if(strategy[this[_0x8f40('0x1e')][this[_0x8f40('0x24')][_0x6ab8a4[_0x8f40('0x11a')]]['queue']][_0x8f40('0x54')]]===_0x8f40('0x11b')){if(this[_0x8f40('0x24')][_0x6ab8a4['actionid']]&&_[_0x8f40('0xac')](this[_0x8f40('0x24')][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0x11c')])&&_0x6ab8a4[_0x8f40('0xae')]==='1'&&_0x6ab8a4[_0x8f40('0x11d')]==='0'){if(this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]]){if(!this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]][_0x8f40('0x11c')]){this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]][_0x8f40('0x11c')]=!![];this['actions'][_0x6ab8a4['actionid']][_0x8f40('0x11c')]=!![];this['actions'][_0x6ab8a4['actionid']]['stateinterface']=_0x6ab8a4[_0x8f40('0x11e')];}}}}else if((strategy[this[_0x8f40('0x1e')][this['actions'][_0x6ab8a4[_0x8f40('0x11a')]]['queue']][_0x8f40('0x54')]]||'rrmemory')===_0x8f40('0x18')){if(this['actions'][_0x6ab8a4[_0x8f40('0x11a')]]){if(this[_0x8f40('0x20')][_0x6ab8a4[_0x8f40('0x11e')]]){this['actions'][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0x11e')]=_0x6ab8a4['stateinterface'];if(_['isNil'](this[_0x8f40('0x2a')][this['actions'][_0x6ab8a4[_0x8f40('0x11a')]]['queue']])){this[_0x8f40('0x2a')][this['actions'][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0xb1')]]=[];}this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x6ab8a4[_0x8f40('0x11a')]][_0x8f40('0xb1')]][_0x8f40('0x11f')](_[_0x8f40('0x8c')](_['pick'](this['actions'][_0x6ab8a4['actionid']],[_0x8f40('0x120'),_0x8f40('0x11e')]),{'status':_0x6ab8a4[_0x8f40('0xae')],'paused':_0x6ab8a4['paused']}));}}}};function unlockQueueStatus(_0x404ff4,_0x96792b){setTimeout(function(){if(_[_0x8f40('0x40')](_0x404ff4[_0x8f40('0x121')])){loggerBooked['error'](_0x8f40('0x122'),_0x96792b);}_0x404ff4[_0x8f40('0x121')]=!![];loggerBooked[_0x8f40('0x7b')]('[booked][unlockQueueStatus]',_0x96792b,JSON[_0x8f40('0x4d')](_[_0x8f40('0xcf')](_0x404ff4,['name',_0x8f40('0x121')])));},0x1f3);}Dialer[_0x8f40('0x19')][_0x8f40('0x3d')]=function(_0x58d89c){var _0x532426=this;var _0x29952c=_0x532426[_0x8f40('0x1e')][_0x532426['actions'][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]];if(strategy[this[_0x8f40('0x1e')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]][_0x8f40('0x54')]]==='roundrobin'){if(this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]&&this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['stateinterface']){this[_0x8f40('0x1d')]['run'](this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0x120')],this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['stateinterface'])['catch'](function(_0xd99aa9){logger[_0x8f40('0x93')](_0x8f40('0x123'),util[_0x8f40('0x94')](_0xd99aa9,{'showHidden':![],'depth':null}));})[_0x8f40('0x1c')](function(){_0x532426['updateOriginated'](_0x532426[_0x8f40('0x1e')][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]);_0x532426['agents'][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0x11e')]]['locked']=![];delete _0x532426[_0x8f40('0x24')][_0x58d89c['actionid']];unlockQueueStatus(_0x29952c);});}else{this[_0x8f40('0xb0')](this[_0x8f40('0x1e')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]);this[_0x8f40('0xbe')]({'active':![],'ContactId':this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['ContactId'],'ListId':this['actions'][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xd0')],'VoiceQueueId':this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x124')));delete this[_0x8f40('0x24')][_0x58d89c['actionid']];unlockQueueStatus(_0x29952c);}}else if((strategy[this['voiceQueues'][this[_0x8f40('0x24')][_0x58d89c['actionid']][_0x8f40('0xb1')]]['strategy']]||_0x8f40('0x18'))===_0x8f40('0x18')){var _0x3f5347;if(this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]]&&!_[_0x8f40('0x4a')](this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]])){if(this[_0x8f40('0x125')][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]){this[_0x8f40('0x125')][_0x532426[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]=this[_0x8f40('0x125')][this[_0x8f40('0x24')][_0x58d89c['actionid']]['queue']]?this['queueBookedRR'][this[_0x8f40('0x24')][_0x58d89c['actionid']][_0x8f40('0xb1')]]:this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]?this[_0x8f40('0x2a')][this['actions'][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]]['_rr']||0x0:0x0;}this[_0x8f40('0x2a')][this[_0x8f40('0x24')][_0x58d89c[_0x8f40('0x11a')]][_0x8f40('0xb1')]][_0x8f40('0x126')]=this[_0x8f40('0x125')][this[_0x8f40('0x24')][_0x58d89c['actionid']][_0x8f40('0xb1')]];for(var _0x138943=0x0;_0x138943=0x0;})[_0x8f40('0xaf')](myreject(_0x197843)));}}else{_0x5c9c80[_0x8f40('0x11f')](ami[_0x8f40('0xad')]({'action':_0x8f40('0x141'),'command':util[_0x8f40('0x76')](_0x8f40('0x142'),_0x737cb3,!_[_0x8f40('0x40')](config[_0x8f40('0x13d')][_0x521fac])?_0x521fac:'')})[_0x8f40('0xb7')](function(_0x3e8629){return _0x3e8629['content']['indexOf'](_0x8f40('0x144'))>=0x0;})['catch'](myreject(_0x197843)));}BPromise[_0x8f40('0x145')](_0x5c9c80)[_0x8f40('0xb7')](function(_0x2f8ac2){var _0x329b60=_[_0x8f40('0x146')](_0x2f8ac2);if(_0x329b60){return _0x32bdb0(_0x329b60);}else{_0x47cbda[_0x8f40('0x41')]=_0x3fe6b4?'GLOBAL_INTERVAL_IS_OVERTIME':_0x8f40('0x147');return _0x197843(msgResponse(_0x8f40('0x148'),_0x8f40('0x13a'),_0x8f40('0x149')+_0x3fe6b4+'\x20'+_0x4042f9+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x737cb3,{'showHidden':![],'depth':null})+_0x8f40('0x14a')+_0x521fac));}})[_0x8f40('0xaf')](function(_0x45c564){return _0x197843(msgResponse(_0x8f40('0x138'),_0x8f40('0x13a'),JSON[_0x8f40('0x4d')](_0x45c564)));});});};Dialer[_0x8f40('0x19')]['checkDialMethod']=function(_0x4027eb){var _0x2fa582=this;return function(){switch(_0x4027eb[_0x8f40('0x5a')]){case _0x8f40('0x14b'):freeVariablesPredictive(_0x4027eb);_0x2fa582['handlePower'](_0x4027eb,0x1);break;case _0x8f40('0x14c'):freeVariablesPredictive(_0x4027eb);_0x2fa582[_0x8f40('0x14d')](_0x4027eb,_0x4027eb['dialPowerLevel']);break;case _0x8f40('0x9'):_0x2fa582['predictive'](_0x4027eb);break;case'booked':freeVariablesPredictive(_0x4027eb);_0x2fa582['handlePower'](_0x4027eb,0x1);break;default:freeVariablesPredictive(_0x4027eb);logger[_0x8f40('0x93')]('Queue',_0x4027eb[_0x8f40('0x43')],'method\x20not\x20recognized');}};};Dialer[_0x8f40('0x19')][_0x8f40('0x14e')]=function(_0x48c0b7){var _0x30e7c2=this;return function(){_0x30e7c2['handleIvr'](_0x48c0b7);};};Dialer[_0x8f40('0x19')][_0x8f40('0x33')]=function(_0x43e9c6){var _0x419fbd=this;if(isNotPreview(_0x43e9c6[_0x8f40('0x5a')])){if(isVoiceQueueOutbound(_0x43e9c6[_0x8f40('0x52')])&&isActive(_0x43e9c6[_0x8f40('0x59')])){_0x43e9c6['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x8f40('0xb7')](checkIsLoggedIn(_0x43e9c6,_0x43e9c6['loggedIn']))[_0x8f40('0xb7')](checkIsActive(_0x43e9c6,_0x43e9c6[_0x8f40('0x59')]))[_0x8f40('0xb7')](checkInterval(_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd['checkIsTrunkReachable'](_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd[_0x8f40('0x137')](_0x43e9c6[_0x8f40('0x14f')],_0x43e9c6[_0x8f40('0x150')],_0x43e9c6[_0x8f40('0x43')],_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd[_0x8f40('0x139')](_0x43e9c6[_0x8f40('0x46')],_0x43e9c6['dialTimezone'],_0x43e9c6[_0x8f40('0x43')],_0x43e9c6))[_0x8f40('0xb7')](_0x419fbd[_0x8f40('0x151')](_0x43e9c6))[_0x8f40('0xaf')](loggerCatchQueueSummary(_0x8f40('0x152'),_0x43e9c6));}else{notSendMessagesQueue(_0x43e9c6);}}else{freeVariablesPredictive(_0x43e9c6);}};Dialer[_0x8f40('0x19')][_0x8f40('0x133')]=function(){var _0x5f4a79=this;var _0x47d274;for(var _0x54798c in this[_0x8f40('0x1f')]){if(typeof this['campaigns'][_0x54798c]!==_0x8f40('0xaa')){_0x47d274=this[_0x8f40('0x1f')][_0x54798c];if(isCampaignIvr(_0x47d274[_0x8f40('0x52')])&&isActive(_0x47d274['active'])){_0x47d274[_0x8f40('0xa0')]=!![];BPromise[_0x8f40('0xba')]()['then'](checkIsActive(_0x47d274,_0x47d274[_0x8f40('0x75')]))[_0x8f40('0xb7')](checkInterval(_0x47d274))[_0x8f40('0xb7')](_0x5f4a79[_0x8f40('0x153')](_0x47d274))[_0x8f40('0xb7')](_0x5f4a79[_0x8f40('0x137')](_0x47d274['dialGlobalInterval'],_0x47d274['dialTimezone'],_0x47d274[_0x8f40('0x43')],_0x47d274))['then'](_0x5f4a79[_0x8f40('0x139')](_0x47d274[_0x8f40('0x46')],_0x47d274['dialTimezone'],_0x47d274[_0x8f40('0x43')],_0x47d274))[_0x8f40('0xb7')](_0x5f4a79[_0x8f40('0x14e')](_0x47d274))[_0x8f40('0xaf')](loggerCatchQueueSummary(_0x8f40('0x154'),_0x47d274));}else{notSendMessagesCampaign(_0x47d274);}}}};function getCallerIdRandom(_0x150f84,_0x4c98e3){var _0x441303;var _0x343e00;var _0x2cc176;if(_0x4c98e3<=0x0){_0x4c98e3=0x1;}_0x441303=new RegExp(_0x8f40('0x155')+_0x4c98e3+'}$');_0x343e00=Math[_0x8f40('0x156')](0xa,_0x4c98e3-0x1);_0x2cc176=Math[_0x8f40('0x156')](0xa,_0x4c98e3)-0x1;return util[_0x8f40('0x76')]('%s',_[_0x8f40('0x157')](_0x150f84,_0x441303,_[_0x8f40('0x158')](_0x343e00,_0x2cc176)));}function extractCalleridName(_0x1d2457){var _0x31af9e=_0x1d2457[_0x8f40('0x159')](/"(.*?)"/);return _0x31af9e?_0x31af9e[0x1]:_0x1d2457;}function extractCalleridNumber(_0x4e394c){var _0x5774b7=_0x4e394c[_0x8f40('0x159')](/<(.*?)>/);return _0x5774b7?_0x5774b7[0x1]:_0x4e394c;}Dialer[_0x8f40('0x19')]['actionOriginate']=function(_0x4b4416,_0x3370e4){var _0x141678=this;var _0x511c68=uuid['v4']();this[_0x8f40('0x24')][_0x511c68]=new Action(_0x4b4416,_0x3370e4,_0x511c68);return new BPromise(function(_0x3253ab,_0xe847bd){if(_[_0x8f40('0x40')](_0x4b4416)&&typeof _0x4b4416!==_0x8f40('0x15a')){return _0xe847bd(msgResponse(_0x8f40('0x15b'),_0x8f40('0x13a'),_0x8f40('0x15c')));}if(_['isUndefined'](_0x3370e4[_0x8f40('0x15d')][_0x8f40('0x15e')])||_0x3370e4['Contact'][_0x8f40('0x15e')]===null){return _0xe847bd(msgResponse('originate',_0x8f40('0x13a'),_0x8f40('0x15f')));}var _0xbff6df={'XMD-CALLERID':_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x160')](),'XMD-AGI':_0x4b4416['dialQueueProject']?util[_0x8f40('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4b4416[_0x8f40('0x161')]):_0x8f40('0x162'),'XMD-AGIAFTER':_0x4b4416['dialQueueProject2']?util[_0x8f40('0x76')](_0x8f40('0x163'),ipAgi,_0x4b4416[_0x8f40('0x107')]):'NONE','XMD-QUEUE':_0x4b4416[_0x8f40('0x52')]===_0x8f40('0x53')?util[_0x8f40('0x76')](_0x8f40('0x164'),_0x4b4416[_0x8f40('0x43')],_0x4b4416[_0x8f40('0x165')]||'',_0x4b4416[_0x8f40('0x166')]?'c':'',_0x4b4416['dialQueueTimeout']||0x3):_0x8f40('0x162'),'XMD-CONTACTID':_0x3370e4[_0x8f40('0xfa')],'XMD-CDRTYPE':_0x8f40('0x7'),'CALLERID(all)':_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x160')](),'XMD-AMD':_0x4b4416[_0x8f40('0xde')]?_0x8f40('0x167'):_0x8f40('0x162'),'XMD-DESTINATION':_0x8f40('0xdd')};if(_0x4b4416['dialAMDActive']){_0xbff6df[_0x8f40('0x168')]=_0x4b4416[_0x8f40('0x169')]||0x9c4;_0xbff6df[_0x8f40('0x16a')]=_0x4b4416[_0x8f40('0x16b')]||0x5dc;_0xbff6df['XMD-AMDAFTERGREETINGSILENCE']=_0x4b4416[_0x8f40('0x16c')]||0x320;_0xbff6df[_0x8f40('0x16d')]=_0x4b4416[_0x8f40('0x16e')]||0x1388;_0xbff6df['XMD-AMDMINWORDLENGTH']=_0x4b4416[_0x8f40('0x16f')]||0x64;_0xbff6df[_0x8f40('0x170')]=_0x4b4416[_0x8f40('0x171')]||0x32;_0xbff6df[_0x8f40('0x172')]=_0x4b4416[_0x8f40('0x173')]||0x3;_0xbff6df[_0x8f40('0x174')]=_0x4b4416[_0x8f40('0x175')]||0x100;_0xbff6df['XMD-AMDMAXIMUMWORDLENGTH']=_0x4b4416[_0x8f40('0x176')]||0x1388;}if(_0x4b4416['type']===_0x8f40('0x53')){_0xbff6df[_0x8f40('0x177')]=_0x3370e4[_0x8f40('0xd2')];}else{_0xbff6df[_0x8f40('0x178')]=_0x3370e4[_0x8f40('0xfb')];}for(var _0x3649bd in _0x3370e4[_0x8f40('0x15d')]){if(typeof _0x3370e4[_0x8f40('0x15d')][_0x3649bd]!==_0x8f40('0xaa')){if(isNotNull(_0x3370e4[_0x8f40('0x15d')][_0x3649bd])&&_0x3649bd!=='id'&&_0x3649bd!==_0x8f40('0x179')&&_0x3649bd!==_0x8f40('0x17a')&&_0x3649bd!==_0x8f40('0x17b')){_0xbff6df[util['format']('%s%s',_0x8f40('0x17c'),_[_0x8f40('0x17d')](_0x3649bd))]=_0x3370e4[_0x8f40('0x15d')][_0x3649bd];}}}var _0x43a90c=_0x141678[_0x8f40('0xd6')](_0x4b4416[_0x8f40('0x74')])?getCallerId(_0x4b4416[_0x8f40('0x74')][_0x8f40('0x17e')],_0x4b4416['dialOriginateCallerIdName'],_0x4b4416[_0x8f40('0x17f')]>0x0?getCallerIdRandom(_0x4b4416['dialOriginateCallerIdNumber'],_0x4b4416['dialRandomLastDigitCallerIdNumber']):_0x4b4416[_0x8f40('0x5b')]):getCallerId(_[_0x8f40('0xac')](_0x4b4416[_0x8f40('0x134')])?_0x4b4416[_0x8f40('0x74')][_0x8f40('0x17e')]:_0x4b4416[_0x8f40('0x134')][_0x8f40('0x17e')],_0x4b4416[_0x8f40('0x180')],_0x4b4416['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4b4416[_0x8f40('0x5b')],_0x4b4416[_0x8f40('0x17f')]):_0x4b4416['dialOriginateCallerIdNumber']);if(_0x43a90c){_0xbff6df[_0x8f40('0x181')]=_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x182')]=extractCalleridName(_0x43a90c);_0xbff6df[_0x8f40('0x183')]=_0x141678[_0x8f40('0x24')][_0x511c68][_0x8f40('0x184')]=extractCalleridNumber(_0x43a90c);}return ami['Action']({'actionid':_0x511c68,'action':'originate','channel':_0x141678[_0x8f40('0xd6')](_0x4b4416[_0x8f40('0x74')])?util[_0x8f40('0x76')](_0x8f40('0x185'),_0x4b4416[_0x8f40('0x74')][_0x8f40('0x43')],isNotNull(_0x4b4416[_0x8f40('0x5d')])?_0x4b4416['dialPrefix'][_0x8f40('0x186')]()||'':'',_0x4b4416[_0x8f40('0x187')]>0x0?_0x3370e4['Contact'][_0x8f40('0x15e')]['substring'](_0x4b4416[_0x8f40('0x187')]):_0x3370e4[_0x8f40('0x15d')]['phone']):util['format'](_0x8f40('0x185'),_[_0x8f40('0xac')](_0x4b4416['TrunkBackup'])?_0x4b4416[_0x8f40('0x74')][_0x8f40('0x43')]:_0x4b4416[_0x8f40('0x134')][_0x8f40('0x43')],isNotNull(_0x4b4416[_0x8f40('0x5d')])?_0x4b4416['dialPrefix'][_0x8f40('0x186')]()||'':'',_0x4b4416[_0x8f40('0x187')]>0x0?_0x3370e4['Contact'][_0x8f40('0x15e')]['substring'](_0x4b4416['dialCutDigit']):_0x3370e4['Contact'][_0x8f40('0x15e')]),'callerid':_0x43a90c,'Exten':_0x8f40('0xdd'),'Context':'from-sip','Priority':'1','variable':_0xbff6df,'timeout':(_0x4b4416['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x511c68})[_0x8f40('0xb7')](function(_0x5c7b01){return _0x3253ab(_0x5c7b01);})[_0x8f40('0xaf')](function(_0x33ca0e){_0x4b4416['outboundOriginateFailureCallsDay']+=0x1;var _0x5d1b3a=new History(_0x141678[_0x8f40('0x24')][_0x511c68]);logger[_0x8f40('0x93')](util[_0x8f40('0x76')]('[originateError]:\x20%s',JSON[_0x8f40('0x4d')](_0x33ca0e)));_0x5d1b3a[_0x8f40('0xa3')]=0xe;_0x5d1b3a[_0x8f40('0xa4')]=_0x8f40('0x188');_0x5d1b3a[_0x8f40('0xa6')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));_0x5d1b3a[_0x8f40('0xa5')]=_0x5d1b3a['starttime'];_0x141678[_0x8f40('0xc9')](_0x5d1b3a)['catch'](loggerCatch(_0x8f40('0x189')));_0x141678[_0x8f40('0xc7')](_0x5d1b3a)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x189')))[_0x8f40('0x1c')](function(){delete _0x141678[_0x8f40('0x24')][_0x511c68];return _0xe847bd(msgResponse(_0x8f40('0x15b'),_0x8f40('0x4c'),_0x8f40('0x18a')));});});});};Dialer[_0x8f40('0x19')][_0x8f40('0x30')]=function(_0x417add){var _0x3c17af=this['actions'][_0x417add['actionid']];if(_0x3c17af){delete this[_0x8f40('0x24')][_0x417add[_0x8f40('0x11a')]];_0x3c17af[_0x8f40('0x18b')]=moment()['format'](_0x8f40('0xf9'));var _0x1fd086=_0x3c17af[_0x8f40('0x52')]===_0x8f40('0xb2')?this[_0x8f40('0x1f')][_0x3c17af['queue']]:this[_0x8f40('0x1e')][_0x3c17af['getQueue']()];if(!this[_0x8f40('0xd5')](_0x417add[_0x8f40('0x18c')])){this['updateOriginated'](_0x1fd086);return this['callProgressDetecting'](_0x3c17af,_0x1fd086,_0x417add)['catch'](loggerCatch(_0x8f40('0x18d')));}this[_0x8f40('0x25')][_0x417add[_0x8f40('0xd9')]]=_0x3c17af;}};Dialer[_0x8f40('0x19')][_0x8f40('0x18e')]=function(_0x2261c2,_0x199f38,_0x7857a1){var _0x4da147=new History(_0x199f38);if(_0x4da147[_0x8f40('0xec')]+_0x4da147[_0x8f40('0xed')]+_0x4da147[_0x8f40('0xee')]+_0x4da147['countnosuchnumberretry']+_0x4da147[_0x8f40('0xf0')]+_0x4da147[_0x8f40('0xf1')]+_0x4da147[_0x8f40('0xe9')]+_0x4da147[_0x8f40('0xfe')]>=_0x7857a1[_0x8f40('0xf2')]-0x1){return!![];}switch(_0x2261c2){case 0x3:if(_0x4da147[_0x8f40('0xee')]>=_0x7857a1[_0x8f40('0x18f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4da147[_0x8f40('0xee')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1['dialNoAnswerRetryFrequency'],'minutes')[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147['ListId'],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147['CampaignId']||undefined})['catch'](loggerCatch(_0x8f40('0x190')));break;case 0x5:if(_0x4da147[_0x8f40('0xec')]>=_0x7857a1[_0x8f40('0x191')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countbusyretry':_0x4da147[_0x8f40('0xec')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1['dialBusyRetryFrequency'],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147['ListId'],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4da147[_0x8f40('0xed')]>=_0x7857a1['dialCongestionMaxRetry']-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countcongestionretry':_0x4da147[_0x8f40('0xed')]+=0x1,'scheduledat':moment()['add'](_0x7857a1[_0x8f40('0x192')],_0x8f40('0xf8'))['format'](_0x8f40('0xf9')),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147['VoiceQueueId']||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x193')));break;case 0x0:if(_0x4da147[_0x8f40('0xef')]>=_0x7857a1[_0x8f40('0x194')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4da147[_0x8f40('0xef')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1[_0x8f40('0x195')],_0x8f40('0xf8'))['format'](_0x8f40('0xf9')),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4da147[_0x8f40('0xf0')]>=_0x7857a1[_0x8f40('0x110')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countdropretry':_0x4da147['countdropretry']+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1['dialDropRetryFrequency'],_0x8f40('0xf8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147['CampaignId']||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x196')));break;case 0xb:if(_0x4da147[_0x8f40('0xf1')]>=_0x7857a1[_0x8f40('0x197')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countabandonedretry':_0x4da147[_0x8f40('0xf1')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1[_0x8f40('0x116')],_0x8f40('0xf8'))[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da147['ContactId'],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4da147[_0x8f40('0xe9')]>=_0x7857a1['dialMachineMaxRetry']-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countmachineretry':_0x4da147[_0x8f40('0xe9')]+=0x1,'scheduledat':moment()[_0x8f40('0xf6')](_0x7857a1[_0x8f40('0xf7')],_0x8f40('0xf8'))[_0x8f40('0x76')](_0x8f40('0xf9')),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147[_0x8f40('0xd0')],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4da147['countagentrejectretry']>=_0x7857a1[_0x8f40('0x198')]-0x1){return!![];}this[_0x8f40('0xbe')]({'active':![],'countagentrejectretry':_0x4da147['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x7857a1[_0x8f40('0x199')],'minutes')[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da147[_0x8f40('0xfa')],'ListId':_0x4da147['ListId'],'VoiceQueueId':_0x4da147[_0x8f40('0xd2')]||undefined,'CampaignId':_0x4da147[_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x19a')));break;default:return!![];}};Dialer[_0x8f40('0x19')][_0x8f40('0x19b')]=function(_0x55f32d,_0x5256ff,_0x16886f){var _0x1740f1=this;var _0x23467b=new History(_0x55f32d);return new BPromise(function(_0x2df1a6,_0x13c3c9){if(_[_0x8f40('0x40')](_0x5256ff)&&typeof _0x5256ff!==_0x8f40('0x15a')){return _0x13c3c9(msgResponse('[callProgressDetecting]',_0x8f40('0x13a'),_0x8f40('0x19c')));}if(_['isUndefined'](_0x16886f)&&typeof _0x16886f!==_0x8f40('0x15a')){return _0x13c3c9(msgResponse('[callProgressDetecting]','Failure',_0x8f40('0x19d')));}switch(_0x16886f['reason']){case'0':_0x5256ff[_0x8f40('0x66')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0x0;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x19e');_0x23467b[_0x8f40('0xef')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')](_0x8f40('0x19f'),ut[_0x8f40('0xe5')](_0x55f32d,_0x8f40('0x1a0')));_0x1740f1[_0x8f40('0xc9')](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xeb')));if(_0x1740f1['checkRetriveMax'](0x0,_0x55f32d,_0x5256ff)){if(_0x23467b['countnosuchnumberretry']>=_0x5256ff[_0x8f40('0x194')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x200\x20no\x20such\x20number....');}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5256ff[_0x8f40('0x65')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0x3;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x1a2');_0x23467b['countnoanswerretry']+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')]('custom:agentnoanswer',ut[_0x8f40('0xe5')](_0x55f32d,_0x8f40('0x1a3')));_0x1740f1['createHistory'](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1a4')));if(_0x1740f1[_0x8f40('0x18e')](0x3,_0x55f32d,_0x5256ff)){if(_0x23467b[_0x8f40('0xee')]>=_0x5256ff[_0x8f40('0x18f')]){_0x1740f1['createStateFinal'](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1740f1['stateGlobal'](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1a5'));}}break;case'5':_0x5256ff['outboundBusyCallsDay']+=0x1;_0x23467b[_0x8f40('0xa3')]=0x5;_0x23467b['statedesc']='Busy';_0x23467b[_0x8f40('0xec')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')](_0x8f40('0x1a6'),ut[_0x8f40('0xe5')](_0x55f32d,'busy'));_0x1740f1[_0x8f40('0xc9')](_0x23467b)['catch'](loggerCatch(_0x8f40('0x1a7')));if(_0x1740f1[_0x8f40('0x18e')](0x5,_0x55f32d,_0x5256ff)){if(_0x23467b[_0x8f40('0xec')]>=_0x5256ff[_0x8f40('0x191')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x205\x20busy');}else{_0x1740f1['stateGlobal'](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1a8'));}}break;case'8':_0x5256ff[_0x8f40('0x1a9')]+=0x1;_0x23467b['state']=0x8;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x1aa');_0x23467b[_0x8f40('0xed')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami[_0x8f40('0x51')](_0x8f40('0x1ab'),ut[_0x8f40('0xe5')](_0x55f32d,_0x8f40('0x1ac')));_0x1740f1[_0x8f40('0xc9')](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1ad')));if(_0x1740f1[_0x8f40('0x18e')](0x8,_0x55f32d,_0x5256ff)){if(_0x23467b['countcongestionretry']>=_0x5256ff[_0x8f40('0x1ae')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,'reason\x208\x20congestion');}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1af'));}}break;case'11':_0x5256ff[_0x8f40('0x1b0')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0xb;_0x23467b[_0x8f40('0xa4')]=_0x8f40('0x118');_0x23467b[_0x8f40('0xf1')]+=0x1;_0x23467b['countglobal']+=0x1;_0x1740f1['createHistory'](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1b1')));if(_0x1740f1[_0x8f40('0x18e')](0xb,_0x55f32d,_0x5256ff)){if(_0x23467b['countabandonedretry']>=_0x5256ff[_0x8f40('0x197')]){_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b2'));}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b2'));}}break;case'20':_0x5256ff[_0x8f40('0x1b3')]+=0x1;_0x23467b[_0x8f40('0xa3')]=0x14;_0x23467b['statedesc']='AgentReject';_0x23467b[_0x8f40('0xfe')]+=0x1;_0x23467b[_0x8f40('0xea')]+=0x1;ami['emit'](_0x8f40('0x1b4'),ut[_0x8f40('0xe5')](_0x55f32d,'agentreject'));_0x1740f1[_0x8f40('0xc9')](_0x23467b)[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1b5')));if(_0x1740f1[_0x8f40('0x18e')](0x14,_0x55f32d,_0x5256ff)){if(_0x23467b['countagentrejectretry']>=_0x5256ff[_0x8f40('0x198')]){_0x1740f1['createStateFinal'](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b6'));}else{_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x8f40('0x1b6'));}}break;default:_0x5256ff[_0x8f40('0x68')]+=0x1;_0x23467b['state']=0xc;_0x23467b[_0x8f40('0xa4')]=_0x16886f['reason'];_0x1740f1[_0x8f40('0xc9')](_0x23467b)['catch'](loggerCatch(_0x8f40('0x1b7')));if(_0x1740f1[_0x8f40('0x18e')](_0x16886f[_0x8f40('0x1b8')],_0x55f32d,_0x5256ff)){if(_0x23467b['countbusyretry']+_0x23467b[_0x8f40('0xed')]+_0x23467b[_0x8f40('0xee')]+_0x23467b[_0x8f40('0xef')]+_0x23467b[_0x8f40('0xf0')]+_0x23467b[_0x8f40('0xf1')]+_0x23467b[_0x8f40('0xe9')]+_0x23467b['countagentrejectretry']>=_0x5256ff[_0x8f40('0xf2')]){_0x1740f1[_0x8f40('0x1a1')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x16886f[_0x8f40('0x1b8')]);}else{_0x1740f1[_0x8f40('0xf5')](_0x23467b,_0x2df1a6,_0x13c3c9,_0x16886f['reason']);}}}});};Dialer[_0x8f40('0x19')][_0x8f40('0x1a1')]=function(_0x4f1a90,_0xa0d8c,_0xcb0600,_0x5acc40){var _0x2492ae=new Final(_0x4f1a90);_0x2492ae[_0x8f40('0xa3')]=0xf;_0x2492ae[_0x8f40('0xa4')]=_0x8f40('0x1b9');this[_0x8f40('0xf5')](_0x2492ae,_0xa0d8c,_0xcb0600,_0x5acc40);};Dialer[_0x8f40('0x19')][_0x8f40('0xf5')]=function(_0x1066e8,_0x96b48d,_0x179fcd,_0x29ccda){this['moveContactManagedDialer'](_0x1066e8)[_0x8f40('0xb7')](function(){return _0x96b48d(msgResponse(_0x8f40('0x1ba'),'Success',_0x29ccda));})['catch'](function(){return _0x179fcd(msgResponse(_0x8f40('0x1bb'),_0x8f40('0x13a'),_0x8f40('0x1bc')));});};Dialer[_0x8f40('0x19')]['predictive']=function(_0x38680b){var _0x3cedbd=_0x38680b[_0x8f40('0x1bd')]/0x64;var _0x5b769b=_0x38680b['outboundDropCallsDayTimeout']/(_0x38680b[_0x8f40('0x64')]+_0x38680b[_0x8f40('0x5f')]);var _0x196d2e=Math['round'](_0x38680b[_0x8f40('0x6e')]*(_0x38680b['predictiveIntervalMaxThreshold']/0x64));var _0x3c74f2=Math[_0x8f40('0x1be')](_0x38680b[_0x8f40('0x6e')]*(_0x38680b[_0x8f40('0x1bf')]/0x64));var _0x34aa2c=_0x38680b[_0x8f40('0x9c')]+_0x38680b['talking'];var _0xfe99c8=Math[_0x8f40('0x1c0')](_0x38680b['erlangCalls']*_0x38680b[_0x8f40('0x72')]*_0x38680b['predictiveIntervalHitRate']*_0x38680b[_0x8f40('0x1c1')]);if(_[_0x8f40('0x40')](_0x38680b[_0x8f40('0x28')])){if(!_[_0x8f40('0x40')](_0x38680b['startPredictive'])){_0x38680b[_0x8f40('0x27')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x8f40('0x1c2'));}if(!_['isUndefined'](_0x38680b[_0x8f40('0x8f')])){loggerPredictive[_0x8f40('0x93')](_0x8f40('0x1c3'),_0x8f40('0x1c4'));clearInterval(_0x38680b[_0x8f40('0x8f')]);_0x38680b[_0x8f40('0x8f')]=undefined;}_0x38680b[_0x8f40('0x28')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x38680b[_0x8f40('0x28')]);this['handlePower'](_0x38680b,0x1);}else if(ifInterval(_0x38680b[_0x8f40('0x1c5')],_0x38680b[_0x8f40('0x28')])){this[_0x8f40('0x14d')](_0x38680b,0x1);loggerPredictiveCalls[_0x8f40('0x7b')](_0x8f40('0x1c6'),_0x38680b[_0x8f40('0x28')],_0x38680b[_0x8f40('0x43')]);_0x38680b[_0x8f40('0x71')]=0x0;_0x38680b[_0x8f40('0x10d')]=0x0;}else if(_0x3cedbd<_0x5b769b&&_0x38680b[_0x8f40('0x1c7')]===_0x8f40('0x1c8')){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x1c9'),'Dropped\x20calls\x20day',_0x5b769b,_0x8f40('0x28'),_0x38680b['name']);}else if(_0xfe99c8<_0x38680b[_0x8f40('0x10d')]&&_0x38680b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x1ca'),'Max\x20Drop\x20',_0xfe99c8,_0x8f40('0x1cb'),_0x38680b[_0x8f40('0x10d')],'startProgressive',_0x38680b['name']);}else if(!ifInterval(_0x38680b[_0x8f40('0x1c5')],_0x38680b[_0x8f40('0x28')])&&_['isUndefined'](_0x38680b[_0x8f40('0x27')])&&!_['isUndefined'](_0x38680b[_0x8f40('0x28')])){_0x38680b[_0x8f40('0x27')]=moment()[_0x8f40('0x76')](_0x8f40('0xf9'));loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],_0x8f40('0x1cc'),_0x38680b['startPredictive']);this['averageHandleTime'](_0x38680b[_0x8f40('0x1c5')])['then'](this[_0x8f40('0x1cd')](_0x38680b))[_0x8f40('0xb7')](mergeDataErlangB(_0x38680b))['then'](this['startMethodPredictive'](_0x38680b))[_0x8f40('0xaf')](loggerCatchPredictive(_0x8f40('0x1ce'),_0x38680b));}else if(!ifInterval(_0x38680b['dialPredictiveInterval'],_0x38680b[_0x8f40('0x27')])){_0x38680b[_0x8f40('0x10d')]=0x0;_0x38680b[_0x8f40('0x27')]=moment()[_0x8f40('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],'recalculate\x20predictive\x20at',_0x38680b[_0x8f40('0x27')]);clearInterval(_0x38680b[_0x8f40('0x8f')]);_0x38680b['handlePredictive']=undefined;this['averageHandleTime'](_0x38680b[_0x8f40('0x1c5')])[_0x8f40('0xb7')](this[_0x8f40('0x1cd')](_0x38680b))['then'](mergeDataErlangB(_0x38680b))['then'](this[_0x8f40('0x1cf')](_0x38680b))['catch'](loggerCatchPredictive(_0x8f40('0x1d0'),_0x38680b));}else if(_0x38680b[_0x8f40('0x6e')]&&_0x34aa2c<_0x38680b['predictiveIntervalAvailable']-_0x3c74f2){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],_0x8f40('0x1d1'),_0x34aa2c,_0x8f40('0x1d2'),_0x38680b[_0x8f40('0x6e')],'-',_0x3c74f2,'=',_0x38680b['predictiveIntervalAvailable']-_0x3c74f2,')');}else if(_0x38680b[_0x8f40('0x6e')]&&_0x34aa2c>_0x38680b[_0x8f40('0x6e')]+_0x196d2e){freeVariablesPredictive(_0x38680b);loggerPredictive[_0x8f40('0x7b')](_0x38680b[_0x8f40('0x43')],_0x8f40('0x1d1'),_0x34aa2c,_0x8f40('0x1d3'),_0x38680b[_0x8f40('0x6e')],'+',_0x196d2e,'=',_0x38680b[_0x8f40('0x6e')]+_0x196d2e,')');}};Dialer[_0x8f40('0x19')]['getDataPredictive']=function(_0x15005c){var _0x8ad867=this;return function(_0x1a86c7){return new BPromise(function(_0x411405,_0x56045a){_[_0x8f40('0x8c')](_0x15005c,_0x1a86c7[0x0]);if(checkGetDataPredictive(_0x1a86c7[0x0])){var _0x2b397c=_0x15005c['predictiveIntervalAvailable']=_0x15005c[_0x8f40('0x57')]+_0x15005c[_0x8f40('0x9c')];var _0x1070be=_0x15005c[_0x8f40('0x1c5')]*0x3c;var _0x592931=_0x1a86c7[0x0][_0x8f40('0x6a')]+_0x1a86c7[0x0][_0x8f40('0x69')];var _0x3795cb=(_0x1a86c7[0x0][_0x8f40('0x7f')]+_0x1a86c7[0x0][_0x8f40('0x1d4')]+_0x1a86c7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1a86c7[0x0]['predictiveIntervalTotalCalls'];_0x15005c['predictiveIntervalHitRate']=_0x3795cb>0x0?_0x3795cb:0x1;switch(_0x15005c['dialPredictiveOptimization']){case _0x8f40('0x1c8'):var _0x39c94f=_0x15005c['dialPredictiveOptimizationPercentage']/0x64;return _0x8ad867[_0x8f40('0x1d5')](_0x2b397c,_0x1070be,_0x592931,_0x3795cb,_0x39c94f)['then'](function(_0x365767){return _0x411405(_0x365767);});case _0x8f40('0x1d6'):var _0x13baa8=_0x15005c['dialPredictiveOptimizationPercentage']/0x64;return _0x8ad867[_0x8f40('0x1d7')](_0x2b397c,_0x1070be,_0x592931,_0x3795cb,_0x13baa8)[_0x8f40('0xb7')](function(_0x1bfadc){return _0x411405(_0x1bfadc);});default:return _0x56045a(msgResponse(_0x8f40('0x1d8'),_0x8f40('0x13a'),_0x8f40('0x1d9')));}}else{return _0x56045a(msgResponse(_0x8f40('0x1d8'),'Failure',_0x8f40('0x1da')));}});};};Dialer[_0x8f40('0x19')][_0x8f40('0x1db')]=function(_0x584bba){var _0x270452=this;return function(_0xfc55f2){return new BPromise(function(_0x2aeb4d,_0x4ad0ae){_[_0x8f40('0x8c')](_0x584bba,_0xfc55f2[0x0]);if(checkGetDataPredictive(_0xfc55f2[0x0])){loggerPredictive['info'](JSON[_0x8f40('0x4d')](_0xfc55f2[0x0]));if(_0x584bba['dialPredictiveOptimization']===_0x8f40('0x1c8')){return _0x270452[_0x8f40('0xc5')](_0x584bba['id'])[_0x8f40('0xb7')](function(_0x4591fb){var _0x1d9a2=_0x584bba[_0x8f40('0x1dc')]-_0x4591fb[0x0][_0x8f40('0x1dd')];var _0x5a901b=_0x584bba[_0x8f40('0x1c5')]*0x3c;var _0x4d78d6=_0xfc55f2[0x0]['predictiveIntervalAvgTalktime']+_0xfc55f2[0x0][_0x8f40('0x69')];var _0x1c8c1c=(_0xfc55f2[0x0][_0x8f40('0x7f')]+_0xfc55f2[0x0][_0x8f40('0x1d4')]+_0xfc55f2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xfc55f2[0x0][_0x8f40('0x6f')];var _0x117b2c=_0x584bba[_0x8f40('0x1bd')]/0x64;_0x584bba[_0x8f40('0x1de')]=_0x4591fb[0x0][_0x8f40('0x1dd')]||0x0;_0x584bba['predictiveIntervalHitRate']=_0x1c8c1c>0x0?_0x1c8c1c:0x1;return _0x270452[_0x8f40('0x1d5')](_0x1d9a2,_0x5a901b,_0x4d78d6,_0x1c8c1c,_0x117b2c);})['then'](function(_0x3ac966){return _0x2aeb4d(_0x3ac966);})['catch'](function(_0x143c88){return _0x4ad0ae(msgResponse(_0x8f40('0x1df'),_0x8f40('0x13a'),JSON[_0x8f40('0x4d')](_0x143c88)));});}if(_0x584bba[_0x8f40('0x1c7')]===_0x8f40('0x1d6')){return _0x270452[_0x8f40('0xc5')](_0x584bba['id'])[_0x8f40('0xb7')](function(_0x1235b1){var _0x28cfc7=_0x584bba[_0x8f40('0x1dc')]-_0x1235b1[0x0][_0x8f40('0x1dd')];var _0x4315ba=_0x584bba['dialPredictiveInterval']*0x3c;var _0xb443c1=_0xfc55f2[0x0]['predictiveIntervalAvgTalktime']+_0xfc55f2[0x0][_0x8f40('0x69')];var _0x18cad0=(_0xfc55f2[0x0][_0x8f40('0x7f')]+_0xfc55f2[0x0][_0x8f40('0x1d4')]+_0xfc55f2[0x0][_0x8f40('0x6b')])/_0xfc55f2[0x0]['predictiveIntervalTotalCalls'];var _0x819826=_0x584bba[_0x8f40('0x1bd')]/0x64;_0x584bba[_0x8f40('0x1de')]=_0x1235b1[0x0][_0x8f40('0x1dd')]||0x0;_0x584bba[_0x8f40('0x6d')]=_0x18cad0>0x0?_0x18cad0:0x1;return _0x270452['busyFactor'](_0x28cfc7,_0x4315ba,_0xb443c1,_0x18cad0,_0x819826);})[_0x8f40('0xb7')](function(_0x14ee7f){return _0x2aeb4d(_0x14ee7f);})['catch'](function(_0x495859){return _0x4ad0ae(msgResponse(_0x8f40('0x1df'),_0x8f40('0x13a'),JSON[_0x8f40('0x4d')](_0x495859)));});}}else{return _0x4ad0ae(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x8f40('0x19')][_0x8f40('0x1cf')]=function(_0x584d6d){var _0x5be245=this;return function(){var _0x18747f=0x0;var _0x422759=Math[_0x8f40('0x1c0')](_0x584d6d[_0x8f40('0x89')]*0x3e8);if(_0x422759>0x0){_0x422759=_0x422759<0x64?0x64:_0x422759;loggerPredictive[_0x8f40('0x7b')](_0x584d6d[_0x8f40('0x43')],'one\x20call\x20every:',_0x422759,'milliseconds');_0x584d6d[_0x8f40('0x8f')]=setInterval(function(){_0x5be245[_0x8f40('0x8f')](_0x584d6d);loggerPredictiveCalls[_0x8f40('0x7b')](_0x8f40('0x1e0'),_0x18747f+=0x1);},_0x422759);}else{loggerPredictive['info'](_0x584d6d[_0x8f40('0x43')],_0x8f40('0x1e1'));}};};Dialer[_0x8f40('0x19')][_0x8f40('0x1e2')]=function(_0x2126dd,_0x59cd90){var _0xaa6497=this;return function(_0x1ddcaf){if(_[_0x8f40('0x4a')](_0x1ddcaf)){if(_[_0x8f40('0xac')](_0x59cd90[_0x8f40('0xd1')])||!_0x59cd90[_0x8f40('0x1e3')]){if(_0x2126dd[_0x8f40('0x5a')]===_0x8f40('0x8')){_0x2126dd[_0x8f40('0x121')]=_['isUndefined'](_0x2126dd[_0x8f40('0x121')])?!![]:_0x2126dd['queueStatusComplete'];var _0x89cca3=uuid['v4']();_0xaa6497[_0x8f40('0x24')][_0x89cca3]=new Action(_0x2126dd,_0x59cd90,_0x89cca3);loggerBooked[_0x8f40('0x7b')](_0x8f40('0x1e4'),_0x89cca3,'queueStatusComplete:\x20',JSON['stringify'](_0x2126dd[_0x8f40('0x121')]),'Queue:\x20',_0x2126dd[_0x8f40('0x43')]);if(_0x2126dd[_0x8f40('0x121')]){_0x2126dd[_0x8f40('0x121')]=![];_0xaa6497[_0x8f40('0x2a')][_0xaa6497['actions'][_0x89cca3][_0x8f40('0xb1')]]=[];ami['Action']({'actionid':_0x89cca3,'action':_0x8f40('0x1e5'),'queue':_0x2126dd[_0x8f40('0x43')]})['catch'](function(){_0xaa6497['updateOriginated'](_0x2126dd);_0xaa6497[_0x8f40('0xbe')]({'active':![],'ContactId':_0xaa6497['actions'][_0x89cca3][_0x8f40('0xfa')],'ListId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd0')],'VoiceQueueId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd2')]||undefined,'CampaignId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1e6')));delete _0xaa6497[_0x8f40('0x24')][_0x89cca3];});}else{loggerBooked[_0x8f40('0x7b')](_0x8f40('0x1e7'),JSON['stringify'](_0x2126dd[_0x8f40('0x121')]),_0x8f40('0x1e8'),_0x2126dd['name']);_0xaa6497[_0x8f40('0xb0')](_0x2126dd);_0xaa6497[_0x8f40('0xbe')]({'active':![],'ContactId':_0xaa6497['actions'][_0x89cca3]['ContactId'],'ListId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd0')],'VoiceQueueId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xd2')]||undefined,'CampaignId':_0xaa6497[_0x8f40('0x24')][_0x89cca3][_0x8f40('0xfb')]||undefined})[_0x8f40('0xaf')](loggerCatch(_0x8f40('0x1e6')));delete _0xaa6497['actions'][_0x89cca3];}}else{return _0xaa6497[_0x8f40('0x1e9')](_0x2126dd,_0x59cd90);}}else{if(getDiff(_0x59cd90[_0x8f40('0x1ea')])<_0x2126dd[_0x8f40('0x1eb')]*0x3c){if(_0x59cd90[_0x8f40('0x1ec')]&&!_0x59cd90[_0x8f40('0x1ec')]['voicePause']){_0xaa6497[_0x8f40('0x1d')]['run'](_0x59cd90['id'])[_0x8f40('0x1c')](function(){_0xaa6497[_0x8f40('0xb0')](_0x2126dd);});}else{_0xaa6497['unlockContact']({'active':![]},_0x59cd90['id'],0x1)[_0x8f40('0x1c')](function(){_0xaa6497[_0x8f40('0xb0')](_0x2126dd);});}}else{_0x2126dd[_0x8f40('0x67')]+=0x1;_0xaa6497[_0x8f40('0xb0')](_0x2126dd);if(_0x2126dd['dialRecallInQueue']){_0xaa6497['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59cd90['ContactId'],'ListId':_0x59cd90[_0x8f40('0xd0')],'VoiceQueueId':_0x59cd90['VoiceQueueId']||undefined,'CampaignId':_0x59cd90[_0x8f40('0xfb')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xaa6497['createHistory'](createObjHistory(_0x2126dd,_0x59cd90,'RECALLINQUEUE',0x17,_0x8f40('0x1ed')))[_0x8f40('0xaf')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xaa6497[_0x8f40('0xce')](createObjHistory(_0x2126dd,_0x59cd90,'RECALLFAILEDTIMEOUT',0x16,_0x8f40('0x1ee')),_0x8f40('0x1ef'),_0x8f40('0x1f0'));}}}}else{_0x2126dd[_0x8f40('0x60')]+=0x1;_0xaa6497[_0x8f40('0xce')](createObjHistory(_0x2126dd,_0x59cd90,_0x8f40('0x1f1'),0xd,_0x8f40('0x1f2')),'[Originate][historyBlacklist]',_0x8f40('0x1f3'));throw _0x8f40('0x1f4');}};};Dialer[_0x8f40('0x19')][_0x8f40('0x1f5')]=function(_0x4807e4){var _0x3481b0=this;var _0x14752a=_0x4807e4['limitCalls']-_0x4807e4['originated']-_0x4807e4[_0x8f40('0xc2')];emitCampaignSummary(_0x4807e4);if(_0x14752a>0x0){if(_0x14752a>this['maxNumberOriginate']){_0x14752a=this[_0x8f40('0x22')];}_0x4807e4['temp']+=_0x14752a;this[_0x8f40('0xc3')](_0x4807e4['id'],_0x14752a,_0x4807e4['dialOrderByScheduledAt'],_0x4807e4)['then'](function(_0xf79aae){_0x4807e4[_0x8f40('0xc2')]-=_0x14752a;_0x4807e4[_0x8f40('0xc2')]=_0x4807e4[_0x8f40('0xc2')]>0x0?_0x4807e4[_0x8f40('0xc2')]:0x0;if(!checkContactEmpty(_0xf79aae)){_0x4807e4[_0x8f40('0x41')]=_0x8f40('0x1f6');logger[_0x8f40('0x7b')]('[getContactCampaign2][Empty]'+_0x4807e4[_0x8f40('0x43')]);}else{_0x4807e4[_0x8f40('0x70')]+=_0xf79aae['length'];_0x4807e4[_0x8f40('0x41')]='RUNNING';for(var _0x214274=0x0;_0x214274<_0xf79aae[_0x8f40('0x127')];_0x214274+=0x1){_0x4807e4['ivrTotalCallsDays']+=0x1;if(_[_0x8f40('0xac')](_0xf79aae[_0x214274])||_[_0x8f40('0xac')](_0xf79aae[_0x214274][_0x8f40('0x15d')])||_['isNil'](_0xf79aae[_0x214274]['Contact'][_0x8f40('0x15e')])){_0x3481b0[_0x8f40('0xcd')]('[actionOriginate]\x20',_0x4807e4,_0xf79aae[_0x214274]);}else{_0x3481b0['checkIsBlackListIvr'](_[_0x8f40('0xcf')](_0xf79aae[_0x214274],[_0x8f40('0xfb'),'Contact.phone']))[_0x8f40('0xb7')](_0x3481b0[_0x8f40('0x1e2')](_0x4807e4,_0xf79aae[_0x214274]))[_0x8f40('0xaf')](_0x3481b0[_0x8f40('0xcc')](_0x8f40('0x1f7'),_0x4807e4));}}}})[_0x8f40('0xaf')](loggerGetContactDialer(_0x8f40('0x1f8'),_0x4807e4,_0x14752a));}};Dialer[_0x8f40('0x19')][_0x8f40('0x14d')]=function(_0x128729,_0x5c9dac){var _0x513d31=this;var _0x1e43ec=[];var _0x51e9d8=_0x5c9dac>=0x1?_0x5c9dac:0x1;if(_0x128729['dialMethod']===_0x8f40('0x8')){_0x51e9d8=0x1;}var _0x1bbbc6=Math['floor'](_0x128729['available']*_0x51e9d8)-_0x128729[_0x8f40('0x70')]-_0x128729[_0x8f40('0xc2')];emitVoiceQueueSummary(_0x128729);if(_0x128729[_0x8f40('0x1f9')]>0x0){var _0x54fbbc=_0x128729[_0x8f40('0x1f9')]-_0x128729[_0x8f40('0x70')]-_0x128729[_0x8f40('0x57')]-_0x128729[_0x8f40('0xc2')]-_0x128729[_0x8f40('0x9b')];if(_0x1bbbc6>_0x54fbbc){_0x1bbbc6=_0x54fbbc;}}if(_0x1bbbc6>0x0){if(_0x128729['dialMethod']==='booked'){_0x1bbbc6=0x1;}if(_0x1bbbc6>this[_0x8f40('0x22')]){_0x1bbbc6=this[_0x8f40('0x22')];}_0x128729[_0x8f40('0xc2')]+=_0x1bbbc6;for(var _0x176488 in this[_0x8f40('0x20')]){if(typeof this[_0x8f40('0x20')][_0x176488]!==_0x8f40('0xaa')){if(this['agents'][_0x176488]['state']===_0x8f40('0x1fa')&&this['agents'][_0x176488][_0x8f40('0xae')]==='reachable'){_0x1e43ec[_0x8f40('0x11f')](this[_0x8f40('0x20')][_0x176488]['id']);}}}this[_0x8f40('0xc1')](_0x128729['id'],_0x1e43ec,_0x1bbbc6,_0x128729['dialOrderByScheduledAt'],_0x128729)[_0x8f40('0xb7')](function(_0x46a67f){_0x128729[_0x8f40('0xc2')]-=_0x1bbbc6;_0x128729[_0x8f40('0xc2')]=_0x128729['temp']>0x0?_0x128729[_0x8f40('0xc2')]:0x0;if(!checkContactEmpty(_0x46a67f)){_0x513d31['countReScheduled'](_0x128729)[_0x8f40('0xb7')](sendMessageReschedule(_0x128729))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb5')));}else{_0x128729[_0x8f40('0x70')]+=_0x46a67f['length'];_0x128729[_0x8f40('0x41')]=_0x128729[_0x8f40('0x5a')]===_0x8f40('0x8')?'ACTIVE':_0x8f40('0x1fb');for(var _0x368900=0x0;_0x368900<_0x46a67f['length'];_0x368900+=0x1){if(_[_0x8f40('0xac')](_0x46a67f[_0x368900])||_[_0x8f40('0xac')](_0x46a67f[_0x368900][_0x8f40('0x15d')])||_[_0x8f40('0xac')](_0x46a67f[_0x368900][_0x8f40('0x15d')][_0x8f40('0x15e')])){_0x513d31[_0x8f40('0xcd')](_0x8f40('0x1fc'),_0x128729,_0x46a67f[_0x368900]);}else{_0x513d31['checkIsBlackList'](_[_0x8f40('0xcf')](_0x46a67f[_0x368900],[_0x8f40('0xd2'),_0x8f40('0x1fd')]))[_0x8f40('0xb7')](_0x513d31[_0x8f40('0x1e2')](_0x128729,_0x46a67f[_0x368900]))[_0x8f40('0xaf')](_0x513d31[_0x8f40('0xcc')](_0x8f40('0x1fc'),_0x128729));}}}})[_0x8f40('0xaf')](loggerGetContactDialer('[getContactDialer2]',_0x128729,_0x1bbbc6));}};Dialer[_0x8f40('0x19')][_0x8f40('0x8f')]=function(_0x4adb47){if(_0x4adb47['dialLimitQueue']>0x0){var _0x29c4c2=_0x4adb47[_0x8f40('0x1f9')]-_0x4adb47[_0x8f40('0x70')]-_0x4adb47[_0x8f40('0x57')];if(_0x29c4c2>0x0){this[_0x8f40('0x1fe')](_0x4adb47);}else{loggerPredictiveCalls['info'](_0x8f40('0x1ff'));}}else{this[_0x8f40('0x1fe')](_0x4adb47);}};Dialer[_0x8f40('0x19')]['tryOriginatePredictive']=function(_0x194707){var _0x16d32c=this;var _0x1560e9=[];_0x194707[_0x8f40('0x70')]+=0x1;for(var _0x422153 in this[_0x8f40('0x20')]){if(typeof this[_0x8f40('0x20')][_0x422153]!==_0x8f40('0xaa')){if(this[_0x8f40('0x20')][_0x422153][_0x8f40('0xa3')]===_0x8f40('0x1fa')&&this['agents'][_0x422153]['status']===_0x8f40('0x200')){_0x1560e9[_0x8f40('0x11f')](this[_0x8f40('0x20')][_0x422153]['id']);}}}this[_0x8f40('0xc1')](_0x194707['id'],_0x1560e9,0x1,_0x194707['dialOrderByScheduledAt'],_0x194707)['then'](function(_0x8cc1d5){if(!checkContactEmpty(_0x8cc1d5)){checkContactLowerLimitOriginate(_0x194707,0x1,0x0);_0x16d32c['countReScheduled'](_0x194707)[_0x8f40('0xb7')](sendMessageReschedule(_0x194707))[_0x8f40('0xaf')](loggerCatch(_0x8f40('0xb5')));}else{_0x194707[_0x8f40('0x41')]=_0x8f40('0x1fb');if(_[_0x8f40('0xac')](_0x8cc1d5[0x0])||_['isNil'](_0x8cc1d5[0x0][_0x8f40('0x15d')])||_['isNil'](_0x8cc1d5[0x0][_0x8f40('0x15d')][_0x8f40('0x15e')])){_0x16d32c[_0x8f40('0xcd')](_0x8f40('0x1fc'),_0x194707,_0x8cc1d5[0x0]);}else{_0x16d32c[_0x8f40('0xb6')](_[_0x8f40('0xcf')](_0x8cc1d5[0x0],['VoiceQueueId',_0x8f40('0x1fd')]))['then'](_0x16d32c['checkContactBlack'](_0x194707,_0x8cc1d5[0x0]))['catch'](_0x16d32c[_0x8f40('0xcc')](_0x8f40('0x201'),_0x194707));}}})['catch'](loggerGetContactDialer(_0x8f40('0x202'),_0x194707,0x1));emitVoiceQueueSummary(_0x194707);};Dialer['prototype'][_0x8f40('0x1d5')]=function(_0x441cc0,_0x314aee,_0x534739,_0x3eabcd,_0x52a63e,_0x3eb226){loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x203'));loggerPredictive['info'](_0x8f40('0x204'),_0x441cc0);loggerPredictive[_0x8f40('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x314aee);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x205'),_0x534739);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x206'),_0x3eabcd);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x207'),_0x52a63e);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x208'));return new BPromise(function(_0x3d5353,_0x44c0c9){if(_0x441cc0<=0x0||isNaN(_0x441cc0)){return _0x44c0c9(msgResponse('[abandonmentRate]',_0x8f40('0x4c'),_0x8f40('0x209')+_0x441cc0));}if(_0x534739<=0x0||isNaN(_0x534739)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20b')+_0x534739));}if(_0x3eabcd<=0x0||isNaN(_0x3eabcd)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20c')+_0x3eabcd));}if(_0x314aee<=0x0||isNaN(_0x314aee)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20d')+_0x314aee));}if(_0x52a63e<=0x0||isNaN(_0x52a63e)){return _0x44c0c9(msgResponse(_0x8f40('0x20a'),_0x8f40('0x4c'),_0x8f40('0x20e')+_0x52a63e));}_0x3eb226=_0x3eb226||0x0;var _0x4c6e7d=0x1/_0x534739;var _0x60c9a7=0x0;var _0x228114=0x0;var _0x595d89=0x0;var _0x10aa86=0x0;for(var _0x511b49=0x0;_0x595d89<_0x52a63e;_0x511b49+=0x1){_0x228114=_0x511b49/_0x314aee;_0x60c9a7=(_0x3eabcd*_0x228114+_0x3eb226)/_0x4c6e7d;_0x595d89=erlangb(_0x60c9a7,_0x441cc0);_0x10aa86=_0x60c9a7/_0x441cc0*(0x1-erlangb(_0x60c9a7,_0x441cc0));}return _0x3d5353({'erlangCalls':_0x511b49,'erlangCallToSecond':_0x314aee/_0x511b49,'erlangAbandonmentRate':_0x595d89,'erlangBusyFactor':_0x10aa86});});};Dialer[_0x8f40('0x19')][_0x8f40('0x1d7')]=function(_0x3c49d6,_0x1ff3b0,_0x5efa77,_0x3b208f,_0x2eb715,_0x2bc245){loggerPredictive['info'](_0x8f40('0x20f'));loggerPredictive['info'](_0x8f40('0x204'),_0x3c49d6);loggerPredictive[_0x8f40('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ff3b0);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x205'),_0x5efa77);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x206'),_0x3b208f);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x210'),_0x2eb715);loggerPredictive[_0x8f40('0x7b')](_0x8f40('0x208'));return new BPromise(function(_0xf1c296,_0x1059d0){if(_0x3c49d6<=0x0||isNaN(_0x3c49d6)){return _0x1059d0(msgResponse('[busyFactor]',_0x8f40('0x4c'),_0x8f40('0x209')+_0x3c49d6));}if(_0x5efa77<=0x0||isNaN(_0x5efa77)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),_0x8f40('0x20b')+_0x5efa77));}if(_0x3b208f<=0x0||isNaN(_0x3b208f)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),'p\x20=\x20'+_0x3b208f));}if(_0x1ff3b0<=0x0||isNaN(_0x1ff3b0)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),_0x8f40('0x20d')+_0x1ff3b0));}if(_0x2eb715<=0x0||isNaN(_0x2eb715)){return _0x1059d0(msgResponse(_0x8f40('0x211'),_0x8f40('0x4c'),'Umin\x20=\x20'+_0x2eb715));}_0x2bc245=_0x2bc245||0x0;var _0x3e8da6=0x1/_0x5efa77;var _0x57d5ac=0x0;var _0x57fe08=0x0;var _0x50c920=0x0;var _0x197d4b=0x0;for(var _0x17ab6a=0x0;_0x197d4b<_0x2eb715;_0x17ab6a+=0x1){_0x57fe08=_0x17ab6a/_0x1ff3b0;_0x57d5ac=(_0x3b208f*_0x57fe08+_0x2bc245)/_0x3e8da6;_0x50c920=erlangb(_0x57d5ac,_0x3c49d6);_0x197d4b=_0x57d5ac/_0x3c49d6*(0x1-erlangb(_0x57d5ac,_0x3c49d6));}return _0xf1c296({'erlangCalls':_0x17ab6a,'erlangCallToSecond':_0x1ff3b0/_0x17ab6a,'erlangAbandonmentRate':_0x50c920,'erlangBusyFactor':_0x197d4b});});};module[_0x8f40('0x212')]=Dialer; \ No newline at end of file +var _0xa122=['dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','available','floor','erlangAbandonmentRate','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','RUNNING','tryOriginatePredictive','[handlePredictive][limitChannel]','[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]','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','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','name','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','outbound','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','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','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','prototype','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','active','SIP/%s','status','reachable','createHistory','moveContactManagedDialer','uniqueid','variable','isNil','amdstatus','exten','xcally-motion-dialer','dialAMDActive','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','state','statedesc','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countcongestionretry','dialMachineMaxRetry','reason\x2019\x20machine....','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','rrmemory','push','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','Intervals','\x20Intervals\x20is\x20null\x20','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','content','indexOf','true','Action','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','match','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','NONE'];(function(_0x17d7e,_0x52bcfb){var _0x22dbca=function(_0xca3846){while(--_0xca3846){_0x17d7e['push'](_0x17d7e['shift']());}};_0x22dbca(++_0x52bcfb);}(_0xa122,0xae));var _0x2a12=function(_0x258d3f,_0x3dffb0){_0x258d3f=_0x258d3f-0x0;var _0x34d529=_0xa122[_0x258d3f];return _0x34d529;};'use strict';var util=require(_0x2a12('0x0'));var _=require(_0x2a12('0x1'));var BPromise=require(_0x2a12('0x2'));var uuid=require(_0x2a12('0x3'));var moment=require(_0x2a12('0x4'));var rr=require('rr');var md5=require(_0x2a12('0x5'));var Redis=require(_0x2a12('0x6'));var ut=require(_0x2a12('0x7'));var config=require(_0x2a12('0x8'));var logger=require(_0x2a12('0x9'))(_0x2a12('0xa'));var loggerBooked=require(_0x2a12('0x9'))(_0x2a12('0xb'));var loggerPredictive=require(_0x2a12('0x9'))('predictive');var loggerPredictiveCalls=require(_0x2a12('0x9'))(_0x2a12('0xc'));var loggerSyncQueueSummary=require(_0x2a12('0x9'))('syncQueueSummary');var ami=require(_0x2a12('0xd'));config[_0x2a12('0xe')]=_[_0x2a12('0xf')](config[_0x2a12('0xe')],{'host':_0x2a12('0x10'),'port':0x18eb});var io=require(_0x2a12('0x11'))(new Redis(config[_0x2a12('0xe')]));var cmHopper=require(_0x2a12('0x12'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x2a12('0x13'));var voiceQueueRt=require(_0x2a12('0x14'));var Action=require(_0x2a12('0x15'));var History=require(_0x2a12('0x16'));var Final=require(_0x2a12('0x17'));var AgentComplete=require(_0x2a12('0x18'));var QueueCallerAbandon=require(_0x2a12('0x19'));var Hangup=require('./hangup');var ipAgi=process[_0x2a12('0x1a')][_0x2a12('0x1b')]||_0x2a12('0x1c');var strategy={'rrmemory':'rrmemory','roundrobin':_0x2a12('0x1d')};var Sequence=function(){};Sequence['prototype'][_0x2a12('0x1e')]=function(_0x18fc6e){this[_0x2a12('0x1f')]=this[_0x2a12('0x1f')]?this['tail'][_0x2a12('0x20')](_0x18fc6e):_0x18fc6e();};function Dialer(_0x5ab383,_0x17116a){this[_0x2a12('0x21')]=new Sequence();this['preview']=_0x17116a;this['voiceQueues']=_0x5ab383[_0x2a12('0x22')];this[_0x2a12('0x23')]=_0x5ab383['campaigns'];this[_0x2a12('0x24')]=_0x5ab383[_0x2a12('0x24')];this[_0x2a12('0x25')]=_0x5ab383[_0x2a12('0x25')];this['maxNumberOriginate']=config[_0x2a12('0x26')]||0x2;this['channels']={};this[_0x2a12('0x27')]={};this[_0x2a12('0x28')]={};this[_0x2a12('0x29')]={};this['optionPredictive']={};this[_0x2a12('0x2a')]={};this[_0x2a12('0x2b')]={};this[_0x2a12('0x2c')]={};this[_0x2a12('0x2d')]={};this[_0x2a12('0x2e')]={};ami['on'](_0x2a12('0x2f'),this[_0x2a12('0x30')][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x32'),this[_0x2a12('0x33')][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x34'),this[_0x2a12('0x35')][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x36'),this['syncAgentComplete'][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x37'),this[_0x2a12('0x38')][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x39'),this[_0x2a12('0x3a')][_0x2a12('0x31')](this));ami['on']('newexten',this[_0x2a12('0x3b')][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x3c'),this[_0x2a12('0x3d')][_0x2a12('0x31')](this));ami['on'](_0x2a12('0x3e'),this[_0x2a12('0x3f')]['bind'](this));ami['on'](_0x2a12('0x40'),this[_0x2a12('0x41')][_0x2a12('0x31')](this));this[_0x2a12('0x42')]();this[_0x2a12('0x43')]();}function isNotNull(_0x1fc33e){return _0x1fc33e!==null&&!_[_0x2a12('0x44')](_0x1fc33e);}function checkIsLoggedIn(_0xb7f051,_0x85a60d){return function(){if(_0x85a60d<=0x0){_0xb7f051[_0x2a12('0x45')]='AGENTS_NOT_LOGGED';throw _0xb7f051['name']+_0x2a12('0x46');}};}function isActive(_0x2d5e1a){return _0x2d5e1a;}function checkIsActive(_0x3282d8,_0x4e65e2){return function(){if(!isActive(_0x4e65e2)){_0x3282d8['message']=_0x2a12('0x47');throw _0x3282d8['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x8a566d){return function(){if(!isNotNull(_0x8a566d[_0x2a12('0x48')])){_0x8a566d[_0x2a12('0x45')]=_0x2a12('0x49');throw _0x8a566d[_0x2a12('0x4a')]+_0x2a12('0x4b');}if(!isNotNull(_0x8a566d[_0x2a12('0x48')]['Intervals'])){_0x8a566d[_0x2a12('0x45')]=_0x2a12('0x49');throw _0x8a566d['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x2a12('0x4c')](_0x8a566d[_0x2a12('0x48')]['Intervals']))){_0x8a566d[_0x2a12('0x45')]=_0x2a12('0x49');throw _0x8a566d[_0x2a12('0x4a')]+_0x2a12('0x4b');}};}function msgResponse(_0x26922c,_0x55409e,_0x36da7f){return{'action':_0x26922c,'response':_0x55409e,'message':_0x36da7f,'stack':_0x36da7f};}function myreject(_0x46cbd3){return function(_0x388a9d){return _0x46cbd3(msgResponse(_0x2a12('0x4d'),'Error',JSON[_0x2a12('0x4e')](_0x388a9d)));};}function getSeconds(_0x5917cc,_0x5eab92){var _0x26c500=moment(_0x5917cc)['milliseconds'](0x0);var _0x374838=moment(_0x5eab92)[_0x2a12('0x4f')](0x0);return _0x26c500[_0x2a12('0x50')](_0x374838,_0x2a12('0x51'));}function emit(_0x522201,_0x2d9f06,_0x4cf99b){io['to'](_0x522201)[_0x2a12('0x52')](_0x2d9f06,_0x4cf99b);}function emitVoiceQueueSummary(_0x1eacb5){if(_0x1eacb5['type']===_0x2a12('0x53')){var _0x507161={'id':_0x1eacb5['id'],'name':_0x1eacb5[_0x2a12('0x4a')],'strategy':_0x1eacb5[_0x2a12('0x54')],'answered':_0x1eacb5['answered'],'available':_0x1eacb5['available'],'loggedIn':_0x1eacb5[_0x2a12('0x55')],'pTalking':_0x1eacb5[_0x2a12('0x56')],'sumBillable':_0x1eacb5[_0x2a12('0x57')],'sumDuration':_0x1eacb5[_0x2a12('0x58')],'sumHoldTime':_0x1eacb5[_0x2a12('0x59')]||0x0,'talking':_0x1eacb5['talking'],'total':_0x1eacb5[_0x2a12('0x5a')],'type':_0x1eacb5[_0x2a12('0x5b')],'unmanaged':_0x1eacb5[_0x2a12('0x5c')],'abandoned':_0x1eacb5[_0x2a12('0x5d')],'waiting':_0x1eacb5['waiting'],'loggedInDb':_0x1eacb5[_0x2a12('0x5e')],'dialActive':_0x1eacb5[_0x2a12('0x5f')],'dialMethod':_0x1eacb5[_0x2a12('0x60')],'dialOriginateCallerIdName':_0x1eacb5[_0x2a12('0x61')],'dialOriginateCallerIdNumber':_0x1eacb5[_0x2a12('0x62')],'dialOriginateTimeout':_0x1eacb5[_0x2a12('0x63')],'dialPrefix':_0x1eacb5[_0x2a12('0x64')],'outboundAnswerAgiCallsDay':_0x1eacb5['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1eacb5[_0x2a12('0x65')],'outboundBlacklistCallsDay':_0x1eacb5[_0x2a12('0x66')],'outboundBusyCallsDay':_0x1eacb5[_0x2a12('0x67')],'outboundCongestionCallsDay':_0x1eacb5[_0x2a12('0x68')],'outboundDropCallsDayACS':_0x1eacb5[_0x2a12('0x69')],'outboundDropCallsDayCallersExit':_0x1eacb5[_0x2a12('0x6a')],'outboundDropCallsDayTimeout':_0x1eacb5[_0x2a12('0x6b')],'outboundNoAnswerCallsDay':_0x1eacb5['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1eacb5[_0x2a12('0x6c')],'outboundOriginateFailureCallsDay':_0x1eacb5[_0x2a12('0x6d')],'outboundReCallsDay':_0x1eacb5['outboundReCallsDay'],'outboundRejectCallsDay':_0x1eacb5[_0x2a12('0x6e')],'outboundUnknownCallsDay':_0x1eacb5[_0x2a12('0x6f')],'predictiveIntervalAnsweredCalls':_0x1eacb5[_0x2a12('0x70')],'predictiveIntervalAvgHoldtime':_0x1eacb5[_0x2a12('0x71')],'predictiveIntervalAvgTalktime':_0x1eacb5['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1eacb5[_0x2a12('0x72')],'predictiveIntervalDroppedCallsTimeout':_0x1eacb5[_0x2a12('0x73')],'predictiveIntervalErlangCalls':_0x1eacb5[_0x2a12('0x74')],'predictiveIntervalErlangCallsDroppedCalls':_0x1eacb5[_0x2a12('0x75')],'predictiveIntervalHitRate':_0x1eacb5['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1eacb5[_0x2a12('0x76')],'predictiveIntervalPauses':_0x1eacb5['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1eacb5[_0x2a12('0x77')],'predictiveIntervalTotalCalls':_0x1eacb5['predictiveIntervalTotalCalls'],'message':_0x1eacb5['message'],'originated':_0x1eacb5[_0x2a12('0x78')],'erlangCalls':_0x1eacb5[_0x2a12('0x79')],'erlangCallToSecond':_0x1eacb5[_0x2a12('0x7a')],'erlangAbandonmentRate':_0x1eacb5['erlangAbandonmentRate'],'erlangBusyFactor':_0x1eacb5[_0x2a12('0x7b')],'startPredictive':_0x1eacb5[_0x2a12('0x2a')],'startProgressive':_0x1eacb5['startProgressive']};if(_0x1eacb5[_0x2a12('0x7c')]){_0x507161[_0x2a12('0x7c')]={'id':_0x1eacb5[_0x2a12('0x7c')]['id'],'name':_0x1eacb5[_0x2a12('0x7c')][_0x2a12('0x4a')],'active':_0x1eacb5['Trunk']['active'],'callerid':_0x1eacb5[_0x2a12('0x7c')][_0x2a12('0x7d')]};}if(_0x1eacb5[_0x2a12('0x48')]){_0x507161[_0x2a12('0x48')]={'id':_0x1eacb5[_0x2a12('0x48')]['id'],'name':_0x1eacb5[_0x2a12('0x48')][_0x2a12('0x4a')]};}var _0xef7380=md5(JSON[_0x2a12('0x4e')](_0x507161));if(_0x1eacb5['md5']!==_0xef7380){_0x1eacb5[_0x2a12('0x5')]=_0xef7380;emit(util['format']('voice:queue:%s',_0x507161[_0x2a12('0x4a')]),_0x2a12('0x7e'),_0x507161);}}}function emitCampaignSummary(_0x4a2ada){if(_0x4a2ada[_0x2a12('0x5b')]===_0x2a12('0x7f')){emit(util[_0x2a12('0x80')](_0x2a12('0x81'),_0x4a2ada[_0x2a12('0x4a')]),_0x2a12('0x82'),_0x4a2ada);}}function checkGetDataPredictive(_0x2c8f28){if(isNotNull(_0x2c8f28)&&!_[_0x2a12('0x4c')](_0x2c8f28)){loggerPredictive[_0x2a12('0x83')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x2a12('0x83')](_0x2a12('0x84'),_0x2c8f28['predictiveIntervalTotalCalls']);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x85'),_0x2c8f28['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x86'),_0x2c8f28[_0x2a12('0x73')]);loggerPredictive[_0x2a12('0x83')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c8f28[_0x2a12('0x72')]);loggerPredictive[_0x2a12('0x83')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c8f28['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x87'),_0x2c8f28[_0x2a12('0x88')]);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x89'));if(_0x2c8f28[_0x2a12('0x8a')]>0x0){if(!_['isUndefined'](_0x2c8f28[_0x2a12('0x88')])&&_0x2c8f28[_0x2a12('0x88')]>0x0){return!![];}loggerPredictive[_0x2a12('0x83')](_0x2a12('0x8b'));if(!_[_0x2a12('0x44')](_0x2c8f28['predictiveIntervalAvgHoldtime'])&&_0x2c8f28[_0x2a12('0x71')]>0x0){return!![];}loggerPredictive['info'](_0x2a12('0x8c'));}else{loggerPredictive[_0x2a12('0x83')](_0x2a12('0x8d'));}}else{loggerPredictive[_0x2a12('0x83')](_0x2a12('0x8e'));}return![];}function mergeDataErlangB(_0x36cdb2){return function(_0x23ee99){loggerPredictive['info'](_0x2a12('0x8f'));loggerPredictive[_0x2a12('0x83')](_0x2a12('0x90'),_0x23ee99[_0x2a12('0x79')]);loggerPredictive[_0x2a12('0x83')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23ee99[_0x2a12('0x7a')]);loggerPredictive[_0x2a12('0x83')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23ee99['erlangAbandonmentRate']);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x91'),_0x23ee99[_0x2a12('0x7b')]);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x92'),_0x23ee99['erlangAbandonmentRate']);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x89'));_[_0x2a12('0x93')](_0x36cdb2,_0x23ee99);};}function getDiff(_0x198a7c){var _0x111016=moment()[_0x2a12('0x4f')](0x0);var _0x299392=moment(_0x198a7c)[_0x2a12('0x4f')](0x0);return _0x111016['diff'](_0x299392,_0x2a12('0x51'));}function ifInterval(_0x4d757b,_0x3dd601){if(_['isUndefined'](_0x3dd601)){return![];}return getDiff(_0x3dd601)<_0x4d757b*0x3c;}function freeVariablesPredictive(_0x1e97bc){if(isNotNull(_0x1e97bc)){if(!_[_0x2a12('0x44')](_0x1e97bc['startProgressive'])){_0x1e97bc[_0x2a12('0x2b')]=undefined;loggerPredictive['info'](_0x1e97bc[_0x2a12('0x4a')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x2a12('0x44')](_0x1e97bc[_0x2a12('0x2a')])){_0x1e97bc[_0x2a12('0x2a')]=undefined;loggerPredictive[_0x2a12('0x83')](_0x1e97bc['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x2a12('0x44')](_0x1e97bc[_0x2a12('0x94')])){clearInterval(_0x1e97bc[_0x2a12('0x94')]);_0x1e97bc['handlePredictive']=undefined;loggerPredictive[_0x2a12('0x83')](_0x1e97bc[_0x2a12('0x4a')],_0x2a12('0x95'));}}}function erlangb(_0x2c567e,_0x25e301){if(_0x25e301===0x0){return 0x0;}var _0x1f7f0f=0x1;for(var _0x2ec7b8=0x1;_0x2ec7b8<=_0x25e301;_0x2ec7b8+=0x1){_0x1f7f0f=0x1+_0x1f7f0f*_0x2ec7b8/_0x2c567e;}return 0x1/_0x1f7f0f;}function isVoiceQueueOutbound(_0x175840){return _0x175840==='outbound';}function isNotPreview(_0x49b169){return _0x49b169!==_0x2a12('0x96');}function isCampaignIvr(_0x53169d){return _0x53169d==='ivr';}function getCallerId(_0x4a6a25,_0x193362,_0x4aead9){if(!_[_0x2a12('0x44')](_0x4aead9)&&typeof _0x4aead9===_0x2a12('0x97')&&!_['isEmpty'](_0x4aead9)){if(!_[_0x2a12('0x44')](_0x193362)&&typeof _0x193362===_0x2a12('0x97')&&!_['isEmpty'](_0x193362)){return util[_0x2a12('0x80')](_0x2a12('0x98'),_0x193362,_0x4aead9);}return util['format'](_0x2a12('0x98'),_0x4aead9,_0x4aead9);}if(!_[_0x2a12('0x44')](_0x4a6a25)&&typeof _0x4a6a25===_0x2a12('0x97')&&!_['isEmpty'](_0x4a6a25)){return _0x4a6a25;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x1b0cd9,_0x2bbc62){return function(_0x53758b){freeVariablesPredictive(_0x2bbc62);emitVoiceQueueSummary(_0x2bbc62);emitCampaignSummary(_0x2bbc62);loggerSyncQueueSummary[_0x2a12('0x99')](_0x1b0cd9,util[_0x2a12('0x9a')](_0x53758b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x57dde6,_0x4af924){return function(_0x45e04f){loggerPredictive['error'](_0x4af924['name'],_0x57dde6);loggerPredictive[_0x2a12('0x99')](_0x45e04f[_0x2a12('0x9b')]);freeVariablesPredictive(_0x4af924);};}function loggerCatch(_0x55d1a7){return function(_0x1788e0){logger[_0x2a12('0x99')](_0x55d1a7,util[_0x2a12('0x9a')](_0x1788e0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x311065){return _0x311065&&!_['isUndefined'](_0x311065)&&_0x311065[_0x2a12('0x9c')]>0x0;}function decremetOriginate(_0x221367){if(!_[_0x2a12('0x44')](_0x221367)&&_0x221367!==null){if(typeof _0x221367[_0x2a12('0x78')]!==_0x2a12('0x9d')){if(_0x221367[_0x2a12('0x78')]>0x0){_0x221367['originated']-=0x1;}else{logger[_0x2a12('0x99')](_0x2a12('0x9e'));}}}else{logger[_0x2a12('0x99')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4150a5,_0x3d2c25,_0x349e77){if(_0x3d2c25>_0x349e77){for(var _0x3abe99=0x0;_0x3abe99<_0x3d2c25-_0x349e77;_0x3abe99+=0x1){decremetOriginate(_0x4150a5);}}}function loggerGetContactDialer(_0x1eb5e3,_0x50746a,_0x22a778){return function(_0x2bab07){checkContactLowerLimitOriginate(_0x50746a,_0x22a778,0x0);logger[_0x2a12('0x99')](_0x1eb5e3,util['inspect'](_0x2bab07,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x509a74){return function(_0x35d8d6){if(isNotNull(_0x35d8d6)&&isNotNull(_0x35d8d6[0x0])){if(_0x35d8d6[0x0]['contactsRescheduled']>0x0){_0x509a74[_0x2a12('0x45')]=_0x2a12('0x9f');logger[_0x2a12('0x83')](_0x2a12('0xa0')+_0x509a74[_0x2a12('0x4a')],_0x35d8d6[0x0][_0x2a12('0xa1')],'contacts');}else{_0x509a74['message']=_0x2a12('0xa2');logger[_0x2a12('0x83')](_0x2a12('0xa3')+_0x509a74['name']);}}};}function notSendMessagesQueue(_0xa52d51){if(_0xa52d51[_0x2a12('0xa4')]){freeVariablesPredictive(_0xa52d51);if(_0xa52d51[_0x2a12('0x78')]===0x0&&_0xa52d51[_0x2a12('0xa5')]===0x0&&_0xa52d51[_0x2a12('0xa6')]===0x0&&(_0xa52d51[_0x2a12('0x56')]||0x0)===0x0){_0xa52d51[_0x2a12('0xa4')]=![];_0xa52d51['available']=0x0;_0xa52d51[_0x2a12('0x45')]=_0x2a12('0x47');loggerSyncQueueSummary[_0x2a12('0x99')](_0x2a12('0xa7'),_0xa52d51[_0x2a12('0x4a')],_0x2a12('0xa8'));}else{_0xa52d51['message']=_0x2a12('0xa9');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xa52d51['name'],_0x2a12('0xaa'));}emitVoiceQueueSummary(_0xa52d51);}}function notSendMessagesCampaign(_0x3156b0){if(_0x3156b0['sendMessageOneNotActive']){if(_0x3156b0['originated']===0x0){_0x3156b0[_0x2a12('0xa4')]=![];_0x3156b0[_0x2a12('0x45')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x2a12('0x99')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3156b0[_0x2a12('0x4a')],_0x2a12('0xa8'));}else{_0x3156b0[_0x2a12('0x45')]=_0x2a12('0xa9');loggerSyncQueueSummary['error'](_0x2a12('0xab'),_0x3156b0[_0x2a12('0x4a')],_0x2a12('0xaa'));}emitCampaignSummary(_0x3156b0);}}function createObjHistory(_0x4f664e,_0x1e48c1,_0x19999a,_0x4ce239,_0x5f03b8){_0x4f664e[_0x2a12('0x45')]=_0x19999a;var _0x4b0861=new Action(_0x4f664e,_0x1e48c1);var _0x503471=new History(_0x4b0861);_0x503471['state']=_0x4ce239;_0x503471['statedesc']=_0x5f03b8;_0x503471[_0x2a12('0xac')]=_0x4b0861[_0x2a12('0xad')];return _0x503471;}Dialer['prototype'][_0x2a12('0x43')]=function(){var _0x5195a0=this;setInterval(function(){_0x5195a0[_0x2a12('0xae')](_0x5195a0[_0x2a12('0x29')],'[uniqueid]');_0x5195a0['clearZombieChannels'](_0x5195a0[_0x2a12('0x27')],'[actions]');},0x32c8);};Dialer[_0x2a12('0xaf')][_0x2a12('0xae')]=function(_0x23549d,_0x1f1545){var _0x58a809=this;for(var _0x47ffef in _0x23549d){if(typeof _0x23549d[_0x47ffef]!=='undefined'){this[_0x2a12('0x21')][_0x2a12('0x1e')](function(){if(!_['isNil'](_0x23549d[_0x47ffef])){return ami['Action']({'action':'status','channel':_0x23549d[_0x47ffef]['channel']})[_0x2a12('0xb0')](function(_0x47910a){if(_0x47910a[_0x2a12('0x45')]===_0x2a12('0xb1')){setTimeout(function(){if(_0x23549d[_0x47ffef]&&_0x23549d[_0x47ffef][_0x2a12('0x5b')]!=='ivr'){_0x58a809[_0x2a12('0xb2')](_0x58a809[_0x2a12('0x22')][_0x23549d[_0x47ffef][_0x2a12('0xb3')]]);logger[_0x2a12('0x99')](_0x2a12('0xb4'),_0x1f1545,_0x47ffef,_0x23549d[_0x47ffef]['queue']);delete _0x23549d[_0x47ffef];}if(_0x23549d[_0x47ffef]&&_0x23549d[_0x47ffef][_0x2a12('0x5b')]===_0x2a12('0x7f')){_0x58a809['updateOriginated'](_0x58a809['campaigns'][_0x23549d[_0x47ffef]['queue']]);logger['error'](_0x2a12('0xb5'),_0x1f1545,_0x47ffef,_0x23549d[_0x47ffef][_0x2a12('0xb3')]);delete _0x23549d[_0x47ffef];}},0x2328);}});}});}}};Dialer[_0x2a12('0xaf')][_0x2a12('0xb6')]=function(_0x4f0b8a){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](cmHopper[_0x2a12('0xb6')](_0x4f0b8a))[_0x2a12('0xb0')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x2a12('0xaf')][_0x2a12('0xb9')]=function(_0x110e0f){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](cmHopperBlack['checkIsBlackList'](_0x110e0f))[_0x2a12('0xb0')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x2a12('0xaf')][_0x2a12('0xba')]=function(_0x591bb4){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](cmHopperBlack['checkIsBlackListIvr'](_0x591bb4))['catch'](loggerCatch(_0x2a12('0xbb')));};Dialer[_0x2a12('0xaf')][_0x2a12('0xbc')]=function(_0x241db2){return BPromise['resolve']()[_0x2a12('0xb8')](cmHopperHistory[_0x2a12('0xbd')](_0x241db2))[_0x2a12('0xb0')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x2a12('0xbe')]=function(_0x23d6e8){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](cmHopper[_0x2a12('0xbe')](_0x23d6e8))[_0x2a12('0xb0')](loggerCatch(_0x2a12('0xbf')));};Dialer[_0x2a12('0xaf')]['unlockContact']=function(_0x3e390d,_0x2b5e05,_0x42cc86){return BPromise[_0x2a12('0xb7')]()['then'](cmHopper['unlockContact'](_0x3e390d,_0x2b5e05,_0x42cc86))[_0x2a12('0xb0')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x2a12('0xaf')][_0x2a12('0xc0')]=function(_0x512694,_0x2adc33,_0x3cc16d,_0x4e4756,_0x513a14){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](cmHopper[_0x2a12('0xc0')](_0x512694,_0x2adc33,_0x3cc16d,_0x4e4756))[_0x2a12('0xb0')](function(_0x2640e2){_0x513a14[_0x2a12('0xc1')]-=_0x3cc16d;_0x513a14['temp']=_0x513a14[_0x2a12('0xc1')]>0x0?_0x513a14[_0x2a12('0xc1')]:0x0;loggerCatch(_0x2a12('0xc2'))(_0x2640e2);});};Dialer[_0x2a12('0xaf')][_0x2a12('0xc3')]=function(_0x2a2a8d,_0x45aacd,_0x29db73,_0x4c427f){return BPromise['resolve']()['then'](cmHopper[_0x2a12('0xc3')](_0x2a2a8d,_0x45aacd,_0x29db73))['catch'](function(_0x46e8d7){_0x4c427f[_0x2a12('0xc1')]-=_0x45aacd;_0x4c427f[_0x2a12('0xc1')]=_0x4c427f[_0x2a12('0xc1')]>0x0?_0x4c427f[_0x2a12('0xc1')]:0x0;loggerCatch(_0x2a12('0xc4'))(_0x46e8d7);});};Dialer['prototype'][_0x2a12('0xc5')]=function(_0x2ac05a){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](voiceQueueRt[_0x2a12('0xc5')](_0x2ac05a))[_0x2a12('0xb0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x2a12('0xaf')]['moveContactManagedDialer']=function(_0x3b0193){return BPromise[_0x2a12('0xb7')]()['then'](cmHopper['moveContactManagedDialer'](_0x3b0193))[_0x2a12('0xb0')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype']['createHistory']=function(_0x1a66f9){return BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](cmHopperHistory['createHistory'](_0x1a66f9))[_0x2a12('0xb0')](loggerCatch('[createHistory]\x20'));};Dialer[_0x2a12('0xaf')][_0x2a12('0xb2')]=function(_0x4b9169){if(!_['isUndefined'](_0x4b9169)&&_0x4b9169!==null){if(typeof _0x4b9169['originated']!==_0x2a12('0x9d')){if(_0x4b9169[_0x2a12('0x78')]>0x0){_0x4b9169['originated']-=0x1;}else{logger[_0x2a12('0x99')](_0x2a12('0xc6'));}}}else{logger[_0x2a12('0x99')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x2a12('0xaf')][_0x2a12('0xc7')]=function(_0x4ed330,_0x12740b){var _0x55d5ac=this;return function(_0x2f4067){_0x55d5ac[_0x2a12('0xb2')](_0x12740b);logger[_0x2a12('0x99')](_0x4ed330,util[_0x2a12('0x9a')](_0x2f4067,{'showHidden':![],'depth':null}));};};Dialer[_0x2a12('0xaf')][_0x2a12('0xc8')]=function(_0x5c3a79,_0x5e2eb0,_0x178342){var _0x2c6653={'state':0x19,'statedesc':_0x2a12('0xc9')};this['updateOriginated'](_0x5e2eb0);this[_0x2a12('0xca')](_[_0x2a12('0x93')](_0x2c6653,_[_0x2a12('0xcb')](_0x178342,[_0x2a12('0xcc'),_0x2a12('0xcd'),_0x2a12('0xce'),'VoiceQueueId',_0x2a12('0xcf')])),_0x2a12('0xd0'),_0x2a12('0xd1'));logger[_0x2a12('0x99')](_0x5c3a79);};Dialer[_0x2a12('0xaf')][_0x2a12('0xd2')]=function(_0x38f7c8){return _0x38f7c8==='Success';};Dialer[_0x2a12('0xaf')][_0x2a12('0xd3')]=function(_0x483ad5){return!_[_0x2a12('0x44')](_0x483ad5)&&_0x483ad5&&!_['isUndefined'](_0x483ad5[_0x2a12('0x4a')])&&!_['isUndefined'](_0x483ad5[_0x2a12('0xd4')])&&_0x483ad5[_0x2a12('0xd4')]&&(this[_0x2a12('0x25')][util[_0x2a12('0x80')](_0x2a12('0xd5'),_0x483ad5[_0x2a12('0x4a')])][_0x2a12('0xd6')]===_0x2a12('0xd7')||this[_0x2a12('0x25')][util[_0x2a12('0x80')](_0x2a12('0xd5'),_0x483ad5['name'])][_0x2a12('0xd6')]==='unmonitored');};Dialer[_0x2a12('0xaf')][_0x2a12('0xca')]=function(_0x4364c7,_0x1324eb,_0x4c1810){this[_0x2a12('0xd8')](_0x4364c7)['catch'](loggerCatch(_0x1324eb));this[_0x2a12('0xd9')](_0x4364c7)['catch'](loggerCatch(_0x4c1810));};Dialer[_0x2a12('0xaf')][_0x2a12('0x3d')]=function(_0x153c59){var _0x4aaa64=this[_0x2a12('0x29')][_0x153c59[_0x2a12('0xda')]];var _0x543a4f;if(!_['isNil'](_0x153c59)&&!_['isNil'](_0x153c59[_0x2a12('0xdb')])&&!_[_0x2a12('0xdc')](_0x153c59[_0x2a12('0xdb')][_0x2a12('0xdd')])&&_0x153c59[_0x2a12('0xde')]===_0x2a12('0xdf')&&_0x4aaa64){if(_0x4aaa64[_0x2a12('0x5b')]!==_0x2a12('0x7f')&&this[_0x2a12('0x22')][_0x4aaa64['queue']][_0x2a12('0xe0')]&&_0x153c59['value']==='HANGUP'){delete this['uniqueId'][_0x153c59[_0x2a12('0xda')]];this['updateOriginated'](this['voiceQueues'][_0x4aaa64[_0x2a12('0xb3')]]);this[_0x2a12('0x22')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0x65')]+=0x1;this[_0x2a12('0x22')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0xe1')]+=0x1;_0x543a4f=new Hangup(_0x4aaa64,_0x153c59);_0x543a4f['state']=0x12;_0x543a4f['statedesc']=_0x2a12('0xe2');_0x543a4f[_0x2a12('0xe3')]=_0x2a12('0xe4');ami[_0x2a12('0x52')](_0x2a12('0xe5'),ut['buildObj'](_0x543a4f,_0x2a12('0xe6')));this[_0x2a12('0xca')](_0x543a4f,_0x2a12('0xe7'),_0x2a12('0xe8'));}if(_0x4aaa64[_0x2a12('0x5b')]!==_0x2a12('0x7f')&&this[_0x2a12('0x22')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0xe0')]&&_0x153c59[_0x2a12('0xe9')]===_0x2a12('0xea')){var _0x2066e8=this;return new BPromise(function(_0x2cf056,_0x474a6a){delete _0x2066e8[_0x2a12('0x29')][_0x153c59[_0x2a12('0xda')]];_0x2066e8[_0x2a12('0xb2')](_0x2066e8[_0x2a12('0x22')][_0x4aaa64['queue']]);_0x2066e8[_0x2a12('0x22')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0x65')]+=0x1;_0x2066e8[_0x2a12('0x22')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0xe1')]+=0x1;var _0x241dd5=_0x2066e8['voiceQueues'][_0x4aaa64[_0x2a12('0xb3')]];var _0x49f51f=new Hangup(_0x4aaa64,_0x153c59);_0x49f51f[_0x2a12('0xeb')]=0x13;_0x49f51f[_0x2a12('0xec')]=_0x2a12('0xed');_0x49f51f['membername']=_0x2a12('0xe4');_0x49f51f[_0x2a12('0xee')]+=0x1;_0x49f51f[_0x2a12('0xef')]+=0x1;_0x49f51f[_0x2a12('0xe6')]=!![];ami[_0x2a12('0x52')]('custom:amd',ut[_0x2a12('0xf0')](_0x49f51f,_0x2a12('0xe6')));_0x2066e8[_0x2a12('0xd8')](_0x49f51f)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0xf1')));if(_0x49f51f[_0x2a12('0xf2')]+_0x49f51f['countcongestionretry']+_0x49f51f[_0x2a12('0xf3')]+_0x49f51f[_0x2a12('0xf4')]+_0x49f51f[_0x2a12('0xf5')]+_0x49f51f[_0x2a12('0xf6')]+_0x49f51f[_0x2a12('0xee')]+_0x49f51f[_0x2a12('0xf7')]>=_0x241dd5[_0x2a12('0xf8')]){_0x2066e8[_0x2a12('0xf9')](_0x49f51f,_0x2cf056,_0x474a6a,_0x2a12('0xfa'));}else{if(_0x49f51f[_0x2a12('0xee')]>=_0x241dd5['dialMachineMaxRetry']){_0x2066e8[_0x2a12('0xfb')](_0x49f51f,_0x2cf056,_0x474a6a,'reason\x2019\x20machine....');}else{_0x2066e8['rescheduleContact']({'active':![],'countmachineretry':_0x49f51f[_0x2a12('0xee')],'scheduledat':moment()[_0x2a12('0xfc')](_0x241dd5[_0x2a12('0xfd')],'minutes')[_0x2a12('0x80')](_0x2a12('0xfe')),'ContactId':_0x49f51f['ContactId'],'ListId':_0x49f51f[_0x2a12('0xcd')],'VoiceQueueId':_0x49f51f[_0x2a12('0xff')]||undefined,'CampaignId':_0x49f51f[_0x2a12('0xcf')]||undefined})['catch'](loggerCatch(_0x2a12('0x100')));_0x2cf056({'reschedule':0x1});}}});}if(_0x4aaa64[_0x2a12('0x5b')]===_0x2a12('0x7f')&&this[_0x2a12('0x23')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0xe0')]&&_0x153c59[_0x2a12('0xe9')]==='HANGUP'){delete this[_0x2a12('0x29')][_0x153c59[_0x2a12('0xda')]];this['updateOriginated'](this['campaigns'][_0x4aaa64[_0x2a12('0xb3')]]);_0x543a4f=new Hangup(_0x4aaa64,_0x153c59);_0x543a4f[_0x2a12('0xeb')]=0x12;_0x543a4f['statedesc']=_0x2a12('0xe2');_0x543a4f[_0x2a12('0xe3')]=_0x2a12('0xe4');ami[_0x2a12('0x52')]('custom:amd',ut[_0x2a12('0xf0')](_0x543a4f,_0x2a12('0xe6')));this[_0x2a12('0xca')](_0x543a4f,_0x2a12('0x101'),'[syncHangupInAMDIvr]');}if(_0x4aaa64[_0x2a12('0x5b')]==='ivr'&&this[_0x2a12('0x23')][_0x4aaa64['queue']][_0x2a12('0xe0')]&&_0x153c59['value']===_0x2a12('0xea')){var _0x2066e8=this;return new BPromise(function(_0x3bab03,_0x32be3e){delete _0x2066e8['uniqueId'][_0x153c59[_0x2a12('0xda')]];_0x2066e8[_0x2a12('0xb2')](_0x2066e8[_0x2a12('0x23')][_0x4aaa64[_0x2a12('0xb3')]]);_0x2066e8[_0x2a12('0x23')][_0x4aaa64[_0x2a12('0xb3')]][_0x2a12('0x65')]+=0x1;_0x2066e8[_0x2a12('0x23')][_0x4aaa64['queue']][_0x2a12('0xe1')]+=0x1;var _0x4511c4=_0x2066e8[_0x2a12('0x23')][_0x4aaa64[_0x2a12('0xb3')]];var _0x1a8543=new Hangup(_0x4aaa64,_0x153c59);_0x1a8543[_0x2a12('0xeb')]=0x13;_0x1a8543['statedesc']=_0x2a12('0xed');_0x1a8543[_0x2a12('0xe3')]=_0x2a12('0xe4');_0x1a8543[_0x2a12('0xee')]+=0x1;_0x1a8543[_0x2a12('0xef')]+=0x1;_0x1a8543[_0x2a12('0xe6')]=!![];ami[_0x2a12('0x52')](_0x2a12('0xe5'),ut[_0x2a12('0xf0')](_0x1a8543,_0x2a12('0xe6')));_0x2066e8['createHistory'](_0x1a8543)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0xf1')));if(_0x1a8543[_0x2a12('0xf2')]+_0x1a8543[_0x2a12('0x102')]+_0x1a8543[_0x2a12('0xf3')]+_0x1a8543[_0x2a12('0xf4')]+_0x1a8543['countdropretry']+_0x1a8543[_0x2a12('0xf6')]+_0x1a8543[_0x2a12('0xee')]+_0x1a8543['countagentrejectretry']>=_0x4511c4[_0x2a12('0xf8')]){_0x2066e8[_0x2a12('0xf9')](_0x1a8543,_0x3bab03,_0x32be3e,_0x2a12('0xfa'));}else{if(_0x1a8543[_0x2a12('0xee')]>=_0x4511c4[_0x2a12('0x103')]){_0x2066e8[_0x2a12('0xfb')](_0x1a8543,_0x3bab03,_0x32be3e,_0x2a12('0x104'));}else{_0x2066e8[_0x2a12('0xbe')]({'active':![],'countmachineretry':_0x1a8543[_0x2a12('0xee')],'scheduledat':moment()['add'](_0x4511c4['dialMachineRetryFrequency'],_0x2a12('0x105'))[_0x2a12('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a8543[_0x2a12('0xcc')],'ListId':_0x1a8543['ListId'],'VoiceQueueId':_0x1a8543[_0x2a12('0xff')]||undefined,'CampaignId':_0x1a8543[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x100')));_0x3bab03({'reschedule':0x1});}}});}}};Dialer[_0x2a12('0xaf')]['syncHangup']=function(_0x1590f4){var _0x5d28b7=this[_0x2a12('0x29')][_0x1590f4['uniqueid']];var _0x3db969=this;var _0x4af299;if(_0x5d28b7&&_0x5d28b7['type']===_0x2a12('0x7f')){delete this[_0x2a12('0x29')][_0x1590f4[_0x2a12('0xda')]];this['updateOriginated'](this['campaigns'][_0x5d28b7['queue']]);this[_0x2a12('0x23')][_0x5d28b7[_0x2a12('0xb3')]][_0x2a12('0x106')]+=0x1;_0x4af299=new Hangup(_0x5d28b7,_0x1590f4);this['createHistory'](_0x4af299)['catch'](loggerCatch(_0x2a12('0x107')));this[_0x2a12('0xd9')](_0x4af299)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x108')));}if(_0x5d28b7&&_0x5d28b7[_0x2a12('0x5b')]!==_0x2a12('0x7f')&&isNotNull(this[_0x2a12('0x22')][_0x5d28b7[_0x2a12('0xb3')]]['dialQueueProject'])){delete this[_0x2a12('0x29')][_0x1590f4[_0x2a12('0xda')]];this[_0x2a12('0xb2')](this[_0x2a12('0x22')][_0x5d28b7[_0x2a12('0xb3')]]);this[_0x2a12('0x22')][_0x5d28b7[_0x2a12('0xb3')]][_0x2a12('0x65')]+=0x1;this[_0x2a12('0x22')][_0x5d28b7['queue']][_0x2a12('0xe1')]+=0x1;_0x4af299=new Hangup(_0x5d28b7,_0x1590f4);_0x4af299['state']=0x10;_0x4af299['statedesc']=_0x2a12('0x109');_0x4af299[_0x2a12('0xe3')]=_0x2a12('0x10a');this[_0x2a12('0xd8')](_0x4af299)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x107')));this['moveContactManagedDialer'](_0x4af299)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x108')));}if(_0x5d28b7&&_0x5d28b7[_0x2a12('0x5b')]!==_0x2a12('0x7f')&&!isNotNull(this[_0x2a12('0x22')][_0x5d28b7['queue']][_0x2a12('0x10b')])){delete this[_0x2a12('0x29')][_0x1590f4['uniqueid']];this[_0x2a12('0xb2')](this['voiceQueues'][_0x5d28b7[_0x2a12('0xb3')]]);this[_0x2a12('0x22')][_0x5d28b7[_0x2a12('0xb3')]][_0x2a12('0x6f')]+=0x1;_0x4af299=new Hangup(_0x5d28b7,_0x1590f4);_0x4af299['state']=0xc;_0x4af299['statedesc']=_0x1590f4[_0x2a12('0x10c')];_0x4af299[_0x2a12('0xe3')]=_0x2a12('0x10d');this[_0x2a12('0xd8')](_0x4af299)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x107')));this[_0x2a12('0xd9')](_0x4af299)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x108')));}};Dialer[_0x2a12('0xaf')][_0x2a12('0x10e')]=function(_0x1863bd){var _0x5f4502=this[_0x2a12('0x29')][_0x1863bd[_0x2a12('0xda')]];var _0x1b16fc=this;if(this[_0x2a12('0x22')][_0x1863bd[_0x2a12('0xb3')]]){if(_0x5f4502&&_0x5f4502['type']!==_0x2a12('0x7f')){delete this[_0x2a12('0x29')][_0x1863bd[_0x2a12('0xda')]];this[_0x2a12('0x22')][_0x1863bd['queue']][_0x2a12('0x65')]+=0x1;var _0xf56b2c=new AgentComplete(_0x5f4502,_0x1863bd);if(_0x1863bd[_0x2a12('0x10f')]===_0x2a12('0x110')){_0xf56b2c[_0x2a12('0x111')]=this['voiceQueues'][_0x1863bd[_0x2a12('0xb3')]]['dialQueueProject2']&&this['voiceQueues'][_0x1863bd['queue']]['dialAgiAfterHangupAgent']?moment()[_0x2a12('0x80')](_0x2a12('0xfe')):undefined;}this[_0x2a12('0xd8')](_0xf56b2c)[_0x2a12('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x2a12('0xd9')](_0xf56b2c)['catch'](loggerCatch(_0x2a12('0x112')));}}};Dialer['prototype'][_0x2a12('0x30')]=function(_0x40a3c4){if(this[_0x2a12('0x22')][_0x40a3c4[_0x2a12('0xb3')]]){if(this[_0x2a12('0x29')][_0x40a3c4[_0x2a12('0xda')]]&&this[_0x2a12('0x29')][_0x40a3c4[_0x2a12('0xda')]][_0x2a12('0x5b')]!==_0x2a12('0x7f')){this['updateOriginated'](this[_0x2a12('0x22')][_0x40a3c4[_0x2a12('0xb3')]]);this[_0x2a12('0x29')][_0x40a3c4[_0x2a12('0xda')]][_0x2a12('0x113')]=moment()['format'](_0x2a12('0xfe'));}}};Dialer[_0x2a12('0xaf')][_0x2a12('0x114')]=function(_0x433233){this[_0x2a12('0xd8')](_0x433233)[_0x2a12('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x2a12('0xd9')](_0x433233)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x115')));};Dialer[_0x2a12('0xaf')][_0x2a12('0x33')]=function(_0x1a4e60){var _0x507f69=this['uniqueId'][_0x1a4e60[_0x2a12('0xda')]];var _0x5a7f2b=this;if(this['voiceQueues'][_0x1a4e60['queue']]){if(_0x507f69&&_0x507f69[_0x2a12('0x5b')]!==_0x2a12('0x7f')){delete this[_0x2a12('0x29')][_0x1a4e60[_0x2a12('0xda')]];this['updateOriginated'](this[_0x2a12('0x22')][_0x1a4e60[_0x2a12('0xb3')]]);_0x507f69['droptime']=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));var _0x4bc5f1=new QueueCallerAbandon(_0x507f69,_0x1a4e60);if(getSeconds(_0x507f69[_0x2a12('0x116')],_0x507f69[_0x2a12('0x117')])>=_0x507f69[_0x2a12('0x118')]){this[_0x2a12('0x22')][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x73')]+=0x1;this['voiceQueues'][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x6b')]+=0x1;this[_0x2a12('0x22')][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x75')]+=0x1;_0x4bc5f1[_0x2a12('0xeb')]=0xa;_0x4bc5f1[_0x2a12('0xec')]=_0x2a12('0x119');_0x4bc5f1[_0x2a12('0x11a')]='TIMEOUT';_0x4bc5f1[_0x2a12('0x111')]=this[_0x2a12('0x22')][_0x1a4e60['queue']]['dialQueueProject2']?moment()[_0x2a12('0x80')](_0x2a12('0xfe')):undefined;_0x4bc5f1[_0x2a12('0xf5')]+=0x1;_0x4bc5f1[_0x2a12('0xef')]+=0x1;if(_0x4bc5f1['countdropretry']>=this[_0x2a12('0x22')][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x11b')]){this['queueCallerAbandonCreateState'](_0x4bc5f1);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4bc5f1[_0x2a12('0xf5')],'scheduledat':moment()[_0x2a12('0xfc')](this['voiceQueues'][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x11c')],'minutes')[_0x2a12('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x507f69[_0x2a12('0xcc')],'ListId':_0x507f69[_0x2a12('0xcd')],'VoiceQueueId':_0x507f69[_0x2a12('0xff')]||undefined,'CampaignId':_0x507f69[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x11d')));var _0x316a3d=new History(_0x4bc5f1);_0x316a3d[_0x2a12('0xeb')]=0xa;_0x316a3d['statedesc']='Drop';_0x316a3d[_0x2a12('0xad')]=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));_0x316a3d[_0x2a12('0xac')]=_0x316a3d[_0x2a12('0xad')];_0x316a3d[_0x2a12('0x11e')]=_0x4bc5f1[_0x2a12('0x11e')];_0x316a3d[_0x2a12('0x11f')]=_0x4bc5f1[_0x2a12('0x11f')];this[_0x2a12('0xd8')](_0x316a3d)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x120')));}}else{this['voiceQueues'][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x72')]+=0x1;this[_0x2a12('0x22')][_0x1a4e60[_0x2a12('0xb3')]][_0x2a12('0x6a')]+=0x1;_0x4bc5f1[_0x2a12('0xeb')]=0xb;_0x4bc5f1['statedesc']=_0x2a12('0x121');_0x4bc5f1[_0x2a12('0x11a')]=_0x2a12('0x122');_0x4bc5f1[_0x2a12('0xf6')]+=0x1;_0x4bc5f1['countglobal']+=0x1;if(_0x4bc5f1['countabandonedretry']>=this['voiceQueues'][_0x1a4e60[_0x2a12('0xb3')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x4bc5f1);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x4bc5f1[_0x2a12('0xf6')],'scheduledat':moment()[_0x2a12('0xfc')](this[_0x2a12('0x22')][_0x1a4e60['queue']]['dialAbandonedRetryFrequency'],_0x2a12('0x105'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x507f69[_0x2a12('0xcc')],'ListId':_0x507f69['ListId'],'VoiceQueueId':_0x507f69[_0x2a12('0xff')]||undefined,'CampaignId':_0x507f69[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x123')));var _0x316a3d=new History(_0x4bc5f1);_0x316a3d[_0x2a12('0xeb')]=0xb;_0x316a3d[_0x2a12('0xec')]=_0x2a12('0x121');_0x316a3d['starttime']=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));_0x316a3d[_0x2a12('0xac')]=_0x316a3d['starttime'];_0x316a3d[_0x2a12('0x11e')]=_0x4bc5f1[_0x2a12('0x11e')];_0x316a3d[_0x2a12('0x11f')]=_0x4bc5f1[_0x2a12('0x11f')];this[_0x2a12('0xd8')](_0x316a3d)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x124')));}}}}};Dialer[_0x2a12('0xaf')]['syncNewExten']=function(_0x1ee363){if(this[_0x2a12('0x27')][_0x1ee363[_0x2a12('0xda')]]){this[_0x2a12('0x27')][_0x1ee363[_0x2a12('0xda')]]['channel']=_0x1ee363[_0x2a12('0x125')];}if(this[_0x2a12('0x29')][_0x1ee363['uniqueid']]){this['uniqueId'][_0x1ee363['uniqueid']][_0x2a12('0x125')]=_0x1ee363[_0x2a12('0x125')];}};Dialer[_0x2a12('0xaf')]['syncQueueMember']=function(_0x56dcbc){if(strategy[this['voiceQueues'][this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]][_0x2a12('0xb3')]][_0x2a12('0x54')]]===_0x2a12('0x1d')){if(this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]]&&_[_0x2a12('0xdc')](this[_0x2a12('0x27')][_0x56dcbc['actionid']][_0x2a12('0x127')])&&_0x56dcbc[_0x2a12('0xd6')]==='1'&&_0x56dcbc[_0x2a12('0x128')]==='0'){if(this['agents'][_0x56dcbc[_0x2a12('0x129')]]){if(!this['agents'][_0x56dcbc['stateinterface']][_0x2a12('0x127')]){this['agents'][_0x56dcbc[_0x2a12('0x129')]][_0x2a12('0x127')]=!![];this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]][_0x2a12('0x127')]=!![];this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]][_0x2a12('0x129')]=_0x56dcbc['stateinterface'];}}}}else if((strategy[this[_0x2a12('0x22')][this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]]['queue']][_0x2a12('0x54')]]||_0x2a12('0x12a'))===_0x2a12('0x12a')){if(this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]]){if(this[_0x2a12('0x24')][_0x56dcbc[_0x2a12('0x129')]]){this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]]['stateinterface']=_0x56dcbc[_0x2a12('0x129')];if(_['isNil'](this[_0x2a12('0x2d')][this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]][_0x2a12('0xb3')]])){this[_0x2a12('0x2d')][this[_0x2a12('0x27')][_0x56dcbc[_0x2a12('0x126')]][_0x2a12('0xb3')]]=[];}this[_0x2a12('0x2d')][this['actions'][_0x56dcbc[_0x2a12('0x126')]]['queue']][_0x2a12('0x12b')](_['merge'](_[_0x2a12('0xcb')](this['actions'][_0x56dcbc['actionid']],['idHopper',_0x2a12('0x129')]),{'status':_0x56dcbc['status'],'paused':_0x56dcbc[_0x2a12('0x128')]}));}}}};function unlockQueueStatus(_0x2a5e92,_0x1997e5){setTimeout(function(){if(_['isUndefined'](_0x2a5e92['queueStatusComplete'])){loggerBooked['error'](_0x2a12('0x12c'),_0x1997e5);}_0x2a5e92['queueStatusComplete']=!![];loggerBooked[_0x2a12('0x83')](_0x2a12('0x12d'),_0x1997e5,JSON['stringify'](_[_0x2a12('0xcb')](_0x2a5e92,[_0x2a12('0x4a'),_0x2a12('0x12e')])));},0x1f3);}Dialer[_0x2a12('0xaf')][_0x2a12('0x41')]=function(_0x4c2919){var _0x1122e9=this;var _0x213cf8=_0x1122e9['voiceQueues'][_0x1122e9[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]]['queue']];if(strategy[this[_0x2a12('0x22')][this['actions'][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0xb3')]][_0x2a12('0x54')]]==='roundrobin'){if(this['actions'][_0x4c2919[_0x2a12('0x126')]]&&this['actions'][_0x4c2919['actionid']][_0x2a12('0x129')]){this[_0x2a12('0x96')][_0x2a12('0x12f')](this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0x130')],this['actions'][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0x129')])[_0x2a12('0xb0')](function(_0x28a893){logger[_0x2a12('0x99')](_0x2a12('0x131'),util['inspect'](_0x28a893,{'showHidden':![],'depth':null}));})[_0x2a12('0x20')](function(){_0x1122e9[_0x2a12('0xb2')](_0x1122e9[_0x2a12('0x22')][_0x1122e9[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]]['queue']]);_0x1122e9[_0x2a12('0x24')][_0x1122e9[_0x2a12('0x27')][_0x4c2919['actionid']][_0x2a12('0x129')]][_0x2a12('0x127')]=![];delete _0x1122e9[_0x2a12('0x27')][_0x4c2919['actionid']];unlockQueueStatus(_0x213cf8);});}else{this[_0x2a12('0xb2')](this['voiceQueues'][this['actions'][_0x4c2919['actionid']][_0x2a12('0xb3')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]]['ContactId'],'ListId':this['actions'][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0xcd')],'VoiceQueueId':this['actions'][_0x4c2919[_0x2a12('0x126')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x4c2919['actionid']][_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]];unlockQueueStatus(_0x213cf8);}}else if((strategy[this['voiceQueues'][this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0xb3')]][_0x2a12('0x54')]]||'rrmemory')===_0x2a12('0x12a')){var _0x472be5;if(this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0x4c2919[_0x2a12('0x126')]]['queue']])){if(this['queueBookedRR'][_0x1122e9['actions'][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0xb3')]]){this[_0x2a12('0x2e')][_0x1122e9['actions'][_0x4c2919['actionid']]['queue']]=this[_0x2a12('0x2e')][this[_0x2a12('0x27')][_0x4c2919['actionid']][_0x2a12('0xb3')]]?this[_0x2a12('0x2e')][this[_0x2a12('0x27')][_0x4c2919['actionid']][_0x2a12('0xb3')]]:this['queueBooked'][this[_0x2a12('0x27')][_0x4c2919['actionid']][_0x2a12('0xb3')]]?this[_0x2a12('0x2d')][this[_0x2a12('0x27')][_0x4c2919['actionid']][_0x2a12('0xb3')]][_0x2a12('0x132')]||0x0:0x0;}this['queueBooked'][this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]]['queue']]['_rr']=this[_0x2a12('0x2e')][this[_0x2a12('0x27')][_0x4c2919[_0x2a12('0x126')]][_0x2a12('0xb3')]];for(var _0x5d384f=0x0;_0x5d384f=0x0;})[_0x2a12('0xb0')](myreject(_0x23491e)));}}else{_0x396157[_0x2a12('0x12b')](ami[_0x2a12('0x14f')]({'action':'command','command':util[_0x2a12('0x80')](_0x2a12('0x150'),_0x2ff9c2,!_[_0x2a12('0x44')](config['timezones'][_0x49e478])?_0x49e478:'')})[_0x2a12('0xb8')](function(_0x59b904){return _0x59b904[_0x2a12('0x14c')][_0x2a12('0x14d')](_0x2a12('0x14e'))>=0x0;})[_0x2a12('0xb0')](myreject(_0x23491e)));}BPromise[_0x2a12('0x151')](_0x396157)[_0x2a12('0xb8')](function(_0x377aec){var _0x1d95c5=_[_0x2a12('0x152')](_0x377aec);if(_0x1d95c5){return _0x1a0a2a(_0x1d95c5);}else{_0x575428[_0x2a12('0x45')]=_0x8a1b21?_0x2a12('0x153'):_0x2a12('0x154');return _0x23491e(msgResponse(_0x2a12('0x155'),_0x2a12('0x145'),_0x2a12('0x156')+_0x8a1b21+'\x20'+_0x4b4f77+_0x2a12('0x157')+util['inspect'](_0x2ff9c2,{'showHidden':![],'depth':null})+_0x2a12('0x158')+_0x49e478));}})[_0x2a12('0xb0')](function(_0x41ef92){return _0x23491e(msgResponse('ifTime',_0x2a12('0x145'),JSON[_0x2a12('0x4e')](_0x41ef92)));});});};Dialer[_0x2a12('0xaf')][_0x2a12('0x159')]=function(_0x2f434f){var _0x400cd9=this;return function(){switch(_0x2f434f[_0x2a12('0x60')]){case _0x2a12('0x15a'):freeVariablesPredictive(_0x2f434f);_0x400cd9['handlePower'](_0x2f434f,0x1);break;case _0x2a12('0x15b'):freeVariablesPredictive(_0x2f434f);_0x400cd9[_0x2a12('0x15c')](_0x2f434f,_0x2f434f[_0x2a12('0x15d')]);break;case'predictive':_0x400cd9[_0x2a12('0x15e')](_0x2f434f);break;case _0x2a12('0xb'):freeVariablesPredictive(_0x2f434f);_0x400cd9[_0x2a12('0x15c')](_0x2f434f,0x1);break;default:freeVariablesPredictive(_0x2f434f);logger['error'](_0x2a12('0x15f'),_0x2f434f[_0x2a12('0x4a')],'method\x20not\x20recognized');}};};Dialer[_0x2a12('0xaf')][_0x2a12('0x160')]=function(_0x4f8630){var _0x12e4f3=this;return function(){_0x12e4f3[_0x2a12('0x161')](_0x4f8630);};};Dialer[_0x2a12('0xaf')]['syncQueueSummary']=function(_0x387f6e){var _0x2e9d60=this;if(isNotPreview(_0x387f6e[_0x2a12('0x60')])){if(isVoiceQueueOutbound(_0x387f6e[_0x2a12('0x5b')])&&isActive(_0x387f6e[_0x2a12('0x5f')])){_0x387f6e[_0x2a12('0xa4')]=!![];BPromise[_0x2a12('0xb7')]()[_0x2a12('0xb8')](checkIsLoggedIn(_0x387f6e,_0x387f6e['loggedIn']))['then'](checkIsActive(_0x387f6e,_0x387f6e['dialActive']))['then'](checkInterval(_0x387f6e))['then'](_0x2e9d60[_0x2a12('0x162')](_0x387f6e))[_0x2a12('0xb8')](_0x2e9d60[_0x2a12('0x140')](_0x387f6e[_0x2a12('0x163')],_0x387f6e[_0x2a12('0x164')],_0x387f6e[_0x2a12('0x4a')],_0x387f6e))[_0x2a12('0xb8')](_0x2e9d60[_0x2a12('0x141')](_0x387f6e[_0x2a12('0x48')],_0x387f6e[_0x2a12('0x164')],_0x387f6e['name'],_0x387f6e))[_0x2a12('0xb8')](_0x2e9d60[_0x2a12('0x159')](_0x387f6e))[_0x2a12('0xb0')](loggerCatchQueueSummary(_0x2a12('0x165'),_0x387f6e));}else{notSendMessagesQueue(_0x387f6e);}}else{freeVariablesPredictive(_0x387f6e);}};Dialer['prototype']['syncCampaigns']=function(){var _0x3189f0=this;var _0x4207a2;for(var _0x142931 in this[_0x2a12('0x23')]){if(typeof this['campaigns'][_0x142931]!==_0x2a12('0x9d')){_0x4207a2=this[_0x2a12('0x23')][_0x142931];if(isCampaignIvr(_0x4207a2[_0x2a12('0x5b')])&&isActive(_0x4207a2[_0x2a12('0xd4')])){_0x4207a2[_0x2a12('0xa4')]=!![];BPromise[_0x2a12('0xb7')]()['then'](checkIsActive(_0x4207a2,_0x4207a2[_0x2a12('0xd4')]))[_0x2a12('0xb8')](checkInterval(_0x4207a2))[_0x2a12('0xb8')](_0x3189f0[_0x2a12('0x162')](_0x4207a2))['then'](_0x3189f0[_0x2a12('0x140')](_0x4207a2[_0x2a12('0x163')],_0x4207a2[_0x2a12('0x164')],_0x4207a2[_0x2a12('0x4a')],_0x4207a2))[_0x2a12('0xb8')](_0x3189f0[_0x2a12('0x141')](_0x4207a2[_0x2a12('0x48')],_0x4207a2[_0x2a12('0x164')],_0x4207a2['name'],_0x4207a2))[_0x2a12('0xb8')](_0x3189f0[_0x2a12('0x160')](_0x4207a2))[_0x2a12('0xb0')](loggerCatchQueueSummary(_0x2a12('0x166'),_0x4207a2));}else{notSendMessagesCampaign(_0x4207a2);}}}};function getCallerIdRandom(_0x417760,_0x38b7ae){var _0x1ce090;var _0x12558f;var _0x105492;if(_0x38b7ae<=0x0){_0x38b7ae=0x1;}_0x1ce090=new RegExp(_0x2a12('0x167')+_0x38b7ae+'}$');_0x12558f=Math[_0x2a12('0x168')](0xa,_0x38b7ae-0x1);_0x105492=Math[_0x2a12('0x168')](0xa,_0x38b7ae)-0x1;return util[_0x2a12('0x80')]('%s',_['replace'](_0x417760,_0x1ce090,_['random'](_0x12558f,_0x105492)));}function extractCalleridName(_0x2ae939){var _0x35d7ad=_0x2ae939[_0x2a12('0x169')](/"(.*?)"/);return _0x35d7ad?_0x35d7ad[0x1]:_0x2ae939;}function extractCalleridNumber(_0x46ac42){var _0x3ebadd=_0x46ac42[_0x2a12('0x169')](/<(.*?)>/);return _0x3ebadd?_0x3ebadd[0x1]:_0x46ac42;}Dialer[_0x2a12('0xaf')]['actionOriginate']=function(_0xce7e56,_0x3e2693){var _0x502e87=this;var _0x30d5e0=uuid['v4']();this['actions'][_0x30d5e0]=new Action(_0xce7e56,_0x3e2693,_0x30d5e0);return new BPromise(function(_0x3b5fc5,_0x4dfe03){if(_[_0x2a12('0x44')](_0xce7e56)&&typeof _0xce7e56!==_0x2a12('0x16a')){return _0x4dfe03(msgResponse(_0x2a12('0x16b'),_0x2a12('0x145'),_0x2a12('0x16c')));}if(_[_0x2a12('0x44')](_0x3e2693['Contact'][_0x2a12('0x16d')])||_0x3e2693[_0x2a12('0x16e')]['phone']===null){return _0x4dfe03(msgResponse(_0x2a12('0x16b'),_0x2a12('0x145'),_0x2a12('0x16f')));}var _0x3600fb={'XMD-CALLERID':_0x502e87[_0x2a12('0x27')][_0x30d5e0][_0x2a12('0x170')](),'XMD-AGI':_0xce7e56['dialQueueProject']?util[_0x2a12('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0xce7e56['dialQueueProject']):_0x2a12('0x171'),'XMD-AGIAFTER':_0xce7e56[_0x2a12('0x172')]?util[_0x2a12('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0xce7e56['dialQueueProject2']):_0x2a12('0x171'),'XMD-QUEUE':_0xce7e56[_0x2a12('0x5b')]===_0x2a12('0x53')?util[_0x2a12('0x80')](_0x2a12('0x173'),_0xce7e56['name'],_0xce7e56['dialQueueOptions']||'',_0xce7e56[_0x2a12('0x174')]?'c':'',_0xce7e56[_0x2a12('0x118')]||0x3):'NONE','XMD-CONTACTID':_0x3e2693[_0x2a12('0xcc')],'XMD-CDRTYPE':_0x2a12('0xa'),'CALLERID(all)':_0x502e87[_0x2a12('0x27')][_0x30d5e0]['getCaller'](),'XMD-AMD':_0xce7e56[_0x2a12('0xe0')]?_0x2a12('0x175'):_0x2a12('0x171'),'XMD-DESTINATION':_0x2a12('0xdf')};if(_0xce7e56[_0x2a12('0xe0')]){_0x3600fb['XMD-AMDINITIALSILENCE']=_0xce7e56[_0x2a12('0x176')]||0x9c4;_0x3600fb[_0x2a12('0x177')]=_0xce7e56[_0x2a12('0x178')]||0x5dc;_0x3600fb[_0x2a12('0x179')]=_0xce7e56[_0x2a12('0x17a')]||0x320;_0x3600fb['XMD-AMDTOTALANALYSISTIME']=_0xce7e56['dialAMDTotalAnalysisTime']||0x1388;_0x3600fb['XMD-AMDMINWORDLENGTH']=_0xce7e56[_0x2a12('0x17b')]||0x64;_0x3600fb[_0x2a12('0x17c')]=_0xce7e56[_0x2a12('0x17d')]||0x32;_0x3600fb[_0x2a12('0x17e')]=_0xce7e56[_0x2a12('0x17f')]||0x3;_0x3600fb[_0x2a12('0x180')]=_0xce7e56['dialAMDSilenceThreshold']||0x100;_0x3600fb[_0x2a12('0x181')]=_0xce7e56[_0x2a12('0x182')]||0x1388;}if(_0xce7e56[_0x2a12('0x5b')]==='outbound'){_0x3600fb[_0x2a12('0x183')]=_0x3e2693['VoiceQueueId'];}else{_0x3600fb[_0x2a12('0x184')]=_0x3e2693[_0x2a12('0xcf')];}for(var _0x55d6cd in _0x3e2693[_0x2a12('0x16e')]){if(typeof _0x3e2693[_0x2a12('0x16e')][_0x55d6cd]!==_0x2a12('0x9d')){if(isNotNull(_0x3e2693[_0x2a12('0x16e')][_0x55d6cd])&&_0x55d6cd!=='id'&&_0x55d6cd!==_0x2a12('0x185')&&_0x55d6cd!==_0x2a12('0x186')&&_0x55d6cd!==_0x2a12('0x187')){_0x3600fb[util['format']('%s%s',_0x2a12('0x188'),_[_0x2a12('0x189')](_0x55d6cd))]=_0x3e2693[_0x2a12('0x16e')][_0x55d6cd];}}}var _0x5dbd91=_0x502e87[_0x2a12('0xd3')](_0xce7e56[_0x2a12('0x7c')])?getCallerId(_0xce7e56[_0x2a12('0x7c')][_0x2a12('0x7d')],_0xce7e56[_0x2a12('0x61')],_0xce7e56[_0x2a12('0x18a')]>0x0?getCallerIdRandom(_0xce7e56['dialOriginateCallerIdNumber'],_0xce7e56[_0x2a12('0x18a')]):_0xce7e56[_0x2a12('0x62')]):getCallerId(_[_0x2a12('0xdc')](_0xce7e56[_0x2a12('0x13d')])?_0xce7e56[_0x2a12('0x7c')][_0x2a12('0x7d')]:_0xce7e56[_0x2a12('0x13d')][_0x2a12('0x7d')],_0xce7e56[_0x2a12('0x61')],_0xce7e56[_0x2a12('0x18a')]>0x0?getCallerIdRandom(_0xce7e56[_0x2a12('0x62')],_0xce7e56[_0x2a12('0x18a')]):_0xce7e56['dialOriginateCallerIdNumber']);if(_0x5dbd91){_0x3600fb[_0x2a12('0x18b')]=_0x502e87['actions'][_0x30d5e0]['originatecalleridname']=extractCalleridName(_0x5dbd91);_0x3600fb[_0x2a12('0x18c')]=_0x502e87[_0x2a12('0x27')][_0x30d5e0][_0x2a12('0x18d')]=extractCalleridNumber(_0x5dbd91);}return ami['Action']({'actionid':_0x30d5e0,'action':'originate','channel':_0x502e87[_0x2a12('0xd3')](_0xce7e56[_0x2a12('0x7c')])?util[_0x2a12('0x80')](_0x2a12('0x18e'),_0xce7e56[_0x2a12('0x7c')][_0x2a12('0x4a')],isNotNull(_0xce7e56[_0x2a12('0x64')])?_0xce7e56[_0x2a12('0x64')]['trim']()||'':'',_0xce7e56[_0x2a12('0x18f')]>0x0?_0x3e2693['Contact'][_0x2a12('0x16d')][_0x2a12('0x190')](_0xce7e56[_0x2a12('0x18f')]):_0x3e2693['Contact']['phone']):util[_0x2a12('0x80')](_0x2a12('0x18e'),_[_0x2a12('0xdc')](_0xce7e56['TrunkBackup'])?_0xce7e56[_0x2a12('0x7c')][_0x2a12('0x4a')]:_0xce7e56[_0x2a12('0x13d')]['name'],isNotNull(_0xce7e56['dialPrefix'])?_0xce7e56[_0x2a12('0x64')]['trim']()||'':'',_0xce7e56[_0x2a12('0x18f')]>0x0?_0x3e2693[_0x2a12('0x16e')][_0x2a12('0x16d')]['substring'](_0xce7e56[_0x2a12('0x18f')]):_0x3e2693[_0x2a12('0x16e')][_0x2a12('0x16d')]),'callerid':_0x5dbd91,'Exten':_0x2a12('0xdf'),'Context':_0x2a12('0x191'),'Priority':'1','variable':_0x3600fb,'timeout':(_0xce7e56[_0x2a12('0x63')]||0x1e)*0x3e8,'async':!![],'channelid':_0x30d5e0})['then'](function(_0x5c36ed){return _0x3b5fc5(_0x5c36ed);})[_0x2a12('0xb0')](function(_0xde6dc2){_0xce7e56[_0x2a12('0x6d')]+=0x1;var _0x3e9788=new History(_0x502e87[_0x2a12('0x27')][_0x30d5e0]);logger[_0x2a12('0x99')](util[_0x2a12('0x80')](_0x2a12('0x192'),JSON[_0x2a12('0x4e')](_0xde6dc2)));_0x3e9788['state']=0xe;_0x3e9788[_0x2a12('0xec')]=_0x2a12('0x193');_0x3e9788[_0x2a12('0xad')]=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));_0x3e9788[_0x2a12('0xac')]=_0x3e9788['starttime'];_0x502e87['createHistory'](_0x3e9788)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x194')));_0x502e87[_0x2a12('0xd9')](_0x3e9788)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x194')))[_0x2a12('0x20')](function(){delete _0x502e87['actions'][_0x30d5e0];return _0x4dfe03(msgResponse(_0x2a12('0x16b'),_0x2a12('0x195'),_0x2a12('0x196')));});});});};Dialer['prototype'][_0x2a12('0x35')]=function(_0x40c555){var _0x1a0904=this[_0x2a12('0x27')][_0x40c555[_0x2a12('0x126')]];if(_0x1a0904){delete this[_0x2a12('0x27')][_0x40c555[_0x2a12('0x126')]];_0x1a0904['responsetime']=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));var _0x1111c2=_0x1a0904[_0x2a12('0x5b')]===_0x2a12('0x7f')?this['campaigns'][_0x1a0904[_0x2a12('0xb3')]]:this['voiceQueues'][_0x1a0904[_0x2a12('0x197')]()];if(!this[_0x2a12('0xd2')](_0x40c555[_0x2a12('0x198')])){this[_0x2a12('0xb2')](_0x1111c2);return this[_0x2a12('0x199')](_0x1a0904,_0x1111c2,_0x40c555)['catch'](loggerCatch(_0x2a12('0x19a')));}this[_0x2a12('0x29')][_0x40c555[_0x2a12('0xda')]]=_0x1a0904;}};Dialer[_0x2a12('0xaf')][_0x2a12('0x19b')]=function(_0x498ea9,_0x4d72a2,_0x1d5942){var _0x2cca44=new History(_0x4d72a2);if(_0x2cca44[_0x2a12('0xf2')]+_0x2cca44[_0x2a12('0x102')]+_0x2cca44['countnoanswerretry']+_0x2cca44[_0x2a12('0xf4')]+_0x2cca44[_0x2a12('0xf5')]+_0x2cca44[_0x2a12('0xf6')]+_0x2cca44['countmachineretry']+_0x2cca44['countagentrejectretry']>=_0x1d5942[_0x2a12('0xf8')]-0x1){return!![];}switch(_0x498ea9){case 0x3:if(_0x2cca44[_0x2a12('0xf3')]>=_0x1d5942[_0x2a12('0x19c')]-0x1){return!![];}this[_0x2a12('0xbe')]({'active':![],'countnoanswerretry':_0x2cca44['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x2a12('0xfc')](_0x1d5942['dialNoAnswerRetryFrequency'],_0x2a12('0x105'))[_0x2a12('0x80')](_0x2a12('0xfe')),'ContactId':_0x2cca44[_0x2a12('0xcc')],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x19d')));break;case 0x5:if(_0x2cca44[_0x2a12('0xf2')]>=_0x1d5942[_0x2a12('0x19e')]-0x1){return!![];}this[_0x2a12('0xbe')]({'active':![],'countbusyretry':_0x2cca44[_0x2a12('0xf2')]+=0x1,'scheduledat':moment()[_0x2a12('0xfc')](_0x1d5942['dialBusyRetryFrequency'],_0x2a12('0x105'))['format'](_0x2a12('0xfe')),'ContactId':_0x2cca44[_0x2a12('0xcc')],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2cca44[_0x2a12('0x102')]>=_0x1d5942[_0x2a12('0x19f')]-0x1){return!![];}this[_0x2a12('0xbe')]({'active':![],'countcongestionretry':_0x2cca44[_0x2a12('0x102')]+=0x1,'scheduledat':moment()[_0x2a12('0xfc')](_0x1d5942[_0x2a12('0x1a0')],_0x2a12('0x105'))[_0x2a12('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cca44['ContactId'],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x2cca44[_0x2a12('0xf4')]>=_0x1d5942[_0x2a12('0x1a1')]-0x1){return!![];}else{this[_0x2a12('0xbe')]({'active':![],'countnosuchnumberretry':_0x2cca44[_0x2a12('0xf4')]+=0x1,'scheduledat':moment()[_0x2a12('0xfc')](_0x1d5942[_0x2a12('0x1a2')],_0x2a12('0x105'))['format'](_0x2a12('0xfe')),'ContactId':_0x2cca44[_0x2a12('0xcc')],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})['catch'](loggerCatch(_0x2a12('0x1a3')));}break;case 0xa:if(_0x2cca44[_0x2a12('0xf5')]>=_0x1d5942[_0x2a12('0x11b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2cca44[_0x2a12('0xf5')]+=0x1,'scheduledat':moment()[_0x2a12('0xfc')](_0x1d5942[_0x2a12('0x11c')],_0x2a12('0x105'))[_0x2a12('0x80')](_0x2a12('0xfe')),'ContactId':_0x2cca44[_0x2a12('0xcc')],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})['catch'](loggerCatch(_0x2a12('0x11d')));break;case 0xb:if(_0x2cca44[_0x2a12('0xf6')]>=_0x1d5942[_0x2a12('0x1a4')]-0x1){return!![];}this[_0x2a12('0xbe')]({'active':![],'countabandonedretry':_0x2cca44[_0x2a12('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x1d5942[_0x2a12('0x1a5')],'minutes')[_0x2a12('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cca44[_0x2a12('0xcc')],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44['CampaignId']||undefined})[_0x2a12('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2cca44[_0x2a12('0xee')]>=_0x1d5942[_0x2a12('0x103')]-0x1){return!![];}this[_0x2a12('0xbe')]({'active':![],'countmachineretry':_0x2cca44[_0x2a12('0xee')]+=0x1,'scheduledat':moment()[_0x2a12('0xfc')](_0x1d5942[_0x2a12('0xfd')],_0x2a12('0x105'))[_0x2a12('0x80')](_0x2a12('0xfe')),'ContactId':_0x2cca44['ContactId'],'ListId':_0x2cca44['ListId'],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2cca44[_0x2a12('0xf7')]>=_0x1d5942['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x2a12('0xbe')]({'active':![],'countagentrejectretry':_0x2cca44['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x1d5942[_0x2a12('0x1a6')],_0x2a12('0x105'))[_0x2a12('0x80')](_0x2a12('0xfe')),'ContactId':_0x2cca44['ContactId'],'ListId':_0x2cca44[_0x2a12('0xcd')],'VoiceQueueId':_0x2cca44[_0x2a12('0xff')]||undefined,'CampaignId':_0x2cca44[_0x2a12('0xcf')]||undefined})[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x1a7')));break;default:return!![];}};Dialer['prototype'][_0x2a12('0x199')]=function(_0xc86776,_0x2bf6c6,_0x27f1e8){var _0x1ef4f7=this;var _0x4c835b=new History(_0xc86776);return new BPromise(function(_0x41145c,_0x109440){if(_[_0x2a12('0x44')](_0x2bf6c6)&&typeof _0x2bf6c6!==_0x2a12('0x16a')){return _0x109440(msgResponse(_0x2a12('0x1a8'),'Failure',_0x2a12('0x1a9')));}if(_['isUndefined'](_0x27f1e8)&&typeof _0x27f1e8!==_0x2a12('0x16a')){return _0x109440(msgResponse('[callProgressDetecting]',_0x2a12('0x145'),_0x2a12('0x1aa')));}switch(_0x27f1e8['reason']){case'0':_0x2bf6c6[_0x2a12('0x6c')]+=0x1;_0x4c835b[_0x2a12('0xeb')]=0x0;_0x4c835b[_0x2a12('0xec')]=_0x2a12('0x1ab');_0x4c835b[_0x2a12('0xf4')]+=0x1;_0x4c835b[_0x2a12('0xef')]+=0x1;ami[_0x2a12('0x52')](_0x2a12('0x1ac'),ut[_0x2a12('0xf0')](_0xc86776,_0x2a12('0x1ad')));_0x1ef4f7[_0x2a12('0xd8')](_0x4c835b)['catch'](loggerCatch(_0x2a12('0xf1')));if(_0x1ef4f7[_0x2a12('0x19b')](0x0,_0xc86776,_0x2bf6c6)){if(_0x4c835b['countnosuchnumberretry']>=_0x2bf6c6[_0x2a12('0x1a1')]){_0x1ef4f7[_0x2a12('0xfb')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1ae'));}else{_0x1ef4f7['stateGlobal'](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1ae'));}}break;case'3':_0x2bf6c6['outboundNoAnswerCallsDay']+=0x1;_0x4c835b[_0x2a12('0xeb')]=0x3;_0x4c835b['statedesc']=_0x2a12('0x1af');_0x4c835b[_0x2a12('0xf3')]+=0x1;_0x4c835b[_0x2a12('0xef')]+=0x1;ami[_0x2a12('0x52')](_0x2a12('0x1b0'),ut[_0x2a12('0xf0')](_0xc86776,'noanswer'));_0x1ef4f7[_0x2a12('0xd8')](_0x4c835b)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1ef4f7[_0x2a12('0x19b')](0x3,_0xc86776,_0x2bf6c6)){if(_0x4c835b[_0x2a12('0xf3')]>=_0x2bf6c6[_0x2a12('0x19c')]){_0x1ef4f7[_0x2a12('0xfb')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1b1'));}else{_0x1ef4f7[_0x2a12('0xf9')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1b1'));}}break;case'5':_0x2bf6c6[_0x2a12('0x67')]+=0x1;_0x4c835b['state']=0x5;_0x4c835b[_0x2a12('0xec')]='Busy';_0x4c835b['countbusyretry']+=0x1;_0x4c835b[_0x2a12('0xef')]+=0x1;ami[_0x2a12('0x52')](_0x2a12('0x1b2'),ut[_0x2a12('0xf0')](_0xc86776,'busy'));_0x1ef4f7['createHistory'](_0x4c835b)[_0x2a12('0xb0')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1ef4f7['checkRetriveMax'](0x5,_0xc86776,_0x2bf6c6)){if(_0x4c835b[_0x2a12('0xf2')]>=_0x2bf6c6['dialBusyMaxRetry']){_0x1ef4f7[_0x2a12('0xfb')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1b3'));}else{_0x1ef4f7['stateGlobal'](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1b3'));}}break;case'8':_0x2bf6c6[_0x2a12('0x68')]+=0x1;_0x4c835b[_0x2a12('0xeb')]=0x8;_0x4c835b[_0x2a12('0xec')]='Congestion';_0x4c835b[_0x2a12('0x102')]+=0x1;_0x4c835b[_0x2a12('0xef')]+=0x1;ami['emit'](_0x2a12('0x1b4'),ut[_0x2a12('0xf0')](_0xc86776,_0x2a12('0x1b5')));_0x1ef4f7[_0x2a12('0xd8')](_0x4c835b)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x1b6')));if(_0x1ef4f7[_0x2a12('0x19b')](0x8,_0xc86776,_0x2bf6c6)){if(_0x4c835b[_0x2a12('0x102')]>=_0x2bf6c6[_0x2a12('0x19f')]){_0x1ef4f7[_0x2a12('0xfb')](_0x4c835b,_0x41145c,_0x109440,'reason\x208\x20congestion');}else{_0x1ef4f7['stateGlobal'](_0x4c835b,_0x41145c,_0x109440,'reason\x208\x20congestion');}}break;case'11':_0x2bf6c6[_0x2a12('0x1b7')]+=0x1;_0x4c835b[_0x2a12('0xeb')]=0xb;_0x4c835b['statedesc']=_0x2a12('0x121');_0x4c835b[_0x2a12('0xf6')]+=0x1;_0x4c835b[_0x2a12('0xef')]+=0x1;_0x1ef4f7['createHistory'](_0x4c835b)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x124')));if(_0x1ef4f7[_0x2a12('0x19b')](0xb,_0xc86776,_0x2bf6c6)){if(_0x4c835b['countabandonedretry']>=_0x2bf6c6['dialAbandonedMaxRetry']){_0x1ef4f7[_0x2a12('0xfb')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1b8'));}else{_0x1ef4f7[_0x2a12('0xf9')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1b8'));}}break;case'20':_0x2bf6c6[_0x2a12('0x6e')]+=0x1;_0x4c835b[_0x2a12('0xeb')]=0x14;_0x4c835b['statedesc']=_0x2a12('0x1b9');_0x4c835b[_0x2a12('0xf7')]+=0x1;_0x4c835b['countglobal']+=0x1;ami['emit'](_0x2a12('0x1ba'),ut[_0x2a12('0xf0')](_0xc86776,_0x2a12('0x1bb')));_0x1ef4f7['createHistory'](_0x4c835b)['catch'](loggerCatch(_0x2a12('0x1bc')));if(_0x1ef4f7[_0x2a12('0x19b')](0x14,_0xc86776,_0x2bf6c6)){if(_0x4c835b['countagentrejectretry']>=_0x2bf6c6[_0x2a12('0x1bd')]){_0x1ef4f7[_0x2a12('0xfb')](_0x4c835b,_0x41145c,_0x109440,'reason\x2020\x20agentreject');}else{_0x1ef4f7[_0x2a12('0xf9')](_0x4c835b,_0x41145c,_0x109440,_0x2a12('0x1be'));}}break;default:_0x2bf6c6[_0x2a12('0x6f')]+=0x1;_0x4c835b[_0x2a12('0xeb')]=0xc;_0x4c835b[_0x2a12('0xec')]=_0x27f1e8[_0x2a12('0x10f')];_0x1ef4f7[_0x2a12('0xd8')](_0x4c835b)[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x1bf')));if(_0x1ef4f7['checkRetriveMax'](_0x27f1e8['reason'],_0xc86776,_0x2bf6c6)){if(_0x4c835b['countbusyretry']+_0x4c835b[_0x2a12('0x102')]+_0x4c835b[_0x2a12('0xf3')]+_0x4c835b[_0x2a12('0xf4')]+_0x4c835b[_0x2a12('0xf5')]+_0x4c835b['countabandonedretry']+_0x4c835b[_0x2a12('0xee')]+_0x4c835b[_0x2a12('0xf7')]>=_0x2bf6c6[_0x2a12('0xf8')]){_0x1ef4f7[_0x2a12('0xf9')](_0x4c835b,_0x41145c,_0x109440,_0x27f1e8['reason']);}else{_0x1ef4f7['createStateFinal'](_0x4c835b,_0x41145c,_0x109440,_0x27f1e8[_0x2a12('0x10f')]);}}}});};Dialer[_0x2a12('0xaf')][_0x2a12('0xf9')]=function(_0xe0a427,_0x5a9ef8,_0x4f991c,_0x3dedae){var _0xa58aa4=new Final(_0xe0a427);_0xa58aa4[_0x2a12('0xeb')]=0xf;_0xa58aa4[_0x2a12('0xec')]=_0x2a12('0x1c0');this[_0x2a12('0xfb')](_0xa58aa4,_0x5a9ef8,_0x4f991c,_0x3dedae);};Dialer[_0x2a12('0xaf')][_0x2a12('0xfb')]=function(_0x27eaa7,_0xfea3c3,_0x45ddcc,_0x50b0a8){this[_0x2a12('0xd9')](_0x27eaa7)['then'](function(){return _0xfea3c3(msgResponse('[callProgressDetecting]',_0x2a12('0x1c1'),_0x50b0a8));})[_0x2a12('0xb0')](function(){return _0x45ddcc(msgResponse(_0x2a12('0x1c2'),'Failure',_0x2a12('0x1c3')));});};Dialer['prototype'][_0x2a12('0x15e')]=function(_0x4e9fac){var _0x5e35f9=_0x4e9fac['dialPredictiveOptimizationPercentage']/0x64;var _0x2c56eb=_0x4e9fac[_0x2a12('0x6b')]/(_0x4e9fac['outboundDropCallsDayTimeout']+_0x4e9fac[_0x2a12('0x65')]);var _0x471ce2=Math[_0x2a12('0x1c4')](_0x4e9fac[_0x2a12('0x77')]*(_0x4e9fac['predictiveIntervalMaxThreshold']/0x64));var _0xcda375=Math[_0x2a12('0x1c4')](_0x4e9fac[_0x2a12('0x77')]*(_0x4e9fac[_0x2a12('0x1c5')]/0x64));var _0x3e5e79=_0x4e9fac[_0x2a12('0x1c6')]+_0x4e9fac['talking'];var _0x55e2ca=Math[_0x2a12('0x1c7')](_0x4e9fac[_0x2a12('0x79')]*_0x4e9fac[_0x2a12('0x1c8')]*_0x4e9fac[_0x2a12('0x1c9')]*_0x4e9fac[_0x2a12('0x76')]);if(_['isUndefined'](_0x4e9fac[_0x2a12('0x2b')])){if(!_[_0x2a12('0x44')](_0x4e9fac[_0x2a12('0x2a')])){_0x4e9fac[_0x2a12('0x2a')]=undefined;loggerPredictive[_0x2a12('0x99')](_0x2a12('0x1ca'),_0x2a12('0x1cb'));}if(!_[_0x2a12('0x44')](_0x4e9fac[_0x2a12('0x94')])){loggerPredictive[_0x2a12('0x99')](_0x2a12('0x1ca'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4e9fac[_0x2a12('0x94')]);_0x4e9fac[_0x2a12('0x94')]=undefined;}_0x4e9fac[_0x2a12('0x2b')]=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));loggerPredictive[_0x2a12('0x83')](_0x4e9fac['name'],'collection\x20data\x20in\x20progressive\x20at',_0x4e9fac[_0x2a12('0x2b')]);this['handlePower'](_0x4e9fac,0x1);}else if(ifInterval(_0x4e9fac[_0x2a12('0x1cc')],_0x4e9fac['startProgressive'])){this[_0x2a12('0x15c')](_0x4e9fac,0x1);loggerPredictiveCalls[_0x2a12('0x83')](_0x2a12('0x1cd'),_0x4e9fac[_0x2a12('0x2b')],_0x4e9fac[_0x2a12('0x4a')]);_0x4e9fac['erlangCalls']=0x0;_0x4e9fac['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x5e35f9<_0x2c56eb&&_0x4e9fac['dialPredictiveOptimization']===_0x2a12('0x1ce')){freeVariablesPredictive(_0x4e9fac);loggerPredictive['info'](_0x2a12('0x1cf'),_0x2a12('0x1d0'),_0x2c56eb,_0x2a12('0x2b'),_0x4e9fac['name']);}else if(_0x55e2ca<_0x4e9fac[_0x2a12('0x75')]&&_0x4e9fac[_0x2a12('0x1d1')]===_0x2a12('0x1ce')){freeVariablesPredictive(_0x4e9fac);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x1d2'),_0x2a12('0x1d3'),_0x55e2ca,_0x2a12('0x1d4'),_0x4e9fac['predictiveIntervalErlangCallsDroppedCalls'],_0x2a12('0x2b'),_0x4e9fac[_0x2a12('0x4a')]);}else if(!ifInterval(_0x4e9fac['dialPredictiveInterval'],_0x4e9fac[_0x2a12('0x2b')])&&_['isUndefined'](_0x4e9fac[_0x2a12('0x2a')])&&!_[_0x2a12('0x44')](_0x4e9fac[_0x2a12('0x2b')])){_0x4e9fac['startPredictive']=moment()[_0x2a12('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2a12('0x83')](_0x4e9fac['name'],'started\x20in\x20predictive\x20at',_0x4e9fac[_0x2a12('0x2a')]);this[_0x2a12('0xbc')](_0x4e9fac[_0x2a12('0x1cc')])[_0x2a12('0xb8')](this['getDataPredictive'](_0x4e9fac))[_0x2a12('0xb8')](mergeDataErlangB(_0x4e9fac))[_0x2a12('0xb8')](this['startMethodPredictive'](_0x4e9fac))[_0x2a12('0xb0')](loggerCatchPredictive(_0x2a12('0x1d5'),_0x4e9fac));}else if(!ifInterval(_0x4e9fac[_0x2a12('0x1cc')],_0x4e9fac[_0x2a12('0x2a')])){_0x4e9fac['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4e9fac[_0x2a12('0x2a')]=moment()[_0x2a12('0x80')](_0x2a12('0xfe'));loggerPredictive[_0x2a12('0x83')](_0x4e9fac['name'],_0x2a12('0x1d6'),_0x4e9fac[_0x2a12('0x2a')]);clearInterval(_0x4e9fac['handlePredictive']);_0x4e9fac[_0x2a12('0x94')]=undefined;this['averageHandleTime'](_0x4e9fac[_0x2a12('0x1cc')])[_0x2a12('0xb8')](this['getDataPredictive'](_0x4e9fac))[_0x2a12('0xb8')](mergeDataErlangB(_0x4e9fac))[_0x2a12('0xb8')](this[_0x2a12('0x1d7')](_0x4e9fac))[_0x2a12('0xb0')](loggerCatchPredictive(_0x2a12('0x1d8'),_0x4e9fac));}else if(_0x4e9fac['predictiveIntervalAvailable']&&_0x3e5e79<_0x4e9fac[_0x2a12('0x77')]-_0xcda375){freeVariablesPredictive(_0x4e9fac);loggerPredictive[_0x2a12('0x83')](_0x4e9fac[_0x2a12('0x4a')],_0x2a12('0x1d9'),_0x3e5e79,_0x2a12('0x1da'),_0x4e9fac[_0x2a12('0x77')],'-',_0xcda375,'=',_0x4e9fac['predictiveIntervalAvailable']-_0xcda375,')');}else if(_0x4e9fac['predictiveIntervalAvailable']&&_0x3e5e79>_0x4e9fac[_0x2a12('0x77')]+_0x471ce2){freeVariablesPredictive(_0x4e9fac);loggerPredictive['info'](_0x4e9fac['name'],_0x2a12('0x1d9'),_0x3e5e79,_0x2a12('0x1db'),_0x4e9fac[_0x2a12('0x77')],'+',_0x471ce2,'=',_0x4e9fac[_0x2a12('0x77')]+_0x471ce2,')');}};Dialer[_0x2a12('0xaf')]['getDataPredictive']=function(_0x558b7b){var _0x4766d2=this;return function(_0x905c55){return new BPromise(function(_0x1ea29c,_0x2ed3ab){_[_0x2a12('0x93')](_0x558b7b,_0x905c55[0x0]);if(checkGetDataPredictive(_0x905c55[0x0])){var _0x5fff6e=_0x558b7b[_0x2a12('0x77')]=_0x558b7b[_0x2a12('0xa5')]+_0x558b7b[_0x2a12('0x1c6')];var _0x50bf4b=_0x558b7b[_0x2a12('0x1cc')]*0x3c;var _0x495206=_0x905c55[0x0][_0x2a12('0x88')]+_0x905c55[0x0][_0x2a12('0x71')];var _0x3acd52=(_0x905c55[0x0]['predictiveIntervalAnsweredCalls']+_0x905c55[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x905c55[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x905c55[0x0][_0x2a12('0x8a')];_0x558b7b[_0x2a12('0x1c9')]=_0x3acd52>0x0?_0x3acd52:0x1;switch(_0x558b7b[_0x2a12('0x1d1')]){case'dropRate':var _0x3d35ce=_0x558b7b[_0x2a12('0x1dc')]/0x64;return _0x4766d2[_0x2a12('0x1dd')](_0x5fff6e,_0x50bf4b,_0x495206,_0x3acd52,_0x3d35ce)[_0x2a12('0xb8')](function(_0x590c0d){return _0x1ea29c(_0x590c0d);});case _0x2a12('0x1de'):var _0x182bda=_0x558b7b[_0x2a12('0x1dc')]/0x64;return _0x4766d2['busyFactor'](_0x5fff6e,_0x50bf4b,_0x495206,_0x3acd52,_0x182bda)[_0x2a12('0xb8')](function(_0x5ef8e0){return _0x1ea29c(_0x5ef8e0);});default:return _0x2ed3ab(msgResponse('[getDataPredictive]',_0x2a12('0x145'),'Unknown\x20Predictive'));}}else{return _0x2ed3ab(msgResponse('[getDataPredictive]',_0x2a12('0x145'),_0x2a12('0x1df')));}});};};Dialer[_0x2a12('0xaf')][_0x2a12('0x1e0')]=function(_0x300c81){var _0x96040e=this;return function(_0x344bec){return new BPromise(function(_0x2f0dec,_0x35afd7){_[_0x2a12('0x93')](_0x300c81,_0x344bec[0x0]);if(checkGetDataPredictive(_0x344bec[0x0])){loggerPredictive[_0x2a12('0x83')](JSON[_0x2a12('0x4e')](_0x344bec[0x0]));if(_0x300c81[_0x2a12('0x1d1')]==='dropRate'){return _0x96040e[_0x2a12('0xc5')](_0x300c81['id'])[_0x2a12('0xb8')](function(_0x2ca73b){var _0x365ec6=_0x300c81['loggedIn']-_0x2ca73b[0x0][_0x2a12('0x1e1')];var _0x1fc5f2=_0x300c81[_0x2a12('0x1cc')]*0x3c;var _0xf1c841=_0x344bec[0x0][_0x2a12('0x88')]+_0x344bec[0x0][_0x2a12('0x71')];var _0x382d81=(_0x344bec[0x0]['predictiveIntervalAnsweredCalls']+_0x344bec[0x0][_0x2a12('0x73')]+_0x344bec[0x0][_0x2a12('0x72')])/_0x344bec[0x0][_0x2a12('0x8a')];var _0x351926=_0x300c81[_0x2a12('0x1dc')]/0x64;_0x300c81[_0x2a12('0x1e2')]=_0x2ca73b[0x0][_0x2a12('0x1e1')]||0x0;_0x300c81[_0x2a12('0x1c9')]=_0x382d81>0x0?_0x382d81:0x1;return _0x96040e[_0x2a12('0x1dd')](_0x365ec6,_0x1fc5f2,_0xf1c841,_0x382d81,_0x351926);})[_0x2a12('0xb8')](function(_0x396f1a){return _0x2f0dec(_0x396f1a);})[_0x2a12('0xb0')](function(_0x36c305){return _0x35afd7(msgResponse(_0x2a12('0x1e3'),_0x2a12('0x145'),JSON['stringify'](_0x36c305)));});}if(_0x300c81[_0x2a12('0x1d1')]===_0x2a12('0x1de')){return _0x96040e['getVoiceQueueRtPauses'](_0x300c81['id'])[_0x2a12('0xb8')](function(_0x922072){var _0x3a3399=_0x300c81['loggedIn']-_0x922072[0x0][_0x2a12('0x1e1')];var _0x48ac35=_0x300c81['dialPredictiveInterval']*0x3c;var _0x282445=_0x344bec[0x0][_0x2a12('0x88')]+_0x344bec[0x0]['predictiveIntervalAvgHoldtime'];var _0x2411a1=(_0x344bec[0x0][_0x2a12('0x70')]+_0x344bec[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x344bec[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x344bec[0x0]['predictiveIntervalTotalCalls'];var _0x3c42f4=_0x300c81[_0x2a12('0x1dc')]/0x64;_0x300c81[_0x2a12('0x1e2')]=_0x922072[0x0]['outboundQueuePauses']||0x0;_0x300c81[_0x2a12('0x1c9')]=_0x2411a1>0x0?_0x2411a1:0x1;return _0x96040e[_0x2a12('0x1e4')](_0x3a3399,_0x48ac35,_0x282445,_0x2411a1,_0x3c42f4);})[_0x2a12('0xb8')](function(_0x313bfe){return _0x2f0dec(_0x313bfe);})[_0x2a12('0xb0')](function(_0x52cc60){return _0x35afd7(msgResponse(_0x2a12('0x1e3'),'Failure',JSON[_0x2a12('0x4e')](_0x52cc60)));});}}else{return _0x35afd7(msgResponse('[getDataPredictive]',_0x2a12('0x145'),_0x2a12('0x1df')));}});};};Dialer[_0x2a12('0xaf')][_0x2a12('0x1d7')]=function(_0x1a7076){var _0x57d4be=this;return function(){var _0x4a6a3d=0x0;var _0xf2718c=Math[_0x2a12('0x1c7')](_0x1a7076['erlangCallToSecond']*0x3e8);if(_0xf2718c>0x0){_0xf2718c=_0xf2718c<0x64?0x64:_0xf2718c;loggerPredictive['info'](_0x1a7076[_0x2a12('0x4a')],'one\x20call\x20every:',_0xf2718c,_0x2a12('0x4f'));_0x1a7076['handlePredictive']=setInterval(function(){_0x57d4be[_0x2a12('0x94')](_0x1a7076);loggerPredictiveCalls['info'](_0x2a12('0x1e5'),_0x4a6a3d+=0x1);},_0xf2718c);}else{loggerPredictive[_0x2a12('0x83')](_0x1a7076[_0x2a12('0x4a')],_0x2a12('0x1e6'));}};};Dialer[_0x2a12('0xaf')][_0x2a12('0x1e7')]=function(_0x3bb72c,_0x37deb4){var _0x4d8bb0=this;return function(_0x5541ec){if(_[_0x2a12('0x4c')](_0x5541ec)){if(_[_0x2a12('0xdc')](_0x37deb4[_0x2a12('0xce')])||!_0x37deb4[_0x2a12('0x1e8')]){if(_0x3bb72c[_0x2a12('0x60')]==='booked'){_0x3bb72c['queueStatusComplete']=_[_0x2a12('0x44')](_0x3bb72c['queueStatusComplete'])?!![]:_0x3bb72c[_0x2a12('0x12e')];var _0x150556=uuid['v4']();_0x4d8bb0[_0x2a12('0x27')][_0x150556]=new Action(_0x3bb72c,_0x37deb4,_0x150556);loggerBooked[_0x2a12('0x83')](_0x2a12('0x1e9'),_0x150556,_0x2a12('0x1ea'),JSON[_0x2a12('0x4e')](_0x3bb72c[_0x2a12('0x12e')]),_0x2a12('0x1eb'),_0x3bb72c[_0x2a12('0x4a')]);if(_0x3bb72c[_0x2a12('0x12e')]){_0x3bb72c['queueStatusComplete']=![];_0x4d8bb0[_0x2a12('0x2d')][_0x4d8bb0[_0x2a12('0x27')][_0x150556][_0x2a12('0xb3')]]=[];ami['Action']({'actionid':_0x150556,'action':'queuestatus','queue':_0x3bb72c['name']})[_0x2a12('0xb0')](function(){_0x4d8bb0[_0x2a12('0xb2')](_0x3bb72c);_0x4d8bb0[_0x2a12('0xbe')]({'active':![],'ContactId':_0x4d8bb0[_0x2a12('0x27')][_0x150556][_0x2a12('0xcc')],'ListId':_0x4d8bb0['actions'][_0x150556][_0x2a12('0xcd')],'VoiceQueueId':_0x4d8bb0[_0x2a12('0x27')][_0x150556]['VoiceQueueId']||undefined,'CampaignId':_0x4d8bb0['actions'][_0x150556]['CampaignId']||undefined})[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x1ec')));delete _0x4d8bb0[_0x2a12('0x27')][_0x150556];});}else{loggerBooked[_0x2a12('0x83')](_0x2a12('0x1ed'),JSON[_0x2a12('0x4e')](_0x3bb72c[_0x2a12('0x12e')]),_0x2a12('0x1eb'),_0x3bb72c[_0x2a12('0x4a')]);_0x4d8bb0[_0x2a12('0xb2')](_0x3bb72c);_0x4d8bb0[_0x2a12('0xbe')]({'active':![],'ContactId':_0x4d8bb0[_0x2a12('0x27')][_0x150556][_0x2a12('0xcc')],'ListId':_0x4d8bb0[_0x2a12('0x27')][_0x150556][_0x2a12('0xcd')],'VoiceQueueId':_0x4d8bb0['actions'][_0x150556][_0x2a12('0xff')]||undefined,'CampaignId':_0x4d8bb0[_0x2a12('0x27')][_0x150556]['CampaignId']||undefined})[_0x2a12('0xb0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4d8bb0['actions'][_0x150556];}}else{return _0x4d8bb0[_0x2a12('0x1ee')](_0x3bb72c,_0x37deb4);}}else{if(getDiff(_0x37deb4[_0x2a12('0x1ef')])<_0x3bb72c[_0x2a12('0x1f0')]*0x3c){if(_0x37deb4[_0x2a12('0x1f1')]&&!_0x37deb4['Agent']['voicePause']){_0x4d8bb0[_0x2a12('0x96')][_0x2a12('0x12f')](_0x37deb4['id'])[_0x2a12('0x20')](function(){_0x4d8bb0['updateOriginated'](_0x3bb72c);});}else{_0x4d8bb0[_0x2a12('0x1f2')]({'active':![]},_0x37deb4['id'],0x1)['finally'](function(){_0x4d8bb0['updateOriginated'](_0x3bb72c);});}}else{_0x3bb72c[_0x2a12('0x1f3')]+=0x1;_0x4d8bb0[_0x2a12('0xb2')](_0x3bb72c);if(_0x3bb72c[_0x2a12('0x1f4')]){_0x4d8bb0[_0x2a12('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x37deb4[_0x2a12('0xcc')],'ListId':_0x37deb4['ListId'],'VoiceQueueId':_0x37deb4['VoiceQueueId']||undefined,'CampaignId':_0x37deb4['CampaignId']||undefined})['catch'](loggerCatch(_0x2a12('0x1f5')));_0x4d8bb0[_0x2a12('0xd8')](createObjHistory(_0x3bb72c,_0x37deb4,_0x2a12('0x1f6'),0x17,_0x2a12('0x1f7')))['catch'](loggerCatch(_0x2a12('0x1f8')));}else{_0x4d8bb0[_0x2a12('0xca')](createObjHistory(_0x3bb72c,_0x37deb4,_0x2a12('0x1f9'),0x16,'RecallFailedTimeout'),_0x2a12('0x1fa'),_0x2a12('0x1fb'));}}}}else{_0x3bb72c[_0x2a12('0x66')]+=0x1;_0x4d8bb0[_0x2a12('0xca')](createObjHistory(_0x3bb72c,_0x37deb4,'BLACKLIST',0xd,_0x2a12('0x1fc')),_0x2a12('0x1fd'),_0x2a12('0x1fe'));throw _0x2a12('0x1ff');}};};Dialer[_0x2a12('0xaf')]['handleIvr']=function(_0x532882){var _0x111448=this;var _0x5e2cf8=_0x532882[_0x2a12('0x200')]-_0x532882[_0x2a12('0x78')]-_0x532882[_0x2a12('0xc1')];emitCampaignSummary(_0x532882);if(_0x5e2cf8>0x0){if(_0x5e2cf8>this[_0x2a12('0x26')]){_0x5e2cf8=this[_0x2a12('0x26')];}_0x532882['temp']+=_0x5e2cf8;this['getContactDialerIvr'](_0x532882['id'],_0x5e2cf8,_0x532882[_0x2a12('0x201')],_0x532882)[_0x2a12('0xb8')](function(_0x2bca9c){_0x532882[_0x2a12('0xc1')]-=_0x5e2cf8;_0x532882[_0x2a12('0xc1')]=_0x532882[_0x2a12('0xc1')]>0x0?_0x532882[_0x2a12('0xc1')]:0x0;if(!checkContactEmpty(_0x2bca9c)){_0x532882[_0x2a12('0x45')]=_0x2a12('0xa2');logger[_0x2a12('0x83')](_0x2a12('0x202')+_0x532882[_0x2a12('0x4a')]);}else{_0x532882['originated']+=_0x2bca9c[_0x2a12('0x9c')];_0x532882[_0x2a12('0x45')]='RUNNING';for(var _0x38b085=0x0;_0x38b085<_0x2bca9c['length'];_0x38b085+=0x1){_0x532882[_0x2a12('0x203')]+=0x1;if(_[_0x2a12('0xdc')](_0x2bca9c[_0x38b085])||_[_0x2a12('0xdc')](_0x2bca9c[_0x38b085][_0x2a12('0x16e')])||_[_0x2a12('0xdc')](_0x2bca9c[_0x38b085]['Contact'][_0x2a12('0x16d')])){_0x111448[_0x2a12('0xc8')](_0x2a12('0x204'),_0x532882,_0x2bca9c[_0x38b085]);}else{_0x111448[_0x2a12('0xba')](_[_0x2a12('0xcb')](_0x2bca9c[_0x38b085],[_0x2a12('0xcf'),_0x2a12('0x205')]))[_0x2a12('0xb8')](_0x111448[_0x2a12('0x1e7')](_0x532882,_0x2bca9c[_0x38b085]))['catch'](_0x111448['loggerHandler'](_0x2a12('0x206'),_0x532882));}}}})[_0x2a12('0xb0')](loggerGetContactDialer(_0x2a12('0x207'),_0x532882,_0x5e2cf8));}};Dialer[_0x2a12('0xaf')][_0x2a12('0x15c')]=function(_0x180fb0,_0x196100){var _0x4cb301=this;var _0x219400=[];var _0x4bd98f=_0x196100>=0x1?_0x196100:0x1;if(_0x180fb0['dialMethod']==='booked'){_0x4bd98f=0x1;}var _0x3bf445=Math['floor'](_0x180fb0['available']*_0x4bd98f)-_0x180fb0[_0x2a12('0x78')]-_0x180fb0[_0x2a12('0xc1')];emitVoiceQueueSummary(_0x180fb0);if(_0x180fb0[_0x2a12('0x208')]>0x0){var _0x7c01ce=_0x180fb0['dialLimitQueue']-_0x180fb0[_0x2a12('0x78')]-_0x180fb0[_0x2a12('0xa5')]-_0x180fb0['temp']-_0x180fb0[_0x2a12('0x56')];if(_0x3bf445>_0x7c01ce){_0x3bf445=_0x7c01ce;}}if(_0x3bf445>0x0){if(_0x180fb0['dialMethod']==='booked'){_0x3bf445=0x1;}if(_0x3bf445>this['maxNumberOriginate']){_0x3bf445=this[_0x2a12('0x26')];}_0x180fb0[_0x2a12('0xc1')]+=_0x3bf445;for(var _0x1e2e6a in this[_0x2a12('0x24')]){if(typeof this[_0x2a12('0x24')][_0x1e2e6a]!==_0x2a12('0x9d')){if(this[_0x2a12('0x24')][_0x1e2e6a][_0x2a12('0xeb')]===_0x2a12('0x209')&&this[_0x2a12('0x24')][_0x1e2e6a][_0x2a12('0xd6')]===_0x2a12('0xd7')){_0x219400['push'](this[_0x2a12('0x24')][_0x1e2e6a]['id']);}}}this['getContactDialer'](_0x180fb0['id'],_0x219400,_0x3bf445,_0x180fb0['dialOrderByScheduledAt'],_0x180fb0)[_0x2a12('0xb8')](function(_0x29bf42){_0x180fb0['temp']-=_0x3bf445;_0x180fb0[_0x2a12('0xc1')]=_0x180fb0['temp']>0x0?_0x180fb0['temp']:0x0;if(!checkContactEmpty(_0x29bf42)){_0x4cb301[_0x2a12('0xb6')](_0x180fb0)[_0x2a12('0xb8')](sendMessageReschedule(_0x180fb0))[_0x2a12('0xb0')](loggerCatch(_0x2a12('0x20a')));}else{_0x180fb0[_0x2a12('0x78')]+=_0x29bf42['length'];_0x180fb0['message']=_0x180fb0['dialMethod']===_0x2a12('0xb')?_0x2a12('0x175'):_0x2a12('0x20b');for(var _0x5bc6d1=0x0;_0x5bc6d1<_0x29bf42[_0x2a12('0x9c')];_0x5bc6d1+=0x1){if(_[_0x2a12('0xdc')](_0x29bf42[_0x5bc6d1])||_[_0x2a12('0xdc')](_0x29bf42[_0x5bc6d1]['Contact'])||_[_0x2a12('0xdc')](_0x29bf42[_0x5bc6d1]['Contact']['phone'])){_0x4cb301['emptyContact'](_0x2a12('0x204'),_0x180fb0,_0x29bf42[_0x5bc6d1]);}else{_0x4cb301[_0x2a12('0xb9')](_[_0x2a12('0xcb')](_0x29bf42[_0x5bc6d1],[_0x2a12('0xff'),_0x2a12('0x205')]))['then'](_0x4cb301[_0x2a12('0x1e7')](_0x180fb0,_0x29bf42[_0x5bc6d1]))[_0x2a12('0xb0')](_0x4cb301[_0x2a12('0xc7')](_0x2a12('0x204'),_0x180fb0));}}}})[_0x2a12('0xb0')](loggerGetContactDialer('[getContactDialer2]',_0x180fb0,_0x3bf445));}};Dialer[_0x2a12('0xaf')]['handlePredictive']=function(_0x4d2ae6){if(_0x4d2ae6[_0x2a12('0x208')]>0x0){var _0x3f9cdd=_0x4d2ae6['dialLimitQueue']-_0x4d2ae6['originated']-_0x4d2ae6[_0x2a12('0xa5')];if(_0x3f9cdd>0x0){this[_0x2a12('0x20c')](_0x4d2ae6);}else{loggerPredictiveCalls[_0x2a12('0x83')](_0x2a12('0x20d'));}}else{this[_0x2a12('0x20c')](_0x4d2ae6);}};Dialer[_0x2a12('0xaf')][_0x2a12('0x20c')]=function(_0x1228a6){var _0x38bd89=this;var _0x12fa5f=[];_0x1228a6[_0x2a12('0x78')]+=0x1;for(var _0x3da636 in this[_0x2a12('0x24')]){if(typeof this[_0x2a12('0x24')][_0x3da636]!==_0x2a12('0x9d')){if(this[_0x2a12('0x24')][_0x3da636][_0x2a12('0xeb')]===_0x2a12('0x209')&&this[_0x2a12('0x24')][_0x3da636][_0x2a12('0xd6')]===_0x2a12('0xd7')){_0x12fa5f['push'](this[_0x2a12('0x24')][_0x3da636]['id']);}}}this[_0x2a12('0xc0')](_0x1228a6['id'],_0x12fa5f,0x1,_0x1228a6['dialOrderByScheduledAt'],_0x1228a6)[_0x2a12('0xb8')](function(_0x23bdc5){if(!checkContactEmpty(_0x23bdc5)){checkContactLowerLimitOriginate(_0x1228a6,0x1,0x0);_0x38bd89[_0x2a12('0xb6')](_0x1228a6)[_0x2a12('0xb8')](sendMessageReschedule(_0x1228a6))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x1228a6[_0x2a12('0x45')]=_0x2a12('0x20b');if(_[_0x2a12('0xdc')](_0x23bdc5[0x0])||_[_0x2a12('0xdc')](_0x23bdc5[0x0][_0x2a12('0x16e')])||_['isNil'](_0x23bdc5[0x0][_0x2a12('0x16e')]['phone'])){_0x38bd89[_0x2a12('0xc8')](_0x2a12('0x204'),_0x1228a6,_0x23bdc5[0x0]);}else{_0x38bd89['checkIsBlackList'](_['pick'](_0x23bdc5[0x0],['VoiceQueueId',_0x2a12('0x205')]))['then'](_0x38bd89[_0x2a12('0x1e7')](_0x1228a6,_0x23bdc5[0x0]))[_0x2a12('0xb0')](_0x38bd89[_0x2a12('0xc7')](_0x2a12('0x20e'),_0x1228a6));}}})[_0x2a12('0xb0')](loggerGetContactDialer(_0x2a12('0x20f'),_0x1228a6,0x1));emitVoiceQueueSummary(_0x1228a6);};Dialer['prototype'][_0x2a12('0x1dd')]=function(_0x985d57,_0x5d1bde,_0x45bf50,_0x42b8f3,_0x4afbaa,_0x5c79fb){loggerPredictive[_0x2a12('0x83')](_0x2a12('0x210'));loggerPredictive[_0x2a12('0x83')](_0x2a12('0x211'),_0x985d57);loggerPredictive[_0x2a12('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d1bde);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x212'),_0x45bf50);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x213'),_0x42b8f3);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4afbaa);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x89'));return new BPromise(function(_0x4b9a2d,_0xec4af8){if(_0x985d57<=0x0||isNaN(_0x985d57)){return _0xec4af8(msgResponse(_0x2a12('0x214'),'Error',_0x2a12('0x215')+_0x985d57));}if(_0x45bf50<=0x0||isNaN(_0x45bf50)){return _0xec4af8(msgResponse('[abandonmentRate]','Error',_0x2a12('0x216')+_0x45bf50));}if(_0x42b8f3<=0x0||isNaN(_0x42b8f3)){return _0xec4af8(msgResponse(_0x2a12('0x214'),_0x2a12('0x195'),'p\x20=\x20'+_0x42b8f3));}if(_0x5d1bde<=0x0||isNaN(_0x5d1bde)){return _0xec4af8(msgResponse(_0x2a12('0x214'),_0x2a12('0x195'),_0x2a12('0x217')+_0x5d1bde));}if(_0x4afbaa<=0x0||isNaN(_0x4afbaa)){return _0xec4af8(msgResponse('[abandonmentRate]','Error',_0x2a12('0x218')+_0x4afbaa));}_0x5c79fb=_0x5c79fb||0x0;var _0x19a11f=0x1/_0x45bf50;var _0x2b6efc=0x0;var _0x549426=0x0;var _0x36bcf5=0x0;var _0x54df1f=0x0;for(var _0x41384c=0x0;_0x36bcf5<_0x4afbaa;_0x41384c+=0x1){_0x549426=_0x41384c/_0x5d1bde;_0x2b6efc=(_0x42b8f3*_0x549426+_0x5c79fb)/_0x19a11f;_0x36bcf5=erlangb(_0x2b6efc,_0x985d57);_0x54df1f=_0x2b6efc/_0x985d57*(0x1-erlangb(_0x2b6efc,_0x985d57));}return _0x4b9a2d({'erlangCalls':_0x41384c,'erlangCallToSecond':_0x5d1bde/_0x41384c,'erlangAbandonmentRate':_0x36bcf5,'erlangBusyFactor':_0x54df1f});});};Dialer[_0x2a12('0xaf')][_0x2a12('0x1e4')]=function(_0x1944fa,_0xdac4f,_0x600033,_0x3262ab,_0x4763f0,_0x1c11a7){loggerPredictive['info'](_0x2a12('0x219'));loggerPredictive[_0x2a12('0x83')](_0x2a12('0x211'),_0x1944fa);loggerPredictive['info'](_0x2a12('0x21a'),_0xdac4f);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x212'),_0x600033);loggerPredictive['info'](_0x2a12('0x213'),_0x3262ab);loggerPredictive[_0x2a12('0x83')](_0x2a12('0x21b'),_0x4763f0);loggerPredictive[_0x2a12('0x83')]('---------------------------');return new BPromise(function(_0x49ba47,_0x244b25){if(_0x1944fa<=0x0||isNaN(_0x1944fa)){return _0x244b25(msgResponse(_0x2a12('0x21c'),'Error',_0x2a12('0x215')+_0x1944fa));}if(_0x600033<=0x0||isNaN(_0x600033)){return _0x244b25(msgResponse(_0x2a12('0x21c'),_0x2a12('0x195'),'Ts\x20=\x20'+_0x600033));}if(_0x3262ab<=0x0||isNaN(_0x3262ab)){return _0x244b25(msgResponse(_0x2a12('0x21c'),'Error',_0x2a12('0x21d')+_0x3262ab));}if(_0xdac4f<=0x0||isNaN(_0xdac4f)){return _0x244b25(msgResponse('[busyFactor]',_0x2a12('0x195'),'interval\x20=\x20'+_0xdac4f));}if(_0x4763f0<=0x0||isNaN(_0x4763f0)){return _0x244b25(msgResponse(_0x2a12('0x21c'),_0x2a12('0x195'),_0x2a12('0x21e')+_0x4763f0));}_0x1c11a7=_0x1c11a7||0x0;var _0x471cb6=0x1/_0x600033;var _0x33d91d=0x0;var _0x27405a=0x0;var _0x54524b=0x0;var _0x406c06=0x0;for(var _0x176666=0x0;_0x406c06<_0x4763f0;_0x176666+=0x1){_0x27405a=_0x176666/_0xdac4f;_0x33d91d=(_0x3262ab*_0x27405a+_0x1c11a7)/_0x471cb6;_0x54524b=erlangb(_0x33d91d,_0x1944fa);_0x406c06=_0x33d91d/_0x1944fa*(0x1-erlangb(_0x33d91d,_0x1944fa));}return _0x49ba47({'erlangCalls':_0x176666,'erlangCallToSecond':_0xdac4f/_0x176666,'erlangAbandonmentRate':_0x54524b,'erlangBusyFactor':_0x406c06});});};module[_0x2a12('0x21f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index f2215d8..534512b 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 _0xc2ff=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x59e564,_0x5936f5){var _0x461a11=function(_0x498624){while(--_0x498624){_0x59e564['push'](_0x59e564['shift']());}};_0x461a11(++_0x5936f5);}(_0xc2ff,0x114));var _0xfc2f=function(_0x4e4630,_0x111d71){_0x4e4630=_0x4e4630-0x0;var _0x277a11=_0xc2ff[_0x4e4630];return _0x277a11;};'use strict';var util=require('util');var _=require(_0xfc2f('0x0'));var moment=require(_0xfc2f('0x1'));function getSeconds(_0xd5bb3f,_0x456944){var _0x469859=moment(_0xd5bb3f)[_0xfc2f('0x2')](0x0);var _0x5c62cb=moment(_0x456944)[_0xfc2f('0x2')](0x0);return _0x469859[_0xfc2f('0x3')](_0x5c62cb,_0xfc2f('0x4'));}function QueueCallerAbandon(_0x3e5286,_0x1c2241){this[_0xfc2f('0x5')]=_0x3e5286[_0xfc2f('0x5')];this['type']=_0x3e5286[_0xfc2f('0x6')];this[_0xfc2f('0x7')]=_0x3e5286[_0xfc2f('0x6')]==='outbound'?_0xfc2f('0x8'):_0x3e5286['type'];this[_0xfc2f('0x9')]=_0x3e5286[_0xfc2f('0x9')];this['countcongestionretry']=_0x3e5286[_0xfc2f('0xa')];this[_0xfc2f('0xb')]=_0x3e5286['countnoanswerretry'];this[_0xfc2f('0xc')]=_0x3e5286[_0xfc2f('0x9')]+_0x3e5286[_0xfc2f('0xa')]+_0x3e5286['countnoanswerretry']+_0x3e5286[_0xfc2f('0xd')]+_0x3e5286[_0xfc2f('0xe')]+_0x3e5286[_0xfc2f('0xf')]+_0x3e5286['countmachineretry']+_0x3e5286[_0xfc2f('0x10')];this[_0xfc2f('0xd')]=_0x3e5286[_0xfc2f('0xd')];this[_0xfc2f('0xe')]=_0x3e5286['countdropretry'];this['countabandonedretry']=_0x3e5286[_0xfc2f('0xf')];this[_0xfc2f('0x11')]=_0x3e5286['countmachineretry'];this[_0xfc2f('0x10')]=_0x3e5286[_0xfc2f('0x10')];this[_0xfc2f('0x12')]=_0x1c2241[_0xfc2f('0x12')];this['calleridname']=_0x3e5286[_0xfc2f('0x13')];this[_0xfc2f('0x14')]=_0x3e5286[_0xfc2f('0x15')];this['starttime']=_0x3e5286[_0xfc2f('0x16')];this[_0xfc2f('0x17')]=_0x3e5286[_0xfc2f('0x17')];this['droptime']=_0x3e5286[_0xfc2f('0x18')];this[_0xfc2f('0x19')]=this['droptime'];this[_0xfc2f('0x1a')]=getSeconds(_0x3e5286['responsetime'],_0x3e5286[_0xfc2f('0x16')]);this[_0xfc2f('0x1b')]=getSeconds(this[_0xfc2f('0x18')],_0x3e5286[_0xfc2f('0x17')]);this['talktime']=0x0;this[_0xfc2f('0x8')]=_0x1c2241['queue'];this[_0xfc2f('0x1c')]=_0x1c2241[_0xfc2f('0x1d')];this[_0xfc2f('0x1e')]=_0x1c2241[_0xfc2f('0x1e')];this['callback']=_0x3e5286[_0xfc2f('0x1f')];this[_0xfc2f('0x20')]=_0x3e5286[_0xfc2f('0x20')];this[_0xfc2f('0x21')]=_0x3e5286[_0xfc2f('0x21')];this[_0xfc2f('0x22')]=_0x3e5286[_0xfc2f('0x22')];this[_0xfc2f('0x23')]=_0x3e5286[_0xfc2f('0x23')];this[_0xfc2f('0x24')]=_0x3e5286['ListId'];this['UserId']=_0x3e5286['UserId'];this[_0xfc2f('0x25')]=_0x3e5286['VoiceQueueId'];this['CampaignId']=_0x3e5286[_0xfc2f('0x26')];this[_0xfc2f('0x27')]=_0x3e5286[_0xfc2f('0x27')]||'';this[_0xfc2f('0x28')]=_0x3e5286['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xabec=['milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment'];(function(_0x18d4a2,_0x342829){var _0x5baae5=function(_0x18339f){while(--_0x18339f){_0x18d4a2['push'](_0x18d4a2['shift']());}};_0x5baae5(++_0x342829);}(_0xabec,0xcf));var _0xcabe=function(_0xaf0b0f,_0x209e37){_0xaf0b0f=_0xaf0b0f-0x0;var _0x9ed5e9=_0xabec[_0xaf0b0f];return _0x9ed5e9;};'use strict';var util=require(_0xcabe('0x0'));var _=require(_0xcabe('0x1'));var moment=require(_0xcabe('0x2'));function getSeconds(_0x10278c,_0x2accf6){var _0x230127=moment(_0x10278c)[_0xcabe('0x3')](0x0);var _0x2dc23e=moment(_0x2accf6)[_0xcabe('0x3')](0x0);return _0x230127[_0xcabe('0x4')](_0x2dc23e,_0xcabe('0x5'));}function QueueCallerAbandon(_0x28d71a,_0x212061){this[_0xcabe('0x6')]=_0x28d71a[_0xcabe('0x6')];this['type']=_0x28d71a[_0xcabe('0x7')];this[_0xcabe('0x8')]=_0x28d71a[_0xcabe('0x7')]===_0xcabe('0x9')?_0xcabe('0xa'):_0x28d71a[_0xcabe('0x7')];this['countbusyretry']=_0x28d71a['countbusyretry'];this['countcongestionretry']=_0x28d71a[_0xcabe('0xb')];this[_0xcabe('0xc')]=_0x28d71a[_0xcabe('0xc')];this[_0xcabe('0xd')]=_0x28d71a[_0xcabe('0xe')]+_0x28d71a[_0xcabe('0xb')]+_0x28d71a[_0xcabe('0xc')]+_0x28d71a[_0xcabe('0xf')]+_0x28d71a[_0xcabe('0x10')]+_0x28d71a[_0xcabe('0x11')]+_0x28d71a[_0xcabe('0x12')]+_0x28d71a[_0xcabe('0x13')];this[_0xcabe('0xf')]=_0x28d71a['countnosuchnumberretry'];this[_0xcabe('0x10')]=_0x28d71a[_0xcabe('0x10')];this[_0xcabe('0x11')]=_0x28d71a[_0xcabe('0x11')];this['countmachineretry']=_0x28d71a[_0xcabe('0x12')];this[_0xcabe('0x13')]=_0x28d71a[_0xcabe('0x13')];this[_0xcabe('0x14')]=_0x212061['uniqueid'];this[_0xcabe('0x15')]=_0x28d71a[_0xcabe('0x16')];this[_0xcabe('0x17')]=_0x28d71a[_0xcabe('0x18')];this[_0xcabe('0x19')]=_0x28d71a[_0xcabe('0x19')];this[_0xcabe('0x1a')]=_0x28d71a[_0xcabe('0x1a')];this[_0xcabe('0x1b')]=_0x28d71a[_0xcabe('0x1b')];this[_0xcabe('0x1c')]=this['droptime'];this['ringtime']=getSeconds(_0x28d71a[_0xcabe('0x1a')],_0x28d71a[_0xcabe('0x19')]);this[_0xcabe('0x1d')]=getSeconds(this['droptime'],_0x28d71a['responsetime']);this['talktime']=0x0;this[_0xcabe('0xa')]=_0x212061[_0xcabe('0xa')];this['membername']=_0x212061['connectedlinename'];this[_0xcabe('0x1e')]=_0x212061[_0xcabe('0x1e')];this[_0xcabe('0x1f')]=_0x28d71a[_0xcabe('0x1f')];this[_0xcabe('0x20')]=_0x28d71a[_0xcabe('0x20')];this['callbackat']=_0x28d71a['callbackat'];this[_0xcabe('0x21')]=_0x28d71a[_0xcabe('0x21')];this[_0xcabe('0x22')]=_0x28d71a[_0xcabe('0x22')];this['ListId']=_0x28d71a[_0xcabe('0x23')];this[_0xcabe('0x24')]=_0x28d71a['UserId'];this[_0xcabe('0x25')]=_0x28d71a[_0xcabe('0x25')];this['CampaignId']=_0x28d71a[_0xcabe('0x26')];this[_0xcabe('0x27')]=_0x28d71a['originatecalleridnum']||'';this[_0xcabe('0x28')]=_0x28d71a[_0xcabe('0x28')]||'';}module[_0xcabe('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 85d32d8..4d430ef 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(_0x138dc8,_0x4adda3){var _0x4ee68e=function(_0x20eb68){while(--_0x20eb68){_0x138dc8['push'](_0x138dc8['shift']());}};_0x4ee68e(++_0x4adda3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x295553,_0x4a3628){var _0x5b6347=function(_0x18a711){while(--_0x18a711){_0x295553['push'](_0x295553['shift']());}};_0x5b6347(++_0x4a3628);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 97229e2..beb3f94 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 _0xe511=['checkTrunk','isValid','Trunk\x20Reachable','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','isNil','active','format','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0xe511,0x16f));var _0x1e51=function(_0x253946,_0x1c8d56){_0x253946=_0x253946-0x0;var _0x198cd6=_0xe511[_0x253946];return _0x198cd6;};'use strict';var util=require(_0x1e51('0x0'));var _=require(_0x1e51('0x1'));var BPromise=require('bluebird');var uuid=require(_0x1e51('0x2'));var moment=require('moment');var path=require(_0x1e51('0x3'));var tiff2pdf=require(_0x1e51('0x4'));var gs=require('./util/gs');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var ami=require(_0x1e51('0x7'));var rpcDb=require(_0x1e51('0x8'));var Channel=require('./channel');var ut=require(_0x1e51('0x9'));var Action=require(_0x1e51('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x1e51('0xb'));function Fax(_0x133021){this['channels']={};this['faxAccounts']=_0x133021[_0x1e51('0xc')];this[_0x1e51('0xd')]=_0x133021[_0x1e51('0xd')];this[_0x1e51('0xe')]={};ami['on'](_0x1e51('0xf'),this[_0x1e51('0x10')]['bind'](this));ami['on'](_0x1e51('0x11'),this[_0x1e51('0x12')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x14'),this[_0x1e51('0x15')][_0x1e51('0x13')](this));ami['on']('newexten',this[_0x1e51('0x16')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x17'),this[_0x1e51('0x18')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x19'),this[_0x1e51('0x1a')][_0x1e51('0x13')](this));ami['on'](_0x1e51('0x1b'),this[_0x1e51('0x1c')]['bind'](this));ami['on'](_0x1e51('0x1d'),this[_0x1e51('0x1e')][_0x1e51('0x13')](this));}Fax['prototype'][_0x1e51('0x10')]=function(_0x4f7aaf){if(_0x4f7aaf['context']===_0x1e51('0x1f')){for(var _0x27dcad in this[_0x1e51('0xc')]){if(this[_0x1e51('0xc')][_0x1e51('0x20')](_0x27dcad)){if(_0x4f7aaf[_0x1e51('0x21')]===this['faxAccounts'][_0x27dcad][_0x1e51('0x22')]){this['channels'][_0x4f7aaf[_0x1e51('0x23')]]={};this[_0x1e51('0x24')][_0x4f7aaf[_0x1e51('0x23')]][_0x1e51('0x25')]=_0x4f7aaf['channel'];this['channels'][_0x4f7aaf['uniqueid']]['id']=this['faxAccounts'][_0x27dcad]['id'];this[_0x1e51('0x24')][_0x4f7aaf['uniqueid']][_0x1e51('0x26')]=this[_0x1e51('0xc')][_0x27dcad][_0x1e51('0x26')];logger[_0x1e51('0x27')](_0x4f7aaf[_0x1e51('0x23')],_0x1e51('0x28'));}}}}if(this[_0x1e51('0xe')][_0x4f7aaf[_0x1e51('0x23')]]){this['channels'][_0x4f7aaf['uniqueid']]={};this[_0x1e51('0x24')][_0x4f7aaf[_0x1e51('0x23')]][_0x1e51('0x25')]=_0x4f7aaf[_0x1e51('0x25')];logger['info'](_0x4f7aaf['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x1e51('0x29')][_0x1e51('0x12')]=function(_0x433c2d){if(this['channels'][_0x433c2d[_0x1e51('0x23')]]){for(var _0x49c507 in _0x433c2d['variable']){if(_0x433c2d[_0x1e51('0x2a')]['hasOwnProperty'](_0x49c507)){this[_0x1e51('0x24')][_0x433c2d[_0x1e51('0x23')]][_0x49c507]=_0x433c2d['value'];}}}};Fax[_0x1e51('0x29')][_0x1e51('0x15')]=function(_0x71c7af){if(this[_0x1e51('0x24')][_0x71c7af['uniqueid']]){this['channels'][_0x71c7af['uniqueid']][_0x1e51('0x2b')]=_0x71c7af[_0x1e51('0x2b')];this[_0x1e51('0x24')][_0x71c7af[_0x1e51('0x23')]][_0x1e51('0x2c')]=_0x71c7af[_0x1e51('0x2c')];}};Fax[_0x1e51('0x29')][_0x1e51('0x16')]=function(_0x31b678){if(this[_0x1e51('0x24')][_0x31b678[_0x1e51('0x23')]]){for(var _0x54c84e in _0x31b678[_0x1e51('0x2a')]){if(_0x31b678[_0x1e51('0x2a')][_0x1e51('0x20')](_0x54c84e)){this[_0x1e51('0x24')][_0x31b678[_0x1e51('0x23')]][_0x54c84e]=_0x31b678['value'];}}}};Fax[_0x1e51('0x29')]['syncFaxStatus']=function(_0x2a7b70){if(this[_0x1e51('0x24')][_0x2a7b70[_0x1e51('0x23')]]){this['channels'][_0x2a7b70[_0x1e51('0x23')]]['operation']=_0x2a7b70[_0x1e51('0x2d')];this['channels'][_0x2a7b70['uniqueid']][_0x1e51('0x2e')]=_0x2a7b70[_0x1e51('0x2e')];this[_0x1e51('0x24')][_0x2a7b70['uniqueid']][_0x1e51('0x22')]=_0x2a7b70['localstationid'];this[_0x1e51('0x24')][_0x2a7b70[_0x1e51('0x23')]]['filename']=_0x2a7b70[_0x1e51('0x2f')];logger[_0x1e51('0x27')](_0x2a7b70[_0x1e51('0x23')],_0x1e51('0x30'));}};Fax[_0x1e51('0x29')][_0x1e51('0x1a')]=function(_0x5c57a6){var _0x509f7d=this;if(this[_0x1e51('0x24')][_0x5c57a6['uniqueid']]){var _0x3c6c35=this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]]['id'];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x31')]=_0x5c57a6[_0x1e51('0x31')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x32')]=_0x5c57a6[_0x1e51('0x32')];this['channels'][_0x5c57a6[_0x1e51('0x23')]]['localstationid']=_0x5c57a6[_0x1e51('0x22')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x33')]=_0x5c57a6[_0x1e51('0x33')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x34')]=_0x5c57a6[_0x1e51('0x34')];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]]['filename']=_0x5c57a6['filename'];this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x35')]=_0x5c57a6[_0x1e51('0x35')];if(this[_0x1e51('0x24')][_0x5c57a6[_0x1e51('0x23')]][_0x1e51('0x32')]>0x0){tiff2pdf(_0x5c57a6[_0x1e51('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x279fca){logger[_0x1e51('0x27')](_0x5c57a6[_0x1e51('0x23')],_0x1e51('0x36'),_0x279fca[_0x1e51('0x37')]);attachment[_0x1e51('0x38')]({'name':path[_0x1e51('0x39')](_0x5c57a6['filename'])[_0x1e51('0x26')],'basename':path[_0x1e51('0x39')](_0x5c57a6['filename'])[_0x1e51('0x26')]+_0x1e51('0x3a'),'type':_0x1e51('0x3b')})['then'](function(_0x2b0790){faxAccount[_0x1e51('0x3c')](_0x3c6c35,{'from':_0x5c57a6[_0x1e51('0x35')],'mapKey':_0x1e51('0x6'),'body':path[_0x1e51('0x39')](_0x5c57a6[_0x1e51('0x2f')])[_0x1e51('0x26')]+_0x1e51('0x3a'),'AttachmentId':_0x2b0790['id']})[_0x1e51('0x3d')](function(_0x551ca4){logger[_0x1e51('0x3e')](_0x5c57a6[_0x1e51('0x23')],'\x20notify\x20',JSON[_0x1e51('0x3f')](_0x551ca4));});})[_0x1e51('0x3d')](function(_0x139e9f){logger['error'](_0x5c57a6[_0x1e51('0x23')],_0x1e51('0x40'),JSON[_0x1e51('0x3f')](_0x139e9f));});});}logger['info'](_0x5c57a6[_0x1e51('0x23')],'\x20receiveFax\x20');}};Fax['prototype']['syncOriginateResponse']=function(_0x169e6c){if(this[_0x1e51('0xe')][_0x169e6c['uniqueid']]){_['merge'](this[_0x1e51('0x24')][_0x169e6c[_0x1e51('0x23')]],_[_0x1e51('0x41')](_0x169e6c,[_0x1e51('0x42'),_0x1e51('0x43')]));}};function updateStatus(_0x54ce36){if(_0x54ce36['AttachmentId']){faxMessage[_0x1e51('0x44')](_0x54ce36['AttachmentId'],{'failMessage':_0x1e51('0x45')})[_0x1e51('0x46')](function(_0x47f9c7){ut['logger']('[Fax][Message][Error][Updated]',_0x47f9c7);})[_0x1e51('0x3d')](function(_0x1cad52){ut[_0x1e51('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x1cad52);});}else{ut[_0x1e51('0x47')](_0x1e51('0x48'));}}Fax[_0x1e51('0x29')][_0x1e51('0x49')]=function(_0x1ccb55,_0x12584c,_0x32fe1f){var _0x2ca91f=this;var _0x5b64f6={};if(_0x12584c){_0x5b64f6={'read':_0x12584c};}else{_0x5b64f6={'failMessage':_0x32fe1f};}if(this[_0x1e51('0xe')][_0x1ccb55][_0x1e51('0x4a')]){faxMessage[_0x1e51('0x44')](this[_0x1e51('0xe')][_0x1ccb55][_0x1e51('0x4a')],_0x5b64f6)[_0x1e51('0x46')](function(_0x5ba6c2){ut[_0x1e51('0x47')]('[Fax][Message][Updated]',_0x5ba6c2);})['catch'](function(_0x4807b9){ut[_0x1e51('0x47')](_0x1e51('0x4b'),_0x4807b9);})[_0x1e51('0x4c')](function(){delete _0x2ca91f['channels'][_0x1ccb55];delete _0x2ca91f[_0x1e51('0xe')][_0x1ccb55];});}else{ut[_0x1e51('0x47')](_0x1e51('0x4d'));delete this['channels'][_0x1ccb55];delete this[_0x1e51('0xe')][_0x1ccb55];}};Fax[_0x1e51('0x29')][_0x1e51('0x1c')]=function(_0x570193){var _0x2d5e58=this;if(this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]){if(this[_0x1e51('0xe')][_0x570193[_0x1e51('0x23')]]){this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['id']=this[_0x1e51('0xe')][_0x570193['uniqueid']]['id'];this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['name']=this['actions'][_0x570193['uniqueid']][_0x1e51('0x26')];}logger[_0x1e51('0x27')](_0x570193[_0x1e51('0x23')],this[_0x1e51('0xe')][_0x570193[_0x1e51('0x23')]]?_0x1e51('0x4e'):_0x1e51('0x4f'),JSON[_0x1e51('0x3f')](this[_0x1e51('0x24')][_0x570193['uniqueid']]));if(this['actions'][_0x570193['uniqueid']]){if(this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['faxpages']>0x0&&this['channels'][_0x570193[_0x1e51('0x23')]][_0x1e51('0x17')]==='SUCCESS'){this[_0x1e51('0x49')](_0x570193[_0x1e51('0x23')],!![]);}else{this[_0x1e51('0x49')](_0x570193[_0x1e51('0x23')],![],this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]][_0x1e51('0x50')]?_0x1e51('0x51')+this[_0x1e51('0x24')][_0x570193[_0x1e51('0x23')]]['faxstatusstring']:_0x1e51('0x52'));}}}};Fax[_0x1e51('0x29')][_0x1e51('0x53')]=function(_0x402bbd){var _0xc720e2=this;return new BPromise(function(_0x224dbc,_0x47cc50){_0xc720e2['execOriginate'](_0x402bbd,_0xc720e2[_0x1e51('0xc')][_0x402bbd[_0x1e51('0x54')]])[_0x1e51('0x46')](function(_0x13fb81){ut['logger']('[Fax][execOriginate][success]',_0x13fb81);_0x224dbc(ut['message'](_0x1e51('0x55')));})[_0x1e51('0x3d')](function(_0x100126){ut[_0x1e51('0x47')](_0x1e51('0x56'),_0x100126);updateStatus(_0x402bbd);_0x47cc50(ut['message'](_0x1e51('0x57')));});});};Fax[_0x1e51('0x29')][_0x1e51('0x58')]=function(_0x556b74){var _0x2d0ff0=this;return new BPromise(function(_0x77f0c1,_0x45e607){var _0x5f19af=_0x2d0ff0[_0x1e51('0x59')](_0x2d0ff0[_0x1e51('0xc')][_0x556b74['FaxAccountId']]['Trunk'],_0x556b74);if(_0x5f19af[_0x1e51('0x5a')]){_0x77f0c1(ut['message'](_0x1e51('0x5b')));}else{_0x45e607(ut['message'](_0x5f19af[_0x1e51('0x37')]));}});};function originate(_0xe1cfa0,_0x35f12e,_0x457e4a){return new BPromise(function(_0x5142ed,_0x37f3e6){if(_0x457e4a){var _0x4c9871=util['format'](_0x1e51('0x5c'),path[_0x1e51('0x39')](_0xe1cfa0[_0x1e51('0x3')])['name'],_0xe1cfa0[_0x1e51('0x3')]);gs[_0x1e51('0x5d')](_0x4c9871)[_0x1e51('0x46')](function(){_0xe1cfa0[_0x1e51('0x3')]=util['format'](_0x1e51('0x5e'),path['parse'](_0xe1cfa0['path'])[_0x1e51('0x5f')],path['parse'](_0xe1cfa0[_0x1e51('0x3')])['name']);_0x35f12e[_0x1e51('0x60')]=_0xe1cfa0['path'];ut[_0x1e51('0x47')](_0x1e51('0x61'),'');ami['Action'](ut[_0x1e51('0x62')](_0xe1cfa0,_0x35f12e))['then'](function(_0x204962){_0x5142ed(_0x204962);})[_0x1e51('0x3d')](function(_0x1d2753){_0x37f3e6(_0x1d2753);});})[_0x1e51('0x3d')](function(_0x2cda1a){_0x37f3e6(_0x2cda1a);});}else{ami[_0x1e51('0x63')](ut['variablesAction'](_0xe1cfa0,_0x35f12e))[_0x1e51('0x46')](function(_0x5054b0){_0x5142ed(_0x5054b0);})['catch'](function(_0x23068f){_0x37f3e6(_0x23068f);});}});}Fax[_0x1e51('0x29')][_0x1e51('0x64')]=function(_0x7091fe,_0x38dda4){var _0x25d128=this;return new BPromise(function(_0x41b43b,_0x51ef46){var _0x39dc12=uuid['v4']();var _0x260f4a=ut[_0x1e51('0x65')](_0x7091fe,_0x38dda4);_0x25d128['actions'][_0x39dc12]=new Action(_0x39dc12,_0x38dda4,_0x7091fe);var _0x4da887=_0x25d128[_0x1e51('0xe')][_0x39dc12];if(path[_0x1e51('0x39')](_0x7091fe['path'])[_0x1e51('0x66')]===_0x1e51('0x3a')){originate(_0x4da887,_0x260f4a,!![])['then'](function(_0x5eb939){_0x41b43b(_0x5eb939);})[_0x1e51('0x3d')](function(_0x49263c){_0x51ef46(_0x49263c);});}else{originate(_0x4da887,_0x260f4a,![])[_0x1e51('0x46')](function(_0x1d6a02){_0x41b43b(_0x1d6a02);})[_0x1e51('0x3d')](function(_0xd450df){_0x51ef46(_0xd450df);});}});};Fax[_0x1e51('0x29')]['isTrunkReachable']=function(_0x4e3460){return!_[_0x1e51('0x67')](_0x4e3460)&&!_[_0x1e51('0x67')](_0x4e3460['name'])&&!_[_0x1e51('0x67')](_0x4e3460[_0x1e51('0x68')])&&_0x4e3460['active']&&!_[_0x1e51('0x67')](this['trunks'][util[_0x1e51('0x69')]('SIP/%s',_0x4e3460['name'])])&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x4e3460[_0x1e51('0x26')])]['status'])&&(this[_0x1e51('0xd')][util['format'](_0x1e51('0x6a'),_0x4e3460[_0x1e51('0x26')])][_0x1e51('0x2e')]==='reachable'||this[_0x1e51('0xd')][util[_0x1e51('0x69')]('SIP/%s',_0x4e3460[_0x1e51('0x26')])]['status']===_0x1e51('0x6b'));};Fax['prototype'][_0x1e51('0x59')]=function(_0x42318c,_0x2d5062){if(!this[_0x1e51('0x6c')](_0x42318c)){ut[_0x1e51('0x47')](_0x1e51('0x6d'),_['isNil'](_0x42318c)?'':_0x42318c[_0x1e51('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x1e51('0x6e')};}if(_[_0x1e51('0x67')](_0x2d5062[_0x1e51('0x6')])){ut[_0x1e51('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2d5062));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x1e51('0x67')](_0x2d5062[_0x1e51('0x3')])){ut[_0x1e51('0x47')](_0x1e51('0x6f'),JSON['stringify'](_0x2d5062));return{'isValid':![],'message':_0x1e51('0x70')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x1e51('0x71')]=Fax; \ No newline at end of file +var _0x5eb8=['remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','.pdf','application/pdf','then','parse','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','logger','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','name','channel','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','filename'];(function(_0x269058,_0x57f7d7){var _0x3beb82=function(_0x229db5){while(--_0x229db5){_0x269058['push'](_0x269058['shift']());}};_0x3beb82(++_0x57f7d7);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x5eb8[_0x2ca2d0];return _0x521c23;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x85eb('0x0'));var uuid=require(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var path=require(_0x85eb('0x3'));var tiff2pdf=require(_0x85eb('0x4'));var gs=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var ami=require(_0x85eb('0x8'));var rpcDb=require(_0x85eb('0x9'));var Channel=require(_0x85eb('0xa'));var ut=require(_0x85eb('0xb'));var Action=require('./action');var faxAccount=require(_0x85eb('0xc'));var attachment=require(_0x85eb('0xd'));var faxMessage=require(_0x85eb('0xe'));function Fax(_0x5cd4ec){this[_0x85eb('0xf')]={};this['faxAccounts']=_0x5cd4ec[_0x85eb('0x10')];this[_0x85eb('0x11')]=_0x5cd4ec[_0x85eb('0x11')];this[_0x85eb('0x12')]={};ami['on'](_0x85eb('0x13'),this[_0x85eb('0x14')][_0x85eb('0x15')](this));ami['on']('varset',this[_0x85eb('0x16')][_0x85eb('0x15')](this));ami['on']('newstate',this[_0x85eb('0x17')][_0x85eb('0x15')](this));ami['on'](_0x85eb('0x18'),this[_0x85eb('0x19')]['bind'](this));ami['on']('faxstatus',this[_0x85eb('0x1a')]['bind'](this));ami['on'](_0x85eb('0x1b'),this[_0x85eb('0x1c')][_0x85eb('0x15')](this));ami['on'](_0x85eb('0x1d'),this[_0x85eb('0x1e')]['bind'](this));ami['on'](_0x85eb('0x1f'),this['syncOriginateResponse'][_0x85eb('0x15')](this));}Fax[_0x85eb('0x20')][_0x85eb('0x14')]=function(_0x5deab1){if(_0x5deab1['context']==='from-voip-provider'){for(var _0x50d2a8 in this[_0x85eb('0x10')]){if(this[_0x85eb('0x10')][_0x85eb('0x21')](_0x50d2a8)){if(_0x5deab1[_0x85eb('0x22')]===this[_0x85eb('0x10')][_0x50d2a8][_0x85eb('0x23')]){this['channels'][_0x5deab1[_0x85eb('0x24')]]={};this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]]['channel']=_0x5deab1['channel'];this['channels'][_0x5deab1['uniqueid']]['id']=this[_0x85eb('0x10')][_0x50d2a8]['id'];this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]][_0x85eb('0x25')]=this[_0x85eb('0x10')][_0x50d2a8][_0x85eb('0x25')];logger['info'](_0x5deab1['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x85eb('0x12')][_0x5deab1[_0x85eb('0x24')]]){this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]]={};this[_0x85eb('0xf')][_0x5deab1[_0x85eb('0x24')]]['channel']=_0x5deab1[_0x85eb('0x26')];logger[_0x85eb('0x27')](_0x5deab1[_0x85eb('0x24')],_0x85eb('0x28'));}};Fax[_0x85eb('0x20')]['syncVarSet']=function(_0x2e5aa3){if(this[_0x85eb('0xf')][_0x2e5aa3[_0x85eb('0x24')]]){for(var _0x3e7eb9 in _0x2e5aa3[_0x85eb('0x29')]){if(_0x2e5aa3[_0x85eb('0x29')]['hasOwnProperty'](_0x3e7eb9)){this['channels'][_0x2e5aa3[_0x85eb('0x24')]][_0x3e7eb9]=_0x2e5aa3['value'];}}}};Fax[_0x85eb('0x20')]['syncNewState']=function(_0x4229e9){if(this[_0x85eb('0xf')][_0x4229e9[_0x85eb('0x24')]]){this[_0x85eb('0xf')][_0x4229e9[_0x85eb('0x24')]][_0x85eb('0x2a')]=_0x4229e9[_0x85eb('0x2a')];this['channels'][_0x4229e9[_0x85eb('0x24')]][_0x85eb('0x2b')]=_0x4229e9['channelstatedesc'];}};Fax[_0x85eb('0x20')]['syncNewExten']=function(_0x5439aa){if(this[_0x85eb('0xf')][_0x5439aa[_0x85eb('0x24')]]){for(var _0x3e6f34 in _0x5439aa[_0x85eb('0x29')]){if(_0x5439aa[_0x85eb('0x29')][_0x85eb('0x21')](_0x3e6f34)){this[_0x85eb('0xf')][_0x5439aa[_0x85eb('0x24')]][_0x3e6f34]=_0x5439aa[_0x85eb('0x2c')];}}}};Fax[_0x85eb('0x20')]['syncFaxStatus']=function(_0x14fe58){if(this[_0x85eb('0xf')][_0x14fe58['uniqueid']]){this['channels'][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x2d')]=_0x14fe58[_0x85eb('0x2d')];this[_0x85eb('0xf')][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x2e')]=_0x14fe58[_0x85eb('0x2e')];this[_0x85eb('0xf')][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x23')]=_0x14fe58[_0x85eb('0x23')];this[_0x85eb('0xf')][_0x14fe58[_0x85eb('0x24')]][_0x85eb('0x2f')]=_0x14fe58['filename'];logger[_0x85eb('0x27')](_0x14fe58[_0x85eb('0x24')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x85eb('0x1c')]=function(_0xe22d16){var _0x5389d8=this;if(this[_0x85eb('0xf')][_0xe22d16['uniqueid']]){var _0x4440ec=this['channels'][_0xe22d16[_0x85eb('0x24')]]['id'];this['channels'][_0xe22d16[_0x85eb('0x24')]]['remotestationid']=_0xe22d16[_0x85eb('0x30')];this[_0x85eb('0xf')][_0xe22d16['uniqueid']][_0x85eb('0x31')]=_0xe22d16['pagestransferred'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]]['localstationid']=_0xe22d16[_0x85eb('0x23')];this['channels'][_0xe22d16['uniqueid']][_0x85eb('0x32')]=_0xe22d16['resolution'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]]['transferrate']=_0xe22d16['transferrate'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]]['filename']=_0xe22d16['filename'];this[_0x85eb('0xf')][_0xe22d16[_0x85eb('0x24')]][_0x85eb('0x33')]=_0xe22d16[_0x85eb('0x33')];if(this[_0x85eb('0xf')][_0xe22d16['uniqueid']][_0x85eb('0x31')]>0x0){tiff2pdf(_0xe22d16[_0x85eb('0x2f')],_0x85eb('0x34'),function(_0x3b096b){logger[_0x85eb('0x27')](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x35'),_0x3b096b[_0x85eb('0x36')]);attachment[_0x85eb('0x37')]({'name':path['parse'](_0xe22d16[_0x85eb('0x2f')])[_0x85eb('0x25')],'basename':path['parse'](_0xe22d16[_0x85eb('0x2f')])[_0x85eb('0x25')]+_0x85eb('0x38'),'type':_0x85eb('0x39')})[_0x85eb('0x3a')](function(_0x2372ad){faxAccount['notify'](_0x4440ec,{'from':_0xe22d16[_0x85eb('0x33')],'mapKey':_0x85eb('0x7'),'body':path[_0x85eb('0x3b')](_0xe22d16[_0x85eb('0x2f')])[_0x85eb('0x25')]+_0x85eb('0x38'),'AttachmentId':_0x2372ad['id']})[_0x85eb('0x3c')](function(_0x202590){logger['error'](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x3d'),JSON[_0x85eb('0x3e')](_0x202590));});})[_0x85eb('0x3c')](function(_0x154399){logger[_0x85eb('0x3f')](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x40'),JSON[_0x85eb('0x3e')](_0x154399));});});}logger[_0x85eb('0x27')](_0xe22d16[_0x85eb('0x24')],_0x85eb('0x40'));}};Fax['prototype'][_0x85eb('0x41')]=function(_0x2c951b){if(this[_0x85eb('0x12')][_0x2c951b['uniqueid']]){_[_0x85eb('0x42')](this[_0x85eb('0xf')][_0x2c951b[_0x85eb('0x24')]],_[_0x85eb('0x43')](_0x2c951b,[_0x85eb('0x44'),'reason']));}};function updateStatus(_0x2ef4d1){if(_0x2ef4d1[_0x85eb('0x45')]){faxMessage[_0x85eb('0x46')](_0x2ef4d1['AttachmentId'],{'failMessage':_0x85eb('0x47')})[_0x85eb('0x3a')](function(_0x1efc6f){ut['logger']('[Fax][Message][Error][Updated]',_0x1efc6f);})[_0x85eb('0x3c')](function(_0x52996f){ut['logger'](_0x85eb('0x48'),_0x52996f);});}else{ut['logger'](_0x85eb('0x49'));}}Fax[_0x85eb('0x20')]['updateStatus']=function(_0x4abe5e,_0x27ce2a,_0x249511){var _0x178d76=this;var _0x40d64d={};if(_0x27ce2a){_0x40d64d={'read':_0x27ce2a};}else{_0x40d64d={'failMessage':_0x249511};}if(this[_0x85eb('0x12')][_0x4abe5e]['AttachmentId']){faxMessage[_0x85eb('0x46')](this[_0x85eb('0x12')][_0x4abe5e][_0x85eb('0x45')],_0x40d64d)[_0x85eb('0x3a')](function(_0x1614dd){ut['logger'](_0x85eb('0x4a'),_0x1614dd);})['catch'](function(_0xd2e792){ut[_0x85eb('0x4b')]('[Fax][Message][NoUpdate1]',_0xd2e792);})[_0x85eb('0x4c')](function(){delete _0x178d76[_0x85eb('0xf')][_0x4abe5e];delete _0x178d76[_0x85eb('0x12')][_0x4abe5e];});}else{ut[_0x85eb('0x4b')](_0x85eb('0x4d'));delete this[_0x85eb('0xf')][_0x4abe5e];delete this['actions'][_0x4abe5e];}};Fax[_0x85eb('0x20')]['syncHangup']=function(_0x311857){var _0x20f4b3=this;if(this['channels'][_0x311857[_0x85eb('0x24')]]){if(this[_0x85eb('0x12')][_0x311857['uniqueid']]){this[_0x85eb('0xf')][_0x311857['uniqueid']]['id']=this[_0x85eb('0x12')][_0x311857[_0x85eb('0x24')]]['id'];this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x25')]=this[_0x85eb('0x12')][_0x311857['uniqueid']][_0x85eb('0x25')];}logger[_0x85eb('0x27')](_0x311857[_0x85eb('0x24')],this[_0x85eb('0x12')][_0x311857[_0x85eb('0x24')]]?_0x85eb('0x4e'):_0x85eb('0x4f'),JSON[_0x85eb('0x3e')](this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]]));if(this[_0x85eb('0x12')][_0x311857['uniqueid']]){if(this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x50')]>0x0&&this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x51')]==='SUCCESS'){this[_0x85eb('0x52')](_0x311857['uniqueid'],!![]);}else{this[_0x85eb('0x52')](_0x311857[_0x85eb('0x24')],![],this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x53')]?'SENDING\x20FAILED:\x20'+this[_0x85eb('0xf')][_0x311857[_0x85eb('0x24')]][_0x85eb('0x53')]:_0x85eb('0x54'));}}}};Fax[_0x85eb('0x20')][_0x85eb('0x55')]=function(_0x23fcf9){var _0x5de716=this;return new BPromise(function(_0x5b611f,_0x3b896a){_0x5de716['execOriginate'](_0x23fcf9,_0x5de716[_0x85eb('0x10')][_0x23fcf9[_0x85eb('0x56')]])[_0x85eb('0x3a')](function(_0x41960f){ut[_0x85eb('0x4b')]('[Fax][execOriginate][success]',_0x41960f);_0x5b611f(ut[_0x85eb('0x36')](_0x85eb('0x57')));})[_0x85eb('0x3c')](function(_0x235fde){ut[_0x85eb('0x4b')](_0x85eb('0x58'),_0x235fde);updateStatus(_0x23fcf9);_0x3b896a(ut['message']('Fax\x20failed'));});});};Fax[_0x85eb('0x20')]['checkAfterSend']=function(_0x1378f4){var _0xc4b933=this;return new BPromise(function(_0xe08b39,_0x23f24a){var _0x232e3f=_0xc4b933[_0x85eb('0x59')](_0xc4b933['faxAccounts'][_0x1378f4[_0x85eb('0x56')]][_0x85eb('0x5a')],_0x1378f4);if(_0x232e3f[_0x85eb('0x5b')]){_0xe08b39(ut[_0x85eb('0x36')]('Trunk\x20Reachable'));}else{_0x23f24a(ut[_0x85eb('0x36')](_0x232e3f[_0x85eb('0x36')]));}});};function originate(_0xcc7da3,_0x14bf0e,_0x5037c7){return new BPromise(function(_0x459317,_0x2e6734){if(_0x5037c7){var _0x13a040=util[_0x85eb('0x5c')](_0x85eb('0x5d'),path[_0x85eb('0x3b')](_0xcc7da3[_0x85eb('0x3')])[_0x85eb('0x25')],_0xcc7da3[_0x85eb('0x3')]);gs[_0x85eb('0x5e')](_0x13a040)[_0x85eb('0x3a')](function(){_0xcc7da3[_0x85eb('0x3')]=util[_0x85eb('0x5c')](_0x85eb('0x5f'),path[_0x85eb('0x3b')](_0xcc7da3[_0x85eb('0x3')])[_0x85eb('0x60')],path[_0x85eb('0x3b')](_0xcc7da3[_0x85eb('0x3')])['name']);_0x14bf0e[_0x85eb('0x61')]=_0xcc7da3['path'];ut[_0x85eb('0x4b')](_0x85eb('0x62'),'');ami[_0x85eb('0x63')](ut[_0x85eb('0x64')](_0xcc7da3,_0x14bf0e))[_0x85eb('0x3a')](function(_0x3de724){_0x459317(_0x3de724);})[_0x85eb('0x3c')](function(_0x3076df){_0x2e6734(_0x3076df);});})[_0x85eb('0x3c')](function(_0x569ebe){_0x2e6734(_0x569ebe);});}else{ami[_0x85eb('0x63')](ut[_0x85eb('0x64')](_0xcc7da3,_0x14bf0e))[_0x85eb('0x3a')](function(_0x31f977){_0x459317(_0x31f977);})[_0x85eb('0x3c')](function(_0x496216){_0x2e6734(_0x496216);});}});}Fax[_0x85eb('0x20')]['execOriginate']=function(_0x24e609,_0x330c2b){var _0x29600d=this;return new BPromise(function(_0x55bab0,_0x2daa64){var _0x2e358d=uuid['v4']();var _0x1169c8=ut['addVariables'](_0x24e609,_0x330c2b);_0x29600d['actions'][_0x2e358d]=new Action(_0x2e358d,_0x330c2b,_0x24e609);var _0x45a1ef=_0x29600d[_0x85eb('0x12')][_0x2e358d];if(path[_0x85eb('0x3b')](_0x24e609[_0x85eb('0x3')])['ext']===_0x85eb('0x38')){originate(_0x45a1ef,_0x1169c8,!![])['then'](function(_0x11a3bd){_0x55bab0(_0x11a3bd);})[_0x85eb('0x3c')](function(_0x528d2e){_0x2daa64(_0x528d2e);});}else{originate(_0x45a1ef,_0x1169c8,![])[_0x85eb('0x3a')](function(_0x404663){_0x55bab0(_0x404663);})[_0x85eb('0x3c')](function(_0x53cf37){_0x2daa64(_0x53cf37);});}});};Fax[_0x85eb('0x20')]['isTrunkReachable']=function(_0x18049b){return!_[_0x85eb('0x65')](_0x18049b)&&!_[_0x85eb('0x65')](_0x18049b[_0x85eb('0x25')])&&!_[_0x85eb('0x65')](_0x18049b[_0x85eb('0x66')])&&_0x18049b[_0x85eb('0x66')]&&!_[_0x85eb('0x65')](this[_0x85eb('0x11')][util['format'](_0x85eb('0x67'),_0x18049b[_0x85eb('0x25')])])&&!_['isNil'](this['trunks'][util[_0x85eb('0x5c')]('SIP/%s',_0x18049b[_0x85eb('0x25')])]['status'])&&(this[_0x85eb('0x11')][util['format'](_0x85eb('0x67'),_0x18049b[_0x85eb('0x25')])]['status']===_0x85eb('0x68')||this[_0x85eb('0x11')][util['format'](_0x85eb('0x67'),_0x18049b[_0x85eb('0x25')])][_0x85eb('0x2e')]===_0x85eb('0x69'));};Fax['prototype'][_0x85eb('0x59')]=function(_0x53ccc5,_0x3acae9){if(!this[_0x85eb('0x6a')](_0x53ccc5)){ut[_0x85eb('0x4b')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x85eb('0x65')](_0x53ccc5)?'':_0x53ccc5[_0x85eb('0x25')]+_0x85eb('0x6b'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x85eb('0x65')](_0x3acae9['fax'])){ut[_0x85eb('0x4b')](_0x85eb('0x6c'),JSON[_0x85eb('0x3e')](_0x3acae9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x3acae9['path'])){ut[_0x85eb('0x4b')](_0x85eb('0x6d'),JSON[_0x85eb('0x3e')](_0x3acae9));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x85eb('0x6e')};};module[_0x85eb('0x6f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 59443ef..b6f2b7e 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 _0xe60f=['error','inspect','notify','resolve','then','catch','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0xe60f,0x1ea));var _0xfe60=function(_0xea5f54,_0x153d7b){_0xea5f54=_0xea5f54-0x0;var _0xdc118e=_0xe60f[_0xea5f54];return _0xdc118e;};'use strict';var util=require(_0xfe60('0x0'));var BPromise=require(_0xfe60('0x1'));var logger=require(_0xfe60('0x2'))('preview');var _=require(_0xfe60('0x3'));var faxAccount=require(_0xfe60('0x4'));function loggerCatch(_0x490ae9){return function(_0x536a91){logger[_0xfe60('0x5')](_0x490ae9,util[_0xfe60('0x6')](_0x536a91,{'showHidden':![],'depth':null}));};}exports[_0xfe60('0x7')]=function(_0x47090e,_0x1473bf){return BPromise[_0xfe60('0x8')]()[_0xfe60('0x9')](faxAccount[_0xfe60('0x7')](_0x47090e,_0x1473bf))[_0xfe60('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x0fcc=['notify','then','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x0fcc,0x138));var _0xc0fc=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x0fcc[_0x5f09c5];return _0x426ad9;};'use strict';var util=require(_0xc0fc('0x0'));var BPromise=require(_0xc0fc('0x1'));var logger=require(_0xc0fc('0x2'))(_0xc0fc('0x3'));var _=require(_0xc0fc('0x4'));var faxAccount=require(_0xc0fc('0x5'));function loggerCatch(_0x5a376b){return function(_0x4b5f80){logger[_0xc0fc('0x6')](_0x5a376b,util[_0xc0fc('0x7')](_0x4b5f80,{'showHidden':![],'depth':null}));};}exports[_0xc0fc('0x8')]=function(_0x3b20c2,_0x1397c8){return BPromise['resolve']()[_0xc0fc('0x9')](faxAccount[_0xc0fc('0x8')](_0x3b20c2,_0x1397c8))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 187ba4e..db07801 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 _0x88ca=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x26545f,_0x1d05e5){var _0x3ea49e=function(_0x108ca2){while(--_0x108ca2){_0x26545f['push'](_0x26545f['shift']());}};_0x3ea49e(++_0x1d05e5);}(_0x88ca,0x175));var _0xa88c=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x88ca[_0xc40b9f];return _0x535b9c;};'use strict';var util=require(_0xa88c('0x0'));var logger=require(_0xa88c('0x1'))(_0xa88c('0x2'));var BPromise=require('bluebird');var exec=require('child_process')[_0xa88c('0x3')];exports['execute']=function(_0x56489b){return new BPromise(function(_0x470b7c,_0x4891fa){exec(_0x56489b,function(_0x382fba,_0x2506b0,_0x392553){logger[_0xa88c('0x4')](_0xa88c('0x5'),_0x2506b0);if(_0x382fba){logger[_0xa88c('0x4')](_0xa88c('0x5'),_0xa88c('0x6'),util[_0xa88c('0x7')](_0x382fba,{'showHidden':![],'depth':null}),_0x2506b0,_0x392553);_0x4891fa(_0x382fba);}_0x470b7c(_0x2506b0);});});}; \ No newline at end of file +var _0x34a3=['child_process','exec','execute','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax'];(function(_0x545bc4,_0x135d48){var _0x2d478e=function(_0x42ab1f){while(--_0x42ab1f){_0x545bc4['push'](_0x545bc4['shift']());}};_0x2d478e(++_0x135d48);}(_0x34a3,0x86));var _0x334a=function(_0x9cf391,_0x3b631f){_0x9cf391=_0x9cf391-0x0;var _0xb7069f=_0x34a3[_0x9cf391];return _0xb7069f;};'use strict';var util=require('util');var logger=require(_0x334a('0x0'))(_0x334a('0x1'));var BPromise=require('bluebird');var exec=require(_0x334a('0x2'))[_0x334a('0x3')];exports[_0x334a('0x4')]=function(_0x5880bc){return new BPromise(function(_0x5d6ee7,_0x1f07bc){exec(_0x5880bc,function(_0x36db46,_0x3596dc,_0x15081a){logger['info']('Exec\x20gs',_0x3596dc);if(_0x36db46){logger['info'](_0x334a('0x5'),_0x334a('0x6'),util[_0x334a('0x7')](_0x36db46,{'showHidden':![],'depth':null}),_0x3596dc,_0x15081a);_0x1f07bc(_0x36db46);}_0x5d6ee7(_0x3596dc);});});}; \ 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 b2e90d5..00e8bc6 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 _0x0c32=['inspect','addVariables','ecm','minrate','format','\x22%s\x22','modem','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0c32,0x130));var _0x20c3=function(_0xd626ea,_0x855b6b){_0xd626ea=_0xd626ea-0x0;var _0x155a50=_0x0c32[_0xd626ea];return _0x155a50;};'use strict';var util=require(_0x20c3('0x0'));var _=require(_0x20c3('0x1'));var moment=require(_0x20c3('0x2'));var logger=require(_0x20c3('0x3'))(_0x20c3('0x4'));exports[_0x20c3('0x5')]=function(_0x1152fe){return{'message':_0x1152fe};};exports[_0x20c3('0x6')]=function(_0x19382d,_0x107cd7){logger[_0x20c3('0x7')](_0x19382d,util[_0x20c3('0x8')](_0x107cd7,{'showHidden':![],'depth':null}));};exports[_0x20c3('0x9')]=function(_0x430839,_0x4d069e){var _0x58bdc4={'XMF-ECM':_0x4d069e[_0x20c3('0xa')],'XMF-HEADERINFO':_0x4d069e['headerinfo'],'XMF-MINRATE':_0x4d069e[_0x20c3('0xb')],'XMF-MAXRATE':_0x4d069e['maxrate'],'XMF-MODEM':util[_0x20c3('0xc')](_0x20c3('0xd'),_0x4d069e[_0x20c3('0xe')]),'XMF-GATEWAY':_0x4d069e['gateway'],'XMF-FAXDETECT':_0x4d069e['faxdetect'],'XMF-T38TIMEOUT':_0x4d069e[_0x20c3('0xf')],'XMF-LOCALSTATIONID':_0x4d069e['localstationid'],'XMF-PATH':_0x430839[_0x20c3('0x10')]};return _0x58bdc4;};exports[_0x20c3('0x11')]=function(_0x12e9dc,_0x1f2e32){return{'actionid':_0x12e9dc[_0x20c3('0x12')],'action':_0x20c3('0x13'),'channel':_0x12e9dc[_0x20c3('0x14')],'Exten':_0x20c3('0x15'),'Context':_0x20c3('0x16'),'Priority':'1','callerid':util[_0x20c3('0xc')](_0x20c3('0x17'),_0x12e9dc[_0x20c3('0x18')]?_0x12e9dc[_0x20c3('0x18')]:'',_0x12e9dc[_0x20c3('0x19')]),'variable':_0x1f2e32,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x12e9dc['uniqueid']};}; \ No newline at end of file +var _0x15c8=['\x22%s\x22\x20<%s>','localstationid','util','moment','../../../../config/logger','fax','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip'];(function(_0x432707,_0xf0f34c){var _0x340b83=function(_0x52ee21){while(--_0x52ee21){_0x432707['push'](_0x432707['shift']());}};_0x340b83(++_0xf0f34c);}(_0x15c8,0x116));var _0x815c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15c8[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x815c('0x0'));var _=require('lodash');var moment=require(_0x815c('0x1'));var logger=require(_0x815c('0x2'))(_0x815c('0x3'));exports['message']=function(_0x10afad){return{'message':_0x10afad};};exports['logger']=function(_0x3ee811,_0x592437){logger['info'](_0x3ee811,util[_0x815c('0x4')](_0x592437,{'showHidden':![],'depth':null}));};exports[_0x815c('0x5')]=function(_0xf3ab1d,_0x224d98){var _0x2bbf33={'XMF-ECM':_0x224d98[_0x815c('0x6')],'XMF-HEADERINFO':_0x224d98[_0x815c('0x7')],'XMF-MINRATE':_0x224d98[_0x815c('0x8')],'XMF-MAXRATE':_0x224d98[_0x815c('0x9')],'XMF-MODEM':util[_0x815c('0xa')](_0x815c('0xb'),_0x224d98[_0x815c('0xc')]),'XMF-GATEWAY':_0x224d98[_0x815c('0xd')],'XMF-FAXDETECT':_0x224d98[_0x815c('0xe')],'XMF-T38TIMEOUT':_0x224d98['t38timeout'],'XMF-LOCALSTATIONID':_0x224d98['localstationid'],'XMF-PATH':_0xf3ab1d['path']};return _0x2bbf33;};exports[_0x815c('0xf')]=function(_0x2a6896,_0x4b8029){return{'actionid':_0x2a6896[_0x815c('0x10')],'action':_0x815c('0x11'),'channel':_0x2a6896[_0x815c('0x12')],'Exten':_0x815c('0x13'),'Context':_0x815c('0x14'),'Priority':'1','callerid':util[_0x815c('0xa')](_0x815c('0x15'),_0x2a6896['headerinfo']?_0x2a6896[_0x815c('0x7')]:'',_0x2a6896[_0x815c('0x16')]),'variable':_0x4b8029,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2a6896[_0x815c('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 2393ea0..5e97c49 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 _0xc408=['./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','error','[index.js][initParams]','listen','sync','catch','[index.js][main]','inspect','util','moment','./server','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/voiceExtension'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0xc408,0x7a));var _0x8c40=function(_0x5cb412,_0xca6392){_0x5cb412=_0x5cb412-0x0;var _0x24f3cd=_0xc408[_0x5cb412];return _0x24f3cd;};'use strict';var BPromise=require('bluebird');var util=require(_0x8c40('0x0'));var moment=require(_0x8c40('0x1'));var server=require(_0x8c40('0x2'));var Realtime=require('./realtime');var Report=require(_0x8c40('0x3'));var Acw=require(_0x8c40('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x8c40('0x5'));var Preview=require(_0x8c40('0x6'));var Fax=require(_0x8c40('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x8c40('0x8'));var voiceQueueReport=require(_0x8c40('0x9'));var voiceCallReport=require(_0x8c40('0xa'));var trunk=require(_0x8c40('0xb'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x8c40('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8c40('0xd'));var faxAccount=require(_0x8c40('0xe'));var zendesk=require(_0x8c40('0xf'));var salesforce=require(_0x8c40('0x10'));var sugarcrm=require(_0x8c40('0x11'));var freshdesk=require(_0x8c40('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x8c40('0x13'));var vtiger=require(_0x8c40('0x14'));var freshsales=require(_0x8c40('0x15'));var servicenow=require(_0x8c40('0x16'));var dynamics365=require(_0x8c40('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x8c40('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8c40('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x8c40('0x1a')](user[_0x8c40('0x1b')]())[_0x8c40('0x1a')](realtime['initAgents']())[_0x8c40('0x1a')](user[_0x8c40('0x1c')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x1d')]())['then'](trunk['getTrunks']())[_0x8c40('0x1a')](realtime[_0x8c40('0x1e')]())[_0x8c40('0x1a')](voiceQueue[_0x8c40('0x1f')]())['then'](realtime[_0x8c40('0x20')]())[_0x8c40('0x1a')](trigger[_0x8c40('0x21')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x22')]())[_0x8c40('0x1a')](template[_0x8c40('0x23')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x24')]())['then'](zendesk[_0x8c40('0x25')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x26')]())['then'](salesforce['getSalesforceAccounts']())[_0x8c40('0x1a')](realtime[_0x8c40('0x27')]())[_0x8c40('0x1a')](sugarcrm[_0x8c40('0x28')]())[_0x8c40('0x1a')](realtime['initSugarcrmAccounts']())[_0x8c40('0x1a')](freshdesk[_0x8c40('0x29')]())['then'](realtime[_0x8c40('0x2a')]())[_0x8c40('0x1a')](desk[_0x8c40('0x2b')]())[_0x8c40('0x1a')](realtime['initDeskAccounts']())[_0x8c40('0x1a')](zoho[_0x8c40('0x2c')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x2d')]())[_0x8c40('0x1a')](vtiger[_0x8c40('0x2e')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x2f')]())[_0x8c40('0x1a')](freshsales['getFreshsalesAccounts']())[_0x8c40('0x1a')](realtime[_0x8c40('0x30')]())['then'](servicenow[_0x8c40('0x31')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x32')]())['then'](dynamics365[_0x8c40('0x33')]())['then'](realtime['initDynamics365Accounts']())[_0x8c40('0x1a')](campaign[_0x8c40('0x34')]())['then'](realtime[_0x8c40('0x35')]())[_0x8c40('0x1a')](voiceExtension[_0x8c40('0x36')]())[_0x8c40('0x1a')](realtime['initVoiceExtensions']())[_0x8c40('0x1a')](faxAccount['getFaxAccounts']())[_0x8c40('0x1a')](realtime[_0x8c40('0x37')]())[_0x8c40('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8c40('0x1a')](voiceQueueReport[_0x8c40('0x38')]())['then'](realtime[_0x8c40('0x39')]())[_0x8c40('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x8c40('0x1a')](realtime[_0x8c40('0x3a')]())['then'](cmHopperHistory[_0x8c40('0x3b')]())[_0x8c40('0x1a')](realtime[_0x8c40('0x3c')]())[_0x8c40('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x8c40('0x1a')](realtime['initVoiceCallReports']())['catch'](function(_0x34fee1){logger[_0x8c40('0x3d')](_0x8c40('0x3e'),util['inspect'](_0x34fee1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8c40('0x3f')](realtime,preview,fax)['then'](function(_0x3320bd){return initRealtime();})[_0x8c40('0x1a')](function(){return initParams();})[_0x8c40('0x1a')](function(){report[_0x8c40('0x40')]();setInterval(initRealtime,0x1388);})[_0x8c40('0x41')](function(_0x42ce17){logger[_0x8c40('0x3d')](_0x8c40('0x42'),util[_0x8c40('0x43')](_0x42ce17,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xfb74=['getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','[index.js][main]','inspect','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xfb74,0x11c));var _0x4fb7=function(_0x52ca59,_0x279dda){_0x52ca59=_0x52ca59-0x0;var _0x1ab7e5=_0xfb74[_0x52ca59];return _0x1ab7e5;};'use strict';var BPromise=require(_0x4fb7('0x0'));var util=require(_0x4fb7('0x1'));var moment=require(_0x4fb7('0x2'));var server=require(_0x4fb7('0x3'));var Realtime=require(_0x4fb7('0x4'));var Report=require(_0x4fb7('0x5'));var Acw=require(_0x4fb7('0x6'));var Trigger=require(_0x4fb7('0x7'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x4fb7('0x8'));var user=require(_0x4fb7('0x9'));var voiceQueue=require(_0x4fb7('0xa'));var voiceQueueReport=require(_0x4fb7('0xb'));var voiceCallReport=require(_0x4fb7('0xc'));var trunk=require(_0x4fb7('0xd'));var trigger=require(_0x4fb7('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x4fb7('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4fb7('0x10'));var faxAccount=require(_0x4fb7('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x4fb7('0x12'));var freshdesk=require(_0x4fb7('0x13'));var desk=require(_0x4fb7('0x14'));var zoho=require(_0x4fb7('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4fb7('0x16'));var servicenow=require(_0x4fb7('0x17'));var dynamics365=require(_0x4fb7('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x4fb7('0x19'))(_0x4fb7('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4fb7('0x1b')](_0x4fb7('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4fb7('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4fb7('0x1d')]()[_0x4fb7('0x1e')](user[_0x4fb7('0x1f')]())['then'](realtime[_0x4fb7('0x20')]())[_0x4fb7('0x1e')](user[_0x4fb7('0x21')]())[_0x4fb7('0x1e')](realtime['initTelephones']())['then'](trunk[_0x4fb7('0x22')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x23')]())[_0x4fb7('0x1e')](voiceQueue['getVoiceQueues']())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x24')]())[_0x4fb7('0x1e')](trigger[_0x4fb7('0x25')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x26')]())[_0x4fb7('0x1e')](template['getTemplates']())[_0x4fb7('0x1e')](realtime['initTemplates']())[_0x4fb7('0x1e')](zendesk[_0x4fb7('0x27')]())[_0x4fb7('0x1e')](realtime['initZendeskAccounts']())[_0x4fb7('0x1e')](salesforce['getSalesforceAccounts']())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x28')]())[_0x4fb7('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x29')]())['then'](freshdesk[_0x4fb7('0x2a')]())['then'](realtime['initFreshdeskAccounts']())[_0x4fb7('0x1e')](desk[_0x4fb7('0x2b')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x2c')]())['then'](zoho[_0x4fb7('0x2d')]())['then'](realtime[_0x4fb7('0x2e')]())['then'](vtiger[_0x4fb7('0x2f')]())[_0x4fb7('0x1e')](realtime['initVtigerAccounts']())[_0x4fb7('0x1e')](freshsales[_0x4fb7('0x30')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x31')]())['then'](servicenow[_0x4fb7('0x32')]())[_0x4fb7('0x1e')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x4fb7('0x33')]())[_0x4fb7('0x1e')](realtime['initDynamics365Accounts']())[_0x4fb7('0x1e')](campaign[_0x4fb7('0x34')]())['then'](realtime['initCampaigns']())[_0x4fb7('0x1e')](voiceExtension[_0x4fb7('0x35')]())[_0x4fb7('0x1e')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x4fb7('0x36')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x37')]())[_0x4fb7('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x4fb7('0x1d')]()[_0x4fb7('0x1e')](voiceQueueReport[_0x4fb7('0x38')]())[_0x4fb7('0x1e')](realtime['initVoiceQueueReports']())[_0x4fb7('0x1e')](cmHopperHistory[_0x4fb7('0x39')]())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x4fb7('0x3a')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x3b')]())[_0x4fb7('0x1e')](voiceCallReport[_0x4fb7('0x3c')]())[_0x4fb7('0x1e')](realtime[_0x4fb7('0x3d')]())[_0x4fb7('0x3e')](function(_0x567018){logger[_0x4fb7('0x3f')](_0x4fb7('0x40'),util['inspect'](_0x567018,{'showHidden':![],'depth':null}));});}function main(){return server[_0x4fb7('0x41')](realtime,preview,fax)[_0x4fb7('0x1e')](function(_0x15f0b6){return initRealtime();})[_0x4fb7('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x5ad29b){logger[_0x4fb7('0x3f')](_0x4fb7('0x42'),util[_0x4fb7('0x43')](_0x5ad29b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index cc53278..1b80948 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 _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x3b660f,_0x45c3db){var _0x187a29=function(_0x11cedf){while(--_0x11cedf){_0x3b660f['push'](_0x3b660f['shift']());}};_0x187a29(++_0x45c3db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x4e1fb5,_0x1fb5a5){var _0xed52ca=function(_0x453ee8){while(--_0x453ee8){_0x4e1fb5['push'](_0x4e1fb5['shift']());}};_0xed52ca(++_0x1fb5a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0xcb91[_0x11f226];return _0x30be77;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index fce6419..01102fd 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 _0x04a8=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x04a8,0x1de));var _0x804a=function(_0x3f74fe,_0x4a517a){_0x3f74fe=_0x3f74fe-0x0;var _0xf3e4aa=_0x04a8[_0x3f74fe];return _0xf3e4aa;};'use strict';function Campaign(_0x36f67d){this['id']=_0x36f67d['id']||0x0;this[_0x804a('0x0')]=_0x36f67d[_0x804a('0x0')]||'';this[_0x804a('0x1')]=_0x36f67d['type']||_0x804a('0x2');this[_0x804a('0x3')]=0x0;this['temp']=0x0;this[_0x804a('0x4')]=0x0;this[_0x804a('0x5')]=0x0;this[_0x804a('0x6')]='';this[_0x804a('0x7')]=!![];this['active']=_0x36f67d[_0x804a('0x8')];this[_0x804a('0x9')]=_0x36f67d['limitCalls'];this[_0x804a('0xa')]=_0x36f67d[_0x804a('0xa')]||null;this[_0x804a('0xb')]=_0x36f67d['dialGlobalInterval']?_0x36f67d['dialGlobalInterval']:null;this[_0x804a('0xc')]=_0x36f67d['dialOriginateCallerIdName'];this[_0x804a('0xd')]=_0x36f67d[_0x804a('0xd')];this[_0x804a('0xe')]=_0x36f67d[_0x804a('0xe')]||0x1e;this[_0x804a('0xf')]=_0x36f67d[_0x804a('0xf')];this['dialCongestionRetryFrequency']=_0x36f67d[_0x804a('0x10')];this[_0x804a('0x11')]=_0x36f67d[_0x804a('0x11')];this[_0x804a('0x12')]=_0x36f67d[_0x804a('0x12')];this['dialNoAnswerMaxRetry']=_0x36f67d[_0x804a('0x13')];this[_0x804a('0x14')]=_0x36f67d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x36f67d[_0x804a('0x15')];this['dialNoSuchNumberMaxRetry']=_0x36f67d[_0x804a('0x16')]||0x3;this[_0x804a('0x17')]=_0x36f67d[_0x804a('0x17')]||0x96;this['dialDropMaxRetry']=_0x36f67d[_0x804a('0x18')]||0x3;this[_0x804a('0x19')]=_0x36f67d[_0x804a('0x19')]||0x96;this[_0x804a('0x1a')]=_0x36f67d['dialAbandonedMaxRetry']||0x3;this[_0x804a('0x1b')]=_0x36f67d[_0x804a('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x36f67d[_0x804a('0x1c')]||0x3;this[_0x804a('0x1d')]=_0x36f67d[_0x804a('0x1d')]||0x96;this[_0x804a('0x1e')]=_0x36f67d['dialAgentRejectMaxRetry']||0x3;this[_0x804a('0x1f')]=_0x36f67d[_0x804a('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x36f67d[_0x804a('0x20')]||'DESC';this[_0x804a('0x21')]=_0x36f67d[_0x804a('0x21')]||undefined;this[_0x804a('0x22')]=_0x36f67d[_0x804a('0x22')]||undefined;this[_0x804a('0x23')]=_0x36f67d[_0x804a('0x23')]||undefined;this[_0x804a('0x24')]=_0x36f67d['TrunkBackup']?_0x36f67d['TrunkBackup']:undefined;this[_0x804a('0x25')]=_0x36f67d[_0x804a('0x25')]?_0x36f67d[_0x804a('0x25')]:undefined;this[_0x804a('0x26')]=_0x36f67d[_0x804a('0x26')]?_0x36f67d[_0x804a('0x26')]:undefined;this[_0x804a('0x27')]=_0x36f67d['SquareProject']?_0x36f67d[_0x804a('0x27')]:undefined;this[_0x804a('0x28')]=_0x36f67d[_0x804a('0x27')]?_0x36f67d[_0x804a('0x27')][_0x804a('0x0')]:undefined;this['dialAMDActive']=_0x36f67d[_0x804a('0x29')]||![];this['dialAMDInitialSilence']=_0x36f67d[_0x804a('0x2a')];this[_0x804a('0x2b')]=_0x36f67d[_0x804a('0x2b')];this[_0x804a('0x2c')]=_0x36f67d[_0x804a('0x2c')];this[_0x804a('0x2d')]=_0x36f67d[_0x804a('0x2d')];this['dialAMDMinWordLength']=_0x36f67d[_0x804a('0x2e')];this[_0x804a('0x2f')]=_0x36f67d[_0x804a('0x2f')];this['dialAMDMaximumNumberOfWords']=_0x36f67d[_0x804a('0x30')];this[_0x804a('0x31')]=_0x36f67d[_0x804a('0x31')];this[_0x804a('0x32')]=_0x36f67d[_0x804a('0x32')];}module[_0x804a('0x33')]=Campaign; \ No newline at end of file +var _0xd60b=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x2a8b1d,_0x1057e8){var _0x3d9ee9=function(_0x386cd2){while(--_0x386cd2){_0x2a8b1d['push'](_0x2a8b1d['shift']());}};_0x3d9ee9(++_0x1057e8);}(_0xd60b,0xa3));var _0xbd60=function(_0x5d4c1d,_0x3d64f8){_0x5d4c1d=_0x5d4c1d-0x0;var _0xb58922=_0xd60b[_0x5d4c1d];return _0xb58922;};'use strict';function Campaign(_0x5bddef){this['id']=_0x5bddef['id']||0x0;this['name']=_0x5bddef[_0xbd60('0x0')]||'';this[_0xbd60('0x1')]=_0x5bddef[_0xbd60('0x1')]||_0xbd60('0x2');this[_0xbd60('0x3')]=0x0;this[_0xbd60('0x4')]=0x0;this[_0xbd60('0x5')]=0x0;this[_0xbd60('0x6')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0xbd60('0x7')]=_0x5bddef[_0xbd60('0x7')];this[_0xbd60('0x8')]=_0x5bddef['limitCalls'];this[_0xbd60('0x9')]=_0x5bddef[_0xbd60('0x9')]||null;this[_0xbd60('0xa')]=_0x5bddef['dialGlobalInterval']?_0x5bddef[_0xbd60('0xa')]:null;this[_0xbd60('0xb')]=_0x5bddef[_0xbd60('0xb')];this[_0xbd60('0xc')]=_0x5bddef[_0xbd60('0xc')];this['dialOriginateTimeout']=_0x5bddef[_0xbd60('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x5bddef[_0xbd60('0xe')];this[_0xbd60('0xf')]=_0x5bddef[_0xbd60('0xf')];this[_0xbd60('0x10')]=_0x5bddef[_0xbd60('0x10')];this[_0xbd60('0x11')]=_0x5bddef[_0xbd60('0x11')];this['dialNoAnswerMaxRetry']=_0x5bddef[_0xbd60('0x12')];this[_0xbd60('0x13')]=_0x5bddef[_0xbd60('0x13')];this[_0xbd60('0x14')]=_0x5bddef[_0xbd60('0x14')];this[_0xbd60('0x15')]=_0x5bddef[_0xbd60('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5bddef[_0xbd60('0x16')]||0x96;this[_0xbd60('0x17')]=_0x5bddef[_0xbd60('0x17')]||0x3;this[_0xbd60('0x18')]=_0x5bddef[_0xbd60('0x18')]||0x96;this[_0xbd60('0x19')]=_0x5bddef[_0xbd60('0x19')]||0x3;this[_0xbd60('0x1a')]=_0x5bddef[_0xbd60('0x1a')]||0x96;this[_0xbd60('0x1b')]=_0x5bddef['dialMachineMaxRetry']||0x3;this[_0xbd60('0x1c')]=_0x5bddef['dialMachineRetryFrequency']||0x96;this[_0xbd60('0x1d')]=_0x5bddef['dialAgentRejectMaxRetry']||0x3;this[_0xbd60('0x1e')]=_0x5bddef[_0xbd60('0x1e')]||0x96;this[_0xbd60('0x1f')]=_0x5bddef[_0xbd60('0x1f')]||_0xbd60('0x20');this['dialPrefix']=_0x5bddef[_0xbd60('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5bddef[_0xbd60('0x22')]||undefined;this['dialCutDigit']=_0x5bddef['dialCutDigit']||undefined;this[_0xbd60('0x23')]=_0x5bddef['TrunkBackup']?_0x5bddef[_0xbd60('0x23')]:undefined;this[_0xbd60('0x24')]=_0x5bddef[_0xbd60('0x24')]?_0x5bddef[_0xbd60('0x24')]:undefined;this['Interval']=_0x5bddef[_0xbd60('0x25')]?_0x5bddef[_0xbd60('0x25')]:undefined;this['SquareProject']=_0x5bddef[_0xbd60('0x26')]?_0x5bddef[_0xbd60('0x26')]:undefined;this[_0xbd60('0x27')]=_0x5bddef[_0xbd60('0x26')]?_0x5bddef[_0xbd60('0x26')][_0xbd60('0x0')]:undefined;this[_0xbd60('0x28')]=_0x5bddef[_0xbd60('0x28')]||![];this[_0xbd60('0x29')]=_0x5bddef[_0xbd60('0x29')];this[_0xbd60('0x2a')]=_0x5bddef[_0xbd60('0x2a')];this['dialAMDAfterGreetingSilence']=_0x5bddef['dialAMDAfterGreetingSilence'];this[_0xbd60('0x2b')]=_0x5bddef[_0xbd60('0x2b')];this[_0xbd60('0x2c')]=_0x5bddef[_0xbd60('0x2c')];this['dialAMDBetweenWordsSilence']=_0x5bddef[_0xbd60('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x5bddef['dialAMDMaximumNumberOfWords'];this[_0xbd60('0x2e')]=_0x5bddef[_0xbd60('0x2e')];this[_0xbd60('0x2f')]=_0x5bddef[_0xbd60('0x2f')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1b0fbb4..1d6fa5e 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 _0xc0a6=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','lastapplication','lastdata','billableseconds','type','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','calleridname'];(function(_0x3891bb,_0x12be78){var _0x1b7637=function(_0x5071fa){while(--_0x5071fa){_0x3891bb['push'](_0x3891bb['shift']());}};_0x1b7637(++_0x12be78);}(_0xc0a6,0xcb));var _0x6c0a=function(_0x20a63e,_0xcb0bea){_0x20a63e=_0x20a63e-0x0;var _0x56fe3d=_0xc0a6[_0x20a63e];return _0x56fe3d;};'use strict';function Channel(){this[_0x6c0a('0x0')]=null;this[_0x6c0a('0x1')]='';this['destinationchannel']='';this[_0x6c0a('0x2')]=0x0;this[_0x6c0a('0x3')]='';this[_0x6c0a('0x4')]=undefined;this[_0x6c0a('0x5')]=undefined;this[_0x6c0a('0x6')]=0x0;this[_0x6c0a('0x7')]='';this[_0x6c0a('0x8')]=0x0;this[_0x6c0a('0x9')]=0x0;this['exten']=0x0;this[_0x6c0a('0xa')]=![];this[_0x6c0a('0xb')]=null;this[_0x6c0a('0xc')]=null;this[_0x6c0a('0xd')]=![];this['abandoned']=![];this[_0x6c0a('0xe')]='';this[_0x6c0a('0xf')]='';this['duration']=0x0;this[_0x6c0a('0x10')]=0x0;this['holdtime']=0x0;this[_0x6c0a('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x6c0a('0x12')]=null;this['monitors']=[];this[_0x6c0a('0x13')]=undefined;this[_0x6c0a('0x14')]=undefined;this[_0x6c0a('0x15')]=undefined;this['mohtime']=0x0;}module[_0x6c0a('0x16')]=Channel; \ No newline at end of file +var _0x7e27=['monitorFilename','monitors','transfercalleridnum','mohtime','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','answered','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag'];(function(_0x22961d,_0x121c25){var _0x1cad3d=function(_0x1d4ed5){while(--_0x1d4ed5){_0x22961d['push'](_0x22961d['shift']());}};_0x1cad3d(++_0x121c25);}(_0x7e27,0xdd));var _0x77e2=function(_0xccb07e,_0x4c12cf){_0xccb07e=_0xccb07e-0x0;var _0x3d4ca9=_0x7e27[_0xccb07e];return _0x3d4ca9;};'use strict';function Channel(){this[_0x77e2('0x0')]=null;this[_0x77e2('0x1')]='';this['destinationchannel']='';this[_0x77e2('0x2')]=0x0;this[_0x77e2('0x3')]='';this[_0x77e2('0x4')]=undefined;this[_0x77e2('0x5')]=undefined;this['accountcode']=0x0;this[_0x77e2('0x6')]='';this[_0x77e2('0x7')]=0x0;this[_0x77e2('0x8')]=0x0;this['exten']=0x0;this[_0x77e2('0x9')]=![];this['answertime']=null;this[_0x77e2('0xa')]=null;this[_0x77e2('0xb')]=![];this['abandoned']=![];this[_0x77e2('0xc')]='';this[_0x77e2('0xd')]='';this[_0x77e2('0xe')]=0x0;this[_0x77e2('0xf')]=0x0;this[_0x77e2('0x10')]=0x0;this[_0x77e2('0x11')]=null;this[_0x77e2('0x12')]=null;this['disposition']=null;this['monitor']=![];this[_0x77e2('0x13')]=null;this['queue']=null;this[_0x77e2('0x14')]=[];this[_0x77e2('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x77e2('0x16')]=0x0;}module[_0x77e2('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 884455c..054977f 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 _0x21a5=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x434eab,_0x1f6969){var _0x579004=function(_0x4f99ce){while(--_0x4f99ce){_0x434eab['push'](_0x434eab['shift']());}};_0x579004(++_0x1f6969);}(_0x21a5,0x84));var _0x521a=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x21a5[_0x10df18];return _0x1f9a1d;};'use strict';function DeskAccount(_0xf959f5){this['id']=_0xf959f5['id']||0x0;this[_0x521a('0x0')]=_0xf959f5[_0x521a('0x0')]||'';this[_0x521a('0x1')]=_0xf959f5[_0x521a('0x1')]||'';this[_0x521a('0x2')]=_0xf959f5[_0x521a('0x2')]||'';this['authType']=_0xf959f5[_0x521a('0x3')]||'';this[_0x521a('0x4')]=_0xf959f5[_0x521a('0x4')]||'';this['consumerKey']=_0xf959f5[_0x521a('0x5')]||'';this[_0x521a('0x6')]=_0xf959f5[_0x521a('0x6')]||'';this['token']=_0xf959f5[_0x521a('0x7')]||'';this['tokenSecret']=_0xf959f5[_0x521a('0x8')]||'';this[_0x521a('0x9')]=_0xf959f5[_0x521a('0x9')]||'';this[_0x521a('0xa')]=_0xf959f5['serverUrl']||'';this[_0x521a('0xb')]=_0xf959f5[_0x521a('0xb')]||{};}module[_0x521a('0xc')]=DeskAccount; \ No newline at end of file +var _0x47f7=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x47f7,0xbf));var _0x747f=function(_0x11c221,_0x65c6a5){_0x11c221=_0x11c221-0x0;var _0x26deef=_0x47f7[_0x11c221];return _0x26deef;};'use strict';function DeskAccount(_0x43a4c2){this['id']=_0x43a4c2['id']||0x0;this[_0x747f('0x0')]=_0x43a4c2[_0x747f('0x0')]||'';this[_0x747f('0x1')]=_0x43a4c2['username']||'';this[_0x747f('0x2')]=_0x43a4c2[_0x747f('0x2')]||'';this[_0x747f('0x3')]=_0x43a4c2['authType']||'';this[_0x747f('0x4')]=_0x43a4c2[_0x747f('0x4')]||'';this[_0x747f('0x5')]=_0x43a4c2['consumerKey']||'';this[_0x747f('0x6')]=_0x43a4c2['consumerSecret']||'';this[_0x747f('0x7')]=_0x43a4c2[_0x747f('0x7')]||'';this[_0x747f('0x8')]=_0x43a4c2[_0x747f('0x8')]||'';this[_0x747f('0x9')]=_0x43a4c2[_0x747f('0x9')]||'';this[_0x747f('0xa')]=_0x43a4c2['serverUrl']||'';this[_0x747f('0xb')]=_0x43a4c2['Configurations']||{};}module[_0x747f('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 78fc15d..b4a73b1 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 _0xac4a=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x4def83,_0x5277f9){var _0xa4c6bf=function(_0x490614){while(--_0x490614){_0x4def83['push'](_0x4def83['shift']());}};_0xa4c6bf(++_0x5277f9);}(_0xac4a,0x13f));var _0xaac4=function(_0x4613a2,_0x45f36a){_0x4613a2=_0x4613a2-0x0;var _0x3952a8=_0xac4a[_0x4613a2];return _0x3952a8;};'use strict';function Dynamics365Account(_0x5d2081){this['id']=_0x5d2081['id']||0x0;this[_0xaac4('0x0')]=_0x5d2081[_0xaac4('0x0')]||'';this[_0xaac4('0x1')]=_0x5d2081[_0xaac4('0x1')]||'';this[_0xaac4('0x2')]=_0x5d2081['password']||'';this['remoteUri']=_0x5d2081[_0xaac4('0x3')]||'';this[_0xaac4('0x4')]=_0x5d2081[_0xaac4('0x4')]||'';this['clientId']=_0x5d2081[_0xaac4('0x5')]||'';this['clientSecret']=_0x5d2081[_0xaac4('0x6')]||{};this['serverUrl']=_0x5d2081[_0xaac4('0x7')]||'';this[_0xaac4('0x8')]=_0x5d2081['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xbaf0=['Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x23e1ec,_0x475540){var _0x4002b0=function(_0x505781){while(--_0x505781){_0x23e1ec['push'](_0x23e1ec['shift']());}};_0x4002b0(++_0x475540);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';function Dynamics365Account(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||'';this[_0x0baf('0x2')]=_0x61caa9[_0x0baf('0x2')]||'';this['remoteUri']=_0x61caa9[_0x0baf('0x3')]||'';this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||'';this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||'';this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||{};this[_0x0baf('0x7')]=_0x61caa9[_0x0baf('0x7')]||'';this['Configurations']=_0x61caa9[_0x0baf('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 6c2e560..dca8dc0 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 _0xfa77=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','faxdetect','t38timeout','tech','Trunk','ListId','key'];(function(_0x24a92f,_0x3538b4){var _0x327b7c=function(_0x2d98b5){while(--_0x2d98b5){_0x24a92f['push'](_0x24a92f['shift']());}};_0x327b7c(++_0x3538b4);}(_0xfa77,0x17b));var _0x7fa7=function(_0x2c9984,_0x9c5c02){_0x2c9984=_0x2c9984-0x0;var _0x284f97=_0xfa77[_0x2c9984];return _0x284f97;};'use strict';function FaxAccount(_0x3ce0bb){this['id']=_0x3ce0bb['id']||0x0;this[_0x7fa7('0x0')]=_0x3ce0bb[_0x7fa7('0x0')]||'';this['description']=_0x3ce0bb[_0x7fa7('0x1')];this[_0x7fa7('0x2')]=_0x3ce0bb[_0x7fa7('0x2')];this[_0x7fa7('0x3')]=_0x3ce0bb[_0x7fa7('0x3')];this[_0x7fa7('0x4')]=_0x3ce0bb[_0x7fa7('0x4')];this[_0x7fa7('0x5')]=_0x3ce0bb['minrate']||0x960;this[_0x7fa7('0x6')]=_0x3ce0bb[_0x7fa7('0x6')]||0x3840;this['modem']=_0x3ce0bb['modem']||'v17,v27,v29';this['gateway']=_0x3ce0bb['gateway']||'no';this[_0x7fa7('0x7')]=_0x3ce0bb[_0x7fa7('0x7')]||'no';this[_0x7fa7('0x8')]=_0x3ce0bb[_0x7fa7('0x8')]||0x1388;this['tech']=_0x3ce0bb[_0x7fa7('0x9')]||'SIP';this['Trunk']=_0x3ce0bb[_0x7fa7('0xa')]?_0x3ce0bb[_0x7fa7('0xa')]:undefined;this[_0x7fa7('0xb')]=_0x3ce0bb[_0x7fa7('0xb')];this[_0x7fa7('0xc')]=_0x3ce0bb[_0x7fa7('0xc')];}module[_0x7fa7('0xd')]=FaxAccount; \ No newline at end of file +var _0x0137=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0137,0x162));var _0x7013=function(_0x9ec1a9,_0x5f2e98){_0x9ec1a9=_0x9ec1a9-0x0;var _0x2eba69=_0x0137[_0x9ec1a9];return _0x2eba69;};'use strict';function FaxAccount(_0x1887b6){this['id']=_0x1887b6['id']||0x0;this[_0x7013('0x0')]=_0x1887b6[_0x7013('0x0')]||'';this[_0x7013('0x1')]=_0x1887b6[_0x7013('0x1')];this[_0x7013('0x2')]=_0x1887b6[_0x7013('0x2')];this[_0x7013('0x3')]=_0x1887b6[_0x7013('0x3')];this[_0x7013('0x4')]=_0x1887b6[_0x7013('0x4')];this[_0x7013('0x5')]=_0x1887b6['minrate']||0x960;this[_0x7013('0x6')]=_0x1887b6['maxrate']||0x3840;this[_0x7013('0x7')]=_0x1887b6[_0x7013('0x7')]||_0x7013('0x8');this['gateway']=_0x1887b6['gateway']||'no';this[_0x7013('0x9')]=_0x1887b6[_0x7013('0x9')]||'no';this['t38timeout']=_0x1887b6[_0x7013('0xa')]||0x1388;this['tech']=_0x1887b6[_0x7013('0xb')]||_0x7013('0xc');this[_0x7013('0xd')]=_0x1887b6[_0x7013('0xd')]?_0x1887b6[_0x7013('0xd')]:undefined;this[_0x7013('0xe')]=_0x1887b6['ListId'];this[_0x7013('0xf')]=_0x1887b6['key'];}module[_0x7013('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f88331e..c33f08b 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 _0xefae=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xefae,0x1d2));var _0xeefa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefae[_0x14add3];return _0x4a174f;};'use strict';function FreshdeskAccount(_0x7d5f32){this['id']=_0x7d5f32['id']||0x0;this[_0xeefa('0x0')]=_0x7d5f32[_0xeefa('0x0')]||'';this[_0xeefa('0x1')]=_0x7d5f32[_0xeefa('0x1')]||'';this['apiKey']=_0x7d5f32[_0xeefa('0x2')]||'';this[_0xeefa('0x3')]=_0x7d5f32[_0xeefa('0x3')]||'';this[_0xeefa('0x4')]=_0x7d5f32[_0xeefa('0x4')]||'';this[_0xeefa('0x5')]=_0x7d5f32['Configurations']||{};}module[_0xeefa('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xa109=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x37a591,_0x241d96){var _0x40f911=function(_0x33437a){while(--_0x33437a){_0x37a591['push'](_0x37a591['shift']());}};_0x40f911(++_0x241d96);}(_0xa109,0xd7));var _0x9a10=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa109[_0x126558];return _0x1f6d14;};'use strict';function FreshdeskAccount(_0x2a3b0d){this['id']=_0x2a3b0d['id']||0x0;this[_0x9a10('0x0')]=_0x2a3b0d[_0x9a10('0x0')]||'';this['username']=_0x2a3b0d[_0x9a10('0x1')]||'';this[_0x9a10('0x2')]=_0x2a3b0d[_0x9a10('0x3')]||'';this[_0x9a10('0x4')]=_0x2a3b0d[_0x9a10('0x4')]||'';this[_0x9a10('0x5')]=_0x2a3b0d['serverUrl']||'';this['Configurations']=_0x2a3b0d[_0x9a10('0x6')]||{};}module[_0x9a10('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 2b4c135..3eea266 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 _0xd101=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x46a836,_0x59b1e9){_0x46a836=_0x46a836-0x0;var _0x4e6773=_0xd101[_0x46a836];return _0x4e6773;};'use strict';function FreshsalesAccount(_0x34b53f){this['id']=_0x34b53f['id']||0x0;this['name']=_0x34b53f[_0x1d10('0x0')]||'';this[_0x1d10('0x1')]=_0x34b53f[_0x1d10('0x1')]||'';this[_0x1d10('0x2')]=_0x34b53f[_0x1d10('0x3')]||'';this[_0x1d10('0x4')]=_0x34b53f[_0x1d10('0x4')]||'';this[_0x1d10('0x5')]=_0x34b53f['serverUrl']||'';this[_0x1d10('0x6')]=_0x34b53f[_0x1d10('0x6')]||{};}module[_0x1d10('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x522b=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x1fbde3,_0x59da39){var _0x2b092f=function(_0x18bd24){while(--_0x18bd24){_0x1fbde3['push'](_0x1fbde3['shift']());}};_0x2b092f(++_0x59da39);}(_0x522b,0x1c3));var _0xb522=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x522b[_0x4e1a49];return _0x136aae;};'use strict';function FreshsalesAccount(_0x5dc096){this['id']=_0x5dc096['id']||0x0;this[_0xb522('0x0')]=_0x5dc096['name']||'';this[_0xb522('0x1')]=_0x5dc096['username']||'';this['apiKey']=_0x5dc096[_0xb522('0x2')]||'';this[_0xb522('0x3')]=_0x5dc096['remoteUri']||'';this[_0xb522('0x4')]=_0x5dc096[_0xb522('0x4')]||'';this[_0xb522('0x5')]=_0x5dc096[_0xb522('0x5')]||{};}module[_0xb522('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 9b2855c..fb473bc 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 _0x4fac=['connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','originalposition','channel'];(function(_0x5e5fa2,_0x1b68eb){var _0x1f7d0f=function(_0x3a68e8){while(--_0x3a68e8){_0x5e5fa2['push'](_0x5e5fa2['shift']());}};_0x1f7d0f(++_0x1b68eb);}(_0x4fac,0xab));var _0xc4fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4fac[_0x122ef9];return _0x42fba0;};'use strict';function QueueReport(){this[_0xc4fa('0x0')]=_0xc4fa('0x1');this[_0xc4fa('0x2')]='';this[_0xc4fa('0x3')]='';this[_0xc4fa('0x4')]='';this[_0xc4fa('0x5')]='';this[_0xc4fa('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xc4fa('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xc4fa('0x8')]=null;this['queuecallercomplete']=![];this[_0xc4fa('0x9')]=null;this[_0xc4fa('0xa')]=![];this['queuecallerexitAt']=null;this[_0xc4fa('0xb')]=0x1;this[_0xc4fa('0xc')]='';this['connectedlinenum']='';this[_0xc4fa('0xd')]='';this['accountcode']='';this[_0xc4fa('0xe')]='';this[_0xc4fa('0xf')]='';this[_0xc4fa('0x10')]='';this[_0xc4fa('0x11')]=0x0;this[_0xc4fa('0x12')]=![];this[_0xc4fa('0x13')]='';this[_0xc4fa('0x14')]=_0xc4fa('0x15');this['mohtime']=0x0;this[_0xc4fa('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x866e=['exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables'];(function(_0x11c8cd,_0x3ecada){var _0xe65263=function(_0x306c69){while(--_0x306c69){_0x11c8cd['push'](_0x11c8cd['shift']());}};_0xe65263(++_0x3ecada);}(_0x866e,0x151));var _0xe866=function(_0xb4fe59,_0x34508e){_0xb4fe59=_0xb4fe59-0x0;var _0x525151=_0x866e[_0xb4fe59];return _0x525151;};'use strict';function QueueReport(){this[_0xe866('0x0')]=_0xe866('0x1');this[_0xe866('0x2')]='';this[_0xe866('0x3')]='';this['calleridname']='';this[_0xe866('0x4')]='';this[_0xe866('0x5')]=null;this[_0xe866('0x6')]=null;this[_0xe866('0x7')]=0x1;this['count']=0x1;this[_0xe866('0x8')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xe866('0x9')]=null;this[_0xe866('0xa')]=0x1;this[_0xe866('0xb')]='';this[_0xe866('0xc')]='';this['connectedlinename']='';this[_0xe866('0xd')]='';this[_0xe866('0xe')]='';this[_0xe866('0xf')]='';this[_0xe866('0x10')]='';this[_0xe866('0x11')]=0x0;this[_0xe866('0x12')]=![];this[_0xe866('0x13')]='';this[_0xe866('0x14')]=_0xe866('0x15');this['mohtime']=0x0;this[_0xe866('0x16')]={};}module[_0xe866('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 404b070..7149b7b 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 _0x3991=['password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri'];(function(_0x4979c8,_0x33206d){var _0x4141bb=function(_0x45857b){while(--_0x45857b){_0x4979c8['push'](_0x4979c8['shift']());}};_0x4141bb(++_0x33206d);}(_0x3991,0x101));var _0x1399=function(_0x581c12,_0x2b75b1){_0x581c12=_0x581c12-0x0;var _0x2ba5af=_0x3991[_0x581c12];return _0x2ba5af;};'use strict';function SalesforceAccount(_0x18d00f){this['id']=_0x18d00f['id']||0x0;this[_0x1399('0x0')]=_0x18d00f[_0x1399('0x0')]||'';this[_0x1399('0x1')]=_0x18d00f['username']||'';this[_0x1399('0x2')]=_0x18d00f[_0x1399('0x2')]||'';this[_0x1399('0x3')]=_0x18d00f[_0x1399('0x3')]||'';this[_0x1399('0x4')]=_0x18d00f['clientId']||'';this['clientSecret']=_0x18d00f['clientSecret']||'';this[_0x1399('0x5')]=_0x18d00f[_0x1399('0x5')]||'';this['type']=_0x18d00f[_0x1399('0x6')]||_0x1399('0x7');this[_0x1399('0x8')]=_0x18d00f[_0x1399('0x8')]||'';this['Configurations']=_0x18d00f[_0x1399('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x2243=['clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x2c4c89,_0x49b9b1){var _0x25ff39=function(_0x4b2b0f){while(--_0x4b2b0f){_0x2c4c89['push'](_0x2c4c89['shift']());}};_0x25ff39(++_0x49b9b1);}(_0x2243,0x13b));var _0x3224=function(_0x4f116f,_0x52ab56){_0x4f116f=_0x4f116f-0x0;var _0x35599e=_0x2243[_0x4f116f];return _0x35599e;};'use strict';function SalesforceAccount(_0x3840cd){this['id']=_0x3840cd['id']||0x0;this[_0x3224('0x0')]=_0x3840cd[_0x3224('0x0')]||'';this[_0x3224('0x1')]=_0x3840cd[_0x3224('0x1')]||'';this[_0x3224('0x2')]=_0x3840cd[_0x3224('0x2')]||'';this[_0x3224('0x3')]=_0x3840cd[_0x3224('0x3')]||'';this[_0x3224('0x4')]=_0x3840cd[_0x3224('0x4')]||'';this[_0x3224('0x5')]=_0x3840cd[_0x3224('0x5')]||'';this['securityToken']=_0x3840cd[_0x3224('0x6')]||'';this[_0x3224('0x7')]=_0x3840cd[_0x3224('0x7')]||'integrationTab';this[_0x3224('0x8')]=_0x3840cd['serverUrl']||'';this['Configurations']=_0x3840cd[_0x3224('0x9')]||{};}module[_0x3224('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index f8e9bcb..1850b74 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 _0x7c3e=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x52838f,_0x55eb08){var _0xa3f47f=function(_0x34b594){while(--_0x34b594){_0x52838f['push'](_0x52838f['shift']());}};_0xa3f47f(++_0x55eb08);}(_0x7c3e,0x1d6));var _0xe7c3=function(_0x33cf66,_0x30e414){_0x33cf66=_0x33cf66-0x0;var _0x3a400b=_0x7c3e[_0x33cf66];return _0x3a400b;};'use strict';function ServicenowAccount(_0x552ef2){this['id']=_0x552ef2['id']||0x0;this['name']=_0x552ef2[_0xe7c3('0x0')]||'';this[_0xe7c3('0x1')]=_0x552ef2[_0xe7c3('0x1')]||'';this[_0xe7c3('0x2')]=_0x552ef2['password']||'';this[_0xe7c3('0x3')]=_0x552ef2[_0xe7c3('0x3')]||'';this[_0xe7c3('0x4')]=_0x552ef2['serverUrl']||'';this[_0xe7c3('0x5')]=_0x552ef2[_0xe7c3('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xafe0=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1761f0,_0x27fe8b){var _0x371d9f=function(_0x4b1a4e){while(--_0x4b1a4e){_0x1761f0['push'](_0x1761f0['shift']());}};_0x371d9f(++_0x27fe8b);}(_0xafe0,0x13c));var _0x0afe=function(_0x3f2647,_0x4447ac){_0x3f2647=_0x3f2647-0x0;var _0xbd8415=_0xafe0[_0x3f2647];return _0xbd8415;};'use strict';function ServicenowAccount(_0xa95914){this['id']=_0xa95914['id']||0x0;this['name']=_0xa95914[_0x0afe('0x0')]||'';this['username']=_0xa95914[_0x0afe('0x1')]||'';this[_0x0afe('0x2')]=_0xa95914[_0x0afe('0x2')]||'';this[_0x0afe('0x3')]=_0xa95914['remoteUri']||'';this['serverUrl']=_0xa95914[_0x0afe('0x4')]||'';this[_0x0afe('0x5')]=_0xa95914[_0x0afe('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 31363cd..9674758 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 _0x844d=['password','serverUrl','Configurations','username'];(function(_0x4eda7e,_0x38b16f){var _0x1261cc=function(_0xf0935e){while(--_0xf0935e){_0x4eda7e['push'](_0x4eda7e['shift']());}};_0x1261cc(++_0x38b16f);}(_0x844d,0x1df));var _0xd844=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x844d[_0x10e840];return _0x405caa;};'use strict';function SugarcrmAccount(_0x843dd0){this['id']=_0x843dd0['id']||0x0;this['name']=_0x843dd0['name']||'';this[_0xd844('0x0')]=_0x843dd0[_0xd844('0x0')]||'';this[_0xd844('0x1')]=_0x843dd0[_0xd844('0x1')]||'';this['remoteUri']=_0x843dd0['remoteUri']||'';this[_0xd844('0x2')]=_0x843dd0['serverUrl']||'';this[_0xd844('0x3')]=_0x843dd0[_0xd844('0x3')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x32f1=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x24eeed,_0x51c3cc){var _0x33c864=function(_0x3330f0){while(--_0x3330f0){_0x24eeed['push'](_0x24eeed['shift']());}};_0x33c864(++_0x51c3cc);}(_0x32f1,0xc0));var _0x132f=function(_0x11a4cf,_0x58226e){_0x11a4cf=_0x11a4cf-0x0;var _0x331e05=_0x32f1[_0x11a4cf];return _0x331e05;};'use strict';function SugarcrmAccount(_0x29f230){this['id']=_0x29f230['id']||0x0;this['name']=_0x29f230[_0x132f('0x0')]||'';this['username']=_0x29f230[_0x132f('0x1')]||'';this[_0x132f('0x2')]=_0x29f230[_0x132f('0x2')]||'';this[_0x132f('0x3')]=_0x29f230[_0x132f('0x3')]||'';this[_0x132f('0x4')]=_0x29f230[_0x132f('0x4')]||'';this[_0x132f('0x5')]=_0x29f230['Configurations']||{};}module[_0x132f('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9de4f3a..04da560 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 _0xd11e=['accountcode','state','unknown','stateTime','address','exports','name'];(function(_0x33ef9c,_0x365cec){var _0x1f4322=function(_0x47bbfa){while(--_0x47bbfa){_0x33ef9c['push'](_0x33ef9c['shift']());}};_0x1f4322(++_0x365cec);}(_0xd11e,0xe6));var _0xed11=function(_0x318cc4,_0xca449c){_0x318cc4=_0x318cc4-0x0;var _0x442ef8=_0xd11e[_0x318cc4];return _0x442ef8;};'use strict';function Telephone(_0x50cfb3){this['id']=_0x50cfb3['id']||0x0;this[_0xed11('0x0')]=_0x50cfb3[_0xed11('0x0')]||'';this[_0xed11('0x1')]=_0x50cfb3[_0xed11('0x1')]||'';this[_0xed11('0x2')]=_0xed11('0x3');this[_0xed11('0x4')]=0x0;this['status']=_0xed11('0x3');this[_0xed11('0x5')]='';}module[_0xed11('0x6')]=Telephone; \ No newline at end of file +var _0x105f=['state','stateTime','status','unknown','address','name'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x105f,0x71));var _0xf105=function(_0x25f69b,_0x1b5fe3){_0x25f69b=_0x25f69b-0x0;var _0x1baaf5=_0x105f[_0x25f69b];return _0x1baaf5;};'use strict';function Telephone(_0x3fe1fe){this['id']=_0x3fe1fe['id']||0x0;this[_0xf105('0x0')]=_0x3fe1fe['name']||'';this['accountcode']=_0x3fe1fe['accountcode']||'';this[_0xf105('0x1')]='unknown';this[_0xf105('0x2')]=0x0;this[_0xf105('0x3')]=_0xf105('0x4');this[_0xf105('0x5')]='';}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 383daef..4362ae3 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x57b931,_0x45ebc0){var _0x1bf9e4=function(_0x8c1da7){while(--_0x8c1da7){_0x57b931['push'](_0x57b931['shift']());}};_0x1bf9e4(++_0x45ebc0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x3d486e,_0x190d81){var _0x59f2c2=function(_0x391a46){while(--_0x391a46){_0x3d486e['push'](_0x3d486e['shift']());}};_0x59f2c2(++_0x190d81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 9f49a1e..27dfff6 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 _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x5eb8[_0x19d24c];return _0x2fae8d;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['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 05af564..19324e9 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 _0x21cf=['split','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','stateTime','status','unknown','registry','indexOf'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x21cf,0xd0));var _0xf21c=function(_0x87128c,_0x505bf4){_0x87128c=_0x87128c-0x0;var _0x507047=_0x21cf[_0x87128c];return _0x507047;};'use strict';function Trunk(_0x5bfe39){this['id']=_0x5bfe39['id']||0x0;this[_0xf21c('0x0')]=_0x5bfe39[_0xf21c('0x0')]||![];this['name']=_0x5bfe39[_0xf21c('0x1')]||'';this[_0xf21c('0x2')]='unknown';this[_0xf21c('0x3')]=0x0;this[_0xf21c('0x4')]=_0xf21c('0x5');this[_0xf21c('0x6')]=_0x5bfe39[_0xf21c('0x6')]&&_0x5bfe39[_0xf21c('0x6')][_0xf21c('0x7')](':')?_0x5bfe39[_0xf21c('0x6')][_0xf21c('0x8')](':')[0x0]:'';this[_0xf21c('0x9')]='';this[_0xf21c('0xa')]='';this[_0xf21c('0xb')]='';this[_0xf21c('0xc')]='';this[_0xf21c('0xd')]='';this[_0xf21c('0xe')]=_0xf21c('0x5');this['registrationtime']='';this[_0xf21c('0xf')]='';this[_0xf21c('0x10')]=_0x5bfe39[_0xf21c('0x10')]||'';}module[_0xf21c('0x11')]=Trunk; \ No newline at end of file +var _0xedcf=['registry','split','domain','domainport','stateRegistry','registrationtime','address','defaultuser','active','name','state','stateTime'];(function(_0x239fd1,_0x263a2a){var _0x58e0e6=function(_0x115224){while(--_0x115224){_0x239fd1['push'](_0x239fd1['shift']());}};_0x58e0e6(++_0x263a2a);}(_0xedcf,0x128));var _0xfedc=function(_0x29cd30,_0x136b4b){_0x29cd30=_0x29cd30-0x0;var _0x6fe1d0=_0xedcf[_0x29cd30];return _0x6fe1d0;};'use strict';function Trunk(_0x553aeb){this['id']=_0x553aeb['id']||0x0;this[_0xfedc('0x0')]=_0x553aeb[_0xfedc('0x0')]||![];this['name']=_0x553aeb[_0xfedc('0x1')]||'';this[_0xfedc('0x2')]='unknown';this[_0xfedc('0x3')]=0x0;this['status']='unknown';this[_0xfedc('0x4')]=_0x553aeb[_0xfedc('0x4')]&&_0x553aeb[_0xfedc('0x4')]['indexOf'](':')?_0x553aeb[_0xfedc('0x4')][_0xfedc('0x5')](':')[0x0]:'';this['host']='';this['port']='';this[_0xfedc('0x6')]='';this[_0xfedc('0x7')]='';this['refresh']='';this[_0xfedc('0x8')]='unknown';this[_0xfedc('0x9')]='';this[_0xfedc('0xa')]='';this[_0xfedc('0xb')]=_0x553aeb['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index da2e650..05d026f 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 _0xdb96=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0xeb1dff,_0x5d2f59){var _0x4c0ee0=function(_0x106dbd){while(--_0x106dbd){_0xeb1dff['push'](_0xeb1dff['shift']());}};_0x4c0ee0(++_0x5d2f59);}(_0xdb96,0x12d));var _0x6db9=function(_0x22df91,_0x1521d2){_0x22df91=_0x22df91-0x0;var _0x10f330=_0xdb96[_0x22df91];return _0x10f330;};'use strict';function voiceExtension(_0x4571b2){this['id']=_0x4571b2['id']||0x0;this[_0x6db9('0x0')]=_0x4571b2[_0x6db9('0x0')]||'';this[_0x6db9('0x1')]=_0x4571b2['recordingFormat']||'none';this['mandatoryDisposition']=_0x4571b2[_0x6db9('0x2')]||![];}module[_0x6db9('0x3')]=voiceExtension; \ No newline at end of file +var _0x1a15=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a15,0x1d3));var _0x51a1=function(_0x423a5f,_0x4f3d2b){_0x423a5f=_0x423a5f-0x0;var _0x38825a=_0x1a15[_0x423a5f];return _0x38825a;};'use strict';function voiceExtension(_0x203280){this['id']=_0x203280['id']||0x0;this[_0x51a1('0x0')]=_0x203280[_0x51a1('0x0')]||'';this[_0x51a1('0x1')]=_0x203280[_0x51a1('0x1')]||_0x51a1('0x2');this[_0x51a1('0x3')]=_0x203280['mandatoryDisposition']||![];}module[_0x51a1('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 4c2203d..fca7461 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 _0x91f8=['predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive'];(function(_0x3996e2,_0x5a4ed5){var _0x586f0c=function(_0x45a867){while(--_0x45a867){_0x3996e2['push'](_0x3996e2['shift']());}};_0x586f0c(++_0x5a4ed5);}(_0x91f8,0x8c));var _0x891f=function(_0x1dc1ea,_0x44ab67){_0x1dc1ea=_0x1dc1ea-0x0;var _0x44e0e2=_0x91f8[_0x1dc1ea];return _0x44e0e2;};'use strict';var statusDesc=[_0x891f('0x0'),_0x891f('0x1'),_0x891f('0x2'),_0x891f('0x3'),_0x891f('0x4'),_0x891f('0x5'),'ringing',_0x891f('0x6'),_0x891f('0x7')];var monitorFormat={'wav':_0x891f('0x8'),'wav49':_0x891f('0x9'),'gsm':_0x891f('0xa')};var strategy={'rrmemory':_0x891f('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x28541b){this['id']=_0x28541b['id']||0x0;this[_0x891f('0xc')]=_0x28541b[_0x891f('0xc')]||'';this[_0x891f('0xd')]=_0x28541b[_0x891f('0xd')]||'';this[_0x891f('0xe')]=_0x28541b[_0x891f('0xe')]||_0x891f('0xf');this['waiting']=0x0;this[_0x891f('0x10')]=0x0;this[_0x891f('0x11')]=0x0;this[_0x891f('0x12')]=0x0;this[_0x891f('0x13')]=0x0;this[_0x891f('0x14')]=0x0;this[_0x891f('0x15')]=0x0;this['unmanaged']=0x0;this[_0x891f('0x16')]=0x0;this[_0x891f('0x17')]=0x0;this[_0x891f('0x18')]=0x0;this[_0x891f('0x19')]=_0x28541b[_0x891f('0x19')]||![];this['acwTimeout']=_0x28541b['acwTimeout']||0xa;this[_0x891f('0x1a')]=_0x28541b[_0x891f('0x1a')]||'no';this[_0x891f('0x1b')]=!![];this[_0x891f('0x1c')]='';this[_0x891f('0x1d')]=0x0;this[_0x891f('0x1e')]=0x0;this[_0x891f('0x1f')]=_0x28541b[_0x891f('0x1f')]||null;this[_0x891f('0x20')]=_0x28541b[_0x891f('0x20')]?_0x28541b[_0x891f('0x20')]:null;this['dialActive']=_0x28541b[_0x891f('0x21')];this[_0x891f('0x22')]=_0x28541b['dialMethod']||_0x891f('0x23');this[_0x891f('0x24')]=_0x28541b[_0x891f('0x24')]||0x0;this[_0x891f('0x25')]=_0x28541b['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x28541b[_0x891f('0x26')]||0x1;this[_0x891f('0x27')]=_0x28541b['dialPredictiveOptimization']||'dropRate';this[_0x891f('0x28')]=_0x28541b[_0x891f('0x28')]||0.03;this['dialPredictiveInterval']=_0x28541b['dialPredictiveInterval']||0x258;this[_0x891f('0x29')]=_0x28541b[_0x891f('0x29')]||_0x891f('0x2a');this[_0x891f('0x2b')]=_0x28541b[_0x891f('0x2b')]||_0x891f('0x2a');this['dialOriginateTimeout']=_0x28541b['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x28541b['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x28541b['dialQueueTimeout']||0x3;this[_0x891f('0x2c')]=_0x28541b[_0x891f('0x2c')]||undefined;this[_0x891f('0x2d')]=_0x28541b[_0x891f('0x2d')]||0x3;this[_0x891f('0x2e')]=_0x28541b[_0x891f('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x28541b[_0x891f('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x28541b['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x28541b[_0x891f('0x30')]||0x3;this[_0x891f('0x31')]=_0x28541b[_0x891f('0x31')]||0x96;this[_0x891f('0x32')]=_0x28541b['dialNoSuchNumberMaxRetry']||0x3;this[_0x891f('0x33')]=_0x28541b[_0x891f('0x33')]||0x96;this[_0x891f('0x34')]=_0x28541b['dialDropMaxRetry']||0x3;this[_0x891f('0x35')]=_0x28541b[_0x891f('0x35')]||0x96;this[_0x891f('0x36')]=_0x28541b[_0x891f('0x36')]||0x3;this[_0x891f('0x37')]=_0x28541b[_0x891f('0x37')]||0x96;this[_0x891f('0x38')]=_0x28541b[_0x891f('0x38')]||0x3;this[_0x891f('0x39')]=_0x28541b[_0x891f('0x39')]||0x96;this[_0x891f('0x3a')]=_0x28541b[_0x891f('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x28541b['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x28541b['dialGlobalMaxRetry']||0x4;this[_0x891f('0x3b')]=_0x28541b[_0x891f('0x3b')]?_0x28541b['Trunk']:undefined;this[_0x891f('0x3c')]=_0x28541b[_0x891f('0x3c')]?_0x28541b['TrunkBackup']:undefined;this[_0x891f('0x3d')]=_0x28541b['dialPrefix']||undefined;this['Interval']=_0x28541b[_0x891f('0x3e')]?_0x28541b[_0x891f('0x3e')]:undefined;this[_0x891f('0x3f')]=_0x28541b[_0x891f('0x3f')]||'DESC';this[_0x891f('0x40')]=_0x28541b[_0x891f('0x40')]||undefined;this['dialCutDigit']=_0x28541b[_0x891f('0x41')]||undefined;this[_0x891f('0x42')]=strategy[_0x28541b['strategy']]||'rrmemory';this[_0x891f('0x43')]=!![];this[_0x891f('0x44')]=_0x28541b[_0x891f('0x44')]||![];this['dialAMDInitialSilence']=_0x28541b['dialAMDInitialSilence'];this[_0x891f('0x45')]=_0x28541b['dialAMDGreeting'];this[_0x891f('0x46')]=_0x28541b[_0x891f('0x46')];this[_0x891f('0x47')]=_0x28541b[_0x891f('0x47')];this[_0x891f('0x48')]=_0x28541b['dialAMDMinWordLength'];this[_0x891f('0x49')]=_0x28541b[_0x891f('0x49')];this[_0x891f('0x4a')]=_0x28541b[_0x891f('0x4a')];this['dialAMDSilenceThreshold']=_0x28541b['dialAMDSilenceThreshold'];this[_0x891f('0x4b')]=_0x28541b[_0x891f('0x4b')];this[_0x891f('0x4c')]=0x0;this['pTalking']=0x0;this['timeout']=_0x28541b['timeout'];this[_0x891f('0x4d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x891f('0x4e')]=0x0;this[_0x891f('0x4f')]=0x0;this[_0x891f('0x50')]=0x0;this[_0x891f('0x51')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x891f('0x52')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x891f('0x53')]=0x0;this[_0x891f('0x54')]=0x0;this[_0x891f('0x55')]=0x0;this[_0x891f('0x56')]=undefined;this['startPredictive']=undefined;this[_0x891f('0x57')]=undefined;this[_0x891f('0x58')]=1.05;this[_0x891f('0x59')]=0x0;this[_0x891f('0x5a')]=0x0;this[_0x891f('0x5b')]=0x0;this[_0x891f('0x5c')]=0x0;this[_0x891f('0x5d')]=0x0;this[_0x891f('0x5e')]=0x0;this[_0x891f('0x5f')]=0x0;this[_0x891f('0x60')]=0x0;this[_0x891f('0x61')]=_0x28541b[_0x891f('0x62')]||0x14;this[_0x891f('0x63')]=_0x28541b[_0x891f('0x62')]||0xa;this[_0x891f('0x64')]=0x0;this[_0x891f('0x65')]=0x0;this[_0x891f('0x66')]=0x1;this[_0x891f('0x67')]=0x0;this['erlangCallToSecond']=0x0;this[_0x891f('0x68')]=0x0;this[_0x891f('0x69')]=0x0;this[_0x891f('0x6a')]=_0x28541b['dialRecallMeTimeout']||0x1e;this[_0x891f('0x6b')]=_0x28541b['dialRecallInQueue']||![];this[_0x891f('0x6c')]=!!_0x28541b[_0x891f('0x6c')]||![];this[_0x891f('0x6d')]=_0x28541b[_0x891f('0x6d')]||undefined;this[_0x891f('0x6e')]=_0x28541b['dialAgiAfterHangupClient']||![];this[_0x891f('0x6f')]=_0x28541b[_0x891f('0x6f')]||![];this[_0x891f('0xd')]=monitorFormat[_0x28541b['monitor_format']]?monitorFormat[_0x28541b[_0x891f('0xd')]]:undefined;this[_0x891f('0x70')]=_0x28541b[_0x891f('0x70')]||![];this['mandatoryDispositionPause']=_0x28541b['mandatoryDispositionPause']?_0x28541b['mandatoryDispositionPause']:undefined;}module[_0x891f('0x71')]=VoiceQueue; \ No newline at end of file +var _0x6d56=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x286889,_0x333b6b){var _0x8b6d2d=function(_0x494813){while(--_0x494813){_0x286889['push'](_0x286889['shift']());}};_0x8b6d2d(++_0x333b6b);}(_0x6d56,0xbd));var _0x66d5=function(_0xa369d8,_0x3a1c1b){_0xa369d8=_0xa369d8-0x0;var _0x324e51=_0x6d56[_0xa369d8];return _0x324e51;};'use strict';var statusDesc=[_0x66d5('0x0'),'not_inuse',_0x66d5('0x1'),_0x66d5('0x2'),_0x66d5('0x3'),_0x66d5('0x4'),'ringing',_0x66d5('0x5'),_0x66d5('0x6')];var monitorFormat={'wav':_0x66d5('0x7'),'wav49':'wav49','gsm':_0x66d5('0x8')};var strategy={'rrmemory':_0x66d5('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5cfce0){this['id']=_0x5cfce0['id']||0x0;this[_0x66d5('0xa')]=_0x5cfce0[_0x66d5('0xa')]||'';this[_0x66d5('0xb')]=_0x5cfce0['monitor_format']||'';this['type']=_0x5cfce0[_0x66d5('0xc')]||'inbound';this[_0x66d5('0xd')]=0x0;this['talking']=0x0;this[_0x66d5('0xe')]=0x0;this[_0x66d5('0xf')]=0x0;this[_0x66d5('0x10')]=0x0;this[_0x66d5('0x11')]=0x0;this[_0x66d5('0x12')]=0x0;this['unmanaged']=0x0;this[_0x66d5('0x13')]=0x0;this[_0x66d5('0x14')]=0x0;this[_0x66d5('0x15')]=0x0;this[_0x66d5('0x16')]=_0x5cfce0['acw']||![];this['acwTimeout']=_0x5cfce0[_0x66d5('0x17')]||0xa;this[_0x66d5('0x18')]=_0x5cfce0[_0x66d5('0x18')]||'no';this[_0x66d5('0x19')]=!![];this[_0x66d5('0x1a')]='';this[_0x66d5('0x1b')]=0x0;this[_0x66d5('0x1c')]=0x0;this[_0x66d5('0x1d')]=_0x5cfce0['dialTimezone']||null;this[_0x66d5('0x1e')]=_0x5cfce0[_0x66d5('0x1e')]?_0x5cfce0['dialGlobalInterval']:null;this[_0x66d5('0x1f')]=_0x5cfce0['dialActive'];this[_0x66d5('0x20')]=_0x5cfce0[_0x66d5('0x20')]||_0x66d5('0x21');this[_0x66d5('0x22')]=_0x5cfce0[_0x66d5('0x22')]||0x0;this[_0x66d5('0x23')]=_0x5cfce0['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x5cfce0['dialPowerLevel']||0x1;this[_0x66d5('0x24')]=_0x5cfce0[_0x66d5('0x24')]||_0x66d5('0x25');this[_0x66d5('0x26')]=_0x5cfce0[_0x66d5('0x26')]||0.03;this[_0x66d5('0x27')]=_0x5cfce0[_0x66d5('0x27')]||0x258;this[_0x66d5('0x28')]=_0x5cfce0['dialOriginateCallerIdName']||_0x66d5('0x29');this['dialOriginateCallerIdNumber']=_0x5cfce0[_0x66d5('0x2a')]||_0x66d5('0x29');this[_0x66d5('0x2b')]=_0x5cfce0[_0x66d5('0x2b')]||0x1e;this[_0x66d5('0x2c')]=_0x5cfce0[_0x66d5('0x2c')]||_0x66d5('0x2d');this['dialQueueTimeout']=_0x5cfce0[_0x66d5('0x2e')]||0x3;this[_0x66d5('0x2f')]=_0x5cfce0['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x5cfce0[_0x66d5('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x5cfce0[_0x66d5('0x31')]||0x96;this[_0x66d5('0x32')]=_0x5cfce0['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x5cfce0[_0x66d5('0x33')]||0x96;this[_0x66d5('0x34')]=_0x5cfce0[_0x66d5('0x34')]||0x3;this[_0x66d5('0x35')]=_0x5cfce0[_0x66d5('0x35')]||0x96;this[_0x66d5('0x36')]=_0x5cfce0['dialNoSuchNumberMaxRetry']||0x3;this[_0x66d5('0x37')]=_0x5cfce0[_0x66d5('0x37')]||0x96;this[_0x66d5('0x38')]=_0x5cfce0[_0x66d5('0x38')]||0x3;this[_0x66d5('0x39')]=_0x5cfce0['dialDropRetryFrequency']||0x96;this[_0x66d5('0x3a')]=_0x5cfce0[_0x66d5('0x3a')]||0x3;this[_0x66d5('0x3b')]=_0x5cfce0['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x5cfce0['dialMachineMaxRetry']||0x3;this[_0x66d5('0x3c')]=_0x5cfce0[_0x66d5('0x3c')]||0x96;this['dialAgentRejectMaxRetry']=_0x5cfce0[_0x66d5('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5cfce0[_0x66d5('0x3e')]||0x96;this[_0x66d5('0x3f')]=_0x5cfce0[_0x66d5('0x3f')]||0x4;this[_0x66d5('0x40')]=_0x5cfce0[_0x66d5('0x40')]?_0x5cfce0[_0x66d5('0x40')]:undefined;this[_0x66d5('0x41')]=_0x5cfce0[_0x66d5('0x41')]?_0x5cfce0[_0x66d5('0x41')]:undefined;this[_0x66d5('0x42')]=_0x5cfce0[_0x66d5('0x42')]||undefined;this[_0x66d5('0x43')]=_0x5cfce0[_0x66d5('0x43')]?_0x5cfce0[_0x66d5('0x43')]:undefined;this[_0x66d5('0x44')]=_0x5cfce0[_0x66d5('0x44')]||_0x66d5('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x5cfce0[_0x66d5('0x46')]||undefined;this[_0x66d5('0x47')]=_0x5cfce0[_0x66d5('0x47')]||undefined;this['strategy']=strategy[_0x5cfce0[_0x66d5('0x48')]]||_0x66d5('0x9');this[_0x66d5('0x49')]=!![];this['dialAMDActive']=_0x5cfce0[_0x66d5('0x4a')]||![];this[_0x66d5('0x4b')]=_0x5cfce0[_0x66d5('0x4b')];this['dialAMDGreeting']=_0x5cfce0['dialAMDGreeting'];this[_0x66d5('0x4c')]=_0x5cfce0[_0x66d5('0x4c')];this[_0x66d5('0x4d')]=_0x5cfce0[_0x66d5('0x4d')];this[_0x66d5('0x4e')]=_0x5cfce0['dialAMDMinWordLength'];this[_0x66d5('0x4f')]=_0x5cfce0[_0x66d5('0x4f')];this[_0x66d5('0x50')]=_0x5cfce0[_0x66d5('0x50')];this[_0x66d5('0x51')]=_0x5cfce0[_0x66d5('0x51')];this[_0x66d5('0x52')]=_0x5cfce0[_0x66d5('0x52')];this[_0x66d5('0x53')]=0x0;this[_0x66d5('0x54')]=0x0;this[_0x66d5('0x55')]=_0x5cfce0[_0x66d5('0x55')];this[_0x66d5('0x56')]=0x0;this[_0x66d5('0x57')]=0x0;this[_0x66d5('0x58')]=0x0;this[_0x66d5('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x66d5('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x66d5('0x5b')]=0x0;this[_0x66d5('0x5c')]=0x0;this[_0x66d5('0x5d')]=0x0;this[_0x66d5('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x66d5('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x66d5('0x60')]=undefined;this[_0x66d5('0x61')]=undefined;this[_0x66d5('0x62')]=undefined;this[_0x66d5('0x63')]=1.05;this[_0x66d5('0x64')]=0x0;this[_0x66d5('0x65')]=0x0;this[_0x66d5('0x66')]=0x0;this[_0x66d5('0x67')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x66d5('0x68')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x66d5('0x69')]=0x0;this[_0x66d5('0x6a')]=_0x5cfce0['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x5cfce0[_0x66d5('0x6b')]||0xa;this[_0x66d5('0x6c')]=0x0;this[_0x66d5('0x6d')]=0x0;this[_0x66d5('0x6e')]=0x1;this[_0x66d5('0x6f')]=0x0;this[_0x66d5('0x70')]=0x0;this[_0x66d5('0x71')]=0x0;this[_0x66d5('0x72')]=0x0;this[_0x66d5('0x73')]=_0x5cfce0[_0x66d5('0x73')]||0x1e;this[_0x66d5('0x74')]=_0x5cfce0['dialRecallInQueue']||![];this[_0x66d5('0x75')]=!!_0x5cfce0[_0x66d5('0x75')]||![];this['dialQueueProject2']=_0x5cfce0['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x5cfce0['dialAgiAfterHangupClient']||![];this[_0x66d5('0x76')]=_0x5cfce0['dialAgiAfterHangupAgent']||![];this[_0x66d5('0xb')]=monitorFormat[_0x5cfce0[_0x66d5('0xb')]]?monitorFormat[_0x5cfce0['monitor_format']]:undefined;this[_0x66d5('0x77')]=_0x5cfce0[_0x66d5('0x77')]||![];this[_0x66d5('0x78')]=_0x5cfce0[_0x66d5('0x78')]?_0x5cfce0[_0x66d5('0x78')]:undefined;}module[_0x66d5('0x79')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 34a6596..8885859 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 _0x948e=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x39fb6a,_0x8b07ae){var _0x1452a1=function(_0x391804){while(--_0x391804){_0x39fb6a['push'](_0x39fb6a['shift']());}};_0x1452a1(++_0x8b07ae);}(_0x948e,0x6a));var _0xe948=function(_0x13d71e,_0x1ab6a1){_0x13d71e=_0x13d71e-0x0;var _0x2dc8aa=_0x948e[_0x13d71e];return _0x2dc8aa;};'use strict';function VtigerAccount(_0x302ee8){this['id']=_0x302ee8['id']||0x0;this[_0xe948('0x0')]=_0x302ee8[_0xe948('0x0')]||'';this[_0xe948('0x1')]=_0x302ee8[_0xe948('0x1')]||'';this['accessKey']=_0x302ee8[_0xe948('0x2')]||'';this[_0xe948('0x3')]=_0x302ee8['remoteUri']||'';this[_0xe948('0x4')]=_0x302ee8[_0xe948('0x4')]||'';this[_0xe948('0x5')]=_0x302ee8['Configurations']||{};}module[_0xe948('0x6')]=VtigerAccount; \ No newline at end of file +var _0x59a5=['name','username','accessKey','remoteUri','Configurations'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x59a5,0x1c7));var _0x559a=function(_0x55c46e,_0x3d30ee){_0x55c46e=_0x55c46e-0x0;var _0x340ac8=_0x59a5[_0x55c46e];return _0x340ac8;};'use strict';function VtigerAccount(_0x4d02cd){this['id']=_0x4d02cd['id']||0x0;this[_0x559a('0x0')]=_0x4d02cd[_0x559a('0x0')]||'';this[_0x559a('0x1')]=_0x4d02cd['username']||'';this[_0x559a('0x2')]=_0x4d02cd['accessKey']||'';this[_0x559a('0x3')]=_0x4d02cd[_0x559a('0x3')]||'';this['serverUrl']=_0x4d02cd['serverUrl']||'';this[_0x559a('0x4')]=_0x4d02cd[_0x559a('0x4')]||{};}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 0b4f1b0..a9512b6 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 _0xce2f=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name'];(function(_0x20b10f,_0xc23e9c){var _0x279391=function(_0x3799b4){while(--_0x3799b4){_0x20b10f['push'](_0x20b10f['shift']());}};_0x279391(++_0xc23e9c);}(_0xce2f,0x18f));var _0xfce2=function(_0x30bbee,_0x24025e){_0x30bbee=_0x30bbee-0x0;var _0x2e16da=_0xce2f[_0x30bbee];return _0x2e16da;};'use strict';function ZendeskAccount(_0x3f5a58){this['id']=_0x3f5a58['id']||0x0;this['name']=_0x3f5a58[_0xfce2('0x0')]||'';this['username']=_0x3f5a58[_0xfce2('0x1')]||'';this[_0xfce2('0x2')]=_0x3f5a58[_0xfce2('0x2')]||'';this[_0xfce2('0x3')]=_0x3f5a58[_0xfce2('0x3')]||'';this[_0xfce2('0x4')]=_0x3f5a58['remoteUri']||'';this[_0xfce2('0x5')]=_0x3f5a58['authType']||'';this[_0xfce2('0x6')]=_0x3f5a58[_0xfce2('0x6')]||_0xfce2('0x7');this[_0xfce2('0x8')]=_0x3f5a58[_0xfce2('0x8')]||'';this['Configurations']=_0x3f5a58[_0xfce2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x94ff=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0xf10ab2,_0x4139fa){var _0x4c6629=function(_0x1be701){while(--_0x1be701){_0xf10ab2['push'](_0xf10ab2['shift']());}};_0x4c6629(++_0x4139fa);}(_0x94ff,0xe7));var _0xf94f=function(_0xbad54c,_0x282fab){_0xbad54c=_0xbad54c-0x0;var _0x5de4cd=_0x94ff[_0xbad54c];return _0x5de4cd;};'use strict';function ZendeskAccount(_0x4206ee){this['id']=_0x4206ee['id']||0x0;this['name']=_0x4206ee[_0xf94f('0x0')]||'';this[_0xf94f('0x1')]=_0x4206ee[_0xf94f('0x1')]||'';this[_0xf94f('0x2')]=_0x4206ee['password']||'';this['token']=_0x4206ee['token']||'';this[_0xf94f('0x3')]=_0x4206ee['remoteUri']||'';this[_0xf94f('0x4')]=_0x4206ee[_0xf94f('0x4')]||'';this['type']=_0x4206ee[_0xf94f('0x5')]||_0xf94f('0x6');this[_0xf94f('0x7')]=_0x4206ee['serverUrl']||'';this[_0xf94f('0x8')]=_0x4206ee['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index de0b8ee..79b75f9 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 _0x7b5f=['refreshToken','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0x7b5f,0x1c3));var _0xf7b5=function(_0x5e1427,_0x322bd8){_0x5e1427=_0x5e1427-0x0;var _0x41458f=_0x7b5f[_0x5e1427];return _0x41458f;};'use strict';function ZohoAccount(_0x221739){this['id']=_0x221739['id']||0x0;this[_0xf7b5('0x0')]=_0x221739[_0xf7b5('0x0')]||'';this[_0xf7b5('0x1')]=_0x221739[_0xf7b5('0x1')]||'';this[_0xf7b5('0x2')]=_0x221739[_0xf7b5('0x2')]||'';this[_0xf7b5('0x3')]=_0x221739['zone']||'';this[_0xf7b5('0x4')]=_0x221739[_0xf7b5('0x4')]||'';this[_0xf7b5('0x5')]=_0x221739[_0xf7b5('0x5')]||'';this[_0xf7b5('0x6')]=_0x221739['serverUrl']||'';this[_0xf7b5('0x7')]=_0x221739[_0xf7b5('0x7')]||'';this[_0xf7b5('0x8')]=_0x221739[_0xf7b5('0x8')]||'';this['Configurations']=_0x221739['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x1828=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','clientId','clientSecret'];(function(_0x265dc5,_0x5a5417){var _0x23cfc2=function(_0x1b29d0){while(--_0x1b29d0){_0x265dc5['push'](_0x265dc5['shift']());}};_0x23cfc2(++_0x5a5417);}(_0x1828,0x195));var _0x8182=function(_0x176c16,_0x1e1474){_0x176c16=_0x176c16-0x0;var _0x5a06a3=_0x1828[_0x176c16];return _0x5a06a3;};'use strict';function ZohoAccount(_0x4c1d8e){this['id']=_0x4c1d8e['id']||0x0;this[_0x8182('0x0')]=_0x4c1d8e[_0x8182('0x0')]||'';this['description']=_0x4c1d8e[_0x8182('0x1')]||'';this[_0x8182('0x2')]=_0x4c1d8e[_0x8182('0x2')]||'';this['zone']=_0x4c1d8e['zone']||'';this[_0x8182('0x3')]=_0x4c1d8e[_0x8182('0x3')]||'';this['clientSecret']=_0x4c1d8e[_0x8182('0x4')]||'';this[_0x8182('0x5')]=_0x4c1d8e[_0x8182('0x5')]||'';this[_0x8182('0x6')]=_0x4c1d8e[_0x8182('0x6')]||'';this[_0x8182('0x7')]=_0x4c1d8e[_0x8182('0x7')]||'';this[_0x8182('0x8')]=_0x4c1d8e['Configurations']||{};}module[_0x8182('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 222019a..c38cf26 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 _0xb7a4=['scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','firstName','Contact','lastName','active','calleridnum','phone'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb7a4,0xa1));var _0x4b7a=function(_0x404fc1,_0x3ba027){_0x404fc1=_0x404fc1-0x0;var _0x3eca07=_0xb7a4[_0x404fc1];return _0x3eca07;};'use strict';var util=require(_0x4b7a('0x0'));var _=require(_0x4b7a('0x1'));var moment=require(_0x4b7a('0x2'));function checkNameSurname(_0x6d7cb6,_0x577a85,_0xf8ad7){var _0x4d702b='';if(!_[_0x4b7a('0x3')](_0x577a85)&&_0x4b7a('0x4')===typeof _0x577a85){_0x4d702b+=_0x577a85;}if(!_[_0x4b7a('0x3')](_0xf8ad7)&&_0x4b7a('0x4')===typeof _0xf8ad7){_0x4d702b+='\x20'+_0xf8ad7;}if(_0x4d702b!==''){return _0x4d702b;}return _0x6d7cb6;}function Action(_0x35a555,_0x3e40b2,_0x454d06,_0x15314b,_0x38436e){this['uniqueid']=_0x454d06||undefined;this[_0x4b7a('0x5')]=_0x35a555['id'];this[_0x4b7a('0x6')]=_0x3e40b2[_0x4b7a('0x7')];this[_0x4b7a('0x8')]=_0x3e40b2[_0x4b7a('0x8')];this[_0x4b7a('0x9')]=_0x4b7a('0x6');this[_0x4b7a('0xa')]=![];this['membername']=_[_0x4b7a('0x3')](_0x35a555[_0x4b7a('0xb')])?undefined:_0x35a555[_0x4b7a('0xb')][_0x4b7a('0x7')];this[_0x4b7a('0xc')]=this[_0x4b7a('0xd')]?util[_0x4b7a('0xe')](_0x4b7a('0xf'),this[_0x4b7a('0xd')]):_0x15314b||undefined;this[_0x4b7a('0x10')]=checkNameSurname(_0x35a555['Contact']['phone'],_0x35a555['Contact'][_0x4b7a('0x11')],_0x35a555[_0x4b7a('0x12')][_0x4b7a('0x13')]);this[_0x4b7a('0x14')]=_0x35a555['active']||![];this[_0x4b7a('0x15')]=_0x35a555['Contact'][_0x4b7a('0x16')];this[_0x4b7a('0x17')]=_0x35a555['scheduledat'];this[_0x4b7a('0x18')]=_0x35a555[_0x4b7a('0x18')]||0x0;this[_0x4b7a('0x19')]=_0x35a555[_0x4b7a('0x19')]||0x0;this['countnoanswerretry']=_0x35a555['countnoanswerretry']||0x0;this[_0x4b7a('0x1a')]=(_0x35a555[_0x4b7a('0x18')]||0x0)+(_0x35a555[_0x4b7a('0x19')]||0x0)+(_0x35a555[_0x4b7a('0x1b')]||0x0)+(_0x35a555[_0x4b7a('0x1c')]||0x0)+(_0x35a555[_0x4b7a('0x1d')]||0x0)+(_0x35a555[_0x4b7a('0x1e')]||0x0)+(_0x35a555[_0x4b7a('0x1f')]||0x0)+(_0x35a555[_0x4b7a('0x20')]||0x0);this['countnosuchnumberretry']=_0x35a555[_0x4b7a('0x1c')]||0x0;this[_0x4b7a('0x1d')]=_0x35a555[_0x4b7a('0x1d')]||0x0;this[_0x4b7a('0x1e')]=_0x35a555['countabandonedretry']||0x0;this[_0x4b7a('0x1f')]=_0x35a555[_0x4b7a('0x1f')]||0x0;this[_0x4b7a('0x20')]=_0x35a555['countagentrejectretry']||0x0;this['callback']=_0x35a555[_0x4b7a('0x21')];this[_0x4b7a('0x22')]=_0x35a555[_0x4b7a('0x22')];this['callbackat']=_0x35a555[_0x4b7a('0x23')];this[_0x4b7a('0x24')]=_0x35a555[_0x4b7a('0x24')];this[_0x4b7a('0x25')]=_0x35a555['ContactId'];this['ListId']=_0x35a555[_0x4b7a('0x26')];this['UserId']=_['isNil'](_0x35a555[_0x4b7a('0xb')])?_0x35a555['UserId']:_0x35a555['Agent']['id'];this[_0x4b7a('0x27')]=_0x35a555['VoiceQueueId'];this[_0x4b7a('0x28')]='';this[_0x4b7a('0x29')]='';}Action[_0x4b7a('0x2a')][_0x4b7a('0x2b')]=function(){return util[_0x4b7a('0xe')](_0x4b7a('0x2c'),this['calleridname'],this['number']);};module[_0x4b7a('0x2d')]=Action; \ No newline at end of file +var _0x4b02=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','format','\x22%s\x22\x20<%s>','exports','util','lodash','moment','string','uniqueid','idContact','queue','name','type','dialAnswer','isNil','Agent','channelAgent','membername','SIP/%s','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callbackuniqueid'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4b02,0x1d9));var _0x24b0=function(_0x4fbcf8,_0x43828c){_0x4fbcf8=_0x4fbcf8-0x0;var _0x1d148b=_0x4b02[_0x4fbcf8];return _0x1d148b;};'use strict';var util=require(_0x24b0('0x0'));var _=require(_0x24b0('0x1'));var moment=require(_0x24b0('0x2'));function checkNameSurname(_0xa51fc4,_0x37b2e1,_0x10d7af){var _0xbd896d='';if(!_['isNil'](_0x37b2e1)&&_0x24b0('0x3')===typeof _0x37b2e1){_0xbd896d+=_0x37b2e1;}if(!_['isNil'](_0x10d7af)&&_0x24b0('0x3')===typeof _0x10d7af){_0xbd896d+='\x20'+_0x10d7af;}if(_0xbd896d!==''){return _0xbd896d;}return _0xa51fc4;}function Action(_0x42aba5,_0x26c0db,_0x41b1a0,_0x1a2a23,_0x2182aa){this[_0x24b0('0x4')]=_0x41b1a0||undefined;this[_0x24b0('0x5')]=_0x42aba5['id'];this[_0x24b0('0x6')]=_0x26c0db[_0x24b0('0x7')];this['type']=_0x26c0db[_0x24b0('0x8')];this['campaigntype']=_0x24b0('0x6');this[_0x24b0('0x9')]=![];this['membername']=_[_0x24b0('0xa')](_0x42aba5[_0x24b0('0xb')])?undefined:_0x42aba5[_0x24b0('0xb')][_0x24b0('0x7')];this[_0x24b0('0xc')]=this[_0x24b0('0xd')]?util['format'](_0x24b0('0xe'),this['membername']):_0x1a2a23||undefined;this['calleridname']=checkNameSurname(_0x42aba5[_0x24b0('0xf')]['phone'],_0x42aba5['Contact']['firstName'],_0x42aba5['Contact'][_0x24b0('0x10')]);this[_0x24b0('0x11')]=_0x42aba5['active']||![];this[_0x24b0('0x12')]=_0x42aba5['Contact'][_0x24b0('0x13')];this['scheduledat']=_0x42aba5[_0x24b0('0x14')];this[_0x24b0('0x15')]=_0x42aba5['countbusyretry']||0x0;this['countcongestionretry']=_0x42aba5[_0x24b0('0x16')]||0x0;this[_0x24b0('0x17')]=_0x42aba5[_0x24b0('0x17')]||0x0;this[_0x24b0('0x18')]=(_0x42aba5[_0x24b0('0x15')]||0x0)+(_0x42aba5['countcongestionretry']||0x0)+(_0x42aba5['countnoanswerretry']||0x0)+(_0x42aba5[_0x24b0('0x19')]||0x0)+(_0x42aba5[_0x24b0('0x1a')]||0x0)+(_0x42aba5[_0x24b0('0x1b')]||0x0)+(_0x42aba5[_0x24b0('0x1c')]||0x0)+(_0x42aba5['countagentrejectretry']||0x0);this[_0x24b0('0x19')]=_0x42aba5[_0x24b0('0x19')]||0x0;this[_0x24b0('0x1a')]=_0x42aba5[_0x24b0('0x1a')]||0x0;this[_0x24b0('0x1b')]=_0x42aba5['countabandonedretry']||0x0;this[_0x24b0('0x1c')]=_0x42aba5[_0x24b0('0x1c')]||0x0;this['countagentrejectretry']=_0x42aba5[_0x24b0('0x1d')]||0x0;this['callback']=_0x42aba5['callback'];this[_0x24b0('0x1e')]=_0x42aba5[_0x24b0('0x1e')];this['callbackat']=_0x42aba5[_0x24b0('0x1f')];this[_0x24b0('0x20')]=_0x42aba5[_0x24b0('0x20')];this[_0x24b0('0x21')]=_0x42aba5[_0x24b0('0x21')];this[_0x24b0('0x22')]=_0x42aba5[_0x24b0('0x22')];this[_0x24b0('0x23')]=_[_0x24b0('0xa')](_0x42aba5[_0x24b0('0xb')])?_0x42aba5[_0x24b0('0x23')]:_0x42aba5[_0x24b0('0xb')]['id'];this[_0x24b0('0x24')]=_0x42aba5[_0x24b0('0x24')];this[_0x24b0('0x25')]='';this['originatecalleridname']='';}Action['prototype'][_0x24b0('0x26')]=function(){return util[_0x24b0('0x27')](_0x24b0('0x28'),this['calleridname'],this['number']);};module[_0x24b0('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ebaa0b6..bd5bf30 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 _0x0faf=['trunks','actions','agents','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','acw','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','countglobal','Busy','busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','countagentrejectretry','custom:agentreject','cloneAction','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','SIP/%s','unmonitored','run','execRun','pick','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','YYYY-MM-DD\x20HH:mm:ss','Action','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','addVariable','variables','filterKey','variable','keys','value','error','inspect','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','localhost','prototype','enqueue','tail','finally','campaignsPreview'];(function(_0x372ae0,_0x2efa78){var _0x390c44=function(_0x139dab){while(--_0x139dab){_0x372ae0['push'](_0x372ae0['shift']());}};_0x390c44(++_0x2efa78);}(_0x0faf,0x132));var _0xf0fa=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x0faf[_0x528497];return _0x392d59;};'use strict';var util=require(_0xf0fa('0x0'));var _=require('lodash');var BPromise=require(_0xf0fa('0x1'));var uuid=require(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var md5=require(_0xf0fa('0x4'));var Redis=require(_0xf0fa('0x5'));var config=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var loggerAction=require(_0xf0fa('0x7'))('actionPreview');var ami=require(_0xf0fa('0x9'));var rpcDb=require(_0xf0fa('0xa'));var Action=require(_0xf0fa('0xb'));var ut=require(_0xf0fa('0xc'));config[_0xf0fa('0xd')]=_['defaults'](config[_0xf0fa('0xd')],{'host':_0xf0fa('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf0fa('0xf')][_0xf0fa('0x10')]=function(_0x25dfec){this[_0xf0fa('0x11')]=this[_0xf0fa('0x11')]?this[_0xf0fa('0x11')][_0xf0fa('0x12')](_0x25dfec):_0x25dfec();};function Preview(_0x20fd09){this['sequence']=new Sequence();this[_0xf0fa('0x13')]=_0x20fd09['voiceQueues'];this[_0xf0fa('0x14')]=_0x20fd09['trunks'];this[_0xf0fa('0x15')]={};this[_0xf0fa('0x16')]=_0x20fd09[_0xf0fa('0x16')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xf0fa('0x17')]['bind'](this));ami['on'](_0xf0fa('0x18'),this[_0xf0fa('0x19')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1b'),this[_0xf0fa('0x1c')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1d'),this[_0xf0fa('0x1e')]['bind'](this));ami['on'](_0xf0fa('0x1f'),this[_0xf0fa('0x20')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x21'),this[_0xf0fa('0x22')][_0xf0fa('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x23'),this[_0xf0fa('0x24')][_0xf0fa('0x1a')](this));this[_0xf0fa('0x25')](this[_0xf0fa('0x13')]);}function emit(_0x32c9bc,_0x3de639,_0x3b87a2){io['to'](_0x32c9bc)[_0xf0fa('0x26')](_0x3de639,_0x3b87a2);}function emitCampaignPreview(_0x1878c4){if(_0x1878c4['type']===_0xf0fa('0x27')){var _0x306f3e={'id':_0x1878c4['id'],'name':_0x1878c4[_0xf0fa('0x28')],'strategy':_0x1878c4[_0xf0fa('0x29')],'answered':_0x1878c4[_0xf0fa('0x2a')],'available':_0x1878c4[_0xf0fa('0x2b')],'loggedIn':_0x1878c4[_0xf0fa('0x2c')],'pTalking':_0x1878c4[_0xf0fa('0x2d')],'sumBillable':_0x1878c4[_0xf0fa('0x2e')],'sumDuration':_0x1878c4['sumDuration'],'sumHoldTime':_0x1878c4[_0xf0fa('0x2f')]||0x0,'talking':_0x1878c4[_0xf0fa('0x30')],'total':_0x1878c4['total'],'type':_0x1878c4[_0xf0fa('0x31')],'unmanaged':_0x1878c4[_0xf0fa('0x32')],'abandoned':_0x1878c4[_0xf0fa('0x33')],'waiting':_0x1878c4['waiting'],'loggedInDb':_0x1878c4[_0xf0fa('0x34')],'dialActive':_0x1878c4[_0xf0fa('0x35')],'dialMethod':_0x1878c4[_0xf0fa('0x36')],'dialOriginateCallerIdName':_0x1878c4[_0xf0fa('0x37')],'dialOriginateCallerIdNumber':_0x1878c4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1878c4['dialOriginateTimeout'],'dialPrefix':_0x1878c4[_0xf0fa('0x38')],'outboundAnswerAgiCallsDay':_0x1878c4[_0xf0fa('0x39')],'outboundAnswerCallsDay':_0x1878c4[_0xf0fa('0x3a')],'outboundBlacklistCallsDay':_0x1878c4[_0xf0fa('0x3b')],'outboundBusyCallsDay':_0x1878c4['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1878c4[_0xf0fa('0x3c')],'outboundDropCallsDayACS':_0x1878c4[_0xf0fa('0x3d')],'outboundDropCallsDayCallersExit':_0x1878c4[_0xf0fa('0x3e')],'outboundDropCallsDayTimeout':_0x1878c4['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1878c4[_0xf0fa('0x3f')],'outboundNoSuchCallsDay':_0x1878c4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1878c4[_0xf0fa('0x40')],'outboundReCallsDay':_0x1878c4[_0xf0fa('0x41')],'outboundRejectCallsDay':_0x1878c4[_0xf0fa('0x42')],'outboundUnknownCallsDay':_0x1878c4['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1878c4[_0xf0fa('0x43')],'predictiveIntervalAnsweredCalls':_0x1878c4[_0xf0fa('0x44')],'predictiveIntervalAvgHoldtime':_0x1878c4[_0xf0fa('0x45')],'predictiveIntervalAvgTalktime':_0x1878c4[_0xf0fa('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x1878c4[_0xf0fa('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x1878c4[_0xf0fa('0x48')],'predictiveIntervalErlangCalls':_0x1878c4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1878c4['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1878c4[_0xf0fa('0x49')],'predictiveIntervalMultiplicativeFactor':_0x1878c4[_0xf0fa('0x4a')],'predictiveIntervalPauses':_0x1878c4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1878c4[_0xf0fa('0x4b')],'predictiveIntervalTotalCalls':_0x1878c4['predictiveIntervalTotalCalls'],'message':_0x1878c4['message'],'originated':_0x1878c4['originated'],'erlangCalls':_0x1878c4[_0xf0fa('0x4c')],'erlangCallToSecond':_0x1878c4['erlangCallToSecond'],'erlangAbandonmentRate':_0x1878c4[_0xf0fa('0x4d')],'erlangBusyFactor':_0x1878c4[_0xf0fa('0x4e')],'startPredictive':_0x1878c4[_0xf0fa('0x4f')],'startProgressive':_0x1878c4[_0xf0fa('0x50')]};if(_0x1878c4[_0xf0fa('0x51')]){_0x306f3e[_0xf0fa('0x51')]={'id':_0x1878c4[_0xf0fa('0x51')]['id'],'name':_0x1878c4[_0xf0fa('0x51')]['name'],'active':_0x1878c4[_0xf0fa('0x51')][_0xf0fa('0x52')],'callerid':_0x1878c4[_0xf0fa('0x51')]['callerid']};}if(_0x1878c4[_0xf0fa('0x53')]){_0x306f3e[_0xf0fa('0x53')]={'id':_0x1878c4[_0xf0fa('0x53')]['id'],'name':_0x1878c4[_0xf0fa('0x53')]['name']};}var _0x5c474e=md5(JSON[_0xf0fa('0x54')](_0x306f3e));if(_0x1878c4[_0xf0fa('0x4')]!==_0x5c474e){_0x1878c4[_0xf0fa('0x4')]=_0x5c474e;emit(util[_0xf0fa('0x55')](_0xf0fa('0x56'),_0x306f3e['name']),'voice_queue:save',_0x306f3e);}}}function emitVoiceQueueChannelRemove(_0x5a2be0){logger['info'](_0xf0fa('0x57'),JSON[_0xf0fa('0x54')](_0x5a2be0));emit(util['format']('voice:queue:%s',_0x5a2be0[_0xf0fa('0x28')]),_0xf0fa('0x58'),_0x5a2be0);io[_0xf0fa('0x26')](_0xf0fa('0x59'),_0x5a2be0);}function notSendMessagesQueue(_0x2202de){if(_0x2202de[_0xf0fa('0x5a')]){if(_0x2202de[_0xf0fa('0x5b')]===0x0&&_0x2202de['pTalking']===0x0){_0x2202de['sendMessageOneNotActive']=![];_0x2202de[_0xf0fa('0x2b')]=0x0;_0x2202de[_0xf0fa('0x5c')]=0x0;_0x2202de[_0xf0fa('0x5d')]=_0xf0fa('0x5e');ut[_0xf0fa('0x5f')](_0xf0fa('0x60'),_0x2202de['name']+_0xf0fa('0x61'));}else{_0x2202de['message']=_0xf0fa('0x62');ut[_0xf0fa('0x5f')](_0xf0fa('0x60'),_0x2202de[_0xf0fa('0x28')]+_0xf0fa('0x63'));}emitCampaignPreview(_0x2202de);}}Preview[_0xf0fa('0xf')][_0xf0fa('0x25')]=function(){var _0x36778f=this;setInterval(function(){_0x36778f[_0xf0fa('0x64')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x52221a=this[_0xf0fa('0x13')];this[_0xf0fa('0x65')]+=0x1;for(var _0x53667f in _0x52221a){if(_0x52221a[_0xf0fa('0x66')](_0x53667f)&&(_0x52221a[_0x53667f][_0xf0fa('0x36')]===_0xf0fa('0x8')||_0x52221a[_0x53667f][_0xf0fa('0x36')]==='booked')&&_0x52221a[_0x53667f][_0xf0fa('0x31')]===_0xf0fa('0x27')){if(this[_0xf0fa('0x65')]>0x7){this[_0xf0fa('0x65')]=0x0;this[_0xf0fa('0x67')]();}}if(_0x52221a[_0xf0fa('0x66')](_0x53667f)&&_0x52221a[_0x53667f][_0xf0fa('0x36')]===_0xf0fa('0x8')&&_0x52221a[_0x53667f][_0xf0fa('0x31')]==='outbound'){if(_0x52221a[_0x53667f][_0xf0fa('0x35')]){this[_0xf0fa('0x68')](_0x52221a[_0x53667f]);if(_0x52221a[_0x53667f][_0xf0fa('0x69')])this[_0xf0fa('0x6a')](_0x52221a[_0x53667f]);}else{notSendMessagesQueue(_0x52221a[_0x53667f]);}}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x6b')]=function(_0x53b2a6){var _0xd86643=this;this[_0xf0fa('0x6c')]['enqueue'](function(){if(!_[_0xf0fa('0x6d')](_0xd86643[_0xf0fa('0x15')][_0x53b2a6])){loggerAction[_0xf0fa('0x6e')](_0xf0fa('0x6f'),_0x53b2a6,_0xf0fa('0x70'),_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')],_0xf0fa('0x72'),JSON[_0xf0fa('0x54')](_0xd86643['campaignsPreview'][_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['queue']][_0xf0fa('0x5b')]),_0xf0fa('0x73'),JSON[_0xf0fa('0x54')](_0xd86643['campaignsPreview'][_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')]][_0xf0fa('0x2d')]),JSON[_0xf0fa('0x54')](_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['dialAnswer']),JSON[_0xf0fa('0x54')](_['pick'](_0xd86643[_0xf0fa('0x15')][_0x53b2a6],[_0xf0fa('0x74'),_0xf0fa('0x75'),_0xf0fa('0x76'),_0xf0fa('0x77')])));return ami['Action']({'action':_0xf0fa('0x78'),'channel':_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x79')]})[_0xf0fa('0x7a')](function(_0x1002e1){if(_0x1002e1[_0xf0fa('0x5d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xd86643[_0xf0fa('0x15')][_0x53b2a6]){ut['updateOriginated'](_0xd86643['campaignsPreview'][_0xd86643['actions'][_0x53b2a6][_0xf0fa('0x71')]],_0xf0fa('0x7b'));if(_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x7c')]===!![]){ut[_0xf0fa('0x7d')](_0xd86643[_0xf0fa('0x13')][_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')]],_0xf0fa('0x7b'));ut['loggerError'](_0xf0fa('0x7e')+_0x53b2a6,_0xd86643['actions'][_0x53b2a6][_0xf0fa('0x71')]);}ut[_0xf0fa('0x7f')](_0xf0fa('0x80')+_0x53b2a6,_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['queue']);delete _0xd86643[_0xf0fa('0x15')][_0x53b2a6];}},0x2328);}});}});};Preview['prototype'][_0xf0fa('0x67')]=function(){var _0x398ea0=this;loggerAction[_0xf0fa('0x6e')](_0xf0fa('0x81'),_[_0xf0fa('0x82')](this[_0xf0fa('0x15')]));for(var _0x4fa721 in this[_0xf0fa('0x15')]){if(_0x398ea0[_0xf0fa('0x15')]['hasOwnProperty'](_0x4fa721)){_0x398ea0[_0xf0fa('0x6b')](_0x4fa721);}}};Preview[_0xf0fa('0xf')]['recallMe']=function(_0x48d769){var _0x2857ae=this;rpcDb['getContactRecallMe'](_0x48d769['id'],ut[_0xf0fa('0x83')](this[_0xf0fa('0x16')]))[_0xf0fa('0x84')](function(_0x4db972){if(!_[_0xf0fa('0x6d')](_0x4db972)){for(var _0x190f2b=0x0;_0x190f2b<_0x4db972['length'];_0x190f2b+=0x1){if(ut[_0xf0fa('0x85')](_0x4db972[_0x190f2b][_0xf0fa('0x86')])<_0x48d769[_0xf0fa('0x87')]*0x3c){if(_0x4db972[_0x190f2b]['Agent']&&!_0x4db972[_0x190f2b][_0xf0fa('0x88')][_0xf0fa('0x89')]){_0x2857ae['run'](_0x4db972[_0x190f2b]['id'])[_0xf0fa('0x84')](ut[_0xf0fa('0x8a')](_0xf0fa('0x8b')))[_0xf0fa('0x7a')](ut[_0xf0fa('0x8a')](_0xf0fa('0x8b')));}else{rpcDb[_0xf0fa('0x8c')](_0x4db972[_0x190f2b]['id']);}}else{var _0x337640=new Action(_0x4db972[_0x190f2b],_0x48d769);_0x337640[_0xf0fa('0x8d')]=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x48d769[_0xf0fa('0x41')]+=0x1;ut[_0xf0fa('0x8e')](_0x337640,0x17,_0xf0fa('0x8f'));if(_0x48d769[_0xf0fa('0x90')]){rpcDb[_0xf0fa('0x91')](ut[_0xf0fa('0x92')](_0x4db972[_0x190f2b]));rpcDb[_0xf0fa('0x93')](_0x337640,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xf0fa('0x8e')](_0x337640,0x16,_0xf0fa('0x94'));rpcDb[_0xf0fa('0x93')](_0x337640,_0xf0fa('0x95'));rpcDb[_0xf0fa('0x96')](_0x337640,_0xf0fa('0x95'));}}}}})[_0xf0fa('0x7a')](ut['logger2'](_0xf0fa('0x97')));};Preview[_0xf0fa('0xf')][_0xf0fa('0x68')]=function(_0x1f608e){_0x1f608e[_0xf0fa('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x1f608e['loggedIn'])){_0x1f608e['message']=_0xf0fa('0x98');}else if(!ut[_0xf0fa('0x99')](_0x1f608e[_0xf0fa('0x35')])){_0x1f608e[_0xf0fa('0x5d')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x1f608e[_0xf0fa('0x51')])){if(!this['isTrunkReachable'](_0x1f608e[_0xf0fa('0x9a')])){_0x1f608e[_0xf0fa('0x5d')]=_0xf0fa('0x9b');}else{_0x1f608e[_0xf0fa('0x5d')]=_0xf0fa('0x9c');}}else{_0x1f608e['message']=_0xf0fa('0x9c');}emitCampaignPreview(_0x1f608e);};Preview[_0xf0fa('0xf')][_0xf0fa('0x9d')]=function(_0x147f71,_0x3e3f6b,_0x43bad2){var _0x30f0fe=this;var _0x35e7e7=this[_0xf0fa('0x15')][_0x3e3f6b];var _0x4c2fdd=this['campaignsPreview'][_0x35e7e7[_0xf0fa('0x71')]];var _0x4d8d2f;if(_0x4c2fdd){switch(_0x43bad2){case'1':_0x4c2fdd[_0xf0fa('0x9e')]+=0x1;_0x35e7e7['countnosuchnumberretry']+=0x1;_0x35e7e7['countglobal']=ut['totalGlobal'](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x0,_0xf0fa('0x9f'));ami[_0xf0fa('0x26')](_0xf0fa('0xa0'),ut[_0xf0fa('0xa1')](_0x35e7e7,_0xf0fa('0xa2')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xa3'));if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xa7'));}else{if(_0x35e7e7['countnosuchnumberretry']>=_0x4c2fdd[_0xf0fa('0xa8')]){rpcDb['createCustomerFinal'](_0x35e7e7,_0xf0fa('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xa9')](_0x35e7e7,_0xf0fa('0xaa'),_0x4c2fdd[_0xf0fa('0xab')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}delete this['actions'][_0x147f71['linkedid']];break;case _0xf0fa('0xae'):var _0x157772=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x35e7e7[_0xf0fa('0xaf')]=_0x157772;_0x35e7e7[_0xf0fa('0xb0')]=_0x157772;_0x35e7e7[_0xf0fa('0x7c')]=!![];_0x4c2fdd[_0xf0fa('0x2d')]+=0x1;logger[_0xf0fa('0x6e')]('[syncHangup][talking][increment]',_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd[_0xf0fa('0x28')],'pTalking:\x20',_0x4c2fdd['pTalking']);ami[_0xf0fa('0x26')](_0xf0fa('0xb3'),ut['buildObj'](_0x35e7e7,'connect',this[_0xf0fa('0x13')][_0x35e7e7[_0xf0fa('0x71')]]));if(_0x4c2fdd[_0xf0fa('0xb4')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x35e7e7));}break;case'16':ami[_0xf0fa('0x26')]('custom:agentcomplete',ut['buildObj'](_0x35e7e7,_0xf0fa('0xb5'),this[_0xf0fa('0x13')][_0x35e7e7[_0xf0fa('0x71')]]));emitVoiceQueueChannelRemove(ut[_0xf0fa('0xa1')](_0x35e7e7,_0xf0fa('0xb5')));_0x4c2fdd[_0xf0fa('0x3a')]+=0x1;_0x4c2fdd['total']+=0x1;_0x4c2fdd[_0xf0fa('0x2a')]+=0x1;ut[_0xf0fa('0x7d')](_0x4c2fdd,_0xf0fa('0xb6'));_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0x4,'Answer');rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x35e7e7,_0xf0fa('0xb7'));rpcDb[_0xf0fa('0xb8')](_0x35e7e7);_0x4c2fdd[_0xf0fa('0xb9')]+=_0x35e7e7['talktime'];_0x4c2fdd[_0xf0fa('0x2e')]+=_0x35e7e7[_0xf0fa('0xba')];logger['info'](_0xf0fa('0xbb'),_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4c2fdd[_0xf0fa('0x2d')]);delete this['actions'][_0x147f71[_0xf0fa('0xbc')]];break;case'BUSY':_0x4c2fdd[_0xf0fa('0xbd')]+=0x1;_0x35e7e7[_0xf0fa('0xbe')]+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x5,_0xf0fa('0xc0'));ami[_0xf0fa('0x26')]('custom:agentbusy',ut['buildObj'](_0x35e7e7,_0xf0fa('0xc1')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x35e7e7['countbusyretry']>=_0x4c2fdd[_0xf0fa('0xc2')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xc3'));}else{rpcDb[_0xf0fa('0xc4')](ut[_0xf0fa('0xa9')](_0x35e7e7,_0xf0fa('0xbe'),_0x4c2fdd['dialBusyRetryFrequency']),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'NOANSWER':_0x4c2fdd[_0xf0fa('0x3f')]+=0x1;_0x35e7e7['countnoanswerretry']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut['totalGlobal'](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0x3,_0xf0fa('0xc5'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x35e7e7,'noanswer'));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xc6'));}else{if(_0x35e7e7[_0xf0fa('0xc7')]>=_0x4c2fdd['dialNoAnswerMaxRetry']){rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,_0xf0fa('0xc7'),_0x4c2fdd[_0xf0fa('0xc8')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'CONGESTION':_0x4c2fdd['outboundCongestionCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xc9')]+=0x1;_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x8,_0xf0fa('0xca'));ami['emit'](_0xf0fa('0xcb'),ut['buildObj'](_0x35e7e7,_0xf0fa('0xcc')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xcd'));if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x35e7e7[_0xf0fa('0xc9')]>=_0x4c2fdd[_0xf0fa('0xce')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xa9')](_0x35e7e7,'countcongestionretry',_0x4c2fdd['dialBusyRetryFrequency']),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'CANCEL':_0x4c2fdd['outboundRejectCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xcf')]+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut['totalGlobal'](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x14,'AgentReject');ami[_0xf0fa('0x26')](_0xf0fa('0xd0'),ut['buildObj'](_0x35e7e7,'agentreject'));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[syncHangupRequest][logAgentReject]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xd2'));}else{if(_0x35e7e7['countagentrejectretry']>=_0x4c2fdd[_0xf0fa('0xd3')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,_0xf0fa('0xcf'),_0x4c2fdd[_0xf0fa('0xd4')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'ABANDONED':_0x4c2fdd['outboundAbandonedCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xd5')]+=0x1;_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0xb,'Abandoned');rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,'Global');rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xd6'));}else{if(_0x35e7e7['countabandonedetry']>=_0x4c2fdd[_0xf0fa('0xd7')]){rpcDb['createCustomerFinal'](_0x35e7e7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,'countabandonedretry',_0x4c2fdd[_0xf0fa('0xd8')]),_0x35e7e7['unlockAgent'],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'18':_0x4c2fdd[_0xf0fa('0xd9')]+=0x1;_0x35e7e7['countmachineretry']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x12,_0x147f71['cause-txt']||_0x147f71[_0xf0fa('0xda')]);ami[_0xf0fa('0x26')]('custom:amd',ut['buildObj'](_0x35e7e7,_0xf0fa('0xdb')));rpcDb['createCustomerHistory'](_0x35e7e7,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xdc'));}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xdc'));}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];break;case'19':_0x4c2fdd['outboundUnknownCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x13,_0x147f71[_0xf0fa('0xdd')]||_0x147f71[_0xf0fa('0xda')]);ami[_0xf0fa('0x26')](_0xf0fa('0xde'),ut[_0xf0fa('0xa1')](_0x35e7e7,'amd'));rpcDb['createCustomerHistory'](_0x35e7e7,_0xf0fa('0xdf'));if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xdf'));}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xdf'));}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];break;default:if(_0x35e7e7['dialAnswer']){ut['decrementTalkink'](_0x4c2fdd,'[default]');ut['loggerError'](_0xf0fa('0xe0')+_0x4c2fdd[_0xf0fa('0x28')],_0x147f71);}_0x4c2fdd['outboundUnknownCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0xc,_0x147f71['cause-txt']||_0x147f71['dialstatus']);rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xe1'));if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];}if(!(_0x35e7e7[_0xf0fa('0x7c')]&&_0x43bad2==='16')){ut[_0xf0fa('0xe2')](_0x4c2fdd,_0xf0fa('0xe3'));logger[_0xf0fa('0x6e')](_0xf0fa('0xe4'),_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd['name'],_0xf0fa('0x72'),_0x4c2fdd['originated']);}if(_0x43bad2!=='ANSWER'){delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];delete this['actions'][_0x147f71[_0xf0fa('0xe5')]];}}};Preview[_0xf0fa('0xf')]['callProgressDetectingAgent']=function(_0x10aa45,_0x9a7e50,_0x1d4106){if(_['isUndefined'](_0x9a7e50)&&_0xf0fa('0xe6')!==typeof _0x9a7e50){return;}if(_[_0xf0fa('0xe7')](_0x1d4106)&&_0xf0fa('0xe6')!==typeof _0x1d4106){return;}switch(_0x1d4106['reason']){case'0':ut[_0xf0fa('0xe8')](_0x10aa45,0x0,_0xf0fa('0x9f'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xea'));break;case'3':ut[_0xf0fa('0xe8')](_0x10aa45,0x3,_0xf0fa('0xc5'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xeb'));break;case'5':ut[_0xf0fa('0xe8')](_0x10aa45,0x5,_0xf0fa('0xc0'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xec'));break;case'8':ut[_0xf0fa('0xe8')](_0x10aa45,0x8,_0xf0fa('0xca'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xed'));break;case'22':ut[_0xf0fa('0xe8')](_0x10aa45,0x16,_0xf0fa('0xee'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xef'));break;default:ut[_0xf0fa('0xe8')](_0x10aa45,0xc,_0x1d4106[_0xf0fa('0xf0')]);rpcDb[_0xf0fa('0xe9')](_0x10aa45,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x9a7e50,_0xf0fa('0xf1'));logger[_0xf0fa('0x6e')](_0xf0fa('0xf2'),_0x10aa45[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x9a7e50[_0xf0fa('0x28')],_0xf0fa('0x72'),_0x9a7e50[_0xf0fa('0x5b')]);delete this[_0xf0fa('0x15')][_0x10aa45[_0xf0fa('0xb1')]];};Preview[_0xf0fa('0xf')][_0xf0fa('0xf3')]=function(_0x4bee69,_0x2b6960,_0x4c85b9,_0x35fd94,_0x3269eb){var _0x573371=this;return new BPromise(function(_0x19c928,_0x32ba2a){if(_[_0xf0fa('0x6d')](_0x2b6960)||_[_0xf0fa('0x6d')](_0x2b6960[_0xf0fa('0xf4')])||_[_0xf0fa('0x6d')](_0x2b6960[_0xf0fa('0xf4')]['phone'])||_['isNil'](_0x2b6960[_0xf0fa('0x76')])){_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0xf5'),_0x35fd94,_0x3269eb));return;}var _0x5b6a68=uuid['v4']();var _0x19e455=_0x573371[_0xf0fa('0x13')][_0x2b6960[_0xf0fa('0x70')][_0xf0fa('0x28')]];var _0x3c906e=_0x4c85b9?_0x573371[_0xf0fa('0x16')][_0x4c85b9]['id']:undefined;_0x573371[_0xf0fa('0x15')][_0x5b6a68]=new Action(_0x2b6960,_0x19e455,_0x5b6a68,_0x4c85b9,_0x3c906e);var _0x36c5e3=_0x573371[_0xf0fa('0x15')][_0x5b6a68];_0x36c5e3[_0xf0fa('0xac')]=_0x35fd94;_0x36c5e3['activeContact']=_0x3269eb;_0x36c5e3[_0xf0fa('0xf6')]=_0x4c85b9;if(_['isEmpty'](_0x4bee69)){_0x573371[_0xf0fa('0xf7')](_0x36c5e3,_0x19e455,_0x2b6960,_0x4c85b9)[_0xf0fa('0x84')](function(_0x958a0a){logger[_0xf0fa('0x6e')](_0xf0fa('0xf8'),_0xf0fa('0xf9')+_0x36c5e3[_0xf0fa('0x71')]+_0xf0fa('0xfa')+_0x36c5e3['idContact'],JSON['stringify'](_0x958a0a));ami[_0xf0fa('0x26')](_0xf0fa('0xfb'),ut[_0xf0fa('0xa1')](_0x36c5e3,_0xf0fa('0xfc'),_0x573371[_0xf0fa('0x13')][_0x36c5e3[_0xf0fa('0x71')]]));_0x19c928(ut[_0xf0fa('0x5d')]('Calling'));})[_0xf0fa('0x7a')](function(_0x3cafd3){ut[_0xf0fa('0x5f')](_0xf0fa('0xfd'),_0x3cafd3);_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0xfe'),_0x35fd94,_0x3269eb));});}else{_0x19e455[_0xf0fa('0x3b')]+=0x1;ut['logBlacklist'](_0x36c5e3);rpcDb[_0xf0fa('0xff')](_0x36c5e3,_0xf0fa('0x100'));delete _0x573371[_0xf0fa('0x15')][_0x5b6a68];_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0x101'),_0x35fd94,_0x3269eb));}});};Preview['prototype'][_0xf0fa('0x102')]=function(_0x5b40d9){return!_[_0xf0fa('0x6d')](_0x5b40d9)&&!_[_0xf0fa('0x6d')](_0x5b40d9[_0xf0fa('0x28')])&&!_['isNil'](_0x5b40d9['active'])&&_0x5b40d9[_0xf0fa('0x52')]&&!_[_0xf0fa('0x6d')](this[_0xf0fa('0x14')][util[_0xf0fa('0x55')]('SIP/%s',_0x5b40d9[_0xf0fa('0x28')])])&&!_[_0xf0fa('0x6d')](this[_0xf0fa('0x14')][util[_0xf0fa('0x55')](_0xf0fa('0x103'),_0x5b40d9[_0xf0fa('0x28')])]['status'])&&(this[_0xf0fa('0x14')][util['format']('SIP/%s',_0x5b40d9[_0xf0fa('0x28')])][_0xf0fa('0x78')]==='reachable'||this[_0xf0fa('0x14')][util['format'](_0xf0fa('0x103'),_0x5b40d9['name'])]['status']===_0xf0fa('0x104'));};Preview[_0xf0fa('0xf')][_0xf0fa('0x105')]=function(_0x142b1e,_0xdc3ef9){var _0x187523=this;return new BPromise(function(_0x53b346,_0x9ebd51){_0x187523[_0xf0fa('0x106')](_0x142b1e,_0xdc3ef9)[_0xf0fa('0x84')](function(_0x38811c){_0x53b346(_[_0xf0fa('0x107')](_0x38811c,[_0xf0fa('0x5d')]));})[_0xf0fa('0x7a')](function(_0x41fdf9){if(_0x41fdf9['unlock']){rpcDb[_0xf0fa('0x108')](_0x142b1e);}if(_0x41fdf9[_0xf0fa('0x52')]){rpcDb[_0xf0fa('0x8c')](_0x142b1e);}_0x9ebd51(_[_0xf0fa('0x107')](_0x41fdf9,[_0xf0fa('0x5d')]));});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x106')]=function(_0x616338,_0x114487){var _0xe0bb72=this;return new BPromise(function(_0x27c397,_0x49448a){var _0x29b1e9,_0x5c8e7b;rpcDb[_0xf0fa('0x109')](_0x616338)[_0xf0fa('0x84')](function(_0xb688a1){if(!_[_0xf0fa('0x6d')](_0xb688a1[0x0])){_0x5c8e7b=_0xb688a1[0x0][_0xf0fa('0x10a')]?![]:!![];_0x29b1e9=_0xb688a1[0x0][_0xf0fa('0x10a')]?!![]:![];_0x29b1e9=_0x114487?!![]:_0x29b1e9;}var _0x571a62=_0xe0bb72[_0xf0fa('0x10b')](_0xb688a1);if(_0x571a62[_0xf0fa('0x10c')]){rpcDb[_0xf0fa('0x10d')](_['pick'](_0xb688a1[0x0],[_0xf0fa('0x76'),_0xf0fa('0x10e')]))[_0xf0fa('0x84')](function(_0x4cf660){_0xe0bb72[_0xf0fa('0xf3')](_0x4cf660,_0xb688a1[0x0],_0x114487,_0x5c8e7b,_0x29b1e9)[_0xf0fa('0x84')](function(_0x42caa1){_0x27c397(_0x42caa1);})['catch'](function(_0x212b4a){_0x49448a(_0x212b4a);});})[_0xf0fa('0x7a')](function(_0x44edb5){ut[_0xf0fa('0x5f')](_0xf0fa('0x10f'),_0x44edb5);_0x49448a(ut[_0xf0fa('0x5d')](_0xf0fa('0x110'),_0x5c8e7b,_0x29b1e9));});}else{_0x49448a(ut['message'](_0x571a62['message'],_0x5c8e7b,_0x29b1e9));}})[_0xf0fa('0x7a')](function(_0x5d32f9){ut[_0xf0fa('0x5f')]('[Preview][getContactPreview]',_0x5d32f9);_0x49448a(ut[_0xf0fa('0x5d')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x10b')]=function(_0x5b9e3f){if(_[_0xf0fa('0x6d')](_0x5b9e3f)||_['isEmpty'](_0x5b9e3f)||!_[_0xf0fa('0x6d')](_0x5b9e3f[0x0][_0xf0fa('0x88')])&&_[_0xf0fa('0x6d')](_0x5b9e3f[0x0]['Agent']['name'])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x5b9e3f);return{'isValid':![],'message':_0xf0fa('0x111')};}var _0x4b6acc=this['campaignsPreview'][_0x5b9e3f[0x0][_0xf0fa('0x70')][_0xf0fa('0x28')]];_0x4b6acc[_0xf0fa('0x5d')]=_0xf0fa('0x9c');if(_[_0xf0fa('0x6d')](_0x4b6acc)){ut[_0xf0fa('0x5f')]('[Preview][validateContact][Empty\x20Campaign]',_0x4b6acc);return{'isValid':![],'message':_0xf0fa('0x112')};}if(!this[_0xf0fa('0x102')](_0x4b6acc[_0xf0fa('0x51')])){ut[_0xf0fa('0x5f')](_0xf0fa('0x113'),_0xf0fa('0x114')+_0x4b6acc['name']+_0xf0fa('0x115'));if(!this['isTrunkReachable'](_0x4b6acc[_0xf0fa('0x9a')])){ut[_0xf0fa('0x5f')](_0xf0fa('0x113'),_0x4b6acc[_0xf0fa('0x28')]+_0xf0fa('0x116'));return{'isValid':![],'message':_0xf0fa('0x117')};}}if(!ut[_0xf0fa('0x99')](_0x4b6acc['dialActive'])){ut[_0xf0fa('0x5f')](_0xf0fa('0x118'),_0x4b6acc[_0xf0fa('0x28')]+_0xf0fa('0x119'));return{'isValid':![],'message':_0xf0fa('0x114')+_0x4b6acc[_0xf0fa('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf0fa('0x11a')};};Preview[_0xf0fa('0xf')][_0xf0fa('0xf7')]=function(_0xb9addb,_0x1493d2,_0x223211,_0x3f4f31){var _0x1864a7=this;return new BPromise(function(_0x18d83c,_0x247dba){var _0x1e1a94=_0xb9addb[_0xf0fa('0xb1')];var _0x1b5b8f=_0x1864a7[_0xf0fa('0x102')](_0x1493d2[_0xf0fa('0x51')])?util[_0xf0fa('0x55')]('SIP/%s/%s%s',_0x1493d2[_0xf0fa('0x51')]['name'],_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x38')])?'':_0x1493d2[_0xf0fa('0x38')][_0xf0fa('0x11b')]()||'',_0x1493d2[_0xf0fa('0x11c')]>0x0?_0x223211[_0xf0fa('0xf4')][_0xf0fa('0x11d')][_0xf0fa('0x11e')](_0x1493d2[_0xf0fa('0x11c')]):_0x223211['Contact'][_0xf0fa('0x11d')]):util[_0xf0fa('0x55')](_0xf0fa('0x11f'),_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x9a')])?_0x1493d2[_0xf0fa('0x51')]['name']:_0x1493d2[_0xf0fa('0x9a')][_0xf0fa('0x28')],_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x38')])?'':_0x1493d2['dialPrefix'][_0xf0fa('0x11b')]()||'',_0x1493d2[_0xf0fa('0x11c')]>0x0?_0x223211[_0xf0fa('0xf4')]['phone'][_0xf0fa('0x11e')](_0x1493d2[_0xf0fa('0x11c')]):_0x223211[_0xf0fa('0xf4')][_0xf0fa('0x11d')]);var _0x33a57e=_0x1864a7['isTrunkReachable'](_0x1493d2[_0xf0fa('0x51')])?ut[_0xf0fa('0x120')](_0x1493d2[_0xf0fa('0x51')][_0xf0fa('0x121')],_0x1493d2[_0xf0fa('0x37')],_0x1493d2['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xf0fa('0x122')](_0x1493d2[_0xf0fa('0x123')],_0x1493d2[_0xf0fa('0x124')]):_0x1493d2[_0xf0fa('0x123')]):ut[_0xf0fa('0x120')](_[_0xf0fa('0x6d')](_0x1493d2['TrunkBackup'])?_0x1493d2[_0xf0fa('0x51')]['callerid']:_0x1493d2[_0xf0fa('0x9a')][_0xf0fa('0x121')],_0x1493d2[_0xf0fa('0x37')],_0x1493d2[_0xf0fa('0x124')]>0x0?ut[_0xf0fa('0x122')](_0x1493d2[_0xf0fa('0x123')],_0x1493d2[_0xf0fa('0x124')]):_0x1493d2['dialOriginateCallerIdNumber']);if(_0x33a57e){_0xb9addb[_0xf0fa('0x125')]=ut[_0xf0fa('0x126')](_0x33a57e);_0xb9addb[_0xf0fa('0x127')]=ut['extractCalleridNumber'](_0x33a57e);}var _0x1b3439=ut['addVariables'](_0x1493d2,_0x223211,_0x1b5b8f,_0x33a57e,_0x1e1a94,_0xb9addb);_['merge'](_0xb9addb,ut['toLowerVariables'](_0x1b3439));_0xb9addb[_0xf0fa('0x8d')]=moment()['format'](_0xf0fa('0x128'));ami[_0xf0fa('0x129')](ut['variablesAction'](_0xb9addb,_0x1493d2,_0x1b3439,_0xb9addb['activeContact'],_0x3f4f31))[_0xf0fa('0x84')](function(_0x3a8b55){_0x1493d2['originated']+=0x1;logger[_0xf0fa('0x6e')]('[originated][increment]',_0x1e1a94,'\x20Queue',_0x1493d2[_0xf0fa('0x28')],_0xf0fa('0x72'),_0x1493d2[_0xf0fa('0x5b')]);_0x18d83c(_0x3a8b55);})[_0xf0fa('0x7a')](function(_0x5ef78f){ut['logAgent'](_0xb9addb,0xe,_0xf0fa('0x12a'));rpcDb[_0xf0fa('0xe9')](_0xb9addb,_0xf0fa('0x12b'));_0x247dba(_0x5ef78f);});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x20')]=function(_0x4fcae8){if(this[_0xf0fa('0x15')][_0x4fcae8[_0xf0fa('0xbc')]]){this[_0xf0fa('0x15')][_0x4fcae8[_0xf0fa('0xbc')]][_0xf0fa('0x79')]=_0x4fcae8[_0xf0fa('0x79')];}};Preview[_0xf0fa('0xf')][_0xf0fa('0x17')]=function(_0x516696){var _0x34c7eb=this;var _0x57f64f=this['actions'][_0x516696[_0xf0fa('0x12c')]];if(_0x57f64f){if(_0x57f64f[_0xf0fa('0xf6')]&&this[_0xf0fa('0x16')][_0x57f64f[_0xf0fa('0xf6')]]){ut[_0xf0fa('0x12d')](_0x57f64f,this[_0xf0fa('0x16')][_0x57f64f['lookAgent']][_0xf0fa('0x28')],this[_0xf0fa('0x16')][_0x57f64f[_0xf0fa('0xf6')]]['id']);}var _0x1514a4=_[_0xf0fa('0x12e')](_0x57f64f);_0x1514a4['responsetime']=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x40e1cf=_0x34c7eb['campaignsPreview'][_0x57f64f[_0xf0fa('0x71')]];if(ut[_0xf0fa('0x12f')](_0x516696['response'])){if(_0x57f64f[_0xf0fa('0xac')]){rpcDb[_0xf0fa('0x108')](_0x57f64f[_0xf0fa('0x130')]);}if(_0x57f64f[_0xf0fa('0xad')]){rpcDb[_0xf0fa('0x8c')](_0x57f64f['idContact']);}ami[_0xf0fa('0x26')](_0xf0fa('0x131'),ut['buildObj'](_0x57f64f,_0xf0fa('0x132'),this[_0xf0fa('0x13')][_0x57f64f[_0xf0fa('0x71')]]));this['callProgressDetectingAgent'](_0x1514a4,_0x40e1cf,_0x516696);}else{_0x57f64f[_0xf0fa('0x8d')]=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xf0fa('0xe8')](_0x1514a4,0x4,'Answer');rpcDb[_0xf0fa('0xe9')](_0x1514a4,_0xf0fa('0x133'));}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x19')]=function(_0x18212c){var _0x4e070b=this;var _0x3a088e=this[_0xf0fa('0x15')][_0x18212c['linkedid']];var _0x4df407;if(_0x3a088e){_0x4df407=this[_0xf0fa('0x13')][_0x3a088e[_0xf0fa('0x71')]];logger['info'](_0xf0fa('0x134'),_0x18212c['linkedid'],'\x20Queue',_0x4df407[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);}if(this['actions'][_0x18212c[_0xf0fa('0xbc')]]&&_0x18212c[_0xf0fa('0xbc')]!==_0x18212c[_0xf0fa('0xb1')]){if(_0x18212c[_0xf0fa('0x135')]==='16'&&this[_0xf0fa('0x15')][_0x18212c['linkedid']]['dialAnswer']){this[_0xf0fa('0x9d')](_0x18212c,_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')]);}else if(this[_0xf0fa('0x15')][_0x18212c[_0xf0fa('0xbc')]][_0xf0fa('0x7c')]){logger['info'](_0xf0fa('0x136'),_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')],'\x20Queue',_0x4df407['name'],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);this[_0xf0fa('0x9d')](_0x18212c,_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')]);}}else if(_0x3a088e&&_['isNil'](_0x3a088e[_0xf0fa('0x137')])&&_0x4df407[_0xf0fa('0x138')]&&_0x18212c[_0xf0fa('0xbc')]===_0x18212c[_0xf0fa('0xb1')]&&_[_0xf0fa('0x6d')](_0x18212c[_0xf0fa('0xf0')])&&_0x18212c['cause']==='16'&&_0x18212c[_0xf0fa('0x139')]==='6'&&_[_0xf0fa('0xe7')](_0x3a088e[_0xf0fa('0x13a')])){if(_0x3a088e['unlockAgent']){rpcDb['unlockContact'](_0x3a088e['idContact']);}if(_0x3a088e[_0xf0fa('0xad')]){rpcDb[_0xf0fa('0x8c')](_0x3a088e[_0xf0fa('0x130')]);}_0x18212c[_0xf0fa('0xf0')]='22';this[_0xf0fa('0x13b')](_0x3a088e,_0x4df407,_0x18212c);}else if(_0x3a088e&&_0x3a088e['transfer']){if(_0x18212c['cause']==='16'&&this[_0xf0fa('0x15')][_0x18212c[_0xf0fa('0xbc')]]['dialAnswer']){logger[_0xf0fa('0x6e')](_0xf0fa('0x13c'),_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')],_0xf0fa('0xb2'),_0x4df407[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);this[_0xf0fa('0x9d')](_0x18212c,_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')]);}else if(this['actions'][_0x18212c[_0xf0fa('0xbc')]][_0xf0fa('0x7c')]){logger[_0xf0fa('0x6e')](_0xf0fa('0x136'),_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')],'\x20Queue',_0x4df407[_0xf0fa('0x28')],'pTalking:\x20',_0x4df407['pTalking']);this['callProgressDetectingCustomer'](_0x18212c,_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')]);}}};Preview[_0xf0fa('0xf')]['syncDialEnd']=function(_0x14e3ed){if(this[_0xf0fa('0x15')][_0x14e3ed['destlinkedid']]&&_0x14e3ed[_0xf0fa('0xe5')]!==_0x14e3ed['destuniqueid']){this[_0xf0fa('0x9d')](_0x14e3ed,_0x14e3ed[_0xf0fa('0xe5')],_0x14e3ed[_0xf0fa('0xda')]);}};Preview[_0xf0fa('0xf')]['syncHangupRequest']=function(_0x543bbb){if(this[_0xf0fa('0x15')][_0x543bbb[_0xf0fa('0xbc')]]&&_0x543bbb[_0xf0fa('0xbc')]!==_0x543bbb[_0xf0fa('0xb1')]&&!this['actions'][_0x543bbb[_0xf0fa('0xbc')]]['dialAnswer']){if(_0x543bbb[_0xf0fa('0x135')]==='1'){this[_0xf0fa('0x9d')](_0x543bbb,_0x543bbb[_0xf0fa('0xbc')],_0x543bbb['cause']);}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x13d')]=function(_0x591ffb,_0x160c0a,_0x4cdf8b){if(this[_0xf0fa('0x15')][_0x591ffb]){if(_[_0xf0fa('0x6d')](this[_0xf0fa('0x15')][_0x591ffb]['variables'])){this[_0xf0fa('0x15')][_0x591ffb][_0xf0fa('0x13e')]={};}this[_0xf0fa('0x15')][_0x591ffb][_0xf0fa('0x13e')][_0x160c0a]=_0x4cdf8b;}};Preview[_0xf0fa('0xf')][_0xf0fa('0x22')]=function(_0x29dea5){try{if(!_[_0xf0fa('0x6d')](_0x29dea5)){if(ut[_0xf0fa('0x13f')](_['keys'](_0x29dea5[_0xf0fa('0x140')])[0x0])){this[_0xf0fa('0x13d')](_0x29dea5['uniqueid'],_[_0xf0fa('0x141')](_0x29dea5[_0xf0fa('0x140')])[0x0],_0x29dea5[_0xf0fa('0x142')]);}}}catch(_0x2dddd1){logger[_0xf0fa('0x143')]('[syncVarSet][Preview]',util[_0xf0fa('0x144')](_0x2dddd1,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x1fc0b1){if(_0x1fc0b1){if(this[_0xf0fa('0x15')][_0x1fc0b1['transfertargetlinkedid']]){this[_0xf0fa('0x15')][_0x1fc0b1['transfertargetlinkedid']][_0xf0fa('0x13a')]=!![];}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x24')]=function(_0x264d29){if(_0x264d29){if(this[_0xf0fa('0x15')][_0x264d29['transfererlinkedid']]){this[_0xf0fa('0x15')][_0x264d29['transfererlinkedid']][_0xf0fa('0x13a')]=!![];}}};module[_0xf0fa('0x145')]=Preview; \ No newline at end of file +var _0x5636=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','format','voice:queue:%s','info','stringify','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','prototype','syncCampaigns','clockClearZombieChannels','booked','outbound','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','enqueue','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','size','clearZombieChannel','agentReadyId','then','isNil','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','complete','total','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumBillable','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','VoiceQueueId','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','[originateFailure][logOriginateFailure]','syncNewExten','actionid','lookAgent','clone','response','custom:agentringnoanswer','rejected','Answer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','strategy','answered','pTalking','sumDuration','sumHoldTime','talking','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0x5636,0x102));var _0x6563=function(_0x2a5438,_0xe70581){_0x2a5438=_0x2a5438-0x0;var _0x475e1b=_0x5636[_0x2a5438];return _0x475e1b;};'use strict';var util=require(_0x6563('0x0'));var _=require(_0x6563('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require(_0x6563('0x2'));var Redis=require(_0x6563('0x3'));var config=require(_0x6563('0x4'));var logger=require('../../../config/logger')(_0x6563('0x5'));var loggerAction=require(_0x6563('0x6'))(_0x6563('0x7'));var ami=require(_0x6563('0x8'));var rpcDb=require(_0x6563('0x9'));var Action=require(_0x6563('0xa'));var ut=require(_0x6563('0xb'));config[_0x6563('0xc')]=_[_0x6563('0xd')](config[_0x6563('0xc')],{'host':_0x6563('0xe'),'port':0x18eb});var io=require(_0x6563('0xf'))(new Redis(config[_0x6563('0xc')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x2946f3){this[_0x6563('0x10')]=this['tail']?this['tail']['finally'](_0x2946f3):_0x2946f3();};function Preview(_0x1ef002){this[_0x6563('0x11')]=new Sequence();this[_0x6563('0x12')]=_0x1ef002[_0x6563('0x13')];this[_0x6563('0x14')]=_0x1ef002[_0x6563('0x14')];this[_0x6563('0x15')]={};this[_0x6563('0x16')]=_0x1ef002[_0x6563('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0x6563('0x17'),this['syncOriginateResponse'][_0x6563('0x18')](this));ami['on'](_0x6563('0x19'),this[_0x6563('0x1a')][_0x6563('0x18')](this));ami['on']('hanguprequest',this[_0x6563('0x1b')][_0x6563('0x18')](this));ami['on'](_0x6563('0x1c'),this[_0x6563('0x1d')]['bind'](this));ami['on'](_0x6563('0x1e'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x6563('0x1f')]['bind'](this));ami['on']('attendedtransfer',this[_0x6563('0x20')][_0x6563('0x18')](this));ami['on'](_0x6563('0x21'),this[_0x6563('0x22')][_0x6563('0x18')](this));this[_0x6563('0x23')](this[_0x6563('0x12')]);}function emit(_0x93a45,_0x2a70f0,_0x5bf608){io['to'](_0x93a45)[_0x6563('0x24')](_0x2a70f0,_0x5bf608);}function emitCampaignPreview(_0x9c3da7){if(_0x9c3da7[_0x6563('0x25')]==='outbound'){var _0x293db2={'id':_0x9c3da7['id'],'name':_0x9c3da7['name'],'strategy':_0x9c3da7[_0x6563('0x26')],'answered':_0x9c3da7[_0x6563('0x27')],'available':_0x9c3da7['available'],'loggedIn':_0x9c3da7['loggedIn'],'pTalking':_0x9c3da7[_0x6563('0x28')],'sumBillable':_0x9c3da7['sumBillable'],'sumDuration':_0x9c3da7[_0x6563('0x29')],'sumHoldTime':_0x9c3da7[_0x6563('0x2a')]||0x0,'talking':_0x9c3da7[_0x6563('0x2b')],'total':_0x9c3da7['total'],'type':_0x9c3da7[_0x6563('0x25')],'unmanaged':_0x9c3da7['unmanaged'],'abandoned':_0x9c3da7[_0x6563('0x2c')],'waiting':_0x9c3da7[_0x6563('0x2d')],'loggedInDb':_0x9c3da7['loggedInDb'],'dialActive':_0x9c3da7[_0x6563('0x2e')],'dialMethod':_0x9c3da7[_0x6563('0x2f')],'dialOriginateCallerIdName':_0x9c3da7['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x9c3da7[_0x6563('0x30')],'dialOriginateTimeout':_0x9c3da7['dialOriginateTimeout'],'dialPrefix':_0x9c3da7[_0x6563('0x31')],'outboundAnswerAgiCallsDay':_0x9c3da7['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x9c3da7['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x9c3da7[_0x6563('0x32')],'outboundBusyCallsDay':_0x9c3da7[_0x6563('0x33')],'outboundCongestionCallsDay':_0x9c3da7[_0x6563('0x34')],'outboundDropCallsDayACS':_0x9c3da7[_0x6563('0x35')],'outboundDropCallsDayCallersExit':_0x9c3da7[_0x6563('0x36')],'outboundDropCallsDayTimeout':_0x9c3da7['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x9c3da7[_0x6563('0x37')],'outboundNoSuchCallsDay':_0x9c3da7['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x9c3da7['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x9c3da7[_0x6563('0x38')],'outboundRejectCallsDay':_0x9c3da7[_0x6563('0x39')],'outboundUnknownCallsDay':_0x9c3da7[_0x6563('0x3a')],'outboundAbandonedCallsDay':_0x9c3da7[_0x6563('0x3b')],'predictiveIntervalAnsweredCalls':_0x9c3da7[_0x6563('0x3c')],'predictiveIntervalAvgHoldtime':_0x9c3da7[_0x6563('0x3d')],'predictiveIntervalAvgTalktime':_0x9c3da7[_0x6563('0x3e')],'predictiveIntervalDroppedCallsCallersExit':_0x9c3da7[_0x6563('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x9c3da7[_0x6563('0x40')],'predictiveIntervalErlangCalls':_0x9c3da7[_0x6563('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x9c3da7['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x9c3da7[_0x6563('0x42')],'predictiveIntervalMultiplicativeFactor':_0x9c3da7[_0x6563('0x43')],'predictiveIntervalPauses':_0x9c3da7[_0x6563('0x44')],'predictiveIntervalAvailable':_0x9c3da7[_0x6563('0x45')],'predictiveIntervalTotalCalls':_0x9c3da7[_0x6563('0x46')],'message':_0x9c3da7[_0x6563('0x47')],'originated':_0x9c3da7[_0x6563('0x48')],'erlangCalls':_0x9c3da7['erlangCalls'],'erlangCallToSecond':_0x9c3da7[_0x6563('0x49')],'erlangAbandonmentRate':_0x9c3da7[_0x6563('0x4a')],'erlangBusyFactor':_0x9c3da7[_0x6563('0x4b')],'startPredictive':_0x9c3da7[_0x6563('0x4c')],'startProgressive':_0x9c3da7[_0x6563('0x4d')]};if(_0x9c3da7[_0x6563('0x4e')]){_0x293db2['Trunk']={'id':_0x9c3da7[_0x6563('0x4e')]['id'],'name':_0x9c3da7[_0x6563('0x4e')][_0x6563('0x4f')],'active':_0x9c3da7[_0x6563('0x4e')][_0x6563('0x50')],'callerid':_0x9c3da7[_0x6563('0x4e')][_0x6563('0x51')]};}if(_0x9c3da7['Interval']){_0x293db2[_0x6563('0x52')]={'id':_0x9c3da7[_0x6563('0x52')]['id'],'name':_0x9c3da7['Interval'][_0x6563('0x4f')]};}var _0x1ff47d=md5(JSON['stringify'](_0x293db2));if(_0x9c3da7['md5']!==_0x1ff47d){_0x9c3da7[_0x6563('0x2')]=_0x1ff47d;emit(util[_0x6563('0x53')](_0x6563('0x54'),_0x293db2[_0x6563('0x4f')]),'voice_queue:save',_0x293db2);}}}function emitVoiceQueueChannelRemove(_0x2d36d4){logger[_0x6563('0x55')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x6563('0x56')](_0x2d36d4));emit(util[_0x6563('0x53')](_0x6563('0x54'),_0x2d36d4[_0x6563('0x4f')]),_0x6563('0x57'),_0x2d36d4);io[_0x6563('0x24')](_0x6563('0x58'),_0x2d36d4);}function notSendMessagesQueue(_0x15c23e){if(_0x15c23e[_0x6563('0x59')]){if(_0x15c23e['originated']===0x0&&_0x15c23e[_0x6563('0x28')]===0x0){_0x15c23e[_0x6563('0x59')]=![];_0x15c23e[_0x6563('0x5a')]=0x0;_0x15c23e[_0x6563('0x5b')]=0x0;_0x15c23e['message']='NOT_ACTIVE';ut[_0x6563('0x5c')](_0x6563('0x5d'),_0x15c23e[_0x6563('0x4f')]+'\x20is\x20not\x20active');}else{_0x15c23e[_0x6563('0x47')]='IS_DISACTIVED';ut[_0x6563('0x5c')](_0x6563('0x5d'),_0x15c23e['name']+_0x6563('0x5e'));}emitCampaignPreview(_0x15c23e);}}Preview[_0x6563('0x5f')][_0x6563('0x23')]=function(){var _0xcf92cd=this;setInterval(function(){_0xcf92cd[_0x6563('0x60')]();},0x7cf);};Preview[_0x6563('0x5f')][_0x6563('0x60')]=function(){var _0x32932f=this[_0x6563('0x12')];this[_0x6563('0x61')]+=0x1;for(var _0x2acb52 in _0x32932f){if(_0x32932f['hasOwnProperty'](_0x2acb52)&&(_0x32932f[_0x2acb52]['dialMethod']===_0x6563('0x5')||_0x32932f[_0x2acb52][_0x6563('0x2f')]===_0x6563('0x62'))&&_0x32932f[_0x2acb52][_0x6563('0x25')]===_0x6563('0x63')){if(this[_0x6563('0x61')]>0x7){this[_0x6563('0x61')]=0x0;this['clearZombieChannels']();}}if(_0x32932f[_0x6563('0x64')](_0x2acb52)&&_0x32932f[_0x2acb52][_0x6563('0x2f')]===_0x6563('0x5')&&_0x32932f[_0x2acb52][_0x6563('0x25')]==='outbound'){if(_0x32932f[_0x2acb52][_0x6563('0x2e')]){this[_0x6563('0x65')](_0x32932f[_0x2acb52]);if(_0x32932f[_0x2acb52][_0x6563('0x66')])this[_0x6563('0x67')](_0x32932f[_0x2acb52]);}else{notSendMessagesQueue(_0x32932f[_0x2acb52]);}}}};Preview[_0x6563('0x5f')]['clearZombieChannel']=function(_0x496602){var _0x1504ca=this;this[_0x6563('0x11')][_0x6563('0x68')](function(){if(!_['isNil'](_0x1504ca[_0x6563('0x15')][_0x496602])){loggerAction[_0x6563('0x55')](_0x6563('0x69'),_0x496602,_0x6563('0x6a'),_0x1504ca['actions'][_0x496602][_0x6563('0x6b')],_0x6563('0x6c'),JSON[_0x6563('0x56')](_0x1504ca['campaignsPreview'][_0x1504ca[_0x6563('0x15')][_0x496602]['queue']][_0x6563('0x48')]),'pTalking:\x20',JSON['stringify'](_0x1504ca[_0x6563('0x12')][_0x1504ca[_0x6563('0x15')][_0x496602][_0x6563('0x6b')]][_0x6563('0x28')]),JSON[_0x6563('0x56')](_0x1504ca[_0x6563('0x15')][_0x496602][_0x6563('0x6d')]),JSON[_0x6563('0x56')](_[_0x6563('0x6e')](_0x1504ca[_0x6563('0x15')][_0x496602],['contactId',_0x6563('0x6f'),'VoiceQueueId',_0x6563('0x70')])));return ami[_0x6563('0x71')]({'action':_0x6563('0x72'),'channel':_0x1504ca['actions'][_0x496602][_0x6563('0x73')]})[_0x6563('0x74')](function(_0x4f9884){if(_0x4f9884[_0x6563('0x47')]===_0x6563('0x75')){setTimeout(function(){if(_0x1504ca[_0x6563('0x15')][_0x496602]){ut[_0x6563('0x76')](_0x1504ca[_0x6563('0x12')][_0x1504ca['actions'][_0x496602][_0x6563('0x6b')]],'[clearZombieChannel]');if(_0x1504ca[_0x6563('0x15')][_0x496602]['dialAnswer']===!![]){ut[_0x6563('0x77')](_0x1504ca['campaignsPreview'][_0x1504ca['actions'][_0x496602]['queue']],'[clearZombieChannel]');ut[_0x6563('0x78')]('[Dialer][checkChannel][pTalking][Preview]'+_0x496602,_0x1504ca[_0x6563('0x15')][_0x496602]['queue']);}ut[_0x6563('0x78')](_0x6563('0x79')+_0x496602,_0x1504ca[_0x6563('0x15')][_0x496602][_0x6563('0x6b')]);delete _0x1504ca[_0x6563('0x15')][_0x496602];}},0x2328);}});}});};Preview[_0x6563('0x5f')][_0x6563('0x7a')]=function(){var _0xdc94f8=this;loggerAction[_0x6563('0x55')]('[action]',_[_0x6563('0x7b')](this[_0x6563('0x15')]));for(var _0x97ee3 in this[_0x6563('0x15')]){if(_0xdc94f8[_0x6563('0x15')][_0x6563('0x64')](_0x97ee3)){_0xdc94f8[_0x6563('0x7c')](_0x97ee3);}}};Preview[_0x6563('0x5f')][_0x6563('0x67')]=function(_0x2c7e9d){var _0x1fc431=this;rpcDb['getContactRecallMe'](_0x2c7e9d['id'],ut[_0x6563('0x7d')](this[_0x6563('0x16')]))[_0x6563('0x7e')](function(_0x2e9c69){if(!_[_0x6563('0x7f')](_0x2e9c69)){for(var _0x3c06ac=0x0;_0x3c06ac<_0x2e9c69[_0x6563('0x80')];_0x3c06ac+=0x1){if(ut[_0x6563('0x81')](_0x2e9c69[_0x3c06ac]['scheduledat'])<_0x2c7e9d[_0x6563('0x82')]*0x3c){if(_0x2e9c69[_0x3c06ac]['Agent']&&!_0x2e9c69[_0x3c06ac][_0x6563('0x83')][_0x6563('0x84')]){_0x1fc431['run'](_0x2e9c69[_0x3c06ac]['id'])['then'](ut[_0x6563('0x85')](_0x6563('0x86')))[_0x6563('0x74')](ut[_0x6563('0x85')]('[RecallMe]'));}else{rpcDb[_0x6563('0x87')](_0x2e9c69[_0x3c06ac]['id']);}}else{var _0x49c1e0=new Action(_0x2e9c69[_0x3c06ac],_0x2c7e9d);_0x49c1e0[_0x6563('0x88')]=moment()[_0x6563('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c7e9d['outboundReCallsDay']+=0x1;ut[_0x6563('0x89')](_0x49c1e0,0x17,'RecallInQueue');if(_0x2c7e9d['dialRecallInQueue']){rpcDb[_0x6563('0x8a')](ut['createBody'](_0x2e9c69[_0x3c06ac]));rpcDb[_0x6563('0x8b')](_0x49c1e0,_0x6563('0x8c'));}else{ut[_0x6563('0x89')](_0x49c1e0,0x16,_0x6563('0x8d'));rpcDb['createCustomerHistory'](_0x49c1e0,_0x6563('0x8e'));rpcDb[_0x6563('0x8f')](_0x49c1e0,_0x6563('0x8e'));}}}}})[_0x6563('0x74')](ut[_0x6563('0x85')](_0x6563('0x90')));};Preview[_0x6563('0x5f')][_0x6563('0x65')]=function(_0x58728d){_0x58728d['sendMessageOneNotActive']=!![];if(ut[_0x6563('0x91')](_0x58728d[_0x6563('0x92')])){_0x58728d['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x58728d[_0x6563('0x2e')])){_0x58728d[_0x6563('0x47')]=_0x6563('0x93');}else if(!this[_0x6563('0x94')](_0x58728d['Trunk'])){if(!this[_0x6563('0x94')](_0x58728d[_0x6563('0x95')])){_0x58728d[_0x6563('0x47')]=_0x6563('0x96');}else{_0x58728d[_0x6563('0x47')]='ACTIVE';}}else{_0x58728d['message']=_0x6563('0x97');}emitCampaignPreview(_0x58728d);};Preview[_0x6563('0x5f')][_0x6563('0x98')]=function(_0x5d365e,_0x23a3e2,_0x5e8a05){var _0x311036=this;var _0x29dfff=this[_0x6563('0x15')][_0x23a3e2];var _0x2ddaac=this[_0x6563('0x12')][_0x29dfff[_0x6563('0x6b')]];var _0x500aa1;if(_0x2ddaac){switch(_0x5e8a05){case'1':_0x2ddaac['outboundNoSuchCallsDay']+=0x1;_0x29dfff['countnosuchnumberretry']+=0x1;_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x0,_0x6563('0x9b'));ami[_0x6563('0x24')](_0x6563('0x9c'),ut['buildObj'](_0x29dfff,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x29dfff,_0x6563('0x9d'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac[_0x6563('0x9e')]){_0x500aa1=ut[_0x6563('0x9f')](_0x29dfff,0xf,_0x6563('0xa0'));rpcDb['createCustomerFinal'](_0x500aa1,_0x6563('0xa1'));}else{if(_0x29dfff[_0x6563('0xa2')]>=_0x2ddaac[_0x6563('0xa3')]){rpcDb[_0x6563('0x8f')](_0x29dfff,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x6563('0xa4')](ut[_0x6563('0xa5')](_0x29dfff,_0x6563('0xa2'),_0x2ddaac[_0x6563('0xa6')]),_0x29dfff[_0x6563('0xa7')],_0x29dfff[_0x6563('0xa8')]);}}delete this[_0x6563('0x15')][_0x5d365e[_0x6563('0xa9')]];break;case _0x6563('0xaa'):var _0x1e08a8=moment()[_0x6563('0x53')](_0x6563('0xab'));_0x29dfff[_0x6563('0xac')]=_0x1e08a8;_0x29dfff[_0x6563('0xad')]=_0x1e08a8;_0x29dfff[_0x6563('0x6d')]=!![];_0x2ddaac['pTalking']+=0x1;logger[_0x6563('0x55')](_0x6563('0xae'),_0x29dfff[_0x6563('0xaf')],_0x6563('0xb0'),_0x2ddaac[_0x6563('0x4f')],_0x6563('0xb1'),_0x2ddaac[_0x6563('0x28')]);ami[_0x6563('0x24')](_0x6563('0xb2'),ut[_0x6563('0xb3')](_0x29dfff,'connect',this[_0x6563('0x12')][_0x29dfff[_0x6563('0x6b')]]));if(_0x2ddaac[_0x6563('0xb4')]){ami[_0x6563('0x24')](_0x6563('0xb5'),ut[_0x6563('0xb6')](_0x29dfff));}break;case'16':ami[_0x6563('0x24')]('custom:agentcomplete',ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xb7'),this[_0x6563('0x12')][_0x29dfff[_0x6563('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xb7')));_0x2ddaac['outboundAnswerCallsDay']+=0x1;_0x2ddaac[_0x6563('0xb8')]+=0x1;_0x2ddaac[_0x6563('0x27')]+=0x1;ut[_0x6563('0x77')](_0x2ddaac,'[16]');_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x4,'Answer');rpcDb['createCustomerHistory'](_0x29dfff,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xb9'));rpcDb[_0x6563('0xba')](_0x29dfff);_0x2ddaac[_0x6563('0x29')]+=_0x29dfff['talktime'];_0x2ddaac[_0x6563('0xbb')]+=_0x29dfff[_0x6563('0xbc')];logger['info']('[syncHangup][talking][decrement]',_0x29dfff[_0x6563('0xaf')],_0x6563('0xb0'),_0x2ddaac[_0x6563('0x4f')],_0x6563('0xb1'),_0x2ddaac['pTalking']);delete this[_0x6563('0x15')][_0x5d365e[_0x6563('0xa9')]];break;case _0x6563('0xbd'):_0x2ddaac[_0x6563('0x33')]+=0x1;_0x29dfff[_0x6563('0xbe')]+=0x1;_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x5,_0x6563('0xbf'));ami['emit'](_0x6563('0xc0'),ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xc1')));rpcDb[_0x6563('0x8b')](_0x29dfff,_0x6563('0xc2'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac['dialGlobalMaxRetry']){_0x500aa1=ut[_0x6563('0x9f')](_0x29dfff,0xf,_0x6563('0xa0'));rpcDb[_0x6563('0x8f')](_0x500aa1,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x29dfff['countbusyretry']>=_0x2ddaac[_0x6563('0xc3')]){rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xc2'));}else{rpcDb[_0x6563('0xa4')](ut[_0x6563('0xa5')](_0x29dfff,'countbusyretry',_0x2ddaac['dialBusyRetryFrequency']),_0x29dfff[_0x6563('0xa7')],_0x29dfff['activeContact']);}}break;case _0x6563('0xc4'):_0x2ddaac['outboundNoAnswerCallsDay']+=0x1;_0x29dfff['countnoanswerretry']+=0x1;_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x3,_0x6563('0xc5'));ami[_0x6563('0x24')](_0x6563('0xc6'),ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xc7')));rpcDb['createCustomerHistory'](_0x29dfff,_0x6563('0xc8'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac[_0x6563('0x9e')]){_0x500aa1=ut[_0x6563('0x9f')](_0x29dfff,0xf,'Global');rpcDb[_0x6563('0x8f')](_0x500aa1,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x29dfff[_0x6563('0xc9')]>=_0x2ddaac[_0x6563('0xca')]){rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xc8'));}else{rpcDb[_0x6563('0xa4')](ut[_0x6563('0xa5')](_0x29dfff,_0x6563('0xc9'),_0x2ddaac[_0x6563('0xcb')]),_0x29dfff[_0x6563('0xa7')],_0x29dfff[_0x6563('0xa8')]);}}break;case _0x6563('0xcc'):_0x2ddaac[_0x6563('0x34')]+=0x1;_0x29dfff['countcongestionretry']+=0x1;_0x29dfff[_0x6563('0x99')]=ut['totalGlobal'](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x8,_0x6563('0xcd'));ami[_0x6563('0x24')](_0x6563('0xce'),ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xcf')));rpcDb[_0x6563('0x8b')](_0x29dfff,_0x6563('0xd0'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac[_0x6563('0x9e')]){_0x500aa1=ut[_0x6563('0x9f')](_0x29dfff,0xf,'Global');rpcDb[_0x6563('0x8f')](_0x500aa1,_0x6563('0xd1'));}else{if(_0x29dfff[_0x6563('0xd2')]>=_0x2ddaac['dialCongestionMaxRetry']){rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xd0'));}else{rpcDb[_0x6563('0xa4')](ut[_0x6563('0xa5')](_0x29dfff,_0x6563('0xd2'),_0x2ddaac[_0x6563('0xd3')]),_0x29dfff['unlockAgent'],_0x29dfff[_0x6563('0xa8')]);}}break;case _0x6563('0xd4'):_0x2ddaac['outboundRejectCallsDay']+=0x1;_0x29dfff[_0x6563('0xd5')]+=0x1;_0x29dfff['countglobal']=ut['totalGlobal'](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x14,_0x6563('0xd6'));ami[_0x6563('0x24')](_0x6563('0xd7'),ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xd8')));rpcDb[_0x6563('0x8b')](_0x29dfff,_0x6563('0xd9'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac[_0x6563('0x9e')]){_0x500aa1=ut['cloneAction'](_0x29dfff,0x14,_0x6563('0xd6'));rpcDb[_0x6563('0x8f')](_0x500aa1,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x29dfff['countagentrejectretry']>=_0x2ddaac[_0x6563('0xda')]){rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xdb'));}else{rpcDb[_0x6563('0xa4')](ut['scheduledAt'](_0x29dfff,_0x6563('0xd5'),_0x2ddaac['dialAgentRejectRetryFrequency']),_0x29dfff[_0x6563('0xa7')],_0x29dfff[_0x6563('0xa8')]);}}break;case _0x6563('0xdc'):_0x2ddaac[_0x6563('0x3b')]+=0x1;_0x29dfff[_0x6563('0xdd')]+=0x1;_0x29dfff[_0x6563('0x99')]=ut['totalGlobal'](_0x29dfff);ut['logCustomer'](_0x29dfff,0xb,_0x6563('0xde'));rpcDb[_0x6563('0x8b')](_0x29dfff,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac['dialGlobalMaxRetry']){_0x500aa1=ut['cloneAction'](_0x29dfff,0xf,_0x6563('0xa0'));rpcDb[_0x6563('0x8f')](_0x500aa1,_0x6563('0xdf'));}else{if(_0x29dfff[_0x6563('0xe0')]>=_0x2ddaac['dialAbandonedMaxRety']){rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xdf'));}else{rpcDb[_0x6563('0xa4')](ut[_0x6563('0xa5')](_0x29dfff,_0x6563('0xdd'),_0x2ddaac[_0x6563('0xe1')]),_0x29dfff[_0x6563('0xa7')],_0x29dfff['activeContact']);}}break;case'18':_0x2ddaac[_0x6563('0x3a')]+=0x1;_0x29dfff[_0x6563('0xe2')]+=0x1;_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut['logCustomer'](_0x29dfff,0x12,_0x5d365e['cause-txt']||_0x5d365e[_0x6563('0xe3')]);ami[_0x6563('0x24')](_0x6563('0xe4'),ut[_0x6563('0xb3')](_0x29dfff,_0x6563('0xe5')));rpcDb[_0x6563('0x8b')](_0x29dfff,_0x6563('0xe6'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac[_0x6563('0x9e')]){_0x500aa1=ut['cloneAction'](_0x29dfff,0xf,'Global');rpcDb[_0x6563('0x8f')](_0x500aa1,_0x6563('0xe6'));}else{rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xe6'));}delete this[_0x6563('0x15')][_0x5d365e[_0x6563('0xa9')]];break;case'19':_0x2ddaac['outboundUnknownCallsDay']+=0x1;_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut[_0x6563('0x89')](_0x29dfff,0x13,_0x5d365e[_0x6563('0xe7')]||_0x5d365e[_0x6563('0xe3')]);ami[_0x6563('0x24')](_0x6563('0xe4'),ut['buildObj'](_0x29dfff,_0x6563('0xe5')));rpcDb[_0x6563('0x8b')](_0x29dfff,_0x6563('0xe8'));if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac['dialGlobalMaxRetry']){_0x500aa1=ut[_0x6563('0x9f')](_0x29dfff,0xf,_0x6563('0xa0'));rpcDb[_0x6563('0x8f')](_0x500aa1,_0x6563('0xe8'));}else{rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xe8'));}delete this[_0x6563('0x15')][_0x5d365e['linkedid']];break;default:if(_0x29dfff['dialAnswer']){ut[_0x6563('0x77')](_0x2ddaac,_0x6563('0xe9'));ut[_0x6563('0x78')](_0x6563('0xea')+_0x2ddaac['name'],_0x5d365e);}_0x2ddaac['outboundUnknownCallsDay']+=0x1;_0x29dfff[_0x6563('0x99')]=ut[_0x6563('0x9a')](_0x29dfff);ut['logCustomer'](_0x29dfff,0xc,_0x5d365e[_0x6563('0xe7')]||_0x5d365e['dialstatus']);rpcDb[_0x6563('0x8b')](_0x29dfff,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x6563('0x9a')](_0x29dfff)>=_0x2ddaac[_0x6563('0x9e')]){_0x500aa1=ut[_0x6563('0x9f')](_0x29dfff,0xf,'Global');rpcDb[_0x6563('0x8f')](_0x500aa1,_0x6563('0xeb'));}else{rpcDb[_0x6563('0x8f')](_0x29dfff,_0x6563('0xeb'));}delete this[_0x6563('0x15')][_0x5d365e[_0x6563('0xa9')]];}if(!(_0x29dfff['dialAnswer']&&_0x5e8a05==='16')){ut[_0x6563('0x76')](_0x2ddaac,_0x6563('0xec'));logger[_0x6563('0x55')](_0x6563('0xed'),_0x29dfff[_0x6563('0xaf')],_0x6563('0xb0'),_0x2ddaac[_0x6563('0x4f')],_0x6563('0x6c'),_0x2ddaac['originated']);}if(_0x5e8a05!==_0x6563('0xaa')){delete this['actions'][_0x5d365e[_0x6563('0xa9')]];delete this[_0x6563('0x15')][_0x5d365e['destlinkedid']];}}};Preview[_0x6563('0x5f')][_0x6563('0xee')]=function(_0x3a6135,_0x3a1c66,_0x367404){if(_[_0x6563('0xef')](_0x3a1c66)&&_0x6563('0xf0')!==typeof _0x3a1c66){return;}if(_['isUndefined'](_0x367404)&&_0x6563('0xf0')!==typeof _0x367404){return;}switch(_0x367404[_0x6563('0xf1')]){case'0':ut[_0x6563('0xf2')](_0x3a6135,0x0,_0x6563('0x9b'));rpcDb[_0x6563('0xf3')](_0x3a6135,_0x6563('0xf4'));break;case'3':ut[_0x6563('0xf2')](_0x3a6135,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x3a6135,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x6563('0xf2')](_0x3a6135,0x5,_0x6563('0xbf'));rpcDb['createAgentHistory'](_0x3a6135,_0x6563('0xf5'));break;case'8':ut[_0x6563('0xf2')](_0x3a6135,0x8,_0x6563('0xcd'));rpcDb[_0x6563('0xf3')](_0x3a6135,_0x6563('0xf6'));break;case'22':ut[_0x6563('0xf2')](_0x3a6135,0x16,_0x6563('0xf7'));rpcDb['createAgentHistory'](_0x3a6135,_0x6563('0xf8'));break;default:ut[_0x6563('0xf2')](_0x3a6135,0xc,_0x367404[_0x6563('0xf1')]);rpcDb[_0x6563('0xf3')](_0x3a6135,_0x6563('0xf6'));}ut[_0x6563('0x76')](_0x3a1c66,_0x6563('0xf9'));logger[_0x6563('0x55')]('[originated][decrement][callProgressDetectingAgent]',_0x3a6135[_0x6563('0xaf')],'\x20Queue',_0x3a1c66[_0x6563('0x4f')],_0x6563('0x6c'),_0x3a1c66[_0x6563('0x48')]);delete this[_0x6563('0x15')][_0x3a6135['uniqueid']];};Preview[_0x6563('0x5f')][_0x6563('0xfa')]=function(_0x399926,_0x471981,_0x6fef3d,_0x8dea03,_0x141eb9){var _0x7f3bbd=this;return new BPromise(function(_0x4fd06b,_0x438160){if(_['isNil'](_0x471981)||_[_0x6563('0x7f')](_0x471981[_0x6563('0xfb')])||_[_0x6563('0x7f')](_0x471981[_0x6563('0xfb')][_0x6563('0xfc')])||_['isNil'](_0x471981['VoiceQueueId'])){_0x438160(ut['message'](_0x6563('0xfd'),_0x8dea03,_0x141eb9));return;}var _0x49ff52=uuid['v4']();var _0x25cd9e=_0x7f3bbd['campaignsPreview'][_0x471981[_0x6563('0x6a')][_0x6563('0x4f')]];var _0x1e75f7=_0x6fef3d?_0x7f3bbd[_0x6563('0x16')][_0x6fef3d]['id']:undefined;_0x7f3bbd[_0x6563('0x15')][_0x49ff52]=new Action(_0x471981,_0x25cd9e,_0x49ff52,_0x6fef3d,_0x1e75f7);var _0x1f75f7=_0x7f3bbd['actions'][_0x49ff52];_0x1f75f7['unlockAgent']=_0x8dea03;_0x1f75f7[_0x6563('0xa8')]=_0x141eb9;_0x1f75f7['lookAgent']=_0x6fef3d;if(_[_0x6563('0xfe')](_0x399926)){_0x7f3bbd[_0x6563('0xff')](_0x1f75f7,_0x25cd9e,_0x471981,_0x6fef3d)['then'](function(_0x374780){logger[_0x6563('0x55')]('[Preview][execCall][success]',_0x6563('0x100')+_0x1f75f7[_0x6563('0x6b')]+_0x6563('0x101')+_0x1f75f7[_0x6563('0x102')],JSON[_0x6563('0x56')](_0x374780));ami['emit'](_0x6563('0x103'),ut[_0x6563('0xb3')](_0x1f75f7,_0x6563('0x104'),_0x7f3bbd[_0x6563('0x12')][_0x1f75f7[_0x6563('0x6b')]]));_0x4fd06b(ut[_0x6563('0x47')](_0x6563('0x105')));})[_0x6563('0x74')](function(_0x35cbd2){ut[_0x6563('0x5c')](_0x6563('0x106'),_0x35cbd2);_0x438160(ut[_0x6563('0x47')](_0x6563('0x107'),_0x8dea03,_0x141eb9));});}else{_0x25cd9e[_0x6563('0x32')]+=0x1;ut[_0x6563('0x108')](_0x1f75f7);rpcDb[_0x6563('0x109')](_0x1f75f7,_0x6563('0x10a'));delete _0x7f3bbd[_0x6563('0x15')][_0x49ff52];_0x438160(ut[_0x6563('0x47')]('Contact\x20in\x20black\x20List',_0x8dea03,_0x141eb9));}});};Preview[_0x6563('0x5f')][_0x6563('0x94')]=function(_0x1a8f03){return!_[_0x6563('0x7f')](_0x1a8f03)&&!_[_0x6563('0x7f')](_0x1a8f03[_0x6563('0x4f')])&&!_[_0x6563('0x7f')](_0x1a8f03[_0x6563('0x50')])&&_0x1a8f03[_0x6563('0x50')]&&!_['isNil'](this[_0x6563('0x14')][util['format'](_0x6563('0x10b'),_0x1a8f03[_0x6563('0x4f')])])&&!_[_0x6563('0x7f')](this['trunks'][util[_0x6563('0x53')](_0x6563('0x10b'),_0x1a8f03['name'])][_0x6563('0x72')])&&(this[_0x6563('0x14')][util[_0x6563('0x53')]('SIP/%s',_0x1a8f03[_0x6563('0x4f')])]['status']===_0x6563('0x10c')||this[_0x6563('0x14')][util['format'](_0x6563('0x10b'),_0x1a8f03['name'])]['status']===_0x6563('0x10d'));};Preview[_0x6563('0x5f')][_0x6563('0x10e')]=function(_0x1036f0,_0x7a1eca){var _0x32f037=this;return new BPromise(function(_0x32ee06,_0x399455){_0x32f037[_0x6563('0x10f')](_0x1036f0,_0x7a1eca)[_0x6563('0x7e')](function(_0x2d0e3b){_0x32ee06(_[_0x6563('0x6e')](_0x2d0e3b,[_0x6563('0x47')]));})[_0x6563('0x74')](function(_0x5e5c86){if(_0x5e5c86[_0x6563('0x110')]){rpcDb[_0x6563('0x111')](_0x1036f0);}if(_0x5e5c86[_0x6563('0x50')]){rpcDb['disableContact'](_0x1036f0);}_0x399455(_[_0x6563('0x6e')](_0x5e5c86,['message']));});});};Preview[_0x6563('0x5f')][_0x6563('0x10f')]=function(_0x32f54a,_0x52f5a8){var _0x474a74=this;return new BPromise(function(_0x425980,_0x4a66cb){var _0x2cef73,_0x13b2dc;rpcDb[_0x6563('0x112')](_0x32f54a)[_0x6563('0x7e')](function(_0x3c8318){if(!_['isNil'](_0x3c8318[0x0])){_0x13b2dc=_0x3c8318[0x0][_0x6563('0x113')]?![]:!![];_0x2cef73=_0x3c8318[0x0][_0x6563('0x113')]?!![]:![];_0x2cef73=_0x52f5a8?!![]:_0x2cef73;}var _0x5ab66e=_0x474a74[_0x6563('0x114')](_0x3c8318);if(_0x5ab66e['isValid']){rpcDb['checkIsBlackList'](_[_0x6563('0x6e')](_0x3c8318[0x0],[_0x6563('0x115'),_0x6563('0x116')]))[_0x6563('0x7e')](function(_0x12a51c){_0x474a74[_0x6563('0xfa')](_0x12a51c,_0x3c8318[0x0],_0x52f5a8,_0x13b2dc,_0x2cef73)[_0x6563('0x7e')](function(_0x134f0a){_0x425980(_0x134f0a);})[_0x6563('0x74')](function(_0x2dd813){_0x4a66cb(_0x2dd813);});})['catch'](function(_0x361107){ut[_0x6563('0x5c')](_0x6563('0x117'),_0x361107);_0x4a66cb(ut[_0x6563('0x47')](_0x6563('0x118'),_0x13b2dc,_0x2cef73));});}else{_0x4a66cb(ut[_0x6563('0x47')](_0x5ab66e['message'],_0x13b2dc,_0x2cef73));}})[_0x6563('0x74')](function(_0x11f51d){ut[_0x6563('0x5c')](_0x6563('0x119'),_0x11f51d);_0x4a66cb(ut[_0x6563('0x47')](_0x6563('0x118'),![],!![]));});});};Preview[_0x6563('0x5f')][_0x6563('0x114')]=function(_0x11359a){if(_[_0x6563('0x7f')](_0x11359a)||_['isEmpty'](_0x11359a)||!_['isNil'](_0x11359a[0x0][_0x6563('0x83')])&&_['isNil'](_0x11359a[0x0][_0x6563('0x83')][_0x6563('0x4f')])){ut[_0x6563('0x5c')]('[Preview][validateContact][Empty\x20Contact]',_0x11359a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x262de2=this['campaignsPreview'][_0x11359a[0x0]['Queue'][_0x6563('0x4f')]];_0x262de2['message']=_0x6563('0x97');if(_[_0x6563('0x7f')](_0x262de2)){ut[_0x6563('0x5c')]('[Preview][validateContact][Empty\x20Campaign]',_0x262de2);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x6563('0x94')](_0x262de2['Trunk'])){ut[_0x6563('0x5c')](_0x6563('0x11a'),_0x6563('0x11b')+_0x262de2[_0x6563('0x4f')]+_0x6563('0x11c'));if(!this[_0x6563('0x94')](_0x262de2[_0x6563('0x95')])){ut[_0x6563('0x5c')](_0x6563('0x11a'),_0x262de2[_0x6563('0x4f')]+_0x6563('0x11d'));return{'isValid':![],'message':_0x6563('0x11e')};}}if(!ut[_0x6563('0x11f')](_0x262de2[_0x6563('0x2e')])){ut[_0x6563('0x5c')](_0x6563('0x120'),_0x262de2[_0x6563('0x4f')]+_0x6563('0x121'));return{'isValid':![],'message':_0x6563('0x11b')+_0x262de2[_0x6563('0x4f')]+_0x6563('0x121')};}return{'isValid':!![],'message':_0x6563('0x122')};};Preview[_0x6563('0x5f')][_0x6563('0xff')]=function(_0x2eccd6,_0x4ae945,_0x4a8de0,_0x324cc1){var _0x2ca1c7=this;return new BPromise(function(_0x4ce85c,_0xf30ae6){var _0x251555=_0x2eccd6['uniqueid'];var _0xdcdce=_0x2ca1c7[_0x6563('0x94')](_0x4ae945[_0x6563('0x4e')])?util[_0x6563('0x53')](_0x6563('0x123'),_0x4ae945[_0x6563('0x4e')]['name'],_['isNil'](_0x4ae945[_0x6563('0x31')])?'':_0x4ae945[_0x6563('0x31')][_0x6563('0x124')]()||'',_0x4ae945['dialCutDigit']>0x0?_0x4a8de0[_0x6563('0xfb')][_0x6563('0xfc')][_0x6563('0x125')](_0x4ae945[_0x6563('0x126')]):_0x4a8de0[_0x6563('0xfb')][_0x6563('0xfc')]):util[_0x6563('0x53')]('SIP/%s/%s%s',_[_0x6563('0x7f')](_0x4ae945[_0x6563('0x95')])?_0x4ae945[_0x6563('0x4e')]['name']:_0x4ae945[_0x6563('0x95')][_0x6563('0x4f')],_['isNil'](_0x4ae945[_0x6563('0x31')])?'':_0x4ae945['dialPrefix'][_0x6563('0x124')]()||'',_0x4ae945[_0x6563('0x126')]>0x0?_0x4a8de0[_0x6563('0xfb')][_0x6563('0xfc')]['substring'](_0x4ae945[_0x6563('0x126')]):_0x4a8de0[_0x6563('0xfb')][_0x6563('0xfc')]);var _0x183752=_0x2ca1c7[_0x6563('0x94')](_0x4ae945[_0x6563('0x4e')])?ut[_0x6563('0x127')](_0x4ae945['Trunk'][_0x6563('0x51')],_0x4ae945[_0x6563('0x128')],_0x4ae945[_0x6563('0x129')]>0x0?ut[_0x6563('0x12a')](_0x4ae945[_0x6563('0x30')],_0x4ae945[_0x6563('0x129')]):_0x4ae945['dialOriginateCallerIdNumber']):ut[_0x6563('0x127')](_[_0x6563('0x7f')](_0x4ae945['TrunkBackup'])?_0x4ae945['Trunk'][_0x6563('0x51')]:_0x4ae945[_0x6563('0x95')][_0x6563('0x51')],_0x4ae945['dialOriginateCallerIdName'],_0x4ae945[_0x6563('0x129')]>0x0?ut[_0x6563('0x12a')](_0x4ae945[_0x6563('0x30')],_0x4ae945[_0x6563('0x129')]):_0x4ae945['dialOriginateCallerIdNumber']);if(_0x183752){_0x2eccd6['originatecalleridname']=ut[_0x6563('0x12b')](_0x183752);_0x2eccd6[_0x6563('0x12c')]=ut['extractCalleridNumber'](_0x183752);}var _0x18b7f7=ut[_0x6563('0x12d')](_0x4ae945,_0x4a8de0,_0xdcdce,_0x183752,_0x251555,_0x2eccd6);_[_0x6563('0x12e')](_0x2eccd6,ut[_0x6563('0x12f')](_0x18b7f7));_0x2eccd6[_0x6563('0x88')]=moment()[_0x6563('0x53')](_0x6563('0xab'));ami[_0x6563('0x71')](ut['variablesAction'](_0x2eccd6,_0x4ae945,_0x18b7f7,_0x2eccd6[_0x6563('0xa8')],_0x324cc1))[_0x6563('0x7e')](function(_0x67ad58){_0x4ae945[_0x6563('0x48')]+=0x1;logger[_0x6563('0x55')]('[originated][increment]',_0x251555,_0x6563('0xb0'),_0x4ae945[_0x6563('0x4f')],_0x6563('0x6c'),_0x4ae945[_0x6563('0x48')]);_0x4ce85c(_0x67ad58);})[_0x6563('0x74')](function(_0x1fe118){ut[_0x6563('0xf2')](_0x2eccd6,0xe,'OriginateError');rpcDb[_0x6563('0xf3')](_0x2eccd6,_0x6563('0x130'));_0xf30ae6(_0x1fe118);});});};Preview[_0x6563('0x5f')][_0x6563('0x131')]=function(_0xf7c630){if(this[_0x6563('0x15')][_0xf7c630[_0x6563('0xa9')]]){this[_0x6563('0x15')][_0xf7c630[_0x6563('0xa9')]][_0x6563('0x73')]=_0xf7c630[_0x6563('0x73')];}};Preview[_0x6563('0x5f')]['syncOriginateResponse']=function(_0x4db603){var _0x10e9e0=this;var _0x23b935=this['actions'][_0x4db603[_0x6563('0x132')]];if(_0x23b935){if(_0x23b935[_0x6563('0x133')]&&this['agents'][_0x23b935['lookAgent']]){ut['logLookAgent'](_0x23b935,this[_0x6563('0x16')][_0x23b935[_0x6563('0x133')]]['name'],this[_0x6563('0x16')][_0x23b935['lookAgent']]['id']);}var _0xca19b5=_[_0x6563('0x134')](_0x23b935);_0xca19b5['responsetime']=moment()[_0x6563('0x53')](_0x6563('0xab'));var _0x3078a4=_0x10e9e0[_0x6563('0x12')][_0x23b935[_0x6563('0x6b')]];if(ut['isFailure'](_0x4db603[_0x6563('0x135')])){if(_0x23b935['unlockAgent']){rpcDb[_0x6563('0x111')](_0x23b935[_0x6563('0x102')]);}if(_0x23b935[_0x6563('0xa8')]){rpcDb['disableContact'](_0x23b935[_0x6563('0x102')]);}ami['emit'](_0x6563('0x136'),ut[_0x6563('0xb3')](_0x23b935,_0x6563('0x137'),this[_0x6563('0x12')][_0x23b935['queue']]));this[_0x6563('0xee')](_0xca19b5,_0x3078a4,_0x4db603);}else{_0x23b935[_0x6563('0x88')]=moment()[_0x6563('0x53')](_0x6563('0xab'));ut[_0x6563('0xf2')](_0xca19b5,0x4,_0x6563('0x138'));rpcDb['createAgentHistory'](_0xca19b5,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x6563('0x5f')][_0x6563('0x1a')]=function(_0x4f0647){var _0x4c5265=this;var _0x9d364f=this[_0x6563('0x15')][_0x4f0647['linkedid']];var _0x38ae7f;if(_0x9d364f){_0x38ae7f=this[_0x6563('0x12')][_0x9d364f[_0x6563('0x6b')]];logger[_0x6563('0x55')](_0x6563('0x139'),_0x4f0647[_0x6563('0xa9')],_0x6563('0xb0'),_0x38ae7f['name'],_0x6563('0xb1'),_0x38ae7f[_0x6563('0x28')]);}if(this[_0x6563('0x15')][_0x4f0647[_0x6563('0xa9')]]&&_0x4f0647[_0x6563('0xa9')]!==_0x4f0647[_0x6563('0xaf')]){if(_0x4f0647['cause']==='16'&&this['actions'][_0x4f0647[_0x6563('0xa9')]][_0x6563('0x6d')]){this[_0x6563('0x98')](_0x4f0647,_0x4f0647['linkedid'],_0x4f0647[_0x6563('0x13a')]);}else if(this[_0x6563('0x15')][_0x4f0647['linkedid']][_0x6563('0x6d')]){logger[_0x6563('0x55')](_0x6563('0x13b'),_0x4f0647['linkedid'],_0x4f0647[_0x6563('0x13a')],_0x6563('0xb0'),_0x38ae7f[_0x6563('0x4f')],_0x6563('0xb1'),_0x38ae7f[_0x6563('0x28')]);this[_0x6563('0x98')](_0x4f0647,_0x4f0647[_0x6563('0xa9')],_0x4f0647[_0x6563('0x13a')]);}}else if(_0x9d364f&&_[_0x6563('0x7f')](_0x9d364f[_0x6563('0x13c')])&&_0x38ae7f['dialQueueProject']&&_0x4f0647['linkedid']===_0x4f0647[_0x6563('0xaf')]&&_[_0x6563('0x7f')](_0x4f0647['reason'])&&_0x4f0647['cause']==='16'&&_0x4f0647[_0x6563('0x13d')]==='6'&&_[_0x6563('0xef')](_0x9d364f[_0x6563('0x13e')])){if(_0x9d364f[_0x6563('0xa7')]){rpcDb['unlockContact'](_0x9d364f['idContact']);}if(_0x9d364f['activeContact']){rpcDb['disableContact'](_0x9d364f[_0x6563('0x102')]);}_0x4f0647['reason']='22';this[_0x6563('0xee')](_0x9d364f,_0x38ae7f,_0x4f0647);}else if(_0x9d364f&&_0x9d364f[_0x6563('0x13e')]){if(_0x4f0647['cause']==='16'&&this[_0x6563('0x15')][_0x4f0647['linkedid']]['dialAnswer']){logger['info'](_0x6563('0x13f'),_0x4f0647[_0x6563('0xa9')],_0x4f0647['cause'],'\x20Queue',_0x38ae7f[_0x6563('0x4f')],_0x6563('0xb1'),_0x38ae7f[_0x6563('0x28')]);this[_0x6563('0x98')](_0x4f0647,_0x4f0647['linkedid'],_0x4f0647[_0x6563('0x13a')]);}else if(this['actions'][_0x4f0647[_0x6563('0xa9')]]['dialAnswer']){logger[_0x6563('0x55')](_0x6563('0x13b'),_0x4f0647[_0x6563('0xa9')],_0x4f0647['cause'],'\x20Queue',_0x38ae7f[_0x6563('0x4f')],_0x6563('0xb1'),_0x38ae7f[_0x6563('0x28')]);this[_0x6563('0x98')](_0x4f0647,_0x4f0647['linkedid'],_0x4f0647['cause']);}}};Preview['prototype'][_0x6563('0x1d')]=function(_0x90878e){if(this[_0x6563('0x15')][_0x90878e[_0x6563('0x140')]]&&_0x90878e[_0x6563('0x140')]!==_0x90878e['destuniqueid']){this[_0x6563('0x98')](_0x90878e,_0x90878e[_0x6563('0x140')],_0x90878e[_0x6563('0xe3')]);}};Preview['prototype'][_0x6563('0x1b')]=function(_0x5ab964){if(this[_0x6563('0x15')][_0x5ab964[_0x6563('0xa9')]]&&_0x5ab964['linkedid']!==_0x5ab964['uniqueid']&&!this[_0x6563('0x15')][_0x5ab964[_0x6563('0xa9')]][_0x6563('0x6d')]){if(_0x5ab964[_0x6563('0x13a')]==='1'){this[_0x6563('0x98')](_0x5ab964,_0x5ab964['linkedid'],_0x5ab964[_0x6563('0x13a')]);}}};Preview['prototype'][_0x6563('0x141')]=function(_0x546047,_0x32c097,_0xf809af){if(this['actions'][_0x546047]){if(_['isNil'](this[_0x6563('0x15')][_0x546047][_0x6563('0x142')])){this[_0x6563('0x15')][_0x546047][_0x6563('0x142')]={};}this[_0x6563('0x15')][_0x546047][_0x6563('0x142')][_0x32c097]=_0xf809af;}};Preview[_0x6563('0x5f')][_0x6563('0x1f')]=function(_0x35989a){try{if(!_[_0x6563('0x7f')](_0x35989a)){if(ut[_0x6563('0x143')](_[_0x6563('0x144')](_0x35989a[_0x6563('0x145')])[0x0])){this[_0x6563('0x141')](_0x35989a[_0x6563('0xaf')],_[_0x6563('0x144')](_0x35989a[_0x6563('0x145')])[0x0],_0x35989a[_0x6563('0x146')]);}}}catch(_0x370d72){logger['error'](_0x6563('0x147'),util['inspect'](_0x370d72,{'showHidden':![],'depth':null}));}};Preview[_0x6563('0x5f')]['syncAttendedTransfer']=function(_0x5b4722){if(_0x5b4722){if(this[_0x6563('0x15')][_0x5b4722[_0x6563('0x148')]]){this[_0x6563('0x15')][_0x5b4722[_0x6563('0x148')]]['transfer']=!![];}}};Preview[_0x6563('0x5f')][_0x6563('0x22')]=function(_0x451bc0){if(_0x451bc0){if(this[_0x6563('0x15')][_0x451bc0[_0x6563('0x149')]]){this[_0x6563('0x15')][_0x451bc0[_0x6563('0x149')]]['transfer']=!![];}}};module[_0x6563('0x14a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index a00d14a..f182c24 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 _0x4a7f=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4a7f,0x15b));var _0xf4a7=function(_0x21686a,_0x139cd2){_0x21686a=_0x21686a-0x0;var _0x168a0c=_0x4a7f[_0x21686a];return _0x168a0c;};'use strict';var util=require(_0xf4a7('0x0'));var BPromise=require(_0xf4a7('0x1'));var logger=require(_0xf4a7('0x2'))(_0xf4a7('0x3'));var _=require(_0xf4a7('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xf4a7('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xf4a7('0x6'));var voiceQueueReport=require(_0xf4a7('0x7'));function loggerCatch(_0x2f008a){return function(_0x34b2e4){logger[_0xf4a7('0x8')](_0x2f008a,util['inspect'](_0x34b2e4,{'showHidden':![],'depth':null}));};}function create(_0x130b9b){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopperHistory[_0xf4a7('0xb')](_0x130b9b))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0xd')));}function createAgent(_0xafd829){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](agentReportPreview[_0xf4a7('0xb')](_0xafd829))['catch'](loggerCatch(_0xf4a7('0xd')));}function moveContact(_0x3dd45b){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0xe')](_0x3dd45b,!![]))['catch'](loggerCatch(_0xf4a7('0xf')));}exports[_0xf4a7('0x10')]=function(_0x389a2e){return BPromise['resolve']()[_0xf4a7('0xa')](cmHopperBlack[_0xf4a7('0x10')](_0x389a2e))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x11')));};exports[_0xf4a7('0x12')]=function(_0x255d01){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopper['getContactPreview'](_0x255d01))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x13')));};exports[_0xf4a7('0xb')]=function(_0x77ba24,_0xa4ae5f){create(_0x77ba24)[_0xf4a7('0xc')](loggerCatch(_0xa4ae5f));moveContact(_0x77ba24)['catch'](loggerCatch(_0xa4ae5f));};exports[_0xf4a7('0x14')]=function(_0x1d848c,_0x5e3b74){createAgent(_0x1d848c)[_0xf4a7('0xc')](loggerCatch(_0x5e3b74));};exports[_0xf4a7('0x15')]=function(_0x11f195,_0x3496b1){create(_0x11f195)[_0xf4a7('0xc')](loggerCatch(_0x3496b1));};exports[_0xf4a7('0x16')]=function(_0x1f1389,_0x51ab67){moveContact(_0x1f1389)[_0xf4a7('0xc')](loggerCatch(_0x51ab67));};exports[_0xf4a7('0x17')]=function(_0x16b839,_0x2e7522,_0x3a4459){if(_0x2e7522){_0x16b839[_0xf4a7('0x18')]=null;}if(_0x3a4459){_0x16b839[_0xf4a7('0x19')]=![];}return BPromise['resolve']()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x17')](_0x16b839))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x1a')));};exports[_0xf4a7('0x1b')]=function(_0x13fbfe){return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x1b')](_0x13fbfe))[_0xf4a7('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xf4a7('0x1c')]=function(_0x223675){return BPromise['resolve']()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x1c')]({'UserId':null},_0x223675,0x1))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x1d')));};exports[_0xf4a7('0x1e')]=function(_0x2ab40f){return BPromise['resolve']()['then'](cmHopper[_0xf4a7('0x1c')]({'active':![]},_0x2ab40f,0x1))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x1f')));};exports[_0xf4a7('0x20')]=function(_0x338174){var _0x1df37e={};_0x1df37e[_0xf4a7('0x21')]=_0x338174[_0xf4a7('0x21')];_0x1df37e[_0xf4a7('0x22')]=_0x338174['uniqueid'];_0x1df37e[_0xf4a7('0x23')]=_0x338174[_0xf4a7('0x23')];_0x1df37e[_0xf4a7('0x24')]=_0x338174[_0xf4a7('0x24')];_0x1df37e[_0xf4a7('0x25')]=_0x338174[_0xf4a7('0x25')];_0x1df37e[_0xf4a7('0x26')]=_0x338174[_0xf4a7('0x27')];_0x1df37e[_0xf4a7('0x28')]=_0x338174[_0xf4a7('0x27')];_0x1df37e[_0xf4a7('0x29')]=0x1;_0x1df37e[_0xf4a7('0x2a')]=_0x338174[_0xf4a7('0x2b')];_0x1df37e[_0xf4a7('0x2c')]=_0x338174['membername'];_0x1df37e[_0xf4a7('0x2d')]='from-sip';_0x1df37e[_0xf4a7('0x2e')]=_0xf4a7('0x2f');_0x1df37e[_0xf4a7('0x30')]=0x0;_0x1df37e[_0xf4a7('0x31')]=0x1;_0x1df37e[_0xf4a7('0x32')]=_0x338174['membername'];_0x1df37e[_0xf4a7('0x33')]=_0xf4a7('0x34');return BPromise[_0xf4a7('0x9')]()[_0xf4a7('0xa')](voiceQueueReport['create'](_0x1df37e))[_0xf4a7('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x98fd18,_0x2085f6){return BPromise[_0xf4a7('0x9')]()['then'](cmHopper[_0xf4a7('0x35')](_0x98fd18,_0x2085f6))[_0xf4a7('0xc')](loggerCatch(_0xf4a7('0x36')));};exports['rescheduleContactInQueue']=function(_0x156ef7){return BPromise['resolve']()[_0xf4a7('0xa')](cmHopper[_0xf4a7('0x17')](_0x156ef7,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x808e=['answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createAgentHistory','rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt'];(function(_0x8df671,_0x92ff2f){var _0x34c072=function(_0x555f32){while(--_0x555f32){_0x8df671['push'](_0x8df671['shift']());}};_0x34c072(++_0x92ff2f);}(_0x808e,0x83));var _0xe808=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x808e[_0x550d12];return _0x12103d;};'use strict';var util=require(_0xe808('0x0'));var BPromise=require('bluebird');var logger=require(_0xe808('0x1'))(_0xe808('0x2'));var _=require(_0xe808('0x3'));var cmHopper=require(_0xe808('0x4'));var cmHopperFinal=require(_0xe808('0x5'));var cmHopperHistory=require(_0xe808('0x6'));var cmHopperBlack=require(_0xe808('0x7'));var voiceQueueRt=require(_0xe808('0x8'));var agentReportPreview=require(_0xe808('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x24e331){return function(_0x296a2c){logger[_0xe808('0xa')](_0x24e331,util[_0xe808('0xb')](_0x296a2c,{'showHidden':![],'depth':null}));};}function create(_0x569968){return BPromise['resolve']()[_0xe808('0xc')](cmHopperHistory[_0xe808('0xd')](_0x569968))[_0xe808('0xe')](loggerCatch(_0xe808('0xf')));}function createAgent(_0x21ff1c){return BPromise['resolve']()[_0xe808('0xc')](agentReportPreview[_0xe808('0xd')](_0x21ff1c))[_0xe808('0xe')](loggerCatch(_0xe808('0xf')));}function moveContact(_0x47d91a){return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopper[_0xe808('0x11')](_0x47d91a,!![]))['catch'](loggerCatch(_0xe808('0x12')));}exports[_0xe808('0x13')]=function(_0x2cc40c){return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopperBlack['checkIsBlackList'](_0x2cc40c))[_0xe808('0xe')](loggerCatch(_0xe808('0x14')));};exports['getContactPreview']=function(_0x498cd6){return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopper['getContactPreview'](_0x498cd6))['catch'](loggerCatch(_0xe808('0x15')));};exports[_0xe808('0xd')]=function(_0x403964,_0x43af26){create(_0x403964)[_0xe808('0xe')](loggerCatch(_0x43af26));moveContact(_0x403964)['catch'](loggerCatch(_0x43af26));};exports[_0xe808('0x16')]=function(_0x27d263,_0x1c3749){createAgent(_0x27d263)[_0xe808('0xe')](loggerCatch(_0x1c3749));};exports['createCustomerHistory']=function(_0x59325e,_0x156526){create(_0x59325e)[_0xe808('0xe')](loggerCatch(_0x156526));};exports['createCustomerFinal']=function(_0x2edf70,_0x3e191d){moveContact(_0x2edf70)[_0xe808('0xe')](loggerCatch(_0x3e191d));};exports[_0xe808('0x17')]=function(_0x50faaa,_0x13d1b2,_0x5ebf37){if(_0x13d1b2){_0x50faaa[_0xe808('0x18')]=null;}if(_0x5ebf37){_0x50faaa['active']=![];}return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopper[_0xe808('0x17')](_0x50faaa))[_0xe808('0xe')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x56df93){return BPromise[_0xe808('0x10')]()['then'](cmHopper[_0xe808('0x19')](_0x56df93))['catch'](loggerCatch(_0xe808('0x1a')));};exports['unlockContact']=function(_0x1a35ec){return BPromise['resolve']()[_0xe808('0xc')](cmHopper[_0xe808('0x1b')]({'UserId':null},_0x1a35ec,0x1))['catch'](loggerCatch(_0xe808('0x1c')));};exports['disableContact']=function(_0x14d0dd){return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopper[_0xe808('0x1b')]({'active':![]},_0x14d0dd,0x1))[_0xe808('0xe')](loggerCatch(_0xe808('0x1d')));};exports[_0xe808('0x1e')]=function(_0x2e07ed){var _0x5e3bee={};_0x5e3bee[_0xe808('0x1f')]=_0x2e07ed[_0xe808('0x1f')];_0x5e3bee[_0xe808('0x20')]=_0x2e07ed['uniqueid'];_0x5e3bee[_0xe808('0x21')]=_0x2e07ed[_0xe808('0x21')];_0x5e3bee[_0xe808('0x22')]=_0x2e07ed[_0xe808('0x22')];_0x5e3bee[_0xe808('0x23')]=_0x2e07ed['queue'];_0x5e3bee[_0xe808('0x24')]=_0x2e07ed[_0xe808('0x25')];_0x5e3bee[_0xe808('0x26')]=_0x2e07ed[_0xe808('0x25')];_0x5e3bee[_0xe808('0x27')]=0x1;_0x5e3bee[_0xe808('0x28')]=_0x2e07ed[_0xe808('0x29')];_0x5e3bee[_0xe808('0x2a')]=_0x2e07ed['membername'];_0x5e3bee['context']=_0xe808('0x2b');_0x5e3bee[_0xe808('0x2c')]=_0xe808('0x2d');_0x5e3bee[_0xe808('0x2e')]=0x0;_0x5e3bee[_0xe808('0x2f')]=0x1;_0x5e3bee[_0xe808('0x30')]=_0x2e07ed[_0xe808('0x31')];_0x5e3bee[_0xe808('0x32')]=_0xe808('0x33');return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](voiceQueueReport[_0xe808('0x34')](_0x5e3bee))[_0xe808('0xe')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xe808('0x35')]=function(_0x4b4576,_0x7974dd){return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopper['getContactRecallMe'](_0x4b4576,_0x7974dd))[_0xe808('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xe808('0x36')]=function(_0x1d1357){return BPromise[_0xe808('0x10')]()[_0xe808('0xc')](cmHopper[_0xe808('0x17')](_0x1d1357,!![],!![]))[_0xe808('0xe')](loggerCatch(_0xe808('0x37')));}; \ 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 8cb0203..d7ab1a3 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 _0x06e6=['CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','info','inspect','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','responsetime','endtime','logAgent','state','statedesc','ringtime','logLookAgent','membername','logCustomer','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','mandatoryDisposition','buildAcw','queue','not_inuse','reachable','push'];(function(_0x549c16,_0x3d29d5){var _0x57cffd=function(_0x4e9f82){while(--_0x4e9f82){_0x549c16['push'](_0x549c16['shift']());}};_0x57cffd(++_0x3d29d5);}(_0x06e6,0xb1));var _0x606e=function(_0x49cee9,_0x28e9de){_0x49cee9=_0x49cee9-0x0;var _0x5c896d=_0x06e6[_0x49cee9];return _0x5c896d;};'use strict';var util=require(_0x606e('0x0'));var _=require(_0x606e('0x1'));var moment=require(_0x606e('0x2'));var logger=require(_0x606e('0x3'))(_0x606e('0x4'));var ipAgi=process['env'][_0x606e('0x5')]||_0x606e('0x6');function getSeconds(_0x166899,_0x58f939){var _0x4aa2d7=moment(_0x166899)['milliseconds'](0x0);var _0x3a557c=moment(_0x58f939)[_0x606e('0x7')](0x0);return _0x4aa2d7[_0x606e('0x8')](_0x3a557c,_0x606e('0x9'));}exports['loggerCatch']=function(_0x59f764){return function(_0x34c2e5){logger[_0x606e('0xa')](_0x59f764,util['inspect'](_0x34c2e5,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1d4a57,_0x3a9927){logger[_0x606e('0xb')](_0x1d4a57,util[_0x606e('0xc')](_0x3a9927,{'showHidden':![],'depth':null}));};exports[_0x606e('0xd')]=function(_0x1d80c6,_0x393f7c){logger[_0x606e('0xa')](_0x1d80c6,util[_0x606e('0xc')](_0x393f7c,{'showHidden':![],'depth':null}));};exports[_0x606e('0xe')]=function(_0x87b239){return function(_0x8d40bb){logger['info'](_0x87b239,util[_0x606e('0xc')](_0x8d40bb,{'showHidden':![],'depth':null}));};};exports[_0x606e('0xf')]=function(_0x119f72,_0x2c44ab,_0x239b62){return{'message':_0x119f72,'unlock':_0x2c44ab,'active':_0x239b62};};exports['getCallerId']=function(_0x4a081d,_0x109010,_0x310c93){if(!_[_0x606e('0x10')](_0x310c93)&&_0x606e('0x11')===typeof _0x310c93&&!_['isEmpty'](_0x310c93)){if(!_[_0x606e('0x10')](_0x109010)&&_0x606e('0x11')===typeof _0x109010&&!_[_0x606e('0x12')](_0x109010)){return util[_0x606e('0x13')](_0x606e('0x14'),_0x109010,_0x310c93);}return util['format'](_0x606e('0x14'),_0x310c93,_0x310c93);}if(!_['isUndefined'](_0x4a081d)&&'string'===typeof _0x4a081d&&!_[_0x606e('0x12')](_0x4a081d)){return _0x4a081d;}return'\x22\x22\x20<>';};exports[_0x606e('0x15')]=function(_0x26321d){if(_['isNil'](_0x26321d)){return![];}return _0x26321d;};exports[_0x606e('0x16')]=function(_0x5bfad0,_0x338299,_0x4100be,_0x52a83d,_0x4c517c,_0x571302){var _0x4e492e={'XMD-QUEUE':_0x338299[_0x606e('0x17')]?_0x338299['Queue'][_0x606e('0x18')]:'','XMD-CALLERID':_0x52a83d,'XMD-CALLERID-PREVIEW':_0x571302?util['format'](_0x606e('0x14'),_0x571302[_0x606e('0x19')],_0x571302[_0x606e('0x1a')]):_0x52a83d,'XMD-DIALID':_0x4c517c,'XMD-CONTACTID':_0x338299[_0x606e('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x52a83d,'XMD-VOICEQUEUEID':_0x338299['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4100be,'XMD-DIALTIMEOUT':_0x5bfad0['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x606e('0x1c'),_0x5bfad0[_0x606e('0x1d')]?'g':'',_[_0x606e('0x12')](_0x5bfad0['monitor_format'])?'':_0x606e('0x1e')),'XMD-DIALURL':_0x5bfad0['dialPreviewUrl']||'','XMD-AGI':_0x5bfad0[_0x606e('0x1f')]?util[_0x606e('0x13')](_0x606e('0x20'),ipAgi,_0x5bfad0[_0x606e('0x1f')]):_0x606e('0x21'),'XMD-AGIAFTER':_0x5bfad0['dialQueueProject2']?util['format'](_0x606e('0x20'),ipAgi,_0x5bfad0['dialQueueProject2']):_0x606e('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x571302?_0x571302['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x571302?_0x571302['originatecalleridname']:'','XMD-DESTINATION':_0x606e('0x22'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x606e('0x12')](_0x5bfad0[_0x606e('0x23')])){_0x4e492e[util['format']('%s',_0x606e('0x24'))]=_0x5bfad0[_0x606e('0x23')];_0x4e492e[util[_0x606e('0x13')]('%s',_0x606e('0x25'))]=_0x4c517c;}if(_0x338299&&_0x338299['Contact']){for(var _0x4c68a0 in _0x338299[_0x606e('0x26')]){if(_0x338299['Contact'][_0x606e('0x27')](_0x4c68a0)){if(!_[_0x606e('0x28')](_0x338299['Contact'][_0x4c68a0])&&_0x4c68a0!=='id'&&_0x4c68a0!==_0x606e('0x29')&&_0x4c68a0!==_0x606e('0x2a')&&_0x4c68a0!=='updatedAt'){_0x4e492e[util[_0x606e('0x13')]('%s%s',_0x606e('0x2b'),_[_0x606e('0x2c')](_0x4c68a0))]=_0x338299[_0x606e('0x26')][_0x4c68a0];}}}}return _0x4e492e;};exports[_0x606e('0x2d')]=function(_0x5bfd7a){var _0x2581e8={};for(var _0x1e2a6e in _0x5bfd7a){if(_0x5bfd7a[_0x606e('0x27')](_0x1e2a6e)){_0x2581e8[util['format']('%s',_[_0x606e('0x2e')](_0x1e2a6e))]=_0x5bfd7a[_0x1e2a6e];}}return{'variables':_0x2581e8};};exports[_0x606e('0x2f')]=function(_0x4e3788,_0x1d5c9a){if(!_[_0x606e('0x28')](_0x4e3788)){if(_0x4e3788['hasOwnProperty'](_0x606e('0x30'))){if(_0x4e3788[_0x606e('0x30')]>0x0){_0x4e3788[_0x606e('0x30')]-=0x1;}else{logger[_0x606e('0xa')](_0x606e('0x31'),_0x1d5c9a);}}}else{logger[_0x606e('0xa')](_0x606e('0x32'),_0x1d5c9a);}};exports[_0x606e('0x33')]=function(_0x264955){var _0x1a256f=moment()['format'](_0x606e('0x34'));_0x264955['state']=0xd;_0x264955['statedesc']='Blacklist';_0x264955[_0x606e('0x35')]=_0x1a256f;_0x264955[_0x606e('0x36')]=_0x1a256f;_0x264955[_0x606e('0x37')]=_0x1a256f;};exports[_0x606e('0x38')]=function(_0x4310d4,_0x4f89f4,_0x386843){var _0x214dd6=moment()[_0x606e('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4310d4[_0x606e('0x39')]=_0x4f89f4;_0x4310d4[_0x606e('0x3a')]=_0x386843;_0x4310d4[_0x606e('0x36')]=_0x214dd6;_0x4310d4[_0x606e('0x3b')]=getSeconds(_0x4310d4[_0x606e('0x36')],_0x4310d4[_0x606e('0x35')]);};exports[_0x606e('0x3c')]=function(_0x2086ad,_0x357ed9,_0x2e577c){_0x2086ad[_0x606e('0x3d')]=_0x357ed9;_0x2086ad['UserId']=_0x2e577c;};exports[_0x606e('0x3e')]=function(_0x23fd45,_0x1b4f23,_0x565828){var _0x29a597=moment()[_0x606e('0x13')](_0x606e('0x34'));_0x23fd45[_0x606e('0x39')]=_0x1b4f23;_0x23fd45[_0x606e('0x3a')]=_0x565828;_0x23fd45[_0x606e('0x36')]=_0x23fd45['responsetime']?_0x23fd45[_0x606e('0x36')]:_0x29a597;_0x23fd45[_0x606e('0x37')]=_0x23fd45[_0x606e('0x37')]?_0x23fd45[_0x606e('0x37')]:_0x29a597;_0x23fd45['ringtime']=getSeconds(_0x23fd45[_0x606e('0x36')]||0x0,_0x23fd45['starttime']||0x0);_0x23fd45['talktime']=_0x23fd45['answertime']?getSeconds(_0x23fd45[_0x606e('0x37')],_0x23fd45[_0x606e('0x3f')]):0x0;};exports[_0x606e('0x40')]=function(_0xd93494){return _0xd93494==='Failure';};exports[_0x606e('0x41')]=function(_0x3c37a8,_0x4d6a0f,_0x143b92,_0x51d0b7,_0x51ad97){var _0x30e288=_0x51d0b7?_0x606e('0x42'):_0x3c37a8[_0x606e('0x19')];_0x30e288=_0x51ad97?_0x606e('0x43'):_0x30e288;return{'actionid':_0x3c37a8[_0x606e('0x44')],'action':'originate','channel':_0x3c37a8[_0x606e('0x45')],'callerid':util[_0x606e('0x13')]('\x22%s\x22\x20<%s>',_0x30e288,_0x3c37a8[_0x606e('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x606e('0x46'),'Priority':'1','variable':_0x143b92,'timeout':(_0x4d6a0f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3c37a8['uniqueid']};};exports[_0x606e('0x47')]=function(_0x2c6bd6){return _0x2c6bd6['countbusyretry']+_0x2c6bd6[_0x606e('0x48')]+_0x2c6bd6[_0x606e('0x49')]+_0x2c6bd6[_0x606e('0x4a')]+_0x2c6bd6[_0x606e('0x4b')];};exports[_0x606e('0x4c')]=function(_0x4c1d00){var _0x2c4b0f=_['clone'](_0x4c1d00);_0x2c4b0f[_0x606e('0x39')]=0xf;_0x2c4b0f['statedesc']=_0x606e('0x4d');return _0x2c4b0f;};exports[_0x606e('0x4e')]=function(_0x1b1632,_0x4e180a,_0x3e207b){var _0x18774f={};_0x18774f[_0x4e180a]=_0x1b1632[_0x4e180a];_0x18774f[_0x606e('0x4f')]=![];_0x18774f[_0x606e('0x50')]=moment()[_0x606e('0x51')](_0x3e207b,_0x606e('0x52'))[_0x606e('0x13')](_0x606e('0x34'));_0x18774f[_0x606e('0x1b')]=_0x1b1632['ContactId'];_0x18774f[_0x606e('0x53')]=_0x1b1632['ListId'];_0x18774f['VoiceQueueId']=_0x1b1632[_0x606e('0x54')]||undefined;return _0x18774f;};exports[_0x606e('0x55')]=function(_0x309149,_0x4cb0c3){if(!_['isNil'](_0x309149)){if(_0x309149['pTalking']>0x0){_0x309149[_0x606e('0x56')]-=0x1;}else{logger['error'](_0x4cb0c3,_0x606e('0x57'));}}else{logger[_0x606e('0xa')](_0x4cb0c3,_0x606e('0x58'));}};exports[_0x606e('0x59')]=function(_0x257c8b){if(_0x257c8b<=0x0){return!![];}return![];};exports['buildObj']=function(_0x416834,_0x2d12b4,_0x2abd56){_0x416834[_0x606e('0x5a')]=_0x2d12b4;_0x416834[_0x606e('0x18')]=_0x416834['queue'];_0x416834[_0x606e('0x5b')]=_0x416834['channelAgent'];_0x416834[_0x606e('0x5c')]='voice';if(_0x2abd56){_0x416834[_0x606e('0x5d')]=_0x2abd56[_0x606e('0x5d')];}return _0x416834;};exports[_0x606e('0x5e')]=function(_0xed25df){var _0x6130a0={};_0x6130a0[_0x606e('0x5f')]=_0xed25df[_0x606e('0x5f')];_0x6130a0[_0x606e('0x5b')]=_0xed25df[_0x606e('0x45')];_0x6130a0['uniqueid']=_0xed25df[_0x606e('0x44')];return _0x6130a0;};exports['agentReadyId']=function(_0x480f76){var _0x598c08=[];for(var _0x49be21 in _0x480f76){if(_0x480f76[_0x606e('0x27')](_0x49be21)){if(!_[_0x606e('0x28')](_0x480f76[_0x49be21])&&_0x480f76[_0x49be21]['state']===_0x606e('0x60')&&_0x480f76[_0x49be21]['status']===_0x606e('0x61')){_0x598c08[_0x606e('0x62')](_0x480f76[_0x49be21]['id']);}}}return _0x598c08;};exports['getDiff']=function(_0x2c1d24){var _0x2cc6fb=moment()[_0x606e('0x7')](0x0);var _0x3f0253=moment(_0x2c1d24)['milliseconds'](0x0);return _0x2cc6fb[_0x606e('0x8')](_0x3f0253,_0x606e('0x9'));};exports['createBody']=function(_0x3739b8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3739b8[_0x606e('0x1b')],'ListId':_0x3739b8[_0x606e('0x53')],'VoiceQueueId':_0x3739b8[_0x606e('0x54')]||undefined,'CampaignId':_0x3739b8[_0x606e('0x63')]||undefined};};exports[_0x606e('0x64')]=function(_0xc4d584){if(_0xc4d584===_0x606e('0x44')||_0xc4d584===_0x606e('0x65')||_0xc4d584===_0x606e('0x5f')||_0xc4d584===_0x606e('0x66')||_0xc4d584===_0x606e('0x67')||_0xc4d584===_0x606e('0x68')||_0xc4d584===_0x606e('0x3d')||_0xc4d584===_0x606e('0x45')||_0xc4d584==='calleridname'||_0xc4d584===_0x606e('0x4f')||_0xc4d584===_0x606e('0x1a')||_0xc4d584===_0x606e('0x50')||_0xc4d584===_0x606e('0x69')||_0xc4d584==='countcongestionretry'||_0xc4d584===_0x606e('0x49')||_0xc4d584===_0x606e('0x6a')||_0xc4d584===_0x606e('0x6b')||_0xc4d584==='callbackuniqueid'||_0xc4d584===_0x606e('0x6c')||_0xc4d584===_0x606e('0x6d')||_0xc4d584==='ContactId'||_0xc4d584===_0x606e('0x53')||_0xc4d584===_0x606e('0x6e')||_0xc4d584===_0x606e('0x54')||_0xc4d584===_0x606e('0x6f')||_0xc4d584===_0x606e('0x70')||_0xc4d584===_0x606e('0x71')||_0xc4d584===_0x606e('0x72')||_0xc4d584==='xmd-listid'||_0xc4d584===_0x606e('0x73')||_0xc4d584===_0x606e('0x74')||_0xc4d584==='xmd-dialoptions'||_0xc4d584===_0x606e('0x75')||_0xc4d584==='xmd-dialchannel'||_0xc4d584===_0x606e('0x76')||_0xc4d584===_0x606e('0x77')||_0xc4d584===_0x606e('0x78')||_0xc4d584===_0x606e('0x79')||_0xc4d584==='xmd-agi'||_0xc4d584===_0x606e('0x7a')||_0xc4d584==='rtpaudioqosbridged'||_0xc4d584===_0x606e('0x7b')||_0xc4d584===_0x606e('0x7c')||_0xc4d584===_0x606e('0x7d')||_0xc4d584==='rtpaudioqoslossbridged'||_0xc4d584===_0x606e('0x7e')||_0xc4d584==='rtpaudioqosrttbridged'||_0xc4d584==='rtpaudioqos'||_0xc4d584===_0x606e('0x7f')||_0xc4d584==='rtpaudioqosjitter'||_0xc4d584===_0x606e('0x7c')||_0xc4d584===_0x606e('0x7d')||_0xc4d584===_0x606e('0x80')||_0xc4d584===_0x606e('0x7e')||_0xc4d584===_0x606e('0x81')||_0xc4d584==='bridgepeer'||_0xc4d584===_0x606e('0x82')||_0xc4d584==='state'||_0xc4d584==='statedesc'){return![];}return!![];};exports[_0x606e('0x83')]=function(_0x321b2c,_0x2eb3d8){var _0x197363,_0x1fe8f1,_0x35cd06;if(_0x2eb3d8<=0x0){_0x2eb3d8=0x1;}_0x197363=new RegExp(_0x606e('0x84')+_0x2eb3d8+'}$');_0x1fe8f1=Math[_0x606e('0x85')](0xa,_0x2eb3d8-0x1);_0x35cd06=Math['pow'](0xa,_0x2eb3d8)-0x1;return util['format']('%s',_['replace'](_0x321b2c,_0x197363,_[_0x606e('0x86')](_0x1fe8f1,_0x35cd06)));};exports[_0x606e('0x87')]=function(_0x42cbd4){var _0x961b9b=_0x42cbd4['match'](/"(.*?)"/);return _0x961b9b?_0x961b9b[0x1]:_0x42cbd4;};exports[_0x606e('0x88')]=function(_0x1e16a3){var _0xa56cc=_0x1e16a3[_0x606e('0x89')](/<(.*?)>/);return _0xa56cc?_0xa56cc[0x1]:_0x1e16a3;}; \ No newline at end of file +var _0x02c5=['Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','buildAcw','agentReadyId','not_inuse','getDiff','seconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','inspect','loggerError','error','logger2','info','message','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','Blacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','logLookAgent','membername','logCustomer','state','endtime','talktime','answertime'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x02c5,0x1e8));var _0x502c=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0x02c5[_0x36436d];return _0x34615d;};'use strict';var util=require('util');var _=require(_0x502c('0x0'));var moment=require(_0x502c('0x1'));var logger=require(_0x502c('0x2'))('preview');var ipAgi=process[_0x502c('0x3')][_0x502c('0x4')]||_0x502c('0x5');function getSeconds(_0x5d71a9,_0x13eb5a){var _0x69826c=moment(_0x5d71a9)['milliseconds'](0x0);var _0x3f4b85=moment(_0x13eb5a)[_0x502c('0x6')](0x0);return _0x69826c[_0x502c('0x7')](_0x3f4b85,'seconds');}exports['loggerCatch']=function(_0x25543a){return function(_0x96348c){logger['error'](_0x25543a,util[_0x502c('0x8')](_0x96348c,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5d7377,_0x52a544){logger['info'](_0x5d7377,util[_0x502c('0x8')](_0x52a544,{'showHidden':![],'depth':null}));};exports[_0x502c('0x9')]=function(_0x19efbd,_0x6bae8f){logger[_0x502c('0xa')](_0x19efbd,util[_0x502c('0x8')](_0x6bae8f,{'showHidden':![],'depth':null}));};exports[_0x502c('0xb')]=function(_0x571d4c){return function(_0x4477a7){logger[_0x502c('0xc')](_0x571d4c,util[_0x502c('0x8')](_0x4477a7,{'showHidden':![],'depth':null}));};};exports[_0x502c('0xd')]=function(_0x275c9f,_0x35b327,_0xfe4e38){return{'message':_0x275c9f,'unlock':_0x35b327,'active':_0xfe4e38};};exports['getCallerId']=function(_0x37abe2,_0x30ab7a,_0x29d1dd){if(!_['isUndefined'](_0x29d1dd)&&'string'===typeof _0x29d1dd&&!_[_0x502c('0xe')](_0x29d1dd)){if(!_[_0x502c('0xf')](_0x30ab7a)&&_0x502c('0x10')===typeof _0x30ab7a&&!_['isEmpty'](_0x30ab7a)){return util[_0x502c('0x11')](_0x502c('0x12'),_0x30ab7a,_0x29d1dd);}return util['format'](_0x502c('0x12'),_0x29d1dd,_0x29d1dd);}if(!_['isUndefined'](_0x37abe2)&&'string'===typeof _0x37abe2&&!_[_0x502c('0xe')](_0x37abe2)){return _0x37abe2;}return _0x502c('0x13');};exports[_0x502c('0x14')]=function(_0x56589e){if(_['isNil'](_0x56589e)){return![];}return _0x56589e;};exports[_0x502c('0x15')]=function(_0x11798c,_0x47ccf5,_0x179fc5,_0xb6d628,_0x4802fc,_0x44222c){var _0x140a31={'XMD-QUEUE':_0x47ccf5['Queue']?_0x47ccf5[_0x502c('0x16')][_0x502c('0x17')]:'','XMD-CALLERID':_0xb6d628,'XMD-CALLERID-PREVIEW':_0x44222c?util[_0x502c('0x11')](_0x502c('0x12'),_0x44222c[_0x502c('0x18')],_0x44222c[_0x502c('0x19')]):_0xb6d628,'XMD-DIALID':_0x4802fc,'XMD-CONTACTID':_0x47ccf5[_0x502c('0x1a')],'XMD-CDRTYPE':_0x502c('0x1b'),'CALLERID(all)':_0xb6d628,'XMD-VOICEQUEUEID':_0x47ccf5[_0x502c('0x1c')],'XMD-DIALCHANNEL':_0x179fc5,'XMD-DIALTIMEOUT':_0x11798c[_0x502c('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x502c('0x11')](_0x502c('0x1e'),_0x11798c[_0x502c('0x1f')]?'g':'',_['isEmpty'](_0x11798c['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x11798c['dialPreviewUrl']||'','XMD-AGI':_0x11798c[_0x502c('0x20')]?util[_0x502c('0x11')](_0x502c('0x21'),ipAgi,_0x11798c['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x11798c['dialQueueProject2']?util[_0x502c('0x11')](_0x502c('0x21'),ipAgi,_0x11798c[_0x502c('0x1f')]):_0x502c('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x44222c?_0x44222c[_0x502c('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x44222c?_0x44222c[_0x502c('0x24')]:'','XMD-DESTINATION':_0x502c('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x11798c[_0x502c('0x26')])){_0x140a31[util[_0x502c('0x11')]('%s',_0x502c('0x27'))]=_0x11798c[_0x502c('0x26')];_0x140a31[util[_0x502c('0x11')]('%s',_0x502c('0x28'))]=_0x4802fc;}if(_0x47ccf5&&_0x47ccf5[_0x502c('0x29')]){for(var _0x81231 in _0x47ccf5[_0x502c('0x29')]){if(_0x47ccf5[_0x502c('0x29')][_0x502c('0x2a')](_0x81231)){if(!_[_0x502c('0x2b')](_0x47ccf5[_0x502c('0x29')][_0x81231])&&_0x81231!=='id'&&_0x81231!==_0x502c('0x2c')&&_0x81231!==_0x502c('0x2d')&&_0x81231!==_0x502c('0x2e')){_0x140a31[util[_0x502c('0x11')]('%s%s',_0x502c('0x2f'),_[_0x502c('0x30')](_0x81231))]=_0x47ccf5['Contact'][_0x81231];}}}}return _0x140a31;};exports['toLowerVariables']=function(_0x1e35dd){var _0x793d1a={};for(var _0x3a6c01 in _0x1e35dd){if(_0x1e35dd[_0x502c('0x2a')](_0x3a6c01)){_0x793d1a[util[_0x502c('0x11')]('%s',_[_0x502c('0x31')](_0x3a6c01))]=_0x1e35dd[_0x3a6c01];}}return{'variables':_0x793d1a};};exports[_0x502c('0x32')]=function(_0x14046f,_0x363ec0){if(!_['isNil'](_0x14046f)){if(_0x14046f[_0x502c('0x2a')](_0x502c('0x33'))){if(_0x14046f['originated']>0x0){_0x14046f[_0x502c('0x33')]-=0x1;}else{logger['error'](_0x502c('0x34'),_0x363ec0);}}}else{logger[_0x502c('0xa')](_0x502c('0x35'),_0x363ec0);}};exports[_0x502c('0x36')]=function(_0x475ba8){var _0x1303a2=moment()[_0x502c('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x475ba8['state']=0xd;_0x475ba8['statedesc']=_0x502c('0x37');_0x475ba8[_0x502c('0x38')]=_0x1303a2;_0x475ba8[_0x502c('0x39')]=_0x1303a2;_0x475ba8['endtime']=_0x1303a2;};exports[_0x502c('0x3a')]=function(_0x55af7b,_0x33aea7,_0x45900e){var _0x2f1003=moment()[_0x502c('0x11')](_0x502c('0x3b'));_0x55af7b['state']=_0x33aea7;_0x55af7b[_0x502c('0x3c')]=_0x45900e;_0x55af7b[_0x502c('0x39')]=_0x2f1003;_0x55af7b['ringtime']=getSeconds(_0x55af7b['responsetime'],_0x55af7b[_0x502c('0x38')]);};exports[_0x502c('0x3d')]=function(_0x4a9c02,_0x11490c,_0x5fd306){_0x4a9c02[_0x502c('0x3e')]=_0x11490c;_0x4a9c02['UserId']=_0x5fd306;};exports[_0x502c('0x3f')]=function(_0x153140,_0x1d14f4,_0x4d45c2){var _0x5ac2e7=moment()['format'](_0x502c('0x3b'));_0x153140[_0x502c('0x40')]=_0x1d14f4;_0x153140[_0x502c('0x3c')]=_0x4d45c2;_0x153140[_0x502c('0x39')]=_0x153140[_0x502c('0x39')]?_0x153140[_0x502c('0x39')]:_0x5ac2e7;_0x153140[_0x502c('0x41')]=_0x153140[_0x502c('0x41')]?_0x153140[_0x502c('0x41')]:_0x5ac2e7;_0x153140['ringtime']=getSeconds(_0x153140[_0x502c('0x39')]||0x0,_0x153140['starttime']||0x0);_0x153140[_0x502c('0x42')]=_0x153140[_0x502c('0x43')]?getSeconds(_0x153140['endtime'],_0x153140[_0x502c('0x43')]):0x0;};exports['isFailure']=function(_0x6f8bd0){return _0x6f8bd0===_0x502c('0x44');};exports[_0x502c('0x45')]=function(_0x4708d3,_0x9763a1,_0x2b2dcf,_0x180002,_0x5c12a3){var _0x21a828=_0x180002?_0x502c('0x46'):_0x4708d3[_0x502c('0x18')];_0x21a828=_0x5c12a3?_0x502c('0x47'):_0x21a828;return{'actionid':_0x4708d3[_0x502c('0x48')],'action':_0x502c('0x49'),'channel':_0x4708d3[_0x502c('0x4a')],'callerid':util[_0x502c('0x11')](_0x502c('0x12'),_0x21a828,_0x4708d3[_0x502c('0x19')]),'Exten':_0x502c('0x25'),'Context':_0x502c('0x4b'),'Priority':'1','variable':_0x2b2dcf,'timeout':(_0x9763a1[_0x502c('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4708d3[_0x502c('0x48')]};};exports['totalGlobal']=function(_0x212d37){return _0x212d37[_0x502c('0x4d')]+_0x212d37[_0x502c('0x4e')]+_0x212d37[_0x502c('0x4f')]+_0x212d37[_0x502c('0x50')]+_0x212d37['countnosuchnumberretry'];};exports[_0x502c('0x51')]=function(_0x349806){var _0x364456=_[_0x502c('0x52')](_0x349806);_0x364456[_0x502c('0x40')]=0xf;_0x364456[_0x502c('0x3c')]=_0x502c('0x53');return _0x364456;};exports[_0x502c('0x54')]=function(_0x45563a,_0x31c70e,_0x5e48fd){var _0x1cc938={};_0x1cc938[_0x31c70e]=_0x45563a[_0x31c70e];_0x1cc938['active']=![];_0x1cc938[_0x502c('0x55')]=moment()[_0x502c('0x56')](_0x5e48fd,_0x502c('0x57'))['format'](_0x502c('0x3b'));_0x1cc938[_0x502c('0x1a')]=_0x45563a[_0x502c('0x1a')];_0x1cc938[_0x502c('0x58')]=_0x45563a[_0x502c('0x58')];_0x1cc938['VoiceQueueId']=_0x45563a['VoiceQueueId']||undefined;return _0x1cc938;};exports['decrementTalkink']=function(_0x5e061e,_0x5e3193){if(!_[_0x502c('0x2b')](_0x5e061e)){if(_0x5e061e['pTalking']>0x0){_0x5e061e[_0x502c('0x59')]-=0x1;}else{logger[_0x502c('0xa')](_0x5e3193,_0x502c('0x5a'));}}else{logger['error'](_0x5e3193,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x502c('0x5b')]=function(_0x194f92){if(_0x194f92<=0x0){return!![];}return![];};exports[_0x502c('0x5c')]=function(_0x19b8f4,_0x32b83c,_0x398547){_0x19b8f4[_0x502c('0x5d')]=_0x32b83c;_0x19b8f4[_0x502c('0x17')]=_0x19b8f4[_0x502c('0x5e')];_0x19b8f4[_0x502c('0x5f')]=_0x19b8f4[_0x502c('0x4a')];_0x19b8f4[_0x502c('0x60')]=_0x502c('0x61');if(_0x398547){_0x19b8f4['mandatoryDisposition']=_0x398547['mandatoryDisposition'];}return _0x19b8f4;};exports[_0x502c('0x62')]=function(_0x1818e5){var _0x57ed87={};_0x57ed87[_0x502c('0x5e')]=_0x1818e5[_0x502c('0x5e')];_0x57ed87[_0x502c('0x5f')]=_0x1818e5[_0x502c('0x4a')];_0x57ed87[_0x502c('0x48')]=_0x1818e5[_0x502c('0x48')];return _0x57ed87;};exports[_0x502c('0x63')]=function(_0x1cc4a7){var _0x582ca6=[];for(var _0x66878d in _0x1cc4a7){if(_0x1cc4a7[_0x502c('0x2a')](_0x66878d)){if(!_[_0x502c('0x2b')](_0x1cc4a7[_0x66878d])&&_0x1cc4a7[_0x66878d]['state']===_0x502c('0x64')&&_0x1cc4a7[_0x66878d]['status']==='reachable'){_0x582ca6['push'](_0x1cc4a7[_0x66878d]['id']);}}}return _0x582ca6;};exports[_0x502c('0x65')]=function(_0x2f99f3){var _0x332594=moment()['milliseconds'](0x0);var _0x350829=moment(_0x2f99f3)['milliseconds'](0x0);return _0x332594[_0x502c('0x7')](_0x350829,_0x502c('0x66'));};exports['createBody']=function(_0x21506f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x21506f['ContactId'],'ListId':_0x21506f[_0x502c('0x58')],'VoiceQueueId':_0x21506f['VoiceQueueId']||undefined,'CampaignId':_0x21506f[_0x502c('0x67')]||undefined};};exports[_0x502c('0x68')]=function(_0x1dbf98){if(_0x1dbf98===_0x502c('0x48')||_0x1dbf98===_0x502c('0x69')||_0x1dbf98===_0x502c('0x5e')||_0x1dbf98===_0x502c('0x6a')||_0x1dbf98===_0x502c('0x6b')||_0x1dbf98===_0x502c('0x6c')||_0x1dbf98==='membername'||_0x1dbf98===_0x502c('0x4a')||_0x1dbf98===_0x502c('0x18')||_0x1dbf98===_0x502c('0x6d')||_0x1dbf98===_0x502c('0x19')||_0x1dbf98===_0x502c('0x55')||_0x1dbf98==='countbusyretry'||_0x1dbf98===_0x502c('0x4e')||_0x1dbf98===_0x502c('0x4f')||_0x1dbf98==='countglobal'||_0x1dbf98===_0x502c('0x6e')||_0x1dbf98==='callbackuniqueid'||_0x1dbf98===_0x502c('0x6f')||_0x1dbf98===_0x502c('0x70')||_0x1dbf98===_0x502c('0x1a')||_0x1dbf98===_0x502c('0x58')||_0x1dbf98===_0x502c('0x71')||_0x1dbf98===_0x502c('0x1c')||_0x1dbf98===_0x502c('0x72')||_0x1dbf98===_0x502c('0x73')||_0x1dbf98==='xmd-queue'||_0x1dbf98===_0x502c('0x74')||_0x1dbf98===_0x502c('0x75')||_0x1dbf98===_0x502c('0x76')||_0x1dbf98===_0x502c('0x77')||_0x1dbf98==='xmd-dialoptions'||_0x1dbf98==='xmd-dialid'||_0x1dbf98===_0x502c('0x78')||_0x1dbf98===_0x502c('0x79')||_0x1dbf98==='xmd-cdrtype'||_0x1dbf98===_0x502c('0x7a')||_0x1dbf98===_0x502c('0x7b')||_0x1dbf98===_0x502c('0x7c')||_0x1dbf98===_0x502c('0x7d')||_0x1dbf98==='rtpaudioqosbridged'||_0x1dbf98==='rtpaudioqosjitter'||_0x1dbf98===_0x502c('0x7e')||_0x1dbf98===_0x502c('0x7f')||_0x1dbf98==='rtpaudioqoslossbridged'||_0x1dbf98===_0x502c('0x80')||_0x1dbf98===_0x502c('0x81')||_0x1dbf98===_0x502c('0x7d')||_0x1dbf98==='rtpaudioqosbridged'||_0x1dbf98===_0x502c('0x82')||_0x1dbf98===_0x502c('0x7e')||_0x1dbf98==='rtpaudioqosloss'||_0x1dbf98===_0x502c('0x83')||_0x1dbf98===_0x502c('0x80')||_0x1dbf98===_0x502c('0x81')||_0x1dbf98==='bridgepeer'||_0x1dbf98==='bridgepvtcallid'||_0x1dbf98==='state'||_0x1dbf98==='statedesc'){return![];}return!![];};exports[_0x502c('0x84')]=function(_0x47fdb9,_0x12a523){var _0x55945e,_0x2f8d00,_0x2f7f43;if(_0x12a523<=0x0){_0x12a523=0x1;}_0x55945e=new RegExp(_0x502c('0x85')+_0x12a523+'}$');_0x2f8d00=Math[_0x502c('0x86')](0xa,_0x12a523-0x1);_0x2f7f43=Math[_0x502c('0x86')](0xa,_0x12a523)-0x1;return util['format']('%s',_[_0x502c('0x87')](_0x47fdb9,_0x55945e,_[_0x502c('0x88')](_0x2f8d00,_0x2f7f43)));};exports[_0x502c('0x89')]=function(_0x1006a5){var _0x3e88d=_0x1006a5[_0x502c('0x8a')](/"(.*?)"/);return _0x3e88d?_0x3e88d[0x1]:_0x1006a5;};exports['extractCalleridNumber']=function(_0x89b8eb){var _0x522599=_0x89b8eb[_0x502c('0x8a')](/<(.*?)>/);return _0x522599?_0x522599[0x1]:_0x89b8eb;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 3460f81..6a29d1c 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 _0xc85f=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','reload'];(function(_0x4c6f51,_0x2757c4){var _0x28050f=function(_0x24c3fc){while(--_0x24c3fc){_0x4c6f51['push'](_0x4c6f51['shift']());}};_0x28050f(++_0x2757c4);}(_0xc85f,0xcd));var _0xfc85=function(_0x1f68de,_0x470829){_0x1f68de=_0x1f68de-0x0;var _0x152c2d=_0xc85f[_0x1f68de];return _0x152c2d;};'use strict';exports[_0xfc85('0x0')]={'queue':{'type':_0xfc85('0x1'),'required':!![]},'interface':{'type':_0xfc85('0x1'),'required':!![]},'membername':{'type':_0xfc85('0x1'),'required':!![]},'penalty':{'type':_0xfc85('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xfc85('0x1'),'required':!![]},'interface':{'type':_0xfc85('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xfc85('0x1'),'required':!![]},'paused':{'type':_0xfc85('0x3')},'reason':{'type':'string','required':![]}};exports[_0xfc85('0x4')]={'module':{'type':_0xfc85('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xfc85('0x1'),'required':!![]},'filename':{'type':_0xfc85('0x1')},'format':{'type':_0xfc85('0x1')},'mixmonitorid':{'type':_0xfc85('0x1')}};exports[_0xfc85('0x5')]={'uniqueid':{'type':_0xfc85('0x1'),'required':!![]}};exports[_0xfc85('0x6')]={'uniqueid':{'type':_0xfc85('0x1'),'required':!![]},'exten':{'type':_0xfc85('0x1'),'required':!![]},'context':{'type':_0xfc85('0x1')}}; \ No newline at end of file +var _0x3899=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','queueadd','string','number'];(function(_0x13d97d,_0x145deb){var _0x4b065a=function(_0x2157a6){while(--_0x2157a6){_0x13d97d['push'](_0x13d97d['shift']());}};_0x4b065a(++_0x145deb);}(_0x3899,0x126));var _0x9389=function(_0x16ed05,_0x568394){_0x16ed05=_0x16ed05-0x0;var _0x48a3c4=_0x3899[_0x16ed05];return _0x48a3c4;};'use strict';exports[_0x9389('0x0')]={'queue':{'type':_0x9389('0x1'),'required':!![]},'interface':{'type':_0x9389('0x1'),'required':!![]},'membername':{'type':_0x9389('0x1'),'required':!![]},'penalty':{'type':_0x9389('0x2'),'required':![]},'paused':{'type':_0x9389('0x3'),'required':![]}};exports[_0x9389('0x4')]={'queue':{'type':_0x9389('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x9389('0x5')]={'interface':{'type':_0x9389('0x1'),'required':!![]},'paused':{'type':_0x9389('0x3')},'reason':{'type':'string','required':![]}};exports[_0x9389('0x6')]={'module':{'type':_0x9389('0x1'),'required':![]}};exports[_0x9389('0x7')]={'uniqueid':{'type':_0x9389('0x1'),'required':!![]}};exports[_0x9389('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x9389('0x1')},'format':{'type':_0x9389('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x9389('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x9389('0x1'),'required':!![]},'exten':{'type':_0x9389('0x1'),'required':!![]},'context':{'type':_0x9389('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index c295aca..1b1a0e4 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 _0x0334=['total','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','duration','disposition','billableseconds','campaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','diff','seconds'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x0334,0x14c));var _0x4033=function(_0x23ccc4,_0x2d2059){_0x23ccc4=_0x23ccc4-0x0;var _0xb6498d=_0x0334[_0x23ccc4];return _0xb6498d;};'use strict';var BPromise=require(_0x4033('0x0'));var util=require(_0x4033('0x1'));var _=require(_0x4033('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x4033('0x3'));var VoiceQueue=require(_0x4033('0x4'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x4033('0x5'));var VoiceExtension=require(_0x4033('0x6'));var ZendeskAccount=require(_0x4033('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x4033('0x8'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4033('0x9'));var VtigerAccount=require(_0x4033('0xa'));var ServicenowAccount=require(_0x4033('0xb'));var Dynamics365Account=require(_0x4033('0xc'));var FreshsalesAccount=require(_0x4033('0xd'));var FaxAccount=require(_0x4033('0xe'));var Realtime=function(){this['agents']={};this[_0x4033('0xf')]={};this['trunks']={};this[_0x4033('0x10')]={};this[_0x4033('0x11')]={};this['campaigns']={};this[_0x4033('0x12')]={};this[_0x4033('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4033('0x14')]={};this[_0x4033('0x15')]={};this['queueChannels']={};this['outboundChannels']={};this[_0x4033('0x16')]={};this[_0x4033('0x17')]={};this[_0x4033('0x18')]={};this['salesforceAccounts']={};this[_0x4033('0x19')]={};this[_0x4033('0x1a')]={};this[_0x4033('0x1b')]={};this['deskAccounts']={};this[_0x4033('0x1c')]={};this[_0x4033('0x1d')]={};this['dynamics365Accounts']={};this[_0x4033('0x1e')]={};this[_0x4033('0x1f')]={};};function freeIsNotKey(_0x47d1ca,_0x1013fb,_0x29ba24){var _0x29c0d4=_[_0x4033('0x20')](_0x47d1ca,function(_0xa20b53,_0xa2318e){return _0xa20b53[_0x29ba24];});for(var _0x2e1ccc in _0x1013fb){if(_0x1013fb[_0x4033('0x21')](_0x2e1ccc)){if(!_0x29c0d4[_0x2e1ccc]){delete _0x1013fb[_0x2e1ccc];}}}}function freeIsNotKeySip(_0x20de76,_0x34936b){var _0x18ec7a=_[_0x4033('0x20')](_0x20de76,function(_0x5933f0,_0x19195b){return util['format'](_0x4033('0x22'),_0x5933f0[_0x4033('0x23')]);});for(var _0x56a16d in _0x34936b){if(_0x34936b['hasOwnProperty'](_0x56a16d)){if(!_0x18ec7a[_0x56a16d]){delete _0x34936b[_0x56a16d];}}}}function freeIsNotKeyAgent(_0x4eddbd,_0x31630f){var _0x568f9d=_[_0x4033('0x20')](_0x4eddbd,function(_0x17a6e3,_0xea6f8c){var _0x596b95=_[_0x4033('0x24')](_0x17a6e3[_0x4033('0x25')])?util[_0x4033('0x26')]('SIP/%s',_0x17a6e3[_0x4033('0x23')]):_0x17a6e3[_0x4033('0x25')];return _0x596b95;});for(var _0x28677d in _0x31630f){if(_0x31630f[_0x4033('0x21')](_0x28677d)){if(!_0x568f9d[_0x28677d]){delete _0x31630f[_0x28677d];}}}}function clearVoiceCallReports(_0x407b60){_0x407b60['total']=0x0;_0x407b60['answered']=0x0;_0x407b60[_0x4033('0x27')]=0x0;_0x407b60[_0x4033('0x28')]=0x0;_0x407b60[_0x4033('0x29')]=0x0;}function clearCampaigns(_0x298c1d){if(!_[_0x4033('0x2a')](_0x298c1d)){for(var _0x1e7b36 in _0x298c1d){if(_0x298c1d['hasOwnProperty'](_0x1e7b36)){_0x298c1d[_0x1e7b36][_0x4033('0x2b')]=0x0;_0x298c1d[_0x1e7b36][_0x4033('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x12115e){if(!_[_0x4033('0x2a')](_0x12115e)){for(var _0x4d36a4 in _0x12115e){if(_0x12115e[_0x4033('0x21')](_0x4d36a4)){_0x12115e[_0x4d36a4]['total']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x2d')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x2e')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x2f')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x27')]=0x0;_0x12115e[_0x4d36a4]['sumDuration']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x29')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x30')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x31')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x32')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x33')]=0x0;_0x12115e[_0x4d36a4]['outboundNoSuchCallsDay']=0x0;_0x12115e[_0x4d36a4]['outboundUnknownCallsDay']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x34')]=0x0;_0x12115e[_0x4d36a4]['outboundDropCallsDayCallersExit']=0x0;_0x12115e[_0x4d36a4][_0x4033('0x35')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x36')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x37')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x38')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x30')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x39')]=0x0;_0x12115e[_0x4d36a4][_0x4033('0x3a')]=!![];}}}}Realtime[_0x4033('0x3b')][_0x4033('0x3c')]=function(_0x32b6c7,_0x539074){for(var _0x1d9130 in _0x539074){if(_0x32b6c7['hasOwnProperty'](_0x1d9130)){_0x32b6c7[_0x1d9130]=_0x539074[_0x1d9130];}}};Realtime[_0x4033('0x3b')][_0x4033('0x3d')]=function(){var _0x5aabb5=this;return function(_0xf72e45){if(_0xf72e45){freeIsNotKeyAgent(_0xf72e45,_0x5aabb5[_0x4033('0x3e')]);for(var _0x13087e=0x0,_0x530d6c={},_0x2ff269={};_0x13087e<_0xf72e45[_0x4033('0x3f')];_0x13087e+=0x1){_0x530d6c=_0xf72e45[_0x13087e];var _0x48bfe5=_['isNil'](_0x530d6c[_0x4033('0x25')])?util[_0x4033('0x26')]('SIP/%s',_0x530d6c[_0x4033('0x23')]):_0x530d6c[_0x4033('0x25')];if(_[_0x4033('0x40')](_0x5aabb5[_0x4033('0x3e')][_0x48bfe5])){_0x5aabb5[_0x4033('0x3e')][_0x48bfe5]=new Agent(_0x530d6c);}else{_0x5aabb5[_0x4033('0x3c')](_0x5aabb5[_0x4033('0x3e')][_0x48bfe5],_0x530d6c);}}}return _0x5aabb5['agents'];};};Realtime[_0x4033('0x3b')][_0x4033('0x41')]=function(){var _0x2fdf8f=this;return function(_0x2e96c9){if(_0x2e96c9){freeIsNotKeySip(_0x2e96c9,_0x2fdf8f[_0x4033('0xf')]);for(var _0x27dc86=0x0,_0x353608={},_0x17e06c={};_0x27dc86<_0x2e96c9[_0x4033('0x3f')];_0x27dc86+=0x1){_0x353608=_0x2e96c9[_0x27dc86];if(_[_0x4033('0x40')](_0x2fdf8f['telephones'][util[_0x4033('0x26')](_0x4033('0x22'),_0x353608['name'])])){_0x2fdf8f[_0x4033('0xf')][util[_0x4033('0x26')]('SIP/%s',_0x353608[_0x4033('0x23')])]=new Telephone(_0x353608);}else{_0x2fdf8f[_0x4033('0x3c')](_0x2fdf8f[_0x4033('0xf')][util['format'](_0x4033('0x22'),_0x353608[_0x4033('0x23')])],_0x353608);}}}return _0x2fdf8f[_0x4033('0xf')];};};Realtime[_0x4033('0x3b')][_0x4033('0x42')]=function(){var _0x473225=this;return function(_0x3aa4f5){if(_0x3aa4f5){freeIsNotKeySip(_0x3aa4f5,_0x473225[_0x4033('0x43')]);for(var _0x477bde=0x0,_0x4abc04={},_0x561686={};_0x477bde<_0x3aa4f5[_0x4033('0x3f')];_0x477bde+=0x1){_0x4abc04=_0x3aa4f5[_0x477bde];if(_[_0x4033('0x40')](_0x473225['trunks'][util[_0x4033('0x26')](_0x4033('0x22'),_0x4abc04[_0x4033('0x23')])])){_0x473225['trunks'][util[_0x4033('0x26')]('SIP/%s',_0x4abc04['name'])]=new Trunk(_0x4abc04);}else{_0x473225[_0x4033('0x3c')](_0x473225[_0x4033('0x43')][util[_0x4033('0x26')](_0x4033('0x22'),_0x4abc04[_0x4033('0x23')])],_0x4abc04);}}}return _0x473225['trunks'];};};Realtime[_0x4033('0x3b')][_0x4033('0x44')]=function(){var _0x4d9e1f=this;return function(_0x4de6aa){if(_0x4de6aa){freeIsNotKey(_0x4de6aa,_0x4d9e1f[_0x4033('0x10')],_0x4033('0x23'));for(var _0x58e173=0x0,_0x2ce338={},_0x161825={};_0x58e173<_0x4de6aa[_0x4033('0x3f')];_0x58e173+=0x1){_0x2ce338=_0x4de6aa[_0x58e173];if(_[_0x4033('0x40')](_0x4d9e1f[_0x4033('0x10')][_0x2ce338[_0x4033('0x23')]])){_0x4d9e1f['voiceQueues'][_0x2ce338['name']]=new VoiceQueue(_0x2ce338);}else{_0x4d9e1f[_0x4033('0x3c')](_0x4d9e1f[_0x4033('0x10')][_0x2ce338[_0x4033('0x23')]],_0x2ce338);}}}return _0x4d9e1f[_0x4033('0x10')];};};Realtime['prototype'][_0x4033('0x45')]=function(){var _0x405e86=this;return function(_0x39afad){if(_0x39afad){freeIsNotKey(_0x39afad,_0x405e86[_0x4033('0x11')],'id');for(var _0x432496=0x0,_0x34c735={},_0x19d901={};_0x432496<_0x39afad[_0x4033('0x3f')];_0x432496+=0x1){_0x34c735=_0x39afad[_0x432496];if(_[_0x4033('0x40')](_0x405e86['triggers'][_0x34c735['id']])){_0x405e86[_0x4033('0x11')][_0x34c735['id']]=new Trigger(_0x34c735);}else{_0x405e86[_0x4033('0x3c')](_0x405e86[_0x4033('0x11')][_0x34c735['id']],_0x34c735);}}}return _0x405e86[_0x4033('0x11')];};};Realtime['prototype'][_0x4033('0x46')]=function(){var _0x1129ef=this;return function(_0x1d447c){if(_0x1d447c){freeIsNotKey(_0x1d447c,_0x1129ef['templates'],'id');for(var _0x5c4e36=0x0,_0x393b81={},_0x378445={};_0x5c4e36<_0x1d447c[_0x4033('0x3f')];_0x5c4e36+=0x1){_0x393b81=_0x1d447c[_0x5c4e36];if(_[_0x4033('0x40')](_0x1129ef[_0x4033('0x12')][_0x393b81['id']])){_0x1129ef['templates'][_0x393b81['id']]=new Template(_0x393b81);}else{_0x1129ef[_0x4033('0x3c')](_0x1129ef[_0x4033('0x12')][_0x393b81['id']],_0x393b81);}}}return _0x1129ef[_0x4033('0x12')];};};Realtime['prototype'][_0x4033('0x47')]=function(){var _0x27086c=this;return function(_0x26139d){if(_0x26139d){freeIsNotKey(_0x26139d,_0x27086c['zendeskAccounts'],'id');for(var _0x463813=0x0,_0x330865={},_0xc3af={};_0x463813<_0x26139d['length'];_0x463813+=0x1){_0x330865=_0x26139d[_0x463813];if(_['isUndefined'](_0x27086c['zendeskAccounts'][_0x330865['id']])){_0x27086c[_0x4033('0x18')][_0x330865['id']]=new ZendeskAccount(_0x330865);}else{_0x27086c['mergeFromDatabase'](_0x27086c[_0x4033('0x18')][_0x330865['id']],_0x330865);}}}return _0x27086c['zendeskAccounts'];};};Realtime[_0x4033('0x3b')][_0x4033('0x48')]=function(){var _0xd2b79=this;return function(_0x5206fa){if(_0x5206fa){freeIsNotKey(_0x5206fa,_0xd2b79[_0x4033('0x49')],'id');for(var _0x5f092c=0x0,_0x4b55ae={},_0x10db47={};_0x5f092c<_0x5206fa[_0x4033('0x3f')];_0x5f092c+=0x1){_0x4b55ae=_0x5206fa[_0x5f092c];if(_[_0x4033('0x40')](_0xd2b79[_0x4033('0x49')][_0x4b55ae['id']])){_0xd2b79['salesforceAccounts'][_0x4b55ae['id']]=new SalesforceAccount(_0x4b55ae);}else{_0xd2b79[_0x4033('0x3c')](_0xd2b79[_0x4033('0x49')][_0x4b55ae['id']],_0x4b55ae);}}}return _0xd2b79['salesforceAccounts'];};};Realtime[_0x4033('0x3b')]['initFreshdeskAccounts']=function(){var _0x5c5261=this;return function(_0x195fb8){if(_0x195fb8){freeIsNotKey(_0x195fb8,_0x5c5261['freshdeskAccounts'],'id');for(var _0x3e610d=0x0,_0x2dcdec={},_0x2c0c7a={};_0x3e610d<_0x195fb8[_0x4033('0x3f')];_0x3e610d+=0x1){_0x2dcdec=_0x195fb8[_0x3e610d];if(_[_0x4033('0x40')](_0x5c5261[_0x4033('0x1a')][_0x2dcdec['id']])){_0x5c5261[_0x4033('0x1a')][_0x2dcdec['id']]=new FreshdeskAccount(_0x2dcdec);}else{_0x5c5261[_0x4033('0x3c')](_0x5c5261[_0x4033('0x1a')][_0x2dcdec['id']],_0x2dcdec);}}}return _0x5c5261['freshdeskAccounts'];};};Realtime[_0x4033('0x3b')][_0x4033('0x4a')]=function(){var _0x4c7155=this;return function(_0x37f464){if(_0x37f464){freeIsNotKey(_0x37f464,_0x4c7155[_0x4033('0x1b')],'id');for(var _0x1c406b=0x0,_0x4e2c83={},_0x375be8={};_0x1c406b<_0x37f464['length'];_0x1c406b+=0x1){_0x4e2c83=_0x37f464[_0x1c406b];if(_[_0x4033('0x40')](_0x4c7155['zohoAccounts'][_0x4e2c83['id']])){_0x4c7155[_0x4033('0x1b')][_0x4e2c83['id']]=new ZohoAccount(_0x4e2c83);}else{_0x4c7155[_0x4033('0x3c')](_0x4c7155['zohoAccounts'][_0x4e2c83['id']],_0x4e2c83);}}}return _0x4c7155[_0x4033('0x1b')];};};Realtime['prototype'][_0x4033('0x4b')]=function(){var _0x4f80ba=this;return function(_0x3997d2){if(_0x3997d2){freeIsNotKey(_0x3997d2,_0x4f80ba[_0x4033('0x4c')],'id');for(var _0x24fb4c=0x0,_0x504dec={},_0x37fdf1={};_0x24fb4c<_0x3997d2['length'];_0x24fb4c+=0x1){_0x504dec=_0x3997d2[_0x24fb4c];if(_['isUndefined'](_0x4f80ba['deskAccounts'][_0x504dec['id']])){_0x4f80ba[_0x4033('0x4c')][_0x504dec['id']]=new DeskAccount(_0x504dec);}else{_0x4f80ba[_0x4033('0x3c')](_0x4f80ba[_0x4033('0x4c')][_0x504dec['id']],_0x504dec);}}}return _0x4f80ba[_0x4033('0x4c')];};};Realtime[_0x4033('0x3b')]['initSugarcrmAccounts']=function(){var _0x5cccc3=this;return function(_0x3f3307){if(_0x3f3307){freeIsNotKey(_0x3f3307,_0x5cccc3[_0x4033('0x19')],'id');for(var _0x3c236f=0x0,_0x3378dc={},_0x2a49e3={};_0x3c236f<_0x3f3307[_0x4033('0x3f')];_0x3c236f+=0x1){_0x3378dc=_0x3f3307[_0x3c236f];if(_[_0x4033('0x40')](_0x5cccc3['sugarcrmAccounts'][_0x3378dc['id']])){_0x5cccc3[_0x4033('0x19')][_0x3378dc['id']]=new SugarcrmAccount(_0x3378dc);}else{_0x5cccc3['mergeFromDatabase'](_0x5cccc3['sugarcrmAccounts'][_0x3378dc['id']],_0x3378dc);}}}return _0x5cccc3['sugarcrmAccounts'];};};Realtime['prototype'][_0x4033('0x4d')]=function(){var _0x5d611b=this;return function(_0x226fb8){if(_0x226fb8){freeIsNotKey(_0x226fb8,_0x5d611b[_0x4033('0x1c')],'id');for(var _0x5c583f=0x0,_0x559730={},_0x61a63f={};_0x5c583f<_0x226fb8[_0x4033('0x3f')];_0x5c583f+=0x1){_0x559730=_0x226fb8[_0x5c583f];if(_[_0x4033('0x40')](_0x5d611b[_0x4033('0x1c')][_0x559730['id']])){_0x5d611b[_0x4033('0x1c')][_0x559730['id']]=new VtigerAccount(_0x559730);}else{_0x5d611b[_0x4033('0x3c')](_0x5d611b[_0x4033('0x1c')][_0x559730['id']],_0x559730);}}}return _0x5d611b['vtigerAccounts'];};};Realtime[_0x4033('0x3b')][_0x4033('0x4e')]=function(){var _0x84cc85=this;return function(_0x520f74){if(_0x520f74){freeIsNotKey(_0x520f74,_0x84cc85['servicenowAccounts'],'id');for(var _0x24f2ce=0x0,_0x12027d={},_0xcbe83b={};_0x24f2ce<_0x520f74[_0x4033('0x3f')];_0x24f2ce+=0x1){_0x12027d=_0x520f74[_0x24f2ce];if(_[_0x4033('0x40')](_0x84cc85['servicenowAccounts'][_0x12027d['id']])){_0x84cc85['servicenowAccounts'][_0x12027d['id']]=new ServicenowAccount(_0x12027d);}else{_0x84cc85['mergeFromDatabase'](_0x84cc85[_0x4033('0x1d')][_0x12027d['id']],_0x12027d);}}}return _0x84cc85['servicenowAccounts'];};};Realtime['prototype'][_0x4033('0x4f')]=function(){var _0x44182f=this;return function(_0x592436){if(_0x592436){freeIsNotKey(_0x592436,_0x44182f[_0x4033('0x50')],'id');for(var _0x44a9b4=0x0,_0x13b7d0={},_0x31c78c={};_0x44a9b4<_0x592436[_0x4033('0x3f')];_0x44a9b4+=0x1){_0x13b7d0=_0x592436[_0x44a9b4];if(_['isUndefined'](_0x44182f['dynamics365Accounts'][_0x13b7d0['id']])){_0x44182f[_0x4033('0x50')][_0x13b7d0['id']]=new Dynamics365Account(_0x13b7d0);}else{_0x44182f[_0x4033('0x3c')](_0x44182f[_0x4033('0x50')][_0x13b7d0['id']],_0x13b7d0);}}}return _0x44182f[_0x4033('0x50')];};};Realtime[_0x4033('0x3b')]['initFreshsalesAccounts']=function(){var _0x33b7d8=this;return function(_0xcedfbb){if(_0xcedfbb){freeIsNotKey(_0xcedfbb,_0x33b7d8[_0x4033('0x1e')],'id');for(var _0x25f919=0x0,_0x46a148={},_0xdc6097={};_0x25f919<_0xcedfbb['length'];_0x25f919+=0x1){_0x46a148=_0xcedfbb[_0x25f919];if(_[_0x4033('0x40')](_0x33b7d8[_0x4033('0x1e')][_0x46a148['id']])){_0x33b7d8['freshsalesAccounts'][_0x46a148['id']]=new FreshsalesAccount(_0x46a148);}else{_0x33b7d8[_0x4033('0x3c')](_0x33b7d8[_0x4033('0x1e')][_0x46a148['id']],_0x46a148);}}}return _0x33b7d8[_0x4033('0x1e')];};};Realtime[_0x4033('0x3b')]['initVoiceQueueHopperHistory']=function(){var _0x28464c=this;return function(_0x5f57c1){for(var _0x2bdfba=0x0;_0x2bdfba<_0x5f57c1[_0x4033('0x3f')];_0x2bdfba+=0x1){_[_0x4033('0x51')](_0x28464c['voiceQueues'][_0x5f57c1[_0x2bdfba][_0x4033('0x23')]],_0x5f57c1[_0x2bdfba]);}return _0x28464c[_0x4033('0x10')];};};Realtime[_0x4033('0x3b')]['initVoiceQueueReports']=function(){var _0x2d20be=this;return function(_0x3313d2){clearVoiceQueues(_0x2d20be[_0x4033('0x10')]);if(_0x3313d2){_0x3313d2=_[_0x4033('0x52')](_0x3313d2,_0x4033('0x53'));for(var _0xfc6c65 in _0x3313d2){if(_0x3313d2[_0x4033('0x21')](_0xfc6c65)){var _0x2091f7={};for(var _0x264493=0x0;_0x264493<_0x3313d2[_0xfc6c65][_0x4033('0x3f')];_0x264493+=0x1){var _0x1c0ca1=_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x54')];if(_0x2d20be[_0x4033('0x10')][_0x1c0ca1]){if(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x55')]){_0x2d20be[_0x4033('0x10')][_0x1c0ca1]['unmanaged']+=0x1;}if(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x56')]){_0x2d20be['voiceQueues'][_0x1c0ca1][_0x4033('0x2f')]+=0x1;}_0x2d20be['voiceQueues'][_0x1c0ca1]['sumHoldTime']+=moment(_0x3313d2[_0xfc6c65][_0x264493]['queuecallerleaveAt'])['diff'](moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x57')]),'seconds')||0x0;if(_0x264493===_0x3313d2[_0xfc6c65][_0x4033('0x3f')]-0x1){_0x2d20be[_0x4033('0x10')][_0x1c0ca1]['sumDuration']+=moment(_0x3313d2[_0xfc6c65][_0x264493]['queuecallercompleteAt']||_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x58')]||_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x59')])[_0x4033('0x5a')](moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x57')]),_0x4033('0x5b'))||0x0;_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x5c')]+=0x1;if(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x5d')]){_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x2d')]+=0x1;_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x29')]+=moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x5e')])[_0x4033('0x5a')](moment(_0x3313d2[_0xfc6c65][_0x264493][_0x4033('0x5f')]),_0x4033('0x5b'))||0x0;}}else{_0x2d20be['voiceQueues'][_0x1c0ca1][_0x4033('0x28')]+=_0x2d20be[_0x4033('0x10')][_0x1c0ca1][_0x4033('0x27')]||0x0;}}}}}}return _0x2d20be[_0x4033('0x10')];};};Realtime['prototype'][_0x4033('0x60')]=function(){var _0x4062af=this;return function(_0x2c31c0){clearVoiceCallReports(_0x4062af['outbound']);if(_0x2c31c0){for(var _0x56baa8=0x0;_0x56baa8<_0x2c31c0['length'];_0x56baa8+=0x1){_0x4062af[_0x4033('0x13')][_0x4033('0x5c')]+=0x1;_0x4062af[_0x4033('0x13')][_0x4033('0x28')]+=_0x2c31c0[_0x56baa8][_0x4033('0x61')];if(_0x2c31c0[_0x56baa8][_0x4033('0x62')]==='ANSWERED'){_0x4062af[_0x4033('0x13')]['answered']+=0x1;_0x4062af[_0x4033('0x13')][_0x4033('0x27')]+=_0x2c31c0[_0x56baa8][_0x4033('0x61')]-_0x2c31c0[_0x56baa8][_0x4033('0x63')]||0x0;_0x4062af['outbound'][_0x4033('0x29')]+=_0x2c31c0[_0x56baa8][_0x4033('0x63')];}}}return _0x4062af[_0x4033('0x13')];};};Realtime[_0x4033('0x3b')]['initCampaigns']=function(){var _0x409b0a=this;return function(_0x486800){if(_0x486800){freeIsNotKey(_0x486800,_0x409b0a[_0x4033('0x64')],_0x4033('0x23'));for(var _0x5122c2=0x0,_0x57a098={};_0x5122c2<_0x486800['length'];_0x5122c2+=0x1){_0x57a098=_0x486800[_0x5122c2];if(_[_0x4033('0x40')](_0x409b0a[_0x4033('0x64')][_0x57a098[_0x4033('0x23')]])){_0x409b0a[_0x4033('0x64')][_0x57a098[_0x4033('0x23')]]=new Campaign(_0x57a098);}else{_0x409b0a[_0x4033('0x3c')](_0x409b0a[_0x4033('0x64')][_0x57a098['name']],_0x57a098);_0x409b0a['campaigns'][_0x57a098[_0x4033('0x23')]][_0x4033('0x65')]=_0x57a098[_0x4033('0x66')]?_0x57a098[_0x4033('0x66')][_0x4033('0x23')]:undefined;}}}return _0x409b0a[_0x4033('0x64')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x355f49=this;return function(_0x2c63eb){if(_0x2c63eb){freeIsNotKey(_0x2c63eb,_0x355f49[_0x4033('0x14')],'id');for(var _0xd42457=0x0,_0x197a14={};_0xd42457<_0x2c63eb[_0x4033('0x3f')];_0xd42457+=0x1){_0x197a14=_0x2c63eb[_0xd42457];if(_[_0x4033('0x40')](_0x355f49[_0x4033('0x14')][_0x197a14['id']])){_0x355f49[_0x4033('0x14')][_0x197a14['id']]=new VoiceExtension(_0x197a14);}else{_0x355f49[_0x4033('0x3c')](_0x355f49[_0x4033('0x14')][_0x197a14['id']],_0x197a14);}}}return _0x355f49['voiceExtensions'];};};Realtime[_0x4033('0x3b')][_0x4033('0x67')]=function(){var _0x13cd4c=this;return function(_0x518401){clearCampaigns(_0x13cd4c[_0x4033('0x64')]);for(var _0x21264f=0x0;_0x21264f<_0x518401[_0x4033('0x3f')];_0x21264f+=0x1){_['merge'](_0x13cd4c[_0x4033('0x64')][_0x518401[_0x21264f][_0x4033('0x23')]],_0x518401[_0x21264f]);}return _0x13cd4c[_0x4033('0x64')];};};Realtime['prototype'][_0x4033('0x68')]=function(){var _0x5f1963=this;return function(_0x553e48){if(_0x553e48){freeIsNotKey(_0x553e48,_0x5f1963[_0x4033('0x1f')],'id');for(var _0xcdfc5=0x0,_0x36a917={},_0x43d5e6={};_0xcdfc5<_0x553e48[_0x4033('0x3f')];_0xcdfc5+=0x1){_0x36a917=_0x553e48[_0xcdfc5];if(_[_0x4033('0x40')](_0x5f1963[_0x4033('0x1f')][_0x36a917['id']])){_0x5f1963[_0x4033('0x1f')][_0x36a917['id']]=new FaxAccount(_0x36a917);}else{_0x5f1963[_0x4033('0x3c')](_0x5f1963[_0x4033('0x1f')][_0x36a917['id']],_0x36a917);}}}return _0x5f1963[_0x4033('0x1f')];};};module[_0x4033('0x69')]=Realtime; \ No newline at end of file +var _0x1d5c=['moment','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','interface','format','total','sumHoldTime','sumDuration','isEmpty','answered','abandoned','sumBillable','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isUndefined','mergeFromDatabase','initTelephones','trunks','initTriggers','initTemplates','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','lodash'];(function(_0x593310,_0x17b9e9){var _0x1ea007=function(_0x4eaceb){while(--_0x4eaceb){_0x593310['push'](_0x593310['shift']());}};_0x1ea007(++_0x17b9e9);}(_0x1d5c,0x1f3));var _0xc1d5=function(_0x2cb984,_0x365f50){_0x2cb984=_0x2cb984-0x0;var _0x2f73e6=_0x1d5c[_0x2cb984];return _0x2f73e6;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xc1d5('0x0'));var moment=require(_0xc1d5('0x1'));var Agent=require(_0xc1d5('0x2'));var Telephone=require(_0xc1d5('0x3'));var Trunk=require(_0xc1d5('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xc1d5('0x5'));var Campaign=require(_0xc1d5('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xc1d5('0x7'));var SalesforceAccount=require(_0xc1d5('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xc1d5('0x9'));var ZohoAccount=require(_0xc1d5('0xa'));var DeskAccount=require(_0xc1d5('0xb'));var VtigerAccount=require(_0xc1d5('0xc'));var ServicenowAccount=require(_0xc1d5('0xd'));var Dynamics365Account=require(_0xc1d5('0xe'));var FreshsalesAccount=require(_0xc1d5('0xf'));var FaxAccount=require(_0xc1d5('0x10'));var Realtime=function(){this[_0xc1d5('0x11')]={};this[_0xc1d5('0x12')]={};this['trunks']={};this[_0xc1d5('0x13')]={};this[_0xc1d5('0x14')]={};this[_0xc1d5('0x15')]={};this[_0xc1d5('0x16')]={};this[_0xc1d5('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xc1d5('0x18')]={};this[_0xc1d5('0x19')]={};this[_0xc1d5('0x1a')]={};this[_0xc1d5('0x1b')]={};this['timers']={};this[_0xc1d5('0x1c')]={};this[_0xc1d5('0x1d')]={};this['salesforceAccounts']={};this[_0xc1d5('0x1e')]={};this[_0xc1d5('0x1f')]={};this[_0xc1d5('0x20')]={};this['deskAccounts']={};this[_0xc1d5('0x21')]={};this[_0xc1d5('0x22')]={};this[_0xc1d5('0x23')]={};this[_0xc1d5('0x24')]={};this[_0xc1d5('0x25')]={};};function freeIsNotKey(_0x2cf467,_0x46394a,_0x2bd9b3){var _0x63dd1f=_[_0xc1d5('0x26')](_0x2cf467,function(_0x191005,_0x4b641f){return _0x191005[_0x2bd9b3];});for(var _0x30dcda in _0x46394a){if(_0x46394a['hasOwnProperty'](_0x30dcda)){if(!_0x63dd1f[_0x30dcda]){delete _0x46394a[_0x30dcda];}}}}function freeIsNotKeySip(_0x471d27,_0xe847c9){var _0x20b5c4=_[_0xc1d5('0x26')](_0x471d27,function(_0x2e7420,_0x2fddb5){return util['format'](_0xc1d5('0x27'),_0x2e7420[_0xc1d5('0x28')]);});for(var _0x280bd9 in _0xe847c9){if(_0xe847c9[_0xc1d5('0x29')](_0x280bd9)){if(!_0x20b5c4[_0x280bd9]){delete _0xe847c9[_0x280bd9];}}}}function freeIsNotKeyAgent(_0x221ac0,_0x53eae7){var _0x47e284=_['mapKeys'](_0x221ac0,function(_0x5f9500,_0x359016){var _0x5dfda4=_[_0xc1d5('0x2a')](_0x5f9500[_0xc1d5('0x2b')])?util[_0xc1d5('0x2c')](_0xc1d5('0x27'),_0x5f9500[_0xc1d5('0x28')]):_0x5f9500[_0xc1d5('0x2b')];return _0x5dfda4;});for(var _0x77ed42 in _0x53eae7){if(_0x53eae7['hasOwnProperty'](_0x77ed42)){if(!_0x47e284[_0x77ed42]){delete _0x53eae7[_0x77ed42];}}}}function clearVoiceCallReports(_0x4a800e){_0x4a800e[_0xc1d5('0x2d')]=0x0;_0x4a800e['answered']=0x0;_0x4a800e[_0xc1d5('0x2e')]=0x0;_0x4a800e[_0xc1d5('0x2f')]=0x0;_0x4a800e['sumBillable']=0x0;}function clearCampaigns(_0xf099a7){if(!_[_0xc1d5('0x30')](_0xf099a7)){for(var _0x123231 in _0xf099a7){if(_0xf099a7['hasOwnProperty'](_0x123231)){_0xf099a7[_0x123231]['ivrTotalCallsDays']=0x0;_0xf099a7[_0x123231]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5ae403){if(!_['isEmpty'](_0x5ae403)){for(var _0x2f02d1 in _0x5ae403){if(_0x5ae403['hasOwnProperty'](_0x2f02d1)){_0x5ae403[_0x2f02d1][_0xc1d5('0x2d')]=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x31')]=0x0;_0x5ae403[_0x2f02d1]['unmanaged']=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x32')]=0x0;_0x5ae403[_0x2f02d1]['sumHoldTime']=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x2f')]=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x33')]=0x0;_0x5ae403[_0x2f02d1]['outboundAnswerAgiCallsDay']=0x0;_0x5ae403[_0x2f02d1]['outboundNoAnswerCallsDay']=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x34')]=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x35')]=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x36')]=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x37')]=0x0;_0x5ae403[_0x2f02d1]['outboundDropCallsDayTimeout']=0x0;_0x5ae403[_0x2f02d1]['outboundDropCallsDayCallersExit']=0x0;_0x5ae403[_0x2f02d1]['outboundBlacklistCallsDay']=0x0;_0x5ae403[_0x2f02d1]['outboundOriginateFailureCallsDay']=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x38')]=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x39')]=0x0;_0x5ae403[_0x2f02d1]['outboundAnswerAgiCallsDay']=0x0;_0x5ae403[_0x2f02d1]['outboundAnswerCallsDay']=0x0;_0x5ae403[_0x2f02d1][_0xc1d5('0x3a')]=!![];}}}}Realtime[_0xc1d5('0x3b')]['mergeFromDatabase']=function(_0x5c4a85,_0x1f943c){for(var _0x5638e3 in _0x1f943c){if(_0x5c4a85[_0xc1d5('0x29')](_0x5638e3)){_0x5c4a85[_0x5638e3]=_0x1f943c[_0x5638e3];}}};Realtime[_0xc1d5('0x3b')]['initAgents']=function(){var _0x566c8f=this;return function(_0x4ab078){if(_0x4ab078){freeIsNotKeyAgent(_0x4ab078,_0x566c8f['agents']);for(var _0x4a316c=0x0,_0x5bfb3a={},_0x5ba7fb={};_0x4a316c<_0x4ab078[_0xc1d5('0x3c')];_0x4a316c+=0x1){_0x5bfb3a=_0x4ab078[_0x4a316c];var _0x5e02c8=_[_0xc1d5('0x2a')](_0x5bfb3a['interface'])?util['format'](_0xc1d5('0x27'),_0x5bfb3a[_0xc1d5('0x28')]):_0x5bfb3a[_0xc1d5('0x2b')];if(_[_0xc1d5('0x3d')](_0x566c8f[_0xc1d5('0x11')][_0x5e02c8])){_0x566c8f[_0xc1d5('0x11')][_0x5e02c8]=new Agent(_0x5bfb3a);}else{_0x566c8f[_0xc1d5('0x3e')](_0x566c8f[_0xc1d5('0x11')][_0x5e02c8],_0x5bfb3a);}}}return _0x566c8f[_0xc1d5('0x11')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x3f')]=function(){var _0x387c47=this;return function(_0x312bfd){if(_0x312bfd){freeIsNotKeySip(_0x312bfd,_0x387c47['telephones']);for(var _0x5794f9=0x0,_0x484338={},_0x188426={};_0x5794f9<_0x312bfd['length'];_0x5794f9+=0x1){_0x484338=_0x312bfd[_0x5794f9];if(_[_0xc1d5('0x3d')](_0x387c47[_0xc1d5('0x12')][util[_0xc1d5('0x2c')]('SIP/%s',_0x484338[_0xc1d5('0x28')])])){_0x387c47[_0xc1d5('0x12')][util[_0xc1d5('0x2c')](_0xc1d5('0x27'),_0x484338[_0xc1d5('0x28')])]=new Telephone(_0x484338);}else{_0x387c47[_0xc1d5('0x3e')](_0x387c47['telephones'][util[_0xc1d5('0x2c')](_0xc1d5('0x27'),_0x484338[_0xc1d5('0x28')])],_0x484338);}}}return _0x387c47[_0xc1d5('0x12')];};};Realtime[_0xc1d5('0x3b')]['initTrunks']=function(){var _0x5a78d4=this;return function(_0x304092){if(_0x304092){freeIsNotKeySip(_0x304092,_0x5a78d4[_0xc1d5('0x40')]);for(var _0x2c79c5=0x0,_0x171428={},_0xd1f0b9={};_0x2c79c5<_0x304092['length'];_0x2c79c5+=0x1){_0x171428=_0x304092[_0x2c79c5];if(_['isUndefined'](_0x5a78d4[_0xc1d5('0x40')][util[_0xc1d5('0x2c')](_0xc1d5('0x27'),_0x171428[_0xc1d5('0x28')])])){_0x5a78d4[_0xc1d5('0x40')][util[_0xc1d5('0x2c')]('SIP/%s',_0x171428[_0xc1d5('0x28')])]=new Trunk(_0x171428);}else{_0x5a78d4['mergeFromDatabase'](_0x5a78d4[_0xc1d5('0x40')][util[_0xc1d5('0x2c')](_0xc1d5('0x27'),_0x171428['name'])],_0x171428);}}}return _0x5a78d4[_0xc1d5('0x40')];};};Realtime[_0xc1d5('0x3b')]['initVoiceQueues']=function(){var _0x1410c0=this;return function(_0x271ec7){if(_0x271ec7){freeIsNotKey(_0x271ec7,_0x1410c0['voiceQueues'],_0xc1d5('0x28'));for(var _0x326723=0x0,_0x4df86a={},_0x16adae={};_0x326723<_0x271ec7[_0xc1d5('0x3c')];_0x326723+=0x1){_0x4df86a=_0x271ec7[_0x326723];if(_[_0xc1d5('0x3d')](_0x1410c0[_0xc1d5('0x13')][_0x4df86a['name']])){_0x1410c0[_0xc1d5('0x13')][_0x4df86a['name']]=new VoiceQueue(_0x4df86a);}else{_0x1410c0[_0xc1d5('0x3e')](_0x1410c0[_0xc1d5('0x13')][_0x4df86a[_0xc1d5('0x28')]],_0x4df86a);}}}return _0x1410c0[_0xc1d5('0x13')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x41')]=function(){var _0x4bfe25=this;return function(_0x3bb1d6){if(_0x3bb1d6){freeIsNotKey(_0x3bb1d6,_0x4bfe25[_0xc1d5('0x14')],'id');for(var _0x1d342e=0x0,_0x3af5e7={},_0x310a52={};_0x1d342e<_0x3bb1d6['length'];_0x1d342e+=0x1){_0x3af5e7=_0x3bb1d6[_0x1d342e];if(_[_0xc1d5('0x3d')](_0x4bfe25[_0xc1d5('0x14')][_0x3af5e7['id']])){_0x4bfe25['triggers'][_0x3af5e7['id']]=new Trigger(_0x3af5e7);}else{_0x4bfe25[_0xc1d5('0x3e')](_0x4bfe25[_0xc1d5('0x14')][_0x3af5e7['id']],_0x3af5e7);}}}return _0x4bfe25['triggers'];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x42')]=function(){var _0x185f7f=this;return function(_0x913977){if(_0x913977){freeIsNotKey(_0x913977,_0x185f7f[_0xc1d5('0x16')],'id');for(var _0x1cc576=0x0,_0x4349ab={},_0x493bff={};_0x1cc576<_0x913977[_0xc1d5('0x3c')];_0x1cc576+=0x1){_0x4349ab=_0x913977[_0x1cc576];if(_['isUndefined'](_0x185f7f['templates'][_0x4349ab['id']])){_0x185f7f['templates'][_0x4349ab['id']]=new Template(_0x4349ab);}else{_0x185f7f[_0xc1d5('0x3e')](_0x185f7f['templates'][_0x4349ab['id']],_0x4349ab);}}}return _0x185f7f[_0xc1d5('0x16')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x43')]=function(){var _0x11694b=this;return function(_0x3e521a){if(_0x3e521a){freeIsNotKey(_0x3e521a,_0x11694b[_0xc1d5('0x1d')],'id');for(var _0x132a6d=0x0,_0x31a1a4={},_0x1bd88f={};_0x132a6d<_0x3e521a[_0xc1d5('0x3c')];_0x132a6d+=0x1){_0x31a1a4=_0x3e521a[_0x132a6d];if(_[_0xc1d5('0x3d')](_0x11694b[_0xc1d5('0x1d')][_0x31a1a4['id']])){_0x11694b[_0xc1d5('0x1d')][_0x31a1a4['id']]=new ZendeskAccount(_0x31a1a4);}else{_0x11694b[_0xc1d5('0x3e')](_0x11694b[_0xc1d5('0x1d')][_0x31a1a4['id']],_0x31a1a4);}}}return _0x11694b[_0xc1d5('0x1d')];};};Realtime[_0xc1d5('0x3b')]['initSalesforceAccounts']=function(){var _0x668e89=this;return function(_0x501899){if(_0x501899){freeIsNotKey(_0x501899,_0x668e89[_0xc1d5('0x44')],'id');for(var _0x680719=0x0,_0x16c60c={},_0x449a79={};_0x680719<_0x501899[_0xc1d5('0x3c')];_0x680719+=0x1){_0x16c60c=_0x501899[_0x680719];if(_[_0xc1d5('0x3d')](_0x668e89[_0xc1d5('0x44')][_0x16c60c['id']])){_0x668e89['salesforceAccounts'][_0x16c60c['id']]=new SalesforceAccount(_0x16c60c);}else{_0x668e89[_0xc1d5('0x3e')](_0x668e89[_0xc1d5('0x44')][_0x16c60c['id']],_0x16c60c);}}}return _0x668e89[_0xc1d5('0x44')];};};Realtime['prototype'][_0xc1d5('0x45')]=function(){var _0x1bfa1a=this;return function(_0x4abded){if(_0x4abded){freeIsNotKey(_0x4abded,_0x1bfa1a[_0xc1d5('0x1f')],'id');for(var _0x2ae8f7=0x0,_0x5da7cb={},_0x343638={};_0x2ae8f7<_0x4abded[_0xc1d5('0x3c')];_0x2ae8f7+=0x1){_0x5da7cb=_0x4abded[_0x2ae8f7];if(_[_0xc1d5('0x3d')](_0x1bfa1a[_0xc1d5('0x1f')][_0x5da7cb['id']])){_0x1bfa1a['freshdeskAccounts'][_0x5da7cb['id']]=new FreshdeskAccount(_0x5da7cb);}else{_0x1bfa1a[_0xc1d5('0x3e')](_0x1bfa1a[_0xc1d5('0x1f')][_0x5da7cb['id']],_0x5da7cb);}}}return _0x1bfa1a[_0xc1d5('0x1f')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x46')]=function(){var _0x29e56a=this;return function(_0x53ac39){if(_0x53ac39){freeIsNotKey(_0x53ac39,_0x29e56a['zohoAccounts'],'id');for(var _0x16e1fe=0x0,_0x2d8d4a={},_0x2f669f={};_0x16e1fe<_0x53ac39[_0xc1d5('0x3c')];_0x16e1fe+=0x1){_0x2d8d4a=_0x53ac39[_0x16e1fe];if(_[_0xc1d5('0x3d')](_0x29e56a[_0xc1d5('0x20')][_0x2d8d4a['id']])){_0x29e56a[_0xc1d5('0x20')][_0x2d8d4a['id']]=new ZohoAccount(_0x2d8d4a);}else{_0x29e56a[_0xc1d5('0x3e')](_0x29e56a[_0xc1d5('0x20')][_0x2d8d4a['id']],_0x2d8d4a);}}}return _0x29e56a['zohoAccounts'];};};Realtime['prototype'][_0xc1d5('0x47')]=function(){var _0x49ccf2=this;return function(_0x473cd8){if(_0x473cd8){freeIsNotKey(_0x473cd8,_0x49ccf2[_0xc1d5('0x48')],'id');for(var _0x4e966e=0x0,_0xf1a2cc={},_0x595863={};_0x4e966e<_0x473cd8[_0xc1d5('0x3c')];_0x4e966e+=0x1){_0xf1a2cc=_0x473cd8[_0x4e966e];if(_[_0xc1d5('0x3d')](_0x49ccf2[_0xc1d5('0x48')][_0xf1a2cc['id']])){_0x49ccf2[_0xc1d5('0x48')][_0xf1a2cc['id']]=new DeskAccount(_0xf1a2cc);}else{_0x49ccf2[_0xc1d5('0x3e')](_0x49ccf2[_0xc1d5('0x48')][_0xf1a2cc['id']],_0xf1a2cc);}}}return _0x49ccf2['deskAccounts'];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x49')]=function(){var _0x4926b1=this;return function(_0x3007e5){if(_0x3007e5){freeIsNotKey(_0x3007e5,_0x4926b1['sugarcrmAccounts'],'id');for(var _0x583719=0x0,_0x3b4b88={},_0x34cd08={};_0x583719<_0x3007e5[_0xc1d5('0x3c')];_0x583719+=0x1){_0x3b4b88=_0x3007e5[_0x583719];if(_['isUndefined'](_0x4926b1[_0xc1d5('0x1e')][_0x3b4b88['id']])){_0x4926b1['sugarcrmAccounts'][_0x3b4b88['id']]=new SugarcrmAccount(_0x3b4b88);}else{_0x4926b1['mergeFromDatabase'](_0x4926b1[_0xc1d5('0x1e')][_0x3b4b88['id']],_0x3b4b88);}}}return _0x4926b1[_0xc1d5('0x1e')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x4a')]=function(){var _0xc488d3=this;return function(_0xb0a509){if(_0xb0a509){freeIsNotKey(_0xb0a509,_0xc488d3['vtigerAccounts'],'id');for(var _0x3fd377=0x0,_0x5ce1ce={},_0x2a5c55={};_0x3fd377<_0xb0a509[_0xc1d5('0x3c')];_0x3fd377+=0x1){_0x5ce1ce=_0xb0a509[_0x3fd377];if(_[_0xc1d5('0x3d')](_0xc488d3['vtigerAccounts'][_0x5ce1ce['id']])){_0xc488d3['vtigerAccounts'][_0x5ce1ce['id']]=new VtigerAccount(_0x5ce1ce);}else{_0xc488d3[_0xc1d5('0x3e')](_0xc488d3[_0xc1d5('0x21')][_0x5ce1ce['id']],_0x5ce1ce);}}}return _0xc488d3[_0xc1d5('0x21')];};};Realtime[_0xc1d5('0x3b')]['initServicenowAccounts']=function(){var _0x2bc2b8=this;return function(_0x4f2f58){if(_0x4f2f58){freeIsNotKey(_0x4f2f58,_0x2bc2b8['servicenowAccounts'],'id');for(var _0x3cedda=0x0,_0x456f80={},_0x576647={};_0x3cedda<_0x4f2f58['length'];_0x3cedda+=0x1){_0x456f80=_0x4f2f58[_0x3cedda];if(_[_0xc1d5('0x3d')](_0x2bc2b8['servicenowAccounts'][_0x456f80['id']])){_0x2bc2b8[_0xc1d5('0x22')][_0x456f80['id']]=new ServicenowAccount(_0x456f80);}else{_0x2bc2b8[_0xc1d5('0x3e')](_0x2bc2b8[_0xc1d5('0x22')][_0x456f80['id']],_0x456f80);}}}return _0x2bc2b8[_0xc1d5('0x22')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x172ac5=this;return function(_0x155d12){if(_0x155d12){freeIsNotKey(_0x155d12,_0x172ac5[_0xc1d5('0x23')],'id');for(var _0x1e3ab0=0x0,_0x34c4de={},_0x5428bd={};_0x1e3ab0<_0x155d12['length'];_0x1e3ab0+=0x1){_0x34c4de=_0x155d12[_0x1e3ab0];if(_['isUndefined'](_0x172ac5[_0xc1d5('0x23')][_0x34c4de['id']])){_0x172ac5[_0xc1d5('0x23')][_0x34c4de['id']]=new Dynamics365Account(_0x34c4de);}else{_0x172ac5[_0xc1d5('0x3e')](_0x172ac5['dynamics365Accounts'][_0x34c4de['id']],_0x34c4de);}}}return _0x172ac5['dynamics365Accounts'];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x4b')]=function(){var _0x2ba914=this;return function(_0x13085a){if(_0x13085a){freeIsNotKey(_0x13085a,_0x2ba914['freshsalesAccounts'],'id');for(var _0x12a2c0=0x0,_0x4bea7f={},_0x3b1be0={};_0x12a2c0<_0x13085a[_0xc1d5('0x3c')];_0x12a2c0+=0x1){_0x4bea7f=_0x13085a[_0x12a2c0];if(_['isUndefined'](_0x2ba914['freshsalesAccounts'][_0x4bea7f['id']])){_0x2ba914[_0xc1d5('0x24')][_0x4bea7f['id']]=new FreshsalesAccount(_0x4bea7f);}else{_0x2ba914[_0xc1d5('0x3e')](_0x2ba914[_0xc1d5('0x24')][_0x4bea7f['id']],_0x4bea7f);}}}return _0x2ba914[_0xc1d5('0x24')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x4c')]=function(){var _0x9187d4=this;return function(_0x327dd0){for(var _0x533995=0x0;_0x533995<_0x327dd0[_0xc1d5('0x3c')];_0x533995+=0x1){_[_0xc1d5('0x4d')](_0x9187d4['voiceQueues'][_0x327dd0[_0x533995][_0xc1d5('0x28')]],_0x327dd0[_0x533995]);}return _0x9187d4['voiceQueues'];};};Realtime['prototype'][_0xc1d5('0x4e')]=function(){var _0x158e6c=this;return function(_0x5a35b1){clearVoiceQueues(_0x158e6c['voiceQueues']);if(_0x5a35b1){_0x5a35b1=_['groupBy'](_0x5a35b1,_0xc1d5('0x4f'));for(var _0x22bb39 in _0x5a35b1){if(_0x5a35b1[_0xc1d5('0x29')](_0x22bb39)){var _0xcaf5b7={};for(var _0x55c62f=0x0;_0x55c62f<_0x5a35b1[_0x22bb39][_0xc1d5('0x3c')];_0x55c62f+=0x1){var _0x2a3e1f=_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x50')];if(_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f]){if(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x51')]){_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f]['unmanaged']+=0x1;}if(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x52')]){_0x158e6c['voiceQueues'][_0x2a3e1f][_0xc1d5('0x32')]+=0x1;}_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f]['sumHoldTime']+=moment(_0x5a35b1[_0x22bb39][_0x55c62f]['queuecallerleaveAt'])[_0xc1d5('0x53')](moment(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x54')]),_0xc1d5('0x55'))||0x0;if(_0x55c62f===_0x5a35b1[_0x22bb39][_0xc1d5('0x3c')]-0x1){_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f][_0xc1d5('0x2f')]+=moment(_0x5a35b1[_0x22bb39][_0x55c62f]['queuecallercompleteAt']||_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x56')]||_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x57')])[_0xc1d5('0x53')](moment(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x54')]),_0xc1d5('0x55'))||0x0;_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f][_0xc1d5('0x2d')]+=0x1;if(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x58')]){_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f][_0xc1d5('0x31')]+=0x1;_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f][_0xc1d5('0x33')]+=moment(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x59')])[_0xc1d5('0x53')](moment(_0x5a35b1[_0x22bb39][_0x55c62f][_0xc1d5('0x5a')]),'seconds')||0x0;}}else{_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f][_0xc1d5('0x2f')]+=_0x158e6c[_0xc1d5('0x13')][_0x2a3e1f][_0xc1d5('0x2e')]||0x0;}}}}}}return _0x158e6c[_0xc1d5('0x13')];};};Realtime[_0xc1d5('0x3b')]['initVoiceCallReports']=function(){var _0x1b8425=this;return function(_0x4fef02){clearVoiceCallReports(_0x1b8425[_0xc1d5('0x17')]);if(_0x4fef02){for(var _0x5879e4=0x0;_0x5879e4<_0x4fef02[_0xc1d5('0x3c')];_0x5879e4+=0x1){_0x1b8425[_0xc1d5('0x17')][_0xc1d5('0x2d')]+=0x1;_0x1b8425[_0xc1d5('0x17')][_0xc1d5('0x2f')]+=_0x4fef02[_0x5879e4][_0xc1d5('0x5b')];if(_0x4fef02[_0x5879e4]['disposition']===_0xc1d5('0x5c')){_0x1b8425[_0xc1d5('0x17')][_0xc1d5('0x31')]+=0x1;_0x1b8425[_0xc1d5('0x17')][_0xc1d5('0x2e')]+=_0x4fef02[_0x5879e4]['duration']-_0x4fef02[_0x5879e4][_0xc1d5('0x5d')]||0x0;_0x1b8425[_0xc1d5('0x17')][_0xc1d5('0x33')]+=_0x4fef02[_0x5879e4][_0xc1d5('0x5d')];}}}return _0x1b8425[_0xc1d5('0x17')];};};Realtime['prototype'][_0xc1d5('0x5e')]=function(){var _0x5d46e7=this;return function(_0x3450f7){if(_0x3450f7){freeIsNotKey(_0x3450f7,_0x5d46e7[_0xc1d5('0x15')],_0xc1d5('0x28'));for(var _0x1fb3b5=0x0,_0x4466f3={};_0x1fb3b5<_0x3450f7[_0xc1d5('0x3c')];_0x1fb3b5+=0x1){_0x4466f3=_0x3450f7[_0x1fb3b5];if(_[_0xc1d5('0x3d')](_0x5d46e7[_0xc1d5('0x15')][_0x4466f3[_0xc1d5('0x28')]])){_0x5d46e7[_0xc1d5('0x15')][_0x4466f3[_0xc1d5('0x28')]]=new Campaign(_0x4466f3);}else{_0x5d46e7['mergeFromDatabase'](_0x5d46e7[_0xc1d5('0x15')][_0x4466f3['name']],_0x4466f3);_0x5d46e7[_0xc1d5('0x15')][_0x4466f3[_0xc1d5('0x28')]][_0xc1d5('0x5f')]=_0x4466f3[_0xc1d5('0x60')]?_0x4466f3[_0xc1d5('0x60')][_0xc1d5('0x28')]:undefined;}}}return _0x5d46e7[_0xc1d5('0x15')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x61')]=function(){var _0x1c9ab4=this;return function(_0x164eb8){if(_0x164eb8){freeIsNotKey(_0x164eb8,_0x1c9ab4[_0xc1d5('0x18')],'id');for(var _0x56643e=0x0,_0x554edd={};_0x56643e<_0x164eb8[_0xc1d5('0x3c')];_0x56643e+=0x1){_0x554edd=_0x164eb8[_0x56643e];if(_[_0xc1d5('0x3d')](_0x1c9ab4[_0xc1d5('0x18')][_0x554edd['id']])){_0x1c9ab4['voiceExtensions'][_0x554edd['id']]=new VoiceExtension(_0x554edd);}else{_0x1c9ab4['mergeFromDatabase'](_0x1c9ab4[_0xc1d5('0x18')][_0x554edd['id']],_0x554edd);}}}return _0x1c9ab4['voiceExtensions'];};};Realtime[_0xc1d5('0x3b')]['initCampaignHopperHistory']=function(){var _0x2c5b3b=this;return function(_0x45159a){clearCampaigns(_0x2c5b3b[_0xc1d5('0x15')]);for(var _0x320a33=0x0;_0x320a33<_0x45159a['length'];_0x320a33+=0x1){_[_0xc1d5('0x4d')](_0x2c5b3b[_0xc1d5('0x15')][_0x45159a[_0x320a33]['name']],_0x45159a[_0x320a33]);}return _0x2c5b3b[_0xc1d5('0x15')];};};Realtime[_0xc1d5('0x3b')][_0xc1d5('0x62')]=function(){var _0x4e7cc9=this;return function(_0x302c97){if(_0x302c97){freeIsNotKey(_0x302c97,_0x4e7cc9['faxAccounts'],'id');for(var _0x2849fd=0x0,_0xa610eb={},_0x2dbe7f={};_0x2849fd<_0x302c97[_0xc1d5('0x3c')];_0x2849fd+=0x1){_0xa610eb=_0x302c97[_0x2849fd];if(_['isUndefined'](_0x4e7cc9['faxAccounts'][_0xa610eb['id']])){_0x4e7cc9[_0xc1d5('0x25')][_0xa610eb['id']]=new FaxAccount(_0xa610eb);}else{_0x4e7cc9[_0xc1d5('0x3e')](_0x4e7cc9['faxAccounts'][_0xa610eb['id']],_0xa610eb);}}}return _0x4e7cc9[_0xc1d5('0x25')];};};module[_0xc1d5('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 530902b..1ffbc24 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 _0x754a=['calleridpreview','destinationchannel','connectedlinenum','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','blindTransfer','transfererlinkedid','attendedTransfer','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','bind','blindtransfer','attendedtransfer','prototype','find','name','isNil','accountcode','interface','format','SIP/%s','length','findAgent','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview'];(function(_0x5d456c,_0x4cbaa9){var _0x4ccf83=function(_0x395607){while(--_0x395607){_0x5d456c['push'](_0x5d456c['shift']());}};_0x4ccf83(++_0x4cbaa9);}(_0x754a,0x1a3));var _0xa754=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x754a[_0x54d4a8];return _0x3b321b;};'use strict';var _=require('lodash');var moment=require(_0xa754('0x0'));var util=require(_0xa754('0x1'));var config=require(_0xa754('0x2'));var ami=require(_0xa754('0x3'));var RpcVoiceAgentReport=require(_0xa754('0x4'));var RpcVoiceCallReport=require(_0xa754('0x5'));var RpcVoiceDialReport=require(_0xa754('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa754('0x7'));var RpcVoiceTransferReport=require(_0xa754('0x8'));var VoiceQueueReport=require(_0xa754('0x9'));var VoiceCallReport=require(_0xa754('0xa'));var VoiceAgentReport=require(_0xa754('0xb'));var VoiceDialReport=require(_0xa754('0xc'));var UserReport=require(_0xa754('0xd'));function Report(_0x108965){this['realtime']=_0x108965;this[_0xa754('0xe')]=_0x108965[_0xa754('0xe')];this[_0xa754('0xf')]=_0x108965[_0xa754('0xf')];}Report['prototype'][_0xa754('0x10')]=function(_0x579e93){var _0x218b1a=new VoiceQueueReport(this[_0xa754('0x11')]);var _0x53dae6=new VoiceAgentReport(this['realtime']);var _0x2faf79=new VoiceDialReport(this['realtime']);var _0x13e4f1=new VoiceCallReport(this['realtime']);var _0x109f1f=new UserReport(this[_0xa754('0x11')]);if(config[_0xa754('0x12')]&&config['xdr'][_0xa754('0x13')]){ami['on'](_0xa754('0x14'),this[_0xa754('0x15')]['bind'](this));ami['on'](_0xa754('0x16'),this[_0xa754('0x17')]['bind'](this));ami['on'](_0xa754('0x18'),this[_0xa754('0x19')]['bind'](this));ami['on'](_0xa754('0x1a'),this[_0xa754('0x1b')][_0xa754('0x1c')](this));ami['on'](_0xa754('0x1d'),this['blindTransfer'][_0xa754('0x1c')](this));ami['on'](_0xa754('0x1e'),this['attendedTransfer'][_0xa754('0x1c')](this));}};Report[_0xa754('0x1f')]['findAgent']=function(_0x1a4eb7){var _0x44f0c3;_0x44f0c3=_[_0xa754('0x20')](this[_0xa754('0xe')],function(_0x9031f5){return _0x9031f5['accountcode']==_0x1a4eb7||_0x9031f5[_0xa754('0x21')]==_0x1a4eb7;});if(_[_0xa754('0x22')](_0x44f0c3)){var _0x2f61f3=_[_0xa754('0x20')](this['telephones'],function(_0x3f836e){return _0x3f836e[_0xa754('0x23')]==_0x1a4eb7||_0x3f836e['name']==_0x1a4eb7;});if(_0x2f61f3){_0x44f0c3=_[_0xa754('0x20')](this[_0xa754('0xe')],function(_0x37cb8b){return _0x37cb8b[_0xa754('0x24')]==util[_0xa754('0x25')](_0xa754('0x26'),_0x2f61f3[_0xa754('0x21')]);});}}return _0x44f0c3;};Report['prototype'][_0xa754('0x15')]=function(_0x4f23bb){for(var _0x44a1f4=0x0;_0x44a1f4<_0x4f23bb[_0xa754('0x27')];_0x44a1f4+=0x1){var _0x38fc58=this[_0xa754('0x28')](_0x4f23bb[_0x44a1f4]['connectedlinenum']);if(_0x38fc58){_0x4f23bb[_0x44a1f4][_0xa754('0x23')]=_0x38fc58[_0xa754('0x23')];_0x4f23bb[_0x44a1f4][_0xa754('0x29')]=!![];_0x4f23bb[_0x44a1f4][_0xa754('0x2a')]=_0x38fc58[_0xa754('0x21')];_0x4f23bb[_0x44a1f4][_0xa754('0x24')]=_[_0xa754('0x22')](_0x38fc58['interface'])?util[_0xa754('0x25')](_0xa754('0x26'),_0x38fc58[_0xa754('0x21')]):_0x38fc58[_0xa754('0x24')];if(_0x4f23bb[_0x44a1f4][_0xa754('0x2b')]){_0x4f23bb[_0x44a1f4]['queuecallercompleteAt']=moment()['format'](_0xa754('0x2c'));}if(_0x4f23bb[_0x44a1f4][_0xa754('0x2d')]){_0x4f23bb[_0x44a1f4][_0xa754('0x2e')]=moment()[_0xa754('0x25')](_0xa754('0x2c'));}RpcMemberReport[_0xa754('0x15')](_0x4f23bb[_0x44a1f4]);}RpcVoiceQueueReport[_0xa754('0x2f')](_0x4f23bb[_0x44a1f4]);}};function extractCalleridNumber(_0x3beae9){var _0x2efd9a=_0x3beae9[_0xa754('0x30')](/<(.*?)>/);return _0x2efd9a?_0x2efd9a[0x1]:_0x3beae9;}Report['prototype'][_0xa754('0x31')]=function(_0x1e2f6e){for(var _0x37751c=0x0;_0x37751c','transfers','linkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','createdAt','xcally-motion-preview','calleridname','connectedlinename','exten','xcally-motion-dialer','forEach','Local','substring','indexOf','phone','lastIndexOf','exports','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','prototype','sync','xdr','disabled','bind','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','agents','accountcode','name','isNil','interface','connectedlinenum','assigned','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceQueueReport','create','match','getAgentByInternal','length','getCallType','channel'];(function(_0x19f72f,_0x4688f8){var _0x112e5c=function(_0x3eed6e){while(--_0x3eed6e){_0x19f72f['push'](_0x19f72f['shift']());}};_0x112e5c(++_0x4688f8);}(_0x17eb,0x12d));var _0xb17e=function(_0x2e9a8f,_0x37c8b2){_0x2e9a8f=_0x2e9a8f-0x0;var _0x4ba021=_0x17eb[_0x2e9a8f];return _0x4ba021;};'use strict';var _=require('lodash');var moment=require(_0xb17e('0x0'));var util=require(_0xb17e('0x1'));var config=require(_0xb17e('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xb17e('0x3'));var RpcVoiceCallReport=require(_0xb17e('0x4'));var RpcVoiceDialReport=require(_0xb17e('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xb17e('0x6'));var RpcVoiceRecording=require(_0xb17e('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xb17e('0x8'));var VoiceAgentReport=require(_0xb17e('0x9'));var VoiceDialReport=require(_0xb17e('0xa'));var UserReport=require(_0xb17e('0xb'));function Report(_0x35ff94){this[_0xb17e('0xc')]=_0x35ff94;this['agents']=_0x35ff94['agents'];this[_0xb17e('0xd')]=_0x35ff94[_0xb17e('0xd')];}Report[_0xb17e('0xe')][_0xb17e('0xf')]=function(_0x345773){var _0x3b8426=new VoiceQueueReport(this['realtime']);var _0x294d90=new VoiceAgentReport(this['realtime']);var _0x2920af=new VoiceDialReport(this[_0xb17e('0xc')]);var _0x7c1499=new VoiceCallReport(this[_0xb17e('0xc')]);var _0xe13c6f=new UserReport(this[_0xb17e('0xc')]);if(config[_0xb17e('0x10')]&&config[_0xb17e('0x10')][_0xb17e('0x11')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xb17e('0x12')](this));ami['on']('custom:voiceCallReport',this[_0xb17e('0x13')][_0xb17e('0x12')](this));ami['on']('custom:voiceAgentReport',this[_0xb17e('0x14')]['bind'](this));ami['on'](_0xb17e('0x15'),this[_0xb17e('0x16')][_0xb17e('0x12')](this));ami['on'](_0xb17e('0x17'),this[_0xb17e('0x18')][_0xb17e('0x12')](this));ami['on'](_0xb17e('0x19'),this[_0xb17e('0x1a')][_0xb17e('0x12')](this));}};Report[_0xb17e('0xe')][_0xb17e('0x1b')]=function(_0x3c9491){var _0x527558;_0x527558=_[_0xb17e('0x1c')](this[_0xb17e('0x1d')],function(_0x230116){return _0x230116[_0xb17e('0x1e')]==_0x3c9491||_0x230116[_0xb17e('0x1f')]==_0x3c9491;});if(_[_0xb17e('0x20')](_0x527558)){var _0x5ae16d=_[_0xb17e('0x1c')](this[_0xb17e('0xd')],function(_0x357d4b){return _0x357d4b[_0xb17e('0x1e')]==_0x3c9491||_0x357d4b['name']==_0x3c9491;});if(_0x5ae16d){_0x527558=_['find'](this[_0xb17e('0x1d')],function(_0x2a3391){return _0x2a3391[_0xb17e('0x21')]==util['format']('SIP/%s',_0x5ae16d[_0xb17e('0x1f')]);});}}return _0x527558;};Report[_0xb17e('0xe')]['voiceQueueReport']=function(_0x4e278d){for(var _0x4d9754=0x0;_0x4d9754<_0x4e278d['length'];_0x4d9754+=0x1){var _0x1fbd92=this[_0xb17e('0x1b')](_0x4e278d[_0x4d9754][_0xb17e('0x22')]);if(_0x1fbd92){_0x4e278d[_0x4d9754]['accountcode']=_0x1fbd92[_0xb17e('0x1e')];_0x4e278d[_0x4d9754][_0xb17e('0x23')]=!![];_0x4e278d[_0x4d9754][_0xb17e('0x24')]=_0x1fbd92[_0xb17e('0x1f')];_0x4e278d[_0x4d9754][_0xb17e('0x21')]=_[_0xb17e('0x20')](_0x1fbd92['interface'])?util[_0xb17e('0x25')](_0xb17e('0x26'),_0x1fbd92[_0xb17e('0x1f')]):_0x1fbd92[_0xb17e('0x21')];if(_0x4e278d[_0x4d9754][_0xb17e('0x27')]){_0x4e278d[_0x4d9754][_0xb17e('0x28')]=moment()[_0xb17e('0x25')](_0xb17e('0x29'));}if(_0x4e278d[_0x4d9754][_0xb17e('0x2a')]){_0x4e278d[_0x4d9754][_0xb17e('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xb17e('0x2c')](_0x4e278d[_0x4d9754]);}RpcVoiceQueueReport[_0xb17e('0x2d')](_0x4e278d[_0x4d9754]);}};function extractCalleridNumber(_0x39441c){var _0x3c61f9=_0x39441c[_0xb17e('0x2e')](/<(.*?)>/);return _0x3c61f9?_0x3c61f9[0x1]:_0x39441c;}Report[_0xb17e('0xe')][_0xb17e('0x2f')]=function(_0x4b2284){for(var _0x557288=0x0;_0x5572880x0?_0x5a7567:0x0;this[_0xcd85('0x14')][_0x24e12b['queue']][_0xcd85('0x32')]=this[_0xcd85('0x14')][_0x24e12b['queue']][_0xcd85('0x32')]>_[_0xcd85('0x68')](_0x24e12b['loggedin'])?_[_0xcd85('0x68')](_0x24e12b[_0xcd85('0x6a')]):this[_0xcd85('0x14')][_0x24e12b[_0xcd85('0x64')]][_0xcd85('0x32')];this[_0xcd85('0x4f')](this[_0xcd85('0x14')][_0x24e12b[_0xcd85('0x64')]],_0xcd85('0x18'));}logger[_0xcd85('0x44')](_0xcd85('0x6b'),util['inspect'](this[_0xcd85('0x14')][_0x24e12b['queue']],{'showHidden':![],'depth':null}));ami[_0xcd85('0x42')]('custom:queuesummary',this[_0xcd85('0x14')][_0x24e12b[_0xcd85('0x64')]]);}}}catch(_0xadd71e){logger[_0xcd85('0x3b')]('[voiceQueueReport][queuesummary]',util[_0xcd85('0x3d')](_0xadd71e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd85('0x1b')]=function(_0x4e6520){logger[_0xcd85('0x44')](_0xcd85('0x6c'),util['inspect'](_0x4e6520,{'showHidden':![],'depth':null}));this[_0xcd85('0x15')]=!![];};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x1c')]=function(_0x19bc44){try{if(this[_0xcd85('0x63')](_0x19bc44)){logger['debug'](_0xcd85('0x6d'),_0x19bc44[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x19bc44,{'showHidden':![],'depth':null}));if(_[_0xcd85('0x5c')](this[_0xcd85('0x11')][_0x19bc44[_0xcd85('0x47')]]))this[_0xcd85('0x11')][_0x19bc44[_0xcd85('0x47')]]=[];if(_[_0xcd85('0x5c')](this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]]))this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]]={};var _0x256702=new QueueReport();_0x256702['name']=_0x19bc44['queue'];_0x256702[_0xcd85('0x50')]=this[_0xcd85('0x14')][_0x256702[_0xcd85('0x49')]]&&this['voiceQueues'][_0x256702[_0xcd85('0x49')]][_0xcd85('0x50')]?this[_0xcd85('0x14')][_0x256702[_0xcd85('0x49')]][_0xcd85('0x50')]||_0xcd85('0x51'):'inbound';_0x256702[_0xcd85('0x64')]=_0x19bc44[_0xcd85('0x64')];_0x256702[_0xcd85('0x6e')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x256702[_0xcd85('0x70')]=_0x19bc44[_0xcd85('0x70')];_0x256702[_0xcd85('0x71')]=_0x19bc44['count'];_0x256702['uniqueid']=_0x19bc44[_0xcd85('0x47')];_0x256702[_0xcd85('0x72')]=this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]][_0xcd85('0x72')];logger['info'](_0xcd85('0x73'),_0x256702[_0xcd85('0x49')],_0x256702['type']);_[_0xcd85('0x74')](_0x256702,_[_0xcd85('0x75')](_0x19bc44,_[_0xcd85('0x76')](_0x256702)));this['queueReports'][_0x19bc44[_0xcd85('0x47')]][_0xcd85('0x77')](_0x256702);this[_0xcd85('0x13')][_0x19bc44[_0xcd85('0x47')]]=_0x256702;this[_0xcd85('0x43')](_0x256702,_0xcd85('0x78'));}}catch(_0x1bdc13){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x19bc44[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x1bdc13,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd85('0x1e')]=function(_0x1f1cbb){try{if(this[_0xcd85('0x63')](_0x1f1cbb)){logger[_0xcd85('0x44')](_0xcd85('0x79'),_0x1f1cbb[_0xcd85('0x47')],util['inspect'](_0x1f1cbb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f1cbb[_0xcd85('0x47')]]){var _0x6efeff=_[_0xcd85('0x7a')](this['queueReports'][_0x1f1cbb[_0xcd85('0x47')]]);_0x6efeff[_0xcd85('0x7b')]=![];_0x6efeff[_0xcd85('0x7c')]=null;_0x6efeff[_0xcd85('0x7d')]=_0x1f1cbb[_0xcd85('0x7d')];_0x6efeff[_0xcd85('0x7e')]=_0x1f1cbb[_0xcd85('0x7e')];_0x6efeff[_0xcd85('0x1d')]=!![];_0x6efeff[_0xcd85('0x7f')]=moment()[_0xcd85('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x6efeff[_0xcd85('0x80')]=_0xcd85('0x81');_0x6efeff[_0xcd85('0x82')]=null;logger[_0xcd85('0x65')](_0xcd85('0x83'),_0x6efeff[_0xcd85('0x49')],_0x6efeff[_0xcd85('0x50')]);this[_0xcd85('0x13')][_0x1f1cbb[_0xcd85('0x47')]]=_0x6efeff;this[_0xcd85('0x40')](_0x6efeff,'queuecallerabandon');}}}catch(_0x1b272e){logger[_0xcd85('0x3b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1f1cbb[_0xcd85('0x47')],util['inspect'](_0x1b272e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')]['syncQueueCallerLeave']=function(_0x5e8354){try{if(this['isNotNull'](_0x5e8354)){logger[_0xcd85('0x44')](_0xcd85('0x84'),_0x5e8354['uniqueid'],util['inspect'](_0x5e8354,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x5e8354['uniqueid']]){var _0x9206a=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x5e8354['uniqueid']]);_0x9206a[_0xcd85('0x85')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x9206a[_0xcd85('0x86')]=_0x5e8354[_0xcd85('0x86')];_0x9206a[_0xcd85('0x87')]=_0x5e8354['connectedlinename'];logger[_0xcd85('0x65')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x9206a[_0xcd85('0x49')],_0x9206a[_0xcd85('0x50')],_0x5e8354[_0xcd85('0x86')],_0x5e8354['connectedlinename']);this[_0xcd85('0x13')][_0x5e8354[_0xcd85('0x47')]]=_0x9206a;this[_0xcd85('0x43')](_0x9206a,_0xcd85('0x1f'));}}}catch(_0xadab3d){logger[_0xcd85('0x3b')](_0xcd85('0x84'),_0x5e8354[_0xcd85('0x47')],util['inspect'](_0xadab3d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x24')]=function(_0x17c1fb){try{if(this['isNotNull'](_0x17c1fb)){logger['debug'](_0xcd85('0x88'),_0x17c1fb[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x17c1fb,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x17c1fb[_0xcd85('0x47')]]){var _0x623c57=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x17c1fb[_0xcd85('0x47')]]);_0x623c57[_0xcd85('0x7b')]=!![];_0x623c57['queuecallerexitreason']=_0xcd85('0x89');logger[_0xcd85('0x65')](_0xcd85('0x8a'),_0x623c57[_0xcd85('0x49')],_0x623c57[_0xcd85('0x50')]);}}}catch(_0x3b7cc5){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x17c1fb['uniqueid'],util[_0xcd85('0x3d')](_0x3b7cc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x22')]=function(_0x22b3f1){try{if(this[_0xcd85('0x63')](_0x22b3f1)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x22b3f1[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x22b3f1,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x47')]]){var _0x5a2121=_[_0xcd85('0x7a')](this['queueReports'][_0x22b3f1[_0xcd85('0x47')]]);_0x5a2121[_0xcd85('0x1d')]=![];_0x5a2121[_0xcd85('0x7f')]=null;_0x5a2121['assigned']=!![];_0x5a2121['lastAssignedTo']=_0x22b3f1[_0xcd85('0x8b')];_0x5a2121['holdtime']=_0x22b3f1['holdtime'];_0x5a2121[_0xcd85('0x7b')]=!![];_0x5a2121[_0xcd85('0x8c')]=![];_0x5a2121[_0xcd85('0x8d')]=null;if(!_0x5a2121[_0xcd85('0x8e')]){if(_0x22b3f1[_0xcd85('0x8f')]=='transfer'){_0x5a2121[_0xcd85('0x80')]=_0xcd85('0x90');logger[_0xcd85('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5a2121[_0xcd85('0x49')],_0x5a2121['type']);}else{if(_[_0xcd85('0x91')](_0x22b3f1['channel'][_0xcd85('0x92')](),_0xcd85('0x93'))){if(this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x94')]]){var _0x468835=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x22b3f1['linkedid']]);_0x468835['queuecallercomplete']=![];_0x468835[_0xcd85('0x8c')]=!![];_0x468835[_0xcd85('0x8d')]=moment(_0x5a2121['queuecallerjoinAt'])[_0xcd85('0x95')](_0x22b3f1[_0xcd85('0x7d')],'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x468835[_0xcd85('0x80')]=_0xcd85('0x96');_0x468835['transfer']=!![];_0x468835[_0xcd85('0x97')]='FORWARD';_0x468835['transferexten']=_0x22b3f1[_0xcd85('0x98')];_0x468835[_0xcd85('0x99')]=_0x22b3f1[_0xcd85('0x47')];logger['info'](_0xcd85('0x9a'),_0x468835[_0xcd85('0x49')],_0x468835[_0xcd85('0x50')]);var _0x55ec67=this['queueReports'][_0x22b3f1[_0xcd85('0x94')]];this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x94')]]=this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x47')]];this[_0xcd85('0x11')][_0x22b3f1[_0xcd85('0x47')]]=_0x55ec67;}}else{_0x5a2121[_0xcd85('0x80')]='COMPLETEDBY'+_0x22b3f1[_0xcd85('0x8f')][_0xcd85('0x9b')]();logger[_0xcd85('0x65')](_0xcd85('0x9c'),_0x5a2121[_0xcd85('0x49')],_0x5a2121[_0xcd85('0x50')],_0x5a2121[_0xcd85('0x80')]);}}}this['channels'][_0x22b3f1[_0xcd85('0x47')]]=_0x5a2121;this['emitVoiceQueueChannelRemove'](_0x5a2121,_0xcd85('0x21'));}}}catch(_0x5317e0){logger[_0xcd85('0x3b')](_0xcd85('0x9d'),_0x22b3f1[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x5317e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd85('0x25')]=function(_0x176a6e){try{if(this[_0xcd85('0x63')](_0x176a6e)){logger[_0xcd85('0x44')](_0xcd85('0x9e'),_0x176a6e[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x176a6e,{'showHidden':![],'depth':null}));this[_0xcd85('0x9f')](_0x176a6e[_0xcd85('0x47')],_[_0xcd85('0x76')](_0x176a6e[_0xcd85('0xa0')])[0x0],_0x176a6e['value']);if(this[_0xcd85('0x11')][_0x176a6e[_0xcd85('0x47')]]){var _0x52dcee=_[_0xcd85('0x7a')](this[_0xcd85('0x11')][_0x176a6e[_0xcd85('0x47')]]);if(_0x52dcee){if(this['isNotNull'](_0x176a6e[_0xcd85('0xa0')])&&this[_0xcd85('0x63')](_0x176a6e[_0xcd85('0xa0')][_0xcd85('0xa1')])){switch(_0x176a6e[_0xcd85('0xa2')]){case _0xcd85('0xa3'):_0x52dcee[_0xcd85('0x8c')]=![];_0x52dcee[_0xcd85('0x8d')]=null;break;case'TIMEOUT':_0x52dcee['lastevent']=_0xcd85('0xa4');_0x52dcee['queuecallerexit']=!![];_0x52dcee[_0xcd85('0x8d')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x52dcee['queuecallerleaveAt']=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));logger[_0xcd85('0x44')](_0xcd85('0xa5'),_0x176a6e[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x52dcee,{'showHidden':![],'depth':null}));ami[_0xcd85('0x42')](_0xcd85('0xa6'),_0x52dcee);break;default:_0x52dcee[_0xcd85('0x8c')]=!![];_0x52dcee['queuecallerexitAt']=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));_0x52dcee[_0xcd85('0x85')]=moment()[_0xcd85('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52dcee[_0xcd85('0x1d')]=![];_0x52dcee[_0xcd85('0x7f')]=null;_0x52dcee['queuecallerexitreason']=_0x176a6e[_0xcd85('0xa2')];this[_0xcd85('0x13')][_0x176a6e['uniqueid']]=_0x52dcee;this[_0xcd85('0x40')](_0x52dcee,_0xcd85('0xa7'));}else if(this['isNotNull'](_0x176a6e[_0xcd85('0xa0')])&&this['isNotNull'](_0x176a6e['variable'][_0xcd85('0xa8')])){if(!_0x52dcee[_0xcd85('0x1d')]){_0x52dcee['queuecallerexit']=!![];_0x52dcee[_0xcd85('0x8d')]=moment()[_0xcd85('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x52dcee[_0xcd85('0x80')]='EXITWITHKEY';_0x52dcee[_0xcd85('0x85')]=moment()[_0xcd85('0x4d')](_0xcd85('0x6f'));this[_0xcd85('0x13')][_0x176a6e[_0xcd85('0x47')]]=_0x52dcee;}}logger[_0xcd85('0x65')](_0xcd85('0xa9'),_0x176a6e[_0xcd85('0x47')],_0x52dcee['name'],_0x52dcee[_0xcd85('0x50')],_[_0xcd85('0x76')](_0x176a6e[_0xcd85('0xa0')])[0x0],_0x176a6e[_0xcd85('0xa2')]);_0x52dcee['variables']=this[_0xcd85('0x17')][_0x176a6e['uniqueid']];}}}}catch(_0x3c43e6){logger[_0xcd85('0x3b')](_0xcd85('0x9e'),_0x176a6e[_0xcd85('0x47')],util['inspect'](_0x3c43e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd85('0xd')][_0xcd85('0x9f')]=function(_0x346bd0,_0x125e4c,_0x232f6a){var _0x2a87d6=['rtpaudioqos',_0xcd85('0xaa'),_0xcd85('0xab'),_0xcd85('0xac'),_0xcd85('0xad'),_0xcd85('0xae'),_0xcd85('0xaf'),_0xcd85('0xb0'),'sipcallid',_0xcd85('0xb1'),'bridgepeer','bridgepvtcallid',_0xcd85('0xb2'),_0xcd85('0xb3'),_0xcd85('0xb4'),'memberlastcall',_0xcd85('0x8b'),_0xcd85('0xb5'),_0xcd85('0xb6')];if(!_[_0xcd85('0xb7')](_0x125e4c)&&!_[_0xcd85('0xb8')](_0x2a87d6,_0x125e4c)){if(_[_0xcd85('0x5c')](this[_0xcd85('0x17')][_0x346bd0])){this[_0xcd85('0x17')][_0x346bd0]={};}this[_0xcd85('0x17')][_0x346bd0][_0x125e4c]=_0x232f6a;}};VoiceQueueReport['prototype'][_0xcd85('0x26')]=function(_0x24684e){try{if(this[_0xcd85('0x63')](_0x24684e)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x24684e[_0xcd85('0x47')],util[_0xcd85('0x3d')](_0x24684e,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x24684e['uniqueid']]){for(var _0x4465c5=0x0,_0x56d517={};_0x4465c50x0?_0x17febe:0x0;this['voiceQueues'][_0x642347[_0xc4ab('0x63')]][_0xc4ab('0x2e')]=this[_0xc4ab('0x13')][_0x642347[_0xc4ab('0x63')]]['talking']>_[_0xc4ab('0x6a')](_0x642347[_0xc4ab('0x69')])?_[_0xc4ab('0x6a')](_0x642347['loggedin']):this[_0xc4ab('0x13')][_0x642347[_0xc4ab('0x63')]][_0xc4ab('0x2e')];this[_0xc4ab('0x4b')](this['voiceQueues'][_0x642347[_0xc4ab('0x63')]],'queuesummary');}logger[_0xc4ab('0x43')](_0xc4ab('0x6b'),util['inspect'](this['voiceQueues'][_0x642347['queue']],{'showHidden':![],'depth':null}));ami[_0xc4ab('0x41')](_0xc4ab('0x6c'),this['voiceQueues'][_0x642347[_0xc4ab('0x63')]]);}}}catch(_0x2c4379){logger[_0xc4ab('0x39')](_0xc4ab('0x61'),util[_0xc4ab('0x3a')](_0x2c4379,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc4ab('0xb')][_0xc4ab('0x16')]=function(_0x314dab){logger[_0xc4ab('0x43')](_0xc4ab('0x6d'),util[_0xc4ab('0x3a')](_0x314dab,{'showHidden':![],'depth':null}));this[_0xc4ab('0x5f')]=!![];};VoiceQueueReport['prototype'][_0xc4ab('0x19')]=function(_0x2f205c){try{if(this[_0xc4ab('0x5b')](_0x2f205c)){logger['debug'](_0xc4ab('0x6e'),_0x2f205c[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x2f205c,{'showHidden':![],'depth':null}));if(_[_0xc4ab('0x5c')](this[_0xc4ab('0x3b')][_0x2f205c[_0xc4ab('0x46')]]))this[_0xc4ab('0x3b')][_0x2f205c['uniqueid']]=[];if(_[_0xc4ab('0x5c')](this[_0xc4ab('0x11')][_0x2f205c['uniqueid']]))this[_0xc4ab('0x11')][_0x2f205c['uniqueid']]={};var _0x16a97e=new QueueReport();_0x16a97e[_0xc4ab('0x48')]=_0x2f205c[_0xc4ab('0x63')];_0x16a97e[_0xc4ab('0x4c')]=this[_0xc4ab('0x13')][_0x16a97e['name']]&&this[_0xc4ab('0x13')][_0x16a97e[_0xc4ab('0x48')]][_0xc4ab('0x4c')]?this[_0xc4ab('0x13')][_0x16a97e[_0xc4ab('0x48')]][_0xc4ab('0x4c')]||'inbound':_0xc4ab('0x4d');_0x16a97e[_0xc4ab('0x63')]=_0x2f205c[_0xc4ab('0x63')];_0x16a97e[_0xc4ab('0x6f')]=moment()[_0xc4ab('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x16a97e[_0xc4ab('0x70')]=_0x2f205c[_0xc4ab('0x70')];_0x16a97e[_0xc4ab('0x71')]=_0x2f205c[_0xc4ab('0x71')];_0x16a97e['uniqueid']=_0x2f205c[_0xc4ab('0x46')];_0x16a97e['routealias']=this[_0xc4ab('0x11')][_0x2f205c['uniqueid']][_0xc4ab('0x72')];logger[_0xc4ab('0x65')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x16a97e[_0xc4ab('0x48')],_0x16a97e['type']);_[_0xc4ab('0x73')](_0x16a97e,_[_0xc4ab('0x74')](_0x2f205c,_[_0xc4ab('0x75')](_0x16a97e)));this['queueReports'][_0x2f205c['uniqueid']][_0xc4ab('0x76')](_0x16a97e);this[_0xc4ab('0x11')][_0x2f205c['uniqueid']]=_0x16a97e;this[_0xc4ab('0x42')](_0x16a97e,_0xc4ab('0x18'));}}catch(_0x2290c5){logger[_0xc4ab('0x39')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2f205c['uniqueid'],util[_0xc4ab('0x3a')](_0x2290c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc4ab('0xb')][_0xc4ab('0x1b')]=function(_0x391b5d){try{if(this[_0xc4ab('0x5b')](_0x391b5d)){logger[_0xc4ab('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x391b5d[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x391b5d,{'showHidden':![],'depth':null}));if(this[_0xc4ab('0x3b')][_0x391b5d[_0xc4ab('0x46')]]){var _0xf93220=_[_0xc4ab('0x77')](this[_0xc4ab('0x3b')][_0x391b5d['uniqueid']]);_0xf93220[_0xc4ab('0x78')]=![];_0xf93220[_0xc4ab('0x79')]=null;_0xf93220[_0xc4ab('0x7a')]=_0x391b5d['holdtime'];_0xf93220[_0xc4ab('0x7b')]=_0x391b5d[_0xc4ab('0x7b')];_0xf93220[_0xc4ab('0x1a')]=!![];_0xf93220[_0xc4ab('0x7c')]=moment()[_0xc4ab('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0xf93220[_0xc4ab('0x7d')]='ABANDONED';_0xf93220[_0xc4ab('0x7e')]=null;logger['info'](_0xc4ab('0x7f'),_0xf93220[_0xc4ab('0x48')],_0xf93220[_0xc4ab('0x4c')]);this[_0xc4ab('0x11')][_0x391b5d[_0xc4ab('0x46')]]=_0xf93220;this[_0xc4ab('0x3f')](_0xf93220,_0xc4ab('0x1a'));}}}catch(_0x594397){logger[_0xc4ab('0x39')]('[%s][voiceQueueReport][queuecallerabandon]',_0x391b5d['uniqueid'],util[_0xc4ab('0x3a')](_0x594397,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc4ab('0x1d')]=function(_0x5fac1c){try{if(this[_0xc4ab('0x5b')](_0x5fac1c)){logger[_0xc4ab('0x43')](_0xc4ab('0x80'),_0x5fac1c[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x5fac1c,{'showHidden':![],'depth':null}));if(this[_0xc4ab('0x3b')][_0x5fac1c[_0xc4ab('0x46')]]){var _0x4aa6d9=_[_0xc4ab('0x77')](this[_0xc4ab('0x3b')][_0x5fac1c[_0xc4ab('0x46')]]);_0x4aa6d9[_0xc4ab('0x81')]=moment()['format'](_0xc4ab('0x82'));_0x4aa6d9['connectedlinenum']=_0x5fac1c[_0xc4ab('0x83')];_0x4aa6d9[_0xc4ab('0x84')]=_0x5fac1c[_0xc4ab('0x84')];logger[_0xc4ab('0x65')](_0xc4ab('0x85'),_0x4aa6d9[_0xc4ab('0x48')],_0x4aa6d9[_0xc4ab('0x4c')],_0x5fac1c[_0xc4ab('0x83')],_0x5fac1c[_0xc4ab('0x84')]);this[_0xc4ab('0x11')][_0x5fac1c[_0xc4ab('0x46')]]=_0x4aa6d9;this[_0xc4ab('0x42')](_0x4aa6d9,'queuecallerleave');}}}catch(_0x416f2d){logger[_0xc4ab('0x39')]('[%s][voiceQueueReport][queuecallerleave]',_0x5fac1c['uniqueid'],util['inspect'](_0x416f2d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc4ab('0xb')]['syncAgentConnect']=function(_0x5a619d){try{if(this[_0xc4ab('0x5b')](_0x5a619d)){logger[_0xc4ab('0x43')](_0xc4ab('0x86'),_0x5a619d[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x5a619d,{'showHidden':![],'depth':null}));if(this[_0xc4ab('0x3b')][_0x5a619d[_0xc4ab('0x46')]]){var _0x5232a8=_[_0xc4ab('0x77')](this['queueReports'][_0x5a619d[_0xc4ab('0x46')]]);_0x5232a8['queuecallercomplete']=!![];_0x5232a8[_0xc4ab('0x7d')]=_0xc4ab('0x87');logger[_0xc4ab('0x65')](_0xc4ab('0x88'),_0x5232a8[_0xc4ab('0x48')],_0x5232a8[_0xc4ab('0x4c')]);}}}catch(_0x1b537d){logger[_0xc4ab('0x39')](_0xc4ab('0x86'),_0x5a619d[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x1b537d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc4ab('0xb')]['syncAgentComplete']=function(_0x2bf3c9){try{if(this['isNotNull'](_0x2bf3c9)){logger[_0xc4ab('0x43')](_0xc4ab('0x89'),_0x2bf3c9[_0xc4ab('0x46')],util['inspect'](_0x2bf3c9,{'showHidden':![],'depth':null}));if(this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x46')]]){var _0x364e70=_['last'](this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x46')]]);_0x364e70[_0xc4ab('0x1a')]=![];_0x364e70['queuecallerabandonAt']=null;_0x364e70[_0xc4ab('0x8a')]=!![];_0x364e70['lastAssignedTo']=_0x2bf3c9[_0xc4ab('0x8b')];_0x364e70['holdtime']=_0x2bf3c9['holdtime'];_0x364e70[_0xc4ab('0x78')]=!![];_0x364e70[_0xc4ab('0x8c')]=![];_0x364e70[_0xc4ab('0x8d')]=null;if(!_0x364e70[_0xc4ab('0x8e')]){if(_0x2bf3c9[_0xc4ab('0x8f')]==_0xc4ab('0x8e')){_0x364e70['queuecallerexitreason']=_0xc4ab('0x90');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x364e70['name'],_0x364e70[_0xc4ab('0x4c')]);}else{if(_['startsWith'](_0x2bf3c9[_0xc4ab('0x37')][_0xc4ab('0x91')](),'local/')){if(this[_0xc4ab('0x3b')][_0x2bf3c9['linkedid']]){var _0x286df3=_['last'](this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x92')]]);_0x286df3[_0xc4ab('0x78')]=![];_0x286df3['queuecallerexit']=!![];_0x286df3[_0xc4ab('0x8d')]=moment(_0x364e70[_0xc4ab('0x6f')])[_0xc4ab('0x93')](_0x2bf3c9[_0xc4ab('0x7a')],_0xc4ab('0x94'))[_0xc4ab('0x47')](_0xc4ab('0x82'));_0x286df3[_0xc4ab('0x7d')]=_0xc4ab('0x95');_0x286df3[_0xc4ab('0x8e')]=!![];_0x286df3[_0xc4ab('0x96')]='FORWARD';_0x286df3[_0xc4ab('0x97')]=_0x2bf3c9['destexten'];_0x286df3['transferuniqueid']=_0x2bf3c9['uniqueid'];logger[_0xc4ab('0x65')](_0xc4ab('0x98'),_0x286df3[_0xc4ab('0x48')],_0x286df3[_0xc4ab('0x4c')]);var _0x34b76a=this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x92')]];this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x92')]]=this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x46')]];this[_0xc4ab('0x3b')][_0x2bf3c9[_0xc4ab('0x46')]]=_0x34b76a;}}else{_0x364e70[_0xc4ab('0x7d')]=_0xc4ab('0x99')+_0x2bf3c9['reason'][_0xc4ab('0x9a')]();logger[_0xc4ab('0x65')](_0xc4ab('0x9b'),_0x364e70[_0xc4ab('0x48')],_0x364e70[_0xc4ab('0x4c')],_0x364e70[_0xc4ab('0x7d')]);}}}this[_0xc4ab('0x11')][_0x2bf3c9[_0xc4ab('0x46')]]=_0x364e70;this[_0xc4ab('0x3f')](_0x364e70,_0xc4ab('0x1e'));}}}catch(_0xf7c116){logger[_0xc4ab('0x39')](_0xc4ab('0x89'),_0x2bf3c9[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0xf7c116,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc4ab('0xb')][_0xc4ab('0x9c')]=function(_0x547484){try{if(this[_0xc4ab('0x5b')](_0x547484)){logger['debug'](_0xc4ab('0x9d'),_0x547484[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x547484,{'showHidden':![],'depth':null}));this[_0xc4ab('0x9e')](_0x547484[_0xc4ab('0x46')],_['keys'](_0x547484[_0xc4ab('0x9f')])[0x0],_0x547484['value']);if(this[_0xc4ab('0x3b')][_0x547484[_0xc4ab('0x46')]]){var _0xb546c6=_[_0xc4ab('0x77')](this[_0xc4ab('0x3b')][_0x547484[_0xc4ab('0x46')]]);if(_0xb546c6){if(this[_0xc4ab('0x5b')](_0x547484[_0xc4ab('0x9f')])&&this['isNotNull'](_0x547484[_0xc4ab('0x9f')][_0xc4ab('0xa0')])){switch(_0x547484[_0xc4ab('0xa1')]){case _0xc4ab('0xa2'):_0xb546c6['queuecallerexit']=![];_0xb546c6[_0xc4ab('0x8d')]=null;break;case _0xc4ab('0xa3'):_0xb546c6[_0xc4ab('0xa4')]=_0xc4ab('0xa5');_0xb546c6[_0xc4ab('0x8c')]=!![];_0xb546c6[_0xc4ab('0x8d')]=moment()[_0xc4ab('0x47')](_0xc4ab('0x82'));_0xb546c6['queuecallerleaveAt']=moment()[_0xc4ab('0x47')](_0xc4ab('0x82'));logger[_0xc4ab('0x43')](_0xc4ab('0xa6'),_0x547484[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0xb546c6,{'showHidden':![],'depth':null}));ami[_0xc4ab('0x41')]('custom:timeout',_0xb546c6);break;default:_0xb546c6[_0xc4ab('0x8c')]=!![];_0xb546c6[_0xc4ab('0x8d')]=moment()[_0xc4ab('0x47')](_0xc4ab('0x82'));_0xb546c6['queuecallerleaveAt']=moment()['format'](_0xc4ab('0x82'));}_0xb546c6['queuecallerabandon']=![];_0xb546c6[_0xc4ab('0x7c')]=null;_0xb546c6[_0xc4ab('0x7d')]=_0x547484[_0xc4ab('0xa1')];this[_0xc4ab('0x11')][_0x547484[_0xc4ab('0x46')]]=_0xb546c6;this[_0xc4ab('0x3f')](_0xb546c6,_0xc4ab('0x21'));}else if(this[_0xc4ab('0x5b')](_0x547484[_0xc4ab('0x9f')])&&this[_0xc4ab('0x5b')](_0x547484[_0xc4ab('0x9f')][_0xc4ab('0xa7')])){if(!_0xb546c6[_0xc4ab('0x1a')]){_0xb546c6['queuecallerexit']=!![];_0xb546c6[_0xc4ab('0x8d')]=moment()[_0xc4ab('0x47')](_0xc4ab('0x82'));_0xb546c6[_0xc4ab('0x7d')]=_0xc4ab('0xa8');_0xb546c6[_0xc4ab('0x81')]=moment()[_0xc4ab('0x47')](_0xc4ab('0x82'));this[_0xc4ab('0x11')][_0x547484['uniqueid']]=_0xb546c6;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x547484[_0xc4ab('0x46')],_0xb546c6[_0xc4ab('0x48')],_0xb546c6[_0xc4ab('0x4c')],_[_0xc4ab('0x75')](_0x547484['variable'])[0x0],_0x547484[_0xc4ab('0xa1')]);_0xb546c6['variables']=this[_0xc4ab('0x15')][_0x547484[_0xc4ab('0x46')]];}}}}catch(_0x33da4a){logger[_0xc4ab('0x39')](_0xc4ab('0x9d'),_0x547484[_0xc4ab('0x46')],util[_0xc4ab('0x3a')](_0x33da4a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc4ab('0xb')][_0xc4ab('0x9e')]=function(_0x48d49d,_0x44a972,_0x51bb86){var _0x24e811=['rtpaudioqos',_0xc4ab('0xa9'),_0xc4ab('0xaa'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xc4ab('0xab'),_0xc4ab('0xac'),_0xc4ab('0xad'),_0xc4ab('0xae'),_0xc4ab('0xaf'),'bridgepeer','bridgepvtcallid',_0xc4ab('0xb0'),_0xc4ab('0xb1'),_0xc4ab('0xb2'),_0xc4ab('0xb3'),'membername',_0xc4ab('0xb4'),_0xc4ab('0xb5')];if(!_[_0xc4ab('0x34')](_0x44a972)&&!_[_0xc4ab('0xb6')](_0x24e811,_0x44a972)){if(_[_0xc4ab('0x5c')](this[_0xc4ab('0x15')][_0x48d49d])){this[_0xc4ab('0x15')][_0x48d49d]={};}this[_0xc4ab('0x15')][_0x48d49d][_0x44a972]=_0x51bb86;}};VoiceQueueReport['prototype'][_0xc4ab('0xb7')]=function(_0x3f079a){try{if(this[_0xc4ab('0x5b')](_0x3f079a)){logger[_0xc4ab('0x43')](_0xc4ab('0xb8'),_0x3f079a['uniqueid'],util[_0xc4ab('0x3a')](_0x3f079a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3f079a[_0xc4ab('0x46')]]){for(var _0x2e8517=0x0,_0x1833aa={};_0x2e8517=0x0?moment(_0x2093f9[_0x0c9e('0x1e')])[_0x0c9e('0xf')](_0x2093f9[_0x0c9e('0x1d')],_0x0c9e('0x10')):null,'data1':_0x0c9e('0x1f'),'data2':_0x2093f9[_0x0c9e('0x17')],'data3':_0x2093f9['exten'],'data4':_0x2093f9[_0x0c9e('0x20')]||null,'role':_0x0c9e('0x15'),'internal':_0x2093f9['accountcode']?_['toNumber'](_0x2093f9[_0x0c9e('0x17')]):undefined,'uniqueid':_0x2093f9[_0x0c9e('0x18')]},'log':_0x0c9e('0x7')});}; \ No newline at end of file +var _0xac99=['isNil','interface','format','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','toNumber','starttime','endtime','outbound','dialstring','agent','uniqueid','moment','util','../client','voiceQueueReport','CreateMemberReport','voice','lastAssignedTo'];(function(_0x222516,_0x49d99a){var _0x1f4c2c=function(_0x456502){while(--_0x456502){_0x222516['push'](_0x222516['shift']());}};_0x1f4c2c(++_0x49d99a);}(_0xac99,0xc1));var _0x9ac9=function(_0x4f517f,_0x15e66f){_0x4f517f=_0x4f517f-0x0;var _0x48bc81=_0xac99[_0x4f517f];return _0x48bc81;};'use strict';var moment=require(_0x9ac9('0x0'));var _=require('lodash');var util=require(_0x9ac9('0x1'));var client=require(_0x9ac9('0x2'));exports[_0x9ac9('0x3')]=function(_0xf8b946){var _0x3051af=_0xf8b946['queuecallercompleteAt']||_0xf8b946['queuecallerexitAt'];return client['Request'](_0x9ac9('0x4'),{'body':{'channel':_0x9ac9('0x5'),'membername':_0xf8b946[_0x9ac9('0x6')],'interface':_[_0x9ac9('0x7')](_0xf8b946[_0x9ac9('0x8')])?util[_0x9ac9('0x9')]('SIP/%s',_0xf8b946[_0x9ac9('0x6')]):_0xf8b946['interface'],'type':_0x9ac9('0xa'),'enterAt':_0xf8b946[_0x9ac9('0xb')],'exitAt':_0x3051af,'duration':moment(_0x3051af)[_0x9ac9('0xc')](_0xf8b946['queuecallerleaveAt'],_0x9ac9('0xd')),'data1':'inbound','data2':_0xf8b946[_0x9ac9('0xe')],'data3':_0xf8b946[_0x9ac9('0xf')],'data4':null,'data5':_0xf8b946[_0x9ac9('0x10')],'role':'agent','internal':_0xf8b946[_0x9ac9('0x11')]?_[_0x9ac9('0x12')](_0xf8b946['accountcode']):undefined,'uniqueid':_0xf8b946['uniqueid']},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0xd52609){return client['Request'](_0x9ac9('0x4'),{'body':{'channel':_0x9ac9('0x5'),'membername':_0xd52609['membername'],'interface':_0xd52609['interface'],'type':_0x9ac9('0xa'),'enterAt':_0xd52609[_0x9ac9('0x13')],'exitAt':_0xd52609[_0x9ac9('0x14')],'duration':moment(_0xd52609[_0x9ac9('0x14')])[_0x9ac9('0xc')](_0xd52609[_0x9ac9('0x13')],_0x9ac9('0xd'))>=0x0?moment(_0xd52609['endtime'])['diff'](_0xd52609['starttime'],_0x9ac9('0xd')):null,'data1':_0x9ac9('0x15'),'data2':_0xd52609[_0x9ac9('0x11')],'data3':_0xd52609[_0x9ac9('0xf')],'data4':_0xd52609[_0x9ac9('0x16')]||null,'role':_0x9ac9('0x17'),'internal':_0xd52609[_0x9ac9('0x11')]?_[_0x9ac9('0x12')](_0xd52609[_0x9ac9('0x11')]):undefined,'uniqueid':_0xd52609[_0x9ac9('0x18')]},'log':_0x9ac9('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 68293a7..f9dd1bd 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 _0x79d3=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x4f0a89,_0x52adca){var _0x1bdd37=function(_0x2c878f){while(--_0x2c878f){_0x4f0a89['push'](_0x4f0a89['shift']());}};_0x1bdd37(++_0x52adca);}(_0x79d3,0x179));var _0x379d=function(_0x1a04a6,_0x1b9764){_0x1a04a6=_0x1a04a6-0x0;var _0xb3f005=_0x79d3[_0x1a04a6];return _0xb3f005;};'use strict';var client=require(_0x379d('0x0'));exports[_0x379d('0x1')]=function(){return client[_0x379d('0x2')](_0x379d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x379d('0x4')]},'log':_0x379d('0x5')});}; \ No newline at end of file +var _0xac92=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0xac92,0x7b));var _0x2ac9=function(_0x4cab9c,_0xf772d9){_0x4cab9c=_0x4cab9c-0x0;var _0x578898=_0xac92[_0x4cab9c];return _0x578898;};'use strict';var client=require(_0x2ac9('0x0'));exports[_0x2ac9('0x1')]=function(){return client[_0x2ac9('0x2')](_0x2ac9('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2ac9('0x4')]},'log':_0x2ac9('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 68d7338..9dd90f9 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 _0x059a=['GetTemplate','name','getTemplates'];(function(_0x593020,_0x12ca30){var _0x215c24=function(_0x2b7118){while(--_0x2b7118){_0x593020['push'](_0x593020['shift']());}};_0x215c24(++_0x12ca30);}(_0x059a,0x18b));var _0xa059=function(_0x5e7e92,_0xdb0f1){_0x5e7e92=_0x5e7e92-0x0;var _0x412746=_0x059a[_0x5e7e92];return _0x412746;};'use strict';var client=require('../client');exports[_0xa059('0x0')]=function(_0x506795){return function(_0x4e5507){return client['Request'](_0xa059('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa059('0x2'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x5843=['../client','Request','GetTemplate','name'];(function(_0x55df8d,_0x21225e){var _0x18cd9b=function(_0x3be621){while(--_0x3be621){_0x55df8d['push'](_0x55df8d['shift']());}};_0x18cd9b(++_0x21225e);}(_0x5843,0x74));var _0x3584=function(_0x1e5cb3,_0x2e0133){_0x1e5cb3=_0x1e5cb3-0x0;var _0x693572=_0x5843[_0x1e5cb3];return _0x693572;};'use strict';var client=require(_0x3584('0x0'));exports['getTemplates']=function(_0x170d21){return function(_0x3c7a35){return client[_0x3584('0x1')](_0x3584('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3584('0x3'),'html']},'log':_0x3584('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index b8579c7..889e8f8 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 _0x5206=['data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','AllConditions','field','value','AnyConditions','operator','Action','Actions','action','data1','data3','data4'];(function(_0x2fb654,_0x47558f){var _0x52284d=function(_0x35698c){while(--_0x35698c){_0x2fb654['push'](_0x2fb654['shift']());}};_0x52284d(++_0x47558f);}(_0x5206,0x1bb));var _0x6520=function(_0x4c27ca,_0x542d00){_0x4c27ca=_0x4c27ca-0x0;var _0x41fba0=_0x5206[_0x4c27ca];return _0x41fba0;};'use strict';var client=require(_0x6520('0x0'));exports[_0x6520('0x1')]=function(_0x5d5173){return function(_0x3d66e5){return client[_0x6520('0x2')](_0x6520('0x3'),{'options':{'raw':![],'attributes':['id',_0x6520('0x4'),_0x6520('0x5'),'status'],'include':[{'model':'Condition','as':_0x6520('0x6'),'attributes':['id',_0x6520('0x7'),'operator',_0x6520('0x8')]},{'model':'Condition','as':_0x6520('0x9'),'attributes':['id',_0x6520('0x7'),_0x6520('0xa'),_0x6520('0x8')]},{'model':_0x6520('0xb'),'as':_0x6520('0xc'),'attributes':['id',_0x6520('0xd'),_0x6520('0xe'),'data2',_0x6520('0xf'),_0x6520('0x10'),_0x6520('0x11'),_0x6520('0x12'),_0x6520('0x13')]}]},'log':_0x6520('0x3')});};}; \ No newline at end of file +var _0xfd88=['data2','data4','data5','data6','data7','../client','getTriggers','Request','channel','status','Condition','AllConditions','AnyConditions','field','operator','value','Action','Actions','action','data1'];(function(_0x526269,_0x5bfb14){var _0x5d21e0=function(_0x516d2d){while(--_0x516d2d){_0x526269['push'](_0x526269['shift']());}};_0x5d21e0(++_0x5bfb14);}(_0xfd88,0xcd));var _0x8fd8=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0xfd88[_0x272d90];return _0x2bf4a2;};'use strict';var client=require(_0x8fd8('0x0'));exports[_0x8fd8('0x1')]=function(_0x52f3df){return function(_0x174ff8){return client[_0x8fd8('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x8fd8('0x3'),_0x8fd8('0x4')],'include':[{'model':_0x8fd8('0x5'),'as':_0x8fd8('0x6'),'attributes':['id','field','operator','value']},{'model':_0x8fd8('0x5'),'as':_0x8fd8('0x7'),'attributes':['id',_0x8fd8('0x8'),_0x8fd8('0x9'),_0x8fd8('0xa')]},{'model':_0x8fd8('0xb'),'as':_0x8fd8('0xc'),'attributes':['id',_0x8fd8('0xd'),_0x8fd8('0xe'),_0x8fd8('0xf'),'data3',_0x8fd8('0x10'),_0x8fd8('0x11'),_0x8fd8('0x12'),_0x8fd8('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 425e952..c5557d5 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 _0xf3a6=['GetTrunk','name','registry','defaultuser','Request'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf3a6,0x1e9));var _0x6f3a=function(_0x39285d,_0x4e7c32){_0x39285d=_0x39285d-0x0;var _0x5b809b=_0xf3a6[_0x39285d];return _0x5b809b;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x4a1034){return function(_0x57f158){return client[_0x6f3a('0x0')](_0x6f3a('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6f3a('0x2'),_0x6f3a('0x3'),_0x6f3a('0x4')]},'log':_0x6f3a('0x1')});};}; \ No newline at end of file +var _0x590c=['registry','defaultuser','../client','Request','GetTrunk','name'];(function(_0x2b429e,_0x3395b3){var _0x43ff8a=function(_0x22fa95){while(--_0x22fa95){_0x2b429e['push'](_0x2b429e['shift']());}};_0x43ff8a(++_0x3395b3);}(_0x590c,0x80));var _0xc590=function(_0xfeeea4,_0x30e65b){_0xfeeea4=_0xfeeea4-0x0;var _0x118b57=_0x590c[_0xfeeea4];return _0x118b57;};'use strict';var client=require(_0xc590('0x0'));exports['getTrunks']=function(_0x53d81b){return function(_0x3ce18b){return client[_0xc590('0x1')](_0xc590('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc590('0x3'),_0xc590('0x4'),_0xc590('0x5')]},'log':_0xc590('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 69410a2..c4c5cb5 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x20be82,_0x47c505){var _0x2139c7=function(_0x46b8f1){while(--_0x46b8f1){_0x20be82['push'](_0x20be82['shift']());}};_0x2139c7(++_0x47c505);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xcb91[_0x22c684];return _0x39fcbb;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x3a0f07,_0x26e3a2){var _0x14c670=function(_0x22c235){while(--_0x22c235){_0x3a0f07['push'](_0x3a0f07['shift']());}};_0x14c670(++_0x26e3a2);}(_0x34e8,0x12c));var _0x834e=function(_0x3bbb49,_0x5162c7){_0x3bbb49=_0x3bbb49-0x0;var _0x5dca1e=_0x34e8[_0x3bbb49];return _0x5dca1e;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c7069a8..e2b44dd 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 _0x5e00=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x1219ba,_0x195743){var _0x582035=function(_0x374e34){while(--_0x374e34){_0x1219ba['push'](_0x1219ba['shift']());}};_0x582035(++_0x195743);}(_0x5e00,0xc2));var _0x05e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5e00[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x05e0('0x0'));exports[_0x05e0('0x1')]=function(_0x22adf1){return client['Request'](_0x05e0('0x2'),{'body':_0x22adf1,'log':'CreateVoiceAgentReport'});};exports[_0x05e0('0x3')]=function(_0x1d7e35,_0x1b46b5,_0x2e7c41){return client[_0x05e0('0x4')](_0x05e0('0x5'),{'body':_0x1d7e35,'options':{'where':{'uniqueid':_0x1b46b5,'interface':_0x2e7c41,'agentcomplete':!![]}},'log':_0x05e0('0x5')});}; \ No newline at end of file +var _0x1343=['UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport','update'];(function(_0x17ef74,_0x155828){var _0x576658=function(_0x47babb){while(--_0x47babb){_0x17ef74['push'](_0x17ef74['shift']());}};_0x576658(++_0x155828);}(_0x1343,0x1f0));var _0x3134=function(_0x11f083,_0x38a7dd){_0x11f083=_0x11f083-0x0;var _0x1a41f3=_0x1343[_0x11f083];return _0x1a41f3;};'use strict';var client=require('../client');exports[_0x3134('0x0')]=function(_0x5e7d26){return client[_0x3134('0x1')](_0x3134('0x2'),{'body':_0x5e7d26,'log':_0x3134('0x2')});};exports[_0x3134('0x3')]=function(_0x3f710e,_0x6c1b26,_0x543dbb){return client[_0x3134('0x1')](_0x3134('0x4'),{'body':_0x3f710e,'options':{'where':{'uniqueid':_0x6c1b26,'interface':_0x543dbb,'agentcomplete':!![]}},'log':_0x3134('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6975b18..e3182d6 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 _0x17de=['disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x53c177,_0x5c8b30){var _0x4a9c32=function(_0x46ab17){while(--_0x46ab17){_0x53c177['push'](_0x53c177['shift']());}};_0x4a9c32(++_0x5c8b30);}(_0x17de,0x67));var _0xe17d=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0x17de[_0x4ac48d];return _0x7537af;};'use strict';var moment=require(_0xe17d('0x0'));var util=require(_0xe17d('0x1'));var _=require(_0xe17d('0x2'));var client=require(_0xe17d('0x3'));exports[_0xe17d('0x4')]=function(_0x2ea5f1){return client[_0xe17d('0x5')](_0xe17d('0x6'),{'body':_['merge'](_0x2ea5f1,{'source':_0x2ea5f1['calleridnum'],'destinationcontext':_0x2ea5f1[_0xe17d('0x7')],'callerid':_0x2ea5f1['callerid'],'amaflags':_0xe17d('0x8')}),'log':_0xe17d('0x6')});};exports[_0xe17d('0x9')]=function(){return function(){return client[_0xe17d('0x5')](_0xe17d('0xa'),{'options':{'where':{'type':[_0xe17d('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xe17d('0xc'))[_0xe17d('0xd')](_0xe17d('0xe')),moment()[_0xe17d('0xf')]('day')['format'](_0xe17d('0xe'))]}},'attributes':[_0xe17d('0x10'),_0xe17d('0x11'),_0xe17d('0x12'),_0xe17d('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x7dd7=['duration','billableseconds','GetVoiceCallReports','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','endOf','disposition'];(function(_0x4ffafb,_0x20171a){var _0x4ab472=function(_0x1afc75){while(--_0x1afc75){_0x4ffafb['push'](_0x4ffafb['shift']());}};_0x4ab472(++_0x20171a);}(_0x7dd7,0x1b8));var _0x77dd=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x7dd7[_0x468a77];return _0x2d1c33;};'use strict';var moment=require('moment');var util=require(_0x77dd('0x0'));var _=require(_0x77dd('0x1'));var client=require('../client');exports['create']=function(_0x4a7c10){return client[_0x77dd('0x2')](_0x77dd('0x3'),{'body':_[_0x77dd('0x4')](_0x4a7c10,{'source':_0x4a7c10[_0x77dd('0x5')],'destinationcontext':_0x4a7c10[_0x77dd('0x6')],'callerid':_0x4a7c10[_0x77dd('0x7')],'amaflags':_0x77dd('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x77dd('0x9')]=function(){return function(){return client[_0x77dd('0x2')](_0x77dd('0xa'),{'options':{'where':{'type':[_0x77dd('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x77dd('0xc'))[_0x77dd('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x77dd('0xe')](_0x77dd('0xc'))[_0x77dd('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x77dd('0xf'),_0x77dd('0x10'),_0x77dd('0x11')]},'log':_0x77dd('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 5a9f052..b4660b9 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 _0x4baf=['CreateVoiceDialReport','../client','Request'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x4baf,0x10c));var _0xf4ba=function(_0x4e3b64,_0xe13dd9){_0x4e3b64=_0x4e3b64-0x0;var _0x56a8ce=_0x4baf[_0x4e3b64];return _0x56a8ce;};'use strict';var client=require(_0xf4ba('0x0'));exports['create']=function(_0x63c177){return client[_0xf4ba('0x1')](_0xf4ba('0x2'),{'body':_0x63c177,'log':_0xf4ba('0x2')});}; \ No newline at end of file +var _0x2f67=['Request','CreateVoiceDialReport','../client'];(function(_0x325a5a,_0x58984d){var _0x54dee6=function(_0x3b0eb2){while(--_0x3b0eb2){_0x325a5a['push'](_0x325a5a['shift']());}};_0x54dee6(++_0x58984d);}(_0x2f67,0x167));var _0x72f6=function(_0x6ae23f,_0x5ad8f6){_0x6ae23f=_0x6ae23f-0x0;var _0x2b9cc3=_0x2f67[_0x6ae23f];return _0x2b9cc3;};'use strict';var client=require(_0x72f6('0x0'));exports['create']=function(_0x475d21){return client[_0x72f6('0x1')]('CreateVoiceDialReport',{'body':_0x475d21,'log':_0x72f6('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 8d91c4a..5cdf671 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 _0x9f94=['getVoiceExtensions','Request','recordingFormat','../client'];(function(_0x2dcd57,_0x3ef5b1){var _0x26789b=function(_0x59fbea){while(--_0x59fbea){_0x2dcd57['push'](_0x2dcd57['shift']());}};_0x26789b(++_0x3ef5b1);}(_0x9f94,0x1e7));var _0x49f9=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9f94[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0x49f9('0x0'));exports[_0x49f9('0x1')]=function(){return function(){return client[_0x49f9('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x49f9('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x49f9('0x1')});};}; \ No newline at end of file +var _0xe28e=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xe28e,0x1ba));var _0xee28=function(_0x4e9fa8,_0x39a916){_0x4e9fa8=_0x4e9fa8-0x0;var _0x3c0df6=_0xe28e[_0x4e9fa8];return _0x3c0df6;};'use strict';var client=require(_0xee28('0x0'));exports[_0xee28('0x1')]=function(){return function(){return client[_0xee28('0x2')](_0xee28('0x3'),{'options':{'raw':!![],'attributes':['id',_0xee28('0x4'),_0xee28('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xee28('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 5049a61..641530f 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 _0x4d87=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName'];(function(_0x2cf0d1,_0x444114){var _0x166fee=function(_0x5cd185){while(--_0x5cd185){_0x2cf0d1['push'](_0x2cf0d1['shift']());}};_0x166fee(++_0x444114);}(_0x4d87,0xf0));var _0x74d8=function(_0x2af50a,_0xa2c81d){_0x2af50a=_0x2af50a-0x0;var _0x36ff3b=_0x4d87[_0x2af50a];return _0x36ff3b;};'use strict';var client=require('../client');exports[_0x74d8('0x0')]=function(){return function(){return client[_0x74d8('0x1')](_0x74d8('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x74d8('0x3'),_0x74d8('0x4'),'autopause','monitor_format',_0x74d8('0x5'),_0x74d8('0x6'),_0x74d8('0x7'),_0x74d8('0x8'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0x74d8('0x9'),_0x74d8('0xa'),_0x74d8('0xb'),_0x74d8('0xc'),_0x74d8('0xd'),_0x74d8('0xe'),'dialQueueTimeout',_0x74d8('0xf'),_0x74d8('0x10'),_0x74d8('0x11'),_0x74d8('0x12'),_0x74d8('0x13'),_0x74d8('0x14'),_0x74d8('0x15'),_0x74d8('0x16'),_0x74d8('0x17'),'dialGlobalInterval',_0x74d8('0x18'),_0x74d8('0x19'),'dialAMDActive',_0x74d8('0x1a'),_0x74d8('0x1b'),_0x74d8('0x1c'),_0x74d8('0x1d'),_0x74d8('0x1e'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x74d8('0x1f'),_0x74d8('0x20'),_0x74d8('0x21'),_0x74d8('0x22'),_0x74d8('0x23'),_0x74d8('0x24'),'dialAgiAfterHangupClient',_0x74d8('0x25'),'monitor_format',_0x74d8('0x26'),_0x74d8('0x27'),_0x74d8('0x28'),_0x74d8('0x29'),_0x74d8('0x2a'),_0x74d8('0x2b'),_0x74d8('0x2c'),'dialAbandonedMaxRetry',_0x74d8('0x2d'),_0x74d8('0x2e'),'dialMachineRetryFrequency',_0x74d8('0x2f'),_0x74d8('0x30'),_0x74d8('0x31'),_0x74d8('0x32'),_0x74d8('0x33'),_0x74d8('0x34')],'include':[{'model':_0x74d8('0x35'),'as':_0x74d8('0x35'),'attributes':['id',_0x74d8('0x36'),_0x74d8('0x37'),_0x74d8('0x38')]},{'model':_0x74d8('0x39'),'as':_0x74d8('0x3a'),'attributes':['id',_0x74d8('0x36')]},{'model':_0x74d8('0x35'),'as':_0x74d8('0x3b'),'attributes':['id',_0x74d8('0x36'),_0x74d8('0x37'),_0x74d8('0x38')]},{'model':'Interval','as':_0x74d8('0x3c'),'attributes':['id',_0x74d8('0x36')],'include':[{'model':_0x74d8('0x3c'),'as':_0x74d8('0x3d'),'attributes':['id',_0x74d8('0x36'),_0x74d8('0x3e')]}]}]},'log':_0x74d8('0x0')});};}; \ No newline at end of file +var _0xf072=['dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','../client','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x1e2b89,_0x456916){var _0x3aec4e=function(_0x1a4c27){while(--_0x1a4c27){_0x1e2b89['push'](_0x1e2b89['shift']());}};_0x3aec4e(++_0x456916);}(_0xf072,0x1cf));var _0x2f07=function(_0xa26b7b,_0x13c525){_0xa26b7b=_0xa26b7b-0x0;var _0x458101=_0xf072[_0xa26b7b];return _0x458101;};'use strict';var client=require(_0x2f07('0x0'));exports[_0x2f07('0x1')]=function(){return function(){return client[_0x2f07('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x2f07('0x3'),'acw',_0x2f07('0x4'),_0x2f07('0x5'),_0x2f07('0x6'),'type',_0x2f07('0x7'),_0x2f07('0x8'),_0x2f07('0x9'),_0x2f07('0xa'),_0x2f07('0xb'),_0x2f07('0xc'),_0x2f07('0xd'),_0x2f07('0xe'),_0x2f07('0xf'),_0x2f07('0x10'),_0x2f07('0x11'),_0x2f07('0x12'),_0x2f07('0x13'),_0x2f07('0x14'),_0x2f07('0x15'),'dialCongestionRetryFrequency',_0x2f07('0x16'),_0x2f07('0x17'),_0x2f07('0x18'),_0x2f07('0x19'),'dialGlobalMaxRetry','dialTimezone',_0x2f07('0x1a'),_0x2f07('0x1b'),'dialCheckDuplicateType',_0x2f07('0x1c'),_0x2f07('0x1d'),_0x2f07('0x1e'),'dialAMDAfterGreetingSilence',_0x2f07('0x1f'),_0x2f07('0x20'),_0x2f07('0x21'),_0x2f07('0x22'),_0x2f07('0x23'),_0x2f07('0x24'),'timeout',_0x2f07('0x25'),'dialRecallInQueue',_0x2f07('0x26'),_0x2f07('0x27'),_0x2f07('0x28'),_0x2f07('0x29'),_0x2f07('0x6'),_0x2f07('0x2a'),_0x2f07('0x2b'),_0x2f07('0x2c'),'dialNoSuchNumberMaxRetry',_0x2f07('0x2d'),'dialDropMaxRetry',_0x2f07('0x2e'),_0x2f07('0x2f'),_0x2f07('0x30'),_0x2f07('0x31'),_0x2f07('0x32'),'dialAgentRejectMaxRetry',_0x2f07('0x33'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x2f07('0x34')],'include':[{'model':'Trunk','as':_0x2f07('0x35'),'attributes':['id','name',_0x2f07('0x36'),_0x2f07('0x37')]},{'model':_0x2f07('0x38'),'as':_0x2f07('0x39'),'attributes':['id','name']},{'model':_0x2f07('0x35'),'as':_0x2f07('0x3a'),'attributes':['id',_0x2f07('0x3'),'callerid',_0x2f07('0x37')]},{'model':_0x2f07('0x3b'),'as':'Interval','attributes':['id',_0x2f07('0x3')],'include':[{'model':_0x2f07('0x3b'),'as':'Intervals','attributes':['id',_0x2f07('0x3'),'interval']}]}]},'log':_0x2f07('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 91e0801..f0a8797 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(_0x1fb299,_0x13dcc9){var _0x5db7da=function(_0x4f8e98){while(--_0x4f8e98){_0x1fb299['push'](_0x1fb299['shift']());}};_0x5db7da(++_0x13dcc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x286c27,_0x2bf6a4){var _0x54f834=function(_0x57c998){while(--_0x57c998){_0x286c27['push'](_0x286c27['shift']());}};_0x54f834(++_0x2bf6a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 706b556..b64ac77 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 _0x6186=['Request','getVoiceQueueRtPauses','../client'];(function(_0x22ba60,_0x164968){var _0x2c9354=function(_0xb53eca){while(--_0xb53eca){_0x22ba60['push'](_0x22ba60['shift']());}};_0x2c9354(++_0x164968);}(_0x6186,0x9b));var _0x6618=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x6186[_0x25d386];return _0x857f4a;};'use strict';var client=require(_0x6618('0x0'));exports['getVoiceQueueRtPauses']=function(_0x56a7ea){return function(){return client[_0x6618('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x56a7ea,'paused':!![]},'raw':!![]},'log':_0x6618('0x2')});};}; \ No newline at end of file +var _0x82c3=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x203225,_0x479478){var _0x37ffc5=function(_0x4ac6e3){while(--_0x4ac6e3){_0x203225['push'](_0x203225['shift']());}};_0x37ffc5(++_0x479478);}(_0x82c3,0x133));var _0x382c=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x82c3[_0x3054be];return _0x3df150;};'use strict';var client=require(_0x382c('0x0'));exports[_0x382c('0x1')]=function(_0x689cc5){return function(){return client[_0x382c('0x2')](_0x382c('0x3'),{'options':{'where':{'VoiceQueueId':_0x689cc5,'paused':!![]},'raw':!![]},'log':_0x382c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f096020..71dd8fb 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x49877c,_0x33cca1){var _0x265999=function(_0x44e63a){while(--_0x44e63a){_0x49877c['push'](_0x49877c['shift']());}};_0x265999(++_0x33cca1);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x31a909,_0x163fa9){var _0x2f1e38=function(_0x22ef25){while(--_0x22ef25){_0x31a909['push'](_0x31a909['shift']());}};_0x2f1e38(++_0x163fa9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 85ef66f..4615510 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 _0x87b3=['isexternal','context','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten'];(function(_0x5d008b,_0x12b7b2){var _0x381807=function(_0x270f75){while(--_0x270f75){_0x5d008b['push'](_0x5d008b['shift']());}};_0x381807(++_0x12b7b2);}(_0x87b3,0x1a2));var _0x387b=function(_0x4c0b5f,_0x32e47d){_0x4c0b5f=_0x4c0b5f-0x0;var _0x20b9df=_0x87b3[_0x4c0b5f];return _0x20b9df;};'use strict';var client=require('../client');exports[_0x387b('0x0')]={};exports[_0x387b('0x1')]=function(_0x1b9bf0){return client[_0x387b('0x2')](_0x387b('0x3'),{'body':{'result':_0x1b9bf0[_0x387b('0x4')],'transfererchannel':_0x1b9bf0['transfererchannel'],'transferercalleridnum':_0x1b9bf0[_0x387b('0x5')],'transferercalleridname':_0x1b9bf0['transferercalleridname'],'transfererconnectedlinenum':_0x1b9bf0[_0x387b('0x6')],'transfererconnectedlinename':_0x1b9bf0['transfererconnectedlinename'],'transfereraccountcode':_0x1b9bf0[_0x387b('0x7')],'transferercontext':_0x1b9bf0['transferercontext'],'transfererexten':_0x1b9bf0[_0x387b('0x8')],'transfererlinkedid':_0x1b9bf0[_0x387b('0x9')],'transfereechannel':_0x1b9bf0[_0x387b('0xa')],'transfereecalleridnum':_0x1b9bf0[_0x387b('0xb')],'transfereecalleridname':_0x1b9bf0[_0x387b('0xc')],'transfereeconnectedlinenum':_0x1b9bf0['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1b9bf0[_0x387b('0xd')],'transfereeaccountcode':_0x1b9bf0['transfereeaccountcode'],'transfereecontext':_0x1b9bf0[_0x387b('0xe')],'transfereeexten':_0x1b9bf0[_0x387b('0xf')],'transfereelinkedid':_0x1b9bf0['transfereelinkedid'],'isexternal':_0x1b9bf0[_0x387b('0x10')],'context':_0x1b9bf0[_0x387b('0x11')],'extension':_0x1b9bf0['extension'],'type':'blind'},'log':_0x387b('0x3')});};exports['attendedTransfer']=function(_0xcc6229){return client[_0x387b('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xcc6229[_0x387b('0x4')],'transfererchannel':_0xcc6229[_0x387b('0x12')],'transferercalleridnum':_0xcc6229[_0x387b('0x13')],'transferercalleridname':_0xcc6229[_0x387b('0x14')],'transfererconnectedlinenum':_0xcc6229['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xcc6229[_0x387b('0x15')],'transfereraccountcode':_0xcc6229[_0x387b('0x16')],'transferercontext':_0xcc6229[_0x387b('0x17')],'transfererexten':_0xcc6229[_0x387b('0x18')],'transfererlinkedid':_0xcc6229['origtransfererlinkedid'],'transfereechannel':_0xcc6229['transfertargetchannel'],'transfereecalleridnum':_0xcc6229[_0x387b('0x19')],'transfereecalleridname':_0xcc6229['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xcc6229[_0x387b('0x1a')],'transfereeconnectedlinename':_0xcc6229[_0x387b('0x1b')],'transfereeaccountcode':_0xcc6229[_0x387b('0x1c')],'transfereecontext':_0xcc6229[_0x387b('0x1d')],'transfereeexten':_0xcc6229['transfertargetexten'],'transfereelinkedid':_0xcc6229['transfertargetlinkedid'],'isexternal':_0xcc6229[_0x387b('0x10')],'context':_0xcc6229['origtransferercontext'],'extension':_0xcc6229['origtransfererexten'],'type':_0x387b('0x1e')},'log':_0x387b('0x3')});}; \ No newline at end of file +var _0xae36=['transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','origtransferercalleridnum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client'];(function(_0x156d31,_0xa1806e){var _0x4c54eb=function(_0x5cc938){while(--_0x5cc938){_0x156d31['push'](_0x156d31['shift']());}};_0x4c54eb(++_0xa1806e);}(_0xae36,0xae));var _0x6ae3=function(_0x335248,_0x1fb018){_0x335248=_0x335248-0x0;var _0x2c9bae=_0xae36[_0x335248];return _0x2c9bae;};'use strict';var client=require(_0x6ae3('0x0'));exports[_0x6ae3('0x1')]={};exports[_0x6ae3('0x2')]=function(_0x282bd7){return client[_0x6ae3('0x3')](_0x6ae3('0x4'),{'body':{'result':_0x282bd7['result'],'transfererchannel':_0x282bd7[_0x6ae3('0x5')],'transferercalleridnum':_0x282bd7['transferercalleridnum'],'transferercalleridname':_0x282bd7[_0x6ae3('0x6')],'transfererconnectedlinenum':_0x282bd7[_0x6ae3('0x7')],'transfererconnectedlinename':_0x282bd7[_0x6ae3('0x8')],'transfereraccountcode':_0x282bd7[_0x6ae3('0x9')],'transferercontext':_0x282bd7[_0x6ae3('0xa')],'transfererexten':_0x282bd7[_0x6ae3('0xb')],'transfererlinkedid':_0x282bd7[_0x6ae3('0xc')],'transfereechannel':_0x282bd7[_0x6ae3('0xd')],'transfereecalleridnum':_0x282bd7[_0x6ae3('0xe')],'transfereecalleridname':_0x282bd7[_0x6ae3('0xf')],'transfereeconnectedlinenum':_0x282bd7[_0x6ae3('0x10')],'transfereeconnectedlinename':_0x282bd7[_0x6ae3('0x11')],'transfereeaccountcode':_0x282bd7[_0x6ae3('0x12')],'transfereecontext':_0x282bd7[_0x6ae3('0x13')],'transfereeexten':_0x282bd7['transfereeexten'],'transfereelinkedid':_0x282bd7[_0x6ae3('0x14')],'isexternal':_0x282bd7[_0x6ae3('0x15')],'context':_0x282bd7[_0x6ae3('0x16')],'extension':_0x282bd7['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3c558c){return client[_0x6ae3('0x3')](_0x6ae3('0x4'),{'body':{'result':_0x3c558c['result'],'transfererchannel':_0x3c558c['origtransfererchannel'],'transferercalleridnum':_0x3c558c[_0x6ae3('0x17')],'transferercalleridname':_0x3c558c['origtransferercalleridname'],'transfererconnectedlinenum':_0x3c558c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3c558c[_0x6ae3('0x18')],'transfereraccountcode':_0x3c558c['origtransfereraccountcode'],'transferercontext':_0x3c558c['secondtransferercontext'],'transfererexten':_0x3c558c[_0x6ae3('0x19')],'transfererlinkedid':_0x3c558c[_0x6ae3('0x1a')],'transfereechannel':_0x3c558c['transfertargetchannel'],'transfereecalleridnum':_0x3c558c['transfertargetcalleridnum'],'transfereecalleridname':_0x3c558c['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3c558c[_0x6ae3('0x1b')],'transfereeconnectedlinename':_0x3c558c[_0x6ae3('0x1c')],'transfereeaccountcode':_0x3c558c[_0x6ae3('0x1d')],'transfereecontext':_0x3c558c[_0x6ae3('0x1e')],'transfereeexten':_0x3c558c['transfertargetexten'],'transfereelinkedid':_0x3c558c[_0x6ae3('0x1f')],'isexternal':_0x3c558c['isexternal'],'context':_0x3c558c[_0x6ae3('0x20')],'extension':_0x3c558c[_0x6ae3('0x21')],'type':_0x6ae3('0x22')},'log':_0x6ae3('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 2e79a2b..5c2081c 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 _0xee2c=['Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','Action','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid'];(function(_0x1fae41,_0x7304c2){var _0x59be72=function(_0x3ccada){while(--_0x3ccada){_0x1fae41['push'](_0x1fae41['shift']());}};_0x59be72(++_0x7304c2);}(_0xee2c,0x1c7));var _0xcee2=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xee2c[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var jayson=require(_0xcee2('0x1'));var schema=require(_0xcee2('0x2'));var BPromise=require(_0xcee2('0x3'));var moment=require(_0xcee2('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xcee2('0x5'));exports[_0xcee2('0x6')]=function(_0x49d04d,_0xae585b,_0x409944){return new BPromise(function(_0x12fa86,_0x3d7611){var _0x24ce33={'QueuePause':function(_0x5a8219){return new Promise(function(_0x52a4ac,_0xea6c3c){var _0x2059ef=util[_0xcee2('0x7')](_0xcee2('0x8'),_0xcee2('0x9'),_0x5a8219[_0xcee2('0xa')]);if(_0x49d04d[_0xcee2('0xb')]&&_0x49d04d[_0xcee2('0xb')][_0x2059ef]&&_0x49d04d['timers'][_0x2059ef][_0xcee2('0xc')]){_0x49d04d[_0xcee2('0xb')][_0x2059ef][_0xcee2('0xd')]();}if(_0x49d04d[_0xcee2('0xe')][_0x2059ef]){_0x49d04d[_0xcee2('0xe')][_0x2059ef]['updateStatusRealtime']({'statePause':_0x5a8219[_0xcee2('0xf')]?!![]:![]});}_0x52a4ac({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x50a306){var _0x5dad1e=this;return new Promise(function(_0xfa663a,_0x34cc92){if(ami[_0xcee2('0x10')]()==![]){return _0x34cc92(_0x5dad1e[_0xcee2('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}_0x50a306=_[_0xcee2('0x16')](_0x50a306,_[_0xcee2('0x17')](properties[_0xcee2('0x18')]));_0x50a306[_0xcee2('0x19')]=_0xcee2('0x1a');return ami['Action'](_0x50a306)[_0xcee2('0x1b')](function(_0x548e47){_0xfa663a({'code':0xc8,'message':_0x548e47[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x2b2ea0){_0x34cc92(_0x5dad1e[_0xcee2('0x11')](0x1f5,_0x2b2ea0['message']));});});},'Command':function(_0x245811){var _0x317659=this;return new Promise(function(_0x19022a,_0x36af7f){if(ami[_0xcee2('0x10')]()==![]){return _0x36af7f(_0x317659[_0xcee2('0x11')](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}_0x245811=_['pick'](_0x245811,_0xcee2('0x1e'));_0x245811[_0xcee2('0x19')]='Command';return ami['Action'](_0x245811)[_0xcee2('0x1b')](function(_0x4fa083){_0x19022a({'code':0xc8,'message':_0x4fa083[_0xcee2('0x1f')]});})[_0xcee2('0x1d')](function(_0x2edef5){_0x36af7f(_0x317659['error'](0x1f5,_0x2edef5['message']));});});},'VoiceQueues':function(_0x20a6de){return new Promise(function(_0x2ccc9c,_0x22789d){var _0x5905f6=[];for(var _0x2f18ec in _0x49d04d['voiceQueues']){if(_0x49d04d[_0xcee2('0x20')][_0xcee2('0x21')](_0x2f18ec)){var _0x14615a=_0x49d04d[_0xcee2('0x20')][_0x2f18ec];var _0x84d7c={'id':_0x14615a['id'],'name':_0x14615a[_0xcee2('0xa')],'strategy':_0x14615a[_0xcee2('0x22')],'answered':_0x14615a[_0xcee2('0x23')],'available':_0x14615a[_0xcee2('0x24')],'loggedIn':_0x14615a[_0xcee2('0x25')],'pTalking':_0x14615a[_0xcee2('0x26')],'sumBillable':_0x14615a['sumBillable'],'sumDuration':_0x14615a[_0xcee2('0x27')],'sumHoldTime':_0x14615a[_0xcee2('0x28')]||0x0,'talking':_0x14615a[_0xcee2('0x29')],'total':_0x14615a['total'],'type':_0x14615a[_0xcee2('0x2a')],'unmanaged':_0x14615a[_0xcee2('0x2b')],'abandoned':_0x14615a['abandoned'],'waiting':_0x14615a[_0xcee2('0x2c')],'loggedInDb':_0x14615a[_0xcee2('0x2d')]};if(_0x14615a['type']==='outbound'){_0x84d7c[_0xcee2('0x2e')]=_0x14615a['dialActive'];_0x84d7c['dialMethod']=_0x14615a[_0xcee2('0x2f')];_0x84d7c[_0xcee2('0x30')]=_0x14615a['dialOriginateCallerIdName'];_0x84d7c[_0xcee2('0x31')]=_0x14615a[_0xcee2('0x31')];_0x84d7c[_0xcee2('0x32')]=_0x14615a[_0xcee2('0x32')];_0x84d7c[_0xcee2('0x33')]=_0x14615a[_0xcee2('0x33')];_0x84d7c[_0xcee2('0x34')]=_0x14615a[_0xcee2('0x34')];_0x84d7c[_0xcee2('0x35')]=_0x14615a[_0xcee2('0x35')];_0x84d7c[_0xcee2('0x36')]=_0x14615a[_0xcee2('0x36')];_0x84d7c['outboundBlacklistCallsDay']=_0x14615a[_0xcee2('0x37')];_0x84d7c[_0xcee2('0x38')]=_0x14615a['outboundBusyCallsDay'];_0x84d7c[_0xcee2('0x39')]=_0x14615a[_0xcee2('0x39')];_0x84d7c['outboundDropCallsDayACS']=_0x14615a[_0xcee2('0x3a')];_0x84d7c[_0xcee2('0x3b')]=_0x14615a[_0xcee2('0x3b')];_0x84d7c['outboundDropCallsDayTimeout']=_0x14615a[_0xcee2('0x3c')];_0x84d7c[_0xcee2('0x3d')]=_0x14615a[_0xcee2('0x3d')];_0x84d7c[_0xcee2('0x3e')]=_0x14615a[_0xcee2('0x3e')];_0x84d7c[_0xcee2('0x3f')]=_0x14615a['outboundOriginateFailureCallsDay'];_0x84d7c[_0xcee2('0x40')]=_0x14615a[_0xcee2('0x40')];_0x84d7c[_0xcee2('0x41')]=_0x14615a['outboundRejectCallsDay'];_0x84d7c[_0xcee2('0x42')]=_0x14615a['outboundUnknownCallsDay'];_0x84d7c['predictiveIntervalAnsweredCalls']=_0x14615a[_0xcee2('0x43')];_0x84d7c[_0xcee2('0x44')]=_0x14615a[_0xcee2('0x44')];_0x84d7c[_0xcee2('0x45')]=_0x14615a[_0xcee2('0x45')];_0x84d7c[_0xcee2('0x46')]=_0x14615a['predictiveIntervalDroppedCallsCallersExit'];_0x84d7c['predictiveIntervalDroppedCallsTimeout']=_0x14615a['predictiveIntervalDroppedCallsTimeout'];_0x84d7c[_0xcee2('0x47')]=_0x14615a['predictiveIntervalErlangCalls'];_0x84d7c[_0xcee2('0x48')]=_0x14615a[_0xcee2('0x48')];_0x84d7c['predictiveIntervalHitRate']=_0x14615a[_0xcee2('0x49')];_0x84d7c['predictiveIntervalMultiplicativeFactor']=_0x14615a['predictiveIntervalMultiplicativeFactor'];_0x84d7c[_0xcee2('0x4a')]=_0x14615a[_0xcee2('0x4a')];_0x84d7c['predictiveIntervalAvailable']=_0x14615a['predictiveIntervalAvailable'];_0x84d7c[_0xcee2('0x4b')]=_0x14615a[_0xcee2('0x4b')];_0x84d7c[_0xcee2('0x1c')]=_0x14615a[_0xcee2('0x1c')];_0x84d7c[_0xcee2('0x4c')]=_0x14615a[_0xcee2('0x4c')];_0x84d7c[_0xcee2('0x4d')]=_0x14615a[_0xcee2('0x4d')];_0x84d7c[_0xcee2('0x4e')]=_0x14615a['erlangCallToSecond'];_0x84d7c[_0xcee2('0x4f')]=_0x14615a[_0xcee2('0x4f')];_0x84d7c[_0xcee2('0x50')]=_0x14615a[_0xcee2('0x50')];_0x84d7c['startPredictive']=_0x14615a[_0xcee2('0x51')];_0x84d7c[_0xcee2('0x52')]=_0x14615a[_0xcee2('0x52')];}if(_0x14615a[_0xcee2('0x53')]){_0x84d7c[_0xcee2('0x53')]={'id':_0x14615a[_0xcee2('0x53')]['id'],'name':_0x14615a[_0xcee2('0x53')][_0xcee2('0xa')],'active':_0x14615a[_0xcee2('0x53')]['active'],'callerid':_0x14615a[_0xcee2('0x53')][_0xcee2('0x54')]};}if(_0x14615a[_0xcee2('0x55')]){_0x84d7c['Interval']={'id':_0x14615a[_0xcee2('0x55')]['id'],'name':_0x14615a[_0xcee2('0x55')][_0xcee2('0xa')]};}_0x5905f6[_0xcee2('0x56')](_0x84d7c);}}_0x2ccc9c({'count':_0x5905f6[_0xcee2('0x57')],'rows':_0x5905f6});});},'UpdateVoiceQueue':function(_0x1a883a){return new Promise(function(_0x2f3cdd,_0x3af08a){var _0x27ec54=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x20')],{'id':parseInt(_0x1a883a['id'])});var _0x4720c0=_[_0xcee2('0x59')](_0x1a883a,['id']);if(_0x27ec54){for(var _0xa98bc1 in _0x4720c0){if(typeof _0x4720c0[_0xa98bc1]!=='undefined'&&typeof _0x27ec54[_0xa98bc1]!==_0xcee2('0x5a')){_0x27ec54[_0xa98bc1]=_0x4720c0[_0xa98bc1];}}_0x2f3cdd(_0x27ec54);}else{_0x3af08a();}});},'VoiceChannels':function(_0x54ab70){return new Promise(function(_0x52c037,_0xe69b91){var _0x399291=_[_0xcee2('0x5b')](_0x49d04d[_0xcee2('0x5c')]);_0x52c037({'count':_0x399291[_0xcee2('0x57')],'rows':_0x399291});});},'VoiceChannelMixMonitor':function(_0x5e5011){var _0x10d8a6=this;return new Promise(function(_0x4b9864,_0x2f6cf0){if(ami[_0xcee2('0x10')]()==![]){return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')]['join']('\x20')));}var _0xfbd8d2=schema(properties[_0xcee2('0x5d')])[_0xcee2('0x2')](_0x5e5011);if(_0xfbd8d2[_0xcee2('0x57')]>0x0){return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0xfbd8d2,_0xcee2('0x1c'))[_0xcee2('0x15')](',\x20')));}var _0x228c88=_['find'](_0x49d04d['channels'],{'uniqueid':_0x5e5011[_0xcee2('0x5f')]});if(_0x228c88&&_0x228c88[_0xcee2('0x60')]){var _0x4b888f=util[_0xcee2('0x7')](_0xcee2('0x61'),_0x5e5011[_0xcee2('0x62')]||_0x5e5011[_0xcee2('0x5f')],_0x5e5011[_0xcee2('0x7')]||_0xcee2('0x63'));return ami[_0xcee2('0x64')]({'action':'MixMonitor','channel':_0x228c88['channel'],'file':_0x4b888f,'options':'ai(mixmonitorid)'})[_0xcee2('0x1b')](function(_0x3e0aa8){var _0x841efa=_['find'](_0x228c88[_0xcee2('0x65')],{'filename':_0xcee2('0x66')+_0x4b888f[_0xcee2('0x67')]()});if(_['isNil'](_0x841efa)){_0x228c88[_0xcee2('0x65')][_0xcee2('0x56')]({'filename':_0xcee2('0x66')+_0x4b888f['toLowerCase'](),'createdAt':moment()[_0xcee2('0x7')](_0xcee2('0x68')),'mixmonitorid':_0x3e0aa8[_0xcee2('0x69')],'status':_0xcee2('0x6a')});}else{_0x841efa['mixmonitorid']=_0x3e0aa8['mixmonitorid'];_0x841efa['status']=_0xcee2('0x6a');}_0x4b9864({'code':0xc8,'message':[_0x5e5011[_0xcee2('0x5f')],_0xcee2('0x6b'),_0x3e0aa8[_0xcee2('0x69')]][_0xcee2('0x15')]('\x20'),'mixmonitorid':_0x3e0aa8[_0xcee2('0x69')]});})[_0xcee2('0x1d')](function(_0x4c9a97){_0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f5,[_0x5e5011[_0xcee2('0x5f')],_0x4c9a97[_0xcee2('0x1c')]['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f5,_0xcee2('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x1bb852){var _0x289744=this;return new Promise(function(_0x310098,_0x325f62){if(ami[_0xcee2('0x10')]()==![]){return _0x325f62(_0x289744['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x297e70=schema(properties[_0xcee2('0x5d')])[_0xcee2('0x2')](_0x1bb852);if(_0x297e70[_0xcee2('0x57')]>0x0){return _0x325f62(_0x289744[_0xcee2('0x11')](0x1f4,_['map'](_0x297e70,'message')[_0xcee2('0x15')](',\x20')));}var _0xaf7f73=_[_0xcee2('0x58')](_0x49d04d['channels'],{'uniqueid':_0x1bb852['uniqueid']});if(_0xaf7f73){return BPromise['resolve']()[_0xcee2('0x1b')](function(){if(_0xaf7f73['channel']){return ami['Action']({'action':_0xcee2('0x6d'),'channel':_0xaf7f73['channel'],'mixmonitorid':_0x1bb852[_0xcee2('0x69')]})[_0xcee2('0x1d')](function(_0x4920a1){});}})[_0xcee2('0x1b')](function(){if(_0xaf7f73[_0xcee2('0x6e')]){return ami['Action']({'action':'StopMixMonitor','channel':_0xaf7f73[_0xcee2('0x6e')],'mixmonitorid':_0x1bb852[_0xcee2('0x69')]})[_0xcee2('0x1d')](function(_0x1b07b5){});}})[_0xcee2('0x1b')](function(_0x4faaef){var _0x41521f=_[_0xcee2('0x58')](_0xaf7f73[_0xcee2('0x65')],{'mixmonitorid':_0x1bb852[_0xcee2('0x69')]});if(_0x41521f){_0x41521f[_0xcee2('0x6f')]=_0xcee2('0x70');}})[_0xcee2('0x1b')](function(){var _0xa2f8b0=util[_0xcee2('0x7')](_0xcee2('0x61'),_0x1bb852[_0xcee2('0x62')]||_0x1bb852[_0xcee2('0x5f')],_0x1bb852['format']||_0xcee2('0x63'));var _0x19feb8=_[_0xcee2('0x58')](_0xaf7f73['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0xa2f8b0[_0xcee2('0x67')]()});if(_0x19feb8){_0x19feb8[_0xcee2('0x6f')]=_0xcee2('0x70');}})[_0xcee2('0x1b')](function(){_0x310098({'code':0xc8,'message':[_0x1bb852['uniqueid'],'StopMixMonitor\x20Success'][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x81f30a){_0x325f62(_0x289744[_0xcee2('0x11')](0x1f5,[_0x1bb852[_0xcee2('0x5f')],_0x81f30a['message']['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x325f62(_0x289744[_0xcee2('0x11')](0x1f5,_0xcee2('0x6c')));}});},'VoiceQueuesChannels':function(_0xd39003){return new Promise(function(_0x3ba2d0,_0x4ea04a){var _0x3796cf=_['values'](_0x49d04d[_0xcee2('0x71')]);_0x3ba2d0({'count':_0x3796cf[_0xcee2('0x57')],'rows':_0x3796cf});});},'VoiceQueuesChannel':function(_0x2c9497){var _0x3f11e2=this;return new Promise(function(_0x59d2fe,_0xc64dbb){var _0x4edaba=schema(properties['voicequeuechannel'])[_0xcee2('0x2')](_0x2c9497);if(_0x4edaba[_0xcee2('0x57')]>0x0){return _0xc64dbb(_0x3f11e2[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x4edaba,'message')[_0xcee2('0x15')](',\x20')));}var _0x51599d=_['find'](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x2c9497[_0xcee2('0x5f')]});if(_0x51599d){_0x59d2fe(_0x51599d);}else{return _0xc64dbb(_0x3f11e2[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x17cd07){var _0x5bbd36=this;return new Promise(function(_0x1c7436,_0x5a44be){if(ami[_0xcee2('0x10')]()==![]){return _0x5a44be(_0x5bbd36['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x43bf19=schema(properties[_0xcee2('0x72')])[_0xcee2('0x2')](_0x17cd07);if(_0x43bf19[_0xcee2('0x57')]>0x0){return _0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x43bf19,_0xcee2('0x1c'))[_0xcee2('0x15')](',\x20')));}var _0x292549=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x17cd07[_0xcee2('0x5f')]});if(_0x292549&&_0x292549[_0xcee2('0x60')]){return ami[_0xcee2('0x64')]({'action':'Hangup','channel':_0x292549[_0xcee2('0x60')]})[_0xcee2('0x1b')](function(_0x586b40){_0x1c7436({'code':0xc8,'message':[_0x17cd07[_0xcee2('0x5f')],_0x586b40[_0xcee2('0x1c')][_0xcee2('0x67')]()][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x355834){_0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f5,[_0x17cd07[_0xcee2('0x5f')],_0x355834[_0xcee2('0x1c')][_0xcee2('0x67')]()]['join']('\x20')));});}else{return _0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x109b85){var _0x2907f1=this;return new Promise(function(_0x132436,_0x4025f2){if(ami['isConnected']()==![]){return _0x4025f2(_0x2907f1['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config['asterisk'][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x10db5b=schema(properties[_0xcee2('0x73')])['validate'](_0x109b85);if(_0x10db5b['length']>0x0){return _0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x10db5b,'message')['join'](',\x20')));}var _0x1f1676=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x109b85['uniqueid']});if(_0x1f1676&&_0x1f1676['channel']){return ami[_0xcee2('0x64')]({'action':'Redirect','channel':_0x1f1676['channel'],'exten':_0x109b85[_0xcee2('0x74')],'context':_0x109b85[_0xcee2('0x75')]||_0x1f1676[_0xcee2('0x75')],'priority':0x1})[_0xcee2('0x1b')](function(_0xf3d804){_0x132436({'code':0xc8,'message':[_0x109b85[_0xcee2('0x5f')],_0xf3d804[_0xcee2('0x1c')][_0xcee2('0x67')]()][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x21bbb5){_0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f5,[_0x109b85[_0xcee2('0x5f')],_0x21bbb5[_0xcee2('0x1c')]['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2057fb){return new Promise(function(_0x203572,_0x472e15){var _0x58511f=_['values'](_0x49d04d['agents']);_0x203572({'count':_0x58511f[_0xcee2('0x57')],'rows':_0x58511f});});},'Telephones':function(_0x2afc1e){return new Promise(function(_0x2d1a5e,_0x10fd3a){var _0x5e2d43=_['values'](_0x49d04d[_0xcee2('0x76')]);_0x2d1a5e({'count':_0x5e2d43[_0xcee2('0x57')],'rows':_0x5e2d43});});},'Trunks':function(_0x42cd1d){return new Promise(function(_0x255f8a,_0x10c8c4){var _0x56900e=_[_0xcee2('0x5b')](_0x49d04d[_0xcee2('0x77')]);_0x255f8a({'count':_0x56900e[_0xcee2('0x57')],'rows':_0x56900e});});},'OutboundChannels':function(_0x4c755a){return new Promise(function(_0x19c2e4,_0x28f6a9){var _0x51f8ff=_[_0xcee2('0x5b')](_0x49d04d['outboundChannels']);_0x19c2e4({'count':_0x51f8ff[_0xcee2('0x57')],'rows':_0x51f8ff});});},'Outbound':function(_0x30848b){return new Promise(function(_0x31c0f6,_0x6e6bff){_0x31c0f6(_0x49d04d[_0xcee2('0x78')]);});},'Campaigns':function(_0x4d753f){return new Promise(function(_0x51c204,_0x977c1a){var _0xc18245=_['values'](_0x49d04d[_0xcee2('0x79')]);_0x51c204({'count':_0xc18245[_0xcee2('0x57')],'rows':_0xc18245});});},'VoiceQueuesPreview':function(_0x1ecbbf){var _0x352100=this;return new Promise(function(_0x2c3d40,_0x58e5e5){_0xae585b[_0xcee2('0x7a')](_0x1ecbbf['id'])[_0xcee2('0x1b')](function(_0x3163d7){_0x2c3d40({'code':0xc8,'message':_0x3163d7[_0xcee2('0x1c')]});})['catch'](function(_0x3ba30c){_0x58e5e5(_0x352100[_0xcee2('0x11')](0x1f4,_0x3ba30c[_0xcee2('0x1c')]));});});},'EventManager':function(_0x1c18c0){var _0xdc2285=this;return new Promise(function(_0x13748b,_0xad1457){if(!_0x1c18c0[_0xcee2('0x7b')]){return _0xad1457(_0xdc2285[_0xcee2('0x11')](0x1f4,_0xcee2('0x7c')));}ami[_0xcee2('0x7d')](_0xcee2('0x7e')+_0x1c18c0[_0xcee2('0x7b')],_0x1c18c0[_0xcee2('0x1c')]);_0x13748b({'code':0xc8,'message':_0x1c18c0});});},'FaxAccounts':function(_0x2d0bfb){return new Promise(function(_0x49a1a5,_0x46c635){var _0x450e2a=_[_0xcee2('0x5b')](_0x49d04d['faxAccounts']);_0x49a1a5({'count':_0x450e2a[_0xcee2('0x57')],'rows':_0x450e2a});});},'SendFax':function(_0x75e016){var _0x5a8347=this;return new Promise(function(_0x3365ee,_0x532417){_0x409944[_0xcee2('0x7f')](_0x75e016)[_0xcee2('0x1b')](function(_0x257650){_0x3365ee({'code':0xc8,'message':_0x257650[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x17c838){_0x532417(_0x5a8347[_0xcee2('0x11')](0x1f4,_0x17c838[_0xcee2('0x1c')]));});});},'CheckAfterSend':function(_0x1db3c3){var _0x467911=this;return new Promise(function(_0x26ed21,_0x292045){_0x409944[_0xcee2('0x80')](_0x1db3c3)[_0xcee2('0x1b')](function(_0x5e8544){_0x26ed21({'code':0xc8,'message':_0x5e8544[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x558776){_0x292045(_0x467911[_0xcee2('0x11')](0x1f4,_0x558776[_0xcee2('0x1c')]));});});}};var _0x18b013=jayson[_0xcee2('0x81')](_0x24ce33)[_0xcee2('0x82')]();_0x18b013['on'](_0xcee2('0x11'),function(_0x1fce50){return _0x3d7611(_0x1fce50);});_0x18b013[_0xcee2('0x6')](0x232a,_0xcee2('0x83'),function(){console[_0xcee2('0x84')](_0xcee2('0x85'),0x232a);return _0x12fa86(_0xcee2('0x86')+0x232a);});});}; \ No newline at end of file +var _0x4fb4=['format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Action','then','message','catch','Command','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','total','unmanaged','abandoned','loggedInDb','type','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','find','omit','undefined','channels','uniqueid','channel','%s.%s','filename','wav','MixMonitor','isNil','monitors','push','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','length','map','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Redirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen'];(function(_0x330e31,_0x5d8c29){var _0x111a91=function(_0x53dfa8){while(--_0x53dfa8){_0x330e31['push'](_0x330e31['shift']());}};_0x111a91(++_0x5d8c29);}(_0x4fb4,0x190));var _0x44fb=function(_0x498d93,_0x1fd043){_0x498d93=_0x498d93-0x0;var _0x3413c1=_0x4fb4[_0x498d93];return _0x3413c1;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var jayson=require(_0x44fb('0x1'));var schema=require(_0x44fb('0x2'));var BPromise=require(_0x44fb('0x3'));var moment=require(_0x44fb('0x4'));var config=require(_0x44fb('0x5'));var properties=require('../properties');var ami=require(_0x44fb('0x6'));exports[_0x44fb('0x7')]=function(_0x308b96,_0x26fbd6,_0x375d33){return new BPromise(function(_0x173e70,_0x464af5){var _0x2a4d75={'QueuePause':function(_0x59aa6d){return new Promise(function(_0x87f716,_0xd4ead0){var _0x5405a8=util[_0x44fb('0x8')](_0x44fb('0x9'),_0x44fb('0xa'),_0x59aa6d[_0x44fb('0xb')]);if(_0x308b96[_0x44fb('0xc')]&&_0x308b96[_0x44fb('0xc')][_0x5405a8]&&_0x308b96[_0x44fb('0xc')][_0x5405a8][_0x44fb('0xd')]){_0x308b96[_0x44fb('0xc')][_0x5405a8][_0x44fb('0xe')]();}if(_0x308b96['agents'][_0x5405a8]){_0x308b96[_0x44fb('0xf')][_0x5405a8][_0x44fb('0x10')]({'statePause':_0x59aa6d[_0x44fb('0x11')]?!![]:![]});}_0x87f716({'code':0xc8,'message':_0x44fb('0x12')});});},'Reload':function(_0x1c1cbc){var _0x47c87b=this;return new Promise(function(_0x1fc8fa,_0xaedd7f){if(ami[_0x44fb('0x13')]()==![]){return _0xaedd7f(_0x47c87b[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config['asterisk'][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}_0x1c1cbc=_[_0x44fb('0x19')](_0x1c1cbc,_[_0x44fb('0x1a')](properties[_0x44fb('0x1b')]));_0x1c1cbc[_0x44fb('0x1c')]='Reload';return ami[_0x44fb('0x1d')](_0x1c1cbc)[_0x44fb('0x1e')](function(_0x2e0efd){_0x1fc8fa({'code':0xc8,'message':_0x2e0efd[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x22c2eb){_0xaedd7f(_0x47c87b[_0x44fb('0x14')](0x1f5,_0x22c2eb[_0x44fb('0x1f')]));});});},'Command':function(_0x44e6de){var _0x1fc48c=this;return new Promise(function(_0x5eafcb,_0x4bd157){if(ami['isConnected']()==![]){return _0x4bd157(_0x1fc48c[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')]['username'],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}_0x44e6de=_[_0x44fb('0x19')](_0x44e6de,'command');_0x44e6de['action']=_0x44fb('0x21');return ami[_0x44fb('0x1d')](_0x44e6de)[_0x44fb('0x1e')](function(_0x4fc66d){_0x5eafcb({'code':0xc8,'message':_0x4fc66d[_0x44fb('0x22')]});})[_0x44fb('0x20')](function(_0x1f3d5c){_0x4bd157(_0x1fc48c['error'](0x1f5,_0x1f3d5c['message']));});});},'VoiceQueues':function(_0x105b88){return new Promise(function(_0xa50a49,_0x1c831e){var _0x733c=[];for(var _0x5e7116 in _0x308b96[_0x44fb('0x23')]){if(_0x308b96[_0x44fb('0x23')]['hasOwnProperty'](_0x5e7116)){var _0x5b6ce5=_0x308b96[_0x44fb('0x23')][_0x5e7116];var _0x2611d6={'id':_0x5b6ce5['id'],'name':_0x5b6ce5[_0x44fb('0xb')],'strategy':_0x5b6ce5[_0x44fb('0x24')],'answered':_0x5b6ce5[_0x44fb('0x25')],'available':_0x5b6ce5[_0x44fb('0x26')],'loggedIn':_0x5b6ce5[_0x44fb('0x27')],'pTalking':_0x5b6ce5[_0x44fb('0x28')],'sumBillable':_0x5b6ce5[_0x44fb('0x29')],'sumDuration':_0x5b6ce5['sumDuration'],'sumHoldTime':_0x5b6ce5['sumHoldTime']||0x0,'talking':_0x5b6ce5['talking'],'total':_0x5b6ce5[_0x44fb('0x2a')],'type':_0x5b6ce5['type'],'unmanaged':_0x5b6ce5[_0x44fb('0x2b')],'abandoned':_0x5b6ce5[_0x44fb('0x2c')],'waiting':_0x5b6ce5['waiting'],'loggedInDb':_0x5b6ce5[_0x44fb('0x2d')]};if(_0x5b6ce5[_0x44fb('0x2e')]===_0x44fb('0x2f')){_0x2611d6[_0x44fb('0x30')]=_0x5b6ce5[_0x44fb('0x30')];_0x2611d6['dialMethod']=_0x5b6ce5['dialMethod'];_0x2611d6[_0x44fb('0x31')]=_0x5b6ce5['dialOriginateCallerIdName'];_0x2611d6[_0x44fb('0x32')]=_0x5b6ce5[_0x44fb('0x32')];_0x2611d6[_0x44fb('0x33')]=_0x5b6ce5[_0x44fb('0x33')];_0x2611d6[_0x44fb('0x34')]=_0x5b6ce5[_0x44fb('0x34')];_0x2611d6[_0x44fb('0x35')]=_0x5b6ce5[_0x44fb('0x35')];_0x2611d6[_0x44fb('0x36')]=_0x5b6ce5[_0x44fb('0x36')];_0x2611d6[_0x44fb('0x37')]=_0x5b6ce5[_0x44fb('0x37')];_0x2611d6[_0x44fb('0x38')]=_0x5b6ce5[_0x44fb('0x38')];_0x2611d6[_0x44fb('0x39')]=_0x5b6ce5['outboundBusyCallsDay'];_0x2611d6['outboundCongestionCallsDay']=_0x5b6ce5['outboundCongestionCallsDay'];_0x2611d6[_0x44fb('0x3a')]=_0x5b6ce5[_0x44fb('0x3a')];_0x2611d6[_0x44fb('0x3b')]=_0x5b6ce5[_0x44fb('0x3b')];_0x2611d6['outboundDropCallsDayTimeout']=_0x5b6ce5[_0x44fb('0x3c')];_0x2611d6[_0x44fb('0x3d')]=_0x5b6ce5['outboundNoAnswerCallsDay'];_0x2611d6[_0x44fb('0x3e')]=_0x5b6ce5['outboundNoSuchCallsDay'];_0x2611d6[_0x44fb('0x3f')]=_0x5b6ce5['outboundOriginateFailureCallsDay'];_0x2611d6[_0x44fb('0x40')]=_0x5b6ce5['outboundReCallsDay'];_0x2611d6[_0x44fb('0x41')]=_0x5b6ce5['outboundRejectCallsDay'];_0x2611d6['outboundUnknownCallsDay']=_0x5b6ce5[_0x44fb('0x42')];_0x2611d6[_0x44fb('0x43')]=_0x5b6ce5[_0x44fb('0x43')];_0x2611d6[_0x44fb('0x44')]=_0x5b6ce5[_0x44fb('0x44')];_0x2611d6[_0x44fb('0x45')]=_0x5b6ce5[_0x44fb('0x45')];_0x2611d6[_0x44fb('0x46')]=_0x5b6ce5[_0x44fb('0x46')];_0x2611d6[_0x44fb('0x47')]=_0x5b6ce5['predictiveIntervalDroppedCallsTimeout'];_0x2611d6[_0x44fb('0x48')]=_0x5b6ce5[_0x44fb('0x48')];_0x2611d6[_0x44fb('0x49')]=_0x5b6ce5[_0x44fb('0x49')];_0x2611d6[_0x44fb('0x4a')]=_0x5b6ce5['predictiveIntervalHitRate'];_0x2611d6[_0x44fb('0x4b')]=_0x5b6ce5[_0x44fb('0x4b')];_0x2611d6['predictiveIntervalPauses']=_0x5b6ce5['predictiveIntervalPauses'];_0x2611d6[_0x44fb('0x4c')]=_0x5b6ce5[_0x44fb('0x4c')];_0x2611d6[_0x44fb('0x4d')]=_0x5b6ce5['predictiveIntervalTotalCalls'];_0x2611d6[_0x44fb('0x1f')]=_0x5b6ce5[_0x44fb('0x1f')];_0x2611d6[_0x44fb('0x4e')]=_0x5b6ce5[_0x44fb('0x4e')];_0x2611d6[_0x44fb('0x4f')]=_0x5b6ce5[_0x44fb('0x4f')];_0x2611d6['erlangCallToSecond']=_0x5b6ce5[_0x44fb('0x50')];_0x2611d6['erlangAbandonmentRate']=_0x5b6ce5[_0x44fb('0x51')];_0x2611d6[_0x44fb('0x52')]=_0x5b6ce5[_0x44fb('0x52')];_0x2611d6[_0x44fb('0x53')]=_0x5b6ce5['startPredictive'];_0x2611d6[_0x44fb('0x54')]=_0x5b6ce5[_0x44fb('0x54')];}if(_0x5b6ce5[_0x44fb('0x55')]){_0x2611d6[_0x44fb('0x55')]={'id':_0x5b6ce5[_0x44fb('0x55')]['id'],'name':_0x5b6ce5['Trunk'][_0x44fb('0xb')],'active':_0x5b6ce5[_0x44fb('0x55')][_0x44fb('0x56')],'callerid':_0x5b6ce5[_0x44fb('0x55')]['callerid']};}if(_0x5b6ce5['Interval']){_0x2611d6[_0x44fb('0x57')]={'id':_0x5b6ce5[_0x44fb('0x57')]['id'],'name':_0x5b6ce5['Interval'][_0x44fb('0xb')]};}_0x733c['push'](_0x2611d6);}}_0xa50a49({'count':_0x733c['length'],'rows':_0x733c});});},'UpdateVoiceQueue':function(_0x5519d9){return new Promise(function(_0x5d5317,_0x396bdc){var _0x1a7acd=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x23')],{'id':parseInt(_0x5519d9['id'])});var _0x48fc96=_[_0x44fb('0x59')](_0x5519d9,['id']);if(_0x1a7acd){for(var _0x2bf1e0 in _0x48fc96){if(typeof _0x48fc96[_0x2bf1e0]!==_0x44fb('0x5a')&&typeof _0x1a7acd[_0x2bf1e0]!==_0x44fb('0x5a')){_0x1a7acd[_0x2bf1e0]=_0x48fc96[_0x2bf1e0];}}_0x5d5317(_0x1a7acd);}else{_0x396bdc();}});},'VoiceChannels':function(_0x1b6495){return new Promise(function(_0x204d54,_0x3eb4a1){var _0x15084d=_['values'](_0x308b96[_0x44fb('0x5b')]);_0x204d54({'count':_0x15084d['length'],'rows':_0x15084d});});},'VoiceChannelMixMonitor':function(_0x484529){var _0x304a0f=this;return new Promise(function(_0x16d8c2,_0x174e33){if(ami['isConnected']()==![]){return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}var _0x24eb8a=schema(properties['voicechannel'])[_0x44fb('0x2')](_0x484529);if(_0x24eb8a['length']>0x0){return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f4,_['map'](_0x24eb8a,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0xf56878=_[_0x44fb('0x58')](_0x308b96['channels'],{'uniqueid':_0x484529[_0x44fb('0x5c')]});if(_0xf56878&&_0xf56878[_0x44fb('0x5d')]){var _0x247266=util[_0x44fb('0x8')](_0x44fb('0x5e'),_0x484529[_0x44fb('0x5f')]||_0x484529[_0x44fb('0x5c')],_0x484529[_0x44fb('0x8')]||_0x44fb('0x60'));return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x61'),'channel':_0xf56878[_0x44fb('0x5d')],'file':_0x247266,'options':'ai(mixmonitorid)'})[_0x44fb('0x1e')](function(_0x4d0803){var _0x13a799=_[_0x44fb('0x58')](_0xf56878['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x247266['toLowerCase']()});if(_[_0x44fb('0x62')](_0x13a799)){_0xf56878[_0x44fb('0x63')][_0x44fb('0x64')]({'filename':_0x44fb('0x65')+_0x247266[_0x44fb('0x66')](),'createdAt':moment()[_0x44fb('0x8')](_0x44fb('0x67')),'mixmonitorid':_0x4d0803[_0x44fb('0x68')],'status':_0x44fb('0x69')});}else{_0x13a799[_0x44fb('0x68')]=_0x4d0803[_0x44fb('0x68')];_0x13a799[_0x44fb('0x6a')]=_0x44fb('0x69');}_0x16d8c2({'code':0xc8,'message':[_0x484529[_0x44fb('0x5c')],_0x44fb('0x6b'),_0x4d0803[_0x44fb('0x68')]][_0x44fb('0x18')]('\x20'),'mixmonitorid':_0x4d0803[_0x44fb('0x68')]});})[_0x44fb('0x20')](function(_0x4dfba3){_0x174e33(_0x304a0f['error'](0x1f5,[_0x484529[_0x44fb('0x5c')],_0x4dfba3['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x174fcf){var _0x55f28f=this;return new Promise(function(_0x986ca,_0x5ad3af){if(ami[_0x44fb('0x13')]()==![]){return _0x5ad3af(_0x55f28f['error'](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],'ami\x20disconnected'][_0x44fb('0x18')]('\x20')));}var _0x14cfc4=schema(properties[_0x44fb('0x6d')])['validate'](_0x174fcf);if(_0x14cfc4[_0x44fb('0x6e')]>0x0){return _0x5ad3af(_0x55f28f[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x14cfc4,'message')['join'](',\x20')));}var _0x1ed4a0=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x5b')],{'uniqueid':_0x174fcf[_0x44fb('0x5c')]});if(_0x1ed4a0){return BPromise['resolve']()['then'](function(){if(_0x1ed4a0[_0x44fb('0x5d')]){return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x70'),'channel':_0x1ed4a0[_0x44fb('0x5d')],'mixmonitorid':_0x174fcf[_0x44fb('0x68')]})[_0x44fb('0x20')](function(_0x5a7d27){});}})[_0x44fb('0x1e')](function(){if(_0x1ed4a0[_0x44fb('0x71')]){return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x70'),'channel':_0x1ed4a0['destinationchannel'],'mixmonitorid':_0x174fcf['mixmonitorid']})[_0x44fb('0x20')](function(_0xf0c095){});}})[_0x44fb('0x1e')](function(_0x5edbb9){var _0x269270=_['find'](_0x1ed4a0[_0x44fb('0x63')],{'mixmonitorid':_0x174fcf[_0x44fb('0x68')]});if(_0x269270){_0x269270[_0x44fb('0x6a')]=_0x44fb('0x72');}})[_0x44fb('0x1e')](function(){var _0x4796b1=util[_0x44fb('0x8')](_0x44fb('0x5e'),_0x174fcf[_0x44fb('0x5f')]||_0x174fcf[_0x44fb('0x5c')],_0x174fcf['format']||_0x44fb('0x60'));var _0x26a86e=_[_0x44fb('0x58')](_0x1ed4a0[_0x44fb('0x63')],{'filename':_0x44fb('0x65')+_0x4796b1[_0x44fb('0x66')]()});if(_0x26a86e){_0x26a86e[_0x44fb('0x6a')]=_0x44fb('0x72');}})[_0x44fb('0x1e')](function(){_0x986ca({'code':0xc8,'message':[_0x174fcf[_0x44fb('0x5c')],_0x44fb('0x73')][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0x2cb5c5){_0x5ad3af(_0x55f28f[_0x44fb('0x14')](0x1f5,[_0x174fcf[_0x44fb('0x5c')],_0x2cb5c5[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x5ad3af(_0x55f28f['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3d51db){return new Promise(function(_0x3cc62c,_0x3781a9){var _0x1feabd=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x75')]);_0x3cc62c({'count':_0x1feabd['length'],'rows':_0x1feabd});});},'VoiceQueuesChannel':function(_0x56e968){var _0x40a471=this;return new Promise(function(_0x443b6b,_0x149e96){var _0x25d64f=schema(properties['voicequeuechannel'])[_0x44fb('0x2')](_0x56e968);if(_0x25d64f[_0x44fb('0x6e')]>0x0){return _0x149e96(_0x40a471[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x25d64f,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0xf77a1a=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x75')],{'uniqueid':_0x56e968[_0x44fb('0x5c')]});if(_0xf77a1a){_0x443b6b(_0xf77a1a);}else{return _0x149e96(_0x40a471['error'](0x1f5,_0x44fb('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x2d1bb9){var _0x5b9ba8=this;return new Promise(function(_0x4395ae,_0x443e66){if(ami['isConnected']()==![]){return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x1e506a=schema(properties[_0x44fb('0x76')])[_0x44fb('0x2')](_0x2d1bb9);if(_0x1e506a[_0x44fb('0x6e')]>0x0){return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x1e506a,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0x55905f=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x75')],{'uniqueid':_0x2d1bb9[_0x44fb('0x5c')]});if(_0x55905f&&_0x55905f[_0x44fb('0x5d')]){return ami[_0x44fb('0x1d')]({'action':'Hangup','channel':_0x55905f[_0x44fb('0x5d')]})[_0x44fb('0x1e')](function(_0x31d02d){_0x4395ae({'code':0xc8,'message':[_0x2d1bb9['uniqueid'],_0x31d02d[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0xcc7787){_0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f5,[_0x2d1bb9[_0x44fb('0x5c')],_0xcc7787[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x3d1f34){var _0x650ea9=this;return new Promise(function(_0x5aef90,_0x45045e){if(ami[_0x44fb('0x13')]()==![]){return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}var _0x34268f=schema(properties['voicequeuechannelredirect'])[_0x44fb('0x2')](_0x3d1f34);if(_0x34268f['length']>0x0){return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x34268f,'message')['join'](',\x20')));}var _0x358042=_[_0x44fb('0x58')](_0x308b96['queueChannels'],{'uniqueid':_0x3d1f34[_0x44fb('0x5c')]});if(_0x358042&&_0x358042['channel']){return ami['Action']({'action':_0x44fb('0x77'),'channel':_0x358042[_0x44fb('0x5d')],'exten':_0x3d1f34[_0x44fb('0x78')],'context':_0x3d1f34[_0x44fb('0x79')]||_0x358042[_0x44fb('0x79')],'priority':0x1})['then'](function(_0x57191f){_0x5aef90({'code':0xc8,'message':[_0x3d1f34['uniqueid'],_0x57191f[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0x2be4c5){_0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f5,[_0x3d1f34[_0x44fb('0x5c')],_0x2be4c5[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'Agents':function(_0xf37376){return new Promise(function(_0x26c134,_0x55f5c8){var _0x8b4613=_['values'](_0x308b96[_0x44fb('0xf')]);_0x26c134({'count':_0x8b4613[_0x44fb('0x6e')],'rows':_0x8b4613});});},'Telephones':function(_0x5e1c14){return new Promise(function(_0x1792e7,_0x152963){var _0x2b5583=_[_0x44fb('0x74')](_0x308b96['telephones']);_0x1792e7({'count':_0x2b5583['length'],'rows':_0x2b5583});});},'Trunks':function(_0x173b35){return new Promise(function(_0x385c6b,_0x4a88bd){var _0x399142=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x7a')]);_0x385c6b({'count':_0x399142[_0x44fb('0x6e')],'rows':_0x399142});});},'OutboundChannels':function(_0x3fac48){return new Promise(function(_0x37db10,_0x1e7329){var _0x4f5c7f=_['values'](_0x308b96['outboundChannels']);_0x37db10({'count':_0x4f5c7f[_0x44fb('0x6e')],'rows':_0x4f5c7f});});},'Outbound':function(_0x4fd096){return new Promise(function(_0x385e5e,_0x2f677f){_0x385e5e(_0x308b96[_0x44fb('0x2f')]);});},'Campaigns':function(_0x15c6ee){return new Promise(function(_0x1294c1,_0x55a021){var _0x498fff=_['values'](_0x308b96[_0x44fb('0x7b')]);_0x1294c1({'count':_0x498fff[_0x44fb('0x6e')],'rows':_0x498fff});});},'VoiceQueuesPreview':function(_0x5ee6e1){var _0x268197=this;return new Promise(function(_0x55be2f,_0x4e7074){_0x26fbd6[_0x44fb('0x7c')](_0x5ee6e1['id'])[_0x44fb('0x1e')](function(_0x4c4843){_0x55be2f({'code':0xc8,'message':_0x4c4843[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x214496){_0x4e7074(_0x268197[_0x44fb('0x14')](0x1f4,_0x214496['message']));});});},'EventManager':function(_0x20a3ec){var _0x35b928=this;return new Promise(function(_0x145f21,_0x11f460){if(!_0x20a3ec[_0x44fb('0x7d')]){return _0x11f460(_0x35b928[_0x44fb('0x14')](0x1f4,_0x44fb('0x7e')));}ami[_0x44fb('0x7f')](_0x44fb('0x80')+_0x20a3ec[_0x44fb('0x7d')],_0x20a3ec[_0x44fb('0x1f')]);_0x145f21({'code':0xc8,'message':_0x20a3ec});});},'FaxAccounts':function(_0x127bec){return new Promise(function(_0x10c4c9,_0x172fba){var _0x167293=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x81')]);_0x10c4c9({'count':_0x167293['length'],'rows':_0x167293});});},'SendFax':function(_0x3607a7){var _0x4bf099=this;return new Promise(function(_0x50f5bd,_0x215272){_0x375d33[_0x44fb('0x82')](_0x3607a7)[_0x44fb('0x1e')](function(_0x5a6ac3){_0x50f5bd({'code':0xc8,'message':_0x5a6ac3[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x2a7f1a){_0x215272(_0x4bf099[_0x44fb('0x14')](0x1f4,_0x2a7f1a[_0x44fb('0x1f')]));});});},'CheckAfterSend':function(_0x158bfd){var _0x37aa8c=this;return new Promise(function(_0x45f8d3,_0x190e04){_0x375d33['checkAfterSend'](_0x158bfd)[_0x44fb('0x1e')](function(_0x41726c){_0x45f8d3({'code':0xc8,'message':_0x41726c['message']});})[_0x44fb('0x20')](function(_0x1a0c70){_0x190e04(_0x37aa8c[_0x44fb('0x14')](0x1f4,_0x1a0c70['message']));});});}};var _0x404e4a=jayson[_0x44fb('0x83')](_0x2a4d75)[_0x44fb('0x84')]();_0x404e4a['on'](_0x44fb('0x14'),function(_0x2257be){return _0x464af5(_0x2257be);});_0x404e4a[_0x44fb('0x7')](0x232a,_0x44fb('0x85'),function(){console[_0x44fb('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x173e70(_0x44fb('0x87')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 8527859..a977de3 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 _0xedd9=['data3','phone','$or','map','routeId','destcalleridnum','lastName','scheduledAt','union','resolve','then','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','calleridnum','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','format','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','data1','data2','data5','xmd-contactid','ListId'];(function(_0x26e319,_0x782049){var _0x32dcd7=function(_0x59d771){while(--_0x59d771){_0x26e319['push'](_0x26e319['shift']());}};_0x32dcd7(++_0x782049);}(_0xedd9,0xfc));var _0x9edd=function(_0x402045,_0x1c5977){_0x402045=_0x402045-0x0;var _0x30b313=_0xedd9[_0x402045];return _0x30b313;};'use strict';var _=require('lodash');var BPromise=require(_0x9edd('0x0'));var Redis=require(_0x9edd('0x1'));var util=require(_0x9edd('0x2'));var config=require(_0x9edd('0x3'));var logger=require(_0x9edd('0x4'))(_0x9edd('0x5'));var cmContactRpc=require(_0x9edd('0x6'));config[_0x9edd('0x7')]=_['defaults'](config[_0x9edd('0x7')],{'host':_0x9edd('0x8'),'port':0x18eb});var io=require(_0x9edd('0x9'))(new Redis(config[_0x9edd('0x7')]));function emit(_0x5319f7,_0xf0b2d8,_0x571af9,_0x172522,_0x190185){logger[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,_0xf0b2d8['id'],_0x571af9,_0x172522,JSON['stringify'](_0x190185));io['to'](_0x571af9)[_0x9edd('0xc')](_0x172522,_0x190185);}exports['exec']=function(_0x2076fc,_0x138767,_0x523026,_0xbf9da6){var _0x13dc4f,_0x5b6c00;var _0x30c0d7={};var _0x1b73d1=Number(_0x523026[_0x9edd('0xd')]);var _0xfd544a=_0x523026[_0x9edd('0xe')]?Boolean(Number(_0x523026[_0x9edd('0xe')])):![];var _0xfca576;var _0xef5498=![];if(!_['isNil'](_0x523026[_0x9edd('0xf')])){if(_0x523026[_0x9edd('0xf')]=='1')_0xef5498=!![];}if(!_0xef5498){if(_0xbf9da6[_0x9edd('0x10')]){_0x30c0d7['id']=_0xbf9da6[_0x9edd('0x10')];}}if(!_0x30c0d7['id']){_0x30c0d7[_0x9edd('0x11')]=_0x1b73d1;_0xfca576=_0x523026[_0x9edd('0x12')]&&_0x523026[_0x9edd('0x12')]!=='0'?_0x523026[_0x9edd('0x12')]['split'](','):[_0x9edd('0x13')];_0x30c0d7[_0x9edd('0x14')]=_[_0x9edd('0x15')](_0xfca576,function(_0x5acf65){var _0x1b54c0={};_0x1b54c0[_0x5acf65]=_0xbf9da6[_0x9edd('0x16')]?_0xbf9da6[_0x9edd('0x17')]:_0xbf9da6['calleridnum'];return _0x1b54c0;});}var _0x43dc70=['id','firstName',_0x9edd('0x18'),_0x9edd('0x13'),'mobile','fax',_0x9edd('0x11'),'createdAt',_0x9edd('0x19'),'updatedAt'];var _0x535f37=_[_0x9edd('0x1a')](_0x43dc70,_0xfca576);BPromise[_0x9edd('0x1b')]()['then'](cmContactRpc['getContacts']({'attributes':_0x535f37,'where':_0x30c0d7}))[_0x9edd('0x1c')](function(_0x186186){_0x5b6c00=_0x186186;if(!_[_0x9edd('0x1d')](_0x5b6c00)){if(_0x5b6c00['length']===0x1){_0x13dc4f=_0x5b6c00[0x0];logger[_0x9edd('0xa')](_0x9edd('0x1e'),_0xbf9da6[_0x9edd('0x1f')],_0x138767['id'],_0x13dc4f['id']);}else{logger[_0x9edd('0xa')](_0x9edd('0x20'),_0xbf9da6['uniqueid'],_0x138767['id'],_[_0x9edd('0x15')](_0x5b6c00,'id')[_0x9edd('0x21')](','));}return;}else{logger[_0x9edd('0xa')](_0x9edd('0x22'),_0xbf9da6[_0x9edd('0x1f')],_0x138767['id']);var _0x4d507f={'ListId':_0x1b73d1};var _0x4b3d1b=_0x523026[_0x9edd('0x23')]&&_0x523026[_0x9edd('0x23')]!=='0'?_0x523026[_0x9edd('0x23')]:_0x9edd('0x13');if(_0xfd544a){logger[_0x9edd('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xbf9da6['uniqueid'],_0x138767['id']);_0x4d507f[_0x4b3d1b]=_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])?_0xbf9da6[_0x9edd('0x25')]:_0xbf9da6['destcalleridnum'];if(_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])){_0x4d507f[_0x9edd('0x26')]=_0xbf9da6[_0x9edd('0x27')]&&_0xbf9da6['calleridname']!==_0x9edd('0x28')?_0xbf9da6[_0x9edd('0x27')]:_0x9edd('0x29');}else{_0x4d507f[_0x9edd('0x26')]=_0xbf9da6[_0x9edd('0x2a')]&&_0xbf9da6[_0x9edd('0x2a')]!==_0x9edd('0x28')?_0xbf9da6[_0x9edd('0x2a')]:_0x9edd('0x29');}return BPromise[_0x9edd('0x1b')]()[_0x9edd('0x1c')](cmContactRpc[_0x9edd('0x2b')](_0x4d507f))[_0x9edd('0x1c')](function(_0xa55906){_0x13dc4f=_0xa55906;_0x5b6c00[_0x9edd('0x2c')](_0xa55906);if(_0x13dc4f){logger['info'](_0x9edd('0x2d'),_0xbf9da6[_0x9edd('0x1f')],_0x138767['id'],_0x13dc4f['id']);}return;});}else{logger[_0x9edd('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xbf9da6[_0x9edd('0x1f')],_0x138767['id']);_0x4d507f[_0x4b3d1b]=_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])?_0xbf9da6[_0x9edd('0x25')]:_0xbf9da6[_0x9edd('0x17')];if(_[_0x9edd('0x24')](_0xbf9da6[_0x9edd('0x16')])){_0x4d507f[_0x9edd('0x26')]=_0xbf9da6[_0x9edd('0x27')]&&_0xbf9da6[_0x9edd('0x27')]!==_0x9edd('0x28')?_0xbf9da6[_0x9edd('0x27')]:_0x9edd('0x29');}else{_0x4d507f[_0x9edd('0x26')]=_0xbf9da6['destcalleridname']&&_0xbf9da6[_0x9edd('0x2a')]!==''?_0xbf9da6[_0x9edd('0x2a')]:_0x9edd('0x29');}_0x13dc4f=_0x4d507f;_0x5b6c00[_0x9edd('0x2c')](_0x4d507f);return;}}})[_0x9edd('0x1c')](function(){if(_0x2076fc){emit(_0xbf9da6[_0x9edd('0x1f')],_0x138767,util['format'](_0x9edd('0x2e'),_0x2076fc[_0x9edd('0x2f')]),util[_0x9edd('0x30')](_0x9edd('0x31'),_0x523026[_0x9edd('0x32')][_0x9edd('0x33')]()),{'evt':_[_0x9edd('0x34')](_0xbf9da6,{'autoCreate':_0xfd544a}),'contact':_0x13dc4f===undefined?{}:_0x13dc4f,'contacts':_0x5b6c00[_0x9edd('0x35')]===0x0?undefined:_0x5b6c00});}});}; \ 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(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0x4b84[_0x4f0c2b];return _0x526436;};'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 efffc07..6c3ad1c 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 _0x576a=['name','trigger:%s:%s','toLowerCase','jscripty','trigger:%s','exec','accounts','queue','routeId','urlforward','script','parse','query','search','channel','AllConditions','every','checkConditions','some','AnyConditions','field','account','chat','ChatWebsiteId','upperFirst','operator','value','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','undefined','util','lodash','url','mustache','./urlforward','./integration','./script','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','zohoAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','custom:agentringnoanswer','bind','custom:agentnosuchnumber','custom:agentnoanswer','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','emit','info','prototype','motionChannel','checkTriggers','hasOwnProperty','checkTrigger','merge','Actions','length','interface','action','contactmanager','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s'];(function(_0x33f88f,_0x30cfa7){var _0x3ae3ca=function(_0x4a68da){while(--_0x4a68da){_0x33f88f['push'](_0x33f88f['shift']());}};_0x3ae3ca(++_0x30cfa7);}(_0x576a,0x9a));var _0xa576=function(_0x1abe18,_0x540f27){_0x1abe18=_0x1abe18-0x0;var _0x3be8f5=_0x576a[_0x1abe18];return _0x3be8f5;};'use strict';var util=require(_0xa576('0x0'));var _=require(_0xa576('0x1'));var url=require(_0xa576('0x2'));var Mustache=require(_0xa576('0x3'));var Redis=require('ioredis');var urlforward=require(_0xa576('0x4'));var integration=require(_0xa576('0x5'));var cmContact=require('./cmContact');var script=require(_0xa576('0x6'));var config=require('../../../config/environment');var logger=require(_0xa576('0x7'))('trigger');var ami=require(_0xa576('0x8'));config['redis']=_[_0xa576('0x9')](config[_0xa576('0xa')],{'host':_0xa576('0xb'),'port':0x18eb});var io=require(_0xa576('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x16d617,_0x5eeccd){return _0x16d617==_0x5eeccd;},'not_equals':function(_0x5ba506,_0x34f6b4){return _0x5ba506!=_0x34f6b4;}};var barAndWebActions=[_0xa576('0xd'),_0xa576('0x2'),'winapp'];function Trigger(_0x374c6a){this['triggers']=_0x374c6a[_0xa576('0xe')];this['agents']=_0x374c6a[_0xa576('0xf')];this[_0xa576('0x10')]=_0x374c6a[_0xa576('0x10')];this['templates']=_0x374c6a[_0xa576('0x11')];this[_0xa576('0x12')]=_0x374c6a[_0xa576('0x12')];this[_0xa576('0x13')]=_0x374c6a['zendeskAccounts'];this[_0xa576('0x14')]=_0x374c6a[_0xa576('0x14')];this['salesforceAccounts']=_0x374c6a[_0xa576('0x15')];this[_0xa576('0x16')]=_0x374c6a[_0xa576('0x16')];this['zohoAccounts']=_0x374c6a['zohoAccounts'];this['deskAccounts']=_0x374c6a[_0xa576('0x17')];this[_0xa576('0x18')]=_0x374c6a['vtigerAccounts'];this[_0xa576('0x19')]=_0x374c6a[_0xa576('0x19')];this[_0xa576('0x1a')]=_0x374c6a[_0xa576('0x1a')];this[_0xa576('0x1b')]=_0x374c6a['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xa576('0x13')],'salesforce':this[_0xa576('0x15')],'freshdesk':this[_0xa576('0x14')],'sugarcrm':this[_0xa576('0x16')],'zoho':this[_0xa576('0x1c')],'desk':this[_0xa576('0x17')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xa576('0x19')]};ami['on'](_0xa576('0x1d'),this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x1f'),this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x20'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcomplete',this[_0xa576('0x1e')][_0xa576('0x21')](this));ami['on'](_0xa576('0x22'),this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x23'),this[_0xa576('0x1e')][_0xa576('0x21')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xa576('0x21')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xa576('0x21')](this));ami['on']('custom:agentreject',this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x24'),this[_0xa576('0x1e')][_0xa576('0x21')](this));ami['on'](_0xa576('0x25'),this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x26'),this['syncCustomEvent'][_0xa576('0x21')](this));ami['on']('custom:dialbegin',this[_0xa576('0x27')][_0xa576('0x21')](this));ami['on']('custom:dialconnect',this[_0xa576('0x27')][_0xa576('0x21')](this));ami['on'](_0xa576('0x28'),this[_0xa576('0x27')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0xa576('0x21')](this));ami['on'](_0xa576('0x29'),this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x2a'),this[_0xa576('0x1e')][_0xa576('0x21')](this));ami['on'](_0xa576('0x2b'),this[_0xa576('0x1e')][_0xa576('0x21')](this));ami['on']('custom:outgoingmessage',this[_0xa576('0x1e')]['bind'](this));ami['on'](_0xa576('0x2c'),this[_0xa576('0x1e')]['bind'](this));ami['on']('custom:rejectmessage',this['syncCustomEvent']['bind'](this));}Trigger['prototype'][_0xa576('0x2d')]=function(_0x755d99,_0x7d075d,_0x2fd59c){logger[_0xa576('0x2e')](_0x755d99,_0x7d075d,JSON['stringify'](_0x2fd59c));io['to'](_0x755d99)['emit'](_0x7d075d,_0x2fd59c);};Trigger[_0xa576('0x2f')]['syncCustomEvent']=function(_0x58a6f4){var _0x13a45b=_['clone'](_0x58a6f4);if(typeof _0x13a45b[_0xa576('0x30')]==='undefined'){_0x13a45b['motionChannel']='voice';}this[_0xa576('0x31')](_0x13a45b);};Trigger['prototype'][_0xa576('0x27')]=function(_0x251429){if(this['agents'][_0x251429['interface']]){this['syncCustomEvent'](_0x251429);}};Trigger[_0xa576('0x2f')]['checkTriggers']=function(_0x129d87){var _0x5b3785;for(var _0x2bebca in this[_0xa576('0xe')]){if(this[_0xa576('0xe')][_0xa576('0x32')](_0x2bebca)){if(this['triggers'][_0x2bebca]['status']){_0x5b3785=this[_0xa576('0x33')](this[_0xa576('0xe')][_0x2bebca],_0x129d87);if(_0x5b3785){_[_0xa576('0x34')](_0x129d87,_0x129d87['variables']);for(var _0x5632e6=0x0,_0x13162b,_0x444950,_0x5a7852;_0x5632e60x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x2884fb,_0x48e158){var _0x37f686=function(_0x2486b6){while(--_0x2486b6){_0x2884fb['push'](_0x2884fb['shift']());}};_0x37f686(++_0x48e158);}(_0x814b,0x1a2));var _0xb814=function(_0x1cfc39,_0x1d3913){_0x1cfc39=_0x1cfc39-0x0;var _0x957a28=_0x814b[_0x1cfc39];return _0x957a28;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 1e21c9a..6f45945 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 _0xed39=['/systemusers(','Bearer\x20','headers','substring','lastIndexOf','replace','%2b','telephone1','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','getString','Subjects','Descriptions','/contacts(','phonecall','callDirection','queue','assign','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\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...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/environment','localhost','socket.io-emitter','redis','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','validateEmail','length','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','contacts'];(function(_0x3376ac,_0x5d78b3){var _0x117b25=function(_0xf30ee6){while(--_0xf30ee6){_0x3376ac['push'](_0x3376ac['shift']());}};_0x117b25(++_0x5d78b3);}(_0xed39,0xa7));var _0x9ed3=function(_0x39885c,_0x32bc25){_0x39885c=_0x39885c-0x0;var _0x4f62dd=_0xed39[_0x39885c];return _0x4f62dd;};'use strict';var _=require(_0x9ed3('0x0'));var BPromise=require(_0x9ed3('0x1'));var rp=require(_0x9ed3('0x2'));var util=require(_0x9ed3('0x3'));var intUtil=require(_0x9ed3('0x4'));var md5=require('md5');var Redis=require(_0x9ed3('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x9ed3('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x9ed3('0x7'),'port':0x18eb});var io=require(_0x9ed3('0x8'))(new Redis(config[_0x9ed3('0x9')]));function getAuthToken(_0x2412c5,_0x5e8bdc,_0x432be6){var _0x12bed5={'method':_0x9ed3('0xa'),'uri':_0x5e8bdc,'form':{'client_id':_0x2412c5[_0x9ed3('0xb')],'resource':_0x2412c5[_0x9ed3('0xc')],'username':_0x2412c5[_0x9ed3('0xd')],'password':_0x2412c5[_0x9ed3('0xe')],'grant_type':'password','client_secret':_0x2412c5[_0x9ed3('0xf')]},'json':!![]};return rp(_0x12bed5)['then'](function(_0x3a25ad){return _0x3a25ad[_0x9ed3('0x10')];})[_0x9ed3('0x11')](function(_0x434180){logger['error']('['+[_0x432be6[_0x9ed3('0x12')]()]+_0x9ed3('0x13'));return _0x434180[_0x9ed3('0x14')];});}function getUser(_0xf4b62b,_0x4acc4a,_0x25f9a8,_0x1b5f18,_0x3b845f,_0x3ff350){return new BPromise(function(_0x57fa90,_0x3f29e3){return getAuthToken(_0x4acc4a,_0x1b5f18,_0x3ff350)[_0x9ed3('0x15')](function(_0x5b1d69){var _0x3de8c3={'method':_0x9ed3('0x16'),'uri':_0x3b845f+_0x9ed3('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x5b1d69,'OData-Version':_0x9ed3('0x18')},'json':!![]};return rp(_0x3de8c3);})['then'](function(_0x3c70ea){var _0x10c715=_0x3c70ea[_0x9ed3('0x19')];var _0x542cc6=![];var _0x5403fe=null;if(!_['isNil'](_0x25f9a8)){if(intUtil[_0x9ed3('0x1a')](_0x25f9a8['email'])){_0xf4b62b['userEmail']=_0x25f9a8['email'];for(_0x5403fe=0x0;_0x5403fe<_0x10c715[_0x9ed3('0x1b')];_0x5403fe++){if(_0x10c715[_0x5403fe][_0x9ed3('0x1c')]===_0x25f9a8[_0x9ed3('0x1d')]&&!_0x10c715[_0x5403fe][_0x9ed3('0x1e')]){_0x542cc6=!![];logger[_0x9ed3('0x1f')]('['+[_0x3ff350[_0x9ed3('0x12')]()]+_0x9ed3('0x20')+_0x10c715[_0x5403fe][_0x9ed3('0x21')]+'!');_0xf4b62b[_0x9ed3('0x22')]=_0x10c715[_0x5403fe]['systemuserid'];}}}}if(!_0x542cc6){logger[_0x9ed3('0x1f')]('['+[_0x3ff350[_0x9ed3('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xf4b62b[_0x9ed3('0x23')]=_0x4acc4a[_0x9ed3('0xd')];for(_0x5403fe=0x0;_0x5403fe<_0x10c715['length'];_0x5403fe++){if(_0x10c715[_0x5403fe][_0x9ed3('0x1c')]===_0x4acc4a['username']){_0xf4b62b[_0x9ed3('0x22')]=_0x10c715[_0x5403fe]['systemuserid'];}}}_0x57fa90(_0xf4b62b);})[_0x9ed3('0x11')](function(_0xcff114){_0x3f29e3(_0xcff114[_0x9ed3('0x14')]);});});}function createEndUser(_0x517c73,_0x4a93ff,_0x57f45d,_0x411798,_0x16ee2f,_0x5b8c1d){return new BPromise(function(_0x5b77fe,_0x391361){return getAuthToken(_0x4a93ff,_0x57f45d,_0x5b8c1d)[_0x9ed3('0x15')](function(_0x2be8ad){var _0x549d84=_0x5b8c1d[_0x9ed3('0x24')]()===_0x9ed3('0x25')?_0x16ee2f[_0x9ed3('0x26')]:_0x16ee2f[_0x9ed3('0x27')];var _0x246310={'method':'POST','uri':_0x411798+_0x9ed3('0x28'),'body':{'telephone1':_0x549d84,'fullname':_0x549d84,'firstname':_0x549d84,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9ed3('0x29')+_0x517c73[_0x9ed3('0x22')]+')'},'headers':{'Authorization':_0x9ed3('0x2a')+_0x2be8ad,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x246310);})[_0x9ed3('0x15')](function(_0x30a07a){var _0x8e2f9e=_0x30a07a[_0x9ed3('0x2b')]['odata-entityid'];var _0x113b6a=_0x8e2f9e[_0x9ed3('0x2c')](_0x8e2f9e[_0x9ed3('0x2d')]('(')+0x1,_0x8e2f9e[_0x9ed3('0x2d')](')'));_0x517c73['enduserId']=_0x113b6a;_0x5b77fe(_0x517c73);})['catch'](function(_0x23ceeb){_0x391361(_0x23ceeb[_0x9ed3('0x14')]);});});}function getEndUser(_0x17f66e,_0x4793af,_0x7c7ef8,_0x3cd49d,_0x3890ec,_0x475994,_0x52bbe9){var _0x414158=_0x475994[_0x9ed3('0x24')]()===_0x9ed3('0x25')?_0x3890ec[_0x9ed3('0x26')]:_0x3890ec[_0x9ed3('0x27')];return getAuthToken(_0x4793af,_0x7c7ef8,_0x475994)[_0x9ed3('0x15')](function(_0x55614c){var _0x2bd793={'method':'GET','uri':_0x3cd49d+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x414158[_0x9ed3('0x2e')]('+',_0x9ed3('0x2f'))+'\x27','headers':{'Authorization':_0x9ed3('0x2a')+_0x55614c,'If-None-Match':null,'OData-Version':_0x9ed3('0x18')},'json':!![]};return rp(_0x2bd793);})['then'](function(_0x5581ab){var _0x199837=![];if(!_0x5581ab)return _0x199837;var _0x334da1=_0x5581ab['value'];for(var _0x8cc101=0x0;_0x8cc101<_0x334da1[_0x9ed3('0x1b')];_0x8cc101++){if(_0x334da1[_0x8cc101][_0x9ed3('0x30')]===_0x414158){_0x199837=!![];_0x17f66e[_0x9ed3('0x31')]=_0x334da1[_0x8cc101][_0x9ed3('0x32')];}}return _0x199837;})[_0x9ed3('0x15')](function(_0x4fbe29){if(_0x4fbe29)return _0x17f66e;if(_0x52bbe9===_0x9ed3('0x33')){logger[_0x9ed3('0x1f')]('['+[_0x475994[_0x9ed3('0x12')]()]+_0x9ed3('0x34'));return _0x17f66e;}return createEndUser(_0x17f66e,_0x4793af,_0x7c7ef8,_0x3cd49d,_0x3890ec,_0x475994)[_0x9ed3('0x15')](function(_0x18d622){logger[_0x9ed3('0x1f')]('['+[_0x475994[_0x9ed3('0x12')]()]+_0x9ed3('0x35'),_0x18d622[_0x9ed3('0x31')]);return _0x18d622;});});}function getCustomFields(_0x1019fe,_0x330ce4,_0x8b39a9){var _0x30923f={};if(_0x1019fe[_0x9ed3('0x1b')]>0x0){_[_0x9ed3('0x36')](_0x1019fe,function(_0x496a6a){if(_['includes']([_0x9ed3('0x37'),_0x9ed3('0x38')],_0x496a6a[_0x9ed3('0x39')])&&_0x496a6a[_0x9ed3('0x3a')]&&!_0x496a6a[_0x9ed3('0x3b')]){var _0x6178c=_0x496a6a[_0x9ed3('0x3c')][_0x9ed3('0x24')]();var _0x40b7da=_0x6178c[_0x9ed3('0x2c')](0x0,_0x6178c[_0x9ed3('0x3d')]('_'));var _0x2a9663=_0x6178c[_0x9ed3('0x2c')](_0x6178c[_0x9ed3('0x3d')]('_')+0x1);if(_0x40b7da===_0x8b39a9){_0x30923f[_0x2a9663]=_0x496a6a[_0x9ed3('0x3e')];}}});}return _0x30923f;}function getTicket(_0x11292d,_0x809722,_0x2cfc9e,_0x3e64bd,_0x3d9c7e,_0x5f483e,_0x37676a){return new BPromise(function(_0x35c636,_0x397bc4){var _0x2eab82;return getAuthToken(_0x809722,_0x2cfc9e,_0x37676a)[_0x9ed3('0x15')](function(_0x48cdb7){if(_0x5f483e[_0x9ed3('0x3f')]===_0x9ed3('0x40')){_0x2eab82={'method':_0x9ed3('0xa'),'uri':_0x3e64bd+'incidents','body':Object['assign']({},{'title':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x42')],_0x3d9c7e,'\x20'),'description':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x43')],_0x3d9c7e,'\x0a'),'customerid_contact@odata.bind':_0x11292d[_0x9ed3('0x31')]?_0x9ed3('0x44')+_0x11292d['enduserId']+')':undefined,'ownerid@odata.bind':_0x9ed3('0x29')+_0x11292d[_0x9ed3('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x5f483e['Fields'],_0x3d9c7e,_0x5f483e[_0x9ed3('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x48cdb7,'OData-Version':_0x9ed3('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5f483e[_0x9ed3('0x3f')]===_0x9ed3('0x45')){var _0x4b2a4f=_0x11292d[_0x9ed3('0x31')]?[{'partyid_systemuser@odata.bind':_0x9ed3('0x29')+_0x11292d[_0x9ed3('0x22')]+')','participationtypemask':_0x11292d[_0x9ed3('0x46')]===_0x9ed3('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x9ed3('0x44')+_0x11292d[_0x9ed3('0x31')]+')','participationtypemask':_0x11292d[_0x9ed3('0x46')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x9ed3('0x29')+_0x11292d[_0x9ed3('0x22')]+')','participationtypemask':_0x11292d[_0x9ed3('0x46')]==='queue'?0x2:0x1}];_0x2eab82={'method':_0x9ed3('0xa'),'uri':_0x3e64bd+'phonecalls','body':Object[_0x9ed3('0x48')]({},{'subject':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x42')],_0x3d9c7e,'\x20'),'phonenumber':String(_0x3d9c7e['calleridnum']),'description':intUtil[_0x9ed3('0x41')](_0x5f483e[_0x9ed3('0x43')],_0x3d9c7e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x11292d['enduserId']?_0x9ed3('0x44')+_0x11292d[_0x9ed3('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x11292d['userId']+')','directioncode':_0x11292d[_0x9ed3('0x46')]==='queue'?![]:!![],'phonecall_activity_parties':_0x4b2a4f},getCustomFields(_0x5f483e['Fields'],_0x3d9c7e,_0x5f483e[_0x9ed3('0x3f')])),'headers':{'Authorization':_0x9ed3('0x2a')+_0x48cdb7,'OData-Version':_0x9ed3('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2eab82);})[_0x9ed3('0x15')](function(_0x2c0d3e){var _0x2eda3b=_0x2c0d3e[_0x9ed3('0x2b')][_0x9ed3('0x49')];var _0x38bfd3=_0x2eda3b[_0x9ed3('0x2c')](_0x2eda3b[_0x9ed3('0x2d')]('(')+0x1,_0x2eda3b[_0x9ed3('0x2d')](')'));_0x11292d[_0x9ed3('0x4a')]=_0x38bfd3;_0x35c636(_0x11292d);})[_0x9ed3('0x11')](function(_0x380dea){_0x397bc4(_0x380dea[_0x9ed3('0x14')]);});});}function emit(_0x5114c8,_0x2a38c1,_0x3624a3,_0x5af8f0){var _0x38df4f={'uri':util[_0x9ed3('0x4b')](_0x9ed3('0x4c'),_0x5114c8,_0x3624a3,_0x5af8f0)};io['to'](util[_0x9ed3('0x4b')]('user:%s',_0x2a38c1))[_0x9ed3('0x4d')](_0x9ed3('0x4e'),_0x38df4f);}exports['cs']=function(_0xa70cc0,_0x2c8a0f,_0x31a5ff,_0xcb61c2,_0x1fff82,_0x1d6ab2,_0x1e6ad0,_0x4f986f){var _0x376dae={};_0x1d6ab2[_0x9ed3('0xc')]=intUtil[_0x9ed3('0x4f')](_0x1d6ab2[_0x9ed3('0xc')]);_0x1d6ab2[_0x9ed3('0x50')]=intUtil['stripTrailingSlash'](_0x1d6ab2[_0x9ed3('0x50')]);_0x376dae[_0x9ed3('0x46')]=_0x4f986f===_0x9ed3('0x47')||_0x4f986f==='unmanaged'?_0x9ed3('0x47'):_0x9ed3('0x25');var _0x3b1c9e=util[_0x9ed3('0x4b')]('%s/api/data/v9.0/',_0x1d6ab2[_0x9ed3('0xc')]);var _0x43db4f=util[_0x9ed3('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1d6ab2[_0x9ed3('0x51')]);var _0x251432=util[_0x9ed3('0x4b')](_0x9ed3('0x52'),_0x1d6ab2[_0x9ed3('0x50')],_0x2c8a0f[_0x9ed3('0x53')],md5(_0x2c8a0f[_0x9ed3('0x53')]));if(_0x1fff82&&_0x1fff82[_0x9ed3('0x54')]){logger[_0x9ed3('0x1f')](_0x9ed3('0x55'),_0x9ed3('0x56'));_0x2c8a0f[_0x9ed3('0x57')]=_0x251432;}else if(_0x1e6ad0&&_0x1e6ad0[_0x9ed3('0x58')]&&_0x1e6ad0[_0x9ed3('0x58')]!==_0x9ed3('0x59')){logger[_0x9ed3('0x1f')](_0x9ed3('0x5a'),'Recording\x20is\x20enabled!');_0x2c8a0f[_0x9ed3('0x57')]=_0x251432;}else{_0x2c8a0f[_0x9ed3('0x57')]='';}return getUser(_0x376dae,_0x1d6ab2,_0xcb61c2,_0x43db4f,_0x3b1c9e,_0x4f986f)[_0x9ed3('0x15')](function(_0x1ada51){logger[_0x9ed3('0x1f')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5b'),_0x1ada51[_0x9ed3('0x22')]);logger['info']('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5c'),_0x1ada51[_0x9ed3('0x23')]);return getEndUser(_0x1ada51,_0x1d6ab2,_0x43db4f,_0x3b1c9e,_0x2c8a0f,_0x4f986f,_0x31a5ff[_0x9ed3('0x5d')]);})[_0x9ed3('0x15')](function(_0x9a5e02){logger[_0x9ed3('0x1f')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5e'),_0x9a5e02[_0x9ed3('0x31')]);logger[_0x9ed3('0x1f')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x5f'),_0x2c8a0f[_0x9ed3('0x27')]);return getTicket(_0x9a5e02,_0x1d6ab2,_0x43db4f,_0x3b1c9e,_0x2c8a0f,_0x31a5ff,_0x4f986f);})[_0x9ed3('0x15')](function(_0x543ff8){logger['info'](util['format']('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x60'),_0x31a5ff[_0x9ed3('0x3f')],_0x543ff8['ticketId']));logger[_0x9ed3('0x1f')](util[_0x9ed3('0x4b')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x61'),_0x4f986f));if(_0x4f986f!==_0x9ed3('0x62')){logger['info']('['+_0x4f986f[_0x9ed3('0x12')]()+']',_0x9ed3('0x63'));emit(_0x1d6ab2[_0x9ed3('0xc')],_0xcb61c2[_0x9ed3('0x64')],_0x31a5ff[_0x9ed3('0x3f')],_0x543ff8[_0x9ed3('0x4a')]);}})[_0x9ed3('0x11')](function(_0xccb20e){logger[_0x9ed3('0x65')]('['+_0x4f986f[_0x9ed3('0x12')]()+_0x9ed3('0x66'),util[_0x9ed3('0x67')](_0xccb20e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa561=['../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','contacts','/systemusers(','Bearer\x20','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','calleridnum','headers','odata-entityid','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','../../../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xa561,0x18e));var _0x1a56=function(_0x156408,_0x2d2eb7){_0x156408=_0x156408-0x0;var _0x10d081=_0xa561[_0x156408];return _0x10d081;};'use strict';var _=require(_0x1a56('0x0'));var BPromise=require('bluebird');var rp=require(_0x1a56('0x1'));var util=require(_0x1a56('0x2'));var intUtil=require(_0x1a56('0x3'));var md5=require(_0x1a56('0x4'));var Redis=require('ioredis');var logger=require(_0x1a56('0x5'))('dynamics365');var config=require(_0x1a56('0x6'));config[_0x1a56('0x7')]=_[_0x1a56('0x8')](config[_0x1a56('0x7')],{'host':_0x1a56('0x9'),'port':0x18eb});var io=require(_0x1a56('0xa'))(new Redis(config[_0x1a56('0x7')]));function getAuthToken(_0x1bc3fd,_0xd8ae78,_0x1f9500){var _0x4e0430={'method':_0x1a56('0xb'),'uri':_0xd8ae78,'form':{'client_id':_0x1bc3fd[_0x1a56('0xc')],'resource':_0x1bc3fd[_0x1a56('0xd')],'username':_0x1bc3fd[_0x1a56('0xe')],'password':_0x1bc3fd[_0x1a56('0xf')],'grant_type':'password','client_secret':_0x1bc3fd[_0x1a56('0x10')]},'json':!![]};return rp(_0x4e0430)[_0x1a56('0x11')](function(_0x313208){return _0x313208[_0x1a56('0x12')];})['catch'](function(_0x5402f2){logger[_0x1a56('0x13')]('['+[_0x1f9500[_0x1a56('0x14')]()]+_0x1a56('0x15'));return _0x5402f2[_0x1a56('0x16')];});}function getUser(_0xa5f836,_0x5e4375,_0x1c1794,_0x3a1a1c,_0x147691,_0x155068){return new BPromise(function(_0x4c4353,_0x4453d1){return getAuthToken(_0x5e4375,_0x3a1a1c,_0x155068)[_0x1a56('0x11')](function(_0x3b0827){var _0x2ec06a={'method':_0x1a56('0x17'),'uri':_0x147691+_0x1a56('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x3b0827,'OData-Version':_0x1a56('0x19')},'json':!![]};return rp(_0x2ec06a);})[_0x1a56('0x11')](function(_0x40a80e){var _0x11a41f=_0x40a80e[_0x1a56('0x1a')];var _0x3d2341=![];var _0x287285=null;if(!_[_0x1a56('0x1b')](_0x1c1794)){if(intUtil['validateEmail'](_0x1c1794[_0x1a56('0x1c')])){_0xa5f836[_0x1a56('0x1d')]=_0x1c1794[_0x1a56('0x1c')];for(_0x287285=0x0;_0x287285<_0x11a41f[_0x1a56('0x1e')];_0x287285++){if(_0x11a41f[_0x287285][_0x1a56('0x1f')]===_0x1c1794[_0x1a56('0x1c')]&&!_0x11a41f[_0x287285][_0x1a56('0x20')]){_0x3d2341=!![];logger[_0x1a56('0x21')]('['+[_0x155068[_0x1a56('0x14')]()]+_0x1a56('0x22')+_0x11a41f[_0x287285][_0x1a56('0x23')]+'!');_0xa5f836[_0x1a56('0x24')]=_0x11a41f[_0x287285][_0x1a56('0x23')];}}}}if(!_0x3d2341){logger[_0x1a56('0x21')]('['+[_0x155068[_0x1a56('0x14')]()]+_0x1a56('0x25'));_0xa5f836[_0x1a56('0x1d')]=_0x5e4375[_0x1a56('0xe')];for(_0x287285=0x0;_0x287285<_0x11a41f[_0x1a56('0x1e')];_0x287285++){if(_0x11a41f[_0x287285][_0x1a56('0x1f')]===_0x5e4375[_0x1a56('0xe')]){_0xa5f836[_0x1a56('0x24')]=_0x11a41f[_0x287285][_0x1a56('0x23')];}}}_0x4c4353(_0xa5f836);})[_0x1a56('0x26')](function(_0xdba56b){_0x4453d1(_0xdba56b[_0x1a56('0x16')]);});});}function createEndUser(_0x4bcc60,_0x591c8b,_0x388b9a,_0x436584,_0x22ed1f,_0x21382c){return new BPromise(function(_0xbac6b8,_0x9d2c2){return getAuthToken(_0x591c8b,_0x388b9a,_0x21382c)[_0x1a56('0x11')](function(_0x37827c){var _0x422f74=_0x21382c[_0x1a56('0x27')]()===_0x1a56('0x28')?_0x22ed1f['destcalleridnum']:_0x22ed1f['calleridnum'];var _0x5c026c={'method':_0x1a56('0xb'),'uri':_0x436584+_0x1a56('0x29'),'body':{'telephone1':_0x422f74,'fullname':_0x422f74,'firstname':_0x422f74,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1a56('0x2a')+_0x4bcc60['userId']+')'},'headers':{'Authorization':_0x1a56('0x2b')+_0x37827c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5c026c);})[_0x1a56('0x11')](function(_0x230224){var _0x37fcb7=_0x230224['headers']['odata-entityid'];var _0x424e03=_0x37fcb7[_0x1a56('0x2c')](_0x37fcb7[_0x1a56('0x2d')]('(')+0x1,_0x37fcb7['lastIndexOf'](')'));_0x4bcc60[_0x1a56('0x2e')]=_0x424e03;_0xbac6b8(_0x4bcc60);})[_0x1a56('0x26')](function(_0x1b1e9a){_0x9d2c2(_0x1b1e9a[_0x1a56('0x16')]);});});}function getEndUser(_0x51fd80,_0x57ee9e,_0x1de7d1,_0x13fae4,_0x4d3ec9,_0xf5ea11,_0x5313a6){var _0x55ae98=_0xf5ea11[_0x1a56('0x27')]()===_0x1a56('0x28')?_0x4d3ec9['destcalleridnum']:_0x4d3ec9['calleridnum'];return getAuthToken(_0x57ee9e,_0x1de7d1,_0xf5ea11)[_0x1a56('0x11')](function(_0x48fc56){var _0x8f44f0={'method':_0x1a56('0x17'),'uri':_0x13fae4+_0x1a56('0x2f')+_0x55ae98['replace']('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x48fc56,'If-None-Match':null,'OData-Version':_0x1a56('0x19')},'json':!![]};return rp(_0x8f44f0);})[_0x1a56('0x11')](function(_0x129a7d){var _0x28f135=![];if(!_0x129a7d)return _0x28f135;var _0x51bafa=_0x129a7d[_0x1a56('0x1a')];for(var _0x2ce60f=0x0;_0x2ce60f<_0x51bafa[_0x1a56('0x1e')];_0x2ce60f++){if(_0x51bafa[_0x2ce60f]['telephone1']===_0x55ae98){_0x28f135=!![];_0x51fd80[_0x1a56('0x2e')]=_0x51bafa[_0x2ce60f][_0x1a56('0x30')];}}return _0x28f135;})[_0x1a56('0x11')](function(_0x9a9dc9){if(_0x9a9dc9)return _0x51fd80;if(_0x5313a6==='nothing'){logger[_0x1a56('0x21')]('['+[_0xf5ea11['toUpperCase']()]+_0x1a56('0x31'));return _0x51fd80;}return createEndUser(_0x51fd80,_0x57ee9e,_0x1de7d1,_0x13fae4,_0x4d3ec9,_0xf5ea11)[_0x1a56('0x11')](function(_0x5d293d){logger[_0x1a56('0x21')]('['+[_0xf5ea11[_0x1a56('0x14')]()]+_0x1a56('0x32'),_0x5d293d[_0x1a56('0x2e')]);return _0x5d293d;});});}function getCustomFields(_0x2d093b,_0x5132d7,_0x27696e){var _0x5a6d2b={};if(_0x2d093b[_0x1a56('0x1e')]>0x0){_[_0x1a56('0x33')](_0x2d093b,function(_0x12fd10){if(_[_0x1a56('0x34')]([_0x1a56('0x35'),'picklist'],_0x12fd10[_0x1a56('0x36')])&&_0x12fd10[_0x1a56('0x37')]&&!_0x12fd10[_0x1a56('0x38')]){var _0x1c35c5=_0x12fd10[_0x1a56('0x39')]['toLowerCase']();var _0x6f4b28=_0x1c35c5['substring'](0x0,_0x1c35c5[_0x1a56('0x3a')]('_'));var _0x1d6adb=_0x1c35c5[_0x1a56('0x2c')](_0x1c35c5[_0x1a56('0x3a')]('_')+0x1);if(_0x6f4b28===_0x27696e){_0x5a6d2b[_0x1d6adb]=_0x12fd10[_0x1a56('0x3b')];}}});}return _0x5a6d2b;}function getTicket(_0xde3c8d,_0x2c90fc,_0x25c849,_0x571878,_0x4d5517,_0x2e95ea,_0x10ecbc){return new BPromise(function(_0xb89fb4,_0x5ddccd){var _0x342138;return getAuthToken(_0x2c90fc,_0x25c849,_0x10ecbc)['then'](function(_0x57c266){if(_0x2e95ea[_0x1a56('0x3c')]==='incident'){_0x342138={'method':'POST','uri':_0x571878+_0x1a56('0x3d'),'body':Object[_0x1a56('0x3e')]({},{'title':intUtil[_0x1a56('0x3f')](_0x2e95ea[_0x1a56('0x40')],_0x4d5517,'\x20'),'description':intUtil[_0x1a56('0x3f')](_0x2e95ea[_0x1a56('0x41')],_0x4d5517,'\x0a'),'customerid_contact@odata.bind':_0xde3c8d[_0x1a56('0x2e')]?_0x1a56('0x42')+_0xde3c8d['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0xde3c8d[_0x1a56('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2e95ea[_0x1a56('0x43')],_0x4d5517,_0x2e95ea[_0x1a56('0x3c')])),'headers':{'Authorization':_0x1a56('0x2b')+_0x57c266,'OData-Version':_0x1a56('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2e95ea[_0x1a56('0x3c')]===_0x1a56('0x44')){var _0x2b155b=_0xde3c8d[_0x1a56('0x2e')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0xde3c8d[_0x1a56('0x24')]+')','participationtypemask':_0xde3c8d['callDirection']===_0x1a56('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x1a56('0x42')+_0xde3c8d[_0x1a56('0x2e')]+')','participationtypemask':_0xde3c8d[_0x1a56('0x46')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x1a56('0x2a')+_0xde3c8d[_0x1a56('0x24')]+')','participationtypemask':_0xde3c8d[_0x1a56('0x46')]===_0x1a56('0x45')?0x2:0x1}];_0x342138={'method':_0x1a56('0xb'),'uri':_0x571878+_0x1a56('0x47'),'body':Object[_0x1a56('0x3e')]({},{'subject':intUtil['getString'](_0x2e95ea[_0x1a56('0x40')],_0x4d5517,'\x20'),'phonenumber':String(_0x4d5517[_0x1a56('0x48')]),'description':intUtil['getString'](_0x2e95ea[_0x1a56('0x41')],_0x4d5517,'\x0a'),'regardingobjectid_contact@odata.bind':_0xde3c8d[_0x1a56('0x2e')]?_0x1a56('0x42')+_0xde3c8d['enduserId']+')':undefined,'ownerid@odata.bind':_0x1a56('0x2a')+_0xde3c8d['userId']+')','directioncode':_0xde3c8d[_0x1a56('0x46')]===_0x1a56('0x45')?![]:!![],'phonecall_activity_parties':_0x2b155b},getCustomFields(_0x2e95ea['Fields'],_0x4d5517,_0x2e95ea[_0x1a56('0x3c')])),'headers':{'Authorization':_0x1a56('0x2b')+_0x57c266,'OData-Version':_0x1a56('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x342138);})['then'](function(_0x142f54){var _0x1b745b=_0x142f54[_0x1a56('0x49')][_0x1a56('0x4a')];var _0x29a453=_0x1b745b['substring'](_0x1b745b[_0x1a56('0x2d')]('(')+0x1,_0x1b745b[_0x1a56('0x2d')](')'));_0xde3c8d['ticketId']=_0x29a453;_0xb89fb4(_0xde3c8d);})['catch'](function(_0x4ab7c9){_0x5ddccd(_0x4ab7c9[_0x1a56('0x16')]);});});}function emit(_0x2b9241,_0x5cca5b,_0x16784c,_0x219519){var _0x6965bc={'uri':util['format'](_0x1a56('0x4b'),_0x2b9241,_0x16784c,_0x219519)};io['to'](util['format']('user:%s',_0x5cca5b))[_0x1a56('0x4c')](_0x1a56('0x4d'),_0x6965bc);}exports['cs']=function(_0x490024,_0x5cd8c3,_0x173f2a,_0x206580,_0x33cd92,_0xa63207,_0x1c2a11,_0x446c7c){var _0x41c59e={};_0xa63207['remoteUri']=intUtil[_0x1a56('0x4e')](_0xa63207['remoteUri']);_0xa63207[_0x1a56('0x4f')]=intUtil[_0x1a56('0x4e')](_0xa63207[_0x1a56('0x4f')]);_0x41c59e[_0x1a56('0x46')]=_0x446c7c===_0x1a56('0x45')||_0x446c7c===_0x1a56('0x50')?_0x1a56('0x45'):'outbound';var _0x26c3da=util[_0x1a56('0x51')]('%s/api/data/v9.0/',_0xa63207[_0x1a56('0xd')]);var _0x8b86b7=util['format'](_0x1a56('0x52'),_0xa63207[_0x1a56('0x53')]);var _0x5c9cc3=util[_0x1a56('0x51')](_0x1a56('0x54'),_0xa63207[_0x1a56('0x4f')],_0x5cd8c3[_0x1a56('0x55')],md5(_0x5cd8c3['uniqueid']));if(_0x33cd92&&_0x33cd92[_0x1a56('0x56')]){logger[_0x1a56('0x21')]('[QUEUE]',_0x1a56('0x57'));_0x5cd8c3[_0x1a56('0x58')]=_0x5c9cc3;}else if(_0x1c2a11&&_0x1c2a11[_0x1a56('0x59')]&&_0x1c2a11[_0x1a56('0x59')]!==_0x1a56('0x5a')){logger[_0x1a56('0x21')]('[OUTBOUND]',_0x1a56('0x57'));_0x5cd8c3[_0x1a56('0x58')]=_0x5c9cc3;}else{_0x5cd8c3[_0x1a56('0x58')]='';}return getUser(_0x41c59e,_0xa63207,_0x206580,_0x8b86b7,_0x26c3da,_0x446c7c)[_0x1a56('0x11')](function(_0x2b51f8){logger['info']('['+_0x446c7c['toUpperCase']()+_0x1a56('0x5b'),_0x2b51f8[_0x1a56('0x24')]);logger[_0x1a56('0x21')]('['+_0x446c7c[_0x1a56('0x14')]()+_0x1a56('0x5c'),_0x2b51f8[_0x1a56('0x1d')]);return getEndUser(_0x2b51f8,_0xa63207,_0x8b86b7,_0x26c3da,_0x5cd8c3,_0x446c7c,_0x173f2a['moduleCreate']);})['then'](function(_0x22c406){logger[_0x1a56('0x21')]('['+_0x446c7c[_0x1a56('0x14')]()+_0x1a56('0x5d'),_0x22c406[_0x1a56('0x2e')]);logger[_0x1a56('0x21')]('['+_0x446c7c[_0x1a56('0x14')]()+_0x1a56('0x5e'),_0x5cd8c3[_0x1a56('0x48')]);return getTicket(_0x22c406,_0xa63207,_0x8b86b7,_0x26c3da,_0x5cd8c3,_0x173f2a,_0x446c7c);})[_0x1a56('0x11')](function(_0x399c62){logger[_0x1a56('0x21')](util[_0x1a56('0x51')]('['+_0x446c7c[_0x1a56('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x173f2a[_0x1a56('0x3c')],_0x399c62[_0x1a56('0x5f')]));logger[_0x1a56('0x21')](util['format']('['+_0x446c7c['toUpperCase']()+_0x1a56('0x60'),_0x446c7c));if(_0x446c7c!==_0x1a56('0x50')){logger[_0x1a56('0x21')]('['+_0x446c7c[_0x1a56('0x14')]()+']',_0x1a56('0x61'));emit(_0xa63207[_0x1a56('0xd')],_0x206580[_0x1a56('0x62')],_0x173f2a[_0x1a56('0x3c')],_0x399c62[_0x1a56('0x5f')]);}})[_0x1a56('0x26')](function(_0x10a905){logger['error']('['+_0x446c7c[_0x1a56('0x14')]()+_0x1a56('0x63'),util[_0x1a56('0x64')](_0x10a905,{'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 6113ea9..42db053 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 _0x5478=['recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','content','type','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','outbound'];(function(_0x9668c1,_0x26274a){var _0x50b7e6=function(_0x42e9d2){while(--_0x42e9d2){_0x9668c1['push'](_0x9668c1['shift']());}};_0x50b7e6(++_0x26274a);}(_0x5478,0x18d));var _0x8547=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x5478[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0x8547('0x0'));var rp=require(_0x8547('0x1'));var md5=require(_0x8547('0x2'));var util=require(_0x8547('0x3'));var Redis=require(_0x8547('0x4'));var intUtil=require(_0x8547('0x5'));var config=require(_0x8547('0x6'));var logger=require('../../../../config/logger')(_0x8547('0x7'));config[_0x8547('0x8')]=_[_0x8547('0x9')](config[_0x8547('0x8')],{'host':_0x8547('0xa'),'port':0x18eb});var io=require(_0x8547('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0x8547('0xc'),'Accept':_0x8547('0xc')};function emit(_0x4debf6,_0x5ec598,_0x43b5d7){io['to'](_0x4debf6)['emit'](_0x5ec598,_0x43b5d7);}function getTicket(_0x292a01,_0x5a310e,_0x36e4ed,_0x30ae2d,_0x9fe705){logger[_0x8547('0xd')]('Creating\x20new\x20ticket...');var _0x54bc73=_['merge']({'responder_id':_0x5a310e['id'],'requester_id':_0x36e4ed['id'],'name':util['format'](_0x8547('0xe'),_0x9fe705[_0x8547('0xf')]),'phone':_0x9fe705['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8547('0x10')](_0x30ae2d[_0x8547('0x11')],_0x9fe705,'\x20'),'description':intUtil[_0x8547('0x10')](_0x30ae2d[_0x8547('0x12')],_0x9fe705,_0x8547('0x13')),'tags':getTags(_0x30ae2d[_0x8547('0x14')],_0x8547('0x15'))},getCustomFields(_0x30ae2d['Fields'],_0x9fe705));_0x54bc73[_0x8547('0x16')]=_[_0x8547('0x17')](_[_0x8547('0x18')](_0x54bc73[_0x8547('0x16')],'id'),_0x8547('0x19'));return request({'uri':util[_0x8547('0x1a')](_0x8547('0x1b'),_0x292a01[_0x8547('0x1c')]),'method':_0x8547('0x1d'),'body':_0x54bc73})['then'](function(_0x374633){logger[_0x8547('0xd')](_0x8547('0x1e'));return _0x374633;});}function getUser(_0x504966,_0x2da248){if(intUtil['validateEmail'](_0x2da248)){return request({'uri':util[_0x8547('0x1a')]('%s/api/v2/agents',_0x504966[_0x8547('0x1c')]),'qs':{'email':_0x2da248}})['then'](function(_0x34defa){if(_0x34defa['length']){logger[_0x8547('0xd')](_0x8547('0x1f'));return _[_0x8547('0x20')](_0x34defa,function(_0x246e76){return _0x246e76[_0x8547('0x21')][_0x8547('0x22')]===_0x2da248;});}else{logger['info'](_0x8547('0x23'));return request({'uri':util['format'](_0x8547('0x24'),_0x504966[_0x8547('0x1c')])})[_0x8547('0x25')](function(_0x315789){logger[_0x8547('0xd')](_0x8547('0x26'));return _0x315789;});}});}else{logger[_0x8547('0xd')](_0x8547('0x27'));return request({'uri':util['format'](_0x8547('0x24'),_0x504966['remoteUri'])})[_0x8547('0x25')](function(_0x38080c){logger[_0x8547('0xd')](_0x8547('0x26'));return _0x38080c;});}}function getEndUser(_0x566cbb,_0x187cdc,_0x60c217){logger['info'](_0x8547('0x28'),_0x60c217);return request({'uri':util[_0x8547('0x1a')](_0x8547('0x29'),_0x566cbb[_0x8547('0x1c')]),'qs':{'phone':_0x60c217}})[_0x8547('0x25')](function(_0x2d7942){if(_0x2d7942[_0x8547('0x2a')]){logger['info'](_0x8547('0x2b'));return _[_0x8547('0x20')](_0x2d7942,{'phone':_0x60c217});}else{logger['info'](_0x8547('0x2c'));return request({'uri':util[_0x8547('0x1a')](_0x8547('0x29'),_0x566cbb['remoteUri']),'method':_0x8547('0x1d'),'body':{'name':_0x187cdc,'phone':_0x60c217}})['then'](function(_0x1d5867){logger[_0x8547('0xd')]('Enduser\x20created.');return _0x1d5867;});}});}function getAuth(_0x380114){return util['format']('Basic\x20%s',new Buffer(_0x380114[_0x8547('0x2d')]+':X')[_0x8547('0x2e')](_0x8547('0x2f')));}function request(_0x5e2296){logger[_0x8547('0x30')](_0x8547('0x31'),JSON[_0x8547('0x32')](_0x5e2296));return rp(_['defaults'](_0x5e2296,{'method':_0x8547('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x15f027,_0x1cd00a){var _0x5b304a=[];if(_0x15f027&&_0x15f027[_0x8547('0x2a')]>0x0){_0x5b304a=_[_0x8547('0x34')](_0x15f027,_0x1cd00a);}return _0x5b304a;}function getCustomFields(_0x2d8109,_0x1f25f2){var _0x460e73=[];var _0x2787a5={'custom_fields':[]};if(_0x2d8109[_0x8547('0x2a')]>0x0){_[_0x8547('0x35')](_0x2d8109,function(_0x264774){if(_[_0x8547('0x36')]([_0x8547('0x37'),_0x8547('0x38')],_0x264774['type'])&&_0x264774[_0x8547('0x39')]&&!_0x264774[_0x8547('0x3a')]){_0x2787a5[_0x264774[_0x8547('0x39')]['toLowerCase']()]=_0x264774[_0x8547('0x3b')]['toString']();}else if(_[_0x8547('0x36')](['string',_0x8547('0x38')],_0x264774[_0x8547('0x3c')])&&_0x264774['idField']&&_0x264774['customField']){_0x2787a5[_0x8547('0x16')]['push']({'id':_0x264774[_0x8547('0x3d')],'value':_0x264774['content'][_0x8547('0x2e')]()});}else if(_0x264774[_0x8547('0x3c')]===_0x8547('0x3e')&&_0x264774[_0x8547('0x3f')]&&_0x264774['idField']&&_0x264774[_0x8547('0x3a')]){_0x1f25f2[_0x264774['variableName']]&&_0x2787a5[_0x8547('0x16')][_0x8547('0x40')]({'id':_0x264774[_0x8547('0x3d')],'value':_0x1f25f2[_0x264774[_0x8547('0x3f')]][_0x8547('0x2e')]()});}else if(_0x264774[_0x8547('0x3c')]===_0x8547('0x41')&&_0x264774[_0x8547('0x42')]&&_0x264774['Variable']['name']&&_0x264774[_0x8547('0x3d')]&&_0x264774[_0x8547('0x3a')]){_0x1f25f2[_0x264774['Variable'][_0x8547('0x15')]['toLowerCase']()]&&_0x2787a5[_0x8547('0x16')]['push']({'id':_0x264774[_0x8547('0x3d')],'value':_0x1f25f2[_0x264774['Variable']['name'][_0x8547('0x43')]()][_0x8547('0x2e')]()});}});}return _0x2787a5;}exports[_0x8547('0x44')]=function(_0x401462,_0x365892,_0x321551,_0x477f1e,_0x22b5d1,_0x1334f1){var _0x55a6f2,_0xa760e3;_0x1334f1['remoteUri']=intUtil[_0x8547('0x45')](_0x1334f1[_0x8547('0x1c')]);_0x1334f1[_0x8547('0x46')]=intUtil[_0x8547('0x45')](_0x1334f1[_0x8547('0x46')]);if(_0x22b5d1&&_0x22b5d1[_0x8547('0x47')]){logger[_0x8547('0xd')]('[QUEUE]',_0x8547('0x48'));_0x365892[_0x8547('0x49')]=util[_0x8547('0x1a')](_0x8547('0x4a'),_0x1334f1[_0x8547('0x46')],_0x365892[_0x8547('0x4b')],md5(_0x365892[_0x8547('0x4b')]));}else{_0x365892[_0x8547('0x49')]='';}headers[_0x8547('0x4c')]=getAuth(_0x1334f1);return getUser(_0x1334f1,_0x477f1e['email'])[_0x8547('0x25')](function(_0x38e21d){_0x55a6f2=_0x38e21d;logger[_0x8547('0xd')](_0x8547('0x4d'),_0x55a6f2['id']);return getEndUser(_0x1334f1,_0x365892[_0x8547('0xf')],_0x365892[_0x8547('0x4e')]);})[_0x8547('0x25')](function(_0x593e22){_0xa760e3=_0x593e22;logger['info'](_0x8547('0x4f'),_0xa760e3['id']);return getTicket(_0x1334f1,_0x55a6f2,_0xa760e3,_0x321551,_0x365892);})['then'](function(_0x46ee89){if(_0x46ee89&&_0x46ee89['id']){logger[_0x8547('0xd')]('Ticket\x20created!');logger[_0x8547('0xd')](_0x8547('0x50'),_0x46ee89['id']);logger[_0x8547('0xd')]('[QUEUE]',_0x8547('0x51'));emit(util[_0x8547('0x1a')](_0x8547('0x52'),_0x477f1e[_0x8547('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x8547('0x53'),_0x1334f1[_0x8547('0x1c')],_0x46ee89['id'])});}})[_0x8547('0x54')](function(_0x44387f){logger[_0x8547('0x55')](_0x8547('0x56'),JSON[_0x8547('0x32')](_0x44387f));});};exports[_0x8547('0x57')]=function(_0x5e43dc,_0x563521,_0xecbca0,_0x250284,_0x419498,_0x2fe578,_0x3aa30c){var _0x182a93,_0xc9e79;_0x2fe578[_0x8547('0x1c')]=intUtil['stripTrailingSlash'](_0x2fe578[_0x8547('0x1c')]);_0x2fe578[_0x8547('0x46')]=intUtil[_0x8547('0x45')](_0x2fe578[_0x8547('0x46')]);if(_0x3aa30c&&_0x3aa30c[_0x8547('0x58')]&&_0x3aa30c[_0x8547('0x58')]!==_0x8547('0x59')){logger[_0x8547('0xd')](_0x8547('0x5a'),'Recording\x20is\x20enabled!');_0x563521['recordingURL']=util['format'](_0x8547('0x4a'),_0x2fe578[_0x8547('0x46')],_0x563521['uniqueid'],md5(_0x563521[_0x8547('0x4b')]));}headers['Authorization']=getAuth(_0x2fe578);return getUser(_0x2fe578,_0x250284[_0x8547('0x22')])['then'](function(_0x1fb4c3){_0x182a93=_0x1fb4c3;logger['info'](_0x8547('0x4d'),_0x182a93['id']);return getEndUser(_0x2fe578,_0x563521[_0x8547('0x5b')],_0x563521[_0x8547('0x5c')]);})[_0x8547('0x25')](function(_0x49163d){_0xc9e79=_0x49163d;logger['info'](_0x8547('0x4f'),_0xc9e79['id']);return getTicket(_0x2fe578,_0x182a93,_0xc9e79,_0xecbca0,_0x563521);})[_0x8547('0x25')](function(_0x5b86dc){if(_0x5b86dc&&_0x5b86dc['id']){logger[_0x8547('0xd')](_0x8547('0x1e'));logger[_0x8547('0xd')](_0x8547('0x50'),_0x5b86dc['id']);logger[_0x8547('0xd')]('[OUTBOUND]',_0x8547('0x51'));emit(util['format']('user:%s',_0x250284[_0x8547('0x15')]),_0x8547('0x5d'),{'uri':util[_0x8547('0x1a')]('%s/helpdesk/tickets/%d',_0x2fe578[_0x8547('0x1c')],_0x5b86dc['id'])});}})[_0x8547('0x54')](function(_0x233672){logger[_0x8547('0x55')](_0x8547('0x5a'),JSON[_0x8547('0x32')](_0x233672));});};exports[_0x8547('0x5e')]=function(_0x5f36f8,_0x5cd438,_0x5332e3,_0x2525fc,_0x1976a9,_0x5cda18){var _0x3fa5b6,_0x33b3c3;_0x5cda18[_0x8547('0x1c')]=intUtil[_0x8547('0x45')](_0x5cda18[_0x8547('0x1c')]);_0x5cda18['serverUrl']=intUtil[_0x8547('0x45')](_0x5cda18[_0x8547('0x46')]);if(_0x1976a9&&_0x1976a9[_0x8547('0x47')]){logger[_0x8547('0xd')]('['+_0x5cd438[_0x8547('0x5f')][_0x8547('0x60')]()+']',_0x8547('0x48'));_0x5cd438[_0x8547('0x49')]=util[_0x8547('0x1a')](_0x8547('0x4a'),_0x5cda18[_0x8547('0x46')],_0x5cd438[_0x8547('0x4b')],md5(_0x5cd438['uniqueid']));}else{_0x5cd438['recordingURL']='';}headers[_0x8547('0x4c')]=getAuth(_0x5cda18);return getUser(_0x5cda18,'')['then'](function(_0xf6daa1){_0x3fa5b6=_0xf6daa1;logger['info'](_0x8547('0x4d'),_0x3fa5b6['id']);return getEndUser(_0x5cda18,_0x5cd438[_0x8547('0xf')],_0x5cd438[_0x8547('0x4e')]);})[_0x8547('0x25')](function(_0xa60fc7){_0x33b3c3=_0xa60fc7;logger[_0x8547('0xd')](_0x8547('0x4f'),_0x33b3c3['id']);return getTicket(_0x5cda18,_0x3fa5b6,_0x33b3c3,_0x5332e3,_0x5cd438);})[_0x8547('0x25')](function(_0x2edc5){if(_0x2edc5){logger['info']('Ticket\x20created!');logger[_0x8547('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2edc5['id']);}})[_0x8547('0x54')](function(_0x8bfc81){logger[_0x8547('0x55')]('['+_0x5cd438[_0x8547('0x5f')][_0x8547('0x60')]()+']',JSON[_0x8547('0x32')](_0x8bfc81));});}; \ No newline at end of file +var _0x6ab9=['trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','Authorization','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','calleridname','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','
','name','custom_fields','keyBy','%s/api/v2/tickets','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','toString','base64','debug','stringify','GET','map','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x287aba,_0x2b05a3){var _0x25d2ea=function(_0x1652c2){while(--_0x1652c2){_0x287aba['push'](_0x287aba['shift']());}};_0x25d2ea(++_0x2b05a3);}(_0x6ab9,0x1e3));var _0x96ab=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x6ab9[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x96ab('0x0'));var rp=require(_0x96ab('0x1'));var md5=require(_0x96ab('0x2'));var util=require(_0x96ab('0x3'));var Redis=require(_0x96ab('0x4'));var intUtil=require(_0x96ab('0x5'));var config=require('../../../../config/environment');var logger=require(_0x96ab('0x6'))(_0x96ab('0x7'));config[_0x96ab('0x8')]=_[_0x96ab('0x9')](config[_0x96ab('0x8')],{'host':_0x96ab('0xa'),'port':0x18eb});var io=require(_0x96ab('0xb'))(new Redis(config[_0x96ab('0x8')]));var headers={'Content-Type':_0x96ab('0xc'),'Accept':_0x96ab('0xc')};function emit(_0x1ebd94,_0x50bf17,_0x5f2345){io['to'](_0x1ebd94)[_0x96ab('0xd')](_0x50bf17,_0x5f2345);}function getTicket(_0x2ed3d4,_0x53005f,_0x32bdbe,_0x3ff01f,_0x6fbc58){logger[_0x96ab('0xe')](_0x96ab('0xf'));var _0x593b17=_[_0x96ab('0x10')]({'responder_id':_0x53005f['id'],'requester_id':_0x32bdbe['id'],'name':util[_0x96ab('0x11')](_0x96ab('0x12'),_0x6fbc58['calleridname']),'phone':_0x6fbc58['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x96ab('0x13')](_0x3ff01f[_0x96ab('0x14')],_0x6fbc58,'\x20'),'description':intUtil[_0x96ab('0x13')](_0x3ff01f[_0x96ab('0x15')],_0x6fbc58,_0x96ab('0x16')),'tags':getTags(_0x3ff01f['Tags'],_0x96ab('0x17'))},getCustomFields(_0x3ff01f['Fields'],_0x6fbc58));_0x593b17[_0x96ab('0x18')]=_['mapValues'](_[_0x96ab('0x19')](_0x593b17[_0x96ab('0x18')],'id'),'value');return request({'uri':util[_0x96ab('0x11')](_0x96ab('0x1a'),_0x2ed3d4['remoteUri']),'method':_0x96ab('0x1b'),'body':_0x593b17})[_0x96ab('0x1c')](function(_0xa3317a){logger['info']('Ticket\x20created!');return _0xa3317a;});}function getUser(_0x48c965,_0x3cdb5a){if(intUtil[_0x96ab('0x1d')](_0x3cdb5a)){return request({'uri':util['format'](_0x96ab('0x1e'),_0x48c965['remoteUri']),'qs':{'email':_0x3cdb5a}})[_0x96ab('0x1c')](function(_0x110342){if(_0x110342[_0x96ab('0x1f')]){logger[_0x96ab('0xe')](_0x96ab('0x20'));return _[_0x96ab('0x21')](_0x110342,function(_0x5612d7){return _0x5612d7[_0x96ab('0x22')]['email']===_0x3cdb5a;});}else{logger[_0x96ab('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x96ab('0x11')](_0x96ab('0x23'),_0x48c965['remoteUri'])})[_0x96ab('0x1c')](function(_0x263c38){logger[_0x96ab('0xe')](_0x96ab('0x24'));return _0x263c38;});}});}else{logger[_0x96ab('0xe')](_0x96ab('0x25'));return request({'uri':util[_0x96ab('0x11')]('%s/api/v2/agents/me',_0x48c965[_0x96ab('0x26')])})[_0x96ab('0x1c')](function(_0x5ec8da){logger['info'](_0x96ab('0x24'));return _0x5ec8da;});}}function getEndUser(_0x3d8149,_0x22d2bc,_0x377295){logger[_0x96ab('0xe')](_0x96ab('0x27'),_0x377295);return request({'uri':util[_0x96ab('0x11')](_0x96ab('0x28'),_0x3d8149[_0x96ab('0x26')]),'qs':{'phone':_0x377295}})[_0x96ab('0x1c')](function(_0x11afe6){if(_0x11afe6['length']){logger[_0x96ab('0xe')]('Enduser\x20found!');return _[_0x96ab('0x21')](_0x11afe6,{'phone':_0x377295});}else{logger[_0x96ab('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x96ab('0x11')](_0x96ab('0x28'),_0x3d8149[_0x96ab('0x26')]),'method':_0x96ab('0x1b'),'body':{'name':_0x22d2bc,'phone':_0x377295}})[_0x96ab('0x1c')](function(_0xcfe0e6){logger[_0x96ab('0xe')](_0x96ab('0x29'));return _0xcfe0e6;});}});}function getAuth(_0x96065a){return util[_0x96ab('0x11')](_0x96ab('0x2a'),new Buffer(_0x96065a['apiKey']+':X')[_0x96ab('0x2b')](_0x96ab('0x2c')));}function request(_0x5dfedb){logger[_0x96ab('0x2d')]('[HTTP]',JSON[_0x96ab('0x2e')](_0x5dfedb));return rp(_[_0x96ab('0x9')](_0x5dfedb,{'method':_0x96ab('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x515a9c,_0x5e341d){var _0x49741b=[];if(_0x515a9c&&_0x515a9c['length']>0x0){_0x49741b=_[_0x96ab('0x30')](_0x515a9c,_0x5e341d);}return _0x49741b;}function getCustomFields(_0x1f955a,_0x27c40f){var _0x3a472a=[];var _0x21eda0={'custom_fields':[]};if(_0x1f955a[_0x96ab('0x1f')]>0x0){_[_0x96ab('0x31')](_0x1f955a,function(_0x4340bd){if(_[_0x96ab('0x32')]([_0x96ab('0x33'),_0x96ab('0x34')],_0x4340bd[_0x96ab('0x35')])&&_0x4340bd['nameField']&&!_0x4340bd[_0x96ab('0x36')]){_0x21eda0[_0x4340bd[_0x96ab('0x37')][_0x96ab('0x38')]()]=_0x4340bd[_0x96ab('0x39')][_0x96ab('0x2b')]();}else if(_[_0x96ab('0x32')]([_0x96ab('0x33'),_0x96ab('0x34')],_0x4340bd['type'])&&_0x4340bd[_0x96ab('0x3a')]&&_0x4340bd[_0x96ab('0x36')]){_0x21eda0[_0x96ab('0x18')]['push']({'id':_0x4340bd['idField'],'value':_0x4340bd[_0x96ab('0x39')]['toString']()});}else if(_0x4340bd[_0x96ab('0x35')]===_0x96ab('0x3b')&&_0x4340bd[_0x96ab('0x3c')]&&_0x4340bd[_0x96ab('0x3a')]&&_0x4340bd[_0x96ab('0x36')]){_0x27c40f[_0x4340bd[_0x96ab('0x3c')]]&&_0x21eda0[_0x96ab('0x18')][_0x96ab('0x3d')]({'id':_0x4340bd[_0x96ab('0x3a')],'value':_0x27c40f[_0x4340bd['variableName']][_0x96ab('0x2b')]()});}else if(_0x4340bd[_0x96ab('0x35')]===_0x96ab('0x3e')&&_0x4340bd['Variable']&&_0x4340bd['Variable']['name']&&_0x4340bd[_0x96ab('0x3a')]&&_0x4340bd[_0x96ab('0x36')]){_0x27c40f[_0x4340bd[_0x96ab('0x3f')][_0x96ab('0x17')][_0x96ab('0x38')]()]&&_0x21eda0[_0x96ab('0x18')]['push']({'id':_0x4340bd['idField'],'value':_0x27c40f[_0x4340bd['Variable'][_0x96ab('0x17')]['toLowerCase']()][_0x96ab('0x2b')]()});}});}return _0x21eda0;}exports[_0x96ab('0x40')]=function(_0x4b646b,_0x16433b,_0x5a9138,_0x15af08,_0xc5f4ce,_0x4ece7d){var _0x1d79c5,_0x32c505;_0x4ece7d[_0x96ab('0x26')]=intUtil[_0x96ab('0x41')](_0x4ece7d[_0x96ab('0x26')]);_0x4ece7d[_0x96ab('0x42')]=intUtil[_0x96ab('0x41')](_0x4ece7d['serverUrl']);if(_0xc5f4ce&&_0xc5f4ce[_0x96ab('0x43')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x16433b[_0x96ab('0x44')]=util[_0x96ab('0x11')](_0x96ab('0x45'),_0x4ece7d[_0x96ab('0x42')],_0x16433b[_0x96ab('0x46')],md5(_0x16433b[_0x96ab('0x46')]));}else{_0x16433b[_0x96ab('0x44')]='';}headers['Authorization']=getAuth(_0x4ece7d);return getUser(_0x4ece7d,_0x15af08[_0x96ab('0x47')])[_0x96ab('0x1c')](function(_0x3a7dd3){_0x1d79c5=_0x3a7dd3;logger[_0x96ab('0xe')]('The\x20User\x20ID\x20is:',_0x1d79c5['id']);return getEndUser(_0x4ece7d,_0x16433b['calleridname'],_0x16433b['calleridnum']);})['then'](function(_0x279e5b){_0x32c505=_0x279e5b;logger['info'](_0x96ab('0x48'),_0x32c505['id']);return getTicket(_0x4ece7d,_0x1d79c5,_0x32c505,_0x5a9138,_0x16433b);})['then'](function(_0x508416){if(_0x508416&&_0x508416['id']){logger[_0x96ab('0xe')]('Ticket\x20created!');logger[_0x96ab('0xe')]('The\x20Ticket\x20ID\x20is:',_0x508416['id']);logger[_0x96ab('0xe')]('[QUEUE]',_0x96ab('0x49'));emit(util[_0x96ab('0x11')](_0x96ab('0x4a'),_0x15af08[_0x96ab('0x17')]),_0x96ab('0x4b'),{'uri':util[_0x96ab('0x11')](_0x96ab('0x4c'),_0x4ece7d[_0x96ab('0x26')],_0x508416['id'])});}})[_0x96ab('0x4d')](function(_0x2886c8){logger[_0x96ab('0x4e')](_0x96ab('0x4f'),JSON[_0x96ab('0x2e')](_0x2886c8));});};exports['outbound']=function(_0x3aee55,_0x46b541,_0x1eeece,_0x43e85b,_0x1f41ba,_0x6f772f,_0x17ace1){var _0x16aab2,_0x87090f;_0x6f772f[_0x96ab('0x26')]=intUtil['stripTrailingSlash'](_0x6f772f[_0x96ab('0x26')]);_0x6f772f[_0x96ab('0x42')]=intUtil[_0x96ab('0x41')](_0x6f772f['serverUrl']);if(_0x17ace1&&_0x17ace1[_0x96ab('0x50')]&&_0x17ace1['recordingFormat']!==_0x96ab('0x51')){logger[_0x96ab('0xe')]('[OUTBOUND]',_0x96ab('0x52'));_0x46b541[_0x96ab('0x44')]=util[_0x96ab('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6f772f[_0x96ab('0x42')],_0x46b541[_0x96ab('0x46')],md5(_0x46b541['uniqueid']));}headers[_0x96ab('0x53')]=getAuth(_0x6f772f);return getUser(_0x6f772f,_0x43e85b[_0x96ab('0x47')])[_0x96ab('0x1c')](function(_0x124b1f){_0x16aab2=_0x124b1f;logger['info']('The\x20User\x20ID\x20is:',_0x16aab2['id']);return getEndUser(_0x6f772f,_0x46b541['destcalleridname'],_0x46b541['destcalleridnum']);})[_0x96ab('0x1c')](function(_0x4802ac){_0x87090f=_0x4802ac;logger[_0x96ab('0xe')](_0x96ab('0x48'),_0x87090f['id']);return getTicket(_0x6f772f,_0x16aab2,_0x87090f,_0x1eeece,_0x46b541);})[_0x96ab('0x1c')](function(_0x55757b){if(_0x55757b&&_0x55757b['id']){logger[_0x96ab('0xe')](_0x96ab('0x54'));logger[_0x96ab('0xe')](_0x96ab('0x55'),_0x55757b['id']);logger[_0x96ab('0xe')]('[OUTBOUND]',_0x96ab('0x49'));emit(util['format']('user:%s',_0x43e85b[_0x96ab('0x17')]),_0x96ab('0x4b'),{'uri':util[_0x96ab('0x11')]('%s/helpdesk/tickets/%d',_0x6f772f[_0x96ab('0x26')],_0x55757b['id'])});}})[_0x96ab('0x4d')](function(_0x2dd5a6){logger[_0x96ab('0x4e')](_0x96ab('0x56'),JSON[_0x96ab('0x2e')](_0x2dd5a6));});};exports[_0x96ab('0x57')]=function(_0x48e21d,_0x22a732,_0x169df7,_0x402a9f,_0x53d49a,_0x12e18a){var _0x472bac,_0x183371;_0x12e18a[_0x96ab('0x26')]=intUtil[_0x96ab('0x41')](_0x12e18a[_0x96ab('0x26')]);_0x12e18a['serverUrl']=intUtil['stripTrailingSlash'](_0x12e18a['serverUrl']);if(_0x53d49a&&_0x53d49a[_0x96ab('0x43')]){logger['info']('['+_0x22a732[_0x96ab('0x58')][_0x96ab('0x59')]()+']',_0x96ab('0x52'));_0x22a732['recordingURL']=util['format'](_0x96ab('0x45'),_0x12e18a['serverUrl'],_0x22a732[_0x96ab('0x46')],md5(_0x22a732[_0x96ab('0x46')]));}else{_0x22a732[_0x96ab('0x44')]='';}headers[_0x96ab('0x53')]=getAuth(_0x12e18a);return getUser(_0x12e18a,'')['then'](function(_0x3de99b){_0x472bac=_0x3de99b;logger[_0x96ab('0xe')](_0x96ab('0x5a'),_0x472bac['id']);return getEndUser(_0x12e18a,_0x22a732[_0x96ab('0x5b')],_0x22a732[_0x96ab('0x5c')]);})[_0x96ab('0x1c')](function(_0x2c0baa){_0x183371=_0x2c0baa;logger[_0x96ab('0xe')](_0x96ab('0x48'),_0x183371['id']);return getTicket(_0x12e18a,_0x472bac,_0x183371,_0x169df7,_0x22a732);})['then'](function(_0xe57e4d){if(_0xe57e4d){logger[_0x96ab('0xe')]('Ticket\x20created!');logger[_0x96ab('0xe')](_0x96ab('0x55'),_0xe57e4d['id']);}})[_0x96ab('0x4d')](function(_0x4485e1){logger[_0x96ab('0x4e')]('['+_0x22a732['lastevent']['toUpperCase']()+']',JSON[_0x96ab('0x2e')](_0x4485e1));});}; \ 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 ce5fafa..eba3ee4 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 _0x81a9=['name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','/contacts/','emit','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...'];(function(_0xb25c53,_0x4ac6b6){var _0x4bd9ef=function(_0x2d300d){while(--_0x2d300d){_0xb25c53['push'](_0xb25c53['shift']());}};_0x4bd9ef(++_0x4ac6b6);}(_0x81a9,0xfb));var _0x981a=function(_0x52f692,_0xfbc239){_0x52f692=_0x52f692-0x0;var _0x293519=_0x81a9[_0x52f692];return _0x293519;};'use strict';var _=require(_0x981a('0x0'));var rp=require(_0x981a('0x1'));var md5=require(_0x981a('0x2'));var util=require(_0x981a('0x3'));var moment=require('moment');var Promise=require(_0x981a('0x4'));var Redis=require(_0x981a('0x5'));var intUtil=require(_0x981a('0x6'));var config=require(_0x981a('0x7'));var logger=require(_0x981a('0x8'))('freshsales');config['redis']=_[_0x981a('0x9')](config[_0x981a('0xa')],{'host':_0x981a('0xb'),'port':0x18eb});var io=require(_0x981a('0xc'))(new Redis(config['redis']));function getAdminId(_0x11f6f7,_0x27e9f9,_0x2a4c8b,_0x2301ca){return new Promise(function(_0x1ce64a,_0x403069){var _0x17fc0b=![];var _0x41538c={'method':_0x981a('0xd'),'uri':_0x2301ca+'/api/selector/owners','json':!![]};_0x41538c[_0x981a('0xe')]=_0x2a4c8b;logger[_0x981a('0xf')]('Getting\x20admin\x20information');return rp(_0x41538c)[_0x981a('0x10')](function(_0x4242b4){if(_0x4242b4){var _0xf210a2=_0x4242b4[_0x981a('0x11')];var _0x48d654=null;for(_0x48d654=0x0;_0x48d654<_0xf210a2[_0x981a('0x12')];_0x48d654++){if(_0xf210a2[_0x48d654][_0x981a('0x13')]===_0x11f6f7[_0x981a('0x14')]){_0x11f6f7[_0x981a('0x15')]=_0xf210a2[_0x48d654]['id'];_0x17fc0b=!![];}}if(_0x17fc0b){logger[_0x981a('0xf')](_0x981a('0x16'),_0x11f6f7[_0x981a('0x15')]);_0x1ce64a(_0x11f6f7);}else{_0x403069({'statusCode':0x194,'message':_0x981a('0x17')});}}else{_0x403069({'statusCode':0x194,'message':_0x981a('0x17')});}})[_0x981a('0x18')](function(_0x37e12){logger[_0x981a('0x19')]('['+[_0x27e9f9[_0x981a('0x1a')]()]+']',_0x37e12[_0x981a('0x1b')]);_0x403069(_0x37e12);});});}function getUser(_0x4443f0,_0x175f18,_0xc1322a){return function(_0x996644){return new Promise(function(_0x500dd5,_0x58ebd0){var _0x5a9d37={'method':_0x981a('0xd'),'uri':_0xc1322a+_0x981a('0x1c'),'json':!![]};_0x5a9d37[_0x981a('0xe')]=_0x175f18;logger[_0x981a('0xf')](_0x981a('0x1d'));return rp(_0x5a9d37)['then'](function(_0x208bf9){if(_0x208bf9){var _0x1e4135=_0x208bf9[_0x981a('0x11')];var _0x303fdf=![];var _0x120294=null;if(_0x996644['agentEmail']!==null){logger['info'](_0x981a('0x1e'),_0x996644[_0x981a('0x1f')]);_0x996644['userEmail']=_0x996644[_0x981a('0x1f')];for(_0x120294=0x0;_0x120294<_0x1e4135['length'];_0x120294++){if(_0x1e4135[_0x120294][_0x981a('0x13')]===_0x996644[_0x981a('0x1f')]){_0x303fdf=!![];_0x996644[_0x981a('0x20')]=_0x1e4135[_0x120294]['id'];logger[_0x981a('0xf')](_0x981a('0x21'),_0x996644['userId']);}}}if(!_0x303fdf){logger[_0x981a('0xf')](_0x981a('0x22'));_0x996644[_0x981a('0x23')]=_0x996644['adminEmail'];_0x996644[_0x981a('0x20')]=_0x996644[_0x981a('0x15')];_0x303fdf=!![];}if(_0x303fdf){_0x500dd5(_0x996644);}else{_0x58ebd0({'statusCode':0x194,'message':_0x981a('0x17')});}}else{_0x58ebd0({'statusCode':0x194,'message':_0x981a('0x17')});}})[_0x981a('0x18')](function(_0x3ded46){logger[_0x981a('0x19')]('['+[_0x4443f0[_0x981a('0x1a')]()]+']',_0x3ded46[_0x981a('0x1b')]);_0x58ebd0(_0x3ded46);});});};}function searchContact(_0x546d62,_0x1e9cf0,_0x256894,_0x5d3281){return new Promise(function(_0x3fd92e,_0x13a3c4){var _0x406b13={'method':'GET','headers':_0x1e9cf0,'uri':_0x546d62+'/api/lookup?q='+_0x5d3281+_0x981a('0x24')+_0x256894+_0x981a('0x25'),'json':!![]};rp(_0x406b13)['then'](function(_0x2e0f9b){var _0x523cc4=_[_0x981a('0x26')](_0x2e0f9b[_0x981a('0x27')][_0x981a('0x27')],[_0x256894,_0x5d3281]);_0x3fd92e(_0x523cc4);})[_0x981a('0x18')](function(_0x3880ea){_0x13a3c4(_0x3880ea);});});}function getEndUser(_0x401bc4,_0x5bb71f,_0x7bc6f){return function(_0x411f39){return new Promise(function(_0x1ef588,_0x5346c8){logger[_0x981a('0xf')](util[_0x981a('0x28')]('Searching\x20contact\x20with\x20phone\x20%s',_0x411f39[_0x981a('0x29')]));searchContact(_0x7bc6f,_0x5bb71f,_0x981a('0x2a'),_0x411f39['contactNumber'])[_0x981a('0x10')](function(_0x589189){if(_0x589189){_0x411f39[_0x981a('0x2b')]=_0x589189['id'];logger[_0x981a('0xf')](_0x981a('0x2c'),_0x411f39['endUserId']);return _0x1ef588(_0x411f39);}searchContact(_0x7bc6f,_0x5bb71f,'work_number',_0x411f39[_0x981a('0x29')])[_0x981a('0x10')](function(_0xcee2d0){if(_0xcee2d0){_0x411f39[_0x981a('0x2b')]=_0xcee2d0['id'];logger[_0x981a('0xf')](_0x981a('0x2d'),_0x411f39[_0x981a('0x2b')]);return _0x1ef588(_0x411f39);}createEndUser(_0x411f39,_0x401bc4,_0x5bb71f,_0x7bc6f)[_0x981a('0x10')](function(_0x10d0e0){logger[_0x981a('0xf')](_0x981a('0x2e'),_0x10d0e0['endUserId']);return _0x1ef588(_0x10d0e0);});});})['catch'](function(_0x88c0f0){_0x5346c8(_0x88c0f0);});});};}function createEndUser(_0x1bf072,_0x3e5d23,_0x1771e1,_0x352722){return new Promise(function(_0x186b77,_0x4ed414){var _0x35f989=moment();var _0x4458d6={'method':_0x981a('0x2f'),'uri':_0x352722+_0x981a('0x30'),'body':{'contact':{'last_name':_0x1bf072[_0x981a('0x29')],'work_number':_0x1bf072[_0x981a('0x29')],'mobile_number':_0x1bf072[_0x981a('0x29')],'owner_id':_0x1bf072[_0x981a('0x20')],'created_at':_0x35f989[_0x981a('0x28')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4458d6['headers']=_0x1771e1;logger[_0x981a('0xf')](_0x981a('0x31'));return rp(_0x4458d6)[_0x981a('0x10')](function(_0x3416a5){_0x1bf072[_0x981a('0x2b')]=_0x3416a5[_0x981a('0x32')]['id'];_0x186b77(_0x1bf072);})['catch'](function(_0xb42abe){logger['error']('['+[_0x3e5d23['toUpperCase']()]+']',_0xb42abe[_0x981a('0x1b')]);_0x4ed414(_0xb42abe[_0x981a('0x1b')]);});});}function getTicket(_0x35e733,_0x2d587f,_0x4c8ebe,_0x1212ca,_0x25aff5){return function(_0x362388){logger[_0x981a('0xf')](_0x981a('0x33'));return new Promise(function(_0x1930eb,_0xcbfe2b){var _0x19348a=moment();var _0x222ef3={'method':_0x981a('0x2f'),'uri':_0x4c8ebe+_0x981a('0x34'),'body':{'title':intUtil['getString'](_0x1212ca[_0x981a('0x35')],_0x25aff5,'\x20'),'description':intUtil[_0x981a('0x36')](_0x1212ca['Descriptions'],_0x25aff5,'\x0a'),'owner_id':_0x362388[_0x981a('0x20')],'creater_id':_0x362388[_0x981a('0x15')],'targetable_id':_0x362388[_0x981a('0x2b')],'targetable_type':_0x981a('0x37'),'created_at':_0x19348a[_0x981a('0x28')](_0x981a('0x38')),'due_date':_0x19348a[_0x981a('0x39')](0x1e,'m')[_0x981a('0x28')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x222ef3['headers']=_0x2d587f;return rp(_0x222ef3)[_0x981a('0x10')](function(_0x20a23f){_0x362388[_0x981a('0x3a')]=_0x20a23f[_0x981a('0x3b')]['id'];logger[_0x981a('0xf')]('Task\x20created:',_0x362388[_0x981a('0x3a')]);_0x1930eb(_0x362388);})[_0x981a('0x18')](function(_0x24471b){logger[_0x981a('0x19')]('['+[_0x35e733['toUpperCase']()]+']',_0x24471b[_0x981a('0x1b')]);_0xcbfe2b(_0x24471b[_0x981a('0x1b')]);});});};}function emit(_0x1224e5,_0x25eea9,_0x43c091){var _0x4e031b={'uri':_0x1224e5+_0x981a('0x3c')+_0x43c091};io['to'](util[_0x981a('0x28')]('user:%s',_0x25eea9))[_0x981a('0x3d')]('trigger:browser:url',_0x4e031b);}exports['cs']=function(_0x26f788,_0x7347a9,_0x58dd08,_0x2f9f28,_0x226ecb,_0x22921d,_0x1e315f,_0x141285){var _0x2f48af={};var _0x4e7e23={'Authorization':_0x981a('0x3e')+_0x22921d['apiKey']};_0x22921d[_0x981a('0x3f')]=intUtil[_0x981a('0x40')](_0x22921d['remoteUri']);_0x22921d[_0x981a('0x41')]=intUtil[_0x981a('0x40')](_0x22921d[_0x981a('0x41')]);var _0x406993=_0x22921d[_0x981a('0x3f')];_0x2f48af['adminEmail']=_0x22921d[_0x981a('0x42')];_0x2f48af[_0x981a('0x29')]=_0x141285[_0x981a('0x43')]()===_0x981a('0x44')?_0x7347a9[_0x981a('0x45')]:_0x7347a9[_0x981a('0x46')];_0x2f48af[_0x981a('0x47')]=_0x141285===_0x981a('0x48')||_0x141285===_0x981a('0x49')?'queue':_0x981a('0x44');if(_0x2f9f28){_0x2f48af['agentEmail']=_0x2f9f28[_0x981a('0x13')];}var _0x319fdb=util['format'](_0x981a('0x4a'),_0x22921d[_0x981a('0x41')],_0x7347a9['uniqueid'],md5(_0x7347a9[_0x981a('0x4b')]));if(_0x226ecb&&_0x226ecb['monitor_format']){logger[_0x981a('0xf')]('[QUEUE]',_0x981a('0x4c'));_0x7347a9[_0x981a('0x4d')]=_0x319fdb;}else if(_0x1e315f&&_0x1e315f['recordingFormat']&&_0x1e315f[_0x981a('0x4e')]!=='none'){logger[_0x981a('0xf')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x7347a9[_0x981a('0x4d')]=_0x319fdb;}else{_0x7347a9['recordingURL']='';}return getAdminId(_0x2f48af,_0x141285,_0x4e7e23,_0x406993)[_0x981a('0x10')](getUser(_0x141285,_0x4e7e23,_0x406993))[_0x981a('0x10')](getEndUser(_0x141285,_0x4e7e23,_0x406993))[_0x981a('0x10')](getTicket(_0x141285,_0x4e7e23,_0x406993,_0x58dd08,_0x7347a9))[_0x981a('0x10')](function(_0x162db4){logger[_0x981a('0xf')](util['format'](_0x981a('0x4f'),_0x162db4[_0x981a('0x3a')]));if(_0x141285!==_0x981a('0x49')){logger[_0x981a('0xf')]('['+[_0x141285[_0x981a('0x1a')]()]+']',_0x981a('0x50'));emit(_0x406993,_0x2f9f28[_0x981a('0x51')],_0x162db4['endUserId']);}})[_0x981a('0x18')](function(_0x197fdb){logger[_0x981a('0x19')]('['+[_0x141285['toUpperCase']()]+_0x981a('0x52'),util['inspect'](_0x197fdb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x26cc=['calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','freshsales','redis','defaults','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','adminEmail','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound'];(function(_0x2d3711,_0x43d60d){var _0x477858=function(_0x4ffb1c){while(--_0x4ffb1c){_0x2d3711['push'](_0x2d3711['shift']());}};_0x477858(++_0x43d60d);}(_0x26cc,0x170));var _0xc26c=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x26cc[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xc26c('0x0'));var rp=require(_0xc26c('0x1'));var md5=require(_0xc26c('0x2'));var util=require(_0xc26c('0x3'));var moment=require(_0xc26c('0x4'));var Promise=require(_0xc26c('0x5'));var Redis=require(_0xc26c('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xc26c('0x7'));config[_0xc26c('0x8')]=_[_0xc26c('0x9')](config[_0xc26c('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc26c('0xa'))(new Redis(config[_0xc26c('0x8')]));function getAdminId(_0x41ae5e,_0x311c16,_0x4ad4d3,_0x3f41a6){return new Promise(function(_0x1ed9dd,_0x33a872){var _0x40a6d6=![];var _0xfc238e={'method':_0xc26c('0xb'),'uri':_0x3f41a6+'/api/selector/owners','json':!![]};_0xfc238e[_0xc26c('0xc')]=_0x4ad4d3;logger[_0xc26c('0xd')](_0xc26c('0xe'));return rp(_0xfc238e)[_0xc26c('0xf')](function(_0x4154a5){if(_0x4154a5){var _0x19299a=_0x4154a5['users'];var _0x318b10=null;for(_0x318b10=0x0;_0x318b10<_0x19299a[_0xc26c('0x10')];_0x318b10++){if(_0x19299a[_0x318b10][_0xc26c('0x11')]===_0x41ae5e['adminEmail']){_0x41ae5e[_0xc26c('0x12')]=_0x19299a[_0x318b10]['id'];_0x40a6d6=!![];}}if(_0x40a6d6){logger['info'](_0xc26c('0x13'),_0x41ae5e[_0xc26c('0x12')]);_0x1ed9dd(_0x41ae5e);}else{_0x33a872({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x33a872({'statusCode':0x194,'message':_0xc26c('0x14')});}})[_0xc26c('0x15')](function(_0x55f488){logger['error']('['+[_0x311c16[_0xc26c('0x16')]()]+']',_0x55f488[_0xc26c('0x17')]);_0x33a872(_0x55f488);});});}function getUser(_0x2e6f7f,_0x281548,_0x396484){return function(_0x22e247){return new Promise(function(_0x53a89a,_0x324e61){var _0x399c04={'method':_0xc26c('0xb'),'uri':_0x396484+_0xc26c('0x18'),'json':!![]};_0x399c04[_0xc26c('0xc')]=_0x281548;logger[_0xc26c('0xd')](_0xc26c('0x19'));return rp(_0x399c04)['then'](function(_0x3dace7){if(_0x3dace7){var _0x4d0bff=_0x3dace7[_0xc26c('0x1a')];var _0x42cf1d=![];var _0x2e3d70=null;if(_0x22e247[_0xc26c('0x1b')]!==null){logger['info'](_0xc26c('0x1c'),_0x22e247[_0xc26c('0x1b')]);_0x22e247['userEmail']=_0x22e247['agentEmail'];for(_0x2e3d70=0x0;_0x2e3d70<_0x4d0bff['length'];_0x2e3d70++){if(_0x4d0bff[_0x2e3d70]['email']===_0x22e247['agentEmail']){_0x42cf1d=!![];_0x22e247[_0xc26c('0x1d')]=_0x4d0bff[_0x2e3d70]['id'];logger[_0xc26c('0xd')](_0xc26c('0x1e'),_0x22e247[_0xc26c('0x1d')]);}}}if(!_0x42cf1d){logger[_0xc26c('0xd')](_0xc26c('0x1f'));_0x22e247[_0xc26c('0x20')]=_0x22e247[_0xc26c('0x21')];_0x22e247[_0xc26c('0x1d')]=_0x22e247['adminId'];_0x42cf1d=!![];}if(_0x42cf1d){_0x53a89a(_0x22e247);}else{_0x324e61({'statusCode':0x194,'message':_0xc26c('0x14')});}}else{_0x324e61({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xc26c('0x15')](function(_0x4ec3e9){logger[_0xc26c('0x22')]('['+[_0x2e6f7f['toUpperCase']()]+']',_0x4ec3e9['message']);_0x324e61(_0x4ec3e9);});});};}function searchContact(_0x1516d7,_0x2fd2d9,_0x514197,_0x192a7d){return new Promise(function(_0xa80bdc,_0x3e65de){var _0x4dc7dd={'method':_0xc26c('0xb'),'headers':_0x2fd2d9,'uri':_0x1516d7+_0xc26c('0x23')+_0x192a7d+_0xc26c('0x24')+_0x514197+_0xc26c('0x25'),'json':!![]};rp(_0x4dc7dd)['then'](function(_0x860ec9){var _0x453edd=_[_0xc26c('0x26')](_0x860ec9[_0xc26c('0x27')][_0xc26c('0x27')],[_0x514197,_0x192a7d]);_0xa80bdc(_0x453edd);})['catch'](function(_0x3aa2de){_0x3e65de(_0x3aa2de);});});}function getEndUser(_0x3e7442,_0x27c4ae,_0x31a1ad){return function(_0x32c713){return new Promise(function(_0x630d3b,_0x1ef3d8){logger[_0xc26c('0xd')](util[_0xc26c('0x28')](_0xc26c('0x29'),_0x32c713[_0xc26c('0x2a')]));searchContact(_0x31a1ad,_0x27c4ae,_0xc26c('0x2b'),_0x32c713['contactNumber'])[_0xc26c('0xf')](function(_0x5dccd1){if(_0x5dccd1){_0x32c713[_0xc26c('0x2c')]=_0x5dccd1['id'];logger['info'](_0xc26c('0x2d'),_0x32c713[_0xc26c('0x2c')]);return _0x630d3b(_0x32c713);}searchContact(_0x31a1ad,_0x27c4ae,_0xc26c('0x2e'),_0x32c713['contactNumber'])['then'](function(_0x54a136){if(_0x54a136){_0x32c713[_0xc26c('0x2c')]=_0x54a136['id'];logger[_0xc26c('0xd')](_0xc26c('0x2f'),_0x32c713[_0xc26c('0x2c')]);return _0x630d3b(_0x32c713);}createEndUser(_0x32c713,_0x3e7442,_0x27c4ae,_0x31a1ad)[_0xc26c('0xf')](function(_0x5435ab){logger['info'](_0xc26c('0x30'),_0x5435ab[_0xc26c('0x2c')]);return _0x630d3b(_0x5435ab);});});})['catch'](function(_0x3d0ecb){_0x1ef3d8(_0x3d0ecb);});});};}function createEndUser(_0xdad585,_0x51a6bf,_0x118018,_0x21cce4){return new Promise(function(_0x1b0b2d,_0x502255){var _0x190b0=moment();var _0x350e6a={'method':_0xc26c('0x31'),'uri':_0x21cce4+_0xc26c('0x32'),'body':{'contact':{'last_name':_0xdad585['contactNumber'],'work_number':_0xdad585[_0xc26c('0x2a')],'mobile_number':_0xdad585[_0xc26c('0x2a')],'owner_id':_0xdad585[_0xc26c('0x1d')],'created_at':_0x190b0[_0xc26c('0x28')](_0xc26c('0x33'))}},'json':!![]};_0x350e6a[_0xc26c('0xc')]=_0x118018;logger[_0xc26c('0xd')](_0xc26c('0x34'));return rp(_0x350e6a)[_0xc26c('0xf')](function(_0x509cec){_0xdad585[_0xc26c('0x2c')]=_0x509cec['contact']['id'];_0x1b0b2d(_0xdad585);})[_0xc26c('0x15')](function(_0x50da26){logger[_0xc26c('0x22')]('['+[_0x51a6bf[_0xc26c('0x16')]()]+']',_0x50da26[_0xc26c('0x17')]);_0x502255(_0x50da26['message']);});});}function getTicket(_0x5caf29,_0x2248ef,_0x100faf,_0x3b2741,_0x1f4176){return function(_0x26ac19){logger[_0xc26c('0xd')](_0xc26c('0x35'));return new Promise(function(_0x2c7d33,_0x3ac65d){var _0x12f46e=moment();var _0x2a2661={'method':_0xc26c('0x31'),'uri':_0x100faf+_0xc26c('0x36'),'body':{'title':intUtil[_0xc26c('0x37')](_0x3b2741['Subjects'],_0x1f4176,'\x20'),'description':intUtil[_0xc26c('0x37')](_0x3b2741[_0xc26c('0x38')],_0x1f4176,'\x0a'),'owner_id':_0x26ac19['userId'],'creater_id':_0x26ac19[_0xc26c('0x12')],'targetable_id':_0x26ac19[_0xc26c('0x2c')],'targetable_type':_0xc26c('0x39'),'created_at':_0x12f46e[_0xc26c('0x28')](_0xc26c('0x33')),'due_date':_0x12f46e[_0xc26c('0x3a')](0x1e,'m')[_0xc26c('0x28')](_0xc26c('0x33'))},'json':!![]};_0x2a2661['headers']=_0x2248ef;return rp(_0x2a2661)[_0xc26c('0xf')](function(_0x3254e4){_0x26ac19[_0xc26c('0x3b')]=_0x3254e4['task']['id'];logger[_0xc26c('0xd')]('Task\x20created:',_0x26ac19[_0xc26c('0x3b')]);_0x2c7d33(_0x26ac19);})['catch'](function(_0x321a2b){logger['error']('['+[_0x5caf29[_0xc26c('0x16')]()]+']',_0x321a2b['message']);_0x3ac65d(_0x321a2b[_0xc26c('0x17')]);});});};}function emit(_0x54a5b3,_0x3d02f9,_0x56d73a){var _0x1db30e={'uri':_0x54a5b3+_0xc26c('0x3c')+_0x56d73a};io['to'](util[_0xc26c('0x28')](_0xc26c('0x3d'),_0x3d02f9))[_0xc26c('0x3e')](_0xc26c('0x3f'),_0x1db30e);}exports['cs']=function(_0x1f14ab,_0x363e2d,_0x5a9046,_0x23aa33,_0x3b27e5,_0x1d9caf,_0x525fb9,_0x5a1fb2){var _0x4bcc92={};var _0x1211ad={'Authorization':_0xc26c('0x40')+_0x1d9caf[_0xc26c('0x41')]};_0x1d9caf['remoteUri']=intUtil['stripTrailingSlash'](_0x1d9caf[_0xc26c('0x42')]);_0x1d9caf[_0xc26c('0x43')]=intUtil[_0xc26c('0x44')](_0x1d9caf[_0xc26c('0x43')]);var _0x29289e=_0x1d9caf[_0xc26c('0x42')];_0x4bcc92[_0xc26c('0x21')]=_0x1d9caf[_0xc26c('0x45')];_0x4bcc92[_0xc26c('0x2a')]=_0x5a1fb2[_0xc26c('0x46')]()===_0xc26c('0x47')?_0x363e2d['destcalleridnum']:_0x363e2d[_0xc26c('0x48')];_0x4bcc92['callDirection']=_0x5a1fb2===_0xc26c('0x49')||_0x5a1fb2==='unmanaged'?'queue':_0xc26c('0x47');if(_0x23aa33){_0x4bcc92[_0xc26c('0x1b')]=_0x23aa33[_0xc26c('0x11')];}var _0x241516=util['format'](_0xc26c('0x4a'),_0x1d9caf[_0xc26c('0x43')],_0x363e2d[_0xc26c('0x4b')],md5(_0x363e2d[_0xc26c('0x4b')]));if(_0x3b27e5&&_0x3b27e5[_0xc26c('0x4c')]){logger[_0xc26c('0xd')](_0xc26c('0x4d'),'Recording\x20is\x20enabled!');_0x363e2d['recordingURL']=_0x241516;}else if(_0x525fb9&&_0x525fb9[_0xc26c('0x4e')]&&_0x525fb9[_0xc26c('0x4e')]!==_0xc26c('0x4f')){logger['info'](_0xc26c('0x50'),'Recording\x20is\x20enabled!');_0x363e2d[_0xc26c('0x51')]=_0x241516;}else{_0x363e2d[_0xc26c('0x51')]='';}return getAdminId(_0x4bcc92,_0x5a1fb2,_0x1211ad,_0x29289e)['then'](getUser(_0x5a1fb2,_0x1211ad,_0x29289e))[_0xc26c('0xf')](getEndUser(_0x5a1fb2,_0x1211ad,_0x29289e))['then'](getTicket(_0x5a1fb2,_0x1211ad,_0x29289e,_0x5a9046,_0x363e2d))[_0xc26c('0xf')](function(_0x5a33aa){logger[_0xc26c('0xd')](util[_0xc26c('0x28')](_0xc26c('0x52'),_0x5a33aa[_0xc26c('0x3b')]));if(_0x5a1fb2!==_0xc26c('0x53')){logger[_0xc26c('0xd')]('['+[_0x5a1fb2[_0xc26c('0x16')]()]+']',_0xc26c('0x54'));emit(_0x29289e,_0x23aa33[_0xc26c('0x55')],_0x5a33aa['endUserId']);}})['catch'](function(_0x2383fe){logger[_0xc26c('0x22')]('['+[_0x5a1fb2[_0xc26c('0x16')]()]+_0xc26c('0x56'),util[_0xc26c('0x57')](_0x2383fe,{'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 1eec531..a1a3a69 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 _0x6385=['data2','lodash','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','desk','vtiger','dynamics365','freshsales','data1','toLowerCase','find','queue','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','servicenow','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found'];(function(_0x1f5ed2,_0x5b3372){var _0xa36e0=function(_0x355491){while(--_0x355491){_0x1f5ed2['push'](_0x1f5ed2['shift']());}};_0xa36e0(++_0x5b3372);}(_0x6385,0xf9));var _0x5638=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x6385[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0x5638('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x5638('0x1'));var sugarcrm=require(_0x5638('0x2'));var freshdesk=require(_0x5638('0x3'));var zoho=require('./zoho');var desk=require(_0x5638('0x4'));var vtiger=require(_0x5638('0x5'));var servicenow=require(_0x5638('0x6'));var dynamics365=require(_0x5638('0x7'));var freshsales=require('./freshsales');var integrations=[_0x5638('0x8'),'salesforce',_0x5638('0x9'),'freshdesk','zoho',_0x5638('0xa'),_0x5638('0xb'),_0x5638('0xc'),_0x5638('0xd'),'servicenow'];exports['exec']=function(_0x3e9736,_0x1e200f,_0xc6f54a,_0x9dad15,_0x5a22cc,_0x3304f9){if(_0xc6f54a){if(_['includes'](integrations,_0x3e9736[_0x5638('0xe')][_0x5638('0xf')]())){try{var _0x5bf3be=null;var _0x146b54='';var _0x4b16cc=_0xc6f54a[_0x3e9736['data1']['toLowerCase']()];if(_0x4b16cc){var _0xf5af0a=_0x4b16cc[_0x3e9736['data2']];if(_0xf5af0a){var _0x4d81d6=_[_0x5638('0x10')](_0xf5af0a['Configurations'],{'id':parseInt(_0x3e9736['data3'],0xa)});if(_0x4d81d6){if(_0x9dad15){if(_0x5a22cc&&_0x1e200f[_0x5638('0x11')]){_0x146b54='queue';}else if(_0x1e200f['routeId']){_0x146b54=_0x5638('0x12');}else{console['log'](_0x5638('0x13'),_0x1e200f);}}else{_0x146b54=_0x5638('0x14');}switch(_0x3e9736[_0x5638('0xe')][_0x5638('0xf')]()){case _0x5638('0x8'):zendesk[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0x15'):salesforce[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0x9'):sugarcrm[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case'freshdesk':freshdesk[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0x16'):zoho[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case'desk':desk[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0xb'):vtiger[_0x146b54](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9);break;case _0x5638('0xd'):freshsales['cs'](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9,_0x146b54);break;case _0x5638('0x17'):servicenow['cs'](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9,_0x146b54);break;case _0x5638('0xc'):dynamics365['cs'](_0x3e9736,_0x1e200f,_0x4d81d6,_0x9dad15,_0x5a22cc,_0xf5af0a,_0x3304f9,_0x146b54);break;default:console[_0x5638('0x18')](_0x5638('0x19'));}}else{_0x5bf3be=require(_0x5638('0x1a'))(_0x3e9736[_0x5638('0xe')]['toLowerCase']());_0x5bf3be[_0x5638('0x1b')](_0x5638('0x1c'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x3e9736[_0x5638('0xe')][_0x5638('0xf')](),_0x3e9736['data3']));}}else{_0x5bf3be=require(_0x5638('0x1a'))(_0x3e9736[_0x5638('0xe')][_0x5638('0xf')]());_0x5bf3be[_0x5638('0x1b')](_0x5638('0x1c'),util['format'](_0x5638('0x1d'),_0x3e9736[_0x5638('0xe')][_0x5638('0xf')](),_0x3e9736[_0x5638('0x1e')]));}}else{}}catch(_0x2f5a1b){console['error'](_0x2f5a1b);}}}}; \ No newline at end of file +var _0x24b0=['vtiger','dynamics365','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','zoho','log','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./desk','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','desk'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0x24b0,0xc5));var _0x024b=function(_0x2805cd,_0x1ad286){_0x2805cd=_0x2805cd-0x0;var _0x59c059=_0x24b0[_0x2805cd];return _0x59c059;};'use strict';var _=require(_0x024b('0x0'));var util=require(_0x024b('0x1'));var zendesk=require(_0x024b('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x024b('0x3'));var freshdesk=require(_0x024b('0x4'));var zoho=require('./zoho');var desk=require(_0x024b('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x024b('0x6'));var dynamics365=require(_0x024b('0x7'));var freshsales=require(_0x024b('0x8'));var integrations=[_0x024b('0x9'),'salesforce',_0x024b('0xa'),_0x024b('0xb'),'zoho',_0x024b('0xc'),_0x024b('0xd'),_0x024b('0xe'),'freshsales',_0x024b('0xf')];exports[_0x024b('0x10')]=function(_0x1d4157,_0x2697b2,_0x582587,_0x74f837,_0x17d2bd,_0x22cac1){if(_0x582587){if(_['includes'](integrations,_0x1d4157[_0x024b('0x11')]['toLowerCase']())){try{var _0x4aad71=null;var _0x434bdc='';var _0x341dd4=_0x582587[_0x1d4157[_0x024b('0x11')][_0x024b('0x12')]()];if(_0x341dd4){var _0x10e82e=_0x341dd4[_0x1d4157[_0x024b('0x13')]];if(_0x10e82e){var _0x331133=_[_0x024b('0x14')](_0x10e82e[_0x024b('0x15')],{'id':parseInt(_0x1d4157[_0x024b('0x16')],0xa)});if(_0x331133){if(_0x74f837){if(_0x17d2bd&&_0x2697b2[_0x024b('0x17')]){_0x434bdc='queue';}else if(_0x2697b2['routeId']){_0x434bdc=_0x024b('0x18');}else{console['log'](_0x024b('0x19'),_0x2697b2);}}else{_0x434bdc=_0x024b('0x1a');}switch(_0x1d4157[_0x024b('0x11')][_0x024b('0x12')]()){case _0x024b('0x9'):zendesk[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case'salesforce':salesforce[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case _0x024b('0xa'):sugarcrm[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case _0x024b('0xb'):freshdesk[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case _0x024b('0x1b'):zoho[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case _0x024b('0xc'):desk[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case'vtiger':vtiger[_0x434bdc](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1);break;case'freshsales':freshsales['cs'](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1,_0x434bdc);break;case'servicenow':servicenow['cs'](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1,_0x434bdc);break;case _0x024b('0xe'):dynamics365['cs'](_0x1d4157,_0x2697b2,_0x331133,_0x74f837,_0x17d2bd,_0x10e82e,_0x22cac1,_0x434bdc);break;default:console[_0x024b('0x1c')](_0x024b('0x1d'));}}else{_0x4aad71=require(_0x024b('0x1e'))(_0x1d4157[_0x024b('0x11')][_0x024b('0x12')]());_0x4aad71[_0x024b('0x1f')]('[EXEC]',util[_0x024b('0x20')](_0x024b('0x21'),_0x1d4157[_0x024b('0x11')]['toLowerCase'](),_0x1d4157[_0x024b('0x16')]));}}else{_0x4aad71=require('../../../../config/logger')(_0x1d4157[_0x024b('0x11')]['toLowerCase']());_0x4aad71[_0x024b('0x1f')]('[EXEC]',util['format'](_0x024b('0x22'),_0x1d4157[_0x024b('0x11')]['toLowerCase'](),_0x1d4157['data2']));}}else{}}catch(_0x5dbfb4){console[_0x024b('0x1f')](_0x5dbfb4);}}}}; \ 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 f1b2b88..79707e6 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 _0xc8e3=['user:%s','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','none','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','lead','leadId','info','sobject','create','isNil','validateEmail','User','execute','then','length','find','Email','resolve','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','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','first','Name','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','moduleCreate','','format','LastName','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientSecret','login','username','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab'];(function(_0x6ff55a,_0x372355){var _0x205083=function(_0xce1de9){while(--_0xce1de9){_0x6ff55a['push'](_0x6ff55a['shift']());}};_0x205083(++_0x372355);}(_0xc8e3,0x119));var _0x3c8e=function(_0x53e97d,_0x554a9c){_0x53e97d=_0x53e97d-0x0;var _0x5c77f0=_0xc8e3[_0x53e97d];return _0x5c77f0;};'use strict';var _=require('lodash');var rp=require(_0x3c8e('0x0'));var moment=require(_0x3c8e('0x1'));var BPromise=require(_0x3c8e('0x2'));var md5=require(_0x3c8e('0x3'));var jsforce=require(_0x3c8e('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x3c8e('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3c8e('0x6'))(_0x3c8e('0x7'));config[_0x3c8e('0x8')]=_[_0x3c8e('0x9')](config[_0x3c8e('0x8')],{'host':_0x3c8e('0xa'),'port':0x18eb});var io=require(_0x3c8e('0xb'))(new Redis(config[_0x3c8e('0x8')]));function emit(_0x193a43,_0x40a3a5,_0x4eeba3){io['to'](_0x193a43)[_0x3c8e('0xc')](_0x40a3a5,_0x4eeba3);}function getTicket(_0x5e33a3,_0x4a333b,_0x5861b6,_0x449500,_0x1caed5,_0x5324e8,_0xbea958,_0x7660be){var _0x146afd=Object['assign']({},{'OwnerId':_0x4a333b['id'],'Subject':intUtil[_0x3c8e('0xd')](_0x449500['Subjects'],_0x1caed5,'\x20'),'Description':intUtil[_0x3c8e('0xd')](_0x449500['Descriptions'],_0x1caed5,'\x0a')},getCustomFields(_0x5324e8,_0x1caed5));if(_0x5861b6){if(_0x449500['ticketType']===_0x3c8e('0xe')){_0x146afd[_0x3c8e('0xf')]=moment['utc']();_0x146afd[_0x3c8e('0x10')]=![];_0x146afd[_0x3c8e('0x11')]=![];if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x13')||_0x5861b6[_0x3c8e('0x12')]==='lead'){_0x146afd[_0x3c8e('0x14')]=_0x5861b6['id'];}else if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x15')){_0x146afd[_0x3c8e('0x16')]=_0x5861b6['id'];}}else if(_0x449500[_0x3c8e('0x17')]===_0x3c8e('0x18')){if(_0x5861b6[_0x3c8e('0x12')]==='contact'){_0x146afd[_0x3c8e('0x19')]=_0x5861b6['id'];}else if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x15')){_0x146afd[_0x3c8e('0x1a')]=_0x5861b6['id'];}else if(_0x5861b6[_0x3c8e('0x12')]===_0x3c8e('0x1b')&&_0x449500['leadId']){_0x146afd[_0x449500[_0x3c8e('0x1c')]]=_0x5861b6['id'];}else{logger[_0x3c8e('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0xbea958[_0x3c8e('0x1e')](_0x449500[_0x3c8e('0x17')])[_0x3c8e('0x1f')](_0x146afd);}function getUser(_0x30a828,_0x2d824f,_0x49c510){if(!_[_0x3c8e('0x20')](_0x2d824f)&&intUtil[_0x3c8e('0x21')](_0x2d824f)){var _0x287b36={'Email':_0x2d824f};var _0x1105b7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x49c510[_0x3c8e('0x1e')](_0x3c8e('0x22'))['find'](_0x287b36,_0x1105b7)[_0x3c8e('0x23')]()[_0x3c8e('0x24')](function(_0x22702a){if(_0x22702a[_0x3c8e('0x25')]){var _0x2da3c0=_[_0x3c8e('0x26')](_0x22702a,function(_0x29333d){return _0x29333d[_0x3c8e('0x27')]===_0x2d824f;});if(_0x2da3c0){logger[_0x3c8e('0x1d')]('Agent\x20%s\x20found.',_0x2d824f);return BPromise[_0x3c8e('0x28')]({'id':_0x2da3c0['Id'],'name':_0x2da3c0['Name']});}}else{logger[_0x3c8e('0x1d')](_0x3c8e('0x29'),_0x2d824f);return _0x49c510[_0x3c8e('0x2a')]()[_0x3c8e('0x24')](function(_0xfae6af){return BPromise[_0x3c8e('0x28')]({'id':_0xfae6af[_0x3c8e('0x2b')],'name':_0xfae6af[_0x3c8e('0x2c')]});});}});}else{logger[_0x3c8e('0x1d')](_0x3c8e('0x29'),_0x2d824f);return _0x49c510['identity']()[_0x3c8e('0x24')](function(_0x4fcade){return BPromise[_0x3c8e('0x28')]({'id':_0x4fcade['user_id'],'name':_0x4fcade[_0x3c8e('0x2c')]});});}}function getEndUser(_0x322ff2,_0x4b025d,_0x1c321f,_0x197739,_0x242074){var _0x270e53={'$or':{'Phone':_0x197739}};var _0x56f80c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3c8e('0x28')]()[_0x3c8e('0x24')](function(){logger[_0x3c8e('0x1d')](_0x3c8e('0x2d'),_0x197739,_0x4b025d[_0x3c8e('0x2e')]);switch(_0x4b025d[_0x3c8e('0x2e')]){case _0x3c8e('0x2f'):var _0x49e241=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchContact']){var _0x332122={};_0x332122[_0x4b025d[_0x3c8e('0x31')]]=_0x197739;_[_0x3c8e('0x32')](_0x49e241[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')]('Contact')[_0x3c8e('0x26')](_0x49e241,_0x56f80c)['execute']()['then'](function(_0xf2852b){if(_0xf2852b&&_0xf2852b[_0x3c8e('0x25')]){return _0xf2852b;}else{var _0x1a194e=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchLead']){var _0x44eca2={};_0x44eca2[_0x4b025d[_0x3c8e('0x34')]]=_0x197739;_[_0x3c8e('0x32')](_0x1a194e['$or'],_0x44eca2);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x35'))[_0x3c8e('0x26')](_0x1a194e,_0x56f80c);}});case'account_contact_lead':var _0x4dfcfe=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d[_0x3c8e('0x36')]){var _0x332122={};_0x332122[_0x4b025d['additionalSearchAccount']]=_0x197739;_[_0x3c8e('0x32')](_0x4dfcfe[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x37'))[_0x3c8e('0x26')](_0x4dfcfe,_0x56f80c)[_0x3c8e('0x23')]()[_0x3c8e('0x24')](function(_0x137aef){if(_0x137aef&&_0x137aef['length']){return _0x137aef;}else{var _0x5372e9=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchContact']){var _0x14d024={};_0x14d024[_0x4b025d['additionalSearchContact']]=_0x197739;_['merge'](_0x5372e9[_0x3c8e('0x33')],_0x14d024);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x38'))[_0x3c8e('0x26')](_0x5372e9,_0x56f80c)[_0x3c8e('0x24')](function(_0x57a0ff){if(_0x57a0ff&&_0x57a0ff['length']){return _0x57a0ff;}else{var _0x4948da=_['cloneDeep'](_0x270e53);if(_0x4b025d['additionalSearchLead']){var _0x145e33={};_0x145e33[_0x4b025d[_0x3c8e('0x34')]]=_0x197739;_[_0x3c8e('0x32')](_0x4948da[_0x3c8e('0x33')],_0x145e33);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x35'))['find'](_0x4948da,_0x56f80c);}});}});case _0x3c8e('0x13'):var _0x49e241=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d[_0x3c8e('0x31')]){var _0x332122={};_0x332122[_0x4b025d[_0x3c8e('0x31')]]=_0x197739;_['merge'](_0x49e241[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x38'))[_0x3c8e('0x26')](_0x49e241,_0x56f80c)['execute']();case'lead':var _0x9bbae5=_['cloneDeep'](_0x270e53);if(_0x4b025d['additionalSearchLead']){var _0x332122={};_0x332122[_0x4b025d['additionalSearchLead']]=_0x197739;_[_0x3c8e('0x32')](_0x9bbae5[_0x3c8e('0x33')],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x35'))['find'](_0x9bbae5,_0x56f80c);case _0x3c8e('0x15'):var _0x4dfcfe=_[_0x3c8e('0x30')](_0x270e53);if(_0x4b025d['additionalSearchAccount']){var _0x332122={};_0x332122[_0x4b025d['additionalSearchAccount']]=_0x197739;_[_0x3c8e('0x32')](_0x4dfcfe['$or'],_0x332122);}return _0x242074[_0x3c8e('0x1e')](_0x3c8e('0x37'))[_0x3c8e('0x26')](_0x4dfcfe,_0x56f80c);default:return null;}})[_0x3c8e('0x24')](function(_0x7e5026){if(_0x7e5026&&_0x7e5026[_0x3c8e('0x25')]){var _0x18b332=_[_0x3c8e('0x39')](_0x7e5026);if(_0x18b332){return BPromise['resolve']({'id':_0x18b332['Id'],'name':_0x18b332[_0x3c8e('0x3a')],'phone':_0x18b332['Phone'],'endUserType':_0x18b332['attributes'][_0x3c8e('0x3b')][_0x3c8e('0x3c')]()});}}})[_0x3c8e('0x24')](function(_0x1a1eeb){if(_0x1a1eeb){logger[_0x3c8e('0x1d')](_0x3c8e('0x3d'),_0x1a1eeb[_0x3c8e('0x12')],_0x197739);return BPromise[_0x3c8e('0x28')](_0x1a1eeb);}else{logger[_0x3c8e('0x1d')](_0x3c8e('0x3e'),_0x197739);var _0x59a21d={'Phone':_0x197739};if(_0x4b025d['moduleCreate']){if(_0x4b025d['moduleCreate']===_0x3c8e('0x13')){logger[_0x3c8e('0x1d')](_0x3c8e('0x3f'),_0x197739,_0x4b025d[_0x3c8e('0x40')]);_0x59a21d['LastName']=_0x1c321f!==_0x3c8e('0x41')?_0x1c321f:util[_0x3c8e('0x42')]('Caller\x20-\x20%s',_0x197739);}else if(_0x4b025d[_0x3c8e('0x40')]===_0x3c8e('0x1b')){logger[_0x3c8e('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x197739,_0x4b025d[_0x3c8e('0x40')]);_0x59a21d[_0x3c8e('0x43')]=_0x1c321f!==_0x3c8e('0x41')?_0x1c321f:util[_0x3c8e('0x42')](_0x3c8e('0x44'),_0x197739);_0x59a21d[_0x3c8e('0x45')]=_0x3c8e('0x46');}else if(_0x4b025d[_0x3c8e('0x40')]==='account'){logger[_0x3c8e('0x1d')](_0x3c8e('0x3f'),_0x197739,_0x4b025d[_0x3c8e('0x40')]);_0x59a21d[_0x3c8e('0x3a')]=_0x1c321f!==''?_0x1c321f:util[_0x3c8e('0x42')]('Caller\x20-\x20%s',_0x197739);}else{return null;}}return _0x242074[_0x3c8e('0x1e')](_[_0x3c8e('0x47')](_0x4b025d[_0x3c8e('0x40')]))[_0x3c8e('0x1f')](_0x59a21d)[_0x3c8e('0x24')](function(_0x4c110e){return BPromise[_0x3c8e('0x28')]({'id':_0x4c110e['id'],'endUserType':_0x4b025d[_0x3c8e('0x40')]});});}});}function getCustomFields(_0xfda8f1,_0x4d88b3){var _0x1e111d={};if(_0xfda8f1[_0x3c8e('0x25')]>0x0){_[_0x3c8e('0x48')](_0xfda8f1,function(_0x42f282){if(_[_0x3c8e('0x49')]([_0x3c8e('0x4a'),_0x3c8e('0x4b')],_0x42f282['type'])&&_0x42f282[_0x3c8e('0x4c')]){_0x1e111d[_0x42f282[_0x3c8e('0x4c')]]=_0x42f282[_0x3c8e('0x4d')][_0x3c8e('0x4e')]();}else if(_0x42f282['type']==='variable'&&_0x42f282[_0x3c8e('0x4f')]&&_0x42f282['idField']){_0x4d88b3[_0x42f282['variableName']]&&(_0x1e111d[_0x42f282['idField']]=_0x4d88b3[_0x42f282[_0x3c8e('0x4f')]][_0x3c8e('0x4e')]());}else if(_0x42f282[_0x3c8e('0x3b')]===_0x3c8e('0x50')&&_0x42f282[_0x3c8e('0x51')]&&_0x42f282[_0x3c8e('0x51')]['name']&&_0x42f282[_0x3c8e('0x4c')]){_0x4d88b3[_0x42f282[_0x3c8e('0x51')][_0x3c8e('0x52')][_0x3c8e('0x3c')]()]&&(_0x1e111d[_0x42f282[_0x3c8e('0x4c')]]=_0x4d88b3[_0x42f282[_0x3c8e('0x51')]['name'][_0x3c8e('0x3c')]()][_0x3c8e('0x4e')]());}});}return _0x1e111d;}function getConnection(_0x5b4ffb){var _0x163471=_0x5b4ffb[_0x3c8e('0x53')][_0x3c8e('0x54')](_0x5b4ffb[_0x3c8e('0x55')]);var _0xdd6bc5=new jsforce[(_0x3c8e('0x56'))]({'oauth2':{'loginUrl':_0x5b4ffb['remoteUri']||_0x3c8e('0x57'),'clientId':_0x5b4ffb['clientId'],'clientSecret':_0x5b4ffb[_0x3c8e('0x58')]}});return _0xdd6bc5[_0x3c8e('0x59')](_0x5b4ffb[_0x3c8e('0x5a')],_0x163471)[_0x3c8e('0x24')](function(){logger[_0x3c8e('0x1d')]('Connection\x20established.');return _0xdd6bc5;});}exports['queue']=function(_0x57d6b1,_0x18314a,_0x4cafbc,_0x52461c,_0x278364,_0x120073){var _0x210d25,_0x2038ac,_0x507eb2,_0x57370e;_0x120073[_0x3c8e('0x5b')]=intUtil[_0x3c8e('0x5c')](_0x120073['serverUrl']);_0x120073[_0x3c8e('0x5d')]=intUtil[_0x3c8e('0x5c')](_0x120073[_0x3c8e('0x5d')]);if(_0x278364&&_0x278364[_0x3c8e('0x5e')]){logger[_0x3c8e('0x1d')](_0x3c8e('0x5f'),_0x3c8e('0x60'));_0x18314a[_0x3c8e('0x61')]=util[_0x3c8e('0x42')](_0x3c8e('0x62'),_0x120073[_0x3c8e('0x5b')],_0x18314a['uniqueid'],md5(_0x18314a[_0x3c8e('0x63')]));}else{_0x18314a[_0x3c8e('0x61')]='';}return getConnection(_0x120073)[_0x3c8e('0x24')](function(_0x4f5a8e){_0x57370e=_0x4f5a8e;return getUser(_0x120073,_0x52461c[_0x3c8e('0x64')],_0x57370e);})[_0x3c8e('0x24')](function(_0x2932fe){_0x210d25=_0x2932fe;return getEndUser(_0x120073,_0x4cafbc,_0x18314a[_0x3c8e('0x65')],_0x18314a['calleridnum'],_0x57370e);})[_0x3c8e('0x24')](function(_0xe995e2){_0x2038ac=_0xe995e2;return getTicket(_0x120073,_0x210d25,_0x2038ac,_0x4cafbc,_0x18314a,_0x4cafbc['Fields'],_0x57370e,_0x3c8e('0x66'));})[_0x3c8e('0x24')](function(_0x1542c6){_0x507eb2=_0x1542c6;logger[_0x3c8e('0x1d')](_0x3c8e('0x67'),_0x507eb2['id']);logger[_0x3c8e('0x1d')](_0x3c8e('0x68'),_0x507eb2['id'],_0x52461c[_0x3c8e('0x52')],_0x120073[_0x3c8e('0x3b')]);switch(_0x120073[_0x3c8e('0x3b')]){case _0x3c8e('0x69'):emit(util['format'](_0x3c8e('0x6a'),_0x52461c[_0x3c8e('0x52')]),_0x3c8e('0x6b'),{'recordId':_0x507eb2['id']});break;case'newTab':emit(util[_0x3c8e('0x42')](_0x3c8e('0x6a'),_0x52461c[_0x3c8e('0x52')]),_0x3c8e('0x6c'),{'uri':util[_0x3c8e('0x42')]('%s/%s/e',_0x57370e[_0x3c8e('0x6d')],_0x507eb2['id'])});break;default:logger[_0x3c8e('0x6e')](_0x3c8e('0x6f'));}})[_0x3c8e('0x70')](function(_0x12f575){logger[_0x3c8e('0x6e')](_0x3c8e('0x5f'),_0x12f575);});};exports[_0x3c8e('0x71')]=function(_0x3a1ae,_0x3275be,_0x4dd64b,_0x2be099,_0x14b117,_0xfa5e38,_0xe1d56){var _0x461d76,_0x13f98c,_0x42d1be,_0x2e2737;_0xfa5e38[_0x3c8e('0x5b')]=intUtil[_0x3c8e('0x5c')](_0xfa5e38[_0x3c8e('0x5b')]);_0xfa5e38['remoteUri']=intUtil[_0x3c8e('0x5c')](_0xfa5e38[_0x3c8e('0x5d')]);if(_0xe1d56&&_0xe1d56['recordingFormat']&&_0xe1d56['recordingFormat']!==_0x3c8e('0x72')){logger[_0x3c8e('0x1d')]('[OUTBOUND]',_0x3c8e('0x60'));_0x3275be[_0x3c8e('0x61')]=util['format'](_0x3c8e('0x62'),_0xfa5e38[_0x3c8e('0x5b')],_0x3275be[_0x3c8e('0x63')],md5(_0x3275be[_0x3c8e('0x63')]));}return getConnection(_0xfa5e38)[_0x3c8e('0x24')](function(_0x47b3cc){_0x2e2737=_0x47b3cc;return getUser(_0xfa5e38,_0x2be099[_0x3c8e('0x64')],_0x2e2737);})[_0x3c8e('0x24')](function(_0x27528d){_0x461d76=_0x27528d;return getEndUser(_0xfa5e38,_0x4dd64b,_0x3275be[_0x3c8e('0x73')],_0x3275be[_0x3c8e('0x74')],_0x2e2737);})[_0x3c8e('0x24')](function(_0x4d4bf4){_0x13f98c=_0x4d4bf4;return getTicket(_0xfa5e38,_0x461d76,_0x13f98c,_0x4dd64b,_0x3275be,_0x4dd64b[_0x3c8e('0x75')],_0x2e2737,_0x3c8e('0x71'));})['then'](function(_0x53d1a3){_0x42d1be=_0x53d1a3;logger[_0x3c8e('0x1d')](_0x3c8e('0x76'),_0x42d1be['id']);logger[_0x3c8e('0x1d')](_0x3c8e('0x77'),_0x42d1be['id'],_0x2be099[_0x3c8e('0x52')],_0xfa5e38[_0x3c8e('0x3b')]);switch(_0xfa5e38['type']){case _0x3c8e('0x69'):emit(util['format'](_0x3c8e('0x6a'),_0x2be099[_0x3c8e('0x52')]),_0x3c8e('0x6b'),{'recordId':_0x42d1be['id']});break;case _0x3c8e('0x78'):emit(util['format']('user:%s',_0x2be099[_0x3c8e('0x52')]),_0x3c8e('0x6c'),{'uri':util['format']('%s/%s/e',_0x2e2737[_0x3c8e('0x6d')],_0x42d1be['id'])});break;default:logger['error'](_0x3c8e('0x79'),_0x3c8e('0x7a'));}})[_0x3c8e('0x70')](function(_0x38a545){logger['error'](_0x3c8e('0x79'),_0x38a545);});};exports[_0x3c8e('0x7b')]=function(_0x5deafb,_0x3547af,_0xfe2db6,_0x1c3136,_0x4d64fa,_0x1bbe66){var _0x11ad4a,_0x32a63d,_0x4383c3,_0x5966c3;_0x1bbe66['serverUrl']=intUtil[_0x3c8e('0x5c')](_0x1bbe66[_0x3c8e('0x5b')]);_0x1bbe66[_0x3c8e('0x5d')]=intUtil[_0x3c8e('0x5c')](_0x1bbe66[_0x3c8e('0x5d')]);if(_0x4d64fa&&_0x4d64fa[_0x3c8e('0x5e')]){logger[_0x3c8e('0x1d')]('['+_0x3547af[_0x3c8e('0x7c')][_0x3c8e('0x7d')]()+']',_0x3c8e('0x60'));_0x3547af[_0x3c8e('0x61')]=util[_0x3c8e('0x42')](_0x3c8e('0x62'),_0x1bbe66['serverUrl'],_0x3547af['uniqueid'],md5(_0x3547af[_0x3c8e('0x63')]));}else{_0x3547af[_0x3c8e('0x61')]='';}return getConnection(_0x1bbe66)[_0x3c8e('0x24')](function(_0x484b45){_0x5966c3=_0x484b45;if(!_[_0x3c8e('0x20')](_0x1c3136)){return getUser(_0x1bbe66,_0x1c3136[_0x3c8e('0x52')],_0x5966c3);}else{return getUser(_0x1bbe66,null,_0x5966c3);}})[_0x3c8e('0x24')](function(_0x1fd946){_0x11ad4a=_0x1fd946;return getEndUser(_0x1bbe66,_0xfe2db6,_0x3547af['calleridname'],_0x3547af[_0x3c8e('0x7e')],_0x5966c3);})['then'](function(_0xfde9a0){_0x32a63d=_0xfde9a0;return getTicket(_0x1bbe66,_0x11ad4a,_0x32a63d,_0xfe2db6,_0x3547af,_0xfe2db6[_0x3c8e('0x75')],_0x5966c3);})[_0x3c8e('0x24')](function(_0x21e914){_0x4383c3=_0x21e914;logger['info']('['+_0x3547af['lastevent'][_0x3c8e('0x7d')]()+_0x3c8e('0x7f'),_0x4383c3['id']);logger[_0x3c8e('0x1d')]('['+_0x3547af[_0x3c8e('0x7c')]['toUpperCase']()+_0x3c8e('0x80'),_0x1bbe66['type']);})[_0x3c8e('0x70')](function(_0x58805b){logger[_0x3c8e('0x6e')]('['+_0x3547af['lastevent'][_0x3c8e('0x7d')]()+']',_0x58805b);});}; \ No newline at end of file +var _0x699e=['attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','LastName','Company','','forEach','includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridname','calleridnum','Fields',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','emit','assign','getString','Subjects','Descriptions','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','length','Agent\x20%s\x20found.','resolve','Name','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','Contact','cloneDeep','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone'];(function(_0x2b3c44,_0x2eddf3){var _0x389ed9=function(_0x2d3695){while(--_0x2d3695){_0x2b3c44['push'](_0x2b3c44['shift']());}};_0x389ed9(++_0x2eddf3);}(_0x699e,0xc0));var _0xe699=function(_0x2f1f7a,_0x5c3558){_0x2f1f7a=_0x2f1f7a-0x0;var _0x45b40a=_0x699e[_0x2f1f7a];return _0x45b40a;};'use strict';var _=require(_0xe699('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe699('0x1'));var md5=require(_0xe699('0x2'));var jsforce=require(_0xe699('0x3'));var util=require(_0xe699('0x4'));var Redis=require(_0xe699('0x5'));var intUtil=require(_0xe699('0x6'));var config=require(_0xe699('0x7'));var logger=require(_0xe699('0x8'))('salesforce');config[_0xe699('0x9')]=_['defaults'](config[_0xe699('0x9')],{'host':_0xe699('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe699('0x9')]));function emit(_0xaedeab,_0x1fc506,_0x452fc4){io['to'](_0xaedeab)[_0xe699('0xb')](_0x1fc506,_0x452fc4);}function getTicket(_0x12ce73,_0x1dfd8f,_0x300652,_0x2f6fdf,_0xf83543,_0x1d8c56,_0x237378,_0x1f7c21){var _0x3f677c=Object[_0xe699('0xc')]({},{'OwnerId':_0x1dfd8f['id'],'Subject':intUtil[_0xe699('0xd')](_0x2f6fdf[_0xe699('0xe')],_0xf83543,'\x20'),'Description':intUtil['getString'](_0x2f6fdf[_0xe699('0xf')],_0xf83543,'\x0a')},getCustomFields(_0x1d8c56,_0xf83543));if(_0x300652){if(_0x2f6fdf['ticketType']==='Task'){_0x3f677c['ActivityDate']=moment[_0xe699('0x10')]();_0x3f677c[_0xe699('0x11')]=![];_0x3f677c[_0xe699('0x12')]=![];if(_0x300652[_0xe699('0x13')]===_0xe699('0x14')||_0x300652[_0xe699('0x13')]===_0xe699('0x15')){_0x3f677c[_0xe699('0x16')]=_0x300652['id'];}else if(_0x300652[_0xe699('0x13')]===_0xe699('0x17')){_0x3f677c['WhatId']=_0x300652['id'];}}else if(_0x2f6fdf[_0xe699('0x18')]===_0xe699('0x19')){if(_0x300652['endUserType']===_0xe699('0x14')){_0x3f677c[_0xe699('0x1a')]=_0x300652['id'];}else if(_0x300652[_0xe699('0x13')]===_0xe699('0x17')){_0x3f677c[_0xe699('0x1b')]=_0x300652['id'];}else if(_0x300652[_0xe699('0x13')]===_0xe699('0x15')&&_0x2f6fdf[_0xe699('0x1c')]){_0x3f677c[_0x2f6fdf[_0xe699('0x1c')]]=_0x300652['id'];}else{logger[_0xe699('0x1d')](_0xe699('0x1e'));}}}return _0x237378[_0xe699('0x1f')](_0x2f6fdf[_0xe699('0x18')])[_0xe699('0x20')](_0x3f677c);}function getUser(_0x1c7d0a,_0x5f4e35,_0x5166d4){if(!_[_0xe699('0x21')](_0x5f4e35)&&intUtil[_0xe699('0x22')](_0x5f4e35)){var _0x2319a6={'Email':_0x5f4e35};var _0x32c4aa={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5166d4['sobject']('User')[_0xe699('0x23')](_0x2319a6,_0x32c4aa)[_0xe699('0x24')]()['then'](function(_0xa6585b){if(_0xa6585b[_0xe699('0x25')]){var _0x52da07=_[_0xe699('0x23')](_0xa6585b,function(_0x103d56){return _0x103d56['Email']===_0x5f4e35;});if(_0x52da07){logger[_0xe699('0x1d')](_0xe699('0x26'),_0x5f4e35);return BPromise[_0xe699('0x27')]({'id':_0x52da07['Id'],'name':_0x52da07[_0xe699('0x28')]});}}else{logger[_0xe699('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5f4e35);return _0x5166d4[_0xe699('0x29')]()[_0xe699('0x2a')](function(_0x5b2b25){return BPromise['resolve']({'id':_0x5b2b25[_0xe699('0x2b')],'name':_0x5b2b25[_0xe699('0x2c')]});});}});}else{logger[_0xe699('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5f4e35);return _0x5166d4[_0xe699('0x29')]()[_0xe699('0x2a')](function(_0xc2596b){return BPromise[_0xe699('0x27')]({'id':_0xc2596b[_0xe699('0x2b')],'name':_0xc2596b[_0xe699('0x2c')]});});}}function getEndUser(_0x2cd2b5,_0x1d75f1,_0x3d40eb,_0x303d76,_0x2dfc2d){var _0x23e809={'$or':{'Phone':_0x303d76}};var _0x3e4750={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger['info'](_0xe699('0x2d'),_0x303d76,_0x1d75f1[_0xe699('0x2e')]);switch(_0x1d75f1[_0xe699('0x2e')]){case _0xe699('0x2f'):var _0x4d8ca1=_['cloneDeep'](_0x23e809);if(_0x1d75f1[_0xe699('0x30')]){var _0x245869={};_0x245869[_0x1d75f1[_0xe699('0x30')]]=_0x303d76;_[_0xe699('0x31')](_0x4d8ca1['$or'],_0x245869);}return _0x2dfc2d['sobject'](_0xe699('0x32'))[_0xe699('0x23')](_0x4d8ca1,_0x3e4750)[_0xe699('0x24')]()['then'](function(_0x16b7aa){if(_0x16b7aa&&_0x16b7aa[_0xe699('0x25')]){return _0x16b7aa;}else{var _0x53f3c3=_[_0xe699('0x33')](_0x23e809);if(_0x1d75f1[_0xe699('0x34')]){var _0x4a63fb={};_0x4a63fb[_0x1d75f1[_0xe699('0x34')]]=_0x303d76;_[_0xe699('0x31')](_0x53f3c3[_0xe699('0x35')],_0x4a63fb);}return _0x2dfc2d['sobject'](_0xe699('0x36'))['find'](_0x53f3c3,_0x3e4750);}});case _0xe699('0x37'):var _0x380541=_['cloneDeep'](_0x23e809);if(_0x1d75f1['additionalSearchAccount']){var _0x245869={};_0x245869[_0x1d75f1[_0xe699('0x38')]]=_0x303d76;_['merge'](_0x380541[_0xe699('0x35')],_0x245869);}return _0x2dfc2d[_0xe699('0x1f')](_0xe699('0x39'))[_0xe699('0x23')](_0x380541,_0x3e4750)[_0xe699('0x24')]()[_0xe699('0x2a')](function(_0x3aa14d){if(_0x3aa14d&&_0x3aa14d[_0xe699('0x25')]){return _0x3aa14d;}else{var _0x463f95=_[_0xe699('0x33')](_0x23e809);if(_0x1d75f1[_0xe699('0x30')]){var _0x2195c3={};_0x2195c3[_0x1d75f1[_0xe699('0x30')]]=_0x303d76;_[_0xe699('0x31')](_0x463f95['$or'],_0x2195c3);}return _0x2dfc2d[_0xe699('0x1f')](_0xe699('0x32'))[_0xe699('0x23')](_0x463f95,_0x3e4750)[_0xe699('0x2a')](function(_0x49984d){if(_0x49984d&&_0x49984d[_0xe699('0x25')]){return _0x49984d;}else{var _0x19f09a=_[_0xe699('0x33')](_0x23e809);if(_0x1d75f1[_0xe699('0x34')]){var _0x5e44f6={};_0x5e44f6[_0x1d75f1[_0xe699('0x34')]]=_0x303d76;_[_0xe699('0x31')](_0x19f09a[_0xe699('0x35')],_0x5e44f6);}return _0x2dfc2d[_0xe699('0x1f')](_0xe699('0x36'))['find'](_0x19f09a,_0x3e4750);}});}});case _0xe699('0x14'):var _0x4d8ca1=_[_0xe699('0x33')](_0x23e809);if(_0x1d75f1[_0xe699('0x30')]){var _0x245869={};_0x245869[_0x1d75f1[_0xe699('0x30')]]=_0x303d76;_['merge'](_0x4d8ca1[_0xe699('0x35')],_0x245869);}return _0x2dfc2d[_0xe699('0x1f')]('Contact')[_0xe699('0x23')](_0x4d8ca1,_0x3e4750)['execute']();case'lead':var _0x4586d3=_['cloneDeep'](_0x23e809);if(_0x1d75f1[_0xe699('0x34')]){var _0x245869={};_0x245869[_0x1d75f1[_0xe699('0x34')]]=_0x303d76;_[_0xe699('0x31')](_0x4586d3[_0xe699('0x35')],_0x245869);}return _0x2dfc2d[_0xe699('0x1f')](_0xe699('0x36'))[_0xe699('0x23')](_0x4586d3,_0x3e4750);case'account':var _0x380541=_[_0xe699('0x33')](_0x23e809);if(_0x1d75f1[_0xe699('0x38')]){var _0x245869={};_0x245869[_0x1d75f1[_0xe699('0x38')]]=_0x303d76;_['merge'](_0x380541[_0xe699('0x35')],_0x245869);}return _0x2dfc2d[_0xe699('0x1f')](_0xe699('0x39'))[_0xe699('0x23')](_0x380541,_0x3e4750);default:return null;}})[_0xe699('0x2a')](function(_0x5787ce){if(_0x5787ce&&_0x5787ce[_0xe699('0x25')]){var _0x45c1ff=_[_0xe699('0x3a')](_0x5787ce);if(_0x45c1ff){return BPromise['resolve']({'id':_0x45c1ff['Id'],'name':_0x45c1ff['Name'],'phone':_0x45c1ff[_0xe699('0x3b')],'endUserType':_0x45c1ff[_0xe699('0x3c')]['type'][_0xe699('0x3d')]()});}}})['then'](function(_0xeddc0){if(_0xeddc0){logger['info'](_0xe699('0x3e'),_0xeddc0[_0xe699('0x13')],_0x303d76);return BPromise[_0xe699('0x27')](_0xeddc0);}else{logger[_0xe699('0x1d')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x303d76);var _0xe676cb={'Phone':_0x303d76};if(_0x1d75f1[_0xe699('0x3f')]){if(_0x1d75f1[_0xe699('0x3f')]===_0xe699('0x14')){logger[_0xe699('0x1d')](_0xe699('0x40'),_0x303d76,_0x1d75f1['moduleCreate']);_0xe676cb['LastName']=_0x3d40eb!==''?_0x3d40eb:util[_0xe699('0x41')](_0xe699('0x42'),_0x303d76);}else if(_0x1d75f1[_0xe699('0x3f')]===_0xe699('0x15')){logger[_0xe699('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x303d76,_0x1d75f1['moduleCreate']);_0xe676cb[_0xe699('0x43')]=_0x3d40eb!==''?_0x3d40eb:util['format']('Caller\x20-\x20%s',_0x303d76);_0xe676cb[_0xe699('0x44')]='No\x20Company';}else if(_0x1d75f1[_0xe699('0x3f')]===_0xe699('0x17')){logger[_0xe699('0x1d')](_0xe699('0x40'),_0x303d76,_0x1d75f1['moduleCreate']);_0xe676cb['Name']=_0x3d40eb!==_0xe699('0x45')?_0x3d40eb:util[_0xe699('0x41')](_0xe699('0x42'),_0x303d76);}else{return null;}}return _0x2dfc2d[_0xe699('0x1f')](_['upperFirst'](_0x1d75f1[_0xe699('0x3f')]))[_0xe699('0x20')](_0xe676cb)[_0xe699('0x2a')](function(_0x3e9ae0){return BPromise[_0xe699('0x27')]({'id':_0x3e9ae0['id'],'endUserType':_0x1d75f1[_0xe699('0x3f')]});});}});}function getCustomFields(_0x278129,_0x15723a){var _0x2f29eb={};if(_0x278129[_0xe699('0x25')]>0x0){_[_0xe699('0x46')](_0x278129,function(_0x5eaa5b){if(_[_0xe699('0x47')](['string',_0xe699('0x48')],_0x5eaa5b[_0xe699('0x49')])&&_0x5eaa5b[_0xe699('0x4a')]){_0x2f29eb[_0x5eaa5b[_0xe699('0x4a')]]=_0x5eaa5b['content'][_0xe699('0x4b')]();}else if(_0x5eaa5b[_0xe699('0x49')]===_0xe699('0x4c')&&_0x5eaa5b[_0xe699('0x4d')]&&_0x5eaa5b[_0xe699('0x4a')]){_0x15723a[_0x5eaa5b[_0xe699('0x4d')]]&&(_0x2f29eb[_0x5eaa5b['idField']]=_0x15723a[_0x5eaa5b['variableName']][_0xe699('0x4b')]());}else if(_0x5eaa5b[_0xe699('0x49')]===_0xe699('0x4e')&&_0x5eaa5b[_0xe699('0x4f')]&&_0x5eaa5b[_0xe699('0x4f')][_0xe699('0x50')]&&_0x5eaa5b['idField']){_0x15723a[_0x5eaa5b[_0xe699('0x4f')][_0xe699('0x50')]['toLowerCase']()]&&(_0x2f29eb[_0x5eaa5b['idField']]=_0x15723a[_0x5eaa5b[_0xe699('0x4f')][_0xe699('0x50')]['toLowerCase']()][_0xe699('0x4b')]());}});}return _0x2f29eb;}function getConnection(_0x310169){var _0x3132fc=_0x310169[_0xe699('0x51')][_0xe699('0x52')](_0x310169[_0xe699('0x53')]);var _0x44ce7f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x310169[_0xe699('0x54')]||'https://login.salesforce.com','clientId':_0x310169[_0xe699('0x55')],'clientSecret':_0x310169[_0xe699('0x56')]}});return _0x44ce7f[_0xe699('0x57')](_0x310169[_0xe699('0x58')],_0x3132fc)[_0xe699('0x2a')](function(){logger[_0xe699('0x1d')](_0xe699('0x59'));return _0x44ce7f;});}exports['queue']=function(_0x720d31,_0x5bf6e5,_0x4c875a,_0x26e718,_0x361da8,_0x48222f){var _0x40189f,_0x41a253,_0x2a358a,_0x57d1dc;_0x48222f[_0xe699('0x5a')]=intUtil[_0xe699('0x5b')](_0x48222f[_0xe699('0x5a')]);_0x48222f[_0xe699('0x54')]=intUtil[_0xe699('0x5b')](_0x48222f[_0xe699('0x54')]);if(_0x361da8&&_0x361da8[_0xe699('0x5c')]){logger['info'](_0xe699('0x5d'),_0xe699('0x5e'));_0x5bf6e5[_0xe699('0x5f')]=util[_0xe699('0x41')](_0xe699('0x60'),_0x48222f[_0xe699('0x5a')],_0x5bf6e5[_0xe699('0x61')],md5(_0x5bf6e5['uniqueid']));}else{_0x5bf6e5['recordingURL']='';}return getConnection(_0x48222f)[_0xe699('0x2a')](function(_0x1710b8){_0x57d1dc=_0x1710b8;return getUser(_0x48222f,_0x26e718[_0xe699('0x62')],_0x57d1dc);})[_0xe699('0x2a')](function(_0x382c0c){_0x40189f=_0x382c0c;return getEndUser(_0x48222f,_0x4c875a,_0x5bf6e5['calleridname'],_0x5bf6e5['calleridnum'],_0x57d1dc);})[_0xe699('0x2a')](function(_0x280ca3){_0x41a253=_0x280ca3;return getTicket(_0x48222f,_0x40189f,_0x41a253,_0x4c875a,_0x5bf6e5,_0x4c875a['Fields'],_0x57d1dc,_0xe699('0x63'));})[_0xe699('0x2a')](function(_0x577058){_0x2a358a=_0x577058;logger[_0xe699('0x1d')](_0xe699('0x64'),_0x2a358a['id']);logger[_0xe699('0x1d')](_0xe699('0x65'),_0x2a358a['id'],_0x26e718[_0xe699('0x50')],_0x48222f[_0xe699('0x49')]);switch(_0x48222f[_0xe699('0x49')]){case _0xe699('0x66'):emit(util[_0xe699('0x41')](_0xe699('0x67'),_0x26e718['name']),'trigger:salesforce:display',{'recordId':_0x2a358a['id']});break;case _0xe699('0x68'):emit(util[_0xe699('0x41')](_0xe699('0x67'),_0x26e718[_0xe699('0x50')]),_0xe699('0x69'),{'uri':util['format'](_0xe699('0x6a'),_0x57d1dc['instanceUrl'],_0x2a358a['id'])});break;default:logger[_0xe699('0x6b')](_0xe699('0x6c'));}})['catch'](function(_0x84ba0f){logger[_0xe699('0x6b')](_0xe699('0x5d'),_0x84ba0f);});};exports[_0xe699('0x6d')]=function(_0x1fe980,_0x5c1597,_0x479894,_0x18e1d0,_0x1cdf0b,_0x5791ba,_0x45ad1c){var _0x22f872,_0x10e4d7,_0x4d89a7,_0x12cc74;_0x5791ba[_0xe699('0x5a')]=intUtil['stripTrailingSlash'](_0x5791ba['serverUrl']);_0x5791ba['remoteUri']=intUtil[_0xe699('0x5b')](_0x5791ba[_0xe699('0x54')]);if(_0x45ad1c&&_0x45ad1c[_0xe699('0x6e')]&&_0x45ad1c[_0xe699('0x6e')]!==_0xe699('0x6f')){logger[_0xe699('0x1d')]('[OUTBOUND]',_0xe699('0x5e'));_0x5c1597[_0xe699('0x5f')]=util[_0xe699('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5791ba[_0xe699('0x5a')],_0x5c1597['uniqueid'],md5(_0x5c1597[_0xe699('0x61')]));}return getConnection(_0x5791ba)[_0xe699('0x2a')](function(_0x4684e9){_0x12cc74=_0x4684e9;return getUser(_0x5791ba,_0x18e1d0['email'],_0x12cc74);})[_0xe699('0x2a')](function(_0x3a3bba){_0x22f872=_0x3a3bba;return getEndUser(_0x5791ba,_0x479894,_0x5c1597[_0xe699('0x70')],_0x5c1597[_0xe699('0x71')],_0x12cc74);})[_0xe699('0x2a')](function(_0x47bca5){_0x10e4d7=_0x47bca5;return getTicket(_0x5791ba,_0x22f872,_0x10e4d7,_0x479894,_0x5c1597,_0x479894['Fields'],_0x12cc74,_0xe699('0x6d'));})[_0xe699('0x2a')](function(_0xaea547){_0x4d89a7=_0xaea547;logger[_0xe699('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x4d89a7['id']);logger[_0xe699('0x1d')](_0xe699('0x72'),_0x4d89a7['id'],_0x18e1d0[_0xe699('0x50')],_0x5791ba['type']);switch(_0x5791ba[_0xe699('0x49')]){case _0xe699('0x66'):emit(util[_0xe699('0x41')](_0xe699('0x67'),_0x18e1d0[_0xe699('0x50')]),'trigger:salesforce:display',{'recordId':_0x4d89a7['id']});break;case'newTab':emit(util['format'](_0xe699('0x67'),_0x18e1d0[_0xe699('0x50')]),_0xe699('0x69'),{'uri':util[_0xe699('0x41')]('%s/%s/e',_0x12cc74[_0xe699('0x73')],_0x4d89a7['id'])});break;default:logger[_0xe699('0x6b')](_0xe699('0x74'),_0xe699('0x75'));}})['catch'](function(_0x420fe9){logger[_0xe699('0x6b')](_0xe699('0x74'),_0x420fe9);});};exports[_0xe699('0x76')]=function(_0x2615a5,_0x65d773,_0x552050,_0x744c8a,_0x4704e9,_0xa1b5c0){var _0xa41bcb,_0x22b6f2,_0x1833d2,_0x468127;_0xa1b5c0[_0xe699('0x5a')]=intUtil['stripTrailingSlash'](_0xa1b5c0[_0xe699('0x5a')]);_0xa1b5c0[_0xe699('0x54')]=intUtil[_0xe699('0x5b')](_0xa1b5c0[_0xe699('0x54')]);if(_0x4704e9&&_0x4704e9[_0xe699('0x5c')]){logger['info']('['+_0x65d773[_0xe699('0x77')][_0xe699('0x78')]()+']',_0xe699('0x5e'));_0x65d773[_0xe699('0x5f')]=util[_0xe699('0x41')](_0xe699('0x60'),_0xa1b5c0[_0xe699('0x5a')],_0x65d773[_0xe699('0x61')],md5(_0x65d773[_0xe699('0x61')]));}else{_0x65d773['recordingURL']='';}return getConnection(_0xa1b5c0)[_0xe699('0x2a')](function(_0x1a412c){_0x468127=_0x1a412c;if(!_['isNil'](_0x744c8a)){return getUser(_0xa1b5c0,_0x744c8a['name'],_0x468127);}else{return getUser(_0xa1b5c0,null,_0x468127);}})[_0xe699('0x2a')](function(_0x4a2d77){_0xa41bcb=_0x4a2d77;return getEndUser(_0xa1b5c0,_0x552050,_0x65d773[_0xe699('0x79')],_0x65d773[_0xe699('0x7a')],_0x468127);})['then'](function(_0x2f13b6){_0x22b6f2=_0x2f13b6;return getTicket(_0xa1b5c0,_0xa41bcb,_0x22b6f2,_0x552050,_0x65d773,_0x552050[_0xe699('0x7b')],_0x468127);})[_0xe699('0x2a')](function(_0x5404f1){_0x1833d2=_0x5404f1;logger[_0xe699('0x1d')]('['+_0x65d773['lastevent'][_0xe699('0x78')]()+']\x20Ticket\x20%s\x20created.',_0x1833d2['id']);logger['info']('['+_0x65d773[_0xe699('0x77')][_0xe699('0x78')]()+_0xe699('0x7c'),_0xa1b5c0[_0xe699('0x49')]);})[_0xe699('0x7d')](function(_0x247b41){logger['error']('['+_0x65d773[_0xe699('0x77')][_0xe699('0x78')]()+']',_0x247b41);});}; \ 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 b4b82ad..8a8b48e 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 _0xb0f7=['lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','adminEmail','POST','user','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','nameField','toLowerCase','content','type','idField','customField','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','GET','label_entry','incident','Incident','Incident\x20-\x20','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb0f7,0x6b));var _0x7b0f=function(_0x2a8375,_0x372351){_0x2a8375=_0x2a8375-0x0;var _0x1b9d44=_0xb0f7[_0x2a8375];return _0x1b9d44;};'use strict';var _=require(_0x7b0f('0x0'));var Promise=require(_0x7b0f('0x1'));var rp=require(_0x7b0f('0x2'));var util=require(_0x7b0f('0x3'));var md5=require(_0x7b0f('0x4'));var Redis=require(_0x7b0f('0x5'));var intUtil=require(_0x7b0f('0x6'));var config=require(_0x7b0f('0x7'));var logger=require('../../../../config/logger')(_0x7b0f('0x8'));config[_0x7b0f('0x9')]=_[_0x7b0f('0xa')](config[_0x7b0f('0x9')],{'host':_0x7b0f('0xb'),'port':0x18eb});var io=require(_0x7b0f('0xc'))(new Redis(config[_0x7b0f('0x9')]));function getAdminUser(_0xd4c456,_0x500ba2,_0x56cde9,_0x293294,_0x4b8f77,_0x3455b7){return new Promise(function(_0xa48575,_0x23fe8f){var _0x50484f={'method':'GET','uri':_0x293294+_0x7b0f('0xd')+'&'+_0x4b8f77+'&'+_0x3455b7,'auth':_0x500ba2,'json':!![]};return rp(_0x50484f)['then'](function(_0x104cdf){if(_0x104cdf[_0x7b0f('0xe')][_0x7b0f('0xf')]>0x0){_0x56cde9[_0x7b0f('0x10')]=_0x104cdf[_0x7b0f('0xe')][0x0][_0x7b0f('0x11')];}logger[_0x7b0f('0x12')]('['+[_0xd4c456[_0x7b0f('0x13')]()]+_0x7b0f('0x14'),_0x56cde9);_0xa48575(_0x56cde9);})[_0x7b0f('0x15')](function(_0x4032f5){logger[_0x7b0f('0x16')]('['+[_0xd4c456[_0x7b0f('0x13')]()]+']',_0x4032f5['message']);_0x23fe8f(_0x4032f5['message']);});});}function getUser(_0x2cf4ee,_0x924dd3,_0x105184,_0x2ed27b,_0x327c88){return function(_0x36f3d4){logger[_0x7b0f('0x12')]('['+[_0x2cf4ee['toUpperCase']()]+_0x7b0f('0x17'),_0x36f3d4);return new Promise(function(_0x253fc9,_0x3ca209){if(intUtil[_0x7b0f('0x18')](_0x36f3d4[_0x7b0f('0x19')])){var _0xf4b185={'method':'GET','uri':_0x105184+_0x7b0f('0x1a')+_0x36f3d4[_0x7b0f('0x19')]+'&'+_0x2ed27b+'&'+_0x327c88,'auth':_0x924dd3,'json':!![]};logger['info']('['+[_0x2cf4ee['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0xf4b185);return rp(_0xf4b185)[_0x7b0f('0x1b')](function(_0x3953c7){logger['info']('['+[_0x2cf4ee['toUpperCase']()]+_0x7b0f('0x1c'),_0x3953c7);if(_0x3953c7[_0x7b0f('0xe')][_0x7b0f('0xf')]>0x0&&String(_0x3953c7[_0x7b0f('0xe')][0x0][_0x7b0f('0x1d')])===_0x7b0f('0x1e')){_0x36f3d4[_0x7b0f('0x1f')]=_0x3953c7[_0x7b0f('0xe')][0x0]['sys_id'];}else{_0x36f3d4[_0x7b0f('0x1f')]=_0x36f3d4[_0x7b0f('0x10')];_0x36f3d4[_0x7b0f('0x19')]=_0x36f3d4['adminEmail'];}logger['info']('['+[_0x2cf4ee[_0x7b0f('0x13')]()]+_0x7b0f('0x20'),_0x36f3d4);_0x253fc9(_0x36f3d4);})['catch'](function(_0x4952c){logger[_0x7b0f('0x16')]('['+[_0x2cf4ee[_0x7b0f('0x13')]()]+']',_0x4952c['message']);_0x3ca209(_0x4952c[_0x7b0f('0x21')]);});}else{logger[_0x7b0f('0x12')]('['+[_0x2cf4ee['toUpperCase']()]+_0x7b0f('0x22'));_0x36f3d4[_0x7b0f('0x1f')]=_0x36f3d4[_0x7b0f('0x10')];_0x36f3d4['userEmail']=_0x36f3d4[_0x7b0f('0x23')];_0x253fc9(_0x36f3d4);}});};}function createEndUser(_0x208b5f,_0x456be5,_0x4228a1,_0x3aee6f,_0x1defa6){logger['info']('['+[_0x208b5f['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4228a1);return new Promise(function(_0x516f1a,_0x10dfcf){var _0x392b5f={'method':_0x7b0f('0x24'),'uri':_0x3aee6f+'sys_user?'+_0x1defa6,'body':{'user_name':_0x4228a1['endUserNumber'],'roles':_0x7b0f('0x25'),'first_name':_0x4228a1[_0x7b0f('0x26')],'active':_0x7b0f('0x1e'),'date_format':'System','phone':_0x4228a1[_0x7b0f('0x26')]},'auth':_0x456be5,'json':!![]};return rp(_0x392b5f)[_0x7b0f('0x1b')](function(_0x248d0c){logger[_0x7b0f('0x12')]('['+[_0x208b5f[_0x7b0f('0x13')]()]+_0x7b0f('0x27'),_0x248d0c[_0x7b0f('0xe')]);_0x4228a1['endUserId']=_0x248d0c[_0x7b0f('0xe')][_0x7b0f('0x11')];_0x516f1a(_0x4228a1);})[_0x7b0f('0x15')](function(_0x19fcf7){logger['error']('['+[_0x208b5f[_0x7b0f('0x13')]()]+']',_0x19fcf7[_0x7b0f('0x21')]);_0x10dfcf(_0x19fcf7[_0x7b0f('0x21')]);});});}function getEndUser(_0x12a096,_0x14635d,_0x3ab6bf,_0x2d806c,_0x18d2be){return function(_0xe2027e){logger['info']('['+[_0x12a096[_0x7b0f('0x13')]()]+_0x7b0f('0x28'),_0xe2027e);return new Promise(function(_0x4d2e3a,_0x31ea35){var _0x45b36f={'method':'GET','uri':_0x3ab6bf+'sys_user?sysparm_query=phone%3D'+_0xe2027e[_0x7b0f('0x26')]+'&'+_0x2d806c+'&'+_0x18d2be,'auth':_0x14635d,'json':!![]};return rp(_0x45b36f)[_0x7b0f('0x1b')](function(_0x7b1df2){if(_0x7b1df2['result'][_0x7b0f('0xf')]>0x0){_0xe2027e['endUserId']=_0x7b1df2[_0x7b0f('0xe')][0x0]['sys_id'];logger[_0x7b0f('0x12')]('['+[_0x12a096['toUpperCase']()]+'],\x20getEndUser\x20crm',_0xe2027e);_0x4d2e3a(_0xe2027e);}else{return createEndUser(_0x12a096,_0x14635d,_0xe2027e,_0x3ab6bf,_0x2d806c)[_0x7b0f('0x1b')](function(_0x32ed9c){logger[_0x7b0f('0x12')]('['+[_0x12a096[_0x7b0f('0x13')]()]+_0x7b0f('0x29'),_0x32ed9c);_0x4d2e3a(_0x32ed9c);});}})[_0x7b0f('0x15')](function(_0x2fa014){logger[_0x7b0f('0x16')]('['+[_0x12a096[_0x7b0f('0x13')]()]+']',_0x2fa014[_0x7b0f('0x21')]);_0x31ea35(_0x2fa014[_0x7b0f('0x21')]);});});};}function getCustomFields(_0x3df01b,_0x32931e){var _0x1aa13d={};if(_0x3df01b['length']>0x0){_['forEach'](_0x3df01b,function(_0x5ef0e2){if(_[_0x7b0f('0x2a')]([_0x7b0f('0x2b'),_0x7b0f('0x2c')],_0x5ef0e2['type'])&&_0x5ef0e2[_0x7b0f('0x2d')]&&!_0x5ef0e2['customField']){_0x1aa13d[_0x5ef0e2['nameField'][_0x7b0f('0x2e')]()]=_0x5ef0e2[_0x7b0f('0x2f')]['toString']();}else if(_['includes']([_0x7b0f('0x2b'),_0x7b0f('0x2c')],_0x5ef0e2[_0x7b0f('0x30')])&&_0x5ef0e2[_0x7b0f('0x31')]&&_0x5ef0e2[_0x7b0f('0x32')]){_0x1aa13d[_0x5ef0e2[_0x7b0f('0x31')]['toLowerCase']()]=_0x5ef0e2[_0x7b0f('0x2f')][_0x7b0f('0x33')]();}else if(_0x5ef0e2[_0x7b0f('0x30')]==='variable'&&_0x5ef0e2['variableName']&&_0x5ef0e2[_0x7b0f('0x31')]&&_0x5ef0e2['customField']){_0x1aa13d[_0x5ef0e2[_0x7b0f('0x31')][_0x7b0f('0x2e')]()]=_0x32931e[_0x5ef0e2['variableName']]['toString']();}else if(_0x5ef0e2[_0x7b0f('0x30')]===_0x7b0f('0x34')&&_0x5ef0e2[_0x7b0f('0x35')]&&_0x5ef0e2[_0x7b0f('0x35')][_0x7b0f('0x36')]&&_0x5ef0e2[_0x7b0f('0x31')]&&_0x5ef0e2[_0x7b0f('0x32')]){_0x1aa13d[_0x5ef0e2['idField'][_0x7b0f('0x2e')]()]=_0x32931e[_0x5ef0e2[_0x7b0f('0x35')][_0x7b0f('0x36')][_0x7b0f('0x2e')]()][_0x7b0f('0x33')]();}});}return _0x1aa13d;}function getTicket(_0x83eaab,_0x421d55,_0x4aa614,_0xffbf83,_0x3e503f,_0x4ec65c){return function(_0x2ac258){logger[_0x7b0f('0x12')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+_0x7b0f('0x37'),_0x2ac258);return new Promise(function(_0x3cdd23,_0x562550){var _0x2f150b=_0x83eaab[_0x7b0f('0x2e')]()===_0x7b0f('0x38')?_0x2ac258[_0x7b0f('0x1f')]:_0x2ac258[_0x7b0f('0x39')];var _0x526006={'method':_0x7b0f('0x24'),'uri':_0x4aa614+'incident'+'?'+_0x4ec65c,'body':Object[_0x7b0f('0x3a')]({},{'active':_0x7b0f('0x1e'),'caller_id':_0x2f150b,'assigned_to':_0x2ac258[_0x7b0f('0x1f')],'short_description':intUtil[_0x7b0f('0x3b')](_0xffbf83[_0x7b0f('0x3c')],_0x3e503f,'\x20'),'description':intUtil[_0x7b0f('0x3b')](_0xffbf83[_0x7b0f('0x3d')],_0x3e503f,'\x0a')},getCustomFields(_0xffbf83['Fields'],_0x3e503f)),'auth':_0x421d55,'json':!![]};return rp(_0x526006)[_0x7b0f('0x1b')](function(_0x27f7d4){logger[_0x7b0f('0x12')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+_0x7b0f('0x3e'),_0x27f7d4['result']);_0x2ac258[_0x7b0f('0x3f')]=_0x27f7d4[_0x7b0f('0xe')]['sys_id'];_0x2ac258[_0x7b0f('0x40')]=_0x27f7d4[_0x7b0f('0xe')]['number'];logger[_0x7b0f('0x12')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+_0x7b0f('0x41'),_0x2ac258);_0x3cdd23(_0x2ac258);})['catch'](function(_0x17b4e){logger[_0x7b0f('0x16')]('['+[_0x83eaab[_0x7b0f('0x13')]()]+']',_0x17b4e['message']);_0x562550(_0x17b4e['message']);});});};}function createRemoteTag(_0x561a6f,_0x512bcb,_0x4c1269,_0x346851){return new Promise(function(_0x1a4ff9,_0x5c560d){var _0x49759e={'method':_0x7b0f('0x24'),'uri':_0x4c1269+_0x7b0f('0x42')+'?'+_0x346851,'body':{'short_description':_0x561a6f,'global':!![],'active':!![],'name':_0x561a6f},'auth':_0x512bcb,'json':!![]};return rp(_0x49759e)[_0x7b0f('0x1b')](function(_0x298f3d){var _0x54b4ee=_0x298f3d['result'][_0x7b0f('0x11')];_0x1a4ff9(_0x54b4ee);});});}function getRemoteTag(_0x5cd591,_0x3c437e,_0x3caad9,_0x178e36,_0xd7ab1a){return new Promise(function(_0x1db86a,_0x15c51e){var _0x3b2b20={'method':_0x7b0f('0x43'),'uri':_0x3caad9+_0x7b0f('0x42')+'?sysparm_query=name%3D'+_0x5cd591+'&'+_0x178e36,'auth':_0x3c437e,'json':!![]};return rp(_0x3b2b20)[_0x7b0f('0x1b')](function(_0x2caa1b){if(_0x2caa1b[_0x7b0f('0xe')]['length']>0x0){var _0x360b32=_0x2caa1b[_0x7b0f('0xe')][0x0]['sys_id'];_0x1db86a(_0x360b32);}else{return createRemoteTag(_0x5cd591,_0x3c437e,_0x3caad9,_0x178e36)['then'](function(_0x349ef1){_0x1db86a(_0x349ef1);});}});});}function assignTagToIncident(_0x17acb4,_0x560725,_0x420c95,_0x17659e,_0x209d8c){return new Promise(function(_0x4d8924,_0x5c01cb){var _0xba1452={'method':_0x7b0f('0x24'),'uri':_0x420c95+_0x7b0f('0x44')+'?'+_0x209d8c,'body':{'label':_0x17acb4,'table':_0x7b0f('0x45'),'id_type':_0x7b0f('0x46'),'table_key':_0x17659e[_0x7b0f('0x3f')],'title':_0x7b0f('0x47')+_0x17659e[_0x7b0f('0x40')],'id_display':_0x17659e[_0x7b0f('0x40')]},'auth':_0x560725,'json':!![]};return rp(_0xba1452)['then'](function(_0x3b1c12){_0x4d8924();})[_0x7b0f('0x15')](function(){_0x4d8924();});});}function manageTags(_0x15b817,_0x329603,_0x5d28bc,_0x3363f7,_0x8236c2,_0x449622,_0x2657c7){return new Promise(function(_0x3a9a45,_0x4c6503){var _0x4739eb=[];_0x329603[_0x7b0f('0x48')](function(_0x2229ee){_0x4739eb[_0x7b0f('0x49')](getRemoteTag(_0x2229ee,_0x5d28bc,_0x3363f7,_0x449622,_0x2657c7));});return Promise['all'](_0x4739eb)[_0x7b0f('0x1b')](function(_0x3c6636){if(_0x3c6636['length']){logger[_0x7b0f('0x12')]('['+[_0x15b817[_0x7b0f('0x13')]()]+_0x7b0f('0x4a'),_0x3c6636);var _0x51b660=[];_0x3c6636[_0x7b0f('0x48')](function(_0x1af258){_0x51b660[_0x7b0f('0x49')](assignTagToIncident(_0x1af258,_0x5d28bc,_0x3363f7,_0x8236c2,_0x449622));});return Promise[_0x7b0f('0x4b')](_0x51b660)['then'](function(){_0x3a9a45();})['catch'](function(){_0x3a9a45();});}else{_0x3a9a45();}});});}function getTags(_0x13bfa1,_0x1ae99b,_0x55cc75,_0x554d6a,_0x2f68c0,_0x7da28b){return function(_0x184a88){return new Promise(function(_0x2645cc,_0x470c3b){var _0x66cd8=[];var _0x16c5db=_0x554d6a['Tags'];if(_0x16c5db&&_0x16c5db[_0x7b0f('0xf')]>0x0){_0x66cd8=_[_0x7b0f('0x4c')](_0x16c5db,_0x7b0f('0x36'));}if(_0x66cd8['length']>0x0){return manageTags(_0x13bfa1,_0x66cd8,_0x1ae99b,_0x55cc75,_0x184a88,_0x2f68c0,_0x7da28b)[_0x7b0f('0x1b')](function(){_0x2645cc(_0x184a88);});}else{_0x2645cc(_0x184a88);}});};}function emit(_0x20afc4,_0x4605c3,_0x31cf54){var _0x2cdae7=_0x7b0f('0x4d')+_0x7b0f('0x4e')+_0x7b0f('0x4f')+_0x7b0f('0x50');var _0x542957={'uri':_0x20afc4+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x31cf54+_0x2cdae7};io['to'](util[_0x7b0f('0x51')](_0x7b0f('0x52'),_0x4605c3))[_0x7b0f('0x53')](_0x7b0f('0x54'),_0x542957);}exports['cs']=function(_0x301349,_0x1fd360,_0x4cb9f9,_0x14bdca,_0x20b265,_0x568467,_0x265eef,_0x26efa1){var _0x11bb9e={};var _0x172f68={'user':_0x568467[_0x7b0f('0x55')],'pass':_0x568467['password']};var _0xf5902b='sysparm_limit=1';var _0x355eb7=_0x7b0f('0x56');_0x568467[_0x7b0f('0x57')]=intUtil['stripTrailingSlash'](_0x568467['remoteUri']);_0x568467[_0x7b0f('0x58')]=intUtil['stripTrailingSlash'](_0x568467[_0x7b0f('0x58')]);var _0x5b8798=util['format'](_0x7b0f('0x59'),_0x568467[_0x7b0f('0x57')]);_0x11bb9e[_0x7b0f('0x19')]=!_[_0x7b0f('0x5a')](_0x14bdca)?_0x14bdca[_0x7b0f('0x5b')]:null;_0x11bb9e[_0x7b0f('0x23')]=_0x568467[_0x7b0f('0x5b')];_0x11bb9e[_0x7b0f('0x26')]=_0x26efa1[_0x7b0f('0x2e')]()==='outbound'?_0x1fd360['destcalleridnum']:_0x1fd360[_0x7b0f('0x5c')];_0x11bb9e[_0x7b0f('0x5d')]=_0x26efa1==='queue'||_0x26efa1===_0x7b0f('0x5e')?_0x7b0f('0x5f'):'outbound';var _0x3367cf=util[_0x7b0f('0x51')](_0x7b0f('0x60'),_0x568467[_0x7b0f('0x58')],_0x1fd360[_0x7b0f('0x61')],md5(_0x1fd360[_0x7b0f('0x61')]));if(_0x20b265&&_0x20b265[_0x7b0f('0x62')]){logger[_0x7b0f('0x12')](_0x7b0f('0x63'),'Recording\x20is\x20enabled!');_0x1fd360[_0x7b0f('0x64')]=_0x3367cf;}else if(_0x265eef&&_0x265eef[_0x7b0f('0x65')]&&_0x265eef[_0x7b0f('0x65')]!==_0x7b0f('0x66')){logger[_0x7b0f('0x12')](_0x7b0f('0x67'),'Recording\x20is\x20enabled!');_0x1fd360[_0x7b0f('0x64')]=_0x3367cf;}else{_0x1fd360['recordingURL']='';}return getAdminUser(_0x26efa1,_0x172f68,_0x11bb9e,_0x5b8798,_0x355eb7,_0xf5902b)[_0x7b0f('0x1b')](getUser(_0x26efa1,_0x172f68,_0x5b8798,_0x355eb7,_0xf5902b))[_0x7b0f('0x1b')](getEndUser(_0x26efa1,_0x172f68,_0x5b8798,_0x355eb7,_0xf5902b))[_0x7b0f('0x1b')](getTicket(_0x26efa1,_0x172f68,_0x5b8798,_0x4cb9f9,_0x1fd360,_0x355eb7))[_0x7b0f('0x1b')](function(_0x4b470a){logger[_0x7b0f('0x12')](util[_0x7b0f('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4b470a[_0x7b0f('0x3f')]));logger[_0x7b0f('0x12')](util[_0x7b0f('0x51')](_0x7b0f('0x68'),_0x26efa1));if(_0x26efa1!==_0x7b0f('0x5e')){logger[_0x7b0f('0x12')]('['+[_0x26efa1[_0x7b0f('0x13')]()]+']',_0x7b0f('0x69'));emit(_0x568467[_0x7b0f('0x57')],_0x14bdca['name'],_0x4b470a['ticketId']);}})['catch'](function(_0x403f22){logger[_0x7b0f('0x16')]('['+[_0x26efa1[_0x7b0f('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x7b0f('0x6a')](_0x403f22,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x951d=['string','picklist','type','nameField','customField','toString','includes','idField','toLowerCase','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','ioredis','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0x951d,0x1ee));var _0xd951=function(_0x4bf83e,_0x429223){_0x4bf83e=_0x4bf83e-0x0;var _0x5647c9=_0x951d[_0x4bf83e];return _0x5647c9;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xd951('0x0'));var util=require(_0xd951('0x1'));var md5=require('md5');var Redis=require(_0xd951('0x2'));var intUtil=require('./util');var config=require(_0xd951('0x3'));var logger=require('../../../../config/logger')(_0xd951('0x4'));config[_0xd951('0x5')]=_[_0xd951('0x6')](config[_0xd951('0x5')],{'host':_0xd951('0x7'),'port':0x18eb});var io=require(_0xd951('0x8'))(new Redis(config[_0xd951('0x5')]));function getAdminUser(_0x3853d3,_0x4f6a6c,_0x295745,_0x5b6f5c,_0x14f54b,_0x1437e9){return new Promise(function(_0xf07e2,_0x11c75c){var _0x200060={'method':_0xd951('0x9'),'uri':_0x5b6f5c+_0xd951('0xa')+'&'+_0x14f54b+'&'+_0x1437e9,'auth':_0x4f6a6c,'json':!![]};return rp(_0x200060)['then'](function(_0x12fe96){if(_0x12fe96[_0xd951('0xb')][_0xd951('0xc')]>0x0){_0x295745[_0xd951('0xd')]=_0x12fe96[_0xd951('0xb')][0x0][_0xd951('0xe')];}logger['info']('['+[_0x3853d3[_0xd951('0xf')]()]+_0xd951('0x10'),_0x295745);_0xf07e2(_0x295745);})[_0xd951('0x11')](function(_0x16eae7){logger[_0xd951('0x12')]('['+[_0x3853d3[_0xd951('0xf')]()]+']',_0x16eae7['message']);_0x11c75c(_0x16eae7[_0xd951('0x13')]);});});}function getUser(_0x1ff620,_0x2f63fc,_0x395b12,_0x52b4d0,_0x595301){return function(_0x249764){logger[_0xd951('0x14')]('['+[_0x1ff620[_0xd951('0xf')]()]+_0xd951('0x15'),_0x249764);return new Promise(function(_0x2e2fde,_0x31d1c4){if(intUtil['validateEmail'](_0x249764['userEmail'])){var _0x3fc219={'method':_0xd951('0x9'),'uri':_0x395b12+'sys_user?sysparm_query=email%3D'+_0x249764[_0xd951('0x16')]+'&'+_0x52b4d0+'&'+_0x595301,'auth':_0x2f63fc,'json':!![]};logger[_0xd951('0x14')]('['+[_0x1ff620[_0xd951('0xf')]()]+_0xd951('0x17'),_0x3fc219);return rp(_0x3fc219)[_0xd951('0x18')](function(_0x1706d4){logger[_0xd951('0x14')]('['+[_0x1ff620[_0xd951('0xf')]()]+_0xd951('0x19'),_0x1706d4);if(_0x1706d4[_0xd951('0xb')][_0xd951('0xc')]>0x0&&String(_0x1706d4['result'][0x0][_0xd951('0x1a')])===_0xd951('0x1b')){_0x249764['userId']=_0x1706d4[_0xd951('0xb')][0x0][_0xd951('0xe')];}else{_0x249764[_0xd951('0x1c')]=_0x249764[_0xd951('0xd')];_0x249764[_0xd951('0x16')]=_0x249764[_0xd951('0x1d')];}logger[_0xd951('0x14')]('['+[_0x1ff620['toUpperCase']()]+_0xd951('0x1e'),_0x249764);_0x2e2fde(_0x249764);})[_0xd951('0x11')](function(_0x3d7e63){logger[_0xd951('0x12')]('['+[_0x1ff620[_0xd951('0xf')]()]+']',_0x3d7e63[_0xd951('0x13')]);_0x31d1c4(_0x3d7e63[_0xd951('0x13')]);});}else{logger[_0xd951('0x14')]('['+[_0x1ff620[_0xd951('0xf')]()]+_0xd951('0x1f'));_0x249764[_0xd951('0x1c')]=_0x249764[_0xd951('0xd')];_0x249764[_0xd951('0x16')]=_0x249764[_0xd951('0x1d')];_0x2e2fde(_0x249764);}});};}function createEndUser(_0x28b816,_0x40e504,_0x188099,_0x2b595d,_0x170d48){logger[_0xd951('0x14')]('['+[_0x28b816['toUpperCase']()]+_0xd951('0x20'),_0x188099);return new Promise(function(_0x5d8625,_0x5c25c5){var _0x4f6e0c={'method':'POST','uri':_0x2b595d+_0xd951('0x21')+_0x170d48,'body':{'user_name':_0x188099[_0xd951('0x22')],'roles':_0xd951('0x23'),'first_name':_0x188099[_0xd951('0x22')],'active':'true','date_format':_0xd951('0x24'),'phone':_0x188099[_0xd951('0x22')]},'auth':_0x40e504,'json':!![]};return rp(_0x4f6e0c)['then'](function(_0x2ac401){logger[_0xd951('0x14')]('['+[_0x28b816[_0xd951('0xf')]()]+_0xd951('0x25'),_0x2ac401[_0xd951('0xb')]);_0x188099['endUserId']=_0x2ac401['result'][_0xd951('0xe')];_0x5d8625(_0x188099);})['catch'](function(_0x532518){logger[_0xd951('0x12')]('['+[_0x28b816['toUpperCase']()]+']',_0x532518[_0xd951('0x13')]);_0x5c25c5(_0x532518[_0xd951('0x13')]);});});}function getEndUser(_0x4af32e,_0x30297c,_0x24fee9,_0x10b65b,_0x373172){return function(_0x567a52){logger[_0xd951('0x14')]('['+[_0x4af32e[_0xd951('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x567a52);return new Promise(function(_0x9c3e00,_0x2a4bc5){var _0x4a0087={'method':_0xd951('0x9'),'uri':_0x24fee9+'sys_user?sysparm_query=phone%3D'+_0x567a52[_0xd951('0x22')]+'&'+_0x10b65b+'&'+_0x373172,'auth':_0x30297c,'json':!![]};return rp(_0x4a0087)[_0xd951('0x18')](function(_0x50589f){if(_0x50589f[_0xd951('0xb')]['length']>0x0){_0x567a52[_0xd951('0x26')]=_0x50589f[_0xd951('0xb')][0x0][_0xd951('0xe')];logger[_0xd951('0x14')]('['+[_0x4af32e['toUpperCase']()]+_0xd951('0x27'),_0x567a52);_0x9c3e00(_0x567a52);}else{return createEndUser(_0x4af32e,_0x30297c,_0x567a52,_0x24fee9,_0x10b65b)[_0xd951('0x18')](function(_0x39ffda){logger['info']('['+[_0x4af32e['toUpperCase']()]+_0xd951('0x28'),_0x39ffda);_0x9c3e00(_0x39ffda);});}})[_0xd951('0x11')](function(_0x5e793e){logger[_0xd951('0x12')]('['+[_0x4af32e['toUpperCase']()]+']',_0x5e793e['message']);_0x2a4bc5(_0x5e793e[_0xd951('0x13')]);});});};}function getCustomFields(_0x13f865,_0x370be6){var _0x2ea321={};if(_0x13f865[_0xd951('0xc')]>0x0){_['forEach'](_0x13f865,function(_0x5d63b7){if(_['includes']([_0xd951('0x29'),_0xd951('0x2a')],_0x5d63b7[_0xd951('0x2b')])&&_0x5d63b7[_0xd951('0x2c')]&&!_0x5d63b7[_0xd951('0x2d')]){_0x2ea321[_0x5d63b7['nameField']['toLowerCase']()]=_0x5d63b7['content'][_0xd951('0x2e')]();}else if(_[_0xd951('0x2f')](['string','picklist'],_0x5d63b7['type'])&&_0x5d63b7[_0xd951('0x30')]&&_0x5d63b7[_0xd951('0x2d')]){_0x2ea321[_0x5d63b7[_0xd951('0x30')][_0xd951('0x31')]()]=_0x5d63b7[_0xd951('0x32')]['toString']();}else if(_0x5d63b7[_0xd951('0x2b')]===_0xd951('0x33')&&_0x5d63b7[_0xd951('0x34')]&&_0x5d63b7[_0xd951('0x30')]&&_0x5d63b7['customField']){_0x2ea321[_0x5d63b7[_0xd951('0x30')][_0xd951('0x31')]()]=_0x370be6[_0x5d63b7[_0xd951('0x34')]][_0xd951('0x2e')]();}else if(_0x5d63b7[_0xd951('0x2b')]===_0xd951('0x35')&&_0x5d63b7['Variable']&&_0x5d63b7[_0xd951('0x36')][_0xd951('0x37')]&&_0x5d63b7[_0xd951('0x30')]&&_0x5d63b7[_0xd951('0x2d')]){_0x2ea321[_0x5d63b7[_0xd951('0x30')][_0xd951('0x31')]()]=_0x370be6[_0x5d63b7[_0xd951('0x36')][_0xd951('0x37')][_0xd951('0x31')]()][_0xd951('0x2e')]();}});}return _0x2ea321;}function getTicket(_0x198ca2,_0x552413,_0x32ce41,_0x28c9cc,_0x2e125b,_0x304b4a){return function(_0x21af51){logger[_0xd951('0x14')]('['+[_0x198ca2[_0xd951('0xf')]()]+_0xd951('0x38'),_0x21af51);return new Promise(function(_0x888c66,_0x14e80b){var _0x300795=_0x198ca2[_0xd951('0x31')]()===_0xd951('0x39')?_0x21af51['userId']:_0x21af51[_0xd951('0x26')];var _0x28dd03={'method':_0xd951('0x3a'),'uri':_0x32ce41+_0xd951('0x3b')+'?'+_0x304b4a,'body':Object['assign']({},{'active':_0xd951('0x1b'),'caller_id':_0x300795,'assigned_to':_0x21af51[_0xd951('0x1c')],'short_description':intUtil[_0xd951('0x3c')](_0x28c9cc[_0xd951('0x3d')],_0x2e125b,'\x20'),'description':intUtil['getString'](_0x28c9cc[_0xd951('0x3e')],_0x2e125b,'\x0a')},getCustomFields(_0x28c9cc[_0xd951('0x3f')],_0x2e125b)),'auth':_0x552413,'json':!![]};return rp(_0x28dd03)[_0xd951('0x18')](function(_0x5f05df){logger[_0xd951('0x14')]('['+[_0x198ca2['toUpperCase']()]+_0xd951('0x40'),_0x5f05df['result']);_0x21af51[_0xd951('0x41')]=_0x5f05df[_0xd951('0xb')][_0xd951('0xe')];_0x21af51['ticketNumber']=_0x5f05df[_0xd951('0xb')]['number'];logger[_0xd951('0x14')]('['+[_0x198ca2[_0xd951('0xf')]()]+']\x20getTicket\x20crm',_0x21af51);_0x888c66(_0x21af51);})['catch'](function(_0x5c22ed){logger[_0xd951('0x12')]('['+[_0x198ca2[_0xd951('0xf')]()]+']',_0x5c22ed[_0xd951('0x13')]);_0x14e80b(_0x5c22ed['message']);});});};}function createRemoteTag(_0x1234f3,_0x3fdf7,_0x1cad05,_0x589be3){return new Promise(function(_0x1dc1c8,_0x2c3906){var _0x331b24={'method':_0xd951('0x3a'),'uri':_0x1cad05+_0xd951('0x42')+'?'+_0x589be3,'body':{'short_description':_0x1234f3,'global':!![],'active':!![],'name':_0x1234f3},'auth':_0x3fdf7,'json':!![]};return rp(_0x331b24)['then'](function(_0x92c0b9){var _0x4c6761=_0x92c0b9[_0xd951('0xb')]['sys_id'];_0x1dc1c8(_0x4c6761);});});}function getRemoteTag(_0x127275,_0x1028db,_0x4fa929,_0x145168,_0x2128ab){return new Promise(function(_0xd3416,_0x234080){var _0xa89bc3={'method':'GET','uri':_0x4fa929+'label'+_0xd951('0x43')+_0x127275+'&'+_0x145168,'auth':_0x1028db,'json':!![]};return rp(_0xa89bc3)[_0xd951('0x18')](function(_0x3dacfb){if(_0x3dacfb['result'][_0xd951('0xc')]>0x0){var _0x3cfd2e=_0x3dacfb[_0xd951('0xb')][0x0][_0xd951('0xe')];_0xd3416(_0x3cfd2e);}else{return createRemoteTag(_0x127275,_0x1028db,_0x4fa929,_0x145168)[_0xd951('0x18')](function(_0x5a38b1){_0xd3416(_0x5a38b1);});}});});}function assignTagToIncident(_0xbde99c,_0x3ee4bb,_0x1e3b69,_0x318a88,_0x383283){return new Promise(function(_0x2edf8c,_0x1c45cd){var _0x547759={'method':'POST','uri':_0x1e3b69+'label_entry'+'?'+_0x383283,'body':{'label':_0xbde99c,'table':'incident','id_type':_0xd951('0x44'),'table_key':_0x318a88['ticketId'],'title':_0xd951('0x45')+_0x318a88[_0xd951('0x46')],'id_display':_0x318a88[_0xd951('0x46')]},'auth':_0x3ee4bb,'json':!![]};return rp(_0x547759)[_0xd951('0x18')](function(_0x5f0258){_0x2edf8c();})[_0xd951('0x11')](function(){_0x2edf8c();});});}function manageTags(_0x11ecd3,_0x5ef49a,_0x7dec28,_0x30a479,_0x3ceaeb,_0x29e408,_0x35e301){return new Promise(function(_0x34833e,_0x4d3602){var _0x564894=[];_0x5ef49a['forEach'](function(_0x320cfb){_0x564894[_0xd951('0x47')](getRemoteTag(_0x320cfb,_0x7dec28,_0x30a479,_0x29e408,_0x35e301));});return Promise[_0xd951('0x48')](_0x564894)[_0xd951('0x18')](function(_0x5329d3){if(_0x5329d3[_0xd951('0xc')]){logger[_0xd951('0x14')]('['+[_0x11ecd3[_0xd951('0xf')]()]+_0xd951('0x49'),_0x5329d3);var _0x2397e5=[];_0x5329d3[_0xd951('0x4a')](function(_0x274623){_0x2397e5[_0xd951('0x47')](assignTagToIncident(_0x274623,_0x7dec28,_0x30a479,_0x3ceaeb,_0x29e408));});return Promise['all'](_0x2397e5)[_0xd951('0x18')](function(){_0x34833e();})[_0xd951('0x11')](function(){_0x34833e();});}else{_0x34833e();}});});}function getTags(_0x22de2d,_0x144dfd,_0x3714b9,_0x1f6a48,_0x4ae30e,_0x5812fa){return function(_0x4488d0){return new Promise(function(_0x36e38b,_0x52fbc9){var _0xc7739b=[];var _0xac4444=_0x1f6a48[_0xd951('0x4b')];if(_0xac4444&&_0xac4444[_0xd951('0xc')]>0x0){_0xc7739b=_[_0xd951('0x4c')](_0xac4444,_0xd951('0x37'));}if(_0xc7739b[_0xd951('0xc')]>0x0){return manageTags(_0x22de2d,_0xc7739b,_0x144dfd,_0x3714b9,_0x4488d0,_0x4ae30e,_0x5812fa)[_0xd951('0x18')](function(){_0x36e38b(_0x4488d0);});}else{_0x36e38b(_0x4488d0);}});};}function emit(_0x16841d,_0x2e28aa,_0x58b604){var _0x4e8be3=_0xd951('0x4d')+_0xd951('0x4e')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x29953c={'uri':_0x16841d+_0xd951('0x4f')+_0x58b604+_0x4e8be3};io['to'](util[_0xd951('0x50')](_0xd951('0x51'),_0x2e28aa))[_0xd951('0x52')](_0xd951('0x53'),_0x29953c);}exports['cs']=function(_0x31adc6,_0x353deb,_0x1a740d,_0x4343e5,_0x2c5d7e,_0x57554b,_0x12dd13,_0x48bbe4){var _0x5497c1={};var _0x45c3ec={'user':_0x57554b['username'],'pass':_0x57554b[_0xd951('0x54')]};var _0x2c8cd4=_0xd951('0x55');var _0x1c369f=_0xd951('0x56');_0x57554b[_0xd951('0x57')]=intUtil[_0xd951('0x58')](_0x57554b[_0xd951('0x57')]);_0x57554b[_0xd951('0x59')]=intUtil[_0xd951('0x58')](_0x57554b[_0xd951('0x59')]);var _0x413f0c=util[_0xd951('0x50')](_0xd951('0x5a'),_0x57554b[_0xd951('0x57')]);_0x5497c1[_0xd951('0x16')]=!_['isNil'](_0x4343e5)?_0x4343e5[_0xd951('0x5b')]:null;_0x5497c1['adminEmail']=_0x57554b[_0xd951('0x5b')];_0x5497c1[_0xd951('0x22')]=_0x48bbe4[_0xd951('0x31')]()===_0xd951('0x39')?_0x353deb['destcalleridnum']:_0x353deb[_0xd951('0x5c')];_0x5497c1['callDirection']=_0x48bbe4===_0xd951('0x5d')||_0x48bbe4===_0xd951('0x5e')?_0xd951('0x5d'):_0xd951('0x39');var _0x1b58d7=util['format'](_0xd951('0x5f'),_0x57554b[_0xd951('0x59')],_0x353deb[_0xd951('0x60')],md5(_0x353deb[_0xd951('0x60')]));if(_0x2c5d7e&&_0x2c5d7e[_0xd951('0x61')]){logger[_0xd951('0x14')](_0xd951('0x62'),'Recording\x20is\x20enabled!');_0x353deb['recordingURL']=_0x1b58d7;}else if(_0x12dd13&&_0x12dd13[_0xd951('0x63')]&&_0x12dd13[_0xd951('0x63')]!==_0xd951('0x64')){logger[_0xd951('0x14')](_0xd951('0x65'),'Recording\x20is\x20enabled!');_0x353deb[_0xd951('0x66')]=_0x1b58d7;}else{_0x353deb['recordingURL']='';}return getAdminUser(_0x48bbe4,_0x45c3ec,_0x5497c1,_0x413f0c,_0x1c369f,_0x2c8cd4)[_0xd951('0x18')](getUser(_0x48bbe4,_0x45c3ec,_0x413f0c,_0x1c369f,_0x2c8cd4))[_0xd951('0x18')](getEndUser(_0x48bbe4,_0x45c3ec,_0x413f0c,_0x1c369f,_0x2c8cd4))[_0xd951('0x18')](getTicket(_0x48bbe4,_0x45c3ec,_0x413f0c,_0x1a740d,_0x353deb,_0x1c369f))['then'](function(_0x2cc879){logger[_0xd951('0x14')](util[_0xd951('0x50')](_0xd951('0x67'),_0x2cc879[_0xd951('0x41')]));logger['info'](util[_0xd951('0x50')]('call\x20direction:\x20%s',_0x48bbe4));if(_0x48bbe4!=='unmanaged'){logger['info']('['+[_0x48bbe4[_0xd951('0xf')]()]+']',_0xd951('0x68'));emit(_0x57554b[_0xd951('0x57')],_0x4343e5[_0xd951('0x37')],_0x2cc879[_0xd951('0x41')]);}})[_0xd951('0x11')](function(_0x56d102){logger[_0xd951('0x12')]('['+[_0x48bbe4[_0xd951('0xf')]()]+_0xd951('0x69'),util[_0xd951('0x6a')](_0x56d102,{'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 27b8c64..b13c89a 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 _0x80ca=['JSON','stringify','format','apiKey','toString','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','uri','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','contacts','charAt','[OUTBOUND]','error','unmanaged','toUpperCase','isNil','Inbound','The\x20Ticket\x20ID\x20is:','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','duration_hours','Contacts','parent_name','length','forEach','variableName','push'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x80ca,0x153));var _0xa80c=function(_0xe9ab7a,_0x53ef34){_0xe9ab7a=_0xe9ab7a-0x0;var _0x14956b=_0x80ca[_0xe9ab7a];return _0x14956b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xa80c('0x0'));var md5=require(_0xa80c('0x1'));var util=require(_0xa80c('0x2'));var Redis=require(_0xa80c('0x3'));var intUtil=require(_0xa80c('0x4'));var config=require(_0xa80c('0x5'));var logger=require(_0xa80c('0x6'))(_0xa80c('0x7'));config[_0xa80c('0x8')]=_[_0xa80c('0x9')](config['redis'],{'host':_0xa80c('0xa'),'port':0x18eb});var io=require(_0xa80c('0xb'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2e44bb,_0xbae1a8,_0x5301e4){io['to'](_0x2e44bb)[_0xa80c('0xc')](_0xbae1a8,_0x5301e4);}function getTicket(_0x2ab8bc,_0x5c266c,_0x10a01f,_0x166ff3,_0x38ac9b,_0x399ed1,_0x10825e,_0x1ab4ea){logger['info'](_0xa80c('0xd'));var _0xfafc25=new Date();var _0x387624=[{'name':_0xa80c('0xe'),'value':intUtil[_0xa80c('0xf')](_0x166ff3[_0xa80c('0x10')],_0x38ac9b,'\x20')},{'name':_0xa80c('0x11'),'value':_0x5c266c['id']},{'name':_0xa80c('0x12'),'value':_0x5c266c['id']},{'name':_0xa80c('0x13'),'value':intUtil[_0xa80c('0xf')](_0x166ff3['Descriptions'],_0x38ac9b,'\x0a')},{'name':_0xa80c('0x14'),'value':_0xfafc25[_0xa80c('0x15')]()[_0xa80c('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':_0xa80c('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x10a01f['id']},{'name':'parent_type','value':_0xa80c('0x18')},{'name':_0xa80c('0x19'),'value':_0x10a01f[_0xa80c('0xe')]},{'name':'direction','value':_0x1ab4ea}];if(_0x399ed1[_0xa80c('0x1a')]){_[_0xa80c('0x1b')](_0x399ed1,function(_0x5f4c30){if(_0x38ac9b[_0x5f4c30[_0xa80c('0x1c')]]){_0x387624[_0xa80c('0x1d')]({'name':_0x5f4c30['idField'],'value':_0x38ac9b[_0x5f4c30[_0xa80c('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x10825e['id'],'module_name':'Calls','name_value_list':_0x387624})}});}function getAuth(_0x5635b1){return util[_0xa80c('0x20')]('Basic\x20%s',new Buffer(_0x5635b1[_0xa80c('0x21')]+':X')[_0xa80c('0x22')]('base64'));}function getServerInfo(_0x4382c8){return request({'form':{'method':'get_server_info','input_type':_0xa80c('0x1e'),'response_type':'JSON','rest_data':JSON[_0xa80c('0x1f')]({'session':_0x4382c8['id']})}});}function getUser(_0x2fdd03,_0x3bc122,_0x247b3b){if(!_['isNil'](_0x3bc122)){logger['info'](_0xa80c('0x23'),_0x3bc122);return request({'form':{'method':_0xa80c('0x24'),'input_type':'JSON','response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x247b3b['id'],'module_name':'Employees','query':util[_0xa80c('0x20')](_0xa80c('0x25'),_0x3bc122),'order_by':'','offset':'0','select_fields':['id','name',_0xa80c('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa80c('0x27')](function(_0x42af46){if(_0x42af46['entry_list'][_0xa80c('0x1a')]){var _0x404b6e=_['find'](_0x42af46[_0xa80c('0x28')],function(_0x5603b2){return _0x5603b2[_0xa80c('0x29')][_0xa80c('0x26')]['value']===_0x3bc122;});if(_0x404b6e){logger[_0xa80c('0x2a')](_0xa80c('0x2b'));return BPromise['resolve']({'id':_0x404b6e[_0xa80c('0x29')]['id']['value'],'name':_0x404b6e['name_value_list'][_0xa80c('0xe')]['value']});}}logger[_0xa80c('0x2a')](_0xa80c('0x2c'));return BPromise['resolve']({'id':_0x247b3b[_0xa80c('0x29')][_0xa80c('0x2d')]['value'],'name':_0x247b3b[_0xa80c('0x29')][_0xa80c('0x26')][_0xa80c('0x2e')]});});}else{logger[_0xa80c('0x2a')](_0xa80c('0x2f'));return BPromise[_0xa80c('0x30')]({'id':_0x247b3b['name_value_list'][_0xa80c('0x2d')][_0xa80c('0x2e')],'name':_0x247b3b[_0xa80c('0x29')]['user_name'][_0xa80c('0x2e')]});}}function getEndUser(_0x291f26,_0x7505d0,_0x1ade3b,_0x249bc8){logger[_0xa80c('0x2a')](_0xa80c('0x31'),_0x1ade3b);return request({'form':{'method':_0xa80c('0x24'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x249bc8['id'],'module_name':_0xa80c('0x18'),'query':util[_0xa80c('0x20')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1ade3b),'order_by':'','offset':'0','select_fields':['id',_0xa80c('0xe'),_0xa80c('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa80c('0x27')](function(_0x2ab2f0){if(_0x2ab2f0[_0xa80c('0x28')][_0xa80c('0x1a')]){var _0x211288=_[_0xa80c('0x33')](_0x2ab2f0[_0xa80c('0x28')],function(_0x15b6ee){return _0x15b6ee['name_value_list']['phone_home']['value']===_0x1ade3b;});if(_0x211288){logger[_0xa80c('0x2a')](_0xa80c('0x34'));return BPromise[_0xa80c('0x30')]({'id':_0x211288[_0xa80c('0x29')]['id'][_0xa80c('0x2e')],'name':_0x211288[_0xa80c('0x29')][_0xa80c('0xe')][_0xa80c('0x2e')],'phone':_0x211288[_0xa80c('0x29')][_0xa80c('0x32')]['value']});}}else{logger[_0xa80c('0x2a')](_0xa80c('0x35'));return request({'form':{'method':_0xa80c('0x36'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x249bc8['id'],'module_name':_0xa80c('0x18'),'name_value_list':[{'name':_0xa80c('0x37'),'value':_0x7505d0!==_0xa80c('0x38')?_0x7505d0:util[_0xa80c('0x20')](_0xa80c('0x39'),_0x1ade3b)},{'name':_0xa80c('0x32'),'value':_0x1ade3b}]})}})['then'](function(_0x2a752c){logger['info']('Enduser\x20created.');return BPromise[_0xa80c('0x30')]({'id':_0x2a752c['id'],'name':_0x2a752c[_0xa80c('0x28')][_0xa80c('0x37')][_0xa80c('0x2e')],'phone':_0x2a752c[_0xa80c('0x28')][_0xa80c('0x32')][_0xa80c('0x2e')]});});}});}function request(_0x410c68){logger[_0xa80c('0x3a')](_0xa80c('0x3b'),JSON[_0xa80c('0x1f')](_0x410c68));return rp(_[_0xa80c('0x3c')](def,_0x410c68));}function getTags(_0x2b9652,_0x564513){var _0x34764d=[];if(_0x2b9652&&_0x2b9652[_0xa80c('0x1a')]>0x0){_0x34764d=_[_0xa80c('0x3d')](_0x2b9652,_0x564513);}return _0x34764d;}function getCustomFields(_0x4cd260,_0x3305f9){var _0x3ab465=[];var _0x135a9a={'custom_fields':[]};if(_0x4cd260[_0xa80c('0x1a')]>0x0){_[_0xa80c('0x1b')](_0x4cd260,function(_0x2ea034){if(_0x2ea034[_0xa80c('0x3e')]===_0xa80c('0x3f')&&_0x2ea034['nameField']&&!_0x2ea034['customField']){_0x135a9a[_0x2ea034[_0xa80c('0x40')][_0xa80c('0x41')]()]=_0x2ea034[_0xa80c('0x42')][_0xa80c('0x22')]();}else if(_0x2ea034[_0xa80c('0x3e')]===_0xa80c('0x3f')&&_0x2ea034[_0xa80c('0x43')]&&_0x2ea034[_0xa80c('0x44')]){_0x135a9a[_0xa80c('0x45')]['push']({'id':_0x2ea034[_0xa80c('0x43')],'value':_0x2ea034[_0xa80c('0x42')]['toString']()});}else if(_0x2ea034[_0xa80c('0x3e')]==='variable'&&_0x2ea034['variableName']&&_0x2ea034['idField']&&_0x2ea034[_0xa80c('0x44')]){_0x3305f9[_0x2ea034[_0xa80c('0x1c')]]&&_0x135a9a[_0xa80c('0x45')][_0xa80c('0x1d')]({'id':_0x2ea034[_0xa80c('0x43')],'value':_0x3305f9[_0x2ea034['variableName']]['toString']()});}else if(_0x2ea034['type']===_0xa80c('0x46')&&_0x2ea034[_0xa80c('0x47')]&&_0x2ea034[_0xa80c('0x47')]['name']&&_0x2ea034[_0xa80c('0x43')]&&_0x2ea034['customField']){_0x3305f9[_0x2ea034['Variable'][_0xa80c('0xe')][_0xa80c('0x41')]()]&&_0x135a9a['custom_fields'][_0xa80c('0x1d')]({'id':_0x2ea034[_0xa80c('0x43')],'value':_0x3305f9[_0x2ea034[_0xa80c('0x47')][_0xa80c('0xe')][_0xa80c('0x41')]()][_0xa80c('0x22')]()});}});}return _0x135a9a;}function getConnection(_0x8f35d7){return request({'method':_0xa80c('0x48'),'form':{'method':_0xa80c('0x49'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x8f35d7[_0xa80c('0x4a')],'password':_0x8f35d7[_0xa80c('0x4b')],'encryption':_0xa80c('0x4c')},'application':_0xa80c('0x4d')})}})['then'](function(_0x52408d){var _0x403e0b=_0x52408d;if(_0x403e0b['id']){def[_0xa80c('0x4e')]=_0x403e0b['id'];return BPromise[_0xa80c('0x30')](_0x403e0b);}else{throw new Error(util[_0xa80c('0x20')](_0xa80c('0x4f'),_0x8f35d7['id']));}});}function setRelationship(_0x3de9c9,_0x544ef1,_0x2f054e,_0x1bdd7b){return request({'form':{'method':_0xa80c('0x50'),'input_type':_0xa80c('0x1e'),'response_type':_0xa80c('0x1e'),'rest_data':JSON[_0xa80c('0x1f')]({'session':_0x3de9c9['id'],'module_name':_0xa80c('0x51'),'module_id':_0x2f054e['id'],'link_field_name':_0x1bdd7b,'related_ids':[_0x544ef1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa80c('0x52')]=function(_0x5201b5,_0x28bed1,_0x2891c5,_0x15a0ee,_0x29aa79,_0x2b6b3d){var _0x3d7691,_0x22f8c3,_0x9ead89,_0x289bc6;_0x2b6b3d['remoteUri']=intUtil['stripTrailingSlash'](_0x2b6b3d[_0xa80c('0x53')]);_0x2b6b3d[_0xa80c('0x54')]=intUtil[_0xa80c('0x55')](_0x2b6b3d['serverUrl']);def['uri']=util[_0xa80c('0x20')](_0xa80c('0x56'),_0x2b6b3d['remoteUri']);if(_0x29aa79&&_0x29aa79[_0xa80c('0x57')]){logger['info'](_0xa80c('0x58'),'Recording\x20is\x20enabled!');_0x28bed1[_0xa80c('0x59')]=util[_0xa80c('0x20')](_0xa80c('0x5a'),_0x2b6b3d[_0xa80c('0x54')],_0x28bed1['uniqueid'],md5(_0x28bed1[_0xa80c('0x5b')]));}else{_0x28bed1[_0xa80c('0x59')]='';}return getConnection(_0x2b6b3d)['then'](function(_0x2f285a){_0x289bc6=_0x2f285a;return getUser(_0x2b6b3d,_0x15a0ee[_0xa80c('0xe')],_0x289bc6);})['then'](function(_0x1cd98e){_0x3d7691=_0x1cd98e;logger[_0xa80c('0x2a')](_0xa80c('0x5c'),_0x3d7691['id']);return getEndUser(_0x2b6b3d,_0x28bed1[_0xa80c('0x5d')],_0x28bed1[_0xa80c('0x5e')],_0x289bc6);})[_0xa80c('0x27')](function(_0x55f1d2){_0x22f8c3=_0x55f1d2;logger['info'](_0xa80c('0x5f'),_0x22f8c3['id']);return getTicket(_0x2b6b3d,_0x3d7691,_0x22f8c3,_0x2891c5,_0x28bed1,_0x2891c5[_0xa80c('0x60')],_0x289bc6,'Inbound');})['then'](function(_0x462854){_0x9ead89=_0x462854;logger['info'](_0xa80c('0x61'));logger[_0xa80c('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x9ead89['id']);return setRelationship(_0x289bc6,_0x3d7691,_0x9ead89,_0xa80c('0x62'));})[_0xa80c('0x27')](function(){return setRelationship(_0x289bc6,_0x22f8c3,_0x9ead89,'contacts');})[_0xa80c('0x27')](function(){return getServerInfo(_0x289bc6);})[_0xa80c('0x27')](function(_0x2640fd){var _0x2c8101=parseInt(_0x2640fd[_0xa80c('0x63')]['charAt'](0x0));var _0x19dac2=util['format'](_0xa80c('0x64'),_0x2b6b3d[_0xa80c('0x53')],_0x9ead89['id']);if(_0x2c8101>0x6){_0x19dac2=util[_0xa80c('0x20')](_0xa80c('0x65'),_0x2b6b3d[_0xa80c('0x53')],_0x9ead89['id']);}logger[_0xa80c('0x2a')]('[QUEUE]',_0xa80c('0x66'));emit(util[_0xa80c('0x20')](_0xa80c('0x67'),_0x15a0ee['name']),_0xa80c('0x68'),{'uri':_0x19dac2});})[_0xa80c('0x69')](function(_0x2eb0b2){logger['error']('[QUEUE]',JSON[_0xa80c('0x1f')](_0x2eb0b2));});};exports['outbound']=function(_0x5dc50f,_0x2bce3d,_0x137ea0,_0x414a37,_0xecf3ef,_0x1e3a65,_0x285d75){var _0x1eda6f,_0x17ea99,_0x5aec10,_0x5bb726;_0x1e3a65['remoteUri']=intUtil[_0xa80c('0x55')](_0x1e3a65['remoteUri']);_0x1e3a65[_0xa80c('0x54')]=intUtil[_0xa80c('0x55')](_0x1e3a65[_0xa80c('0x54')]);def[_0xa80c('0x6a')]=util[_0xa80c('0x20')]('%s/service/v4_1/rest.php',_0x1e3a65['remoteUri']);if(_0x285d75&&_0x285d75[_0xa80c('0x6b')]&&_0x285d75['recordingFormat']!==_0xa80c('0x6c')){logger[_0xa80c('0x2a')]('[OUTBOUND]',_0xa80c('0x6d'));_0x2bce3d[_0xa80c('0x59')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e3a65[_0xa80c('0x54')],_0x2bce3d['uniqueid'],md5(_0x2bce3d[_0xa80c('0x5b')]));}return getConnection(_0x1e3a65)[_0xa80c('0x27')](function(_0x4bef47){_0x5bb726=_0x4bef47;return getUser(_0x1e3a65,_0x414a37[_0xa80c('0xe')],_0x5bb726);})[_0xa80c('0x27')](function(_0x2949eb){_0x1eda6f=_0x2949eb;logger['info'](_0xa80c('0x5c'),_0x1eda6f['id']);return getEndUser(_0x1e3a65,_0x2bce3d[_0xa80c('0x6e')],_0x2bce3d[_0xa80c('0x6f')],_0x5bb726);})[_0xa80c('0x27')](function(_0x4e4d64){_0x17ea99=_0x4e4d64;logger[_0xa80c('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x17ea99['id']);return getTicket(_0x1e3a65,_0x1eda6f,_0x17ea99,_0x137ea0,_0x2bce3d,_0x137ea0['Fields'],_0x5bb726,_0xa80c('0x70'));})[_0xa80c('0x27')](function(_0x4fcb9b){_0x5aec10=_0x4fcb9b;logger[_0xa80c('0x2a')](_0xa80c('0x61'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5aec10['id']);return setRelationship(_0x5bb726,_0x1eda6f,_0x5aec10,_0xa80c('0x62'));})[_0xa80c('0x27')](function(){return setRelationship(_0x5bb726,_0x17ea99,_0x5aec10,_0xa80c('0x71'));})['then'](function(){return getServerInfo(_0x5bb726);})[_0xa80c('0x27')](function(_0x308e44){var _0x48676e=parseInt(_0x308e44[_0xa80c('0x63')][_0xa80c('0x72')](0x0));var _0x4cc242=util[_0xa80c('0x20')](_0xa80c('0x64'),_0x1e3a65['remoteUri'],_0x5aec10['id']);if(_0x48676e>0x6){_0x4cc242=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1e3a65['remoteUri'],_0x5aec10['id']);}logger[_0xa80c('0x2a')](_0xa80c('0x73'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa80c('0x20')](_0xa80c('0x67'),_0x414a37[_0xa80c('0xe')]),'trigger:browser:url',{'uri':_0x4cc242});})[_0xa80c('0x69')](function(_0x2da9ca){logger[_0xa80c('0x74')](_0xa80c('0x73'),JSON[_0xa80c('0x1f')](_0x2da9ca));});};exports[_0xa80c('0x75')]=function(_0x365806,_0x2613cc,_0x33eefc,_0x7a3f6b,_0x1cfa0d,_0x2f1aaa){var _0x507046,_0xee267c,_0x4b196f,_0x2a4340;_0x2f1aaa[_0xa80c('0x53')]=intUtil[_0xa80c('0x55')](_0x2f1aaa[_0xa80c('0x53')]);_0x2f1aaa['serverUrl']=intUtil[_0xa80c('0x55')](_0x2f1aaa[_0xa80c('0x54')]);def['uri']=util[_0xa80c('0x20')](_0xa80c('0x56'),_0x2f1aaa[_0xa80c('0x53')]);if(_0x1cfa0d&&_0x1cfa0d[_0xa80c('0x57')]){logger[_0xa80c('0x2a')]('['+_0x2613cc['lastevent'][_0xa80c('0x76')]()+']',_0xa80c('0x6d'));_0x2613cc['recordingURL']=util[_0xa80c('0x20')](_0xa80c('0x5a'),_0x2f1aaa[_0xa80c('0x54')],_0x2613cc['uniqueid'],md5(_0x2613cc['uniqueid']));}else{_0x2613cc[_0xa80c('0x59')]='';}return getConnection(_0x2f1aaa)[_0xa80c('0x27')](function(_0x664ba3){_0x2a4340=_0x664ba3;if(!_[_0xa80c('0x77')](_0x7a3f6b)){return getUser(_0x2f1aaa,_0x7a3f6b['name'],_0x2a4340);}else{return getUser(_0x2f1aaa,null,_0x2a4340);}})[_0xa80c('0x27')](function(_0x564374){_0x507046=_0x564374;logger[_0xa80c('0x2a')](_0xa80c('0x5c'),_0x507046['id']);return getEndUser(_0x2f1aaa,_0x2613cc[_0xa80c('0x5d')],_0x2613cc[_0xa80c('0x5e')],_0x2a4340);})[_0xa80c('0x27')](function(_0x3f24d3){_0xee267c=_0x3f24d3;logger[_0xa80c('0x2a')](_0xa80c('0x5f'),_0xee267c['id']);return getTicket(_0x2f1aaa,_0x507046,_0xee267c,_0x33eefc,_0x2613cc,_0x33eefc[_0xa80c('0x60')],_0x2a4340,_0xa80c('0x78'));})['then'](function(_0x46cc88){_0x4b196f=_0x46cc88;logger[_0xa80c('0x2a')](_0xa80c('0x61'));logger[_0xa80c('0x2a')](_0xa80c('0x79'),_0x4b196f['id']);return setRelationship(_0x2a4340,_0x507046,_0x4b196f,_0xa80c('0x62'));})['then'](function(){return setRelationship(_0x2a4340,_0xee267c,_0x4b196f,_0xa80c('0x71'));})[_0xa80c('0x27')](function(){return getServerInfo(_0x2a4340);})[_0xa80c('0x69')](function(_0x44d017){logger[_0xa80c('0x74')]('['+_0x2613cc[_0xa80c('0x7a')]['toUpperCase']()+']',JSON[_0xa80c('0x1f')](_0x44d017));});}; \ No newline at end of file +var _0x4269=['trigger:browser:url','unmanaged','toUpperCase','lastevent','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Caller\x20-\x20%s','[HTTP]','map','forEach','type','string','nameField','customField','content','toString','custom_fields','customVariable','Variable','toLowerCase','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:'];(function(_0x13fdb3,_0x493557){var _0x212e46=function(_0x47b3e0){while(--_0x47b3e0){_0x13fdb3['push'](_0x13fdb3['shift']());}};_0x212e46(++_0x493557);}(_0x4269,0x7a));var _0x9426=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x4269[_0x2a67fe];return _0x57e726;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x9426('0x0'));var md5=require(_0x9426('0x1'));var util=require(_0x9426('0x2'));var Redis=require(_0x9426('0x3'));var intUtil=require('./util');var config=require(_0x9426('0x4'));var logger=require(_0x9426('0x5'))(_0x9426('0x6'));config[_0x9426('0x7')]=_[_0x9426('0x8')](config[_0x9426('0x7')],{'host':_0x9426('0x9'),'port':0x18eb});var io=require(_0x9426('0xa'))(new Redis(config[_0x9426('0x7')]));var def={'method':_0x9426('0xb'),'json':!![]};function emit(_0x4b3785,_0x36a5d7,_0x2e6b48){io['to'](_0x4b3785)[_0x9426('0xc')](_0x36a5d7,_0x2e6b48);}function getTicket(_0x590b8b,_0x45a6e4,_0x122446,_0x5929f6,_0x31d1c9,_0x599e7d,_0x33e262,_0x4f2d29){logger[_0x9426('0xd')](_0x9426('0xe'));var _0x321bb1=new Date();var _0x2e867d=[{'name':_0x9426('0xf'),'value':intUtil[_0x9426('0x10')](_0x5929f6[_0x9426('0x11')],_0x31d1c9,'\x20')},{'name':_0x9426('0x12'),'value':_0x45a6e4['id']},{'name':_0x9426('0x13'),'value':_0x45a6e4['id']},{'name':_0x9426('0x14'),'value':intUtil[_0x9426('0x10')](_0x5929f6['Descriptions'],_0x31d1c9,'\x0a')},{'name':'date_start','value':_0x321bb1['toISOString']()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x9426('0x15'),'value':'0'},{'name':_0x9426('0x16'),'value':'15'},{'name':_0x9426('0x17'),'value':_0x122446['id']},{'name':_0x9426('0x18'),'value':_0x9426('0x19')},{'name':'parent_name','value':_0x122446[_0x9426('0xf')]},{'name':_0x9426('0x1a'),'value':_0x4f2d29}];if(_0x599e7d[_0x9426('0x1b')]){_['forEach'](_0x599e7d,function(_0x590778){if(_0x31d1c9[_0x590778[_0x9426('0x1c')]]){_0x2e867d[_0x9426('0x1d')]({'name':_0x590778[_0x9426('0x1e')],'value':_0x31d1c9[_0x590778[_0x9426('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x9426('0x1f'),'response_type':_0x9426('0x1f'),'rest_data':JSON[_0x9426('0x20')]({'session':_0x33e262['id'],'module_name':_0x9426('0x21'),'name_value_list':_0x2e867d})}});}function getAuth(_0x3e6b4b){return util[_0x9426('0x22')](_0x9426('0x23'),new Buffer(_0x3e6b4b['apiKey']+':X')['toString'](_0x9426('0x24')));}function getServerInfo(_0x472ebf){return request({'form':{'method':'get_server_info','input_type':_0x9426('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x472ebf['id']})}});}function getUser(_0x2c94a0,_0x5072c2,_0x90abc5){if(!_[_0x9426('0x25')](_0x5072c2)){logger['info'](_0x9426('0x26'),_0x5072c2);return request({'form':{'method':_0x9426('0x27'),'input_type':'JSON','response_type':_0x9426('0x1f'),'rest_data':JSON['stringify']({'session':_0x90abc5['id'],'module_name':'Employees','query':util[_0x9426('0x22')](_0x9426('0x28'),_0x5072c2),'order_by':'','offset':'0','select_fields':['id',_0x9426('0xf'),_0x9426('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9426('0x2a')](function(_0x238456){if(_0x238456[_0x9426('0x2b')][_0x9426('0x1b')]){var _0x56c73a=_[_0x9426('0x2c')](_0x238456[_0x9426('0x2b')],function(_0x525eda){return _0x525eda[_0x9426('0x2d')][_0x9426('0x29')][_0x9426('0x2e')]===_0x5072c2;});if(_0x56c73a){logger[_0x9426('0xd')](_0x9426('0x2f'));return BPromise[_0x9426('0x30')]({'id':_0x56c73a['name_value_list']['id'][_0x9426('0x2e')],'name':_0x56c73a[_0x9426('0x2d')][_0x9426('0xf')][_0x9426('0x2e')]});}}logger[_0x9426('0xd')](_0x9426('0x31'));return BPromise[_0x9426('0x30')]({'id':_0x90abc5[_0x9426('0x2d')]['user_id'][_0x9426('0x2e')],'name':_0x90abc5[_0x9426('0x2d')][_0x9426('0x29')]['value']});});}else{logger[_0x9426('0xd')](_0x9426('0x32'));return BPromise[_0x9426('0x30')]({'id':_0x90abc5[_0x9426('0x2d')][_0x9426('0x33')]['value'],'name':_0x90abc5[_0x9426('0x2d')][_0x9426('0x29')][_0x9426('0x2e')]});}}function getEndUser(_0x34e93a,_0x228b44,_0x618f7f,_0x249a4a){logger[_0x9426('0xd')]('Searching\x20enduser\x20with\x20phone',_0x618f7f);return request({'form':{'method':_0x9426('0x27'),'input_type':_0x9426('0x1f'),'response_type':'JSON','rest_data':JSON[_0x9426('0x20')]({'session':_0x249a4a['id'],'module_name':_0x9426('0x19'),'query':util[_0x9426('0x22')](_0x9426('0x34'),_0x618f7f),'order_by':'','offset':'0','select_fields':['id',_0x9426('0xf'),_0x9426('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9426('0x2a')](function(_0x102a44){if(_0x102a44[_0x9426('0x2b')]['length']){var _0x4fe04f=_[_0x9426('0x2c')](_0x102a44[_0x9426('0x2b')],function(_0x430dc5){return _0x430dc5[_0x9426('0x2d')][_0x9426('0x35')]['value']===_0x618f7f;});if(_0x4fe04f){logger[_0x9426('0xd')](_0x9426('0x36'));return BPromise[_0x9426('0x30')]({'id':_0x4fe04f[_0x9426('0x2d')]['id'][_0x9426('0x2e')],'name':_0x4fe04f[_0x9426('0x2d')][_0x9426('0xf')]['value'],'phone':_0x4fe04f[_0x9426('0x2d')]['phone_home'][_0x9426('0x2e')]});}}else{logger[_0x9426('0xd')](_0x9426('0x37'));return request({'form':{'method':_0x9426('0x38'),'input_type':_0x9426('0x1f'),'response_type':'JSON','rest_data':JSON[_0x9426('0x20')]({'session':_0x249a4a['id'],'module_name':'Contacts','name_value_list':[{'name':_0x9426('0x39'),'value':_0x228b44!==''?_0x228b44:util[_0x9426('0x22')](_0x9426('0x3a'),_0x618f7f)},{'name':_0x9426('0x35'),'value':_0x618f7f}]})}})[_0x9426('0x2a')](function(_0x535d0e){logger['info']('Enduser\x20created.');return BPromise[_0x9426('0x30')]({'id':_0x535d0e['id'],'name':_0x535d0e[_0x9426('0x2b')][_0x9426('0x39')][_0x9426('0x2e')],'phone':_0x535d0e['entry_list'][_0x9426('0x35')][_0x9426('0x2e')]});});}});}function request(_0x517f54){logger['debug'](_0x9426('0x3b'),JSON['stringify'](_0x517f54));return rp(_['merge'](def,_0x517f54));}function getTags(_0x55f8ca,_0xcc076b){var _0x573637=[];if(_0x55f8ca&&_0x55f8ca[_0x9426('0x1b')]>0x0){_0x573637=_[_0x9426('0x3c')](_0x55f8ca,_0xcc076b);}return _0x573637;}function getCustomFields(_0x4d068d,_0x166d50){var _0x5ceb73=[];var _0x17bd46={'custom_fields':[]};if(_0x4d068d[_0x9426('0x1b')]>0x0){_[_0x9426('0x3d')](_0x4d068d,function(_0x473952){if(_0x473952[_0x9426('0x3e')]===_0x9426('0x3f')&&_0x473952[_0x9426('0x40')]&&!_0x473952[_0x9426('0x41')]){_0x17bd46[_0x473952['nameField']['toLowerCase']()]=_0x473952[_0x9426('0x42')][_0x9426('0x43')]();}else if(_0x473952[_0x9426('0x3e')]==='string'&&_0x473952[_0x9426('0x1e')]&&_0x473952[_0x9426('0x41')]){_0x17bd46[_0x9426('0x44')][_0x9426('0x1d')]({'id':_0x473952[_0x9426('0x1e')],'value':_0x473952[_0x9426('0x42')][_0x9426('0x43')]()});}else if(_0x473952[_0x9426('0x3e')]==='variable'&&_0x473952['variableName']&&_0x473952['idField']&&_0x473952[_0x9426('0x41')]){_0x166d50[_0x473952[_0x9426('0x1c')]]&&_0x17bd46[_0x9426('0x44')]['push']({'id':_0x473952[_0x9426('0x1e')],'value':_0x166d50[_0x473952[_0x9426('0x1c')]][_0x9426('0x43')]()});}else if(_0x473952[_0x9426('0x3e')]===_0x9426('0x45')&&_0x473952[_0x9426('0x46')]&&_0x473952['Variable'][_0x9426('0xf')]&&_0x473952[_0x9426('0x1e')]&&_0x473952['customField']){_0x166d50[_0x473952['Variable'][_0x9426('0xf')][_0x9426('0x47')]()]&&_0x17bd46[_0x9426('0x44')][_0x9426('0x1d')]({'id':_0x473952['idField'],'value':_0x166d50[_0x473952['Variable'][_0x9426('0xf')][_0x9426('0x47')]()][_0x9426('0x43')]()});}});}return _0x17bd46;}function getConnection(_0x517036){return request({'method':'POST','form':{'method':_0x9426('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x517036[_0x9426('0x49')],'password':_0x517036[_0x9426('0x4a')],'encryption':_0x9426('0x4b')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x3105fc){var _0x3b3cc6=_0x3105fc;if(_0x3b3cc6['id']){def[_0x9426('0x4c')]=_0x3b3cc6['id'];return BPromise['resolve'](_0x3b3cc6);}else{throw new Error(util['format'](_0x9426('0x4d'),_0x517036['id']));}});}function setRelationship(_0x205c01,_0x15c6c4,_0x4472be,_0x8c868){return request({'form':{'method':_0x9426('0x4e'),'input_type':'JSON','response_type':_0x9426('0x1f'),'rest_data':JSON[_0x9426('0x20')]({'session':_0x205c01['id'],'module_name':_0x9426('0x21'),'module_id':_0x4472be['id'],'link_field_name':_0x8c868,'related_ids':[_0x15c6c4['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9426('0x4f')]=function(_0x3b7206,_0x90a8a9,_0x1915b6,_0x4f66fb,_0x26bab7,_0x28976f){var _0x3fd453,_0x32cc06,_0x323ee1,_0x34ffda;_0x28976f[_0x9426('0x50')]=intUtil[_0x9426('0x51')](_0x28976f[_0x9426('0x50')]);_0x28976f[_0x9426('0x52')]=intUtil[_0x9426('0x51')](_0x28976f[_0x9426('0x52')]);def[_0x9426('0x53')]=util[_0x9426('0x22')]('%s/service/v4_1/rest.php',_0x28976f[_0x9426('0x50')]);if(_0x26bab7&&_0x26bab7[_0x9426('0x54')]){logger[_0x9426('0xd')](_0x9426('0x55'),_0x9426('0x56'));_0x90a8a9[_0x9426('0x57')]=util[_0x9426('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28976f['serverUrl'],_0x90a8a9['uniqueid'],md5(_0x90a8a9[_0x9426('0x58')]));}else{_0x90a8a9[_0x9426('0x57')]='';}return getConnection(_0x28976f)[_0x9426('0x2a')](function(_0x3f0cd4){_0x34ffda=_0x3f0cd4;return getUser(_0x28976f,_0x4f66fb[_0x9426('0xf')],_0x34ffda);})[_0x9426('0x2a')](function(_0x345d35){_0x3fd453=_0x345d35;logger[_0x9426('0xd')](_0x9426('0x59'),_0x3fd453['id']);return getEndUser(_0x28976f,_0x90a8a9[_0x9426('0x5a')],_0x90a8a9[_0x9426('0x5b')],_0x34ffda);})[_0x9426('0x2a')](function(_0x2069a5){_0x32cc06=_0x2069a5;logger[_0x9426('0xd')](_0x9426('0x5c'),_0x32cc06['id']);return getTicket(_0x28976f,_0x3fd453,_0x32cc06,_0x1915b6,_0x90a8a9,_0x1915b6['Fields'],_0x34ffda,_0x9426('0x5d'));})[_0x9426('0x2a')](function(_0x348081){_0x323ee1=_0x348081;logger[_0x9426('0xd')](_0x9426('0x5e'));logger[_0x9426('0xd')]('The\x20Ticket\x20ID\x20is:',_0x323ee1['id']);return setRelationship(_0x34ffda,_0x3fd453,_0x323ee1,_0x9426('0x5f'));})[_0x9426('0x2a')](function(){return setRelationship(_0x34ffda,_0x32cc06,_0x323ee1,_0x9426('0x60'));})[_0x9426('0x2a')](function(){return getServerInfo(_0x34ffda);})[_0x9426('0x2a')](function(_0x147719){var _0x7feb02=parseInt(_0x147719[_0x9426('0x61')][_0x9426('0x62')](0x0));var _0x5034b5=util[_0x9426('0x22')](_0x9426('0x63'),_0x28976f['remoteUri'],_0x323ee1['id']);if(_0x7feb02>0x6){_0x5034b5=util[_0x9426('0x22')](_0x9426('0x64'),_0x28976f[_0x9426('0x50')],_0x323ee1['id']);}logger[_0x9426('0xd')](_0x9426('0x55'),_0x9426('0x65'));emit(util['format']('user:%s',_0x4f66fb[_0x9426('0xf')]),'trigger:browser:url',{'uri':_0x5034b5});})[_0x9426('0x66')](function(_0x19950b){logger[_0x9426('0x67')](_0x9426('0x55'),JSON[_0x9426('0x20')](_0x19950b));});};exports[_0x9426('0x68')]=function(_0x14f0ed,_0x4431eb,_0x35f49e,_0x45b9aa,_0x374ce7,_0x2ad51f,_0x51c2a4){var _0x255b0d,_0x2ef8cf,_0x1646c2,_0x5e6983;_0x2ad51f['remoteUri']=intUtil[_0x9426('0x51')](_0x2ad51f[_0x9426('0x50')]);_0x2ad51f['serverUrl']=intUtil[_0x9426('0x51')](_0x2ad51f[_0x9426('0x52')]);def['uri']=util[_0x9426('0x22')](_0x9426('0x69'),_0x2ad51f[_0x9426('0x50')]);if(_0x51c2a4&&_0x51c2a4[_0x9426('0x6a')]&&_0x51c2a4['recordingFormat']!==_0x9426('0x6b')){logger[_0x9426('0xd')](_0x9426('0x6c'),'Recording\x20is\x20enabled!');_0x4431eb[_0x9426('0x57')]=util[_0x9426('0x22')](_0x9426('0x6d'),_0x2ad51f['serverUrl'],_0x4431eb[_0x9426('0x58')],md5(_0x4431eb[_0x9426('0x58')]));}return getConnection(_0x2ad51f)[_0x9426('0x2a')](function(_0xc7c0cf){_0x5e6983=_0xc7c0cf;return getUser(_0x2ad51f,_0x45b9aa[_0x9426('0xf')],_0x5e6983);})[_0x9426('0x2a')](function(_0x5944ac){_0x255b0d=_0x5944ac;logger['info']('The\x20User\x20ID\x20is:',_0x255b0d['id']);return getEndUser(_0x2ad51f,_0x4431eb[_0x9426('0x6e')],_0x4431eb[_0x9426('0x6f')],_0x5e6983);})[_0x9426('0x2a')](function(_0x1c527e){_0x2ef8cf=_0x1c527e;logger[_0x9426('0xd')](_0x9426('0x5c'),_0x2ef8cf['id']);return getTicket(_0x2ad51f,_0x255b0d,_0x2ef8cf,_0x35f49e,_0x4431eb,_0x35f49e[_0x9426('0x70')],_0x5e6983,'Outbound');})[_0x9426('0x2a')](function(_0x328015){_0x1646c2=_0x328015;logger[_0x9426('0xd')](_0x9426('0x5e'));logger[_0x9426('0xd')](_0x9426('0x71'),_0x1646c2['id']);return setRelationship(_0x5e6983,_0x255b0d,_0x1646c2,_0x9426('0x5f'));})[_0x9426('0x2a')](function(){return setRelationship(_0x5e6983,_0x2ef8cf,_0x1646c2,_0x9426('0x60'));})['then'](function(){return getServerInfo(_0x5e6983);})[_0x9426('0x2a')](function(_0x16169a){var _0x53277b=parseInt(_0x16169a[_0x9426('0x61')][_0x9426('0x62')](0x0));var _0x135b87=util[_0x9426('0x22')](_0x9426('0x63'),_0x2ad51f[_0x9426('0x50')],_0x1646c2['id']);if(_0x53277b>0x6){_0x135b87=util[_0x9426('0x22')](_0x9426('0x64'),_0x2ad51f[_0x9426('0x50')],_0x1646c2['id']);}logger[_0x9426('0xd')](_0x9426('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x45b9aa[_0x9426('0xf')]),_0x9426('0x72'),{'uri':_0x135b87});})[_0x9426('0x66')](function(_0x50d3f0){logger[_0x9426('0x67')](_0x9426('0x6c'),JSON[_0x9426('0x20')](_0x50d3f0));});};exports[_0x9426('0x73')]=function(_0x16b86f,_0x18fe52,_0x30a3b0,_0x5e6a88,_0xa373e4,_0x3cd874){var _0x43505a,_0x1f37fc,_0x145b67,_0x135033;_0x3cd874[_0x9426('0x50')]=intUtil[_0x9426('0x51')](_0x3cd874[_0x9426('0x50')]);_0x3cd874[_0x9426('0x52')]=intUtil[_0x9426('0x51')](_0x3cd874['serverUrl']);def[_0x9426('0x53')]=util[_0x9426('0x22')]('%s/service/v4_1/rest.php',_0x3cd874[_0x9426('0x50')]);if(_0xa373e4&&_0xa373e4[_0x9426('0x54')]){logger[_0x9426('0xd')]('['+_0x18fe52['lastevent'][_0x9426('0x74')]()+']',_0x9426('0x56'));_0x18fe52['recordingURL']=util[_0x9426('0x22')](_0x9426('0x6d'),_0x3cd874[_0x9426('0x52')],_0x18fe52['uniqueid'],md5(_0x18fe52[_0x9426('0x58')]));}else{_0x18fe52[_0x9426('0x57')]='';}return getConnection(_0x3cd874)[_0x9426('0x2a')](function(_0xe40d97){_0x135033=_0xe40d97;if(!_[_0x9426('0x25')](_0x5e6a88)){return getUser(_0x3cd874,_0x5e6a88[_0x9426('0xf')],_0x135033);}else{return getUser(_0x3cd874,null,_0x135033);}})[_0x9426('0x2a')](function(_0x5780f0){_0x43505a=_0x5780f0;logger[_0x9426('0xd')](_0x9426('0x59'),_0x43505a['id']);return getEndUser(_0x3cd874,_0x18fe52[_0x9426('0x5a')],_0x18fe52[_0x9426('0x5b')],_0x135033);})[_0x9426('0x2a')](function(_0x418f2c){_0x1f37fc=_0x418f2c;logger[_0x9426('0xd')](_0x9426('0x5c'),_0x1f37fc['id']);return getTicket(_0x3cd874,_0x43505a,_0x1f37fc,_0x30a3b0,_0x18fe52,_0x30a3b0[_0x9426('0x70')],_0x135033,_0x9426('0x5d'));})[_0x9426('0x2a')](function(_0x41056e){_0x145b67=_0x41056e;logger[_0x9426('0xd')](_0x9426('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x145b67['id']);return setRelationship(_0x135033,_0x43505a,_0x145b67,_0x9426('0x5f'));})[_0x9426('0x2a')](function(){return setRelationship(_0x135033,_0x1f37fc,_0x145b67,_0x9426('0x60'));})['then'](function(){return getServerInfo(_0x135033);})[_0x9426('0x66')](function(_0x458a3c){logger[_0x9426('0x67')]('['+_0x18fe52[_0x9426('0x75')][_0x9426('0x74')]()+']',JSON[_0x9426('0x20')](_0x458a3c));});}; \ 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 13be923..c247607 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 _0xd6b3=['type','string','content','variable','variableName','toString','Variable','name','toLowerCase','push','keyType','key','format','keyContent','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','validateEmail','isNil','lodash','util','sortBy'];(function(_0x3c58d1,_0x150f6e){var _0x5e46e7=function(_0x432419){while(--_0x432419){_0x3c58d1['push'](_0x3c58d1['shift']());}};_0x5e46e7(++_0x150f6e);}(_0xd6b3,0x174));var _0x3d6b=function(_0x51970a,_0x5ab3b7){_0x51970a=_0x51970a-0x0;var _0x3e7380=_0xd6b3[_0x51970a];return _0x3e7380;};'use strict';var _=require(_0x3d6b('0x0'));var util=require(_0x3d6b('0x1'));exports['getString']=function(_0x46de11,_0x4f3960,_0x437c97){var _0x448d90=[];if(_0x46de11['length']>0x0){var _0x530bae=_[_0x3d6b('0x2')](_0x46de11,['id']);for(var _0x245477=0x0;_0x245477<_0x530bae['length'];_0x245477++){var _0x21aa6e=_0x530bae[_0x245477];if(_0x21aa6e[_0x3d6b('0x3')]===_0x3d6b('0x4')){_0x448d90['push'](_0x21aa6e[_0x3d6b('0x5')]);}else if(_0x21aa6e[_0x3d6b('0x3')]===_0x3d6b('0x6')&&_0x21aa6e[_0x3d6b('0x7')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]]&&_0x448d90['push'](_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]][_0x3d6b('0x8')]());}else if(_0x21aa6e[_0x3d6b('0x3')]==='customVariable'&&_0x21aa6e[_0x3d6b('0x9')]&&_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')][_0x3d6b('0xb')]()]&&_0x448d90[_0x3d6b('0xc')](_0x4f3960[_0x21aa6e['Variable'][_0x3d6b('0xa')][_0x3d6b('0xb')]()]['toString']());}else if(_0x21aa6e[_0x3d6b('0x3')]==='keyValue'){if(_0x21aa6e[_0x3d6b('0xd')]===_0x3d6b('0x4')&&_0x21aa6e[_0x3d6b('0xe')]){_0x448d90[_0x3d6b('0xc')](util[_0x3d6b('0xf')]('%s:\x20%s',_0x21aa6e[_0x3d6b('0xe')],_0x21aa6e[_0x3d6b('0x10')]));}else if(_0x21aa6e[_0x3d6b('0xd')]==='variable'&&_0x21aa6e[_0x3d6b('0x7')]&&_0x21aa6e[_0x3d6b('0xe')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]]&&_0x448d90[_0x3d6b('0xc')](util[_0x3d6b('0xf')](_0x3d6b('0x11'),_0x21aa6e[_0x3d6b('0xe')],_0x4f3960[_0x21aa6e[_0x3d6b('0x7')]]));}else if(_0x21aa6e[_0x3d6b('0xd')]===_0x3d6b('0x12')&&_0x21aa6e[_0x3d6b('0x9')]&&_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')]&&_0x21aa6e[_0x3d6b('0xe')]){_0x4f3960[_0x21aa6e[_0x3d6b('0x9')][_0x3d6b('0xa')][_0x3d6b('0xb')]()]&&_0x448d90[_0x3d6b('0xc')](util['format']('%s:\x20%s',_0x21aa6e[_0x3d6b('0xe')],_0x4f3960[_0x21aa6e[_0x3d6b('0x9')]['name'][_0x3d6b('0xb')]()]));}}}}return _0x448d90[_0x3d6b('0x13')](_0x437c97);};exports[_0x3d6b('0x14')]=function(_0x278cd8){var _0x3bad07=_0x278cd8[_0x3d6b('0x15')](-0x1);if(_0x3bad07==='/'){_0x278cd8=_0x278cd8[_0x3d6b('0x16')](0x0,_0x278cd8['lastIndexOf'](_0x3bad07));}return _0x278cd8;};exports[_0x3d6b('0x17')]=function(_0x28c597){if(!_[_0x3d6b('0x18')](_0x28c597)&&_0x28c597!==''){var _0x277a2f=/^(([^<>()\[\]\\.,;:\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 _0x277a2f['test'](String(_0x28c597)[_0x3d6b('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x2ff0=['keyValue','key','format','keyType','variable','%s:\x20%s','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','length','sortBy','type','content','variableName','push','toString','customVariable','Variable','name','toLowerCase'];(function(_0x23851f,_0x3b7734){var _0x1216a4=function(_0x506ce9){while(--_0x506ce9){_0x23851f['push'](_0x23851f['shift']());}};_0x1216a4(++_0x3b7734);}(_0x2ff0,0x1c7));var _0x02ff=function(_0x55fe92,_0x139e60){_0x55fe92=_0x55fe92-0x0;var _0x3e31f8=_0x2ff0[_0x55fe92];return _0x3e31f8;};'use strict';var _=require(_0x02ff('0x0'));var util=require(_0x02ff('0x1'));exports['getString']=function(_0x2b27f8,_0x1b6993,_0x8947bf){var _0x396771=[];if(_0x2b27f8[_0x02ff('0x2')]>0x0){var _0x500b03=_[_0x02ff('0x3')](_0x2b27f8,['id']);for(var _0x1b203d=0x0;_0x1b203d<_0x500b03['length'];_0x1b203d++){var _0x350548=_0x500b03[_0x1b203d];if(_0x350548[_0x02ff('0x4')]==='string'){_0x396771['push'](_0x350548[_0x02ff('0x5')]);}else if(_0x350548['type']==='variable'&&_0x350548[_0x02ff('0x6')]){_0x1b6993[_0x350548['variableName']]&&_0x396771[_0x02ff('0x7')](_0x1b6993[_0x350548[_0x02ff('0x6')]][_0x02ff('0x8')]());}else if(_0x350548[_0x02ff('0x4')]===_0x02ff('0x9')&&_0x350548[_0x02ff('0xa')]&&_0x350548[_0x02ff('0xa')][_0x02ff('0xb')]){_0x1b6993[_0x350548[_0x02ff('0xa')]['name'][_0x02ff('0xc')]()]&&_0x396771['push'](_0x1b6993[_0x350548[_0x02ff('0xa')][_0x02ff('0xb')][_0x02ff('0xc')]()]['toString']());}else if(_0x350548[_0x02ff('0x4')]===_0x02ff('0xd')){if(_0x350548['keyType']==='string'&&_0x350548[_0x02ff('0xe')]){_0x396771[_0x02ff('0x7')](util[_0x02ff('0xf')]('%s:\x20%s',_0x350548[_0x02ff('0xe')],_0x350548['keyContent']));}else if(_0x350548[_0x02ff('0x10')]===_0x02ff('0x11')&&_0x350548[_0x02ff('0x6')]&&_0x350548['key']){_0x1b6993[_0x350548[_0x02ff('0x6')]]&&_0x396771[_0x02ff('0x7')](util[_0x02ff('0xf')](_0x02ff('0x12'),_0x350548[_0x02ff('0xe')],_0x1b6993[_0x350548[_0x02ff('0x6')]]));}else if(_0x350548[_0x02ff('0x10')]===_0x02ff('0x9')&&_0x350548['Variable']&&_0x350548[_0x02ff('0xa')]['name']&&_0x350548[_0x02ff('0xe')]){_0x1b6993[_0x350548[_0x02ff('0xa')][_0x02ff('0xb')][_0x02ff('0xc')]()]&&_0x396771[_0x02ff('0x7')](util[_0x02ff('0xf')]('%s:\x20%s',_0x350548[_0x02ff('0xe')],_0x1b6993[_0x350548[_0x02ff('0xa')][_0x02ff('0xb')][_0x02ff('0xc')]()]));}}}}return _0x396771[_0x02ff('0x13')](_0x8947bf);};exports[_0x02ff('0x14')]=function(_0x41398c){var _0x109075=_0x41398c[_0x02ff('0x15')](-0x1);if(_0x109075==='/'){_0x41398c=_0x41398c[_0x02ff('0x16')](0x0,_0x41398c['lastIndexOf'](_0x109075));}return _0x41398c;};exports[_0x02ff('0x17')]=function(_0x2f0a99){if(!_[_0x02ff('0x18')](_0x2f0a99)&&_0x2f0a99!==''){var _0x532ecd=/^(([^<>()\[\]\\.,;:\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 _0x532ecd[_0x02ff('0x19')](String(_0x2f0a99)[_0x02ff('0xc')]());}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 9274eb6..f5eaa80 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','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]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x55e11c,_0x463a84){var _0xf006c5=function(_0x393902){while(--_0x393902){_0x55e11c['push'](_0x55e11c['shift']());}};_0xf006c5(++_0x463a84);}(_0xe706,0xa3));var _0x6e70=function(_0x4c4fbe,_0x483482){_0x4c4fbe=_0x4c4fbe-0x0;var _0x39b3b9=_0xe706[_0x4c4fbe];return _0x39b3b9;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 830ba99..4d26ed1 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 _0xc9ef=['util','ioredis','./util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','results','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','username','toString','debug','[HTTP]','defaults','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','lodash'];(function(_0x2d7c5f,_0x3fcdd4){var _0x13d9d0=function(_0x3a008e){while(--_0x3a008e){_0x2d7c5f['push'](_0x2d7c5f['shift']());}};_0x13d9d0(++_0x3fcdd4);}(_0xc9ef,0x68));var _0xfc9e=function(_0x1dc337,_0x163446){_0x1dc337=_0x1dc337-0x0;var _0x2c4d04=_0xc9ef[_0x1dc337];return _0x2c4d04;};'use strict';var _=require(_0xfc9e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xfc9e('0x1'));var Redis=require(_0xfc9e('0x2'));var intUtil=require(_0xfc9e('0x3'));var config=require(_0xfc9e('0x4'));var logger=require('../../../../config/logger')(_0xfc9e('0x5'));config[_0xfc9e('0x6')]=_['defaults'](config[_0xfc9e('0x6')],{'host':_0xfc9e('0x7'),'port':0x18eb});var io=require(_0xfc9e('0x8'))(new Redis(config[_0xfc9e('0x6')]));function emit(_0x2d3161,_0x1fe084,_0x450c62){io['to'](_0x2d3161)['emit'](_0x1fe084,_0x450c62);}var headers={'Content-Type':_0xfc9e('0x9'),'Accept':'application/json'};function getTicket(_0xec9760,_0x68012,_0x39594b,_0x1e6094,_0x168fbb){logger[_0xfc9e('0xa')](_0xfc9e('0xb'));return request({'uri':util['format'](_0xfc9e('0xc'),_0xec9760['remoteUri']),'method':_0xfc9e('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x39594b['id'],'submitter_id':_0x68012?_0x68012['id']:undefined,'assignee_id':_0x68012?_0x68012['id']:undefined,'tags':getTags(_0x1e6094['Tags'],_0xfc9e('0xe')),'subject':intUtil[_0xfc9e('0xf')](_0x1e6094[_0xfc9e('0x10')],_0x168fbb,'\x20'),'description':intUtil[_0xfc9e('0xf')](_0x1e6094['Descriptions'],_0x168fbb,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfc9e('0xf')](_0x1e6094[_0xfc9e('0x11')],_0x168fbb,'\x0a')}},getCustomFields(_0x1e6094[_0xfc9e('0x12')],_0x168fbb))}})[_0xfc9e('0x13')](function(_0x2a4aef){logger[_0xfc9e('0xa')]('Ticket\x20created!');return _0x2a4aef[_0xfc9e('0x14')];});}function getUser(_0x28f3d7,_0x460999){if(intUtil[_0xfc9e('0x15')](_0x460999)){logger['info'](_0xfc9e('0x16'),_0x460999);return request({'uri':util[_0xfc9e('0x17')]('%s/search.json',_0x28f3d7[_0xfc9e('0x18')]),'qs':{'query':util[_0xfc9e('0x17')](_0xfc9e('0x19'),_0x460999)}})[_0xfc9e('0x13')](function(_0x47c4b7){if(_0x47c4b7[_0xfc9e('0x1a')]){logger[_0xfc9e('0xa')](_0xfc9e('0x1b'));return _['find'](_0x47c4b7['results'],{'email':_0x460999,'role':_0xfc9e('0x1c')});}else{logger[_0xfc9e('0xa')](_0xfc9e('0x1d'));return request({'uri':util[_0xfc9e('0x17')]('%s/users/me.json',_0x28f3d7[_0xfc9e('0x18')])})[_0xfc9e('0x13')](function(_0x5d91fc){logger['info']('Admin\x20account\x20selected.');return _0x5d91fc[_0xfc9e('0x1e')];});}});}else{logger[_0xfc9e('0xa')](_0xfc9e('0x1d'));return request({'uri':util[_0xfc9e('0x17')]('%s/users/me.json',_0x28f3d7[_0xfc9e('0x18')])})['then'](function(_0x5a408a){logger[_0xfc9e('0xa')](_0xfc9e('0x1f'));return _0x5a408a[_0xfc9e('0x1e')];});}}function getEndUser(_0x49e261,_0x3a6446,_0x3a6bd5){logger[_0xfc9e('0xa')]('Searching\x20enduser\x20with\x20phone',_0x3a6bd5);return request({'uri':util[_0xfc9e('0x17')](_0xfc9e('0x20'),_0x49e261[_0xfc9e('0x18')]),'qs':{'query':util['format'](_0xfc9e('0x21'),_0x3a6bd5)}})['then'](function(_0x27f111){var _0x338b9a;if(_0x27f111['results'][_0xfc9e('0x22')]){_0x27f111['results']=_['filter'](_0x27f111[_0xfc9e('0x23')],{'suspended':![],'role':_0xfc9e('0x24')});if(_0x27f111[_0xfc9e('0x23')][_0xfc9e('0x22')]){_0x338b9a=_[_0xfc9e('0x25')](_0x27f111[_0xfc9e('0x23')]);}}if(_0x338b9a){logger[_0xfc9e('0xa')](_0xfc9e('0x26'));return _0x338b9a;}else{logger[_0xfc9e('0xa')](_0xfc9e('0x27'));return request({'uri':util[_0xfc9e('0x17')](_0xfc9e('0x28'),_0x49e261[_0xfc9e('0x18')]),'method':_0xfc9e('0xd'),'body':{'user':{'role':'end-user','name':util[_0xfc9e('0x17')](_0xfc9e('0x29'),_0x3a6446||_0x3a6bd5),'phone':_0x3a6bd5}}})[_0xfc9e('0x13')](function(_0x373e9c){logger[_0xfc9e('0xa')](_0xfc9e('0x2a'));return _0x373e9c[_0xfc9e('0x1e')];});}});}function getAuth(_0x1b0798){var _0x5bed02;if(_0x1b0798[_0xfc9e('0x2b')]===_0xfc9e('0x2c')){_0x5bed02=util['format']('%s:%s',_0x1b0798['username'],_0x1b0798[_0xfc9e('0x2c')]);}else if(_0x1b0798[_0xfc9e('0x2b')]===_0xfc9e('0x2d')){_0x5bed02=util['format'](_0xfc9e('0x2e'),_0x1b0798[_0xfc9e('0x2f')],_0x1b0798[_0xfc9e('0x2d')]);}return util[_0xfc9e('0x17')]('Basic\x20%s',new Buffer(_0x5bed02)[_0xfc9e('0x30')]('base64'));}function request(_0x200982){logger[_0xfc9e('0x31')](_0xfc9e('0x32'),JSON['stringify'](_0x200982));return rp(_[_0xfc9e('0x33')](_0x200982,{'method':_0xfc9e('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x38f80c,_0x4e52c3){var _0x5eb266=[];if(_0x38f80c&&_0x38f80c['length']>0x0){_0x5eb266=_[_0xfc9e('0x35')](_0x38f80c,_0x4e52c3);}return _0x5eb266;}function getCustomFields(_0x44b72e,_0x3d99d3){var _0x51c454=[];var _0x32acdd={'custom_fields':[]};if(_0x44b72e['length']>0x0){_[_0xfc9e('0x36')](_0x44b72e,function(_0x2f02d6){if(_[_0xfc9e('0x37')](['string',_0xfc9e('0x38')],_0x2f02d6[_0xfc9e('0x39')])&&_0x2f02d6[_0xfc9e('0x3a')]&&!_0x2f02d6[_0xfc9e('0x3b')]){_0x32acdd[_0x2f02d6[_0xfc9e('0x3a')][_0xfc9e('0x3c')]()]=_0x2f02d6[_0xfc9e('0x3d')][_0xfc9e('0x30')]();}else if(_[_0xfc9e('0x37')]([_0xfc9e('0x3e'),_0xfc9e('0x38')],_0x2f02d6[_0xfc9e('0x39')])&&_0x2f02d6[_0xfc9e('0x3f')]&&_0x2f02d6[_0xfc9e('0x3b')]){_0x32acdd[_0xfc9e('0x40')][_0xfc9e('0x41')]({'id':_0x2f02d6[_0xfc9e('0x3f')],'value':_0x2f02d6[_0xfc9e('0x3d')][_0xfc9e('0x30')]()});}else if(_0x2f02d6[_0xfc9e('0x39')]===_0xfc9e('0x42')&&_0x2f02d6['variableName']&&_0x2f02d6[_0xfc9e('0x3f')]&&_0x2f02d6[_0xfc9e('0x3b')]){_0x3d99d3[_0x2f02d6['variableName']]&&_0x32acdd[_0xfc9e('0x40')]['push']({'id':_0x2f02d6['idField'],'value':_0x3d99d3[_0x2f02d6[_0xfc9e('0x43')]]['toString']()});}else if(_0x2f02d6[_0xfc9e('0x39')]==='customVariable'&&_0x2f02d6['Variable']&&_0x2f02d6['Variable'][_0xfc9e('0xe')]&&_0x2f02d6[_0xfc9e('0x3f')]&&_0x2f02d6['customField']){_0x3d99d3[_0x2f02d6[_0xfc9e('0x44')][_0xfc9e('0xe')][_0xfc9e('0x3c')]()]&&_0x32acdd['custom_fields'][_0xfc9e('0x41')]({'id':_0x2f02d6[_0xfc9e('0x3f')],'value':_0x3d99d3[_0x2f02d6[_0xfc9e('0x44')]['name'][_0xfc9e('0x3c')]()][_0xfc9e('0x30')]()});}});}return _0x32acdd;}exports[_0xfc9e('0x45')]=function(_0x47440a,_0x1bca65,_0x5c7646,_0x3d3c32,_0x585f04,_0x4e52be){var _0x30176c,_0x129de4;_0x4e52be[_0xfc9e('0x18')]=intUtil['stripTrailingSlash'](_0x4e52be[_0xfc9e('0x18')]);_0x4e52be[_0xfc9e('0x46')]=intUtil[_0xfc9e('0x47')](_0x4e52be['serverUrl']);if(_0x585f04&&_0x585f04[_0xfc9e('0x48')]){logger[_0xfc9e('0xa')](_0xfc9e('0x49'),_0xfc9e('0x4a'));_0x1bca65[_0xfc9e('0x4b')]=util[_0xfc9e('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e52be[_0xfc9e('0x46')],_0x1bca65['uniqueid'],md5(_0x1bca65[_0xfc9e('0x4c')]));}else{_0x1bca65[_0xfc9e('0x4b')]='';}headers[_0xfc9e('0x4d')]=getAuth(_0x4e52be);return getUser(_0x4e52be,_0x3d3c32[_0xfc9e('0x4e')])[_0xfc9e('0x13')](function(_0x61fd46){_0x30176c=_0x61fd46;logger[_0xfc9e('0xa')](_0xfc9e('0x4f'),_0x30176c['id']);return getEndUser(_0x4e52be,_0x1bca65[_0xfc9e('0x50')],_0x1bca65[_0xfc9e('0x51')]);})[_0xfc9e('0x13')](function(_0x1dfb71){_0x129de4=_0x1dfb71;logger[_0xfc9e('0xa')](_0xfc9e('0x52'),_0x129de4['id']);return getTicket(_0x4e52be,_0x30176c,_0x129de4,_0x5c7646,_0x1bca65);})[_0xfc9e('0x13')](function(_0x506533){if(_0x506533){logger[_0xfc9e('0xa')](_0xfc9e('0x53'),_0x506533['id']);switch(_0x4e52be[_0xfc9e('0x39')]){case _0xfc9e('0x54'):logger[_0xfc9e('0xa')]('[QUEUE]',_0xfc9e('0x55'));return request({'uri':util[_0xfc9e('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e52be[_0xfc9e('0x18')],_0x30176c['id'],_0x506533['id']),'method':'POST'});case _0xfc9e('0x56'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xfc9e('0x57'),_0x3d3c32[_0xfc9e('0xe')]),_0xfc9e('0x58'),{'uri':util['format'](_0xfc9e('0x59'),_0x4e52be[_0xfc9e('0x18')]['replace']('/api/v2',''),_0x506533['id'])});break;default:logger[_0xfc9e('0x5a')](_0xfc9e('0x49'),_0xfc9e('0x5b'));}}})['catch'](function(_0x5ced58){logger[_0xfc9e('0x5a')](_0xfc9e('0x5c'),util[_0xfc9e('0x5d')](_0x5ced58,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3e17ce,_0x511dbe,_0x3d160e,_0x15c5df,_0x5aa4f3,_0x12446d,_0x3bd0b1){var _0x5bb323,_0x314128;_0x12446d[_0xfc9e('0x18')]=intUtil[_0xfc9e('0x47')](_0x12446d[_0xfc9e('0x18')]);_0x12446d[_0xfc9e('0x46')]=intUtil[_0xfc9e('0x47')](_0x12446d[_0xfc9e('0x46')]);if(_0x3bd0b1&&_0x3bd0b1['recordingFormat']&&_0x3bd0b1[_0xfc9e('0x5e')]!==_0xfc9e('0x5f')){logger[_0xfc9e('0xa')](_0xfc9e('0x60'),_0xfc9e('0x4a'));_0x511dbe[_0xfc9e('0x4b')]=util[_0xfc9e('0x17')](_0xfc9e('0x61'),_0x12446d[_0xfc9e('0x46')],_0x511dbe[_0xfc9e('0x4c')],md5(_0x511dbe['uniqueid']));}headers[_0xfc9e('0x4d')]=getAuth(_0x12446d);return getUser(_0x12446d,_0x15c5df[_0xfc9e('0x4e')])[_0xfc9e('0x13')](function(_0x5a0b37){_0x5bb323=_0x5a0b37;logger[_0xfc9e('0xa')](_0xfc9e('0x4f'),_0x5bb323['id']);return getEndUser(_0x12446d,_0x511dbe[_0xfc9e('0x62')],_0x511dbe['destcalleridnum']);})[_0xfc9e('0x13')](function(_0x42f614){_0x314128=_0x42f614;logger['info'](_0xfc9e('0x52'),_0x314128['id']);return getTicket(_0x12446d,_0x5bb323,_0x314128,_0x3d160e,_0x511dbe);})[_0xfc9e('0x13')](function(_0x363a85){if(_0x363a85){logger[_0xfc9e('0xa')](_0xfc9e('0x53'),_0x363a85['id']);switch(_0x12446d['type']){case _0xfc9e('0x54'):logger[_0xfc9e('0xa')](_0xfc9e('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xfc9e('0x17')](_0xfc9e('0x63'),_0x12446d['remoteUri'],_0x5bb323['id'],_0x363a85['id']),'method':_0xfc9e('0xd')});case'newTab':logger[_0xfc9e('0xa')](_0xfc9e('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfc9e('0x17')]('user:%s',_0x15c5df[_0xfc9e('0xe')]),_0xfc9e('0x58'),{'uri':util[_0xfc9e('0x17')](_0xfc9e('0x59'),_0x12446d[_0xfc9e('0x18')]['replace'](_0xfc9e('0x64'),''),_0x363a85['id'])});break;default:logger[_0xfc9e('0x5a')](_0xfc9e('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xfc9e('0x65')](function(_0x276f67){logger[_0xfc9e('0x5a')](_0xfc9e('0x66'),util[_0xfc9e('0x5d')](_0x276f67,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x459716,_0x204f2c,_0x126260,_0x14416a,_0x4df5be,_0x2dce3c){var _0x499a6f,_0x1f7217;_0x2dce3c[_0xfc9e('0x18')]=intUtil[_0xfc9e('0x47')](_0x2dce3c['remoteUri']);_0x2dce3c['serverUrl']=intUtil[_0xfc9e('0x47')](_0x2dce3c[_0xfc9e('0x46')]);if(_0x4df5be&&_0x4df5be[_0xfc9e('0x48')]){logger['info']('['+_0x204f2c[_0xfc9e('0x67')][_0xfc9e('0x68')]()+']',_0xfc9e('0x4a'));_0x204f2c['recordingURL']=util[_0xfc9e('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dce3c['serverUrl'],_0x204f2c['uniqueid'],md5(_0x204f2c[_0xfc9e('0x4c')]));}else{_0x204f2c[_0xfc9e('0x4b')]='';}headers[_0xfc9e('0x4d')]=getAuth(_0x2dce3c);return getUser(_0x2dce3c)[_0xfc9e('0x13')](function(_0x4da2c8){_0x499a6f=_0x4da2c8;logger[_0xfc9e('0xa')](_0xfc9e('0x4f'),_0x499a6f['id']);return getEndUser(_0x2dce3c,_0x204f2c['calleridname'],_0x204f2c['calleridnum']);})[_0xfc9e('0x13')](function(_0x20faa6){_0x1f7217=_0x20faa6;logger[_0xfc9e('0xa')](_0xfc9e('0x52'),_0x1f7217['id']);return getTicket(_0x2dce3c,_0x499a6f,_0x1f7217,_0x126260,_0x204f2c);})[_0xfc9e('0x13')](function(_0x29aea8){if(_0x29aea8){logger[_0xfc9e('0xa')]('The\x20Ticket\x20ID\x20is:',_0x29aea8['id']);}})[_0xfc9e('0x65')](function(_0x2564e7){logger[_0xfc9e('0x5a')]('['+_0x204f2c[_0xfc9e('0x67')][_0xfc9e('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x2564e7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8183=['username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8183,0x188));var _0x3818=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x8183[_0x874cf1];return _0x233579;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0x3818('0x0'));var intUtil=require('./util');var config=require(_0x3818('0x1'));var logger=require(_0x3818('0x2'))(_0x3818('0x3'));config[_0x3818('0x4')]=_[_0x3818('0x5')](config[_0x3818('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3818('0x4')]));function emit(_0x559068,_0x47cf4a,_0x204498){io['to'](_0x559068)['emit'](_0x47cf4a,_0x204498);}var headers={'Content-Type':_0x3818('0x6'),'Accept':_0x3818('0x6')};function getTicket(_0x354828,_0xae1727,_0x1d5748,_0x115d3c,_0x446629){logger[_0x3818('0x7')](_0x3818('0x8'));return request({'uri':util[_0x3818('0x9')](_0x3818('0xa'),_0x354828[_0x3818('0xb')]),'method':_0x3818('0xc'),'body':{'ticket':_[_0x3818('0xd')]({'requester_id':_0x1d5748['id'],'submitter_id':_0xae1727?_0xae1727['id']:undefined,'assignee_id':_0xae1727?_0xae1727['id']:undefined,'tags':getTags(_0x115d3c[_0x3818('0xe')],_0x3818('0xf')),'subject':intUtil[_0x3818('0x10')](_0x115d3c[_0x3818('0x11')],_0x446629,'\x20'),'description':intUtil['getString'](_0x115d3c[_0x3818('0x12')],_0x446629,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x115d3c[_0x3818('0x12')],_0x446629,'\x0a')}},getCustomFields(_0x115d3c['Fields'],_0x446629))}})[_0x3818('0x13')](function(_0x4d0b52){logger[_0x3818('0x7')](_0x3818('0x14'));return _0x4d0b52[_0x3818('0x15')];});}function getUser(_0x34370e,_0x3a659c){if(intUtil[_0x3818('0x16')](_0x3a659c)){logger[_0x3818('0x7')](_0x3818('0x17'),_0x3a659c);return request({'uri':util[_0x3818('0x9')]('%s/search.json',_0x34370e['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x3a659c)}})[_0x3818('0x13')](function(_0xdece1){if(_0xdece1['count']){logger[_0x3818('0x7')](_0x3818('0x18'));return _[_0x3818('0x19')](_0xdece1[_0x3818('0x1a')],{'email':_0x3a659c,'role':_0x3818('0x1b')});}else{logger['info'](_0x3818('0x1c'));return request({'uri':util[_0x3818('0x9')](_0x3818('0x1d'),_0x34370e[_0x3818('0xb')])})[_0x3818('0x13')](function(_0x46c6e2){logger[_0x3818('0x7')]('Admin\x20account\x20selected.');return _0x46c6e2[_0x3818('0x1e')];});}});}else{logger[_0x3818('0x7')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x3818('0x9')](_0x3818('0x1d'),_0x34370e['remoteUri'])})[_0x3818('0x13')](function(_0x1dffa9){logger[_0x3818('0x7')](_0x3818('0x1f'));return _0x1dffa9[_0x3818('0x1e')];});}}function getEndUser(_0x26a857,_0x358fe6,_0x471a3c){logger[_0x3818('0x7')](_0x3818('0x20'),_0x471a3c);return request({'uri':util[_0x3818('0x9')](_0x3818('0x21'),_0x26a857[_0x3818('0xb')]),'qs':{'query':util[_0x3818('0x9')]('type:user\x20role:end-user\x20phone:%s',_0x471a3c)}})[_0x3818('0x13')](function(_0x34d371){var _0x27c326;if(_0x34d371[_0x3818('0x1a')][_0x3818('0x22')]){_0x34d371[_0x3818('0x1a')]=_['filter'](_0x34d371['results'],{'suspended':![],'role':_0x3818('0x23')});if(_0x34d371[_0x3818('0x1a')]['length']){_0x27c326=_[_0x3818('0x24')](_0x34d371[_0x3818('0x1a')]);}}if(_0x27c326){logger[_0x3818('0x7')](_0x3818('0x25'));return _0x27c326;}else{logger[_0x3818('0x7')](_0x3818('0x26'));return request({'uri':util[_0x3818('0x9')]('%s/users.json',_0x26a857[_0x3818('0xb')]),'method':_0x3818('0xc'),'body':{'user':{'role':'end-user','name':util['format'](_0x3818('0x27'),_0x358fe6||_0x471a3c),'phone':_0x471a3c}}})[_0x3818('0x13')](function(_0x39a5d3){logger[_0x3818('0x7')](_0x3818('0x28'));return _0x39a5d3[_0x3818('0x1e')];});}});}function getAuth(_0x2df607){var _0x1194a6;if(_0x2df607[_0x3818('0x29')]===_0x3818('0x2a')){_0x1194a6=util['format'](_0x3818('0x2b'),_0x2df607[_0x3818('0x2c')],_0x2df607['password']);}else if(_0x2df607[_0x3818('0x29')]===_0x3818('0x2d')){_0x1194a6=util[_0x3818('0x9')](_0x3818('0x2e'),_0x2df607['username'],_0x2df607[_0x3818('0x2d')]);}return util['format'](_0x3818('0x2f'),new Buffer(_0x1194a6)[_0x3818('0x30')]('base64'));}function request(_0x3967b0){logger[_0x3818('0x31')](_0x3818('0x32'),JSON[_0x3818('0x33')](_0x3967b0));return rp(_[_0x3818('0x5')](_0x3967b0,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x564659,_0x17b42f){var _0xb26762=[];if(_0x564659&&_0x564659[_0x3818('0x22')]>0x0){_0xb26762=_[_0x3818('0x34')](_0x564659,_0x17b42f);}return _0xb26762;}function getCustomFields(_0x29cc62,_0xf638e1){var _0x4671ee=[];var _0x5ac68d={'custom_fields':[]};if(_0x29cc62[_0x3818('0x22')]>0x0){_[_0x3818('0x35')](_0x29cc62,function(_0x32bc71){if(_[_0x3818('0x36')]([_0x3818('0x37'),_0x3818('0x38')],_0x32bc71[_0x3818('0x39')])&&_0x32bc71[_0x3818('0x3a')]&&!_0x32bc71[_0x3818('0x3b')]){_0x5ac68d[_0x32bc71['nameField'][_0x3818('0x3c')]()]=_0x32bc71[_0x3818('0x3d')][_0x3818('0x30')]();}else if(_[_0x3818('0x36')]([_0x3818('0x37'),_0x3818('0x38')],_0x32bc71[_0x3818('0x39')])&&_0x32bc71[_0x3818('0x3e')]&&_0x32bc71['customField']){_0x5ac68d[_0x3818('0x3f')][_0x3818('0x40')]({'id':_0x32bc71['idField'],'value':_0x32bc71[_0x3818('0x3d')][_0x3818('0x30')]()});}else if(_0x32bc71['type']==='variable'&&_0x32bc71[_0x3818('0x41')]&&_0x32bc71[_0x3818('0x3e')]&&_0x32bc71[_0x3818('0x3b')]){_0xf638e1[_0x32bc71[_0x3818('0x41')]]&&_0x5ac68d[_0x3818('0x3f')][_0x3818('0x40')]({'id':_0x32bc71['idField'],'value':_0xf638e1[_0x32bc71['variableName']][_0x3818('0x30')]()});}else if(_0x32bc71['type']==='customVariable'&&_0x32bc71[_0x3818('0x42')]&&_0x32bc71[_0x3818('0x42')][_0x3818('0xf')]&&_0x32bc71[_0x3818('0x3e')]&&_0x32bc71[_0x3818('0x3b')]){_0xf638e1[_0x32bc71['Variable'][_0x3818('0xf')][_0x3818('0x3c')]()]&&_0x5ac68d[_0x3818('0x3f')][_0x3818('0x40')]({'id':_0x32bc71['idField'],'value':_0xf638e1[_0x32bc71[_0x3818('0x42')]['name'][_0x3818('0x3c')]()][_0x3818('0x30')]()});}});}return _0x5ac68d;}exports[_0x3818('0x43')]=function(_0x404d6a,_0x107b7b,_0x2ba7f8,_0x327f3e,_0x12d788,_0x8b1edf){var _0x16cfb0,_0x5e9e63;_0x8b1edf[_0x3818('0xb')]=intUtil['stripTrailingSlash'](_0x8b1edf['remoteUri']);_0x8b1edf[_0x3818('0x44')]=intUtil[_0x3818('0x45')](_0x8b1edf[_0x3818('0x44')]);if(_0x12d788&&_0x12d788[_0x3818('0x46')]){logger[_0x3818('0x7')](_0x3818('0x47'),_0x3818('0x48'));_0x107b7b['recordingURL']=util[_0x3818('0x9')](_0x3818('0x49'),_0x8b1edf[_0x3818('0x44')],_0x107b7b[_0x3818('0x4a')],md5(_0x107b7b['uniqueid']));}else{_0x107b7b[_0x3818('0x4b')]='';}headers[_0x3818('0x4c')]=getAuth(_0x8b1edf);return getUser(_0x8b1edf,_0x327f3e[_0x3818('0x4d')])[_0x3818('0x13')](function(_0x1a2595){_0x16cfb0=_0x1a2595;logger['info'](_0x3818('0x4e'),_0x16cfb0['id']);return getEndUser(_0x8b1edf,_0x107b7b[_0x3818('0x4f')],_0x107b7b[_0x3818('0x50')]);})[_0x3818('0x13')](function(_0x3a64d5){_0x5e9e63=_0x3a64d5;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5e9e63['id']);return getTicket(_0x8b1edf,_0x16cfb0,_0x5e9e63,_0x2ba7f8,_0x107b7b);})[_0x3818('0x13')](function(_0x97473c){if(_0x97473c){logger[_0x3818('0x7')](_0x3818('0x51'),_0x97473c['id']);switch(_0x8b1edf[_0x3818('0x39')]){case _0x3818('0x52'):logger[_0x3818('0x7')](_0x3818('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3818('0x9')](_0x3818('0x53'),_0x8b1edf[_0x3818('0xb')],_0x16cfb0['id'],_0x97473c['id']),'method':'POST'});case'newTab':logger[_0x3818('0x7')](_0x3818('0x47'),_0x3818('0x54'));emit(util['format'](_0x3818('0x55'),_0x327f3e[_0x3818('0xf')]),_0x3818('0x56'),{'uri':util[_0x3818('0x9')](_0x3818('0x57'),_0x8b1edf[_0x3818('0xb')][_0x3818('0x58')](_0x3818('0x59'),''),_0x97473c['id'])});break;default:logger[_0x3818('0x5a')](_0x3818('0x47'),_0x3818('0x5b'));}}})['catch'](function(_0x5a7050){logger[_0x3818('0x5a')](_0x3818('0x5c'),util[_0x3818('0x5d')](_0x5a7050,{'showHidden':!![],'depth':null}));});};exports[_0x3818('0x5e')]=function(_0x2e4f1f,_0x8636a1,_0x4429a9,_0x430661,_0x4168ca,_0x1ac78e,_0x1e1ee8){var _0x3227d7,_0x20e85a;_0x1ac78e[_0x3818('0xb')]=intUtil[_0x3818('0x45')](_0x1ac78e[_0x3818('0xb')]);_0x1ac78e[_0x3818('0x44')]=intUtil[_0x3818('0x45')](_0x1ac78e[_0x3818('0x44')]);if(_0x1e1ee8&&_0x1e1ee8[_0x3818('0x5f')]&&_0x1e1ee8['recordingFormat']!==_0x3818('0x60')){logger[_0x3818('0x7')](_0x3818('0x61'),_0x3818('0x48'));_0x8636a1['recordingURL']=util[_0x3818('0x9')](_0x3818('0x49'),_0x1ac78e['serverUrl'],_0x8636a1[_0x3818('0x4a')],md5(_0x8636a1[_0x3818('0x4a')]));}headers['Authorization']=getAuth(_0x1ac78e);return getUser(_0x1ac78e,_0x430661[_0x3818('0x4d')])['then'](function(_0x7f534c){_0x3227d7=_0x7f534c;logger[_0x3818('0x7')](_0x3818('0x4e'),_0x3227d7['id']);return getEndUser(_0x1ac78e,_0x8636a1[_0x3818('0x62')],_0x8636a1[_0x3818('0x63')]);})['then'](function(_0x4eff76){_0x20e85a=_0x4eff76;logger['info'](_0x3818('0x64'),_0x20e85a['id']);return getTicket(_0x1ac78e,_0x3227d7,_0x20e85a,_0x4429a9,_0x8636a1);})['then'](function(_0x17ff46){if(_0x17ff46){logger[_0x3818('0x7')]('The\x20Ticket\x20ID\x20is:',_0x17ff46['id']);switch(_0x1ac78e[_0x3818('0x39')]){case _0x3818('0x52'):logger[_0x3818('0x7')]('[OUTBOUND]',_0x3818('0x65'));return request({'uri':util[_0x3818('0x9')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1ac78e['remoteUri'],_0x3227d7['id'],_0x17ff46['id']),'method':_0x3818('0xc')});case _0x3818('0x66'):logger[_0x3818('0x7')](_0x3818('0x61'),_0x3818('0x54'));emit(util[_0x3818('0x9')]('user:%s',_0x430661[_0x3818('0xf')]),_0x3818('0x56'),{'uri':util[_0x3818('0x9')](_0x3818('0x57'),_0x1ac78e[_0x3818('0xb')][_0x3818('0x58')](_0x3818('0x59'),''),_0x17ff46['id'])});break;default:logger['error'](_0x3818('0x61'),_0x3818('0x5b'));}}})[_0x3818('0x67')](function(_0x3bdc41){logger[_0x3818('0x5a')](_0x3818('0x68'),util[_0x3818('0x5d')](_0x3bdc41,{'showHidden':!![],'depth':null}));});};exports[_0x3818('0x69')]=function(_0xa17c23,_0x2f7dec,_0x583a09,_0x41e7e8,_0x122edd,_0x290af2){var _0x1f6dc1,_0x4b3cff;_0x290af2[_0x3818('0xb')]=intUtil[_0x3818('0x45')](_0x290af2['remoteUri']);_0x290af2[_0x3818('0x44')]=intUtil[_0x3818('0x45')](_0x290af2['serverUrl']);if(_0x122edd&&_0x122edd[_0x3818('0x46')]){logger[_0x3818('0x7')]('['+_0x2f7dec[_0x3818('0x6a')][_0x3818('0x6b')]()+']',_0x3818('0x48'));_0x2f7dec[_0x3818('0x4b')]=util[_0x3818('0x9')](_0x3818('0x49'),_0x290af2[_0x3818('0x44')],_0x2f7dec[_0x3818('0x4a')],md5(_0x2f7dec[_0x3818('0x4a')]));}else{_0x2f7dec[_0x3818('0x4b')]='';}headers[_0x3818('0x4c')]=getAuth(_0x290af2);return getUser(_0x290af2)['then'](function(_0x470dc8){_0x1f6dc1=_0x470dc8;logger[_0x3818('0x7')]('The\x20User\x20ID\x20is:',_0x1f6dc1['id']);return getEndUser(_0x290af2,_0x2f7dec['calleridname'],_0x2f7dec[_0x3818('0x50')]);})[_0x3818('0x13')](function(_0x852e4d){_0x4b3cff=_0x852e4d;logger['info'](_0x3818('0x64'),_0x4b3cff['id']);return getTicket(_0x290af2,_0x1f6dc1,_0x4b3cff,_0x583a09,_0x2f7dec);})[_0x3818('0x13')](function(_0x51c2af){if(_0x51c2af){logger[_0x3818('0x7')](_0x3818('0x51'),_0x51c2af['id']);}})['catch'](function(_0x34c44f){logger[_0x3818('0x5a')]('['+_0x2f7dec[_0x3818('0x6a')]['toUpperCase']()+']'+_0x3818('0x6c'),util[_0x3818('0x5d')](_0x34c44f,{'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 5a49fe8..c99df71 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 _0xa0e2=['outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','calleridname','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','emit','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','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','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id='];(function(_0xd82eb2,_0x504198){var _0x1b1c57=function(_0x1d6082){while(--_0x1d6082){_0xd82eb2['push'](_0xd82eb2['shift']());}};_0x1b1c57(++_0x504198);}(_0xa0e2,0xaa));var _0x2a0e=function(_0x235ceb,_0x903bb3){_0x235ceb=_0x235ceb-0x0;var _0x4974bf=_0xa0e2[_0x235ceb];return _0x4974bf;};'use strict';var _=require(_0x2a0e('0x0'));var rp=require(_0x2a0e('0x1'));var md5=require(_0x2a0e('0x2'));var util=require(_0x2a0e('0x3'));var intUtil=require(_0x2a0e('0x4'));var moment=require(_0x2a0e('0x5'));var Redis=require(_0x2a0e('0x6'));var BPromise=require(_0x2a0e('0x7'));var config=require(_0x2a0e('0x8'));var logger=require(_0x2a0e('0x9'))(_0x2a0e('0xa'));config['redis']=_[_0x2a0e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2a0e('0xc')]));function emit(_0x339857,_0x33ad16,_0x25e0bb){io['to'](_0x339857)[_0x2a0e('0xd')](_0x33ad16,_0x25e0bb);}function request(_0x4cbf43){logger['debug']('[HTTP]',JSON[_0x2a0e('0xe')](_0x4cbf43));return rp(_0x4cbf43);}function getCustomFields(_0x100d38,_0x3a5f8b){var _0x421f1e={};if(_0x100d38[_0x2a0e('0xf')]>0x0){_[_0x2a0e('0x10')](_0x100d38,function(_0x523ee6){if(_[_0x2a0e('0x11')]([_0x2a0e('0x12'),_0x2a0e('0x13')],_0x523ee6[_0x2a0e('0x14')])&&_0x523ee6[_0x2a0e('0x15')]){_0x421f1e[_0x523ee6[_0x2a0e('0x15')]]=_0x523ee6[_0x2a0e('0x16')][_0x2a0e('0x17')]();}else if(_0x523ee6[_0x2a0e('0x14')]===_0x2a0e('0x18')&&_0x523ee6[_0x2a0e('0x19')]&&_0x523ee6[_0x2a0e('0x15')]&&_0x3a5f8b[_0x523ee6[_0x2a0e('0x19')]]){_0x421f1e[_0x523ee6['idField']]=_0x3a5f8b[_0x523ee6[_0x2a0e('0x19')]][_0x2a0e('0x17')]();}else if(_0x523ee6[_0x2a0e('0x14')]===_0x2a0e('0x1a')&&_0x523ee6[_0x2a0e('0x1b')]&&_0x523ee6[_0x2a0e('0x1b')][_0x2a0e('0x1c')]&&_0x523ee6['idField']&&_0x3a5f8b[_0x523ee6[_0x2a0e('0x1b')][_0x2a0e('0x1c')][_0x2a0e('0x1d')]()]){_0x421f1e[_0x523ee6[_0x2a0e('0x15')]]=_0x3a5f8b[_0x523ee6[_0x2a0e('0x1b')]['name'][_0x2a0e('0x1d')]()][_0x2a0e('0x17')]();}});}return _0x421f1e;}function getName(_0x82240e){if(_0x82240e['indexOf']('\x20')>0x0){var _0x19972b=_0x82240e[_0x2a0e('0x1e')](/ (.+)/);if(_0x19972b[0x1]){return _0x19972b;}}return[_0x82240e,_0x82240e];}var accountsTokens={};function getAccessToken(_0x160c8f){return new Promise(function(_0x1b642d,_0x2f3795){if(!_[_0x2a0e('0x1f')](accountsTokens[_0x160c8f['id']])&&!_[_0x2a0e('0x1f')](accountsTokens[_0x160c8f['id']]['access_token'])){if(moment()[_0x2a0e('0x20')](accountsTokens[_0x160c8f['id']][_0x2a0e('0x21')])){_0x1b642d(accountsTokens[_0x160c8f['id']][_0x2a0e('0x22')]);}}var _0x1a9085;switch(_0x160c8f[_0x2a0e('0x23')]){case'US':_0x1a9085='https://accounts.zoho.com';break;case'AU':_0x1a9085=_0x2a0e('0x24');break;case'EU':_0x1a9085=_0x2a0e('0x25');break;case'IN':_0x1a9085='https://accounts.zoho.in';break;case'CN':_0x1a9085=_0x2a0e('0x26');break;default:_0x1a9085=_0x2a0e('0x25');break;}var _0x213719={'method':_0x2a0e('0x27'),'uri':_0x1a9085+_0x2a0e('0x28'),'qs':{'refresh_token':_0x160c8f[_0x2a0e('0x29')],'client_id':_0x160c8f[_0x2a0e('0x2a')],'client_secret':_0x160c8f[_0x2a0e('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x213719)[_0x2a0e('0x2c')](function(_0x44f5b6){accountsTokens[_0x160c8f['id']]={'access_token':_0x44f5b6['access_token'],'expires_in':moment()[_0x2a0e('0x2d')](_0x44f5b6[_0x2a0e('0x21')],_0x2a0e('0x2e'))};_0x1b642d(_0x44f5b6['access_token']);})[_0x2a0e('0x2f')](function(_0x1beffb){logger[_0x2a0e('0x30')]('Failing\x20creating\x20the\x20access_token',_0x1beffb[_0x2a0e('0x31')]);_0x2f3795(_0x1beffb);});});}function getUser(_0x250f59,_0x1640c4,_0x2ecd43,_0x334814){logger[_0x2a0e('0x32')](_0x2a0e('0x33'));return request({'method':_0x2a0e('0x34'),'uri':util[_0x2a0e('0x35')]('https://www.zohoapis.%s/crm/v2/users',_0x1640c4),'qs':{'type':_0x2a0e('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x250f59},'json':!![]})[_0x2a0e('0x2c')](function(_0x766801){if(_0x766801['users']){var _0x7ffc62=-0x1;if(_['isArrayLikeObject'](_0x766801[_0x2a0e('0x37')])){if(!_['isNil'](_0x334814)){_0x7ffc62=_[_0x2a0e('0x38')](_0x766801[_0x2a0e('0x37')],function(_0x4f12f6){return _0x4f12f6[_0x2a0e('0x39')]===_0x334814;});}if(_0x7ffc62>=0x0){logger[_0x2a0e('0x32')](_0x2a0e('0x3a'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x7ffc62=_['findIndex'](_0x766801[_0x2a0e('0x37')],function(_0x26f97f){return _0x26f97f[_0x2a0e('0x3b')][_0x2a0e('0x1c')]===_0x2a0e('0x3c');});}return _0x766801[_0x2a0e('0x37')][_0x7ffc62];}else{if(_0x766801[_0x2a0e('0x3d')][_0x2a0e('0x3b')][_0x2a0e('0x1c')]===_0x2a0e('0x3c')){logger[_0x2a0e('0x32')](_0x2a0e('0x3e'));user=_0x766801[_0x2a0e('0x3d')];return user;}else{logger[_0x2a0e('0x30')](_0x2a0e('0x3f'),JSON[_0x2a0e('0xe')](_0x766801));throw new Error(_0x2a0e('0x40')+JSON[_0x2a0e('0xe')](_0x766801));}}}else{logger[_0x2a0e('0x30')](_0x2a0e('0x3f'),JSON[_0x2a0e('0xe')](_0x766801));throw new Error(_0x2a0e('0x40')+JSON[_0x2a0e('0xe')](_0x766801));}})[_0x2a0e('0x2f')](function(_0x778734){console[_0x2a0e('0x30')](_0x778734);});}function getZohoUser(_0x24f020,_0x13ddfc){return new BPromise(function(_0x2c4055,_0x213fef){request(_0x24f020)['then'](function(_0x59734f){var _0x293a8f=null;if(_0x59734f){_0x293a8f=_0x59734f[_0x2a0e('0x41')][0x0];_0x293a8f[_0x2a0e('0x42')]=_0x13ddfc;}_0x2c4055(_0x293a8f);})[_0x2a0e('0x2f')](function(_0xe4bccf){_0x213fef(_0xe4bccf);});});}function createEndUser(_0x4d8c6b,_0x53583e,_0x1f6db3,_0x40c0fc,_0x34f959,_0x27ddef){var _0x1f6db3=getName(_0x1f6db3);return request({'method':_0x2a0e('0x27'),'uri':_0x2a0e('0x43')+_0x53583e+_0x2a0e('0x44')+_[_0x2a0e('0x45')](_0x27ddef[_0x2a0e('0x46')])+'s','body':{'data':[{'Last_Name':_0x1f6db3[0x1],'First_Name':_0x1f6db3[0x0],'Phone':_0x40c0fc,'Owner':{'name':!_[_0x2a0e('0x1f')](_0x34f959[_0x2a0e('0x47')][_0x2a0e('0x1c')])?_0x34f959['role'][_0x2a0e('0x1c')]:!_[_0x2a0e('0x1f')](_0x34f959[_0x2a0e('0x48')])?_0x34f959[_0x2a0e('0x48')]+'\x20'+_0x34f959[_0x2a0e('0x49')]:_0x34f959[_0x2a0e('0x49')],'id':_0x34f959['id']}}]},'headers':{'Authorization':_0x2a0e('0x4a')+_0x4d8c6b},'json':!![]})[_0x2a0e('0x2c')](function(_0x573f22){if(_0x573f22&&_0x573f22[_0x2a0e('0x41')][0x0][_0x2a0e('0x4b')]==='SUCCESS'){var _0xc6124a=_0x573f22[_0x2a0e('0x41')][0x0]['details'];_0xc6124a[_0x2a0e('0x42')]=_['startCase'](_0x27ddef[_0x2a0e('0x46')])+'s';return _0xc6124a;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x2a0e('0xe')](data));throw new Error(_0x2a0e('0x4c')+JSON[_0x2a0e('0xe')](data));})[_0x2a0e('0x2f')](function(_0x12f9da){console[_0x2a0e('0x4d')](_0x2a0e('0x4e'),_0x12f9da);});}function getEndUser(_0x42269c,_0x46b2a5,_0x5ce514,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a){var _0x55b7d7={'method':_0x2a0e('0x34'),'uri':'','headers':{'Authorization':_0x2a0e('0x4a')+_0x42269c},'json':!![]};switch(_0xd0223a[_0x2a0e('0x4f')]){case _0x2a0e('0x50'):_0x55b7d7[_0x2a0e('0x51')]=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x52')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,_0x2a0e('0x53'))[_0x2a0e('0x2c')](function(_0x1662c5){if(_0x1662c5)return _0x1662c5;_0x55b7d7[_0x2a0e('0x51')]=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x54')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,'Leads')['then'](function(_0x387efc){if(_0x387efc)return _0x387efc;if(_0xd0223a[_0x2a0e('0x46')]!=_0x2a0e('0x55')){return createEndUser(_0x42269c,_0x46b2a5,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a);}else{return{};}});});break;case'contact':_0x55b7d7['uri']=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x52')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,_0x2a0e('0x53'))[_0x2a0e('0x2c')](function(_0x5504f5){if(_0x5504f5)return _0x5504f5;if(_0xd0223a['moduleCreate']!=_0x2a0e('0x55')){return createEndUser(_0x42269c,_0x46b2a5,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a);}else{return{};}});break;case'lead':_0x55b7d7[_0x2a0e('0x51')]=_0x2a0e('0x43')+_0x46b2a5+_0x2a0e('0x54')+_0x78cde8+'))';return getZohoUser(_0x55b7d7,_0x2a0e('0x56'))['then'](function(_0x103ab8){if(_0x103ab8)return _0x103ab8;if(_0xd0223a[_0x2a0e('0x46')]!=_0x2a0e('0x55')){return createEndUser(_0x42269c,_0x46b2a5,_0x538a92,_0x78cde8,_0x571d9e,_0xd0223a);}else{return{};}});break;}}function getCall(_0x1088fe,_0x27ed95,_0x1cfeef,_0x308b8d,_0x48b6d4,_0x4fbf17,_0x58908c,_0x40e35c){logger[_0x2a0e('0x32')](_0x2a0e('0x57'));var _0x42d7b7={};_0x42d7b7[_0x2a0e('0x58')]={'name':!_[_0x2a0e('0x1f')](_0x308b8d[_0x2a0e('0x47')][_0x2a0e('0x1c')])&&!_[_0x2a0e('0x1f')](_0x308b8d[_0x2a0e('0x3b')][_0x2a0e('0x1c')])&&_0x308b8d[_0x2a0e('0x3b')][_0x2a0e('0x1c')]===_0x2a0e('0x59')?_0x308b8d[_0x2a0e('0x47')][_0x2a0e('0x1c')]:!_[_0x2a0e('0x1f')](_0x308b8d[_0x2a0e('0x48')])?_0x308b8d[_0x2a0e('0x48')]+'\x20'+_0x308b8d[_0x2a0e('0x49')]:_0x308b8d[_0x2a0e('0x49')],'id':_0x308b8d['id']};_0x42d7b7[_0x2a0e('0x5a')]=intUtil[_0x2a0e('0x5b')](_0x4fbf17[_0x2a0e('0x5c')],_0x58908c,'\x20');_0x42d7b7[_0x2a0e('0x5d')]=intUtil[_0x2a0e('0x5b')](_0x4fbf17[_0x2a0e('0x5e')],_0x58908c,'\x0a');if(_0x48b6d4[_0x2a0e('0x42')]===_0x2a0e('0x53')){_0x42d7b7[_0x2a0e('0x5f')]={'name':!_['isNil'](_0x48b6d4['Full_Name'])?_0x48b6d4[_0x2a0e('0x60')]:!_[_0x2a0e('0x1f')](_0x48b6d4[_0x2a0e('0x61')])?_0x48b6d4[_0x2a0e('0x61')]+'\x20'+_0x48b6d4['Last_Name']:_0x48b6d4[_0x2a0e('0x62')],'id':_0x48b6d4['id']};}if(_0x48b6d4[_0x2a0e('0x42')]===_0x2a0e('0x56')){_0x42d7b7[_0x2a0e('0x63')]={'name':!_[_0x2a0e('0x1f')](_0x48b6d4[_0x2a0e('0x60')])?_0x48b6d4[_0x2a0e('0x60')]:!_[_0x2a0e('0x1f')](_0x48b6d4[_0x2a0e('0x61')])?_0x48b6d4['First_Name']+'\x20'+_0x48b6d4['Last_Name']:_0x48b6d4['Last_Name'],'id':_0x48b6d4['id']};_0x42d7b7[_0x2a0e('0x64')]=_[_0x2a0e('0x45')](_0x48b6d4[_0x2a0e('0x42')]);}if(_0x58908c[_0x2a0e('0x65')]){_0x42d7b7['Call_Duration']=moment[_0x2a0e('0x66')](parseInt(_0x58908c[_0x2a0e('0x65')])*0x3e8)[_0x2a0e('0x35')](_0x2a0e('0x67'));}else if(_0x58908c[_0x2a0e('0x68')]&&_0x58908c[_0x2a0e('0x69')]){_0x42d7b7[_0x2a0e('0x6a')]=moment['utc'](moment(_0x58908c[_0x2a0e('0x69')],_0x2a0e('0x6b'))[_0x2a0e('0x6c')](moment(_0x58908c[_0x2a0e('0x6d')],_0x2a0e('0x6b'))))[_0x2a0e('0x35')]('mm:ss');}switch(_0x58908c[_0x2a0e('0x6e')]){case _0x2a0e('0x6f'):_0x42d7b7['Call_Result']=_0x2a0e('0x70');break;case _0x2a0e('0x71'):case _0x2a0e('0x72'):_0x42d7b7[_0x2a0e('0x73')]=_0x2a0e('0x74');break;case _0x2a0e('0x75'):_0x42d7b7['Call_Result']=_0x2a0e('0x76');break;case'abandoned':_0x42d7b7['Call_Result']=_0x2a0e('0x77');break;case _0x2a0e('0x78'):_0x42d7b7['Call_Result']=_0x2a0e('0x79');default:}_0x42d7b7['Call_Start_Time']=(_0x40e35c==='outbound'?moment(_0x58908c[_0x2a0e('0x6d')])['format'](_0x2a0e('0x6b')):moment(_0x58908c['agentcalledAt'])[_0x2a0e('0x35')](_0x2a0e('0x6b')))||moment()[_0x2a0e('0x35')](_0x2a0e('0x6b'));_0x42d7b7[_0x2a0e('0x7a')]=_0x40e35c||_0x2a0e('0x7b');_0x42d7b7=_['merge'](_0x42d7b7,getCustomFields(_0x4fbf17[_0x2a0e('0x7c')],_0x58908c));return request({'method':_0x2a0e('0x27'),'uri':_0x2a0e('0x43')+_0x27ed95+_0x2a0e('0x7d'),'headers':{'Authorization':_0x2a0e('0x4a')+_0x1088fe},'body':{'data':[_0x42d7b7]},'json':!![]})['then'](function(_0xf4500a){if(_0xf4500a&&_0xf4500a[_0x2a0e('0x41')][0x0]['code']==='SUCCESS'){logger[_0x2a0e('0x32')](_0x2a0e('0x7e'));return{'id':_0xf4500a[_0x2a0e('0x41')][0x0]['details']['id']};}})[_0x2a0e('0x2f')](function(_0x1c4357){logger[_0x2a0e('0x32')](_0x2a0e('0x7f'),_0x1c4357[_0x2a0e('0x31')]);console[_0x2a0e('0x4d')](_0x2a0e('0x7f'),_0x1c4357);});}exports[_0x2a0e('0x80')]=function(_0x1531bc,_0x38dee7,_0x21dd92,_0x422dfc,_0x242ba3,_0x2e09cf){var _0x53b861,_0x37813b,_0x54d484;_0x2e09cf[_0x2a0e('0x81')]=intUtil[_0x2a0e('0x82')](_0x2e09cf[_0x2a0e('0x81')]);_0x2e09cf[_0x2a0e('0x83')]=intUtil[_0x2a0e('0x82')](_0x2e09cf[_0x2a0e('0x83')]);if(_0x242ba3&&_0x242ba3[_0x2a0e('0x84')]){logger[_0x2a0e('0x32')]('[QUEUE]','Recording\x20is\x20enabled!');_0x38dee7[_0x2a0e('0x85')]=_0x2e09cf[_0x2a0e('0x83')]+_0x2a0e('0x86')+_0x38dee7[_0x2a0e('0x87')]+_0x2a0e('0x88')+md5(_0x38dee7[_0x2a0e('0x87')]);}else{_0x38dee7[_0x2a0e('0x85')]='';}var _0x408c95=_0x2e09cf[_0x2a0e('0x81')]===_0x2a0e('0x89')?'eu':_0x2a0e('0x8a');return getAccessToken(_0x2e09cf)[_0x2a0e('0x2c')](function(_0x3f8666){_0x54d484=_0x3f8666;return getUser(_0x54d484,_0x408c95,_0x2e09cf,_0x422dfc[_0x2a0e('0x39')]);})[_0x2a0e('0x2c')](function(_0x33a8b6){_0x53b861=_0x33a8b6;logger[_0x2a0e('0x32')](_0x2a0e('0x8b'),_0x53b861['id']);return getEndUser(_0x54d484,_0x408c95,_0x2e09cf,_0x38dee7['calleridname'],_0x38dee7[_0x2a0e('0x8c')],_0x53b861,_0x21dd92);})['then'](function(_0x495ae6){_0x37813b=_0x495ae6;return getCall(_0x54d484,_0x408c95,_0x2e09cf,_0x53b861,_0x37813b,_0x21dd92,_0x38dee7,_0x2a0e('0x7b'));})[_0x2a0e('0x2c')](function(_0x240c12){if(_0x240c12){logger[_0x2a0e('0x32')](_0x2a0e('0x8d'),_0x240c12['id']);logger['info'](_0x2a0e('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2a0e('0x35')]('user:%s',_0x422dfc[_0x2a0e('0x1c')]),_0x2a0e('0x8f'),{'uri':_0x2a0e('0x90')+_0x2e09cf[_0x2a0e('0x81')]+_0x2a0e('0x91')+_0x240c12['id']});}})['catch'](function(_0x426b70){logger[_0x2a0e('0x30')](_0x2a0e('0x8e'),JSON['stringify'](_0x426b70));});};exports[_0x2a0e('0x92')]=function(_0xf3904b,_0x47c2d0,_0x150fec,_0x2a5b9d,_0x1bb0e9,_0xb385a2,_0x5f22ea){var _0x5b5de7,_0x597af5,_0x1e1d6f;_0xb385a2[_0x2a0e('0x81')]=intUtil[_0x2a0e('0x82')](_0xb385a2[_0x2a0e('0x81')]);_0xb385a2[_0x2a0e('0x83')]=intUtil[_0x2a0e('0x82')](_0xb385a2['serverUrl']);if(_0x5f22ea&&_0x5f22ea[_0x2a0e('0x93')]&&_0x5f22ea['recordingFormat']!==_0x2a0e('0x94')){logger[_0x2a0e('0x32')](_0x2a0e('0x95'),_0x2a0e('0x96'));_0x47c2d0['recordingURL']=_0xb385a2['serverUrl']+_0x2a0e('0x86')+_0x47c2d0[_0x2a0e('0x87')]+_0x2a0e('0x88')+md5(_0x47c2d0['uniqueid']);}var _0x1e0e5f=_0xb385a2['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0xb385a2)[_0x2a0e('0x2c')](function(_0x28e877){_0x1e1d6f=_0x28e877;return getUser(_0x1e1d6f,_0x1e0e5f,_0xb385a2,_0x2a5b9d['email']);})[_0x2a0e('0x2c')](function(_0x337474){_0x5b5de7=_0x337474;logger[_0x2a0e('0x32')](_0x2a0e('0x8b'),_0x5b5de7['id']);return getEndUser(_0x1e1d6f,_0x1e0e5f,_0xb385a2,_0x47c2d0[_0x2a0e('0x97')],_0x47c2d0[_0x2a0e('0x98')],_0x5b5de7,_0x150fec);})[_0x2a0e('0x2c')](function(_0x430643){_0x597af5=_0x430643;return getCall(_0x1e1d6f,_0x1e0e5f,_0xb385a2,_0x5b5de7,_0x597af5,_0x150fec,_0x47c2d0,_0x2a0e('0x99'));})[_0x2a0e('0x2c')](function(_0x3972fc){if(_0x3972fc){logger[_0x2a0e('0x32')](_0x2a0e('0x8d'),_0x3972fc['id']);logger[_0x2a0e('0x32')](_0x2a0e('0x95'),_0x2a0e('0x9a'));emit(util['format']('user:%s',_0x2a5b9d[_0x2a0e('0x1c')]),'trigger:browser:url',{'uri':_0x2a0e('0x90')+_0xb385a2[_0x2a0e('0x81')]+_0x2a0e('0x91')+_0x3972fc['id']});}})[_0x2a0e('0x2f')](function(_0x3ef98a){logger[_0x2a0e('0x30')](_0x2a0e('0x95'),JSON['stringify'](_0x3ef98a));});};exports[_0x2a0e('0x9b')]=function(_0x14f1dc,_0x2f25b4,_0x2c4d45,_0x2375ff,_0x1e0177,_0x229f83){var _0x1f27e0,_0x137820,_0x21ae99;_0x229f83[_0x2a0e('0x81')]=intUtil[_0x2a0e('0x82')](_0x229f83[_0x2a0e('0x81')]);_0x229f83[_0x2a0e('0x83')]=intUtil['stripTrailingSlash'](_0x229f83[_0x2a0e('0x83')]);if(_0x1e0177&&_0x1e0177['monitor_format']){logger['info']('['+_0x2f25b4[_0x2a0e('0x6e')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2f25b4['recordingURL']=_0x229f83['serverUrl']+_0x2a0e('0x86')+_0x2f25b4[_0x2a0e('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x2f25b4['uniqueid']);}else{_0x2f25b4[_0x2a0e('0x85')]='';}var _0x5b7061=_0x229f83[_0x2a0e('0x81')]===_0x2a0e('0x89')?'eu':_0x2a0e('0x8a');return getAccessToken(_0x229f83)[_0x2a0e('0x2c')](function(_0x55d23e){_0x21ae99=_0x55d23e;return getUser(_0x21ae99,_0x5b7061,_0x229f83);})[_0x2a0e('0x2c')](function(_0x3a01e9){_0x1f27e0=_0x3a01e9;logger[_0x2a0e('0x32')]('The\x20User\x20ID\x20is:',_0x1f27e0['id']);return getEndUser(_0x21ae99,_0x5b7061,_0x229f83,_0x2f25b4[_0x2a0e('0x9c')],_0x2f25b4[_0x2a0e('0x8c')],_0x1f27e0,_0x2c4d45);})[_0x2a0e('0x2c')](function(_0x4cf625){_0x137820=_0x4cf625;return getCall(_0x21ae99,_0x5b7061,_0x229f83,_0x1f27e0,_0x137820,_0x2c4d45,_0x2f25b4,'Inbound');})[_0x2a0e('0x2c')](function(_0x204ebd){if(_0x204ebd){logger['info'](_0x2a0e('0x8d'),_0x204ebd['id']);}})['catch'](function(_0x67f6ce){logger[_0x2a0e('0x30')]('['+_0x2f25b4[_0x2a0e('0x6e')][_0x2a0e('0x9d')]()+']',JSON[_0x2a0e('0xe')](_0x67f6ce));});}; \ No newline at end of file +var _0x2f45=['moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','lead','nothing','Owner','administrator','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','startCase','talktime','Call_Duration','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Call_Result','Called','complete','Answered','rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','[OUTBOUND]','Outbound','trigger:browser:url','https://crm.','lastevent','calleridnum','toUpperCase','lodash','request-promise','md5','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','isArrayLikeObject','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f45,0x18a));var _0x52f4=function(_0xe39f5,_0x594bb3){_0xe39f5=_0xe39f5-0x0;var _0x3d722f=_0x2f45[_0xe39f5];return _0x3d722f;};'use strict';var _=require(_0x52f4('0x0'));var rp=require(_0x52f4('0x1'));var md5=require(_0x52f4('0x2'));var util=require('util');var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x52f4('0x3'));var BPromise=require(_0x52f4('0x4'));var config=require(_0x52f4('0x5'));var logger=require(_0x52f4('0x6'))(_0x52f4('0x7'));config[_0x52f4('0x8')]=_[_0x52f4('0x9')](config[_0x52f4('0x8')],{'host':_0x52f4('0xa'),'port':0x18eb});var io=require(_0x52f4('0xb'))(new Redis(config['redis']));function emit(_0x411dd9,_0x10a21f,_0x3df1ec){io['to'](_0x411dd9)[_0x52f4('0xc')](_0x10a21f,_0x3df1ec);}function request(_0xd40cf8){logger[_0x52f4('0xd')](_0x52f4('0xe'),JSON[_0x52f4('0xf')](_0xd40cf8));return rp(_0xd40cf8);}function getCustomFields(_0x2e5de8,_0xe16c9e){var _0x1480ec={};if(_0x2e5de8[_0x52f4('0x10')]>0x0){_[_0x52f4('0x11')](_0x2e5de8,function(_0x2ae28f){if(_[_0x52f4('0x12')]([_0x52f4('0x13'),'picklist'],_0x2ae28f[_0x52f4('0x14')])&&_0x2ae28f[_0x52f4('0x15')]){_0x1480ec[_0x2ae28f['idField']]=_0x2ae28f[_0x52f4('0x16')][_0x52f4('0x17')]();}else if(_0x2ae28f[_0x52f4('0x14')]===_0x52f4('0x18')&&_0x2ae28f[_0x52f4('0x19')]&&_0x2ae28f['idField']&&_0xe16c9e[_0x2ae28f[_0x52f4('0x19')]]){_0x1480ec[_0x2ae28f[_0x52f4('0x15')]]=_0xe16c9e[_0x2ae28f['variableName']][_0x52f4('0x17')]();}else if(_0x2ae28f[_0x52f4('0x14')]===_0x52f4('0x1a')&&_0x2ae28f[_0x52f4('0x1b')]&&_0x2ae28f[_0x52f4('0x1b')][_0x52f4('0x1c')]&&_0x2ae28f[_0x52f4('0x15')]&&_0xe16c9e[_0x2ae28f[_0x52f4('0x1b')][_0x52f4('0x1c')]['toLowerCase']()]){_0x1480ec[_0x2ae28f[_0x52f4('0x15')]]=_0xe16c9e[_0x2ae28f[_0x52f4('0x1b')][_0x52f4('0x1c')][_0x52f4('0x1d')]()]['toString']();}});}return _0x1480ec;}function getName(_0x2b32e6){if(_0x2b32e6[_0x52f4('0x1e')]('\x20')>0x0){var _0x5e1d0c=_0x2b32e6[_0x52f4('0x1f')](/ (.+)/);if(_0x5e1d0c[0x1]){return _0x5e1d0c;}}return[_0x2b32e6,_0x2b32e6];}var accountsTokens={};function getAccessToken(_0x1e759a){return new Promise(function(_0xf901cc,_0x3ace9b){if(!_[_0x52f4('0x20')](accountsTokens[_0x1e759a['id']])&&!_[_0x52f4('0x20')](accountsTokens[_0x1e759a['id']][_0x52f4('0x21')])){if(moment()['isBefore'](accountsTokens[_0x1e759a['id']][_0x52f4('0x22')])){_0xf901cc(accountsTokens[_0x1e759a['id']][_0x52f4('0x21')]);}}var _0x46023a;switch(_0x1e759a[_0x52f4('0x23')]){case'US':_0x46023a=_0x52f4('0x24');break;case'AU':_0x46023a=_0x52f4('0x25');break;case'EU':_0x46023a='https://accounts.zoho.eu';break;case'IN':_0x46023a=_0x52f4('0x26');break;case'CN':_0x46023a=_0x52f4('0x27');break;default:_0x46023a=_0x52f4('0x28');break;}var _0x1dc060={'method':_0x52f4('0x29'),'uri':_0x46023a+_0x52f4('0x2a'),'qs':{'refresh_token':_0x1e759a[_0x52f4('0x2b')],'client_id':_0x1e759a[_0x52f4('0x2c')],'client_secret':_0x1e759a[_0x52f4('0x2d')],'grant_type':_0x52f4('0x2e')},'json':!![]};return rp(_0x1dc060)['then'](function(_0x3271fe){accountsTokens[_0x1e759a['id']]={'access_token':_0x3271fe[_0x52f4('0x21')],'expires_in':moment()[_0x52f4('0x2f')](_0x3271fe['expires_in'],_0x52f4('0x30'))};_0xf901cc(_0x3271fe[_0x52f4('0x21')]);})['catch'](function(_0x2c0e65){logger[_0x52f4('0x31')](_0x52f4('0x32'),_0x2c0e65[_0x52f4('0x33')]);_0x3ace9b(_0x2c0e65);});});}function getUser(_0x9a808e,_0x1af5e8,_0x28bc10,_0x53472c){logger['info'](_0x52f4('0x34'));return request({'method':_0x52f4('0x35'),'uri':util[_0x52f4('0x36')](_0x52f4('0x37'),_0x1af5e8),'qs':{'type':_0x52f4('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x9a808e},'json':!![]})[_0x52f4('0x39')](function(_0x3b37d5){if(_0x3b37d5[_0x52f4('0x3a')]){var _0x1c567f=-0x1;if(_[_0x52f4('0x3b')](_0x3b37d5[_0x52f4('0x3a')])){if(!_[_0x52f4('0x20')](_0x53472c)){_0x1c567f=_[_0x52f4('0x3c')](_0x3b37d5[_0x52f4('0x3a')],function(_0x447fc4){return _0x447fc4['email']===_0x53472c;});}if(_0x1c567f>=0x0){logger['info'](_0x52f4('0x3d'));}else{logger[_0x52f4('0x3e')](_0x52f4('0x3f'));_0x1c567f=_[_0x52f4('0x3c')](_0x3b37d5[_0x52f4('0x3a')],function(_0x327eaf){return _0x327eaf['profile'][_0x52f4('0x1c')]===_0x52f4('0x40');});}return _0x3b37d5[_0x52f4('0x3a')][_0x1c567f];}else{if(_0x3b37d5[_0x52f4('0x41')][_0x52f4('0x42')][_0x52f4('0x1c')]===_0x52f4('0x40')){logger[_0x52f4('0x3e')](_0x52f4('0x3f'));user=_0x3b37d5[_0x52f4('0x41')];return user;}else{logger[_0x52f4('0x31')](_0x52f4('0x43'),JSON[_0x52f4('0xf')](_0x3b37d5));throw new Error(_0x52f4('0x44')+JSON[_0x52f4('0xf')](_0x3b37d5));}}}else{logger[_0x52f4('0x31')](_0x52f4('0x43'),JSON['stringify'](_0x3b37d5));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x52f4('0xf')](_0x3b37d5));}})[_0x52f4('0x45')](function(_0x395015){console['error'](_0x395015);});}function getZohoUser(_0x403d29,_0xe4eb51){return new BPromise(function(_0x42f71e,_0x526fff){request(_0x403d29)['then'](function(_0x426b76){var _0x2809c7=null;if(_0x426b76){_0x2809c7=_0x426b76['data'][0x0];_0x2809c7[_0x52f4('0x46')]=_0xe4eb51;}_0x42f71e(_0x2809c7);})[_0x52f4('0x45')](function(_0x58d598){_0x526fff(_0x58d598);});});}function createEndUser(_0x3493ad,_0x1f1a69,_0x3bef26,_0x1e0f5f,_0x5eb6e7,_0x30fd05){var _0x3bef26=getName(_0x3bef26);return request({'method':_0x52f4('0x29'),'uri':'https://www.zohoapis.'+_0x1f1a69+'/crm/v2/'+_['startCase'](_0x30fd05[_0x52f4('0x47')])+'s','body':{'data':[{'Last_Name':_0x3bef26[0x1],'First_Name':_0x3bef26[0x0],'Phone':_0x1e0f5f,'Owner':{'name':!_[_0x52f4('0x20')](_0x5eb6e7['role'][_0x52f4('0x1c')])?_0x5eb6e7[_0x52f4('0x48')][_0x52f4('0x1c')]:!_[_0x52f4('0x20')](_0x5eb6e7[_0x52f4('0x49')])?_0x5eb6e7[_0x52f4('0x49')]+'\x20'+_0x5eb6e7[_0x52f4('0x4a')]:_0x5eb6e7['last_name'],'id':_0x5eb6e7['id']}}]},'headers':{'Authorization':_0x52f4('0x4b')+_0x3493ad},'json':!![]})[_0x52f4('0x39')](function(_0x5408c6){if(_0x5408c6&&_0x5408c6[_0x52f4('0x4c')][0x0]['code']===_0x52f4('0x4d')){var _0x474347=_0x5408c6[_0x52f4('0x4c')][0x0][_0x52f4('0x4e')];_0x474347['enduserType']=_['startCase'](_0x30fd05[_0x52f4('0x47')])+'s';return _0x474347;}logger[_0x52f4('0x31')](_0x52f4('0x43'),JSON[_0x52f4('0xf')](data));throw new Error(_0x52f4('0x4f')+JSON['stringify'](data));})[_0x52f4('0x45')](function(_0x15a02f){console[_0x52f4('0x50')](_0x52f4('0x51'),_0x15a02f);});}function getEndUser(_0x461e5a,_0x2ec45f,_0x3c0585,_0x2a4c6f,_0x56bad2,_0x394808,_0x12d587){var _0x5d200c={'method':_0x52f4('0x35'),'uri':'','headers':{'Authorization':_0x52f4('0x4b')+_0x461e5a},'json':!![]};switch(_0x12d587[_0x52f4('0x52')]){case _0x52f4('0x53'):_0x5d200c[_0x52f4('0x54')]='https://www.zohoapis.'+_0x2ec45f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x56bad2+'))';return getZohoUser(_0x5d200c,_0x52f4('0x55'))['then'](function(_0xf15433){if(_0xf15433)return _0xf15433;_0x5d200c[_0x52f4('0x54')]=_0x52f4('0x56')+_0x2ec45f+_0x52f4('0x57')+_0x56bad2+'))';return getZohoUser(_0x5d200c,_0x52f4('0x58'))[_0x52f4('0x39')](function(_0x487a06){if(_0x487a06)return _0x487a06;if(_0x12d587[_0x52f4('0x47')]!='nothing'){return createEndUser(_0x461e5a,_0x2ec45f,_0x2a4c6f,_0x56bad2,_0x394808,_0x12d587);}else{return{};}});});break;case _0x52f4('0x59'):_0x5d200c[_0x52f4('0x54')]=_0x52f4('0x56')+_0x2ec45f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x56bad2+'))';return getZohoUser(_0x5d200c,_0x52f4('0x55'))[_0x52f4('0x39')](function(_0x4862f7){if(_0x4862f7)return _0x4862f7;if(_0x12d587[_0x52f4('0x47')]!='nothing'){return createEndUser(_0x461e5a,_0x2ec45f,_0x2a4c6f,_0x56bad2,_0x394808,_0x12d587);}else{return{};}});break;case _0x52f4('0x5a'):_0x5d200c[_0x52f4('0x54')]=_0x52f4('0x56')+_0x2ec45f+_0x52f4('0x57')+_0x56bad2+'))';return getZohoUser(_0x5d200c,_0x52f4('0x58'))[_0x52f4('0x39')](function(_0x44436b){if(_0x44436b)return _0x44436b;if(_0x12d587[_0x52f4('0x47')]!=_0x52f4('0x5b')){return createEndUser(_0x461e5a,_0x2ec45f,_0x2a4c6f,_0x56bad2,_0x394808,_0x12d587);}else{return{};}});break;}}function getCall(_0x536b7a,_0x3d7733,_0x564b57,_0x583d39,_0x94271,_0x4af0ed,_0x45adf2,_0x2be702){logger[_0x52f4('0x3e')]('Creating\x20new\x20call...');var _0x1cedf7={};_0x1cedf7[_0x52f4('0x5c')]={'name':!_[_0x52f4('0x20')](_0x583d39['role'][_0x52f4('0x1c')])&&!_[_0x52f4('0x20')](_0x583d39['profile']['name'])&&_0x583d39[_0x52f4('0x42')][_0x52f4('0x1c')]===_0x52f4('0x5d')?_0x583d39['role'][_0x52f4('0x1c')]:!_[_0x52f4('0x20')](_0x583d39[_0x52f4('0x49')])?_0x583d39[_0x52f4('0x49')]+'\x20'+_0x583d39[_0x52f4('0x4a')]:_0x583d39[_0x52f4('0x4a')],'id':_0x583d39['id']};_0x1cedf7['Subject']=intUtil[_0x52f4('0x5e')](_0x4af0ed['Subjects'],_0x45adf2,'\x20');_0x1cedf7[_0x52f4('0x5f')]=intUtil['getString'](_0x4af0ed['Descriptions'],_0x45adf2,'\x0a');if(_0x94271['enduserType']===_0x52f4('0x55')){_0x1cedf7[_0x52f4('0x60')]={'name':!_['isNil'](_0x94271[_0x52f4('0x61')])?_0x94271[_0x52f4('0x61')]:!_['isNil'](_0x94271[_0x52f4('0x62')])?_0x94271[_0x52f4('0x62')]+'\x20'+_0x94271[_0x52f4('0x63')]:_0x94271[_0x52f4('0x63')],'id':_0x94271['id']};}if(_0x94271[_0x52f4('0x46')]==='Leads'){_0x1cedf7[_0x52f4('0x64')]={'name':!_[_0x52f4('0x20')](_0x94271[_0x52f4('0x61')])?_0x94271[_0x52f4('0x61')]:!_[_0x52f4('0x20')](_0x94271[_0x52f4('0x62')])?_0x94271[_0x52f4('0x62')]+'\x20'+_0x94271[_0x52f4('0x63')]:_0x94271[_0x52f4('0x63')],'id':_0x94271['id']};_0x1cedf7[_0x52f4('0x65')]=_[_0x52f4('0x66')](_0x94271[_0x52f4('0x46')]);}if(_0x45adf2[_0x52f4('0x67')]){_0x1cedf7[_0x52f4('0x68')]=moment['utc'](parseInt(_0x45adf2[_0x52f4('0x67')])*0x3e8)[_0x52f4('0x36')]('mm:ss');}else if(_0x45adf2['answertime']&&_0x45adf2[_0x52f4('0x69')]){_0x1cedf7[_0x52f4('0x68')]=moment[_0x52f4('0x6a')](moment(_0x45adf2[_0x52f4('0x69')],_0x52f4('0x6b'))[_0x52f4('0x6c')](moment(_0x45adf2[_0x52f4('0x6d')],_0x52f4('0x6b'))))['format'](_0x52f4('0x6e'));}switch(_0x45adf2['lastevent']){case _0x52f4('0x6f'):_0x1cedf7[_0x52f4('0x70')]=_0x52f4('0x71');break;case _0x52f4('0x72'):case'connect':_0x1cedf7[_0x52f4('0x70')]=_0x52f4('0x73');break;case _0x52f4('0x74'):_0x1cedf7[_0x52f4('0x70')]='Rejected';break;case'abandoned':_0x1cedf7['Call_Result']=_0x52f4('0x75');break;case _0x52f4('0x76'):_0x1cedf7[_0x52f4('0x70')]=_0x52f4('0x77');default:}_0x1cedf7[_0x52f4('0x78')]=(_0x2be702===_0x52f4('0x79')?moment(_0x45adf2[_0x52f4('0x6d')])[_0x52f4('0x36')](_0x52f4('0x6b')):moment(_0x45adf2['agentcalledAt'])[_0x52f4('0x36')](_0x52f4('0x6b')))||moment()['format'](_0x52f4('0x6b'));_0x1cedf7[_0x52f4('0x7a')]=_0x2be702||_0x52f4('0x7b');_0x1cedf7=_['merge'](_0x1cedf7,getCustomFields(_0x4af0ed[_0x52f4('0x7c')],_0x45adf2));return request({'method':_0x52f4('0x29'),'uri':_0x52f4('0x56')+_0x3d7733+_0x52f4('0x7d'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x536b7a},'body':{'data':[_0x1cedf7]},'json':!![]})[_0x52f4('0x39')](function(_0x46f11d){if(_0x46f11d&&_0x46f11d[_0x52f4('0x4c')][0x0][_0x52f4('0x7e')]==='SUCCESS'){logger[_0x52f4('0x3e')](_0x52f4('0x7f'));return{'id':_0x46f11d[_0x52f4('0x4c')][0x0]['details']['id']};}})['catch'](function(_0x44a19b){logger[_0x52f4('0x3e')](_0x52f4('0x80'),_0x44a19b[_0x52f4('0x33')]);console[_0x52f4('0x50')](_0x52f4('0x80'),_0x44a19b);});}exports[_0x52f4('0x81')]=function(_0x4dc71c,_0x15b6bd,_0x13600e,_0x36bff4,_0x232971,_0x372ae1){var _0x5e36ae,_0x48b4d3,_0x176ef4;_0x372ae1['host']=intUtil[_0x52f4('0x82')](_0x372ae1[_0x52f4('0x83')]);_0x372ae1[_0x52f4('0x84')]=intUtil[_0x52f4('0x82')](_0x372ae1['serverUrl']);if(_0x232971&&_0x232971[_0x52f4('0x85')]){logger['info'](_0x52f4('0x86'),_0x52f4('0x87'));_0x15b6bd[_0x52f4('0x88')]=_0x372ae1[_0x52f4('0x84')]+_0x52f4('0x89')+_0x15b6bd['uniqueid']+_0x52f4('0x8a')+md5(_0x15b6bd[_0x52f4('0x8b')]);}else{_0x15b6bd['recordingURL']='';}var _0x5d03d5=_0x372ae1[_0x52f4('0x83')]===_0x52f4('0x8c')?'eu':_0x52f4('0x8d');return getAccessToken(_0x372ae1)['then'](function(_0xbbe1af){_0x176ef4=_0xbbe1af;return getUser(_0x176ef4,_0x5d03d5,_0x372ae1,_0x36bff4[_0x52f4('0x8e')]);})[_0x52f4('0x39')](function(_0x4a63ed){_0x5e36ae=_0x4a63ed;logger[_0x52f4('0x3e')](_0x52f4('0x8f'),_0x5e36ae['id']);return getEndUser(_0x176ef4,_0x5d03d5,_0x372ae1,_0x15b6bd[_0x52f4('0x90')],_0x15b6bd['calleridnum'],_0x5e36ae,_0x13600e);})[_0x52f4('0x39')](function(_0x54aa88){_0x48b4d3=_0x54aa88;return getCall(_0x176ef4,_0x5d03d5,_0x372ae1,_0x5e36ae,_0x48b4d3,_0x13600e,_0x15b6bd,_0x52f4('0x7b'));})['then'](function(_0xd9439c){if(_0xd9439c){logger['info'](_0x52f4('0x91'),_0xd9439c['id']);logger[_0x52f4('0x3e')](_0x52f4('0x86'),_0x52f4('0x92'));emit(util[_0x52f4('0x36')]('user:%s',_0x36bff4[_0x52f4('0x1c')]),'trigger:browser:url',{'uri':'https://crm.'+_0x372ae1[_0x52f4('0x83')]+_0x52f4('0x93')+_0xd9439c['id']});}})['catch'](function(_0x160ec9){logger[_0x52f4('0x31')](_0x52f4('0x86'),JSON[_0x52f4('0xf')](_0x160ec9));});};exports[_0x52f4('0x79')]=function(_0x3df3bf,_0x3c51bf,_0x2ff4b,_0x3ac060,_0x3fa665,_0x35a220,_0x10ded2){var _0x4af063,_0x39f132,_0xbc9ad4;_0x35a220[_0x52f4('0x83')]=intUtil[_0x52f4('0x82')](_0x35a220[_0x52f4('0x83')]);_0x35a220[_0x52f4('0x84')]=intUtil[_0x52f4('0x82')](_0x35a220[_0x52f4('0x84')]);if(_0x10ded2&&_0x10ded2['recordingFormat']&&_0x10ded2['recordingFormat']!=='none'){logger['info'](_0x52f4('0x94'),_0x52f4('0x87'));_0x3c51bf['recordingURL']=_0x35a220['serverUrl']+_0x52f4('0x89')+_0x3c51bf['uniqueid']+_0x52f4('0x8a')+md5(_0x3c51bf[_0x52f4('0x8b')]);}var _0x2f9643=_0x35a220[_0x52f4('0x83')]==='zoho.eu'?'eu':_0x52f4('0x8d');return getAccessToken(_0x35a220)['then'](function(_0x2260b7){_0xbc9ad4=_0x2260b7;return getUser(_0xbc9ad4,_0x2f9643,_0x35a220,_0x3ac060[_0x52f4('0x8e')]);})[_0x52f4('0x39')](function(_0x317379){_0x4af063=_0x317379;logger[_0x52f4('0x3e')](_0x52f4('0x8f'),_0x4af063['id']);return getEndUser(_0xbc9ad4,_0x2f9643,_0x35a220,_0x3c51bf['destcalleridname'],_0x3c51bf['destcalleridnum'],_0x4af063,_0x2ff4b);})[_0x52f4('0x39')](function(_0x1fc6bd){_0x39f132=_0x1fc6bd;return getCall(_0xbc9ad4,_0x2f9643,_0x35a220,_0x4af063,_0x39f132,_0x2ff4b,_0x3c51bf,_0x52f4('0x95'));})[_0x52f4('0x39')](function(_0x43ef97){if(_0x43ef97){logger[_0x52f4('0x3e')]('The\x20Call\x20ID\x20is:',_0x43ef97['id']);logger['info'](_0x52f4('0x94'),_0x52f4('0x92'));emit(util[_0x52f4('0x36')]('user:%s',_0x3ac060[_0x52f4('0x1c')]),_0x52f4('0x96'),{'uri':_0x52f4('0x97')+_0x35a220[_0x52f4('0x83')]+_0x52f4('0x93')+_0x43ef97['id']});}})[_0x52f4('0x45')](function(_0x1c520f){logger[_0x52f4('0x31')](_0x52f4('0x94'),JSON['stringify'](_0x1c520f));});};exports['unmanaged']=function(_0x5a3a49,_0x5d06c5,_0x2e3782,_0x3265ee,_0x11fb37,_0x426d7b){var _0x2e084a,_0x24fdb7,_0x30d358;_0x426d7b[_0x52f4('0x83')]=intUtil[_0x52f4('0x82')](_0x426d7b['host']);_0x426d7b[_0x52f4('0x84')]=intUtil[_0x52f4('0x82')](_0x426d7b[_0x52f4('0x84')]);if(_0x11fb37&&_0x11fb37[_0x52f4('0x85')]){logger['info']('['+_0x5d06c5[_0x52f4('0x98')]['toUpperCase']()+']',_0x52f4('0x87'));_0x5d06c5[_0x52f4('0x88')]=_0x426d7b[_0x52f4('0x84')]+_0x52f4('0x89')+_0x5d06c5['uniqueid']+_0x52f4('0x8a')+md5(_0x5d06c5['uniqueid']);}else{_0x5d06c5['recordingURL']='';}var _0x2a6714=_0x426d7b[_0x52f4('0x83')]===_0x52f4('0x8c')?'eu':_0x52f4('0x8d');return getAccessToken(_0x426d7b)['then'](function(_0x59ed55){_0x30d358=_0x59ed55;return getUser(_0x30d358,_0x2a6714,_0x426d7b);})[_0x52f4('0x39')](function(_0x348705){_0x2e084a=_0x348705;logger[_0x52f4('0x3e')](_0x52f4('0x8f'),_0x2e084a['id']);return getEndUser(_0x30d358,_0x2a6714,_0x426d7b,_0x5d06c5[_0x52f4('0x90')],_0x5d06c5[_0x52f4('0x99')],_0x2e084a,_0x2e3782);})[_0x52f4('0x39')](function(_0x18eda4){_0x24fdb7=_0x18eda4;return getCall(_0x30d358,_0x2a6714,_0x426d7b,_0x2e084a,_0x24fdb7,_0x2e3782,_0x5d06c5,_0x52f4('0x7b'));})['then'](function(_0x3d66f6){if(_0x3d66f6){logger[_0x52f4('0x3e')](_0x52f4('0x91'),_0x3d66f6['id']);}})[_0x52f4('0x45')](function(_0x4a8caf){logger[_0x52f4('0x31')]('['+_0x5d06c5[_0x52f4('0x98')][_0x52f4('0x9a')]()+']',JSON['stringify'](_0x4a8caf));});}; \ 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 9cdb10f..193dbe7 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 _0x1f9e=['info','mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x4178b0,_0xf5e57b){var _0x499921=function(_0x230c99){while(--_0x230c99){_0x4178b0['push'](_0x4178b0['shift']());}};_0x499921(++_0xf5e57b);}(_0x1f9e,0xdd));var _0xe1f9=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0x1f9e[_0x4af01e];return _0x178c11;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0xe1f9('0x0'));var logger=require(_0xe1f9('0x1'))(_0xe1f9('0x2'));exports[_0xe1f9('0x3')]=function(_0xa8607b,_0x4e8b63){var _0x50ddf4=_0xa8607b[_0xe1f9('0x4')]?_0xa8607b[_0xe1f9('0x4')]:_0xe1f9('0x5');var _0x2ae687=_0xa8607b['data3']?Mustache[_0xe1f9('0x6')](_0xa8607b[_0xe1f9('0x7')],_0x4e8b63):_0x4e8b63;sh[_0xe1f9('0x3')](_0x2ae687,function(_0x4783be,_0x56125b,_0x3dae96){if(_0x4783be!==0x0){logger['error'](util[_0xe1f9('0x8')](_0xe1f9('0x9'),_0x50ddf4,_0x2ae687,_0x4783be,_0x3dae96));}else{logger[_0xe1f9('0xa')](util[_0xe1f9('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x50ddf4,_0x2ae687,_0x56125b));}});}; \ No newline at end of file +var _0xc902=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','data2','data3','render'];(function(_0x23895f,_0x43e4a9){var _0x39cfc9=function(_0x72a423){while(--_0x72a423){_0x23895f['push'](_0x23895f['shift']());}};_0x39cfc9(++_0x43e4a9);}(_0xc902,0x1d0));var _0x2c90=function(_0x330701,_0x2736b4){_0x330701=_0x330701-0x0;var _0x1cbd6f=_0xc902[_0x330701];return _0x1cbd6f;};'use strict';var util=require(_0x2c90('0x0'));var sh=require(_0x2c90('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x2c90('0x2'));exports['exec']=function(_0x304ac1,_0x266aec){var _0x44394c=_0x304ac1[_0x2c90('0x3')]?_0x304ac1['data2']:'Script';var _0x354964=_0x304ac1[_0x2c90('0x4')]?Mustache[_0x2c90('0x5')](_0x304ac1[_0x2c90('0x4')],_0x266aec):_0x266aec;sh['exec'](_0x354964,function(_0x4f2ee9,_0x2db13d,_0x21fe96){if(_0x4f2ee9!==0x0){logger[_0x2c90('0x6')](util['format'](_0x2c90('0x7'),_0x44394c,_0x354964,_0x4f2ee9,_0x21fe96));}else{logger[_0x2c90('0x8')](util['format'](_0x2c90('0x9'),_0x44394c,_0x354964,_0x2db13d));}});}; \ 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 ce72a9a..196ac6c 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 _0xfdcd=['number','data5','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','util','lodash','../../../../config/logger','trigger','data1','toUpperCase','render','data2'];(function(_0x2e1d26,_0x1a1b10){var _0x1642e6=function(_0x40c896){while(--_0x40c896){_0x2e1d26['push'](_0x2e1d26['shift']());}};_0x1642e6(++_0x1a1b10);}(_0xfdcd,0xb8));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var rp=require('request-promise');var util=require(_0xdfdc('0x0'));var _=require(_0xdfdc('0x1'));var Mustache=require('mustache');var logger=require(_0xdfdc('0x2'))(_0xdfdc('0x3'));exports['exec']=function(_0x407b21,_0x225d3d){var _0x449ce6,_0x312b49;var _0x29f78d={'method':_0x407b21[_0xdfdc('0x4')][_0xdfdc('0x5')](),'uri':Mustache[_0xdfdc('0x6')](_0x407b21[_0xdfdc('0x7')],_0x225d3d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x407b21['data5'])===_0xdfdc('0x8')&&parseInt(_0x407b21['data5'])>=0x1&&parseInt(_0x407b21[_0xdfdc('0x9')])<=0xa?parseInt(_0x407b21['data5'])*0x3e8:0x5*0x3e8};try{_0x29f78d['headers']=_0x407b21[_0xdfdc('0xa')]?JSON[_0xdfdc('0xb')](Mustache[_0xdfdc('0x6')](_0x407b21['data6'],_0x225d3d)):{};}catch(_0x58af9b){logger[_0xdfdc('0xc')](_0x58af9b[_0xdfdc('0xd')]);}switch(_0x407b21[_0xdfdc('0x4')][_0xdfdc('0x5')]()){case _0xdfdc('0xe'):case _0xdfdc('0xf'):_0x449ce6=null;_0x29f78d['qs']=_0x225d3d;break;case _0xdfdc('0x10'):case _0xdfdc('0x11'):if(_0x407b21[_0xdfdc('0x12')]){try{_0x449ce6=JSON[_0xdfdc('0xb')](Mustache[_0xdfdc('0x6')](_0x407b21['data7'],_0x225d3d));_0x29f78d['body']=_0x449ce6;}catch(_0x7b9759){logger[_0xdfdc('0xc')](_0x7b9759[_0xdfdc('0xd')]);logger[_0xdfdc('0xc')](_0xdfdc('0x13'));}}else{_0x449ce6=_0x225d3d;_0x29f78d[_0xdfdc('0x14')]=_0x449ce6;}break;}logger[_0xdfdc('0x15')](util[_0xdfdc('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x407b21[_0xdfdc('0x4')],_0x407b21[_0xdfdc('0x7')],JSON[_0xdfdc('0x17')](_0x29f78d)));rp(_0x29f78d)[_0xdfdc('0x18')](function(_0x26da60){_0x449ce6=!_[_0xdfdc('0x19')](_0x449ce6)?_0xdfdc('0x1a')+_0x449ce6:'';_0x312b49=typeof _0x26da60[_0xdfdc('0x14')]===_0xdfdc('0x1b')?JSON[_0xdfdc('0x17')](_0x26da60[_0xdfdc('0x14')]):_0x26da60[_0xdfdc('0x14')];logger[_0xdfdc('0x15')](util[_0xdfdc('0x16')](_0xdfdc('0x1c'),_0x407b21['data1'],_0x407b21[_0xdfdc('0x7')],_0x26da60[_0xdfdc('0x1d')],_0x312b49));})['catch'](function(_0x48148f){logger[_0xdfdc('0xc')](util[_0xdfdc('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x407b21[_0xdfdc('0x4')],_0x407b21['data2'],_0x48148f['statusCode'],_0x48148f[_0xdfdc('0x1e')],_0x48148f[_0xdfdc('0x1f')]));});}; \ No newline at end of file +var _0x42ef=['statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','render','data2','data5','number','headers','data6','parse','error','toUpperCase','GET','DELETE','PUT','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','stringify','then','isNil',',\x20request\x20body:\x20','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s'];(function(_0x465f17,_0x49fb97){var _0x2a2573=function(_0x3eb0a5){while(--_0x3eb0a5){_0x465f17['push'](_0x465f17['shift']());}};_0x2a2573(++_0x49fb97);}(_0x42ef,0x140));var _0xf42e=function(_0x3eff05,_0x3f517e){_0x3eff05=_0x3eff05-0x0;var _0x56fc9e=_0x42ef[_0x3eff05];return _0x56fc9e;};'use strict';var rp=require(_0xf42e('0x0'));var util=require(_0xf42e('0x1'));var _=require(_0xf42e('0x2'));var Mustache=require(_0xf42e('0x3'));var logger=require(_0xf42e('0x4'))('trigger');exports[_0xf42e('0x5')]=function(_0x465042,_0x322c8f){var _0x2b63fe,_0x2ae11c;var _0x514643={'method':_0x465042[_0xf42e('0x6')]['toUpperCase'](),'uri':Mustache[_0xf42e('0x7')](_0x465042[_0xf42e('0x8')],_0x322c8f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x465042[_0xf42e('0x9')])===_0xf42e('0xa')&&parseInt(_0x465042['data5'])>=0x1&&parseInt(_0x465042[_0xf42e('0x9')])<=0xa?parseInt(_0x465042['data5'])*0x3e8:0x5*0x3e8};try{_0x514643[_0xf42e('0xb')]=_0x465042[_0xf42e('0xc')]?JSON[_0xf42e('0xd')](Mustache[_0xf42e('0x7')](_0x465042[_0xf42e('0xc')],_0x322c8f)):{};}catch(_0x26ec0e){logger[_0xf42e('0xe')](_0x26ec0e['stack']);}switch(_0x465042['data1'][_0xf42e('0xf')]()){case _0xf42e('0x10'):case _0xf42e('0x11'):_0x2b63fe=null;_0x514643['qs']=_0x322c8f;break;case'POST':case _0xf42e('0x12'):if(_0x465042[_0xf42e('0x13')]){try{_0x2b63fe=JSON['parse'](Mustache[_0xf42e('0x7')](_0x465042[_0xf42e('0x13')],_0x322c8f));_0x514643['body']=_0x2b63fe;}catch(_0x43f148){logger['error'](_0x43f148[_0xf42e('0x14')]);logger[_0xf42e('0xe')](_0xf42e('0x15'));}}else{_0x2b63fe=_0x322c8f;_0x514643[_0xf42e('0x16')]=_0x2b63fe;}break;}logger['info'](util[_0xf42e('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x465042['data1'],_0x465042[_0xf42e('0x8')],JSON[_0xf42e('0x18')](_0x514643)));rp(_0x514643)[_0xf42e('0x19')](function(_0x78c981){_0x2b63fe=!_[_0xf42e('0x1a')](_0x2b63fe)?_0xf42e('0x1b')+_0x2b63fe:'';_0x2ae11c=typeof _0x78c981[_0xf42e('0x16')]==='object'?JSON[_0xf42e('0x18')](_0x78c981[_0xf42e('0x16')]):_0x78c981[_0xf42e('0x16')];logger[_0xf42e('0x1c')](util[_0xf42e('0x17')](_0xf42e('0x1d'),_0x465042[_0xf42e('0x6')],_0x465042[_0xf42e('0x8')],_0x78c981[_0xf42e('0x1e')],_0x2ae11c));})[_0xf42e('0x1f')](function(_0x15bf29){logger['error'](util[_0xf42e('0x17')](_0xf42e('0x20'),_0x465042[_0xf42e('0x6')],_0x465042[_0xf42e('0x8')],_0x15bf29[_0xf42e('0x1e')],_0x15bf29[_0xf42e('0x21')],_0x15bf29[_0xf42e('0x22')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6cbf91a..420714e 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 _0xe198=['request','debug','rpc','error','message','result','exports','jayson/promise','bluebird','routing','http','Request'];(function(_0x53f3d9,_0xf23c6e){var _0x17a455=function(_0x36e9d3){while(--_0x36e9d3){_0x53f3d9['push'](_0x53f3d9['shift']());}};_0x17a455(++_0xf23c6e);}(_0xe198,0x163));var _0x8e19=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe198[_0x2064e5];return _0x21a233;};'use strict';var jayson=require(_0x8e19('0x0'));var BPromise=require(_0x8e19('0x1'));var logger=require('../../config/logger')(_0x8e19('0x2'));var client=jayson['client'][_0x8e19('0x3')]({'port':0x2329});client[_0x8e19('0x4')]=function(_0x192730,_0x41acd1){return new BPromise(function(_0xa621d,_0x49a9b9){return client[_0x8e19('0x5')](_0x192730,_0x41acd1)['then'](function(_0x180193){logger[_0x8e19('0x6')](_0x8e19('0x7'),_0x8e19('0x2'),_0x192730,_0x41acd1,_0x180193);if(_0x180193[_0x8e19('0x8')]){logger[_0x8e19('0x8')](_0x8e19('0x7'),_0x8e19('0x2'),_0x192730,_0x180193[_0x8e19('0x8')][_0x8e19('0x9')],_0x41acd1);return _0x49a9b9(_0x180193[_0x8e19('0x8')]['message']);}else{return _0xa621d(_0x180193[_0x8e19('0xa')]);}})['catch'](function(_0x47c600){logger['error']('rpc',_0x8e19('0x2'),_0x192730,_0x47c600,_0x41acd1);return _0x49a9b9(_0x47c600);});});};module[_0x8e19('0xb')]=client; \ No newline at end of file +var _0xa376=['routing','error','message','result','../../config/logger','client','http','request','then','debug','rpc'];(function(_0x5495fc,_0x268c40){var _0x1c549e=function(_0x11ccb8){while(--_0x11ccb8){_0x5495fc['push'](_0x5495fc['shift']());}};_0x1c549e(++_0x268c40);}(_0xa376,0x88));var _0x6a37=function(_0x4002d9,_0x5811b3){_0x4002d9=_0x4002d9-0x0;var _0xb531e0=_0xa376[_0x4002d9];return _0xb531e0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x6a37('0x0'))('routing');var client=jayson[_0x6a37('0x1')][_0x6a37('0x2')]({'port':0x2329});client['Request']=function(_0x57e051,_0x1d8dd8){return new BPromise(function(_0x3d0e2d,_0x3dd153){return client[_0x6a37('0x3')](_0x57e051,_0x1d8dd8)[_0x6a37('0x4')](function(_0x58a562){logger[_0x6a37('0x5')](_0x6a37('0x6'),_0x6a37('0x7'),_0x57e051,_0x1d8dd8,_0x58a562);if(_0x58a562[_0x6a37('0x8')]){logger[_0x6a37('0x8')](_0x6a37('0x6'),_0x6a37('0x7'),_0x57e051,_0x58a562['error'][_0x6a37('0x9')],_0x1d8dd8);return _0x3dd153(_0x58a562['error']['message']);}else{return _0x3d0e2d(_0x58a562[_0x6a37('0xa')]);}})['catch'](function(_0x57b211){logger['error']('rpc',_0x6a37('0x7'),_0x57e051,_0x57b211,_0x1d8dd8);return _0x3dd153(_0x57b211);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 05ed71c..55b9a64 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 _0xc274=['loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','initMailAccounts','refresh','mailAccounts','listen','getSettings'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc274,0x93));var _0x4c27=function(_0x1d97fb,_0x475e43){_0x1d97fb=_0x1d97fb-0x0;var _0x595579=_0xc274[_0x1d97fb];return _0x595579;};'use strict';var server=require(_0x4c27('0x0'));var Realtime=require(_0x4c27('0x1'));var EmailChannel=require(_0x4c27('0x2'));var mailAccount=require(_0x4c27('0x3'));var setting=require(_0x4c27('0x4'));var logger=require(_0x4c27('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x4c27('0x6')]()[_0x4c27('0x7')](mailAccount['getMailAccounts']())['then'](realtime[_0x4c27('0x8')]())['then'](function(){email[_0x4c27('0x9')](realtime[_0x4c27('0xa')]);return realtime;});}function main(){return server[_0x4c27('0xb')](realtime,email)[_0x4c27('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x4c27('0xc')]();})['then'](function(_0x48a332){return setInterval(initRealtime,_0x48a332[_0x4c27('0xd')]*0x3e8);})['catch'](function(_0x2ec4f8){logger[_0x4c27('0xe')](_0x4c27('0xf'),_0x2ec4f8);});}main(); \ No newline at end of file +var _0x238b=['./lib/email','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x114ea7,_0x231dd2){var _0x352c7a=function(_0x20775a){while(--_0x20775a){_0x114ea7['push'](_0x114ea7['shift']());}};_0x352c7a(++_0x231dd2);}(_0x238b,0x13e));var _0xb238=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x238b[_0x20a584];return _0x4b41a8;};'use strict';var server=require(_0xb238('0x0'));var Realtime=require(_0xb238('0x1'));var EmailChannel=require(_0xb238('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xb238('0x3'));var logger=require(_0xb238('0x4'))(_0xb238('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb238('0x6')]()['then'](mailAccount['getMailAccounts']())[_0xb238('0x7')](realtime[_0xb238('0x8')]())[_0xb238('0x7')](function(){email['refresh'](realtime[_0xb238('0x9')]);return realtime;});}function main(){return server[_0xb238('0xa')](realtime,email)[_0xb238('0x7')](function(){return initRealtime();})[_0xb238('0x7')](function(){return setting[_0xb238('0xb')]();})[_0xb238('0x7')](function(_0x46dfdc){return setInterval(initRealtime,_0x46dfdc[_0xb238('0xc')]*0x3e8);})[_0xb238('0xd')](function(_0x3657db){logger[_0xb238('0xe')](_0xb238('0xf'),_0x3657db);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f5cb63e..7905689 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 _0xc4e1=['moment','bluebird','md5','../../../config/environment','email','defaults','localhost','socket.io-emitter','./imap','./smtp','mailAccounts','imapAccounts','prototype','name','key','active','status','Imap','isNil','emit','mailAccount:update','service','provider','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','send','Smtp','verified','verify','exports','lodash'];(function(_0x3d9e9e,_0x2779d6){var _0x4632e5=function(_0x176590){while(--_0x176590){_0x3d9e9e['push'](_0x3d9e9e['shift']());}};_0x4632e5(++_0x2779d6);}(_0xc4e1,0x172));var _0x1c4e=function(_0x3ec174,_0x39d21b){_0x3ec174=_0x3ec174-0x0;var _0x33ed60=_0xc4e1[_0x3ec174];return _0x33ed60;};'use strict';var _=require(_0x1c4e('0x0'));var moment=require(_0x1c4e('0x1'));var BPromise=require(_0x1c4e('0x2'));var md5=require(_0x1c4e('0x3'));var Redis=require('ioredis');var config=require(_0x1c4e('0x4'));var logger=require('../../../config/logger')(_0x1c4e('0x5'));config['redis']=_[_0x1c4e('0x6')](config['redis'],{'host':_0x1c4e('0x7'),'port':0x18eb});var io=require(_0x1c4e('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x1c4e('0x9'));var EmailSmtp=require(_0x1c4e('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0xa423ce){logger['info']('start\x20email\x20channel');this[_0x1c4e('0xb')]=_0xa423ce['mailAccounts'];this[_0x1c4e('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x1c4e('0xd')]['emit']=function(_0x39b296){var _0x5cdd3c=this['mailAccounts'][_0x39b296];var _0x5b75a3={'id':_0x5cdd3c['id'],'name':_0x5cdd3c[_0x1c4e('0xe')],'key':_0x5cdd3c[_0x1c4e('0xf')],'active':_0x5cdd3c[_0x1c4e('0x10')],'Imap':{'status':_0x5cdd3c['Imap'][_0x1c4e('0x11')],'messageStatus':_0x5cdd3c[_0x1c4e('0x12')]['messageStatus'],'total':_0x5cdd3c['Imap']['total']}};if(_[_0x1c4e('0x13')](md5Accounts[_0x39b296])){md5Accounts[_0x39b296]={};}var _0x2b6459=md5(JSON['stringify'](_0x5b75a3));if(md5Accounts[_0x39b296][_0x1c4e('0x3')]!==_0x2b6459){md5Accounts[_0x39b296][_0x1c4e('0x3')]=_0x2b6459;io[_0x1c4e('0x14')](_0x1c4e('0x15'),_0x5b75a3);}};EmailChannel[_0x1c4e('0xd')]['refresh']=function(_0x17259a){for(var _0x3d4bd4 in _0x17259a){if(_0x17259a['hasOwnProperty'](_0x3d4bd4)){if(_0x17259a[_0x3d4bd4]['Imap']&&_0x17259a[_0x3d4bd4]['active']){var _0x54ef20=_0x17259a[_0x3d4bd4][_0x1c4e('0x12')];if(!_0x54ef20[_0x1c4e('0x16')])_0x54ef20['service']=_0x17259a[_0x3d4bd4][_0x1c4e('0x17')];if(!this[_0x1c4e('0xc')][_0x1c4e('0x18')](_0x54ef20['id'])){this[_0x1c4e('0xc')][_0x54ef20['id']]=new EmailImap(_0x54ef20,_0x17259a[_0x3d4bd4][_0x1c4e('0x5')]);this[_0x1c4e('0xc')][_0x54ef20['id']]['on'](_0x1c4e('0x19'),this[_0x1c4e('0x1a')][_0x1c4e('0x1b')](this,_0x3d4bd4));this['imapAccounts'][_0x54ef20['id']]['on'](_0x1c4e('0x5'),this['handleImapEmail'][_0x1c4e('0x1b')](this,_0x3d4bd4));this[_0x1c4e('0xc')][_0x54ef20['id']]['on'](_0x1c4e('0x1c'),this[_0x1c4e('0x1d')][_0x1c4e('0x1b')](this,_0x3d4bd4));this['imapAccounts'][_0x54ef20['id']]['on'](_0x1c4e('0x1e'),this[_0x1c4e('0x1f')][_0x1c4e('0x1b')](this,_0x3d4bd4));}}else{if(_[_0x1c4e('0x13')](this[_0x1c4e('0xb')][_0x3d4bd4][_0x1c4e('0x12')])){this['mailAccounts'][_0x3d4bd4][_0x1c4e('0x12')]={};}this[_0x1c4e('0xb')][_0x3d4bd4][_0x1c4e('0x12')][_0x1c4e('0x11')]=_0x1c4e('0x20');this[_0x1c4e('0xb')][_0x3d4bd4]['Imap'][_0x1c4e('0x21')]='';this[_0x1c4e('0x14')](_0x3d4bd4);}}}};EmailChannel['prototype'][_0x1c4e('0x1a')]=function(_0x3c8240,_0x35a119){if(this[_0x1c4e('0xb')][_0x3c8240]){this['mailAccounts'][_0x3c8240][_0x1c4e('0x12')][_0x1c4e('0x11')]=_0x1c4e('0x22');this['mailAccounts'][_0x3c8240][_0x1c4e('0x12')][_0x1c4e('0x21')]=_0x35a119[_0x1c4e('0xe')];if(_0x35a119[_0x1c4e('0x23')]){this['mailAccounts'][_0x3c8240][_0x1c4e('0x12')][_0x1c4e('0x24')]=_0x35a119[_0x1c4e('0x23')][_0x1c4e('0x24')];}return this['emit'](_0x3c8240);}};EmailChannel['prototype'][_0x1c4e('0x25')]=function(_0x287dcd,_0x1f99c9){logger['info'](_0x1c4e('0x26'),_0x1f99c9[_0x1c4e('0x27')],_0x1f99c9['lastName'],_0x1f99c9[_0x1c4e('0x28')],_0x287dcd);if(this[_0x1c4e('0xb')][_0x287dcd]){return mailAccount[_0x1c4e('0x29')](_0x287dcd,_0x1f99c9)[_0x1c4e('0x2a')](function(_0x216cf4){if(_0x216cf4){logger['info'](_0x1c4e('0x2b'));}})[_0x1c4e('0x2c')](function(_0x1e2559){logger[_0x1c4e('0x1e')](_0x1c4e('0x2d'),JSON['stringify'](_0x1e2559));});}};EmailChannel[_0x1c4e('0xd')]['handleImapEnd']=function(_0x1fff83){if(this[_0x1c4e('0xb')][_0x1fff83]&&this[_0x1c4e('0xb')][_0x1fff83][_0x1c4e('0x12')]){if(this[_0x1c4e('0xc')][this['mailAccounts'][_0x1fff83][_0x1c4e('0x12')]['id']]){delete this[_0x1c4e('0xc')][this[_0x1c4e('0xb')][_0x1fff83][_0x1c4e('0x12')]['id']];}this[_0x1c4e('0xb')][_0x1fff83][_0x1c4e('0x12')][_0x1c4e('0x2e')]=moment();this[_0x1c4e('0x14')](_0x1fff83);}};EmailChannel[_0x1c4e('0xd')][_0x1c4e('0x1f')]=function(_0xa8b923,_0x2b78ee){if(this[_0x1c4e('0xb')][_0xa8b923]){this['mailAccounts'][_0xa8b923][_0x1c4e('0x12')][_0x1c4e('0x11')]=_0x1c4e('0x1e');this[_0x1c4e('0xb')][_0xa8b923][_0x1c4e('0x12')]['messageStatus']=_0x2b78ee;return this[_0x1c4e('0x14')](_0xa8b923);}};EmailChannel['prototype']['sendMail']=function(_0x19cb63,_0x5d0f40){return this[_0x1c4e('0x2f')][_0x1c4e('0x30')](_0x19cb63,_0x5d0f40);};EmailChannel['prototype']['verifySmtp']=function(_0x1ab7e5){var _0x3267e9=this;if(this[_0x1c4e('0xb')][_0x1ab7e5['id']]){if(_[_0x1c4e('0x13')](this['mailAccounts'][_0x1ab7e5['id']]['Smtp'])){this['mailAccounts'][_0x1ab7e5['id']]['Smtp']={};}this[_0x1c4e('0xb')][_0x1ab7e5['id']][_0x1c4e('0x31')][_0x1c4e('0x2e')]=moment();return new BPromise(function(_0x25432d,_0x3c19af){return _0x3267e9['smtp']['verify'](_0x1ab7e5)[_0x1c4e('0x2a')](function(_0x3baa31){_0x3267e9[_0x1c4e('0xb')][_0x1ab7e5['id']][_0x1c4e('0x31')]['status']=_0x1c4e('0x32');_0x3267e9['mailAccounts'][_0x1ab7e5['id']]['Smtp'][_0x1c4e('0x21')]='';_0x3267e9[_0x1c4e('0x14')](_0x1ab7e5['id']);_0x25432d(_0x3baa31);})['catch'](function(_0x43193f){_0x3267e9[_0x1c4e('0xb')][_0x1ab7e5['id']][_0x1c4e('0x31')][_0x1c4e('0x11')]=_0x1c4e('0x1e');_0x3267e9['mailAccounts'][_0x1ab7e5['id']][_0x1c4e('0x31')]['messageStatus']=_0x43193f;_0x3267e9[_0x1c4e('0x14')](_0x1ab7e5['id']);_0x3c19af(_0x43193f);});});}return this['smtp'][_0x1c4e('0x33')](_0x1ab7e5);};module[_0x1c4e('0x34')]=EmailChannel; \ No newline at end of file +var _0x15fd=['handleImapEnd','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','verifySmtp','Smtp','lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','box','handleImapBox','bind'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x15fd,0x1d4));var _0xd15f=function(_0x2c9237,_0x233838){_0x2c9237=_0x2c9237-0x0;var _0x113879=_0x15fd[_0x2c9237];return _0x113879;};'use strict';var _=require(_0xd15f('0x0'));var moment=require(_0xd15f('0x1'));var BPromise=require(_0xd15f('0x2'));var md5=require(_0xd15f('0x3'));var Redis=require(_0xd15f('0x4'));var config=require(_0xd15f('0x5'));var logger=require(_0xd15f('0x6'))(_0xd15f('0x7'));config[_0xd15f('0x8')]=_[_0xd15f('0x9')](config['redis'],{'host':_0xd15f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xd15f('0xb'));var EmailSmtp=require(_0xd15f('0xc'));var mailAccount=require(_0xd15f('0xd'));var md5Accounts={};function EmailChannel(_0x33ba78){logger[_0xd15f('0xe')](_0xd15f('0xf'));this[_0xd15f('0x10')]=_0x33ba78[_0xd15f('0x10')];this[_0xd15f('0x11')]={};this[_0xd15f('0x12')]=new EmailSmtp();}EmailChannel[_0xd15f('0x13')][_0xd15f('0x14')]=function(_0x559f60){var _0x4c5071=this[_0xd15f('0x10')][_0x559f60];var _0x4ca80a={'id':_0x4c5071['id'],'name':_0x4c5071[_0xd15f('0x15')],'key':_0x4c5071['key'],'active':_0x4c5071['active'],'Imap':{'status':_0x4c5071[_0xd15f('0x16')][_0xd15f('0x17')],'messageStatus':_0x4c5071[_0xd15f('0x16')][_0xd15f('0x18')],'total':_0x4c5071[_0xd15f('0x16')][_0xd15f('0x19')]}};if(_[_0xd15f('0x1a')](md5Accounts[_0x559f60])){md5Accounts[_0x559f60]={};}var _0x4e4ca9=md5(JSON[_0xd15f('0x1b')](_0x4ca80a));if(md5Accounts[_0x559f60][_0xd15f('0x3')]!==_0x4e4ca9){md5Accounts[_0x559f60][_0xd15f('0x3')]=_0x4e4ca9;io[_0xd15f('0x14')](_0xd15f('0x1c'),_0x4ca80a);}};EmailChannel['prototype'][_0xd15f('0x1d')]=function(_0x4cd4d9){for(var _0x36fc54 in _0x4cd4d9){if(_0x4cd4d9[_0xd15f('0x1e')](_0x36fc54)){if(_0x4cd4d9[_0x36fc54][_0xd15f('0x16')]&&_0x4cd4d9[_0x36fc54]['active']){var _0x13cce3=_0x4cd4d9[_0x36fc54]['Imap'];if(!_0x13cce3[_0xd15f('0x1f')])_0x13cce3[_0xd15f('0x1f')]=_0x4cd4d9[_0x36fc54][_0xd15f('0x20')];if(!this[_0xd15f('0x11')]['hasOwnProperty'](_0x13cce3['id'])){this[_0xd15f('0x11')][_0x13cce3['id']]=new EmailImap(_0x13cce3,_0x4cd4d9[_0x36fc54][_0xd15f('0x7')]);this[_0xd15f('0x11')][_0x13cce3['id']]['on'](_0xd15f('0x21'),this[_0xd15f('0x22')][_0xd15f('0x23')](this,_0x36fc54));this['imapAccounts'][_0x13cce3['id']]['on'](_0xd15f('0x7'),this['handleImapEmail']['bind'](this,_0x36fc54));this['imapAccounts'][_0x13cce3['id']]['on']('end',this[_0xd15f('0x24')][_0xd15f('0x23')](this,_0x36fc54));this[_0xd15f('0x11')][_0x13cce3['id']]['on'](_0xd15f('0x25'),this[_0xd15f('0x26')]['bind'](this,_0x36fc54));}}else{if(_['isNil'](this[_0xd15f('0x10')][_0x36fc54][_0xd15f('0x16')])){this[_0xd15f('0x10')][_0x36fc54][_0xd15f('0x16')]={};}this[_0xd15f('0x10')][_0x36fc54][_0xd15f('0x16')][_0xd15f('0x17')]=_0xd15f('0x27');this[_0xd15f('0x10')][_0x36fc54][_0xd15f('0x16')]['messageStatus']='';this[_0xd15f('0x14')](_0x36fc54);}}}};EmailChannel[_0xd15f('0x13')][_0xd15f('0x22')]=function(_0x5101c2,_0x5eae05){if(this[_0xd15f('0x10')][_0x5101c2]){this[_0xd15f('0x10')][_0x5101c2][_0xd15f('0x16')][_0xd15f('0x17')]=_0xd15f('0x28');this[_0xd15f('0x10')][_0x5101c2]['Imap']['messageStatus']=_0x5eae05[_0xd15f('0x15')];if(_0x5eae05[_0xd15f('0x29')]){this[_0xd15f('0x10')][_0x5101c2][_0xd15f('0x16')][_0xd15f('0x19')]=_0x5eae05[_0xd15f('0x29')][_0xd15f('0x19')];}return this[_0xd15f('0x14')](_0x5101c2);}};EmailChannel['prototype'][_0xd15f('0x2a')]=function(_0x417667,_0x3d0855){logger['info'](_0xd15f('0x2b'),_0x3d0855[_0xd15f('0x2c')],_0x3d0855['lastName'],_0x3d0855[_0xd15f('0x2d')],_0x417667);if(this['mailAccounts'][_0x417667]){return mailAccount[_0xd15f('0x2e')](_0x417667,_0x3d0855)[_0xd15f('0x2f')](function(_0x1f2907){if(_0x1f2907){logger[_0xd15f('0xe')](_0xd15f('0x30'));}})['catch'](function(_0x47b7ac){logger[_0xd15f('0x25')](_0xd15f('0x31'),JSON[_0xd15f('0x1b')](_0x47b7ac));});}};EmailChannel[_0xd15f('0x13')][_0xd15f('0x24')]=function(_0x578e1b){if(this['mailAccounts'][_0x578e1b]&&this['mailAccounts'][_0x578e1b][_0xd15f('0x16')]){if(this[_0xd15f('0x11')][this[_0xd15f('0x10')][_0x578e1b][_0xd15f('0x16')]['id']]){delete this[_0xd15f('0x11')][this['mailAccounts'][_0x578e1b][_0xd15f('0x16')]['id']];}this[_0xd15f('0x10')][_0x578e1b][_0xd15f('0x16')]['lastSync']=moment();this[_0xd15f('0x14')](_0x578e1b);}};EmailChannel[_0xd15f('0x13')][_0xd15f('0x26')]=function(_0xa36879,_0x24a98f){if(this[_0xd15f('0x10')][_0xa36879]){this[_0xd15f('0x10')][_0xa36879]['Imap'][_0xd15f('0x17')]=_0xd15f('0x25');this[_0xd15f('0x10')][_0xa36879][_0xd15f('0x16')][_0xd15f('0x18')]=_0x24a98f;return this[_0xd15f('0x14')](_0xa36879);}};EmailChannel[_0xd15f('0x13')][_0xd15f('0x32')]=function(_0x3b701d,_0x4ab0af){return this['smtp']['send'](_0x3b701d,_0x4ab0af);};EmailChannel['prototype'][_0xd15f('0x33')]=function(_0x129a6b){var _0x5f454b=this;if(this[_0xd15f('0x10')][_0x129a6b['id']]){if(_['isNil'](this['mailAccounts'][_0x129a6b['id']]['Smtp'])){this[_0xd15f('0x10')][_0x129a6b['id']][_0xd15f('0x34')]={};}this[_0xd15f('0x10')][_0x129a6b['id']]['Smtp'][_0xd15f('0x35')]=moment();return new BPromise(function(_0x1e8eca,_0x4828c3){return _0x5f454b[_0xd15f('0x12')][_0xd15f('0x36')](_0x129a6b)[_0xd15f('0x2f')](function(_0x3c74cc){_0x5f454b[_0xd15f('0x10')][_0x129a6b['id']][_0xd15f('0x34')][_0xd15f('0x17')]=_0xd15f('0x37');_0x5f454b[_0xd15f('0x10')][_0x129a6b['id']][_0xd15f('0x34')][_0xd15f('0x18')]='';_0x5f454b[_0xd15f('0x14')](_0x129a6b['id']);_0x1e8eca(_0x3c74cc);})['catch'](function(_0x255f63){_0x5f454b[_0xd15f('0x10')][_0x129a6b['id']][_0xd15f('0x34')][_0xd15f('0x17')]=_0xd15f('0x25');_0x5f454b[_0xd15f('0x10')][_0x129a6b['id']][_0xd15f('0x34')][_0xd15f('0x18')]=_0x255f63;_0x5f454b['emit'](_0x129a6b['id']);_0x4828c3(_0x255f63);});});}return this[_0xd15f('0x12')]['verify'](_0x129a6b);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 0ab7519..77aeda3 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 _0xb016=['isNil','service','authentication','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','stringify','textCode','lodash','util','simpleParser','Iconv','events','EventEmitter','./utils','email','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','inherits','prototype','connTimeout'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xb016,0x159));var _0x6b01=function(_0x7267c4,_0x3d79c4){_0x7267c4=_0x7267c4-0x0;var _0x31075d=_0xb016[_0x7267c4];return _0x31075d;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x6b01('0x2')];var Iconv=require('iconv')[_0x6b01('0x3')];var EventEmitter=require(_0x6b01('0x4'))[_0x6b01('0x5')];var utils=require(_0x6b01('0x6'));var logger=require('../../../config/logger')(_0x6b01('0x7'));function EmailImap(_0x65407a,_0x192b2d){this['mailbox']='INBOX';this[_0x6b01('0x8')]=this[_0x6b01('0x9')](_0x65407a,_0x192b2d);this['imap']=new Imap(this['account']);this[_0x6b01('0xa')][_0x6b01('0xb')](_0x6b01('0xc'),this[_0x6b01('0xd')][_0x6b01('0xe')](this));this['imap']['once'](_0x6b01('0xf'),this[_0x6b01('0x10')][_0x6b01('0xe')](this));this['imap']['on'](_0x6b01('0x11'),this['handleError']['bind'](this));this[_0x6b01('0xa')]['connect']();}util[_0x6b01('0x12')](EmailImap,EventEmitter);EmailImap[_0x6b01('0x13')]['getAccount']=function(_0x2c305e,_0x4ea5fa){var _0x50d778={'connTimeout':_0x2c305e['connTimeout']?_0x2c305e[_0x6b01('0x14')]*0x3e8:0x2710,'authTimeout':_0x2c305e['authTimeout']?_0x2c305e['authTimeout']*0x3e8:0x1388};if(_[_0x6b01('0x15')](_0x2c305e[_0x6b01('0x16')])){if(_0x2c305e[_0x6b01('0x17')]){_0x50d778[_0x6b01('0x18')]=_0x2c305e[_0x6b01('0x18')];_0x50d778[_0x6b01('0x19')]=_0x2c305e[_0x6b01('0x19')];}_0x50d778[_0x6b01('0x1a')]=_0x2c305e[_0x6b01('0x1a')];_0x50d778[_0x6b01('0x1b')]=_0x2c305e[_0x6b01('0x1b')]||0x3e1;if(_0x2c305e['tls']){_0x50d778[_0x6b01('0x1c')]=!![];}else{_0x50d778[_0x6b01('0x1c')]=![];_0x50d778[_0x6b01('0x1d')]=_0x6b01('0x1e');}}else{if(_0x2c305e[_0x6b01('0x1f')]){_0x50d778[_0x6b01('0x20')]=utils[_0x6b01('0x21')](_0x2c305e[_0x6b01('0x22')]['data5'],_0x2c305e[_0x6b01('0x18')]);_0x50d778[_0x6b01('0x18')]=_0x2c305e[_0x6b01('0x18')];}else{_0x50d778[_0x6b01('0x18')]=_0x2c305e[_0x6b01('0x18')];_0x50d778[_0x6b01('0x19')]=_0x2c305e[_0x6b01('0x19')];}_0x50d778['host']=utils[_0x6b01('0x23')](_0x2c305e[_0x6b01('0x16')]);_0x50d778[_0x6b01('0x1b')]=0x3e1;_0x50d778['tls']=!![];}_0x50d778[_0x6b01('0x7')]=_0x4ea5fa||_0x2c305e[_0x6b01('0x18')]||_0x6b01('0x24');return _0x50d778;};EmailImap[_0x6b01('0x13')][_0x6b01('0xd')]=function(){this[_0x6b01('0xa')][_0x6b01('0x25')](this[_0x6b01('0x26')],![],this[_0x6b01('0x27')][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')][_0x6b01('0x27')]=function(_0x154dfc,_0x55ca4b){if(_0x154dfc){this[_0x6b01('0x28')](_0x154dfc,!![]);}else{this[_0x6b01('0x29')](_0x6b01('0x2a'),_0x55ca4b);this[_0x6b01('0x2b')]();}};EmailImap[_0x6b01('0x13')]['handleCloseBox']=function(_0x54f030){if(_0x54f030){this[_0x6b01('0x28')](_0x54f030,!![]);}else{this[_0x6b01('0xa')][_0x6b01('0xf')]();}};EmailImap[_0x6b01('0x13')][_0x6b01('0x2b')]=function(){this[_0x6b01('0xa')]['search']([_0x6b01('0x2c')],this['handleReadUnseen'][_0x6b01('0xe')](this));};EmailImap['prototype'][_0x6b01('0x2d')]=function(_0xa6b2b6,_0x473201){if(_0xa6b2b6){this[_0x6b01('0x28')](_0xa6b2b6,!![]);}else{if(_0x473201[_0x6b01('0x2e')]){try{var _0x54575c=this[_0x6b01('0xa')][_0x6b01('0x2f')](_0x473201,{'bodies':'','markSeen':!![]});_0x54575c['on'](_0x6b01('0x30'),this['handleFetchMessage']['bind'](this));_0x54575c[_0x6b01('0xb')]('error',this[_0x6b01('0x31')][_0x6b01('0xe')](this));_0x54575c[_0x6b01('0xb')]('end',this[_0x6b01('0x32')][_0x6b01('0xe')](this));}catch(_0x186a6d){logger['error'](_0x186a6d);}}else{this[_0x6b01('0xa')][_0x6b01('0x33')](!![],this[_0x6b01('0x34')][_0x6b01('0xe')](this));}}};EmailImap[_0x6b01('0x13')]['handleFetchMessage']=function(_0xa041ea){_0xa041ea['on'](_0x6b01('0x35'),this[_0x6b01('0x36')][_0x6b01('0xe')](this));_0xa041ea[_0x6b01('0xb')](_0x6b01('0x37'),this[_0x6b01('0x38')][_0x6b01('0xe')](this));_0xa041ea['once'](_0x6b01('0xf'),this['handleMessageEnd'][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')][_0x6b01('0x36')]=function(_0x318b8b){simpleParser(_0x318b8b,{'Iconv':Iconv},this[_0x6b01('0x39')][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x6b01('0x13')][_0x6b01('0x3a')]=function(){};EmailImap[_0x6b01('0x13')][_0x6b01('0x39')]=function(_0x1ca3aa,_0x2c4205){if(_0x1ca3aa){logger[_0x6b01('0x11')](_0x1ca3aa);}else{var _0x44bf46=this;utils['parser'](this[_0x6b01('0x8')],_0x2c4205,function(_0x55907f){_0x44bf46[_0x6b01('0x29')](_0x6b01('0x7'),_0x55907f);});}};EmailImap['prototype'][_0x6b01('0x32')]=function(){this[_0x6b01('0xa')][_0x6b01('0x33')](!![],this[_0x6b01('0x34')][_0x6b01('0xe')](this));};EmailImap[_0x6b01('0x13')][_0x6b01('0x31')]=function(_0x93737a){this[_0x6b01('0x28')](_0x93737a);this[_0x6b01('0xa')]['closeBox'](!![],this[_0x6b01('0x34')][_0x6b01('0xe')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x6b01('0x29')](_0x6b01('0xf'));};EmailImap['prototype'][_0x6b01('0x28')]=function(_0x3f9e46,_0x55bf71){logger[_0x6b01('0x11')]('handleError',this[_0x6b01('0x8')][_0x6b01('0x7')],JSON[_0x6b01('0x3b')](_0x3f9e46));var _0x50b13d='';if(_0x3f9e46){if(_0x3f9e46[_0x6b01('0x3c')]){_0x50b13d=_0x3f9e46[_0x6b01('0x3c')];}else{for(var _0x52cc57 in _0x3f9e46){if(_0x3f9e46['hasOwnProperty'](_0x52cc57)){_0x50b13d+=_['upperFirst'](_0x52cc57)+':\x20'+_0x3f9e46[_0x52cc57]+'\x0a';}}}}if(_0x55bf71){this[_0x6b01('0xa')][_0x6b01('0xf')]();}else{this[_0x6b01('0x29')](_0x6b01('0x11'),_0x50b13d);this[_0x6b01('0x29')](_0x6b01('0xf'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x53ec=['modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','service','email','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','handleFetchMessage','handleFetchError','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','events','./utils','../../../config/logger','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','handleEnd','error','handleError','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required'];(function(_0x275d5f,_0x232fb5){var _0x1e66fc=function(_0x395d29){while(--_0x395d29){_0x275d5f['push'](_0x275d5f['shift']());}};_0x1e66fc(++_0x232fb5);}(_0x53ec,0x192));var _0xc53e=function(_0x2d9f30,_0x258111){_0x2d9f30=_0x2d9f30-0x0;var _0x243932=_0x53ec[_0x2d9f30];return _0x243932;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var Imap=require(_0xc53e('0x2'));var simpleParser=require(_0xc53e('0x3'))[_0xc53e('0x4')];var Iconv=require(_0xc53e('0x5'))['Iconv'];var EventEmitter=require(_0xc53e('0x6'))['EventEmitter'];var utils=require(_0xc53e('0x7'));var logger=require(_0xc53e('0x8'))('email');function EmailImap(_0x2f1414,_0x4f989b){this[_0xc53e('0x9')]=_0xc53e('0xa');this['account']=this[_0xc53e('0xb')](_0x2f1414,_0x4f989b);this[_0xc53e('0x2')]=new Imap(this[_0xc53e('0xc')]);this[_0xc53e('0x2')][_0xc53e('0xd')](_0xc53e('0xe'),this[_0xc53e('0xf')][_0xc53e('0x10')](this));this[_0xc53e('0x2')]['once']('end',this[_0xc53e('0x11')]['bind'](this));this['imap']['on'](_0xc53e('0x12'),this[_0xc53e('0x13')][_0xc53e('0x10')](this));this[_0xc53e('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xc53e('0x14')][_0xc53e('0xb')]=function(_0x7cd798,_0x3d2e17){var _0x358ef3={'connTimeout':_0x7cd798[_0xc53e('0x15')]?_0x7cd798[_0xc53e('0x15')]*0x3e8:0x2710,'authTimeout':_0x7cd798[_0xc53e('0x16')]?_0x7cd798[_0xc53e('0x16')]*0x3e8:0x1388};if(_[_0xc53e('0x17')](_0x7cd798['service'])){if(_0x7cd798[_0xc53e('0x18')]){_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];_0x358ef3[_0xc53e('0x1a')]=_0x7cd798[_0xc53e('0x1a')];}_0x358ef3[_0xc53e('0x1b')]=_0x7cd798[_0xc53e('0x1b')];_0x358ef3[_0xc53e('0x1c')]=_0x7cd798[_0xc53e('0x1c')]||0x3e1;if(_0x7cd798['tls']){_0x358ef3['tls']=!![];}else{_0x358ef3[_0xc53e('0x1d')]=![];_0x358ef3[_0xc53e('0x1e')]=_0xc53e('0x1f');}}else{if(_0x7cd798[_0xc53e('0x20')]){_0x358ef3[_0xc53e('0x21')]=utils[_0xc53e('0x22')](_0x7cd798[_0xc53e('0x23')][_0xc53e('0x24')],_0x7cd798[_0xc53e('0x19')]);_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];}else{_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];_0x358ef3['password']=_0x7cd798['password'];}_0x358ef3['host']=utils[_0xc53e('0x25')](_0x7cd798[_0xc53e('0x26')]);_0x358ef3[_0xc53e('0x1c')]=0x3e1;_0x358ef3[_0xc53e('0x1d')]=!![];}_0x358ef3[_0xc53e('0x27')]=_0x3d2e17||_0x7cd798['user']||'anonymous@xcally.com';return _0x358ef3;};EmailImap[_0xc53e('0x14')]['handleReady']=function(){this[_0xc53e('0x2')][_0xc53e('0x28')](this[_0xc53e('0x9')],![],this[_0xc53e('0x29')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x29')]=function(_0x4b9f6a,_0x4d9a68){if(_0x4b9f6a){this['handleError'](_0x4b9f6a,!![]);}else{this[_0xc53e('0x2a')]('box',_0x4d9a68);this[_0xc53e('0x2b')]();}};EmailImap['prototype'][_0xc53e('0x2c')]=function(_0x5112d2){if(_0x5112d2){this['handleError'](_0x5112d2,!![]);}else{this[_0xc53e('0x2')][_0xc53e('0x2d')]();}};EmailImap[_0xc53e('0x14')][_0xc53e('0x2b')]=function(){this[_0xc53e('0x2')][_0xc53e('0x2e')]([_0xc53e('0x2f')],this[_0xc53e('0x30')]['bind'](this));};EmailImap[_0xc53e('0x14')][_0xc53e('0x30')]=function(_0x2d36c0,_0x56206b){if(_0x2d36c0){this[_0xc53e('0x13')](_0x2d36c0,!![]);}else{if(_0x56206b['length']){try{var _0x4572e=this[_0xc53e('0x2')]['fetch'](_0x56206b,{'bodies':'','markSeen':!![]});_0x4572e['on']('message',this[_0xc53e('0x31')][_0xc53e('0x10')](this));_0x4572e[_0xc53e('0xd')](_0xc53e('0x12'),this[_0xc53e('0x32')][_0xc53e('0x10')](this));_0x4572e[_0xc53e('0xd')](_0xc53e('0x2d'),this['handleFetchEnd'][_0xc53e('0x10')](this));}catch(_0x3bae8a){logger[_0xc53e('0x12')](_0x3bae8a);}}else{this[_0xc53e('0x2')][_0xc53e('0x33')](!![],this[_0xc53e('0x2c')][_0xc53e('0x10')](this));}}};EmailImap[_0xc53e('0x14')][_0xc53e('0x31')]=function(_0x595efb){_0x595efb['on'](_0xc53e('0x34'),this['handleMessageBody'][_0xc53e('0x10')](this));_0x595efb[_0xc53e('0xd')]('attributes',this[_0xc53e('0x35')][_0xc53e('0x10')](this));_0x595efb[_0xc53e('0xd')]('end',this[_0xc53e('0x36')][_0xc53e('0x10')](this));};EmailImap[_0xc53e('0x14')][_0xc53e('0x37')]=function(_0xeaec72){simpleParser(_0xeaec72,{'Iconv':Iconv},this[_0xc53e('0x38')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x35')]=function(){};EmailImap[_0xc53e('0x14')][_0xc53e('0x36')]=function(){};EmailImap['prototype'][_0xc53e('0x38')]=function(_0x5e8ab7,_0xaa00cd){if(_0x5e8ab7){logger[_0xc53e('0x12')](_0x5e8ab7);}else{var _0x40c4f5=this;utils[_0xc53e('0x39')](this[_0xc53e('0xc')],_0xaa00cd,function(_0x5507d0){_0x40c4f5[_0xc53e('0x2a')](_0xc53e('0x27'),_0x5507d0);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this[_0xc53e('0x2c')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x32')]=function(_0x574983){this['handleError'](_0x574983);this['imap'][_0xc53e('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xc53e('0x14')]['handleEnd']=function(){this[_0xc53e('0x2a')](_0xc53e('0x2d'));};EmailImap['prototype'][_0xc53e('0x13')]=function(_0x3a4ebc,_0x509a04){logger[_0xc53e('0x12')]('handleError',this['account']['email'],JSON['stringify'](_0x3a4ebc));var _0x887d78='';if(_0x3a4ebc){if(_0x3a4ebc[_0xc53e('0x3a')]){_0x887d78=_0x3a4ebc[_0xc53e('0x3a')];}else{for(var _0x5f1884 in _0x3a4ebc){if(_0x3a4ebc[_0xc53e('0x3b')](_0x5f1884)){_0x887d78+=_[_0xc53e('0x3c')](_0x5f1884)+':\x20'+_0x3a4ebc[_0x5f1884]+'\x0a';}}}}if(_0x509a04){this['imap']['end']();}else{this[_0xc53e('0x2a')](_0xc53e('0x12'),_0x887d78);this[_0xc53e('0x2a')]('end');}};module[_0xc53e('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 16fabba..908c183 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 _0xfdbd=['nodemailer','nodemailer-plugin-inline-base64','prototype','send','use','sendMail','verify','createTransport','toString','exports'];(function(_0x198577,_0x3040c6){var _0x58bba3=function(_0x1aa42b){while(--_0x1aa42b){_0x198577['push'](_0x198577['shift']());}};_0x58bba3(++_0x3040c6);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0xfdbd[_0x22ccc0];return _0xe2af6a;};'use strict';var nodemailer=require(_0xdfdb('0x0'));var inlineBase64=require(_0xdfdb('0x1'));function EmailSmtp(){}EmailSmtp[_0xdfdb('0x2')][_0xdfdb('0x3')]=function(_0x28f05d,_0x3078f0){return new Promise(function(_0x11218a,_0x66533b){var _0x330ad3=nodemailer['createTransport'](_0x28f05d);_0x330ad3[_0xdfdb('0x4')]('compile',inlineBase64());_0x330ad3[_0xdfdb('0x5')](_0x3078f0,function(_0x41bd5e,_0x489f19){if(_0x41bd5e)return _0x66533b(_0x41bd5e['toString']());return _0x11218a(_0x489f19);});});};EmailSmtp['prototype'][_0xdfdb('0x6')]=function(_0xf72a24){return new Promise(function(_0x47c629,_0x11d845){var _0x444c19=nodemailer[_0xdfdb('0x7')](_0xf72a24);_0x444c19[_0xdfdb('0x6')](function(_0x3a44a9,_0x1ace28){if(_0x3a44a9)return _0x11d845(_0x3a44a9[_0xdfdb('0x8')]());if(!_0x1ace28)return _0x11d845('Not\x20verified');return _0x47c629(_0x1ace28);});});};module[_0xdfdb('0x9')]=EmailSmtp; \ No newline at end of file +var _0x01d9=['prototype','send','createTransport','use','compile','toString','verify','Not\x20verified','nodemailer','nodemailer-plugin-inline-base64'];(function(_0xc9cd47,_0x35a546){var _0x26827e=function(_0x32d967){while(--_0x32d967){_0xc9cd47['push'](_0xc9cd47['shift']());}};_0x26827e(++_0x35a546);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var nodemailer=require(_0x901d('0x0'));var inlineBase64=require(_0x901d('0x1'));function EmailSmtp(){}EmailSmtp[_0x901d('0x2')][_0x901d('0x3')]=function(_0x521cc9,_0x2ce1fd){return new Promise(function(_0x28bf48,_0x247cfc){var _0x8f7b4=nodemailer[_0x901d('0x4')](_0x521cc9);_0x8f7b4[_0x901d('0x5')](_0x901d('0x6'),inlineBase64());_0x8f7b4['sendMail'](_0x2ce1fd,function(_0x1e5d7d,_0x6c9ac8){if(_0x1e5d7d)return _0x247cfc(_0x1e5d7d[_0x901d('0x7')]());return _0x28bf48(_0x6c9ac8);});});};EmailSmtp[_0x901d('0x2')][_0x901d('0x8')]=function(_0x39fc94){return new Promise(function(_0x202568,_0x2555e0){var _0x15076e=nodemailer[_0x901d('0x4')](_0x39fc94);_0x15076e[_0x901d('0x8')](function(_0xd819f0,_0x1d3137){if(_0xd819f0)return _0x2555e0(_0xd819f0['toString']());if(!_0x1d3137)return _0x2555e0(_0x901d('0x9'));return _0x202568(_0x1d3137);});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ea1bf81..c579572 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 _0xaa09=['body','message','originTo','email','bcc','attachments','attach','type','attachment-','format','now','join','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','Attachments','push','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','length','slice','Anonymous','pop','isEmpty','anonymous','test','html','replace','includes','\x20[Attachment:\x20','\x20]'];(function(_0x4f4c89,_0x330fa1){var _0x10f812=function(_0x8934fe){while(--_0x8934fe){_0x4f4c89['push'](_0x4f4c89['shift']());}};_0x10f812(++_0x330fa1);}(_0xaa09,0x77));var _0x9aa0=function(_0x40189c,_0x3a35d4){_0x40189c=_0x40189c-0x0;var _0xac4ebb=_0xaa09[_0x40189c];return _0xac4ebb;};'use strict';var _=require(_0x9aa0('0x0'));var moment=require(_0x9aa0('0x1'));var random=require(_0x9aa0('0x2'));var fs=require('fs');var path=require(_0x9aa0('0x3'));var util=require(_0x9aa0('0x4'));var tnef=require(_0x9aa0('0x5'));var logger=require(_0x9aa0('0x6'))('email');var config=require(_0x9aa0('0x7'));function getAddress(_0x57182f){var _0x2877eb=_[_0x9aa0('0x8')](_0x57182f[_0x9aa0('0x9')]);return _0x2877eb&&_0x2877eb[_0x9aa0('0xa')]?_0x2877eb[_0x9aa0('0xa')]:'anonymous'+random[_0x9aa0('0xb')](0x6)+_0x9aa0('0xc');}function getFirstName(_0x34c7c9){var _0x518438=_[_0x9aa0('0x8')](_0x34c7c9[_0x9aa0('0x9')]);if(_0x518438&&_0x518438[_0x9aa0('0xd')]){if(_0x518438[_0x9aa0('0xd')]==_0x518438[_0x9aa0('0xa')]){return _0x518438[_0x9aa0('0xd')][_0x9aa0('0xe')](0x0,_0x518438[_0x9aa0('0xd')][_0x9aa0('0xf')]('@'));}var _0x3eb532=_0x518438['name']['split'](/\s+/);return _0x3eb532[_0x9aa0('0x10')]>0x1?_0x3eb532[_0x9aa0('0x11')](0x0,-0x1)['join']('\x20'):_0x518438[_0x9aa0('0xd')];}return _0x9aa0('0x12');}function getLastName(_0x31c653){var _0x50a524=_['head'](_0x31c653[_0x9aa0('0x9')]);if(_0x50a524&&_0x50a524['name']){var _0x2df9e5=_0x50a524[_0x9aa0('0xd')]['split'](/\s+/);return _0x2df9e5['length']>0x1?_0x2df9e5[_0x9aa0('0x13')]():'';}return'';}function getMails(_0x3512fb,_0x462501){var _0x4d96b8='';for(var _0x5d12a8=0x0;_0x5d12a8<_0x462501[_0x9aa0('0x9')][_0x9aa0('0x10')];_0x5d12a8+=0x1){if(_0x462501[_0x9aa0('0x9')][_0x5d12a8]['address']!==_0x3512fb){if(!_[_0x9aa0('0x14')](_0x4d96b8)){_0x4d96b8+=',';}_0x4d96b8+=_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xd')]||_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xa')]||'';_0x4d96b8+='\x20<';_0x4d96b8+=_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xa')]?_0x462501[_0x9aa0('0x9')][_0x5d12a8][_0x9aa0('0xa')]:_0x9aa0('0x15')+random[_0x9aa0('0xb')](0x6)+_0x9aa0('0xc');_0x4d96b8+='>';}}return _0x4d96b8;}function parseEmail(_0x28820f,_0x1d870f,_0x1b3db6){if(_0x1d870f['html']){var _0x48f84c=/)<[^<]*)*<\/script>/gi;while(_0x48f84c[_0x9aa0('0x16')](_0x1d870f[_0x9aa0('0x17')])){_0x1d870f[_0x9aa0('0x17')]=_0x1d870f[_0x9aa0('0x17')][_0x9aa0('0x18')](_0x48f84c,'');}if(_0x1d870f[_0x9aa0('0x17')][_0x9aa0('0x19')](_0x9aa0('0x1a'))){var _0x3045da=[];_0x1d870f['attachments']['forEach'](_0x50074b=>{_0x3045da['push'](_0x50074b[_0x9aa0('0x1b')]);});var _0x2fc9e5=/]+>/g;var _0x3a71c6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2b1b1a=_0x1d870f['html']['replace'](_0x3a71c6,_0x9aa0('0x1c'));var _0x1cd6b4=_0x2b1b1a[_0x9aa0('0x18')](_0x2fc9e5,'_IMG');for(let _0x3b6f62=0x0;_0x3b6f62<_0x3045da[_0x9aa0('0x10')];_0x3b6f62++){var _0x365bad=_0x1cd6b4[_0x9aa0('0x18')]('_IMG',_0x9aa0('0x1d')+_0x3045da[_0x3b6f62]+_0x9aa0('0x1e'));_0x1cd6b4=_0x365bad;}_0x1d870f[_0x9aa0('0x17')]=_0x1cd6b4;}_0x1b3db6[_0x9aa0('0x1f')]=_0x1d870f['html'];}else{_0x1b3db6[_0x9aa0('0x1f')]=_0x1d870f['textAsHtml'];}if(_0x1b3db6[_0x9aa0('0x1f')]){_0x1b3db6['body']=_0x1b3db6[_0x9aa0('0x1f')][_0x9aa0('0x18')](/0x0){var _0x4d3d25=[_0x9aa0('0x2f'),_0x9aa0('0x30'),_0x9aa0('0x31')];for(var _0x1fd156=0x0;_0x1fd156<_0x1d870f[_0x9aa0('0x2e')]['length'];_0x1fd156++){var _0x368b2a=_[_0x9aa0('0xf')](_0x4d3d25,_0x1d870f[_0x9aa0('0x2e')][_0x1fd156][_0x9aa0('0x32')]);if(_0x368b2a>=0x0){_0x1b3db6[_0x9aa0('0x33')]=!![];}}}return _0x1b3db6;}exports[_0x9aa0('0x34')]=function(_0xc5c4c7,_0x1e5eea,_0x43d038){var _0x9819a9={'from':getAddress(_0x1e5eea['from']),'firstName':getFirstName(_0x1e5eea[_0x9aa0('0x35')]),'lastName':getLastName(_0x1e5eea[_0x9aa0('0x35')]),'mapKey':'email','message':{'from':getMails(_0xc5c4c7['email'],_0x1e5eea[_0x9aa0('0x35')]),'to':_0xc5c4c7[_0x9aa0('0x22')],'cc':'','subject':_0x1e5eea[_0x9aa0('0x36')]||'','messageId':_0x1e5eea['messageId'],'inReplyTo':_0x1e5eea['inReplyTo'],'sentAt':moment(_0x1e5eea['date'])[_0x9aa0('0x28')](_0x9aa0('0x37')),'attach':![],'attachments':[]}};if(!_0x1e5eea[_0x9aa0('0x17')]&&!_0x1e5eea[_0x9aa0('0x38')]){var _0x104476=_[_0x9aa0('0x39')](_0x1e5eea[_0x9aa0('0x24')],{'contentType':_0x9aa0('0x3a')});if(_0x104476['length']){logger['info'](util[_0x9aa0('0x28')](_0x9aa0('0x3b'),_0x1e5eea['messageId']));tnef[_0x9aa0('0x3c')](_[_0x9aa0('0x3d')](_0x104476)['content'],function(_0x1db098,_0x4506aa){if(_0x4506aa){_0x1e5eea[_0x9aa0('0x17')]=_0x4506aa['BodyHTML']||'

Empty\x20message

';if(_0x4506aa[_0x9aa0('0x3e')]){for(var _0x11de3a=0x0;_0x11de3a<_0x4506aa['Attachments']['length'];_0x11de3a++){var _0x2520c8=_0x4506aa[_0x9aa0('0x3e')][_0x11de3a];_0x9819a9[_0x9aa0('0x20')]['attachments'][_0x9aa0('0x3f')]({'filename':_0x2520c8['Title'],'content':Buffer[_0x9aa0('0x35')](_0x2520c8[_0x9aa0('0x40')])});}}}_0x43d038(parseEmail(_0xc5c4c7,_0x1e5eea,_0x9819a9));});}else{_0x1e5eea[_0x9aa0('0x17')]='

Empty\x20message

';_0x43d038(parseEmail(_0xc5c4c7,_0x1e5eea,_0x9819a9));}}else{_0x43d038(parseEmail(_0xc5c4c7,_0x1e5eea,_0x9819a9));}};exports[_0x9aa0('0x41')]=function(_0x4a3e5){switch(_0x4a3e5){case'gmail':return _0x9aa0('0x42');case _0x9aa0('0x43'):return _0x9aa0('0x44');case'hotmail':return'imap-mail.outlook.com';case _0x9aa0('0x45'):return _0x9aa0('0x46');}return'127.0.0.1';};exports['generateXOAuth2Token']=function(_0x2c7e81,_0x377287){var _0x46bac5=[_0x9aa0('0x47')+(_0x377287||''),_0x9aa0('0x48')+_0x2c7e81,'',''];return Buffer['from'](_0x46bac5[_0x9aa0('0x2a')](''),'utf-8')[_0x9aa0('0x49')](_0x9aa0('0x4a'));}; \ No newline at end of file +var _0x5cfa=['X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','headerLines','line','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.mail.yahoo.com','outlook365','outlook.office365.com','auth=Bearer\x20','utf-8','moment','path','util','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','attachments','forEach','push','filename','replace','_IMG','\x20]','body','textAsHtml','0x1?_0x53049d[_0xa5cf('0x10')](0x0,-0x1)[_0xa5cf('0x11')]('\x20'):_0x59ad25[_0xa5cf('0xb')];}return _0xa5cf('0x12');}function getLastName(_0x1a043d){var _0x13a863=_[_0xa5cf('0x5')](_0x1a043d['value']);if(_0x13a863&&_0x13a863[_0xa5cf('0xb')]){var _0x324a8f=_0x13a863[_0xa5cf('0xb')][_0xa5cf('0xe')](/\s+/);return _0x324a8f['length']>0x1?_0x324a8f[_0xa5cf('0x13')]():'';}return'';}function getMails(_0x37cb13,_0xf06a35){var _0x3b0294='';for(var _0x3e3c98=0x0;_0x3e3c98<_0xf06a35[_0xa5cf('0x6')][_0xa5cf('0xf')];_0x3e3c98+=0x1){if(_0xf06a35[_0xa5cf('0x6')][_0x3e3c98]['address']!==_0x37cb13){if(!_[_0xa5cf('0x14')](_0x3b0294)){_0x3b0294+=',';}_0x3b0294+=_0xf06a35[_0xa5cf('0x6')][_0x3e3c98][_0xa5cf('0xb')]||_0xf06a35[_0xa5cf('0x6')][_0x3e3c98]['address']||'';_0x3b0294+='\x20<';_0x3b0294+=_0xf06a35[_0xa5cf('0x6')][_0x3e3c98][_0xa5cf('0x7')]?_0xf06a35[_0xa5cf('0x6')][_0x3e3c98][_0xa5cf('0x7')]:'anonymous'+random['generate'](0x6)+_0xa5cf('0xa');_0x3b0294+='>';}}return _0x3b0294;}function parseEmail(_0x17aa27,_0x5b5c72,_0x5701bb){if(_0x5b5c72[_0xa5cf('0x15')]){var _0x70b11a=/)<[^<]*)*<\/script>/gi;while(_0x70b11a[_0xa5cf('0x16')](_0x5b5c72[_0xa5cf('0x15')])){_0x5b5c72[_0xa5cf('0x15')]=_0x5b5c72[_0xa5cf('0x15')]['replace'](_0x70b11a,'');}if(_0x5b5c72['html']['includes']('{_0x3dd70a[_0xa5cf('0x19')](_0x203784[_0xa5cf('0x1a')]);});var _0xee7274=/]+>/g;var _0x15dd09=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1ef3d5=_0x5b5c72[_0xa5cf('0x15')]['replace'](_0x15dd09,'_SRC');var _0x50b3c7=_0x1ef3d5[_0xa5cf('0x1b')](_0xee7274,_0xa5cf('0x1c'));for(let _0x1b3eb9=0x0;_0x1b3eb9<_0x3dd70a[_0xa5cf('0xf')];_0x1b3eb9++){var _0x37855f=_0x50b3c7['replace'](_0xa5cf('0x1c'),'\x20[Attachment:\x20'+_0x3dd70a[_0x1b3eb9]+_0xa5cf('0x1d'));_0x50b3c7=_0x37855f;}_0x5b5c72[_0xa5cf('0x15')]=_0x50b3c7;}_0x5701bb[_0xa5cf('0x1e')]=_0x5b5c72[_0xa5cf('0x15')];}else{_0x5701bb['body']=_0x5b5c72[_0xa5cf('0x1f')];}if(_0x5701bb[_0xa5cf('0x1e')]){_0x5701bb[_0xa5cf('0x1e')]=_0x5701bb['body']['replace'](/0x0){var _0x4b2747=[_0xa5cf('0x2e'),_0xa5cf('0x2f'),_0xa5cf('0x30')];for(var _0x4a3361=0x0;_0x4a3361<_0x5b5c72[_0xa5cf('0x31')][_0xa5cf('0xf')];_0x4a3361++){var _0xb15189=_['indexOf'](_0x4b2747,_0x5b5c72[_0xa5cf('0x31')][_0x4a3361][_0xa5cf('0x32')]);if(_0xb15189>=0x0){_0x5701bb['isAutoreply']=!![];}}}return _0x5701bb;}exports[_0xa5cf('0x33')]=function(_0x5222b2,_0x4502db,_0x179a5f){var _0x5b1893={'from':getAddress(_0x4502db['from']),'firstName':getFirstName(_0x4502db[_0xa5cf('0x34')]),'lastName':getLastName(_0x4502db[_0xa5cf('0x34')]),'mapKey':_0xa5cf('0x3'),'message':{'from':getMails(_0x5222b2[_0xa5cf('0x3')],_0x4502db[_0xa5cf('0x34')]),'to':_0x5222b2['email'],'cc':'','subject':_0x4502db[_0xa5cf('0x35')]||'','messageId':_0x4502db[_0xa5cf('0x36')],'inReplyTo':_0x4502db['inReplyTo'],'sentAt':moment(_0x4502db[_0xa5cf('0x37')])[_0xa5cf('0x28')](_0xa5cf('0x38')),'attach':![],'attachments':[]}};if(!_0x4502db[_0xa5cf('0x15')]&&!_0x4502db[_0xa5cf('0x1f')]){var _0x592a73=_[_0xa5cf('0x39')](_0x4502db['attachments'],{'contentType':_0xa5cf('0x3a')});if(_0x592a73[_0xa5cf('0xf')]){logger[_0xa5cf('0x3b')](util['format'](_0xa5cf('0x3c'),_0x4502db['messageId']));tnef[_0xa5cf('0x3d')](_[_0xa5cf('0x3e')](_0x592a73)[_0xa5cf('0x2c')],function(_0x2b7278,_0xdc850c){if(_0xdc850c){_0x4502db[_0xa5cf('0x15')]=_0xdc850c[_0xa5cf('0x3f')]||_0xa5cf('0x40');if(_0xdc850c[_0xa5cf('0x41')]){for(var _0x5e529f=0x0;_0x5e529f<_0xdc850c[_0xa5cf('0x41')][_0xa5cf('0xf')];_0x5e529f++){var _0x1ae9a9=_0xdc850c[_0xa5cf('0x41')][_0x5e529f];_0x5b1893[_0xa5cf('0x21')][_0xa5cf('0x17')][_0xa5cf('0x19')]({'filename':_0x1ae9a9[_0xa5cf('0x42')],'content':Buffer[_0xa5cf('0x34')](_0x1ae9a9[_0xa5cf('0x43')])});}}}_0x179a5f(parseEmail(_0x5222b2,_0x4502db,_0x5b1893));});}else{_0x4502db[_0xa5cf('0x15')]=_0xa5cf('0x40');_0x179a5f(parseEmail(_0x5222b2,_0x4502db,_0x5b1893));}}else{_0x179a5f(parseEmail(_0x5222b2,_0x4502db,_0x5b1893));}};exports[_0xa5cf('0x44')]=function(_0xbd4eed){switch(_0xbd4eed){case _0xa5cf('0x45'):return'imap.gmail.com';case'yahoo':return _0xa5cf('0x46');case'hotmail':return'imap-mail.outlook.com';case _0xa5cf('0x47'):return _0xa5cf('0x48');}return'127.0.0.1';};exports['generateXOAuth2Token']=function(_0x3a09b3,_0x310a5d){var _0x43aa03=['user='+(_0x310a5d||''),_0xa5cf('0x49')+_0x3a09b3,'',''];return Buffer[_0xa5cf('0x34')](_0x43aa03['join'](''),_0xa5cf('0x4a'))['toString']('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 2c33508..4df3272 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 _0xd677=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x13052e,_0x5c5754){var _0x685d7e=function(_0x182db4){while(--_0x182db4){_0x13052e['push'](_0x13052e['shift']());}};_0x685d7e(++_0x5c5754);}(_0xd677,0x154));var _0x7d67=function(_0x5b95f2,_0x2adb49){_0x5b95f2=_0x5b95f2-0x0;var _0x376b33=_0xd677[_0x5b95f2];return _0x376b33;};'use strict';var _=require(_0x7d67('0x0'));function MailAccount(_0x1d80fb){this['id']=_0x1d80fb['id']||0x0;this[_0x7d67('0x1')]=_0x1d80fb[_0x7d67('0x1')]||_0x7d67('0x2');this['key']=_0x1d80fb[_0x7d67('0x3')]||_0x7d67('0x4');this[_0x7d67('0x5')]=_0x1d80fb[_0x7d67('0x5')]||![];this['Imap']=_0x1d80fb[_0x7d67('0x6')]||[];this[_0x7d67('0x7')]=_0x1d80fb[_0x7d67('0x7')]||[];}module[_0x7d67('0x8')]=MailAccount; \ No newline at end of file +var _0xcda7=['Smtp','name','Service','key','SERV','active','Imap'];(function(_0x1125d2,_0x4a49cb){var _0x3b1372=function(_0x16a156){while(--_0x16a156){_0x1125d2['push'](_0x1125d2['shift']());}};_0x3b1372(++_0x4a49cb);}(_0xcda7,0x1c8));var _0x7cda=function(_0x2c7aa2,_0x5ef162){_0x2c7aa2=_0x2c7aa2-0x0;var _0x1e4a12=_0xcda7[_0x2c7aa2];return _0x1e4a12;};'use strict';var _=require('lodash');function MailAccount(_0x4abad4){this['id']=_0x4abad4['id']||0x0;this[_0x7cda('0x0')]=_0x4abad4[_0x7cda('0x0')]||_0x7cda('0x1');this[_0x7cda('0x2')]=_0x4abad4[_0x7cda('0x2')]||_0x7cda('0x3');this[_0x7cda('0x4')]=_0x4abad4[_0x7cda('0x4')]||![];this[_0x7cda('0x5')]=_0x4abad4[_0x7cda('0x5')]||[];this['Smtp']=_0x4abad4[_0x7cda('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index b2a13a8..94d7358 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 _0x6d2f=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','length','isUndefined'];(function(_0x501b35,_0x352c25){var _0x204306=function(_0x79bbd8){while(--_0x79bbd8){_0x501b35['push'](_0x501b35['shift']());}};_0x204306(++_0x352c25);}(_0x6d2f,0xc0));var _0xf6d2=function(_0x1cd65a,_0x29fa8f){_0x1cd65a=_0x1cd65a-0x0;var _0xf93849=_0x6d2f[_0x1cd65a];return _0xf93849;};'use strict';var _=require(_0xf6d2('0x0'));var MailAccount=require(_0xf6d2('0x1'));var Realtime=function(){this[_0xf6d2('0x2')]={};};function freeIsNotKey(_0x558f52,_0xcb94bb,_0x5054ce){var _0x401608=_[_0xf6d2('0x3')](_0x558f52,function(_0x1cbd74,_0x52da96){return _0x1cbd74[_0x5054ce];});for(var _0x400cec in _0xcb94bb){if(_0xcb94bb[_0xf6d2('0x4')](_0x400cec)){if(!_0x401608[_0x400cec]){delete _0xcb94bb[_0x400cec];}}}}Realtime[_0xf6d2('0x5')]['mergeFromDatabase']=function(_0x551709,_0x7a8263){for(var _0x5715c3 in _0x7a8263){if(_0x551709[_0xf6d2('0x4')](_0x5715c3)){_0x551709[_0x5715c3]=_0x7a8263[_0x5715c3];}}};Realtime[_0xf6d2('0x5')]['initMailAccounts']=function(){var _0xcaa468=this;return function(_0x3ea901){if(_0x3ea901){freeIsNotKey(_0x3ea901,_0xcaa468[_0xf6d2('0x2')],'id');for(var _0x306203=0x0,_0xfec6c6={},_0x120121={};_0x306203<_0x3ea901[_0xf6d2('0x6')];_0x306203+=0x1){_0xfec6c6=_0x3ea901[_0x306203];if(_[_0xf6d2('0x7')](_0xcaa468[_0xf6d2('0x2')][_0xfec6c6['id']])){_0xcaa468[_0xf6d2('0x2')][_0xfec6c6['id']]=new MailAccount(_0xfec6c6);}else{_['merge'](_0xcaa468[_0xf6d2('0x2')][_0xfec6c6['id']],_0xfec6c6);}}}return _0xcaa468[_0xf6d2('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb0eb=['isUndefined','merge','exports','lodash','mailAccounts','mapKeys','prototype','hasOwnProperty','initMailAccounts','length'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0xb0eb,0x143));var _0xbb0e=function(_0x59054f,_0x5dfd47){_0x59054f=_0x59054f-0x0;var _0x415fce=_0xb0eb[_0x59054f];return _0x415fce;};'use strict';var _=require(_0xbb0e('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xbb0e('0x1')]={};};function freeIsNotKey(_0x34f608,_0x26ae15,_0x205ceb){var _0x5acbcb=_[_0xbb0e('0x2')](_0x34f608,function(_0x865c8e,_0x4a5b22){return _0x865c8e[_0x205ceb];});for(var _0x5309b8 in _0x26ae15){if(_0x26ae15['hasOwnProperty'](_0x5309b8)){if(!_0x5acbcb[_0x5309b8]){delete _0x26ae15[_0x5309b8];}}}}Realtime[_0xbb0e('0x3')]['mergeFromDatabase']=function(_0x486f06,_0x2b099d){for(var _0x3fecc3 in _0x2b099d){if(_0x486f06[_0xbb0e('0x4')](_0x3fecc3)){_0x486f06[_0x3fecc3]=_0x2b099d[_0x3fecc3];}}};Realtime[_0xbb0e('0x3')][_0xbb0e('0x5')]=function(){var _0x49ff58=this;return function(_0x24823c){if(_0x24823c){freeIsNotKey(_0x24823c,_0x49ff58['mailAccounts'],'id');for(var _0x28301c=0x0,_0x3d1a93={},_0x458595={};_0x28301c<_0x24823c[_0xbb0e('0x6')];_0x28301c+=0x1){_0x3d1a93=_0x24823c[_0x28301c];if(_[_0xbb0e('0x7')](_0x49ff58[_0xbb0e('0x1')][_0x3d1a93['id']])){_0x49ff58[_0xbb0e('0x1')][_0x3d1a93['id']]=new MailAccount(_0x3d1a93);}else{_[_0xbb0e('0x8')](_0x49ff58[_0xbb0e('0x1')][_0x3d1a93['id']],_0x3d1a93);}}}return _0x49ff58['mailAccounts'];};};module[_0xbb0e('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b00cc53..daceaa7 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 _0xb1f7=['email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb1f7,0x19d));var _0x7b1f=function(_0x7882f2,_0x12aaae){_0x7882f2=_0x7882f2-0x0;var _0x1eefbe=_0xb1f7[_0x7882f2];return _0x1eefbe;};'use strict';var client=require(_0x7b1f('0x0'));exports[_0x7b1f('0x1')]=function(){return function(){return client[_0x7b1f('0x2')](_0x7b1f('0x3'),{'options':{'attributes':['id',_0x7b1f('0x4'),_0x7b1f('0x5'),_0x7b1f('0x6'),_0x7b1f('0x7'),_0x7b1f('0x8'),_0x7b1f('0x9'),_0x7b1f('0xa'),_0x7b1f('0xb')],'raw':![],'include':[{'model':_0x7b1f('0xc'),'as':_0x7b1f('0xd'),'include':[{'model':_0x7b1f('0xe'),'attributes':['id',_0x7b1f('0x4'),_0x7b1f('0x6'),_0x7b1f('0xf'),_0x7b1f('0x10')],'as':_0x7b1f('0xe')}]},{'model':_0x7b1f('0x11'),'as':_0x7b1f('0x12'),'include':[{'model':_0x7b1f('0xe'),'attributes':['id','name','service','type',_0x7b1f('0x10')],'as':_0x7b1f('0xe')}]}]},'log':_0x7b1f('0x13')});};};exports['notify']=function(_0x2af42e,_0x33f354){return client[_0x7b1f('0x2')](_0x7b1f('0x14'),{'account':{'id':_0x2af42e},'body':_0x33f354,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xb2b4=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify'];(function(_0x2cc842,_0xd6800d){var _0x24adab=function(_0x41ab67){while(--_0x41ab67){_0x2cc842['push'](_0x2cc842['shift']());}};_0x24adab(++_0xd6800d);}(_0xb2b4,0x141));var _0x4b2b=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0xb2b4[_0x272d90];return _0x2bf4a2;};'use strict';var client=require(_0x4b2b('0x0'));exports[_0x4b2b('0x1')]=function(){return function(){return client[_0x4b2b('0x2')](_0x4b2b('0x3'),{'options':{'attributes':['id',_0x4b2b('0x4'),'provider',_0x4b2b('0x5'),_0x4b2b('0x6'),_0x4b2b('0x7'),_0x4b2b('0x8'),_0x4b2b('0x9'),_0x4b2b('0xa')],'raw':![],'include':[{'model':_0x4b2b('0xb'),'as':_0x4b2b('0xc'),'include':[{'model':_0x4b2b('0xd'),'attributes':['id',_0x4b2b('0x4'),'service',_0x4b2b('0xe'),_0x4b2b('0xf')],'as':_0x4b2b('0xd')}]},{'model':'MailServerOut','as':_0x4b2b('0x10'),'include':[{'model':_0x4b2b('0xd'),'attributes':['id',_0x4b2b('0x4'),_0x4b2b('0x5'),_0x4b2b('0xe'),_0x4b2b('0xf')],'as':'CloudProvider'}]}]},'log':_0x4b2b('0x11')});};};exports[_0x4b2b('0x12')]=function(_0x1cea35,_0xa517f2){return client['Request'](_0x4b2b('0x13'),{'account':{'id':_0x1cea35},'body':_0xa517f2,'log':_0x4b2b('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 9f63c90..3956ba2 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 _0x5037=['Request','ShowSetting','GetSettings'];(function(_0x25af83,_0x49dedd){var _0x2b1902=function(_0x4e7b5a){while(--_0x4e7b5a){_0x25af83['push'](_0x25af83['shift']());}};_0x2b1902(++_0x49dedd);}(_0x5037,0xd2));var _0x7503=function(_0x45f8ef,_0x26fc8d){_0x45f8ef=_0x45f8ef-0x0;var _0x10878a=_0x5037[_0x45f8ef];return _0x10878a;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x7503('0x0')](_0x7503('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x7503('0x2')});}; \ No newline at end of file +var _0xdb6d=['getSettings','ShowSetting','loginMailFrequency','../client'];(function(_0xc9783b,_0x7d3db2){var _0x57b576=function(_0x482abd){while(--_0x482abd){_0xc9783b['push'](_0xc9783b['shift']());}};_0x57b576(++_0x7d3db2);}(_0xdb6d,0x7f));var _0xddb6=function(_0x1d11d7,_0x5e4c2c){_0x1d11d7=_0x1d11d7-0x0;var _0x1c057b=_0xdb6d[_0x1d11d7];return _0x1c057b;};'use strict';var client=require(_0xddb6('0x0'));exports[_0xddb6('0x1')]=function(){return client['Request'](_0xddb6('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xddb6('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 085baac..b056aeb 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 735ea09..e143c61 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 _0xd389=['polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','ioredis','../../config/environment','timeout','listen','port','socket.io','websocket'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd389,0x1ab));var _0x9d38=function(_0x75f855,_0x133595){_0x75f855=_0x75f855-0x0;var _0x4ffb79=_0xd389[_0x75f855];return _0x4ffb79;};'use strict';var _=require(_0x9d38('0x0'));var http=require(_0x9d38('0x1'));var express=require(_0x9d38('0x2'));var sticky=require('sticky-session');var Redis=require(_0x9d38('0x3'));var config=require(_0x9d38('0x4'));var app=express();var server=http['createServer'](app);server[_0x9d38('0x5')]=0xdbba0;if(sticky[_0x9d38('0x6')](server,config[_0x9d38('0x7')])){var socketio=require(_0x9d38('0x8'))(server,{'transports':[_0x9d38('0x9'),_0x9d38('0xa')]});config[_0x9d38('0xb')]=_[_0x9d38('0xc')](config[_0x9d38('0xb')],{'host':'localhost','port':0x18eb});socketio[_0x9d38('0xd')](require(_0x9d38('0xe'))({'pubClient':new Redis(config[_0x9d38('0xb')]),'subClient':new Redis(config[_0x9d38('0xb')])}));require(_0x9d38('0xf'))[_0x9d38('0x10')]();require(_0x9d38('0x11'))[_0x9d38('0x10')](socketio);require(_0x9d38('0x12'))[_0x9d38('0x10')](app);require(_0x9d38('0x13'))[_0x9d38('0x10')](app);}else{server['once'](_0x9d38('0x14'),function(){console[_0x9d38('0x15')](_0x9d38('0x16'),config[_0x9d38('0x7')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x49e3=['websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express','ioredis','createServer','timeout','socket.io'];(function(_0x4d53d0,_0x2ab50e){var _0x84c24=function(_0x5efbb4){while(--_0x5efbb4){_0x4d53d0['push'](_0x4d53d0['shift']());}};_0x84c24(++_0x2ab50e);}(_0x49e3,0x1dd));var _0x349e=function(_0x717e65,_0x5c7caa){_0x717e65=_0x717e65-0x0;var _0x3b7f95=_0x49e3[_0x717e65];return _0x3b7f95;};'use strict';var _=require(_0x349e('0x0'));var http=require(_0x349e('0x1'));var express=require(_0x349e('0x2'));var sticky=require('sticky-session');var Redis=require(_0x349e('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x349e('0x4')](app);server[_0x349e('0x5')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x349e('0x6'))(server,{'transports':[_0x349e('0x7'),'polling']});config['redis']=_[_0x349e('0x8')](config[_0x349e('0x9')],{'host':_0x349e('0xa'),'port':0x18eb});socketio[_0x349e('0xb')](require(_0x349e('0xc'))({'pubClient':new Redis(config[_0x349e('0x9')]),'subClient':new Redis(config[_0x349e('0x9')])}));require(_0x349e('0xd'))[_0x349e('0xe')]();require(_0x349e('0xf'))[_0x349e('0xe')](socketio);require(_0x349e('0x10'))['default'](app);require(_0x349e('0x11'))['default'](app);}else{server[_0x349e('0x12')](_0x349e('0x13'),function(){console['log'](_0x349e('0x14'),config[_0x349e('0x15')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index bdc2ce2..c7643a1 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 _0x8b25=['routing','client','http','Request','request','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x4d16c7,_0x153f0e){var _0x24c82b=function(_0x27f46c){while(--_0x27f46c){_0x4d16c7['push'](_0x4d16c7['shift']());}};_0x24c82b(++_0x153f0e);}(_0x8b25,0x1d9));var _0x58b2=function(_0x1d886b,_0x593cc9){_0x1d886b=_0x1d886b-0x0;var _0x2cee91=_0x8b25[_0x1d886b];return _0x2cee91;};'use strict';var jayson=require(_0x58b2('0x0'));var BPromise=require(_0x58b2('0x1'));var logger=require(_0x58b2('0x2'))(_0x58b2('0x3'));var client=jayson[_0x58b2('0x4')][_0x58b2('0x5')]({'port':0x2329});client[_0x58b2('0x6')]=function(_0x52a15b,_0x4c5684){return new BPromise(function(_0x14a918,_0x2e4613){return client[_0x58b2('0x7')](_0x52a15b,_0x4c5684)['then'](function(_0x5219cf){logger['debug'](_0x58b2('0x8'),_0x58b2('0x3'),_0x52a15b,_0x4c5684,_0x5219cf);if(_0x5219cf[_0x58b2('0x9')]){logger[_0x58b2('0x9')](_0x58b2('0x8'),_0x58b2('0x3'),_0x52a15b,_0x5219cf[_0x58b2('0x9')][_0x58b2('0xa')],_0x4c5684);return _0x2e4613(_0x5219cf[_0x58b2('0x9')][_0x58b2('0xa')]);}else{return _0x14a918(_0x5219cf[_0x58b2('0xb')]);}})[_0x58b2('0xc')](function(_0x17e9bf){logger['error']('rpc',_0x58b2('0x3'),_0x52a15b,_0x17e9bf,_0x4c5684);return _0x2e4613(_0x17e9bf);});});};module[_0x58b2('0xd')]=client; \ No newline at end of file +var _0xfd0e=['../../config/logger','routing','http','Request','request','then','debug','error','rpc','message','result','exports','jayson/promise','bluebird'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0xfd0e,0x1b0));var _0xefd0=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0xfd0e[_0xb6e2ea];return _0x2a57bb;};'use strict';var jayson=require(_0xefd0('0x0'));var BPromise=require(_0xefd0('0x1'));var logger=require(_0xefd0('0x2'))(_0xefd0('0x3'));var client=jayson['client'][_0xefd0('0x4')]({'port':0x2329});client[_0xefd0('0x5')]=function(_0x50102a,_0x2f7edc){return new BPromise(function(_0x965e81,_0x25448a){return client[_0xefd0('0x6')](_0x50102a,_0x2f7edc)[_0xefd0('0x7')](function(_0x3e3306){logger[_0xefd0('0x8')]('rpc',_0xefd0('0x3'),_0x50102a,_0x2f7edc,_0x3e3306);if(_0x3e3306[_0xefd0('0x9')]){logger[_0xefd0('0x9')](_0xefd0('0xa'),'routing',_0x50102a,_0x3e3306['error'][_0xefd0('0xb')],_0x2f7edc);return _0x25448a(_0x3e3306[_0xefd0('0x9')][_0xefd0('0xb')]);}else{return _0x965e81(_0x3e3306[_0xefd0('0xc')]);}})['catch'](function(_0x4e3dfa){logger[_0xefd0('0x9')](_0xefd0('0xa'),'routing',_0x50102a,_0x4e3dfa,_0x2f7edc);return _0x25448a(_0x4e3dfa);});});};module[_0xefd0('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 2315f1e..bf6eb57 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 _0x747d=['./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x1c97c8,_0x28d564){var _0x2c096d=function(_0x1bf3ec){while(--_0x1bf3ec){_0x1c97c8['push'](_0x1c97c8['shift']());}};_0x2c096d(++_0x28d564);}(_0x747d,0x170));var _0xd747=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x747d[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var server=require(_0xd747('0x0'));var Realtime=require(_0xd747('0x1'));var user=require('./rpc/user');var interval=require(_0xd747('0x2'));var openchannelQueue=require(_0xd747('0x3'));var chatQueue=require(_0xd747('0x4'));var smsQueue=require(_0xd747('0x5'));var mailQueue=require(_0xd747('0x6'));var faxQueue=require(_0xd747('0x7'));var whatsappQueue=require(_0xd747('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd747('0x9')]()[_0xd747('0xa')](user[_0xd747('0xb')]())[_0xd747('0xa')](realtime[_0xd747('0xc')]())[_0xd747('0xa')](interval[_0xd747('0xd')]())[_0xd747('0xa')](realtime[_0xd747('0xe')]())[_0xd747('0xa')](openchannelQueue['getOpenchannelQueues']())[_0xd747('0xa')](realtime[_0xd747('0xf')]())[_0xd747('0xa')](chatQueue['getChatQueues']())[_0xd747('0xa')](realtime[_0xd747('0x10')]())['then'](smsQueue[_0xd747('0x11')]())[_0xd747('0xa')](realtime[_0xd747('0x12')]())[_0xd747('0xa')](mailQueue['getMailQueues']())[_0xd747('0xa')](realtime[_0xd747('0x13')]())['then'](faxQueue[_0xd747('0x14')]())[_0xd747('0xa')](realtime[_0xd747('0x15')]())['then'](whatsappQueue[_0xd747('0x16')]())['then'](realtime[_0xd747('0x17')]())[_0xd747('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x4037db){return initRealtime();})[_0xd747('0xa')](function(_0x5b68e2){return setInterval(initRealtime,0x1388);})['catch'](function(_0x569466){console[_0xd747('0x18')](_0x569466);});}main(); \ No newline at end of file +var _0x527b=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getChatQueues','initSmsQueues','initMailQueues','getFaxQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x48af9e,_0x3b30d8){var _0x36eeb9=function(_0x3a3821){while(--_0x3a3821){_0x48af9e['push'](_0x48af9e['shift']());}};_0x36eeb9(++_0x3b30d8);}(_0x527b,0x10c));var _0xb527=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x527b[_0x5de214];return _0x4df627;};'use strict';var BPromise=require(_0xb527('0x0'));var server=require('./server');var Realtime=require(_0xb527('0x1'));var user=require(_0xb527('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xb527('0x3'));var smsQueue=require(_0xb527('0x4'));var mailQueue=require(_0xb527('0x5'));var faxQueue=require(_0xb527('0x6'));var whatsappQueue=require(_0xb527('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xb527('0x8')]()['then'](user[_0xb527('0x9')]())[_0xb527('0xa')](realtime[_0xb527('0xb')]())[_0xb527('0xa')](interval[_0xb527('0xc')]())[_0xb527('0xa')](realtime[_0xb527('0xd')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xb527('0xa')](realtime['initOpenchannelQueues']())[_0xb527('0xa')](chatQueue[_0xb527('0xe')]())[_0xb527('0xa')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0xb527('0xa')](realtime[_0xb527('0xf')]())['then'](mailQueue['getMailQueues']())[_0xb527('0xa')](realtime[_0xb527('0x10')]())[_0xb527('0xa')](faxQueue[_0xb527('0x11')]())[_0xb527('0xa')](realtime['initFaxQueues']())[_0xb527('0xa')](whatsappQueue['getWhatsappQueues']())[_0xb527('0xa')](realtime['initWhatsappQueues']())[_0xb527('0xa')](function(){return realtime;});}function main(){return server[_0xb527('0x12')](realtime)[_0xb527('0xa')](function(_0x232e30){return initRealtime();})[_0xb527('0xa')](function(_0x61502c){return setInterval(initRealtime,0x1388);})[_0xb527('0x13')](function(_0xc2250e){console[_0xb527('0x14')](_0xc2250e);});}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 8c5fc71..dbd7a06 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 _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(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0x326f,0xd1));var _0xf326=function(_0x2a3933,_0x16d3d2){_0x2a3933=_0x2a3933-0x0;var _0x6a4b24=_0x326f[_0x2a3933];return _0x6a4b24;};'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 +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x5c365f,_0x3b40ed){_0x5c365f=_0x5c365f-0x0;var _0x295e1b=_0x1261[_0x5c365f];return _0x295e1b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 4cfed5b..91c4986 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 _0xc221=['result','catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x592694,_0x3b1336){var _0x174315=function(_0xd15dba){while(--_0xd15dba){_0x592694['push'](_0x592694['shift']());}};_0x174315(++_0x3b1336);}(_0xc221,0x71));var _0x1c22=function(_0x32991c,_0x5434e7){_0x32991c=_0x32991c-0x0;var _0x56f2be=_0xc221[_0x32991c];return _0x56f2be;};'use strict';var BPromise=require(_0x1c22('0x0'));var jayson=require(_0x1c22('0x1'));var client=jayson[_0x1c22('0x2')][_0x1c22('0x3')]({'port':0x232b});function request(_0x4de90a,_0x100ea2){return new BPromise(function(_0x1dd500,_0x5017b8){return client[_0x1c22('0x4')](_0x4de90a,_0x100ea2)[_0x1c22('0x5')](function(_0x2995e1){if(_0x2995e1[_0x1c22('0x6')]){return _0x5017b8(_0x2995e1[_0x1c22('0x6')][_0x1c22('0x7')]);}else{return _0x1dd500(_0x2995e1[_0x1c22('0x8')]);}})[_0x1c22('0x9')](function(_0x1e6fa5){return _0x5017b8(_0x1e6fa5);});});}exports[_0x1c22('0xa')]=function(_0x5b5cc6,_0xbf0af3){return request('SendMail',{'account':_0x5b5cc6,'message':_0xbf0af3});}; \ No newline at end of file +var _0x93d5=['then','error','catch','sendMailMessage','SendMail','client','http'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x93d5,0x83));var _0x593d=function(_0x2f3ee8,_0x104b39){_0x2f3ee8=_0x2f3ee8-0x0;var _0x1e9ce0=_0x93d5[_0x2f3ee8];return _0x1e9ce0;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x593d('0x0')][_0x593d('0x1')]({'port':0x232b});function request(_0x336eeb,_0x4951c8){return new BPromise(function(_0x567649,_0x4c09e8){return client['request'](_0x336eeb,_0x4951c8)[_0x593d('0x2')](function(_0x3edfca){if(_0x3edfca[_0x593d('0x3')]){return _0x4c09e8(_0x3edfca[_0x593d('0x3')]['message']);}else{return _0x567649(_0x3edfca['result']);}})[_0x593d('0x4')](function(_0x2045ba){return _0x4c09e8(_0x2045ba);});});}exports[_0x593d('0x5')]=function(_0x55502e,_0x264e29){return request(_0x593d('0x6'),{'account':_0x55502e,'message':_0x264e29});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f9a7d53..b05d29f 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 _0xc465=['openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','mail','chat','openchannel','length','Status','StatusTime','toNumber','format','mailStatus','faxStatus','smsStatusTime','whatsappCurrentCapacity','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime'];(function(_0xab0b32,_0x52d49d){var _0x3532f2=function(_0x2261ac){while(--_0x2261ac){_0xab0b32['push'](_0xab0b32['shift']());}};_0x3532f2(++_0x52d49d);}(_0xc465,0x100));var _0x5c46=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xc465[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x5c46('0x0'));var moment=require(_0x5c46('0x1'));var md5=require(_0x5c46('0x2'));var Redis=require(_0x5c46('0x3'));var config=require(_0x5c46('0x4'));config[_0x5c46('0x5')]=_[_0x5c46('0x6')](config[_0x5c46('0x5')],{'host':_0x5c46('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c46('0x5')]));function Agent(_0x3a4e73){this['id']=_0x3a4e73['id']||0x0;this[_0x5c46('0x8')]=_0x3a4e73[_0x5c46('0x8')]||'';this[_0x5c46('0x9')]=_0x3a4e73[_0x5c46('0x9')]||!![];this[_0x5c46('0xa')]=_0x3a4e73[_0x5c46('0xa')]||![];this['chatPause']=_0x3a4e73[_0x5c46('0xb')]||![];this[_0x5c46('0xc')]=_0x3a4e73[_0x5c46('0xc')]||![];this[_0x5c46('0xd')]=_0x3a4e73[_0x5c46('0xd')]||![];this[_0x5c46('0xe')]=_0x3a4e73[_0x5c46('0xe')]||![];this[_0x5c46('0xf')]=_0x3a4e73[_0x5c46('0xf')]||![];this[_0x5c46('0x10')]=_0x5c46('0x11');this['chatStatusTime']=0x0;this[_0x5c46('0x12')]=_0x3a4e73[_0x5c46('0x12')]||0x0;this[_0x5c46('0x13')]=0x0;this['mailStatus']=_0x5c46('0x11');this[_0x5c46('0x14')]=0x0;this[_0x5c46('0x15')]=_0x3a4e73[_0x5c46('0x15')]||0x0;this[_0x5c46('0x16')]=0x0;this['faxStatus']=_0x5c46('0x11');this[_0x5c46('0x17')]=0x0;this[_0x5c46('0x18')]=_0x3a4e73[_0x5c46('0x18')]||0x0;this[_0x5c46('0x19')]=0x0;this[_0x5c46('0x1a')]=_0x5c46('0x11');this['smsStatusTime']=0x0;this['smsCapacity']=_0x3a4e73[_0x5c46('0x1b')]||0x0;this[_0x5c46('0x1c')]=0x0;this[_0x5c46('0x1d')]='unknown';this[_0x5c46('0x1e')]=0x0;this[_0x5c46('0x1f')]=_0x3a4e73[_0x5c46('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x5c46('0x20')]=_0x5c46('0x11');this[_0x5c46('0x21')]=0x0;this['openchannelCapacity']=_0x3a4e73[_0x5c46('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x5c46('0x23')]=![];this[_0x5c46('0x24')]=undefined;this[_0x5c46('0x2')]='';this[_0x5c46('0x25')]();}Agent[_0x5c46('0x26')][_0x5c46('0x27')]=function(_0x1f2e51){if(this[_0x1f2e51+_0x5c46('0x28')]>0x0){if(this[_0x1f2e51+'Capacity']>0x0&&this[_0x1f2e51+_0x5c46('0x28')]>=this[_0x1f2e51+_0x5c46('0x29')]){return _0x5c46('0x2a');}else{return'working';}}else{return'idle';}};Agent[_0x5c46('0x26')][_0x5c46('0x25')]=function(){var _0x440d72=[_0x5c46('0x2b'),_0x5c46('0x2c'),_0x5c46('0x2d'),'fax','sms','whatsapp'];for(var _0x1e92e5=0x0;_0x1e92e5<_0x440d72[_0x5c46('0x2e')];_0x1e92e5+=0x1){var _0x2f220f=this[_0x5c46('0x27')](_0x440d72[_0x1e92e5]);if(this[_0x440d72[_0x1e92e5]+_0x5c46('0x2f')]!==_0x2f220f){this[_0x440d72[_0x1e92e5]+_0x5c46('0x30')]=_[_0x5c46('0x31')](moment()[_0x5c46('0x32')]('x'));}this[_0x440d72[_0x1e92e5]+_0x5c46('0x2f')]=_0x2f220f;}var _0x11260d={'id':this['id'],'name':this[_0x5c46('0x8')],'online':this[_0x5c46('0x9')],'voicePause':this[_0x5c46('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x5c46('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x5c46('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x5c46('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5c46('0x33')],'mailStatusTime':this[_0x5c46('0x14')],'mailCapacity':this[_0x5c46('0x15')],'mailCurrentCapacity':this[_0x5c46('0x16')],'faxStatus':this[_0x5c46('0x34')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x5c46('0x19')],'smsStatus':this[_0x5c46('0x1a')],'smsStatusTime':this[_0x5c46('0x35')],'smsCapacity':this[_0x5c46('0x1b')],'smsCurrentCapacity':this[_0x5c46('0x1c')],'whatsappStatus':this[_0x5c46('0x1d')],'whatsappStatusTime':this[_0x5c46('0x1e')],'whatsappCapacity':this[_0x5c46('0x1f')],'whatsappCurrentCapacity':this[_0x5c46('0x36')],'openchannelStatus':this[_0x5c46('0x20')],'openchannelStatusTime':this[_0x5c46('0x21')],'openchannelCapacity':this[_0x5c46('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x5c46('0x23')],'busyQueue':this[_0x5c46('0x24')]};var _0x3fb7bf=md5(JSON[_0x5c46('0x37')](_0x11260d));if(this[_0x5c46('0x2')]!==_0x3fb7bf){this[_0x5c46('0x2')]=_0x3fb7bf;io[_0x5c46('0x38')](_0x5c46('0x39'),_0x11260d);}};module['exports']=Agent; \ No newline at end of file +var _0x43b7=['mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','prototype','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','voicePause','smsStatusTime','smsCurrentCapacity','openchannelStatusTime','stringify','md5','emit','exports','lodash','ioredis','redis','defaults','socket.io-emitter','name','online','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity'];(function(_0xeecc25,_0x3814a3){var _0x2df18b=function(_0x1192b4){while(--_0x1192b4){_0xeecc25['push'](_0xeecc25['shift']());}};_0x2df18b(++_0x3814a3);}(_0x43b7,0x183));var _0x743b=function(_0x143ef4,_0x483593){_0x143ef4=_0x143ef4-0x0;var _0x32e266=_0x43b7[_0x143ef4];return _0x32e266;};'use strict';var _=require(_0x743b('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x743b('0x1'));var config=require('../../../config/environment');config[_0x743b('0x2')]=_[_0x743b('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x743b('0x4'))(new Redis(config[_0x743b('0x2')]));function Agent(_0xf029){this['id']=_0xf029['id']||0x0;this[_0x743b('0x5')]=_0xf029[_0x743b('0x5')]||'';this[_0x743b('0x6')]=_0xf029[_0x743b('0x6')]||!![];this['voicePause']=_0xf029['voicePause']||![];this['chatPause']=_0xf029['chatPause']||![];this['mailPause']=_0xf029[_0x743b('0x7')]||![];this[_0x743b('0x8')]=_0xf029['faxPause']||![];this[_0x743b('0x9')]=_0xf029['smsPause']||![];this[_0x743b('0xa')]=_0xf029[_0x743b('0xa')]||![];this[_0x743b('0xb')]=_0x743b('0xc');this[_0x743b('0xd')]=0x0;this[_0x743b('0xe')]=_0xf029[_0x743b('0xe')]||0x0;this[_0x743b('0xf')]=0x0;this[_0x743b('0x10')]=_0x743b('0xc');this[_0x743b('0x11')]=0x0;this['mailCapacity']=_0xf029[_0x743b('0x12')]||0x0;this[_0x743b('0x13')]=0x0;this[_0x743b('0x14')]=_0x743b('0xc');this[_0x743b('0x15')]=0x0;this['faxCapacity']=_0xf029[_0x743b('0x16')]||0x0;this[_0x743b('0x17')]=0x0;this[_0x743b('0x18')]=_0x743b('0xc');this['smsStatusTime']=0x0;this['smsCapacity']=_0xf029[_0x743b('0x19')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x743b('0x1a')]=_0x743b('0xc');this[_0x743b('0x1b')]=0x0;this[_0x743b('0x1c')]=_0xf029[_0x743b('0x1c')]||0x0;this[_0x743b('0x1d')]=0x0;this[_0x743b('0x1e')]=_0x743b('0xc');this['openchannelStatusTime']=0x0;this[_0x743b('0x1f')]=_0xf029['openchannelCapacity']||0x0;this[_0x743b('0x20')]=0x0;this[_0x743b('0x21')]=![];this[_0x743b('0x22')]=undefined;this['md5']='';this[_0x743b('0x23')]();}Agent['prototype'][_0x743b('0x24')]=function(_0x375fd1){if(this[_0x375fd1+'CurrentCapacity']>0x0){if(this[_0x375fd1+_0x743b('0x25')]>0x0&&this[_0x375fd1+_0x743b('0x26')]>=this[_0x375fd1+_0x743b('0x25')]){return _0x743b('0x27');}else{return'working';}}else{return'idle';}};Agent[_0x743b('0x28')][_0x743b('0x23')]=function(){var _0xfacf67=['mail',_0x743b('0x29'),_0x743b('0x2a'),_0x743b('0x2b'),_0x743b('0x2c'),_0x743b('0x2d')];for(var _0x1b8290=0x0;_0x1b8290<_0xfacf67[_0x743b('0x2e')];_0x1b8290+=0x1){var _0x3ef25e=this[_0x743b('0x24')](_0xfacf67[_0x1b8290]);if(this[_0xfacf67[_0x1b8290]+'Status']!==_0x3ef25e){this[_0xfacf67[_0x1b8290]+_0x743b('0x2f')]=_[_0x743b('0x30')](moment()[_0x743b('0x31')]('x'));}this[_0xfacf67[_0x1b8290]+'Status']=_0x3ef25e;}var _0x2f8c31={'id':this['id'],'name':this[_0x743b('0x5')],'online':this[_0x743b('0x6')],'voicePause':this[_0x743b('0x32')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x743b('0x9')],'faxPause':this['faxPause'],'openchannelPause':this[_0x743b('0xa')],'chatStatus':this[_0x743b('0xb')],'chatStatusTime':this[_0x743b('0xd')],'chatCapacity':this[_0x743b('0xe')],'chatCurrentCapacity':this[_0x743b('0xf')],'mailStatus':this[_0x743b('0x10')],'mailStatusTime':this[_0x743b('0x11')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x743b('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x743b('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x743b('0x33')],'smsCapacity':this[_0x743b('0x19')],'smsCurrentCapacity':this[_0x743b('0x34')],'whatsappStatus':this[_0x743b('0x1a')],'whatsappStatusTime':this[_0x743b('0x1b')],'whatsappCapacity':this[_0x743b('0x1c')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x743b('0x35')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x743b('0x22')]};var _0x3310fb=md5(JSON[_0x743b('0x36')](_0x2f8c31));if(this[_0x743b('0x37')]!==_0x3310fb){this[_0x743b('0x37')]=_0x3310fb;io[_0x743b('0x38')]('user:save',_0x2f8c31);}};module[_0x743b('0x39')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 550a83d..a6a6c39 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 _0xa4e1=['Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr','map','length','online','loggedIn','paused','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x5bd14c,_0x46fda7){var _0x53bcbd=function(_0x2afd9d){while(--_0x2afd9d){_0x5bd14c['push'](_0x5bd14c['shift']());}};_0x53bcbd(++_0x46fda7);}(_0xa4e1,0x121));var _0x1a4e=function(_0x4e0bb5,_0x307f58){_0x4e0bb5=_0x4e0bb5-0x0;var _0xc89f95=_0xa4e1[_0x4e0bb5];return _0xc89f95;};'use strict';var _=require(_0x1a4e('0x0'));var md5=require('md5');var util=require(_0x1a4e('0x1'));var Redis=require('ioredis');var config=require(_0x1a4e('0x2'));config[_0x1a4e('0x3')]=_[_0x1a4e('0x4')](config[_0x1a4e('0x3')],{'host':_0x1a4e('0x5'),'port':0x18eb});var io=require(_0x1a4e('0x6'))(new Redis(config[_0x1a4e('0x3')]));function ChatQueue(_0x2e494){this['id']=_0x2e494['id']||0x0;this[_0x1a4e('0x7')]=_0x2e494[_0x1a4e('0x7')]||'';this['timeout']=_0x2e494[_0x1a4e('0x8')]||0xa;this[_0x1a4e('0x9')]=_0x2e494[_0x1a4e('0x9')]||_0x1a4e('0xa');this[_0x1a4e('0xb')]=_0x2e494['Agents'];this[_0x1a4e('0xc')]={};this['waiting']=0x0;this[_0x1a4e('0xd')]='';this['updateRouting']();this[_0x1a4e('0xe')]();}ChatQueue[_0x1a4e('0xf')][_0x1a4e('0x10')]=function(){var _0x17c05d=this['mapAgentsId'][_0x1a4e('0x11')];this[_0x1a4e('0xc')]=_[_0x1a4e('0x12')](this[_0x1a4e('0xb')],'id');this[_0x1a4e('0xc')]['_rr']=_0x17c05d;};ChatQueue[_0x1a4e('0xf')][_0x1a4e('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x6ad27d=0x0;_0x6ad27d=0x0?this[_0x1a4e('0x17')]:0x0;var _0x56eb98={'id':this['id'],'available':this[_0x1a4e('0x17')],'loggedIn':this[_0x1a4e('0x15')],'name':this[_0x1a4e('0x7')],'paused':this[_0x1a4e('0x16')],'waiting':this[_0x1a4e('0x18')]};var _0x49d821=md5(JSON[_0x1a4e('0x19')](_0x56eb98));if(this[_0x1a4e('0xd')]!==_0x49d821){this['md5']=_0x49d821;io['to'](util[_0x1a4e('0x1a')](_0x1a4e('0x1b'),_0x56eb98[_0x1a4e('0x7')]))[_0x1a4e('0x1c')](_0x1a4e('0x1d'),_0x56eb98);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x3be0=['chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length','online','paused','available','format'];(function(_0x5b306a,_0x74687d){var _0x49b59a=function(_0x1e1072){while(--_0x1e1072){_0x5b306a['push'](_0x5b306a['shift']());}};_0x49b59a(++_0x74687d);}(_0x3be0,0x70));var _0x03be=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x3be0[_0x5de532];return _0x4e9192;};'use strict';var _=require(_0x03be('0x0'));var md5=require(_0x03be('0x1'));var util=require('util');var Redis=require(_0x03be('0x2'));var config=require(_0x03be('0x3'));config[_0x03be('0x4')]=_[_0x03be('0x5')](config[_0x03be('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x03be('0x4')]));function ChatQueue(_0x517a23){this['id']=_0x517a23['id']||0x0;this['name']=_0x517a23[_0x03be('0x6')]||'';this[_0x03be('0x7')]=_0x517a23[_0x03be('0x7')]||0xa;this[_0x03be('0x8')]=_0x517a23[_0x03be('0x8')]||'beepall';this[_0x03be('0x9')]=_0x517a23[_0x03be('0x9')];this[_0x03be('0xa')]={};this[_0x03be('0xb')]=0x0;this['md5']='';this[_0x03be('0xc')]();this[_0x03be('0xd')]();}ChatQueue[_0x03be('0xe')][_0x03be('0xc')]=function(){var _0x396568=this[_0x03be('0xa')]['_rr'];this[_0x03be('0xa')]=_[_0x03be('0xf')](this[_0x03be('0x9')],'id');this[_0x03be('0xa')][_0x03be('0x10')]=_0x396568;};ChatQueue[_0x03be('0xe')][_0x03be('0xd')]=function(){this[_0x03be('0x11')]=0x0;this['paused']=0x0;for(var _0x2d6aa8=0x0;_0x2d6aa8=0x0?this[_0x03be('0x15')]:0x0;var _0x37b470={'id':this['id'],'available':this[_0x03be('0x15')],'loggedIn':this[_0x03be('0x11')],'name':this[_0x03be('0x6')],'paused':this[_0x03be('0x14')],'waiting':this[_0x03be('0xb')]};var _0x187209=md5(JSON['stringify'](_0x37b470));if(this[_0x03be('0x1')]!==_0x187209){this[_0x03be('0x1')]=_0x187209;io['to'](util[_0x03be('0x16')](_0x03be('0x17'),_0x37b470[_0x03be('0x6')]))[_0x03be('0x18')](_0x03be('0x19'),_0x37b470);}};module[_0x03be('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1463b7f..31f49f7 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 _0x2347=['Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','paused','length','online','loggedIn','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2347,0xc6));var _0x7234=function(_0x2d7b62,_0x1327df){_0x2d7b62=_0x2d7b62-0x0;var _0x25cef1=_0x2347[_0x2d7b62];return _0x25cef1;};'use strict';var _=require(_0x7234('0x0'));var md5=require(_0x7234('0x1'));var util=require(_0x7234('0x2'));var Redis=require(_0x7234('0x3'));var config=require(_0x7234('0x4'));config['redis']=_['defaults'](config[_0x7234('0x5')],{'host':_0x7234('0x6'),'port':0x18eb});var io=require(_0x7234('0x7'))(new Redis(config[_0x7234('0x5')]));function FaxQueue(_0x49b7e6){this['id']=_0x49b7e6['id']||0x0;this[_0x7234('0x8')]=_0x49b7e6[_0x7234('0x8')]||'';this[_0x7234('0x9')]=_0x49b7e6[_0x7234('0x9')]||0xa;this[_0x7234('0xa')]=_0x49b7e6[_0x7234('0xa')]||_0x7234('0xb');this[_0x7234('0xc')]=_0x49b7e6[_0x7234('0xc')];this[_0x7234('0xd')]={};this['waiting']=0x0;this[_0x7234('0x1')]='';this[_0x7234('0xe')]();this['updateRealtime']();}FaxQueue['prototype'][_0x7234('0xe')]=function(){var _0x315b6c=this['mapAgentsId'][_0x7234('0xf')];this[_0x7234('0xd')]=_[_0x7234('0x10')](this['Agents'],'id');this[_0x7234('0xd')][_0x7234('0xf')]=_0x315b6c;};FaxQueue[_0x7234('0x11')][_0x7234('0x12')]=function(){this['loggedIn']=0x0;this[_0x7234('0x13')]=0x0;for(var _0x200545=0x0;_0x200545=0x0?this[_0x7234('0x17')]:0x0;var _0x4851bc={'id':this['id'],'available':this[_0x7234('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x7234('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0xe46a80=md5(JSON[_0x7234('0x18')](_0x4851bc));if(this[_0x7234('0x1')]!==_0xe46a80){this[_0x7234('0x1')]=_0xe46a80;io['to'](util[_0x7234('0x19')](_0x7234('0x1a'),_0x4851bc[_0x7234('0x8')]))[_0x7234('0x1b')](_0x7234('0x1c'),_0x4851bc);}};module[_0x7234('0x1d')]=FaxQueue; \ No newline at end of file +var _0xa25a=['fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','map','mapAgentsId','loggedIn','paused','length','available','stringify'];(function(_0x55350e,_0x9c8c57){var _0x41e775=function(_0xd4fbff){while(--_0xd4fbff){_0x55350e['push'](_0x55350e['shift']());}};_0x41e775(++_0x9c8c57);}(_0xa25a,0x138));var _0xaa25=function(_0x1d735d,_0x4251c3){_0x1d735d=_0x1d735d-0x0;var _0x252798=_0xa25a[_0x1d735d];return _0x252798;};'use strict';var _=require(_0xaa25('0x0'));var md5=require(_0xaa25('0x1'));var util=require(_0xaa25('0x2'));var Redis=require(_0xaa25('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xaa25('0x4')](config[_0xaa25('0x5')],{'host':_0xaa25('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaa25('0x5')]));function FaxQueue(_0x5aef1e){this['id']=_0x5aef1e['id']||0x0;this[_0xaa25('0x7')]=_0x5aef1e[_0xaa25('0x7')]||'';this['timeout']=_0x5aef1e[_0xaa25('0x8')]||0xa;this[_0xaa25('0x9')]=_0x5aef1e[_0xaa25('0x9')]||_0xaa25('0xa');this['Agents']=_0x5aef1e[_0xaa25('0xb')];this['mapAgentsId']={};this[_0xaa25('0xc')]=0x0;this[_0xaa25('0x1')]='';this[_0xaa25('0xd')]();this[_0xaa25('0xe')]();}FaxQueue[_0xaa25('0xf')][_0xaa25('0xd')]=function(){var _0x94fe28=this['mapAgentsId'][_0xaa25('0x10')];this['mapAgentsId']=_[_0xaa25('0x11')](this[_0xaa25('0xb')],'id');this[_0xaa25('0x12')][_0xaa25('0x10')]=_0x94fe28;};FaxQueue['prototype'][_0xaa25('0xe')]=function(){this[_0xaa25('0x13')]=0x0;this[_0xaa25('0x14')]=0x0;for(var _0x4fe015=0x0;_0x4fe015=0x0?this[_0xaa25('0x16')]:0x0;var _0x48553b={'id':this['id'],'available':this[_0xaa25('0x16')],'loggedIn':this[_0xaa25('0x13')],'name':this[_0xaa25('0x7')],'paused':this[_0xaa25('0x14')],'waiting':this[_0xaa25('0xc')]};var _0x3969fa=md5(JSON[_0xaa25('0x17')](_0x48553b));if(this[_0xaa25('0x1')]!==_0x3969fa){this['md5']=_0x3969fa;io['to'](util['format'](_0xaa25('0x18'),_0x48553b[_0xaa25('0x7')]))[_0xaa25('0x19')](_0xaa25('0x1a'),_0x48553b);}};module[_0xaa25('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b06d9c3..a453a41 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 _0x42cc=['Intervals','exports','name'];(function(_0x245690,_0x3bf938){var _0x3fb9a4=function(_0x3354b3){while(--_0x3354b3){_0x245690['push'](_0x245690['shift']());}};_0x3fb9a4(++_0x3bf938);}(_0x42cc,0x119));var _0xc42c=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x42cc[_0x220afa];return _0x1b79d1;};'use strict';function Interval(_0x100827){this['id']=_0x100827['id']||0x0;this['name']=_0x100827[_0xc42c('0x0')]||'';this[_0xc42c('0x1')]=_0x100827[_0xc42c('0x1')]||{};}module[_0xc42c('0x2')]=Interval; \ No newline at end of file +var _0x94ae=['name','Intervals','exports'];(function(_0x38396e,_0x39b8ad){var _0x1b2fff=function(_0x5e4152){while(--_0x5e4152){_0x38396e['push'](_0x38396e['shift']());}};_0x1b2fff(++_0x39b8ad);}(_0x94ae,0xff));var _0xe94a=function(_0x1bd75a,_0x5ad951){_0x1bd75a=_0x1bd75a-0x0;var _0x4230e5=_0x94ae[_0x1bd75a];return _0x4230e5;};'use strict';function Interval(_0x590f7b){this['id']=_0x590f7b['id']||0x0;this[_0xe94a('0x0')]=_0x590f7b[_0xe94a('0x0')]||'';this[_0xe94a('0x1')]=_0x590f7b['Intervals']||{};}module[_0xe94a('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 1328095..b9a3040 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 _0x8486=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis'];(function(_0x4cab36,_0x27aa8f){var _0x1eca64=function(_0x245753){while(--_0x245753){_0x4cab36['push'](_0x4cab36['shift']());}};_0x1eca64(++_0x27aa8f);}(_0x8486,0x1ad));var _0x6848=function(_0x508095,_0x1c8d7c){_0x508095=_0x508095-0x0;var _0x10f4ac=_0x8486[_0x508095];return _0x10f4ac;};'use strict';var _=require('lodash');var md5=require(_0x6848('0x0'));var util=require(_0x6848('0x1'));var Redis=require(_0x6848('0x2'));var config=require(_0x6848('0x3'));config[_0x6848('0x4')]=_[_0x6848('0x5')](config[_0x6848('0x4')],{'host':_0x6848('0x6'),'port':0x18eb});var io=require(_0x6848('0x7'))(new Redis(config[_0x6848('0x4')]));function MailQueue(_0x3e87b4){this['id']=_0x3e87b4['id']||0x0;this[_0x6848('0x8')]=_0x3e87b4['name']||'';this[_0x6848('0x9')]=_0x3e87b4[_0x6848('0x9')]||0xa;this[_0x6848('0xa')]=_0x3e87b4[_0x6848('0xa')]||_0x6848('0xb');this[_0x6848('0xc')]=_0x3e87b4[_0x6848('0xc')];this[_0x6848('0xd')]={};this[_0x6848('0xe')]=0x0;this['md5']='';this[_0x6848('0xf')]();this[_0x6848('0x10')]();}MailQueue[_0x6848('0x11')][_0x6848('0xf')]=function(){var _0x15ff8c=this['mapAgentsId'][_0x6848('0x12')];this['mapAgentsId']=_[_0x6848('0x13')](this[_0x6848('0xc')],'id');this[_0x6848('0xd')]['_rr']=_0x15ff8c;};MailQueue[_0x6848('0x11')][_0x6848('0x10')]=function(){this[_0x6848('0x14')]=0x0;this[_0x6848('0x15')]=0x0;for(var _0x2626ac=0x0;_0x2626ac=0x0?this[_0x6848('0x19')]:0x0;var _0x5cfb3e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x6848('0x8')],'paused':this[_0x6848('0x15')],'waiting':this['waiting']};var _0x500cef=md5(JSON[_0x6848('0x1a')](_0x5cfb3e));if(this[_0x6848('0x0')]!==_0x500cef){this['md5']=_0x500cef;io['to'](util[_0x6848('0x1b')]('mail:queue:%s',_0x5cfb3e[_0x6848('0x8')]))[_0x6848('0x1c')](_0x6848('0x1d'),_0x5cfb3e);}};module[_0x6848('0x1e')]=MailQueue; \ No newline at end of file +var _0x8e9e=['md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','mailPause','available','format','exports','lodash'];(function(_0x9bb8fd,_0x1a4f7c){var _0x295bb0=function(_0x688b1f){while(--_0x688b1f){_0x9bb8fd['push'](_0x9bb8fd['shift']());}};_0x295bb0(++_0x1a4f7c);}(_0x8e9e,0x176));var _0xe8e9=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x8e9e[_0x11ba46];return _0x1c8c6f;};'use strict';var _=require(_0xe8e9('0x0'));var md5=require(_0xe8e9('0x1'));var util=require(_0xe8e9('0x2'));var Redis=require(_0xe8e9('0x3'));var config=require(_0xe8e9('0x4'));config['redis']=_[_0xe8e9('0x5')](config[_0xe8e9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe8e9('0x7'))(new Redis(config[_0xe8e9('0x6')]));function MailQueue(_0x26274a){this['id']=_0x26274a['id']||0x0;this[_0xe8e9('0x8')]=_0x26274a[_0xe8e9('0x8')]||'';this['timeout']=_0x26274a[_0xe8e9('0x9')]||0xa;this[_0xe8e9('0xa')]=_0x26274a[_0xe8e9('0xa')]||'beepall';this[_0xe8e9('0xb')]=_0x26274a['Agents'];this['mapAgentsId']={};this[_0xe8e9('0xc')]=0x0;this[_0xe8e9('0x1')]='';this[_0xe8e9('0xd')]();this[_0xe8e9('0xe')]();}MailQueue[_0xe8e9('0xf')][_0xe8e9('0xd')]=function(){var _0x1bbc5d=this[_0xe8e9('0x10')]['_rr'];this[_0xe8e9('0x10')]=_['map'](this[_0xe8e9('0xb')],'id');this[_0xe8e9('0x10')][_0xe8e9('0x11')]=_0x1bbc5d;};MailQueue[_0xe8e9('0xf')][_0xe8e9('0xe')]=function(){this[_0xe8e9('0x12')]=0x0;this[_0xe8e9('0x13')]=0x0;for(var _0x3a310f=0x0;_0x3a310f=0x0?this[_0xe8e9('0x16')]:0x0;var _0x16c1e7={'id':this['id'],'available':this[_0xe8e9('0x16')],'loggedIn':this[_0xe8e9('0x12')],'name':this[_0xe8e9('0x8')],'paused':this[_0xe8e9('0x13')],'waiting':this[_0xe8e9('0xc')]};var _0x3c69ab=md5(JSON['stringify'](_0x16c1e7));if(this[_0xe8e9('0x1')]!==_0x3c69ab){this[_0xe8e9('0x1')]=_0x3c69ab;io['to'](util[_0xe8e9('0x17')]('mail:queue:%s',_0x16c1e7[_0xe8e9('0x8')]))['emit']('mail_queue:save',_0x16c1e7);}};module[_0xe8e9('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index dc26ed7..ab1e99b 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 _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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1261,0x144));var _0x1126=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x1261[_0x3d5df9];return _0x50ba39;};'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 +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(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0x2ef3,0xba));var _0x32ef=function(_0xf45974,_0x2a5952){_0xf45974=_0xf45974-0x0;var _0x2db9a2=_0x2ef3[_0xf45974];return _0x2db9a2;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 826a124..6a4953d 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 _0xf9f7=['md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','smsPause','available','paused','format','sms:queue:%s','emit','lodash'];(function(_0x3bad42,_0x3c736d){var _0xa57adf=function(_0x24df89){while(--_0x24df89){_0x3bad42['push'](_0x3bad42['shift']());}};_0xa57adf(++_0x3c736d);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x2f379a,_0x53382d){_0x2f379a=_0x2f379a-0x0;var _0x305249=_0xf9f7[_0x2f379a];return _0x305249;};'use strict';var _=require(_0x7f9f('0x0'));var md5=require(_0x7f9f('0x1'));var util=require(_0x7f9f('0x2'));var Redis=require(_0x7f9f('0x3'));var config=require(_0x7f9f('0x4'));config[_0x7f9f('0x5')]=_['defaults'](config['redis'],{'host':_0x7f9f('0x6'),'port':0x18eb});var io=require(_0x7f9f('0x7'))(new Redis(config[_0x7f9f('0x5')]));function SmsQueue(_0xee790a){this['id']=_0xee790a['id']||0x0;this[_0x7f9f('0x8')]=_0xee790a[_0x7f9f('0x8')]||'';this['timeout']=_0xee790a[_0x7f9f('0x9')]||0xa;this[_0x7f9f('0xa')]=_0xee790a[_0x7f9f('0xa')]||_0x7f9f('0xb');this[_0x7f9f('0xc')]=_0xee790a['Agents'];this[_0x7f9f('0xd')]={};this[_0x7f9f('0xe')]=0x0;this[_0x7f9f('0x1')]='';this[_0x7f9f('0xf')]();this[_0x7f9f('0x10')]();}SmsQueue[_0x7f9f('0x11')][_0x7f9f('0xf')]=function(){var _0x4a2786=this[_0x7f9f('0xd')][_0x7f9f('0x12')];this['mapAgentsId']=_['map'](this[_0x7f9f('0xc')],'id');this['mapAgentsId'][_0x7f9f('0x12')]=_0x4a2786;};SmsQueue[_0x7f9f('0x11')]['updateRealtime']=function(){this[_0x7f9f('0x13')]=0x0;this['paused']=0x0;for(var _0x292470=0x0;_0x292470=0x0?this[_0x7f9f('0x17')]:0x0;var _0x2d663e={'id':this['id'],'available':this[_0x7f9f('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x7f9f('0x8')],'paused':this[_0x7f9f('0x18')],'waiting':this['waiting']};var _0x28621a=md5(JSON['stringify'](_0x2d663e));if(this[_0x7f9f('0x1')]!==_0x28621a){this[_0x7f9f('0x1')]=_0x28621a;io['to'](util[_0x7f9f('0x19')](_0x7f9f('0x1a'),_0x2d663e['name']))[_0x7f9f('0x1b')]('sms_queue:save',_0x2d663e);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x4876=['Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','paused','length','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x371860,_0xed56ad){var _0x508130=function(_0x5e1d93){while(--_0x5e1d93){_0x371860['push'](_0x371860['shift']());}};_0x508130(++_0xed56ad);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x6487('0x0'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6487('0x1')]=_['defaults'](config[_0x6487('0x1')],{'host':_0x6487('0x2'),'port':0x18eb});var io=require(_0x6487('0x3'))(new Redis(config[_0x6487('0x1')]));function SmsQueue(_0x57d99d){this['id']=_0x57d99d['id']||0x0;this[_0x6487('0x4')]=_0x57d99d[_0x6487('0x4')]||'';this['timeout']=_0x57d99d[_0x6487('0x5')]||0xa;this[_0x6487('0x6')]=_0x57d99d[_0x6487('0x6')]||_0x6487('0x7');this[_0x6487('0x8')]=_0x57d99d[_0x6487('0x8')];this[_0x6487('0x9')]={};this[_0x6487('0xa')]=0x0;this[_0x6487('0xb')]='';this['updateRouting']();this[_0x6487('0xc')]();}SmsQueue[_0x6487('0xd')][_0x6487('0xe')]=function(){var _0x2ba8ce=this[_0x6487('0x9')][_0x6487('0xf')];this[_0x6487('0x9')]=_[_0x6487('0x10')](this['Agents'],'id');this[_0x6487('0x9')][_0x6487('0xf')]=_0x2ba8ce;};SmsQueue[_0x6487('0xd')][_0x6487('0xc')]=function(){this['loggedIn']=0x0;this[_0x6487('0x11')]=0x0;for(var _0x10f2e1=0x0;_0x10f2e1=0x0?this['available']:0x0;var _0x4cedf9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6487('0x13')],'name':this[_0x6487('0x4')],'paused':this[_0x6487('0x11')],'waiting':this[_0x6487('0xa')]};var _0x30abdc=md5(JSON[_0x6487('0x16')](_0x4cedf9));if(this[_0x6487('0xb')]!==_0x30abdc){this[_0x6487('0xb')]=_0x30abdc;io['to'](util[_0x6487('0x17')](_0x6487('0x18'),_0x4cedf9[_0x6487('0x4')]))[_0x6487('0x19')](_0x6487('0x1a'),_0x4cedf9);}};module[_0x6487('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index d5c29b7..10ee1fc 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 _0x4bc2=['whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x463c69,_0x2168a6){var _0x1084bd=function(_0x417281){while(--_0x417281){_0x463c69['push'](_0x463c69['shift']());}};_0x1084bd(++_0x2168a6);}(_0x4bc2,0xff));var _0x24bc=function(_0x44a34b,_0x5171f1){_0x44a34b=_0x44a34b-0x0;var _0x421e7e=_0x4bc2[_0x44a34b];return _0x421e7e;};'use strict';var _=require(_0x24bc('0x0'));var md5=require(_0x24bc('0x1'));var util=require(_0x24bc('0x2'));var Redis=require(_0x24bc('0x3'));var config=require(_0x24bc('0x4'));config['redis']=_[_0x24bc('0x5')](config[_0x24bc('0x6')],{'host':_0x24bc('0x7'),'port':0x18eb});var io=require(_0x24bc('0x8'))(new Redis(config[_0x24bc('0x6')]));function WhatsappQueue(_0x5208c5){this['id']=_0x5208c5['id']||0x0;this[_0x24bc('0x9')]=_0x5208c5[_0x24bc('0x9')]||'';this['timeout']=_0x5208c5[_0x24bc('0xa')]||0xa;this[_0x24bc('0xb')]=_0x5208c5[_0x24bc('0xb')]||_0x24bc('0xc');this[_0x24bc('0xd')]=_0x5208c5[_0x24bc('0xd')];this[_0x24bc('0xe')]={};this[_0x24bc('0xf')]=0x0;this[_0x24bc('0x1')]='';this[_0x24bc('0x10')]();this[_0x24bc('0x11')]();}WhatsappQueue[_0x24bc('0x12')][_0x24bc('0x10')]=function(){var _0x8eaed6=this['mapAgentsId'][_0x24bc('0x13')];this[_0x24bc('0xe')]=_[_0x24bc('0x14')](this['Agents'],'id');this[_0x24bc('0xe')][_0x24bc('0x13')]=_0x8eaed6;};WhatsappQueue['prototype'][_0x24bc('0x11')]=function(){this[_0x24bc('0x15')]=0x0;this[_0x24bc('0x16')]=0x0;for(var _0x3d7993=0x0;_0x3d7993=0x0?this['available']:0x0;var _0x2076b2={'id':this['id'],'available':this[_0x24bc('0x19')],'loggedIn':this[_0x24bc('0x15')],'name':this[_0x24bc('0x9')],'paused':this[_0x24bc('0x16')],'waiting':this[_0x24bc('0xf')]};var _0x158894=md5(JSON[_0x24bc('0x1a')](_0x2076b2));if(this[_0x24bc('0x1')]!==_0x158894){this[_0x24bc('0x1')]=_0x158894;io['to'](util['format'](_0x24bc('0x1b'),_0x2076b2[_0x24bc('0x9')]))[_0x24bc('0x1c')](_0x24bc('0x1d'),_0x2076b2);}};module[_0x24bc('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x6b85=['beepall','Agents','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','loggedIn','online','whatsappPause','paused','available','waiting','stringify','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x55ce3d,_0x1ad63f){var _0x2e485f=function(_0x4f6a49){while(--_0x4f6a49){_0x55ce3d['push'](_0x55ce3d['shift']());}};_0x2e485f(++_0x1ad63f);}(_0x6b85,0x65));var _0x56b8=function(_0x22aeb5,_0x5b0296){_0x22aeb5=_0x22aeb5-0x0;var _0x12338b=_0x6b85[_0x22aeb5];return _0x12338b;};'use strict';var _=require(_0x56b8('0x0'));var md5=require(_0x56b8('0x1'));var util=require(_0x56b8('0x2'));var Redis=require(_0x56b8('0x3'));var config=require(_0x56b8('0x4'));config[_0x56b8('0x5')]=_['defaults'](config['redis'],{'host':_0x56b8('0x6'),'port':0x18eb});var io=require(_0x56b8('0x7'))(new Redis(config[_0x56b8('0x5')]));function WhatsappQueue(_0x2fd82c){this['id']=_0x2fd82c['id']||0x0;this[_0x56b8('0x8')]=_0x2fd82c[_0x56b8('0x8')]||'';this[_0x56b8('0x9')]=_0x2fd82c['timeout']||0xa;this[_0x56b8('0xa')]=_0x2fd82c[_0x56b8('0xa')]||_0x56b8('0xb');this['Agents']=_0x2fd82c[_0x56b8('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x56b8('0xd')]();this[_0x56b8('0xe')]();}WhatsappQueue[_0x56b8('0xf')][_0x56b8('0xd')]=function(){var _0x31b24f=this['mapAgentsId'][_0x56b8('0x10')];this['mapAgentsId']=_['map'](this[_0x56b8('0xc')],'id');this[_0x56b8('0x11')][_0x56b8('0x10')]=_0x31b24f;};WhatsappQueue[_0x56b8('0xf')][_0x56b8('0xe')]=function(){this[_0x56b8('0x12')]=0x0;this['paused']=0x0;for(var _0x55d987=0x0;_0x55d987=0x0?this[_0x56b8('0x16')]:0x0;var _0x4f84fb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x56b8('0x12')],'name':this[_0x56b8('0x8')],'paused':this[_0x56b8('0x15')],'waiting':this[_0x56b8('0x17')]};var _0x2f210c=md5(JSON[_0x56b8('0x18')](_0x4f84fb));if(this[_0x56b8('0x1')]!==_0x2f210c){this[_0x56b8('0x1')]=_0x2f210c;io['to'](util['format']('whatsapp:queue:%s',_0x4f84fb[_0x56b8('0x8')]))[_0x56b8('0x19')](_0x56b8('0x1a'),_0x4f84fb);}};module[_0x56b8('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 6faef5b..84e51a4 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(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x2adc30,_0x1c0c4f){var _0x12eba2=function(_0x1a5266){while(--_0x1a5266){_0x2adc30['push'](_0x2adc30['shift']());}};_0x12eba2(++_0x1c0c4f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c70d0,_0xfeac42){_0x5c70d0=_0x5c70d0-0x0;var _0x484491=_0xb10b[_0x5c70d0];return _0x484491;};'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 64ddf58..836df68 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 _0x6bc8=['../client','update','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x179fb3,_0x7d2749){var _0x118482=function(_0x3d4e22){while(--_0x3d4e22){_0x179fb3['push'](_0x179fb3['shift']());}};_0x118482(++_0x7d2749);}(_0x6bc8,0xde));var _0x86bc=function(_0x1337ef,_0x3963f6){_0x1337ef=_0x1337ef-0x0;var _0x532a6d=_0x6bc8[_0x1337ef];return _0x532a6d;};'use strict';var client=require(_0x86bc('0x0'));exports[_0x86bc('0x1')]=function(_0x5a8683,_0x582063){return client['Request']('UpdateChatInteraction',{'body':_0x582063,'options':{'where':{'id':_0x5a8683}},'log':'updateChatInteraction'});};exports[_0x86bc('0x2')]=function(_0x5d0196,_0x39315a){return client[_0x86bc('0x3')](_0x86bc('0x4'),{'body':_0x39315a,'options':{'where':{'id':_0x5d0196}},'log':_0x86bc('0x5')});}; \ No newline at end of file +var _0x0844=['../client','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x0844,0x66));var _0x4084=function(_0x24b137,_0x30191b){_0x24b137=_0x24b137-0x0;var _0x341c34=_0x0844[_0x24b137];return _0x341c34;};'use strict';var client=require(_0x4084('0x0'));exports['update']=function(_0x42ca39,_0x57e584){return client[_0x4084('0x1')](_0x4084('0x2'),{'body':_0x57e584,'options':{'where':{'id':_0x42ca39}},'log':_0x4084('0x3')});};exports['addTags']=function(_0x42112d,_0x343cfd){return client['Request'](_0x4084('0x4'),{'body':_0x343cfd,'options':{'where':{'id':_0x42112d}},'log':_0x4084('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index bcb981f..7e15127 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 _0xcf0c=['createChatMessage','create','Request','CreateChatMessage'];(function(_0x59dfb4,_0x55fa56){var _0x5bec07=function(_0x4fca9d){while(--_0x4fca9d){_0x59dfb4['push'](_0x59dfb4['shift']());}};_0x5bec07(++_0x55fa56);}(_0xcf0c,0x1d1));var _0xccf0=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xcf0c[_0x548627];return _0x844a84;};'use strict';var client=require('../client');exports[_0xccf0('0x0')]=function(_0x575eb7){return client[_0xccf0('0x1')](_0xccf0('0x2'),{'body':_0x575eb7,'log':_0xccf0('0x3')});}; \ No newline at end of file +var _0x23de=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x198e84,_0x407557){var _0x269d12=function(_0x11dd85){while(--_0x11dd85){_0x198e84['push'](_0x198e84['shift']());}};_0x269d12(++_0x407557);}(_0x23de,0x11c));var _0xe23d=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x23de[_0x3ba924];return _0x4cc1df;};'use strict';var client=require(_0xe23d('0x0'));exports[_0xe23d('0x1')]=function(_0x17f1d3){return client[_0xe23d('0x2')](_0xe23d('0x3'),{'body':_0x17f1d3,'log':_0xe23d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 6462b77..b9aa127 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 _0xb3ea=['name','strategy','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x3ae2d0,_0x51d098){var _0x25b291=function(_0x2445b1){while(--_0x2445b1){_0x3ae2d0['push'](_0x3ae2d0['shift']());}};_0x25b291(++_0x51d098);}(_0xb3ea,0x10d));var _0xab3e=function(_0x9abdef,_0x1800ab){_0x9abdef=_0x9abdef-0x0;var _0x3122cb=_0xb3ea[_0x9abdef];return _0x3122cb;};'use strict';var client=require(_0xab3e('0x0'));exports[_0xab3e('0x1')]=function(){return function(){return client[_0xab3e('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xab3e('0x3'),'timeout',_0xab3e('0x4')],'include':[{'model':'User','as':_0xab3e('0x5'),'attributes':['id',_0xab3e('0x3'),_0xab3e('0x6'),_0xab3e('0x7')]}]},'log':_0xab3e('0x1')});};}; \ No newline at end of file +var _0xae1c=['timeout','strategy','User','Agents','online','chatPause','getChatQueues','name'];(function(_0xe1770a,_0x4fc5d6){var _0x3e6274=function(_0x1a016f){while(--_0x1a016f){_0xe1770a['push'](_0xe1770a['shift']());}};_0x3e6274(++_0x4fc5d6);}(_0xae1c,0xff));var _0xcae1=function(_0x354007,_0x4fb097){_0x354007=_0x354007-0x0;var _0x385f9a=_0xae1c[_0x354007];return _0x385f9a;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xcae1('0x0'),_0xcae1('0x1'),_0xcae1('0x2')],'include':[{'model':_0xcae1('0x3'),'as':_0xcae1('0x4'),'attributes':['id',_0xcae1('0x0'),_0xcae1('0x5'),_0xcae1('0x6')]}]},'log':_0xcae1('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 720a125..04d33cd 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 _0xe812=['create','CreateChatQueueReport','update','Request','DESC','UpdateChatQueueReport'];(function(_0x23fdea,_0x11fbd6){var _0x22b2d9=function(_0x894694){while(--_0x894694){_0x23fdea['push'](_0x23fdea['shift']());}};_0x22b2d9(++_0x11fbd6);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports[_0x2e81('0x0')]=function(_0x46bf6b){return client['Request']('CreateChatQueueReport',{'body':_0x46bf6b,'log':_0x2e81('0x1')});};exports[_0x2e81('0x2')]=function(_0x4fac31,_0x466f52){return client[_0x2e81('0x3')]('UpdateChatQueueReport',{'body':_0x466f52,'options':{'where':{'uniqueid':_0x4fac31},'order':[['id',_0x2e81('0x4')]],'limit':0x1},'log':_0x2e81('0x5')});}; \ No newline at end of file +var _0x76a3=['update','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x4ec791,_0x561b09){var _0x46e14e=function(_0x3fe7c9){while(--_0x3fe7c9){_0x4ec791['push'](_0x4ec791['shift']());}};_0x46e14e(++_0x561b09);}(_0x76a3,0xf8));var _0x376a=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x76a3[_0x3e2fcf];return _0x497db7;};'use strict';var client=require(_0x376a('0x0'));exports[_0x376a('0x1')]=function(_0x376352){return client[_0x376a('0x2')](_0x376a('0x3'),{'body':_0x376352,'log':_0x376a('0x3')});};exports[_0x376a('0x4')]=function(_0x433678,_0x8bdd7f){return client[_0x376a('0x2')]('UpdateChatQueueReport',{'body':_0x8bdd7f,'options':{'where':{'uniqueid':_0x433678},'order':[['id','DESC']],'limit':0x1},'log':_0x376a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 19658d4..6026a6d 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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x45aee2,_0x2693b9){_0x45aee2=_0x45aee2-0x0;var _0x2d3c32=_0x7a54[_0x45aee2];return _0x2d3c32;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x7a54,0x106));var _0x47a5=function(_0x548fdd,_0x2434f7){_0x548fdd=_0x548fdd-0x0;var _0x28f6f2=_0x7a54[_0x548fdd];return _0x28f6f2;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 1dda5a1..b3b5ff5 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 _0xb076=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0xf56414,_0xf524f){var _0x44dac9=function(_0x2c1156){while(--_0x2c1156){_0xf56414['push'](_0xf56414['shift']());}};_0x44dac9(++_0xf524f);}(_0xb076,0x118));var _0x6b07=function(_0x168fd3,_0x11fbbd){_0x168fd3=_0x168fd3-0x0;var _0x47f2b7=_0xb076[_0x168fd3];return _0x47f2b7;};'use strict';var client=require('../client');exports[_0x6b07('0x0')]=function(_0x3f0e94){return client[_0x6b07('0x1')](_0x6b07('0x2'),{'body':_0x3f0e94,'log':_0x6b07('0x3')});}; \ No newline at end of file +var _0xcbc2=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcbc2,0x113));var _0x2cbc=function(_0x38e5ee,_0x3cd0cb){_0x38e5ee=_0x38e5ee-0x0;var _0x85812d=_0xcbc2[_0x38e5ee];return _0x85812d;};'use strict';var client=require(_0x2cbc('0x0'));exports[_0x2cbc('0x1')]=function(_0x28a9af){return client[_0x2cbc('0x2')](_0x2cbc('0x3'),{'body':_0x28a9af,'log':_0x2cbc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 598f395..b92a4bf 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 _0xd961=['../client','Request','GetFaxQueue','name','User','Agents','faxPause'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0xd961,0x1e3));var _0x1d96=function(_0x39782f,_0x4aa931){_0x39782f=_0x39782f-0x0;var _0x47768c=_0xd961[_0x39782f];return _0x47768c;};'use strict';var client=require(_0x1d96('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x1d96('0x1')](_0x1d96('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d96('0x3'),'timeout','strategy'],'include':[{'model':_0x1d96('0x4'),'as':_0x1d96('0x5'),'attributes':['id','name','online',_0x1d96('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x1458=['../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User','Agents','online','faxPause'];(function(_0x4566ac,_0x7a4151){var _0x5450dd=function(_0x464d54){while(--_0x464d54){_0x4566ac['push'](_0x4566ac['shift']());}};_0x5450dd(++_0x7a4151);}(_0x1458,0x8c));var _0x8145=function(_0x3f228e,_0x51e3b5){_0x3f228e=_0x3f228e-0x0;var _0x56d89d=_0x1458[_0x3f228e];return _0x56d89d;};'use strict';var client=require(_0x8145('0x0'));exports[_0x8145('0x1')]=function(){return function(){return client[_0x8145('0x2')](_0x8145('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8145('0x4'),_0x8145('0x5')],'include':[{'model':_0x8145('0x6'),'as':_0x8145('0x7'),'attributes':['id','name',_0x8145('0x8'),_0x8145('0x9')]}]},'log':_0x8145('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 06cc0e4..bc4d1c8 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 _0x9fd3=['create','Request','CreateFaxQueueReport','update','DESC','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd3,0x71));var _0x39fd=function(_0x2e5363,_0x1b9df7){_0x2e5363=_0x2e5363-0x0;var _0xa52095=_0x9fd3[_0x2e5363];return _0xa52095;};'use strict';var client=require(_0x39fd('0x0'));exports[_0x39fd('0x1')]=function(_0x33fb5c){return client[_0x39fd('0x2')](_0x39fd('0x3'),{'body':_0x33fb5c,'log':_0x39fd('0x3')});};exports[_0x39fd('0x4')]=function(_0x50cbbf,_0x51b7b9){return client[_0x39fd('0x2')]('UpdateFaxQueueReport',{'body':_0x51b7b9,'options':{'where':{'uniqueid':_0x50cbbf},'order':[['id',_0x39fd('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xa8be=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x1aa72d,_0x4c63a6){var _0x2602f9=function(_0x561600){while(--_0x561600){_0x1aa72d['push'](_0x1aa72d['shift']());}};_0x2602f9(++_0x4c63a6);}(_0xa8be,0x8c));var _0xea8b=function(_0x4d31d0,_0x32966d){_0x4d31d0=_0x4d31d0-0x0;var _0x3567ae=_0xa8be[_0x4d31d0];return _0x3567ae;};'use strict';var client=require(_0xea8b('0x0'));exports[_0xea8b('0x1')]=function(_0x1ee24e){return client[_0xea8b('0x2')](_0xea8b('0x3'),{'body':_0x1ee24e,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x43d59c,_0x45ea16){return client[_0xea8b('0x2')](_0xea8b('0x4'),{'body':_0x45ea16,'options':{'where':{'uniqueid':_0x43d59c},'order':[['id',_0xea8b('0x5')]],'limit':0x1},'log':_0xea8b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index c5b7aeb..88b4aa6 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 _0x4842=['getIntervals','Request','GetInterval','name','Interval','interval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4842,0x67));var _0x2484=function(_0x4739ea,_0x1c1f75){_0x4739ea=_0x4739ea-0x0;var _0x3b2427=_0x4842[_0x4739ea];return _0x3b2427;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x2484('0x0')](_0x2484('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2484('0x2')],'include':[{'model':_0x2484('0x3'),'as':'Intervals','attributes':['id',_0x2484('0x2'),_0x2484('0x4')]}]},'log':_0x2484('0x5')});};}; \ No newline at end of file +var _0xb936=['getIntervals','../client','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x58e6a1,_0x419922){var _0x59431c=function(_0x3f2b58){while(--_0x3f2b58){_0x58e6a1['push'](_0x58e6a1['shift']());}};_0x59431c(++_0x419922);}(_0xb936,0x1b9));var _0x6b93=function(_0x25509d,_0x1ee9d0){_0x25509d=_0x25509d-0x0;var _0x72d366=_0xb936[_0x25509d];return _0x72d366;};'use strict';var client=require(_0x6b93('0x0'));exports['getIntervals']=function(){return function(){return client[_0x6b93('0x1')](_0x6b93('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x6b93('0x3')],'include':[{'model':_0x6b93('0x4'),'as':_0x6b93('0x5'),'attributes':['id','name',_0x6b93('0x6')]}]},'log':_0x6b93('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 74250db..c7e12a4 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 _0xadb5=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update'];(function(_0x8bb086,_0x487530){var _0x3b6943=function(_0x343291){while(--_0x343291){_0x8bb086['push'](_0x8bb086['shift']());}};_0x3b6943(++_0x487530);}(_0xadb5,0xad));var _0x5adb=function(_0x209400,_0x45ae77){_0x209400=_0x209400-0x0;var _0x2d2ef0=_0xadb5[_0x209400];return _0x2d2ef0;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(_0x49fc17,_0x3d6340){return client[_0x5adb('0x1')](_0x5adb('0x2'),{'body':_0x3d6340,'options':{'where':{'id':_0x49fc17}},'log':'updateMailInteraction'});};exports[_0x5adb('0x3')]=function(_0x31457,_0x2e3ef4){return client['Request'](_0x5adb('0x4'),{'body':_0x2e3ef4,'options':{'where':{'id':_0x31457}},'log':_0x5adb('0x5')});}; \ No newline at end of file +var _0xfff0=['addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x501fe6,_0xb74e75){var _0x2262da=function(_0x5e8584){while(--_0x5e8584){_0x501fe6['push'](_0x501fe6['shift']());}};_0x2262da(++_0xb74e75);}(_0xfff0,0x139));var _0x0fff=function(_0x436e5f,_0x1bc211){_0x436e5f=_0x436e5f-0x0;var _0x26314b=_0xfff0[_0x436e5f];return _0x26314b;};'use strict';var client=require('../client');exports[_0x0fff('0x0')]=function(_0x2b95e0,_0x148db8){return client['Request'](_0x0fff('0x1'),{'body':_0x148db8,'options':{'where':{'id':_0x2b95e0}},'log':_0x0fff('0x2')});};exports[_0x0fff('0x3')]=function(_0x4bec60,_0x2cd3d5){return client[_0x0fff('0x4')]('AddTagsToMailInteraction',{'body':_0x2cd3d5,'options':{'where':{'id':_0x4bec60}},'log':_0x0fff('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1388091..7bce3dd 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 _0x35e0=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x26bf69,_0x2a0bcf){var _0x41ab9a=function(_0x2916bc){while(--_0x2916bc){_0x26bf69['push'](_0x26bf69['shift']());}};_0x41ab9a(++_0x2a0bcf);}(_0x35e0,0x10f));var _0x035e=function(_0x53d8a0,_0x32137e){_0x53d8a0=_0x53d8a0-0x0;var _0x560209=_0x35e0[_0x53d8a0];return _0x560209;};'use strict';var client=require(_0x035e('0x0'));exports[_0x035e('0x1')]=function(_0x9cca2b){return client[_0x035e('0x2')](_0x035e('0x3'),{'body':_0x9cca2b,'log':_0x035e('0x4')});}; \ No newline at end of file +var _0x6c62=['Request','CreateMailMessage'];(function(_0x201002,_0x3a7f6b){var _0x1b088d=function(_0x547688){while(--_0x547688){_0x201002['push'](_0x201002['shift']());}};_0x1b088d(++_0x3a7f6b);}(_0x6c62,0xa8));var _0x26c6=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x6c62[_0xd1b4d7];return _0x3002ec;};'use strict';var client=require('../client');exports['create']=function(_0x5a3d36){return client[_0x26c6('0x0')](_0x26c6('0x1'),{'body':_0x5a3d36,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 89b287f..eb5c127 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 _0x55aa=['timeout','User','Agents','online','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x55aa,0x94));var _0xa55a=function(_0x48ff63,_0x10f18a){_0x48ff63=_0x48ff63-0x0;var _0x584924=_0x55aa[_0x48ff63];return _0x584924;};'use strict';var client=require(_0xa55a('0x0'));exports[_0xa55a('0x1')]=function(){return function(){return client[_0xa55a('0x2')](_0xa55a('0x3'),{'options':{'raw':![],'attributes':['id',_0xa55a('0x4'),_0xa55a('0x5'),'strategy'],'include':[{'model':_0xa55a('0x6'),'as':_0xa55a('0x7'),'attributes':['id','name',_0xa55a('0x8'),'mailPause']}]},'log':_0xa55a('0x1')});};}; \ No newline at end of file +var _0xc6d1=['GetMailQueue','name','timeout','strategy','User','online','mailPause','../client','getMailQueues'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xc6d1,0x97));var _0x1c6d=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xc6d1[_0x376b45];return _0x2341b3;};'use strict';var client=require(_0x1c6d('0x0'));exports[_0x1c6d('0x1')]=function(){return function(){return client['Request'](_0x1c6d('0x2'),{'options':{'raw':![],'attributes':['id',_0x1c6d('0x3'),_0x1c6d('0x4'),_0x1c6d('0x5')],'include':[{'model':_0x1c6d('0x6'),'as':'Agents','attributes':['id',_0x1c6d('0x3'),_0x1c6d('0x7'),_0x1c6d('0x8')]}]},'log':_0x1c6d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 8f17264..8b47f85 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 _0x3c2d=['update','DESC','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0xad6bec,_0x3bd539){var _0x1201a7=function(_0xa8e557){while(--_0xa8e557){_0xad6bec['push'](_0xad6bec['shift']());}};_0x1201a7(++_0x3bd539);}(_0x3c2d,0x1b3));var _0xd3c2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3c2d[_0x59ee6f];return _0x4c0979;};'use strict';var client=require('../client');exports[_0xd3c2('0x0')]=function(_0x1d8fdf){return client[_0xd3c2('0x1')](_0xd3c2('0x2'),{'body':_0x1d8fdf,'log':_0xd3c2('0x2')});};exports[_0xd3c2('0x3')]=function(_0x5d4f6e,_0x3fc242){return client['Request']('UpdateMailQueueReport',{'body':_0x3fc242,'options':{'where':{'uniqueid':_0x5d4f6e},'order':[['id',_0xd3c2('0x4')]],'limit':0x1},'log':_0xd3c2('0x5')});}; \ No newline at end of file +var _0xac74=['DESC','../client','create','CreateMailQueueReport','Request','UpdateMailQueueReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xac74,0x133));var _0x4ac7=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xac74[_0x2b8077];return _0x308091;};'use strict';var client=require(_0x4ac7('0x0'));exports[_0x4ac7('0x1')]=function(_0x1f211a){return client['Request'](_0x4ac7('0x2'),{'body':_0x1f211a,'log':_0x4ac7('0x2')});};exports['update']=function(_0x4e496e,_0x64a716){return client[_0x4ac7('0x3')](_0x4ac7('0x4'),{'body':_0x64a716,'options':{'where':{'uniqueid':_0x4e496e},'order':[['id',_0x4ac7('0x5')]],'limit':0x1},'log':_0x4ac7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index a95abde..9e6babc 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 _0x4b75=['Request','AddTagsToOpenchannelInteraction','update','updateOpenchannelInteraction','addTags'];(function(_0x217f17,_0x2a2039){var _0x66991e=function(_0x484039){while(--_0x484039){_0x217f17['push'](_0x217f17['shift']());}};_0x66991e(++_0x2a2039);}(_0x4b75,0x1ab));var _0x54b7=function(_0x126ca8,_0x2fc203){_0x126ca8=_0x126ca8-0x0;var _0x5372a0=_0x4b75[_0x126ca8];return _0x5372a0;};'use strict';var client=require('../client');exports[_0x54b7('0x0')]=function(_0x4b1b7a,_0x399e8d){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x399e8d,'options':{'where':{'id':_0x4b1b7a}},'log':_0x54b7('0x1')});};exports[_0x54b7('0x2')]=function(_0x4a1181,_0x362e8c){return client[_0x54b7('0x3')](_0x54b7('0x4'),{'body':_0x362e8c,'options':{'where':{'id':_0x4a1181}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x53e8=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x20b5ec,_0x535026){var _0x1a4d2f=function(_0x116eb2){while(--_0x116eb2){_0x20b5ec['push'](_0x20b5ec['shift']());}};_0x1a4d2f(++_0x535026);}(_0x53e8,0x17d));var _0x853e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x53e8[_0x1ccdf7];return _0x52a0ae;};'use strict';var client=require(_0x853e('0x0'));exports[_0x853e('0x1')]=function(_0x3f1989,_0x506f42){return client[_0x853e('0x2')](_0x853e('0x3'),{'body':_0x506f42,'options':{'where':{'id':_0x3f1989}},'log':_0x853e('0x4')});};exports[_0x853e('0x5')]=function(_0x4db684,_0x403e8d){return client[_0x853e('0x2')](_0x853e('0x6'),{'body':_0x403e8d,'options':{'where':{'id':_0x4db684}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 1dbb9dc..b513151 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 _0x4cac=['Request','createOpenchannelMessage','create'];(function(_0xedba19,_0x4faa98){var _0x298a7f=function(_0x1dac1e){while(--_0x1dac1e){_0xedba19['push'](_0xedba19['shift']());}};_0x298a7f(++_0x4faa98);}(_0x4cac,0xe3));var _0xc4ca=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4cac[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0xc4ca('0x0')]=function(_0x45b1f6){return client[_0xc4ca('0x1')]('CreateOpenchannelMessage',{'body':_0x45b1f6,'log':_0xc4ca('0x2')});}; \ No newline at end of file +var _0xa842=['createOpenchannelMessage','../client','create','CreateOpenchannelMessage'];(function(_0x34a6e9,_0x25cabe){var _0x11015c=function(_0x5c2ced){while(--_0x5c2ced){_0x34a6e9['push'](_0x34a6e9['shift']());}};_0x11015c(++_0x25cabe);}(_0xa842,0x1a1));var _0x2a84=function(_0x31be2d,_0x2f918a){_0x31be2d=_0x31be2d-0x0;var _0x5080eb=_0xa842[_0x31be2d];return _0x5080eb;};'use strict';var client=require(_0x2a84('0x0'));exports[_0x2a84('0x1')]=function(_0x1d4136){return client['Request'](_0x2a84('0x2'),{'body':_0x1d4136,'log':_0x2a84('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index a37cf05..1b24c3b 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 _0x3408=['Request','GetOpenchannelQueue','User','Agents','name','getOpenchannelQueues','../client'];(function(_0x353d5e,_0x5ec150){var _0x13279a=function(_0x25ed4c){while(--_0x25ed4c){_0x353d5e['push'](_0x353d5e['shift']());}};_0x13279a(++_0x5ec150);}(_0x3408,0x15d));var _0x8340=function(_0x2275dc,_0x14bc66){_0x2275dc=_0x2275dc-0x0;var _0x687922=_0x3408[_0x2275dc];return _0x687922;};'use strict';var client=require(_0x8340('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x8340('0x1')](_0x8340('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x8340('0x3'),'as':_0x8340('0x4'),'attributes':['id',_0x8340('0x5'),'online','openchannelPause']}]},'log':_0x8340('0x6')});};}; \ No newline at end of file +var _0x05e6=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','openchannelPause','../client'];(function(_0x212e9b,_0x2f64fa){var _0x49fccc=function(_0x2429e4){while(--_0x2429e4){_0x212e9b['push'](_0x212e9b['shift']());}};_0x49fccc(++_0x2f64fa);}(_0x05e6,0x1af));var _0x605e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x05e6[_0x5b561d];return _0x431060;};'use strict';var client=require(_0x605e('0x0'));exports[_0x605e('0x1')]=function(){return function(){return client[_0x605e('0x2')](_0x605e('0x3'),{'options':{'raw':![],'attributes':['id',_0x605e('0x4'),_0x605e('0x5'),_0x605e('0x6')],'include':[{'model':_0x605e('0x7'),'as':'Agents','attributes':['id',_0x605e('0x4'),'online',_0x605e('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 3fd518f..0818f6d 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 _0x74cf=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x25a4a1,_0x20ac34){var _0x522016=function(_0x5bd2c9){while(--_0x5bd2c9){_0x25a4a1['push'](_0x25a4a1['shift']());}};_0x522016(++_0x20ac34);}(_0x74cf,0x126));var _0xf74c=function(_0x576297,_0xf0286a){_0x576297=_0x576297-0x0;var _0x4e8e98=_0x74cf[_0x576297];return _0x4e8e98;};'use strict';var client=require(_0xf74c('0x0'));exports[_0xf74c('0x1')]=function(_0xbe2c33){return client[_0xf74c('0x2')](_0xf74c('0x3'),{'body':_0xbe2c33,'log':_0xf74c('0x3')});};exports[_0xf74c('0x4')]=function(_0x5774a8,_0x1bce1e){return client[_0xf74c('0x2')](_0xf74c('0x5'),{'body':_0x1bce1e,'options':{'where':{'uniqueid':_0x5774a8},'order':[['id',_0xf74c('0x6')]],'limit':0x1},'log':_0xf74c('0x5')});}; \ No newline at end of file +var _0x1806=['update','UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport'];(function(_0x4e0ab8,_0x401afb){var _0x4c1f40=function(_0x7f95ef){while(--_0x7f95ef){_0x4e0ab8['push'](_0x4e0ab8['shift']());}};_0x4c1f40(++_0x401afb);}(_0x1806,0x8f));var _0x6180=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1806[_0x3b380d];return _0x54502b;};'use strict';var client=require('../client');exports[_0x6180('0x0')]=function(_0x4d83db){return client['Request'](_0x6180('0x1'),{'body':_0x4d83db,'log':_0x6180('0x1')});};exports[_0x6180('0x2')]=function(_0x485d41,_0x5af5ab){return client['Request'](_0x6180('0x3'),{'body':_0x5af5ab,'options':{'where':{'uniqueid':_0x485d41},'order':[['id',_0x6180('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9c3c058..ac80946 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 _0x2d17=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update'];(function(_0xc7939b,_0xecf1fe){var _0x249cb2=function(_0x5a0661){while(--_0x5a0661){_0xc7939b['push'](_0xc7939b['shift']());}};_0x249cb2(++_0xecf1fe);}(_0x2d17,0x17e));var _0x72d1=function(_0x29f63e,_0x64b23f){_0x29f63e=_0x29f63e-0x0;var _0x3c5629=_0x2d17[_0x29f63e];return _0x3c5629;};'use strict';var client=require(_0x72d1('0x0'));exports[_0x72d1('0x1')]=function(_0x52078d,_0x12f23c){return client[_0x72d1('0x2')]('UpdateSmsInteraction',{'body':_0x12f23c,'options':{'where':{'id':_0x52078d}},'log':_0x72d1('0x3')});};exports[_0x72d1('0x4')]=function(_0x55b722,_0x1dd6d8){return client['Request'](_0x72d1('0x5'),{'body':_0x1dd6d8,'options':{'where':{'id':_0x55b722}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xd0bb=['addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x5b147a,_0x4cacdb){var _0x50cfca=function(_0x1a9e25){while(--_0x1a9e25){_0x5b147a['push'](_0x5b147a['shift']());}};_0x50cfca(++_0x4cacdb);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0xe4ee1e,_0xea8b9b){_0xe4ee1e=_0xe4ee1e-0x0;var _0x22f903=_0xd0bb[_0xe4ee1e];return _0x22f903;};'use strict';var client=require(_0xbd0b('0x0'));exports[_0xbd0b('0x1')]=function(_0x43bfb8,_0x5793c9){return client[_0xbd0b('0x2')]('UpdateSmsInteraction',{'body':_0x5793c9,'options':{'where':{'id':_0x43bfb8}},'log':_0xbd0b('0x3')});};exports[_0xbd0b('0x4')]=function(_0x53e6ce,_0x432acf){return client['Request'](_0xbd0b('0x5'),{'body':_0x432acf,'options':{'where':{'id':_0x53e6ce}},'log':_0xbd0b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index a7256aa..b732de1 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 _0xa793=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x45b58d,_0x43e5ae){var _0x5061dd=function(_0xc0ab76){while(--_0xc0ab76){_0x45b58d['push'](_0x45b58d['shift']());}};_0x5061dd(++_0x43e5ae);}(_0xa793,0x18b));var _0x3a79=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xa793[_0x8af54b];return _0x27d8f0;};'use strict';var client=require(_0x3a79('0x0'));exports[_0x3a79('0x1')]=function(_0x139e9e){return client[_0x3a79('0x2')](_0x3a79('0x3'),{'body':_0x139e9e,'log':_0x3a79('0x4')});}; \ No newline at end of file +var _0x0fdb=['../client','Request','createSmsMessage'];(function(_0x449864,_0x49b5a2){var _0x406fff=function(_0x2dcdb3){while(--_0x2dcdb3){_0x449864['push'](_0x449864['shift']());}};_0x406fff(++_0x49b5a2);}(_0x0fdb,0x1e3));var _0xb0fd=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x0fdb[_0x1ebeea];return _0x576465;};'use strict';var client=require(_0xb0fd('0x0'));exports['create']=function(_0x507d5e){return client[_0xb0fd('0x1')]('CreateSmsMessage',{'body':_0x507d5e,'log':_0xb0fd('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index c5d5aae..e521eba 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(_0x4b0bbb,_0x19f57c){var _0x5f489e=function(_0x1c3248){while(--_0x1c3248){_0x4b0bbb['push'](_0x4b0bbb['shift']());}};_0x5f489e(++_0x19f57c);}(_0x70e0,0x17b));var _0x070e=function(_0x3fbcae,_0xf363ca){_0x3fbcae=_0x3fbcae-0x0;var _0xc0ac10=_0x70e0[_0x3fbcae];return _0xc0ac10;};'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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x335ff7,_0x3853e4){var _0x38637c=function(_0x1628f9){while(--_0x1628f9){_0x335ff7['push'](_0x335ff7['shift']());}};_0x38637c(++_0x3853e4);}(_0x70e0,0x17b));var _0x070e=function(_0x28c4d4,_0x572299){_0x28c4d4=_0x28c4d4-0x0;var _0x1f4b52=_0x70e0[_0x28c4d4];return _0x1f4b52;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 06e318c..0216a21 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x29a7e1,_0x48c971){var _0x366d5a=function(_0x5daa){while(--_0x5daa){_0x29a7e1['push'](_0x29a7e1['shift']());}};_0x366d5a(++_0x48c971);}(_0x55ca,0x126));var _0xa55c=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0x55ca[_0x27def7];return _0x581cbc;};'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 +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x45048e,_0xa62eea){var _0x575af4=function(_0x42c257){while(--_0x42c257){_0x45048e['push'](_0x45048e['shift']());}};_0x575af4(++_0xa62eea);}(_0x3e74,0x175));var _0x43e7=function(_0x37cfd2,_0x4cbc61){_0x37cfd2=_0x37cfd2-0x0;var _0x46027e=_0x3e74[_0x37cfd2];return _0x46027e;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index ad83dc5..c4b9dc6 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(_0x4326f6,_0x37ee58){var _0x3352ed=function(_0x2e68ea){while(--_0x2e68ea){_0x4326f6['push'](_0x4326f6['shift']());}};_0x3352ed(++_0x37ee58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x1912fd,_0x2ec304){var _0x573fc4=function(_0x2950a7){while(--_0x2950a7){_0x1912fd['push'](_0x1912fd['shift']());}};_0x573fc4(++_0x2ec304);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 e750a65..4e41958 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 _0x4c60=['addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','Request','AddTagsToWhatsappInteraction'];(function(_0x289150,_0x3aff1e){var _0x521828=function(_0x38eb5d){while(--_0x38eb5d){_0x289150['push'](_0x289150['shift']());}};_0x521828(++_0x3aff1e);}(_0x4c60,0xc1));var _0x04c6=function(_0x30dd74,_0x365f1a){_0x30dd74=_0x30dd74-0x0;var _0x1e2b12=_0x4c60[_0x30dd74];return _0x1e2b12;};'use strict';var client=require(_0x04c6('0x0'));exports[_0x04c6('0x1')]=function(_0x1d5492,_0x782829){return client['Request'](_0x04c6('0x2'),{'body':_0x782829,'options':{'where':{'id':_0x1d5492}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x4ad4f1,_0x53ca7a){return client[_0x04c6('0x3')](_0x04c6('0x4'),{'body':_0x53ca7a,'options':{'where':{'id':_0x4ad4f1}},'log':_0x04c6('0x5')});}; \ No newline at end of file +var _0xb4b6=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x2e121c,_0x29b897){var _0x4055ef=function(_0x55ac72){while(--_0x55ac72){_0x2e121c['push'](_0x2e121c['shift']());}};_0x4055ef(++_0x29b897);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x54c55c,_0x138b2b){_0x54c55c=_0x54c55c-0x0;var _0x28c537=_0xb4b6[_0x54c55c];return _0x28c537;};'use strict';var client=require('../client');exports[_0x6b4b('0x0')]=function(_0x475f60,_0x1ee7bf){return client[_0x6b4b('0x1')](_0x6b4b('0x2'),{'body':_0x1ee7bf,'options':{'where':{'id':_0x475f60}},'log':_0x6b4b('0x3')});};exports[_0x6b4b('0x4')]=function(_0xff2737,_0x422b21){return client['Request'](_0x6b4b('0x5'),{'body':_0x422b21,'options':{'where':{'id':_0xff2737}},'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 c598d08..7e718d0 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 _0xe4d4=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0xe4d4,0x80));var _0x4e4d=function(_0x263f7a,_0xed2f86){_0x263f7a=_0x263f7a-0x0;var _0x50e7b9=_0xe4d4[_0x263f7a];return _0x50e7b9;};'use strict';var client=require(_0x4e4d('0x0'));exports[_0x4e4d('0x1')]=function(_0xab5ff2){return client[_0x4e4d('0x2')](_0x4e4d('0x3'),{'body':_0xab5ff2,'log':_0x4e4d('0x4')});}; \ No newline at end of file +var _0xb18b=['../client','create','Request','CreateWhatsappMessage'];(function(_0x14ffe8,_0x4c2f13){var _0x4a4d2a=function(_0x254f85){while(--_0x254f85){_0x14ffe8['push'](_0x14ffe8['shift']());}};_0x4a4d2a(++_0x4c2f13);}(_0xb18b,0x1b4));var _0xbb18=function(_0x5585c3,_0x21920c){_0x5585c3=_0x5585c3-0x0;var _0x435d7d=_0xb18b[_0x5585c3];return _0x435d7d;};'use strict';var client=require(_0xbb18('0x0'));exports[_0xbb18('0x1')]=function(_0x598e82){return client[_0xbb18('0x2')](_0xbb18('0x3'),{'body':_0x598e82,'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 511c70c..3b77966 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 _0x4f16=['name','strategy','Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x45319d,_0x5a0653){var _0x20f076=function(_0x3da82c){while(--_0x3da82c){_0x45319d['push'](_0x45319d['shift']());}};_0x20f076(++_0x5a0653);}(_0x4f16,0x194));var _0x64f1=function(_0x4e322c,_0x4c95b3){_0x4e322c=_0x4e322c-0x0;var _0x358af7=_0x4f16[_0x4e322c];return _0x358af7;};'use strict';var client=require(_0x64f1('0x0'));exports[_0x64f1('0x1')]=function(){return function(){return client[_0x64f1('0x2')](_0x64f1('0x3'),{'options':{'raw':![],'attributes':['id',_0x64f1('0x4'),'timeout',_0x64f1('0x5')],'include':[{'model':'User','as':_0x64f1('0x6'),'attributes':['id',_0x64f1('0x4'),'online',_0x64f1('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xd61a=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','name'];(function(_0xd10b43,_0x440ec1){var _0x369090=function(_0x5ae495){while(--_0x5ae495){_0xd10b43['push'](_0xd10b43['shift']());}};_0x369090(++_0x440ec1);}(_0xd61a,0x12e));var _0xad61=function(_0x36433c,_0x4fcfe5){_0x36433c=_0x36433c-0x0;var _0x1aa57d=_0xd61a[_0x36433c];return _0x1aa57d;};'use strict';var client=require(_0xad61('0x0'));exports[_0xad61('0x1')]=function(){return function(){return client[_0xad61('0x2')](_0xad61('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xad61('0x4'),_0xad61('0x5')],'include':[{'model':_0xad61('0x6'),'as':'Agents','attributes':['id',_0xad61('0x7'),_0xad61('0x8'),_0xad61('0x9')]}]},'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 0c4f2ce..0435f6e 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 _0x5478=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x35de8e,_0x23bbf5){var _0x597ed7=function(_0xb831a8){while(--_0xb831a8){_0x35de8e['push'](_0x35de8e['shift']());}};_0x597ed7(++_0x23bbf5);}(_0x5478,0x83));var _0x8547=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x5478[_0x4fc80b];return _0x119dba;};'use strict';var client=require(_0x8547('0x0'));exports[_0x8547('0x1')]=function(_0x804662){return client[_0x8547('0x2')](_0x8547('0x3'),{'body':_0x804662,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x1620ce,_0x237c65){return client[_0x8547('0x2')](_0x8547('0x4'),{'body':_0x237c65,'options':{'where':{'uniqueid':_0x1620ce},'order':[['id',_0x8547('0x5')]],'limit':0x1},'log':_0x8547('0x4')});}; \ No newline at end of file +var _0xb316=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x2c6b0e,_0x1d2623){var _0x56cab6=function(_0x2225f8){while(--_0x2225f8){_0x2c6b0e['push'](_0x2c6b0e['shift']());}};_0x56cab6(++_0x1d2623);}(_0xb316,0x1cf));var _0x6b31=function(_0x1ca1bc,_0x346d4e){_0x1ca1bc=_0x1ca1bc-0x0;var _0x3dbf90=_0xb316[_0x1ca1bc];return _0x3dbf90;};'use strict';var client=require(_0x6b31('0x0'));exports[_0x6b31('0x1')]=function(_0x44cc26){return client[_0x6b31('0x2')](_0x6b31('0x3'),{'body':_0x44cc26,'log':_0x6b31('0x3')});};exports[_0x6b31('0x4')]=function(_0x394494,_0x4b8d07){return client['Request'](_0x6b31('0x5'),{'body':_0x4b8d07,'options':{'where':{'uniqueid':_0x394494},'order':[['id','DESC']],'limit':0x1},'log':_0x6b31('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 d5c12c1..f0d52b8 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 _0xb706=['find','agents','timeout','createQueue','channel','rules','end','info','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop'];(function(_0x168447,_0x3825d0){var _0x18ee99=function(_0xdb1c72){while(--_0xdb1c72){_0x168447['push'](_0x168447['shift']());}};_0x18ee99(++_0x3825d0);}(_0xb706,0x1eb));var _0x6b70=function(_0x8e1e2e,_0x2e8df4){_0x8e1e2e=_0x8e1e2e-0x0;var _0x26c6b6=_0xb706[_0x8e1e2e];return _0x26c6b6;};'use strict';var schema=require(_0x6b70('0x0'));var _=require('lodash');var util=require(_0x6b70('0x1'));var seqqueue=require(_0x6b70('0x2'));var logger=require(_0x6b70('0x3'))(_0x6b70('0x4'));var strategy=require(_0x6b70('0x5'));var queue=schema({'name':{'type':_0x6b70('0x6'),'required':!![],'message':_0x6b70('0x7')},'timeout':{'type':_0x6b70('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x958686,_0x105b00,_0x11a1b5){return logger['info'](util[_0x6b70('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x958686,_0x105b00[_0x6b70('0xa')],_0x11a1b5));}function handleFindAgent(_0xcf7b1e){return function(_0x45d9a5){return _0x45d9a5['name']['toLowerCase']()===_0xcf7b1e[_0x6b70('0xb')]();};}exports[_0x6b70('0xc')]=function(_0x47debf,_0x536c77,_0x4818ff,_0x79eefe){return function(_0x2c2e3e){try{var _0x583225={'name':_0x536c77[0x0],'timeout':_0x536c77[0x1]};var _0x11c13a=queue[_0x6b70('0x0')](_0x583225,{'typecast':!![]});if(_0x11c13a[_0x6b70('0xd')]){logger['error'](_0x6b70('0xe'),_0x47debf,_[_0x6b70('0xf')](_0x11c13a,_0x6b70('0x10'))[_0x6b70('0x11')](',\x20'));_0x2c2e3e[_0x6b70('0x12')]();}else{var _0x3ec24c=_[_0x6b70('0x13')](_0x4818ff[_0x6b70('0x14')],handleFindAgent(_0x583225[_0x6b70('0xa')]));if(_0x3ec24c){var _0x1ae79d=(_0x583225[_0x6b70('0x15')]||0xa)*0x3e8;var _0x5e2f4e,_0x2886cb;var _0x522edd=seqqueue[_0x6b70('0x16')](_0x1ae79d);_0x522edd['id']=_0x47debf;_0x522edd['atimeout']=_0x1ae79d;_0x522edd[_0x6b70('0x17')]=_0x79eefe['channel'];writeLog(_0x47debf,_0x3ec24c,util['format']('START:%s',_0x1ae79d));_0x4818ff[_0x6b70('0x18')][_0x47debf]['on'](_0x6b70('0x19'),function(){logger[_0x6b70('0x1a')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x47debf);clearTimeout(_0x2886cb);_0x2886cb=undefined;_0x522edd[_0x6b70('0x1b')]();if(_0x4818ff[_0x6b70('0x18')][_0x47debf]){delete _0x4818ff[_0x6b70('0x18')][_0x47debf];}_0x2c2e3e['stop']();});_0x4818ff[_0x6b70('0x18')][_0x47debf]['on']('complete',function(){if(_0x4818ff[_0x6b70('0x18')][_0x47debf]){delete _0x4818ff[_0x6b70('0x18')][_0x47debf];}});_0x2886cb=setTimeout(function(){logger['info'](_0x6b70('0x1c'),_0x47debf);clearTimeout(_0x2886cb);_0x522edd[_0x6b70('0x1b')]();_0x2c2e3e[_0x6b70('0x1d')]();},_0x1ae79d);strategy[_0x6b70('0x1e')](_0x522edd,_0x3ec24c,_0x4818ff,_0x79eefe);}else{logger[_0x6b70('0x1f')](_0x6b70('0x20'),_0x47debf,_0x583225[_0x6b70('0xa')]);_0x2c2e3e['stop']();}}}catch(_0x56475e){console['log'](_0x56475e);logger['error'](_0x6b70('0x21'),_0x47debf,_0x56475e['stack']);_0x2c2e3e[_0x6b70('0x12')]();}};}; \ No newline at end of file +var _0x8be8=['next','agent','[%s][QUEUE]\x20%s','stack','util','seq-queue','../../../../config/logger','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','stop','find','agents','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close'];(function(_0x2909a8,_0x1a5ac2){var _0x4e2568=function(_0xe98f7e){while(--_0xe98f7e){_0x2909a8['push'](_0x2909a8['shift']());}};_0x4e2568(++_0x1a5ac2);}(_0x8be8,0x1c4));var _0x88be=function(_0x23e614,_0x29311b){_0x23e614=_0x23e614-0x0;var _0x49ca7a=_0x8be8[_0x23e614];return _0x49ca7a;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x88be('0x0'));var seqqueue=require(_0x88be('0x1'));var logger=require(_0x88be('0x2'))('routing');var strategy=require(_0x88be('0x3'));var queue=schema({'name':{'type':_0x88be('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x88be('0x5')}});function writeLog(_0x59a221,_0x3de4c2,_0x320ead){return logger[_0x88be('0x6')](util[_0x88be('0x7')](_0x88be('0x8'),_0x59a221,_0x3de4c2['name'],_0x320ead));}function handleFindAgent(_0x134c25){return function(_0x52644a){return _0x52644a[_0x88be('0x9')][_0x88be('0xa')]()===_0x134c25[_0x88be('0xa')]();};}exports[_0x88be('0xb')]=function(_0x1cbfe3,_0x751cef,_0xfd6605,_0x200dc6){return function(_0x99e835){try{var _0x368ad6={'name':_0x751cef[0x0],'timeout':_0x751cef[0x1]};var _0x3cda2c=queue[_0x88be('0xc')](_0x368ad6,{'typecast':!![]});if(_0x3cda2c[_0x88be('0xd')]){logger[_0x88be('0xe')](_0x88be('0xf'),_0x1cbfe3,_['map'](_0x3cda2c,'message')['join'](',\x20'));_0x99e835[_0x88be('0x10')]();}else{var _0x20e4f3=_[_0x88be('0x11')](_0xfd6605[_0x88be('0x12')],handleFindAgent(_0x368ad6[_0x88be('0x9')]));if(_0x20e4f3){var _0x3d004a=(_0x368ad6['timeout']||0xa)*0x3e8;var _0x10922e,_0x1922d0;var _0x4a9448=seqqueue[_0x88be('0x13')](_0x3d004a);_0x4a9448['id']=_0x1cbfe3;_0x4a9448[_0x88be('0x14')]=_0x3d004a;_0x4a9448[_0x88be('0x15')]=_0x200dc6[_0x88be('0x15')];writeLog(_0x1cbfe3,_0x20e4f3,util['format']('START:%s',_0x3d004a));_0xfd6605['rules'][_0x1cbfe3]['on'](_0x88be('0x16'),function(){logger[_0x88be('0x6')](_0x88be('0x17'),_0x1cbfe3);clearTimeout(_0x1922d0);_0x1922d0=undefined;_0x4a9448['close']();if(_0xfd6605['rules'][_0x1cbfe3]){delete _0xfd6605[_0x88be('0x18')][_0x1cbfe3];}_0x99e835[_0x88be('0x10')]();});_0xfd6605[_0x88be('0x18')][_0x1cbfe3]['on'](_0x88be('0x19'),function(){if(_0xfd6605[_0x88be('0x18')][_0x1cbfe3]){delete _0xfd6605[_0x88be('0x18')][_0x1cbfe3];}});_0x1922d0=setTimeout(function(){logger[_0x88be('0x6')](_0x88be('0x1a'),_0x1cbfe3);clearTimeout(_0x1922d0);_0x4a9448[_0x88be('0x1b')]();_0x99e835[_0x88be('0x1c')]();},_0x3d004a);strategy[_0x88be('0x1d')](_0x4a9448,_0x20e4f3,_0xfd6605,_0x200dc6);}else{logger[_0x88be('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1cbfe3,_0x368ad6[_0x88be('0x9')]);_0x99e835['stop']();}}}catch(_0x1d643c){console['log'](_0x1d643c);logger[_0x88be('0xe')](_0x88be('0x1e'),_0x1cbfe3,_0x1d643c[_0x88be('0x1f')]);_0x99e835[_0x88be('0x10')]();}};}; \ 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 3378445..f185a98 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 _0x3ef3=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','info','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','stringify','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils'];(function(_0x31108e,_0xca45dd){var _0x518147=function(_0x1a5fbf){while(--_0x1a5fbf){_0x31108e['push'](_0x31108e['shift']());}};_0x518147(++_0xca45dd);}(_0x3ef3,0x1ac));var _0x33ef=function(_0x141fa1,_0x530636){_0x141fa1=_0x141fa1-0x0;var _0x1200ed=_0x3ef3[_0x141fa1];return _0x1200ed;};'use strict';var _=require(_0x33ef('0x0'));var moment=require(_0x33ef('0x1'));var AWS=require(_0x33ef('0x2'));var utils=require(_0x33ef('0x3'));var logger=require(_0x33ef('0x4'))(_0x33ef('0x5'));var rpc={'chatMessage':require(_0x33ef('0x6')),'openchannelMessage':require(_0x33ef('0x7')),'mailMessage':require(_0x33ef('0x8')),'smsMessage':require(_0x33ef('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x33ef('0xa')]=function(_0x593e58,_0x3c600c){return function(_0x12c9a1){try{if(!_[_0x33ef('0xb')](this[_0x33ef('0xc')][_0x33ef('0xd')])){logger['info'](_0x33ef('0xe'),_0x593e58,_0x33ef('0xf'));return _0x12c9a1[_0x33ef('0x10')]();}var _0x31ebe6={'ContactId':this[_0x33ef('0x11')]['id'],'sentAt':moment()[_0x33ef('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x33ef('0x13')};if(this['channel']===_0x33ef('0x14')||this['channel']===_0x33ef('0x15')){_0x31ebe6[_0x33ef('0x16')]=this['interaction']['phone'];}var _0x1197f4=this[_0x33ef('0x17')];if(_0x1197f4===_0x33ef('0x18')){_0x31ebe6[_0x33ef('0x19')]=this['account']['id'];}else{_0x31ebe6[_[_0x33ef('0x1a')](_0x1197f4)+_0x33ef('0x1b')]=this[_0x33ef('0x1c')]['id'];}_0x31ebe6[_[_0x33ef('0x1a')](_0x1197f4)+_0x33ef('0x1d')]=this[_0x33ef('0xc')]['id'];if(this[_0x33ef('0xc')][_0x33ef('0x1e')]){var _0x333eff=_0x3c600c[0x4];if(!_[_0x33ef('0x1f')](_0x333eff)){_0x31ebe6[_0x33ef('0x20')]=utils[_0x33ef('0x21')](_0x333eff,this);return rpc[_0x1197f4+'Message'][_0x33ef('0x22')](_0x31ebe6)[_0x33ef('0x23')](function(_0x33408c){logger[_0x33ef('0x24')](_0x33ef('0xe'),_0x593e58,_0x31ebe6[_0x33ef('0x20')]);})[_0x33ef('0x25')](function(_0x43f0d3){logger[_0x33ef('0x26')]('[%s][AMAZONLEX]\x20%s',_0x593e58,JSON['stringify'](_0x43f0d3));})[_0x33ef('0x27')](function(){logger[_0x33ef('0x24')](_0x33ef('0x28'),_0x593e58);_0x12c9a1[_0x33ef('0x29')]();});}else{logger[_0x33ef('0x24')](_0x33ef('0x2a'),_0x593e58);_0x12c9a1[_0x33ef('0x29')]();}}else{var _0x2dc607=this;var _0x1b3f4d=new AWS[(_0x33ef('0x2b'))]({'accessKeyId':_0x3c600c[0x0],'secretAccessKey':_0x3c600c[0x1],'region':_0x3c600c[0x2]});var _0x16cb5f={'botAlias':_0x33ef('0x2c'),'botName':_0x3c600c[0x3],'inputText':this[_0x33ef('0x2d')][_0x33ef('0x20')],'userId':this[_0x33ef('0x17')]+':'+this[_0x33ef('0xc')]['id'][_0x33ef('0x2e')]()};_0x1b3f4d[_0x33ef('0x2f')](_0x16cb5f,function(_0x33cbe8,_0x3951b5){if(_0x33cbe8){logger[_0x33ef('0x26')](_0x33ef('0xe'),_0x593e58,_0x33cbe8['message']);_0x12c9a1[_0x33ef('0x10')]();}else if(_0x3951b5&&_0x3951b5[_0x33ef('0x2d')]){_0x2dc607[_0x33ef('0x20')][_0x33ef('0x30')]=_0x3951b5;_0x31ebe6[_0x33ef('0x20')]=_0x3951b5[_0x33ef('0x2d')];_0x31ebe6[_0x33ef('0x31')]='amazonlex';_0x31ebe6['providerResponse']=JSON[_0x33ef('0x32')](_0x3951b5);return rpc[_0x1197f4+_0x33ef('0x33')][_0x33ef('0x22')](_0x31ebe6)[_0x33ef('0x23')](function(_0x12dd0f){logger[_0x33ef('0x24')](_0x33ef('0xe'),_0x593e58,_0x31ebe6[_0x33ef('0x20')]);if(_0x3951b5[_0x33ef('0x34')]==_0x33ef('0x35')){_0x12c9a1['next']();}else{_0x12c9a1[_0x33ef('0x29')]();}})['catch'](function(_0x51205a){logger[_0x33ef('0x26')]('[%s][AMAZONLEX]\x20%s',_0x593e58,JSON[_0x33ef('0x32')](_0x51205a));_0x12c9a1['next']();});}else{_0x12c9a1['next']();}});}}catch(_0x218857){logger[_0x33ef('0x26')](_0x33ef('0xe'),_0x593e58,JSON['stringify'](_0x218857));_0x12c9a1[_0x33ef('0x29')]();}};}; \ No newline at end of file +var _0xd755=['body','Message','create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty'];(function(_0xc7d149,_0x30b514){var _0x5442f4=function(_0x3d2841){while(--_0x3d2841){_0xc7d149['push'](_0xc7d149['shift']());}};_0x5442f4(++_0x30b514);}(_0xd755,0x109));var _0x5d75=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xd755[_0x3fa37f];return _0x5a01d5;};'use strict';var _=require(_0x5d75('0x0'));var moment=require(_0x5d75('0x1'));var AWS=require(_0x5d75('0x2'));var utils=require(_0x5d75('0x3'));var logger=require('../../../../config/logger')(_0x5d75('0x4'));var rpc={'chatMessage':require(_0x5d75('0x5')),'openchannelMessage':require(_0x5d75('0x6')),'mailMessage':require(_0x5d75('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5d75('0x8')),'whatsappMessage':require(_0x5d75('0x9'))};exports[_0x5d75('0xa')]=function(_0x28bcfc,_0x734a59){return function(_0x3ab586){try{if(!_['isNil'](this[_0x5d75('0xb')]['UserId'])){logger[_0x5d75('0xc')](_0x5d75('0xd'),_0x28bcfc,_0x5d75('0xe'));return _0x3ab586[_0x5d75('0xf')]();}var _0x576c78={'ContactId':this[_0x5d75('0x10')]['id'],'sentAt':moment()[_0x5d75('0x11')](_0x5d75('0x12')),'direction':_0x5d75('0x13')};if(this[_0x5d75('0x14')]===_0x5d75('0x15')||this[_0x5d75('0x14')]==='whatsapp'){_0x576c78['phone']=this[_0x5d75('0xb')]['phone'];}var _0x393b2d=this[_0x5d75('0x14')];if(_0x393b2d===_0x5d75('0x16')){_0x576c78[_0x5d75('0x17')]=this[_0x5d75('0x18')]['id'];}else{_0x576c78[_[_0x5d75('0x19')](_0x393b2d)+_0x5d75('0x1a')]=this[_0x5d75('0x18')]['id'];}_0x576c78[_['upperFirst'](_0x393b2d)+'InteractionId']=this[_0x5d75('0xb')]['id'];if(this[_0x5d75('0xb')][_0x5d75('0x1b')]){var _0x184ea0=_0x734a59[0x4];if(!_[_0x5d75('0x1c')](_0x184ea0)){_0x576c78[_0x5d75('0x1d')]=utils['getMustacheRender'](_0x184ea0,this);return rpc[_0x393b2d+_0x5d75('0x1e')][_0x5d75('0x1f')](_0x576c78)[_0x5d75('0x20')](function(_0x5f3678){logger[_0x5d75('0xc')](_0x5d75('0xd'),_0x28bcfc,_0x576c78[_0x5d75('0x1d')]);})[_0x5d75('0x21')](function(_0x3a9d31){logger[_0x5d75('0x22')](_0x5d75('0xd'),_0x28bcfc,JSON['stringify'](_0x3a9d31));})[_0x5d75('0x23')](function(){logger[_0x5d75('0xc')](_0x5d75('0x24'),_0x28bcfc);_0x3ab586[_0x5d75('0x25')]();});}else{logger[_0x5d75('0xc')](_0x5d75('0x26'),_0x28bcfc);_0x3ab586['stop']();}}else{var _0x35a8a4=this;var _0x58d962=new AWS['LexRuntime']({'accessKeyId':_0x734a59[0x0],'secretAccessKey':_0x734a59[0x1],'region':_0x734a59[0x2]});var _0x1dd1ed={'botAlias':_0x5d75('0x27'),'botName':_0x734a59[0x3],'inputText':this[_0x5d75('0x28')][_0x5d75('0x1d')],'userId':this[_0x5d75('0x14')]+':'+this[_0x5d75('0xb')]['id'][_0x5d75('0x29')]()};_0x58d962[_0x5d75('0x2a')](_0x1dd1ed,function(_0x3199a1,_0x4ab953){if(_0x3199a1){logger[_0x5d75('0x22')](_0x5d75('0xd'),_0x28bcfc,_0x3199a1[_0x5d75('0x28')]);_0x3ab586['next']();}else if(_0x4ab953&&_0x4ab953[_0x5d75('0x28')]){_0x35a8a4['body'][_0x5d75('0x2b')]=_0x4ab953;_0x576c78[_0x5d75('0x1d')]=_0x4ab953[_0x5d75('0x28')];_0x576c78[_0x5d75('0x2c')]=_0x5d75('0x2b');_0x576c78[_0x5d75('0x2d')]=JSON[_0x5d75('0x2e')](_0x4ab953);return rpc[_0x393b2d+'Message']['create'](_0x576c78)[_0x5d75('0x20')](function(_0x455925){logger['info']('[%s][AMAZONLEX]\x20%s',_0x28bcfc,_0x576c78[_0x5d75('0x1d')]);if(_0x4ab953[_0x5d75('0x2f')]==_0x5d75('0x30')){_0x3ab586[_0x5d75('0xf')]();}else{_0x3ab586[_0x5d75('0x25')]();}})['catch'](function(_0x254075){logger[_0x5d75('0x22')](_0x5d75('0xd'),_0x28bcfc,JSON[_0x5d75('0x2e')](_0x254075));_0x3ab586[_0x5d75('0xf')]();});}else{_0x3ab586[_0x5d75('0xf')]();}});}}catch(_0x436a43){logger['error'](_0x5d75('0xd'),_0x28bcfc,JSON[_0x5d75('0x2e')](_0x436a43));_0x3ab586[_0x5d75('0x25')]();}};}; \ 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 7d761b2..307aaa2 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 _0x74ce=['Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','messageId','html','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','then','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','create','finally','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId'];(function(_0x44c44b,_0x57e40d){var _0xb29ca8=function(_0x1fea49){while(--_0x1fea49){_0x44c44b['push'](_0x44c44b['shift']());}};_0xb29ca8(++_0x57e40d);}(_0x74ce,0x102));var _0xe74c=function(_0x314b0d,_0x26cb50){_0x314b0d=_0x314b0d-0x0;var _0x27d919=_0x74ce[_0x314b0d];return _0x27d919;};'use strict';var _=require(_0xe74c('0x0'));var moment=require('moment');var utils=require(_0xe74c('0x1'));var logger=require(_0xe74c('0x2'))(_0xe74c('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe74c('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe74c('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xe74c('0x6')),'smsInteraction':require(_0xe74c('0x7')),'faxInteraction':require(_0xe74c('0x8')),'whatsappInteraction':require(_0xe74c('0x9'))};var mailRpc=require(_0xe74c('0xa'));exports[_0xe74c('0xb')]=function(_0x597d60,_0x37f826,_0x32de7c,_0x2e43fc){return function(_0x45fbd1){try{var _0x401dbd=this[_0xe74c('0xc')];if(_0x401dbd===_0xe74c('0xd')&&_0x2e43fc['body'][_0xe74c('0xe')]){logger[_0xe74c('0xf')](_0xe74c('0x10'),_0x597d60,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x45fbd1[_0xe74c('0x11')]();}if(_0x37f826[0x0]==='1'&&(_[_0xe74c('0x12')](this[_0xe74c('0x13')]['created'])||!this['interaction'][_0xe74c('0x14')])){logger[_0xe74c('0xf')](_0xe74c('0x10'),_0x597d60,'Autoreply\x20already\x20sent');return _0x45fbd1[_0xe74c('0x11')]();}if(_0x37f826[0x0]==='2'&&this['interaction'][_0xe74c('0x15')]){logger[_0xe74c('0xf')](_0xe74c('0x16'),_0x597d60,'One\x20Time\x20already\x20sent');return _0x45fbd1[_0xe74c('0x11')]();}var _0x5748a8={'ContactId':this[_0xe74c('0x17')]['id'],'sentAt':moment()['format'](_0xe74c('0x18')),'direction':_0xe74c('0x19')};if(this[_0xe74c('0xc')]===_0xe74c('0xd')){_0x5748a8['body']=utils['getMustacheRender'](_0x37f826[0x2],this);}else{_0x5748a8[_0xe74c('0x1a')]=utils[_0xe74c('0x1b')](_0x37f826[0x1],this);}if(this['message']){_0x5748a8['to']=this[_0xe74c('0x1c')][_0xe74c('0x1d')]||'';if(this['channel']===_0xe74c('0xd')&&_0x37f826[0x1]==='1'){_0x5748a8['cc']=this[_0xe74c('0x1c')]['cc']||'';}_0x5748a8[_0xe74c('0x1d')]=this['message']['to']||'';_0x5748a8[_0xe74c('0x1e')]=this['message']['phone']||'';_0x5748a8[_0xe74c('0x1f')]=!![];if(this[_0xe74c('0x1c')][_0xe74c('0x20')]){_0x5748a8[_0xe74c('0x20')]='';_0x5748a8['subject']+=_[_0xe74c('0x21')](this[_0xe74c('0x1c')][_0xe74c('0x20')],_0xe74c('0x22'))?'':_0xe74c('0x23');_0x5748a8[_0xe74c('0x20')]+=this['message'][_0xe74c('0x20')];}}if(this[_0xe74c('0xc')]===_0xe74c('0x24')){_0x5748a8[_0xe74c('0x25')]=this[_0xe74c('0x26')]['id'];}else{_0x5748a8[_['upperFirst'](this['channel'])+_0xe74c('0x27')]=this[_0xe74c('0x26')]['id'];}_0x5748a8[_[_0xe74c('0x28')](this[_0xe74c('0xc')])+_0xe74c('0x29')]=this[_0xe74c('0x13')]['id'];var _0xa683fa=this['interaction'];if(rpc[this[_0xe74c('0xc')]+'Message']){if(this[_0xe74c('0xc')]===_0xe74c('0xd')){var _0x1c25c8={'tls':{'rejectUnauthorized':![]}};if(this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2b')]){_0x1c25c8[_0xe74c('0x2b')]=this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2b')];}else{_0x1c25c8[_0xe74c('0x2c')]=this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2c')];_0x1c25c8[_0xe74c('0x2d')]=this[_0xe74c('0x26')][_0xe74c('0x2a')]['port'];_0x1c25c8[_0xe74c('0x2e')]=this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2e')];}if(this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x2f')]){_0x1c25c8[_0xe74c('0x30')]={'user':this[_0xe74c('0x26')][_0xe74c('0x2a')][_0xe74c('0x31')],'pass':this[_0xe74c('0x26')][_0xe74c('0x2a')]['pass']};}_0x5748a8[_0xe74c('0x32')]=this[_0xe74c('0x1c')][_0xe74c('0x33')];_0x5748a8[_0xe74c('0x34')]=''+_[_0xe74c('0x35')](_0x5748a8[_0xe74c('0x1a')],_0xe74c('0x36'),_0xe74c('0x37'))+_0xe74c('0x38');_0x5748a8[_0xe74c('0x39')]={'Auto-Submitted':_0xe74c('0x3a'),'X-Auto-Response-Suppress':_0xe74c('0x3b'),'Precedence':_0xe74c('0x3c')};return mailRpc[_0xe74c('0x3d')](_0x1c25c8,_0x5748a8)['then'](function(_0x578809){logger[_0xe74c('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x597d60);_0x5748a8[_0xe74c('0x33')]=_0x578809[_0xe74c('0x1c')][_0xe74c('0x33')];return rpc[_0x401dbd+'Message']['create'](_0x5748a8);})['then'](function(_0x10bc93){logger['info']('[%s][AUTOREPLY]\x20%s',_0x597d60,JSON[_0xe74c('0x3e')](_0x10bc93));})[_0xe74c('0x3f')](function(_0x4621ab){logger[_0xe74c('0x40')](_0xe74c('0x41'),_0x597d60,JSON[_0xe74c('0x3e')](_0x4621ab));})['finally'](function(){Promise[_0xe74c('0x42')]()['then'](function(){if(_0x37f826[0x0]!=='2'||_0xa683fa[_0xe74c('0x15')])return;return rpc[_0x401dbd+_0xe74c('0x43')][_0xe74c('0x44')](_0xa683fa['id'],{'autoreplyExecuted':!![]})[_0xe74c('0x45')](function(_0x4b97ae){logger[_0xe74c('0xf')](_0xe74c('0x16'),_0x597d60,JSON[_0xe74c('0x3e')](_0x4b97ae));})[_0xe74c('0x3f')](function(_0x5c76de){logger['error'](_0xe74c('0x46'),_0x597d60,JSON[_0xe74c('0x3e')](_0x5c76de));});})['then'](function(){_0x45fbd1['next']();});});}else{return rpc[this[_0xe74c('0xc')]+_0xe74c('0x47')][_0xe74c('0x48')](_0x5748a8)[_0xe74c('0x45')](function(_0x40c9e0){logger['info'](_0xe74c('0x10'),_0x597d60,_0x5748a8['body']);})[_0xe74c('0x3f')](function(_0x33e95f){logger['error'](_0xe74c('0x10'),_0x597d60,JSON[_0xe74c('0x3e')](_0x33e95f));})[_0xe74c('0x49')](function(){Promise[_0xe74c('0x42')]()[_0xe74c('0x45')](function(){if(_0x37f826[0x0]!=='2'||_0xa683fa[_0xe74c('0x15')])return;return rpc[_0x401dbd+'Interaction'][_0xe74c('0x44')](_0xa683fa['id'],{'autoreplyExecuted':!![]})[_0xe74c('0x45')](function(_0x380872){logger[_0xe74c('0xf')](_0xe74c('0x16'),_0x597d60,JSON['stringify'](_0x380872));})['catch'](function(_0x334f69){logger[_0xe74c('0x40')](_0xe74c('0x46'),_0x597d60,JSON[_0xe74c('0x3e')](_0x334f69));});})['then'](function(){_0x45fbd1[_0xe74c('0x11')]();});});}}}catch(_0x236f32){logger[_0xe74c('0x40')]('[%s][AUTOREPLY]\x20%s',_0x597d60,JSON['stringify'](_0x236f32));_0x45fbd1[_0xe74c('0x4a')]();}};}; \ No newline at end of file +var _0xcfcd=['from','phone','read','subject','startsWith','ChatWebsiteId','account','upperFirst','AccountId','service','Smtp','host','port','secure','authentication','auth','inReplyTo','messageId','html','','replace','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','stop','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','consequence','channel','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','interaction','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','mail'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xcfcd,0x132));var _0xdcfc=function(_0x419423,_0x2acd18){_0x419423=_0x419423-0x0;var _0x4ba5b1=_0xcfcd[_0x419423];return _0x4ba5b1;};'use strict';var _=require('lodash');var moment=require(_0xdcfc('0x0'));var utils=require(_0xdcfc('0x1'));var logger=require(_0xdcfc('0x2'))('routing');var rpc={'chatMessage':require(_0xdcfc('0x3')),'openchannelMessage':require(_0xdcfc('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdcfc('0x5')),'whatsappMessage':require(_0xdcfc('0x6')),'chatInteraction':require(_0xdcfc('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xdcfc('0x8')),'smsInteraction':require(_0xdcfc('0x9')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xdcfc('0xa')]=function(_0x5ddce8,_0x2c9651,_0xe358d9,_0x356fbb){return function(_0x397e07){try{var _0x12a602=this[_0xdcfc('0xb')];if(_0x12a602==='mail'&&_0x356fbb[_0xdcfc('0xc')]['isAutoreply']){logger[_0xdcfc('0xd')](_0xdcfc('0xe'),_0x5ddce8,_0xdcfc('0xf'));return _0x397e07['next']();}if(_0x2c9651[0x0]==='1'&&(_[_0xdcfc('0x10')](this['interaction'][_0xdcfc('0x11')])||!this[_0xdcfc('0x12')][_0xdcfc('0x11')])){logger[_0xdcfc('0xd')](_0xdcfc('0xe'),_0x5ddce8,_0xdcfc('0x13'));return _0x397e07[_0xdcfc('0x14')]();}if(_0x2c9651[0x0]==='2'&&this['interaction'][_0xdcfc('0x15')]){logger[_0xdcfc('0xd')](_0xdcfc('0x16'),_0x5ddce8,'One\x20Time\x20already\x20sent');return _0x397e07['next']();}var _0x5209e0={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdcfc('0x17')](_0xdcfc('0x18')),'direction':_0xdcfc('0x19')};if(this['channel']==='mail'){_0x5209e0[_0xdcfc('0xc')]=utils['getMustacheRender'](_0x2c9651[0x2],this);}else{_0x5209e0[_0xdcfc('0xc')]=utils[_0xdcfc('0x1a')](_0x2c9651[0x1],this);}if(this[_0xdcfc('0x1b')]){_0x5209e0['to']=this[_0xdcfc('0x1b')]['from']||'';if(this[_0xdcfc('0xb')]===_0xdcfc('0x1c')&&_0x2c9651[0x1]==='1'){_0x5209e0['cc']=this['message']['cc']||'';}_0x5209e0[_0xdcfc('0x1d')]=this['message']['to']||'';_0x5209e0[_0xdcfc('0x1e')]=this[_0xdcfc('0x1b')][_0xdcfc('0x1e')]||'';_0x5209e0[_0xdcfc('0x1f')]=!![];if(this[_0xdcfc('0x1b')][_0xdcfc('0x20')]){_0x5209e0[_0xdcfc('0x20')]='';_0x5209e0['subject']+=_[_0xdcfc('0x21')](this[_0xdcfc('0x1b')][_0xdcfc('0x20')],'Re:')?'':'Re:\x20';_0x5209e0[_0xdcfc('0x20')]+=this[_0xdcfc('0x1b')][_0xdcfc('0x20')];}}if(this[_0xdcfc('0xb')]==='chat'){_0x5209e0[_0xdcfc('0x22')]=this[_0xdcfc('0x23')]['id'];}else{_0x5209e0[_[_0xdcfc('0x24')](this[_0xdcfc('0xb')])+_0xdcfc('0x25')]=this[_0xdcfc('0x23')]['id'];}_0x5209e0[_[_0xdcfc('0x24')](this[_0xdcfc('0xb')])+'InteractionId']=this[_0xdcfc('0x12')]['id'];var _0x5c9817=this['interaction'];if(rpc[this[_0xdcfc('0xb')]+'Message']){if(this[_0xdcfc('0xb')]===_0xdcfc('0x1c')){var _0x5abe98={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp'][_0xdcfc('0x26')]){_0x5abe98[_0xdcfc('0x26')]=this[_0xdcfc('0x23')][_0xdcfc('0x27')][_0xdcfc('0x26')];}else{_0x5abe98[_0xdcfc('0x28')]=this[_0xdcfc('0x23')]['Smtp'][_0xdcfc('0x28')];_0x5abe98['port']=this[_0xdcfc('0x23')][_0xdcfc('0x27')][_0xdcfc('0x29')];_0x5abe98[_0xdcfc('0x2a')]=this['account'][_0xdcfc('0x27')][_0xdcfc('0x2a')];}if(this[_0xdcfc('0x23')][_0xdcfc('0x27')][_0xdcfc('0x2b')]){_0x5abe98[_0xdcfc('0x2c')]={'user':this[_0xdcfc('0x23')][_0xdcfc('0x27')]['user'],'pass':this[_0xdcfc('0x23')][_0xdcfc('0x27')]['pass']};}_0x5209e0[_0xdcfc('0x2d')]=this['message'][_0xdcfc('0x2e')];_0x5209e0[_0xdcfc('0x2f')]=_0xdcfc('0x30')+_[_0xdcfc('0x31')](_0x5209e0['body'],'';_0x5209e0[_0xdcfc('0x32')]={'Auto-Submitted':_0xdcfc('0x33'),'X-Auto-Response-Suppress':_0xdcfc('0x34'),'Precedence':_0xdcfc('0x35')};return mailRpc[_0xdcfc('0x36')](_0x5abe98,_0x5209e0)[_0xdcfc('0x37')](function(_0x3c4eb6){logger[_0xdcfc('0xd')](_0xdcfc('0x38'),_0x5ddce8);_0x5209e0[_0xdcfc('0x2e')]=_0x3c4eb6[_0xdcfc('0x1b')][_0xdcfc('0x2e')];return rpc[_0x12a602+'Message']['create'](_0x5209e0);})['then'](function(_0xb8ec04){logger[_0xdcfc('0xd')](_0xdcfc('0xe'),_0x5ddce8,JSON[_0xdcfc('0x39')](_0xb8ec04));})[_0xdcfc('0x3a')](function(_0x308335){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x5ddce8,JSON[_0xdcfc('0x39')](_0x308335));})[_0xdcfc('0x3b')](function(){Promise[_0xdcfc('0x3c')]()[_0xdcfc('0x37')](function(){if(_0x2c9651[0x0]!=='2'||_0x5c9817[_0xdcfc('0x15')])return;return rpc[_0x12a602+_0xdcfc('0x3d')][_0xdcfc('0x3e')](_0x5c9817['id'],{'autoreplyExecuted':!![]})['then'](function(_0x24ccae){logger[_0xdcfc('0xd')](_0xdcfc('0x16'),_0x5ddce8,JSON[_0xdcfc('0x39')](_0x24ccae));})[_0xdcfc('0x3a')](function(_0x5abee9){logger[_0xdcfc('0x3f')](_0xdcfc('0x40'),_0x5ddce8,JSON['stringify'](_0x5abee9));});})['then'](function(){_0x397e07['next']();});});}else{return rpc[this[_0xdcfc('0xb')]+_0xdcfc('0x41')]['create'](_0x5209e0)[_0xdcfc('0x37')](function(_0x336b66){logger[_0xdcfc('0xd')](_0xdcfc('0xe'),_0x5ddce8,_0x5209e0[_0xdcfc('0xc')]);})[_0xdcfc('0x3a')](function(_0x3bda7c){logger['error'](_0xdcfc('0xe'),_0x5ddce8,JSON['stringify'](_0x3bda7c));})[_0xdcfc('0x3b')](function(){Promise['resolve']()['then'](function(){if(_0x2c9651[0x0]!=='2'||_0x5c9817['autoreplyExecuted'])return;return rpc[_0x12a602+_0xdcfc('0x3d')]['update'](_0x5c9817['id'],{'autoreplyExecuted':!![]})[_0xdcfc('0x37')](function(_0x4f8578){logger[_0xdcfc('0xd')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5ddce8,JSON[_0xdcfc('0x39')](_0x4f8578));})[_0xdcfc('0x3a')](function(_0x357d72){logger['error'](_0xdcfc('0x40'),_0x5ddce8,JSON[_0xdcfc('0x39')](_0x357d72));});})['then'](function(){_0x397e07[_0xdcfc('0x14')]();});});}}}catch(_0x117c35){logger[_0xdcfc('0x3f')](_0xdcfc('0xe'),_0x5ddce8,JSON[_0xdcfc('0x39')](_0x117c35));_0x397e07[_0xdcfc('0x42')]();}};}; \ 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 78e3e91..2f8fec9 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 _0x5256=['[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x5256,0x153));var _0x6525=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5256[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var logger=require(_0x6525('0x0'))('routing');var rpc={'chatInteraction':require(_0x6525('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6525('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x6525('0x3')),'whatsappInteraction':require(_0x6525('0x4'))};exports[_0x6525('0x5')]=function(_0x34c69d,_0x478cfd,_0x131e96,_0x47614f){return function(_0x559e3f){try{logger[_0x6525('0x6')](_0x6525('0x7'),_0x34c69d,_0x478cfd[0x0]);var _0x523b2d={'closed':0x1,'closedAt':moment()[_0x6525('0x8')](_0x6525('0x9')),'closeReason':'system','disposition':_0x478cfd[0x0]};if(rpc[_0x47614f[_0x6525('0xa')]+_0x6525('0xb')]){rpc[_0x47614f[_0x6525('0xa')]+_0x6525('0xb')][_0x6525('0xc')](_0x47614f[_0x6525('0xd')]['id'],_0x523b2d)[_0x6525('0xe')](function(_0x12202b){logger['info'](_0x6525('0xf'),_0x34c69d,_0x47614f['interaction']['id']);})[_0x6525('0x10')](function(_0x32ed34){logger[_0x6525('0x11')](_0x6525('0x12'),_0x34c69d,JSON[_0x6525('0x13')](_0x32ed34));})['finally'](function(){_0x559e3f[_0x6525('0x14')]();});}}catch(_0x97f329){logger['error'](_0x6525('0x12'),_0x34c69d,JSON[_0x6525('0x13')](_0x97f329));_0x559e3f[_0x6525('0x14')]();}};}; \ No newline at end of file +var _0xca58=['../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x481538,_0x58bd10){var _0x4c15c1=function(_0x25c1a8){while(--_0x25c1a8){_0x481538['push'](_0x481538['shift']());}};_0x4c15c1(++_0x58bd10);}(_0xca58,0x1f2));var _0x8ca5=function(_0x289487,_0x44ea22){_0x289487=_0x289487-0x0;var _0x2d4ff1=_0xca58[_0x289487];return _0x2d4ff1;};'use strict';var moment=require(_0x8ca5('0x0'));var logger=require('../../../../config/logger')(_0x8ca5('0x1'));var rpc={'chatInteraction':require(_0x8ca5('0x2')),'openchannelInteraction':require(_0x8ca5('0x3')),'smsInteraction':require(_0x8ca5('0x4')),'mailInteraction':require(_0x8ca5('0x5')),'faxInteraction':require(_0x8ca5('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x8ca5('0x7')]=function(_0x4f203c,_0xb0689f,_0x54ed1f,_0x492e46){return function(_0x4009ed){try{logger[_0x8ca5('0x8')](_0x8ca5('0x9'),_0x4f203c,_0xb0689f[0x0]);var _0x529f31={'closed':0x1,'closedAt':moment()[_0x8ca5('0xa')](_0x8ca5('0xb')),'closeReason':_0x8ca5('0xc'),'disposition':_0xb0689f[0x0]};if(rpc[_0x492e46['channel']+_0x8ca5('0xd')]){rpc[_0x492e46[_0x8ca5('0xe')]+_0x8ca5('0xd')][_0x8ca5('0xf')](_0x492e46[_0x8ca5('0x10')]['id'],_0x529f31)[_0x8ca5('0x11')](function(_0x352bf3){logger[_0x8ca5('0x8')](_0x8ca5('0x12'),_0x4f203c,_0x492e46['interaction']['id']);})[_0x8ca5('0x13')](function(_0x2c171a){logger['error']('[%s][CLOSE]\x20%s',_0x4f203c,JSON[_0x8ca5('0x14')](_0x2c171a));})[_0x8ca5('0x15')](function(){_0x4009ed[_0x8ca5('0x16')]();});}}catch(_0x44f9ad){logger['error'](_0x8ca5('0x17'),_0x4f203c,JSON['stringify'](_0x44f9ad));_0x4009ed[_0x8ca5('0x16')]();}};}; \ 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 813fe6a..ccf4335 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 _0x187d=['result','speech','providerName','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','getMustacheRender','Message','create','then','info','body','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest'];(function(_0x33c26b,_0x109f10){var _0x54a7a5=function(_0x44e268){while(--_0x44e268){_0x33c26b['push'](_0x33c26b['shift']());}};_0x54a7a5(++_0x109f10);}(_0x187d,0x93));var _0xd187=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x187d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xd187('0x0'));var moment=require('moment');var apiai=require(_0xd187('0x1'));var md5=require(_0xd187('0x2'));var utils=require(_0xd187('0x3'));var logger=require(_0xd187('0x4'))(_0xd187('0x5'));var rpc={'chatMessage':require(_0xd187('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd187('0x7')),'smsMessage':require(_0xd187('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd187('0x9'))};exports[_0xd187('0xa')]=function(_0x444a60,_0x1d3fe4){return function(_0x28ce2f){try{if(!_[_0xd187('0xb')](this[_0xd187('0xc')][_0xd187('0xd')])){logger['info'](_0xd187('0xe'),_0x444a60,_0xd187('0xf'));return _0x28ce2f[_0xd187('0x10')]();}var _0x473866={'ContactId':this[_0xd187('0x11')]['id'],'sentAt':moment()[_0xd187('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd187('0x13')};if(this[_0xd187('0x14')]===_0xd187('0x15')||this['channel']===_0xd187('0x16')){_0x473866[_0xd187('0x17')]=this[_0xd187('0xc')]['phone'];}var _0x33e3d5=this[_0xd187('0x14')];if(_0x33e3d5===_0xd187('0x18')){_0x473866[_0xd187('0x19')]=this['account']['id'];}else{_0x473866[_[_0xd187('0x1a')](_0x33e3d5)+_0xd187('0x1b')]=this[_0xd187('0x1c')]['id'];}_0x473866[_[_0xd187('0x1a')](_0x33e3d5)+'InteractionId']=this[_0xd187('0xc')]['id'];if(this['interaction']['created']){var _0x40ed84=_0x1d3fe4[0x2];if(!_['isEmpty'](_0x40ed84)){_0x473866['body']=utils[_0xd187('0x1d')](_0x40ed84,this);return rpc[_0x33e3d5+_0xd187('0x1e')][_0xd187('0x1f')](_0x473866)[_0xd187('0x20')](function(_0x21df74){logger[_0xd187('0x21')](_0xd187('0xe'),_0x444a60,_0x473866[_0xd187('0x22')]);})[_0xd187('0x23')](function(_0x46fca3){logger[_0xd187('0x24')](_0xd187('0xe'),_0x444a60,JSON[_0xd187('0x25')](_0x46fca3));})['finally'](function(){logger[_0xd187('0x21')](_0xd187('0x26'),_0x444a60);_0x28ce2f[_0xd187('0x27')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x444a60);_0x28ce2f['stop']();}}else{var _0x435d94=this;var _0x33741d=apiai(_0x1d3fe4[0x0],{'language':_0x1d3fe4[0x1]||'en'});return _0x33741d[_0xd187('0x28')](this['message'][_0xd187('0x22')],{'sessionId':md5(this['interaction']['id'])})[_0xd187('0x20')](function(_0x5a7a23){_0x435d94[_0xd187('0x22')]['dialogflow']=_0x5a7a23;_0x473866['body']=_0x5a7a23[_0xd187('0x29')]['fulfillment'][_0xd187('0x2a')];_0x473866[_0xd187('0x2b')]='dialogflow';_0x473866['providerResponse']=JSON[_0xd187('0x25')](_0x5a7a23);return rpc[_0x33e3d5+_0xd187('0x1e')][_0xd187('0x1f')](_0x473866)[_0xd187('0x20')](function(_0x5cf19a){logger[_0xd187('0x21')](_0xd187('0xe'),_0x444a60,_0x473866['body']);if(_0x5a7a23[_0xd187('0x29')][_0xd187('0x2c')][_0xd187('0x2d')]){_0x28ce2f['next']();}else{_0x28ce2f[_0xd187('0x27')]();}})['catch'](function(_0x263e31){logger[_0xd187('0x24')](_0xd187('0xe'),_0x444a60,JSON[_0xd187('0x25')](_0x263e31));_0x28ce2f['next']();});})[_0xd187('0x23')](function(_0xb38778){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x444a60,_0xb38778[_0xd187('0x2e')]);_0x28ce2f[_0xd187('0x10')]();});}}catch(_0x13f285){logger[_0xd187('0x24')](_0xd187('0xe'),_0x444a60,JSON[_0xd187('0x25')](_0x13f285));_0x28ce2f[_0xd187('0x27')]();}};}; \ No newline at end of file +var _0xfc65=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','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','result','fulfillment','speech','providerName','dialogflow','metadata','endConversation','lodash','md5','./utils','../../../../config/logger','routing'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xfc65,0x1e1));var _0x5fc6=function(_0xe208fc,_0x37462c){_0xe208fc=_0xe208fc-0x0;var _0x2ec588=_0xfc65[_0xe208fc];return _0x2ec588;};'use strict';var _=require(_0x5fc6('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x5fc6('0x1'));var utils=require(_0x5fc6('0x2'));var logger=require(_0x5fc6('0x3'))(_0x5fc6('0x4'));var rpc={'chatMessage':require(_0x5fc6('0x5')),'openchannelMessage':require(_0x5fc6('0x6')),'mailMessage':require(_0x5fc6('0x7')),'smsMessage':require(_0x5fc6('0x8')),'faxMessage':require(_0x5fc6('0x9')),'whatsappMessage':require(_0x5fc6('0xa'))};exports[_0x5fc6('0xb')]=function(_0x409c5f,_0x1a9600){return function(_0x572941){try{if(!_[_0x5fc6('0xc')](this[_0x5fc6('0xd')][_0x5fc6('0xe')])){logger[_0x5fc6('0xf')](_0x5fc6('0x10'),_0x409c5f,_0x5fc6('0x11'));return _0x572941[_0x5fc6('0x12')]();}var _0x27cad8={'ContactId':this[_0x5fc6('0x13')]['id'],'sentAt':moment()[_0x5fc6('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x5fc6('0x15')};if(this['channel']===_0x5fc6('0x16')||this[_0x5fc6('0x17')]===_0x5fc6('0x18')){_0x27cad8[_0x5fc6('0x19')]=this['interaction'][_0x5fc6('0x19')];}var _0x3dff42=this[_0x5fc6('0x17')];if(_0x3dff42===_0x5fc6('0x1a')){_0x27cad8[_0x5fc6('0x1b')]=this[_0x5fc6('0x1c')]['id'];}else{_0x27cad8[_[_0x5fc6('0x1d')](_0x3dff42)+_0x5fc6('0x1e')]=this[_0x5fc6('0x1c')]['id'];}_0x27cad8[_[_0x5fc6('0x1d')](_0x3dff42)+'InteractionId']=this['interaction']['id'];if(this[_0x5fc6('0xd')][_0x5fc6('0x1f')]){var _0x5cb1c7=_0x1a9600[0x2];if(!_[_0x5fc6('0x20')](_0x5cb1c7)){_0x27cad8[_0x5fc6('0x21')]=utils[_0x5fc6('0x22')](_0x5cb1c7,this);return rpc[_0x3dff42+_0x5fc6('0x23')][_0x5fc6('0x24')](_0x27cad8)[_0x5fc6('0x25')](function(_0x569bbc){logger[_0x5fc6('0xf')](_0x5fc6('0x10'),_0x409c5f,_0x27cad8[_0x5fc6('0x21')]);})[_0x5fc6('0x26')](function(_0x5c76e7){logger[_0x5fc6('0x27')](_0x5fc6('0x10'),_0x409c5f,JSON[_0x5fc6('0x28')](_0x5c76e7));})[_0x5fc6('0x29')](function(){logger[_0x5fc6('0xf')](_0x5fc6('0x2a'),_0x409c5f);_0x572941[_0x5fc6('0x2b')]();});}else{logger[_0x5fc6('0xf')](_0x5fc6('0x2c'),_0x409c5f);_0x572941[_0x5fc6('0x2b')]();}}else{var _0x5ed932=this;var _0x1a3c0d=apiai(_0x1a9600[0x0],{'language':_0x1a9600[0x1]||'en'});return _0x1a3c0d[_0x5fc6('0x2d')](this[_0x5fc6('0x2e')][_0x5fc6('0x21')],{'sessionId':md5(this[_0x5fc6('0xd')]['id'])})[_0x5fc6('0x25')](function(_0xb7946){_0x5ed932[_0x5fc6('0x21')]['dialogflow']=_0xb7946;_0x27cad8[_0x5fc6('0x21')]=_0xb7946[_0x5fc6('0x2f')][_0x5fc6('0x30')][_0x5fc6('0x31')];_0x27cad8[_0x5fc6('0x32')]=_0x5fc6('0x33');_0x27cad8['providerResponse']=JSON[_0x5fc6('0x28')](_0xb7946);return rpc[_0x3dff42+_0x5fc6('0x23')]['create'](_0x27cad8)[_0x5fc6('0x25')](function(_0x3d7099){logger[_0x5fc6('0xf')](_0x5fc6('0x10'),_0x409c5f,_0x27cad8[_0x5fc6('0x21')]);if(_0xb7946['result'][_0x5fc6('0x34')][_0x5fc6('0x35')]){_0x572941[_0x5fc6('0x12')]();}else{_0x572941[_0x5fc6('0x2b')]();}})[_0x5fc6('0x26')](function(_0x19fceb){logger[_0x5fc6('0x27')](_0x5fc6('0x10'),_0x409c5f,JSON[_0x5fc6('0x28')](_0x19fceb));_0x572941['next']();});})[_0x5fc6('0x26')](function(_0x5ae36d){logger[_0x5fc6('0x27')](_0x5fc6('0x10'),_0x409c5f,_0x5ae36d[_0x5fc6('0x2e')]);_0x572941[_0x5fc6('0x12')]();});}}catch(_0x331c2b){logger['error'](_0x5fc6('0x10'),_0x409c5f,JSON[_0x5fc6('0x28')](_0x331c2b));_0x572941[_0x5fc6('0x2b')]();}};}; \ 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 3de5eed..463dc6e 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 _0xdbd0=['providerName','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence'];(function(_0xbfe63f,_0x415287){var _0x2b3708=function(_0x43570d){while(--_0x43570d){_0xbfe63f['push'](_0xbfe63f['shift']());}};_0x2b3708(++_0x415287);}(_0xdbd0,0x88));var _0x0dbd=function(_0x4b712e,_0x299d59){_0x4b712e=_0x4b712e-0x0;var _0x247a26=_0xdbd0[_0x4b712e];return _0x247a26;};'use strict';var _=require(_0x0dbd('0x0'));var dialogflow=require(_0x0dbd('0x1'));var md5=require(_0x0dbd('0x2'));var moment=require(_0x0dbd('0x3'));var Promise=require(_0x0dbd('0x4'));var logger=require('../../../../config/logger')(_0x0dbd('0x5'));var utils=require(_0x0dbd('0x6'));var rpc={'chatMessage':require(_0x0dbd('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0dbd('0x8')),'smsMessage':require(_0x0dbd('0x9')),'faxMessage':require(_0x0dbd('0xa')),'whatsappMessage':require(_0x0dbd('0xb'))};function createMessage(_0x4b653b,_0x47e742,_0xcb72c2,_0x3b3f21){return new Promise(function(_0x1a957e,_0x1b041f){var _0x12057a=_[_0x0dbd('0xc')](_0xcb72c2);_0x12057a['body']=_0x3b3f21;return rpc[_0x47e742+'Message'][_0x0dbd('0xd')](_0x12057a)[_0x0dbd('0xe')](function(){logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0x4b653b,_0x12057a[_0x0dbd('0x11')]);_0x1a957e();})[_0x0dbd('0x12')](function(_0x1e0006){logger[_0x0dbd('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x4b653b,JSON[_0x0dbd('0x14')](_0x1e0006));_0x1b041f(_0x1e0006);});});}exports[_0x0dbd('0x15')]=function(_0xbeeb88,_0x59f880){return function(_0x1f358a){try{if(!_[_0x0dbd('0x16')](this[_0x0dbd('0x17')][_0x0dbd('0x18')])){logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0xbeeb88,_0x0dbd('0x19'));return _0x1f358a[_0x0dbd('0x1a')]();}var _0x1b9134={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x0dbd('0x1b')),'direction':_0x0dbd('0x1c')};if(this['channel']===_0x0dbd('0x1d')||this[_0x0dbd('0x1e')]==='whatsapp'){_0x1b9134['phone']=this[_0x0dbd('0x17')][_0x0dbd('0x1f')];}var _0x24ac9d=this['channel'];if(_0x24ac9d===_0x0dbd('0x20')){_0x1b9134[_0x0dbd('0x21')]=this['account']['id'];}else{_0x1b9134[_['upperFirst'](_0x24ac9d)+_0x0dbd('0x22')]=this[_0x0dbd('0x23')]['id'];}_0x1b9134[_[_0x0dbd('0x24')](_0x24ac9d)+'InteractionId']=this['interaction']['id'];if(this[_0x0dbd('0x17')][_0x0dbd('0x25')]){var _0x4e5f3e=_0x59f880[0x4];if(!_['isEmpty'](_0x4e5f3e)){_0x1b9134[_0x0dbd('0x11')]=utils[_0x0dbd('0x26')](_0x4e5f3e,this);return rpc[_0x24ac9d+'Message'][_0x0dbd('0xd')](_0x1b9134)[_0x0dbd('0xe')](function(_0x18edd1){logger['info'](_0x0dbd('0x10'),_0xbeeb88,_0x1b9134[_0x0dbd('0x11')]);})['catch'](function(_0x328eba){logger[_0x0dbd('0x13')](_0x0dbd('0x10'),_0xbeeb88,JSON[_0x0dbd('0x14')](_0x328eba));})[_0x0dbd('0x27')](function(){logger['info'](_0x0dbd('0x28'),_0xbeeb88);_0x1f358a[_0x0dbd('0x29')]();});}else{logger[_0x0dbd('0xf')](_0x0dbd('0x2a'),_0xbeeb88);_0x1f358a[_0x0dbd('0x29')]();}}else{var _0x464d99=this;var _0x4938d9=_0x59f880[0x2]['replace'](/\\n/g,'\x0a');var _0x47dce1={'credentials':{'private_key':_0x4938d9,'client_email':_0x59f880[0x1]}};var _0x1728d1=new dialogflow['SessionsClient'](_0x47dce1);var _0x228fc6=_0x1728d1['sessionPath'](_0x59f880[0x0],md5(_0x464d99['interaction']['id']));var _0xd13db9={'session':_0x228fc6,'queryInput':{'text':{'text':_0x464d99[_0x0dbd('0x2b')][_0x0dbd('0x11')],'languageCode':_0x59f880[0x3]||'en'}}};return _0x1728d1[_0x0dbd('0x2c')](_0xd13db9)['then'](function(_0x32d41a){if(_0x32d41a&&_0x32d41a[_0x0dbd('0x2d')]){_0x464d99[_0x0dbd('0x11')]['dialogflowV2']=_0x32d41a;var _0x467d49=_0x32d41a[0x0];var _0x3ac530=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x2f')]&&_0x467d49['queryResult'][_0x0dbd('0x2f')][_0x0dbd('0x30')]?_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x2f')]['fields'][_0x0dbd('0x31')][_0x0dbd('0x32')]:![];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_ACTION']=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x33')];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x467d49[_0x0dbd('0x2e')]['allRequiredParamsPresent'];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x467d49['queryResult']['diagnosticInfo']&&_0x467d49['queryResult'][_0x0dbd('0x2f')][_0x0dbd('0x30')]?_0x467d49['queryResult'][_0x0dbd('0x2f')][_0x0dbd('0x30')]['end_conversation'][_0x0dbd('0x32')]:![];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x34')]=_0x467d49['queryResult']['intent']['name'];_0x464d99[_0x0dbd('0x11')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x467d49['queryResult'][_0x0dbd('0x35')]['displayName'];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x36')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x35')][_0x0dbd('0x37')];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x38')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x39')];_0x464d99['body'][_0x0dbd('0x3a')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x3b')];_0x464d99[_0x0dbd('0x11')][_0x0dbd('0x3c')]=_0x467d49[_0x0dbd('0x2e')][_0x0dbd('0x3d')];_0x1b9134[_0x0dbd('0x3e')]='dialogflowV2';_0x1b9134[_0x0dbd('0x3f')]=JSON['stringify'](_0x32d41a);var _0x2a9c8a=[];for(var _0x270baa=0x0;_0x270baa<_0x32d41a['length'];_0x270baa++){var _0x1d39a6=_0x32d41a[_0x270baa];if(_0x1d39a6&&_0x1d39a6[_0x0dbd('0x2e')]&&_0x1d39a6[_0x0dbd('0x2e')][_0x0dbd('0x40')]){_0x2a9c8a['push'](createMessage(_0xbeeb88,_0x24ac9d,_0x1b9134,_0x1d39a6[_0x0dbd('0x2e')]['fulfillmentText']));}}return Promise[_0x0dbd('0x41')](_0x2a9c8a)[_0x0dbd('0xe')](function(){if(_0x3ac530){_0x1f358a[_0x0dbd('0x1a')]();}else{_0x1f358a[_0x0dbd('0x29')]();}})[_0x0dbd('0x12')](function(_0x523291){logger[_0x0dbd('0x13')](_0x0dbd('0x10'),_0xbeeb88,JSON[_0x0dbd('0x14')](_0x523291));_0x1f358a[_0x0dbd('0x1a')]();});}})[_0x0dbd('0x12')](function(_0x27741e){logger[_0x0dbd('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0xbeeb88,_0x27741e['message']);_0x1f358a[_0x0dbd('0x1a')]();});}}catch(_0x14ca34){logger[_0x0dbd('0x13')](_0x0dbd('0x10'),_0xbeeb88,JSON['stringify'](_0x14ca34));_0x1f358a[_0x0dbd('0x29')]();}};}; \ No newline at end of file +var _0x8d48=['UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','whatsapp','phone','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','create','error','finally','stop','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','fulfillmentText','all','dialogflow','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','then','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','interaction'];(function(_0x382e8a,_0x24ec77){var _0x3e99b1=function(_0x46872c){while(--_0x46872c){_0x382e8a['push'](_0x382e8a['shift']());}};_0x3e99b1(++_0x24ec77);}(_0x8d48,0x18b));var _0x88d4=function(_0x315aea,_0x318a80){_0x315aea=_0x315aea-0x0;var _0x4a4bdb=_0x8d48[_0x315aea];return _0x4a4bdb;};'use strict';var _=require('lodash');var dialogflow=require(_0x88d4('0x0'));var md5=require('md5');var moment=require(_0x88d4('0x1'));var Promise=require(_0x88d4('0x2'));var logger=require('../../../../config/logger')(_0x88d4('0x3'));var utils=require(_0x88d4('0x4'));var rpc={'chatMessage':require(_0x88d4('0x5')),'openchannelMessage':require(_0x88d4('0x6')),'mailMessage':require(_0x88d4('0x7')),'smsMessage':require(_0x88d4('0x8')),'faxMessage':require(_0x88d4('0x9')),'whatsappMessage':require(_0x88d4('0xa'))};function createMessage(_0x4b653e,_0x1b24ac,_0x17e8df,_0x1f7185){return new Promise(function(_0x4a680b,_0x1bd294){var _0x3e736f=_['clone'](_0x17e8df);_0x3e736f[_0x88d4('0xb')]=_0x1f7185;return rpc[_0x1b24ac+_0x88d4('0xc')]['create'](_0x3e736f)[_0x88d4('0xd')](function(){logger['info'](_0x88d4('0xe'),_0x4b653e,_0x3e736f['body']);_0x4a680b();})[_0x88d4('0xf')](function(_0x32ca19){logger['error'](_0x88d4('0xe'),_0x4b653e,JSON[_0x88d4('0x10')](_0x32ca19));_0x1bd294(_0x32ca19);});});}exports[_0x88d4('0x11')]=function(_0x6bf79f,_0x54c3bf){return function(_0x3f767d){try{if(!_['isNil'](this[_0x88d4('0x12')][_0x88d4('0x13')])){logger[_0x88d4('0x14')](_0x88d4('0xe'),_0x6bf79f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3f767d[_0x88d4('0x15')]();}var _0x5e008a={'ContactId':this[_0x88d4('0x16')]['id'],'sentAt':moment()[_0x88d4('0x17')](_0x88d4('0x18')),'direction':'out'};if(this['channel']===_0x88d4('0x19')||this['channel']===_0x88d4('0x1a')){_0x5e008a[_0x88d4('0x1b')]=this['interaction'][_0x88d4('0x1b')];}var _0x41d386=this[_0x88d4('0x1c')];if(_0x41d386==='chat'){_0x5e008a[_0x88d4('0x1d')]=this[_0x88d4('0x1e')]['id'];}else{_0x5e008a[_[_0x88d4('0x1f')](_0x41d386)+_0x88d4('0x20')]=this[_0x88d4('0x1e')]['id'];}_0x5e008a[_[_0x88d4('0x1f')](_0x41d386)+_0x88d4('0x21')]=this[_0x88d4('0x12')]['id'];if(this[_0x88d4('0x12')][_0x88d4('0x22')]){var _0x4c6c05=_0x54c3bf[0x4];if(!_['isEmpty'](_0x4c6c05)){_0x5e008a[_0x88d4('0xb')]=utils[_0x88d4('0x23')](_0x4c6c05,this);return rpc[_0x41d386+'Message'][_0x88d4('0x24')](_0x5e008a)[_0x88d4('0xd')](function(_0x3c149b){logger[_0x88d4('0x14')](_0x88d4('0xe'),_0x6bf79f,_0x5e008a[_0x88d4('0xb')]);})[_0x88d4('0xf')](function(_0x447c82){logger[_0x88d4('0x25')](_0x88d4('0xe'),_0x6bf79f,JSON[_0x88d4('0x10')](_0x447c82));})[_0x88d4('0x26')](function(){logger[_0x88d4('0x14')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x6bf79f);_0x3f767d['stop']();});}else{logger[_0x88d4('0x14')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x6bf79f);_0x3f767d[_0x88d4('0x27')]();}}else{var _0xdf35d7=this;var _0x3e0b12=_0x54c3bf[0x2]['replace'](/\\n/g,'\x0a');var _0x20e447={'credentials':{'private_key':_0x3e0b12,'client_email':_0x54c3bf[0x1]}};var _0x1b0bc7=new dialogflow[(_0x88d4('0x28'))](_0x20e447);var _0x43edcc=_0x1b0bc7[_0x88d4('0x29')](_0x54c3bf[0x0],md5(_0xdf35d7[_0x88d4('0x12')]['id']));var _0x5f04aa={'session':_0x43edcc,'queryInput':{'text':{'text':_0xdf35d7[_0x88d4('0x2a')][_0x88d4('0xb')],'languageCode':_0x54c3bf[0x3]||'en'}}};return _0x1b0bc7[_0x88d4('0x2b')](_0x5f04aa)[_0x88d4('0xd')](function(_0x23aa4b){if(_0x23aa4b&&_0x23aa4b[_0x88d4('0x2c')]){_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x2d')]=_0x23aa4b;var _0x33c15b=_0x23aa4b[0x0];var _0x3a42b8=_0x33c15b[_0x88d4('0x2e')][_0x88d4('0x2f')]&&_0x33c15b[_0x88d4('0x2e')][_0x88d4('0x2f')][_0x88d4('0x30')]?_0x33c15b[_0x88d4('0x2e')]['diagnosticInfo']['fields'][_0x88d4('0x31')]['boolValue']:![];_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x32')]=_0x33c15b[_0x88d4('0x2e')]['action'];_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x33')]=_0x33c15b['queryResult'][_0x88d4('0x34')];_0xdf35d7['body'][_0x88d4('0x35')]=_0x33c15b[_0x88d4('0x2e')]['diagnosticInfo']&&_0x33c15b[_0x88d4('0x2e')][_0x88d4('0x2f')][_0x88d4('0x30')]?_0x33c15b[_0x88d4('0x2e')][_0x88d4('0x2f')][_0x88d4('0x30')]['end_conversation'][_0x88d4('0x36')]:![];_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x37')]=_0x33c15b[_0x88d4('0x2e')]['intent'][_0x88d4('0x38')];_0xdf35d7['body'][_0x88d4('0x39')]=_0x33c15b['queryResult']['intent']['displayName'];_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x3a')]=_0x33c15b['queryResult'][_0x88d4('0x3b')][_0x88d4('0x3c')];_0xdf35d7['body'][_0x88d4('0x3d')]=_0x33c15b[_0x88d4('0x2e')][_0x88d4('0x3e')];_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x3f')]=_0x33c15b[_0x88d4('0x2e')][_0x88d4('0x40')];_0xdf35d7[_0x88d4('0xb')][_0x88d4('0x41')]=_0x33c15b[_0x88d4('0x2e')]['intentDetectionConfidence'];_0x5e008a[_0x88d4('0x42')]='dialogflowV2';_0x5e008a['providerResponse']=JSON['stringify'](_0x23aa4b);var _0x3efb2b=[];for(var _0x412faf=0x0;_0x412faf<_0x23aa4b[_0x88d4('0x2c')];_0x412faf++){var _0x572e41=_0x23aa4b[_0x412faf];if(_0x572e41&&_0x572e41[_0x88d4('0x2e')]&&_0x572e41['queryResult'][_0x88d4('0x43')]){_0x3efb2b['push'](createMessage(_0x6bf79f,_0x41d386,_0x5e008a,_0x572e41[_0x88d4('0x2e')][_0x88d4('0x43')]));}}return Promise[_0x88d4('0x44')](_0x3efb2b)['then'](function(){if(_0x3a42b8){_0x3f767d['next']();}else{_0x3f767d['stop']();}})['catch'](function(_0x570dca){logger[_0x88d4('0x25')](_0x88d4('0xe'),_0x6bf79f,JSON[_0x88d4('0x10')](_0x570dca));_0x3f767d[_0x88d4('0x15')]();});}})[_0x88d4('0xf')](function(_0x49c011){logger[_0x88d4('0x25')](_0x88d4('0xe'),_0x6bf79f,_0x49c011[_0x88d4('0x2a')]);_0x3f767d['next']();});}}catch(_0x2988d1){logger[_0x88d4('0x25')](_0x88d4('0xe'),_0x6bf79f,JSON[_0x88d4('0x10')](_0x2988d1));_0x3f767d[_0x88d4('0x27')]();}};}; \ 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 735bc4c..4f96a94 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 _0xc747=['priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0xc747,0x79));var _0x7c74=function(_0x33c98e,_0x4eb3d0){_0x33c98e=_0x33c98e-0x0;var _0x39a756=_0xc747[_0x33c98e];return _0x39a756;};'use strict';var schema=require(_0x7c74('0x0'));var _=require(_0x7c74('0x1'));var htmlToText=require(_0x7c74('0x2'));var utils=require(_0x7c74('0x3'));var logger=require(_0x7c74('0x4'))(_0x7c74('0x5'));var gotoif=schema({'condition':{'type':_0x7c74('0x6'),'required':!![],'message':_0x7c74('0x7')},'priorityTrue':{'type':'number','message':_0x7c74('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x7c74('0x9')]=function(_0x565a6b,_0x171be9){return function(_0x9cc4c){try{var _0x5834d6={'condition':htmlToText[_0x7c74('0xa')](utils[_0x7c74('0xb')](_0x171be9[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x171be9[0x1],'priorityFalse':_0x171be9[0x2]};var _0x410a58=gotoif[_0x7c74('0x0')](_0x5834d6,{'typecast':!![]});if(_0x410a58[_0x7c74('0xc')]){logger['error'](_0x7c74('0xd'),_0x565a6b,_[_0x7c74('0xe')](_0x410a58,_0x7c74('0xf'))[_0x7c74('0x10')](',\x20'));_0x9cc4c[_0x7c74('0x11')]();}else{try{var _0x4670ce=eval('('+_0x5834d6['condition']+')');var _0x594eb9=_0x4670ce?_0x5834d6[_0x7c74('0x12')]:_0x5834d6[_0x7c74('0x13')];logger[_0x7c74('0x14')](_0x7c74('0x15'),_0x565a6b,_0x5834d6[_0x7c74('0x16')],_0x4670ce,_0x594eb9||_0x7c74('0x17'));if(_0x594eb9){var _0x5806fd=_[_0x7c74('0x18')](_0x9cc4c['rules'](),{'p':_0x594eb9});if(_0x5806fd>=0x0){logger[_0x7c74('0x14')](_0x7c74('0x19'),_0x565a6b,_0x594eb9||_0x7c74('0x17'),_0x5806fd);_0x9cc4c[_0x7c74('0x17')](_0x5806fd);}else{logger[_0x7c74('0x14')](_0x7c74('0x1a'),_0x565a6b,_0x594eb9||'next');_0x9cc4c[_0x7c74('0x11')]();}}else{_0x9cc4c[_0x7c74('0x17')]();}}catch(_0x9894ed){logger['error'](_0x7c74('0x1b'),_0x565a6b,_0x9894ed['message']);_0x9cc4c['stop']();}}}catch(_0x550a57){logger['error'](_0x7c74('0xd'),_0x565a6b,JSON['stringify'](_0x550a57));_0x9cc4c[_0x7c74('0x11')]();}};}; \ No newline at end of file +var _0x90eb=['consequence','getMustacheRender','length','error','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number'];(function(_0x489b01,_0x597248){var _0x5dcc6c=function(_0xf8a48e){while(--_0xf8a48e){_0x489b01['push'](_0x489b01['shift']());}};_0x5dcc6c(++_0x597248);}(_0x90eb,0x79));var _0xb90e=function(_0x2eb5a1,_0x49ba16){_0x2eb5a1=_0x2eb5a1-0x0;var _0x389d7b=_0x90eb[_0x2eb5a1];return _0x389d7b;};'use strict';var schema=require(_0xb90e('0x0'));var _=require(_0xb90e('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xb90e('0x2'));var logger=require(_0xb90e('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xb90e('0x4'),'required':!![],'message':_0xb90e('0x5')},'priorityTrue':{'type':'number','message':_0xb90e('0x6')},'priorityFalse':{'type':_0xb90e('0x7'),'message':_0xb90e('0x8')}});exports[_0xb90e('0x9')]=function(_0x4ac770,_0x32ed5a){return function(_0x2c9edd){try{var _0x436652={'condition':htmlToText['fromString'](utils[_0xb90e('0xa')](_0x32ed5a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x32ed5a[0x1],'priorityFalse':_0x32ed5a[0x2]};var _0x2ae2d8=gotoif[_0xb90e('0x0')](_0x436652,{'typecast':!![]});if(_0x2ae2d8[_0xb90e('0xb')]){logger[_0xb90e('0xc')]('[%s][GOTOIF]\x20%s',_0x4ac770,_['map'](_0x2ae2d8,_0xb90e('0xd'))[_0xb90e('0xe')](',\x20'));_0x2c9edd[_0xb90e('0xf')]();}else{try{var _0x466bac=eval('('+_0x436652[_0xb90e('0x10')]+')');var _0x35ea19=_0x466bac?_0x436652[_0xb90e('0x11')]:_0x436652[_0xb90e('0x12')];logger[_0xb90e('0x13')](_0xb90e('0x14'),_0x4ac770,_0x436652[_0xb90e('0x10')],_0x466bac,_0x35ea19||_0xb90e('0x15'));if(_0x35ea19){var _0x3545c2=_[_0xb90e('0x16')](_0x2c9edd['rules'](),{'p':_0x35ea19});if(_0x3545c2>=0x0){logger[_0xb90e('0x13')](_0xb90e('0x17'),_0x4ac770,_0x35ea19||_0xb90e('0x15'),_0x3545c2);_0x2c9edd[_0xb90e('0x15')](_0x3545c2);}else{logger[_0xb90e('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4ac770,_0x35ea19||'next');_0x2c9edd[_0xb90e('0xf')]();}}else{_0x2c9edd['next']();}}catch(_0x18366a){logger[_0xb90e('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4ac770,_0x18366a['message']);_0x2c9edd[_0xb90e('0xf')]();}}}catch(_0x17160f){logger[_0xb90e('0xc')](_0xb90e('0x18'),_0x4ac770,JSON[_0xb90e('0x19')](_0x17160f));_0x2c9edd['stop']();}};}; \ 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 6ce6a38..292b13f 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 _0xcc83=['next','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x1ed406,_0x3b3184){var _0x359b38=function(_0x35dc97){while(--_0x35dc97){_0x1ed406['push'](_0x1ed406['shift']());}};_0x359b38(++_0x3b3184);}(_0xcc83,0x145));var _0x3cc8=function(_0x782159,_0x364b5f){_0x782159=_0x782159-0x0;var _0xf9415=_0xcc83[_0x782159];return _0xf9415;};'use strict';var schema=require(_0x3cc8('0x0'));var _=require('lodash');var logger=require(_0x3cc8('0x1'))(_0x3cc8('0x2'));var gotop=schema({'priority':{'type':_0x3cc8('0x3'),'required':!![],'message':_0x3cc8('0x4')}});exports[_0x3cc8('0x5')]=function(_0x357a7e,_0x5b16e3){return function(_0x457737){try{var _0x5622a0={'priority':_0x5b16e3[0x0]};var _0x148e76=gotop['validate'](_0x5622a0,{'typecast':!![]});if(_0x148e76[_0x3cc8('0x6')]){logger[_0x3cc8('0x7')](_0x3cc8('0x8'),_0x357a7e,_[_0x3cc8('0x9')](_0x148e76,_0x3cc8('0xa'))['join'](',\x20'));_0x457737[_0x3cc8('0xb')]();}else{logger[_0x3cc8('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x357a7e,_0x5622a0[_0x3cc8('0xd')]);if(_0x5622a0['priority']){var _0x21f12e=_[_0x3cc8('0xe')](_0x457737[_0x3cc8('0xf')](),{'p':_0x5622a0['priority']});if(_0x21f12e>=0x0){logger[_0x3cc8('0xc')](_0x3cc8('0x10'),_0x357a7e,_0x5622a0[_0x3cc8('0xd')]||_0x3cc8('0x11'),_0x21f12e);_0x457737[_0x3cc8('0x11')](_0x21f12e);}else{logger[_0x3cc8('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x357a7e,_0x5622a0[_0x3cc8('0xd')]||'next');_0x457737[_0x3cc8('0xb')]();}}else{_0x457737['next']();}}}catch(_0x520245){logger[_0x3cc8('0x7')](_0x3cc8('0x8'),_0x357a7e,JSON[_0x3cc8('0x12')](_0x520245));_0x457737['stop']();}};}; \ No newline at end of file +var _0x4cb4=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing'];(function(_0x389391,_0x27d994){var _0x34ac0e=function(_0x18261d){while(--_0x18261d){_0x389391['push'](_0x389391['shift']());}};_0x34ac0e(++_0x27d994);}(_0x4cb4,0xa5));var _0x44cb=function(_0x1a5687,_0xc2188f){_0x1a5687=_0x1a5687-0x0;var _0x257d5c=_0x4cb4[_0x1a5687];return _0x257d5c;};'use strict';var schema=require(_0x44cb('0x0'));var _=require('lodash');var logger=require(_0x44cb('0x1'))(_0x44cb('0x2'));var gotop=schema({'priority':{'type':_0x44cb('0x3'),'required':!![],'message':_0x44cb('0x4')}});exports[_0x44cb('0x5')]=function(_0x5d68c5,_0x468ffb){return function(_0x186e9d){try{var _0x473b43={'priority':_0x468ffb[0x0]};var _0x15eb13=gotop[_0x44cb('0x0')](_0x473b43,{'typecast':!![]});if(_0x15eb13['length']){logger[_0x44cb('0x6')](_0x44cb('0x7'),_0x5d68c5,_[_0x44cb('0x8')](_0x15eb13,_0x44cb('0x9'))[_0x44cb('0xa')](',\x20'));_0x186e9d[_0x44cb('0xb')]();}else{logger['info'](_0x44cb('0xc'),_0x5d68c5,_0x473b43['priority']);if(_0x473b43[_0x44cb('0xd')]){var _0x407141=_[_0x44cb('0xe')](_0x186e9d[_0x44cb('0xf')](),{'p':_0x473b43['priority']});if(_0x407141>=0x0){logger['info'](_0x44cb('0x10'),_0x5d68c5,_0x473b43['priority']||'next',_0x407141);_0x186e9d[_0x44cb('0x11')](_0x407141);}else{logger[_0x44cb('0x12')](_0x44cb('0x13'),_0x5d68c5,_0x473b43[_0x44cb('0xd')]||'next');_0x186e9d[_0x44cb('0xb')]();}}else{_0x186e9d['next']();}}}catch(_0x594448){logger[_0x44cb('0x6')](_0x44cb('0x7'),_0x5d68c5,JSON[_0x44cb('0x14')](_0x594448));_0x186e9d[_0x44cb('0xb')]();}};}; \ 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 faa09e8..188cda2 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 _0x25c9=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','lodash','./utils','../../../../config/logger'];(function(_0xe47d21,_0x106bf8){var _0x5ebf66=function(_0x566021){while(--_0x566021){_0xe47d21['push'](_0xe47d21['shift']());}};_0x5ebf66(++_0x106bf8);}(_0x25c9,0x1d9));var _0x925c=function(_0x30f211,_0x920a91){_0x30f211=_0x30f211-0x0;var _0x71f489=_0x25c9[_0x30f211];return _0x71f489;};'use strict';var _=require(_0x925c('0x0'));var utils=require(_0x925c('0x1'));var logger=require(_0x925c('0x2'))(_0x925c('0x3'));var rpc={'chatMessage':require(_0x925c('0x4')),'openchannelMessage':require(_0x925c('0x5')),'mailMessage':require(_0x925c('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x925c('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x925c('0x8')]=function(_0x58010f,_0x479e60){return function(_0x18ddd9){try{var _0x4af9af={'body':utils[_0x925c('0x9')](_0x479e60[0x0],this),'ContactId':this[_0x925c('0xa')]['id']};if(this[_0x925c('0xb')]===_0x925c('0xc')){_0x4af9af[_0x925c('0xd')]=this['account']['id'];}else{_0x4af9af[_[_0x925c('0xe')](this[_0x925c('0xb')])+_0x925c('0xf')]=this['account']['id'];}_0x4af9af[_[_0x925c('0xe')](this['channel'])+_0x925c('0x10')]=this[_0x925c('0x11')]['id'];if(rpc[this[_0x925c('0xb')]+_0x925c('0x12')]){return rpc[this[_0x925c('0xb')]+'Message'][_0x925c('0x13')](_0x4af9af)[_0x925c('0x14')](function(_0x2fdd3b){logger['info'](_0x925c('0x15'),_0x58010f,_0x4af9af[_0x925c('0x16')]);_0x18ddd9[_0x925c('0x17')]();})[_0x925c('0x18')](function(_0x4df95a){logger['error'](_0x925c('0x15'),_0x58010f,JSON[_0x925c('0x19')](_0x4df95a));_0x18ddd9[_0x925c('0x1a')]();});}}catch(_0x255285){logger[_0x925c('0x1b')](_0x925c('0x15'),_0x58010f,JSON[_0x925c('0x19')](_0x255285));_0x18ddd9['stop']();}};}; \ No newline at end of file +var _0x2b29=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','error','stringify','stop','lodash','../../../../config/logger','routing'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x2b29,0x135));var _0x92b2=function(_0x2ede77,_0x15e029){_0x2ede77=_0x2ede77-0x0;var _0x56a5f9=_0x2b29[_0x2ede77];return _0x56a5f9;};'use strict';var _=require(_0x92b2('0x0'));var utils=require('./utils');var logger=require(_0x92b2('0x1'))(_0x92b2('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x92b2('0x3')),'mailMessage':require(_0x92b2('0x4')),'smsMessage':require(_0x92b2('0x5')),'faxMessage':require(_0x92b2('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x92b2('0x7')]=function(_0x6754a0,_0x591321){return function(_0x1419c1){try{var _0x542994={'body':utils['getMustacheRender'](_0x591321[0x0],this),'ContactId':this[_0x92b2('0x8')]['id']};if(this[_0x92b2('0x9')]===_0x92b2('0xa')){_0x542994[_0x92b2('0xb')]=this[_0x92b2('0xc')]['id'];}else{_0x542994[_[_0x92b2('0xd')](this[_0x92b2('0x9')])+'AccountId']=this[_0x92b2('0xc')]['id'];}_0x542994[_[_0x92b2('0xd')](this['channel'])+_0x92b2('0xe')]=this[_0x92b2('0xf')]['id'];if(rpc[this[_0x92b2('0x9')]+'Message']){return rpc[this[_0x92b2('0x9')]+_0x92b2('0x10')][_0x92b2('0x11')](_0x542994)[_0x92b2('0x12')](function(_0x3944b5){logger[_0x92b2('0x13')](_0x92b2('0x14'),_0x6754a0,_0x542994['body']);_0x1419c1['next']();})['catch'](function(_0x5bcebf){logger[_0x92b2('0x15')](_0x92b2('0x14'),_0x6754a0,JSON[_0x92b2('0x16')](_0x5bcebf));_0x1419c1[_0x92b2('0x17')]();});}}catch(_0x114aca){logger[_0x92b2('0x15')](_0x92b2('0x14'),_0x6754a0,JSON['stringify'](_0x114aca));_0x1419c1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 63cc59f..4ebc712 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 _0xf3a9=['../../../../config/logger','routing','consequence','getMustacheRender','next','stringify','stop','./utils'];(function(_0x3a0712,_0x4d7b79){var _0x3a0592=function(_0x5ef1f0){while(--_0x5ef1f0){_0x3a0712['push'](_0x3a0712['shift']());}};_0x3a0592(++_0x4d7b79);}(_0xf3a9,0x1c7));var _0x9f3a=function(_0xc2f303,_0x1796e9){_0xc2f303=_0xc2f303-0x0;var _0x223923=_0xf3a9[_0xc2f303];return _0x223923;};'use strict';var utils=require(_0x9f3a('0x0'));var logger=require(_0x9f3a('0x1'))(_0x9f3a('0x2'));exports[_0x9f3a('0x3')]=function(_0x56f130,_0x21a38b){return function(_0x3e0f92){try{logger['info']('[%s][NOOP]\x20%s',_0x56f130,utils[_0x9f3a('0x4')](_0x21a38b[0x0],this));_0x3e0f92[_0x9f3a('0x5')]();}catch(_0x443119){logger['error']('[%s][NOOP]\x20%s',_0x56f130,JSON[_0x9f3a('0x6')](_0x443119));_0x3e0f92[_0x9f3a('0x7')]();}};}; \ No newline at end of file +var _0xeada=['stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x285680,_0x18ce0e){var _0x4140ae=function(_0x388bd2){while(--_0x388bd2){_0x285680['push'](_0x285680['shift']());}};_0x4140ae(++_0x18ce0e);}(_0xeada,0x7a));var _0xaead=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeada[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require(_0xaead('0x0'));var logger=require(_0xaead('0x1'))(_0xaead('0x2'));exports[_0xaead('0x3')]=function(_0x222b3c,_0x160247){return function(_0x864a28){try{logger[_0xaead('0x4')](_0xaead('0x5'),_0x222b3c,utils[_0xaead('0x6')](_0x160247[0x0],this));_0x864a28[_0xaead('0x7')]();}catch(_0x28e0d5){logger[_0xaead('0x8')]('[%s][NOOP]\x20%s',_0x222b3c,JSON[_0xaead('0x9')](_0x28e0d5));_0x864a28[_0xaead('0xa')]();}};}; \ 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 af60518..d2d1a2c 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 _0x640b=['interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','length','map','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','log','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','ioredis','../../../../config/environment','routing','./strategy','redis','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','waiting','body','contact','list','upperFirst','channel','InteractionId'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0x640b,0x1af));var _0xb640=function(_0x1c022f,_0xabda83){_0x1c022f=_0x1c022f-0x0;var _0x363696=_0x640b[_0x1c022f];return _0x363696;};'use strict';var schema=require(_0xb640('0x0'));var _=require(_0xb640('0x1'));var util=require('util');var seqqueue=require(_0xb640('0x2'));var moment=require('moment');var Redis=require(_0xb640('0x3'));var config=require(_0xb640('0x4'));var logger=require('../../../../config/logger')(_0xb640('0x5'));var strategy=require(_0xb640('0x6'));config[_0xb640('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb640('0x7')]));var attributes=['id',_0xb640('0x8'),_0xb640('0x9'),_0xb640('0xa'),_0xb640('0xb'),'joinAt'];function emit(_0x2b36ec,_0x1c2344,_0x9dfda){io['to'](_0x2b36ec)[_0xb640('0xc')](_0x1c2344,_0x9dfda);}function emitChannelQueueInteraction(_0x182654,_0x5769da,_0x118d5a,_0x4ab97c,_0x1ffbee,_0x3d3f09,_0x5071d8,_0x10d604){var _0x653407=_[_0xb640('0xd')](_0x118d5a);_0x653407[_0xb640('0x8')]=_0x10d604;_0x653407['queue']=_0x5769da;_0x653407[_0xb640('0x9')]=_0x4ab97c;_0x653407['id']=_0x1ffbee;if(_0x3d3f09){_0x5071d8[util[_0xb640('0xe')](_0xb640('0xf'),_0x182654)][_0x1ffbee]=_['pick'](_0x653407,attributes);}else{delete _0x5071d8[util[_0xb640('0xe')](_0xb640('0xf'),_0x182654)][_0x1ffbee];}emit(util[_0xb640('0xe')](_0xb640('0x10'),_0x182654,_0x5769da),util[_0xb640('0xe')]('%s_queue_waiting_interaction:%s',_0x182654,_0x3d3f09?_0xb640('0x11'):_0xb640('0x12')),_['pick'](_0x653407,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb640('0x13')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xb640('0x14')),'faxQueueReport':require(_0xb640('0x15')),'whatsappQueueReport':require(_0xb640('0x16'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb640('0x17'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4fee45,_0x3d04cf,_0xe58548,_0x449f8d){if(_0x4fee45&&_0x3d04cf&&_0xe58548){_0x3d04cf[_0xb640('0x18')]+=0x1;var _0x45e263={'uniqueid':_0x4fee45,'from':_0xe58548[_0xb640('0x19')]?_0xe58548[_0xb640('0x19')][_0xb640('0xb')]:'','joinAt':moment()[_0xb640('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe58548[_0xb640('0x1a')]?_0xe58548['contact']['id']:null,'ListId':_0xe58548[_0xb640('0x1b')]?_0xe58548['list']['id']:null};_0x45e263[_['upperFirst'](_0xe58548['channel'])+'QueueId']=_0x3d04cf['id']||null;_0x45e263[_[_0xb640('0x1c')](_0xe58548[_0xb640('0x1d')])+_0xb640('0x1e')]=_0xe58548[_0xb640('0x1f')]?_0xe58548[_0xb640('0x1f')]['id']:null;_0x45e263[_[_0xb640('0x1c')](_0xe58548[_0xb640('0x1d')])+_0xb640('0x20')]=_0xe58548['message']?_0xe58548[_0xb640('0x21')]['id']:null;_0x45e263[_['upperFirst'](_0xe58548[_0xb640('0x1d')])+(_0xe58548['channel']!==_0xb640('0x22')?'AccountId':_0xb640('0x23'))]=_0xe58548[_0xb640('0x9')]?_0xe58548[_0xb640('0x9')]['id']:null;logger[_0xb640('0x24')](util['format'](_0xb640('0x25'),_0x4fee45,_0x3d04cf[_0xb640('0x26')]));emitChannelQueueInteraction(_0xe58548[_0xb640('0x1d')],_0x3d04cf[_0xb640('0x26')],_0x45e263,_0xe58548['account'][_0xb640('0x26')],_0xe58548[_0xb640('0x21')]['id'],!![],_0x449f8d,_0x3d04cf['id']);if(rpc[_0xe58548[_0xb640('0x1d')]+_0xb640('0x27')]){return rpc[_0xe58548[_0xb640('0x1d')]+'QueueReport']['create'](_0x45e263)['catch'](function(_0x52001a){logger[_0xb640('0x28')](_0xb640('0x29'));});}}}function stopRouting(_0x5a0de8,_0x4f587b,_0x322706,_0x29937a){if(_0x5a0de8&&_0x4f587b){_0x4f587b[_0xb640('0x18')]-=0x1;var _0x3ab06a={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xb640('0xe')](_0xb640('0x2a')),'reason':'accepted'};logger[_0xb640('0x24')](util[_0xb640('0xe')](_0xb640('0x2b'),_0x5a0de8,_0x4f587b[_0xb640('0x26')]));emitChannelQueueInteraction(_0x322706[_0xb640('0x1d')],_0x4f587b[_0xb640('0x26')],_0x322706[_0xb640('0x19')],_0x322706[_0xb640('0x9')][_0xb640('0x26')],_0x322706[_0xb640('0x21')]['id'],![],_0x29937a,_0x4f587b['id']);if(rpc[_0x322706['channel']+'QueueReport']){return rpc[_0x322706['channel']+_0xb640('0x27')][_0xb640('0x2c')](_0x5a0de8,_0x3ab06a)[_0xb640('0x2d')](function(_0x62c3fd){logger[_0xb640('0x28')](_0xb640('0x2e'));});}}}function endRouting(_0x495dd1,_0x1bd3a5,_0x5c161c,_0x43f550){if(_0x495dd1&&_0x1bd3a5){_0x1bd3a5['waiting']-=0x1;var _0x446bb1={'leaveAt':moment()[_0xb640('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xb640('0x2a')),'reason':'timeout'};logger[_0xb640('0x24')](util[_0xb640('0xe')](_0xb640('0x2f'),_0x495dd1,_0x1bd3a5[_0xb640('0x26')]));emitChannelQueueInteraction(_0x5c161c['channel'],_0x1bd3a5['name'],_0x5c161c['body'],_0x5c161c[_0xb640('0x9')]['name'],_0x5c161c['message']['id'],![],_0x43f550);if(rpc[_0x5c161c[_0xb640('0x1d')]+'QueueReport']){return rpc[_0x5c161c[_0xb640('0x1d')]+_0xb640('0x27')][_0xb640('0x2c')](_0x495dd1,_0x446bb1)[_0xb640('0x2d')](function(_0x6fa50d){logger[_0xb640('0x28')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x1054f5){return function(_0x4f4a05){return _0x4f4a05['name']['toLowerCase']()===_0x1054f5['toLowerCase']();};}exports['consequence']=function(_0x35ba5c,_0x559e1f,_0x26ad5d,_0x3fd11d){return function(_0x86c9e6){try{var _0x2566e1={'name':_0x559e1f[0x0],'timeout':_0x559e1f[0x1]};var _0x68e038=queue[_0xb640('0x0')](_0x2566e1,{'typecast':!![]});if(_0x68e038[_0xb640('0x30')]){logger['error']('[%s][QUEUE]\x20%s',_0x35ba5c,_[_0xb640('0x31')](_0x68e038,_0xb640('0x21'))['join'](',\x20'));_0x86c9e6[_0xb640('0x32')]();}else{var _0x3aacb2=_['find'](_0x26ad5d[_0x3fd11d[_0xb640('0x1d')]+_0xb640('0x33')],handleFindQueue(_0x2566e1['name']));if(_0x3aacb2){startRouting(_0x35ba5c,_0x3aacb2,_0x3fd11d,_0x26ad5d);var _0x110384=(_0x3aacb2[_0xb640('0x34')]||0xa)*0x3e8;var _0x2d756d=(_0x2566e1[_0xb640('0x34')]||0x14)*0x3e8;var _0xf36807,_0x43c1b6;if(_0x110384>_0x2d756d){_0x2d756d=_0x110384;}var _0x5dabc0=seqqueue[_0xb640('0x35')](_0x110384);_0x5dabc0['id']=_0x35ba5c;_0x5dabc0[_0xb640('0x36')]=_0x110384;_0x5dabc0[_0xb640('0x37')]=_0x2d756d;_0x5dabc0[_0xb640('0x1d')]=_0x3fd11d[_0xb640('0x1d')];_0x26ad5d[_0xb640('0x38')][_0x35ba5c]['on'](_0xb640('0x39'),function(){logger[_0xb640('0x24')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x35ba5c);stopRouting(_0x35ba5c,_0x3aacb2,_0x3fd11d,_0x26ad5d);clearTimeout(_0xf36807);_0xf36807=undefined;_0x5dabc0[_0xb640('0x3a')](!![]);if(_0x26ad5d[_0xb640('0x38')][_0x35ba5c]){delete _0x26ad5d[_0xb640('0x38')][_0x35ba5c];}_0x86c9e6[_0xb640('0x32')]();});_0x26ad5d[_0xb640('0x38')][_0x35ba5c]['on'](_0xb640('0x3b'),function(){if(_0x26ad5d[_0xb640('0x38')][_0x35ba5c]){delete _0x26ad5d['rules'][_0x35ba5c];}});_0xf36807=setTimeout(function(){logger[_0xb640('0x24')](_0xb640('0x3c'),_0x35ba5c);endRouting(_0x35ba5c,_0x3aacb2,_0x3fd11d,_0x26ad5d);clearTimeout(_0xf36807);_0x5dabc0[_0xb640('0x3a')](!![]);_0x86c9e6[_0xb640('0x3d')]();},_0x2d756d);switch(_0x3aacb2['strategy']){case _0xb640('0x3e'):strategy[_0xb640('0x3e')](_0x5dabc0,_0x3aacb2,_0x26ad5d,_0x3fd11d);break;default:strategy[_0xb640('0x3f')](_0x5dabc0,_0x3aacb2,_0x26ad5d,_0x3fd11d);}}else{logger[_0xb640('0x28')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x35ba5c,_0x2566e1[_0xb640('0x26')]);_0x86c9e6[_0xb640('0x32')]();}}}catch(_0x923d48){console[_0xb640('0x40')](_0x923d48);logger[_0xb640('0x28')](_0xb640('0x41'),_0x35ba5c,_0x923d48['stack']);_0x86c9e6[_0xb640('0x32')]();}};}; \ No newline at end of file +var _0x51eb=['upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','map','stop','find','createQueue','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','queue','from','joinAt','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId'];(function(_0x371a18,_0x50ae4c){var _0x59dfb4=function(_0x117c5c){while(--_0x117c5c){_0x371a18['push'](_0x371a18['shift']());}};_0x59dfb4(++_0x50ae4c);}(_0x51eb,0x169));var _0xb51e=function(_0x560b55,_0x338050){_0x560b55=_0x560b55-0x0;var _0x1e5ae4=_0x51eb[_0x560b55];return _0x1e5ae4;};'use strict';var schema=require(_0xb51e('0x0'));var _=require(_0xb51e('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xb51e('0x2'));var Redis=require(_0xb51e('0x3'));var config=require(_0xb51e('0x4'));var logger=require(_0xb51e('0x5'))(_0xb51e('0x6'));var strategy=require(_0xb51e('0x7'));config['redis']=_[_0xb51e('0x8')](config[_0xb51e('0x9')],{'host':_0xb51e('0xa'),'port':0x18eb});var io=require(_0xb51e('0xb'))(new Redis(config['redis']));var attributes=['id',_0xb51e('0xc'),'account',_0xb51e('0xd'),_0xb51e('0xe'),_0xb51e('0xf')];function emit(_0x13c074,_0x2ffa7e,_0x3540bf){io['to'](_0x13c074)['emit'](_0x2ffa7e,_0x3540bf);}function emitChannelQueueInteraction(_0x22c9b7,_0x5d8d3e,_0x2ba975,_0x37594f,_0xd02986,_0x3de574,_0x917310,_0x4d3672){var _0x174f48=_[_0xb51e('0x10')](_0x2ba975);_0x174f48[_0xb51e('0xc')]=_0x4d3672;_0x174f48[_0xb51e('0xd')]=_0x5d8d3e;_0x174f48[_0xb51e('0x11')]=_0x37594f;_0x174f48['id']=_0xd02986;if(_0x3de574){_0x917310[util[_0xb51e('0x12')](_0xb51e('0x13'),_0x22c9b7)][_0xd02986]=_[_0xb51e('0x14')](_0x174f48,attributes);}else{delete _0x917310[util[_0xb51e('0x12')](_0xb51e('0x13'),_0x22c9b7)][_0xd02986];}emit(util[_0xb51e('0x12')](_0xb51e('0x15'),_0x22c9b7,_0x5d8d3e),util[_0xb51e('0x12')](_0xb51e('0x16'),_0x22c9b7,_0x3de574?_0xb51e('0x17'):_0xb51e('0x18')),_['pick'](_0x174f48,attributes));}var rpc={'openchannelQueueReport':require(_0xb51e('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb51e('0x1a')),'smsQueueReport':require(_0xb51e('0x1b')),'faxQueueReport':require(_0xb51e('0x1c')),'whatsappQueueReport':require(_0xb51e('0x1d'))};var queue=schema({'name':{'type':_0xb51e('0x1e'),'required':!![],'message':_0xb51e('0x1f')},'timeout':{'type':_0xb51e('0x20'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x17359c,_0x2c684c,_0x886bf9,_0x5a3410){if(_0x17359c&&_0x2c684c&&_0x886bf9){_0x2c684c[_0xb51e('0x21')]+=0x1;var _0x40dc32={'uniqueid':_0x17359c,'from':_0x886bf9[_0xb51e('0x22')]?_0x886bf9[_0xb51e('0x22')][_0xb51e('0xe')]:'','joinAt':moment()[_0xb51e('0x12')](_0xb51e('0x23')),'ContactId':_0x886bf9[_0xb51e('0x24')]?_0x886bf9[_0xb51e('0x24')]['id']:null,'ListId':_0x886bf9[_0xb51e('0x25')]?_0x886bf9[_0xb51e('0x25')]['id']:null};_0x40dc32[_['upperFirst'](_0x886bf9['channel'])+_0xb51e('0x26')]=_0x2c684c['id']||null;_0x40dc32[_[_0xb51e('0x27')](_0x886bf9[_0xb51e('0x28')])+_0xb51e('0x29')]=_0x886bf9[_0xb51e('0x2a')]?_0x886bf9['interaction']['id']:null;_0x40dc32[_[_0xb51e('0x27')](_0x886bf9['channel'])+_0xb51e('0x2b')]=_0x886bf9[_0xb51e('0x2c')]?_0x886bf9[_0xb51e('0x2c')]['id']:null;_0x40dc32[_['upperFirst'](_0x886bf9[_0xb51e('0x28')])+(_0x886bf9[_0xb51e('0x28')]!==_0xb51e('0x2d')?_0xb51e('0x2e'):_0xb51e('0x2f'))]=_0x886bf9[_0xb51e('0x11')]?_0x886bf9[_0xb51e('0x11')]['id']:null;logger[_0xb51e('0x30')](util[_0xb51e('0x12')](_0xb51e('0x31'),_0x17359c,_0x2c684c[_0xb51e('0x32')]));emitChannelQueueInteraction(_0x886bf9[_0xb51e('0x28')],_0x2c684c[_0xb51e('0x32')],_0x40dc32,_0x886bf9[_0xb51e('0x11')][_0xb51e('0x32')],_0x886bf9['message']['id'],!![],_0x5a3410,_0x2c684c['id']);if(rpc[_0x886bf9[_0xb51e('0x28')]+'QueueReport']){return rpc[_0x886bf9[_0xb51e('0x28')]+_0xb51e('0x33')][_0xb51e('0x34')](_0x40dc32)[_0xb51e('0x35')](function(_0x25b0ce){logger['error'](_0xb51e('0x36'));});}}}function stopRouting(_0x4cdd27,_0x55e26a,_0x5555a3,_0x57b660){if(_0x4cdd27&&_0x55e26a){_0x55e26a[_0xb51e('0x21')]-=0x1;var _0x5d3a78={'leaveAt':moment()['format'](_0xb51e('0x23')),'acceptAt':moment()['format'](_0xb51e('0x23')),'reason':_0xb51e('0x37')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x4cdd27,_0x55e26a['name']));emitChannelQueueInteraction(_0x5555a3[_0xb51e('0x28')],_0x55e26a[_0xb51e('0x32')],_0x5555a3['body'],_0x5555a3[_0xb51e('0x11')][_0xb51e('0x32')],_0x5555a3[_0xb51e('0x2c')]['id'],![],_0x57b660,_0x55e26a['id']);if(rpc[_0x5555a3[_0xb51e('0x28')]+_0xb51e('0x33')]){return rpc[_0x5555a3['channel']+_0xb51e('0x33')][_0xb51e('0x38')](_0x4cdd27,_0x5d3a78)[_0xb51e('0x35')](function(_0x100f88){logger[_0xb51e('0x39')](_0xb51e('0x3a'));});}}}function endRouting(_0x14bd73,_0x4b4f21,_0x7b97bd,_0x173d0a){if(_0x14bd73&&_0x4b4f21){_0x4b4f21[_0xb51e('0x21')]-=0x1;var _0x3b7349={'leaveAt':moment()[_0xb51e('0x12')](_0xb51e('0x23')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb51e('0x3b')};logger[_0xb51e('0x30')](util[_0xb51e('0x12')](_0xb51e('0x3c'),_0x14bd73,_0x4b4f21[_0xb51e('0x32')]));emitChannelQueueInteraction(_0x7b97bd[_0xb51e('0x28')],_0x4b4f21['name'],_0x7b97bd[_0xb51e('0x22')],_0x7b97bd[_0xb51e('0x11')][_0xb51e('0x32')],_0x7b97bd[_0xb51e('0x2c')]['id'],![],_0x173d0a);if(rpc[_0x7b97bd[_0xb51e('0x28')]+_0xb51e('0x33')]){return rpc[_0x7b97bd[_0xb51e('0x28')]+_0xb51e('0x33')][_0xb51e('0x38')](_0x14bd73,_0x3b7349)[_0xb51e('0x35')](function(_0x266371){logger[_0xb51e('0x39')](_0xb51e('0x3a'));});}}}function handleFindQueue(_0x569478){return function(_0x4c6bfb){return _0x4c6bfb['name']['toLowerCase']()===_0x569478[_0xb51e('0x3d')]();};}exports['consequence']=function(_0x17c3f5,_0x1dcfed,_0x5a5762,_0x164e20){return function(_0x107298){try{var _0x51cc9d={'name':_0x1dcfed[0x0],'timeout':_0x1dcfed[0x1]};var _0x411a16=queue[_0xb51e('0x0')](_0x51cc9d,{'typecast':!![]});if(_0x411a16[_0xb51e('0x3e')]){logger[_0xb51e('0x39')]('[%s][QUEUE]\x20%s',_0x17c3f5,_[_0xb51e('0x3f')](_0x411a16,_0xb51e('0x2c'))['join'](',\x20'));_0x107298[_0xb51e('0x40')]();}else{var _0x120c5c=_[_0xb51e('0x41')](_0x5a5762[_0x164e20[_0xb51e('0x28')]+'Queues'],handleFindQueue(_0x51cc9d[_0xb51e('0x32')]));if(_0x120c5c){startRouting(_0x17c3f5,_0x120c5c,_0x164e20,_0x5a5762);var _0x3c8222=(_0x120c5c[_0xb51e('0x3b')]||0xa)*0x3e8;var _0x378352=(_0x51cc9d[_0xb51e('0x3b')]||0x14)*0x3e8;var _0x267ad6,_0x580c7f;if(_0x3c8222>_0x378352){_0x378352=_0x3c8222;}var _0x2bac39=seqqueue[_0xb51e('0x42')](_0x3c8222);_0x2bac39['id']=_0x17c3f5;_0x2bac39[_0xb51e('0x43')]=_0x3c8222;_0x2bac39[_0xb51e('0x44')]=_0x378352;_0x2bac39[_0xb51e('0x28')]=_0x164e20[_0xb51e('0x28')];_0x5a5762[_0xb51e('0x45')][_0x17c3f5]['on'](_0xb51e('0x46'),function(){logger[_0xb51e('0x30')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x17c3f5);stopRouting(_0x17c3f5,_0x120c5c,_0x164e20,_0x5a5762);clearTimeout(_0x267ad6);_0x267ad6=undefined;_0x2bac39[_0xb51e('0x47')](!![]);if(_0x5a5762[_0xb51e('0x45')][_0x17c3f5]){delete _0x5a5762[_0xb51e('0x45')][_0x17c3f5];}_0x107298[_0xb51e('0x40')]();});_0x5a5762[_0xb51e('0x45')][_0x17c3f5]['on']('complete',function(){if(_0x5a5762['rules'][_0x17c3f5]){delete _0x5a5762[_0xb51e('0x45')][_0x17c3f5];}});_0x267ad6=setTimeout(function(){logger['info'](_0xb51e('0x48'),_0x17c3f5);endRouting(_0x17c3f5,_0x120c5c,_0x164e20,_0x5a5762);clearTimeout(_0x267ad6);_0x2bac39['close'](!![]);_0x107298[_0xb51e('0x49')]();},_0x378352);switch(_0x120c5c[_0xb51e('0x4a')]){case'rrmemory':strategy[_0xb51e('0x4b')](_0x2bac39,_0x120c5c,_0x5a5762,_0x164e20);break;default:strategy[_0xb51e('0x4c')](_0x2bac39,_0x120c5c,_0x5a5762,_0x164e20);}}else{logger[_0xb51e('0x39')](_0xb51e('0x4d'),_0x17c3f5,_0x51cc9d[_0xb51e('0x32')]);_0x107298['stop']();}}}catch(_0xd392f2){console[_0xb51e('0x4e')](_0xd392f2);logger['error']('[%s][QUEUE]\x20%s',_0x17c3f5,_0xd392f2[_0xb51e('0x4f')]);_0x107298[_0xb51e('0x40')]();}};}; \ 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 28ab5b3..336a708 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 _0x0d14=['writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','bind','handleTimeout','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busy','busyQueue','showNotification'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x0d14,0x1e1));var _0x40d1=function(_0x42402,_0x546de4){_0x42402=_0x42402-0x0;var _0x4defbb=_0x0d14[_0x42402];return _0x4defbb;};'use strict';var _=require('lodash');var uuid=require(_0x40d1('0x0'));var util=require(_0x40d1('0x1'));var logger=require(_0x40d1('0x2'))(_0x40d1('0x3'));var Agent=function(_0x333b18,_0x563574,_0xe30a78,_0x5713bb){this['notificationId']=uuid['v4']();this[_0x40d1('0x4')]=_0x333b18;this[_0x40d1('0x5')]=_0x563574;this[_0x40d1('0x6')]=_0xe30a78;this[_0x40d1('0x3')]=_0x5713bb;this[_0x40d1('0x4')][_0x40d1('0x7')](this['handleRun'][_0x40d1('0x8')](this),this[_0x40d1('0x9')][_0x40d1('0x8')](this));this[_0x40d1('0x4')]['on'](_0x40d1('0xa'),this[_0x40d1('0x9')][_0x40d1('0x8')](this));this[_0x40d1('0x4')]['on']('drained',this[_0x40d1('0xb')]['bind'](this));};Agent[_0x40d1('0xc')]['push']=function(){this[_0x40d1('0x4')][_0x40d1('0x7')](this['handleRun'][_0x40d1('0x8')](this),this[_0x40d1('0x9')][_0x40d1('0x8')](this));};Agent['prototype'][_0x40d1('0xb')]=function(){this[_0x40d1('0x9')](!![]);};Agent[_0x40d1('0xc')]['handleRun']=function(_0x1be074){logger[_0x40d1('0xd')](_0x40d1('0xe'),this[_0x40d1('0x4')]['id'],this[_0x40d1('0x5')]['id']);if(_[_0x40d1('0xf')](this[_0x40d1('0x6')]['agents'][this[_0x40d1('0x5')]['id']])){logger[_0x40d1('0xd')](_0x40d1('0x10'),this[_0x40d1('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x40d1('0x8')](this),0x3e8);}else{if(this[_0x40d1('0x3')][_0x40d1('0x11')]||util['isAgentAvailable'](this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],this[_0x40d1('0x4')][_0x40d1('0x13')],![])){this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']][_0x40d1('0x14')]=!![];this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']][_0x40d1('0x15')]=undefined;util[_0x40d1('0x16')](this['notificationId'],this['squeue']['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],null,this[_0x40d1('0x3')]);util[_0x40d1('0x17')](this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],'RINGING'+(this[_0x40d1('0x3')][_0x40d1('0x11')]?_0x40d1('0x18'):''));}else{logger[_0x40d1('0xd')](_0x40d1('0x19'),this[_0x40d1('0x4')]['id'],this[_0x40d1('0x5')]['id']);setTimeout(this[_0x40d1('0x7')][_0x40d1('0x8')](this),0x3e8);}}};Agent['prototype'][_0x40d1('0x9')]=function(_0x45caa4){if(_['isNil'](this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']])){return logger[_0x40d1('0xd')](_0x40d1('0x10'),this['squeue']['id'],this[_0x40d1('0x5')]['id']);}else{logger[_0x40d1('0xd')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x40d1('0x4')]['id'],this[_0x40d1('0x5')]['id']);util['hideNotification'](this['notificationId'],this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],null,this[_0x40d1('0x3')]);this[_0x40d1('0x6')]['agents'][this[_0x40d1('0x5')]['id']][_0x40d1('0x14')]=![];this['realtime'][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']][_0x40d1('0x15')]=undefined;util['writeLog'](this[_0x40d1('0x4')]['id'],this[_0x40d1('0x6')][_0x40d1('0x12')][this[_0x40d1('0x5')]['id']],_0x45caa4?_0x40d1('0x1a'):_0x40d1('0x1b'));}if(!_0x45caa4){setTimeout(this[_0x40d1('0x7')][_0x40d1('0x8')](this),0x3e8);}};function agent(_0x5c6b56,_0x1835e1,_0x1c3623,_0x308b75){return new Agent(_0x5c6b56,_0x1835e1,_0x1c3623,_0x308b75);}module['exports']=agent; \ No newline at end of file +var _0x0379=['busy','busyQueue','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','handleTimeout','timeout','drained','handleDrained','handleRun','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents'];(function(_0x204789,_0x2e6e57){var _0x2dded7=function(_0x2aa3af){while(--_0x2aa3af){_0x204789['push'](_0x204789['shift']());}};_0x2dded7(++_0x2e6e57);}(_0x0379,0xe2));var _0x9037=function(_0x57877f,_0x4e8af0){_0x57877f=_0x57877f-0x0;var _0x2a7640=_0x0379[_0x57877f];return _0x2a7640;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x9037('0x0'));var logger=require(_0x9037('0x1'))(_0x9037('0x2'));var Agent=function(_0x1fd741,_0x127fde,_0x3803c1,_0x58a3bf){this[_0x9037('0x3')]=uuid['v4']();this[_0x9037('0x4')]=_0x1fd741;this[_0x9037('0x5')]=_0x127fde;this['realtime']=_0x3803c1;this[_0x9037('0x2')]=_0x58a3bf;this[_0x9037('0x4')][_0x9037('0x6')](this['handleRun'][_0x9037('0x7')](this),this[_0x9037('0x8')][_0x9037('0x7')](this));this[_0x9037('0x4')]['on'](_0x9037('0x9'),this['handleTimeout'][_0x9037('0x7')](this));this['squeue']['on'](_0x9037('0xa'),this[_0x9037('0xb')][_0x9037('0x7')](this));};Agent['prototype']['push']=function(){this['squeue']['push'](this[_0x9037('0xc')][_0x9037('0x7')](this),this[_0x9037('0x8')][_0x9037('0x7')](this));};Agent[_0x9037('0xd')][_0x9037('0xb')]=function(){this[_0x9037('0x8')](!![]);};Agent[_0x9037('0xd')]['handleRun']=function(_0x172cf9){logger[_0x9037('0xe')](_0x9037('0xf'),this[_0x9037('0x4')]['id'],this[_0x9037('0x5')]['id']);if(_[_0x9037('0x10')](this[_0x9037('0x11')]['agents'][this[_0x9037('0x5')]['id']])){logger[_0x9037('0xe')](_0x9037('0x12'),this[_0x9037('0x4')]['id'],this[_0x9037('0x5')]['id']);setTimeout(this[_0x9037('0x6')][_0x9037('0x7')](this),0x3e8);}else{if(this['routing'][_0x9037('0x13')]||util[_0x9037('0x14')](this[_0x9037('0x4')]['id'],this['realtime'][_0x9037('0x15')][this[_0x9037('0x5')]['id']],this[_0x9037('0x4')]['channel'],![])){this[_0x9037('0x11')]['agents'][this['agent']['id']][_0x9037('0x16')]=!![];this[_0x9037('0x11')][_0x9037('0x15')][this[_0x9037('0x5')]['id']][_0x9037('0x17')]=undefined;util['showNotification'](this['notificationId'],this['squeue']['id'],this[_0x9037('0x11')][_0x9037('0x15')][this[_0x9037('0x5')]['id']],null,this['routing']);util[_0x9037('0x18')](this['squeue']['id'],this['realtime'][_0x9037('0x15')][this[_0x9037('0x5')]['id']],_0x9037('0x19')+(this[_0x9037('0x2')][_0x9037('0x13')]?':FORCED':''));}else{logger[_0x9037('0xe')](_0x9037('0x1a'),this[_0x9037('0x4')]['id'],this[_0x9037('0x5')]['id']);setTimeout(this['push'][_0x9037('0x7')](this),0x3e8);}}};Agent['prototype'][_0x9037('0x8')]=function(_0x30a4c3){if(_['isNil'](this[_0x9037('0x11')][_0x9037('0x15')][this[_0x9037('0x5')]['id']])){return logger[_0x9037('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x9037('0x4')]['id'],this[_0x9037('0x5')]['id']);}else{logger['info'](_0x9037('0x1b'),this[_0x9037('0x4')]['id'],this[_0x9037('0x5')]['id']);util[_0x9037('0x1c')](this['notificationId'],this['squeue']['id'],this[_0x9037('0x11')]['agents'][this[_0x9037('0x5')]['id']],null,this[_0x9037('0x2')]);this['realtime'][_0x9037('0x15')][this[_0x9037('0x5')]['id']][_0x9037('0x16')]=![];this[_0x9037('0x11')][_0x9037('0x15')][this['agent']['id']][_0x9037('0x17')]=undefined;util[_0x9037('0x18')](this[_0x9037('0x4')]['id'],this[_0x9037('0x11')][_0x9037('0x15')][this['agent']['id']],_0x30a4c3?'STOP':_0x9037('0x1d'));}if(!_0x30a4c3){setTimeout(this[_0x9037('0x6')][_0x9037('0x7')](this),0x3e8);}};function agent(_0x25d9cb,_0x5f1b0f,_0x218128,_0x5d2f75){return new Agent(_0x25d9cb,_0x5f1b0f,_0x218128,_0x5d2f75);}module[_0x9037('0x1e')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 5012963..087c110 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 _0x536e=['exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','timeout','handleTimeout','drained','prototype','push','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','TIMEOUT'];(function(_0xa158b,_0x20318a){var _0x314d0b=function(_0x368495){while(--_0x368495){_0xa158b['push'](_0xa158b['shift']());}};_0x314d0b(++_0x20318a);}(_0x536e,0x155));var _0xe536=function(_0x4ddef8,_0x3c78fe){_0x4ddef8=_0x4ddef8-0x0;var _0x456403=_0x536e[_0x4ddef8];return _0x456403;};'use strict';var _=require(_0xe536('0x0'));var uuid=require(_0xe536('0x1'));var util=require(_0xe536('0x2'));var logger=require(_0xe536('0x3'))(_0xe536('0x4'));var Beepall=function(_0xacd429,_0x42805f,_0x181c14,_0x26d7cb){this[_0xe536('0x5')]=uuid['v4']();this[_0xe536('0x6')]=_0xacd429;this[_0xe536('0x7')]=_0x42805f;this[_0xe536('0x8')]=_0x181c14;this[_0xe536('0x4')]=_0x26d7cb;this['squeue']['push'](this[_0xe536('0x9')][_0xe536('0xa')](this),this['handleTimeout'][_0xe536('0xa')](this));this[_0xe536('0x6')]['on'](_0xe536('0xb'),this[_0xe536('0xc')][_0xe536('0xa')](this));this[_0xe536('0x6')]['on'](_0xe536('0xd'),this['handleDrained']['bind'](this));};Beepall[_0xe536('0xe')][_0xe536('0xf')]=function(){this['squeue'][_0xe536('0xf')](this[_0xe536('0x9')][_0xe536('0xa')](this),this[_0xe536('0xc')][_0xe536('0xa')](this));};Beepall[_0xe536('0xe')]['handleDrained']=function(_0xb47818){this[_0xe536('0xc')](!![]);};Beepall[_0xe536('0xe')][_0xe536('0x9')]=function(_0x349020){var _0x4a6400=!![];if(!_[_0xe536('0x10')](this[_0xe536('0x7')])&&!_[_0xe536('0x10')](this['queue'][_0xe536('0x11')])&&this[_0xe536('0x7')][_0xe536('0x11')][_0xe536('0x12')]>0x0){for(var _0x4cf519=0x0,_0x49432f;_0x4cf5190x0){for(var _0x3d1619=0x0,_0x2f0c7d;_0x3d16190x0&&_0x390464[_0x1ddd54+_0x72a0('0x25')]>=_0x390464[_0x1ddd54+_0x72a0('0x24')]){writeLog(_0x38a7ba,_0x390464,_0x1ddd54[_0x72a0('0x26')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x72a0('0x27')]=function(_0x553641,_0xc22d18,_0x2928f6,_0x1773ea,_0x177a3a){return sendNotification(!![],_0x553641,_0xc22d18,_0x2928f6,_0x1773ea,_0x177a3a);};exports[_0x72a0('0x28')]=function(_0x12eda2,_0x23c96a,_0x916733,_0x4ba037,_0x41efc1){return sendNotification(![],_0x12eda2,_0x23c96a,_0x916733,_0x4ba037,_0x41efc1);};exports[_0x72a0('0x29')]=writeLog; \ No newline at end of file +var _0xafc4=['notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','localhost','socket.io-emitter','redis','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','emit'];(function(_0x3cdabc,_0x265158){var _0x34f5c0=function(_0xa78041){while(--_0xa78041){_0x3cdabc['push'](_0x3cdabc['shift']());}};_0x34f5c0(++_0x265158);}(_0xafc4,0x69));var _0x4afc=function(_0x70235a,_0x108220){_0x70235a=_0x70235a-0x0;var _0x5e7984=_0xafc4[_0x70235a];return _0x5e7984;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var utils=require(_0x4afc('0x1'));var Mustache=require('mustache');var Redis=require(_0x4afc('0x2'));var config=require(_0x4afc('0x3'));var logger=require(_0x4afc('0x4'))(_0x4afc('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x4afc('0x6'),'port':0x18eb});var io=require(_0x4afc('0x7'))(new Redis(config[_0x4afc('0x8')]));function emit(_0x1bb281,_0xc828d9,_0xaf053d){io['to'](_0x1bb281)['emit'](_0xc828d9,_0xaf053d);}function sendNotification(_0x31e165,_0x1c740c,_0x134aad,_0x1e6bf5,_0x1b8981,_0x458fde){io['to'](util['format']('user:%s',_0x1e6bf5[_0x4afc('0x9')]))['emit'](_0x4afc('0xa'),_0x1e6bf5);var _0x225793=_0x458fde||{};var _0x49b56f=_0x134aad[_0x4afc('0xb')]('.');var _0x3fb54a={'uniqueid':_0x1c740c,'channel':_0x49b56f[0x0],'id':_0x49b56f[0x1],'title':_0x49b56f[0x0]+_0x4afc('0xc'),'interactionId':_0x49b56f[0x2],'queue':_0x1b8981?_0x1b8981[_0x4afc('0x9')]:null,'sound':_0x225793[_0x4afc('0xd')][_0x4afc('0xe')],'shake':_0x225793[_0x4afc('0xd')][_0x4afc('0xf')]};try{if(!_0x225793['body']){_0x225793[_0x4afc('0x10')]={};}if(_0x1b8981){_0x225793[_0x4afc('0x10')][_0x4afc('0x11')]=_0x1b8981;}else if(_0x225793[_0x4afc('0x10')]['queue']){delete _0x225793['body'][_0x4afc('0x11')];}_0x3fb54a['msg']=utils[_0x4afc('0x12')](_0x225793[_0x4afc('0xd')][_0x4afc('0x13')],_0x225793);}catch(_0x31eec4){_0x3fb54a[_0x4afc('0x14')]=_0x4afc('0x15');logger[_0x4afc('0x16')](util[_0x4afc('0x17')](_0x4afc('0x18'),_0x1c740c,_0x31eec4[_0x4afc('0x19')]));}io['to'](util[_0x4afc('0x17')]('user:%s',_0x1e6bf5[_0x4afc('0x9')]))[_0x4afc('0x1a')](util[_0x4afc('0x17')](_0x4afc('0x1b'),_0x31e165?'save':_0x4afc('0x1c')),_0x3fb54a);}function writeLog(_0x30eda3,_0x2de6e9,_0x280587){return logger[_0x4afc('0x1d')](util[_0x4afc('0x17')](_0x4afc('0x1e'),_0x30eda3,_0x2de6e9['name'],_0x280587));}exports[_0x4afc('0x1f')]=function(_0x3ecf2d,_0x57f37c,_0x37debf,_0x4e9a48){if(_0x57f37c[_0x4afc('0x20')]){writeLog(_0x3ecf2d,_0x57f37c,_0x4afc('0x21'));return![];}if(!_0x57f37c[_0x4afc('0x22')]){writeLog(_0x3ecf2d,_0x57f37c,_0x4afc('0x23'));return![];}if(_0x57f37c[_0x37debf+_0x4afc('0x24')]){writeLog(_0x3ecf2d,_0x57f37c,_0x4afc('0x25'));return![];}if(_0x4e9a48&&_0x57f37c[_0x4afc('0x26')](_0x37debf+_0x4afc('0x27'))&&_0x57f37c[_0x4afc('0x26')](_0x37debf+_0x4afc('0x28'))){if(_0x57f37c[_0x37debf+_0x4afc('0x27')]>0x0&&_0x57f37c[_0x37debf+_0x4afc('0x28')]>=_0x57f37c[_0x37debf+_0x4afc('0x27')]){writeLog(_0x3ecf2d,_0x57f37c,_0x37debf['toUpperCase']()+_0x4afc('0x29'));return![];}}return!![];};exports[_0x4afc('0x2a')]=function(_0x2d6112,_0x4e254d,_0x52212d,_0x54433f,_0x426e9d){return sendNotification(!![],_0x2d6112,_0x4e254d,_0x52212d,_0x54433f,_0x426e9d);};exports[_0x4afc('0x2b')]=function(_0x5e4747,_0xd26d2f,_0x628e42,_0x494fe7,_0x514278){return sendNotification(![],_0x5e4747,_0xd26d2f,_0x628e42,_0x494fe7,_0x514278);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 2f4d9a0..1382a1c 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 _0xdbf9=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','map','message','join','info'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0xdbf9,0x146));var _0x9dbf=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xdbf9[_0x2b10c6];return _0x3789d2;};'use strict';var schema=require(_0x9dbf('0x0'));var sh=require('shelljs');var _=require(_0x9dbf('0x1'));var utils=require(_0x9dbf('0x2'));var logger=require(_0x9dbf('0x3'))(_0x9dbf('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x9dbf('0x5')}});exports['consequence']=function(_0x210833,_0x358d41){return function(_0x420321){try{var _0x3be0e2={'command':_0x358d41[0x0]};var _0x5bd66c=system[_0x9dbf('0x0')](_0x3be0e2,{'typecast':!![]});if(_0x5bd66c['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x210833,_[_0x9dbf('0x6')](_0x5bd66c,_0x9dbf('0x7'))[_0x9dbf('0x8')](',\x20'));logger[_0x9dbf('0x9')](_0x9dbf('0xa'),_0x210833);_0x420321[_0x9dbf('0xb')]();}else{var _0x478312=this;var _0x5f5bc1=utils[_0x9dbf('0xc')](_0x358d41[0x0],this);logger[_0x9dbf('0x9')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x210833,_0x5f5bc1);sh['exec'](_['trim'](_0x5f5bc1),function(_0x404916,_0x1edead){logger[_0x9dbf('0x9')](_0x9dbf('0xd'),_0x210833,_0x404916);if(_0x404916==0x0){var _0x462755=_0x1edead['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x9dbf('0xe')](_0x358d41[0x1])||_[_0x9dbf('0xf')](_0x358d41[0x1])){logger['info'](_0x9dbf('0x10'),_0x210833);_0x478312[_0x9dbf('0x11')][_0x358d41[0x1]]=_0x462755;}else{logger['info'](_0x9dbf('0x12'),_0x210833,_0x358d41[0x1],_0x462755);_0x478312[_0x9dbf('0x11')][_0x358d41[0x1]]=_0x462755;}}_0x420321['next']();});}}catch(_0x1f65d2){logger['error']('[%s][SYSTEM]\x20%s',_0x210833,_[_0x9dbf('0x13')](_0x1f65d2)?JSON[_0x9dbf('0x14')](_0x1f65d2):_0x1f65d2);logger[_0x9dbf('0x9')](_0x9dbf('0xa'),_0x210833);_0x420321[_0x9dbf('0xb')]();}};}; \ No newline at end of file +var _0x7079=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x4196fc,_0x178761){var _0x4b67f5=function(_0x4e1ede){while(--_0x4e1ede){_0x4196fc['push'](_0x4196fc['shift']());}};_0x4b67f5(++_0x178761);}(_0x7079,0x68));var _0x9707=function(_0x17b869,_0x120b3a){_0x17b869=_0x17b869-0x0;var _0x5d437e=_0x7079[_0x17b869];return _0x5d437e;};'use strict';var schema=require(_0x9707('0x0'));var sh=require(_0x9707('0x1'));var _=require('lodash');var utils=require(_0x9707('0x2'));var logger=require(_0x9707('0x3'))('routing');var system=schema({'command':{'type':_0x9707('0x4'),'required':!![],'message':_0x9707('0x5')}});exports[_0x9707('0x6')]=function(_0x49896c,_0x1f11c8){return function(_0x223a40){try{var _0x4dcb1b={'command':_0x1f11c8[0x0]};var _0x2c7b04=system[_0x9707('0x0')](_0x4dcb1b,{'typecast':!![]});if(_0x2c7b04[_0x9707('0x7')]){logger[_0x9707('0x8')](_0x9707('0x9'),_0x49896c,_[_0x9707('0xa')](_0x2c7b04,'message')['join'](',\x20'));logger[_0x9707('0xb')](_0x9707('0xc'),_0x49896c);_0x223a40[_0x9707('0xd')]();}else{var _0x1d276f=this;var _0x460e9f=utils[_0x9707('0xe')](_0x1f11c8[0x0],this);logger[_0x9707('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x49896c,_0x460e9f);sh[_0x9707('0xf')](_['trim'](_0x460e9f),function(_0x5cab5f,_0x306591){logger[_0x9707('0xb')](_0x9707('0x10'),_0x49896c,_0x5cab5f);if(_0x5cab5f==0x0){var _0x3a845a=_0x306591['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x9707('0x11')](_0x1f11c8[0x1])||_['isEmpty'](_0x1f11c8[0x1])){logger[_0x9707('0xb')](_0x9707('0x12'),_0x49896c);_0x1d276f[_0x9707('0x13')][_0x1f11c8[0x1]]=_0x3a845a;}else{logger['info'](_0x9707('0x14'),_0x49896c,_0x1f11c8[0x1],_0x3a845a);_0x1d276f['body'][_0x1f11c8[0x1]]=_0x3a845a;}}_0x223a40[_0x9707('0xd')]();});}}catch(_0x44c3e7){logger[_0x9707('0x8')]('[%s][SYSTEM]\x20%s',_0x49896c,_[_0x9707('0x15')](_0x44c3e7)?JSON[_0x9707('0x16')](_0x44c3e7):_0x44c3e7);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x49896c);_0x223a40[_0x9707('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 88d3875..fca1579 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 _0x825b=['validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','consequence','length','error','[%s][TAG]\x20%s','map','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','finally','next','stringify'];(function(_0x2ce9c3,_0x20a165){var _0x109b3a=function(_0xfd90e2){while(--_0xfd90e2){_0x2ce9c3['push'](_0x2ce9c3['shift']());}};_0x109b3a(++_0x20a165);}(_0x825b,0xfa));var _0xb825=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x825b[_0x4b73a2];return _0x383c66;};'use strict';var schema=require(_0xb825('0x0'));var _=require(_0xb825('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb825('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb825('0x3')),'faxInteraction':require(_0xb825('0x4')),'whatsappInteraction':require(_0xb825('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xb825('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb825('0x7')]=function(_0x3ed0a0,_0x5478ea,_0x2f0572,_0x32eebb){return function(_0x23c0c8){try{var _0x28a6a9={'tag':_0x5478ea[0x0]};var _0x2a08c7=tag['validate'](_0x28a6a9,{'typecast':!![]});if(_0x2a08c7[_0xb825('0x8')]){logger[_0xb825('0x9')](_0xb825('0xa'),_0x3ed0a0,_[_0xb825('0xb')](_0x2a08c7,'message')[_0xb825('0xc')](',\x20'));logger[_0xb825('0xd')](_0xb825('0xe'),_0x3ed0a0);_0x23c0c8['next']();}else{var _0x5769d9={'ids':[_0x5478ea[0x0]]};if(rpc[_0x32eebb[_0xb825('0xf')]+_0xb825('0x10')]){rpc[_0x32eebb[_0xb825('0xf')]+_0xb825('0x10')][_0xb825('0x11')](_0x32eebb[_0xb825('0x12')]['id'],_0x5769d9)[_0xb825('0x13')](function(_0x1ed879){logger[_0xb825('0xd')](_0xb825('0x14'),_0x3ed0a0,_0x5478ea[0x1],_0x32eebb[_0xb825('0xf')],_0x32eebb[_0xb825('0x12')]['id']);})[_0xb825('0x15')](function(_0xe87849){logger[_0xb825('0x9')](_0xb825('0xa'),_0x3ed0a0,JSON['stringify'](_0xe87849));logger[_0xb825('0xd')](_0xb825('0xe'),_0x3ed0a0);})[_0xb825('0x16')](function(){_0x23c0c8[_0xb825('0x17')]();});}}}catch(_0x2fd236){logger[_0xb825('0x9')](_0xb825('0xa'),_0x3ed0a0,_['isObject'](_0x2fd236)?JSON[_0xb825('0x18')](_0x2fd236):_0x2fd236);logger[_0xb825('0xd')](_0xb825('0xe'),_0x3ed0a0);_0x23c0c8[_0xb825('0x17')]();}};}; \ No newline at end of file +var _0x8836=['isObject','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','info','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x8836,0x1e7));var _0x6883=function(_0x3da480,_0x3327e0){_0x3da480=_0x3da480-0x0;var _0xda3942=_0x8836[_0x3da480];return _0xda3942;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x6883('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6883('0x1')),'mailInteraction':require(_0x6883('0x2')),'faxInteraction':require(_0x6883('0x3')),'whatsappInteraction':require(_0x6883('0x4'))};var logger=require(_0x6883('0x5'))(_0x6883('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x6883('0x7')}});exports[_0x6883('0x8')]=function(_0x44f520,_0x1e942f,_0x3b2d75,_0x39e1be){return function(_0x286bfa){try{var _0x2b9acf={'tag':_0x1e942f[0x0]};var _0x3ebfda=tag[_0x6883('0x9')](_0x2b9acf,{'typecast':!![]});if(_0x3ebfda[_0x6883('0xa')]){logger[_0x6883('0xb')](_0x6883('0xc'),_0x44f520,_[_0x6883('0xd')](_0x3ebfda,_0x6883('0xe'))['join'](',\x20'));logger[_0x6883('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x44f520);_0x286bfa[_0x6883('0x10')]();}else{var _0x4496be={'ids':[_0x1e942f[0x0]]};if(rpc[_0x39e1be[_0x6883('0x11')]+_0x6883('0x12')]){rpc[_0x39e1be[_0x6883('0x11')]+_0x6883('0x12')][_0x6883('0x13')](_0x39e1be[_0x6883('0x14')]['id'],_0x4496be)[_0x6883('0x15')](function(_0x5c8442){logger[_0x6883('0xf')](_0x6883('0x16'),_0x44f520,_0x1e942f[0x1],_0x39e1be['channel'],_0x39e1be[_0x6883('0x14')]['id']);})['catch'](function(_0x6bea10){logger[_0x6883('0xb')](_0x6883('0xc'),_0x44f520,JSON[_0x6883('0x17')](_0x6bea10));logger[_0x6883('0xf')](_0x6883('0x18'),_0x44f520);})[_0x6883('0x19')](function(){_0x286bfa[_0x6883('0x10')]();});}}}catch(_0x536c84){logger[_0x6883('0xb')](_0x6883('0xc'),_0x44f520,_[_0x6883('0x1a')](_0x536c84)?JSON[_0x6883('0x17')](_0x536c84):_0x536c84);logger[_0x6883('0xf')](_0x6883('0x18'),_0x44f520);_0x286bfa[_0x6883('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index bf88929..f2ea7a6 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ab9=['consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','2.0','method','login','params','stringify','POST','application/json-rpc','then','parse','result','channelId=','&serviceId=','&sessionId=','info','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x8ab9,0x1de));var _0x98ab=function(_0x3f7da9,_0x4db255){_0x3f7da9=_0x3f7da9-0x0;var _0x13d49e=_0x8ab9[_0x3f7da9];return _0x13d49e;};'use strict';var rp=require(_0x98ab('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x98ab('0x1'));var arr=[];exports[_0x98ab('0x2')]=function(_0x71ff54,_0x55956f){return function(_0x88a7bc){var _0x29a7af=_0x55956f[0xa];var _0x17adeb=_0x55956f[0xb];var _0xde6ac3=_0x55956f[0xc];var _0x3c8cb3=_0x55956f[0xd];var _0x3423ca=_0x55956f[0xe];var _0x43bef2=_0x55956f[0xf]['replace'](/\n/g,_0x98ab('0x3'));var _0x1c5705=_0x55956f[0x10][_0x98ab('0x4')](/\n/g,'\x20');if(!arr[_0x98ab('0x5')](_0x17adeb)){arr[_0x98ab('0x6')](_0x17adeb);var _0x34cb54=_0x55956f[0x3];var _0x51f044=_0x55956f[0x4];var _0x4cc98f=_0x55956f[0x1];var _0x3abb9c=_0x55956f[0x0];var _0x186cdd={};_0x186cdd[_0x98ab('0x7')]=_0x55956f[0x8]+_0x98ab('0x8')+_0xde6ac3+'|'+_0x29a7af+'|'+_0x3c8cb3+'|'+_0x17adeb+'|'+_0x3423ca;_0x186cdd[_0x98ab('0x9')]=_0x55956f[0x7]+'?params='+_0xde6ac3+'|'+_0x29a7af+'|'+_0x3c8cb3+'|'+_0x17adeb+'|'+_0x3423ca+'|'+_0x43bef2+'|'+_0x1c5705;_0x186cdd['title']=_0x55956f[0x9];var _0x4e8d8a={};_0x4e8d8a['jsonrpc']=_0x98ab('0xa');_0x4e8d8a[_0x98ab('0xb')]=_0x98ab('0xc');var _0x48b369=[];_0x48b369[_0x98ab('0x6')](_0x55956f[0x2]);_0x48b369['push'](_0x55956f[0x5]);_0x48b369[_0x98ab('0x6')](_0x55956f[0x6]);_0x4e8d8a[_0x98ab('0xd')]=_0x48b369;_0x4e8d8a['id']=0x1;var _0x4fdd4f=JSON[_0x98ab('0xe')](_0x4e8d8a);var _0x25f326={'encoding':'utf8','method':_0x98ab('0xf'),'timeout':0x2710,'url':_0x34cb54,'headers':{'Content-Type':_0x98ab('0x10')},'body':_0x4fdd4f};return rp(_0x25f326)[_0x98ab('0x11')](function(_0x3cb730){const _0x257918=JSON[_0x98ab('0x12')](_0x3cb730);if(!_0x257918[_0x98ab('0x13')]['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1a76d9=_0x17adeb;var _0x4c29df=_0x98ab('0x14')+_0x4cc98f+_0x98ab('0x15')+_0x3abb9c+_0x98ab('0x16')+_0x1a76d9+'&data='+JSON[_0x98ab('0xe')](_0x186cdd);var _0x23a371=_0x51f044+'?'+_0x4c29df;return rp(_0x23a371);})['then'](function(_0x3afee5){logger[_0x98ab('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x71ff54,_0x3afee5);_0x88a7bc[_0x98ab('0x18')]();})['catch'](function(_0x14b845){logger[_0x98ab('0x19')](_0x98ab('0x1a'),_0x71ff54,_[_0x98ab('0x1b')](_0x14b845)?JSON[_0x98ab('0xe')](_0x14b845):_0x14b845);_0x88a7bc[_0x98ab('0x18')]();});}else{logger[_0x98ab('0x17')](_0x98ab('0x1c'),_0x71ff54);_0x88a7bc[_0x98ab('0x1d')]();}};}; \ No newline at end of file +var _0x4ed1=['jsonrpc','2.0','method','params','utf8','POST','application/json-rpc','parse','logged','channelId=','&serviceId=','&sessionId=','&data=','stringify','then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','includes','push','?params=','urlOnRing','title'];(function(_0x252ef4,_0x5094f5){var _0x35bd84=function(_0x1ecab9){while(--_0x1ecab9){_0x252ef4['push'](_0x252ef4['shift']());}};_0x35bd84(++_0x5094f5);}(_0x4ed1,0x9f));var _0x14ed=function(_0x1382e6,_0x102059){_0x1382e6=_0x1382e6-0x0;var _0x8c49b0=_0x4ed1[_0x1382e6];return _0x8c49b0;};'use strict';var rp=require(_0x14ed('0x0'));var logger=require(_0x14ed('0x1'))(_0x14ed('0x2'));var _=require(_0x14ed('0x3'));var arr=[];exports[_0x14ed('0x4')]=function(_0x55b43b,_0x3732db){return function(_0x3f445c){var _0x38377c=_0x3732db[0xa];var _0x50bb18=_0x3732db[0xb];var _0x49fbfe=_0x3732db[0xc];var _0x1be614=_0x3732db[0xd];var _0x4e03d0=_0x3732db[0xe];var _0x4aa674=_0x3732db[0xf][_0x14ed('0x5')](/\n/g,'\x20-\x20');var _0x468dda=_0x3732db[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x14ed('0x6')](_0x50bb18)){arr[_0x14ed('0x7')](_0x50bb18);var _0xec3421=_0x3732db[0x3];var _0x532a47=_0x3732db[0x4];var _0x5543dc=_0x3732db[0x1];var _0x47cdd8=_0x3732db[0x0];var _0x520046={};_0x520046['urlOnAnswer']=_0x3732db[0x8]+_0x14ed('0x8')+_0x49fbfe+'|'+_0x38377c+'|'+_0x1be614+'|'+_0x50bb18+'|'+_0x4e03d0;_0x520046[_0x14ed('0x9')]=_0x3732db[0x7]+_0x14ed('0x8')+_0x49fbfe+'|'+_0x38377c+'|'+_0x1be614+'|'+_0x50bb18+'|'+_0x4e03d0+'|'+_0x4aa674+'|'+_0x468dda;_0x520046[_0x14ed('0xa')]=_0x3732db[0x9];var _0x515399={};_0x515399[_0x14ed('0xb')]=_0x14ed('0xc');_0x515399[_0x14ed('0xd')]='login';var _0x775a0e=[];_0x775a0e[_0x14ed('0x7')](_0x3732db[0x2]);_0x775a0e[_0x14ed('0x7')](_0x3732db[0x5]);_0x775a0e[_0x14ed('0x7')](_0x3732db[0x6]);_0x515399[_0x14ed('0xe')]=_0x775a0e;_0x515399['id']=0x1;var _0x36de99=JSON['stringify'](_0x515399);var _0x1a4e03={'encoding':_0x14ed('0xf'),'method':_0x14ed('0x10'),'timeout':0x2710,'url':_0xec3421,'headers':{'Content-Type':_0x14ed('0x11')},'body':_0x36de99};return rp(_0x1a4e03)['then'](function(_0x10d3a4){const _0x1d430d=JSON[_0x14ed('0x12')](_0x10d3a4);if(!_0x1d430d['result'][_0x14ed('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1c2c8f=_0x50bb18;var _0x44f6f5=_0x14ed('0x14')+_0x5543dc+_0x14ed('0x15')+_0x47cdd8+_0x14ed('0x16')+_0x1c2c8f+_0x14ed('0x17')+JSON[_0x14ed('0x18')](_0x520046);var _0x4802d8=_0x532a47+'?'+_0x44f6f5;return rp(_0x4802d8);})[_0x14ed('0x19')](function(_0x65ab74){logger['info'](_0x14ed('0x1a'),_0x55b43b,_0x65ab74);_0x3f445c[_0x14ed('0x1b')]();})[_0x14ed('0x1c')](function(_0x21cd14){logger[_0x14ed('0x1d')]('[%s][TVOX]\x20%s',_0x55b43b,_[_0x14ed('0x1e')](_0x21cd14)?JSON['stringify'](_0x21cd14):_0x21cd14);_0x3f445c[_0x14ed('0x1b')]();});}else{logger[_0x14ed('0x1f')](_0x14ed('0x20'),_0x55b43b);_0x3f445c[_0x14ed('0x21')]();}};}; \ 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 1de8876..68feb7f 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x25af4f,_0x4f6aa9){var _0xc87d41=function(_0x2d81cb){while(--_0x2d81cb){_0x25af4f['push'](_0x25af4f['shift']());}};_0xc87d41(++_0x4f6aa9);}(_0xe706,0xa3));var _0x6e70=function(_0x3fe966,_0x552df7){_0x3fe966=_0x3fe966-0x0;var _0x139983=_0xe706[_0x3fe966];return _0x139983;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4ca6b1,_0x2ebdbf){var _0x4ab9c0=function(_0x21b17b){while(--_0x21b17b){_0x4ca6b1['push'](_0x4ca6b1['shift']());}};_0x4ab9c0(++_0x2ebdbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 d185d3c..f2bf2ce 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 _0xd547=['applications','existsSync','app','.js','toLowerCase','autoreply','mail','push','slice','join','dialogflow','appdata','split','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','body','format','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','name','mailQueues','paused','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','path','jayson/promise','bluebird','uuid','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','channel','message','interaction','isArray','length'];(function(_0x3fae59,_0x3e750e){var _0x38e268=function(_0x525fed){while(--_0x525fed){_0x3fae59['push'](_0x3fae59['shift']());}};_0x38e268(++_0x3e750e);}(_0xd547,0x1c1));var _0x7d54=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0xd547[_0xf35bc1];return _0xa6b162;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x7d54('0x0'));var fs=require('fs');var jayson=require(_0x7d54('0x1'));var BPromise=require(_0x7d54('0x2'));var uuid=require(_0x7d54('0x3'));var utils=require('./applications/utils');var config=require('../../../config/environment');var logger=require(_0x7d54('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0x7d54('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x7d54('0x6')),'smsQueueReport':require(_0x7d54('0x7')),'faxQueueReport':require(_0x7d54('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x478f9b,_0xb224a9,_0x39885d){return util['format'](_0x7d54('0x9'),_0x478f9b,_0xb224a9||0x0,_0x39885d||0x0);}function getIntervals(_0x48b250,_0x2bede6){var _0x4d9dc3=[];if(!_[_0x7d54('0xa')](_0x2bede6['IntervalId'])&&!_[_0x7d54('0xa')](_0x48b250[_0x2bede6[_0x7d54('0xb')]])&&!_['isNil'](_0x48b250[_0x2bede6['IntervalId']]['Intervals'])){_0x4d9dc3=_[_0x7d54('0xc')](_0x48b250[_0x2bede6[_0x7d54('0xb')]][_0x7d54('0xd')],'interval');}else if(!_[_0x7d54('0xa')](_0x2bede6['interval'])){_0x4d9dc3=[_0x2bede6[_0x7d54('0xe')]];}return _0x4d9dc3;}exports['listen']=function(_0x11c94a){_0x11c94a[_0x7d54('0xf')]={};return new BPromise(function(_0x4bc96e,_0x268b0c){var _0x208b3c={'Start':function(_0x25b69c){var _0x5a6bec=this;return new Promise(function(_0x2b1b0f,_0x33a519){if(_0x25b69c){try{var _0x2b13d5=[];var _0x12c48d=getId(_0x25b69c[_0x7d54('0x10')],_0x25b69c[_0x7d54('0x11')]?_0x25b69c['message']['id']:0x0,_0x25b69c[_0x7d54('0x12')]?_0x25b69c[_0x7d54('0x12')]['id']:0x0);if(_0x25b69c['applications']&&_[_0x7d54('0x13')](_0x25b69c['applications'])&&_0x25b69c['applications'][_0x7d54('0x14')]){for(var _0x4138f1=0x0;_0x4138f1<_0x25b69c[_0x7d54('0x15')][_0x7d54('0x14')];_0x4138f1+=0x1){var _0x54e783=_0x25b69c[_0x7d54('0x15')][_0x4138f1];if(fs[_0x7d54('0x16')](path['join'](__dirname,_0x7d54('0x15'),_0x54e783[_0x7d54('0x17')]+_0x7d54('0x18')))){var _0x6cc88b=[];switch(_0x54e783[_0x7d54('0x17')][_0x7d54('0x19')]()){case _0x7d54('0x1a'):var _0x4f3a94=_0x54e783['appdata']['split'](',');if(_0x25b69c[_0x7d54('0x10')]===_0x7d54('0x1b')){_0x6cc88b['push'](_0x4f3a94[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[_0x7d54('0x1d')](0x2,_0x4f3a94[_0x7d54('0x14')])[_0x7d54('0x1e')](','));}else{_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x4f3a94[_0x7d54('0x1d')](0x1,_0x4f3a94['length'])[_0x7d54('0x1e')](','));}break;case _0x7d54('0x1f'):var _0x5117a4=_0x54e783['appdata']['split'](',');_0x6cc88b['push'](_0x5117a4[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x5117a4[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x5117a4['slice'](0x2,_0x5117a4[_0x7d54('0x14')])[_0x7d54('0x1e')](','));break;case'dialogflowv2':var _0x472032=_0x54e783[_0x7d54('0x20')][_0x7d54('0x21')](',');_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x2]);_0x6cc88b[_0x7d54('0x1c')](_0x472032[0x3]);_0x6cc88b[_0x7d54('0x1c')](_0x472032['slice'](0x4,_0x472032[_0x7d54('0x14')])['join'](','));break;case'amazonlex':var _0x2602c2=_0x54e783[_0x7d54('0x20')]['split'](',');_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x2]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[0x3]);_0x6cc88b[_0x7d54('0x1c')](_0x2602c2[_0x7d54('0x1d')](0x4,_0x2602c2[_0x7d54('0x14')])['join'](','));break;case _0x7d54('0x11'):_0x6cc88b[_0x7d54('0x1c')](_0x54e783['appdata']);break;case _0x7d54('0x22'):_0x6cc88b[_0x7d54('0x1c')](_0x54e783[_0x7d54('0x23')]);_0x6cc88b['push'](_0x54e783[_0x7d54('0x20')]);break;case _0x7d54('0x24'):var _0x266d0d=utils[_0x7d54('0x25')](_0x25b69c[_0x7d54('0x26')]['notificationTemplate'],_0x25b69c);var _0x4560d9=_0x54e783[_0x7d54('0x20')]['split'](',');_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x0]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x1]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x2]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x3]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x4]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x5]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x6]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x7]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x8]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0x9]);_0x6cc88b[_0x7d54('0x1c')](_0x4560d9[0xa]);_0x6cc88b[_0x7d54('0x1c')](_0x25b69c['interaction']['id']);_0x6cc88b['push'](_0x25b69c[_0x7d54('0x11')]['id']);_0x6cc88b[_0x7d54('0x1c')](_0x54e783[_0x7d54('0x27')]);_0x6cc88b[_0x7d54('0x1c')](_0x25b69c['interaction']['ContactId']);_0x6cc88b[_0x7d54('0x1c')](_0x25b69c['body'][_0x7d54('0x28')]);_0x6cc88b[_0x7d54('0x1c')](_0x266d0d);break;default:_0x6cc88b=_['isNil'](_0x54e783['appdata'])?[]:_0x54e783[_0x7d54('0x20')][_0x7d54('0x21')](',');}var _0x57203d={'id':util[_0x7d54('0x29')](_0x7d54('0x2a'),_0x12c48d,_0x54e783['id'],_0x54e783['app']),'condition':require('./interval')[_0x7d54('0x2b')](_0x12c48d,getIntervals(_0x11c94a[_0x7d54('0x2c')],_0x54e783),_0x11c94a),'consequence':require(_0x7d54('0x2d')+_0x54e783[_0x7d54('0x17')])[_0x7d54('0x2e')](_0x12c48d,_0x6cc88b,_0x11c94a,_0x25b69c),'p':_0x54e783[_0x7d54('0x2f')]||0x0};logger[_0x7d54('0x30')](_0x7d54('0x31'),_0x57203d['id'],_0x7d54('0x32'),getIntervals(_0x11c94a[_0x7d54('0x2c')],_0x54e783)[_0x7d54('0x1e')]('\x20|\x20'));_0x2b13d5['push'](_0x57203d);}else{logger[_0x7d54('0x33')](_0x7d54('0x34'),path[_0x7d54('0x1e')](__dirname,_0x7d54('0x15'),_0x54e783[_0x7d54('0x17')]+_0x7d54('0x18')));}}_0x11c94a[_0x7d54('0xf')][_0x12c48d]=new RuleEngine(_0x2b13d5);_0x11c94a['rules'][_0x12c48d][_0x7d54('0x35')](_0x25b69c,function(_0x588360){logger['info'](_0x7d54('0x36'),JSON[_0x7d54('0x37')](_0x588360[_0x7d54('0x38')]));if(_0x11c94a[_0x7d54('0xf')][_0x12c48d]){_0x11c94a[_0x7d54('0xf')][_0x12c48d]['emit'](_0x7d54('0x39'));}});return _0x2b1b0f({'code':0xc8,'message':_0x25b69c});}else{logger[_0x7d54('0x30')]('No\x20applications\x20to\x20execute');return _0x2b1b0f({'code':0xc8,'message':_0x25b69c});}}catch(_0x18ea23){logger[_0x7d54('0x33')](_0x18ea23[_0x7d54('0x3a')]);return _0x33a519(_0x5a6bec[_0x7d54('0x33')](0x1f4,_0x18ea23));}}return _0x33a519(_0x7d54('0x3b'));});},'AcceptMessage':function(_0x3d6f39){var _0x5a2fcb=this;return new Promise(function(_0x4b6cd6,_0x403f9d){if(_0x3d6f39[_0x7d54('0x3c')]&&_0x3d6f39[_0x7d54('0x3c')]['id']){if(_0x11c94a[_0x7d54('0x3d')][_0x3d6f39[_0x7d54('0x3c')]['id']]){_0x11c94a[_0x7d54('0x3d')][_0x3d6f39['agent']['id']][_0x7d54('0x3e')]=![];_0x11c94a[_0x7d54('0x3d')][_0x3d6f39[_0x7d54('0x3c')]['id']][_0x7d54('0x3f')]=undefined;}}if(_0x3d6f39[_0x7d54('0x11')]&&_0x3d6f39['message']['id']){try{var _0x39094a=getId(_0x3d6f39['channel'],_0x3d6f39[_0x7d54('0x11')]?_0x3d6f39['message']['id']:0x0,_0x3d6f39['interaction']?_0x3d6f39[_0x7d54('0x12')]['id']:0x0);if(_0x11c94a['rules'][_0x39094a]){_0x11c94a['rules'][_0x39094a][_0x7d54('0x40')](_0x7d54('0x41'));if(rpc[_0x3d6f39['channel']+_0x7d54('0x42')]){rpc[_0x3d6f39[_0x7d54('0x10')]+_0x7d54('0x42')]['update'](_0x39094a,{'UserId':_0x3d6f39[_0x7d54('0x11')]['UserId']})[_0x7d54('0x43')](function(_0x1692e9){logger[_0x7d54('0x33')](_0x7d54('0x44'));});}}return _0x4b6cd6({'code':0xc8,'message':_0x3d6f39});}catch(_0x53de17){logger['error'](_0x53de17[_0x7d54('0x3a')]);return _0x403f9d(_0x5a2fcb[_0x7d54('0x33')](0x1f4,_0x53de17));}}logger[_0x7d54('0x33')](_0x7d54('0x45'));return _0x403f9d(_0x5a2fcb[_0x7d54('0x33')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x326bdb){var _0x33604c=this;return new Promise(function(_0x532e6c,_0x2e3e08){if(_0x326bdb[_0x7d54('0x3c')]&&_0x326bdb[_0x7d54('0x3c')]['id']){try{if(_0x11c94a[_0x7d54('0x3d')][_0x326bdb[_0x7d54('0x3c')]['id']]){_0x11c94a[_0x7d54('0x3d')][_0x326bdb[_0x7d54('0x3c')]['id']][_0x7d54('0x3e')]=![];_0x11c94a['agents'][_0x326bdb[_0x7d54('0x3c')]['id']][_0x7d54('0x3f')]=undefined;}return _0x532e6c({'code':0xc8,'message':_0x326bdb});}catch(_0x2938ac){logger['error'](_0x2938ac[_0x7d54('0x3a')]);return _0x2e3e08(_0x33604c[_0x7d54('0x33')](0x1f4,_0x2938ac));}}logger[_0x7d54('0x33')](_0x7d54('0x45'));return _0x2e3e08(_0x33604c['error'](0x1f4,_0x7d54('0x45')));});},'AbandonInteraction':function(_0x238210){var _0xe9db27=this;return new Promise(function(_0x55ee74,_0x5be8d3){if(_0x238210['channel']&&_0x238210['interaction']&&_0x238210[_0x7d54('0x12')]['id']){try{var _0x369c4a=getId(_0x238210[_0x7d54('0x10')],_0x238210[_0x7d54('0x11')]?_0x238210[_0x7d54('0x11')]['id']:0x0,_0x238210['interaction']?_0x238210['interaction']['id']:0x0);if(_0x11c94a['rules'][_0x369c4a]){_0x11c94a['rules'][_0x369c4a][_0x7d54('0x40')]('end');}return _0x55ee74({'code':0xc8,'message':_0x238210});}catch(_0x36a82a){logger['error'](_0x36a82a[_0x7d54('0x3a')]);return _0x5be8d3(_0xe9db27['error'](0x1f4,_0x36a82a));}}logger[_0x7d54('0x33')](_0x7d54('0x45'));return _0x5be8d3(_0xe9db27['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x519759){var _0x2b6dfb=this;return new Promise(function(_0x37bf9c,_0x4cccf1){if(_0x11c94a['agents'][_0x7d54('0x46')](_0x519759['id'])){for(var _0x21dcd7 in _0x519759[_0x7d54('0x47')]){if(_0x519759[_0x7d54('0x47')][_0x7d54('0x46')](_0x21dcd7)){if(_0x11c94a['agents'][_0x519759['id']][_0x7d54('0x46')](_0x21dcd7+'CurrentCapacity')){_0x11c94a['agents'][_0x519759['id']][_0x21dcd7+_0x7d54('0x48')]=parseInt(_0x519759[_0x7d54('0x47')][_0x21dcd7],0xa);}}}_0x11c94a[_0x7d54('0x3d')][_0x519759['id']][_0x7d54('0x49')]();return _0x37bf9c({'code':0xc8,'message':_0x11c94a[_0x7d54('0x3d')][_0x519759['id']]});}else{return _0x4cccf1(_0x2b6dfb['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x580664){return new Promise(function(_0x5a3cdb,_0x45d5f3){var _0x1a04b9=_['values'](_0x11c94a[_0x7d54('0x3d')]);_0x5a3cdb({'count':_0x1a04b9[_0x7d54('0x14')],'rows':_0x1a04b9});});},'ChatQueues':function(_0x5e78cc){return new Promise(function(_0x4b5f6f,_0x2c0f39){var _0x2a1ffa=[];for(var _0x37ae5e in _0x11c94a[_0x7d54('0x4a')]){if(_0x11c94a['chatQueues'][_0x7d54('0x46')](_0x37ae5e)){var _0x247d06=_0x11c94a[_0x7d54('0x4a')][_0x37ae5e];var _0xf45231={'id':_0x247d06['id'],'available':_0x247d06[_0x7d54('0x4b')],'loggedIn':_0x247d06[_0x7d54('0x4c')],'name':_0x247d06[_0x7d54('0x4d')],'paused':_0x247d06['paused'],'waiting':_0x247d06['waiting']};_0x2a1ffa[_0x7d54('0x1c')](_0xf45231);}}_0x4b5f6f({'count':_0x2a1ffa['length'],'rows':_0x2a1ffa});});},'MailQueues':function(_0x770d4d){return new Promise(function(_0x37d990,_0xc2b893){var _0x1b97da=[];for(var _0x3f0bdc in _0x11c94a[_0x7d54('0x4e')]){if(_0x11c94a['mailQueues'][_0x7d54('0x46')](_0x3f0bdc)){var _0x3abd4e=_0x11c94a[_0x7d54('0x4e')][_0x3f0bdc];var _0x2c4485={'id':_0x3abd4e['id'],'available':_0x3abd4e[_0x7d54('0x4b')],'loggedIn':_0x3abd4e[_0x7d54('0x4c')],'name':_0x3abd4e[_0x7d54('0x4d')],'paused':_0x3abd4e[_0x7d54('0x4f')],'waiting':_0x3abd4e['waiting']};_0x1b97da[_0x7d54('0x1c')](_0x2c4485);}}_0x37d990({'count':_0x1b97da[_0x7d54('0x14')],'rows':_0x1b97da});});},'OpenchannelQueues':function(_0x5b916d){return new Promise(function(_0x20bb3b,_0x28c5a0){var _0x49b9ae=[];for(var _0x562ff1 in _0x11c94a[_0x7d54('0x50')]){if(_0x11c94a['openchannelQueues']['hasOwnProperty'](_0x562ff1)){var _0xb70943=_0x11c94a[_0x7d54('0x50')][_0x562ff1];var _0x26c0ef={'id':_0xb70943['id'],'available':_0xb70943[_0x7d54('0x4b')],'loggedIn':_0xb70943[_0x7d54('0x4c')],'name':_0xb70943['name'],'paused':_0xb70943[_0x7d54('0x4f')],'waiting':_0xb70943[_0x7d54('0x51')]};_0x49b9ae[_0x7d54('0x1c')](_0x26c0ef);}}_0x20bb3b({'count':_0x49b9ae['length'],'rows':_0x49b9ae});});},'SmsQueues':function(_0x52baf0){return new Promise(function(_0x5306b3,_0xfd6137){var _0x4abf96=[];for(var _0x4cd995 in _0x11c94a[_0x7d54('0x52')]){if(_0x11c94a[_0x7d54('0x52')][_0x7d54('0x46')](_0x4cd995)){var _0x3276d9=_0x11c94a[_0x7d54('0x52')][_0x4cd995];var _0x1d5734={'id':_0x3276d9['id'],'available':_0x3276d9[_0x7d54('0x4b')],'loggedIn':_0x3276d9[_0x7d54('0x4c')],'name':_0x3276d9[_0x7d54('0x4d')],'paused':_0x3276d9['paused'],'waiting':_0x3276d9[_0x7d54('0x51')]};_0x4abf96[_0x7d54('0x1c')](_0x1d5734);}}_0x5306b3({'count':_0x4abf96[_0x7d54('0x14')],'rows':_0x4abf96});});},'FaxQueues':function(_0x1d631d){return new Promise(function(_0x80f9f2,_0x526990){var _0x5622fa=[];for(var _0x35029f in _0x11c94a['faxQueues']){if(_0x11c94a[_0x7d54('0x53')][_0x7d54('0x46')](_0x35029f)){var _0xfc06d7=_0x11c94a[_0x7d54('0x53')][_0x35029f];var _0x1c0268={'id':_0xfc06d7['id'],'available':_0xfc06d7[_0x7d54('0x4b')],'loggedIn':_0xfc06d7[_0x7d54('0x4c')],'name':_0xfc06d7[_0x7d54('0x4d')],'paused':_0xfc06d7[_0x7d54('0x4f')],'waiting':_0xfc06d7[_0x7d54('0x51')]};_0x5622fa[_0x7d54('0x1c')](_0x1c0268);}}_0x80f9f2({'count':_0x5622fa[_0x7d54('0x14')],'rows':_0x5622fa});});},'WhatsappQueues':function(_0x5d6beb){return new Promise(function(_0x215d29,_0x7cbc02){var _0x38084e=[];for(var _0x4e4550 in _0x11c94a[_0x7d54('0x54')]){if(_0x11c94a[_0x7d54('0x54')][_0x7d54('0x46')](_0x4e4550)){var _0x509ce6=_0x11c94a[_0x7d54('0x54')][_0x4e4550];var _0x28cc6f={'id':_0x509ce6['id'],'available':_0x509ce6[_0x7d54('0x4b')],'loggedIn':_0x509ce6['loggedIn'],'name':_0x509ce6[_0x7d54('0x4d')],'paused':_0x509ce6[_0x7d54('0x4f')],'waiting':_0x509ce6['waiting']};_0x38084e['push'](_0x28cc6f);}}_0x215d29({'count':_0x38084e[_0x7d54('0x14')],'rows':_0x38084e});});},'ChatQueuesWaitingInteractions':function(_0x18d0e7){return new Promise(function(_0x1ae929,_0x901f7){var _0x11294c=_['values'](_0x11c94a['chatQueuesWaitingInteractions']);_0x1ae929({'count':_0x11294c[_0x7d54('0x14')],'rows':_0x11294c});});},'MailQueuesWaitingInteractions':function(_0x165910){return new Promise(function(_0x17b675,_0x12f82e){var _0x46a397=_['values'](_0x11c94a[_0x7d54('0x55')]);_0x17b675({'count':_0x46a397[_0x7d54('0x14')],'rows':_0x46a397});});},'OpenchannelQueuesWaitingInteractions':function(_0x286187){return new Promise(function(_0x14d32d,_0x57d9f3){var _0x1ee675=_[_0x7d54('0x56')](_0x11c94a[_0x7d54('0x57')]);_0x14d32d({'count':_0x1ee675[_0x7d54('0x14')],'rows':_0x1ee675});});},'SmsQueuesWaitingInteractions':function(_0x3bf887){return new Promise(function(_0x1654b2,_0x9bd346){var _0xa5a4ba=_[_0x7d54('0x56')](_0x11c94a[_0x7d54('0x58')]);_0x1654b2({'count':_0xa5a4ba['length'],'rows':_0xa5a4ba});});},'FaxQueuesWaitingInteractions':function(_0xaffef1){return new Promise(function(_0x3d4acf,_0x6a6fce){var _0x2afe98=_['values'](_0x11c94a['faxQueuesWaitingInteractions']);_0x3d4acf({'count':_0x2afe98[_0x7d54('0x14')],'rows':_0x2afe98});});},'WhatsappQueuesWaitingInteractions':function(_0x62ba1c){return new Promise(function(_0x3ce36d,_0x2a6f31){var _0x1a1560=_[_0x7d54('0x56')](_0x11c94a[_0x7d54('0x59')]);_0x3ce36d({'count':_0x1a1560['length'],'rows':_0x1a1560});});}};var _0x68d02c=jayson[_0x7d54('0x5a')](_0x208b3c)['http']();_0x68d02c['on'](_0x7d54('0x33'),function(_0x39329d){logger[_0x7d54('0x33')](JSON[_0x7d54('0x37')](_0x39329d));return _0x268b0c(_0x39329d);});_0x68d02c[_0x7d54('0x5b')](0x232c,_0x7d54('0x5c'),function(){console[_0x7d54('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4bc96e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x823c=['body','%s:%s:%s','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','info','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','busy','busyQueue','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agents','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','available','loggedIn','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','log','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','IntervalId','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','join','app','.js','autoreply','split','push','slice','dialogflow','dialogflowv2','appdata','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x823c,0x143));var _0xc823=function(_0x483b24,_0x193698){_0x483b24=_0x483b24-0x0;var _0x67ce30=_0x823c[_0x483b24];return _0x67ce30;};'use strict';var _=require(_0xc823('0x0'));var util=require('util');var path=require(_0xc823('0x1'));var fs=require('fs');var jayson=require(_0xc823('0x2'));var BPromise=require(_0xc823('0x3'));var uuid=require(_0xc823('0x4'));var utils=require(_0xc823('0x5'));var config=require(_0xc823('0x6'));var logger=require('../../../config/logger')(_0xc823('0x7'));var rpc={'openchannelQueueReport':require(_0xc823('0x8')),'mailQueueReport':require(_0xc823('0x9')),'chatQueueReport':require(_0xc823('0xa')),'smsQueueReport':require(_0xc823('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xc823('0xc'))};var RuleEngine=require(_0xc823('0xd'));function getId(_0x5daab9,_0x52bb76,_0x4478fc){return util[_0xc823('0xe')]('%s.%s.%s',_0x5daab9,_0x52bb76||0x0,_0x4478fc||0x0);}function getIntervals(_0x43bbd8,_0x2716a0){var _0x5c214c=[];if(!_['isNil'](_0x2716a0[_0xc823('0xf')])&&!_[_0xc823('0x10')](_0x43bbd8[_0x2716a0[_0xc823('0xf')]])&&!_[_0xc823('0x10')](_0x43bbd8[_0x2716a0[_0xc823('0xf')]]['Intervals'])){_0x5c214c=_[_0xc823('0x11')](_0x43bbd8[_0x2716a0[_0xc823('0xf')]][_0xc823('0x12')],_0xc823('0x13'));}else if(!_[_0xc823('0x10')](_0x2716a0[_0xc823('0x13')])){_0x5c214c=[_0x2716a0['interval']];}return _0x5c214c;}exports[_0xc823('0x14')]=function(_0xff0ec2){_0xff0ec2[_0xc823('0x15')]={};return new BPromise(function(_0x4571cd,_0x55b31d){var _0x4bc9c9={'Start':function(_0x59749d){var _0x5bdfc9=this;return new Promise(function(_0x565aeb,_0x5d3521){if(_0x59749d){try{var _0x366c31=[];var _0x122510=getId(_0x59749d[_0xc823('0x16')],_0x59749d[_0xc823('0x17')]?_0x59749d[_0xc823('0x17')]['id']:0x0,_0x59749d[_0xc823('0x18')]?_0x59749d[_0xc823('0x18')]['id']:0x0);if(_0x59749d['applications']&&_[_0xc823('0x19')](_0x59749d['applications'])&&_0x59749d[_0xc823('0x1a')][_0xc823('0x1b')]){for(var _0x3d3ddb=0x0;_0x3d3ddb<_0x59749d['applications'][_0xc823('0x1b')];_0x3d3ddb+=0x1){var _0x2cacfd=_0x59749d[_0xc823('0x1a')][_0x3d3ddb];if(fs['existsSync'](path[_0xc823('0x1c')](__dirname,_0xc823('0x1a'),_0x2cacfd[_0xc823('0x1d')]+_0xc823('0x1e')))){var _0x574c76=[];switch(_0x2cacfd[_0xc823('0x1d')]['toLowerCase']()){case _0xc823('0x1f'):var _0x517231=_0x2cacfd['appdata'][_0xc823('0x20')](',');if(_0x59749d[_0xc823('0x16')]==='mail'){_0x574c76[_0xc823('0x21')](_0x517231[0x0]);_0x574c76[_0xc823('0x21')](_0x517231[0x1]);_0x574c76[_0xc823('0x21')](_0x517231[_0xc823('0x22')](0x2,_0x517231[_0xc823('0x1b')])[_0xc823('0x1c')](','));}else{_0x574c76[_0xc823('0x21')](_0x517231[0x0]);_0x574c76[_0xc823('0x21')](_0x517231[_0xc823('0x22')](0x1,_0x517231[_0xc823('0x1b')])['join'](','));}break;case _0xc823('0x23'):var _0x533560=_0x2cacfd['appdata'][_0xc823('0x20')](',');_0x574c76[_0xc823('0x21')](_0x533560[0x0]);_0x574c76[_0xc823('0x21')](_0x533560[0x1]);_0x574c76[_0xc823('0x21')](_0x533560[_0xc823('0x22')](0x2,_0x533560[_0xc823('0x1b')])[_0xc823('0x1c')](','));break;case _0xc823('0x24'):var _0x12f061=_0x2cacfd[_0xc823('0x25')][_0xc823('0x20')](',');_0x574c76[_0xc823('0x21')](_0x12f061[0x0]);_0x574c76[_0xc823('0x21')](_0x12f061[0x1]);_0x574c76[_0xc823('0x21')](_0x12f061[0x2]);_0x574c76[_0xc823('0x21')](_0x12f061[0x3]);_0x574c76['push'](_0x12f061[_0xc823('0x22')](0x4,_0x12f061[_0xc823('0x1b')])[_0xc823('0x1c')](','));break;case _0xc823('0x26'):var _0x14db83=_0x2cacfd['appdata']['split'](',');_0x574c76['push'](_0x14db83[0x0]);_0x574c76[_0xc823('0x21')](_0x14db83[0x1]);_0x574c76[_0xc823('0x21')](_0x14db83[0x2]);_0x574c76[_0xc823('0x21')](_0x14db83[0x3]);_0x574c76[_0xc823('0x21')](_0x14db83['slice'](0x4,_0x14db83[_0xc823('0x1b')])[_0xc823('0x1c')](','));break;case _0xc823('0x17'):_0x574c76[_0xc823('0x21')](_0x2cacfd[_0xc823('0x25')]);break;case _0xc823('0x27'):_0x574c76[_0xc823('0x21')](_0x2cacfd[_0xc823('0x28')]);_0x574c76[_0xc823('0x21')](_0x2cacfd[_0xc823('0x25')]);break;case _0xc823('0x29'):var _0x9fd3a2=utils[_0xc823('0x2a')](_0x59749d['account'][_0xc823('0x2b')],_0x59749d);var _0x3bb497=_0x2cacfd[_0xc823('0x25')][_0xc823('0x20')](',');_0x574c76[_0xc823('0x21')](_0x3bb497[0x0]);_0x574c76[_0xc823('0x21')](_0x3bb497[0x1]);_0x574c76['push'](_0x3bb497[0x2]);_0x574c76[_0xc823('0x21')](_0x3bb497[0x3]);_0x574c76[_0xc823('0x21')](_0x3bb497[0x4]);_0x574c76['push'](_0x3bb497[0x5]);_0x574c76[_0xc823('0x21')](_0x3bb497[0x6]);_0x574c76['push'](_0x3bb497[0x7]);_0x574c76[_0xc823('0x21')](_0x3bb497[0x8]);_0x574c76[_0xc823('0x21')](_0x3bb497[0x9]);_0x574c76['push'](_0x3bb497[0xa]);_0x574c76[_0xc823('0x21')](_0x59749d[_0xc823('0x18')]['id']);_0x574c76[_0xc823('0x21')](_0x59749d[_0xc823('0x17')]['id']);_0x574c76[_0xc823('0x21')](_0x2cacfd[_0xc823('0x2c')]);_0x574c76[_0xc823('0x21')](_0x59749d['interaction']['ContactId']);_0x574c76['push'](_0x59749d[_0xc823('0x2d')][_0xc823('0x2d')]);_0x574c76[_0xc823('0x21')](_0x9fd3a2);break;default:_0x574c76=_[_0xc823('0x10')](_0x2cacfd[_0xc823('0x25')])?[]:_0x2cacfd['appdata'][_0xc823('0x20')](',');}var _0x28e575={'id':util[_0xc823('0xe')](_0xc823('0x2e'),_0x122510,_0x2cacfd['id'],_0x2cacfd['app']),'condition':require('./interval')['condition'](_0x122510,getIntervals(_0xff0ec2[_0xc823('0x2f')],_0x2cacfd),_0xff0ec2),'consequence':require(_0xc823('0x30')+_0x2cacfd[_0xc823('0x1d')])['consequence'](_0x122510,_0x574c76,_0xff0ec2,_0x59749d),'p':_0x2cacfd[_0xc823('0x31')]||0x0};logger['info'](_0xc823('0x32'),_0x28e575['id'],_0xc823('0x33'),getIntervals(_0xff0ec2[_0xc823('0x2f')],_0x2cacfd)[_0xc823('0x1c')](_0xc823('0x34')));_0x366c31[_0xc823('0x21')](_0x28e575);}else{logger[_0xc823('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xc823('0x1c')](__dirname,'applications',_0x2cacfd[_0xc823('0x1d')]+_0xc823('0x1e')));}}_0xff0ec2[_0xc823('0x15')][_0x122510]=new RuleEngine(_0x366c31);_0xff0ec2[_0xc823('0x15')][_0x122510][_0xc823('0x36')](_0x59749d,function(_0x2978a9){logger[_0xc823('0x37')](_0xc823('0x38'),JSON['stringify'](_0x2978a9[_0xc823('0x39')]));if(_0xff0ec2[_0xc823('0x15')][_0x122510]){_0xff0ec2['rules'][_0x122510][_0xc823('0x3a')](_0xc823('0x3b'));}});return _0x565aeb({'code':0xc8,'message':_0x59749d});}else{logger[_0xc823('0x37')](_0xc823('0x3c'));return _0x565aeb({'code':0xc8,'message':_0x59749d});}}catch(_0x2d6206){logger[_0xc823('0x35')](_0x2d6206[_0xc823('0x3d')]);return _0x5d3521(_0x5bdfc9[_0xc823('0x35')](0x1f4,_0x2d6206));}}return _0x5d3521(_0xc823('0x3e'));});},'AcceptMessage':function(_0x51a0d3){var _0x153ca1=this;return new Promise(function(_0xfb1078,_0x50515d){if(_0x51a0d3[_0xc823('0x3f')]&&_0x51a0d3[_0xc823('0x3f')]['id']){if(_0xff0ec2['agents'][_0x51a0d3[_0xc823('0x3f')]['id']]){_0xff0ec2['agents'][_0x51a0d3[_0xc823('0x3f')]['id']][_0xc823('0x40')]=![];_0xff0ec2['agents'][_0x51a0d3['agent']['id']][_0xc823('0x41')]=undefined;}}if(_0x51a0d3[_0xc823('0x17')]&&_0x51a0d3[_0xc823('0x17')]['id']){try{var _0x34706b=getId(_0x51a0d3[_0xc823('0x16')],_0x51a0d3[_0xc823('0x17')]?_0x51a0d3[_0xc823('0x17')]['id']:0x0,_0x51a0d3[_0xc823('0x18')]?_0x51a0d3['interaction']['id']:0x0);if(_0xff0ec2[_0xc823('0x15')][_0x34706b]){_0xff0ec2[_0xc823('0x15')][_0x34706b]['emit']('end');if(rpc[_0x51a0d3[_0xc823('0x16')]+'QueueReport']){rpc[_0x51a0d3['channel']+'QueueReport']['update'](_0x34706b,{'UserId':_0x51a0d3['message']['UserId']})[_0xc823('0x42')](function(_0x4b5cdb){logger['error'](_0xc823('0x43'));});}}return _0xfb1078({'code':0xc8,'message':_0x51a0d3});}catch(_0x4f25ae){logger[_0xc823('0x35')](_0x4f25ae[_0xc823('0x3d')]);return _0x50515d(_0x153ca1['error'](0x1f4,_0x4f25ae));}}logger[_0xc823('0x35')](_0xc823('0x44'));return _0x50515d(_0x153ca1[_0xc823('0x35')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x564ef5){var _0x304e71=this;return new Promise(function(_0x11dfe8,_0x5bbf90){if(_0x564ef5[_0xc823('0x3f')]&&_0x564ef5[_0xc823('0x3f')]['id']){try{if(_0xff0ec2[_0xc823('0x45')][_0x564ef5['agent']['id']]){_0xff0ec2[_0xc823('0x45')][_0x564ef5[_0xc823('0x3f')]['id']][_0xc823('0x40')]=![];_0xff0ec2[_0xc823('0x45')][_0x564ef5[_0xc823('0x3f')]['id']][_0xc823('0x41')]=undefined;}return _0x11dfe8({'code':0xc8,'message':_0x564ef5});}catch(_0xe53fb5){logger['error'](_0xe53fb5[_0xc823('0x3d')]);return _0x5bbf90(_0x304e71[_0xc823('0x35')](0x1f4,_0xe53fb5));}}logger[_0xc823('0x35')](_0xc823('0x44'));return _0x5bbf90(_0x304e71[_0xc823('0x35')](0x1f4,_0xc823('0x44')));});},'AbandonInteraction':function(_0x37d7b4){var _0x5e7527=this;return new Promise(function(_0x219c6d,_0x2fd2df){if(_0x37d7b4[_0xc823('0x16')]&&_0x37d7b4[_0xc823('0x18')]&&_0x37d7b4[_0xc823('0x18')]['id']){try{var _0x2d20fc=getId(_0x37d7b4['channel'],_0x37d7b4[_0xc823('0x17')]?_0x37d7b4['message']['id']:0x0,_0x37d7b4['interaction']?_0x37d7b4['interaction']['id']:0x0);if(_0xff0ec2[_0xc823('0x15')][_0x2d20fc]){_0xff0ec2['rules'][_0x2d20fc][_0xc823('0x3a')]('end');}return _0x219c6d({'code':0xc8,'message':_0x37d7b4});}catch(_0x2244bd){logger[_0xc823('0x35')](_0x2244bd['stack']);return _0x2fd2df(_0x5e7527[_0xc823('0x35')](0x1f4,_0x2244bd));}}logger['error']('message\x20is\x20empty');return _0x2fd2df(_0x5e7527[_0xc823('0x35')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x262a98){var _0x5a122b=this;return new Promise(function(_0x403c0e,_0x3698a2){if(_0xff0ec2['agents'][_0xc823('0x46')](_0x262a98['id'])){for(var _0x1d9689 in _0x262a98[_0xc823('0x47')]){if(_0x262a98[_0xc823('0x47')]['hasOwnProperty'](_0x1d9689)){if(_0xff0ec2['agents'][_0x262a98['id']][_0xc823('0x46')](_0x1d9689+'CurrentCapacity')){_0xff0ec2[_0xc823('0x45')][_0x262a98['id']][_0x1d9689+_0xc823('0x48')]=parseInt(_0x262a98[_0xc823('0x47')][_0x1d9689],0xa);}}}_0xff0ec2[_0xc823('0x45')][_0x262a98['id']][_0xc823('0x49')]();return _0x403c0e({'code':0xc8,'message':_0xff0ec2['agents'][_0x262a98['id']]});}else{return _0x3698a2(_0x5a122b[_0xc823('0x35')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x164e2a){return new Promise(function(_0x1b552c,_0x5efb1b){var _0x13a218=_['values'](_0xff0ec2[_0xc823('0x45')]);_0x1b552c({'count':_0x13a218[_0xc823('0x1b')],'rows':_0x13a218});});},'ChatQueues':function(_0x110374){return new Promise(function(_0x42f203,_0x51a528){var _0x542a87=[];for(var _0x4b3f69 in _0xff0ec2['chatQueues']){if(_0xff0ec2['chatQueues'][_0xc823('0x46')](_0x4b3f69)){var _0x302720=_0xff0ec2['chatQueues'][_0x4b3f69];var _0x4d632d={'id':_0x302720['id'],'available':_0x302720[_0xc823('0x4a')],'loggedIn':_0x302720[_0xc823('0x4b')],'name':_0x302720[_0xc823('0x4c')],'paused':_0x302720[_0xc823('0x4d')],'waiting':_0x302720[_0xc823('0x4e')]};_0x542a87[_0xc823('0x21')](_0x4d632d);}}_0x42f203({'count':_0x542a87[_0xc823('0x1b')],'rows':_0x542a87});});},'MailQueues':function(_0x5106d6){return new Promise(function(_0x32b4b9,_0x371707){var _0x3589f6=[];for(var _0x4ac00f in _0xff0ec2['mailQueues']){if(_0xff0ec2['mailQueues'][_0xc823('0x46')](_0x4ac00f)){var _0x3f4ffe=_0xff0ec2['mailQueues'][_0x4ac00f];var _0x18d4ed={'id':_0x3f4ffe['id'],'available':_0x3f4ffe[_0xc823('0x4a')],'loggedIn':_0x3f4ffe[_0xc823('0x4b')],'name':_0x3f4ffe[_0xc823('0x4c')],'paused':_0x3f4ffe['paused'],'waiting':_0x3f4ffe[_0xc823('0x4e')]};_0x3589f6[_0xc823('0x21')](_0x18d4ed);}}_0x32b4b9({'count':_0x3589f6[_0xc823('0x1b')],'rows':_0x3589f6});});},'OpenchannelQueues':function(_0x54bbac){return new Promise(function(_0x46551d,_0x147481){var _0x47d3d2=[];for(var _0x144a49 in _0xff0ec2[_0xc823('0x4f')]){if(_0xff0ec2['openchannelQueues']['hasOwnProperty'](_0x144a49)){var _0x4cd52c=_0xff0ec2[_0xc823('0x4f')][_0x144a49];var _0x3b68ce={'id':_0x4cd52c['id'],'available':_0x4cd52c['available'],'loggedIn':_0x4cd52c[_0xc823('0x4b')],'name':_0x4cd52c[_0xc823('0x4c')],'paused':_0x4cd52c[_0xc823('0x4d')],'waiting':_0x4cd52c[_0xc823('0x4e')]};_0x47d3d2[_0xc823('0x21')](_0x3b68ce);}}_0x46551d({'count':_0x47d3d2[_0xc823('0x1b')],'rows':_0x47d3d2});});},'SmsQueues':function(_0x5e1e27){return new Promise(function(_0xe838f0,_0x483908){var _0x53bf28=[];for(var _0x2d9efb in _0xff0ec2['smsQueues']){if(_0xff0ec2[_0xc823('0x50')][_0xc823('0x46')](_0x2d9efb)){var _0x2e0774=_0xff0ec2[_0xc823('0x50')][_0x2d9efb];var _0x1c198e={'id':_0x2e0774['id'],'available':_0x2e0774[_0xc823('0x4a')],'loggedIn':_0x2e0774[_0xc823('0x4b')],'name':_0x2e0774['name'],'paused':_0x2e0774[_0xc823('0x4d')],'waiting':_0x2e0774[_0xc823('0x4e')]};_0x53bf28[_0xc823('0x21')](_0x1c198e);}}_0xe838f0({'count':_0x53bf28[_0xc823('0x1b')],'rows':_0x53bf28});});},'FaxQueues':function(_0x1f0ce3){return new Promise(function(_0x514138,_0x239a2d){var _0x1e9439=[];for(var _0xfcfe28 in _0xff0ec2[_0xc823('0x51')]){if(_0xff0ec2[_0xc823('0x51')]['hasOwnProperty'](_0xfcfe28)){var _0x310f3e=_0xff0ec2[_0xc823('0x51')][_0xfcfe28];var _0x416618={'id':_0x310f3e['id'],'available':_0x310f3e[_0xc823('0x4a')],'loggedIn':_0x310f3e['loggedIn'],'name':_0x310f3e[_0xc823('0x4c')],'paused':_0x310f3e[_0xc823('0x4d')],'waiting':_0x310f3e[_0xc823('0x4e')]};_0x1e9439[_0xc823('0x21')](_0x416618);}}_0x514138({'count':_0x1e9439[_0xc823('0x1b')],'rows':_0x1e9439});});},'WhatsappQueues':function(_0x28068c){return new Promise(function(_0x58f745,_0x2d2dc2){var _0x4a4d1d=[];for(var _0x165845 in _0xff0ec2[_0xc823('0x52')]){if(_0xff0ec2[_0xc823('0x52')]['hasOwnProperty'](_0x165845)){var _0x36efc9=_0xff0ec2[_0xc823('0x52')][_0x165845];var _0x27d4b9={'id':_0x36efc9['id'],'available':_0x36efc9[_0xc823('0x4a')],'loggedIn':_0x36efc9[_0xc823('0x4b')],'name':_0x36efc9[_0xc823('0x4c')],'paused':_0x36efc9[_0xc823('0x4d')],'waiting':_0x36efc9['waiting']};_0x4a4d1d[_0xc823('0x21')](_0x27d4b9);}}_0x58f745({'count':_0x4a4d1d[_0xc823('0x1b')],'rows':_0x4a4d1d});});},'ChatQueuesWaitingInteractions':function(_0x2bc119){return new Promise(function(_0x339aa1,_0x1ca2e1){var _0x39282f=_[_0xc823('0x53')](_0xff0ec2[_0xc823('0x54')]);_0x339aa1({'count':_0x39282f[_0xc823('0x1b')],'rows':_0x39282f});});},'MailQueuesWaitingInteractions':function(_0x3cf745){return new Promise(function(_0x10effc,_0x167d47){var _0x2091ab=_[_0xc823('0x53')](_0xff0ec2[_0xc823('0x55')]);_0x10effc({'count':_0x2091ab[_0xc823('0x1b')],'rows':_0x2091ab});});},'OpenchannelQueuesWaitingInteractions':function(_0xd9f9b8){return new Promise(function(_0x2178c9,_0x329f55){var _0x473aa1=_['values'](_0xff0ec2[_0xc823('0x56')]);_0x2178c9({'count':_0x473aa1[_0xc823('0x1b')],'rows':_0x473aa1});});},'SmsQueuesWaitingInteractions':function(_0x28278c){return new Promise(function(_0x1927ff,_0x1b6b22){var _0x112a0d=_['values'](_0xff0ec2[_0xc823('0x57')]);_0x1927ff({'count':_0x112a0d[_0xc823('0x1b')],'rows':_0x112a0d});});},'FaxQueuesWaitingInteractions':function(_0x366d8e){return new Promise(function(_0x3fa853,_0x2d250d){var _0x397a29=_[_0xc823('0x53')](_0xff0ec2['faxQueuesWaitingInteractions']);_0x3fa853({'count':_0x397a29[_0xc823('0x1b')],'rows':_0x397a29});});},'WhatsappQueuesWaitingInteractions':function(_0x21438d){return new Promise(function(_0xfa2b6e,_0x26da3d){var _0x764a8f=_[_0xc823('0x53')](_0xff0ec2['whatsappQueuesWaitingInteractions']);_0xfa2b6e({'count':_0x764a8f[_0xc823('0x1b')],'rows':_0x764a8f});});}};var _0x2db7e2=jayson[_0xc823('0x58')](_0x4bc9c9)[_0xc823('0x59')]();_0x2db7e2['on'](_0xc823('0x35'),function(_0x18146b){logger[_0xc823('0x35')](JSON['stringify'](_0x18146b));return _0x55b31d(_0x18146b);});_0x2db7e2['listen'](0x232c,'127.0.0.1',function(){console[_0xc823('0x5a')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4571cd(_0xc823('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 0ee1451..576411f 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 _0x56f6=['format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','when','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','message','result','catch','condition','rules','info','stop','length','push'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x56f6,0x8e));var _0x656f=function(_0x434a7a,_0xd166b){_0x434a7a=_0x434a7a-0x0;var _0x49addb=_0x56f6[_0x434a7a];return _0x49addb;};'use strict';var util=require(_0x656f('0x0'));var BPromise=require('bluebird');var jayson=require(_0x656f('0x1'));var _=require(_0x656f('0x2'));var logger=require(_0x656f('0x3'))(_0x656f('0x4'));var client=jayson[_0x656f('0x5')][_0x656f('0x6')]({'port':0x232a});function request(_0x4aea03,_0x1dfa91){return new BPromise(function(_0x64b8e4,_0x38fa13){return client[_0x656f('0x7')](_0x4aea03,_0x1dfa91)['then'](function(_0x4bd03f){if(_0x4bd03f[_0x656f('0x8')]){return _0x38fa13(_0x4bd03f[_0x656f('0x8')][_0x656f('0x9')]);}else{return _0x64b8e4(_0x4bd03f[_0x656f('0xa')]);}})[_0x656f('0xb')](function(_0x2c15b7){return _0x38fa13(_0x2c15b7);});});}exports[_0x656f('0xc')]=function(_0x2f2d89,_0x4d45cc,_0x23c1a9){return function(_0x26bbf7){if(_0x23c1a9[_0x656f('0xd')]&&!_0x23c1a9[_0x656f('0xd')][_0x2f2d89]){logger[_0x656f('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2f2d89);return _0x26bbf7[_0x656f('0xf')]();}var _0x4431d9=[];for(var _0x525b09=0x0;_0x525b09<_0x4d45cc[_0x656f('0x10')];_0x525b09+=0x1){_0x4431d9[_0x656f('0x11')](request('Command',{'command':util[_0x656f('0x12')](_0x656f('0x13'),_0x4d45cc[_0x525b09])})[_0x656f('0x14')](function(_0x3fd002){return _0x3fd002&&_0x3fd002[_0x656f('0x9')]&&_0x3fd002[_0x656f('0x9')][_0x656f('0x15')](_0x656f('0x16'))>=0x0?!![]:![];})[_0x656f('0xb')](function(_0x5d4515){logger['error'](_0x656f('0x17'),_0x2f2d89,_0x4d45cc[_0x525b09]);}));}BPromise[_0x656f('0x18')](_0x4431d9)[_0x656f('0x14')](function(_0x52d1db){var _0x533974=_[_0x656f('0x19')](_0x52d1db);logger[_0x656f('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x2f2d89,_0x4d45cc[_0x656f('0x1a')]('\x20|\x20'),_0x533974);_0x26bbf7[_0x656f('0x1b')](_0x533974);})[_0x656f('0xb')](function(_0x740114){console[_0x656f('0x1c')](_0x740114);logger[_0x656f('0x8')](_0x656f('0x1d'),_0x2f2d89,_0x4d45cc[_0x656f('0x1a')](_0x656f('0x1e')),_0x740114[_0x656f('0x1f')]);_0x26bbf7[_0x656f('0xf')]();});};}; \ No newline at end of file +var _0x6831=['util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s','indexOf','true','catch','error','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','when','join','\x20|\x20','stack'];(function(_0x46538e,_0x1a2620){var _0x4da081=function(_0x5f2f8d){while(--_0x5f2f8d){_0x46538e['push'](_0x46538e['shift']());}};_0x4da081(++_0x1a2620);}(_0x6831,0x15c));var _0x1683=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x6831[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0x1683('0x0'));var BPromise=require('bluebird');var jayson=require(_0x1683('0x1'));var _=require(_0x1683('0x2'));var logger=require(_0x1683('0x3'))(_0x1683('0x4'));var client=jayson[_0x1683('0x5')][_0x1683('0x6')]({'port':0x232a});function request(_0x897584,_0x544aea){return new BPromise(function(_0x26b650,_0x50ea39){return client[_0x1683('0x7')](_0x897584,_0x544aea)[_0x1683('0x8')](function(_0x1a2387){if(_0x1a2387['error']){return _0x50ea39(_0x1a2387['error'][_0x1683('0x9')]);}else{return _0x26b650(_0x1a2387[_0x1683('0xa')]);}})['catch'](function(_0x2b1230){return _0x50ea39(_0x2b1230);});});}exports[_0x1683('0xb')]=function(_0x3275be,_0x385408,_0x578fbc){return function(_0x4d4fa3){if(_0x578fbc[_0x1683('0xc')]&&!_0x578fbc[_0x1683('0xc')][_0x3275be]){logger[_0x1683('0xd')](_0x1683('0xe'),_0x3275be);return _0x4d4fa3[_0x1683('0xf')]();}var _0x395259=[];for(var _0x236020=0x0;_0x236020<_0x385408[_0x1683('0x10')];_0x236020+=0x1){_0x395259[_0x1683('0x11')](request('Command',{'command':util['format'](_0x1683('0x12'),_0x385408[_0x236020])})[_0x1683('0x8')](function(_0x6830e0){return _0x6830e0&&_0x6830e0[_0x1683('0x9')]&&_0x6830e0['message'][_0x1683('0x13')](_0x1683('0x14'))>=0x0?!![]:![];})[_0x1683('0x15')](function(_0x4c740f){logger[_0x1683('0x16')](_0x1683('0x17'),_0x3275be,_0x385408[_0x236020]);}));}BPromise['all'](_0x395259)[_0x1683('0x8')](function(_0x2824bf){var _0x3ec37f=_['some'](_0x2824bf);logger[_0x1683('0xd')](_0x1683('0x18'),_0x3275be,_0x385408['join']('\x20|\x20'),_0x3ec37f);_0x4d4fa3[_0x1683('0x19')](_0x3ec37f);})[_0x1683('0x15')](function(_0x1034c7){console['log'](_0x1034c7);logger[_0x1683('0x16')]('[%s][INTERVAL]\x20%s\x20%s',_0x3275be,_0x385408[_0x1683('0x1a')](_0x1683('0x1b')),_0x1034c7[_0x1683('0x1c')]);_0x4d4fa3[_0x1683('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7054870..9f7a9ea 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 _0x8f59=['transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]'];(function(_0x2d129c,_0x5115d8){var _0x324a33=function(_0x237f6e){while(--_0x237f6e){_0x2d129c['push'](_0x2d129c['shift']());}};_0x324a33(++_0x5115d8);}(_0x8f59,0x11d));var _0x98f5=function(_0x11e3b4,_0x321e0a){_0x11e3b4=_0x11e3b4-0x0;var _0x541588=_0x8f59[_0x11e3b4];return _0x541588;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var utils=require(_0x98f5('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xe809bb,_0x1d9fb3){utils[_0x98f5('0x3')](util['format'](_0x98f5('0x4'),_0xe809bb[_0x98f5('0x5')],_0xe809bb[_0x98f5('0x6')],_0xe809bb[_0x98f5('0x7')],_0xe809bb['membername'],_0xe809bb[_0x98f5('0x8')],_0xe809bb[_0x98f5('0x9')],_0xe809bb[_0x98f5('0xa')],_0xe809bb['lastevent']));if(_0xe809bb['queue']){utils[_0x98f5('0xb')](_0xe809bb[_0x98f5('0x7')])[_0x98f5('0xc')](function(_0x53493e){if(_0x53493e){_0xe809bb[_0x98f5('0xd')]=_0x53493e[_0x98f5('0xd')];_0xe809bb[_0x98f5('0xe')]=_0xe809bb[_0x98f5('0xf')]?_0x53493e['acw']:![];_0xe809bb[_0x98f5('0x10')]=_0xe809bb['agentacw']?_0x53493e['acwTimeout']:0x0;}utils[_0x98f5('0x11')](_0x98f5('0x12'),_0xe809bb);});}else{utils['request'](_0x98f5('0x12'),_0xe809bb);}if(_0x1d9fb3){delete transfers[_0xe809bb[_0x98f5('0x5')]];}else{delete agents[_0xe809bb[_0x98f5('0x13')]];}}exports[_0x98f5('0x14')]=function(_0x3286f7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x16'),_0x3286f7[_0x98f5('0x5')]),_0x3286f7);agents[_0x3286f7['destuniqueid']]=_0x3286f7;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();agents[_0x3286f7['destuniqueid']][_0x98f5('0x19')]=_0x98f5('0x1a');agents[_0x3286f7[_0x98f5('0x13')]]['connectedlinenum']=null;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1b')]=null;utils['info'](util[_0x98f5('0x1c')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3286f7[_0x98f5('0x5')],agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x3286f7[_0x98f5('0x13')]));}catch(_0xd6f409){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x16'),_0x3286f7['uniqueid']),_0xd6f409);}};exports[_0x98f5('0x1f')]=function(_0x191f23){try{if(!_['isNil'](agents[_0x191f23[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x191f23);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x191f23[_0x98f5('0x5')],agents[_0x191f23['destuniqueid']][_0x98f5('0x1d')],_0x191f23['destuniqueid']));agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x1f')]=!![];agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x21')]=utils[_0x98f5('0x18')]();agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x19')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x22')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x191f23[_0x98f5('0x24')]?parseInt(_0x191f23[_0x98f5('0x24')])/0x3e8:0x0;agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x25')]=0x0;unanswered[_0x98f5('0x26')](_0x191f23[_0x98f5('0x13')]);}}catch(_0x576c4b){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x576c4b);}};exports[_0x98f5('0x27')]=function(_0x15bf92){try{_[_0x98f5('0x28')](agents,function(_0x5e9d73,_0x29e1f5){if(_0x5e9d73[_0x98f5('0x5')]==_0x15bf92[_0x98f5('0x5')]&&!_[_0x98f5('0x29')](unanswered,_0x5e9d73[_0x98f5('0x13')])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0x15bf92);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x15bf92[_0x98f5('0x5')],_0x5e9d73[_0x98f5('0x1d')],_0x5e9d73[_0x98f5('0x13')]));_0x5e9d73[_0x98f5('0x1f')]=!![];_0x5e9d73[_0x98f5('0x21')]=utils[_0x98f5('0x18')]();_0x5e9d73[_0x98f5('0x19')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x22')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x23')]=_0x15bf92[_0x98f5('0x23')];_0x5e9d73[_0x98f5('0x25')]=0x0;writeDB(_0x5e9d73);}});}catch(_0xe4a944){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0xe4a944);}};exports[_0x98f5('0x2c')]=function(_0x39d935){try{if(agents[_0x39d935['destuniqueid']]){utils[_0x98f5('0x15')](util['format']('[%s][agents][agentconnect]',_0x39d935[_0x98f5('0x5')]),_0x39d935);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x2d'),_0x39d935['uniqueid'],agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x39d935[_0x98f5('0x13')]));agents[_0x39d935['destuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();agents[_0x39d935['destuniqueid']][_0x98f5('0xa')]=_0x39d935[_0x98f5('0xa')];agents[_0x39d935[_0x98f5('0x13')]]['connectedlinename']=_0x39d935[_0x98f5('0x1b')];agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];agents[_0x39d935[_0x98f5('0x13')]]['lastevent']='connect';_[_0x98f5('0x28')](agents,function(_0x14faf2,_0x33e6e2){if(_0x14faf2[_0x98f5('0x13')]!=_0x39d935[_0x98f5('0x13')]&&_0x14faf2[_0x98f5('0x5')]==_0x39d935['uniqueid']){_0x14faf2['talktime']=0x0;_0x14faf2[_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];_0x14faf2[_0x98f5('0x1f')]=!![];_0x14faf2[_0x98f5('0x21')]=utils['now']();_0x14faf2['lastevent']=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x22')]=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x30')]=_0x39d935['destuniqueid'];_0x14faf2['answeredelsewheremembername']=_0x39d935[_0x98f5('0x1d')];writeDB(_0x14faf2);}});}}catch(_0x3a191f){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x31'),_0x39d935['uniqueid']),_0x3a191f);}};exports[_0x98f5('0xf')]=function(_0x4ff7b0){try{if(!_[_0x98f5('0x32')](agents[_0x4ff7b0[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x4ff7b0);utils['info'](util[_0x98f5('0x1c')](_0x98f5('0x34'),_0x4ff7b0['uniqueid'],agents[_0x4ff7b0[_0x98f5('0x13')]]['membername'],_0x4ff7b0[_0x98f5('0x13')]));agents[_0x4ff7b0[_0x98f5('0x13')]]['agentcomplete']=!![];agents[_0x4ff7b0['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x4ff7b0[_0x98f5('0x13')]]['talktime']=utils[_0x98f5('0x35')](agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x36')],agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x2e')]);agents[_0x4ff7b0[_0x98f5('0x13')]]['reason']=_0x4ff7b0[_0x98f5('0x22')];agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x19')]=_0x98f5('0x37');writeDB(agents[_0x4ff7b0[_0x98f5('0x13')]]);}}catch(_0x459649){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x459649);}};exports[_0x98f5('0x38')]=function(_0x4a0cda){try{if(!_[_0x98f5('0x32')](agents[_0x4a0cda[_0x98f5('0x39')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda['uniqueid']),_0x4a0cda);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4a0cda[_0x98f5('0x5')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x1d')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x5')]));agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3b')]=!![];agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x3c')]=_0x98f5('0x3d');agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3e')]=_0x4a0cda[_0x98f5('0x3f')];agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x40')]=agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x5')];}}catch(_0x2e48a1){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda[_0x98f5('0x5')]),_0x2e48a1);}};exports[_0x98f5('0x41')]=function(_0x1289a7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1289a7);if(_0x1289a7[_0x98f5('0x43')]==_0x1289a7[_0x98f5('0x44')]){if(!_[_0x98f5('0x32')](agents[_0x1289a7[_0x98f5('0x45')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x45')]]['transfer']=!![];agents[_0x1289a7[_0x98f5('0x45')]]['transfertype']=_0x98f5('0x46');agents[_0x1289a7['secondtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x47')];agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x40')]=_0x1289a7['origtransfereruniqueid'];}if(_0x1289a7['transfereeuniqueid']&&agents[_0x1289a7[_0x98f5('0x48')]]){agents[_0x1289a7[_0x98f5('0x48')]]['agententerreason']=0x1;transfers[_0x1289a7[_0x98f5('0x48')]]=_[_0x98f5('0x49')](agents[_0x1289a7['transfereeuniqueid']]);transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x45')]]['calleridnum'];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x4a')]=agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x48')]]['holdtime']=0x0;transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x4b')]=0x2;}}else if(_0x1289a7[_0x98f5('0x45')]==_0x1289a7['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1289a7['origtransfereruniqueid']])){utils['info'](util[_0x98f5('0x1c')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3b')]=!![];agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3c')]=_0x98f5('0x46');agents[_0x1289a7['origtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x4c')];agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x40')]=_0x1289a7[_0x98f5('0x45')];}if(_0x1289a7[_0x98f5('0x4d')]&&agents[_0x1289a7['transfertargetuniqueid']]){agents[_0x1289a7[_0x98f5('0x4d')]]['agententerreason']=0x1;transfers[_0x1289a7['transfertargetuniqueid']]=_['clone'](agents[_0x1289a7[_0x98f5('0x4d')]]);transfers[_0x1289a7['transfertargetuniqueid']][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x9')];transfers[_0x1289a7['transfertargetuniqueid']]['calleridname']=agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x4d')]]['agentcalledAt']=utils['now']();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x23')]=0x0;transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x4b')]=0x2;}}}catch(_0x1cc6e3){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1cc6e3);}};exports[_0x98f5('0x4e')]=function(_0xb64efb){try{utils['debug'](util[_0x98f5('0x1c')](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0xb64efb);if(agents[_0xb64efb['uniqueid']]&&agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]==='timeout'){if(_0xb64efb[_0x98f5('0x50')]==='21'){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]='rejected';agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x51');}utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb['uniqueid']][_0x98f5('0x22')],agents[_0xb64efb['uniqueid']][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);var _0x3bb728=unanswered[_0x98f5('0x53')](_0xb64efb['uniqueid']);if(_0x3bb728>-0x1){unanswered[_0x98f5('0x54')](_0x3bb728,0x1);}}if(transfers[_0xb64efb[_0x98f5('0x5')]]){transfers[_0xb64efb['uniqueid']][_0x98f5('0xf')]=!![];transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')]=utils[_0x98f5('0x18')]();transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x25')]=utils['diffTime'](transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')],transfers[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]=_0x98f5('0x55');transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x37');utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],transfers[_0xb64efb[_0x98f5('0x5')]]['membername'],transfers[_0xb64efb['uniqueid']][_0x98f5('0x22')],transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(transfers[_0xb64efb['uniqueid']],!![]);}if(agents[_0xb64efb[_0x98f5('0x5')]]&&agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0xf')]=!![];agents[_0xb64efb['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0xb64efb['uniqueid']][_0x98f5('0x25')]=utils[_0x98f5('0x35')](agents[_0xb64efb['uniqueid']][_0x98f5('0x36')],agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);agents[_0xb64efb[_0x98f5('0x5')]]['reason']=agents[_0xb64efb['uniqueid']][_0x98f5('0x3b')]?_0x98f5('0x3b'):_0x98f5('0x55');agents[_0xb64efb[_0x98f5('0x5')]]['lastevent']=_0x98f5('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);}}catch(_0x1a3a76){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0x1a3a76);}}; \ No newline at end of file +var _0x84a0=['transferexten','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','complete','lodash','util','./utils','info','format','channel','queue','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','timeout','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x84a0,0x66));var _0x084a=function(_0x379f70,_0x52942f){_0x379f70=_0x379f70-0x0;var _0x372cab=_0x84a0[_0x379f70];return _0x372cab;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var utils=require(_0x084a('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fff7f,_0x483bfa){utils[_0x084a('0x3')](util[_0x084a('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1fff7f['uniqueid'],_0x1fff7f[_0x084a('0x5')],_0x1fff7f[_0x084a('0x6')],_0x1fff7f['membername'],_0x1fff7f[_0x084a('0x7')],_0x1fff7f[_0x084a('0x8')],_0x1fff7f[_0x084a('0x9')],_0x1fff7f[_0x084a('0xa')]));if(_0x1fff7f[_0x084a('0x6')]){utils['getVoiceQueueByName'](_0x1fff7f[_0x084a('0x6')])[_0x084a('0xb')](function(_0x8198ad){if(_0x8198ad){_0x1fff7f[_0x084a('0xc')]=_0x8198ad[_0x084a('0xc')];_0x1fff7f['agentacw']=_0x1fff7f['agentcomplete']?_0x8198ad[_0x084a('0xd')]:![];_0x1fff7f[_0x084a('0xe')]=_0x1fff7f[_0x084a('0xf')]?_0x8198ad[_0x084a('0x10')]:0x0;}utils[_0x084a('0x11')]('CreateVoiceAgentReport',_0x1fff7f);});}else{utils['request'](_0x084a('0x12'),_0x1fff7f);}if(_0x483bfa){delete transfers[_0x1fff7f[_0x084a('0x13')]];}else{delete agents[_0x1fff7f[_0x084a('0x14')]];}}exports[_0x084a('0x15')]=function(_0x1bdfb8){try{utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x17'),_0x1bdfb8['uniqueid']),_0x1bdfb8);agents[_0x1bdfb8[_0x084a('0x14')]]=_0x1bdfb8;agents[_0x1bdfb8['destuniqueid']][_0x084a('0x18')]=utils[_0x084a('0x19')]();agents[_0x1bdfb8[_0x084a('0x14')]][_0x084a('0xa')]=_0x084a('0x1a');agents[_0x1bdfb8['destuniqueid']][_0x084a('0x9')]=null;agents[_0x1bdfb8['destuniqueid']][_0x084a('0x1b')]=null;utils[_0x084a('0x3')](util['format'](_0x084a('0x1c'),_0x1bdfb8[_0x084a('0x13')],agents[_0x1bdfb8[_0x084a('0x14')]][_0x084a('0x1d')],_0x1bdfb8[_0x084a('0x14')]));}catch(_0x145636){utils[_0x084a('0x1e')](util[_0x084a('0x4')](_0x084a('0x17'),_0x1bdfb8[_0x084a('0x13')]),_0x145636);}};exports[_0x084a('0x1f')]=function(_0x279e25){try{if(!_[_0x084a('0x20')](agents[_0x279e25[_0x084a('0x14')]])){utils[_0x084a('0x16')](util['format'](_0x084a('0x21'),_0x279e25[_0x084a('0x13')]),_0x279e25);utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x22'),_0x279e25['uniqueid'],agents[_0x279e25[_0x084a('0x14')]][_0x084a('0x1d')],_0x279e25[_0x084a('0x14')]));agents[_0x279e25[_0x084a('0x14')]][_0x084a('0x1f')]=!![];agents[_0x279e25[_0x084a('0x14')]]['agentringnoanswerAt']=utils[_0x084a('0x19')]();agents[_0x279e25[_0x084a('0x14')]][_0x084a('0xa')]='timeout';agents[_0x279e25[_0x084a('0x14')]][_0x084a('0x23')]=_0x084a('0x24');agents[_0x279e25['destuniqueid']]['holdtime']=_0x279e25['ringtime']?parseInt(_0x279e25['ringtime'])/0x3e8:0x0;agents[_0x279e25[_0x084a('0x14')]]['talktime']=0x0;unanswered['push'](_0x279e25['destuniqueid']);}}catch(_0x3b8176){utils[_0x084a('0x1e')](util[_0x084a('0x4')](_0x084a('0x21'),_0x279e25[_0x084a('0x13')]),_0x3b8176);}};exports[_0x084a('0x25')]=function(_0x378de6){try{_[_0x084a('0x26')](agents,function(_0x5e6ea8,_0x2ed3cd){if(_0x5e6ea8[_0x084a('0x13')]==_0x378de6['uniqueid']&&!_[_0x084a('0x27')](unanswered,_0x5e6ea8[_0x084a('0x14')])){utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x28'),_0x378de6[_0x084a('0x13')]),_0x378de6);utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x29'),_0x378de6[_0x084a('0x13')],_0x5e6ea8[_0x084a('0x1d')],_0x5e6ea8[_0x084a('0x14')]));_0x5e6ea8[_0x084a('0x1f')]=!![];_0x5e6ea8['agentringnoanswerAt']=utils['now']();_0x5e6ea8[_0x084a('0xa')]=_0x084a('0x2a');_0x5e6ea8[_0x084a('0x23')]=_0x084a('0x2a');_0x5e6ea8[_0x084a('0x2b')]=_0x378de6['holdtime'];_0x5e6ea8[_0x084a('0x2c')]=0x0;writeDB(_0x5e6ea8);}});}catch(_0x1b56ad){utils[_0x084a('0x1e')](util['format'](_0x084a('0x28'),_0x378de6[_0x084a('0x13')]),_0x1b56ad);}};exports[_0x084a('0x2d')]=function(_0x4c4c90){try{if(agents[_0x4c4c90['destuniqueid']]){utils['debug'](util[_0x084a('0x4')](_0x084a('0x2e'),_0x4c4c90[_0x084a('0x13')]),_0x4c4c90);utils['info'](util[_0x084a('0x4')](_0x084a('0x2f'),_0x4c4c90[_0x084a('0x13')],agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x1d')],_0x4c4c90[_0x084a('0x14')]));agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x30')]=utils[_0x084a('0x19')]();agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x9')]=_0x4c4c90[_0x084a('0x9')];agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0x1b')]=_0x4c4c90[_0x084a('0x1b')];agents[_0x4c4c90['destuniqueid']][_0x084a('0x2b')]=_0x4c4c90[_0x084a('0x31')];agents[_0x4c4c90[_0x084a('0x14')]][_0x084a('0xa')]=_0x084a('0x32');_[_0x084a('0x26')](agents,function(_0xa7b652,_0x183e10){if(_0xa7b652[_0x084a('0x14')]!=_0x4c4c90['destuniqueid']&&_0xa7b652[_0x084a('0x13')]==_0x4c4c90[_0x084a('0x13')]){_0xa7b652[_0x084a('0x2c')]=0x0;_0xa7b652[_0x084a('0x2b')]=_0x4c4c90[_0x084a('0x31')];_0xa7b652[_0x084a('0x1f')]=!![];_0xa7b652['agentringnoanswerAt']=utils[_0x084a('0x19')]();_0xa7b652[_0x084a('0xa')]='answered_elsewhere';_0xa7b652[_0x084a('0x23')]=_0x084a('0x33');_0xa7b652[_0x084a('0x34')]=_0x4c4c90['destuniqueid'];_0xa7b652[_0x084a('0x35')]=_0x4c4c90[_0x084a('0x1d')];writeDB(_0xa7b652);}});}}catch(_0x4fe9c2){utils[_0x084a('0x1e')](util[_0x084a('0x4')]('[%s][agents][agentconnect]',_0x4c4c90['uniqueid']),_0x4fe9c2);}};exports[_0x084a('0x36')]=function(_0x17a8d4){try{if(!_[_0x084a('0x20')](agents[_0x17a8d4[_0x084a('0x14')]])){utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x37'),_0x17a8d4[_0x084a('0x13')]),_0x17a8d4);utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x38'),_0x17a8d4['uniqueid'],agents[_0x17a8d4['destuniqueid']][_0x084a('0x1d')],_0x17a8d4[_0x084a('0x14')]));agents[_0x17a8d4[_0x084a('0x14')]]['agentcomplete']=!![];agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0x39')]=utils[_0x084a('0x19')]();agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0x2c')]=utils['diffTime'](agents[_0x17a8d4[_0x084a('0x14')]]['agentcompleteAt'],agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0x30')]);agents[_0x17a8d4[_0x084a('0x14')]]['reason']=_0x17a8d4['reason'];agents[_0x17a8d4[_0x084a('0x14')]][_0x084a('0xa')]='complete';writeDB(agents[_0x17a8d4[_0x084a('0x14')]]);}}catch(_0x2c2c2e){utils[_0x084a('0x1e')](util[_0x084a('0x4')]('[%s][agents][agentcomplete]',_0x17a8d4[_0x084a('0x13')]),_0x2c2c2e);}};exports[_0x084a('0x3a')]=function(_0x31677b){try{if(!_[_0x084a('0x20')](agents[_0x31677b['transfereruniqueid']])){utils[_0x084a('0x16')](util[_0x084a('0x4')](_0x084a('0x3b'),_0x31677b[_0x084a('0x13')]),_0x31677b);utils['info'](util['format'](_0x084a('0x3c'),_0x31677b[_0x084a('0x13')],agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x1d')],agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x13')]));agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x3e')]=!![];agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x3f')]=_0x084a('0x40');agents[_0x31677b[_0x084a('0x3d')]]['transferexten']=_0x31677b[_0x084a('0x41')];agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x42')]=agents[_0x31677b[_0x084a('0x3d')]][_0x084a('0x13')];}}catch(_0x1c972c){utils[_0x084a('0x1e')](util['format'](_0x084a('0x3b'),_0x31677b[_0x084a('0x13')]),_0x1c972c);}};exports[_0x084a('0x43')]=function(_0x54aa6c){try{utils['debug'](util[_0x084a('0x4')]('[%s][agents][attendedtransfer]',_0x54aa6c[_0x084a('0x44')]),_0x54aa6c);if(_0x54aa6c[_0x084a('0x44')]==_0x54aa6c['origtransfererlinkedid']){if(!_[_0x084a('0x20')](agents[_0x54aa6c['secondtransfereruniqueid']])){utils['info'](util[_0x084a('0x4')](_0x084a('0x45'),_0x54aa6c[_0x084a('0x44')],agents[_0x54aa6c[_0x084a('0x46')]][_0x084a('0x1d')]));agents[_0x54aa6c[_0x084a('0x46')]][_0x084a('0x3e')]=!![];agents[_0x54aa6c['secondtransfereruniqueid']][_0x084a('0x3f')]=_0x084a('0x47');agents[_0x54aa6c[_0x084a('0x46')]]['transferexten']=_0x54aa6c[_0x084a('0x48')];agents[_0x54aa6c[_0x084a('0x46')]][_0x084a('0x42')]=_0x54aa6c[_0x084a('0x44')];}if(_0x54aa6c['transfereeuniqueid']&&agents[_0x54aa6c[_0x084a('0x49')]]){agents[_0x54aa6c['transfereeuniqueid']][_0x084a('0x4a')]=0x1;transfers[_0x54aa6c[_0x084a('0x49')]]=_[_0x084a('0x4b')](agents[_0x54aa6c['transfereeuniqueid']]);transfers[_0x54aa6c['transfereeuniqueid']][_0x084a('0x8')]=agents[_0x54aa6c[_0x084a('0x46')]]['calleridnum'];transfers[_0x54aa6c[_0x084a('0x49')]]['calleridname']=agents[_0x54aa6c['secondtransfereruniqueid']][_0x084a('0x4c')];transfers[_0x54aa6c[_0x084a('0x49')]][_0x084a('0x18')]=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x49')]][_0x084a('0x30')]=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x49')]][_0x084a('0x2b')]=0x0;transfers[_0x54aa6c['transfereeuniqueid']][_0x084a('0x4a')]=0x2;}}else if(_0x54aa6c[_0x084a('0x46')]==_0x54aa6c[_0x084a('0x4d')]){if(!_['isNil'](agents[_0x54aa6c[_0x084a('0x44')]])){utils[_0x084a('0x3')](util['format'](_0x084a('0x45'),_0x54aa6c['origtransfereruniqueid'],agents[_0x54aa6c['origtransfereruniqueid']][_0x084a('0x1d')]));agents[_0x54aa6c['origtransfereruniqueid']]['transfer']=!![];agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x3f')]=_0x084a('0x47');agents[_0x54aa6c['origtransfereruniqueid']][_0x084a('0x4e')]=_0x54aa6c[_0x084a('0x4f')];agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x42')]=_0x54aa6c[_0x084a('0x46')];}if(_0x54aa6c[_0x084a('0x50')]&&agents[_0x54aa6c[_0x084a('0x50')]]){agents[_0x54aa6c['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x54aa6c[_0x084a('0x50')]]=_[_0x084a('0x4b')](agents[_0x54aa6c['transfertargetuniqueid']]);transfers[_0x54aa6c[_0x084a('0x50')]][_0x084a('0x8')]=agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x8')];transfers[_0x54aa6c['transfertargetuniqueid']][_0x084a('0x4c')]=agents[_0x54aa6c[_0x084a('0x44')]][_0x084a('0x4c')];transfers[_0x54aa6c['transfertargetuniqueid']]['agentcalledAt']=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x50')]][_0x084a('0x30')]=utils[_0x084a('0x19')]();transfers[_0x54aa6c[_0x084a('0x50')]][_0x084a('0x2b')]=0x0;transfers[_0x54aa6c[_0x084a('0x50')]]['agententerreason']=0x2;}}}catch(_0x22efb6){utils['error'](util['format'](_0x084a('0x51'),_0x54aa6c[_0x084a('0x44')]),_0x22efb6);}};exports[_0x084a('0x52')]=function(_0x4a2745){try{utils[_0x084a('0x16')](util['format'](_0x084a('0x53'),_0x4a2745[_0x084a('0x13')]),_0x4a2745);if(agents[_0x4a2745[_0x084a('0x13')]]&&agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')]===_0x084a('0x24')){if(_0x4a2745['cause']==='21'){agents[_0x4a2745['uniqueid']][_0x084a('0x23')]=_0x084a('0x54');agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]=_0x084a('0x54');}utils[_0x084a('0x3')](util['format'](_0x084a('0x55'),_0x4a2745[_0x084a('0x13')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x1d')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')],agents[_0x4a2745[_0x084a('0x13')]]['lastevent']));writeDB(agents[_0x4a2745[_0x084a('0x13')]]);var _0x38b5b6=unanswered[_0x084a('0x56')](_0x4a2745[_0x084a('0x13')]);if(_0x38b5b6>-0x1){unanswered[_0x084a('0x57')](_0x38b5b6,0x1);}}if(transfers[_0x4a2745[_0x084a('0x13')]]){transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x36')]=!![];transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x39')]=utils['now']();transfers[_0x4a2745['uniqueid']]['talktime']=utils[_0x084a('0x58')](transfers[_0x4a2745[_0x084a('0x13')]]['agentcompleteAt'],transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x30')]);transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')]='agent';transfers[_0x4a2745['uniqueid']][_0x084a('0xa')]=_0x084a('0x59');utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x55'),_0x4a2745[_0x084a('0x13')],transfers[_0x4a2745[_0x084a('0x13')]]['membername'],transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')],transfers[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]));writeDB(transfers[_0x4a2745[_0x084a('0x13')]],!![]);}if(agents[_0x4a2745[_0x084a('0x13')]]&&agents[_0x4a2745[_0x084a('0x13')]]['agentconnectAt']){agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x36')]=!![];agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x39')]=utils[_0x084a('0x19')]();agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x2c')]=utils[_0x084a('0x58')](agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x39')],agents[_0x4a2745[_0x084a('0x13')]]['agentconnectAt']);agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')]=agents[_0x4a2745['uniqueid']][_0x084a('0x3e')]?'transfer':'agent';agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]='complete';utils[_0x084a('0x3')](util[_0x084a('0x4')](_0x084a('0x55'),_0x4a2745[_0x084a('0x13')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x1d')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0x23')],agents[_0x4a2745[_0x084a('0x13')]][_0x084a('0xa')]));writeDB(agents[_0x4a2745[_0x084a('0x13')]]);}}catch(_0x7c85e3){utils[_0x084a('0x1e')](util[_0x084a('0x4')](_0x084a('0x53'),_0x4a2745['uniqueid']),_0x7c85e3);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 89bf32c..b879236 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 _0x4baf=['error','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber'];(function(_0xa81f2d,_0x17f3a0){var _0x26937d=function(_0x5df6a1){while(--_0x5df6a1){_0xa81f2d['push'](_0xa81f2d['shift']());}};_0x26937d(++_0x17f3a0);}(_0x4baf,0xb4));var _0xf4ba=function(_0x23bafc,_0x2cd70d){_0x23bafc=_0x23bafc-0x0;var _0x308fd8=_0x4baf[_0x23bafc];return _0x308fd8;};'use strict';var _=require(_0xf4ba('0x0'));var util=require('util');var utils=require(_0xf4ba('0x1'));var transfers=require(_0xf4ba('0x2'));var dispositions=[_0xf4ba('0x3'),_0xf4ba('0x4'),_0xf4ba('0x4'),_0xf4ba('0x3'),_0xf4ba('0x3'),_0xf4ba('0x3'),_0xf4ba('0x5'),'BUSY',_0xf4ba('0x4'),'FAILED',_0xf4ba('0x4')];var channels={};function writeDB(_0x35a4e7){var _0x5732a5;if(transfers[_0xf4ba('0x6')][_0x35a4e7[_0xf4ba('0x7')]]){_0x5732a5=_0x35a4e7[_0xf4ba('0x7')];_0x35a4e7[_0xf4ba('0x7')]=transfers[_0xf4ba('0x6')][_0x35a4e7['uniqueid']]['transfereeuniqueid'];}utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0xa'),_0x35a4e7['uniqueid'],_0x35a4e7[_0xf4ba('0xb')],_0x35a4e7[_0xf4ba('0xc')],_0x35a4e7[_0xf4ba('0xd')],_0x35a4e7['interface'],_0x35a4e7[_0xf4ba('0xe')],_0x35a4e7[_0xf4ba('0xf')],_0x35a4e7[_0xf4ba('0x10')]));if(_0x35a4e7[_0xf4ba('0x11')]){utils[_0xf4ba('0x12')](_0x35a4e7[_0xf4ba('0x11')])[_0xf4ba('0x13')](function(_0x466d63){if(_0x466d63){_0x35a4e7[_0xf4ba('0x14')]=_0x466d63['id'];}utils['request'](_0xf4ba('0x15'),_0x35a4e7);});}else{utils['request'](_0xf4ba('0x15'),_0x35a4e7);}if(channels[_0x35a4e7[_0xf4ba('0x7')]]){delete channels[_0x35a4e7['uniqueid']];}else if(_0x5732a5&&channels[_0x5732a5]){if(!transfers['blinds'][_0x5732a5][_0xf4ba('0x16')])delete transfers[_0xf4ba('0x6')][_0x5732a5];delete channels[_0x5732a5];}}exports[_0xf4ba('0x17')]=function(_0x314cf5){try{utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x19'),_0x314cf5['uniqueid']),_0x314cf5);if(_0x314cf5[_0xf4ba('0x7')]==_0x314cf5[_0xf4ba('0x1a')]&&_0x314cf5[_0xf4ba('0xb')]!='OutgoingSpoolFailed'){utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x1b'),_0x314cf5[_0xf4ba('0x7')],_0x314cf5['context'],_0x314cf5[_0xf4ba('0x1c')]));channels[_0x314cf5[_0xf4ba('0x7')]]={'uniqueid':_0x314cf5[_0xf4ba('0x7')],'accountcode':_0x314cf5[_0xf4ba('0x11')],'source':_0x314cf5[_0xf4ba('0xe')],'destination':_0x314cf5['exten'],'destinationcontext':_0x314cf5['context'],'channel':_0x314cf5[_0xf4ba('0xb')],'starttime':utils[_0xf4ba('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf4ba('0x1e')};}}catch(_0x212dc5){utils['error'](util['format'](_0xf4ba('0x19'),_0x314cf5[_0xf4ba('0x7')]),_0x212dc5);}};exports['newstate']=function(_0x3b71e4){try{utils['debug'](util[_0xf4ba('0x9')](_0xf4ba('0x1f'),_0x3b71e4['uniqueid']),_0x3b71e4);if(!_[_0xf4ba('0x20')](channels[_0x3b71e4['uniqueid']])&&_0x3b71e4[_0xf4ba('0x21')]==0x6){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x22'),_0x3b71e4[_0xf4ba('0x7')],_0x3b71e4[_0xf4ba('0x23')],_0x3b71e4[_0xf4ba('0xb')]));if(_[_0xf4ba('0x20')](channels[_0x3b71e4['uniqueid']][_0xf4ba('0x24')])){channels[_0x3b71e4[_0xf4ba('0x7')]][_0xf4ba('0x24')]=utils[_0xf4ba('0x1d')]();}}else if(!_[_0xf4ba('0x20')](channels[_0x3b71e4[_0xf4ba('0x1a')]])&&_0x3b71e4['channelstate']==0x6&&_0x3b71e4[_0xf4ba('0x23')]!=_0xf4ba('0x25')){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x26'),_0x3b71e4[_0xf4ba('0x7')],_0x3b71e4[_0xf4ba('0x1a')],_0x3b71e4[_0xf4ba('0x23')],_0x3b71e4[_0xf4ba('0xb')]));channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x11')]=_0x3b71e4[_0xf4ba('0x11')];channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x27')]=_0x3b71e4['channel'];if(_[_0xf4ba('0x20')](channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x28')])){channels[_0x3b71e4[_0xf4ba('0x1a')]][_0xf4ba('0x28')]=utils[_0xf4ba('0x1d')]();}channels[_0x3b71e4[_0xf4ba('0x1a')]]['disposition']=dispositions[_[_0xf4ba('0x29')](_0x3b71e4[_0xf4ba('0x21')])]||_0xf4ba('0x5');}}catch(_0x4b048e){utils[_0xf4ba('0x2a')](util[_0xf4ba('0x9')](_0xf4ba('0x1f'),_0x3b71e4['uniqueid']),_0x4b048e);}};exports[_0xf4ba('0x2b')]=function(_0x2fdba0){try{if(!_[_0xf4ba('0x20')](channels[_0x2fdba0[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x2c'),_0x2fdba0[_0xf4ba('0x7')]),_0x2fdba0);if(_[_0xf4ba('0x20')](channels[_0x2fdba0[_0xf4ba('0x7')]]['callerid'])){channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x2d')]=_0x2fdba0[_0xf4ba('0x2e')]+'\x20<'+_0x2fdba0[_0xf4ba('0xe')]+'>';}utils[_0xf4ba('0x8')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2fdba0['uniqueid'],channels[_0x2fdba0[_0xf4ba('0x7')]]['callerid'],_0x2fdba0[_0xf4ba('0x2f')]));channels[_0x2fdba0['uniqueid']][_0xf4ba('0x30')]=utils[_0xf4ba('0x1d')]();channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x31')]=utils[_0xf4ba('0x32')](channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x30')],channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x33')]);channels[_0x2fdba0['uniqueid']][_0xf4ba('0x34')]=channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x28')]?utils['diffTime'](channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x30')],channels[_0x2fdba0[_0xf4ba('0x7')]][_0xf4ba('0x28')]):0x0;writeDB(channels[_0x2fdba0[_0xf4ba('0x7')]]);}}catch(_0x1329fa){utils[_0xf4ba('0x2a')](util[_0xf4ba('0x9')](_0xf4ba('0x2c'),_0x2fdba0['uniqueid']),_0x1329fa);}};exports[_0xf4ba('0x35')]=function(_0x423825){try{if(!_[_0xf4ba('0x20')](channels[_0x423825[_0xf4ba('0x36')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')]('[%s][calls][attendedtransfer]',_0x423825[_0xf4ba('0x37')]),_0x423825);if(channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0xb')]==_0x423825[_0xf4ba('0x38')]){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x39'),_0x423825[_0xf4ba('0x37')],_0x423825[_0xf4ba('0x36')],_0x423825[_0xf4ba('0x3a')]));channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0x27')]=_0x423825[_0xf4ba('0x3a')];channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0x3b')]='_attended';}else if(channels[_0x423825[_0xf4ba('0x36')]][_0xf4ba('0xb')]=_0x423825['transfertargetchannel']){utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x39'),_0x423825['origtransfereruniqueid'],_0x423825['localtwolinkedid'],_0x423825[_0xf4ba('0x3c')]));channels[_0x423825[_0xf4ba('0x36')]]['destinationchannel']=_0x423825[_0xf4ba('0x3c')];channels[_0x423825['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x212930){utils['error'](util[_0xf4ba('0x9')]('[%s][calls][attendedtransfer]',_0x423825['origtransfereruniqueid']),_0x212930);}};exports[_0xf4ba('0x3d')]=function(_0x358fb4){try{if(!_[_0xf4ba('0x20')](channels[_0x358fb4[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x3e'),_0x358fb4[_0xf4ba('0x7')]),_0x358fb4);channels[_0x358fb4[_0xf4ba('0x7')]][_0xf4ba('0x3f')]=utils[_0xf4ba('0x1d')]();utils['info'](util[_0xf4ba('0x9')](_0xf4ba('0x40'),_0x358fb4[_0xf4ba('0x7')],channels[_0x358fb4['uniqueid']][_0xf4ba('0x3f')]));}}catch(_0xc8583b){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x3e'),_0x358fb4[_0xf4ba('0x7')]),_0xc8583b);}};exports[_0xf4ba('0x41')]=function(_0x445eda){try{if(!_[_0xf4ba('0x20')](channels[_0x445eda[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x42'),_0x445eda['uniqueid']),_0x445eda);if(!_[_0xf4ba('0x20')](channels[_0x445eda['uniqueid']][_0xf4ba('0x3f')])){channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x43')]+=utils['diffTime'](utils[_0xf4ba('0x1d')](),channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x3f')]);utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x44'),_0x445eda['uniqueid'],channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x43')]));delete channels[_0x445eda[_0xf4ba('0x7')]][_0xf4ba('0x3f')];}}}catch(_0xdad88){utils[_0xf4ba('0x2a')](util['format']('[%s][calls][musiconholdstop]',_0x445eda[_0xf4ba('0x7')]),_0xdad88);}};exports[_0xf4ba('0x45')]=function(_0x35dbe1){try{if(!_[_0xf4ba('0x20')](channels[_0x35dbe1['uniqueid']])){utils[_0xf4ba('0x18')](util['format'](_0xf4ba('0x46'),_0x35dbe1['uniqueid']),_0x35dbe1);if(!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')]['xmd-originatecalleridnum'])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x48'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1['uniqueid']][_0xf4ba('0x4a')]=_0x35dbe1['value'];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x4b')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x4c'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1['value']));channels[_0x35dbe1[_0xf4ba('0x7')]]['destination']=_0x35dbe1[_0xf4ba('0x49')];channels[_0x35dbe1['uniqueid']][_0xf4ba('0x2d')]='\x22'+_0x35dbe1[_0xf4ba('0x49')]+_0xf4ba('0x4d')+_0x35dbe1['value']+'>';}if(!_['isNil'](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4e')])||!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4f')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x35dbe1[_0xf4ba('0x7')],!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x4e')])?_0xf4ba('0x4e'):_0xf4ba('0x4f'),_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]]['callerid']=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x50')])||!_['isNil'](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x51')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x52'),_0x35dbe1[_0xf4ba('0x7')],!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x50')])?'xmd-queue':_0xf4ba('0x51'),_0x35dbe1['value']));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x53')]=_0xf4ba('0x54');channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x55')]=_0x35dbe1[_0xf4ba('0x49')];channels[_0x35dbe1[_0xf4ba('0x7')]]['queue']=!![];}if(!_[_0xf4ba('0x20')](_0x35dbe1[_0xf4ba('0x47')][_0xf4ba('0x56')])){utils['info'](util[_0xf4ba('0x9')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x57')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x58')])){utils[_0xf4ba('0x8')](util['format'](_0xf4ba('0x59'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1['uniqueid']][_0xf4ba('0x5a')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x5b')])){utils['info'](util['format'](_0xf4ba('0x5c'),_0x35dbe1['uniqueid'],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x5d')]=_0x35dbe1[_0xf4ba('0x49')];}if(!_[_0xf4ba('0x20')](_0x35dbe1['variable'][_0xf4ba('0x5e')])){utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x5f'),_0x35dbe1[_0xf4ba('0x7')],_0x35dbe1[_0xf4ba('0x49')]));channels[_0x35dbe1[_0xf4ba('0x7')]][_0xf4ba('0x5e')]=_0x35dbe1[_0xf4ba('0x49')];}}}catch(_0x4e8229){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x46'),_0x35dbe1['uniqueid']),_0x4e8229);}};exports[_0xf4ba('0x60')]=function(_0x1efd3d){try{if(!_[_0xf4ba('0x20')](channels[_0x1efd3d[_0xf4ba('0x7')]])){utils[_0xf4ba('0x18')](util[_0xf4ba('0x9')](_0xf4ba('0x61'),_0x1efd3d[_0xf4ba('0x7')]),_0x1efd3d);utils[_0xf4ba('0x8')](util[_0xf4ba('0x9')](_0xf4ba('0x62'),_0x1efd3d[_0xf4ba('0x7')],_0x1efd3d[_0xf4ba('0x63')],_0x1efd3d['appdata']));if(_0x1efd3d['application'][_0xf4ba('0x64')]()==_0xf4ba('0x65')&&_[_0xf4ba('0x66')](_0x1efd3d['appdata'][_0xf4ba('0x64')](),_0xf4ba('0x67'))){var _0x1a422e=_0x1efd3d[_0xf4ba('0x68')]['split']('=');var _0x4310ce=_0x1a422e[0x0][_0xf4ba('0x69')](_0x1a422e[0x0]['lastIndexOf']('(')+0x1,_0x1a422e[0x0][_0xf4ba('0x6a')](')'));var _0x22fb55=_0x1a422e[0x1];channels[_0x1efd3d[_0xf4ba('0x7')]][_0x4310ce]=_0x22fb55;}if(!_[_0xf4ba('0x6b')]([_0xf4ba('0x2b'),_0xf4ba('0x6c'),_0xf4ba('0x6d'),_0xf4ba('0x65'),_0xf4ba('0x6e')],_0x1efd3d['application']['toLowerCase']())){channels[_0x1efd3d[_0xf4ba('0x7')]][_0xf4ba('0x53')]=_0x1efd3d[_0xf4ba('0x63')];channels[_0x1efd3d[_0xf4ba('0x7')]][_0xf4ba('0x55')]=_0x1efd3d[_0xf4ba('0x68')];}}}catch(_0x4dd001){utils[_0xf4ba('0x2a')](util['format'](_0xf4ba('0x61'),_0x1efd3d[_0xf4ba('0x7')]),_0x4dd001);}}; \ No newline at end of file +var _0x02d4=['answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','channel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','substring','lastIndexOf','noop','execif','gotoif','lastapplication','[%s][calls][newexten]','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','queue','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','DOCUMENTATION','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel'];(function(_0x4c02d0,_0x49e7c3){var _0x41d71b=function(_0x442d6f){while(--_0x442d6f){_0x4c02d0['push'](_0x4c02d0['shift']());}};_0x41d71b(++_0x49e7c3);}(_0x02d4,0x111));var _0x402d=function(_0x249135,_0x2afed6){_0x249135=_0x249135-0x0;var _0x958f26=_0x02d4[_0x249135];return _0x958f26;};'use strict';var _=require(_0x402d('0x0'));var util=require('util');var utils=require(_0x402d('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x402d('0x2'),_0x402d('0x3'),_0x402d('0x3'),_0x402d('0x2'),_0x402d('0x2'),_0x402d('0x2'),_0x402d('0x4'),_0x402d('0x5'),'FAILED',_0x402d('0x3'),_0x402d('0x3')];var channels={};function writeDB(_0x4257d1){var _0x13f1f4;if(transfers[_0x402d('0x6')][_0x4257d1[_0x402d('0x7')]]){_0x13f1f4=_0x4257d1[_0x402d('0x7')];_0x4257d1[_0x402d('0x7')]=transfers[_0x402d('0x6')][_0x4257d1[_0x402d('0x7')]]['transfereeuniqueid'];}utils[_0x402d('0x8')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4257d1[_0x402d('0x7')],_0x4257d1['channel'],_0x4257d1[_0x402d('0x9')],_0x4257d1['membername'],_0x4257d1[_0x402d('0xa')],_0x4257d1[_0x402d('0xb')],_0x4257d1['connectedlinenum'],_0x4257d1[_0x402d('0xc')]));if(_0x4257d1['accountcode']){utils[_0x402d('0xd')](_0x4257d1[_0x402d('0xe')])[_0x402d('0xf')](function(_0x3e450f){if(_0x3e450f){_0x4257d1['UserId']=_0x3e450f['id'];}utils[_0x402d('0x10')](_0x402d('0x11'),_0x4257d1);});}else{utils[_0x402d('0x10')](_0x402d('0x11'),_0x4257d1);}if(channels[_0x4257d1[_0x402d('0x7')]]){delete channels[_0x4257d1[_0x402d('0x7')]];}else if(_0x13f1f4&&channels[_0x13f1f4]){if(!transfers[_0x402d('0x6')][_0x13f1f4]['recording'])delete transfers[_0x402d('0x6')][_0x13f1f4];delete channels[_0x13f1f4];}}exports[_0x402d('0x12')]=function(_0x11e517){try{utils[_0x402d('0x13')](util[_0x402d('0x14')](_0x402d('0x15'),_0x11e517[_0x402d('0x7')]),_0x11e517);if(_0x11e517[_0x402d('0x7')]==_0x11e517[_0x402d('0x16')]&&_0x11e517['channel']!=_0x402d('0x17')){utils[_0x402d('0x8')](util[_0x402d('0x14')](_0x402d('0x18'),_0x11e517[_0x402d('0x7')],_0x11e517['context'],_0x11e517[_0x402d('0x19')]));channels[_0x11e517[_0x402d('0x7')]]={'uniqueid':_0x11e517['uniqueid'],'accountcode':_0x11e517['accountcode'],'source':_0x11e517[_0x402d('0xb')],'destination':_0x11e517[_0x402d('0x19')],'destinationcontext':_0x11e517[_0x402d('0x1a')],'channel':_0x11e517['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x402d('0x2'),'amaflags':_0x402d('0x1b')};}}catch(_0x27585e){utils['error'](util[_0x402d('0x14')](_0x402d('0x15'),_0x11e517[_0x402d('0x7')]),_0x27585e);}};exports['newstate']=function(_0xaa7f5a){try{utils[_0x402d('0x13')](util['format'](_0x402d('0x1c'),_0xaa7f5a[_0x402d('0x7')]),_0xaa7f5a);if(!_['isNil'](channels[_0xaa7f5a['uniqueid']])&&_0xaa7f5a[_0x402d('0x1d')]==0x6){utils[_0x402d('0x8')](util['format'](_0x402d('0x1e'),_0xaa7f5a[_0x402d('0x7')],_0xaa7f5a['context'],_0xaa7f5a['channel']));if(_[_0x402d('0x1f')](channels[_0xaa7f5a[_0x402d('0x7')]][_0x402d('0x20')])){channels[_0xaa7f5a['uniqueid']][_0x402d('0x20')]=utils[_0x402d('0x21')]();}}else if(!_[_0x402d('0x1f')](channels[_0xaa7f5a[_0x402d('0x16')]])&&_0xaa7f5a['channelstate']==0x6&&_0xaa7f5a[_0x402d('0x1a')]!='transfer'){utils['info'](util['format'](_0x402d('0x22'),_0xaa7f5a[_0x402d('0x7')],_0xaa7f5a[_0x402d('0x16')],_0xaa7f5a[_0x402d('0x1a')],_0xaa7f5a['channel']));channels[_0xaa7f5a['linkedid']][_0x402d('0xe')]=_0xaa7f5a[_0x402d('0xe')];channels[_0xaa7f5a[_0x402d('0x16')]][_0x402d('0x23')]=_0xaa7f5a['channel'];if(_['isNil'](channels[_0xaa7f5a[_0x402d('0x16')]][_0x402d('0x24')])){channels[_0xaa7f5a['linkedid']][_0x402d('0x24')]=utils[_0x402d('0x21')]();}channels[_0xaa7f5a[_0x402d('0x16')]][_0x402d('0x25')]=dispositions[_[_0x402d('0x26')](_0xaa7f5a['channelstate'])]||_0x402d('0x4');}}catch(_0x27c18e){utils[_0x402d('0x27')](util[_0x402d('0x14')](_0x402d('0x1c'),_0xaa7f5a[_0x402d('0x7')]),_0x27c18e);}};exports[_0x402d('0x28')]=function(_0x309b78){try{if(!_[_0x402d('0x1f')](channels[_0x309b78[_0x402d('0x7')]])){utils[_0x402d('0x13')](util['format'](_0x402d('0x29'),_0x309b78[_0x402d('0x7')]),_0x309b78);if(_[_0x402d('0x1f')](channels[_0x309b78['uniqueid']]['callerid'])){channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x2a')]=_0x309b78[_0x402d('0x2b')]+'\x20<'+_0x309b78[_0x402d('0xb')]+'>';}utils[_0x402d('0x8')](util['format'](_0x402d('0x2c'),_0x309b78[_0x402d('0x7')],channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x2a')],_0x309b78[_0x402d('0x2d')]));channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x2e')]=utils[_0x402d('0x21')]();channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x2f')]=utils['diffTime'](channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x2e')],channels[_0x309b78[_0x402d('0x7')]]['starttime']);channels[_0x309b78[_0x402d('0x7')]]['billableseconds']=channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x24')]?utils[_0x402d('0x30')](channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x2e')],channels[_0x309b78[_0x402d('0x7')]][_0x402d('0x24')]):0x0;writeDB(channels[_0x309b78[_0x402d('0x7')]]);}}catch(_0x43efb4){utils[_0x402d('0x27')](util['format'](_0x402d('0x29'),_0x309b78[_0x402d('0x7')]),_0x43efb4);}};exports[_0x402d('0x31')]=function(_0x5101e8){try{if(!_['isNil'](channels[_0x5101e8[_0x402d('0x32')]])){utils[_0x402d('0x13')](util[_0x402d('0x14')](_0x402d('0x33'),_0x5101e8[_0x402d('0x34')]),_0x5101e8);if(channels[_0x5101e8['localtwolinkedid']]['channel']==_0x5101e8[_0x402d('0x35')]){utils[_0x402d('0x8')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5101e8[_0x402d('0x34')],_0x5101e8[_0x402d('0x32')],_0x5101e8['secondtransfererchannel']));channels[_0x5101e8[_0x402d('0x32')]]['destinationchannel']=_0x5101e8[_0x402d('0x36')];channels[_0x5101e8[_0x402d('0x32')]]['userfield']=_0x402d('0x37');}else if(channels[_0x5101e8['localtwolinkedid']][_0x402d('0x38')]=_0x5101e8['transfertargetchannel']){utils['info'](util[_0x402d('0x14')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5101e8[_0x402d('0x34')],_0x5101e8[_0x402d('0x32')],_0x5101e8[_0x402d('0x39')]));channels[_0x5101e8[_0x402d('0x32')]][_0x402d('0x23')]=_0x5101e8[_0x402d('0x39')];channels[_0x5101e8['localtwolinkedid']][_0x402d('0x3a')]=_0x402d('0x37');}}}catch(_0x1c3f16){utils[_0x402d('0x27')](util[_0x402d('0x14')]('[%s][calls][attendedtransfer]',_0x5101e8[_0x402d('0x34')]),_0x1c3f16);}};exports[_0x402d('0x3b')]=function(_0x2d934f){try{if(!_['isNil'](channels[_0x2d934f[_0x402d('0x7')]])){utils['debug'](util[_0x402d('0x14')](_0x402d('0x3c'),_0x2d934f[_0x402d('0x7')]),_0x2d934f);channels[_0x2d934f['uniqueid']][_0x402d('0x3d')]=utils[_0x402d('0x21')]();utils[_0x402d('0x8')](util[_0x402d('0x14')](_0x402d('0x3e'),_0x2d934f[_0x402d('0x7')],channels[_0x2d934f['uniqueid']][_0x402d('0x3d')]));}}catch(_0x17d71b){utils[_0x402d('0x27')](util['format'](_0x402d('0x3c'),_0x2d934f[_0x402d('0x7')]),_0x17d71b);}};exports[_0x402d('0x3f')]=function(_0x14b846){try{if(!_['isNil'](channels[_0x14b846[_0x402d('0x7')]])){utils[_0x402d('0x13')](util[_0x402d('0x14')](_0x402d('0x40'),_0x14b846[_0x402d('0x7')]),_0x14b846);if(!_['isNil'](channels[_0x14b846['uniqueid']]['musiconholdstartAt'])){channels[_0x14b846['uniqueid']][_0x402d('0x41')]+=utils[_0x402d('0x30')](utils[_0x402d('0x21')](),channels[_0x14b846['uniqueid']][_0x402d('0x3d')]);utils[_0x402d('0x8')](util[_0x402d('0x14')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x14b846['uniqueid'],channels[_0x14b846['uniqueid']][_0x402d('0x41')]));delete channels[_0x14b846[_0x402d('0x7')]]['musiconholdstartAt'];}}}catch(_0x4a9454){utils[_0x402d('0x27')](util[_0x402d('0x14')](_0x402d('0x40'),_0x14b846['uniqueid']),_0x4a9454);}};exports[_0x402d('0x42')]=function(_0x1255f8){try{if(!_[_0x402d('0x1f')](channels[_0x1255f8[_0x402d('0x7')]])){utils[_0x402d('0x13')](util['format'](_0x402d('0x43'),_0x1255f8['uniqueid']),_0x1255f8);if(!_[_0x402d('0x1f')](_0x1255f8[_0x402d('0x44')][_0x402d('0x45')])){utils['info'](util['format'](_0x402d('0x46'),_0x1255f8['uniqueid'],_0x1255f8['value']));channels[_0x1255f8[_0x402d('0x7')]]['source']=_0x1255f8[_0x402d('0x47')];}if(!_['isNil'](_0x1255f8[_0x402d('0x44')][_0x402d('0x48')])){utils[_0x402d('0x8')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1255f8[_0x402d('0x7')],_0x1255f8['value']));channels[_0x1255f8['uniqueid']][_0x402d('0x49')]=_0x1255f8[_0x402d('0x47')];channels[_0x1255f8[_0x402d('0x7')]][_0x402d('0x2a')]='\x22'+_0x1255f8['value']+_0x402d('0x4a')+_0x1255f8[_0x402d('0x47')]+'>';}if(!_[_0x402d('0x1f')](_0x1255f8[_0x402d('0x44')]['xmd-callerid-preview'])||!_[_0x402d('0x1f')](_0x1255f8['variable'][_0x402d('0x4b')])){utils['info'](util[_0x402d('0x14')](_0x402d('0x4c'),_0x1255f8[_0x402d('0x7')],!_[_0x402d('0x1f')](_0x1255f8['variable'][_0x402d('0x4d')])?_0x402d('0x4d'):_0x402d('0x4b'),_0x1255f8['value']));channels[_0x1255f8[_0x402d('0x7')]][_0x402d('0x2a')]=_0x1255f8[_0x402d('0x47')];}if(!_[_0x402d('0x1f')](_0x1255f8[_0x402d('0x44')][_0x402d('0x4e')])||!_[_0x402d('0x1f')](_0x1255f8[_0x402d('0x44')][_0x402d('0x4f')])){utils['info'](util[_0x402d('0x14')](_0x402d('0x4c'),_0x1255f8[_0x402d('0x7')],!_[_0x402d('0x1f')](_0x1255f8['variable']['xmd-queue'])?_0x402d('0x4e'):_0x402d('0x4f'),_0x1255f8[_0x402d('0x47')]));channels[_0x1255f8[_0x402d('0x7')]]['lastapplication']=_0x402d('0x50');channels[_0x1255f8[_0x402d('0x7')]][_0x402d('0x51')]=_0x1255f8[_0x402d('0x47')];channels[_0x1255f8[_0x402d('0x7')]][_0x402d('0x9')]=!![];}if(!_['isNil'](_0x1255f8[_0x402d('0x44')][_0x402d('0x52')])){utils[_0x402d('0x8')](util[_0x402d('0x14')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1255f8['uniqueid'],_0x1255f8[_0x402d('0x47')]));channels[_0x1255f8[_0x402d('0x7')]]['ContactId']=_0x1255f8[_0x402d('0x47')];}if(!_['isNil'](_0x1255f8[_0x402d('0x44')][_0x402d('0x53')])){utils[_0x402d('0x8')](util[_0x402d('0x14')](_0x402d('0x54'),_0x1255f8['uniqueid'],_0x1255f8[_0x402d('0x47')]));channels[_0x1255f8[_0x402d('0x7')]][_0x402d('0x55')]=_0x1255f8[_0x402d('0x47')];}if(!_['isNil'](_0x1255f8[_0x402d('0x44')]['outboundrouteid'])){utils[_0x402d('0x8')](util['format'](_0x402d('0x56'),_0x1255f8[_0x402d('0x7')],_0x1255f8['value']));channels[_0x1255f8[_0x402d('0x7')]][_0x402d('0x57')]=_0x1255f8[_0x402d('0x47')];}if(!_[_0x402d('0x1f')](_0x1255f8[_0x402d('0x44')]['sipcallid'])){utils['info'](util[_0x402d('0x14')](_0x402d('0x58'),_0x1255f8[_0x402d('0x7')],_0x1255f8[_0x402d('0x47')]));channels[_0x1255f8['uniqueid']][_0x402d('0x59')]=_0x1255f8[_0x402d('0x47')];}}}catch(_0x5a55c1){utils['error'](util[_0x402d('0x14')](_0x402d('0x43'),_0x1255f8['uniqueid']),_0x5a55c1);}};exports[_0x402d('0x5a')]=function(_0x587249){try{if(!_[_0x402d('0x1f')](channels[_0x587249[_0x402d('0x7')]])){utils[_0x402d('0x13')](util[_0x402d('0x14')]('[%s][calls][newexten]',_0x587249[_0x402d('0x7')]),_0x587249);utils[_0x402d('0x8')](util[_0x402d('0x14')](_0x402d('0x5b'),_0x587249['uniqueid'],_0x587249[_0x402d('0x5c')],_0x587249[_0x402d('0x5d')]));if(_0x587249[_0x402d('0x5c')][_0x402d('0x5e')]()=='set'&&_[_0x402d('0x5f')](_0x587249[_0x402d('0x5d')][_0x402d('0x5e')](),'cdr')){var _0x2aff84=_0x587249[_0x402d('0x5d')]['split']('=');var _0x53b187=_0x2aff84[0x0][_0x402d('0x60')](_0x2aff84[0x0][_0x402d('0x61')]('(')+0x1,_0x2aff84[0x0][_0x402d('0x61')](')'));var _0x3a4f60=_0x2aff84[0x1];channels[_0x587249['uniqueid']][_0x53b187]=_0x3a4f60;}if(!_['includes']([_0x402d('0x28'),_0x402d('0x62'),_0x402d('0x63'),'set',_0x402d('0x64')],_0x587249[_0x402d('0x5c')][_0x402d('0x5e')]())){channels[_0x587249['uniqueid']][_0x402d('0x65')]=_0x587249['application'];channels[_0x587249[_0x402d('0x7')]][_0x402d('0x51')]=_0x587249['appdata'];}}}catch(_0x42cd68){utils['error'](util['format'](_0x402d('0x66'),_0x587249[_0x402d('0x7')]),_0x42cd68);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index f49225c..4657231 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 _0x47a8=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','info','shutdown','fullybooted'];(function(_0x5b7f40,_0x374a85){var _0x4ae56f=function(_0xc32edb){while(--_0xc32edb){_0x5b7f40['push'](_0x5b7f40['shift']());}};_0x4ae56f(++_0x374a85);}(_0x47a8,0x105));var _0x847a=function(_0x9b561,_0x5640b0){_0x9b561=_0x9b561-0x0;var _0xaff0a=_0x47a8[_0x9b561];return _0xaff0a;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x847a('0x0')]('[core]\x20connected');};exports[_0x847a('0x1')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x847a('0x2')]=function(){utils['info'](_0x847a('0x3'));};exports[_0x847a('0x4')]=function(_0x1155d8){utils[_0x847a('0x4')](_0x847a('0x5'),_0x1155d8);};exports[_0x847a('0x6')]=function(){utils[_0x847a('0x0')]('[core]\x20close');};exports[_0x847a('0x7')]=function(_0x54b15c){}; \ No newline at end of file +var _0x9986=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','connect','info'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x9986,0x1f2));var _0x6998=function(_0x128443,_0x2fe025){_0x128443=_0x128443-0x0;var _0x1a4ce1=_0x9986[_0x128443];return _0x1a4ce1;};'use strict';var utils=require('./utils');exports[_0x6998('0x0')]=function(){utils[_0x6998('0x1')](_0x6998('0x2'));};exports[_0x6998('0x3')]=function(){utils['info'](_0x6998('0x4'));};exports[_0x6998('0x5')]=function(){utils['info'](_0x6998('0x6'));};exports[_0x6998('0x7')]=function(_0xec4dd2){utils[_0x6998('0x7')](_0x6998('0x8'),_0xec4dd2);};exports[_0x6998('0x9')]=function(){utils[_0x6998('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x38b8f5){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 25fe228..4d901f4 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 _0x20d2=['util','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','complete','duration','endtime','starttime','diffTime','billableseconds','lodash'];(function(_0x4d739f,_0x2aa279){var _0x1a704e=function(_0x24f094){while(--_0x24f094){_0x4d739f['push'](_0x4d739f['shift']());}};_0x1a704e(++_0x2aa279);}(_0x20d2,0x1df));var _0x220d=function(_0x32f2b7,_0x3e62b9){_0x32f2b7=_0x32f2b7-0x0;var _0x26487d=_0x20d2[_0x32f2b7];return _0x26487d;};'use strict';var _=require(_0x220d('0x0'));var util=require(_0x220d('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x3792a4){utils['info'](util['format'](_0x220d('0x2'),_0x3792a4[_0x220d('0x3')],_0x3792a4[_0x220d('0x4')],_0x3792a4[_0x220d('0x5')],_0x3792a4[_0x220d('0x6')],_0x3792a4[_0x220d('0x7')],_0x3792a4[_0x220d('0x8')]));utils['request'](_0x220d('0x9'),_0x3792a4);delete dials[_0x3792a4[_0x220d('0x3')]];}exports['newexten']=function(_0x5d7afe){try{utils[_0x220d('0xa')](util[_0x220d('0xb')](_0x220d('0xc'),_0x5d7afe[_0x220d('0x3')]),_0x5d7afe);utils[_0x220d('0xd')](util['format'](_0x220d('0xe'),_0x5d7afe[_0x220d('0x3')],_0x5d7afe[_0x220d('0xf')],_0x5d7afe[_0x220d('0x10')]));if(_0x5d7afe['application'][_0x220d('0x11')]()=='set'&&_['startsWith'](_0x5d7afe[_0x220d('0x10')][_0x220d('0x11')](),_0x220d('0x12'))){var _0x451911=_0x5d7afe[_0x220d('0x10')]['split']('=');dials[_0x5d7afe['uniqueid']]={'routeId':_0x451911[0x1]};}}catch(_0x482b26){utils['error'](util['format']('[%s][dials][newexten]',_0x5d7afe[_0x220d('0x3')]),_0x482b26);}};exports[_0x220d('0x13')]=function(_0x3e9017){try{utils[_0x220d('0xa')](util[_0x220d('0xb')](_0x220d('0x14'),_0x3e9017[_0x220d('0x3')]),_0x3e9017);if(!_[_0x220d('0x15')](_0x3e9017[_0x220d('0x16')][_0x220d('0x17')])){utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x18'),_0x3e9017[_0x220d('0x3')],_0x3e9017[_0x220d('0x19')]));dials[_0x3e9017[_0x220d('0x3')]]={'routeId':_0x3e9017[_0x220d('0x19')]};}}catch(_0x174b0c){utils[_0x220d('0x1a')](util[_0x220d('0xb')]('[%s][dials][varset]',_0x3e9017[_0x220d('0x3')]),_0x174b0c);}};exports['dialbegin']=function(_0x3f0568){try{if(!_[_0x220d('0x15')](dials[_0x3f0568[_0x220d('0x3')]])){utils['debug'](util[_0x220d('0xb')](_0x220d('0x1b'),_0x3f0568[_0x220d('0x3')]),_0x3f0568);dials[_0x3f0568['uniqueid']]=_[_0x220d('0x1c')](dials[_0x3f0568[_0x220d('0x3')]],_0x3f0568);dials[_0x3f0568[_0x220d('0x3')]]['starttime']=utils[_0x220d('0x1d')]();dials[_0x3f0568[_0x220d('0x3')]][_0x220d('0x1e')]=_0x220d('0x1f');utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x20'),_0x3f0568[_0x220d('0x3')],dials[_0x3f0568[_0x220d('0x3')]]['starttime']));}}catch(_0x224148){utils[_0x220d('0x1a')](util[_0x220d('0xb')](_0x220d('0x1b'),_0x3f0568[_0x220d('0x3')]),_0x224148);}};exports['dialend']=function(_0x523c0d){try{if(!_['isNil'](dials[_0x523c0d[_0x220d('0x3')]])){utils[_0x220d('0xa')](util['format'](_0x220d('0x21'),_0x523c0d[_0x220d('0x3')]),_0x523c0d);dials[_0x523c0d[_0x220d('0x3')]][_0x220d('0x8')]=_0x523c0d[_0x220d('0x8')];if(_0x523c0d[_0x220d('0x8')]==_0x220d('0x22')){dials[_0x523c0d[_0x220d('0x3')]]=_[_0x220d('0x1c')](dials[_0x523c0d['uniqueid']],_0x523c0d);dials[_0x523c0d[_0x220d('0x3')]][_0x220d('0x23')]=utils['now']();dials[_0x523c0d[_0x220d('0x3')]][_0x220d('0x1e')]=_0x220d('0x24');utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x25'),_0x523c0d[_0x220d('0x3')],_0x523c0d['dialstatus'],dials[_0x523c0d['uniqueid']]['answertime']));}else{utils[_0x220d('0xd')](util[_0x220d('0xb')](_0x220d('0x26'),_0x523c0d['uniqueid'],_0x523c0d[_0x220d('0x8')]));}}}catch(_0x2c1b6a){utils['error'](util[_0x220d('0xb')](_0x220d('0x21'),_0x523c0d['uniqueid']),_0x2c1b6a);}};exports[_0x220d('0x27')]=function(_0x144df5){try{if(!_['isNil'](dials[_0x144df5['uniqueid']])){utils[_0x220d('0xa')](util['format'](_0x220d('0x28'),_0x144df5[_0x220d('0x3')]),_0x144df5);utils[_0x220d('0xd')](util[_0x220d('0xb')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x144df5[_0x220d('0x3')],_0x144df5[_0x220d('0x6')],_0x144df5['calleridname'],_0x144df5[_0x220d('0x29')]));dials[_0x144df5[_0x220d('0x3')]]=_[_0x220d('0x1c')](dials[_0x144df5[_0x220d('0x3')]],{'endtime':utils[_0x220d('0x1d')](),'lastevent':_0x220d('0x2a')});dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2b')]=utils['diffTime'](dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2c')],dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2d')]);dials[_0x144df5[_0x220d('0x3')]]['holdtime']=utils[_0x220d('0x2e')](dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x23')]||dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2c')],dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2d')]);dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x2f')]=dials[_0x144df5[_0x220d('0x3')]][_0x220d('0x23')]?utils[_0x220d('0x2e')](dials[_0x144df5[_0x220d('0x3')]]['endtime'],dials[_0x144df5['uniqueid']][_0x220d('0x23')]):0x0;writeDB(dials[_0x144df5[_0x220d('0x3')]]);}}catch(_0x52a158){utils[_0x220d('0x1a')](util[_0x220d('0xb')](_0x220d('0x28'),_0x144df5[_0x220d('0x3')]),_0x52a158);}}; \ No newline at end of file +var _0xf283=['now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','complete','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf283,0xe2));var _0x3f28=function(_0x27eb9d,_0x1210d4){_0x27eb9d=_0x27eb9d-0x0;var _0x35b67d=_0xf283[_0x27eb9d];return _0x35b67d;};'use strict';var _=require(_0x3f28('0x0'));var util=require('util');var utils=require(_0x3f28('0x1'));var dials={};function writeDB(_0x5ec431){utils[_0x3f28('0x2')](util[_0x3f28('0x3')](_0x3f28('0x4'),_0x5ec431[_0x3f28('0x5')],_0x5ec431[_0x3f28('0x6')],_0x5ec431['dialstring'],_0x5ec431[_0x3f28('0x7')],_0x5ec431[_0x3f28('0x8')],_0x5ec431[_0x3f28('0x9')]));utils[_0x3f28('0xa')](_0x3f28('0xb'),_0x5ec431);delete dials[_0x5ec431[_0x3f28('0x5')]];}exports[_0x3f28('0xc')]=function(_0x5c9442){try{utils[_0x3f28('0xd')](util['format'](_0x3f28('0xe'),_0x5c9442[_0x3f28('0x5')]),_0x5c9442);utils[_0x3f28('0x2')](util[_0x3f28('0x3')](_0x3f28('0xf'),_0x5c9442['uniqueid'],_0x5c9442[_0x3f28('0x10')],_0x5c9442[_0x3f28('0x11')]));if(_0x5c9442[_0x3f28('0x10')][_0x3f28('0x12')]()==_0x3f28('0x13')&&_['startsWith'](_0x5c9442[_0x3f28('0x11')][_0x3f28('0x12')](),_0x3f28('0x14'))){var _0x118e62=_0x5c9442[_0x3f28('0x11')][_0x3f28('0x15')]('=');dials[_0x5c9442[_0x3f28('0x5')]]={'routeId':_0x118e62[0x1]};}}catch(_0x1f54f5){utils[_0x3f28('0x16')](util[_0x3f28('0x3')](_0x3f28('0xe'),_0x5c9442[_0x3f28('0x5')]),_0x1f54f5);}};exports[_0x3f28('0x17')]=function(_0x40c8c1){try{utils[_0x3f28('0xd')](util[_0x3f28('0x3')](_0x3f28('0x18'),_0x40c8c1[_0x3f28('0x5')]),_0x40c8c1);if(!_[_0x3f28('0x19')](_0x40c8c1[_0x3f28('0x1a')][_0x3f28('0x1b')])){utils[_0x3f28('0x2')](util[_0x3f28('0x3')](_0x3f28('0x1c'),_0x40c8c1[_0x3f28('0x5')],_0x40c8c1[_0x3f28('0x1d')]));dials[_0x40c8c1[_0x3f28('0x5')]]={'routeId':_0x40c8c1['value']};}}catch(_0x3a2ef7){utils[_0x3f28('0x16')](util['format'](_0x3f28('0x18'),_0x40c8c1[_0x3f28('0x5')]),_0x3a2ef7);}};exports[_0x3f28('0x1e')]=function(_0x30de69){try{if(!_[_0x3f28('0x19')](dials[_0x30de69[_0x3f28('0x5')]])){utils[_0x3f28('0xd')](util[_0x3f28('0x3')](_0x3f28('0x1f'),_0x30de69[_0x3f28('0x5')]),_0x30de69);dials[_0x30de69[_0x3f28('0x5')]]=_[_0x3f28('0x20')](dials[_0x30de69[_0x3f28('0x5')]],_0x30de69);dials[_0x30de69[_0x3f28('0x5')]][_0x3f28('0x21')]=utils[_0x3f28('0x22')]();dials[_0x30de69[_0x3f28('0x5')]][_0x3f28('0x23')]=_0x3f28('0x24');utils['info'](util[_0x3f28('0x3')](_0x3f28('0x25'),_0x30de69[_0x3f28('0x5')],dials[_0x30de69[_0x3f28('0x5')]][_0x3f28('0x21')]));}}catch(_0x1b56c5){utils['error'](util[_0x3f28('0x3')](_0x3f28('0x1f'),_0x30de69[_0x3f28('0x5')]),_0x1b56c5);}};exports['dialend']=function(_0x35c558){try{if(!_['isNil'](dials[_0x35c558[_0x3f28('0x5')]])){utils['debug'](util[_0x3f28('0x3')](_0x3f28('0x26'),_0x35c558['uniqueid']),_0x35c558);dials[_0x35c558[_0x3f28('0x5')]][_0x3f28('0x9')]=_0x35c558['dialstatus'];if(_0x35c558['dialstatus']==_0x3f28('0x27')){dials[_0x35c558[_0x3f28('0x5')]]=_[_0x3f28('0x20')](dials[_0x35c558[_0x3f28('0x5')]],_0x35c558);dials[_0x35c558[_0x3f28('0x5')]][_0x3f28('0x28')]=utils[_0x3f28('0x22')]();dials[_0x35c558[_0x3f28('0x5')]][_0x3f28('0x23')]=_0x3f28('0x29');utils['info'](util[_0x3f28('0x3')](_0x3f28('0x2a'),_0x35c558[_0x3f28('0x5')],_0x35c558[_0x3f28('0x9')],dials[_0x35c558[_0x3f28('0x5')]][_0x3f28('0x28')]));}else{utils[_0x3f28('0x2')](util['format'](_0x3f28('0x2b'),_0x35c558[_0x3f28('0x5')],_0x35c558[_0x3f28('0x9')]));}}}catch(_0x4b95ed){utils['error'](util[_0x3f28('0x3')](_0x3f28('0x26'),_0x35c558['uniqueid']),_0x4b95ed);}};exports[_0x3f28('0x2c')]=function(_0x4f6a0a){try{if(!_[_0x3f28('0x19')](dials[_0x4f6a0a[_0x3f28('0x5')]])){utils['debug'](util[_0x3f28('0x3')](_0x3f28('0x2d'),_0x4f6a0a[_0x3f28('0x5')]),_0x4f6a0a);utils[_0x3f28('0x2')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4f6a0a[_0x3f28('0x5')],_0x4f6a0a[_0x3f28('0x7')],_0x4f6a0a[_0x3f28('0x2e')],_0x4f6a0a['cause-txt']));dials[_0x4f6a0a['uniqueid']]=_['assign'](dials[_0x4f6a0a[_0x3f28('0x5')]],{'endtime':utils[_0x3f28('0x22')](),'lastevent':_0x3f28('0x2f')});dials[_0x4f6a0a['uniqueid']]['duration']=utils[_0x3f28('0x30')](dials[_0x4f6a0a[_0x3f28('0x5')]][_0x3f28('0x31')],dials[_0x4f6a0a[_0x3f28('0x5')]]['starttime']);dials[_0x4f6a0a[_0x3f28('0x5')]][_0x3f28('0x32')]=utils[_0x3f28('0x30')](dials[_0x4f6a0a[_0x3f28('0x5')]][_0x3f28('0x28')]||dials[_0x4f6a0a['uniqueid']][_0x3f28('0x31')],dials[_0x4f6a0a[_0x3f28('0x5')]][_0x3f28('0x21')]);dials[_0x4f6a0a[_0x3f28('0x5')]][_0x3f28('0x33')]=dials[_0x4f6a0a[_0x3f28('0x5')]]['answertime']?utils[_0x3f28('0x30')](dials[_0x4f6a0a['uniqueid']][_0x3f28('0x31')],dials[_0x4f6a0a[_0x3f28('0x5')]]['answertime']):0x0;writeDB(dials[_0x4f6a0a[_0x3f28('0x5')]]);}}catch(_0x37e753){utils[_0x3f28('0x16')](util['format'](_0x3f28('0x2d'),_0x4f6a0a[_0x3f28('0x5')]),_0x37e753);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index e11aa3e..76e0861 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 _0x3522=['debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][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]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','port','username','keepConnected','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3522,0xa9));var _0x2352=function(_0x4a9c1e,_0x2dfb18){_0x4a9c1e=_0x4a9c1e-0x0;var _0x417b7c=_0x3522[_0x4a9c1e];return _0x417b7c;};var AsteriskManager=require(_0x2352('0x0'));var config=require('../../config/environment');var utils=require(_0x2352('0x1'));var util=require(_0x2352('0x2'));var ami=new AsteriskManager(config[_0x2352('0x3')][_0x2352('0x4')],config[_0x2352('0x3')]['ip'],config[_0x2352('0x3')][_0x2352('0x5')],config[_0x2352('0x3')]['password'],!![]);ami[_0x2352('0x6')]();if(config['xdr']&&config['xdr'][_0x2352('0x7')]){utils['info'](_0x2352('0x8'));}else{var agents=require('./agents.controller');var calls=require(_0x2352('0x9'));var queues=require(_0x2352('0xa'));var recordings=require('./recordings.controller');var members=require(_0x2352('0xb'));var dials=require('./dials.controller');var transfers=require(_0x2352('0xc'));var core=require(_0x2352('0xd'));ami['on'](_0x2352('0xe'),core[_0x2352('0xe')]);ami['on'](_0x2352('0xf'),core[_0x2352('0xf')]);ami['on'](_0x2352('0x10'),core[_0x2352('0x10')]);ami['on'](_0x2352('0x11'),core[_0x2352('0x11')]);ami['on'](_0x2352('0x12'),core[_0x2352('0x12')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x2352('0x13'),function(_0x180c4a){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x15'),_0x180c4a[_0x2352('0x16')]),_0x180c4a);members['devicestatechange'](_0x180c4a);}catch(_0x3f345b){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x15'),_0x180c4a[_0x2352('0x16')]),_0x3f345b);}});ami['on'](_0x2352('0x18'),function(_0x2fc59){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x19'),_0x2fc59['uniqueid']),_0x2fc59);agents[_0x2352('0x18')](_0x2fc59);}catch(_0x14b3dc){utils['error'](util[_0x2352('0x17')](_0x2352('0x19'),_0x2fc59[_0x2352('0x1a')]),_0x14b3dc);}});ami['on']('agentringnoanswer',function(_0x4896d3){try{utils[_0x2352('0x14')](util[_0x2352('0x17')]('[%s][index][agentringnoanswer]',_0x4896d3[_0x2352('0x1a')]),_0x4896d3);agents['agentringnoanswer'](_0x4896d3);}catch(_0x34df2a){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x1b'),_0x4896d3[_0x2352('0x1a')]),_0x34df2a);}});ami['on'](_0x2352('0x1c'),function(_0x2ba10e){try{utils['debug'](util[_0x2352('0x17')](_0x2352('0x1d'),_0x2ba10e['uniqueid']),_0x2ba10e);agents[_0x2352('0x1c')](_0x2ba10e);queues['agentconnect'](_0x2ba10e);}catch(_0x265492){utils['error'](util[_0x2352('0x17')](_0x2352('0x1d'),_0x2ba10e[_0x2352('0x1a')]),_0x265492);}});ami['on'](_0x2352('0x1e'),function(_0x5717de){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x1f'),_0x5717de[_0x2352('0x1a')]),_0x5717de);agents[_0x2352('0x1e')](_0x5717de);queues[_0x2352('0x1e')](_0x5717de);members[_0x2352('0x1e')](_0x5717de);}catch(_0x29565b){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x1f'),_0x5717de['uniqueid']),_0x29565b);}});ami['on'](_0x2352('0x20'),function(_0x5ce448){try{utils['debug'](util[_0x2352('0x17')]('[%s][index][queuecallerabandon]',_0x5ce448['uniqueid']),_0x5ce448);agents[_0x2352('0x20')](_0x5ce448);queues[_0x2352('0x20')](_0x5ce448);}catch(_0x329f57){utils['error'](util['format'](_0x2352('0x21'),_0x5ce448[_0x2352('0x1a')]),_0x329f57);}});ami['on'](_0x2352('0x22'),function(_0x596c45){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x23'),_0x596c45[_0x2352('0x1a')]),_0x596c45);queues[_0x2352('0x22')](_0x596c45);recordings[_0x2352('0x22')](_0x596c45);}catch(_0x232c51){utils['error'](util[_0x2352('0x17')](_0x2352('0x23'),_0x596c45[_0x2352('0x1a')]),_0x232c51);}});ami['on']('queuecallerleave',function(_0x520231){try{utils['debug'](util[_0x2352('0x17')](_0x2352('0x24'),_0x520231['uniqueid']),_0x520231);queues[_0x2352('0x25')](_0x520231);}catch(_0x5609e7){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x24'),_0x520231[_0x2352('0x1a')]),_0x5609e7);}});ami['on'](_0x2352('0x26'),function(_0x26cf7b){try{utils[_0x2352('0x14')](util['format']('[%s][index][musiconholdstart]',_0x26cf7b[_0x2352('0x1a')]),_0x26cf7b);queues[_0x2352('0x26')](_0x26cf7b);calls[_0x2352('0x26')](_0x26cf7b);}catch(_0x1a1daa){utils['error'](util[_0x2352('0x17')](_0x2352('0x27'),_0x26cf7b[_0x2352('0x1a')]),_0x1a1daa);}});ami['on']('musiconholdstop',function(_0x1714ed){try{utils[_0x2352('0x14')](util['format'](_0x2352('0x28'),_0x1714ed[_0x2352('0x1a')]),_0x1714ed);queues[_0x2352('0x29')](_0x1714ed);calls[_0x2352('0x29')](_0x1714ed);}catch(_0x450966){utils['error'](util[_0x2352('0x17')](_0x2352('0x28'),_0x1714ed[_0x2352('0x1a')]),_0x450966);}});ami['on'](_0x2352('0x2a'),function(_0x1b380b){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x2b'),_0x1b380b[_0x2352('0x1a')]),_0x1b380b);calls[_0x2352('0x2a')](_0x1b380b);recordings['newstate'](_0x1b380b);}catch(_0x2095de){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x2b'),_0x1b380b[_0x2352('0x1a')]),_0x2095de);}});ami['on'](_0x2352('0x2c'),function(_0xb4f115){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x2d'),_0xb4f115[_0x2352('0x1a')]),_0xb4f115);calls[_0x2352('0x2c')](_0xb4f115);recordings[_0x2352('0x2c')](_0xb4f115);dials[_0x2352('0x2c')](_0xb4f115);agents[_0x2352('0x2c')](_0xb4f115);queues[_0x2352('0x2c')](_0xb4f115);}catch(_0xc1042f){utils[_0x2352('0x11')](util['format'](_0x2352('0x2d'),_0xb4f115[_0x2352('0x1a')]),_0xc1042f);}});ami['on'](_0x2352('0x2e'),function(_0x1ac4c3){try{utils[_0x2352('0x14')](util[_0x2352('0x17')]('[%s][index][cdr]',_0x1ac4c3[_0x2352('0x1a')]),_0x1ac4c3);members[_0x2352('0x2e')](_0x1ac4c3);}catch(_0x27c825){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x2f'),_0x1ac4c3[_0x2352('0x1a')]),_0x27c825);}});ami['on']('blindtransfer',function(_0x2d0ac2){try{utils['debug'](util[_0x2352('0x17')](_0x2352('0x30'),_0x2d0ac2['uniqueid']),_0x2d0ac2);queues[_0x2352('0x31')](_0x2d0ac2);agents[_0x2352('0x31')](_0x2d0ac2);transfers['blindtransfer'](_0x2d0ac2);recordings[_0x2352('0x31')](_0x2d0ac2);}catch(_0xa2f4de){utils[_0x2352('0x11')](util[_0x2352('0x17')]('[%s][index][blindtransfer]',_0x2d0ac2[_0x2352('0x1a')]),_0xa2f4de);}});ami['on'](_0x2352('0x32'),function(_0xa1499d){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x33'),_0xa1499d[_0x2352('0x34')]),_0xa1499d);queues[_0x2352('0x32')](_0xa1499d);transfers[_0x2352('0x32')](_0xa1499d);agents[_0x2352('0x32')](_0xa1499d);calls[_0x2352('0x32')](_0xa1499d);}catch(_0x4211a5){utils[_0x2352('0x11')](util['format']('[%s][index][attendedtransfer]',_0xa1499d[_0x2352('0x34')]),_0x4211a5);}});ami['on'](_0x2352('0x35'),function(_0x212743){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x36'),_0x212743[_0x2352('0x1a')]),_0x212743);queues[_0x2352('0x35')](_0x212743);recordings[_0x2352('0x35')](_0x212743);calls[_0x2352('0x35')](_0x212743);dials[_0x2352('0x35')](_0x212743);}catch(_0x4d4a8c){utils[_0x2352('0x11')](util['format'](_0x2352('0x36'),_0x212743[_0x2352('0x1a')]),_0x4d4a8c);}});ami['on'](_0x2352('0x37'),function(_0x261d75){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x38'),_0x261d75[_0x2352('0x1a')]),_0x261d75);calls[_0x2352('0x37')](_0x261d75);recordings['newexten'](_0x261d75);dials[_0x2352('0x37')](_0x261d75);}catch(_0x3bcfaf){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x38'),_0x261d75[_0x2352('0x1a')]),_0x3bcfaf);}});ami['on'](_0x2352('0x39'),function(_0x57fa7f){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x3a'),_0x57fa7f[_0x2352('0x1a')]),_0x57fa7f);calls[_0x2352('0x39')](_0x57fa7f);recordings[_0x2352('0x39')](_0x57fa7f);}catch(_0x964bfa){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x3a'),_0x57fa7f[_0x2352('0x1a')]),_0x964bfa);}});ami['on'](_0x2352('0x3b'),function(_0x2c3528){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x3c'),_0x2c3528['uniqueid']),_0x2c3528);dials[_0x2352('0x3b')](_0x2c3528);}catch(_0x50f990){utils['error'](util[_0x2352('0x17')]('[%s]dialbegin',_0x2c3528[_0x2352('0x1a')]),_0x50f990);}});ami['on'](_0x2352('0x3d'),function(_0x40efbc){try{utils[_0x2352('0x14')](util[_0x2352('0x17')](_0x2352('0x3e'),_0x40efbc[_0x2352('0x1a')]),_0x40efbc);dials[_0x2352('0x3d')](_0x40efbc);}catch(_0x20a825){utils[_0x2352('0x11')](util[_0x2352('0x17')](_0x2352('0x3e'),_0x40efbc['uniqueid']),_0x20a825);}});} \ No newline at end of file +var _0x8844=['[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel'];(function(_0x4717a5,_0x133cad){var _0xd3c128=function(_0x1150e3){while(--_0x1150e3){_0x4717a5['push'](_0x4717a5['shift']());}};_0xd3c128(++_0x133cad);}(_0x8844,0xcd));var _0x4884=function(_0x55af0d,_0x5db5c9){_0x55af0d=_0x55af0d-0x0;var _0x245085=_0x8844[_0x55af0d];return _0x245085;};var AsteriskManager=require('asterisk-manager');var config=require(_0x4884('0x0'));var utils=require(_0x4884('0x1'));var util=require(_0x4884('0x2'));var ami=new AsteriskManager(config[_0x4884('0x3')][_0x4884('0x4')],config[_0x4884('0x3')]['ip'],config[_0x4884('0x3')][_0x4884('0x5')],config['asterisk'][_0x4884('0x6')],!![]);ami[_0x4884('0x7')]();if(config[_0x4884('0x8')]&&config[_0x4884('0x8')][_0x4884('0x9')]){utils[_0x4884('0xa')](_0x4884('0xb'));}else{var agents=require(_0x4884('0xc'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x4884('0xd'));var members=require(_0x4884('0xe'));var dials=require(_0x4884('0xf'));var transfers=require(_0x4884('0x10'));var core=require(_0x4884('0x11'));ami['on'](_0x4884('0x12'),core[_0x4884('0x12')]);ami['on']('shutdown',core[_0x4884('0x13')]);ami['on'](_0x4884('0x14'),core[_0x4884('0x14')]);ami['on'](_0x4884('0x15'),core[_0x4884('0x15')]);ami['on'](_0x4884('0x16'),core['close']);ami['on']('managerevent',core[_0x4884('0x17')]);ami['on']('devicestatechange',function(_0x1981ce){try{utils['debug'](util[_0x4884('0x18')](_0x4884('0x19'),_0x1981ce[_0x4884('0x1a')]),_0x1981ce);members[_0x4884('0x1b')](_0x1981ce);}catch(_0x22e221){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x19'),_0x1981ce[_0x4884('0x1a')]),_0x22e221);}});ami['on'](_0x4884('0x1c'),function(_0xbf4f27){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x1e'),_0xbf4f27[_0x4884('0x1f')]),_0xbf4f27);agents[_0x4884('0x1c')](_0xbf4f27);}catch(_0x1ca2cc){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x1e'),_0xbf4f27[_0x4884('0x1f')]),_0x1ca2cc);}});ami['on'](_0x4884('0x20'),function(_0x217c64){try{utils[_0x4884('0x1d')](util['format']('[%s][index][agentringnoanswer]',_0x217c64[_0x4884('0x1f')]),_0x217c64);agents[_0x4884('0x20')](_0x217c64);}catch(_0x418260){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x21'),_0x217c64['uniqueid']),_0x418260);}});ami['on'](_0x4884('0x22'),function(_0x2a28aa){try{utils[_0x4884('0x1d')](util['format'](_0x4884('0x23'),_0x2a28aa[_0x4884('0x1f')]),_0x2a28aa);agents[_0x4884('0x22')](_0x2a28aa);queues[_0x4884('0x22')](_0x2a28aa);}catch(_0x5ef788){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x23'),_0x2a28aa[_0x4884('0x1f')]),_0x5ef788);}});ami['on']('agentcomplete',function(_0x35bb7f){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x24'),_0x35bb7f['uniqueid']),_0x35bb7f);agents['agentcomplete'](_0x35bb7f);queues['agentcomplete'](_0x35bb7f);members[_0x4884('0x25')](_0x35bb7f);}catch(_0x40b58c){utils[_0x4884('0x15')](util['format'](_0x4884('0x24'),_0x35bb7f[_0x4884('0x1f')]),_0x40b58c);}});ami['on']('queuecallerabandon',function(_0x131f27){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x26'),_0x131f27['uniqueid']),_0x131f27);agents['queuecallerabandon'](_0x131f27);queues['queuecallerabandon'](_0x131f27);}catch(_0x159222){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x26'),_0x131f27[_0x4884('0x1f')]),_0x159222);}});ami['on'](_0x4884('0x27'),function(_0x245322){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x28'),_0x245322[_0x4884('0x1f')]),_0x245322);queues[_0x4884('0x27')](_0x245322);recordings[_0x4884('0x27')](_0x245322);}catch(_0x272c5b){utils[_0x4884('0x15')](util['format'](_0x4884('0x28'),_0x245322[_0x4884('0x1f')]),_0x272c5b);}});ami['on'](_0x4884('0x29'),function(_0xaf8a){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x2a'),_0xaf8a[_0x4884('0x1f')]),_0xaf8a);queues[_0x4884('0x29')](_0xaf8a);}catch(_0x1014f8){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x2a'),_0xaf8a['uniqueid']),_0x1014f8);}});ami['on'](_0x4884('0x2b'),function(_0x38f488){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')]('[%s][index][musiconholdstart]',_0x38f488[_0x4884('0x1f')]),_0x38f488);queues[_0x4884('0x2b')](_0x38f488);calls[_0x4884('0x2b')](_0x38f488);}catch(_0x2ce6b3){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x2c'),_0x38f488['uniqueid']),_0x2ce6b3);}});ami['on'](_0x4884('0x2d'),function(_0x2bf6f9){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x2e'),_0x2bf6f9[_0x4884('0x1f')]),_0x2bf6f9);queues[_0x4884('0x2d')](_0x2bf6f9);calls[_0x4884('0x2d')](_0x2bf6f9);}catch(_0x18ed02){utils[_0x4884('0x15')](util['format'](_0x4884('0x2e'),_0x2bf6f9[_0x4884('0x1f')]),_0x18ed02);}});ami['on']('newstate',function(_0x592014){try{utils['debug'](util['format'](_0x4884('0x2f'),_0x592014[_0x4884('0x1f')]),_0x592014);calls[_0x4884('0x30')](_0x592014);recordings[_0x4884('0x30')](_0x592014);}catch(_0x51c179){utils['error'](util[_0x4884('0x18')]('[%s][index][newstate]',_0x592014[_0x4884('0x1f')]),_0x51c179);}});ami['on'](_0x4884('0x31'),function(_0x2459c5){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x32'),_0x2459c5[_0x4884('0x1f')]),_0x2459c5);calls[_0x4884('0x31')](_0x2459c5);recordings[_0x4884('0x31')](_0x2459c5);dials['hangup'](_0x2459c5);agents[_0x4884('0x31')](_0x2459c5);queues[_0x4884('0x31')](_0x2459c5);}catch(_0x2104a9){utils[_0x4884('0x15')](util[_0x4884('0x18')]('[%s][index][hangup]',_0x2459c5[_0x4884('0x1f')]),_0x2104a9);}});ami['on']('cdr',function(_0x538ca9){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x33'),_0x538ca9[_0x4884('0x1f')]),_0x538ca9);members[_0x4884('0x34')](_0x538ca9);}catch(_0x2e8bc1){utils['error'](util[_0x4884('0x18')](_0x4884('0x33'),_0x538ca9[_0x4884('0x1f')]),_0x2e8bc1);}});ami['on'](_0x4884('0x35'),function(_0x312f90){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')]('[%s][index][blindtransfer]',_0x312f90[_0x4884('0x1f')]),_0x312f90);queues[_0x4884('0x35')](_0x312f90);agents[_0x4884('0x35')](_0x312f90);transfers['blindtransfer'](_0x312f90);recordings['blindtransfer'](_0x312f90);}catch(_0x193fc0){utils['error'](util['format'](_0x4884('0x36'),_0x312f90[_0x4884('0x1f')]),_0x193fc0);}});ami['on'](_0x4884('0x37'),function(_0x4c3b99){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x38'),_0x4c3b99['origtransfereruniqueid']),_0x4c3b99);queues[_0x4884('0x37')](_0x4c3b99);transfers['attendedtransfer'](_0x4c3b99);agents[_0x4884('0x37')](_0x4c3b99);calls[_0x4884('0x37')](_0x4c3b99);}catch(_0x313820){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x38'),_0x4c3b99[_0x4884('0x39')]),_0x313820);}});ami['on'](_0x4884('0x3a'),function(_0x33b35b){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x3b'),_0x33b35b[_0x4884('0x1f')]),_0x33b35b);queues[_0x4884('0x3a')](_0x33b35b);recordings[_0x4884('0x3a')](_0x33b35b);calls[_0x4884('0x3a')](_0x33b35b);dials[_0x4884('0x3a')](_0x33b35b);}catch(_0x329150){utils['error'](util[_0x4884('0x18')](_0x4884('0x3b'),_0x33b35b[_0x4884('0x1f')]),_0x329150);}});ami['on'](_0x4884('0x3c'),function(_0x4f1eab){try{utils[_0x4884('0x1d')](util['format'](_0x4884('0x3d'),_0x4f1eab['uniqueid']),_0x4f1eab);calls['newexten'](_0x4f1eab);recordings[_0x4884('0x3c')](_0x4f1eab);dials[_0x4884('0x3c')](_0x4f1eab);}catch(_0x211553){utils[_0x4884('0x15')](util['format'](_0x4884('0x3d'),_0x4f1eab[_0x4884('0x1f')]),_0x211553);}});ami['on'](_0x4884('0x3e'),function(_0x5119c5){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x3f'),_0x5119c5[_0x4884('0x1f')]),_0x5119c5);calls[_0x4884('0x3e')](_0x5119c5);recordings[_0x4884('0x3e')](_0x5119c5);}catch(_0x504c76){utils[_0x4884('0x15')](util[_0x4884('0x18')](_0x4884('0x3f'),_0x5119c5[_0x4884('0x1f')]),_0x504c76);}});ami['on'](_0x4884('0x40'),function(_0x18cbe6){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x41'),_0x18cbe6[_0x4884('0x1f')]),_0x18cbe6);dials['dialbegin'](_0x18cbe6);}catch(_0x3c8398){utils['error'](util[_0x4884('0x18')]('[%s]dialbegin',_0x18cbe6[_0x4884('0x1f')]),_0x3c8398);}});ami['on']('dialend',function(_0xeda8aa){try{utils[_0x4884('0x1d')](util[_0x4884('0x18')](_0x4884('0x42'),_0xeda8aa['uniqueid']),_0xeda8aa);dials['dialend'](_0xeda8aa);}catch(_0x3c2128){utils[_0x4884('0x15')](util[_0x4884('0x18')]('[%s][index][dialend]',_0xeda8aa[_0x4884('0x1f')]),_0x3c2128);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8d9e6b9..abd2a80 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 _0xcebd=['data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','./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','internal','request','CreateMemberReport','name','catch','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','[%s][members][cdr]','channel','split','assign','data1','data2'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xcebd,0x15c));var _0xdceb=function(_0x562416,_0x4b979f){_0x562416=_0x562416-0x0;var _0x49498a=_0xcebd[_0x562416];return _0x49498a;};'use strict';var _=require(_0xdceb('0x0'));var util=require('util');var utils=require(_0xdceb('0x1'));var members={};var exclude=[_0xdceb('0x2'),_0xdceb('0x3')];function writeDB(_0x4b1472){utils[_0xdceb('0x4')](util[_0xdceb('0x5')](_0xdceb('0x6'),_0x4b1472[_0xdceb('0x7')],_0x4b1472[_0xdceb('0x8')],_0x4b1472['channel'],_0x4b1472['data2'],_0x4b1472[_0xdceb('0x9')],_0x4b1472[_0xdceb('0xa')]));if(_0x4b1472[_0xdceb('0x8')]){utils['getUserByInterface'](_0x4b1472[_0xdceb('0x8')])[_0xdceb('0xb')](function(_0x18c45d){if(_0x18c45d){_0x4b1472[_0xdceb('0x9')]=_0x18c45d['name'];_0x4b1472[_0xdceb('0xc')]=_0x18c45d['internal'];utils[_0xdceb('0xd')](_0xdceb('0xe'),_0x4b1472);}else{utils['getUserByName'](_0x4b1472[_0xdceb('0x8')]['split']('/')[0x1])[_0xdceb('0xb')](function(_0x5bded7){if(_0x5bded7){_0x4b1472[_0xdceb('0x9')]=_0x5bded7[_0xdceb('0xf')];_0x4b1472[_0xdceb('0xc')]=_0x5bded7[_0xdceb('0xc')];utils['request'](_0xdceb('0xe'),_0x4b1472);}});}})[_0xdceb('0x10')](function(_0x426b34){utils[_0xdceb('0x11')](util[_0xdceb('0x5')]('[%s][members][writeDB]',_0x4b1472[_0xdceb('0x7')]),_0x426b34);});}delete members[_0x4b1472[_0xdceb('0x8')]];}function startsWith(_0x4fc8ea,_0x213e80){return _[_0xdceb('0x12')](_0x4fc8ea,function(_0x45ff2d){return _['startsWith'](_0x213e80,_0x45ff2d);});}exports[_0xdceb('0x13')]=function(_0x434de3){try{utils[_0xdceb('0x14')](util[_0xdceb('0x5')](_0xdceb('0x15'),members[_0x434de3[_0xdceb('0x16')]]?members[_0x434de3['device']]['uniqueid']:_0x434de3[_0xdceb('0x16')]),_0x434de3);utils[_0xdceb('0x4')](util['format'](_0xdceb('0x17'),members[_0x434de3[_0xdceb('0x16')]]?members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x7')]:_0x434de3['device'],_0x434de3['state'],_0x434de3[_0xdceb('0x16')]));switch(_0x434de3[_0xdceb('0x18')]){case _0xdceb('0x19'):case _0xdceb('0x1a'):if(!startsWith(exclude,_0x434de3[_0xdceb('0x16')])){members[_0x434de3[_0xdceb('0x16')]]={'channel':'voice','interface':_0x434de3[_0xdceb('0x16')],'type':_0xdceb('0x1b'),'enterAt':utils[_0xdceb('0x1c')](),'role':_0xdceb('0x1d')};}break;case _0xdceb('0x1e'):if(!_[_0xdceb('0x1f')](members[_0x434de3[_0xdceb('0x16')]])){members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x20')]=utils[_0xdceb('0x1c')]();members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x21')]=utils[_0xdceb('0x22')](members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x20')],members[_0x434de3[_0xdceb('0x16')]]['enterAt']);if(members[_0x434de3[_0xdceb('0x16')]][_0xdceb('0x7')]){writeDB(members[_0x434de3[_0xdceb('0x16')]]);}}break;default:break;}}catch(_0x4e5ca2){utils[_0xdceb('0x11')](util[_0xdceb('0x5')](_0xdceb('0x15'),members[_0x434de3[_0xdceb('0x16')]]?members[_0x434de3['device']]['uniqueid']:_0x434de3['device']),_0x4e5ca2);}};exports['agentcomplete']=function(_0x587d95){try{if(!_['isNil'](members[_0x587d95[_0xdceb('0x8')]])){utils['debug'](util[_0xdceb('0x5')]('[%s][members][agentcomplete]',_0x587d95[_0xdceb('0x7')]),_0x587d95);utils[_0xdceb('0x4')](util['format'](_0xdceb('0x23'),_0x587d95[_0xdceb('0x7')],_0x587d95[_0xdceb('0x8')],_0x587d95[_0xdceb('0x24')]));members[_0x587d95[_0xdceb('0x8')]]=_['assign'](members[_0x587d95[_0xdceb('0x8')]],{'data4':_0x587d95[_0xdceb('0x24')],'uniqueid':_0x587d95[_0xdceb('0x7')]});}}catch(_0x136c17){utils[_0xdceb('0x11')](util[_0xdceb('0x5')](_0xdceb('0x25'),_0x587d95[_0xdceb('0x7')]),_0x136c17);}};exports['cdr']=function(_0x46a04c){try{utils['debug'](util[_0xdceb('0x5')](_0xdceb('0x26'),_0x46a04c[_0xdceb('0x7')]),_0x46a04c);if(_0x46a04c[_0xdceb('0x27')]){var _0x4fea13=_0x46a04c[_0xdceb('0x27')][_0xdceb('0x28')]('-')[0x0];if(!_[_0xdceb('0x1f')](members[_0x4fea13])){members[_0x4fea13]=_[_0xdceb('0x29')](members[_0x4fea13],{'data1':members[_0x4fea13][_0xdceb('0x2a')]||_0x46a04c['type'],'data2':members[_0x4fea13][_0xdceb('0x2b')]||_0x46a04c['source'],'data3':members[_0x4fea13][_0xdceb('0x2c')]||_0x46a04c[_0xdceb('0x2d')],'uniqueid':members[_0x4fea13]['uniqueid']||_0x46a04c['uniqueid']});utils[_0xdceb('0x4')](util[_0xdceb('0x5')](_0xdceb('0x2e'),_0x46a04c[_0xdceb('0x7')],members[_0x4fea13][_0xdceb('0x2a')],members[_0x4fea13]['data2'],members[_0x4fea13]['data3']));if(members[_0x4fea13][_0xdceb('0x20')]){writeDB(members[_0x4fea13]);}}}if(_0x46a04c[_0xdceb('0x2f')]){var _0x4f3972=_0x46a04c[_0xdceb('0x2f')][_0xdceb('0x28')]('-')[0x0];if(!_['isNil'](members[_0x4f3972])){members[_0x4f3972]=_['assign'](members[_0x4f3972],{'data1':members[_0x4f3972]['data1']||_0x46a04c[_0xdceb('0xa')],'data2':members[_0x4f3972][_0xdceb('0x2b')]||_0x46a04c[_0xdceb('0x30')],'data3':members[_0x4f3972][_0xdceb('0x2c')]||_0x46a04c[_0xdceb('0x2d')],'uniqueid':members[_0x4f3972][_0xdceb('0x7')]||_0x46a04c['uniqueid']});utils[_0xdceb('0x4')](util[_0xdceb('0x5')](_0xdceb('0x2e'),_0x46a04c[_0xdceb('0x7')],members[_0x4f3972][_0xdceb('0x2a')],members[_0x4f3972][_0xdceb('0x2b')],members[_0x4f3972][_0xdceb('0x2c')]));if(members[_0x4f3972][_0xdceb('0x20')]){writeDB(members[_0x4f3972]);}}}}catch(_0x27ec0c){utils[_0xdceb('0x11')](util[_0xdceb('0x5')](_0xdceb('0x26'),_0x46a04c[_0xdceb('0x7')]),_0x27ec0c);}}; \ No newline at end of file +var _0x155d=['membername','type','interface','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','name','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','format','device','uniqueid','state','INUSE','voice','TALKING','now','NOT_INUSE','exitAt','diffTime','error','agentcomplete','isNil','[%s][members][agentcomplete]','queue','[%s][members][cdr]','assign','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','info','channel','data2'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x155d,0x89));var _0xd155=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x155d[_0x3bab09];return _0x164376;};'use strict';var _=require(_0xd155('0x0'));var util=require(_0xd155('0x1'));var utils=require(_0xd155('0x2'));var members={};var exclude=[_0xd155('0x3'),'Queue:'];function writeDB(_0x2526f7){utils[_0xd155('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2526f7['uniqueid'],_0x2526f7['interface'],_0x2526f7[_0xd155('0x5')],_0x2526f7[_0xd155('0x6')],_0x2526f7[_0xd155('0x7')],_0x2526f7[_0xd155('0x8')]));if(_0x2526f7[_0xd155('0x9')]){utils[_0xd155('0xa')](_0x2526f7[_0xd155('0x9')])[_0xd155('0xb')](function(_0x288f54){if(_0x288f54){_0x2526f7[_0xd155('0x7')]=_0x288f54['name'];_0x2526f7[_0xd155('0xc')]=_0x288f54['internal'];utils[_0xd155('0xd')](_0xd155('0xe'),_0x2526f7);}else{utils[_0xd155('0xf')](_0x2526f7[_0xd155('0x9')][_0xd155('0x10')]('/')[0x1])[_0xd155('0xb')](function(_0x1e56be){if(_0x1e56be){_0x2526f7[_0xd155('0x7')]=_0x1e56be[_0xd155('0x11')];_0x2526f7[_0xd155('0xc')]=_0x1e56be[_0xd155('0xc')];utils[_0xd155('0xd')]('CreateMemberReport',_0x2526f7);}});}})[_0xd155('0x12')](function(_0x101285){utils['error'](util['format'](_0xd155('0x13'),_0x2526f7['uniqueid']),_0x101285);});}delete members[_0x2526f7['interface']];}function startsWith(_0xb37166,_0x3195e8){return _[_0xd155('0x14')](_0xb37166,function(_0x39d2e6){return _[_0xd155('0x15')](_0x3195e8,_0x39d2e6);});}exports[_0xd155('0x16')]=function(_0x111445){try{utils[_0xd155('0x17')](util[_0xd155('0x18')]('[%s][members][devicestatechange]',members[_0x111445[_0xd155('0x19')]]?members[_0x111445['device']]['uniqueid']:_0x111445[_0xd155('0x19')]),_0x111445);utils[_0xd155('0x4')](util[_0xd155('0x18')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x111445[_0xd155('0x19')]]?members[_0x111445[_0xd155('0x19')]][_0xd155('0x1a')]:_0x111445[_0xd155('0x19')],_0x111445[_0xd155('0x1b')],_0x111445[_0xd155('0x19')]));switch(_0x111445[_0xd155('0x1b')]){case _0xd155('0x1c'):case'BUSY':if(!startsWith(exclude,_0x111445[_0xd155('0x19')])){members[_0x111445[_0xd155('0x19')]]={'channel':_0xd155('0x1d'),'interface':_0x111445[_0xd155('0x19')],'type':_0xd155('0x1e'),'enterAt':utils[_0xd155('0x1f')](),'role':'agent'};}break;case _0xd155('0x20'):if(!_['isNil'](members[_0x111445[_0xd155('0x19')]])){members[_0x111445[_0xd155('0x19')]][_0xd155('0x21')]=utils[_0xd155('0x1f')]();members[_0x111445['device']]['duration']=utils[_0xd155('0x22')](members[_0x111445[_0xd155('0x19')]][_0xd155('0x21')],members[_0x111445[_0xd155('0x19')]]['enterAt']);if(members[_0x111445[_0xd155('0x19')]][_0xd155('0x1a')]){writeDB(members[_0x111445[_0xd155('0x19')]]);}}break;default:break;}}catch(_0x1f243c){utils[_0xd155('0x23')](util[_0xd155('0x18')]('[%s][members][devicestatechange]',members[_0x111445['device']]?members[_0x111445[_0xd155('0x19')]][_0xd155('0x1a')]:_0x111445[_0xd155('0x19')]),_0x1f243c);}};exports[_0xd155('0x24')]=function(_0x49f513){try{if(!_[_0xd155('0x25')](members[_0x49f513['interface']])){utils[_0xd155('0x17')](util['format'](_0xd155('0x26'),_0x49f513[_0xd155('0x1a')]),_0x49f513);utils['info'](util[_0xd155('0x18')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x49f513[_0xd155('0x1a')],_0x49f513[_0xd155('0x9')],_0x49f513[_0xd155('0x27')]));members[_0x49f513[_0xd155('0x9')]]=_['assign'](members[_0x49f513[_0xd155('0x9')]],{'data4':_0x49f513['queue'],'uniqueid':_0x49f513[_0xd155('0x1a')]});}}catch(_0x49d400){utils['error'](util[_0xd155('0x18')]('[%s][members][agentcomplete]',_0x49f513[_0xd155('0x1a')]),_0x49d400);}};exports['cdr']=function(_0x358af8){try{utils[_0xd155('0x17')](util[_0xd155('0x18')](_0xd155('0x28'),_0x358af8['uniqueid']),_0x358af8);if(_0x358af8[_0xd155('0x5')]){var _0x24f45e=_0x358af8[_0xd155('0x5')][_0xd155('0x10')]('-')[0x0];if(!_[_0xd155('0x25')](members[_0x24f45e])){members[_0x24f45e]=_[_0xd155('0x29')](members[_0x24f45e],{'data1':members[_0x24f45e][_0xd155('0x2a')]||_0x358af8[_0xd155('0x8')],'data2':members[_0x24f45e][_0xd155('0x6')]||_0x358af8[_0xd155('0x2b')],'data3':members[_0x24f45e][_0xd155('0x2c')]||_0x358af8[_0xd155('0x2d')],'uniqueid':members[_0x24f45e]['uniqueid']||_0x358af8[_0xd155('0x1a')]});utils[_0xd155('0x4')](util[_0xd155('0x18')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x358af8[_0xd155('0x1a')],members[_0x24f45e][_0xd155('0x2a')],members[_0x24f45e][_0xd155('0x6')],members[_0x24f45e]['data3']));if(members[_0x24f45e][_0xd155('0x21')]){writeDB(members[_0x24f45e]);}}}if(_0x358af8[_0xd155('0x2e')]){var _0x361c8a=_0x358af8['destinationchannel'][_0xd155('0x10')]('-')[0x0];if(!_[_0xd155('0x25')](members[_0x361c8a])){members[_0x361c8a]=_[_0xd155('0x29')](members[_0x361c8a],{'data1':members[_0x361c8a][_0xd155('0x2a')]||_0x358af8[_0xd155('0x8')],'data2':members[_0x361c8a][_0xd155('0x6')]||_0x358af8[_0xd155('0x2b')],'data3':members[_0x361c8a]['data3']||_0x358af8[_0xd155('0x2d')],'uniqueid':members[_0x361c8a][_0xd155('0x1a')]||_0x358af8[_0xd155('0x1a')]});utils[_0xd155('0x4')](util['format'](_0xd155('0x2f'),_0x358af8[_0xd155('0x1a')],members[_0x361c8a][_0xd155('0x2a')],members[_0x361c8a]['data2'],members[_0x361c8a]['data3']));if(members[_0x361c8a][_0xd155('0x21')]){writeDB(members[_0x361c8a]);}}}}catch(_0x581648){utils[_0xd155('0x23')](util[_0xd155('0x18')](_0xd155('0x28'),_0x358af8[_0xd155('0x1a')]),_0x581648);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 561d6ac..dc5be69 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 _0xabfb=['accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','assign','position','now','hangup','isNil','debug','[%s][queues][hangup]','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum'];(function(_0x4fe416,_0x5a310a){var _0x252725=function(_0x1d67db){while(--_0x1d67db){_0x4fe416['push'](_0x4fe416['shift']());}};_0x252725(++_0x5a310a);}(_0xabfb,0x12d));var _0xbabf=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xabfb[_0x4914ad];return _0x3cd61f;};'use strict';var _=require(_0xbabf('0x0'));var util=require(_0xbabf('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x110b6f){utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x4'),_0x110b6f['uniqueid'],_0x110b6f[_0xbabf('0x5')],_0x110b6f[_0xbabf('0x6')],_0x110b6f['lastAssignedTo'],_0x110b6f[_0xbabf('0x7')],_0x110b6f[_0xbabf('0x8')],_0x110b6f[_0xbabf('0x9')]));if(_0x110b6f['queue']){utils[_0xbabf('0xa')](_0x110b6f[_0xbabf('0x6')])['then'](function(_0x9c3bd4){if(_0x9c3bd4){_0x110b6f[_0xbabf('0xb')]=_0x9c3bd4[_0xbabf('0xb')];}utils['request'](_0xbabf('0xc'),_0x110b6f);});}else{utils['request']('CreateVoiceQueueReport',_0x110b6f);}if(_0x110b6f[_0xbabf('0xd')]){delete queues[_0x110b6f['transfereduniqueid']];}else{delete queues[_0x110b6f[_0xbabf('0xe')]];}}exports[_0xbabf('0xf')]=function(_0x4237e7){try{utils['debug'](util['format'](_0xbabf('0x10'),_0x4237e7[_0xbabf('0xe')]),_0x4237e7);utils['info'](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4237e7[_0xbabf('0xe')],_0x4237e7[_0xbabf('0x6')],_0x4237e7['position']));queues[_0x4237e7['uniqueid']]=_[_0xbabf('0x11')](_0x4237e7,{'originalposition':_0x4237e7[_0xbabf('0x12')],'queuecallerjoinAt':utils[_0xbabf('0x13')](),'mohtime':0x0});}catch(_0x218bdb){utils['error'](util[_0xbabf('0x3')](_0xbabf('0x10'),_0x4237e7[_0xbabf('0xe')]),_0x218bdb);}};exports[_0xbabf('0x14')]=function(_0x516598){try{if(!_[_0xbabf('0x15')](queues[_0x516598[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x17'),_0x516598['uniqueid']),_0x516598);if(queues[_0x516598['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x516598['uniqueid']]['queuecallerabandon']&&!queues[_0x516598[_0xbabf('0xe')]]['queuecallerexit']){queues[_0x516598[_0xbabf('0xe')]]['queuecallercomplete']=!![];queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0x18')]=utils[_0xbabf('0x13')]();queues[_0x516598['uniqueid']][_0xbabf('0x9')]=_0xbabf('0x19');}utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x1a'),_0x516598[_0xbabf('0xe')],queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x516598['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x516598[_0xbabf('0xe')]]);}else if(queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0xd')]){utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x1c'),_0x516598['uniqueid'],queues[_0x516598['uniqueid']][_0xbabf('0x1b')],queues[_0x516598['uniqueid']][_0xbabf('0xd')]));queues[queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0xd')]]=queues[_0x516598[_0xbabf('0xe')]];queues[queues[_0x516598[_0xbabf('0xe')]][_0xbabf('0xd')]][_0xbabf('0x1d')]=0x2;delete queues[_0x516598[_0xbabf('0xe')]];}}}catch(_0x1d6b6d){utils['error'](util[_0xbabf('0x3')]('[%s][queues][hangup]',_0x516598['uniqueid']),_0x1d6b6d);}};exports[_0xbabf('0x1e')]=function(_0x564f09){try{utils['debug'](util[_0xbabf('0x3')]('[%s][queues][varset]',_0x564f09[_0xbabf('0xe')]),_0x564f09);if(!_[_0xbabf('0x15')](_0x564f09[_0xbabf('0x1f')]['queuestatus'])&&_0x564f09[_0xbabf('0x20')][_0xbabf('0x21')]()!==_0xbabf('0x22')){if(!_[_0xbabf('0x15')](queues[_0x564f09[_0xbabf('0xe')]])){queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x24')]=null;queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x25')]=!![];queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x26')]=utils[_0xbabf('0x13')]();queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x9')]=_0x564f09['value'][_0xbabf('0x21')]();utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x27'),_0x564f09['uniqueid'],queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x1b')],_0x564f09[_0xbabf('0x20')],queues[_0x564f09['uniqueid']][_0xbabf('0x9')]));writeDB(queues[_0x564f09[_0xbabf('0xe')]]);}}else if(!_[_0xbabf('0x15')](_0x564f09[_0xbabf('0x1f')][_0xbabf('0x28')])){if(!_[_0xbabf('0x15')](queues[_0x564f09[_0xbabf('0xe')]])&&!queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x23')]){queues[_0x564f09[_0xbabf('0xe')]]['queuecallerabandon']=![];queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x24')]=null;queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x25')]=!![];queues[_0x564f09['uniqueid']]['queuecallerexitAt']=utils[_0xbabf('0x13')]();queues[_0x564f09['uniqueid']][_0xbabf('0x9')]='EXITWITHKEY';utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x29'),_0x564f09[_0xbabf('0xe')],queues[_0x564f09[_0xbabf('0xe')]][_0xbabf('0x1b')],_0x564f09[_0xbabf('0x20')],queues[_0x564f09['uniqueid']]['queuecallerexitreason']));}}}catch(_0x47f006){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x2b'),_0x564f09[_0xbabf('0xe')]),_0x47f006);}};exports['queuecallerabandon']=function(_0x21f1b5){try{if(!_[_0xbabf('0x15')](queues[_0x21f1b5['uniqueid']])){utils['debug'](util['format'](_0xbabf('0x2c'),_0x21f1b5[_0xbabf('0xe')]),_0x21f1b5);queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x25')]=![];queues[_0x21f1b5[_0xbabf('0xe')]]['queuecallerexitAt']=null;queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x23')]=!![];queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x24')]=utils[_0xbabf('0x13')]();queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x9')]=_0xbabf('0x2d');utils['info'](util[_0xbabf('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x21f1b5[_0xbabf('0xe')],queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x21f1b5[_0xbabf('0xe')]][_0xbabf('0x9')]));}}catch(_0x5b4529){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x2c'),_0x21f1b5[_0xbabf('0xe')]),_0x5b4529);}};exports[_0xbabf('0x2e')]=function(_0x302c70){try{if(!_[_0xbabf('0x15')](queues[_0x302c70[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x2f'),_0x302c70[_0xbabf('0xe')]),_0x302c70);utils['info'](util[_0xbabf('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x302c70[_0xbabf('0xe')],queues[_0x302c70[_0xbabf('0xe')]]['name'],_0x302c70[_0xbabf('0x30')],_0x302c70[_0xbabf('0x31')]));queues[_0x302c70[_0xbabf('0xe')]]['queuecallerleave']=!![];queues[_0x302c70['uniqueid']][_0xbabf('0x32')]=utils['now']();queues[_0x302c70[_0xbabf('0xe')]][_0xbabf('0x33')]=utils[_0xbabf('0x34')](queues[_0x302c70['uniqueid']][_0xbabf('0x32')],queues[_0x302c70[_0xbabf('0xe')]][_0xbabf('0x35')]);queues[_0x302c70[_0xbabf('0xe')]]['position']=_0x302c70[_0xbabf('0x12')];queues[_0x302c70[_0xbabf('0xe')]][_0xbabf('0x36')]=_0x302c70[_0xbabf('0x36')];queues[_0x302c70['uniqueid']][_0xbabf('0x30')]=_0x302c70[_0xbabf('0x30')];queues[_0x302c70['uniqueid']][_0xbabf('0x31')]=_0x302c70[_0xbabf('0x31')];}}catch(_0x3d62ac){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x2f'),_0x302c70['uniqueid']),_0x3d62ac);}};exports[_0xbabf('0x37')]=function(_0x5d239d){try{if(!_[_0xbabf('0x15')](queues[_0x5d239d[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x38'),_0x5d239d[_0xbabf('0xe')]),_0x5d239d);utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x39'),_0x5d239d['uniqueid'],queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x1b')],_0x5d239d['membername'],_0x5d239d['destaccountcode']));queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x5d239d['uniqueid']][_0xbabf('0x24')]=null;queues[_0x5d239d['uniqueid']]['queuecallerexit']=![];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x9')]=null;queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x26')]=null;queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x3a')]=!![];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x8')]=_0x5d239d[_0xbabf('0x3b')];queues[_0x5d239d[_0xbabf('0xe')]][_0xbabf('0x3c')]=_0x5d239d[_0xbabf('0x3d')];}}catch(_0x4cb772){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')]('[%s][queues][agentconnect]',_0x5d239d['uniqueid']),_0x4cb772);}};exports[_0xbabf('0x3e')]=function(_0x3da4e1){try{if(!_['isNil'](queues[_0x3da4e1['uniqueid']])){if(queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x32')]){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x3f'),_0x3da4e1[_0xbabf('0xe')]),_0x3da4e1);queues[_0x3da4e1['uniqueid']][_0xbabf('0x23')]=![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x23')]=![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x24')]=null;queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x25')]=![];queues[_0x3da4e1[_0xbabf('0xe')]]['queuecallerexitAt']=null;queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x3a')]=!![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x3c')]=_0x3da4e1[_0xbabf('0x3d')];queues[_0x3da4e1['uniqueid']]['queuecallercomplete']=!![];queues[_0x3da4e1[_0xbabf('0xe')]][_0xbabf('0x18')]=utils[_0xbabf('0x13')]();if(_0x3da4e1[_0xbabf('0x40')]==_0xbabf('0x41')){if(!queues[_0x3da4e1[_0xbabf('0xe')]]['transfer']){queues[_0x3da4e1[_0xbabf('0xe')]]['queuecallerexitreason']=_0xbabf('0x42');}}else{queues[_0x3da4e1['uniqueid']][_0xbabf('0x9')]=_0xbabf('0x43')+_0x3da4e1[_0xbabf('0x40')][_0xbabf('0x21')]();}utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x44'),_0x3da4e1[_0xbabf('0xe')],queues[_0x3da4e1[_0xbabf('0xe')]]['name'],_0x3da4e1[_0xbabf('0x3d')],queues[_0x3da4e1['uniqueid']][_0xbabf('0x9')]));writeDB(queues[_0x3da4e1['uniqueid']]);}}}catch(_0x5d04f7){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x3f'),_0x3da4e1[_0xbabf('0xe')]),_0x5d04f7);}};exports[_0xbabf('0x45')]=function(_0x2ecc86){try{if(!_['isNil'](queues[_0x2ecc86[_0xbabf('0x46')]])){utils['debug'](util[_0xbabf('0x3')](_0xbabf('0x47'),_0x2ecc86['uniqueid']),_0x2ecc86);queues[_0x2ecc86['transfereeuniqueid']][_0xbabf('0x41')]=!![];queues[_0x2ecc86['transfereeuniqueid']][_0xbabf('0x48')]='BLIND';queues[_0x2ecc86['transfereeuniqueid']][_0xbabf('0x49')]=_0x2ecc86[_0xbabf('0x4a')];queues[_0x2ecc86[_0xbabf('0x46')]][_0xbabf('0x4b')]=_0x2ecc86['transfereeuniqueid'];queues[_0x2ecc86[_0xbabf('0x46')]][_0xbabf('0x9')]='BLINDTRANSFER';utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x4c'),_0x2ecc86[_0xbabf('0xe')],queues[_0x2ecc86[_0xbabf('0x46')]][_0xbabf('0x1b')],_0x2ecc86['transfereeuniqueid'],_0x2ecc86[_0xbabf('0x4a')]));}}catch(_0x3cf7f0){utils[_0xbabf('0x2a')](util['format'](_0xbabf('0x47'),_0x2ecc86[_0xbabf('0xe')]),_0x3cf7f0);}};exports[_0xbabf('0x4d')]=function(_0x3799db){try{utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x4e'),_0x3799db[_0xbabf('0x4f')]),_0x3799db);if(_0x3799db[_0xbabf('0x4f')]==_0x3799db['origtransfererlinkedid']){if(!_['isNil'](queues[_0x3799db['secondtransfererlinkedid']])){utils[_0xbabf('0x2')](util['format'](_0xbabf('0x50'),_0x3799db['origtransfereruniqueid'],queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x52')]));queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x41')]=!![];queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x48')]=_0xbabf('0x53');queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x49')]=_0x3799db[_0xbabf('0x52')];queues[_0x3799db['secondtransfererlinkedid']][_0xbabf('0x4b')]=_0x3799db[_0xbabf('0x4f')];queues[_0x3799db[_0xbabf('0x51')]]['queuecallerexitreason']=_0xbabf('0x54');}if(!_[_0xbabf('0x15')](queues[_0x3799db[_0xbabf('0x55')]])){if(_0x3799db[_0xbabf('0x56')]&&queues[_0x3799db[_0xbabf('0x56')]]){queues[_0x3799db['transfereelinkedid']][_0xbabf('0x1d')]=0x1;queues[_0x3799db[_0xbabf('0x46')]]=_[_0xbabf('0x57')](queues[_0x3799db[_0xbabf('0x56')]]);queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0xd')]=_0x3799db[_0xbabf('0x58')];queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x1d')]=0x2;queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x7')]=queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x7')];queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x59')]=queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x59')];queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x35')]=utils[_0xbabf('0x13')]();queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x32')]=utils[_0xbabf('0x13')]();queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x33')]=0x0;queues[_0x3799db['transfereeuniqueid']][_0xbabf('0x5a')]=0x0;utils[_0xbabf('0x2')](util['format'](_0xbabf('0x5b'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x1b')],queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x7')],queues[_0x3799db[_0xbabf('0x46')]][_0xbabf('0x59')]));}else{utils[_0xbabf('0x2')](util['format'](_0xbabf('0x5c'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db[_0xbabf('0x55')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x51')]));queues[_0x3799db[_0xbabf('0x55')]]['transfereduniqueid']=_0x3799db['secondtransfererlinkedid'];}}}else if(_0x3799db['secondtransfereruniqueid']==_0x3799db[_0xbabf('0x51')]){if(!_[_0xbabf('0x15')](queues[_0x3799db['origtransfererlinkedid']])){utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x5d'),_0x3799db['origtransfereruniqueid'],queues[_0x3799db[_0xbabf('0x55')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x5e')],_0x3799db[_0xbabf('0x5f')]));queues[_0x3799db['origtransfererlinkedid']][_0xbabf('0x41')]=!![];queues[_0x3799db[_0xbabf('0x55')]]['transfertype']='ATTENDED';queues[_0x3799db[_0xbabf('0x55')]]['transferexten']=_0x3799db[_0xbabf('0x5f')];queues[_0x3799db['origtransfererlinkedid']][_0xbabf('0x4b')]=_0x3799db[_0xbabf('0x5e')];queues[_0x3799db[_0xbabf('0x55')]][_0xbabf('0x9')]=_0xbabf('0x54');}if(!_[_0xbabf('0x15')](queues[_0x3799db[_0xbabf('0x51')]])){if(_0x3799db['transfertargetlinkedid']&&queues[_0x3799db[_0xbabf('0x60')]]){queues[_0x3799db[_0xbabf('0x60')]][_0xbabf('0x1d')]=0x1;queues[_0x3799db[_0xbabf('0x58')]]=_[_0xbabf('0x57')](queues[_0x3799db[_0xbabf('0x60')]]);queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0xd')]=_0x3799db[_0xbabf('0x58')];queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x1d')]=0x2;queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x7')]=queues[_0x3799db['origtransfererlinkedid']][_0xbabf('0x7')];queues[_0x3799db[_0xbabf('0x58')]]['calleridname']=queues[_0x3799db['origtransfererlinkedid']]['calleridname'];queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x35')]=utils[_0xbabf('0x13')]();queues[_0x3799db['transfertargetuniqueid']][_0xbabf('0x32')]=utils[_0xbabf('0x13')]();queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x33')]=0x0;queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x5a')]=0x0;utils['info'](util[_0xbabf('0x3')](_0xbabf('0x61'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db['transfertargetuniqueid']][_0xbabf('0x1b')],queues[_0x3799db[_0xbabf('0x58')]]['transfereduniqueid'],queues[_0x3799db['transfertargetuniqueid']]['calleridnum'],queues[_0x3799db[_0xbabf('0x58')]][_0xbabf('0x59')]));}else{utils[_0xbabf('0x2')](util['format'](_0xbabf('0x5c'),_0x3799db[_0xbabf('0x4f')],queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0x1b')],_0x3799db[_0xbabf('0x55')]));queues[_0x3799db[_0xbabf('0x51')]][_0xbabf('0xd')]=_0x3799db['origtransfererlinkedid'];}}}}catch(_0x2be3f3){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x4e'),_0x3799db[_0xbabf('0x4f')]),_0x2be3f3);}};exports['musiconholdstart']=function(_0x43ae1c){try{if(!_[_0xbabf('0x15')](queues[_0x43ae1c[_0xbabf('0xe')]])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x62'),_0x43ae1c[_0xbabf('0xe')]),_0x43ae1c);queues[_0x43ae1c[_0xbabf('0xe')]][_0xbabf('0x63')]=utils[_0xbabf('0x13')]();utils[_0xbabf('0x2')](util[_0xbabf('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x43ae1c[_0xbabf('0xe')],queues[_0x43ae1c[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x43ae1c[_0xbabf('0xe')]][_0xbabf('0x63')]));}}catch(_0x896ede){utils[_0xbabf('0x2a')](util[_0xbabf('0x3')](_0xbabf('0x62'),_0x43ae1c[_0xbabf('0xe')]),_0x896ede);}};exports[_0xbabf('0x64')]=function(_0x5728e6){try{if(!_[_0xbabf('0x15')](queues[_0x5728e6[_0xbabf('0xe')]])){if(!_[_0xbabf('0x15')](queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x63')])){utils[_0xbabf('0x16')](util[_0xbabf('0x3')](_0xbabf('0x65'),_0x5728e6[_0xbabf('0xe')]),_0x5728e6);queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x5a')]+=utils['diffTime'](utils[_0xbabf('0x13')](),queues[_0x5728e6[_0xbabf('0xe')]]['musiconholdstartAt']);utils[_0xbabf('0x2')](util[_0xbabf('0x3')](_0xbabf('0x66'),_0x5728e6[_0xbabf('0xe')],queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x1b')],queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x5a')]));delete queues[_0x5728e6[_0xbabf('0xe')]][_0xbabf('0x63')];}}}catch(_0x59fe87){utils['error'](util[_0xbabf('0x3')](_0xbabf('0x65'),_0x5728e6['uniqueid']),_0x59fe87);}}; \ No newline at end of file +var _0x46ed=['CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','position','now','error','format','hangup','isNil','[%s][queues][hangup]','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','queuecallerexit','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','count','agentconnect','membername','assigned','[%s][queues][agentconnect]','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferuniqueid','BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','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','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request'];(function(_0x4dd4ca,_0x4acbf8){var _0x43bdf1=function(_0x5e2e92){while(--_0x5e2e92){_0x4dd4ca['push'](_0x4dd4ca['shift']());}};_0x43bdf1(++_0x4acbf8);}(_0x46ed,0x184));var _0xd46e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x46ed[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xd46e('0x0'));var util=require('util');var utils=require(_0xd46e('0x1'));var queues={};function writeDB(_0x346452){utils[_0xd46e('0x2')](util['format'](_0xd46e('0x3'),_0x346452['uniqueid'],_0x346452[_0xd46e('0x4')],_0x346452[_0xd46e('0x5')],_0x346452[_0xd46e('0x6')],_0x346452[_0xd46e('0x7')],_0x346452['accountcode'],_0x346452[_0xd46e('0x8')]));if(_0x346452['queue']){utils[_0xd46e('0x9')](_0x346452[_0xd46e('0x5')])['then'](function(_0x4a7a99){if(_0x4a7a99){_0x346452['type']=_0x4a7a99[_0xd46e('0xa')];}utils[_0xd46e('0xb')](_0xd46e('0xc'),_0x346452);});}else{utils[_0xd46e('0xb')](_0xd46e('0xc'),_0x346452);}if(_0x346452[_0xd46e('0xd')]){delete queues[_0x346452[_0xd46e('0xd')]];}else{delete queues[_0x346452[_0xd46e('0xe')]];}}exports['queuecallerjoin']=function(_0x36991d){try{utils[_0xd46e('0xf')](util['format'](_0xd46e('0x10'),_0x36991d['uniqueid']),_0x36991d);utils[_0xd46e('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x36991d[_0xd46e('0xe')],_0x36991d[_0xd46e('0x5')],_0x36991d[_0xd46e('0x11')]));queues[_0x36991d['uniqueid']]=_['assign'](_0x36991d,{'originalposition':_0x36991d['position'],'queuecallerjoinAt':utils[_0xd46e('0x12')](),'mohtime':0x0});}catch(_0x3d4640){utils[_0xd46e('0x13')](util[_0xd46e('0x14')](_0xd46e('0x10'),_0x36991d[_0xd46e('0xe')]),_0x3d4640);}};exports[_0xd46e('0x15')]=function(_0x3f4a7b){try{if(!_[_0xd46e('0x16')](queues[_0x3f4a7b[_0xd46e('0xe')]])){utils[_0xd46e('0xf')](util[_0xd46e('0x14')](_0xd46e('0x17'),_0x3f4a7b['uniqueid']),_0x3f4a7b);if(queues[_0x3f4a7b[_0xd46e('0xe')]]['queuecallerleaveAt']){if(!queues[_0x3f4a7b[_0xd46e('0xe')]]['queuecallerabandon']&&!queues[_0x3f4a7b['uniqueid']]['queuecallerexit']){queues[_0x3f4a7b['uniqueid']][_0xd46e('0x18')]=!![];queues[_0x3f4a7b[_0xd46e('0xe')]]['queuecallercompleteAt']=utils[_0xd46e('0x12')]();queues[_0x3f4a7b[_0xd46e('0xe')]][_0xd46e('0x8')]=_0xd46e('0x19');}utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x1a'),_0x3f4a7b[_0xd46e('0xe')],queues[_0x3f4a7b[_0xd46e('0xe')]][_0xd46e('0x1b')],queues[_0x3f4a7b[_0xd46e('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x3f4a7b[_0xd46e('0xe')]]);}else if(queues[_0x3f4a7b['uniqueid']][_0xd46e('0xd')]){utils[_0xd46e('0x2')](util['format'](_0xd46e('0x1c'),_0x3f4a7b[_0xd46e('0xe')],queues[_0x3f4a7b[_0xd46e('0xe')]][_0xd46e('0x1b')],queues[_0x3f4a7b[_0xd46e('0xe')]][_0xd46e('0xd')]));queues[queues[_0x3f4a7b[_0xd46e('0xe')]][_0xd46e('0xd')]]=queues[_0x3f4a7b[_0xd46e('0xe')]];queues[queues[_0x3f4a7b[_0xd46e('0xe')]][_0xd46e('0xd')]][_0xd46e('0x1d')]=0x2;delete queues[_0x3f4a7b[_0xd46e('0xe')]];}}}catch(_0x399a41){utils[_0xd46e('0x13')](util[_0xd46e('0x14')](_0xd46e('0x17'),_0x3f4a7b[_0xd46e('0xe')]),_0x399a41);}};exports[_0xd46e('0x1e')]=function(_0x1e2c52){try{utils['debug'](util[_0xd46e('0x14')](_0xd46e('0x1f'),_0x1e2c52['uniqueid']),_0x1e2c52);if(!_[_0xd46e('0x16')](_0x1e2c52[_0xd46e('0x20')][_0xd46e('0x21')])&&_0x1e2c52[_0xd46e('0x22')][_0xd46e('0x23')]()!==_0xd46e('0x24')){if(!_[_0xd46e('0x16')](queues[_0x1e2c52['uniqueid']])){queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x25')]=![];queues[_0x1e2c52['uniqueid']][_0xd46e('0x26')]=null;queues[_0x1e2c52[_0xd46e('0xe')]]['queuecallerexit']=!![];queues[_0x1e2c52['uniqueid']][_0xd46e('0x27')]=utils['now']();queues[_0x1e2c52['uniqueid']]['queuecallerexitreason']=_0x1e2c52[_0xd46e('0x22')][_0xd46e('0x23')]();utils[_0xd46e('0x2')](util[_0xd46e('0x14')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x1e2c52['uniqueid'],queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x1b')],_0x1e2c52[_0xd46e('0x22')],queues[_0x1e2c52[_0xd46e('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x1e2c52[_0xd46e('0xe')]]);}}else if(!_[_0xd46e('0x16')](_0x1e2c52[_0xd46e('0x20')]['queueposition'])){if(!_['isNil'](queues[_0x1e2c52[_0xd46e('0xe')]])&&!queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x25')]){queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x25')]=![];queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x26')]=null;queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x28')]=!![];queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x27')]=utils['now']();queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x8')]=_0xd46e('0x29');utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x2a'),_0x1e2c52['uniqueid'],queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x1b')],_0x1e2c52[_0xd46e('0x22')],queues[_0x1e2c52[_0xd46e('0xe')]][_0xd46e('0x8')]));}}}catch(_0x524adb){utils[_0xd46e('0x13')](util[_0xd46e('0x14')](_0xd46e('0x1f'),_0x1e2c52[_0xd46e('0xe')]),_0x524adb);}};exports['queuecallerabandon']=function(_0x5c62ef){try{if(!_[_0xd46e('0x16')](queues[_0x5c62ef[_0xd46e('0xe')]])){utils[_0xd46e('0xf')](util['format'](_0xd46e('0x2b'),_0x5c62ef[_0xd46e('0xe')]),_0x5c62ef);queues[_0x5c62ef[_0xd46e('0xe')]][_0xd46e('0x28')]=![];queues[_0x5c62ef[_0xd46e('0xe')]][_0xd46e('0x27')]=null;queues[_0x5c62ef['uniqueid']][_0xd46e('0x25')]=!![];queues[_0x5c62ef[_0xd46e('0xe')]][_0xd46e('0x26')]=utils['now']();queues[_0x5c62ef[_0xd46e('0xe')]][_0xd46e('0x8')]=_0xd46e('0x2c');utils['info'](util[_0xd46e('0x14')](_0xd46e('0x2d'),_0x5c62ef[_0xd46e('0xe')],queues[_0x5c62ef[_0xd46e('0xe')]]['name'],queues[_0x5c62ef[_0xd46e('0xe')]]['queuecallerexitreason']));}}catch(_0x1c8525){utils[_0xd46e('0x13')](util[_0xd46e('0x14')](_0xd46e('0x2b'),_0x5c62ef[_0xd46e('0xe')]),_0x1c8525);}};exports[_0xd46e('0x2e')]=function(_0x4dbd41){try{if(!_[_0xd46e('0x16')](queues[_0x4dbd41[_0xd46e('0xe')]])){utils[_0xd46e('0xf')](util['format'](_0xd46e('0x2f'),_0x4dbd41['uniqueid']),_0x4dbd41);utils[_0xd46e('0x2')](util['format'](_0xd46e('0x30'),_0x4dbd41[_0xd46e('0xe')],queues[_0x4dbd41[_0xd46e('0xe')]][_0xd46e('0x1b')],_0x4dbd41[_0xd46e('0x31')],_0x4dbd41[_0xd46e('0x32')]));queues[_0x4dbd41[_0xd46e('0xe')]][_0xd46e('0x2e')]=!![];queues[_0x4dbd41[_0xd46e('0xe')]][_0xd46e('0x33')]=utils[_0xd46e('0x12')]();queues[_0x4dbd41['uniqueid']][_0xd46e('0x34')]=utils[_0xd46e('0x35')](queues[_0x4dbd41['uniqueid']][_0xd46e('0x33')],queues[_0x4dbd41[_0xd46e('0xe')]]['queuecallerjoinAt']);queues[_0x4dbd41[_0xd46e('0xe')]]['position']=_0x4dbd41[_0xd46e('0x11')];queues[_0x4dbd41['uniqueid']][_0xd46e('0x36')]=_0x4dbd41[_0xd46e('0x36')];queues[_0x4dbd41[_0xd46e('0xe')]]['connectedlinenum']=_0x4dbd41[_0xd46e('0x31')];queues[_0x4dbd41[_0xd46e('0xe')]][_0xd46e('0x32')]=_0x4dbd41[_0xd46e('0x32')];}}catch(_0xad6ac4){utils[_0xd46e('0x13')](util[_0xd46e('0x14')]('[%s][queues][queuecallerleave]',_0x4dbd41[_0xd46e('0xe')]),_0xad6ac4);}};exports[_0xd46e('0x37')]=function(_0x3c8ff3){try{if(!_['isNil'](queues[_0x3c8ff3[_0xd46e('0xe')]])){utils['debug'](util[_0xd46e('0x14')]('[%s][queues][agentconnect]',_0x3c8ff3[_0xd46e('0xe')]),_0x3c8ff3);utils[_0xd46e('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3c8ff3['uniqueid'],queues[_0x3c8ff3['uniqueid']]['name'],_0x3c8ff3[_0xd46e('0x38')],_0x3c8ff3['destaccountcode']));queues[_0x3c8ff3[_0xd46e('0xe')]][_0xd46e('0x25')]=![];queues[_0x3c8ff3[_0xd46e('0xe')]][_0xd46e('0x25')]=![];queues[_0x3c8ff3['uniqueid']][_0xd46e('0x26')]=null;queues[_0x3c8ff3[_0xd46e('0xe')]][_0xd46e('0x28')]=![];queues[_0x3c8ff3['uniqueid']]['queuecallerexitreason']=null;queues[_0x3c8ff3[_0xd46e('0xe')]][_0xd46e('0x27')]=null;queues[_0x3c8ff3['uniqueid']][_0xd46e('0x39')]=!![];queues[_0x3c8ff3[_0xd46e('0xe')]]['accountcode']=_0x3c8ff3['destaccountcode'];queues[_0x3c8ff3[_0xd46e('0xe')]][_0xd46e('0x6')]=_0x3c8ff3[_0xd46e('0x38')];}}catch(_0x415a0f){utils[_0xd46e('0x13')](util[_0xd46e('0x14')](_0xd46e('0x3a'),_0x3c8ff3[_0xd46e('0xe')]),_0x415a0f);}};exports[_0xd46e('0x3b')]=function(_0x1aab43){try{if(!_[_0xd46e('0x16')](queues[_0x1aab43[_0xd46e('0xe')]])){if(queues[_0x1aab43['uniqueid']][_0xd46e('0x33')]){utils[_0xd46e('0xf')](util['format']('[%s][queues][agentcomplete]',_0x1aab43[_0xd46e('0xe')]),_0x1aab43);queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x25')]=![];queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x25')]=![];queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x26')]=null;queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x28')]=![];queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x27')]=null;queues[_0x1aab43['uniqueid']][_0xd46e('0x39')]=!![];queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x6')]=_0x1aab43[_0xd46e('0x38')];queues[_0x1aab43['uniqueid']]['queuecallercomplete']=!![];queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x3c')]=utils[_0xd46e('0x12')]();if(_0x1aab43[_0xd46e('0x3d')]==_0xd46e('0x3e')){if(!queues[_0x1aab43['uniqueid']][_0xd46e('0x3e')]){queues[_0x1aab43[_0xd46e('0xe')]]['queuecallerexitreason']=_0xd46e('0x3f');}}else{queues[_0x1aab43[_0xd46e('0xe')]]['queuecallerexitreason']='COMPLETEDBY'+_0x1aab43[_0xd46e('0x3d')][_0xd46e('0x23')]();}utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x40'),_0x1aab43[_0xd46e('0xe')],queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x1b')],_0x1aab43['membername'],queues[_0x1aab43[_0xd46e('0xe')]][_0xd46e('0x8')]));writeDB(queues[_0x1aab43[_0xd46e('0xe')]]);}}}catch(_0x35990c){utils[_0xd46e('0x13')](util[_0xd46e('0x14')]('[%s][queues][agentcomplete]',_0x1aab43[_0xd46e('0xe')]),_0x35990c);}};exports['blindtransfer']=function(_0x3d7864){try{if(!_[_0xd46e('0x16')](queues[_0x3d7864[_0xd46e('0x41')]])){utils[_0xd46e('0xf')](util[_0xd46e('0x14')](_0xd46e('0x42'),_0x3d7864[_0xd46e('0xe')]),_0x3d7864);queues[_0x3d7864['transfereeuniqueid']]['transfer']=!![];queues[_0x3d7864[_0xd46e('0x41')]][_0xd46e('0x43')]=_0xd46e('0x44');queues[_0x3d7864['transfereeuniqueid']]['transferexten']=_0x3d7864['extension'];queues[_0x3d7864[_0xd46e('0x41')]][_0xd46e('0x45')]=_0x3d7864['transfereeuniqueid'];queues[_0x3d7864[_0xd46e('0x41')]][_0xd46e('0x8')]=_0xd46e('0x46');utils['info'](util[_0xd46e('0x14')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3d7864['uniqueid'],queues[_0x3d7864[_0xd46e('0x41')]][_0xd46e('0x1b')],_0x3d7864[_0xd46e('0x41')],_0x3d7864[_0xd46e('0x47')]));}}catch(_0x49ad16){utils[_0xd46e('0x13')](util[_0xd46e('0x14')]('[%s][queues][blindtransfer]',_0x3d7864[_0xd46e('0xe')]),_0x49ad16);}};exports[_0xd46e('0x48')]=function(_0x3fd102){try{utils[_0xd46e('0xf')](util['format'](_0xd46e('0x49'),_0x3fd102['origtransfereruniqueid']),_0x3fd102);if(_0x3fd102['origtransfereruniqueid']==_0x3fd102[_0xd46e('0x4a')]){if(!_['isNil'](queues[_0x3fd102[_0xd46e('0x4b')]])){utils[_0xd46e('0x2')](util['format'](_0xd46e('0x4c'),_0x3fd102[_0xd46e('0x4d')],queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x1b')],_0x3fd102[_0xd46e('0x4e')]));queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x3e')]=!![];queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x43')]=_0xd46e('0x4f');queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x50')]=_0x3fd102['origtransfererexten'];queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x45')]=_0x3fd102['origtransfereruniqueid'];queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x8')]=_0xd46e('0x51');}if(!_[_0xd46e('0x16')](queues[_0x3fd102[_0xd46e('0x4a')]])){if(_0x3fd102[_0xd46e('0x52')]&&queues[_0x3fd102['transfereelinkedid']]){queues[_0x3fd102[_0xd46e('0x52')]][_0xd46e('0x1d')]=0x1;queues[_0x3fd102[_0xd46e('0x41')]]=_[_0xd46e('0x53')](queues[_0x3fd102['transfereelinkedid']]);queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0xd')]=_0x3fd102[_0xd46e('0x54')];queues[_0x3fd102[_0xd46e('0x41')]]['queuecallerenterreason']=0x2;queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x7')]=queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x7')];queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x55')]=queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x55')];queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x56')]=utils['now']();queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x33')]=utils[_0xd46e('0x12')]();queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x34')]=0x0;queues[_0x3fd102['transfereeuniqueid']][_0xd46e('0x57')]=0x0;utils[_0xd46e('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x3fd102[_0xd46e('0x4d')],queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x1b')],queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x7')],queues[_0x3fd102[_0xd46e('0x41')]][_0xd46e('0x55')]));}else{utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x58'),_0x3fd102['origtransfereruniqueid'],queues[_0x3fd102['origtransfererlinkedid']][_0xd46e('0x1b')],_0x3fd102['secondtransfererlinkedid']));queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0xd')]=_0x3fd102[_0xd46e('0x4b')];}}}else if(_0x3fd102[_0xd46e('0x59')]==_0x3fd102[_0xd46e('0x4b')]){if(!_[_0xd46e('0x16')](queues[_0x3fd102['origtransfererlinkedid']])){utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x5a'),_0x3fd102[_0xd46e('0x4d')],queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x1b')],_0x3fd102['secondtransfereruniqueid'],_0x3fd102[_0xd46e('0x5b')]));queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x3e')]=!![];queues[_0x3fd102['origtransfererlinkedid']]['transfertype']=_0xd46e('0x4f');queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x50')]=_0x3fd102[_0xd46e('0x5b')];queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x45')]=_0x3fd102[_0xd46e('0x59')];queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x8')]='ATTENDEDTRANSFER';}if(!_[_0xd46e('0x16')](queues[_0x3fd102[_0xd46e('0x4b')]])){if(_0x3fd102[_0xd46e('0x5c')]&&queues[_0x3fd102[_0xd46e('0x5c')]]){queues[_0x3fd102[_0xd46e('0x5c')]][_0xd46e('0x1d')]=0x1;queues[_0x3fd102['transfertargetuniqueid']]=_[_0xd46e('0x53')](queues[_0x3fd102[_0xd46e('0x5c')]]);queues[_0x3fd102[_0xd46e('0x54')]]['transfereduniqueid']=_0x3fd102['transfertargetuniqueid'];queues[_0x3fd102['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3fd102[_0xd46e('0x54')]]['calleridnum']=queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x7')];queues[_0x3fd102[_0xd46e('0x54')]]['calleridname']=queues[_0x3fd102[_0xd46e('0x4a')]][_0xd46e('0x55')];queues[_0x3fd102[_0xd46e('0x54')]][_0xd46e('0x56')]=utils[_0xd46e('0x12')]();queues[_0x3fd102['transfertargetuniqueid']][_0xd46e('0x33')]=utils[_0xd46e('0x12')]();queues[_0x3fd102['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x3fd102[_0xd46e('0x54')]][_0xd46e('0x57')]=0x0;utils['info'](util['format'](_0xd46e('0x5d'),_0x3fd102['origtransfereruniqueid'],queues[_0x3fd102[_0xd46e('0x54')]][_0xd46e('0x1b')],queues[_0x3fd102[_0xd46e('0x54')]][_0xd46e('0xd')],queues[_0x3fd102[_0xd46e('0x54')]][_0xd46e('0x7')],queues[_0x3fd102[_0xd46e('0x54')]]['calleridname']));}else{utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x58'),_0x3fd102[_0xd46e('0x4d')],queues[_0x3fd102[_0xd46e('0x4b')]][_0xd46e('0x1b')],_0x3fd102[_0xd46e('0x4a')]));queues[_0x3fd102['secondtransfererlinkedid']][_0xd46e('0xd')]=_0x3fd102[_0xd46e('0x4a')];}}}}catch(_0x4d7915){utils[_0xd46e('0x13')](util['format'](_0xd46e('0x49'),_0x3fd102[_0xd46e('0x4d')]),_0x4d7915);}};exports[_0xd46e('0x5e')]=function(_0x290e75){try{if(!_['isNil'](queues[_0x290e75['uniqueid']])){utils[_0xd46e('0xf')](util['format'](_0xd46e('0x5f'),_0x290e75[_0xd46e('0xe')]),_0x290e75);queues[_0x290e75[_0xd46e('0xe')]][_0xd46e('0x60')]=utils[_0xd46e('0x12')]();utils['info'](util[_0xd46e('0x14')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x290e75[_0xd46e('0xe')],queues[_0x290e75[_0xd46e('0xe')]]['name'],queues[_0x290e75[_0xd46e('0xe')]][_0xd46e('0x60')]));}}catch(_0x3819e8){utils[_0xd46e('0x13')](util[_0xd46e('0x14')](_0xd46e('0x5f'),_0x290e75[_0xd46e('0xe')]),_0x3819e8);}};exports[_0xd46e('0x61')]=function(_0x37bfc8){try{if(!_['isNil'](queues[_0x37bfc8[_0xd46e('0xe')]])){if(!_[_0xd46e('0x16')](queues[_0x37bfc8[_0xd46e('0xe')]]['musiconholdstartAt'])){utils[_0xd46e('0xf')](util['format'](_0xd46e('0x62'),_0x37bfc8[_0xd46e('0xe')]),_0x37bfc8);queues[_0x37bfc8[_0xd46e('0xe')]]['mohtime']+=utils[_0xd46e('0x35')](utils[_0xd46e('0x12')](),queues[_0x37bfc8[_0xd46e('0xe')]][_0xd46e('0x60')]);utils[_0xd46e('0x2')](util[_0xd46e('0x14')](_0xd46e('0x63'),_0x37bfc8[_0xd46e('0xe')],queues[_0x37bfc8[_0xd46e('0xe')]]['name'],queues[_0x37bfc8['uniqueid']]['mohtime']));delete queues[_0x37bfc8[_0xd46e('0xe')]][_0xd46e('0x60')];}}}catch(_0x321666){utils[_0xd46e('0x13')](util['format'](_0xd46e('0x62'),_0x37bfc8[_0xd46e('0xe')]),_0x321666);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 727189d..5329995 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 _0x83b5=['[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','set','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]'];(function(_0x3e307b,_0x5a3d7c){var _0x1f0f4e=function(_0x5daf5e){while(--_0x5daf5e){_0x3e307b['push'](_0x3e307b['shift']());}};_0x1f0f4e(++_0x5a3d7c);}(_0x83b5,0x133));var _0x583b=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x83b5[_0x319a03];return _0x3b6704;};'use strict';var _=require(_0x583b('0x0'));var util=require(_0x583b('0x1'));var utils=require(_0x583b('0x2'));var transfers=require(_0x583b('0x3'));var recordings={};function writeDB(_0x1aa92b){var _0x4349eb;utils[_0x583b('0x4')](util['format']('[%s][recordings][writeDB]',_0x1aa92b[_0x583b('0x5')]));if(transfers[_0x583b('0x6')][_0x1aa92b[_0x583b('0x5')]]){_0x4349eb=_0x1aa92b[_0x583b('0x5')];_0x1aa92b[_0x583b('0x5')]=transfers[_0x583b('0x6')][_0x1aa92b[_0x583b('0x5')]][_0x583b('0x7')];}if(_0x1aa92b[_0x583b('0x8')]){utils['getUserByInternal'](_0x1aa92b[_0x583b('0x8')])[_0x583b('0x9')](function(_0x200f02){if(_0x200f02){_0x1aa92b[_0x583b('0xa')]=_0x200f02['name'];_0x1aa92b['UserId']=_0x200f02['id'];}utils[_0x583b('0xb')](_0x583b('0xc'),_0x1aa92b);});}else{utils[_0x583b('0xb')](_0x583b('0xc'),_0x1aa92b);}if(_0x4349eb)delete transfers[_0x583b('0x6')][_0x4349eb];}exports[_0x583b('0xd')]=function(_0x59e95c){try{utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x10'),_0x59e95c['uniqueid']),_0x59e95c);if(_0x59e95c[_0x583b('0x5')]==_0x59e95c[_0x583b('0x11')]){utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x12'),_0x59e95c[_0x583b('0x5')],_0x59e95c[_0x583b('0x13')],_0x59e95c['exten']));recordings[_0x59e95c[_0x583b('0x5')]]={'uniqueid':_0x59e95c[_0x583b('0x5')],'accountcode':_0x59e95c[_0x583b('0x8')],'exten':_0x59e95c[_0x583b('0x14')],'context':_0x59e95c[_0x583b('0x13')],'channel':_0x59e95c[_0x583b('0x15')],'monitors':[]};}}catch(_0x32ab71){utils[_0x583b('0x16')](util[_0x583b('0xf')]('[%s][recordings][newchannel]',_0x59e95c[_0x583b('0x5')]),_0x32ab71);}};exports[_0x583b('0x17')]=function(_0x54cce8){try{utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x18'),_0x54cce8[_0x583b('0x5')]),_0x54cce8);if(!_[_0x583b('0x19')](recordings[_0x54cce8[_0x583b('0x5')]])&&_0x54cce8['channelstate']==0x6){utils['info'](util['format'](_0x583b('0x1a'),_0x54cce8[_0x583b('0x5')],_0x54cce8['context'],_0x54cce8[_0x583b('0x15')]));}else if(!_[_0x583b('0x19')](recordings[_0x54cce8[_0x583b('0x11')]])&&_0x54cce8[_0x583b('0x1b')]==0x6&&_0x54cce8[_0x583b('0x13')]!=_0x583b('0x1c')){utils[_0x583b('0x4')](util[_0x583b('0xf')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54cce8[_0x583b('0x5')],_0x54cce8[_0x583b('0x11')],_0x54cce8[_0x583b('0x13')],_0x54cce8[_0x583b('0x15')]));recordings[_0x54cce8[_0x583b('0x11')]]['accountcode']=_0x54cce8['accountcode'];}}catch(_0x240ca9){utils[_0x583b('0x16')](util[_0x583b('0xf')](_0x583b('0x18'),_0x54cce8[_0x583b('0x5')]),_0x240ca9);}};exports[_0x583b('0x1d')]=function(_0x5e84df){try{if(!_[_0x583b('0x19')](_0x5e84df[_0x583b('0x1e')])&&!_[_0x583b('0x19')](_0x5e84df['variable'][_0x583b('0x1f')])){utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x20'),_0x5e84df[_0x583b('0x5')]),_0x5e84df);utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x21'),_0x5e84df[_0x583b('0x5')],_0x5e84df[_0x583b('0x1e')],_0x5e84df[_0x583b('0x22')]));if(_[_0x583b('0x23')](_0x5e84df[_0x583b('0x22')],_0x583b('0x24'))){_0x5e84df[_0x583b('0x22')]=_0x5e84df[_0x583b('0x22')][_0x583b('0x25')](_0x583b('0x24'),'.WAV');}if(recordings[_0x5e84df['linkedid']]){var _0x1310c7=_[_0x583b('0x26')](recordings[_0x5e84df[_0x583b('0x11')]]['monitors'],{'value':_0x5e84df[_0x583b('0x22')]});if(_[_0x583b('0x19')](_0x1310c7)){recordings[_0x5e84df['linkedid']][_0x583b('0x27')][_0x583b('0x28')]({'value':_0x5e84df['value']});}}}}catch(_0x59aaae){utils[_0x583b('0x16')](util['format'](_0x583b('0x20'),_0x5e84df[_0x583b('0x5')]),_0x59aaae);}};exports[_0x583b('0x29')]=function(_0x1aa6ca){try{if(!_[_0x583b('0x19')](recordings[_0x1aa6ca[_0x583b('0x5')]])){utils['debug'](util[_0x583b('0xf')](_0x583b('0x2a'),_0x1aa6ca[_0x583b('0x5')]),_0x1aa6ca);utils['info'](util[_0x583b('0xf')](_0x583b('0x2b'),_0x1aa6ca[_0x583b('0x5')],_0x1aa6ca[_0x583b('0x2c')],_0x1aa6ca[_0x583b('0x2d')],_0x1aa6ca[_0x583b('0x2e')]));recordings[_0x1aa6ca['uniqueid']][_0x583b('0x2c')]=_0x1aa6ca[_0x583b('0x2c')];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x2d')]=_0x1aa6ca[_0x583b('0x2d')];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x2f')]=_0x1aa6ca['connectedlinenum'];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x30')]=_0x1aa6ca[_0x583b('0x30')];if(recordings[_0x1aa6ca['uniqueid']]['type']==_0x583b('0x31')&&recordings[_0x1aa6ca['uniqueid']][_0x583b('0x8')]){recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x2f')]=recordings[_0x1aa6ca[_0x583b('0x5')]]['accountcode'];recordings[_0x1aa6ca[_0x583b('0x5')]][_0x583b('0x30')]='';}recordings[_0x1aa6ca['uniqueid']]['monitors']['forEach'](function(_0x4c1269){var _0x94d89b=_['clone'](recordings[_0x1aa6ca['uniqueid']]);_0x94d89b[_0x583b('0x22')]=_0x4c1269[_0x583b('0x22')];writeDB(_0x94d89b);});delete recordings[_0x1aa6ca['uniqueid']];}}catch(_0x1915fb){utils[_0x583b('0x16')](util[_0x583b('0xf')](_0x583b('0x2a'),_0x1aa6ca[_0x583b('0x5')]),_0x1915fb);}};exports[_0x583b('0x32')]=function(_0x1d7443){try{if(!_[_0x583b('0x19')](recordings[_0x1d7443[_0x583b('0x5')]])){utils[_0x583b('0xe')](util[_0x583b('0xf')]('[%s][recordings][newexten]',_0x1d7443[_0x583b('0x5')]),_0x1d7443);utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x33'),_0x1d7443['uniqueid'],_0x1d7443['application'],_0x1d7443[_0x583b('0x34')]));if(_0x1d7443['application']['toLowerCase']()==_0x583b('0x35')&&_['startsWith'](_0x1d7443[_0x583b('0x34')][_0x583b('0x36')](),'cdr')){var _0x53ecdc=_0x1d7443['appdata'][_0x583b('0x37')]('=');var _0x949da0=_0x53ecdc[0x0][_0x583b('0x38')](_0x53ecdc[0x0][_0x583b('0x39')]('(')+0x1,_0x53ecdc[0x0]['lastIndexOf'](')'));var _0x39df52=_0x53ecdc[0x1];recordings[_0x1d7443['uniqueid']][_0x949da0]=_0x39df52;}}}catch(_0x48be57){utils['error'](util[_0x583b('0xf')]('[%s][recordings][newexten]',_0x1d7443[_0x583b('0x5')]),_0x48be57);}};exports[_0x583b('0x3a')]=function(_0x5c841b){try{if(!_['isNil'](recordings[_0x5c841b['uniqueid']])){utils[_0x583b('0xe')](util[_0x583b('0xf')](_0x583b('0x3b'),_0x5c841b[_0x583b('0x5')]),_0x5c841b);utils[_0x583b('0x4')](util[_0x583b('0xf')](_0x583b('0x3c'),_0x5c841b[_0x583b('0x5')],_0x5c841b[_0x583b('0x3d')]));recordings[_0x5c841b[_0x583b('0x5')]][_0x583b('0x3d')]=_0x5c841b[_0x583b('0x3d')];}}catch(_0x37cc40){utils['error'](util[_0x583b('0xf')](_0x583b('0x3b'),_0x5c841b[_0x583b('0x5')]),_0x37cc40);}};exports[_0x583b('0x3e')]=function(_0x48d8a6){try{utils[_0x583b('0xe')](util['format'](_0x583b('0x3f'),_0x48d8a6[_0x583b('0x5')]),_0x48d8a6);utils[_0x583b('0x4')](util[_0x583b('0xf')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x48d8a6[_0x583b('0x5')],_0x48d8a6[_0x583b('0x40')],_0x48d8a6[_0x583b('0x41')],_0x48d8a6[_0x583b('0x42')],_0x48d8a6[_0x583b('0x43')]));if(recordings[_0x48d8a6[_0x583b('0x44')]]&&transfers[_0x583b('0x6')][_0x48d8a6[_0x583b('0x44')]]){transfers[_0x583b('0x6')][_0x48d8a6['transfereruniqueid']][_0x583b('0x45')]=!![];}}catch(_0x4808dc){utils[_0x583b('0x16')](util[_0x583b('0xf')]('[%s][recordings][blindtransfer]',_0x48d8a6['uniqueid']),_0x4808dc);}}; \ No newline at end of file +var _0x7ca5=['membername','name','CreateVoiceRecording','newchannel','linkedid','info','context','exten','channel','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal'];(function(_0x2fbd50,_0xf31c66){var _0xef391d=function(_0x3d5611){while(--_0x3d5611){_0x2fbd50['push'](_0x2fbd50['shift']());}};_0xef391d(++_0xf31c66);}(_0x7ca5,0x1ac));var _0x57ca=function(_0xb57e45,_0x5c2f43){_0xb57e45=_0xb57e45-0x0;var _0x3cce62=_0x7ca5[_0xb57e45];return _0x3cce62;};'use strict';var _=require(_0x57ca('0x0'));var util=require(_0x57ca('0x1'));var utils=require(_0x57ca('0x2'));var transfers=require(_0x57ca('0x3'));var recordings={};function writeDB(_0x359a0f){var _0x13293e;utils['info'](util[_0x57ca('0x4')](_0x57ca('0x5'),_0x359a0f[_0x57ca('0x6')]));if(transfers[_0x57ca('0x7')][_0x359a0f[_0x57ca('0x6')]]){_0x13293e=_0x359a0f[_0x57ca('0x6')];_0x359a0f['uniqueid']=transfers[_0x57ca('0x7')][_0x359a0f[_0x57ca('0x6')]]['transfereeuniqueid'];}if(_0x359a0f[_0x57ca('0x8')]){utils[_0x57ca('0x9')](_0x359a0f[_0x57ca('0x8')])['then'](function(_0x111259){if(_0x111259){_0x359a0f[_0x57ca('0xa')]=_0x111259[_0x57ca('0xb')];_0x359a0f['UserId']=_0x111259['id'];}utils['request'](_0x57ca('0xc'),_0x359a0f);});}else{utils['request'](_0x57ca('0xc'),_0x359a0f);}if(_0x13293e)delete transfers['blinds'][_0x13293e];}exports[_0x57ca('0xd')]=function(_0x208a99){try{utils['debug'](util[_0x57ca('0x4')]('[%s][recordings][newchannel]',_0x208a99[_0x57ca('0x6')]),_0x208a99);if(_0x208a99[_0x57ca('0x6')]==_0x208a99[_0x57ca('0xe')]){utils[_0x57ca('0xf')](util[_0x57ca('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x208a99['uniqueid'],_0x208a99[_0x57ca('0x10')],_0x208a99['exten']));recordings[_0x208a99[_0x57ca('0x6')]]={'uniqueid':_0x208a99[_0x57ca('0x6')],'accountcode':_0x208a99['accountcode'],'exten':_0x208a99[_0x57ca('0x11')],'context':_0x208a99[_0x57ca('0x10')],'channel':_0x208a99[_0x57ca('0x12')],'monitors':[]};}}catch(_0x3298ac){utils[_0x57ca('0x13')](util[_0x57ca('0x4')](_0x57ca('0x14'),_0x208a99[_0x57ca('0x6')]),_0x3298ac);}};exports[_0x57ca('0x15')]=function(_0x3dd33c){try{utils[_0x57ca('0x16')](util[_0x57ca('0x4')](_0x57ca('0x17'),_0x3dd33c[_0x57ca('0x6')]),_0x3dd33c);if(!_[_0x57ca('0x18')](recordings[_0x3dd33c[_0x57ca('0x6')]])&&_0x3dd33c['channelstate']==0x6){utils[_0x57ca('0xf')](util[_0x57ca('0x4')](_0x57ca('0x19'),_0x3dd33c[_0x57ca('0x6')],_0x3dd33c[_0x57ca('0x10')],_0x3dd33c[_0x57ca('0x12')]));}else if(!_['isNil'](recordings[_0x3dd33c[_0x57ca('0xe')]])&&_0x3dd33c[_0x57ca('0x1a')]==0x6&&_0x3dd33c[_0x57ca('0x10')]!=_0x57ca('0x1b')){utils['info'](util['format'](_0x57ca('0x1c'),_0x3dd33c[_0x57ca('0x6')],_0x3dd33c['linkedid'],_0x3dd33c[_0x57ca('0x10')],_0x3dd33c[_0x57ca('0x12')]));recordings[_0x3dd33c[_0x57ca('0xe')]][_0x57ca('0x8')]=_0x3dd33c[_0x57ca('0x8')];}}catch(_0x198cce){utils['error'](util[_0x57ca('0x4')](_0x57ca('0x17'),_0x3dd33c[_0x57ca('0x6')]),_0x198cce);}};exports['varset']=function(_0x4d41cd){try{if(!_[_0x57ca('0x18')](_0x4d41cd[_0x57ca('0x1d')])&&!_[_0x57ca('0x18')](_0x4d41cd['variable'][_0x57ca('0x1e')])){utils[_0x57ca('0x16')](util[_0x57ca('0x4')](_0x57ca('0x1f'),_0x4d41cd['uniqueid']),_0x4d41cd);utils[_0x57ca('0xf')](util[_0x57ca('0x4')](_0x57ca('0x20'),_0x4d41cd[_0x57ca('0x6')],_0x4d41cd[_0x57ca('0x1d')],_0x4d41cd[_0x57ca('0x21')]));if(_[_0x57ca('0x22')](_0x4d41cd[_0x57ca('0x21')],_0x57ca('0x23'))){_0x4d41cd['value']=_0x4d41cd['value'][_0x57ca('0x24')](_0x57ca('0x23'),_0x57ca('0x25'));}if(recordings[_0x4d41cd['linkedid']]){var _0x4efbf4=_[_0x57ca('0x26')](recordings[_0x4d41cd[_0x57ca('0xe')]][_0x57ca('0x27')],{'value':_0x4d41cd[_0x57ca('0x21')]});if(_[_0x57ca('0x18')](_0x4efbf4)){recordings[_0x4d41cd[_0x57ca('0xe')]][_0x57ca('0x27')][_0x57ca('0x28')]({'value':_0x4d41cd[_0x57ca('0x21')]});}}}}catch(_0x554618){utils[_0x57ca('0x13')](util[_0x57ca('0x4')]('[%s][recordings][varset]',_0x4d41cd[_0x57ca('0x6')]),_0x554618);}};exports[_0x57ca('0x29')]=function(_0x5c9d92){try{if(!_[_0x57ca('0x18')](recordings[_0x5c9d92[_0x57ca('0x6')]])){utils[_0x57ca('0x16')](util[_0x57ca('0x4')](_0x57ca('0x2a'),_0x5c9d92[_0x57ca('0x6')]),_0x5c9d92);utils[_0x57ca('0xf')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5c9d92['uniqueid'],_0x5c9d92[_0x57ca('0x2b')],_0x5c9d92[_0x57ca('0x2c')],_0x5c9d92[_0x57ca('0x2d')]));recordings[_0x5c9d92['uniqueid']][_0x57ca('0x2b')]=_0x5c9d92['calleridnum'];recordings[_0x5c9d92[_0x57ca('0x6')]][_0x57ca('0x2c')]=_0x5c9d92['calleridname'];recordings[_0x5c9d92[_0x57ca('0x6')]][_0x57ca('0x2e')]=_0x5c9d92['connectedlinenum'];recordings[_0x5c9d92[_0x57ca('0x6')]][_0x57ca('0x2f')]=_0x5c9d92['connectedlinename'];if(recordings[_0x5c9d92[_0x57ca('0x6')]][_0x57ca('0x30')]==_0x57ca('0x31')&&recordings[_0x5c9d92[_0x57ca('0x6')]]['accountcode']){recordings[_0x5c9d92[_0x57ca('0x6')]][_0x57ca('0x2e')]=recordings[_0x5c9d92[_0x57ca('0x6')]]['accountcode'];recordings[_0x5c9d92['uniqueid']][_0x57ca('0x2f')]='';}recordings[_0x5c9d92['uniqueid']][_0x57ca('0x27')][_0x57ca('0x32')](function(_0x45d7f0){var _0x51f29=_[_0x57ca('0x33')](recordings[_0x5c9d92[_0x57ca('0x6')]]);_0x51f29[_0x57ca('0x21')]=_0x45d7f0[_0x57ca('0x21')];writeDB(_0x51f29);});delete recordings[_0x5c9d92[_0x57ca('0x6')]];}}catch(_0x20560e){utils[_0x57ca('0x13')](util[_0x57ca('0x4')](_0x57ca('0x2a'),_0x5c9d92[_0x57ca('0x6')]),_0x20560e);}};exports[_0x57ca('0x34')]=function(_0x1ba017){try{if(!_['isNil'](recordings[_0x1ba017[_0x57ca('0x6')]])){utils[_0x57ca('0x16')](util[_0x57ca('0x4')](_0x57ca('0x35'),_0x1ba017[_0x57ca('0x6')]),_0x1ba017);utils[_0x57ca('0xf')](util[_0x57ca('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1ba017[_0x57ca('0x6')],_0x1ba017[_0x57ca('0x36')],_0x1ba017[_0x57ca('0x37')]));if(_0x1ba017['application'][_0x57ca('0x38')]()==_0x57ca('0x39')&&_[_0x57ca('0x3a')](_0x1ba017['appdata'][_0x57ca('0x38')](),_0x57ca('0x3b'))){var _0x24e32d=_0x1ba017[_0x57ca('0x37')][_0x57ca('0x3c')]('=');var _0x1ce993=_0x24e32d[0x0][_0x57ca('0x3d')](_0x24e32d[0x0][_0x57ca('0x3e')]('(')+0x1,_0x24e32d[0x0][_0x57ca('0x3e')](')'));var _0x12e5e7=_0x24e32d[0x1];recordings[_0x1ba017[_0x57ca('0x6')]][_0x1ce993]=_0x12e5e7;}}}catch(_0x36c15d){utils[_0x57ca('0x13')](util[_0x57ca('0x4')](_0x57ca('0x35'),_0x1ba017[_0x57ca('0x6')]),_0x36c15d);}};exports[_0x57ca('0x3f')]=function(_0x3c7bc7){try{if(!_[_0x57ca('0x18')](recordings[_0x3c7bc7[_0x57ca('0x6')]])){utils[_0x57ca('0x16')](util[_0x57ca('0x4')]('[%s][recordings][queuecallerjoin]',_0x3c7bc7['uniqueid']),_0x3c7bc7);utils['info'](util[_0x57ca('0x4')](_0x57ca('0x40'),_0x3c7bc7[_0x57ca('0x6')],_0x3c7bc7['queue']));recordings[_0x3c7bc7['uniqueid']][_0x57ca('0x41')]=_0x3c7bc7[_0x57ca('0x41')];}}catch(_0x58e4bf){utils[_0x57ca('0x13')](util[_0x57ca('0x4')]('[%s][recordings][queuecallerjoin]',_0x3c7bc7[_0x57ca('0x6')]),_0x58e4bf);}};exports[_0x57ca('0x42')]=function(_0x2c9158){try{utils['debug'](util[_0x57ca('0x4')](_0x57ca('0x43'),_0x2c9158['uniqueid']),_0x2c9158);utils['info'](util[_0x57ca('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2c9158[_0x57ca('0x6')],_0x2c9158[_0x57ca('0x44')],_0x2c9158[_0x57ca('0x45')],_0x2c9158[_0x57ca('0x46')],_0x2c9158[_0x57ca('0x47')]));if(recordings[_0x2c9158[_0x57ca('0x48')]]&&transfers[_0x57ca('0x7')][_0x2c9158[_0x57ca('0x48')]]){transfers[_0x57ca('0x7')][_0x2c9158[_0x57ca('0x48')]]['recording']=!![];}}catch(_0x26946f){utils[_0x57ca('0x13')](util[_0x57ca('0x4')](_0x57ca('0x43'),_0x2c9158[_0x57ca('0x6')]),_0x26946f);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 0ade37f..02c5ea5 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 _0xb9af=['debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','error','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blindtransfer'];(function(_0x387cbc,_0x5b072c){var _0x24f07f=function(_0x17d5c1){while(--_0x17d5c1){_0x387cbc['push'](_0x387cbc['shift']());}};_0x24f07f(++_0x5b072c);}(_0xb9af,0xa2));var _0xfb9a=function(_0x33db5c,_0x20caba){_0x33db5c=_0x33db5c-0x0;var _0x2222b0=_0xb9af[_0x33db5c];return _0x2222b0;};'use strict';var _=require(_0xfb9a('0x0'));var util=require(_0xfb9a('0x1'));var utils=require('./utils');function writeDB(_0x1aefab){utils[_0xfb9a('0x2')](util[_0xfb9a('0x3')](_0xfb9a('0x4'),_0x1aefab[_0xfb9a('0x5')]===_0xfb9a('0x6')?_0x1aefab['origtransfereruniqueid']:_0x1aefab[_0xfb9a('0x7')],_0x1aefab['type']));utils['request'](_0xfb9a('0x8'),_0x1aefab);}exports['blinds']={};exports[_0xfb9a('0x9')]=function(_0xe983d4){try{utils[_0xfb9a('0xa')](util['format'](_0xfb9a('0xb'),_0xe983d4[_0xfb9a('0x7')]),_0xe983d4);utils[_0xfb9a('0x2')](util['format'](_0xfb9a('0xc'),_0xe983d4[_0xfb9a('0x7')],_0xe983d4[_0xfb9a('0xd')],_0xe983d4[_0xfb9a('0xe')],_0xe983d4[_0xfb9a('0xf')],_0xe983d4[_0xfb9a('0x10')]));_0xe983d4[_0xfb9a('0x5')]=_0xfb9a('0x11');exports[_0xfb9a('0x12')][_0xe983d4[_0xfb9a('0x13')]]=_0xe983d4;writeDB(_0xe983d4);}catch(_0x173f62){utils['error'](util[_0xfb9a('0x3')]('[%s][transfers][blindtransfer]',_0xe983d4[_0xfb9a('0x7')]),_0x173f62);}};exports[_0xfb9a('0x14')]=function(_0xb4049){try{utils[_0xfb9a('0xa')](util['format'](_0xfb9a('0x15'),_0xb4049[_0xfb9a('0x16')]),_0xb4049);utils['info'](util['format'](_0xfb9a('0x17'),_0xb4049[_0xfb9a('0x16')],_0xb4049['origtransferercalleridnum'],_0xb4049[_0xfb9a('0x18')],_0xb4049[_0xfb9a('0x19')],_0xb4049[_0xfb9a('0x1a')]));_0xb4049=_[_0xfb9a('0x1b')](_0xb4049,{'transfererchannel':_0xb4049[_0xfb9a('0x1c')],'transferercalleridnum':_0xb4049['origtransferercalleridnum'],'transferercalleridname':_0xb4049[_0xfb9a('0x18')],'transfererconnectedlinenum':_0xb4049[_0xfb9a('0x1d')],'transfererconnectedlinename':_0xb4049[_0xfb9a('0x1e')],'transfereraccountcode':_0xb4049[_0xfb9a('0x1f')],'transferercontext':_0xb4049[_0xfb9a('0x20')],'transfererexten':_0xb4049[_0xfb9a('0x21')],'transfererlinkedid':_0xb4049[_0xfb9a('0x22')],'context':_0xb4049[_0xfb9a('0x23')],'extension':_0xb4049[_0xfb9a('0x24')],'type':_0xfb9a('0x6')});if(_[_0xfb9a('0x25')](_0xb4049[_0xfb9a('0x26')])){_0xb4049=_['assign'](_0xb4049,{'transfereechannel':_0xb4049[_0xfb9a('0x27')],'transfereecalleridnum':_0xb4049[_0xfb9a('0x19')],'transfereecalleridname':_0xb4049[_0xfb9a('0x1a')],'transfereeconnectedlinenum':_0xb4049['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xb4049['transfertargetconnectedlinename'],'transfereeaccountcode':_0xb4049[_0xfb9a('0x28')],'transfereecontext':_0xb4049[_0xfb9a('0x29')],'transfereeexten':_0xb4049['transfertargetexten'],'transfereelinkedid':_0xb4049['transfertargetlinkedid']});}writeDB(_0xb4049);}catch(_0x366c30){utils[_0xfb9a('0x2a')](util[_0xfb9a('0x3')]('[%s][transfers][attendedtransfer]',_0xb4049[_0xfb9a('0x16')]),_0x366c30);}}; \ No newline at end of file +var _0x972d=['info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid','lodash','util','./utils'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x972d,0x12a));var _0xd972=function(_0x15a164,_0x4046ab){_0x15a164=_0x15a164-0x0;var _0x35b8ef=_0x972d[_0x15a164];return _0x35b8ef;};'use strict';var _=require(_0xd972('0x0'));var util=require(_0xd972('0x1'));var utils=require(_0xd972('0x2'));function writeDB(_0x241a79){utils[_0xd972('0x3')](util[_0xd972('0x4')](_0xd972('0x5'),_0x241a79[_0xd972('0x6')]==='attended'?_0x241a79[_0xd972('0x7')]:_0x241a79[_0xd972('0x8')],_0x241a79[_0xd972('0x6')]));utils[_0xd972('0x9')]('CreateVoiceTransferReport',_0x241a79);}exports[_0xd972('0xa')]={};exports[_0xd972('0xb')]=function(_0x791559){try{utils['debug'](util[_0xd972('0x4')]('[%s][transfers][blindtransfer]',_0x791559[_0xd972('0x8')]),_0x791559);utils[_0xd972('0x3')](util[_0xd972('0x4')](_0xd972('0xc'),_0x791559[_0xd972('0x8')],_0x791559[_0xd972('0xd')],_0x791559[_0xd972('0xe')],_0x791559[_0xd972('0xf')],_0x791559['transfereecalleridname']));_0x791559['type']=_0xd972('0x10');exports[_0xd972('0xa')][_0x791559[_0xd972('0x11')]]=_0x791559;writeDB(_0x791559);}catch(_0x4cf2e8){utils[_0xd972('0x12')](util['format'](_0xd972('0x13'),_0x791559[_0xd972('0x8')]),_0x4cf2e8);}};exports[_0xd972('0x14')]=function(_0x2bff3e){try{utils[_0xd972('0x15')](util['format'](_0xd972('0x16'),_0x2bff3e['origtransfereruniqueid']),_0x2bff3e);utils[_0xd972('0x3')](util[_0xd972('0x4')](_0xd972('0x17'),_0x2bff3e[_0xd972('0x7')],_0x2bff3e[_0xd972('0x18')],_0x2bff3e[_0xd972('0x19')],_0x2bff3e[_0xd972('0x1a')],_0x2bff3e[_0xd972('0x1b')]));_0x2bff3e=_['assign'](_0x2bff3e,{'transfererchannel':_0x2bff3e[_0xd972('0x1c')],'transferercalleridnum':_0x2bff3e[_0xd972('0x18')],'transferercalleridname':_0x2bff3e[_0xd972('0x19')],'transfererconnectedlinenum':_0x2bff3e[_0xd972('0x1d')],'transfererconnectedlinename':_0x2bff3e[_0xd972('0x1e')],'transfereraccountcode':_0x2bff3e[_0xd972('0x1f')],'transferercontext':_0x2bff3e[_0xd972('0x20')],'transfererexten':_0x2bff3e['secondtransfererexten'],'transfererlinkedid':_0x2bff3e[_0xd972('0x21')],'context':_0x2bff3e['origtransferercontext'],'extension':_0x2bff3e[_0xd972('0x22')],'type':_0xd972('0x23')});if(_[_0xd972('0x24')](_0x2bff3e[_0xd972('0x25')])){_0x2bff3e=_[_0xd972('0x26')](_0x2bff3e,{'transfereechannel':_0x2bff3e[_0xd972('0x27')],'transfereecalleridnum':_0x2bff3e[_0xd972('0x1a')],'transfereecalleridname':_0x2bff3e[_0xd972('0x1b')],'transfereeconnectedlinenum':_0x2bff3e[_0xd972('0x28')],'transfereeconnectedlinename':_0x2bff3e[_0xd972('0x29')],'transfereeaccountcode':_0x2bff3e['transfertargetaccountcode'],'transfereecontext':_0x2bff3e['transfertargetcontext'],'transfereeexten':_0x2bff3e['transfertargetexten'],'transfereelinkedid':_0x2bff3e[_0xd972('0x2a')]});}writeDB(_0x2bff3e);}catch(_0x33aa4b){utils['error'](util[_0xd972('0x4')](_0xd972('0x16'),_0x2bff3e[_0xd972('0x7')]),_0x33aa4b);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 82f641a..a71d1d9 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 _0x9576=['getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','result','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','length'];(function(_0x232f9c,_0x3ae9df){var _0x24bb71=function(_0x4fb958){while(--_0x4fb958){_0x232f9c['push'](_0x232f9c['shift']());}};_0x24bb71(++_0x3ae9df);}(_0x9576,0x182));var _0x6957=function(_0x52b5bc,_0x260b13){_0x52b5bc=_0x52b5bc-0x0;var _0x542fcb=_0x9576[_0x52b5bc];return _0x542fcb;};'use strict';var BPromise=require(_0x6957('0x0'));var jayson=require(_0x6957('0x1'));var moment=require(_0x6957('0x2'));var util=require(_0x6957('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x6957('0x4'))(_0x6957('0x5'));exports[_0x6957('0x6')]=function(_0x10ed80,_0x413fde){logger[_0x6957('0x6')](_0x10ed80,_0x413fde?util[_0x6957('0x7')](_0x413fde,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x6d8af8,_0x3425fe){logger[_0x6957('0x8')](_0x6d8af8,_0x3425fe?util[_0x6957('0x7')](_0x3425fe,{'showHidden':![],'depth':null}):'');};exports[_0x6957('0x9')]=function(_0x3b6461,_0x486361){logger[_0x6957('0x9')](_0x3b6461,_0x486361?util[_0x6957('0x7')](_0x486361,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x55078f,_0x3e0520){return client[_0x6957('0xa')](_0x55078f,{'body':_0x3e0520})[_0x6957('0xb')](function(_0x476167){logger[_0x6957('0x8')](_0x6957('0xc'),_0x55078f,_0x476167?util[_0x6957('0x7')](_0x476167,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5888d6){logger['error'](_0x6957('0xc'),_0x55078f,_0x5888d6?util[_0x6957('0x7')](_0x5888d6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1bf2cc){return client[_0x6957('0xa')](_0x6957('0xd'),{'options':{'raw':!![],'attributes':['id',_0x6957('0xe'),_0x6957('0xf'),'interface'],'where':_0x1bf2cc,'limit':0x1}})['then'](function(_0x4f82cb){logger[_0x6957('0x8')](_0x6957('0x10'),JSON[_0x6957('0x11')](_0x1bf2cc),_0x4f82cb?util[_0x6957('0x7')](_0x4f82cb,{'showHidden':![],'depth':null}):'');return _0x4f82cb['result'][_0x6957('0x12')]?_0x4f82cb['result'][0x0]:null;});}exports[_0x6957('0x13')]=function(_0xabd232){return new BPromise(function(_0x49aa31,_0x2ccd8e){if(_0xabd232){return getUser({'internal':_0xabd232})[_0x6957('0xb')](function(_0x26b577){logger['info'](_0x6957('0x14'),_0xabd232,_0x26b577?_0x6957('0x15'):_0x6957('0x16'));return _0x49aa31(_0x26b577);})[_0x6957('0x17')](function(_0x1ce753){logger[_0x6957('0x9')](_0x6957('0x18'),_0x1ce753?util[_0x6957('0x7')](_0x1ce753,{'showHidden':![],'depth':null}):'');return _0x49aa31(null);});}return _0x49aa31(null);});};exports['getUserByInterface']=function(_0x5ee3f8){return new BPromise(function(_0x37c974,_0xa6dd1f){if(_0x5ee3f8){return getUser({'interface':_0x5ee3f8})[_0x6957('0xb')](function(_0x2569f4){logger[_0x6957('0x6')](_0x6957('0x19'),_0x5ee3f8,_0x2569f4?_0x6957('0x15'):_0x6957('0x16'));return _0x37c974(_0x2569f4);})['catch'](function(_0x2b2dcd){logger[_0x6957('0x9')](_0x6957('0x1a'),_0x2b2dcd?util[_0x6957('0x7')](_0x2b2dcd,{'showHidden':![],'depth':null}):'');return _0x37c974(null);});}return _0x37c974(null);});};exports['getUserByName']=function(_0x4cc749){return new BPromise(function(_0xa1e6af,_0x2a57b6){if(_0x4cc749){return getUser({'name':_0x4cc749})['then'](function(_0x5da47a){logger[_0x6957('0x6')](_0x6957('0x1b'),_0x4cc749,_0x5da47a?_0x6957('0x15'):'notfound');return _0xa1e6af(_0x5da47a);})[_0x6957('0x17')](function(_0x2c24c2){logger[_0x6957('0x9')](_0x6957('0x1c'),_0x2c24c2?util[_0x6957('0x7')](_0x2c24c2,{'showHidden':![],'depth':null}):'');return _0xa1e6af(null);});}return _0xa1e6af(null);});};exports[_0x6957('0x1d')]=function(_0x2d33ef){return new BPromise(function(_0x320e1a,_0x595770){if(_0x2d33ef){return client[_0x6957('0xa')](_0x6957('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x6957('0xf'),_0x6957('0x1f'),_0x6957('0x20'),_0x6957('0x21')],'where':{'name':_0x2d33ef},'limit':0x1}})[_0x6957('0xb')](function(_0xef7f63){logger[_0x6957('0x8')](_0x6957('0x22'),_0x2d33ef,_0xef7f63?util[_0x6957('0x7')](_0xef7f63,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x2d33ef,_0xef7f63?_0x6957('0x15'):_0x6957('0x16'));return _0x320e1a(_0xef7f63[_0x6957('0x23')][_0x6957('0x12')]?_0xef7f63['result'][0x0]:null);})[_0x6957('0x17')](function(_0xf194c6){logger[_0x6957('0x9')]('[utils][getVoiceQueueByName]',_0xf194c6?util['inspect'](_0xf194c6,{'showHidden':![],'depth':null}):'');return _0x320e1a(null);});}return _0x320e1a(null);});};exports[_0x6957('0x24')]=function(_0x27d019,_0x425294){return moment(_0x27d019)['add'](_0x425294,_0x6957('0x25'))[_0x6957('0x26')](_0x6957('0x27'));};exports[_0x6957('0x28')]=function(_0x1ccff8,_0x19da87){return moment(_0x1ccff8)[_0x6957('0x29')](_0x19da87,_0x6957('0x25'))[_0x6957('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6957('0x2a')]=function(_0x298b9b,_0x3358ca){return moment(_0x298b9b)['diff'](moment(_0x3358ca),'seconds');};exports['sumTime']=function(_0x9dc614,_0x59a58e){return parseInt(_0x9dc614,0xa)+parseInt(_0x59a58e,0xa);};exports['now']=function(){return moment()[_0x6957('0x26')](_0x6957('0x27'));};exports['isAfter']=function(_0x4e90f9,_0x2f46e5){if(_0x2f46e5){return moment(_0x4e90f9)[_0x6957('0x2b')](_0x2f46e5);}return!![];};exports[_0x6957('0x2c')]=function(_0x33a182,_0x122c73){if(_0x122c73){return moment(_0x33a182)['isBefore'](_0x122c73);}else if(_0x33a182){return!![];}return![];}; \ No newline at end of file +var _0x9c32=['request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','notfound','[utils][getUserByInterface]','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','format','diffTime','diff','isBefore','jayson/promise','client','http','../../config/logger','info','inspect','debug','error'];(function(_0x3b8f84,_0x4c2a7a){var _0x548540=function(_0x4137d9){while(--_0x4137d9){_0x3b8f84['push'](_0x3b8f84['shift']());}};_0x548540(++_0x4c2a7a);}(_0x9c32,0xbb));var _0x29c3=function(_0x237178,_0x413fe0){_0x237178=_0x237178-0x0;var _0x3e2fd0=_0x9c32[_0x237178];return _0x3e2fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x29c3('0x0'));var moment=require('moment');var util=require('util');var client=jayson[_0x29c3('0x1')][_0x29c3('0x2')]({'port':0x2329});var logger=require(_0x29c3('0x3'))('xdr');exports[_0x29c3('0x4')]=function(_0x402499,_0x40b2bf){logger[_0x29c3('0x4')](_0x402499,_0x40b2bf?util[_0x29c3('0x5')](_0x40b2bf,{'showHidden':![],'depth':null}):'');};exports[_0x29c3('0x6')]=function(_0x373ed0,_0x424874){logger[_0x29c3('0x6')](_0x373ed0,_0x424874?util[_0x29c3('0x5')](_0x424874,{'showHidden':![],'depth':null}):'');};exports[_0x29c3('0x7')]=function(_0xa5dfeb,_0x553e70){logger[_0x29c3('0x7')](_0xa5dfeb,_0x553e70?util[_0x29c3('0x5')](_0x553e70,{'showHidden':![],'depth':null}):'');};exports[_0x29c3('0x8')]=function(_0x590452,_0x22c128){return client[_0x29c3('0x8')](_0x590452,{'body':_0x22c128})[_0x29c3('0x9')](function(_0x53aec3){logger['debug'](_0x29c3('0xa'),_0x590452,_0x53aec3?util['inspect'](_0x53aec3,{'showHidden':![],'depth':null}):'');})[_0x29c3('0xb')](function(_0x5f157f){logger[_0x29c3('0x7')](_0x29c3('0xa'),_0x590452,_0x5f157f?util[_0x29c3('0x5')](_0x5f157f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x486a10){return client[_0x29c3('0x8')](_0x29c3('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x29c3('0xd'),_0x29c3('0xe')],'where':_0x486a10,'limit':0x1}})[_0x29c3('0x9')](function(_0x9ee76f){logger[_0x29c3('0x6')](_0x29c3('0xf'),JSON[_0x29c3('0x10')](_0x486a10),_0x9ee76f?util['inspect'](_0x9ee76f,{'showHidden':![],'depth':null}):'');return _0x9ee76f[_0x29c3('0x11')]['length']?_0x9ee76f[_0x29c3('0x11')][0x0]:null;});}exports[_0x29c3('0x12')]=function(_0x531088){return new BPromise(function(_0x143f3c,_0x284b80){if(_0x531088){return getUser({'internal':_0x531088})[_0x29c3('0x9')](function(_0x3f8a9e){logger[_0x29c3('0x4')](_0x29c3('0x13'),_0x531088,_0x3f8a9e?_0x29c3('0x14'):'notfound');return _0x143f3c(_0x3f8a9e);})[_0x29c3('0xb')](function(_0x37a6e8){logger[_0x29c3('0x7')](_0x29c3('0x15'),_0x37a6e8?util[_0x29c3('0x5')](_0x37a6e8,{'showHidden':![],'depth':null}):'');return _0x143f3c(null);});}return _0x143f3c(null);});};exports['getUserByInterface']=function(_0x9c29c4){return new BPromise(function(_0x4183bb,_0x308f88){if(_0x9c29c4){return getUser({'interface':_0x9c29c4})[_0x29c3('0x9')](function(_0x507778){logger[_0x29c3('0x4')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x9c29c4,_0x507778?_0x29c3('0x14'):_0x29c3('0x16'));return _0x4183bb(_0x507778);})['catch'](function(_0x369c8f){logger['error'](_0x29c3('0x17'),_0x369c8f?util['inspect'](_0x369c8f,{'showHidden':![],'depth':null}):'');return _0x4183bb(null);});}return _0x4183bb(null);});};exports['getUserByName']=function(_0x3d10f1){return new BPromise(function(_0x5684c8,_0x4d45e6){if(_0x3d10f1){return getUser({'name':_0x3d10f1})[_0x29c3('0x9')](function(_0xa9a7bd){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x3d10f1,_0xa9a7bd?_0x29c3('0x14'):_0x29c3('0x16'));return _0x5684c8(_0xa9a7bd);})[_0x29c3('0xb')](function(_0x511341){logger['error']('[utils][getUserByName]',_0x511341?util[_0x29c3('0x5')](_0x511341,{'showHidden':![],'depth':null}):'');return _0x5684c8(null);});}return _0x5684c8(null);});};exports['getVoiceQueueByName']=function(_0x5b6044){return new BPromise(function(_0x69ae6f,_0x3aedf3){if(_0x5b6044){return client['request'](_0x29c3('0x18'),{'options':{'raw':!![],'attributes':['id',_0x29c3('0xd'),_0x29c3('0x19'),_0x29c3('0x1a'),'acwTimeout'],'where':{'name':_0x5b6044},'limit':0x1}})['then'](function(_0x490200){logger[_0x29c3('0x6')](_0x29c3('0x1b'),_0x5b6044,_0x490200?util[_0x29c3('0x5')](_0x490200,{'showHidden':![],'depth':null}):'');logger[_0x29c3('0x4')](_0x29c3('0x1c'),_0x5b6044,_0x490200?'found':_0x29c3('0x16'));return _0x69ae6f(_0x490200[_0x29c3('0x11')][_0x29c3('0x1d')]?_0x490200[_0x29c3('0x11')][0x0]:null);})[_0x29c3('0xb')](function(_0x54e50f){logger[_0x29c3('0x7')](_0x29c3('0x1e'),_0x54e50f?util[_0x29c3('0x5')](_0x54e50f,{'showHidden':![],'depth':null}):'');return _0x69ae6f(null);});}return _0x69ae6f(null);});};exports[_0x29c3('0x1f')]=function(_0x166400,_0x218626){return moment(_0x166400)[_0x29c3('0x20')](_0x218626,_0x29c3('0x21'))['format'](_0x29c3('0x22'));};exports['subtractTime']=function(_0x1890dd,_0x5c3266){return moment(_0x1890dd)['subtract'](_0x5c3266,'seconds')[_0x29c3('0x23')](_0x29c3('0x22'));};exports[_0x29c3('0x24')]=function(_0x1f7ba2,_0x443b42){return moment(_0x1f7ba2)[_0x29c3('0x25')](moment(_0x443b42),_0x29c3('0x21'));};exports['sumTime']=function(_0x18965c,_0x3b45d0){return parseInt(_0x18965c,0xa)+parseInt(_0x3b45d0,0xa);};exports['now']=function(){return moment()['format'](_0x29c3('0x22'));};exports['isAfter']=function(_0x10fa5a,_0x28e2de){if(_0x28e2de){return moment(_0x10fa5a)['isAfter'](_0x28e2de);}return!![];};exports[_0x29c3('0x26')]=function(_0x1d0b7c,_0x4b2183){if(_0x4b2183){return moment(_0x1d0b7c)[_0x29c3('0x26')](_0x4b2183);}else if(_0x1d0b7c){return!![];}return![];}; \ No newline at end of file -- 1.7.1